From d49944cc2e95578bfbd15d79d46896f71a145821 Mon Sep 17 00:00:00 2001 From: support Date: Wed, 23 Nov 2022 17:09:48 +0000 Subject: [PATCH] Built motion from commit d5e4af8c.|2.6.23 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/components/realtime/queues.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/models/action.js | 2 +- server/services/ami/dialer/models/agentComplete.js | 2 +- server/services/ami/dialer/models/final.js | 2 +- server/services/ami/dialer/models/hangup.js | 2 +- server/services/ami/dialer/models/history.js | 2 +- .../ami/dialer/models/queueCallerAbandon.js | 2 +- server/services/ami/dialer/utils/hopper.js | 2 +- server/services/ami/dialer/utils/index.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/voiceQueueSummary.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/realtime/utils.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/interval.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/iftime.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- server/utils/update-app-config.js | 2 +- 1203 files changed, 1203 insertions(+), 1203 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 4db650d..3cd8df5 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-23T16:40:39.630Z", + "time": "2022-11-23T17:02:47.728Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 143485d..d71d500 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-23T16:40:39.630Z", + "time": "2022-11-23T17:02:47.728Z", "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 d024ad2..cf19f3b 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 _0x5845=['bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','STRING','integration','jscripty','browser'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5845,0x80));var _0x5584=function(_0x557cc0,_0x581d23){_0x557cc0=_0x557cc0-0x0;var _0x48a33e=_0x5845[_0x557cc0];return _0x48a33e;};'use strict';var Sequelize=require(_0x5584('0x0'));module[_0x5584('0x1')]={'name':{'type':Sequelize[_0x5584('0x2')],'get':function(_0x16e3cb){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x5584('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x5584('0x4'),'motionbar',_0x5584('0x5'),'urlForward',_0x5584('0x6'),_0x5584('0x7'),'script']],'msg':_0x5584('0x8')}},'comment':_0x5584('0x8')},'data1':{'type':Sequelize[_0x5584('0x3')](0x1000),'comment':_0x5584('0x9')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x5584('0xa')},'data3':{'type':Sequelize[_0x5584('0x3')](0x1000),'comment':_0x5584('0xb')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x5584('0xc')},'data5':{'type':Sequelize[_0x5584('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x5584('0x3')],'comments':_0x5584('0xd')},'data7':{'type':Sequelize[_0x5584('0xe')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x9973=['urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x26b91a,_0x4b63a1){var _0x33d215=function(_0x2238a0){while(--_0x2238a0){_0x26b91a['push'](_0x26b91a['shift']());}};_0x33d215(++_0x4b63a1);}(_0x9973,0x157));var _0x3997=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9973[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0x3997('0x0')]={'name':{'type':Sequelize[_0x3997('0x1')],'get':function(_0x575ebe){return this[_0x3997('0x2')](_0x3997('0x3'));}},'action':{'type':Sequelize[_0x3997('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3997('0x5'),_0x3997('0x6'),_0x3997('0x7'),_0x3997('0x8'),'urlForward','browser',_0x3997('0x9'),_0x3997('0xa')]],'msg':_0x3997('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x3997('0x4')](0x1000),'comment':_0x3997('0xc')},'data3':{'type':Sequelize[_0x3997('0x4')](0x1000),'comment':_0x3997('0xd')},'data4':{'type':Sequelize[_0x3997('0x4')](0x1000),'comments':_0x3997('0xe')},'data5':{'type':Sequelize[_0x3997('0x4')](0x1000),'comments':_0x3997('0xf')},'data6':{'type':Sequelize[_0x3997('0x4')],'comments':_0x3997('0x10')},'data7':{'type':Sequelize[_0x3997('0x11')],'comments':_0x3997('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index bee383b..0c769f3 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 _0x3d87=['mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0x3d87,0x82));var _0x73d8=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x3d87[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0x73d8('0x0'));var rimraf=require(_0x73d8('0x1'));var zipdir=require(_0x73d8('0x2'));var jsonpatch=require(_0x73d8('0x3'));var rp=require('request-promise');var moment=require(_0x73d8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x73d8('0x5'));var util=require('util');var path=require('path');var sox=require(_0x73d8('0x6'));var csv=require(_0x73d8('0x7'));var ejs=require(_0x73d8('0x8'));var fs=require('fs');var fs_extra=require(_0x73d8('0x9'));var _=require(_0x73d8('0xa'));var squel=require('squel');var crypto=require(_0x73d8('0xb'));var jsforce=require(_0x73d8('0xc'));var deskjs=require(_0x73d8('0xd'));var toCsv=require(_0x73d8('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x73d8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x73d8('0xf'));var as=require(_0x73d8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x73d8('0x11'))(_0x73d8('0x12'));var utils=require(_0x73d8('0x13'));var config=require(_0x73d8('0x14'));var licenseUtil=require(_0x73d8('0x15'));var db=require(_0x73d8('0x16'))['db'];function respondWithStatusCode(_0x5713f2,_0x20248c){_0x20248c=_0x20248c||0xcc;return function(_0x2d7bf1){if(_0x2d7bf1){return _0x5713f2[_0x73d8('0x17')](_0x20248c);}return _0x5713f2[_0x73d8('0x18')](_0x20248c)[_0x73d8('0x19')]();};}function respondWithResult(_0x3c0d07,_0x26faa1){_0x26faa1=_0x26faa1||0xc8;return function(_0x32a5c1){if(_0x32a5c1){return _0x3c0d07[_0x73d8('0x18')](_0x26faa1)[_0x73d8('0x1a')](_0x32a5c1);}};}function respondWithFilteredResult(_0x514d4b,_0x5b8249){return function(_0x35c8e3){if(_0x35c8e3){var _0x55f9f5=typeof _0x5b8249[_0x73d8('0x1b')]===_0x73d8('0x1c')&&typeof _0x5b8249['limit']===_0x73d8('0x1c');var _0x473ebf=_0x35c8e3[_0x73d8('0x1d')];var _0x37a9c8=_0x55f9f5?0x0:_0x5b8249[_0x73d8('0x1b')];var _0x4cae5d=_0x55f9f5?_0x35c8e3[_0x73d8('0x1d')]:_0x5b8249['offset']+_0x5b8249['limit'];var _0x2fc206;if(_0x4cae5d>=_0x473ebf){_0x4cae5d=_0x473ebf;_0x2fc206=0xc8;}else{_0x2fc206=0xce;}_0x514d4b['status'](_0x2fc206);return _0x514d4b['set'](_0x73d8('0x1e'),_0x37a9c8+'-'+_0x4cae5d+'/'+_0x473ebf)[_0x73d8('0x1a')](_0x35c8e3);}return null;};}function patchUpdates(_0x280619){return function(_0x1f7a36){try{jsonpatch[_0x73d8('0x1f')](_0x1f7a36,_0x280619,!![]);}catch(_0x4f7741){return BPromise[_0x73d8('0x20')](_0x4f7741);}return _0x1f7a36[_0x73d8('0x21')]();};}function saveUpdates(_0x25e36a,_0x5096b6){return function(_0x53014e){if(_0x53014e){return _0x53014e[_0x73d8('0x22')](_0x25e36a)[_0x73d8('0x23')](function(_0x3c0fa3){return _0x3c0fa3;});}return null;};}function removeEntity(_0x443ab9,_0x51c8a0){return function(_0x881aab){if(_0x881aab){return _0x881aab[_0x73d8('0x24')]()[_0x73d8('0x23')](function(){_0x443ab9['status'](0xcc)[_0x73d8('0x19')]();});}};}function handleEntityNotFound(_0x5a1c1b,_0x20040b){return function(_0x3e9157){if(!_0x3e9157){_0x5a1c1b[_0x73d8('0x17')](0x194);}return _0x3e9157;};}function handleError(_0x43135f,_0x37a44f){_0x37a44f=_0x37a44f||0x1f4;return function(_0x3aa69e){logger[_0x73d8('0x25')](_0x3aa69e[_0x73d8('0x26')]);if(_0x3aa69e[_0x73d8('0x27')]){delete _0x3aa69e[_0x73d8('0x27')];}_0x43135f[_0x73d8('0x18')](_0x37a44f)[_0x73d8('0x28')](_0x3aa69e);};}exports[_0x73d8('0x22')]=function(_0x2f9f89,_0x1cef07){if(_0x2f9f89[_0x73d8('0x29')]['id']){delete _0x2f9f89['body']['id'];}return db[_0x73d8('0x2a')][_0x73d8('0x2b')]({'where':{'id':_0x2f9f89[_0x73d8('0x2c')]['id']}})[_0x73d8('0x23')](handleEntityNotFound(_0x1cef07,null))[_0x73d8('0x23')](saveUpdates(_0x2f9f89[_0x73d8('0x29')],null))['then'](respondWithResult(_0x1cef07,null))['catch'](handleError(_0x1cef07,null));};exports[_0x73d8('0x24')]=function(_0x400380,_0x3dad6c){return db[_0x73d8('0x2a')][_0x73d8('0x2b')]({'where':{'id':_0x400380[_0x73d8('0x2c')]['id']}})[_0x73d8('0x23')](handleEntityNotFound(_0x3dad6c,null))[_0x73d8('0x23')](removeEntity(_0x3dad6c,null))['catch'](handleError(_0x3dad6c,null));}; \ No newline at end of file +var _0x0bfb=['mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','count','offset','status','set','apply','reject','save','update','destroy','end','error','stack','send','body','Action','find','params','then','catch','eml-format','rimraf','zip-dir','bluebird'];(function(_0x4887a3,_0x12f2e1){var _0x92d39e=function(_0x49ccd0){while(--_0x49ccd0){_0x4887a3['push'](_0x4887a3['shift']());}};_0x92d39e(++_0x12f2e1);}(_0x0bfb,0xe7));var _0xb0bf=function(_0x3be014,_0xeba67e){_0x3be014=_0x3be014-0x0;var _0x18630f=_0x0bfb[_0x3be014];return _0x18630f;};'use strict';var emlformat=require(_0xb0bf('0x0'));var rimraf=require(_0xb0bf('0x1'));var zipdir=require(_0xb0bf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb0bf('0x3'));var Mustache=require(_0xb0bf('0x4'));var util=require('util');var path=require(_0xb0bf('0x5'));var sox=require(_0xb0bf('0x6'));var csv=require(_0xb0bf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0bf('0x8'));var _=require(_0xb0bf('0x9'));var squel=require(_0xb0bf('0xa'));var crypto=require(_0xb0bf('0xb'));var jsforce=require(_0xb0bf('0xc'));var deskjs=require(_0xb0bf('0xd'));var toCsv=require(_0xb0bf('0x7'));var querystring=require(_0xb0bf('0xe'));var Papa=require('papaparse');var Redis=require(_0xb0bf('0xf'));var authService=require(_0xb0bf('0x10'));var qs=require(_0xb0bf('0x11'));var as=require(_0xb0bf('0x12'));var hardwareService=require(_0xb0bf('0x13'));var logger=require(_0xb0bf('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb0bf('0x15'));var licenseUtil=require(_0xb0bf('0x16'));var db=require(_0xb0bf('0x17'))['db'];function respondWithStatusCode(_0x1993dd,_0x403a31){_0x403a31=_0x403a31||0xcc;return function(_0x385f52){if(_0x385f52){return _0x1993dd[_0xb0bf('0x18')](_0x403a31);}return _0x1993dd['status'](_0x403a31)['end']();};}function respondWithResult(_0x1c0dbb,_0x52130a){_0x52130a=_0x52130a||0xc8;return function(_0x3f1cc6){if(_0x3f1cc6){return _0x1c0dbb['status'](_0x52130a)[_0xb0bf('0x19')](_0x3f1cc6);}};}function respondWithFilteredResult(_0x22c64b,_0x39c8b7){return function(_0xa23bc0){if(_0xa23bc0){var _0x5b331d=typeof _0x39c8b7['offset']===_0xb0bf('0x1a')&&typeof _0x39c8b7[_0xb0bf('0x1b')]===_0xb0bf('0x1a');var _0x5e7723=_0xa23bc0[_0xb0bf('0x1c')];var _0x27718f=_0x5b331d?0x0:_0x39c8b7[_0xb0bf('0x1d')];var _0x1809cd=_0x5b331d?_0xa23bc0['count']:_0x39c8b7[_0xb0bf('0x1d')]+_0x39c8b7[_0xb0bf('0x1b')];var _0x50fc0e;if(_0x1809cd>=_0x5e7723){_0x1809cd=_0x5e7723;_0x50fc0e=0xc8;}else{_0x50fc0e=0xce;}_0x22c64b[_0xb0bf('0x1e')](_0x50fc0e);return _0x22c64b[_0xb0bf('0x1f')]('Content-Range',_0x27718f+'-'+_0x1809cd+'/'+_0x5e7723)[_0xb0bf('0x19')](_0xa23bc0);}return null;};}function patchUpdates(_0x399a63){return function(_0xa6d623){try{jsonpatch[_0xb0bf('0x20')](_0xa6d623,_0x399a63,!![]);}catch(_0x3b1776){return BPromise[_0xb0bf('0x21')](_0x3b1776);}return _0xa6d623[_0xb0bf('0x22')]();};}function saveUpdates(_0x1c8c92,_0xf2997f){return function(_0x4f5b8f){if(_0x4f5b8f){return _0x4f5b8f[_0xb0bf('0x23')](_0x1c8c92)['then'](function(_0x23c44e){return _0x23c44e;});}return null;};}function removeEntity(_0x58ec1c,_0x3b7ff5){return function(_0x2e5c64){if(_0x2e5c64){return _0x2e5c64[_0xb0bf('0x24')]()['then'](function(){_0x58ec1c['status'](0xcc)[_0xb0bf('0x25')]();});}};}function handleEntityNotFound(_0x58ef1f,_0x257006){return function(_0x3fec7b){if(!_0x3fec7b){_0x58ef1f[_0xb0bf('0x18')](0x194);}return _0x3fec7b;};}function handleError(_0x189856,_0x19ffd9){_0x19ffd9=_0x19ffd9||0x1f4;return function(_0x110b26){logger[_0xb0bf('0x26')](_0x110b26[_0xb0bf('0x27')]);if(_0x110b26['name']){delete _0x110b26['name'];}_0x189856[_0xb0bf('0x1e')](_0x19ffd9)[_0xb0bf('0x28')](_0x110b26);};}exports['update']=function(_0x1fce80,_0x42e864){if(_0x1fce80[_0xb0bf('0x29')]['id']){delete _0x1fce80[_0xb0bf('0x29')]['id'];}return db[_0xb0bf('0x2a')][_0xb0bf('0x2b')]({'where':{'id':_0x1fce80[_0xb0bf('0x2c')]['id']}})[_0xb0bf('0x2d')](handleEntityNotFound(_0x42e864,null))[_0xb0bf('0x2d')](saveUpdates(_0x1fce80[_0xb0bf('0x29')],null))[_0xb0bf('0x2d')](respondWithResult(_0x42e864,null))['catch'](handleError(_0x42e864,null));};exports['destroy']=function(_0x45c7e3,_0x13d176){return db['Action']['find']({'where':{'id':_0x45c7e3[_0xb0bf('0x2c')]['id']}})[_0xb0bf('0x2d')](handleEntityNotFound(_0x13d176,null))[_0xb0bf('0x2d')](removeEntity(_0x13d176,null))[_0xb0bf('0x2e')](handleError(_0x13d176,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 4d7dcce..d141fb6 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 _0x91b6=['util','api','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash'];(function(_0x5414e9,_0x2c64f9){var _0x836198=function(_0x37f65f){while(--_0x37f65f){_0x5414e9['push'](_0x5414e9['shift']());}};_0x836198(++_0x2c64f9);}(_0x91b6,0x18b));var _0x691b=function(_0x6cf760,_0x1616c8){_0x6cf760=_0x6cf760-0x0;var _0x2c0ff0=_0x91b6[_0x6cf760];return _0x2c0ff0;};'use strict';var _=require(_0x691b('0x0'));var util=require(_0x691b('0x1'));var logger=require('../../config/logger')(_0x691b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x691b('0x3'));var fs=require('fs');var path=require(_0x691b('0x4'));var rimraf=require(_0x691b('0x5'));var config=require(_0x691b('0x6'));var attributes=require(_0x691b('0x7'));module[_0x691b('0x8')]=function(_0x585420,_0x5586b9){return _0x585420[_0x691b('0x9')](_0x691b('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61f1=['rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','util','api','moment','bluebird','request-promise','path'];(function(_0x19590c,_0x969a2f){var _0x4038ae=function(_0xbc63f2){while(--_0xbc63f2){_0x19590c['push'](_0x19590c['shift']());}};_0x4038ae(++_0x969a2f);}(_0x61f1,0xde));var _0x161f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x61f1[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x161f('0x0'));var logger=require('../../config/logger')(_0x161f('0x1'));var moment=require(_0x161f('0x2'));var BPromise=require(_0x161f('0x3'));var rp=require(_0x161f('0x4'));var fs=require('fs');var path=require(_0x161f('0x5'));var rimraf=require(_0x161f('0x6'));var config=require(_0x161f('0x7'));var attributes=require(_0x161f('0x8'));module[_0x161f('0x9')]=function(_0x10b7c7,_0xd9ef96){return _0x10b7c7['define'](_0x161f('0xa'),attributes,{'tableName':_0x161f('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 37eaa84..d73c1b5 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1648d9,_0x48957b){var _0x4dd649=function(_0xcdfc77){while(--_0xcdfc77){_0x1648d9['push'](_0x1648d9['shift']());}};_0x4dd649(++_0x48957b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc4aa[_0x5d6456];return _0x4d66c1;};'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')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x995dff,_0x349b8e){var _0x403beb=function(_0x1adc18){while(--_0x1adc18){_0x995dff['push'](_0x995dff['shift']());}};_0x403beb(++_0x349b8e);}(_0x5fab,0x177));var _0xb5fa=function(_0x3e35e9,_0x343705){_0x3e35e9=_0x3e35e9-0x0;var _0x5a9829=_0x5fab[_0x3e35e9];return _0x5a9829;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index f66413e..dd62201 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 _0x7163=['../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x30000b,_0xa62fbc){var _0x23da32=function(_0x228798){while(--_0x228798){_0x30000b['push'](_0x30000b['shift']());}};_0x23da32(++_0xa62fbc);}(_0x7163,0x104));var _0x3716=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0x7163[_0x2ff762];return _0x158b02;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3716('0x0'));var timeout=require(_0x3716('0x1'));var express=require(_0x3716('0x2'));var router=express['Router']();var fs_extra=require(_0x3716('0x3'));var auth=require(_0x3716('0x4'));var interaction=require(_0x3716('0x5'));var config=require(_0x3716('0x6'));var controller=require(_0x3716('0x7'));router[_0x3716('0x8')](_0x3716('0x9'),auth['isAuthenticated'](),controller[_0x3716('0xa')]);router[_0x3716('0xb')]('/:id',auth[_0x3716('0xc')](),controller['destroy']);module[_0x3716('0xd')]=router; \ No newline at end of file +var _0xbdb7=['update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','isAuthenticated'];(function(_0x5bc613,_0x56c8bd){var _0x2f5505=function(_0x35a246){while(--_0x35a246){_0x5bc613['push'](_0x5bc613['shift']());}};_0x2f5505(++_0x56c8bd);}(_0xbdb7,0xf4));var _0x7bdb=function(_0x3252b1,_0x54e32d){_0x3252b1=_0x3252b1-0x0;var _0x5f189d=_0xbdb7[_0x3252b1];return _0x5f189d;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7bdb('0x8'));var controller=require(_0x7bdb('0x9'));router[_0x7bdb('0xa')]('/:id',auth[_0x7bdb('0xb')](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xd')](_0x7bdb('0xe'),auth[_0x7bdb('0xb')](),controller[_0x7bdb('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 65b9367..15814a1 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 _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x8dd1be,_0x18e210){var _0x1216d2=function(_0xa57c03){while(--_0xa57c03){_0x8dd1be['push'](_0x8dd1be['shift']());}};_0x1216d2(++_0x18e210);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3cdaf4,_0x505e4f){_0x3cdaf4=_0x3cdaf4-0x0;var _0x20d430=_0x9c5a[_0x3cdaf4];return _0x20d430;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x687b=['STRING','TEXT','sequelize','exports'];(function(_0x5d4818,_0x3ccae2){var _0x578a9c=function(_0x530284){while(--_0x530284){_0x5d4818['push'](_0x5d4818['shift']());}};_0x578a9c(++_0x3ccae2);}(_0x687b,0x14a));var _0xb687=function(_0x2ac980,_0x33829d){_0x2ac980=_0x2ac980-0x0;var _0x53974d=_0x687b[_0x2ac980];return _0x53974d;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb687('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xb687('0x3')]},'joins':{'type':Sequelize[_0xb687('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index ec40e8d..65f9f69 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 _0x12b8=['includeAll','include','findAll','params','rawAttributes','find','catch','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','operator','Please\x20insert\x20at\x20least\x20one\x20field','select','metric','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','send','index','map','AnalyticCustomReport','fieldName','type','key','keys','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','name','merge','options'];(function(_0x4906c8,_0x41119e){var _0x1a0b9d=function(_0x124f3e){while(--_0x124f3e){_0x4906c8['push'](_0x4906c8['shift']());}};_0x1a0b9d(++_0x41119e);}(_0x12b8,0x1b5));var _0x812b=function(_0x15fe68,_0xddc145){_0x15fe68=_0x15fe68-0x0;var _0x1d144c=_0x12b8[_0x15fe68];return _0x1d144c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x812b('0x0'));var jsonpatch=require(_0x812b('0x1'));var rp=require(_0x812b('0x2'));var moment=require(_0x812b('0x3'));var BPromise=require(_0x812b('0x4'));var Mustache=require(_0x812b('0x5'));var util=require(_0x812b('0x6'));var path=require(_0x812b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x812b('0x8'));var fs=require('fs');var fs_extra=require(_0x812b('0x9'));var _=require(_0x812b('0xa'));var squel=require(_0x812b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x812b('0xc'));var querystring=require(_0x812b('0xd'));var Papa=require(_0x812b('0xe'));var Redis=require(_0x812b('0xf'));var authService=require(_0x812b('0x10'));var qs=require(_0x812b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x812b('0x12'));var logger=require(_0x812b('0x13'))(_0x812b('0x14'));var utils=require(_0x812b('0x15'));var config=require(_0x812b('0x16'));var licenseUtil=require(_0x812b('0x17'));var db=require(_0x812b('0x18'))['db'];var dbH=require(_0x812b('0x18'))[_0x812b('0x19')];function respondWithStatusCode(_0x4708d7,_0x3a893e){_0x3a893e=_0x3a893e||0xcc;return function(_0xc4d62){if(_0xc4d62){return _0x4708d7[_0x812b('0x1a')](_0x3a893e);}return _0x4708d7[_0x812b('0x1b')](_0x3a893e)[_0x812b('0x1c')]();};}function respondWithResult(_0x3d3eff,_0x18ba01){_0x18ba01=_0x18ba01||0xc8;return function(_0x592a83){if(_0x592a83){return _0x3d3eff[_0x812b('0x1b')](_0x18ba01)[_0x812b('0x1d')](_0x592a83);}};}function respondWithFilteredResult(_0x161f62,_0x3303b2){return function(_0xef9f3f){if(_0xef9f3f){var _0x13faf9=typeof _0x3303b2['offset']===_0x812b('0x1e')&&typeof _0x3303b2['limit']===_0x812b('0x1e');var _0x26d85f=_0xef9f3f[_0x812b('0x1f')];var _0x257aee=_0x13faf9?0x0:_0x3303b2[_0x812b('0x20')];var _0x2a042f=_0x13faf9?_0xef9f3f[_0x812b('0x1f')]:_0x3303b2[_0x812b('0x20')]+_0x3303b2[_0x812b('0x21')];var _0x2489b6;if(_0x2a042f>=_0x26d85f){_0x2a042f=_0x26d85f;_0x2489b6=0xc8;}else{_0x2489b6=0xce;}_0x161f62['status'](_0x2489b6);return _0x161f62[_0x812b('0x22')](_0x812b('0x23'),_0x257aee+'-'+_0x2a042f+'/'+_0x26d85f)[_0x812b('0x1d')](_0xef9f3f);}return null;};}function patchUpdates(_0x1f574f){return function(_0x1e1ffc){try{jsonpatch[_0x812b('0x24')](_0x1e1ffc,_0x1f574f,!![]);}catch(_0x45ee2d){return BPromise[_0x812b('0x25')](_0x45ee2d);}return _0x1e1ffc[_0x812b('0x26')]();};}function saveUpdates(_0xbb9bac,_0x39601b){return function(_0x586fe3){if(_0x586fe3){return _0x586fe3[_0x812b('0x27')](_0xbb9bac)[_0x812b('0x28')](function(_0x44edc5){return _0x44edc5;});}return null;};}function removeEntity(_0x3ad4a9,_0x5be22f){return function(_0x234178){if(_0x234178){return _0x234178[_0x812b('0x29')]()['then'](function(){var _0x4c3610=_0x234178[_0x812b('0x2a')]({'plain':!![]});var _0x417fed=_0x812b('0x2b');return db['UserProfileResource'][_0x812b('0x29')]({'where':{'type':_0x417fed,'resourceId':_0x4c3610['id']}})[_0x812b('0x28')](function(){return _0x234178;});})[_0x812b('0x28')](function(){_0x3ad4a9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x354038,_0x160a37){return function(_0x1c9dea){if(!_0x1c9dea){_0x354038[_0x812b('0x1a')](0x194);}return _0x1c9dea;};}function handleError(_0x297b77,_0x171585){_0x171585=_0x171585||0x1f4;return function(_0x1fd2f2){logger[_0x812b('0x2c')](_0x1fd2f2[_0x812b('0x2d')]);if(_0x1fd2f2['name']){delete _0x1fd2f2['name'];}_0x297b77[_0x812b('0x1b')](_0x171585)[_0x812b('0x2e')](_0x1fd2f2);};}exports[_0x812b('0x2f')]=function(_0x31adce,_0xe359be){var _0x1690ce={},_0x16a0fd={},_0x156fef={'count':0x0,'rows':[]};var _0x42e44a=_[_0x812b('0x30')](db[_0x812b('0x31')]['rawAttributes'],function(_0x1b7194){return{'name':_0x1b7194[_0x812b('0x32')],'type':_0x1b7194[_0x812b('0x33')][_0x812b('0x34')]};});_0x16a0fd['model']=_[_0x812b('0x30')](_0x42e44a,'name');_0x16a0fd['query']=_[_0x812b('0x35')](_0x31adce['query']);_0x16a0fd['filters']=_[_0x812b('0x36')](_0x16a0fd[_0x812b('0x37')],_0x16a0fd[_0x812b('0x38')]);_0x1690ce['attributes']=_[_0x812b('0x36')](_0x16a0fd[_0x812b('0x37')],qs[_0x812b('0x39')](_0x31adce[_0x812b('0x38')][_0x812b('0x39')]));_0x1690ce[_0x812b('0x3a')]=_0x1690ce[_0x812b('0x3a')][_0x812b('0x3b')]?_0x1690ce[_0x812b('0x3a')]:_0x16a0fd[_0x812b('0x37')];if(!_0x31adce[_0x812b('0x38')][_0x812b('0x3c')](_0x812b('0x3d'))){_0x1690ce[_0x812b('0x21')]=qs['limit'](_0x31adce[_0x812b('0x38')][_0x812b('0x21')]);_0x1690ce['offset']=qs['offset'](_0x31adce[_0x812b('0x38')][_0x812b('0x20')]);}_0x1690ce[_0x812b('0x3e')]=qs[_0x812b('0x3f')](_0x31adce[_0x812b('0x38')]['sort']);_0x1690ce[_0x812b('0x40')]=qs[_0x812b('0x41')](_[_0x812b('0x42')](_0x31adce[_0x812b('0x38')],_0x16a0fd[_0x812b('0x41')]),_0x42e44a);if(_0x31adce[_0x812b('0x38')]['filter']){_0x1690ce[_0x812b('0x40')]=_['merge'](_0x1690ce[_0x812b('0x40')],{'$or':_[_0x812b('0x30')](_0x42e44a,function(_0x17a50a){if(_0x17a50a[_0x812b('0x33')]!=='VIRTUAL'){var _0x4debad={};_0x4debad[_0x17a50a[_0x812b('0x43')]]={'$like':'%'+_0x31adce[_0x812b('0x38')]['filter']+'%'};return _0x4debad;}})});}_0x1690ce=_[_0x812b('0x44')]({},_0x1690ce,_0x31adce[_0x812b('0x45')]);var _0x21723b={'where':_0x1690ce['where']};return db[_0x812b('0x31')][_0x812b('0x1f')](_0x21723b)[_0x812b('0x28')](function(_0x40c6fe){_0x156fef[_0x812b('0x1f')]=_0x40c6fe;if(_0x31adce['query'][_0x812b('0x46')]){_0x1690ce[_0x812b('0x47')]=[{'all':!![]}];}return db[_0x812b('0x31')][_0x812b('0x48')](_0x1690ce);})['then'](function(_0x20d429){_0x156fef['rows']=_0x20d429;return _0x156fef;})[_0x812b('0x28')](respondWithFilteredResult(_0xe359be,_0x1690ce))['catch'](handleError(_0xe359be,null));};exports['show']=function(_0x2713a0,_0x5b2cb2){var _0x482723={'raw':![],'where':{'id':_0x2713a0[_0x812b('0x49')]['id']}},_0x2087b5={};_0x2087b5[_0x812b('0x37')]=_[_0x812b('0x35')](db['AnalyticCustomReport'][_0x812b('0x4a')]);_0x2087b5[_0x812b('0x38')]=_[_0x812b('0x35')](_0x2713a0[_0x812b('0x38')]);_0x2087b5[_0x812b('0x41')]=_['intersection'](_0x2087b5[_0x812b('0x37')],_0x2087b5['query']);_0x482723[_0x812b('0x3a')]=_[_0x812b('0x36')](_0x2087b5[_0x812b('0x37')],qs[_0x812b('0x39')](_0x2713a0['query'][_0x812b('0x39')]));_0x482723[_0x812b('0x3a')]=_0x482723[_0x812b('0x3a')]['length']?_0x482723[_0x812b('0x3a')]:_0x2087b5[_0x812b('0x37')];if(_0x2713a0[_0x812b('0x38')]['includeAll']){_0x482723[_0x812b('0x47')]=[{'all':!![]}];}_0x482723=_['merge']({},_0x482723,_0x2713a0[_0x812b('0x45')]);return db['AnalyticCustomReport'][_0x812b('0x4b')](_0x482723)[_0x812b('0x28')](handleEntityNotFound(_0x5b2cb2,null))[_0x812b('0x28')](respondWithResult(_0x5b2cb2,null))[_0x812b('0x4c')](handleError(_0x5b2cb2,null));};exports[_0x812b('0x4d')]=function(_0x3bd80f,_0x12badf){return db[_0x812b('0x31')][_0x812b('0x4d')](_0x3bd80f[_0x812b('0x4e')],{})[_0x812b('0x28')](function(_0x5eae6f){var _0x2fce5b=_0x3bd80f[_0x812b('0x4f')]['get']({'plain':!![]});if(!_0x2fce5b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fce5b[_0x812b('0x50')]===_0x812b('0x4f')){var _0x36e362=_0x5eae6f[_0x812b('0x2a')]({'plain':!![]});var _0x59620b=_0x812b('0x51');return db[_0x812b('0x52')][_0x812b('0x4b')]({'where':{'name':_0x59620b,'userProfileId':_0x2fce5b[_0x812b('0x53')]},'raw':!![]})[_0x812b('0x28')](function(_0x40fd8b){if(_0x40fd8b&&_0x40fd8b[_0x812b('0x54')]===0x0){return db[_0x812b('0x55')][_0x812b('0x4d')]({'name':_0x36e362[_0x812b('0x43')],'resourceId':_0x36e362['id'],'type':_0x812b('0x2b'),'sectionId':_0x40fd8b['id']},{})['then'](function(){return _0x5eae6f;});}else{return _0x5eae6f;}})['catch'](function(_0x1097cb){logger[_0x812b('0x2c')](_0x812b('0x56'),_0x1097cb);throw _0x1097cb;});}return _0x5eae6f;})[_0x812b('0x28')](respondWithResult(_0x12badf,0xc9))[_0x812b('0x4c')](handleError(_0x12badf,null));};exports[_0x812b('0x27')]=function(_0xf7b6fe,_0x5ad721){if(_0xf7b6fe[_0x812b('0x4e')]['id']){delete _0xf7b6fe[_0x812b('0x4e')]['id'];}return db[_0x812b('0x31')]['find']({'where':{'id':_0xf7b6fe['params']['id']}})[_0x812b('0x28')](handleEntityNotFound(_0x5ad721,null))['then'](saveUpdates(_0xf7b6fe[_0x812b('0x4e')],null))[_0x812b('0x28')](respondWithResult(_0x5ad721,null))[_0x812b('0x4c')](handleError(_0x5ad721,null));};exports[_0x812b('0x29')]=function(_0x1c98ed,_0x244158){return db['AnalyticCustomReport'][_0x812b('0x4b')]({'where':{'id':_0x1c98ed[_0x812b('0x49')]['id']}})[_0x812b('0x28')](handleEntityNotFound(_0x244158,null))['then'](removeEntity(_0x244158,null))[_0x812b('0x4c')](handleError(_0x244158,null));};exports[_0x812b('0x57')]=function(_0x21fef8,_0x48b815){var _0x91f3d0=0xa;var _0x783dbd=[_0x812b('0x58'),_0x812b('0x59'),_0x812b('0x5a'),_0x812b('0x5b')];var _0x5ad34c={'SUM':_0x812b('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x812b('0x5d'),'MIN':_0x812b('0x5e'),'AVG':_0x812b('0x5f'),'GROUP_CONCAT':_0x812b('0x60'),'GROUP_CONCAT ASC':_0x812b('0x61'),'GROUP_CONCAT DESC':_0x812b('0x62')};var _0x2a2f72={'SEC_TO_TIME':_0x812b('0x63'),'DATE':_0x812b('0x64'),'HOUR':_0x812b('0x65'),'ROUND':_0x812b('0x66'),'UNIX_TIMESTAMP':_0x812b('0x67')};var _0x25702b=function(_0x40b81b){return!_[_0x812b('0x68')]([_0x812b('0x69'),_0x812b('0x6a'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x40b81b);};var _0x177e66=function(_0x30eac3){if(!_0x30eac3||!_0x30eac3[_0x812b('0x6b')]['length']){return'';}for(var _0x527cc1='(',_0x5bdbb9=0x0;_0x5bdbb9<_0x30eac3[_0x812b('0x6b')][_0x812b('0x3b')];_0x5bdbb9+=0x1){_0x5bdbb9>0x0&&(_0x527cc1+='\x20'+_0x30eac3['operator']+'\x20');_0x527cc1+=_0x30eac3[_0x812b('0x6b')][_0x5bdbb9]['group']?_0x177e66(_0x30eac3[_0x812b('0x6b')][_0x5bdbb9][_0x812b('0x6c')]):_0x30eac3[_0x812b('0x6b')][_0x5bdbb9][_0x812b('0x6d')]+'\x20'+_0x30eac3[_0x812b('0x6b')][_0x5bdbb9][_0x812b('0x6e')]+(_0x25702b(_0x30eac3[_0x812b('0x6b')][_0x5bdbb9][_0x812b('0x6e')])?'\x20'+_0x30eac3[_0x812b('0x6b')][_0x5bdbb9][_0x812b('0x6f')]:'');}return _0x527cc1+')';};var _0x478a10={'where':{'id':_0x21fef8['params']['id']}},_0x45da53,_0x4d6b9a,_0x355059,_0x50bf86,_0x1c3603;_0x478a10=_[_0x812b('0x44')]({},_0x478a10,_0x21fef8[_0x812b('0x45')]);return db['AnalyticCustomReport'][_0x812b('0x4b')](_0x478a10)[_0x812b('0x28')](function(_0x50ab03){if(_0x50ab03){_0x45da53=_0x50ab03;return _0x50ab03[_0x812b('0x70')]();}return null;})[_0x812b('0x28')](function(_0x1e86cd){if(_0x1e86cd){if(!_0x1e86cd['length']){throw new db[(_0x812b('0x71'))][(_0x812b('0x72'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4d6b9a=_0x1e86cd;return db[_0x812b('0x73')][_0x812b('0x48')]({'raw':!![]});}return null;})[_0x812b('0x28')](function(_0x14219a){if(_0x14219a){_0x355059=_[_0x812b('0x74')](_0x14219a,'id');var _0x2db249;var _0xc83017=squel['select']();_0xc83017[_0x812b('0x75')](_0x45da53[_0x812b('0x76')]);for(var _0x27dc79=0x0;_0x27dc79<_0x4d6b9a[_0x812b('0x3b')];_0x27dc79+=0x1){_0x2db249=_0x4d6b9a[_0x27dc79][_0x812b('0x77')]?_0x355059[_0x4d6b9a[_0x27dc79][_0x812b('0x77')]]['metric']:_0x4d6b9a[_0x27dc79][_0x812b('0x6d')];_0x2db249=_0x4d6b9a[_0x27dc79][_0x812b('0x78')]?_[_0x812b('0x79')](_0x5ad34c[_0x4d6b9a[_0x27dc79][_0x812b('0x78')]],'%s',_0x2db249):_0x2db249;_0x2db249=_0x4d6b9a[_0x27dc79][_0x812b('0x7a')]?_['replace'](_0x2a2f72[_0x4d6b9a[_0x27dc79][_0x812b('0x7a')]],'%s',_0x2db249):_0x2db249;if(_0x4d6b9a[_0x27dc79][_0x812b('0x7b')]){_0xc83017[_0x812b('0x6c')](_0x2db249);}_0x4d6b9a[_0x27dc79][_0x812b('0x7c')]&&_0xc83017[_0x812b('0x3e')](_0x2db249,_0x4d6b9a[_0x27dc79][_0x812b('0x7c')]===_0x812b('0x7d')?![]:!![]);_0xc83017[_0x812b('0x6d')](_0x2db249,_0x4d6b9a[_0x27dc79][_0x812b('0x7e')]||_0x2db249);}if(_0x45da53['joins']){_0x45da53[_0x812b('0x7f')]=JSON['parse'](_0x45da53['joins']);for(var _0x1ae25b=0x0;_0x1ae25b<_0x45da53[_0x812b('0x7f')][_0x812b('0x3b')];_0x1ae25b+=0x1){if(_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x33')]&&_[_0x812b('0x68')](_0x783dbd,_0x45da53['joins'][_0x1ae25b][_0x812b('0x33')])&&_0x45da53[_0x812b('0x7f')][_0x1ae25b]['parentKey']&&_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x80')]&&_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x81')]){_0xc83017[_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x33')]](_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x80')],null,util[_0x812b('0x7a')](_0x812b('0x82'),_0x45da53[_0x812b('0x76')],_0x45da53['joins'][_0x1ae25b][_0x812b('0x83')],_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x80')],_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x81')]));}}}if(_0x45da53[_0x812b('0x84')]){_0x45da53[_0x812b('0x84')]=JSON[_0x812b('0x85')](_0x45da53['conditions']);_0xc83017[_0x812b('0x40')](_0x177e66(_0x45da53[_0x812b('0x84')][_0x812b('0x6c')]));}_0x1c3603=_0xc83017[_0x812b('0x86')]();_0xc83017[_0x812b('0x21')](_0x91f3d0);_0xc83017['offset'](0x0);logger[_0x812b('0x87')](_0x812b('0x88'),_0xc83017[_0x812b('0x89')]());return dbH['sequelize']['query'](_0xc83017[_0x812b('0x89')](),{'type':dbH[_0x812b('0x8a')][_0x812b('0x8b')][_0x812b('0x8c')]});}})['then'](respondWithResult(_0x48b815,null))[_0x812b('0x4c')](handleError(_0x48b815,null));};function runReport(_0x5b4566,_0x50147b,_0x40aab8){var _0xa92f01=_0x50147b['name'];var _0x486085=0xa;var _0x283f2b=[_0x812b('0x58'),_0x812b('0x59'),'right_join',_0x812b('0x5b')];var _0x2c1ed6={'SUM':_0x812b('0x5c'),'COUNT':_0x812b('0x8d'),'COUNT DISTINCT':_0x812b('0x8e'),'MAX':_0x812b('0x5d'),'MIN':_0x812b('0x5e'),'AVG':_0x812b('0x5f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x812b('0x62')};var _0x4423ed={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x812b('0x64'),'HOUR':_0x812b('0x65'),'ROUND':_0x812b('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27bc53=function(_0x21538d){return!_[_0x812b('0x68')]([_0x812b('0x69'),_0x812b('0x6a'),'IS\x20EMPTY',_0x812b('0x8f')],_0x21538d);};var _0x5a08f1=function(_0xadf92d){if(!_0xadf92d||!_0xadf92d[_0x812b('0x6b')][_0x812b('0x3b')]){return'';}for(var _0x5d82d0='(',_0x5f4809=0x0;_0x5f4809<_0xadf92d[_0x812b('0x6b')][_0x812b('0x3b')];_0x5f4809+=0x1){_0x5f4809>0x0&&(_0x5d82d0+='\x20'+_0xadf92d[_0x812b('0x90')]+'\x20');_0x5d82d0+=_0xadf92d[_0x812b('0x6b')][_0x5f4809][_0x812b('0x6c')]?_0x5a08f1(_0xadf92d[_0x812b('0x6b')][_0x5f4809]['group']):_0xadf92d['rules'][_0x5f4809]['field']+'\x20'+_0xadf92d[_0x812b('0x6b')][_0x5f4809][_0x812b('0x6e')]+(_0x27bc53(_0xadf92d[_0x812b('0x6b')][_0x5f4809][_0x812b('0x6e')])?'\x20'+_0xadf92d[_0x812b('0x6b')][_0x5f4809][_0x812b('0x6f')]:'');}return _0x5d82d0+')';};var _0x463d2f={'where':{'id':_0x5b4566['id']}},_0x11c862,_0xea9a7c,_0x34b880,_0x3b5a60,_0x1ce63d;_0x463d2f=_[_0x812b('0x44')]({},_0x463d2f,_0x40aab8);return db['AnalyticCustomReport'][_0x812b('0x4b')](_0x463d2f)[_0x812b('0x28')](function(_0x590f5f){if(_0x590f5f){_0x11c862=_0x590f5f;return _0x590f5f['getFields']();}return null;})[_0x812b('0x28')](function(_0x43c90c){if(_0x43c90c){if(!_0x43c90c[_0x812b('0x3b')]){throw new db[(_0x812b('0x71'))]['ValidationErrorItem'](_0x812b('0x91'),0x193);}_0xea9a7c=_0x43c90c;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0xd53787){if(_0xd53787){_0x34b880=_[_0x812b('0x74')](_0xd53787,'id');var _0x23ebd7;var _0x5ebdbc=squel[_0x812b('0x92')]();_0x5ebdbc[_0x812b('0x75')](_0x11c862[_0x812b('0x76')]);for(var _0x44da79=0x0;_0x44da79<_0xea9a7c[_0x812b('0x3b')];_0x44da79+=0x1){_0x23ebd7=_0xea9a7c[_0x44da79]['MetricId']?_0x34b880[_0xea9a7c[_0x44da79]['MetricId']][_0x812b('0x93')]:_0xea9a7c[_0x44da79]['field'];_0x23ebd7=_0xea9a7c[_0x44da79][_0x812b('0x78')]?_[_0x812b('0x79')](_0x2c1ed6[_0xea9a7c[_0x44da79][_0x812b('0x78')]],'%s',_0x23ebd7):_0x23ebd7;_0x23ebd7=_0xea9a7c[_0x44da79][_0x812b('0x7a')]?_[_0x812b('0x79')](_0x4423ed[_0xea9a7c[_0x44da79][_0x812b('0x7a')]],'%s',_0x23ebd7):_0x23ebd7;if(_0xea9a7c[_0x44da79][_0x812b('0x7b')]){_0x5ebdbc['group'](_0x23ebd7);}_0xea9a7c[_0x44da79][_0x812b('0x7c')]&&_0x5ebdbc['order'](_0x23ebd7,_0xea9a7c[_0x44da79][_0x812b('0x7c')]==='DESC'?![]:!![]);_0x5ebdbc['field'](_0x23ebd7,_0xea9a7c[_0x44da79]['alias']||_0x23ebd7);}if(_0x11c862['joins']){_0x11c862[_0x812b('0x7f')]=JSON[_0x812b('0x85')](_0x11c862[_0x812b('0x7f')]);for(var _0xcbac4d=0x0;_0xcbac4d<_0x11c862['joins'][_0x812b('0x3b')];_0xcbac4d+=0x1){if(_0x11c862[_0x812b('0x7f')][_0xcbac4d][_0x812b('0x33')]&&_[_0x812b('0x68')](_0x283f2b,_0x11c862['joins'][_0xcbac4d][_0x812b('0x33')])&&_0x11c862[_0x812b('0x7f')][_0xcbac4d][_0x812b('0x83')]&&_0x11c862[_0x812b('0x7f')][_0xcbac4d][_0x812b('0x80')]&&_0x11c862['joins'][_0xcbac4d][_0x812b('0x81')]){_0x5ebdbc[_0x11c862[_0x812b('0x7f')][_0xcbac4d][_0x812b('0x33')]](_0x11c862[_0x812b('0x7f')][_0xcbac4d][_0x812b('0x80')],null,util[_0x812b('0x7a')]('%s.%s\x20=\x20%s.%s',_0x11c862[_0x812b('0x76')],_0x11c862[_0x812b('0x7f')][_0xcbac4d][_0x812b('0x83')],_0x11c862['joins'][_0xcbac4d][_0x812b('0x80')],_0x11c862[_0x812b('0x7f')][_0xcbac4d]['foreignKey']));}}}if(_0x11c862[_0x812b('0x84')]){_0x11c862[_0x812b('0x84')]=JSON[_0x812b('0x85')](_0x11c862[_0x812b('0x84')]);_0x5ebdbc[_0x812b('0x40')](_0x5a08f1(_0x11c862[_0x812b('0x84')][_0x812b('0x6c')]));}_0x1ce63d=_0x5ebdbc['clone']();_0x5ebdbc[_0x812b('0x21')](_0x486085);_0x5ebdbc[_0x812b('0x20')](0x0);return;}})[_0x812b('0x28')](function(){if(_0x50147b[_0x812b('0x94')]===_0x812b('0x95')){return null;}var _0x4cae2a=_['merge'](_0x50147b,{'name':_0x50147b[_0x812b('0x96')]||_0x50147b[_0x812b('0x43')]||_0x11c862['name'],'basename':_0xa92f01,'savename':util[_0x812b('0x7a')](_0x812b('0x97'),_0x50147b[_0x812b('0x43')]||_0x11c862['name'],require('randomstring')[_0x812b('0x98')](0x4),_0x50147b[_0x812b('0x94')]||_0x812b('0x99')),'reportId':_0x11c862['id'],'reportType':_0x812b('0x9a')});return db[_0x812b('0x9b')][_0x812b('0x4d')](_0x4cae2a,{'raw':!![]});})[_0x812b('0x28')](function(_0x4e897e){if(_0x11c862[_0x812b('0x76')]===_0x812b('0x9c')){_0x1ce63d['where'](_0x11c862[_0x812b('0x76')]+_0x812b('0x9d'),_0x50147b['startDate'],_0x50147b['endDate']);}else{_0x1ce63d[_0x812b('0x40')](_0x11c862[_0x812b('0x76')]+_0x812b('0x9e'),_0x50147b[_0x812b('0x9f')],_0x50147b[_0x812b('0xa0')]);}if(_0x4e897e){logger[_0x812b('0xa1')]('Run\x20Query:',_0x1ce63d[_0x812b('0x89')]());require(_0x812b('0xa2'))['fork'](path[_0x812b('0x58')](__dirname,_0x812b('0xa3'),_0x4e897e[_0x812b('0x94')]),[_0x4e897e['id'],_0x1ce63d[_0x812b('0x89')](),path[_0x812b('0x58')](__dirname,'../../files/reports',_0x4e897e[_0x812b('0xa4')]),_0xa92f01]);return _0x4e897e;}else{var _0x217bcf=squel['select']();_0x217bcf[_0x812b('0x75')]('('+_0x1ce63d[_0x812b('0x89')]()+')',_0x812b('0xa5'));_0x217bcf[_0x812b('0x6d')](_0x812b('0xa6'),'count');_0x1ce63d[_0x812b('0x21')](_0x50147b[_0x812b('0x21')]||_0x486085);_0x1ce63d[_0x812b('0x20')](_0x50147b[_0x812b('0x20')]||0x0);return dbH[_0x812b('0x8a')]['query'](_0x217bcf[_0x812b('0x89')](),{'type':dbH['sequelize']['QueryTypes'][_0x812b('0x8c')]})[_0x812b('0x28')](function(_0x1408d2){if(!_0x1408d2[_0x812b('0x3b')]){_0x3b5a60=0x0;}else{_0x3b5a60=_0x1408d2[0x0]['count']||0x0;}return dbH[_0x812b('0x8a')]['query'](_0x1ce63d[_0x812b('0x89')](),{'type':dbH[_0x812b('0x8a')]['QueryTypes']['SELECT']});})['then'](function(_0xc5bad5){return{'rows':_0xc5bad5||[],'count':_0x3b5a60};});}});}exports[_0x812b('0xa7')]=function(_0x2d02d9,_0x51e3b3){return runReport(_0x2d02d9[_0x812b('0x49')],_0x2d02d9['query'],_0x2d02d9[_0x812b('0x45')])['then'](respondWithResult(_0x51e3b3,null))[_0x812b('0x4c')](handleError(_0x51e3b3,null));};exports[_0x812b('0xa8')]=runReport;exports[_0x812b('0x38')]=function(_0x39f1d9,_0x49bd36){var _0xd7ea2b=0xa;var _0x5a35b9=[_0x812b('0x58'),_0x812b('0x59'),'right_join',_0x812b('0x5b')];var _0x246607={'SUM':_0x812b('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x812b('0x8e'),'MAX':_0x812b('0x5d'),'MIN':_0x812b('0x5e'),'AVG':_0x812b('0x5f'),'GROUP_CONCAT':_0x812b('0x60'),'GROUP_CONCAT ASC':_0x812b('0x61'),'GROUP_CONCAT DESC':_0x812b('0x62')};var _0x22499c={'SEC_TO_TIME':_0x812b('0x63'),'DATE':_0x812b('0x64'),'HOUR':_0x812b('0x65'),'ROUND':_0x812b('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x10e3ee=function(_0xd615d1){return!_[_0x812b('0x68')]([_0x812b('0x69'),_0x812b('0x6a'),'IS\x20EMPTY',_0x812b('0x8f')],_0xd615d1);};var _0x5a14a=function(_0x3d9395){if(!_0x3d9395||!_0x3d9395[_0x812b('0x6b')][_0x812b('0x3b')]){return'';}for(var _0x46344e='(',_0x344ccd=0x0;_0x344ccd<_0x3d9395[_0x812b('0x6b')]['length'];_0x344ccd+=0x1){_0x344ccd>0x0&&(_0x46344e+='\x20'+_0x3d9395[_0x812b('0x90')]+'\x20');_0x46344e+=_0x3d9395[_0x812b('0x6b')][_0x344ccd][_0x812b('0x6c')]?_0x5a14a(_0x3d9395['rules'][_0x344ccd][_0x812b('0x6c')]):_0x3d9395[_0x812b('0x6b')][_0x344ccd]['field']+'\x20'+_0x3d9395[_0x812b('0x6b')][_0x344ccd][_0x812b('0x6e')]+(_0x10e3ee(_0x3d9395[_0x812b('0x6b')][_0x344ccd][_0x812b('0x6e')])?'\x20'+_0x3d9395['rules'][_0x344ccd]['value']:'');}return _0x46344e+')';};var _0x3a4716={'where':{'id':_0x39f1d9[_0x812b('0x49')]['id']}},_0xa33dc4,_0x38f83e,_0x40d578,_0x40e680,_0x19f3e5;_0x3a4716=_[_0x812b('0x44')]({},_0x3a4716,_0x39f1d9['options']);return db[_0x812b('0x31')][_0x812b('0x4b')](_0x3a4716)['then'](function(_0x4f66ad){if(_0x4f66ad){_0xa33dc4=_0x4f66ad;return _0x4f66ad[_0x812b('0x70')]();}return null;})[_0x812b('0x28')](function(_0x264210){if(_0x264210){if(!_0x264210[_0x812b('0x3b')]){throw new db[(_0x812b('0x71'))][(_0x812b('0x72'))](_0x812b('0x91'),0x193);}_0x38f83e=_0x264210;return db[_0x812b('0x73')][_0x812b('0x48')]({'raw':!![]});}return null;})[_0x812b('0x28')](function(_0xd4b59){if(_0xd4b59){_0x40d578=_[_0x812b('0x74')](_0xd4b59,'id');var _0x4d4aff;var _0xbc476f=squel[_0x812b('0x92')]();_0xbc476f[_0x812b('0x75')](_0xa33dc4['table']);for(var _0xd2c36d=0x0;_0xd2c36d<_0x38f83e[_0x812b('0x3b')];_0xd2c36d+=0x1){_0x4d4aff=_0x38f83e[_0xd2c36d][_0x812b('0x77')]?_0x40d578[_0x38f83e[_0xd2c36d]['MetricId']][_0x812b('0x93')]:_0x38f83e[_0xd2c36d]['field'];_0x4d4aff=_0x38f83e[_0xd2c36d][_0x812b('0x78')]?_[_0x812b('0x79')](_0x246607[_0x38f83e[_0xd2c36d][_0x812b('0x78')]],'%s',_0x4d4aff):_0x4d4aff;_0x4d4aff=_0x38f83e[_0xd2c36d][_0x812b('0x7a')]?_['replace'](_0x22499c[_0x38f83e[_0xd2c36d]['format']],'%s',_0x4d4aff):_0x4d4aff;if(_0x38f83e[_0xd2c36d][_0x812b('0x7b')]){_0xbc476f[_0x812b('0x6c')](_0x4d4aff);}_0x38f83e[_0xd2c36d]['orderBy']&&_0xbc476f['order'](_0x4d4aff,_0x38f83e[_0xd2c36d][_0x812b('0x7c')]===_0x812b('0x7d')?![]:!![]);_0xbc476f['field'](_0x4d4aff,_0x38f83e[_0xd2c36d][_0x812b('0x7e')]||_0x4d4aff);}if(_0xa33dc4[_0x812b('0x7f')]){_0xa33dc4[_0x812b('0x7f')]=JSON[_0x812b('0x85')](_0xa33dc4[_0x812b('0x7f')]);for(var _0xa73c82=0x0;_0xa73c82<_0xa33dc4[_0x812b('0x7f')][_0x812b('0x3b')];_0xa73c82+=0x1){if(_0xa33dc4[_0x812b('0x7f')][_0xa73c82][_0x812b('0x33')]&&_['includes'](_0x5a35b9,_0xa33dc4['joins'][_0xa73c82][_0x812b('0x33')])&&_0xa33dc4[_0x812b('0x7f')][_0xa73c82]['parentKey']&&_0xa33dc4[_0x812b('0x7f')][_0xa73c82][_0x812b('0x80')]&&_0xa33dc4['joins'][_0xa73c82][_0x812b('0x81')]){_0xbc476f[_0xa33dc4[_0x812b('0x7f')][_0xa73c82][_0x812b('0x33')]](_0xa33dc4[_0x812b('0x7f')][_0xa73c82]['foreignTable'],null,util[_0x812b('0x7a')](_0x812b('0x82'),_0xa33dc4[_0x812b('0x76')],_0xa33dc4['joins'][_0xa73c82][_0x812b('0x83')],_0xa33dc4[_0x812b('0x7f')][_0xa73c82][_0x812b('0x80')],_0xa33dc4[_0x812b('0x7f')][_0xa73c82][_0x812b('0x81')]));}}}if(_0xa33dc4['conditions']){_0xa33dc4['conditions']=JSON[_0x812b('0x85')](_0xa33dc4[_0x812b('0x84')]);_0xbc476f[_0x812b('0x40')](_0x5a14a(_0xa33dc4[_0x812b('0x84')][_0x812b('0x6c')]));}_0x19f3e5=_0xbc476f['clone']();_0xbc476f[_0x812b('0x21')](_0xd7ea2b);_0xbc476f[_0x812b('0x20')](0x0);logger['debug'](_0x812b('0x88'),_0xbc476f['toString']());return dbH[_0x812b('0x8a')][_0x812b('0x38')](_0xbc476f[_0x812b('0x89')](),{'type':dbH[_0x812b('0x8a')][_0x812b('0x8b')][_0x812b('0x8c')]});}})[_0x812b('0x28')](function(){return{'sql':_0x19f3e5['toString']()};})['then'](respondWithResult(_0x49bd36,null))['catch'](handleError(_0x49bd36,null));}; \ No newline at end of file +var _0x3da6=['Sequelize','findAll','%s.%s\x20=\x20%s.%s','clone','output','web','fullPath','generate','csv','custom','AnalyticExtractedReport','cdr','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','metric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','options','includeAll','include','rows','catch','show','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','parentKey','conditions','where','debug','Limited\x20Query:','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20NULL'];(function(_0x5e8fc,_0x1ccc06){var _0x41c58c=function(_0x495f2c){while(--_0x495f2c){_0x5e8fc['push'](_0x5e8fc['shift']());}};_0x41c58c(++_0x1ccc06);}(_0x3da6,0xc1));var _0x63da=function(_0x59d216,_0x27fdf6){_0x59d216=_0x59d216-0x0;var _0x309d65=_0x3da6[_0x59d216];return _0x309d65;};'use strict';var emlformat=require(_0x63da('0x0'));var rimraf=require(_0x63da('0x1'));var zipdir=require(_0x63da('0x2'));var jsonpatch=require(_0x63da('0x3'));var rp=require(_0x63da('0x4'));var moment=require(_0x63da('0x5'));var BPromise=require(_0x63da('0x6'));var Mustache=require('mustache');var util=require(_0x63da('0x7'));var path=require(_0x63da('0x8'));var sox=require('sox');var csv=require(_0x63da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x63da('0xa'));var _=require('lodash');var squel=require(_0x63da('0xb'));var crypto=require(_0x63da('0xc'));var jsforce=require(_0x63da('0xd'));var deskjs=require(_0x63da('0xe'));var toCsv=require('to-csv');var querystring=require(_0x63da('0xf'));var Papa=require(_0x63da('0x10'));var Redis=require('ioredis');var authService=require(_0x63da('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x63da('0x12'));var hardwareService=require(_0x63da('0x13'));var logger=require(_0x63da('0x14'))(_0x63da('0x15'));var utils=require(_0x63da('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x63da('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x63da('0x18'))[_0x63da('0x19')];function respondWithStatusCode(_0x30d1bd,_0x213d63){_0x213d63=_0x213d63||0xcc;return function(_0x276f6a){if(_0x276f6a){return _0x30d1bd[_0x63da('0x1a')](_0x213d63);}return _0x30d1bd[_0x63da('0x1b')](_0x213d63)[_0x63da('0x1c')]();};}function respondWithResult(_0x37ce36,_0x26870d){_0x26870d=_0x26870d||0xc8;return function(_0x3f141c){if(_0x3f141c){return _0x37ce36[_0x63da('0x1b')](_0x26870d)[_0x63da('0x1d')](_0x3f141c);}};}function respondWithFilteredResult(_0x4e6084,_0x48ac11){return function(_0x12ffb3){if(_0x12ffb3){var _0x5cf63d=typeof _0x48ac11[_0x63da('0x1e')]===_0x63da('0x1f')&&typeof _0x48ac11[_0x63da('0x20')]===_0x63da('0x1f');var _0xaf41cb=_0x12ffb3['count'];var _0x8ce2aa=_0x5cf63d?0x0:_0x48ac11['offset'];var _0x5ace3f=_0x5cf63d?_0x12ffb3[_0x63da('0x21')]:_0x48ac11['offset']+_0x48ac11[_0x63da('0x20')];var _0x3b4003;if(_0x5ace3f>=_0xaf41cb){_0x5ace3f=_0xaf41cb;_0x3b4003=0xc8;}else{_0x3b4003=0xce;}_0x4e6084[_0x63da('0x1b')](_0x3b4003);return _0x4e6084['set'](_0x63da('0x22'),_0x8ce2aa+'-'+_0x5ace3f+'/'+_0xaf41cb)[_0x63da('0x1d')](_0x12ffb3);}return null;};}function patchUpdates(_0x54b6c6){return function(_0x30d5ef){try{jsonpatch[_0x63da('0x23')](_0x30d5ef,_0x54b6c6,!![]);}catch(_0x3716bd){return BPromise[_0x63da('0x24')](_0x3716bd);}return _0x30d5ef[_0x63da('0x25')]();};}function saveUpdates(_0x33e5c6,_0x131dc9){return function(_0xd9dbf6){if(_0xd9dbf6){return _0xd9dbf6[_0x63da('0x26')](_0x33e5c6)['then'](function(_0x55df4a){return _0x55df4a;});}return null;};}function removeEntity(_0xef0017,_0x32d43e){return function(_0x13d657){if(_0x13d657){return _0x13d657[_0x63da('0x27')]()[_0x63da('0x28')](function(){var _0x716174=_0x13d657['get']({'plain':!![]});var _0xc44172=_0x63da('0x29');return db[_0x63da('0x2a')][_0x63da('0x27')]({'where':{'type':_0xc44172,'resourceId':_0x716174['id']}})['then'](function(){return _0x13d657;});})[_0x63da('0x28')](function(){_0xef0017[_0x63da('0x1b')](0xcc)[_0x63da('0x1c')]();});}};}function handleEntityNotFound(_0x3505b0,_0x8ed71e){return function(_0x21cb98){if(!_0x21cb98){_0x3505b0[_0x63da('0x1a')](0x194);}return _0x21cb98;};}function handleError(_0x4b5e64,_0x5a4628){_0x5a4628=_0x5a4628||0x1f4;return function(_0x3c646a){logger[_0x63da('0x2b')](_0x3c646a[_0x63da('0x2c')]);if(_0x3c646a[_0x63da('0x2d')]){delete _0x3c646a[_0x63da('0x2d')];}_0x4b5e64[_0x63da('0x1b')](_0x5a4628)[_0x63da('0x2e')](_0x3c646a);};}exports[_0x63da('0x2f')]=function(_0x56fcda,_0x59c9ef){var _0x3fb195={},_0x56e957={},_0x3f2ed0={'count':0x0,'rows':[]};var _0x2e2ec5=_[_0x63da('0x30')](db[_0x63da('0x31')][_0x63da('0x32')],function(_0x21f3fc){return{'name':_0x21f3fc[_0x63da('0x33')],'type':_0x21f3fc[_0x63da('0x34')]['key']};});_0x56e957['model']=_['map'](_0x2e2ec5,_0x63da('0x2d'));_0x56e957['query']=_['keys'](_0x56fcda[_0x63da('0x35')]);_0x56e957[_0x63da('0x36')]=_[_0x63da('0x37')](_0x56e957[_0x63da('0x38')],_0x56e957[_0x63da('0x35')]);_0x3fb195['attributes']=_['intersection'](_0x56e957[_0x63da('0x38')],qs['fields'](_0x56fcda[_0x63da('0x35')][_0x63da('0x39')]));_0x3fb195[_0x63da('0x3a')]=_0x3fb195[_0x63da('0x3a')][_0x63da('0x3b')]?_0x3fb195['attributes']:_0x56e957['model'];if(!_0x56fcda['query'][_0x63da('0x3c')](_0x63da('0x3d'))){_0x3fb195[_0x63da('0x20')]=qs[_0x63da('0x20')](_0x56fcda['query']['limit']);_0x3fb195[_0x63da('0x1e')]=qs[_0x63da('0x1e')](_0x56fcda[_0x63da('0x35')][_0x63da('0x1e')]);}_0x3fb195[_0x63da('0x3e')]=qs[_0x63da('0x3f')](_0x56fcda[_0x63da('0x35')]['sort']);_0x3fb195['where']=qs[_0x63da('0x36')](_[_0x63da('0x40')](_0x56fcda[_0x63da('0x35')],_0x56e957[_0x63da('0x36')]),_0x2e2ec5);if(_0x56fcda[_0x63da('0x35')][_0x63da('0x41')]){_0x3fb195['where']=_['merge'](_0x3fb195['where'],{'$or':_[_0x63da('0x30')](_0x2e2ec5,function(_0x52504f){if(_0x52504f[_0x63da('0x34')]!=='VIRTUAL'){var _0x1c329d={};_0x1c329d[_0x52504f[_0x63da('0x2d')]]={'$like':'%'+_0x56fcda['query'][_0x63da('0x41')]+'%'};return _0x1c329d;}})});}_0x3fb195=_['merge']({},_0x3fb195,_0x56fcda[_0x63da('0x42')]);var _0x59fd31={'where':_0x3fb195['where']};return db[_0x63da('0x31')]['count'](_0x59fd31)[_0x63da('0x28')](function(_0x4e2eba){_0x3f2ed0['count']=_0x4e2eba;if(_0x56fcda['query'][_0x63da('0x43')]){_0x3fb195[_0x63da('0x44')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x3fb195);})[_0x63da('0x28')](function(_0x262ec2){_0x3f2ed0[_0x63da('0x45')]=_0x262ec2;return _0x3f2ed0;})[_0x63da('0x28')](respondWithFilteredResult(_0x59c9ef,_0x3fb195))[_0x63da('0x46')](handleError(_0x59c9ef,null));};exports[_0x63da('0x47')]=function(_0x1441e8,_0x2498eb){var _0x15d4ee={'raw':![],'where':{'id':_0x1441e8[_0x63da('0x48')]['id']}},_0x2d4373={};_0x2d4373[_0x63da('0x38')]=_['keys'](db['AnalyticCustomReport']['rawAttributes']);_0x2d4373[_0x63da('0x35')]=_['keys'](_0x1441e8[_0x63da('0x35')]);_0x2d4373[_0x63da('0x36')]=_[_0x63da('0x37')](_0x2d4373[_0x63da('0x38')],_0x2d4373[_0x63da('0x35')]);_0x15d4ee[_0x63da('0x3a')]=_[_0x63da('0x37')](_0x2d4373[_0x63da('0x38')],qs['fields'](_0x1441e8['query']['fields']));_0x15d4ee[_0x63da('0x3a')]=_0x15d4ee[_0x63da('0x3a')][_0x63da('0x3b')]?_0x15d4ee['attributes']:_0x2d4373[_0x63da('0x38')];if(_0x1441e8[_0x63da('0x35')][_0x63da('0x43')]){_0x15d4ee[_0x63da('0x44')]=[{'all':!![]}];}_0x15d4ee=_[_0x63da('0x49')]({},_0x15d4ee,_0x1441e8[_0x63da('0x42')]);return db['AnalyticCustomReport'][_0x63da('0x4a')](_0x15d4ee)[_0x63da('0x28')](handleEntityNotFound(_0x2498eb,null))['then'](respondWithResult(_0x2498eb,null))[_0x63da('0x46')](handleError(_0x2498eb,null));};exports[_0x63da('0x4b')]=function(_0x778284,_0xd20751){return db[_0x63da('0x31')][_0x63da('0x4b')](_0x778284['body'],{})[_0x63da('0x28')](function(_0x55d9ed){var _0xb11b7=_0x778284['user']['get']({'plain':!![]});if(!_0xb11b7)throw new Error(_0x63da('0x4c'));if(_0xb11b7[_0x63da('0x4d')]==='user'){var _0x207b8e=_0x55d9ed['get']({'plain':!![]});var _0x4c7f48=_0x63da('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x4c7f48,'userProfileId':_0xb11b7[_0x63da('0x4f')]},'raw':!![]})[_0x63da('0x28')](function(_0x1c5a4a){if(_0x1c5a4a&&_0x1c5a4a[_0x63da('0x50')]===0x0){return db[_0x63da('0x2a')][_0x63da('0x4b')]({'name':_0x207b8e[_0x63da('0x2d')],'resourceId':_0x207b8e['id'],'type':_0x63da('0x29'),'sectionId':_0x1c5a4a['id']},{})[_0x63da('0x28')](function(){return _0x55d9ed;});}else{return _0x55d9ed;}})[_0x63da('0x46')](function(_0x5bfce6){logger[_0x63da('0x2b')](_0x63da('0x51'),_0x5bfce6);throw _0x5bfce6;});}return _0x55d9ed;})[_0x63da('0x28')](respondWithResult(_0xd20751,0xc9))[_0x63da('0x46')](handleError(_0xd20751,null));};exports[_0x63da('0x26')]=function(_0x37c6d7,_0xd6b1b2){if(_0x37c6d7[_0x63da('0x52')]['id']){delete _0x37c6d7[_0x63da('0x52')]['id'];}return db[_0x63da('0x31')]['find']({'where':{'id':_0x37c6d7[_0x63da('0x48')]['id']}})[_0x63da('0x28')](handleEntityNotFound(_0xd6b1b2,null))['then'](saveUpdates(_0x37c6d7[_0x63da('0x52')],null))[_0x63da('0x28')](respondWithResult(_0xd6b1b2,null))[_0x63da('0x46')](handleError(_0xd6b1b2,null));};exports[_0x63da('0x27')]=function(_0x273c5d,_0xa5e7c){return db[_0x63da('0x31')][_0x63da('0x4a')]({'where':{'id':_0x273c5d[_0x63da('0x48')]['id']}})['then'](handleEntityNotFound(_0xa5e7c,null))[_0x63da('0x28')](removeEntity(_0xa5e7c,null))[_0x63da('0x46')](handleError(_0xa5e7c,null));};exports[_0x63da('0x53')]=function(_0x2908cb,_0x284ef1){var _0x26df3e=0xa;var _0x11bf43=[_0x63da('0x54'),'left_join',_0x63da('0x55'),_0x63da('0x56')];var _0x2bf285={'SUM':_0x63da('0x57'),'COUNT':_0x63da('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x63da('0x59'),'MIN':'MIN(%s)','AVG':_0x63da('0x5a'),'GROUP_CONCAT':_0x63da('0x5b'),'GROUP_CONCAT ASC':_0x63da('0x5c'),'GROUP_CONCAT DESC':_0x63da('0x5d')};var _0x2cce8e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x63da('0x5e'),'HOUR':_0x63da('0x5f'),'ROUND':_0x63da('0x60'),'UNIX_TIMESTAMP':_0x63da('0x61')};var _0x4977e6=function(_0x1738f9){return!_[_0x63da('0x62')]([_0x63da('0x63'),'IS\x20NOT\x20NULL',_0x63da('0x64'),_0x63da('0x65')],_0x1738f9);};var _0x50da69=function(_0x2f89d3){if(!_0x2f89d3||!_0x2f89d3[_0x63da('0x66')]['length']){return'';}for(var _0x3c6d05='(',_0x3680cb=0x0;_0x3680cb<_0x2f89d3[_0x63da('0x66')][_0x63da('0x3b')];_0x3680cb+=0x1){_0x3680cb>0x0&&(_0x3c6d05+='\x20'+_0x2f89d3[_0x63da('0x67')]+'\x20');_0x3c6d05+=_0x2f89d3['rules'][_0x3680cb][_0x63da('0x68')]?_0x50da69(_0x2f89d3[_0x63da('0x66')][_0x3680cb][_0x63da('0x68')]):_0x2f89d3[_0x63da('0x66')][_0x3680cb][_0x63da('0x69')]+'\x20'+_0x2f89d3[_0x63da('0x66')][_0x3680cb][_0x63da('0x6a')]+(_0x4977e6(_0x2f89d3[_0x63da('0x66')][_0x3680cb][_0x63da('0x6a')])?'\x20'+_0x2f89d3[_0x63da('0x66')][_0x3680cb][_0x63da('0x6b')]:'');}return _0x3c6d05+')';};var _0x3aee30={'where':{'id':_0x2908cb[_0x63da('0x48')]['id']}},_0x5e7743,_0x36da27,_0x4ca47d,_0x47eead,_0x5a9005;_0x3aee30=_[_0x63da('0x49')]({},_0x3aee30,_0x2908cb[_0x63da('0x42')]);return db[_0x63da('0x31')][_0x63da('0x4a')](_0x3aee30)[_0x63da('0x28')](function(_0x49ec1b){if(_0x49ec1b){_0x5e7743=_0x49ec1b;return _0x49ec1b[_0x63da('0x6c')]();}return null;})['then'](function(_0x3ec1b8){if(_0x3ec1b8){if(!_0x3ec1b8['length']){throw new db['Sequelize'][(_0x63da('0x6d'))](_0x63da('0x6e'),0x193);}_0x36da27=_0x3ec1b8;return db[_0x63da('0x6f')]['findAll']({'raw':!![]});}return null;})[_0x63da('0x28')](function(_0x45adc2){if(_0x45adc2){_0x4ca47d=_[_0x63da('0x70')](_0x45adc2,'id');var _0x7d2375;var _0x1ceef1=squel[_0x63da('0x71')]();_0x1ceef1[_0x63da('0x72')](_0x5e7743[_0x63da('0x73')]);for(var _0x1b32a7=0x0;_0x1b32a7<_0x36da27[_0x63da('0x3b')];_0x1b32a7+=0x1){_0x7d2375=_0x36da27[_0x1b32a7][_0x63da('0x74')]?_0x4ca47d[_0x36da27[_0x1b32a7][_0x63da('0x74')]]['metric']:_0x36da27[_0x1b32a7][_0x63da('0x69')];_0x7d2375=_0x36da27[_0x1b32a7][_0x63da('0x75')]?_[_0x63da('0x76')](_0x2bf285[_0x36da27[_0x1b32a7][_0x63da('0x75')]],'%s',_0x7d2375):_0x7d2375;_0x7d2375=_0x36da27[_0x1b32a7][_0x63da('0x77')]?_[_0x63da('0x76')](_0x2cce8e[_0x36da27[_0x1b32a7][_0x63da('0x77')]],'%s',_0x7d2375):_0x7d2375;if(_0x36da27[_0x1b32a7][_0x63da('0x78')]){_0x1ceef1[_0x63da('0x68')](_0x7d2375);}_0x36da27[_0x1b32a7][_0x63da('0x79')]&&_0x1ceef1['order'](_0x7d2375,_0x36da27[_0x1b32a7]['orderBy']===_0x63da('0x7a')?![]:!![]);_0x1ceef1[_0x63da('0x69')](_0x7d2375,_0x36da27[_0x1b32a7][_0x63da('0x7b')]||_0x7d2375);}if(_0x5e7743[_0x63da('0x7c')]){_0x5e7743[_0x63da('0x7c')]=JSON[_0x63da('0x7d')](_0x5e7743[_0x63da('0x7c')]);for(var _0x548a50=0x0;_0x548a50<_0x5e7743[_0x63da('0x7c')]['length'];_0x548a50+=0x1){if(_0x5e7743[_0x63da('0x7c')][_0x548a50][_0x63da('0x34')]&&_[_0x63da('0x62')](_0x11bf43,_0x5e7743[_0x63da('0x7c')][_0x548a50][_0x63da('0x34')])&&_0x5e7743['joins'][_0x548a50]['parentKey']&&_0x5e7743[_0x63da('0x7c')][_0x548a50][_0x63da('0x7e')]&&_0x5e7743['joins'][_0x548a50][_0x63da('0x7f')]){_0x1ceef1[_0x5e7743['joins'][_0x548a50][_0x63da('0x34')]](_0x5e7743[_0x63da('0x7c')][_0x548a50][_0x63da('0x7e')],null,util[_0x63da('0x77')]('%s.%s\x20=\x20%s.%s',_0x5e7743['table'],_0x5e7743['joins'][_0x548a50][_0x63da('0x80')],_0x5e7743[_0x63da('0x7c')][_0x548a50][_0x63da('0x7e')],_0x5e7743[_0x63da('0x7c')][_0x548a50][_0x63da('0x7f')]));}}}if(_0x5e7743['conditions']){_0x5e7743[_0x63da('0x81')]=JSON[_0x63da('0x7d')](_0x5e7743[_0x63da('0x81')]);_0x1ceef1[_0x63da('0x82')](_0x50da69(_0x5e7743[_0x63da('0x81')][_0x63da('0x68')]));}_0x5a9005=_0x1ceef1['clone']();_0x1ceef1[_0x63da('0x20')](_0x26df3e);_0x1ceef1[_0x63da('0x1e')](0x0);logger[_0x63da('0x83')](_0x63da('0x84'),_0x1ceef1['toString']());return dbH['sequelize'][_0x63da('0x35')](_0x1ceef1[_0x63da('0x85')](),{'type':dbH['sequelize'][_0x63da('0x86')][_0x63da('0x87')]});}})[_0x63da('0x28')](respondWithResult(_0x284ef1,null))[_0x63da('0x46')](handleError(_0x284ef1,null));};function runReport(_0x1c016d,_0x4957f5,_0x438ef5){var _0x2e262a=_0x4957f5[_0x63da('0x2d')];var _0x7990d7=0xa;var _0x3e5fa8=[_0x63da('0x54'),_0x63da('0x88'),_0x63da('0x55'),_0x63da('0x56')];var _0x86380d={'SUM':_0x63da('0x57'),'COUNT':_0x63da('0x58'),'COUNT DISTINCT':_0x63da('0x89'),'MAX':_0x63da('0x59'),'MIN':_0x63da('0x8a'),'AVG':_0x63da('0x5a'),'GROUP_CONCAT':_0x63da('0x5b'),'GROUP_CONCAT ASC':_0x63da('0x5c'),'GROUP_CONCAT DESC':_0x63da('0x5d')};var _0x42b4f5={'SEC_TO_TIME':_0x63da('0x8b'),'DATE':'DATE(%s)','HOUR':_0x63da('0x5f'),'ROUND':_0x63da('0x60'),'UNIX_TIMESTAMP':_0x63da('0x61')};var _0xf1566c=function(_0x5aed2b){return!_['includes']([_0x63da('0x63'),_0x63da('0x8c'),_0x63da('0x64'),_0x63da('0x65')],_0x5aed2b);};var _0x4e3c20=function(_0x24586b){if(!_0x24586b||!_0x24586b[_0x63da('0x66')]['length']){return'';}for(var _0x5983d7='(',_0x5dc5e3=0x0;_0x5dc5e3<_0x24586b[_0x63da('0x66')][_0x63da('0x3b')];_0x5dc5e3+=0x1){_0x5dc5e3>0x0&&(_0x5983d7+='\x20'+_0x24586b[_0x63da('0x67')]+'\x20');_0x5983d7+=_0x24586b[_0x63da('0x66')][_0x5dc5e3][_0x63da('0x68')]?_0x4e3c20(_0x24586b[_0x63da('0x66')][_0x5dc5e3][_0x63da('0x68')]):_0x24586b['rules'][_0x5dc5e3][_0x63da('0x69')]+'\x20'+_0x24586b[_0x63da('0x66')][_0x5dc5e3][_0x63da('0x6a')]+(_0xf1566c(_0x24586b[_0x63da('0x66')][_0x5dc5e3]['condition'])?'\x20'+_0x24586b[_0x63da('0x66')][_0x5dc5e3][_0x63da('0x6b')]:'');}return _0x5983d7+')';};var _0xdd075e={'where':{'id':_0x1c016d['id']}},_0x64c3a6,_0x200d22,_0x3c0340,_0x27adb9,_0x1a2f84;_0xdd075e=_['merge']({},_0xdd075e,_0x438ef5);return db['AnalyticCustomReport'][_0x63da('0x4a')](_0xdd075e)[_0x63da('0x28')](function(_0x3dd6fe){if(_0x3dd6fe){_0x64c3a6=_0x3dd6fe;return _0x3dd6fe[_0x63da('0x6c')]();}return null;})[_0x63da('0x28')](function(_0x3f47db){if(_0x3f47db){if(!_0x3f47db[_0x63da('0x3b')]){throw new db[(_0x63da('0x8d'))][(_0x63da('0x6d'))](_0x63da('0x6e'),0x193);}_0x200d22=_0x3f47db;return db['AnalyticMetric'][_0x63da('0x8e')]({'raw':!![]});}return null;})[_0x63da('0x28')](function(_0x280076){if(_0x280076){_0x3c0340=_['keyBy'](_0x280076,'id');var _0x2f66f6;var _0x44e016=squel[_0x63da('0x71')]();_0x44e016[_0x63da('0x72')](_0x64c3a6[_0x63da('0x73')]);for(var _0x2906a9=0x0;_0x2906a9<_0x200d22['length'];_0x2906a9+=0x1){_0x2f66f6=_0x200d22[_0x2906a9]['MetricId']?_0x3c0340[_0x200d22[_0x2906a9]['MetricId']]['metric']:_0x200d22[_0x2906a9]['field'];_0x2f66f6=_0x200d22[_0x2906a9][_0x63da('0x75')]?_[_0x63da('0x76')](_0x86380d[_0x200d22[_0x2906a9][_0x63da('0x75')]],'%s',_0x2f66f6):_0x2f66f6;_0x2f66f6=_0x200d22[_0x2906a9]['format']?_[_0x63da('0x76')](_0x42b4f5[_0x200d22[_0x2906a9][_0x63da('0x77')]],'%s',_0x2f66f6):_0x2f66f6;if(_0x200d22[_0x2906a9][_0x63da('0x78')]){_0x44e016[_0x63da('0x68')](_0x2f66f6);}_0x200d22[_0x2906a9][_0x63da('0x79')]&&_0x44e016[_0x63da('0x3e')](_0x2f66f6,_0x200d22[_0x2906a9][_0x63da('0x79')]==='DESC'?![]:!![]);_0x44e016[_0x63da('0x69')](_0x2f66f6,_0x200d22[_0x2906a9]['alias']||_0x2f66f6);}if(_0x64c3a6[_0x63da('0x7c')]){_0x64c3a6[_0x63da('0x7c')]=JSON[_0x63da('0x7d')](_0x64c3a6[_0x63da('0x7c')]);for(var _0xce573=0x0;_0xce573<_0x64c3a6[_0x63da('0x7c')][_0x63da('0x3b')];_0xce573+=0x1){if(_0x64c3a6['joins'][_0xce573][_0x63da('0x34')]&&_[_0x63da('0x62')](_0x3e5fa8,_0x64c3a6[_0x63da('0x7c')][_0xce573][_0x63da('0x34')])&&_0x64c3a6['joins'][_0xce573][_0x63da('0x80')]&&_0x64c3a6[_0x63da('0x7c')][_0xce573][_0x63da('0x7e')]&&_0x64c3a6[_0x63da('0x7c')][_0xce573][_0x63da('0x7f')]){_0x44e016[_0x64c3a6[_0x63da('0x7c')][_0xce573]['type']](_0x64c3a6[_0x63da('0x7c')][_0xce573][_0x63da('0x7e')],null,util['format'](_0x63da('0x8f'),_0x64c3a6[_0x63da('0x73')],_0x64c3a6[_0x63da('0x7c')][_0xce573][_0x63da('0x80')],_0x64c3a6[_0x63da('0x7c')][_0xce573][_0x63da('0x7e')],_0x64c3a6['joins'][_0xce573]['foreignKey']));}}}if(_0x64c3a6[_0x63da('0x81')]){_0x64c3a6['conditions']=JSON[_0x63da('0x7d')](_0x64c3a6[_0x63da('0x81')]);_0x44e016[_0x63da('0x82')](_0x4e3c20(_0x64c3a6['conditions'][_0x63da('0x68')]));}_0x1a2f84=_0x44e016[_0x63da('0x90')]();_0x44e016[_0x63da('0x20')](_0x7990d7);_0x44e016[_0x63da('0x1e')](0x0);return;}})[_0x63da('0x28')](function(){if(_0x4957f5[_0x63da('0x91')]===_0x63da('0x92')){return null;}var _0x508f1f=_[_0x63da('0x49')](_0x4957f5,{'name':_0x4957f5[_0x63da('0x93')]||_0x4957f5[_0x63da('0x2d')]||_0x64c3a6[_0x63da('0x2d')],'basename':_0x2e262a,'savename':util[_0x63da('0x77')]('%s-%s.%s',_0x4957f5[_0x63da('0x2d')]||_0x64c3a6[_0x63da('0x2d')],require('randomstring')[_0x63da('0x94')](0x4),_0x4957f5[_0x63da('0x91')]||_0x63da('0x95')),'reportId':_0x64c3a6['id'],'reportType':_0x63da('0x96')});return db[_0x63da('0x97')][_0x63da('0x4b')](_0x508f1f,{'raw':!![]});})[_0x63da('0x28')](function(_0x13077b){if(_0x64c3a6[_0x63da('0x73')]===_0x63da('0x98')){_0x1a2f84[_0x63da('0x82')](_0x64c3a6['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4957f5['startDate'],_0x4957f5['endDate']);}else{_0x1a2f84[_0x63da('0x82')](_0x64c3a6['table']+_0x63da('0x99'),_0x4957f5[_0x63da('0x9a')],_0x4957f5[_0x63da('0x9b')]);}if(_0x13077b){logger[_0x63da('0x9c')]('Run\x20Query:',_0x1a2f84['toString']());require(_0x63da('0x9d'))[_0x63da('0x9e')](path[_0x63da('0x54')](__dirname,_0x63da('0x9f'),_0x13077b[_0x63da('0x91')]),[_0x13077b['id'],_0x1a2f84[_0x63da('0x85')](),path[_0x63da('0x54')](__dirname,_0x63da('0xa0'),_0x13077b[_0x63da('0xa1')]),_0x2e262a]);return _0x13077b;}else{var _0x2c04ac=squel['select']();_0x2c04ac[_0x63da('0x72')]('('+_0x1a2f84[_0x63da('0x85')]()+')',_0x63da('0xa2'));_0x2c04ac[_0x63da('0x69')](_0x63da('0xa3'),_0x63da('0x21'));_0x1a2f84[_0x63da('0x20')](_0x4957f5[_0x63da('0x20')]||_0x7990d7);_0x1a2f84['offset'](_0x4957f5[_0x63da('0x1e')]||0x0);return dbH['sequelize'][_0x63da('0x35')](_0x2c04ac[_0x63da('0x85')](),{'type':dbH[_0x63da('0xa4')]['QueryTypes'][_0x63da('0x87')]})['then'](function(_0x284563){if(!_0x284563['length']){_0x27adb9=0x0;}else{_0x27adb9=_0x284563[0x0][_0x63da('0x21')]||0x0;}return dbH['sequelize'][_0x63da('0x35')](_0x1a2f84[_0x63da('0x85')](),{'type':dbH[_0x63da('0xa4')]['QueryTypes'][_0x63da('0x87')]});})[_0x63da('0x28')](function(_0x361397){return{'rows':_0x361397||[],'count':_0x27adb9};});}});}exports['run']=function(_0x4bdebf,_0x2c690e){return runReport(_0x4bdebf[_0x63da('0x48')],_0x4bdebf['query'],_0x4bdebf[_0x63da('0x42')])[_0x63da('0x28')](respondWithResult(_0x2c690e,null))[_0x63da('0x46')](handleError(_0x2c690e,null));};exports[_0x63da('0xa5')]=runReport;exports[_0x63da('0x35')]=function(_0x4312dd,_0xf4f38d){var _0x167411=0xa;var _0x1ea9e7=[_0x63da('0x54'),'left_join',_0x63da('0x55'),_0x63da('0x56')];var _0x3cf3f4={'SUM':_0x63da('0x57'),'COUNT':_0x63da('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x63da('0x59'),'MIN':_0x63da('0x8a'),'AVG':_0x63da('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x63da('0x5d')};var _0x399571={'SEC_TO_TIME':_0x63da('0x8b'),'DATE':_0x63da('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x63da('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x40992e=function(_0x527ca0){return!_[_0x63da('0x62')]([_0x63da('0x63'),_0x63da('0x8c'),_0x63da('0x64'),_0x63da('0x65')],_0x527ca0);};var _0x28874b=function(_0x2cbecf){if(!_0x2cbecf||!_0x2cbecf[_0x63da('0x66')][_0x63da('0x3b')]){return'';}for(var _0x2afb51='(',_0xb771cb=0x0;_0xb771cb<_0x2cbecf['rules'][_0x63da('0x3b')];_0xb771cb+=0x1){_0xb771cb>0x0&&(_0x2afb51+='\x20'+_0x2cbecf['operator']+'\x20');_0x2afb51+=_0x2cbecf[_0x63da('0x66')][_0xb771cb][_0x63da('0x68')]?_0x28874b(_0x2cbecf[_0x63da('0x66')][_0xb771cb]['group']):_0x2cbecf['rules'][_0xb771cb][_0x63da('0x69')]+'\x20'+_0x2cbecf[_0x63da('0x66')][_0xb771cb][_0x63da('0x6a')]+(_0x40992e(_0x2cbecf['rules'][_0xb771cb][_0x63da('0x6a')])?'\x20'+_0x2cbecf[_0x63da('0x66')][_0xb771cb][_0x63da('0x6b')]:'');}return _0x2afb51+')';};var _0x3d4dd6={'where':{'id':_0x4312dd[_0x63da('0x48')]['id']}},_0x521e3f,_0x5e11bd,_0x581bca,_0x48edda,_0x48a5a4;_0x3d4dd6=_[_0x63da('0x49')]({},_0x3d4dd6,_0x4312dd[_0x63da('0x42')]);return db[_0x63da('0x31')][_0x63da('0x4a')](_0x3d4dd6)[_0x63da('0x28')](function(_0x14763c){if(_0x14763c){_0x521e3f=_0x14763c;return _0x14763c[_0x63da('0x6c')]();}return null;})[_0x63da('0x28')](function(_0x4d6e9a){if(_0x4d6e9a){if(!_0x4d6e9a[_0x63da('0x3b')]){throw new db[(_0x63da('0x8d'))][(_0x63da('0x6d'))](_0x63da('0x6e'),0x193);}_0x5e11bd=_0x4d6e9a;return db[_0x63da('0x6f')][_0x63da('0x8e')]({'raw':!![]});}return null;})['then'](function(_0x42e36d){if(_0x42e36d){_0x581bca=_[_0x63da('0x70')](_0x42e36d,'id');var _0xa1aa4f;var _0x3c4d14=squel[_0x63da('0x71')]();_0x3c4d14[_0x63da('0x72')](_0x521e3f[_0x63da('0x73')]);for(var _0x29b03c=0x0;_0x29b03c<_0x5e11bd['length'];_0x29b03c+=0x1){_0xa1aa4f=_0x5e11bd[_0x29b03c]['MetricId']?_0x581bca[_0x5e11bd[_0x29b03c][_0x63da('0x74')]][_0x63da('0xa6')]:_0x5e11bd[_0x29b03c][_0x63da('0x69')];_0xa1aa4f=_0x5e11bd[_0x29b03c][_0x63da('0x75')]?_[_0x63da('0x76')](_0x3cf3f4[_0x5e11bd[_0x29b03c][_0x63da('0x75')]],'%s',_0xa1aa4f):_0xa1aa4f;_0xa1aa4f=_0x5e11bd[_0x29b03c][_0x63da('0x77')]?_[_0x63da('0x76')](_0x399571[_0x5e11bd[_0x29b03c]['format']],'%s',_0xa1aa4f):_0xa1aa4f;if(_0x5e11bd[_0x29b03c][_0x63da('0x78')]){_0x3c4d14[_0x63da('0x68')](_0xa1aa4f);}_0x5e11bd[_0x29b03c]['orderBy']&&_0x3c4d14[_0x63da('0x3e')](_0xa1aa4f,_0x5e11bd[_0x29b03c]['orderBy']===_0x63da('0x7a')?![]:!![]);_0x3c4d14['field'](_0xa1aa4f,_0x5e11bd[_0x29b03c]['alias']||_0xa1aa4f);}if(_0x521e3f[_0x63da('0x7c')]){_0x521e3f[_0x63da('0x7c')]=JSON[_0x63da('0x7d')](_0x521e3f[_0x63da('0x7c')]);for(var _0x406b0c=0x0;_0x406b0c<_0x521e3f[_0x63da('0x7c')][_0x63da('0x3b')];_0x406b0c+=0x1){if(_0x521e3f[_0x63da('0x7c')][_0x406b0c][_0x63da('0x34')]&&_['includes'](_0x1ea9e7,_0x521e3f[_0x63da('0x7c')][_0x406b0c][_0x63da('0x34')])&&_0x521e3f[_0x63da('0x7c')][_0x406b0c][_0x63da('0x80')]&&_0x521e3f['joins'][_0x406b0c][_0x63da('0x7e')]&&_0x521e3f[_0x63da('0x7c')][_0x406b0c][_0x63da('0x7f')]){_0x3c4d14[_0x521e3f['joins'][_0x406b0c][_0x63da('0x34')]](_0x521e3f[_0x63da('0x7c')][_0x406b0c][_0x63da('0x7e')],null,util['format'](_0x63da('0x8f'),_0x521e3f[_0x63da('0x73')],_0x521e3f[_0x63da('0x7c')][_0x406b0c]['parentKey'],_0x521e3f[_0x63da('0x7c')][_0x406b0c][_0x63da('0x7e')],_0x521e3f[_0x63da('0x7c')][_0x406b0c][_0x63da('0x7f')]));}}}if(_0x521e3f['conditions']){_0x521e3f['conditions']=JSON['parse'](_0x521e3f[_0x63da('0x81')]);_0x3c4d14[_0x63da('0x82')](_0x28874b(_0x521e3f[_0x63da('0x81')][_0x63da('0x68')]));}_0x48a5a4=_0x3c4d14[_0x63da('0x90')]();_0x3c4d14['limit'](_0x167411);_0x3c4d14['offset'](0x0);logger[_0x63da('0x83')]('Limited\x20Query:',_0x3c4d14[_0x63da('0x85')]());return dbH['sequelize'][_0x63da('0x35')](_0x3c4d14[_0x63da('0x85')](),{'type':dbH['sequelize'][_0x63da('0x86')][_0x63da('0x87')]});}})[_0x63da('0x28')](function(){return{'sql':_0x48a5a4[_0x63da('0x85')]()};})[_0x63da('0x28')](respondWithResult(_0xf4f38d,null))[_0x63da('0x46')](handleError(_0xf4f38d,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index a388af1..260fe15 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 _0x1be8=['../../config/logger','moment','rimraf','exports','define','AnalyticCustomReport','lodash','util'];(function(_0x2cd26d,_0x1b6142){var _0x113d9d=function(_0x44172d){while(--_0x44172d){_0x2cd26d['push'](_0x2cd26d['shift']());}};_0x113d9d(++_0x1b6142);}(_0x1be8,0x196));var _0x81be=function(_0x5bf7bd,_0x52d967){_0x5bf7bd=_0x5bf7bd-0x0;var _0x4d3227=_0x1be8[_0x5bf7bd];return _0x4d3227;};'use strict';var _=require(_0x81be('0x0'));var util=require(_0x81be('0x1'));var logger=require(_0x81be('0x2'))('api');var moment=require(_0x81be('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x81be('0x4'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x81be('0x5')]=function(_0x35579c,_0x218929){return _0x35579c[_0x81be('0x6')](_0x81be('0x7'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d4e=['../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment','request-promise','rimraf'];(function(_0x232dab,_0x597683){var _0xd0193d=function(_0x233a02){while(--_0x233a02){_0x232dab['push'](_0x232dab['shift']());}};_0xd0193d(++_0x597683);}(_0x5d4e,0x1b2));var _0xe5d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d4e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe5d4('0x0'));var util=require(_0xe5d4('0x1'));var logger=require('../../config/logger')(_0xe5d4('0x2'));var moment=require(_0xe5d4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe5d4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe5d4('0x5'));var config=require(_0xe5d4('0x6'));var attributes=require(_0xe5d4('0x7'));module[_0xe5d4('0x8')]=function(_0x19f5e6,_0x1e2bf9){return _0x19f5e6['define'](_0xe5d4('0x9'),attributes,{'tableName':_0xe5d4('0xa'),'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 5d47e0c..50757d5 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 _0xda73=['request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','jayson/promise','client','http','then','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x12ccce,_0x17661b){var _0x53cb19=function(_0x53daf4){while(--_0x53daf4){_0x12ccce['push'](_0x12ccce['shift']());}};_0x53cb19(++_0x17661b);}(_0xda73,0xb5));var _0x3da7=function(_0x57d24d,_0x1e2554){_0x57d24d=_0x57d24d-0x0;var _0xacd5eb=_0xda73[_0x57d24d];return _0xacd5eb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3da7('0x0'));var BPromise=require(_0x3da7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3da7('0x2'));var db=require(_0x3da7('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3da7('0x4'));var client=jayson[_0x3da7('0x5')][_0x3da7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x538939,_0x2e58ef,_0x1815a4){return new BPromise(function(_0x10064d,_0x62e806){return client['request'](_0x538939,_0x1815a4)[_0x3da7('0x7')](function(_0x3ff85e){logger['info'](_0x3da7('0x8'),_0x2e58ef,_0x3da7('0x9'));logger[_0x3da7('0xa')](_0x3da7('0xb'),_0x2e58ef,_0x3da7('0x9'),JSON[_0x3da7('0xc')](_0x3ff85e));if(_0x3ff85e[_0x3da7('0xd')]){if(_0x3ff85e['error'][_0x3da7('0xe')]===0x1f4){logger['error'](_0x3da7('0x8'),_0x2e58ef,_0x3ff85e[_0x3da7('0xd')]['message']);return _0x62e806(_0x3ff85e[_0x3da7('0xd')][_0x3da7('0xf')]);}logger[_0x3da7('0xd')](_0x3da7('0x8'),_0x2e58ef,_0x3ff85e[_0x3da7('0xd')][_0x3da7('0xf')]);return _0x10064d(_0x3ff85e['error'][_0x3da7('0xf')]);}else{logger[_0x3da7('0x10')](_0x3da7('0x8'),_0x2e58ef,_0x3da7('0x9'));_0x10064d(_0x3ff85e[_0x3da7('0x11')][_0x3da7('0xf')]);}})[_0x3da7('0x12')](function(_0x55f209){logger[_0x3da7('0xd')](_0x3da7('0x8'),_0x2e58ef,_0x55f209);_0x62e806(_0x55f209);});});} \ No newline at end of file +var _0x5283=['util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x3f7e76,_0x512f5f){var _0x4565bb=function(_0x1af414){while(--_0x1af414){_0x3f7e76['push'](_0x3f7e76['shift']());}};_0x4565bb(++_0x512f5f);}(_0x5283,0x143));var _0x3528=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0x5283[_0x3e21f4];return _0x40fc49;};'use strict';var _=require('lodash');var util=require(_0x3528('0x0'));var moment=require(_0x3528('0x1'));var BPromise=require('bluebird');var rs=require(_0x3528('0x2'));var fs=require('fs');var Redis=require(_0x3528('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3528('0x4'))(_0x3528('0x5'));var config=require(_0x3528('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3528('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x390988,_0x401ed5,_0x5b0438){return new BPromise(function(_0x2ba11f,_0x13c0ab){return client[_0x3528('0x8')](_0x390988,_0x5b0438)['then'](function(_0x5622a9){logger[_0x3528('0x9')](_0x3528('0xa'),_0x401ed5,'request\x20sent');logger[_0x3528('0xb')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x401ed5,_0x3528('0xc'),JSON[_0x3528('0xd')](_0x5622a9));if(_0x5622a9[_0x3528('0xe')]){if(_0x5622a9[_0x3528('0xe')][_0x3528('0xf')]===0x1f4){logger['error'](_0x3528('0xa'),_0x401ed5,_0x5622a9['error'][_0x3528('0x10')]);return _0x13c0ab(_0x5622a9['error'][_0x3528('0x10')]);}logger[_0x3528('0xe')](_0x3528('0xa'),_0x401ed5,_0x5622a9[_0x3528('0xe')][_0x3528('0x10')]);return _0x2ba11f(_0x5622a9[_0x3528('0xe')]['message']);}else{logger[_0x3528('0x9')](_0x3528('0xa'),_0x401ed5,_0x3528('0xc'));_0x2ba11f(_0x5622a9[_0x3528('0x11')][_0x3528('0x10')]);}})[_0x3528('0x12')](function(_0x37daf5){logger[_0x3528('0xe')](_0x3528('0xa'),_0x401ed5,_0x37daf5);_0x13c0ab(_0x37daf5);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 7750a3a..57c1f0b 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 _0x2d6a=['run','/:id/query','post','create','put','update','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run'];(function(_0x227b69,_0x4c56d6){var _0x5a3595=function(_0x625eb3){while(--_0x625eb3){_0x227b69['push'](_0x227b69['shift']());}};_0x5a3595(++_0x4c56d6);}(_0x2d6a,0xa8));var _0xa2d6=function(_0x322532,_0xd88c57){_0x322532=_0x322532-0x0;var _0x57c8b9=_0x2d6a[_0x322532];return _0x57c8b9;};'use strict';var multer=require('multer');var util=require(_0xa2d6('0x0'));var path=require(_0xa2d6('0x1'));var timeout=require(_0xa2d6('0x2'));var express=require(_0xa2d6('0x3'));var router=express['Router']();var fs_extra=require(_0xa2d6('0x4'));var auth=require(_0xa2d6('0x5'));var interaction=require(_0xa2d6('0x6'));var config=require('../../config/environment');var controller=require(_0xa2d6('0x7'));router[_0xa2d6('0x8')]('/',auth[_0xa2d6('0x9')](),controller[_0xa2d6('0xa')]);router[_0xa2d6('0x8')](_0xa2d6('0xb'),auth[_0xa2d6('0x9')](),controller[_0xa2d6('0xc')]);router[_0xa2d6('0x8')](_0xa2d6('0xd'),auth[_0xa2d6('0x9')](),controller[_0xa2d6('0xe')]);router['get'](_0xa2d6('0xf'),auth[_0xa2d6('0x9')](),controller[_0xa2d6('0x10')]);router[_0xa2d6('0x8')](_0xa2d6('0x11'),auth[_0xa2d6('0x9')](),controller['query']);router[_0xa2d6('0x12')]('/',auth[_0xa2d6('0x9')](),controller[_0xa2d6('0x13')]);router[_0xa2d6('0x14')]('/:id',auth[_0xa2d6('0x9')](),controller[_0xa2d6('0x15')]);router['delete']('/:id',auth[_0xa2d6('0x9')](),controller[_0xa2d6('0x16')]);module['exports']=router; \ No newline at end of file +var _0x6b1a=['run','/:id/query','query','post','create','put','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','show','/:id/preview','isAuthenticated','preview','/:id/run'];(function(_0x4fa67d,_0x5aa5c3){var _0x194f8f=function(_0x3353f4){while(--_0x3353f4){_0x4fa67d['push'](_0x4fa67d['shift']());}};_0x194f8f(++_0x5aa5c3);}(_0x6b1a,0xd2));var _0xa6b1=function(_0x619cb4,_0x47efe9){_0x619cb4=_0x619cb4-0x0;var _0xff0ed4=_0x6b1a[_0x619cb4];return _0xff0ed4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa6b1('0x0'));var timeout=require(_0xa6b1('0x1'));var express=require('express');var router=express[_0xa6b1('0x2')]();var fs_extra=require(_0xa6b1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa6b1('0x4'));var config=require(_0xa6b1('0x5'));var controller=require(_0xa6b1('0x6'));router[_0xa6b1('0x7')]('/',auth['isAuthenticated'](),controller[_0xa6b1('0x8')]);router[_0xa6b1('0x7')](_0xa6b1('0x9'),auth['isAuthenticated'](),controller[_0xa6b1('0xa')]);router[_0xa6b1('0x7')](_0xa6b1('0xb'),auth[_0xa6b1('0xc')](),controller[_0xa6b1('0xd')]);router[_0xa6b1('0x7')](_0xa6b1('0xe'),auth['isAuthenticated'](),controller[_0xa6b1('0xf')]);router[_0xa6b1('0x7')](_0xa6b1('0x10'),auth[_0xa6b1('0xc')](),controller[_0xa6b1('0x11')]);router[_0xa6b1('0x12')]('/',auth[_0xa6b1('0xc')](),controller[_0xa6b1('0x13')]);router[_0xa6b1('0x14')](_0xa6b1('0x9'),auth[_0xa6b1('0xc')](),controller[_0xa6b1('0x15')]);router[_0xa6b1('0x16')]('/:id',auth[_0xa6b1('0xc')](),controller[_0xa6b1('0x17')]);module[_0xa6b1('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 0eafec0..0f36276 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 _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x4669b9,_0xae07ab){var _0x31cf78=function(_0x5cabb1){while(--_0x5cabb1){_0x4669b9['push'](_0x4669b9['shift']());}};_0x31cf78(++_0xae07ab);}(_0xd8fb,0x99));var _0xbd8f=function(_0x2e06d1,_0x408878){_0x2e06d1=_0x2e06d1-0x0;var _0x36e3e9=_0xd8fb[_0x2e06d1];return _0x36e3e9;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}}; \ No newline at end of file +var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0xfdbd[_0x2c1114];return _0x2b877c;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 87fac6c..f92fa58 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x427006,_0x5889d9){var _0x49b183=function(_0x5526b9){while(--_0x5526b9){_0x427006['push'](_0x427006['shift']());}};_0x49b183(++_0x5889d9);}(_0x1261,0x144));var _0x1126=function(_0x75e866,_0x30b4de){_0x75e866=_0x75e866-0x0;var _0x5e4b64=_0x1261[_0x75e866];return _0x5e4b64;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));}; \ No newline at end of file +var _0x687b=['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','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0x687b[_0x3e0763];return _0x351ca2;};'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'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 4c806f6..a2e01c7 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 _0xecbf=['request-promise','path','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x24cf2e,_0x141f1d){var _0xb81932=function(_0x10fa0e){while(--_0x10fa0e){_0x24cf2e['push'](_0x24cf2e['shift']());}};_0xb81932(++_0x141f1d);}(_0xecbf,0xa3));var _0xfecb=function(_0x47bea2,_0x5e25db){_0x47bea2=_0x47bea2-0x0;var _0x7e1b08=_0xecbf[_0x47bea2];return _0x7e1b08;};'use strict';var _=require(_0xfecb('0x0'));var util=require('util');var logger=require(_0xfecb('0x1'))(_0xfecb('0x2'));var moment=require(_0xfecb('0x3'));var BPromise=require(_0xfecb('0x4'));var rp=require(_0xfecb('0x5'));var fs=require('fs');var path=require(_0xfecb('0x6'));var rimraf=require('rimraf');var config=require(_0xfecb('0x7'));var attributes=require(_0xfecb('0x8'));module['exports']=function(_0x468755,_0x2bdcaf){return _0x468755[_0xfecb('0x9')](_0xfecb('0xa'),attributes,{'tableName':_0xfecb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda16=['AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','path','rimraf','./analyticDefaultReport.attributes','define'];(function(_0xea541c,_0x121d11){var _0x551e65=function(_0x8d998c){while(--_0x8d998c){_0xea541c['push'](_0xea541c['shift']());}};_0x551e65(++_0x121d11);}(_0xda16,0x91));var _0x6da1=function(_0x3da725,_0x7c378d){_0x3da725=_0x3da725-0x0;var _0x41bd11=_0xda16[_0x3da725];return _0x41bd11;};'use strict';var _=require(_0x6da1('0x0'));var util=require(_0x6da1('0x1'));var logger=require(_0x6da1('0x2'))(_0x6da1('0x3'));var moment=require(_0x6da1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6da1('0x5'));var rimraf=require(_0x6da1('0x6'));var config=require('../../config/environment');var attributes=require(_0x6da1('0x7'));module['exports']=function(_0x1100bb,_0x320d1b){return _0x1100bb[_0x6da1('0x8')](_0x6da1('0x9'),attributes,{'tableName':_0x6da1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index c5228a5..333a963 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 _0xe6af=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0xb9b3b8,_0x1a02f2){var _0x517c9d=function(_0x3f6226){while(--_0x3f6226){_0xb9b3b8['push'](_0xb9b3b8['shift']());}};_0x517c9d(++_0x1a02f2);}(_0xe6af,0x11c));var _0xfe6a=function(_0x55db89,_0x57f9ca){_0x55db89=_0x55db89-0x0;var _0x3a9fab=_0xe6af[_0x55db89];return _0x3a9fab;};'use strict';var _=require(_0xfe6a('0x0'));var util=require(_0xfe6a('0x1'));var moment=require(_0xfe6a('0x2'));var BPromise=require(_0xfe6a('0x3'));var rs=require(_0xfe6a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe6a('0x5'))['db'];var utils=require(_0xfe6a('0x6'));var logger=require('../../config/logger')(_0xfe6a('0x7'));var config=require('../../config/environment');var jayson=require(_0xfe6a('0x8'));var client=jayson[_0xfe6a('0x9')][_0xfe6a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51cd53,_0x7c6f5c,_0x45fce2){return new BPromise(function(_0x4725eb,_0x1f7798){return client[_0xfe6a('0xb')](_0x51cd53,_0x45fce2)[_0xfe6a('0xc')](function(_0x23d13a){logger[_0xfe6a('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x7c6f5c,_0xfe6a('0xe'));logger[_0xfe6a('0xf')](_0xfe6a('0x10'),_0x7c6f5c,_0xfe6a('0xe'),JSON[_0xfe6a('0x11')](_0x23d13a));if(_0x23d13a[_0xfe6a('0x12')]){if(_0x23d13a[_0xfe6a('0x12')]['code']===0x1f4){logger[_0xfe6a('0x12')](_0xfe6a('0x13'),_0x7c6f5c,_0x23d13a[_0xfe6a('0x12')][_0xfe6a('0x14')]);return _0x1f7798(_0x23d13a['error'][_0xfe6a('0x14')]);}logger[_0xfe6a('0x12')](_0xfe6a('0x13'),_0x7c6f5c,_0x23d13a[_0xfe6a('0x12')]['message']);return _0x4725eb(_0x23d13a[_0xfe6a('0x12')][_0xfe6a('0x14')]);}else{logger[_0xfe6a('0xd')](_0xfe6a('0x13'),_0x7c6f5c,_0xfe6a('0xe'));_0x4725eb(_0x23d13a['result'][_0xfe6a('0x14')]);}})[_0xfe6a('0x15')](function(_0xc783d1){logger[_0xfe6a('0x12')](_0xfe6a('0x13'),_0x7c6f5c,_0xc783d1);_0x1f7798(_0xc783d1);});});} \ No newline at end of file +var _0xd4a2=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','stringify','error','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xd4a2,0x129));var _0x2d4a=function(_0x510801,_0x5dc617){_0x510801=_0x510801-0x0;var _0x439021=_0xd4a2[_0x510801];return _0x439021;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2d4a('0x0'));var BPromise=require(_0x2d4a('0x1'));var rs=require(_0x2d4a('0x2'));var fs=require('fs');var Redis=require(_0x2d4a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d4a('0x4'));var logger=require(_0x2d4a('0x5'))(_0x2d4a('0x6'));var config=require(_0x2d4a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2d4a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dd019,_0x448ee3,_0x16032d){return new BPromise(function(_0x16f5d0,_0x51be72){return client[_0x2d4a('0x9')](_0x4dd019,_0x16032d)[_0x2d4a('0xa')](function(_0x5ca93a){logger[_0x2d4a('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x448ee3,_0x2d4a('0xc'));logger[_0x2d4a('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x448ee3,_0x2d4a('0xc'),JSON[_0x2d4a('0xe')](_0x5ca93a));if(_0x5ca93a['error']){if(_0x5ca93a[_0x2d4a('0xf')]['code']===0x1f4){logger[_0x2d4a('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x448ee3,_0x5ca93a[_0x2d4a('0xf')][_0x2d4a('0x10')]);return _0x51be72(_0x5ca93a[_0x2d4a('0xf')][_0x2d4a('0x10')]);}logger[_0x2d4a('0xf')](_0x2d4a('0x11'),_0x448ee3,_0x5ca93a[_0x2d4a('0xf')][_0x2d4a('0x10')]);return _0x16f5d0(_0x5ca93a['error'][_0x2d4a('0x10')]);}else{logger['info'](_0x2d4a('0x11'),_0x448ee3,_0x2d4a('0xc'));_0x16f5d0(_0x5ca93a[_0x2d4a('0x12')][_0x2d4a('0x10')]);}})[_0x2d4a('0x13')](function(_0xabd175){logger[_0x2d4a('0xf')](_0x2d4a('0x11'),_0x448ee3,_0xabd175);_0x51be72(_0xabd175);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 85006b9..73c01ed 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 _0x8163=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','preview','/:id/query','query','create','delete','destroy','multer','util','path'];(function(_0x153304,_0x25da33){var _0x479c46=function(_0x3335c2){while(--_0x3335c2){_0x153304['push'](_0x153304['shift']());}};_0x479c46(++_0x25da33);}(_0x8163,0x1d8));var _0x3816=function(_0xfff114,_0x5943d6){_0xfff114=_0xfff114-0x0;var _0x26ce1d=_0x8163[_0xfff114];return _0x26ce1d;};'use strict';var multer=require(_0x3816('0x0'));var util=require(_0x3816('0x1'));var path=require(_0x3816('0x2'));var timeout=require(_0x3816('0x3'));var express=require(_0x3816('0x4'));var router=express[_0x3816('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3816('0x6'));var interaction=require(_0x3816('0x7'));var config=require('../../config/environment');var controller=require(_0x3816('0x8'));router['get']('/',auth[_0x3816('0x9')](),controller[_0x3816('0xa')]);router[_0x3816('0xb')](_0x3816('0xc'),auth[_0x3816('0x9')](),controller['show']);router[_0x3816('0xb')]('/:id/preview',auth[_0x3816('0x9')](),controller[_0x3816('0xd')]);router[_0x3816('0xb')]('/:id/run',auth[_0x3816('0x9')](),controller['run']);router[_0x3816('0xb')](_0x3816('0xe'),auth[_0x3816('0x9')](),controller[_0x3816('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3816('0x10')]);router['put'](_0x3816('0xc'),auth[_0x3816('0x9')](),controller['update']);router[_0x3816('0x11')](_0x3816('0xc'),auth[_0x3816('0x9')](),controller[_0x3816('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9b44=['preview','/:id/run','run','/:id/query','query','put','/:id','update','delete','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id/preview'];(function(_0x467db8,_0x41f547){var _0x26afff=function(_0x35cfe8){while(--_0x35cfe8){_0x467db8['push'](_0x467db8['shift']());}};_0x26afff(++_0x41f547);}(_0x9b44,0xb2));var _0x49b4=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0x9b44[_0x2ff238];return _0x204a56;};'use strict';var multer=require(_0x49b4('0x0'));var util=require(_0x49b4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x49b4('0x2'));var router=express['Router']();var fs_extra=require(_0x49b4('0x3'));var auth=require(_0x49b4('0x4'));var interaction=require(_0x49b4('0x5'));var config=require('../../config/environment');var controller=require(_0x49b4('0x6'));router[_0x49b4('0x7')]('/',auth[_0x49b4('0x8')](),controller[_0x49b4('0x9')]);router[_0x49b4('0x7')]('/:id',auth[_0x49b4('0x8')](),controller['show']);router[_0x49b4('0x7')](_0x49b4('0xa'),auth['isAuthenticated'](),controller[_0x49b4('0xb')]);router['get'](_0x49b4('0xc'),auth[_0x49b4('0x8')](),controller[_0x49b4('0xd')]);router[_0x49b4('0x7')](_0x49b4('0xe'),auth[_0x49b4('0x8')](),controller[_0x49b4('0xf')]);router['post']('/',auth[_0x49b4('0x8')](),controller['create']);router[_0x49b4('0x10')](_0x49b4('0x11'),auth[_0x49b4('0x8')](),controller[_0x49b4('0x12')]);router[_0x49b4('0x13')]('/:id',auth[_0x49b4('0x8')](),controller['destroy']);module[_0x49b4('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 5aa11be..9675e92 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 _0x6a99=['sequelize','moment','STRING','ENUM','csv','xlsx','DATE','Loading','manual','scheduled','INTEGER'];(function(_0xfbfd77,_0x920bcd){var _0x2ede18=function(_0x15a590){while(--_0x15a590){_0xfbfd77['push'](_0xfbfd77['shift']());}};_0x2ede18(++_0x920bcd);}(_0x6a99,0x84));var _0x96a9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6a99[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x96a9('0x0'));var moment=require(_0x96a9('0x1'));module['exports']={'name':{'type':Sequelize[_0x96a9('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x96a9('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x96a9('0x3')](_0x96a9('0x4'),'pdf',_0x96a9('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x96a9('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x96a9('0x2')],'defaultValue':_0x96a9('0x7')},'type':{'type':Sequelize[_0x96a9('0x3')](_0x96a9('0x8'),_0x96a9('0x9')),'allowNull':![],'defaultValue':_0x96a9('0x8')},'reportId':{'type':Sequelize[_0x96a9('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf020=['exports','STRING','csv','pdf','xlsx','DATE','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xf020,0xa7));var _0x0f02=function(_0x522dff,_0x5ae644){_0x522dff=_0x522dff-0x0;var _0x4fccc9=_0xf020[_0x522dff];return _0x4fccc9;};'use strict';var Sequelize=require(_0x0f02('0x0'));var moment=require('moment');module[_0x0f02('0x1')]={'name':{'type':Sequelize[_0x0f02('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x0f02('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x0f02('0x3'),_0x0f02('0x4'),_0x0f02('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x0f02('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0f02('0x6')]},'endDate':{'type':Sequelize[_0x0f02('0x6')]},'status':{'type':Sequelize[_0x0f02('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x0f02('0x7')](_0x0f02('0x8'),_0x0f02('0x9')),'allowNull':![],'defaultValue':_0x0f02('0x8')},'reportId':{'type':Sequelize[_0x0f02('0xa')](0xb)[_0x0f02('0xb')]},'reportType':{'type':Sequelize[_0x0f02('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index e512956..eb07812 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 _0xf2d3=['undefined','limit','count','set','Content-Range','reject','update','destroy','then','get','ExtractedReports','UserProfileResource','status','sendStatus','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','params','find','catch','create','body','role','user','UserProfileSection','userProfileId','download','savename','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','basename','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset'];(function(_0x32e3ca,_0x2045cf){var _0x279952=function(_0x31c4cd){while(--_0x31c4cd){_0x32e3ca['push'](_0x32e3ca['shift']());}};_0x279952(++_0x2045cf);}(_0xf2d3,0xff));var _0x3f2d=function(_0x50d8cd,_0x471c05){_0x50d8cd=_0x50d8cd-0x0;var _0xbd9dae=_0xf2d3[_0x50d8cd];return _0xbd9dae;};'use strict';var emlformat=require(_0x3f2d('0x0'));var rimraf=require(_0x3f2d('0x1'));var zipdir=require(_0x3f2d('0x2'));var jsonpatch=require(_0x3f2d('0x3'));var rp=require(_0x3f2d('0x4'));var moment=require('moment');var BPromise=require(_0x3f2d('0x5'));var Mustache=require('mustache');var util=require(_0x3f2d('0x6'));var path=require(_0x3f2d('0x7'));var sox=require(_0x3f2d('0x8'));var csv=require(_0x3f2d('0x9'));var ejs=require(_0x3f2d('0xa'));var fs=require('fs');var fs_extra=require(_0x3f2d('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3f2d('0xc'));var jsforce=require(_0x3f2d('0xd'));var deskjs=require(_0x3f2d('0xe'));var toCsv=require(_0x3f2d('0x9'));var querystring=require(_0x3f2d('0xf'));var Papa=require(_0x3f2d('0x10'));var Redis=require('ioredis');var authService=require(_0x3f2d('0x11'));var qs=require(_0x3f2d('0x12'));var as=require(_0x3f2d('0x13'));var hardwareService=require(_0x3f2d('0x14'));var logger=require(_0x3f2d('0x15'))(_0x3f2d('0x16'));var utils=require(_0x3f2d('0x17'));var config=require(_0x3f2d('0x18'));var licenseUtil=require(_0x3f2d('0x19'));var db=require(_0x3f2d('0x1a'))['db'];function respondWithStatusCode(_0x59455a,_0x35b953){_0x35b953=_0x35b953||0xcc;return function(_0x1fc48f){if(_0x1fc48f){return _0x59455a['sendStatus'](_0x35b953);}return _0x59455a['status'](_0x35b953)[_0x3f2d('0x1b')]();};}function respondWithResult(_0x4adb63,_0x17d69a){_0x17d69a=_0x17d69a||0xc8;return function(_0x5ce2ce){if(_0x5ce2ce){return _0x4adb63['status'](_0x17d69a)[_0x3f2d('0x1c')](_0x5ce2ce);}};}function respondWithFilteredResult(_0x1f7597,_0xcc881){return function(_0x4ad4fa){if(_0x4ad4fa){var _0x454d7d=typeof _0xcc881[_0x3f2d('0x1d')]===_0x3f2d('0x1e')&&typeof _0xcc881[_0x3f2d('0x1f')]==='undefined';var _0x23feb0=_0x4ad4fa[_0x3f2d('0x20')];var _0x23feb1=_0x454d7d?0x0:_0xcc881[_0x3f2d('0x1d')];var _0x274159=_0x454d7d?_0x4ad4fa['count']:_0xcc881[_0x3f2d('0x1d')]+_0xcc881[_0x3f2d('0x1f')];var _0x4b3a4b;if(_0x274159>=_0x23feb0){_0x274159=_0x23feb0;_0x4b3a4b=0xc8;}else{_0x4b3a4b=0xce;}_0x1f7597['status'](_0x4b3a4b);return _0x1f7597[_0x3f2d('0x21')](_0x3f2d('0x22'),_0x23feb1+'-'+_0x274159+'/'+_0x23feb0)[_0x3f2d('0x1c')](_0x4ad4fa);}return null;};}function patchUpdates(_0x44d418){return function(_0x1153b3){try{jsonpatch['apply'](_0x1153b3,_0x44d418,!![]);}catch(_0xd7fe4d){return BPromise[_0x3f2d('0x23')](_0xd7fe4d);}return _0x1153b3['save']();};}function saveUpdates(_0x5e876c,_0x351b6c){return function(_0x205657){if(_0x205657){return _0x205657[_0x3f2d('0x24')](_0x5e876c)['then'](function(_0x9cd9f0){return _0x9cd9f0;});}return null;};}function removeEntity(_0x14b20d,_0x2d93a3){return function(_0x3ecc70){if(_0x3ecc70){return _0x3ecc70[_0x3f2d('0x25')]()[_0x3f2d('0x26')](function(){var _0x49bf88=_0x3ecc70[_0x3f2d('0x27')]({'plain':!![]});var _0x18a971=_0x3f2d('0x28');return db[_0x3f2d('0x29')][_0x3f2d('0x25')]({'where':{'type':_0x18a971,'resourceId':_0x49bf88['id']}})['then'](function(){return _0x3ecc70;});})[_0x3f2d('0x26')](function(){_0x14b20d[_0x3f2d('0x2a')](0xcc)[_0x3f2d('0x1b')]();});}};}function handleEntityNotFound(_0xa8a9d,_0x10854e){return function(_0x2d9fc5){if(!_0x2d9fc5){_0xa8a9d[_0x3f2d('0x2b')](0x194);}return _0x2d9fc5;};}function handleError(_0x23ee64,_0x447e0b){_0x447e0b=_0x447e0b||0x1f4;return function(_0x26b4f8){logger['error'](_0x26b4f8['stack']);if(_0x26b4f8[_0x3f2d('0x2c')]){delete _0x26b4f8[_0x3f2d('0x2c')];}_0x23ee64[_0x3f2d('0x2a')](_0x447e0b)[_0x3f2d('0x2d')](_0x26b4f8);};}exports[_0x3f2d('0x2e')]=function(_0x430f31,_0x5a3a5f){var _0x3cbe1f={},_0x214023={},_0x24d61f={'count':0x0,'rows':[]};var _0x47bd00=_[_0x3f2d('0x2f')](db[_0x3f2d('0x30')][_0x3f2d('0x31')],function(_0x5baa0c){return{'name':_0x5baa0c[_0x3f2d('0x32')],'type':_0x5baa0c[_0x3f2d('0x33')]['key']};});_0x214023[_0x3f2d('0x34')]=_[_0x3f2d('0x2f')](_0x47bd00,_0x3f2d('0x2c'));_0x214023[_0x3f2d('0x35')]=_[_0x3f2d('0x36')](_0x430f31[_0x3f2d('0x35')]);_0x214023['filters']=_[_0x3f2d('0x37')](_0x214023['model'],_0x214023[_0x3f2d('0x35')]);_0x3cbe1f[_0x3f2d('0x38')]=_['intersection'](_0x214023['model'],qs[_0x3f2d('0x39')](_0x430f31[_0x3f2d('0x35')][_0x3f2d('0x39')]));_0x3cbe1f[_0x3f2d('0x38')]=_0x3cbe1f[_0x3f2d('0x38')][_0x3f2d('0x3a')]?_0x3cbe1f[_0x3f2d('0x38')]:_0x214023['model'];if(!_0x430f31['query']['hasOwnProperty'](_0x3f2d('0x3b'))){_0x3cbe1f[_0x3f2d('0x1f')]=qs['limit'](_0x430f31['query'][_0x3f2d('0x1f')]);_0x3cbe1f['offset']=qs[_0x3f2d('0x1d')](_0x430f31[_0x3f2d('0x35')][_0x3f2d('0x1d')]);}_0x3cbe1f[_0x3f2d('0x3c')]=qs[_0x3f2d('0x3d')](_0x430f31[_0x3f2d('0x35')][_0x3f2d('0x3d')]);_0x3cbe1f[_0x3f2d('0x3e')]=qs[_0x3f2d('0x3f')](_[_0x3f2d('0x40')](_0x430f31[_0x3f2d('0x35')],_0x214023[_0x3f2d('0x3f')]),_0x47bd00);if(_0x430f31['query'][_0x3f2d('0x41')]){_0x3cbe1f[_0x3f2d('0x3e')]=_[_0x3f2d('0x42')](_0x3cbe1f['where'],{'$or':_[_0x3f2d('0x2f')](_0x47bd00,function(_0x3d9501){if(_0x3d9501[_0x3f2d('0x33')]!==_0x3f2d('0x43')){var _0x4ae66d={};_0x4ae66d[_0x3d9501[_0x3f2d('0x2c')]]={'$like':'%'+_0x430f31[_0x3f2d('0x35')][_0x3f2d('0x41')]+'%'};return _0x4ae66d;}})});}_0x3cbe1f=_['merge']({},_0x3cbe1f,_0x430f31[_0x3f2d('0x44')]);var _0x234cac={'where':_0x3cbe1f['where']};return db[_0x3f2d('0x30')][_0x3f2d('0x20')](_0x234cac)[_0x3f2d('0x26')](function(_0x1c4e43){_0x24d61f['count']=_0x1c4e43;if(_0x430f31[_0x3f2d('0x35')][_0x3f2d('0x45')]){_0x3cbe1f[_0x3f2d('0x46')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x3cbe1f);})[_0x3f2d('0x26')](function(_0x40e323){_0x24d61f['rows']=_0x40e323;return _0x24d61f;})['then'](respondWithFilteredResult(_0x5a3a5f,_0x3cbe1f))['catch'](handleError(_0x5a3a5f,null));};exports['show']=function(_0x3769e2,_0x270f4f){var _0x2c989c={'raw':!![],'where':{'id':_0x3769e2[_0x3f2d('0x47')]['id']}},_0x57be4b={};_0x57be4b['model']=_[_0x3f2d('0x36')](db['AnalyticExtractedReport']['rawAttributes']);_0x57be4b[_0x3f2d('0x35')]=_['keys'](_0x3769e2[_0x3f2d('0x35')]);_0x57be4b[_0x3f2d('0x3f')]=_[_0x3f2d('0x37')](_0x57be4b['model'],_0x57be4b['query']);_0x2c989c[_0x3f2d('0x38')]=_[_0x3f2d('0x37')](_0x57be4b[_0x3f2d('0x34')],qs[_0x3f2d('0x39')](_0x3769e2[_0x3f2d('0x35')]['fields']));_0x2c989c[_0x3f2d('0x38')]=_0x2c989c[_0x3f2d('0x38')]['length']?_0x2c989c['attributes']:_0x57be4b['model'];if(_0x3769e2[_0x3f2d('0x35')][_0x3f2d('0x45')]){_0x2c989c[_0x3f2d('0x46')]=[{'all':!![]}];}_0x2c989c=_[_0x3f2d('0x42')]({},_0x2c989c,_0x3769e2[_0x3f2d('0x44')]);return db[_0x3f2d('0x30')][_0x3f2d('0x48')](_0x2c989c)[_0x3f2d('0x26')](handleEntityNotFound(_0x270f4f,null))[_0x3f2d('0x26')](respondWithResult(_0x270f4f,null))[_0x3f2d('0x49')](handleError(_0x270f4f,null));};exports[_0x3f2d('0x4a')]=function(_0x176739,_0x5c6f1e){return db['AnalyticExtractedReport'][_0x3f2d('0x4a')](_0x176739[_0x3f2d('0x4b')],{})[_0x3f2d('0x26')](function(_0x3c3130){var _0x5989ed=_0x176739['user'][_0x3f2d('0x27')]({'plain':!![]});if(!_0x5989ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5989ed[_0x3f2d('0x4c')]===_0x3f2d('0x4d')){var _0x5e45b5=_0x3c3130[_0x3f2d('0x27')]({'plain':!![]});var _0x58cddd=_0x3f2d('0x28');return db[_0x3f2d('0x4e')][_0x3f2d('0x48')]({'where':{'name':_0x58cddd,'userProfileId':_0x5989ed[_0x3f2d('0x4f')]},'raw':!![]})[_0x3f2d('0x26')](function(_0x37d755){if(_0x37d755&&_0x37d755['autoAssociation']===0x0){return db[_0x3f2d('0x29')][_0x3f2d('0x4a')]({'name':_0x5e45b5['name'],'resourceId':_0x5e45b5['id'],'type':_0x37d755[_0x3f2d('0x2c')],'sectionId':_0x37d755['id']},{})[_0x3f2d('0x26')](function(){return _0x3c3130;});}else{return _0x3c3130;}})[_0x3f2d('0x49')](function(_0x4cf452){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cf452);throw _0x4cf452;});}return _0x3c3130;})['then'](respondWithResult(_0x5c6f1e,0xc9))[_0x3f2d('0x49')](handleError(_0x5c6f1e,null));};exports[_0x3f2d('0x24')]=function(_0x26a819,_0x4d303e){if(_0x26a819[_0x3f2d('0x4b')]['id']){delete _0x26a819[_0x3f2d('0x4b')]['id'];}return db[_0x3f2d('0x30')][_0x3f2d('0x48')]({'where':{'id':_0x26a819['params']['id']}})[_0x3f2d('0x26')](handleEntityNotFound(_0x4d303e,null))[_0x3f2d('0x26')](saveUpdates(_0x26a819[_0x3f2d('0x4b')],null))[_0x3f2d('0x26')](respondWithResult(_0x4d303e,null))[_0x3f2d('0x49')](handleError(_0x4d303e,null));};exports[_0x3f2d('0x25')]=function(_0x38a392,_0x244922){return db[_0x3f2d('0x30')][_0x3f2d('0x48')]({'where':{'id':_0x38a392[_0x3f2d('0x47')]['id']}})[_0x3f2d('0x26')](handleEntityNotFound(_0x244922,null))[_0x3f2d('0x26')](removeEntity(_0x244922,null))['catch'](handleError(_0x244922,null));};exports[_0x3f2d('0x50')]=function(_0x2cb4d6,_0x337d61,_0x52a7b2){return db['AnalyticExtractedReport'][_0x3f2d('0x48')]({'where':{'id':_0x2cb4d6[_0x3f2d('0x47')]['id']},'attributes':[_0x3f2d('0x2c'),'basename',_0x3f2d('0x51'),'output'],'raw':!![]})[_0x3f2d('0x26')](handleEntityNotFound(_0x337d61,null))[_0x3f2d('0x26')](function(_0x529615){if(_0x529615){if(!fs[_0x3f2d('0x52')](path['join'](config[_0x3f2d('0x53')],_0x3f2d('0x54'),_0x529615['savename']))){throw new db[(_0x3f2d('0x55'))][(_0x3f2d('0x56'))](_0x3f2d('0x57'));}if(_0x2cb4d6[_0x3f2d('0x35')][_0x3f2d('0x58')]){return _0x337d61[_0x3f2d('0x2b')](0xc8);}return _0x337d61[_0x3f2d('0x50')](path[_0x3f2d('0x59')](config[_0x3f2d('0x53')],_0x3f2d('0x54'),_0x529615[_0x3f2d('0x51')]),util[_0x3f2d('0x5a')](_0x3f2d('0x5b'),_0x529615[_0x3f2d('0x5c')]||_0x529615['name'],_0x529615[_0x3f2d('0x5d')][_0x3f2d('0x5e')]()));}})[_0x3f2d('0x49')](handleError(_0x337d61,null));}; \ No newline at end of file +var _0xc0a6=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','findAll','rows','catch','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','exists','root','format','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','ExtractedReports','UserProfileResource','stack','name','rawAttributes','fieldName','type','model','map','keys'];(function(_0x56fb33,_0x37be08){var _0x435ee4=function(_0xa80804){while(--_0xa80804){_0x56fb33['push'](_0x56fb33['shift']());}};_0x435ee4(++_0x37be08);}(_0xc0a6,0xfc));var _0x6c0a=function(_0x536609,_0x58d4bb){_0x536609=_0x536609-0x0;var _0x3d34fd=_0xc0a6[_0x536609];return _0x3d34fd;};'use strict';var emlformat=require(_0x6c0a('0x0'));var rimraf=require(_0x6c0a('0x1'));var zipdir=require(_0x6c0a('0x2'));var jsonpatch=require(_0x6c0a('0x3'));var rp=require(_0x6c0a('0x4'));var moment=require('moment');var BPromise=require(_0x6c0a('0x5'));var Mustache=require(_0x6c0a('0x6'));var util=require(_0x6c0a('0x7'));var path=require(_0x6c0a('0x8'));var sox=require(_0x6c0a('0x9'));var csv=require(_0x6c0a('0xa'));var ejs=require(_0x6c0a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c0a('0xc'));var squel=require(_0x6c0a('0xd'));var crypto=require(_0x6c0a('0xe'));var jsforce=require(_0x6c0a('0xf'));var deskjs=require(_0x6c0a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6c0a('0x11'));var Papa=require(_0x6c0a('0x12'));var Redis=require(_0x6c0a('0x13'));var authService=require(_0x6c0a('0x14'));var qs=require(_0x6c0a('0x15'));var as=require(_0x6c0a('0x16'));var hardwareService=require(_0x6c0a('0x17'));var logger=require(_0x6c0a('0x18'))(_0x6c0a('0x19'));var utils=require(_0x6c0a('0x1a'));var config=require(_0x6c0a('0x1b'));var licenseUtil=require(_0x6c0a('0x1c'));var db=require(_0x6c0a('0x1d'))['db'];function respondWithStatusCode(_0x23190e,_0x2372d9){_0x2372d9=_0x2372d9||0xcc;return function(_0x59cbf8){if(_0x59cbf8){return _0x23190e[_0x6c0a('0x1e')](_0x2372d9);}return _0x23190e[_0x6c0a('0x1f')](_0x2372d9)[_0x6c0a('0x20')]();};}function respondWithResult(_0x80cf07,_0x28f32d){_0x28f32d=_0x28f32d||0xc8;return function(_0x14b0bf){if(_0x14b0bf){return _0x80cf07[_0x6c0a('0x1f')](_0x28f32d)[_0x6c0a('0x21')](_0x14b0bf);}};}function respondWithFilteredResult(_0x560644,_0xdd320b){return function(_0x41b1c9){if(_0x41b1c9){var _0x56cb04=typeof _0xdd320b[_0x6c0a('0x22')]===_0x6c0a('0x23')&&typeof _0xdd320b[_0x6c0a('0x24')]===_0x6c0a('0x23');var _0x13cd36=_0x41b1c9[_0x6c0a('0x25')];var _0x7db190=_0x56cb04?0x0:_0xdd320b['offset'];var _0x490250=_0x56cb04?_0x41b1c9['count']:_0xdd320b['offset']+_0xdd320b['limit'];var _0x236c2b;if(_0x490250>=_0x13cd36){_0x490250=_0x13cd36;_0x236c2b=0xc8;}else{_0x236c2b=0xce;}_0x560644[_0x6c0a('0x1f')](_0x236c2b);return _0x560644[_0x6c0a('0x26')]('Content-Range',_0x7db190+'-'+_0x490250+'/'+_0x13cd36)['json'](_0x41b1c9);}return null;};}function patchUpdates(_0x5ec192){return function(_0x46e638){try{jsonpatch[_0x6c0a('0x27')](_0x46e638,_0x5ec192,!![]);}catch(_0xa09edb){return BPromise['reject'](_0xa09edb);}return _0x46e638[_0x6c0a('0x28')]();};}function saveUpdates(_0x1c7223,_0x4dd863){return function(_0x5d8154){if(_0x5d8154){return _0x5d8154[_0x6c0a('0x29')](_0x1c7223)[_0x6c0a('0x2a')](function(_0xc62b0b){return _0xc62b0b;});}return null;};}function removeEntity(_0x582511,_0x4ebe7e){return function(_0x41906b){if(_0x41906b){return _0x41906b[_0x6c0a('0x2b')]()[_0x6c0a('0x2a')](function(){var _0x88d2a2=_0x41906b['get']({'plain':!![]});var _0x4f94c0=_0x6c0a('0x2c');return db[_0x6c0a('0x2d')]['destroy']({'where':{'type':_0x4f94c0,'resourceId':_0x88d2a2['id']}})[_0x6c0a('0x2a')](function(){return _0x41906b;});})[_0x6c0a('0x2a')](function(){_0x582511[_0x6c0a('0x1f')](0xcc)[_0x6c0a('0x20')]();});}};}function handleEntityNotFound(_0x4df98e,_0x199342){return function(_0x4b1731){if(!_0x4b1731){_0x4df98e[_0x6c0a('0x1e')](0x194);}return _0x4b1731;};}function handleError(_0x4f079a,_0x30fc49){_0x30fc49=_0x30fc49||0x1f4;return function(_0x2c92ca){logger['error'](_0x2c92ca[_0x6c0a('0x2e')]);if(_0x2c92ca[_0x6c0a('0x2f')]){delete _0x2c92ca[_0x6c0a('0x2f')];}_0x4f079a['status'](_0x30fc49)['send'](_0x2c92ca);};}exports['index']=function(_0x566bfb,_0x4f3d76){var _0x7da94b={},_0x1e7a99={},_0xaabe4e={'count':0x0,'rows':[]};var _0x1e9422=_['map'](db['AnalyticExtractedReport'][_0x6c0a('0x30')],function(_0x415a24){return{'name':_0x415a24[_0x6c0a('0x31')],'type':_0x415a24[_0x6c0a('0x32')]['key']};});_0x1e7a99[_0x6c0a('0x33')]=_[_0x6c0a('0x34')](_0x1e9422,_0x6c0a('0x2f'));_0x1e7a99['query']=_[_0x6c0a('0x35')](_0x566bfb[_0x6c0a('0x36')]);_0x1e7a99[_0x6c0a('0x37')]=_['intersection'](_0x1e7a99['model'],_0x1e7a99[_0x6c0a('0x36')]);_0x7da94b['attributes']=_[_0x6c0a('0x38')](_0x1e7a99[_0x6c0a('0x33')],qs[_0x6c0a('0x39')](_0x566bfb[_0x6c0a('0x36')]['fields']));_0x7da94b[_0x6c0a('0x3a')]=_0x7da94b['attributes'][_0x6c0a('0x3b')]?_0x7da94b['attributes']:_0x1e7a99[_0x6c0a('0x33')];if(!_0x566bfb[_0x6c0a('0x36')][_0x6c0a('0x3c')](_0x6c0a('0x3d'))){_0x7da94b[_0x6c0a('0x24')]=qs[_0x6c0a('0x24')](_0x566bfb[_0x6c0a('0x36')][_0x6c0a('0x24')]);_0x7da94b[_0x6c0a('0x22')]=qs['offset'](_0x566bfb[_0x6c0a('0x36')][_0x6c0a('0x22')]);}_0x7da94b[_0x6c0a('0x3e')]=qs[_0x6c0a('0x3f')](_0x566bfb[_0x6c0a('0x36')]['sort']);_0x7da94b[_0x6c0a('0x40')]=qs[_0x6c0a('0x37')](_[_0x6c0a('0x41')](_0x566bfb[_0x6c0a('0x36')],_0x1e7a99[_0x6c0a('0x37')]),_0x1e9422);if(_0x566bfb[_0x6c0a('0x36')][_0x6c0a('0x42')]){_0x7da94b[_0x6c0a('0x40')]=_[_0x6c0a('0x43')](_0x7da94b[_0x6c0a('0x40')],{'$or':_['map'](_0x1e9422,function(_0x8d345f){if(_0x8d345f[_0x6c0a('0x32')]!==_0x6c0a('0x44')){var _0x303c98={};_0x303c98[_0x8d345f[_0x6c0a('0x2f')]]={'$like':'%'+_0x566bfb['query'][_0x6c0a('0x42')]+'%'};return _0x303c98;}})});}_0x7da94b=_[_0x6c0a('0x43')]({},_0x7da94b,_0x566bfb[_0x6c0a('0x45')]);var _0x4920b8={'where':_0x7da94b[_0x6c0a('0x40')]};return db[_0x6c0a('0x46')][_0x6c0a('0x25')](_0x4920b8)['then'](function(_0x7854ad){_0xaabe4e['count']=_0x7854ad;if(_0x566bfb[_0x6c0a('0x36')]['includeAll']){_0x7da94b['include']=[{'all':!![]}];}return db[_0x6c0a('0x46')][_0x6c0a('0x47')](_0x7da94b);})[_0x6c0a('0x2a')](function(_0x30f62a){_0xaabe4e[_0x6c0a('0x48')]=_0x30f62a;return _0xaabe4e;})[_0x6c0a('0x2a')](respondWithFilteredResult(_0x4f3d76,_0x7da94b))[_0x6c0a('0x49')](handleError(_0x4f3d76,null));};exports['show']=function(_0x5efc79,_0x54db74){var _0x1d5c93={'raw':!![],'where':{'id':_0x5efc79['params']['id']}},_0x1540d8={};_0x1540d8['model']=_[_0x6c0a('0x35')](db[_0x6c0a('0x46')][_0x6c0a('0x30')]);_0x1540d8[_0x6c0a('0x36')]=_[_0x6c0a('0x35')](_0x5efc79[_0x6c0a('0x36')]);_0x1540d8['filters']=_['intersection'](_0x1540d8['model'],_0x1540d8[_0x6c0a('0x36')]);_0x1d5c93['attributes']=_[_0x6c0a('0x38')](_0x1540d8[_0x6c0a('0x33')],qs[_0x6c0a('0x39')](_0x5efc79[_0x6c0a('0x36')]['fields']));_0x1d5c93[_0x6c0a('0x3a')]=_0x1d5c93['attributes'][_0x6c0a('0x3b')]?_0x1d5c93[_0x6c0a('0x3a')]:_0x1540d8[_0x6c0a('0x33')];if(_0x5efc79['query'][_0x6c0a('0x4a')]){_0x1d5c93[_0x6c0a('0x4b')]=[{'all':!![]}];}_0x1d5c93=_['merge']({},_0x1d5c93,_0x5efc79['options']);return db[_0x6c0a('0x46')][_0x6c0a('0x4c')](_0x1d5c93)['then'](handleEntityNotFound(_0x54db74,null))[_0x6c0a('0x2a')](respondWithResult(_0x54db74,null))[_0x6c0a('0x49')](handleError(_0x54db74,null));};exports[_0x6c0a('0x4d')]=function(_0x20a1b3,_0x4e1710){return db[_0x6c0a('0x46')][_0x6c0a('0x4d')](_0x20a1b3[_0x6c0a('0x4e')],{})['then'](function(_0x1b51bf){var _0x156f84=_0x20a1b3[_0x6c0a('0x4f')][_0x6c0a('0x50')]({'plain':!![]});if(!_0x156f84)throw new Error(_0x6c0a('0x51'));if(_0x156f84[_0x6c0a('0x52')]===_0x6c0a('0x4f')){var _0x3afc2c=_0x1b51bf[_0x6c0a('0x50')]({'plain':!![]});var _0x3e70da=_0x6c0a('0x2c');return db[_0x6c0a('0x53')][_0x6c0a('0x4c')]({'where':{'name':_0x3e70da,'userProfileId':_0x156f84[_0x6c0a('0x54')]},'raw':!![]})['then'](function(_0x5cfc3f){if(_0x5cfc3f&&_0x5cfc3f[_0x6c0a('0x55')]===0x0){return db[_0x6c0a('0x2d')]['create']({'name':_0x3afc2c[_0x6c0a('0x2f')],'resourceId':_0x3afc2c['id'],'type':_0x5cfc3f[_0x6c0a('0x2f')],'sectionId':_0x5cfc3f['id']},{})[_0x6c0a('0x2a')](function(){return _0x1b51bf;});}else{return _0x1b51bf;}})[_0x6c0a('0x49')](function(_0x59bd4c){logger[_0x6c0a('0x56')](_0x6c0a('0x57'),_0x59bd4c);throw _0x59bd4c;});}return _0x1b51bf;})[_0x6c0a('0x2a')](respondWithResult(_0x4e1710,0xc9))['catch'](handleError(_0x4e1710,null));};exports[_0x6c0a('0x29')]=function(_0x423333,_0xdca467){if(_0x423333[_0x6c0a('0x4e')]['id']){delete _0x423333[_0x6c0a('0x4e')]['id'];}return db[_0x6c0a('0x46')]['find']({'where':{'id':_0x423333[_0x6c0a('0x58')]['id']}})[_0x6c0a('0x2a')](handleEntityNotFound(_0xdca467,null))[_0x6c0a('0x2a')](saveUpdates(_0x423333['body'],null))[_0x6c0a('0x2a')](respondWithResult(_0xdca467,null))[_0x6c0a('0x49')](handleError(_0xdca467,null));};exports[_0x6c0a('0x2b')]=function(_0x5b09f4,_0x49efff){return db['AnalyticExtractedReport'][_0x6c0a('0x4c')]({'where':{'id':_0x5b09f4[_0x6c0a('0x58')]['id']}})[_0x6c0a('0x2a')](handleEntityNotFound(_0x49efff,null))['then'](removeEntity(_0x49efff,null))[_0x6c0a('0x49')](handleError(_0x49efff,null));};exports[_0x6c0a('0x59')]=function(_0x3e571d,_0x11c4e1,_0x570974){return db[_0x6c0a('0x46')][_0x6c0a('0x4c')]({'where':{'id':_0x3e571d['params']['id']},'attributes':['name',_0x6c0a('0x5a'),_0x6c0a('0x5b'),'output'],'raw':!![]})[_0x6c0a('0x2a')](handleEntityNotFound(_0x11c4e1,null))[_0x6c0a('0x2a')](function(_0x7812a6){if(_0x7812a6){if(!fs[_0x6c0a('0x5c')](path[_0x6c0a('0x5d')](config['root'],_0x6c0a('0x5e'),_0x7812a6[_0x6c0a('0x5b')]))){throw new db[(_0x6c0a('0x5f'))][(_0x6c0a('0x60'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x3e571d[_0x6c0a('0x36')][_0x6c0a('0x61')]){return _0x11c4e1['sendStatus'](0xc8);}return _0x11c4e1[_0x6c0a('0x59')](path['join'](config[_0x6c0a('0x62')],_0x6c0a('0x5e'),_0x7812a6[_0x6c0a('0x5b')]),util[_0x6c0a('0x63')]('%s.%s',_0x7812a6[_0x6c0a('0x5a')]||_0x7812a6[_0x6c0a('0x2f')],_0x7812a6[_0x6c0a('0x64')][_0x6c0a('0x65')]()));}})[_0x6c0a('0x49')](handleError(_0x11c4e1,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index d61911d..c643268 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 _0xed9d=['moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api'];(function(_0x4cd6c5,_0x5d146f){var _0x128376=function(_0x4d526d){while(--_0x4d526d){_0x4cd6c5['push'](_0x4cd6c5['shift']());}};_0x128376(++_0x5d146f);}(_0xed9d,0x8c));var _0xded9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xed9d[_0x432682];return _0x463d05;};'use strict';var _=require(_0xded9('0x0'));var util=require('util');var logger=require(_0xded9('0x1'))(_0xded9('0x2'));var moment=require(_0xded9('0x3'));var BPromise=require(_0xded9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xded9('0x5'));var rimraf=require('rimraf');var config=require(_0xded9('0x6'));var attributes=require(_0xded9('0x7'));module['exports']=function(_0x39b98b,_0x3da47d){return _0x39b98b[_0xded9('0x8')](_0xded9('0x9'),attributes,{'tableName':_0xded9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d7e=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x29273a,_0x4a80ed){var _0x4b0ae6=function(_0x3532e1){while(--_0x3532e1){_0x29273a['push'](_0x29273a['shift']());}};_0x4b0ae6(++_0x4a80ed);}(_0x9d7e,0x11a));var _0xe9d7=function(_0xbc6987,_0xeaf4e4){_0xbc6987=_0xbc6987-0x0;var _0x2db50e=_0x9d7e[_0xbc6987];return _0x2db50e;};'use strict';var _=require(_0xe9d7('0x0'));var util=require(_0xe9d7('0x1'));var logger=require(_0xe9d7('0x2'))(_0xe9d7('0x3'));var moment=require(_0xe9d7('0x4'));var BPromise=require(_0xe9d7('0x5'));var rp=require(_0xe9d7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9d7('0x7'));var config=require(_0xe9d7('0x8'));var attributes=require(_0xe9d7('0x9'));module[_0xe9d7('0xa')]=function(_0x4a161e,_0x4f2cae){return _0x4a161e['define'](_0xe9d7('0xb'),attributes,{'tableName':_0xe9d7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 30547ab..23044f4 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 _0x757c=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','AnalyticExtractedReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info'];(function(_0x2d5934,_0x1acc4f){var _0x5807c8=function(_0x326cc5){while(--_0x326cc5){_0x2d5934['push'](_0x2d5934['shift']());}};_0x5807c8(++_0x1acc4f);}(_0x757c,0x191));var _0xc757=function(_0x5f073a,_0x19c2da){_0x5f073a=_0x5f073a-0x0;var _0x5ba2c5=_0x757c[_0x5f073a];return _0x5ba2c5;};'use strict';var _=require(_0xc757('0x0'));var util=require(_0xc757('0x1'));var moment=require('moment');var BPromise=require(_0xc757('0x2'));var rs=require(_0xc757('0x3'));var fs=require('fs');var Redis=require(_0xc757('0x4'));var db=require(_0xc757('0x5'))['db'];var utils=require(_0xc757('0x6'));var logger=require(_0xc757('0x7'))(_0xc757('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc757('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fff5d,_0x6a9867,_0x78a1e2){return new BPromise(function(_0x280ca0,_0x112111){return client[_0xc757('0xa')](_0x4fff5d,_0x78a1e2)[_0xc757('0xb')](function(_0x53d71b){logger['info'](_0xc757('0xc'),_0x6a9867,'request\x20sent');logger[_0xc757('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x6a9867,_0xc757('0xe'),JSON['stringify'](_0x53d71b));if(_0x53d71b[_0xc757('0xf')]){if(_0x53d71b[_0xc757('0xf')][_0xc757('0x10')]===0x1f4){logger[_0xc757('0xf')](_0xc757('0xc'),_0x6a9867,_0x53d71b['error'][_0xc757('0x11')]);return _0x112111(_0x53d71b[_0xc757('0xf')][_0xc757('0x11')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x6a9867,_0x53d71b[_0xc757('0xf')][_0xc757('0x11')]);return _0x280ca0(_0x53d71b[_0xc757('0xf')][_0xc757('0x11')]);}else{logger[_0xc757('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x6a9867,_0xc757('0xe'));_0x280ca0(_0x53d71b[_0xc757('0x13')][_0xc757('0x11')]);}})['catch'](function(_0x21ed91){logger[_0xc757('0xf')](_0xc757('0xc'),_0x6a9867,_0x21ed91);_0x112111(_0x21ed91);});});} \ No newline at end of file +var _0xff83=['then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x3e24c9,_0x4d9e09){var _0x4237cf=function(_0x79297b){while(--_0x79297b){_0x3e24c9['push'](_0x3e24c9['shift']());}};_0x4237cf(++_0x4d9e09);}(_0xff83,0xee));var _0x3ff8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xff83[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x3ff8('0x0'));var moment=require(_0x3ff8('0x1'));var BPromise=require('bluebird');var rs=require(_0x3ff8('0x2'));var fs=require('fs');var Redis=require(_0x3ff8('0x3'));var db=require(_0x3ff8('0x4'))['db'];var utils=require(_0x3ff8('0x5'));var logger=require('../../config/logger')(_0x3ff8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3ff8('0x7')][_0x3ff8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3fa008,_0x3eb04c,_0x380507){return new BPromise(function(_0x1027ca,_0x20973c){return client['request'](_0x3fa008,_0x380507)[_0x3ff8('0x9')](function(_0x33e0fd){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x3eb04c,_0x3ff8('0xa'));logger[_0x3ff8('0xb')](_0x3ff8('0xc'),_0x3eb04c,_0x3ff8('0xa'),JSON[_0x3ff8('0xd')](_0x33e0fd));if(_0x33e0fd[_0x3ff8('0xe')]){if(_0x33e0fd['error'][_0x3ff8('0xf')]===0x1f4){logger['error'](_0x3ff8('0x10'),_0x3eb04c,_0x33e0fd[_0x3ff8('0xe')][_0x3ff8('0x11')]);return _0x20973c(_0x33e0fd['error'][_0x3ff8('0x11')]);}logger['error'](_0x3ff8('0x10'),_0x3eb04c,_0x33e0fd[_0x3ff8('0xe')][_0x3ff8('0x11')]);return _0x1027ca(_0x33e0fd[_0x3ff8('0xe')]['message']);}else{logger['info'](_0x3ff8('0x10'),_0x3eb04c,_0x3ff8('0xa'));_0x1027ca(_0x33e0fd[_0x3ff8('0x12')]['message']);}})['catch'](function(_0x1e0a08){logger[_0x3ff8('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3eb04c,_0x1e0a08);_0x20973c(_0x1e0a08);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index b61c157..fe9dd96 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 _0xb384=['show','download','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x595856,_0x462d70){var _0xf5c1ed=function(_0x15909c){while(--_0x15909c){_0x595856['push'](_0x595856['shift']());}};_0xf5c1ed(++_0x462d70);}(_0xb384,0x1be));var _0x4b38=function(_0x53ae5d,_0x294404){_0x53ae5d=_0x53ae5d-0x0;var _0x2ee44d=_0xb384[_0x53ae5d];return _0x2ee44d;};'use strict';var multer=require(_0x4b38('0x0'));var util=require(_0x4b38('0x1'));var path=require(_0x4b38('0x2'));var timeout=require('connect-timeout');var express=require(_0x4b38('0x3'));var router=express[_0x4b38('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4b38('0x5'));var config=require(_0x4b38('0x6'));var controller=require(_0x4b38('0x7'));router[_0x4b38('0x8')]('/',auth[_0x4b38('0x9')](),controller['index']);router[_0x4b38('0x8')]('/:id',auth[_0x4b38('0x9')](),controller[_0x4b38('0xa')]);router[_0x4b38('0x8')]('/:id/download',auth[_0x4b38('0x9')](),controller[_0x4b38('0xb')]);router[_0x4b38('0xc')]('/',auth[_0x4b38('0x9')](),controller[_0x4b38('0xd')]);router[_0x4b38('0xe')]('/:id',auth[_0x4b38('0x9')](),controller[_0x4b38('0xf')]);router[_0x4b38('0x10')]('/:id',auth[_0x4b38('0x9')](),controller[_0x4b38('0x11')]);module[_0x4b38('0x12')]=router; \ No newline at end of file +var _0x06bd=['index','show','/:id/download','put','/:id','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x46f664,_0x2d65fb){var _0x4773bd=function(_0x4dd440){while(--_0x4dd440){_0x46f664['push'](_0x46f664['shift']());}};_0x4773bd(++_0x2d65fb);}(_0x06bd,0xf2));var _0xd06b=function(_0x2975f1,_0x453f49){_0x2975f1=_0x2975f1-0x0;var _0x2c08d5=_0x06bd[_0x2975f1];return _0x2c08d5;};'use strict';var multer=require(_0xd06b('0x0'));var util=require('util');var path=require(_0xd06b('0x1'));var timeout=require(_0xd06b('0x2'));var express=require('express');var router=express[_0xd06b('0x3')]();var fs_extra=require(_0xd06b('0x4'));var auth=require(_0xd06b('0x5'));var interaction=require(_0xd06b('0x6'));var config=require(_0xd06b('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0xd06b('0x8')]('/',auth[_0xd06b('0x9')](),controller[_0xd06b('0xa')]);router[_0xd06b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd06b('0xb')]);router[_0xd06b('0x8')](_0xd06b('0xc'),auth[_0xd06b('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd06b('0xd')](_0xd06b('0xe'),auth['isAuthenticated'](),controller[_0xd06b('0xf')]);router['delete'](_0xd06b('0xe'),auth[_0xd06b('0x9')](),controller[_0xd06b('0x10')]);module[_0xd06b('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index effa39f..41dcd7e 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 _0x9f21=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9f21,0x1e3));var _0x19f2=function(_0x356005,_0x411466){_0x356005=_0x356005-0x0;var _0x2bb35b=_0x9f21[_0x356005];return _0x2bb35b;};'use strict';var Sequelize=require(_0x19f2('0x0'));module[_0x19f2('0x1')]={'field':{'type':Sequelize[_0x19f2('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x19f2('0x3')]},'format':{'type':Sequelize[_0x19f2('0x3')]},'groupBy':{'type':Sequelize[_0x19f2('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x19f2('0x3')]},'custom':{'type':Sequelize[_0x19f2('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x487f=['TEXT','STRING','sequelize','exports'];(function(_0x477663,_0x1e8e99){var _0x461e4a=function(_0x26789a){while(--_0x26789a){_0x477663['push'](_0x477663['shift']());}};_0x461e4a(++_0x1e8e99);}(_0x487f,0xd2));var _0xf487=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x487f[_0x5e3b04];return _0x1fc44d;};'use strict';var Sequelize=require(_0xf487('0x0'));module[_0xf487('0x1')]={'field':{'type':Sequelize[_0xf487('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xf487('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 929cfa7..d4090fe 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 _0x5d36=['apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','show','length','catch','bulkCreate','body','find','params','bulkDestroy','ids','addFields','findOne','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x5d36,0x1cb));var _0x65d3=function(_0x50c86a,_0x2fec99){_0x50c86a=_0x50c86a-0x0;var _0x53420a=_0x5d36[_0x50c86a];return _0x53420a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65d3('0x0'));var zipdir=require(_0x65d3('0x1'));var jsonpatch=require(_0x65d3('0x2'));var rp=require(_0x65d3('0x3'));var moment=require(_0x65d3('0x4'));var BPromise=require(_0x65d3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x65d3('0x6'));var sox=require(_0x65d3('0x7'));var csv=require(_0x65d3('0x8'));var ejs=require(_0x65d3('0x9'));var fs=require('fs');var fs_extra=require(_0x65d3('0xa'));var _=require('lodash');var squel=require(_0x65d3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x65d3('0xc'));var toCsv=require(_0x65d3('0x8'));var querystring=require(_0x65d3('0xd'));var Papa=require(_0x65d3('0xe'));var Redis=require('ioredis');var authService=require(_0x65d3('0xf'));var qs=require(_0x65d3('0x10'));var as=require(_0x65d3('0x11'));var hardwareService=require(_0x65d3('0x12'));var logger=require(_0x65d3('0x13'))(_0x65d3('0x14'));var utils=require(_0x65d3('0x15'));var config=require(_0x65d3('0x16'));var licenseUtil=require(_0x65d3('0x17'));var db=require(_0x65d3('0x18'))['db'];function respondWithStatusCode(_0x5e34f7,_0x48958f){_0x48958f=_0x48958f||0xcc;return function(_0x4d58cc){if(_0x4d58cc){return _0x5e34f7['sendStatus'](_0x48958f);}return _0x5e34f7['status'](_0x48958f)['end']();};}function respondWithResult(_0xb15e33,_0xad4aff){_0xad4aff=_0xad4aff||0xc8;return function(_0x2595d2){if(_0x2595d2){return _0xb15e33[_0x65d3('0x19')](_0xad4aff)[_0x65d3('0x1a')](_0x2595d2);}};}function respondWithFilteredResult(_0xc2068e,_0x112418){return function(_0x14dd12){if(_0x14dd12){var _0xcff4cb=typeof _0x112418[_0x65d3('0x1b')]===_0x65d3('0x1c')&&typeof _0x112418[_0x65d3('0x1d')]===_0x65d3('0x1c');var _0x558609=_0x14dd12['count'];var _0xaec2b8=_0xcff4cb?0x0:_0x112418['offset'];var _0x54c404=_0xcff4cb?_0x14dd12[_0x65d3('0x1e')]:_0x112418[_0x65d3('0x1b')]+_0x112418[_0x65d3('0x1d')];var _0x4a8f9b;if(_0x54c404>=_0x558609){_0x54c404=_0x558609;_0x4a8f9b=0xc8;}else{_0x4a8f9b=0xce;}_0xc2068e[_0x65d3('0x19')](_0x4a8f9b);return _0xc2068e[_0x65d3('0x1f')](_0x65d3('0x20'),_0xaec2b8+'-'+_0x54c404+'/'+_0x558609)[_0x65d3('0x1a')](_0x14dd12);}return null;};}function patchUpdates(_0x17e335){return function(_0x2ffa46){try{jsonpatch[_0x65d3('0x21')](_0x2ffa46,_0x17e335,!![]);}catch(_0x28d861){return BPromise[_0x65d3('0x22')](_0x28d861);}return _0x2ffa46[_0x65d3('0x23')]();};}function saveUpdates(_0x255206,_0x3dd095){return function(_0x1091d9){if(_0x1091d9){return _0x1091d9[_0x65d3('0x24')](_0x255206)[_0x65d3('0x25')](function(_0x497eeb){return _0x497eeb;});}return null;};}function removeEntity(_0x3209f6,_0x2e79e6){return function(_0x5abe15){if(_0x5abe15){return _0x5abe15[_0x65d3('0x26')]()[_0x65d3('0x25')](function(){_0x3209f6['status'](0xcc)[_0x65d3('0x27')]();});}};}function handleEntityNotFound(_0x129bd7,_0x55dc69){return function(_0x18ffbd){if(!_0x18ffbd){_0x129bd7[_0x65d3('0x28')](0x194);}return _0x18ffbd;};}function handleError(_0x24c6c0,_0x35ea61){_0x35ea61=_0x35ea61||0x1f4;return function(_0x57e9c7){logger[_0x65d3('0x29')](_0x57e9c7[_0x65d3('0x2a')]);if(_0x57e9c7[_0x65d3('0x2b')]){delete _0x57e9c7['name'];}_0x24c6c0['status'](_0x35ea61)[_0x65d3('0x2c')](_0x57e9c7);};}exports[_0x65d3('0x2d')]=function(_0x5d63ee,_0x2a8d63){var _0x3674d4={},_0xe30c16={},_0x49a91b={'count':0x0,'rows':[]};var _0x5c3fff=_[_0x65d3('0x2e')](db['AnalyticFieldReport'][_0x65d3('0x2f')],function(_0xac7298){return{'name':_0xac7298[_0x65d3('0x30')],'type':_0xac7298['type']['key']};});_0xe30c16[_0x65d3('0x31')]=_[_0x65d3('0x2e')](_0x5c3fff,'name');_0xe30c16[_0x65d3('0x32')]=_[_0x65d3('0x33')](_0x5d63ee['query']);_0xe30c16[_0x65d3('0x34')]=_[_0x65d3('0x35')](_0xe30c16[_0x65d3('0x31')],_0xe30c16[_0x65d3('0x32')]);_0x3674d4[_0x65d3('0x36')]=_[_0x65d3('0x35')](_0xe30c16[_0x65d3('0x31')],qs[_0x65d3('0x37')](_0x5d63ee['query'][_0x65d3('0x37')]));_0x3674d4[_0x65d3('0x36')]=_0x3674d4[_0x65d3('0x36')]['length']?_0x3674d4[_0x65d3('0x36')]:_0xe30c16[_0x65d3('0x31')];if(!_0x5d63ee[_0x65d3('0x32')][_0x65d3('0x38')](_0x65d3('0x39'))){_0x3674d4[_0x65d3('0x1d')]=qs[_0x65d3('0x1d')](_0x5d63ee[_0x65d3('0x32')]['limit']);_0x3674d4[_0x65d3('0x1b')]=qs['offset'](_0x5d63ee['query'][_0x65d3('0x1b')]);}_0x3674d4['order']=qs[_0x65d3('0x3a')](_0x5d63ee['query']['sort']);_0x3674d4[_0x65d3('0x3b')]=qs[_0x65d3('0x34')](_[_0x65d3('0x3c')](_0x5d63ee['query'],_0xe30c16[_0x65d3('0x34')]),_0x5c3fff);if(_0x5d63ee[_0x65d3('0x32')][_0x65d3('0x3d')]){_0x3674d4[_0x65d3('0x3b')]=_[_0x65d3('0x3e')](_0x3674d4[_0x65d3('0x3b')],{'$or':_[_0x65d3('0x2e')](_0x5c3fff,function(_0x4b4b6b){if(_0x4b4b6b[_0x65d3('0x3f')]!==_0x65d3('0x40')){var _0x618baa={};_0x618baa[_0x4b4b6b['name']]={'$like':'%'+_0x5d63ee['query']['filter']+'%'};return _0x618baa;}})});}_0x3674d4=_[_0x65d3('0x3e')]({},_0x3674d4,_0x5d63ee[_0x65d3('0x41')]);var _0xfbb1bf={'where':_0x3674d4['where']};return db[_0x65d3('0x42')][_0x65d3('0x1e')](_0xfbb1bf)[_0x65d3('0x25')](function(_0x38de24){_0x49a91b[_0x65d3('0x1e')]=_0x38de24;if(_0x5d63ee[_0x65d3('0x32')][_0x65d3('0x43')]){_0x3674d4[_0x65d3('0x44')]=[{'all':!![]}];}return db[_0x65d3('0x42')][_0x65d3('0x45')](_0x3674d4);})[_0x65d3('0x25')](function(_0x3b262b){_0x49a91b['rows']=_0x3b262b;return _0x49a91b;})['then'](respondWithFilteredResult(_0x2a8d63,_0x3674d4))['catch'](handleError(_0x2a8d63,null));};exports[_0x65d3('0x46')]=function(_0x430f44,_0x817a5c){var _0x1b42e3={'raw':![],'where':{'id':_0x430f44['params']['id']}},_0x5eb27a={};_0x5eb27a[_0x65d3('0x31')]=_['keys'](db[_0x65d3('0x42')][_0x65d3('0x2f')]);_0x5eb27a[_0x65d3('0x32')]=_[_0x65d3('0x33')](_0x430f44[_0x65d3('0x32')]);_0x5eb27a[_0x65d3('0x34')]=_[_0x65d3('0x35')](_0x5eb27a[_0x65d3('0x31')],_0x5eb27a[_0x65d3('0x32')]);_0x1b42e3[_0x65d3('0x36')]=_[_0x65d3('0x35')](_0x5eb27a['model'],qs['fields'](_0x430f44['query'][_0x65d3('0x37')]));_0x1b42e3['attributes']=_0x1b42e3[_0x65d3('0x36')][_0x65d3('0x47')]?_0x1b42e3[_0x65d3('0x36')]:_0x5eb27a[_0x65d3('0x31')];if(_0x430f44['query'][_0x65d3('0x43')]){_0x1b42e3['include']=[{'all':!![]}];}_0x1b42e3=_['merge']({},_0x1b42e3,_0x430f44[_0x65d3('0x41')]);return db[_0x65d3('0x42')]['find'](_0x1b42e3)['then'](handleEntityNotFound(_0x817a5c,null))['then'](respondWithResult(_0x817a5c,null))[_0x65d3('0x48')](handleError(_0x817a5c,null));};exports['create']=function(_0x57f54e,_0x292474){return db[_0x65d3('0x42')]['create'](_0x57f54e['body'],{})[_0x65d3('0x25')](respondWithResult(_0x292474,0xc9))[_0x65d3('0x48')](handleError(_0x292474,null));};exports['bulkCreate']=function(_0x193ef2,_0x33b5a0){return db[_0x65d3('0x42')][_0x65d3('0x49')](_0x193ef2['body'],{'raw':![],'individualHooks':!![]})[_0x65d3('0x25')](respondWithResult(_0x33b5a0,0xc9))[_0x65d3('0x48')](handleError(_0x33b5a0,null));};exports[_0x65d3('0x24')]=function(_0x312dbb,_0x2b3785){if(_0x312dbb['body']['id']){delete _0x312dbb[_0x65d3('0x4a')]['id'];}return db[_0x65d3('0x42')][_0x65d3('0x4b')]({'where':{'id':_0x312dbb[_0x65d3('0x4c')]['id']}})[_0x65d3('0x25')](handleEntityNotFound(_0x2b3785,null))[_0x65d3('0x25')](saveUpdates(_0x312dbb[_0x65d3('0x4a')],null))['then'](respondWithResult(_0x2b3785,null))[_0x65d3('0x48')](handleError(_0x2b3785,null));};exports['destroy']=function(_0x439c7f,_0x28e42e){return db['AnalyticFieldReport'][_0x65d3('0x4b')]({'where':{'id':_0x439c7f[_0x65d3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x28e42e,null))['then'](removeEntity(_0x28e42e,null))[_0x65d3('0x48')](handleError(_0x28e42e,null));};exports[_0x65d3('0x4d')]=function(_0x5949da,_0xbd0af3){return db[_0x65d3('0x42')][_0x65d3('0x26')]({'where':{'id':_0x5949da[_0x65d3('0x32')][_0x65d3('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x65d3('0x25')](respondWithResult(_0xbd0af3,0xcc))['catch'](handleError(_0xbd0af3,null));};exports[_0x65d3('0x4f')]=function(_0x4f9807,_0x4744aa,_0x5054b6){return db['AnalyticCustomReport'][_0x65d3('0x50')]({'where':{'id':_0x4f9807[_0x65d3('0x4c')]['id']}})[_0x65d3('0x25')](handleEntityNotFound(_0x4744aa,null))[_0x65d3('0x25')](function(_0x1a524d){if(_0x1a524d){return db['sequelize'][_0x65d3('0x51')](function(_0x509899){return db[_0x65d3('0x42')][_0x65d3('0x26')]({'where':{'CustomReportId':_0x4f9807[_0x65d3('0x4c')]['id']},'transaction':_0x509899})[_0x65d3('0x25')](function(_0x274bc4){var _0x5489d1=_['map'](_0x4f9807['body'],function(_0x28173c){delete _0x28173c['id'];_0x28173c['CustomReportId']=_0x4f9807[_0x65d3('0x4c')]['id'];return _0x28173c;});return db[_0x65d3('0x42')][_0x65d3('0x49')](_0x5489d1,{'transaction':_0x509899});});})[_0x65d3('0x25')](function(){return db[_0x65d3('0x42')][_0x65d3('0x45')]({'where':{'CustomReportId':_0x4f9807[_0x65d3('0x4c')]['id']}});});}})[_0x65d3('0x25')](respondWithResult(_0x4744aa,null))[_0x65d3('0x48')](handleError(_0x4744aa,null));}; \ No newline at end of file +var _0xfe5e=['sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','sequelize','CustomReportId','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy'];(function(_0x3be6af,_0x22fece){var _0x60f1b3=function(_0x29ecb5){while(--_0x29ecb5){_0x3be6af['push'](_0x3be6af['shift']());}};_0x60f1b3(++_0x22fece);}(_0xfe5e,0x176));var _0xefe5=function(_0x3a1cca,_0xf9cf7e){_0x3a1cca=_0x3a1cca-0x0;var _0x53b71c=_0xfe5e[_0x3a1cca];return _0x53b71c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefe5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xefe5('0x1'));var rp=require(_0xefe5('0x2'));var moment=require(_0xefe5('0x3'));var BPromise=require(_0xefe5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xefe5('0x5'));var csv=require('to-csv');var ejs=require(_0xefe5('0x6'));var fs=require('fs');var fs_extra=require(_0xefe5('0x7'));var _=require(_0xefe5('0x8'));var squel=require('squel');var crypto=require(_0xefe5('0x9'));var jsforce=require(_0xefe5('0xa'));var deskjs=require(_0xefe5('0xb'));var toCsv=require(_0xefe5('0xc'));var querystring=require(_0xefe5('0xd'));var Papa=require(_0xefe5('0xe'));var Redis=require(_0xefe5('0xf'));var authService=require(_0xefe5('0x10'));var qs=require(_0xefe5('0x11'));var as=require(_0xefe5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xefe5('0x13'));var utils=require('../../config/utils');var config=require(_0xefe5('0x14'));var licenseUtil=require(_0xefe5('0x15'));var db=require(_0xefe5('0x16'))['db'];function respondWithStatusCode(_0x507e54,_0x5cbb14){_0x5cbb14=_0x5cbb14||0xcc;return function(_0x5a581d){if(_0x5a581d){return _0x507e54['sendStatus'](_0x5cbb14);}return _0x507e54[_0xefe5('0x17')](_0x5cbb14)[_0xefe5('0x18')]();};}function respondWithResult(_0x102f1f,_0x36f185){_0x36f185=_0x36f185||0xc8;return function(_0x133161){if(_0x133161){return _0x102f1f[_0xefe5('0x17')](_0x36f185)['json'](_0x133161);}};}function respondWithFilteredResult(_0x931bc9,_0x268e50){return function(_0x313dd6){if(_0x313dd6){var _0x35ff98=typeof _0x268e50['offset']===_0xefe5('0x19')&&typeof _0x268e50[_0xefe5('0x1a')]===_0xefe5('0x19');var _0xa171a3=_0x313dd6['count'];var _0x2289ee=_0x35ff98?0x0:_0x268e50[_0xefe5('0x1b')];var _0x241bd3=_0x35ff98?_0x313dd6[_0xefe5('0x1c')]:_0x268e50['offset']+_0x268e50['limit'];var _0x7c41bf;if(_0x241bd3>=_0xa171a3){_0x241bd3=_0xa171a3;_0x7c41bf=0xc8;}else{_0x7c41bf=0xce;}_0x931bc9[_0xefe5('0x17')](_0x7c41bf);return _0x931bc9[_0xefe5('0x1d')](_0xefe5('0x1e'),_0x2289ee+'-'+_0x241bd3+'/'+_0xa171a3)['json'](_0x313dd6);}return null;};}function patchUpdates(_0xd8bd7d){return function(_0x4490fd){try{jsonpatch[_0xefe5('0x1f')](_0x4490fd,_0xd8bd7d,!![]);}catch(_0x21e1c3){return BPromise['reject'](_0x21e1c3);}return _0x4490fd[_0xefe5('0x20')]();};}function saveUpdates(_0x91140,_0x27f15f){return function(_0x2a8a1){if(_0x2a8a1){return _0x2a8a1[_0xefe5('0x21')](_0x91140)[_0xefe5('0x22')](function(_0x3d86ea){return _0x3d86ea;});}return null;};}function removeEntity(_0x2e7ecd,_0x98e1cb){return function(_0x4e0c50){if(_0x4e0c50){return _0x4e0c50[_0xefe5('0x23')]()[_0xefe5('0x22')](function(){_0x2e7ecd[_0xefe5('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x314e76,_0x2d667d){return function(_0x15cb76){if(!_0x15cb76){_0x314e76[_0xefe5('0x24')](0x194);}return _0x15cb76;};}function handleError(_0x26e48a,_0x50f854){_0x50f854=_0x50f854||0x1f4;return function(_0x56e49b){logger[_0xefe5('0x25')](_0x56e49b[_0xefe5('0x26')]);if(_0x56e49b[_0xefe5('0x27')]){delete _0x56e49b[_0xefe5('0x27')];}_0x26e48a[_0xefe5('0x17')](_0x50f854)[_0xefe5('0x28')](_0x56e49b);};}exports[_0xefe5('0x29')]=function(_0x8f541c,_0x36a7b8){var _0x3ec5b1={},_0x26241a={},_0x40540b={'count':0x0,'rows':[]};var _0x19e427=_[_0xefe5('0x2a')](db[_0xefe5('0x2b')][_0xefe5('0x2c')],function(_0x643a86){return{'name':_0x643a86[_0xefe5('0x2d')],'type':_0x643a86[_0xefe5('0x2e')][_0xefe5('0x2f')]};});_0x26241a['model']=_[_0xefe5('0x2a')](_0x19e427,_0xefe5('0x27'));_0x26241a[_0xefe5('0x30')]=_['keys'](_0x8f541c[_0xefe5('0x30')]);_0x26241a['filters']=_['intersection'](_0x26241a[_0xefe5('0x31')],_0x26241a[_0xefe5('0x30')]);_0x3ec5b1[_0xefe5('0x32')]=_[_0xefe5('0x33')](_0x26241a['model'],qs[_0xefe5('0x34')](_0x8f541c[_0xefe5('0x30')]['fields']));_0x3ec5b1[_0xefe5('0x32')]=_0x3ec5b1[_0xefe5('0x32')][_0xefe5('0x35')]?_0x3ec5b1[_0xefe5('0x32')]:_0x26241a[_0xefe5('0x31')];if(!_0x8f541c[_0xefe5('0x30')][_0xefe5('0x36')](_0xefe5('0x37'))){_0x3ec5b1['limit']=qs[_0xefe5('0x1a')](_0x8f541c['query']['limit']);_0x3ec5b1[_0xefe5('0x1b')]=qs['offset'](_0x8f541c['query']['offset']);}_0x3ec5b1[_0xefe5('0x38')]=qs[_0xefe5('0x39')](_0x8f541c[_0xefe5('0x30')][_0xefe5('0x39')]);_0x3ec5b1[_0xefe5('0x3a')]=qs[_0xefe5('0x3b')](_[_0xefe5('0x3c')](_0x8f541c[_0xefe5('0x30')],_0x26241a[_0xefe5('0x3b')]),_0x19e427);if(_0x8f541c['query'][_0xefe5('0x3d')]){_0x3ec5b1[_0xefe5('0x3a')]=_['merge'](_0x3ec5b1['where'],{'$or':_['map'](_0x19e427,function(_0x1a14fa){if(_0x1a14fa['type']!==_0xefe5('0x3e')){var _0x22c93d={};_0x22c93d[_0x1a14fa[_0xefe5('0x27')]]={'$like':'%'+_0x8f541c[_0xefe5('0x30')]['filter']+'%'};return _0x22c93d;}})});}_0x3ec5b1=_[_0xefe5('0x3f')]({},_0x3ec5b1,_0x8f541c['options']);var _0x3fe309={'where':_0x3ec5b1['where']};return db[_0xefe5('0x2b')][_0xefe5('0x1c')](_0x3fe309)[_0xefe5('0x22')](function(_0x18373f){_0x40540b[_0xefe5('0x1c')]=_0x18373f;if(_0x8f541c['query'][_0xefe5('0x40')]){_0x3ec5b1[_0xefe5('0x41')]=[{'all':!![]}];}return db[_0xefe5('0x2b')][_0xefe5('0x42')](_0x3ec5b1);})[_0xefe5('0x22')](function(_0x5e5a70){_0x40540b['rows']=_0x5e5a70;return _0x40540b;})['then'](respondWithFilteredResult(_0x36a7b8,_0x3ec5b1))[_0xefe5('0x43')](handleError(_0x36a7b8,null));};exports[_0xefe5('0x44')]=function(_0x3436d1,_0x257c3a){var _0x403664={'raw':![],'where':{'id':_0x3436d1[_0xefe5('0x45')]['id']}},_0x4bb47c={};_0x4bb47c[_0xefe5('0x31')]=_[_0xefe5('0x46')](db[_0xefe5('0x2b')][_0xefe5('0x2c')]);_0x4bb47c[_0xefe5('0x30')]=_[_0xefe5('0x46')](_0x3436d1[_0xefe5('0x30')]);_0x4bb47c[_0xefe5('0x3b')]=_['intersection'](_0x4bb47c['model'],_0x4bb47c['query']);_0x403664[_0xefe5('0x32')]=_[_0xefe5('0x33')](_0x4bb47c['model'],qs[_0xefe5('0x34')](_0x3436d1['query'][_0xefe5('0x34')]));_0x403664['attributes']=_0x403664[_0xefe5('0x32')][_0xefe5('0x35')]?_0x403664['attributes']:_0x4bb47c[_0xefe5('0x31')];if(_0x3436d1[_0xefe5('0x30')][_0xefe5('0x40')]){_0x403664['include']=[{'all':!![]}];}_0x403664=_[_0xefe5('0x3f')]({},_0x403664,_0x3436d1[_0xefe5('0x47')]);return db[_0xefe5('0x2b')][_0xefe5('0x48')](_0x403664)[_0xefe5('0x22')](handleEntityNotFound(_0x257c3a,null))[_0xefe5('0x22')](respondWithResult(_0x257c3a,null))[_0xefe5('0x43')](handleError(_0x257c3a,null));};exports[_0xefe5('0x49')]=function(_0x207f98,_0x2e2386){return db[_0xefe5('0x2b')]['create'](_0x207f98[_0xefe5('0x4a')],{})[_0xefe5('0x22')](respondWithResult(_0x2e2386,0xc9))[_0xefe5('0x43')](handleError(_0x2e2386,null));};exports['bulkCreate']=function(_0x4e4c88,_0x5b75bd){return db[_0xefe5('0x2b')][_0xefe5('0x4b')](_0x4e4c88[_0xefe5('0x4a')],{'raw':![],'individualHooks':!![]})[_0xefe5('0x22')](respondWithResult(_0x5b75bd,0xc9))[_0xefe5('0x43')](handleError(_0x5b75bd,null));};exports[_0xefe5('0x21')]=function(_0xd04075,_0x3ce317){if(_0xd04075[_0xefe5('0x4a')]['id']){delete _0xd04075[_0xefe5('0x4a')]['id'];}return db[_0xefe5('0x2b')][_0xefe5('0x48')]({'where':{'id':_0xd04075[_0xefe5('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ce317,null))['then'](saveUpdates(_0xd04075['body'],null))['then'](respondWithResult(_0x3ce317,null))['catch'](handleError(_0x3ce317,null));};exports[_0xefe5('0x23')]=function(_0x169fb6,_0x504192){return db['AnalyticFieldReport'][_0xefe5('0x48')]({'where':{'id':_0x169fb6[_0xefe5('0x45')]['id']}})[_0xefe5('0x22')](handleEntityNotFound(_0x504192,null))['then'](removeEntity(_0x504192,null))['catch'](handleError(_0x504192,null));};exports[_0xefe5('0x4c')]=function(_0x3fe824,_0x4f6d23){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x3fe824['query'][_0xefe5('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0xefe5('0x22')](respondWithResult(_0x4f6d23,0xcc))[_0xefe5('0x43')](handleError(_0x4f6d23,null));};exports[_0xefe5('0x4e')]=function(_0x860e95,_0xc9b29f,_0x3460a5){return db['AnalyticCustomReport'][_0xefe5('0x4f')]({'where':{'id':_0x860e95[_0xefe5('0x45')]['id']}})[_0xefe5('0x22')](handleEntityNotFound(_0xc9b29f,null))[_0xefe5('0x22')](function(_0x4ef5a8){if(_0x4ef5a8){return db[_0xefe5('0x50')]['transaction'](function(_0x43d32e){return db[_0xefe5('0x2b')][_0xefe5('0x23')]({'where':{'CustomReportId':_0x860e95[_0xefe5('0x45')]['id']},'transaction':_0x43d32e})['then'](function(_0x3692d2){var _0xb93963=_[_0xefe5('0x2a')](_0x860e95['body'],function(_0x57a4f2){delete _0x57a4f2['id'];_0x57a4f2[_0xefe5('0x51')]=_0x860e95[_0xefe5('0x45')]['id'];return _0x57a4f2;});return db['AnalyticFieldReport']['bulkCreate'](_0xb93963,{'transaction':_0x43d32e});});})['then'](function(){return db[_0xefe5('0x2b')][_0xefe5('0x42')]({'where':{'CustomReportId':_0x860e95[_0xefe5('0x45')]['id']}});});}})[_0xefe5('0x22')](respondWithResult(_0xc9b29f,null))[_0xefe5('0x43')](handleError(_0xc9b29f,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 0d47812..cdd792c 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 _0xff19=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x36ad8c,_0x416e50){var _0x1a22f0=function(_0xc9b130){while(--_0xc9b130){_0x36ad8c['push'](_0x36ad8c['shift']());}};_0x1a22f0(++_0x416e50);}(_0xff19,0x112));var _0x9ff1=function(_0x47d923,_0x527893){_0x47d923=_0x47d923-0x0;var _0x2aa8a4=_0xff19[_0x47d923];return _0x2aa8a4;};'use strict';var _=require(_0x9ff1('0x0'));var util=require(_0x9ff1('0x1'));var logger=require(_0x9ff1('0x2'))(_0x9ff1('0x3'));var moment=require('moment');var BPromise=require(_0x9ff1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ff1('0x5'));var rimraf=require(_0x9ff1('0x6'));var config=require(_0x9ff1('0x7'));var attributes=require(_0x9ff1('0x8'));module['exports']=function(_0x1b5895,_0x5070a9){return _0x1b5895[_0x9ff1('0x9')](_0x9ff1('0xa'),attributes,{'tableName':_0x9ff1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a68=['analytics_report_fields','lodash','util','api','moment','bluebird','rimraf','define'];(function(_0x3b58c9,_0x1f46c3){var _0x5b653a=function(_0xecac3b){while(--_0xecac3b){_0x3b58c9['push'](_0x3b58c9['shift']());}};_0x5b653a(++_0x1f46c3);}(_0x1a68,0x129));var _0x81a6=function(_0x4df928,_0x3d4292){_0x4df928=_0x4df928-0x0;var _0x1d6f26=_0x1a68[_0x4df928];return _0x1d6f26;};'use strict';var _=require(_0x81a6('0x0'));var util=require(_0x81a6('0x1'));var logger=require('../../config/logger')(_0x81a6('0x2'));var moment=require(_0x81a6('0x3'));var BPromise=require(_0x81a6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x81a6('0x5'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x254853,_0x3812ad){return _0x254853[_0x81a6('0x6')]('AnalyticFieldReport',attributes,{'tableName':_0x81a6('0x7'),'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 a2b9994..4cfe423 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 _0xd6a1=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2db10a,_0x32610f){var _0x36364a=function(_0x1ec0bc){while(--_0x1ec0bc){_0x2db10a['push'](_0x2db10a['shift']());}};_0x36364a(++_0x32610f);}(_0xd6a1,0x75));var _0x1d6a=function(_0x1f14c2,_0x1ddfce){_0x1f14c2=_0x1f14c2-0x0;var _0x574964=_0xd6a1[_0x1f14c2];return _0x574964;};'use strict';var _=require(_0x1d6a('0x0'));var util=require(_0x1d6a('0x1'));var moment=require('moment');var BPromise=require(_0x1d6a('0x2'));var rs=require(_0x1d6a('0x3'));var fs=require('fs');var Redis=require(_0x1d6a('0x4'));var db=require(_0x1d6a('0x5'))['db'];var utils=require(_0x1d6a('0x6'));var logger=require(_0x1d6a('0x7'))(_0x1d6a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1d6a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x285959,_0x55d092,_0x53860e){return new BPromise(function(_0x548939,_0x13a8c2){return client[_0x1d6a('0xa')](_0x285959,_0x53860e)[_0x1d6a('0xb')](function(_0x31f5e2){logger[_0x1d6a('0xc')](_0x1d6a('0xd'),_0x55d092,_0x1d6a('0xe'));logger[_0x1d6a('0xf')](_0x1d6a('0x10'),_0x55d092,'request\x20sent',JSON[_0x1d6a('0x11')](_0x31f5e2));if(_0x31f5e2[_0x1d6a('0x12')]){if(_0x31f5e2['error'][_0x1d6a('0x13')]===0x1f4){logger[_0x1d6a('0x12')](_0x1d6a('0xd'),_0x55d092,_0x31f5e2[_0x1d6a('0x12')]['message']);return _0x13a8c2(_0x31f5e2['error'][_0x1d6a('0x14')]);}logger['error'](_0x1d6a('0xd'),_0x55d092,_0x31f5e2[_0x1d6a('0x12')][_0x1d6a('0x14')]);return _0x548939(_0x31f5e2[_0x1d6a('0x12')][_0x1d6a('0x14')]);}else{logger[_0x1d6a('0xc')](_0x1d6a('0xd'),_0x55d092,_0x1d6a('0xe'));_0x548939(_0x31f5e2[_0x1d6a('0x15')][_0x1d6a('0x14')]);}})[_0x1d6a('0x16')](function(_0x1059f8){logger[_0x1d6a('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x55d092,_0x1059f8);_0x13a8c2(_0x1059f8);});});} \ No newline at end of file +var _0x861f=['then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x38d167,_0x5273c7){var _0x43b9df=function(_0x452d70){while(--_0x452d70){_0x38d167['push'](_0x38d167['shift']());}};_0x43b9df(++_0x5273c7);}(_0x861f,0x1ee));var _0xf861=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x861f[_0x425716];return _0x2d39af;};'use strict';var _=require('lodash');var util=require(_0xf861('0x0'));var moment=require(_0xf861('0x1'));var BPromise=require(_0xf861('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf861('0x3'));var db=require(_0xf861('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf861('0x5'))(_0xf861('0x6'));var config=require(_0xf861('0x7'));var jayson=require(_0xf861('0x8'));var client=jayson[_0xf861('0x9')][_0xf861('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53fffb,_0x109d71,_0x5d4185){return new BPromise(function(_0x2f3d44,_0x4dbcbc){return client[_0xf861('0xb')](_0x53fffb,_0x5d4185)[_0xf861('0xc')](function(_0x2b07bc){logger[_0xf861('0xd')](_0xf861('0xe'),_0x109d71,_0xf861('0xf'));logger[_0xf861('0x10')](_0xf861('0x11'),_0x109d71,'request\x20sent',JSON['stringify'](_0x2b07bc));if(_0x2b07bc[_0xf861('0x12')]){if(_0x2b07bc[_0xf861('0x12')][_0xf861('0x13')]===0x1f4){logger[_0xf861('0x12')](_0xf861('0xe'),_0x109d71,_0x2b07bc['error']['message']);return _0x4dbcbc(_0x2b07bc[_0xf861('0x12')][_0xf861('0x14')]);}logger['error'](_0xf861('0xe'),_0x109d71,_0x2b07bc[_0xf861('0x12')][_0xf861('0x14')]);return _0x2f3d44(_0x2b07bc[_0xf861('0x12')][_0xf861('0x14')]);}else{logger[_0xf861('0xd')](_0xf861('0xe'),_0x109d71,_0xf861('0xf'));_0x2f3d44(_0x2b07bc[_0xf861('0x15')]['message']);}})[_0xf861('0x16')](function(_0x2a5d63){logger[_0xf861('0x12')](_0xf861('0xe'),_0x109d71,_0x2a5d63);_0x4dbcbc(_0x2a5d63);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 2a024ea..1c8fe8d 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(_0x4ab1f0,_0xc06064){var _0x2af637=function(_0x1315d4){while(--_0x1315d4){_0x4ab1f0['push'](_0x4ab1f0['shift']());}};_0x2af637(++_0xc06064);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0xa9b1c9,_0x20afdb){var _0x56c50d=function(_0x58799d){while(--_0x58799d){_0xa9b1c9['push'](_0xa9b1c9['shift']());}};_0x56c50d(++_0x20afdb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 e78da1b..347644f 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 _0x1020=['sequelize','STRING','name','TEXT'];(function(_0x33dd87,_0x1b1d84){var _0x34e6fa=function(_0x99cca9){while(--_0x99cca9){_0x33dd87['push'](_0x33dd87['shift']());}};_0x34e6fa(++_0x1b1d84);}(_0x1020,0x1a4));var _0x0102=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0x1020[_0x5447aa];return _0xb21e53;};'use strict';var Sequelize=require(_0x0102('0x0'));module['exports']={'name':{'type':Sequelize[_0x0102('0x1')],'allowNull':![],'unique':_0x0102('0x2')},'table':{'type':Sequelize[_0x0102('0x1')]},'metric':{'type':Sequelize[_0x0102('0x3')]},'description':{'type':Sequelize[_0x0102('0x1')]}}; \ No newline at end of file +var _0x8369=['name','TEXT','sequelize','exports','STRING'];(function(_0x57b296,_0x2f99c6){var _0x1185d5=function(_0xf782e1){while(--_0xf782e1){_0x57b296['push'](_0x57b296['shift']());}};_0x1185d5(++_0x2f99c6);}(_0x8369,0x10b));var _0x9836=function(_0x266eac,_0x4aff06){_0x266eac=_0x266eac-0x0;var _0x489843=_0x8369[_0x266eac];return _0x489843;};'use strict';var Sequelize=require(_0x9836('0x0'));module[_0x9836('0x1')]={'name':{'type':Sequelize[_0x9836('0x2')],'allowNull':![],'unique':_0x9836('0x3')},'table':{'type':Sequelize[_0x9836('0x2')]},'metric':{'type':Sequelize[_0x9836('0x4')]},'description':{'type':Sequelize[_0x9836('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 598a308..cceb102 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 _0x9957=['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','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x11ba46,_0x1d6752){var _0x1c8c6f=function(_0x4cf96f){while(--_0x4cf96f){_0x11ba46['push'](_0x11ba46['shift']());}};_0x1c8c6f(++_0x1d6752);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));}; \ No newline at end of file +var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x739034,_0x2e0a35){var _0x391cd9=function(_0x383443){while(--_0x383443){_0x739034['push'](_0x739034['shift']());}};_0x391cd9(++_0x2e0a35);}(_0xabce,0x103));var _0xeabc=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0xabce[_0x2df507];return _0x1f7167;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 6f00927..c6d41e4 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 _0x5a5a=['path','rimraf','../../config/environment','AnalyticMetric','analytics_metrics','util','../../config/logger','api','moment','bluebird'];(function(_0x117bac,_0xe12783){var _0x143996=function(_0x3b901d){while(--_0x3b901d){_0x117bac['push'](_0x117bac['shift']());}};_0x143996(++_0xe12783);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x3a03ef,_0x458404){_0x3a03ef=_0x3a03ef-0x0;var _0x540c15=_0x5a5a[_0x3a03ef];return _0x540c15;};'use strict';var _=require('lodash');var util=require(_0xa5a5('0x0'));var logger=require(_0xa5a5('0x1'))(_0xa5a5('0x2'));var moment=require(_0xa5a5('0x3'));var BPromise=require(_0xa5a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5a5('0x5'));var rimraf=require(_0xa5a5('0x6'));var config=require(_0xa5a5('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x43943d,_0x1fe96d){return _0x43943d['define'](_0xa5a5('0x8'),attributes,{'tableName':_0xa5a5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b83=['bluebird','request-promise','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','util','../../config/logger','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2b83,0x1d3));var _0x32b8=function(_0x49b77e,_0x2b9c04){_0x49b77e=_0x49b77e-0x0;var _0x4309c4=_0x2b83[_0x49b77e];return _0x4309c4;};'use strict';var _=require('lodash');var util=require(_0x32b8('0x0'));var logger=require(_0x32b8('0x1'))('api');var moment=require(_0x32b8('0x2'));var BPromise=require(_0x32b8('0x3'));var rp=require(_0x32b8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x32b8('0x5'));var attributes=require(_0x32b8('0x6'));module['exports']=function(_0x6bbc3d,_0x55abd0){return _0x6bbc3d[_0x32b8('0x7')](_0x32b8('0x8'),attributes,{'tableName':_0x32b8('0x9'),'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 6493a1e..75d42ca 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 _0x5bda=['AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticMetric,\x20%s,\x20%s','debug'];(function(_0x101fe8,_0x20df0){var _0x2f5451=function(_0x2eb634){while(--_0x2eb634){_0x101fe8['push'](_0x101fe8['shift']());}};_0x2f5451(++_0x20df0);}(_0x5bda,0x1a9));var _0xa5bd=function(_0x389adb,_0x166f1c){_0x389adb=_0x389adb-0x0;var _0x59768e=_0x5bda[_0x389adb];return _0x59768e;};'use strict';var _=require(_0xa5bd('0x0'));var util=require(_0xa5bd('0x1'));var moment=require(_0xa5bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xa5bd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5bd('0x4'))['db'];var utils=require(_0xa5bd('0x5'));var logger=require(_0xa5bd('0x6'))(_0xa5bd('0x7'));var config=require(_0xa5bd('0x8'));var jayson=require(_0xa5bd('0x9'));var client=jayson['client'][_0xa5bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x179378,_0x4d2274,_0x13cf13){return new BPromise(function(_0x14ea9c,_0x2f3015){return client['request'](_0x179378,_0x13cf13)[_0xa5bd('0xb')](function(_0x11df57){logger[_0xa5bd('0xc')](_0xa5bd('0xd'),_0x4d2274,'request\x20sent');logger[_0xa5bd('0xe')](_0xa5bd('0xf'),_0x4d2274,_0xa5bd('0x10'),JSON[_0xa5bd('0x11')](_0x11df57));if(_0x11df57[_0xa5bd('0x12')]){if(_0x11df57[_0xa5bd('0x12')][_0xa5bd('0x13')]===0x1f4){logger[_0xa5bd('0x12')](_0xa5bd('0xd'),_0x4d2274,_0x11df57['error'][_0xa5bd('0x14')]);return _0x2f3015(_0x11df57[_0xa5bd('0x12')][_0xa5bd('0x14')]);}logger[_0xa5bd('0x12')](_0xa5bd('0xd'),_0x4d2274,_0x11df57[_0xa5bd('0x12')][_0xa5bd('0x14')]);return _0x14ea9c(_0x11df57[_0xa5bd('0x12')]['message']);}else{logger[_0xa5bd('0xc')](_0xa5bd('0xd'),_0x4d2274,_0xa5bd('0x10'));_0x14ea9c(_0x11df57[_0xa5bd('0x15')][_0xa5bd('0x14')]);}})['catch'](function(_0x1e1f9b){logger[_0xa5bd('0x12')](_0xa5bd('0xd'),_0x4d2274,_0x1e1f9b);_0x2f3015(_0x1e1f9b);});});} \ No newline at end of file +var _0x999e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x216bdd,_0x22e02b){var _0x3422b0=function(_0x3f6bf6){while(--_0x3f6bf6){_0x216bdd['push'](_0x216bdd['shift']());}};_0x3422b0(++_0x22e02b);}(_0x999e,0xb9));var _0xe999=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x999e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe999('0x0'));var util=require(_0xe999('0x1'));var moment=require(_0xe999('0x2'));var BPromise=require('bluebird');var rs=require(_0xe999('0x3'));var fs=require('fs');var Redis=require(_0xe999('0x4'));var db=require(_0xe999('0x5'))['db'];var utils=require(_0xe999('0x6'));var logger=require(_0xe999('0x7'))(_0xe999('0x8'));var config=require(_0xe999('0x9'));var jayson=require(_0xe999('0xa'));var client=jayson[_0xe999('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c7696,_0x204a26,_0x15ab36){return new BPromise(function(_0xb08b03,_0x483d6d){return client['request'](_0x3c7696,_0x15ab36)[_0xe999('0xc')](function(_0xaf1a3f){logger['info'](_0xe999('0xd'),_0x204a26,_0xe999('0xe'));logger[_0xe999('0xf')](_0xe999('0x10'),_0x204a26,_0xe999('0xe'),JSON[_0xe999('0x11')](_0xaf1a3f));if(_0xaf1a3f[_0xe999('0x12')]){if(_0xaf1a3f[_0xe999('0x12')][_0xe999('0x13')]===0x1f4){logger[_0xe999('0x12')](_0xe999('0xd'),_0x204a26,_0xaf1a3f[_0xe999('0x12')][_0xe999('0x14')]);return _0x483d6d(_0xaf1a3f['error'][_0xe999('0x14')]);}logger[_0xe999('0x12')](_0xe999('0xd'),_0x204a26,_0xaf1a3f[_0xe999('0x12')][_0xe999('0x14')]);return _0xb08b03(_0xaf1a3f[_0xe999('0x12')][_0xe999('0x14')]);}else{logger[_0xe999('0x15')](_0xe999('0xd'),_0x204a26,'request\x20sent');_0xb08b03(_0xaf1a3f[_0xe999('0x16')][_0xe999('0x14')]);}})[_0xe999('0x17')](function(_0x1f4e67){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x204a26,_0x1f4e67);_0x483d6d(_0x1f4e67);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index c4527c8..67d865b 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 _0xf2cf=['put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','/:id','show','post','create'];(function(_0x184031,_0x20f2d9){var _0x1454f5=function(_0x2a094b){while(--_0x2a094b){_0x184031['push'](_0x184031['shift']());}};_0x1454f5(++_0x20f2d9);}(_0xf2cf,0xf5));var _0xff2c=function(_0x26dc33,_0x23c483){_0x26dc33=_0x26dc33-0x0;var _0x1bbee3=_0xf2cf[_0x26dc33];return _0x1bbee3;};'use strict';var multer=require('multer');var util=require(_0xff2c('0x0'));var path=require(_0xff2c('0x1'));var timeout=require(_0xff2c('0x2'));var express=require('express');var router=express[_0xff2c('0x3')]();var fs_extra=require(_0xff2c('0x4'));var auth=require(_0xff2c('0x5'));var interaction=require(_0xff2c('0x6'));var config=require(_0xff2c('0x7'));var controller=require(_0xff2c('0x8'));router['get']('/',auth[_0xff2c('0x9')](),controller[_0xff2c('0xa')]);router['get'](_0xff2c('0xb'),auth[_0xff2c('0x9')](),controller[_0xff2c('0xc')]);router[_0xff2c('0xd')]('/',auth[_0xff2c('0x9')](),controller[_0xff2c('0xe')]);router[_0xff2c('0xf')]('/:id',auth[_0xff2c('0x9')](),controller[_0xff2c('0x10')]);router[_0xff2c('0x11')]('/:id',auth[_0xff2c('0x9')](),controller[_0xff2c('0x12')]);module[_0xff2c('0x13')]=router; \ No newline at end of file +var _0x9009=['get','/:id','show','post','isAuthenticated','create','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9009,0x1d4));var _0x9900=function(_0x3cfac7,_0xb9e0ee){_0x3cfac7=_0x3cfac7-0x0;var _0x171e12=_0x9009[_0x3cfac7];return _0x171e12;};'use strict';var multer=require(_0x9900('0x0'));var util=require('util');var path=require(_0x9900('0x1'));var timeout=require(_0x9900('0x2'));var express=require('express');var router=express[_0x9900('0x3')]();var fs_extra=require(_0x9900('0x4'));var auth=require(_0x9900('0x5'));var interaction=require(_0x9900('0x6'));var config=require('../../config/environment');var controller=require(_0x9900('0x7'));router[_0x9900('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9900('0x8')](_0x9900('0x9'),auth['isAuthenticated'](),controller[_0x9900('0xa')]);router[_0x9900('0xb')]('/',auth[_0x9900('0xc')](),controller[_0x9900('0xd')]);router['put'](_0x9900('0x9'),auth[_0x9900('0xc')](),controller[_0x9900('0xe')]);router[_0x9900('0xf')](_0x9900('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x9900('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index af16b36..7f90ffb 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 _0x5169=['exports','TEXT'];(function(_0x17183b,_0x248dfb){var _0x2f6554=function(_0x374b57){while(--_0x374b57){_0x17183b['push'](_0x17183b['shift']());}};_0x2f6554(++_0x248dfb);}(_0x5169,0x180));var _0x9516=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x5169[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require('sequelize');module[_0x9516('0x0')]={'tree':{'type':Sequelize[_0x9516('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x789f=['exports','sequelize'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x789f,0x129));var _0xf789=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0x789f[_0x1acc2d];return _0xabfa6d;};'use strict';var Sequelize=require(_0xf789('0x0'));module[_0xf789('0x1')]={'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 dff2f18..ff98fb9 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 _0x67ca=['desk.js','to-csv','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','stack','name','index','map','AnalyticTreeReport','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce'];(function(_0x199b64,_0x5d1120){var _0x42b220=function(_0x26d4e6){while(--_0x26d4e6){_0x199b64['push'](_0x199b64['shift']());}};_0x42b220(++_0x5d1120);}(_0x67ca,0x7b));var _0xa67c=function(_0x2694bb,_0x5602f7){_0x2694bb=_0x2694bb-0x0;var _0x4ea59f=_0x67ca[_0x2694bb];return _0x4ea59f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa67c('0x0'));var zipdir=require(_0xa67c('0x1'));var jsonpatch=require(_0xa67c('0x2'));var rp=require(_0xa67c('0x3'));var moment=require('moment');var BPromise=require(_0xa67c('0x4'));var Mustache=require('mustache');var util=require(_0xa67c('0x5'));var path=require(_0xa67c('0x6'));var sox=require(_0xa67c('0x7'));var csv=require('to-csv');var ejs=require(_0xa67c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa67c('0x9'));var squel=require(_0xa67c('0xa'));var crypto=require(_0xa67c('0xb'));var jsforce=require(_0xa67c('0xc'));var deskjs=require(_0xa67c('0xd'));var toCsv=require(_0xa67c('0xe'));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(_0xa67c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa67c('0x10'))('api');var utils=require(_0xa67c('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xa67c('0x12'));var db=require(_0xa67c('0x13'))['db'];function respondWithStatusCode(_0x5d8f4b,_0x9faf0a){_0x9faf0a=_0x9faf0a||0xcc;return function(_0x45c0bb){if(_0x45c0bb){return _0x5d8f4b[_0xa67c('0x14')](_0x9faf0a);}return _0x5d8f4b[_0xa67c('0x15')](_0x9faf0a)[_0xa67c('0x16')]();};}function respondWithResult(_0x16a73d,_0x671945){_0x671945=_0x671945||0xc8;return function(_0x3e7464){if(_0x3e7464){return _0x16a73d['status'](_0x671945)['json'](_0x3e7464);}};}function respondWithFilteredResult(_0x5aa28f,_0x4bdef4){return function(_0x26e818){if(_0x26e818){var _0x6ff018=typeof _0x4bdef4[_0xa67c('0x17')]===_0xa67c('0x18')&&typeof _0x4bdef4[_0xa67c('0x19')]==='undefined';var _0x1e0887=_0x26e818['count'];var _0x34f590=_0x6ff018?0x0:_0x4bdef4['offset'];var _0x5a3188=_0x6ff018?_0x26e818[_0xa67c('0x1a')]:_0x4bdef4[_0xa67c('0x17')]+_0x4bdef4[_0xa67c('0x19')];var _0x5409df;if(_0x5a3188>=_0x1e0887){_0x5a3188=_0x1e0887;_0x5409df=0xc8;}else{_0x5409df=0xce;}_0x5aa28f[_0xa67c('0x15')](_0x5409df);return _0x5aa28f[_0xa67c('0x1b')](_0xa67c('0x1c'),_0x34f590+'-'+_0x5a3188+'/'+_0x1e0887)[_0xa67c('0x1d')](_0x26e818);}return null;};}function patchUpdates(_0x2a3c71){return function(_0x5a9e48){try{jsonpatch[_0xa67c('0x1e')](_0x5a9e48,_0x2a3c71,!![]);}catch(_0x39621e){return BPromise[_0xa67c('0x1f')](_0x39621e);}return _0x5a9e48['save']();};}function saveUpdates(_0x427936,_0x5e2230){return function(_0x143dbd){if(_0x143dbd){return _0x143dbd['update'](_0x427936)[_0xa67c('0x20')](function(_0x11f813){return _0x11f813;});}return null;};}function removeEntity(_0xfefd64,_0x2e6fb5){return function(_0x358192){if(_0x358192){return _0x358192[_0xa67c('0x21')]()[_0xa67c('0x20')](function(){_0xfefd64[_0xa67c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b13b5,_0x356626){return function(_0x516893){if(!_0x516893){_0x5b13b5['sendStatus'](0x194);}return _0x516893;};}function handleError(_0x541cf9,_0xec104f){_0xec104f=_0xec104f||0x1f4;return function(_0x15c04a){logger['error'](_0x15c04a[_0xa67c('0x22')]);if(_0x15c04a[_0xa67c('0x23')]){delete _0x15c04a[_0xa67c('0x23')];}_0x541cf9[_0xa67c('0x15')](_0xec104f)['send'](_0x15c04a);};}exports[_0xa67c('0x24')]=function(_0x17a900,_0x36b7c1){var _0x3f31f1={},_0x184f30={},_0x24a734={'count':0x0,'rows':[]};var _0x286a5c=_[_0xa67c('0x25')](db[_0xa67c('0x26')]['rawAttributes'],function(_0x38904c){return{'name':_0x38904c['fieldName'],'type':_0x38904c[_0xa67c('0x27')][_0xa67c('0x28')]};});_0x184f30['model']=_['map'](_0x286a5c,_0xa67c('0x23'));_0x184f30[_0xa67c('0x29')]=_[_0xa67c('0x2a')](_0x17a900[_0xa67c('0x29')]);_0x184f30[_0xa67c('0x2b')]=_[_0xa67c('0x2c')](_0x184f30[_0xa67c('0x2d')],_0x184f30[_0xa67c('0x29')]);_0x3f31f1[_0xa67c('0x2e')]=_['intersection'](_0x184f30[_0xa67c('0x2d')],qs[_0xa67c('0x2f')](_0x17a900[_0xa67c('0x29')]['fields']));_0x3f31f1[_0xa67c('0x2e')]=_0x3f31f1[_0xa67c('0x2e')][_0xa67c('0x30')]?_0x3f31f1[_0xa67c('0x2e')]:_0x184f30[_0xa67c('0x2d')];if(!_0x17a900[_0xa67c('0x29')][_0xa67c('0x31')](_0xa67c('0x32'))){_0x3f31f1[_0xa67c('0x19')]=qs['limit'](_0x17a900['query']['limit']);_0x3f31f1['offset']=qs[_0xa67c('0x17')](_0x17a900['query'][_0xa67c('0x17')]);}_0x3f31f1['order']=qs[_0xa67c('0x33')](_0x17a900[_0xa67c('0x29')][_0xa67c('0x33')]);_0x3f31f1['where']=qs['filters'](_[_0xa67c('0x34')](_0x17a900[_0xa67c('0x29')],_0x184f30[_0xa67c('0x2b')]),_0x286a5c);if(_0x17a900[_0xa67c('0x29')][_0xa67c('0x35')]){_0x3f31f1[_0xa67c('0x36')]=_['merge'](_0x3f31f1['where'],{'$or':_['map'](_0x286a5c,function(_0x53d571){if(_0x53d571[_0xa67c('0x27')]!=='VIRTUAL'){var _0x4af30e={};_0x4af30e[_0x53d571[_0xa67c('0x23')]]={'$like':'%'+_0x17a900['query'][_0xa67c('0x35')]+'%'};return _0x4af30e;}})});}_0x3f31f1=_[_0xa67c('0x37')]({},_0x3f31f1,_0x17a900['options']);var _0xc1dae2={'where':_0x3f31f1[_0xa67c('0x36')]};return db[_0xa67c('0x26')]['count'](_0xc1dae2)[_0xa67c('0x20')](function(_0x1843a8){_0x24a734[_0xa67c('0x1a')]=_0x1843a8;if(_0x17a900[_0xa67c('0x29')][_0xa67c('0x38')]){_0x3f31f1[_0xa67c('0x39')]=[{'all':!![]}];}return db[_0xa67c('0x26')][_0xa67c('0x3a')](_0x3f31f1);})[_0xa67c('0x20')](function(_0x55135e){_0x24a734[_0xa67c('0x3b')]=_0x55135e;return _0x24a734;})['then'](respondWithFilteredResult(_0x36b7c1,_0x3f31f1))[_0xa67c('0x3c')](handleError(_0x36b7c1,null));};exports[_0xa67c('0x3d')]=function(_0x428dc0,_0x3f9915){var _0x5f5c42={'raw':!![],'where':{'id':_0x428dc0[_0xa67c('0x3e')]['id']}},_0x1f0f3={};_0x1f0f3[_0xa67c('0x2d')]=_['keys'](db[_0xa67c('0x26')]['rawAttributes']);_0x1f0f3[_0xa67c('0x29')]=_[_0xa67c('0x2a')](_0x428dc0[_0xa67c('0x29')]);_0x1f0f3['filters']=_['intersection'](_0x1f0f3[_0xa67c('0x2d')],_0x1f0f3[_0xa67c('0x29')]);_0x5f5c42['attributes']=_[_0xa67c('0x2c')](_0x1f0f3[_0xa67c('0x2d')],qs[_0xa67c('0x2f')](_0x428dc0[_0xa67c('0x29')]['fields']));_0x5f5c42['attributes']=_0x5f5c42['attributes'][_0xa67c('0x30')]?_0x5f5c42['attributes']:_0x1f0f3['model'];if(_0x428dc0['query'][_0xa67c('0x38')]){_0x5f5c42['include']=[{'all':!![]}];}_0x5f5c42=_['merge']({},_0x5f5c42,_0x428dc0[_0xa67c('0x3f')]);return db[_0xa67c('0x26')][_0xa67c('0x40')](_0x5f5c42)[_0xa67c('0x20')](handleEntityNotFound(_0x3f9915,null))[_0xa67c('0x20')](respondWithResult(_0x3f9915,null))[_0xa67c('0x3c')](handleError(_0x3f9915,null));};exports[_0xa67c('0x41')]=function(_0x47776a,_0x4e4792){return db[_0xa67c('0x26')][_0xa67c('0x41')](_0x47776a[_0xa67c('0x42')],{})['then'](respondWithResult(_0x4e4792,0xc9))[_0xa67c('0x3c')](handleError(_0x4e4792,null));};exports[_0xa67c('0x43')]=function(_0x822651,_0x4fb8b7){if(_0x822651[_0xa67c('0x42')]['id']){delete _0x822651[_0xa67c('0x42')]['id'];}return db[_0xa67c('0x26')][_0xa67c('0x40')]({'where':{'id':_0x822651[_0xa67c('0x3e')]['id']}})[_0xa67c('0x20')](handleEntityNotFound(_0x4fb8b7,null))['then'](saveUpdates(_0x822651[_0xa67c('0x42')],null))['then'](respondWithResult(_0x4fb8b7,null))['catch'](handleError(_0x4fb8b7,null));};exports[_0xa67c('0x21')]=function(_0x4558cd,_0x4e559a){return db[_0xa67c('0x26')][_0xa67c('0x40')]({'where':{'id':_0x4558cd[_0xa67c('0x3e')]['id']}})[_0xa67c('0x20')](handleEntityNotFound(_0x4e559a,null))[_0xa67c('0x20')](removeEntity(_0x4e559a,null))[_0xa67c('0x3c')](handleError(_0x4e559a,null));}; \ No newline at end of file +var _0x96c2=['find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','then','count','includeAll','rows','catch','params','keys','include','body'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x96c2,0xdc));var _0x296c=function(_0x44ca6e,_0x5e2c91){_0x44ca6e=_0x44ca6e-0x0;var _0x2edab2=_0x96c2[_0x44ca6e];return _0x2edab2;};'use strict';var emlformat=require(_0x296c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x296c('0x1'));var jsonpatch=require(_0x296c('0x2'));var rp=require(_0x296c('0x3'));var moment=require(_0x296c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x296c('0x5'));var util=require('util');var path=require(_0x296c('0x6'));var sox=require(_0x296c('0x7'));var csv=require(_0x296c('0x8'));var ejs=require(_0x296c('0x9'));var fs=require('fs');var fs_extra=require(_0x296c('0xa'));var _=require(_0x296c('0xb'));var squel=require(_0x296c('0xc'));var crypto=require(_0x296c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x296c('0xe'));var toCsv=require(_0x296c('0x8'));var querystring=require(_0x296c('0xf'));var Papa=require(_0x296c('0x10'));var Redis=require('ioredis');var authService=require(_0x296c('0x11'));var qs=require(_0x296c('0x12'));var as=require(_0x296c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x296c('0x14'))(_0x296c('0x15'));var utils=require(_0x296c('0x16'));var config=require(_0x296c('0x17'));var licenseUtil=require(_0x296c('0x18'));var db=require(_0x296c('0x19'))['db'];function respondWithStatusCode(_0x126b6f,_0x407735){_0x407735=_0x407735||0xcc;return function(_0x31a325){if(_0x31a325){return _0x126b6f[_0x296c('0x1a')](_0x407735);}return _0x126b6f[_0x296c('0x1b')](_0x407735)[_0x296c('0x1c')]();};}function respondWithResult(_0x434cf1,_0x361f94){_0x361f94=_0x361f94||0xc8;return function(_0x19cecf){if(_0x19cecf){return _0x434cf1[_0x296c('0x1b')](_0x361f94)['json'](_0x19cecf);}};}function respondWithFilteredResult(_0x5ea23e,_0x5c3f14){return function(_0x479e89){if(_0x479e89){var _0x9d7d0=typeof _0x5c3f14[_0x296c('0x1d')]===_0x296c('0x1e')&&typeof _0x5c3f14[_0x296c('0x1f')]===_0x296c('0x1e');var _0x28dc35=_0x479e89['count'];var _0x424903=_0x9d7d0?0x0:_0x5c3f14[_0x296c('0x1d')];var _0x1a6be8=_0x9d7d0?_0x479e89['count']:_0x5c3f14['offset']+_0x5c3f14[_0x296c('0x1f')];var _0x3ce023;if(_0x1a6be8>=_0x28dc35){_0x1a6be8=_0x28dc35;_0x3ce023=0xc8;}else{_0x3ce023=0xce;}_0x5ea23e[_0x296c('0x1b')](_0x3ce023);return _0x5ea23e[_0x296c('0x20')](_0x296c('0x21'),_0x424903+'-'+_0x1a6be8+'/'+_0x28dc35)[_0x296c('0x22')](_0x479e89);}return null;};}function patchUpdates(_0x481ec8){return function(_0x3af33f){try{jsonpatch[_0x296c('0x23')](_0x3af33f,_0x481ec8,!![]);}catch(_0x43d7fe){return BPromise[_0x296c('0x24')](_0x43d7fe);}return _0x3af33f[_0x296c('0x25')]();};}function saveUpdates(_0x3c61a5,_0x18e260){return function(_0x1b57ed){if(_0x1b57ed){return _0x1b57ed[_0x296c('0x26')](_0x3c61a5)['then'](function(_0x5f31c6){return _0x5f31c6;});}return null;};}function removeEntity(_0x279ec3,_0x5cec0a){return function(_0x3b4965){if(_0x3b4965){return _0x3b4965[_0x296c('0x27')]()['then'](function(){_0x279ec3[_0x296c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e81c6,_0x28c2db){return function(_0x2d3a9c){if(!_0x2d3a9c){_0x2e81c6[_0x296c('0x1a')](0x194);}return _0x2d3a9c;};}function handleError(_0x2a9e48,_0x3d0d83){_0x3d0d83=_0x3d0d83||0x1f4;return function(_0x4858f5){logger['error'](_0x4858f5['stack']);if(_0x4858f5[_0x296c('0x28')]){delete _0x4858f5['name'];}_0x2a9e48[_0x296c('0x1b')](_0x3d0d83)['send'](_0x4858f5);};}exports[_0x296c('0x29')]=function(_0xe22b19,_0x37734d){var _0xa023b5={},_0x16af8f={},_0x2784a1={'count':0x0,'rows':[]};var _0x553abb=_['map'](db[_0x296c('0x2a')][_0x296c('0x2b')],function(_0x411a5a){return{'name':_0x411a5a[_0x296c('0x2c')],'type':_0x411a5a[_0x296c('0x2d')][_0x296c('0x2e')]};});_0x16af8f[_0x296c('0x2f')]=_[_0x296c('0x30')](_0x553abb,_0x296c('0x28'));_0x16af8f[_0x296c('0x31')]=_['keys'](_0xe22b19[_0x296c('0x31')]);_0x16af8f[_0x296c('0x32')]=_[_0x296c('0x33')](_0x16af8f[_0x296c('0x2f')],_0x16af8f[_0x296c('0x31')]);_0xa023b5[_0x296c('0x34')]=_[_0x296c('0x33')](_0x16af8f[_0x296c('0x2f')],qs[_0x296c('0x35')](_0xe22b19[_0x296c('0x31')][_0x296c('0x35')]));_0xa023b5['attributes']=_0xa023b5['attributes'][_0x296c('0x36')]?_0xa023b5[_0x296c('0x34')]:_0x16af8f[_0x296c('0x2f')];if(!_0xe22b19[_0x296c('0x31')][_0x296c('0x37')](_0x296c('0x38'))){_0xa023b5['limit']=qs[_0x296c('0x1f')](_0xe22b19[_0x296c('0x31')][_0x296c('0x1f')]);_0xa023b5[_0x296c('0x1d')]=qs[_0x296c('0x1d')](_0xe22b19[_0x296c('0x31')][_0x296c('0x1d')]);}_0xa023b5['order']=qs[_0x296c('0x39')](_0xe22b19['query'][_0x296c('0x39')]);_0xa023b5[_0x296c('0x3a')]=qs[_0x296c('0x32')](_['pick'](_0xe22b19[_0x296c('0x31')],_0x16af8f[_0x296c('0x32')]),_0x553abb);if(_0xe22b19[_0x296c('0x31')][_0x296c('0x3b')]){_0xa023b5[_0x296c('0x3a')]=_[_0x296c('0x3c')](_0xa023b5[_0x296c('0x3a')],{'$or':_[_0x296c('0x30')](_0x553abb,function(_0x4f228e){if(_0x4f228e['type']!==_0x296c('0x3d')){var _0x2f0e2e={};_0x2f0e2e[_0x4f228e[_0x296c('0x28')]]={'$like':'%'+_0xe22b19['query'][_0x296c('0x3b')]+'%'};return _0x2f0e2e;}})});}_0xa023b5=_['merge']({},_0xa023b5,_0xe22b19[_0x296c('0x3e')]);var _0x704c63={'where':_0xa023b5['where']};return db['AnalyticTreeReport']['count'](_0x704c63)[_0x296c('0x3f')](function(_0x262b9c){_0x2784a1[_0x296c('0x40')]=_0x262b9c;if(_0xe22b19[_0x296c('0x31')][_0x296c('0x41')]){_0xa023b5['include']=[{'all':!![]}];}return db[_0x296c('0x2a')]['findAll'](_0xa023b5);})['then'](function(_0x15b7a4){_0x2784a1[_0x296c('0x42')]=_0x15b7a4;return _0x2784a1;})[_0x296c('0x3f')](respondWithFilteredResult(_0x37734d,_0xa023b5))[_0x296c('0x43')](handleError(_0x37734d,null));};exports['show']=function(_0x3bfa37,_0x183324){var _0x32c4a6={'raw':!![],'where':{'id':_0x3bfa37[_0x296c('0x44')]['id']}},_0x4829a3={};_0x4829a3[_0x296c('0x2f')]=_[_0x296c('0x45')](db['AnalyticTreeReport'][_0x296c('0x2b')]);_0x4829a3[_0x296c('0x31')]=_[_0x296c('0x45')](_0x3bfa37[_0x296c('0x31')]);_0x4829a3[_0x296c('0x32')]=_[_0x296c('0x33')](_0x4829a3[_0x296c('0x2f')],_0x4829a3[_0x296c('0x31')]);_0x32c4a6['attributes']=_[_0x296c('0x33')](_0x4829a3[_0x296c('0x2f')],qs[_0x296c('0x35')](_0x3bfa37[_0x296c('0x31')]['fields']));_0x32c4a6[_0x296c('0x34')]=_0x32c4a6[_0x296c('0x34')][_0x296c('0x36')]?_0x32c4a6['attributes']:_0x4829a3[_0x296c('0x2f')];if(_0x3bfa37[_0x296c('0x31')][_0x296c('0x41')]){_0x32c4a6[_0x296c('0x46')]=[{'all':!![]}];}_0x32c4a6=_[_0x296c('0x3c')]({},_0x32c4a6,_0x3bfa37[_0x296c('0x3e')]);return db['AnalyticTreeReport']['find'](_0x32c4a6)['then'](handleEntityNotFound(_0x183324,null))[_0x296c('0x3f')](respondWithResult(_0x183324,null))[_0x296c('0x43')](handleError(_0x183324,null));};exports['create']=function(_0x2edb6f,_0x49bdf8){return db['AnalyticTreeReport']['create'](_0x2edb6f[_0x296c('0x47')],{})[_0x296c('0x3f')](respondWithResult(_0x49bdf8,0xc9))[_0x296c('0x43')](handleError(_0x49bdf8,null));};exports['update']=function(_0x5680b0,_0x4e0754){if(_0x5680b0[_0x296c('0x47')]['id']){delete _0x5680b0[_0x296c('0x47')]['id'];}return db[_0x296c('0x2a')][_0x296c('0x48')]({'where':{'id':_0x5680b0[_0x296c('0x44')]['id']}})[_0x296c('0x3f')](handleEntityNotFound(_0x4e0754,null))[_0x296c('0x3f')](saveUpdates(_0x5680b0['body'],null))[_0x296c('0x3f')](respondWithResult(_0x4e0754,null))[_0x296c('0x43')](handleError(_0x4e0754,null));};exports[_0x296c('0x27')]=function(_0x4d1761,_0x30124){return db['AnalyticTreeReport'][_0x296c('0x48')]({'where':{'id':_0x4d1761[_0x296c('0x44')]['id']}})[_0x296c('0x3f')](handleEntityNotFound(_0x30124,null))[_0x296c('0x3f')](removeEntity(_0x30124,null))[_0x296c('0x43')](handleError(_0x30124,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 4698cb1..c40d61a 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 _0xda30=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0xda30,0x185));var _0x0da3=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xda30[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0x0da3('0x0'));var util=require(_0x0da3('0x1'));var logger=require(_0x0da3('0x2'))(_0x0da3('0x3'));var moment=require(_0x0da3('0x4'));var BPromise=require(_0x0da3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0da3('0x6'));var config=require(_0x0da3('0x7'));var attributes=require(_0x0da3('0x8'));module[_0x0da3('0x9')]=function(_0x420487,_0x453412){return _0x420487[_0x0da3('0xa')](_0x0da3('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2f9=['./analyticTreeReport.attributes','define','AnalyticTreeReport','../../config/logger','api','bluebird','path'];(function(_0x408cbb,_0x368547){var _0x57f5cd=function(_0x41c2c3){while(--_0x41c2c3){_0x408cbb['push'](_0x408cbb['shift']());}};_0x57f5cd(++_0x368547);}(_0xf2f9,0x1ae));var _0x9f2f=function(_0x37656f,_0x350ac6){_0x37656f=_0x37656f-0x0;var _0x5cd9d8=_0xf2f9[_0x37656f];return _0x5cd9d8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9f2f('0x0'))(_0x9f2f('0x1'));var moment=require('moment');var BPromise=require(_0x9f2f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f2f('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9f2f('0x4'));module['exports']=function(_0x4a0b4f,_0x373cf3){return _0x4a0b4f[_0x9f2f('0x5')](_0x9f2f('0x6'),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 2c2d23b..7af89d4 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x58b335,_0x3ab857){var _0x397f5c=function(_0x2f2d96){while(--_0x2f2d96){_0x58b335['push'](_0x58b335['shift']());}};_0x397f5c(++_0x3ab857);}(_0xdb28,0x106));var _0x8db2=function(_0x1fc614,_0x1001cf){_0x1fc614=_0x1fc614-0x0;var _0x44f2c6=_0xdb28[_0x1fc614];return _0x44f2c6;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x562d52,_0x3eab9c){_0x562d52=_0x562d52-0x0;var _0x231e9f=_0x7a54[_0x562d52];return _0x231e9f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index f966ffe..6050159 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 _0x7192=['Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x491884,_0x3bc8d5){var _0x45c4ae=function(_0x3ccf86){while(--_0x3ccf86){_0x491884['push'](_0x491884['shift']());}};_0x45c4ae(++_0x3bc8d5);}(_0x7192,0xcd));var _0x2719=function(_0x5eecba,_0xf00f05){_0x5eecba=_0x5eecba-0x0;var _0x4cd68e=_0x7192[_0x5eecba];return _0x4cd68e;};'use strict';var multer=require(_0x2719('0x0'));var util=require(_0x2719('0x1'));var path=require('path');var timeout=require(_0x2719('0x2'));var express=require(_0x2719('0x3'));var router=express[_0x2719('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2719('0x5'));var interaction=require(_0x2719('0x6'));var config=require('../../config/environment');var controller=require(_0x2719('0x7'));router[_0x2719('0x8')]('/',auth[_0x2719('0x9')](),controller[_0x2719('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2719('0xb')]);router[_0x2719('0xc')]('/',auth['isAuthenticated'](),controller[_0x2719('0xd')]);router[_0x2719('0xe')](_0x2719('0xf'),auth['isAuthenticated'](),controller[_0x2719('0x10')]);router[_0x2719('0x11')](_0x2719('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x2719('0x12')]=router; \ No newline at end of file +var _0x7461=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','show','post','create','put','delete'];(function(_0x8319e4,_0x1d1ec8){var _0x37ca5d=function(_0x2536a0){while(--_0x2536a0){_0x8319e4['push'](_0x8319e4['shift']());}};_0x37ca5d(++_0x1d1ec8);}(_0x7461,0x170));var _0x1746=function(_0x443e9e,_0x3c1baf){_0x443e9e=_0x443e9e-0x0;var _0x5db340=_0x7461[_0x443e9e];return _0x5db340;};'use strict';var multer=require('multer');var util=require(_0x1746('0x0'));var path=require(_0x1746('0x1'));var timeout=require(_0x1746('0x2'));var express=require(_0x1746('0x3'));var router=express[_0x1746('0x4')]();var fs_extra=require(_0x1746('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1746('0x6'));var controller=require(_0x1746('0x7'));router['get']('/',auth[_0x1746('0x8')](),controller[_0x1746('0x9')]);router['get'](_0x1746('0xa'),auth[_0x1746('0x8')](),controller[_0x1746('0xb')]);router[_0x1746('0xc')]('/',auth['isAuthenticated'](),controller[_0x1746('0xd')]);router[_0x1746('0xe')]('/:id',auth[_0x1746('0x8')](),controller['update']);router[_0x1746('0xf')]('/:id',auth[_0x1746('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 5136e3a..31f1b72 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 _0x6ec9=['sequelize','STRING'];(function(_0x3938f5,_0x5e3784){var _0x539996=function(_0x5ee4da){while(--_0x5ee4da){_0x3938f5['push'](_0x3938f5['shift']());}};_0x539996(++_0x5e3784);}(_0x6ec9,0x174));var _0x96ec=function(_0x2b6f99,_0x31128e){_0x2b6f99=_0x2b6f99-0x0;var _0x2c55c2=_0x6ec9[_0x2b6f99];return _0x2c55c2;};'use strict';var Sequelize=require(_0x96ec('0x0'));module['exports']={'name':{'type':Sequelize[_0x96ec('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x96ec('0x1')]}}; \ No newline at end of file +var _0x562d=['sequelize','exports','STRING'];(function(_0x895fa7,_0x170542){var _0x22b85a=function(_0x270acb){while(--_0x270acb){_0x895fa7['push'](_0x895fa7['shift']());}};_0x22b85a(++_0x170542);}(_0x562d,0xe1));var _0xd562=function(_0x3ff1ec,_0x5229ed){_0x3ff1ec=_0x3ff1ec-0x0;var _0x4eedef=_0x562d[_0x3ff1ec];return _0x4eedef;};'use strict';var Sequelize=require(_0xd562('0x0'));module[_0xd562('0x1')]={'name':{'type':Sequelize[_0xd562('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index f3dbbbf..17ed318 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 _0xc872=['order','sort','filter','where','VIRTUAL','merge','includeAll','include','findAll','show','params','options','find','catch','clone','keys','Attachment','omit','updatedAt','body','create','update','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','root','join','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','name','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit'];(function(_0x4c99ee,_0x2d8768){var _0x24bc5f=function(_0x9b00c1){while(--_0x9b00c1){_0x4c99ee['push'](_0x4c99ee['shift']());}};_0x24bc5f(++_0x2d8768);}(_0xc872,0xcc));var _0x2c87=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0xc872[_0x5235a6];return _0x1cf37e;};'use strict';var emlformat=require(_0x2c87('0x0'));var rimraf=require(_0x2c87('0x1'));var zipdir=require(_0x2c87('0x2'));var jsonpatch=require(_0x2c87('0x3'));var rp=require(_0x2c87('0x4'));var moment=require('moment');var BPromise=require(_0x2c87('0x5'));var Mustache=require(_0x2c87('0x6'));var util=require(_0x2c87('0x7'));var path=require(_0x2c87('0x8'));var sox=require(_0x2c87('0x9'));var csv=require('to-csv');var ejs=require(_0x2c87('0xa'));var fs=require('fs');var fs_extra=require(_0x2c87('0xb'));var _=require('lodash');var squel=require(_0x2c87('0xc'));var crypto=require(_0x2c87('0xd'));var jsforce=require(_0x2c87('0xe'));var deskjs=require(_0x2c87('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2c87('0x10'));var Papa=require(_0x2c87('0x11'));var Redis=require(_0x2c87('0x12'));var authService=require(_0x2c87('0x13'));var qs=require(_0x2c87('0x14'));var as=require(_0x2c87('0x15'));var hardwareService=require(_0x2c87('0x16'));var logger=require(_0x2c87('0x17'))(_0x2c87('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2c87('0x19'))['db'];function respondWithStatusCode(_0x33f50f,_0xdd4f89){_0xdd4f89=_0xdd4f89||0xcc;return function(_0x567bb4){if(_0x567bb4){return _0x33f50f[_0x2c87('0x1a')](_0xdd4f89);}return _0x33f50f[_0x2c87('0x1b')](_0xdd4f89)[_0x2c87('0x1c')]();};}function respondWithResult(_0x2d2745,_0x11efe0){_0x11efe0=_0x11efe0||0xc8;return function(_0x171c86){if(_0x171c86){return _0x2d2745[_0x2c87('0x1b')](_0x11efe0)[_0x2c87('0x1d')](_0x171c86);}};}function respondWithFilteredResult(_0x170f70,_0x164da8){return function(_0x2cee2c){if(_0x2cee2c){var _0x5922b0=typeof _0x164da8[_0x2c87('0x1e')]===_0x2c87('0x1f')&&typeof _0x164da8[_0x2c87('0x20')]===_0x2c87('0x1f');var _0x2ccebf=_0x2cee2c[_0x2c87('0x21')];var _0x204d61=_0x5922b0?0x0:_0x164da8[_0x2c87('0x1e')];var _0x323f17=_0x5922b0?_0x2cee2c[_0x2c87('0x21')]:_0x164da8['offset']+_0x164da8[_0x2c87('0x20')];var _0x211f1e;if(_0x323f17>=_0x2ccebf){_0x323f17=_0x2ccebf;_0x211f1e=0xc8;}else{_0x211f1e=0xce;}_0x170f70[_0x2c87('0x1b')](_0x211f1e);return _0x170f70[_0x2c87('0x22')]('Content-Range',_0x204d61+'-'+_0x323f17+'/'+_0x2ccebf)['json'](_0x2cee2c);}return null;};}function patchUpdates(_0x4225d9){return function(_0x40b2a7){try{jsonpatch['apply'](_0x40b2a7,_0x4225d9,!![]);}catch(_0x5e028b){return BPromise[_0x2c87('0x23')](_0x5e028b);}return _0x40b2a7[_0x2c87('0x24')]();};}function saveUpdates(_0x3086c5,_0x15ea79){return function(_0x28a3b5){if(_0x28a3b5){return _0x28a3b5['update'](_0x3086c5)[_0x2c87('0x25')](function(_0x476e6a){return _0x476e6a;});}return null;};}function removeEntity(_0x3ae760,_0x248555){return function(_0xa9c67c){if(_0xa9c67c){return _0xa9c67c[_0x2c87('0x26')]()[_0x2c87('0x25')](function(){_0x3ae760[_0x2c87('0x1b')](0xcc)[_0x2c87('0x1c')]();});}};}function handleEntityNotFound(_0x4d9236,_0x228ec9){return function(_0x8c2cd3){if(!_0x8c2cd3){_0x4d9236[_0x2c87('0x1a')](0x194);}return _0x8c2cd3;};}function handleError(_0xf9314d,_0x26b892){_0x26b892=_0x26b892||0x1f4;return function(_0x251bf3){logger[_0x2c87('0x27')](_0x251bf3['stack']);if(_0x251bf3['name']){delete _0x251bf3[_0x2c87('0x28')];}_0xf9314d[_0x2c87('0x1b')](_0x26b892)['send'](_0x251bf3);};}exports['index']=function(_0xbd1186,_0x57f118){var _0x1bfd5a={},_0x233ce9={},_0x4ac401={'count':0x0,'rows':[]};var _0x5dc069=_['map'](db['Attachment'][_0x2c87('0x29')],function(_0x34807d){return{'name':_0x34807d[_0x2c87('0x2a')],'type':_0x34807d[_0x2c87('0x2b')][_0x2c87('0x2c')]};});_0x233ce9[_0x2c87('0x2d')]=_[_0x2c87('0x2e')](_0x5dc069,_0x2c87('0x28'));_0x233ce9[_0x2c87('0x2f')]=_['keys'](_0xbd1186[_0x2c87('0x2f')]);_0x233ce9[_0x2c87('0x30')]=_['intersection'](_0x233ce9['model'],_0x233ce9[_0x2c87('0x2f')]);_0x1bfd5a[_0x2c87('0x31')]=_[_0x2c87('0x32')](_0x233ce9[_0x2c87('0x2d')],qs[_0x2c87('0x33')](_0xbd1186[_0x2c87('0x2f')]['fields']));_0x1bfd5a['attributes']=_0x1bfd5a[_0x2c87('0x31')][_0x2c87('0x34')]?_0x1bfd5a[_0x2c87('0x31')]:_0x233ce9[_0x2c87('0x2d')];if(!_0xbd1186[_0x2c87('0x2f')]['hasOwnProperty'](_0x2c87('0x35'))){_0x1bfd5a['limit']=qs[_0x2c87('0x20')](_0xbd1186[_0x2c87('0x2f')][_0x2c87('0x20')]);_0x1bfd5a[_0x2c87('0x1e')]=qs[_0x2c87('0x1e')](_0xbd1186[_0x2c87('0x2f')][_0x2c87('0x1e')]);}_0x1bfd5a[_0x2c87('0x36')]=qs['sort'](_0xbd1186[_0x2c87('0x2f')][_0x2c87('0x37')]);_0x1bfd5a['where']=qs[_0x2c87('0x30')](_['pick'](_0xbd1186[_0x2c87('0x2f')],_0x233ce9[_0x2c87('0x30')]),_0x5dc069);if(_0xbd1186[_0x2c87('0x2f')][_0x2c87('0x38')]){_0x1bfd5a[_0x2c87('0x39')]=_['merge'](_0x1bfd5a[_0x2c87('0x39')],{'$or':_[_0x2c87('0x2e')](_0x5dc069,function(_0x4ddc7d){if(_0x4ddc7d[_0x2c87('0x2b')]!==_0x2c87('0x3a')){var _0x4a6294={};_0x4a6294[_0x4ddc7d[_0x2c87('0x28')]]={'$like':'%'+_0xbd1186[_0x2c87('0x2f')][_0x2c87('0x38')]+'%'};return _0x4a6294;}})});}_0x1bfd5a=_[_0x2c87('0x3b')]({},_0x1bfd5a,_0xbd1186['options']);var _0x4cd7fa={'where':_0x1bfd5a[_0x2c87('0x39')]};return db['Attachment'][_0x2c87('0x21')](_0x4cd7fa)[_0x2c87('0x25')](function(_0x2b8c4c){_0x4ac401[_0x2c87('0x21')]=_0x2b8c4c;if(_0xbd1186[_0x2c87('0x2f')][_0x2c87('0x3c')]){_0x1bfd5a[_0x2c87('0x3d')]=[{'all':!![]}];}return db['Attachment'][_0x2c87('0x3e')](_0x1bfd5a);})['then'](function(_0x395bd6){_0x4ac401['rows']=_0x395bd6;return _0x4ac401;})[_0x2c87('0x25')](respondWithFilteredResult(_0x57f118,_0x1bfd5a))['catch'](handleError(_0x57f118,null));};exports[_0x2c87('0x3f')]=function(_0x3ffa5a,_0x28606f){var _0x4849fd={'raw':!![],'where':{'id':_0x3ffa5a[_0x2c87('0x40')]['id']}},_0x50f5e9={};_0x50f5e9[_0x2c87('0x2d')]=_['keys'](db['Attachment'][_0x2c87('0x29')]);_0x50f5e9[_0x2c87('0x2f')]=_['keys'](_0x3ffa5a[_0x2c87('0x2f')]);_0x50f5e9[_0x2c87('0x30')]=_[_0x2c87('0x32')](_0x50f5e9[_0x2c87('0x2d')],_0x50f5e9[_0x2c87('0x2f')]);_0x4849fd[_0x2c87('0x31')]=_[_0x2c87('0x32')](_0x50f5e9['model'],qs['fields'](_0x3ffa5a[_0x2c87('0x2f')][_0x2c87('0x33')]));_0x4849fd[_0x2c87('0x31')]=_0x4849fd[_0x2c87('0x31')][_0x2c87('0x34')]?_0x4849fd[_0x2c87('0x31')]:_0x50f5e9[_0x2c87('0x2d')];if(_0x3ffa5a[_0x2c87('0x2f')][_0x2c87('0x3c')]){_0x4849fd[_0x2c87('0x3d')]=[{'all':!![]}];}_0x4849fd=_['merge']({},_0x4849fd,_0x3ffa5a[_0x2c87('0x41')]);return db['Attachment'][_0x2c87('0x42')](_0x4849fd)[_0x2c87('0x25')](handleEntityNotFound(_0x28606f,null))['then'](respondWithResult(_0x28606f,null))[_0x2c87('0x43')](handleError(_0x28606f,null));};exports[_0x2c87('0x44')]=function(_0x5eedc4,_0x162ff3){var _0x2a2ec2={'where':{'id':_0x5eedc4[_0x2c87('0x40')]['id']}},_0x5b0546={};_0x5b0546[_0x2c87('0x2d')]=_[_0x2c87('0x45')](db[_0x2c87('0x46')][_0x2c87('0x29')]);_0x2a2ec2[_0x2c87('0x31')]=_['intersection'](_0x5b0546[_0x2c87('0x2d')],qs['fields'](_0x5eedc4[_0x2c87('0x2f')][_0x2c87('0x33')]));_0x2a2ec2[_0x2c87('0x31')]=_0x2a2ec2[_0x2c87('0x31')][_0x2c87('0x34')]?_0x2a2ec2[_0x2c87('0x31')]:_0x5b0546[_0x2c87('0x2d')];if(_0x5eedc4[_0x2c87('0x2f')][_0x2c87('0x3c')]){_0x2a2ec2[_0x2c87('0x3d')]=[{'all':!![]}];}_0x2a2ec2=_[_0x2c87('0x3b')]({},_0x2a2ec2,_0x5eedc4['options']);return db[_0x2c87('0x46')][_0x2c87('0x42')](_0x2a2ec2)['then'](handleEntityNotFound(_0x162ff3,null))[_0x2c87('0x25')](function(_0x569d1d){if(_0x569d1d){var _0x3f4c35=_0x569d1d['get']({'plain':!![]});_0x3f4c35=qs[_0x2c87('0x47')](_0x3f4c35,['id','createdAt',_0x2c87('0x48')]);_0x5eedc4[_0x2c87('0x49')]=_[_0x2c87('0x47')](_0x5eedc4[_0x2c87('0x49')],['id','createdAt',_0x2c87('0x48')]);return db[_0x2c87('0x46')][_0x2c87('0x4a')](_[_0x2c87('0x3b')](_0x3f4c35,_0x5eedc4['body']),{'include':_0x5eedc4['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x2c87('0x25')](respondWithResult(_0x162ff3,0xc9))['catch'](handleError(_0x162ff3,null));};exports[_0x2c87('0x4b')]=function(_0x2b340c,_0x2ee8b4){if(_0x2b340c[_0x2c87('0x49')]['id']){delete _0x2b340c[_0x2c87('0x49')]['id'];}return db['Attachment'][_0x2c87('0x42')]({'where':{'id':_0x2b340c[_0x2c87('0x40')]['id']}})[_0x2c87('0x25')](handleEntityNotFound(_0x2ee8b4,null))[_0x2c87('0x25')](saveUpdates(_0x2b340c[_0x2c87('0x49')],null))['then'](respondWithResult(_0x2ee8b4,null))[_0x2c87('0x43')](handleError(_0x2ee8b4,null));};exports[_0x2c87('0x26')]=function(_0x45c544,_0x15f890){return db[_0x2c87('0x46')][_0x2c87('0x42')]({'where':{'id':_0x45c544[_0x2c87('0x40')]['id']}})[_0x2c87('0x25')](handleEntityNotFound(_0x15f890,null))[_0x2c87('0x25')](removeEntity(_0x15f890,null))[_0x2c87('0x43')](handleError(_0x15f890,null));};exports[_0x2c87('0x4a')]=function(_0x4a712b,_0x149c7f,_0x1e96d2){_0x4a712b[_0x2c87('0x49')][_0x2c87('0x28')]=_0x4a712b[_0x2c87('0x4c')][_0x2c87('0x4d')];_0x4a712b[_0x2c87('0x49')]['basename']=_0x4a712b[_0x2c87('0x4c')][_0x2c87('0x4e')];_0x4a712b['body']['type']=_0x4a712b[_0x2c87('0x4c')][_0x2c87('0x4f')];return db[_0x2c87('0x46')]['create'](_0x4a712b['body'])[_0x2c87('0x25')](respondWithResult(_0x149c7f,0xc9))[_0x2c87('0x43')](handleError(_0x149c7f,null));};exports[_0x2c87('0x50')]=function(_0x2f110c,_0x159892,_0x1206d7){return db[_0x2c87('0x46')][_0x2c87('0x51')]({'where':{'id':_0x2f110c[_0x2c87('0x40')]['id']},'raw':!![]})[_0x2c87('0x25')](handleEntityNotFound(_0x159892,null))['then'](function(_0x4c6084){if(_0x4c6084){var _0x1950cc=_0x4c6084[_0x2c87('0x52')]!==null;var _0x2cdda0=path['join'](config[_0x2c87('0x53')],'server/files/attachments/');if(_0x1950cc){_0x2cdda0=path[_0x2c87('0x54')](_0x2cdda0,'offline-chat/');}var _0x4576c7=path[_0x2c87('0x54')](_0x2cdda0,_0x4c6084[_0x2c87('0x55')]);return _0x159892['download'](_0x4576c7);}})['catch'](handleError(_0x159892,null));}; \ No newline at end of file +var _0xf8f5=['params','catch','clone','find','get','omit','createdAt','updatedAt','body','create','destroy','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','name','send','map','Attachment','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows'];(function(_0x175bc7,_0x1e8056){var _0x5ea690=function(_0x1fe24e){while(--_0x1fe24e){_0x175bc7['push'](_0x175bc7['shift']());}};_0x5ea690(++_0x1e8056);}(_0xf8f5,0x121));var _0x5f8f=function(_0x31899d,_0x2bf3dc){_0x31899d=_0x31899d-0x0;var _0x534b42=_0xf8f5[_0x31899d];return _0x534b42;};'use strict';var emlformat=require(_0x5f8f('0x0'));var rimraf=require(_0x5f8f('0x1'));var zipdir=require(_0x5f8f('0x2'));var jsonpatch=require(_0x5f8f('0x3'));var rp=require(_0x5f8f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5f8f('0x5'));var util=require(_0x5f8f('0x6'));var path=require(_0x5f8f('0x7'));var sox=require(_0x5f8f('0x8'));var csv=require(_0x5f8f('0x9'));var ejs=require(_0x5f8f('0xa'));var fs=require('fs');var fs_extra=require(_0x5f8f('0xb'));var _=require(_0x5f8f('0xc'));var squel=require(_0x5f8f('0xd'));var crypto=require(_0x5f8f('0xe'));var jsforce=require(_0x5f8f('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5f8f('0x10'));var authService=require(_0x5f8f('0x11'));var qs=require(_0x5f8f('0x12'));var as=require(_0x5f8f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f8f('0x14'));var utils=require(_0x5f8f('0x15'));var config=require(_0x5f8f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f8f('0x17'))['db'];function respondWithStatusCode(_0x311807,_0x1118f6){_0x1118f6=_0x1118f6||0xcc;return function(_0x2befa1){if(_0x2befa1){return _0x311807[_0x5f8f('0x18')](_0x1118f6);}return _0x311807[_0x5f8f('0x19')](_0x1118f6)[_0x5f8f('0x1a')]();};}function respondWithResult(_0x3fc49d,_0x4f9952){_0x4f9952=_0x4f9952||0xc8;return function(_0x33c7f8){if(_0x33c7f8){return _0x3fc49d[_0x5f8f('0x19')](_0x4f9952)[_0x5f8f('0x1b')](_0x33c7f8);}};}function respondWithFilteredResult(_0x35dde8,_0x18d46f){return function(_0x3a1153){if(_0x3a1153){var _0x20f996=typeof _0x18d46f['offset']===_0x5f8f('0x1c')&&typeof _0x18d46f[_0x5f8f('0x1d')]===_0x5f8f('0x1c');var _0x1c21ce=_0x3a1153[_0x5f8f('0x1e')];var _0x56ec96=_0x20f996?0x0:_0x18d46f[_0x5f8f('0x1f')];var _0x55721c=_0x20f996?_0x3a1153[_0x5f8f('0x1e')]:_0x18d46f[_0x5f8f('0x1f')]+_0x18d46f[_0x5f8f('0x1d')];var _0xfb6ceb;if(_0x55721c>=_0x1c21ce){_0x55721c=_0x1c21ce;_0xfb6ceb=0xc8;}else{_0xfb6ceb=0xce;}_0x35dde8['status'](_0xfb6ceb);return _0x35dde8[_0x5f8f('0x20')](_0x5f8f('0x21'),_0x56ec96+'-'+_0x55721c+'/'+_0x1c21ce)[_0x5f8f('0x1b')](_0x3a1153);}return null;};}function patchUpdates(_0x429399){return function(_0x3b676e){try{jsonpatch[_0x5f8f('0x22')](_0x3b676e,_0x429399,!![]);}catch(_0xf4d341){return BPromise[_0x5f8f('0x23')](_0xf4d341);}return _0x3b676e[_0x5f8f('0x24')]();};}function saveUpdates(_0x52be6b,_0x499d5d){return function(_0x4e853e){if(_0x4e853e){return _0x4e853e[_0x5f8f('0x25')](_0x52be6b)[_0x5f8f('0x26')](function(_0x2316e3){return _0x2316e3;});}return null;};}function removeEntity(_0x44e456,_0x19bbb1){return function(_0x3d0e53){if(_0x3d0e53){return _0x3d0e53['destroy']()[_0x5f8f('0x26')](function(){_0x44e456['status'](0xcc)[_0x5f8f('0x1a')]();});}};}function handleEntityNotFound(_0x2ad36c,_0x5a4ac7){return function(_0x3a78f4){if(!_0x3a78f4){_0x2ad36c[_0x5f8f('0x18')](0x194);}return _0x3a78f4;};}function handleError(_0x5d82ca,_0x47fa6d){_0x47fa6d=_0x47fa6d||0x1f4;return function(_0xe205a6){logger['error'](_0xe205a6['stack']);if(_0xe205a6[_0x5f8f('0x27')]){delete _0xe205a6[_0x5f8f('0x27')];}_0x5d82ca[_0x5f8f('0x19')](_0x47fa6d)[_0x5f8f('0x28')](_0xe205a6);};}exports['index']=function(_0x375675,_0x549ecd){var _0x37d8df={},_0xeb9cd5={},_0x13e1b8={'count':0x0,'rows':[]};var _0x5bc769=_[_0x5f8f('0x29')](db[_0x5f8f('0x2a')][_0x5f8f('0x2b')],function(_0xf265ae){return{'name':_0xf265ae[_0x5f8f('0x2c')],'type':_0xf265ae[_0x5f8f('0x2d')][_0x5f8f('0x2e')]};});_0xeb9cd5[_0x5f8f('0x2f')]=_[_0x5f8f('0x29')](_0x5bc769,'name');_0xeb9cd5['query']=_[_0x5f8f('0x30')](_0x375675[_0x5f8f('0x31')]);_0xeb9cd5[_0x5f8f('0x32')]=_[_0x5f8f('0x33')](_0xeb9cd5[_0x5f8f('0x2f')],_0xeb9cd5['query']);_0x37d8df[_0x5f8f('0x34')]=_['intersection'](_0xeb9cd5[_0x5f8f('0x2f')],qs['fields'](_0x375675[_0x5f8f('0x31')][_0x5f8f('0x35')]));_0x37d8df[_0x5f8f('0x34')]=_0x37d8df[_0x5f8f('0x34')][_0x5f8f('0x36')]?_0x37d8df[_0x5f8f('0x34')]:_0xeb9cd5[_0x5f8f('0x2f')];if(!_0x375675[_0x5f8f('0x31')][_0x5f8f('0x37')](_0x5f8f('0x38'))){_0x37d8df[_0x5f8f('0x1d')]=qs[_0x5f8f('0x1d')](_0x375675[_0x5f8f('0x31')][_0x5f8f('0x1d')]);_0x37d8df[_0x5f8f('0x1f')]=qs[_0x5f8f('0x1f')](_0x375675[_0x5f8f('0x31')][_0x5f8f('0x1f')]);}_0x37d8df[_0x5f8f('0x39')]=qs[_0x5f8f('0x3a')](_0x375675[_0x5f8f('0x31')][_0x5f8f('0x3a')]);_0x37d8df[_0x5f8f('0x3b')]=qs['filters'](_[_0x5f8f('0x3c')](_0x375675[_0x5f8f('0x31')],_0xeb9cd5[_0x5f8f('0x32')]),_0x5bc769);if(_0x375675['query']['filter']){_0x37d8df[_0x5f8f('0x3b')]=_[_0x5f8f('0x3d')](_0x37d8df['where'],{'$or':_[_0x5f8f('0x29')](_0x5bc769,function(_0x49ed19){if(_0x49ed19['type']!=='VIRTUAL'){var _0x55de6a={};_0x55de6a[_0x49ed19[_0x5f8f('0x27')]]={'$like':'%'+_0x375675[_0x5f8f('0x31')]['filter']+'%'};return _0x55de6a;}})});}_0x37d8df=_[_0x5f8f('0x3d')]({},_0x37d8df,_0x375675[_0x5f8f('0x3e')]);var _0x4c2db7={'where':_0x37d8df[_0x5f8f('0x3b')]};return db[_0x5f8f('0x2a')]['count'](_0x4c2db7)['then'](function(_0x88ec5a){_0x13e1b8[_0x5f8f('0x1e')]=_0x88ec5a;if(_0x375675[_0x5f8f('0x31')][_0x5f8f('0x3f')]){_0x37d8df[_0x5f8f('0x40')]=[{'all':!![]}];}return db['Attachment'][_0x5f8f('0x41')](_0x37d8df);})[_0x5f8f('0x26')](function(_0x14a77c){_0x13e1b8[_0x5f8f('0x42')]=_0x14a77c;return _0x13e1b8;})['then'](respondWithFilteredResult(_0x549ecd,_0x37d8df))['catch'](handleError(_0x549ecd,null));};exports['show']=function(_0x1bf2b7,_0x2dcdac){var _0x1917d6={'raw':!![],'where':{'id':_0x1bf2b7[_0x5f8f('0x43')]['id']}},_0x2fb0a2={};_0x2fb0a2['model']=_[_0x5f8f('0x30')](db[_0x5f8f('0x2a')][_0x5f8f('0x2b')]);_0x2fb0a2[_0x5f8f('0x31')]=_[_0x5f8f('0x30')](_0x1bf2b7[_0x5f8f('0x31')]);_0x2fb0a2['filters']=_[_0x5f8f('0x33')](_0x2fb0a2['model'],_0x2fb0a2['query']);_0x1917d6[_0x5f8f('0x34')]=_['intersection'](_0x2fb0a2[_0x5f8f('0x2f')],qs[_0x5f8f('0x35')](_0x1bf2b7['query']['fields']));_0x1917d6[_0x5f8f('0x34')]=_0x1917d6[_0x5f8f('0x34')][_0x5f8f('0x36')]?_0x1917d6[_0x5f8f('0x34')]:_0x2fb0a2[_0x5f8f('0x2f')];if(_0x1bf2b7[_0x5f8f('0x31')][_0x5f8f('0x3f')]){_0x1917d6['include']=[{'all':!![]}];}_0x1917d6=_[_0x5f8f('0x3d')]({},_0x1917d6,_0x1bf2b7['options']);return db[_0x5f8f('0x2a')]['find'](_0x1917d6)[_0x5f8f('0x26')](handleEntityNotFound(_0x2dcdac,null))['then'](respondWithResult(_0x2dcdac,null))[_0x5f8f('0x44')](handleError(_0x2dcdac,null));};exports[_0x5f8f('0x45')]=function(_0x5af707,_0x15acc9){var _0x1969b8={'where':{'id':_0x5af707['params']['id']}},_0xd9cc5c={};_0xd9cc5c[_0x5f8f('0x2f')]=_[_0x5f8f('0x30')](db[_0x5f8f('0x2a')]['rawAttributes']);_0x1969b8[_0x5f8f('0x34')]=_[_0x5f8f('0x33')](_0xd9cc5c[_0x5f8f('0x2f')],qs[_0x5f8f('0x35')](_0x5af707[_0x5f8f('0x31')][_0x5f8f('0x35')]));_0x1969b8['attributes']=_0x1969b8[_0x5f8f('0x34')][_0x5f8f('0x36')]?_0x1969b8[_0x5f8f('0x34')]:_0xd9cc5c[_0x5f8f('0x2f')];if(_0x5af707[_0x5f8f('0x31')][_0x5f8f('0x3f')]){_0x1969b8[_0x5f8f('0x40')]=[{'all':!![]}];}_0x1969b8=_['merge']({},_0x1969b8,_0x5af707[_0x5f8f('0x3e')]);return db[_0x5f8f('0x2a')][_0x5f8f('0x46')](_0x1969b8)[_0x5f8f('0x26')](handleEntityNotFound(_0x15acc9,null))['then'](function(_0x240dc6){if(_0x240dc6){var _0x11b0ba=_0x240dc6[_0x5f8f('0x47')]({'plain':!![]});_0x11b0ba=qs[_0x5f8f('0x48')](_0x11b0ba,['id',_0x5f8f('0x49'),_0x5f8f('0x4a')]);_0x5af707[_0x5f8f('0x4b')]=_[_0x5f8f('0x48')](_0x5af707[_0x5f8f('0x4b')],['id',_0x5f8f('0x49'),_0x5f8f('0x4a')]);return db[_0x5f8f('0x2a')][_0x5f8f('0x4c')](_['merge'](_0x11b0ba,_0x5af707[_0x5f8f('0x4b')]),{'include':_0x5af707[_0x5f8f('0x31')][_0x5f8f('0x3f')]?[{'all':!![]}]:undefined});}})[_0x5f8f('0x26')](respondWithResult(_0x15acc9,0xc9))[_0x5f8f('0x44')](handleError(_0x15acc9,null));};exports[_0x5f8f('0x25')]=function(_0x217938,_0x3b1209){if(_0x217938[_0x5f8f('0x4b')]['id']){delete _0x217938['body']['id'];}return db[_0x5f8f('0x2a')]['find']({'where':{'id':_0x217938[_0x5f8f('0x43')]['id']}})['then'](handleEntityNotFound(_0x3b1209,null))[_0x5f8f('0x26')](saveUpdates(_0x217938['body'],null))['then'](respondWithResult(_0x3b1209,null))[_0x5f8f('0x44')](handleError(_0x3b1209,null));};exports[_0x5f8f('0x4d')]=function(_0x5bb946,_0x433b60){return db[_0x5f8f('0x2a')][_0x5f8f('0x46')]({'where':{'id':_0x5bb946[_0x5f8f('0x43')]['id']}})['then'](handleEntityNotFound(_0x433b60,null))[_0x5f8f('0x26')](removeEntity(_0x433b60,null))[_0x5f8f('0x44')](handleError(_0x433b60,null));};exports['create']=function(_0x5a7304,_0x489130,_0x5b11a4){_0x5a7304[_0x5f8f('0x4b')][_0x5f8f('0x27')]=_0x5a7304[_0x5f8f('0x4e')][_0x5f8f('0x4f')];_0x5a7304[_0x5f8f('0x4b')][_0x5f8f('0x50')]=_0x5a7304[_0x5f8f('0x4e')]['filename'];_0x5a7304[_0x5f8f('0x4b')][_0x5f8f('0x2d')]=_0x5a7304[_0x5f8f('0x4e')][_0x5f8f('0x51')];return db[_0x5f8f('0x2a')][_0x5f8f('0x4c')](_0x5a7304[_0x5f8f('0x4b')])[_0x5f8f('0x26')](respondWithResult(_0x489130,0xc9))[_0x5f8f('0x44')](handleError(_0x489130,null));};exports[_0x5f8f('0x52')]=function(_0x5e403c,_0x3b1ac5,_0x121c1){return db[_0x5f8f('0x2a')][_0x5f8f('0x53')]({'where':{'id':_0x5e403c[_0x5f8f('0x43')]['id']},'raw':!![]})[_0x5f8f('0x26')](handleEntityNotFound(_0x3b1ac5,null))[_0x5f8f('0x26')](function(_0x222f8f){if(_0x222f8f){var _0x2a5cab=_0x222f8f[_0x5f8f('0x54')]!==null;var _0x2b3ff9=path[_0x5f8f('0x55')](config[_0x5f8f('0x56')],_0x5f8f('0x57'));if(_0x2a5cab){_0x2b3ff9=path[_0x5f8f('0x55')](_0x2b3ff9,_0x5f8f('0x58'));}var _0x1cdee6=path['join'](_0x2b3ff9,_0x222f8f[_0x5f8f('0x50')]);return _0x3b1ac5[_0x5f8f('0x52')](_0x1cdee6);}})['catch'](handleError(_0x3b1ac5,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index c58b233..e33000d 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 _0xe677=['Attachment','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x44266a,_0x1a495e){var _0x10d89f=function(_0x55ce51){while(--_0x55ce51){_0x44266a['push'](_0x44266a['shift']());}};_0x10d89f(++_0x1a495e);}(_0xe677,0x123));var _0x7e67=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xe677[_0x1cfa0d];return _0xe33279;};'use strict';var _=require('lodash');var util=require(_0x7e67('0x0'));var logger=require(_0x7e67('0x1'))('api');var moment=require(_0x7e67('0x2'));var BPromise=require(_0x7e67('0x3'));var rp=require(_0x7e67('0x4'));var fs=require('fs');var path=require(_0x7e67('0x5'));var rimraf=require(_0x7e67('0x6'));var config=require(_0x7e67('0x7'));var attributes=require(_0x7e67('0x8'));module['exports']=function(_0x33220b,_0x21a758){return _0x33220b['define'](_0x7e67('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x254a=['../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x220586,_0x54fa09){var _0x38ee70=function(_0x1cfca9){while(--_0x1cfca9){_0x220586['push'](_0x220586['shift']());}};_0x38ee70(++_0x54fa09);}(_0x254a,0x18e));var _0xa254=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0x254a[_0x5a6961];return _0x4af0a6;};'use strict';var _=require(_0xa254('0x0'));var util=require(_0xa254('0x1'));var logger=require(_0xa254('0x2'))(_0xa254('0x3'));var moment=require(_0xa254('0x4'));var BPromise=require(_0xa254('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa254('0x6'));var rimraf=require(_0xa254('0x7'));var config=require(_0xa254('0x8'));var attributes=require(_0xa254('0x9'));module[_0xa254('0xa')]=function(_0x141473,_0x296389){return _0x141473[_0xa254('0xb')](_0xa254('0xc'),attributes,{'tableName':_0xa254('0xd'),'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 b477ea0..20f852b 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 _0xb201=['stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','Attachment,\x20%s,\x20%s','message','result','CreateAttachment','Attachment','create','body','options','raw'];(function(_0xb6ebda,_0xfb8708){var _0x45fb3b=function(_0x598b85){while(--_0x598b85){_0xb6ebda['push'](_0xb6ebda['shift']());}};_0x45fb3b(++_0xfb8708);}(_0xb201,0x1b1));var _0x1b20=function(_0x2c7261,_0x264bae){_0x2c7261=_0x2c7261-0x0;var _0x4b21d1=_0xb201[_0x2c7261];return _0x4b21d1;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var moment=require(_0x1b20('0x1'));var BPromise=require(_0x1b20('0x2'));var rs=require(_0x1b20('0x3'));var fs=require('fs');var Redis=require(_0x1b20('0x4'));var db=require(_0x1b20('0x5'))['db'];var utils=require(_0x1b20('0x6'));var logger=require('../../config/logger')(_0x1b20('0x7'));var config=require(_0x1b20('0x8'));var jayson=require(_0x1b20('0x9'));var client=jayson['client'][_0x1b20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50cdbc,_0x34304b,_0x2a184f){return new BPromise(function(_0x3cc600,_0x426ae9){return client['request'](_0x50cdbc,_0x2a184f)[_0x1b20('0xb')](function(_0x1f5ae4){logger[_0x1b20('0xc')]('Attachment,\x20%s,\x20%s',_0x34304b,_0x1b20('0xd'));logger['debug'](_0x1b20('0xe'),_0x34304b,'request\x20sent',JSON['stringify'](_0x1f5ae4));if(_0x1f5ae4[_0x1b20('0xf')]){if(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x10')]===0x1f4){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x426ae9(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x3cc600(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}else{logger['info'](_0x1b20('0x11'),_0x34304b,'request\x20sent');_0x3cc600(_0x1f5ae4[_0x1b20('0x13')][_0x1b20('0x12')]);}})['catch'](function(_0x44e713){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x44e713);_0x426ae9(_0x44e713);});});}exports[_0x1b20('0x14')]=function(_0xff7c72){var _0xf9078e=this;return new Promise(function(_0x34517f,_0x46bb09){return db[_0x1b20('0x15')][_0x1b20('0x16')](_0xff7c72[_0x1b20('0x17')],{'raw':_0xff7c72[_0x1b20('0x18')]?_0xff7c72[_0x1b20('0x18')][_0x1b20('0x19')]===undefined?!![]:![]:!![]})[_0x1b20('0xb')](function(_0x4823d4){logger[_0x1b20('0xc')]('CreateAttachment',_0xff7c72);logger['debug']('CreateAttachment',_0xff7c72,JSON[_0x1b20('0x1a')](_0x4823d4));_0x34517f(_0x4823d4);})['catch'](function(_0x5c3038){logger[_0x1b20('0xf')]('CreateAttachment',_0x5c3038[_0x1b20('0x12')],_0xff7c72);_0x46bb09(_0xf9078e['error'](0x1f4,_0x5c3038[_0x1b20('0x12')]));});});}; \ No newline at end of file +var _0x4522=['code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','body','options','raw','info','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error'];(function(_0x548654,_0x9f385){var _0x24ec47=function(_0x3c224f){while(--_0x3c224f){_0x548654['push'](_0x548654['shift']());}};_0x24ec47(++_0x9f385);}(_0x4522,0x1a0));var _0x2452=function(_0x4906f6,_0x3a9b5d){_0x4906f6=_0x4906f6-0x0;var _0x4542e9=_0x4522[_0x4906f6];return _0x4542e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2452('0x0'));var BPromise=require(_0x2452('0x1'));var rs=require(_0x2452('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2452('0x3'))['db'];var utils=require(_0x2452('0x4'));var logger=require(_0x2452('0x5'))(_0x2452('0x6'));var config=require(_0x2452('0x7'));var jayson=require(_0x2452('0x8'));var client=jayson[_0x2452('0x9')][_0x2452('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0139,_0x149807,_0x3bc193){return new BPromise(function(_0x33b935,_0x24073f){return client[_0x2452('0xb')](_0x2f0139,_0x3bc193)[_0x2452('0xc')](function(_0x2995b5){logger['info']('Attachment,\x20%s,\x20%s',_0x149807,_0x2452('0xd'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x149807,_0x2452('0xd'),JSON[_0x2452('0xe')](_0x2995b5));if(_0x2995b5[_0x2452('0xf')]){if(_0x2995b5[_0x2452('0xf')][_0x2452('0x10')]===0x1f4){logger[_0x2452('0xf')](_0x2452('0x11'),_0x149807,_0x2995b5[_0x2452('0xf')]['message']);return _0x24073f(_0x2995b5['error']['message']);}logger[_0x2452('0xf')]('Attachment,\x20%s,\x20%s',_0x149807,_0x2995b5[_0x2452('0xf')]['message']);return _0x33b935(_0x2995b5[_0x2452('0xf')][_0x2452('0x12')]);}else{logger['info'](_0x2452('0x11'),_0x149807,'request\x20sent');_0x33b935(_0x2995b5[_0x2452('0x13')][_0x2452('0x12')]);}})[_0x2452('0x14')](function(_0xdede20){logger['error'](_0x2452('0x11'),_0x149807,_0xdede20);_0x24073f(_0xdede20);});});}exports[_0x2452('0x15')]=function(_0x59d89a){var _0x4802ad=this;return new Promise(function(_0x1bfb44,_0x37c6a6){return db[_0x2452('0x16')]['create'](_0x59d89a[_0x2452('0x17')],{'raw':_0x59d89a[_0x2452('0x18')]?_0x59d89a[_0x2452('0x18')][_0x2452('0x19')]===undefined?!![]:![]:!![]})[_0x2452('0xc')](function(_0x1c70cb){logger[_0x2452('0x1a')](_0x2452('0x15'),_0x59d89a);logger['debug']('CreateAttachment',_0x59d89a,JSON[_0x2452('0xe')](_0x1c70cb));_0x1bfb44(_0x1c70cb);})[_0x2452('0x14')](function(_0x4bb3ff){logger[_0x2452('0xf')](_0x2452('0x15'),_0x4bb3ff[_0x2452('0x12')],_0x59d89a);_0x37c6a6(_0x4802ad[_0x2452('0xf')](0x1f4,_0x4bb3ff[_0x2452('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 86e6bbe..3691116 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x4c6c12,_0x827b7c){var _0x36839a=function(_0x54bf73){while(--_0x54bf73){_0x4c6c12['push'](_0x4c6c12['shift']());}};_0x36839a(++_0x827b7c);}(_0xadb5,0xad));var _0x5adb=function(_0x17e401,_0x129eeb){_0x17e401=_0x17e401-0x0;var _0x48d168=_0xadb5[_0x17e401];return _0x48d168;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file +var _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(_0x557d06,_0x2fe80a){var _0x570d09=function(_0x1d058d){while(--_0x1d058d){_0x557d06['push'](_0x557d06['shift']());}};_0x570d09(++_0x2fe80a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x8a296a,_0xe357a9){_0x8a296a=_0x8a296a-0x0;var _0x519e7f=_0x5f2f[_0x8a296a];return _0x519e7f;};'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 ec4cbee..434e171 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 _0x1169=['disabled','blocked','blockedAt','online','admin','user','agent','add','minutes','clearBlockUser','getLicense','send','login','authenticate','ad-login','json','use','name','password','User','passport','passport-local','moment','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','activedirectory','undefined','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','findOne','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','salt','role'];(function(_0x239b16,_0x51ce2b){var _0x5547e7=function(_0x4a5ef5){while(--_0x4a5ef5){_0x239b16['push'](_0x239b16['shift']());}};_0x5547e7(++_0x51ce2b);}(_0x1169,0x68));var _0x9116=function(_0x50780a,_0x226772){_0x50780a=_0x50780a-0x0;var _0x3cccf7=_0x1169[_0x50780a];return _0x3cccf7;};'use strict';var passport=require(_0x9116('0x0'));var LocalStrategy=require(_0x9116('0x1'))['Strategy'];var moment=require(_0x9116('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x9116('0x3'));var util=require(_0x9116('0x4'));var db=require(_0x9116('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x9116('0x6'));var config=require(_0x9116('0x7'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x278398){var _0xce8dec=![];if(typeof _0x278398[_0x9116('0x8')]!==_0x9116('0x9')){_0xce8dec=_0x278398[_0x9116('0x8')][_0x9116('0xa')]&&_0x278398['activedirectory'][_0x9116('0xb')]&&_0x278398['activedirectory'][_0x9116('0xc')];}return _0xce8dec;}function adAuthenticate(_0xa48a54,_0x5cd60f,_0x124f1a){return new BPromise(function(_0x37a11e,_0x2e1d5a){try{var _0x34b460=new ActiveDirectory(_0xa48a54);_0x34b460['authenticate'](_0x5cd60f,_0x124f1a,function(_0x29f732,_0x3c4e0c){if(_0x29f732){logger[_0x9116('0xd')](_0x9116('0xe'),_0x5cd60f,util['inspect'](_0x29f732,{'showHidden':![],'depth':null}));_0x2e1d5a(_0x9116('0xf'));}else if(!_0x3c4e0c){logger[_0x9116('0xd')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x5cd60f);_0x2e1d5a(_0x9116('0xf'));}else{_0x37a11e(_0x3c4e0c);}});}catch(_0x4de9df){_0x2e1d5a(_0x4de9df);}});}function ActiveDirectoryAuthenticate(_0x255407,_0xa8880a,_0x4fa7b0,_0x5e5e49){var _0x410799,_0x3a623e;if(!isActiveDirectoryConfigured(config)){logger[_0x9116('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0xa8880a);return _0x5e5e49(null,![],{'message':_0x9116('0xf')});}return db['Setting'][_0x9116('0x10')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x9116('0x11')],'raw':!![]})[_0x9116('0x12')](function(_0x9066ac){_0x410799=_0x9066ac;if(!_0x410799['adSsoEnabled']){logger[_0x9116('0xd')](_0x9116('0x13'),_0xa8880a);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x255407[_0x9116('0x10')]({'attributes':['id','name','password',_0x9116('0x14'),_0x9116('0x15'),_0x9116('0x16'),_0x9116('0x17'),_0x9116('0x18'),_0x9116('0x19')],'where':{'name':_0xa8880a,'role':{'$or':[_0x9116('0x1a'),_0x9116('0x1b'),_0x9116('0x1c')]},'adSsoEnabled':!![]}});})[_0x9116('0x12')](function(_0x4f49ef){if(!_0x4f49ef||_0x4f49ef&&_0x4f49ef['name']!==_0xa8880a){throw new Error(_0x9116('0xf'));}_0x3a623e=_0x4f49ef;var _0x511d9f=_0x3a623e['name']+'@'+config[_0x9116('0x8')][_0x9116('0xc')];return adAuthenticate(config['activedirectory'],_0x511d9f,_0x4fa7b0);})[_0x9116('0x12')](function(_0x3a472f){if(_0x3a623e[_0x9116('0x16')]){throw new Error(_0x9116('0xf'));}if(_0x410799['blockDuration']>0x0){if(_0x3a623e[_0x9116('0x17')]){if(moment(_0x3a623e[_0x9116('0x18')])[_0x9116('0x1d')](_0x410799[_0x9116('0x11')],_0x9116('0x1e'))>moment()){throw new Error(_0x9116('0xf'));}return utils[_0x9116('0x1f')](_0x3a623e,0x0,![],null)[_0x9116('0x12')](function(){return utils['getLicense'](_0x3a623e);})[_0x9116('0x12')](function(){return _0x5e5e49(null,_0x3a623e);});}else{return utils[_0x9116('0x20')](_0x3a623e)[_0x9116('0x12')](function(){return _0x5e5e49(null,_0x3a623e);});}}else{return utils['getLicense'](_0x3a623e)['then'](function(){return _0x5e5e49(null,_0x3a623e);});}})['catch'](function(_0x20299c){return _0x5e5e49(null,![],_0x20299c);});}function handleError(_0x257257,_0x51319f,_0x357b8f){return _0x257257['status'](_0x51319f||0x1f4)[_0x9116('0x21')]({'message':_0x357b8f?_0x357b8f['message']||_0x357b8f:''});}exports[_0x9116('0x22')]=function(_0x1036c1,_0xd94d2,_0xf3e514){passport[_0x9116('0x23')](_0x9116('0x24'),function(_0x4ee11a,_0x92c653,_0xd9abbe){var _0x40372a=_0x4ee11a||_0xd9abbe;if(_0x40372a){return handleError(_0xd94d2,0x191,_0x40372a);}if(!_0x92c653){return handleError(_0xd94d2,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x45e45f={'payload':{'id':_0x92c653['id'],'role':_0x92c653['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x45e45f)[_0x9116('0x12')](function(_0x55af54){_0xd94d2[_0x9116('0x25')]({'id':_0x92c653['id'],'token':_0x55af54,'statusCall':'','isAlreadyLogged':_0x92c653[_0x9116('0x19')]});});}})(_0x1036c1,_0xd94d2,_0xf3e514);};passport[_0x9116('0x26')](_0x9116('0x24'),new LocalStrategy({'usernameField':_0x9116('0x27'),'passwordField':_0x9116('0x28')},function(_0x498eb2,_0x141172,_0x1f6b03){return ActiveDirectoryAuthenticate(db[_0x9116('0x29')],_0x498eb2,_0x141172,_0x1f6b03);})); \ No newline at end of file +var _0xab49=['blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','disabled','blocked','blockedAt','admin','user','agent','name','minutes','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','User','passport','passport-local','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled'];(function(_0x5a01cc,_0x1d9844){var _0x4a33a8=function(_0x4e8986){while(--_0x4e8986){_0x5a01cc['push'](_0x5a01cc['shift']());}};_0x4a33a8(++_0x1d9844);}(_0xab49,0xdd));var _0x9ab4=function(_0x55d911,_0x2b768c){_0x55d911=_0x55d911-0x0;var _0x3104c2=_0xab49[_0x55d911];return _0x3104c2;};'use strict';var passport=require(_0x9ab4('0x0'));var LocalStrategy=require(_0x9ab4('0x1'))['Strategy'];var moment=require(_0x9ab4('0x2'));var ActiveDirectory=require(_0x9ab4('0x3'));var BPromise=require(_0x9ab4('0x4'));var util=require(_0x9ab4('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x9ab4('0x6'));var utils=require(_0x9ab4('0x7'));var config=require('../../config/environment');var logger=require(_0x9ab4('0x8'))(_0x9ab4('0x9'));function isActiveDirectoryConfigured(_0x18720){var _0x404a8e=![];if(typeof _0x18720[_0x9ab4('0xa')]!==_0x9ab4('0xb')){_0x404a8e=_0x18720[_0x9ab4('0xa')][_0x9ab4('0xc')]&&_0x18720[_0x9ab4('0xa')][_0x9ab4('0xd')]&&_0x18720[_0x9ab4('0xa')][_0x9ab4('0xe')];}return _0x404a8e;}function adAuthenticate(_0x4e3c92,_0x4f6ea5,_0x198d5d){return new BPromise(function(_0x1cc84d,_0x49966a){try{var _0x4aad68=new ActiveDirectory(_0x4e3c92);_0x4aad68[_0x9ab4('0xf')](_0x4f6ea5,_0x198d5d,function(_0x5e79d1,_0x9cba0f){if(_0x5e79d1){logger[_0x9ab4('0x10')](_0x9ab4('0x11'),_0x4f6ea5,util[_0x9ab4('0x12')](_0x5e79d1,{'showHidden':![],'depth':null}));_0x49966a(_0x9ab4('0x13'));}else if(!_0x9cba0f){logger['error'](_0x9ab4('0x14'),_0x4f6ea5);_0x49966a(_0x9ab4('0x13'));}else{_0x1cc84d(_0x9cba0f);}});}catch(_0x428eb5){_0x49966a(_0x428eb5);}});}function ActiveDirectoryAuthenticate(_0x35c043,_0x3eaf42,_0x1b4e81,_0x383a42){var _0x5f2ea9,_0x28fffa;if(!isActiveDirectoryConfigured(config)){logger[_0x9ab4('0x10')](_0x9ab4('0x15'),_0x3eaf42);return _0x383a42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x9ab4('0x16')]['findOne']({'where':{'id':0x1},'attributes':[_0x9ab4('0x17'),_0x9ab4('0x18')],'raw':!![]})[_0x9ab4('0x19')](function(_0xe513c9){_0x5f2ea9=_0xe513c9;if(!_0x5f2ea9[_0x9ab4('0x17')]){logger[_0x9ab4('0x10')](_0x9ab4('0x1a'),_0x3eaf42);throw new Error(_0x9ab4('0x13'));}return _0x35c043['findOne']({'attributes':['id','name',_0x9ab4('0x1b'),_0x9ab4('0x1c'),_0x9ab4('0x1d'),_0x9ab4('0x1e'),_0x9ab4('0x1f'),_0x9ab4('0x20'),'online'],'where':{'name':_0x3eaf42,'role':{'$or':[_0x9ab4('0x21'),_0x9ab4('0x22'),_0x9ab4('0x23')]},'adSsoEnabled':!![]}});})[_0x9ab4('0x19')](function(_0x8528b9){if(!_0x8528b9||_0x8528b9&&_0x8528b9[_0x9ab4('0x24')]!==_0x3eaf42){throw new Error(_0x9ab4('0x13'));}_0x28fffa=_0x8528b9;var _0x38e2e7=_0x28fffa[_0x9ab4('0x24')]+'@'+config[_0x9ab4('0xa')][_0x9ab4('0xe')];return adAuthenticate(config['activedirectory'],_0x38e2e7,_0x1b4e81);})[_0x9ab4('0x19')](function(_0x2f796a){if(_0x28fffa[_0x9ab4('0x1e')]){throw new Error(_0x9ab4('0x13'));}if(_0x5f2ea9[_0x9ab4('0x18')]>0x0){if(_0x28fffa[_0x9ab4('0x1f')]){if(moment(_0x28fffa[_0x9ab4('0x20')])['add'](_0x5f2ea9[_0x9ab4('0x18')],_0x9ab4('0x25'))>moment()){throw new Error(_0x9ab4('0x13'));}return utils['clearBlockUser'](_0x28fffa,0x0,![],null)['then'](function(){return utils[_0x9ab4('0x26')](_0x28fffa);})[_0x9ab4('0x19')](function(){return _0x383a42(null,_0x28fffa);});}else{return utils[_0x9ab4('0x26')](_0x28fffa)[_0x9ab4('0x19')](function(){return _0x383a42(null,_0x28fffa);});}}else{return utils[_0x9ab4('0x26')](_0x28fffa)[_0x9ab4('0x19')](function(){return _0x383a42(null,_0x28fffa);});}})[_0x9ab4('0x27')](function(_0x384516){return _0x383a42(null,![],_0x384516);});}function handleError(_0x2745de,_0x1f80eb,_0xef0801){return _0x2745de[_0x9ab4('0x28')](_0x1f80eb||0x1f4)[_0x9ab4('0x29')]({'message':_0xef0801?_0xef0801['message']||_0xef0801:''});}exports[_0x9ab4('0x2a')]=function(_0xf8a6ab,_0xabd5e7,_0x2ec18b){passport['authenticate'](_0x9ab4('0x2b'),function(_0x4afffa,_0x47d391,_0x1baff3){var _0x4af424=_0x4afffa||_0x1baff3;if(_0x4af424){return handleError(_0xabd5e7,0x191,_0x4af424);}if(!_0x47d391){return handleError(_0xabd5e7,0x194,{'message':_0x9ab4('0x2c')});}else{var _0x29918f={'payload':{'id':_0x47d391['id'],'role':_0x47d391[_0x9ab4('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x9ab4('0x2d')](_0x29918f)[_0x9ab4('0x19')](function(_0x3abd88){_0xabd5e7[_0x9ab4('0x2e')]({'id':_0x47d391['id'],'token':_0x3abd88,'statusCall':'','isAlreadyLogged':_0x47d391[_0x9ab4('0x2f')]});});}})(_0xf8a6ab,_0xabd5e7,_0x2ec18b);};passport['use'](_0x9ab4('0x2b'),new LocalStrategy({'usernameField':_0x9ab4('0x24'),'passwordField':_0x9ab4('0x1b')},function(_0x27ca54,_0x418f96,_0x23f0eb){return ActiveDirectoryAuthenticate(db[_0x9ab4('0x30')],_0x27ca54,_0x418f96,_0x23f0eb);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index e40adaf..4d39da8 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 _0x84b8=['Router','exports','express'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x84b8,0x1a3));var _0x884b=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x84b8[_0x494d1f];return _0x457b6e;};'use strict';var express=require(_0x884b('0x0'));var router=express[_0x884b('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller['login']);module[_0x884b('0x2')]=router; \ No newline at end of file +var _0x8104=['express','./authActiveDirectory.controller','login','exports'];(function(_0x2f80fa,_0xef0dcb){var _0xf3687e=function(_0x340cfd){while(--_0x340cfd){_0x2f80fa['push'](_0x2f80fa['shift']());}};_0xf3687e(++_0xef0dcb);}(_0x8104,0x188));var _0x4810=function(_0x28ae21,_0x5f04ab){_0x28ae21=_0x28ae21-0x0;var _0x405fd7=_0x8104[_0x28ae21];return _0x405fd7;};'use strict';var express=require(_0x4810('0x0'));var router=express['Router']();var controller=require(_0x4810('0x1'));router['post']('/',controller[_0x4810('0x2')]);module[_0x4810('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index abd842e..4883e2d 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x37c80b,_0x5b90a5){var _0x4ea485=function(_0x27520f){while(--_0x27520f){_0x37c80b['push'](_0x37c80b['shift']());}};_0x4ea485(++_0x5b90a5);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _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(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x7a54,0x106));var _0x47a5=function(_0x28fc08,_0x3cda5e){_0x28fc08=_0x28fc08-0x0;var _0x8e5a2=_0x7a54[_0x28fc08];return _0x8e5a2;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index e9aafb6..7fb1d88 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 _0x6ccb=['/callback','callback','isMiddleware','setTokenCookie','exports','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x6ccb,0x118));var _0xb6cc=function(_0x394694,_0x78036){_0x394694=_0x394694-0x0;var _0x3cd632=_0x6ccb[_0x394694];return _0x3cd632;};'use strict';var express=require('express');var passport=require(_0xb6cc('0x0'));var router=express['Router']();var controller=require(_0xb6cc('0x1'));var userController=require(_0xb6cc('0x2'));var authService=require(_0xb6cc('0x3'));router['get']('/',controller[_0xb6cc('0x4')]);router[_0xb6cc('0x5')](_0xb6cc('0x6'),controller[_0xb6cc('0x7')],authService[_0xb6cc('0x8')],userController[_0xb6cc('0x4')],authService[_0xb6cc('0x9')]);module[_0xb6cc('0xa')]=router; \ No newline at end of file +var _0x2fe9=['/callback','callback','isMiddleware','exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x2fe9,0x143));var _0x92fe=function(_0x3188ab,_0x4eeca7){_0x3188ab=_0x3188ab-0x0;var _0x239a99=_0x2fe9[_0x3188ab];return _0x239a99;};'use strict';var express=require(_0x92fe('0x0'));var passport=require(_0x92fe('0x1'));var router=express[_0x92fe('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x92fe('0x3'));var authService=require(_0x92fe('0x4'));router[_0x92fe('0x5')]('/',controller[_0x92fe('0x6')]);router[_0x92fe('0x5')](_0x92fe('0x7'),controller[_0x92fe('0x8')],authService[_0x92fe('0x9')],userController[_0x92fe('0x6')],authService['setTokenCookie']);module[_0x92fe('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 2749993..ad04265 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 _0xac01=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','User','params','token','securePassword','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','jayson/promise','lodash','randomstring','moment','../../components/auth/service','http','Setting','blockDuration','then','findOne','name','password','salt','disabled','blockedAt','loginAttempts','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','clearBlockUser','allowedLoginAttempts','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','generate','body','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add'];(function(_0xf5fbb7,_0xdb7f69){var _0x330d55=function(_0x45fd85){while(--_0x45fd85){_0xf5fbb7['push'](_0xf5fbb7['shift']());}};_0x330d55(++_0xdb7f69);}(_0xac01,0x67));var _0x1ac0=function(_0x2166d1,_0x5ec8a6){_0x2166d1=_0x2166d1-0x0;var _0x554486=_0xac01[_0x2166d1];return _0x554486;};'use strict';var util=require(_0x1ac0('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x1ac0('0x1'));var _=require(_0x1ac0('0x2'));var rs=require(_0x1ac0('0x3'));var moment=require(_0x1ac0('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x1ac0('0x5'));var utils=require('../../config/utils');var client=jayson['client'][_0x1ac0('0x6')]({'port':0x232b});function localAuthenticate(_0x40840e,_0x5e12e2,_0x2dd220,_0x5d7bc0){var _0x2fcca7,_0x699e53;return db[_0x1ac0('0x7')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x1ac0('0x8')],'raw':!![]})[_0x1ac0('0x9')](function(_0x18bb4c){_0x2fcca7=_0x18bb4c;return _0x40840e[_0x1ac0('0xa')]({'attributes':['id',_0x1ac0('0xb'),_0x1ac0('0xc'),_0x1ac0('0xd'),'role',_0x1ac0('0xe'),'blocked',_0x1ac0('0xf'),_0x1ac0('0x10')],'where':{'name':_0x5e12e2,'role':{'$or':['admin','user',_0x1ac0('0x11')]}}});})[_0x1ac0('0x9')](function(_0x1ba229){if(!_0x1ba229||_0x1ba229&&_0x1ba229['name']!==_0x5e12e2){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x699e53=_0x1ba229;return _0x699e53;}})[_0x1ac0('0x9')](function(){_0x699e53[_0x1ac0('0x12')](_0x2dd220,function(_0x5a8245,_0x4e1e68){var _0x2cf0af=_0x699e53[_0x1ac0('0x10')]+0x1;if(_0x5a8245){return _0x5d7bc0(_0x5a8245);}else if(!_0x4e1e68){if(_0x699e53[_0x1ac0('0xe')]){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}else if(_0x2fcca7['allowedLoginAttempts']>0x0){if(_0x699e53[_0x1ac0('0x14')]){if(_0x2fcca7['blockDuration']>0x0){if(moment(_0x699e53[_0x1ac0('0xf')])['add'](_0x2fcca7[_0x1ac0('0x8')],'minutes')>moment()){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}else{return utils['clearBlockUser'](_0x699e53,_0x2cf0af,![],null)[_0x1ac0('0x9')](function(){return _0x5d7bc0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5d7bc0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2cf0af>=_0x2fcca7['allowedLoginAttempts']){return utils[_0x1ac0('0x15')](_0x699e53,0x0,!![],moment())[_0x1ac0('0x9')](function(){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});});}else{return utils['clearBlockUser'](_0x699e53,_0x2cf0af,![],null)[_0x1ac0('0x9')](function(){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});});}}}else{return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}}else{if(_0x699e53[_0x1ac0('0xe')]){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}else if(_0x2fcca7[_0x1ac0('0x16')]>0x0){if(_0x699e53['blocked']){if(_0x2fcca7[_0x1ac0('0x8')]>0x0){if(moment(_0x699e53[_0x1ac0('0xf')])['add'](_0x2fcca7[_0x1ac0('0x8')],_0x1ac0('0x17'))>moment()){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}else{return utils['clearBlockUser'](_0x699e53,0x0,![],null)[_0x1ac0('0x9')](function(){return utils[_0x1ac0('0x18')](_0x699e53);})[_0x1ac0('0x9')](function(){return _0x5d7bc0(null,_0x699e53);});}}else{return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}}else{return utils[_0x1ac0('0x15')](_0x699e53,0x0,![],null)[_0x1ac0('0x9')](function(){return utils[_0x1ac0('0x18')](_0x699e53);})[_0x1ac0('0x9')](function(){return _0x5d7bc0(null,_0x699e53);})[_0x1ac0('0x19')](function(_0x3f7e15){return _0x5d7bc0(null,![],_0x3f7e15);});}}else{if(_0x699e53[_0x1ac0('0x14')]){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}else{return utils[_0x1ac0('0x18')](_0x699e53)['then'](function(){return _0x5d7bc0(null,_0x699e53);});}}}});})[_0x1ac0('0x19')](function(_0x2896d1){return _0x5d7bc0(null,![],_0x2896d1);});}function sendServiceMail(_0x1d3f4e){return db[_0x1ac0('0x1a')][_0x1ac0('0x1b')]({'where':{'service':!![]},'attributes':['id',_0x1ac0('0xb'),_0x1ac0('0x1c')],'include':[{'model':db[_0x1ac0('0x1d')],'as':_0x1ac0('0x1e'),'include':[{'model':db[_0x1ac0('0x1f')],'as':_0x1ac0('0x1f')}]}]})[_0x1ac0('0x9')](function(_0x2f2ea8){if(!_0x2f2ea8){throw new Error(_0x1ac0('0x20'));}var _0x3cf86d=_0x2f2ea8[_0x1ac0('0x21')]();var _0x292b8a={'account':_0x3cf86d,'message':_[_0x1ac0('0x22')]({'from':util[_0x1ac0('0x23')](_0x1ac0('0x24'),_0x2f2ea8[_0x1ac0('0xb')],_0x2f2ea8[_0x1ac0('0x1c')]||_0x2f2ea8[_0x1ac0('0x1e')]['user'])},_0x1d3f4e)};return client[_0x1ac0('0x25')](_0x1ac0('0x26'),_0x292b8a);})[_0x1ac0('0x9')](function(_0x550105){if(_0x550105[_0x1ac0('0x27')]){throw new Error(util[_0x1ac0('0x23')](_0x1ac0('0x28'),_0x550105['error'][_0x1ac0('0x29')]||JSON[_0x1ac0('0x2a')](_0x550105[_0x1ac0('0x27')])));}return!![];});}function handleError(_0x3c573b,_0x5bd90a,_0x21f085){return _0x3c573b[_0x1ac0('0x2b')](_0x5bd90a||0x1f4)[_0x1ac0('0x2c')]({'message':_0x21f085?_0x21f085[_0x1ac0('0x29')]||_0x21f085:''});}exports[_0x1ac0('0x2d')]=function(_0x53c883,_0x117bac,_0x4932a9){passport[_0x1ac0('0x12')](_0x1ac0('0x2e'),function(_0xbbf6bc,_0x31b361,_0x129114){var _0x16d3b6=_0xbbf6bc||_0x129114;if(_0x16d3b6){return handleError(_0x117bac,0x191,_0x16d3b6);}if(!_0x31b361){return handleError(_0x117bac,0x194,{'message':_0x1ac0('0x2f')});}else{var _0x4c38d0={'payload':{'id':_0x31b361['id'],'role':_0x31b361[_0x1ac0('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0x1ac0('0x31')](_0x4c38d0)['then'](function(_0x27b535){_0x117bac[_0x1ac0('0x32')]({'id':_0x31b361['id'],'token':_0x27b535,'statusCall':'','isAlreadyLogged':_0x31b361[_0x1ac0('0x33')]});});}})(_0x53c883,_0x117bac,_0x4932a9);};exports[_0x1ac0('0x34')]=function(_0x1448fd,_0x65ffd3){if(!_0x1448fd['body']['email']){return handleError(_0x65ffd3,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x2a26eb=rs[_0x1ac0('0x35')]();_0x1448fd[_0x1ac0('0x36')][_0x1ac0('0x1c')]=_0x1448fd[_0x1ac0('0x36')]['email'][_0x1ac0('0x37')]()[_0x1ac0('0x38')]();var _0x2811a7;return db[_0x1ac0('0x7')][_0x1ac0('0xa')]({'where':{'id':0x1},'attributes':[_0x1ac0('0x16'),'blockDuration'],'raw':!![]})[_0x1ac0('0x9')](function(_0x219d0f){_0x2811a7=_0x219d0f;return db['User']['find']({'where':{'email':_0x1448fd['body'][_0x1ac0('0x1c')]}});})[_0x1ac0('0x9')](function(_0x87b56c){if(!_0x87b56c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x87b56c['disabled']){throw new Error(_0x1ac0('0x39'));}if(_0x87b56c[_0x1ac0('0x14')]){if(moment(_0x87b56c['blockedAt'])[_0x1ac0('0x3a')](_0x2811a7[_0x1ac0('0x8')],'minutes')>moment()){throw new Error(_0x1ac0('0x3b'));}else{_0x87b56c[_0x1ac0('0x14')]=![];_0x87b56c[_0x1ac0('0xf')]=null;}}_0x87b56c[_0x1ac0('0x3c')]=_0x2a26eb;_0x87b56c[_0x1ac0('0x3d')]=Date[_0x1ac0('0x3e')]()+0x36ee80;return _0x87b56c[_0x1ac0('0x3f')]();})[_0x1ac0('0x9')](function(){return sendServiceMail({'to':_0x1448fd['body'][_0x1ac0('0x1c')],'subject':_0x1ac0('0x40'),'text':_0x1ac0('0x41')+_0x1ac0('0x42')+_0x1ac0('0x43')+_0x1448fd[_0x1ac0('0x44')][_0x1ac0('0x45')]+'/reset/'+_0x2a26eb+'\x0a\x0a'+_0x1ac0('0x46')});})[_0x1ac0('0x9')](function(){_0x65ffd3[_0x1ac0('0x2b')](0xc8)[_0x1ac0('0x2c')]({'message':'Reset\x20Email\x20sent!'});})[_0x1ac0('0x19')](function(_0x49d02f){return handleError(_0x65ffd3,0x1f4,_0x49d02f);});};exports['reset']=function(_0xd3e407,_0x2d04dd){return db[_0x1ac0('0x47')][_0x1ac0('0x1b')]({'where':{'resetPasswordToken':_0xd3e407[_0x1ac0('0x48')][_0x1ac0('0x49')],'resetPasswordExpires':{'$gt':Date[_0x1ac0('0x3e')]()}}})['then'](function(_0x53d077){if(!_0x53d077){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x1ac0('0x7')][_0x1ac0('0xa')]({'attributes':['id',_0x1ac0('0x4a'),'enforcePasswordHistory',_0x1ac0('0x4b')]})['then'](function(_0x5fb977){if(_0x5fb977[_0x1ac0('0x4a')])authService[_0x1ac0('0x4c')](_0xd3e407[_0x1ac0('0x36')][_0x1ac0('0xc')]);if(!_0x5fb977['enforcePasswordHistory']||!_0x53d077[_0x1ac0('0x4d')])return _0x53d077;authService[_0x1ac0('0x4e')](_0xd3e407[_0x1ac0('0x36')][_0x1ac0('0xc')],_0x53d077[_0x1ac0('0x4d')],_0x5fb977['passwordHistoryLimit']);return _0x53d077;})['then'](function(){_0x53d077['password']=_0xd3e407[_0x1ac0('0x36')][_0x1ac0('0xc')];_0x53d077[_0x1ac0('0x3c')]=null;_0x53d077[_0x1ac0('0x3d')]=null;return _0x53d077[_0x1ac0('0x3f')]();});})[_0x1ac0('0x9')](function(){_0x2d04dd[_0x1ac0('0x2b')](0xc8)[_0x1ac0('0x2c')]({'message':_0x1ac0('0x4f')});})[_0x1ac0('0x19')](function(_0xb38fa){return handleError(_0x2d04dd,0x1f4,_0xb38fa);});};passport[_0x1ac0('0x50')](_0x1ac0('0x2e'),new LocalStrategy({'usernameField':_0x1ac0('0xb'),'passwordField':_0x1ac0('0xc')},function(_0x409475,_0x65f92f,_0x444f4c){return localAuthenticate(db['User'],_0x409475,_0x65f92f,_0x444f4c);})); \ No newline at end of file +var _0x8c5f=['name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','SendMail','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','generate','trim','toLowerCase','findOne','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','User','util','passport','passport-local','Strategy','jayson/promise','randomstring','../../mysqldb','../../config/utils','client','http','Setting','then'];(function(_0x389698,_0x1486e4){var _0x2e5391=function(_0x224c56){while(--_0x224c56){_0x389698['push'](_0x389698['shift']());}};_0x2e5391(++_0x1486e4);}(_0x8c5f,0x98));var _0xf8c5=function(_0x2e0af0,_0xace130){_0x2e0af0=_0x2e0af0-0x0;var _0x3d8f9e=_0x8c5f[_0x2e0af0];return _0x3d8f9e;};'use strict';var util=require(_0xf8c5('0x0'));var passport=require(_0xf8c5('0x1'));var LocalStrategy=require(_0xf8c5('0x2'))[_0xf8c5('0x3')];var jayson=require(_0xf8c5('0x4'));var _=require('lodash');var rs=require(_0xf8c5('0x5'));var moment=require('moment');var db=require(_0xf8c5('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xf8c5('0x7'));var client=jayson[_0xf8c5('0x8')][_0xf8c5('0x9')]({'port':0x232b});function localAuthenticate(_0x34a3ec,_0x9ddd63,_0x204a89,_0x2c4673){var _0x11d94d,_0x1d8e71;return db[_0xf8c5('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xf8c5('0xb')](function(_0x4e1cb9){_0x11d94d=_0x4e1cb9;return _0x34a3ec['findOne']({'attributes':['id',_0xf8c5('0xc'),_0xf8c5('0xd'),_0xf8c5('0xe'),_0xf8c5('0xf'),_0xf8c5('0x10'),_0xf8c5('0x11'),_0xf8c5('0x12'),_0xf8c5('0x13')],'where':{'name':_0x9ddd63,'role':{'$or':['admin','user',_0xf8c5('0x14')]}}});})['then'](function(_0xbdb452){if(!_0xbdb452||_0xbdb452&&_0xbdb452[_0xf8c5('0xc')]!==_0x9ddd63){throw new Error(_0xf8c5('0x15'));}else{_0x1d8e71=_0xbdb452;return _0x1d8e71;}})[_0xf8c5('0xb')](function(){_0x1d8e71[_0xf8c5('0x16')](_0x204a89,function(_0xd63683,_0x4b9e10){var _0xb8d15e=_0x1d8e71[_0xf8c5('0x13')]+0x1;if(_0xd63683){return _0x2c4673(_0xd63683);}else if(!_0x4b9e10){if(_0x1d8e71[_0xf8c5('0x10')]){return _0x2c4673(null,![],{'message':_0xf8c5('0x15')});}else if(_0x11d94d[_0xf8c5('0x17')]>0x0){if(_0x1d8e71['blocked']){if(_0x11d94d[_0xf8c5('0x18')]>0x0){if(moment(_0x1d8e71['blockedAt'])[_0xf8c5('0x19')](_0x11d94d[_0xf8c5('0x18')],_0xf8c5('0x1a'))>moment()){return _0x2c4673(null,![],{'message':_0xf8c5('0x15')});}else{return utils['clearBlockUser'](_0x1d8e71,_0xb8d15e,![],null)[_0xf8c5('0xb')](function(){return _0x2c4673(null,![],{'message':_0xf8c5('0x15')});});}}else{return _0x2c4673(null,![],{'message':_0xf8c5('0x15')});}}else{if(_0xb8d15e>=_0x11d94d[_0xf8c5('0x17')]){return utils['clearBlockUser'](_0x1d8e71,0x0,!![],moment())[_0xf8c5('0xb')](function(){return _0x2c4673(null,![],{'message':_0xf8c5('0x15')});});}else{return utils[_0xf8c5('0x1b')](_0x1d8e71,_0xb8d15e,![],null)[_0xf8c5('0xb')](function(){return _0x2c4673(null,![],{'message':_0xf8c5('0x15')});});}}}else{return _0x2c4673(null,![],{'message':_0xf8c5('0x15')});}}else{if(_0x1d8e71[_0xf8c5('0x10')]){return _0x2c4673(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x11d94d[_0xf8c5('0x17')]>0x0){if(_0x1d8e71[_0xf8c5('0x11')]){if(_0x11d94d['blockDuration']>0x0){if(moment(_0x1d8e71[_0xf8c5('0x12')])[_0xf8c5('0x19')](_0x11d94d['blockDuration'],_0xf8c5('0x1a'))>moment()){return _0x2c4673(null,![],{'message':_0xf8c5('0x15')});}else{return utils[_0xf8c5('0x1b')](_0x1d8e71,0x0,![],null)[_0xf8c5('0xb')](function(){return utils['getLicense'](_0x1d8e71);})[_0xf8c5('0xb')](function(){return _0x2c4673(null,_0x1d8e71);});}}else{return _0x2c4673(null,![],{'message':_0xf8c5('0x15')});}}else{return utils[_0xf8c5('0x1b')](_0x1d8e71,0x0,![],null)[_0xf8c5('0xb')](function(){return utils[_0xf8c5('0x1c')](_0x1d8e71);})['then'](function(){return _0x2c4673(null,_0x1d8e71);})[_0xf8c5('0x1d')](function(_0x24f07a){return _0x2c4673(null,![],_0x24f07a);});}}else{if(_0x1d8e71[_0xf8c5('0x11')]){return _0x2c4673(null,![],{'message':_0xf8c5('0x15')});}else{return utils['getLicense'](_0x1d8e71)[_0xf8c5('0xb')](function(){return _0x2c4673(null,_0x1d8e71);});}}}});})[_0xf8c5('0x1d')](function(_0x135697){return _0x2c4673(null,![],_0x135697);});}function sendServiceMail(_0x4df27f){return db[_0xf8c5('0x1e')][_0xf8c5('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xf8c5('0xc'),_0xf8c5('0x20')],'include':[{'model':db[_0xf8c5('0x21')],'as':_0xf8c5('0x22'),'include':[{'model':db[_0xf8c5('0x23')],'as':_0xf8c5('0x23')}]}]})[_0xf8c5('0xb')](function(_0x282c31){if(!_0x282c31){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x2243cb=_0x282c31[_0xf8c5('0x24')]();var _0x14d6ca={'account':_0x2243cb,'message':_[_0xf8c5('0x25')]({'from':util[_0xf8c5('0x26')](_0xf8c5('0x27'),_0x282c31[_0xf8c5('0xc')],_0x282c31[_0xf8c5('0x20')]||_0x282c31[_0xf8c5('0x22')]['user'])},_0x4df27f)};return client['request'](_0xf8c5('0x28'),_0x14d6ca);})[_0xf8c5('0xb')](function(_0x3f4650){if(_0x3f4650['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3f4650[_0xf8c5('0x29')][_0xf8c5('0x2a')]||JSON[_0xf8c5('0x2b')](_0x3f4650[_0xf8c5('0x29')])));}return!![];});}function handleError(_0x412274,_0x2efa6e,_0x27d5ff){return _0x412274[_0xf8c5('0x2c')](_0x2efa6e||0x1f4)[_0xf8c5('0x2d')]({'message':_0x27d5ff?_0x27d5ff['message']||_0x27d5ff:''});}exports[_0xf8c5('0x2e')]=function(_0x33bbab,_0x1c499a,_0x3cadca){passport[_0xf8c5('0x16')](_0xf8c5('0x2f'),function(_0x175e23,_0x6337cc,_0x50c739){var _0x360495=_0x175e23||_0x50c739;if(_0x360495){return handleError(_0x1c499a,0x191,_0x360495);}if(!_0x6337cc){return handleError(_0x1c499a,0x194,{'message':_0xf8c5('0x30')});}else{var _0x2bf96b={'payload':{'id':_0x6337cc['id'],'role':_0x6337cc['role']},'options':{'expiresIn':0x15180}};return authService[_0xf8c5('0x31')](_0x2bf96b)[_0xf8c5('0xb')](function(_0x27be54){_0x1c499a[_0xf8c5('0x32')]({'id':_0x6337cc['id'],'token':_0x27be54,'statusCall':'','isAlreadyLogged':_0x6337cc[_0xf8c5('0x33')]});});}})(_0x33bbab,_0x1c499a,_0x3cadca);};exports['forgot']=function(_0xcae1ec,_0x2a4a74){if(!_0xcae1ec[_0xf8c5('0x34')][_0xf8c5('0x20')]){return handleError(_0x2a4a74,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x2ec69c=rs[_0xf8c5('0x35')]();_0xcae1ec[_0xf8c5('0x34')][_0xf8c5('0x20')]=_0xcae1ec[_0xf8c5('0x34')][_0xf8c5('0x20')][_0xf8c5('0x36')]()[_0xf8c5('0x37')]();var _0x4b765b;return db['Setting'][_0xf8c5('0x38')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xf8c5('0xb')](function(_0x1c6ed4){_0x4b765b=_0x1c6ed4;return db['User'][_0xf8c5('0x1f')]({'where':{'email':_0xcae1ec[_0xf8c5('0x34')][_0xf8c5('0x20')]}});})[_0xf8c5('0xb')](function(_0x508096){if(!_0x508096){throw new Error(_0xf8c5('0x39'));}if(_0x508096[_0xf8c5('0x10')]){throw new Error(_0xf8c5('0x3a'));}if(_0x508096[_0xf8c5('0x11')]){if(moment(_0x508096['blockedAt'])[_0xf8c5('0x19')](_0x4b765b['blockDuration'],'minutes')>moment()){throw new Error(_0xf8c5('0x3b'));}else{_0x508096[_0xf8c5('0x11')]=![];_0x508096[_0xf8c5('0x12')]=null;}}_0x508096[_0xf8c5('0x3c')]=_0x2ec69c;_0x508096[_0xf8c5('0x3d')]=Date[_0xf8c5('0x3e')]()+0x36ee80;return _0x508096['save']();})[_0xf8c5('0xb')](function(){return sendServiceMail({'to':_0xcae1ec['body']['email'],'subject':_0xf8c5('0x3f'),'text':_0xf8c5('0x40')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0xcae1ec[_0xf8c5('0x41')][_0xf8c5('0x42')]+_0xf8c5('0x43')+_0x2ec69c+'\x0a\x0a'+_0xf8c5('0x44')});})[_0xf8c5('0xb')](function(){_0x2a4a74[_0xf8c5('0x2c')](0xc8)[_0xf8c5('0x2d')]({'message':_0xf8c5('0x45')});})['catch'](function(_0x100c84){return handleError(_0x2a4a74,0x1f4,_0x100c84);});};exports[_0xf8c5('0x46')]=function(_0x2d539b,_0x3d226f){return db['User'][_0xf8c5('0x1f')]({'where':{'resetPasswordToken':_0x2d539b['params'][_0xf8c5('0x47')],'resetPasswordExpires':{'$gt':Date[_0xf8c5('0x3e')]()}}})['then'](function(_0x2b375d){if(!_0x2b375d){throw new Error(_0xf8c5('0x48'));}return db[_0xf8c5('0xa')][_0xf8c5('0x38')]({'attributes':['id','securePassword',_0xf8c5('0x49'),_0xf8c5('0x4a')]})[_0xf8c5('0xb')](function(_0x793e3b){if(_0x793e3b[_0xf8c5('0x4b')])authService['validatePasswordPattern'](_0x2d539b[_0xf8c5('0x34')][_0xf8c5('0xd')]);if(!_0x793e3b[_0xf8c5('0x49')]||!_0x2b375d[_0xf8c5('0x4c')])return _0x2b375d;authService[_0xf8c5('0x4d')](_0x2d539b[_0xf8c5('0x34')]['password'],_0x2b375d[_0xf8c5('0x4c')],_0x793e3b[_0xf8c5('0x4a')]);return _0x2b375d;})[_0xf8c5('0xb')](function(){_0x2b375d[_0xf8c5('0xd')]=_0x2d539b[_0xf8c5('0x34')][_0xf8c5('0xd')];_0x2b375d[_0xf8c5('0x3c')]=null;_0x2b375d['resetPasswordExpires']=null;return _0x2b375d[_0xf8c5('0x4e')]();});})[_0xf8c5('0xb')](function(){_0x3d226f[_0xf8c5('0x2c')](0xc8)[_0xf8c5('0x2d')]({'message':_0xf8c5('0x4f')});})[_0xf8c5('0x1d')](function(_0x42e548){return handleError(_0x3d226f,0x1f4,_0x42e548);});};passport[_0xf8c5('0x50')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0xf8c5('0xd')},function(_0x1c6666,_0x595177,_0x3da426){return localAuthenticate(db[_0xf8c5('0x51')],_0x1c6666,_0x595177,_0x3da426);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 4a6b7c9..c3cfca6 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 _0xb58f=['./authLocal.controller','login','post','reset','exports','Router'];(function(_0x48381d,_0x4ee067){var _0x1431d3=function(_0x492d96){while(--_0x492d96){_0x48381d['push'](_0x48381d['shift']());}};_0x1431d3(++_0x4ee067);}(_0xb58f,0xd1));var _0xfb58=function(_0x55fbb4,_0x2f5794){_0x55fbb4=_0x55fbb4-0x0;var _0x33042d=_0xb58f[_0x55fbb4];return _0x33042d;};'use strict';var express=require('express');var router=express[_0xfb58('0x0')]();var controller=require(_0xfb58('0x1'));router['post']('/',controller[_0xfb58('0x2')]);router[_0xfb58('0x3')]('/forgot',controller['forgot']);router[_0xfb58('0x3')]('/reset/:token',controller[_0xfb58('0x4')]);module[_0xfb58('0x5')]=router; \ No newline at end of file +var _0xbdbc=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post','login','/forgot'];(function(_0x15b0b2,_0x2eda12){var _0x29869c=function(_0x37ee61){while(--_0x37ee61){_0x15b0b2['push'](_0x15b0b2['shift']());}};_0x29869c(++_0x2eda12);}(_0xbdbc,0xa5));var _0xcbdb=function(_0x9ae99e,_0x2ac9e7){_0x9ae99e=_0x9ae99e-0x0;var _0x281db5=_0xbdbc[_0x9ae99e];return _0x281db5;};'use strict';var express=require(_0xcbdb('0x0'));var router=express[_0xcbdb('0x1')]();var controller=require(_0xcbdb('0x2'));router[_0xcbdb('0x3')]('/',controller[_0xcbdb('0x4')]);router[_0xcbdb('0x3')](_0xcbdb('0x5'),controller['forgot']);router[_0xcbdb('0x3')](_0xcbdb('0x6'),controller[_0xcbdb('0x7')]);module[_0xcbdb('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 7c4701e..2128d53 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 _0x0fec=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x115453,_0x5458f0){var _0x5a591a=function(_0x4fc58c){while(--_0x4fc58c){_0x115453['push'](_0x115453['shift']());}};_0x5a591a(++_0x5458f0);}(_0x0fec,0x142));var _0xc0fe=function(_0x16124d,_0x4afafa){_0x16124d=_0x16124d-0x0;var _0x56d3be=_0x0fec[_0x16124d];return _0x56d3be;};'use strict';var Sequelize=require(_0xc0fe('0x0'));module['exports']={'name':{'type':Sequelize[_0xc0fe('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xc0fe('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xc0fe('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc0fe('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xb706=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x29bc22,_0x2286ed){var _0x1b0d56=function(_0x2920ca){while(--_0x2920ca){_0x29bc22['push'](_0x29bc22['shift']());}};_0x1b0d56(++_0x2286ed);}(_0xb706,0x1e4));var _0x6b70=function(_0x5c8f99,_0x323736){_0x5c8f99=_0x5c8f99-0x0;var _0x5ac9eb=_0xb706[_0x5c8f99];return _0x5ac9eb;};'use strict';var Sequelize=require(_0x6b70('0x0'));module['exports']={'name':{'type':Sequelize[_0x6b70('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x6b70('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x6b70('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6b70('0x3')],'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 d992e9c..e605cb6 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 _0x856d=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Automation','findAll','rows','catch','show','params','filters','find','create','body','addConditions','Condition','ids','omit','findOne','getConditions','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2b8121,_0x128869){var _0xec2947=function(_0x424997){while(--_0x424997){_0x2b8121['push'](_0x2b8121['shift']());}};_0xec2947(++_0x128869);}(_0x856d,0x93));var _0xd856=function(_0x19f838,_0x5c3217){_0x19f838=_0x19f838-0x0;var _0x139ecc=_0x856d[_0x19f838];return _0x139ecc;};'use strict';var emlformat=require(_0xd856('0x0'));var rimraf=require(_0xd856('0x1'));var zipdir=require(_0xd856('0x2'));var jsonpatch=require(_0xd856('0x3'));var rp=require(_0xd856('0x4'));var moment=require(_0xd856('0x5'));var BPromise=require(_0xd856('0x6'));var Mustache=require(_0xd856('0x7'));var util=require(_0xd856('0x8'));var path=require(_0xd856('0x9'));var sox=require(_0xd856('0xa'));var csv=require(_0xd856('0xb'));var ejs=require(_0xd856('0xc'));var fs=require('fs');var fs_extra=require(_0xd856('0xd'));var _=require('lodash');var squel=require(_0xd856('0xe'));var crypto=require('crypto');var jsforce=require(_0xd856('0xf'));var deskjs=require(_0xd856('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd856('0x11'));var Redis=require(_0xd856('0x12'));var authService=require(_0xd856('0x13'));var qs=require(_0xd856('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd856('0x15'));var utils=require(_0xd856('0x16'));var config=require(_0xd856('0x17'));var licenseUtil=require(_0xd856('0x18'));var db=require(_0xd856('0x19'))['db'];function respondWithStatusCode(_0x326243,_0x23c161){_0x23c161=_0x23c161||0xcc;return function(_0x429628){if(_0x429628){return _0x326243[_0xd856('0x1a')](_0x23c161);}return _0x326243[_0xd856('0x1b')](_0x23c161)[_0xd856('0x1c')]();};}function respondWithResult(_0x4958a2,_0x1cad81){_0x1cad81=_0x1cad81||0xc8;return function(_0x4e6cf2){if(_0x4e6cf2){return _0x4958a2[_0xd856('0x1b')](_0x1cad81)[_0xd856('0x1d')](_0x4e6cf2);}};}function respondWithFilteredResult(_0xd0cf89,_0x2af87c){return function(_0x22d229){if(_0x22d229){var _0x383101=typeof _0x2af87c[_0xd856('0x1e')]===_0xd856('0x1f')&&typeof _0x2af87c[_0xd856('0x20')]===_0xd856('0x1f');var _0x2a2602=_0x22d229[_0xd856('0x21')];var _0x1d1201=_0x383101?0x0:_0x2af87c[_0xd856('0x1e')];var _0x33478b=_0x383101?_0x22d229['count']:_0x2af87c[_0xd856('0x1e')]+_0x2af87c[_0xd856('0x20')];var _0x1b7471;if(_0x33478b>=_0x2a2602){_0x33478b=_0x2a2602;_0x1b7471=0xc8;}else{_0x1b7471=0xce;}_0xd0cf89[_0xd856('0x1b')](_0x1b7471);return _0xd0cf89[_0xd856('0x22')](_0xd856('0x23'),_0x1d1201+'-'+_0x33478b+'/'+_0x2a2602)[_0xd856('0x1d')](_0x22d229);}return null;};}function patchUpdates(_0x5b8040){return function(_0x2f16c3){try{jsonpatch[_0xd856('0x24')](_0x2f16c3,_0x5b8040,!![]);}catch(_0x38c6a9){return BPromise[_0xd856('0x25')](_0x38c6a9);}return _0x2f16c3[_0xd856('0x26')]();};}function saveUpdates(_0x15bb9b,_0x5a2577){return function(_0x2d969e){if(_0x2d969e){return _0x2d969e[_0xd856('0x27')](_0x15bb9b)[_0xd856('0x28')](function(_0x26f230){return _0x26f230;});}return null;};}function removeEntity(_0x46f56c,_0xc57a70){return function(_0x81f125){if(_0x81f125){return _0x81f125[_0xd856('0x29')]()['then'](function(){_0x46f56c[_0xd856('0x1b')](0xcc)[_0xd856('0x1c')]();});}};}function handleEntityNotFound(_0x4198e4,_0xbbe50d){return function(_0x391619){if(!_0x391619){_0x4198e4['sendStatus'](0x194);}return _0x391619;};}function handleError(_0x1d0e2e,_0x46f5b5){_0x46f5b5=_0x46f5b5||0x1f4;return function(_0x1149d3){logger[_0xd856('0x2a')](_0x1149d3[_0xd856('0x2b')]);if(_0x1149d3[_0xd856('0x2c')]){delete _0x1149d3['name'];}_0x1d0e2e[_0xd856('0x1b')](_0x46f5b5)[_0xd856('0x2d')](_0x1149d3);};}exports[_0xd856('0x2e')]=function(_0x360c82,_0x55c19b){var _0x20bd65={},_0xabbe84={},_0x539474={'count':0x0,'rows':[]};var _0x4394d4=_[_0xd856('0x2f')](db['Automation'][_0xd856('0x30')],function(_0x8a01a7){return{'name':_0x8a01a7['fieldName'],'type':_0x8a01a7[_0xd856('0x31')][_0xd856('0x32')]};});_0xabbe84[_0xd856('0x33')]=_[_0xd856('0x2f')](_0x4394d4,_0xd856('0x2c'));_0xabbe84[_0xd856('0x34')]=_[_0xd856('0x35')](_0x360c82['query']);_0xabbe84['filters']=_[_0xd856('0x36')](_0xabbe84[_0xd856('0x33')],_0xabbe84[_0xd856('0x34')]);_0x20bd65[_0xd856('0x37')]=_[_0xd856('0x36')](_0xabbe84[_0xd856('0x33')],qs['fields'](_0x360c82['query'][_0xd856('0x38')]));_0x20bd65[_0xd856('0x37')]=_0x20bd65[_0xd856('0x37')][_0xd856('0x39')]?_0x20bd65[_0xd856('0x37')]:_0xabbe84['model'];if(!_0x360c82[_0xd856('0x34')]['hasOwnProperty'](_0xd856('0x3a'))){_0x20bd65[_0xd856('0x20')]=qs['limit'](_0x360c82[_0xd856('0x34')][_0xd856('0x20')]);_0x20bd65[_0xd856('0x1e')]=qs[_0xd856('0x1e')](_0x360c82[_0xd856('0x34')][_0xd856('0x1e')]);}_0x20bd65[_0xd856('0x3b')]=qs['sort'](_0x360c82[_0xd856('0x34')][_0xd856('0x3c')]);_0x20bd65[_0xd856('0x3d')]=qs['filters'](_[_0xd856('0x3e')](_0x360c82['query'],_0xabbe84['filters']),_0x4394d4);if(_0x360c82['query'][_0xd856('0x3f')]){_0x20bd65[_0xd856('0x3d')]=_[_0xd856('0x40')](_0x20bd65[_0xd856('0x3d')],{'$or':_[_0xd856('0x2f')](_0x4394d4,function(_0x560c7e){if(_0x560c7e['type']!==_0xd856('0x41')){var _0x4a6a56={};_0x4a6a56[_0x560c7e['name']]={'$like':'%'+_0x360c82[_0xd856('0x34')][_0xd856('0x3f')]+'%'};return _0x4a6a56;}})});}_0x20bd65=_[_0xd856('0x40')]({},_0x20bd65,_0x360c82[_0xd856('0x42')]);var _0x9df496={'where':_0x20bd65[_0xd856('0x3d')]};return db['Automation'][_0xd856('0x21')](_0x9df496)[_0xd856('0x28')](function(_0x22257b){_0x539474['count']=_0x22257b;if(_0x360c82[_0xd856('0x34')][_0xd856('0x43')]){_0x20bd65[_0xd856('0x44')]=[{'all':!![]}];}return db[_0xd856('0x45')][_0xd856('0x46')](_0x20bd65);})[_0xd856('0x28')](function(_0x2ff90c){_0x539474[_0xd856('0x47')]=_0x2ff90c;return _0x539474;})[_0xd856('0x28')](respondWithFilteredResult(_0x55c19b,_0x20bd65))[_0xd856('0x48')](handleError(_0x55c19b,null));};exports[_0xd856('0x49')]=function(_0x576032,_0x3faf16){var _0x28f39d={'raw':![],'where':{'id':_0x576032[_0xd856('0x4a')]['id']}},_0x5c875a={};_0x5c875a[_0xd856('0x33')]=_[_0xd856('0x35')](db[_0xd856('0x45')][_0xd856('0x30')]);_0x5c875a[_0xd856('0x34')]=_[_0xd856('0x35')](_0x576032[_0xd856('0x34')]);_0x5c875a[_0xd856('0x4b')]=_[_0xd856('0x36')](_0x5c875a['model'],_0x5c875a['query']);_0x28f39d['attributes']=_[_0xd856('0x36')](_0x5c875a[_0xd856('0x33')],qs['fields'](_0x576032[_0xd856('0x34')]['fields']));_0x28f39d[_0xd856('0x37')]=_0x28f39d[_0xd856('0x37')][_0xd856('0x39')]?_0x28f39d['attributes']:_0x5c875a[_0xd856('0x33')];if(_0x576032[_0xd856('0x34')][_0xd856('0x43')]){_0x28f39d[_0xd856('0x44')]=[{'all':!![]}];}_0x28f39d=_[_0xd856('0x40')]({},_0x28f39d,_0x576032[_0xd856('0x42')]);return db[_0xd856('0x45')][_0xd856('0x4c')](_0x28f39d)[_0xd856('0x28')](handleEntityNotFound(_0x3faf16,null))['then'](respondWithResult(_0x3faf16,null))[_0xd856('0x48')](handleError(_0x3faf16,null));};exports[_0xd856('0x4d')]=function(_0x3767b6,_0x8a7ad7){return db[_0xd856('0x45')][_0xd856('0x4d')](_0x3767b6[_0xd856('0x4e')],{})[_0xd856('0x28')](respondWithResult(_0x8a7ad7,0xc9))[_0xd856('0x48')](handleError(_0x8a7ad7,null));};exports[_0xd856('0x27')]=function(_0x24abe7,_0x592363){if(_0x24abe7[_0xd856('0x4e')]['id']){delete _0x24abe7[_0xd856('0x4e')]['id'];}return db[_0xd856('0x45')][_0xd856('0x4c')]({'where':{'id':_0x24abe7[_0xd856('0x4a')]['id']}})[_0xd856('0x28')](handleEntityNotFound(_0x592363,null))[_0xd856('0x28')](saveUpdates(_0x24abe7[_0xd856('0x4e')],null))['then'](respondWithResult(_0x592363,null))[_0xd856('0x48')](handleError(_0x592363,null));};exports[_0xd856('0x29')]=function(_0x227731,_0x5aaa64){return db[_0xd856('0x45')][_0xd856('0x4c')]({'where':{'id':_0x227731[_0xd856('0x4a')]['id']}})[_0xd856('0x28')](handleEntityNotFound(_0x5aaa64,null))[_0xd856('0x28')](removeEntity(_0x5aaa64,null))[_0xd856('0x48')](handleError(_0x5aaa64,null));};exports[_0xd856('0x4f')]=function(_0x9ef291,_0x37944e,_0x447544){return db[_0xd856('0x50')][_0xd856('0x4c')]({'where':{'id':_0x9ef291[_0xd856('0x4a')]['id']}})[_0xd856('0x28')](handleEntityNotFound(_0x37944e,null))[_0xd856('0x28')](function(_0x3ab4b6){if(_0x3ab4b6){return _0x3ab4b6[_0xd856('0x4f')](_0x9ef291['body'][_0xd856('0x51')],_[_0xd856('0x52')](_0x9ef291[_0xd856('0x4e')],[_0xd856('0x51'),'id'])||{});}})['then'](respondWithResult(_0x37944e,null))[_0xd856('0x48')](handleError(_0x37944e,null));};exports['getConditions']=function(_0x540124,_0x10905f,_0x592caf){var _0x45edb5={};var _0x1d146f={};var _0x79deab;var _0x43dd46;return db[_0xd856('0x45')][_0xd856('0x53')]({'where':{'id':_0x540124[_0xd856('0x4a')]['id']}})[_0xd856('0x28')](handleEntityNotFound(_0x10905f,null))[_0xd856('0x28')](function(_0x53b189){if(_0x53b189){_0x79deab=_0x53b189;_0x1d146f[_0xd856('0x33')]=_[_0xd856('0x35')](db[_0xd856('0x50')][_0xd856('0x30')]);_0x1d146f[_0xd856('0x34')]=_[_0xd856('0x35')](_0x540124[_0xd856('0x34')]);_0x1d146f[_0xd856('0x4b')]=_[_0xd856('0x36')](_0x1d146f['model'],_0x1d146f[_0xd856('0x34')]);_0x45edb5[_0xd856('0x37')]=_['intersection'](_0x1d146f[_0xd856('0x33')],qs[_0xd856('0x38')](_0x540124[_0xd856('0x34')]['fields']));_0x45edb5['attributes']=_0x45edb5[_0xd856('0x37')][_0xd856('0x39')]?_0x45edb5[_0xd856('0x37')]:_0x1d146f[_0xd856('0x33')];_0x45edb5['order']=qs['sort'](_0x540124[_0xd856('0x34')][_0xd856('0x3c')]);_0x45edb5[_0xd856('0x3d')]=qs[_0xd856('0x4b')](_['pick'](_0x540124[_0xd856('0x34')],_0x1d146f[_0xd856('0x4b')]));if(_0x540124[_0xd856('0x34')][_0xd856('0x3f')]){_0x45edb5[_0xd856('0x3d')]=_['merge'](_0x45edb5['where'],{'$or':_[_0xd856('0x2f')](_0x45edb5[_0xd856('0x37')],function(_0x1dd32e){var _0x5812d6={};_0x5812d6[_0x1dd32e]={'$like':'%'+_0x540124[_0xd856('0x34')][_0xd856('0x3f')]+'%'};return _0x5812d6;})});}_0x45edb5=_[_0xd856('0x40')]({},_0x45edb5,_0x540124[_0xd856('0x42')]);return _0x79deab[_0xd856('0x54')](_0x45edb5);}})[_0xd856('0x28')](function(_0x5b66c7){if(_0x5b66c7){_0x43dd46=_0x5b66c7[_0xd856('0x39')];if(!_0x540124[_0xd856('0x34')][_0xd856('0x55')](_0xd856('0x3a'))){_0x45edb5[_0xd856('0x20')]=qs[_0xd856('0x20')](_0x540124[_0xd856('0x34')][_0xd856('0x20')]);_0x45edb5[_0xd856('0x1e')]=qs['offset'](_0x540124['query'][_0xd856('0x1e')]);}return _0x79deab[_0xd856('0x54')](_0x45edb5);}})[_0xd856('0x28')](function(_0x402566){if(_0x402566){return _0x402566?{'count':_0x43dd46,'rows':_0x402566}:null;}})[_0xd856('0x28')](respondWithResult(_0x10905f,null))[_0xd856('0x48')](handleError(_0x10905f,null));};exports[_0xd856('0x56')]=function(_0x4a26d2,_0x36e1e4,_0xc9195){return db[_0xd856('0x57')][_0xd856('0x4c')]({'where':{'id':_0x4a26d2[_0xd856('0x4a')]['id']}})['then'](handleEntityNotFound(_0x36e1e4,null))[_0xd856('0x28')](function(_0x320c3c){if(_0x320c3c){return _0x320c3c[_0xd856('0x56')](_0x4a26d2['body'][_0xd856('0x51')],_['omit'](_0x4a26d2[_0xd856('0x4e')],[_0xd856('0x51'),'id'])||{});}})['then'](respondWithResult(_0x36e1e4,null))[_0xd856('0x48')](handleError(_0x36e1e4,null));};exports[_0xd856('0x58')]=function(_0x5009af,_0xb94712,_0x26f185){var _0x579937={};var _0x4713d5={};var _0x1ecd88;var _0x44d8f6;return db[_0xd856('0x45')][_0xd856('0x53')]({'where':{'id':_0x5009af[_0xd856('0x4a')]['id']}})[_0xd856('0x28')](handleEntityNotFound(_0xb94712,null))[_0xd856('0x28')](function(_0x28a4fc){if(_0x28a4fc){_0x1ecd88=_0x28a4fc;_0x4713d5['model']=_[_0xd856('0x35')](db[_0xd856('0x57')]['rawAttributes']);_0x4713d5['query']=_[_0xd856('0x35')](_0x5009af[_0xd856('0x34')]);_0x4713d5[_0xd856('0x4b')]=_[_0xd856('0x36')](_0x4713d5[_0xd856('0x33')],_0x4713d5[_0xd856('0x34')]);_0x579937[_0xd856('0x37')]=_['intersection'](_0x4713d5[_0xd856('0x33')],qs[_0xd856('0x38')](_0x5009af[_0xd856('0x34')]['fields']));_0x579937[_0xd856('0x37')]=_0x579937['attributes']['length']?_0x579937[_0xd856('0x37')]:_0x4713d5['model'];_0x579937[_0xd856('0x3b')]=qs[_0xd856('0x3c')](_0x5009af[_0xd856('0x34')][_0xd856('0x3c')]);_0x579937['where']=qs['filters'](_[_0xd856('0x3e')](_0x5009af[_0xd856('0x34')],_0x4713d5[_0xd856('0x4b')]));if(_0x5009af[_0xd856('0x34')]['filter']){_0x579937[_0xd856('0x3d')]=_[_0xd856('0x40')](_0x579937[_0xd856('0x3d')],{'$or':_[_0xd856('0x2f')](_0x579937['attributes'],function(_0x344d0d){var _0x40a1e2={};_0x40a1e2[_0x344d0d]={'$like':'%'+_0x5009af[_0xd856('0x34')][_0xd856('0x3f')]+'%'};return _0x40a1e2;})});}_0x579937=_[_0xd856('0x40')]({},_0x579937,_0x5009af[_0xd856('0x42')]);return _0x1ecd88[_0xd856('0x58')](_0x579937);}})[_0xd856('0x28')](function(_0x926df3){if(_0x926df3){_0x44d8f6=_0x926df3[_0xd856('0x39')];if(!_0x5009af[_0xd856('0x34')][_0xd856('0x55')](_0xd856('0x3a'))){_0x579937[_0xd856('0x20')]=qs[_0xd856('0x20')](_0x5009af[_0xd856('0x34')]['limit']);_0x579937[_0xd856('0x1e')]=qs[_0xd856('0x1e')](_0x5009af['query'][_0xd856('0x1e')]);}return _0x1ecd88[_0xd856('0x58')](_0x579937);}})[_0xd856('0x28')](function(_0x5b7bb0){if(_0x5b7bb0){return _0x5b7bb0?{'count':_0x44d8f6,'rows':_0x5b7bb0}:null;}})[_0xd856('0x28')](respondWithResult(_0xb94712,null))['catch'](handleError(_0xb94712,null));}; \ No newline at end of file +var _0xb557=['fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','order','addActions','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','reject','update','then','destroy','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','query','keys','intersection','model'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0xb557,0x1cf));var _0x7b55=function(_0x492172,_0x374d76){_0x492172=_0x492172-0x0;var _0x42d5aa=_0xb557[_0x492172];return _0x42d5aa;};'use strict';var emlformat=require(_0x7b55('0x0'));var rimraf=require(_0x7b55('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b55('0x2'));var rp=require(_0x7b55('0x3'));var moment=require(_0x7b55('0x4'));var BPromise=require(_0x7b55('0x5'));var Mustache=require(_0x7b55('0x6'));var util=require(_0x7b55('0x7'));var path=require(_0x7b55('0x8'));var sox=require(_0x7b55('0x9'));var csv=require(_0x7b55('0xa'));var ejs=require(_0x7b55('0xb'));var fs=require('fs');var fs_extra=require(_0x7b55('0xc'));var _=require(_0x7b55('0xd'));var squel=require(_0x7b55('0xe'));var crypto=require(_0x7b55('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7b55('0xa'));var querystring=require(_0x7b55('0x10'));var Papa=require(_0x7b55('0x11'));var Redis=require(_0x7b55('0x12'));var authService=require(_0x7b55('0x13'));var qs=require(_0x7b55('0x14'));var as=require(_0x7b55('0x15'));var hardwareService=require(_0x7b55('0x16'));var logger=require(_0x7b55('0x17'))('api');var utils=require(_0x7b55('0x18'));var config=require(_0x7b55('0x19'));var licenseUtil=require(_0x7b55('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54b6d9,_0x15f15e){_0x15f15e=_0x15f15e||0xcc;return function(_0x4dbe04){if(_0x4dbe04){return _0x54b6d9[_0x7b55('0x1b')](_0x15f15e);}return _0x54b6d9['status'](_0x15f15e)['end']();};}function respondWithResult(_0x47f228,_0x27c65b){_0x27c65b=_0x27c65b||0xc8;return function(_0x493160){if(_0x493160){return _0x47f228['status'](_0x27c65b)[_0x7b55('0x1c')](_0x493160);}};}function respondWithFilteredResult(_0x47bd24,_0x34e163){return function(_0x1d3ab2){if(_0x1d3ab2){var _0x2d3a0d=typeof _0x34e163[_0x7b55('0x1d')]===_0x7b55('0x1e')&&typeof _0x34e163[_0x7b55('0x1f')]===_0x7b55('0x1e');var _0x57b4df=_0x1d3ab2[_0x7b55('0x20')];var _0x478c4c=_0x2d3a0d?0x0:_0x34e163[_0x7b55('0x1d')];var _0x25e576=_0x2d3a0d?_0x1d3ab2['count']:_0x34e163[_0x7b55('0x1d')]+_0x34e163[_0x7b55('0x1f')];var _0x4a7d93;if(_0x25e576>=_0x57b4df){_0x25e576=_0x57b4df;_0x4a7d93=0xc8;}else{_0x4a7d93=0xce;}_0x47bd24[_0x7b55('0x21')](_0x4a7d93);return _0x47bd24[_0x7b55('0x22')](_0x7b55('0x23'),_0x478c4c+'-'+_0x25e576+'/'+_0x57b4df)[_0x7b55('0x1c')](_0x1d3ab2);}return null;};}function patchUpdates(_0x500d8e){return function(_0x322659){try{jsonpatch['apply'](_0x322659,_0x500d8e,!![]);}catch(_0x2075b3){return BPromise[_0x7b55('0x24')](_0x2075b3);}return _0x322659['save']();};}function saveUpdates(_0x5252c0,_0x22682b){return function(_0x4af9fe){if(_0x4af9fe){return _0x4af9fe[_0x7b55('0x25')](_0x5252c0)[_0x7b55('0x26')](function(_0x446438){return _0x446438;});}return null;};}function removeEntity(_0x26e011,_0x2ddefd){return function(_0x1779d7){if(_0x1779d7){return _0x1779d7[_0x7b55('0x27')]()['then'](function(){_0x26e011[_0x7b55('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a24ec,_0x2a9044){return function(_0x4dafb0){if(!_0x4dafb0){_0x5a24ec[_0x7b55('0x1b')](0x194);}return _0x4dafb0;};}function handleError(_0x3e1391,_0x3e50ac){_0x3e50ac=_0x3e50ac||0x1f4;return function(_0x11096b){logger['error'](_0x11096b[_0x7b55('0x28')]);if(_0x11096b['name']){delete _0x11096b[_0x7b55('0x29')];}_0x3e1391[_0x7b55('0x21')](_0x3e50ac)['send'](_0x11096b);};}exports[_0x7b55('0x2a')]=function(_0x573423,_0x3896c0){var _0x45f6e0={},_0x106b5f={},_0x20a90f={'count':0x0,'rows':[]};var _0x5c5a02=_[_0x7b55('0x2b')](db[_0x7b55('0x2c')][_0x7b55('0x2d')],function(_0x5b60c2){return{'name':_0x5b60c2[_0x7b55('0x2e')],'type':_0x5b60c2[_0x7b55('0x2f')][_0x7b55('0x30')]};});_0x106b5f['model']=_[_0x7b55('0x2b')](_0x5c5a02,_0x7b55('0x29'));_0x106b5f[_0x7b55('0x31')]=_[_0x7b55('0x32')](_0x573423['query']);_0x106b5f['filters']=_[_0x7b55('0x33')](_0x106b5f[_0x7b55('0x34')],_0x106b5f[_0x7b55('0x31')]);_0x45f6e0['attributes']=_[_0x7b55('0x33')](_0x106b5f['model'],qs[_0x7b55('0x35')](_0x573423['query'][_0x7b55('0x35')]));_0x45f6e0[_0x7b55('0x36')]=_0x45f6e0[_0x7b55('0x36')][_0x7b55('0x37')]?_0x45f6e0['attributes']:_0x106b5f['model'];if(!_0x573423[_0x7b55('0x31')][_0x7b55('0x38')](_0x7b55('0x39'))){_0x45f6e0[_0x7b55('0x1f')]=qs[_0x7b55('0x1f')](_0x573423[_0x7b55('0x31')]['limit']);_0x45f6e0[_0x7b55('0x1d')]=qs[_0x7b55('0x1d')](_0x573423['query']['offset']);}_0x45f6e0['order']=qs[_0x7b55('0x3a')](_0x573423['query'][_0x7b55('0x3a')]);_0x45f6e0[_0x7b55('0x3b')]=qs['filters'](_[_0x7b55('0x3c')](_0x573423[_0x7b55('0x31')],_0x106b5f[_0x7b55('0x3d')]),_0x5c5a02);if(_0x573423[_0x7b55('0x31')][_0x7b55('0x3e')]){_0x45f6e0['where']=_[_0x7b55('0x3f')](_0x45f6e0[_0x7b55('0x3b')],{'$or':_['map'](_0x5c5a02,function(_0x19657e){if(_0x19657e[_0x7b55('0x2f')]!==_0x7b55('0x40')){var _0x58bc8e={};_0x58bc8e[_0x19657e['name']]={'$like':'%'+_0x573423[_0x7b55('0x31')]['filter']+'%'};return _0x58bc8e;}})});}_0x45f6e0=_[_0x7b55('0x3f')]({},_0x45f6e0,_0x573423['options']);var _0x4f6688={'where':_0x45f6e0['where']};return db[_0x7b55('0x2c')][_0x7b55('0x20')](_0x4f6688)[_0x7b55('0x26')](function(_0x3cd8f0){_0x20a90f[_0x7b55('0x20')]=_0x3cd8f0;if(_0x573423[_0x7b55('0x31')][_0x7b55('0x41')]){_0x45f6e0['include']=[{'all':!![]}];}return db[_0x7b55('0x2c')][_0x7b55('0x42')](_0x45f6e0);})['then'](function(_0x3de41f){_0x20a90f[_0x7b55('0x43')]=_0x3de41f;return _0x20a90f;})[_0x7b55('0x26')](respondWithFilteredResult(_0x3896c0,_0x45f6e0))[_0x7b55('0x44')](handleError(_0x3896c0,null));};exports[_0x7b55('0x45')]=function(_0x463c83,_0x1eedb3){var _0x26bee0={'raw':![],'where':{'id':_0x463c83[_0x7b55('0x46')]['id']}},_0x53b37f={};_0x53b37f[_0x7b55('0x34')]=_[_0x7b55('0x32')](db[_0x7b55('0x2c')][_0x7b55('0x2d')]);_0x53b37f[_0x7b55('0x31')]=_[_0x7b55('0x32')](_0x463c83['query']);_0x53b37f[_0x7b55('0x3d')]=_[_0x7b55('0x33')](_0x53b37f[_0x7b55('0x34')],_0x53b37f[_0x7b55('0x31')]);_0x26bee0[_0x7b55('0x36')]=_[_0x7b55('0x33')](_0x53b37f[_0x7b55('0x34')],qs[_0x7b55('0x35')](_0x463c83[_0x7b55('0x31')][_0x7b55('0x35')]));_0x26bee0[_0x7b55('0x36')]=_0x26bee0[_0x7b55('0x36')][_0x7b55('0x37')]?_0x26bee0['attributes']:_0x53b37f[_0x7b55('0x34')];if(_0x463c83[_0x7b55('0x31')][_0x7b55('0x41')]){_0x26bee0[_0x7b55('0x47')]=[{'all':!![]}];}_0x26bee0=_[_0x7b55('0x3f')]({},_0x26bee0,_0x463c83[_0x7b55('0x48')]);return db[_0x7b55('0x2c')][_0x7b55('0x49')](_0x26bee0)[_0x7b55('0x26')](handleEntityNotFound(_0x1eedb3,null))[_0x7b55('0x26')](respondWithResult(_0x1eedb3,null))[_0x7b55('0x44')](handleError(_0x1eedb3,null));};exports[_0x7b55('0x4a')]=function(_0x455428,_0x4aa2c7){return db[_0x7b55('0x2c')][_0x7b55('0x4a')](_0x455428[_0x7b55('0x4b')],{})[_0x7b55('0x26')](respondWithResult(_0x4aa2c7,0xc9))['catch'](handleError(_0x4aa2c7,null));};exports[_0x7b55('0x25')]=function(_0x4ebb7c,_0x2669e1){if(_0x4ebb7c[_0x7b55('0x4b')]['id']){delete _0x4ebb7c['body']['id'];}return db['Automation'][_0x7b55('0x49')]({'where':{'id':_0x4ebb7c[_0x7b55('0x46')]['id']}})['then'](handleEntityNotFound(_0x2669e1,null))[_0x7b55('0x26')](saveUpdates(_0x4ebb7c[_0x7b55('0x4b')],null))[_0x7b55('0x26')](respondWithResult(_0x2669e1,null))[_0x7b55('0x44')](handleError(_0x2669e1,null));};exports[_0x7b55('0x27')]=function(_0x3d7e4f,_0x567042){return db[_0x7b55('0x2c')][_0x7b55('0x49')]({'where':{'id':_0x3d7e4f['params']['id']}})[_0x7b55('0x26')](handleEntityNotFound(_0x567042,null))[_0x7b55('0x26')](removeEntity(_0x567042,null))[_0x7b55('0x44')](handleError(_0x567042,null));};exports[_0x7b55('0x4c')]=function(_0x412039,_0x4d6d7d,_0x3edea9){return db[_0x7b55('0x4d')][_0x7b55('0x49')]({'where':{'id':_0x412039[_0x7b55('0x46')]['id']}})[_0x7b55('0x26')](handleEntityNotFound(_0x4d6d7d,null))['then'](function(_0x1b1b7f){if(_0x1b1b7f){return _0x1b1b7f[_0x7b55('0x4c')](_0x412039[_0x7b55('0x4b')][_0x7b55('0x4e')],_[_0x7b55('0x4f')](_0x412039[_0x7b55('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0x4d6d7d,null))[_0x7b55('0x44')](handleError(_0x4d6d7d,null));};exports[_0x7b55('0x50')]=function(_0x1a4666,_0x3cf37b,_0x3ada42){var _0x56cdf2={};var _0x4e444c={};var _0x34ac27;var _0xfcf1e;return db[_0x7b55('0x2c')][_0x7b55('0x51')]({'where':{'id':_0x1a4666[_0x7b55('0x46')]['id']}})['then'](handleEntityNotFound(_0x3cf37b,null))[_0x7b55('0x26')](function(_0xfcadbc){if(_0xfcadbc){_0x34ac27=_0xfcadbc;_0x4e444c[_0x7b55('0x34')]=_[_0x7b55('0x32')](db[_0x7b55('0x4d')][_0x7b55('0x2d')]);_0x4e444c['query']=_[_0x7b55('0x32')](_0x1a4666[_0x7b55('0x31')]);_0x4e444c[_0x7b55('0x3d')]=_[_0x7b55('0x33')](_0x4e444c['model'],_0x4e444c[_0x7b55('0x31')]);_0x56cdf2['attributes']=_[_0x7b55('0x33')](_0x4e444c[_0x7b55('0x34')],qs[_0x7b55('0x35')](_0x1a4666['query'][_0x7b55('0x35')]));_0x56cdf2[_0x7b55('0x36')]=_0x56cdf2[_0x7b55('0x36')][_0x7b55('0x37')]?_0x56cdf2[_0x7b55('0x36')]:_0x4e444c[_0x7b55('0x34')];_0x56cdf2[_0x7b55('0x52')]=qs[_0x7b55('0x3a')](_0x1a4666[_0x7b55('0x31')][_0x7b55('0x3a')]);_0x56cdf2[_0x7b55('0x3b')]=qs[_0x7b55('0x3d')](_[_0x7b55('0x3c')](_0x1a4666[_0x7b55('0x31')],_0x4e444c[_0x7b55('0x3d')]));if(_0x1a4666[_0x7b55('0x31')][_0x7b55('0x3e')]){_0x56cdf2['where']=_[_0x7b55('0x3f')](_0x56cdf2[_0x7b55('0x3b')],{'$or':_[_0x7b55('0x2b')](_0x56cdf2[_0x7b55('0x36')],function(_0xaf49c2){var _0x570aa3={};_0x570aa3[_0xaf49c2]={'$like':'%'+_0x1a4666[_0x7b55('0x31')][_0x7b55('0x3e')]+'%'};return _0x570aa3;})});}_0x56cdf2=_[_0x7b55('0x3f')]({},_0x56cdf2,_0x1a4666[_0x7b55('0x48')]);return _0x34ac27[_0x7b55('0x50')](_0x56cdf2);}})['then'](function(_0x588fdc){if(_0x588fdc){_0xfcf1e=_0x588fdc[_0x7b55('0x37')];if(!_0x1a4666[_0x7b55('0x31')][_0x7b55('0x38')](_0x7b55('0x39'))){_0x56cdf2[_0x7b55('0x1f')]=qs[_0x7b55('0x1f')](_0x1a4666[_0x7b55('0x31')][_0x7b55('0x1f')]);_0x56cdf2['offset']=qs[_0x7b55('0x1d')](_0x1a4666['query'][_0x7b55('0x1d')]);}return _0x34ac27[_0x7b55('0x50')](_0x56cdf2);}})['then'](function(_0x279fb6){if(_0x279fb6){return _0x279fb6?{'count':_0xfcf1e,'rows':_0x279fb6}:null;}})[_0x7b55('0x26')](respondWithResult(_0x3cf37b,null))[_0x7b55('0x44')](handleError(_0x3cf37b,null));};exports[_0x7b55('0x53')]=function(_0x5894f1,_0x2944a2,_0x1f37cf){return db[_0x7b55('0x54')][_0x7b55('0x49')]({'where':{'id':_0x5894f1[_0x7b55('0x46')]['id']}})['then'](handleEntityNotFound(_0x2944a2,null))['then'](function(_0x567ba6){if(_0x567ba6){return _0x567ba6[_0x7b55('0x53')](_0x5894f1[_0x7b55('0x4b')][_0x7b55('0x4e')],_[_0x7b55('0x4f')](_0x5894f1[_0x7b55('0x4b')],['ids','id'])||{});}})[_0x7b55('0x26')](respondWithResult(_0x2944a2,null))['catch'](handleError(_0x2944a2,null));};exports[_0x7b55('0x55')]=function(_0x1402e9,_0xbb28e0,_0x17c81d){var _0x22b395={};var _0x49dc78={};var _0x34b481;var _0xc81631;return db['Automation'][_0x7b55('0x51')]({'where':{'id':_0x1402e9[_0x7b55('0x46')]['id']}})['then'](handleEntityNotFound(_0xbb28e0,null))[_0x7b55('0x26')](function(_0x5d8df6){if(_0x5d8df6){_0x34b481=_0x5d8df6;_0x49dc78[_0x7b55('0x34')]=_['keys'](db[_0x7b55('0x54')][_0x7b55('0x2d')]);_0x49dc78['query']=_[_0x7b55('0x32')](_0x1402e9[_0x7b55('0x31')]);_0x49dc78[_0x7b55('0x3d')]=_[_0x7b55('0x33')](_0x49dc78[_0x7b55('0x34')],_0x49dc78[_0x7b55('0x31')]);_0x22b395[_0x7b55('0x36')]=_[_0x7b55('0x33')](_0x49dc78[_0x7b55('0x34')],qs[_0x7b55('0x35')](_0x1402e9[_0x7b55('0x31')][_0x7b55('0x35')]));_0x22b395[_0x7b55('0x36')]=_0x22b395[_0x7b55('0x36')][_0x7b55('0x37')]?_0x22b395[_0x7b55('0x36')]:_0x49dc78['model'];_0x22b395['order']=qs[_0x7b55('0x3a')](_0x1402e9[_0x7b55('0x31')][_0x7b55('0x3a')]);_0x22b395[_0x7b55('0x3b')]=qs[_0x7b55('0x3d')](_[_0x7b55('0x3c')](_0x1402e9[_0x7b55('0x31')],_0x49dc78['filters']));if(_0x1402e9[_0x7b55('0x31')]['filter']){_0x22b395[_0x7b55('0x3b')]=_['merge'](_0x22b395[_0x7b55('0x3b')],{'$or':_[_0x7b55('0x2b')](_0x22b395[_0x7b55('0x36')],function(_0x4f6e0c){var _0x8097b2={};_0x8097b2[_0x4f6e0c]={'$like':'%'+_0x1402e9[_0x7b55('0x31')][_0x7b55('0x3e')]+'%'};return _0x8097b2;})});}_0x22b395=_['merge']({},_0x22b395,_0x1402e9[_0x7b55('0x48')]);return _0x34b481[_0x7b55('0x55')](_0x22b395);}})['then'](function(_0x4e7196){if(_0x4e7196){_0xc81631=_0x4e7196[_0x7b55('0x37')];if(!_0x1402e9[_0x7b55('0x31')][_0x7b55('0x38')]('nolimit')){_0x22b395['limit']=qs[_0x7b55('0x1f')](_0x1402e9['query'][_0x7b55('0x1f')]);_0x22b395[_0x7b55('0x1d')]=qs['offset'](_0x1402e9['query'][_0x7b55('0x1d')]);}return _0x34b481[_0x7b55('0x55')](_0x22b395);}})[_0x7b55('0x26')](function(_0x3c9609){if(_0x3c9609){return _0x3c9609?{'count':_0xc81631,'rows':_0x3c9609}:null;}})[_0x7b55('0x26')](respondWithResult(_0xbb28e0,null))[_0x7b55('0x44')](handleError(_0xbb28e0,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 700b085..b417377 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 _0x9397=['tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x9397,0xaa));var _0x7939=function(_0x167015,_0xf06138){_0x167015=_0x167015-0x0;var _0x4e7da3=_0x9397[_0x167015];return _0x4e7da3;};'use strict';var _=require(_0x7939('0x0'));var util=require(_0x7939('0x1'));var logger=require(_0x7939('0x2'))(_0x7939('0x3'));var moment=require(_0x7939('0x4'));var BPromise=require(_0x7939('0x5'));var rp=require(_0x7939('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7939('0x7'));var attributes=require(_0x7939('0x8'));module[_0x7939('0x9')]=function(_0x32eb39,_0x33cdae){return _0x32eb39[_0x7939('0xa')](_0x7939('0xb'),attributes,{'tableName':_0x7939('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3478=['tools_automations','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x3478,0x69));var _0x8347=function(_0x278a14,_0xf19619){_0x278a14=_0x278a14-0x0;var _0x844308=_0x3478[_0x278a14];return _0x844308;};'use strict';var _=require(_0x8347('0x0'));var util=require(_0x8347('0x1'));var logger=require('../../config/logger')(_0x8347('0x2'));var moment=require(_0x8347('0x3'));var BPromise=require(_0x8347('0x4'));var rp=require(_0x8347('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8347('0x6'));var config=require(_0x8347('0x7'));var attributes=require(_0x8347('0x8'));module[_0x8347('0x9')]=function(_0x35ff12,_0x540bd2){return _0x35ff12[_0x8347('0xa')](_0x8347('0xb'),attributes,{'tableName':_0x8347('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 66bd54f..7b003b7 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 _0xd8d7=['client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','rpc','jayson/promise'];(function(_0x5f2280,_0x202963){var _0xb2007c=function(_0x38b7c9){while(--_0x38b7c9){_0x5f2280['push'](_0x5f2280['shift']());}};_0xb2007c(++_0x202963);}(_0xd8d7,0x1d4));var _0x7d8d=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0xd8d7[_0xdbe2de];return _0x2facd7;};'use strict';var _=require(_0x7d8d('0x0'));var util=require(_0x7d8d('0x1'));var moment=require(_0x7d8d('0x2'));var BPromise=require(_0x7d8d('0x3'));var rs=require(_0x7d8d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7d8d('0x5'));var config=require('../../config/environment');var jayson=require(_0x7d8d('0x6'));var client=jayson[_0x7d8d('0x7')][_0x7d8d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc39292,_0x2294c2,_0x3036a9){return new BPromise(function(_0x1bac2e,_0x506fcd){return client[_0x7d8d('0x9')](_0xc39292,_0x3036a9)[_0x7d8d('0xa')](function(_0x3e2f6e){logger[_0x7d8d('0xb')](_0x7d8d('0xc'),_0x2294c2,_0x7d8d('0xd'));logger[_0x7d8d('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x2294c2,_0x7d8d('0xd'),JSON[_0x7d8d('0xf')](_0x3e2f6e));if(_0x3e2f6e[_0x7d8d('0x10')]){if(_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x11')]===0x1f4){logger['error'](_0x7d8d('0xc'),_0x2294c2,_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);return _0x506fcd(_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);}logger[_0x7d8d('0x10')]('Automation,\x20%s,\x20%s',_0x2294c2,_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);return _0x1bac2e(_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);}else{logger[_0x7d8d('0xb')]('Automation,\x20%s,\x20%s',_0x2294c2,_0x7d8d('0xd'));_0x1bac2e(_0x3e2f6e['result'][_0x7d8d('0x12')]);}})['catch'](function(_0x12588c){logger[_0x7d8d('0x10')](_0x7d8d('0xc'),_0x2294c2,_0x12588c);_0x506fcd(_0x12588c);});});} \ No newline at end of file +var _0xde1a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x54a2e4,_0x1ff92c){var _0x4742d0=function(_0x147a6f){while(--_0x147a6f){_0x54a2e4['push'](_0x54a2e4['shift']());}};_0x4742d0(++_0x1ff92c);}(_0xde1a,0xfd));var _0xade1=function(_0x3897d2,_0x57147f){_0x3897d2=_0x3897d2-0x0;var _0x5ef6ac=_0xde1a[_0x3897d2];return _0x5ef6ac;};'use strict';var _=require('lodash');var util=require(_0xade1('0x0'));var moment=require(_0xade1('0x1'));var BPromise=require(_0xade1('0x2'));var rs=require(_0xade1('0x3'));var fs=require('fs');var Redis=require(_0xade1('0x4'));var db=require(_0xade1('0x5'))['db'];var utils=require(_0xade1('0x6'));var logger=require(_0xade1('0x7'))('rpc');var config=require(_0xade1('0x8'));var jayson=require(_0xade1('0x9'));var client=jayson[_0xade1('0xa')][_0xade1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3be6d5,_0x15e325,_0x5eb992){return new BPromise(function(_0x3a24e7,_0x41d069){return client[_0xade1('0xc')](_0x3be6d5,_0x5eb992)[_0xade1('0xd')](function(_0x120f47){logger[_0xade1('0xe')](_0xade1('0xf'),_0x15e325,_0xade1('0x10'));logger['debug'](_0xade1('0x11'),_0x15e325,_0xade1('0x10'),JSON['stringify'](_0x120f47));if(_0x120f47[_0xade1('0x12')]){if(_0x120f47[_0xade1('0x12')][_0xade1('0x13')]===0x1f4){logger['error'](_0xade1('0xf'),_0x15e325,_0x120f47[_0xade1('0x12')][_0xade1('0x14')]);return _0x41d069(_0x120f47[_0xade1('0x12')][_0xade1('0x14')]);}logger[_0xade1('0x12')]('Automation,\x20%s,\x20%s',_0x15e325,_0x120f47[_0xade1('0x12')][_0xade1('0x14')]);return _0x3a24e7(_0x120f47[_0xade1('0x12')][_0xade1('0x14')]);}else{logger[_0xade1('0xe')]('Automation,\x20%s,\x20%s',_0x15e325,_0xade1('0x10'));_0x3a24e7(_0x120f47[_0xade1('0x15')][_0xade1('0x14')]);}})[_0xade1('0x16')](function(_0x994e75){logger['error'](_0xade1('0xf'),_0x15e325,_0x994e75);_0x41d069(_0x994e75);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 30930bb..bd2e735 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 _0xb790=['create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','util','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','post'];(function(_0x23b1d5,_0x3043fa){var _0x3f5702=function(_0xc9b7eb){while(--_0xc9b7eb){_0x23b1d5['push'](_0x23b1d5['shift']());}};_0x3f5702(++_0x3043fa);}(_0xb790,0xe5));var _0x0b79=function(_0xa1dc2c,_0x6d230d){_0xa1dc2c=_0xa1dc2c-0x0;var _0x4caf06=_0xb790[_0xa1dc2c];return _0x4caf06;};'use strict';var multer=require('multer');var util=require(_0x0b79('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0b79('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0b79('0x2'));var config=require(_0x0b79('0x3'));var controller=require('./automation.controller');router[_0x0b79('0x4')]('/',auth[_0x0b79('0x5')](),controller[_0x0b79('0x6')]);router[_0x0b79('0x4')](_0x0b79('0x7'),auth[_0x0b79('0x5')](),controller[_0x0b79('0x8')]);router[_0x0b79('0x4')](_0x0b79('0x9'),auth[_0x0b79('0x5')](),controller[_0x0b79('0xa')]);router[_0x0b79('0x4')]('/:id/actions',auth['isAuthenticated'](),controller[_0x0b79('0xb')]);router[_0x0b79('0xc')]('/',auth[_0x0b79('0x5')](),controller[_0x0b79('0xd')]);router[_0x0b79('0xc')]('/:id/conditions',auth[_0x0b79('0x5')](),controller[_0x0b79('0xe')]);router['post'](_0x0b79('0xf'),auth[_0x0b79('0x5')](),controller[_0x0b79('0x10')]);router[_0x0b79('0x11')]('/:id',auth[_0x0b79('0x5')](),controller[_0x0b79('0x12')]);router[_0x0b79('0x13')](_0x0b79('0x7'),auth['isAuthenticated'](),controller[_0x0b79('0x14')]);module[_0x0b79('0x15')]=router; \ No newline at end of file +var _0xfd8f=['index','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2ba62e,_0x3062b6){var _0x574764=function(_0x8b469){while(--_0x8b469){_0x2ba62e['push'](_0x2ba62e['shift']());}};_0x574764(++_0x3062b6);}(_0xfd8f,0xae));var _0xffd8=function(_0xc2bb54,_0x54ece6){_0xc2bb54=_0xc2bb54-0x0;var _0x546542=_0xfd8f[_0xc2bb54];return _0x546542;};'use strict';var multer=require(_0xffd8('0x0'));var util=require(_0xffd8('0x1'));var path=require('path');var timeout=require(_0xffd8('0x2'));var express=require(_0xffd8('0x3'));var router=express[_0xffd8('0x4')]();var fs_extra=require(_0xffd8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xffd8('0x6'));var config=require(_0xffd8('0x7'));var controller=require('./automation.controller');router[_0xffd8('0x8')]('/',auth[_0xffd8('0x9')](),controller[_0xffd8('0xa')]);router[_0xffd8('0x8')](_0xffd8('0xb'),auth[_0xffd8('0x9')](),controller['show']);router[_0xffd8('0x8')](_0xffd8('0xc'),auth[_0xffd8('0x9')](),controller[_0xffd8('0xd')]);router['get'](_0xffd8('0xe'),auth[_0xffd8('0x9')](),controller[_0xffd8('0xf')]);router[_0xffd8('0x10')]('/',auth[_0xffd8('0x9')](),controller[_0xffd8('0x11')]);router[_0xffd8('0x10')](_0xffd8('0xc'),auth[_0xffd8('0x9')](),controller['addConditions']);router['post']('/:id/actions',auth[_0xffd8('0x9')](),controller[_0xffd8('0x12')]);router[_0xffd8('0x13')](_0xffd8('0xb'),auth[_0xffd8('0x9')](),controller['update']);router[_0xffd8('0x14')](_0xffd8('0xb'),auth[_0xffd8('0x9')](),controller[_0xffd8('0x15')]);module[_0xffd8('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 5d8e8b0..e4edbb3 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 _0xe25b=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xe25b,0x129));var _0xbe25=function(_0x1a124d,_0x3e04b0){_0x1a124d=_0x1a124d-0x0;var _0x5f0830=_0xe25b[_0x1a124d];return _0x5f0830;};'use strict';var Sequelize=require(_0xbe25('0x0'));module[_0xbe25('0x1')]={'name':{'type':Sequelize[_0xbe25('0x2')],'unique':_0xbe25('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xbe25('0x4')](_0xbe25('0x5')),'allowNull':![],'defaultValue':_0xbe25('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xbe25('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xbe25('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbe25('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xbe25('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xbe25('0x7')](0x3)[_0xbe25('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xbe25('0x7')](0x3)[_0xbe25('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbe25('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xbe25('0x7')](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbe25('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xbe25('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbe25('0xf')},'dialTimezone':{'type':Sequelize[_0xbe25('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbe25('0x2')],'defaultValue':_0xbe25('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xbe25('0x4')](_0xbe25('0x11'),'never',_0xbe25('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xbe25('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xbe25('0x7')](0x9)[_0xbe25('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbe25('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xbe25('0x7')](0x9)[_0xbe25('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbe25('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xbe25('0x7')](0x9)[_0xbe25('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbe25('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbe25('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbe25('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xbe25('0x7')](0x9)[_0xbe25('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbe25('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbe25('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbe25('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xbe25('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xbe25('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xbe25('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbe25('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xbe25('0x4')](_0xbe25('0x1c'),_0xbe25('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xbe25('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbe25('0x7')](0x3)[_0xbe25('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbe25('0x1e')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xbe25('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbe25('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xbe25('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbe25('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbe25('0x7')](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xbe25('0x7')](0x3)[_0xbe25('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbe25('0x22')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xbe25('0x7')](0x3)[_0xbe25('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbe25('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbe25('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xbe25('0x7')](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbe25('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xbe25('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0x27')}}; \ No newline at end of file +var _0x7760=['#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x19c051,_0x1330ab){var _0x29995b=function(_0x11455e){while(--_0x11455e){_0x19c051['push'](_0x19c051['shift']());}};_0x29995b(++_0x1330ab);}(_0x7760,0x15d));var _0x0776=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x7760[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0x0776('0x0'));module['exports']={'name':{'type':Sequelize[_0x0776('0x1')],'unique':_0x0776('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x0776('0x3')),'allowNull':![],'defaultValue':_0x0776('0x3')},'description':{'type':Sequelize[_0x0776('0x1')]},'active':{'type':Sequelize[_0x0776('0x4')],'defaultValue':0x0,'comment':_0x0776('0x5')},'limitCalls':{'type':Sequelize[_0x0776('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0776('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0776('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0776('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x0776('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0776('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0776('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0776('0x6')](0x5)[_0x0776('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0776('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0776('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0776('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0776('0x6')](0x5)[_0x0776('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0776('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0776('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x0776('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0776('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0776('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0776('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0776('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0776('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x0776('0x10')](_0x0776('0x11'),_0x0776('0x12'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0776('0x4')],'defaultValue':0x0,'comment':_0x0776('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0776('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0776('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x0776('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0776('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0776('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0776('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0776('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0776('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0776('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0776('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0776('0x6')](0x9)[_0x0776('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0776('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0776('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0776('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0776('0x6')](0x9)[_0x0776('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0776('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0776('0x10')](_0x0776('0x1c'),_0x0776('0x1d')),'defaultValue':_0x0776('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0776('0x6')](0x3)[_0x0776('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0776('0x1e')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0776('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0776('0x6')](0x3)[_0x0776('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0776('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0776('0x6')](0x5)[_0x0776('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0776('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0776('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x0776('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0776('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0776('0x6')](0x5)[_0x0776('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0776('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0776('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0776('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0776('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0776('0x6')](0x3)[_0x0776('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0776('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0776('0x6')](0x5)[_0x0776('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 67c7fdf..6d6caaa 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 _0xfa12=['format','push','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','UserProfileSection','findOne','CmHopper','CampaignId','getHopperHistories','sort','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0xfa12,0x1b2));var _0x2fa1=function(_0x5098ce,_0x43425c){_0x5098ce=_0x5098ce-0x0;var _0x17a3ac=_0xfa12[_0x5098ce];return _0x17a3ac;};'use strict';var emlformat=require(_0x2fa1('0x0'));var rimraf=require(_0x2fa1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2fa1('0x2'));var rp=require(_0x2fa1('0x3'));var moment=require(_0x2fa1('0x4'));var BPromise=require(_0x2fa1('0x5'));var Mustache=require('mustache');var util=require(_0x2fa1('0x6'));var path=require(_0x2fa1('0x7'));var sox=require(_0x2fa1('0x8'));var csv=require(_0x2fa1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2fa1('0xa'));var _=require(_0x2fa1('0xb'));var squel=require('squel');var crypto=require(_0x2fa1('0xc'));var jsforce=require(_0x2fa1('0xd'));var deskjs=require(_0x2fa1('0xe'));var toCsv=require(_0x2fa1('0x9'));var querystring=require('querystring');var Papa=require(_0x2fa1('0xf'));var Redis=require(_0x2fa1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2fa1('0x11'));var as=require(_0x2fa1('0x12'));var hardwareService=require(_0x2fa1('0x13'));var logger=require(_0x2fa1('0x14'))(_0x2fa1('0x15'));var utils=require(_0x2fa1('0x16'));var config=require(_0x2fa1('0x17'));var licenseUtil=require(_0x2fa1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x305bb3,_0x4198e1){_0x4198e1=_0x4198e1||0xcc;return function(_0x311441){if(_0x311441){return _0x305bb3[_0x2fa1('0x19')](_0x4198e1);}return _0x305bb3[_0x2fa1('0x1a')](_0x4198e1)[_0x2fa1('0x1b')]();};}function respondWithResult(_0x567bc5,_0xf81957){_0xf81957=_0xf81957||0xc8;return function(_0x409ea0){if(_0x409ea0){return _0x567bc5[_0x2fa1('0x1a')](_0xf81957)[_0x2fa1('0x1c')](_0x409ea0);}};}function respondWithFilteredResult(_0x5e7ed0,_0x3c79b6){return function(_0x3d6647){if(_0x3d6647){var _0x59aa4d=typeof _0x3c79b6[_0x2fa1('0x1d')]===_0x2fa1('0x1e')&&typeof _0x3c79b6[_0x2fa1('0x1f')]===_0x2fa1('0x1e');var _0xaf39c7=_0x3d6647[_0x2fa1('0x20')];var _0x21004a=_0x59aa4d?0x0:_0x3c79b6[_0x2fa1('0x1d')];var _0x4d16ac=_0x59aa4d?_0x3d6647[_0x2fa1('0x20')]:_0x3c79b6['offset']+_0x3c79b6['limit'];var _0x18d225;if(_0x4d16ac>=_0xaf39c7){_0x4d16ac=_0xaf39c7;_0x18d225=0xc8;}else{_0x18d225=0xce;}_0x5e7ed0[_0x2fa1('0x1a')](_0x18d225);return _0x5e7ed0[_0x2fa1('0x21')](_0x2fa1('0x22'),_0x21004a+'-'+_0x4d16ac+'/'+_0xaf39c7)[_0x2fa1('0x1c')](_0x3d6647);}return null;};}function patchUpdates(_0x5c451e){return function(_0x23f0d2){try{jsonpatch['apply'](_0x23f0d2,_0x5c451e,!![]);}catch(_0x22e15f){return BPromise[_0x2fa1('0x23')](_0x22e15f);}return _0x23f0d2[_0x2fa1('0x24')]();};}function saveUpdates(_0x245898,_0x24fe15){return function(_0x3fa70d){if(_0x3fa70d){return _0x3fa70d[_0x2fa1('0x25')](_0x245898)[_0x2fa1('0x26')](function(_0x2e95f0){return _0x2e95f0;});}return null;};}function removeEntity(_0x15037c,_0x5021fb){return function(_0x1eaa57){if(_0x1eaa57){return _0x1eaa57['destroy']()['then'](function(){var _0x5e255a=_0x1eaa57[_0x2fa1('0x27')]({'plain':!![]});var _0x5c89fc='IvrCampaigns';return db[_0x2fa1('0x28')][_0x2fa1('0x29')]({'where':{'type':_0x5c89fc,'resourceId':_0x5e255a['id']}})[_0x2fa1('0x26')](function(){return _0x1eaa57;});})[_0x2fa1('0x26')](function(){_0x15037c[_0x2fa1('0x1a')](0xcc)[_0x2fa1('0x1b')]();});}};}function handleEntityNotFound(_0x294c29,_0x39d083){return function(_0x255974){if(!_0x255974){_0x294c29[_0x2fa1('0x19')](0x194);}return _0x255974;};}function handleError(_0x28f35e,_0x28300d){_0x28300d=_0x28300d||0x1f4;return function(_0x16c050){logger[_0x2fa1('0x2a')](_0x16c050[_0x2fa1('0x2b')]);if(_0x16c050[_0x2fa1('0x2c')]){delete _0x16c050[_0x2fa1('0x2c')];}_0x28f35e[_0x2fa1('0x1a')](_0x28300d)['send'](_0x16c050);};}exports[_0x2fa1('0x2d')]=function(_0x1860a0,_0x4bf6b5){var _0x1bf81b={},_0x489cbe={},_0x33eff1={'count':0x0,'rows':[]};var _0x2da397=_[_0x2fa1('0x2e')](db['Campaign'][_0x2fa1('0x2f')],function(_0x345b81){return{'name':_0x345b81[_0x2fa1('0x30')],'type':_0x345b81[_0x2fa1('0x31')]['key']};});_0x489cbe[_0x2fa1('0x32')]=_[_0x2fa1('0x2e')](_0x2da397,'name');_0x489cbe[_0x2fa1('0x33')]=_['keys'](_0x1860a0[_0x2fa1('0x33')]);_0x489cbe[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x489cbe[_0x2fa1('0x32')],_0x489cbe[_0x2fa1('0x33')]);_0x1bf81b[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x489cbe[_0x2fa1('0x32')],qs['fields'](_0x1860a0[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x1bf81b['attributes']=_0x1bf81b[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x1bf81b[_0x2fa1('0x36')]:_0x489cbe[_0x2fa1('0x32')];if(!_0x1860a0[_0x2fa1('0x33')][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x1bf81b[_0x2fa1('0x1f')]=qs['limit'](_0x1860a0['query']['limit']);_0x1bf81b[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x1860a0['query']['offset']);}_0x1bf81b[_0x2fa1('0x3b')]=qs['sort'](_0x1860a0[_0x2fa1('0x33')]['sort']);_0x1bf81b[_0x2fa1('0x3c')]=qs[_0x2fa1('0x34')](_[_0x2fa1('0x3d')](_0x1860a0[_0x2fa1('0x33')],_0x489cbe['filters']),_0x2da397);if(_0x1860a0['query'][_0x2fa1('0x3e')]){_0x1bf81b[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x1bf81b[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x2da397,function(_0x119db6){if(_0x119db6[_0x2fa1('0x31')]!==_0x2fa1('0x40')){var _0x50a769={};_0x50a769[_0x119db6[_0x2fa1('0x2c')]]={'$like':'%'+_0x1860a0[_0x2fa1('0x33')]['filter']+'%'};return _0x50a769;}})});}_0x1bf81b=_[_0x2fa1('0x3f')]({},_0x1bf81b,_0x1860a0[_0x2fa1('0x41')]);var _0x2c2bcb={'where':_0x1bf81b[_0x2fa1('0x3c')]};return db[_0x2fa1('0x42')][_0x2fa1('0x20')](_0x2c2bcb)[_0x2fa1('0x26')](function(_0x5154b7){_0x33eff1[_0x2fa1('0x20')]=_0x5154b7;if(_0x1860a0[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x1bf81b[_0x2fa1('0x44')]=[{'all':!![]}];}return db['Campaign'][_0x2fa1('0x45')](_0x1bf81b);})[_0x2fa1('0x26')](function(_0x1180eb){_0x33eff1[_0x2fa1('0x46')]=_0x1180eb;return _0x33eff1;})['then'](respondWithFilteredResult(_0x4bf6b5,_0x1bf81b))[_0x2fa1('0x47')](handleError(_0x4bf6b5,null));};exports[_0x2fa1('0x48')]=function(_0x8d92b6,_0x197dcf){var _0x422807={'raw':![],'where':{'id':_0x8d92b6[_0x2fa1('0x49')]['id']}},_0x2c4453={};_0x2c4453[_0x2fa1('0x32')]=_[_0x2fa1('0x4a')](db[_0x2fa1('0x42')]['rawAttributes']);_0x2c4453['query']=_['keys'](_0x8d92b6[_0x2fa1('0x33')]);_0x2c4453['filters']=_['intersection'](_0x2c4453['model'],_0x2c4453[_0x2fa1('0x33')]);_0x422807[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x2c4453[_0x2fa1('0x32')],qs['fields'](_0x8d92b6[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x422807[_0x2fa1('0x36')]=_0x422807[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x422807[_0x2fa1('0x36')]:_0x2c4453[_0x2fa1('0x32')];if(_0x8d92b6[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x422807[_0x2fa1('0x44')]=[{'all':!![]}];}_0x422807=_['merge']({},_0x422807,_0x8d92b6[_0x2fa1('0x41')]);return db[_0x2fa1('0x42')][_0x2fa1('0x4b')](_0x422807)[_0x2fa1('0x26')](handleEntityNotFound(_0x197dcf,null))[_0x2fa1('0x26')](respondWithResult(_0x197dcf,null))['catch'](handleError(_0x197dcf,null));};exports[_0x2fa1('0x4c')]=function(_0x2410e4,_0x1b8556){return db[_0x2fa1('0x42')]['create'](_0x2410e4['body'],{})[_0x2fa1('0x26')](function(_0x4c5562){var _0x2a4fc7=_0x2410e4[_0x2fa1('0x4d')][_0x2fa1('0x27')]({'plain':!![]});if(!_0x2a4fc7)throw new Error(_0x2fa1('0x4e'));if(_0x2a4fc7[_0x2fa1('0x4f')]===_0x2fa1('0x4d')){var _0x5198b1=_0x4c5562['get']({'plain':!![]});var _0x4ca733='IvrCampaigns';return db['UserProfileSection'][_0x2fa1('0x4b')]({'where':{'name':_0x4ca733,'userProfileId':_0x2a4fc7[_0x2fa1('0x50')]},'raw':!![]})[_0x2fa1('0x26')](function(_0x367c2e){if(_0x367c2e&&_0x367c2e[_0x2fa1('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5198b1['name'],'resourceId':_0x5198b1['id'],'type':_0x367c2e[_0x2fa1('0x2c')],'sectionId':_0x367c2e['id']},{})[_0x2fa1('0x26')](function(){return _0x4c5562;});}else{return _0x4c5562;}})['catch'](function(_0x129b9b){logger[_0x2fa1('0x2a')](_0x2fa1('0x52'),_0x129b9b);throw _0x129b9b;});}return _0x4c5562;})[_0x2fa1('0x26')](respondWithResult(_0x1b8556,0xc9))[_0x2fa1('0x47')](handleError(_0x1b8556,null));};exports['clone']=function(_0x3b1923,_0x38c5ac){var _0x4b78e2={'where':{'id':_0x3b1923[_0x2fa1('0x49')]['id']}},_0x499840={};_0x499840[_0x2fa1('0x32')]=_[_0x2fa1('0x4a')](db['Campaign'][_0x2fa1('0x2f')]);_0x4b78e2[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x499840[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x3b1923['query'][_0x2fa1('0x37')]));_0x4b78e2[_0x2fa1('0x36')]=_0x4b78e2['attributes'][_0x2fa1('0x38')]?_0x4b78e2[_0x2fa1('0x36')]:_0x499840[_0x2fa1('0x32')];if(_0x3b1923[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x4b78e2[_0x2fa1('0x44')]=[{'all':!![]}];}_0x4b78e2=_['merge']({},_0x4b78e2,_0x3b1923[_0x2fa1('0x41')]);return db['Campaign']['find'](_0x4b78e2)['then'](handleEntityNotFound(_0x38c5ac,null))[_0x2fa1('0x26')](function(_0x54da3f){if(_0x54da3f){var _0x57f47c=_0x54da3f[_0x2fa1('0x27')]({'plain':!![]});_0x57f47c=qs[_0x2fa1('0x53')](_0x57f47c,['id',_0x2fa1('0x54'),_0x2fa1('0x55')]);_0x3b1923[_0x2fa1('0x56')]=_[_0x2fa1('0x53')](_0x3b1923['body'],['id','createdAt','updatedAt']);return db[_0x2fa1('0x42')]['create'](_[_0x2fa1('0x3f')](_0x57f47c,_0x3b1923[_0x2fa1('0x56')]),{'include':_0x3b1923[_0x2fa1('0x33')][_0x2fa1('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x31bfe1){var _0xfa7a69=_0x3b1923['user'][_0x2fa1('0x27')]({'plain':!![]});if(!_0xfa7a69)throw new Error(_0x2fa1('0x4e'));if(_0xfa7a69[_0x2fa1('0x4f')]===_0x2fa1('0x4d')){var _0x5e8938=_0x31bfe1[_0x2fa1('0x27')]({'plain':!![]});var _0x52694c='IvrCampaigns';return db[_0x2fa1('0x57')][_0x2fa1('0x4b')]({'where':{'name':_0x52694c,'userProfileId':_0xfa7a69['userProfileId']},'raw':!![]})['then'](function(_0x59d74f){if(_0x59d74f&&_0x59d74f[_0x2fa1('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5e8938[_0x2fa1('0x2c')],'resourceId':_0x5e8938['id'],'type':_0x59d74f[_0x2fa1('0x2c')],'sectionId':_0x59d74f['id']},{})[_0x2fa1('0x26')](function(){return _0x31bfe1;});}else{return _0x31bfe1;}})[_0x2fa1('0x47')](function(_0x14c829){logger['error'](_0x2fa1('0x52'),_0x14c829);throw _0x14c829;});}return _0x31bfe1;});}})[_0x2fa1('0x26')](respondWithResult(_0x38c5ac,0xc9))[_0x2fa1('0x47')](handleError(_0x38c5ac,null));};exports[_0x2fa1('0x25')]=function(_0x4e8d81,_0x91bd89){if(_0x4e8d81[_0x2fa1('0x56')]['id']){delete _0x4e8d81[_0x2fa1('0x56')]['id'];}return db[_0x2fa1('0x42')][_0x2fa1('0x4b')]({'where':{'id':_0x4e8d81[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x91bd89,null))[_0x2fa1('0x26')](saveUpdates(_0x4e8d81[_0x2fa1('0x56')],null))[_0x2fa1('0x26')](respondWithResult(_0x91bd89,null))['catch'](handleError(_0x91bd89,null));};exports['destroy']=function(_0x859f00,_0x2de879){return db[_0x2fa1('0x42')][_0x2fa1('0x4b')]({'where':{'id':_0x859f00['params']['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x2de879,null))[_0x2fa1('0x26')](removeEntity(_0x2de879,null))[_0x2fa1('0x47')](handleError(_0x2de879,null));};exports['getHoppers']=function(_0x53c36e,_0x35b9a7,_0x4d292e){var _0x521fa9={'raw':!![],'where':{}};var _0x3e919e={};var _0x424ebc={'count':0x0,'rows':[]};return db[_0x2fa1('0x42')][_0x2fa1('0x58')]({'where':{'id':_0x53c36e['params']['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x35b9a7,null))['then'](function(_0x4df9d8){if(_0x4df9d8){_0x3e919e[_0x2fa1('0x32')]=_['keys'](db[_0x2fa1('0x59')][_0x2fa1('0x2f')]);_0x3e919e['query']=_[_0x2fa1('0x4a')](_0x53c36e[_0x2fa1('0x33')]);_0x3e919e[_0x2fa1('0x34')]=_['intersection'](_0x3e919e['model'],_0x3e919e[_0x2fa1('0x33')]);_0x521fa9['attributes']=_[_0x2fa1('0x35')](_0x3e919e[_0x2fa1('0x32')],qs['fields'](_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x521fa9[_0x2fa1('0x36')]=_0x521fa9[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x521fa9[_0x2fa1('0x36')]:_0x3e919e[_0x2fa1('0x32')];if(!_0x53c36e['query'][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x521fa9[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x53c36e['query'][_0x2fa1('0x1f')]);_0x521fa9[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x1d')]);}_0x521fa9[_0x2fa1('0x3b')]=qs['sort'](_0x53c36e[_0x2fa1('0x33')]['sort']);_0x521fa9[_0x2fa1('0x3c')]=qs[_0x2fa1('0x34')](_['pick'](_0x53c36e[_0x2fa1('0x33')],_0x3e919e[_0x2fa1('0x34')]));_0x521fa9[_0x2fa1('0x3c')][_0x2fa1('0x5a')]=_0x4df9d8['id'];if(_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0x521fa9[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x521fa9['where'],{'$or':_[_0x2fa1('0x2e')](_0x521fa9[_0x2fa1('0x36')],function(_0x504759){var _0x31cc1c={};_0x31cc1c[_0x504759]={'$like':'%'+_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x3e')]+'%'};return _0x31cc1c;})});}_0x521fa9=_[_0x2fa1('0x3f')]({},_0x521fa9,_0x53c36e[_0x2fa1('0x41')]);return db['CmHopper'][_0x2fa1('0x20')]({'where':_0x521fa9['where']})[_0x2fa1('0x26')](function(_0x73d040){_0x424ebc[_0x2fa1('0x20')]=_0x73d040;if(_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x521fa9[_0x2fa1('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0x2fa1('0x45')](_0x521fa9);})[_0x2fa1('0x26')](function(_0x2acb1e){_0x424ebc['rows']=_0x2acb1e;return _0x424ebc;});}})[_0x2fa1('0x26')](respondWithFilteredResult(_0x35b9a7,_0x521fa9))[_0x2fa1('0x47')](handleError(_0x35b9a7,null));};exports[_0x2fa1('0x5b')]=function(_0x1eb73,_0x36dbbb,_0x29f6f5){var _0x100fc4={'raw':!![],'where':{}};var _0x77fa71={};var _0x57479b={'count':0x0,'rows':[]};return db['Campaign'][_0x2fa1('0x58')]({'where':{'id':_0x1eb73['params']['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x36dbbb,null))['then'](function(_0x2ba1f5){if(_0x2ba1f5){_0x77fa71[_0x2fa1('0x32')]=_['keys'](db['CmHopperHistory'][_0x2fa1('0x2f')]);_0x77fa71[_0x2fa1('0x33')]=_['keys'](_0x1eb73[_0x2fa1('0x33')]);_0x77fa71[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x77fa71[_0x2fa1('0x32')],_0x77fa71['query']);_0x100fc4['attributes']=_[_0x2fa1('0x35')](_0x77fa71[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x1eb73[_0x2fa1('0x33')]['fields']));_0x100fc4['attributes']=_0x100fc4['attributes'][_0x2fa1('0x38')]?_0x100fc4['attributes']:_0x77fa71[_0x2fa1('0x32')];if(!_0x1eb73[_0x2fa1('0x33')]['hasOwnProperty'](_0x2fa1('0x3a'))){_0x100fc4[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0x100fc4[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x1d')]);}_0x100fc4[_0x2fa1('0x3b')]=qs[_0x2fa1('0x5c')](_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x5c')]);_0x100fc4[_0x2fa1('0x3c')]=qs['filters'](_[_0x2fa1('0x3d')](_0x1eb73[_0x2fa1('0x33')],_0x77fa71[_0x2fa1('0x34')]));_0x100fc4['where']['CampaignId']=_0x2ba1f5['id'];if(_0x1eb73[_0x2fa1('0x33')]['filter']){_0x100fc4[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x100fc4[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x100fc4['attributes'],function(_0x3fb815){var _0x42d027={};_0x42d027[_0x3fb815]={'$like':'%'+_0x1eb73['query']['filter']+'%'};return _0x42d027;})});}_0x100fc4=_[_0x2fa1('0x3f')]({},_0x100fc4,_0x1eb73['options']);return db[_0x2fa1('0x5d')]['count']({'where':_0x100fc4[_0x2fa1('0x3c')]})[_0x2fa1('0x26')](function(_0x4f446c){_0x57479b[_0x2fa1('0x20')]=_0x4f446c;if(_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x100fc4[_0x2fa1('0x44')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x100fc4);})[_0x2fa1('0x26')](function(_0x3f02ef){_0x57479b[_0x2fa1('0x46')]=_0x3f02ef;return _0x57479b;});}})['then'](respondWithFilteredResult(_0x36dbbb,_0x100fc4))[_0x2fa1('0x47')](handleError(_0x36dbbb,null));};exports[_0x2fa1('0x5e')]=function(_0x4b2686,_0x33f181,_0x511aeb){var _0x268fea={'raw':!![],'where':{}};var _0x40021f={};var _0x56b98b={'count':0x0,'rows':[]};return db[_0x2fa1('0x42')]['findOne']({'where':{'id':_0x4b2686[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x33f181,null))[_0x2fa1('0x26')](function(_0x160733){if(_0x160733){_0x40021f['model']=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x40021f['query']=_['keys'](_0x4b2686['query']);_0x40021f[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x40021f[_0x2fa1('0x32')],_0x40021f[_0x2fa1('0x33')]);_0x268fea['attributes']=_[_0x2fa1('0x35')](_0x40021f[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x4b2686[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x268fea['attributes']=_0x268fea[_0x2fa1('0x36')]['length']?_0x268fea[_0x2fa1('0x36')]:_0x40021f[_0x2fa1('0x32')];if(!_0x4b2686[_0x2fa1('0x33')][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x268fea['limit']=qs['limit'](_0x4b2686['query'][_0x2fa1('0x1f')]);_0x268fea[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x4b2686['query'][_0x2fa1('0x1d')]);}_0x268fea[_0x2fa1('0x3b')]=qs['sort'](_0x4b2686['query'][_0x2fa1('0x5c')]);_0x268fea[_0x2fa1('0x3c')]=qs[_0x2fa1('0x34')](_[_0x2fa1('0x3d')](_0x4b2686['query'],_0x40021f[_0x2fa1('0x34')]));_0x268fea['where'][_0x2fa1('0x5a')]=_0x160733['id'];if(_0x4b2686['query'][_0x2fa1('0x3e')]){_0x268fea[_0x2fa1('0x3c')]=_['merge'](_0x268fea[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x268fea[_0x2fa1('0x36')],function(_0xfd138e){var _0x34084f={};_0x34084f[_0xfd138e]={'$like':'%'+_0x4b2686[_0x2fa1('0x33')]['filter']+'%'};return _0x34084f;})});}_0x268fea=_['merge']({},_0x268fea,_0x4b2686[_0x2fa1('0x41')]);return db[_0x2fa1('0x5f')]['count']({'where':_0x268fea[_0x2fa1('0x3c')]})[_0x2fa1('0x26')](function(_0x546c02){_0x56b98b[_0x2fa1('0x20')]=_0x546c02;if(_0x4b2686[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x268fea[_0x2fa1('0x44')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x2fa1('0x45')](_0x268fea);})[_0x2fa1('0x26')](function(_0x4e6e0a){_0x56b98b[_0x2fa1('0x46')]=_0x4e6e0a;return _0x56b98b;});}})[_0x2fa1('0x26')](respondWithFilteredResult(_0x33f181,_0x268fea))['catch'](handleError(_0x33f181,null));};exports[_0x2fa1('0x60')]=function(_0x281ab0,_0x41f5ad,_0x3f6dc6){var _0xbf35f2={'raw':!![],'where':{}};var _0xc1562c={};var _0x2e057e={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x281ab0[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x41f5ad,null))[_0x2fa1('0x26')](function(_0x3e8c84){if(_0x3e8c84){_0xc1562c[_0x2fa1('0x32')]=_[_0x2fa1('0x4a')](db[_0x2fa1('0x61')]['rawAttributes']);_0xc1562c[_0x2fa1('0x33')]=_[_0x2fa1('0x4a')](_0x281ab0[_0x2fa1('0x33')]);_0xc1562c['filters']=_[_0x2fa1('0x35')](_0xc1562c[_0x2fa1('0x32')],_0xc1562c['query']);_0xbf35f2[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0xc1562c[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0xbf35f2[_0x2fa1('0x36')]=_0xbf35f2[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0xbf35f2[_0x2fa1('0x36')]:_0xc1562c[_0x2fa1('0x32')];if(!_0x281ab0[_0x2fa1('0x33')]['hasOwnProperty'](_0x2fa1('0x3a'))){_0xbf35f2[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0xbf35f2[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x1d')]);}_0xbf35f2[_0x2fa1('0x3b')]=qs[_0x2fa1('0x5c')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x5c')]);_0xbf35f2[_0x2fa1('0x3c')]=qs['filters'](_['pick'](_0x281ab0[_0x2fa1('0x33')],_0xc1562c['filters']));_0xbf35f2[_0x2fa1('0x3c')]['CampaignId']=_0x3e8c84['id'];if(_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0xbf35f2['where']=_[_0x2fa1('0x3f')](_0xbf35f2[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0xbf35f2[_0x2fa1('0x36')],function(_0x4d46f6){var _0x534331={};_0x534331[_0x4d46f6]={'$like':'%'+_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x3e')]+'%'};return _0x534331;})});}_0xbf35f2=_[_0x2fa1('0x3f')]({},_0xbf35f2,_0x281ab0['options']);return db[_0x2fa1('0x61')][_0x2fa1('0x20')]({'where':_0xbf35f2['where']})[_0x2fa1('0x26')](function(_0xc761a1){_0x2e057e[_0x2fa1('0x20')]=_0xc761a1;if(_0x281ab0['query'][_0x2fa1('0x43')]){_0xbf35f2[_0x2fa1('0x44')]=[{'all':!![]}];}return db[_0x2fa1('0x61')][_0x2fa1('0x45')](_0xbf35f2);})[_0x2fa1('0x26')](function(_0x40f293){_0x2e057e[_0x2fa1('0x46')]=_0x40f293;return _0x2e057e;});}})[_0x2fa1('0x26')](respondWithFilteredResult(_0x41f5ad,_0xbf35f2))[_0x2fa1('0x47')](handleError(_0x41f5ad,null));};exports['getLists']=function(_0xec70d9,_0x58f7db,_0xdc7f5d){var _0x49c8d3={};var _0x3572f9={};var _0xd68af4;var _0x181772;return db[_0x2fa1('0x42')][_0x2fa1('0x58')]({'where':{'id':_0xec70d9[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x58f7db,null))[_0x2fa1('0x26')](function(_0x357e19){if(_0x357e19){_0xd68af4=_0x357e19;_0x3572f9['model']=_[_0x2fa1('0x4a')](db[_0x2fa1('0x62')][_0x2fa1('0x2f')]);_0x3572f9[_0x2fa1('0x33')]=_['keys'](_0xec70d9[_0x2fa1('0x33')]);_0x3572f9[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x3572f9[_0x2fa1('0x32')],_0x3572f9[_0x2fa1('0x33')]);_0x49c8d3[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x3572f9[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x49c8d3[_0x2fa1('0x36')]=_0x49c8d3['attributes'][_0x2fa1('0x38')]?_0x49c8d3[_0x2fa1('0x36')]:_0x3572f9['model'];_0x49c8d3[_0x2fa1('0x3b')]=qs[_0x2fa1('0x5c')](_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x5c')]);_0x49c8d3['where']=qs['filters'](_[_0x2fa1('0x3d')](_0xec70d9[_0x2fa1('0x33')],_0x3572f9[_0x2fa1('0x34')]));if(_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0x49c8d3['where']=_[_0x2fa1('0x3f')](_0x49c8d3[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x49c8d3[_0x2fa1('0x36')],function(_0x28d67b){var _0x2697bd={};_0x2697bd[_0x28d67b]={'$like':'%'+_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x3e')]+'%'};return _0x2697bd;})});}_0x49c8d3=_[_0x2fa1('0x3f')]({},_0x49c8d3,_0xec70d9[_0x2fa1('0x41')]);return _0xd68af4[_0x2fa1('0x63')](_0x49c8d3);}})['then'](function(_0x3f178d){if(_0x3f178d){_0x181772=_0x3f178d['length'];if(!_0xec70d9['query']['hasOwnProperty'](_0x2fa1('0x3a'))){_0x49c8d3[_0x2fa1('0x1f')]=qs['limit'](_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0x49c8d3[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0xec70d9[_0x2fa1('0x33')]['offset']);}return _0xd68af4[_0x2fa1('0x63')](_0x49c8d3);}})[_0x2fa1('0x26')](function(_0x1136da){if(_0x1136da){return _0x1136da?{'count':_0x181772,'rows':_0x1136da}:null;}})['then'](respondWithResult(_0x58f7db,null))[_0x2fa1('0x47')](handleError(_0x58f7db,null));};exports[_0x2fa1('0x64')]=function(_0x514c96,_0x50a1f0,_0x317e71){var _0x112ad6,_0x57d3e0;var _0x1a0a85=[];var _0x1a07b6=moment()['format'](_0x2fa1('0x65'));return db['Campaign'][_0x2fa1('0x4b')]({'where':{'id':_0x514c96[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x50a1f0,null))['then'](function(_0x4b4a98){if(_0x4b4a98){_0x57d3e0=_0x4b4a98;return _0x4b4a98[_0x2fa1('0x64')](_0x514c96[_0x2fa1('0x56')]['ids'],_[_0x2fa1('0x53')](_0x514c96[_0x2fa1('0x56')],[_0x2fa1('0x66'),'id'])||{});}return null;})[_0x2fa1('0x67')](function(_0x4c2f9b){var _0x420fe8;var _0x30fd19;_0x112ad6=_0x4c2f9b||[];var _0xf9d8d1=[];if(_0x4c2f9b){for(var _0x541964=0x0;_0x541964<_0x4c2f9b['length'];_0x541964+=0x1){var _0x227c57=_0x4c2f9b[_0x541964][_0x2fa1('0x27')]({'plain':!![]});_0x57d3e0['dialCheckDuplicateType']=_0x514c96[_0x2fa1('0x56')][_0x2fa1('0x68')]?_0x514c96[_0x2fa1('0x56')]['dialCheckDuplicateType']:_0x57d3e0[_0x2fa1('0x68')];switch(_0x57d3e0[_0x2fa1('0x68')]){case _0x2fa1('0x69'):_0x420fe8=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')]('cm_hopper')[_0x2fa1('0x6c')](['phone',_0x2fa1('0x6d'),_0x2fa1('0x6e'),_0x2fa1('0x6f'),_0x2fa1('0x5a'),'createdAt','updatedAt'],squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')](_0x2fa1('0x72'),'phone')['field'](_0x2fa1('0x73'),'scheduledAt')[_0x2fa1('0x71')]('id',_0x2fa1('0x6e'))[_0x2fa1('0x71')](_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')](),_0x2fa1('0x6f'))[_0x2fa1('0x71')](_0x514c96[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')](),_0x2fa1('0x5a'))['field']('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27','updatedAt')[_0x2fa1('0x76')](_0x2fa1('0x77'))[_0x2fa1('0x3c')](_0x2fa1('0x78'))[_0x2fa1('0x3c')](_0x2fa1('0x79'),_0x227c57['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x2fa1('0x3c')](_0x2fa1('0x7a'),squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')](_0x2fa1('0x7b'))['from']('cm_hopper_final')[_0x2fa1('0x3c')](_0x2fa1('0x7c'),_0x514c96[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')]()))[_0x2fa1('0x3c')](_0x2fa1('0x7a'),squel[_0x2fa1('0x70')]()['field']('COALESCE(phone,\x27\x27)')[_0x2fa1('0x76')](_0x2fa1('0x7d'))[_0x2fa1('0x3c')]('CampaignId\x20=\x20?',_0x514c96[_0x2fa1('0x49')]['id']['toString']())))[_0x2fa1('0x75')]();break;case _0x2fa1('0x7e'):_0x420fe8=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')](_0x2fa1('0x7d'))['fromQuery'](['phone','scheduledAt',_0x2fa1('0x6e'),_0x2fa1('0x6f'),_0x2fa1('0x5a'),'createdAt',_0x2fa1('0x55')],squel[_0x2fa1('0x70')]()['field'](_0x2fa1('0x72'),_0x2fa1('0x72'))[_0x2fa1('0x71')]('NOW()',_0x2fa1('0x6d'))[_0x2fa1('0x71')]('id',_0x2fa1('0x6e'))['field'](_0x227c57[_0x2fa1('0x74')]['toString'](),'ListId')[_0x2fa1('0x71')](_0x514c96['params']['id']['toString'](),_0x2fa1('0x5a'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))['field']('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x55'))['from']('cm_contacts')['where'](_0x2fa1('0x78'))[_0x2fa1('0x3c')](_0x2fa1('0x79'),_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')]())['where'](_0x2fa1('0x7f'))[_0x2fa1('0x3c')](_0x2fa1('0x7a'),squel['select']()[_0x2fa1('0x71')](_0x2fa1('0x80'))['from'](_0x2fa1('0x7d'))[_0x2fa1('0x3c')](_0x2fa1('0x7c'),_0x514c96[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')]())))[_0x2fa1('0x75')]();break;default:_0x420fe8=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')](_0x2fa1('0x7d'))[_0x2fa1('0x6c')]([_0x2fa1('0x72'),'scheduledAt',_0x2fa1('0x6e'),'ListId','CampaignId',_0x2fa1('0x54'),_0x2fa1('0x55')],squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')]('phone',_0x2fa1('0x72'))[_0x2fa1('0x71')](_0x2fa1('0x73'),_0x2fa1('0x6d'))['field']('id',_0x2fa1('0x6e'))[_0x2fa1('0x71')](_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')](),_0x2fa1('0x6f'))[_0x2fa1('0x71')](_0x514c96['params']['id']['toString'](),_0x2fa1('0x5a'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x55'))[_0x2fa1('0x76')](_0x2fa1('0x77'))[_0x2fa1('0x3c')]('deletedAt\x20IS\x20NULL')[_0x2fa1('0x3c')](_0x2fa1('0x79'),_0x227c57[_0x2fa1('0x74')]['toString']())[_0x2fa1('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x2fa1('0x75')]();}_0x30fd19=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')]('cm_hopper_additional_phones')[_0x2fa1('0x6c')]([_0x2fa1('0x81'),_0x2fa1('0x6d'),_0x2fa1('0x72'),_0x2fa1('0x82'),'createdAt',_0x2fa1('0x55')],squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')]('h.id','id')[_0x2fa1('0x71')](_0x2fa1('0x73'),_0x2fa1('0x6d'))[_0x2fa1('0x71')](_0x2fa1('0x83'),_0x2fa1('0x72'))['field'](_0x2fa1('0x84'),'OrderBy')['field']('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27','updatedAt')['from'](_0x2fa1('0x85'),'ci')[_0x2fa1('0x86')](_0x2fa1('0x7d'),'h',_0x2fa1('0x87'))[_0x2fa1('0x3c')]('h.ListId\x20=\x20?',_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')]())['where']('h.CampaignId=?',_0x514c96[_0x2fa1('0x49')]['id']['toString']())[_0x2fa1('0x3c')](_0x2fa1('0x88'),_0x1a07b6))[_0x2fa1('0x75')]();_0xf9d8d1['push'](db['sequelize'][_0x2fa1('0x33')](_0x420fe8));_0x1a0a85['push'](db[_0x2fa1('0x89')][_0x2fa1('0x33')](_0x30fd19));}return BPromise[_0x2fa1('0x8a')](_0xf9d8d1);}})[_0x2fa1('0x26')](function(){return BPromise[_0x2fa1('0x8a')](_0x1a0a85);})[_0x2fa1('0x26')](function(){return _0x112ad6;})[_0x2fa1('0x26')](respondWithResult(_0x50a1f0,null))['catch'](handleError(_0x50a1f0,null));};exports[_0x2fa1('0x8b')]=function(_0x51f490,_0xdabaa9,_0x56a7ae){return db['Campaign'][_0x2fa1('0x4b')]({'where':{'id':_0x51f490[_0x2fa1('0x49')]['id']}})['then'](handleEntityNotFound(_0xdabaa9,null))[_0x2fa1('0x26')](function(_0x3bc618){if(_0x3bc618){return _0x3bc618[_0x2fa1('0x8b')](_0x51f490[_0x2fa1('0x33')][_0x2fa1('0x66')]);}})['then'](function(_0x217644){if(_0x217644){return db[_0x2fa1('0x59')][_0x2fa1('0x29')]({'where':{'ListId':_0x51f490[_0x2fa1('0x33')][_0x2fa1('0x66')],'CampaignId':_0x51f490['params']['id']}})['then'](function(){return _0x217644;});}})[_0x2fa1('0x26')](respondWithStatusCode(_0xdabaa9,null))[_0x2fa1('0x47')](handleError(_0xdabaa9,null));};exports['getBlackLists']=function(_0x2588b9,_0x16aa12,_0x9f0835){var _0x10eb99={};var _0x39a45a={};var _0x398d4e;var _0x1abedd;return db['Campaign'][_0x2fa1('0x58')]({'where':{'id':_0x2588b9[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x16aa12,null))[_0x2fa1('0x26')](function(_0x4bdf1e){if(_0x4bdf1e){_0x398d4e=_0x4bdf1e;_0x39a45a['model']=_['keys'](db['CmList']['rawAttributes']);_0x39a45a[_0x2fa1('0x33')]=_['keys'](_0x2588b9[_0x2fa1('0x33')]);_0x39a45a['filters']=_[_0x2fa1('0x35')](_0x39a45a[_0x2fa1('0x32')],_0x39a45a[_0x2fa1('0x33')]);_0x10eb99[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x39a45a[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x10eb99[_0x2fa1('0x36')]=_0x10eb99[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x10eb99[_0x2fa1('0x36')]:_0x39a45a[_0x2fa1('0x32')];_0x10eb99[_0x2fa1('0x3b')]=qs['sort'](_0x2588b9[_0x2fa1('0x33')]['sort']);_0x10eb99['where']=qs[_0x2fa1('0x34')](_[_0x2fa1('0x3d')](_0x2588b9[_0x2fa1('0x33')],_0x39a45a[_0x2fa1('0x34')]));if(_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0x10eb99[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x10eb99['where'],{'$or':_[_0x2fa1('0x2e')](_0x10eb99[_0x2fa1('0x36')],function(_0x17ae92){var _0x942423={};_0x942423[_0x17ae92]={'$like':'%'+_0x2588b9[_0x2fa1('0x33')]['filter']+'%'};return _0x942423;})});}_0x10eb99=_[_0x2fa1('0x3f')]({},_0x10eb99,_0x2588b9[_0x2fa1('0x41')]);return _0x398d4e[_0x2fa1('0x8c')](_0x10eb99);}})[_0x2fa1('0x26')](function(_0x3eddf0){if(_0x3eddf0){_0x1abedd=_0x3eddf0['length'];if(!_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x10eb99[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0x10eb99[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x2588b9['query']['offset']);}return _0x398d4e['getBlackLists'](_0x10eb99);}})[_0x2fa1('0x26')](function(_0x3fdbf1){if(_0x3fdbf1){return _0x3fdbf1?{'count':_0x1abedd,'rows':_0x3fdbf1}:null;}})[_0x2fa1('0x26')](respondWithResult(_0x16aa12,null))[_0x2fa1('0x47')](handleError(_0x16aa12,null));};exports[_0x2fa1('0x8d')]=function(_0x388317,_0x413113,_0x2770fb){var _0x3e7dfd,_0x35e40b;var _0x53a5c7=[];var _0x10cbfb=moment()[_0x2fa1('0x8e')](_0x2fa1('0x65'));return db[_0x2fa1('0x42')][_0x2fa1('0x4b')]({'where':{'id':_0x388317[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x413113,null))['then'](function(_0x51b9e4){if(_0x51b9e4){_0x35e40b=_0x51b9e4;return _0x51b9e4[_0x2fa1('0x8d')](_0x388317['body']['ids'],_['omit'](_0x388317[_0x2fa1('0x56')],[_0x2fa1('0x66'),'id'])||{});}return null;})['spread'](function(_0x442806){var _0x3365a9;var _0xae739d;_0x3e7dfd=_0x442806||[];var _0x17fcaf=[];if(_0x442806){for(var _0xe3fa13=0x0;_0xe3fa13<_0x442806[_0x2fa1('0x38')];_0xe3fa13+=0x1){var _0x431f49=_0x442806[_0xe3fa13][_0x2fa1('0x27')]({'plain':!![]});_0x3365a9=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')]('cm_hopper_black')[_0x2fa1('0x6c')]([_0x2fa1('0x72'),'ContactId',_0x2fa1('0x6f'),_0x2fa1('0x5a'),_0x2fa1('0x54'),_0x2fa1('0x55')],squel['select']()[_0x2fa1('0x71')](_0x2fa1('0x72'),_0x2fa1('0x72'))['field']('id','ContactId')['field'](_0x431f49[_0x2fa1('0x74')][_0x2fa1('0x75')](),_0x2fa1('0x6f'))['field'](_0x388317[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')](),_0x2fa1('0x5a'))[_0x2fa1('0x71')](_0x2fa1('0x73'),'createdAt')[_0x2fa1('0x71')](_0x2fa1('0x73'),_0x2fa1('0x55'))[_0x2fa1('0x76')](_0x2fa1('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0x2fa1('0x3c')]('ListId\x20=\x20?',_0x431f49[_0x2fa1('0x74')][_0x2fa1('0x75')]())[_0x2fa1('0x3c')](_0x2fa1('0x7f')))[_0x2fa1('0x75')]();_0x17fcaf[_0x2fa1('0x8f')](db[_0x2fa1('0x89')][_0x2fa1('0x33')](_0x3365a9));}return BPromise[_0x2fa1('0x8a')](_0x17fcaf);}})['then'](function(){return _0x3e7dfd;})[_0x2fa1('0x26')](respondWithResult(_0x413113,null))[_0x2fa1('0x47')](handleError(_0x413113,null));};exports['removeBlackLists']=function(_0x5e1947,_0x2f19c6,_0x379950){return db[_0x2fa1('0x42')]['find']({'where':{'id':_0x5e1947[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x2f19c6,null))['then'](function(_0x3b7a83){if(_0x3b7a83){return _0x3b7a83['removeBlackLists'](_0x5e1947[_0x2fa1('0x33')]['ids']);}})['then'](function(_0x10c626){if(_0x10c626){return db[_0x2fa1('0x61')]['destroy']({'where':{'ListId':_0x5e1947[_0x2fa1('0x33')][_0x2fa1('0x66')],'CampaignId':_0x5e1947[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](function(){return _0x10c626;});}})[_0x2fa1('0x26')](respondWithStatusCode(_0x2f19c6,null))[_0x2fa1('0x47')](handleError(_0x2f19c6,null));}; \ No newline at end of file +var _0x6f3e=['h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','getHoppers','findOne','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','format','ids','spread','dialCheckDuplicateType','insert','cm_hopper','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','fromQuery','cm_contacts','phone\x20NOT\x20IN\x20(?)','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','join'];(function(_0x1d49a6,_0x2f073f){var _0x4e3cff=function(_0x4fa2c6){while(--_0x4fa2c6){_0x1d49a6['push'](_0x1d49a6['shift']());}};_0x4e3cff(++_0x2f073f);}(_0x6f3e,0x9f));var _0xe6f3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6f3e[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xe6f3('0x0'));var rimraf=require(_0xe6f3('0x1'));var zipdir=require(_0xe6f3('0x2'));var jsonpatch=require(_0xe6f3('0x3'));var rp=require(_0xe6f3('0x4'));var moment=require(_0xe6f3('0x5'));var BPromise=require(_0xe6f3('0x6'));var Mustache=require('mustache');var util=require(_0xe6f3('0x7'));var path=require(_0xe6f3('0x8'));var sox=require('sox');var csv=require(_0xe6f3('0x9'));var ejs=require(_0xe6f3('0xa'));var fs=require('fs');var fs_extra=require(_0xe6f3('0xb'));var _=require('lodash');var squel=require(_0xe6f3('0xc'));var crypto=require(_0xe6f3('0xd'));var jsforce=require(_0xe6f3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe6f3('0x9'));var querystring=require('querystring');var Papa=require(_0xe6f3('0xf'));var Redis=require(_0xe6f3('0x10'));var authService=require(_0xe6f3('0x11'));var qs=require(_0xe6f3('0x12'));var as=require(_0xe6f3('0x13'));var hardwareService=require(_0xe6f3('0x14'));var logger=require('../../config/logger')(_0xe6f3('0x15'));var utils=require('../../config/utils');var config=require(_0xe6f3('0x16'));var licenseUtil=require(_0xe6f3('0x17'));var db=require(_0xe6f3('0x18'))['db'];function respondWithStatusCode(_0x1cca90,_0x563a20){_0x563a20=_0x563a20||0xcc;return function(_0x15d740){if(_0x15d740){return _0x1cca90[_0xe6f3('0x19')](_0x563a20);}return _0x1cca90[_0xe6f3('0x1a')](_0x563a20)[_0xe6f3('0x1b')]();};}function respondWithResult(_0x7c2664,_0x2f8885){_0x2f8885=_0x2f8885||0xc8;return function(_0x26f4a7){if(_0x26f4a7){return _0x7c2664['status'](_0x2f8885)[_0xe6f3('0x1c')](_0x26f4a7);}};}function respondWithFilteredResult(_0x1e8dcd,_0x31e0a1){return function(_0x34a730){if(_0x34a730){var _0x1706a9=typeof _0x31e0a1['offset']==='undefined'&&typeof _0x31e0a1[_0xe6f3('0x1d')]===_0xe6f3('0x1e');var _0x22dcf7=_0x34a730['count'];var _0x39d6be=_0x1706a9?0x0:_0x31e0a1[_0xe6f3('0x1f')];var _0x1aa839=_0x1706a9?_0x34a730[_0xe6f3('0x20')]:_0x31e0a1[_0xe6f3('0x1f')]+_0x31e0a1['limit'];var _0x537568;if(_0x1aa839>=_0x22dcf7){_0x1aa839=_0x22dcf7;_0x537568=0xc8;}else{_0x537568=0xce;}_0x1e8dcd['status'](_0x537568);return _0x1e8dcd[_0xe6f3('0x21')](_0xe6f3('0x22'),_0x39d6be+'-'+_0x1aa839+'/'+_0x22dcf7)[_0xe6f3('0x1c')](_0x34a730);}return null;};}function patchUpdates(_0x398a6b){return function(_0x14dd0e){try{jsonpatch[_0xe6f3('0x23')](_0x14dd0e,_0x398a6b,!![]);}catch(_0x47f69b){return BPromise[_0xe6f3('0x24')](_0x47f69b);}return _0x14dd0e[_0xe6f3('0x25')]();};}function saveUpdates(_0x37041b,_0x1405bd){return function(_0x43c0d5){if(_0x43c0d5){return _0x43c0d5[_0xe6f3('0x26')](_0x37041b)[_0xe6f3('0x27')](function(_0x4d75d3){return _0x4d75d3;});}return null;};}function removeEntity(_0x4b1bf2,_0x88ed03){return function(_0x3989c5){if(_0x3989c5){return _0x3989c5[_0xe6f3('0x28')]()[_0xe6f3('0x27')](function(){var _0x617847=_0x3989c5[_0xe6f3('0x29')]({'plain':!![]});var _0x5b1a12=_0xe6f3('0x2a');return db[_0xe6f3('0x2b')][_0xe6f3('0x28')]({'where':{'type':_0x5b1a12,'resourceId':_0x617847['id']}})[_0xe6f3('0x27')](function(){return _0x3989c5;});})['then'](function(){_0x4b1bf2['status'](0xcc)[_0xe6f3('0x1b')]();});}};}function handleEntityNotFound(_0x3eef65,_0x482cef){return function(_0x5e5f44){if(!_0x5e5f44){_0x3eef65[_0xe6f3('0x19')](0x194);}return _0x5e5f44;};}function handleError(_0x19691c,_0x37a5a5){_0x37a5a5=_0x37a5a5||0x1f4;return function(_0x4627de){logger[_0xe6f3('0x2c')](_0x4627de[_0xe6f3('0x2d')]);if(_0x4627de[_0xe6f3('0x2e')]){delete _0x4627de['name'];}_0x19691c[_0xe6f3('0x1a')](_0x37a5a5)['send'](_0x4627de);};}exports[_0xe6f3('0x2f')]=function(_0x104677,_0x473064){var _0x5c8494={},_0x34ad3c={},_0x5163e0={'count':0x0,'rows':[]};var _0x359c2d=_[_0xe6f3('0x30')](db[_0xe6f3('0x31')][_0xe6f3('0x32')],function(_0x498a16){return{'name':_0x498a16[_0xe6f3('0x33')],'type':_0x498a16[_0xe6f3('0x34')]['key']};});_0x34ad3c[_0xe6f3('0x35')]=_[_0xe6f3('0x30')](_0x359c2d,_0xe6f3('0x2e'));_0x34ad3c[_0xe6f3('0x36')]=_[_0xe6f3('0x37')](_0x104677[_0xe6f3('0x36')]);_0x34ad3c[_0xe6f3('0x38')]=_['intersection'](_0x34ad3c[_0xe6f3('0x35')],_0x34ad3c[_0xe6f3('0x36')]);_0x5c8494[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x34ad3c['model'],qs[_0xe6f3('0x3b')](_0x104677[_0xe6f3('0x36')]['fields']));_0x5c8494['attributes']=_0x5c8494[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x5c8494[_0xe6f3('0x39')]:_0x34ad3c[_0xe6f3('0x35')];if(!_0x104677['query'][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0x5c8494['limit']=qs['limit'](_0x104677[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0x5c8494[_0xe6f3('0x1f')]=qs[_0xe6f3('0x1f')](_0x104677[_0xe6f3('0x36')]['offset']);}_0x5c8494[_0xe6f3('0x3f')]=qs[_0xe6f3('0x40')](_0x104677[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x5c8494['where']=qs[_0xe6f3('0x38')](_['pick'](_0x104677[_0xe6f3('0x36')],_0x34ad3c[_0xe6f3('0x38')]),_0x359c2d);if(_0x104677[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0x5c8494['where']=_['merge'](_0x5c8494[_0xe6f3('0x42')],{'$or':_[_0xe6f3('0x30')](_0x359c2d,function(_0x30a160){if(_0x30a160[_0xe6f3('0x34')]!==_0xe6f3('0x43')){var _0x51bd3f={};_0x51bd3f[_0x30a160[_0xe6f3('0x2e')]]={'$like':'%'+_0x104677[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x51bd3f;}})});}_0x5c8494=_[_0xe6f3('0x44')]({},_0x5c8494,_0x104677[_0xe6f3('0x45')]);var _0x1badac={'where':_0x5c8494['where']};return db[_0xe6f3('0x31')][_0xe6f3('0x20')](_0x1badac)['then'](function(_0x2e5108){_0x5163e0[_0xe6f3('0x20')]=_0x2e5108;if(_0x104677[_0xe6f3('0x36')][_0xe6f3('0x46')]){_0x5c8494[_0xe6f3('0x47')]=[{'all':!![]}];}return db[_0xe6f3('0x31')][_0xe6f3('0x48')](_0x5c8494);})[_0xe6f3('0x27')](function(_0x25f946){_0x5163e0[_0xe6f3('0x49')]=_0x25f946;return _0x5163e0;})[_0xe6f3('0x27')](respondWithFilteredResult(_0x473064,_0x5c8494))[_0xe6f3('0x4a')](handleError(_0x473064,null));};exports[_0xe6f3('0x4b')]=function(_0x21f142,_0x24ce66){var _0x127583={'raw':![],'where':{'id':_0x21f142[_0xe6f3('0x4c')]['id']}},_0x2fde49={};_0x2fde49[_0xe6f3('0x35')]=_[_0xe6f3('0x37')](db[_0xe6f3('0x31')][_0xe6f3('0x32')]);_0x2fde49['query']=_[_0xe6f3('0x37')](_0x21f142[_0xe6f3('0x36')]);_0x2fde49[_0xe6f3('0x38')]=_['intersection'](_0x2fde49[_0xe6f3('0x35')],_0x2fde49[_0xe6f3('0x36')]);_0x127583[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x2fde49[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x21f142['query'][_0xe6f3('0x3b')]));_0x127583[_0xe6f3('0x39')]=_0x127583[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x127583[_0xe6f3('0x39')]:_0x2fde49['model'];if(_0x21f142['query']['includeAll']){_0x127583['include']=[{'all':!![]}];}_0x127583=_[_0xe6f3('0x44')]({},_0x127583,_0x21f142[_0xe6f3('0x45')]);return db[_0xe6f3('0x31')][_0xe6f3('0x4d')](_0x127583)[_0xe6f3('0x27')](handleEntityNotFound(_0x24ce66,null))['then'](respondWithResult(_0x24ce66,null))[_0xe6f3('0x4a')](handleError(_0x24ce66,null));};exports[_0xe6f3('0x4e')]=function(_0x33e3a9,_0x19e0c7){return db['Campaign'][_0xe6f3('0x4e')](_0x33e3a9[_0xe6f3('0x4f')],{})[_0xe6f3('0x27')](function(_0xc305e3){var _0xcfc2c=_0x33e3a9['user']['get']({'plain':!![]});if(!_0xcfc2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcfc2c[_0xe6f3('0x50')]==='user'){var _0x392ec6=_0xc305e3[_0xe6f3('0x29')]({'plain':!![]});var _0x473adf=_0xe6f3('0x2a');return db[_0xe6f3('0x51')][_0xe6f3('0x4d')]({'where':{'name':_0x473adf,'userProfileId':_0xcfc2c[_0xe6f3('0x52')]},'raw':!![]})[_0xe6f3('0x27')](function(_0x358d5b){if(_0x358d5b&&_0x358d5b[_0xe6f3('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x392ec6[_0xe6f3('0x2e')],'resourceId':_0x392ec6['id'],'type':_0x358d5b[_0xe6f3('0x2e')],'sectionId':_0x358d5b['id']},{})[_0xe6f3('0x27')](function(){return _0xc305e3;});}else{return _0xc305e3;}})[_0xe6f3('0x4a')](function(_0x5ec345){logger[_0xe6f3('0x2c')](_0xe6f3('0x54'),_0x5ec345);throw _0x5ec345;});}return _0xc305e3;})['then'](respondWithResult(_0x19e0c7,0xc9))[_0xe6f3('0x4a')](handleError(_0x19e0c7,null));};exports[_0xe6f3('0x55')]=function(_0x20fa56,_0x11df4f){var _0x47fe00={'where':{'id':_0x20fa56['params']['id']}},_0xe23956={};_0xe23956[_0xe6f3('0x35')]=_['keys'](db[_0xe6f3('0x31')][_0xe6f3('0x32')]);_0x47fe00[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0xe23956[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x20fa56[_0xe6f3('0x36')][_0xe6f3('0x3b')]));_0x47fe00[_0xe6f3('0x39')]=_0x47fe00[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x47fe00[_0xe6f3('0x39')]:_0xe23956[_0xe6f3('0x35')];if(_0x20fa56[_0xe6f3('0x36')]['includeAll']){_0x47fe00['include']=[{'all':!![]}];}_0x47fe00=_[_0xe6f3('0x44')]({},_0x47fe00,_0x20fa56[_0xe6f3('0x45')]);return db['Campaign'][_0xe6f3('0x4d')](_0x47fe00)[_0xe6f3('0x27')](handleEntityNotFound(_0x11df4f,null))['then'](function(_0x52e8af){if(_0x52e8af){var _0x5af456=_0x52e8af[_0xe6f3('0x29')]({'plain':!![]});_0x5af456=qs[_0xe6f3('0x56')](_0x5af456,['id',_0xe6f3('0x57'),_0xe6f3('0x58')]);_0x20fa56[_0xe6f3('0x4f')]=_['omit'](_0x20fa56[_0xe6f3('0x4f')],['id',_0xe6f3('0x57'),_0xe6f3('0x58')]);return db[_0xe6f3('0x31')][_0xe6f3('0x4e')](_[_0xe6f3('0x44')](_0x5af456,_0x20fa56[_0xe6f3('0x4f')]),{'include':_0x20fa56[_0xe6f3('0x36')][_0xe6f3('0x46')]?[{'all':!![]}]:undefined})[_0xe6f3('0x27')](function(_0x1024d0){var _0x15e297=_0x20fa56[_0xe6f3('0x59')][_0xe6f3('0x29')]({'plain':!![]});if(!_0x15e297)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15e297[_0xe6f3('0x50')]===_0xe6f3('0x59')){var _0x2ded8e=_0x1024d0[_0xe6f3('0x29')]({'plain':!![]});var _0x2900b2=_0xe6f3('0x2a');return db[_0xe6f3('0x51')]['find']({'where':{'name':_0x2900b2,'userProfileId':_0x15e297[_0xe6f3('0x52')]},'raw':!![]})[_0xe6f3('0x27')](function(_0x3cb9de){if(_0x3cb9de&&_0x3cb9de[_0xe6f3('0x53')]===0x0){return db[_0xe6f3('0x2b')][_0xe6f3('0x4e')]({'name':_0x2ded8e['name'],'resourceId':_0x2ded8e['id'],'type':_0x3cb9de[_0xe6f3('0x2e')],'sectionId':_0x3cb9de['id']},{})[_0xe6f3('0x27')](function(){return _0x1024d0;});}else{return _0x1024d0;}})[_0xe6f3('0x4a')](function(_0x1cf8ae){logger[_0xe6f3('0x2c')](_0xe6f3('0x54'),_0x1cf8ae);throw _0x1cf8ae;});}return _0x1024d0;});}})['then'](respondWithResult(_0x11df4f,0xc9))[_0xe6f3('0x4a')](handleError(_0x11df4f,null));};exports[_0xe6f3('0x26')]=function(_0x171950,_0xc37282){if(_0x171950[_0xe6f3('0x4f')]['id']){delete _0x171950['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x171950[_0xe6f3('0x4c')]['id']}})['then'](handleEntityNotFound(_0xc37282,null))[_0xe6f3('0x27')](saveUpdates(_0x171950[_0xe6f3('0x4f')],null))[_0xe6f3('0x27')](respondWithResult(_0xc37282,null))[_0xe6f3('0x4a')](handleError(_0xc37282,null));};exports[_0xe6f3('0x28')]=function(_0x1caf9b,_0x48b8d1){return db[_0xe6f3('0x31')]['find']({'where':{'id':_0x1caf9b['params']['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x48b8d1,null))[_0xe6f3('0x27')](removeEntity(_0x48b8d1,null))[_0xe6f3('0x4a')](handleError(_0x48b8d1,null));};exports[_0xe6f3('0x5a')]=function(_0x24bd75,_0x2807bf,_0x24dbd2){var _0x29428b={'raw':!![],'where':{}};var _0x5e825c={};var _0x38c1c4={'count':0x0,'rows':[]};return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x24bd75[_0xe6f3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2807bf,null))[_0xe6f3('0x27')](function(_0x4875e9){if(_0x4875e9){_0x5e825c[_0xe6f3('0x35')]=_['keys'](db['CmHopper'][_0xe6f3('0x32')]);_0x5e825c[_0xe6f3('0x36')]=_['keys'](_0x24bd75['query']);_0x5e825c[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x5e825c[_0xe6f3('0x35')],_0x5e825c['query']);_0x29428b[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x5e825c['model'],qs['fields'](_0x24bd75[_0xe6f3('0x36')][_0xe6f3('0x3b')]));_0x29428b[_0xe6f3('0x39')]=_0x29428b[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x29428b['attributes']:_0x5e825c[_0xe6f3('0x35')];if(!_0x24bd75['query'][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0x29428b[_0xe6f3('0x1d')]=qs[_0xe6f3('0x1d')](_0x24bd75[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0x29428b['offset']=qs[_0xe6f3('0x1f')](_0x24bd75[_0xe6f3('0x36')]['offset']);}_0x29428b[_0xe6f3('0x3f')]=qs[_0xe6f3('0x40')](_0x24bd75[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x29428b[_0xe6f3('0x42')]=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x24bd75[_0xe6f3('0x36')],_0x5e825c[_0xe6f3('0x38')]));_0x29428b[_0xe6f3('0x42')][_0xe6f3('0x5d')]=_0x4875e9['id'];if(_0x24bd75[_0xe6f3('0x36')]['filter']){_0x29428b[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x29428b['where'],{'$or':_['map'](_0x29428b[_0xe6f3('0x39')],function(_0x30d5f7){var _0x799399={};_0x799399[_0x30d5f7]={'$like':'%'+_0x24bd75[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x799399;})});}_0x29428b=_[_0xe6f3('0x44')]({},_0x29428b,_0x24bd75['options']);return db[_0xe6f3('0x5e')][_0xe6f3('0x20')]({'where':_0x29428b[_0xe6f3('0x42')]})[_0xe6f3('0x27')](function(_0x3e18fa){_0x38c1c4[_0xe6f3('0x20')]=_0x3e18fa;if(_0x24bd75['query'][_0xe6f3('0x46')]){_0x29428b[_0xe6f3('0x47')]=[{'all':!![]}];}return db['CmHopper'][_0xe6f3('0x48')](_0x29428b);})['then'](function(_0x2b22a0){_0x38c1c4['rows']=_0x2b22a0;return _0x38c1c4;});}})[_0xe6f3('0x27')](respondWithFilteredResult(_0x2807bf,_0x29428b))[_0xe6f3('0x4a')](handleError(_0x2807bf,null));};exports[_0xe6f3('0x5f')]=function(_0x221bd9,_0x11d640,_0x229477){var _0x53eb94={'raw':!![],'where':{}};var _0x13212f={};var _0x4e533a={'count':0x0,'rows':[]};return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x221bd9[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x11d640,null))[_0xe6f3('0x27')](function(_0x13f260){if(_0x13f260){_0x13212f[_0xe6f3('0x35')]=_['keys'](db[_0xe6f3('0x60')][_0xe6f3('0x32')]);_0x13212f[_0xe6f3('0x36')]=_['keys'](_0x221bd9['query']);_0x13212f[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x13212f[_0xe6f3('0x35')],_0x13212f['query']);_0x53eb94[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x13212f[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x221bd9[_0xe6f3('0x36')]['fields']));_0x53eb94[_0xe6f3('0x39')]=_0x53eb94[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x53eb94['attributes']:_0x13212f[_0xe6f3('0x35')];if(!_0x221bd9[_0xe6f3('0x36')]['hasOwnProperty']('nolimit')){_0x53eb94[_0xe6f3('0x1d')]=qs['limit'](_0x221bd9[_0xe6f3('0x36')]['limit']);_0x53eb94['offset']=qs['offset'](_0x221bd9['query'][_0xe6f3('0x1f')]);}_0x53eb94[_0xe6f3('0x3f')]=qs['sort'](_0x221bd9[_0xe6f3('0x36')]['sort']);_0x53eb94[_0xe6f3('0x42')]=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x221bd9[_0xe6f3('0x36')],_0x13212f[_0xe6f3('0x38')]));_0x53eb94[_0xe6f3('0x42')]['CampaignId']=_0x13f260['id'];if(_0x221bd9[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0x53eb94[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x53eb94[_0xe6f3('0x42')],{'$or':_[_0xe6f3('0x30')](_0x53eb94['attributes'],function(_0x596b21){var _0x32929b={};_0x32929b[_0x596b21]={'$like':'%'+_0x221bd9[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x32929b;})});}_0x53eb94=_['merge']({},_0x53eb94,_0x221bd9['options']);return db['CmHopperHistory'][_0xe6f3('0x20')]({'where':_0x53eb94[_0xe6f3('0x42')]})[_0xe6f3('0x27')](function(_0x845b5c){_0x4e533a[_0xe6f3('0x20')]=_0x845b5c;if(_0x221bd9[_0xe6f3('0x36')][_0xe6f3('0x46')]){_0x53eb94['include']=[{'all':!![]}];}return db[_0xe6f3('0x60')][_0xe6f3('0x48')](_0x53eb94);})['then'](function(_0x5ab162){_0x4e533a[_0xe6f3('0x49')]=_0x5ab162;return _0x4e533a;});}})[_0xe6f3('0x27')](respondWithFilteredResult(_0x11d640,_0x53eb94))[_0xe6f3('0x4a')](handleError(_0x11d640,null));};exports[_0xe6f3('0x61')]=function(_0x103b1e,_0x5447d5,_0x34bdad){var _0x3682ca={'raw':!![],'where':{}};var _0x32bce8={};var _0x58202c={'count':0x0,'rows':[]};return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x103b1e[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x5447d5,null))[_0xe6f3('0x27')](function(_0x4ab738){if(_0x4ab738){_0x32bce8[_0xe6f3('0x35')]=_[_0xe6f3('0x37')](db[_0xe6f3('0x62')][_0xe6f3('0x32')]);_0x32bce8['query']=_[_0xe6f3('0x37')](_0x103b1e[_0xe6f3('0x36')]);_0x32bce8['filters']=_[_0xe6f3('0x3a')](_0x32bce8[_0xe6f3('0x35')],_0x32bce8[_0xe6f3('0x36')]);_0x3682ca[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x32bce8[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x3b')]));_0x3682ca['attributes']=_0x3682ca[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x3682ca[_0xe6f3('0x39')]:_0x32bce8['model'];if(!_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0x3682ca['limit']=qs['limit'](_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0x3682ca[_0xe6f3('0x1f')]=qs[_0xe6f3('0x1f')](_0x103b1e['query'][_0xe6f3('0x1f')]);}_0x3682ca[_0xe6f3('0x3f')]=qs['sort'](_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x3682ca[_0xe6f3('0x42')]=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x103b1e[_0xe6f3('0x36')],_0x32bce8[_0xe6f3('0x38')]));_0x3682ca['where'][_0xe6f3('0x5d')]=_0x4ab738['id'];if(_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0x3682ca[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x3682ca['where'],{'$or':_[_0xe6f3('0x30')](_0x3682ca['attributes'],function(_0xbf614b){var _0x36be9d={};_0x36be9d[_0xbf614b]={'$like':'%'+_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x36be9d;})});}_0x3682ca=_[_0xe6f3('0x44')]({},_0x3682ca,_0x103b1e[_0xe6f3('0x45')]);return db[_0xe6f3('0x62')]['count']({'where':_0x3682ca['where']})[_0xe6f3('0x27')](function(_0x3264af){_0x58202c[_0xe6f3('0x20')]=_0x3264af;if(_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x46')]){_0x3682ca['include']=[{'all':!![]}];}return db[_0xe6f3('0x62')][_0xe6f3('0x48')](_0x3682ca);})[_0xe6f3('0x27')](function(_0x347f39){_0x58202c['rows']=_0x347f39;return _0x58202c;});}})['then'](respondWithFilteredResult(_0x5447d5,_0x3682ca))['catch'](handleError(_0x5447d5,null));};exports['getHopperBlacks']=function(_0x5d1470,_0x423088,_0x46ae4a){var _0xf8052c={'raw':!![],'where':{}};var _0x547fa2={};var _0x1eb4b3={'count':0x0,'rows':[]};return db['Campaign'][_0xe6f3('0x5b')]({'where':{'id':_0x5d1470['params']['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x423088,null))[_0xe6f3('0x27')](function(_0x2d8b5b){if(_0x2d8b5b){_0x547fa2[_0xe6f3('0x35')]=_['keys'](db[_0xe6f3('0x63')][_0xe6f3('0x32')]);_0x547fa2[_0xe6f3('0x36')]=_[_0xe6f3('0x37')](_0x5d1470[_0xe6f3('0x36')]);_0x547fa2[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x547fa2[_0xe6f3('0x35')],_0x547fa2[_0xe6f3('0x36')]);_0xf8052c[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x547fa2[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x5d1470[_0xe6f3('0x36')]['fields']));_0xf8052c['attributes']=_0xf8052c['attributes'][_0xe6f3('0x3c')]?_0xf8052c[_0xe6f3('0x39')]:_0x547fa2[_0xe6f3('0x35')];if(!_0x5d1470[_0xe6f3('0x36')][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0xf8052c[_0xe6f3('0x1d')]=qs[_0xe6f3('0x1d')](_0x5d1470[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0xf8052c[_0xe6f3('0x1f')]=qs['offset'](_0x5d1470['query'][_0xe6f3('0x1f')]);}_0xf8052c['order']=qs['sort'](_0x5d1470[_0xe6f3('0x36')]['sort']);_0xf8052c['where']=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x5d1470['query'],_0x547fa2[_0xe6f3('0x38')]));_0xf8052c[_0xe6f3('0x42')]['CampaignId']=_0x2d8b5b['id'];if(_0x5d1470[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0xf8052c[_0xe6f3('0x42')]=_['merge'](_0xf8052c[_0xe6f3('0x42')],{'$or':_['map'](_0xf8052c[_0xe6f3('0x39')],function(_0x13a6b4){var _0x8a722d={};_0x8a722d[_0x13a6b4]={'$like':'%'+_0x5d1470['query'][_0xe6f3('0x41')]+'%'};return _0x8a722d;})});}_0xf8052c=_[_0xe6f3('0x44')]({},_0xf8052c,_0x5d1470[_0xe6f3('0x45')]);return db[_0xe6f3('0x63')][_0xe6f3('0x20')]({'where':_0xf8052c[_0xe6f3('0x42')]})[_0xe6f3('0x27')](function(_0x3fea28){_0x1eb4b3['count']=_0x3fea28;if(_0x5d1470['query']['includeAll']){_0xf8052c[_0xe6f3('0x47')]=[{'all':!![]}];}return db[_0xe6f3('0x63')][_0xe6f3('0x48')](_0xf8052c);})[_0xe6f3('0x27')](function(_0xa2bb66){_0x1eb4b3[_0xe6f3('0x49')]=_0xa2bb66;return _0x1eb4b3;});}})[_0xe6f3('0x27')](respondWithFilteredResult(_0x423088,_0xf8052c))[_0xe6f3('0x4a')](handleError(_0x423088,null));};exports['getLists']=function(_0x13ae5b,_0x10eb2b,_0x54e719){var _0x354f1e={};var _0x5f528a={};var _0x3c79e5;var _0x4f4c1f;return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x13ae5b[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x10eb2b,null))[_0xe6f3('0x27')](function(_0x3cb4f4){if(_0x3cb4f4){_0x3c79e5=_0x3cb4f4;_0x5f528a[_0xe6f3('0x35')]=_[_0xe6f3('0x37')](db['CmList'][_0xe6f3('0x32')]);_0x5f528a['query']=_[_0xe6f3('0x37')](_0x13ae5b[_0xe6f3('0x36')]);_0x5f528a[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x5f528a[_0xe6f3('0x35')],_0x5f528a[_0xe6f3('0x36')]);_0x354f1e[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x5f528a[_0xe6f3('0x35')],qs['fields'](_0x13ae5b[_0xe6f3('0x36')]['fields']));_0x354f1e[_0xe6f3('0x39')]=_0x354f1e[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x354f1e['attributes']:_0x5f528a[_0xe6f3('0x35')];_0x354f1e[_0xe6f3('0x3f')]=qs[_0xe6f3('0x40')](_0x13ae5b[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x354f1e[_0xe6f3('0x42')]=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x13ae5b[_0xe6f3('0x36')],_0x5f528a[_0xe6f3('0x38')]));if(_0x13ae5b[_0xe6f3('0x36')]['filter']){_0x354f1e[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x354f1e['where'],{'$or':_[_0xe6f3('0x30')](_0x354f1e[_0xe6f3('0x39')],function(_0xe04f93){var _0x30e569={};_0x30e569[_0xe04f93]={'$like':'%'+_0x13ae5b[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x30e569;})});}_0x354f1e=_[_0xe6f3('0x44')]({},_0x354f1e,_0x13ae5b[_0xe6f3('0x45')]);return _0x3c79e5[_0xe6f3('0x64')](_0x354f1e);}})[_0xe6f3('0x27')](function(_0x5479bd){if(_0x5479bd){_0x4f4c1f=_0x5479bd[_0xe6f3('0x3c')];if(!_0x13ae5b[_0xe6f3('0x36')][_0xe6f3('0x3d')]('nolimit')){_0x354f1e[_0xe6f3('0x1d')]=qs[_0xe6f3('0x1d')](_0x13ae5b[_0xe6f3('0x36')]['limit']);_0x354f1e['offset']=qs[_0xe6f3('0x1f')](_0x13ae5b[_0xe6f3('0x36')][_0xe6f3('0x1f')]);}return _0x3c79e5['getLists'](_0x354f1e);}})[_0xe6f3('0x27')](function(_0x1a9cdc){if(_0x1a9cdc){return _0x1a9cdc?{'count':_0x4f4c1f,'rows':_0x1a9cdc}:null;}})[_0xe6f3('0x27')](respondWithResult(_0x10eb2b,null))[_0xe6f3('0x4a')](handleError(_0x10eb2b,null));};exports['addLists']=function(_0x69990a,_0x817aa2,_0x54963a){var _0x20e015,_0x4bb525;var _0x123626=[];var _0x25224a=moment()[_0xe6f3('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xe6f3('0x31')][_0xe6f3('0x4d')]({'where':{'id':_0x69990a[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x817aa2,null))[_0xe6f3('0x27')](function(_0x5cb788){if(_0x5cb788){_0x4bb525=_0x5cb788;return _0x5cb788['addLists'](_0x69990a[_0xe6f3('0x4f')][_0xe6f3('0x66')],_[_0xe6f3('0x56')](_0x69990a[_0xe6f3('0x4f')],[_0xe6f3('0x66'),'id'])||{});}return null;})[_0xe6f3('0x67')](function(_0x3ca584){var _0xe73186;var _0x157b70;_0x20e015=_0x3ca584||[];var _0x2557c4=[];if(_0x3ca584){for(var _0x2fb222=0x0;_0x2fb222<_0x3ca584[_0xe6f3('0x3c')];_0x2fb222+=0x1){var _0x5333c7=_0x3ca584[_0x2fb222]['get']({'plain':!![]});_0x4bb525[_0xe6f3('0x68')]=_0x69990a[_0xe6f3('0x4f')]['dialCheckDuplicateType']?_0x69990a[_0xe6f3('0x4f')]['dialCheckDuplicateType']:_0x4bb525[_0xe6f3('0x68')];switch(_0x4bb525[_0xe6f3('0x68')]){case'always':_0xe73186=squel[_0xe6f3('0x69')]()['into'](_0xe6f3('0x6a'))['fromQuery']([_0xe6f3('0x6b'),_0xe6f3('0x6c'),_0xe6f3('0x6d'),_0xe6f3('0x6e'),_0xe6f3('0x5d'),_0xe6f3('0x57'),_0xe6f3('0x58')],squel['select']()[_0xe6f3('0x6f')]('phone',_0xe6f3('0x6b'))['field'](_0xe6f3('0x70'),_0xe6f3('0x6c'))['field']('id',_0xe6f3('0x6d'))['field'](_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')](),_0xe6f3('0x6e'))[_0xe6f3('0x6f')](_0x69990a[_0xe6f3('0x4c')]['id']['toString'](),_0xe6f3('0x5d'))[_0xe6f3('0x6f')]('\x27'+_0x25224a+'\x27',_0xe6f3('0x57'))[_0xe6f3('0x6f')]('\x27'+_0x25224a+'\x27','updatedAt')[_0xe6f3('0x73')]('cm_contacts')[_0xe6f3('0x42')](_0xe6f3('0x74'))['where'](_0xe6f3('0x75'),_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x76'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')](_0xe6f3('0x78'))[_0xe6f3('0x73')](_0xe6f3('0x79'))[_0xe6f3('0x42')](_0xe6f3('0x7a'),_0x69990a[_0xe6f3('0x4c')]['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xe6f3('0x77')]()['field'](_0xe6f3('0x7b'))[_0xe6f3('0x73')](_0xe6f3('0x6a'))[_0xe6f3('0x42')](_0xe6f3('0x7a'),_0x69990a[_0xe6f3('0x4c')]['id'][_0xe6f3('0x72')]())))['toString']();break;case'onlyIfOpen':_0xe73186=squel[_0xe6f3('0x69')]()['into'](_0xe6f3('0x6a'))[_0xe6f3('0x7c')]([_0xe6f3('0x6b'),'scheduledAt','ContactId',_0xe6f3('0x6e'),'CampaignId',_0xe6f3('0x57'),'updatedAt'],squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')](_0xe6f3('0x6b'),_0xe6f3('0x6b'))[_0xe6f3('0x6f')]('NOW()',_0xe6f3('0x6c'))['field']('id',_0xe6f3('0x6d'))[_0xe6f3('0x6f')](_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')](),'ListId')[_0xe6f3('0x6f')](_0x69990a['params']['id']['toString'](),_0xe6f3('0x5d'))['field']('\x27'+_0x25224a+'\x27',_0xe6f3('0x57'))[_0xe6f3('0x6f')]('\x27'+_0x25224a+'\x27',_0xe6f3('0x58'))[_0xe6f3('0x73')](_0xe6f3('0x7d'))['where'](_0xe6f3('0x74'))['where'](_0xe6f3('0x75'),_0x5333c7['CmListId'][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x76'))[_0xe6f3('0x42')](_0xe6f3('0x7e'),squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')](_0xe6f3('0x7b'))[_0xe6f3('0x73')](_0xe6f3('0x6a'))['where']('CampaignId\x20=\x20?',_0x69990a[_0xe6f3('0x4c')]['id'][_0xe6f3('0x72')]())))['toString']();break;default:_0xe73186=squel[_0xe6f3('0x69')]()['into'](_0xe6f3('0x6a'))['fromQuery']([_0xe6f3('0x6b'),_0xe6f3('0x6c'),_0xe6f3('0x6d'),_0xe6f3('0x6e'),'CampaignId','createdAt',_0xe6f3('0x58')],squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')](_0xe6f3('0x6b'),_0xe6f3('0x6b'))[_0xe6f3('0x6f')]('NOW()',_0xe6f3('0x6c'))[_0xe6f3('0x6f')]('id',_0xe6f3('0x6d'))[_0xe6f3('0x6f')](_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')](),_0xe6f3('0x6e'))[_0xe6f3('0x6f')](_0x69990a[_0xe6f3('0x4c')]['id']['toString'](),_0xe6f3('0x5d'))['field']('\x27'+_0x25224a+'\x27','createdAt')['field']('\x27'+_0x25224a+'\x27',_0xe6f3('0x58'))[_0xe6f3('0x73')](_0xe6f3('0x7d'))['where']('deletedAt\x20IS\x20NULL')[_0xe6f3('0x42')](_0xe6f3('0x75'),_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x76')))['toString']();}_0x157b70=squel['insert']()['into'](_0xe6f3('0x7f'))[_0xe6f3('0x7c')]([_0xe6f3('0x80'),_0xe6f3('0x6c'),'phone',_0xe6f3('0x81'),'createdAt',_0xe6f3('0x58')],squel['select']()[_0xe6f3('0x6f')]('h.id','id')[_0xe6f3('0x6f')](_0xe6f3('0x70'),_0xe6f3('0x6c'))[_0xe6f3('0x6f')](_0xe6f3('0x82'),_0xe6f3('0x6b'))[_0xe6f3('0x6f')](_0xe6f3('0x83'),_0xe6f3('0x81'))[_0xe6f3('0x6f')]('\x27'+_0x25224a+'\x27',_0xe6f3('0x57'))['field']('\x27'+_0x25224a+'\x27',_0xe6f3('0x58'))[_0xe6f3('0x73')]('cm_contact_has_items','ci')[_0xe6f3('0x84')](_0xe6f3('0x6a'),'h',_0xe6f3('0x85'))[_0xe6f3('0x42')]('h.ListId\x20=\x20?',_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x86'),_0x69990a[_0xe6f3('0x4c')]['id']['toString']())[_0xe6f3('0x42')](_0xe6f3('0x87'),_0x25224a))[_0xe6f3('0x72')]();_0x2557c4[_0xe6f3('0x88')](db['sequelize']['query'](_0xe73186));_0x123626[_0xe6f3('0x88')](db[_0xe6f3('0x89')][_0xe6f3('0x36')](_0x157b70));}return BPromise[_0xe6f3('0x8a')](_0x2557c4);}})[_0xe6f3('0x27')](function(){return BPromise['all'](_0x123626);})[_0xe6f3('0x27')](function(){return _0x20e015;})['then'](respondWithResult(_0x817aa2,null))[_0xe6f3('0x4a')](handleError(_0x817aa2,null));};exports[_0xe6f3('0x8b')]=function(_0x5105d2,_0x3f0acb,_0x1cd3f3){return db[_0xe6f3('0x31')][_0xe6f3('0x4d')]({'where':{'id':_0x5105d2[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x3f0acb,null))[_0xe6f3('0x27')](function(_0x2eb815){if(_0x2eb815){return _0x2eb815['removeLists'](_0x5105d2['query']['ids']);}})[_0xe6f3('0x27')](function(_0x1b4916){if(_0x1b4916){return db[_0xe6f3('0x5e')][_0xe6f3('0x28')]({'where':{'ListId':_0x5105d2[_0xe6f3('0x36')][_0xe6f3('0x66')],'CampaignId':_0x5105d2[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](function(){return _0x1b4916;});}})['then'](respondWithStatusCode(_0x3f0acb,null))[_0xe6f3('0x4a')](handleError(_0x3f0acb,null));};exports[_0xe6f3('0x8c')]=function(_0x546296,_0x10a22f,_0x2a4df1){var _0x24b1ca={};var _0x492e69={};var _0x14e8fc;var _0x4db105;return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x546296[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x10a22f,null))[_0xe6f3('0x27')](function(_0x45b410){if(_0x45b410){_0x14e8fc=_0x45b410;_0x492e69[_0xe6f3('0x35')]=_[_0xe6f3('0x37')](db[_0xe6f3('0x8d')][_0xe6f3('0x32')]);_0x492e69[_0xe6f3('0x36')]=_[_0xe6f3('0x37')](_0x546296[_0xe6f3('0x36')]);_0x492e69[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x492e69['model'],_0x492e69[_0xe6f3('0x36')]);_0x24b1ca[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x492e69[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x546296[_0xe6f3('0x36')]['fields']));_0x24b1ca[_0xe6f3('0x39')]=_0x24b1ca[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x24b1ca['attributes']:_0x492e69['model'];_0x24b1ca['order']=qs[_0xe6f3('0x40')](_0x546296[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x24b1ca['where']=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x546296[_0xe6f3('0x36')],_0x492e69[_0xe6f3('0x38')]));if(_0x546296[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0x24b1ca[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x24b1ca[_0xe6f3('0x42')],{'$or':_['map'](_0x24b1ca[_0xe6f3('0x39')],function(_0x43e42b){var _0x273dad={};_0x273dad[_0x43e42b]={'$like':'%'+_0x546296[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x273dad;})});}_0x24b1ca=_['merge']({},_0x24b1ca,_0x546296[_0xe6f3('0x45')]);return _0x14e8fc[_0xe6f3('0x8c')](_0x24b1ca);}})[_0xe6f3('0x27')](function(_0x1f93e1){if(_0x1f93e1){_0x4db105=_0x1f93e1[_0xe6f3('0x3c')];if(!_0x546296[_0xe6f3('0x36')][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0x24b1ca['limit']=qs['limit'](_0x546296[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0x24b1ca['offset']=qs[_0xe6f3('0x1f')](_0x546296[_0xe6f3('0x36')][_0xe6f3('0x1f')]);}return _0x14e8fc[_0xe6f3('0x8c')](_0x24b1ca);}})['then'](function(_0x314a32){if(_0x314a32){return _0x314a32?{'count':_0x4db105,'rows':_0x314a32}:null;}})[_0xe6f3('0x27')](respondWithResult(_0x10a22f,null))[_0xe6f3('0x4a')](handleError(_0x10a22f,null));};exports[_0xe6f3('0x8e')]=function(_0x2cfc20,_0x3a9926,_0x4b461f){var _0xc2cdd8,_0x5a4ccf;var _0x1a8205=[];var _0x5ac6c0=moment()[_0xe6f3('0x65')](_0xe6f3('0x8f'));return db['Campaign']['find']({'where':{'id':_0x2cfc20[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x3a9926,null))[_0xe6f3('0x27')](function(_0x32167a){if(_0x32167a){_0x5a4ccf=_0x32167a;return _0x32167a[_0xe6f3('0x8e')](_0x2cfc20['body'][_0xe6f3('0x66')],_[_0xe6f3('0x56')](_0x2cfc20[_0xe6f3('0x4f')],['ids','id'])||{});}return null;})[_0xe6f3('0x67')](function(_0x337df8){var _0x115fcf;var _0x1c20f5;_0xc2cdd8=_0x337df8||[];var _0x37204c=[];if(_0x337df8){for(var _0x51c01f=0x0;_0x51c01f<_0x337df8[_0xe6f3('0x3c')];_0x51c01f+=0x1){var _0x4b40f7=_0x337df8[_0x51c01f][_0xe6f3('0x29')]({'plain':!![]});_0x115fcf=squel[_0xe6f3('0x69')]()['into'](_0xe6f3('0x90'))['fromQuery']([_0xe6f3('0x6b'),_0xe6f3('0x6d'),_0xe6f3('0x6e'),_0xe6f3('0x5d'),_0xe6f3('0x57'),_0xe6f3('0x58')],squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')]('phone',_0xe6f3('0x6b'))[_0xe6f3('0x6f')]('id','ContactId')[_0xe6f3('0x6f')](_0x4b40f7[_0xe6f3('0x71')]['toString'](),_0xe6f3('0x6e'))[_0xe6f3('0x6f')](_0x2cfc20['params']['id']['toString'](),_0xe6f3('0x5d'))[_0xe6f3('0x6f')](_0xe6f3('0x70'),_0xe6f3('0x57'))[_0xe6f3('0x6f')](_0xe6f3('0x70'),_0xe6f3('0x58'))[_0xe6f3('0x73')](_0xe6f3('0x7d'))['where'](_0xe6f3('0x74'))[_0xe6f3('0x42')]('ListId\x20=\x20?',_0x4b40f7[_0xe6f3('0x71')][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x76')))[_0xe6f3('0x72')]();_0x37204c[_0xe6f3('0x88')](db[_0xe6f3('0x89')][_0xe6f3('0x36')](_0x115fcf));}return BPromise[_0xe6f3('0x8a')](_0x37204c);}})['then'](function(){return _0xc2cdd8;})[_0xe6f3('0x27')](respondWithResult(_0x3a9926,null))['catch'](handleError(_0x3a9926,null));};exports[_0xe6f3('0x91')]=function(_0x498bb1,_0x2baf8c,_0x5b2063){return db[_0xe6f3('0x31')][_0xe6f3('0x4d')]({'where':{'id':_0x498bb1[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x2baf8c,null))[_0xe6f3('0x27')](function(_0x3ba927){if(_0x3ba927){return _0x3ba927[_0xe6f3('0x91')](_0x498bb1[_0xe6f3('0x36')]['ids']);}})[_0xe6f3('0x27')](function(_0x11ba37){if(_0x11ba37){return db[_0xe6f3('0x63')]['destroy']({'where':{'ListId':_0x498bb1['query'][_0xe6f3('0x66')],'CampaignId':_0x498bb1['params']['id']}})['then'](function(){return _0x11ba37;});}})['then'](respondWithStatusCode(_0x2baf8c,null))[_0xe6f3('0x4a')](handleError(_0x2baf8c,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 3023e71..c1ec9e1 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4d2263,_0x3fbf0d){var _0x24aba0=function(_0x389a59){while(--_0x389a59){_0x4d2263['push'](_0x4d2263['shift']());}};_0x24aba0(++_0x3fbf0d);}(_0x7a54,0x106));var _0x47a5=function(_0x45951b,_0x2d4e3e){_0x45951b=_0x45951b-0x0;var _0x317dec=_0x7a54[_0x45951b];return _0x317dec;};'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 03cd534..e9748ae 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 _0xad36=['map','model','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','GetCampaign','Campaign','findAll','options','where','attributes','limit','include'];(function(_0x115801,_0x506a72){var _0x4179c4=function(_0x46cb34){while(--_0x46cb34){_0x115801['push'](_0x115801['shift']());}};_0x4179c4(++_0x506a72);}(_0xad36,0x11c));var _0x6ad3=function(_0x14d38a,_0x57f85d){_0x14d38a=_0x14d38a-0x0;var _0x35e2c2=_0xad36[_0x14d38a];return _0x35e2c2;};'use strict';var _=require('lodash');var util=require(_0x6ad3('0x0'));var moment=require(_0x6ad3('0x1'));var BPromise=require(_0x6ad3('0x2'));var rs=require(_0x6ad3('0x3'));var fs=require('fs');var Redis=require(_0x6ad3('0x4'));var db=require(_0x6ad3('0x5'))['db'];var utils=require(_0x6ad3('0x6'));var logger=require(_0x6ad3('0x7'))(_0x6ad3('0x8'));var config=require('../../config/environment');var jayson=require(_0x6ad3('0x9'));var client=jayson[_0x6ad3('0xa')][_0x6ad3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb38339,_0x4a4ad8,_0x5693c1){return new BPromise(function(_0x50913c,_0x563396){return client[_0x6ad3('0xc')](_0xb38339,_0x5693c1)[_0x6ad3('0xd')](function(_0x363032){logger[_0x6ad3('0xe')](_0x6ad3('0xf'),_0x4a4ad8,_0x6ad3('0x10'));logger[_0x6ad3('0x11')](_0x6ad3('0x12'),_0x4a4ad8,_0x6ad3('0x10'),JSON['stringify'](_0x363032));if(_0x363032[_0x6ad3('0x13')]){if(_0x363032[_0x6ad3('0x13')][_0x6ad3('0x14')]===0x1f4){logger[_0x6ad3('0x13')](_0x6ad3('0xf'),_0x4a4ad8,_0x363032[_0x6ad3('0x13')][_0x6ad3('0x15')]);return _0x563396(_0x363032[_0x6ad3('0x13')]['message']);}logger[_0x6ad3('0x13')]('Campaign,\x20%s,\x20%s',_0x4a4ad8,_0x363032[_0x6ad3('0x13')][_0x6ad3('0x15')]);return _0x50913c(_0x363032[_0x6ad3('0x13')][_0x6ad3('0x15')]);}else{logger[_0x6ad3('0xe')]('Campaign,\x20%s,\x20%s',_0x4a4ad8,_0x6ad3('0x10'));_0x50913c(_0x363032[_0x6ad3('0x16')][_0x6ad3('0x15')]);}})['catch'](function(_0x5479b8){logger['error']('Campaign,\x20%s,\x20%s',_0x4a4ad8,_0x5479b8);_0x563396(_0x5479b8);});});}exports[_0x6ad3('0x17')]=function(_0x4d031b){var _0x358243=this;return new Promise(function(_0x52d10c,_0x4239fe){return db[_0x6ad3('0x18')][_0x6ad3('0x19')]({'raw':_0x4d031b[_0x6ad3('0x1a')]?_0x4d031b['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d031b[_0x6ad3('0x1a')]?_0x4d031b[_0x6ad3('0x1a')][_0x6ad3('0x1b')]||null:null,'attributes':_0x4d031b[_0x6ad3('0x1a')]?_0x4d031b[_0x6ad3('0x1a')][_0x6ad3('0x1c')]||null:null,'limit':_0x4d031b[_0x6ad3('0x1a')]?_0x4d031b[_0x6ad3('0x1a')][_0x6ad3('0x1d')]||null:null,'include':_0x4d031b['options']?_0x4d031b[_0x6ad3('0x1a')][_0x6ad3('0x1e')]?_[_0x6ad3('0x1f')](_0x4d031b[_0x6ad3('0x1a')][_0x6ad3('0x1e')],function(_0x244064){return{'model':db[_0x244064['model']],'as':_0x244064['as'],'attributes':_0x244064[_0x6ad3('0x1c')],'include':_0x244064[_0x6ad3('0x1e')]?_[_0x6ad3('0x1f')](_0x244064['include'],function(_0x50dbec){return{'model':db[_0x50dbec[_0x6ad3('0x20')]],'as':_0x50dbec['as'],'attributes':_0x50dbec[_0x6ad3('0x1c')],'include':_0x50dbec['include']?_['map'](_0x50dbec[_0x6ad3('0x1e')],function(_0x1892fd){return{'model':db[_0x1892fd[_0x6ad3('0x20')]],'as':_0x1892fd['as'],'attributes':_0x1892fd[_0x6ad3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6ad3('0xd')](function(_0x3a8774){logger['info']('GetCampaign',_0x4d031b);logger[_0x6ad3('0x11')](_0x6ad3('0x17'),_0x4d031b,JSON[_0x6ad3('0x21')](_0x3a8774));_0x52d10c(_0x3a8774);})[_0x6ad3('0x22')](function(_0x4ee707){logger[_0x6ad3('0x13')](_0x6ad3('0x17'),_0x4ee707[_0x6ad3('0x15')],_0x4d031b);_0x4239fe(_0x358243[_0x6ad3('0x13')](0x1f4,_0x4ee707[_0x6ad3('0x15')]));});});}; \ No newline at end of file +var _0x2821=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','map','include','model','then','lodash','util','moment','bluebird','randomstring'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x2821,0x87));var _0x1282=function(_0x4ccd19,_0x5d2627){_0x4ccd19=_0x4ccd19-0x0;var _0x10496b=_0x2821[_0x4ccd19];return _0x10496b;};'use strict';var _=require(_0x1282('0x0'));var util=require(_0x1282('0x1'));var moment=require(_0x1282('0x2'));var BPromise=require(_0x1282('0x3'));var rs=require(_0x1282('0x4'));var fs=require('fs');var Redis=require(_0x1282('0x5'));var db=require(_0x1282('0x6'))['db'];var utils=require(_0x1282('0x7'));var logger=require(_0x1282('0x8'))(_0x1282('0x9'));var config=require(_0x1282('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1282('0xb')][_0x1282('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x293947,_0x13beb5,_0xa4eee9){return new BPromise(function(_0x1a8666,_0x18d69a){return client[_0x1282('0xd')](_0x293947,_0xa4eee9)['then'](function(_0x41c458){logger[_0x1282('0xe')](_0x1282('0xf'),_0x13beb5,_0x1282('0x10'));logger[_0x1282('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x13beb5,_0x1282('0x10'),JSON[_0x1282('0x12')](_0x41c458));if(_0x41c458['error']){if(_0x41c458[_0x1282('0x13')][_0x1282('0x14')]===0x1f4){logger['error'](_0x1282('0xf'),_0x13beb5,_0x41c458['error']['message']);return _0x18d69a(_0x41c458[_0x1282('0x13')][_0x1282('0x15')]);}logger[_0x1282('0x13')](_0x1282('0xf'),_0x13beb5,_0x41c458['error']['message']);return _0x1a8666(_0x41c458['error'][_0x1282('0x15')]);}else{logger[_0x1282('0xe')](_0x1282('0xf'),_0x13beb5,_0x1282('0x10'));_0x1a8666(_0x41c458[_0x1282('0x16')][_0x1282('0x15')]);}})[_0x1282('0x17')](function(_0x116ef1){logger['error'](_0x1282('0xf'),_0x13beb5,_0x116ef1);_0x18d69a(_0x116ef1);});});}exports[_0x1282('0x18')]=function(_0x518733){var _0x48c857=this;return new Promise(function(_0xebc97e,_0x4e3ec7){return db[_0x1282('0x19')][_0x1282('0x1a')]({'raw':_0x518733['options']?_0x518733['options']['raw']===undefined?!![]:![]:!![],'where':_0x518733['options']?_0x518733[_0x1282('0x1b')][_0x1282('0x1c')]||null:null,'attributes':_0x518733[_0x1282('0x1b')]?_0x518733[_0x1282('0x1b')][_0x1282('0x1d')]||null:null,'limit':_0x518733[_0x1282('0x1b')]?_0x518733[_0x1282('0x1b')][_0x1282('0x1e')]||null:null,'include':_0x518733[_0x1282('0x1b')]?_0x518733[_0x1282('0x1b')]['include']?_[_0x1282('0x1f')](_0x518733['options'][_0x1282('0x20')],function(_0x25dbb5){return{'model':db[_0x25dbb5[_0x1282('0x21')]],'as':_0x25dbb5['as'],'attributes':_0x25dbb5[_0x1282('0x1d')],'include':_0x25dbb5[_0x1282('0x20')]?_['map'](_0x25dbb5[_0x1282('0x20')],function(_0x117e5c){return{'model':db[_0x117e5c[_0x1282('0x21')]],'as':_0x117e5c['as'],'attributes':_0x117e5c[_0x1282('0x1d')],'include':_0x117e5c[_0x1282('0x20')]?_[_0x1282('0x1f')](_0x117e5c[_0x1282('0x20')],function(_0x28e686){return{'model':db[_0x28e686['model']],'as':_0x28e686['as'],'attributes':_0x28e686['attributes']};}):[]};}):[]};}):[]:[]})[_0x1282('0x22')](function(_0x5d97b4){logger[_0x1282('0xe')]('GetCampaign',_0x518733);logger[_0x1282('0x11')]('GetCampaign',_0x518733,JSON[_0x1282('0x12')](_0x5d97b4));_0xebc97e(_0x5d97b4);})['catch'](function(_0x519a7f){logger['error']('GetCampaign',_0x519a7f['message'],_0x518733);_0x4e3ec7(_0x48c857['error'](0x1f4,_0x519a7f[_0x1282('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 5ebc419..9abf393 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 _0x8d37=['addBlackLists','update','delete','/:id','destroy','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','clone','addLists'];(function(_0xa8dcce,_0x48ac8c){var _0x4baeec=function(_0x5dfb97){while(--_0x5dfb97){_0xa8dcce['push'](_0xa8dcce['shift']());}};_0x4baeec(++_0x48ac8c);}(_0x8d37,0xbc));var _0x78d3=function(_0x24d41c,_0x35c9aa){_0x24d41c=_0x24d41c-0x0;var _0xa7f164=_0x8d37[_0x24d41c];return _0xa7f164;};'use strict';var multer=require(_0x78d3('0x0'));var util=require('util');var path=require(_0x78d3('0x1'));var timeout=require(_0x78d3('0x2'));var express=require(_0x78d3('0x3'));var router=express[_0x78d3('0x4')]();var fs_extra=require(_0x78d3('0x5'));var auth=require(_0x78d3('0x6'));var interaction=require(_0x78d3('0x7'));var config=require('../../config/environment');var controller=require(_0x78d3('0x8'));router[_0x78d3('0x9')]('/',auth['isAuthenticated'](),controller[_0x78d3('0xa')]);router[_0x78d3('0x9')]('/:id',auth[_0x78d3('0xb')](),controller[_0x78d3('0xc')]);router[_0x78d3('0x9')](_0x78d3('0xd'),auth[_0x78d3('0xb')](),controller[_0x78d3('0xe')]);router['get'](_0x78d3('0xf'),auth[_0x78d3('0xb')](),controller[_0x78d3('0x10')]);router[_0x78d3('0x9')](_0x78d3('0x11'),auth['isAuthenticated'](),controller[_0x78d3('0x12')]);router[_0x78d3('0x9')](_0x78d3('0x13'),auth[_0x78d3('0xb')](),controller[_0x78d3('0x14')]);router[_0x78d3('0x9')](_0x78d3('0x15'),auth['isAuthenticated'](),controller[_0x78d3('0x16')]);router[_0x78d3('0x9')](_0x78d3('0x17'),auth['isAuthenticated'](),controller[_0x78d3('0x18')]);router['post']('/',auth[_0x78d3('0xb')](),controller['create']);router[_0x78d3('0x19')]('/:id/clone',auth[_0x78d3('0xb')](),controller[_0x78d3('0x1a')]);router['post']('/:id/lists',auth[_0x78d3('0xb')](),controller[_0x78d3('0x1b')]);router[_0x78d3('0x19')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x78d3('0x1c')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x78d3('0x1d')]);router[_0x78d3('0x1e')](_0x78d3('0x1f'),auth['isAuthenticated'](),controller[_0x78d3('0x20')]);router[_0x78d3('0x1e')]('/:id/lists',auth[_0x78d3('0xb')](),controller[_0x78d3('0x21')]);router[_0x78d3('0x1e')](_0x78d3('0x17'),auth[_0x78d3('0xb')](),controller[_0x78d3('0x22')]);module[_0x78d3('0x23')]=router; \ No newline at end of file +var _0xfb3f=['/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists'];(function(_0x3b14e4,_0x277d5c){var _0x3e8616=function(_0x335bd2){while(--_0x335bd2){_0x3b14e4['push'](_0x3b14e4['shift']());}};_0x3e8616(++_0x277d5c);}(_0xfb3f,0xd9));var _0xffb3=function(_0x487530,_0x2c2a64){_0x487530=_0x487530-0x0;var _0x4cc9bd=_0xfb3f[_0x487530];return _0x4cc9bd;};'use strict';var multer=require(_0xffb3('0x0'));var util=require(_0xffb3('0x1'));var path=require('path');var timeout=require(_0xffb3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xffb3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xffb3('0x4'));var config=require(_0xffb3('0x5'));var controller=require(_0xffb3('0x6'));router[_0xffb3('0x7')]('/',auth[_0xffb3('0x8')](),controller[_0xffb3('0x9')]);router[_0xffb3('0x7')](_0xffb3('0xa'),auth['isAuthenticated'](),controller[_0xffb3('0xb')]);router[_0xffb3('0x7')](_0xffb3('0xc'),auth[_0xffb3('0x8')](),controller[_0xffb3('0xd')]);router['get'](_0xffb3('0xe'),auth[_0xffb3('0x8')](),controller[_0xffb3('0xf')]);router[_0xffb3('0x7')](_0xffb3('0x10'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x11')]);router[_0xffb3('0x7')]('/:id/hopper_black',auth[_0xffb3('0x8')](),controller[_0xffb3('0x12')]);router['get'](_0xffb3('0x13'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x14')]);router[_0xffb3('0x7')](_0xffb3('0x15'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x16')]);router[_0xffb3('0x17')]('/',auth[_0xffb3('0x8')](),controller[_0xffb3('0x18')]);router[_0xffb3('0x17')](_0xffb3('0x19'),auth['isAuthenticated'](),controller[_0xffb3('0x1a')]);router[_0xffb3('0x17')](_0xffb3('0x13'),auth['isAuthenticated'](),controller['addLists']);router[_0xffb3('0x17')](_0xffb3('0x15'),auth['isAuthenticated'](),controller[_0xffb3('0x1b')]);router[_0xffb3('0x1c')](_0xffb3('0xa'),auth['isAuthenticated'](),controller[_0xffb3('0x1d')]);router[_0xffb3('0x1e')]('/:id',auth[_0xffb3('0x8')](),controller[_0xffb3('0x1f')]);router[_0xffb3('0x1e')](_0xffb3('0x13'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x20')]);router[_0xffb3('0x1e')]('/:id/blacklists',auth[_0xffb3('0x8')](),controller[_0xffb3('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index e5de132..1cf3742 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 _0xc1a1=['sequelize','exports','STRING','medium','VIRTUAL'];(function(_0x5706fb,_0xacfe3c){var _0x21799d=function(_0x9a813e){while(--_0x9a813e){_0x5706fb['push'](_0x5706fb['shift']());}};_0x21799d(++_0xacfe3c);}(_0xc1a1,0x154));var _0x1c1a=function(_0x2f6efc,_0x24a7f8){_0x2f6efc=_0x2f6efc-0x0;var _0x196611=_0xc1a1[_0x2f6efc];return _0x196611;};'use strict';var Sequelize=require(_0x1c1a('0x0'));module[_0x1c1a('0x1')]={'key':{'type':Sequelize[_0x1c1a('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0x1c1a('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x1c1a('0x4')],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file +var _0xf043=['STRING','TEXT','medium','getDataValue','key'];(function(_0x236d9c,_0x15f9ec){var _0x1be452=function(_0x5d3111){while(--_0x5d3111){_0x236d9c['push'](_0x236d9c['shift']());}};_0x1be452(++_0x15f9ec);}(_0xf043,0x1b3));var _0x3f04=function(_0x28989a,_0xd11763){_0x28989a=_0x28989a-0x0;var _0x5056ae=_0xf043[_0x28989a];return _0x5056ae;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x3f04('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x3f04('0x1')],'length':_0x3f04('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3f04('0x3')](_0x3f04('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 93add3b..36abb13 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 _0x0cbb=['query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','filter','where','merge','options','count','includeAll','include','findAll','rows','catch','params','keys','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','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','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','UserProfileResource','error','stack','name','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map'];(function(_0x50ba88,_0x44d9dd){var _0x155479=function(_0x2fa4c9){while(--_0x2fa4c9){_0x50ba88['push'](_0x50ba88['shift']());}};_0x155479(++_0x44d9dd);}(_0x0cbb,0x1ee));var _0xb0cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cbb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb0cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0cb('0x1'));var jsonpatch=require(_0xb0cb('0x2'));var rp=require(_0xb0cb('0x3'));var moment=require(_0xb0cb('0x4'));var BPromise=require(_0xb0cb('0x5'));var Mustache=require(_0xb0cb('0x6'));var util=require(_0xb0cb('0x7'));var path=require('path');var sox=require(_0xb0cb('0x8'));var csv=require('to-csv');var ejs=require(_0xb0cb('0x9'));var fs=require('fs');var fs_extra=require(_0xb0cb('0xa'));var _=require(_0xb0cb('0xb'));var squel=require(_0xb0cb('0xc'));var crypto=require('crypto');var jsforce=require(_0xb0cb('0xd'));var deskjs=require(_0xb0cb('0xe'));var toCsv=require(_0xb0cb('0xf'));var querystring=require(_0xb0cb('0x10'));var Papa=require(_0xb0cb('0x11'));var Redis=require(_0xb0cb('0x12'));var authService=require(_0xb0cb('0x13'));var qs=require(_0xb0cb('0x14'));var as=require(_0xb0cb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0cb('0x16'))(_0xb0cb('0x17'));var utils=require(_0xb0cb('0x18'));var config=require(_0xb0cb('0x19'));var licenseUtil=require(_0xb0cb('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33b5ea,_0x447d46){_0x447d46=_0x447d46||0xcc;return function(_0x52fcf2){if(_0x52fcf2){return _0x33b5ea[_0xb0cb('0x1b')](_0x447d46);}return _0x33b5ea[_0xb0cb('0x1c')](_0x447d46)[_0xb0cb('0x1d')]();};}function respondWithResult(_0x402bcd,_0x365bd5){_0x365bd5=_0x365bd5||0xc8;return function(_0x19b04a){if(_0x19b04a){return _0x402bcd[_0xb0cb('0x1c')](_0x365bd5)[_0xb0cb('0x1e')](_0x19b04a);}};}function respondWithFilteredResult(_0x3d85ee,_0x197f14){return function(_0x30854b){if(_0x30854b){var _0x4b0a7c=typeof _0x197f14[_0xb0cb('0x1f')]==='undefined'&&typeof _0x197f14[_0xb0cb('0x20')]===_0xb0cb('0x21');var _0x55fd5a=_0x30854b['count'];var _0x214a7=_0x4b0a7c?0x0:_0x197f14['offset'];var _0x183f3d=_0x4b0a7c?_0x30854b['count']:_0x197f14[_0xb0cb('0x1f')]+_0x197f14['limit'];var _0x7c4b8b;if(_0x183f3d>=_0x55fd5a){_0x183f3d=_0x55fd5a;_0x7c4b8b=0xc8;}else{_0x7c4b8b=0xce;}_0x3d85ee['status'](_0x7c4b8b);return _0x3d85ee[_0xb0cb('0x22')]('Content-Range',_0x214a7+'-'+_0x183f3d+'/'+_0x55fd5a)[_0xb0cb('0x1e')](_0x30854b);}return null;};}function patchUpdates(_0x47351f){return function(_0x19991e){try{jsonpatch[_0xb0cb('0x23')](_0x19991e,_0x47351f,!![]);}catch(_0x4ee322){return BPromise[_0xb0cb('0x24')](_0x4ee322);}return _0x19991e[_0xb0cb('0x25')]();};}function saveUpdates(_0x420ecd,_0x20f469){return function(_0x73d6ea){if(_0x73d6ea){return _0x73d6ea[_0xb0cb('0x26')](_0x420ecd)[_0xb0cb('0x27')](function(_0x533f39){return _0x533f39;});}return null;};}function removeEntity(_0x4475c9,_0x540f17){return function(_0xe20a77){if(_0xe20a77){return _0xe20a77['destroy']()['then'](function(){var _0x2a6adb=_0xe20a77['get']({'plain':!![]});var _0x1a57ff='CannedAnswers';return db[_0xb0cb('0x28')]['destroy']({'where':{'type':_0x1a57ff,'resourceId':_0x2a6adb['id']}})[_0xb0cb('0x27')](function(){return _0xe20a77;});})['then'](function(){_0x4475c9[_0xb0cb('0x1c')](0xcc)[_0xb0cb('0x1d')]();});}};}function handleEntityNotFound(_0x56dbb7,_0x55f0cd){return function(_0x945449){if(!_0x945449){_0x56dbb7['sendStatus'](0x194);}return _0x945449;};}function handleError(_0x2879e6,_0x54f3bc){_0x54f3bc=_0x54f3bc||0x1f4;return function(_0x573415){logger[_0xb0cb('0x29')](_0x573415[_0xb0cb('0x2a')]);if(_0x573415[_0xb0cb('0x2b')]){delete _0x573415[_0xb0cb('0x2b')];}_0x2879e6[_0xb0cb('0x1c')](_0x54f3bc)['send'](_0x573415);};}exports[_0xb0cb('0x2c')]=function(_0x455632,_0x13ec92){var _0x1ccd21={},_0x1211e9={},_0x49f8bf={'count':0x0,'rows':[]};var _0x9f34e4=_['map'](db[_0xb0cb('0x2d')][_0xb0cb('0x2e')],function(_0x463764){return{'name':_0x463764[_0xb0cb('0x2f')],'type':_0x463764[_0xb0cb('0x30')][_0xb0cb('0x31')]};});_0x1211e9[_0xb0cb('0x32')]=_[_0xb0cb('0x33')](_0x9f34e4,_0xb0cb('0x2b'));_0x1211e9[_0xb0cb('0x34')]=_['keys'](_0x455632['query']);_0x1211e9['filters']=_[_0xb0cb('0x35')](_0x1211e9['model'],_0x1211e9[_0xb0cb('0x34')]);_0x1ccd21[_0xb0cb('0x36')]=_[_0xb0cb('0x35')](_0x1211e9[_0xb0cb('0x32')],qs['fields'](_0x455632[_0xb0cb('0x34')][_0xb0cb('0x37')]));_0x1ccd21[_0xb0cb('0x36')]=_0x1ccd21[_0xb0cb('0x36')][_0xb0cb('0x38')]?_0x1ccd21[_0xb0cb('0x36')]:_0x1211e9[_0xb0cb('0x32')];if(!_0x455632[_0xb0cb('0x34')][_0xb0cb('0x39')]('nolimit')){_0x1ccd21[_0xb0cb('0x20')]=qs[_0xb0cb('0x20')](_0x455632[_0xb0cb('0x34')][_0xb0cb('0x20')]);_0x1ccd21[_0xb0cb('0x1f')]=qs[_0xb0cb('0x1f')](_0x455632[_0xb0cb('0x34')]['offset']);}_0x1ccd21[_0xb0cb('0x3a')]=qs[_0xb0cb('0x3b')](_0x455632[_0xb0cb('0x34')][_0xb0cb('0x3b')]);_0x1ccd21['where']=qs['filters'](_[_0xb0cb('0x3c')](_0x455632[_0xb0cb('0x34')],_0x1211e9[_0xb0cb('0x3d')]),_0x9f34e4);if(_0x455632['query'][_0xb0cb('0x3e')]){_0x1ccd21[_0xb0cb('0x3f')]=_['merge'](_0x1ccd21[_0xb0cb('0x3f')],{'$or':[{'key':{'$like':'%'+_0x455632['query'][_0xb0cb('0x3e')]+'%'}},{'value':{'$like':'%'+_0x455632[_0xb0cb('0x34')][_0xb0cb('0x3e')]+'%'}}]});}_0x1ccd21=_[_0xb0cb('0x40')]({},_0x1ccd21,_0x455632[_0xb0cb('0x41')]);var _0x4e2827={'where':_0x1ccd21[_0xb0cb('0x3f')]};return db[_0xb0cb('0x2d')][_0xb0cb('0x42')](_0x4e2827)[_0xb0cb('0x27')](function(_0x143b51){_0x49f8bf[_0xb0cb('0x42')]=_0x143b51;if(_0x455632[_0xb0cb('0x34')][_0xb0cb('0x43')]){_0x1ccd21[_0xb0cb('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb0cb('0x45')](_0x1ccd21);})[_0xb0cb('0x27')](function(_0x5ed84a){_0x49f8bf[_0xb0cb('0x46')]=_0x5ed84a;return _0x49f8bf;})['then'](respondWithFilteredResult(_0x13ec92,_0x1ccd21))[_0xb0cb('0x47')](handleError(_0x13ec92,null));};exports['show']=function(_0x38e8c3,_0x51b1f0){var _0x417934={'raw':!![],'where':{'id':_0x38e8c3[_0xb0cb('0x48')]['id']}},_0x1b0a71={};_0x1b0a71[_0xb0cb('0x32')]=_[_0xb0cb('0x49')](db[_0xb0cb('0x2d')][_0xb0cb('0x2e')]);_0x1b0a71[_0xb0cb('0x34')]=_['keys'](_0x38e8c3['query']);_0x1b0a71[_0xb0cb('0x3d')]=_[_0xb0cb('0x35')](_0x1b0a71['model'],_0x1b0a71['query']);_0x417934[_0xb0cb('0x36')]=_[_0xb0cb('0x35')](_0x1b0a71[_0xb0cb('0x32')],qs[_0xb0cb('0x37')](_0x38e8c3[_0xb0cb('0x34')]['fields']));_0x417934[_0xb0cb('0x36')]=_0x417934[_0xb0cb('0x36')][_0xb0cb('0x38')]?_0x417934[_0xb0cb('0x36')]:_0x1b0a71[_0xb0cb('0x32')];if(_0x38e8c3[_0xb0cb('0x34')][_0xb0cb('0x43')]){_0x417934[_0xb0cb('0x44')]=[{'all':!![]}];}_0x417934=_[_0xb0cb('0x40')]({},_0x417934,_0x38e8c3[_0xb0cb('0x41')]);return db[_0xb0cb('0x2d')][_0xb0cb('0x4a')](_0x417934)[_0xb0cb('0x27')](handleEntityNotFound(_0x51b1f0,null))[_0xb0cb('0x27')](respondWithResult(_0x51b1f0,null))['catch'](handleError(_0x51b1f0,null));};exports[_0xb0cb('0x26')]=function(_0x205781,_0x5eaf7f){if(_0x205781[_0xb0cb('0x4b')]['id']){delete _0x205781[_0xb0cb('0x4b')]['id'];}return db['CannedAnswer'][_0xb0cb('0x4a')]({'where':{'id':_0x205781[_0xb0cb('0x48')]['id']}})[_0xb0cb('0x27')](handleEntityNotFound(_0x5eaf7f,null))['then'](saveUpdates(_0x205781[_0xb0cb('0x4b')],null))[_0xb0cb('0x27')](respondWithResult(_0x5eaf7f,null))[_0xb0cb('0x47')](handleError(_0x5eaf7f,null));};exports[_0xb0cb('0x4c')]=function(_0x590b13,_0x294932){return db['CannedAnswer'][_0xb0cb('0x4a')]({'where':{'id':_0x590b13['params']['id']}})[_0xb0cb('0x27')](handleEntityNotFound(_0x294932,null))[_0xb0cb('0x27')](removeEntity(_0x294932,null))[_0xb0cb('0x47')](handleError(_0x294932,null));};exports[_0xb0cb('0x4d')]=function(_0x4f5533,_0x25f4a5){var _0x4402a7={'key':_0x4f5533[_0xb0cb('0x4b')][_0xb0cb('0x31')]};if(_0x4f5533[_0xb0cb('0x4b')][_0xb0cb('0x4e')]){_0x4402a7[_0xb0cb('0x4e')]=_0x4f5533['body'][_0xb0cb('0x4e')];}else if(_0x4f5533[_0xb0cb('0x4b')][_0xb0cb('0x4f')]){_0x4402a7['SmsAccountId']=_0x4f5533[_0xb0cb('0x4b')][_0xb0cb('0x4f')];}else if(_0x4f5533[_0xb0cb('0x4b')]['OpenchannelAccountId']){_0x4402a7[_0xb0cb('0x50')]=_0x4f5533[_0xb0cb('0x4b')][_0xb0cb('0x50')];}else if(_0x4f5533[_0xb0cb('0x4b')][_0xb0cb('0x51')]){_0x4402a7[_0xb0cb('0x51')]=_0x4f5533[_0xb0cb('0x4b')]['ChatWebsiteId'];}return db[_0xb0cb('0x2d')]['find']({'where':_0x4402a7})[_0xb0cb('0x27')](function(_0x171ce9){if(_0x171ce9){throw new db[(_0xb0cb('0x52'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xb0cb('0x2d')][_0xb0cb('0x4d')](_0x4f5533[_0xb0cb('0x4b')]);})[_0xb0cb('0x27')](function(_0x3d5688){var _0x295380=_0x4f5533[_0xb0cb('0x53')]['get']({'plain':!![]});if(!_0x295380)throw new Error(_0xb0cb('0x54'));if(_0x295380[_0xb0cb('0x55')]===_0xb0cb('0x53')){var _0x458045=_0x3d5688[_0xb0cb('0x56')]({'plain':!![]});return db[_0xb0cb('0x57')][_0xb0cb('0x4a')]({'where':{'name':_0xb0cb('0x58'),'userProfileId':_0x295380[_0xb0cb('0x59')]},'raw':!![]})[_0xb0cb('0x27')](function(_0x2194ba){if(_0x2194ba&&_0x2194ba['autoAssociation']===0x0){return db[_0xb0cb('0x28')][_0xb0cb('0x4d')]({'name':_0x458045[_0xb0cb('0x2b')],'resourceId':_0x458045['id'],'type':_0x2194ba['name'],'sectionId':_0x2194ba['id']},{})[_0xb0cb('0x27')](function(){return _0x3d5688;});}else{return _0x3d5688;}})[_0xb0cb('0x47')](function(_0x34360c){logger[_0xb0cb('0x29')](_0xb0cb('0x5a'),_0x34360c);throw _0x34360c;});}return _0x3d5688;})[_0xb0cb('0x27')](respondWithResult(_0x25f4a5,0xc9))[_0xb0cb('0x47')](handleError(_0x25f4a5,null));}; \ No newline at end of file +var _0x3bb3=['to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','limit','undefined','count','offset','json','reject','update','then','destroy','get','CannedAnswers','error','name','send','index','map','CannedAnswer','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','options','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox'];(function(_0x19b392,_0x1df894){var _0x29a9f4=function(_0x1d866f){while(--_0x1d866f){_0x19b392['push'](_0x19b392['shift']());}};_0x29a9f4(++_0x1df894);}(_0x3bb3,0xa0));var _0x33bb=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x3bb3[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x33bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33bb('0x1'));var jsonpatch=require(_0x33bb('0x2'));var rp=require('request-promise');var moment=require(_0x33bb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x33bb('0x4'));var util=require(_0x33bb('0x5'));var path=require(_0x33bb('0x6'));var sox=require(_0x33bb('0x7'));var csv=require(_0x33bb('0x8'));var ejs=require(_0x33bb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33bb('0xa'));var squel=require(_0x33bb('0xb'));var crypto=require('crypto');var jsforce=require(_0x33bb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x33bb('0x8'));var querystring=require(_0x33bb('0xd'));var Papa=require(_0x33bb('0xe'));var Redis=require('ioredis');var authService=require(_0x33bb('0xf'));var qs=require(_0x33bb('0x10'));var as=require(_0x33bb('0x11'));var hardwareService=require(_0x33bb('0x12'));var logger=require('../../config/logger')(_0x33bb('0x13'));var utils=require('../../config/utils');var config=require(_0x33bb('0x14'));var licenseUtil=require(_0x33bb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x147bc4,_0x5376b4){_0x5376b4=_0x5376b4||0xcc;return function(_0x1830c3){if(_0x1830c3){return _0x147bc4[_0x33bb('0x16')](_0x5376b4);}return _0x147bc4[_0x33bb('0x17')](_0x5376b4)['end']();};}function respondWithResult(_0x394f17,_0x79da9){_0x79da9=_0x79da9||0xc8;return function(_0x5eae6a){if(_0x5eae6a){return _0x394f17[_0x33bb('0x17')](_0x79da9)['json'](_0x5eae6a);}};}function respondWithFilteredResult(_0x14dab5,_0x3ffcc5){return function(_0x2ac0c3){if(_0x2ac0c3){var _0x22c248=typeof _0x3ffcc5['offset']==='undefined'&&typeof _0x3ffcc5[_0x33bb('0x18')]===_0x33bb('0x19');var _0x55c6fc=_0x2ac0c3[_0x33bb('0x1a')];var _0x3c0f47=_0x22c248?0x0:_0x3ffcc5[_0x33bb('0x1b')];var _0x356e5e=_0x22c248?_0x2ac0c3[_0x33bb('0x1a')]:_0x3ffcc5[_0x33bb('0x1b')]+_0x3ffcc5[_0x33bb('0x18')];var _0x509084;if(_0x356e5e>=_0x55c6fc){_0x356e5e=_0x55c6fc;_0x509084=0xc8;}else{_0x509084=0xce;}_0x14dab5[_0x33bb('0x17')](_0x509084);return _0x14dab5['set']('Content-Range',_0x3c0f47+'-'+_0x356e5e+'/'+_0x55c6fc)[_0x33bb('0x1c')](_0x2ac0c3);}return null;};}function patchUpdates(_0x21e166){return function(_0x4a189a){try{jsonpatch['apply'](_0x4a189a,_0x21e166,!![]);}catch(_0x28cec9){return BPromise[_0x33bb('0x1d')](_0x28cec9);}return _0x4a189a['save']();};}function saveUpdates(_0x18b415,_0x4eff9b){return function(_0x5dc44d){if(_0x5dc44d){return _0x5dc44d[_0x33bb('0x1e')](_0x18b415)[_0x33bb('0x1f')](function(_0x3ca856){return _0x3ca856;});}return null;};}function removeEntity(_0x26054a,_0x49e4fe){return function(_0x5abf74){if(_0x5abf74){return _0x5abf74[_0x33bb('0x20')]()['then'](function(){var _0x5a915d=_0x5abf74[_0x33bb('0x21')]({'plain':!![]});var _0x1d585d=_0x33bb('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x1d585d,'resourceId':_0x5a915d['id']}})[_0x33bb('0x1f')](function(){return _0x5abf74;});})[_0x33bb('0x1f')](function(){_0x26054a[_0x33bb('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bbd6a,_0x98eae6){return function(_0x3d7064){if(!_0x3d7064){_0x3bbd6a['sendStatus'](0x194);}return _0x3d7064;};}function handleError(_0x4effe5,_0x1d489c){_0x1d489c=_0x1d489c||0x1f4;return function(_0x24e791){logger[_0x33bb('0x23')](_0x24e791['stack']);if(_0x24e791[_0x33bb('0x24')]){delete _0x24e791[_0x33bb('0x24')];}_0x4effe5[_0x33bb('0x17')](_0x1d489c)[_0x33bb('0x25')](_0x24e791);};}exports[_0x33bb('0x26')]=function(_0x51d0af,_0x2d4e8e){var _0x222a98={},_0x19a0da={},_0x4942de={'count':0x0,'rows':[]};var _0x148d89=_[_0x33bb('0x27')](db[_0x33bb('0x28')][_0x33bb('0x29')],function(_0x3c0f45){return{'name':_0x3c0f45['fieldName'],'type':_0x3c0f45['type'][_0x33bb('0x2a')]};});_0x19a0da['model']=_[_0x33bb('0x27')](_0x148d89,_0x33bb('0x24'));_0x19a0da[_0x33bb('0x2b')]=_[_0x33bb('0x2c')](_0x51d0af[_0x33bb('0x2b')]);_0x19a0da[_0x33bb('0x2d')]=_[_0x33bb('0x2e')](_0x19a0da[_0x33bb('0x2f')],_0x19a0da[_0x33bb('0x2b')]);_0x222a98[_0x33bb('0x30')]=_[_0x33bb('0x2e')](_0x19a0da[_0x33bb('0x2f')],qs['fields'](_0x51d0af[_0x33bb('0x2b')][_0x33bb('0x31')]));_0x222a98[_0x33bb('0x30')]=_0x222a98[_0x33bb('0x30')][_0x33bb('0x32')]?_0x222a98['attributes']:_0x19a0da[_0x33bb('0x2f')];if(!_0x51d0af[_0x33bb('0x2b')][_0x33bb('0x33')](_0x33bb('0x34'))){_0x222a98[_0x33bb('0x18')]=qs[_0x33bb('0x18')](_0x51d0af['query']['limit']);_0x222a98['offset']=qs['offset'](_0x51d0af['query'][_0x33bb('0x1b')]);}_0x222a98[_0x33bb('0x35')]=qs[_0x33bb('0x36')](_0x51d0af[_0x33bb('0x2b')]['sort']);_0x222a98[_0x33bb('0x37')]=qs[_0x33bb('0x2d')](_[_0x33bb('0x38')](_0x51d0af['query'],_0x19a0da[_0x33bb('0x2d')]),_0x148d89);if(_0x51d0af[_0x33bb('0x2b')][_0x33bb('0x39')]){_0x222a98['where']=_[_0x33bb('0x3a')](_0x222a98['where'],{'$or':[{'key':{'$like':'%'+_0x51d0af[_0x33bb('0x2b')][_0x33bb('0x39')]+'%'}},{'value':{'$like':'%'+_0x51d0af[_0x33bb('0x2b')][_0x33bb('0x39')]+'%'}}]});}_0x222a98=_[_0x33bb('0x3a')]({},_0x222a98,_0x51d0af['options']);var _0x831194={'where':_0x222a98[_0x33bb('0x37')]};return db[_0x33bb('0x28')][_0x33bb('0x1a')](_0x831194)[_0x33bb('0x1f')](function(_0x7c11ba){_0x4942de[_0x33bb('0x1a')]=_0x7c11ba;if(_0x51d0af[_0x33bb('0x2b')][_0x33bb('0x3b')]){_0x222a98[_0x33bb('0x3c')]=[{'all':!![]}];}return db['CannedAnswer'][_0x33bb('0x3d')](_0x222a98);})[_0x33bb('0x1f')](function(_0x1ff432){_0x4942de[_0x33bb('0x3e')]=_0x1ff432;return _0x4942de;})[_0x33bb('0x1f')](respondWithFilteredResult(_0x2d4e8e,_0x222a98))[_0x33bb('0x3f')](handleError(_0x2d4e8e,null));};exports[_0x33bb('0x40')]=function(_0x30c183,_0x3a1f57){var _0x19f715={'raw':!![],'where':{'id':_0x30c183['params']['id']}},_0x129653={};_0x129653['model']=_[_0x33bb('0x2c')](db[_0x33bb('0x28')][_0x33bb('0x29')]);_0x129653[_0x33bb('0x2b')]=_[_0x33bb('0x2c')](_0x30c183[_0x33bb('0x2b')]);_0x129653[_0x33bb('0x2d')]=_['intersection'](_0x129653[_0x33bb('0x2f')],_0x129653[_0x33bb('0x2b')]);_0x19f715['attributes']=_[_0x33bb('0x2e')](_0x129653[_0x33bb('0x2f')],qs[_0x33bb('0x31')](_0x30c183[_0x33bb('0x2b')][_0x33bb('0x31')]));_0x19f715[_0x33bb('0x30')]=_0x19f715[_0x33bb('0x30')][_0x33bb('0x32')]?_0x19f715[_0x33bb('0x30')]:_0x129653[_0x33bb('0x2f')];if(_0x30c183[_0x33bb('0x2b')]['includeAll']){_0x19f715['include']=[{'all':!![]}];}_0x19f715=_['merge']({},_0x19f715,_0x30c183[_0x33bb('0x41')]);return db[_0x33bb('0x28')]['find'](_0x19f715)[_0x33bb('0x1f')](handleEntityNotFound(_0x3a1f57,null))[_0x33bb('0x1f')](respondWithResult(_0x3a1f57,null))['catch'](handleError(_0x3a1f57,null));};exports[_0x33bb('0x1e')]=function(_0x163b59,_0x37d7e5){if(_0x163b59[_0x33bb('0x42')]['id']){delete _0x163b59['body']['id'];}return db['CannedAnswer'][_0x33bb('0x43')]({'where':{'id':_0x163b59[_0x33bb('0x44')]['id']}})[_0x33bb('0x1f')](handleEntityNotFound(_0x37d7e5,null))[_0x33bb('0x1f')](saveUpdates(_0x163b59[_0x33bb('0x42')],null))['then'](respondWithResult(_0x37d7e5,null))[_0x33bb('0x3f')](handleError(_0x37d7e5,null));};exports[_0x33bb('0x20')]=function(_0x2bc743,_0x2c1ced){return db[_0x33bb('0x28')][_0x33bb('0x43')]({'where':{'id':_0x2bc743['params']['id']}})['then'](handleEntityNotFound(_0x2c1ced,null))[_0x33bb('0x1f')](removeEntity(_0x2c1ced,null))[_0x33bb('0x3f')](handleError(_0x2c1ced,null));};exports[_0x33bb('0x45')]=function(_0x53ae5f,_0x1fec4a){var _0x5e3a40={'key':_0x53ae5f[_0x33bb('0x42')][_0x33bb('0x2a')]};if(_0x53ae5f[_0x33bb('0x42')][_0x33bb('0x46')]){_0x5e3a40['MailAccountId']=_0x53ae5f[_0x33bb('0x42')]['MailAccountId'];}else if(_0x53ae5f[_0x33bb('0x42')][_0x33bb('0x47')]){_0x5e3a40['SmsAccountId']=_0x53ae5f[_0x33bb('0x42')][_0x33bb('0x47')];}else if(_0x53ae5f[_0x33bb('0x42')][_0x33bb('0x48')]){_0x5e3a40['OpenchannelAccountId']=_0x53ae5f[_0x33bb('0x42')][_0x33bb('0x48')];}else if(_0x53ae5f[_0x33bb('0x42')]['ChatWebsiteId']){_0x5e3a40[_0x33bb('0x49')]=_0x53ae5f[_0x33bb('0x42')][_0x33bb('0x49')];}return db[_0x33bb('0x28')][_0x33bb('0x43')]({'where':_0x5e3a40})['then'](function(_0x3bcd6a){if(_0x3bcd6a){throw new db[(_0x33bb('0x4a'))][(_0x33bb('0x4b'))](_0x33bb('0x4c'));}return db[_0x33bb('0x28')][_0x33bb('0x45')](_0x53ae5f[_0x33bb('0x42')]);})[_0x33bb('0x1f')](function(_0x2cc4e5){var _0x78653d=_0x53ae5f[_0x33bb('0x4d')][_0x33bb('0x21')]({'plain':!![]});if(!_0x78653d)throw new Error(_0x33bb('0x4e'));if(_0x78653d['role']===_0x33bb('0x4d')){var _0x371494=_0x2cc4e5[_0x33bb('0x21')]({'plain':!![]});return db[_0x33bb('0x4f')][_0x33bb('0x43')]({'where':{'name':_0x33bb('0x22'),'userProfileId':_0x78653d[_0x33bb('0x50')]},'raw':!![]})[_0x33bb('0x1f')](function(_0x3d6ba9){if(_0x3d6ba9&&_0x3d6ba9[_0x33bb('0x51')]===0x0){return db[_0x33bb('0x52')][_0x33bb('0x45')]({'name':_0x371494['name'],'resourceId':_0x371494['id'],'type':_0x3d6ba9[_0x33bb('0x24')],'sectionId':_0x3d6ba9['id']},{})[_0x33bb('0x1f')](function(){return _0x2cc4e5;});}else{return _0x2cc4e5;}})['catch'](function(_0x5c2915){logger[_0x33bb('0x23')](_0x33bb('0x53'),_0x5c2915);throw _0x5c2915;});}return _0x2cc4e5;})[_0x33bb('0x1f')](respondWithResult(_0x1fec4a,0xc9))[_0x33bb('0x3f')](handleError(_0x1fec4a,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 115b335..acb5498 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 _0xb63a=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x33f764,_0x545987){var _0x491a5a=function(_0x107e44){while(--_0x107e44){_0x33f764['push'](_0x33f764['shift']());}};_0x491a5a(++_0x545987);}(_0xb63a,0x135));var _0xab63=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0xb63a[_0x51a6d6];return _0x5ef1a8;};'use strict';var _=require(_0xab63('0x0'));var util=require(_0xab63('0x1'));var logger=require('../../config/logger')(_0xab63('0x2'));var moment=require(_0xab63('0x3'));var BPromise=require(_0xab63('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab63('0x5'));var rimraf=require(_0xab63('0x6'));var config=require(_0xab63('0x7'));var attributes=require(_0xab63('0x8'));module['exports']=function(_0x127ccd,_0x881bbe){return _0x127ccd[_0xab63('0x9')](_0xab63('0xa'),attributes,{'tableName':_0xab63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab63('0xc'),'collate':_0xab63('0xd')});}; \ No newline at end of file +var _0xd770=['../../config/environment','exports','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xd770,0x1e5));var _0x0d77=function(_0xc6574b,_0x4bf578){_0xc6574b=_0xc6574b-0x0;var _0x3f49a4=_0xd770[_0xc6574b];return _0x3f49a4;};'use strict';var _=require('lodash');var util=require(_0x0d77('0x0'));var logger=require(_0x0d77('0x1'))(_0x0d77('0x2'));var moment=require('moment');var BPromise=require(_0x0d77('0x3'));var rp=require(_0x0d77('0x4'));var fs=require('fs');var path=require(_0x0d77('0x5'));var rimraf=require(_0x0d77('0x6'));var config=require(_0x0d77('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x0d77('0x8')]=function(_0x10b216,_0x3be4a7){return _0x10b216['define']('CannedAnswer',attributes,{'tableName':_0x0d77('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0d77('0xa'),'collate':_0x0d77('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index a617eeb..81f4f38 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(_0x1b8ffb,_0x2b6eeb){var _0x2f9c09=function(_0x2ae130){while(--_0x2ae130){_0x1b8ffb['push'](_0x1b8ffb['shift']());}};_0x2f9c09(++_0x2b6eeb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x29ceae,_0x5e7ad3){var _0x44128e=function(_0x197f2c){while(--_0x197f2c){_0x29ceae['push'](_0x29ceae['shift']());}};_0x44128e(++_0x5e7ad3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 4e90186..fd7675b 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 _0x2b82=['util','express','fs-extra','./cannedAnswer.controller','get','isAuthenticated','/:id','show','create','put','delete','destroy','exports','multer'];(function(_0x566d9d,_0x1884f9){var _0x479385=function(_0x60f08f){while(--_0x60f08f){_0x566d9d['push'](_0x566d9d['shift']());}};_0x479385(++_0x1884f9);}(_0x2b82,0x1bf));var _0x22b8=function(_0x530525,_0x7e14ec){_0x530525=_0x530525-0x0;var _0x41a015=_0x2b82[_0x530525];return _0x41a015;};'use strict';var multer=require(_0x22b8('0x0'));var util=require(_0x22b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x22b8('0x2'));var router=express['Router']();var fs_extra=require(_0x22b8('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x22b8('0x4'));router[_0x22b8('0x5')]('/',auth[_0x22b8('0x6')](),controller['index']);router['get'](_0x22b8('0x7'),auth[_0x22b8('0x6')](),controller[_0x22b8('0x8')]);router['post']('/',auth[_0x22b8('0x6')](),controller[_0x22b8('0x9')]);router[_0x22b8('0xa')]('/:id',auth[_0x22b8('0x6')](),controller['update']);router[_0x22b8('0xb')]('/:id',auth[_0x22b8('0x6')](),controller[_0x22b8('0xc')]);module[_0x22b8('0xd')]=router; \ No newline at end of file +var _0xa2e0=['../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x2c70f5,_0x24f8fe){var _0x12ade5=function(_0x481605){while(--_0x481605){_0x2c70f5['push'](_0x2c70f5['shift']());}};_0x12ade5(++_0x24f8fe);}(_0xa2e0,0x12d));var _0x0a2e=function(_0x4e3a4a,_0x4e8e47){_0x4e3a4a=_0x4e3a4a-0x0;var _0x585b6f=_0xa2e0[_0x4e3a4a];return _0x585b6f;};'use strict';var multer=require('multer');var util=require(_0x0a2e('0x0'));var path=require(_0x0a2e('0x1'));var timeout=require(_0x0a2e('0x2'));var express=require('express');var router=express[_0x0a2e('0x3')]();var fs_extra=require(_0x0a2e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a2e('0x5'));var config=require('../../config/environment');var controller=require(_0x0a2e('0x6'));router[_0x0a2e('0x7')]('/',auth[_0x0a2e('0x8')](),controller[_0x0a2e('0x9')]);router['get'](_0x0a2e('0xa'),auth[_0x0a2e('0x8')](),controller[_0x0a2e('0xb')]);router[_0x0a2e('0xc')]('/',auth[_0x0a2e('0x8')](),controller[_0x0a2e('0xd')]);router[_0x0a2e('0xe')](_0x0a2e('0xa'),auth[_0x0a2e('0x8')](),controller[_0x0a2e('0xf')]);router['delete'](_0x0a2e('0xa'),auth[_0x0a2e('0x8')](),controller[_0x0a2e('0x10')]);module[_0x0a2e('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b67e5cf..000e39c 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 _0x0f92=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x1918d9,_0x3fb09d){var _0xaa4f57=function(_0x5ee64b){while(--_0x5ee64b){_0x1918d9['push'](_0x1918d9['shift']());}};_0xaa4f57(++_0x3fb09d);}(_0x0f92,0xfd));var _0x20f9=function(_0xc3970b,_0xd82b5b){_0xc3970b=_0xc3970b-0x0;var _0xfd1d16=_0x0f92[_0xc3970b];return _0xfd1d16;};'use strict';var Sequelize=require(_0x20f9('0x0'));module[_0x20f9('0x1')]={'calldate':{'type':Sequelize[_0x20f9('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x20f9('0x3')]},'src':{'type':Sequelize[_0x20f9('0x3')]},'dst':{'type':Sequelize[_0x20f9('0x3')]},'dcontext':{'type':Sequelize[_0x20f9('0x3')]},'channel':{'type':Sequelize[_0x20f9('0x3')]},'dstchannel':{'type':Sequelize[_0x20f9('0x3')]},'lastapp':{'type':Sequelize[_0x20f9('0x3')]},'lastdata':{'type':Sequelize[_0x20f9('0x3')]},'duration':{'type':Sequelize[_0x20f9('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x20f9('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x20f9('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x20f9('0x3')]},'userfield':{'type':Sequelize[_0x20f9('0x3')]},'uniqueid':{'type':Sequelize[_0x20f9('0x3')]},'linkedid':{'type':Sequelize[_0x20f9('0x3')]},'sequence':{'type':Sequelize[_0x20f9('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x20f9('0x3')]},'tag':{'type':Sequelize[_0x20f9('0x3')]}}; \ No newline at end of file +var _0x5c9c=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x30126c,_0x43a5a3){var _0x184d7f=function(_0x34f445){while(--_0x34f445){_0x30126c['push'](_0x30126c['shift']());}};_0x184d7f(++_0x43a5a3);}(_0x5c9c,0x1d1));var _0xc5c9=function(_0xf2fae3,_0x53526f){_0xf2fae3=_0xf2fae3-0x0;var _0x2df866=_0x5c9c[_0xf2fae3];return _0x2df866;};'use strict';var Sequelize=require(_0xc5c9('0x0'));module[_0xc5c9('0x1')]={'calldate':{'type':Sequelize[_0xc5c9('0x2')],'allowNull':![],'defaultValue':_0xc5c9('0x3')},'clid':{'type':Sequelize[_0xc5c9('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xc5c9('0x4')]},'dcontext':{'type':Sequelize[_0xc5c9('0x4')]},'channel':{'type':Sequelize[_0xc5c9('0x4')]},'dstchannel':{'type':Sequelize[_0xc5c9('0x4')]},'lastapp':{'type':Sequelize[_0xc5c9('0x4')]},'lastdata':{'type':Sequelize[_0xc5c9('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xc5c9('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc5c9('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc5c9('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xc5c9('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc5c9('0x4')]},'tag':{'type':Sequelize[_0xc5c9('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 3d2dc68..781895a 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 _0xf3cc=['then','destroy','end','stack','name','send','Cdr','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x3221cd,_0x4a4a4a){_0x3221cd=_0x3221cd-0x0;var _0x21a689=_0xf3cc[_0x3221cd];return _0x21a689;};'use strict';var emlformat=require(_0xcf3c('0x0'));var rimraf=require(_0xcf3c('0x1'));var zipdir=require(_0xcf3c('0x2'));var jsonpatch=require(_0xcf3c('0x3'));var rp=require('request-promise');var moment=require(_0xcf3c('0x4'));var BPromise=require(_0xcf3c('0x5'));var Mustache=require(_0xcf3c('0x6'));var util=require('util');var path=require(_0xcf3c('0x7'));var sox=require(_0xcf3c('0x8'));var csv=require('to-csv');var ejs=require(_0xcf3c('0x9'));var fs=require('fs');var fs_extra=require(_0xcf3c('0xa'));var _=require(_0xcf3c('0xb'));var squel=require(_0xcf3c('0xc'));var crypto=require(_0xcf3c('0xd'));var jsforce=require(_0xcf3c('0xe'));var deskjs=require(_0xcf3c('0xf'));var toCsv=require(_0xcf3c('0x10'));var querystring=require(_0xcf3c('0x11'));var Papa=require(_0xcf3c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf3c('0x13'));var as=require(_0xcf3c('0x14'));var hardwareService=require(_0xcf3c('0x15'));var logger=require(_0xcf3c('0x16'))(_0xcf3c('0x17'));var utils=require(_0xcf3c('0x18'));var config=require(_0xcf3c('0x19'));var licenseUtil=require(_0xcf3c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245b88,_0x389b0f){_0x389b0f=_0x389b0f||0xcc;return function(_0x59a8dc){if(_0x59a8dc){return _0x245b88[_0xcf3c('0x1b')](_0x389b0f);}return _0x245b88['status'](_0x389b0f)['end']();};}function respondWithResult(_0x56261f,_0x3fd714){_0x3fd714=_0x3fd714||0xc8;return function(_0x598576){if(_0x598576){return _0x56261f[_0xcf3c('0x1c')](_0x3fd714)[_0xcf3c('0x1d')](_0x598576);}};}function respondWithFilteredResult(_0x4e35fc,_0x3e759f){return function(_0x540046){if(_0x540046){var _0x30d023=typeof _0x3e759f[_0xcf3c('0x1e')]===_0xcf3c('0x1f')&&typeof _0x3e759f['limit']===_0xcf3c('0x1f');var _0x190c8c=_0x540046[_0xcf3c('0x20')];var _0x3f6cef=_0x30d023?0x0:_0x3e759f['offset'];var _0x3789b6=_0x30d023?_0x540046[_0xcf3c('0x20')]:_0x3e759f[_0xcf3c('0x1e')]+_0x3e759f[_0xcf3c('0x21')];var _0x3d0e0a;if(_0x3789b6>=_0x190c8c){_0x3789b6=_0x190c8c;_0x3d0e0a=0xc8;}else{_0x3d0e0a=0xce;}_0x4e35fc[_0xcf3c('0x1c')](_0x3d0e0a);return _0x4e35fc[_0xcf3c('0x22')](_0xcf3c('0x23'),_0x3f6cef+'-'+_0x3789b6+'/'+_0x190c8c)[_0xcf3c('0x1d')](_0x540046);}return null;};}function patchUpdates(_0x8e7738){return function(_0x26a26e){try{jsonpatch[_0xcf3c('0x24')](_0x26a26e,_0x8e7738,!![]);}catch(_0x4e80d4){return BPromise[_0xcf3c('0x25')](_0x4e80d4);}return _0x26a26e['save']();};}function saveUpdates(_0x3c9153,_0x1228c1){return function(_0x5dddc1){if(_0x5dddc1){return _0x5dddc1[_0xcf3c('0x26')](_0x3c9153)[_0xcf3c('0x27')](function(_0x328336){return _0x328336;});}return null;};}function removeEntity(_0x1d7e79,_0x32bbd5){return function(_0x3f1771){if(_0x3f1771){return _0x3f1771[_0xcf3c('0x28')]()[_0xcf3c('0x27')](function(){_0x1d7e79['status'](0xcc)[_0xcf3c('0x29')]();});}};}function handleEntityNotFound(_0x4ce43c,_0x2281b6){return function(_0x15b55c){if(!_0x15b55c){_0x4ce43c[_0xcf3c('0x1b')](0x194);}return _0x15b55c;};}function handleError(_0x35e546,_0x181c90){_0x181c90=_0x181c90||0x1f4;return function(_0x43c912){logger['error'](_0x43c912[_0xcf3c('0x2a')]);if(_0x43c912['name']){delete _0x43c912[_0xcf3c('0x2b')];}_0x35e546[_0xcf3c('0x1c')](_0x181c90)[_0xcf3c('0x2c')](_0x43c912);};}exports['index']=function(_0x397996,_0x54174a){var _0x1d8223={},_0xe22e99={},_0x21a329={'count':0x0,'rows':[]};var _0x5bdae3=_['map'](db[_0xcf3c('0x2d')][_0xcf3c('0x2e')],function(_0x1f53ee){return{'name':_0x1f53ee[_0xcf3c('0x2f')],'type':_0x1f53ee['type'][_0xcf3c('0x30')]};});_0xe22e99[_0xcf3c('0x31')]=_[_0xcf3c('0x32')](_0x5bdae3,'name');_0xe22e99[_0xcf3c('0x33')]=_[_0xcf3c('0x34')](_0x397996[_0xcf3c('0x33')]);_0xe22e99['filters']=_[_0xcf3c('0x35')](_0xe22e99[_0xcf3c('0x31')],_0xe22e99[_0xcf3c('0x33')]);_0x1d8223[_0xcf3c('0x36')]=_[_0xcf3c('0x35')](_0xe22e99['model'],qs[_0xcf3c('0x37')](_0x397996['query'][_0xcf3c('0x37')]));_0x1d8223['attributes']=_0x1d8223[_0xcf3c('0x36')][_0xcf3c('0x38')]?_0x1d8223[_0xcf3c('0x36')]:_0xe22e99[_0xcf3c('0x31')];if(!_0x397996[_0xcf3c('0x33')][_0xcf3c('0x39')](_0xcf3c('0x3a'))){_0x1d8223[_0xcf3c('0x21')]=qs['limit'](_0x397996[_0xcf3c('0x33')][_0xcf3c('0x21')]);_0x1d8223[_0xcf3c('0x1e')]=qs[_0xcf3c('0x1e')](_0x397996[_0xcf3c('0x33')][_0xcf3c('0x1e')]);}_0x1d8223[_0xcf3c('0x3b')]=qs[_0xcf3c('0x3c')](_0x397996[_0xcf3c('0x33')][_0xcf3c('0x3c')]);_0x1d8223['where']=qs[_0xcf3c('0x3d')](_['pick'](_0x397996['query'],_0xe22e99['filters']),_0x5bdae3);if(_0x397996[_0xcf3c('0x33')][_0xcf3c('0x3e')]){_0x1d8223[_0xcf3c('0x3f')]=_[_0xcf3c('0x40')](_0x1d8223['where'],{'$or':_['map'](_0x5bdae3,function(_0x27e186){if(_0x27e186[_0xcf3c('0x41')]!==_0xcf3c('0x42')){var _0x9c753f={};_0x9c753f[_0x27e186[_0xcf3c('0x2b')]]={'$like':'%'+_0x397996[_0xcf3c('0x33')]['filter']+'%'};return _0x9c753f;}})});}_0x1d8223=_[_0xcf3c('0x40')]({},_0x1d8223,_0x397996[_0xcf3c('0x43')]);var _0x292c4d={'where':_0x1d8223['where']};return db[_0xcf3c('0x2d')]['count'](_0x292c4d)['then'](function(_0x43ba75){_0x21a329[_0xcf3c('0x20')]=_0x43ba75;if(_0x397996[_0xcf3c('0x33')][_0xcf3c('0x44')]){_0x1d8223[_0xcf3c('0x45')]=[{'all':!![]}];}return db[_0xcf3c('0x2d')][_0xcf3c('0x46')](_0x1d8223);})[_0xcf3c('0x27')](function(_0x245c77){_0x21a329['rows']=_0x245c77;return _0x21a329;})['then'](respondWithFilteredResult(_0x54174a,_0x1d8223))[_0xcf3c('0x47')](handleError(_0x54174a,null));};exports[_0xcf3c('0x48')]=function(_0x4f5b07,_0x3092e4){var _0x48e5f1={'raw':!![],'where':{'id':_0x4f5b07[_0xcf3c('0x49')]['id']}},_0x2831de={};_0x2831de[_0xcf3c('0x31')]=_[_0xcf3c('0x34')](db[_0xcf3c('0x2d')][_0xcf3c('0x2e')]);_0x2831de[_0xcf3c('0x33')]=_[_0xcf3c('0x34')](_0x4f5b07[_0xcf3c('0x33')]);_0x2831de[_0xcf3c('0x3d')]=_[_0xcf3c('0x35')](_0x2831de[_0xcf3c('0x31')],_0x2831de[_0xcf3c('0x33')]);_0x48e5f1[_0xcf3c('0x36')]=_[_0xcf3c('0x35')](_0x2831de[_0xcf3c('0x31')],qs[_0xcf3c('0x37')](_0x4f5b07[_0xcf3c('0x33')]['fields']));_0x48e5f1['attributes']=_0x48e5f1[_0xcf3c('0x36')]['length']?_0x48e5f1[_0xcf3c('0x36')]:_0x2831de[_0xcf3c('0x31')];if(_0x4f5b07[_0xcf3c('0x33')][_0xcf3c('0x44')]){_0x48e5f1[_0xcf3c('0x45')]=[{'all':!![]}];}_0x48e5f1=_['merge']({},_0x48e5f1,_0x4f5b07['options']);return db['Cdr'][_0xcf3c('0x4a')](_0x48e5f1)[_0xcf3c('0x27')](handleEntityNotFound(_0x3092e4,null))['then'](respondWithResult(_0x3092e4,null))[_0xcf3c('0x47')](handleError(_0x3092e4,null));};exports[_0xcf3c('0x4b')]=function(_0x1cfbc9,_0x2800d4){return db[_0xcf3c('0x2d')][_0xcf3c('0x4b')](_0x1cfbc9[_0xcf3c('0x4c')],{})[_0xcf3c('0x27')](respondWithResult(_0x2800d4,0xc9))[_0xcf3c('0x47')](handleError(_0x2800d4,null));};exports[_0xcf3c('0x26')]=function(_0x25d090,_0x2cfc0b){if(_0x25d090['body']['id']){delete _0x25d090[_0xcf3c('0x4c')]['id'];}return db[_0xcf3c('0x2d')][_0xcf3c('0x4a')]({'where':{'id':_0x25d090[_0xcf3c('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cfc0b,null))[_0xcf3c('0x27')](saveUpdates(_0x25d090['body'],null))[_0xcf3c('0x27')](respondWithResult(_0x2cfc0b,null))['catch'](handleError(_0x2cfc0b,null));};exports['destroy']=function(_0x4bba35,_0x5e3abc){return db[_0xcf3c('0x2d')][_0xcf3c('0x4a')]({'where':{'id':_0x4bba35['params']['id']}})[_0xcf3c('0x27')](handleEntityNotFound(_0x5e3abc,null))[_0xcf3c('0x27')](removeEntity(_0x5e3abc,null))[_0xcf3c('0x47')](handleError(_0x5e3abc,null));};exports['describe']=function(_0x5b5e6a,_0x43f2e1){return db[_0xcf3c('0x2d')]['describe']()['then'](respondWithResult(_0x43f2e1,null))['catch'](handleError(_0x43f2e1,null));}; \ No newline at end of file +var _0x56e6=['keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','count','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','index','Cdr','rawAttributes','fieldName','model','map','name'];(function(_0x3852fb,_0xbd80e3){var _0x2f2af7=function(_0x55a8e3){while(--_0x55a8e3){_0x3852fb['push'](_0x3852fb['shift']());}};_0x2f2af7(++_0xbd80e3);}(_0x56e6,0x6b));var _0x656e=function(_0x59e401,_0x586a8c){_0x59e401=_0x59e401-0x0;var _0x2a8d4e=_0x56e6[_0x59e401];return _0x2a8d4e;};'use strict';var emlformat=require(_0x656e('0x0'));var rimraf=require(_0x656e('0x1'));var zipdir=require(_0x656e('0x2'));var jsonpatch=require(_0x656e('0x3'));var rp=require(_0x656e('0x4'));var moment=require(_0x656e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x656e('0x6'));var util=require(_0x656e('0x7'));var path=require(_0x656e('0x8'));var sox=require(_0x656e('0x9'));var csv=require(_0x656e('0xa'));var ejs=require(_0x656e('0xb'));var fs=require('fs');var fs_extra=require(_0x656e('0xc'));var _=require('lodash');var squel=require(_0x656e('0xd'));var crypto=require(_0x656e('0xe'));var jsforce=require(_0x656e('0xf'));var deskjs=require(_0x656e('0x10'));var toCsv=require(_0x656e('0xa'));var querystring=require(_0x656e('0x11'));var Papa=require(_0x656e('0x12'));var Redis=require(_0x656e('0x13'));var authService=require(_0x656e('0x14'));var qs=require(_0x656e('0x15'));var as=require(_0x656e('0x16'));var hardwareService=require(_0x656e('0x17'));var logger=require(_0x656e('0x18'))(_0x656e('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x656e('0x1a'));var db=require(_0x656e('0x1b'))['db'];function respondWithStatusCode(_0x3cb3c8,_0x460aad){_0x460aad=_0x460aad||0xcc;return function(_0x581525){if(_0x581525){return _0x3cb3c8['sendStatus'](_0x460aad);}return _0x3cb3c8[_0x656e('0x1c')](_0x460aad)[_0x656e('0x1d')]();};}function respondWithResult(_0x53699e,_0x230249){_0x230249=_0x230249||0xc8;return function(_0x5059d9){if(_0x5059d9){return _0x53699e[_0x656e('0x1c')](_0x230249)[_0x656e('0x1e')](_0x5059d9);}};}function respondWithFilteredResult(_0x2a52f7,_0x1f839f){return function(_0x5a1fc3){if(_0x5a1fc3){var _0x3ab51b=typeof _0x1f839f[_0x656e('0x1f')]===_0x656e('0x20')&&typeof _0x1f839f[_0x656e('0x21')]===_0x656e('0x20');var _0x4fd12e=_0x5a1fc3['count'];var _0x526b83=_0x3ab51b?0x0:_0x1f839f[_0x656e('0x1f')];var _0x1b0fdd=_0x3ab51b?_0x5a1fc3['count']:_0x1f839f[_0x656e('0x1f')]+_0x1f839f['limit'];var _0x495f60;if(_0x1b0fdd>=_0x4fd12e){_0x1b0fdd=_0x4fd12e;_0x495f60=0xc8;}else{_0x495f60=0xce;}_0x2a52f7['status'](_0x495f60);return _0x2a52f7[_0x656e('0x22')](_0x656e('0x23'),_0x526b83+'-'+_0x1b0fdd+'/'+_0x4fd12e)[_0x656e('0x1e')](_0x5a1fc3);}return null;};}function patchUpdates(_0x141587){return function(_0x5532ee){try{jsonpatch[_0x656e('0x24')](_0x5532ee,_0x141587,!![]);}catch(_0x543338){return BPromise[_0x656e('0x25')](_0x543338);}return _0x5532ee['save']();};}function saveUpdates(_0x159e42,_0x1acca5){return function(_0x19ab77){if(_0x19ab77){return _0x19ab77[_0x656e('0x26')](_0x159e42)[_0x656e('0x27')](function(_0x38ea02){return _0x38ea02;});}return null;};}function removeEntity(_0x382a5f,_0x57ac6c){return function(_0x44551b){if(_0x44551b){return _0x44551b[_0x656e('0x28')]()['then'](function(){_0x382a5f['status'](0xcc)[_0x656e('0x1d')]();});}};}function handleEntityNotFound(_0x517021,_0x33fb09){return function(_0x5b492e){if(!_0x5b492e){_0x517021['sendStatus'](0x194);}return _0x5b492e;};}function handleError(_0xa834a5,_0x4e2a80){_0x4e2a80=_0x4e2a80||0x1f4;return function(_0x26870d){logger[_0x656e('0x29')](_0x26870d[_0x656e('0x2a')]);if(_0x26870d['name']){delete _0x26870d['name'];}_0xa834a5[_0x656e('0x1c')](_0x4e2a80)[_0x656e('0x2b')](_0x26870d);};}exports[_0x656e('0x2c')]=function(_0x469acf,_0xc2a01){var _0x264e88={},_0xfece84={},_0x58181e={'count':0x0,'rows':[]};var _0x84d034=_['map'](db[_0x656e('0x2d')][_0x656e('0x2e')],function(_0x58cf11){return{'name':_0x58cf11[_0x656e('0x2f')],'type':_0x58cf11['type']['key']};});_0xfece84[_0x656e('0x30')]=_[_0x656e('0x31')](_0x84d034,_0x656e('0x32'));_0xfece84['query']=_[_0x656e('0x33')](_0x469acf['query']);_0xfece84[_0x656e('0x34')]=_[_0x656e('0x35')](_0xfece84['model'],_0xfece84[_0x656e('0x36')]);_0x264e88['attributes']=_['intersection'](_0xfece84[_0x656e('0x30')],qs['fields'](_0x469acf[_0x656e('0x36')][_0x656e('0x37')]));_0x264e88[_0x656e('0x38')]=_0x264e88[_0x656e('0x38')]['length']?_0x264e88['attributes']:_0xfece84[_0x656e('0x30')];if(!_0x469acf['query'][_0x656e('0x39')](_0x656e('0x3a'))){_0x264e88[_0x656e('0x21')]=qs[_0x656e('0x21')](_0x469acf[_0x656e('0x36')][_0x656e('0x21')]);_0x264e88['offset']=qs['offset'](_0x469acf['query']['offset']);}_0x264e88['order']=qs[_0x656e('0x3b')](_0x469acf['query']['sort']);_0x264e88[_0x656e('0x3c')]=qs[_0x656e('0x34')](_[_0x656e('0x3d')](_0x469acf[_0x656e('0x36')],_0xfece84[_0x656e('0x34')]),_0x84d034);if(_0x469acf[_0x656e('0x36')][_0x656e('0x3e')]){_0x264e88[_0x656e('0x3c')]=_[_0x656e('0x3f')](_0x264e88[_0x656e('0x3c')],{'$or':_[_0x656e('0x31')](_0x84d034,function(_0x46306a){if(_0x46306a[_0x656e('0x40')]!=='VIRTUAL'){var _0x3c1a70={};_0x3c1a70[_0x46306a['name']]={'$like':'%'+_0x469acf['query'][_0x656e('0x3e')]+'%'};return _0x3c1a70;}})});}_0x264e88=_[_0x656e('0x3f')]({},_0x264e88,_0x469acf[_0x656e('0x41')]);var _0x5cd5e9={'where':_0x264e88['where']};return db['Cdr'][_0x656e('0x42')](_0x5cd5e9)[_0x656e('0x27')](function(_0x3e6266){_0x58181e[_0x656e('0x42')]=_0x3e6266;if(_0x469acf[_0x656e('0x36')][_0x656e('0x43')]){_0x264e88[_0x656e('0x44')]=[{'all':!![]}];}return db[_0x656e('0x2d')][_0x656e('0x45')](_0x264e88);})[_0x656e('0x27')](function(_0x3f81fa){_0x58181e[_0x656e('0x46')]=_0x3f81fa;return _0x58181e;})[_0x656e('0x27')](respondWithFilteredResult(_0xc2a01,_0x264e88))['catch'](handleError(_0xc2a01,null));};exports[_0x656e('0x47')]=function(_0x562482,_0x21af67){var _0x3f3d5e={'raw':!![],'where':{'id':_0x562482[_0x656e('0x48')]['id']}},_0x4045c4={};_0x4045c4[_0x656e('0x30')]=_[_0x656e('0x33')](db[_0x656e('0x2d')][_0x656e('0x2e')]);_0x4045c4[_0x656e('0x36')]=_[_0x656e('0x33')](_0x562482['query']);_0x4045c4[_0x656e('0x34')]=_[_0x656e('0x35')](_0x4045c4[_0x656e('0x30')],_0x4045c4['query']);_0x3f3d5e['attributes']=_[_0x656e('0x35')](_0x4045c4[_0x656e('0x30')],qs[_0x656e('0x37')](_0x562482[_0x656e('0x36')]['fields']));_0x3f3d5e[_0x656e('0x38')]=_0x3f3d5e[_0x656e('0x38')][_0x656e('0x49')]?_0x3f3d5e[_0x656e('0x38')]:_0x4045c4[_0x656e('0x30')];if(_0x562482['query'][_0x656e('0x43')]){_0x3f3d5e[_0x656e('0x44')]=[{'all':!![]}];}_0x3f3d5e=_[_0x656e('0x3f')]({},_0x3f3d5e,_0x562482[_0x656e('0x41')]);return db[_0x656e('0x2d')][_0x656e('0x4a')](_0x3f3d5e)['then'](handleEntityNotFound(_0x21af67,null))[_0x656e('0x27')](respondWithResult(_0x21af67,null))[_0x656e('0x4b')](handleError(_0x21af67,null));};exports[_0x656e('0x4c')]=function(_0x904b8a,_0x5dbcfb){return db['Cdr'][_0x656e('0x4c')](_0x904b8a['body'],{})['then'](respondWithResult(_0x5dbcfb,0xc9))['catch'](handleError(_0x5dbcfb,null));};exports[_0x656e('0x26')]=function(_0x2c648e,_0x59cb0f){if(_0x2c648e['body']['id']){delete _0x2c648e['body']['id'];}return db['Cdr'][_0x656e('0x4a')]({'where':{'id':_0x2c648e[_0x656e('0x48')]['id']}})['then'](handleEntityNotFound(_0x59cb0f,null))[_0x656e('0x27')](saveUpdates(_0x2c648e[_0x656e('0x4d')],null))[_0x656e('0x27')](respondWithResult(_0x59cb0f,null))[_0x656e('0x4b')](handleError(_0x59cb0f,null));};exports[_0x656e('0x28')]=function(_0x3e8d90,_0x2dac52){return db[_0x656e('0x2d')][_0x656e('0x4a')]({'where':{'id':_0x3e8d90[_0x656e('0x48')]['id']}})[_0x656e('0x27')](handleEntityNotFound(_0x2dac52,null))['then'](removeEntity(_0x2dac52,null))['catch'](handleError(_0x2dac52,null));};exports['describe']=function(_0x47e622,_0x464881){return db[_0x656e('0x2d')][_0x656e('0x4e')]()['then'](respondWithResult(_0x464881,null))['catch'](handleError(_0x464881,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index c19e100..fd20a6f 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(_0x48b3ec,_0x21fe3d){var _0x7956cf=function(_0x12f5f7){while(--_0x12f5f7){_0x48b3ec['push'](_0x48b3ec['shift']());}};_0x7956cf(++_0x21fe3d);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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(_0x5234a6,_0x314a5d){var _0x1f8955=function(_0xb6717c){while(--_0xb6717c){_0x5234a6['push'](_0x5234a6['shift']());}};_0x1f8955(++_0x314a5d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 2f2587a..179f37f 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 _0x0dce=['request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xc75912,_0x2bbbe){var _0x17fbe2=function(_0x37607d){while(--_0x37607d){_0xc75912['push'](_0xc75912['shift']());}};_0x17fbe2(++_0x2bbbe);}(_0x0dce,0x154));var _0xe0dc=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x0dce[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0xe0dc('0x0'));var util=require(_0xe0dc('0x1'));var moment=require(_0xe0dc('0x2'));var BPromise=require(_0xe0dc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0dc('0x4'))['db'];var utils=require(_0xe0dc('0x5'));var logger=require(_0xe0dc('0x6'))(_0xe0dc('0x7'));var config=require(_0xe0dc('0x8'));var jayson=require(_0xe0dc('0x9'));var client=jayson[_0xe0dc('0xa')][_0xe0dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43857a,_0x50884e,_0x147b56){return new BPromise(function(_0xb7d8fb,_0x887aeb){return client['request'](_0x43857a,_0x147b56)['then'](function(_0x5ba68a){logger['info']('Cdr,\x20%s,\x20%s',_0x50884e,_0xe0dc('0xc'));logger['debug'](_0xe0dc('0xd'),_0x50884e,_0xe0dc('0xc'),JSON[_0xe0dc('0xe')](_0x5ba68a));if(_0x5ba68a[_0xe0dc('0xf')]){if(_0x5ba68a[_0xe0dc('0xf')][_0xe0dc('0x10')]===0x1f4){logger[_0xe0dc('0xf')](_0xe0dc('0x11'),_0x50884e,_0x5ba68a['error']['message']);return _0x887aeb(_0x5ba68a[_0xe0dc('0xf')][_0xe0dc('0x12')]);}logger[_0xe0dc('0xf')]('Cdr,\x20%s,\x20%s',_0x50884e,_0x5ba68a[_0xe0dc('0xf')]['message']);return _0xb7d8fb(_0x5ba68a['error']['message']);}else{logger[_0xe0dc('0x13')]('Cdr,\x20%s,\x20%s',_0x50884e,_0xe0dc('0xc'));_0xb7d8fb(_0x5ba68a[_0xe0dc('0x14')][_0xe0dc('0x12')]);}})[_0xe0dc('0x15')](function(_0x6da21a){logger[_0xe0dc('0xf')](_0xe0dc('0x11'),_0x50884e,_0x6da21a);_0x887aeb(_0x6da21a);});});} \ No newline at end of file +var _0x14ef=['error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x238c67,_0x4c409e){var _0x51d179=function(_0x24ab46){while(--_0x24ab46){_0x238c67['push'](_0x238c67['shift']());}};_0x51d179(++_0x4c409e);}(_0x14ef,0x158));var _0xf14e=function(_0x2f888d,_0x597d3c){_0x2f888d=_0x2f888d-0x0;var _0x40f285=_0x14ef[_0x2f888d];return _0x40f285;};'use strict';var _=require(_0xf14e('0x0'));var util=require(_0xf14e('0x1'));var moment=require('moment');var BPromise=require(_0xf14e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf14e('0x3'));var db=require(_0xf14e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf14e('0x5'))(_0xf14e('0x6'));var config=require(_0xf14e('0x7'));var jayson=require(_0xf14e('0x8'));var client=jayson[_0xf14e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a594,_0xd72758,_0x51e46e){return new BPromise(function(_0x61d4a7,_0x8ec369){return client['request'](_0x41a594,_0x51e46e)[_0xf14e('0xa')](function(_0x55b89f){logger[_0xf14e('0xb')](_0xf14e('0xc'),_0xd72758,_0xf14e('0xd'));logger[_0xf14e('0xe')](_0xf14e('0xf'),_0xd72758,_0xf14e('0xd'),JSON['stringify'](_0x55b89f));if(_0x55b89f[_0xf14e('0x10')]){if(_0x55b89f[_0xf14e('0x10')]['code']===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0xd72758,_0x55b89f[_0xf14e('0x10')][_0xf14e('0x11')]);return _0x8ec369(_0x55b89f[_0xf14e('0x10')][_0xf14e('0x11')]);}logger[_0xf14e('0x10')](_0xf14e('0xc'),_0xd72758,_0x55b89f[_0xf14e('0x10')][_0xf14e('0x11')]);return _0x61d4a7(_0x55b89f[_0xf14e('0x10')][_0xf14e('0x11')]);}else{logger['info'](_0xf14e('0xc'),_0xd72758,_0xf14e('0xd'));_0x61d4a7(_0x55b89f[_0xf14e('0x12')][_0xf14e('0x11')]);}})[_0xf14e('0x13')](function(_0x32affb){logger[_0xf14e('0x10')](_0xf14e('0xc'),_0xd72758,_0x32affb);_0x8ec369(_0x32affb);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index be427c2..cdb4363 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x212403,_0x285a0e){var _0xf76354=function(_0x31963e){while(--_0x31963e){_0x212403['push'](_0x212403['shift']());}};_0xf76354(++_0x285a0e);}(_0xb10b,0x12a));var _0xbb10=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0xb10b[_0x151721];return _0x2deaa7;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +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(_0x26a382,_0x3d54db){var _0x14f9c8=function(_0x1b69f6){while(--_0x1b69f6){_0x26a382['push'](_0x26a382['shift']());}};_0x14f9c8(++_0x3d54db);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index efcd493..7aaed9a 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 _0x786f=['sequelize','exports','INTEGER','TEXT','STRING'];(function(_0x299634,_0x5b67c4){var _0x4e0220=function(_0x23938a){while(--_0x23938a){_0x299634['push'](_0x299634['shift']());}};_0x4e0220(++_0x5b67c4);}(_0x786f,0x87));var _0xf786=function(_0x2cd8d0,_0x5ddefb){_0x2cd8d0=_0x2cd8d0-0x0;var _0x49a221=_0x786f[_0x2cd8d0];return _0x49a221;};'use strict';var Sequelize=require(_0xf786('0x0'));module[_0xf786('0x1')]={'priority':{'type':Sequelize[_0xf786('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf786('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf786('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xabae=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xabae,0xe0));var _0xeaba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xabae[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xeaba('0x0'));module[_0xeaba('0x1')]={'priority':{'type':Sequelize[_0xeaba('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xeaba('0x3')],'allowNull':![],'defaultValue':_0xeaba('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xeaba('0x3')]},'interval':{'type':Sequelize[_0xeaba('0x3')],'defaultValue':_0xeaba('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 8819b63..a6b5b1a 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 _0x8868=['offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','show','keys','ChatApplication','rawAttributes','query','filters','model','attributes','fields','length','includeAll','include','options','find','catch','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0x8868,0x1ca));var _0x8886=function(_0x3292ce,_0x3eb57b){_0x3292ce=_0x3292ce-0x0;var _0x4f4c2c=_0x8868[_0x3292ce];return _0x4f4c2c;};'use strict';var emlformat=require(_0x8886('0x0'));var rimraf=require(_0x8886('0x1'));var zipdir=require(_0x8886('0x2'));var jsonpatch=require(_0x8886('0x3'));var rp=require(_0x8886('0x4'));var moment=require(_0x8886('0x5'));var BPromise=require(_0x8886('0x6'));var Mustache=require(_0x8886('0x7'));var util=require(_0x8886('0x8'));var path=require(_0x8886('0x9'));var sox=require(_0x8886('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8886('0xb'));var _=require(_0x8886('0xc'));var squel=require('squel');var crypto=require(_0x8886('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8886('0xe'));var toCsv=require(_0x8886('0xf'));var querystring=require(_0x8886('0x10'));var Papa=require(_0x8886('0x11'));var Redis=require(_0x8886('0x12'));var authService=require(_0x8886('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8886('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8886('0x15'));var utils=require('../../config/utils');var config=require(_0x8886('0x16'));var licenseUtil=require(_0x8886('0x17'));var db=require(_0x8886('0x18'))['db'];function respondWithStatusCode(_0x2a154d,_0x54cbc9){_0x54cbc9=_0x54cbc9||0xcc;return function(_0x29fa59){if(_0x29fa59){return _0x2a154d[_0x8886('0x19')](_0x54cbc9);}return _0x2a154d['status'](_0x54cbc9)[_0x8886('0x1a')]();};}function respondWithResult(_0x5ef48a,_0x4a339){_0x4a339=_0x4a339||0xc8;return function(_0x1110fd){if(_0x1110fd){return _0x5ef48a[_0x8886('0x1b')](_0x4a339)[_0x8886('0x1c')](_0x1110fd);}};}function respondWithFilteredResult(_0x57e00c,_0x5b6f4b){return function(_0x31dad3){if(_0x31dad3){var _0x11905e=typeof _0x5b6f4b['offset']==='undefined'&&typeof _0x5b6f4b['limit']==='undefined';var _0x438f1a=_0x31dad3[_0x8886('0x1d')];var _0x1d47a6=_0x11905e?0x0:_0x5b6f4b[_0x8886('0x1e')];var _0xb13c62=_0x11905e?_0x31dad3[_0x8886('0x1d')]:_0x5b6f4b[_0x8886('0x1e')]+_0x5b6f4b[_0x8886('0x1f')];var _0xbf4367;if(_0xb13c62>=_0x438f1a){_0xb13c62=_0x438f1a;_0xbf4367=0xc8;}else{_0xbf4367=0xce;}_0x57e00c[_0x8886('0x1b')](_0xbf4367);return _0x57e00c[_0x8886('0x20')](_0x8886('0x21'),_0x1d47a6+'-'+_0xb13c62+'/'+_0x438f1a)[_0x8886('0x1c')](_0x31dad3);}return null;};}function patchUpdates(_0x19f0ef){return function(_0x5103f9){try{jsonpatch[_0x8886('0x22')](_0x5103f9,_0x19f0ef,!![]);}catch(_0x595f45){return BPromise[_0x8886('0x23')](_0x595f45);}return _0x5103f9[_0x8886('0x24')]();};}function saveUpdates(_0x48ec2e,_0x3894a0){return function(_0x17163e){if(_0x17163e){return _0x17163e[_0x8886('0x25')](_0x48ec2e)[_0x8886('0x26')](function(_0x19a78f){return _0x19a78f;});}return null;};}function removeEntity(_0x1c4485,_0x4d8d5e){return function(_0x3df299){if(_0x3df299){return _0x3df299['destroy']()[_0x8886('0x26')](function(){_0x1c4485[_0x8886('0x1b')](0xcc)[_0x8886('0x1a')]();});}};}function handleEntityNotFound(_0x48280f,_0x31e239){return function(_0x5b966b){if(!_0x5b966b){_0x48280f[_0x8886('0x19')](0x194);}return _0x5b966b;};}function handleError(_0x127fc9,_0x27ba7d){_0x27ba7d=_0x27ba7d||0x1f4;return function(_0x337007){logger[_0x8886('0x27')](_0x337007[_0x8886('0x28')]);if(_0x337007[_0x8886('0x29')]){delete _0x337007['name'];}_0x127fc9['status'](_0x27ba7d)[_0x8886('0x2a')](_0x337007);};}exports[_0x8886('0x2b')]=function(_0x4a37ca,_0xc02082){var _0x45b714={'raw':!![],'where':{'id':_0x4a37ca['params']['id']}},_0x15cc33={};_0x15cc33['model']=_[_0x8886('0x2c')](db[_0x8886('0x2d')][_0x8886('0x2e')]);_0x15cc33[_0x8886('0x2f')]=_[_0x8886('0x2c')](_0x4a37ca[_0x8886('0x2f')]);_0x15cc33[_0x8886('0x30')]=_['intersection'](_0x15cc33[_0x8886('0x31')],_0x15cc33[_0x8886('0x2f')]);_0x45b714[_0x8886('0x32')]=_['intersection'](_0x15cc33[_0x8886('0x31')],qs['fields'](_0x4a37ca[_0x8886('0x2f')][_0x8886('0x33')]));_0x45b714['attributes']=_0x45b714[_0x8886('0x32')][_0x8886('0x34')]?_0x45b714[_0x8886('0x32')]:_0x15cc33[_0x8886('0x31')];if(_0x4a37ca[_0x8886('0x2f')][_0x8886('0x35')]){_0x45b714[_0x8886('0x36')]=[{'all':!![]}];}_0x45b714=_['merge']({},_0x45b714,_0x4a37ca[_0x8886('0x37')]);return db[_0x8886('0x2d')][_0x8886('0x38')](_0x45b714)[_0x8886('0x26')](handleEntityNotFound(_0xc02082,null))[_0x8886('0x26')](respondWithResult(_0xc02082,null))[_0x8886('0x39')](handleError(_0xc02082,null));};exports['update']=function(_0x3bd743,_0x4298e8){if(_0x3bd743[_0x8886('0x3a')]['id']){delete _0x3bd743[_0x8886('0x3a')]['id'];}return db[_0x8886('0x2d')]['find']({'where':{'id':_0x3bd743[_0x8886('0x3b')]['id']}})[_0x8886('0x26')](handleEntityNotFound(_0x4298e8,null))[_0x8886('0x26')](saveUpdates(_0x3bd743[_0x8886('0x3a')],null))[_0x8886('0x26')](respondWithResult(_0x4298e8,null))[_0x8886('0x39')](handleError(_0x4298e8,null));};exports[_0x8886('0x3c')]=function(_0x487f30,_0x2f9531){return db[_0x8886('0x2d')]['find']({'where':{'id':_0x487f30['params']['id']}})[_0x8886('0x26')](handleEntityNotFound(_0x2f9531,null))[_0x8886('0x26')](removeEntity(_0x2f9531,null))['catch'](handleError(_0x2f9531,null));}; \ No newline at end of file +var _0xdadd=['include','options','find','catch','body','ChatApplication','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','reject','destroy','then','stack','name','show','params','keys','rawAttributes','query','intersection','model','attributes','fields'];(function(_0x7e8c9,_0x9c5daf){var _0xc0efc=function(_0x2ca872){while(--_0x2ca872){_0x7e8c9['push'](_0x7e8c9['shift']());}};_0xc0efc(++_0x9c5daf);}(_0xdadd,0x1c8));var _0xddad=function(_0x7d3039,_0x63151b){_0x7d3039=_0x7d3039-0x0;var _0x24031e=_0xdadd[_0x7d3039];return _0x24031e;};'use strict';var emlformat=require(_0xddad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xddad('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xddad('0x2'));var moment=require(_0xddad('0x3'));var BPromise=require(_0xddad('0x4'));var Mustache=require('mustache');var util=require(_0xddad('0x5'));var path=require(_0xddad('0x6'));var sox=require(_0xddad('0x7'));var csv=require(_0xddad('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xddad('0x9'));var squel=require(_0xddad('0xa'));var crypto=require('crypto');var jsforce=require(_0xddad('0xb'));var deskjs=require(_0xddad('0xc'));var toCsv=require(_0xddad('0x8'));var querystring=require(_0xddad('0xd'));var Papa=require(_0xddad('0xe'));var Redis=require(_0xddad('0xf'));var authService=require(_0xddad('0x10'));var qs=require(_0xddad('0x11'));var as=require(_0xddad('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xddad('0x13'))(_0xddad('0x14'));var utils=require(_0xddad('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xddad('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x193c44,_0x248c9b){_0x248c9b=_0x248c9b||0xcc;return function(_0xc8973d){if(_0xc8973d){return _0x193c44[_0xddad('0x17')](_0x248c9b);}return _0x193c44[_0xddad('0x18')](_0x248c9b)[_0xddad('0x19')]();};}function respondWithResult(_0x4f8c2e,_0x353723){_0x353723=_0x353723||0xc8;return function(_0x2c7b40){if(_0x2c7b40){return _0x4f8c2e[_0xddad('0x18')](_0x353723)[_0xddad('0x1a')](_0x2c7b40);}};}function respondWithFilteredResult(_0x2ac2ac,_0x1b4b94){return function(_0x4e0ca3){if(_0x4e0ca3){var _0x50c3e4=typeof _0x1b4b94[_0xddad('0x1b')]===_0xddad('0x1c')&&typeof _0x1b4b94[_0xddad('0x1d')]===_0xddad('0x1c');var _0x413fe9=_0x4e0ca3['count'];var _0x282b69=_0x50c3e4?0x0:_0x1b4b94[_0xddad('0x1b')];var _0x3c4a8a=_0x50c3e4?_0x4e0ca3['count']:_0x1b4b94[_0xddad('0x1b')]+_0x1b4b94['limit'];var _0x46ac1f;if(_0x3c4a8a>=_0x413fe9){_0x3c4a8a=_0x413fe9;_0x46ac1f=0xc8;}else{_0x46ac1f=0xce;}_0x2ac2ac['status'](_0x46ac1f);return _0x2ac2ac['set']('Content-Range',_0x282b69+'-'+_0x3c4a8a+'/'+_0x413fe9)[_0xddad('0x1a')](_0x4e0ca3);}return null;};}function patchUpdates(_0x49acbf){return function(_0x567986){try{jsonpatch['apply'](_0x567986,_0x49acbf,!![]);}catch(_0x4ea1e9){return BPromise[_0xddad('0x1e')](_0x4ea1e9);}return _0x567986['save']();};}function saveUpdates(_0x1c4db9,_0x450080){return function(_0x2598c3){if(_0x2598c3){return _0x2598c3['update'](_0x1c4db9)['then'](function(_0x59739e){return _0x59739e;});}return null;};}function removeEntity(_0x321b25,_0x5e9e62){return function(_0x3a6c68){if(_0x3a6c68){return _0x3a6c68[_0xddad('0x1f')]()[_0xddad('0x20')](function(){_0x321b25[_0xddad('0x18')](0xcc)[_0xddad('0x19')]();});}};}function handleEntityNotFound(_0x561f35,_0x17b9ce){return function(_0x5b3a5b){if(!_0x5b3a5b){_0x561f35['sendStatus'](0x194);}return _0x5b3a5b;};}function handleError(_0x3040d1,_0x74c3ea){_0x74c3ea=_0x74c3ea||0x1f4;return function(_0x3b4bc8){logger['error'](_0x3b4bc8[_0xddad('0x21')]);if(_0x3b4bc8[_0xddad('0x22')]){delete _0x3b4bc8['name'];}_0x3040d1[_0xddad('0x18')](_0x74c3ea)['send'](_0x3b4bc8);};}exports[_0xddad('0x23')]=function(_0x53c761,_0x35a882){var _0x1823b0={'raw':!![],'where':{'id':_0x53c761[_0xddad('0x24')]['id']}},_0x55ea75={};_0x55ea75['model']=_[_0xddad('0x25')](db['ChatApplication'][_0xddad('0x26')]);_0x55ea75[_0xddad('0x27')]=_[_0xddad('0x25')](_0x53c761[_0xddad('0x27')]);_0x55ea75['filters']=_[_0xddad('0x28')](_0x55ea75[_0xddad('0x29')],_0x55ea75['query']);_0x1823b0[_0xddad('0x2a')]=_['intersection'](_0x55ea75['model'],qs[_0xddad('0x2b')](_0x53c761[_0xddad('0x27')][_0xddad('0x2b')]));_0x1823b0[_0xddad('0x2a')]=_0x1823b0[_0xddad('0x2a')]['length']?_0x1823b0[_0xddad('0x2a')]:_0x55ea75[_0xddad('0x29')];if(_0x53c761[_0xddad('0x27')]['includeAll']){_0x1823b0[_0xddad('0x2c')]=[{'all':!![]}];}_0x1823b0=_['merge']({},_0x1823b0,_0x53c761[_0xddad('0x2d')]);return db['ChatApplication'][_0xddad('0x2e')](_0x1823b0)[_0xddad('0x20')](handleEntityNotFound(_0x35a882,null))['then'](respondWithResult(_0x35a882,null))[_0xddad('0x2f')](handleError(_0x35a882,null));};exports['update']=function(_0x526205,_0x5884d2){if(_0x526205['body']['id']){delete _0x526205[_0xddad('0x30')]['id'];}return db[_0xddad('0x31')]['find']({'where':{'id':_0x526205['params']['id']}})['then'](handleEntityNotFound(_0x5884d2,null))[_0xddad('0x20')](saveUpdates(_0x526205['body'],null))[_0xddad('0x20')](respondWithResult(_0x5884d2,null))['catch'](handleError(_0x5884d2,null));};exports['destroy']=function(_0x5315aa,_0x4a16f2){return db['ChatApplication'][_0xddad('0x2e')]({'where':{'id':_0x5315aa[_0xddad('0x24')]['id']}})[_0xddad('0x20')](handleEntityNotFound(_0x4a16f2,null))[_0xddad('0x20')](removeEntity(_0x4a16f2,null))[_0xddad('0x2f')](handleError(_0x4a16f2,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 34a14fc..7ba99e7 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 _0x4112=['exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatApplication.attributes'];(function(_0x3c600d,_0x4b5c85){var _0xd195e3=function(_0x2a2f5f){while(--_0x2a2f5f){_0x3c600d['push'](_0x3c600d['shift']());}};_0xd195e3(++_0x4b5c85);}(_0x4112,0x12b));var _0x2411=function(_0x122df5,_0x29caeb){_0x122df5=_0x122df5-0x0;var _0x4f5339=_0x4112[_0x122df5];return _0x4f5339;};'use strict';var _=require(_0x2411('0x0'));var util=require(_0x2411('0x1'));var logger=require(_0x2411('0x2'))(_0x2411('0x3'));var moment=require(_0x2411('0x4'));var BPromise=require(_0x2411('0x5'));var rp=require(_0x2411('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2411('0x7'));var config=require('../../config/environment');var attributes=require(_0x2411('0x8'));module[_0x2411('0x9')]=function(_0x418ac7,_0x40d44a){return _0x418ac7[_0x2411('0xa')]('ChatApplication',attributes,{'tableName':_0x2411('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2411('0xc'),'collate':_0x2411('0xd')});}; \ No newline at end of file +var _0xb770=['./chatApplication.attributes','exports','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1f0a78,_0x54ae1f){var _0x2a706d=function(_0x23bf96){while(--_0x23bf96){_0x1f0a78['push'](_0x1f0a78['shift']());}};_0x2a706d(++_0x54ae1f);}(_0xb770,0x191));var _0x0b77=function(_0x9c2370,_0x356b32){_0x9c2370=_0x9c2370-0x0;var _0x37bed8=_0xb770[_0x9c2370];return _0x37bed8;};'use strict';var _=require(_0x0b77('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0b77('0x1'));var moment=require(_0x0b77('0x2'));var BPromise=require(_0x0b77('0x3'));var rp=require(_0x0b77('0x4'));var fs=require('fs');var path=require(_0x0b77('0x5'));var rimraf=require('rimraf');var config=require(_0x0b77('0x6'));var attributes=require(_0x0b77('0x7'));module[_0x0b77('0x8')]=function(_0x2a5023,_0x562a26){return _0x2a5023['define']('ChatApplication',attributes,{'tableName':_0x0b77('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0b77('0xa'),'collate':_0x0b77('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 86d6f12..c574c22 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 _0x86b2=['code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4227f7,_0x5e2633){var _0x4d394e=function(_0x1d7676){while(--_0x1d7676){_0x4227f7['push'](_0x4227f7['shift']());}};_0x4d394e(++_0x5e2633);}(_0x86b2,0x1c7));var _0x286b=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x86b2[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x286b('0x0'));var util=require(_0x286b('0x1'));var moment=require('moment');var BPromise=require(_0x286b('0x2'));var rs=require(_0x286b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x286b('0x4'))['db'];var utils=require(_0x286b('0x5'));var logger=require(_0x286b('0x6'))(_0x286b('0x7'));var config=require(_0x286b('0x8'));var jayson=require(_0x286b('0x9'));var client=jayson[_0x286b('0xa')][_0x286b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc60ad4,_0x43b84d,_0x233a96){return new BPromise(function(_0x348df6,_0x35eeb5){return client[_0x286b('0xc')](_0xc60ad4,_0x233a96)[_0x286b('0xd')](function(_0x42288f){logger[_0x286b('0xe')]('ChatApplication,\x20%s,\x20%s',_0x43b84d,'request\x20sent');logger[_0x286b('0xf')](_0x286b('0x10'),_0x43b84d,_0x286b('0x11'),JSON[_0x286b('0x12')](_0x42288f));if(_0x42288f['error']){if(_0x42288f[_0x286b('0x13')][_0x286b('0x14')]===0x1f4){logger[_0x286b('0x13')](_0x286b('0x15'),_0x43b84d,_0x42288f[_0x286b('0x13')][_0x286b('0x16')]);return _0x35eeb5(_0x42288f[_0x286b('0x13')]['message']);}logger[_0x286b('0x13')](_0x286b('0x15'),_0x43b84d,_0x42288f[_0x286b('0x13')][_0x286b('0x16')]);return _0x348df6(_0x42288f[_0x286b('0x13')]['message']);}else{logger['info'](_0x286b('0x15'),_0x43b84d,_0x286b('0x11'));_0x348df6(_0x42288f[_0x286b('0x17')][_0x286b('0x16')]);}})[_0x286b('0x18')](function(_0x495f19){logger[_0x286b('0x13')](_0x286b('0x15'),_0x43b84d,_0x495f19);_0x35eeb5(_0x495f19);});});} \ No newline at end of file +var _0x161c=['jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x3a74d1,_0x1b29a2){var _0x277b73=function(_0x19e5a7){while(--_0x19e5a7){_0x3a74d1['push'](_0x3a74d1['shift']());}};_0x277b73(++_0x1b29a2);}(_0x161c,0x1b0));var _0xc161=function(_0x3245a4,_0x5bd4b0){_0x3245a4=_0x3245a4-0x0;var _0x4e25c4=_0x161c[_0x3245a4];return _0x4e25c4;};'use strict';var _=require(_0xc161('0x0'));var util=require(_0xc161('0x1'));var moment=require(_0xc161('0x2'));var BPromise=require(_0xc161('0x3'));var rs=require(_0xc161('0x4'));var fs=require('fs');var Redis=require(_0xc161('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc161('0x6'));var logger=require('../../config/logger')(_0xc161('0x7'));var config=require('../../config/environment');var jayson=require(_0xc161('0x8'));var client=jayson['client'][_0xc161('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c609d,_0x1e9e52,_0x275068){return new BPromise(function(_0x481f47,_0x3314aa){return client[_0xc161('0xa')](_0x2c609d,_0x275068)[_0xc161('0xb')](function(_0x291964){logger[_0xc161('0xc')](_0xc161('0xd'),_0x1e9e52,_0xc161('0xe'));logger[_0xc161('0xf')](_0xc161('0x10'),_0x1e9e52,_0xc161('0xe'),JSON[_0xc161('0x11')](_0x291964));if(_0x291964[_0xc161('0x12')]){if(_0x291964[_0xc161('0x12')]['code']===0x1f4){logger[_0xc161('0x12')](_0xc161('0xd'),_0x1e9e52,_0x291964[_0xc161('0x12')][_0xc161('0x13')]);return _0x3314aa(_0x291964[_0xc161('0x12')]['message']);}logger[_0xc161('0x12')]('ChatApplication,\x20%s,\x20%s',_0x1e9e52,_0x291964[_0xc161('0x12')][_0xc161('0x13')]);return _0x481f47(_0x291964[_0xc161('0x12')][_0xc161('0x13')]);}else{logger[_0xc161('0xc')](_0xc161('0xd'),_0x1e9e52,_0xc161('0xe'));_0x481f47(_0x291964[_0xc161('0x14')][_0xc161('0x13')]);}})[_0xc161('0x15')](function(_0x4abfd3){logger[_0xc161('0x12')](_0xc161('0xd'),_0x1e9e52,_0x4abfd3);_0x3314aa(_0x4abfd3);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 39dde84..d0a1920 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 _0xb552=['show','put','isAuthenticated','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id'];(function(_0x378891,_0x4e3e16){var _0xfbfda2=function(_0x3b7681){while(--_0x3b7681){_0x378891['push'](_0x378891['shift']());}};_0xfbfda2(++_0x4e3e16);}(_0xb552,0x8e));var _0x2b55=function(_0x4c8a02,_0x35a179){_0x4c8a02=_0x4c8a02-0x0;var _0x259314=_0xb552[_0x4c8a02];return _0x259314;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b55('0x0'));var timeout=require(_0x2b55('0x1'));var express=require(_0x2b55('0x2'));var router=express[_0x2b55('0x3')]();var fs_extra=require(_0x2b55('0x4'));var auth=require(_0x2b55('0x5'));var interaction=require(_0x2b55('0x6'));var config=require(_0x2b55('0x7'));var controller=require(_0x2b55('0x8'));router[_0x2b55('0x9')](_0x2b55('0xa'),auth['isAuthenticated'](),controller[_0x2b55('0xb')]);router[_0x2b55('0xc')](_0x2b55('0xa'),auth[_0x2b55('0xd')](),controller['update']);router[_0x2b55('0xe')](_0x2b55('0xa'),auth['isAuthenticated'](),controller[_0x2b55('0xf')]);module[_0x2b55('0x10')]=router; \ No newline at end of file +var _0xad86=['exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','update','delete','isAuthenticated'];(function(_0x1ae139,_0x529c60){var _0x5e0de7=function(_0x2b8273){while(--_0x2b8273){_0x1ae139['push'](_0x1ae139['shift']());}};_0x5e0de7(++_0x529c60);}(_0xad86,0x15a));var _0x6ad8=function(_0x2b3c84,_0x44221c){_0x2b3c84=_0x2b3c84-0x0;var _0x18b3d3=_0xad86[_0x2b3c84];return _0x18b3d3;};'use strict';var multer=require(_0x6ad8('0x0'));var util=require(_0x6ad8('0x1'));var path=require('path');var timeout=require(_0x6ad8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6ad8('0x3'));var auth=require(_0x6ad8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ad8('0x5'));var controller=require(_0x6ad8('0x6'));router[_0x6ad8('0x7')](_0x6ad8('0x8'),auth['isAuthenticated'](),controller[_0x6ad8('0x9')]);router[_0x6ad8('0xa')](_0x6ad8('0x8'),auth['isAuthenticated'](),controller[_0x6ad8('0xb')]);router[_0x6ad8('0xc')](_0x6ad8('0x8'),auth[_0x6ad8('0xd')](),controller['destroy']);module[_0x6ad8('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index eb31419..1befe71 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 _0x8303=['STRING','BOOLEAN','sequelize'];(function(_0x2e6f86,_0x436c8b){var _0x5adcef=function(_0x39f035){while(--_0x39f035){_0x2e6f86['push'](_0x2e6f86['shift']());}};_0x5adcef(++_0x436c8b);}(_0x8303,0xaa));var _0x3830=function(_0xdb7ee3,_0x2274e9){_0xdb7ee3=_0xdb7ee3-0x0;var _0x42419f=_0x8303[_0xdb7ee3];return _0x42419f;};'use strict';var Sequelize=require(_0x3830('0x0'));module['exports']={'name':{'type':Sequelize[_0x3830('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3830('0x1')]},'write':{'type':Sequelize[_0x3830('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5e8d=['STRING','BOOLEAN','sequelize','exports'];(function(_0x428ad0,_0x1725cc){var _0x4b3fd7=function(_0x38cd38){while(--_0x38cd38){_0x428ad0['push'](_0x428ad0['shift']());}};_0x4b3fd7(++_0x1725cc);}(_0x5e8d,0x11a));var _0xd5e8=function(_0x15b642,_0x10e817){_0x15b642=_0x15b642-0x0;var _0x18e96c=_0x5e8d[_0x15b642];return _0x18e96c;};'use strict';var Sequelize=require(_0xd5e8('0x0'));module[_0xd5e8('0x1')]={'name':{'type':Sequelize[_0xd5e8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd5e8('0x2')]},'write':{'type':Sequelize[_0xd5e8('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 96ed294..7046509 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 _0x1fce=['removeMembers','addMessage','order','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','pick','nolimit'];(function(_0x23733d,_0x56f0a1){var _0x4a9cc4=function(_0x26f9ab){while(--_0x26f9ab){_0x23733d['push'](_0x23733d['shift']());}};_0x4a9cc4(++_0x56f0a1);}(_0x1fce,0x6a));var _0xe1fc=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x1fce[_0x3ea913];return _0x2b4f28;};'use strict';var emlformat=require(_0xe1fc('0x0'));var rimraf=require(_0xe1fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe1fc('0x2'));var rp=require(_0xe1fc('0x3'));var moment=require(_0xe1fc('0x4'));var BPromise=require(_0xe1fc('0x5'));var Mustache=require(_0xe1fc('0x6'));var util=require(_0xe1fc('0x7'));var path=require(_0xe1fc('0x8'));var sox=require(_0xe1fc('0x9'));var csv=require(_0xe1fc('0xa'));var ejs=require(_0xe1fc('0xb'));var fs=require('fs');var fs_extra=require(_0xe1fc('0xc'));var _=require(_0xe1fc('0xd'));var squel=require(_0xe1fc('0xe'));var crypto=require(_0xe1fc('0xf'));var jsforce=require(_0xe1fc('0x10'));var deskjs=require(_0xe1fc('0x11'));var toCsv=require(_0xe1fc('0xa'));var querystring=require('querystring');var Papa=require(_0xe1fc('0x12'));var Redis=require(_0xe1fc('0x13'));var authService=require(_0xe1fc('0x14'));var qs=require(_0xe1fc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe1fc('0x16'));var logger=require('../../config/logger')(_0xe1fc('0x17'));var utils=require(_0xe1fc('0x18'));var config=require(_0xe1fc('0x19'));var licenseUtil=require(_0xe1fc('0x1a'));var db=require(_0xe1fc('0x1b'))['db'];config[_0xe1fc('0x1c')]=_[_0xe1fc('0x1d')](config[_0xe1fc('0x1c')],{'host':_0xe1fc('0x1e'),'port':0x18eb});var socket=require(_0xe1fc('0x1f'))(new Redis(config[_0xe1fc('0x1c')]));require(_0xe1fc('0x20'))[_0xe1fc('0x21')](socket);function respondWithStatusCode(_0x43b144,_0x33d6ce){_0x33d6ce=_0x33d6ce||0xcc;return function(_0x36717c){if(_0x36717c){return _0x43b144['sendStatus'](_0x33d6ce);}return _0x43b144[_0xe1fc('0x22')](_0x33d6ce)['end']();};}function respondWithResult(_0x366310,_0x14883d){_0x14883d=_0x14883d||0xc8;return function(_0x138bdc){if(_0x138bdc){return _0x366310[_0xe1fc('0x22')](_0x14883d)[_0xe1fc('0x23')](_0x138bdc);}};}function respondWithFilteredResult(_0xe634b0,_0x49d578){return function(_0x641eaa){if(_0x641eaa){var _0xc8c62f=typeof _0x49d578[_0xe1fc('0x24')]==='undefined'&&typeof _0x49d578[_0xe1fc('0x25')]===_0xe1fc('0x26');var _0x132faf=_0x641eaa[_0xe1fc('0x27')];var _0x57645d=_0xc8c62f?0x0:_0x49d578[_0xe1fc('0x24')];var _0x4a062d=_0xc8c62f?_0x641eaa[_0xe1fc('0x27')]:_0x49d578[_0xe1fc('0x24')]+_0x49d578[_0xe1fc('0x25')];var _0x684671;if(_0x4a062d>=_0x132faf){_0x4a062d=_0x132faf;_0x684671=0xc8;}else{_0x684671=0xce;}_0xe634b0[_0xe1fc('0x22')](_0x684671);return _0xe634b0['set']('Content-Range',_0x57645d+'-'+_0x4a062d+'/'+_0x132faf)[_0xe1fc('0x23')](_0x641eaa);}return null;};}function patchUpdates(_0x107e11){return function(_0x7254ad){try{jsonpatch[_0xe1fc('0x28')](_0x7254ad,_0x107e11,!![]);}catch(_0x3099c0){return BPromise[_0xe1fc('0x29')](_0x3099c0);}return _0x7254ad[_0xe1fc('0x2a')]();};}function saveUpdates(_0x4dffbb,_0x2160d1){return function(_0x5eb3f0){if(_0x5eb3f0){return _0x5eb3f0[_0xe1fc('0x2b')](_0x4dffbb)[_0xe1fc('0x2c')](function(_0x5c9560){return _0x5c9560;});}return null;};}function removeEntity(_0x4230dd,_0x237e6c){return function(_0x11dc63){if(_0x11dc63){return _0x11dc63[_0xe1fc('0x2d')]()['then'](function(){_0x4230dd[_0xe1fc('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x244013,_0x3a922c){return function(_0x4220dd){if(!_0x4220dd){_0x244013['sendStatus'](0x194);}return _0x4220dd;};}function handleError(_0x5b2191,_0x27674e){_0x27674e=_0x27674e||0x1f4;return function(_0x24fd39){logger[_0xe1fc('0x2e')](_0x24fd39[_0xe1fc('0x2f')]);if(_0x24fd39[_0xe1fc('0x30')]){delete _0x24fd39[_0xe1fc('0x30')];}_0x5b2191[_0xe1fc('0x22')](_0x27674e)[_0xe1fc('0x31')](_0x24fd39);};}exports[_0xe1fc('0x32')]=function(_0x44fd19,_0x447db6){var _0x45b3f0={},_0x5e2751={},_0x215afc={'count':0x0,'rows':[]};var _0x438943=_[_0xe1fc('0x33')](db[_0xe1fc('0x34')][_0xe1fc('0x35')],function(_0x195a83){return{'name':_0x195a83['fieldName'],'type':_0x195a83[_0xe1fc('0x36')][_0xe1fc('0x37')]};});_0x5e2751['model']=_[_0xe1fc('0x33')](_0x438943,_0xe1fc('0x30'));_0x5e2751[_0xe1fc('0x38')]=_[_0xe1fc('0x39')](_0x44fd19['query']);_0x5e2751['filters']=_[_0xe1fc('0x3a')](_0x5e2751[_0xe1fc('0x3b')],_0x5e2751[_0xe1fc('0x38')]);_0x45b3f0[_0xe1fc('0x3c')]=_[_0xe1fc('0x3a')](_0x5e2751[_0xe1fc('0x3b')],qs[_0xe1fc('0x3d')](_0x44fd19[_0xe1fc('0x38')]['fields']));_0x45b3f0['attributes']=_0x45b3f0['attributes']['length']?_0x45b3f0[_0xe1fc('0x3c')]:_0x5e2751[_0xe1fc('0x3b')];if(!_0x44fd19['query'][_0xe1fc('0x3e')]('nolimit')){_0x45b3f0['limit']=qs[_0xe1fc('0x25')](_0x44fd19[_0xe1fc('0x38')][_0xe1fc('0x25')]);_0x45b3f0[_0xe1fc('0x24')]=qs[_0xe1fc('0x24')](_0x44fd19['query'][_0xe1fc('0x24')]);}_0x45b3f0['order']=qs['sort'](_0x44fd19[_0xe1fc('0x38')][_0xe1fc('0x3f')]);_0x45b3f0['where']=qs[_0xe1fc('0x40')](_['pick'](_0x44fd19['query'],_0x5e2751['filters']),_0x438943);if(_0x44fd19[_0xe1fc('0x38')][_0xe1fc('0x41')]){_0x45b3f0[_0xe1fc('0x42')]=_['merge'](_0x45b3f0[_0xe1fc('0x42')],{'$or':_[_0xe1fc('0x33')](_0x438943,function(_0x534f99){if(_0x534f99['type']!==_0xe1fc('0x43')){var _0x293b6f={};_0x293b6f[_0x534f99['name']]={'$like':'%'+_0x44fd19[_0xe1fc('0x38')][_0xe1fc('0x41')]+'%'};return _0x293b6f;}})});}_0x45b3f0=_[_0xe1fc('0x44')]({},_0x45b3f0,_0x44fd19[_0xe1fc('0x45')]);var _0xbf003a={'where':_0x45b3f0[_0xe1fc('0x42')]};return db[_0xe1fc('0x34')][_0xe1fc('0x27')](_0xbf003a)[_0xe1fc('0x2c')](function(_0x3b1219){_0x215afc['count']=_0x3b1219;if(_0x44fd19[_0xe1fc('0x38')][_0xe1fc('0x46')]){_0x45b3f0[_0xe1fc('0x47')]=[{'all':!![]}];}return db[_0xe1fc('0x34')][_0xe1fc('0x48')](_0x45b3f0);})[_0xe1fc('0x2c')](function(_0x2ccd58){_0x215afc[_0xe1fc('0x49')]=_0x2ccd58;return _0x215afc;})[_0xe1fc('0x2c')](respondWithFilteredResult(_0x447db6,_0x45b3f0))[_0xe1fc('0x4a')](handleError(_0x447db6,null));};exports['show']=function(_0x602e0b,_0x279f10){var _0x3efc20={'raw':!![],'where':{'id':_0x602e0b[_0xe1fc('0x4b')]['id']}},_0x571290={};_0x571290[_0xe1fc('0x3b')]=_['keys'](db[_0xe1fc('0x34')][_0xe1fc('0x35')]);_0x571290[_0xe1fc('0x38')]=_['keys'](_0x602e0b['query']);_0x571290[_0xe1fc('0x40')]=_[_0xe1fc('0x3a')](_0x571290['model'],_0x571290[_0xe1fc('0x38')]);_0x3efc20['attributes']=_[_0xe1fc('0x3a')](_0x571290['model'],qs[_0xe1fc('0x3d')](_0x602e0b[_0xe1fc('0x38')][_0xe1fc('0x3d')]));_0x3efc20['attributes']=_0x3efc20[_0xe1fc('0x3c')][_0xe1fc('0x4c')]?_0x3efc20[_0xe1fc('0x3c')]:_0x571290[_0xe1fc('0x3b')];if(_0x602e0b[_0xe1fc('0x38')][_0xe1fc('0x46')]){_0x3efc20[_0xe1fc('0x47')]=[{'all':!![]}];}_0x3efc20=_[_0xe1fc('0x44')]({},_0x3efc20,_0x602e0b[_0xe1fc('0x45')]);return db[_0xe1fc('0x34')][_0xe1fc('0x4d')](_0x3efc20)[_0xe1fc('0x2c')](handleEntityNotFound(_0x279f10,null))[_0xe1fc('0x2c')](respondWithResult(_0x279f10,null))['catch'](handleError(_0x279f10,null));};exports[_0xe1fc('0x4e')]=function(_0x2be741,_0x293ac0){return db[_0xe1fc('0x34')][_0xe1fc('0x4e')](_0x2be741[_0xe1fc('0x4f')],{})[_0xe1fc('0x2c')](respondWithResult(_0x293ac0,0xc9))[_0xe1fc('0x4a')](handleError(_0x293ac0,null));};exports[_0xe1fc('0x2b')]=function(_0x1b7050,_0x1f02b3){if(_0x1b7050['body']['id']){delete _0x1b7050[_0xe1fc('0x4f')]['id'];}return db[_0xe1fc('0x34')][_0xe1fc('0x4d')]({'where':{'id':_0x1b7050[_0xe1fc('0x4b')]['id']}})[_0xe1fc('0x2c')](handleEntityNotFound(_0x1f02b3,null))[_0xe1fc('0x2c')](saveUpdates(_0x1b7050[_0xe1fc('0x4f')],null))['then'](respondWithResult(_0x1f02b3,null))[_0xe1fc('0x4a')](handleError(_0x1f02b3,null));};exports[_0xe1fc('0x2d')]=function(_0x24d77e,_0x471bea){return db[_0xe1fc('0x34')]['find']({'where':{'id':_0x24d77e[_0xe1fc('0x4b')]['id']}})[_0xe1fc('0x2c')](handleEntityNotFound(_0x471bea,null))[_0xe1fc('0x2c')](removeEntity(_0x471bea,null))[_0xe1fc('0x4a')](handleError(_0x471bea,null));};exports[_0xe1fc('0x50')]=function(_0x1f8315,_0x3f059e){return db[_0xe1fc('0x34')][_0xe1fc('0x50')]()[_0xe1fc('0x2c')](respondWithResult(_0x3f059e,null))['catch'](handleError(_0x3f059e,null));};exports[_0xe1fc('0x51')]=function(_0x9e974e,_0x341bc7,_0x305b46){return db[_0xe1fc('0x52')]['count']({'where':{'ChatGroupId':_0x9e974e[_0xe1fc('0x4b')]['id'],'ToId':_0x9e974e[_0xe1fc('0x53')]['id'],'read':![]}})['then'](function(_0x210b78){return{'id':_[_0xe1fc('0x54')](_0x9e974e[_0xe1fc('0x4b')]['id']),'count':_0x210b78};})['then'](respondWithResult(_0x341bc7,null))[_0xe1fc('0x4a')](handleError(_0x341bc7,null));};exports[_0xe1fc('0x55')]=function(_0xdb7a51,_0x30fd93,_0x1fd6a){return db['ChatGroup'][_0xe1fc('0x4d')]({'where':{'id':_0xdb7a51[_0xe1fc('0x4b')]['id']}})[_0xe1fc('0x2c')](handleEntityNotFound(_0x30fd93,null))[_0xe1fc('0x2c')](function(_0x360d90){if(_0x360d90){return _0x360d90[_0xe1fc('0x55')](_0xdb7a51[_0xe1fc('0x4f')][_0xe1fc('0x56')],_['omit'](_0xdb7a51[_0xe1fc('0x4f')],[_0xe1fc('0x56'),'id'])||{});}})['then'](respondWithResult(_0x30fd93,null))[_0xe1fc('0x4a')](handleError(_0x30fd93,null));};exports[_0xe1fc('0x57')]=function(_0x64f62c,_0x1c0c91,_0x4d44b3){var _0x26214d={};var _0x29e30e={};var _0x1be5e7;var _0x5cbf3c;return db[_0xe1fc('0x34')][_0xe1fc('0x58')]({'where':{'id':_0x64f62c[_0xe1fc('0x4b')]['id']}})[_0xe1fc('0x2c')](handleEntityNotFound(_0x1c0c91,null))[_0xe1fc('0x2c')](function(_0xed1acc){if(_0xed1acc){_0x1be5e7=_0xed1acc;_0x29e30e['model']=_['keys'](db[_0xe1fc('0x59')]['rawAttributes']);_0x29e30e['query']=_[_0xe1fc('0x39')](_0x64f62c[_0xe1fc('0x38')]);_0x29e30e[_0xe1fc('0x40')]=_[_0xe1fc('0x3a')](_0x29e30e[_0xe1fc('0x3b')],_0x29e30e[_0xe1fc('0x38')]);_0x26214d[_0xe1fc('0x3c')]=_['intersection'](_0x29e30e['model'],qs[_0xe1fc('0x3d')](_0x64f62c[_0xe1fc('0x38')][_0xe1fc('0x3d')]));_0x26214d[_0xe1fc('0x3c')]=_0x26214d[_0xe1fc('0x3c')][_0xe1fc('0x4c')]?_0x26214d[_0xe1fc('0x3c')]:_0x29e30e[_0xe1fc('0x3b')];_0x26214d['order']=qs[_0xe1fc('0x3f')](_0x64f62c['query']['sort']);_0x26214d[_0xe1fc('0x42')]=qs[_0xe1fc('0x40')](_[_0xe1fc('0x5a')](_0x64f62c[_0xe1fc('0x38')],_0x29e30e[_0xe1fc('0x40')]));if(_0x64f62c[_0xe1fc('0x38')][_0xe1fc('0x41')]){_0x26214d[_0xe1fc('0x42')]=_[_0xe1fc('0x44')](_0x26214d[_0xe1fc('0x42')],{'$or':_['map'](_0x26214d['attributes'],function(_0x197f53){var _0x586260={};_0x586260[_0x197f53]={'$like':'%'+_0x64f62c['query'][_0xe1fc('0x41')]+'%'};return _0x586260;})});}_0x26214d=_[_0xe1fc('0x44')]({},_0x26214d,_0x64f62c[_0xe1fc('0x45')]);return _0x1be5e7[_0xe1fc('0x57')](_0x26214d);}})['then'](function(_0x4bbce2){if(_0x4bbce2){_0x5cbf3c=_0x4bbce2['length'];if(!_0x64f62c[_0xe1fc('0x38')]['hasOwnProperty'](_0xe1fc('0x5b'))){_0x26214d[_0xe1fc('0x25')]=qs[_0xe1fc('0x25')](_0x64f62c[_0xe1fc('0x38')][_0xe1fc('0x25')]);_0x26214d[_0xe1fc('0x24')]=qs[_0xe1fc('0x24')](_0x64f62c[_0xe1fc('0x38')][_0xe1fc('0x24')]);}return _0x1be5e7[_0xe1fc('0x57')](_0x26214d);}})[_0xe1fc('0x2c')](function(_0x21437a){if(_0x21437a){return _0x21437a?{'count':_0x5cbf3c,'rows':_0x21437a}:null;}})[_0xe1fc('0x2c')](respondWithResult(_0x1c0c91,null))[_0xe1fc('0x4a')](handleError(_0x1c0c91,null));};exports['removeMembers']=function(_0x313ce2,_0x134bea,_0x2ac879){return db[_0xe1fc('0x34')]['find']({'where':{'id':_0x313ce2[_0xe1fc('0x4b')]['id']}})[_0xe1fc('0x2c')](handleEntityNotFound(_0x134bea,null))[_0xe1fc('0x2c')](function(_0x46b923){if(_0x46b923){return _0x46b923[_0xe1fc('0x5c')](_0x313ce2[_0xe1fc('0x38')][_0xe1fc('0x56')]);}})[_0xe1fc('0x2c')](respondWithStatusCode(_0x134bea,null))['catch'](handleError(_0x134bea,null));};exports[_0xe1fc('0x5d')]=function(_0x5427db,_0x393d95,_0xa3d14){if(_0x5427db[_0xe1fc('0x4f')]['id']){delete _0x5427db[_0xe1fc('0x4f')]['id'];}return db[_0xe1fc('0x34')][_0xe1fc('0x4d')]({'where':{'id':_0x5427db['params']['id']}})['then'](handleEntityNotFound(_0x393d95,null))[_0xe1fc('0x2c')](function(_0x14d4d3){if(_0x14d4d3){_0x5427db[_0xe1fc('0x4f')]['ChatGroupId']=_0x14d4d3['id'];return db[_0xe1fc('0x52')][_0xe1fc('0x4e')](_0x5427db[_0xe1fc('0x4f')]);}})[_0xe1fc('0x2c')](respondWithResult(_0x393d95,null))['catch'](handleError(_0x393d95,null));};exports['getMessages']=function(_0x5a890d,_0x1a20c5,_0x506798){var _0x322467={};var _0x180c02={};var _0x4c3567;var _0x268186;return db[_0xe1fc('0x34')][_0xe1fc('0x58')]({'where':{'id':_0x5a890d[_0xe1fc('0x4b')]['id']}})[_0xe1fc('0x2c')](handleEntityNotFound(_0x1a20c5,null))[_0xe1fc('0x2c')](function(_0xc8cdfc){if(_0xc8cdfc){_0x4c3567=_0xc8cdfc;_0x180c02[_0xe1fc('0x3b')]=_[_0xe1fc('0x39')](db[_0xe1fc('0x52')][_0xe1fc('0x35')]);_0x180c02['query']=_[_0xe1fc('0x39')](_0x5a890d[_0xe1fc('0x38')]);_0x180c02[_0xe1fc('0x40')]=_[_0xe1fc('0x3a')](_0x180c02[_0xe1fc('0x3b')],_0x180c02[_0xe1fc('0x38')]);_0x322467[_0xe1fc('0x3c')]=_[_0xe1fc('0x3a')](_0x180c02[_0xe1fc('0x3b')],qs[_0xe1fc('0x3d')](_0x5a890d[_0xe1fc('0x38')][_0xe1fc('0x3d')]));_0x322467[_0xe1fc('0x3c')]=_0x322467[_0xe1fc('0x3c')][_0xe1fc('0x4c')]?_0x322467[_0xe1fc('0x3c')]:_0x180c02[_0xe1fc('0x3b')];_0x322467[_0xe1fc('0x5e')]=qs[_0xe1fc('0x3f')](_0x5a890d[_0xe1fc('0x38')][_0xe1fc('0x3f')]);_0x322467[_0xe1fc('0x42')]=qs['filters'](_[_0xe1fc('0x5a')](_0x5a890d[_0xe1fc('0x38')],_0x180c02[_0xe1fc('0x40')]));if(_0x5a890d[_0xe1fc('0x38')][_0xe1fc('0x41')]){_0x322467[_0xe1fc('0x42')]=_[_0xe1fc('0x44')](_0x322467[_0xe1fc('0x42')],{'$or':_[_0xe1fc('0x33')](_0x322467['attributes'],function(_0x5a20d){var _0x16deb1={};_0x16deb1[_0x5a20d]={'$like':'%'+_0x5a890d[_0xe1fc('0x38')]['filter']+'%'};return _0x16deb1;})});}if(_0x5a890d[_0xe1fc('0x38')][_0xe1fc('0x5f')]){var _0x59ae2c=_0x5a890d[_0xe1fc('0x38')][_0xe1fc('0x5f')]['split'](',');var _0x4f34bf={};_0x4f34bf[_0x59ae2c[0x0]]={'$gte':moment(_0x59ae2c[0x1])[_0xe1fc('0x60')](_0xe1fc('0x61'))};_0x322467['where']=_['merge'](_0x322467[_0xe1fc('0x42')],_0x4f34bf);}_0x322467=_[_0xe1fc('0x44')]({},_0x322467,_0x5a890d[_0xe1fc('0x45')]);return _0x4c3567['getMessages'](_0x322467);}})[_0xe1fc('0x2c')](function(_0x513b0f){if(_0x513b0f){_0x268186=_0x513b0f[_0xe1fc('0x4c')];if(!_0x5a890d[_0xe1fc('0x38')]['hasOwnProperty'](_0xe1fc('0x5b'))){_0x322467[_0xe1fc('0x25')]=qs['limit'](_0x5a890d['query'][_0xe1fc('0x25')]);_0x322467[_0xe1fc('0x24')]=qs[_0xe1fc('0x24')](_0x5a890d[_0xe1fc('0x38')][_0xe1fc('0x24')]);}return _0x4c3567[_0xe1fc('0x62')](_0x322467);}})['then'](function(_0xa446ae){if(_0xa446ae){return _0xa446ae?{'count':_0x268186,'rows':_0xa446ae}:null;}})['then'](respondWithResult(_0x1a20c5,null))[_0xe1fc('0x4a')](handleError(_0x1a20c5,null));}; \ No newline at end of file +var _0xeec0=['error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','User','pick','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xeec0,0x9e));var _0x0eec=function(_0x213b6c,_0x2ce0ce){_0x213b6c=_0x213b6c-0x0;var _0x146be0=_0xeec0[_0x213b6c];return _0x146be0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0eec('0x0'));var zipdir=require(_0x0eec('0x1'));var jsonpatch=require(_0x0eec('0x2'));var rp=require('request-promise');var moment=require(_0x0eec('0x3'));var BPromise=require(_0x0eec('0x4'));var Mustache=require(_0x0eec('0x5'));var util=require(_0x0eec('0x6'));var path=require(_0x0eec('0x7'));var sox=require(_0x0eec('0x8'));var csv=require(_0x0eec('0x9'));var ejs=require(_0x0eec('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0eec('0xb'));var squel=require('squel');var crypto=require(_0x0eec('0xc'));var jsforce=require(_0x0eec('0xd'));var deskjs=require(_0x0eec('0xe'));var toCsv=require(_0x0eec('0x9'));var querystring=require(_0x0eec('0xf'));var Papa=require(_0x0eec('0x10'));var Redis=require(_0x0eec('0x11'));var authService=require(_0x0eec('0x12'));var qs=require(_0x0eec('0x13'));var as=require(_0x0eec('0x14'));var hardwareService=require(_0x0eec('0x15'));var logger=require(_0x0eec('0x16'))(_0x0eec('0x17'));var utils=require(_0x0eec('0x18'));var config=require(_0x0eec('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0eec('0x1a'))['db'];config[_0x0eec('0x1b')]=_[_0x0eec('0x1c')](config[_0x0eec('0x1b')],{'host':_0x0eec('0x1d'),'port':0x18eb});var socket=require(_0x0eec('0x1e'))(new Redis(config[_0x0eec('0x1b')]));require('./chatGroup.socket')[_0x0eec('0x1f')](socket);function respondWithStatusCode(_0x158962,_0x41bd56){_0x41bd56=_0x41bd56||0xcc;return function(_0x1d4e7d){if(_0x1d4e7d){return _0x158962[_0x0eec('0x20')](_0x41bd56);}return _0x158962[_0x0eec('0x21')](_0x41bd56)[_0x0eec('0x22')]();};}function respondWithResult(_0x164b9e,_0x6cda44){_0x6cda44=_0x6cda44||0xc8;return function(_0x49aa66){if(_0x49aa66){return _0x164b9e['status'](_0x6cda44)['json'](_0x49aa66);}};}function respondWithFilteredResult(_0x470ff0,_0xc2db9a){return function(_0x406609){if(_0x406609){var _0x5a171b=typeof _0xc2db9a[_0x0eec('0x23')]===_0x0eec('0x24')&&typeof _0xc2db9a[_0x0eec('0x25')]===_0x0eec('0x24');var _0x36df21=_0x406609[_0x0eec('0x26')];var _0x3434cb=_0x5a171b?0x0:_0xc2db9a[_0x0eec('0x23')];var _0x40454b=_0x5a171b?_0x406609['count']:_0xc2db9a[_0x0eec('0x23')]+_0xc2db9a[_0x0eec('0x25')];var _0x5eb336;if(_0x40454b>=_0x36df21){_0x40454b=_0x36df21;_0x5eb336=0xc8;}else{_0x5eb336=0xce;}_0x470ff0[_0x0eec('0x21')](_0x5eb336);return _0x470ff0['set'](_0x0eec('0x27'),_0x3434cb+'-'+_0x40454b+'/'+_0x36df21)[_0x0eec('0x28')](_0x406609);}return null;};}function patchUpdates(_0x338ca8){return function(_0x21d267){try{jsonpatch[_0x0eec('0x29')](_0x21d267,_0x338ca8,!![]);}catch(_0x13c7eb){return BPromise[_0x0eec('0x2a')](_0x13c7eb);}return _0x21d267[_0x0eec('0x2b')]();};}function saveUpdates(_0x1e4d1b,_0x231e56){return function(_0x58004a){if(_0x58004a){return _0x58004a['update'](_0x1e4d1b)[_0x0eec('0x2c')](function(_0x54b64b){return _0x54b64b;});}return null;};}function removeEntity(_0x43b610,_0x213202){return function(_0x294aaa){if(_0x294aaa){return _0x294aaa[_0x0eec('0x2d')]()['then'](function(){_0x43b610[_0x0eec('0x21')](0xcc)[_0x0eec('0x22')]();});}};}function handleEntityNotFound(_0x378a14,_0x3d96ec){return function(_0x87bd14){if(!_0x87bd14){_0x378a14['sendStatus'](0x194);}return _0x87bd14;};}function handleError(_0x47932f,_0x1894a0){_0x1894a0=_0x1894a0||0x1f4;return function(_0x524ff8){logger[_0x0eec('0x2e')](_0x524ff8[_0x0eec('0x2f')]);if(_0x524ff8[_0x0eec('0x30')]){delete _0x524ff8[_0x0eec('0x30')];}_0x47932f[_0x0eec('0x21')](_0x1894a0)[_0x0eec('0x31')](_0x524ff8);};}exports[_0x0eec('0x32')]=function(_0x40afa4,_0x3704c6){var _0x2e7f7c={},_0x40ce06={},_0x18cdc2={'count':0x0,'rows':[]};var _0x3467ef=_[_0x0eec('0x33')](db[_0x0eec('0x34')][_0x0eec('0x35')],function(_0x5008aa){return{'name':_0x5008aa['fieldName'],'type':_0x5008aa[_0x0eec('0x36')][_0x0eec('0x37')]};});_0x40ce06['model']=_[_0x0eec('0x33')](_0x3467ef,'name');_0x40ce06[_0x0eec('0x38')]=_[_0x0eec('0x39')](_0x40afa4[_0x0eec('0x38')]);_0x40ce06['filters']=_['intersection'](_0x40ce06[_0x0eec('0x3a')],_0x40ce06['query']);_0x2e7f7c[_0x0eec('0x3b')]=_[_0x0eec('0x3c')](_0x40ce06[_0x0eec('0x3a')],qs[_0x0eec('0x3d')](_0x40afa4['query'][_0x0eec('0x3d')]));_0x2e7f7c[_0x0eec('0x3b')]=_0x2e7f7c[_0x0eec('0x3b')][_0x0eec('0x3e')]?_0x2e7f7c[_0x0eec('0x3b')]:_0x40ce06['model'];if(!_0x40afa4[_0x0eec('0x38')][_0x0eec('0x3f')](_0x0eec('0x40'))){_0x2e7f7c[_0x0eec('0x25')]=qs[_0x0eec('0x25')](_0x40afa4['query'][_0x0eec('0x25')]);_0x2e7f7c[_0x0eec('0x23')]=qs[_0x0eec('0x23')](_0x40afa4['query'][_0x0eec('0x23')]);}_0x2e7f7c[_0x0eec('0x41')]=qs['sort'](_0x40afa4['query'][_0x0eec('0x42')]);_0x2e7f7c[_0x0eec('0x43')]=qs[_0x0eec('0x44')](_['pick'](_0x40afa4[_0x0eec('0x38')],_0x40ce06[_0x0eec('0x44')]),_0x3467ef);if(_0x40afa4['query'][_0x0eec('0x45')]){_0x2e7f7c[_0x0eec('0x43')]=_[_0x0eec('0x46')](_0x2e7f7c[_0x0eec('0x43')],{'$or':_[_0x0eec('0x33')](_0x3467ef,function(_0x5d52ec){if(_0x5d52ec[_0x0eec('0x36')]!=='VIRTUAL'){var _0x4a314e={};_0x4a314e[_0x5d52ec['name']]={'$like':'%'+_0x40afa4[_0x0eec('0x38')][_0x0eec('0x45')]+'%'};return _0x4a314e;}})});}_0x2e7f7c=_[_0x0eec('0x46')]({},_0x2e7f7c,_0x40afa4[_0x0eec('0x47')]);var _0x54f2d9={'where':_0x2e7f7c[_0x0eec('0x43')]};return db[_0x0eec('0x34')][_0x0eec('0x26')](_0x54f2d9)['then'](function(_0xd458a){_0x18cdc2[_0x0eec('0x26')]=_0xd458a;if(_0x40afa4['query'][_0x0eec('0x48')]){_0x2e7f7c[_0x0eec('0x49')]=[{'all':!![]}];}return db[_0x0eec('0x34')][_0x0eec('0x4a')](_0x2e7f7c);})[_0x0eec('0x2c')](function(_0x57788d){_0x18cdc2[_0x0eec('0x4b')]=_0x57788d;return _0x18cdc2;})[_0x0eec('0x2c')](respondWithFilteredResult(_0x3704c6,_0x2e7f7c))[_0x0eec('0x4c')](handleError(_0x3704c6,null));};exports[_0x0eec('0x4d')]=function(_0x4c95d8,_0x4bca31){var _0x3870fd={'raw':!![],'where':{'id':_0x4c95d8[_0x0eec('0x4e')]['id']}},_0x3fa391={};_0x3fa391[_0x0eec('0x3a')]=_['keys'](db['ChatGroup']['rawAttributes']);_0x3fa391[_0x0eec('0x38')]=_['keys'](_0x4c95d8[_0x0eec('0x38')]);_0x3fa391[_0x0eec('0x44')]=_[_0x0eec('0x3c')](_0x3fa391[_0x0eec('0x3a')],_0x3fa391[_0x0eec('0x38')]);_0x3870fd['attributes']=_[_0x0eec('0x3c')](_0x3fa391[_0x0eec('0x3a')],qs['fields'](_0x4c95d8['query'][_0x0eec('0x3d')]));_0x3870fd['attributes']=_0x3870fd['attributes'][_0x0eec('0x3e')]?_0x3870fd['attributes']:_0x3fa391[_0x0eec('0x3a')];if(_0x4c95d8['query'][_0x0eec('0x48')]){_0x3870fd[_0x0eec('0x49')]=[{'all':!![]}];}_0x3870fd=_['merge']({},_0x3870fd,_0x4c95d8[_0x0eec('0x47')]);return db[_0x0eec('0x34')]['find'](_0x3870fd)[_0x0eec('0x2c')](handleEntityNotFound(_0x4bca31,null))['then'](respondWithResult(_0x4bca31,null))[_0x0eec('0x4c')](handleError(_0x4bca31,null));};exports['create']=function(_0x25105d,_0x2ba8fc){return db['ChatGroup'][_0x0eec('0x4f')](_0x25105d[_0x0eec('0x50')],{})['then'](respondWithResult(_0x2ba8fc,0xc9))['catch'](handleError(_0x2ba8fc,null));};exports[_0x0eec('0x51')]=function(_0x520f2e,_0x4c7069){if(_0x520f2e['body']['id']){delete _0x520f2e[_0x0eec('0x50')]['id'];}return db[_0x0eec('0x34')]['find']({'where':{'id':_0x520f2e[_0x0eec('0x4e')]['id']}})[_0x0eec('0x2c')](handleEntityNotFound(_0x4c7069,null))['then'](saveUpdates(_0x520f2e[_0x0eec('0x50')],null))[_0x0eec('0x2c')](respondWithResult(_0x4c7069,null))['catch'](handleError(_0x4c7069,null));};exports[_0x0eec('0x2d')]=function(_0x17333c,_0x5b10a1){return db[_0x0eec('0x34')][_0x0eec('0x52')]({'where':{'id':_0x17333c[_0x0eec('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5b10a1,null))[_0x0eec('0x2c')](removeEntity(_0x5b10a1,null))['catch'](handleError(_0x5b10a1,null));};exports[_0x0eec('0x53')]=function(_0x3a081e,_0x67ad33){return db['ChatGroup'][_0x0eec('0x53')]()['then'](respondWithResult(_0x67ad33,null))[_0x0eec('0x4c')](handleError(_0x67ad33,null));};exports[_0x0eec('0x54')]=function(_0x25248f,_0x14f705,_0xac65aa){return db[_0x0eec('0x55')][_0x0eec('0x26')]({'where':{'ChatGroupId':_0x25248f[_0x0eec('0x4e')]['id'],'ToId':_0x25248f['user']['id'],'read':![]}})[_0x0eec('0x2c')](function(_0x37255c){return{'id':_[_0x0eec('0x56')](_0x25248f[_0x0eec('0x4e')]['id']),'count':_0x37255c};})['then'](respondWithResult(_0x14f705,null))[_0x0eec('0x4c')](handleError(_0x14f705,null));};exports[_0x0eec('0x57')]=function(_0x2d2b0d,_0x2031e5,_0x4a96ca){return db[_0x0eec('0x34')][_0x0eec('0x52')]({'where':{'id':_0x2d2b0d[_0x0eec('0x4e')]['id']}})[_0x0eec('0x2c')](handleEntityNotFound(_0x2031e5,null))[_0x0eec('0x2c')](function(_0x3d04fd){if(_0x3d04fd){return _0x3d04fd[_0x0eec('0x57')](_0x2d2b0d[_0x0eec('0x50')][_0x0eec('0x58')],_[_0x0eec('0x59')](_0x2d2b0d[_0x0eec('0x50')],['ids','id'])||{});}})[_0x0eec('0x2c')](respondWithResult(_0x2031e5,null))[_0x0eec('0x4c')](handleError(_0x2031e5,null));};exports['getMembers']=function(_0x17fb62,_0x321b9b,_0x2ff685){var _0x363780={};var _0x45c112={};var _0x37f3ea;var _0x66fd61;return db[_0x0eec('0x34')][_0x0eec('0x5a')]({'where':{'id':_0x17fb62[_0x0eec('0x4e')]['id']}})['then'](handleEntityNotFound(_0x321b9b,null))[_0x0eec('0x2c')](function(_0x4aeb19){if(_0x4aeb19){_0x37f3ea=_0x4aeb19;_0x45c112['model']=_[_0x0eec('0x39')](db[_0x0eec('0x5b')][_0x0eec('0x35')]);_0x45c112[_0x0eec('0x38')]=_[_0x0eec('0x39')](_0x17fb62[_0x0eec('0x38')]);_0x45c112['filters']=_[_0x0eec('0x3c')](_0x45c112[_0x0eec('0x3a')],_0x45c112[_0x0eec('0x38')]);_0x363780['attributes']=_[_0x0eec('0x3c')](_0x45c112[_0x0eec('0x3a')],qs['fields'](_0x17fb62[_0x0eec('0x38')]['fields']));_0x363780[_0x0eec('0x3b')]=_0x363780['attributes'][_0x0eec('0x3e')]?_0x363780[_0x0eec('0x3b')]:_0x45c112[_0x0eec('0x3a')];_0x363780[_0x0eec('0x41')]=qs['sort'](_0x17fb62[_0x0eec('0x38')]['sort']);_0x363780['where']=qs[_0x0eec('0x44')](_[_0x0eec('0x5c')](_0x17fb62[_0x0eec('0x38')],_0x45c112['filters']));if(_0x17fb62[_0x0eec('0x38')][_0x0eec('0x45')]){_0x363780[_0x0eec('0x43')]=_[_0x0eec('0x46')](_0x363780[_0x0eec('0x43')],{'$or':_['map'](_0x363780[_0x0eec('0x3b')],function(_0xeee524){var _0xf900a6={};_0xf900a6[_0xeee524]={'$like':'%'+_0x17fb62[_0x0eec('0x38')][_0x0eec('0x45')]+'%'};return _0xf900a6;})});}_0x363780=_[_0x0eec('0x46')]({},_0x363780,_0x17fb62[_0x0eec('0x47')]);return _0x37f3ea[_0x0eec('0x5d')](_0x363780);}})[_0x0eec('0x2c')](function(_0x4f9109){if(_0x4f9109){_0x66fd61=_0x4f9109[_0x0eec('0x3e')];if(!_0x17fb62[_0x0eec('0x38')]['hasOwnProperty'](_0x0eec('0x40'))){_0x363780[_0x0eec('0x25')]=qs[_0x0eec('0x25')](_0x17fb62[_0x0eec('0x38')][_0x0eec('0x25')]);_0x363780[_0x0eec('0x23')]=qs['offset'](_0x17fb62[_0x0eec('0x38')][_0x0eec('0x23')]);}return _0x37f3ea[_0x0eec('0x5d')](_0x363780);}})[_0x0eec('0x2c')](function(_0x19eb30){if(_0x19eb30){return _0x19eb30?{'count':_0x66fd61,'rows':_0x19eb30}:null;}})['then'](respondWithResult(_0x321b9b,null))[_0x0eec('0x4c')](handleError(_0x321b9b,null));};exports[_0x0eec('0x5e')]=function(_0x2a653e,_0x1155bb,_0x2130e8){return db['ChatGroup']['find']({'where':{'id':_0x2a653e[_0x0eec('0x4e')]['id']}})[_0x0eec('0x2c')](handleEntityNotFound(_0x1155bb,null))[_0x0eec('0x2c')](function(_0x2c26e3){if(_0x2c26e3){return _0x2c26e3['removeMembers'](_0x2a653e[_0x0eec('0x38')][_0x0eec('0x58')]);}})[_0x0eec('0x2c')](respondWithStatusCode(_0x1155bb,null))[_0x0eec('0x4c')](handleError(_0x1155bb,null));};exports[_0x0eec('0x5f')]=function(_0x5baad7,_0x356935,_0x5aa0c5){if(_0x5baad7['body']['id']){delete _0x5baad7[_0x0eec('0x50')]['id'];}return db[_0x0eec('0x34')][_0x0eec('0x52')]({'where':{'id':_0x5baad7['params']['id']}})[_0x0eec('0x2c')](handleEntityNotFound(_0x356935,null))[_0x0eec('0x2c')](function(_0x5a74ef){if(_0x5a74ef){_0x5baad7[_0x0eec('0x50')][_0x0eec('0x60')]=_0x5a74ef['id'];return db['ChatInternalMessage'][_0x0eec('0x4f')](_0x5baad7['body']);}})[_0x0eec('0x2c')](respondWithResult(_0x356935,null))[_0x0eec('0x4c')](handleError(_0x356935,null));};exports[_0x0eec('0x61')]=function(_0x21374b,_0x19436d,_0x10e4bf){var _0x558087={};var _0x5b7002={};var _0x121cf1;var _0x159132;return db['ChatGroup'][_0x0eec('0x5a')]({'where':{'id':_0x21374b[_0x0eec('0x4e')]['id']}})[_0x0eec('0x2c')](handleEntityNotFound(_0x19436d,null))[_0x0eec('0x2c')](function(_0x3c7a2d){if(_0x3c7a2d){_0x121cf1=_0x3c7a2d;_0x5b7002[_0x0eec('0x3a')]=_[_0x0eec('0x39')](db[_0x0eec('0x55')]['rawAttributes']);_0x5b7002['query']=_['keys'](_0x21374b['query']);_0x5b7002[_0x0eec('0x44')]=_[_0x0eec('0x3c')](_0x5b7002['model'],_0x5b7002[_0x0eec('0x38')]);_0x558087[_0x0eec('0x3b')]=_[_0x0eec('0x3c')](_0x5b7002['model'],qs[_0x0eec('0x3d')](_0x21374b['query'][_0x0eec('0x3d')]));_0x558087[_0x0eec('0x3b')]=_0x558087[_0x0eec('0x3b')][_0x0eec('0x3e')]?_0x558087[_0x0eec('0x3b')]:_0x5b7002[_0x0eec('0x3a')];_0x558087[_0x0eec('0x41')]=qs[_0x0eec('0x42')](_0x21374b[_0x0eec('0x38')]['sort']);_0x558087['where']=qs[_0x0eec('0x44')](_[_0x0eec('0x5c')](_0x21374b[_0x0eec('0x38')],_0x5b7002[_0x0eec('0x44')]));if(_0x21374b[_0x0eec('0x38')][_0x0eec('0x45')]){_0x558087['where']=_[_0x0eec('0x46')](_0x558087[_0x0eec('0x43')],{'$or':_[_0x0eec('0x33')](_0x558087['attributes'],function(_0x4064ba){var _0x3f190b={};_0x3f190b[_0x4064ba]={'$like':'%'+_0x21374b['query'][_0x0eec('0x45')]+'%'};return _0x3f190b;})});}if(_0x21374b[_0x0eec('0x38')][_0x0eec('0x62')]){var _0x46eb5b=_0x21374b[_0x0eec('0x38')][_0x0eec('0x62')][_0x0eec('0x63')](',');var _0x2cf102={};_0x2cf102[_0x46eb5b[0x0]]={'$gte':moment(_0x46eb5b[0x1])[_0x0eec('0x64')](_0x0eec('0x65'))};_0x558087['where']=_['merge'](_0x558087[_0x0eec('0x43')],_0x2cf102);}_0x558087=_[_0x0eec('0x46')]({},_0x558087,_0x21374b[_0x0eec('0x47')]);return _0x121cf1[_0x0eec('0x61')](_0x558087);}})[_0x0eec('0x2c')](function(_0x2e5465){if(_0x2e5465){_0x159132=_0x2e5465[_0x0eec('0x3e')];if(!_0x21374b['query']['hasOwnProperty']('nolimit')){_0x558087[_0x0eec('0x25')]=qs[_0x0eec('0x25')](_0x21374b['query'][_0x0eec('0x25')]);_0x558087[_0x0eec('0x23')]=qs[_0x0eec('0x23')](_0x21374b[_0x0eec('0x38')][_0x0eec('0x23')]);}return _0x121cf1[_0x0eec('0x61')](_0x558087);}})['then'](function(_0x3772ac){if(_0x3772ac){return _0x3772ac?{'count':_0x159132,'rows':_0x3772ac}:null;}})[_0x0eec('0x2c')](respondWithResult(_0x19436d,null))[_0x0eec('0x4c')](handleError(_0x19436d,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 3e029b5..aca010e 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 _0x7cfe=['remove','emit','hasOwnProperty','hook','events','setMaxListeners','save','update'];(function(_0x33918e,_0x370d49){var _0x21ad27=function(_0xfb0948){while(--_0xfb0948){_0x33918e['push'](_0x33918e['shift']());}};_0x21ad27(++_0x370d49);}(_0x7cfe,0x94));var _0xe7cf=function(_0xbb9503,_0x4bd3e6){_0xbb9503=_0xbb9503-0x0;var _0x417628=_0x7cfe[_0xbb9503];return _0x417628;};'use strict';var EventEmitter=require(_0xe7cf('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe7cf('0x1')](0x0);var events={'afterCreate':_0xe7cf('0x2'),'afterUpdate':_0xe7cf('0x3'),'afterDestroy':_0xe7cf('0x4')};function emitEvent(_0x18f5cf){return function(_0x1a035b,_0x1b15b4,_0x485c23){ChatGroupEvents[_0xe7cf('0x5')](_0x18f5cf+':'+_0x1a035b['id'],_0x1a035b);ChatGroupEvents[_0xe7cf('0x5')](_0x18f5cf,_0x1a035b);_0x485c23(null);};}for(var e in events){if(events[_0xe7cf('0x6')](e)){var event=events[e];ChatGroup[_0xe7cf('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x0e26=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','save'];(function(_0x401609,_0x5eb61d){var _0x35fd57=function(_0x5dcddd){while(--_0x5dcddd){_0x401609['push'](_0x401609['shift']());}};_0x35fd57(++_0x5eb61d);}(_0x0e26,0x19b));var _0x60e2=function(_0x1b0edf,_0x499d44){_0x1b0edf=_0x1b0edf-0x0;var _0x149666=_0x0e26[_0x1b0edf];return _0x149666;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x60e2('0x0'))['db'][_0x60e2('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x60e2('0x2'),'afterUpdate':_0x60e2('0x3'),'afterDestroy':_0x60e2('0x4')};function emitEvent(_0xa4456c){return function(_0x431bba,_0x2c63c0,_0x432250){ChatGroupEvents['emit'](_0xa4456c+':'+_0x431bba['id'],_0x431bba);ChatGroupEvents[_0x60e2('0x5')](_0xa4456c,_0x431bba);_0x432250(null);};}for(var e in events){if(events[_0x60e2('0x6')](e)){var event=events[e];ChatGroup[_0x60e2('0x7')](e,emitEvent(event));}}module[_0x60e2('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 d0f96e9..ca79502 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 _0x972f=['exports','define','ChatGroup','chat_groups','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x55edaa,_0x4a71e5){var _0x4abd20=function(_0x2ef079){while(--_0x2ef079){_0x55edaa['push'](_0x55edaa['shift']());}};_0x4abd20(++_0x4a71e5);}(_0x972f,0x149));var _0xf972=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x972f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf972('0x0'));var util=require(_0xf972('0x1'));var logger=require('../../config/logger')(_0xf972('0x2'));var moment=require(_0xf972('0x3'));var BPromise=require(_0xf972('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf972('0x5'));var rimraf=require(_0xf972('0x6'));var config=require(_0xf972('0x7'));var attributes=require(_0xf972('0x8'));module[_0xf972('0x9')]=function(_0x3e1e50,_0x2fb58f){return _0x3e1e50[_0xf972('0xa')](_0xf972('0xb'),attributes,{'tableName':_0xf972('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f0f=['moment','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api'];(function(_0xea343d,_0x311197){var _0x2c6e9c=function(_0x454bd6){while(--_0x454bd6){_0xea343d['push'](_0xea343d['shift']());}};_0x2c6e9c(++_0x311197);}(_0x0f0f,0x1ac));var _0xf0f0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0f0f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf0f0('0x0'));var util=require(_0xf0f0('0x1'));var logger=require(_0xf0f0('0x2'))(_0xf0f0('0x3'));var moment=require(_0xf0f0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0f0('0x5'));var rimraf=require('rimraf');var config=require(_0xf0f0('0x6'));var attributes=require(_0xf0f0('0x7'));module[_0xf0f0('0x8')]=function(_0x57bbbc,_0xe59b35){return _0x57bbbc[_0xf0f0('0x9')](_0xf0f0('0xa'),attributes,{'tableName':_0xf0f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 42056b5..75d87ae 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 _0x1b69=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','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','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x57bff1,_0x29ec45){var _0x8173d0=function(_0x427bf7){while(--_0x427bf7){_0x57bff1['push'](_0x57bff1['shift']());}};_0x8173d0(++_0x29ec45);}(_0x1b69,0x190));var _0x91b6=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x1b69[_0x494d1f];return _0x457b6e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x91b6('0x0'));var rs=require(_0x91b6('0x1'));var fs=require('fs');var Redis=require(_0x91b6('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x91b6('0x3'));var logger=require(_0x91b6('0x4'))(_0x91b6('0x5'));var config=require(_0x91b6('0x6'));var jayson=require(_0x91b6('0x7'));var client=jayson[_0x91b6('0x8')][_0x91b6('0x9')]({'port':0x232a});config[_0x91b6('0xa')]=_[_0x91b6('0xb')](config[_0x91b6('0xa')],{'host':_0x91b6('0xc'),'port':0x18eb});var socket=require(_0x91b6('0xd'))(new Redis(config[_0x91b6('0xa')]));require(_0x91b6('0xe'))['register'](socket);function respondWithRpcPromise(_0x563f68,_0x579e5b,_0x3580be){return new BPromise(function(_0x416bdd,_0x59c9ea){return client[_0x91b6('0xf')](_0x563f68,_0x3580be)[_0x91b6('0x10')](function(_0x45b492){logger[_0x91b6('0x11')](_0x91b6('0x12'),_0x579e5b,_0x91b6('0x13'));logger['debug'](_0x91b6('0x14'),_0x579e5b,'request\x20sent',JSON[_0x91b6('0x15')](_0x45b492));if(_0x45b492[_0x91b6('0x16')]){if(_0x45b492[_0x91b6('0x16')][_0x91b6('0x17')]===0x1f4){logger['error'](_0x91b6('0x12'),_0x579e5b,_0x45b492[_0x91b6('0x16')][_0x91b6('0x18')]);return _0x59c9ea(_0x45b492[_0x91b6('0x16')][_0x91b6('0x18')]);}logger['error'](_0x91b6('0x12'),_0x579e5b,_0x45b492[_0x91b6('0x16')][_0x91b6('0x18')]);return _0x416bdd(_0x45b492[_0x91b6('0x16')]['message']);}else{logger['info'](_0x91b6('0x12'),_0x579e5b,_0x91b6('0x13'));_0x416bdd(_0x45b492[_0x91b6('0x19')][_0x91b6('0x18')]);}})[_0x91b6('0x1a')](function(_0x34f58b){logger['error'](_0x91b6('0x12'),_0x579e5b,_0x34f58b);_0x59c9ea(_0x34f58b);});});} \ No newline at end of file +var _0x56a4=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','randomstring','../../config/utils'];(function(_0x34e655,_0x19b266){var _0x2b3214=function(_0x268aa6){while(--_0x268aa6){_0x34e655['push'](_0x34e655['shift']());}};_0x2b3214(++_0x19b266);}(_0x56a4,0x11b));var _0x456a=function(_0x8e3507,_0x7c734c){_0x8e3507=_0x8e3507-0x0;var _0x48c52b=_0x56a4[_0x8e3507];return _0x48c52b;};'use strict';var _=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var moment=require('moment');var BPromise=require(_0x456a('0x2'));var rs=require(_0x456a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x456a('0x4'));var logger=require(_0x456a('0x5'))(_0x456a('0x6'));var config=require(_0x456a('0x7'));var jayson=require(_0x456a('0x8'));var client=jayson['client'][_0x456a('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x456a('0xa')],{'host':_0x456a('0xb'),'port':0x18eb});var socket=require(_0x456a('0xc'))(new Redis(config['redis']));require(_0x456a('0xd'))['register'](socket);function respondWithRpcPromise(_0xb56df,_0x29073f,_0x3bb712){return new BPromise(function(_0x3b57ac,_0x2706a7){return client[_0x456a('0xe')](_0xb56df,_0x3bb712)[_0x456a('0xf')](function(_0xe60506){logger[_0x456a('0x10')](_0x456a('0x11'),_0x29073f,_0x456a('0x12'));logger['debug'](_0x456a('0x13'),_0x29073f,'request\x20sent',JSON['stringify'](_0xe60506));if(_0xe60506[_0x456a('0x14')]){if(_0xe60506[_0x456a('0x14')][_0x456a('0x15')]===0x1f4){logger[_0x456a('0x14')]('ChatGroup,\x20%s,\x20%s',_0x29073f,_0xe60506[_0x456a('0x14')][_0x456a('0x16')]);return _0x2706a7(_0xe60506[_0x456a('0x14')][_0x456a('0x16')]);}logger[_0x456a('0x14')](_0x456a('0x11'),_0x29073f,_0xe60506['error'][_0x456a('0x16')]);return _0x3b57ac(_0xe60506[_0x456a('0x14')][_0x456a('0x16')]);}else{logger[_0x456a('0x10')]('ChatGroup,\x20%s,\x20%s',_0x29073f,_0x456a('0x12'));_0x3b57ac(_0xe60506[_0x456a('0x17')][_0x456a('0x16')]);}})['catch'](function(_0x3d06b4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x29073f,_0x3d06b4);_0x2706a7(_0x3d06b4);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 73f0640..6cb3573 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 _0xf86e=['./chatGroup.events','save','remove','emit','removeListener','register','length','chatGroup:'];(function(_0x485abd,_0x32c7c1){var _0x3379f1=function(_0x36b528){while(--_0x36b528){_0x485abd['push'](_0x485abd['shift']());}};_0x3379f1(++_0x32c7c1);}(_0xf86e,0xf8));var _0xef86=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0xf86e[_0x4953da];return _0x2d3780;};'use strict';var ChatGroupEvents=require(_0xef86('0x0'));var events=[_0xef86('0x1'),_0xef86('0x2'),'update'];function createListener(_0x3d9379,_0x353a79){return function(_0x37eeef){_0x353a79[_0xef86('0x3')](_0x3d9379,_0x37eeef);};}function removeListener(_0x2f13d1,_0x11a015){return function(){ChatGroupEvents[_0xef86('0x4')](_0x2f13d1,_0x11a015);};}exports[_0xef86('0x5')]=function(_0x2ca95f){for(var _0x1683f2=0x0,_0x3b8425=events[_0xef86('0x6')];_0x1683f2<_0x3b8425;_0x1683f2++){var _0x1ad76d=events[_0x1683f2];var _0x28d994=createListener(_0xef86('0x7')+_0x1ad76d,_0x2ca95f);ChatGroupEvents['on'](_0x1ad76d,_0x28d994);}}; \ No newline at end of file +var _0x6e3a=['remove','update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x6e3a,0x1d2));var _0xa6e3=function(_0x2e0a85,_0x242749){_0x2e0a85=_0x2e0a85-0x0;var _0x2c49bb=_0x6e3a[_0x2e0a85];return _0x2c49bb;};'use strict';var ChatGroupEvents=require(_0xa6e3('0x0'));var events=[_0xa6e3('0x1'),_0xa6e3('0x2'),_0xa6e3('0x3')];function createListener(_0xb70ace,_0x3c9ef9){return function(_0xeb9130){_0x3c9ef9[_0xa6e3('0x4')](_0xb70ace,_0xeb9130);};}function removeListener(_0xd3d8e,_0x797163){return function(){ChatGroupEvents[_0xa6e3('0x5')](_0xd3d8e,_0x797163);};}exports[_0xa6e3('0x6')]=function(_0x4899bb){for(var _0x1f2289=0x0,_0x175d31=events[_0xa6e3('0x7')];_0x1f2289<_0x175d31;_0x1f2289++){var _0x1c1a04=events[_0x1f2289];var _0x5e2136=createListener(_0xa6e3('0x8')+_0x1c1a04,_0x4899bb);ChatGroupEvents['on'](_0x1c1a04,_0x5e2136);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 1694f0e..3a49698 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 _0x332a=['../../config/environment','./chatGroup.controller','isAuthenticated','index','get','show','/:id/unread','/:id/members','/:id/messages','getMessages','post','addMessage','put','update','/:id','delete','removeMembers','exports','util','express','Router','../../components/interaction/service'];(function(_0x4cb9e8,_0x43ac2c){var _0x398212=function(_0x3a0b8f){while(--_0x3a0b8f){_0x4cb9e8['push'](_0x4cb9e8['shift']());}};_0x398212(++_0x43ac2c);}(_0x332a,0x96));var _0xa332=function(_0x4ffa64,_0x271035){_0x4ffa64=_0x4ffa64-0x0;var _0x5da001=_0x332a[_0x4ffa64];return _0x5da001;};'use strict';var multer=require('multer');var util=require(_0xa332('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa332('0x1'));var router=express[_0xa332('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa332('0x3'));var config=require(_0xa332('0x4'));var controller=require(_0xa332('0x5'));router['get']('/',auth[_0xa332('0x6')](),controller[_0xa332('0x7')]);router[_0xa332('0x8')]('/describe',auth[_0xa332('0x6')](),controller['describe']);router[_0xa332('0x8')]('/:id',auth[_0xa332('0x6')](),controller[_0xa332('0x9')]);router[_0xa332('0x8')](_0xa332('0xa'),auth[_0xa332('0x6')](),controller['getUnread']);router[_0xa332('0x8')](_0xa332('0xb'),auth[_0xa332('0x6')](),controller['getMembers']);router[_0xa332('0x8')](_0xa332('0xc'),auth[_0xa332('0x6')](),controller[_0xa332('0xd')]);router[_0xa332('0xe')]('/',auth[_0xa332('0x6')](),controller['create']);router[_0xa332('0xe')]('/:id/members',auth[_0xa332('0x6')](),controller['addMembers']);router[_0xa332('0xe')]('/:id/messages',auth[_0xa332('0x6')](),controller[_0xa332('0xf')]);router[_0xa332('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa332('0x11')]);router['delete'](_0xa332('0x12'),auth[_0xa332('0x6')](),controller['destroy']);router[_0xa332('0x13')](_0xa332('0xb'),auth[_0xa332('0x6')](),controller[_0xa332('0x14')]);module[_0xa332('0x15')]=router; \ No newline at end of file +var _0xb3cb=['getMessages','post','create','addMembers','addMessage','put','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','describe','/:id','isAuthenticated','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xb3cb,0x158));var _0xbb3c=function(_0xeae455,_0x19b22b){_0xeae455=_0xeae455-0x0;var _0x39eade=_0xb3cb[_0xeae455];return _0x39eade;};'use strict';var multer=require(_0xbb3c('0x0'));var util=require(_0xbb3c('0x1'));var path=require(_0xbb3c('0x2'));var timeout=require(_0xbb3c('0x3'));var express=require(_0xbb3c('0x4'));var router=express[_0xbb3c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbb3c('0x6'));var config=require(_0xbb3c('0x7'));var controller=require(_0xbb3c('0x8'));router[_0xbb3c('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb3c('0xa')]);router[_0xbb3c('0x9')](_0xbb3c('0xb'),auth['isAuthenticated'](),controller[_0xbb3c('0xc')]);router[_0xbb3c('0x9')](_0xbb3c('0xd'),auth[_0xbb3c('0xe')](),controller['show']);router[_0xbb3c('0x9')](_0xbb3c('0xf'),auth[_0xbb3c('0xe')](),controller[_0xbb3c('0x10')]);router[_0xbb3c('0x9')](_0xbb3c('0x11'),auth[_0xbb3c('0xe')](),controller[_0xbb3c('0x12')]);router[_0xbb3c('0x9')](_0xbb3c('0x13'),auth[_0xbb3c('0xe')](),controller[_0xbb3c('0x14')]);router[_0xbb3c('0x15')]('/',auth[_0xbb3c('0xe')](),controller[_0xbb3c('0x16')]);router[_0xbb3c('0x15')](_0xbb3c('0x11'),auth[_0xbb3c('0xe')](),controller[_0xbb3c('0x17')]);router[_0xbb3c('0x15')](_0xbb3c('0x13'),auth['isAuthenticated'](),controller[_0xbb3c('0x18')]);router[_0xbb3c('0x19')]('/:id',auth[_0xbb3c('0xe')](),controller['update']);router['delete'](_0xbb3c('0xd'),auth[_0xbb3c('0xe')](),controller['destroy']);router['delete'](_0xbb3c('0x11'),auth[_0xbb3c('0xe')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index aabfd3e..a897975 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 _0xe1d0=['INTEGER','sequelize','BOOLEAN','ENUM','star','DATE','STRING','TEXT','long'];(function(_0x3e03f7,_0x5f3edd){var _0x4436f9=function(_0x20d6bd){while(--_0x20d6bd){_0x3e03f7['push'](_0x3e03f7['shift']());}};_0x4436f9(++_0x5f3edd);}(_0xe1d0,0x6d));var _0x0e1d=function(_0x51ba5f,_0x17923b){_0x51ba5f=_0x51ba5f-0x0;var _0x31d14a=_0xe1d0[_0x51ba5f];return _0x31d14a;};'use strict';var Sequelize=require(_0x0e1d('0x0'));module['exports']={'closed':{'type':Sequelize[_0x0e1d('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x0e1d('0x2')](_0x0e1d('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0e1d('0x4')]},'disposition':{'type':Sequelize[_0x0e1d('0x5')]},'secondDisposition':{'type':Sequelize[_0x0e1d('0x5')]},'thirdDisposition':{'type':Sequelize[_0x0e1d('0x5')]},'note':{'type':Sequelize[_0x0e1d('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x0e1d('0x5')]},'osName':{'type':Sequelize[_0x0e1d('0x5')]},'osVersion':{'type':Sequelize[_0x0e1d('0x5')]},'deviceModel':{'type':Sequelize[_0x0e1d('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x0e1d('0x5')]},'referer':{'type':Sequelize[_0x0e1d('0x6')]},'customerIp':{'type':Sequelize[_0x0e1d('0x5')]},'formData':{'type':Sequelize[_0x0e1d('0x6')](_0x0e1d('0x7'))},'read1stAt':{'type':Sequelize[_0x0e1d('0x4')]},'lastMsgAt':{'type':Sequelize[_0x0e1d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x0e1d('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x0e1d('0x5')]},'customerPort':{'type':Sequelize[_0x0e1d('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x0e1d('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x0e1d('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0e1d('0x8')]}}; \ No newline at end of file +var _0x50e9=['long','out','sequelize','exports','BOOLEAN','ENUM','star','TEXT','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x50e9,0x14c));var _0x950e=function(_0x32908e,_0x33ff9f){_0x32908e=_0x32908e-0x0;var _0x33759d=_0x50e9[_0x32908e];return _0x33759d;};'use strict';var Sequelize=require(_0x950e('0x0'));module[_0x950e('0x1')]={'closed':{'type':Sequelize[_0x950e('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x950e('0x3')](_0x950e('0x4'),'thumb'),'defaultValue':_0x950e('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x950e('0x5')]},'mailTranscript':{'type':Sequelize[_0x950e('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x950e('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x950e('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x950e('0x6')]},'browserVersion':{'type':Sequelize[_0x950e('0x6')]},'osName':{'type':Sequelize[_0x950e('0x6')]},'osVersion':{'type':Sequelize[_0x950e('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x950e('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x950e('0x5')]},'customerIp':{'type':Sequelize[_0x950e('0x6')]},'formData':{'type':Sequelize[_0x950e('0x5')](_0x950e('0x8'))},'read1stAt':{'type':Sequelize[_0x950e('0x7')]},'lastMsgAt':{'type':Sequelize[_0x950e('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x950e('0x3')]('in',_0x950e('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x950e('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x950e('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 7822216..b50ec9e 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 _0x76f1=['vidaooTopic','isNull','vidaooNote','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','find','CmContact','UserId','disposition','abandon','attachmentUpload','file','originalname','filename','mimetype','Attachment','closed','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','basename','download','close','mailTranscript','server/files/chat/upload/','pathTranscript','Messages','User','ContactId','format','customer','%s%d','Visitor','agentIdentifier','agentAlias','System','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','hasOwnProperty','nolimit','order','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','count','rows','getMyMessages','includeAgent','setTags','spread','Tag','color','emit','removeTags','unix','toString','server','files','tmp','transcript-%d-%s.zip','push','firstName','lastName','attachments','read','Account','get','mkdirSync','Chat','Owner','N.A.','createdAt','closedAt','osName','customerIp','customerPort','existsSync','createReadStream','createWriteStream','Contact','secret','value','views','downloadInteraction.ejs','transcript-','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','api','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','request','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','update','destroy','then','end','stack','name','render','merge','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','type','key','findAll','chat','query','show','model','keys','attributes','intersection','fields','length','includeAll','include','create','body','params','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooMetadata','user','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0x76f1,0x7b));var _0x176f=function(_0x55103c,_0x453b56){_0x55103c=_0x55103c-0x0;var _0x5ab744=_0x76f1[_0x55103c];return _0x5ab744;};'use strict';var rimraf=require(_0x176f('0x0'));var zipdir=require(_0x176f('0x1'));var rp=require(_0x176f('0x2'));var moment=require(_0x176f('0x3'));var BPromise=require(_0x176f('0x4'));var Mustache=require(_0x176f('0x5'));var util=require('util');var path=require(_0x176f('0x6'));var ejs=require(_0x176f('0x7'));var fs=require('fs');var _=require(_0x176f('0x8'));var Redis=require(_0x176f('0x9'));var interaction=require(_0x176f('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0x176f('0xb'));var logger=require('../../config/logger')(_0x176f('0xc'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x176f('0xd')]=_['defaults'](config[_0x176f('0xd')],{'host':_0x176f('0xe'),'port':0x18eb});var socket=require(_0x176f('0xf'))(new Redis(config[_0x176f('0xd')]));require(_0x176f('0x10'))['register'](socket);var jayson=require(_0x176f('0x11'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson[_0x176f('0x12')]['http']({'port':0x232c});function respondWithRpcPromise(_0x598b14,_0x16f2a6,_0x38b4d0,_0x3d2f6e){return new BPromise(function(_0x2f3065,_0x1bf783){var _0x3adef1=_0x3d2f6e||client;return _0x3adef1[_0x176f('0x13')](_0x598b14,_0x38b4d0)['then'](function(_0x4508f7){logger[_0x176f('0x14')](_0x176f('0x15'),_0x16f2a6,'request\x20sent');logger[_0x176f('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x16f2a6,_0x176f('0x17'),JSON[_0x176f('0x18')](_0x4508f7));if(_0x4508f7[_0x176f('0x19')]){if(_0x4508f7[_0x176f('0x19')][_0x176f('0x1a')]===0x1f4){logger['error'](_0x176f('0x15'),_0x16f2a6,_0x4508f7[_0x176f('0x19')][_0x176f('0x1b')]);return _0x1bf783(_0x4508f7[_0x176f('0x19')][_0x176f('0x1b')]);}logger['error'](_0x176f('0x15'),_0x16f2a6,_0x4508f7[_0x176f('0x19')][_0x176f('0x1b')]);return _0x2f3065(_0x4508f7[_0x176f('0x19')][_0x176f('0x1b')]);}else{logger[_0x176f('0x14')](_0x176f('0x15'),_0x16f2a6,_0x176f('0x17'));_0x2f3065(_0x4508f7[_0x176f('0x1c')][_0x176f('0x1b')]);}})[_0x176f('0x1d')](function(_0x5caa3a){logger['error'](_0x176f('0x15'),_0x16f2a6,_0x5caa3a);_0x1bf783(_0x5caa3a);});});}function respondWithStatusCode(_0x248d35,_0x2e324a){_0x2e324a=_0x2e324a||0xcc;return function(_0x26e8ca){if(_0x26e8ca){return _0x248d35[_0x176f('0x1e')](_0x2e324a);}return _0x248d35[_0x176f('0x1f')](_0x2e324a)['end']();};}function respondWithResult(_0x1e27bd,_0x247eb1){_0x247eb1=_0x247eb1||0xc8;return function(_0xf5a011){if(_0xf5a011){return _0x1e27bd[_0x176f('0x1f')](_0x247eb1)[_0x176f('0x20')](_0xf5a011);}};}function respondWithFilteredResult(_0x40e944,_0x55b7a8){return function(_0x4030d8){if(_0x4030d8){var _0x2e92d1=typeof _0x55b7a8[_0x176f('0x21')]===_0x176f('0x22')&&typeof _0x55b7a8[_0x176f('0x23')]===_0x176f('0x22');var _0x4a2e1c=_0x4030d8['count'];var _0x41d73d=_0x2e92d1?0x0:_0x55b7a8[_0x176f('0x21')];var _0x2fa014=_0x2e92d1?_0x4030d8['count']:_0x55b7a8[_0x176f('0x21')]+_0x55b7a8[_0x176f('0x23')];var _0x4d4b84;if(_0x2fa014>=_0x4a2e1c){_0x2fa014=_0x4a2e1c;_0x4d4b84=0xc8;}else{_0x4d4b84=0xce;}_0x40e944['status'](_0x4d4b84);return _0x40e944[_0x176f('0x24')](_0x176f('0x25'),_0x41d73d+'-'+_0x2fa014+'/'+_0x4a2e1c)[_0x176f('0x20')](_0x4030d8);}return null;};}function saveUpdates(_0x130f3e){return function(_0x375b0d){if(_0x375b0d){return _0x375b0d[_0x176f('0x26')](_0x130f3e)['then'](function(_0x88cda4){return _0x88cda4;});}return null;};}function removeEntity(_0x33df47){return function(_0x311491){if(_0x311491){return _0x311491[_0x176f('0x27')]()[_0x176f('0x28')](function(){_0x33df47[_0x176f('0x1f')](0xcc)[_0x176f('0x29')]();});}};}function handleEntityNotFound(_0x490f22){return function(_0x275db1){if(!_0x275db1){_0x490f22[_0x176f('0x1e')](0x194);}return _0x275db1;};}function handleError(_0x19b9d7,_0x3e86af){_0x3e86af=_0x3e86af||0x1f4;return function(_0x270136){logger[_0x176f('0x19')](_0x270136[_0x176f('0x2a')]);if(_0x270136[_0x176f('0x2b')]){delete _0x270136[_0x176f('0x2b')];}_0x19b9d7['status'](_0x3e86af)['send'](_0x270136);};}function getMustacheRender(_0x46b4e8,_0x536955){return Mustache[_0x176f('0x2c')](_0x46b4e8,_[_0x176f('0x2d')](_0x536955['body'],{'contact':_0x536955[_0x176f('0x2e')],'message':_0x536955[_0x176f('0x1b')],'agent':_0x536955[_0x176f('0x2f')],'interaction':_0x536955[_0x176f('0x30')],'account':_0x536955[_0x176f('0x31')]}))||'';}exports['index']=function(_0x3ac02d,_0x3f8983){var _0x201a1b={};var _0x57e9a6=_[_0x176f('0x32')](db[_0x176f('0x33')][_0x176f('0x34')],function(_0x126794){return{'name':_0x126794['fieldName'],'type':_0x126794[_0x176f('0x35')][_0x176f('0x36')]};});_0x201a1b=qs['getOptions'](_0x57e9a6,_0x3ac02d);return interaction[_0x176f('0x37')](_0x176f('0x38'),_0x3ac02d[_0x176f('0x39')],_0x3ac02d['user'],_0x201a1b,_0x57e9a6)[_0x176f('0x28')](respondWithFilteredResult(_0x3f8983,_0x201a1b))[_0x176f('0x1d')](handleError(_0x3f8983,null));};exports[_0x176f('0x3a')]=function(_0x5b0118,_0xf6a64d){var _0x2862f1={'raw':![],'where':{'id':_0x5b0118['params']['id']}},_0x45a80a={};_0x45a80a[_0x176f('0x3b')]=_[_0x176f('0x3c')](db[_0x176f('0x33')][_0x176f('0x34')]);_0x45a80a[_0x176f('0x39')]=_[_0x176f('0x3c')](_0x5b0118[_0x176f('0x39')]);_0x45a80a['filters']=_['intersection'](_0x45a80a[_0x176f('0x3b')],_0x45a80a[_0x176f('0x39')]);_0x2862f1[_0x176f('0x3d')]=_[_0x176f('0x3e')](_0x45a80a[_0x176f('0x3b')],qs['fields'](_0x5b0118[_0x176f('0x39')][_0x176f('0x3f')]));_0x2862f1[_0x176f('0x3d')]=_0x2862f1['attributes'][_0x176f('0x40')]?_0x2862f1['attributes']:_0x45a80a['model'];if(_0x5b0118[_0x176f('0x39')][_0x176f('0x41')]){_0x2862f1[_0x176f('0x42')]=[{'all':!![]}];}_0x2862f1=_['merge']({},_0x2862f1,_0x5b0118['options']);return db[_0x176f('0x33')]['find'](_0x2862f1)[_0x176f('0x28')](handleEntityNotFound(_0xf6a64d,null))[_0x176f('0x28')](respondWithResult(_0xf6a64d,null))[_0x176f('0x1d')](handleError(_0xf6a64d,null));};exports[_0x176f('0x43')]=function(_0x3627fb,_0x2c1b1f){return db['ChatInteraction']['create'](_0x3627fb[_0x176f('0x44')],{})[_0x176f('0x28')](respondWithResult(_0x2c1b1f,0xc9))[_0x176f('0x1d')](handleError(_0x2c1b1f,null));};exports[_0x176f('0x26')]=function(_0x5a00de,_0x37723c){if(_0x5a00de[_0x176f('0x44')]['id']){delete _0x5a00de['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5a00de[_0x176f('0x45')]['id']}})[_0x176f('0x28')](handleEntityNotFound(_0x37723c,null))['then'](saveUpdates(_0x5a00de['body'],null))[_0x176f('0x28')](respondWithResult(_0x37723c,null))['catch'](handleError(_0x37723c,null));};exports['destroy']=function(_0x40e214,_0x1ca2f0){return db[_0x176f('0x33')]['find']({'where':{'id':_0x40e214['params']['id']}})[_0x176f('0x28')](handleEntityNotFound(_0x1ca2f0,null))['then'](removeEntity(_0x1ca2f0,null))[_0x176f('0x1d')](handleError(_0x1ca2f0,null));};exports[_0x176f('0x46')]=function(_0xbbc702,_0x2b4cc5){return db[_0x176f('0x33')]['describe']()[_0x176f('0x28')](respondWithResult(_0x2b4cc5,null))[_0x176f('0x1d')](handleError(_0x2b4cc5,null));};exports[_0x176f('0x47')]=function(_0x25146e,_0x48bb58){var _0x11eeec=_0x25146e[_0x176f('0x45')]['id'];var _0x55f2fe;var _0xf496ce;var _0x5bfa8d;return db[_0x176f('0x33')][_0x176f('0x48')]({'where':{'id':_0x11eeec}})[_0x176f('0x28')](function(_0x1e488f){_0x55f2fe=_0x1e488f;return db[_0x176f('0x49')][_0x176f('0x48')]({'where':{'id':_0x1e488f[_0x176f('0x4a')]},'attributes':['id',_0x176f('0x4b'),'vidaooEscalation','vidaooTopic','vidaooNote',_0x176f('0x4c')],'raw':!![]});})[_0x176f('0x28')](function(_0x3984b8){if(_0x3984b8&&_0x3984b8[_0x176f('0x4b')]&&_0x3984b8['vidaooEscalation']){_0xf496ce=_0x3984b8;var _0x535826={'interaction':{'id':_0x11eeec},'agent':{'id':_0x25146e[_0x176f('0x4d')]['id'],'name':_0x25146e[_0x176f('0x4d')][_0x176f('0x2b')],'fullname':_0x25146e[_0x176f('0x4d')][_0x176f('0x4e')],'email':_0x25146e[_0x176f('0x4d')][_0x176f('0x4f')]},'contact':_0x25146e[_0x176f('0x44')]['contact'],'account':_0x25146e['body'][_0x176f('0x31')]};var _0x4fb2c2={'rejectUnauthorized':![],'method':'POST','url':_0x176f('0x50'),'headers':{'X-APIKEY':_0x3984b8[_0x176f('0x4b')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x25146e[_0x176f('0x4d')]['email']],'buttons':null,'topic':_0xf496ce[_0x176f('0x51')],'note':_[_0x176f('0x52')](_0xf496ce['vidaooNote'])?null:getMustacheRender(_0xf496ce[_0x176f('0x53')],_0x535826),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x176f('0x52')](_0xf496ce['vidaooMetadata'])){var _0xd59369=getMustacheRender(_0xf496ce[_0x176f('0x4c')],_0x535826);var _0x51d59c=JSON['parse'](_0xd59369);_0x4fb2c2[_0x176f('0x44')][_0x176f('0x54')]=_0x51d59c;}}catch(_0x27afda){throw new db[(_0x176f('0x55'))][(_0x176f('0x56'))](_0x176f('0x57'));}return rp(_0x4fb2c2);}else{throw new db[(_0x176f('0x55'))][(_0x176f('0x56'))](_0x176f('0x58'));}})[_0x176f('0x28')](function(_0x4b324a){_0x5bfa8d=_0x4b324a;if(_0x5bfa8d['id']){var _0x4d49bb={'body':_0x5bfa8d[_0x176f('0x59')],'ChatWebsiteId':_0xf496ce['id'],'ChatInteractionId':_0x55f2fe['id'],'direction':_0x176f('0x5a'),'UserId':_0x25146e['user']['id']};return db[_0x176f('0x5b')]['create'](_0x4d49bb,{});}else{throw new db[(_0x176f('0x55'))][(_0x176f('0x56'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x176f('0x28')](function(){return _0x55f2fe[_0x176f('0x5c')]({'vidaooSessionId':_0x5bfa8d['id']});})['then'](respondWithResult(_0x48bb58,null))[_0x176f('0x1d')](handleError(_0x48bb58,null));};exports[_0x176f('0x5d')]=function(_0x33dcf4,_0x355254){if(_0x33dcf4['body']['id']){delete _0x33dcf4[_0x176f('0x44')]['id'];}return db[_0x176f('0x33')][_0x176f('0x5e')]({'where':{'id':_0x33dcf4[_0x176f('0x45')]['id']},'include':[{'model':db[_0x176f('0x5f')],'as':'Contact'}]})[_0x176f('0x28')](handleEntityNotFound(_0x355254,null))['then'](saveUpdates(_0x33dcf4[_0x176f('0x44')],null))[_0x176f('0x28')](respondWithResult(_0x355254,null))[_0x176f('0x1d')](handleError(_0x355254,null));};exports['abandon']=function(_0x3a190c,_0x2996ff){if(_0x3a190c[_0x176f('0x44')]['id']){delete _0x3a190c[_0x176f('0x44')]['id'];}return db['ChatInteraction'][_0x176f('0x5e')]({'where':{'id':_0x3a190c['params']['id']}})[_0x176f('0x28')](function(_0x147fb1){if(!_0x147fb1){logger[_0x176f('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,'entity\x20not\x20found');_0x2996ff[_0x176f('0x1e')](0x194);}else{if(_0x147fb1[_0x176f('0x60')]){throw new db[(_0x176f('0x55'))][(_0x176f('0x56'))]('Interaction\x20already\x20assigned');}}return _0x147fb1;})[_0x176f('0x28')](function(_0xa6a63e){if(_0xa6a63e){return _0xa6a63e[_0x176f('0x26')]({'closed':_0x3a190c[_0x176f('0x44')]['closed'],'disposition':_0x3a190c['body'][_0x176f('0x61')]})[_0x176f('0x28')](function(_0x25f52c){return _0x25f52c;});}})[_0x176f('0x28')](function(){return respondWithRpcPromise('AbandonInteraction',_0x176f('0x62'),_0x3a190c[_0x176f('0x44')],client9004);})[_0x176f('0x28')](respondWithResult(_0x2996ff,null))[_0x176f('0x1d')](handleError(_0x2996ff,null));};exports[_0x176f('0x63')]=function(_0x5c14ba,_0x1e6d31){_0x5c14ba['body'][_0x176f('0x2b')]=_0x5c14ba[_0x176f('0x64')][_0x176f('0x65')];_0x5c14ba['body']['basename']=_0x5c14ba[_0x176f('0x64')][_0x176f('0x66')];_0x5c14ba['body'][_0x176f('0x35')]=_0x5c14ba[_0x176f('0x64')][_0x176f('0x67')];return db[_0x176f('0x68')][_0x176f('0x43')](_0x5c14ba['body'])[_0x176f('0x28')](respondWithResult(_0x1e6d31,0xc9))['catch'](handleError(_0x1e6d31,null));};exports['attachmentDownload']=function(_0x49e1af,_0x38e514){return db[_0x176f('0x33')][_0x176f('0x48')]({'where':{'id':_0x49e1af[_0x176f('0x45')]['id']},'raw':!![]})[_0x176f('0x28')](handleEntityNotFound(_0x38e514,null))['then'](function(_0x554793){if(_0x554793){if(_0x554793[_0x176f('0x69')]){return _0x38e514[_0x176f('0x1f')](0x193)['json']({'status':0x193,'message':_0x176f('0x6a')});}return db[_0x176f('0x68')][_0x176f('0x48')]({'where':{'id':_0x49e1af['query'][_0x176f('0x6b')]},'raw':!![]})[_0x176f('0x28')](handleEntityNotFound(_0x38e514,null));}})[_0x176f('0x28')](function(_0x259b04){if(_0x259b04){var _0x36a207=_0x259b04[_0x176f('0x6c')]!==null;var _0x510758=path['join'](config[_0x176f('0x6d')],_0x176f('0x6e'));if(_0x36a207){_0x510758=path['join'](_0x510758,_0x176f('0x6f'));}var _0xc5e8d9=path[_0x176f('0x70')](_0x510758,_0x259b04[_0x176f('0x71')]);return _0x38e514[_0x176f('0x72')](_0xc5e8d9);}})['catch'](handleError(_0x38e514,null));};exports[_0x176f('0x73')]=function(_0x56ada9,_0x1688b2){var _0x468d71=null;var _0x5bcf0f=null;var _0x337ec7=null;if(_0x56ada9[_0x176f('0x44')]['id']){delete _0x56ada9['body']['id'];}if(_0x56ada9['body'][_0x176f('0x74')]){_0x337ec7=path[_0x176f('0x70')](config['root'],_0x176f('0x75'),util['format']('transcript-%s.txt',Date['now']()));_0x56ada9['body'][_0x176f('0x76')]=_0x337ec7;}return db[_0x176f('0x33')][_0x176f('0x5e')]({'where':{'id':_0x56ada9[_0x176f('0x45')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x176f('0x77'),'include':[{'model':db['User'],'as':_0x176f('0x78')}]}]})[_0x176f('0x28')](handleEntityNotFound(_0x1688b2,null))[_0x176f('0x28')](saveUpdates(_0x56ada9[_0x176f('0x44')],null))[_0x176f('0x28')](function(_0x3c59ca){if(_0x3c59ca){_0x468d71=_0x3c59ca;return db[_0x176f('0x49')][_0x176f('0x5e')]({'where':{'id':_0x468d71['ChatWebsiteId']}});}})['then'](function(_0x34937c){if(_0x34937c){_0x5bcf0f=_0x34937c;return db[_0x176f('0x5f')]['find']({'where':{'id':_0x468d71[_0x176f('0x79')]}});}})['then'](function(_0x10e90b){if(_0x10e90b){if(_0x337ec7){var _0x365be7=null;for(var _0x8adc13=0x1;_0x8adc13<_0x468d71['Messages'][_0x176f('0x40')];++_0x8adc13){_0x365be7=_0x468d71['Messages'][_0x8adc13];var _0x235d40=_0x365be7['UserId']?util[_0x176f('0x7a')]('%s%d',_0x5bcf0f['agentAlias'],_0x365be7['UserId']):'System';var _0x5d8150=_0x56ada9['body'][_0x176f('0x7b')]||util[_0x176f('0x7a')](_0x176f('0x7c'),_0x176f('0x7d'),_0x365be7['ContactId']);switch(_0x5bcf0f[_0x176f('0x7e')]){case'website_alias':_0x235d40=_0x365be7[_0x176f('0x60')]?util[_0x176f('0x7a')](_0x176f('0x7c'),_0x5bcf0f[_0x176f('0x7f')],_0x365be7[_0x176f('0x60')]):_0x176f('0x80');break;case _0x176f('0x81'):_0x235d40=_0x365be7[_0x176f('0x60')]?_0x365be7[_0x176f('0x78')][_0x176f('0x82')]||_0x365be7[_0x176f('0x78')]['fullname']:_0x176f('0x80');break;case _0x176f('0x83'):_0x235d40=_0x365be7['UserId']?_0x365be7['User'][_0x176f('0x4e')]:_0x176f('0x80');break;default:_0x235d40=_0x365be7[_0x176f('0x60')]?util['format'](_0x176f('0x7c'),_0x5bcf0f['agentAlias'],_0x365be7['UserId']):'System';}var _0x4f4414=util[_0x176f('0x7a')]('[%s]\x20%s:\x20%s\x0a',moment(_0x365be7['createdAt'])['format'](_0x176f('0x84')),_0x365be7[_0x176f('0x85')]==='in'?_0x5d8150:_0x235d40,_0x365be7['body']);if(!_0x365be7['secret']){fs[_0x176f('0x86')](_0x337ec7,_0x4f4414);}}return db[_0x176f('0x87')][_0x176f('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0x176f('0x88')],'as':_0x176f('0x89'),'raw':!![],'include':[{'model':db[_0x176f('0x8a')],'as':_0x176f('0x8a'),'raw':!![]}]}]});}}})['then'](function(_0x258475){if(!_0x258475||!_0x258475['Smtp']||!_0x56ada9[_0x176f('0x44')])return _0x468d71;var _0x30f84a=_0x258475[_0x176f('0x8b')]();return respondWithRpcPromise(_0x176f('0x8c'),_0x176f('0x8d'),{'account':_0x30f84a,'message':{'from':util[_0x176f('0x7a')]('\x22%s\x22\x20<%s>',_0x258475[_0x176f('0x2b')],_0x258475['email']||_0x258475[_0x176f('0x89')]['user']),'to':_0x56ada9['body'][_0x176f('0x74')],'subject':_0x176f('0x8e'),'text':util[_0x176f('0x7a')](_0x176f('0x8f'),_0x56ada9[_0x176f('0x44')][_0x176f('0x74')]),'attachments':[{'path':_0x337ec7}]}})[_0x176f('0x28')](function(){return _0x468d71;})[_0x176f('0x1d')](function(_0x5e8ea0){logger['error'](_0x5e8ea0);});})[_0x176f('0x28')](respondWithStatusCode(_0x1688b2,0xc8))['catch'](handleError(_0x1688b2,null));};exports[_0x176f('0x90')]=function(_0x57614e,_0x2f2306){return db[_0x176f('0x5b')][_0x176f('0x5e')]({'where':{'id':_0x57614e[_0x176f('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f2306,null))[_0x176f('0x28')](function(_0x402b3d){if(_0x402b3d){return _0x402b3d[_0x176f('0x90')](_0x57614e[_0x176f('0x44')][_0x176f('0x91')],_[_0x176f('0x92')](_0x57614e['body'],[_0x176f('0x91'),'id'])||{});}})['then'](respondWithResult(_0x2f2306,null))[_0x176f('0x1d')](handleError(_0x2f2306,null));};exports[_0x176f('0x93')]=function(_0x2b9b3c,_0x2b7691){var _0x515242={'raw':![],'where':{}};var _0x4089a2={};var _0x46ced3={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x176f('0x48')]({'where':{'id':_0x2b9b3c['params']['id']}})[_0x176f('0x28')](handleEntityNotFound(_0x2b7691,null))['then'](function(_0x59ec4f){if(_0x59ec4f){_0x4089a2['model']=_['keys'](db['ChatMessage']['rawAttributes']);_0x4089a2['query']=_['keys'](_0x2b9b3c['query']);_0x4089a2[_0x176f('0x94')]=_[_0x176f('0x3e')](_0x4089a2['model'],_0x4089a2['query']);_0x515242['attributes']=_['intersection'](_0x4089a2[_0x176f('0x3b')],qs['fields'](_0x2b9b3c[_0x176f('0x39')]['fields']));_0x515242['attributes']=_0x515242[_0x176f('0x3d')][_0x176f('0x40')]?_0x515242['attributes']:_0x4089a2[_0x176f('0x3b')];if(!_0x2b9b3c[_0x176f('0x39')][_0x176f('0x95')](_0x176f('0x96'))){_0x515242[_0x176f('0x23')]=qs[_0x176f('0x23')](_0x2b9b3c[_0x176f('0x39')][_0x176f('0x23')]);_0x515242[_0x176f('0x21')]=qs[_0x176f('0x21')](_0x2b9b3c['query'][_0x176f('0x21')]);}_0x515242[_0x176f('0x97')]=qs[_0x176f('0x98')](_0x2b9b3c[_0x176f('0x39')][_0x176f('0x98')]);_0x515242['where']=qs[_0x176f('0x94')](_[_0x176f('0x99')](_0x2b9b3c[_0x176f('0x39')],_0x4089a2[_0x176f('0x94')]));_0x515242[_0x176f('0x9a')][_0x176f('0x9b')]=_0x59ec4f['id'];if(_0x2b9b3c[_0x176f('0x39')]['filter']){_0x515242[_0x176f('0x9a')]=_[_0x176f('0x2d')](_0x515242[_0x176f('0x9a')],{'$or':_['map'](_0x515242['attributes'],function(_0x2f6ac6){var _0x1dca43={};_0x1dca43[_0x2f6ac6]={'$like':'%'+_0x2b9b3c[_0x176f('0x39')][_0x176f('0x9c')]+'%'};return _0x1dca43;})});}if(_0x2b9b3c[_0x176f('0x39')][_0x176f('0x9d')]){var _0x23c413=_0x2b9b3c[_0x176f('0x39')][_0x176f('0x9d')][_0x176f('0x9e')](',');var _0x367a31={};_0x367a31[_0x23c413[0x0]]={'$gte':moment(_0x23c413[0x1])[_0x176f('0x7a')](_0x176f('0x9f'))};_0x515242[_0x176f('0x9a')]=_[_0x176f('0x2d')](_0x515242['where'],_0x367a31);}_0x515242=_[_0x176f('0x2d')]({},_0x515242,_0x2b9b3c[_0x176f('0xa0')]);return db[_0x176f('0x5b')][_0x176f('0xa1')]({'where':_0x515242['where']})[_0x176f('0x28')](function(_0x3d5fd0){_0x46ced3[_0x176f('0xa1')]=_0x3d5fd0;if(_0x2b9b3c['query']['includeAll']){_0x515242[_0x176f('0x42')]=[{'all':!![]}];}return db[_0x176f('0x5b')]['findAll'](_0x515242);})['then'](function(_0xd3b6e0){_0x46ced3[_0x176f('0xa2')]=_0xd3b6e0;return _0x46ced3;});}})[_0x176f('0x28')](respondWithFilteredResult(_0x2b7691,_0x515242))['catch'](handleError(_0x2b7691,null));};exports[_0x176f('0xa3')]=function(_0xbebf62,_0x120943){var _0x3749a4={'where':{}},_0xc6716e={},_0x45f3bb={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x176f('0x48')]({'where':{'id':_0xbebf62['params']['id']}})[_0x176f('0x28')](handleEntityNotFound(_0x120943,null))[_0x176f('0x28')](function(_0x455bf2){if(_0x455bf2){_0xc6716e[_0x176f('0x3b')]=_[_0x176f('0x3c')](db[_0x176f('0x5b')][_0x176f('0x34')]);_0xc6716e[_0x176f('0x39')]=_[_0x176f('0x3c')](_0xbebf62[_0x176f('0x39')]);_0xc6716e[_0x176f('0x94')]=_[_0x176f('0x3e')](_0xc6716e[_0x176f('0x3b')],_0xc6716e[_0x176f('0x39')]);_0x3749a4[_0x176f('0x3d')]=_[_0x176f('0x3e')](_0xc6716e[_0x176f('0x3b')],qs['fields'](_0xbebf62[_0x176f('0x39')][_0x176f('0x3f')]));_0x3749a4['attributes']=_0x3749a4[_0x176f('0x3d')][_0x176f('0x40')]?_0x3749a4[_0x176f('0x3d')]:_0xc6716e[_0x176f('0x3b')];if(!_0xbebf62[_0x176f('0x39')][_0x176f('0x95')]('nolimit')){_0x3749a4[_0x176f('0x23')]=qs['limit'](_0xbebf62['query']['limit']);_0x3749a4[_0x176f('0x21')]=qs['offset'](_0xbebf62[_0x176f('0x39')][_0x176f('0x21')]);}_0x3749a4[_0x176f('0x97')]=qs[_0x176f('0x98')](_0xbebf62[_0x176f('0x39')][_0x176f('0x98')]);_0x3749a4[_0x176f('0x9a')]=qs[_0x176f('0x94')](_[_0x176f('0x99')](_0xbebf62['query'],_0xc6716e[_0x176f('0x94')]));_0x3749a4['where'][_0x176f('0x9b')]=_0x455bf2['id'];if(_0xbebf62[_0x176f('0x39')][_0x176f('0x9c')]){_0x3749a4['where']=_[_0x176f('0x2d')](_0x3749a4[_0x176f('0x9a')],{'$or':_['map'](_0x3749a4[_0x176f('0x3d')],function(_0xd9baa6){var _0x2b9fb9={};_0x2b9fb9[_0xd9baa6]={'$like':'%'+_0xbebf62[_0x176f('0x39')][_0x176f('0x9c')]+'%'};return _0x2b9fb9;})});}_0x3749a4[_0x176f('0x9a')]['secret']=![];if(_0xbebf62[_0x176f('0x39')]['id']){_0x3749a4['where']['id']={'$gt':_0xbebf62[_0x176f('0x39')]['id']};}_0x3749a4=_[_0x176f('0x2d')]({},_0x3749a4,_0xbebf62[_0x176f('0xa0')]);return db[_0x176f('0x5b')][_0x176f('0xa1')]({'where':_0x3749a4['where']})[_0x176f('0x28')](function(_0x60b0ec){_0x45f3bb[_0x176f('0xa1')]=_0x60b0ec;_0x3749a4[_0x176f('0x42')]=[];if(_0xbebf62[_0x176f('0x39')][_0x176f('0xa4')]){_0x3749a4[_0x176f('0x42')]['push']({'model':db[_0x176f('0x78')],'as':_0x176f('0x78'),'attributes':['id',_0x176f('0x4e'),_0x176f('0x82')]});}if(_0xbebf62[_0x176f('0x39')][_0x176f('0x41')]){_0x3749a4[_0x176f('0x42')]=[{'all':!![]}];}return db[_0x176f('0x5b')][_0x176f('0x37')](_0x3749a4);})[_0x176f('0x28')](function(_0x112057){_0x45f3bb[_0x176f('0xa2')]=_0x112057;return _0x45f3bb;});}})[_0x176f('0x28')](respondWithFilteredResult(_0x120943,_0x3749a4))['catch'](handleError(_0x120943,null));};exports['addTags']=function(_0xdafc98,_0x221fec){return db[_0x176f('0x33')]['find']({'where':{'id':_0xdafc98[_0x176f('0x45')]['id']}})[_0x176f('0x28')](handleEntityNotFound(_0x221fec,null))[_0x176f('0x28')](function(_0x567622){if(_0x567622){return _0x567622[_0x176f('0xa5')](_0xdafc98[_0x176f('0x44')][_0x176f('0x91')],_[_0x176f('0x92')](_0xdafc98['body'],['ids','id'])||{})[_0x176f('0xa6')](function(){return db[_0x176f('0xa7')][_0x176f('0x37')]({'attributes':['id','name',_0x176f('0xa8')],'where':{'id':_0xdafc98[_0x176f('0x44')][_0x176f('0x91')]}});})[_0x176f('0x28')](function(_0x1ce214){socket[_0x176f('0xa9')]('chatInteractionTags:save',{'id':Number(_0xdafc98[_0x176f('0x45')]['id']),'tags':_0x1ce214||[]});return{'id':Number(_0xdafc98[_0x176f('0x45')]['id']),'tags':_0x1ce214||[]};});}})[_0x176f('0x28')](respondWithResult(_0x221fec,null))[_0x176f('0x1d')](handleError(_0x221fec,null));};exports['removeTags']=function(_0x456a69,_0x2a2778){return db[_0x176f('0x33')][_0x176f('0x5e')]({'where':{'id':_0x456a69[_0x176f('0x45')]['id']}})[_0x176f('0x28')](handleEntityNotFound(_0x2a2778,null))['then'](function(_0x1849c5){if(_0x1849c5){return _0x1849c5[_0x176f('0xaa')](_0x456a69[_0x176f('0x39')][_0x176f('0x91')]);}})[_0x176f('0x28')](respondWithStatusCode(_0x2a2778,null))['catch'](handleError(_0x2a2778,null));};exports[_0x176f('0x72')]=function(_0x3a9341,_0x379b9c){var _0xb77f2b=moment()[_0x176f('0xab')]()[_0x176f('0xac')]();var _0x5582d2=path['join'](config['root'],_0x176f('0xad'),_0x176f('0xae'),_0x176f('0xaf'));var _0x5815dc=path[_0x176f('0x70')](config[_0x176f('0x6d')],_0x176f('0xad'),_0x176f('0xae'),'attachments');var _0x2eddc8=path[_0x176f('0x70')](_0x5582d2,_0xb77f2b);var _0x3ca787=util[_0x176f('0x7a')](_0x176f('0xb0'),_0x3a9341['params']['id'],_0xb77f2b);var _0x41ccd6=path[_0x176f('0x70')](_0x5582d2,_0x3ca787);var _0x5eff49=[];_0x5eff49[_0x176f('0xb1')]({'model':db[_0x176f('0x78')],'as':'User','attributes':['id',_0x176f('0x4e')],'raw':!![]});_0x5eff49[_0x176f('0xb1')]({'model':db[_0x176f('0x5f')],'as':'Contact','attributes':['id',_0x176f('0xb2'),_0x176f('0xb3')],'raw':!![]});if(_0x3a9341['query'][_0x176f('0xb4')]){_0x5eff49[_0x176f('0xb1')]({'model':db[_0x176f('0x68')],'as':_0x176f('0x68'),'raw':!![]});}var _0x265120=[{'model':db[_0x176f('0x5b')],'as':_0x176f('0x77'),'attributes':['id',_0x176f('0x44'),'createdAt','direction','secret',_0x176f('0xb5')],'include':_0x5eff49}];_0x265120[_0x176f('0xb1')]({'model':db[_0x176f('0x49')],'as':_0x176f('0xb6'),'attributes':['id',_0x176f('0x2b')]});_0x265120[_0x176f('0xb1')]({'model':db[_0x176f('0x78')],'as':'Owner','attributes':['id',_0x176f('0x4e')]});return db[_0x176f('0x33')][_0x176f('0x5e')]({'where':{'id':_0x3a9341[_0x176f('0x45')]['id']},'include':_0x265120})['then'](handleEntityNotFound(_0x379b9c,null))[_0x176f('0x28')](function(_0x58ee60){if(_0x58ee60){var _0x1ea63e=_0x58ee60[_0x176f('0xb7')]({'plain':!![]});fs[_0x176f('0xb8')](_0x2eddc8);var _0x5d1a54={'channel':_0x176f('0xb9'),'account':_0x1ea63e[_0x176f('0xb6')][_0x176f('0x2b')],'agent':_0x1ea63e['Owner']?_0x1ea63e[_0x176f('0xba')][_0x176f('0x4e')]:_0x176f('0xbb'),'createdAt':moment(_0x1ea63e[_0x176f('0xbc')])['format'](_0x176f('0x9f'))[_0x176f('0xac')](),'closedAt':_0x1ea63e[_0x176f('0x69')]?moment(_0x1ea63e[_0x176f('0xbd')])['format'](_0x176f('0x9f'))[_0x176f('0xac')]():'','disposition':_0x1ea63e[_0x176f('0x61')],'chatInfo':{'browser':_0x1ea63e['browserName'],'os':_0x1ea63e[_0x176f('0xbe')],'referer':_0x1ea63e['referer'],'customerIp':_0x1ea63e[_0x176f('0xbf')],'customerPort':_0x1ea63e[_0x176f('0xc0')]?_0x1ea63e[_0x176f('0xc0')]:_0x176f('0xbb')},'messages':_(_0x1ea63e[_0x176f('0x77')])['tail']()[_0x176f('0x9c')]({'secret':![]})[_0x176f('0x32')](function(_0x3d0afd){if(_0x3d0afd[_0x176f('0x68')]){var _0x519bdc=path[_0x176f('0x70')](_0x5815dc,_0x3d0afd[_0x176f('0x68')][_0x176f('0x71')]);if(fs[_0x176f('0xc1')](_0x519bdc)){fs[_0x176f('0xc2')](_0x519bdc)['pipe'](fs[_0x176f('0xc3')](path[_0x176f('0x70')](_0x2eddc8,_0x3d0afd[_0x176f('0x68')][_0x176f('0x71')])));}}return{'date':moment(_0x3d0afd['createdAt'])['format'](_0x176f('0x9f'))[_0x176f('0xac')](),'sender':_0x3d0afd[_0x176f('0x85')]===_0x176f('0x5a')?_0x3d0afd[_0x176f('0x78')]?_0x3d0afd[_0x176f('0x78')][_0x176f('0x4e')]:'System':_0x3d0afd[_0x176f('0xc4')]['firstName']+(_0x3d0afd[_0x176f('0xc4')][_0x176f('0xb3')]?'\x20'+_0x3d0afd[_0x176f('0xc4')][_0x176f('0xb3')]:''),'body':_0x3d0afd[_0x176f('0x68')]?_0x3d0afd[_0x176f('0x68')][_0x176f('0x71')]:_0x3d0afd['body'],'direction':_0x3d0afd['direction']==='out'?'A':'C','secret':_0x3d0afd[_0x176f('0xc5')],'read':_0x3d0afd[_0x176f('0xb5')],'attachment':_0x3d0afd[_0x176f('0x68')]};})[_0x176f('0xc6')]()};return ejs['renderFile'](path['join'](config[_0x176f('0x6d')],_0x176f('0xad'),_0x176f('0xc7'),_0x176f('0xc8')),{'interaction':_0x5d1a54})['then'](function(_0x3da4dd){var _0x39c327=path[_0x176f('0x70')](_0x2eddc8,_0x176f('0xc9')+_0x1ea63e['id']+'-'+_0xb77f2b+'.pdf');var _0x21b3fc={'path':_0x39c327,'channel':_0x176f('0xb9'),'interactionId':_0x1ea63e['id']};return pdf['createPdfFromHTML'](_0x3da4dd,_0x21b3fc);})['then'](function(){return new Promise(function(_0x579825,_0x155dc4){zipdir(_0x2eddc8,{'saveTo':_0x41ccd6},function(_0x3811bc,_0x3347bb){if(_0x3811bc)return _0x155dc4(_0x3811bc);return _0x579825(_0x3347bb);});})[_0x176f('0x28')](function(){return new BPromise(function(_0xda1211,_0x3cb35e){rimraf(_0x2eddc8,function(_0x5088fb){if(_0x5088fb)_0x3cb35e(_0x5088fb);return _0xda1211();});});})[_0x176f('0x28')](function(){return _0x379b9c[_0x176f('0x72')](_0x41ccd6,_0x3ca787,function(_0x4db946){if(_0x4db946){logger[_0x176f('0x19')](_0x176f('0xca'),_0x4db946);}else{fs[_0x176f('0xcb')](_0x41ccd6);}});});});}else{return _0x379b9c[_0x176f('0x1e')](0xc8);}})['catch'](handleError(_0x379b9c,null));}; \ No newline at end of file +var _0x54e2=['attachmentDownload','Unauthorized','findOne','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','User','ChatWebsiteId','CmContact','ContactId','%s%d','agentAlias','System','customer','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','getMessages','length','hasOwnProperty','nolimit','order','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','rows','sort','secret','includeAgent','push','setTags','omit','spread','Tag','color','emit','chatInteractionTags:save','download','unix','toString','server','files','attachments','transcript-%d-%s.zip','lastName','read','Owner','get','mkdirSync','Chat','closed','closedAt','disposition','browserName','referer','customerPort','N.A.','tail','basename','existsSync','createReadStream','pipe','firstName','value','renderFile','downloadInteraction.ejs','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','bluebird','mustache','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','undefined','limit','count','offset','Content-Range','destroy','sendStatus','name','send','render','merge','body','contact','account','index','map','ChatInteraction','rawAttributes','fieldName','key','findAll','user','catch','show','keys','query','filters','model','intersection','fields','attributes','options','find','create','update','params','describe','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','attachmentUpload','file','type','Attachment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x54e2,0x1ed));var _0x254e=function(_0x33a563,_0x595854){_0x33a563=_0x33a563-0x0;var _0x2e5ed4=_0x54e2[_0x33a563];return _0x2e5ed4;};'use strict';var rimraf=require(_0x254e('0x0'));var zipdir=require(_0x254e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x254e('0x2'));var Mustache=require(_0x254e('0x3'));var util=require(_0x254e('0x4'));var path=require(_0x254e('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x254e('0x6'));var Redis=require(_0x254e('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x254e('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x254e('0x9'))('api');var config=require('../../config/environment');var db=require(_0x254e('0xa'))['db'];config[_0x254e('0xb')]=_[_0x254e('0xc')](config[_0x254e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x254e('0xd'))(new Redis(config[_0x254e('0xb')]));require(_0x254e('0xe'))[_0x254e('0xf')](socket);var jayson=require(_0x254e('0x10'));var client=jayson[_0x254e('0x11')][_0x254e('0x12')]({'port':0x232b});var client9004=jayson[_0x254e('0x11')][_0x254e('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x28e3ad,_0x53c0c9,_0x18ec2b,_0x11284e){return new BPromise(function(_0x24cc1b,_0x4301f6){var _0x2bfe36=_0x11284e||client;return _0x2bfe36[_0x254e('0x13')](_0x28e3ad,_0x18ec2b)[_0x254e('0x14')](function(_0xeddbf5){logger[_0x254e('0x15')](_0x254e('0x16'),_0x53c0c9,_0x254e('0x17'));logger[_0x254e('0x18')](_0x254e('0x19'),_0x53c0c9,'request\x20sent',JSON[_0x254e('0x1a')](_0xeddbf5));if(_0xeddbf5[_0x254e('0x1b')]){if(_0xeddbf5[_0x254e('0x1b')][_0x254e('0x1c')]===0x1f4){logger['error'](_0x254e('0x16'),_0x53c0c9,_0xeddbf5[_0x254e('0x1b')][_0x254e('0x1d')]);return _0x4301f6(_0xeddbf5[_0x254e('0x1b')][_0x254e('0x1d')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x53c0c9,_0xeddbf5[_0x254e('0x1b')]['message']);return _0x24cc1b(_0xeddbf5[_0x254e('0x1b')][_0x254e('0x1d')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x53c0c9,_0x254e('0x17'));_0x24cc1b(_0xeddbf5[_0x254e('0x1e')][_0x254e('0x1d')]);}})['catch'](function(_0x37a32e){logger[_0x254e('0x1b')](_0x254e('0x16'),_0x53c0c9,_0x37a32e);_0x4301f6(_0x37a32e);});});}function respondWithStatusCode(_0x462558,_0x347db8){_0x347db8=_0x347db8||0xcc;return function(_0x58c1b3){if(_0x58c1b3){return _0x462558['sendStatus'](_0x347db8);}return _0x462558[_0x254e('0x1f')](_0x347db8)[_0x254e('0x20')]();};}function respondWithResult(_0x6c4021,_0x3da757){_0x3da757=_0x3da757||0xc8;return function(_0x25a3b1){if(_0x25a3b1){return _0x6c4021[_0x254e('0x1f')](_0x3da757)['json'](_0x25a3b1);}};}function respondWithFilteredResult(_0x30c01f,_0x811a9){return function(_0x55d90f){if(_0x55d90f){var _0x3dfc20=typeof _0x811a9['offset']===_0x254e('0x21')&&typeof _0x811a9[_0x254e('0x22')]==='undefined';var _0x1da07a=_0x55d90f[_0x254e('0x23')];var _0x4db598=_0x3dfc20?0x0:_0x811a9[_0x254e('0x24')];var _0x1e5bf0=_0x3dfc20?_0x55d90f[_0x254e('0x23')]:_0x811a9[_0x254e('0x24')]+_0x811a9[_0x254e('0x22')];var _0x4661a9;if(_0x1e5bf0>=_0x1da07a){_0x1e5bf0=_0x1da07a;_0x4661a9=0xc8;}else{_0x4661a9=0xce;}_0x30c01f[_0x254e('0x1f')](_0x4661a9);return _0x30c01f['set'](_0x254e('0x25'),_0x4db598+'-'+_0x1e5bf0+'/'+_0x1da07a)['json'](_0x55d90f);}return null;};}function saveUpdates(_0x2d5f79){return function(_0x595780){if(_0x595780){return _0x595780['update'](_0x2d5f79)['then'](function(_0x4a9359){return _0x4a9359;});}return null;};}function removeEntity(_0x1efd3c){return function(_0x57ed34){if(_0x57ed34){return _0x57ed34[_0x254e('0x26')]()[_0x254e('0x14')](function(){_0x1efd3c['status'](0xcc)[_0x254e('0x20')]();});}};}function handleEntityNotFound(_0x4a66f9){return function(_0x365eea){if(!_0x365eea){_0x4a66f9[_0x254e('0x27')](0x194);}return _0x365eea;};}function handleError(_0x43b538,_0xe28d00){_0xe28d00=_0xe28d00||0x1f4;return function(_0x53ef78){logger[_0x254e('0x1b')](_0x53ef78['stack']);if(_0x53ef78[_0x254e('0x28')]){delete _0x53ef78[_0x254e('0x28')];}_0x43b538[_0x254e('0x1f')](_0xe28d00)[_0x254e('0x29')](_0x53ef78);};}function getMustacheRender(_0x28b82f,_0x4b2eff){return Mustache[_0x254e('0x2a')](_0x28b82f,_[_0x254e('0x2b')](_0x4b2eff[_0x254e('0x2c')],{'contact':_0x4b2eff[_0x254e('0x2d')],'message':_0x4b2eff[_0x254e('0x1d')],'agent':_0x4b2eff['agent'],'interaction':_0x4b2eff['interaction'],'account':_0x4b2eff[_0x254e('0x2e')]}))||'';}exports[_0x254e('0x2f')]=function(_0x2b28a1,_0x1857ff){var _0x57d590={};var _0x520616=_[_0x254e('0x30')](db[_0x254e('0x31')][_0x254e('0x32')],function(_0x52dc5c){return{'name':_0x52dc5c[_0x254e('0x33')],'type':_0x52dc5c['type'][_0x254e('0x34')]};});_0x57d590=qs['getOptions'](_0x520616,_0x2b28a1);return interaction[_0x254e('0x35')]('chat',_0x2b28a1['query'],_0x2b28a1[_0x254e('0x36')],_0x57d590,_0x520616)[_0x254e('0x14')](respondWithFilteredResult(_0x1857ff,_0x57d590))[_0x254e('0x37')](handleError(_0x1857ff,null));};exports[_0x254e('0x38')]=function(_0x1a8ba6,_0x48d4dc){var _0x4a5f35={'raw':![],'where':{'id':_0x1a8ba6['params']['id']}},_0x56325c={};_0x56325c['model']=_[_0x254e('0x39')](db[_0x254e('0x31')][_0x254e('0x32')]);_0x56325c[_0x254e('0x3a')]=_[_0x254e('0x39')](_0x1a8ba6[_0x254e('0x3a')]);_0x56325c[_0x254e('0x3b')]=_['intersection'](_0x56325c[_0x254e('0x3c')],_0x56325c['query']);_0x4a5f35['attributes']=_[_0x254e('0x3d')](_0x56325c[_0x254e('0x3c')],qs[_0x254e('0x3e')](_0x1a8ba6[_0x254e('0x3a')]['fields']));_0x4a5f35[_0x254e('0x3f')]=_0x4a5f35[_0x254e('0x3f')]['length']?_0x4a5f35['attributes']:_0x56325c[_0x254e('0x3c')];if(_0x1a8ba6['query']['includeAll']){_0x4a5f35['include']=[{'all':!![]}];}_0x4a5f35=_[_0x254e('0x2b')]({},_0x4a5f35,_0x1a8ba6[_0x254e('0x40')]);return db['ChatInteraction'][_0x254e('0x41')](_0x4a5f35)[_0x254e('0x14')](handleEntityNotFound(_0x48d4dc,null))[_0x254e('0x14')](respondWithResult(_0x48d4dc,null))[_0x254e('0x37')](handleError(_0x48d4dc,null));};exports[_0x254e('0x42')]=function(_0x336b7f,_0x4ebff1){return db[_0x254e('0x31')][_0x254e('0x42')](_0x336b7f['body'],{})[_0x254e('0x14')](respondWithResult(_0x4ebff1,0xc9))['catch'](handleError(_0x4ebff1,null));};exports[_0x254e('0x43')]=function(_0x568864,_0x59f3fb){if(_0x568864[_0x254e('0x2c')]['id']){delete _0x568864[_0x254e('0x2c')]['id'];}return db[_0x254e('0x31')]['find']({'where':{'id':_0x568864[_0x254e('0x44')]['id']}})['then'](handleEntityNotFound(_0x59f3fb,null))[_0x254e('0x14')](saveUpdates(_0x568864['body'],null))[_0x254e('0x14')](respondWithResult(_0x59f3fb,null))[_0x254e('0x37')](handleError(_0x59f3fb,null));};exports[_0x254e('0x26')]=function(_0x37fcaf,_0x4ee134){return db[_0x254e('0x31')][_0x254e('0x41')]({'where':{'id':_0x37fcaf[_0x254e('0x44')]['id']}})[_0x254e('0x14')](handleEntityNotFound(_0x4ee134,null))['then'](removeEntity(_0x4ee134,null))[_0x254e('0x37')](handleError(_0x4ee134,null));};exports[_0x254e('0x45')]=function(_0x496b8d,_0x17897a){return db[_0x254e('0x31')][_0x254e('0x45')]()[_0x254e('0x14')](respondWithResult(_0x17897a,null))[_0x254e('0x37')](handleError(_0x17897a,null));};exports['createVidaooSession']=function(_0x146819,_0x4a7e92){var _0x167c28=_0x146819[_0x254e('0x44')]['id'];var _0x3f493f;var _0x48e59d;var _0x93dbcf;return db[_0x254e('0x31')]['findOne']({'where':{'id':_0x167c28}})['then'](function(_0x5ef451){_0x3f493f=_0x5ef451;return db[_0x254e('0x46')]['findOne']({'where':{'id':_0x5ef451['ChatWebsiteId']},'attributes':['id',_0x254e('0x47'),_0x254e('0x48'),_0x254e('0x49'),_0x254e('0x4a'),_0x254e('0x4b')],'raw':!![]});})[_0x254e('0x14')](function(_0x173861){if(_0x173861&&_0x173861['vidaooApiKey']&&_0x173861[_0x254e('0x48')]){_0x48e59d=_0x173861;var _0x2b6ff8={'interaction':{'id':_0x167c28},'agent':{'id':_0x146819[_0x254e('0x36')]['id'],'name':_0x146819[_0x254e('0x36')][_0x254e('0x28')],'fullname':_0x146819[_0x254e('0x36')][_0x254e('0x4c')],'email':_0x146819['user']['email']},'contact':_0x146819[_0x254e('0x2c')]['contact'],'account':_0x146819[_0x254e('0x2c')]['account']};var _0x11f2c4={'rejectUnauthorized':![],'method':'POST','url':_0x254e('0x4d'),'headers':{'X-APIKEY':_0x173861[_0x254e('0x47')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x146819[_0x254e('0x36')][_0x254e('0x4e')]],'buttons':null,'topic':_0x48e59d[_0x254e('0x49')],'note':_[_0x254e('0x4f')](_0x48e59d[_0x254e('0x4a')])?null:getMustacheRender(_0x48e59d[_0x254e('0x4a')],_0x2b6ff8),'metadata':null},'redirect':_0x254e('0x50'),'json':!![]};try{if(!_['isNull'](_0x48e59d[_0x254e('0x4b')])){var _0x4a5c09=getMustacheRender(_0x48e59d[_0x254e('0x4b')],_0x2b6ff8);var _0x3679e9=JSON[_0x254e('0x51')](_0x4a5c09);_0x11f2c4[_0x254e('0x2c')][_0x254e('0x52')]=_0x3679e9;}}catch(_0x5436ff){throw new db[(_0x254e('0x53'))][(_0x254e('0x54'))](_0x254e('0x55'));}return rp(_0x11f2c4);}else{throw new db[(_0x254e('0x53'))][(_0x254e('0x54'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x254e('0x14')](function(_0x29ff40){_0x93dbcf=_0x29ff40;if(_0x93dbcf['id']){var _0x5979a5={'body':_0x93dbcf['join_url'],'ChatWebsiteId':_0x48e59d['id'],'ChatInteractionId':_0x3f493f['id'],'direction':_0x254e('0x56'),'UserId':_0x146819[_0x254e('0x36')]['id']};return db['ChatMessage'][_0x254e('0x42')](_0x5979a5,{});}else{throw new db[(_0x254e('0x53'))][(_0x254e('0x54'))](_0x254e('0x57'));}})[_0x254e('0x14')](function(){return _0x3f493f[_0x254e('0x58')]({'vidaooSessionId':_0x93dbcf['id']});})[_0x254e('0x14')](respondWithResult(_0x4a7e92,null))[_0x254e('0x37')](handleError(_0x4a7e92,null));};exports['customUpdate']=function(_0x35faa3,_0x176086){if(_0x35faa3['body']['id']){delete _0x35faa3[_0x254e('0x2c')]['id'];}return db['ChatInteraction'][_0x254e('0x41')]({'where':{'id':_0x35faa3[_0x254e('0x44')]['id']},'include':[{'model':db['CmContact'],'as':_0x254e('0x59')}]})[_0x254e('0x14')](handleEntityNotFound(_0x176086,null))['then'](saveUpdates(_0x35faa3['body'],null))[_0x254e('0x14')](respondWithResult(_0x176086,null))[_0x254e('0x37')](handleError(_0x176086,null));};exports[_0x254e('0x5a')]=function(_0x20f7bd,_0x50805f){if(_0x20f7bd[_0x254e('0x2c')]['id']){delete _0x20f7bd['body']['id'];}return db[_0x254e('0x31')]['find']({'where':{'id':_0x20f7bd[_0x254e('0x44')]['id']}})[_0x254e('0x14')](function(_0x2539fe){if(!_0x2539fe){logger[_0x254e('0x1b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x254e('0x5a'),0x194,_0x254e('0x5b'));_0x50805f[_0x254e('0x27')](0x194);}else{if(_0x2539fe[_0x254e('0x5c')]){throw new db[(_0x254e('0x53'))]['ValidationError'](_0x254e('0x5d'));}}return _0x2539fe;})[_0x254e('0x14')](function(_0x28184b){if(_0x28184b){return _0x28184b[_0x254e('0x43')]({'closed':_0x20f7bd['body']['closed'],'disposition':_0x20f7bd[_0x254e('0x2c')]['disposition']})[_0x254e('0x14')](function(_0x58f107){return _0x58f107;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0x254e('0x5a'),_0x20f7bd['body'],client9004);})[_0x254e('0x14')](respondWithResult(_0x50805f,null))['catch'](handleError(_0x50805f,null));};exports[_0x254e('0x5e')]=function(_0x3a3599,_0x476419){_0x3a3599[_0x254e('0x2c')]['name']=_0x3a3599[_0x254e('0x5f')]['originalname'];_0x3a3599[_0x254e('0x2c')]['basename']=_0x3a3599[_0x254e('0x5f')]['filename'];_0x3a3599[_0x254e('0x2c')][_0x254e('0x60')]=_0x3a3599[_0x254e('0x5f')]['mimetype'];return db[_0x254e('0x61')]['create'](_0x3a3599['body'])[_0x254e('0x14')](respondWithResult(_0x476419,0xc9))[_0x254e('0x37')](handleError(_0x476419,null));};exports[_0x254e('0x62')]=function(_0x6b8e2f,_0x1dc233){return db['ChatInteraction']['findOne']({'where':{'id':_0x6b8e2f[_0x254e('0x44')]['id']},'raw':!![]})[_0x254e('0x14')](handleEntityNotFound(_0x1dc233,null))[_0x254e('0x14')](function(_0x42cf89){if(_0x42cf89){if(_0x42cf89['closed']){return _0x1dc233[_0x254e('0x1f')](0x193)['json']({'status':0x193,'message':_0x254e('0x63')});}return db[_0x254e('0x61')][_0x254e('0x64')]({'where':{'id':_0x6b8e2f[_0x254e('0x3a')][_0x254e('0x65')]},'raw':!![]})[_0x254e('0x14')](handleEntityNotFound(_0x1dc233,null));}})[_0x254e('0x14')](function(_0x289cdc){if(_0x289cdc){var _0xe92adc=_0x289cdc[_0x254e('0x66')]!==null;var _0x35a2f2=path[_0x254e('0x67')](config[_0x254e('0x68')],_0x254e('0x69'));if(_0xe92adc){_0x35a2f2=path[_0x254e('0x67')](_0x35a2f2,'offline-chat/');}var _0x2a2f00=path[_0x254e('0x67')](_0x35a2f2,_0x289cdc['basename']);return _0x1dc233['download'](_0x2a2f00);}})['catch'](handleError(_0x1dc233,null));};exports[_0x254e('0x6a')]=function(_0x325d99,_0x477f3c){var _0x369d49=null;var _0x2ec11c=null;var _0x24c6ea=null;if(_0x325d99[_0x254e('0x2c')]['id']){delete _0x325d99[_0x254e('0x2c')]['id'];}if(_0x325d99['body'][_0x254e('0x6b')]){_0x24c6ea=path[_0x254e('0x67')](config['root'],_0x254e('0x6c'),util[_0x254e('0x6d')]('transcript-%s.txt',Date[_0x254e('0x6e')]()));_0x325d99[_0x254e('0x2c')][_0x254e('0x6f')]=_0x24c6ea;}return db[_0x254e('0x31')][_0x254e('0x41')]({'where':{'id':_0x325d99['params']['id']},'include':[{'model':db[_0x254e('0x70')],'as':_0x254e('0x71'),'include':[{'model':db[_0x254e('0x72')],'as':_0x254e('0x72')}]}]})[_0x254e('0x14')](handleEntityNotFound(_0x477f3c,null))[_0x254e('0x14')](saveUpdates(_0x325d99[_0x254e('0x2c')],null))[_0x254e('0x14')](function(_0x19ce95){if(_0x19ce95){_0x369d49=_0x19ce95;return db[_0x254e('0x46')][_0x254e('0x41')]({'where':{'id':_0x369d49[_0x254e('0x73')]}});}})[_0x254e('0x14')](function(_0xe1b862){if(_0xe1b862){_0x2ec11c=_0xe1b862;return db[_0x254e('0x74')][_0x254e('0x41')]({'where':{'id':_0x369d49[_0x254e('0x75')]}});}})[_0x254e('0x14')](function(_0x421d6b){if(_0x421d6b){if(_0x24c6ea){var _0x581324=null;for(var _0x36028f=0x1;_0x36028f<_0x369d49[_0x254e('0x71')]['length'];++_0x36028f){_0x581324=_0x369d49[_0x254e('0x71')][_0x36028f];var _0x4ba602=_0x581324[_0x254e('0x5c')]?util[_0x254e('0x6d')](_0x254e('0x76'),_0x2ec11c[_0x254e('0x77')],_0x581324['UserId']):_0x254e('0x78');var _0x2c3f2f=_0x325d99[_0x254e('0x2c')][_0x254e('0x79')]||util[_0x254e('0x6d')](_0x254e('0x76'),'Visitor',_0x581324['ContactId']);switch(_0x2ec11c['agentIdentifier']){case _0x254e('0x7a'):_0x4ba602=_0x581324[_0x254e('0x5c')]?util[_0x254e('0x6d')](_0x254e('0x76'),_0x2ec11c[_0x254e('0x77')],_0x581324[_0x254e('0x5c')]):_0x254e('0x78');break;case _0x254e('0x7b'):_0x4ba602=_0x581324['UserId']?_0x581324[_0x254e('0x72')][_0x254e('0x7c')]||_0x581324[_0x254e('0x72')][_0x254e('0x4c')]:'System';break;case _0x254e('0x7d'):_0x4ba602=_0x581324['UserId']?_0x581324[_0x254e('0x72')]['fullname']:_0x254e('0x78');break;default:_0x4ba602=_0x581324[_0x254e('0x5c')]?util[_0x254e('0x6d')](_0x254e('0x76'),_0x2ec11c[_0x254e('0x77')],_0x581324[_0x254e('0x5c')]):_0x254e('0x78');}var _0x471c73=util['format'](_0x254e('0x7e'),moment(_0x581324[_0x254e('0x7f')])[_0x254e('0x6d')](_0x254e('0x80')),_0x581324[_0x254e('0x81')]==='in'?_0x2c3f2f:_0x4ba602,_0x581324[_0x254e('0x2c')]);if(!_0x581324['secret']){fs[_0x254e('0x82')](_0x24c6ea,_0x471c73);}}return db[_0x254e('0x83')][_0x254e('0x64')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x254e('0x84'),'raw':!![],'include':[{'model':db[_0x254e('0x85')],'as':_0x254e('0x85'),'raw':!![]}]}]});}}})[_0x254e('0x14')](function(_0x1bbd75){if(!_0x1bbd75||!_0x1bbd75[_0x254e('0x84')]||!_0x325d99[_0x254e('0x2c')])return _0x369d49;var _0x2ae79f=_0x1bbd75['getSmtpOptions']();return respondWithRpcPromise(_0x254e('0x86'),_0x254e('0x87'),{'account':_0x2ae79f,'message':{'from':util[_0x254e('0x6d')](_0x254e('0x88'),_0x1bbd75[_0x254e('0x28')],_0x1bbd75[_0x254e('0x4e')]||_0x1bbd75[_0x254e('0x84')][_0x254e('0x36')]),'to':_0x325d99[_0x254e('0x2c')][_0x254e('0x6b')],'subject':'Mail\x20Transcript','text':util[_0x254e('0x6d')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x325d99['body'][_0x254e('0x6b')]),'attachments':[{'path':_0x24c6ea}]}})[_0x254e('0x14')](function(){return _0x369d49;})[_0x254e('0x37')](function(_0x482587){logger[_0x254e('0x1b')](_0x482587);});})[_0x254e('0x14')](respondWithStatusCode(_0x477f3c,0xc8))[_0x254e('0x37')](handleError(_0x477f3c,null));};exports[_0x254e('0x89')]=function(_0x5c3871,_0x1230a8){return db[_0x254e('0x70')][_0x254e('0x41')]({'where':{'id':_0x5c3871[_0x254e('0x44')]['id']}})['then'](handleEntityNotFound(_0x1230a8,null))[_0x254e('0x14')](function(_0x385ff2){if(_0x385ff2){return _0x385ff2[_0x254e('0x89')](_0x5c3871[_0x254e('0x2c')][_0x254e('0x8a')],_['omit'](_0x5c3871[_0x254e('0x2c')],[_0x254e('0x8a'),'id'])||{});}})[_0x254e('0x14')](respondWithResult(_0x1230a8,null))[_0x254e('0x37')](handleError(_0x1230a8,null));};exports[_0x254e('0x8b')]=function(_0x41bc65,_0x313654){var _0xbc315={'raw':![],'where':{}};var _0x2124f8={};var _0x4af75a={'count':0x0,'rows':[]};return db[_0x254e('0x31')]['findOne']({'where':{'id':_0x41bc65[_0x254e('0x44')]['id']}})[_0x254e('0x14')](handleEntityNotFound(_0x313654,null))[_0x254e('0x14')](function(_0x5c4d51){if(_0x5c4d51){_0x2124f8[_0x254e('0x3c')]=_[_0x254e('0x39')](db[_0x254e('0x70')][_0x254e('0x32')]);_0x2124f8[_0x254e('0x3a')]=_[_0x254e('0x39')](_0x41bc65[_0x254e('0x3a')]);_0x2124f8[_0x254e('0x3b')]=_[_0x254e('0x3d')](_0x2124f8[_0x254e('0x3c')],_0x2124f8[_0x254e('0x3a')]);_0xbc315['attributes']=_['intersection'](_0x2124f8['model'],qs[_0x254e('0x3e')](_0x41bc65[_0x254e('0x3a')][_0x254e('0x3e')]));_0xbc315[_0x254e('0x3f')]=_0xbc315[_0x254e('0x3f')][_0x254e('0x8c')]?_0xbc315[_0x254e('0x3f')]:_0x2124f8[_0x254e('0x3c')];if(!_0x41bc65[_0x254e('0x3a')][_0x254e('0x8d')](_0x254e('0x8e'))){_0xbc315['limit']=qs[_0x254e('0x22')](_0x41bc65[_0x254e('0x3a')][_0x254e('0x22')]);_0xbc315[_0x254e('0x24')]=qs[_0x254e('0x24')](_0x41bc65[_0x254e('0x3a')][_0x254e('0x24')]);}_0xbc315[_0x254e('0x8f')]=qs['sort'](_0x41bc65[_0x254e('0x3a')]['sort']);_0xbc315[_0x254e('0x90')]=qs['filters'](_[_0x254e('0x91')](_0x41bc65[_0x254e('0x3a')],_0x2124f8['filters']));_0xbc315[_0x254e('0x90')][_0x254e('0x92')]=_0x5c4d51['id'];if(_0x41bc65[_0x254e('0x3a')][_0x254e('0x93')]){_0xbc315[_0x254e('0x90')]=_[_0x254e('0x2b')](_0xbc315[_0x254e('0x90')],{'$or':_[_0x254e('0x30')](_0xbc315[_0x254e('0x3f')],function(_0x4b2eeb){var _0x393c2c={};_0x393c2c[_0x4b2eeb]={'$like':'%'+_0x41bc65[_0x254e('0x3a')][_0x254e('0x93')]+'%'};return _0x393c2c;})});}if(_0x41bc65['query'][_0x254e('0x94')]){var _0x26728f=_0x41bc65[_0x254e('0x3a')]['$gte'][_0x254e('0x95')](',');var _0x311b3d={};_0x311b3d[_0x26728f[0x0]]={'$gte':moment(_0x26728f[0x1])[_0x254e('0x6d')](_0x254e('0x96'))};_0xbc315['where']=_[_0x254e('0x2b')](_0xbc315[_0x254e('0x90')],_0x311b3d);}_0xbc315=_['merge']({},_0xbc315,_0x41bc65[_0x254e('0x40')]);return db[_0x254e('0x70')][_0x254e('0x23')]({'where':_0xbc315[_0x254e('0x90')]})['then'](function(_0x2c2e25){_0x4af75a['count']=_0x2c2e25;if(_0x41bc65[_0x254e('0x3a')][_0x254e('0x97')]){_0xbc315[_0x254e('0x98')]=[{'all':!![]}];}return db[_0x254e('0x70')][_0x254e('0x35')](_0xbc315);})[_0x254e('0x14')](function(_0x428fca){_0x4af75a[_0x254e('0x99')]=_0x428fca;return _0x4af75a;});}})[_0x254e('0x14')](respondWithFilteredResult(_0x313654,_0xbc315))[_0x254e('0x37')](handleError(_0x313654,null));};exports['getMyMessages']=function(_0x5de933,_0x17bc61){var _0x4a24f4={'where':{}},_0x5e52a3={},_0x2ea696={'count':0x0,'rows':[]};return db[_0x254e('0x31')]['findOne']({'where':{'id':_0x5de933[_0x254e('0x44')]['id']}})[_0x254e('0x14')](handleEntityNotFound(_0x17bc61,null))[_0x254e('0x14')](function(_0x257b65){if(_0x257b65){_0x5e52a3[_0x254e('0x3c')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x5e52a3[_0x254e('0x3a')]=_['keys'](_0x5de933[_0x254e('0x3a')]);_0x5e52a3[_0x254e('0x3b')]=_['intersection'](_0x5e52a3[_0x254e('0x3c')],_0x5e52a3['query']);_0x4a24f4[_0x254e('0x3f')]=_[_0x254e('0x3d')](_0x5e52a3[_0x254e('0x3c')],qs['fields'](_0x5de933['query'][_0x254e('0x3e')]));_0x4a24f4['attributes']=_0x4a24f4[_0x254e('0x3f')][_0x254e('0x8c')]?_0x4a24f4['attributes']:_0x5e52a3[_0x254e('0x3c')];if(!_0x5de933[_0x254e('0x3a')][_0x254e('0x8d')](_0x254e('0x8e'))){_0x4a24f4[_0x254e('0x22')]=qs[_0x254e('0x22')](_0x5de933['query'][_0x254e('0x22')]);_0x4a24f4[_0x254e('0x24')]=qs[_0x254e('0x24')](_0x5de933['query'][_0x254e('0x24')]);}_0x4a24f4[_0x254e('0x8f')]=qs[_0x254e('0x9a')](_0x5de933[_0x254e('0x3a')][_0x254e('0x9a')]);_0x4a24f4['where']=qs['filters'](_[_0x254e('0x91')](_0x5de933['query'],_0x5e52a3['filters']));_0x4a24f4[_0x254e('0x90')]['ChatInteractionId']=_0x257b65['id'];if(_0x5de933[_0x254e('0x3a')][_0x254e('0x93')]){_0x4a24f4[_0x254e('0x90')]=_[_0x254e('0x2b')](_0x4a24f4[_0x254e('0x90')],{'$or':_['map'](_0x4a24f4['attributes'],function(_0x4fd52b){var _0x12cd66={};_0x12cd66[_0x4fd52b]={'$like':'%'+_0x5de933[_0x254e('0x3a')]['filter']+'%'};return _0x12cd66;})});}_0x4a24f4[_0x254e('0x90')][_0x254e('0x9b')]=![];if(_0x5de933[_0x254e('0x3a')]['id']){_0x4a24f4[_0x254e('0x90')]['id']={'$gt':_0x5de933[_0x254e('0x3a')]['id']};}_0x4a24f4=_[_0x254e('0x2b')]({},_0x4a24f4,_0x5de933[_0x254e('0x40')]);return db[_0x254e('0x70')][_0x254e('0x23')]({'where':_0x4a24f4[_0x254e('0x90')]})[_0x254e('0x14')](function(_0x47ab5e){_0x2ea696[_0x254e('0x23')]=_0x47ab5e;_0x4a24f4[_0x254e('0x98')]=[];if(_0x5de933[_0x254e('0x3a')][_0x254e('0x9c')]){_0x4a24f4[_0x254e('0x98')][_0x254e('0x9d')]({'model':db[_0x254e('0x72')],'as':_0x254e('0x72'),'attributes':['id',_0x254e('0x4c'),'alias']});}if(_0x5de933[_0x254e('0x3a')][_0x254e('0x97')]){_0x4a24f4[_0x254e('0x98')]=[{'all':!![]}];}return db[_0x254e('0x70')][_0x254e('0x35')](_0x4a24f4);})['then'](function(_0x4cd87c){_0x2ea696[_0x254e('0x99')]=_0x4cd87c;return _0x2ea696;});}})[_0x254e('0x14')](respondWithFilteredResult(_0x17bc61,_0x4a24f4))['catch'](handleError(_0x17bc61,null));};exports['addTags']=function(_0x4bea03,_0x384961){return db[_0x254e('0x31')][_0x254e('0x41')]({'where':{'id':_0x4bea03['params']['id']}})[_0x254e('0x14')](handleEntityNotFound(_0x384961,null))[_0x254e('0x14')](function(_0x3872d4){if(_0x3872d4){return _0x3872d4[_0x254e('0x9e')](_0x4bea03[_0x254e('0x2c')][_0x254e('0x8a')],_[_0x254e('0x9f')](_0x4bea03[_0x254e('0x2c')],[_0x254e('0x8a'),'id'])||{})[_0x254e('0xa0')](function(){return db[_0x254e('0xa1')][_0x254e('0x35')]({'attributes':['id',_0x254e('0x28'),_0x254e('0xa2')],'where':{'id':_0x4bea03[_0x254e('0x2c')]['ids']}});})[_0x254e('0x14')](function(_0x1c6ee7){socket[_0x254e('0xa3')](_0x254e('0xa4'),{'id':Number(_0x4bea03['params']['id']),'tags':_0x1c6ee7||[]});return{'id':Number(_0x4bea03[_0x254e('0x44')]['id']),'tags':_0x1c6ee7||[]};});}})['then'](respondWithResult(_0x384961,null))[_0x254e('0x37')](handleError(_0x384961,null));};exports['removeTags']=function(_0x423c6d,_0x7ce9c6){return db[_0x254e('0x31')]['find']({'where':{'id':_0x423c6d[_0x254e('0x44')]['id']}})[_0x254e('0x14')](handleEntityNotFound(_0x7ce9c6,null))['then'](function(_0x4c75c4){if(_0x4c75c4){return _0x4c75c4['removeTags'](_0x423c6d[_0x254e('0x3a')][_0x254e('0x8a')]);}})[_0x254e('0x14')](respondWithStatusCode(_0x7ce9c6,null))[_0x254e('0x37')](handleError(_0x7ce9c6,null));};exports[_0x254e('0xa5')]=function(_0x508fa7,_0x5a9f36){var _0x1962ae=moment()[_0x254e('0xa6')]()[_0x254e('0xa7')]();var _0x321802=path[_0x254e('0x67')](config[_0x254e('0x68')],_0x254e('0xa8'),_0x254e('0xa9'),'tmp');var _0x230b5d=path[_0x254e('0x67')](config['root'],'server',_0x254e('0xa9'),_0x254e('0xaa'));var _0x53865a=path[_0x254e('0x67')](_0x321802,_0x1962ae);var _0x43c846=util[_0x254e('0x6d')](_0x254e('0xab'),_0x508fa7[_0x254e('0x44')]['id'],_0x1962ae);var _0x53927b=path[_0x254e('0x67')](_0x321802,_0x43c846);var _0x4f8dae=[];_0x4f8dae['push']({'model':db[_0x254e('0x72')],'as':_0x254e('0x72'),'attributes':['id',_0x254e('0x4c')],'raw':!![]});_0x4f8dae['push']({'model':db[_0x254e('0x74')],'as':_0x254e('0x59'),'attributes':['id','firstName',_0x254e('0xac')],'raw':!![]});if(_0x508fa7['query']['attachments']){_0x4f8dae['push']({'model':db[_0x254e('0x61')],'as':_0x254e('0x61'),'raw':!![]});}var _0x16f8c3=[{'model':db[_0x254e('0x70')],'as':_0x254e('0x71'),'attributes':['id',_0x254e('0x2c'),'createdAt','direction',_0x254e('0x9b'),_0x254e('0xad')],'include':_0x4f8dae}];_0x16f8c3[_0x254e('0x9d')]({'model':db[_0x254e('0x46')],'as':'Account','attributes':['id','name']});_0x16f8c3['push']({'model':db[_0x254e('0x72')],'as':_0x254e('0xae'),'attributes':['id',_0x254e('0x4c')]});return db['ChatInteraction']['find']({'where':{'id':_0x508fa7[_0x254e('0x44')]['id']},'include':_0x16f8c3})[_0x254e('0x14')](handleEntityNotFound(_0x5a9f36,null))[_0x254e('0x14')](function(_0x2c18db){if(_0x2c18db){var _0x16b2c2=_0x2c18db[_0x254e('0xaf')]({'plain':!![]});fs[_0x254e('0xb0')](_0x53865a);var _0x55302a={'channel':_0x254e('0xb1'),'account':_0x16b2c2['Account']['name'],'agent':_0x16b2c2[_0x254e('0xae')]?_0x16b2c2[_0x254e('0xae')][_0x254e('0x4c')]:'N.A.','createdAt':moment(_0x16b2c2[_0x254e('0x7f')])[_0x254e('0x6d')](_0x254e('0x96'))[_0x254e('0xa7')](),'closedAt':_0x16b2c2[_0x254e('0xb2')]?moment(_0x16b2c2[_0x254e('0xb3')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x254e('0xa7')]():'','disposition':_0x16b2c2[_0x254e('0xb4')],'chatInfo':{'browser':_0x16b2c2[_0x254e('0xb5')],'os':_0x16b2c2['osName'],'referer':_0x16b2c2[_0x254e('0xb6')],'customerIp':_0x16b2c2['customerIp'],'customerPort':_0x16b2c2[_0x254e('0xb7')]?_0x16b2c2['customerPort']:_0x254e('0xb8')},'messages':_(_0x16b2c2['Messages'])[_0x254e('0xb9')]()[_0x254e('0x93')]({'secret':![]})[_0x254e('0x30')](function(_0x48cd6a){if(_0x48cd6a[_0x254e('0x61')]){var _0x29668f=path[_0x254e('0x67')](_0x230b5d,_0x48cd6a[_0x254e('0x61')][_0x254e('0xba')]);if(fs[_0x254e('0xbb')](_0x29668f)){fs[_0x254e('0xbc')](_0x29668f)[_0x254e('0xbd')](fs['createWriteStream'](path['join'](_0x53865a,_0x48cd6a[_0x254e('0x61')][_0x254e('0xba')])));}}return{'date':moment(_0x48cd6a[_0x254e('0x7f')])[_0x254e('0x6d')](_0x254e('0x96'))[_0x254e('0xa7')](),'sender':_0x48cd6a[_0x254e('0x81')]===_0x254e('0x56')?_0x48cd6a[_0x254e('0x72')]?_0x48cd6a['User'][_0x254e('0x4c')]:_0x254e('0x78'):_0x48cd6a[_0x254e('0x59')][_0x254e('0xbe')]+(_0x48cd6a[_0x254e('0x59')][_0x254e('0xac')]?'\x20'+_0x48cd6a[_0x254e('0x59')][_0x254e('0xac')]:''),'body':_0x48cd6a[_0x254e('0x61')]?_0x48cd6a['Attachment'][_0x254e('0xba')]:_0x48cd6a[_0x254e('0x2c')],'direction':_0x48cd6a['direction']===_0x254e('0x56')?'A':'C','secret':_0x48cd6a[_0x254e('0x9b')],'read':_0x48cd6a['read'],'attachment':_0x48cd6a[_0x254e('0x61')]};})[_0x254e('0xbf')]()};return ejs[_0x254e('0xc0')](path['join'](config[_0x254e('0x68')],_0x254e('0xa8'),'views',_0x254e('0xc1')),{'interaction':_0x55302a})[_0x254e('0x14')](function(_0x9e9659){var _0x441785=path['join'](_0x53865a,'transcript-'+_0x16b2c2['id']+'-'+_0x1962ae+'.pdf');var _0x475b24={'path':_0x441785,'channel':_0x254e('0xb1'),'interactionId':_0x16b2c2['id']};return pdf[_0x254e('0xc2')](_0x9e9659,_0x475b24);})[_0x254e('0x14')](function(){return new Promise(function(_0x4746fe,_0x17edda){zipdir(_0x53865a,{'saveTo':_0x53927b},function(_0x3258ab,_0x2bb305){if(_0x3258ab)return _0x17edda(_0x3258ab);return _0x4746fe(_0x2bb305);});})['then'](function(){return new BPromise(function(_0x7347a2,_0x3f271b){rimraf(_0x53865a,function(_0xa4f020){if(_0xa4f020)_0x3f271b(_0xa4f020);return _0x7347a2();});});})[_0x254e('0x14')](function(){return _0x5a9f36[_0x254e('0xa5')](_0x53927b,_0x43c846,function(_0x325b0c){if(_0x325b0c){logger[_0x254e('0x1b')](_0x254e('0xc3'),_0x325b0c);}else{fs[_0x254e('0xc4')](_0x53927b);}});});});}else{return _0x5a9f36['sendStatus'](0xc8);}})[_0x254e('0x37')](handleError(_0x5a9f36,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 4d59c89..f3d9067 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 _0xdd68=['then','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers'];(function(_0x25c2a9,_0x26e068){var _0x434e1b=function(_0x58493e){while(--_0x58493e){_0x25c2a9['push'](_0x25c2a9['shift']());}};_0x434e1b(++_0x26e068);}(_0xdd68,0xdb));var _0x8dd6=function(_0x5c78d9,_0x2736c7){_0x5c78d9=_0x5c78d9-0x0;var _0x69ae1f=_0xdd68[_0x5c78d9];return _0x69ae1f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x8dd6('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x8dd6('0x0'))['db'][_0x8dd6('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8dd6('0x2')](0x0);var events={'afterCreate':_0x8dd6('0x3'),'afterUpdate':'update','afterDestroy':_0x8dd6('0x4')};function emitEvent(_0x51c331){return function(_0x33a5ed,_0x295ad0,_0x36cad0){_0x33a5ed[_0x8dd6('0x5')]({'attributes':['id'],'raw':!![]})[_0x8dd6('0x6')](function(_0x17873e){_0x33a5ed['setDataValue']('Users',_0x17873e[_0x8dd6('0x7')](function(_0x6140ec){return{'id':_0x6140ec['id']};}));return ChatMessage[_0x8dd6('0x8')]({'where':{'ChatInteractionId':_0x33a5ed['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8dd6('0x6')](function(_0xdeee3e){_0x33a5ed[_0x8dd6('0x9')](_0x8dd6('0xa'),_0xdeee3e['length']);ChatInteractionEvents[_0x8dd6('0xb')](_0x51c331+':'+_0x33a5ed['id'],_0x33a5ed);ChatInteractionEvents[_0x8dd6('0xb')](_0x51c331,_0x33a5ed);_0x36cad0(null);})[_0x8dd6('0xc')](_0x36cad0(null));};}for(var e in events){if(events[_0x8dd6('0xd')](e)){var event=events[e];ChatInteraction[_0x8dd6('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xc672=['../../mysqldb','ChatInteraction','setMaxListeners','update','remove','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','events'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0xc672,0x87));var _0x2c67=function(_0xc87033,_0x3c9a4a){_0xc87033=_0xc87033-0x0;var _0x21ee66=_0xc672[_0xc87033];return _0x21ee66;};'use strict';var EventEmitter=require(_0x2c67('0x0'));var ChatInteraction=require(_0x2c67('0x1'))['db'][_0x2c67('0x2')];var ChatMessage=require(_0x2c67('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2c67('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2c67('0x4'),'afterDestroy':_0x2c67('0x5')};function emitEvent(_0x4e0813){return function(_0x40c016,_0x133788,_0x152984){_0x40c016['getUsers']({'attributes':['id'],'raw':!![]})[_0x2c67('0x6')](function(_0x751e2d){_0x40c016['setDataValue'](_0x2c67('0x7'),_0x751e2d[_0x2c67('0x8')](function(_0x3713ed){return{'id':_0x3713ed['id']};}));return ChatMessage[_0x2c67('0x9')]({'where':{'ChatInteractionId':_0x40c016['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2c67('0x6')](function(_0x23a71d){_0x40c016[_0x2c67('0xa')](_0x2c67('0xb'),_0x23a71d[_0x2c67('0xc')]);ChatInteractionEvents['emit'](_0x4e0813+':'+_0x40c016['id'],_0x40c016);ChatInteractionEvents[_0x2c67('0xd')](_0x4e0813,_0x40c016);_0x152984(null);})[_0x2c67('0xe')](_0x152984(null));};}for(var e in events){if(events[_0x2c67('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x2c67('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 60d0b14..e249daa 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 _0x8b7b=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','ChatInteraction','chat_interactions'];(function(_0x2f5e81,_0x49c319){var _0x5e4f0e=function(_0x3343d8){while(--_0x3343d8){_0x2f5e81['push'](_0x2f5e81['shift']());}};_0x5e4f0e(++_0x49c319);}(_0x8b7b,0x95));var _0xb8b7=function(_0x36c396,_0x332431){_0x36c396=_0x36c396-0x0;var _0x201307=_0x8b7b[_0x36c396];return _0x201307;};'use strict';var _=require(_0xb8b7('0x0'));var util=require('util');var logger=require(_0xb8b7('0x1'))(_0xb8b7('0x2'));var moment=require(_0xb8b7('0x3'));var BPromise=require('bluebird');var rp=require(_0xb8b7('0x4'));var fs=require('fs');var path=require(_0xb8b7('0x5'));var rimraf=require(_0xb8b7('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0xb8b7('0x7')]=function(_0x19d25a,_0x2ff03d){return _0x19d25a[_0xb8b7('0x8')](_0xb8b7('0x9'),attributes,{'tableName':_0xb8b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57325f,_0x5ec27b,_0x14e43a){if(_0x57325f[_0xb8b7('0xb')]('closed')){_0x57325f[_0xb8b7('0xc')]=moment()[_0xb8b7('0xd')](_0xb8b7('0xe'));}_0x14e43a(null,_0x57325f);}},'charset':'utf8mb4','collate':_0xb8b7('0xf')});}; \ No newline at end of file +var _0x8aed=['api','request-promise','path','define','chat_interactions','changed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5e4cea,_0x50eb0e){var _0x151e98=function(_0x50479f){while(--_0x50479f){_0x5e4cea['push'](_0x5e4cea['shift']());}};_0x151e98(++_0x50eb0e);}(_0x8aed,0x8e));var _0xd8ae=function(_0x315bf5,_0x6794a3){_0x315bf5=_0x315bf5-0x0;var _0x34d518=_0x8aed[_0x315bf5];return _0x34d518;};'use strict';var _=require(_0xd8ae('0x0'));var util=require(_0xd8ae('0x1'));var logger=require('../../config/logger')(_0xd8ae('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd8ae('0x3'));var fs=require('fs');var path=require(_0xd8ae('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x1e242c,_0x49d82d){return _0x1e242c[_0xd8ae('0x5')]('ChatInteraction',attributes,{'tableName':_0xd8ae('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x56f199,_0x176a87,_0x352b15){if(_0x56f199[_0xd8ae('0x7')]('closed')){_0x56f199[_0xd8ae('0x8')]=moment()[_0xd8ae('0x9')]('YYYY-MM-DD\x20HH:mm:ss');}_0x352b15(null,_0x56f199);}},'charset':_0xd8ae('0xa'),'collate':_0xd8ae('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index c253f37..df54603 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 _0x50bd=['ChatInteraction','update','body','options','raw','where','attributes','UpdateChatInteraction','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./chatInteraction.socket','register','request','then','info','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x50bd,0x113));var _0xd50b=function(_0x29fc91,_0x386185){_0x29fc91=_0x29fc91-0x0;var _0x2adbd1=_0x50bd[_0x29fc91];return _0x2adbd1;};'use strict';var _=require(_0xd50b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd50b('0x1'));var rs=require(_0xd50b('0x2'));var fs=require('fs');var Redis=require(_0xd50b('0x3'));var db=require(_0xd50b('0x4'))['db'];var utils=require(_0xd50b('0x5'));var logger=require(_0xd50b('0x6'))(_0xd50b('0x7'));var config=require(_0xd50b('0x8'));var jayson=require(_0xd50b('0x9'));var client=jayson[_0xd50b('0xa')][_0xd50b('0xb')]({'port':0x232a});config['redis']=_[_0xd50b('0xc')](config['redis'],{'host':_0xd50b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd50b('0xe')]));require(_0xd50b('0xf'))[_0xd50b('0x10')](socket);function respondWithRpcPromise(_0x3dd240,_0x51d32b,_0x4dbb3e){return new BPromise(function(_0x59beac,_0xa827a4){return client[_0xd50b('0x11')](_0x3dd240,_0x4dbb3e)[_0xd50b('0x12')](function(_0x40f15d){logger[_0xd50b('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x51d32b,_0xd50b('0x14'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x51d32b,'request\x20sent',JSON['stringify'](_0x40f15d));if(_0x40f15d[_0xd50b('0x15')]){if(_0x40f15d['error'][_0xd50b('0x16')]===0x1f4){logger[_0xd50b('0x15')](_0xd50b('0x17'),_0x51d32b,_0x40f15d[_0xd50b('0x15')][_0xd50b('0x18')]);return _0xa827a4(_0x40f15d[_0xd50b('0x15')]['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x51d32b,_0x40f15d[_0xd50b('0x15')][_0xd50b('0x18')]);return _0x59beac(_0x40f15d['error'][_0xd50b('0x18')]);}else{logger[_0xd50b('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x51d32b,_0xd50b('0x14'));_0x59beac(_0x40f15d['result']['message']);}})[_0xd50b('0x19')](function(_0x3ff86b){logger['error'](_0xd50b('0x17'),_0x51d32b,_0x3ff86b);_0xa827a4(_0x3ff86b);});});}exports['UpdateChatInteraction']=function(_0xe4f10b){var _0x8b5ac0=this;return new Promise(function(_0x315643,_0x1d75d7){return db[_0xd50b('0x1a')][_0xd50b('0x1b')](_0xe4f10b[_0xd50b('0x1c')],{'raw':_0xe4f10b[_0xd50b('0x1d')]?_0xe4f10b[_0xd50b('0x1d')][_0xd50b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe4f10b[_0xd50b('0x1d')]?_0xe4f10b['options'][_0xd50b('0x1f')]||null:null,'attributes':_0xe4f10b[_0xd50b('0x1d')]?_0xe4f10b[_0xd50b('0x1d')][_0xd50b('0x20')]||null:null,'limit':_0xe4f10b[_0xd50b('0x1d')]?_0xe4f10b[_0xd50b('0x1d')]['limit']||null:null})[_0xd50b('0x12')](function(_0x2bd7d1){logger[_0xd50b('0x13')](_0xd50b('0x21'),_0xe4f10b);logger['debug'](_0xd50b('0x21'),_0xe4f10b,JSON[_0xd50b('0x22')](_0x2bd7d1));_0x315643(_0x2bd7d1);})[_0xd50b('0x19')](function(_0x268c80){logger[_0xd50b('0x15')](_0xd50b('0x21'),_0x268c80[_0xd50b('0x18')],_0xe4f10b);_0x1d75d7(_0x8b5ac0[_0xd50b('0x15')](0x1f4,_0x268c80['message']));});});};exports[_0xd50b('0x23')]=function(_0x33a9e6){return new Promise(function(_0x9d7477,_0x2c8644){return db[_0xd50b('0x1a')][_0xd50b('0x24')]({'where':_0x33a9e6[_0xd50b('0x1d')]?_0x33a9e6[_0xd50b('0x1d')][_0xd50b('0x1f')]||null:null})['then'](function(_0xa20e23){if(_0xa20e23){return _0xa20e23[_0xd50b('0x25')](_0x33a9e6[_0xd50b('0x1c')][_0xd50b('0x26')],_[_0xd50b('0x27')](_0x33a9e6['body'],['ids','id'])||{});}})[_0xd50b('0x28')](function(_0x29b0d4){logger[_0xd50b('0x13')](_0xd50b('0x29'),_0x33a9e6);logger[_0xd50b('0x2a')](_0xd50b('0x29'),_0x33a9e6,JSON['stringify'](_0x29b0d4));_0x9d7477(_0x29b0d4);})['catch'](function(_0x307a00){logger['error']('AddTags',_0x307a00['message'],_0x33a9e6);_0x2c8644(_this['error'](0x1f4,_0x307a00[_0xd50b('0x18')]));});});}; \ No newline at end of file +var _0xaeef=['randomstring','ioredis','../../config/logger','rpc','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','options','raw','where','attributes','UpdateChatInteraction','ChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xaeef,0x1e8));var _0xfaee=function(_0x8df189,_0x5f4e9b){_0x8df189=_0x8df189-0x0;var _0x2aa166=_0xaeef[_0x8df189];return _0x2aa166;};'use strict';var _=require(_0xfaee('0x0'));var util=require(_0xfaee('0x1'));var moment=require(_0xfaee('0x2'));var BPromise=require(_0xfaee('0x3'));var rs=require(_0xfaee('0x4'));var fs=require('fs');var Redis=require(_0xfaee('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfaee('0x6'))(_0xfaee('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfaee('0x8')][_0xfaee('0x9')]({'port':0x232a});config[_0xfaee('0xa')]=_[_0xfaee('0xb')](config[_0xfaee('0xa')],{'host':_0xfaee('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfaee('0xd'))[_0xfaee('0xe')](socket);function respondWithRpcPromise(_0xa94834,_0x55ae39,_0xafac5a){return new BPromise(function(_0x3a570e,_0x5bb18f){return client[_0xfaee('0xf')](_0xa94834,_0xafac5a)[_0xfaee('0x10')](function(_0x34735e){logger['info'](_0xfaee('0x11'),_0x55ae39,_0xfaee('0x12'));logger[_0xfaee('0x13')](_0xfaee('0x14'),_0x55ae39,_0xfaee('0x12'),JSON[_0xfaee('0x15')](_0x34735e));if(_0x34735e[_0xfaee('0x16')]){if(_0x34735e[_0xfaee('0x16')][_0xfaee('0x17')]===0x1f4){logger['error'](_0xfaee('0x11'),_0x55ae39,_0x34735e[_0xfaee('0x16')]['message']);return _0x5bb18f(_0x34735e['error'][_0xfaee('0x18')]);}logger['error'](_0xfaee('0x11'),_0x55ae39,_0x34735e[_0xfaee('0x16')][_0xfaee('0x18')]);return _0x3a570e(_0x34735e['error']['message']);}else{logger[_0xfaee('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x55ae39,_0xfaee('0x12'));_0x3a570e(_0x34735e[_0xfaee('0x1a')][_0xfaee('0x18')]);}})[_0xfaee('0x1b')](function(_0x477b42){logger['error'](_0xfaee('0x11'),_0x55ae39,_0x477b42);_0x5bb18f(_0x477b42);});});}exports['UpdateChatInteraction']=function(_0x596088){var _0x419201=this;return new Promise(function(_0x2e4753,_0x75521c){return db['ChatInteraction']['update'](_0x596088['body'],{'raw':_0x596088[_0xfaee('0x1c')]?_0x596088[_0xfaee('0x1c')][_0xfaee('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x596088[_0xfaee('0x1c')]?_0x596088[_0xfaee('0x1c')][_0xfaee('0x1e')]||null:null,'attributes':_0x596088[_0xfaee('0x1c')]?_0x596088['options'][_0xfaee('0x1f')]||null:null,'limit':_0x596088[_0xfaee('0x1c')]?_0x596088[_0xfaee('0x1c')]['limit']||null:null})[_0xfaee('0x10')](function(_0x4f2b23){logger['info'](_0xfaee('0x20'),_0x596088);logger[_0xfaee('0x13')](_0xfaee('0x20'),_0x596088,JSON['stringify'](_0x4f2b23));_0x2e4753(_0x4f2b23);})['catch'](function(_0x1dfad6){logger[_0xfaee('0x16')](_0xfaee('0x20'),_0x1dfad6[_0xfaee('0x18')],_0x596088);_0x75521c(_0x419201[_0xfaee('0x16')](0x1f4,_0x1dfad6[_0xfaee('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x3bdc74){return new Promise(function(_0x1a1cb5,_0x23e741){return db[_0xfaee('0x21')][_0xfaee('0x22')]({'where':_0x3bdc74[_0xfaee('0x1c')]?_0x3bdc74[_0xfaee('0x1c')][_0xfaee('0x1e')]||null:null})['then'](function(_0x54e06b){if(_0x54e06b){return _0x54e06b[_0xfaee('0x23')](_0x3bdc74[_0xfaee('0x24')][_0xfaee('0x25')],_[_0xfaee('0x26')](_0x3bdc74['body'],[_0xfaee('0x25'),'id'])||{});}})[_0xfaee('0x27')](function(_0x4bde8b){logger['info'](_0xfaee('0x28'),_0x3bdc74);logger[_0xfaee('0x13')](_0xfaee('0x28'),_0x3bdc74,JSON['stringify'](_0x4bde8b));_0x1a1cb5(_0x4bde8b);})[_0xfaee('0x1b')](function(_0x2dc1af){logger[_0xfaee('0x16')]('AddTags',_0x2dc1af[_0xfaee('0x18')],_0x3bdc74);_0x23e741(_this[_0xfaee('0x16')](0x1f4,_0x2dc1af[_0xfaee('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 2ba5ee9..5205ac4 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 _0xf778=['update','emit','removeListener','register','length','./chatInteraction.events','save','remove'];(function(_0xcaf223,_0xd39f07){var _0x17e00d=function(_0xe2852e){while(--_0xe2852e){_0xcaf223['push'](_0xcaf223['shift']());}};_0x17e00d(++_0xd39f07);}(_0xf778,0x9d));var _0x8f77=function(_0x3f4c67,_0x1a5f87){_0x3f4c67=_0x3f4c67-0x0;var _0x5c3777=_0xf778[_0x3f4c67];return _0x5c3777;};'use strict';var ChatInteractionEvents=require(_0x8f77('0x0'));var events=[_0x8f77('0x1'),_0x8f77('0x2'),_0x8f77('0x3')];function createListener(_0x1320ba,_0x410562){return function(_0x6c5670){_0x410562[_0x8f77('0x4')](_0x1320ba,_0x6c5670);};}function removeListener(_0x3607b5,_0x4e63ec){return function(){ChatInteractionEvents[_0x8f77('0x5')](_0x3607b5,_0x4e63ec);};}exports[_0x8f77('0x6')]=function(_0x14537f){for(var _0x2fa72d=0x0,_0x3f309e=events[_0x8f77('0x7')];_0x2fa72d<_0x3f309e;_0x2fa72d++){var _0xb52b35=events[_0x2fa72d];var _0x34a97e=createListener('chatInteraction:'+_0xb52b35,_0x14537f);ChatInteractionEvents['on'](_0xb52b35,_0x34a97e);}}; \ No newline at end of file +var _0xcba7=['length','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x4109f3,_0x257ef8){var _0x31c848=function(_0x304bf3){while(--_0x304bf3){_0x4109f3['push'](_0x4109f3['shift']());}};_0x31c848(++_0x257ef8);}(_0xcba7,0x199));var _0x7cba=function(_0x4b5f1f,_0x1fee93){_0x4b5f1f=_0x4b5f1f-0x0;var _0x3bb747=_0xcba7[_0x4b5f1f];return _0x3bb747;};'use strict';var ChatInteractionEvents=require(_0x7cba('0x0'));var events=[_0x7cba('0x1'),_0x7cba('0x2'),_0x7cba('0x3')];function createListener(_0x5e59d1,_0x119b7f){return function(_0x461067){_0x119b7f[_0x7cba('0x4')](_0x5e59d1,_0x461067);};}function removeListener(_0x4fa145,_0x251250){return function(){ChatInteractionEvents[_0x7cba('0x5')](_0x4fa145,_0x251250);};}exports[_0x7cba('0x6')]=function(_0x2b0112){for(var _0x285928=0x0,_0x12bc28=events[_0x7cba('0x7')];_0x285928<_0x12bc28;_0x285928++){var _0x435722=events[_0x285928];var _0x1a1cef=createListener('chatInteraction:'+_0x435722,_0x2b0112);ChatInteractionEvents['on'](_0x435722,_0x1a1cef);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 3e8b42d..812644b 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 _0x0362=['close','destroy','delete','removeTags','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMyMessages','/:id/download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','abandon'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x0362,0x65));var _0x2036=function(_0x3fdb39,_0x45dace){_0x3fdb39=_0x3fdb39-0x0;var _0x154df5=_0x0362[_0x3fdb39];return _0x154df5;};'use strict';var multer=require('multer');var util=require(_0x2036('0x0'));var path=require('path');var timeout=require(_0x2036('0x1'));var express=require(_0x2036('0x2'));var router=express[_0x2036('0x3')]();var fs_extra=require(_0x2036('0x4'));var auth=require(_0x2036('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2036('0x6'));router[_0x2036('0x7')]('/',auth[_0x2036('0x8')](),controller['index']);router[_0x2036('0x7')](_0x2036('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2036('0xa'),auth[_0x2036('0xb')](),controller[_0x2036('0xc')]);router[_0x2036('0x7')]('/:id/attachment_download',auth[_0x2036('0xb')](),controller[_0x2036('0xd')]);router['get'](_0x2036('0xe'),auth[_0x2036('0x8')](),controller['getMessages']);router[_0x2036('0x7')]('/:id/my_messages',auth[_0x2036('0xb')](),controller[_0x2036('0xf')]);router[_0x2036('0x7')](_0x2036('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x2036('0x11')]('/',auth['isAuthenticated'](),controller[_0x2036('0x12')]);router[_0x2036('0x11')]('/:id/vidaoo',auth[_0x2036('0x8')](),controller[_0x2036('0x13')]);var upload=multer({'storage':multer[_0x2036('0x14')]({'destination':function(_0x1565a8,_0x28c74a,_0x26489a){_0x26489a(null,path[_0x2036('0x15')](config[_0x2036('0x16')],_0x2036('0x17')));},'filename':function(_0x3301d0,_0x790181,_0x26c14a){_0x26c14a(null,util[_0x2036('0x18')](_0x2036('0x19'),Date[_0x2036('0x1a')](),_0x790181[_0x2036('0x1b')][_0x2036('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x2036('0x1d'),upload[_0x2036('0x1e')](_0x2036('0x1f')),controller[_0x2036('0x20')]);router[_0x2036('0x11')](_0x2036('0xe'),auth[_0x2036('0xb')](),controller['addMessage']);router[_0x2036('0x11')](_0x2036('0x21'),auth[_0x2036('0x8')](),interaction[_0x2036('0x22')](_0x2036('0x23'),_0x2036('0x24')),controller['addTags']);router['put'](_0x2036('0xa'),auth[_0x2036('0x8')](),interaction[_0x2036('0x22')](_0x2036('0x23'),_0x2036('0x25')),controller[_0x2036('0x26')]);router[_0x2036('0x27')](_0x2036('0x28'),controller[_0x2036('0x29')]);router['put']('/:id/abandon',auth[_0x2036('0xb')](),controller[_0x2036('0x2a')]);router['put']('/:id/close',controller[_0x2036('0x2b')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x2036('0x22')](_0x2036('0x23'),'chatinteraction:destroy'),controller[_0x2036('0x2c')]);router[_0x2036('0x2d')](_0x2036('0x21'),auth[_0x2036('0x8')](),controller[_0x2036('0x2e')]);module[_0x2036('0x2f')]=router; \ No newline at end of file +var _0xed71=['getMyMessages','post','create','createVidaooSession','diskStorage','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','/:id/messages','/:id/tags','tracked','chat','chatinteraction:addtags','/:id','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/my_messages'];(function(_0x35fe31,_0x1b5d53){var _0x2f96ab=function(_0x55c172){while(--_0x55c172){_0x35fe31['push'](_0x35fe31['shift']());}};_0x2f96ab(++_0x1b5d53);}(_0xed71,0xed));var _0x1ed7=function(_0x44aac2,_0x336163){_0x44aac2=_0x44aac2-0x0;var _0x38a6bc=_0xed71[_0x44aac2];return _0x38a6bc;};'use strict';var multer=require(_0x1ed7('0x0'));var util=require('util');var path=require(_0x1ed7('0x1'));var timeout=require(_0x1ed7('0x2'));var express=require(_0x1ed7('0x3'));var router=express['Router']();var fs_extra=require(_0x1ed7('0x4'));var auth=require(_0x1ed7('0x5'));var interaction=require(_0x1ed7('0x6'));var config=require(_0x1ed7('0x7'));var controller=require(_0x1ed7('0x8'));router[_0x1ed7('0x9')]('/',auth[_0x1ed7('0xa')](),controller[_0x1ed7('0xb')]);router['get'](_0x1ed7('0xc'),auth[_0x1ed7('0xa')](),controller[_0x1ed7('0xd')]);router['get']('/:id',auth[_0x1ed7('0xe')](),controller[_0x1ed7('0xf')]);router[_0x1ed7('0x9')](_0x1ed7('0x10'),auth[_0x1ed7('0xe')](),controller['attachmentDownload']);router[_0x1ed7('0x9')]('/:id/messages',auth[_0x1ed7('0xa')](),controller['getMessages']);router[_0x1ed7('0x9')](_0x1ed7('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x1ed7('0x12')]);router[_0x1ed7('0x9')]('/:id/download',auth[_0x1ed7('0xa')](),controller['download']);router[_0x1ed7('0x13')]('/',auth[_0x1ed7('0xa')](),controller[_0x1ed7('0x14')]);router['post']('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x1ed7('0x15')]);var upload=multer({'storage':multer[_0x1ed7('0x16')]({'destination':function(_0x86fafe,_0x3599cf,_0xee946a){_0xee946a(null,path['join'](config[_0x1ed7('0x17')],_0x1ed7('0x18')));},'filename':function(_0x3c9b5d,_0x18f697,_0x3b9094){_0x3b9094(null,util[_0x1ed7('0x19')]('%s-%s',Date[_0x1ed7('0x1a')](),_0x18f697[_0x1ed7('0x1b')][_0x1ed7('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1ed7('0x13')](_0x1ed7('0x1d'),upload[_0x1ed7('0x1e')](_0x1ed7('0x1f')),controller['attachmentUpload']);router['post'](_0x1ed7('0x20'),auth[_0x1ed7('0xe')](),controller['addMessage']);router['post'](_0x1ed7('0x21'),auth[_0x1ed7('0xa')](),interaction[_0x1ed7('0x22')](_0x1ed7('0x23'),_0x1ed7('0x24')),controller['addTags']);router['put'](_0x1ed7('0x25'),auth[_0x1ed7('0xa')](),interaction[_0x1ed7('0x22')](_0x1ed7('0x23'),_0x1ed7('0x26')),controller[_0x1ed7('0x27')]);router[_0x1ed7('0x28')](_0x1ed7('0x29'),controller[_0x1ed7('0x2a')]);router['put'](_0x1ed7('0x2b'),auth[_0x1ed7('0xe')](),controller[_0x1ed7('0x2c')]);router[_0x1ed7('0x28')](_0x1ed7('0x2d'),controller['close']);router[_0x1ed7('0x2e')]('/:id',auth[_0x1ed7('0xa')](),interaction[_0x1ed7('0x22')]('chat',_0x1ed7('0x2f')),controller[_0x1ed7('0x30')]);router[_0x1ed7('0x2e')](_0x1ed7('0x21'),auth[_0x1ed7('0xa')](),controller[_0x1ed7('0x31')]);module[_0x1ed7('0x32')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index b5fc314..6580dea 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 _0xc085=['INTEGER','TEXT','BOOLEAN'];(function(_0x2e7188,_0x207fc3){var _0x265f52=function(_0x47a8d1){while(--_0x47a8d1){_0x2e7188['push'](_0x2e7188['shift']());}};_0x265f52(++_0x207fc3);}(_0xc085,0x109));var _0x5c08=function(_0xad0d4e,_0x20e0f6){_0xad0d4e=_0xad0d4e-0x0;var _0x87943c=_0xc085[_0xad0d4e];return _0x87943c;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x5c08('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5c08('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5c08('0x2')]}}; \ No newline at end of file +var _0x8080=['BOOLEAN','INTEGER','sequelize','TEXT','medium'];(function(_0x392cee,_0x462c7c){var _0x5535eb=function(_0x3447bf){while(--_0x3447bf){_0x392cee['push'](_0x392cee['shift']());}};_0x5535eb(++_0x462c7c);}(_0x8080,0x1dd));var _0x0808=function(_0x16a022,_0x2a40e1){_0x16a022=_0x16a022-0x0;var _0x59cf5c=_0x8080[_0x16a022];return _0x59cf5c;};'use strict';var Sequelize=require(_0x0808('0x0'));module['exports']={'body':{'type':Sequelize[_0x0808('0x1')](_0x0808('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0808('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x0808('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 1ad909c..3c52d40 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 _0xf2e2=['VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','body','catch','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','autoAssociation','isEmpty','resourceId','push','ToId','read','-createdAt','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','keys','query','model','attributes','intersection','fields','length','order','sort','filters','filter','where','merge'];(function(_0x532a69,_0x1cd3f3){var _0x5def44=function(_0x581255){while(--_0x581255){_0x532a69['push'](_0x532a69['shift']());}};_0x5def44(++_0x1cd3f3);}(_0xf2e2,0xa0));var _0x2f2e=function(_0x1088ef,_0x6ce3e4){_0x1088ef=_0x1088ef-0x0;var _0x215cdd=_0xf2e2[_0x1088ef];return _0x215cdd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f2e('0x0'));var zipdir=require(_0x2f2e('0x1'));var jsonpatch=require(_0x2f2e('0x2'));var rp=require(_0x2f2e('0x3'));var moment=require(_0x2f2e('0x4'));var BPromise=require(_0x2f2e('0x5'));var Mustache=require(_0x2f2e('0x6'));var util=require('util');var path=require(_0x2f2e('0x7'));var sox=require(_0x2f2e('0x8'));var csv=require(_0x2f2e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f2e('0xa'));var _=require(_0x2f2e('0xb'));var squel=require(_0x2f2e('0xc'));var crypto=require(_0x2f2e('0xd'));var jsforce=require(_0x2f2e('0xe'));var deskjs=require(_0x2f2e('0xf'));var toCsv=require(_0x2f2e('0x9'));var querystring=require(_0x2f2e('0x10'));var Papa=require('papaparse');var Redis=require(_0x2f2e('0x11'));var authService=require(_0x2f2e('0x12'));var qs=require(_0x2f2e('0x13'));var as=require(_0x2f2e('0x14'));var hardwareService=require(_0x2f2e('0x15'));var logger=require(_0x2f2e('0x16'))(_0x2f2e('0x17'));var utils=require(_0x2f2e('0x18'));var config=require(_0x2f2e('0x19'));var licenseUtil=require(_0x2f2e('0x1a'));var db=require(_0x2f2e('0x1b'))['db'];config[_0x2f2e('0x1c')]=_[_0x2f2e('0x1d')](config[_0x2f2e('0x1c')],{'host':_0x2f2e('0x1e'),'port':0x18eb});var socket=require(_0x2f2e('0x1f'))(new Redis(config['redis']));require(_0x2f2e('0x20'))[_0x2f2e('0x21')](socket);function respondWithStatusCode(_0x10e789,_0x1ea1bd){_0x1ea1bd=_0x1ea1bd||0xcc;return function(_0x2e2487){if(_0x2e2487){return _0x10e789['sendStatus'](_0x1ea1bd);}return _0x10e789[_0x2f2e('0x22')](_0x1ea1bd)[_0x2f2e('0x23')]();};}function respondWithResult(_0x4437af,_0x4f613d){_0x4f613d=_0x4f613d||0xc8;return function(_0x23ca3b){if(_0x23ca3b){return _0x4437af['status'](_0x4f613d)['json'](_0x23ca3b);}};}function respondWithFilteredResult(_0x5db71c,_0x1bb9fb){return function(_0x4a8a4a){if(_0x4a8a4a){var _0x4ec9d5=typeof _0x1bb9fb[_0x2f2e('0x24')]===_0x2f2e('0x25')&&typeof _0x1bb9fb[_0x2f2e('0x26')]==='undefined';var _0x2835b1=_0x4a8a4a[_0x2f2e('0x27')];var _0x1f770e=_0x4ec9d5?0x0:_0x1bb9fb[_0x2f2e('0x24')];var _0x1a0150=_0x4ec9d5?_0x4a8a4a[_0x2f2e('0x27')]:_0x1bb9fb[_0x2f2e('0x24')]+_0x1bb9fb[_0x2f2e('0x26')];var _0x26d2d5;if(_0x1a0150>=_0x2835b1){_0x1a0150=_0x2835b1;_0x26d2d5=0xc8;}else{_0x26d2d5=0xce;}_0x5db71c[_0x2f2e('0x22')](_0x26d2d5);return _0x5db71c[_0x2f2e('0x28')](_0x2f2e('0x29'),_0x1f770e+'-'+_0x1a0150+'/'+_0x2835b1)[_0x2f2e('0x2a')](_0x4a8a4a);}return null;};}function patchUpdates(_0x4b24be){return function(_0x4783a8){try{jsonpatch[_0x2f2e('0x2b')](_0x4783a8,_0x4b24be,!![]);}catch(_0x20c61c){return BPromise[_0x2f2e('0x2c')](_0x20c61c);}return _0x4783a8[_0x2f2e('0x2d')]();};}function saveUpdates(_0x2522f1,_0x48c126){return function(_0x4702a8){if(_0x4702a8){return _0x4702a8[_0x2f2e('0x2e')](_0x2522f1)['then'](function(_0x1d6329){return _0x1d6329;});}return null;};}function removeEntity(_0x3fa074,_0x471677){return function(_0x548c77){if(_0x548c77){return _0x548c77[_0x2f2e('0x2f')]()[_0x2f2e('0x30')](function(){_0x3fa074['status'](0xcc)[_0x2f2e('0x23')]();});}};}function handleEntityNotFound(_0x2902b9,_0x36653f){return function(_0x2cc071){if(!_0x2cc071){_0x2902b9[_0x2f2e('0x31')](0x194);}return _0x2cc071;};}function handleError(_0x24271e,_0x4bb9d7){_0x4bb9d7=_0x4bb9d7||0x1f4;return function(_0x35a2ec){logger[_0x2f2e('0x32')](_0x35a2ec[_0x2f2e('0x33')]);if(_0x35a2ec[_0x2f2e('0x34')]){delete _0x35a2ec[_0x2f2e('0x34')];}_0x24271e[_0x2f2e('0x22')](_0x4bb9d7)[_0x2f2e('0x35')](_0x35a2ec);};}exports[_0x2f2e('0x36')]=function(_0x31ea6e,_0x1753ef){var _0x3987a5={},_0xc602b8={},_0x4cc065={'count':0x0,'rows':[]};var _0x52807c=_[_0x2f2e('0x37')](db[_0x2f2e('0x38')][_0x2f2e('0x39')],function(_0x3c6cb1){return{'name':_0x3c6cb1[_0x2f2e('0x3a')],'type':_0x3c6cb1[_0x2f2e('0x3b')][_0x2f2e('0x3c')]};});_0xc602b8['model']=_[_0x2f2e('0x37')](_0x52807c,'name');_0xc602b8['query']=_[_0x2f2e('0x3d')](_0x31ea6e[_0x2f2e('0x3e')]);_0xc602b8['filters']=_['intersection'](_0xc602b8[_0x2f2e('0x3f')],_0xc602b8[_0x2f2e('0x3e')]);_0x3987a5[_0x2f2e('0x40')]=_[_0x2f2e('0x41')](_0xc602b8[_0x2f2e('0x3f')],qs[_0x2f2e('0x42')](_0x31ea6e['query']['fields']));_0x3987a5['attributes']=_0x3987a5['attributes'][_0x2f2e('0x43')]?_0x3987a5[_0x2f2e('0x40')]:_0xc602b8[_0x2f2e('0x3f')];if(!_0x31ea6e[_0x2f2e('0x3e')]['hasOwnProperty']('nolimit')){_0x3987a5[_0x2f2e('0x26')]=qs[_0x2f2e('0x26')](_0x31ea6e[_0x2f2e('0x3e')][_0x2f2e('0x26')]);_0x3987a5[_0x2f2e('0x24')]=qs['offset'](_0x31ea6e[_0x2f2e('0x3e')][_0x2f2e('0x24')]);}_0x3987a5[_0x2f2e('0x44')]=qs[_0x2f2e('0x45')](_0x31ea6e['query'][_0x2f2e('0x45')]);_0x3987a5['where']=qs[_0x2f2e('0x46')](_['pick'](_0x31ea6e['query'],_0xc602b8['filters']),_0x52807c);if(_0x31ea6e['query'][_0x2f2e('0x47')]){_0x3987a5[_0x2f2e('0x48')]=_[_0x2f2e('0x49')](_0x3987a5[_0x2f2e('0x48')],{'$or':_[_0x2f2e('0x37')](_0x52807c,function(_0x1b2c69){if(_0x1b2c69[_0x2f2e('0x3b')]!==_0x2f2e('0x4a')){var _0x22aac5={};_0x22aac5[_0x1b2c69[_0x2f2e('0x34')]]={'$like':'%'+_0x31ea6e[_0x2f2e('0x3e')][_0x2f2e('0x47')]+'%'};return _0x22aac5;}})});}_0x3987a5=_[_0x2f2e('0x49')]({},_0x3987a5,_0x31ea6e[_0x2f2e('0x4b')]);var _0x2a68f2={'where':_0x3987a5[_0x2f2e('0x48')]};return db[_0x2f2e('0x38')]['count'](_0x2a68f2)[_0x2f2e('0x30')](function(_0x13f6d8){_0x4cc065[_0x2f2e('0x27')]=_0x13f6d8;if(_0x31ea6e[_0x2f2e('0x3e')][_0x2f2e('0x4c')]){_0x3987a5['include']=[{'all':!![]}];}return db[_0x2f2e('0x38')][_0x2f2e('0x4d')](_0x3987a5);})[_0x2f2e('0x30')](function(_0x11225f){_0x4cc065[_0x2f2e('0x4e')]=_0x11225f;return _0x4cc065;})[_0x2f2e('0x30')](respondWithFilteredResult(_0x1753ef,_0x3987a5))['catch'](handleError(_0x1753ef,null));};exports[_0x2f2e('0x4f')]=function(_0x3ffd88,_0x92a531){var _0x36b388={'raw':!![],'where':{'id':_0x3ffd88[_0x2f2e('0x50')]['id']}},_0x521d3f={};_0x521d3f[_0x2f2e('0x3f')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x521d3f[_0x2f2e('0x3e')]=_[_0x2f2e('0x3d')](_0x3ffd88[_0x2f2e('0x3e')]);_0x521d3f[_0x2f2e('0x46')]=_[_0x2f2e('0x41')](_0x521d3f[_0x2f2e('0x3f')],_0x521d3f[_0x2f2e('0x3e')]);_0x36b388[_0x2f2e('0x40')]=_[_0x2f2e('0x41')](_0x521d3f[_0x2f2e('0x3f')],qs[_0x2f2e('0x42')](_0x3ffd88[_0x2f2e('0x3e')][_0x2f2e('0x42')]));_0x36b388[_0x2f2e('0x40')]=_0x36b388[_0x2f2e('0x40')]['length']?_0x36b388[_0x2f2e('0x40')]:_0x521d3f['model'];if(_0x3ffd88[_0x2f2e('0x3e')]['includeAll']){_0x36b388[_0x2f2e('0x51')]=[{'all':!![]}];}_0x36b388=_['merge']({},_0x36b388,_0x3ffd88[_0x2f2e('0x4b')]);return db['ChatInternalMessage'][_0x2f2e('0x52')](_0x36b388)[_0x2f2e('0x30')](handleEntityNotFound(_0x92a531,null))[_0x2f2e('0x30')](respondWithResult(_0x92a531,null))['catch'](handleError(_0x92a531,null));};exports['create']=function(_0x4e1bea,_0x499e2e){return db[_0x2f2e('0x38')][_0x2f2e('0x53')](_0x4e1bea[_0x2f2e('0x54')],{})[_0x2f2e('0x30')](respondWithResult(_0x499e2e,0xc9))[_0x2f2e('0x55')](handleError(_0x499e2e,null));};exports[_0x2f2e('0x2e')]=function(_0xdc737a,_0x59fe8c){if(_0xdc737a[_0x2f2e('0x54')]['id']){delete _0xdc737a[_0x2f2e('0x54')]['id'];}return db[_0x2f2e('0x38')][_0x2f2e('0x52')]({'where':{'id':_0xdc737a[_0x2f2e('0x50')]['id']}})[_0x2f2e('0x30')](handleEntityNotFound(_0x59fe8c,null))[_0x2f2e('0x30')](saveUpdates(_0xdc737a['body'],null))['then'](respondWithResult(_0x59fe8c,null))[_0x2f2e('0x55')](handleError(_0x59fe8c,null));};exports[_0x2f2e('0x2f')]=function(_0x4c2a79,_0x26c61d){return db['ChatInternalMessage'][_0x2f2e('0x52')]({'where':{'id':_0x4c2a79[_0x2f2e('0x50')]['id']}})[_0x2f2e('0x30')](handleEntityNotFound(_0x26c61d,null))[_0x2f2e('0x30')](removeEntity(_0x26c61d,null))[_0x2f2e('0x55')](handleError(_0x26c61d,null));};exports[_0x2f2e('0x56')]=function(_0x1dbe4f,_0x461c3e){return db['ChatInternalMessage']['describe']()[_0x2f2e('0x30')](respondWithResult(_0x461c3e,null))[_0x2f2e('0x55')](handleError(_0x461c3e,null));};function wrapUser(_0x25a61e){return function(_0x5b628c){var _0x35482e=_0x25a61e[_0x2f2e('0x57')]({'plain':!![]});_0x35482e[_0x2f2e('0x58')]=[];if(_0x5b628c){_0x35482e[_0x2f2e('0x59')]=_0x5b628c[_0x2f2e('0x5a')];_0x35482e['lastMessage']=_0x5b628c;}else{_0x35482e['lastMessageAt']=moment(0x0)[_0x2f2e('0x5b')](_0x2f2e('0x5c'));_0x35482e[_0x2f2e('0x5d')]={};}return _0x35482e;};}exports[_0x2f2e('0x5e')]=function(_0xa8b70,_0x1d59d6,_0x4edf4d){var _0x2b363c=[];return db['User'][_0x2f2e('0x4d')]({'where':{'role':[_0x2f2e('0x5f'),_0x2f2e('0x60'),_0x2f2e('0x61')]},'attributes':['id',_0x2f2e('0x62'),_0x2f2e('0x34'),_0x2f2e('0x63'),_0x2f2e('0x64'),_0x2f2e('0x65'),_0x2f2e('0x66'),_0x2f2e('0x67'),_0x2f2e('0x68'),'showWebBar'],'order':qs[_0x2f2e('0x45')](_0x2f2e('0x69')),'include':[{'model':db[_0x2f2e('0x6a')],'as':_0x2f2e('0x6b'),'attributes':['id',_0x2f2e('0x34'),_0x2f2e('0x3b')],'through':{'attributes':[]}}]})[_0x2f2e('0x30')](function(_0x6c68e1){if(_0x6c68e1){var _0x240387=_0xa8b70[_0x2f2e('0x61')]['get']({'plain':!![]});if(!_0x240387)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x240387[_0x2f2e('0x63')]===_0x2f2e('0x61')){return db[_0x2f2e('0x6c')][_0x2f2e('0x52')]({'where':{'name':_0x2f2e('0x6d'),'userProfileId':_0x240387['userProfileId']},'raw':!![]})[_0x2f2e('0x30')](function(_0xb20c39){if(_0xb20c39){if(_0xb20c39[_0x2f2e('0x6e')]===0x0){return db['UserProfileResource'][_0x2f2e('0x4d')]({'where':{'sectionId':_0xb20c39['id']},'raw':!![]})[_0x2f2e('0x30')](function(_0xb75a22){var _0x48bcb4=[];if(_[_0x2f2e('0x6f')](_0xb75a22)){_0x48bcb4=_['filter'](_0x6c68e1,function(_0x1c6d84){if(_0x1c6d84[_0x2f2e('0x63')]!=='agent'){return _0x1c6d84;}});return _0x48bcb4;}else{for(var _0x54b6ae=0x0;_0x54b6ae<_0x6c68e1[_0x2f2e('0x43')];_0x54b6ae++){var _0x2874ba=_0x6c68e1[_0x54b6ae];if(_0x2874ba[_0x2f2e('0x63')]==='agent'){var _0x5af102=_[_0x2f2e('0x52')](_0xb75a22,function(_0x43f477){return _0x43f477[_0x2f2e('0x70')]===_0x2874ba['id'];});if(_0x5af102)_0x48bcb4[_0x2f2e('0x71')](_0x2874ba);}else{_0x48bcb4[_0x2f2e('0x71')](_0x2874ba);}}return _0x48bcb4;}});}else{return _0x6c68e1;}}else{var _0x4fcf5e=_[_0x2f2e('0x47')](_0x6c68e1,function(_0x281b5a){if(_0x281b5a['role']!=='agent'){return _0x281b5a;}});return _0x4fcf5e;}});}else{return _0x6c68e1;}}})[_0x2f2e('0x30')](function(_0x1bfd2b){var _0x50d3f7=[];if(_0x1bfd2b){_0x2b363c=_0x1bfd2b;for(var _0x127e39=0x0;_0x127e39<_0x1bfd2b[_0x2f2e('0x43')];_0x127e39+=0x1){_0x2b363c[_0x127e39][_0x2f2e('0x58')]=[];_0x50d3f7[_0x2f2e('0x71')](db[_0x2f2e('0x38')][_0x2f2e('0x52')]({'where':{'FromId':[_0xa8b70[_0x2f2e('0x61')]['id'],_0x1bfd2b[_0x127e39]['id']],'ToId':[_0xa8b70['user']['id'],_0x1bfd2b[_0x127e39]['id']],'ChatGroupId':null},'attributes':['id',_0x2f2e('0x5a'),'FromId',_0x2f2e('0x72'),_0x2f2e('0x73'),'body'],'order':qs[_0x2f2e('0x45')](_0x2f2e('0x74')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2f2e('0x30')](wrapUser(_0x1bfd2b[_0x127e39])));}return BPromise['all'](_0x50d3f7);}return[];})['then'](function(_0x2e5b27){return{'rows':_0x2e5b27,'count':_0x2e5b27[_0x2f2e('0x43')]};})[_0x2f2e('0x30')](respondWithResult(_0x1d59d6,null))[_0x2f2e('0x55')](handleError(_0x1d59d6,null));}; \ No newline at end of file +var _0x824b=['find','catch','create','body','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','push','FromId','ToId','read','-createdAt','all','zip-dir','request-promise','moment','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','offset','undefined','count','limit','status','Content-Range','json','apply','reject','update','then','destroy','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','ChatInternalMessage','includeAll','include','findAll','rows','show'];(function(_0x93558e,_0x517903){var _0x5c18aa=function(_0x45305f){while(--_0x45305f){_0x93558e['push'](_0x93558e['shift']());}};_0x5c18aa(++_0x517903);}(_0x824b,0x178));var _0xb824=function(_0x48c210,_0x43165e){_0x48c210=_0x48c210-0x0;var _0x275f93=_0x824b[_0x48c210];return _0x275f93;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb824('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb824('0x1'));var moment=require(_0xb824('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb824('0x3'));var sox=require(_0xb824('0x4'));var csv=require(_0xb824('0x5'));var ejs=require(_0xb824('0x6'));var fs=require('fs');var fs_extra=require(_0xb824('0x7'));var _=require(_0xb824('0x8'));var squel=require(_0xb824('0x9'));var crypto=require(_0xb824('0xa'));var jsforce=require(_0xb824('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb824('0xc'));var Papa=require(_0xb824('0xd'));var Redis=require('ioredis');var authService=require(_0xb824('0xe'));var qs=require(_0xb824('0xf'));var as=require(_0xb824('0x10'));var hardwareService=require(_0xb824('0x11'));var logger=require(_0xb824('0x12'))(_0xb824('0x13'));var utils=require(_0xb824('0x14'));var config=require(_0xb824('0x15'));var licenseUtil=require(_0xb824('0x16'));var db=require(_0xb824('0x17'))['db'];config[_0xb824('0x18')]=_[_0xb824('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb824('0x1a'))(new Redis(config['redis']));require(_0xb824('0x1b'))[_0xb824('0x1c')](socket);function respondWithStatusCode(_0x3e2146,_0x56aa00){_0x56aa00=_0x56aa00||0xcc;return function(_0x6666e4){if(_0x6666e4){return _0x3e2146[_0xb824('0x1d')](_0x56aa00);}return _0x3e2146['status'](_0x56aa00)[_0xb824('0x1e')]();};}function respondWithResult(_0x317417,_0x1a4b1c){_0x1a4b1c=_0x1a4b1c||0xc8;return function(_0x5c4712){if(_0x5c4712){return _0x317417['status'](_0x1a4b1c)['json'](_0x5c4712);}};}function respondWithFilteredResult(_0x14845c,_0x3a16c2){return function(_0x2f5c07){if(_0x2f5c07){var _0x55b527=typeof _0x3a16c2[_0xb824('0x1f')]==='undefined'&&typeof _0x3a16c2['limit']===_0xb824('0x20');var _0x48102e=_0x2f5c07['count'];var _0x20c6bf=_0x55b527?0x0:_0x3a16c2[_0xb824('0x1f')];var _0xa1112=_0x55b527?_0x2f5c07[_0xb824('0x21')]:_0x3a16c2[_0xb824('0x1f')]+_0x3a16c2[_0xb824('0x22')];var _0x32084f;if(_0xa1112>=_0x48102e){_0xa1112=_0x48102e;_0x32084f=0xc8;}else{_0x32084f=0xce;}_0x14845c[_0xb824('0x23')](_0x32084f);return _0x14845c['set'](_0xb824('0x24'),_0x20c6bf+'-'+_0xa1112+'/'+_0x48102e)[_0xb824('0x25')](_0x2f5c07);}return null;};}function patchUpdates(_0x24792d){return function(_0x5f3012){try{jsonpatch[_0xb824('0x26')](_0x5f3012,_0x24792d,!![]);}catch(_0xc69a29){return BPromise[_0xb824('0x27')](_0xc69a29);}return _0x5f3012['save']();};}function saveUpdates(_0xcfc9d9,_0x565cee){return function(_0x53e677){if(_0x53e677){return _0x53e677[_0xb824('0x28')](_0xcfc9d9)[_0xb824('0x29')](function(_0x59a32c){return _0x59a32c;});}return null;};}function removeEntity(_0x37bc23,_0x26e473){return function(_0x23ffdd){if(_0x23ffdd){return _0x23ffdd[_0xb824('0x2a')]()[_0xb824('0x29')](function(){_0x37bc23[_0xb824('0x23')](0xcc)[_0xb824('0x1e')]();});}};}function handleEntityNotFound(_0x5d1aa4,_0x5b0569){return function(_0x28bf03){if(!_0x28bf03){_0x5d1aa4[_0xb824('0x1d')](0x194);}return _0x28bf03;};}function handleError(_0xee0b54,_0x170bea){_0x170bea=_0x170bea||0x1f4;return function(_0x51fdec){logger['error'](_0x51fdec['stack']);if(_0x51fdec[_0xb824('0x2b')]){delete _0x51fdec[_0xb824('0x2b')];}_0xee0b54[_0xb824('0x23')](_0x170bea)[_0xb824('0x2c')](_0x51fdec);};}exports[_0xb824('0x2d')]=function(_0x21d341,_0x5d519e){var _0x253865={},_0x5690de={},_0x3757f7={'count':0x0,'rows':[]};var _0x2d8bc3=_[_0xb824('0x2e')](db['ChatInternalMessage'][_0xb824('0x2f')],function(_0x531cab){return{'name':_0x531cab[_0xb824('0x30')],'type':_0x531cab['type'][_0xb824('0x31')]};});_0x5690de[_0xb824('0x32')]=_[_0xb824('0x2e')](_0x2d8bc3,'name');_0x5690de[_0xb824('0x33')]=_[_0xb824('0x34')](_0x21d341[_0xb824('0x33')]);_0x5690de[_0xb824('0x35')]=_[_0xb824('0x36')](_0x5690de['model'],_0x5690de[_0xb824('0x33')]);_0x253865[_0xb824('0x37')]=_[_0xb824('0x36')](_0x5690de[_0xb824('0x32')],qs[_0xb824('0x38')](_0x21d341['query'][_0xb824('0x38')]));_0x253865[_0xb824('0x37')]=_0x253865[_0xb824('0x37')][_0xb824('0x39')]?_0x253865[_0xb824('0x37')]:_0x5690de['model'];if(!_0x21d341[_0xb824('0x33')]['hasOwnProperty'](_0xb824('0x3a'))){_0x253865[_0xb824('0x22')]=qs['limit'](_0x21d341['query']['limit']);_0x253865[_0xb824('0x1f')]=qs[_0xb824('0x1f')](_0x21d341[_0xb824('0x33')][_0xb824('0x1f')]);}_0x253865[_0xb824('0x3b')]=qs['sort'](_0x21d341[_0xb824('0x33')][_0xb824('0x3c')]);_0x253865[_0xb824('0x3d')]=qs['filters'](_[_0xb824('0x3e')](_0x21d341[_0xb824('0x33')],_0x5690de[_0xb824('0x35')]),_0x2d8bc3);if(_0x21d341[_0xb824('0x33')]['filter']){_0x253865[_0xb824('0x3d')]=_[_0xb824('0x3f')](_0x253865['where'],{'$or':_[_0xb824('0x2e')](_0x2d8bc3,function(_0x5d42c5){if(_0x5d42c5['type']!=='VIRTUAL'){var _0x496f71={};_0x496f71[_0x5d42c5['name']]={'$like':'%'+_0x21d341[_0xb824('0x33')][_0xb824('0x40')]+'%'};return _0x496f71;}})});}_0x253865=_[_0xb824('0x3f')]({},_0x253865,_0x21d341[_0xb824('0x41')]);var _0x30c49b={'where':_0x253865[_0xb824('0x3d')]};return db[_0xb824('0x42')]['count'](_0x30c49b)[_0xb824('0x29')](function(_0x81a019){_0x3757f7[_0xb824('0x21')]=_0x81a019;if(_0x21d341[_0xb824('0x33')][_0xb824('0x43')]){_0x253865[_0xb824('0x44')]=[{'all':!![]}];}return db[_0xb824('0x42')][_0xb824('0x45')](_0x253865);})[_0xb824('0x29')](function(_0x2626ee){_0x3757f7[_0xb824('0x46')]=_0x2626ee;return _0x3757f7;})['then'](respondWithFilteredResult(_0x5d519e,_0x253865))['catch'](handleError(_0x5d519e,null));};exports[_0xb824('0x47')]=function(_0x3ef443,_0x25eab7){var _0x29a8ed={'raw':!![],'where':{'id':_0x3ef443['params']['id']}},_0x575804={};_0x575804[_0xb824('0x32')]=_[_0xb824('0x34')](db['ChatInternalMessage']['rawAttributes']);_0x575804[_0xb824('0x33')]=_['keys'](_0x3ef443[_0xb824('0x33')]);_0x575804[_0xb824('0x35')]=_[_0xb824('0x36')](_0x575804[_0xb824('0x32')],_0x575804['query']);_0x29a8ed[_0xb824('0x37')]=_[_0xb824('0x36')](_0x575804['model'],qs[_0xb824('0x38')](_0x3ef443[_0xb824('0x33')][_0xb824('0x38')]));_0x29a8ed['attributes']=_0x29a8ed[_0xb824('0x37')][_0xb824('0x39')]?_0x29a8ed[_0xb824('0x37')]:_0x575804['model'];if(_0x3ef443[_0xb824('0x33')][_0xb824('0x43')]){_0x29a8ed[_0xb824('0x44')]=[{'all':!![]}];}_0x29a8ed=_[_0xb824('0x3f')]({},_0x29a8ed,_0x3ef443[_0xb824('0x41')]);return db['ChatInternalMessage'][_0xb824('0x48')](_0x29a8ed)['then'](handleEntityNotFound(_0x25eab7,null))[_0xb824('0x29')](respondWithResult(_0x25eab7,null))[_0xb824('0x49')](handleError(_0x25eab7,null));};exports['create']=function(_0x26db7e,_0x492c9b){return db[_0xb824('0x42')][_0xb824('0x4a')](_0x26db7e[_0xb824('0x4b')],{})[_0xb824('0x29')](respondWithResult(_0x492c9b,0xc9))[_0xb824('0x49')](handleError(_0x492c9b,null));};exports[_0xb824('0x28')]=function(_0x15addd,_0x13af84){if(_0x15addd[_0xb824('0x4b')]['id']){delete _0x15addd[_0xb824('0x4b')]['id'];}return db[_0xb824('0x42')]['find']({'where':{'id':_0x15addd[_0xb824('0x4c')]['id']}})[_0xb824('0x29')](handleEntityNotFound(_0x13af84,null))[_0xb824('0x29')](saveUpdates(_0x15addd[_0xb824('0x4b')],null))[_0xb824('0x29')](respondWithResult(_0x13af84,null))['catch'](handleError(_0x13af84,null));};exports['destroy']=function(_0x422b42,_0xac86bb){return db[_0xb824('0x42')][_0xb824('0x48')]({'where':{'id':_0x422b42[_0xb824('0x4c')]['id']}})['then'](handleEntityNotFound(_0xac86bb,null))[_0xb824('0x29')](removeEntity(_0xac86bb,null))[_0xb824('0x49')](handleError(_0xac86bb,null));};exports[_0xb824('0x4d')]=function(_0x4affca,_0x432c2e){return db[_0xb824('0x42')]['describe']()[_0xb824('0x29')](respondWithResult(_0x432c2e,null))[_0xb824('0x49')](handleError(_0x432c2e,null));};function wrapUser(_0x577cd9){return function(_0x834153){var _0x552dc3=_0x577cd9[_0xb824('0x4e')]({'plain':!![]});_0x552dc3[_0xb824('0x4f')]=[];if(_0x834153){_0x552dc3[_0xb824('0x50')]=_0x834153[_0xb824('0x51')];_0x552dc3[_0xb824('0x52')]=_0x834153;}else{_0x552dc3[_0xb824('0x50')]=moment(0x0)[_0xb824('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x552dc3[_0xb824('0x52')]={};}return _0x552dc3;};}exports[_0xb824('0x54')]=function(_0x46595c,_0x7d4721,_0x4dba6e){var _0x45c750=[];return db[_0xb824('0x55')][_0xb824('0x45')]({'where':{'role':[_0xb824('0x56'),_0xb824('0x57'),_0xb824('0x58')]},'attributes':['id',_0xb824('0x59'),_0xb824('0x2b'),_0xb824('0x5a'),_0xb824('0x5b'),_0xb824('0x5c'),_0xb824('0x5d'),_0xb824('0x5e'),_0xb824('0x5f'),_0xb824('0x60')],'order':qs[_0xb824('0x3c')](_0xb824('0x61')),'include':[{'model':db[_0xb824('0x62')],'as':_0xb824('0x63'),'attributes':['id',_0xb824('0x2b'),'type'],'through':{'attributes':[]}}]})[_0xb824('0x29')](function(_0x33b43c){if(_0x33b43c){var _0xbc610d=_0x46595c['user'][_0xb824('0x4e')]({'plain':!![]});if(!_0xbc610d)throw new Error(_0xb824('0x64'));if(_0xbc610d[_0xb824('0x5a')]===_0xb824('0x58')){return db[_0xb824('0x65')]['find']({'where':{'name':_0xb824('0x66'),'userProfileId':_0xbc610d[_0xb824('0x67')]},'raw':!![]})[_0xb824('0x29')](function(_0x19a304){if(_0x19a304){if(_0x19a304[_0xb824('0x68')]===0x0){return db[_0xb824('0x69')][_0xb824('0x45')]({'where':{'sectionId':_0x19a304['id']},'raw':!![]})[_0xb824('0x29')](function(_0x3d582c){var _0x18cabd=[];if(_['isEmpty'](_0x3d582c)){_0x18cabd=_['filter'](_0x33b43c,function(_0x25556e){if(_0x25556e[_0xb824('0x5a')]!=='agent'){return _0x25556e;}});return _0x18cabd;}else{for(var _0x12fcd8=0x0;_0x12fcd8<_0x33b43c[_0xb824('0x39')];_0x12fcd8++){var _0x50cb75=_0x33b43c[_0x12fcd8];if(_0x50cb75[_0xb824('0x5a')]===_0xb824('0x56')){var _0x41660d=_[_0xb824('0x48')](_0x3d582c,function(_0x3268a7){return _0x3268a7['resourceId']===_0x50cb75['id'];});if(_0x41660d)_0x18cabd[_0xb824('0x6a')](_0x50cb75);}else{_0x18cabd[_0xb824('0x6a')](_0x50cb75);}}return _0x18cabd;}});}else{return _0x33b43c;}}else{var _0x27e8fa=_[_0xb824('0x40')](_0x33b43c,function(_0x468de9){if(_0x468de9[_0xb824('0x5a')]!==_0xb824('0x56')){return _0x468de9;}});return _0x27e8fa;}});}else{return _0x33b43c;}}})['then'](function(_0x2bccbe){var _0x123608=[];if(_0x2bccbe){_0x45c750=_0x2bccbe;for(var _0x37c51f=0x0;_0x37c51f<_0x2bccbe[_0xb824('0x39')];_0x37c51f+=0x1){_0x45c750[_0x37c51f][_0xb824('0x4f')]=[];_0x123608['push'](db[_0xb824('0x42')][_0xb824('0x48')]({'where':{'FromId':[_0x46595c[_0xb824('0x58')]['id'],_0x2bccbe[_0x37c51f]['id']],'ToId':[_0x46595c[_0xb824('0x58')]['id'],_0x2bccbe[_0x37c51f]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xb824('0x6b'),_0xb824('0x6c'),_0xb824('0x6d'),_0xb824('0x4b')],'order':qs[_0xb824('0x3c')](_0xb824('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x2bccbe[_0x37c51f])));}return BPromise[_0xb824('0x6f')](_0x123608);}return[];})[_0xb824('0x29')](function(_0x1a5565){return{'rows':_0x1a5565,'count':_0x1a5565[_0xb824('0x39')]};})[_0xb824('0x29')](respondWithResult(_0x7d4721,null))[_0xb824('0x49')](handleError(_0x7d4721,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index dec4e7c..3fe8408 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 _0x8fa1=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3e0816,_0x30bb29){var _0x2c48cf=function(_0x3940b1){while(--_0x3940b1){_0x3e0816['push'](_0x3e0816['shift']());}};_0x2c48cf(++_0x30bb29);}(_0x8fa1,0x15e));var _0x18fa=function(_0x49a548,_0x59bce0){_0x49a548=_0x49a548-0x0;var _0x385bfb=_0x8fa1[_0x49a548];return _0x385bfb;};'use strict';var EventEmitter=require(_0x18fa('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x18fa('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x18fa('0x2')](0x0);var events={'afterCreate':_0x18fa('0x3'),'afterUpdate':_0x18fa('0x4'),'afterDestroy':_0x18fa('0x5')};function emitEvent(_0x33e7be){return function(_0x279050,_0x23dd93,_0x487b7e){ChatInternalMessageEvents['emit'](_0x33e7be+':'+_0x279050['id'],_0x279050);ChatInternalMessageEvents[_0x18fa('0x6')](_0x33e7be,_0x279050);_0x487b7e(null);};}for(var e in events){if(events[_0x18fa('0x7')](e)){var event=events[e];ChatInternalMessage[_0x18fa('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x98f1=['emit','hasOwnProperty','hook','exports','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x2701d6,_0x3bff77){var _0x2de14b=function(_0x3b1677){while(--_0x3b1677){_0x2701d6['push'](_0x2701d6['shift']());}};_0x2de14b(++_0x3bff77);}(_0x98f1,0x1cf));var _0x198f=function(_0xbcac26,_0x1f0df5){_0xbcac26=_0xbcac26-0x0;var _0xc45acb=_0x98f1[_0xbcac26];return _0xc45acb;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x198f('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x198f('0x1')](0x0);var events={'afterCreate':_0x198f('0x2'),'afterUpdate':_0x198f('0x3'),'afterDestroy':_0x198f('0x4')};function emitEvent(_0x9dcc6b){return function(_0x549617,_0x12c7dd,_0x3ad802){ChatInternalMessageEvents[_0x198f('0x5')](_0x9dcc6b+':'+_0x549617['id'],_0x549617);ChatInternalMessageEvents['emit'](_0x9dcc6b,_0x549617);_0x3ad802(null);};}for(var e in events){if(events[_0x198f('0x6')](e)){var event=events[e];ChatInternalMessage[_0x198f('0x7')](e,emitEvent(event));}}module[_0x198f('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index bf3c88e..25c5203 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 _0xc093=['define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x279f32,_0x423fd3){var _0x3325a2=function(_0x551c02){while(--_0x551c02){_0x279f32['push'](_0x279f32['shift']());}};_0x3325a2(++_0x423fd3);}(_0xc093,0x6c));var _0x3c09=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0xc093[_0x5756c6];return _0x4b5806;};'use strict';var _=require('lodash');var util=require(_0x3c09('0x0'));var logger=require(_0x3c09('0x1'))(_0x3c09('0x2'));var moment=require(_0x3c09('0x3'));var BPromise=require(_0x3c09('0x4'));var rp=require(_0x3c09('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3c09('0x6'));var attributes=require(_0x3c09('0x7'));module[_0x3c09('0x8')]=function(_0x1accb2,_0x333525){return _0x1accb2[_0x3c09('0x9')](_0x3c09('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3c09('0xb'),'collate':_0x3c09('0xc')});}; \ No newline at end of file +var _0x6941=['utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x3cb93a,_0x5048cf){var _0x49b7b7=function(_0x2bb13d){while(--_0x2bb13d){_0x3cb93a['push'](_0x3cb93a['shift']());}};_0x49b7b7(++_0x5048cf);}(_0x6941,0xaa));var _0x1694=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x6941[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x1694('0x0'));var util=require('util');var logger=require(_0x1694('0x1'))(_0x1694('0x2'));var moment=require(_0x1694('0x3'));var BPromise=require(_0x1694('0x4'));var rp=require(_0x1694('0x5'));var fs=require('fs');var path=require(_0x1694('0x6'));var rimraf=require(_0x1694('0x7'));var config=require('../../config/environment');var attributes=require(_0x1694('0x8'));module[_0x1694('0x9')]=function(_0x5273e6,_0x447d63){return _0x5273e6[_0x1694('0xa')](_0x1694('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1694('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index b399fb9..c295649 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 _0x400b=['rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x320cf5,_0x4e437d){var _0xa77006=function(_0x854b9c){while(--_0x854b9c){_0x320cf5['push'](_0x320cf5['shift']());}};_0xa77006(++_0x4e437d);}(_0x400b,0x1e5));var _0xb400=function(_0x3098a7,_0x490909){_0x3098a7=_0x3098a7-0x0;var _0x530a7b=_0x400b[_0x3098a7];return _0x530a7b;};'use strict';var _=require(_0xb400('0x0'));var util=require(_0xb400('0x1'));var moment=require(_0xb400('0x2'));var BPromise=require(_0xb400('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb400('0x4'));var db=require(_0xb400('0x5'))['db'];var utils=require(_0xb400('0x6'));var logger=require(_0xb400('0x7'))(_0xb400('0x8'));var config=require(_0xb400('0x9'));var jayson=require(_0xb400('0xa'));var client=jayson['client'][_0xb400('0xb')]({'port':0x232a});config['redis']=_[_0xb400('0xc')](config[_0xb400('0xd')],{'host':_0xb400('0xe'),'port':0x18eb});var socket=require(_0xb400('0xf'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xb400('0x10')](socket);function respondWithRpcPromise(_0x1299ef,_0x2811ab,_0x4c7373){return new BPromise(function(_0x438f8c,_0xe35775){return client[_0xb400('0x11')](_0x1299ef,_0x4c7373)[_0xb400('0x12')](function(_0xa63c5){logger[_0xb400('0x13')](_0xb400('0x14'),_0x2811ab,'request\x20sent');logger[_0xb400('0x15')](_0xb400('0x16'),_0x2811ab,_0xb400('0x17'),JSON[_0xb400('0x18')](_0xa63c5));if(_0xa63c5['error']){if(_0xa63c5[_0xb400('0x19')]['code']===0x1f4){logger[_0xb400('0x19')](_0xb400('0x14'),_0x2811ab,_0xa63c5[_0xb400('0x19')][_0xb400('0x1a')]);return _0xe35775(_0xa63c5[_0xb400('0x19')]['message']);}logger[_0xb400('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x2811ab,_0xa63c5[_0xb400('0x19')][_0xb400('0x1a')]);return _0x438f8c(_0xa63c5[_0xb400('0x19')][_0xb400('0x1a')]);}else{logger[_0xb400('0x13')](_0xb400('0x14'),_0x2811ab,_0xb400('0x17'));_0x438f8c(_0xa63c5[_0xb400('0x1b')][_0xb400('0x1a')]);}})[_0xb400('0x1c')](function(_0x4251d7){logger[_0xb400('0x19')](_0xb400('0x14'),_0x2811ab,_0x4251d7);_0xe35775(_0x4251d7);});});} \ No newline at end of file +var _0xbff9=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x31242e,_0x40adb9){var _0x610bea=function(_0x1050cc){while(--_0x1050cc){_0x31242e['push'](_0x31242e['shift']());}};_0x610bea(++_0x40adb9);}(_0xbff9,0x197));var _0x9bff=function(_0x183842,_0x57e3fa){_0x183842=_0x183842-0x0;var _0x4fc041=_0xbff9[_0x183842];return _0x4fc041;};'use strict';var _=require(_0x9bff('0x0'));var util=require(_0x9bff('0x1'));var moment=require(_0x9bff('0x2'));var BPromise=require(_0x9bff('0x3'));var rs=require(_0x9bff('0x4'));var fs=require('fs');var Redis=require(_0x9bff('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9bff('0x6'));var logger=require('../../config/logger')(_0x9bff('0x7'));var config=require(_0x9bff('0x8'));var jayson=require(_0x9bff('0x9'));var client=jayson[_0x9bff('0xa')]['http']({'port':0x232a});config[_0x9bff('0xb')]=_[_0x9bff('0xc')](config[_0x9bff('0xb')],{'host':_0x9bff('0xd'),'port':0x18eb});var socket=require(_0x9bff('0xe'))(new Redis(config[_0x9bff('0xb')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x29c44c,_0xb5ea3e,_0x549bea){return new BPromise(function(_0x43870b,_0x2b56b7){return client[_0x9bff('0xf')](_0x29c44c,_0x549bea)[_0x9bff('0x10')](function(_0x3bb292){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0xb5ea3e,_0x9bff('0x11'));logger['debug'](_0x9bff('0x12'),_0xb5ea3e,_0x9bff('0x11'),JSON[_0x9bff('0x13')](_0x3bb292));if(_0x3bb292[_0x9bff('0x14')]){if(_0x3bb292[_0x9bff('0x14')][_0x9bff('0x15')]===0x1f4){logger[_0x9bff('0x14')](_0x9bff('0x16'),_0xb5ea3e,_0x3bb292[_0x9bff('0x14')][_0x9bff('0x17')]);return _0x2b56b7(_0x3bb292['error'][_0x9bff('0x17')]);}logger[_0x9bff('0x14')](_0x9bff('0x16'),_0xb5ea3e,_0x3bb292[_0x9bff('0x14')][_0x9bff('0x17')]);return _0x43870b(_0x3bb292[_0x9bff('0x14')]['message']);}else{logger[_0x9bff('0x18')](_0x9bff('0x16'),_0xb5ea3e,_0x9bff('0x11'));_0x43870b(_0x3bb292[_0x9bff('0x19')][_0x9bff('0x17')]);}})['catch'](function(_0x25fc83){logger[_0x9bff('0x14')](_0x9bff('0x16'),_0xb5ea3e,_0x25fc83);_0x2b56b7(_0x25fc83);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 0b6e397..37cc66c 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 _0x1fad=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fad,0x154));var _0xd1fa=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1fad[_0x4b369d];return _0x571a98;};'use strict';var ChatInternalMessageEvents=require(_0xd1fa('0x0'));var events=[_0xd1fa('0x1'),_0xd1fa('0x2'),_0xd1fa('0x3')];function createListener(_0xee3f03,_0x10186d){return function(_0x924a01){_0x10186d['emit'](_0xee3f03,_0x924a01);};}function removeListener(_0x1bfdf1,_0x5e9752){return function(){ChatInternalMessageEvents[_0xd1fa('0x4')](_0x1bfdf1,_0x5e9752);};}exports[_0xd1fa('0x5')]=function(_0x1ad55b){for(var _0xb8338f=0x0,_0x2f4b60=events[_0xd1fa('0x6')];_0xb8338f<_0x2f4b60;_0xb8338f++){var _0x1d8e49=events[_0xb8338f];var _0x1f5039=createListener(_0xd1fa('0x7')+_0x1d8e49,_0x1ad55b);ChatInternalMessageEvents['on'](_0x1d8e49,_0x1f5039);}}; \ No newline at end of file +var _0x6567=['removeListener','register','length','save','remove'];(function(_0x49bef2,_0x5aedf4){var _0x5d763b=function(_0x4502fb){while(--_0x4502fb){_0x49bef2['push'](_0x49bef2['shift']());}};_0x5d763b(++_0x5aedf4);}(_0x6567,0x157));var _0x7656=function(_0x54d768,_0x482b44){_0x54d768=_0x54d768-0x0;var _0x354842=_0x6567[_0x54d768];return _0x354842;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x7656('0x0'),_0x7656('0x1'),'update'];function createListener(_0x39c070,_0x51229d){return function(_0x263c58){_0x51229d['emit'](_0x39c070,_0x263c58);};}function removeListener(_0x122c53,_0x5c64d5){return function(){ChatInternalMessageEvents[_0x7656('0x2')](_0x122c53,_0x5c64d5);};}exports[_0x7656('0x3')]=function(_0x2f5a1b){for(var _0x134fd3=0x0,_0x1d931b=events[_0x7656('0x4')];_0x134fd3<_0x1d931b;_0x134fd3++){var _0x9514ae=events[_0x134fd3];var _0x456993=createListener('chatInternalMessage:'+_0x9514ae,_0x2f5a1b);ChatInternalMessageEvents['on'](_0x9514ae,_0x456993);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 955e504..f8bd986 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 _0x6839=['index','/describe','getUsers','show','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x435666,_0x2b89a4){var _0x22b742=function(_0x161501){while(--_0x161501){_0x435666['push'](_0x435666['shift']());}};_0x22b742(++_0x2b89a4);}(_0x6839,0x11c));var _0x9683=function(_0x2a04df,_0x48f2de){_0x2a04df=_0x2a04df-0x0;var _0x1369a2=_0x6839[_0x2a04df];return _0x1369a2;};'use strict';var multer=require(_0x9683('0x0'));var util=require(_0x9683('0x1'));var path=require('path');var timeout=require(_0x9683('0x2'));var express=require(_0x9683('0x3'));var router=express[_0x9683('0x4')]();var fs_extra=require(_0x9683('0x5'));var auth=require(_0x9683('0x6'));var interaction=require(_0x9683('0x7'));var config=require(_0x9683('0x8'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x9683('0x9')](),controller[_0x9683('0xa')]);router['get'](_0x9683('0xb'),auth[_0x9683('0x9')](),controller['describe']);router['get']('/users',auth['isAuthenticated'](),controller[_0x9683('0xc')]);router['get']('/:id',auth[_0x9683('0x9')](),controller[_0x9683('0xd')]);router[_0x9683('0xe')]('/',auth[_0x9683('0x9')](),controller[_0x9683('0xf')]);router[_0x9683('0x10')](_0x9683('0x11'),controller[_0x9683('0x12')]);router[_0x9683('0x13')]('/:id',auth[_0x9683('0x9')](),controller['destroy']);module[_0x9683('0x14')]=router; \ No newline at end of file +var _0x0577=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','describe','/users','getUsers','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xc6aa35,_0xc448b6){var _0x49d20c=function(_0x32a4b9){while(--_0x32a4b9){_0xc6aa35['push'](_0xc6aa35['shift']());}};_0x49d20c(++_0xc448b6);}(_0x0577,0x19d));var _0x7057=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x0577[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0x7057('0x0'));var util=require(_0x7057('0x1'));var path=require(_0x7057('0x2'));var timeout=require(_0x7057('0x3'));var express=require(_0x7057('0x4'));var router=express['Router']();var fs_extra=require(_0x7057('0x5'));var auth=require(_0x7057('0x6'));var interaction=require(_0x7057('0x7'));var config=require(_0x7057('0x8'));var controller=require(_0x7057('0x9'));router[_0x7057('0xa')]('/',auth[_0x7057('0xb')](),controller['index']);router[_0x7057('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x7057('0xc')]);router[_0x7057('0xa')](_0x7057('0xd'),auth['isAuthenticated'](),controller[_0x7057('0xe')]);router[_0x7057('0xa')](_0x7057('0xf'),auth[_0x7057('0xb')](),controller['show']);router[_0x7057('0x10')]('/',auth['isAuthenticated'](),controller[_0x7057('0x11')]);router[_0x7057('0x12')]('/:id',controller[_0x7057('0x13')]);router['delete']('/:id',auth[_0x7057('0xb')](),controller[_0x7057('0x14')]);module[_0x7057('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index c2bc174..a50f68d 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 _0x152f=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x152f,0x144));var _0xf152=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x152f[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require(_0xf152('0x0'));module[_0xf152('0x1')]={'body':{'type':Sequelize[_0xf152('0x2')](_0xf152('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf152('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf152('0x5')]('in',_0xf152('0x6')),'defaultValue':_0xf152('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf152('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xf152('0x2')]}}; \ No newline at end of file +var _0x6f2f=['BOOLEAN','out','DATE','STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x6f2f[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require(_0xf6f2('0x0'));module[_0xf6f2('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf6f2('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xf6f2('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf6f2('0x4')]},'providerName':{'type':Sequelize[_0xf6f2('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 8863697..3aee354 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 _0xd2eb=['merge','VIRTUAL','options','then','includeAll','include','findAll','rows','keys','find','catch','create','body','params','destroy','describe','chat-interactions','accept','read','format','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','email','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','sendStatus','stack','name','send','ChatMessage','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter'];(function(_0x5401da,_0x572809){var _0x2e669e=function(_0x382b70){while(--_0x382b70){_0x5401da['push'](_0x5401da['shift']());}};_0x2e669e(++_0x572809);}(_0xd2eb,0x1cf));var _0xbd2e=function(_0x2f8b82,_0x62abcb){_0x2f8b82=_0x2f8b82-0x0;var _0x60afef=_0xd2eb[_0x2f8b82];return _0x60afef;};'use strict';var emlformat=require(_0xbd2e('0x0'));var rimraf=require(_0xbd2e('0x1'));var zipdir=require(_0xbd2e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd2e('0x3'));var moment=require(_0xbd2e('0x4'));var BPromise=require(_0xbd2e('0x5'));var Mustache=require(_0xbd2e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xbd2e('0x7'));var csv=require('to-csv');var ejs=require(_0xbd2e('0x8'));var fs=require('fs');var fs_extra=require(_0xbd2e('0x9'));var _=require(_0xbd2e('0xa'));var squel=require(_0xbd2e('0xb'));var crypto=require(_0xbd2e('0xc'));var jsforce=require(_0xbd2e('0xd'));var deskjs=require(_0xbd2e('0xe'));var toCsv=require(_0xbd2e('0xf'));var querystring=require(_0xbd2e('0x10'));var Papa=require(_0xbd2e('0x11'));var Redis=require(_0xbd2e('0x12'));var authService=require(_0xbd2e('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd2e('0x14'));var logger=require(_0xbd2e('0x15'))(_0xbd2e('0x16'));var utils=require(_0xbd2e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbd2e('0x18'));var db=require(_0xbd2e('0x19'))['db'];config[_0xbd2e('0x1a')]=_['defaults'](config[_0xbd2e('0x1a')],{'host':_0xbd2e('0x1b'),'port':0x18eb});var socket=require(_0xbd2e('0x1c'))(new Redis(config[_0xbd2e('0x1a')]));require(_0xbd2e('0x1d'))[_0xbd2e('0x1e')](socket);var jayson=require(_0xbd2e('0x1f'));var client=jayson[_0xbd2e('0x20')][_0xbd2e('0x21')]({'port':0x232c});var client9002=jayson[_0xbd2e('0x20')][_0xbd2e('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3f98c5,_0x21037c,_0x100d14,_0x3327e0){return new BPromise(function(_0x420e9b,_0x4096d9){var _0x2d9b39=_0x3327e0||client;return _0x2d9b39[_0xbd2e('0x22')](_0x3f98c5,_0x100d14)['then'](function(_0x4b2a27){logger[_0xbd2e('0x23')](_0xbd2e('0x24'),_0x21037c,_0xbd2e('0x25'));logger['debug'](_0xbd2e('0x26'),_0x21037c,_0xbd2e('0x25'),JSON[_0xbd2e('0x27')](_0x4b2a27));if(_0x4b2a27[_0xbd2e('0x28')]){if(_0x4b2a27[_0xbd2e('0x28')][_0xbd2e('0x29')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x21037c,_0x4b2a27[_0xbd2e('0x28')][_0xbd2e('0x2a')]);return _0x4096d9(_0x4b2a27['error'][_0xbd2e('0x2a')]);}logger[_0xbd2e('0x28')](_0xbd2e('0x24'),_0x21037c,_0x4b2a27[_0xbd2e('0x28')][_0xbd2e('0x2a')]);return _0x420e9b(_0x4b2a27[_0xbd2e('0x28')]['message']);}else{logger[_0xbd2e('0x23')](_0xbd2e('0x24'),_0x21037c,'request\x20sent');_0x420e9b(_0x4b2a27[_0xbd2e('0x2b')][_0xbd2e('0x2a')]);}})['catch'](function(_0xa7673){logger[_0xbd2e('0x28')](_0xbd2e('0x24'),_0x21037c,_0xa7673);_0x4096d9(_0xa7673);});});}function respondWithStatusCode(_0x3d7ec8,_0x443cb0){_0x443cb0=_0x443cb0||0xcc;return function(_0x253715){if(_0x253715){return _0x3d7ec8['sendStatus'](_0x443cb0);}return _0x3d7ec8[_0xbd2e('0x2c')](_0x443cb0)[_0xbd2e('0x2d')]();};}function respondWithResult(_0x5726f6,_0x11c6a3){_0x11c6a3=_0x11c6a3||0xc8;return function(_0x1e1db0){if(_0x1e1db0){return _0x5726f6[_0xbd2e('0x2c')](_0x11c6a3)['json'](_0x1e1db0);}};}function respondWithFilteredResult(_0x33d845,_0x2671c4){return function(_0x16cced){if(_0x16cced){var _0x52156a=typeof _0x2671c4['offset']===_0xbd2e('0x2e')&&typeof _0x2671c4[_0xbd2e('0x2f')]===_0xbd2e('0x2e');var _0x408cf5=_0x16cced[_0xbd2e('0x30')];var _0x470670=_0x52156a?0x0:_0x2671c4[_0xbd2e('0x31')];var _0x48c266=_0x52156a?_0x16cced[_0xbd2e('0x30')]:_0x2671c4[_0xbd2e('0x31')]+_0x2671c4[_0xbd2e('0x2f')];var _0x2af6a1;if(_0x48c266>=_0x408cf5){_0x48c266=_0x408cf5;_0x2af6a1=0xc8;}else{_0x2af6a1=0xce;}_0x33d845['status'](_0x2af6a1);return _0x33d845[_0xbd2e('0x32')](_0xbd2e('0x33'),_0x470670+'-'+_0x48c266+'/'+_0x408cf5)[_0xbd2e('0x34')](_0x16cced);}return null;};}function patchUpdates(_0x504fef){return function(_0x3d0b56){try{jsonpatch[_0xbd2e('0x35')](_0x3d0b56,_0x504fef,!![]);}catch(_0x49c254){return BPromise[_0xbd2e('0x36')](_0x49c254);}return _0x3d0b56[_0xbd2e('0x37')]();};}function saveUpdates(_0x24247f,_0x30904e){return function(_0x4526db){if(_0x4526db){return _0x4526db[_0xbd2e('0x38')](_0x24247f)['then'](function(_0x5596ec){return _0x5596ec;});}return null;};}function removeEntity(_0xa29ce6,_0x309321){return function(_0x1c8a51){if(_0x1c8a51){return _0x1c8a51['destroy']()['then'](function(){_0xa29ce6[_0xbd2e('0x2c')](0xcc)[_0xbd2e('0x2d')]();});}};}function handleEntityNotFound(_0xfae1f4,_0x242432){return function(_0x4dd636){if(!_0x4dd636){_0xfae1f4[_0xbd2e('0x39')](0x194);}return _0x4dd636;};}function handleError(_0x26e2ba,_0x574ce4){_0x574ce4=_0x574ce4||0x1f4;return function(_0xf2776d){logger[_0xbd2e('0x28')](_0xf2776d[_0xbd2e('0x3a')]);if(_0xf2776d[_0xbd2e('0x3b')]){delete _0xf2776d['name'];}_0x26e2ba[_0xbd2e('0x2c')](_0x574ce4)[_0xbd2e('0x3c')](_0xf2776d);};}exports['index']=function(_0x51443f,_0xbfce34){var _0x524d35={},_0x5b1103={},_0x1c91a2={'count':0x0,'rows':[]};var _0x1b3de6=_['map'](db[_0xbd2e('0x3d')][_0xbd2e('0x3e')],function(_0x36edfb){return{'name':_0x36edfb['fieldName'],'type':_0x36edfb['type'][_0xbd2e('0x3f')]};});_0x5b1103[_0xbd2e('0x40')]=_[_0xbd2e('0x41')](_0x1b3de6,'name');_0x5b1103[_0xbd2e('0x42')]=_['keys'](_0x51443f[_0xbd2e('0x42')]);_0x5b1103[_0xbd2e('0x43')]=_[_0xbd2e('0x44')](_0x5b1103[_0xbd2e('0x40')],_0x5b1103[_0xbd2e('0x42')]);_0x524d35[_0xbd2e('0x45')]=_[_0xbd2e('0x44')](_0x5b1103[_0xbd2e('0x40')],qs[_0xbd2e('0x46')](_0x51443f['query'][_0xbd2e('0x46')]));_0x524d35[_0xbd2e('0x45')]=_0x524d35[_0xbd2e('0x45')][_0xbd2e('0x47')]?_0x524d35[_0xbd2e('0x45')]:_0x5b1103[_0xbd2e('0x40')];if(!_0x51443f['query'][_0xbd2e('0x48')]('nolimit')){_0x524d35[_0xbd2e('0x2f')]=qs['limit'](_0x51443f[_0xbd2e('0x42')][_0xbd2e('0x2f')]);_0x524d35['offset']=qs[_0xbd2e('0x31')](_0x51443f[_0xbd2e('0x42')][_0xbd2e('0x31')]);}_0x524d35['order']=qs[_0xbd2e('0x49')](_0x51443f['query'][_0xbd2e('0x49')]);_0x524d35[_0xbd2e('0x4a')]=qs[_0xbd2e('0x43')](_[_0xbd2e('0x4b')](_0x51443f[_0xbd2e('0x42')],_0x5b1103['filters']),_0x1b3de6);if(_0x51443f[_0xbd2e('0x42')][_0xbd2e('0x4c')]){_0x524d35['where']=_[_0xbd2e('0x4d')](_0x524d35['where'],{'$or':_[_0xbd2e('0x41')](_0x1b3de6,function(_0x4c09d1){if(_0x4c09d1['type']!==_0xbd2e('0x4e')){var _0x7a649e={};_0x7a649e[_0x4c09d1[_0xbd2e('0x3b')]]={'$like':'%'+_0x51443f[_0xbd2e('0x42')][_0xbd2e('0x4c')]+'%'};return _0x7a649e;}})});}_0x524d35=_[_0xbd2e('0x4d')]({},_0x524d35,_0x51443f[_0xbd2e('0x4f')]);var _0x50353a={'where':_0x524d35[_0xbd2e('0x4a')]};return db['ChatMessage']['count'](_0x50353a)[_0xbd2e('0x50')](function(_0x14f150){_0x1c91a2[_0xbd2e('0x30')]=_0x14f150;if(_0x51443f['query'][_0xbd2e('0x51')]){_0x524d35[_0xbd2e('0x52')]=[{'all':!![]}];}return db[_0xbd2e('0x3d')][_0xbd2e('0x53')](_0x524d35);})[_0xbd2e('0x50')](function(_0x390a08){_0x1c91a2[_0xbd2e('0x54')]=_0x390a08;return _0x1c91a2;})['then'](respondWithFilteredResult(_0xbfce34,_0x524d35))['catch'](handleError(_0xbfce34,null));};exports['show']=function(_0x54ff6c,_0x38302d){var _0x1d2f70={'raw':!![],'where':{'id':_0x54ff6c['params']['id']}},_0x41a5ad={};_0x41a5ad['model']=_[_0xbd2e('0x55')](db['ChatMessage'][_0xbd2e('0x3e')]);_0x41a5ad[_0xbd2e('0x42')]=_[_0xbd2e('0x55')](_0x54ff6c[_0xbd2e('0x42')]);_0x41a5ad[_0xbd2e('0x43')]=_[_0xbd2e('0x44')](_0x41a5ad[_0xbd2e('0x40')],_0x41a5ad[_0xbd2e('0x42')]);_0x1d2f70[_0xbd2e('0x45')]=_['intersection'](_0x41a5ad[_0xbd2e('0x40')],qs['fields'](_0x54ff6c[_0xbd2e('0x42')][_0xbd2e('0x46')]));_0x1d2f70[_0xbd2e('0x45')]=_0x1d2f70[_0xbd2e('0x45')]['length']?_0x1d2f70['attributes']:_0x41a5ad[_0xbd2e('0x40')];if(_0x54ff6c[_0xbd2e('0x42')]['includeAll']){_0x1d2f70[_0xbd2e('0x52')]=[{'all':!![]}];}_0x1d2f70=_[_0xbd2e('0x4d')]({},_0x1d2f70,_0x54ff6c['options']);return db['ChatMessage'][_0xbd2e('0x56')](_0x1d2f70)[_0xbd2e('0x50')](handleEntityNotFound(_0x38302d,null))[_0xbd2e('0x50')](respondWithResult(_0x38302d,null))[_0xbd2e('0x57')](handleError(_0x38302d,null));};exports[_0xbd2e('0x58')]=function(_0xb47842,_0x42a36f){return db[_0xbd2e('0x3d')][_0xbd2e('0x58')](_0xb47842['body'],{})[_0xbd2e('0x50')](respondWithResult(_0x42a36f,0xc9))[_0xbd2e('0x57')](handleError(_0x42a36f,null));};exports['update']=function(_0x4612b0,_0x288465){if(_0x4612b0[_0xbd2e('0x59')]['id']){delete _0x4612b0[_0xbd2e('0x59')]['id'];}return db[_0xbd2e('0x3d')][_0xbd2e('0x56')]({'where':{'id':_0x4612b0[_0xbd2e('0x5a')]['id']}})[_0xbd2e('0x50')](handleEntityNotFound(_0x288465,null))[_0xbd2e('0x50')](saveUpdates(_0x4612b0[_0xbd2e('0x59')],null))[_0xbd2e('0x50')](respondWithResult(_0x288465,null))[_0xbd2e('0x57')](handleError(_0x288465,null));};exports[_0xbd2e('0x5b')]=function(_0x175ae5,_0x1cb705){return db[_0xbd2e('0x3d')]['find']({'where':{'id':_0x175ae5[_0xbd2e('0x5a')]['id']}})[_0xbd2e('0x50')](handleEntityNotFound(_0x1cb705,null))[_0xbd2e('0x50')](removeEntity(_0x1cb705,null))['catch'](handleError(_0x1cb705,null));};exports[_0xbd2e('0x5c')]=function(_0x48eb7b,_0x545ad8){return db[_0xbd2e('0x3d')][_0xbd2e('0x5c')]()['then'](respondWithResult(_0x545ad8,null))[_0xbd2e('0x57')](handleError(_0x545ad8,null));};var interaction_log=require(_0xbd2e('0x15'))(_0xbd2e('0x5d'));exports[_0xbd2e('0x5e')]=function(_0x34739b,_0x2647fb,_0x3fe782){var _0x37ba0e={'agent':{},'channel':'chat'};if(_0x34739b[_0xbd2e('0x59')]['id']){delete _0x34739b[_0xbd2e('0x59')]['id'];}_0x34739b[_0xbd2e('0x59')][_0xbd2e('0x5f')]=!![];_0x34739b[_0xbd2e('0x59')]['readAt']=moment()[_0xbd2e('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x34739b[_0xbd2e('0x59')][_0xbd2e('0x61')]=_0x34739b['body'][_0xbd2e('0x61')]||_0x34739b[_0xbd2e('0x62')]['id'];_0x37ba0e['agent']['id']=_0x34739b[_0xbd2e('0x59')]['UserId'];return db[_0xbd2e('0x3d')]['find']({'where':{'id':_0x34739b[_0xbd2e('0x5a')]['id'],'UserId':null}})[_0xbd2e('0x50')](handleEntityNotFound(_0x2647fb,null))[_0xbd2e('0x50')](saveUpdates(_0x34739b['body'],null))[_0xbd2e('0x50')](function(_0x3a06db){if(_0x3a06db){_0x37ba0e[_0xbd2e('0x2a')]=_0x3a06db[_0xbd2e('0x63')]({'plain':!![]});return db[_0xbd2e('0x64')][_0xbd2e('0x56')]({'where':{'id':_0x3a06db[_0xbd2e('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x2647fb,null))[_0xbd2e('0x50')](function(_0x10f740){if(_0x10f740){return _0x10f740[_0xbd2e('0x38')]({'UserId':_0x34739b[_0xbd2e('0x59')][_0xbd2e('0x61')],'read1stAt':_[_0xbd2e('0x66')](_0x10f740[_0xbd2e('0x67')])?moment()[_0xbd2e('0x60')](_0xbd2e('0x68')):undefined});}return null;})['then'](function(_0x30076a){if(_0x30076a){_0x37ba0e[_0xbd2e('0x69')]=_0x30076a[_0xbd2e('0x63')]({'plain':!![]});interaction_log[_0xbd2e('0x23')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34739b[_0xbd2e('0x62')]['id'],_0x34739b[_0xbd2e('0x62')]['name'],_0x34739b['user']['role'],_0x37ba0e[_0xbd2e('0x69')]['id'],_0x34739b['body']?JSON['stringify'](_0x34739b['body']):_0xbd2e('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xbd2e('0x6b'),_0x37ba0e);}return null;})[_0xbd2e('0x50')](function(_0x3e485f){var _0x2be706=_0xbd2e('0x6c')+_0x3e485f[_0xbd2e('0x2a')][_0xbd2e('0x6d')];return db['sequelize'][_0xbd2e('0x42')](_0x2be706,{'type':db[_0xbd2e('0x6e')][_0xbd2e('0x6f')][_0xbd2e('0x70')],'raw':!![]})[_0xbd2e('0x50')](function(_0x3505e3){return _0x3505e3;});})[_0xbd2e('0x50')](function(_0x262041){if(_0x262041){_0x37ba0e[_0xbd2e('0x2a')][_0xbd2e('0x71')]=_0x262041[0x0];if(!_0x34739b[_0xbd2e('0x59')][_0xbd2e('0x61')])return;return db[_0xbd2e('0x72')][_0xbd2e('0x56')]({'where':{'id':_0x34739b['body']['UserId'],'role':_0xbd2e('0x73')},'attributes':['id','name',_0xbd2e('0x74'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x585116){if(!_0x585116)return null;_0x37ba0e[_0xbd2e('0x2a')][_0xbd2e('0x73')]=_0x585116;return _0x37ba0e;})['then'](function(_0x27cfb6){if(_0x27cfb6){if(_0x34739b['body'][_0xbd2e('0x75')]){_0x37ba0e['message'][_0xbd2e('0x76')]=util[_0xbd2e('0x60')](_0xbd2e('0x77'),_0x34739b[_0xbd2e('0x62')]['name']);_0x37ba0e[_0xbd2e('0x2a')][_0xbd2e('0x78')]=_0x37ba0e[_0xbd2e('0x78')];_0x37ba0e[_0xbd2e('0x2a')]['motionChannel']=_0x37ba0e[_0xbd2e('0x78')];_0x37ba0e[_0xbd2e('0x2a')][_0xbd2e('0x79')]=_0xbd2e('0x5e');return respondWithRpcPromise(_0xbd2e('0x7a'),_0xbd2e('0x7a'),{'event':_0xbd2e('0x7b'),'message':_[_0xbd2e('0x4d')](_0x37ba0e['message'],JSON[_0xbd2e('0x7c')](_0x37ba0e['interaction'][_0xbd2e('0x7d')]))},client9002)['then'](function(){return _0x37ba0e;});}return _0x37ba0e;}return null;})['then'](respondWithResult(_0x2647fb,null))['catch'](handleError(_0x2647fb,null));};var interaction_log=require('../../config/logger')(_0xbd2e('0x5d'));exports[_0xbd2e('0x36')]=function(_0xf7f935,_0x3770f9,_0x2ff52e){var _0x1104be={'agent':{},'channel':_0xbd2e('0x7e')};if(_0xf7f935[_0xbd2e('0x59')]['id']){delete _0xf7f935[_0xbd2e('0x59')]['id'];}_0xf7f935[_0xbd2e('0x59')][_0xbd2e('0x61')]=_0xf7f935[_0xbd2e('0x59')]['UserId']||_0xf7f935[_0xbd2e('0x62')]['id'];_0x1104be[_0xbd2e('0x73')]['id']=_0xf7f935[_0xbd2e('0x59')][_0xbd2e('0x61')];return db[_0xbd2e('0x3d')]['find']({'where':{'id':_0xf7f935[_0xbd2e('0x5a')]['id'],'UserId':null}})[_0xbd2e('0x50')](handleEntityNotFound(_0x3770f9,null))[_0xbd2e('0x50')](function(_0x355e61){if(_0x355e61){_0x1104be[_0xbd2e('0x2a')]=_0x355e61[_0xbd2e('0x63')]({'plain':!![]});return db[_0xbd2e('0x64')][_0xbd2e('0x56')]({'where':{'id':_0x355e61[_0xbd2e('0x65')]}});}return null;})[_0xbd2e('0x50')](handleEntityNotFound(_0x3770f9,null))['then'](function(_0x4a4343){if(_0x4a4343){_0x1104be[_0xbd2e('0x69')]=_0x4a4343[_0xbd2e('0x63')]({'plain':!![]});interaction_log['info'](_0xbd2e('0x7f'),_0xf7f935['user']['id'],_0xf7f935[_0xbd2e('0x62')][_0xbd2e('0x3b')],_0xf7f935[_0xbd2e('0x62')][_0xbd2e('0x80')],_0x1104be[_0xbd2e('0x69')]['id'],_0xf7f935[_0xbd2e('0x59')]?JSON[_0xbd2e('0x27')](_0xf7f935[_0xbd2e('0x59')]):_0xbd2e('0x6a'));return respondWithRpcPromise(_0xbd2e('0x81'),_0xbd2e('0x82'),_0x1104be);}return null;})[_0xbd2e('0x50')](function(_0x11dd41){var _0x40ffc5=_0xbd2e('0x6c')+_0x11dd41[_0xbd2e('0x2a')][_0xbd2e('0x6d')];return db[_0xbd2e('0x83')]['query'](_0x40ffc5,{'type':db['Sequelize'][_0xbd2e('0x6f')][_0xbd2e('0x70')],'raw':!![]})[_0xbd2e('0x50')](function(_0x2b7082){return _0x2b7082;});})['then'](function(_0x2763c7){if(_0x2763c7){_0x1104be[_0xbd2e('0x2a')][_0xbd2e('0x71')]=_0x2763c7[0x0];if(!_0xf7f935['body'][_0xbd2e('0x61')])return;return db[_0xbd2e('0x72')][_0xbd2e('0x56')]({'where':{'id':_0xf7f935[_0xbd2e('0x59')][_0xbd2e('0x61')],'role':_0xbd2e('0x73')},'attributes':['id',_0xbd2e('0x3b'),'fullname',_0xbd2e('0x84'),'internal'],'raw':!![]});}return null;})[_0xbd2e('0x50')](function(_0x1e3488){if(!_0x1e3488)return null;_0x1104be[_0xbd2e('0x2a')][_0xbd2e('0x73')]=_0x1e3488;return _0x1104be;})[_0xbd2e('0x50')](function(_0x261e07){if(_0x261e07){_0x261e07[_0xbd2e('0x2a')][_0xbd2e('0x76')]=util[_0xbd2e('0x60')](_0xbd2e('0x77'),_0xf7f935[_0xbd2e('0x62')][_0xbd2e('0x3b')]);_0x261e07[_0xbd2e('0x2a')]['channel']=_0x1104be[_0xbd2e('0x78')];_0x261e07['message'][_0xbd2e('0x85')]=_0x1104be[_0xbd2e('0x78')];_0x261e07[_0xbd2e('0x2a')][_0xbd2e('0x79')]=_0xbd2e('0x36');respondWithRpcPromise('EventManager',_0xbd2e('0x7a'),{'event':_0xbd2e('0x86'),'message':_['merge'](_0x1104be[_0xbd2e('0x2a')],JSON[_0xbd2e('0x7c')](_0x1104be[_0xbd2e('0x69')][_0xbd2e('0x7d')]))},client9002);return _0x1104be;}return null;})[_0xbd2e('0x50')](respondWithResult(_0x3770f9,null))[_0xbd2e('0x57')](handleError(_0x3770f9,null));}; \ No newline at end of file +var _0xa0c5=['set','apply','reject','destroy','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatMessage','include','findAll','rows','show','params','length','find','body','update','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','isNil','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','fullname','email','internal','manual','channel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','User','interface','rejectmessage','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','limit','count'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xa0c5,0x158));var _0x5a0c=function(_0x1b9ec2,_0x39ae50){_0x1b9ec2=_0x1b9ec2-0x0;var _0x26c710=_0xa0c5[_0x1b9ec2];return _0x26c710;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a0c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5a0c('0x1'));var BPromise=require(_0x5a0c('0x2'));var Mustache=require(_0x5a0c('0x3'));var util=require(_0x5a0c('0x4'));var path=require(_0x5a0c('0x5'));var sox=require(_0x5a0c('0x6'));var csv=require(_0x5a0c('0x7'));var ejs=require(_0x5a0c('0x8'));var fs=require('fs');var fs_extra=require(_0x5a0c('0x9'));var _=require('lodash');var squel=require(_0x5a0c('0xa'));var crypto=require(_0x5a0c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5a0c('0xc'));var toCsv=require(_0x5a0c('0x7'));var querystring=require(_0x5a0c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5a0c('0xe'));var qs=require(_0x5a0c('0xf'));var as=require(_0x5a0c('0x10'));var hardwareService=require(_0x5a0c('0x11'));var logger=require(_0x5a0c('0x12'))(_0x5a0c('0x13'));var utils=require(_0x5a0c('0x14'));var config=require(_0x5a0c('0x15'));var licenseUtil=require(_0x5a0c('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5a0c('0x17')](config[_0x5a0c('0x18')],{'host':_0x5a0c('0x19'),'port':0x18eb});var socket=require(_0x5a0c('0x1a'))(new Redis(config[_0x5a0c('0x18')]));require(_0x5a0c('0x1b'))[_0x5a0c('0x1c')](socket);var jayson=require(_0x5a0c('0x1d'));var client=jayson[_0x5a0c('0x1e')][_0x5a0c('0x1f')]({'port':0x232c});var client9002=jayson[_0x5a0c('0x1e')][_0x5a0c('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2dab14,_0x4243e1,_0x3b7334,_0x2432d8){return new BPromise(function(_0x139200,_0x30e0aa){var _0x595b7f=_0x2432d8||client;return _0x595b7f['request'](_0x2dab14,_0x3b7334)[_0x5a0c('0x20')](function(_0x2510db){logger['info']('ChatMessage,\x20%s,\x20%s',_0x4243e1,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4243e1,_0x5a0c('0x21'),JSON[_0x5a0c('0x22')](_0x2510db));if(_0x2510db[_0x5a0c('0x23')]){if(_0x2510db['error'][_0x5a0c('0x24')]===0x1f4){logger['error'](_0x5a0c('0x25'),_0x4243e1,_0x2510db[_0x5a0c('0x23')][_0x5a0c('0x26')]);return _0x30e0aa(_0x2510db['error'][_0x5a0c('0x26')]);}logger['error'](_0x5a0c('0x25'),_0x4243e1,_0x2510db[_0x5a0c('0x23')][_0x5a0c('0x26')]);return _0x139200(_0x2510db[_0x5a0c('0x23')][_0x5a0c('0x26')]);}else{logger[_0x5a0c('0x27')](_0x5a0c('0x25'),_0x4243e1,_0x5a0c('0x21'));_0x139200(_0x2510db[_0x5a0c('0x28')][_0x5a0c('0x26')]);}})[_0x5a0c('0x29')](function(_0x3e8604){logger[_0x5a0c('0x23')](_0x5a0c('0x25'),_0x4243e1,_0x3e8604);_0x30e0aa(_0x3e8604);});});}function respondWithStatusCode(_0x571d39,_0x123be1){_0x123be1=_0x123be1||0xcc;return function(_0x3049ca){if(_0x3049ca){return _0x571d39[_0x5a0c('0x2a')](_0x123be1);}return _0x571d39[_0x5a0c('0x2b')](_0x123be1)[_0x5a0c('0x2c')]();};}function respondWithResult(_0x2a1c01,_0x251f6d){_0x251f6d=_0x251f6d||0xc8;return function(_0x3e71b4){if(_0x3e71b4){return _0x2a1c01['status'](_0x251f6d)[_0x5a0c('0x2d')](_0x3e71b4);}};}function respondWithFilteredResult(_0x25b8c3,_0x181997){return function(_0x12b5ac){if(_0x12b5ac){var _0x38f3c6=typeof _0x181997[_0x5a0c('0x2e')]==='undefined'&&typeof _0x181997[_0x5a0c('0x2f')]==='undefined';var _0x3af1df=_0x12b5ac[_0x5a0c('0x30')];var _0x5358b6=_0x38f3c6?0x0:_0x181997[_0x5a0c('0x2e')];var _0x196f73=_0x38f3c6?_0x12b5ac[_0x5a0c('0x30')]:_0x181997[_0x5a0c('0x2e')]+_0x181997[_0x5a0c('0x2f')];var _0x543067;if(_0x196f73>=_0x3af1df){_0x196f73=_0x3af1df;_0x543067=0xc8;}else{_0x543067=0xce;}_0x25b8c3['status'](_0x543067);return _0x25b8c3[_0x5a0c('0x31')]('Content-Range',_0x5358b6+'-'+_0x196f73+'/'+_0x3af1df)[_0x5a0c('0x2d')](_0x12b5ac);}return null;};}function patchUpdates(_0x386608){return function(_0x39a741){try{jsonpatch[_0x5a0c('0x32')](_0x39a741,_0x386608,!![]);}catch(_0x4681de){return BPromise[_0x5a0c('0x33')](_0x4681de);}return _0x39a741['save']();};}function saveUpdates(_0x5df246,_0x5fe61d){return function(_0x3967e4){if(_0x3967e4){return _0x3967e4['update'](_0x5df246)[_0x5a0c('0x20')](function(_0x1decf7){return _0x1decf7;});}return null;};}function removeEntity(_0x2b4821,_0x1a2976){return function(_0x633c88){if(_0x633c88){return _0x633c88[_0x5a0c('0x34')]()[_0x5a0c('0x20')](function(){_0x2b4821[_0x5a0c('0x2b')](0xcc)[_0x5a0c('0x2c')]();});}};}function handleEntityNotFound(_0x26a4d5,_0x2d0ccf){return function(_0x24171a){if(!_0x24171a){_0x26a4d5[_0x5a0c('0x2a')](0x194);}return _0x24171a;};}function handleError(_0x781e0f,_0x3595a0){_0x3595a0=_0x3595a0||0x1f4;return function(_0x6f35a){logger[_0x5a0c('0x23')](_0x6f35a['stack']);if(_0x6f35a[_0x5a0c('0x35')]){delete _0x6f35a['name'];}_0x781e0f[_0x5a0c('0x2b')](_0x3595a0)[_0x5a0c('0x36')](_0x6f35a);};}exports[_0x5a0c('0x37')]=function(_0x18f8f0,_0x1a3902){var _0x2ce5e1={},_0xa4eb73={},_0x587b96={'count':0x0,'rows':[]};var _0x73c1d8=_[_0x5a0c('0x38')](db['ChatMessage'][_0x5a0c('0x39')],function(_0xa1d59f){return{'name':_0xa1d59f[_0x5a0c('0x3a')],'type':_0xa1d59f['type'][_0x5a0c('0x3b')]};});_0xa4eb73[_0x5a0c('0x3c')]=_[_0x5a0c('0x38')](_0x73c1d8,_0x5a0c('0x35'));_0xa4eb73[_0x5a0c('0x3d')]=_[_0x5a0c('0x3e')](_0x18f8f0['query']);_0xa4eb73[_0x5a0c('0x3f')]=_[_0x5a0c('0x40')](_0xa4eb73[_0x5a0c('0x3c')],_0xa4eb73[_0x5a0c('0x3d')]);_0x2ce5e1[_0x5a0c('0x41')]=_[_0x5a0c('0x40')](_0xa4eb73['model'],qs[_0x5a0c('0x42')](_0x18f8f0['query']['fields']));_0x2ce5e1['attributes']=_0x2ce5e1[_0x5a0c('0x41')]['length']?_0x2ce5e1[_0x5a0c('0x41')]:_0xa4eb73['model'];if(!_0x18f8f0[_0x5a0c('0x3d')][_0x5a0c('0x43')](_0x5a0c('0x44'))){_0x2ce5e1[_0x5a0c('0x2f')]=qs['limit'](_0x18f8f0[_0x5a0c('0x3d')]['limit']);_0x2ce5e1[_0x5a0c('0x2e')]=qs[_0x5a0c('0x2e')](_0x18f8f0[_0x5a0c('0x3d')][_0x5a0c('0x2e')]);}_0x2ce5e1[_0x5a0c('0x45')]=qs[_0x5a0c('0x46')](_0x18f8f0[_0x5a0c('0x3d')]['sort']);_0x2ce5e1[_0x5a0c('0x47')]=qs[_0x5a0c('0x3f')](_[_0x5a0c('0x48')](_0x18f8f0[_0x5a0c('0x3d')],_0xa4eb73[_0x5a0c('0x3f')]),_0x73c1d8);if(_0x18f8f0[_0x5a0c('0x3d')][_0x5a0c('0x49')]){_0x2ce5e1[_0x5a0c('0x47')]=_[_0x5a0c('0x4a')](_0x2ce5e1[_0x5a0c('0x47')],{'$or':_[_0x5a0c('0x38')](_0x73c1d8,function(_0x4d48cb){if(_0x4d48cb[_0x5a0c('0x4b')]!==_0x5a0c('0x4c')){var _0x347c7d={};_0x347c7d[_0x4d48cb[_0x5a0c('0x35')]]={'$like':'%'+_0x18f8f0[_0x5a0c('0x3d')]['filter']+'%'};return _0x347c7d;}})});}_0x2ce5e1=_[_0x5a0c('0x4a')]({},_0x2ce5e1,_0x18f8f0[_0x5a0c('0x4d')]);var _0x452783={'where':_0x2ce5e1[_0x5a0c('0x47')]};return db[_0x5a0c('0x4e')]['count'](_0x452783)[_0x5a0c('0x20')](function(_0x186342){_0x587b96[_0x5a0c('0x30')]=_0x186342;if(_0x18f8f0[_0x5a0c('0x3d')]['includeAll']){_0x2ce5e1[_0x5a0c('0x4f')]=[{'all':!![]}];}return db[_0x5a0c('0x4e')][_0x5a0c('0x50')](_0x2ce5e1);})[_0x5a0c('0x20')](function(_0x24f58a){_0x587b96[_0x5a0c('0x51')]=_0x24f58a;return _0x587b96;})[_0x5a0c('0x20')](respondWithFilteredResult(_0x1a3902,_0x2ce5e1))[_0x5a0c('0x29')](handleError(_0x1a3902,null));};exports[_0x5a0c('0x52')]=function(_0x745af4,_0x277969){var _0x1c8356={'raw':!![],'where':{'id':_0x745af4[_0x5a0c('0x53')]['id']}},_0x56839f={};_0x56839f[_0x5a0c('0x3c')]=_['keys'](db[_0x5a0c('0x4e')][_0x5a0c('0x39')]);_0x56839f['query']=_[_0x5a0c('0x3e')](_0x745af4[_0x5a0c('0x3d')]);_0x56839f['filters']=_[_0x5a0c('0x40')](_0x56839f[_0x5a0c('0x3c')],_0x56839f[_0x5a0c('0x3d')]);_0x1c8356[_0x5a0c('0x41')]=_[_0x5a0c('0x40')](_0x56839f[_0x5a0c('0x3c')],qs[_0x5a0c('0x42')](_0x745af4['query'][_0x5a0c('0x42')]));_0x1c8356[_0x5a0c('0x41')]=_0x1c8356[_0x5a0c('0x41')][_0x5a0c('0x54')]?_0x1c8356['attributes']:_0x56839f[_0x5a0c('0x3c')];if(_0x745af4['query']['includeAll']){_0x1c8356['include']=[{'all':!![]}];}_0x1c8356=_['merge']({},_0x1c8356,_0x745af4[_0x5a0c('0x4d')]);return db[_0x5a0c('0x4e')][_0x5a0c('0x55')](_0x1c8356)[_0x5a0c('0x20')](handleEntityNotFound(_0x277969,null))[_0x5a0c('0x20')](respondWithResult(_0x277969,null))[_0x5a0c('0x29')](handleError(_0x277969,null));};exports['create']=function(_0x5dcf61,_0x24a05b){return db['ChatMessage']['create'](_0x5dcf61[_0x5a0c('0x56')],{})[_0x5a0c('0x20')](respondWithResult(_0x24a05b,0xc9))['catch'](handleError(_0x24a05b,null));};exports[_0x5a0c('0x57')]=function(_0x14a75a,_0xe5304c){if(_0x14a75a[_0x5a0c('0x56')]['id']){delete _0x14a75a[_0x5a0c('0x56')]['id'];}return db[_0x5a0c('0x4e')][_0x5a0c('0x55')]({'where':{'id':_0x14a75a[_0x5a0c('0x53')]['id']}})[_0x5a0c('0x20')](handleEntityNotFound(_0xe5304c,null))[_0x5a0c('0x20')](saveUpdates(_0x14a75a[_0x5a0c('0x56')],null))['then'](respondWithResult(_0xe5304c,null))[_0x5a0c('0x29')](handleError(_0xe5304c,null));};exports['destroy']=function(_0xde38f,_0x4ce56e){return db[_0x5a0c('0x4e')][_0x5a0c('0x55')]({'where':{'id':_0xde38f[_0x5a0c('0x53')]['id']}})['then'](handleEntityNotFound(_0x4ce56e,null))[_0x5a0c('0x20')](removeEntity(_0x4ce56e,null))[_0x5a0c('0x29')](handleError(_0x4ce56e,null));};exports[_0x5a0c('0x58')]=function(_0xf57a0a,_0x121195){return db[_0x5a0c('0x4e')]['describe']()[_0x5a0c('0x20')](respondWithResult(_0x121195,null))['catch'](handleError(_0x121195,null));};var interaction_log=require(_0x5a0c('0x12'))(_0x5a0c('0x59'));exports[_0x5a0c('0x5a')]=function(_0x3d48e5,_0x11189c,_0xcce195){var _0x48a05c={'agent':{},'channel':_0x5a0c('0x5b')};if(_0x3d48e5[_0x5a0c('0x56')]['id']){delete _0x3d48e5[_0x5a0c('0x56')]['id'];}_0x3d48e5[_0x5a0c('0x56')][_0x5a0c('0x5c')]=!![];_0x3d48e5[_0x5a0c('0x56')][_0x5a0c('0x5d')]=moment()[_0x5a0c('0x5e')](_0x5a0c('0x5f'));_0x3d48e5[_0x5a0c('0x56')][_0x5a0c('0x60')]=_0x3d48e5['body'][_0x5a0c('0x60')]||_0x3d48e5[_0x5a0c('0x61')]['id'];_0x48a05c[_0x5a0c('0x62')]['id']=_0x3d48e5[_0x5a0c('0x56')]['UserId'];return db[_0x5a0c('0x4e')][_0x5a0c('0x55')]({'where':{'id':_0x3d48e5[_0x5a0c('0x53')]['id'],'UserId':null}})[_0x5a0c('0x20')](handleEntityNotFound(_0x11189c,null))[_0x5a0c('0x20')](saveUpdates(_0x3d48e5[_0x5a0c('0x56')],null))['then'](function(_0x120eb4){if(_0x120eb4){_0x48a05c[_0x5a0c('0x26')]=_0x120eb4['get']({'plain':!![]});return db[_0x5a0c('0x63')][_0x5a0c('0x55')]({'where':{'id':_0x120eb4['ChatInteractionId']}});}return null;})[_0x5a0c('0x20')](handleEntityNotFound(_0x11189c,null))['then'](function(_0x49c76a){if(_0x49c76a){return _0x49c76a['update']({'UserId':_0x3d48e5[_0x5a0c('0x56')][_0x5a0c('0x60')],'read1stAt':_[_0x5a0c('0x64')](_0x49c76a['read1stAt'])?moment()['format'](_0x5a0c('0x5f')):undefined});}return null;})['then'](function(_0x33088c){if(_0x33088c){_0x48a05c[_0x5a0c('0x65')]=_0x33088c[_0x5a0c('0x66')]({'plain':!![]});interaction_log['info'](_0x5a0c('0x67'),_0x3d48e5[_0x5a0c('0x61')]['id'],_0x3d48e5[_0x5a0c('0x61')][_0x5a0c('0x35')],_0x3d48e5[_0x5a0c('0x61')][_0x5a0c('0x68')],_0x48a05c[_0x5a0c('0x65')]['id'],_0x3d48e5[_0x5a0c('0x56')]?JSON[_0x5a0c('0x22')](_0x3d48e5[_0x5a0c('0x56')]):_0x5a0c('0x69'));return respondWithRpcPromise(_0x5a0c('0x6a'),_0x5a0c('0x6b'),_0x48a05c);}return null;})['then'](function(_0x1182e4){var _0x6a70de=_0x5a0c('0x6c')+_0x1182e4[_0x5a0c('0x26')][_0x5a0c('0x6d')];return db[_0x5a0c('0x6e')][_0x5a0c('0x3d')](_0x6a70de,{'type':db[_0x5a0c('0x6f')]['QueryTypes'][_0x5a0c('0x70')],'raw':!![]})['then'](function(_0x512eec){return _0x512eec;});})[_0x5a0c('0x20')](function(_0x46326d){if(_0x46326d){_0x48a05c[_0x5a0c('0x26')][_0x5a0c('0x71')]=_0x46326d[0x0];if(!_0x3d48e5[_0x5a0c('0x56')][_0x5a0c('0x60')])return;return db['User']['find']({'where':{'id':_0x3d48e5[_0x5a0c('0x56')]['UserId'],'role':_0x5a0c('0x62')},'attributes':['id',_0x5a0c('0x35'),_0x5a0c('0x72'),_0x5a0c('0x73'),_0x5a0c('0x74')],'raw':!![]});}return null;})[_0x5a0c('0x20')](function(_0x1913c8){if(!_0x1913c8)return null;_0x48a05c[_0x5a0c('0x26')][_0x5a0c('0x62')]=_0x1913c8;return _0x48a05c;})['then'](function(_0x574020){if(_0x574020){if(_0x3d48e5[_0x5a0c('0x56')][_0x5a0c('0x75')]){_0x48a05c[_0x5a0c('0x26')]['interface']=util[_0x5a0c('0x5e')]('SIP/%s',_0x3d48e5['user']['name']);_0x48a05c[_0x5a0c('0x26')][_0x5a0c('0x76')]=_0x48a05c[_0x5a0c('0x76')];_0x48a05c['message']['motionChannel']=_0x48a05c[_0x5a0c('0x76')];_0x48a05c[_0x5a0c('0x26')][_0x5a0c('0x77')]=_0x5a0c('0x5a');return respondWithRpcPromise('EventManager',_0x5a0c('0x78'),{'event':_0x5a0c('0x79'),'message':_['merge'](_0x48a05c[_0x5a0c('0x26')],JSON[_0x5a0c('0x7a')](_0x48a05c[_0x5a0c('0x65')][_0x5a0c('0x7b')]))},client9002)['then'](function(){return _0x48a05c;});}return _0x48a05c;}return null;})[_0x5a0c('0x20')](respondWithResult(_0x11189c,null))['catch'](handleError(_0x11189c,null));};var interaction_log=require(_0x5a0c('0x12'))(_0x5a0c('0x59'));exports[_0x5a0c('0x33')]=function(_0x3acf1e,_0x4e0801,_0x41513e){var _0x14be6a={'agent':{},'channel':'chat'};if(_0x3acf1e[_0x5a0c('0x56')]['id']){delete _0x3acf1e['body']['id'];}_0x3acf1e[_0x5a0c('0x56')][_0x5a0c('0x60')]=_0x3acf1e[_0x5a0c('0x56')]['UserId']||_0x3acf1e[_0x5a0c('0x61')]['id'];_0x14be6a['agent']['id']=_0x3acf1e[_0x5a0c('0x56')]['UserId'];return db[_0x5a0c('0x4e')]['find']({'where':{'id':_0x3acf1e[_0x5a0c('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4e0801,null))[_0x5a0c('0x20')](function(_0x729b0a){if(_0x729b0a){_0x14be6a[_0x5a0c('0x26')]=_0x729b0a['get']({'plain':!![]});return db[_0x5a0c('0x63')]['find']({'where':{'id':_0x729b0a['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4e0801,null))[_0x5a0c('0x20')](function(_0x281311){if(_0x281311){_0x14be6a['interaction']=_0x281311[_0x5a0c('0x66')]({'plain':!![]});interaction_log['info'](_0x5a0c('0x7c'),_0x3acf1e[_0x5a0c('0x61')]['id'],_0x3acf1e[_0x5a0c('0x61')][_0x5a0c('0x35')],_0x3acf1e['user'][_0x5a0c('0x68')],_0x14be6a[_0x5a0c('0x65')]['id'],_0x3acf1e[_0x5a0c('0x56')]?JSON[_0x5a0c('0x22')](_0x3acf1e[_0x5a0c('0x56')]):'null');return respondWithRpcPromise(_0x5a0c('0x7d'),_0x5a0c('0x7e'),_0x14be6a);}return null;})[_0x5a0c('0x20')](function(_0x5ad5d7){var _0x40b14c=_0x5a0c('0x6c')+_0x5ad5d7[_0x5a0c('0x26')][_0x5a0c('0x6d')];return db[_0x5a0c('0x6e')][_0x5a0c('0x3d')](_0x40b14c,{'type':db[_0x5a0c('0x6f')][_0x5a0c('0x7f')][_0x5a0c('0x70')],'raw':!![]})[_0x5a0c('0x20')](function(_0x344949){return _0x344949;});})[_0x5a0c('0x20')](function(_0x351bad){if(_0x351bad){_0x14be6a['message'][_0x5a0c('0x71')]=_0x351bad[0x0];if(!_0x3acf1e[_0x5a0c('0x56')][_0x5a0c('0x60')])return;return db[_0x5a0c('0x80')][_0x5a0c('0x55')]({'where':{'id':_0x3acf1e[_0x5a0c('0x56')][_0x5a0c('0x60')],'role':'agent'},'attributes':['id',_0x5a0c('0x35'),'fullname',_0x5a0c('0x73'),_0x5a0c('0x74')],'raw':!![]});}return null;})[_0x5a0c('0x20')](function(_0x5837dc){if(!_0x5837dc)return null;_0x14be6a[_0x5a0c('0x26')][_0x5a0c('0x62')]=_0x5837dc;return _0x14be6a;})[_0x5a0c('0x20')](function(_0x2e12eb){if(_0x2e12eb){_0x2e12eb[_0x5a0c('0x26')][_0x5a0c('0x81')]=util[_0x5a0c('0x5e')]('SIP/%s',_0x3acf1e['user'][_0x5a0c('0x35')]);_0x2e12eb[_0x5a0c('0x26')][_0x5a0c('0x76')]=_0x14be6a[_0x5a0c('0x76')];_0x2e12eb[_0x5a0c('0x26')]['motionChannel']=_0x14be6a[_0x5a0c('0x76')];_0x2e12eb[_0x5a0c('0x26')]['event']=_0x5a0c('0x33');respondWithRpcPromise(_0x5a0c('0x78'),_0x5a0c('0x78'),{'event':_0x5a0c('0x82'),'message':_[_0x5a0c('0x4a')](_0x14be6a['message'],JSON[_0x5a0c('0x7a')](_0x14be6a[_0x5a0c('0x65')][_0x5a0c('0x7b')]))},client9002);return _0x14be6a;}return null;})[_0x5a0c('0x20')](respondWithResult(_0x4e0801,null))['catch'](handleError(_0x4e0801,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 633a00d..9cd8ac1 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 _0x3d9d=['remove','emit','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x3d9d,0x9c));var _0xd3d9=function(_0x11a6bb,_0x39c422){_0x11a6bb=_0x11a6bb-0x0;var _0x1492b1=_0x3d9d[_0x11a6bb];return _0x1492b1;};'use strict';var EventEmitter=require(_0xd3d9('0x0'));var ChatMessage=require(_0xd3d9('0x1'))['db'][_0xd3d9('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd3d9('0x3')](0x0);var events={'afterCreate':_0xd3d9('0x4'),'afterUpdate':_0xd3d9('0x5'),'afterDestroy':_0xd3d9('0x6')};function emitEvent(_0x37cd45){return function(_0x20de98,_0x1c2606,_0x57574d){ChatMessageEvents[_0xd3d9('0x7')](_0x37cd45+':'+_0x20de98['id'],_0x20de98);ChatMessageEvents[_0xd3d9('0x7')](_0x37cd45,_0x20de98);_0x57574d(null);};}for(var e in events){if(events[_0xd3d9('0x8')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x2709=['hook','events','../../mysqldb','save','update','emit','hasOwnProperty'];(function(_0x156234,_0x46f2c1){var _0xc219a7=function(_0x26bbf5){while(--_0x26bbf5){_0x156234['push'](_0x156234['shift']());}};_0xc219a7(++_0x46f2c1);}(_0x2709,0x1eb));var _0x9270=function(_0x493cb8,_0x42359d){_0x493cb8=_0x493cb8-0x0;var _0x54ce1d=_0x2709[_0x493cb8];return _0x54ce1d;};'use strict';var EventEmitter=require(_0x9270('0x0'));var ChatMessage=require(_0x9270('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9270('0x2'),'afterUpdate':_0x9270('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2c23c1){return function(_0x5d62c5,_0x564e43,_0x292a50){ChatMessageEvents['emit'](_0x2c23c1+':'+_0x5d62c5['id'],_0x5d62c5);ChatMessageEvents[_0x9270('0x4')](_0x2c23c1,_0x5d62c5);_0x292a50(null);};}for(var e in events){if(events[_0x9270('0x5')](e)){var event=events[e];ChatMessage[_0x9270('0x6')](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 6363178..e2f46b9 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 _0x4a5e=['bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','error','lodash','util','../../config/logger','moment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4a5e,0x158));var _0xe4a5=function(_0xe6f4ef,_0x4e34cc){_0xe6f4ef=_0xe6f4ef-0x0;var _0x4f3447=_0x4a5e[_0xe6f4ef];return _0x4f3447;};'use strict';var _=require(_0xe4a5('0x0'));var util=require(_0xe4a5('0x1'));var logger=require(_0xe4a5('0x2'))('api');var moment=require(_0xe4a5('0x3'));var BPromise=require(_0xe4a5('0x4'));var rp=require(_0xe4a5('0x5'));var fs=require('fs');var path=require(_0xe4a5('0x6'));var rimraf=require(_0xe4a5('0x7'));var config=require(_0xe4a5('0x8'));var attributes=require(_0xe4a5('0x9'));module['exports']=function(_0x3781a3,_0x13640d){return _0x3781a3[_0xe4a5('0xa')](_0xe4a5('0xb'),attributes,{'tableName':_0xe4a5('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xe4a5('0xd')],'type':_0xe4a5('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5630f5,_0x398baa,_0x25773d){var _0x5dca12=_0x3781a3[_0xe4a5('0xf')];var _0x1a279c=_0x5630f5[_0xe4a5('0x10')]({'plain':!![]});if(_0x1a279c[_0xe4a5('0x11')][_0xe4a5('0x12')]()==='in'||_0x1a279c[_0xe4a5('0x11')]['toLowerCase']()===_0xe4a5('0x13')&&!_0x1a279c[_0xe4a5('0x14')]&&!_[_0xe4a5('0x15')](_0x1a279c[_0xe4a5('0x16')])){_0x5dca12['ChatInteraction'][_0xe4a5('0x17')]({'where':{'id':_0x1a279c[_0xe4a5('0x18')]}})[_0xe4a5('0x19')](function(_0x402b54){if(_0x402b54){_0x402b54[_0xe4a5('0x1a')]({'lastMsgAt':_0x1a279c[_0xe4a5('0x1b')],'lastMsgDirection':_0x1a279c[_0xe4a5('0x11')][_0xe4a5('0x12')]()});}})['catch'](function(_0x1ac77d){console[_0xe4a5('0x1c')](_0x1ac77d);});}_0x25773d();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc30d=['rimraf','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xd0be97,_0x570fd5){var _0x2ad2f8=function(_0x5aaccc){while(--_0x5aaccc){_0xd0be97['push'](_0xd0be97['shift']());}};_0x2ad2f8(++_0x570fd5);}(_0xc30d,0x6e));var _0xdc30=function(_0x2d7a4b,_0xa36b04){_0x2d7a4b=_0x2d7a4b-0x0;var _0x603707=_0xc30d[_0x2d7a4b];return _0x603707;};'use strict';var _=require(_0xdc30('0x0'));var util=require('util');var logger=require(_0xdc30('0x1'))(_0xdc30('0x2'));var moment=require(_0xdc30('0x3'));var BPromise=require(_0xdc30('0x4'));var rp=require(_0xdc30('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc30('0x6'));var config=require('../../config/environment');var attributes=require(_0xdc30('0x7'));module[_0xdc30('0x8')]=function(_0x1d2db4,_0x3e480e){return _0x1d2db4[_0xdc30('0x9')](_0xdc30('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xdc30('0xb'),'fields':[_0xdc30('0xc')],'type':_0xdc30('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xad8d18,_0x1a9c5f,_0x65f596){var _0x38b6fc=_0x1d2db4[_0xdc30('0xe')];var _0x2c4fe1=_0xad8d18['get']({'plain':!![]});if(_0x2c4fe1['direction']['toLowerCase']()==='in'||_0x2c4fe1[_0xdc30('0xf')][_0xdc30('0x10')]()===_0xdc30('0x11')&&!_0x2c4fe1[_0xdc30('0x12')]&&!_[_0xdc30('0x13')](_0x2c4fe1[_0xdc30('0x14')])){_0x38b6fc[_0xdc30('0x15')]['findOne']({'where':{'id':_0x2c4fe1[_0xdc30('0x16')]}})[_0xdc30('0x17')](function(_0x2220e3){if(_0x2220e3){_0x2220e3[_0xdc30('0x18')]({'lastMsgAt':_0x2c4fe1['createdAt'],'lastMsgDirection':_0x2c4fe1[_0xdc30('0xf')][_0xdc30('0x10')]()});}})[_0xdc30('0x19')](function(_0x553b45){console[_0xdc30('0x1a')](_0x553b45);});}_0x65f596();}},'charset':_0xdc30('0x1b'),'collate':_0xdc30('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 857c1ca..b5eb30d 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 _0x1e6a=['ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','CreateChatMessage','ChatMessage','create','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x1e6a,0x135));var _0xa1e6=function(_0x518122,_0x293879){_0x518122=_0x518122-0x0;var _0x26eb6e=_0x1e6a[_0x518122];return _0x26eb6e;};'use strict';var _=require(_0xa1e6('0x0'));var util=require('util');var moment=require(_0xa1e6('0x1'));var BPromise=require(_0xa1e6('0x2'));var rs=require(_0xa1e6('0x3'));var fs=require('fs');var Redis=require(_0xa1e6('0x4'));var db=require(_0xa1e6('0x5'))['db'];var utils=require(_0xa1e6('0x6'));var logger=require(_0xa1e6('0x7'))(_0xa1e6('0x8'));var config=require(_0xa1e6('0x9'));var jayson=require(_0xa1e6('0xa'));var client=jayson[_0xa1e6('0xb')]['http']({'port':0x232a});config[_0xa1e6('0xc')]=_[_0xa1e6('0xd')](config[_0xa1e6('0xc')],{'host':_0xa1e6('0xe'),'port':0x18eb});var socket=require(_0xa1e6('0xf'))(new Redis(config['redis']));require(_0xa1e6('0x10'))[_0xa1e6('0x11')](socket);function respondWithRpcPromise(_0x28ca89,_0x43ed06,_0x42c51a){return new BPromise(function(_0x443db3,_0x241ac3){return client[_0xa1e6('0x12')](_0x28ca89,_0x42c51a)[_0xa1e6('0x13')](function(_0x553902){logger[_0xa1e6('0x14')](_0xa1e6('0x15'),_0x43ed06,'request\x20sent');logger[_0xa1e6('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x43ed06,_0xa1e6('0x17'),JSON[_0xa1e6('0x18')](_0x553902));if(_0x553902[_0xa1e6('0x19')]){if(_0x553902[_0xa1e6('0x19')]['code']===0x1f4){logger[_0xa1e6('0x19')](_0xa1e6('0x15'),_0x43ed06,_0x553902[_0xa1e6('0x19')][_0xa1e6('0x1a')]);return _0x241ac3(_0x553902[_0xa1e6('0x19')][_0xa1e6('0x1a')]);}logger[_0xa1e6('0x19')]('ChatMessage,\x20%s,\x20%s',_0x43ed06,_0x553902['error'][_0xa1e6('0x1a')]);return _0x443db3(_0x553902[_0xa1e6('0x19')][_0xa1e6('0x1a')]);}else{logger[_0xa1e6('0x14')](_0xa1e6('0x15'),_0x43ed06,_0xa1e6('0x17'));_0x443db3(_0x553902['result']['message']);}})[_0xa1e6('0x1b')](function(_0x1ce59e){logger[_0xa1e6('0x19')](_0xa1e6('0x15'),_0x43ed06,_0x1ce59e);_0x241ac3(_0x1ce59e);});});}exports[_0xa1e6('0x1c')]=function(_0x29aa6b){var _0x3d3ed3=this;return new Promise(function(_0x183440,_0x5da910){return db[_0xa1e6('0x1d')][_0xa1e6('0x1e')](_0x29aa6b['body'],{'raw':_0x29aa6b[_0xa1e6('0x1f')]?_0x29aa6b[_0xa1e6('0x1f')][_0xa1e6('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x6c8ebd){logger['info'](_0xa1e6('0x1c'),_0x29aa6b);logger['debug'](_0xa1e6('0x1c'),_0x29aa6b,JSON[_0xa1e6('0x18')](_0x6c8ebd));_0x183440(_0x6c8ebd);})[_0xa1e6('0x1b')](function(_0x2f2c9f){logger[_0xa1e6('0x19')](_0xa1e6('0x1c'),_0x2f2c9f[_0xa1e6('0x1a')],_0x29aa6b);_0x5da910(_0x3d3ed3[_0xa1e6('0x19')](0x1f4,_0x2f2c9f[_0xa1e6('0x1a')]));});});}; \ No newline at end of file +var _0x1f42=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5304cf,_0x1848d4){var _0x1afa02=function(_0x51614e){while(--_0x51614e){_0x5304cf['push'](_0x5304cf['shift']());}};_0x1afa02(++_0x1848d4);}(_0x1f42,0xf5));var _0x21f4=function(_0x3fccf9,_0x456817){_0x3fccf9=_0x3fccf9-0x0;var _0x231b9c=_0x1f42[_0x3fccf9];return _0x231b9c;};'use strict';var _=require(_0x21f4('0x0'));var util=require(_0x21f4('0x1'));var moment=require(_0x21f4('0x2'));var BPromise=require(_0x21f4('0x3'));var rs=require(_0x21f4('0x4'));var fs=require('fs');var Redis=require(_0x21f4('0x5'));var db=require(_0x21f4('0x6'))['db'];var utils=require(_0x21f4('0x7'));var logger=require(_0x21f4('0x8'))('rpc');var config=require(_0x21f4('0x9'));var jayson=require(_0x21f4('0xa'));var client=jayson[_0x21f4('0xb')][_0x21f4('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x21f4('0xd')],{'host':_0x21f4('0xe'),'port':0x18eb});var socket=require(_0x21f4('0xf'))(new Redis(config['redis']));require(_0x21f4('0x10'))[_0x21f4('0x11')](socket);function respondWithRpcPromise(_0x8e65e,_0x24e1b4,_0xd0502f){return new BPromise(function(_0x5014f9,_0xf6adbe){return client[_0x21f4('0x12')](_0x8e65e,_0xd0502f)[_0x21f4('0x13')](function(_0x3f1472){logger['info'](_0x21f4('0x14'),_0x24e1b4,_0x21f4('0x15'));logger[_0x21f4('0x16')](_0x21f4('0x17'),_0x24e1b4,_0x21f4('0x15'),JSON['stringify'](_0x3f1472));if(_0x3f1472[_0x21f4('0x18')]){if(_0x3f1472[_0x21f4('0x18')]['code']===0x1f4){logger[_0x21f4('0x18')]('ChatMessage,\x20%s,\x20%s',_0x24e1b4,_0x3f1472['error']['message']);return _0xf6adbe(_0x3f1472[_0x21f4('0x18')]['message']);}logger[_0x21f4('0x18')](_0x21f4('0x14'),_0x24e1b4,_0x3f1472[_0x21f4('0x18')][_0x21f4('0x19')]);return _0x5014f9(_0x3f1472['error'][_0x21f4('0x19')]);}else{logger[_0x21f4('0x1a')](_0x21f4('0x14'),_0x24e1b4,_0x21f4('0x15'));_0x5014f9(_0x3f1472[_0x21f4('0x1b')][_0x21f4('0x19')]);}})[_0x21f4('0x1c')](function(_0x3e7dfb){logger[_0x21f4('0x18')](_0x21f4('0x14'),_0x24e1b4,_0x3e7dfb);_0xf6adbe(_0x3e7dfb);});});}exports['CreateChatMessage']=function(_0x5d092e){var _0x1ceed1=this;return new Promise(function(_0x4adf2f,_0x50ab39){return db[_0x21f4('0x1d')][_0x21f4('0x1e')](_0x5d092e[_0x21f4('0x1f')],{'raw':_0x5d092e[_0x21f4('0x20')]?_0x5d092e[_0x21f4('0x20')][_0x21f4('0x21')]===undefined?!![]:![]:!![]})[_0x21f4('0x13')](function(_0x248502){logger[_0x21f4('0x1a')]('CreateChatMessage',_0x5d092e);logger['debug'](_0x21f4('0x22'),_0x5d092e,JSON[_0x21f4('0x23')](_0x248502));_0x4adf2f(_0x248502);})[_0x21f4('0x1c')](function(_0x3f1be8){logger['error'](_0x21f4('0x22'),_0x3f1be8[_0x21f4('0x19')],_0x5d092e);_0x50ab39(_0x1ceed1[_0x21f4('0x18')](0x1f4,_0x3f1be8[_0x21f4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 8f1eefa..5613d9c 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 _0x96aa=['update','emit','removeListener','length','chatMessage:','./chatMessage.events','save'];(function(_0x330665,_0x515789){var _0x53feef=function(_0x11ab8f){while(--_0x11ab8f){_0x330665['push'](_0x330665['shift']());}};_0x53feef(++_0x515789);}(_0x96aa,0x67));var _0xa96a=function(_0x4d00ef,_0x3087a2){_0x4d00ef=_0x4d00ef-0x0;var _0x1e67b3=_0x96aa[_0x4d00ef];return _0x1e67b3;};'use strict';var ChatMessageEvents=require(_0xa96a('0x0'));var events=[_0xa96a('0x1'),'remove',_0xa96a('0x2')];function createListener(_0x32bff8,_0x227d50){return function(_0x12bbb7){_0x227d50[_0xa96a('0x3')](_0x32bff8,_0x12bbb7);};}function removeListener(_0x4911c8,_0x1ce4a1){return function(){ChatMessageEvents[_0xa96a('0x4')](_0x4911c8,_0x1ce4a1);};}exports['register']=function(_0x464684){for(var _0x2e9a41=0x0,_0x282c8c=events[_0xa96a('0x5')];_0x2e9a41<_0x282c8c;_0x2e9a41++){var _0x44fb9d=events[_0x2e9a41];var _0x3c7329=createListener(_0xa96a('0x6')+_0x44fb9d,_0x464684);ChatMessageEvents['on'](_0x44fb9d,_0x3c7329);}}; \ No newline at end of file +var _0xaa19=['length','./chatMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x9bfc6c,_0x159ef2){var _0x1f8376=function(_0x475856){while(--_0x475856){_0x9bfc6c['push'](_0x9bfc6c['shift']());}};_0x1f8376(++_0x159ef2);}(_0xaa19,0x79));var _0x9aa1=function(_0x1e8136,_0x188332){_0x1e8136=_0x1e8136-0x0;var _0x5ada0d=_0xaa19[_0x1e8136];return _0x5ada0d;};'use strict';var ChatMessageEvents=require(_0x9aa1('0x0'));var events=[_0x9aa1('0x1'),_0x9aa1('0x2'),_0x9aa1('0x3')];function createListener(_0x4af2e4,_0x343b95){return function(_0x5371a9){_0x343b95[_0x9aa1('0x4')](_0x4af2e4,_0x5371a9);};}function removeListener(_0x58fb46,_0x11fd1b){return function(){ChatMessageEvents[_0x9aa1('0x5')](_0x58fb46,_0x11fd1b);};}exports[_0x9aa1('0x6')]=function(_0x52124b){for(var _0x1e59f8=0x0,_0x473aa0=events[_0x9aa1('0x7')];_0x1e59f8<_0x473aa0;_0x1e59f8++){var _0x5363e3=events[_0x1e59f8];var _0x302408=createListener('chatMessage:'+_0x5363e3,_0x52124b);ChatMessageEvents['on'](_0x5363e3,_0x302408);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 1271a53..69d9dd5 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 _0x40a1=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','isAuthenticated','describe','/:id','show','tracked','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports'];(function(_0x6c4358,_0x17bcbb){var _0x7aa4ef=function(_0x3ddd15){while(--_0x3ddd15){_0x6c4358['push'](_0x6c4358['shift']());}};_0x7aa4ef(++_0x17bcbb);}(_0x40a1,0x10e));var _0x140a=function(_0x1e3572,_0x12a24b){_0x1e3572=_0x1e3572-0x0;var _0x9fafc=_0x40a1[_0x1e3572];return _0x9fafc;};'use strict';var multer=require(_0x140a('0x0'));var util=require(_0x140a('0x1'));var path=require(_0x140a('0x2'));var timeout=require(_0x140a('0x3'));var express=require(_0x140a('0x4'));var router=express[_0x140a('0x5')]();var fs_extra=require(_0x140a('0x6'));var auth=require(_0x140a('0x7'));var interaction=require(_0x140a('0x8'));var config=require(_0x140a('0x9'));var controller=require(_0x140a('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x140a('0xb')]);router[_0x140a('0xc')]('/describe',auth[_0x140a('0xd')](),controller[_0x140a('0xe')]);router[_0x140a('0xc')](_0x140a('0xf'),auth['isAuthenticated'](),controller[_0x140a('0x10')]);router['post']('/',auth[_0x140a('0xd')](),interaction[_0x140a('0x11')]('chat',_0x140a('0x12')),controller['create']);router[_0x140a('0x13')](_0x140a('0xf'),controller[_0x140a('0x14')]);router[_0x140a('0x13')](_0x140a('0x15'),auth[_0x140a('0xd')](),controller[_0x140a('0x16')]);router[_0x140a('0x13')](_0x140a('0x17'),auth[_0x140a('0xd')](),controller[_0x140a('0x18')]);router['delete'](_0x140a('0xf'),auth[_0x140a('0xd')](),controller[_0x140a('0x19')]);module[_0x140a('0x1a')]=router; \ No newline at end of file +var _0xe1b7=['Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','post','create','put','/:id','/:id/accept','accept','destroy','exports','util','path','connect-timeout','express'];(function(_0x190e6d,_0x8e29c1){var _0x4e721e=function(_0x54ed17){while(--_0x54ed17){_0x190e6d['push'](_0x190e6d['shift']());}};_0x4e721e(++_0x8e29c1);}(_0xe1b7,0xba));var _0x7e1b=function(_0x128440,_0xeaccfa){_0x128440=_0x128440-0x0;var _0x3cb264=_0xe1b7[_0x128440];return _0x3cb264;};'use strict';var multer=require('multer');var util=require(_0x7e1b('0x0'));var path=require(_0x7e1b('0x1'));var timeout=require(_0x7e1b('0x2'));var express=require(_0x7e1b('0x3'));var router=express[_0x7e1b('0x4')]();var fs_extra=require(_0x7e1b('0x5'));var auth=require(_0x7e1b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0x7e1b('0x7')]('/',auth[_0x7e1b('0x8')](),controller[_0x7e1b('0x9')]);router[_0x7e1b('0x7')](_0x7e1b('0xa'),auth[_0x7e1b('0x8')](),controller['describe']);router['get']('/:id',auth[_0x7e1b('0x8')](),controller['show']);router[_0x7e1b('0xb')]('/',auth['isAuthenticated'](),interaction['tracked']('chat','chatmessage:create'),controller[_0x7e1b('0xc')]);router[_0x7e1b('0xd')](_0x7e1b('0xe'),controller['update']);router['put'](_0x7e1b('0xf'),auth[_0x7e1b('0x8')](),controller[_0x7e1b('0x10')]);router[_0x7e1b('0xd')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router['delete'](_0x7e1b('0xe'),auth[_0x7e1b('0x8')](),controller[_0x7e1b('0x11')]);module[_0x7e1b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index d194e8b..38e8086 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 _0x2032=['medium','exports','TEXT'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0x2032,0xd9));var _0x2203=function(_0x2c31d3,_0x1323fc){_0x2c31d3=_0x2c31d3-0x0;var _0x22c330=_0x2032[_0x2c31d3];return _0x22c330;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x5f66=['medium','TEXT','exports'];(function(_0x4a5a3c,_0x443f2d){var _0x1805d6=function(_0x1d0be0){while(--_0x1d0be0){_0x4a5a3c['push'](_0x4a5a3c['shift']());}};_0x1805d6(++_0x443f2d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 85f80cb..bb0c027 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(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x7a54,0x106));var _0x47a5=function(_0x45bf96,_0x5a4dd7){_0x45bf96=_0x45bf96-0x0;var _0x488a0c=_0x7a54[_0x45bf96];return _0x488a0c;};'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(_0x551b54,_0x541977){var _0x40789a=function(_0x52221f){while(--_0x52221f){_0x551b54['push'](_0x551b54['shift']());}};_0x40789a(++_0x541977);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index d9252c5..2e83301 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 _0x9888=['../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x186d35,_0x2cdd9b){var _0x341737=function(_0x166719){while(--_0x166719){_0x186d35['push'](_0x186d35['shift']());}};_0x341737(++_0x2cdd9b);}(_0x9888,0xd0));var _0x8988=function(_0x2ba691,_0x1886f9){_0x2ba691=_0x2ba691-0x0;var _0x5f4202=_0x9888[_0x2ba691];return _0x5f4202;};'use strict';var EventEmitter=require(_0x8988('0x0'));var ChatOfflineMessage=require(_0x8988('0x1'))['db'][_0x8988('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x8988('0x3')](0x0);var events={'afterCreate':_0x8988('0x4'),'afterUpdate':_0x8988('0x5'),'afterDestroy':_0x8988('0x6')};function emitEvent(_0xee07a5){return function(_0x24a255,_0x3e4d04,_0x25862f){ChatOfflineMessageEvents[_0x8988('0x7')](_0xee07a5+':'+_0x24a255['id'],_0x24a255);ChatOfflineMessageEvents[_0x8988('0x7')](_0xee07a5,_0x24a255);_0x25862f(null);};}for(var e in events){if(events[_0x8988('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x8988('0x9')](e,emitEvent(event));}}module[_0x8988('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x882a=['hasOwnProperty','events','../../mysqldb','save','update','emit'];(function(_0x10e983,_0x2f4eda){var _0x324138=function(_0x17a377){while(--_0x17a377){_0x10e983['push'](_0x10e983['shift']());}};_0x324138(++_0x2f4eda);}(_0x882a,0xc7));var _0xa882=function(_0x48c199,_0x38fac1){_0x48c199=_0x48c199-0x0;var _0x30296c=_0x882a[_0x48c199];return _0x30296c;};'use strict';var EventEmitter=require(_0xa882('0x0'));var ChatOfflineMessage=require(_0xa882('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa882('0x2'),'afterUpdate':_0xa882('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3c5051){return function(_0x126b9a,_0x2355bc,_0x24657e){ChatOfflineMessageEvents[_0xa882('0x4')](_0x3c5051+':'+_0x126b9a['id'],_0x126b9a);ChatOfflineMessageEvents[_0xa882('0x4')](_0x3c5051,_0x126b9a);_0x24657e(null);};}for(var e in events){if(events[_0xa882('0x5')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 034f141..215fba9 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 _0x78c5=['exports','define','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0x78c5,0x130));var _0x578c=function(_0x18c618,_0x484959){_0x18c618=_0x18c618-0x0;var _0x4c1381=_0x78c5[_0x18c618];return _0x4c1381;};'use strict';var attributes=require(_0x578c('0x0'));module[_0x578c('0x1')]=function(_0x1455c8){return _0x1455c8[_0x578c('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x578c('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x578c('0x4'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9e13=['ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x457501,_0x9eacca){var _0x47ab95=function(_0x336aad){while(--_0x336aad){_0x457501['push'](_0x457501['shift']());}};_0x47ab95(++_0x9eacca);}(_0x9e13,0x102));var _0x39e1=function(_0x1faf2d,_0x418fe6){_0x1faf2d=_0x1faf2d-0x0;var _0x4b77d4=_0x9e13[_0x1faf2d];return _0x4b77d4;};'use strict';var attributes=require(_0x39e1('0x0'));module[_0x39e1('0x1')]=function(_0x164f5e){return _0x164f5e['define'](_0x39e1('0x2'),attributes,{'tableName':_0x39e1('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x39e1('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 783a5b9..b28da8e 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 _0x0d64=['then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x3c4f4f,_0x4aa56f){var _0x3cb6cc=function(_0x379f5f){while(--_0x379f5f){_0x3c4f4f['push'](_0x3c4f4f['shift']());}};_0x3cb6cc(++_0x4aa56f);}(_0x0d64,0x1c4));var _0x40d6=function(_0x451655,_0x1be29f){_0x451655=_0x451655-0x0;var _0x2bdf91=_0x0d64[_0x451655];return _0x2bdf91;};'use strict';var _=require('lodash');var util=require(_0x40d6('0x0'));var moment=require(_0x40d6('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40d6('0x2'));var db=require(_0x40d6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x40d6('0x4'))(_0x40d6('0x5'));var config=require('../../config/environment');var jayson=require(_0x40d6('0x6'));var client=jayson[_0x40d6('0x7')][_0x40d6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x483a47,_0x586a2e,_0x1edd89){return new BPromise(function(_0x448ce2,_0x2ac99f){return client[_0x40d6('0x9')](_0x483a47,_0x1edd89)[_0x40d6('0xa')](function(_0x1faf99){logger[_0x40d6('0xb')](_0x40d6('0xc'),_0x586a2e,'request\x20sent');logger[_0x40d6('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x586a2e,_0x40d6('0xe'),JSON[_0x40d6('0xf')](_0x1faf99));if(_0x1faf99['error']){if(_0x1faf99['error'][_0x40d6('0x10')]===0x1f4){logger[_0x40d6('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x586a2e,_0x1faf99['error']['message']);return _0x2ac99f(_0x1faf99[_0x40d6('0x11')][_0x40d6('0x12')]);}logger[_0x40d6('0x11')](_0x40d6('0xc'),_0x586a2e,_0x1faf99[_0x40d6('0x11')][_0x40d6('0x12')]);return _0x448ce2(_0x1faf99[_0x40d6('0x11')][_0x40d6('0x12')]);}else{logger[_0x40d6('0xb')](_0x40d6('0xc'),_0x586a2e,_0x40d6('0xe'));_0x448ce2(_0x1faf99[_0x40d6('0x13')][_0x40d6('0x12')]);}})[_0x40d6('0x14')](function(_0x2b5000){logger[_0x40d6('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x586a2e,_0x2b5000);_0x2ac99f(_0x2b5000);});});} \ No newline at end of file +var _0xed20=['bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash'];(function(_0x262f36,_0x54bd2d){var _0x355624=function(_0x1b84f5){while(--_0x1b84f5){_0x262f36['push'](_0x262f36['shift']());}};_0x355624(++_0x54bd2d);}(_0xed20,0x1b9));var _0x0ed2=function(_0x34b50f,_0x3713fa){_0x34b50f=_0x34b50f-0x0;var _0x324183=_0xed20[_0x34b50f];return _0x324183;};'use strict';var _=require(_0x0ed2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0ed2('0x1'));var rs=require(_0x0ed2('0x2'));var fs=require('fs');var Redis=require(_0x0ed2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0ed2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0ed2('0x5'));var client=jayson[_0x0ed2('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35f80f,_0x1847c6,_0x17c085){return new BPromise(function(_0x2fbb7d,_0x15a400){return client[_0x0ed2('0x7')](_0x35f80f,_0x17c085)[_0x0ed2('0x8')](function(_0x101f28){logger[_0x0ed2('0x9')](_0x0ed2('0xa'),_0x1847c6,'request\x20sent');logger['debug'](_0x0ed2('0xb'),_0x1847c6,_0x0ed2('0xc'),JSON['stringify'](_0x101f28));if(_0x101f28['error']){if(_0x101f28[_0x0ed2('0xd')][_0x0ed2('0xe')]===0x1f4){logger[_0x0ed2('0xd')](_0x0ed2('0xa'),_0x1847c6,_0x101f28[_0x0ed2('0xd')][_0x0ed2('0xf')]);return _0x15a400(_0x101f28[_0x0ed2('0xd')][_0x0ed2('0xf')]);}logger[_0x0ed2('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1847c6,_0x101f28[_0x0ed2('0xd')][_0x0ed2('0xf')]);return _0x2fbb7d(_0x101f28[_0x0ed2('0xd')][_0x0ed2('0xf')]);}else{logger[_0x0ed2('0x9')](_0x0ed2('0xa'),_0x1847c6,_0x0ed2('0xc'));_0x2fbb7d(_0x101f28['result'][_0x0ed2('0xf')]);}})[_0x0ed2('0x10')](function(_0x1c5079){logger[_0x0ed2('0xd')](_0x0ed2('0xa'),_0x1847c6,_0x1c5079);_0x15a400(_0x1c5079);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 82de335..15d44e9 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 _0xc0e9=['update','delete','/:id','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','index','/describe','isAuthenticated','describe','show','post','create','put'];(function(_0x5c0de0,_0x28b5e8){var _0x4242a7=function(_0x23a316){while(--_0x23a316){_0x5c0de0['push'](_0x5c0de0['shift']());}};_0x4242a7(++_0x28b5e8);}(_0xc0e9,0xb8));var _0x9c0e=function(_0xcb17a8,_0x12548e){_0xcb17a8=_0xcb17a8-0x0;var _0x9aa364=_0xc0e9[_0xcb17a8];return _0x9aa364;};'use strict';var multer=require(_0x9c0e('0x0'));var util=require('util');var path=require(_0x9c0e('0x1'));var timeout=require(_0x9c0e('0x2'));var express=require('express');var router=express[_0x9c0e('0x3')]();var fs_extra=require(_0x9c0e('0x4'));var auth=require(_0x9c0e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c0e('0x6'));var controller=require(_0x9c0e('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9c0e('0x8')]);router['get'](_0x9c0e('0x9'),auth[_0x9c0e('0xa')](),controller[_0x9c0e('0xb')]);router['get']('/:id',auth[_0x9c0e('0xa')](),controller[_0x9c0e('0xc')]);router[_0x9c0e('0xd')]('/',auth['isAuthenticated'](),controller[_0x9c0e('0xe')]);router[_0x9c0e('0xf')]('/:id',auth[_0x9c0e('0xa')](),controller[_0x9c0e('0x10')]);router[_0x9c0e('0x11')](_0x9c0e('0x12'),auth['isAuthenticated'](),controller[_0x9c0e('0x13')]);module['exports']=router; \ No newline at end of file +var _0x97a0=['../../config/environment','get','isAuthenticated','/describe','describe','show','post','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x682667,_0x3e1b08){var _0x174148=function(_0xb5d738){while(--_0xb5d738){_0x682667['push'](_0x682667['shift']());}};_0x174148(++_0x3e1b08);}(_0x97a0,0x84));var _0x097a=function(_0x4da434,_0x1cc9fe){_0x4da434=_0x4da434-0x0;var _0x53e4b2=_0x97a0[_0x4da434];return _0x53e4b2;};'use strict';var multer=require(_0x097a('0x0'));var util=require('util');var path=require(_0x097a('0x1'));var timeout=require(_0x097a('0x2'));var express=require(_0x097a('0x3'));var router=express[_0x097a('0x4')]();var fs_extra=require(_0x097a('0x5'));var auth=require(_0x097a('0x6'));var interaction=require(_0x097a('0x7'));var config=require(_0x097a('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x097a('0x9')]('/',auth[_0x097a('0xa')](),controller['index']);router[_0x097a('0x9')](_0x097a('0xb'),auth[_0x097a('0xa')](),controller[_0x097a('0xc')]);router[_0x097a('0x9')]('/:id',auth[_0x097a('0xa')](),controller[_0x097a('0xd')]);router[_0x097a('0xe')]('/',auth[_0x097a('0xa')](),controller['create']);router[_0x097a('0xf')](_0x097a('0x10'),auth['isAuthenticated'](),controller[_0x097a('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x097a('0x12')]);module[_0x097a('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 4259225..50c0b39 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 _0x5d4c=['sequelize','exports','STRING','mouseOver','INTEGER'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x5d4c,0xfa));var _0xc5d4=function(_0x23a44e,_0x1e5b0b){_0x23a44e=_0x23a44e-0x0;var _0x4cfb30=_0x5d4c[_0x23a44e];return _0x4cfb30;};'use strict';var Sequelize=require(_0xc5d4('0x0'));module[_0xc5d4('0x1')]={'name':{'type':Sequelize[_0xc5d4('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc5d4('0x3'),'timeout'),'defaultValue':_0xc5d4('0x3')},'selector':{'type':Sequelize[_0xc5d4('0x2')]},'timeout':{'type':Sequelize[_0xc5d4('0x4')]}}; \ No newline at end of file +var _0x0bef=['mouseOver','exports','STRING','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bef,0x95));var _0xf0be=function(_0x3a15c8,_0x50be54){_0x3a15c8=_0x3a15c8-0x0;var _0x33de16=_0x0bef[_0x3a15c8];return _0x33de16;};'use strict';var Sequelize=require('sequelize');module[_0xf0be('0x0')]={'name':{'type':Sequelize[_0xf0be('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf0be('0x2')](_0xf0be('0x3'),'timeout'),'defaultValue':_0xf0be('0x3')},'selector':{'type':Sequelize[_0xf0be('0x1')]},'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 5846803..dd72367 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 _0xb1a3=['limit','count','set','Content-Range','json','reject','save','then','destroy','end','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined'];(function(_0x32189c,_0x4fa006){var _0x8da8f1=function(_0x239113){while(--_0x239113){_0x32189c['push'](_0x32189c['shift']());}};_0x8da8f1(++_0x4fa006);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0xb1a3[_0xfcbcb8];return _0x1b1f97;};'use strict';var emlformat=require(_0x3b1a('0x0'));var rimraf=require(_0x3b1a('0x1'));var zipdir=require(_0x3b1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b1a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3b1a('0x4'));var util=require(_0x3b1a('0x5'));var path=require(_0x3b1a('0x6'));var sox=require(_0x3b1a('0x7'));var csv=require(_0x3b1a('0x8'));var ejs=require(_0x3b1a('0x9'));var fs=require('fs');var fs_extra=require(_0x3b1a('0xa'));var _=require('lodash');var squel=require(_0x3b1a('0xb'));var crypto=require(_0x3b1a('0xc'));var jsforce=require(_0x3b1a('0xd'));var deskjs=require(_0x3b1a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3b1a('0xf'));var Redis=require(_0x3b1a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3b1a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b1a('0x12'));var logger=require('../../config/logger')(_0x3b1a('0x13'));var utils=require(_0x3b1a('0x14'));var config=require(_0x3b1a('0x15'));var licenseUtil=require(_0x3b1a('0x16'));var db=require(_0x3b1a('0x17'))['db'];function respondWithStatusCode(_0x1fea99,_0x2bd423){_0x2bd423=_0x2bd423||0xcc;return function(_0x32e77a){if(_0x32e77a){return _0x1fea99[_0x3b1a('0x18')](_0x2bd423);}return _0x1fea99['status'](_0x2bd423)['end']();};}function respondWithResult(_0x8aad4b,_0x3dfeda){_0x3dfeda=_0x3dfeda||0xc8;return function(_0x19c135){if(_0x19c135){return _0x8aad4b[_0x3b1a('0x19')](_0x3dfeda)['json'](_0x19c135);}};}function respondWithFilteredResult(_0x1b175e,_0x2f0674){return function(_0x55ac06){if(_0x55ac06){var _0x19bbc1=typeof _0x2f0674[_0x3b1a('0x1a')]===_0x3b1a('0x1b')&&typeof _0x2f0674[_0x3b1a('0x1c')]===_0x3b1a('0x1b');var _0xf10b60=_0x55ac06[_0x3b1a('0x1d')];var _0x220869=_0x19bbc1?0x0:_0x2f0674['offset'];var _0x14996f=_0x19bbc1?_0x55ac06[_0x3b1a('0x1d')]:_0x2f0674['offset']+_0x2f0674[_0x3b1a('0x1c')];var _0x5758fd;if(_0x14996f>=_0xf10b60){_0x14996f=_0xf10b60;_0x5758fd=0xc8;}else{_0x5758fd=0xce;}_0x1b175e[_0x3b1a('0x19')](_0x5758fd);return _0x1b175e[_0x3b1a('0x1e')](_0x3b1a('0x1f'),_0x220869+'-'+_0x14996f+'/'+_0xf10b60)[_0x3b1a('0x20')](_0x55ac06);}return null;};}function patchUpdates(_0xe1113d){return function(_0x13eeec){try{jsonpatch['apply'](_0x13eeec,_0xe1113d,!![]);}catch(_0x2c0a87){return BPromise[_0x3b1a('0x21')](_0x2c0a87);}return _0x13eeec[_0x3b1a('0x22')]();};}function saveUpdates(_0x1a09f1,_0x42bdf6){return function(_0x4f5f52){if(_0x4f5f52){return _0x4f5f52['update'](_0x1a09f1)[_0x3b1a('0x23')](function(_0x447d94){return _0x447d94;});}return null;};}function removeEntity(_0x5829ea,_0x3af980){return function(_0x1728df){if(_0x1728df){return _0x1728df[_0x3b1a('0x24')]()[_0x3b1a('0x23')](function(){_0x5829ea['status'](0xcc)[_0x3b1a('0x25')]();});}};}function handleEntityNotFound(_0x417c2e,_0x2fbac5){return function(_0x482484){if(!_0x482484){_0x417c2e[_0x3b1a('0x18')](0x194);}return _0x482484;};}function handleError(_0x3744f0,_0x155d77){_0x155d77=_0x155d77||0x1f4;return function(_0x45ebfc){logger[_0x3b1a('0x26')](_0x45ebfc[_0x3b1a('0x27')]);if(_0x45ebfc['name']){delete _0x45ebfc[_0x3b1a('0x28')];}_0x3744f0[_0x3b1a('0x19')](_0x155d77)[_0x3b1a('0x29')](_0x45ebfc);};}exports[_0x3b1a('0x2a')]=function(_0x2ff415,_0x1c6399){var _0x5cb4d0={'raw':!![],'where':{'id':_0x2ff415[_0x3b1a('0x2b')]['id']}},_0x58aec7={};_0x58aec7[_0x3b1a('0x2c')]=_[_0x3b1a('0x2d')](db[_0x3b1a('0x2e')][_0x3b1a('0x2f')]);_0x58aec7[_0x3b1a('0x30')]=_[_0x3b1a('0x2d')](_0x2ff415[_0x3b1a('0x30')]);_0x58aec7[_0x3b1a('0x31')]=_['intersection'](_0x58aec7[_0x3b1a('0x2c')],_0x58aec7[_0x3b1a('0x30')]);_0x5cb4d0[_0x3b1a('0x32')]=_[_0x3b1a('0x33')](_0x58aec7[_0x3b1a('0x2c')],qs[_0x3b1a('0x34')](_0x2ff415[_0x3b1a('0x30')][_0x3b1a('0x34')]));_0x5cb4d0[_0x3b1a('0x32')]=_0x5cb4d0['attributes'][_0x3b1a('0x35')]?_0x5cb4d0[_0x3b1a('0x32')]:_0x58aec7[_0x3b1a('0x2c')];if(_0x2ff415[_0x3b1a('0x30')]['includeAll']){_0x5cb4d0[_0x3b1a('0x36')]=[{'all':!![]}];}_0x5cb4d0=_[_0x3b1a('0x37')]({},_0x5cb4d0,_0x2ff415[_0x3b1a('0x38')]);return db[_0x3b1a('0x2e')][_0x3b1a('0x39')](_0x5cb4d0)[_0x3b1a('0x23')](handleEntityNotFound(_0x1c6399,null))[_0x3b1a('0x23')](respondWithResult(_0x1c6399,null))[_0x3b1a('0x3a')](handleError(_0x1c6399,null));};exports['create']=function(_0x189e00,_0x2be45d){return db[_0x3b1a('0x2e')][_0x3b1a('0x3b')](_0x189e00[_0x3b1a('0x3c')],{})[_0x3b1a('0x23')](respondWithResult(_0x2be45d,0xc9))[_0x3b1a('0x3a')](handleError(_0x2be45d,null));};exports['update']=function(_0x3c2108,_0x420d13){if(_0x3c2108[_0x3b1a('0x3c')]['id']){delete _0x3c2108[_0x3b1a('0x3c')]['id'];}return db['ChatProactiveAction'][_0x3b1a('0x39')]({'where':{'id':_0x3c2108[_0x3b1a('0x2b')]['id']}})[_0x3b1a('0x23')](handleEntityNotFound(_0x420d13,null))[_0x3b1a('0x23')](saveUpdates(_0x3c2108[_0x3b1a('0x3c')],null))[_0x3b1a('0x23')](respondWithResult(_0x420d13,null))[_0x3b1a('0x3a')](handleError(_0x420d13,null));};exports[_0x3b1a('0x24')]=function(_0x228667,_0x5277bb){return db[_0x3b1a('0x2e')][_0x3b1a('0x39')]({'where':{'id':_0x228667['params']['id']}})[_0x3b1a('0x23')](handleEntityNotFound(_0x5277bb,null))[_0x3b1a('0x23')](removeEntity(_0x5277bb,null))[_0x3b1a('0x3a')](handleError(_0x5277bb,null));}; \ No newline at end of file +var _0xbacb=['params','model','ChatProactiveAction','rawAttributes','query','keys','filters','attributes','fields','include','merge','options','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send'];(function(_0x32111c,_0x2c2983){var _0x54a797=function(_0x2291a1){while(--_0x2291a1){_0x32111c['push'](_0x32111c['shift']());}};_0x54a797(++_0x2c2983);}(_0xbacb,0x1a6));var _0xbbac=function(_0x12db7d,_0x5b8bfc){_0x12db7d=_0x12db7d-0x0;var _0x5336ce=_0xbacb[_0x12db7d];return _0x5336ce;};'use strict';var emlformat=require(_0xbbac('0x0'));var rimraf=require(_0xbbac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbac('0x2'));var rp=require(_0xbbac('0x3'));var moment=require(_0xbbac('0x4'));var BPromise=require(_0xbbac('0x5'));var Mustache=require(_0xbbac('0x6'));var util=require(_0xbbac('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xbbac('0x8'));var ejs=require(_0xbbac('0x9'));var fs=require('fs');var fs_extra=require(_0xbbac('0xa'));var _=require(_0xbbac('0xb'));var squel=require('squel');var crypto=require(_0xbbac('0xc'));var jsforce=require(_0xbbac('0xd'));var deskjs=require(_0xbbac('0xe'));var toCsv=require(_0xbbac('0x8'));var querystring=require(_0xbbac('0xf'));var Papa=require(_0xbbac('0x10'));var Redis=require('ioredis');var authService=require(_0xbbac('0x11'));var qs=require(_0xbbac('0x12'));var as=require(_0xbbac('0x13'));var hardwareService=require(_0xbbac('0x14'));var logger=require(_0xbbac('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xbbac('0x16'));var licenseUtil=require(_0xbbac('0x17'));var db=require(_0xbbac('0x18'))['db'];function respondWithStatusCode(_0x480405,_0x8a7118){_0x8a7118=_0x8a7118||0xcc;return function(_0x5de0a7){if(_0x5de0a7){return _0x480405[_0xbbac('0x19')](_0x8a7118);}return _0x480405[_0xbbac('0x1a')](_0x8a7118)['end']();};}function respondWithResult(_0x304acc,_0x24123b){_0x24123b=_0x24123b||0xc8;return function(_0x487693){if(_0x487693){return _0x304acc[_0xbbac('0x1a')](_0x24123b)[_0xbbac('0x1b')](_0x487693);}};}function respondWithFilteredResult(_0x2d60b2,_0x131207){return function(_0x58d599){if(_0x58d599){var _0x25beac=typeof _0x131207[_0xbbac('0x1c')]===_0xbbac('0x1d')&&typeof _0x131207[_0xbbac('0x1e')]===_0xbbac('0x1d');var _0x597916=_0x58d599['count'];var _0x1ed67d=_0x25beac?0x0:_0x131207[_0xbbac('0x1c')];var _0x3e133c=_0x25beac?_0x58d599['count']:_0x131207['offset']+_0x131207[_0xbbac('0x1e')];var _0x39d6c7;if(_0x3e133c>=_0x597916){_0x3e133c=_0x597916;_0x39d6c7=0xc8;}else{_0x39d6c7=0xce;}_0x2d60b2[_0xbbac('0x1a')](_0x39d6c7);return _0x2d60b2[_0xbbac('0x1f')](_0xbbac('0x20'),_0x1ed67d+'-'+_0x3e133c+'/'+_0x597916)[_0xbbac('0x1b')](_0x58d599);}return null;};}function patchUpdates(_0x1de1e1){return function(_0x355543){try{jsonpatch[_0xbbac('0x21')](_0x355543,_0x1de1e1,!![]);}catch(_0x4cca95){return BPromise[_0xbbac('0x22')](_0x4cca95);}return _0x355543['save']();};}function saveUpdates(_0x389e73,_0x112376){return function(_0x5e1d58){if(_0x5e1d58){return _0x5e1d58[_0xbbac('0x23')](_0x389e73)['then'](function(_0x2ee598){return _0x2ee598;});}return null;};}function removeEntity(_0x25514d,_0x46e6ba){return function(_0x155d3b){if(_0x155d3b){return _0x155d3b[_0xbbac('0x24')]()[_0xbbac('0x25')](function(){_0x25514d[_0xbbac('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11fdf4,_0x24a77f){return function(_0x3ead07){if(!_0x3ead07){_0x11fdf4[_0xbbac('0x19')](0x194);}return _0x3ead07;};}function handleError(_0x4bb179,_0x448ad5){_0x448ad5=_0x448ad5||0x1f4;return function(_0x19681c){logger[_0xbbac('0x26')](_0x19681c[_0xbbac('0x27')]);if(_0x19681c[_0xbbac('0x28')]){delete _0x19681c['name'];}_0x4bb179[_0xbbac('0x1a')](_0x448ad5)[_0xbbac('0x29')](_0x19681c);};}exports['show']=function(_0x4c1497,_0x15e60e){var _0x48e768={'raw':!![],'where':{'id':_0x4c1497[_0xbbac('0x2a')]['id']}},_0x10c4ae={};_0x10c4ae[_0xbbac('0x2b')]=_['keys'](db[_0xbbac('0x2c')][_0xbbac('0x2d')]);_0x10c4ae[_0xbbac('0x2e')]=_[_0xbbac('0x2f')](_0x4c1497[_0xbbac('0x2e')]);_0x10c4ae[_0xbbac('0x30')]=_['intersection'](_0x10c4ae['model'],_0x10c4ae[_0xbbac('0x2e')]);_0x48e768[_0xbbac('0x31')]=_['intersection'](_0x10c4ae[_0xbbac('0x2b')],qs[_0xbbac('0x32')](_0x4c1497['query'][_0xbbac('0x32')]));_0x48e768[_0xbbac('0x31')]=_0x48e768[_0xbbac('0x31')]['length']?_0x48e768[_0xbbac('0x31')]:_0x10c4ae[_0xbbac('0x2b')];if(_0x4c1497[_0xbbac('0x2e')]['includeAll']){_0x48e768[_0xbbac('0x33')]=[{'all':!![]}];}_0x48e768=_[_0xbbac('0x34')]({},_0x48e768,_0x4c1497[_0xbbac('0x35')]);return db['ChatProactiveAction']['find'](_0x48e768)['then'](handleEntityNotFound(_0x15e60e,null))[_0xbbac('0x25')](respondWithResult(_0x15e60e,null))[_0xbbac('0x36')](handleError(_0x15e60e,null));};exports[_0xbbac('0x37')]=function(_0x1682d4,_0x496a4b){return db['ChatProactiveAction'][_0xbbac('0x37')](_0x1682d4[_0xbbac('0x38')],{})[_0xbbac('0x25')](respondWithResult(_0x496a4b,0xc9))[_0xbbac('0x36')](handleError(_0x496a4b,null));};exports[_0xbbac('0x23')]=function(_0xc167fd,_0x295f30){if(_0xc167fd['body']['id']){delete _0xc167fd[_0xbbac('0x38')]['id'];}return db[_0xbbac('0x2c')]['find']({'where':{'id':_0xc167fd['params']['id']}})[_0xbbac('0x25')](handleEntityNotFound(_0x295f30,null))['then'](saveUpdates(_0xc167fd['body'],null))['then'](respondWithResult(_0x295f30,null))[_0xbbac('0x36')](handleError(_0x295f30,null));};exports[_0xbbac('0x24')]=function(_0x586e49,_0x2bfa0b){return db[_0xbbac('0x2c')][_0xbbac('0x39')]({'where':{'id':_0x586e49[_0xbbac('0x2a')]['id']}})[_0xbbac('0x25')](handleEntityNotFound(_0x2bfa0b,null))[_0xbbac('0x25')](removeEntity(_0x2bfa0b,null))[_0xbbac('0x36')](handleError(_0x2bfa0b,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 6f20255..2df890d 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 _0x1544=['exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatProactiveAction.attributes'];(function(_0x2c1256,_0x3f5700){var _0x199a61=function(_0x14ce69){while(--_0x14ce69){_0x2c1256['push'](_0x2c1256['shift']());}};_0x199a61(++_0x3f5700);}(_0x1544,0x93));var _0x4154=function(_0x25c43c,_0x3a3aa3){_0x25c43c=_0x25c43c-0x0;var _0x28e108=_0x1544[_0x25c43c];return _0x28e108;};'use strict';var _=require(_0x4154('0x0'));var util=require(_0x4154('0x1'));var logger=require(_0x4154('0x2'))(_0x4154('0x3'));var moment=require(_0x4154('0x4'));var BPromise=require('bluebird');var rp=require(_0x4154('0x5'));var fs=require('fs');var path=require(_0x4154('0x6'));var rimraf=require('rimraf');var config=require(_0x4154('0x7'));var attributes=require(_0x4154('0x8'));module[_0x4154('0x9')]=function(_0x37c817,_0x1213a3){return _0x37c817[_0x4154('0xa')](_0x4154('0xb'),attributes,{'tableName':_0x4154('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd198=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','../../config/logger','api','moment','bluebird','path'];(function(_0x32228d,_0x903cee){var _0x4dc897=function(_0x4c2dbc){while(--_0x4c2dbc){_0x32228d['push'](_0x32228d['shift']());}};_0x4dc897(++_0x903cee);}(_0xd198,0x133));var _0x8d19=function(_0x442c36,_0x3dbe3c){_0x442c36=_0x442c36-0x0;var _0x7f1070=_0xd198[_0x442c36];return _0x7f1070;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8d19('0x0'))(_0x8d19('0x1'));var moment=require(_0x8d19('0x2'));var BPromise=require(_0x8d19('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d19('0x4'));var rimraf=require(_0x8d19('0x5'));var config=require(_0x8d19('0x6'));var attributes=require(_0x8d19('0x7'));module[_0x8d19('0x8')]=function(_0x561d89,_0x3a2ad7){return _0x561d89[_0x8d19('0x9')](_0x8d19('0xa'),attributes,{'tableName':_0x8d19('0xb'),'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 cc605a3..8284b03 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 _0x804e=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2dec67,_0x328cc3){var _0x1f4f47=function(_0x3f12d9){while(--_0x3f12d9){_0x2dec67['push'](_0x2dec67['shift']());}};_0x1f4f47(++_0x328cc3);}(_0x804e,0x1b4));var _0xe804=function(_0x5aab79,_0x2c285c){_0x5aab79=_0x5aab79-0x0;var _0x355002=_0x804e[_0x5aab79];return _0x355002;};'use strict';var _=require(_0xe804('0x0'));var util=require('util');var moment=require(_0xe804('0x1'));var BPromise=require(_0xe804('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe804('0x3'));var db=require(_0xe804('0x4'))['db'];var utils=require(_0xe804('0x5'));var logger=require(_0xe804('0x6'))(_0xe804('0x7'));var config=require(_0xe804('0x8'));var jayson=require(_0xe804('0x9'));var client=jayson[_0xe804('0xa')][_0xe804('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f1485,_0xad05e0,_0x17fb6f){return new BPromise(function(_0x1a50c0,_0x18cac3){return client[_0xe804('0xc')](_0x4f1485,_0x17fb6f)[_0xe804('0xd')](function(_0x1076b5){logger[_0xe804('0xe')](_0xe804('0xf'),_0xad05e0,_0xe804('0x10'));logger[_0xe804('0x11')](_0xe804('0x12'),_0xad05e0,'request\x20sent',JSON[_0xe804('0x13')](_0x1076b5));if(_0x1076b5['error']){if(_0x1076b5['error'][_0xe804('0x14')]===0x1f4){logger[_0xe804('0x15')](_0xe804('0xf'),_0xad05e0,_0x1076b5[_0xe804('0x15')][_0xe804('0x16')]);return _0x18cac3(_0x1076b5[_0xe804('0x15')][_0xe804('0x16')]);}logger[_0xe804('0x15')](_0xe804('0xf'),_0xad05e0,_0x1076b5[_0xe804('0x15')][_0xe804('0x16')]);return _0x1a50c0(_0x1076b5[_0xe804('0x15')][_0xe804('0x16')]);}else{logger[_0xe804('0xe')](_0xe804('0xf'),_0xad05e0,_0xe804('0x10'));_0x1a50c0(_0x1076b5[_0xe804('0x17')][_0xe804('0x16')]);}})[_0xe804('0x18')](function(_0x35a30b){logger[_0xe804('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0xad05e0,_0x35a30b);_0x18cac3(_0x35a30b);});});} \ No newline at end of file +var _0xccde=['../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3eb144,_0x5b5479){var _0x39708d=function(_0x26448c){while(--_0x26448c){_0x3eb144['push'](_0x3eb144['shift']());}};_0x39708d(++_0x5b5479);}(_0xccde,0x1ba));var _0xeccd=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0xccde[_0x291f8b];return _0x275171;};'use strict';var _=require(_0xeccd('0x0'));var util=require(_0xeccd('0x1'));var moment=require(_0xeccd('0x2'));var BPromise=require('bluebird');var rs=require(_0xeccd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeccd('0x4'))['db'];var utils=require(_0xeccd('0x5'));var logger=require(_0xeccd('0x6'))(_0xeccd('0x7'));var config=require(_0xeccd('0x8'));var jayson=require(_0xeccd('0x9'));var client=jayson[_0xeccd('0xa')][_0xeccd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x481a9b,_0x3b5025,_0x4692b6){return new BPromise(function(_0x3a3eb6,_0x5609cc){return client[_0xeccd('0xc')](_0x481a9b,_0x4692b6)[_0xeccd('0xd')](function(_0x37c372){logger[_0xeccd('0xe')](_0xeccd('0xf'),_0x3b5025,_0xeccd('0x10'));logger[_0xeccd('0x11')](_0xeccd('0x12'),_0x3b5025,_0xeccd('0x10'),JSON[_0xeccd('0x13')](_0x37c372));if(_0x37c372[_0xeccd('0x14')]){if(_0x37c372['error'][_0xeccd('0x15')]===0x1f4){logger[_0xeccd('0x14')](_0xeccd('0xf'),_0x3b5025,_0x37c372[_0xeccd('0x14')][_0xeccd('0x16')]);return _0x5609cc(_0x37c372['error'][_0xeccd('0x16')]);}logger[_0xeccd('0x14')](_0xeccd('0xf'),_0x3b5025,_0x37c372[_0xeccd('0x14')][_0xeccd('0x16')]);return _0x3a3eb6(_0x37c372[_0xeccd('0x14')][_0xeccd('0x16')]);}else{logger[_0xeccd('0xe')](_0xeccd('0xf'),_0x3b5025,_0xeccd('0x10'));_0x3a3eb6(_0x37c372[_0xeccd('0x17')]['message']);}})[_0xeccd('0x18')](function(_0x259ce2){logger[_0xeccd('0x14')](_0xeccd('0xf'),_0x3b5025,_0x259ce2);_0x5609cc(_0x259ce2);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 29a27d3..c9c0589 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 _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x23deee,_0x135240){_0x23deee=_0x23deee-0x0;var _0x5ccb76=_0xb4c7[_0x23deee];return _0x5ccb76;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router; \ No newline at end of file +var _0x71ab=['get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x71ab,0x64));var _0xb71a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x71ab[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0xa')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xf')]);router[_0xb71a('0x10')]('/:id',auth[_0xb71a('0xa')](),controller['destroy']);module[_0xb71a('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 bcfc969..c91ebaa 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 _0xc0fe=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x13b70c,_0x40be1c){var _0x2d0edd=function(_0x485ea4){while(--_0x485ea4){_0x13b70c['push'](_0x13b70c['shift']());}};_0x2d0edd(++_0x40be1c);}(_0xc0fe,0x18d));var _0xec0f=function(_0x528a13,_0x396b5b){_0x528a13=_0x528a13-0x0;var _0xba7822=_0xc0fe[_0x528a13];return _0xba7822;};'use strict';var Sequelize=require(_0xec0f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xec0f('0x1')]},'timeout':{'type':Sequelize[_0xec0f('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xec0f('0x3')](_0xec0f('0x4'),_0xec0f('0x5'),_0xec0f('0x6'))}}; \ No newline at end of file +var _0x6b5d=['beepall','exports','STRING','INTEGER','rrmemory'];(function(_0x26c0ce,_0x4c535b){var _0x387c96=function(_0x44cb6f){while(--_0x44cb6f){_0x26c0ce['push'](_0x26c0ce['shift']());}};_0x387c96(++_0x4c535b);}(_0x6b5d,0x119));var _0xd6b5=function(_0x5260dc,_0x23757e){_0x5260dc=_0x5260dc-0x0;var _0x47a261=_0x6b5d[_0x5260dc];return _0x47a261;};'use strict';var Sequelize=require('sequelize');module[_0xd6b5('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd6b5('0x1')]},'timeout':{'type':Sequelize[_0xd6b5('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd6b5('0x3'),_0xd6b5('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 8cc8990..37e3e94 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 _0x4312=['then','get','ChatQueues','UserProfileResource','end','error','stack','name','send','ChatQueue','rawAttributes','fieldName','type','key','getOptions','include','query','rows','catch','show','model','keys','filters','attributes','intersection','fields','length','includeAll','merge','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','nolimit','limit','sort','where','ChatQueueId','map','filter','UserChatQueue','findAll','findAndCountAll','agent','chatPause','createdAt','format','updatedAt','getTeams','order','hasOwnProperty','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','User','select','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatQueue.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','destroy'];(function(_0x5730a9,_0x22d1a5){var _0x25b913=function(_0x559e35){while(--_0x559e35){_0x5730a9['push'](_0x5730a9['shift']());}};_0x25b913(++_0x22d1a5);}(_0x4312,0xdb));var _0x2431=function(_0x593576,_0x8629f2){_0x593576=_0x593576-0x0;var _0x2bcd63=_0x4312[_0x593576];return _0x2bcd63;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require(_0x2431('0x0'));var qs=require(_0x2431('0x1'));var logger=require(_0x2431('0x2'))(_0x2431('0x3'));var config=require(_0x2431('0x4'));var db=require(_0x2431('0x5'))['db'];config[_0x2431('0x6')]=_['defaults'](config[_0x2431('0x6')],{'host':_0x2431('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2431('0x8'))[_0x2431('0x9')](socket);function respondWithStatusCode(_0x548402,_0xd5b9ef){_0xd5b9ef=_0xd5b9ef||0xcc;return function(_0x4a6c8f){if(_0x4a6c8f){return _0x548402[_0x2431('0xa')](_0xd5b9ef);}return _0x548402[_0x2431('0xb')](_0xd5b9ef)['end']();};}function respondWithResult(_0x530a67,_0x512e1c){_0x512e1c=_0x512e1c||0xc8;return function(_0x8526a7){if(_0x8526a7){return _0x530a67[_0x2431('0xb')](_0x512e1c)[_0x2431('0xc')](_0x8526a7);}};}function respondWithFilteredResult(_0x4e3f21,_0x4497b0){return function(_0x4e1392){if(_0x4e1392){var _0x82fc80=typeof _0x4497b0[_0x2431('0xd')]===_0x2431('0xe')&&typeof _0x4497b0['limit']===_0x2431('0xe');var _0x482fdb=_0x4e1392['count'];var _0x56e4ea=_0x82fc80?0x0:_0x4497b0[_0x2431('0xd')];var _0x557b9a=_0x82fc80?_0x4e1392[_0x2431('0xf')]:_0x4497b0[_0x2431('0xd')]+_0x4497b0['limit'];var _0x162dd6;if(_0x557b9a>=_0x482fdb){_0x557b9a=_0x482fdb;_0x162dd6=0xc8;}else{_0x162dd6=0xce;}_0x4e3f21[_0x2431('0xb')](_0x162dd6);return _0x4e3f21[_0x2431('0x10')](_0x2431('0x11'),_0x56e4ea+'-'+_0x557b9a+'/'+_0x482fdb)['json'](_0x4e1392);}return null;};}function saveUpdates(_0xc8d93e){return function(_0x212914){if(_0x212914){return _0x212914['update'](_0xc8d93e)['then'](function(_0x4d1029){return _0x4d1029;});}return null;};}function removeEntity(_0x1cc458){return function(_0x32ad63){if(_0x32ad63){return _0x32ad63[_0x2431('0x12')]()[_0x2431('0x13')](function(){var _0x59f8fc=_0x32ad63[_0x2431('0x14')]({'plain':!![]});var _0x30ee12=_0x2431('0x15');return db[_0x2431('0x16')]['destroy']({'where':{'type':_0x30ee12,'resourceId':_0x59f8fc['id']}})['then'](function(){return _0x32ad63;});})[_0x2431('0x13')](function(){_0x1cc458[_0x2431('0xb')](0xcc)[_0x2431('0x17')]();});}};}function handleEntityNotFound(_0xc8c754){return function(_0x569550){if(!_0x569550){_0xc8c754[_0x2431('0xa')](0x194);}return _0x569550;};}function handleError(_0x4aab56,_0x27b83f){_0x27b83f=_0x27b83f||0x1f4;return function(_0x4563dd){logger[_0x2431('0x18')](_0x4563dd[_0x2431('0x19')]);if(_0x4563dd[_0x2431('0x1a')]){delete _0x4563dd[_0x2431('0x1a')];}_0x4aab56[_0x2431('0xb')](_0x27b83f)[_0x2431('0x1b')](_0x4563dd);};}exports['index']=function(_0x1f5c8b,_0x5c6231){var _0x2fa64a={};var _0x32ea4d={'count':0x0,'rows':[]};var _0x181b34=_['map'](db[_0x2431('0x1c')][_0x2431('0x1d')],function(_0x3b4884){return{'name':_0x3b4884[_0x2431('0x1e')],'type':_0x3b4884[_0x2431('0x1f')][_0x2431('0x20')]};});_0x2fa64a=qs[_0x2431('0x21')](_0x181b34,_0x1f5c8b);var _0xaeb041={'where':_0x2fa64a['where']};return db[_0x2431('0x1c')]['count'](_0xaeb041)[_0x2431('0x13')](function(_0x4d40e9){_0x32ea4d[_0x2431('0xf')]=_0x4d40e9;_0x2fa64a['include']=qs[_0x2431('0x22')](_0x1f5c8b[_0x2431('0x23')]);return db['ChatQueue']['findAll'](_0x2fa64a);})[_0x2431('0x13')](function(_0x4d721f){_0x32ea4d[_0x2431('0x24')]=_0x4d721f;return _0x32ea4d;})[_0x2431('0x13')](respondWithFilteredResult(_0x5c6231,_0x2fa64a))[_0x2431('0x25')](handleError(_0x5c6231,null));};exports[_0x2431('0x26')]=function(_0x3812e5,_0xb3e3a5){var _0x583efe={'raw':!![],'where':{'id':_0x3812e5['params']['id']}},_0x36584a={};_0x36584a[_0x2431('0x27')]=_[_0x2431('0x28')](db[_0x2431('0x1c')][_0x2431('0x1d')]);_0x36584a[_0x2431('0x23')]=_[_0x2431('0x28')](_0x3812e5[_0x2431('0x23')]);_0x36584a[_0x2431('0x29')]=_['intersection'](_0x36584a[_0x2431('0x27')],_0x36584a[_0x2431('0x23')]);_0x583efe[_0x2431('0x2a')]=_[_0x2431('0x2b')](_0x36584a[_0x2431('0x27')],qs[_0x2431('0x2c')](_0x3812e5['query'][_0x2431('0x2c')]));_0x583efe[_0x2431('0x2a')]=_0x583efe['attributes'][_0x2431('0x2d')]?_0x583efe[_0x2431('0x2a')]:_0x36584a['model'];if(_0x3812e5['query'][_0x2431('0x2e')]){_0x583efe[_0x2431('0x22')]=[{'all':!![]}];}_0x583efe=_[_0x2431('0x2f')]({},_0x583efe,_0x3812e5[_0x2431('0x30')]);return db[_0x2431('0x1c')][_0x2431('0x31')](_0x583efe)[_0x2431('0x13')](handleEntityNotFound(_0xb3e3a5,null))['then'](respondWithResult(_0xb3e3a5,null))[_0x2431('0x25')](handleError(_0xb3e3a5,null));};exports[_0x2431('0x32')]=function(_0x4ed61c,_0x1d7bfc){return db[_0x2431('0x1c')]['create'](_0x4ed61c[_0x2431('0x33')],{})[_0x2431('0x13')](function(_0x31caed){var _0x15d14a=_0x4ed61c[_0x2431('0x34')][_0x2431('0x14')]({'plain':!![]});if(!_0x15d14a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15d14a[_0x2431('0x35')]==='user'){var _0x4aba06=_0x31caed[_0x2431('0x14')]({'plain':!![]});var _0x4a87ca='ChatQueues';return db[_0x2431('0x36')][_0x2431('0x31')]({'where':{'name':_0x4a87ca,'userProfileId':_0x15d14a[_0x2431('0x37')]},'raw':!![]})['then'](function(_0x169540){if(_0x169540&&_0x169540[_0x2431('0x38')]===0x0){return db['UserProfileResource'][_0x2431('0x32')]({'name':_0x4aba06[_0x2431('0x1a')],'resourceId':_0x4aba06['id'],'type':_0x169540[_0x2431('0x1a')],'sectionId':_0x169540['id']},{})[_0x2431('0x13')](function(){return _0x31caed;});}else{return _0x31caed;}})[_0x2431('0x25')](function(_0x347ed5){logger[_0x2431('0x18')](_0x2431('0x39'),_0x347ed5);throw _0x347ed5;});}return _0x31caed;})[_0x2431('0x13')](respondWithResult(_0x1d7bfc,0xc9))['catch'](handleError(_0x1d7bfc,null));};exports['update']=function(_0x51551f,_0x55f0c1){if(_0x51551f[_0x2431('0x33')]['id']){delete _0x51551f[_0x2431('0x33')]['id'];}return db[_0x2431('0x1c')]['find']({'where':{'id':_0x51551f[_0x2431('0x3a')]['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x55f0c1,null))[_0x2431('0x13')](saveUpdates(_0x51551f[_0x2431('0x33')],null))[_0x2431('0x13')](respondWithResult(_0x55f0c1,null))[_0x2431('0x25')](handleError(_0x55f0c1,null));};exports[_0x2431('0x12')]=function(_0x32d3e3,_0x593cc8){return db[_0x2431('0x1c')][_0x2431('0x31')]({'where':{'id':_0x32d3e3['params']['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x593cc8,null))[_0x2431('0x13')](removeEntity(_0x593cc8,null))['catch'](handleError(_0x593cc8,null));};exports['describe']=function(_0x1682d4,_0x3c5872){return db['ChatQueue'][_0x2431('0x3b')]()['then'](respondWithResult(_0x3c5872,null))[_0x2431('0x25')](handleError(_0x3c5872,null));};exports['getMembers']=function(_0x2eb8cf,_0x29890f){var _0x3acba4={'raw':!![],'where':{}},_0x38ca00={},_0xca8677;return db[_0x2431('0x1c')][_0x2431('0x3c')]({'where':{'id':_0x2eb8cf['params']['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x29890f,null))['then'](function(_0x3757da){if(_0x3757da){_0xca8677=_0x3757da[_0x2431('0x14')]({'plain':!![]});_0x38ca00[_0x2431('0x27')]=_[_0x2431('0x28')](db['UserChatQueue']['rawAttributes']);_0x38ca00['query']=_[_0x2431('0x28')](_0x2eb8cf[_0x2431('0x23')]);_0x38ca00['filters']=_[_0x2431('0x2b')](_0x38ca00[_0x2431('0x27')],_0x38ca00['query']);_0x3acba4[_0x2431('0x2a')]=_[_0x2431('0x2b')](_0x38ca00[_0x2431('0x27')],qs['fields'](_0x2eb8cf[_0x2431('0x23')][_0x2431('0x2c')]));_0x3acba4['attributes']=_0x3acba4['attributes'][_0x2431('0x2d')]?_0x3acba4[_0x2431('0x2a')]:_0x38ca00[_0x2431('0x27')];if(!_0x2eb8cf[_0x2431('0x23')]['hasOwnProperty'](_0x2431('0x3d'))){_0x3acba4[_0x2431('0x3e')]=qs['limit'](_0x2eb8cf[_0x2431('0x23')][_0x2431('0x3e')]);_0x3acba4[_0x2431('0xd')]=qs[_0x2431('0xd')](_0x2eb8cf[_0x2431('0x23')][_0x2431('0xd')]);}_0x3acba4['order']=qs[_0x2431('0x3f')](_0x2eb8cf[_0x2431('0x23')]['sort']);_0x3acba4['where']=qs[_0x2431('0x29')](_['pick'](_0x2eb8cf[_0x2431('0x23')],_0x38ca00[_0x2431('0x29')]));_0x3acba4[_0x2431('0x40')][_0x2431('0x41')]=_0x3757da['id'];if(_0x2eb8cf[_0x2431('0x23')]['filter']){_0x3acba4[_0x2431('0x40')]=_[_0x2431('0x2f')](_0x3acba4['where'],{'$or':_[_0x2431('0x42')](_0x3acba4[_0x2431('0x2a')],function(_0x43f65f){var _0x271996={};_0x271996[_0x43f65f]={'$like':'%'+_0x2eb8cf['query'][_0x2431('0x43')]+'%'};return _0x271996;})});}_0x3acba4=_[_0x2431('0x2f')]({},_0x3acba4,_0x2eb8cf[_0x2431('0x30')]);return db[_0x2431('0x44')][_0x2431('0x45')](_0x3acba4);}})['then'](function(_0x4fc07b){if(_0x4fc07b){return db['User'][_0x2431('0x46')]({'where':{'id':_[_0x2431('0x42')](_0x4fc07b,'UserId'),'role':_0x2431('0x47')},'attributes':['id',_0x2431('0x1a'),_0x2431('0x48'),'updatedAt',_0x2431('0x49')]});}})[_0x2431('0x13')](function(_0x1ca705){if(_0x1ca705){return{'count':_0x1ca705[_0x2431('0xf')],'rows':_['map'](_0x1ca705[_0x2431('0x24')],function(_0x4ec19e){return{'membername':_0x4ec19e[_0x2431('0x1a')],'UserId':_0x4ec19e['id'],'queue_name':_0xca8677['name'],'ChatQueueId':_0xca8677['id'],'interface':util[_0x2431('0x4a')]('%s/%s','SIP',_0x4ec19e[_0x2431('0x1a')]),'penalty':0x0,'paused':_0x4ec19e[_0x2431('0x48')],'createdAt':_0x4ec19e['createdAt'],'updatedAt':_0x4ec19e[_0x2431('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2431('0x13')](respondWithFilteredResult(_0x29890f,_0x3acba4))[_0x2431('0x25')](handleError(_0x29890f,null));};exports[_0x2431('0x4c')]=function(_0x54ecd8,_0x2d9b61){var _0x396b9b={};var _0x130eb5={};var _0x2852d8;var _0x106ad1;return db['ChatQueue'][_0x2431('0x3c')]({'where':{'id':_0x54ecd8['params']['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x2d9b61,null))[_0x2431('0x13')](function(_0x7e5d33){if(_0x7e5d33){_0x2852d8=_0x7e5d33;_0x130eb5[_0x2431('0x27')]=_[_0x2431('0x28')](db['Team'][_0x2431('0x1d')]);_0x130eb5[_0x2431('0x23')]=_['keys'](_0x54ecd8[_0x2431('0x23')]);_0x130eb5['filters']=_['intersection'](_0x130eb5['model'],_0x130eb5['query']);_0x396b9b[_0x2431('0x2a')]=_[_0x2431('0x2b')](_0x130eb5['model'],qs[_0x2431('0x2c')](_0x54ecd8[_0x2431('0x23')][_0x2431('0x2c')]));_0x396b9b[_0x2431('0x2a')]=_0x396b9b[_0x2431('0x2a')]['length']?_0x396b9b[_0x2431('0x2a')]:_0x130eb5[_0x2431('0x27')];_0x396b9b[_0x2431('0x4d')]=qs[_0x2431('0x3f')](_0x54ecd8[_0x2431('0x23')][_0x2431('0x3f')]);_0x396b9b[_0x2431('0x40')]=qs[_0x2431('0x29')](_['pick'](_0x54ecd8[_0x2431('0x23')],_0x130eb5[_0x2431('0x29')]));if(_0x54ecd8[_0x2431('0x23')][_0x2431('0x43')]){_0x396b9b[_0x2431('0x40')]=_[_0x2431('0x2f')](_0x396b9b[_0x2431('0x40')],{'$or':_[_0x2431('0x42')](_0x396b9b[_0x2431('0x2a')],function(_0x570a19){var _0x3f564f={};_0x3f564f[_0x570a19]={'$like':'%'+_0x54ecd8[_0x2431('0x23')][_0x2431('0x43')]+'%'};return _0x3f564f;})});}_0x396b9b=_[_0x2431('0x2f')]({},_0x396b9b,_0x54ecd8[_0x2431('0x30')]);return _0x2852d8[_0x2431('0x4c')](_0x396b9b);}})[_0x2431('0x13')](function(_0x451b3c){if(_0x451b3c){_0x106ad1=_0x451b3c[_0x2431('0x2d')];if(!_0x54ecd8[_0x2431('0x23')][_0x2431('0x4e')](_0x2431('0x3d'))){_0x396b9b['limit']=qs['limit'](_0x54ecd8[_0x2431('0x23')][_0x2431('0x3e')]);_0x396b9b['offset']=qs[_0x2431('0xd')](_0x54ecd8[_0x2431('0x23')]['offset']);}return _0x2852d8[_0x2431('0x4c')](_0x396b9b);}})['then'](function(_0x2fa746){if(_0x2fa746){return _0x2fa746?{'count':_0x106ad1,'rows':_0x2fa746}:null;}})[_0x2431('0x13')](respondWithResult(_0x2d9b61,null))[_0x2431('0x25')](handleError(_0x2d9b61,null));};exports[_0x2431('0x4f')]=function(_0x989168,_0x49635d){var _0x1ad009=_0x989168[_0x2431('0x33')][_0x2431('0x50')];return db[_0x2431('0x51')][_0x2431('0x45')]({'where':{'id':_0x1ad009},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2431('0x52'),'attributes':['id','name','online',_0x2431('0x53'),_0x2431('0x54')],'raw':!![]}]})[_0x2431('0x13')](function(_0x2a61df){if(_0x2a61df){var _0x322db0=_[_0x2431('0x55')](_0x2a61df,function(_0x110c68){var _0x21a186=_0x110c68['get']({'plain':!![]});return _0x21a186['Agents'];});return db[_0x2431('0x1c')][_0x2431('0x31')]({'where':{'id':_0x989168[_0x2431('0x3a')]['id']}})[_0x2431('0x13')](function(_0x48a7cc){return db[_0x2431('0x56')][_0x2431('0x57')](function(_0x286c8c){return _0x48a7cc[_0x2431('0x4f')](_0x1ad009,{'transaction':_0x286c8c})[_0x2431('0x13')](function(){return BPromise['each'](_0x322db0,function(_0x4bd7e5){return db[_0x2431('0x44')][_0x2431('0x58')]({'where':{'UserId':_0x4bd7e5['id'],'ChatQueueId':_0x989168[_0x2431('0x3a')]['id']},'transaction':_0x286c8c});});})[_0x2431('0x13')](function(){_0x322db0[_0x2431('0x59')](function(_0x556bed){socket[_0x2431('0x5a')](_0x2431('0x5b'),{'UserId':_0x556bed['id'],'ChatQueueId':_0x48a7cc['id']});});});});});}})['then'](respondWithStatusCode(_0x49635d,null))[_0x2431('0x25')](handleError(_0x49635d,null));};exports['removeTeams']=function(_0x105864,_0x16b883){return db[_0x2431('0x51')][_0x2431('0x45')]({'where':{'id':_0x105864['query'][_0x2431('0x50')]},'attributes':['id'],'include':[{'model':db[_0x2431('0x5c')],'as':_0x2431('0x52'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x16b883,null))[_0x2431('0x13')](function(_0x1dcbb7){var _0x32da14=_[_0x2431('0x42')](_0x1dcbb7,'id');var _0x1f3def=[];var _0x23ffc6=[];var _0x4bd2b8=squel[_0x2431('0x5d')]();_0x4bd2b8['field'](_0x2431('0x5e'))[_0x2431('0x5f')](_0x2431('0x60'),'tq')['join'](_0x2431('0x61'),'ut',_0x2431('0x62'))[_0x2431('0x40')](_0x2431('0x63'),_0x105864['params']['id']);for(var _0x1d58a3=0x0;_0x1d58a3<_0x1dcbb7[_0x2431('0x2d')];_0x1d58a3+=0x1){let _0x344a93=_0x1dcbb7[_0x1d58a3];for(var _0x2e0173=0x0;_0x2e0173<_0x344a93[_0x2431('0x52')][_0x2431('0x2d')];_0x2e0173+=0x1){let _0x2d6f3e=_0x344a93['Agents'][_0x2e0173];var _0x5578ab=_0x4bd2b8[_0x2431('0x64')]();_0x5578ab[_0x2431('0x40')](_0x2431('0x65'),_0x2d6f3e['id']);_0x23ffc6[_0x2431('0x66')](db[_0x2431('0x56')][_0x2431('0x23')](_0x5578ab[_0x2431('0x67')](),{'type':db[_0x2431('0x56')][_0x2431('0x68')][_0x2431('0x69')]})[_0x2431('0x13')](function(_0xc5cfa2){if(_0xc5cfa2['length']===0x1){return _0x2d6f3e['id'];}else{var _0x334d0c=_['every'](_[_0x2431('0x42')](_0xc5cfa2,'TeamId'),function(_0x2024ef){return _[_0x2431('0x6a')](_0x32da14,_0x2024ef);});if(_0x334d0c){return _0x2d6f3e['id'];}}}));}}return BPromise['all'](_0x23ffc6)['then'](function(_0x22dca8){_0x1f3def=_(_0x1f3def)[_0x2431('0x6b')](_0x22dca8)[_0x2431('0x6c')]()[_0x2431('0x6d')]();return db[_0x2431('0x1c')][_0x2431('0x31')]({'where':{'id':_0x105864[_0x2431('0x3a')]['id']}})[_0x2431('0x13')](function(_0x55b15e){return db[_0x2431('0x56')]['transaction'](function(_0x4391f2){return _0x55b15e[_0x2431('0x6e')](_0x105864[_0x2431('0x23')]['ids'],{'transaction':_0x4391f2})[_0x2431('0x13')](function(){if(!_[_0x2431('0x6f')](_0x1f3def)){return _0x55b15e[_0x2431('0x70')](_0x1f3def,{'transaction':_0x4391f2});}})[_0x2431('0x13')](function(){_0x1f3def['forEach'](function(_0x2d2586){socket[_0x2431('0x5a')](_0x2431('0x71'),{'UserId':_0x2d2586,'ChatQueueId':_0x55b15e['id']});});});});});});})[_0x2431('0x13')](respondWithStatusCode(_0x16b883,null))[_0x2431('0x25')](handleError(_0x16b883,null));};exports[_0x2431('0x72')]=function(_0x5acfb3,_0x196fd8){return db[_0x2431('0x1c')][_0x2431('0x31')]({'where':{'id':_0x5acfb3[_0x2431('0x3a')]['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x196fd8,null))[_0x2431('0x13')](function(_0x4196ac){if(_0x4196ac){return _0x4196ac[_0x2431('0x72')](_0x5acfb3[_0x2431('0x33')]['ids'],_[_0x2431('0x73')](_0x5acfb3[_0x2431('0x33')],[_0x2431('0x50'),'id'])||{})[_0x2431('0x74')](function(_0x228879){for(var _0x3ac587=0x0;_0x3ac587<_0x5acfb3['body'][_0x2431('0x50')][_0x2431('0x2d')];_0x3ac587+=0x1){socket[_0x2431('0x5a')](_0x2431('0x5b'),{'UserId':Number(_0x5acfb3['body'][_0x2431('0x50')][_0x3ac587]),'ChatQueueId':Number(_0x5acfb3[_0x2431('0x3a')]['id'])});}return _0x228879;});}})['then'](respondWithResult(_0x196fd8,null))[_0x2431('0x25')](handleError(_0x196fd8,null));};exports[_0x2431('0x70')]=function(_0x4d8a18,_0x4e7e47){return db[_0x2431('0x1c')][_0x2431('0x31')]({'where':{'id':_0x4d8a18[_0x2431('0x3a')]['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x4e7e47,null))[_0x2431('0x13')](function(_0x370c38){if(_0x370c38){return _0x370c38[_0x2431('0x70')](_0x4d8a18[_0x2431('0x23')][_0x2431('0x50')])['then'](function(){if(_[_0x2431('0x75')](_0x4d8a18[_0x2431('0x23')][_0x2431('0x50')])){for(var _0x5cbb2d=0x0;_0x5cbb2d<_0x4d8a18[_0x2431('0x23')][_0x2431('0x50')][_0x2431('0x2d')];_0x5cbb2d+=0x1){socket[_0x2431('0x5a')]('userChatQueue:remove',{'UserId':Number(_0x4d8a18[_0x2431('0x23')][_0x2431('0x50')][_0x5cbb2d]),'ChatQueueId':Number(_0x4d8a18[_0x2431('0x3a')]['id'])});}}else{socket[_0x2431('0x5a')](_0x2431('0x71'),{'UserId':Number(_0x4d8a18[_0x2431('0x23')][_0x2431('0x50')]),'ChatQueueId':Number(_0x4d8a18[_0x2431('0x3a')]['id'])});}});}})[_0x2431('0x13')](respondWithStatusCode(_0x4e7e47,null))[_0x2431('0x25')](handleError(_0x4e7e47,null));};exports[_0x2431('0x76')]=function(_0x1d57a2,_0x5977d9){var _0x4998b8={};var _0x1f85fa={};var _0x2b510c;var _0x36e16a;return db[_0x2431('0x1c')][_0x2431('0x3c')]({'where':{'id':_0x1d57a2[_0x2431('0x3a')]['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x5977d9,null))[_0x2431('0x13')](function(_0x1281d5){if(_0x1281d5){_0x2b510c=_0x1281d5;_0x1f85fa['model']=_[_0x2431('0x28')](db['User'][_0x2431('0x1d')]);_0x1f85fa['query']=_[_0x2431('0x28')](_0x1d57a2[_0x2431('0x23')]);_0x1f85fa[_0x2431('0x29')]=_[_0x2431('0x2b')](_0x1f85fa['model'],_0x1f85fa[_0x2431('0x23')]);_0x4998b8['attributes']=_[_0x2431('0x2b')](_0x1f85fa['model'],qs['fields'](_0x1d57a2[_0x2431('0x23')][_0x2431('0x2c')]));_0x4998b8[_0x2431('0x2a')]=_0x4998b8[_0x2431('0x2a')][_0x2431('0x2d')]?_0x4998b8[_0x2431('0x2a')]:_0x1f85fa['model'];_0x4998b8[_0x2431('0x4d')]=qs[_0x2431('0x3f')](_0x1d57a2[_0x2431('0x23')][_0x2431('0x3f')]);_0x4998b8[_0x2431('0x40')]=qs['filters'](_['pick'](_0x1d57a2['query'],_0x1f85fa[_0x2431('0x29')]));if(_0x1d57a2[_0x2431('0x23')]['filter']){_0x4998b8[_0x2431('0x40')]=_['merge'](_0x4998b8['where'],{'$or':_['map'](_0x4998b8[_0x2431('0x2a')],function(_0x7aeba9){var _0x8f9b5b={};_0x8f9b5b[_0x7aeba9]={'$like':'%'+_0x1d57a2[_0x2431('0x23')][_0x2431('0x43')]+'%'};return _0x8f9b5b;})});}_0x4998b8=_['merge']({},_0x4998b8,_0x1d57a2[_0x2431('0x30')]);return _0x2b510c[_0x2431('0x76')](_0x4998b8);}})[_0x2431('0x13')](function(_0x485b65){if(_0x485b65){_0x36e16a=_0x485b65['length'];if(!_0x1d57a2[_0x2431('0x23')][_0x2431('0x4e')](_0x2431('0x3d'))){_0x4998b8[_0x2431('0x3e')]=qs['limit'](_0x1d57a2['query'][_0x2431('0x3e')]);_0x4998b8['offset']=qs[_0x2431('0xd')](_0x1d57a2[_0x2431('0x23')][_0x2431('0xd')]);}return _0x2b510c['getAgents'](_0x4998b8);}})[_0x2431('0x13')](function(_0xb32e92){if(_0xb32e92){return _0xb32e92?{'count':_0x36e16a,'rows':_0xb32e92}:null;}})['then'](respondWithResult(_0x5977d9,null))[_0x2431('0x25')](handleError(_0x5977d9,null));}; \ No newline at end of file +var _0xe657=['UserChatQueue','hasOwnProperty','order','sort','pick','filter','options','User','UserId','agent','chatPause','updatedAt','format','%s/%s','createdAt','getTeams','Team','nolimit','addTeams','ids','findAll','Agents','interface','flatMap','sequelize','each','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','all','union','compact','value','transaction','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','ChatQueue','rawAttributes','fieldName','key','where','include','rows','catch','show','params','model','keys','query','filters','intersection','fields','attributes','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne'];(function(_0x4893c3,_0x35c8b5){var _0x75f46e=function(_0x4553bb){while(--_0x4553bb){_0x4893c3['push'](_0x4893c3['shift']());}};_0x75f46e(++_0x35c8b5);}(_0xe657,0x11d));var _0x7e65=function(_0x2f52d5,_0x513a9d){_0x2f52d5=_0x2f52d5-0x0;var _0x4c1bdc=_0xe657[_0x2f52d5];return _0x4c1bdc;};'use strict';var BPromise=require('bluebird');var util=require(_0x7e65('0x0'));var _=require(_0x7e65('0x1'));var squel=require(_0x7e65('0x2'));var Redis=require(_0x7e65('0x3'));var qs=require(_0x7e65('0x4'));var logger=require('../../config/logger')(_0x7e65('0x5'));var config=require('../../config/environment');var db=require(_0x7e65('0x6'))['db'];config[_0x7e65('0x7')]=_[_0x7e65('0x8')](config[_0x7e65('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e65('0x9'))(new Redis(config[_0x7e65('0x7')]));require(_0x7e65('0xa'))[_0x7e65('0xb')](socket);function respondWithStatusCode(_0x21055f,_0x5b8643){_0x5b8643=_0x5b8643||0xcc;return function(_0x582796){if(_0x582796){return _0x21055f[_0x7e65('0xc')](_0x5b8643);}return _0x21055f[_0x7e65('0xd')](_0x5b8643)[_0x7e65('0xe')]();};}function respondWithResult(_0x8a7831,_0x2a06bb){_0x2a06bb=_0x2a06bb||0xc8;return function(_0x36ca09){if(_0x36ca09){return _0x8a7831[_0x7e65('0xd')](_0x2a06bb)[_0x7e65('0xf')](_0x36ca09);}};}function respondWithFilteredResult(_0x45eccc,_0x54e0cd){return function(_0x4f6b24){if(_0x4f6b24){var _0x551b78=typeof _0x54e0cd[_0x7e65('0x10')]===_0x7e65('0x11')&&typeof _0x54e0cd[_0x7e65('0x12')]===_0x7e65('0x11');var _0x3c1dd7=_0x4f6b24[_0x7e65('0x13')];var _0x271488=_0x551b78?0x0:_0x54e0cd[_0x7e65('0x10')];var _0x5c0a76=_0x551b78?_0x4f6b24[_0x7e65('0x13')]:_0x54e0cd[_0x7e65('0x10')]+_0x54e0cd['limit'];var _0x478d85;if(_0x5c0a76>=_0x3c1dd7){_0x5c0a76=_0x3c1dd7;_0x478d85=0xc8;}else{_0x478d85=0xce;}_0x45eccc['status'](_0x478d85);return _0x45eccc[_0x7e65('0x14')](_0x7e65('0x15'),_0x271488+'-'+_0x5c0a76+'/'+_0x3c1dd7)[_0x7e65('0xf')](_0x4f6b24);}return null;};}function saveUpdates(_0x451bb5){return function(_0x47161c){if(_0x47161c){return _0x47161c[_0x7e65('0x16')](_0x451bb5)[_0x7e65('0x17')](function(_0x1e72bc){return _0x1e72bc;});}return null;};}function removeEntity(_0x2543af){return function(_0x221cf3){if(_0x221cf3){return _0x221cf3[_0x7e65('0x18')]()[_0x7e65('0x17')](function(){var _0x11e505=_0x221cf3[_0x7e65('0x19')]({'plain':!![]});var _0x18cd4a='ChatQueues';return db[_0x7e65('0x1a')][_0x7e65('0x18')]({'where':{'type':_0x18cd4a,'resourceId':_0x11e505['id']}})[_0x7e65('0x17')](function(){return _0x221cf3;});})['then'](function(){_0x2543af[_0x7e65('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x75bd56){return function(_0x2d0fd4){if(!_0x2d0fd4){_0x75bd56[_0x7e65('0xc')](0x194);}return _0x2d0fd4;};}function handleError(_0xf5267b,_0x171633){_0x171633=_0x171633||0x1f4;return function(_0x4ebfdc){logger[_0x7e65('0x1b')](_0x4ebfdc[_0x7e65('0x1c')]);if(_0x4ebfdc['name']){delete _0x4ebfdc[_0x7e65('0x1d')];}_0xf5267b[_0x7e65('0xd')](_0x171633)[_0x7e65('0x1e')](_0x4ebfdc);};}exports['index']=function(_0x3dcfbb,_0x31dc1b){var _0x5b1808={};var _0x30d807={'count':0x0,'rows':[]};var _0x2dde3a=_[_0x7e65('0x1f')](db[_0x7e65('0x20')][_0x7e65('0x21')],function(_0x535d51){return{'name':_0x535d51[_0x7e65('0x22')],'type':_0x535d51['type'][_0x7e65('0x23')]};});_0x5b1808=qs['getOptions'](_0x2dde3a,_0x3dcfbb);var _0x38c687={'where':_0x5b1808[_0x7e65('0x24')]};return db[_0x7e65('0x20')][_0x7e65('0x13')](_0x38c687)['then'](function(_0x664704){_0x30d807[_0x7e65('0x13')]=_0x664704;_0x5b1808[_0x7e65('0x25')]=qs[_0x7e65('0x25')](_0x3dcfbb['query']);return db['ChatQueue']['findAll'](_0x5b1808);})[_0x7e65('0x17')](function(_0x2fba3c){_0x30d807[_0x7e65('0x26')]=_0x2fba3c;return _0x30d807;})[_0x7e65('0x17')](respondWithFilteredResult(_0x31dc1b,_0x5b1808))[_0x7e65('0x27')](handleError(_0x31dc1b,null));};exports[_0x7e65('0x28')]=function(_0x33a495,_0x12bc0a){var _0x21cdeb={'raw':!![],'where':{'id':_0x33a495[_0x7e65('0x29')]['id']}},_0x10e1ba={};_0x10e1ba[_0x7e65('0x2a')]=_[_0x7e65('0x2b')](db[_0x7e65('0x20')]['rawAttributes']);_0x10e1ba[_0x7e65('0x2c')]=_[_0x7e65('0x2b')](_0x33a495[_0x7e65('0x2c')]);_0x10e1ba[_0x7e65('0x2d')]=_['intersection'](_0x10e1ba[_0x7e65('0x2a')],_0x10e1ba[_0x7e65('0x2c')]);_0x21cdeb['attributes']=_[_0x7e65('0x2e')](_0x10e1ba[_0x7e65('0x2a')],qs[_0x7e65('0x2f')](_0x33a495[_0x7e65('0x2c')]['fields']));_0x21cdeb[_0x7e65('0x30')]=_0x21cdeb[_0x7e65('0x30')][_0x7e65('0x31')]?_0x21cdeb[_0x7e65('0x30')]:_0x10e1ba[_0x7e65('0x2a')];if(_0x33a495[_0x7e65('0x2c')]['includeAll']){_0x21cdeb[_0x7e65('0x25')]=[{'all':!![]}];}_0x21cdeb=_[_0x7e65('0x32')]({},_0x21cdeb,_0x33a495['options']);return db['ChatQueue'][_0x7e65('0x33')](_0x21cdeb)['then'](handleEntityNotFound(_0x12bc0a,null))[_0x7e65('0x17')](respondWithResult(_0x12bc0a,null))[_0x7e65('0x27')](handleError(_0x12bc0a,null));};exports[_0x7e65('0x34')]=function(_0x5a9763,_0x52bf30){return db['ChatQueue']['create'](_0x5a9763[_0x7e65('0x35')],{})['then'](function(_0x6ca1){var _0x55e395=_0x5a9763[_0x7e65('0x36')][_0x7e65('0x19')]({'plain':!![]});if(!_0x55e395)throw new Error(_0x7e65('0x37'));if(_0x55e395[_0x7e65('0x38')]===_0x7e65('0x36')){var _0x4b367f=_0x6ca1[_0x7e65('0x19')]({'plain':!![]});var _0x258933='ChatQueues';return db[_0x7e65('0x39')][_0x7e65('0x33')]({'where':{'name':_0x258933,'userProfileId':_0x55e395[_0x7e65('0x3a')]},'raw':!![]})['then'](function(_0x20ec04){if(_0x20ec04&&_0x20ec04[_0x7e65('0x3b')]===0x0){return db[_0x7e65('0x1a')]['create']({'name':_0x4b367f[_0x7e65('0x1d')],'resourceId':_0x4b367f['id'],'type':_0x20ec04[_0x7e65('0x1d')],'sectionId':_0x20ec04['id']},{})[_0x7e65('0x17')](function(){return _0x6ca1;});}else{return _0x6ca1;}})[_0x7e65('0x27')](function(_0x177e74){logger[_0x7e65('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x177e74);throw _0x177e74;});}return _0x6ca1;})[_0x7e65('0x17')](respondWithResult(_0x52bf30,0xc9))[_0x7e65('0x27')](handleError(_0x52bf30,null));};exports['update']=function(_0x5cf2d2,_0x162683){if(_0x5cf2d2[_0x7e65('0x35')]['id']){delete _0x5cf2d2[_0x7e65('0x35')]['id'];}return db[_0x7e65('0x20')][_0x7e65('0x33')]({'where':{'id':_0x5cf2d2[_0x7e65('0x29')]['id']}})[_0x7e65('0x17')](handleEntityNotFound(_0x162683,null))['then'](saveUpdates(_0x5cf2d2[_0x7e65('0x35')],null))[_0x7e65('0x17')](respondWithResult(_0x162683,null))[_0x7e65('0x27')](handleError(_0x162683,null));};exports[_0x7e65('0x18')]=function(_0x3fa7e5,_0x4f855c){return db[_0x7e65('0x20')][_0x7e65('0x33')]({'where':{'id':_0x3fa7e5[_0x7e65('0x29')]['id']}})[_0x7e65('0x17')](handleEntityNotFound(_0x4f855c,null))[_0x7e65('0x17')](removeEntity(_0x4f855c,null))['catch'](handleError(_0x4f855c,null));};exports[_0x7e65('0x3c')]=function(_0x2249b4,_0x39e52d){return db['ChatQueue'][_0x7e65('0x3c')]()['then'](respondWithResult(_0x39e52d,null))[_0x7e65('0x27')](handleError(_0x39e52d,null));};exports[_0x7e65('0x3d')]=function(_0x3a8d83,_0x23b2d9){var _0x7e3c46={'raw':!![],'where':{}},_0x1ad7e8={},_0x14f638;return db[_0x7e65('0x20')][_0x7e65('0x3e')]({'where':{'id':_0x3a8d83[_0x7e65('0x29')]['id']}})[_0x7e65('0x17')](handleEntityNotFound(_0x23b2d9,null))[_0x7e65('0x17')](function(_0x47f8da){if(_0x47f8da){_0x14f638=_0x47f8da[_0x7e65('0x19')]({'plain':!![]});_0x1ad7e8[_0x7e65('0x2a')]=_['keys'](db[_0x7e65('0x3f')][_0x7e65('0x21')]);_0x1ad7e8['query']=_[_0x7e65('0x2b')](_0x3a8d83[_0x7e65('0x2c')]);_0x1ad7e8['filters']=_[_0x7e65('0x2e')](_0x1ad7e8[_0x7e65('0x2a')],_0x1ad7e8[_0x7e65('0x2c')]);_0x7e3c46['attributes']=_['intersection'](_0x1ad7e8[_0x7e65('0x2a')],qs[_0x7e65('0x2f')](_0x3a8d83[_0x7e65('0x2c')][_0x7e65('0x2f')]));_0x7e3c46[_0x7e65('0x30')]=_0x7e3c46['attributes']['length']?_0x7e3c46[_0x7e65('0x30')]:_0x1ad7e8['model'];if(!_0x3a8d83[_0x7e65('0x2c')][_0x7e65('0x40')]('nolimit')){_0x7e3c46[_0x7e65('0x12')]=qs['limit'](_0x3a8d83['query'][_0x7e65('0x12')]);_0x7e3c46[_0x7e65('0x10')]=qs['offset'](_0x3a8d83[_0x7e65('0x2c')][_0x7e65('0x10')]);}_0x7e3c46[_0x7e65('0x41')]=qs[_0x7e65('0x42')](_0x3a8d83['query'][_0x7e65('0x42')]);_0x7e3c46[_0x7e65('0x24')]=qs[_0x7e65('0x2d')](_[_0x7e65('0x43')](_0x3a8d83['query'],_0x1ad7e8[_0x7e65('0x2d')]));_0x7e3c46[_0x7e65('0x24')]['ChatQueueId']=_0x47f8da['id'];if(_0x3a8d83['query'][_0x7e65('0x44')]){_0x7e3c46[_0x7e65('0x24')]=_[_0x7e65('0x32')](_0x7e3c46[_0x7e65('0x24')],{'$or':_[_0x7e65('0x1f')](_0x7e3c46[_0x7e65('0x30')],function(_0x2e4408){var _0x16b8e7={};_0x16b8e7[_0x2e4408]={'$like':'%'+_0x3a8d83[_0x7e65('0x2c')]['filter']+'%'};return _0x16b8e7;})});}_0x7e3c46=_[_0x7e65('0x32')]({},_0x7e3c46,_0x3a8d83[_0x7e65('0x45')]);return db[_0x7e65('0x3f')]['findAll'](_0x7e3c46);}})[_0x7e65('0x17')](function(_0x3b6592){if(_0x3b6592){return db[_0x7e65('0x46')]['findAndCountAll']({'where':{'id':_['map'](_0x3b6592,_0x7e65('0x47')),'role':_0x7e65('0x48')},'attributes':['id',_0x7e65('0x1d'),_0x7e65('0x49'),_0x7e65('0x4a'),'createdAt']});}})[_0x7e65('0x17')](function(_0x1e3cd1){if(_0x1e3cd1){return{'count':_0x1e3cd1[_0x7e65('0x13')],'rows':_[_0x7e65('0x1f')](_0x1e3cd1[_0x7e65('0x26')],function(_0x39abb6){return{'membername':_0x39abb6[_0x7e65('0x1d')],'UserId':_0x39abb6['id'],'queue_name':_0x14f638[_0x7e65('0x1d')],'ChatQueueId':_0x14f638['id'],'interface':util[_0x7e65('0x4b')](_0x7e65('0x4c'),'SIP',_0x39abb6['name']),'penalty':0x0,'paused':_0x39abb6[_0x7e65('0x49')],'createdAt':_0x39abb6[_0x7e65('0x4d')],'updatedAt':_0x39abb6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7e65('0x17')](respondWithFilteredResult(_0x23b2d9,_0x7e3c46))['catch'](handleError(_0x23b2d9,null));};exports[_0x7e65('0x4e')]=function(_0x1336f1,_0x14feb0){var _0x2929a2={};var _0x1ec07d={};var _0x1a91b6;var _0x44b180;return db[_0x7e65('0x20')]['findOne']({'where':{'id':_0x1336f1[_0x7e65('0x29')]['id']}})[_0x7e65('0x17')](handleEntityNotFound(_0x14feb0,null))['then'](function(_0x5812e6){if(_0x5812e6){_0x1a91b6=_0x5812e6;_0x1ec07d['model']=_['keys'](db[_0x7e65('0x4f')][_0x7e65('0x21')]);_0x1ec07d[_0x7e65('0x2c')]=_[_0x7e65('0x2b')](_0x1336f1[_0x7e65('0x2c')]);_0x1ec07d['filters']=_[_0x7e65('0x2e')](_0x1ec07d[_0x7e65('0x2a')],_0x1ec07d[_0x7e65('0x2c')]);_0x2929a2[_0x7e65('0x30')]=_[_0x7e65('0x2e')](_0x1ec07d[_0x7e65('0x2a')],qs[_0x7e65('0x2f')](_0x1336f1[_0x7e65('0x2c')][_0x7e65('0x2f')]));_0x2929a2[_0x7e65('0x30')]=_0x2929a2[_0x7e65('0x30')][_0x7e65('0x31')]?_0x2929a2[_0x7e65('0x30')]:_0x1ec07d[_0x7e65('0x2a')];_0x2929a2['order']=qs[_0x7e65('0x42')](_0x1336f1['query'][_0x7e65('0x42')]);_0x2929a2[_0x7e65('0x24')]=qs[_0x7e65('0x2d')](_[_0x7e65('0x43')](_0x1336f1[_0x7e65('0x2c')],_0x1ec07d['filters']));if(_0x1336f1['query'][_0x7e65('0x44')]){_0x2929a2['where']=_[_0x7e65('0x32')](_0x2929a2[_0x7e65('0x24')],{'$or':_['map'](_0x2929a2['attributes'],function(_0x2c8205){var _0x2831a8={};_0x2831a8[_0x2c8205]={'$like':'%'+_0x1336f1[_0x7e65('0x2c')]['filter']+'%'};return _0x2831a8;})});}_0x2929a2=_['merge']({},_0x2929a2,_0x1336f1['options']);return _0x1a91b6[_0x7e65('0x4e')](_0x2929a2);}})[_0x7e65('0x17')](function(_0x3d5be0){if(_0x3d5be0){_0x44b180=_0x3d5be0[_0x7e65('0x31')];if(!_0x1336f1[_0x7e65('0x2c')][_0x7e65('0x40')](_0x7e65('0x50'))){_0x2929a2[_0x7e65('0x12')]=qs['limit'](_0x1336f1[_0x7e65('0x2c')][_0x7e65('0x12')]);_0x2929a2[_0x7e65('0x10')]=qs[_0x7e65('0x10')](_0x1336f1[_0x7e65('0x2c')][_0x7e65('0x10')]);}return _0x1a91b6[_0x7e65('0x4e')](_0x2929a2);}})[_0x7e65('0x17')](function(_0x290276){if(_0x290276){return _0x290276?{'count':_0x44b180,'rows':_0x290276}:null;}})[_0x7e65('0x17')](respondWithResult(_0x14feb0,null))[_0x7e65('0x27')](handleError(_0x14feb0,null));};exports[_0x7e65('0x51')]=function(_0x300400,_0x497856){var _0x5b5626=_0x300400['body'][_0x7e65('0x52')];return db[_0x7e65('0x4f')][_0x7e65('0x53')]({'where':{'id':_0x5b5626},'attributes':['id'],'include':[{'model':db[_0x7e65('0x46')],'as':_0x7e65('0x54'),'attributes':['id',_0x7e65('0x1d'),'online','voicePause',_0x7e65('0x55')],'raw':!![]}]})['then'](function(_0xe51735){if(_0xe51735){var _0xc4a153=_[_0x7e65('0x56')](_0xe51735,function(_0x35b985){var _0x1d46fc=_0x35b985[_0x7e65('0x19')]({'plain':!![]});return _0x1d46fc[_0x7e65('0x54')];});return db[_0x7e65('0x20')][_0x7e65('0x33')]({'where':{'id':_0x300400[_0x7e65('0x29')]['id']}})[_0x7e65('0x17')](function(_0x21c636){return db[_0x7e65('0x57')]['transaction'](function(_0x5646ce){return _0x21c636[_0x7e65('0x51')](_0x5b5626,{'transaction':_0x5646ce})[_0x7e65('0x17')](function(){return BPromise[_0x7e65('0x58')](_0xc4a153,function(_0x2ab344){return db[_0x7e65('0x3f')]['findOrCreate']({'where':{'UserId':_0x2ab344['id'],'ChatQueueId':_0x300400[_0x7e65('0x29')]['id']},'transaction':_0x5646ce});});})[_0x7e65('0x17')](function(){_0xc4a153[_0x7e65('0x59')](function(_0x3fb5f3){socket[_0x7e65('0x5a')](_0x7e65('0x5b'),{'UserId':_0x3fb5f3['id'],'ChatQueueId':_0x21c636['id']});});});});});}})[_0x7e65('0x17')](respondWithStatusCode(_0x497856,null))[_0x7e65('0x27')](handleError(_0x497856,null));};exports[_0x7e65('0x5c')]=function(_0x32b7ff,_0x30572d){return db[_0x7e65('0x4f')][_0x7e65('0x53')]({'where':{'id':_0x32b7ff[_0x7e65('0x2c')][_0x7e65('0x52')]},'attributes':['id'],'include':[{'model':db[_0x7e65('0x46')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7e65('0x17')](handleEntityNotFound(_0x30572d,null))[_0x7e65('0x17')](function(_0x2b526f){var _0x40f809=_['map'](_0x2b526f,'id');var _0x16a261=[];var _0x53a74e=[];var _0x4ad20e=squel['select']();_0x4ad20e[_0x7e65('0x5d')](_0x7e65('0x5e'))['from'](_0x7e65('0x5f'),'tq')['join'](_0x7e65('0x60'),'ut',_0x7e65('0x61'))[_0x7e65('0x24')](_0x7e65('0x62'),_0x32b7ff['params']['id']);for(var _0x98c99e=0x0;_0x98c99e<_0x2b526f[_0x7e65('0x31')];_0x98c99e+=0x1){let _0x3300d2=_0x2b526f[_0x98c99e];for(var _0x4b9d0a=0x0;_0x4b9d0a<_0x3300d2['Agents'][_0x7e65('0x31')];_0x4b9d0a+=0x1){let _0xbc4ab3=_0x3300d2['Agents'][_0x4b9d0a];var _0x4cb93f=_0x4ad20e[_0x7e65('0x63')]();_0x4cb93f['where'](_0x7e65('0x64'),_0xbc4ab3['id']);_0x53a74e[_0x7e65('0x65')](db['sequelize']['query'](_0x4cb93f[_0x7e65('0x66')](),{'type':db[_0x7e65('0x57')]['QueryTypes']['SELECT']})[_0x7e65('0x17')](function(_0x527702){if(_0x527702[_0x7e65('0x31')]===0x1){return _0xbc4ab3['id'];}else{var _0x590833=_[_0x7e65('0x67')](_[_0x7e65('0x1f')](_0x527702,'TeamId'),function(_0x4bddcc){return _['includes'](_0x40f809,_0x4bddcc);});if(_0x590833){return _0xbc4ab3['id'];}}}));}}return BPromise[_0x7e65('0x68')](_0x53a74e)[_0x7e65('0x17')](function(_0x14634b){_0x16a261=_(_0x16a261)[_0x7e65('0x69')](_0x14634b)[_0x7e65('0x6a')]()[_0x7e65('0x6b')]();return db['ChatQueue']['find']({'where':{'id':_0x32b7ff[_0x7e65('0x29')]['id']}})[_0x7e65('0x17')](function(_0x3cdc55){return db['sequelize'][_0x7e65('0x6c')](function(_0x21c072){return _0x3cdc55['removeTeams'](_0x32b7ff['query'][_0x7e65('0x52')],{'transaction':_0x21c072})[_0x7e65('0x17')](function(){if(!_['isEmpty'](_0x16a261)){return _0x3cdc55[_0x7e65('0x6d')](_0x16a261,{'transaction':_0x21c072});}})[_0x7e65('0x17')](function(){_0x16a261[_0x7e65('0x59')](function(_0x36d16c){socket[_0x7e65('0x5a')](_0x7e65('0x6e'),{'UserId':_0x36d16c,'ChatQueueId':_0x3cdc55['id']});});});});});});})[_0x7e65('0x17')](respondWithStatusCode(_0x30572d,null))[_0x7e65('0x27')](handleError(_0x30572d,null));};exports[_0x7e65('0x6f')]=function(_0x9c95e6,_0x165854){return db[_0x7e65('0x20')]['find']({'where':{'id':_0x9c95e6[_0x7e65('0x29')]['id']}})[_0x7e65('0x17')](handleEntityNotFound(_0x165854,null))[_0x7e65('0x17')](function(_0x213ded){if(_0x213ded){return _0x213ded[_0x7e65('0x6f')](_0x9c95e6['body'][_0x7e65('0x52')],_[_0x7e65('0x70')](_0x9c95e6['body'],['ids','id'])||{})[_0x7e65('0x71')](function(_0x131e52){for(var _0x3a0571=0x0;_0x3a0571<_0x9c95e6['body'][_0x7e65('0x52')]['length'];_0x3a0571+=0x1){socket[_0x7e65('0x5a')](_0x7e65('0x5b'),{'UserId':Number(_0x9c95e6['body'][_0x7e65('0x52')][_0x3a0571]),'ChatQueueId':Number(_0x9c95e6[_0x7e65('0x29')]['id'])});}return _0x131e52;});}})[_0x7e65('0x17')](respondWithResult(_0x165854,null))[_0x7e65('0x27')](handleError(_0x165854,null));};exports[_0x7e65('0x6d')]=function(_0x35c564,_0x3c4696){return db[_0x7e65('0x20')][_0x7e65('0x33')]({'where':{'id':_0x35c564['params']['id']}})[_0x7e65('0x17')](handleEntityNotFound(_0x3c4696,null))[_0x7e65('0x17')](function(_0x3984ac){if(_0x3984ac){return _0x3984ac[_0x7e65('0x6d')](_0x35c564[_0x7e65('0x2c')][_0x7e65('0x52')])[_0x7e65('0x17')](function(){if(_[_0x7e65('0x72')](_0x35c564[_0x7e65('0x2c')]['ids'])){for(var _0x30e547=0x0;_0x30e547<_0x35c564[_0x7e65('0x2c')][_0x7e65('0x52')][_0x7e65('0x31')];_0x30e547+=0x1){socket[_0x7e65('0x5a')](_0x7e65('0x6e'),{'UserId':Number(_0x35c564[_0x7e65('0x2c')][_0x7e65('0x52')][_0x30e547]),'ChatQueueId':Number(_0x35c564[_0x7e65('0x29')]['id'])});}}else{socket[_0x7e65('0x5a')](_0x7e65('0x6e'),{'UserId':Number(_0x35c564['query'][_0x7e65('0x52')]),'ChatQueueId':Number(_0x35c564[_0x7e65('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x3c4696,null))['catch'](handleError(_0x3c4696,null));};exports[_0x7e65('0x73')]=function(_0x44734f,_0x22a544){var _0x1aa430={};var _0x465b17={};var _0x267531;var _0x400c04;return db[_0x7e65('0x20')][_0x7e65('0x3e')]({'where':{'id':_0x44734f[_0x7e65('0x29')]['id']}})[_0x7e65('0x17')](handleEntityNotFound(_0x22a544,null))[_0x7e65('0x17')](function(_0x2af27f){if(_0x2af27f){_0x267531=_0x2af27f;_0x465b17[_0x7e65('0x2a')]=_[_0x7e65('0x2b')](db[_0x7e65('0x46')][_0x7e65('0x21')]);_0x465b17[_0x7e65('0x2c')]=_[_0x7e65('0x2b')](_0x44734f[_0x7e65('0x2c')]);_0x465b17[_0x7e65('0x2d')]=_['intersection'](_0x465b17['model'],_0x465b17[_0x7e65('0x2c')]);_0x1aa430[_0x7e65('0x30')]=_[_0x7e65('0x2e')](_0x465b17[_0x7e65('0x2a')],qs[_0x7e65('0x2f')](_0x44734f[_0x7e65('0x2c')][_0x7e65('0x2f')]));_0x1aa430[_0x7e65('0x30')]=_0x1aa430['attributes'][_0x7e65('0x31')]?_0x1aa430[_0x7e65('0x30')]:_0x465b17[_0x7e65('0x2a')];_0x1aa430[_0x7e65('0x41')]=qs[_0x7e65('0x42')](_0x44734f[_0x7e65('0x2c')][_0x7e65('0x42')]);_0x1aa430[_0x7e65('0x24')]=qs[_0x7e65('0x2d')](_[_0x7e65('0x43')](_0x44734f[_0x7e65('0x2c')],_0x465b17[_0x7e65('0x2d')]));if(_0x44734f[_0x7e65('0x2c')][_0x7e65('0x44')]){_0x1aa430[_0x7e65('0x24')]=_[_0x7e65('0x32')](_0x1aa430['where'],{'$or':_[_0x7e65('0x1f')](_0x1aa430[_0x7e65('0x30')],function(_0x4a0371){var _0x935eae={};_0x935eae[_0x4a0371]={'$like':'%'+_0x44734f[_0x7e65('0x2c')][_0x7e65('0x44')]+'%'};return _0x935eae;})});}_0x1aa430=_['merge']({},_0x1aa430,_0x44734f[_0x7e65('0x45')]);return _0x267531[_0x7e65('0x73')](_0x1aa430);}})['then'](function(_0x3def7f){if(_0x3def7f){_0x400c04=_0x3def7f[_0x7e65('0x31')];if(!_0x44734f[_0x7e65('0x2c')][_0x7e65('0x40')](_0x7e65('0x50'))){_0x1aa430[_0x7e65('0x12')]=qs[_0x7e65('0x12')](_0x44734f[_0x7e65('0x2c')][_0x7e65('0x12')]);_0x1aa430[_0x7e65('0x10')]=qs[_0x7e65('0x10')](_0x44734f[_0x7e65('0x2c')][_0x7e65('0x10')]);}return _0x267531[_0x7e65('0x73')](_0x1aa430);}})[_0x7e65('0x17')](function(_0x39b086){if(_0x39b086){return _0x39b086?{'count':_0x400c04,'rows':_0x39b086}:null;}})[_0x7e65('0x17')](respondWithResult(_0x22a544,null))[_0x7e65('0x27')](handleError(_0x22a544,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 037b5ef..e437e70 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 _0xb0c3=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x2a40ce,_0x1cebaa){var _0x134442=function(_0x43c8ab){while(--_0x43c8ab){_0x2a40ce['push'](_0x2a40ce['shift']());}};_0x134442(++_0x1cebaa);}(_0xb0c3,0x12e));var _0x3b0c=function(_0x44148f,_0x1d1769){_0x44148f=_0x44148f-0x0;var _0x28eef3=_0xb0c3[_0x44148f];return _0x28eef3;};'use strict';var EventEmitter=require(_0x3b0c('0x0'));var ChatQueue=require(_0x3b0c('0x1'))['db'][_0x3b0c('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x3b0c('0x3')](0x0);var events={'afterCreate':_0x3b0c('0x4'),'afterUpdate':_0x3b0c('0x5'),'afterDestroy':_0x3b0c('0x6')};function emitEvent(_0x4ef5c3){return function(_0x1d4b43,_0x4d1866,_0x212503){ChatQueueEvents[_0x3b0c('0x7')](_0x4ef5c3+':'+_0x1d4b43['id'],_0x1d4b43);ChatQueueEvents[_0x3b0c('0x7')](_0x4ef5c3,_0x1d4b43);_0x212503(null);};}for(var e in events){if(events[_0x3b0c('0x8')](e)){var event=events[e];ChatQueue[_0x3b0c('0x9')](e,emitEvent(event));}}module[_0x3b0c('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0xe08a=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x2b89dc,_0x8bfa42){var _0x412762=function(_0x42dc39){while(--_0x42dc39){_0x2b89dc['push'](_0x2b89dc['shift']());}};_0x412762(++_0x8bfa42);}(_0xe08a,0x1d9));var _0xae08=function(_0x4ddcba,_0x46d21a){_0x4ddcba=_0x4ddcba-0x0;var _0x47642f=_0xe08a[_0x4ddcba];return _0x47642f;};'use strict';var EventEmitter=require(_0xae08('0x0'));var ChatQueue=require(_0xae08('0x1'))['db'][_0xae08('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xae08('0x3')](0x0);var events={'afterCreate':_0xae08('0x4'),'afterUpdate':_0xae08('0x5'),'afterDestroy':'remove'};function emitEvent(_0xbf1bf6){return function(_0x15d7ce,_0x1ad1d2,_0x1f2f87){ChatQueueEvents[_0xae08('0x6')](_0xbf1bf6+':'+_0x15d7ce['id'],_0x15d7ce);ChatQueueEvents[_0xae08('0x6')](_0xbf1bf6,_0x15d7ce);_0x1f2f87(null);};}for(var e in events){if(events[_0xae08('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xae08('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 3be88dd..28f8dc3 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 _0x9e8c=['./chatQueue.attributes','exports','define','chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0x9e8c,0x12f));var _0xc9e8=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x9e8c[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xc9e8('0x0'));var util=require(_0xc9e8('0x1'));var logger=require(_0xc9e8('0x2'))(_0xc9e8('0x3'));var moment=require('moment');var BPromise=require(_0xc9e8('0x4'));var rp=require(_0xc9e8('0x5'));var fs=require('fs');var path=require(_0xc9e8('0x6'));var rimraf=require(_0xc9e8('0x7'));var config=require(_0xc9e8('0x8'));var attributes=require(_0xc9e8('0x9'));module[_0xc9e8('0xa')]=function(_0x56a5f7,_0x2e67f7){return _0x56a5f7[_0xc9e8('0xb')]('ChatQueue',attributes,{'tableName':_0xc9e8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0912=['exports','define','ChatQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x0912,0xd3));var _0x2091=function(_0x40d4bf,_0x2faffb){_0x40d4bf=_0x40d4bf-0x0;var _0x1a890e=_0x0912[_0x40d4bf];return _0x1a890e;};'use strict';var _=require('lodash');var util=require(_0x2091('0x0'));var logger=require(_0x2091('0x1'))(_0x2091('0x2'));var moment=require(_0x2091('0x3'));var BPromise=require(_0x2091('0x4'));var rp=require(_0x2091('0x5'));var fs=require('fs');var path=require(_0x2091('0x6'));var rimraf=require(_0x2091('0x7'));var config=require(_0x2091('0x8'));var attributes=require(_0x2091('0x9'));module[_0x2091('0xa')]=function(_0xe7f56d,_0x318e07){return _0xe7f56d[_0x2091('0xb')](_0x2091('0xc'),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 7d28195..4486935 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 _0xbbbc=['model','include','then','debug','catch','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','map'];(function(_0x46734b,_0x5f0ce4){var _0x23a413=function(_0xa454f8){while(--_0xa454f8){_0x46734b['push'](_0x46734b['shift']());}};_0x23a413(++_0x5f0ce4);}(_0xbbbc,0xf6));var _0xcbbb=function(_0xc89c5f,_0x8032a7){_0xc89c5f=_0xc89c5f-0x0;var _0x2d1ab1=_0xbbbc[_0xc89c5f];return _0x2d1ab1;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require(_0xcbbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')]['http']({'port':0x232a});config[_0xcbbb('0xc')]=_[_0xcbbb('0xd')](config[_0xcbbb('0xc')],{'host':_0xcbbb('0xe'),'port':0x18eb});var socket=require(_0xcbbb('0xf'))(new Redis(config[_0xcbbb('0xc')]));require(_0xcbbb('0x10'))['register'](socket);function respondWithRpcPromise(_0x225156,_0x4b0138,_0x5893f9){return new BPromise(function(_0x107c35,_0x56c7d0){return client[_0xcbbb('0x11')](_0x225156,_0x5893f9)['then'](function(_0x3766c2){logger[_0xcbbb('0x12')]('ChatQueue,\x20%s,\x20%s',_0x4b0138,_0xcbbb('0x13'));logger['debug'](_0xcbbb('0x14'),_0x4b0138,'request\x20sent',JSON[_0xcbbb('0x15')](_0x3766c2));if(_0x3766c2[_0xcbbb('0x16')]){if(_0x3766c2[_0xcbbb('0x16')]['code']===0x1f4){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x56c7d0(_0x3766c2['error']['message']);}logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x107c35(_0x3766c2['error'][_0xcbbb('0x18')]);}else{logger['info'](_0xcbbb('0x17'),_0x4b0138,_0xcbbb('0x13'));_0x107c35(_0x3766c2[_0xcbbb('0x19')]['message']);}})['catch'](function(_0x4bcd9a){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x4bcd9a);_0x56c7d0(_0x4bcd9a);});});}exports[_0xcbbb('0x1a')]=function(_0x25e92f){var _0x658337=this;return new Promise(function(_0x1cca90,_0x45de5f){return db[_0xcbbb('0x1b')][_0xcbbb('0x1c')]({'raw':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f['options'][_0xcbbb('0x1e')]===undefined?!![]:![]:!![],'where':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f[_0xcbbb('0x1d')][_0xcbbb('0x1f')]||null:null,'attributes':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f[_0xcbbb('0x1d')][_0xcbbb('0x20')]||null:null,'limit':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f[_0xcbbb('0x1d')]['limit']||null:null,'include':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f[_0xcbbb('0x1d')]['include']?_[_0xcbbb('0x21')](_0x25e92f['options']['include'],function(_0x575d56){return{'model':db[_0x575d56[_0xcbbb('0x22')]],'as':_0x575d56['as'],'attributes':_0x575d56['attributes'],'include':_0x575d56['include']?_['map'](_0x575d56[_0xcbbb('0x23')],function(_0x55e1d8){return{'model':db[_0x55e1d8['model']],'as':_0x55e1d8['as'],'attributes':_0x55e1d8[_0xcbbb('0x20')],'include':_0x55e1d8[_0xcbbb('0x23')]?_[_0xcbbb('0x21')](_0x55e1d8[_0xcbbb('0x23')],function(_0x372024){return{'model':db[_0x372024[_0xcbbb('0x22')]],'as':_0x372024['as'],'attributes':_0x372024[_0xcbbb('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcbbb('0x24')](function(_0x2a023f){logger[_0xcbbb('0x12')](_0xcbbb('0x1a'),_0x25e92f);logger[_0xcbbb('0x25')](_0xcbbb('0x1a'),_0x25e92f,JSON[_0xcbbb('0x15')](_0x2a023f));_0x1cca90(_0x2a023f);})[_0xcbbb('0x26')](function(_0xcae72c){logger[_0xcbbb('0x16')](_0xcbbb('0x1a'),_0xcae72c['message'],_0x25e92f);_0x45de5f(_0x658337[_0xcbbb('0x16')](0x1f4,_0xcae72c[_0xcbbb('0x18')]));});});};exports['ShowChatQueue']=function(_0xec2761){var _0x539dcf=this;return new Promise(function(_0x2d37d3,_0x1fb05e){return db[_0xcbbb('0x1b')]['find']({'raw':_0xec2761[_0xcbbb('0x1d')]?_0xec2761[_0xcbbb('0x1d')][_0xcbbb('0x1e')]===undefined?!![]:![]:!![],'where':_0xec2761[_0xcbbb('0x1d')]?_0xec2761[_0xcbbb('0x1d')][_0xcbbb('0x1f')]||null:null,'attributes':_0xec2761[_0xcbbb('0x1d')]?_0xec2761[_0xcbbb('0x1d')][_0xcbbb('0x20')]||null:null,'include':_0xec2761[_0xcbbb('0x1d')]?_0xec2761['options']['include']?_['map'](_0xec2761['options'][_0xcbbb('0x23')],function(_0x5ccc55){return{'model':db[_0x5ccc55[_0xcbbb('0x22')]],'as':_0x5ccc55['as'],'attributes':_0x5ccc55[_0xcbbb('0x20')],'include':_0x5ccc55[_0xcbbb('0x23')]?_[_0xcbbb('0x21')](_0x5ccc55[_0xcbbb('0x23')],function(_0x39a417){return{'model':db[_0x39a417[_0xcbbb('0x22')]],'as':_0x39a417['as'],'attributes':_0x39a417[_0xcbbb('0x20')],'include':_0x39a417[_0xcbbb('0x23')]?_[_0xcbbb('0x21')](_0x39a417['include'],function(_0x5f578f){return{'model':db[_0x5f578f[_0xcbbb('0x22')]],'as':_0x5f578f['as'],'attributes':_0x5f578f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dbd8d){logger[_0xcbbb('0x12')](_0xcbbb('0x27'),_0xec2761);logger[_0xcbbb('0x25')](_0xcbbb('0x27'),_0xec2761,JSON[_0xcbbb('0x15')](_0x5dbd8d));_0x2d37d3(_0x5dbd8d);})[_0xcbbb('0x26')](function(_0x18054f){logger[_0xcbbb('0x16')](_0xcbbb('0x27'),_0x18054f[_0xcbbb('0x18')],_0xec2761);_0x1fb05e(_0x539dcf[_0xcbbb('0x16')](0x1f4,_0x18054f['message']));});});}; \ No newline at end of file +var _0x3670=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','include','model','map','stringify','ShowChatQueue','find','util','moment','bluebird','randomstring','ioredis'];(function(_0x30eeed,_0x37cb64){var _0x44fe07=function(_0x571bff){while(--_0x571bff){_0x30eeed['push'](_0x30eeed['shift']());}};_0x44fe07(++_0x37cb64);}(_0x3670,0x16c));var _0x0367=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3670[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x0367('0x0'));var moment=require(_0x0367('0x1'));var BPromise=require(_0x0367('0x2'));var rs=require(_0x0367('0x3'));var fs=require('fs');var Redis=require(_0x0367('0x4'));var db=require(_0x0367('0x5'))['db'];var utils=require(_0x0367('0x6'));var logger=require('../../config/logger')(_0x0367('0x7'));var config=require(_0x0367('0x8'));var jayson=require(_0x0367('0x9'));var client=jayson[_0x0367('0xa')][_0x0367('0xb')]({'port':0x232a});config[_0x0367('0xc')]=_[_0x0367('0xd')](config[_0x0367('0xc')],{'host':_0x0367('0xe'),'port':0x18eb});var socket=require(_0x0367('0xf'))(new Redis(config[_0x0367('0xc')]));require(_0x0367('0x10'))[_0x0367('0x11')](socket);function respondWithRpcPromise(_0x27d570,_0x412c44,_0x2036c0){return new BPromise(function(_0x5437d0,_0x323471){return client['request'](_0x27d570,_0x2036c0)[_0x0367('0x12')](function(_0x23f4c8){logger[_0x0367('0x13')](_0x0367('0x14'),_0x412c44,_0x0367('0x15'));logger[_0x0367('0x16')](_0x0367('0x17'),_0x412c44,_0x0367('0x15'),JSON['stringify'](_0x23f4c8));if(_0x23f4c8[_0x0367('0x18')]){if(_0x23f4c8[_0x0367('0x18')]['code']===0x1f4){logger[_0x0367('0x18')](_0x0367('0x14'),_0x412c44,_0x23f4c8[_0x0367('0x18')]['message']);return _0x323471(_0x23f4c8[_0x0367('0x18')][_0x0367('0x19')]);}logger[_0x0367('0x18')](_0x0367('0x14'),_0x412c44,_0x23f4c8['error']['message']);return _0x5437d0(_0x23f4c8[_0x0367('0x18')][_0x0367('0x19')]);}else{logger[_0x0367('0x13')]('ChatQueue,\x20%s,\x20%s',_0x412c44,'request\x20sent');_0x5437d0(_0x23f4c8[_0x0367('0x1a')][_0x0367('0x19')]);}})[_0x0367('0x1b')](function(_0x383217){logger['error'](_0x0367('0x14'),_0x412c44,_0x383217);_0x323471(_0x383217);});});}exports[_0x0367('0x1c')]=function(_0x14ddf2){var _0x2f8d0d=this;return new Promise(function(_0x50551d,_0x5de2fd){return db[_0x0367('0x1d')][_0x0367('0x1e')]({'raw':_0x14ddf2['options']?_0x14ddf2['options'][_0x0367('0x1f')]===undefined?!![]:![]:!![],'where':_0x14ddf2[_0x0367('0x20')]?_0x14ddf2[_0x0367('0x20')][_0x0367('0x21')]||null:null,'attributes':_0x14ddf2[_0x0367('0x20')]?_0x14ddf2[_0x0367('0x20')][_0x0367('0x22')]||null:null,'limit':_0x14ddf2[_0x0367('0x20')]?_0x14ddf2['options']['limit']||null:null,'include':_0x14ddf2[_0x0367('0x20')]?_0x14ddf2[_0x0367('0x20')][_0x0367('0x23')]?_['map'](_0x14ddf2['options'][_0x0367('0x23')],function(_0x520a84){return{'model':db[_0x520a84[_0x0367('0x24')]],'as':_0x520a84['as'],'attributes':_0x520a84[_0x0367('0x22')],'include':_0x520a84[_0x0367('0x23')]?_[_0x0367('0x25')](_0x520a84[_0x0367('0x23')],function(_0x5c2905){return{'model':db[_0x5c2905[_0x0367('0x24')]],'as':_0x5c2905['as'],'attributes':_0x5c2905[_0x0367('0x22')],'include':_0x5c2905[_0x0367('0x23')]?_[_0x0367('0x25')](_0x5c2905['include'],function(_0x2ed10e){return{'model':db[_0x2ed10e[_0x0367('0x24')]],'as':_0x2ed10e['as'],'attributes':_0x2ed10e[_0x0367('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46461f){logger[_0x0367('0x13')]('GetChatQueue',_0x14ddf2);logger[_0x0367('0x16')](_0x0367('0x1c'),_0x14ddf2,JSON[_0x0367('0x26')](_0x46461f));_0x50551d(_0x46461f);})[_0x0367('0x1b')](function(_0x382370){logger['error'](_0x0367('0x1c'),_0x382370['message'],_0x14ddf2);_0x5de2fd(_0x2f8d0d[_0x0367('0x18')](0x1f4,_0x382370[_0x0367('0x19')]));});});};exports[_0x0367('0x27')]=function(_0xb6ab1b){var _0x16265a=this;return new Promise(function(_0x157dd2,_0x4edac8){return db[_0x0367('0x1d')][_0x0367('0x28')]({'raw':_0xb6ab1b[_0x0367('0x20')]?_0xb6ab1b['options'][_0x0367('0x1f')]===undefined?!![]:![]:!![],'where':_0xb6ab1b[_0x0367('0x20')]?_0xb6ab1b[_0x0367('0x20')][_0x0367('0x21')]||null:null,'attributes':_0xb6ab1b[_0x0367('0x20')]?_0xb6ab1b[_0x0367('0x20')]['attributes']||null:null,'include':_0xb6ab1b[_0x0367('0x20')]?_0xb6ab1b['options'][_0x0367('0x23')]?_[_0x0367('0x25')](_0xb6ab1b[_0x0367('0x20')]['include'],function(_0x33395f){return{'model':db[_0x33395f['model']],'as':_0x33395f['as'],'attributes':_0x33395f['attributes'],'include':_0x33395f[_0x0367('0x23')]?_[_0x0367('0x25')](_0x33395f[_0x0367('0x23')],function(_0x843a58){return{'model':db[_0x843a58['model']],'as':_0x843a58['as'],'attributes':_0x843a58[_0x0367('0x22')],'include':_0x843a58[_0x0367('0x23')]?_[_0x0367('0x25')](_0x843a58[_0x0367('0x23')],function(_0x5d60c3){return{'model':db[_0x5d60c3['model']],'as':_0x5d60c3['as'],'attributes':_0x5d60c3[_0x0367('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0367('0x12')](function(_0x2d4a0b){logger[_0x0367('0x13')](_0x0367('0x27'),_0xb6ab1b);logger[_0x0367('0x16')](_0x0367('0x27'),_0xb6ab1b,JSON['stringify'](_0x2d4a0b));_0x157dd2(_0x2d4a0b);})['catch'](function(_0x2f4660){logger[_0x0367('0x18')](_0x0367('0x27'),_0x2f4660[_0x0367('0x19')],_0xb6ab1b);_0x4edac8(_0x16265a[_0x0367('0x18')](0x1f4,_0x2f4660[_0x0367('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index f258c79..ce84fd1 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 _0x29d4=['removeListener','register','length','./chatQueue.events','remove','update'];(function(_0x22bb7c,_0x4c17ab){var _0x53d6aa=function(_0x5a2e30){while(--_0x5a2e30){_0x22bb7c['push'](_0x22bb7c['shift']());}};_0x53d6aa(++_0x4c17ab);}(_0x29d4,0x1a1));var _0x429d=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x29d4[_0x29b609];return _0x54c952;};'use strict';var ChatQueueEvents=require(_0x429d('0x0'));var events=['save',_0x429d('0x1'),_0x429d('0x2')];function createListener(_0x16ce75,_0x472fc9){return function(_0x45df1c){_0x472fc9['emit'](_0x16ce75,_0x45df1c);};}function removeListener(_0xc3989d,_0x3f43f5){return function(){ChatQueueEvents[_0x429d('0x3')](_0xc3989d,_0x3f43f5);};}exports[_0x429d('0x4')]=function(_0x1c55aa){for(var _0xa71445=0x0,_0x56aa2f=events[_0x429d('0x5')];_0xa71445<_0x56aa2f;_0xa71445++){var _0x4befb9=events[_0xa71445];var _0x9fc337=createListener('chatQueue:'+_0x4befb9,_0x1c55aa);ChatQueueEvents['on'](_0x4befb9,_0x9fc337);}}; \ No newline at end of file +var _0x3e74=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','remove','update'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x3e74,0x175));var _0x43e7=function(_0x14fa8e,_0x342486){_0x14fa8e=_0x14fa8e-0x0;var _0x40a59f=_0x3e74[_0x14fa8e];return _0x40a59f;};'use strict';var ChatQueueEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){ChatQueueEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);ChatQueueEvents['on'](_0x3491d6,_0x2ede2d);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index b49d228..4209f9f 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(_0x3a21c1,_0x1dcf73){var _0x5be9c6=function(_0x4fb58e){while(--_0x4fb58e){_0x3a21c1['push'](_0x3a21c1['shift']());}};_0x5be9c6(++_0x1dcf73);}(_0xe14b,0x93));var _0xbe14=function(_0x1fdd12,_0x2d92bb){_0x1fdd12=_0x1fdd12-0x0;var _0x2b7c26=_0xe14b[_0x1fdd12];return _0x2b7c26;};'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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x5fc3[_0x3cb6dc];return _0x47ec89;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 51051bd..11ac765 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 _0x3cf5=['sequelize','exports','STRING','DATE','moment'];(function(_0x17396e,_0x21cd31){var _0x3c1e80=function(_0x5e41d2){while(--_0x5e41d2){_0x17396e['push'](_0x17396e['shift']());}};_0x3c1e80(++_0x21cd31);}(_0x3cf5,0x1a3));var _0x53cf=function(_0x4c9d58,_0x1c83f0){_0x4c9d58=_0x4c9d58-0x0;var _0x3ad22d=_0x3cf5[_0x4c9d58];return _0x3ad22d;};'use strict';var moment=require(_0x53cf('0x0'));var Sequelize=require(_0x53cf('0x1'));module[_0x53cf('0x2')]={'uniqueid':{'type':Sequelize[_0x53cf('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x53cf('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x53cf('0x4')]},'exitAt':{'type':Sequelize[_0x53cf('0x4')]},'reason':{'type':Sequelize[_0x53cf('0x3')]}}; \ No newline at end of file +var _0xe5f5=['DATE','moment','sequelize','exports','STRING'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xe5f5,0x1e6));var _0x5e5f=function(_0x133a85,_0x2435ea){_0x133a85=_0x133a85-0x0;var _0x54cac6=_0xe5f5[_0x133a85];return _0x54cac6;};'use strict';var moment=require(_0x5e5f('0x0'));var Sequelize=require(_0x5e5f('0x1'));module[_0x5e5f('0x2')]={'uniqueid':{'type':Sequelize[_0x5e5f('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x5e5f('0x4')]},'leaveAt':{'type':Sequelize[_0x5e5f('0x4')]},'acceptAt':{'type':Sequelize[_0x5e5f('0x4')]},'exitAt':{'type':Sequelize[_0x5e5f('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 2545d4a..ebe5572 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 _0x1c63=['merge','options','ChatQueueReport','findAll','rows','keys','includeAll','include','find','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','update','then','destroy','map','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter'];(function(_0x96c154,_0x2db1aa){var _0x43fb6d=function(_0x1d1417){while(--_0x1d1417){_0x96c154['push'](_0x96c154['shift']());}};_0x43fb6d(++_0x2db1aa);}(_0x1c63,0xdc));var _0x31c6=function(_0x349b8a,_0x35b021){_0x349b8a=_0x349b8a-0x0;var _0x1d5645=_0x1c63[_0x349b8a];return _0x1d5645;};'use strict';var emlformat=require(_0x31c6('0x0'));var rimraf=require(_0x31c6('0x1'));var zipdir=require(_0x31c6('0x2'));var jsonpatch=require(_0x31c6('0x3'));var rp=require('request-promise');var moment=require(_0x31c6('0x4'));var BPromise=require(_0x31c6('0x5'));var Mustache=require(_0x31c6('0x6'));var util=require('util');var path=require(_0x31c6('0x7'));var sox=require(_0x31c6('0x8'));var csv=require(_0x31c6('0x9'));var ejs=require(_0x31c6('0xa'));var fs=require('fs');var fs_extra=require(_0x31c6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x31c6('0xc'));var jsforce=require(_0x31c6('0xd'));var deskjs=require(_0x31c6('0xe'));var toCsv=require(_0x31c6('0x9'));var querystring=require(_0x31c6('0xf'));var Papa=require('papaparse');var Redis=require(_0x31c6('0x10'));var authService=require(_0x31c6('0x11'));var qs=require(_0x31c6('0x12'));var as=require(_0x31c6('0x13'));var hardwareService=require(_0x31c6('0x14'));var logger=require('../../config/logger')(_0x31c6('0x15'));var utils=require('../../config/utils');var config=require(_0x31c6('0x16'));var licenseUtil=require(_0x31c6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53c23d,_0x3424f0){_0x3424f0=_0x3424f0||0xcc;return function(_0x12f99c){if(_0x12f99c){return _0x53c23d[_0x31c6('0x18')](_0x3424f0);}return _0x53c23d[_0x31c6('0x19')](_0x3424f0)[_0x31c6('0x1a')]();};}function respondWithResult(_0x4d1710,_0x11e6a4){_0x11e6a4=_0x11e6a4||0xc8;return function(_0x3995cc){if(_0x3995cc){return _0x4d1710[_0x31c6('0x19')](_0x11e6a4)[_0x31c6('0x1b')](_0x3995cc);}};}function respondWithFilteredResult(_0x7a8c46,_0x5f1d49){return function(_0x5f2c85){if(_0x5f2c85){var _0x497264=typeof _0x5f1d49['offset']===_0x31c6('0x1c')&&typeof _0x5f1d49['limit']===_0x31c6('0x1c');var _0x2a4780=_0x5f2c85[_0x31c6('0x1d')];var _0xf352af=_0x497264?0x0:_0x5f1d49[_0x31c6('0x1e')];var _0x4c7f34=_0x497264?_0x5f2c85[_0x31c6('0x1d')]:_0x5f1d49[_0x31c6('0x1e')]+_0x5f1d49['limit'];var _0x593d2b;if(_0x4c7f34>=_0x2a4780){_0x4c7f34=_0x2a4780;_0x593d2b=0xc8;}else{_0x593d2b=0xce;}_0x7a8c46['status'](_0x593d2b);return _0x7a8c46[_0x31c6('0x1f')](_0x31c6('0x20'),_0xf352af+'-'+_0x4c7f34+'/'+_0x2a4780)[_0x31c6('0x1b')](_0x5f2c85);}return null;};}function patchUpdates(_0x24602f){return function(_0x4f17e5){try{jsonpatch['apply'](_0x4f17e5,_0x24602f,!![]);}catch(_0x4070f6){return BPromise[_0x31c6('0x21')](_0x4070f6);}return _0x4f17e5['save']();};}function saveUpdates(_0x339588,_0x1c6fda){return function(_0x392723){if(_0x392723){return _0x392723[_0x31c6('0x22')](_0x339588)[_0x31c6('0x23')](function(_0x509bed){return _0x509bed;});}return null;};}function removeEntity(_0x287c59,_0x536e57){return function(_0x8773d4){if(_0x8773d4){return _0x8773d4[_0x31c6('0x24')]()['then'](function(){_0x287c59['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x412a8a,_0x250ab1){return function(_0x551291){if(!_0x551291){_0x412a8a[_0x31c6('0x18')](0x194);}return _0x551291;};}function handleError(_0x44bf50,_0x2c9d78){_0x2c9d78=_0x2c9d78||0x1f4;return function(_0x2fb5f3){logger['error'](_0x2fb5f3['stack']);if(_0x2fb5f3['name']){delete _0x2fb5f3['name'];}_0x44bf50[_0x31c6('0x19')](_0x2c9d78)['send'](_0x2fb5f3);};}exports['index']=function(_0x1e24fa,_0x2034cc){var _0x5e3ed0={},_0x41100c={},_0x47a0cd={'count':0x0,'rows':[]};var _0x1d5ab5=_[_0x31c6('0x25')](db['ChatQueueReport'][_0x31c6('0x26')],function(_0x3840de){return{'name':_0x3840de[_0x31c6('0x27')],'type':_0x3840de[_0x31c6('0x28')][_0x31c6('0x29')]};});_0x41100c[_0x31c6('0x2a')]=_['map'](_0x1d5ab5,_0x31c6('0x2b'));_0x41100c[_0x31c6('0x2c')]=_['keys'](_0x1e24fa[_0x31c6('0x2c')]);_0x41100c[_0x31c6('0x2d')]=_['intersection'](_0x41100c['model'],_0x41100c['query']);_0x5e3ed0[_0x31c6('0x2e')]=_[_0x31c6('0x2f')](_0x41100c['model'],qs[_0x31c6('0x30')](_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x30')]));_0x5e3ed0[_0x31c6('0x2e')]=_0x5e3ed0[_0x31c6('0x2e')]['length']?_0x5e3ed0[_0x31c6('0x2e')]:_0x41100c[_0x31c6('0x2a')];if(!_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x31')](_0x31c6('0x32'))){_0x5e3ed0[_0x31c6('0x33')]=qs[_0x31c6('0x33')](_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x33')]);_0x5e3ed0['offset']=qs[_0x31c6('0x1e')](_0x1e24fa[_0x31c6('0x2c')]['offset']);}_0x5e3ed0[_0x31c6('0x34')]=qs[_0x31c6('0x35')](_0x1e24fa['query'][_0x31c6('0x35')]);_0x5e3ed0[_0x31c6('0x36')]=qs[_0x31c6('0x2d')](_['pick'](_0x1e24fa[_0x31c6('0x2c')],_0x41100c['filters']),_0x1d5ab5);if(_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x37')]){_0x5e3ed0[_0x31c6('0x36')]=_['merge'](_0x5e3ed0[_0x31c6('0x36')],{'$or':_[_0x31c6('0x25')](_0x1d5ab5,function(_0xdf5348){if(_0xdf5348[_0x31c6('0x28')]!=='VIRTUAL'){var _0x506491={};_0x506491[_0xdf5348[_0x31c6('0x2b')]]={'$like':'%'+_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x37')]+'%'};return _0x506491;}})});}_0x5e3ed0=_[_0x31c6('0x38')]({},_0x5e3ed0,_0x1e24fa[_0x31c6('0x39')]);var _0xeed7d7={'where':_0x5e3ed0[_0x31c6('0x36')]};return db[_0x31c6('0x3a')][_0x31c6('0x1d')](_0xeed7d7)[_0x31c6('0x23')](function(_0x4dba99){_0x47a0cd[_0x31c6('0x1d')]=_0x4dba99;if(_0x1e24fa[_0x31c6('0x2c')]['includeAll']){_0x5e3ed0['include']=[{'all':!![]}];}return db[_0x31c6('0x3a')][_0x31c6('0x3b')](_0x5e3ed0);})[_0x31c6('0x23')](function(_0xd85393){_0x47a0cd[_0x31c6('0x3c')]=_0xd85393;return _0x47a0cd;})[_0x31c6('0x23')](respondWithFilteredResult(_0x2034cc,_0x5e3ed0))['catch'](handleError(_0x2034cc,null));};exports['show']=function(_0x31c919,_0x5195b0){var _0x2c2129={'raw':!![],'where':{'id':_0x31c919['params']['id']}},_0x1f0b73={};_0x1f0b73[_0x31c6('0x2a')]=_[_0x31c6('0x3d')](db[_0x31c6('0x3a')][_0x31c6('0x26')]);_0x1f0b73[_0x31c6('0x2c')]=_[_0x31c6('0x3d')](_0x31c919['query']);_0x1f0b73[_0x31c6('0x2d')]=_[_0x31c6('0x2f')](_0x1f0b73[_0x31c6('0x2a')],_0x1f0b73[_0x31c6('0x2c')]);_0x2c2129[_0x31c6('0x2e')]=_['intersection'](_0x1f0b73[_0x31c6('0x2a')],qs[_0x31c6('0x30')](_0x31c919[_0x31c6('0x2c')][_0x31c6('0x30')]));_0x2c2129['attributes']=_0x2c2129[_0x31c6('0x2e')]['length']?_0x2c2129[_0x31c6('0x2e')]:_0x1f0b73[_0x31c6('0x2a')];if(_0x31c919[_0x31c6('0x2c')][_0x31c6('0x3e')]){_0x2c2129[_0x31c6('0x3f')]=[{'all':!![]}];}_0x2c2129=_['merge']({},_0x2c2129,_0x31c919[_0x31c6('0x39')]);return db[_0x31c6('0x3a')][_0x31c6('0x40')](_0x2c2129)[_0x31c6('0x23')](handleEntityNotFound(_0x5195b0,null))[_0x31c6('0x23')](respondWithResult(_0x5195b0,null))[_0x31c6('0x41')](handleError(_0x5195b0,null));};exports['create']=function(_0x36fc66,_0x52d06d){return db[_0x31c6('0x3a')]['create'](_0x36fc66['body'],{})[_0x31c6('0x23')](respondWithResult(_0x52d06d,0xc9))[_0x31c6('0x41')](handleError(_0x52d06d,null));};exports['update']=function(_0xf33b6c,_0x129197){if(_0xf33b6c[_0x31c6('0x42')]['id']){delete _0xf33b6c['body']['id'];}return db['ChatQueueReport'][_0x31c6('0x40')]({'where':{'id':_0xf33b6c[_0x31c6('0x43')]['id']}})[_0x31c6('0x23')](handleEntityNotFound(_0x129197,null))[_0x31c6('0x23')](saveUpdates(_0xf33b6c[_0x31c6('0x42')],null))[_0x31c6('0x23')](respondWithResult(_0x129197,null))[_0x31c6('0x41')](handleError(_0x129197,null));};exports[_0x31c6('0x24')]=function(_0x21ead7,_0x10f5b1){return db[_0x31c6('0x3a')][_0x31c6('0x40')]({'where':{'id':_0x21ead7['params']['id']}})['then'](handleEntityNotFound(_0x10f5b1,null))['then'](removeEntity(_0x10f5b1,null))[_0x31c6('0x41')](handleError(_0x10f5b1,null));};exports[_0x31c6('0x44')]=function(_0x1b0999,_0x433a63){return db[_0x31c6('0x3a')][_0x31c6('0x44')]()[_0x31c6('0x23')](respondWithResult(_0x433a63,null))['catch'](handleError(_0x433a63,null));}; \ No newline at end of file +var _0x7fd6=['count','Content-Range','apply','save','update','then','stack','name','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','ChatQueueReport','findAll','catch','show','params','keys','length','includeAll','create','body','find','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x428f3d,_0x1be3e8){var _0x118462=function(_0x23ef99){while(--_0x23ef99){_0x428f3d['push'](_0x428f3d['shift']());}};_0x118462(++_0x1be3e8);}(_0x7fd6,0x157));var _0x67fd=function(_0x86f647,_0x34beaa){_0x86f647=_0x86f647-0x0;var _0x2ee4ba=_0x7fd6[_0x86f647];return _0x2ee4ba;};'use strict';var emlformat=require(_0x67fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x67fd('0x1'));var jsonpatch=require(_0x67fd('0x2'));var rp=require(_0x67fd('0x3'));var moment=require(_0x67fd('0x4'));var BPromise=require(_0x67fd('0x5'));var Mustache=require(_0x67fd('0x6'));var util=require('util');var path=require(_0x67fd('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x67fd('0x8'));var squel=require(_0x67fd('0x9'));var crypto=require(_0x67fd('0xa'));var jsforce=require(_0x67fd('0xb'));var deskjs=require(_0x67fd('0xc'));var toCsv=require(_0x67fd('0xd'));var querystring=require(_0x67fd('0xe'));var Papa=require(_0x67fd('0xf'));var Redis=require('ioredis');var authService=require(_0x67fd('0x10'));var qs=require(_0x67fd('0x11'));var as=require(_0x67fd('0x12'));var hardwareService=require(_0x67fd('0x13'));var logger=require(_0x67fd('0x14'))(_0x67fd('0x15'));var utils=require('../../config/utils');var config=require(_0x67fd('0x16'));var licenseUtil=require(_0x67fd('0x17'));var db=require(_0x67fd('0x18'))['db'];function respondWithStatusCode(_0x133c2f,_0x13dd7c){_0x13dd7c=_0x13dd7c||0xcc;return function(_0x41876c){if(_0x41876c){return _0x133c2f[_0x67fd('0x19')](_0x13dd7c);}return _0x133c2f[_0x67fd('0x1a')](_0x13dd7c)[_0x67fd('0x1b')]();};}function respondWithResult(_0x79379c,_0x9e1983){_0x9e1983=_0x9e1983||0xc8;return function(_0x5e7d9f){if(_0x5e7d9f){return _0x79379c[_0x67fd('0x1a')](_0x9e1983)[_0x67fd('0x1c')](_0x5e7d9f);}};}function respondWithFilteredResult(_0x468b9c,_0x1cf79b){return function(_0x520bbf){if(_0x520bbf){var _0x16fd3a=typeof _0x1cf79b[_0x67fd('0x1d')]==='undefined'&&typeof _0x1cf79b[_0x67fd('0x1e')]===_0x67fd('0x1f');var _0x1d5a3c=_0x520bbf[_0x67fd('0x20')];var _0x412a1c=_0x16fd3a?0x0:_0x1cf79b[_0x67fd('0x1d')];var _0x1f019e=_0x16fd3a?_0x520bbf[_0x67fd('0x20')]:_0x1cf79b['offset']+_0x1cf79b[_0x67fd('0x1e')];var _0x4d7fa8;if(_0x1f019e>=_0x1d5a3c){_0x1f019e=_0x1d5a3c;_0x4d7fa8=0xc8;}else{_0x4d7fa8=0xce;}_0x468b9c[_0x67fd('0x1a')](_0x4d7fa8);return _0x468b9c['set'](_0x67fd('0x21'),_0x412a1c+'-'+_0x1f019e+'/'+_0x1d5a3c)[_0x67fd('0x1c')](_0x520bbf);}return null;};}function patchUpdates(_0x118169){return function(_0x581ed6){try{jsonpatch[_0x67fd('0x22')](_0x581ed6,_0x118169,!![]);}catch(_0x1f3a48){return BPromise['reject'](_0x1f3a48);}return _0x581ed6[_0x67fd('0x23')]();};}function saveUpdates(_0x20f8b6,_0x2cface){return function(_0x5faffc){if(_0x5faffc){return _0x5faffc[_0x67fd('0x24')](_0x20f8b6)[_0x67fd('0x25')](function(_0x24d5c9){return _0x24d5c9;});}return null;};}function removeEntity(_0x186b9a,_0x311c1d){return function(_0x424447){if(_0x424447){return _0x424447['destroy']()[_0x67fd('0x25')](function(){_0x186b9a[_0x67fd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ce47b,_0x365252){return function(_0x7daaa8){if(!_0x7daaa8){_0x5ce47b[_0x67fd('0x19')](0x194);}return _0x7daaa8;};}function handleError(_0x166e94,_0x43aee0){_0x43aee0=_0x43aee0||0x1f4;return function(_0x8d4eff){logger['error'](_0x8d4eff[_0x67fd('0x26')]);if(_0x8d4eff[_0x67fd('0x27')]){delete _0x8d4eff[_0x67fd('0x27')];}_0x166e94['status'](_0x43aee0)['send'](_0x8d4eff);};}exports[_0x67fd('0x28')]=function(_0x3b3393,_0x39c569){var _0x1b4aad={},_0x383ef={},_0x327480={'count':0x0,'rows':[]};var _0x5d24e2=_[_0x67fd('0x29')](db['ChatQueueReport'][_0x67fd('0x2a')],function(_0x9b424b){return{'name':_0x9b424b[_0x67fd('0x2b')],'type':_0x9b424b[_0x67fd('0x2c')]['key']};});_0x383ef['model']=_[_0x67fd('0x29')](_0x5d24e2,'name');_0x383ef[_0x67fd('0x2d')]=_['keys'](_0x3b3393['query']);_0x383ef[_0x67fd('0x2e')]=_[_0x67fd('0x2f')](_0x383ef[_0x67fd('0x30')],_0x383ef[_0x67fd('0x2d')]);_0x1b4aad[_0x67fd('0x31')]=_[_0x67fd('0x2f')](_0x383ef[_0x67fd('0x30')],qs['fields'](_0x3b3393['query'][_0x67fd('0x32')]));_0x1b4aad[_0x67fd('0x31')]=_0x1b4aad['attributes']['length']?_0x1b4aad[_0x67fd('0x31')]:_0x383ef[_0x67fd('0x30')];if(!_0x3b3393[_0x67fd('0x2d')][_0x67fd('0x33')](_0x67fd('0x34'))){_0x1b4aad[_0x67fd('0x1e')]=qs[_0x67fd('0x1e')](_0x3b3393[_0x67fd('0x2d')][_0x67fd('0x1e')]);_0x1b4aad[_0x67fd('0x1d')]=qs[_0x67fd('0x1d')](_0x3b3393['query'][_0x67fd('0x1d')]);}_0x1b4aad[_0x67fd('0x35')]=qs['sort'](_0x3b3393['query'][_0x67fd('0x36')]);_0x1b4aad['where']=qs[_0x67fd('0x2e')](_[_0x67fd('0x37')](_0x3b3393['query'],_0x383ef[_0x67fd('0x2e')]),_0x5d24e2);if(_0x3b3393[_0x67fd('0x2d')][_0x67fd('0x38')]){_0x1b4aad[_0x67fd('0x39')]=_[_0x67fd('0x3a')](_0x1b4aad[_0x67fd('0x39')],{'$or':_[_0x67fd('0x29')](_0x5d24e2,function(_0x356032){if(_0x356032[_0x67fd('0x2c')]!==_0x67fd('0x3b')){var _0x5c78f6={};_0x5c78f6[_0x356032[_0x67fd('0x27')]]={'$like':'%'+_0x3b3393[_0x67fd('0x2d')][_0x67fd('0x38')]+'%'};return _0x5c78f6;}})});}_0x1b4aad=_[_0x67fd('0x3a')]({},_0x1b4aad,_0x3b3393[_0x67fd('0x3c')]);var _0x18de55={'where':_0x1b4aad['where']};return db['ChatQueueReport'][_0x67fd('0x20')](_0x18de55)[_0x67fd('0x25')](function(_0x332add){_0x327480[_0x67fd('0x20')]=_0x332add;if(_0x3b3393[_0x67fd('0x2d')]['includeAll']){_0x1b4aad[_0x67fd('0x3d')]=[{'all':!![]}];}return db[_0x67fd('0x3e')][_0x67fd('0x3f')](_0x1b4aad);})[_0x67fd('0x25')](function(_0x5a2e53){_0x327480['rows']=_0x5a2e53;return _0x327480;})['then'](respondWithFilteredResult(_0x39c569,_0x1b4aad))[_0x67fd('0x40')](handleError(_0x39c569,null));};exports[_0x67fd('0x41')]=function(_0x56fc7f,_0x7d4916){var _0xc17f69={'raw':!![],'where':{'id':_0x56fc7f[_0x67fd('0x42')]['id']}},_0x1ada05={};_0x1ada05[_0x67fd('0x30')]=_[_0x67fd('0x43')](db[_0x67fd('0x3e')][_0x67fd('0x2a')]);_0x1ada05[_0x67fd('0x2d')]=_[_0x67fd('0x43')](_0x56fc7f['query']);_0x1ada05[_0x67fd('0x2e')]=_[_0x67fd('0x2f')](_0x1ada05['model'],_0x1ada05[_0x67fd('0x2d')]);_0xc17f69[_0x67fd('0x31')]=_[_0x67fd('0x2f')](_0x1ada05['model'],qs[_0x67fd('0x32')](_0x56fc7f[_0x67fd('0x2d')][_0x67fd('0x32')]));_0xc17f69[_0x67fd('0x31')]=_0xc17f69[_0x67fd('0x31')][_0x67fd('0x44')]?_0xc17f69['attributes']:_0x1ada05[_0x67fd('0x30')];if(_0x56fc7f['query'][_0x67fd('0x45')]){_0xc17f69[_0x67fd('0x3d')]=[{'all':!![]}];}_0xc17f69=_[_0x67fd('0x3a')]({},_0xc17f69,_0x56fc7f['options']);return db[_0x67fd('0x3e')]['find'](_0xc17f69)[_0x67fd('0x25')](handleEntityNotFound(_0x7d4916,null))[_0x67fd('0x25')](respondWithResult(_0x7d4916,null))[_0x67fd('0x40')](handleError(_0x7d4916,null));};exports[_0x67fd('0x46')]=function(_0x4a3154,_0x24966b){return db[_0x67fd('0x3e')][_0x67fd('0x46')](_0x4a3154[_0x67fd('0x47')],{})[_0x67fd('0x25')](respondWithResult(_0x24966b,0xc9))[_0x67fd('0x40')](handleError(_0x24966b,null));};exports[_0x67fd('0x24')]=function(_0x39f8cc,_0x2062a0){if(_0x39f8cc[_0x67fd('0x47')]['id']){delete _0x39f8cc[_0x67fd('0x47')]['id'];}return db[_0x67fd('0x3e')][_0x67fd('0x48')]({'where':{'id':_0x39f8cc[_0x67fd('0x42')]['id']}})[_0x67fd('0x25')](handleEntityNotFound(_0x2062a0,null))['then'](saveUpdates(_0x39f8cc['body'],null))['then'](respondWithResult(_0x2062a0,null))[_0x67fd('0x40')](handleError(_0x2062a0,null));};exports[_0x67fd('0x49')]=function(_0x443d82,_0x35a80c){return db['ChatQueueReport']['find']({'where':{'id':_0x443d82['params']['id']}})[_0x67fd('0x25')](handleEntityNotFound(_0x35a80c,null))[_0x67fd('0x25')](removeEntity(_0x35a80c,null))[_0x67fd('0x40')](handleError(_0x35a80c,null));};exports[_0x67fd('0x4a')]=function(_0x5361bc,_0x18763e){return db[_0x67fd('0x3e')][_0x67fd('0x4a')]()['then'](respondWithResult(_0x18763e,null))[_0x67fd('0x40')](handleError(_0x18763e,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 1ed06cb..a76000f 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e1f52,_0x4ecd26){var _0x7c84bb=function(_0x4bca4f){while(--_0x4bca4f){_0x5e1f52['push'](_0x5e1f52['shift']());}};_0x7c84bb(++_0x4ecd26);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x1192e8,_0x5142a1){var _0x5531c2=function(_0x59c2ff){while(--_0x59c2ff){_0x1192e8['push'](_0x1192e8['shift']());}};_0x5531c2(++_0x5142a1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0xcb91[_0x245afe];return _0x4eefde;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'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 91429fd..15441bb 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 _0x2127=['raw','UpdateChatQueueReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options'];(function(_0x571852,_0x34ae1f){var _0x1ec365=function(_0x398fe5){while(--_0x398fe5){_0x571852['push'](_0x571852['shift']());}};_0x1ec365(++_0x34ae1f);}(_0x2127,0x8a));var _0x7212=function(_0x540934,_0x333150){_0x540934=_0x540934-0x0;var _0x1b3d31=_0x2127[_0x540934];return _0x1b3d31;};'use strict';var _=require(_0x7212('0x0'));var util=require(_0x7212('0x1'));var moment=require(_0x7212('0x2'));var BPromise=require(_0x7212('0x3'));var rs=require(_0x7212('0x4'));var fs=require('fs');var Redis=require(_0x7212('0x5'));var db=require(_0x7212('0x6'))['db'];var utils=require(_0x7212('0x7'));var logger=require(_0x7212('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7212('0x9'));var client=jayson[_0x7212('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3225fc,_0x40ce7f,_0x5183a7){return new BPromise(function(_0x419b8f,_0x5b54a9){return client[_0x7212('0xb')](_0x3225fc,_0x5183a7)[_0x7212('0xc')](function(_0x59923a){logger[_0x7212('0xd')](_0x7212('0xe'),_0x40ce7f,_0x7212('0xf'));logger[_0x7212('0x10')](_0x7212('0x11'),_0x40ce7f,'request\x20sent',JSON[_0x7212('0x12')](_0x59923a));if(_0x59923a[_0x7212('0x13')]){if(_0x59923a[_0x7212('0x13')]['code']===0x1f4){logger[_0x7212('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x40ce7f,_0x59923a[_0x7212('0x13')][_0x7212('0x14')]);return _0x5b54a9(_0x59923a[_0x7212('0x13')][_0x7212('0x14')]);}logger[_0x7212('0x13')](_0x7212('0xe'),_0x40ce7f,_0x59923a[_0x7212('0x13')][_0x7212('0x14')]);return _0x419b8f(_0x59923a[_0x7212('0x13')][_0x7212('0x14')]);}else{logger[_0x7212('0xd')](_0x7212('0xe'),_0x40ce7f,_0x7212('0xf'));_0x419b8f(_0x59923a[_0x7212('0x15')]['message']);}})[_0x7212('0x16')](function(_0x2e67d){logger[_0x7212('0x13')](_0x7212('0xe'),_0x40ce7f,_0x2e67d);_0x5b54a9(_0x2e67d);});});}exports[_0x7212('0x17')]=function(_0x272757){var _0x2cf4f0=this;return new Promise(function(_0x395b48,_0x4ca5a1){return db[_0x7212('0x18')][_0x7212('0x19')](_0x272757['body'],{'raw':_0x272757[_0x7212('0x1a')]?_0x272757[_0x7212('0x1a')][_0x7212('0x1b')]===undefined?!![]:![]:!![]})[_0x7212('0xc')](function(_0x5c6fe1){logger[_0x7212('0xd')](_0x7212('0x17'),_0x272757);logger[_0x7212('0x10')]('CreateChatQueueReport',_0x272757,JSON[_0x7212('0x12')](_0x5c6fe1));_0x395b48(_0x5c6fe1);})[_0x7212('0x16')](function(_0x13f292){logger[_0x7212('0x13')](_0x7212('0x17'),_0x13f292[_0x7212('0x14')],_0x272757);_0x4ca5a1(_0x2cf4f0['error'](0x1f4,_0x13f292[_0x7212('0x14')]));});});};exports[_0x7212('0x1c')]=function(_0xc43c54){var _0x5ce4f9=this;return new Promise(function(_0x7d4bd1,_0x4af986){return db[_0x7212('0x18')][_0x7212('0x1d')](_0xc43c54[_0x7212('0x1e')],{'raw':_0xc43c54[_0x7212('0x1a')]?_0xc43c54[_0x7212('0x1a')][_0x7212('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc43c54[_0x7212('0x1a')]?_0xc43c54['options'][_0x7212('0x1f')]||null:null,'attributes':_0xc43c54[_0x7212('0x1a')]?_0xc43c54[_0x7212('0x1a')]['attributes']||null:null,'limit':_0xc43c54[_0x7212('0x1a')]?_0xc43c54['options'][_0x7212('0x20')]||null:null})[_0x7212('0xc')](function(_0x3b8957){logger[_0x7212('0xd')](_0x7212('0x1c'),_0xc43c54);logger[_0x7212('0x10')](_0x7212('0x1c'),_0xc43c54,JSON[_0x7212('0x12')](_0x3b8957));_0x7d4bd1(_0x3b8957);})[_0x7212('0x16')](function(_0x1d3441){logger['error'](_0x7212('0x1c'),_0x1d3441[_0x7212('0x14')],_0xc43c54);_0x4af986(_0x5ce4f9['error'](0x1f4,_0x1d3441[_0x7212('0x14')]));});});}; \ No newline at end of file +var _0xc269=['util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatQueueReport,\x20%s,\x20%s','CreateChatQueueReport','ChatQueueReport','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit'];(function(_0x3c2f9c,_0xc76b36){var _0x33584f=function(_0x37224f){while(--_0x37224f){_0x3c2f9c['push'](_0x3c2f9c['shift']());}};_0x33584f(++_0xc76b36);}(_0xc269,0xf8));var _0x9c26=function(_0x3a8d04,_0x4f837b){_0x3a8d04=_0x3a8d04-0x0;var _0x368a71=_0xc269[_0x3a8d04];return _0x368a71;};'use strict';var _=require('lodash');var util=require(_0x9c26('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c26('0x1'));var db=require(_0x9c26('0x2'))['db'];var utils=require(_0x9c26('0x3'));var logger=require(_0x9c26('0x4'))(_0x9c26('0x5'));var config=require(_0x9c26('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9c26('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42f581,_0x46f74c,_0x58d587){return new BPromise(function(_0x35621a,_0x190f37){return client[_0x9c26('0x8')](_0x42f581,_0x58d587)[_0x9c26('0x9')](function(_0x314225){logger[_0x9c26('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x46f74c,'request\x20sent');logger[_0x9c26('0xb')](_0x9c26('0xc'),_0x46f74c,_0x9c26('0xd'),JSON[_0x9c26('0xe')](_0x314225));if(_0x314225[_0x9c26('0xf')]){if(_0x314225[_0x9c26('0xf')][_0x9c26('0x10')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x46f74c,_0x314225[_0x9c26('0xf')][_0x9c26('0x11')]);return _0x190f37(_0x314225[_0x9c26('0xf')][_0x9c26('0x11')]);}logger[_0x9c26('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x46f74c,_0x314225[_0x9c26('0xf')][_0x9c26('0x11')]);return _0x35621a(_0x314225[_0x9c26('0xf')][_0x9c26('0x11')]);}else{logger[_0x9c26('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x46f74c,'request\x20sent');_0x35621a(_0x314225[_0x9c26('0x12')][_0x9c26('0x11')]);}})[_0x9c26('0x13')](function(_0x4d7392){logger[_0x9c26('0xf')](_0x9c26('0x14'),_0x46f74c,_0x4d7392);_0x190f37(_0x4d7392);});});}exports[_0x9c26('0x15')]=function(_0x3e7867){var _0x80d525=this;return new Promise(function(_0xe01a67,_0x5a040f){return db[_0x9c26('0x16')]['create'](_0x3e7867[_0x9c26('0x17')],{'raw':_0x3e7867[_0x9c26('0x18')]?_0x3e7867[_0x9c26('0x18')][_0x9c26('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x10ca27){logger[_0x9c26('0xa')](_0x9c26('0x15'),_0x3e7867);logger[_0x9c26('0xb')](_0x9c26('0x15'),_0x3e7867,JSON[_0x9c26('0xe')](_0x10ca27));_0xe01a67(_0x10ca27);})[_0x9c26('0x13')](function(_0x2d2d6a){logger[_0x9c26('0xf')](_0x9c26('0x15'),_0x2d2d6a[_0x9c26('0x11')],_0x3e7867);_0x5a040f(_0x80d525[_0x9c26('0xf')](0x1f4,_0x2d2d6a['message']));});});};exports[_0x9c26('0x1a')]=function(_0x169852){var _0x1904f9=this;return new Promise(function(_0x585ba3,_0xc28b26){return db[_0x9c26('0x16')][_0x9c26('0x1b')](_0x169852[_0x9c26('0x17')],{'raw':_0x169852[_0x9c26('0x18')]?_0x169852[_0x9c26('0x18')][_0x9c26('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x169852[_0x9c26('0x18')]?_0x169852[_0x9c26('0x18')][_0x9c26('0x1c')]||null:null,'attributes':_0x169852[_0x9c26('0x18')]?_0x169852[_0x9c26('0x18')][_0x9c26('0x1d')]||null:null,'limit':_0x169852[_0x9c26('0x18')]?_0x169852['options'][_0x9c26('0x1e')]||null:null})[_0x9c26('0x9')](function(_0x268132){logger['info'](_0x9c26('0x1a'),_0x169852);logger[_0x9c26('0xb')](_0x9c26('0x1a'),_0x169852,JSON[_0x9c26('0xe')](_0x268132));_0x585ba3(_0x268132);})[_0x9c26('0x13')](function(_0x5f2f4e){logger[_0x9c26('0xf')]('UpdateChatQueueReport',_0x5f2f4e['message'],_0x169852);_0xc28b26(_0x1904f9['error'](0x1f4,_0x5f2f4e['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 64c7e86..3f1743c 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 _0xe021=['isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get'];(function(_0x86ee9c,_0xb532e8){var _0x4a66b2=function(_0x15556e){while(--_0x15556e){_0x86ee9c['push'](_0x86ee9c['shift']());}};_0x4a66b2(++_0xb532e8);}(_0xe021,0x10e));var _0x1e02=function(_0x1aaed0,_0x5b97e5){_0x1aaed0=_0x1aaed0-0x0;var _0x42513e=_0xe021[_0x1aaed0];return _0x42513e;};'use strict';var multer=require(_0x1e02('0x0'));var util=require(_0x1e02('0x1'));var path=require(_0x1e02('0x2'));var timeout=require(_0x1e02('0x3'));var express=require(_0x1e02('0x4'));var router=express['Router']();var fs_extra=require(_0x1e02('0x5'));var auth=require(_0x1e02('0x6'));var interaction=require(_0x1e02('0x7'));var config=require('../../config/environment');var controller=require(_0x1e02('0x8'));router[_0x1e02('0x9')]('/',auth[_0x1e02('0xa')](),controller[_0x1e02('0xb')]);router[_0x1e02('0x9')](_0x1e02('0xc'),auth[_0x1e02('0xa')](),controller[_0x1e02('0xd')]);router[_0x1e02('0x9')]('/:id',auth[_0x1e02('0xa')](),controller[_0x1e02('0xe')]);router['post']('/',auth[_0x1e02('0xa')](),controller['create']);router[_0x1e02('0xf')](_0x1e02('0x10'),auth[_0x1e02('0xa')](),controller[_0x1e02('0x11')]);router[_0x1e02('0x12')]('/:id',auth[_0x1e02('0xa')](),controller['destroy']);module[_0x1e02('0x13')]=router; \ No newline at end of file +var _0x4a75=['delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','create','put','update'];(function(_0x1b75cb,_0x1e6e09){var _0x484e47=function(_0x5334e2){while(--_0x5334e2){_0x1b75cb['push'](_0x1b75cb['shift']());}};_0x484e47(++_0x1e6e09);}(_0x4a75,0xe0));var _0x54a7=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x4a75[_0x1e4150];return _0x1ce3ee;};'use strict';var multer=require('multer');var util=require(_0x54a7('0x0'));var path=require(_0x54a7('0x1'));var timeout=require(_0x54a7('0x2'));var express=require(_0x54a7('0x3'));var router=express[_0x54a7('0x4')]();var fs_extra=require(_0x54a7('0x5'));var auth=require(_0x54a7('0x6'));var interaction=require(_0x54a7('0x7'));var config=require('../../config/environment');var controller=require(_0x54a7('0x8'));router[_0x54a7('0x9')]('/',auth[_0x54a7('0xa')](),controller['index']);router[_0x54a7('0x9')](_0x54a7('0xb'),auth['isAuthenticated'](),controller[_0x54a7('0xc')]);router[_0x54a7('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x54a7('0xa')](),controller[_0x54a7('0xd')]);router[_0x54a7('0xe')]('/:id',auth[_0x54a7('0xa')](),controller[_0x54a7('0xf')]);router[_0x54a7('0x10')](_0x54a7('0x11'),auth['isAuthenticated'](),controller[_0x54a7('0x12')]);module[_0x54a7('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 6f28b96..794a0b5 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5bd99b,_0x5de34f){var _0x4911f6=function(_0x4767f8){while(--_0x4767f8){_0x5bd99b['push'](_0x5bd99b['shift']());}};_0x4911f6(++_0x5de34f);}(_0xaa88,0x137));var _0x8aa8=function(_0x34232c,_0x18e61d){_0x34232c=_0x34232c-0x0;var _0x4d4f4e=_0xaa88[_0x34232c];return _0x4d4f4e;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 9f8a687..cbe321f 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 _0xfaa3=['desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','index','ChatTransferReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xfaa3,0x110));var _0x3faa=function(_0x210ba0,_0x48f352){_0x210ba0=_0x210ba0-0x0;var _0xacf2c9=_0xfaa3[_0x210ba0];return _0xacf2c9;};'use strict';var emlformat=require(_0x3faa('0x0'));var rimraf=require(_0x3faa('0x1'));var zipdir=require(_0x3faa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3faa('0x3'));var moment=require(_0x3faa('0x4'));var BPromise=require(_0x3faa('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3faa('0x6'));var ejs=require(_0x3faa('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3faa('0x8'));var squel=require(_0x3faa('0x9'));var crypto=require(_0x3faa('0xa'));var jsforce=require(_0x3faa('0xb'));var deskjs=require(_0x3faa('0xc'));var toCsv=require(_0x3faa('0x6'));var querystring=require(_0x3faa('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3faa('0xe'));var qs=require(_0x3faa('0xf'));var as=require(_0x3faa('0x10'));var hardwareService=require(_0x3faa('0x11'));var logger=require('../../config/logger')(_0x3faa('0x12'));var utils=require(_0x3faa('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3faa('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28fd2a,_0x35d492){_0x35d492=_0x35d492||0xcc;return function(_0x4cd8fd){if(_0x4cd8fd){return _0x28fd2a['sendStatus'](_0x35d492);}return _0x28fd2a['status'](_0x35d492)['end']();};}function respondWithResult(_0x11781f,_0x3b35a0){_0x3b35a0=_0x3b35a0||0xc8;return function(_0x4596a8){if(_0x4596a8){return _0x11781f[_0x3faa('0x15')](_0x3b35a0)[_0x3faa('0x16')](_0x4596a8);}};}function respondWithFilteredResult(_0x5cd6ff,_0x4e00da){return function(_0x287cad){if(_0x287cad){var _0x360c4f=typeof _0x4e00da[_0x3faa('0x17')]===_0x3faa('0x18')&&typeof _0x4e00da[_0x3faa('0x19')]==='undefined';var _0x4309cb=_0x287cad[_0x3faa('0x1a')];var _0x3a421f=_0x360c4f?0x0:_0x4e00da[_0x3faa('0x17')];var _0x4b875f=_0x360c4f?_0x287cad[_0x3faa('0x1a')]:_0x4e00da[_0x3faa('0x17')]+_0x4e00da['limit'];var _0x104e8c;if(_0x4b875f>=_0x4309cb){_0x4b875f=_0x4309cb;_0x104e8c=0xc8;}else{_0x104e8c=0xce;}_0x5cd6ff[_0x3faa('0x15')](_0x104e8c);return _0x5cd6ff[_0x3faa('0x1b')](_0x3faa('0x1c'),_0x3a421f+'-'+_0x4b875f+'/'+_0x4309cb)[_0x3faa('0x16')](_0x287cad);}return null;};}function patchUpdates(_0x40d01c){return function(_0x543706){try{jsonpatch['apply'](_0x543706,_0x40d01c,!![]);}catch(_0x33b1c6){return BPromise[_0x3faa('0x1d')](_0x33b1c6);}return _0x543706[_0x3faa('0x1e')]();};}function saveUpdates(_0x4379f9,_0x56c21c){return function(_0x489e4a){if(_0x489e4a){return _0x489e4a[_0x3faa('0x1f')](_0x4379f9)[_0x3faa('0x20')](function(_0x4b0f9a){return _0x4b0f9a;});}return null;};}function removeEntity(_0x30dc37,_0x6477b4){return function(_0x3c2ff6){if(_0x3c2ff6){return _0x3c2ff6[_0x3faa('0x21')]()[_0x3faa('0x20')](function(){_0x30dc37[_0x3faa('0x15')](0xcc)[_0x3faa('0x22')]();});}};}function handleEntityNotFound(_0x5c82cf,_0x441f32){return function(_0x1874ec){if(!_0x1874ec){_0x5c82cf['sendStatus'](0x194);}return _0x1874ec;};}function handleError(_0x55635b,_0x1b5c5d){_0x1b5c5d=_0x1b5c5d||0x1f4;return function(_0x4f164e){logger[_0x3faa('0x23')](_0x4f164e['stack']);if(_0x4f164e[_0x3faa('0x24')]){delete _0x4f164e['name'];}_0x55635b[_0x3faa('0x15')](_0x1b5c5d)['send'](_0x4f164e);};}exports[_0x3faa('0x25')]=function(_0x3f2deb,_0x5e5326){var _0x18fb8d={},_0x2ffdc7={},_0x172142={'count':0x0,'rows':[]};var _0x1ab681=_['map'](db[_0x3faa('0x26')][_0x3faa('0x27')],function(_0x2c4168){return{'name':_0x2c4168['fieldName'],'type':_0x2c4168[_0x3faa('0x28')][_0x3faa('0x29')]};});_0x2ffdc7[_0x3faa('0x2a')]=_[_0x3faa('0x2b')](_0x1ab681,_0x3faa('0x24'));_0x2ffdc7[_0x3faa('0x2c')]=_[_0x3faa('0x2d')](_0x3f2deb[_0x3faa('0x2c')]);_0x2ffdc7[_0x3faa('0x2e')]=_[_0x3faa('0x2f')](_0x2ffdc7[_0x3faa('0x2a')],_0x2ffdc7['query']);_0x18fb8d[_0x3faa('0x30')]=_['intersection'](_0x2ffdc7['model'],qs[_0x3faa('0x31')](_0x3f2deb[_0x3faa('0x2c')][_0x3faa('0x31')]));_0x18fb8d['attributes']=_0x18fb8d[_0x3faa('0x30')][_0x3faa('0x32')]?_0x18fb8d[_0x3faa('0x30')]:_0x2ffdc7['model'];if(!_0x3f2deb[_0x3faa('0x2c')][_0x3faa('0x33')](_0x3faa('0x34'))){_0x18fb8d[_0x3faa('0x19')]=qs['limit'](_0x3f2deb['query'][_0x3faa('0x19')]);_0x18fb8d['offset']=qs[_0x3faa('0x17')](_0x3f2deb[_0x3faa('0x2c')][_0x3faa('0x17')]);}_0x18fb8d[_0x3faa('0x35')]=qs[_0x3faa('0x36')](_0x3f2deb[_0x3faa('0x2c')]['sort']);_0x18fb8d[_0x3faa('0x37')]=qs[_0x3faa('0x2e')](_['pick'](_0x3f2deb[_0x3faa('0x2c')],_0x2ffdc7[_0x3faa('0x2e')]),_0x1ab681);if(_0x3f2deb['query']['filter']){_0x18fb8d[_0x3faa('0x37')]=_[_0x3faa('0x38')](_0x18fb8d[_0x3faa('0x37')],{'$or':_[_0x3faa('0x2b')](_0x1ab681,function(_0xe33657){if(_0xe33657['type']!==_0x3faa('0x39')){var _0x1bfd8e={};_0x1bfd8e[_0xe33657[_0x3faa('0x24')]]={'$like':'%'+_0x3f2deb[_0x3faa('0x2c')][_0x3faa('0x3a')]+'%'};return _0x1bfd8e;}})});}_0x18fb8d=_[_0x3faa('0x38')]({},_0x18fb8d,_0x3f2deb[_0x3faa('0x3b')]);var _0x1556ae={'where':_0x18fb8d[_0x3faa('0x37')]};return db[_0x3faa('0x26')][_0x3faa('0x1a')](_0x1556ae)[_0x3faa('0x20')](function(_0x351d91){_0x172142['count']=_0x351d91;if(_0x3f2deb[_0x3faa('0x2c')][_0x3faa('0x3c')]){_0x18fb8d[_0x3faa('0x3d')]=[{'all':!![]}];}return db[_0x3faa('0x26')][_0x3faa('0x3e')](_0x18fb8d);})[_0x3faa('0x20')](function(_0x32d294){_0x172142[_0x3faa('0x3f')]=_0x32d294;return _0x172142;})['then'](respondWithFilteredResult(_0x5e5326,_0x18fb8d))[_0x3faa('0x40')](handleError(_0x5e5326,null));};exports[_0x3faa('0x41')]=function(_0x4d4ca7,_0x4e5e74){var _0x200e9a={'raw':!![],'where':{'id':_0x4d4ca7['params']['id']}},_0x444227={};_0x444227[_0x3faa('0x2a')]=_['keys'](db['ChatTransferReport'][_0x3faa('0x27')]);_0x444227[_0x3faa('0x2c')]=_['keys'](_0x4d4ca7[_0x3faa('0x2c')]);_0x444227[_0x3faa('0x2e')]=_[_0x3faa('0x2f')](_0x444227['model'],_0x444227['query']);_0x200e9a[_0x3faa('0x30')]=_['intersection'](_0x444227[_0x3faa('0x2a')],qs[_0x3faa('0x31')](_0x4d4ca7[_0x3faa('0x2c')]['fields']));_0x200e9a[_0x3faa('0x30')]=_0x200e9a['attributes'][_0x3faa('0x32')]?_0x200e9a['attributes']:_0x444227['model'];if(_0x4d4ca7[_0x3faa('0x2c')]['includeAll']){_0x200e9a[_0x3faa('0x3d')]=[{'all':!![]}];}_0x200e9a=_[_0x3faa('0x38')]({},_0x200e9a,_0x4d4ca7[_0x3faa('0x3b')]);return db[_0x3faa('0x26')][_0x3faa('0x42')](_0x200e9a)['then'](handleEntityNotFound(_0x4e5e74,null))['then'](respondWithResult(_0x4e5e74,null))[_0x3faa('0x40')](handleError(_0x4e5e74,null));};exports[_0x3faa('0x43')]=function(_0x1064c3,_0x2d0bc8){return db[_0x3faa('0x26')][_0x3faa('0x43')](_0x1064c3[_0x3faa('0x44')],{})['then'](respondWithResult(_0x2d0bc8,0xc9))[_0x3faa('0x40')](handleError(_0x2d0bc8,null));};exports[_0x3faa('0x1f')]=function(_0x1319ea,_0x40e2b2){if(_0x1319ea[_0x3faa('0x44')]['id']){delete _0x1319ea['body']['id'];}return db[_0x3faa('0x26')][_0x3faa('0x42')]({'where':{'id':_0x1319ea[_0x3faa('0x45')]['id']}})[_0x3faa('0x20')](handleEntityNotFound(_0x40e2b2,null))[_0x3faa('0x20')](saveUpdates(_0x1319ea[_0x3faa('0x44')],null))['then'](respondWithResult(_0x40e2b2,null))[_0x3faa('0x40')](handleError(_0x40e2b2,null));};exports['destroy']=function(_0x1c0d42,_0x5a5dae){return db[_0x3faa('0x26')][_0x3faa('0x42')]({'where':{'id':_0x1c0d42['params']['id']}})[_0x3faa('0x20')](handleEntityNotFound(_0x5a5dae,null))['then'](removeEntity(_0x5a5dae,null))[_0x3faa('0x40')](handleError(_0x5a5dae,null));};exports[_0x3faa('0x46')]=function(_0xd7b425,_0xbb02c){return db['ChatTransferReport'][_0x3faa('0x46')]()[_0x3faa('0x20')](respondWithResult(_0xbb02c,null))[_0x3faa('0x40')](handleError(_0xbb02c,null));}; \ No newline at end of file +var _0x7a6a=['length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','findAll','rows','catch','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x1b8997,_0x331887){var _0x5862d1=function(_0x37a1c5){while(--_0x37a1c5){_0x1b8997['push'](_0x1b8997['shift']());}};_0x5862d1(++_0x331887);}(_0x7a6a,0xf8));var _0xa7a6=function(_0x5932b1,_0x460f37){_0x5932b1=_0x5932b1-0x0;var _0x16070c=_0x7a6a[_0x5932b1];return _0x16070c;};'use strict';var emlformat=require(_0xa7a6('0x0'));var rimraf=require(_0xa7a6('0x1'));var zipdir=require(_0xa7a6('0x2'));var jsonpatch=require(_0xa7a6('0x3'));var rp=require(_0xa7a6('0x4'));var moment=require(_0xa7a6('0x5'));var BPromise=require(_0xa7a6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa7a6('0x7'));var sox=require(_0xa7a6('0x8'));var csv=require(_0xa7a6('0x9'));var ejs=require(_0xa7a6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa7a6('0xb'));var squel=require(_0xa7a6('0xc'));var crypto=require(_0xa7a6('0xd'));var jsforce=require(_0xa7a6('0xe'));var deskjs=require(_0xa7a6('0xf'));var toCsv=require(_0xa7a6('0x9'));var querystring=require(_0xa7a6('0x10'));var Papa=require(_0xa7a6('0x11'));var Redis=require(_0xa7a6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa7a6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7a6('0x14'))(_0xa7a6('0x15'));var utils=require(_0xa7a6('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa7a6('0x17'))['db'];function respondWithStatusCode(_0x15cfbd,_0x1640b4){_0x1640b4=_0x1640b4||0xcc;return function(_0x14a54e){if(_0x14a54e){return _0x15cfbd[_0xa7a6('0x18')](_0x1640b4);}return _0x15cfbd['status'](_0x1640b4)['end']();};}function respondWithResult(_0xb46223,_0x3cf8cc){_0x3cf8cc=_0x3cf8cc||0xc8;return function(_0x78a1f8){if(_0x78a1f8){return _0xb46223[_0xa7a6('0x19')](_0x3cf8cc)[_0xa7a6('0x1a')](_0x78a1f8);}};}function respondWithFilteredResult(_0x3a2c02,_0x44b115){return function(_0x71d7cf){if(_0x71d7cf){var _0x4feca6=typeof _0x44b115[_0xa7a6('0x1b')]===_0xa7a6('0x1c')&&typeof _0x44b115[_0xa7a6('0x1d')]===_0xa7a6('0x1c');var _0xc13938=_0x71d7cf[_0xa7a6('0x1e')];var _0x221753=_0x4feca6?0x0:_0x44b115[_0xa7a6('0x1b')];var _0x2ae3b4=_0x4feca6?_0x71d7cf['count']:_0x44b115[_0xa7a6('0x1b')]+_0x44b115[_0xa7a6('0x1d')];var _0x4aacc1;if(_0x2ae3b4>=_0xc13938){_0x2ae3b4=_0xc13938;_0x4aacc1=0xc8;}else{_0x4aacc1=0xce;}_0x3a2c02['status'](_0x4aacc1);return _0x3a2c02[_0xa7a6('0x1f')](_0xa7a6('0x20'),_0x221753+'-'+_0x2ae3b4+'/'+_0xc13938)[_0xa7a6('0x1a')](_0x71d7cf);}return null;};}function patchUpdates(_0x209085){return function(_0xd2f81b){try{jsonpatch[_0xa7a6('0x21')](_0xd2f81b,_0x209085,!![]);}catch(_0x11261d){return BPromise[_0xa7a6('0x22')](_0x11261d);}return _0xd2f81b[_0xa7a6('0x23')]();};}function saveUpdates(_0x1d07b3,_0x2c6307){return function(_0x1389e1){if(_0x1389e1){return _0x1389e1[_0xa7a6('0x24')](_0x1d07b3)[_0xa7a6('0x25')](function(_0x37bd13){return _0x37bd13;});}return null;};}function removeEntity(_0x22e27d,_0x126aad){return function(_0x5e76f6){if(_0x5e76f6){return _0x5e76f6[_0xa7a6('0x26')]()[_0xa7a6('0x25')](function(){_0x22e27d[_0xa7a6('0x19')](0xcc)[_0xa7a6('0x27')]();});}};}function handleEntityNotFound(_0x298df7,_0x10d567){return function(_0x1d7ac2){if(!_0x1d7ac2){_0x298df7[_0xa7a6('0x18')](0x194);}return _0x1d7ac2;};}function handleError(_0x5062e3,_0x103867){_0x103867=_0x103867||0x1f4;return function(_0x1ff315){logger[_0xa7a6('0x28')](_0x1ff315[_0xa7a6('0x29')]);if(_0x1ff315[_0xa7a6('0x2a')]){delete _0x1ff315[_0xa7a6('0x2a')];}_0x5062e3[_0xa7a6('0x19')](_0x103867)[_0xa7a6('0x2b')](_0x1ff315);};}exports[_0xa7a6('0x2c')]=function(_0x9602f7,_0x22b2db){var _0x115821={},_0x5c54e2={},_0x351135={'count':0x0,'rows':[]};var _0xd32738=_[_0xa7a6('0x2d')](db[_0xa7a6('0x2e')][_0xa7a6('0x2f')],function(_0x25f909){return{'name':_0x25f909['fieldName'],'type':_0x25f909['type'][_0xa7a6('0x30')]};});_0x5c54e2['model']=_[_0xa7a6('0x2d')](_0xd32738,_0xa7a6('0x2a'));_0x5c54e2[_0xa7a6('0x31')]=_[_0xa7a6('0x32')](_0x9602f7[_0xa7a6('0x31')]);_0x5c54e2[_0xa7a6('0x33')]=_[_0xa7a6('0x34')](_0x5c54e2[_0xa7a6('0x35')],_0x5c54e2['query']);_0x115821[_0xa7a6('0x36')]=_[_0xa7a6('0x34')](_0x5c54e2[_0xa7a6('0x35')],qs[_0xa7a6('0x37')](_0x9602f7[_0xa7a6('0x31')][_0xa7a6('0x37')]));_0x115821[_0xa7a6('0x36')]=_0x115821[_0xa7a6('0x36')][_0xa7a6('0x38')]?_0x115821[_0xa7a6('0x36')]:_0x5c54e2[_0xa7a6('0x35')];if(!_0x9602f7[_0xa7a6('0x31')][_0xa7a6('0x39')]('nolimit')){_0x115821[_0xa7a6('0x1d')]=qs['limit'](_0x9602f7[_0xa7a6('0x31')][_0xa7a6('0x1d')]);_0x115821['offset']=qs[_0xa7a6('0x1b')](_0x9602f7[_0xa7a6('0x31')][_0xa7a6('0x1b')]);}_0x115821[_0xa7a6('0x3a')]=qs[_0xa7a6('0x3b')](_0x9602f7[_0xa7a6('0x31')][_0xa7a6('0x3b')]);_0x115821['where']=qs[_0xa7a6('0x33')](_[_0xa7a6('0x3c')](_0x9602f7['query'],_0x5c54e2[_0xa7a6('0x33')]),_0xd32738);if(_0x9602f7[_0xa7a6('0x31')][_0xa7a6('0x3d')]){_0x115821[_0xa7a6('0x3e')]=_[_0xa7a6('0x3f')](_0x115821[_0xa7a6('0x3e')],{'$or':_[_0xa7a6('0x2d')](_0xd32738,function(_0x41f20b){if(_0x41f20b[_0xa7a6('0x40')]!==_0xa7a6('0x41')){var _0x2a94ac={};_0x2a94ac[_0x41f20b[_0xa7a6('0x2a')]]={'$like':'%'+_0x9602f7[_0xa7a6('0x31')][_0xa7a6('0x3d')]+'%'};return _0x2a94ac;}})});}_0x115821=_['merge']({},_0x115821,_0x9602f7['options']);var _0x531892={'where':_0x115821[_0xa7a6('0x3e')]};return db[_0xa7a6('0x2e')][_0xa7a6('0x1e')](_0x531892)[_0xa7a6('0x25')](function(_0x141960){_0x351135['count']=_0x141960;if(_0x9602f7[_0xa7a6('0x31')][_0xa7a6('0x42')]){_0x115821['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xa7a6('0x43')](_0x115821);})[_0xa7a6('0x25')](function(_0x56be6b){_0x351135[_0xa7a6('0x44')]=_0x56be6b;return _0x351135;})[_0xa7a6('0x25')](respondWithFilteredResult(_0x22b2db,_0x115821))[_0xa7a6('0x45')](handleError(_0x22b2db,null));};exports['show']=function(_0x31c559,_0x5de4d7){var _0xff1478={'raw':!![],'where':{'id':_0x31c559[_0xa7a6('0x46')]['id']}},_0x1fe0ac={};_0x1fe0ac[_0xa7a6('0x35')]=_[_0xa7a6('0x32')](db[_0xa7a6('0x2e')][_0xa7a6('0x2f')]);_0x1fe0ac['query']=_[_0xa7a6('0x32')](_0x31c559['query']);_0x1fe0ac['filters']=_[_0xa7a6('0x34')](_0x1fe0ac[_0xa7a6('0x35')],_0x1fe0ac[_0xa7a6('0x31')]);_0xff1478['attributes']=_[_0xa7a6('0x34')](_0x1fe0ac[_0xa7a6('0x35')],qs[_0xa7a6('0x37')](_0x31c559[_0xa7a6('0x31')]['fields']));_0xff1478['attributes']=_0xff1478[_0xa7a6('0x36')][_0xa7a6('0x38')]?_0xff1478[_0xa7a6('0x36')]:_0x1fe0ac['model'];if(_0x31c559[_0xa7a6('0x31')][_0xa7a6('0x42')]){_0xff1478['include']=[{'all':!![]}];}_0xff1478=_[_0xa7a6('0x3f')]({},_0xff1478,_0x31c559[_0xa7a6('0x47')]);return db[_0xa7a6('0x2e')][_0xa7a6('0x48')](_0xff1478)['then'](handleEntityNotFound(_0x5de4d7,null))[_0xa7a6('0x25')](respondWithResult(_0x5de4d7,null))[_0xa7a6('0x45')](handleError(_0x5de4d7,null));};exports['create']=function(_0x361b31,_0x9b9e70){return db[_0xa7a6('0x2e')][_0xa7a6('0x49')](_0x361b31[_0xa7a6('0x4a')],{})[_0xa7a6('0x25')](respondWithResult(_0x9b9e70,0xc9))[_0xa7a6('0x45')](handleError(_0x9b9e70,null));};exports[_0xa7a6('0x24')]=function(_0x11fd9e,_0x2e3fe5){if(_0x11fd9e[_0xa7a6('0x4a')]['id']){delete _0x11fd9e[_0xa7a6('0x4a')]['id'];}return db[_0xa7a6('0x2e')]['find']({'where':{'id':_0x11fd9e[_0xa7a6('0x46')]['id']}})[_0xa7a6('0x25')](handleEntityNotFound(_0x2e3fe5,null))[_0xa7a6('0x25')](saveUpdates(_0x11fd9e['body'],null))['then'](respondWithResult(_0x2e3fe5,null))[_0xa7a6('0x45')](handleError(_0x2e3fe5,null));};exports[_0xa7a6('0x26')]=function(_0x3ad1b8,_0x6da14c){return db[_0xa7a6('0x2e')][_0xa7a6('0x48')]({'where':{'id':_0x3ad1b8['params']['id']}})[_0xa7a6('0x25')](handleEntityNotFound(_0x6da14c,null))[_0xa7a6('0x25')](removeEntity(_0x6da14c,null))[_0xa7a6('0x45')](handleError(_0x6da14c,null));};exports[_0xa7a6('0x4b')]=function(_0x33cef4,_0x105711){return db[_0xa7a6('0x2e')][_0xa7a6('0x4b')]()[_0xa7a6('0x25')](respondWithResult(_0x105711,null))['catch'](handleError(_0x105711,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 3da91a8..f22eb75 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 _0xef02=['lodash','api','moment','bluebird','request-promise','path','../../config/environment','define','uniqueid'];(function(_0x544e2b,_0x10a25e){var _0x479085=function(_0x40a526){while(--_0x40a526){_0x544e2b['push'](_0x544e2b['shift']());}};_0x479085(++_0x10a25e);}(_0xef02,0x1cb));var _0x2ef0=function(_0xee2e7a,_0x58354d){_0xee2e7a=_0xee2e7a-0x0;var _0x319dd3=_0xef02[_0xee2e7a];return _0x319dd3;};'use strict';var _=require(_0x2ef0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2ef0('0x1'));var moment=require(_0x2ef0('0x2'));var BPromise=require(_0x2ef0('0x3'));var rp=require(_0x2ef0('0x4'));var fs=require('fs');var path=require(_0x2ef0('0x5'));var rimraf=require('rimraf');var config=require(_0x2ef0('0x6'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x349af5,_0x4c680b){return _0x349af5[_0x2ef0('0x7')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2ef0('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa5a7=['path','../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2e840a,_0x4cd495){var _0xd7bdaf=function(_0x230a82){while(--_0x230a82){_0x2e840a['push'](_0x2e840a['shift']());}};_0xd7bdaf(++_0x4cd495);}(_0xa5a7,0x102));var _0x7a5a=function(_0x479904,_0x13fd2a){_0x479904=_0x479904-0x0;var _0x27ae1f=_0xa5a7[_0x479904];return _0x27ae1f;};'use strict';var _=require(_0x7a5a('0x0'));var util=require(_0x7a5a('0x1'));var logger=require(_0x7a5a('0x2'))(_0x7a5a('0x3'));var moment=require(_0x7a5a('0x4'));var BPromise=require(_0x7a5a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a5a('0x6'));var rimraf=require('rimraf');var config=require(_0x7a5a('0x7'));var attributes=require(_0x7a5a('0x8'));module['exports']=function(_0x6d8df5,_0x311b6b){return _0x6d8df5['define'](_0x7a5a('0x9'),attributes,{'tableName':_0x7a5a('0xa'),'paranoid':![],'indexes':[{'name':_0x7a5a('0xb'),'fields':[_0x7a5a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 62b3a84..0926b18 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 _0xdcbe=['http','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','info','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x32bb5e,_0x31d14e){var _0x228589=function(_0x57bc86){while(--_0x57bc86){_0x32bb5e['push'](_0x32bb5e['shift']());}};_0x228589(++_0x31d14e);}(_0xdcbe,0xdd));var _0xedcb=function(_0x5bb95e,_0x3c9bd7){_0x5bb95e=_0x5bb95e-0x0;var _0x3b1d93=_0xdcbe[_0x5bb95e];return _0x3b1d93;};'use strict';var _=require(_0xedcb('0x0'));var util=require('util');var moment=require(_0xedcb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xedcb('0x2'));var db=require(_0xedcb('0x3'))['db'];var utils=require(_0xedcb('0x4'));var logger=require(_0xedcb('0x5'))(_0xedcb('0x6'));var config=require(_0xedcb('0x7'));var jayson=require(_0xedcb('0x8'));var client=jayson[_0xedcb('0x9')][_0xedcb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2aa072,_0x31a0f6,_0x746dc9){return new BPromise(function(_0x3b6ebd,_0x166d59){return client['request'](_0x2aa072,_0x746dc9)[_0xedcb('0xb')](function(_0x20783a){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x31a0f6,_0xedcb('0xc'));logger[_0xedcb('0xd')](_0xedcb('0xe'),_0x31a0f6,'request\x20sent',JSON[_0xedcb('0xf')](_0x20783a));if(_0x20783a[_0xedcb('0x10')]){if(_0x20783a[_0xedcb('0x10')][_0xedcb('0x11')]===0x1f4){logger[_0xedcb('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x31a0f6,_0x20783a[_0xedcb('0x10')][_0xedcb('0x12')]);return _0x166d59(_0x20783a['error']['message']);}logger['error'](_0xedcb('0x13'),_0x31a0f6,_0x20783a[_0xedcb('0x10')][_0xedcb('0x12')]);return _0x3b6ebd(_0x20783a[_0xedcb('0x10')][_0xedcb('0x12')]);}else{logger[_0xedcb('0x14')](_0xedcb('0x13'),_0x31a0f6,_0xedcb('0xc'));_0x3b6ebd(_0x20783a['result']['message']);}})['catch'](function(_0x312f1d){logger[_0xedcb('0x10')](_0xedcb('0x13'),_0x31a0f6,_0x312f1d);_0x166d59(_0x312f1d);});});} \ No newline at end of file +var _0xb835=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0xb835,0xb0));var _0x5b83=function(_0x2efcfc,_0x2aac80){_0x2efcfc=_0x2efcfc-0x0;var _0x2363be=_0xb835[_0x2efcfc];return _0x2363be;};'use strict';var _=require(_0x5b83('0x0'));var util=require(_0x5b83('0x1'));var moment=require('moment');var BPromise=require(_0x5b83('0x2'));var rs=require(_0x5b83('0x3'));var fs=require('fs');var Redis=require(_0x5b83('0x4'));var db=require(_0x5b83('0x5'))['db'];var utils=require(_0x5b83('0x6'));var logger=require(_0x5b83('0x7'))(_0x5b83('0x8'));var config=require(_0x5b83('0x9'));var jayson=require(_0x5b83('0xa'));var client=jayson[_0x5b83('0xb')][_0x5b83('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x441a67,_0x4ecb2,_0x10a72c){return new BPromise(function(_0x3ee1c6,_0x401a5c){return client[_0x5b83('0xd')](_0x441a67,_0x10a72c)[_0x5b83('0xe')](function(_0x4683ec){logger[_0x5b83('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x4ecb2,_0x5b83('0x10'));logger['debug'](_0x5b83('0x11'),_0x4ecb2,'request\x20sent',JSON['stringify'](_0x4683ec));if(_0x4683ec[_0x5b83('0x12')]){if(_0x4683ec[_0x5b83('0x12')]['code']===0x1f4){logger[_0x5b83('0x12')](_0x5b83('0x13'),_0x4ecb2,_0x4683ec[_0x5b83('0x12')][_0x5b83('0x14')]);return _0x401a5c(_0x4683ec['error'][_0x5b83('0x14')]);}logger[_0x5b83('0x12')](_0x5b83('0x13'),_0x4ecb2,_0x4683ec[_0x5b83('0x12')][_0x5b83('0x14')]);return _0x3ee1c6(_0x4683ec['error'][_0x5b83('0x14')]);}else{logger[_0x5b83('0xf')](_0x5b83('0x13'),_0x4ecb2,_0x5b83('0x10'));_0x3ee1c6(_0x4683ec[_0x5b83('0x15')][_0x5b83('0x14')]);}})[_0x5b83('0x16')](function(_0x23aa5b){logger[_0x5b83('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x4ecb2,_0x23aa5b);_0x401a5c(_0x23aa5b);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 69dd361..fcc9354 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 _0xfcfc=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','post','create','put','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x28bfba,_0x543076){var _0x1d6099=function(_0x2b3847){while(--_0x2b3847){_0x28bfba['push'](_0x28bfba['shift']());}};_0x1d6099(++_0x543076);}(_0xfcfc,0x1c7));var _0xcfcf=function(_0x2c2902,_0x75cdab){_0x2c2902=_0x2c2902-0x0;var _0x44ec3b=_0xfcfc[_0x2c2902];return _0x44ec3b;};'use strict';var multer=require(_0xcfcf('0x0'));var util=require(_0xcfcf('0x1'));var path=require('path');var timeout=require(_0xcfcf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcfcf('0x3'));var auth=require(_0xcfcf('0x4'));var interaction=require(_0xcfcf('0x5'));var config=require(_0xcfcf('0x6'));var controller=require(_0xcfcf('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xcfcf('0x8')]);router[_0xcfcf('0x9')](_0xcfcf('0xa'),auth[_0xcfcf('0xb')](),controller[_0xcfcf('0xc')]);router[_0xcfcf('0x9')](_0xcfcf('0xd'),auth[_0xcfcf('0xb')](),controller['show']);router[_0xcfcf('0xe')]('/',auth[_0xcfcf('0xb')](),controller[_0xcfcf('0xf')]);router[_0xcfcf('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xcfcf('0x11')](_0xcfcf('0xd'),auth[_0xcfcf('0xb')](),controller[_0xcfcf('0x12')]);module[_0xcfcf('0x13')]=router; \ No newline at end of file +var _0xf05a=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x451e7,_0x5eda43){var _0x3c342b=function(_0x19169d){while(--_0x19169d){_0x451e7['push'](_0x451e7['shift']());}};_0x3c342b(++_0x5eda43);}(_0xf05a,0xb5));var _0xaf05=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf05a[_0x4a9fb1];return _0x348672;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaf05('0x0'));var timeout=require(_0xaf05('0x1'));var express=require(_0xaf05('0x2'));var router=express[_0xaf05('0x3')]();var fs_extra=require(_0xaf05('0x4'));var auth=require(_0xaf05('0x5'));var interaction=require(_0xaf05('0x6'));var config=require(_0xaf05('0x7'));var controller=require(_0xaf05('0x8'));router[_0xaf05('0x9')]('/',auth[_0xaf05('0xa')](),controller[_0xaf05('0xb')]);router[_0xaf05('0x9')](_0xaf05('0xc'),auth[_0xaf05('0xa')](),controller[_0xaf05('0xd')]);router[_0xaf05('0x9')](_0xaf05('0xe'),auth[_0xaf05('0xa')](),controller[_0xaf05('0xf')]);router[_0xaf05('0x10')]('/',auth[_0xaf05('0xa')](),controller[_0xaf05('0x11')]);router['put'](_0xaf05('0xe'),auth[_0xaf05('0xa')](),controller[_0xaf05('0x12')]);router['delete'](_0xaf05('0xe'),auth[_0xaf05('0xa')](),controller[_0xaf05('0x13')]);module[_0xaf05('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 840be87..bfa811c 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 _0xac3e=['ENUM','rounded','squared','Send','Contact\x20us','BOOLEAN','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','thumb','star','stringify','input','name','text','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A'];(function(_0x1d1c05,_0xab4b54){var _0x2f802c=function(_0x5dc4b5){while(--_0x5dc4b5){_0x1d1c05['push'](_0x1d1c05['shift']());}};_0x2f802c(++_0xab4b54);}(_0xac3e,0x157));var _0xeac3=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0xac3e[_0x50e593];return _0x3821d0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xeac3('0x0'));module[_0xeac3('0x1')]={'name':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![],'unique':_0xeac3('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x4')},'mapKeyOffline':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x4')},'key':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x5')},'customerAlias':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![],'defaultValue':_0xeac3('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xeac3('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xeac3('0x7')](_0xeac3('0x8'),_0xeac3('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xeac3('0xa')},'header_offline':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0xb')},'download_transcript':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xeac3('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xeac3('0xf')]},'closingQuestion':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xeac3('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xeac3('0x13')},'placeholderMessage':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xeac3('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x16')},'conditionAgreement':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM']('star',_0xeac3('0x17')),'defaultValue':_0xeac3('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xeac3('0xf')],'defaultValue':function(){return JSON[_0xeac3('0x19')]({'items':[{'type':_0xeac3('0x1a'),'variable':null,'config':{'placeholder':_0xeac3('0x1b'),'type':_0xeac3('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xeac3('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xeac3('0x1d')]('onlineForm')?JSON[_0xeac3('0x1e')](this[_0xeac3('0x1d')](_0xeac3('0x1f'))):{};},'set':function(_0x3f3f29){return this[_0xeac3('0x20')](_0xeac3('0x1f'),JSON[_0xeac3('0x19')](_0x3f3f29));}},'offlineForm':{'type':Sequelize[_0xeac3('0xf')],'defaultValue':function(){return JSON[_0xeac3('0x19')]({'items':[{'type':'input','props':{'title':_0xeac3('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xeac3('0x4'),'type':'email'},'variable':null},{'type':_0xeac3('0x21'),'config':{'placeholder':'Comments'},'props':{'title':_0xeac3('0x22'),'helpText':_0xeac3('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xeac3('0x1d')]('offlineForm')?JSON[_0xeac3('0x1e')](this[_0xeac3('0x1d')]('offlineForm')):{};},'set':function(_0x443ca4){return this['setDataValue']('offlineForm',JSON[_0xeac3('0x19')](_0x443ca4));}},'token':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':function(){return rs[_0xeac3('0x24')]();}},'autoclose':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xeac3('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xeac3('0x2')]},'waitingTitle':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x25')},'waitingMessage':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x26')},'offlineMessageBody':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x28')},'skipUnmanaged':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xeac3('0x2')]},'notificationTemplate':{'type':Sequelize[_0xeac3('0xf')],'defaultValue':function(){return _0xeac3('0x29');}},'notificationSound':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xeac3('0x2a')},'verticalAlignment':{'type':Sequelize[_0xeac3('0xd')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x2b')},'messagesAlignment':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x2c')},'defaultTitle':{'type':Sequelize[_0xeac3('0x2')]},'customerAvatar':{'type':Sequelize[_0xeac3('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xeac3('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![],'defaultValue':_0xeac3('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeac3('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xeac3('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeac3('0xd')],'comment':_0xeac3('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xd34c8d){if(!_0xd34c8d)this[_0xeac3('0x20')](_0xeac3('0x2f'),null);this[_0xeac3('0x20')](_0xeac3('0x30'),_0xd34c8d);}},'vidaooEscalation':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xeac3('0x2')]},'vidaooTopic':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':function(){return _0xeac3('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xeac3('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xeac3('0xf')]}}; \ No newline at end of file +var _0x0055=['email','Agent','#ffffff','BOOLEAN','rounded','squared','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','name','input','onlineForm','parse','getDataValue','setDataValue','stringify','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','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address'];(function(_0x25e812,_0x241e47){var _0x4d1ec4=function(_0x2cf4b2){while(--_0x2cf4b2){_0x25e812['push'](_0x25e812['shift']());}};_0x4d1ec4(++_0x241e47);}(_0x0055,0xc4));var _0x5005=function(_0x207269,_0x452844){_0x207269=_0x207269-0x0;var _0x1bb6bf=_0x0055[_0x207269];return _0x1bb6bf;};'use strict';var Sequelize=require(_0x5005('0x0'));var rs=require(_0x5005('0x1'));module['exports']={'name':{'type':Sequelize[_0x5005('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5005('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x5005('0x4')},'mapKeyOffline':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0x4')},'key':{'type':Sequelize[_0x5005('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5005('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5005('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5005('0x2')],'allowNull':![],'defaultValue':_0x5005('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x5005('0x2')],'allowNull':![],'defaultValue':_0x5005('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5005('0x2')]},'animation':{'type':Sequelize[_0x5005('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x5005('0x8'),_0x5005('0x9')),'defaultValue':_0x5005('0x8')},'header_online':{'type':Sequelize[_0x5005('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x5005('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0xa')},'header_offline':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0xb')},'download_transcript':{'type':Sequelize[_0x5005('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x5005('0xc')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x5005('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5005('0xe')]},'closingQuestion':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0xf')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5005('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5005('0x11')},'noteTitle':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0x13')},'closingMessageButton':{'type':Sequelize[_0x5005('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5005('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0x15')},'ratingType':{'type':Sequelize[_0x5005('0x16')](_0x5005('0x17'),_0x5005('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x5005('0xc')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x5005('0x19'),'type':'text','required':!![]},'props':{'title':_0x5005('0x19'),'helpText':''}},{'type':_0x5005('0x1a'),'props':{'title':_0x5005('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x5005('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x5005('0x1b'))?JSON[_0x5005('0x1c')](this[_0x5005('0x1d')](_0x5005('0x1b'))):{};},'set':function(_0x467970){return this[_0x5005('0x1e')](_0x5005('0x1b'),JSON[_0x5005('0x1f')](_0x467970));}},'offlineForm':{'type':Sequelize[_0x5005('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x5005('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x5005('0x4'),'type':_0x5005('0x4')},'variable':null},{'type':_0x5005('0x20'),'config':{'placeholder':_0x5005('0x21')},'props':{'title':_0x5005('0x21'),'helpText':_0x5005('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x5005('0x1d')](_0x5005('0x23'))?JSON['parse'](this[_0x5005('0x1d')](_0x5005('0x23'))):{};},'set':function(_0x357f11){return this[_0x5005('0x1e')]('offlineForm',JSON['stringify'](_0x357f11));}},'token':{'type':Sequelize[_0x5005('0x2')],'defaultValue':function(){return rs[_0x5005('0x24')]();}},'autoclose':{'type':Sequelize[_0x5005('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5005('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x5005('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5005('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5005('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x5005('0x25')},'waitingMessage':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0x27')},'offlineMessageBody':{'type':Sequelize[_0x5005('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x5005('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5005('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x5005('0x14')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x5005('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x5005('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5005('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5005('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x5005('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5005('0x2')]},'notificationTemplate':{'type':Sequelize[_0x5005('0xe')],'defaultValue':function(){return _0x5005('0x28');}},'notificationSound':{'type':Sequelize[_0x5005('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5005('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5005('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5005('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0x2a')},'verticalAlignment':{'type':Sequelize[_0x5005('0xc')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x5005('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x5005('0x2')],'defaultValue':_0x5005('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x5005('0xe')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5005('0xc')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5005('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x5005('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5005('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x5005('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x5005('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x5005('0x7')],'defaultValue':![],'comment':_0x5005('0x2f'),'set':function(_0x3f8bbe){if(!_0x3f8bbe)this[_0x5005('0x1e')]('mandatoryDispositionPauseId',null);this[_0x5005('0x1e')](_0x5005('0x30'),_0x3f8bbe);}},'vidaooEscalation':{'type':Sequelize[_0x5005('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5005('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5005('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x5005('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x5005('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x5005('0xe')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 593197f..83c89c9 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 _0x1139=['addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','chat','CmContact','ValidationError','difference','createdAt','updatedAt','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','contact','headers','threadId','ChatInteraction','externalUrl','interaction','messageId','created','autoclose','unmanaged','*,*,*,*','AttachmentId','UserId','agent','waitForTheAssignedAgent','queueId','ChatQueue','unshift','queue','waitForTheAssignedQueue','Start','EventManager','files','no\x20available\x20attributes','CompanyId','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','getSnippet','getLicense','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','URL','origin','3.5.0','remote','x-real-ip','remoteAddress','replace','render','alignment','verticalAlignment','color','labelText','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','omit','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','mustache','util','path','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','APIOutOfIntervalError','../../errors/api','APINotFoundError','handleError','../../mysqldb','redis','defaults','localhost','client','http','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','sendStatus','end','status','offset','limit','undefined','count','set','json','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Command','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','map','Interval','Intervals','all','some','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','device','model','vendor','type','stringify','Pause','ChatWebsite','fieldName','key','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','mandatoryDispositionPause','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','rawAttributes','include','rows','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar'];(function(_0x501fe6,_0xb74e75){var _0x2262da=function(_0x5e8584){while(--_0x5e8584){_0x501fe6['push'](_0x501fe6['shift']());}};_0x2262da(++_0xb74e75);}(_0x1139,0x1e3));var _0x9113=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1139[_0x40a045];return _0x1a687c;};'use strict';var Mustache=require(_0x9113('0x0'));var util=require(_0x9113('0x1'));var path=require(_0x9113('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9113('0x3'));var _=require(_0x9113('0x4'));var querystring=require(_0x9113('0x5'));var htmlToText=require(_0x9113('0x6'));var Redis=require(_0x9113('0x7'));var jayson=require(_0x9113('0x8'));var url=require(_0x9113('0x9'));var qs=require(_0x9113('0xa'));var logger=require(_0x9113('0xb'))(_0x9113('0xc'));var config=require(_0x9113('0xd'));var APIOutOfIntervalError=require('../../errors/api')[_0x9113('0xe')];var APINotFoundError=require(_0x9113('0xf'))[_0x9113('0x10')];var APIHandleError=require(_0x9113('0xf'))[_0x9113('0x11')];var db=require(_0x9113('0x12'))['db'];config[_0x9113('0x13')]=_[_0x9113('0x14')](config['redis'],{'host':_0x9113('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9113('0x13')]));require('./chatWebsite.socket')['register'](socket);var client=jayson[_0x9113('0x16')][_0x9113('0x17')]({'port':0x232c});var client9002=jayson[_0x9113('0x16')][_0x9113('0x17')]({'port':0x232a});var client9003=jayson[_0x9113('0x16')][_0x9113('0x17')]({'port':0x232b});var client9001=jayson[_0x9113('0x16')][_0x9113('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x2752df,_0x10d60c,_0x185e71,_0x2a9ba8){return new Promise(function(_0x2ba2e7,_0x162f85){var _0xeaeac2=_0x2a9ba8||client;return _0xeaeac2[_0x9113('0x18')](_0x2752df,_0x185e71)['then'](function(_0x221f0d){logger[_0x9113('0x19')](_0x9113('0x1a'),_0x10d60c,'request\x20sent');logger[_0x9113('0x1b')](_0x9113('0x1c'),_0x10d60c,_0x9113('0x1d'),JSON['stringify'](_0x221f0d));if(_0x221f0d[_0x9113('0x1e')]){if(_0x221f0d['error']['code']===0x1f4){logger[_0x9113('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x10d60c,_0x221f0d[_0x9113('0x1e')][_0x9113('0x1f')]);return _0x162f85(_0x221f0d[_0x9113('0x1e')][_0x9113('0x1f')]);}logger['error'](_0x9113('0x1a'),_0x10d60c,_0x221f0d['error'][_0x9113('0x1f')]);return _0x2ba2e7(_0x221f0d[_0x9113('0x1e')][_0x9113('0x1f')]);}else{logger['info'](_0x9113('0x1a'),_0x10d60c,_0x9113('0x1d'));_0x2ba2e7(_0x221f0d[_0x9113('0x20')][_0x9113('0x1f')]);}})['catch'](function(_0x524db4){logger[_0x9113('0x1e')](_0x9113('0x1a'),_0x10d60c,_0x524db4);_0x162f85(_0x524db4);});});}function respondWithStatusCode(_0x39e1bb,_0x4eca00){_0x4eca00=_0x4eca00||0xcc;return function(_0x2725dc){if(_0x2725dc){return _0x39e1bb[_0x9113('0x21')](_0x4eca00);}return _0x39e1bb['status'](_0x4eca00)[_0x9113('0x22')]();};}function respondWithResult(_0x236042,_0x3a8e4){_0x3a8e4=_0x3a8e4||0xc8;return function(_0x536ac0){if(_0x536ac0){return _0x236042[_0x9113('0x23')](_0x3a8e4)['json'](_0x536ac0);}};}function respondWithFilteredResult(_0x5def2c,_0xc8f3ae){return function(_0x240e68){if(_0x240e68){var _0x36b213=typeof _0xc8f3ae[_0x9113('0x24')]==='undefined'&&typeof _0xc8f3ae[_0x9113('0x25')]===_0x9113('0x26');var _0x35068b=_0x240e68[_0x9113('0x27')];var _0x9d098e=_0x36b213?0x0:_0xc8f3ae['offset'];var _0x2c63df=_0x36b213?_0x240e68[_0x9113('0x27')]:_0xc8f3ae['offset']+_0xc8f3ae[_0x9113('0x25')];var _0x2e6bcf;if(_0x2c63df>=_0x35068b){_0x2c63df=_0x35068b;_0x2e6bcf=0xc8;}else{_0x2e6bcf=0xce;}_0x5def2c[_0x9113('0x23')](_0x2e6bcf);return _0x5def2c[_0x9113('0x28')]('Content-Range',_0x9d098e+'-'+_0x2c63df+'/'+_0x35068b)[_0x9113('0x29')](_0x240e68);}return null;};}function saveUpdates(_0x21397b){return function(_0x565756){if(_0x565756){return _0x565756[_0x9113('0x2a')](_0x21397b)[_0x9113('0x2b')](function(_0xe1628d){return _0xe1628d;});}return null;};}function removeEntity(_0x49eeae){return function(_0x42ae8a){if(_0x42ae8a){return _0x42ae8a[_0x9113('0x2c')]()['then'](function(){var _0xdb9d01=_0x42ae8a[_0x9113('0x2d')]({'plain':!![]});var _0x4f08b6=_0x9113('0x2e');return db[_0x9113('0x2f')][_0x9113('0x2c')]({'where':{'type':_0x4f08b6,'resourceId':_0xdb9d01['id']}})['then'](function(){return _0x42ae8a;});})[_0x9113('0x2b')](function(){_0x49eeae[_0x9113('0x23')](0xcc)[_0x9113('0x22')]();});}};}function handleEntityNotFound(_0xb18fa6){return function(_0xfe4c85){if(!_0xfe4c85){_0xb18fa6['sendStatus'](0x194);}return _0xfe4c85;};}function handleError(_0x4d6c1c,_0x3703d8){_0x3703d8=_0x3703d8||0x1f4;return function(_0x43925e){logger['error'](_0x43925e[_0x9113('0x30')]);if(_0x43925e[_0x9113('0x31')]){delete _0x43925e[_0x9113('0x31')];}_0x4d6c1c['status'](_0x3703d8)[_0x9113('0x32')](_0x43925e);};}function iftimePromise(_0x1da9f5,_0xf81d34){return respondWithRpcPromise(_0x9113('0x33'),'getSnippet',{'command':_0xf81d34[_0x9113('0x34')]?util[_0x9113('0x35')](_0x9113('0x36'),_0x1da9f5[_0x9113('0x37')],_0xf81d34[_0x9113('0x34')]):util[_0x9113('0x35')](_0x9113('0x38'),_0x1da9f5[_0x9113('0x37')])},client9002)[_0x9113('0x2b')](function(_0x580652){var _0x3aa0dc=_0x580652&&_0x580652[_0x9113('0x39')](_0x9113('0x3a'))>=0x0?!![]:![];logger[_0x9113('0x19')](_0x9113('0x3b'),_0xf81d34['id'],_0x1da9f5['id'],_0x1da9f5[_0x9113('0x37')],_0x3aa0dc?_0x9113('0x3c'):_0x9113('0x3d'),_0xf81d34[_0x9113('0x34')]?_0xf81d34[_0x9113('0x34')]:_0x9113('0x3e'));return _0x3aa0dc;})['catch'](function(_0x8e1d14){logger[_0x9113('0x1e')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xf81d34['id'],_0x1da9f5['id'],_0x1da9f5[_0x9113('0x37')],util[_0x9113('0x3f')](_0x8e1d14,{'showHidden':![],'depth':null}),_0xf81d34[_0x9113('0x34')]?_0xf81d34['timezone']:_0x9113('0x3e'));return![];});}function checkWebsiteIntervals(_0x1f762a){var _0x31f4b2=_[_0x9113('0x40')](_0x1f762a[_0x9113('0x41')][_0x9113('0x42')],function(_0x3e6cee){var _0x3a2175=_0x3e6cee[_0x9113('0x2d')]({'plain':!![]});return iftimePromise(_0x3a2175,_0x1f762a);});return Promise[_0x9113('0x43')](_0x31f4b2)[_0x9113('0x2b')](function(_0x3af062){return _[_0x9113('0x44')](_0x3af062);});}function createInteractionObject(_0x3e8be,_0x28c3d5,_0x4a3ca9,_0x3884c2){var _0x2a8682=require('user-agent-parser');var _0x1e1e52=new _0x2a8682();var _0x1c66ec=_0x1e1e52[_0x9113('0x45')](_0x4a3ca9[_0x9113('0x46')])[_0x9113('0x47')]();var _0x3807cb=_0x28c3d5[_0x9113('0x48')];if(_0x4a3ca9[_0x9113('0x49')]){_0x3807cb=_0x4a3ca9[_0x9113('0x49')];}else if(_0x4a3ca9[_0x9113('0x4a')]){_0x3807cb=_[_0x9113('0x4b')](_0x4a3ca9['x-forwarded-for'][_0x9113('0x4c')](','));}return{'ContactId':_0x3884c2['id'],'ChatWebsiteId':_0x3e8be,'from':(_0x3884c2[_0x9113('0x4d')]||'')+'\x20'+(_0x3884c2[_0x9113('0x4e')]||''),'customerIp':_0x3807cb,'customerPort':_0x4a3ca9[_0x9113('0x4f')]?_0x4a3ca9['x-real-port']:null,'referer':_0x28c3d5[_0x9113('0x50')],'browserName':_0x1c66ec[_0x9113('0x51')][_0x9113('0x31')]&&_0x1c66ec[_0x9113('0x51')]['version']?util[_0x9113('0x35')](_0x9113('0x52'),_0x1c66ec[_0x9113('0x51')][_0x9113('0x31')],_0x1c66ec[_0x9113('0x51')]['version']):'unknown','browserVersion':_0x1c66ec[_0x9113('0x51')]['version']||'unknown','osName':util[_0x9113('0x35')](_0x9113('0x52'),_0x1c66ec['os'][_0x9113('0x31')],_0x1c66ec['os'][_0x9113('0x53')]),'osVersion':_0x1c66ec['os'][_0x9113('0x53')],'deviceModel':_0x1c66ec[_0x9113('0x54')][_0x9113('0x55')]&&_0x1c66ec[_0x9113('0x54')][_0x9113('0x56')]?util[_0x9113('0x35')]('%s\x20%s\x20%s',_0x1c66ec[_0x9113('0x54')][_0x9113('0x55')],_0x1c66ec[_0x9113('0x54')][_0x9113('0x56')],_0x1c66ec[_0x9113('0x54')][_0x9113('0x57')]):null,'deviceVendor':_0x1c66ec[_0x9113('0x54')][_0x9113('0x56')],'deviceType':_0x1c66ec[_0x9113('0x54')]['type'],'formData':JSON[_0x9113('0x58')](_0x28c3d5)};}exports['index']=function(_0x4fc69b,_0x6b6635){var _0x39c66e={'include':[{'model':db[_0x9113('0x59')],'as':'mandatoryDispositionPause'}]},_0x312128={},_0x985afe={'count':0x0,'rows':[]};var _0x3f37a1=_['map'](db[_0x9113('0x5a')]['rawAttributes'],function(_0x263f6c){return{'name':_0x263f6c[_0x9113('0x5b')],'type':_0x263f6c['type'][_0x9113('0x5c')]};});_0x312128['model']=_[_0x9113('0x40')](_0x3f37a1,'name');_0x312128['query']=_[_0x9113('0x5d')](_0x4fc69b[_0x9113('0x5e')]);_0x312128[_0x9113('0x5f')]=_['intersection'](_0x312128[_0x9113('0x55')],_0x312128[_0x9113('0x5e')]);_0x39c66e[_0x9113('0x60')]=_[_0x9113('0x61')](_0x312128[_0x9113('0x55')],qs[_0x9113('0x62')](_0x4fc69b[_0x9113('0x5e')][_0x9113('0x62')]));_0x39c66e['attributes']=_0x39c66e['attributes'][_0x9113('0x63')]?_0x39c66e['attributes']:_0x312128[_0x9113('0x55')];if(!_0x4fc69b[_0x9113('0x5e')][_0x9113('0x64')](_0x9113('0x65'))){_0x39c66e[_0x9113('0x25')]=qs['limit'](_0x4fc69b[_0x9113('0x5e')]['limit']);_0x39c66e['offset']=qs['offset'](_0x4fc69b['query'][_0x9113('0x24')]);}_0x39c66e[_0x9113('0x66')]=qs[_0x9113('0x67')](_0x4fc69b[_0x9113('0x5e')][_0x9113('0x67')]);_0x39c66e[_0x9113('0x68')]=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x4fc69b[_0x9113('0x5e')],_0x312128[_0x9113('0x5f')]),_0x3f37a1);if(_0x4fc69b[_0x9113('0x5e')][_0x9113('0x6a')]){_0x39c66e[_0x9113('0x68')]=_[_0x9113('0x6b')](_0x39c66e[_0x9113('0x68')],{'$or':_[_0x9113('0x40')](_0x3f37a1,function(_0x4d0cfb){if(_0x4d0cfb[_0x9113('0x57')]!==_0x9113('0x6c')){var _0x399662={};_0x399662[_0x4d0cfb[_0x9113('0x31')]]={'$like':'%'+_0x4fc69b[_0x9113('0x5e')][_0x9113('0x6a')]+'%'};return _0x399662;}})});}_0x39c66e=_[_0x9113('0x6b')]({},_0x39c66e,_0x4fc69b[_0x9113('0x6d')]);var _0x40996a={'where':_0x39c66e[_0x9113('0x68')]};return db[_0x9113('0x5a')][_0x9113('0x27')](_0x40996a)[_0x9113('0x2b')](function(_0x1541d6){_0x985afe[_0x9113('0x27')]=_0x1541d6;if(_0x4fc69b[_0x9113('0x5e')][_0x9113('0x6e')]){_0x39c66e['include']=[{'all':!![]}];}return db[_0x9113('0x5a')][_0x9113('0x6f')](_0x39c66e);})[_0x9113('0x2b')](function(_0x16d191){_0x985afe['rows']=_0x16d191;return _0x985afe;})[_0x9113('0x2b')](respondWithFilteredResult(_0x6b6635,_0x39c66e))[_0x9113('0x70')](handleError(_0x6b6635,null));};exports['show']=function(_0x556625,_0x52b409){var _0x263629={'raw':![],'where':{'id':_0x556625[_0x9113('0x71')]['id']},'include':[{'model':db[_0x9113('0x59')],'as':_0x9113('0x72')}]},_0x59f43b={};_0x59f43b[_0x9113('0x55')]=_['keys'](db[_0x9113('0x5a')]['rawAttributes']);_0x59f43b[_0x9113('0x5e')]=_[_0x9113('0x5d')](_0x556625['query']);_0x59f43b[_0x9113('0x5f')]=_['intersection'](_0x59f43b[_0x9113('0x55')],_0x59f43b[_0x9113('0x5e')]);_0x263629[_0x9113('0x60')]=_[_0x9113('0x61')](_0x59f43b['model'],qs[_0x9113('0x62')](_0x556625[_0x9113('0x5e')][_0x9113('0x62')]));_0x263629[_0x9113('0x60')]=_0x263629[_0x9113('0x60')][_0x9113('0x63')]?_0x263629[_0x9113('0x60')]:_0x59f43b['model'];if(_0x556625[_0x9113('0x5e')]['includeAll']){_0x263629['include']=[{'all':!![]}];}_0x263629=_[_0x9113('0x6b')]({},_0x263629,_0x556625[_0x9113('0x6d')]);return db[_0x9113('0x5a')][_0x9113('0x73')](_0x263629)['then'](handleEntityNotFound(_0x52b409,null))[_0x9113('0x2b')](respondWithResult(_0x52b409,null))[_0x9113('0x70')](handleError(_0x52b409,null));};exports['create']=function(_0x461988,_0xbe79a9){return db[_0x9113('0x5a')][_0x9113('0x74')](_0x461988['body'],{})[_0x9113('0x2b')](function(_0x31b444){var _0x3d4c07=_0x461988[_0x9113('0x75')][_0x9113('0x2d')]({'plain':!![]});if(!_0x3d4c07)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d4c07['role']==='user'){var _0x1f49ea=_0x31b444[_0x9113('0x2d')]({'plain':!![]});var _0xa72a90=_0x9113('0x2e');return db[_0x9113('0x76')]['find']({'where':{'name':_0xa72a90,'userProfileId':_0x3d4c07[_0x9113('0x77')]},'raw':!![]})[_0x9113('0x2b')](function(_0x389438){if(_0x389438&&_0x389438[_0x9113('0x78')]===0x0){return db[_0x9113('0x2f')][_0x9113('0x74')]({'name':_0x1f49ea[_0x9113('0x31')],'resourceId':_0x1f49ea['id'],'type':_0x389438['name'],'sectionId':_0x389438['id']},{})[_0x9113('0x2b')](function(){return _0x31b444;});}else{return _0x31b444;}})[_0x9113('0x70')](function(_0x4e3b36){logger['error'](_0x9113('0x79'),_0x4e3b36);throw _0x4e3b36;});}return _0x31b444;})[_0x9113('0x2b')](respondWithResult(_0xbe79a9,0xc9))[_0x9113('0x70')](handleError(_0xbe79a9,null));};exports[_0x9113('0x2a')]=function(_0x3d08de,_0x59f63b){if(_0x3d08de[_0x9113('0x7a')]['id']){delete _0x3d08de[_0x9113('0x7a')]['id'];}return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x3d08de['params']['id']},'include':[{'model':db[_0x9113('0x59')],'as':_0x9113('0x72')}]})['then'](handleEntityNotFound(_0x59f63b,null))[_0x9113('0x2b')](saveUpdates(_0x3d08de[_0x9113('0x7a')],null))[_0x9113('0x2b')](respondWithResult(_0x59f63b,null))[_0x9113('0x70')](handleError(_0x59f63b,null));};exports[_0x9113('0x2c')]=function(_0x2fbe28,_0x32c717){return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x2fbe28[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x32c717,null))[_0x9113('0x2b')](removeEntity(_0x32c717,null))[_0x9113('0x70')](handleError(_0x32c717,null));};exports['describe']=function(_0x3b91ba,_0x4a6ef6){return db[_0x9113('0x5a')][_0x9113('0x7b')]()['then'](respondWithResult(_0x4a6ef6,null))[_0x9113('0x70')](handleError(_0x4a6ef6,null));};exports[_0x9113('0x7c')]=function(_0x5ad7e8,_0x446e0f){if(_0x5ad7e8[_0x9113('0x7a')]['id']){delete _0x5ad7e8['body']['id'];}return db[_0x9113('0x5a')]['find']({'where':{'id':_0x5ad7e8['params']['id']}})['then'](handleEntityNotFound(_0x446e0f,null))[_0x9113('0x2b')](function(_0x3a318a){if(_0x3a318a){_0x5ad7e8[_0x9113('0x7a')][_0x9113('0x7d')]=_0x3a318a['id'];return db[_0x9113('0x7e')][_0x9113('0x74')](_0x5ad7e8[_0x9113('0x7a')]);}})[_0x9113('0x2b')](respondWithResult(_0x446e0f,null))[_0x9113('0x70')](handleError(_0x446e0f,null));};exports[_0x9113('0x7f')]=function(_0x182b4b,_0x455ab8){var _0x5b0c0e={'raw':![],'where':{}};var _0x2074fc={};var _0x4144f8={'count':0x0,'rows':[]};return db[_0x9113('0x5a')]['findOne']({'where':{'id':_0x182b4b[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x455ab8,null))[_0x9113('0x2b')](function(_0x547ae8){if(_0x547ae8){_0x2074fc[_0x9113('0x55')]=_[_0x9113('0x5d')](db[_0x9113('0x7e')][_0x9113('0x80')]);_0x2074fc[_0x9113('0x5e')]=_[_0x9113('0x5d')](_0x182b4b[_0x9113('0x5e')]);_0x2074fc['filters']=_[_0x9113('0x61')](_0x2074fc['model'],_0x2074fc[_0x9113('0x5e')]);_0x5b0c0e['attributes']=_[_0x9113('0x61')](_0x2074fc[_0x9113('0x55')],qs[_0x9113('0x62')](_0x182b4b['query'][_0x9113('0x62')]));_0x5b0c0e[_0x9113('0x60')]=_0x5b0c0e[_0x9113('0x60')][_0x9113('0x63')]?_0x5b0c0e[_0x9113('0x60')]:_0x2074fc[_0x9113('0x55')];if(!_0x182b4b[_0x9113('0x5e')][_0x9113('0x64')](_0x9113('0x65'))){_0x5b0c0e[_0x9113('0x25')]=qs[_0x9113('0x25')](_0x182b4b[_0x9113('0x5e')]['limit']);_0x5b0c0e['offset']=qs['offset'](_0x182b4b[_0x9113('0x5e')][_0x9113('0x24')]);}_0x5b0c0e[_0x9113('0x66')]=qs[_0x9113('0x67')](_0x182b4b['query'][_0x9113('0x67')]);_0x5b0c0e['where']=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x182b4b[_0x9113('0x5e')],_0x2074fc['filters']));_0x5b0c0e[_0x9113('0x68')][_0x9113('0x7d')]=_0x547ae8['id'];if(_0x182b4b[_0x9113('0x5e')][_0x9113('0x6a')]){_0x5b0c0e['where']=_[_0x9113('0x6b')](_0x5b0c0e[_0x9113('0x68')],{'$or':_[_0x9113('0x40')](_0x5b0c0e[_0x9113('0x60')],function(_0x538ce9){var _0x54ead9={};_0x54ead9[_0x538ce9]={'$like':'%'+_0x182b4b[_0x9113('0x5e')][_0x9113('0x6a')]+'%'};return _0x54ead9;})});}_0x5b0c0e=_[_0x9113('0x6b')]({},_0x5b0c0e,_0x182b4b[_0x9113('0x6d')]);return db[_0x9113('0x7e')]['count']({'where':_0x5b0c0e['where']})[_0x9113('0x2b')](function(_0x2bc75c){_0x4144f8[_0x9113('0x27')]=_0x2bc75c;if(_0x182b4b['query'][_0x9113('0x6e')]){_0x5b0c0e[_0x9113('0x81')]=[{'all':!![]}];}return db[_0x9113('0x7e')][_0x9113('0x6f')](_0x5b0c0e);})[_0x9113('0x2b')](function(_0x4ed7a1){_0x4144f8[_0x9113('0x82')]=_0x4ed7a1;return _0x4144f8;});}})[_0x9113('0x2b')](respondWithFilteredResult(_0x455ab8,_0x5b0c0e))[_0x9113('0x70')](handleError(_0x455ab8,null));};exports['removeDispositions']=function(_0x179ad5,_0x4429a0){return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x179ad5[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x4429a0,null))['then'](function(_0x25eb89){if(_0x25eb89){return _0x25eb89[_0x9113('0x83')](_0x179ad5[_0x9113('0x5e')][_0x9113('0x84')]);}})[_0x9113('0x2b')](respondWithStatusCode(_0x4429a0,null))[_0x9113('0x70')](handleError(_0x4429a0,null));};exports[_0x9113('0x85')]=function(_0x1a57c9,_0x425c24){if(_0x1a57c9['body']['id']){delete _0x1a57c9['body']['id'];}return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x1a57c9[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x425c24,null))[_0x9113('0x2b')](function(_0x4996ee){if(_0x4996ee){_0x1a57c9['body'][_0x9113('0x7d')]=_0x4996ee['id'];return db[_0x9113('0x86')][_0x9113('0x74')](_0x1a57c9[_0x9113('0x7a')]);}})[_0x9113('0x2b')](respondWithResult(_0x425c24,null))[_0x9113('0x70')](handleError(_0x425c24,null));};exports['getAnswers']=function(_0x1afd6c,_0x266978){var _0x531f80={'raw':![],'where':{}};var _0x770a3e={};var _0x1a84d2={'count':0x0,'rows':[]};return db[_0x9113('0x5a')][_0x9113('0x87')]({'where':{'id':_0x1afd6c[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x266978,null))['then'](function(_0x5601aa){if(_0x5601aa){_0x770a3e[_0x9113('0x55')]=_[_0x9113('0x5d')](db['CannedAnswer'][_0x9113('0x80')]);_0x770a3e[_0x9113('0x5e')]=_['keys'](_0x1afd6c['query']);_0x770a3e['filters']=_['intersection'](_0x770a3e['model'],_0x770a3e[_0x9113('0x5e')]);_0x531f80[_0x9113('0x60')]=_[_0x9113('0x61')](_0x770a3e['model'],qs[_0x9113('0x62')](_0x1afd6c[_0x9113('0x5e')]['fields']));_0x531f80[_0x9113('0x60')]=_0x531f80['attributes'][_0x9113('0x63')]?_0x531f80['attributes']:_0x770a3e[_0x9113('0x55')];if(!_0x1afd6c[_0x9113('0x5e')][_0x9113('0x64')]('nolimit')){_0x531f80[_0x9113('0x25')]=qs[_0x9113('0x25')](_0x1afd6c[_0x9113('0x5e')]['limit']);_0x531f80[_0x9113('0x24')]=qs[_0x9113('0x24')](_0x1afd6c[_0x9113('0x5e')][_0x9113('0x24')]);}_0x531f80['order']=qs[_0x9113('0x67')](_0x1afd6c[_0x9113('0x5e')][_0x9113('0x67')]);_0x531f80[_0x9113('0x68')]=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x1afd6c[_0x9113('0x5e')],_0x770a3e[_0x9113('0x5f')]));_0x531f80[_0x9113('0x68')][_0x9113('0x7d')]=_0x5601aa['id'];if(_0x1afd6c[_0x9113('0x5e')][_0x9113('0x6a')]){_0x531f80[_0x9113('0x68')]=_[_0x9113('0x6b')](_0x531f80[_0x9113('0x68')],{'$or':_[_0x9113('0x40')](_0x531f80['attributes'],function(_0x3c8f4c){var _0x475fd5={};_0x475fd5[_0x3c8f4c]={'$like':'%'+_0x1afd6c[_0x9113('0x5e')][_0x9113('0x6a')]+'%'};return _0x475fd5;})});}_0x531f80=_['merge']({},_0x531f80,_0x1afd6c['options']);return db[_0x9113('0x86')]['count']({'where':_0x531f80[_0x9113('0x68')]})[_0x9113('0x2b')](function(_0x17813b){_0x1a84d2['count']=_0x17813b;if(_0x1afd6c['query'][_0x9113('0x6e')]){_0x531f80[_0x9113('0x81')]=[{'all':!![]}];}return db[_0x9113('0x86')][_0x9113('0x6f')](_0x531f80);})[_0x9113('0x2b')](function(_0x5c74f0){_0x1a84d2[_0x9113('0x82')]=_0x5c74f0;return _0x1a84d2;});}})['then'](respondWithFilteredResult(_0x266978,_0x531f80))[_0x9113('0x70')](handleError(_0x266978,null));};exports[_0x9113('0x88')]=function(_0x338141,_0x469b1b){return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x338141[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x469b1b,null))[_0x9113('0x2b')](function(_0x255221){if(_0x255221){return _0x255221[_0x9113('0x88')](_0x338141[_0x9113('0x5e')]['ids']);}})[_0x9113('0x2b')](respondWithStatusCode(_0x469b1b,null))[_0x9113('0x70')](handleError(_0x469b1b,null));};exports[_0x9113('0x89')]=function(_0x3236fb,_0x15d1ef){_0x3236fb['body'][_0x9113('0x8a')]=_0x3236fb[_0x9113('0x8b')][_0x9113('0x8c')];return db['ChatWebsite'][_0x9113('0x73')]({'where':{'id':_0x3236fb[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x15d1ef,null))[_0x9113('0x2b')](saveUpdates(_0x3236fb[_0x9113('0x7a')],null))[_0x9113('0x2b')](respondWithResult(_0x15d1ef,null))[_0x9113('0x70')](handleError(_0x15d1ef,null));};exports[_0x9113('0x8d')]=function(_0x1844fe,_0x1ef0e8){_0x1844fe['body'][_0x9113('0x8e')]=_0x1844fe[_0x9113('0x8b')]['filename'];return db[_0x9113('0x5a')]['find']({'where':{'id':_0x1844fe[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x1ef0e8,null))['then'](saveUpdates(_0x1844fe[_0x9113('0x7a')],null))[_0x9113('0x2b')](respondWithResult(_0x1ef0e8,null))[_0x9113('0x70')](handleError(_0x1ef0e8,null));};exports[_0x9113('0x8f')]=function(_0x3cbaa9,_0x45d2f1){_0x3cbaa9[_0x9113('0x7a')][_0x9113('0x90')]=_0x3cbaa9[_0x9113('0x8b')][_0x9113('0x8c')];return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x3cbaa9[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x45d2f1,null))[_0x9113('0x2b')](saveUpdates(_0x3cbaa9[_0x9113('0x7a')],null))[_0x9113('0x2b')](respondWithResult(_0x45d2f1,null))[_0x9113('0x70')](handleError(_0x45d2f1,null));};exports[_0x9113('0x91')]=function(_0x258ff7,_0x4bc870){_0x258ff7[_0x9113('0x7a')]['systemAvatar']=_0x258ff7[_0x9113('0x8b')]['filename'];return db['ChatWebsite'][_0x9113('0x73')]({'where':{'id':_0x258ff7['params']['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x4bc870,null))[_0x9113('0x2b')](saveUpdates(_0x258ff7[_0x9113('0x7a')],null))[_0x9113('0x2b')](respondWithResult(_0x4bc870,null))[_0x9113('0x70')](handleError(_0x4bc870,null));};exports[_0x9113('0x92')]=function(_0x26dd54,_0xa5fb10){var _0x16734e=path[_0x9113('0x93')](config[_0x9113('0x94')],_0x9113('0x95'));var _0x489205={'where':{'id':_0x26dd54[_0x9113('0x71')]['id']},'attributes':['id',_0x9113('0x8a')],'raw':!![]};var _0x5f5d7e=![];return require(_0x9113('0x96'))['getLicense']()[_0x9113('0x2b')](function(_0x380d0e){if(_0x380d0e){_0x5f5d7e=_0x380d0e[_0x9113('0x97')];}})[_0x9113('0x2b')](function(){return db['ChatWebsite'][_0x9113('0x73')](_0x489205);})['then'](handleEntityNotFound(_0xa5fb10,null))[_0x9113('0x2b')](function(_0x84c3a0){if(_0x84c3a0){if(!_[_0x9113('0x98')](_0x84c3a0[_0x9113('0x8a')])){if(fs[_0x9113('0x99')](path[_0x9113('0x93')](config[_0x9113('0x94')],'server/files/images/logos/',_0x84c3a0[_0x9113('0x8a')]))&&_0x5f5d7e){_0x16734e=path[_0x9113('0x93')](config[_0x9113('0x94')],'server/files/images/logos/',_0x84c3a0[_0x9113('0x8a')]);}}return _0xa5fb10[_0x9113('0x9a')](_0x16734e);}})[_0x9113('0x70')](handleError(_0xa5fb10,null));};exports[_0x9113('0x9b')]=function(_0x3e033e,_0x4485d5){var _0x53576d=path[_0x9113('0x93')](config[_0x9113('0x94')],_0x9113('0x9c'));var _0x1cba5b={'where':{'id':_0x3e033e[_0x9113('0x71')]['id']},'attributes':['id',_0x9113('0x8e')],'raw':!![]};return db[_0x9113('0x5a')][_0x9113('0x73')](_0x1cba5b)[_0x9113('0x2b')](handleEntityNotFound(_0x4485d5,null))['then'](function(_0x37b49e){if(_0x37b49e){if(!_[_0x9113('0x98')](_0x37b49e[_0x9113('0x8e')])){if(fs['existsSync'](path['join'](config[_0x9113('0x94')],_0x9113('0x9d'),_0x37b49e[_0x9113('0x8e')]))){_0x53576d=path[_0x9113('0x93')](config[_0x9113('0x94')],_0x9113('0x9d'),_0x37b49e['agentAvatar']);}}return _0x4485d5[_0x9113('0x9a')](_0x53576d);}})[_0x9113('0x70')](handleError(_0x4485d5,null));};exports[_0x9113('0x9e')]=function(_0x3dcf7e,_0x383e85){var _0x2b5f6=path['join'](config[_0x9113('0x94')],_0x9113('0x9f'));var _0x51a103={'where':{'id':_0x3dcf7e['params']['id']},'attributes':['id',_0x9113('0x90'),_0x9113('0xa0')],'raw':!![]};return db['ChatWebsite'][_0x9113('0x73')](_0x51a103)['then'](handleEntityNotFound(_0x383e85,null))[_0x9113('0x2b')](function(_0x181c10){if(_0x181c10){if(!_['isNil'](_0x181c10[_0x9113('0x90')])){if(fs[_0x9113('0x99')](path[_0x9113('0x93')](config[_0x9113('0x94')],_0x9113('0x9d'),_0x181c10[_0x9113('0x90')]))&&_0x181c10[_0x9113('0xa0')]){_0x2b5f6=path['join'](config[_0x9113('0x94')],_0x9113('0x9d'),_0x181c10[_0x9113('0x90')]);}}return _0x383e85[_0x9113('0x9a')](_0x2b5f6);}})[_0x9113('0x70')](handleError(_0x383e85,null));};exports[_0x9113('0xa1')]=function(_0x4fafa5,_0x3a2b17){var _0x34eebf=path[_0x9113('0x93')](config[_0x9113('0x94')],_0x9113('0xa2'));var _0x2485e2={'where':{'id':_0x4fafa5[_0x9113('0x71')]['id']},'attributes':['id',_0x9113('0xa3')],'raw':!![]};return db[_0x9113('0x5a')]['find'](_0x2485e2)[_0x9113('0x2b')](handleEntityNotFound(_0x3a2b17,null))['then'](function(_0x2c7d2c){if(_0x2c7d2c){if(!_[_0x9113('0x98')](_0x2c7d2c[_0x9113('0xa3')])){if(fs['existsSync'](path['join'](config[_0x9113('0x94')],_0x9113('0x9d'),_0x2c7d2c[_0x9113('0xa3')]))){_0x34eebf=path[_0x9113('0x93')](config[_0x9113('0x94')],'server/files/images/avatars/',_0x2c7d2c['systemAvatar']);}}return _0x3a2b17[_0x9113('0x9a')](_0x34eebf);}})['catch'](handleError(_0x3a2b17,null));};exports[_0x9113('0xa4')]=function(_0x459f94,_0x554f51){var _0x444ce8={'body':_0x459f94[_0x9113('0x7a')],'channel':_0x9113('0xa5')};var _0x4fed7f=[];var _0x57db2c=[];var _0x3b4a49={};var _0x42a65a=![];return db[_0x9113('0xa6')][_0x9113('0x7b')]()[_0x9113('0x2b')](function(_0x15c888){if(!_0x15c888){throw new db['Sequelize'][(_0x9113('0xa7'))]('no\x20available\x20attributes');}_0x4fed7f=_[_0x9113('0xa8')](_[_0x9113('0x5d')](_0x15c888),[_0x9113('0xa9'),'updatedAt']);_0x57db2c=_[_0x9113('0xa8')](_[_0x9113('0x5d')](_0x15c888),['createdAt',_0x9113('0xaa'),'CompanyId',_0x9113('0xab')]);if(_0x459f94[_0x9113('0x7a')]['id']){delete _0x459f94['body']['id'];}if(_[_0x9113('0x98')](_0x459f94['body'][_0x9113('0xac')])){throw new db[(_0x9113('0xad'))]['ValidationError'](_0x9113('0xae'));}if(_[_0x9113('0x98')](_0x459f94['body'][_0x9113('0x7a')])||_0x459f94[_0x9113('0x7a')]['body']===''){throw new db[(_0x9113('0xad'))][(_0x9113('0xa7'))](_0x9113('0xaf'));}if(_[_0x9113('0x98')](_0x459f94[_0x9113('0x7a')]['mapKey'])){throw new db[(_0x9113('0xad'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x57db2c);}if(!_[_0x9113('0xb0')](_0x57db2c,_0x459f94[_0x9113('0x7a')][_0x9113('0xb1')])){throw new db[(_0x9113('0xad'))][(_0x9113('0xa7'))](_0x9113('0xb2')+_0x57db2c);}_0x3b4a49[_0x459f94['body'][_0x9113('0xb1')]]=_0x459f94['body']['from'];})[_0x9113('0x2b')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x459f94['params']['id']},'include':[{'model':db[_0x9113('0xb3')],'as':_0x9113('0xb4'),'include':[{'model':db[_0x9113('0xa6')],'as':_0x9113('0xb5'),'where':_0x3b4a49,'limit':0x1,'order':[[_0x9113('0xaa'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x9113('0xb6')},{'model':db[_0x9113('0x41')],'as':_0x9113('0x41'),'include':[{'model':db['Interval'],'as':_0x9113('0x42'),'attributes':['id',_0x9113('0x37')],'raw':!![]}]}]});})[_0x9113('0x2b')](function(_0x586c30){if(!_0x586c30)throw new APINotFoundError(util['format'](_0x9113('0xb7'),_0x459f94[_0x9113('0x71')]['id']));if(!_0x586c30['Interval']||!_0x586c30[_0x9113('0x41')][_0x9113('0x42')])return[_0x586c30,!![]];return[_0x586c30,checkWebsiteIntervals(_0x586c30)];})[_0x9113('0xb8')](function(_0x49d6ba,_0x5eb902){if(!_0x5eb902)throw new APIOutOfIntervalError();if(!_0x49d6ba[_0x9113('0xb4')])return;_0x444ce8[_0x9113('0xb9')]=_0x49d6ba;_0x444ce8[_0x9113('0xba')]=_0x49d6ba[_0x9113('0xb4')];_0x444ce8[_0x9113('0xbb')]=_[_0x9113('0xbc')](_0x49d6ba[_0x9113('0xb6')],[_0x9113('0xbd')],[_0x9113('0xbe')]);if(_0x444ce8[_0x9113('0xb9')][_0x9113('0xb6')]){delete _0x444ce8[_0x9113('0xb9')][_0x9113('0xb6')];}if(_0x444ce8[_0x9113('0xb9')]['List']&&_0x444ce8[_0x9113('0xb9')][_0x9113('0xb4')][_0x9113('0xb5')][_0x9113('0x63')]){return _0x444ce8[_0x9113('0xb9')][_0x9113('0xb4')][_0x9113('0xb5')][0x0];}var _0x198dc1=_[_0x9113('0x14')](_0x459f94[_0x9113('0x7a')],{'firstName':_0x459f94['body'][_0x9113('0xac')],'ListId':_0x49d6ba[_0x9113('0xab')]});_0x198dc1[_0x459f94['body'][_0x9113('0xb1')]]=_0x459f94[_0x9113('0x7a')][_0x9113('0xac')];return db[_0x9113('0xa6')]['create'](_0x198dc1,{'fields':_0x4fed7f,'raw':!![]});})[_0x9113('0x2b')](function(_0x4de2a7){_0x444ce8[_0x9113('0xbf')]=_0x4de2a7;var _0x34ff8b=createInteractionObject(_0x459f94[_0x9113('0x71')]['id'],_0x459f94[_0x9113('0x7a')],_0x459f94[_0x9113('0xc0')],_0x4de2a7);var _0x16405d={'ChatWebsiteId':_0x459f94['params']['id'],'closed':![]};if(_0x459f94['body']['threadId']){_0x16405d[_0x9113('0xc1')]=_0x459f94['body'][_0x9113('0xc1')];return db[_0x9113('0xc2')][_0x9113('0x73')]({'where':_0x16405d})[_0x9113('0x2b')](function(_0x2b7c5){if(_0x2b7c5){_0x42a65a=!![];return _0x2b7c5;}_0x34ff8b[_0x9113('0xc1')]=_0x459f94['body'][_0x9113('0xc1')];_0x34ff8b[_0x9113('0xc3')]=_0x459f94[_0x9113('0x7a')][_0x9113('0xc3')];return db[_0x9113('0xc2')][_0x9113('0x74')](_0x34ff8b);});}_0x16405d['ContactId']=_0x4de2a7['id'];if(_0x459f94['body'][_0x9113('0xc4')]&&_0x459f94[_0x9113('0x7a')][_0x9113('0xc4')]['id']){_0x16405d['id']=_0x459f94[_0x9113('0x7a')]['interaction']['id'];return db[_0x9113('0xc2')]['find']({'where':_0x16405d})['then'](function(_0x2f19da){if(_0x2f19da){_0x42a65a=!![];return _0x2f19da;}return db[_0x9113('0xc2')][_0x9113('0x74')](_0x34ff8b);});}return db[_0x9113('0xc2')]['create'](_0x34ff8b);})[_0x9113('0x2b')](function(_0x4df2a2){if(!_0x42a65a)return _0x4df2a2;var _0x4a2471={'from':(_0x444ce8[_0x9113('0xbf')][_0x9113('0x4d')]||'')+'\x20'+(_0x444ce8[_0x9113('0xbf')]['lastName']||'')};if(_0x459f94[_0x9113('0x7a')][_0x9113('0xc1')]&&_0x459f94[_0x9113('0x7a')][_0x9113('0xc5')]&&_0x459f94[_0x9113('0x7a')]['threadId']!=_0x459f94[_0x9113('0x7a')]['messageId']){_0x4a2471['threadId']=_0x459f94[_0x9113('0x7a')][_0x9113('0xc5')];}return _0x4df2a2[_0x9113('0x2a')](_0x4a2471);})[_0x9113('0x2b')](function(_0x1b3ef7){_0x444ce8[_0x9113('0xc4')]=_0x1b3ef7[_0x9113('0x2d')]({'plain':!![]});_0x444ce8[_0x9113('0xc4')][_0x9113('0xc6')]=!_0x42a65a;if(_0x444ce8[_0x9113('0xc4')]['created']){if(_0x444ce8[_0x9113('0xb9')][_0x9113('0xc7')]){_0x444ce8[_0x9113('0xbb')]['push']({'id':0x0,'priority':_0x444ce8['applications'][_0x9113('0x63')]+0x1,'app':'close','appdata':_0x9113('0xc8'),'interval':_0x9113('0xc9')});}}return db['ChatMessage']['create']({'body':_0x459f94['body']['body'],'ChatWebsiteId':_0x459f94[_0x9113('0x71')]['id'],'ChatInteractionId':_0x1b3ef7['id'],'direction':'in','ContactId':_0x444ce8['contact']['id'],'AttachmentId':_0x459f94[_0x9113('0x7a')][_0x9113('0xca')]});})[_0x9113('0x2b')](function(_0x2f31a8){_0x444ce8[_0x9113('0x1f')]=_0x2f31a8;if(!_0x444ce8[_0x9113('0xc4')]['UserId']){return;}return db['User'][_0x9113('0x73')]({'attributes':['id',_0x9113('0x31')],'where':{'id':_0x444ce8['interaction'][_0x9113('0xcb')]}});})[_0x9113('0x2b')](function(_0x5c5b3e){if(_0x5c5b3e){_0x444ce8[_0x9113('0xbb')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9113('0xcc'),'appdata':_0x5c5b3e[_0x9113('0x31')]+','+(_0x444ce8[_0x9113('0xb9')][_0x9113('0xcd')]||0xa),'interval':'*,*,*,*'});_0x444ce8['forcedOwnership']=!![];}if(!_0x444ce8['interaction'][_0x9113('0xce')]){return;}return db[_0x9113('0xcf')]['find']({'attributes':['id','name'],'where':{'id':_0x444ce8[_0x9113('0xc4')][_0x9113('0xce')]}});})[_0x9113('0x2b')](function(_0x356503){if(_0x356503){_0x444ce8['applications'][_0x9113('0xd0')]({'id':0x0,'priority':0x1,'app':_0x9113('0xd1'),'appdata':_0x356503[_0x9113('0x31')]+','+(_0x444ce8['account'][_0x9113('0xd2')]||0x12c),'interval':_0x9113('0xc9')});}return respondWithRpcPromise(_0x9113('0xd3'),'startRouting',_0x444ce8);})[_0x9113('0x2b')](function(_0x538efb){respondWithRpcPromise(_0x9113('0xd4'),_0x9113('0xd4'),{'event':'notify','message':_0x538efb},client9002);return _0x538efb;})[_0x9113('0x2b')](respondWithResult(_0x554f51,null))['catch'](APIHandleError(_0x554f51));};exports['offline']=function(_0x5ec7c1,_0x55a4c2){var _0x572fb1,_0x51801f,_0x2ad2ce;var _0x821a00=[];var _0x54400b={};var _0x504e3d=_0x5ec7c1[_0x9113('0xd5')]||[];var _0x39ca49=[];var _0x48cdcc;return db[_0x9113('0xa6')][_0x9113('0x7b')]()[_0x9113('0x2b')](function(_0x510078){if(!_0x510078){throw new db['Sequelize'][(_0x9113('0xa7'))](_0x9113('0xd6'));}_0x821a00=_['difference'](_['keys'](_0x510078),['createdAt',_0x9113('0xaa'),_0x9113('0xd7'),_0x9113('0xab')]);if(_0x5ec7c1[_0x9113('0x7a')]['id']){delete _0x5ec7c1['body']['id'];}if(_['isNil'](_0x5ec7c1[_0x9113('0x7a')][_0x9113('0xac')])){throw _0x55a4c2[_0x9113('0x23')](0x1f4)['send'](new db[(_0x9113('0xad'))][(_0x9113('0xa7'))]('from\x20is\x20mandatory'));}if(_[_0x9113('0x98')](_0x5ec7c1[_0x9113('0x7a')][_0x9113('0x7a')])||_0x5ec7c1[_0x9113('0x7a')][_0x9113('0x7a')]===''){throw _0x55a4c2[_0x9113('0x23')](0x1f4)[_0x9113('0x32')](new db[(_0x9113('0xad'))][(_0x9113('0xa7'))](_0x9113('0xaf')));}if(_['isNil'](_0x5ec7c1[_0x9113('0x7a')][_0x9113('0xd8')])){throw _0x55a4c2[_0x9113('0x23')](0x1f4)[_0x9113('0x32')](new db[(_0x9113('0xad'))][(_0x9113('0xa7'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x821a00));}if(!_[_0x9113('0xb0')](_0x821a00,_0x5ec7c1['body']['mapKeyOffline'])){throw _0x55a4c2['status'](0x1f4)[_0x9113('0x32')](new db[(_0x9113('0xad'))][(_0x9113('0xa7'))](_0x9113('0xd9')+_0x821a00));}_0x54400b[_0x5ec7c1[_0x9113('0x7a')][_0x9113('0xd8')]]=_0x5ec7c1[_0x9113('0x7a')][_0x9113('0xac')];})[_0x9113('0x2b')](function(){return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x5ec7c1[_0x9113('0x71')]['id']},'include':[{'model':db[_0x9113('0xb3')],'as':_0x9113('0xb4')},{'model':db['MailAccount'],'as':_0x9113('0xda')}]});})['then'](handleEntityNotFound(_0x55a4c2,null))[_0x9113('0x2b')](function(_0x7174fa){if(_0x7174fa&&_0x7174fa['List']){_0x51801f=_0x7174fa;var _0x41f322=_[_0x9113('0x14')](_0x5ec7c1[_0x9113('0x7a')],{'firstName':_0x5ec7c1[_0x9113('0x7a')][_0x9113('0xac')],'phone':_0x5ec7c1['body'][_0x9113('0xac')],'ListId':_0x7174fa[_0x9113('0xab')]});_0x41f322[_0x5ec7c1[_0x9113('0x7a')]['mapKeyOffline']]=_0x5ec7c1[_0x9113('0x7a')][_0x9113('0xac')];return db[_0x9113('0xa6')][_0x9113('0xdb')]({'where':_0x54400b,'defaults':_0x41f322});}})['spread'](function(_0x1a5648){if(_0x1a5648){_0x2ad2ce=_0x1a5648;var _0x361012=fs[_0x9113('0xdc')](path[_0x9113('0x93')](config['root'],_0x9113('0xdd')),_0x9113('0xde'));var _0x262aca=ejs['render'](_0x361012,{'body':_[_0x9113('0xdf')](_0x5ec7c1['body'][_0x9113('0x7a')]),'bodyTitle':_0x51801f['offlineMessageBody']});return db['ChatOfflineMessage'][_0x9113('0x74')]({'body':_0x262aca,'plainBody':htmlToText[_0x9113('0xe0')](_0x262aca),'ContactId':_0x1a5648['id'],'ChatWebsiteId':_0x51801f['id']});}})[_0x9113('0x2b')](function(_0x1e4406){_0x48cdcc=_0x1e4406;if(_0x504e3d[_0x9113('0x63')]){var _0x4ea56c=_0x504e3d[_0x9113('0x40')](function(_0x4744af){return{'name':_0x4744af[_0x9113('0xe1')],'basename':_0x4744af['filename'],'type':_0x4744af[_0x9113('0xe2')],'ChatOfflineMessageId':_0x1e4406['id']};});_0x39ca49=_0x4ea56c[_0x9113('0x40')](_0x5169ad=>{var _0x5ce14d={'filename':_0x5169ad[_0x9113('0x31')],'path':path['join'](config[_0x9113('0x94')],_0x9113('0xe3'),_0x9113('0xd5'),_0x9113('0xe4'),_0x9113('0xe5'),_0x5169ad[_0x9113('0xe6')])};return _0x5ce14d;});if(!_0x51801f[_0x9113('0xe7')]){return db[_0x9113('0xe8')][_0x9113('0xe9')](function(_0x14f3d8){return db['Attachment'][_0x9113('0xea')](_0x4ea56c,{'transaction':_0x14f3d8});});}}})[_0x9113('0x2b')](function(){if(_0x48cdcc){_0x572fb1=_0x48cdcc;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x9113('0xeb'),'raw':!![],'include':[{'model':db[_0x9113('0xec')],'as':_0x9113('0xec'),'raw':!![]}]}]});}})[_0x9113('0x2b')](function(_0x46473d){if(_0x46473d&&_0x46473d['Smtp']&&_0x51801f[_0x9113('0xed')]&&_0x51801f['forwardOfflineAddress']){var _0x2fd0e2=_0x46473d[_0x9113('0xee')]();return respondWithRpcPromise(_0x9113('0xef'),_0x9113('0xf0'),{'account':_0x2fd0e2,'message':{'from':util[_0x9113('0x35')](_0x9113('0xf1'),_0x46473d[_0x9113('0x31')],_0x46473d[_0x9113('0xf2')]||_0x46473d[_0x9113('0xeb')][_0x9113('0x75')]),'to':_0x51801f[_0x9113('0xf3')],'subject':_0x51801f[_0x9113('0xf4')],'html':_0x572fb1[_0x9113('0x7a')],'attachments':_0x39ca49}},client9003)[_0x9113('0x2b')](function(){return _0x572fb1;})['catch'](function(_0xd65505){logger[_0x9113('0x1e')](_0xd65505);});}})[_0x9113('0x2b')](function(){if(_0x51801f&&_0x51801f[_0x9113('0xe7')]&&_0x51801f[_0x9113('0xf5')]){var _0x438850=[];if(_0x504e3d[_0x9113('0x63')]){_0x438850=_0x504e3d['map'](function(_0x4f7446){return{'name':_0x4f7446[_0x9113('0xe1')],'basename':_0x4f7446['filename'],'type':_0x4f7446['mimetype'],'ChatOfflineMessageId':_0x48cdcc['id']};});}var _0x22ac3f;if(!_['isNil'](_0x51801f[_0x9113('0xf6')])){var _0xfa8747=_[_0x9113('0x40')](_0x5ec7c1[_0x9113('0x7a')],function(_0x2d7fd1){return _0x2d7fd1;});var _0x519c86=_['toPairsIn'](_0xfa8747)[0x0];var _0x37ab18=_[_0x9113('0xf7')](_0x519c86,function(_0x229fdd){return _0x229fdd;});_0x22ac3f=_0x37ab18[0x1][_0x51801f[_0x9113('0xf6')]];}var _0x664e63={'from':_0x2ad2ce[_0x9113('0xf2')],'firstName':_0x2ad2ce[_0x9113('0x4d')],'lastName':_0x2ad2ce[_0x9113('0x4e')],'mapKey':_0x9113('0xf2'),'message':{'from':_0x2ad2ce[_0x9113('0xf2')],'to':_0x51801f[_0x9113('0xda')][_0x9113('0xf2')],'cc':'','subject':_['isNil'](_0x22ac3f)?_0x51801f[_0x9113('0xf4')]:_0x22ac3f,'messageId':'','sentAt':new Date(),'attach':_0x438850[_0x9113('0x63')],'attachments':_0x438850,'originChannel':_0x9113('0xf8'),'ChatWebsiteId':_0x51801f['id'],'ChatOfflineMessageId':_0x572fb1['id'],'originTo':_0x51801f[_0x9113('0xda')][_0x9113('0xf2')]},'body':_0x572fb1[_0x9113('0x7a')]};var _0x59b0af={'account':{'id':_0x51801f['MailAccountId']},'body':_0x664e63,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x9113('0xf9'),_0x9113('0xfa'),_0x59b0af,client9001)[_0x9113('0x2b')](function(){return _0x572fb1;})[_0x9113('0x70')](function(_0x239c5f){logger[_0x9113('0x1e')](_0x239c5f);});}return;})[_0x9113('0x2b')](function(){if(_0x572fb1){return _0x572fb1;}})['then'](respondWithResult(_0x55a4c2,null))['catch'](function(){for(var _0x52a9f4 of _0x504e3d){var _0x1d73f5=path['join'](config['root'],_0x9113('0xe3'),'files',_0x9113('0xe4'),'offline-chat',_0x52a9f4[_0x9113('0x8c')]);fs_extra[_0x9113('0xfb')](_0x1d73f5)[_0x9113('0x70')](function(_0x1ae839){logger[_0x9113('0x1e')](_0x9113('0xfc'),_0x1d73f5,_0x1ae839);});}});};exports[_0x9113('0xfd')]=function(_0x1f772b,_0x651dac){return db['ChatInteraction'][_0x9113('0x73')]({'where':{'id':_0x1f772b[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x651dac,null))[_0x9113('0x2b')](function(_0x4a011c){if(_0x4a011c){return _0x4a011c[_0x9113('0xfd')](_0x1f772b['body'][_0x9113('0x84')],_['omit'](_0x1f772b[_0x9113('0x7a')],['ids','id'])||{});}})[_0x9113('0x2b')](respondWithResult(_0x651dac,null))['catch'](handleError(_0x651dac,null));};exports[_0x9113('0xfe')]=function(_0x12fe46,_0x3e7821){var _0x2456b5={'raw':![],'where':{}};var _0x5be781={};var _0x1f7170={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x9113('0x87')]({'where':{'id':_0x12fe46['params']['id']}})['then'](handleEntityNotFound(_0x3e7821,null))[_0x9113('0x2b')](function(_0x1f5295){if(_0x1f5295){_0x5be781[_0x9113('0x55')]=_[_0x9113('0x5d')](db[_0x9113('0xc2')][_0x9113('0x80')]);_0x5be781['query']=_[_0x9113('0x5d')](_0x12fe46[_0x9113('0x5e')]);_0x5be781[_0x9113('0x5f')]=_[_0x9113('0x61')](_0x5be781[_0x9113('0x55')],_0x5be781[_0x9113('0x5e')]);_0x2456b5[_0x9113('0x60')]=_['intersection'](_0x5be781[_0x9113('0x55')],qs[_0x9113('0x62')](_0x12fe46['query'][_0x9113('0x62')]));_0x2456b5[_0x9113('0x60')]=_0x2456b5[_0x9113('0x60')][_0x9113('0x63')]?_0x2456b5['attributes']:_0x5be781[_0x9113('0x55')];if(!_0x12fe46['query'][_0x9113('0x64')](_0x9113('0x65'))){_0x2456b5[_0x9113('0x25')]=qs[_0x9113('0x25')](_0x12fe46[_0x9113('0x5e')][_0x9113('0x25')]);_0x2456b5[_0x9113('0x24')]=qs[_0x9113('0x24')](_0x12fe46[_0x9113('0x5e')][_0x9113('0x24')]);}_0x2456b5[_0x9113('0x66')]=qs[_0x9113('0x67')](_0x12fe46[_0x9113('0x5e')][_0x9113('0x67')]);_0x2456b5[_0x9113('0x68')]=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x12fe46['query'],_0x5be781[_0x9113('0x5f')]));_0x2456b5[_0x9113('0x68')]['ChatWebsiteId']=_0x1f5295['id'];if(_0x12fe46[_0x9113('0x5e')][_0x9113('0x6a')]){_0x2456b5[_0x9113('0x68')]=_['merge'](_0x2456b5[_0x9113('0x68')],{'$or':_['map'](_0x2456b5[_0x9113('0x60')],function(_0x5435dc){var _0x58b378={};_0x58b378[_0x5435dc]={'$like':'%'+_0x12fe46[_0x9113('0x5e')]['filter']+'%'};return _0x58b378;})});}_0x2456b5=_[_0x9113('0x6b')]({},_0x2456b5,_0x12fe46[_0x9113('0x6d')]);return db[_0x9113('0xc2')][_0x9113('0x27')]({'where':_0x2456b5['where']})['then'](function(_0x61e2b){_0x1f7170['count']=_0x61e2b;if(_0x12fe46[_0x9113('0x5e')]['includeAll']){_0x2456b5['include']=[{'model':db[_0x9113('0xa6')],'as':_0x9113('0xff'),'required':![]},{'model':db['User'],'as':_0x9113('0x100'),'attributes':[_0x9113('0x31'),_0x9113('0x101'),'internal'],'required':![]},{'model':db[_0x9113('0x102')],'as':_0x9113('0x103'),'attributes':['id',_0x9113('0x31'),'color'],'where':_0x12fe46[_0x9113('0x5e')][_0x9113('0x104')]?{'id':_0x12fe46[_0x9113('0x5e')][_0x9113('0x104')]}:undefined,'required':_0x12fe46[_0x9113('0x5e')][_0x9113('0x104')]?!![]:![]}];}return db[_0x9113('0xc2')][_0x9113('0x6f')](_0x2456b5);})['then'](function(_0x1586da){_0x1f7170[_0x9113('0x82')]=_0x1586da;return _0x1f7170;});}})[_0x9113('0x2b')](respondWithFilteredResult(_0x3e7821,_0x2456b5))[_0x9113('0x70')](handleError(_0x3e7821,null));};exports[_0x9113('0x105')]=function(_0x3696d0,_0x3d2a29){var _0x7337e4=0x0;var _0x1b9b08=0x0;var _0x347f9a=![];var _0x1a79bc;var _0x474e97;return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x3696d0['params']['id']},'include':[{'model':db['Interval'],'as':_0x9113('0x41'),'include':[{'model':db[_0x9113('0x41')],'as':_0x9113('0x42'),'attributes':['id',_0x9113('0x37')]}]}]})['then'](handleEntityNotFound(_0x3d2a29,null))[_0x9113('0x2b')](function(_0x32f7c7){if(_0x32f7c7){_0x1a79bc=_0x32f7c7;return _0x32f7c7['getProactiveActions']({'raw':!![]});}})['then'](function(_0xe8f1ed){if(_0x1a79bc){if(_0xe8f1ed){_0x474e97=_0xe8f1ed;}}return require(_0x9113('0x96'))[_0x9113('0x106')]();})[_0x9113('0x2b')](function(_0x43a949){if(_0x43a949){_0x1b9b08=_0x43a949[_0x9113('0x107')];_0x347f9a=_0x43a949['custom'];}})[_0x9113('0x2b')](function(){return db[_0x9113('0xc2')]['count']({'where':{'closed':![]}});})[_0x9113('0x2b')](function(_0x25d00d){_0x7337e4=_0x25d00d;if(_0x1b9b08&&_0x25d00d>_0x1b9b08){return db[_0x9113('0x108')][_0x9113('0x87')]({'where':{'id':0x1}})[_0x9113('0x2b')](function(_0x2e2d98){if(_0x2e2d98){_0x2e2d98[_0x9113('0x109')](_0x9113('0x10a'));}});}})[_0x9113('0x2b')](function(){if(!_0x1a79bc['Interval']||!_0x1a79bc[_0x9113('0x41')][_0x9113('0x42')])return!![];return checkWebsiteIntervals(_0x1a79bc);})['then'](function(_0x23c7d2){var _0x108bd4=fs[_0x9113('0xdc')](path[_0x9113('0x93')](config['root'],_0x9113('0x10b')),_0x9113('0xde'));var _0x12c852=new url[(_0x9113('0x10c'))](_0x1a79bc['address'])[_0x9113('0x10d')];var _0x1e6b43=_0x9113('0x10e');var _0x13907d=![];var _0x1666e9={'chatVersion':_0x1e6b43,'chatWebsiteAddressOrigin':_0x12c852,'remote':_0x1a79bc[_0x9113('0x10f')],'query':querystring[_0x9113('0x58')](_['merge'](_0x1a79bc[_0x9113('0x2d')]({'plain':!![]}),{'customerIp':_0x3696d0[_0x9113('0xc0')][_0x9113('0x4a')]||_0x3696d0[_0x9113('0xc0')][_0x9113('0x110')]||_0x3696d0['connection'][_0x9113('0x111')]||_0x3696d0['ip'],'referer':_0x3696d0[_0x9113('0xc0')]['referer'],'openedInteractions':_0x7337e4,'maxInteractions':_0x1b9b08,'virtual':_0x347f9a[_0x9113('0x107')],'online':_0x23c7d2,'custom':_0x347f9a}))[_0x9113('0x112')](/'/g,'\x5c\x27')};_0x3d2a29[_0x9113('0x32')](ejs['render'](Mustache[_0x9113('0x113')](_0x108bd4,_0x1666e9),{'proactiveActions':_0x474e97,'alignment':_0x1a79bc[_0x9113('0x114')],'verticalAlignment':_0x1a79bc[_0x9113('0x115')],'div_color':_0x1a79bc[_0x9113('0x116')],'labelText':_0x1a79bc[_0x9113('0x117')],'text_color':_0x1a79bc['textColor'],'text_button_color':_0x1a79bc['textButtonColor'],'button_color':_0x1a79bc[_0x9113('0x118')],'background_color':_0x1a79bc[_0x9113('0x119')],'hideWhenOffline':_0x1a79bc[_0x9113('0x11a')],'intervalId':_0x1a79bc[_0x9113('0x11b')],'isDevelopment':_0x13907d,'chatVersion':_0x1e6b43}));})[_0x9113('0x70')](handleError(_0x3d2a29,null));};exports[_0x9113('0x11c')]=function(_0x1789ff,_0x36368b){var _0xc317c5=_0x1789ff['params']['id'];var _0x566264=_0x1789ff['body'];var _0x78914c=0xc8;var _0x472ab2=null;return db[_0x9113('0xe8')][_0x9113('0xe9')]({'isolationLevel':db['sequelize'][_0x9113('0x11d')][_0x9113('0x11e')][_0x9113('0x11f')]},function(_0x4b7ba2){return db[_0x9113('0x5a')]['findOne']({'where':{'id':_0xc317c5},'transaction':_0x4b7ba2})[_0x9113('0x2b')](function(_0x390eb0){if(_0x390eb0){return db['ChatApplication'][_0x9113('0x2c')]({'where':{'ChatWebsiteId':_0xc317c5},'transaction':_0x4b7ba2})[_0x9113('0x2b')](function(){var _0x2cee19=_[_0x9113('0x40')](_0x566264,function(_0x2bbd92){_0x2bbd92['ChatWebsiteId']=_0xc317c5;return _0x2bbd92;});return db['ChatApplication']['bulkCreate'](_0x2cee19,{'transaction':_0x4b7ba2});});}else{_0x78914c=0x194;_0x472ab2=[];}});})['then'](function(){if(_0x78914c!==0x194){return db[_0x9113('0x120')][_0x9113('0x121')]({'where':{'ChatWebsiteId':_0xc317c5},'order':_0x9113('0xbd')})[_0x9113('0x2b')](function(_0x34b840){_0x472ab2=_0x34b840;});}})[_0x9113('0x70')](function(_0x4fcccd){_0x78914c=0x1f4;logger[_0x9113('0x1e')](_0x4fcccd['stack']);if(_0x4fcccd[_0x9113('0x31')]){delete _0x4fcccd[_0x9113('0x31')];}_0x472ab2=_0x4fcccd;})[_0x9113('0x122')](function(){if(_0x472ab2===null){_0x36368b[_0x9113('0x21')](_0x78914c);}else{if(_0x78914c===0x1f4){_0x36368b['status'](_0x78914c)[_0x9113('0x32')](_0x472ab2);}else{_0x36368b[_0x9113('0x23')](_0x78914c)['json'](_0x472ab2);}}});};exports[_0x9113('0x123')]=function(_0x5c3ad3,_0xe7382b){var _0x14d17c={};var _0x1ea370={};var _0x425deb;var _0x86a9d0;return db[_0x9113('0x5a')][_0x9113('0x87')]({'where':{'id':_0x5c3ad3['params']['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0xe7382b,null))[_0x9113('0x2b')](function(_0x9e019b){if(_0x9e019b){_0x425deb=_0x9e019b;_0x1ea370[_0x9113('0x55')]=_[_0x9113('0x5d')](db[_0x9113('0x120')]['rawAttributes']);_0x1ea370[_0x9113('0x5e')]=_['keys'](_0x5c3ad3[_0x9113('0x5e')]);_0x1ea370[_0x9113('0x5f')]=_[_0x9113('0x61')](_0x1ea370[_0x9113('0x55')],_0x1ea370['query']);_0x14d17c['attributes']=_['intersection'](_0x1ea370[_0x9113('0x55')],qs['fields'](_0x5c3ad3[_0x9113('0x5e')][_0x9113('0x62')]));_0x14d17c[_0x9113('0x60')]=_0x14d17c[_0x9113('0x60')]['length']?_0x14d17c[_0x9113('0x60')]:_0x1ea370[_0x9113('0x55')];_0x14d17c[_0x9113('0x66')]=qs['sort'](_0x5c3ad3[_0x9113('0x5e')][_0x9113('0x67')]);_0x14d17c[_0x9113('0x68')]=qs[_0x9113('0x5f')](_['pick'](_0x5c3ad3[_0x9113('0x5e')],_0x1ea370[_0x9113('0x5f')]));if(_0x5c3ad3['query']['filter']){_0x14d17c[_0x9113('0x68')]=_['merge'](_0x14d17c['where'],{'$or':_[_0x9113('0x40')](_0x14d17c[_0x9113('0x60')],function(_0x23bf98){var _0x2189e2={};_0x2189e2[_0x23bf98]={'$like':'%'+_0x5c3ad3[_0x9113('0x5e')][_0x9113('0x6a')]+'%'};return _0x2189e2;})});}_0x14d17c=_[_0x9113('0x6b')]({},_0x14d17c,_0x5c3ad3[_0x9113('0x6d')]);return _0x425deb[_0x9113('0x123')](_0x14d17c);}})[_0x9113('0x2b')](function(_0x20beea){if(_0x20beea){_0x86a9d0=_0x20beea[_0x9113('0x63')];if(!_0x5c3ad3[_0x9113('0x5e')][_0x9113('0x64')](_0x9113('0x65'))){_0x14d17c[_0x9113('0x25')]=qs[_0x9113('0x25')](_0x5c3ad3['query']['limit']);_0x14d17c['offset']=qs[_0x9113('0x24')](_0x5c3ad3[_0x9113('0x5e')][_0x9113('0x24')]);}return _0x425deb[_0x9113('0x123')](_0x14d17c);}})[_0x9113('0x2b')](function(_0x102d5f){if(_0x102d5f){return _0x102d5f?{'count':_0x86a9d0,'rows':_0x102d5f}:null;}})[_0x9113('0x2b')](respondWithResult(_0xe7382b,null))[_0x9113('0x70')](handleError(_0xe7382b,null));};exports['addProactiveActions']=function(_0x52478e,_0x4d80bd){return db[_0x9113('0x124')][_0x9113('0x73')]({'where':{'id':_0x52478e[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x4d80bd,null))[_0x9113('0x2b')](function(_0x4840c8){if(_0x4840c8){return _0x4840c8[_0x9113('0x125')](_0x52478e[_0x9113('0x7a')][_0x9113('0x84')],_['omit'](_0x52478e[_0x9113('0x7a')],[_0x9113('0x84'),'id'])||{});}})[_0x9113('0x2b')](respondWithResult(_0x4d80bd,null))[_0x9113('0x70')](handleError(_0x4d80bd,null));};exports[_0x9113('0x126')]=function(_0x160e20,_0x43352a){var _0x23d6eb={};var _0x11b55c={};var _0x5b5ff7;var _0x4bf171;return db[_0x9113('0x5a')]['findOne']({'where':{'id':_0x160e20[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x43352a,null))[_0x9113('0x2b')](function(_0x42d3e9){if(_0x42d3e9){_0x5b5ff7=_0x42d3e9;_0x11b55c[_0x9113('0x55')]=_[_0x9113('0x5d')](db[_0x9113('0x127')][_0x9113('0x80')]);_0x11b55c[_0x9113('0x5e')]=_[_0x9113('0x5d')](_0x160e20[_0x9113('0x5e')]);_0x11b55c[_0x9113('0x5f')]=_['intersection'](_0x11b55c['model'],_0x11b55c[_0x9113('0x5e')]);_0x23d6eb['attributes']=_[_0x9113('0x61')](_0x11b55c[_0x9113('0x55')],qs[_0x9113('0x62')](_0x160e20['query'][_0x9113('0x62')]));_0x23d6eb[_0x9113('0x60')]=_0x23d6eb[_0x9113('0x60')][_0x9113('0x63')]?_0x23d6eb[_0x9113('0x60')]:_0x11b55c[_0x9113('0x55')];_0x23d6eb[_0x9113('0x66')]=qs[_0x9113('0x67')](_0x160e20[_0x9113('0x5e')][_0x9113('0x67')]);_0x23d6eb[_0x9113('0x68')]=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x160e20[_0x9113('0x5e')],_0x11b55c[_0x9113('0x5f')]));if(_0x160e20[_0x9113('0x5e')][_0x9113('0x6a')]){_0x23d6eb[_0x9113('0x68')]=_[_0x9113('0x6b')](_0x23d6eb[_0x9113('0x68')],{'$or':_[_0x9113('0x40')](_0x23d6eb[_0x9113('0x60')],function(_0x4193b1){var _0x286a5a={};_0x286a5a[_0x4193b1]={'$like':'%'+_0x160e20[_0x9113('0x5e')][_0x9113('0x6a')]+'%'};return _0x286a5a;})});}_0x23d6eb=_[_0x9113('0x6b')]({},_0x23d6eb,_0x160e20[_0x9113('0x6d')]);return _0x5b5ff7[_0x9113('0x126')](_0x23d6eb);}})[_0x9113('0x2b')](function(_0x258933){if(_0x258933){_0x4bf171=_0x258933[_0x9113('0x63')];if(!_0x160e20[_0x9113('0x5e')][_0x9113('0x64')](_0x9113('0x65'))){_0x23d6eb[_0x9113('0x25')]=qs['limit'](_0x160e20['query'][_0x9113('0x25')]);_0x23d6eb['offset']=qs[_0x9113('0x24')](_0x160e20[_0x9113('0x5e')][_0x9113('0x24')]);}return _0x5b5ff7[_0x9113('0x126')](_0x23d6eb);}})['then'](function(_0x449861){if(_0x449861){return _0x449861?{'count':_0x4bf171,'rows':_0x449861}:null;}})['then'](respondWithResult(_0x43352a,null))[_0x9113('0x70')](handleError(_0x43352a,null));};exports[_0x9113('0x128')]=function(_0x35176d,_0x5d561a){var _0x2a7cbb=_0x35176d[_0x9113('0x5e')][_0x9113('0x129')]===_0x9113('0x12a')?_0x9113('0x12b'):_0x9113('0x12c');return db[_0x9113('0x5a')][_0x9113('0x73')]({'attributes':['id',_0x2a7cbb],'where':{'id':_0x35176d[_0x9113('0x71')]['id']}})['then'](handleEntityNotFound(_0x5d561a,null))['then'](function(_0x400c6e){if(_0x400c6e){var _0x50189d=_0x400c6e[_0x2a7cbb];var _0x5b7163=_0x50189d&&_0x50189d[_0x9113('0x12d')]?_0x50189d[_0x9113('0x12d')]:[];_0x5d561a[_0x9113('0x32')]({'fromKey':_[_0x9113('0x98')](_0x50189d['fromKey'])?undefined:_0x50189d[_0x9113('0x12e')],'count':_0x5b7163[_0x9113('0x63')],'rows':_0x5b7163});}})[_0x9113('0x70')](handleError(_0x5d561a,null));};exports['getOfflineMessages']=function(_0x29d20b,_0x233093){var _0xecd0ac={'raw':![],'where':{}};var _0x193361={};var _0x1c3e09={'count':0x0,'rows':[]};return db[_0x9113('0x5a')][_0x9113('0x87')]({'where':{'id':_0x29d20b[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x233093,null))[_0x9113('0x2b')](function(_0x2a3ccc){if(_0x2a3ccc){_0x193361['model']=_[_0x9113('0x5d')](db[_0x9113('0x12f')][_0x9113('0x80')]);_0x193361['query']=_[_0x9113('0x5d')](_0x29d20b[_0x9113('0x5e')]);_0x193361[_0x9113('0x5f')]=_[_0x9113('0x61')](_0x193361[_0x9113('0x55')],_0x193361[_0x9113('0x5e')]);_0xecd0ac['attributes']=_[_0x9113('0x61')](_0x193361['model'],qs[_0x9113('0x62')](_0x29d20b['query'][_0x9113('0x62')]));_0xecd0ac['attributes']=_0xecd0ac[_0x9113('0x60')][_0x9113('0x63')]?_0xecd0ac[_0x9113('0x60')]:_0x193361['model'];if(!_0x29d20b[_0x9113('0x5e')]['hasOwnProperty']('nolimit')){_0xecd0ac[_0x9113('0x25')]=qs[_0x9113('0x25')](_0x29d20b['query'][_0x9113('0x25')]);_0xecd0ac[_0x9113('0x24')]=qs[_0x9113('0x24')](_0x29d20b['query'][_0x9113('0x24')]);}_0xecd0ac[_0x9113('0x66')]=qs['sort'](_0x29d20b[_0x9113('0x5e')][_0x9113('0x67')]);_0xecd0ac[_0x9113('0x68')]=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x29d20b[_0x9113('0x5e')],_0x193361['filters']));_0xecd0ac[_0x9113('0x68')][_0x9113('0x7d')]=_0x2a3ccc['id'];if(_0x29d20b['query'][_0x9113('0x6a')]){_0xecd0ac[_0x9113('0x68')]=_[_0x9113('0x6b')](_0xecd0ac[_0x9113('0x68')],{'$or':_[_0x9113('0x40')](_0xecd0ac[_0x9113('0x60')],function(_0x33659b){var _0x51dc75={};_0x51dc75[_0x33659b]={'$like':'%'+_0x29d20b[_0x9113('0x5e')][_0x9113('0x6a')]+'%'};return _0x51dc75;})});}_0xecd0ac=_[_0x9113('0x6b')]({},_0xecd0ac,_0x29d20b['options']);return db[_0x9113('0x12f')][_0x9113('0x27')]({'where':_0xecd0ac[_0x9113('0x68')]})[_0x9113('0x2b')](function(_0x23845f){_0x1c3e09['count']=_0x23845f;if(_0x29d20b[_0x9113('0x5e')]['includeAll']){_0xecd0ac[_0x9113('0x81')]=[{'all':!![]}];}else{_0xecd0ac['include']=[{'model':db['CmContact'],'as':_0x9113('0xff'),'required':![]},{'model':db['Attachment'],'as':_0x9113('0x130'),'required':![]}];}return db['ChatOfflineMessage'][_0x9113('0x6f')](_0xecd0ac);})['then'](function(_0x484c81){_0x1c3e09['rows']=_0x484c81;return _0x1c3e09;});}})[_0x9113('0x2b')](respondWithFilteredResult(_0x233093,_0xecd0ac))[_0x9113('0x70')](handleError(_0x233093,null));};exports[_0x9113('0x131')]=function(_0x34dc68,_0x5a84da){return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x34dc68[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x5a84da,null))['then'](function(_0x191bbc){if(_0x191bbc){return _0x191bbc['addAgents'](_0x34dc68[_0x9113('0x7a')][_0x9113('0x84')],_[_0x9113('0x132')](_0x34dc68[_0x9113('0x7a')],[_0x9113('0x84'),'id'])||{})[_0x9113('0xb8')](function(_0x553cd4){for(var _0x8efd30=0x0;_0x8efd30<_0x34dc68[_0x9113('0x7a')]['ids'][_0x9113('0x63')];_0x8efd30+=0x1){socket[_0x9113('0x133')](_0x9113('0x134'),{'UserId':Number(_0x34dc68[_0x9113('0x7a')]['ids'][_0x8efd30]),'ChatWebsiteId':Number(_0x34dc68[_0x9113('0x71')]['id'])});}return _0x553cd4;});}})[_0x9113('0x2b')](respondWithResult(_0x5a84da,null))[_0x9113('0x70')](handleError(_0x5a84da,null));};exports[_0x9113('0x135')]=function(_0x17c258,_0x2d14a3){return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x17c258['params']['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x2d14a3,null))[_0x9113('0x2b')](function(_0x1f60d0){if(_0x1f60d0){return _0x1f60d0[_0x9113('0x135')](_0x17c258[_0x9113('0x5e')]['ids'])[_0x9113('0x2b')](function(){if(_[_0x9113('0x136')](_0x17c258[_0x9113('0x5e')][_0x9113('0x84')])){for(var _0x36b86b=0x0;_0x36b86b<_0x17c258['query']['ids']['length'];_0x36b86b+=0x1){socket[_0x9113('0x133')](_0x9113('0x137'),{'UserId':Number(_0x17c258[_0x9113('0x5e')][_0x9113('0x84')][_0x36b86b]),'ChatWebsiteId':Number(_0x17c258[_0x9113('0x71')]['id'])});}}else{socket[_0x9113('0x133')](_0x9113('0x137'),{'UserId':Number(_0x17c258[_0x9113('0x5e')][_0x9113('0x84')]),'ChatWebsiteId':Number(_0x17c258[_0x9113('0x71')]['id'])});}});}})['then'](respondWithStatusCode(_0x2d14a3,null))[_0x9113('0x70')](handleError(_0x2d14a3,null));};exports[_0x9113('0x138')]=function(_0x440969,_0x5c8653){var _0x553753={};var _0x28aa8b={};var _0x33e12a;var _0x1e929b;return db['ChatWebsite'][_0x9113('0x87')]({'where':{'id':_0x440969[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x5c8653,null))[_0x9113('0x2b')](function(_0xdeeda9){if(_0xdeeda9){_0x33e12a=_0xdeeda9;_0x28aa8b[_0x9113('0x55')]=_[_0x9113('0x5d')](db[_0x9113('0x139')][_0x9113('0x80')]);_0x28aa8b[_0x9113('0x5e')]=_[_0x9113('0x5d')](_0x440969[_0x9113('0x5e')]);_0x28aa8b[_0x9113('0x5f')]=_[_0x9113('0x61')](_0x28aa8b[_0x9113('0x55')],_0x28aa8b['query']);_0x553753[_0x9113('0x60')]=_[_0x9113('0x61')](_0x28aa8b[_0x9113('0x55')],qs[_0x9113('0x62')](_0x440969['query'][_0x9113('0x62')]));_0x553753[_0x9113('0x60')]=_0x553753[_0x9113('0x60')][_0x9113('0x63')]?_0x553753[_0x9113('0x60')]:_0x28aa8b['model'];_0x553753[_0x9113('0x66')]=qs[_0x9113('0x67')](_0x440969['query']['sort']);_0x553753['where']=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x440969['query'],_0x28aa8b[_0x9113('0x5f')]));if(_0x440969[_0x9113('0x5e')]['filter']){_0x553753[_0x9113('0x68')]=_[_0x9113('0x6b')](_0x553753[_0x9113('0x68')],{'$or':_[_0x9113('0x40')](_0x553753[_0x9113('0x60')],function(_0x80d76c){var _0x42f795={};_0x42f795[_0x80d76c]={'$like':'%'+_0x440969[_0x9113('0x5e')]['filter']+'%'};return _0x42f795;})});}_0x553753=_[_0x9113('0x6b')]({},_0x553753,_0x440969[_0x9113('0x6d')]);return _0x33e12a['getAgents'](_0x553753);}})[_0x9113('0x2b')](function(_0x5a918c){if(_0x5a918c){_0x1e929b=_0x5a918c['length'];if(!_0x440969[_0x9113('0x5e')]['hasOwnProperty'](_0x9113('0x65'))){_0x553753['limit']=qs[_0x9113('0x25')](_0x440969[_0x9113('0x5e')][_0x9113('0x25')]);_0x553753[_0x9113('0x24')]=qs[_0x9113('0x24')](_0x440969[_0x9113('0x5e')][_0x9113('0x24')]);}return _0x33e12a['getAgents'](_0x553753);}})[_0x9113('0x2b')](function(_0x308fe3){if(_0x308fe3){return _0x308fe3?{'count':_0x1e929b,'rows':_0x308fe3}:null;}})[_0x9113('0x2b')](respondWithResult(_0x5c8653,null))[_0x9113('0x70')](handleError(_0x5c8653,null));}; \ No newline at end of file +var _0x99bf=['keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','length','create','body','user','UserProfileSection','find','userProfileId','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','hasOwnProperty','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','getLogo','join','root','../../config/license/util','getLicense','server/files/images/logos/','download','getAvatar','existsSync','getCustomerAvatar','customerAvatar','isNil','server/files/images/avatars/','showCustomerAvatar','systemAvatar','notify','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','applications','orderBy','priority','account','ListId','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','queue','Start','EventManager','offline','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','server','files','attachments','offline-chat','basename','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','NotifyMailAccount','remove','addInteraction','omit','getInteractions','User','Owner','fullname','internal','Tag','Tags','color','tag','getProactiveActions','virtual','custom','License','readFileSync','server/files/chat/iframe.ejs','origin','3.5.0','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','fs-extra','lodash','querystring','html-to-text','ioredis','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','handleError','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','http','client','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','json','offset','undefined','limit','count','set','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','Command','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','catch','inspect','Interval','Intervals','all','some','setUA','user-agent','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','%s\x20%s','version','unknown','device','model','vendor','type','index','Pause','map','ChatWebsite','rawAttributes','query'];(function(_0x35f83e,_0x30ec55){var _0x249b05=function(_0x2c2fcc){while(--_0x2c2fcc){_0x35f83e['push'](_0x35f83e['shift']());}};_0x249b05(++_0x30ec55);}(_0x99bf,0x1ee));var _0xf99b=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x99bf[_0x1203f];return _0x365f0a;};'use strict';var Mustache=require(_0xf99b('0x0'));var util=require(_0xf99b('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf99b('0x2'));var _=require(_0xf99b('0x3'));var querystring=require(_0xf99b('0x4'));var htmlToText=require(_0xf99b('0x5'));var Redis=require(_0xf99b('0x6'));var jayson=require('jayson/promise');var url=require(_0xf99b('0x7'));var qs=require(_0xf99b('0x8'));var logger=require(_0xf99b('0x9'))(_0xf99b('0xa'));var config=require(_0xf99b('0xb'));var APIOutOfIntervalError=require(_0xf99b('0xc'))['APIOutOfIntervalError'];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIHandleError=require(_0xf99b('0xc'))[_0xf99b('0xd')];var db=require(_0xf99b('0xe'))['db'];config[_0xf99b('0xf')]=_[_0xf99b('0x10')](config[_0xf99b('0xf')],{'host':_0xf99b('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf99b('0x12'))['register'](socket);var client=jayson['client'][_0xf99b('0x13')]({'port':0x232c});var client9002=jayson[_0xf99b('0x14')][_0xf99b('0x13')]({'port':0x232a});var client9003=jayson[_0xf99b('0x14')]['http']({'port':0x232b});var client9001=jayson[_0xf99b('0x14')]['http']({'port':0x2329});function respondWithRpcPromise(_0x5e1014,_0x1866aa,_0x20d64,_0x344b10){return new Promise(function(_0x541331,_0x2f0903){var _0x51ced5=_0x344b10||client;return _0x51ced5['request'](_0x5e1014,_0x20d64)[_0xf99b('0x15')](function(_0x2c2804){logger[_0xf99b('0x16')](_0xf99b('0x17'),_0x1866aa,_0xf99b('0x18'));logger['debug'](_0xf99b('0x19'),_0x1866aa,_0xf99b('0x18'),JSON[_0xf99b('0x1a')](_0x2c2804));if(_0x2c2804[_0xf99b('0x1b')]){if(_0x2c2804[_0xf99b('0x1b')]['code']===0x1f4){logger[_0xf99b('0x1b')](_0xf99b('0x17'),_0x1866aa,_0x2c2804[_0xf99b('0x1b')][_0xf99b('0x1c')]);return _0x2f0903(_0x2c2804[_0xf99b('0x1b')]['message']);}logger[_0xf99b('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x1866aa,_0x2c2804[_0xf99b('0x1b')][_0xf99b('0x1c')]);return _0x541331(_0x2c2804[_0xf99b('0x1b')]['message']);}else{logger[_0xf99b('0x16')](_0xf99b('0x17'),_0x1866aa,_0xf99b('0x18'));_0x541331(_0x2c2804[_0xf99b('0x1d')]['message']);}})['catch'](function(_0x418139){logger[_0xf99b('0x1b')](_0xf99b('0x17'),_0x1866aa,_0x418139);_0x2f0903(_0x418139);});});}function respondWithStatusCode(_0x545c41,_0x47608f){_0x47608f=_0x47608f||0xcc;return function(_0x544396){if(_0x544396){return _0x545c41[_0xf99b('0x1e')](_0x47608f);}return _0x545c41['status'](_0x47608f)['end']();};}function respondWithResult(_0x5614e9,_0xfceb90){_0xfceb90=_0xfceb90||0xc8;return function(_0x107410){if(_0x107410){return _0x5614e9[_0xf99b('0x1f')](_0xfceb90)[_0xf99b('0x20')](_0x107410);}};}function respondWithFilteredResult(_0x58e2fe,_0x5c916a){return function(_0x564ccc){if(_0x564ccc){var _0x373f1d=typeof _0x5c916a[_0xf99b('0x21')]===_0xf99b('0x22')&&typeof _0x5c916a[_0xf99b('0x23')]===_0xf99b('0x22');var _0x138550=_0x564ccc[_0xf99b('0x24')];var _0x251b19=_0x373f1d?0x0:_0x5c916a[_0xf99b('0x21')];var _0x3e8e4d=_0x373f1d?_0x564ccc[_0xf99b('0x24')]:_0x5c916a[_0xf99b('0x21')]+_0x5c916a['limit'];var _0x155cb9;if(_0x3e8e4d>=_0x138550){_0x3e8e4d=_0x138550;_0x155cb9=0xc8;}else{_0x155cb9=0xce;}_0x58e2fe[_0xf99b('0x1f')](_0x155cb9);return _0x58e2fe[_0xf99b('0x25')]('Content-Range',_0x251b19+'-'+_0x3e8e4d+'/'+_0x138550)[_0xf99b('0x20')](_0x564ccc);}return null;};}function saveUpdates(_0x35b264){return function(_0x22362c){if(_0x22362c){return _0x22362c['update'](_0x35b264)['then'](function(_0x34c404){return _0x34c404;});}return null;};}function removeEntity(_0x44055c){return function(_0x66a247){if(_0x66a247){return _0x66a247[_0xf99b('0x26')]()[_0xf99b('0x15')](function(){var _0x392205=_0x66a247[_0xf99b('0x27')]({'plain':!![]});var _0x9b6646=_0xf99b('0x28');return db[_0xf99b('0x29')][_0xf99b('0x26')]({'where':{'type':_0x9b6646,'resourceId':_0x392205['id']}})[_0xf99b('0x15')](function(){return _0x66a247;});})[_0xf99b('0x15')](function(){_0x44055c[_0xf99b('0x1f')](0xcc)[_0xf99b('0x2a')]();});}};}function handleEntityNotFound(_0xadc8a4){return function(_0x109e7b){if(!_0x109e7b){_0xadc8a4[_0xf99b('0x1e')](0x194);}return _0x109e7b;};}function handleError(_0x3cb012,_0x4fa82e){_0x4fa82e=_0x4fa82e||0x1f4;return function(_0xc278da){logger[_0xf99b('0x1b')](_0xc278da[_0xf99b('0x2b')]);if(_0xc278da[_0xf99b('0x2c')]){delete _0xc278da[_0xf99b('0x2c')];}_0x3cb012[_0xf99b('0x1f')](_0x4fa82e)[_0xf99b('0x2d')](_0xc278da);};}function iftimePromise(_0x23cb9f,_0x3093c5){return respondWithRpcPromise(_0xf99b('0x2e'),'getSnippet',{'command':_0x3093c5[_0xf99b('0x2f')]?util[_0xf99b('0x30')](_0xf99b('0x31'),_0x23cb9f[_0xf99b('0x32')],_0x3093c5[_0xf99b('0x2f')]):util['format'](_0xf99b('0x33'),_0x23cb9f[_0xf99b('0x32')])},client9002)[_0xf99b('0x15')](function(_0x557cca){var _0x11ca6d=_0x557cca&&_0x557cca[_0xf99b('0x34')]('true')>=0x0?!![]:![];logger[_0xf99b('0x16')](_0xf99b('0x35'),_0x3093c5['id'],_0x23cb9f['id'],_0x23cb9f['interval'],_0x11ca6d?'ONLINE':_0xf99b('0x36'),_0x3093c5[_0xf99b('0x2f')]?_0x3093c5[_0xf99b('0x2f')]:_0xf99b('0x37'));return _0x11ca6d;})[_0xf99b('0x38')](function(_0x264225){logger['error'](_0xf99b('0x35'),_0x3093c5['id'],_0x23cb9f['id'],_0x23cb9f['interval'],util[_0xf99b('0x39')](_0x264225,{'showHidden':![],'depth':null}),_0x3093c5['timezone']?_0x3093c5[_0xf99b('0x2f')]:_0xf99b('0x37'));return![];});}function checkWebsiteIntervals(_0x31abde){var _0x4a3370=_['map'](_0x31abde[_0xf99b('0x3a')][_0xf99b('0x3b')],function(_0x2204e2){var _0x5f012d=_0x2204e2[_0xf99b('0x27')]({'plain':!![]});return iftimePromise(_0x5f012d,_0x31abde);});return Promise[_0xf99b('0x3c')](_0x4a3370)['then'](function(_0x23ad75){return _[_0xf99b('0x3d')](_0x23ad75);});}function createInteractionObject(_0x13702f,_0x490e40,_0x37282c,_0x428eb0){var _0x25cc43=require('user-agent-parser');var _0x2813d5=new _0x25cc43();var _0x4396e3=_0x2813d5[_0xf99b('0x3e')](_0x37282c[_0xf99b('0x3f')])['getResult']();var _0x2663d3=_0x490e40[_0xf99b('0x40')];if(_0x37282c[_0xf99b('0x41')]){_0x2663d3=_0x37282c[_0xf99b('0x41')];}else if(_0x37282c['x-forwarded-for']){_0x2663d3=_[_0xf99b('0x42')](_0x37282c[_0xf99b('0x43')][_0xf99b('0x44')](','));}return{'ContactId':_0x428eb0['id'],'ChatWebsiteId':_0x13702f,'from':(_0x428eb0[_0xf99b('0x45')]||'')+'\x20'+(_0x428eb0[_0xf99b('0x46')]||''),'customerIp':_0x2663d3,'customerPort':_0x37282c[_0xf99b('0x47')]?_0x37282c[_0xf99b('0x47')]:null,'referer':_0x490e40['referer'],'browserName':_0x4396e3[_0xf99b('0x48')][_0xf99b('0x2c')]&&_0x4396e3['browser']['version']?util[_0xf99b('0x30')](_0xf99b('0x49'),_0x4396e3[_0xf99b('0x48')]['name'],_0x4396e3[_0xf99b('0x48')][_0xf99b('0x4a')]):_0xf99b('0x4b'),'browserVersion':_0x4396e3[_0xf99b('0x48')][_0xf99b('0x4a')]||_0xf99b('0x4b'),'osName':util[_0xf99b('0x30')](_0xf99b('0x49'),_0x4396e3['os'][_0xf99b('0x2c')],_0x4396e3['os'][_0xf99b('0x4a')]),'osVersion':_0x4396e3['os'][_0xf99b('0x4a')],'deviceModel':_0x4396e3[_0xf99b('0x4c')][_0xf99b('0x4d')]&&_0x4396e3[_0xf99b('0x4c')][_0xf99b('0x4e')]?util[_0xf99b('0x30')]('%s\x20%s\x20%s',_0x4396e3[_0xf99b('0x4c')][_0xf99b('0x4d')],_0x4396e3[_0xf99b('0x4c')][_0xf99b('0x4e')],_0x4396e3[_0xf99b('0x4c')][_0xf99b('0x4f')]):null,'deviceVendor':_0x4396e3['device']['vendor'],'deviceType':_0x4396e3[_0xf99b('0x4c')][_0xf99b('0x4f')],'formData':JSON['stringify'](_0x490e40)};}exports[_0xf99b('0x50')]=function(_0x507c48,_0x57b9bd){var _0x4ca524={'include':[{'model':db[_0xf99b('0x51')],'as':'mandatoryDispositionPause'}]},_0x26e1bc={},_0x2ef315={'count':0x0,'rows':[]};var _0x4fb336=_[_0xf99b('0x52')](db[_0xf99b('0x53')][_0xf99b('0x54')],function(_0x141fee){return{'name':_0x141fee['fieldName'],'type':_0x141fee[_0xf99b('0x4f')]['key']};});_0x26e1bc['model']=_['map'](_0x4fb336,'name');_0x26e1bc[_0xf99b('0x55')]=_[_0xf99b('0x56')](_0x507c48[_0xf99b('0x55')]);_0x26e1bc[_0xf99b('0x57')]=_[_0xf99b('0x58')](_0x26e1bc['model'],_0x26e1bc['query']);_0x4ca524[_0xf99b('0x59')]=_[_0xf99b('0x58')](_0x26e1bc['model'],qs[_0xf99b('0x5a')](_0x507c48[_0xf99b('0x55')][_0xf99b('0x5a')]));_0x4ca524[_0xf99b('0x59')]=_0x4ca524[_0xf99b('0x59')]['length']?_0x4ca524[_0xf99b('0x59')]:_0x26e1bc['model'];if(!_0x507c48[_0xf99b('0x55')]['hasOwnProperty'](_0xf99b('0x5b'))){_0x4ca524['limit']=qs['limit'](_0x507c48[_0xf99b('0x55')][_0xf99b('0x23')]);_0x4ca524[_0xf99b('0x21')]=qs[_0xf99b('0x21')](_0x507c48[_0xf99b('0x55')][_0xf99b('0x21')]);}_0x4ca524[_0xf99b('0x5c')]=qs['sort'](_0x507c48['query'][_0xf99b('0x5d')]);_0x4ca524[_0xf99b('0x5e')]=qs[_0xf99b('0x57')](_[_0xf99b('0x5f')](_0x507c48['query'],_0x26e1bc[_0xf99b('0x57')]),_0x4fb336);if(_0x507c48['query']['filter']){_0x4ca524[_0xf99b('0x5e')]=_[_0xf99b('0x60')](_0x4ca524[_0xf99b('0x5e')],{'$or':_['map'](_0x4fb336,function(_0x5d6138){if(_0x5d6138['type']!==_0xf99b('0x61')){var _0x54a6b1={};_0x54a6b1[_0x5d6138['name']]={'$like':'%'+_0x507c48[_0xf99b('0x55')][_0xf99b('0x62')]+'%'};return _0x54a6b1;}})});}_0x4ca524=_[_0xf99b('0x60')]({},_0x4ca524,_0x507c48[_0xf99b('0x63')]);var _0x4a0e1b={'where':_0x4ca524[_0xf99b('0x5e')]};return db[_0xf99b('0x53')][_0xf99b('0x24')](_0x4a0e1b)[_0xf99b('0x15')](function(_0x5e3466){_0x2ef315[_0xf99b('0x24')]=_0x5e3466;if(_0x507c48[_0xf99b('0x55')][_0xf99b('0x64')]){_0x4ca524[_0xf99b('0x65')]=[{'all':!![]}];}return db['ChatWebsite'][_0xf99b('0x66')](_0x4ca524);})['then'](function(_0x319784){_0x2ef315[_0xf99b('0x67')]=_0x319784;return _0x2ef315;})[_0xf99b('0x15')](respondWithFilteredResult(_0x57b9bd,_0x4ca524))[_0xf99b('0x38')](handleError(_0x57b9bd,null));};exports[_0xf99b('0x68')]=function(_0x44efa3,_0x4fea29){var _0x134c7b={'raw':![],'where':{'id':_0x44efa3[_0xf99b('0x69')]['id']},'include':[{'model':db[_0xf99b('0x51')],'as':_0xf99b('0x6a')}]},_0x550efb={};_0x550efb['model']=_['keys'](db[_0xf99b('0x53')][_0xf99b('0x54')]);_0x550efb['query']=_[_0xf99b('0x56')](_0x44efa3[_0xf99b('0x55')]);_0x550efb[_0xf99b('0x57')]=_[_0xf99b('0x58')](_0x550efb['model'],_0x550efb[_0xf99b('0x55')]);_0x134c7b[_0xf99b('0x59')]=_['intersection'](_0x550efb[_0xf99b('0x4d')],qs['fields'](_0x44efa3[_0xf99b('0x55')][_0xf99b('0x5a')]));_0x134c7b[_0xf99b('0x59')]=_0x134c7b[_0xf99b('0x59')][_0xf99b('0x6b')]?_0x134c7b[_0xf99b('0x59')]:_0x550efb[_0xf99b('0x4d')];if(_0x44efa3[_0xf99b('0x55')]['includeAll']){_0x134c7b[_0xf99b('0x65')]=[{'all':!![]}];}_0x134c7b=_[_0xf99b('0x60')]({},_0x134c7b,_0x44efa3[_0xf99b('0x63')]);return db[_0xf99b('0x53')]['find'](_0x134c7b)[_0xf99b('0x15')](handleEntityNotFound(_0x4fea29,null))[_0xf99b('0x15')](respondWithResult(_0x4fea29,null))['catch'](handleError(_0x4fea29,null));};exports[_0xf99b('0x6c')]=function(_0x5cc6ef,_0x590343){return db[_0xf99b('0x53')][_0xf99b('0x6c')](_0x5cc6ef[_0xf99b('0x6d')],{})[_0xf99b('0x15')](function(_0x13693c){var _0x2beb1f=_0x5cc6ef[_0xf99b('0x6e')][_0xf99b('0x27')]({'plain':!![]});if(!_0x2beb1f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2beb1f['role']===_0xf99b('0x6e')){var _0x19c4a4=_0x13693c[_0xf99b('0x27')]({'plain':!![]});var _0x3ffd3a=_0xf99b('0x28');return db[_0xf99b('0x6f')][_0xf99b('0x70')]({'where':{'name':_0x3ffd3a,'userProfileId':_0x2beb1f[_0xf99b('0x71')]},'raw':!![]})[_0xf99b('0x15')](function(_0x19901c){if(_0x19901c&&_0x19901c['autoAssociation']===0x0){return db[_0xf99b('0x29')]['create']({'name':_0x19c4a4[_0xf99b('0x2c')],'resourceId':_0x19c4a4['id'],'type':_0x19901c[_0xf99b('0x2c')],'sectionId':_0x19901c['id']},{})[_0xf99b('0x15')](function(){return _0x13693c;});}else{return _0x13693c;}})[_0xf99b('0x38')](function(_0x58bd0d){logger[_0xf99b('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58bd0d);throw _0x58bd0d;});}return _0x13693c;})['then'](respondWithResult(_0x590343,0xc9))[_0xf99b('0x38')](handleError(_0x590343,null));};exports[_0xf99b('0x72')]=function(_0x23e9cc,_0x55dd8d){if(_0x23e9cc[_0xf99b('0x6d')]['id']){delete _0x23e9cc[_0xf99b('0x6d')]['id'];}return db[_0xf99b('0x53')]['find']({'where':{'id':_0x23e9cc[_0xf99b('0x69')]['id']},'include':[{'model':db[_0xf99b('0x51')],'as':_0xf99b('0x6a')}]})[_0xf99b('0x15')](handleEntityNotFound(_0x55dd8d,null))[_0xf99b('0x15')](saveUpdates(_0x23e9cc[_0xf99b('0x6d')],null))[_0xf99b('0x15')](respondWithResult(_0x55dd8d,null))[_0xf99b('0x38')](handleError(_0x55dd8d,null));};exports['destroy']=function(_0x186070,_0x2e5665){return db[_0xf99b('0x53')]['find']({'where':{'id':_0x186070[_0xf99b('0x69')]['id']}})[_0xf99b('0x15')](handleEntityNotFound(_0x2e5665,null))['then'](removeEntity(_0x2e5665,null))[_0xf99b('0x38')](handleError(_0x2e5665,null));};exports['describe']=function(_0x1c44b2,_0x3c7bfe){return db[_0xf99b('0x53')][_0xf99b('0x73')]()['then'](respondWithResult(_0x3c7bfe,null))[_0xf99b('0x38')](handleError(_0x3c7bfe,null));};exports[_0xf99b('0x74')]=function(_0x4d41f5,_0x42612e){if(_0x4d41f5[_0xf99b('0x6d')]['id']){delete _0x4d41f5[_0xf99b('0x6d')]['id'];}return db[_0xf99b('0x53')][_0xf99b('0x70')]({'where':{'id':_0x4d41f5[_0xf99b('0x69')]['id']}})[_0xf99b('0x15')](handleEntityNotFound(_0x42612e,null))[_0xf99b('0x15')](function(_0x3a2478){if(_0x3a2478){_0x4d41f5['body'][_0xf99b('0x75')]=_0x3a2478['id'];return db[_0xf99b('0x76')]['create'](_0x4d41f5[_0xf99b('0x6d')]);}})[_0xf99b('0x15')](respondWithResult(_0x42612e,null))[_0xf99b('0x38')](handleError(_0x42612e,null));};exports[_0xf99b('0x77')]=function(_0x3e2a03,_0x497c0c){var _0x54f02d={'raw':![],'where':{}};var _0x1788ea={};var _0x573eb4={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3e2a03['params']['id']}})['then'](handleEntityNotFound(_0x497c0c,null))[_0xf99b('0x15')](function(_0x324112){if(_0x324112){_0x1788ea[_0xf99b('0x4d')]=_[_0xf99b('0x56')](db['Disposition'][_0xf99b('0x54')]);_0x1788ea[_0xf99b('0x55')]=_[_0xf99b('0x56')](_0x3e2a03[_0xf99b('0x55')]);_0x1788ea[_0xf99b('0x57')]=_['intersection'](_0x1788ea['model'],_0x1788ea[_0xf99b('0x55')]);_0x54f02d[_0xf99b('0x59')]=_[_0xf99b('0x58')](_0x1788ea[_0xf99b('0x4d')],qs['fields'](_0x3e2a03[_0xf99b('0x55')][_0xf99b('0x5a')]));_0x54f02d[_0xf99b('0x59')]=_0x54f02d['attributes'][_0xf99b('0x6b')]?_0x54f02d['attributes']:_0x1788ea['model'];if(!_0x3e2a03['query']['hasOwnProperty'](_0xf99b('0x5b'))){_0x54f02d[_0xf99b('0x23')]=qs['limit'](_0x3e2a03['query'][_0xf99b('0x23')]);_0x54f02d[_0xf99b('0x21')]=qs[_0xf99b('0x21')](_0x3e2a03['query'][_0xf99b('0x21')]);}_0x54f02d['order']=qs['sort'](_0x3e2a03['query']['sort']);_0x54f02d['where']=qs[_0xf99b('0x57')](_[_0xf99b('0x5f')](_0x3e2a03[_0xf99b('0x55')],_0x1788ea['filters']));_0x54f02d[_0xf99b('0x5e')]['ChatWebsiteId']=_0x324112['id'];if(_0x3e2a03['query']['filter']){_0x54f02d[_0xf99b('0x5e')]=_['merge'](_0x54f02d[_0xf99b('0x5e')],{'$or':_['map'](_0x54f02d['attributes'],function(_0x3f4495){var _0x2fe461={};_0x2fe461[_0x3f4495]={'$like':'%'+_0x3e2a03[_0xf99b('0x55')][_0xf99b('0x62')]+'%'};return _0x2fe461;})});}_0x54f02d=_[_0xf99b('0x60')]({},_0x54f02d,_0x3e2a03['options']);return db[_0xf99b('0x76')]['count']({'where':_0x54f02d[_0xf99b('0x5e')]})[_0xf99b('0x15')](function(_0xf2fd03){_0x573eb4['count']=_0xf2fd03;if(_0x3e2a03[_0xf99b('0x55')]['includeAll']){_0x54f02d[_0xf99b('0x65')]=[{'all':!![]}];}return db[_0xf99b('0x76')][_0xf99b('0x66')](_0x54f02d);})[_0xf99b('0x15')](function(_0x44f7f5){_0x573eb4[_0xf99b('0x67')]=_0x44f7f5;return _0x573eb4;});}})[_0xf99b('0x15')](respondWithFilteredResult(_0x497c0c,_0x54f02d))[_0xf99b('0x38')](handleError(_0x497c0c,null));};exports[_0xf99b('0x78')]=function(_0x516bc9,_0x523552){return db['ChatWebsite'][_0xf99b('0x70')]({'where':{'id':_0x516bc9[_0xf99b('0x69')]['id']}})[_0xf99b('0x15')](handleEntityNotFound(_0x523552,null))[_0xf99b('0x15')](function(_0xbc4240){if(_0xbc4240){return _0xbc4240[_0xf99b('0x78')](_0x516bc9[_0xf99b('0x55')][_0xf99b('0x79')]);}})[_0xf99b('0x15')](respondWithStatusCode(_0x523552,null))[_0xf99b('0x38')](handleError(_0x523552,null));};exports[_0xf99b('0x7a')]=function(_0x2b680f,_0x43ea2a){if(_0x2b680f[_0xf99b('0x6d')]['id']){delete _0x2b680f[_0xf99b('0x6d')]['id'];}return db['ChatWebsite'][_0xf99b('0x70')]({'where':{'id':_0x2b680f['params']['id']}})['then'](handleEntityNotFound(_0x43ea2a,null))[_0xf99b('0x15')](function(_0x3c9c87){if(_0x3c9c87){_0x2b680f[_0xf99b('0x6d')][_0xf99b('0x75')]=_0x3c9c87['id'];return db[_0xf99b('0x7b')][_0xf99b('0x6c')](_0x2b680f[_0xf99b('0x6d')]);}})['then'](respondWithResult(_0x43ea2a,null))['catch'](handleError(_0x43ea2a,null));};exports[_0xf99b('0x7c')]=function(_0x465ca7,_0xd5df61){var _0x3e512b={'raw':![],'where':{}};var _0x526a2e={};var _0x125845={'count':0x0,'rows':[]};return db[_0xf99b('0x53')][_0xf99b('0x7d')]({'where':{'id':_0x465ca7['params']['id']}})['then'](handleEntityNotFound(_0xd5df61,null))['then'](function(_0x516d8b){if(_0x516d8b){_0x526a2e[_0xf99b('0x4d')]=_[_0xf99b('0x56')](db[_0xf99b('0x7b')][_0xf99b('0x54')]);_0x526a2e['query']=_[_0xf99b('0x56')](_0x465ca7[_0xf99b('0x55')]);_0x526a2e[_0xf99b('0x57')]=_[_0xf99b('0x58')](_0x526a2e[_0xf99b('0x4d')],_0x526a2e[_0xf99b('0x55')]);_0x3e512b[_0xf99b('0x59')]=_[_0xf99b('0x58')](_0x526a2e[_0xf99b('0x4d')],qs[_0xf99b('0x5a')](_0x465ca7[_0xf99b('0x55')][_0xf99b('0x5a')]));_0x3e512b['attributes']=_0x3e512b[_0xf99b('0x59')][_0xf99b('0x6b')]?_0x3e512b[_0xf99b('0x59')]:_0x526a2e['model'];if(!_0x465ca7[_0xf99b('0x55')][_0xf99b('0x7e')](_0xf99b('0x5b'))){_0x3e512b['limit']=qs[_0xf99b('0x23')](_0x465ca7[_0xf99b('0x55')]['limit']);_0x3e512b[_0xf99b('0x21')]=qs['offset'](_0x465ca7['query'][_0xf99b('0x21')]);}_0x3e512b[_0xf99b('0x5c')]=qs[_0xf99b('0x5d')](_0x465ca7[_0xf99b('0x55')][_0xf99b('0x5d')]);_0x3e512b['where']=qs['filters'](_[_0xf99b('0x5f')](_0x465ca7[_0xf99b('0x55')],_0x526a2e[_0xf99b('0x57')]));_0x3e512b[_0xf99b('0x5e')][_0xf99b('0x75')]=_0x516d8b['id'];if(_0x465ca7['query'][_0xf99b('0x62')]){_0x3e512b['where']=_[_0xf99b('0x60')](_0x3e512b['where'],{'$or':_[_0xf99b('0x52')](_0x3e512b[_0xf99b('0x59')],function(_0x4a45c2){var _0x2e6155={};_0x2e6155[_0x4a45c2]={'$like':'%'+_0x465ca7[_0xf99b('0x55')][_0xf99b('0x62')]+'%'};return _0x2e6155;})});}_0x3e512b=_[_0xf99b('0x60')]({},_0x3e512b,_0x465ca7[_0xf99b('0x63')]);return db[_0xf99b('0x7b')]['count']({'where':_0x3e512b[_0xf99b('0x5e')]})['then'](function(_0xdfdcc5){_0x125845[_0xf99b('0x24')]=_0xdfdcc5;if(_0x465ca7[_0xf99b('0x55')][_0xf99b('0x64')]){_0x3e512b[_0xf99b('0x65')]=[{'all':!![]}];}return db[_0xf99b('0x7b')][_0xf99b('0x66')](_0x3e512b);})[_0xf99b('0x15')](function(_0x5afff8){_0x125845[_0xf99b('0x67')]=_0x5afff8;return _0x125845;});}})[_0xf99b('0x15')](respondWithFilteredResult(_0xd5df61,_0x3e512b))[_0xf99b('0x38')](handleError(_0xd5df61,null));};exports[_0xf99b('0x7f')]=function(_0xb65373,_0x299096){return db[_0xf99b('0x53')]['find']({'where':{'id':_0xb65373[_0xf99b('0x69')]['id']}})[_0xf99b('0x15')](handleEntityNotFound(_0x299096,null))[_0xf99b('0x15')](function(_0x10fec9){if(_0x10fec9){return _0x10fec9['removeAnswers'](_0xb65373[_0xf99b('0x55')][_0xf99b('0x79')]);}})[_0xf99b('0x15')](respondWithStatusCode(_0x299096,null))[_0xf99b('0x38')](handleError(_0x299096,null));};exports[_0xf99b('0x80')]=function(_0x41b380,_0x229889){_0x41b380[_0xf99b('0x6d')][_0xf99b('0x81')]=_0x41b380[_0xf99b('0x82')]['filename'];return db[_0xf99b('0x53')]['find']({'where':{'id':_0x41b380['params']['id']}})[_0xf99b('0x15')](handleEntityNotFound(_0x229889,null))[_0xf99b('0x15')](saveUpdates(_0x41b380['body'],null))[_0xf99b('0x15')](respondWithResult(_0x229889,null))['catch'](handleError(_0x229889,null));};exports[_0xf99b('0x83')]=function(_0x564f35,_0x234574){_0x564f35[_0xf99b('0x6d')][_0xf99b('0x84')]=_0x564f35[_0xf99b('0x82')][_0xf99b('0x85')];return db[_0xf99b('0x53')][_0xf99b('0x70')]({'where':{'id':_0x564f35[_0xf99b('0x69')]['id']}})['then'](handleEntityNotFound(_0x234574,null))['then'](saveUpdates(_0x564f35[_0xf99b('0x6d')],null))['then'](respondWithResult(_0x234574,null))[_0xf99b('0x38')](handleError(_0x234574,null));};exports['addCustomerAvatar']=function(_0x54f287,_0x5ed388){_0x54f287[_0xf99b('0x6d')]['customerAvatar']=_0x54f287[_0xf99b('0x82')][_0xf99b('0x85')];return db[_0xf99b('0x53')][_0xf99b('0x70')]({'where':{'id':_0x54f287[_0xf99b('0x69')]['id']}})[_0xf99b('0x15')](handleEntityNotFound(_0x5ed388,null))['then'](saveUpdates(_0x54f287[_0xf99b('0x6d')],null))[_0xf99b('0x15')](respondWithResult(_0x5ed388,null))[_0xf99b('0x38')](handleError(_0x5ed388,null));};exports['addSystemAvatar']=function(_0x508362,_0x1cccbc){_0x508362[_0xf99b('0x6d')]['systemAvatar']=_0x508362[_0xf99b('0x82')][_0xf99b('0x85')];return db[_0xf99b('0x53')][_0xf99b('0x70')]({'where':{'id':_0x508362[_0xf99b('0x69')]['id']}})['then'](handleEntityNotFound(_0x1cccbc,null))[_0xf99b('0x15')](saveUpdates(_0x508362[_0xf99b('0x6d')],null))[_0xf99b('0x15')](respondWithResult(_0x1cccbc,null))[_0xf99b('0x38')](handleError(_0x1cccbc,null));};exports[_0xf99b('0x86')]=function(_0x279b10,_0x2a2d32){var _0x45fb9b=path[_0xf99b('0x87')](config[_0xf99b('0x88')],'server/files/images/logos/default_logo.svg');var _0xf4e51e={'where':{'id':_0x279b10[_0xf99b('0x69')]['id']},'attributes':['id',_0xf99b('0x81')],'raw':!![]};var _0x4d5b94=![];return require(_0xf99b('0x89'))[_0xf99b('0x8a')]()[_0xf99b('0x15')](function(_0x41dfc7){if(_0x41dfc7){_0x4d5b94=_0x41dfc7['custom'];}})[_0xf99b('0x15')](function(){return db[_0xf99b('0x53')]['find'](_0xf4e51e);})[_0xf99b('0x15')](handleEntityNotFound(_0x2a2d32,null))[_0xf99b('0x15')](function(_0x4575c0){if(_0x4575c0){if(!_['isNil'](_0x4575c0[_0xf99b('0x81')])){if(fs['existsSync'](path[_0xf99b('0x87')](config[_0xf99b('0x88')],_0xf99b('0x8b'),_0x4575c0[_0xf99b('0x81')]))&&_0x4d5b94){_0x45fb9b=path[_0xf99b('0x87')](config[_0xf99b('0x88')],_0xf99b('0x8b'),_0x4575c0[_0xf99b('0x81')]);}}return _0x2a2d32[_0xf99b('0x8c')](_0x45fb9b);}})[_0xf99b('0x38')](handleError(_0x2a2d32,null));};exports[_0xf99b('0x8d')]=function(_0x5cfc25,_0x5d5b25){var _0x2b63a5=path[_0xf99b('0x87')](config[_0xf99b('0x88')],'server/files/images/avatars/default_avatar.png');var _0x353c4b={'where':{'id':_0x5cfc25['params']['id']},'attributes':['id',_0xf99b('0x84')],'raw':!![]};return db['ChatWebsite'][_0xf99b('0x70')](_0x353c4b)[_0xf99b('0x15')](handleEntityNotFound(_0x5d5b25,null))[_0xf99b('0x15')](function(_0x1e093a){if(_0x1e093a){if(!_['isNil'](_0x1e093a[_0xf99b('0x84')])){if(fs[_0xf99b('0x8e')](path[_0xf99b('0x87')](config[_0xf99b('0x88')],'server/files/images/avatars/',_0x1e093a['agentAvatar']))){_0x2b63a5=path[_0xf99b('0x87')](config[_0xf99b('0x88')],'server/files/images/avatars/',_0x1e093a[_0xf99b('0x84')]);}}return _0x5d5b25[_0xf99b('0x8c')](_0x2b63a5);}})[_0xf99b('0x38')](handleError(_0x5d5b25,null));};exports[_0xf99b('0x8f')]=function(_0x2c6747,_0x5b793d){var _0x845e1c=path[_0xf99b('0x87')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x2425cb={'where':{'id':_0x2c6747[_0xf99b('0x69')]['id']},'attributes':['id',_0xf99b('0x90'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xf99b('0x70')](_0x2425cb)[_0xf99b('0x15')](handleEntityNotFound(_0x5b793d,null))['then'](function(_0x121dfa){if(_0x121dfa){if(!_[_0xf99b('0x91')](_0x121dfa[_0xf99b('0x90')])){if(fs[_0xf99b('0x8e')](path['join'](config[_0xf99b('0x88')],_0xf99b('0x92'),_0x121dfa[_0xf99b('0x90')]))&&_0x121dfa[_0xf99b('0x93')]){_0x845e1c=path[_0xf99b('0x87')](config[_0xf99b('0x88')],_0xf99b('0x92'),_0x121dfa[_0xf99b('0x90')]);}}return _0x5b793d[_0xf99b('0x8c')](_0x845e1c);}})[_0xf99b('0x38')](handleError(_0x5b793d,null));};exports['getSystemAvatar']=function(_0x1539bd,_0x229bc8){var _0x2fea7b=path[_0xf99b('0x87')](config[_0xf99b('0x88')],'server/files/images/avatars/system_avatar.png');var _0x6ea6ba={'where':{'id':_0x1539bd[_0xf99b('0x69')]['id']},'attributes':['id',_0xf99b('0x94')],'raw':!![]};return db['ChatWebsite'][_0xf99b('0x70')](_0x6ea6ba)[_0xf99b('0x15')](handleEntityNotFound(_0x229bc8,null))['then'](function(_0x3ff717){if(_0x3ff717){if(!_[_0xf99b('0x91')](_0x3ff717[_0xf99b('0x94')])){if(fs[_0xf99b('0x8e')](path[_0xf99b('0x87')](config[_0xf99b('0x88')],'server/files/images/avatars/',_0x3ff717[_0xf99b('0x94')]))){_0x2fea7b=path['join'](config[_0xf99b('0x88')],'server/files/images/avatars/',_0x3ff717[_0xf99b('0x94')]);}}return _0x229bc8[_0xf99b('0x8c')](_0x2fea7b);}})[_0xf99b('0x38')](handleError(_0x229bc8,null));};exports[_0xf99b('0x95')]=function(_0x29727c,_0x4b5ead){var _0x35e9f1={'body':_0x29727c['body'],'channel':_0xf99b('0x96')};var _0x863331=[];var _0x45ccb8=[];var _0x40e8c0={};var _0x481a9d=![];return db[_0xf99b('0x97')]['describe']()[_0xf99b('0x15')](function(_0x30d63e){if(!_0x30d63e){throw new db[(_0xf99b('0x98'))][(_0xf99b('0x99'))](_0xf99b('0x9a'));}_0x863331=_[_0xf99b('0x9b')](_[_0xf99b('0x56')](_0x30d63e),[_0xf99b('0x9c'),_0xf99b('0x9d')]);_0x45ccb8=_[_0xf99b('0x9b')](_['keys'](_0x30d63e),[_0xf99b('0x9c'),_0xf99b('0x9d'),_0xf99b('0x9e'),'ListId']);if(_0x29727c['body']['id']){delete _0x29727c[_0xf99b('0x6d')]['id'];}if(_[_0xf99b('0x91')](_0x29727c[_0xf99b('0x6d')][_0xf99b('0x9f')])){throw new db[(_0xf99b('0x98'))][(_0xf99b('0x99'))]('from\x20is\x20mandatory');}if(_[_0xf99b('0x91')](_0x29727c[_0xf99b('0x6d')][_0xf99b('0x6d')])||_0x29727c[_0xf99b('0x6d')][_0xf99b('0x6d')]===''){throw new db['Sequelize'][(_0xf99b('0x99'))](_0xf99b('0xa0'));}if(_[_0xf99b('0x91')](_0x29727c[_0xf99b('0x6d')][_0xf99b('0xa1')])){throw new db[(_0xf99b('0x98'))][(_0xf99b('0x99'))](_0xf99b('0xa2')+_0x45ccb8);}if(!_['includes'](_0x45ccb8,_0x29727c['body'][_0xf99b('0xa1')])){throw new db[(_0xf99b('0x98'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x45ccb8);}_0x40e8c0[_0x29727c[_0xf99b('0x6d')][_0xf99b('0xa1')]]=_0x29727c['body'][_0xf99b('0x9f')];})[_0xf99b('0x15')](function(){return db[_0xf99b('0x53')][_0xf99b('0x70')]({'where':{'id':_0x29727c[_0xf99b('0x69')]['id']},'include':[{'model':db['CmList'],'as':_0xf99b('0xa3'),'include':[{'model':db[_0xf99b('0x97')],'as':_0xf99b('0xa4'),'where':_0x40e8c0,'limit':0x1,'order':[['updatedAt',_0xf99b('0xa5')]]}]},{'model':db[_0xf99b('0xa6')],'as':_0xf99b('0xa7')},{'model':db[_0xf99b('0x3a')],'as':_0xf99b('0x3a'),'include':[{'model':db[_0xf99b('0x3a')],'as':_0xf99b('0x3b'),'attributes':['id','interval'],'raw':!![]}]}]});})['then'](function(_0x220adb){if(!_0x220adb)throw new APINotFoundError(util[_0xf99b('0x30')](_0xf99b('0xa8'),_0x29727c[_0xf99b('0x69')]['id']));if(!_0x220adb[_0xf99b('0x3a')]||!_0x220adb[_0xf99b('0x3a')][_0xf99b('0x3b')])return[_0x220adb,!![]];return[_0x220adb,checkWebsiteIntervals(_0x220adb)];})[_0xf99b('0xa9')](function(_0x2e249f,_0x2a308f){if(!_0x2a308f)throw new APIOutOfIntervalError();if(!_0x2e249f[_0xf99b('0xa3')])return;_0x35e9f1['account']=_0x2e249f;_0x35e9f1['list']=_0x2e249f[_0xf99b('0xa3')];_0x35e9f1[_0xf99b('0xaa')]=_[_0xf99b('0xab')](_0x2e249f[_0xf99b('0xa7')],[_0xf99b('0xac')],['asc']);if(_0x35e9f1[_0xf99b('0xad')][_0xf99b('0xa7')]){delete _0x35e9f1['account']['Applications'];}if(_0x35e9f1[_0xf99b('0xad')][_0xf99b('0xa3')]&&_0x35e9f1['account'][_0xf99b('0xa3')]['Contacts'][_0xf99b('0x6b')]){return _0x35e9f1[_0xf99b('0xad')][_0xf99b('0xa3')][_0xf99b('0xa4')][0x0];}var _0xf2e4ac=_['defaults'](_0x29727c[_0xf99b('0x6d')],{'firstName':_0x29727c[_0xf99b('0x6d')]['from'],'ListId':_0x2e249f[_0xf99b('0xae')]});_0xf2e4ac[_0x29727c[_0xf99b('0x6d')]['mapKey']]=_0x29727c['body']['from'];return db[_0xf99b('0x97')]['create'](_0xf2e4ac,{'fields':_0x863331,'raw':!![]});})[_0xf99b('0x15')](function(_0x51f2eb){_0x35e9f1[_0xf99b('0xaf')]=_0x51f2eb;var _0x36d227=createInteractionObject(_0x29727c['params']['id'],_0x29727c[_0xf99b('0x6d')],_0x29727c[_0xf99b('0xb0')],_0x51f2eb);var _0x286538={'ChatWebsiteId':_0x29727c[_0xf99b('0x69')]['id'],'closed':![]};if(_0x29727c[_0xf99b('0x6d')][_0xf99b('0xb1')]){_0x286538[_0xf99b('0xb1')]=_0x29727c[_0xf99b('0x6d')][_0xf99b('0xb1')];return db[_0xf99b('0xb2')][_0xf99b('0x70')]({'where':_0x286538})[_0xf99b('0x15')](function(_0x30fd14){if(_0x30fd14){_0x481a9d=!![];return _0x30fd14;}_0x36d227[_0xf99b('0xb1')]=_0x29727c[_0xf99b('0x6d')][_0xf99b('0xb1')];_0x36d227['externalUrl']=_0x29727c[_0xf99b('0x6d')][_0xf99b('0xb3')];return db[_0xf99b('0xb2')][_0xf99b('0x6c')](_0x36d227);});}_0x286538[_0xf99b('0xb4')]=_0x51f2eb['id'];if(_0x29727c['body'][_0xf99b('0xb5')]&&_0x29727c[_0xf99b('0x6d')]['interaction']['id']){_0x286538['id']=_0x29727c[_0xf99b('0x6d')][_0xf99b('0xb5')]['id'];return db[_0xf99b('0xb2')]['find']({'where':_0x286538})[_0xf99b('0x15')](function(_0x59938f){if(_0x59938f){_0x481a9d=!![];return _0x59938f;}return db[_0xf99b('0xb2')][_0xf99b('0x6c')](_0x36d227);});}return db[_0xf99b('0xb2')][_0xf99b('0x6c')](_0x36d227);})[_0xf99b('0x15')](function(_0x43941e){if(!_0x481a9d)return _0x43941e;var _0x406acd={'from':(_0x35e9f1[_0xf99b('0xaf')][_0xf99b('0x45')]||'')+'\x20'+(_0x35e9f1['contact'][_0xf99b('0x46')]||'')};if(_0x29727c[_0xf99b('0x6d')][_0xf99b('0xb1')]&&_0x29727c['body']['messageId']&&_0x29727c[_0xf99b('0x6d')]['threadId']!=_0x29727c[_0xf99b('0x6d')][_0xf99b('0xb6')]){_0x406acd[_0xf99b('0xb1')]=_0x29727c[_0xf99b('0x6d')][_0xf99b('0xb6')];}return _0x43941e[_0xf99b('0x72')](_0x406acd);})['then'](function(_0x2afc5b){_0x35e9f1[_0xf99b('0xb5')]=_0x2afc5b['get']({'plain':!![]});_0x35e9f1[_0xf99b('0xb5')][_0xf99b('0xb7')]=!_0x481a9d;if(_0x35e9f1[_0xf99b('0xb5')][_0xf99b('0xb7')]){if(_0x35e9f1[_0xf99b('0xad')]['autoclose']){_0x35e9f1[_0xf99b('0xaa')][_0xf99b('0xb8')]({'id':0x0,'priority':_0x35e9f1[_0xf99b('0xaa')][_0xf99b('0x6b')]+0x1,'app':'close','appdata':_0xf99b('0xb9'),'interval':_0xf99b('0xba')});}}return db[_0xf99b('0xbb')][_0xf99b('0x6c')]({'body':_0x29727c['body']['body'],'ChatWebsiteId':_0x29727c['params']['id'],'ChatInteractionId':_0x2afc5b['id'],'direction':'in','ContactId':_0x35e9f1[_0xf99b('0xaf')]['id'],'AttachmentId':_0x29727c[_0xf99b('0x6d')][_0xf99b('0xbc')]});})['then'](function(_0x5bd63a){_0x35e9f1[_0xf99b('0x1c')]=_0x5bd63a;if(!_0x35e9f1[_0xf99b('0xb5')][_0xf99b('0xbd')]){return;}return db['User'][_0xf99b('0x70')]({'attributes':['id',_0xf99b('0x2c')],'where':{'id':_0x35e9f1[_0xf99b('0xb5')]['UserId']}});})[_0xf99b('0x15')](function(_0xbf8ba9){if(_0xbf8ba9){_0x35e9f1[_0xf99b('0xaa')][_0xf99b('0xbe')]({'id':0x0,'priority':0x0,'app':_0xf99b('0xbf'),'appdata':_0xbf8ba9[_0xf99b('0x2c')]+','+(_0x35e9f1[_0xf99b('0xad')][_0xf99b('0xc0')]||0xa),'interval':'*,*,*,*'});_0x35e9f1[_0xf99b('0xc1')]=!![];}if(!_0x35e9f1[_0xf99b('0xb5')]['queueId']){return;}return db['ChatQueue'][_0xf99b('0x70')]({'attributes':['id','name'],'where':{'id':_0x35e9f1[_0xf99b('0xb5')][_0xf99b('0xc2')]}});})[_0xf99b('0x15')](function(_0x587d40){if(_0x587d40){_0x35e9f1['applications'][_0xf99b('0xbe')]({'id':0x0,'priority':0x1,'app':_0xf99b('0xc3'),'appdata':_0x587d40[_0xf99b('0x2c')]+','+(_0x35e9f1[_0xf99b('0xad')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xf99b('0xc4'),'startRouting',_0x35e9f1);})[_0xf99b('0x15')](function(_0x2f5f6e){respondWithRpcPromise(_0xf99b('0xc5'),_0xf99b('0xc5'),{'event':_0xf99b('0x95'),'message':_0x2f5f6e},client9002);return _0x2f5f6e;})[_0xf99b('0x15')](respondWithResult(_0x4b5ead,null))[_0xf99b('0x38')](APIHandleError(_0x4b5ead));};exports[_0xf99b('0xc6')]=function(_0x2fe499,_0x2b7bf5){var _0x44030a,_0xa48254,_0x2ef198;var _0x3c71f9=[];var _0x15d43c={};var _0x3a31d1=_0x2fe499['files']||[];var _0x5928df=[];var _0x4a5c8b;return db[_0xf99b('0x97')]['describe']()[_0xf99b('0x15')](function(_0x5f4863){if(!_0x5f4863){throw new db[(_0xf99b('0x98'))]['ValidationError'](_0xf99b('0x9a'));}_0x3c71f9=_[_0xf99b('0x9b')](_[_0xf99b('0x56')](_0x5f4863),['createdAt',_0xf99b('0x9d'),_0xf99b('0x9e'),'ListId']);if(_0x2fe499[_0xf99b('0x6d')]['id']){delete _0x2fe499['body']['id'];}if(_[_0xf99b('0x91')](_0x2fe499[_0xf99b('0x6d')][_0xf99b('0x9f')])){throw _0x2b7bf5['status'](0x1f4)[_0xf99b('0x2d')](new db['Sequelize'][(_0xf99b('0x99'))](_0xf99b('0xc7')));}if(_[_0xf99b('0x91')](_0x2fe499[_0xf99b('0x6d')][_0xf99b('0x6d')])||_0x2fe499[_0xf99b('0x6d')][_0xf99b('0x6d')]===''){throw _0x2b7bf5[_0xf99b('0x1f')](0x1f4)[_0xf99b('0x2d')](new db[(_0xf99b('0x98'))][(_0xf99b('0x99'))](_0xf99b('0xa0')));}if(_[_0xf99b('0x91')](_0x2fe499['body'][_0xf99b('0xc8')])){throw _0x2b7bf5[_0xf99b('0x1f')](0x1f4)[_0xf99b('0x2d')](new db['Sequelize'][(_0xf99b('0x99'))](_0xf99b('0xc9')+_0x3c71f9));}if(!_[_0xf99b('0xca')](_0x3c71f9,_0x2fe499['body'][_0xf99b('0xc8')])){throw _0x2b7bf5[_0xf99b('0x1f')](0x1f4)[_0xf99b('0x2d')](new db[(_0xf99b('0x98'))][(_0xf99b('0x99'))](_0xf99b('0xcb')+_0x3c71f9));}_0x15d43c[_0x2fe499[_0xf99b('0x6d')][_0xf99b('0xc8')]]=_0x2fe499['body'][_0xf99b('0x9f')];})[_0xf99b('0x15')](function(){return db[_0xf99b('0x53')]['find']({'where':{'id':_0x2fe499[_0xf99b('0x69')]['id']},'include':[{'model':db[_0xf99b('0xcc')],'as':_0xf99b('0xa3')},{'model':db[_0xf99b('0xcd')],'as':_0xf99b('0xcd')}]});})['then'](handleEntityNotFound(_0x2b7bf5,null))[_0xf99b('0x15')](function(_0x37a0c1){if(_0x37a0c1&&_0x37a0c1['List']){_0xa48254=_0x37a0c1;var _0xd49044=_[_0xf99b('0x10')](_0x2fe499[_0xf99b('0x6d')],{'firstName':_0x2fe499[_0xf99b('0x6d')][_0xf99b('0x9f')],'phone':_0x2fe499[_0xf99b('0x6d')][_0xf99b('0x9f')],'ListId':_0x37a0c1['ListId']});_0xd49044[_0x2fe499['body']['mapKeyOffline']]=_0x2fe499[_0xf99b('0x6d')][_0xf99b('0x9f')];return db[_0xf99b('0x97')][_0xf99b('0xce')]({'where':_0x15d43c,'defaults':_0xd49044});}})[_0xf99b('0xa9')](function(_0x3fd334){if(_0x3fd334){_0x2ef198=_0x3fd334;var _0x3c10f0=fs['readFileSync'](path[_0xf99b('0x87')](config[_0xf99b('0x88')],_0xf99b('0xcf')),_0xf99b('0xd0'));var _0x383781=ejs[_0xf99b('0xd1')](_0x3c10f0,{'body':_[_0xf99b('0xd2')](_0x2fe499[_0xf99b('0x6d')][_0xf99b('0x6d')]),'bodyTitle':_0xa48254['offlineMessageBody']});return db[_0xf99b('0xd3')]['create']({'body':_0x383781,'plainBody':htmlToText['fromString'](_0x383781),'ContactId':_0x3fd334['id'],'ChatWebsiteId':_0xa48254['id']});}})['then'](function(_0x49c4af){_0x4a5c8b=_0x49c4af;if(_0x3a31d1[_0xf99b('0x6b')]){var _0x14bd62=_0x3a31d1[_0xf99b('0x52')](function(_0x339c8c){return{'name':_0x339c8c[_0xf99b('0xd4')],'basename':_0x339c8c[_0xf99b('0x85')],'type':_0x339c8c['mimetype'],'ChatOfflineMessageId':_0x49c4af['id']};});_0x5928df=_0x14bd62[_0xf99b('0x52')](_0x356b13=>{var _0x10dc69={'filename':_0x356b13[_0xf99b('0x2c')],'path':path[_0xf99b('0x87')](config['root'],_0xf99b('0xd5'),_0xf99b('0xd6'),_0xf99b('0xd7'),_0xf99b('0xd8'),_0x356b13[_0xf99b('0xd9')])};return _0x10dc69;});if(!_0xa48254['openNewInteraction']){return db['sequelize'][_0xf99b('0xda')](function(_0x56a197){return db[_0xf99b('0xdb')][_0xf99b('0xdc')](_0x14bd62,{'transaction':_0x56a197});});}}})[_0xf99b('0x15')](function(){if(_0x4a5c8b){_0x44030a=_0x4a5c8b;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf99b('0xdd')],'as':_0xf99b('0xde'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}})[_0xf99b('0x15')](function(_0x52c462){if(_0x52c462&&_0x52c462[_0xf99b('0xde')]&&_0xa48254[_0xf99b('0xdf')]&&_0xa48254[_0xf99b('0xe0')]){var _0x2e1973=_0x52c462[_0xf99b('0xe1')]();return respondWithRpcPromise(_0xf99b('0xe2'),'sendMail',{'account':_0x2e1973,'message':{'from':util['format'](_0xf99b('0xe3'),_0x52c462[_0xf99b('0x2c')],_0x52c462[_0xf99b('0xe4')]||_0x52c462[_0xf99b('0xde')]['user']),'to':_0xa48254[_0xf99b('0xe0')],'subject':_0xa48254[_0xf99b('0xe5')],'html':_0x44030a['body'],'attachments':_0x5928df}},client9003)[_0xf99b('0x15')](function(){return _0x44030a;})['catch'](function(_0x3bd804){logger[_0xf99b('0x1b')](_0x3bd804);});}})[_0xf99b('0x15')](function(){if(_0xa48254&&_0xa48254['openNewInteraction']&&_0xa48254[_0xf99b('0xe6')]){var _0x38ac0a=[];if(_0x3a31d1['length']){_0x38ac0a=_0x3a31d1[_0xf99b('0x52')](function(_0x236afd){return{'name':_0x236afd[_0xf99b('0xd4')],'basename':_0x236afd['filename'],'type':_0x236afd[_0xf99b('0xe7')],'ChatOfflineMessageId':_0x4a5c8b['id']};});}var _0x5528ab;if(!_[_0xf99b('0x91')](_0xa48254['subjectOffline'])){var _0xf9a676=_['map'](_0x2fe499[_0xf99b('0x6d')],function(_0x525267){return _0x525267;});var _0x28d3e2=_['toPairsIn'](_0xf9a676)[0x0];var _0x17b4b9=_['mapValues'](_0x28d3e2,function(_0x46e8c3){return _0x46e8c3;});_0x5528ab=_0x17b4b9[0x1][_0xa48254[_0xf99b('0xe8')]];}var _0x506e06={'from':_0x2ef198[_0xf99b('0xe4')],'firstName':_0x2ef198[_0xf99b('0x45')],'lastName':_0x2ef198[_0xf99b('0x46')],'mapKey':_0xf99b('0xe4'),'message':{'from':_0x2ef198['email'],'to':_0xa48254['MailAccount']['email'],'cc':'','subject':_['isNil'](_0x5528ab)?_0xa48254[_0xf99b('0xe5')]:_0x5528ab,'messageId':'','sentAt':new Date(),'attach':_0x38ac0a['length'],'attachments':_0x38ac0a,'originChannel':'Chat','ChatWebsiteId':_0xa48254['id'],'ChatOfflineMessageId':_0x44030a['id'],'originTo':_0xa48254[_0xf99b('0xcd')][_0xf99b('0xe4')]},'body':_0x44030a[_0xf99b('0x6d')]};var _0x508342={'account':{'id':_0xa48254[_0xf99b('0xe6')]},'body':_0x506e06,'log':_0xf99b('0xe9')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x508342,client9001)[_0xf99b('0x15')](function(){return _0x44030a;})[_0xf99b('0x38')](function(_0x18c717){logger[_0xf99b('0x1b')](_0x18c717);});}return;})[_0xf99b('0x15')](function(){if(_0x44030a){return _0x44030a;}})[_0xf99b('0x15')](respondWithResult(_0x2b7bf5,null))[_0xf99b('0x38')](function(){for(var _0x7a29ec of _0x3a31d1){var _0xce5c21=path[_0xf99b('0x87')](config[_0xf99b('0x88')],'server','files',_0xf99b('0xd7'),_0xf99b('0xd8'),_0x7a29ec[_0xf99b('0x85')]);fs_extra[_0xf99b('0xea')](_0xce5c21)[_0xf99b('0x38')](function(_0x5bd490){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0xce5c21,_0x5bd490);});}});};exports[_0xf99b('0xeb')]=function(_0x29b9f8,_0x40b684){return db['ChatInteraction'][_0xf99b('0x70')]({'where':{'id':_0x29b9f8[_0xf99b('0x69')]['id']}})['then'](handleEntityNotFound(_0x40b684,null))['then'](function(_0x2a1b57){if(_0x2a1b57){return _0x2a1b57[_0xf99b('0xeb')](_0x29b9f8[_0xf99b('0x6d')]['ids'],_[_0xf99b('0xec')](_0x29b9f8[_0xf99b('0x6d')],['ids','id'])||{});}})[_0xf99b('0x15')](respondWithResult(_0x40b684,null))['catch'](handleError(_0x40b684,null));};exports[_0xf99b('0xed')]=function(_0x4584ad,_0x3b1128){var _0x5b6a6e={'raw':![],'where':{}};var _0x16d7ca={};var _0x84939b={'count':0x0,'rows':[]};return db[_0xf99b('0x53')][_0xf99b('0x7d')]({'where':{'id':_0x4584ad[_0xf99b('0x69')]['id']}})[_0xf99b('0x15')](handleEntityNotFound(_0x3b1128,null))[_0xf99b('0x15')](function(_0x1e3513){if(_0x1e3513){_0x16d7ca[_0xf99b('0x4d')]=_[_0xf99b('0x56')](db[_0xf99b('0xb2')]['rawAttributes']);_0x16d7ca['query']=_[_0xf99b('0x56')](_0x4584ad[_0xf99b('0x55')]);_0x16d7ca[_0xf99b('0x57')]=_['intersection'](_0x16d7ca[_0xf99b('0x4d')],_0x16d7ca[_0xf99b('0x55')]);_0x5b6a6e[_0xf99b('0x59')]=_[_0xf99b('0x58')](_0x16d7ca[_0xf99b('0x4d')],qs[_0xf99b('0x5a')](_0x4584ad[_0xf99b('0x55')]['fields']));_0x5b6a6e[_0xf99b('0x59')]=_0x5b6a6e[_0xf99b('0x59')][_0xf99b('0x6b')]?_0x5b6a6e[_0xf99b('0x59')]:_0x16d7ca[_0xf99b('0x4d')];if(!_0x4584ad['query'][_0xf99b('0x7e')]('nolimit')){_0x5b6a6e[_0xf99b('0x23')]=qs[_0xf99b('0x23')](_0x4584ad[_0xf99b('0x55')]['limit']);_0x5b6a6e['offset']=qs[_0xf99b('0x21')](_0x4584ad[_0xf99b('0x55')][_0xf99b('0x21')]);}_0x5b6a6e['order']=qs[_0xf99b('0x5d')](_0x4584ad[_0xf99b('0x55')][_0xf99b('0x5d')]);_0x5b6a6e[_0xf99b('0x5e')]=qs['filters'](_[_0xf99b('0x5f')](_0x4584ad[_0xf99b('0x55')],_0x16d7ca[_0xf99b('0x57')]));_0x5b6a6e[_0xf99b('0x5e')]['ChatWebsiteId']=_0x1e3513['id'];if(_0x4584ad[_0xf99b('0x55')][_0xf99b('0x62')]){_0x5b6a6e[_0xf99b('0x5e')]=_[_0xf99b('0x60')](_0x5b6a6e[_0xf99b('0x5e')],{'$or':_[_0xf99b('0x52')](_0x5b6a6e[_0xf99b('0x59')],function(_0x21f5ae){var _0x1e82d9={};_0x1e82d9[_0x21f5ae]={'$like':'%'+_0x4584ad['query'][_0xf99b('0x62')]+'%'};return _0x1e82d9;})});}_0x5b6a6e=_['merge']({},_0x5b6a6e,_0x4584ad[_0xf99b('0x63')]);return db[_0xf99b('0xb2')][_0xf99b('0x24')]({'where':_0x5b6a6e[_0xf99b('0x5e')]})[_0xf99b('0x15')](function(_0xdc9715){_0x84939b[_0xf99b('0x24')]=_0xdc9715;if(_0x4584ad[_0xf99b('0x55')]['includeAll']){_0x5b6a6e['include']=[{'model':db[_0xf99b('0x97')],'as':'Contact','required':![]},{'model':db[_0xf99b('0xee')],'as':_0xf99b('0xef'),'attributes':[_0xf99b('0x2c'),_0xf99b('0xf0'),_0xf99b('0xf1')],'required':![]},{'model':db[_0xf99b('0xf2')],'as':_0xf99b('0xf3'),'attributes':['id',_0xf99b('0x2c'),_0xf99b('0xf4')],'where':_0x4584ad[_0xf99b('0x55')][_0xf99b('0xf5')]?{'id':_0x4584ad[_0xf99b('0x55')]['tag']}:undefined,'required':_0x4584ad[_0xf99b('0x55')][_0xf99b('0xf5')]?!![]:![]}];}return db[_0xf99b('0xb2')][_0xf99b('0x66')](_0x5b6a6e);})[_0xf99b('0x15')](function(_0x5a1e33){_0x84939b[_0xf99b('0x67')]=_0x5a1e33;return _0x84939b;});}})[_0xf99b('0x15')](respondWithFilteredResult(_0x3b1128,_0x5b6a6e))[_0xf99b('0x38')](handleError(_0x3b1128,null));};exports['getSnippet']=function(_0x3c66de,_0x24ba2a){var _0x1f259c=0x0;var _0x5edb28=0x0;var _0x130f20=![];var _0x576355;var _0x3137df;return db[_0xf99b('0x53')][_0xf99b('0x70')]({'where':{'id':_0x3c66de[_0xf99b('0x69')]['id']},'include':[{'model':db[_0xf99b('0x3a')],'as':_0xf99b('0x3a'),'include':[{'model':db[_0xf99b('0x3a')],'as':_0xf99b('0x3b'),'attributes':['id',_0xf99b('0x32')]}]}]})[_0xf99b('0x15')](handleEntityNotFound(_0x24ba2a,null))['then'](function(_0x3b116c){if(_0x3b116c){_0x576355=_0x3b116c;return _0x3b116c[_0xf99b('0xf6')]({'raw':!![]});}})[_0xf99b('0x15')](function(_0x3de217){if(_0x576355){if(_0x3de217){_0x3137df=_0x3de217;}}return require(_0xf99b('0x89'))[_0xf99b('0x8a')]();})[_0xf99b('0x15')](function(_0x2c3ef4){if(_0x2c3ef4){_0x5edb28=_0x2c3ef4[_0xf99b('0xf7')];_0x130f20=_0x2c3ef4[_0xf99b('0xf8')];}})[_0xf99b('0x15')](function(){return db[_0xf99b('0xb2')]['count']({'where':{'closed':![]}});})[_0xf99b('0x15')](function(_0x250f05){_0x1f259c=_0x250f05;if(_0x5edb28&&_0x250f05>_0x5edb28){return db[_0xf99b('0xf9')]['findOne']({'where':{'id':0x1}})['then'](function(_0x21727d){if(_0x21727d){_0x21727d['increment']('chatLicenseExceeded');}});}})[_0xf99b('0x15')](function(){if(!_0x576355[_0xf99b('0x3a')]||!_0x576355['Interval']['Intervals'])return!![];return checkWebsiteIntervals(_0x576355);})[_0xf99b('0x15')](function(_0x4fa57e){var _0x443444=fs[_0xf99b('0xfa')](path[_0xf99b('0x87')](config[_0xf99b('0x88')],_0xf99b('0xfb')),_0xf99b('0xd0'));var _0x3c3d4c=new url['URL'](_0x576355['address'])[_0xf99b('0xfc')];var _0x259fcb=_0xf99b('0xfd');var _0x11b1ef=![];var _0x43d0e8={'chatVersion':_0x259fcb,'chatWebsiteAddressOrigin':_0x3c3d4c,'remote':_0x576355[_0xf99b('0xfe')],'query':querystring[_0xf99b('0x1a')](_[_0xf99b('0x60')](_0x576355[_0xf99b('0x27')]({'plain':!![]}),{'customerIp':_0x3c66de[_0xf99b('0xb0')][_0xf99b('0x43')]||_0x3c66de[_0xf99b('0xb0')][_0xf99b('0xff')]||_0x3c66de[_0xf99b('0x100')][_0xf99b('0x101')]||_0x3c66de['ip'],'referer':_0x3c66de[_0xf99b('0xb0')][_0xf99b('0x102')],'openedInteractions':_0x1f259c,'maxInteractions':_0x5edb28,'virtual':_0x130f20['virtual'],'online':_0x4fa57e,'custom':_0x130f20}))[_0xf99b('0x103')](/'/g,'\x5c\x27')};_0x24ba2a[_0xf99b('0x2d')](ejs[_0xf99b('0xd1')](Mustache[_0xf99b('0xd1')](_0x443444,_0x43d0e8),{'proactiveActions':_0x3137df,'alignment':_0x576355[_0xf99b('0x104')],'verticalAlignment':_0x576355[_0xf99b('0x105')],'div_color':_0x576355[_0xf99b('0xf4')],'labelText':_0x576355['labelText'],'text_color':_0x576355['textColor'],'text_button_color':_0x576355[_0xf99b('0x106')],'button_color':_0x576355[_0xf99b('0x107')],'background_color':_0x576355[_0xf99b('0x108')],'hideWhenOffline':_0x576355[_0xf99b('0x109')],'intervalId':_0x576355[_0xf99b('0x10a')],'isDevelopment':_0x11b1ef,'chatVersion':_0x259fcb}));})[_0xf99b('0x38')](handleError(_0x24ba2a,null));};exports['addApplications']=function(_0xfadaf3,_0x1a5a42){var _0xdd345a=_0xfadaf3['params']['id'];var _0x4fb5cf=_0xfadaf3[_0xf99b('0x6d')];var _0x227d59=0xc8;var _0x55d8a3=null;return db['sequelize'][_0xf99b('0xda')]({'isolationLevel':db[_0xf99b('0x10b')]['Transaction'][_0xf99b('0x10c')][_0xf99b('0x10d')]},function(_0x534055){return db[_0xf99b('0x53')][_0xf99b('0x7d')]({'where':{'id':_0xdd345a},'transaction':_0x534055})[_0xf99b('0x15')](function(_0x21c160){if(_0x21c160){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0xdd345a},'transaction':_0x534055})[_0xf99b('0x15')](function(){var _0x211d3c=_[_0xf99b('0x52')](_0x4fb5cf,function(_0x1512cf){_0x1512cf[_0xf99b('0x75')]=_0xdd345a;return _0x1512cf;});return db[_0xf99b('0xa6')][_0xf99b('0xdc')](_0x211d3c,{'transaction':_0x534055});});}else{_0x227d59=0x194;_0x55d8a3=[];}});})['then'](function(){if(_0x227d59!==0x194){return db['ChatApplication'][_0xf99b('0x10e')]({'where':{'ChatWebsiteId':_0xdd345a},'order':_0xf99b('0xac')})[_0xf99b('0x15')](function(_0x2e5c0b){_0x55d8a3=_0x2e5c0b;});}})[_0xf99b('0x38')](function(_0x50dc9f){_0x227d59=0x1f4;logger[_0xf99b('0x1b')](_0x50dc9f[_0xf99b('0x2b')]);if(_0x50dc9f['name']){delete _0x50dc9f[_0xf99b('0x2c')];}_0x55d8a3=_0x50dc9f;})[_0xf99b('0x10f')](function(){if(_0x55d8a3===null){_0x1a5a42[_0xf99b('0x1e')](_0x227d59);}else{if(_0x227d59===0x1f4){_0x1a5a42['status'](_0x227d59)[_0xf99b('0x2d')](_0x55d8a3);}else{_0x1a5a42['status'](_0x227d59)[_0xf99b('0x20')](_0x55d8a3);}}});};exports[_0xf99b('0x110')]=function(_0x545d19,_0x5df697){var _0x40341f={};var _0x27d3f2={};var _0x39f3e8;var _0x20f942;return db[_0xf99b('0x53')]['findOne']({'where':{'id':_0x545d19[_0xf99b('0x69')]['id']}})[_0xf99b('0x15')](handleEntityNotFound(_0x5df697,null))[_0xf99b('0x15')](function(_0x58306a){if(_0x58306a){_0x39f3e8=_0x58306a;_0x27d3f2['model']=_['keys'](db[_0xf99b('0xa6')][_0xf99b('0x54')]);_0x27d3f2[_0xf99b('0x55')]=_[_0xf99b('0x56')](_0x545d19[_0xf99b('0x55')]);_0x27d3f2[_0xf99b('0x57')]=_['intersection'](_0x27d3f2['model'],_0x27d3f2[_0xf99b('0x55')]);_0x40341f['attributes']=_[_0xf99b('0x58')](_0x27d3f2[_0xf99b('0x4d')],qs[_0xf99b('0x5a')](_0x545d19[_0xf99b('0x55')][_0xf99b('0x5a')]));_0x40341f[_0xf99b('0x59')]=_0x40341f['attributes']['length']?_0x40341f[_0xf99b('0x59')]:_0x27d3f2[_0xf99b('0x4d')];_0x40341f['order']=qs[_0xf99b('0x5d')](_0x545d19['query'][_0xf99b('0x5d')]);_0x40341f[_0xf99b('0x5e')]=qs[_0xf99b('0x57')](_[_0xf99b('0x5f')](_0x545d19[_0xf99b('0x55')],_0x27d3f2['filters']));if(_0x545d19[_0xf99b('0x55')][_0xf99b('0x62')]){_0x40341f[_0xf99b('0x5e')]=_[_0xf99b('0x60')](_0x40341f[_0xf99b('0x5e')],{'$or':_['map'](_0x40341f[_0xf99b('0x59')],function(_0x38cf11){var _0x4f5654={};_0x4f5654[_0x38cf11]={'$like':'%'+_0x545d19['query']['filter']+'%'};return _0x4f5654;})});}_0x40341f=_[_0xf99b('0x60')]({},_0x40341f,_0x545d19['options']);return _0x39f3e8[_0xf99b('0x110')](_0x40341f);}})[_0xf99b('0x15')](function(_0x584c02){if(_0x584c02){_0x20f942=_0x584c02[_0xf99b('0x6b')];if(!_0x545d19[_0xf99b('0x55')][_0xf99b('0x7e')](_0xf99b('0x5b'))){_0x40341f[_0xf99b('0x23')]=qs['limit'](_0x545d19['query'][_0xf99b('0x23')]);_0x40341f[_0xf99b('0x21')]=qs[_0xf99b('0x21')](_0x545d19[_0xf99b('0x55')]['offset']);}return _0x39f3e8[_0xf99b('0x110')](_0x40341f);}})[_0xf99b('0x15')](function(_0x5c30e3){if(_0x5c30e3){return _0x5c30e3?{'count':_0x20f942,'rows':_0x5c30e3}:null;}})[_0xf99b('0x15')](respondWithResult(_0x5df697,null))[_0xf99b('0x38')](handleError(_0x5df697,null));};exports[_0xf99b('0x111')]=function(_0x91175c,_0x47bfa1){return db[_0xf99b('0x112')][_0xf99b('0x70')]({'where':{'id':_0x91175c['params']['id']}})['then'](handleEntityNotFound(_0x47bfa1,null))[_0xf99b('0x15')](function(_0x3d1d4a){if(_0x3d1d4a){return _0x3d1d4a['addProactiveActions'](_0x91175c[_0xf99b('0x6d')][_0xf99b('0x79')],_[_0xf99b('0xec')](_0x91175c[_0xf99b('0x6d')],[_0xf99b('0x79'),'id'])||{});}})[_0xf99b('0x15')](respondWithResult(_0x47bfa1,null))[_0xf99b('0x38')](handleError(_0x47bfa1,null));};exports['getProactiveActions']=function(_0x3e7fac,_0x37224c){var _0x2e1f40={};var _0xbbdd1c={};var _0x351121;var _0xcacc12;return db[_0xf99b('0x53')]['findOne']({'where':{'id':_0x3e7fac[_0xf99b('0x69')]['id']}})['then'](handleEntityNotFound(_0x37224c,null))[_0xf99b('0x15')](function(_0xfae04c){if(_0xfae04c){_0x351121=_0xfae04c;_0xbbdd1c[_0xf99b('0x4d')]=_['keys'](db['ChatProactiveAction'][_0xf99b('0x54')]);_0xbbdd1c['query']=_[_0xf99b('0x56')](_0x3e7fac[_0xf99b('0x55')]);_0xbbdd1c['filters']=_[_0xf99b('0x58')](_0xbbdd1c[_0xf99b('0x4d')],_0xbbdd1c[_0xf99b('0x55')]);_0x2e1f40[_0xf99b('0x59')]=_[_0xf99b('0x58')](_0xbbdd1c['model'],qs[_0xf99b('0x5a')](_0x3e7fac[_0xf99b('0x55')][_0xf99b('0x5a')]));_0x2e1f40['attributes']=_0x2e1f40[_0xf99b('0x59')][_0xf99b('0x6b')]?_0x2e1f40[_0xf99b('0x59')]:_0xbbdd1c['model'];_0x2e1f40[_0xf99b('0x5c')]=qs[_0xf99b('0x5d')](_0x3e7fac[_0xf99b('0x55')]['sort']);_0x2e1f40['where']=qs['filters'](_[_0xf99b('0x5f')](_0x3e7fac[_0xf99b('0x55')],_0xbbdd1c[_0xf99b('0x57')]));if(_0x3e7fac[_0xf99b('0x55')][_0xf99b('0x62')]){_0x2e1f40[_0xf99b('0x5e')]=_['merge'](_0x2e1f40[_0xf99b('0x5e')],{'$or':_[_0xf99b('0x52')](_0x2e1f40[_0xf99b('0x59')],function(_0x1a7e65){var _0x4c878c={};_0x4c878c[_0x1a7e65]={'$like':'%'+_0x3e7fac['query'][_0xf99b('0x62')]+'%'};return _0x4c878c;})});}_0x2e1f40=_['merge']({},_0x2e1f40,_0x3e7fac[_0xf99b('0x63')]);return _0x351121[_0xf99b('0xf6')](_0x2e1f40);}})[_0xf99b('0x15')](function(_0x475241){if(_0x475241){_0xcacc12=_0x475241[_0xf99b('0x6b')];if(!_0x3e7fac[_0xf99b('0x55')][_0xf99b('0x7e')](_0xf99b('0x5b'))){_0x2e1f40['limit']=qs[_0xf99b('0x23')](_0x3e7fac[_0xf99b('0x55')][_0xf99b('0x23')]);_0x2e1f40[_0xf99b('0x21')]=qs[_0xf99b('0x21')](_0x3e7fac[_0xf99b('0x55')][_0xf99b('0x21')]);}return _0x351121[_0xf99b('0xf6')](_0x2e1f40);}})['then'](function(_0x55319e){if(_0x55319e){return _0x55319e?{'count':_0xcacc12,'rows':_0x55319e}:null;}})['then'](respondWithResult(_0x37224c,null))[_0xf99b('0x38')](handleError(_0x37224c,null));};exports[_0xf99b('0x113')]=function(_0x5554c8,_0x1b5dce){var _0x2c154f=_0x5554c8['query'][_0xf99b('0x114')]===_0xf99b('0x115')?_0xf99b('0x116'):_0xf99b('0x117');return db[_0xf99b('0x53')][_0xf99b('0x70')]({'attributes':['id',_0x2c154f],'where':{'id':_0x5554c8[_0xf99b('0x69')]['id']}})['then'](handleEntityNotFound(_0x1b5dce,null))['then'](function(_0x25b88f){if(_0x25b88f){var _0x363574=_0x25b88f[_0x2c154f];var _0x4e7915=_0x363574&&_0x363574[_0xf99b('0x118')]?_0x363574[_0xf99b('0x118')]:[];_0x1b5dce[_0xf99b('0x2d')]({'fromKey':_['isNil'](_0x363574[_0xf99b('0x119')])?undefined:_0x363574[_0xf99b('0x119')],'count':_0x4e7915[_0xf99b('0x6b')],'rows':_0x4e7915});}})[_0xf99b('0x38')](handleError(_0x1b5dce,null));};exports['getOfflineMessages']=function(_0x115e4c,_0x166346){var _0x144622={'raw':![],'where':{}};var _0x2f0300={};var _0xcaa87f={'count':0x0,'rows':[]};return db[_0xf99b('0x53')][_0xf99b('0x7d')]({'where':{'id':_0x115e4c[_0xf99b('0x69')]['id']}})[_0xf99b('0x15')](handleEntityNotFound(_0x166346,null))[_0xf99b('0x15')](function(_0xc1908b){if(_0xc1908b){_0x2f0300[_0xf99b('0x4d')]=_[_0xf99b('0x56')](db[_0xf99b('0xd3')][_0xf99b('0x54')]);_0x2f0300['query']=_[_0xf99b('0x56')](_0x115e4c[_0xf99b('0x55')]);_0x2f0300[_0xf99b('0x57')]=_['intersection'](_0x2f0300[_0xf99b('0x4d')],_0x2f0300[_0xf99b('0x55')]);_0x144622[_0xf99b('0x59')]=_[_0xf99b('0x58')](_0x2f0300[_0xf99b('0x4d')],qs['fields'](_0x115e4c['query'][_0xf99b('0x5a')]));_0x144622[_0xf99b('0x59')]=_0x144622[_0xf99b('0x59')]['length']?_0x144622[_0xf99b('0x59')]:_0x2f0300[_0xf99b('0x4d')];if(!_0x115e4c['query'][_0xf99b('0x7e')](_0xf99b('0x5b'))){_0x144622[_0xf99b('0x23')]=qs[_0xf99b('0x23')](_0x115e4c[_0xf99b('0x55')][_0xf99b('0x23')]);_0x144622[_0xf99b('0x21')]=qs['offset'](_0x115e4c[_0xf99b('0x55')][_0xf99b('0x21')]);}_0x144622[_0xf99b('0x5c')]=qs['sort'](_0x115e4c['query'][_0xf99b('0x5d')]);_0x144622[_0xf99b('0x5e')]=qs[_0xf99b('0x57')](_['pick'](_0x115e4c['query'],_0x2f0300[_0xf99b('0x57')]));_0x144622[_0xf99b('0x5e')]['ChatWebsiteId']=_0xc1908b['id'];if(_0x115e4c[_0xf99b('0x55')][_0xf99b('0x62')]){_0x144622[_0xf99b('0x5e')]=_[_0xf99b('0x60')](_0x144622[_0xf99b('0x5e')],{'$or':_['map'](_0x144622[_0xf99b('0x59')],function(_0x47316d){var _0x4c7b0b={};_0x4c7b0b[_0x47316d]={'$like':'%'+_0x115e4c[_0xf99b('0x55')][_0xf99b('0x62')]+'%'};return _0x4c7b0b;})});}_0x144622=_[_0xf99b('0x60')]({},_0x144622,_0x115e4c[_0xf99b('0x63')]);return db[_0xf99b('0xd3')][_0xf99b('0x24')]({'where':_0x144622[_0xf99b('0x5e')]})[_0xf99b('0x15')](function(_0x1eb17d){_0xcaa87f[_0xf99b('0x24')]=_0x1eb17d;if(_0x115e4c['query'][_0xf99b('0x64')]){_0x144622['include']=[{'all':!![]}];}else{_0x144622[_0xf99b('0x65')]=[{'model':db[_0xf99b('0x97')],'as':_0xf99b('0x11a'),'required':![]},{'model':db[_0xf99b('0xdb')],'as':_0xf99b('0x11b'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x144622);})[_0xf99b('0x15')](function(_0x57d480){_0xcaa87f['rows']=_0x57d480;return _0xcaa87f;});}})[_0xf99b('0x15')](respondWithFilteredResult(_0x166346,_0x144622))[_0xf99b('0x38')](handleError(_0x166346,null));};exports[_0xf99b('0x11c')]=function(_0x507696,_0x1ebdab){return db[_0xf99b('0x53')]['find']({'where':{'id':_0x507696['params']['id']}})[_0xf99b('0x15')](handleEntityNotFound(_0x1ebdab,null))[_0xf99b('0x15')](function(_0x4a96fc){if(_0x4a96fc){return _0x4a96fc[_0xf99b('0x11c')](_0x507696[_0xf99b('0x6d')][_0xf99b('0x79')],_['omit'](_0x507696[_0xf99b('0x6d')],[_0xf99b('0x79'),'id'])||{})[_0xf99b('0xa9')](function(_0x55c0f4){for(var _0x3095fc=0x0;_0x3095fc<_0x507696[_0xf99b('0x6d')][_0xf99b('0x79')][_0xf99b('0x6b')];_0x3095fc+=0x1){socket[_0xf99b('0x11d')](_0xf99b('0x11e'),{'UserId':Number(_0x507696['body'][_0xf99b('0x79')][_0x3095fc]),'ChatWebsiteId':Number(_0x507696[_0xf99b('0x69')]['id'])});}return _0x55c0f4;});}})[_0xf99b('0x15')](respondWithResult(_0x1ebdab,null))[_0xf99b('0x38')](handleError(_0x1ebdab,null));};exports['removeAgents']=function(_0x4bb977,_0x2798ac){return db[_0xf99b('0x53')][_0xf99b('0x70')]({'where':{'id':_0x4bb977[_0xf99b('0x69')]['id']}})[_0xf99b('0x15')](handleEntityNotFound(_0x2798ac,null))[_0xf99b('0x15')](function(_0x22c5e6){if(_0x22c5e6){return _0x22c5e6[_0xf99b('0x11f')](_0x4bb977['query'][_0xf99b('0x79')])[_0xf99b('0x15')](function(){if(_['isArray'](_0x4bb977['query'][_0xf99b('0x79')])){for(var _0x194b03=0x0;_0x194b03<_0x4bb977[_0xf99b('0x55')][_0xf99b('0x79')][_0xf99b('0x6b')];_0x194b03+=0x1){socket[_0xf99b('0x11d')](_0xf99b('0x120'),{'UserId':Number(_0x4bb977['query'][_0xf99b('0x79')][_0x194b03]),'ChatWebsiteId':Number(_0x4bb977[_0xf99b('0x69')]['id'])});}}else{socket[_0xf99b('0x11d')](_0xf99b('0x120'),{'UserId':Number(_0x4bb977['query'][_0xf99b('0x79')]),'ChatWebsiteId':Number(_0x4bb977[_0xf99b('0x69')]['id'])});}});}})[_0xf99b('0x15')](respondWithStatusCode(_0x2798ac,null))[_0xf99b('0x38')](handleError(_0x2798ac,null));};exports[_0xf99b('0x121')]=function(_0x3a0058,_0x444057){var _0xaf3f39={};var _0x16aa1e={};var _0x3fa666;var _0x4970ce;return db[_0xf99b('0x53')][_0xf99b('0x7d')]({'where':{'id':_0x3a0058[_0xf99b('0x69')]['id']}})[_0xf99b('0x15')](handleEntityNotFound(_0x444057,null))[_0xf99b('0x15')](function(_0x855588){if(_0x855588){_0x3fa666=_0x855588;_0x16aa1e[_0xf99b('0x4d')]=_[_0xf99b('0x56')](db[_0xf99b('0xee')][_0xf99b('0x54')]);_0x16aa1e[_0xf99b('0x55')]=_['keys'](_0x3a0058[_0xf99b('0x55')]);_0x16aa1e['filters']=_['intersection'](_0x16aa1e[_0xf99b('0x4d')],_0x16aa1e[_0xf99b('0x55')]);_0xaf3f39[_0xf99b('0x59')]=_[_0xf99b('0x58')](_0x16aa1e['model'],qs[_0xf99b('0x5a')](_0x3a0058[_0xf99b('0x55')]['fields']));_0xaf3f39[_0xf99b('0x59')]=_0xaf3f39['attributes'][_0xf99b('0x6b')]?_0xaf3f39[_0xf99b('0x59')]:_0x16aa1e['model'];_0xaf3f39[_0xf99b('0x5c')]=qs[_0xf99b('0x5d')](_0x3a0058[_0xf99b('0x55')][_0xf99b('0x5d')]);_0xaf3f39[_0xf99b('0x5e')]=qs[_0xf99b('0x57')](_['pick'](_0x3a0058[_0xf99b('0x55')],_0x16aa1e[_0xf99b('0x57')]));if(_0x3a0058[_0xf99b('0x55')][_0xf99b('0x62')]){_0xaf3f39[_0xf99b('0x5e')]=_[_0xf99b('0x60')](_0xaf3f39[_0xf99b('0x5e')],{'$or':_[_0xf99b('0x52')](_0xaf3f39['attributes'],function(_0x1ba814){var _0x459ce1={};_0x459ce1[_0x1ba814]={'$like':'%'+_0x3a0058[_0xf99b('0x55')][_0xf99b('0x62')]+'%'};return _0x459ce1;})});}_0xaf3f39=_[_0xf99b('0x60')]({},_0xaf3f39,_0x3a0058['options']);return _0x3fa666[_0xf99b('0x121')](_0xaf3f39);}})['then'](function(_0x8aa349){if(_0x8aa349){_0x4970ce=_0x8aa349[_0xf99b('0x6b')];if(!_0x3a0058[_0xf99b('0x55')][_0xf99b('0x7e')](_0xf99b('0x5b'))){_0xaf3f39[_0xf99b('0x23')]=qs['limit'](_0x3a0058['query']['limit']);_0xaf3f39[_0xf99b('0x21')]=qs['offset'](_0x3a0058[_0xf99b('0x55')][_0xf99b('0x21')]);}return _0x3fa666[_0xf99b('0x121')](_0xaf3f39);}})['then'](function(_0x9ca7c5){if(_0x9ca7c5){return _0x9ca7c5?{'count':_0x4970ce,'rows':_0x9ca7c5}:null;}})[_0xf99b('0x15')](respondWithResult(_0x444057,null))['catch'](handleError(_0x444057,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 40c11cb..c5362be 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 _0xee39=['events','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3e0f82,_0x3e431b){var _0x3723e3=function(_0x9b827a){while(--_0x9b827a){_0x3e0f82['push'](_0x3e0f82['shift']());}};_0x3723e3(++_0x3e431b);}(_0xee39,0x1e6));var _0x9ee3=function(_0x78ca23,_0x43c558){_0x78ca23=_0x78ca23-0x0;var _0x184831=_0xee39[_0x78ca23];return _0x184831;};'use strict';var EventEmitter=require(_0x9ee3('0x0'));var ChatWebsite=require(_0x9ee3('0x1'))['db'][_0x9ee3('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9ee3('0x3'),'afterUpdate':_0x9ee3('0x4'),'afterDestroy':_0x9ee3('0x5')};function emitEvent(_0x3cdeaf){return function(_0x2724c7,_0x3a556a,_0x3398c6){ChatWebsiteEvents[_0x9ee3('0x6')](_0x3cdeaf+':'+_0x2724c7['id'],_0x2724c7);ChatWebsiteEvents[_0x9ee3('0x6')](_0x3cdeaf,_0x2724c7);_0x3398c6(null);};}for(var e in events){if(events[_0x9ee3('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x9ee3('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x81bd=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update'];(function(_0x2c9e54,_0x178247){var _0x25d074=function(_0x14e87e){while(--_0x14e87e){_0x2c9e54['push'](_0x2c9e54['shift']());}};_0x25d074(++_0x178247);}(_0x81bd,0x7c));var _0xd81b=function(_0x9861ff,_0x41fb17){_0x9861ff=_0x9861ff-0x0;var _0x48852b=_0x81bd[_0x9861ff];return _0x48852b;};'use strict';var EventEmitter=require(_0xd81b('0x0'));var ChatWebsite=require(_0xd81b('0x1'))['db'][_0xd81b('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd81b('0x3')](0x0);var events={'afterCreate':_0xd81b('0x4'),'afterUpdate':_0xd81b('0x5'),'afterDestroy':_0xd81b('0x6')};function emitEvent(_0x54e096){return function(_0x16e8de,_0x2c3d9e,_0x1b6cfe){ChatWebsiteEvents['emit'](_0x54e096+':'+_0x16e8de['id'],_0x16e8de);ChatWebsiteEvents[_0xd81b('0x7')](_0x54e096,_0x16e8de);_0x1b6cfe(null);};}for(var e in events){if(events[_0xd81b('0x8')](e)){var event=events[e];ChatWebsite[_0xd81b('0x9')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index f5eb388..ec052f9 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 _0x0f31=['api','moment','bluebird','request-promise','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x3c59b7,_0x242aba){var _0x1a5e0=function(_0x32fc7f){while(--_0x32fc7f){_0x3c59b7['push'](_0x3c59b7['shift']());}};_0x1a5e0(++_0x242aba);}(_0x0f31,0x1cb));var _0x10f3=function(_0x4650fa,_0x32b710){_0x4650fa=_0x4650fa-0x0;var _0x196825=_0x0f31[_0x4650fa];return _0x196825;};'use strict';var _=require(_0x10f3('0x0'));var util=require(_0x10f3('0x1'));var logger=require(_0x10f3('0x2'))(_0x10f3('0x3'));var moment=require(_0x10f3('0x4'));var BPromise=require(_0x10f3('0x5'));var rp=require(_0x10f3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x10f3('0x7'));module[_0x10f3('0x8')]=function(_0x24e094,_0x165b1b){return _0x24e094['define'](_0x10f3('0x9'),attributes,{'tableName':_0x10f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6309=['../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','path','rimraf'];(function(_0x9ca828,_0x47a7d9){var _0x223f00=function(_0x4b7e4f){while(--_0x4b7e4f){_0x9ca828['push'](_0x9ca828['shift']());}};_0x223f00(++_0x47a7d9);}(_0x6309,0xe1));var _0x9630=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0x6309[_0x41d432];return _0x1650f9;};'use strict';var _=require(_0x9630('0x0'));var util=require(_0x9630('0x1'));var logger=require(_0x9630('0x2'))(_0x9630('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9630('0x4'));var rimraf=require(_0x9630('0x5'));var config=require(_0x9630('0x6'));var attributes=require(_0x9630('0x7'));module[_0x9630('0x8')]=function(_0x465e69,_0x109115){return _0x465e69['define'](_0x9630('0x9'),attributes,{'tableName':_0x9630('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 69556bd..7310269 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 _0x86ee=['localhost','./chatWebsite.socket','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis'];(function(_0x4c639c,_0x2e1398){var _0x3c15b6=function(_0x116d9f){while(--_0x116d9f){_0x4c639c['push'](_0x4c639c['shift']());}};_0x3c15b6(++_0x2e1398);}(_0x86ee,0x66));var _0xe86e=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0x86ee[_0x1e4a8e];return _0x5408f9;};'use strict';var _=require(_0xe86e('0x0'));var util=require(_0xe86e('0x1'));var moment=require(_0xe86e('0x2'));var BPromise=require(_0xe86e('0x3'));var rs=require(_0xe86e('0x4'));var fs=require('fs');var Redis=require(_0xe86e('0x5'));var db=require(_0xe86e('0x6'))['db'];var utils=require(_0xe86e('0x7'));var logger=require(_0xe86e('0x8'))('rpc');var config=require(_0xe86e('0x9'));var jayson=require(_0xe86e('0xa'));var client=jayson[_0xe86e('0xb')]['http']({'port':0x232a});config[_0xe86e('0xc')]=_['defaults'](config[_0xe86e('0xc')],{'host':_0xe86e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe86e('0xc')]));require(_0xe86e('0xe'))['register'](socket);function respondWithRpcPromise(_0x558975,_0x1349aa,_0x5deaae){return new BPromise(function(_0xcb0890,_0x1e5a4a){return client['request'](_0x558975,_0x5deaae)['then'](function(_0x267ff8){logger[_0xe86e('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x1349aa,_0xe86e('0x10'));logger['debug'](_0xe86e('0x11'),_0x1349aa,'request\x20sent',JSON[_0xe86e('0x12')](_0x267ff8));if(_0x267ff8[_0xe86e('0x13')]){if(_0x267ff8[_0xe86e('0x13')][_0xe86e('0x14')]===0x1f4){logger[_0xe86e('0x13')](_0xe86e('0x15'),_0x1349aa,_0x267ff8[_0xe86e('0x13')][_0xe86e('0x16')]);return _0x1e5a4a(_0x267ff8[_0xe86e('0x13')][_0xe86e('0x16')]);}logger[_0xe86e('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x1349aa,_0x267ff8[_0xe86e('0x13')]['message']);return _0xcb0890(_0x267ff8[_0xe86e('0x13')][_0xe86e('0x16')]);}else{logger[_0xe86e('0xf')](_0xe86e('0x15'),_0x1349aa,_0xe86e('0x10'));_0xcb0890(_0x267ff8['result'][_0xe86e('0x16')]);}})['catch'](function(_0x331016){logger['error'](_0xe86e('0x15'),_0x1349aa,_0x331016);_0x1e5a4a(_0x331016);});});} \ No newline at end of file +var _0x7de8=['error','code','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0x7de8,0x18b));var _0x87de=function(_0x5a2889,_0x7e409a){_0x5a2889=_0x5a2889-0x0;var _0x5dd616=_0x7de8[_0x5a2889];return _0x5dd616;};'use strict';var _=require(_0x87de('0x0'));var util=require('util');var moment=require(_0x87de('0x1'));var BPromise=require(_0x87de('0x2'));var rs=require(_0x87de('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87de('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x87de('0x5'))('rpc');var config=require(_0x87de('0x6'));var jayson=require(_0x87de('0x7'));var client=jayson[_0x87de('0x8')]['http']({'port':0x232a});config[_0x87de('0x9')]=_[_0x87de('0xa')](config['redis'],{'host':_0x87de('0xb'),'port':0x18eb});var socket=require(_0x87de('0xc'))(new Redis(config[_0x87de('0x9')]));require(_0x87de('0xd'))[_0x87de('0xe')](socket);function respondWithRpcPromise(_0xfb2d08,_0xbf0c71,_0x4d15bb){return new BPromise(function(_0x231c93,_0x55efab){return client[_0x87de('0xf')](_0xfb2d08,_0x4d15bb)[_0x87de('0x10')](function(_0x3d6b27){logger[_0x87de('0x11')]('ChatWebsite,\x20%s,\x20%s',_0xbf0c71,_0x87de('0x12'));logger[_0x87de('0x13')](_0x87de('0x14'),_0xbf0c71,_0x87de('0x12'),JSON['stringify'](_0x3d6b27));if(_0x3d6b27[_0x87de('0x15')]){if(_0x3d6b27[_0x87de('0x15')][_0x87de('0x16')]===0x1f4){logger[_0x87de('0x15')](_0x87de('0x17'),_0xbf0c71,_0x3d6b27[_0x87de('0x15')]['message']);return _0x55efab(_0x3d6b27[_0x87de('0x15')]['message']);}logger[_0x87de('0x15')](_0x87de('0x17'),_0xbf0c71,_0x3d6b27['error']['message']);return _0x231c93(_0x3d6b27[_0x87de('0x15')]['message']);}else{logger[_0x87de('0x11')](_0x87de('0x17'),_0xbf0c71,_0x87de('0x12'));_0x231c93(_0x3d6b27[_0x87de('0x18')]['message']);}})[_0x87de('0x19')](function(_0x402deb){logger[_0x87de('0x15')](_0x87de('0x17'),_0xbf0c71,_0x402deb);_0x55efab(_0x402deb);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 3e0c329..c470734 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 _0xa278=['chatWebsite:','save','remove','update','removeListener','register','length'];(function(_0x324f7f,_0x34504f){var _0x56e96d=function(_0x37d6bb){while(--_0x37d6bb){_0x324f7f['push'](_0x324f7f['shift']());}};_0x56e96d(++_0x34504f);}(_0xa278,0xda));var _0x8a27=function(_0x29f31c,_0x46bbdf){_0x29f31c=_0x29f31c-0x0;var _0x3b6b8a=_0xa278[_0x29f31c];return _0x3b6b8a;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x8a27('0x0'),_0x8a27('0x1'),_0x8a27('0x2')];function createListener(_0x4d195b,_0x126800){return function(_0x5b7197){_0x126800['emit'](_0x4d195b,_0x5b7197);};}function removeListener(_0x4138a6,_0x31b896){return function(){ChatWebsiteEvents[_0x8a27('0x3')](_0x4138a6,_0x31b896);};}exports[_0x8a27('0x4')]=function(_0x136e13){for(var _0xe0b746=0x0,_0x22969c=events[_0x8a27('0x5')];_0xe0b746<_0x22969c;_0xe0b746++){var _0x50dacb=events[_0xe0b746];var _0x268289=createListener(_0x8a27('0x6')+_0x50dacb,_0x136e13);ChatWebsiteEvents['on'](_0x50dacb,_0x268289);}}; \ No newline at end of file +var _0x07d0=['chatWebsite:','./chatWebsite.events','save','remove','update','emit','register','length'];(function(_0x31a6b1,_0x7c3be1){var _0x8c77f5=function(_0x35b0d7){while(--_0x35b0d7){_0x31a6b1['push'](_0x31a6b1['shift']());}};_0x8c77f5(++_0x7c3be1);}(_0x07d0,0xa1));var _0x007d=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x07d0[_0x4792c8];return _0x35edb1;};'use strict';var ChatWebsiteEvents=require(_0x007d('0x0'));var events=[_0x007d('0x1'),_0x007d('0x2'),_0x007d('0x3')];function createListener(_0xe1ade7,_0x325bf7){return function(_0x1d97f7){_0x325bf7[_0x007d('0x4')](_0xe1ade7,_0x1d97f7);};}function removeListener(_0x28ec9c,_0x343b9c){return function(){ChatWebsiteEvents['removeListener'](_0x28ec9c,_0x343b9c);};}exports[_0x007d('0x5')]=function(_0x2d1fa5){for(var _0x592c7b=0x0,_0x5477ab=events[_0x007d('0x6')];_0x592c7b<_0x5477ab;_0x592c7b++){var _0x5c84e4=events[_0x592c7b];var _0x87f4b=createListener(_0x007d('0x7')+_0x5c84e4,_0x2d1fa5);ChatWebsiteEvents['on'](_0x5c84e4,_0x87f4b);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 43c62b2..d7c1d65 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 _0xf95b=['getOfflineMessages','/:id/users','create','addDisposition','post','addAnswer','diskStorage','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','join','root','server/files/images/avatars/','/:id/avatar','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','extname','offline','addInteraction','/:id/applications','addApplications','addAgents','put','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/fields','getFields'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf95b,0x1d8));var _0xbf95=function(_0x3e75a1,_0x47051b){_0x3e75a1=_0x3e75a1-0x0;var _0x456c32=_0xf95b[_0x3e75a1];return _0x456c32;};'use strict';var multer=require('multer');var util=require(_0xbf95('0x0'));var path=require(_0xbf95('0x1'));var timeout=require(_0xbf95('0x2'));var express=require(_0xbf95('0x3'));var router=express[_0xbf95('0x4')]();var fs_extra=require(_0xbf95('0x5'));var auth=require(_0xbf95('0x6'));var interaction=require(_0xbf95('0x7'));var config=require(_0xbf95('0x8'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0xbf95('0x9')](),controller[_0xbf95('0xa')]);router[_0xbf95('0xb')](_0xbf95('0xc'),auth[_0xbf95('0x9')](),controller[_0xbf95('0xd')]);router['get'](_0xbf95('0xe'),auth['isAuthenticated'](),controller[_0xbf95('0xf')]);router['get'](_0xbf95('0x10'),auth[_0xbf95('0x9')](),controller['getDispositions']);router[_0xbf95('0xb')](_0xbf95('0x11'),auth[_0xbf95('0x9')](),controller[_0xbf95('0x12')]);router[_0xbf95('0xb')](_0xbf95('0x13'),controller[_0xbf95('0x14')]);router[_0xbf95('0xb')]('/:id/avatar',controller[_0xbf95('0x15')]);router['get'](_0xbf95('0x16'),controller['getCustomerAvatar']);router[_0xbf95('0xb')](_0xbf95('0x17'),controller[_0xbf95('0x18')]);router[_0xbf95('0xb')](_0xbf95('0x19'),auth[_0xbf95('0x9')](),controller[_0xbf95('0x1a')]);router[_0xbf95('0xb')](_0xbf95('0x1b'),controller[_0xbf95('0x1c')]);router[_0xbf95('0xb')]('/:id/applications',auth[_0xbf95('0x9')](),controller[_0xbf95('0x1d')]);router[_0xbf95('0xb')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router[_0xbf95('0xb')](_0xbf95('0x1e'),controller[_0xbf95('0x1f')]);router[_0xbf95('0xb')]('/:id/offline_messages',auth[_0xbf95('0x9')](),controller[_0xbf95('0x20')]);router[_0xbf95('0xb')](_0xbf95('0x21'),auth[_0xbf95('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xbf95('0x22')]);router['post'](_0xbf95('0x10'),auth[_0xbf95('0x9')](),controller[_0xbf95('0x23')]);router[_0xbf95('0x24')](_0xbf95('0x11'),auth['isAuthenticated'](),controller[_0xbf95('0x25')]);var upload=multer({'storage':multer[_0xbf95('0x26')]({'destination':function(_0x3c893f,_0x200765,_0x10fd29){_0x10fd29(null,path['join'](config['root'],_0xbf95('0x27')));},'filename':function(_0x5ad451,_0x1799ee,_0xd6e15a){_0xd6e15a(null,util[_0xbf95('0x28')](_0xbf95('0x29'),Date[_0xbf95('0x2a')](),_0x1799ee[_0xbf95('0x2b')]));}})});router[_0xbf95('0x24')](_0xbf95('0x13'),upload[_0xbf95('0x2c')](_0xbf95('0x2d')),controller[_0xbf95('0x2e')]);var upload=multer({'storage':multer[_0xbf95('0x26')]({'destination':function(_0x5c5e23,_0x2aaf62,_0x59b1f2){_0x59b1f2(null,path[_0xbf95('0x2f')](config[_0xbf95('0x30')],_0xbf95('0x31')));},'filename':function(_0x3090e3,_0x420c7b,_0x12a0d9){_0x12a0d9(null,util[_0xbf95('0x28')](_0xbf95('0x29'),Date['now'](),_0x420c7b[_0xbf95('0x2b')]));}})});router[_0xbf95('0x24')](_0xbf95('0x32'),upload[_0xbf95('0x2c')](_0xbf95('0x2d')),controller[_0xbf95('0x33')]);var upload=multer({'storage':multer[_0xbf95('0x26')]({'destination':function(_0x4ebd51,_0x31024b,_0x3771a2){_0x3771a2(null,path[_0xbf95('0x2f')](config[_0xbf95('0x30')],_0xbf95('0x31')));},'filename':function(_0x359e5b,_0x2b010a,_0x2af393){_0x2af393(null,util['format'](_0xbf95('0x29'),Date[_0xbf95('0x2a')](),_0x2b010a[_0xbf95('0x2b')]));}})});router[_0xbf95('0x24')](_0xbf95('0x16'),upload[_0xbf95('0x2c')](_0xbf95('0x2d')),controller[_0xbf95('0x34')]);var upload=multer({'storage':multer[_0xbf95('0x26')]({'destination':function(_0x2c4417,_0x39243d,_0x181b1a){_0x181b1a(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x900369,_0x6c82c7,_0xc14dbc){_0xc14dbc(null,util[_0xbf95('0x28')]('%s-%s',Date[_0xbf95('0x2a')](),_0x6c82c7['originalname']));}})});router['post'](_0xbf95('0x17'),upload[_0xbf95('0x2c')](_0xbf95('0x2d')),controller[_0xbf95('0x35')]);router[_0xbf95('0x24')](_0xbf95('0x36'),controller[_0xbf95('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x18aa5f,_0x290732,_0x10aaa2){const _0x5df2fb=path[_0xbf95('0x2f')](config['root'],_0xbf95('0x38'),'attachments','offline-chat');fs_extra[_0xbf95('0x39')](_0x5df2fb,function(){_0x10aaa2(null,_0x5df2fb);});},'filename':function(_0x22f530,_0x372b9c,_0x18c2b6){const _0x1ee5df=_0x372b9c['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3292f3=path[_0xbf95('0x3a')](_0x1ee5df);const _0x55e49b=Date['now']()+'-'+_0x1ee5df['replace'](_0x3292f3,'')+_0x3292f3;_0x18c2b6(null,_0x55e49b);}})});router[_0xbf95('0x24')]('/:id/offline',offlineUploadMulter['any'](),controller[_0xbf95('0x3b')]);router[_0xbf95('0x24')](_0xbf95('0x19'),auth['isAuthenticated'](),controller[_0xbf95('0x3c')]);router[_0xbf95('0x24')](_0xbf95('0x3d'),auth['isAuthenticated'](),controller[_0xbf95('0x3e')]);router[_0xbf95('0x24')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xbf95('0x24')]('/:id/users',auth[_0xbf95('0x9')](),controller[_0xbf95('0x3f')]);router[_0xbf95('0x40')](_0xbf95('0xe'),auth[_0xbf95('0x9')](),controller[_0xbf95('0x41')]);router['delete'](_0xbf95('0xe'),auth['isAuthenticated'](),controller[_0xbf95('0x42')]);router['delete'](_0xbf95('0x10'),auth[_0xbf95('0x9')](),controller[_0xbf95('0x43')]);router[_0xbf95('0x44')](_0xbf95('0x11'),auth[_0xbf95('0x9')](),controller[_0xbf95('0x45')]);router[_0xbf95('0x44')](_0xbf95('0x21'),auth['isAuthenticated'](),controller[_0xbf95('0x46')]);module[_0xbf95('0x47')]=router; \ No newline at end of file +var _0x8e74=['/:id/proactive_actions','addProactiveActions','put','update','delete','destroy','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getFields','getOfflineMessages','/:id/users','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','/:id/customer_avatar','/:id/system_avatar','addSystemAvatar','notify','offline-chat','replace','extname','/:id/offline','offline','addInteraction','addApplications'];(function(_0x4723ca,_0x230e9a){var _0xb6a9e2=function(_0x1ce51a){while(--_0x1ce51a){_0x4723ca['push'](_0x4723ca['shift']());}};_0xb6a9e2(++_0x230e9a);}(_0x8e74,0x15c));var _0x48e7=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x8e74[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0x48e7('0x0'));var util=require(_0x48e7('0x1'));var path=require(_0x48e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x48e7('0x3'));var router=express['Router']();var fs_extra=require(_0x48e7('0x4'));var auth=require(_0x48e7('0x5'));var interaction=require(_0x48e7('0x6'));var config=require(_0x48e7('0x7'));var controller=require(_0x48e7('0x8'));router[_0x48e7('0x9')]('/',auth[_0x48e7('0xa')](),controller[_0x48e7('0xb')]);router[_0x48e7('0x9')](_0x48e7('0xc'),auth[_0x48e7('0xa')](),controller[_0x48e7('0xd')]);router[_0x48e7('0x9')](_0x48e7('0xe'),auth[_0x48e7('0xa')](),controller[_0x48e7('0xf')]);router[_0x48e7('0x9')](_0x48e7('0x10'),auth[_0x48e7('0xa')](),controller['getDispositions']);router[_0x48e7('0x9')](_0x48e7('0x11'),auth['isAuthenticated'](),controller[_0x48e7('0x12')]);router[_0x48e7('0x9')]('/:id/logo',controller[_0x48e7('0x13')]);router[_0x48e7('0x9')](_0x48e7('0x14'),controller[_0x48e7('0x15')]);router[_0x48e7('0x9')]('/:id/customer_avatar',controller[_0x48e7('0x16')]);router[_0x48e7('0x9')]('/:id/system_avatar',controller[_0x48e7('0x17')]);router[_0x48e7('0x9')](_0x48e7('0x18'),auth[_0x48e7('0xa')](),controller[_0x48e7('0x19')]);router[_0x48e7('0x9')](_0x48e7('0x1a'),controller[_0x48e7('0x1b')]);router[_0x48e7('0x9')](_0x48e7('0x1c'),auth['isAuthenticated'](),controller[_0x48e7('0x1d')]);router['get']('/:id/proactive_actions',auth[_0x48e7('0xa')](),controller['getProactiveActions']);router[_0x48e7('0x9')]('/:id/fields',controller[_0x48e7('0x1e')]);router['get']('/:id/offline_messages',auth[_0x48e7('0xa')](),controller[_0x48e7('0x1f')]);router[_0x48e7('0x9')](_0x48e7('0x20'),auth['isAuthenticated'](),controller['getAgents']);router[_0x48e7('0x21')]('/',auth[_0x48e7('0xa')](),controller[_0x48e7('0x22')]);router[_0x48e7('0x21')]('/:id/dispositions',auth[_0x48e7('0xa')](),controller[_0x48e7('0x23')]);router[_0x48e7('0x21')](_0x48e7('0x11'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0x48e7('0x24')]({'destination':function(_0x2d71b7,_0x2910b7,_0x231f89){_0x231f89(null,path[_0x48e7('0x25')](config[_0x48e7('0x26')],_0x48e7('0x27')));},'filename':function(_0x37e62a,_0x4c7121,_0x3b4985){_0x3b4985(null,util[_0x48e7('0x28')](_0x48e7('0x29'),Date[_0x48e7('0x2a')](),_0x4c7121[_0x48e7('0x2b')]));}})});router['post']('/:id/logo',upload[_0x48e7('0x2c')](_0x48e7('0x2d')),controller[_0x48e7('0x2e')]);var upload=multer({'storage':multer[_0x48e7('0x24')]({'destination':function(_0x5aa634,_0x4d8f87,_0x3526b9){_0x3526b9(null,path[_0x48e7('0x25')](config[_0x48e7('0x26')],_0x48e7('0x2f')));},'filename':function(_0x23848e,_0x5339d5,_0x4d6a26){_0x4d6a26(null,util['format'](_0x48e7('0x29'),Date[_0x48e7('0x2a')](),_0x5339d5['originalname']));}})});router['post'](_0x48e7('0x14'),upload[_0x48e7('0x2c')](_0x48e7('0x2d')),controller[_0x48e7('0x30')]);var upload=multer({'storage':multer[_0x48e7('0x24')]({'destination':function(_0x3bcb93,_0x3737b5,_0x358b20){_0x358b20(null,path[_0x48e7('0x25')](config[_0x48e7('0x26')],_0x48e7('0x2f')));},'filename':function(_0x100ef3,_0x54c3dd,_0x223d52){_0x223d52(null,util[_0x48e7('0x28')](_0x48e7('0x29'),Date[_0x48e7('0x2a')](),_0x54c3dd[_0x48e7('0x2b')]));}})});router['post'](_0x48e7('0x31'),upload['single'](_0x48e7('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x48e7('0x24')]({'destination':function(_0x16cf28,_0x36836f,_0x178a26){_0x178a26(null,path[_0x48e7('0x25')](config[_0x48e7('0x26')],'server/files/images/avatars/'));},'filename':function(_0x30e7d1,_0x3b13e1,_0x34893c){_0x34893c(null,util[_0x48e7('0x28')](_0x48e7('0x29'),Date[_0x48e7('0x2a')](),_0x3b13e1[_0x48e7('0x2b')]));}})});router[_0x48e7('0x21')](_0x48e7('0x32'),upload[_0x48e7('0x2c')]('file'),controller[_0x48e7('0x33')]);router[_0x48e7('0x21')]('/:id/notify',controller[_0x48e7('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x48e7('0x24')]({'destination':function(_0x1ee295,_0xf29ed8,_0x58db8b){const _0x466a96=path['join'](config[_0x48e7('0x26')],'server/files','attachments',_0x48e7('0x35'));fs_extra['ensureDir'](_0x466a96,function(){_0x58db8b(null,_0x466a96);});},'filename':function(_0x1dce12,_0x8ee358,_0x11e1fc){const _0x4fbb20=_0x8ee358[_0x48e7('0x2b')][_0x48e7('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x476e1e=path[_0x48e7('0x37')](_0x4fbb20);const _0x4cae0f=Date[_0x48e7('0x2a')]()+'-'+_0x4fbb20[_0x48e7('0x36')](_0x476e1e,'')+_0x476e1e;_0x11e1fc(null,_0x4cae0f);}})});router[_0x48e7('0x21')](_0x48e7('0x38'),offlineUploadMulter['any'](),controller[_0x48e7('0x39')]);router[_0x48e7('0x21')](_0x48e7('0x18'),auth['isAuthenticated'](),controller[_0x48e7('0x3a')]);router['post']('/:id/applications',auth[_0x48e7('0xa')](),controller[_0x48e7('0x3b')]);router[_0x48e7('0x21')](_0x48e7('0x3c'),auth['isAuthenticated'](),controller[_0x48e7('0x3d')]);router['post'](_0x48e7('0x20'),auth[_0x48e7('0xa')](),controller['addAgents']);router[_0x48e7('0x3e')]('/:id',auth[_0x48e7('0xa')](),controller[_0x48e7('0x3f')]);router[_0x48e7('0x40')]('/:id',auth[_0x48e7('0xa')](),controller[_0x48e7('0x41')]);router['delete'](_0x48e7('0x10'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x48e7('0x11'),auth[_0x48e7('0xa')](),controller['removeAnswers']);router[_0x48e7('0x40')](_0x48e7('0x20'),auth[_0x48e7('0xa')](),controller[_0x48e7('0x42')]);module[_0x48e7('0x43')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 7f24053..6825856 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 _0x04cc=['production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','exports','beaver-logger/server','express','../config/environment','Router','env'];(function(_0x30eed8,_0x112840){var _0x410c92=function(_0x2eff26){while(--_0x2eff26){_0x30eed8['push'](_0x30eed8['shift']());}};_0x410c92(++_0x112840);}(_0x04cc,0x14b));var _0xc04c=function(_0x521378,_0x2f8004){_0x521378=_0x521378-0x0;var _0x4b2fc4=_0x04cc[_0x521378];return _0x4b2fc4;};var beaverLogger=require(_0xc04c('0x0'));var express=require(_0xc04c('0x1'));var auth=require('../components/auth/service');var config=require(_0xc04c('0x2'));var router=express[_0xc04c('0x3')]();var isProduction=config[_0xc04c('0x4')]===_0xc04c('0x5')||![];function clientSideLogs(_0x3ab21b,_0x22298b,_0x2a2622){var _0x38a3bf=_0x3ab21b['app'][_0xc04c('0x6')](_0xc04c('0x7'));if(!_0x38a3bf){throw new Error(_0xc04c('0x8'));}return beaverLogger[_0xc04c('0x9')]({'uri':_0xc04c('0xa'),'logger':_0x38a3bf,'enableCors':!isProduction})(_0x3ab21b,_0x22298b,_0x2a2622);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xc04c('0xb')]=router; \ No newline at end of file +var _0x09d8=['express','../components/auth/service','Router','env','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server'];(function(_0x43fd0e,_0x419944){var _0xfee08c=function(_0xb2a177){while(--_0xb2a177){_0x43fd0e['push'](_0x43fd0e['shift']());}};_0xfee08c(++_0x419944);}(_0x09d8,0x1a3));var _0x809d=function(_0x3f4a73,_0x1c770b){_0x3f4a73=_0x3f4a73-0x0;var _0xb9de69=_0x09d8[_0x3f4a73];return _0xb9de69;};var beaverLogger=require(_0x809d('0x0'));var express=require(_0x809d('0x1'));var auth=require(_0x809d('0x2'));var config=require('../config/environment');var router=express[_0x809d('0x3')]();var isProduction=config[_0x809d('0x4')]==='production'||![];function clientSideLogs(_0x17efa4,_0x203b57,_0x91b634){var _0x1dc497=_0x17efa4[_0x809d('0x5')]['get'](_0x809d('0x6'));if(!_0x1dc497){throw new Error(_0x809d('0x7'));}return beaverLogger[_0x809d('0x8')]({'uri':'/client-logs','logger':_0x1dc497,'enableCors':!isProduction})(_0x17efa4,_0x203b57,_0x91b634);}router[_0x809d('0x9')](auth[_0x809d('0xa')](),clientSideLogs);module[_0x809d('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 6321f39..1fe2b5a 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 _0x87d4=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x87d4,0x120));var _0x487d=function(_0x308d77,_0x47a8f3){_0x308d77=_0x308d77-0x0;var _0x54946d=_0x87d4[_0x308d77];return _0x54946d;};'use strict';var Sequelize=require(_0x487d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x487d('0x1'),_0x487d('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x487d('0x3'),_0x487d('0x4'))},'data1':{'type':Sequelize[_0x487d('0x5')],'comment':_0x487d('0x6')},'data2':{'type':Sequelize[_0x487d('0x5')],'comment':_0x487d('0x7')},'data3':{'type':Sequelize[_0x487d('0x5')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x487d('0x5')],'comment':_0x487d('0x8')},'data5':{'type':Sequelize['TEXT'],'comment':_0x487d('0x9')},'data6':{'type':Sequelize[_0x487d('0xa')],'comment':_0x487d('0xb')},'data7':{'type':Sequelize[_0x487d('0xa')],'comment':_0x487d('0xc')}}; \ No newline at end of file +var _0xf781=['STRING','ENUM','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0x306687,_0x15c008){var _0x3601f0=function(_0x211e19){while(--_0x211e19){_0x306687['push'](_0x306687['shift']());}};_0x3601f0(++_0x15c008);}(_0xf781,0x136));var _0x1f78=function(_0x3ed983,_0x5d9f79){_0x3ed983=_0x3ed983-0x0;var _0x45072e=_0xf781[_0x3ed983];return _0x45072e;};'use strict';var Sequelize=require(_0x1f78('0x0'));module[_0x1f78('0x1')]={'name':{'type':Sequelize[_0x1f78('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1f78('0x3')]('AmazonAWS',_0x1f78('0x4'),_0x1f78('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x1f78('0x3')](_0x1f78('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0x1f78('0x2')],'comment':_0x1f78('0x7')},'data2':{'type':Sequelize[_0x1f78('0x2')],'comment':_0x1f78('0x8')},'data3':{'type':Sequelize[_0x1f78('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x1f78('0x2')],'comment':_0x1f78('0x9')},'data5':{'type':Sequelize[_0x1f78('0xa')],'comment':_0x1f78('0xb')},'data6':{'type':Sequelize[_0x1f78('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0x1f78('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index cb85d9e..4379238 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 _0x8167=['stringify','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','status','end','offset','limit','count','set','Content-Range','update','destroy','then','sendStatus','error','stack','name','send','padEnd','slice','map','CloudProvider','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','filters','pick','filter','where','VIRTUAL','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','merge','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','findOne','oauth2MicrosoftCallback','get','state','base64','toString','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0x8167,0xab));var _0x7816=function(_0x2b1796,_0xcdb779){_0x2b1796=_0x2b1796-0x0;var _0x1e0f44=_0x8167[_0x2b1796];return _0x1e0f44;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x7816('0x0'));var encryptor=require(_0x7816('0x1'));var config=require(_0x7816('0x2'));var logger=require('../../config/logger')(_0x7816('0x3'));var db=require(_0x7816('0x4'))['db'];var oauth=require(_0x7816('0x5'));config[_0x7816('0x6')]=_[_0x7816('0x7')](config['redis'],{'host':_0x7816('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x1f7bf7,_0x5f11ef){_0x5f11ef=_0x5f11ef||0xcc;return function(_0x107a14){if(_0x107a14){return _0x1f7bf7['sendStatus'](_0x5f11ef);}return _0x1f7bf7[_0x7816('0x9')](_0x5f11ef)[_0x7816('0xa')]();};}function respondWithResult(_0x3b5b99,_0x4518a6){_0x4518a6=_0x4518a6||0xc8;return function(_0x1ff5c5){if(_0x1ff5c5){return _0x3b5b99[_0x7816('0x9')](_0x4518a6)['json'](_0x1ff5c5);}};}function respondWithFilteredResult(_0x58b717,_0x2fb2f5){return function(_0x20fec3){if(_0x20fec3){var _0x531fb4=typeof _0x2fb2f5[_0x7816('0xb')]==='undefined'&&typeof _0x2fb2f5[_0x7816('0xc')]==='undefined';var _0x41aca0=_0x20fec3['count'];var _0x703620=_0x531fb4?0x0:_0x2fb2f5[_0x7816('0xb')];var _0x2ddbc8=_0x531fb4?_0x20fec3[_0x7816('0xd')]:_0x2fb2f5[_0x7816('0xb')]+_0x2fb2f5[_0x7816('0xc')];var _0x1863d7;if(_0x2ddbc8>=_0x41aca0){_0x2ddbc8=_0x41aca0;_0x1863d7=0xc8;}else{_0x1863d7=0xce;}_0x58b717['status'](_0x1863d7);return _0x58b717[_0x7816('0xe')](_0x7816('0xf'),_0x703620+'-'+_0x2ddbc8+'/'+_0x41aca0)['json'](_0x20fec3);}return null;};}function saveUpdates(_0x4b80f7){return function(_0x406aa6){if(_0x406aa6){return _0x406aa6[_0x7816('0x10')](_0x4b80f7)['then'](function(_0x1cf118){return _0x1cf118;});}return null;};}function removeEntity(_0x503fbe){return function(_0x411aa7){if(_0x411aa7){return _0x411aa7[_0x7816('0x11')]()[_0x7816('0x12')](function(){_0x503fbe[_0x7816('0x9')](0xcc)[_0x7816('0xa')]();});}};}function handleEntityNotFound(_0x50be36){return function(_0x21673f){if(!_0x21673f){_0x50be36[_0x7816('0x13')](0x194);}return _0x21673f;};}function handleError(_0xf12456,_0x427af6){_0x427af6=_0x427af6||0x1f4;return function(_0x2c095c){logger[_0x7816('0x14')](_0x2c095c[_0x7816('0x15')]);if(_0x2c095c[_0x7816('0x16')]){delete _0x2c095c[_0x7816('0x16')];}_0xf12456['status'](_0x427af6)[_0x7816('0x17')](_0x2c095c);};}function maskClientSecret(_0x4562cd){return _[_0x7816('0x18')](_0x4562cd[_0x7816('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x556459,_0x3f9b3f){var _0x18e8ba={},_0x4bbbf3={},_0x360b93={'count':0x0,'rows':[]};var _0x49013e=_[_0x7816('0x1a')](db[_0x7816('0x1b')][_0x7816('0x1c')],function(_0xd48657){return{'name':_0xd48657['fieldName'],'type':_0xd48657[_0x7816('0x1d')][_0x7816('0x1e')]};});_0x4bbbf3[_0x7816('0x1f')]=_[_0x7816('0x1a')](_0x49013e,'name');_0x4bbbf3[_0x7816('0x20')]=_[_0x7816('0x21')](_0x556459[_0x7816('0x20')]);_0x4bbbf3['filters']=_[_0x7816('0x22')](_0x4bbbf3['model'],_0x4bbbf3[_0x7816('0x20')]);_0x18e8ba[_0x7816('0x23')]=_[_0x7816('0x22')](_0x4bbbf3[_0x7816('0x1f')],qs[_0x7816('0x24')](_0x556459[_0x7816('0x20')][_0x7816('0x24')]));_0x18e8ba['attributes']=_0x18e8ba[_0x7816('0x23')][_0x7816('0x25')]?_0x18e8ba[_0x7816('0x23')]:_0x4bbbf3[_0x7816('0x1f')];if(!_0x556459[_0x7816('0x20')][_0x7816('0x26')](_0x7816('0x27'))){_0x18e8ba['limit']=qs[_0x7816('0xc')](_0x556459[_0x7816('0x20')][_0x7816('0xc')]);_0x18e8ba[_0x7816('0xb')]=qs[_0x7816('0xb')](_0x556459[_0x7816('0x20')]['offset']);}_0x18e8ba['order']=qs['sort'](_0x556459[_0x7816('0x20')]['sort']);_0x18e8ba['where']=qs[_0x7816('0x28')](_[_0x7816('0x29')](_0x556459[_0x7816('0x20')],_0x4bbbf3[_0x7816('0x28')]),_0x49013e);if(_0x556459[_0x7816('0x20')][_0x7816('0x2a')]){_0x18e8ba[_0x7816('0x2b')]=_['merge'](_0x18e8ba['where'],{'$or':_[_0x7816('0x1a')](_0x49013e,function(_0x581452){if(_0x581452[_0x7816('0x1d')]!==_0x7816('0x2c')){var _0x57e71e={};_0x57e71e[_0x581452[_0x7816('0x16')]]={'$like':'%'+_0x556459[_0x7816('0x20')][_0x7816('0x2a')]+'%'};return _0x57e71e;}})});}_0x18e8ba=_['merge']({},_0x18e8ba,_0x556459[_0x7816('0x2d')]);var _0x451a1d={'where':_0x18e8ba[_0x7816('0x2b')]};return db['CloudProvider'][_0x7816('0xd')](_0x451a1d)['then'](function(_0x5e3d3d){_0x360b93[_0x7816('0xd')]=_0x5e3d3d;if(_0x556459[_0x7816('0x20')][_0x7816('0x2e')]){_0x18e8ba[_0x7816('0x2f')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x18e8ba);})[_0x7816('0x12')](function(_0x1505c9){_0x360b93[_0x7816('0x30')]=_[_0x7816('0x1a')](_0x1505c9,function(_0x4083e8){if(_0x4083e8[_0x7816('0x31')]===_0x7816('0x32')){var _0x3b137f=encryptor[_0x7816('0x33')](_0x4083e8[_0x7816('0x34')]);_0x4083e8[_0x7816('0x34')]=maskClientSecret(_0x3b137f);}return _0x4083e8;});return _0x360b93;})[_0x7816('0x12')](respondWithFilteredResult(_0x3f9b3f,_0x18e8ba))[_0x7816('0x35')](handleError(_0x3f9b3f,null));};exports[_0x7816('0x36')]=function(_0x3135db,_0x5217a7){var _0x5af2ff={'raw':!![],'where':{'id':_0x3135db[_0x7816('0x37')]['id']}},_0x3afbdf={};_0x3afbdf['model']=_[_0x7816('0x21')](db[_0x7816('0x1b')]['rawAttributes']);_0x3afbdf[_0x7816('0x20')]=_[_0x7816('0x21')](_0x3135db[_0x7816('0x20')]);_0x3afbdf[_0x7816('0x28')]=_[_0x7816('0x22')](_0x3afbdf[_0x7816('0x1f')],_0x3afbdf[_0x7816('0x20')]);_0x5af2ff['attributes']=_[_0x7816('0x22')](_0x3afbdf[_0x7816('0x1f')],qs['fields'](_0x3135db['query'][_0x7816('0x24')]));_0x5af2ff[_0x7816('0x23')]=_0x5af2ff['attributes'][_0x7816('0x25')]?_0x5af2ff['attributes']:_0x3afbdf[_0x7816('0x1f')];if(_0x3135db[_0x7816('0x20')][_0x7816('0x2e')]){_0x5af2ff[_0x7816('0x2f')]=[{'all':!![]}];}_0x5af2ff=_[_0x7816('0x38')]({},_0x5af2ff,_0x3135db['options']);return db[_0x7816('0x1b')][_0x7816('0x39')](_0x5af2ff)[_0x7816('0x12')](handleEntityNotFound(_0x5217a7,null))['then'](function(_0x24d586){if(_0x24d586['service']===_0x7816('0x32')){var _0x367571=encryptor[_0x7816('0x33')](_0x24d586[_0x7816('0x34')]);_0x24d586['data3']=maskClientSecret(_0x367571);}return _0x24d586;})[_0x7816('0x12')](respondWithResult(_0x5217a7,null))[_0x7816('0x35')](handleError(_0x5217a7,null));};exports[_0x7816('0x3a')]=function(_0x191190,_0x40adb6){if(!_0x191190[_0x7816('0x3b')]['name'])throw new Error(_0x7816('0x3c'));if(!_0x191190['body'][_0x7816('0x31')])throw new Error(_0x7816('0x3d'));var _0x3570c8=db[_0x7816('0x1b')][_0x7816('0x1c')][_0x7816('0x31')]['values'];if(!_0x3570c8['includes'](_0x191190[_0x7816('0x3b')]['service']))throw new Error(_0x7816('0x3e')+_0x3570c8['join'](',\x20'));if(_0x191190['body']['service']==='MicrosoftAzure'&&_0x191190['body']['data3']){_0x191190['body'][_0x7816('0x34')]=encryptor[_0x7816('0x3f')](_0x191190['body'][_0x7816('0x34')]);}return db[_0x7816('0x1b')][_0x7816('0x3a')](_0x191190[_0x7816('0x3b')],{})['then'](respondWithResult(_0x40adb6,0xc9))[_0x7816('0x35')](handleError(_0x40adb6,null));};exports[_0x7816('0x10')]=function(_0x26e564,_0x10fafb){if(_0x26e564[_0x7816('0x3b')]['id']){delete _0x26e564[_0x7816('0x3b')]['id'];}return db[_0x7816('0x1b')][_0x7816('0x39')]({'where':{'id':_0x26e564['params']['id']}})[_0x7816('0x12')](handleEntityNotFound(_0x10fafb,null))[_0x7816('0x12')](function(_0x3d1434){if(_0x3d1434['service']===_0x7816('0x32')&&_0x26e564['body'][_0x7816('0x34')]){_0x26e564[_0x7816('0x3b')][_0x7816('0x34')]=encryptor[_0x7816('0x3f')](_0x26e564['body'][_0x7816('0x34')]);}return _0x3d1434;})[_0x7816('0x12')](saveUpdates(_0x26e564['body'],null))[_0x7816('0x12')](respondWithResult(_0x10fafb,null))[_0x7816('0x35')](handleError(_0x10fafb,null));};exports[_0x7816('0x11')]=function(_0x500f90,_0x2e0a77){return db[_0x7816('0x1b')][_0x7816('0x39')]({'where':{'id':_0x500f90[_0x7816('0x37')]['id']}})[_0x7816('0x12')](handleEntityNotFound(_0x2e0a77,null))[_0x7816('0x12')](removeEntity(_0x2e0a77,null))[_0x7816('0x35')](handleError(_0x2e0a77,null));};exports['oauth2MicrosoftAuthorize']=function(_0x2e39ed,_0x1d7955){return db[_0x7816('0x1b')][_0x7816('0x40')]({'where':{'id':_0x2e39ed[_0x7816('0x37')]['id']},'raw':!![]})[_0x7816('0x12')](function(_0x15be87){if(!_0x15be87)return _0x1d7955[_0x7816('0x13')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x15be87,_0x2e39ed['user']['id'])};})[_0x7816('0x12')](respondWithResult(_0x1d7955,null))[_0x7816('0x35')](handleError(_0x1d7955,null));};exports[_0x7816('0x41')]=function(_0x4c064f,_0x36c75c){var _0x48b006=_0x4c064f[_0x7816('0x3b')];var _0x474df3;var _0x13a28d;if(_0x48b006['error'])throw _0x48b006;redis[_0x7816('0x42')](_0x48b006[_0x7816('0x43')])['then'](function(_0xb56ca0){if(!_0xb56ca0)throw new Error('Invalid\x20state\x20parameter');_0x474df3=JSON['parse'](_0xb56ca0);var _0x4a78db=Buffer['from'](_0x48b006[_0x7816('0x43')],_0x7816('0x44'))[_0x7816('0x45')]('ascii');_0x13a28d=JSON['parse'](_0x4a78db);if(!oauth['isValidIdToken'](_0x48b006[_0x7816('0x46')],_0x474df3[_0x7816('0x47')]))throw new Error(_0x7816('0x48'));redis[_0x7816('0x49')](_0x48b006[_0x7816('0x43')]);return oauth[_0x7816('0x4a')](_0x48b006['code'],_0x474df3);})[_0x7816('0x12')](function(_0x2162cb){_0x474df3[_0x7816('0x4b')]=_0x2162cb[_0x7816('0x4c')];_0x474df3[_0x7816('0x4d')]=_0x2162cb[_0x7816('0x4e')];return db[_0x7816('0x1b')][_0x7816('0x10')]({'data5':_0x474df3['data5'],'data6':_0x474df3['data6']},{'where':{'id':_0x474df3['id']}});})['then'](function(){oauth[_0x7816('0x4f')](_0x474df3);socket[_0x7816('0x50')](_0x7816('0x51'),{'id':_0x13a28d['id']});return;})[_0x7816('0x12')](respondWithStatusCode(_0x36c75c,null))['catch'](function(_0x33eb2c){if(_0x13a28d){socket[_0x7816('0x50')](_0x7816('0x52'),{'id':_0x13a28d['id']});}if(!_0x474df3){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x33eb2c);return _0x36c75c[_0x7816('0x9')](0x1f4)[_0x7816('0x17')](_0x33eb2c['message']);}logger[_0x7816('0x14')](_0x7816('0x53'),_0x474df3['id'],JSON[_0x7816('0x54')](_0x33eb2c));});}; \ No newline at end of file +var _0x1ff8=['data3','catch','show','params','keys','length','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','ascii','Unable\x20to\x20validate\x20id_token','code','data5','data6','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','destroy','then','error','name','send','slice','index','map','CloudProvider','rawAttributes','fieldName','model','filters','intersection','fields','query','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','service','decryptString'];(function(_0x434e05,_0x243a35){var _0x422b3c=function(_0x702507){while(--_0x702507){_0x434e05['push'](_0x434e05['shift']());}};_0x422b3c(++_0x243a35);}(_0x1ff8,0x86));var _0x81ff=function(_0x65c903,_0x41e920){_0x65c903=_0x65c903-0x0;var _0x23e1d7=_0x1ff8[_0x65c903];return _0x23e1d7;};'use strict';var _=require(_0x81ff('0x0'));var Redis=require(_0x81ff('0x1'));var qs=require(_0x81ff('0x2'));var encryptor=require(_0x81ff('0x3'));var config=require('../../config/environment');var logger=require(_0x81ff('0x4'))(_0x81ff('0x5'));var db=require(_0x81ff('0x6'))['db'];var oauth=require(_0x81ff('0x7'));config[_0x81ff('0x8')]=_[_0x81ff('0x9')](config[_0x81ff('0x8')],{'host':_0x81ff('0xa'),'port':0x18eb});var socket=require(_0x81ff('0xb'))(new Redis(config[_0x81ff('0x8')]));var redis=new Redis(config[_0x81ff('0x8')]);function respondWithStatusCode(_0x33bb82,_0x416ebd){_0x416ebd=_0x416ebd||0xcc;return function(_0x3c7d38){if(_0x3c7d38){return _0x33bb82[_0x81ff('0xc')](_0x416ebd);}return _0x33bb82[_0x81ff('0xd')](_0x416ebd)[_0x81ff('0xe')]();};}function respondWithResult(_0x239050,_0x31be77){_0x31be77=_0x31be77||0xc8;return function(_0x1fa1fc){if(_0x1fa1fc){return _0x239050[_0x81ff('0xd')](_0x31be77)[_0x81ff('0xf')](_0x1fa1fc);}};}function respondWithFilteredResult(_0x15a3df,_0x305a46){return function(_0x45b154){if(_0x45b154){var _0x521ad1=typeof _0x305a46[_0x81ff('0x10')]==='undefined'&&typeof _0x305a46[_0x81ff('0x11')]==='undefined';var _0x3f591c=_0x45b154[_0x81ff('0x12')];var _0x4f4804=_0x521ad1?0x0:_0x305a46[_0x81ff('0x10')];var _0xf3cb54=_0x521ad1?_0x45b154[_0x81ff('0x12')]:_0x305a46[_0x81ff('0x10')]+_0x305a46[_0x81ff('0x11')];var _0x261f35;if(_0xf3cb54>=_0x3f591c){_0xf3cb54=_0x3f591c;_0x261f35=0xc8;}else{_0x261f35=0xce;}_0x15a3df[_0x81ff('0xd')](_0x261f35);return _0x15a3df[_0x81ff('0x13')](_0x81ff('0x14'),_0x4f4804+'-'+_0xf3cb54+'/'+_0x3f591c)[_0x81ff('0xf')](_0x45b154);}return null;};}function saveUpdates(_0x3a6a17){return function(_0x1564e1){if(_0x1564e1){return _0x1564e1[_0x81ff('0x15')](_0x3a6a17)['then'](function(_0x3284ff){return _0x3284ff;});}return null;};}function removeEntity(_0x4f6795){return function(_0x3febc8){if(_0x3febc8){return _0x3febc8[_0x81ff('0x16')]()[_0x81ff('0x17')](function(){_0x4f6795['status'](0xcc)[_0x81ff('0xe')]();});}};}function handleEntityNotFound(_0x2aedb9){return function(_0x19698d){if(!_0x19698d){_0x2aedb9[_0x81ff('0xc')](0x194);}return _0x19698d;};}function handleError(_0x4177eb,_0x49c7b8){_0x49c7b8=_0x49c7b8||0x1f4;return function(_0xc2dc05){logger[_0x81ff('0x18')](_0xc2dc05['stack']);if(_0xc2dc05[_0x81ff('0x19')]){delete _0xc2dc05[_0x81ff('0x19')];}_0x4177eb[_0x81ff('0xd')](_0x49c7b8)[_0x81ff('0x1a')](_0xc2dc05);};}function maskClientSecret(_0x42dc92){return _['padEnd'](_0x42dc92[_0x81ff('0x1b')](0x0,0x3),0x14,'*');}exports[_0x81ff('0x1c')]=function(_0xa382a9,_0x2c14ad){var _0x4f4576={},_0x74e4e5={},_0x153a1e={'count':0x0,'rows':[]};var _0x427939=_[_0x81ff('0x1d')](db[_0x81ff('0x1e')][_0x81ff('0x1f')],function(_0x2be28d){return{'name':_0x2be28d[_0x81ff('0x20')],'type':_0x2be28d['type']['key']};});_0x74e4e5[_0x81ff('0x21')]=_[_0x81ff('0x1d')](_0x427939,_0x81ff('0x19'));_0x74e4e5['query']=_['keys'](_0xa382a9['query']);_0x74e4e5[_0x81ff('0x22')]=_[_0x81ff('0x23')](_0x74e4e5['model'],_0x74e4e5['query']);_0x4f4576['attributes']=_[_0x81ff('0x23')](_0x74e4e5[_0x81ff('0x21')],qs[_0x81ff('0x24')](_0xa382a9[_0x81ff('0x25')]['fields']));_0x4f4576[_0x81ff('0x26')]=_0x4f4576[_0x81ff('0x26')]['length']?_0x4f4576[_0x81ff('0x26')]:_0x74e4e5[_0x81ff('0x21')];if(!_0xa382a9[_0x81ff('0x25')][_0x81ff('0x27')](_0x81ff('0x28'))){_0x4f4576[_0x81ff('0x11')]=qs[_0x81ff('0x11')](_0xa382a9[_0x81ff('0x25')][_0x81ff('0x11')]);_0x4f4576[_0x81ff('0x10')]=qs['offset'](_0xa382a9[_0x81ff('0x25')][_0x81ff('0x10')]);}_0x4f4576[_0x81ff('0x29')]=qs[_0x81ff('0x2a')](_0xa382a9[_0x81ff('0x25')]['sort']);_0x4f4576[_0x81ff('0x2b')]=qs[_0x81ff('0x22')](_[_0x81ff('0x2c')](_0xa382a9[_0x81ff('0x25')],_0x74e4e5['filters']),_0x427939);if(_0xa382a9[_0x81ff('0x25')][_0x81ff('0x2d')]){_0x4f4576[_0x81ff('0x2b')]=_[_0x81ff('0x2e')](_0x4f4576[_0x81ff('0x2b')],{'$or':_[_0x81ff('0x1d')](_0x427939,function(_0x23a129){if(_0x23a129[_0x81ff('0x2f')]!==_0x81ff('0x30')){var _0x4c66a0={};_0x4c66a0[_0x23a129['name']]={'$like':'%'+_0xa382a9[_0x81ff('0x25')][_0x81ff('0x2d')]+'%'};return _0x4c66a0;}})});}_0x4f4576=_[_0x81ff('0x2e')]({},_0x4f4576,_0xa382a9[_0x81ff('0x31')]);var _0x2a347f={'where':_0x4f4576[_0x81ff('0x2b')]};return db['CloudProvider'][_0x81ff('0x12')](_0x2a347f)['then'](function(_0x4ee248){_0x153a1e[_0x81ff('0x12')]=_0x4ee248;if(_0xa382a9[_0x81ff('0x25')][_0x81ff('0x32')]){_0x4f4576[_0x81ff('0x33')]=[{'all':!![]}];}return db[_0x81ff('0x1e')][_0x81ff('0x34')](_0x4f4576);})[_0x81ff('0x17')](function(_0x408c69){_0x153a1e[_0x81ff('0x35')]=_['map'](_0x408c69,function(_0x252568){if(_0x252568[_0x81ff('0x36')]==='MicrosoftAzure'){var _0x2863b7=encryptor[_0x81ff('0x37')](_0x252568[_0x81ff('0x38')]);_0x252568[_0x81ff('0x38')]=maskClientSecret(_0x2863b7);}return _0x252568;});return _0x153a1e;})[_0x81ff('0x17')](respondWithFilteredResult(_0x2c14ad,_0x4f4576))[_0x81ff('0x39')](handleError(_0x2c14ad,null));};exports[_0x81ff('0x3a')]=function(_0x20b4a1,_0x5543e5){var _0xe1d873={'raw':!![],'where':{'id':_0x20b4a1[_0x81ff('0x3b')]['id']}},_0x2b19af={};_0x2b19af[_0x81ff('0x21')]=_[_0x81ff('0x3c')](db[_0x81ff('0x1e')][_0x81ff('0x1f')]);_0x2b19af[_0x81ff('0x25')]=_[_0x81ff('0x3c')](_0x20b4a1[_0x81ff('0x25')]);_0x2b19af[_0x81ff('0x22')]=_[_0x81ff('0x23')](_0x2b19af[_0x81ff('0x21')],_0x2b19af[_0x81ff('0x25')]);_0xe1d873[_0x81ff('0x26')]=_['intersection'](_0x2b19af[_0x81ff('0x21')],qs[_0x81ff('0x24')](_0x20b4a1['query']['fields']));_0xe1d873[_0x81ff('0x26')]=_0xe1d873[_0x81ff('0x26')][_0x81ff('0x3d')]?_0xe1d873[_0x81ff('0x26')]:_0x2b19af['model'];if(_0x20b4a1[_0x81ff('0x25')]['includeAll']){_0xe1d873[_0x81ff('0x33')]=[{'all':!![]}];}_0xe1d873=_['merge']({},_0xe1d873,_0x20b4a1[_0x81ff('0x31')]);return db[_0x81ff('0x1e')][_0x81ff('0x3e')](_0xe1d873)[_0x81ff('0x17')](handleEntityNotFound(_0x5543e5,null))[_0x81ff('0x17')](function(_0x442f04){if(_0x442f04[_0x81ff('0x36')]===_0x81ff('0x3f')){var _0x53152c=encryptor[_0x81ff('0x37')](_0x442f04[_0x81ff('0x38')]);_0x442f04[_0x81ff('0x38')]=maskClientSecret(_0x53152c);}return _0x442f04;})[_0x81ff('0x17')](respondWithResult(_0x5543e5,null))['catch'](handleError(_0x5543e5,null));};exports[_0x81ff('0x40')]=function(_0x256159,_0x1bbd2d){if(!_0x256159[_0x81ff('0x41')][_0x81ff('0x19')])throw new Error(_0x81ff('0x42'));if(!_0x256159['body'][_0x81ff('0x36')])throw new Error(_0x81ff('0x43'));var _0x434634=db[_0x81ff('0x1e')][_0x81ff('0x1f')][_0x81ff('0x36')][_0x81ff('0x44')];if(!_0x434634[_0x81ff('0x45')](_0x256159[_0x81ff('0x41')][_0x81ff('0x36')]))throw new Error(_0x81ff('0x46')+_0x434634[_0x81ff('0x47')](',\x20'));if(_0x256159[_0x81ff('0x41')]['service']===_0x81ff('0x3f')&&_0x256159[_0x81ff('0x41')]['data3']){_0x256159['body'][_0x81ff('0x38')]=encryptor[_0x81ff('0x48')](_0x256159[_0x81ff('0x41')][_0x81ff('0x38')]);}return db[_0x81ff('0x1e')][_0x81ff('0x40')](_0x256159[_0x81ff('0x41')],{})[_0x81ff('0x17')](respondWithResult(_0x1bbd2d,0xc9))['catch'](handleError(_0x1bbd2d,null));};exports[_0x81ff('0x15')]=function(_0xa60f67,_0x6af4de){if(_0xa60f67['body']['id']){delete _0xa60f67[_0x81ff('0x41')]['id'];}return db[_0x81ff('0x1e')]['find']({'where':{'id':_0xa60f67['params']['id']}})[_0x81ff('0x17')](handleEntityNotFound(_0x6af4de,null))[_0x81ff('0x17')](function(_0x8eb2f4){if(_0x8eb2f4['service']===_0x81ff('0x3f')&&_0xa60f67[_0x81ff('0x41')][_0x81ff('0x38')]){_0xa60f67[_0x81ff('0x41')][_0x81ff('0x38')]=encryptor[_0x81ff('0x48')](_0xa60f67[_0x81ff('0x41')]['data3']);}return _0x8eb2f4;})[_0x81ff('0x17')](saveUpdates(_0xa60f67[_0x81ff('0x41')],null))[_0x81ff('0x17')](respondWithResult(_0x6af4de,null))[_0x81ff('0x39')](handleError(_0x6af4de,null));};exports[_0x81ff('0x16')]=function(_0x238276,_0x4ef55c){return db[_0x81ff('0x1e')][_0x81ff('0x3e')]({'where':{'id':_0x238276[_0x81ff('0x3b')]['id']}})[_0x81ff('0x17')](handleEntityNotFound(_0x4ef55c,null))['then'](removeEntity(_0x4ef55c,null))[_0x81ff('0x39')](handleError(_0x4ef55c,null));};exports[_0x81ff('0x49')]=function(_0x265798,_0x5f7337){return db[_0x81ff('0x1e')][_0x81ff('0x4a')]({'where':{'id':_0x265798['params']['id']},'raw':!![]})[_0x81ff('0x17')](function(_0x3fe019){if(!_0x3fe019)return _0x5f7337[_0x81ff('0xc')](0x194);return{'url':oauth[_0x81ff('0x4b')](_0x3fe019,_0x265798[_0x81ff('0x4c')]['id'])};})['then'](respondWithResult(_0x5f7337,null))[_0x81ff('0x39')](handleError(_0x5f7337,null));};exports[_0x81ff('0x4d')]=function(_0x383105,_0x334410){var _0x472c68=_0x383105[_0x81ff('0x41')];var _0x2e183a;var _0x1f0fc6;if(_0x472c68['error'])throw _0x472c68;redis[_0x81ff('0x4e')](_0x472c68[_0x81ff('0x4f')])[_0x81ff('0x17')](function(_0xe5cf55){if(!_0xe5cf55)throw new Error(_0x81ff('0x50'));_0x2e183a=JSON[_0x81ff('0x51')](_0xe5cf55);var _0x20cfa5=Buffer[_0x81ff('0x52')](_0x472c68[_0x81ff('0x4f')],'base64')['toString'](_0x81ff('0x53'));_0x1f0fc6=JSON[_0x81ff('0x51')](_0x20cfa5);if(!oauth['isValidIdToken'](_0x472c68['id_token'],_0x2e183a['oauth2Claims']))throw new Error(_0x81ff('0x54'));redis['del'](_0x472c68['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x472c68[_0x81ff('0x55')],_0x2e183a);})['then'](function(_0x15355b){_0x2e183a[_0x81ff('0x56')]=_0x15355b['access_token'];_0x2e183a[_0x81ff('0x57')]=_0x15355b['refresh_token'];return db[_0x81ff('0x1e')]['update']({'data5':_0x2e183a[_0x81ff('0x56')],'data6':_0x2e183a['data6']},{'where':{'id':_0x2e183a['id']}});})[_0x81ff('0x17')](function(){oauth[_0x81ff('0x58')](_0x2e183a);socket['emit'](_0x81ff('0x59'),{'id':_0x1f0fc6['id']});return;})['then'](respondWithStatusCode(_0x334410,null))[_0x81ff('0x39')](function(_0x5517a0){if(_0x1f0fc6){socket[_0x81ff('0x5a')](_0x81ff('0x5b'),{'id':_0x1f0fc6['id']});}if(!_0x2e183a){logger['error'](_0x81ff('0x5c'),_0x5517a0);return _0x334410['status'](0x1f4)['send'](_0x5517a0['message']);}logger['error'](_0x81ff('0x5d'),_0x2e183a['id'],JSON[_0x81ff('0x5e')](_0x5517a0));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 7774a25..078355c 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 _0xefe3=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash'];(function(_0x552bd8,_0x4f6540){var _0x52fbce=function(_0x1c4cb1){while(--_0x1c4cb1){_0x552bd8['push'](_0x552bd8['shift']());}};_0x52fbce(++_0x4f6540);}(_0xefe3,0x192));var _0x3efe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xefe3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3efe('0x0'));var util=require(_0x3efe('0x1'));var logger=require(_0x3efe('0x2'))(_0x3efe('0x3'));var moment=require('moment');var BPromise=require(_0x3efe('0x4'));var rp=require(_0x3efe('0x5'));var fs=require('fs');var path=require(_0x3efe('0x6'));var rimraf=require(_0x3efe('0x7'));var config=require(_0x3efe('0x8'));var attributes=require(_0x3efe('0x9'));module[_0x3efe('0xa')]=function(_0x9e9697,_0x5404c0){return _0x9e9697[_0x3efe('0xb')](_0x3efe('0xc'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5adb=['api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','define','CloudProvider','lodash','util','../../config/logger'];(function(_0x38a155,_0x2aa026){var _0x269403=function(_0x47263b){while(--_0x47263b){_0x38a155['push'](_0x38a155['shift']());}};_0x269403(++_0x2aa026);}(_0x5adb,0x135));var _0xb5ad=function(_0x248a43,_0x59e52a){_0x248a43=_0x248a43-0x0;var _0x451379=_0x5adb[_0x248a43];return _0x451379;};'use strict';var _=require(_0xb5ad('0x0'));var util=require(_0xb5ad('0x1'));var logger=require(_0xb5ad('0x2'))(_0xb5ad('0x3'));var moment=require(_0xb5ad('0x4'));var BPromise=require(_0xb5ad('0x5'));var rp=require(_0xb5ad('0x6'));var fs=require('fs');var path=require(_0xb5ad('0x7'));var rimraf=require('rimraf');var config=require(_0xb5ad('0x8'));var attributes=require(_0xb5ad('0x9'));module['exports']=function(_0x2fc5ec,_0x1148ce){return _0x2fc5ec[_0xb5ad('0xa')](_0xb5ad('0xb'),attributes,{'tableName':'cloud_providers','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 b529d51..0537359 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 _0xbc8a=['resolve','data3','then','refresh_token','data6','POST','access_token','update','data5','catch','error','authorization_code','decryptString','intervals','bind','findAll','all','inspect','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','Dynamics365','/.default','join','Outlook365','data7','replace','data2','id_token','stringify','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','audience','isAfter','unix','exp'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0xbc8a,0x193));var _0xabc8=function(_0x7d4593,_0xd66d60){_0x7d4593=_0x7d4593-0x0;var _0x440c23=_0xbc8a[_0x7d4593];return _0x440c23;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0xabc8('0x0'));var moment=require(_0xabc8('0x1'));var Redis=require(_0xabc8('0x2'));var rp=require('request-promise');var util=require(_0xabc8('0x3'));var encryptor=require(_0xabc8('0x4'));var config=require(_0xabc8('0x5'));var logger=require(_0xabc8('0x6'))(_0xabc8('0x7'));var schedule=require(_0xabc8('0x8'));var db=require(_0xabc8('0x9'))['db'];config[_0xabc8('0xa')]=_[_0xabc8('0xb')](config[_0xabc8('0xa')],{'host':_0xabc8('0xc'),'port':0x18eb});var redis=new Redis(config[_0xabc8('0xa')]);var MICROSOFT_AUTH_URL=_0xabc8('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xabc8('0xe'),_0xabc8('0xf'),_0xabc8('0x10'),_0xabc8('0x11'),_0xabc8('0x12'),_0xabc8('0x13'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xabc8('0xe'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xabc8('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0xabc8('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1b6925){var _0x5b2ba8=_[_0xabc8('0x16')](AZURE_AUTH_SCOPES[_0x1b6925[_0xabc8('0x17')]]);if(_0x1b6925[_0xabc8('0x17')]===_0xabc8('0x18'))_0x5b2ba8['push'](_0x1b6925['data7']+_0xabc8('0x19'));return _0x5b2ba8[_0xabc8('0x1a')]('\x20');}function getAccessTokenScope(_0x5ed373){if(_0x5ed373[_0xabc8('0x17')]===_0xabc8('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x5ed373[_0xabc8('0x17')]==='Dynamics365')return _0x5ed373[_0xabc8('0x1c')]+_0xabc8('0x19');}function generateMicrosoftAuthorizationUrl(_0x2af3a5,_0x42f029){var _0x459ba9=MICROSOFT_AUTH_URL[_0xabc8('0x1d')]('{TENANT_ID}',_0x2af3a5[_0xabc8('0x1e')]);var _0x56ddc4=['code',_0xabc8('0x1f')];var _0x463bd=Buffer['from'](JSON[_0xabc8('0x20')]({'id':_0x42f029}))['toString'](_0xabc8('0x21'));var _0x47ba25=crypto[_0xabc8('0x22')](0x10)['toString'](_0xabc8('0x23'));var _0x218df9=getAuthorizationScopes(_0x2af3a5);var _0xf67b2c=[{'key':_0xabc8('0x24'),'value':_0x2af3a5[_0xabc8('0x25')]},{'key':_0xabc8('0x26'),'value':encodeURIComponent(_0x56ddc4[_0xabc8('0x1a')]('\x20'))},{'key':_0xabc8('0x27'),'value':_0x2af3a5[_0xabc8('0x28')]},{'key':_0xabc8('0x29'),'value':_0xabc8('0x2a')},{'key':_0xabc8('0x2b'),'value':encodeURIComponent(_0x218df9)},{'key':_0xabc8('0x2c'),'value':_0x463bd},{'key':_0xabc8('0x2d'),'value':_0x47ba25},{'key':_0xabc8('0x2e'),'value':_0xabc8('0x2f')}];var _0xcd4e94=_0x459ba9+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xabc8('0x16')](_0xf67b2c,function(_0x370135){return _0x370135['key']+'='+_0x370135['value'];})[_0xabc8('0x1a')]('&');_0x2af3a5[_0xabc8('0x30')]={'issuer':_0x459ba9[_0xabc8('0x1d')](_0xabc8('0x31'),''),'audience':_0x2af3a5[_0xabc8('0x25')],'state':_0x463bd,'nonce':_0x47ba25};redis[_0xabc8('0x32')](_0x463bd,JSON[_0xabc8('0x20')](_0x2af3a5));return _0xcd4e94;}function isValidIdToken(_0x4a114f,_0x5e54dd){try{var _0x34a7c1=jwt[_0xabc8('0x33')](_0x4a114f,{'complete':!![]});var _0x3b3d8d=_0x34a7c1[_0xabc8('0x34')];if(_0x3b3d8d[_0xabc8('0x35')]!==_0x5e54dd[_0xabc8('0x36')])return![];if(_0x3b3d8d['aud']!==_0x5e54dd[_0xabc8('0x37')])return![];if(_0x3b3d8d[_0xabc8('0x2d')]!==_0x5e54dd[_0xabc8('0x2d')])return![];if(moment()[_0xabc8('0x38')](moment[_0xabc8('0x39')](_0x3b3d8d[_0xabc8('0x3a')])))return![];return!![];}catch(_0x4d2895){throw _0x4d2895;}}function refreshOauth2MicrosoftAccessToken(_0x2be4e0){return Promise[_0xabc8('0x3b')]()['then'](function(){if(_0x2be4e0[_0xabc8('0x3c')])return _0x2be4e0;return db['CloudProvider']['findOne']({'where':{'id':_0x2be4e0['id']},'raw':!![]});})[_0xabc8('0x3d')](function(_0x2e9813){var _0x2e8195={'grant_type':_0xabc8('0x3e'),'refresh_token':_0x2e9813[_0xabc8('0x3f')],'scope':getAccessTokenScope(_0x2e9813),'redirect_uri':_0x2e9813[_0xabc8('0x28')],'client_id':_0x2e9813[_0xabc8('0x25')],'client_secret':encryptor['decryptString'](_0x2e9813[_0xabc8('0x3c')])};var _0xf8a2d3={'method':_0xabc8('0x40'),'uri':MICROSOFT_AUTH_URL[_0xabc8('0x1d')]('{TENANT_ID}',_0x2e9813[_0xabc8('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2e8195,'json':!![]};return rp(_0xf8a2d3);})['then'](function(_0x152451){_0x2be4e0['data5']=_0x152451[_0xabc8('0x41')];_0x2be4e0[_0xabc8('0x3f')]=_0x152451[_0xabc8('0x3e')];return db['CloudProvider'][_0xabc8('0x42')]({'data5':_0x2be4e0[_0xabc8('0x43')],'data6':_0x2be4e0['data6']},{'where':{'id':_0x2be4e0['id']}});})['then'](function(){return _0x2be4e0;})[_0xabc8('0x44')](function(_0x31bd6){logger[_0xabc8('0x45')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x2be4e0['id'],_0x31bd6);});}function getOauth2MicrosoftAccessToken(_0xd4cdd1,_0x428315){var _0x10b816={'grant_type':_0xabc8('0x46'),'code':_0xd4cdd1,'scope':getAccessTokenScope(_0x428315),'redirect_uri':_0x428315[_0xabc8('0x28')],'client_id':_0x428315[_0xabc8('0x25')],'client_secret':encryptor[_0xabc8('0x47')](_0x428315['data3'])};var _0x3d66b3={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xabc8('0x1d')]('{TENANT_ID}',_0x428315[_0xabc8('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x10b816,'json':!![]};return rp(_0x3d66b3);}function startRefreshInterval(_0x326ce2){var _0x59c82d=schedule[_0xabc8('0x48')];if(_0x59c82d[_0x326ce2['id']])clearInterval(_0x59c82d[_0x326ce2['id']]);_0x59c82d[_0x326ce2['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xabc8('0x49')](this,{'id':_0x326ce2['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xabc8('0x48')]=_0x59c82d;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xabc8('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xabc8('0x3d')](function(_0x339fde){var _0x31932f=_0x339fde[_0xabc8('0x16')](function(_0x514ac7){return refreshOauth2MicrosoftAccessToken(_0x514ac7)[_0xabc8('0x3d')](function(_0x3d7891){startRefreshInterval(_0x3d7891);});});return Promise[_0xabc8('0x4b')](_0x31932f);})['catch'](function(_0x182680){var _0x4ce0d1=_0x182680?util[_0xabc8('0x4c')](_0x182680,{'showHidden':![],'depth':null}):'';logger[_0xabc8('0x45')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4ce0d1);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xd6b5=['../../components/encryptor','../../config/environment','../../config/schedule/cloud-provider','../../mysqldb','redis','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','push','data7','join','/.default','replace','{TENANT_ID}','data2','from','stringify','toString','base64','hex','data1','redirect_uri','data4','response_mode','form_post','state','nonce','login','key','value','oauth2Claims','oauth2/','set','decode','iss','issuer','aud','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','data5','access_token','data6','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken'];(function(_0x414810,_0x5e924d){var _0x2d4df5=function(_0x390860){while(--_0x390860){_0x414810['push'](_0x414810['shift']());}};_0x2d4df5(++_0x5e924d);}(_0xd6b5,0x1e0));var _0x5d6b=function(_0x3959b8,_0x6ac695){_0x3959b8=_0x3959b8-0x0;var _0x1bc7cb=_0xd6b5[_0x3959b8];return _0x1bc7cb;};'use strict';var _=require(_0x5d6b('0x0'));var crypto=require(_0x5d6b('0x1'));var jwt=require(_0x5d6b('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require(_0x5d6b('0x3'));var config=require(_0x5d6b('0x4'));var logger=require('../../config/logger')('api');var schedule=require(_0x5d6b('0x5'));var db=require(_0x5d6b('0x6'))['db'];config['redis']=_['defaults'](config[_0x5d6b('0x7')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x5d6b('0x7')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x5d6b('0x8'),_0x5d6b('0x9'),_0x5d6b('0xa'),_0x5d6b('0xb'),_0x5d6b('0xc'),_0x5d6b('0xd'),_0x5d6b('0xe')],'Dynamics365':[_0x5d6b('0x8'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x5d6b('0xf');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3824f2){var _0xd83209=_[_0x5d6b('0x10')](AZURE_AUTH_SCOPES[_0x3824f2[_0x5d6b('0x11')]]);if(_0x3824f2[_0x5d6b('0x11')]==='Dynamics365')_0xd83209[_0x5d6b('0x12')](_0x3824f2[_0x5d6b('0x13')]+'/.default');return _0xd83209[_0x5d6b('0x14')]('\x20');}function getAccessTokenScope(_0xf4785){if(_0xf4785['type']==='Outlook365')return _0x5d6b('0xc');if(_0xf4785['type']==='Dynamics365')return _0xf4785[_0x5d6b('0x13')]+_0x5d6b('0x15');}function generateMicrosoftAuthorizationUrl(_0x20a1b9,_0x79ad2d){var _0x32c4d0=MICROSOFT_AUTH_URL[_0x5d6b('0x16')](_0x5d6b('0x17'),_0x20a1b9[_0x5d6b('0x18')]);var _0x44b290=['code','id_token'];var _0x5cd1c1=Buffer[_0x5d6b('0x19')](JSON[_0x5d6b('0x1a')]({'id':_0x79ad2d}))[_0x5d6b('0x1b')](_0x5d6b('0x1c'));var _0x226bf4=crypto['randomBytes'](0x10)[_0x5d6b('0x1b')](_0x5d6b('0x1d'));var _0x2cf7b2=getAuthorizationScopes(_0x20a1b9);var _0x539d07=[{'key':'client_id','value':_0x20a1b9[_0x5d6b('0x1e')]},{'key':'response_type','value':encodeURIComponent(_0x44b290[_0x5d6b('0x14')]('\x20'))},{'key':_0x5d6b('0x1f'),'value':_0x20a1b9[_0x5d6b('0x20')]},{'key':_0x5d6b('0x21'),'value':_0x5d6b('0x22')},{'key':'scope','value':encodeURIComponent(_0x2cf7b2)},{'key':_0x5d6b('0x23'),'value':_0x5cd1c1},{'key':_0x5d6b('0x24'),'value':_0x226bf4},{'key':'prompt','value':_0x5d6b('0x25')}];var _0x29d996=_0x32c4d0+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x5d6b('0x10')](_0x539d07,function(_0x1b7e9d){return _0x1b7e9d[_0x5d6b('0x26')]+'='+_0x1b7e9d[_0x5d6b('0x27')];})[_0x5d6b('0x14')]('&');_0x20a1b9[_0x5d6b('0x28')]={'issuer':_0x32c4d0[_0x5d6b('0x16')](_0x5d6b('0x29'),''),'audience':_0x20a1b9[_0x5d6b('0x1e')],'state':_0x5cd1c1,'nonce':_0x226bf4};redis[_0x5d6b('0x2a')](_0x5cd1c1,JSON['stringify'](_0x20a1b9));return _0x29d996;}function isValidIdToken(_0x142fb4,_0x4e1b2a){try{var _0x273fee=jwt[_0x5d6b('0x2b')](_0x142fb4,{'complete':!![]});var _0x18677b=_0x273fee['payload'];if(_0x18677b[_0x5d6b('0x2c')]!==_0x4e1b2a[_0x5d6b('0x2d')])return![];if(_0x18677b[_0x5d6b('0x2e')]!==_0x4e1b2a['audience'])return![];if(_0x18677b[_0x5d6b('0x24')]!==_0x4e1b2a[_0x5d6b('0x24')])return![];if(moment()['isAfter'](moment[_0x5d6b('0x2f')](_0x18677b[_0x5d6b('0x30')])))return![];return!![];}catch(_0x34665f){throw _0x34665f;}}function refreshOauth2MicrosoftAccessToken(_0x3cd577){return Promise[_0x5d6b('0x31')]()[_0x5d6b('0x32')](function(){if(_0x3cd577[_0x5d6b('0x33')])return _0x3cd577;return db[_0x5d6b('0x34')][_0x5d6b('0x35')]({'where':{'id':_0x3cd577['id']},'raw':!![]});})[_0x5d6b('0x32')](function(_0x198e64){var _0x4f4345={'grant_type':_0x5d6b('0x36'),'refresh_token':_0x198e64['data6'],'scope':getAccessTokenScope(_0x198e64),'redirect_uri':_0x198e64['data4'],'client_id':_0x198e64[_0x5d6b('0x1e')],'client_secret':encryptor[_0x5d6b('0x37')](_0x198e64[_0x5d6b('0x33')])};var _0x36ea97={'method':_0x5d6b('0x38'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x198e64['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4f4345,'json':!![]};return rp(_0x36ea97);})[_0x5d6b('0x32')](function(_0x2169fa){_0x3cd577[_0x5d6b('0x39')]=_0x2169fa[_0x5d6b('0x3a')];_0x3cd577[_0x5d6b('0x3b')]=_0x2169fa[_0x5d6b('0x36')];return db[_0x5d6b('0x34')]['update']({'data5':_0x3cd577['data5'],'data6':_0x3cd577['data6']},{'where':{'id':_0x3cd577['id']}});})[_0x5d6b('0x32')](function(){return _0x3cd577;})[_0x5d6b('0x3c')](function(_0x4d0aca){logger[_0x5d6b('0x3d')](_0x5d6b('0x3e'),_0x3cd577['id'],_0x4d0aca);});}function getOauth2MicrosoftAccessToken(_0x42e92d,_0x4511d3){var _0x4e051e={'grant_type':_0x5d6b('0x3f'),'code':_0x42e92d,'scope':getAccessTokenScope(_0x4511d3),'redirect_uri':_0x4511d3[_0x5d6b('0x20')],'client_id':_0x4511d3['data1'],'client_secret':encryptor[_0x5d6b('0x37')](_0x4511d3['data3'])};var _0xb8521b={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x5d6b('0x16')](_0x5d6b('0x17'),_0x4511d3['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4e051e,'json':!![]};return rp(_0xb8521b);}function startRefreshInterval(_0x3cf99e){var _0x44e2a7=schedule[_0x5d6b('0x40')];if(_0x44e2a7[_0x3cf99e['id']])clearInterval(_0x44e2a7[_0x3cf99e['id']]);_0x44e2a7[_0x3cf99e['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x3cf99e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x5d6b('0x40')]=_0x44e2a7;}function startAllRefreshIntervals(){return db[_0x5d6b('0x34')][_0x5d6b('0x41')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x5d6b('0x32')](function(_0x11d2e5){var _0x39c4b3=_0x11d2e5[_0x5d6b('0x10')](function(_0x3e964a){return refreshOauth2MicrosoftAccessToken(_0x3e964a)[_0x5d6b('0x32')](function(_0xf290ef){startRefreshInterval(_0xf290ef);});});return Promise[_0x5d6b('0x42')](_0x39c4b3);})[_0x5d6b('0x3c')](function(_0x2c726c){var _0x53a51e=_0x2c726c?util['inspect'](_0x2c726c,{'showHidden':![],'depth':null}):'';logger[_0x5d6b('0x3d')](_0x5d6b('0x43'),_0x53a51e);});}module[_0x5d6b('0x44')]={'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 989f201..d55b68c 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1b6db3,_0x26930b){var _0x38a71e=function(_0x21dddd){while(--_0x21dddd){_0x1b6db3['push'](_0x1b6db3['shift']());}};_0x38a71e(++_0x26930b);}(_0xadb5,0xad));var _0x5adb=function(_0x27f2f3,_0x8f117e){_0x27f2f3=_0x27f2f3-0x0;var _0x2890ba=_0xadb5[_0x27f2f3];return _0x2890ba;};'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']('CloudProvider,\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 _0x8cda=['../../config/environment','client','http','request','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa8cd('0x0'));var moment=require(_0xa8cd('0x1'));var BPromise=require(_0xa8cd('0x2'));var rs=require(_0xa8cd('0x3'));var fs=require('fs');var Redis=require(_0xa8cd('0x4'));var db=require(_0xa8cd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8cd('0x6'))(_0xa8cd('0x7'));var config=require(_0xa8cd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8cd('0x9')][_0xa8cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1362c3,_0x273d2f,_0x2b9b51){return new BPromise(function(_0x2481ba,_0x13f394){return client[_0xa8cd('0xb')](_0x1362c3,_0x2b9b51)['then'](function(_0x50b8ee){logger['info'](_0xa8cd('0xc'),_0x273d2f,'request\x20sent');logger[_0xa8cd('0xd')](_0xa8cd('0xe'),_0x273d2f,'request\x20sent',JSON[_0xa8cd('0xf')](_0x50b8ee));if(_0x50b8ee[_0xa8cd('0x10')]){if(_0x50b8ee['error']['code']===0x1f4){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x50b8ee[_0xa8cd('0x10')][_0xa8cd('0x11')]);return _0x13f394(_0x50b8ee[_0xa8cd('0x10')]['message']);}logger[_0xa8cd('0x10')]('CloudProvider,\x20%s,\x20%s',_0x273d2f,_0x50b8ee[_0xa8cd('0x10')]['message']);return _0x2481ba(_0x50b8ee[_0xa8cd('0x10')]['message']);}else{logger[_0xa8cd('0x12')](_0xa8cd('0xc'),_0x273d2f,_0xa8cd('0x13'));_0x2481ba(_0x50b8ee['result']['message']);}})[_0xa8cd('0x14')](function(_0x6d5f40){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x6d5f40);_0x13f394(_0x6d5f40);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 779072b..8ba7e5e 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x271051,_0x4f5b43){var _0x245193=function(_0x54bc54){while(--_0x54bc54){_0x271051['push'](_0x271051['shift']());}};_0x245193(++_0x4f5b43);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x2211ed,_0x1bca0b){var _0x4d78cc=function(_0x467b59){while(--_0x467b59){_0x2211ed['push'](_0x2211ed['shift']());}};_0x4d78cc(++_0x1bca0b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x255294,_0x2acf58){_0x255294=_0x255294-0x0;var _0x51d8c6=_0x5f2f[_0x255294];return _0x51d8c6;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index d0b9179..590bc4e 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 _0x4dc7=['STRING','name','sequelize','exports'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x4dc7,0x182));var _0x74dc=function(_0x55ce99,_0x158d8f){_0x55ce99=_0x55ce99-0x0;var _0x52bf95=_0x4dc7[_0x55ce99];return _0x52bf95;};'use strict';var Sequelize=require(_0x74dc('0x0'));module[_0x74dc('0x1')]={'name':{'type':Sequelize[_0x74dc('0x2')],'unique':_0x74dc('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x74dc('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x74dc('0x2')]},'fax':{'type':Sequelize[_0x74dc('0x2')]},'type':{'type':Sequelize[_0x74dc('0x2')]},'street':{'type':Sequelize[_0x74dc('0x2')]},'postalCode':{'type':Sequelize[_0x74dc('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x74dc('0x2')]},'email':{'type':Sequelize[_0x74dc('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x74dc('0x2')]},'sPostalCode':{'type':Sequelize[_0x74dc('0x2')]},'sCity':{'type':Sequelize[_0x74dc('0x2')]},'sCountry':{'type':Sequelize[_0x74dc('0x2')]},'description':{'type':Sequelize[_0x74dc('0x2')]}}; \ No newline at end of file +var _0x579d=['STRING','name','sequelize','exports'];(function(_0x4f6bdf,_0x5e68d3){var _0xaf2706=function(_0x378fcf){while(--_0x378fcf){_0x4f6bdf['push'](_0x4f6bdf['shift']());}};_0xaf2706(++_0x5e68d3);}(_0x579d,0x16a));var _0xd579=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x579d[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0xd579('0x0'));module[_0xd579('0x1')]={'name':{'type':Sequelize[_0xd579('0x2')],'unique':_0xd579('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd579('0x2')]},'companyId':{'type':Sequelize[_0xd579('0x2')]},'website':{'type':Sequelize[_0xd579('0x2')]},'phone':{'type':Sequelize[_0xd579('0x2')]},'fax':{'type':Sequelize[_0xd579('0x2')]},'type':{'type':Sequelize[_0xd579('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd579('0x2')]},'city':{'type':Sequelize[_0xd579('0x2')]},'country':{'type':Sequelize[_0xd579('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd579('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xd579('0x2')]},'description':{'type':Sequelize[_0xd579('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 70b45d8..8bd3158 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 _0xae32=['sort','where','filters','filter','merge','map','options','includeAll','include','CmCompany','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','ids','omit','getContacts','findOne','CmContact','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','name','send','index','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x1f7a7e,_0x3ac087){var _0x18f367=function(_0xd8ac2d){while(--_0xd8ac2d){_0x1f7a7e['push'](_0x1f7a7e['shift']());}};_0x18f367(++_0x3ac087);}(_0xae32,0x1e8));var _0x2ae3=function(_0x54c03a,_0x54f389){_0x54c03a=_0x54c03a-0x0;var _0x5c75d7=_0xae32[_0x54c03a];return _0x5c75d7;};'use strict';var emlformat=require(_0x2ae3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2ae3('0x1'));var jsonpatch=require(_0x2ae3('0x2'));var rp=require(_0x2ae3('0x3'));var moment=require(_0x2ae3('0x4'));var BPromise=require(_0x2ae3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2ae3('0x6'));var sox=require(_0x2ae3('0x7'));var csv=require(_0x2ae3('0x8'));var ejs=require(_0x2ae3('0x9'));var fs=require('fs');var fs_extra=require(_0x2ae3('0xa'));var _=require(_0x2ae3('0xb'));var squel=require(_0x2ae3('0xc'));var crypto=require(_0x2ae3('0xd'));var jsforce=require(_0x2ae3('0xe'));var deskjs=require(_0x2ae3('0xf'));var toCsv=require(_0x2ae3('0x8'));var querystring=require('querystring');var Papa=require(_0x2ae3('0x10'));var Redis=require(_0x2ae3('0x11'));var authService=require(_0x2ae3('0x12'));var qs=require(_0x2ae3('0x13'));var as=require(_0x2ae3('0x14'));var hardwareService=require(_0x2ae3('0x15'));var logger=require(_0x2ae3('0x16'))(_0x2ae3('0x17'));var utils=require(_0x2ae3('0x18'));var config=require(_0x2ae3('0x19'));var licenseUtil=require(_0x2ae3('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x275b4c,_0x589cac){_0x589cac=_0x589cac||0xcc;return function(_0x201e30){if(_0x201e30){return _0x275b4c[_0x2ae3('0x1b')](_0x589cac);}return _0x275b4c[_0x2ae3('0x1c')](_0x589cac)[_0x2ae3('0x1d')]();};}function respondWithResult(_0x5d4f52,_0x5d7b05){_0x5d7b05=_0x5d7b05||0xc8;return function(_0x51894f){if(_0x51894f){return _0x5d4f52['status'](_0x5d7b05)['json'](_0x51894f);}};}function respondWithFilteredResult(_0x376289,_0x45542c){return function(_0x12e912){if(_0x12e912){var _0x4b9be2=typeof _0x45542c[_0x2ae3('0x1e')]==='undefined'&&typeof _0x45542c[_0x2ae3('0x1f')]===_0x2ae3('0x20');var _0x13ae89=_0x12e912[_0x2ae3('0x21')];var _0x37723d=_0x4b9be2?0x0:_0x45542c['offset'];var _0x55fcf4=_0x4b9be2?_0x12e912[_0x2ae3('0x21')]:_0x45542c[_0x2ae3('0x1e')]+_0x45542c['limit'];var _0x5763f1;if(_0x55fcf4>=_0x13ae89){_0x55fcf4=_0x13ae89;_0x5763f1=0xc8;}else{_0x5763f1=0xce;}_0x376289[_0x2ae3('0x1c')](_0x5763f1);return _0x376289[_0x2ae3('0x22')](_0x2ae3('0x23'),_0x37723d+'-'+_0x55fcf4+'/'+_0x13ae89)['json'](_0x12e912);}return null;};}function patchUpdates(_0x2a2a22){return function(_0x4ae332){try{jsonpatch[_0x2ae3('0x24')](_0x4ae332,_0x2a2a22,!![]);}catch(_0x213537){return BPromise[_0x2ae3('0x25')](_0x213537);}return _0x4ae332[_0x2ae3('0x26')]();};}function saveUpdates(_0x185abc,_0xe0e8d1){return function(_0x54cc9f){if(_0x54cc9f){return _0x54cc9f[_0x2ae3('0x27')](_0x185abc)[_0x2ae3('0x28')](function(_0x2241e8){return _0x2241e8;});}return null;};}function removeEntity(_0x37c522,_0x367cca){return function(_0x152533){if(_0x152533){return _0x152533[_0x2ae3('0x29')]()[_0x2ae3('0x28')](function(){var _0x3037c4=_0x152533[_0x2ae3('0x2a')]({'plain':!![]});var _0x3400ed=_0x2ae3('0x2b');return db[_0x2ae3('0x2c')][_0x2ae3('0x29')]({'where':{'type':_0x3400ed,'resourceId':_0x3037c4['id']}})[_0x2ae3('0x28')](function(){return _0x152533;});})[_0x2ae3('0x28')](function(){_0x37c522[_0x2ae3('0x1c')](0xcc)[_0x2ae3('0x1d')]();});}};}function handleEntityNotFound(_0x5407c8,_0x5d90f3){return function(_0x5451df){if(!_0x5451df){_0x5407c8['sendStatus'](0x194);}return _0x5451df;};}function handleError(_0x11badd,_0x2f632f){_0x2f632f=_0x2f632f||0x1f4;return function(_0x4661b7){logger['error'](_0x4661b7['stack']);if(_0x4661b7[_0x2ae3('0x2d')]){delete _0x4661b7['name'];}_0x11badd[_0x2ae3('0x1c')](_0x2f632f)[_0x2ae3('0x2e')](_0x4661b7);};}exports[_0x2ae3('0x2f')]=function(_0x23425f,_0x44dd04){var _0xedd19e={},_0x474db4={},_0x48edcf={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x2ae3('0x28')](function(_0x889036){_0x474db4[_0x2ae3('0x30')]=_[_0x2ae3('0x31')](_0x889036);_0x474db4[_0x2ae3('0x32')]=_[_0x2ae3('0x31')](_0x23425f[_0x2ae3('0x32')]);_0x474db4['filters']=_[_0x2ae3('0x33')](_0x474db4[_0x2ae3('0x30')],_0x474db4[_0x2ae3('0x32')]);_0xedd19e[_0x2ae3('0x34')]=_[_0x2ae3('0x33')](_0x474db4[_0x2ae3('0x30')],qs[_0x2ae3('0x35')](_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x35')]));_0xedd19e['attributes']=_0xedd19e[_0x2ae3('0x34')][_0x2ae3('0x36')]?_0xedd19e[_0x2ae3('0x34')]:_0x474db4[_0x2ae3('0x30')];if(!_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x37')](_0x2ae3('0x38'))){_0xedd19e['limit']=qs[_0x2ae3('0x1f')](_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x1f')]);_0xedd19e[_0x2ae3('0x1e')]=qs[_0x2ae3('0x1e')](_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x1e')]);}_0xedd19e[_0x2ae3('0x39')]=qs[_0x2ae3('0x3a')](_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x3a')]);_0xedd19e[_0x2ae3('0x3b')]=qs[_0x2ae3('0x3c')](_['pick'](_0x23425f['query'],_0x474db4[_0x2ae3('0x3c')]),_0x889036);if(_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x3d')]){_0xedd19e['where']=_[_0x2ae3('0x3e')](_0xedd19e[_0x2ae3('0x3b')],{'$or':_[_0x2ae3('0x3f')](_0xedd19e['attributes'],function(_0x178dd6){var _0x37efe8={};_0x37efe8[_0x178dd6]={'$like':'%'+_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x3d')]+'%'};return _0x37efe8;})});}_0xedd19e=_[_0x2ae3('0x3e')]({},_0xedd19e,_0x23425f[_0x2ae3('0x40')]);var _0x1b9232={'where':_0xedd19e[_0x2ae3('0x3b')]};return db['CmCompany'][_0x2ae3('0x21')](_0x1b9232)[_0x2ae3('0x28')](function(_0x1fbe73){_0x48edcf[_0x2ae3('0x21')]=_0x1fbe73;if(_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x41')]){_0xedd19e[_0x2ae3('0x42')]=[{'all':!![]}];}return db[_0x2ae3('0x43')][_0x2ae3('0x44')](_0xedd19e);})[_0x2ae3('0x28')](function(_0x17e847){_0x48edcf[_0x2ae3('0x45')]=_0x17e847;return _0x48edcf;})['then'](respondWithFilteredResult(_0x44dd04,_0xedd19e))[_0x2ae3('0x46')](handleError(_0x44dd04,null));})[_0x2ae3('0x46')](handleError(_0x44dd04,null));};exports['show']=function(_0x3e6792,_0x1ac594){var _0xbebd28={'raw':![],'where':{'id':_0x3e6792[_0x2ae3('0x47')]['id']}},_0x4a694f={};_0x4a694f[_0x2ae3('0x30')]=_[_0x2ae3('0x31')](db[_0x2ae3('0x43')][_0x2ae3('0x48')]);_0x4a694f[_0x2ae3('0x32')]=_[_0x2ae3('0x31')](_0x3e6792['query']);_0x4a694f[_0x2ae3('0x3c')]=_[_0x2ae3('0x33')](_0x4a694f[_0x2ae3('0x30')],_0x4a694f[_0x2ae3('0x32')]);_0xbebd28[_0x2ae3('0x34')]=_[_0x2ae3('0x33')](_0x4a694f['model'],qs[_0x2ae3('0x35')](_0x3e6792['query'][_0x2ae3('0x35')]));_0xbebd28[_0x2ae3('0x34')]=_0xbebd28[_0x2ae3('0x34')][_0x2ae3('0x36')]?_0xbebd28[_0x2ae3('0x34')]:_0x4a694f[_0x2ae3('0x30')];if(_0x3e6792[_0x2ae3('0x32')][_0x2ae3('0x41')]){_0xbebd28['include']=[{'all':!![]}];}_0xbebd28=_[_0x2ae3('0x3e')]({},_0xbebd28,_0x3e6792[_0x2ae3('0x40')]);return db[_0x2ae3('0x43')][_0x2ae3('0x49')](_0xbebd28)[_0x2ae3('0x28')](handleEntityNotFound(_0x1ac594,null))[_0x2ae3('0x28')](respondWithResult(_0x1ac594,null))[_0x2ae3('0x46')](handleError(_0x1ac594,null));};exports[_0x2ae3('0x4a')]=function(_0x4dfcbe,_0x10cf5c){return db[_0x2ae3('0x43')][_0x2ae3('0x4a')](_0x4dfcbe[_0x2ae3('0x4b')],{})['then'](function(_0x41036d){var _0x5644d7=_0x4dfcbe[_0x2ae3('0x4c')][_0x2ae3('0x2a')]({'plain':!![]});if(!_0x5644d7)throw new Error(_0x2ae3('0x4d'));if(_0x5644d7[_0x2ae3('0x4e')]===_0x2ae3('0x4c')){var _0x4b6a37=_0x41036d[_0x2ae3('0x2a')]({'plain':!![]});var _0x2714f4=_0x2ae3('0x2b');return db[_0x2ae3('0x4f')]['find']({'where':{'name':_0x2714f4,'userProfileId':_0x5644d7[_0x2ae3('0x50')]},'raw':!![]})[_0x2ae3('0x28')](function(_0x207a84){if(_0x207a84&&_0x207a84['autoAssociation']===0x0){return db[_0x2ae3('0x2c')][_0x2ae3('0x4a')]({'name':_0x4b6a37[_0x2ae3('0x2d')],'resourceId':_0x4b6a37['id'],'type':_0x207a84[_0x2ae3('0x2d')],'sectionId':_0x207a84['id']},{})[_0x2ae3('0x28')](function(){return _0x41036d;});}else{return _0x41036d;}})['catch'](function(_0xfea3c6){logger[_0x2ae3('0x51')](_0x2ae3('0x52'),_0xfea3c6);throw _0xfea3c6;});}return _0x41036d;})[_0x2ae3('0x28')](respondWithResult(_0x10cf5c,0xc9))[_0x2ae3('0x46')](handleError(_0x10cf5c,null));};exports[_0x2ae3('0x27')]=function(_0x4b6d23,_0x2f3b7e){if(_0x4b6d23[_0x2ae3('0x4b')]['id']){delete _0x4b6d23[_0x2ae3('0x4b')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x4b6d23[_0x2ae3('0x47')]['id']}})[_0x2ae3('0x28')](handleEntityNotFound(_0x2f3b7e,null))[_0x2ae3('0x28')](saveUpdates(_0x4b6d23[_0x2ae3('0x4b')],null))['then'](respondWithResult(_0x2f3b7e,null))[_0x2ae3('0x46')](handleError(_0x2f3b7e,null));};exports[_0x2ae3('0x29')]=function(_0x220088,_0x35d798){return db[_0x2ae3('0x43')][_0x2ae3('0x49')]({'where':{'id':_0x220088[_0x2ae3('0x47')]['id']}})[_0x2ae3('0x28')](handleEntityNotFound(_0x35d798,null))[_0x2ae3('0x28')](removeEntity(_0x35d798,null))[_0x2ae3('0x46')](handleError(_0x35d798,null));};exports['describe']=function(_0x226ad8,_0x49d1e7){return db['CmCompany'][_0x2ae3('0x53')]()[_0x2ae3('0x28')](respondWithResult(_0x49d1e7,null))[_0x2ae3('0x46')](handleError(_0x49d1e7,null));};exports['addContacts']=function(_0x6c5e76,_0x14f93a,_0x580470){return db['CmContact'][_0x2ae3('0x49')]({'where':{'id':_0x6c5e76[_0x2ae3('0x47')]['id']}})[_0x2ae3('0x28')](handleEntityNotFound(_0x14f93a,null))[_0x2ae3('0x28')](function(_0x50eeab){if(_0x50eeab){return _0x50eeab[_0x2ae3('0x54')](_0x6c5e76[_0x2ae3('0x4b')][_0x2ae3('0x55')],_[_0x2ae3('0x56')](_0x6c5e76[_0x2ae3('0x4b')],[_0x2ae3('0x55'),'id'])||{});}})[_0x2ae3('0x28')](respondWithResult(_0x14f93a,null))['catch'](handleError(_0x14f93a,null));};exports[_0x2ae3('0x57')]=function(_0x21cd11,_0x45ec91,_0x341f98){var _0x34646b={};var _0x5ab8ff={};var _0x593e0e;var _0x47f47a;return db[_0x2ae3('0x43')][_0x2ae3('0x58')]({'where':{'id':_0x21cd11['params']['id']}})[_0x2ae3('0x28')](handleEntityNotFound(_0x45ec91,null))['then'](function(_0x7a7ede){if(_0x7a7ede){_0x593e0e=_0x7a7ede;_0x5ab8ff[_0x2ae3('0x30')]=_[_0x2ae3('0x31')](db[_0x2ae3('0x59')][_0x2ae3('0x48')]);_0x5ab8ff[_0x2ae3('0x32')]=_[_0x2ae3('0x31')](_0x21cd11[_0x2ae3('0x32')]);_0x5ab8ff[_0x2ae3('0x3c')]=_['intersection'](_0x5ab8ff[_0x2ae3('0x30')],_0x5ab8ff[_0x2ae3('0x32')]);_0x34646b[_0x2ae3('0x34')]=_['intersection'](_0x5ab8ff[_0x2ae3('0x30')],qs[_0x2ae3('0x35')](_0x21cd11[_0x2ae3('0x32')][_0x2ae3('0x35')]));_0x34646b[_0x2ae3('0x34')]=_0x34646b[_0x2ae3('0x34')][_0x2ae3('0x36')]?_0x34646b[_0x2ae3('0x34')]:_0x5ab8ff[_0x2ae3('0x30')];_0x34646b['order']=qs[_0x2ae3('0x3a')](_0x21cd11[_0x2ae3('0x32')][_0x2ae3('0x3a')]);_0x34646b[_0x2ae3('0x3b')]=qs['filters'](_[_0x2ae3('0x5a')](_0x21cd11[_0x2ae3('0x32')],_0x5ab8ff[_0x2ae3('0x3c')]));if(_0x21cd11[_0x2ae3('0x32')][_0x2ae3('0x3d')]){_0x34646b[_0x2ae3('0x3b')]=_[_0x2ae3('0x3e')](_0x34646b[_0x2ae3('0x3b')],{'$or':_[_0x2ae3('0x3f')](_0x34646b[_0x2ae3('0x34')],function(_0x410f60){var _0x1079d0={};_0x1079d0[_0x410f60]={'$like':'%'+_0x21cd11[_0x2ae3('0x32')]['filter']+'%'};return _0x1079d0;})});}_0x34646b=_[_0x2ae3('0x3e')]({},_0x34646b,_0x21cd11[_0x2ae3('0x40')]);return _0x593e0e['getContacts'](_0x34646b);}})['then'](function(_0x40df5b){if(_0x40df5b){_0x47f47a=_0x40df5b[_0x2ae3('0x36')];if(!_0x21cd11[_0x2ae3('0x32')][_0x2ae3('0x37')](_0x2ae3('0x38'))){_0x34646b[_0x2ae3('0x1f')]=qs[_0x2ae3('0x1f')](_0x21cd11['query']['limit']);_0x34646b[_0x2ae3('0x1e')]=qs['offset'](_0x21cd11[_0x2ae3('0x32')][_0x2ae3('0x1e')]);}return _0x593e0e[_0x2ae3('0x57')](_0x34646b);}})['then'](function(_0x3bf098){if(_0x3bf098){return _0x3bf098?{'count':_0x47f47a,'rows':_0x3bf098}:null;}})['then'](respondWithResult(_0x45ec91,null))['catch'](handleError(_0x45ec91,null));}; \ No newline at end of file +var _0xc78d=['ids','getContacts','findOne','CmContact','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','then','destroy','get','sendStatus','error','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','options','CmCompany','includeAll','findAll','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addContacts','omit'];(function(_0x272ea6,_0x3f0673){var _0x43ef03=function(_0x2307e2){while(--_0x2307e2){_0x272ea6['push'](_0x272ea6['shift']());}};_0x43ef03(++_0x3f0673);}(_0xc78d,0xfd));var _0xdc78=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc78d[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xdc78('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdc78('0x1'));var rp=require('request-promise');var moment=require(_0xdc78('0x2'));var BPromise=require(_0xdc78('0x3'));var Mustache=require(_0xdc78('0x4'));var util=require(_0xdc78('0x5'));var path=require('path');var sox=require(_0xdc78('0x6'));var csv=require('to-csv');var ejs=require(_0xdc78('0x7'));var fs=require('fs');var fs_extra=require(_0xdc78('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdc78('0x9'));var jsforce=require(_0xdc78('0xa'));var deskjs=require(_0xdc78('0xb'));var toCsv=require(_0xdc78('0xc'));var querystring=require(_0xdc78('0xd'));var Papa=require(_0xdc78('0xe'));var Redis=require('ioredis');var authService=require(_0xdc78('0xf'));var qs=require(_0xdc78('0x10'));var as=require(_0xdc78('0x11'));var hardwareService=require(_0xdc78('0x12'));var logger=require(_0xdc78('0x13'))(_0xdc78('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdc78('0x15'));var db=require(_0xdc78('0x16'))['db'];function respondWithStatusCode(_0x281911,_0x56c003){_0x56c003=_0x56c003||0xcc;return function(_0x2bec3d){if(_0x2bec3d){return _0x281911['sendStatus'](_0x56c003);}return _0x281911[_0xdc78('0x17')](_0x56c003)[_0xdc78('0x18')]();};}function respondWithResult(_0x7df72d,_0x35a281){_0x35a281=_0x35a281||0xc8;return function(_0x1252c0){if(_0x1252c0){return _0x7df72d[_0xdc78('0x17')](_0x35a281)[_0xdc78('0x19')](_0x1252c0);}};}function respondWithFilteredResult(_0x4d3c82,_0x3f3347){return function(_0x11208b){if(_0x11208b){var _0x29abbb=typeof _0x3f3347[_0xdc78('0x1a')]==='undefined'&&typeof _0x3f3347[_0xdc78('0x1b')]===_0xdc78('0x1c');var _0x461cc0=_0x11208b['count'];var _0x2c5d80=_0x29abbb?0x0:_0x3f3347[_0xdc78('0x1a')];var _0x318048=_0x29abbb?_0x11208b[_0xdc78('0x1d')]:_0x3f3347['offset']+_0x3f3347[_0xdc78('0x1b')];var _0x3b9a57;if(_0x318048>=_0x461cc0){_0x318048=_0x461cc0;_0x3b9a57=0xc8;}else{_0x3b9a57=0xce;}_0x4d3c82[_0xdc78('0x17')](_0x3b9a57);return _0x4d3c82['set'](_0xdc78('0x1e'),_0x2c5d80+'-'+_0x318048+'/'+_0x461cc0)[_0xdc78('0x19')](_0x11208b);}return null;};}function patchUpdates(_0x2d4bd7){return function(_0x123799){try{jsonpatch[_0xdc78('0x1f')](_0x123799,_0x2d4bd7,!![]);}catch(_0x224018){return BPromise[_0xdc78('0x20')](_0x224018);}return _0x123799['save']();};}function saveUpdates(_0x53c006,_0x40068f){return function(_0x3bce37){if(_0x3bce37){return _0x3bce37['update'](_0x53c006)[_0xdc78('0x21')](function(_0x52c206){return _0x52c206;});}return null;};}function removeEntity(_0x2a0df0,_0x715d32){return function(_0x125f97){if(_0x125f97){return _0x125f97[_0xdc78('0x22')]()[_0xdc78('0x21')](function(){var _0x10b558=_0x125f97[_0xdc78('0x23')]({'plain':!![]});var _0x5c3f6a='Companies';return db['UserProfileResource']['destroy']({'where':{'type':_0x5c3f6a,'resourceId':_0x10b558['id']}})[_0xdc78('0x21')](function(){return _0x125f97;});})[_0xdc78('0x21')](function(){_0x2a0df0[_0xdc78('0x17')](0xcc)[_0xdc78('0x18')]();});}};}function handleEntityNotFound(_0x5eff82,_0x945029){return function(_0x396623){if(!_0x396623){_0x5eff82[_0xdc78('0x24')](0x194);}return _0x396623;};}function handleError(_0x27b51d,_0x1c5731){_0x1c5731=_0x1c5731||0x1f4;return function(_0x34aa59){logger[_0xdc78('0x25')](_0x34aa59[_0xdc78('0x26')]);if(_0x34aa59[_0xdc78('0x27')]){delete _0x34aa59[_0xdc78('0x27')];}_0x27b51d[_0xdc78('0x17')](_0x1c5731)[_0xdc78('0x28')](_0x34aa59);};}exports[_0xdc78('0x29')]=function(_0x186dac,_0x3ea4a4){var _0xf040f5={},_0x2721c2={},_0x1b0456={'count':0x0,'rows':[]};return db['CmCompany']['describe']()['then'](function(_0x2a73fa){_0x2721c2[_0xdc78('0x2a')]=_[_0xdc78('0x2b')](_0x2a73fa);_0x2721c2[_0xdc78('0x2c')]=_[_0xdc78('0x2b')](_0x186dac[_0xdc78('0x2c')]);_0x2721c2[_0xdc78('0x2d')]=_[_0xdc78('0x2e')](_0x2721c2[_0xdc78('0x2a')],_0x2721c2[_0xdc78('0x2c')]);_0xf040f5[_0xdc78('0x2f')]=_['intersection'](_0x2721c2[_0xdc78('0x2a')],qs[_0xdc78('0x30')](_0x186dac[_0xdc78('0x2c')][_0xdc78('0x30')]));_0xf040f5['attributes']=_0xf040f5['attributes'][_0xdc78('0x31')]?_0xf040f5[_0xdc78('0x2f')]:_0x2721c2['model'];if(!_0x186dac[_0xdc78('0x2c')]['hasOwnProperty'](_0xdc78('0x32'))){_0xf040f5['limit']=qs[_0xdc78('0x1b')](_0x186dac[_0xdc78('0x2c')][_0xdc78('0x1b')]);_0xf040f5[_0xdc78('0x1a')]=qs['offset'](_0x186dac[_0xdc78('0x2c')]['offset']);}_0xf040f5[_0xdc78('0x33')]=qs['sort'](_0x186dac[_0xdc78('0x2c')][_0xdc78('0x34')]);_0xf040f5['where']=qs['filters'](_[_0xdc78('0x35')](_0x186dac[_0xdc78('0x2c')],_0x2721c2[_0xdc78('0x2d')]),_0x2a73fa);if(_0x186dac[_0xdc78('0x2c')][_0xdc78('0x36')]){_0xf040f5[_0xdc78('0x37')]=_[_0xdc78('0x38')](_0xf040f5[_0xdc78('0x37')],{'$or':_[_0xdc78('0x39')](_0xf040f5['attributes'],function(_0x23416f){var _0x831a4d={};_0x831a4d[_0x23416f]={'$like':'%'+_0x186dac[_0xdc78('0x2c')][_0xdc78('0x36')]+'%'};return _0x831a4d;})});}_0xf040f5=_[_0xdc78('0x38')]({},_0xf040f5,_0x186dac[_0xdc78('0x3a')]);var _0x9c2cca={'where':_0xf040f5[_0xdc78('0x37')]};return db[_0xdc78('0x3b')][_0xdc78('0x1d')](_0x9c2cca)[_0xdc78('0x21')](function(_0x40ce50){_0x1b0456[_0xdc78('0x1d')]=_0x40ce50;if(_0x186dac[_0xdc78('0x2c')][_0xdc78('0x3c')]){_0xf040f5['include']=[{'all':!![]}];}return db['CmCompany'][_0xdc78('0x3d')](_0xf040f5);})[_0xdc78('0x21')](function(_0x71f42){_0x1b0456['rows']=_0x71f42;return _0x1b0456;})[_0xdc78('0x21')](respondWithFilteredResult(_0x3ea4a4,_0xf040f5))['catch'](handleError(_0x3ea4a4,null));})[_0xdc78('0x3e')](handleError(_0x3ea4a4,null));};exports[_0xdc78('0x3f')]=function(_0x334cb8,_0x5550c7){var _0x316121={'raw':![],'where':{'id':_0x334cb8[_0xdc78('0x40')]['id']}},_0x595175={};_0x595175[_0xdc78('0x2a')]=_[_0xdc78('0x2b')](db[_0xdc78('0x3b')][_0xdc78('0x41')]);_0x595175[_0xdc78('0x2c')]=_[_0xdc78('0x2b')](_0x334cb8['query']);_0x595175['filters']=_[_0xdc78('0x2e')](_0x595175[_0xdc78('0x2a')],_0x595175['query']);_0x316121['attributes']=_[_0xdc78('0x2e')](_0x595175['model'],qs['fields'](_0x334cb8[_0xdc78('0x2c')][_0xdc78('0x30')]));_0x316121['attributes']=_0x316121[_0xdc78('0x2f')][_0xdc78('0x31')]?_0x316121[_0xdc78('0x2f')]:_0x595175[_0xdc78('0x2a')];if(_0x334cb8['query'][_0xdc78('0x3c')]){_0x316121['include']=[{'all':!![]}];}_0x316121=_[_0xdc78('0x38')]({},_0x316121,_0x334cb8['options']);return db['CmCompany'][_0xdc78('0x42')](_0x316121)[_0xdc78('0x21')](handleEntityNotFound(_0x5550c7,null))[_0xdc78('0x21')](respondWithResult(_0x5550c7,null))[_0xdc78('0x3e')](handleError(_0x5550c7,null));};exports[_0xdc78('0x43')]=function(_0x22e65c,_0x3e854a){return db['CmCompany'][_0xdc78('0x43')](_0x22e65c[_0xdc78('0x44')],{})[_0xdc78('0x21')](function(_0x1022ae){var _0x56f701=_0x22e65c[_0xdc78('0x45')]['get']({'plain':!![]});if(!_0x56f701)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56f701[_0xdc78('0x46')]===_0xdc78('0x45')){var _0x1b4e49=_0x1022ae[_0xdc78('0x23')]({'plain':!![]});var _0x73b980='Companies';return db[_0xdc78('0x47')]['find']({'where':{'name':_0x73b980,'userProfileId':_0x56f701[_0xdc78('0x48')]},'raw':!![]})[_0xdc78('0x21')](function(_0x3d11f1){if(_0x3d11f1&&_0x3d11f1['autoAssociation']===0x0){return db[_0xdc78('0x49')][_0xdc78('0x43')]({'name':_0x1b4e49[_0xdc78('0x27')],'resourceId':_0x1b4e49['id'],'type':_0x3d11f1[_0xdc78('0x27')],'sectionId':_0x3d11f1['id']},{})[_0xdc78('0x21')](function(){return _0x1022ae;});}else{return _0x1022ae;}})[_0xdc78('0x3e')](function(_0x471b6f){logger[_0xdc78('0x25')](_0xdc78('0x4a'),_0x471b6f);throw _0x471b6f;});}return _0x1022ae;})[_0xdc78('0x21')](respondWithResult(_0x3e854a,0xc9))[_0xdc78('0x3e')](handleError(_0x3e854a,null));};exports[_0xdc78('0x4b')]=function(_0x503060,_0x522328){if(_0x503060[_0xdc78('0x44')]['id']){delete _0x503060[_0xdc78('0x44')]['id'];}return db[_0xdc78('0x3b')][_0xdc78('0x42')]({'where':{'id':_0x503060['params']['id']}})[_0xdc78('0x21')](handleEntityNotFound(_0x522328,null))['then'](saveUpdates(_0x503060['body'],null))[_0xdc78('0x21')](respondWithResult(_0x522328,null))[_0xdc78('0x3e')](handleError(_0x522328,null));};exports['destroy']=function(_0x2d2faa,_0x4b96d4){return db['CmCompany']['find']({'where':{'id':_0x2d2faa[_0xdc78('0x40')]['id']}})[_0xdc78('0x21')](handleEntityNotFound(_0x4b96d4,null))['then'](removeEntity(_0x4b96d4,null))[_0xdc78('0x3e')](handleError(_0x4b96d4,null));};exports[_0xdc78('0x4c')]=function(_0x54f302,_0x32867e){return db[_0xdc78('0x3b')][_0xdc78('0x4c')]()['then'](respondWithResult(_0x32867e,null))['catch'](handleError(_0x32867e,null));};exports[_0xdc78('0x4d')]=function(_0x5801c3,_0x3f5207,_0x30bec9){return db['CmContact']['find']({'where':{'id':_0x5801c3['params']['id']}})[_0xdc78('0x21')](handleEntityNotFound(_0x3f5207,null))[_0xdc78('0x21')](function(_0x7a6df9){if(_0x7a6df9){return _0x7a6df9[_0xdc78('0x4d')](_0x5801c3[_0xdc78('0x44')]['ids'],_[_0xdc78('0x4e')](_0x5801c3[_0xdc78('0x44')],[_0xdc78('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x3f5207,null))[_0xdc78('0x3e')](handleError(_0x3f5207,null));};exports[_0xdc78('0x50')]=function(_0x35d591,_0x11c799,_0x16689b){var _0x5bd59a={};var _0x1d30dd={};var _0x5b5cef;var _0x4a2b3d;return db[_0xdc78('0x3b')][_0xdc78('0x51')]({'where':{'id':_0x35d591[_0xdc78('0x40')]['id']}})[_0xdc78('0x21')](handleEntityNotFound(_0x11c799,null))[_0xdc78('0x21')](function(_0x4f7c9e){if(_0x4f7c9e){_0x5b5cef=_0x4f7c9e;_0x1d30dd[_0xdc78('0x2a')]=_['keys'](db[_0xdc78('0x52')][_0xdc78('0x41')]);_0x1d30dd[_0xdc78('0x2c')]=_[_0xdc78('0x2b')](_0x35d591[_0xdc78('0x2c')]);_0x1d30dd['filters']=_[_0xdc78('0x2e')](_0x1d30dd['model'],_0x1d30dd['query']);_0x5bd59a['attributes']=_[_0xdc78('0x2e')](_0x1d30dd[_0xdc78('0x2a')],qs[_0xdc78('0x30')](_0x35d591[_0xdc78('0x2c')][_0xdc78('0x30')]));_0x5bd59a[_0xdc78('0x2f')]=_0x5bd59a[_0xdc78('0x2f')]['length']?_0x5bd59a[_0xdc78('0x2f')]:_0x1d30dd[_0xdc78('0x2a')];_0x5bd59a[_0xdc78('0x33')]=qs[_0xdc78('0x34')](_0x35d591[_0xdc78('0x2c')]['sort']);_0x5bd59a[_0xdc78('0x37')]=qs[_0xdc78('0x2d')](_[_0xdc78('0x35')](_0x35d591[_0xdc78('0x2c')],_0x1d30dd[_0xdc78('0x2d')]));if(_0x35d591[_0xdc78('0x2c')][_0xdc78('0x36')]){_0x5bd59a[_0xdc78('0x37')]=_['merge'](_0x5bd59a[_0xdc78('0x37')],{'$or':_[_0xdc78('0x39')](_0x5bd59a['attributes'],function(_0x2ea7f1){var _0x1f3f94={};_0x1f3f94[_0x2ea7f1]={'$like':'%'+_0x35d591[_0xdc78('0x2c')][_0xdc78('0x36')]+'%'};return _0x1f3f94;})});}_0x5bd59a=_[_0xdc78('0x38')]({},_0x5bd59a,_0x35d591[_0xdc78('0x3a')]);return _0x5b5cef[_0xdc78('0x50')](_0x5bd59a);}})[_0xdc78('0x21')](function(_0x3d5ccd){if(_0x3d5ccd){_0x4a2b3d=_0x3d5ccd[_0xdc78('0x31')];if(!_0x35d591[_0xdc78('0x2c')]['hasOwnProperty']('nolimit')){_0x5bd59a['limit']=qs[_0xdc78('0x1b')](_0x35d591[_0xdc78('0x2c')]['limit']);_0x5bd59a[_0xdc78('0x1a')]=qs[_0xdc78('0x1a')](_0x35d591[_0xdc78('0x2c')]['offset']);}return _0x5b5cef['getContacts'](_0x5bd59a);}})[_0xdc78('0x21')](function(_0x25b5aa){if(_0x25b5aa){return _0x25b5aa?{'count':_0x4a2b3d,'rows':_0x25b5aa}:null;}})[_0xdc78('0x21')](respondWithResult(_0x11c799,null))[_0xdc78('0x3e')](handleError(_0x11c799,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 9f8af9b..5355c24 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 _0x2ce4=['rimraf','exports','define','CmCompany','lodash','api','moment','request-promise'];(function(_0x1b51f9,_0x46240e){var _0x46cf16=function(_0x3034c3){while(--_0x3034c3){_0x1b51f9['push'](_0x1b51f9['shift']());}};_0x46cf16(++_0x46240e);}(_0x2ce4,0x16c));var _0x42ce=function(_0x190134,_0x366609){_0x190134=_0x190134-0x0;var _0x2a654=_0x2ce4[_0x190134];return _0x2a654;};'use strict';var _=require(_0x42ce('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x42ce('0x1'));var moment=require(_0x42ce('0x2'));var BPromise=require('bluebird');var rp=require(_0x42ce('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x42ce('0x4'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x42ce('0x5')]=function(_0x1f8e71,_0x12c2f1){return _0x1f8e71[_0x42ce('0x6')](_0x42ce('0x7'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a1c=['define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x3fc6c2,_0x3acffd){var _0x1b025e=function(_0x5665f4){while(--_0x5665f4){_0x3fc6c2['push'](_0x3fc6c2['shift']());}};_0x1b025e(++_0x3acffd);}(_0x8a1c,0x1e3));var _0xc8a1=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x8a1c[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xc8a1('0x0'));var util=require(_0xc8a1('0x1'));var logger=require(_0xc8a1('0x2'))(_0xc8a1('0x3'));var moment=require(_0xc8a1('0x4'));var BPromise=require(_0xc8a1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8a1('0x6'));var rimraf=require('rimraf');var config=require(_0xc8a1('0x7'));var attributes=require('./cmCompany.attributes');module[_0xc8a1('0x8')]=function(_0x46cb0b,_0x1bcb66){return _0x46cb0b[_0xc8a1('0x9')](_0xc8a1('0xa'),attributes,{'tableName':_0xc8a1('0xb'),'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 cfa9112..c878a40 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 _0x50a0=['request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http'];(function(_0x31328b,_0x35150c){var _0x5e23cf=function(_0x5cb686){while(--_0x5cb686){_0x31328b['push'](_0x31328b['shift']());}};_0x5e23cf(++_0x35150c);}(_0x50a0,0x115));var _0x050a=function(_0x5c54b7,_0x5693d3){_0x5c54b7=_0x5c54b7-0x0;var _0x146b07=_0x50a0[_0x5c54b7];return _0x146b07;};'use strict';var _=require(_0x050a('0x0'));var util=require(_0x050a('0x1'));var moment=require(_0x050a('0x2'));var BPromise=require(_0x050a('0x3'));var rs=require(_0x050a('0x4'));var fs=require('fs');var Redis=require(_0x050a('0x5'));var db=require(_0x050a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x050a('0x7'));var jayson=require(_0x050a('0x8'));var client=jayson[_0x050a('0x9')][_0x050a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ab180,_0x1286f3,_0x518a8d){return new BPromise(function(_0x5d4171,_0x279e72){return client[_0x050a('0xb')](_0x2ab180,_0x518a8d)[_0x050a('0xc')](function(_0x26749d){logger['info'](_0x050a('0xd'),_0x1286f3,_0x050a('0xe'));logger[_0x050a('0xf')](_0x050a('0x10'),_0x1286f3,_0x050a('0xe'),JSON[_0x050a('0x11')](_0x26749d));if(_0x26749d[_0x050a('0x12')]){if(_0x26749d[_0x050a('0x12')][_0x050a('0x13')]===0x1f4){logger[_0x050a('0x12')](_0x050a('0xd'),_0x1286f3,_0x26749d[_0x050a('0x12')]['message']);return _0x279e72(_0x26749d[_0x050a('0x12')]['message']);}logger[_0x050a('0x12')](_0x050a('0xd'),_0x1286f3,_0x26749d['error']['message']);return _0x5d4171(_0x26749d['error'][_0x050a('0x14')]);}else{logger[_0x050a('0x15')](_0x050a('0xd'),_0x1286f3,_0x050a('0xe'));_0x5d4171(_0x26749d[_0x050a('0x16')][_0x050a('0x14')]);}})[_0x050a('0x17')](function(_0x47cb4e){logger[_0x050a('0x12')]('CmCompany,\x20%s,\x20%s',_0x1286f3,_0x47cb4e);_0x279e72(_0x47cb4e);});});} \ No newline at end of file +var _0x8021=['CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x8021,0x175));var _0x1802=function(_0x30b094,_0x555417){_0x30b094=_0x30b094-0x0;var _0x4337f3=_0x8021[_0x30b094];return _0x4337f3;};'use strict';var _=require(_0x1802('0x0'));var util=require(_0x1802('0x1'));var moment=require(_0x1802('0x2'));var BPromise=require(_0x1802('0x3'));var rs=require(_0x1802('0x4'));var fs=require('fs');var Redis=require(_0x1802('0x5'));var db=require(_0x1802('0x6'))['db'];var utils=require(_0x1802('0x7'));var logger=require(_0x1802('0x8'))(_0x1802('0x9'));var config=require(_0x1802('0xa'));var jayson=require(_0x1802('0xb'));var client=jayson['client'][_0x1802('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x182adc,_0x4e1e03,_0x3f5eb1){return new BPromise(function(_0x38c50a,_0x548880){return client[_0x1802('0xd')](_0x182adc,_0x3f5eb1)['then'](function(_0x2d2589){logger[_0x1802('0xe')](_0x1802('0xf'),_0x4e1e03,_0x1802('0x10'));logger[_0x1802('0x11')](_0x1802('0x12'),_0x4e1e03,_0x1802('0x10'),JSON['stringify'](_0x2d2589));if(_0x2d2589[_0x1802('0x13')]){if(_0x2d2589['error'][_0x1802('0x14')]===0x1f4){logger['error'](_0x1802('0xf'),_0x4e1e03,_0x2d2589[_0x1802('0x13')][_0x1802('0x15')]);return _0x548880(_0x2d2589[_0x1802('0x13')][_0x1802('0x15')]);}logger['error'](_0x1802('0xf'),_0x4e1e03,_0x2d2589[_0x1802('0x13')][_0x1802('0x15')]);return _0x38c50a(_0x2d2589[_0x1802('0x13')]['message']);}else{logger[_0x1802('0xe')](_0x1802('0xf'),_0x4e1e03,_0x1802('0x10'));_0x38c50a(_0x2d2589[_0x1802('0x16')][_0x1802('0x15')]);}})['catch'](function(_0x30a918){logger[_0x1802('0x13')]('CmCompany,\x20%s,\x20%s',_0x4e1e03,_0x30a918);_0x548880(_0x30a918);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 941b6e6..a69f45b 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 _0xcd96=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/contacts','post','create','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x152c9a,_0x15db16){var _0x43a214=function(_0x29ce5e){while(--_0x29ce5e){_0x152c9a['push'](_0x152c9a['shift']());}};_0x43a214(++_0x15db16);}(_0xcd96,0x163));var _0x6cd9=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xcd96[_0x2f45ea];return _0x485a84;};'use strict';var multer=require(_0x6cd9('0x0'));var util=require(_0x6cd9('0x1'));var path=require(_0x6cd9('0x2'));var timeout=require(_0x6cd9('0x3'));var express=require(_0x6cd9('0x4'));var router=express[_0x6cd9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6cd9('0x6'));var interaction=require(_0x6cd9('0x7'));var config=require(_0x6cd9('0x8'));var controller=require(_0x6cd9('0x9'));router['get']('/',auth[_0x6cd9('0xa')](),controller[_0x6cd9('0xb')]);router[_0x6cd9('0xc')](_0x6cd9('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x6cd9('0xc')](_0x6cd9('0xe'),auth['isAuthenticated'](),controller[_0x6cd9('0xf')]);router['get'](_0x6cd9('0x10'),auth[_0x6cd9('0xa')](),controller['getContacts']);router[_0x6cd9('0x11')]('/',auth[_0x6cd9('0xa')](),controller[_0x6cd9('0x12')]);router[_0x6cd9('0x11')]('/:id/contacts',auth[_0x6cd9('0xa')](),controller[_0x6cd9('0x13')]);router[_0x6cd9('0x14')](_0x6cd9('0xe'),auth[_0x6cd9('0xa')](),controller['update']);router[_0x6cd9('0x15')]('/:id',auth[_0x6cd9('0xa')](),controller[_0x6cd9('0x16')]);module[_0x6cd9('0x17')]=router; \ No newline at end of file +var _0x76ca=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x76ca,0x98));var _0xa76c=function(_0x12bfdd,_0x22fe52){_0x12bfdd=_0x12bfdd-0x0;var _0x1e1c32=_0x76ca[_0x12bfdd];return _0x1e1c32;};'use strict';var multer=require(_0xa76c('0x0'));var util=require(_0xa76c('0x1'));var path=require(_0xa76c('0x2'));var timeout=require(_0xa76c('0x3'));var express=require(_0xa76c('0x4'));var router=express[_0xa76c('0x5')]();var fs_extra=require(_0xa76c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa76c('0x7'));var config=require(_0xa76c('0x8'));var controller=require(_0xa76c('0x9'));router[_0xa76c('0xa')]('/',auth[_0xa76c('0xb')](),controller['index']);router[_0xa76c('0xa')](_0xa76c('0xc'),auth['isAuthenticated'](),controller[_0xa76c('0xd')]);router[_0xa76c('0xa')](_0xa76c('0xe'),auth['isAuthenticated'](),controller[_0xa76c('0xf')]);router['get'](_0xa76c('0x10'),auth[_0xa76c('0xb')](),controller[_0xa76c('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa76c('0x12')]);router[_0xa76c('0x13')](_0xa76c('0x10'),auth[_0xa76c('0xb')](),controller[_0xa76c('0x14')]);router[_0xa76c('0x15')]('/:id',auth[_0xa76c('0xb')](),controller[_0xa76c('0x16')]);router[_0xa76c('0x17')](_0xa76c('0xe'),auth[_0xa76c('0xb')](),controller[_0xa76c('0x18')]);module[_0xa76c('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index eb3dbbd..aaf856b 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 _0x560b=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x4cefc3,_0x23f291){var _0x1cc779=function(_0x7cb914){while(--_0x7cb914){_0x4cefc3['push'](_0x4cefc3['shift']());}};_0x1cc779(++_0x23f291);}(_0x560b,0x79));var _0xb560=function(_0x5e4792,_0x1d0c51){_0x5e4792=_0x5e4792-0x0;var _0x16c150=_0x560b[_0x5e4792];return _0x16c150;};'use strict';var _=require(_0xb560('0x0'));var Sequelize=require(_0xb560('0x1'));module[_0xb560('0x2')]={'firstName':{'type':Sequelize[_0xb560('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb560('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xb560('0x3')]},'country':{'type':Sequelize[_0xb560('0x3')]},'dateOfBirth':{'type':Sequelize[_0xb560('0x3')]},'description':{'type':Sequelize[_0xb560('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xb560('0x3')]},'email':{'type':Sequelize[_0xb560('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xb560('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xb560('0x3')]},'teams':{'type':Sequelize[_0xb560('0x3')]},'viber':{'type':Sequelize[_0xb560('0x3')]},'line':{'type':Sequelize[_0xb560('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xb560('0x3')]},'UserId':{'type':Sequelize[_0xb560('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xb560('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xb560('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xb560('0x7')]},'dialTimezone':{'type':Sequelize[_0xb560('0x3')]},'utcOffset':{'type':Sequelize[_0xb560('0x5')]}}; \ No newline at end of file +var _0x0bb6=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','sequelize','exports'];(function(_0x20db55,_0x4a484c){var _0x33bc37=function(_0x157180){while(--_0x157180){_0x20db55['push'](_0x20db55['shift']());}};_0x33bc37(++_0x4a484c);}(_0x0bb6,0x136));var _0x60bb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0bb6[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var Sequelize=require(_0x60bb('0x0'));module[_0x60bb('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x60bb('0x2')]},'street':{'type':Sequelize[_0x60bb('0x2')]},'postalCode':{'type':Sequelize[_0x60bb('0x2')]},'city':{'type':Sequelize[_0x60bb('0x2')]},'country':{'type':Sequelize[_0x60bb('0x2')]},'dateOfBirth':{'type':Sequelize[_0x60bb('0x2')]},'description':{'type':Sequelize[_0x60bb('0x3')]},'phone':{'type':Sequelize[_0x60bb('0x2')]},'mobile':{'type':Sequelize[_0x60bb('0x2')]},'fax':{'type':Sequelize[_0x60bb('0x2')]},'email':{'type':Sequelize[_0x60bb('0x2')]},'url':{'type':Sequelize[_0x60bb('0x2')]},'facebook':{'type':Sequelize[_0x60bb('0x2')]},'fb_data':{'type':Sequelize[_0x60bb('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x60bb('0x2')]},'teams':{'type':Sequelize[_0x60bb('0x2')]},'viber':{'type':Sequelize[_0x60bb('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x60bb('0x2')]},'UserId':{'type':Sequelize[_0x60bb('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x60bb('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x60bb('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x60bb('0x6')],'defaultValue':Sequelize[_0x60bb('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x60bb('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index e11f43e..15d9b57 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 _0x3889=['Invalid\x20createdAt\x20filter','uniqueid','type','source','callerid','endtime','note','createdAt','UserId','fullname','DESC','findAndCountAll','Website','Account','closed','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','startCase','flatten','sortBy','value','moment','bluebird','util','path','lodash','squel','papaparse','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','limit','count','set','then','destroy','end','sendStatus','error','name','send','index','describe','getOptions','findAll','user','catch','CmContact','find','params','tags','keys','length','startsWith','displayName','query','analytics','cf_','columnName','alias','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','get','mergeWith','isArray','join','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','update','ChatMessage','MailInteraction','MailMessage','SmsInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','isNil','timezones','utcOffset','additionalPhones','each','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','all','show','Tags','color','Phones','ItemType','sequelize','literal','Phones.OrderBy','$and','CmCustomField','omit','map','cf_%d','dialTimezone','format','table','cm_contacts','setFields','toParam','text','phone','getTags','Tag','intersection','model','attributes','fields','sort','filters','pick','filter','options','nolimit','findOne','ids','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','order','ContactId','includeAll','include','rows','getHopperHistories','rawAttributes','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','json','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','User','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','importUpdates','../../components/import/cm/csvUpdates','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter'];(function(_0x5854a6,_0x4111dd){var _0x32c7ee=function(_0x4a28dd){while(--_0x4a28dd){_0x5854a6['push'](_0x5854a6['shift']());}};_0x32c7ee(++_0x4111dd);}(_0x3889,0x12a));var _0x9388=function(_0x461fa1,_0x5aa2cb){_0x461fa1=_0x461fa1-0x0;var _0x585156=_0x3889[_0x461fa1];return _0x585156;};'use strict';var moment=require(_0x9388('0x0'));var BPromise=require(_0x9388('0x1'));var util=require(_0x9388('0x2'));var path=require(_0x9388('0x3'));var fs=require('fs');var _=require(_0x9388('0x4'));var squel=require(_0x9388('0x5'));var Papa=require(_0x9388('0x6'));var Redis=require('ioredis');var contacts=require(_0x9388('0x7'));var qs=require(_0x9388('0x8'));var logger=require(_0x9388('0x9'))(_0x9388('0xa'));var config=require(_0x9388('0xb'));var shared=require('../../config/environment/shared');var db=require(_0x9388('0xc'))['db'];config[_0x9388('0xd')]=_[_0x9388('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9388('0xf'))(new Redis(config[_0x9388('0xd')]));require(_0x9388('0x10'))[_0x9388('0x11')](socket);function respondWithResult(_0x5c8994,_0x54ab43){_0x54ab43=_0x54ab43||0xc8;return function(_0x472bd7){if(_0x472bd7){return _0x5c8994[_0x9388('0x12')](_0x54ab43)['json'](_0x472bd7);}};}function respondWithFilteredResult(_0x18c447,_0x4e2c7e){return function(_0x8851eb){if(_0x8851eb){var _0x215816=typeof _0x4e2c7e[_0x9388('0x13')]===_0x9388('0x14')&&typeof _0x4e2c7e[_0x9388('0x15')]===_0x9388('0x14');var _0x3308bd=_0x8851eb['count'];var _0x1fd462=_0x215816?0x0:_0x4e2c7e[_0x9388('0x13')];var _0x13c79c=_0x215816?_0x8851eb[_0x9388('0x16')]:_0x4e2c7e['offset']+_0x4e2c7e[_0x9388('0x15')];var _0x382028;if(_0x13c79c>=_0x3308bd){_0x13c79c=_0x3308bd;_0x382028=0xc8;}else{_0x382028=0xce;}_0x18c447[_0x9388('0x12')](_0x382028);return _0x18c447[_0x9388('0x17')]('Content-Range',_0x1fd462+'-'+_0x13c79c+'/'+_0x3308bd)['json'](_0x8851eb);}return null;};}function saveUpdates(_0x354781){return function(_0x56652d){if(_0x56652d){return _0x56652d['update'](_0x354781)[_0x9388('0x18')](function(_0x22ab7a){return _0x22ab7a;});}return null;};}function removeEntity(_0x57b03d){return function(_0x2c8090){if(_0x2c8090){return _0x2c8090[_0x9388('0x19')]()[_0x9388('0x18')](function(){_0x57b03d[_0x9388('0x12')](0xcc)[_0x9388('0x1a')]();});}};}function handleEntityNotFound(_0x53ef31){return function(_0x444451){if(!_0x444451){_0x53ef31[_0x9388('0x1b')](0x194);}return _0x444451;};}function handleError(_0x41a761,_0x753b5e){_0x753b5e=_0x753b5e||0x1f4;return function(_0x42d18c){logger[_0x9388('0x1c')](_0x42d18c['stack']);if(_0x42d18c['name']){delete _0x42d18c[_0x9388('0x1d')];}_0x41a761[_0x9388('0x12')](_0x753b5e)[_0x9388('0x1e')](_0x42d18c);};}exports[_0x9388('0x1f')]=function(_0x393005,_0xb87b4b){var _0xd964ec={};return contacts[_0x9388('0x20')]()[_0x9388('0x18')](function(_0x1d02de){_0xd964ec=qs[_0x9388('0x21')](_0x1d02de,_0x393005);return contacts[_0x9388('0x22')](_0x393005['query'],_0x393005[_0x9388('0x23')],_0xd964ec,_0x1d02de);})[_0x9388('0x18')](respondWithFilteredResult(_0xb87b4b,_0xd964ec))[_0x9388('0x24')](handleError(_0xb87b4b,null));};exports['destroy']=function(_0x5da19b,_0x3f8fc6){return db[_0x9388('0x25')][_0x9388('0x26')]({'where':{'id':_0x5da19b[_0x9388('0x27')]['id']}})[_0x9388('0x18')](handleEntityNotFound(_0x3f8fc6,null))[_0x9388('0x18')](removeEntity(_0x3f8fc6,null))[_0x9388('0x24')](handleError(_0x3f8fc6,null));};exports['describe']=function(_0x4e3477,_0x25264d){return db['CmContact'][_0x9388('0x20')]()['then'](function(_0x1af056){delete _0x1af056[_0x9388('0x28')];for(var _0x5bb429=0x0;_0x5bb4290x0){return new Promise(function(_0xe2b9dd){var _0xd7337f=[];for(var _0x22bc50=0x0;_0x22bc50<_0x2d4f39['length'];_0x22bc50++){_0xd7337f[_0x9388('0x5f')](insertAdditionalPhones(_0x2d4f39[_0x22bc50][_0x9388('0x63')],_0x2d4f39[_0x22bc50][_0x9388('0x5a')]));}Promise[_0x9388('0x64')](_0xd7337f)['then'](function(){_0xe2b9dd(0x1);});})[_0x9388('0x18')](function(){return{'success':_0x4f07ef,'failure':_0x409019,'duplicates':_0x1b9a11};});}else{return{'success':_0x4f07ef,'failure':_0x409019,'duplicates':_0x1b9a11};}}})['then'](respondWithResult(_0x48c82e,0xc9))[_0x9388('0x24')](handleError(_0x48c82e,null));};exports[_0x9388('0x65')]=function(_0x184fa3,_0x40c187){var _0xb93b76;return db[_0x9388('0x25')]['describe']()['then'](function(_0x93f006){return db['CmContact'][_0x9388('0x26')]({'where':{'id':_0x184fa3[_0x9388('0x27')]['id']},'include':[{'model':db['Tag'],'as':_0x9388('0x66'),'attributes':['id',_0x9388('0x1d'),_0x9388('0x67')],'required':_0x184fa3[_0x9388('0x2d')]['tag']?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x9388('0x68'),'where':{'CmContactId':_0x184fa3[_0x9388('0x27')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x9388('0x69')}]}],'order':[db[_0x9388('0x6a')][_0x9388('0x6b')](_0x9388('0x6c'))],'attributes':_[_0x9388('0x29')](_0x93f006)});})[_0x9388('0x18')](function(_0x209104){if(!_['isNil'](_0x209104)){_0xb93b76=_0x209104[_0x9388('0x3a')]({'plain':!![]});var _0x54cb7d={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x209104&&_0x209104[_0x9388('0x60')]){if(_0x209104['ListId']){_0x54cb7d[_0x9388('0x5d')][_0x9388('0x6d')][_0x9388('0x5f')]({'ListId':{'$ne':_0x209104[_0x9388('0x60')]}});}}return db[_0x9388('0x6e')][_0x9388('0x22')](_0x54cb7d);}})['then'](function(_0x38e73f){if(!_[_0x9388('0x57')](_0x38e73f)){return _[_0x9388('0x6f')](_0xb93b76,_[_0x9388('0x70')](_0x38e73f,function(_0x187c09){return util['format'](_0x9388('0x71'),_0x187c09['id']);}));}})[_0x9388('0x18')](handleEntityNotFound(_0x40c187,null))[_0x9388('0x18')](respondWithResult(_0x40c187,null))[_0x9388('0x24')](handleError(_0x40c187,null));};exports[_0x9388('0x44')]=function(_0x30d16c,_0x26a5c4){var _0x42abaf;if(_0x30d16c[_0x9388('0x39')]['id']){delete _0x30d16c[_0x9388('0x39')]['id'];}if(!_[_0x9388('0x57')](_0x30d16c[_0x9388('0x39')]['dialTimezone'])){var _0x2b5765=_0x30d16c[_0x9388('0x39')][_0x9388('0x72')];if(!_['isNil'](shared[_0x9388('0x58')][_0x2b5765]))_0x30d16c[_0x9388('0x39')]['utcOffset']=shared[_0x9388('0x58')][_0x2b5765][_0x9388('0x59')];}return db[_0x9388('0x25')][_0x9388('0x26')]({'where':{'id':_0x30d16c['params']['id']}})[_0x9388('0x18')](handleEntityNotFound(_0x26a5c4,null))[_0x9388('0x18')](saveUpdates(_0x30d16c[_0x9388('0x39')],null))[_0x9388('0x18')](function(_0x1918a4){_0x42abaf=_0x1918a4;var _0x59282b={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1918a4&&_0x1918a4[_0x9388('0x60')]){if(_0x1918a4[_0x9388('0x60')]){_0x59282b[_0x9388('0x5d')][_0x9388('0x6d')][_0x9388('0x5f')]({'ListId':{'$ne':_0x1918a4[_0x9388('0x60')]}});}}return db[_0x9388('0x6e')][_0x9388('0x22')](_0x59282b);})[_0x9388('0x18')](function(_0x43d92e){if(_0x43d92e){return _[_0x9388('0x6f')](_['pickBy'](_0x30d16c[_0x9388('0x39')],function(_0x4be75f,_0x380444){return _[_0x9388('0x2b')](_0x380444,'cf_');}),_[_0x9388('0x70')](_0x43d92e,function(_0x45f2eb){return util[_0x9388('0x73')](_0x9388('0x71'),_0x45f2eb['id']);}));}})[_0x9388('0x18')](function(_0xf73096){if(_0xf73096&&!_['isEmpty'](_0xf73096)){var _0x2f1906=squel[_0x9388('0x44')]()[_0x9388('0x74')](_0x9388('0x75'))[_0x9388('0x76')](_0xf73096)[_0x9388('0x5d')]('id\x20=\x20?',_0x30d16c[_0x9388('0x27')]['id'])[_0x9388('0x77')]();return db[_0x9388('0x6a')][_0x9388('0x2d')](_0x2f1906[_0x9388('0x78')],{'replacements':_0x2f1906[_0x9388('0x33')]});}})[_0x9388('0x18')](function(){if(_0x30d16c[_0x9388('0x39')][_0x9388('0x79')]&&_0x42abaf){return db[_0x9388('0x3f')]['update']({'phone':_0x30d16c[_0x9388('0x39')][_0x9388('0x79')],'OrderBy':0x0},{'where':{'ContactId':_0x42abaf['id']}});}})[_0x9388('0x18')](function(){return _0x42abaf;})[_0x9388('0x18')](respondWithResult(_0x26a5c4,null))[_0x9388('0x24')](handleError(_0x26a5c4,null));};exports[_0x9388('0x7a')]=function(_0x2fdd1e,_0xfa9822){var _0x17053a={};var _0xb054f8={};var _0xbf11db;var _0x58d9a3;return db[_0x9388('0x25')]['findOne']({'where':{'id':_0x2fdd1e[_0x9388('0x27')]['id']}})[_0x9388('0x18')](handleEntityNotFound(_0xfa9822,null))[_0x9388('0x18')](function(_0x321bc9){if(_0x321bc9){_0xbf11db=_0x321bc9;_0xb054f8['model']=_[_0x9388('0x29')](db[_0x9388('0x7b')]['rawAttributes']);_0xb054f8['query']=_[_0x9388('0x29')](_0x2fdd1e[_0x9388('0x2d')]);_0xb054f8['filters']=_[_0x9388('0x7c')](_0xb054f8[_0x9388('0x7d')],_0xb054f8[_0x9388('0x2d')]);_0x17053a[_0x9388('0x7e')]=_[_0x9388('0x7c')](_0xb054f8[_0x9388('0x7d')],qs[_0x9388('0x7f')](_0x2fdd1e[_0x9388('0x2d')][_0x9388('0x7f')]));_0x17053a['attributes']=_0x17053a['attributes'][_0x9388('0x2a')]?_0x17053a[_0x9388('0x7e')]:_0xb054f8[_0x9388('0x7d')];_0x17053a['order']=qs[_0x9388('0x80')](_0x2fdd1e[_0x9388('0x2d')]['sort']);_0x17053a[_0x9388('0x5d')]=qs[_0x9388('0x81')](_[_0x9388('0x82')](_0x2fdd1e[_0x9388('0x2d')],_0xb054f8['filters']));if(_0x2fdd1e[_0x9388('0x2d')][_0x9388('0x83')]){_0x17053a[_0x9388('0x5d')]=_[_0x9388('0x38')](_0x17053a[_0x9388('0x5d')],{'$or':_[_0x9388('0x70')](_0x17053a[_0x9388('0x7e')],function(_0x1598f4){var _0x30b519={};_0x30b519[_0x1598f4]={'$like':'%'+_0x2fdd1e[_0x9388('0x2d')][_0x9388('0x83')]+'%'};return _0x30b519;})});}_0x17053a=_['merge']({},_0x17053a,_0x2fdd1e[_0x9388('0x84')]);return _0xbf11db['getTags'](_0x17053a);}})[_0x9388('0x18')](function(_0x2b9cf3){if(_0x2b9cf3){_0x58d9a3=_0x2b9cf3[_0x9388('0x2a')];if(!_0x2fdd1e[_0x9388('0x2d')][_0x9388('0x37')](_0x9388('0x85'))){_0x17053a[_0x9388('0x15')]=qs[_0x9388('0x15')](_0x2fdd1e[_0x9388('0x2d')]['limit']);_0x17053a[_0x9388('0x13')]=qs[_0x9388('0x13')](_0x2fdd1e[_0x9388('0x2d')][_0x9388('0x13')]);}return _0xbf11db[_0x9388('0x7a')](_0x17053a);}})[_0x9388('0x18')](function(_0x389bf0){if(_0x389bf0){return _0x389bf0?{'count':_0x58d9a3,'rows':_0x389bf0}:null;}})[_0x9388('0x18')](respondWithResult(_0xfa9822,null))[_0x9388('0x24')](handleError(_0xfa9822,null));};exports['setTags']=function(_0xeae772,_0x95b872){if(_0xeae772[_0x9388('0x39')]['id']){delete _0xeae772[_0x9388('0x39')]['id'];}return db[_0x9388('0x25')][_0x9388('0x86')]({'where':{'id':_0xeae772['params']['id']}})['then'](handleEntityNotFound(_0x95b872,null))[_0x9388('0x18')](function(_0x434961){if(_0x434961){return _0x434961['setTags'](_0xeae772[_0x9388('0x39')][_0x9388('0x87')]||[]);}return null;})['then'](respondWithResult(_0x95b872,null))[_0x9388('0x24')](handleError(_0x95b872,null));};exports[_0x9388('0x88')]=function(_0x1c5a05,_0x322c11){var _0x2495f5=[];_0x2495f5[_0x9388('0x5f')](addAdditionalPhones(_0x1c5a05[_0x9388('0x39')]));Promise[_0x9388('0x64')](_0x2495f5)[_0x9388('0x18')](function(){_0x2495f5=[];_0x2495f5[_0x9388('0x5f')](deleteCmHopperPhones(_0x1c5a05[_0x9388('0x39')]['id']));_0x2495f5['push'](addCmHopperPhones(_0x1c5a05['body']['id']));Promise[_0x9388('0x64')](_0x2495f5)[_0x9388('0x18')](function(){return[0x1];})[_0x9388('0x18')](respondWithResult(_0x322c11,null));});};function addAdditionalPhones(_0x221b75){var _0xf4eb17;return new Promise(function(_0x2ed224){return db['CmContactHasItem']['destroy']({'where':{'CmContactId':_0x221b75['id']}})[_0x9388('0x18')](function(){db[_0x9388('0x89')][_0x9388('0x22')]({'raw':!![],'attributes':['id',_0x9388('0x8a')]})[_0x9388('0x18')](function(_0x2e66a7){var _0x17b060=[];for(var _0x2c1b98=0x0;_0x2c1b98<_0x221b75[_0x9388('0x8b')]['length'];_0x2c1b98++){var _0x4ede82=_0x221b75[_0x9388('0x8c')]?_[_0x9388('0x57')](_0x221b75['item_types'][_0x2c1b98])?'':_0x221b75[_0x9388('0x8c')][_0x2c1b98]:_0x221b75[_0x9388('0x8b')][_0x2c1b98][_0x9388('0x8d')]?_0x221b75['items'][_0x2c1b98][_0x9388('0x8d')]:'';var _0xdfeb0=_[_0x9388('0x57')](_0x221b75[_0x9388('0x8b')][_0x2c1b98]['description'])?'':_0x221b75[_0x9388('0x8b')][_0x2c1b98][_0x9388('0x8e')];var _0x1ebb38=_0x4ede82+':'+_0x221b75[_0x9388('0x8b')][_0x2c1b98][_0x9388('0x79')]+'§'+_0xdfeb0;if(_['isNil'](_0xf4eb17))_0xf4eb17=_0x1ebb38;else _0xf4eb17+=';'+_0x1ebb38;var _0x10738f=null;var _0x2b7aa1=null;if(_0x221b75[_0x9388('0x8c')]){if(!_[_0x9388('0x57')](_0x221b75[_0x9388('0x8c')][_0x2c1b98])){_0x2b7aa1=_[_0x9388('0x26')](_0x2e66a7,function(_0x51bb21){return _0x51bb21['id']===_0x221b75[_0x9388('0x8c')][_0x2c1b98];});if(!_[_0x9388('0x57')](_0x2b7aa1)){_0x10738f=_0x2b7aa1[_0x9388('0x8a')];}}}else{if(!_[_0x9388('0x57')](_0x221b75[_0x9388('0x8b')][_0x2c1b98])){_0x2b7aa1=_[_0x9388('0x26')](_0x2e66a7,function(_0x36a3cd){return _0x36a3cd['id']===_0x221b75[_0x9388('0x8b')][_0x2c1b98][_0x9388('0x8d')];});if(!_[_0x9388('0x57')](_0x2b7aa1)){_0x10738f=_0x2c1b98;}}}if(_[_0x9388('0x57')](_0x10738f)){_0x10738f=0x64;}_0x17b060['push'](addAdditionalPhone(_0x221b75['id'],_0x221b75[_0x9388('0x8b')][_0x2c1b98][_0x9388('0x79')],_0x221b75[_0x9388('0x8c')]?_[_0x9388('0x57')](_0x221b75[_0x9388('0x8c')][_0x2c1b98])?null:_0x221b75[_0x9388('0x8c')][_0x2c1b98]:_0x221b75['items'][_0x2c1b98][_0x9388('0x8d')]?_0x221b75[_0x9388('0x8b')][_0x2c1b98]['ItemTypeId']:null,_0x10738f,_0xdfeb0));}Promise['all'](_0x17b060)[_0x9388('0x18')](function(){db[_0x9388('0x25')]['update']({'AdditionalPhones':_0xf4eb17},{'where':{'id':_0x221b75['id']}})[_0x9388('0x18')](function(){_0x2ed224(0x1);});});});});});}function addAdditionalPhone(_0x273d04,_0x1a7deb,_0x18e6e3,_0x48455a,_0x23b8c9){return db['CmContactHasItem'][_0x9388('0x26')]({'where':{'CmContactId':_0x273d04,'item':_0x1a7deb}})[_0x9388('0x18')](function(_0x2457cc){if(_0x2457cc)logger['info']('contact\x20phone\x20exists',_0x2457cc);else{db[_0x9388('0x4b')][_0x9388('0x56')]({'CmContactId':_0x273d04,'item':_0x1a7deb,'ItemTypeId':_0x18e6e3,'OrderBy':_0x48455a,'ItemClass':_0x9388('0x8f'),'description':_0x23b8c9});}});}function deleteCmHopperPhones(_0x1df0b6){return new Promise(function(_0x39fc96){return db[_0x9388('0x3f')][_0x9388('0x22')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1df0b6}})[_0x9388('0x18')](function(_0x37c785){db[_0x9388('0x90')][_0x9388('0x19')]({'where':{'CmHopperId':{'$in':_['map'](_0x37c785,'id')}}});})['then'](function(){_0x39fc96(0x1);});});}function addCmHopperPhones(_0x29d42f){return new Promise(function(_0x514578){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x29d42f}})[_0x9388('0x18')](function(_0x356eaa){var _0xd72ca5=[];_[_0x9388('0x70')](_0x356eaa,function(_0x4ba2cd){_0xd72ca5[_0x9388('0x5f')](createCmHopperPhone(_0x29d42f,_0x4ba2cd['id']));});Promise[_0x9388('0x64')](_0xd72ca5)[_0x9388('0x18')](function(){_0x514578(0x1);});});});}function createCmHopperPhone(_0x25f4b2,_0x3c1124){return new Promise(function(_0x436f54){db[_0x9388('0x4b')][_0x9388('0x22')]({'raw':!![],'attributes':[_0x9388('0x91'),_0x9388('0x8a')],'where':{'CmContactId':_0x25f4b2,'ItemClass':'PHONE'},'include':[{'model':db[_0x9388('0x89')],'attributes':[_0x9388('0x8a')],'as':_0x9388('0x69')}],'order':[_0x9388('0x8a'),db[_0x9388('0x6a')][_0x9388('0x6b')](_0x9388('0x92'))]})['then'](function(_0xf1e348){var _0x1dadee=0x1;var _0x3bf2fb=_[_0x9388('0x70')](_0xf1e348,function(_0x58c2b8){_0x58c2b8[_0x9388('0x93')]=_0x3c1124;_0x58c2b8[_0x9388('0x79')]=_0x58c2b8[_0x9388('0x91')];_0x58c2b8[_0x9388('0x8a')]=_0x1dadee;delete _0x58c2b8[_0x9388('0x94')];_0x1dadee=_0x1dadee+0x1;return _0x58c2b8;});return db[_0x9388('0x90')]['bulkCreate'](_0x3bf2fb,{});})['then'](function(){_0x436f54(0x1);});});}function insertAdditionalPhones(_0x250400,_0x57e1a7){return new Promise(function(_0x330d58){var _0x49834=[];for(var _0x4944c8=0x0;_0x4944c8<_0x57e1a7[_0x9388('0x2a')];_0x4944c8++){var _0x42a153=_0x57e1a7[_0x4944c8];_0x49834['push'](parseContactItemType(_0x42a153));}Promise[_0x9388('0x64')](_0x49834)[_0x9388('0x18')](function(){var _0x520d90={'id':_0x250400['id'],'items':_0x57e1a7};return addAdditionalPhones(_0x520d90)[_0x9388('0x18')](function(){return addCmHopperPhones(_0x250400['id']);});})[_0x9388('0x18')](function(){_0x330d58(_0x250400);});});}function parseContactItemType(_0x3e9af5){return new Promise(function(_0x4c4a89){if(_0x3e9af5[_0x9388('0x37')](_0x9388('0x8d'))){_0x4c4a89(_0x3e9af5);}else{return db[_0x9388('0x89')][_0x9388('0x26')]({'where':{'name':_0x3e9af5[_0x9388('0x69')]}})[_0x9388('0x18')](function(_0x2fe205){if(_[_0x9388('0x57')](_0x2fe205))_0x3e9af5[_0x9388('0x8d')]=null;else _0x3e9af5[_0x9388('0x8d')]=_0x2fe205['id'];_0x4c4a89(_0x3e9af5);});}});}exports[_0x9388('0x95')]=function(_0xa6ab0f,_0x11457a){return db['CmContactHasItem'][_0x9388('0x22')]({'raw':!![],'where':{'CmContactId':_0xa6ab0f[_0x9388('0x27')]['id'],'ItemClass':_0x9388('0x8f')},'include':[{'model':db[_0x9388('0x89')],'as':_0x9388('0x69')}],'order':[[_0x9388('0x8a')],[db[_0x9388('0x6a')]['literal']('`ItemType`.OrderBy')]]})[_0x9388('0x18')](function(_0x46ad4f){return _0x46ad4f;})['then'](respondWithResult(_0x11457a,null))[_0x9388('0x24')](handleError(_0x11457a,null));};exports[_0x9388('0x96')]=function(_0x23a1fe,_0x432407){return db[_0x9388('0x4b')][_0x9388('0x22')]({'raw':!![],'where':{'CmContactId':_0x23a1fe[_0x9388('0x39')][_0x9388('0x97')]}})['then'](function(_0x45a310){var _0x4d51f9=_[_0x9388('0x70')](_0x45a310,function(_0x3235de){_0x3235de['CmContactId']=_0x23a1fe['body'][_0x9388('0x98')];return _0x3235de;});return db[_0x9388('0x4b')]['bulkCreate'](_0x4d51f9,{});})[_0x9388('0x18')](function(){return addCmHopperPhones(_0x23a1fe['body']['toContactId']);})[_0x9388('0x18')](function(){return['ok'];})[_0x9388('0x18')](respondWithResult(_0x432407,null))[_0x9388('0x24')](handleError(_0x432407,null));};exports[_0x9388('0x99')]=function(_0x59edfa,_0x3afcbb){var _0x4c1b39=[];_0x4c1b39['push'](createCmHopperPhone(_0x59edfa[_0x9388('0x39')]['id'],_0x59edfa['body'][_0x9388('0x9a')]));Promise['all'](_0x4c1b39)[_0x9388('0x18')](function(){return[0x1];})['then'](respondWithResult(_0x3afcbb,null));};exports[_0x9388('0x9b')]=function(_0x458b37,_0xd5d06e){var _0xe7e7c9={'raw':![],'where':{}};var _0x4ced15={};var _0x1639f3={'count':0x0,'rows':[]};return db[_0x9388('0x25')][_0x9388('0x86')]({'where':{'id':_0x458b37['params']['id']}})[_0x9388('0x18')](handleEntityNotFound(_0xd5d06e,null))[_0x9388('0x18')](function(_0x49b6fa){if(_0x49b6fa){_0x4ced15[_0x9388('0x7d')]=_['keys'](db['CmHopper']['rawAttributes']);_0x4ced15[_0x9388('0x2d')]=_['keys'](_0x458b37[_0x9388('0x2d')]);_0x4ced15[_0x9388('0x81')]=_[_0x9388('0x7c')](_0x4ced15[_0x9388('0x7d')],_0x4ced15[_0x9388('0x2d')]);_0xe7e7c9[_0x9388('0x7e')]=_[_0x9388('0x7c')](_0x4ced15['model'],qs['fields'](_0x458b37[_0x9388('0x2d')][_0x9388('0x7f')]));_0xe7e7c9['attributes']=_0xe7e7c9['attributes']['length']?_0xe7e7c9[_0x9388('0x7e')]:_0x4ced15[_0x9388('0x7d')];if(!_0x458b37[_0x9388('0x2d')][_0x9388('0x37')](_0x9388('0x85'))){_0xe7e7c9['limit']=qs[_0x9388('0x15')](_0x458b37[_0x9388('0x2d')][_0x9388('0x15')]);_0xe7e7c9['offset']=qs[_0x9388('0x13')](_0x458b37[_0x9388('0x2d')]['offset']);}_0xe7e7c9[_0x9388('0x9c')]=qs[_0x9388('0x80')](_0x458b37[_0x9388('0x2d')]['sort']);_0xe7e7c9['where']=qs[_0x9388('0x81')](_[_0x9388('0x82')](_0x458b37[_0x9388('0x2d')],_0x4ced15['filters']));_0xe7e7c9['where'][_0x9388('0x9d')]=_0x49b6fa['id'];if(_0x458b37[_0x9388('0x2d')][_0x9388('0x83')]){_0xe7e7c9[_0x9388('0x5d')]=_[_0x9388('0x38')](_0xe7e7c9[_0x9388('0x5d')],{'$or':_[_0x9388('0x70')](_0xe7e7c9[_0x9388('0x7e')],function(_0x487abe){var _0x103793={};_0x103793[_0x487abe]={'$like':'%'+_0x458b37[_0x9388('0x2d')][_0x9388('0x83')]+'%'};return _0x103793;})});}_0xe7e7c9=_[_0x9388('0x38')]({},_0xe7e7c9,_0x458b37[_0x9388('0x84')]);return db[_0x9388('0x3f')][_0x9388('0x16')]({'where':_0xe7e7c9['where']})[_0x9388('0x18')](function(_0x18d077){_0x1639f3[_0x9388('0x16')]=_0x18d077;if(_0x458b37[_0x9388('0x2d')][_0x9388('0x9e')]){_0xe7e7c9[_0x9388('0x9f')]=[{'all':!![]}];}return db[_0x9388('0x3f')][_0x9388('0x22')](_0xe7e7c9);})[_0x9388('0x18')](function(_0x47f324){_0x1639f3[_0x9388('0xa0')]=_0x47f324;return _0x1639f3;});}})[_0x9388('0x18')](respondWithFilteredResult(_0xd5d06e,_0xe7e7c9))[_0x9388('0x24')](handleError(_0xd5d06e,null));};exports[_0x9388('0xa1')]=function(_0x3593ae,_0x57667b){var _0x470571={'raw':!![],'where':{}};var _0x4e0475={};var _0xac6cc={'count':0x0,'rows':[]};return db[_0x9388('0x25')]['findOne']({'where':{'id':_0x3593ae[_0x9388('0x27')]['id']}})[_0x9388('0x18')](handleEntityNotFound(_0x57667b,null))[_0x9388('0x18')](function(_0x5ec3dd){if(_0x5ec3dd){_0x4e0475[_0x9388('0x7d')]=_['keys'](db['CmHopperHistory'][_0x9388('0xa2')]);_0x4e0475['query']=_[_0x9388('0x29')](_0x3593ae[_0x9388('0x2d')]);_0x4e0475[_0x9388('0x81')]=_[_0x9388('0x7c')](_0x4e0475[_0x9388('0x7d')],_0x4e0475['query']);_0x470571['attributes']=_['intersection'](_0x4e0475[_0x9388('0x7d')],qs[_0x9388('0x7f')](_0x3593ae[_0x9388('0x2d')]['fields']));_0x470571[_0x9388('0x7e')]=_0x470571[_0x9388('0x7e')][_0x9388('0x2a')]?_0x470571['attributes']:_0x4e0475[_0x9388('0x7d')];if(!_0x3593ae[_0x9388('0x2d')][_0x9388('0x37')]('nolimit')){_0x470571[_0x9388('0x15')]=qs[_0x9388('0x15')](_0x3593ae[_0x9388('0x2d')]['limit']);_0x470571[_0x9388('0x13')]=qs['offset'](_0x3593ae[_0x9388('0x2d')][_0x9388('0x13')]);}_0x470571[_0x9388('0x9c')]=qs[_0x9388('0x80')](_0x3593ae[_0x9388('0x2d')][_0x9388('0x80')]);_0x470571['where']=qs[_0x9388('0x81')](_[_0x9388('0x82')](_0x3593ae['query'],_0x4e0475[_0x9388('0x81')]));_0x470571['where'][_0x9388('0x9d')]=_0x5ec3dd['id'];if(_0x3593ae[_0x9388('0x2d')]['filter']){_0x470571['where']=_['merge'](_0x470571[_0x9388('0x5d')],{'$or':_[_0x9388('0x70')](_0x470571[_0x9388('0x7e')],function(_0x42d93b){var _0x4cdebf={};_0x4cdebf[_0x42d93b]={'$like':'%'+_0x3593ae[_0x9388('0x2d')][_0x9388('0x83')]+'%'};return _0x4cdebf;})});}_0x470571=_[_0x9388('0x38')]({},_0x470571,_0x3593ae[_0x9388('0x84')]);return db[_0x9388('0x4d')][_0x9388('0x16')]({'where':_0x470571[_0x9388('0x5d')]})[_0x9388('0x18')](function(_0x21de6c){_0xac6cc[_0x9388('0x16')]=_0x21de6c;if(_0x3593ae[_0x9388('0x2d')][_0x9388('0x9e')]){_0x470571[_0x9388('0x9f')]=[{'all':!![]}];}return db[_0x9388('0x4d')][_0x9388('0x22')](_0x470571);})[_0x9388('0x18')](function(_0x48ce0e){_0xac6cc[_0x9388('0xa0')]=_0x48ce0e;return _0xac6cc;});}})[_0x9388('0x18')](respondWithFilteredResult(_0x57667b,_0x470571))['catch'](handleError(_0x57667b,null));};exports[_0x9388('0xa3')]=function(_0x44117f,_0x21bad2){var _0x271a60={'raw':!![],'where':{}};var _0x25827b={};var _0x42ed44={'count':0x0,'rows':[]};return db['CmContact'][_0x9388('0x86')]({'where':{'id':_0x44117f[_0x9388('0x27')]['id']}})[_0x9388('0x18')](handleEntityNotFound(_0x21bad2,null))[_0x9388('0x18')](function(_0x4cee3d){if(_0x4cee3d){_0x25827b[_0x9388('0x7d')]=_[_0x9388('0x29')](db[_0x9388('0x4c')]['rawAttributes']);_0x25827b[_0x9388('0x2d')]=_[_0x9388('0x29')](_0x44117f[_0x9388('0x2d')]);_0x25827b['filters']=_[_0x9388('0x7c')](_0x25827b[_0x9388('0x7d')],_0x25827b['query']);_0x271a60[_0x9388('0x7e')]=_[_0x9388('0x7c')](_0x25827b['model'],qs[_0x9388('0x7f')](_0x44117f[_0x9388('0x2d')][_0x9388('0x7f')]));_0x271a60['attributes']=_0x271a60['attributes'][_0x9388('0x2a')]?_0x271a60[_0x9388('0x7e')]:_0x25827b[_0x9388('0x7d')];if(!_0x44117f['query']['hasOwnProperty']('nolimit')){_0x271a60['limit']=qs[_0x9388('0x15')](_0x44117f[_0x9388('0x2d')][_0x9388('0x15')]);_0x271a60['offset']=qs[_0x9388('0x13')](_0x44117f[_0x9388('0x2d')][_0x9388('0x13')]);}_0x271a60['order']=qs['sort'](_0x44117f['query']['sort']);_0x271a60[_0x9388('0x5d')]=qs[_0x9388('0x81')](_[_0x9388('0x82')](_0x44117f['query'],_0x25827b[_0x9388('0x81')]));_0x271a60['where']['ContactId']=_0x4cee3d['id'];if(_0x44117f[_0x9388('0x2d')][_0x9388('0x83')]){_0x271a60['where']=_[_0x9388('0x38')](_0x271a60[_0x9388('0x5d')],{'$or':_[_0x9388('0x70')](_0x271a60[_0x9388('0x7e')],function(_0x1a6900){var _0x5e582b={};_0x5e582b[_0x1a6900]={'$like':'%'+_0x44117f[_0x9388('0x2d')]['filter']+'%'};return _0x5e582b;})});}_0x271a60=_['merge']({},_0x271a60,_0x44117f[_0x9388('0x84')]);return db['CmHopperFinal']['count']({'where':_0x271a60[_0x9388('0x5d')]})[_0x9388('0x18')](function(_0x43f900){_0x42ed44['count']=_0x43f900;if(_0x44117f['query'][_0x9388('0x9e')]){_0x271a60[_0x9388('0x9f')]=[{'all':!![]}];}return db[_0x9388('0x4c')][_0x9388('0x22')](_0x271a60);})[_0x9388('0x18')](function(_0x4f8483){_0x42ed44[_0x9388('0xa0')]=_0x4f8483;return _0x42ed44;});}})[_0x9388('0x18')](respondWithFilteredResult(_0x21bad2,_0x271a60))[_0x9388('0x24')](handleError(_0x21bad2,null));};exports[_0x9388('0xa4')]=function(_0xb0792d,_0x16b53f){var _0x3bf2ab={'raw':!![],'where':{}};var _0x38a1b9={};var _0x5a9aa2={'count':0x0,'rows':[]};return db[_0x9388('0x25')][_0x9388('0x86')]({'where':{'id':_0xb0792d[_0x9388('0x27')]['id']}})[_0x9388('0x18')](handleEntityNotFound(_0x16b53f,null))['then'](function(_0x3b38bf){if(_0x3b38bf){_0x38a1b9[_0x9388('0x7d')]=_['keys'](db['JscriptySessionReport'][_0x9388('0xa2')]);_0x38a1b9[_0x9388('0x2d')]=_[_0x9388('0x29')](_0xb0792d[_0x9388('0x2d')]);_0x38a1b9[_0x9388('0x81')]=_[_0x9388('0x7c')](_0x38a1b9[_0x9388('0x7d')],_0x38a1b9[_0x9388('0x2d')]);_0x3bf2ab[_0x9388('0x7e')]=_[_0x9388('0x7c')](_0x38a1b9[_0x9388('0x7d')],qs['fields'](_0xb0792d[_0x9388('0x2d')][_0x9388('0x7f')]));_0x3bf2ab['attributes']=_0x3bf2ab[_0x9388('0x7e')][_0x9388('0x2a')]?_0x3bf2ab[_0x9388('0x7e')]:_0x38a1b9[_0x9388('0x7d')];if(!_0xb0792d[_0x9388('0x2d')][_0x9388('0x37')](_0x9388('0x85'))){_0x3bf2ab[_0x9388('0x15')]=qs[_0x9388('0x15')](_0xb0792d[_0x9388('0x2d')][_0x9388('0x15')]);_0x3bf2ab[_0x9388('0x13')]=qs[_0x9388('0x13')](_0xb0792d[_0x9388('0x2d')][_0x9388('0x13')]);}_0x3bf2ab['order']=qs['sort'](_0xb0792d[_0x9388('0x2d')][_0x9388('0x80')]);_0x3bf2ab[_0x9388('0x5d')]=qs[_0x9388('0x81')](_[_0x9388('0x82')](_0xb0792d[_0x9388('0x2d')],_0x38a1b9[_0x9388('0x81')]));_0x3bf2ab[_0x9388('0x5d')][_0x9388('0x9d')]=_0x3b38bf['id'];if(_0xb0792d['query'][_0x9388('0x83')]){_0x3bf2ab[_0x9388('0x5d')]=_[_0x9388('0x38')](_0x3bf2ab[_0x9388('0x5d')],{'$or':_['map'](_0x3bf2ab['attributes'],function(_0x204047){var _0x13d813={};_0x13d813[_0x204047]={'$like':'%'+_0xb0792d[_0x9388('0x2d')][_0x9388('0x83')]+'%'};return _0x13d813;})});}_0x3bf2ab=_[_0x9388('0x38')]({},_0x3bf2ab,_0xb0792d[_0x9388('0x84')]);return db[_0x9388('0x53')]['count']({'where':_0x3bf2ab[_0x9388('0x5d')]})[_0x9388('0x18')](function(_0x5472e5){_0x5a9aa2[_0x9388('0x16')]=_0x5472e5;if(_0xb0792d[_0x9388('0x2d')][_0x9388('0x9e')]){_0x3bf2ab['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x9388('0x22')](_0x3bf2ab);})['then'](function(_0xe16379){_0x5a9aa2[_0x9388('0xa0')]=_0xe16379;return _0x5a9aa2;});}})[_0x9388('0x18')](respondWithFilteredResult(_0x16b53f,_0x3bf2ab))['catch'](handleError(_0x16b53f,null));};exports[_0x9388('0xa5')]=function(_0xe603a5,_0x244fa6){try{if(!_0xe603a5[_0x9388('0x39')][_0x9388('0x60')]){throw new Error(_0x9388('0xa6'));}if(!_0xe603a5[_0x9388('0x39')][_0x9388('0xa7')]){throw new Error(_0x9388('0xa8'));}if(!_0xe603a5['body'][_0x9388('0xa9')]){throw new Error(_0x9388('0xaa'));}if(!_0xe603a5['body']['socket_timestamp']){throw new Error(_0x9388('0xab'));}var _0x2aa5b6=_0xe603a5[_0x9388('0x39')]['binding_keys'][_0x9388('0xac')](',');var _0x1a993c=_0xe603a5[_0x9388('0x39')][_0x9388('0xa9')]['split'](',');if(!_0x2aa5b6['length']||!_0x1a993c[_0x9388('0x2a')]||_0x2aa5b6['length']!==_0x1a993c[_0x9388('0x2a')]){throw new Error(_0x9388('0xad'));}_0xe603a5[_0x9388('0x39')][_0x9388('0x7f')]=_[_0x9388('0xae')](_0x2aa5b6,_0x1a993c);if(!_0xe603a5['body'][_0x9388('0x7f')][_0x9388('0x79')]){throw new Error(_0x9388('0xaf'));}if(!_0xe603a5[_0x9388('0x39')]['fields'][_0x9388('0xb0')]){throw new Error(_0x9388('0xb1'));}var _0x558ac4=path[_0x9388('0x3d')](config[_0x9388('0xb2')],_0x9388('0xb3'),_0xe603a5[_0x9388('0xb4')][_0x9388('0xb5')]);fs[_0x9388('0xb6')](_0x558ac4,parseInt(_0x9388('0xb7'),0x8));var _0x14dc1f=require(_0x9388('0xb8'))[_0x9388('0xb9')](path[_0x9388('0x3d')](__dirname,_0x9388('0xba')),[_0x558ac4,_0xe603a5[_0x9388('0x39')][_0x9388('0xa7')],_0xe603a5[_0x9388('0x39')][_0x9388('0xa9')],_0xe603a5[_0x9388('0x39')]['ListId'],_0xe603a5[_0x9388('0x39')][_0x9388('0xbb')],_0xe603a5[_0x9388('0x39')]['duplicates'],_0xe603a5['body'][_0x9388('0xbc')]]);return _0x244fa6['status'](0xc8)[_0x9388('0xbd')]({'message':_0x9388('0xbe'),'pid':_0x14dc1f[_0x9388('0xbf')]});}catch(_0x1457c8){return _0x244fa6[_0x9388('0x12')](0x1f4)[_0x9388('0x1e')](_0x1457c8);}};exports[_0x9388('0xc0')]=function(_0x4506e0,_0x1cf9bc){var _0x2bf282=fs[_0x9388('0xc1')](_0x4506e0[_0x9388('0xb4')][_0x9388('0x3')]);Papa[_0x9388('0xc2')](_0x2bf282,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x512aee){return _0x1cf9bc[_0x9388('0x12')](0xc8)[_0x9388('0xbd')]({'file':_0x4506e0['file'],'fields':_0x512aee[_0x9388('0xc3')][_0x9388('0x7f')]});}});};exports['import']=function(_0x33c645,_0x2ffda4){return db[_0x9388('0xc4')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x9388('0xc5')}})[_0x9388('0x18')](function(_0x6991b9){var _0x28f093=![];if(!_0x33c645[_0x9388('0x39')]['ListId']){throw new Error(_0x9388('0xa6'));}if(!_0x33c645[_0x9388('0x39')][_0x9388('0xc6')][_0x9388('0x79')]){throw new Error(_0x9388('0xaf'));}if(!_0x33c645[_0x9388('0x39')][_0x9388('0xc6')][_0x9388('0xb0')]){throw new Error(_0x9388('0xb1'));}if(!_0x33c645[_0x9388('0x39')][_0x9388('0xbc')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3c4144=require(_0x9388('0xb8'))[_0x9388('0xb9')](path[_0x9388('0x3d')](__dirname,_0x9388('0xc7')),[_0x33c645[_0x9388('0x27')]['id'],JSON[_0x9388('0xc8')](_0x33c645[_0x9388('0x39')]),JSON[_0x9388('0xc8')](_0x6991b9)]);_0x3c4144['on'](_0x9388('0xc9'),function(){_0x28f093=!![];return _0x2ffda4[_0x9388('0x12')](0xc8)[_0x9388('0xbd')]({'message':_0x9388('0xca'),'pid':_0x3c4144[_0x9388('0xbf')]});});_0x3c4144['on'](_0x9388('0xcb'),function(_0xf1dfc3){if(_0xf1dfc3&&!_0x28f093){return _0x2ffda4[_0x9388('0x12')](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x3c4144[_0x9388('0xbf')]});}});})[_0x9388('0x24')](handleError(_0x2ffda4,null));};exports[_0x9388('0xcc')]=function(_0x80e0a7,_0x4edf8c){return db[_0x9388('0xc4')][_0x9388('0x22')]({'raw':!![],'attributes':['id'],'where':{'role':_0x9388('0xc5')}})[_0x9388('0x18')](function(_0x2e0f38){var _0x30d2c7=![];if(!_0x80e0a7['body'][_0x9388('0x60')]){throw new Error(_0x9388('0xa6'));}if(!_0x80e0a7[_0x9388('0x39')][_0x9388('0xc6')]['phone']){throw new Error(_0x9388('0xaf'));}if(!_0x80e0a7[_0x9388('0x39')][_0x9388('0xc6')]['firstName']){throw new Error(_0x9388('0xb1'));}if(!_0x80e0a7[_0x9388('0x39')][_0x9388('0xbc')]){throw new Error(_0x9388('0xab'));}var _0x1f2daa=require('child_process')[_0x9388('0xb9')](path['join'](__dirname,_0x9388('0xcd')),[_0x80e0a7['params']['id'],JSON[_0x9388('0xc8')](_0x80e0a7[_0x9388('0x39')]),JSON[_0x9388('0xc8')](_0x2e0f38)]);_0x1f2daa['on'](_0x9388('0xc9'),function(){_0x30d2c7=!![];return _0x4edf8c['status'](0xc8)['json']({'message':_0x9388('0xca'),'pid':_0x1f2daa[_0x9388('0xbf')]});});_0x1f2daa['on']('exit',function(_0x31e143){if(_0x31e143&&!_0x30d2c7){return _0x4edf8c[_0x9388('0x12')](0x1f4)['json']({'message':_0x9388('0xce'),'pid':_0x1f2daa[_0x9388('0xbf')]});}});})[_0x9388('0x24')](handleError(_0x4edf8c,null));};exports[_0x9388('0xcf')]=function(_0xd9fd1b,_0x311739){var _0xbbcd65=[_0x9388('0xd0'),_0x9388('0xd1'),_0x9388('0xd2'),_0x9388('0xd3'),_0x9388('0xd4'),_0x9388('0xd5'),_0x9388('0xd6')];var _0x4d6fb1={'offset':0x0,'order':qs[_0x9388('0x80')](_0x9388('0xd7'))},_0x35807d={'count':0x0,'rows':[]};Promise['resolve']()[_0x9388('0x18')](function(){if(_0xd9fd1b[_0x9388('0x2d')]['channel']){if(!_[_0x9388('0xd8')](_0xbbcd65,_0xd9fd1b[_0x9388('0x2d')][_0x9388('0xd9')][_0x9388('0xda')]())){throw new Error(_0x9388('0xdb'));}_0xbbcd65=[_0xd9fd1b[_0x9388('0x2d')][_0x9388('0xd9')][_0x9388('0xda')]()];}if(_0xd9fd1b['query'][_0x9388('0xdc')]){try{var _0x3f6605=JSON[_0x9388('0xc2')](_0xd9fd1b[_0x9388('0x2d')][_0x9388('0xdc')]);if(!moment(_0x3f6605[_0x9388('0x3e')])[_0x9388('0xdd')]()){throw new Error(_0x9388('0xde'));}if(!moment(_0x3f6605['to'])['isValid']()){throw new Error(_0x9388('0xdf'));}}catch(_0x20f103){throw new Error(_0x9388('0xe0'));}}if(!_0xd9fd1b[_0x9388('0x2d')][_0x9388('0x37')](_0x9388('0x85'))){_0x4d6fb1[_0x9388('0x15')]=qs[_0x9388('0x15')](_0xd9fd1b[_0x9388('0x2d')][_0x9388('0x15')]||0xa);_0x4d6fb1['offset']=qs[_0x9388('0x13')](_0xd9fd1b['query']['offset']);}var _0x1a1d05=_0xbbcd65[_0x9388('0x70')](function(_0x364815){if(_0x364815===_0x9388('0xd6')){var _0x5d92cf={'attributes':['id',_0x9388('0xe1'),_0x9388('0xe2'),_0x9388('0xe3'),'destination',_0x9388('0xe4'),'starttime',_0x9388('0xe5'),'duration',_0x9388('0xe6'),_0x9388('0xe7'),'userDisposition','userSecondDisposition','userThirdDisposition',_0x9388('0xe8')],'where':{'ContactId':_0xd9fd1b[_0x9388('0x27')]['id']},'include':[{'model':db['User'],'as':'User','attributes':['id',_0x9388('0x1d'),_0x9388('0xe9'),_0x9388('0x31')]}],'order':[[_0x9388('0xe7'),_0x9388('0xea')]]};if(_0xd9fd1b[_0x9388('0x2d')][_0x9388('0xdc')]){_0x5d92cf[_0x9388('0x5d')][_0x9388('0xe7')]={'$gte':_0x3f6605[_0x9388('0x3e')],'$lte':_0x3f6605['to']};}return db['VoiceCallReport'][_0x9388('0xeb')](_0x5d92cf)[_0x9388('0x18')](function(_0x115529){_0x35807d[_0x9388('0x16')]+=_0x115529['count'];return _[_0x9388('0x70')](_0x115529[_0x9388('0xa0')],function(_0x58da11){var _0x16c082=_0x58da11[_0x9388('0x3a')]({'plain':!![]});_0x16c082[_0x9388('0xd9')]=_0x364815;if(_0x16c082[_0x9388('0xc4')]){_0x16c082[_0x9388('0xc4')]={'id':_0x16c082[_0x9388('0xc4')]['id'],'name':_0x16c082[_0x9388('0xc4')][_0x9388('0x1d')],'fullname':_0x16c082['User']['fullname'],'alias':_0x16c082['User'][_0x9388('0x31')]};}return _0x16c082;});});}else{var _0x588c1e=_['startCase'](_0x364815)+(_0x364815===_0x9388('0xd1')?_0x9388('0xec'):_0x9388('0xed'));var _0x520fe5={'attributes':['id',_0x9388('0xee'),'closedAt',_0x9388('0xe7'),_0x9388('0xe6'),_0x9388('0xef'),_0x9388('0xf0'),_0x9388('0xf1'),_0x9388('0xe8'),_0x588c1e+'Id'],'where':{'ContactId':_0xd9fd1b[_0x9388('0x27')]['id']},'include':[{'model':db[_0x588c1e],'as':_0x9388('0xed'),'attributes':['id','name',_0x9388('0xf2')]},{'model':db[_0x9388('0xc4')],'as':_0x9388('0xf3'),'attributes':['id','name',_0x9388('0xe9')]},{'model':db[_0x9388('0x7b')],'as':_0x9388('0x66'),'attributes':['id',_0x9388('0x1d'),_0x9388('0x67')],'through':{'attributes':[]}}],'order':[[_0x9388('0xe7'),_0x9388('0xea')]]};if(_0xd9fd1b['query']['range']){_0x520fe5[_0x9388('0x5d')]['createdAt']={'$gte':_0x3f6605[_0x9388('0x3e')],'$lte':_0x3f6605['to']};}switch(_0x364815){case _0x9388('0xd1'):_0x520fe5[_0x9388('0x7e')][_0x9388('0x5f')](_0x9388('0xf4'),_0x9388('0xf5'),_0x9388('0xf6'),_0x9388('0xf7'),_0x9388('0xf8'),_0x9388('0xf9'),_0x9388('0xfa'),_0x9388('0xfb'),_0x9388('0xfc'));break;case _0x9388('0xd0'):_0x520fe5[_0x9388('0x7e')][_0x9388('0x5f')](_0x9388('0xfd'),_0x9388('0xfe'));break;case _0x9388('0xd3'):_0x520fe5[_0x9388('0x7e')][_0x9388('0x5f')](_0x9388('0xff'),_0x9388('0x100'));break;}return db[_[_0x9388('0x101')](_0x364815)+'Interaction'][_0x9388('0xeb')](_0x520fe5)[_0x9388('0x18')](function(_0x4c866b){_0x35807d[_0x9388('0x16')]+=_0x4c866b[_0x9388('0x16')];return _[_0x9388('0x70')](_0x4c866b['rows'],function(_0x1c9c72){var _0x3a065d=_0x1c9c72[_0x9388('0x3a')]({'plain':!![]});_0x3a065d[_0x9388('0xd9')]=_0x364815;if(_0x3a065d[_0x9388('0xf3')]){_0x3a065d[_0x9388('0xf3')]={'id':_0x3a065d[_0x9388('0xf3')]['id'],'name':_0x3a065d[_0x9388('0xf3')][_0x9388('0x1d')],'fullname':_0x3a065d[_0x9388('0xf3')][_0x9388('0xe9')]};}return _0x3a065d;});});}});return Promise[_0x9388('0x64')](_0x1a1d05);})[_0x9388('0x18')](function(_0x3a254d){return _(_0x3a254d)[_0x9388('0x102')]()[_0x9388('0x103')](_0x9388('0xe7'))['reverse']()[_0x9388('0x104')]();})[_0x9388('0x18')](function(_0x5e3bc7){_0x35807d[_0x9388('0xa0')]=_0x4d6fb1[_0x9388('0x15')]?_0x5e3bc7['slice'](_0x4d6fb1[_0x9388('0x13')],_0x4d6fb1[_0x9388('0x13')]+_0x4d6fb1[_0x9388('0x15')]):_0x5e3bc7;return _0x35807d;})[_0x9388('0x18')](respondWithFilteredResult(_0x311739,_0x4d6fb1))[_0x9388('0x24')](handleError(_0x311739,null));}; \ No newline at end of file +var _0x49d2=['../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','status','offset','undefined','limit','count','set','json','update','destroy','then','end','sendStatus','error','name','send','index','describe','query','user','params','catch','CmContact','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','alias','custom','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','columnName','merge','body','findAll','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','from','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatOfflineMessage','MailMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','push','where','ListId','findOrCreate','spread','contact','all','show','Tags','color','tag','ItemType','sequelize','literal','Phones.OrderBy','$and','map','format','find','cf_%d','isEmpty','table','cm_contacts','id\x20=\x20?','text','values','phone','getTags','findOne','Tag','rawAttributes','filters','intersection','model','attributes','fields','order','sort','pick','filter','options','nolimit','setTags','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','ContactId','include','rows','getHopperHistories','includeAll','CmHopperFinal','getJscriptySessions','No\x20ListId\x20specified','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','upload','createReadStream','meta','import','User','agent','binding','firstName','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','pid','importUpdates','../../components/import/cm/csvUpdates','error\x20child\x20process','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','parse','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','source','callerid','starttime','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','createdAt','DESC','findAndCountAll','startCase','Website','Account','closed','closedAt','secondDisposition','thirdDisposition','browserName','customerIp','customerPort','ratingMessage','ratingType','ratingValue','referer','mail','subject','substatus','externalUrl','Interaction','Owner','flatten','sortBy','reverse','slice','moment','bluebird','util','path','squel','ioredis','../../components/contacts','../../components/parsers/qs'];(function(_0xbb9b40,_0x51b63a){var _0x4cd1b3=function(_0x4c0343){while(--_0x4c0343){_0xbb9b40['push'](_0xbb9b40['shift']());}};_0x4cd1b3(++_0x51b63a);}(_0x49d2,0xf8));var _0x249d=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x49d2[_0x473738];return _0x1df4ae;};'use strict';var moment=require(_0x249d('0x0'));var BPromise=require(_0x249d('0x1'));var util=require(_0x249d('0x2'));var path=require(_0x249d('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x249d('0x4'));var Papa=require('papaparse');var Redis=require(_0x249d('0x5'));var contacts=require(_0x249d('0x6'));var qs=require(_0x249d('0x7'));var logger=require(_0x249d('0x8'))('api');var config=require(_0x249d('0x9'));var shared=require(_0x249d('0xa'));var db=require(_0x249d('0xb'))['db'];config['redis']=_[_0x249d('0xc')](config['redis'],{'host':_0x249d('0xd'),'port':0x18eb});var socket=require(_0x249d('0xe'))(new Redis(config[_0x249d('0xf')]));require('./cmContact.socket')[_0x249d('0x10')](socket);function respondWithResult(_0x259e6d,_0x25d634){_0x25d634=_0x25d634||0xc8;return function(_0x59cf93){if(_0x59cf93){return _0x259e6d[_0x249d('0x11')](_0x25d634)['json'](_0x59cf93);}};}function respondWithFilteredResult(_0x1bbf19,_0x591b8b){return function(_0x5a332a){if(_0x5a332a){var _0x25a825=typeof _0x591b8b[_0x249d('0x12')]===_0x249d('0x13')&&typeof _0x591b8b[_0x249d('0x14')]==='undefined';var _0xac378=_0x5a332a[_0x249d('0x15')];var _0x532331=_0x25a825?0x0:_0x591b8b[_0x249d('0x12')];var _0x13ef3a=_0x25a825?_0x5a332a[_0x249d('0x15')]:_0x591b8b[_0x249d('0x12')]+_0x591b8b['limit'];var _0x233111;if(_0x13ef3a>=_0xac378){_0x13ef3a=_0xac378;_0x233111=0xc8;}else{_0x233111=0xce;}_0x1bbf19['status'](_0x233111);return _0x1bbf19[_0x249d('0x16')]('Content-Range',_0x532331+'-'+_0x13ef3a+'/'+_0xac378)[_0x249d('0x17')](_0x5a332a);}return null;};}function saveUpdates(_0x27c309){return function(_0x2412f0){if(_0x2412f0){return _0x2412f0[_0x249d('0x18')](_0x27c309)['then'](function(_0x1799d7){return _0x1799d7;});}return null;};}function removeEntity(_0x3ec405){return function(_0x2043c2){if(_0x2043c2){return _0x2043c2[_0x249d('0x19')]()[_0x249d('0x1a')](function(){_0x3ec405[_0x249d('0x11')](0xcc)[_0x249d('0x1b')]();});}};}function handleEntityNotFound(_0x37cd13){return function(_0x1084b9){if(!_0x1084b9){_0x37cd13[_0x249d('0x1c')](0x194);}return _0x1084b9;};}function handleError(_0x307514,_0x571d13){_0x571d13=_0x571d13||0x1f4;return function(_0x55c826){logger[_0x249d('0x1d')](_0x55c826['stack']);if(_0x55c826['name']){delete _0x55c826[_0x249d('0x1e')];}_0x307514[_0x249d('0x11')](_0x571d13)[_0x249d('0x1f')](_0x55c826);};}exports[_0x249d('0x20')]=function(_0x57151e,_0x194d77){var _0x3e64be={};return contacts[_0x249d('0x21')]()[_0x249d('0x1a')](function(_0x26f53d){_0x3e64be=qs['getOptions'](_0x26f53d,_0x57151e);return contacts['findAll'](_0x57151e[_0x249d('0x22')],_0x57151e[_0x249d('0x23')],_0x3e64be,_0x26f53d);})['then'](respondWithFilteredResult(_0x194d77,_0x3e64be))['catch'](handleError(_0x194d77,null));};exports[_0x249d('0x19')]=function(_0x2b702f,_0x497854){return db['CmContact']['find']({'where':{'id':_0x2b702f[_0x249d('0x24')]['id']}})['then'](handleEntityNotFound(_0x497854,null))[_0x249d('0x1a')](removeEntity(_0x497854,null))[_0x249d('0x25')](handleError(_0x497854,null));};exports[_0x249d('0x21')]=function(_0xacce11,_0x260910){return db[_0x249d('0x26')][_0x249d('0x21')]()[_0x249d('0x1a')](function(_0x430499){delete _0x430499[_0x249d('0x27')];for(var _0x209850=0x0;_0x2098500x0){return new Promise(function(_0x5c18da){var _0x4ef3ed=[];for(var _0x3ab1b9=0x0;_0x3ab1b9<_0x129000['length'];_0x3ab1b9++){_0x4ef3ed['push'](insertAdditionalPhones(_0x129000[_0x3ab1b9][_0x249d('0x65')],_0x129000[_0x3ab1b9][_0x249d('0x5b')]));}Promise[_0x249d('0x66')](_0x4ef3ed)[_0x249d('0x1a')](function(){_0x5c18da(0x1);});})[_0x249d('0x1a')](function(){return{'success':_0x448c71,'failure':_0x2b211a,'duplicates':_0x2093a3};});}else{return{'success':_0x448c71,'failure':_0x2b211a,'duplicates':_0x2093a3};}}})[_0x249d('0x1a')](respondWithResult(_0x41f787,0xc9))[_0x249d('0x25')](handleError(_0x41f787,null));};exports[_0x249d('0x67')]=function(_0x3210ec,_0x319a4a){var _0xba2a40;return db[_0x249d('0x26')][_0x249d('0x21')]()[_0x249d('0x1a')](function(_0x224642){return db[_0x249d('0x26')]['find']({'where':{'id':_0x3210ec['params']['id']},'include':[{'model':db['Tag'],'as':_0x249d('0x68'),'attributes':['id',_0x249d('0x1e'),_0x249d('0x69')],'required':_0x3210ec[_0x249d('0x22')][_0x249d('0x6a')]?!![]:![]},{'model':db[_0x249d('0x4b')],'as':'Phones','where':{'CmContactId':_0x3210ec[_0x249d('0x24')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x249d('0x6b')}]}],'order':[db[_0x249d('0x6c')][_0x249d('0x6d')](_0x249d('0x6e'))],'attributes':_[_0x249d('0x28')](_0x224642)});})['then'](function(_0xbb7795){if(!_['isNil'](_0xbb7795)){_0xba2a40=_0xbb7795[_0x249d('0x3a')]({'plain':!![]});var _0x304104={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xbb7795&&_0xbb7795['ListId']){if(_0xbb7795[_0x249d('0x62')]){_0x304104['where'][_0x249d('0x6f')][_0x249d('0x60')]({'ListId':{'$ne':_0xbb7795[_0x249d('0x62')]}});}}return db[_0x249d('0x2d')][_0x249d('0x39')](_0x304104);}})[_0x249d('0x1a')](function(_0x122968){if(!_[_0x249d('0x57')](_0x122968)){return _['omit'](_0xba2a40,_[_0x249d('0x70')](_0x122968,function(_0x4d2ac0){return util[_0x249d('0x71')]('cf_%d',_0x4d2ac0['id']);}));}})['then'](handleEntityNotFound(_0x319a4a,null))[_0x249d('0x1a')](respondWithResult(_0x319a4a,null))[_0x249d('0x25')](handleError(_0x319a4a,null));};exports[_0x249d('0x18')]=function(_0x3a484c,_0x67de0f){var _0x450b64;if(_0x3a484c[_0x249d('0x38')]['id']){delete _0x3a484c[_0x249d('0x38')]['id'];}if(!_[_0x249d('0x57')](_0x3a484c['body']['dialTimezone'])){var _0x2b3273=_0x3a484c[_0x249d('0x38')][_0x249d('0x58')];if(!_[_0x249d('0x57')](shared['timezones'][_0x2b3273]))_0x3a484c[_0x249d('0x38')][_0x249d('0x5a')]=shared[_0x249d('0x59')][_0x2b3273][_0x249d('0x5a')];}return db[_0x249d('0x26')][_0x249d('0x72')]({'where':{'id':_0x3a484c[_0x249d('0x24')]['id']}})[_0x249d('0x1a')](handleEntityNotFound(_0x67de0f,null))[_0x249d('0x1a')](saveUpdates(_0x3a484c[_0x249d('0x38')],null))[_0x249d('0x1a')](function(_0x3d1a50){_0x450b64=_0x3d1a50;var _0x3bf2ae={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3d1a50&&_0x3d1a50[_0x249d('0x62')]){if(_0x3d1a50[_0x249d('0x62')]){_0x3bf2ae[_0x249d('0x61')][_0x249d('0x6f')][_0x249d('0x60')]({'ListId':{'$ne':_0x3d1a50[_0x249d('0x62')]}});}}return db['CmCustomField']['findAll'](_0x3bf2ae);})[_0x249d('0x1a')](function(_0x10d30a){if(_0x10d30a){return _['omit'](_['pickBy'](_0x3a484c[_0x249d('0x38')],function(_0x8c420f,_0x524522){return _[_0x249d('0x29')](_0x524522,_0x249d('0x2a'));}),_[_0x249d('0x70')](_0x10d30a,function(_0x228ba4){return util[_0x249d('0x71')](_0x249d('0x73'),_0x228ba4['id']);}));}})['then'](function(_0xa286b2){if(_0xa286b2&&!_[_0x249d('0x74')](_0xa286b2)){var _0x44039b=squel['update']()[_0x249d('0x75')](_0x249d('0x76'))['setFields'](_0xa286b2)['where'](_0x249d('0x77'),_0x3a484c[_0x249d('0x24')]['id'])['toParam']();return db[_0x249d('0x6c')][_0x249d('0x22')](_0x44039b[_0x249d('0x78')],{'replacements':_0x44039b[_0x249d('0x79')]});}})[_0x249d('0x1a')](function(){if(_0x3a484c[_0x249d('0x38')][_0x249d('0x7a')]&&_0x450b64){return db['CmHopper'][_0x249d('0x18')]({'phone':_0x3a484c[_0x249d('0x38')][_0x249d('0x7a')],'OrderBy':0x0},{'where':{'ContactId':_0x450b64['id']}});}})[_0x249d('0x1a')](function(){return _0x450b64;})[_0x249d('0x1a')](respondWithResult(_0x67de0f,null))['catch'](handleError(_0x67de0f,null));};exports[_0x249d('0x7b')]=function(_0x3f2bdb,_0x24a1ec){var _0x457842={};var _0xb09e6e={};var _0x3fd33c;var _0x156033;return db[_0x249d('0x26')][_0x249d('0x7c')]({'where':{'id':_0x3f2bdb[_0x249d('0x24')]['id']}})['then'](handleEntityNotFound(_0x24a1ec,null))[_0x249d('0x1a')](function(_0x24a274){if(_0x24a274){_0x3fd33c=_0x24a274;_0xb09e6e['model']=_[_0x249d('0x28')](db[_0x249d('0x7d')][_0x249d('0x7e')]);_0xb09e6e['query']=_['keys'](_0x3f2bdb['query']);_0xb09e6e[_0x249d('0x7f')]=_[_0x249d('0x80')](_0xb09e6e[_0x249d('0x81')],_0xb09e6e['query']);_0x457842[_0x249d('0x82')]=_[_0x249d('0x80')](_0xb09e6e[_0x249d('0x81')],qs[_0x249d('0x83')](_0x3f2bdb[_0x249d('0x22')]['fields']));_0x457842['attributes']=_0x457842[_0x249d('0x82')][_0x249d('0x2e')]?_0x457842[_0x249d('0x82')]:_0xb09e6e[_0x249d('0x81')];_0x457842[_0x249d('0x84')]=qs[_0x249d('0x85')](_0x3f2bdb['query'][_0x249d('0x85')]);_0x457842[_0x249d('0x61')]=qs[_0x249d('0x7f')](_[_0x249d('0x86')](_0x3f2bdb[_0x249d('0x22')],_0xb09e6e[_0x249d('0x7f')]));if(_0x3f2bdb[_0x249d('0x22')][_0x249d('0x87')]){_0x457842[_0x249d('0x61')]=_[_0x249d('0x37')](_0x457842[_0x249d('0x61')],{'$or':_[_0x249d('0x70')](_0x457842[_0x249d('0x82')],function(_0x938c9f){var _0x14399a={};_0x14399a[_0x938c9f]={'$like':'%'+_0x3f2bdb[_0x249d('0x22')]['filter']+'%'};return _0x14399a;})});}_0x457842=_['merge']({},_0x457842,_0x3f2bdb[_0x249d('0x88')]);return _0x3fd33c[_0x249d('0x7b')](_0x457842);}})[_0x249d('0x1a')](function(_0x15e4d2){if(_0x15e4d2){_0x156033=_0x15e4d2[_0x249d('0x2e')];if(!_0x3f2bdb['query']['hasOwnProperty'](_0x249d('0x89'))){_0x457842['limit']=qs[_0x249d('0x14')](_0x3f2bdb['query'][_0x249d('0x14')]);_0x457842['offset']=qs[_0x249d('0x12')](_0x3f2bdb[_0x249d('0x22')][_0x249d('0x12')]);}return _0x3fd33c[_0x249d('0x7b')](_0x457842);}})[_0x249d('0x1a')](function(_0x13c572){if(_0x13c572){return _0x13c572?{'count':_0x156033,'rows':_0x13c572}:null;}})[_0x249d('0x1a')](respondWithResult(_0x24a1ec,null))[_0x249d('0x25')](handleError(_0x24a1ec,null));};exports[_0x249d('0x8a')]=function(_0x130812,_0x331e2b){if(_0x130812[_0x249d('0x38')]['id']){delete _0x130812[_0x249d('0x38')]['id'];}return db[_0x249d('0x26')][_0x249d('0x7c')]({'where':{'id':_0x130812[_0x249d('0x24')]['id']}})[_0x249d('0x1a')](handleEntityNotFound(_0x331e2b,null))[_0x249d('0x1a')](function(_0x20405e){if(_0x20405e){return _0x20405e['setTags'](_0x130812[_0x249d('0x38')]['ids']||[]);}return null;})[_0x249d('0x1a')](respondWithResult(_0x331e2b,null))[_0x249d('0x25')](handleError(_0x331e2b,null));};exports[_0x249d('0x8b')]=function(_0x557a7d,_0x539aad){var _0x5c69a1=[];_0x5c69a1[_0x249d('0x60')](addAdditionalPhones(_0x557a7d[_0x249d('0x38')]));Promise['all'](_0x5c69a1)[_0x249d('0x1a')](function(){_0x5c69a1=[];_0x5c69a1['push'](deleteCmHopperPhones(_0x557a7d[_0x249d('0x38')]['id']));_0x5c69a1[_0x249d('0x60')](addCmHopperPhones(_0x557a7d[_0x249d('0x38')]['id']));Promise[_0x249d('0x66')](_0x5c69a1)['then'](function(){return[0x1];})[_0x249d('0x1a')](respondWithResult(_0x539aad,null));});};function addAdditionalPhones(_0x8245ca){var _0x5d03e2;return new Promise(function(_0x21d302){return db[_0x249d('0x4b')][_0x249d('0x19')]({'where':{'CmContactId':_0x8245ca['id']}})['then'](function(){db[_0x249d('0x8c')][_0x249d('0x39')]({'raw':!![],'attributes':['id',_0x249d('0x8d')]})['then'](function(_0x43c162){var _0x3b062d=[];for(var _0x2d428e=0x0;_0x2d428e<_0x8245ca[_0x249d('0x8e')][_0x249d('0x2e')];_0x2d428e++){var _0x5f2b55=_0x8245ca['item_types']?_[_0x249d('0x57')](_0x8245ca[_0x249d('0x8f')][_0x2d428e])?'':_0x8245ca['item_types'][_0x2d428e]:_0x8245ca[_0x249d('0x8e')][_0x2d428e][_0x249d('0x90')]?_0x8245ca[_0x249d('0x8e')][_0x2d428e][_0x249d('0x90')]:'';var _0x413d0f=_['isNil'](_0x8245ca[_0x249d('0x8e')][_0x2d428e][_0x249d('0x91')])?'':_0x8245ca[_0x249d('0x8e')][_0x2d428e][_0x249d('0x91')];var _0x11d7b4=_0x5f2b55+':'+_0x8245ca[_0x249d('0x8e')][_0x2d428e]['phone']+'§'+_0x413d0f;if(_[_0x249d('0x57')](_0x5d03e2))_0x5d03e2=_0x11d7b4;else _0x5d03e2+=';'+_0x11d7b4;var _0x8d887b=null;var _0x396cf2=null;if(_0x8245ca[_0x249d('0x8f')]){if(!_['isNil'](_0x8245ca[_0x249d('0x8f')][_0x2d428e])){_0x396cf2=_[_0x249d('0x72')](_0x43c162,function(_0x542025){return _0x542025['id']===_0x8245ca['item_types'][_0x2d428e];});if(!_[_0x249d('0x57')](_0x396cf2)){_0x8d887b=_0x396cf2[_0x249d('0x8d')];}}}else{if(!_[_0x249d('0x57')](_0x8245ca[_0x249d('0x8e')][_0x2d428e])){_0x396cf2=_[_0x249d('0x72')](_0x43c162,function(_0x2c019b){return _0x2c019b['id']===_0x8245ca[_0x249d('0x8e')][_0x2d428e]['ItemTypeId'];});if(!_[_0x249d('0x57')](_0x396cf2)){_0x8d887b=_0x2d428e;}}}if(_[_0x249d('0x57')](_0x8d887b)){_0x8d887b=0x64;}_0x3b062d[_0x249d('0x60')](addAdditionalPhone(_0x8245ca['id'],_0x8245ca[_0x249d('0x8e')][_0x2d428e]['phone'],_0x8245ca['item_types']?_['isNil'](_0x8245ca[_0x249d('0x8f')][_0x2d428e])?null:_0x8245ca[_0x249d('0x8f')][_0x2d428e]:_0x8245ca[_0x249d('0x8e')][_0x2d428e]['ItemTypeId']?_0x8245ca[_0x249d('0x8e')][_0x2d428e]['ItemTypeId']:null,_0x8d887b,_0x413d0f));}Promise[_0x249d('0x66')](_0x3b062d)['then'](function(){db['CmContact']['update']({'AdditionalPhones':_0x5d03e2},{'where':{'id':_0x8245ca['id']}})[_0x249d('0x1a')](function(){_0x21d302(0x1);});});});});});}function addAdditionalPhone(_0x58fee1,_0xfd3e8c,_0x41cf25,_0x4e8a57,_0x3df2c4){return db['CmContactHasItem'][_0x249d('0x72')]({'where':{'CmContactId':_0x58fee1,'item':_0xfd3e8c}})[_0x249d('0x1a')](function(_0x3d4e34){if(_0x3d4e34)logger[_0x249d('0x32')](_0x249d('0x92'),_0x3d4e34);else{db[_0x249d('0x4b')][_0x249d('0x56')]({'CmContactId':_0x58fee1,'item':_0xfd3e8c,'ItemTypeId':_0x41cf25,'OrderBy':_0x4e8a57,'ItemClass':_0x249d('0x93'),'description':_0x3df2c4});}});}function deleteCmHopperPhones(_0x44de22){return new Promise(function(_0x47d019){return db['CmHopper'][_0x249d('0x39')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x44de22}})[_0x249d('0x1a')](function(_0x8f9ee1){db[_0x249d('0x94')][_0x249d('0x19')]({'where':{'CmHopperId':{'$in':_[_0x249d('0x70')](_0x8f9ee1,'id')}}});})['then'](function(){_0x47d019(0x1);});});}function addCmHopperPhones(_0x33a1d){return new Promise(function(_0x129b2e){return db['CmHopper'][_0x249d('0x39')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x33a1d}})[_0x249d('0x1a')](function(_0x27eda5){var _0x3f3589=[];_[_0x249d('0x70')](_0x27eda5,function(_0x470715){_0x3f3589[_0x249d('0x60')](createCmHopperPhone(_0x33a1d,_0x470715['id']));});Promise[_0x249d('0x66')](_0x3f3589)['then'](function(){_0x129b2e(0x1);});});});}function createCmHopperPhone(_0x3e3229,_0x4a3647){return new Promise(function(_0x22c196){db['CmContactHasItem'][_0x249d('0x39')]({'raw':!![],'attributes':[_0x249d('0x95'),_0x249d('0x8d')],'where':{'CmContactId':_0x3e3229,'ItemClass':_0x249d('0x93')},'include':[{'model':db[_0x249d('0x8c')],'attributes':[_0x249d('0x8d')],'as':'ItemType'}],'order':[_0x249d('0x8d'),db[_0x249d('0x6c')][_0x249d('0x6d')](_0x249d('0x96'))]})[_0x249d('0x1a')](function(_0x23afdc){var _0x2c1119=0x1;var _0x26ebcf=_[_0x249d('0x70')](_0x23afdc,function(_0x18a21f){_0x18a21f[_0x249d('0x97')]=_0x4a3647;_0x18a21f[_0x249d('0x7a')]=_0x18a21f[_0x249d('0x95')];_0x18a21f[_0x249d('0x8d')]=_0x2c1119;delete _0x18a21f['ItemType.OrderBy'];_0x2c1119=_0x2c1119+0x1;return _0x18a21f;});return db[_0x249d('0x94')]['bulkCreate'](_0x26ebcf,{});})[_0x249d('0x1a')](function(){_0x22c196(0x1);});});}function insertAdditionalPhones(_0x58780e,_0x326baf){return new Promise(function(_0x198a87){var _0xf579af=[];for(var _0x437451=0x0;_0x437451<_0x326baf[_0x249d('0x2e')];_0x437451++){var _0x52afcb=_0x326baf[_0x437451];_0xf579af[_0x249d('0x60')](parseContactItemType(_0x52afcb));}Promise[_0x249d('0x66')](_0xf579af)[_0x249d('0x1a')](function(){var _0x49ac84={'id':_0x58780e['id'],'items':_0x326baf};return addAdditionalPhones(_0x49ac84)['then'](function(){return addCmHopperPhones(_0x58780e['id']);});})[_0x249d('0x1a')](function(){_0x198a87(_0x58780e);});});}function parseContactItemType(_0x549d50){return new Promise(function(_0x21090e){if(_0x549d50[_0x249d('0x35')](_0x249d('0x90'))){_0x21090e(_0x549d50);}else{return db[_0x249d('0x8c')][_0x249d('0x72')]({'where':{'name':_0x549d50['ItemType']}})[_0x249d('0x1a')](function(_0x1baca9){if(_['isNil'](_0x1baca9))_0x549d50[_0x249d('0x90')]=null;else _0x549d50[_0x249d('0x90')]=_0x1baca9['id'];_0x21090e(_0x549d50);});}});}exports[_0x249d('0x98')]=function(_0x19a3de,_0x1d5077){return db[_0x249d('0x4b')][_0x249d('0x39')]({'raw':!![],'where':{'CmContactId':_0x19a3de[_0x249d('0x24')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0x249d('0x8c')],'as':'ItemType'}],'order':[[_0x249d('0x8d')],[db[_0x249d('0x6c')]['literal'](_0x249d('0x96'))]]})[_0x249d('0x1a')](function(_0x258591){return _0x258591;})[_0x249d('0x1a')](respondWithResult(_0x1d5077,null))['catch'](handleError(_0x1d5077,null));};exports[_0x249d('0x99')]=function(_0x5ed4a5,_0x51bc4d){return db[_0x249d('0x4b')][_0x249d('0x39')]({'raw':!![],'where':{'CmContactId':_0x5ed4a5[_0x249d('0x38')][_0x249d('0x9a')]}})['then'](function(_0xe018ad){var _0x46830f=_[_0x249d('0x70')](_0xe018ad,function(_0xa23237){_0xa23237[_0x249d('0x9b')]=_0x5ed4a5[_0x249d('0x38')][_0x249d('0x9c')];return _0xa23237;});return db['CmContactHasItem'][_0x249d('0x5c')](_0x46830f,{});})[_0x249d('0x1a')](function(){return addCmHopperPhones(_0x5ed4a5[_0x249d('0x38')][_0x249d('0x9c')]);})[_0x249d('0x1a')](function(){return['ok'];})[_0x249d('0x1a')](respondWithResult(_0x51bc4d,null))[_0x249d('0x25')](handleError(_0x51bc4d,null));};exports[_0x249d('0x9d')]=function(_0x1e1b85,_0x3cd65d){var _0x518da0=[];_0x518da0['push'](createCmHopperPhone(_0x1e1b85[_0x249d('0x38')]['id'],_0x1e1b85[_0x249d('0x38')][_0x249d('0x9e')]));Promise[_0x249d('0x66')](_0x518da0)['then'](function(){return[0x1];})[_0x249d('0x1a')](respondWithResult(_0x3cd65d,null));};exports['getHoppers']=function(_0xa6afe6,_0x549dc8){var _0x3e7bef={'raw':![],'where':{}};var _0x43d10e={};var _0x4fd7ba={'count':0x0,'rows':[]};return db[_0x249d('0x26')][_0x249d('0x7c')]({'where':{'id':_0xa6afe6[_0x249d('0x24')]['id']}})[_0x249d('0x1a')](handleEntityNotFound(_0x549dc8,null))[_0x249d('0x1a')](function(_0xccd26b){if(_0xccd26b){_0x43d10e[_0x249d('0x81')]=_['keys'](db[_0x249d('0x3f')][_0x249d('0x7e')]);_0x43d10e[_0x249d('0x22')]=_[_0x249d('0x28')](_0xa6afe6[_0x249d('0x22')]);_0x43d10e[_0x249d('0x7f')]=_[_0x249d('0x80')](_0x43d10e[_0x249d('0x81')],_0x43d10e['query']);_0x3e7bef[_0x249d('0x82')]=_[_0x249d('0x80')](_0x43d10e['model'],qs[_0x249d('0x83')](_0xa6afe6[_0x249d('0x22')]['fields']));_0x3e7bef['attributes']=_0x3e7bef[_0x249d('0x82')]['length']?_0x3e7bef[_0x249d('0x82')]:_0x43d10e['model'];if(!_0xa6afe6['query']['hasOwnProperty'](_0x249d('0x89'))){_0x3e7bef[_0x249d('0x14')]=qs[_0x249d('0x14')](_0xa6afe6['query'][_0x249d('0x14')]);_0x3e7bef['offset']=qs[_0x249d('0x12')](_0xa6afe6[_0x249d('0x22')]['offset']);}_0x3e7bef[_0x249d('0x84')]=qs[_0x249d('0x85')](_0xa6afe6[_0x249d('0x22')]['sort']);_0x3e7bef[_0x249d('0x61')]=qs[_0x249d('0x7f')](_['pick'](_0xa6afe6[_0x249d('0x22')],_0x43d10e['filters']));_0x3e7bef[_0x249d('0x61')][_0x249d('0x9f')]=_0xccd26b['id'];if(_0xa6afe6[_0x249d('0x22')]['filter']){_0x3e7bef['where']=_[_0x249d('0x37')](_0x3e7bef[_0x249d('0x61')],{'$or':_[_0x249d('0x70')](_0x3e7bef['attributes'],function(_0x4f34cf){var _0x4f56bb={};_0x4f56bb[_0x4f34cf]={'$like':'%'+_0xa6afe6[_0x249d('0x22')]['filter']+'%'};return _0x4f56bb;})});}_0x3e7bef=_[_0x249d('0x37')]({},_0x3e7bef,_0xa6afe6[_0x249d('0x88')]);return db['CmHopper'][_0x249d('0x15')]({'where':_0x3e7bef[_0x249d('0x61')]})[_0x249d('0x1a')](function(_0x538a6c){_0x4fd7ba[_0x249d('0x15')]=_0x538a6c;if(_0xa6afe6[_0x249d('0x22')]['includeAll']){_0x3e7bef[_0x249d('0xa0')]=[{'all':!![]}];}return db['CmHopper'][_0x249d('0x39')](_0x3e7bef);})['then'](function(_0x8ea64){_0x4fd7ba[_0x249d('0xa1')]=_0x8ea64;return _0x4fd7ba;});}})[_0x249d('0x1a')](respondWithFilteredResult(_0x549dc8,_0x3e7bef))[_0x249d('0x25')](handleError(_0x549dc8,null));};exports[_0x249d('0xa2')]=function(_0xc46235,_0x8cffe4){var _0x1263b8={'raw':!![],'where':{}};var _0x36cf84={};var _0x13af7a={'count':0x0,'rows':[]};return db[_0x249d('0x26')][_0x249d('0x7c')]({'where':{'id':_0xc46235['params']['id']}})[_0x249d('0x1a')](handleEntityNotFound(_0x8cffe4,null))['then'](function(_0x31df98){if(_0x31df98){_0x36cf84[_0x249d('0x81')]=_[_0x249d('0x28')](db[_0x249d('0x4c')][_0x249d('0x7e')]);_0x36cf84[_0x249d('0x22')]=_['keys'](_0xc46235['query']);_0x36cf84[_0x249d('0x7f')]=_[_0x249d('0x80')](_0x36cf84[_0x249d('0x81')],_0x36cf84[_0x249d('0x22')]);_0x1263b8[_0x249d('0x82')]=_['intersection'](_0x36cf84[_0x249d('0x81')],qs[_0x249d('0x83')](_0xc46235[_0x249d('0x22')][_0x249d('0x83')]));_0x1263b8[_0x249d('0x82')]=_0x1263b8[_0x249d('0x82')][_0x249d('0x2e')]?_0x1263b8['attributes']:_0x36cf84[_0x249d('0x81')];if(!_0xc46235[_0x249d('0x22')][_0x249d('0x35')](_0x249d('0x89'))){_0x1263b8[_0x249d('0x14')]=qs[_0x249d('0x14')](_0xc46235['query'][_0x249d('0x14')]);_0x1263b8[_0x249d('0x12')]=qs[_0x249d('0x12')](_0xc46235['query'][_0x249d('0x12')]);}_0x1263b8[_0x249d('0x84')]=qs[_0x249d('0x85')](_0xc46235[_0x249d('0x22')][_0x249d('0x85')]);_0x1263b8['where']=qs[_0x249d('0x7f')](_[_0x249d('0x86')](_0xc46235[_0x249d('0x22')],_0x36cf84[_0x249d('0x7f')]));_0x1263b8['where'][_0x249d('0x9f')]=_0x31df98['id'];if(_0xc46235[_0x249d('0x22')]['filter']){_0x1263b8['where']=_[_0x249d('0x37')](_0x1263b8[_0x249d('0x61')],{'$or':_[_0x249d('0x70')](_0x1263b8[_0x249d('0x82')],function(_0x4b09e4){var _0x31e666={};_0x31e666[_0x4b09e4]={'$like':'%'+_0xc46235[_0x249d('0x22')]['filter']+'%'};return _0x31e666;})});}_0x1263b8=_[_0x249d('0x37')]({},_0x1263b8,_0xc46235[_0x249d('0x88')]);return db[_0x249d('0x4c')]['count']({'where':_0x1263b8[_0x249d('0x61')]})[_0x249d('0x1a')](function(_0x3e57d2){_0x13af7a[_0x249d('0x15')]=_0x3e57d2;if(_0xc46235[_0x249d('0x22')][_0x249d('0xa3')]){_0x1263b8[_0x249d('0xa0')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1263b8);})[_0x249d('0x1a')](function(_0x42c5a0){_0x13af7a[_0x249d('0xa1')]=_0x42c5a0;return _0x13af7a;});}})[_0x249d('0x1a')](respondWithFilteredResult(_0x8cffe4,_0x1263b8))[_0x249d('0x25')](handleError(_0x8cffe4,null));};exports['getHopperFinals']=function(_0x492dcd,_0x29c616){var _0x3dcd7f={'raw':!![],'where':{}};var _0x1230dd={};var _0x5c6e19={'count':0x0,'rows':[]};return db[_0x249d('0x26')][_0x249d('0x7c')]({'where':{'id':_0x492dcd[_0x249d('0x24')]['id']}})[_0x249d('0x1a')](handleEntityNotFound(_0x29c616,null))[_0x249d('0x1a')](function(_0x41455c){if(_0x41455c){_0x1230dd[_0x249d('0x81')]=_[_0x249d('0x28')](db['CmHopperFinal'][_0x249d('0x7e')]);_0x1230dd['query']=_['keys'](_0x492dcd[_0x249d('0x22')]);_0x1230dd[_0x249d('0x7f')]=_[_0x249d('0x80')](_0x1230dd[_0x249d('0x81')],_0x1230dd[_0x249d('0x22')]);_0x3dcd7f[_0x249d('0x82')]=_[_0x249d('0x80')](_0x1230dd['model'],qs[_0x249d('0x83')](_0x492dcd[_0x249d('0x22')][_0x249d('0x83')]));_0x3dcd7f[_0x249d('0x82')]=_0x3dcd7f['attributes']['length']?_0x3dcd7f[_0x249d('0x82')]:_0x1230dd['model'];if(!_0x492dcd[_0x249d('0x22')][_0x249d('0x35')](_0x249d('0x89'))){_0x3dcd7f[_0x249d('0x14')]=qs[_0x249d('0x14')](_0x492dcd['query'][_0x249d('0x14')]);_0x3dcd7f[_0x249d('0x12')]=qs[_0x249d('0x12')](_0x492dcd[_0x249d('0x22')][_0x249d('0x12')]);}_0x3dcd7f[_0x249d('0x84')]=qs[_0x249d('0x85')](_0x492dcd[_0x249d('0x22')]['sort']);_0x3dcd7f[_0x249d('0x61')]=qs[_0x249d('0x7f')](_[_0x249d('0x86')](_0x492dcd['query'],_0x1230dd[_0x249d('0x7f')]));_0x3dcd7f['where'][_0x249d('0x9f')]=_0x41455c['id'];if(_0x492dcd[_0x249d('0x22')][_0x249d('0x87')]){_0x3dcd7f[_0x249d('0x61')]=_[_0x249d('0x37')](_0x3dcd7f[_0x249d('0x61')],{'$or':_[_0x249d('0x70')](_0x3dcd7f[_0x249d('0x82')],function(_0x3d29be){var _0x21f6d6={};_0x21f6d6[_0x3d29be]={'$like':'%'+_0x492dcd['query']['filter']+'%'};return _0x21f6d6;})});}_0x3dcd7f=_[_0x249d('0x37')]({},_0x3dcd7f,_0x492dcd[_0x249d('0x88')]);return db[_0x249d('0xa4')][_0x249d('0x15')]({'where':_0x3dcd7f['where']})[_0x249d('0x1a')](function(_0x1db666){_0x5c6e19[_0x249d('0x15')]=_0x1db666;if(_0x492dcd[_0x249d('0x22')][_0x249d('0xa3')]){_0x3dcd7f[_0x249d('0xa0')]=[{'all':!![]}];}return db[_0x249d('0xa4')][_0x249d('0x39')](_0x3dcd7f);})[_0x249d('0x1a')](function(_0x5913f7){_0x5c6e19[_0x249d('0xa1')]=_0x5913f7;return _0x5c6e19;});}})[_0x249d('0x1a')](respondWithFilteredResult(_0x29c616,_0x3dcd7f))[_0x249d('0x25')](handleError(_0x29c616,null));};exports[_0x249d('0xa5')]=function(_0x2b4794,_0x520215){var _0x39a2a1={'raw':!![],'where':{}};var _0x347378={};var _0x4b3be2={'count':0x0,'rows':[]};return db[_0x249d('0x26')][_0x249d('0x7c')]({'where':{'id':_0x2b4794['params']['id']}})[_0x249d('0x1a')](handleEntityNotFound(_0x520215,null))[_0x249d('0x1a')](function(_0x432702){if(_0x432702){_0x347378[_0x249d('0x81')]=_[_0x249d('0x28')](db[_0x249d('0x52')]['rawAttributes']);_0x347378[_0x249d('0x22')]=_[_0x249d('0x28')](_0x2b4794['query']);_0x347378[_0x249d('0x7f')]=_[_0x249d('0x80')](_0x347378['model'],_0x347378[_0x249d('0x22')]);_0x39a2a1[_0x249d('0x82')]=_[_0x249d('0x80')](_0x347378[_0x249d('0x81')],qs[_0x249d('0x83')](_0x2b4794[_0x249d('0x22')][_0x249d('0x83')]));_0x39a2a1['attributes']=_0x39a2a1[_0x249d('0x82')]['length']?_0x39a2a1[_0x249d('0x82')]:_0x347378[_0x249d('0x81')];if(!_0x2b4794['query'][_0x249d('0x35')](_0x249d('0x89'))){_0x39a2a1[_0x249d('0x14')]=qs['limit'](_0x2b4794[_0x249d('0x22')][_0x249d('0x14')]);_0x39a2a1[_0x249d('0x12')]=qs[_0x249d('0x12')](_0x2b4794[_0x249d('0x22')][_0x249d('0x12')]);}_0x39a2a1[_0x249d('0x84')]=qs['sort'](_0x2b4794[_0x249d('0x22')][_0x249d('0x85')]);_0x39a2a1['where']=qs[_0x249d('0x7f')](_['pick'](_0x2b4794['query'],_0x347378[_0x249d('0x7f')]));_0x39a2a1[_0x249d('0x61')]['ContactId']=_0x432702['id'];if(_0x2b4794['query'][_0x249d('0x87')]){_0x39a2a1['where']=_[_0x249d('0x37')](_0x39a2a1[_0x249d('0x61')],{'$or':_[_0x249d('0x70')](_0x39a2a1[_0x249d('0x82')],function(_0x3c1a71){var _0x406615={};_0x406615[_0x3c1a71]={'$like':'%'+_0x2b4794[_0x249d('0x22')]['filter']+'%'};return _0x406615;})});}_0x39a2a1=_[_0x249d('0x37')]({},_0x39a2a1,_0x2b4794[_0x249d('0x88')]);return db[_0x249d('0x52')][_0x249d('0x15')]({'where':_0x39a2a1['where']})[_0x249d('0x1a')](function(_0x51a94d){_0x4b3be2[_0x249d('0x15')]=_0x51a94d;if(_0x2b4794['query'][_0x249d('0xa3')]){_0x39a2a1[_0x249d('0xa0')]=[{'all':!![]}];}return db[_0x249d('0x52')][_0x249d('0x39')](_0x39a2a1);})[_0x249d('0x1a')](function(_0x54d7c9){_0x4b3be2[_0x249d('0xa1')]=_0x54d7c9;return _0x4b3be2;});}})[_0x249d('0x1a')](respondWithFilteredResult(_0x520215,_0x39a2a1))[_0x249d('0x25')](handleError(_0x520215,null));};exports['uploadCsv']=function(_0x3d317d,_0x2ad1c8){try{if(!_0x3d317d[_0x249d('0x38')][_0x249d('0x62')]){throw new Error(_0x249d('0xa6'));}if(!_0x3d317d[_0x249d('0x38')]['binding_keys']){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x3d317d['body']['binding_values']){throw new Error(_0x249d('0xa7'));}if(!_0x3d317d[_0x249d('0x38')][_0x249d('0xa8')]){throw new Error(_0x249d('0xa9'));}var _0x22d79d=_0x3d317d[_0x249d('0x38')][_0x249d('0xaa')][_0x249d('0xab')](',');var _0x50ae18=_0x3d317d[_0x249d('0x38')][_0x249d('0xac')][_0x249d('0xab')](',');if(!_0x22d79d[_0x249d('0x2e')]||!_0x50ae18[_0x249d('0x2e')]||_0x22d79d[_0x249d('0x2e')]!==_0x50ae18['length']){throw new Error(_0x249d('0xad'));}_0x3d317d[_0x249d('0x38')]['fields']=_[_0x249d('0xae')](_0x22d79d,_0x50ae18);if(!_0x3d317d[_0x249d('0x38')][_0x249d('0x83')][_0x249d('0x7a')]){throw new Error(_0x249d('0xaf'));}if(!_0x3d317d[_0x249d('0x38')][_0x249d('0x83')]['firstName']){throw new Error(_0x249d('0xb0'));}var _0x521fc0=path[_0x249d('0x3d')](config['root'],'server/files/tmp',_0x3d317d[_0x249d('0xb1')][_0x249d('0xb2')]);fs['chmodSync'](_0x521fc0,parseInt(_0x249d('0xb3'),0x8));var _0x509c0f=require(_0x249d('0xb4'))[_0x249d('0xb5')](path[_0x249d('0x3d')](__dirname,_0x249d('0xb6')),[_0x521fc0,_0x3d317d['body']['binding_keys'],_0x3d317d[_0x249d('0x38')][_0x249d('0xac')],_0x3d317d[_0x249d('0x38')][_0x249d('0x62')],_0x3d317d[_0x249d('0x38')][_0x249d('0xb7')],_0x3d317d['body'][_0x249d('0x5e')],_0x3d317d[_0x249d('0x38')]['socket_timestamp']]);return _0x2ad1c8[_0x249d('0x11')](0xc8)[_0x249d('0x17')]({'message':_0x249d('0xb8'),'pid':_0x509c0f['pid']});}catch(_0x28ffb7){return _0x2ad1c8[_0x249d('0x11')](0x1f4)[_0x249d('0x1f')](_0x28ffb7);}};exports[_0x249d('0xb9')]=function(_0x205217,_0x2c2e48){var _0x11b3ad=fs[_0x249d('0xba')](_0x205217['file'][_0x249d('0x3')]);Papa['parse'](_0x11b3ad,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x39c679){return _0x2c2e48[_0x249d('0x11')](0xc8)[_0x249d('0x17')]({'file':_0x205217['file'],'fields':_0x39c679[_0x249d('0xbb')][_0x249d('0x83')]});}});};exports[_0x249d('0xbc')]=function(_0x235f8b,_0x1a419d){return db[_0x249d('0xbd')][_0x249d('0x39')]({'raw':!![],'attributes':['id'],'where':{'role':_0x249d('0xbe')}})[_0x249d('0x1a')](function(_0x55fa77){var _0x3f0f8e=![];if(!_0x235f8b[_0x249d('0x38')][_0x249d('0x62')]){throw new Error('No\x20ListId\x20specified');}if(!_0x235f8b[_0x249d('0x38')][_0x249d('0xbf')][_0x249d('0x7a')]){throw new Error(_0x249d('0xaf'));}if(!_0x235f8b[_0x249d('0x38')][_0x249d('0xbf')][_0x249d('0xc0')]){throw new Error(_0x249d('0xb0'));}if(!_0x235f8b['body']['socket_timestamp']){throw new Error(_0x249d('0xa9'));}var _0x17f20b=require(_0x249d('0xb4'))[_0x249d('0xb5')](path[_0x249d('0x3d')](__dirname,_0x249d('0xc1')),[_0x235f8b['params']['id'],JSON[_0x249d('0xc2')](_0x235f8b[_0x249d('0x38')]),JSON[_0x249d('0xc2')](_0x55fa77)]);_0x17f20b['on'](_0x249d('0xc3'),function(){_0x3f0f8e=!![];return _0x1a419d[_0x249d('0x11')](0xc8)[_0x249d('0x17')]({'message':_0x249d('0xc4'),'pid':_0x17f20b['pid']});});_0x17f20b['on'](_0x249d('0xc5'),function(_0x361c96){if(_0x361c96&&!_0x3f0f8e){return _0x1a419d['status'](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x17f20b[_0x249d('0xc6')]});}});})[_0x249d('0x25')](handleError(_0x1a419d,null));};exports[_0x249d('0xc7')]=function(_0x6f084f,_0x2a1c25){return db[_0x249d('0xbd')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x249d('0xbe')}})[_0x249d('0x1a')](function(_0x34a60a){var _0x174b3b=![];if(!_0x6f084f[_0x249d('0x38')][_0x249d('0x62')]){throw new Error('No\x20ListId\x20specified');}if(!_0x6f084f[_0x249d('0x38')]['binding'][_0x249d('0x7a')]){throw new Error(_0x249d('0xaf'));}if(!_0x6f084f[_0x249d('0x38')][_0x249d('0xbf')][_0x249d('0xc0')]){throw new Error(_0x249d('0xb0'));}if(!_0x6f084f[_0x249d('0x38')][_0x249d('0xa8')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x1e3402=require(_0x249d('0xb4'))[_0x249d('0xb5')](path[_0x249d('0x3d')](__dirname,_0x249d('0xc8')),[_0x6f084f['params']['id'],JSON[_0x249d('0xc2')](_0x6f084f[_0x249d('0x38')]),JSON['stringify'](_0x34a60a)]);_0x1e3402['on'](_0x249d('0xc3'),function(){_0x174b3b=!![];return _0x2a1c25['status'](0xc8)[_0x249d('0x17')]({'message':_0x249d('0xc4'),'pid':_0x1e3402[_0x249d('0xc6')]});});_0x1e3402['on'](_0x249d('0xc5'),function(_0x18daf7){if(_0x18daf7&&!_0x174b3b){return _0x2a1c25[_0x249d('0x11')](0x1f4)['json']({'message':_0x249d('0xc9'),'pid':_0x1e3402[_0x249d('0xc6')]});}});})[_0x249d('0x25')](handleError(_0x2a1c25,null));};exports['getJourney']=function(_0x422589,_0x3c54ef){var _0x51fb35=['mail',_0x249d('0xca'),_0x249d('0xcb'),_0x249d('0xcc'),_0x249d('0xcd'),_0x249d('0xce'),_0x249d('0xcf')];var _0x2d5e03={'offset':0x0,'order':qs[_0x249d('0x85')](_0x249d('0xd0'))},_0x3a8c53={'count':0x0,'rows':[]};Promise[_0x249d('0xd1')]()[_0x249d('0x1a')](function(){if(_0x422589[_0x249d('0x22')][_0x249d('0xd2')]){if(!_[_0x249d('0xd3')](_0x51fb35,_0x422589[_0x249d('0x22')][_0x249d('0xd2')][_0x249d('0xd4')]())){throw new Error(_0x249d('0xd5'));}_0x51fb35=[_0x422589['query'][_0x249d('0xd2')]['toLowerCase']()];}if(_0x422589['query']['range']){try{var _0x4e501d=JSON[_0x249d('0xd6')](_0x422589[_0x249d('0x22')][_0x249d('0xd7')]);if(!moment(_0x4e501d['from'])[_0x249d('0xd8')]()){throw new Error(_0x249d('0xd9'));}if(!moment(_0x4e501d['to'])[_0x249d('0xd8')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x6ecd7b){throw new Error(_0x249d('0xda'));}}if(!_0x422589[_0x249d('0x22')][_0x249d('0x35')](_0x249d('0x89'))){_0x2d5e03[_0x249d('0x14')]=qs[_0x249d('0x14')](_0x422589[_0x249d('0x22')][_0x249d('0x14')]||0xa);_0x2d5e03[_0x249d('0x12')]=qs[_0x249d('0x12')](_0x422589[_0x249d('0x22')][_0x249d('0x12')]);}var _0x26d287=_0x51fb35['map'](function(_0x1589a6){if(_0x1589a6==='voice'){var _0xa5498a={'attributes':['id','uniqueid',_0x249d('0x31'),_0x249d('0xdb'),'destination',_0x249d('0xdc'),_0x249d('0xdd'),'endtime',_0x249d('0xde'),_0x249d('0xdf'),'createdAt',_0x249d('0xe0'),_0x249d('0xe1'),_0x249d('0xe2'),_0x249d('0xe3')],'where':{'ContactId':_0x422589[_0x249d('0x24')]['id']},'include':[{'model':db[_0x249d('0xbd')],'as':_0x249d('0xbd'),'attributes':['id',_0x249d('0x1e'),_0x249d('0xe4'),_0x249d('0x2f')]}],'order':[[_0x249d('0xe5'),_0x249d('0xe6')]]};if(_0x422589['query'][_0x249d('0xd7')]){_0xa5498a['where'][_0x249d('0xe5')]={'$gte':_0x4e501d[_0x249d('0x40')],'$lte':_0x4e501d['to']};}return db[_0x249d('0x4e')][_0x249d('0xe7')](_0xa5498a)[_0x249d('0x1a')](function(_0x4b3929){_0x3a8c53['count']+=_0x4b3929['count'];return _['map'](_0x4b3929[_0x249d('0xa1')],function(_0x43ebe8){var _0x49d1b2=_0x43ebe8[_0x249d('0x3a')]({'plain':!![]});_0x49d1b2[_0x249d('0xd2')]=_0x1589a6;if(_0x49d1b2[_0x249d('0xbd')]){_0x49d1b2[_0x249d('0xbd')]={'id':_0x49d1b2[_0x249d('0xbd')]['id'],'name':_0x49d1b2['User'][_0x249d('0x1e')],'fullname':_0x49d1b2['User']['fullname'],'alias':_0x49d1b2['User'][_0x249d('0x2f')]};}return _0x49d1b2;});});}else{var _0x3203a3=_[_0x249d('0xe8')](_0x1589a6)+(_0x1589a6==='chat'?_0x249d('0xe9'):_0x249d('0xea'));var _0x5324e7={'attributes':['id',_0x249d('0xeb'),_0x249d('0xec'),_0x249d('0xe5'),_0x249d('0xdf'),'disposition',_0x249d('0xed'),_0x249d('0xee'),_0x249d('0xe3'),_0x3203a3+'Id'],'where':{'ContactId':_0x422589[_0x249d('0x24')]['id']},'include':[{'model':db[_0x3203a3],'as':_0x249d('0xea'),'attributes':['id',_0x249d('0x1e'),'key']},{'model':db[_0x249d('0xbd')],'as':'Owner','attributes':['id','name','fullname']},{'model':db[_0x249d('0x7d')],'as':_0x249d('0x68'),'attributes':['id',_0x249d('0x1e'),'color'],'through':{'attributes':[]}}],'order':[[_0x249d('0xe5'),_0x249d('0xe6')]]};if(_0x422589[_0x249d('0x22')][_0x249d('0xd7')]){_0x5324e7[_0x249d('0x61')][_0x249d('0xe5')]={'$gte':_0x4e501d['from'],'$lte':_0x4e501d['to']};}switch(_0x1589a6){case _0x249d('0xca'):_0x5324e7[_0x249d('0x82')][_0x249d('0x60')](_0x249d('0xef'),_0x249d('0xf0'),_0x249d('0xf1'),'deviceModel','osName',_0x249d('0xf2'),_0x249d('0xf3'),_0x249d('0xf4'),_0x249d('0xf5'));break;case _0x249d('0xf6'):_0x5324e7[_0x249d('0x82')][_0x249d('0x60')](_0x249d('0xf7'),_0x249d('0xf8'));break;case _0x249d('0xcc'):_0x5324e7['attributes'][_0x249d('0x60')](_0x249d('0xf9'),'threadId');break;}return db[_[_0x249d('0xe8')](_0x1589a6)+_0x249d('0xfa')][_0x249d('0xe7')](_0x5324e7)[_0x249d('0x1a')](function(_0x26c081){_0x3a8c53['count']+=_0x26c081[_0x249d('0x15')];return _[_0x249d('0x70')](_0x26c081[_0x249d('0xa1')],function(_0x5b4838){var _0x56bdc7=_0x5b4838[_0x249d('0x3a')]({'plain':!![]});_0x56bdc7[_0x249d('0xd2')]=_0x1589a6;if(_0x56bdc7[_0x249d('0xfb')]){_0x56bdc7[_0x249d('0xfb')]={'id':_0x56bdc7[_0x249d('0xfb')]['id'],'name':_0x56bdc7[_0x249d('0xfb')]['name'],'fullname':_0x56bdc7['Owner'][_0x249d('0xe4')]};}return _0x56bdc7;});});}});return Promise[_0x249d('0x66')](_0x26d287);})['then'](function(_0x2f43fd){return _(_0x2f43fd)[_0x249d('0xfc')]()[_0x249d('0xfd')](_0x249d('0xe5'))[_0x249d('0xfe')]()['value']();})[_0x249d('0x1a')](function(_0x27b7c9){_0x3a8c53['rows']=_0x2d5e03['limit']?_0x27b7c9[_0x249d('0xff')](_0x2d5e03[_0x249d('0x12')],_0x2d5e03['offset']+_0x2d5e03[_0x249d('0x14')]):_0x27b7c9;return _0x3a8c53;})[_0x249d('0x1a')](respondWithFilteredResult(_0x3c54ef,_0x2d5e03))['catch'](handleError(_0x3c54ef,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 09d495a..051a665 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 _0x5e6d=['events','../../mysqldb','CmContact','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x6b0451,_0x266f96){var _0x1eb6d5=function(_0x3c2d53){while(--_0x3c2d53){_0x6b0451['push'](_0x6b0451['shift']());}};_0x1eb6d5(++_0x266f96);}(_0x5e6d,0x12c));var _0xd5e6=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x5e6d[_0x5834bc];return _0x3e183a;};'use strict';var EventEmitter=require(_0xd5e6('0x0'));var CmContact=require(_0xd5e6('0x1'))['db'][_0xd5e6('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xd5e6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd5e6('0x4'),'afterDestroy':_0xd5e6('0x5')};function emitEvent(_0x2ff856){return function(_0x5853f7,_0x45876b,_0x373841){CmContactEvents[_0xd5e6('0x6')](_0x2ff856+':'+_0x5853f7['id'],_0x5853f7);CmContactEvents[_0xd5e6('0x6')](_0x2ff856,_0x5853f7);_0x373841(null);};}for(var e in events){if(events[_0xd5e6('0x7')](e)){var event=events[e];CmContact[_0xd5e6('0x8')](e,emitEvent(event));}}module[_0xd5e6('0x9')]=CmContactEvents; \ No newline at end of file +var _0xea28=['emit','hasOwnProperty','hook','exports','events','CmContact','save','update','remove'];(function(_0x2c27aa,_0x282997){var _0x69f67f=function(_0x4da4cc){while(--_0x4da4cc){_0x2c27aa['push'](_0x2c27aa['shift']());}};_0x69f67f(++_0x282997);}(_0xea28,0x100));var _0x8ea2=function(_0x5ba22d,_0x4d05ee){_0x5ba22d=_0x5ba22d-0x0;var _0x466526=_0xea28[_0x5ba22d];return _0x466526;};'use strict';var EventEmitter=require(_0x8ea2('0x0'));var CmContact=require('../../mysqldb')['db'][_0x8ea2('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8ea2('0x2'),'afterUpdate':_0x8ea2('0x3'),'afterDestroy':_0x8ea2('0x4')};function emitEvent(_0x256c0c){return function(_0x337c15,_0x2cd4ae,_0x586678){CmContactEvents[_0x8ea2('0x5')](_0x256c0c+':'+_0x337c15['id'],_0x337c15);CmContactEvents['emit'](_0x256c0c,_0x337c15);_0x586678(null);};}for(var e in events){if(events[_0x8ea2('0x6')](e)){var event=events[e];CmContact[_0x8ea2('0x7')](e,emitEvent(event));}}module[_0x8ea2('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index d1af724..45f7564 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 _0x669d=['afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','findOne','dialTimezone','timezones','utcOffset','minutes','then','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','ret','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','catch','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','findAll','dialCheckDuplicateType','CmList','Lists','get','onlyIfOpen','outbound','BlackLists','length','cmContact,\x20%s,\x20%s','always','CmHopperBlack','message','ContactId','VoiceQueueId','all','info','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','../../config/environment/shared','exports','define','CmContact','phone','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','models','error','cmContact'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0x669d,0x138));var _0xd669=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x669d[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0xd669('0x0'));var util=require(_0xd669('0x1'));var logger=require(_0xd669('0x2'))(_0xd669('0x3'));var moment=require(_0xd669('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd669('0x5'));var rimraf=require(_0xd669('0x6'));var config=require(_0xd669('0x7'));var shared=require(_0xd669('0x8'));var attributes=require('./cmContact.attributes');module[_0xd669('0x9')]=function(_0x469798,_0x127a3f){return _0x469798[_0xd669('0xa')](_0xd669('0xb'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xd669('0xc'),'fields':[_0xd669('0xc')]},{'name':'fti_cm_contacts','fields':[_0xd669('0xd'),_0xd669('0xe'),'phone',_0xd669('0xf'),_0xd669('0x10'),_0xd669('0x11')],'type':_0xd669('0x12')}],'timestamps':!![],'charset':'utf8mb4','collate':_0xd669('0x13'),'hooks':{'afterCreate':function(_0x2b8423,_0xd7df7,_0x4eb628){var _0x3d0c09=_0x469798[_0xd669('0x14')];var _0x271185=_0x2b8423['get']({'plain':!![]});function _0x20a693(){return function(_0x231e0f){logger[_0xd669('0x15')](_0xd669('0x16'),_0xd669('0x17'),util[_0xd669('0x18')](_0x231e0f,{'showHidden':![],'depth':null}));};}function _0x4d7e99(_0x40d196,_0x4d7efa){var _0x420940=_0x4d7efa[_0xd669('0x19')]?_0x4d7efa[_0xd669('0x19')]:moment()[_0xd669('0x1a')](_0xd669('0x1b'));return new BPromise(function(_0x110731,_0x2a20c1){if(_[_0xd669('0x1c')](_0x4d7efa['dialTimezone'])){_0x110731({'ret':_0x420940});}else{_0x3d0c09[_0xd669('0x1d')][_0xd669('0x1e')]({'where':{'id':_0x40d196['id']}})['then'](function(_0x3719d9){if(!_['isNil'](_0x3719d9)){var _0x333662=_0x3719d9[_0xd669('0x1f')];if(!_[_0xd669('0x1c')](_0x333662)){var _0x4a688c=shared[_0xd669('0x20')];var _0x18359b=_0x4a688c[_0x333662];var _0x256cdc=_0x4a688c[_0x4d7efa[_0xd669('0x1f')]];if(!_[_0xd669('0x1c')](_0x18359b)&&!_[_0xd669('0x1c')](_0x256cdc)){var _0x59d78e=_0x18359b[_0xd669('0x21')]-_0x256cdc[_0xd669('0x21')];_0x420940=_0x4d7efa['scheduledat']?_0x4d7efa[_0xd669('0x19')]:moment();var _0x23fad0=moment(_0x420940)['add'](_0x59d78e,_0xd669('0x22'));_0x110731({'ret':_0x23fad0[_0xd669('0x1a')](_0xd669('0x1b'))});}else _0x110731({'ret':_0x420940});}else _0x110731({'ret':_0x420940});}else{_0x110731({'ret':_0x420940});}});}});return 0xa;}var _0x11b171=function(_0x37370d){return new BPromise(function(_0x3e715b,_0x248b88){_0x4d7e99(_0x37370d,_0x271185)[_0xd669('0x23')](function(_0x47a657){_0x271185[_0xd669('0x19')]=_0x47a657['ret'];_0x3d0c09[_0xd669('0x24')][_0xd669('0x1e')]({'where':{'phone':_0x271185[_0xd669('0xc')],'VoiceQueueId':_0x37370d['id']}})[_0xd669('0x23')](function(_0x2756ec){if(!_['isNil'](_0x2756ec)){throw new Error(_0xd669('0x25')+_0x271185[_0xd669('0xc')]+_0xd669('0x26')+_0x37370d['id']);}return _0x3d0c09[_0xd669('0x24')]['create']({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'priority':_0x271185[_0xd669('0x28')]?_0x271185[_0xd669('0x28')]:0x2,'scheduledat':_0x271185[_0xd669('0x19')]?_0x271185[_0xd669('0x19')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x271185['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x271185['callbackUniqueid']?_0x271185[_0xd669('0x29')]:undefined,'callbackat':_0x271185[_0xd669('0x29')]?moment()[_0xd669('0x1a')](_0xd669('0x1b')):undefined,'VoiceQueueId':_0x37370d['id']});})['catch'](function(_0x3b9de1){_0x248b88(_0x3b9de1);});});});};var _0x3178c8=function(_0x52ad86){return new BPromise(function(_0x2078ed,_0x358d85){_0x4d7e99(_0x52ad86,_0x271185)[_0xd669('0x23')](function(_0x11bbbf){_0x271185[_0xd669('0x19')]=_0x11bbbf[_0xd669('0x2a')];_0x3d0c09[_0xd669('0x24')][_0xd669('0x1e')]({'where':{'phone':_0x271185[_0xd669('0xc')],'VoiceQueueId':_0x52ad86['id']}})[_0xd669('0x23')](function(_0x34b568){if(!_[_0xd669('0x1c')](_0x34b568)){throw new Error(_0xd669('0x25')+_0x271185[_0xd669('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x52ad86['id']);}return _0x3d0c09[_0xd669('0x2b')][_0xd669('0x1e')]({'where':{'calleridnum':_0x271185['phone'],'VoiceQueueId':_0x52ad86['id']}});})['then'](function(_0x37cb20){if(!_['isNil'](_0x37cb20)){throw new Error(_0xd669('0x2c')+_0x271185[_0xd669('0xc')]+_0xd669('0x2d')+_0x52ad86['id']);}return _0x3d0c09[_0xd669('0x24')][_0xd669('0x2e')]({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'priority':_0x271185['priority']?_0x271185[_0xd669('0x28')]:0x2,'scheduledat':_0x271185[_0xd669('0x19')]?_0x271185['scheduledat']:moment()[_0xd669('0x1a')](_0xd669('0x1b')),'callback':_0x271185[_0xd669('0x29')]?!![]:![],'callbackuniqueid':_0x271185[_0xd669('0x29')]?_0x271185['callbackUniqueid']:undefined,'callbackat':_0x271185[_0xd669('0x29')]?moment()[_0xd669('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x52ad86['id']});})[_0xd669('0x2f')](function(_0x2f116d){_0x358d85(_0x2f116d);});});});};function _0x245d7b(){return function(_0xf14fd5){logger['error']('cmContact',_0xd669('0x17'),util[_0xd669('0x18')](_0xf14fd5,{'showHidden':![],'depth':null}));};}function _0x2e4254(_0xb1fd26,_0x521a72){var _0x3f4636=_0x521a72[_0xd669('0x19')]?_0x521a72['scheduledat']:moment()[_0xd669('0x1a')](_0xd669('0x1b'));return new BPromise(function(_0x40b9ed,_0x398b23){if(_[_0xd669('0x1c')](_0x521a72['dialTimezone'])){_0x40b9ed({'ret':_0x3f4636});}else{_0x3d0c09[_0xd669('0x30')]['findOne']({'where':{'id':_0xb1fd26['id']}})[_0xd669('0x23')](function(_0x4a85d0){if(!_[_0xd669('0x1c')](_0x4a85d0)){var _0x301db9=_0x4a85d0['dialTimezone'];if(!_['isNil'](_0x301db9)){var _0x517fb5=shared['timezones'];var _0x57183e=_0x517fb5[_0x301db9];var _0x2eb21f=_0x517fb5[_0x521a72[_0xd669('0x1f')]];if(!_['isNil'](_0x57183e)&&!_[_0xd669('0x1c')](_0x2eb21f)){var _0x4421ba=_0x57183e['utcOffset']-_0x2eb21f[_0xd669('0x21')];_0x3f4636=_0x521a72[_0xd669('0x19')]?_0x521a72[_0xd669('0x19')]:moment();var _0x4f1d4a=moment(_0x3f4636)['add'](_0x4421ba,_0xd669('0x22'));_0x40b9ed({'ret':_0x4f1d4a[_0xd669('0x1a')](_0xd669('0x1b'))});}else _0x40b9ed({'ret':_0x3f4636});}else _0x40b9ed({'ret':_0x3f4636});}else{_0x40b9ed({'ret':_0x3f4636});}});}});return 0xa;}var _0x286b90=function(_0x227ad8){return new BPromise(function(_0x5b0883,_0x49daf8){_0x2e4254(_0x227ad8,_0x271185)['then'](function(_0x4f0ac5){_0x271185['scheduledat']=_0x4f0ac5[_0xd669('0x2a')];_0x3d0c09['CmHopper'][_0xd669('0x1e')]({'where':{'phone':_0x271185[_0xd669('0xc')],'CampaignId':_0x227ad8['id']}})[_0xd669('0x23')](function(_0x4dbf1b){if(!_[_0xd669('0x1c')](_0x4dbf1b)){throw new Error(_0xd669('0x25')+_0x271185[_0xd669('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x227ad8['id']);}return _0x3d0c09['CmHopper'][_0xd669('0x2e')]({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'priority':_0x271185['priority']?_0x271185[_0xd669('0x28')]:0x2,'scheduledat':_0x271185['scheduledat']?_0x271185['scheduledat']:moment()[_0xd669('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x271185['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x271185[_0xd669('0x29')]?_0x271185[_0xd669('0x29')]:undefined,'callbackat':_0x271185[_0xd669('0x29')]?moment()[_0xd669('0x1a')](_0xd669('0x1b')):undefined,'CampaignId':_0x227ad8['id']});})[_0xd669('0x2f')](function(_0x2da876){_0x49daf8(_0x2da876);});});});};var _0xab9cc0=function(_0x4c1de1){return new BPromise(function(_0x50d585,_0x4bf5b9){_0x2e4254(_0x4c1de1,_0x271185)['then'](function(_0x1bb27b){_0x271185[_0xd669('0x19')]=_0x1bb27b[_0xd669('0x2a')];_0x3d0c09[_0xd669('0x24')]['findOne']({'where':{'phone':_0x271185[_0xd669('0xc')],'CampaignId':_0x4c1de1['id']}})['then'](function(_0x3fedc9){if(!_[_0xd669('0x1c')](_0x3fedc9)){throw new Error(_0xd669('0x25')+_0x271185[_0xd669('0xc')]+_0xd669('0x31')+_0x4c1de1['id']);}return _0x3d0c09[_0xd669('0x2b')][_0xd669('0x1e')]({'where':{'calleridnum':_0x271185[_0xd669('0xc')],'CampaignId':_0x4c1de1['id']}});})[_0xd669('0x23')](function(_0xcd60b6){if(!_[_0xd669('0x1c')](_0xcd60b6)){throw new Error(_0xd669('0x2c')+_0x271185[_0xd669('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x4c1de1['id']);}return _0x3d0c09[_0xd669('0x24')]['create']({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'priority':_0x271185['priority']?_0x271185['priority']:0x2,'scheduledat':_0x271185[_0xd669('0x19')]?_0x271185['scheduledat']:moment()[_0xd669('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x271185[_0xd669('0x29')]?!![]:![],'callbackuniqueid':_0x271185[_0xd669('0x29')]?_0x271185[_0xd669('0x29')]:undefined,'callbackat':_0x271185[_0xd669('0x29')]?moment()[_0xd669('0x1a')](_0xd669('0x1b')):undefined,'CampaignId':_0x4c1de1['id']});})['catch'](function(_0x20d762){_0x4bf5b9(_0x20d762);});});});};if(_0x271185[_0xd669('0x27')]){_0x3d0c09['VoiceQueue'][_0xd669('0x32')]({'where':{'type':'outbound'},'attributes':['id',_0xd669('0x33'),'dialTimezone'],'include':[{'model':_0x3d0c09[_0xd669('0x34')],'as':_0xd669('0x35'),'where':{'id':_0x271185[_0xd669('0x27')]}}]})['then'](function(_0x29067a){if(_0x29067a){var _0x13840a=[];for(var _0x2fc52f=0x0,_0xee199c;_0x2fc52f<_0x29067a['length'];_0x2fc52f+=0x1){_0xee199c=_0x29067a[_0x2fc52f][_0xd669('0x36')]({'plain':!![]});switch(_0xee199c['dialCheckDuplicateType']){case'always':_0x3178c8(_0xee199c)[_0xd669('0x2f')](_0x20a693());break;case _0xd669('0x37'):_0x11b171(_0xee199c)[_0xd669('0x2f')](_0x20a693());break;default:_0x2e4254(_0xee199c,_0x271185)[_0xd669('0x23')](function(_0x2d3018){_0x271185[_0xd669('0x19')]=_0x2d3018[_0xd669('0x2a')];_0x3d0c09[_0xd669('0x24')]['create']({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'scheduledat':_0x271185[_0xd669('0x19')]?_0x271185[_0xd669('0x19')]:moment()[_0xd669('0x1a')](_0xd669('0x1b')),'priority':_0x271185[_0xd669('0x28')]?_0x271185['priority']:0x2,'callback':_0x271185[_0xd669('0x29')]?!![]:![],'callbackuniqueid':_0x271185[_0xd669('0x29')]?_0x271185[_0xd669('0x29')]:undefined,'callbackat':_0x271185[_0xd669('0x29')]?moment()[_0xd669('0x1a')](_0xd669('0x1b')):undefined,'VoiceQueueId':_0xee199c['id']})[_0xd669('0x2f')](_0x20a693());});}}}})[_0xd669('0x23')](function(){return _0x3d0c09[_0xd669('0x1d')][_0xd669('0x32')]({'where':{'type':_0xd669('0x38')},'attributes':['id'],'include':[{'model':_0x3d0c09[_0xd669('0x34')],'as':_0xd669('0x39'),'where':{'id':_0x271185['ListId']}}]})[_0xd669('0x23')](function(_0x171d7a){if(_0x171d7a){var _0x4cb57a=[];for(var _0x2c99b0=0x0,_0x36582f;_0x2c99b0<_0x171d7a[_0xd669('0x3a')];_0x2c99b0+=0x1){_0x36582f=_0x171d7a[_0x2c99b0][_0xd669('0x36')]({'plain':!![]});_0x3d0c09['CmHopperBlack'][_0xd669('0x2e')]({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'VoiceQueueId':_0x36582f['id']})['catch'](function(_0x2b9868){logger['error'](_0xd669('0x3b'),_0xd669('0x17'),_0x2b9868['message']);});}}});})[_0xd669('0x23')](function(){return _0x3d0c09['Campaign']['findAll']({'attributes':['id',_0xd669('0x33'),_0xd669('0x1f')],'include':[{'model':_0x3d0c09[_0xd669('0x34')],'as':_0xd669('0x35'),'where':{'id':_0x271185[_0xd669('0x27')]}}]})['then'](function(_0x27ae7b){if(_0x27ae7b){var _0x2570fb=[];for(var _0x32247e=0x0,_0x13399b;_0x32247e<_0x27ae7b[_0xd669('0x3a')];_0x32247e+=0x1){_0x13399b=_0x27ae7b[_0x32247e][_0xd669('0x36')]({'plain':!![]});switch(_0x13399b[_0xd669('0x33')]){case _0xd669('0x3c'):_0xab9cc0(_0x13399b)[_0xd669('0x2f')](_0x245d7b());break;case _0xd669('0x37'):_0x286b90(_0x13399b)[_0xd669('0x2f')](_0x245d7b());break;default:_0x3d0c09[_0xd669('0x24')]['create']({'phone':_0x271185['phone'],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'scheduledat':_0x271185['scheduledat']?_0x271185[_0xd669('0x19')]:moment()[_0xd669('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x271185[_0xd669('0x28')]?_0x271185[_0xd669('0x28')]:0x2,'callback':_0x271185['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x271185[_0xd669('0x29')]?_0x271185[_0xd669('0x29')]:undefined,'callbackat':_0x271185['callbackUniqueid']?moment()[_0xd669('0x1a')](_0xd669('0x1b')):undefined,'CampaignId':_0x13399b['id']})['catch'](_0x245d7b());}}}});})[_0xd669('0x23')](function(){return _0x3d0c09[_0xd669('0x30')]['findAll']({'attributes':['id'],'include':[{'model':_0x3d0c09[_0xd669('0x34')],'as':_0xd669('0x39'),'where':{'id':_0x271185[_0xd669('0x27')]}}]})[_0xd669('0x23')](function(_0x3f01fd){if(_0x3f01fd){var _0x4ac8ae=[];for(var _0x2b3407=0x0,_0x280b2b;_0x2b3407<_0x3f01fd[_0xd669('0x3a')];_0x2b3407+=0x1){_0x280b2b=_0x3f01fd[_0x2b3407]['get']({'plain':!![]});_0x3d0c09[_0xd669('0x3d')]['create']({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'CampaignId':_0x280b2b['id']})[_0xd669('0x2f')](function(_0x109eaa){logger['error'](_0xd669('0x3b'),_0xd669('0x17'),_0x109eaa[_0xd669('0x3e')]);});}}});})[_0xd669('0x23')](function(){_0x4eb628();})[_0xd669('0x2f')](function(_0x533e11){logger[_0xd669('0x15')]('cmContact,\x20%s,\x20%s',_0xd669('0x17'),_0x533e11['message']);_0x4eb628(_0x533e11);});}else{_0x4eb628(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x42db17,_0x1b0231,_0x157f16){var _0x316b3a=_0x469798[_0xd669('0x14')];var _0x42cc74=_0x42db17[_0xd669('0x36')]({'plain':!![]});return _0x316b3a[_0xd669('0x24')][_0xd669('0x32')]({'raw':!![],'where':{'ListId':_0x42cc74['ListId'],'ContactId':_0x42cc74['id']}})[_0xd669('0x23')](function(_0x2226dc){if(!_['isEmpty'](_0x2226dc)){var _0x3ab11a=[];for(var _0x19833e=0x0;_0x19833e<_0x2226dc[_0xd669('0x3a')];_0x19833e+=0x1){var _0x543981=_0x316b3a[_0xd669('0x24')]['destroy']({'where':{'ListId':_0x2226dc[_0x19833e]['ListId'],'ContactId':_0x2226dc[_0x19833e][_0xd669('0x3f')],'VoiceQueueId':_0x2226dc[_0x19833e][_0xd669('0x40')],'CampaignId':_0x2226dc[_0x19833e]['CampaignId']}});_0x3ab11a['push'](_0x543981);}return BPromise[_0xd669('0x41')](_0x3ab11a);}})[_0xd669('0x23')](function(_0x1fb038){logger[_0xd669('0x42')]('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0x1fb038,{'showHidden':![],'depth':null}));_0x157f16();})[_0xd669('0x2f')](function(_0x26830e){logger[_0xd669('0x15')]('[CmContact][afterDestroy][Error]',util[_0xd669('0x18')](_0x26830e,{'showHidden':![],'depth':null}));_0x157f16(_0x26830e);});}}});}; \ No newline at end of file +var _0x05f1=['destroy','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','mobile','email','FULLTEXT','utf8mb4','models','get','error','cmContact','inspect','scheduledat','format','isNil','dialTimezone','VoiceQueue','then','minutes','YYYY-MM-DD\x20HH:mm:ss','findOne','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','callbackUniqueid','ret','cmContact,\x20afterCreate\x20','\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','catch','afterCreate','Campaign','timezones','utcOffset','add','\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','outbound','CmList','Lists','length','dialCheckDuplicateType','always','onlyIfOpen','BlackLists','cmContact,\x20%s,\x20%s','message','findAll','List\x20not\x20found','isEmpty'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x05f1,0x12e));var _0x105f=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x05f1[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x105f('0x0'));var util=require(_0x105f('0x1'));var logger=require(_0x105f('0x2'))(_0x105f('0x3'));var moment=require(_0x105f('0x4'));var BPromise=require(_0x105f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x105f('0x6'));var rimraf=require('rimraf');var config=require(_0x105f('0x7'));var shared=require('../../config/environment/shared');var attributes=require(_0x105f('0x8'));module[_0x105f('0x9')]=function(_0x18566b,_0xf6e852){return _0x18566b[_0x105f('0xa')](_0x105f('0xb'),attributes,{'tableName':_0x105f('0xc'),'paranoid':!![],'indexes':[{'name':_0x105f('0xd'),'fields':[_0x105f('0xd')]},{'name':_0x105f('0xe'),'fields':[_0x105f('0xf'),'lastName',_0x105f('0xd'),_0x105f('0x10'),'fax',_0x105f('0x11')],'type':_0x105f('0x12')}],'timestamps':!![],'charset':_0x105f('0x13'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x23faf8,_0x833ddc,_0x508dba){var _0xf30d1f=_0x18566b[_0x105f('0x14')];var _0x24ab11=_0x23faf8[_0x105f('0x15')]({'plain':!![]});function _0x3ea6ce(){return function(_0xd465e1){logger[_0x105f('0x16')](_0x105f('0x17'),'afterCreate',util[_0x105f('0x18')](_0xd465e1,{'showHidden':![],'depth':null}));};}function _0x342981(_0x4c04ab,_0x194b17){var _0x25aed9=_0x194b17[_0x105f('0x19')]?_0x194b17[_0x105f('0x19')]:moment()[_0x105f('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x1727bf,_0x2986f4){if(_[_0x105f('0x1b')](_0x194b17[_0x105f('0x1c')])){_0x1727bf({'ret':_0x25aed9});}else{_0xf30d1f[_0x105f('0x1d')]['findOne']({'where':{'id':_0x4c04ab['id']}})[_0x105f('0x1e')](function(_0x5ca1d9){if(!_[_0x105f('0x1b')](_0x5ca1d9)){var _0x141b6a=_0x5ca1d9[_0x105f('0x1c')];if(!_[_0x105f('0x1b')](_0x141b6a)){var _0x3d1c8f=shared['timezones'];var _0x228197=_0x3d1c8f[_0x141b6a];var _0x303e28=_0x3d1c8f[_0x194b17[_0x105f('0x1c')]];if(!_[_0x105f('0x1b')](_0x228197)&&!_[_0x105f('0x1b')](_0x303e28)){var _0x59c67f=_0x228197['utcOffset']-_0x303e28['utcOffset'];_0x25aed9=_0x194b17[_0x105f('0x19')]?_0x194b17[_0x105f('0x19')]:moment();var _0x475e74=moment(_0x25aed9)['add'](_0x59c67f,_0x105f('0x1f'));_0x1727bf({'ret':_0x475e74[_0x105f('0x1a')](_0x105f('0x20'))});}else _0x1727bf({'ret':_0x25aed9});}else _0x1727bf({'ret':_0x25aed9});}else{_0x1727bf({'ret':_0x25aed9});}});}});return 0xa;}var _0x30b2ea=function(_0x25d1e8){return new BPromise(function(_0x53b395,_0x37a810){_0x342981(_0x25d1e8,_0x24ab11)[_0x105f('0x1e')](function(_0x4bad30){_0x24ab11['scheduledat']=_0x4bad30['ret'];_0xf30d1f['CmHopper'][_0x105f('0x21')]({'where':{'phone':_0x24ab11[_0x105f('0xd')],'VoiceQueueId':_0x25d1e8['id']}})[_0x105f('0x1e')](function(_0x178e4c){if(!_[_0x105f('0x1b')](_0x178e4c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x24ab11[_0x105f('0xd')]+_0x105f('0x22')+_0x25d1e8['id']);}return _0xf30d1f[_0x105f('0x23')][_0x105f('0x24')]({'phone':_0x24ab11[_0x105f('0xd')],'ContactId':_0x24ab11['id'],'ListId':_0x24ab11[_0x105f('0x25')],'priority':_0x24ab11[_0x105f('0x26')]?_0x24ab11[_0x105f('0x26')]:0x2,'scheduledat':_0x24ab11[_0x105f('0x19')]?_0x24ab11[_0x105f('0x19')]:moment()[_0x105f('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x24ab11[_0x105f('0x27')]?!![]:![],'callbackuniqueid':_0x24ab11[_0x105f('0x27')]?_0x24ab11['callbackUniqueid']:undefined,'callbackat':_0x24ab11['callbackUniqueid']?moment()[_0x105f('0x1a')](_0x105f('0x20')):undefined,'VoiceQueueId':_0x25d1e8['id']});})['catch'](function(_0x5c35ca){_0x37a810(_0x5c35ca);});});});};var _0x5da48b=function(_0x5b4c1a){return new BPromise(function(_0x4d81e6,_0x361898){_0x342981(_0x5b4c1a,_0x24ab11)[_0x105f('0x1e')](function(_0x30da04){_0x24ab11[_0x105f('0x19')]=_0x30da04[_0x105f('0x28')];_0xf30d1f[_0x105f('0x23')]['findOne']({'where':{'phone':_0x24ab11[_0x105f('0xd')],'VoiceQueueId':_0x5b4c1a['id']}})[_0x105f('0x1e')](function(_0x2889dd){if(!_[_0x105f('0x1b')](_0x2889dd)){throw new Error(_0x105f('0x29')+_0x24ab11[_0x105f('0xd')]+_0x105f('0x2a')+_0x5b4c1a['id']);}return _0xf30d1f[_0x105f('0x2b')]['findOne']({'where':{'calleridnum':_0x24ab11[_0x105f('0xd')],'VoiceQueueId':_0x5b4c1a['id']}});})['then'](function(_0x1d32a6){if(!_[_0x105f('0x1b')](_0x1d32a6)){throw new Error(_0x105f('0x2c')+_0x24ab11[_0x105f('0xd')]+_0x105f('0x2d')+_0x5b4c1a['id']);}return _0xf30d1f[_0x105f('0x23')][_0x105f('0x24')]({'phone':_0x24ab11[_0x105f('0xd')],'ContactId':_0x24ab11['id'],'ListId':_0x24ab11[_0x105f('0x25')],'priority':_0x24ab11[_0x105f('0x26')]?_0x24ab11['priority']:0x2,'scheduledat':_0x24ab11[_0x105f('0x19')]?_0x24ab11[_0x105f('0x19')]:moment()[_0x105f('0x1a')](_0x105f('0x20')),'callback':_0x24ab11[_0x105f('0x27')]?!![]:![],'callbackuniqueid':_0x24ab11[_0x105f('0x27')]?_0x24ab11[_0x105f('0x27')]:undefined,'callbackat':_0x24ab11['callbackUniqueid']?moment()[_0x105f('0x1a')](_0x105f('0x20')):undefined,'VoiceQueueId':_0x5b4c1a['id']});})[_0x105f('0x2e')](function(_0x5867e0){_0x361898(_0x5867e0);});});});};function _0x418f2e(){return function(_0x5a04ad){logger[_0x105f('0x16')]('cmContact',_0x105f('0x2f'),util[_0x105f('0x18')](_0x5a04ad,{'showHidden':![],'depth':null}));};}function _0x521c5c(_0x540ae7,_0xc30caf){var _0x3f84ae=_0xc30caf[_0x105f('0x19')]?_0xc30caf[_0x105f('0x19')]:moment()['format'](_0x105f('0x20'));return new BPromise(function(_0x5b110e,_0xc13ae4){if(_[_0x105f('0x1b')](_0xc30caf[_0x105f('0x1c')])){_0x5b110e({'ret':_0x3f84ae});}else{_0xf30d1f[_0x105f('0x30')]['findOne']({'where':{'id':_0x540ae7['id']}})[_0x105f('0x1e')](function(_0x523da0){if(!_['isNil'](_0x523da0)){var _0x159fea=_0x523da0['dialTimezone'];if(!_[_0x105f('0x1b')](_0x159fea)){var _0x500023=shared[_0x105f('0x31')];var _0xc07853=_0x500023[_0x159fea];var _0x209438=_0x500023[_0xc30caf[_0x105f('0x1c')]];if(!_['isNil'](_0xc07853)&&!_[_0x105f('0x1b')](_0x209438)){var _0x28910b=_0xc07853[_0x105f('0x32')]-_0x209438[_0x105f('0x32')];_0x3f84ae=_0xc30caf['scheduledat']?_0xc30caf['scheduledat']:moment();var _0x20bcc3=moment(_0x3f84ae)[_0x105f('0x33')](_0x28910b,'minutes');_0x5b110e({'ret':_0x20bcc3['format'](_0x105f('0x20'))});}else _0x5b110e({'ret':_0x3f84ae});}else _0x5b110e({'ret':_0x3f84ae});}else{_0x5b110e({'ret':_0x3f84ae});}});}});return 0xa;}var _0x340212=function(_0x5f8039){return new BPromise(function(_0x52c1d0,_0x2a896d){_0x521c5c(_0x5f8039,_0x24ab11)['then'](function(_0x434a3c){_0x24ab11[_0x105f('0x19')]=_0x434a3c['ret'];_0xf30d1f[_0x105f('0x23')][_0x105f('0x21')]({'where':{'phone':_0x24ab11[_0x105f('0xd')],'CampaignId':_0x5f8039['id']}})[_0x105f('0x1e')](function(_0x2be121){if(!_[_0x105f('0x1b')](_0x2be121)){throw new Error(_0x105f('0x29')+_0x24ab11[_0x105f('0xd')]+_0x105f('0x34')+_0x5f8039['id']);}return _0xf30d1f[_0x105f('0x23')][_0x105f('0x24')]({'phone':_0x24ab11[_0x105f('0xd')],'ContactId':_0x24ab11['id'],'ListId':_0x24ab11[_0x105f('0x25')],'priority':_0x24ab11[_0x105f('0x26')]?_0x24ab11['priority']:0x2,'scheduledat':_0x24ab11['scheduledat']?_0x24ab11[_0x105f('0x19')]:moment()[_0x105f('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x24ab11['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x24ab11[_0x105f('0x27')]?_0x24ab11[_0x105f('0x27')]:undefined,'callbackat':_0x24ab11[_0x105f('0x27')]?moment()['format'](_0x105f('0x20')):undefined,'CampaignId':_0x5f8039['id']});})[_0x105f('0x2e')](function(_0x3ec0c1){_0x2a896d(_0x3ec0c1);});});});};var _0x44fdb2=function(_0x4e2059){return new BPromise(function(_0x1d4623,_0x4e680e){_0x521c5c(_0x4e2059,_0x24ab11)[_0x105f('0x1e')](function(_0x43f84b){_0x24ab11['scheduledat']=_0x43f84b[_0x105f('0x28')];_0xf30d1f[_0x105f('0x23')][_0x105f('0x21')]({'where':{'phone':_0x24ab11[_0x105f('0xd')],'CampaignId':_0x4e2059['id']}})[_0x105f('0x1e')](function(_0x5b0e33){if(!_[_0x105f('0x1b')](_0x5b0e33)){throw new Error(_0x105f('0x29')+_0x24ab11['phone']+_0x105f('0x35')+_0x4e2059['id']);}return _0xf30d1f[_0x105f('0x2b')][_0x105f('0x21')]({'where':{'calleridnum':_0x24ab11['phone'],'CampaignId':_0x4e2059['id']}});})['then'](function(_0x7d2c87){if(!_[_0x105f('0x1b')](_0x7d2c87)){throw new Error(_0x105f('0x2c')+_0x24ab11[_0x105f('0xd')]+_0x105f('0x36')+_0x4e2059['id']);}return _0xf30d1f[_0x105f('0x23')][_0x105f('0x24')]({'phone':_0x24ab11[_0x105f('0xd')],'ContactId':_0x24ab11['id'],'ListId':_0x24ab11[_0x105f('0x25')],'priority':_0x24ab11[_0x105f('0x26')]?_0x24ab11[_0x105f('0x26')]:0x2,'scheduledat':_0x24ab11[_0x105f('0x19')]?_0x24ab11['scheduledat']:moment()[_0x105f('0x1a')](_0x105f('0x20')),'callback':_0x24ab11['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x24ab11[_0x105f('0x27')]?_0x24ab11[_0x105f('0x27')]:undefined,'callbackat':_0x24ab11[_0x105f('0x27')]?moment()['format'](_0x105f('0x20')):undefined,'CampaignId':_0x4e2059['id']});})[_0x105f('0x2e')](function(_0x328bb3){_0x4e680e(_0x328bb3);});});});};if(_0x24ab11[_0x105f('0x25')]){_0xf30d1f[_0x105f('0x1d')]['findAll']({'where':{'type':_0x105f('0x37')},'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0xf30d1f[_0x105f('0x38')],'as':_0x105f('0x39'),'where':{'id':_0x24ab11[_0x105f('0x25')]}}]})['then'](function(_0x1637c6){if(_0x1637c6){var _0x39560a=[];for(var _0x3be94d=0x0,_0x217286;_0x3be94d<_0x1637c6[_0x105f('0x3a')];_0x3be94d+=0x1){_0x217286=_0x1637c6[_0x3be94d][_0x105f('0x15')]({'plain':!![]});switch(_0x217286[_0x105f('0x3b')]){case _0x105f('0x3c'):_0x5da48b(_0x217286)[_0x105f('0x2e')](_0x3ea6ce());break;case _0x105f('0x3d'):_0x30b2ea(_0x217286)[_0x105f('0x2e')](_0x3ea6ce());break;default:_0x521c5c(_0x217286,_0x24ab11)[_0x105f('0x1e')](function(_0x2b1d0e){_0x24ab11[_0x105f('0x19')]=_0x2b1d0e[_0x105f('0x28')];_0xf30d1f['CmHopper'][_0x105f('0x24')]({'phone':_0x24ab11[_0x105f('0xd')],'ContactId':_0x24ab11['id'],'ListId':_0x24ab11['ListId'],'scheduledat':_0x24ab11[_0x105f('0x19')]?_0x24ab11['scheduledat']:moment()[_0x105f('0x1a')](_0x105f('0x20')),'priority':_0x24ab11[_0x105f('0x26')]?_0x24ab11[_0x105f('0x26')]:0x2,'callback':_0x24ab11['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x24ab11['callbackUniqueid']?_0x24ab11['callbackUniqueid']:undefined,'callbackat':_0x24ab11[_0x105f('0x27')]?moment()[_0x105f('0x1a')](_0x105f('0x20')):undefined,'VoiceQueueId':_0x217286['id']})[_0x105f('0x2e')](_0x3ea6ce());});}}}})['then'](function(){return _0xf30d1f[_0x105f('0x1d')]['findAll']({'where':{'type':_0x105f('0x37')},'attributes':['id'],'include':[{'model':_0xf30d1f['CmList'],'as':_0x105f('0x3e'),'where':{'id':_0x24ab11['ListId']}}]})[_0x105f('0x1e')](function(_0x4fdd6c){if(_0x4fdd6c){var _0x1f43e1=[];for(var _0x5dbc45=0x0,_0x4b03c3;_0x5dbc45<_0x4fdd6c[_0x105f('0x3a')];_0x5dbc45+=0x1){_0x4b03c3=_0x4fdd6c[_0x5dbc45][_0x105f('0x15')]({'plain':!![]});_0xf30d1f['CmHopperBlack'][_0x105f('0x24')]({'phone':_0x24ab11[_0x105f('0xd')],'ContactId':_0x24ab11['id'],'ListId':_0x24ab11[_0x105f('0x25')],'VoiceQueueId':_0x4b03c3['id']})['catch'](function(_0x359742){logger['error'](_0x105f('0x3f'),'afterCreate',_0x359742[_0x105f('0x40')]);});}}});})[_0x105f('0x1e')](function(){return _0xf30d1f[_0x105f('0x30')][_0x105f('0x41')]({'attributes':['id',_0x105f('0x3b'),'dialTimezone'],'include':[{'model':_0xf30d1f['CmList'],'as':_0x105f('0x39'),'where':{'id':_0x24ab11[_0x105f('0x25')]}}]})['then'](function(_0x558c92){if(_0x558c92){var _0x498edf=[];for(var _0x48eb3c=0x0,_0x17f928;_0x48eb3c<_0x558c92['length'];_0x48eb3c+=0x1){_0x17f928=_0x558c92[_0x48eb3c][_0x105f('0x15')]({'plain':!![]});switch(_0x17f928[_0x105f('0x3b')]){case _0x105f('0x3c'):_0x44fdb2(_0x17f928)[_0x105f('0x2e')](_0x418f2e());break;case _0x105f('0x3d'):_0x340212(_0x17f928)[_0x105f('0x2e')](_0x418f2e());break;default:_0xf30d1f[_0x105f('0x23')][_0x105f('0x24')]({'phone':_0x24ab11[_0x105f('0xd')],'ContactId':_0x24ab11['id'],'ListId':_0x24ab11['ListId'],'scheduledat':_0x24ab11['scheduledat']?_0x24ab11[_0x105f('0x19')]:moment()[_0x105f('0x1a')](_0x105f('0x20')),'priority':_0x24ab11[_0x105f('0x26')]?_0x24ab11[_0x105f('0x26')]:0x2,'callback':_0x24ab11[_0x105f('0x27')]?!![]:![],'callbackuniqueid':_0x24ab11[_0x105f('0x27')]?_0x24ab11[_0x105f('0x27')]:undefined,'callbackat':_0x24ab11[_0x105f('0x27')]?moment()['format'](_0x105f('0x20')):undefined,'CampaignId':_0x17f928['id']})[_0x105f('0x2e')](_0x418f2e());}}}});})[_0x105f('0x1e')](function(){return _0xf30d1f[_0x105f('0x30')][_0x105f('0x41')]({'attributes':['id'],'include':[{'model':_0xf30d1f[_0x105f('0x38')],'as':'BlackLists','where':{'id':_0x24ab11[_0x105f('0x25')]}}]})['then'](function(_0x45192b){if(_0x45192b){var _0x5435b7=[];for(var _0x2b016b=0x0,_0x38b776;_0x2b016b<_0x45192b['length'];_0x2b016b+=0x1){_0x38b776=_0x45192b[_0x2b016b][_0x105f('0x15')]({'plain':!![]});_0xf30d1f['CmHopperBlack'][_0x105f('0x24')]({'phone':_0x24ab11[_0x105f('0xd')],'ContactId':_0x24ab11['id'],'ListId':_0x24ab11[_0x105f('0x25')],'CampaignId':_0x38b776['id']})['catch'](function(_0x556662){logger['error']('cmContact,\x20%s,\x20%s',_0x105f('0x2f'),_0x556662['message']);});}}});})[_0x105f('0x1e')](function(){_0x508dba();})[_0x105f('0x2e')](function(_0x3f4b86){logger[_0x105f('0x16')](_0x105f('0x3f'),_0x105f('0x2f'),_0x3f4b86[_0x105f('0x40')]);_0x508dba(_0x3f4b86);});}else{_0x508dba(new Error(_0x105f('0x42')));}},'afterDestroy':function(_0x341543,_0x1cfee2,_0x2bfd59){var _0x171fa0=_0x18566b['models'];var _0x21de7a=_0x341543[_0x105f('0x15')]({'plain':!![]});return _0x171fa0['CmHopper'][_0x105f('0x41')]({'raw':!![],'where':{'ListId':_0x21de7a[_0x105f('0x25')],'ContactId':_0x21de7a['id']}})[_0x105f('0x1e')](function(_0x4f0cc1){if(!_[_0x105f('0x43')](_0x4f0cc1)){var _0x1b950e=[];for(var _0x1e7489=0x0;_0x1e7489<_0x4f0cc1[_0x105f('0x3a')];_0x1e7489+=0x1){var _0x3c7db9=_0x171fa0['CmHopper'][_0x105f('0x44')]({'where':{'ListId':_0x4f0cc1[_0x1e7489][_0x105f('0x25')],'ContactId':_0x4f0cc1[_0x1e7489]['ContactId'],'VoiceQueueId':_0x4f0cc1[_0x1e7489]['VoiceQueueId'],'CampaignId':_0x4f0cc1[_0x1e7489][_0x105f('0x45')]}});_0x1b950e[_0x105f('0x46')](_0x3c7db9);}return BPromise['all'](_0x1b950e);}})[_0x105f('0x1e')](function(_0x509645){logger[_0x105f('0x47')](_0x105f('0x48'),util[_0x105f('0x18')](_0x509645,{'showHidden':![],'depth':null}));_0x2bfd59();})[_0x105f('0x2e')](function(_0x59df93){logger[_0x105f('0x16')](_0x105f('0x49'),util[_0x105f('0x18')](_0x59df93,{'showHidden':![],'depth':null}));_0x2bfd59(_0x59df93);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 8c3da05..fa48014 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x3faf6c,_0x28aa62){var _0x30460b=function(_0x31351e){while(--_0x31351e){_0x3faf6c['push'](_0x3faf6c['shift']());}};_0x30460b(++_0x28aa62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 27374fa..51d6f50 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 _0x90ae=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x1d8fd7,_0xbda2e6){var _0xf30dbc=function(_0x1509a7){while(--_0x1509a7){_0x1d8fd7['push'](_0x1d8fd7['shift']());}};_0xf30dbc(++_0xbda2e6);}(_0x90ae,0x195));var _0xe90a=function(_0x3bf72d,_0x2d6468){_0x3bf72d=_0x3bf72d-0x0;var _0x2950d3=_0x90ae[_0x3bf72d];return _0x2950d3;};'use strict';var Sequelize=require(_0xe90a('0x0'));module[_0xe90a('0x1')]={'CmContactId':{'type':Sequelize[_0xe90a('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xe90a('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xe90a('0x3')],'defaultValue':_0xe90a('0x4')},'OrderBy':{'type':Sequelize[_0xe90a('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xe90a('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x0e9f=['exports','INTEGER','sequelize'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0x0e9f,0x116));var _0xf0e9=function(_0x54054,_0x3541ab){_0x54054=_0x54054-0x0;var _0x4f3954=_0x0e9f[_0x54054];return _0x4f3954;};'use strict';var Sequelize=require(_0xf0e9('0x0'));module[_0xf0e9('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xf0e9('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xf0e9('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 3f97a43..f42cede 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 _0x194e=['map','CmContactHasItem','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','fields','length','model','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmContactHasItems','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','index'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x194e,0x7c));var _0xe194=function(_0xe009b5,_0x45b4b4){_0xe009b5=_0xe009b5-0x0;var _0x4c1d04=_0x194e[_0xe009b5];return _0x4c1d04;};'use strict';var emlformat=require(_0xe194('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe194('0x1'));var jsonpatch=require(_0xe194('0x2'));var rp=require(_0xe194('0x3'));var moment=require('moment');var BPromise=require(_0xe194('0x4'));var Mustache=require(_0xe194('0x5'));var util=require(_0xe194('0x6'));var path=require(_0xe194('0x7'));var sox=require(_0xe194('0x8'));var csv=require(_0xe194('0x9'));var ejs=require(_0xe194('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe194('0xb'));var squel=require(_0xe194('0xc'));var crypto=require('crypto');var jsforce=require(_0xe194('0xd'));var deskjs=require(_0xe194('0xe'));var toCsv=require(_0xe194('0x9'));var querystring=require(_0xe194('0xf'));var Papa=require(_0xe194('0x10'));var Redis=require('ioredis');var authService=require(_0xe194('0x11'));var qs=require(_0xe194('0x12'));var as=require(_0xe194('0x13'));var hardwareService=require(_0xe194('0x14'));var logger=require('../../config/logger')(_0xe194('0x15'));var utils=require(_0xe194('0x16'));var config=require(_0xe194('0x17'));var licenseUtil=require(_0xe194('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f43b2,_0x492861){_0x492861=_0x492861||0xcc;return function(_0x280d1a){if(_0x280d1a){return _0x4f43b2[_0xe194('0x19')](_0x492861);}return _0x4f43b2[_0xe194('0x1a')](_0x492861)['end']();};}function respondWithResult(_0x22611b,_0x2e4403){_0x2e4403=_0x2e4403||0xc8;return function(_0x9159d3){if(_0x9159d3){return _0x22611b[_0xe194('0x1a')](_0x2e4403)[_0xe194('0x1b')](_0x9159d3);}};}function respondWithFilteredResult(_0x56b7e2,_0x35f2a1){return function(_0x47b432){if(_0x47b432){var _0x3ddbd6=typeof _0x35f2a1[_0xe194('0x1c')]==='undefined'&&typeof _0x35f2a1[_0xe194('0x1d')]===_0xe194('0x1e');var _0x54c443=_0x47b432[_0xe194('0x1f')];var _0x2e55f0=_0x3ddbd6?0x0:_0x35f2a1[_0xe194('0x1c')];var _0x4895e5=_0x3ddbd6?_0x47b432[_0xe194('0x1f')]:_0x35f2a1[_0xe194('0x1c')]+_0x35f2a1['limit'];var _0x384b0e;if(_0x4895e5>=_0x54c443){_0x4895e5=_0x54c443;_0x384b0e=0xc8;}else{_0x384b0e=0xce;}_0x56b7e2[_0xe194('0x1a')](_0x384b0e);return _0x56b7e2[_0xe194('0x20')](_0xe194('0x21'),_0x2e55f0+'-'+_0x4895e5+'/'+_0x54c443)[_0xe194('0x1b')](_0x47b432);}return null;};}function patchUpdates(_0x23f4bd){return function(_0x345b17){try{jsonpatch['apply'](_0x345b17,_0x23f4bd,!![]);}catch(_0x3b740b){return BPromise[_0xe194('0x22')](_0x3b740b);}return _0x345b17[_0xe194('0x23')]();};}function saveUpdates(_0xb81222,_0x5a5ee5){return function(_0xec1be3){if(_0xec1be3){return _0xec1be3[_0xe194('0x24')](_0xb81222)[_0xe194('0x25')](function(_0x29923f){return _0x29923f;});}return null;};}function removeEntity(_0x45e61e,_0xdf7161){return function(_0x26858f){if(_0x26858f){return _0x26858f['destroy']()['then'](function(){var _0xfcd2e9=_0x26858f[_0xe194('0x26')]({'plain':!![]});var _0x436c='CmContactHasItems';return db[_0xe194('0x27')][_0xe194('0x28')]({'where':{'type':_0x436c,'resourceId':_0xfcd2e9['id']}})[_0xe194('0x25')](function(){return _0x26858f;});})[_0xe194('0x25')](function(){_0x45e61e[_0xe194('0x1a')](0xcc)[_0xe194('0x29')]();});}};}function handleEntityNotFound(_0x8749,_0x3f8ab9){return function(_0x316ae4){if(!_0x316ae4){_0x8749[_0xe194('0x19')](0x194);}return _0x316ae4;};}function handleError(_0x3635b8,_0x6e5534){_0x6e5534=_0x6e5534||0x1f4;return function(_0x51ff33){logger[_0xe194('0x2a')](_0x51ff33[_0xe194('0x2b')]);if(_0x51ff33[_0xe194('0x2c')]){delete _0x51ff33['name'];}_0x3635b8[_0xe194('0x1a')](_0x6e5534)['send'](_0x51ff33);};}exports[_0xe194('0x2d')]=function(_0x31572e,_0x47a3c7){var _0x228703={},_0x4b310c={},_0x2588f3={'count':0x0,'rows':[]};var _0x34bda2=_[_0xe194('0x2e')](db[_0xe194('0x2f')][_0xe194('0x30')],function(_0x14d913){return{'name':_0x14d913[_0xe194('0x31')],'type':_0x14d913[_0xe194('0x32')][_0xe194('0x33')]};});_0x4b310c['model']=_[_0xe194('0x2e')](_0x34bda2,_0xe194('0x2c'));_0x4b310c[_0xe194('0x34')]=_[_0xe194('0x35')](_0x31572e[_0xe194('0x34')]);_0x4b310c['filters']=_['intersection'](_0x4b310c['model'],_0x4b310c['query']);_0x228703[_0xe194('0x36')]=_[_0xe194('0x37')](_0x4b310c['model'],qs[_0xe194('0x38')](_0x31572e[_0xe194('0x34')][_0xe194('0x38')]));_0x228703[_0xe194('0x36')]=_0x228703[_0xe194('0x36')][_0xe194('0x39')]?_0x228703[_0xe194('0x36')]:_0x4b310c[_0xe194('0x3a')];if(!_0x31572e[_0xe194('0x34')]['hasOwnProperty'](_0xe194('0x3b'))){_0x228703[_0xe194('0x1d')]=qs[_0xe194('0x1d')](_0x31572e['query'][_0xe194('0x1d')]);_0x228703[_0xe194('0x1c')]=qs[_0xe194('0x1c')](_0x31572e[_0xe194('0x34')][_0xe194('0x1c')]);}_0x228703[_0xe194('0x3c')]=qs[_0xe194('0x3d')](_0x31572e[_0xe194('0x34')][_0xe194('0x3d')]);_0x228703[_0xe194('0x3e')]=qs[_0xe194('0x3f')](_[_0xe194('0x40')](_0x31572e[_0xe194('0x34')],_0x4b310c[_0xe194('0x3f')]),_0x34bda2);if(_0x31572e[_0xe194('0x34')][_0xe194('0x41')]){_0x228703[_0xe194('0x3e')]=_[_0xe194('0x42')](_0x228703['where'],{'$or':_[_0xe194('0x2e')](_0x34bda2,function(_0x1993d2){if(_0x1993d2[_0xe194('0x32')]!==_0xe194('0x43')){var _0x370c77={};_0x370c77[_0x1993d2['name']]={'$like':'%'+_0x31572e[_0xe194('0x34')]['filter']+'%'};return _0x370c77;}})});}_0x228703=_[_0xe194('0x42')]({},_0x228703,_0x31572e[_0xe194('0x44')]);var _0x58f317={'where':_0x228703[_0xe194('0x3e')]};return db[_0xe194('0x2f')]['count'](_0x58f317)['then'](function(_0x443b84){_0x2588f3[_0xe194('0x1f')]=_0x443b84;if(_0x31572e[_0xe194('0x34')][_0xe194('0x45')]){_0x228703['include']=[{'all':!![]}];}return db['CmContactHasItem'][_0xe194('0x46')](_0x228703);})[_0xe194('0x25')](function(_0x131472){_0x2588f3[_0xe194('0x47')]=_0x131472;return _0x2588f3;})[_0xe194('0x25')](respondWithFilteredResult(_0x47a3c7,_0x228703))[_0xe194('0x48')](handleError(_0x47a3c7,null));};exports[_0xe194('0x49')]=function(_0x1550fc,_0x5c4093){var _0x30bc17={'raw':!![],'where':{'id':_0x1550fc[_0xe194('0x4a')]['id']}},_0x52d59f={};_0x52d59f[_0xe194('0x3a')]=_[_0xe194('0x35')](db[_0xe194('0x2f')][_0xe194('0x30')]);_0x52d59f['query']=_[_0xe194('0x35')](_0x1550fc[_0xe194('0x34')]);_0x52d59f[_0xe194('0x3f')]=_[_0xe194('0x37')](_0x52d59f[_0xe194('0x3a')],_0x52d59f['query']);_0x30bc17['attributes']=_[_0xe194('0x37')](_0x52d59f[_0xe194('0x3a')],qs['fields'](_0x1550fc['query'][_0xe194('0x38')]));_0x30bc17[_0xe194('0x36')]=_0x30bc17[_0xe194('0x36')][_0xe194('0x39')]?_0x30bc17[_0xe194('0x36')]:_0x52d59f['model'];if(_0x1550fc[_0xe194('0x34')]['includeAll']){_0x30bc17[_0xe194('0x4b')]=[{'all':!![]}];}_0x30bc17=_['merge']({},_0x30bc17,_0x1550fc[_0xe194('0x44')]);return db[_0xe194('0x2f')][_0xe194('0x4c')](_0x30bc17)[_0xe194('0x25')](handleEntityNotFound(_0x5c4093,null))[_0xe194('0x25')](respondWithResult(_0x5c4093,null))[_0xe194('0x48')](handleError(_0x5c4093,null));};exports[_0xe194('0x4d')]=function(_0x38e6d9,_0x1777a9){return db[_0xe194('0x2f')]['create'](_0x38e6d9[_0xe194('0x4e')],{})[_0xe194('0x25')](function(_0x4dd732){var _0x516df6=_0x38e6d9[_0xe194('0x4f')][_0xe194('0x26')]({'plain':!![]});if(!_0x516df6)throw new Error(_0xe194('0x50'));if(_0x516df6['role']===_0xe194('0x4f')){var _0x45981f=_0x4dd732[_0xe194('0x26')]({'plain':!![]});var _0x139dbc=_0xe194('0x51');return db[_0xe194('0x52')][_0xe194('0x4c')]({'where':{'name':_0x139dbc,'userProfileId':_0x516df6['userProfileId']},'raw':!![]})[_0xe194('0x25')](function(_0xef27ed){if(_0xef27ed&&_0xef27ed[_0xe194('0x53')]===0x0){return db[_0xe194('0x27')]['create']({'name':_0x45981f[_0xe194('0x2c')],'resourceId':_0x45981f['id'],'type':_0xef27ed['name'],'sectionId':_0xef27ed['id']},{})[_0xe194('0x25')](function(){return _0x4dd732;});}else{return _0x4dd732;}})[_0xe194('0x48')](function(_0x3c358a){logger[_0xe194('0x2a')](_0xe194('0x54'),_0x3c358a);throw _0x3c358a;});}return _0x4dd732;})[_0xe194('0x25')](respondWithResult(_0x1777a9,0xc9))['catch'](handleError(_0x1777a9,null));};exports['update']=function(_0x51194a,_0x113354){if(_0x51194a[_0xe194('0x4e')]['id']){delete _0x51194a[_0xe194('0x4e')]['id'];}return db[_0xe194('0x2f')][_0xe194('0x4c')]({'where':{'id':_0x51194a[_0xe194('0x4a')]['id']}})['then'](handleEntityNotFound(_0x113354,null))[_0xe194('0x25')](saveUpdates(_0x51194a['body'],null))['then'](respondWithResult(_0x113354,null))[_0xe194('0x48')](handleError(_0x113354,null));};exports[_0xe194('0x28')]=function(_0x26b5be,_0x5d0bcb){return db[_0xe194('0x2f')][_0xe194('0x4c')]({'where':{'id':_0x26b5be[_0xe194('0x4a')]['id']}})[_0xe194('0x25')](handleEntityNotFound(_0x5d0bcb,null))[_0xe194('0x25')](removeEntity(_0x5d0bcb,null))[_0xe194('0x48')](handleError(_0x5d0bcb,null));}; \ No newline at end of file +var _0xf293=['error','stack','name','send','index','rawAttributes','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','CmContactHasItem','include','findAll','rows','catch','show','params','fields','includeAll','create','body','user','get','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','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','CmContactHasItems','UserProfileResource'];(function(_0x306abc,_0x1c7f78){var _0x5ef657=function(_0x22198f){while(--_0x22198f){_0x306abc['push'](_0x306abc['shift']());}};_0x5ef657(++_0x1c7f78);}(_0xf293,0x135));var _0x3f29=function(_0x92aecf,_0x21bf3f){_0x92aecf=_0x92aecf-0x0;var _0x27812c=_0xf293[_0x92aecf];return _0x27812c;};'use strict';var emlformat=require(_0x3f29('0x0'));var rimraf=require(_0x3f29('0x1'));var zipdir=require(_0x3f29('0x2'));var jsonpatch=require(_0x3f29('0x3'));var rp=require(_0x3f29('0x4'));var moment=require(_0x3f29('0x5'));var BPromise=require(_0x3f29('0x6'));var Mustache=require(_0x3f29('0x7'));var util=require(_0x3f29('0x8'));var path=require('path');var sox=require(_0x3f29('0x9'));var csv=require(_0x3f29('0xa'));var ejs=require(_0x3f29('0xb'));var fs=require('fs');var fs_extra=require(_0x3f29('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3f29('0xd'));var jsforce=require(_0x3f29('0xe'));var deskjs=require(_0x3f29('0xf'));var toCsv=require(_0x3f29('0xa'));var querystring=require(_0x3f29('0x10'));var Papa=require(_0x3f29('0x11'));var Redis=require(_0x3f29('0x12'));var authService=require(_0x3f29('0x13'));var qs=require(_0x3f29('0x14'));var as=require(_0x3f29('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f29('0x16'))(_0x3f29('0x17'));var utils=require(_0x3f29('0x18'));var config=require(_0x3f29('0x19'));var licenseUtil=require(_0x3f29('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x122731,_0x33b899){_0x33b899=_0x33b899||0xcc;return function(_0x21ad8e){if(_0x21ad8e){return _0x122731[_0x3f29('0x1b')](_0x33b899);}return _0x122731[_0x3f29('0x1c')](_0x33b899)[_0x3f29('0x1d')]();};}function respondWithResult(_0x1646de,_0x2bf435){_0x2bf435=_0x2bf435||0xc8;return function(_0x266c92){if(_0x266c92){return _0x1646de[_0x3f29('0x1c')](_0x2bf435)['json'](_0x266c92);}};}function respondWithFilteredResult(_0x1e0caa,_0xad54ff){return function(_0x363207){if(_0x363207){var _0xd13b1b=typeof _0xad54ff[_0x3f29('0x1e')]===_0x3f29('0x1f')&&typeof _0xad54ff[_0x3f29('0x20')]===_0x3f29('0x1f');var _0x5f2313=_0x363207[_0x3f29('0x21')];var _0x2f57c7=_0xd13b1b?0x0:_0xad54ff['offset'];var _0xf577ca=_0xd13b1b?_0x363207[_0x3f29('0x21')]:_0xad54ff['offset']+_0xad54ff[_0x3f29('0x20')];var _0x17bd1a;if(_0xf577ca>=_0x5f2313){_0xf577ca=_0x5f2313;_0x17bd1a=0xc8;}else{_0x17bd1a=0xce;}_0x1e0caa['status'](_0x17bd1a);return _0x1e0caa[_0x3f29('0x22')](_0x3f29('0x23'),_0x2f57c7+'-'+_0xf577ca+'/'+_0x5f2313)['json'](_0x363207);}return null;};}function patchUpdates(_0x5cd5f0){return function(_0x58fc7f){try{jsonpatch[_0x3f29('0x24')](_0x58fc7f,_0x5cd5f0,!![]);}catch(_0x4632cd){return BPromise['reject'](_0x4632cd);}return _0x58fc7f[_0x3f29('0x25')]();};}function saveUpdates(_0x48721a,_0x212122){return function(_0x313821){if(_0x313821){return _0x313821[_0x3f29('0x26')](_0x48721a)[_0x3f29('0x27')](function(_0x19e58b){return _0x19e58b;});}return null;};}function removeEntity(_0x25fabb,_0xa2b332){return function(_0x41d861){if(_0x41d861){return _0x41d861[_0x3f29('0x28')]()[_0x3f29('0x27')](function(){var _0x9c9c4d=_0x41d861['get']({'plain':!![]});var _0x4d34b9=_0x3f29('0x29');return db[_0x3f29('0x2a')][_0x3f29('0x28')]({'where':{'type':_0x4d34b9,'resourceId':_0x9c9c4d['id']}})[_0x3f29('0x27')](function(){return _0x41d861;});})['then'](function(){_0x25fabb[_0x3f29('0x1c')](0xcc)[_0x3f29('0x1d')]();});}};}function handleEntityNotFound(_0x2e716a,_0x2e5ffc){return function(_0x1b4b9a){if(!_0x1b4b9a){_0x2e716a[_0x3f29('0x1b')](0x194);}return _0x1b4b9a;};}function handleError(_0x4e9910,_0x4db9d8){_0x4db9d8=_0x4db9d8||0x1f4;return function(_0x2d783b){logger[_0x3f29('0x2b')](_0x2d783b[_0x3f29('0x2c')]);if(_0x2d783b[_0x3f29('0x2d')]){delete _0x2d783b['name'];}_0x4e9910[_0x3f29('0x1c')](_0x4db9d8)[_0x3f29('0x2e')](_0x2d783b);};}exports[_0x3f29('0x2f')]=function(_0x47c176,_0x512fc2){var _0x2c3e2e={},_0x4817d7={},_0x3e55fb={'count':0x0,'rows':[]};var _0x3d7a57=_['map'](db['CmContactHasItem'][_0x3f29('0x30')],function(_0x2adb33){return{'name':_0x2adb33['fieldName'],'type':_0x2adb33['type'][_0x3f29('0x31')]};});_0x4817d7[_0x3f29('0x32')]=_[_0x3f29('0x33')](_0x3d7a57,_0x3f29('0x2d'));_0x4817d7[_0x3f29('0x34')]=_[_0x3f29('0x35')](_0x47c176['query']);_0x4817d7['filters']=_[_0x3f29('0x36')](_0x4817d7['model'],_0x4817d7['query']);_0x2c3e2e[_0x3f29('0x37')]=_[_0x3f29('0x36')](_0x4817d7['model'],qs['fields'](_0x47c176[_0x3f29('0x34')]['fields']));_0x2c3e2e[_0x3f29('0x37')]=_0x2c3e2e[_0x3f29('0x37')][_0x3f29('0x38')]?_0x2c3e2e[_0x3f29('0x37')]:_0x4817d7[_0x3f29('0x32')];if(!_0x47c176[_0x3f29('0x34')][_0x3f29('0x39')](_0x3f29('0x3a'))){_0x2c3e2e[_0x3f29('0x20')]=qs['limit'](_0x47c176['query']['limit']);_0x2c3e2e[_0x3f29('0x1e')]=qs[_0x3f29('0x1e')](_0x47c176[_0x3f29('0x34')][_0x3f29('0x1e')]);}_0x2c3e2e[_0x3f29('0x3b')]=qs[_0x3f29('0x3c')](_0x47c176['query'][_0x3f29('0x3c')]);_0x2c3e2e[_0x3f29('0x3d')]=qs[_0x3f29('0x3e')](_[_0x3f29('0x3f')](_0x47c176[_0x3f29('0x34')],_0x4817d7[_0x3f29('0x3e')]),_0x3d7a57);if(_0x47c176[_0x3f29('0x34')][_0x3f29('0x40')]){_0x2c3e2e[_0x3f29('0x3d')]=_[_0x3f29('0x41')](_0x2c3e2e['where'],{'$or':_[_0x3f29('0x33')](_0x3d7a57,function(_0x1e4207){if(_0x1e4207['type']!==_0x3f29('0x42')){var _0x511a02={};_0x511a02[_0x1e4207['name']]={'$like':'%'+_0x47c176[_0x3f29('0x34')][_0x3f29('0x40')]+'%'};return _0x511a02;}})});}_0x2c3e2e=_[_0x3f29('0x41')]({},_0x2c3e2e,_0x47c176[_0x3f29('0x43')]);var _0x3efb64={'where':_0x2c3e2e[_0x3f29('0x3d')]};return db[_0x3f29('0x44')][_0x3f29('0x21')](_0x3efb64)[_0x3f29('0x27')](function(_0x1f0fed){_0x3e55fb[_0x3f29('0x21')]=_0x1f0fed;if(_0x47c176[_0x3f29('0x34')]['includeAll']){_0x2c3e2e[_0x3f29('0x45')]=[{'all':!![]}];}return db[_0x3f29('0x44')][_0x3f29('0x46')](_0x2c3e2e);})['then'](function(_0x19239e){_0x3e55fb[_0x3f29('0x47')]=_0x19239e;return _0x3e55fb;})[_0x3f29('0x27')](respondWithFilteredResult(_0x512fc2,_0x2c3e2e))[_0x3f29('0x48')](handleError(_0x512fc2,null));};exports[_0x3f29('0x49')]=function(_0x3f36bb,_0x12a265){var _0xcd76fa={'raw':!![],'where':{'id':_0x3f36bb[_0x3f29('0x4a')]['id']}},_0x342db0={};_0x342db0[_0x3f29('0x32')]=_[_0x3f29('0x35')](db[_0x3f29('0x44')][_0x3f29('0x30')]);_0x342db0[_0x3f29('0x34')]=_[_0x3f29('0x35')](_0x3f36bb['query']);_0x342db0['filters']=_[_0x3f29('0x36')](_0x342db0[_0x3f29('0x32')],_0x342db0[_0x3f29('0x34')]);_0xcd76fa[_0x3f29('0x37')]=_[_0x3f29('0x36')](_0x342db0[_0x3f29('0x32')],qs[_0x3f29('0x4b')](_0x3f36bb[_0x3f29('0x34')][_0x3f29('0x4b')]));_0xcd76fa[_0x3f29('0x37')]=_0xcd76fa[_0x3f29('0x37')][_0x3f29('0x38')]?_0xcd76fa[_0x3f29('0x37')]:_0x342db0[_0x3f29('0x32')];if(_0x3f36bb[_0x3f29('0x34')][_0x3f29('0x4c')]){_0xcd76fa['include']=[{'all':!![]}];}_0xcd76fa=_['merge']({},_0xcd76fa,_0x3f36bb['options']);return db[_0x3f29('0x44')]['find'](_0xcd76fa)['then'](handleEntityNotFound(_0x12a265,null))[_0x3f29('0x27')](respondWithResult(_0x12a265,null))[_0x3f29('0x48')](handleError(_0x12a265,null));};exports[_0x3f29('0x4d')]=function(_0x2888e6,_0x436425){return db[_0x3f29('0x44')][_0x3f29('0x4d')](_0x2888e6[_0x3f29('0x4e')],{})['then'](function(_0x24334c){var _0x29b5b2=_0x2888e6[_0x3f29('0x4f')][_0x3f29('0x50')]({'plain':!![]});if(!_0x29b5b2)throw new Error(_0x3f29('0x51'));if(_0x29b5b2[_0x3f29('0x52')]===_0x3f29('0x4f')){var _0x22a0e9=_0x24334c[_0x3f29('0x50')]({'plain':!![]});var _0x319774=_0x3f29('0x29');return db[_0x3f29('0x53')][_0x3f29('0x54')]({'where':{'name':_0x319774,'userProfileId':_0x29b5b2[_0x3f29('0x55')]},'raw':!![]})[_0x3f29('0x27')](function(_0x3ab8c9){if(_0x3ab8c9&&_0x3ab8c9[_0x3f29('0x56')]===0x0){return db['UserProfileResource'][_0x3f29('0x4d')]({'name':_0x22a0e9['name'],'resourceId':_0x22a0e9['id'],'type':_0x3ab8c9[_0x3f29('0x2d')],'sectionId':_0x3ab8c9['id']},{})[_0x3f29('0x27')](function(){return _0x24334c;});}else{return _0x24334c;}})[_0x3f29('0x48')](function(_0x325080){logger[_0x3f29('0x2b')](_0x3f29('0x57'),_0x325080);throw _0x325080;});}return _0x24334c;})[_0x3f29('0x27')](respondWithResult(_0x436425,0xc9))[_0x3f29('0x48')](handleError(_0x436425,null));};exports[_0x3f29('0x26')]=function(_0x3a1535,_0x474d00){if(_0x3a1535[_0x3f29('0x4e')]['id']){delete _0x3a1535[_0x3f29('0x4e')]['id'];}return db['CmContactHasItem'][_0x3f29('0x54')]({'where':{'id':_0x3a1535[_0x3f29('0x4a')]['id']}})['then'](handleEntityNotFound(_0x474d00,null))[_0x3f29('0x27')](saveUpdates(_0x3a1535['body'],null))[_0x3f29('0x27')](respondWithResult(_0x474d00,null))[_0x3f29('0x48')](handleError(_0x474d00,null));};exports['destroy']=function(_0x5243a9,_0xfc6437){return db[_0x3f29('0x44')][_0x3f29('0x54')]({'where':{'id':_0x5243a9[_0x3f29('0x4a')]['id']}})[_0x3f29('0x27')](handleEntityNotFound(_0xfc6437,null))[_0x3f29('0x27')](removeEntity(_0xfc6437,null))[_0x3f29('0x48')](handleError(_0xfc6437,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 8fc7042..3fbd718 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 _0x0000=['api','moment','bluebird','path','rimraf','../../config/environment','exports','CmContactHasItem','cm_contact_has_items','util'];(function(_0x17a852,_0x25e880){var _0x21d525=function(_0x3ba57f){while(--_0x3ba57f){_0x17a852['push'](_0x17a852['shift']());}};_0x21d525(++_0x25e880);}(_0x0000,0x17b));var _0x0000=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0000[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x0000('0x0'));var logger=require('../../config/logger')(_0x0000('0x1'));var moment=require(_0x0000('0x2'));var BPromise=require(_0x0000('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0000('0x4'));var rimraf=require(_0x0000('0x5'));var config=require(_0x0000('0x6'));var attributes=require('./cmContactHasItem.attributes');module[_0x0000('0x7')]=function(_0x220eb2,_0x20f572){return _0x220eb2['define'](_0x0000('0x8'),attributes,{'tableName':_0x0000('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d9b=['define','CmContactHasItem','cm_contact_has_items','../../config/logger','bluebird','request-promise','path','rimraf','./cmContactHasItem.attributes','exports'];(function(_0x4c0baa,_0x2e110f){var _0x4bf459=function(_0x401aa3){while(--_0x401aa3){_0x4c0baa['push'](_0x4c0baa['shift']());}};_0x4bf459(++_0x2e110f);}(_0x4d9b,0xa3));var _0xb4d9=function(_0x12be2a,_0x3bc4f4){_0x12be2a=_0x12be2a-0x0;var _0x1ff626=_0x4d9b[_0x12be2a];return _0x1ff626;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb4d9('0x0'))('api');var moment=require('moment');var BPromise=require(_0xb4d9('0x1'));var rp=require(_0xb4d9('0x2'));var fs=require('fs');var path=require(_0xb4d9('0x3'));var rimraf=require(_0xb4d9('0x4'));var config=require('../../config/environment');var attributes=require(_0xb4d9('0x5'));module[_0xb4d9('0x6')]=function(_0x5862f4,_0x5e42a0){return _0x5862f4[_0xb4d9('0x7')](_0xb4d9('0x8'),attributes,{'tableName':_0xb4d9('0x9'),'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 879f4ad..d8f14fa 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 _0x2c3d=['error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s'];(function(_0x3dbb16,_0x881a4a){var _0x47afd9=function(_0x1db85e){while(--_0x1db85e){_0x3dbb16['push'](_0x3dbb16['shift']());}};_0x47afd9(++_0x881a4a);}(_0x2c3d,0xdd));var _0xd2c3=function(_0x434c53,_0x5dd162){_0x434c53=_0x434c53-0x0;var _0x4c5fc9=_0x2c3d[_0x434c53];return _0x4c5fc9;};'use strict';var _=require(_0xd2c3('0x0'));var util=require('util');var moment=require(_0xd2c3('0x1'));var BPromise=require('bluebird');var rs=require(_0xd2c3('0x2'));var fs=require('fs');var Redis=require(_0xd2c3('0x3'));var db=require(_0xd2c3('0x4'))['db'];var utils=require(_0xd2c3('0x5'));var logger=require(_0xd2c3('0x6'))(_0xd2c3('0x7'));var config=require(_0xd2c3('0x8'));var jayson=require(_0xd2c3('0x9'));var client=jayson[_0xd2c3('0xa')][_0xd2c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a6a2e,_0x4c5f69,_0x5c6cc8){return new BPromise(function(_0x3f6b42,_0xc80eee){return client[_0xd2c3('0xc')](_0x1a6a2e,_0x5c6cc8)[_0xd2c3('0xd')](function(_0x149a8b){logger[_0xd2c3('0xe')](_0xd2c3('0xf'),_0x4c5f69,_0xd2c3('0x10'));logger[_0xd2c3('0x11')](_0xd2c3('0x12'),_0x4c5f69,_0xd2c3('0x10'),JSON['stringify'](_0x149a8b));if(_0x149a8b[_0xd2c3('0x13')]){if(_0x149a8b[_0xd2c3('0x13')][_0xd2c3('0x14')]===0x1f4){logger[_0xd2c3('0x13')](_0xd2c3('0xf'),_0x4c5f69,_0x149a8b[_0xd2c3('0x13')][_0xd2c3('0x15')]);return _0xc80eee(_0x149a8b[_0xd2c3('0x13')]['message']);}logger[_0xd2c3('0x13')](_0xd2c3('0xf'),_0x4c5f69,_0x149a8b['error'][_0xd2c3('0x15')]);return _0x3f6b42(_0x149a8b[_0xd2c3('0x13')][_0xd2c3('0x15')]);}else{logger[_0xd2c3('0xe')](_0xd2c3('0xf'),_0x4c5f69,_0xd2c3('0x10'));_0x3f6b42(_0x149a8b[_0xd2c3('0x16')][_0xd2c3('0x15')]);}})[_0xd2c3('0x17')](function(_0x534c52){logger[_0xd2c3('0x13')](_0xd2c3('0xf'),_0x4c5f69,_0x534c52);_0xc80eee(_0x534c52);});});} \ No newline at end of file +var _0xfcbf=['client','http','request','then','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x22a233,_0xed4800){var _0x775e1f=function(_0x3d19f9){while(--_0x3d19f9){_0x22a233['push'](_0x22a233['shift']());}};_0x775e1f(++_0xed4800);}(_0xfcbf,0xff));var _0xffcb=function(_0x4e956a,_0x29b8dd){_0x4e956a=_0x4e956a-0x0;var _0x1feef4=_0xfcbf[_0x4e956a];return _0x1feef4;};'use strict';var _=require(_0xffcb('0x0'));var util=require(_0xffcb('0x1'));var moment=require(_0xffcb('0x2'));var BPromise=require(_0xffcb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffcb('0x4'));var db=require(_0xffcb('0x5'))['db'];var utils=require(_0xffcb('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xffcb('0x7'));var jayson=require(_0xffcb('0x8'));var client=jayson[_0xffcb('0x9')][_0xffcb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4919eb,_0x35c3fa,_0xa85f10){return new BPromise(function(_0x35b797,_0x2f5121){return client[_0xffcb('0xb')](_0x4919eb,_0xa85f10)[_0xffcb('0xc')](function(_0xe8d66e){logger[_0xffcb('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0x35c3fa,_0xffcb('0xe'));logger[_0xffcb('0xf')](_0xffcb('0x10'),_0x35c3fa,'request\x20sent',JSON[_0xffcb('0x11')](_0xe8d66e));if(_0xe8d66e[_0xffcb('0x12')]){if(_0xe8d66e[_0xffcb('0x12')][_0xffcb('0x13')]===0x1f4){logger['error'](_0xffcb('0x14'),_0x35c3fa,_0xe8d66e[_0xffcb('0x12')][_0xffcb('0x15')]);return _0x2f5121(_0xe8d66e[_0xffcb('0x12')][_0xffcb('0x15')]);}logger[_0xffcb('0x12')](_0xffcb('0x14'),_0x35c3fa,_0xe8d66e['error'][_0xffcb('0x15')]);return _0x35b797(_0xe8d66e['error'][_0xffcb('0x15')]);}else{logger[_0xffcb('0xd')](_0xffcb('0x14'),_0x35c3fa,_0xffcb('0xe'));_0x35b797(_0xe8d66e[_0xffcb('0x16')][_0xffcb('0x15')]);}})[_0xffcb('0x17')](function(_0x412c69){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x35c3fa,_0x412c69);_0x2f5121(_0x412c69);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 3c6c3e9..ee13f91 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 _0x4281=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','put','delete'];(function(_0x116b20,_0x2c0e55){var _0x143ca2=function(_0x3bd2d4){while(--_0x3bd2d4){_0x116b20['push'](_0x116b20['shift']());}};_0x143ca2(++_0x2c0e55);}(_0x4281,0x1a4));var _0x1428=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x4281[_0x62c958];return _0x57ec61;};'use strict';var multer=require(_0x1428('0x0'));var util=require(_0x1428('0x1'));var path=require(_0x1428('0x2'));var timeout=require(_0x1428('0x3'));var express=require(_0x1428('0x4'));var router=express[_0x1428('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1428('0x6'));var interaction=require(_0x1428('0x7'));var config=require('../../config/environment');var controller=require(_0x1428('0x8'));router[_0x1428('0x9')]('/',auth[_0x1428('0xa')](),controller[_0x1428('0xb')]);router[_0x1428('0x9')](_0x1428('0xc'),auth['isAuthenticated'](),controller[_0x1428('0xd')]);router[_0x1428('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1428('0xf')](_0x1428('0xc'),auth[_0x1428('0xa')](),controller['update']);router[_0x1428('0x10')](_0x1428('0xc'),auth[_0x1428('0xa')](),controller[_0x1428('0x11')]);module[_0x1428('0x12')]=router; \ No newline at end of file +var _0xafc6=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x2dcb3e,_0x26414d){var _0x884bc5=function(_0x30b958){while(--_0x30b958){_0x2dcb3e['push'](_0x2dcb3e['shift']());}};_0x884bc5(++_0x26414d);}(_0xafc6,0x180));var _0x6afc=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xafc6[_0x22b68a];return _0x1ac67a;};'use strict';var multer=require(_0x6afc('0x0'));var util=require(_0x6afc('0x1'));var path=require(_0x6afc('0x2'));var timeout=require(_0x6afc('0x3'));var express=require(_0x6afc('0x4'));var router=express[_0x6afc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6afc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6afc('0x7'));router[_0x6afc('0x8')]('/',auth[_0x6afc('0x9')](),controller[_0x6afc('0xa')]);router[_0x6afc('0x8')](_0x6afc('0xb'),auth[_0x6afc('0x9')](),controller[_0x6afc('0xc')]);router[_0x6afc('0xd')]('/',auth[_0x6afc('0x9')](),controller[_0x6afc('0xe')]);router[_0x6afc('0xf')](_0x6afc('0xb'),auth['isAuthenticated'](),controller[_0x6afc('0x10')]);router[_0x6afc('0x11')](_0x6afc('0xb'),auth['isAuthenticated'](),controller[_0x6afc('0x12')]);module[_0x6afc('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 db9c5ff..07d2d7e 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 _0xf437=['long','type','select','parse','values','BOOLEAN','ENUM','voice','lodash','exports','alias','STRING','setDataValue','getDataValue','TEXT'];(function(_0xf1b134,_0xb399dd){var _0x139dbb=function(_0xe7a88d){while(--_0xe7a88d){_0xf1b134['push'](_0xf1b134['shift']());}};_0x139dbb(++_0xb399dd);}(_0xf437,0x1e8));var _0x7f43=function(_0x42e25e,_0x46cfd1){_0x42e25e=_0x42e25e-0x0;var _0x1ed3a6=_0xf437[_0x42e25e];return _0x1ed3a6;};'use strict';var Sequelize=require('sequelize');var _=require(_0x7f43('0x0'));module[_0x7f43('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x131bb7){return this['getDataValue'](_0x7f43('0x2'));}},'alias':{'type':Sequelize[_0x7f43('0x3')],'allowNull':![],'set':function(_0x588f6c){this[_0x7f43('0x4')](_0x7f43('0x2'),_0x588f6c?_0x588f6c:this[_0x7f43('0x5')]('name'));}},'type':{'type':Sequelize[_0x7f43('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x7f43('0x6')](_0x7f43('0x7')),'get':function(){if(this[_0x7f43('0x5')](_0x7f43('0x8'))===_0x7f43('0x9')){return JSON[_0x7f43('0xa')](this[_0x7f43('0x5')](_0x7f43('0xb')));}else{return this[_0x7f43('0x5')](_0x7f43('0xb'));}},'set':function(_0x3933b0){if(Array['isArray'](_0x3933b0)){this[_0x7f43('0x4')](_0x7f43('0xb'),JSON['stringify'](_0x3933b0));}else{this[_0x7f43('0x4')](_0x7f43('0xb'),_0x3933b0);}}},'required':{'type':Sequelize[_0x7f43('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7f43('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x7f43('0xd')](_0x7f43('0xe'))}}; \ No newline at end of file +var _0x858e=['parse','values','isArray','stringify','BOOLEAN','ENUM','sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue','name','TEXT','long','select'];(function(_0x5f0dc0,_0x5a7898){var _0x518322=function(_0x280f7a){while(--_0x280f7a){_0x5f0dc0['push'](_0x5f0dc0['shift']());}};_0x518322(++_0x5a7898);}(_0x858e,0x138));var _0xe858=function(_0x3f8d23,_0x16f5ee){_0x3f8d23=_0x3f8d23-0x0;var _0x1ffe51=_0x858e[_0x3f8d23];return _0x1ffe51;};'use strict';var Sequelize=require(_0xe858('0x0'));var _=require(_0xe858('0x1'));module[_0xe858('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x34c91b){return this[_0xe858('0x3')](_0xe858('0x4'));}},'alias':{'type':Sequelize[_0xe858('0x5')],'allowNull':![],'set':function(_0x31b8c3){this[_0xe858('0x6')](_0xe858('0x4'),_0x31b8c3?_0x31b8c3:this[_0xe858('0x3')](_0xe858('0x7')));}},'type':{'type':Sequelize[_0xe858('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xe858('0x8')](_0xe858('0x9')),'get':function(){if(this[_0xe858('0x3')]('type')===_0xe858('0xa')){return JSON[_0xe858('0xb')](this['getDataValue']('values'));}else{return this[_0xe858('0x3')](_0xe858('0xc'));}},'set':function(_0x5e3915){if(Array[_0xe858('0xd')](_0x5e3915)){this[_0xe858('0x6')](_0xe858('0xc'),JSON[_0xe858('0xe')](_0x5e3915));}else{this[_0xe858('0x6')](_0xe858('0xc'),_0x5e3915);}}},'required':{'type':Sequelize[_0xe858('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe858('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xe858('0x10')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 4bd5df8..c4400a6 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 _0x21c0=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','name','send','index','map','CmCustomField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','then','include','findAll','rows','show','params','keys','includeAll','options','find','catch','body','create','sequelize','transaction','Sequelize','text','TEXT','INTEGER','switch','defaultValue','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x491082,_0x28f78b){var _0x5797d9=function(_0x20d0ba){while(--_0x20d0ba){_0x491082['push'](_0x491082['shift']());}};_0x5797d9(++_0x28f78b);}(_0x21c0,0x1a8));var _0x021c=function(_0x360ce8,_0x2be87b){_0x360ce8=_0x360ce8-0x0;var _0x5a6cd4=_0x21c0[_0x360ce8];return _0x5a6cd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x021c('0x0'));var zipdir=require(_0x021c('0x1'));var jsonpatch=require(_0x021c('0x2'));var rp=require(_0x021c('0x3'));var moment=require('moment');var BPromise=require(_0x021c('0x4'));var Mustache=require(_0x021c('0x5'));var util=require('util');var path=require(_0x021c('0x6'));var sox=require(_0x021c('0x7'));var csv=require(_0x021c('0x8'));var ejs=require(_0x021c('0x9'));var fs=require('fs');var fs_extra=require(_0x021c('0xa'));var _=require(_0x021c('0xb'));var squel=require(_0x021c('0xc'));var crypto=require('crypto');var jsforce=require(_0x021c('0xd'));var deskjs=require(_0x021c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x021c('0xf'));var Redis=require(_0x021c('0x10'));var authService=require(_0x021c('0x11'));var qs=require(_0x021c('0x12'));var as=require(_0x021c('0x13'));var hardwareService=require(_0x021c('0x14'));var logger=require(_0x021c('0x15'))('api');var utils=require(_0x021c('0x16'));var config=require(_0x021c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x021c('0x18'))['db'];function respondWithStatusCode(_0xf36938,_0x1b839c){_0x1b839c=_0x1b839c||0xcc;return function(_0x5f4e95){if(_0x5f4e95){return _0xf36938[_0x021c('0x19')](_0x1b839c);}return _0xf36938[_0x021c('0x1a')](_0x1b839c)[_0x021c('0x1b')]();};}function respondWithResult(_0x546640,_0x51189a){_0x51189a=_0x51189a||0xc8;return function(_0x538cde){if(_0x538cde){return _0x546640[_0x021c('0x1a')](_0x51189a)[_0x021c('0x1c')](_0x538cde);}};}function respondWithFilteredResult(_0x51eae3,_0x6fd198){return function(_0x34016d){if(_0x34016d){var _0x2b292f=typeof _0x6fd198[_0x021c('0x1d')]===_0x021c('0x1e')&&typeof _0x6fd198[_0x021c('0x1f')]==='undefined';var _0x3ec056=_0x34016d['count'];var _0x5880fe=_0x2b292f?0x0:_0x6fd198[_0x021c('0x1d')];var _0x307d5b=_0x2b292f?_0x34016d[_0x021c('0x20')]:_0x6fd198[_0x021c('0x1d')]+_0x6fd198['limit'];var _0x41e659;if(_0x307d5b>=_0x3ec056){_0x307d5b=_0x3ec056;_0x41e659=0xc8;}else{_0x41e659=0xce;}_0x51eae3['status'](_0x41e659);return _0x51eae3[_0x021c('0x21')](_0x021c('0x22'),_0x5880fe+'-'+_0x307d5b+'/'+_0x3ec056)[_0x021c('0x1c')](_0x34016d);}return null;};}function patchUpdates(_0x5ca29a){return function(_0x206149){try{jsonpatch[_0x021c('0x23')](_0x206149,_0x5ca29a,!![]);}catch(_0x293645){return BPromise[_0x021c('0x24')](_0x293645);}return _0x206149['save']();};}function saveUpdates(_0x35c2a3,_0xc60219){return function(_0x44f5f7){if(_0x44f5f7){return _0x44f5f7[_0x021c('0x25')](_0x35c2a3)['then'](function(_0x274b6d){return _0x274b6d;});}return null;};}function removeEntity(_0x3afe90,_0x218527){return function(_0xf25a86){if(_0xf25a86){return _0xf25a86[_0x021c('0x26')]()['then'](function(){_0x3afe90[_0x021c('0x1a')](0xcc)[_0x021c('0x1b')]();});}};}function handleEntityNotFound(_0x249567,_0x402f10){return function(_0xaf19dd){if(!_0xaf19dd){_0x249567[_0x021c('0x19')](0x194);}return _0xaf19dd;};}function handleError(_0xab7a87,_0x5031c5){_0x5031c5=_0x5031c5||0x1f4;return function(_0x4a2dbd){logger[_0x021c('0x27')](_0x4a2dbd['stack']);if(_0x4a2dbd[_0x021c('0x28')]){delete _0x4a2dbd[_0x021c('0x28')];}_0xab7a87[_0x021c('0x1a')](_0x5031c5)[_0x021c('0x29')](_0x4a2dbd);};}exports[_0x021c('0x2a')]=function(_0x5c39ad,_0x1487e1){var _0x20a3be={},_0x439430={},_0x53d36d={'count':0x0,'rows':[]};var _0x4f7187=_[_0x021c('0x2b')](db[_0x021c('0x2c')][_0x021c('0x2d')],function(_0x2679a1){return{'name':_0x2679a1[_0x021c('0x2e')],'type':_0x2679a1['type'][_0x021c('0x2f')]};});_0x439430[_0x021c('0x30')]=_['differenceBy'](_[_0x021c('0x2b')](_0x4f7187,'name'),['name']);_0x439430[_0x021c('0x31')]=_['keys'](_0x5c39ad[_0x021c('0x31')]);_0x439430[_0x021c('0x32')]=_[_0x021c('0x33')](_0x439430[_0x021c('0x30')],_0x439430[_0x021c('0x31')]);_0x20a3be[_0x021c('0x34')]=_[_0x021c('0x33')](_0x439430[_0x021c('0x30')],qs[_0x021c('0x35')](_0x5c39ad[_0x021c('0x31')][_0x021c('0x35')]));_0x20a3be[_0x021c('0x34')]=_0x20a3be[_0x021c('0x34')][_0x021c('0x36')]?_0x20a3be[_0x021c('0x34')]:_0x439430[_0x021c('0x30')];if(!_0x5c39ad[_0x021c('0x31')][_0x021c('0x37')](_0x021c('0x38'))){_0x20a3be[_0x021c('0x1f')]=qs['limit'](_0x5c39ad[_0x021c('0x31')][_0x021c('0x1f')]);_0x20a3be[_0x021c('0x1d')]=qs['offset'](_0x5c39ad['query'][_0x021c('0x1d')]);}_0x20a3be[_0x021c('0x39')]=qs['sort'](_0x5c39ad[_0x021c('0x31')][_0x021c('0x3a')]);_0x20a3be['where']=qs[_0x021c('0x32')](_[_0x021c('0x3b')](_0x5c39ad[_0x021c('0x31')],_0x439430['filters']),_0x4f7187);if(_0x5c39ad[_0x021c('0x31')][_0x021c('0x3c')]){_0x20a3be[_0x021c('0x3d')]=_[_0x021c('0x3e')](_0x20a3be[_0x021c('0x3d')],{'$or':_[_0x021c('0x2b')](_0x4f7187,function(_0x5f13f7){if(_0x5f13f7[_0x021c('0x3f')]!==_0x021c('0x40')){var _0xfdd77b={};_0xfdd77b[_0x5f13f7['name']]={'$like':'%'+_0x5c39ad[_0x021c('0x31')]['filter']+'%'};return _0xfdd77b;}})});}_0x20a3be=_[_0x021c('0x3e')]({},_0x20a3be,_0x5c39ad['options']);var _0x35cbf3={'where':_0x20a3be[_0x021c('0x3d')]};return db['CmCustomField']['count'](_0x35cbf3)[_0x021c('0x41')](function(_0x52e689){_0x53d36d[_0x021c('0x20')]=_0x52e689;if(_0x5c39ad[_0x021c('0x31')]['includeAll']){_0x20a3be[_0x021c('0x42')]=[{'all':!![]}];}return db[_0x021c('0x2c')][_0x021c('0x43')](_0x20a3be);})[_0x021c('0x41')](function(_0x290190){_0x53d36d[_0x021c('0x44')]=_0x290190;return _0x53d36d;})[_0x021c('0x41')](respondWithFilteredResult(_0x1487e1,_0x20a3be))['catch'](handleError(_0x1487e1,null));};exports[_0x021c('0x45')]=function(_0x4bde17,_0x172d9c){var _0x2c93de={'raw':!![],'where':{'id':_0x4bde17[_0x021c('0x46')]['id']}},_0x3ec243={};_0x3ec243['model']=_[_0x021c('0x47')](db['CmCustomField'][_0x021c('0x2d')]);_0x3ec243[_0x021c('0x31')]=_['keys'](_0x4bde17[_0x021c('0x31')]);_0x3ec243[_0x021c('0x32')]=_[_0x021c('0x33')](_0x3ec243['model'],_0x3ec243[_0x021c('0x31')]);_0x2c93de[_0x021c('0x34')]=_[_0x021c('0x33')](_0x3ec243[_0x021c('0x30')],qs[_0x021c('0x35')](_0x4bde17[_0x021c('0x31')]['fields']));_0x2c93de['attributes']=_0x2c93de[_0x021c('0x34')][_0x021c('0x36')]?_0x2c93de[_0x021c('0x34')]:_0x3ec243['model'];if(_0x4bde17[_0x021c('0x31')][_0x021c('0x48')]){_0x2c93de['include']=[{'all':!![]}];}_0x2c93de=_['merge']({},_0x2c93de,_0x4bde17[_0x021c('0x49')]);return db[_0x021c('0x2c')][_0x021c('0x4a')](_0x2c93de)[_0x021c('0x41')](handleEntityNotFound(_0x172d9c,null))[_0x021c('0x41')](respondWithResult(_0x172d9c,null))[_0x021c('0x4b')](handleError(_0x172d9c,null));};exports[_0x021c('0x25')]=function(_0x114b79,_0x22abb4){if(_0x114b79[_0x021c('0x4c')]['id']){delete _0x114b79[_0x021c('0x4c')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x114b79['params']['id']}})[_0x021c('0x41')](handleEntityNotFound(_0x22abb4,null))[_0x021c('0x41')](saveUpdates(_0x114b79[_0x021c('0x4c')],null))['then'](respondWithResult(_0x22abb4,null))[_0x021c('0x4b')](handleError(_0x22abb4,null));};exports[_0x021c('0x26')]=function(_0x24a001,_0x30e134){return db['CmCustomField'][_0x021c('0x4a')]({'where':{'id':_0x24a001['params']['id']}})[_0x021c('0x41')](handleEntityNotFound(_0x30e134,null))[_0x021c('0x41')](removeEntity(_0x30e134,null))['catch'](handleError(_0x30e134,null));};exports[_0x021c('0x4d')]=function(_0x57855c,_0x31b146){var _0x3c2a0c;return db[_0x021c('0x4e')][_0x021c('0x4f')](function(_0x339708){return db[_0x021c('0x2c')][_0x021c('0x4d')](_0x57855c[_0x021c('0x4c')],{'transaction':_0x339708})[_0x021c('0x41')](function(_0x411eaa){_0x3c2a0c=_0x411eaa;var _0x62cc0={'type':db[_0x021c('0x50')]['TEXT'],'transaction':_0x339708};switch(_0x57855c[_0x021c('0x4c')][_0x021c('0x3f')]){case _0x021c('0x51'):_0x62cc0['type']=db[_0x021c('0x50')][_0x021c('0x52')];break;case'number':_0x62cc0[_0x021c('0x3f')]=db[_0x021c('0x50')][_0x021c('0x53')];break;case _0x021c('0x54'):_0x62cc0['type']=db[_0x021c('0x50')]['BOOLEAN'];_0x62cc0[_0x021c('0x55')]=![];break;default:}return db[_0x021c('0x4e')]['queryInterface']['addColumn']('cm_contacts',util[_0x021c('0x56')](_0x021c('0x57'),_0x3c2a0c['id']),_0x62cc0);})[_0x021c('0x41')](function(){return _0x3c2a0c;});})[_0x021c('0x41')](respondWithResult(_0x31b146,0xc9))[_0x021c('0x4b')](handleError(_0x31b146,null));}; \ No newline at end of file +var _0x69d3=['save','then','error','stack','name','send','map','CmCustomField','type','key','model','differenceBy','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','rawAttributes','fields','find','update','body','params','destroy','catch','create','transaction','Sequelize','text','TEXT','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','end','status','json','offset','undefined','limit','count','Content-Range'];(function(_0x570a69,_0x3c0304){var _0x2912e6=function(_0x1fd55c){while(--_0x1fd55c){_0x570a69['push'](_0x570a69['shift']());}};_0x2912e6(++_0x3c0304);}(_0x69d3,0x12b));var _0x369d=function(_0x1c77c8,_0x5c109c){_0x1c77c8=_0x1c77c8-0x0;var _0x38de8a=_0x69d3[_0x1c77c8];return _0x38de8a;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x369d('0x1'));var jsonpatch=require(_0x369d('0x2'));var rp=require(_0x369d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x369d('0x4'));var util=require('util');var path=require(_0x369d('0x5'));var sox=require(_0x369d('0x6'));var csv=require(_0x369d('0x7'));var ejs=require(_0x369d('0x8'));var fs=require('fs');var fs_extra=require(_0x369d('0x9'));var _=require(_0x369d('0xa'));var squel=require(_0x369d('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x369d('0xc'));var toCsv=require(_0x369d('0x7'));var querystring=require(_0x369d('0xd'));var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x369d('0x11'));var logger=require(_0x369d('0x12'))(_0x369d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x369d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5260ae,_0x5c290a){_0x5c290a=_0x5c290a||0xcc;return function(_0x14c4a1){if(_0x14c4a1){return _0x5260ae['sendStatus'](_0x5c290a);}return _0x5260ae['status'](_0x5c290a)[_0x369d('0x15')]();};}function respondWithResult(_0x591589,_0x44bdcc){_0x44bdcc=_0x44bdcc||0xc8;return function(_0x48d4ea){if(_0x48d4ea){return _0x591589[_0x369d('0x16')](_0x44bdcc)[_0x369d('0x17')](_0x48d4ea);}};}function respondWithFilteredResult(_0xcb835d,_0x1abbfd){return function(_0x6a56c1){if(_0x6a56c1){var _0x4a928f=typeof _0x1abbfd[_0x369d('0x18')]===_0x369d('0x19')&&typeof _0x1abbfd[_0x369d('0x1a')]===_0x369d('0x19');var _0x25c427=_0x6a56c1[_0x369d('0x1b')];var _0x276a7f=_0x4a928f?0x0:_0x1abbfd[_0x369d('0x18')];var _0x1a82c4=_0x4a928f?_0x6a56c1[_0x369d('0x1b')]:_0x1abbfd[_0x369d('0x18')]+_0x1abbfd['limit'];var _0x389ae3;if(_0x1a82c4>=_0x25c427){_0x1a82c4=_0x25c427;_0x389ae3=0xc8;}else{_0x389ae3=0xce;}_0xcb835d[_0x369d('0x16')](_0x389ae3);return _0xcb835d['set'](_0x369d('0x1c'),_0x276a7f+'-'+_0x1a82c4+'/'+_0x25c427)[_0x369d('0x17')](_0x6a56c1);}return null;};}function patchUpdates(_0x19079c){return function(_0x55ec59){try{jsonpatch['apply'](_0x55ec59,_0x19079c,!![]);}catch(_0x4f4f29){return BPromise['reject'](_0x4f4f29);}return _0x55ec59[_0x369d('0x1d')]();};}function saveUpdates(_0x31cbad,_0x910d09){return function(_0x9b10eb){if(_0x9b10eb){return _0x9b10eb['update'](_0x31cbad)[_0x369d('0x1e')](function(_0x35e43d){return _0x35e43d;});}return null;};}function removeEntity(_0x3b783b,_0x4b806b){return function(_0x5832ed){if(_0x5832ed){return _0x5832ed['destroy']()[_0x369d('0x1e')](function(){_0x3b783b[_0x369d('0x16')](0xcc)[_0x369d('0x15')]();});}};}function handleEntityNotFound(_0x37c67e,_0x403850){return function(_0xd06ed0){if(!_0xd06ed0){_0x37c67e['sendStatus'](0x194);}return _0xd06ed0;};}function handleError(_0x36f313,_0xd3a421){_0xd3a421=_0xd3a421||0x1f4;return function(_0xacb18b){logger[_0x369d('0x1f')](_0xacb18b[_0x369d('0x20')]);if(_0xacb18b[_0x369d('0x21')]){delete _0xacb18b[_0x369d('0x21')];}_0x36f313[_0x369d('0x16')](_0xd3a421)[_0x369d('0x22')](_0xacb18b);};}exports['index']=function(_0x5c27fd,_0x26de15){var _0x3ecf13={},_0x1a82cf={},_0x58c16f={'count':0x0,'rows':[]};var _0x12a847=_[_0x369d('0x23')](db[_0x369d('0x24')]['rawAttributes'],function(_0x3f3c29){return{'name':_0x3f3c29['fieldName'],'type':_0x3f3c29[_0x369d('0x25')][_0x369d('0x26')]};});_0x1a82cf[_0x369d('0x27')]=_[_0x369d('0x28')](_['map'](_0x12a847,'name'),['name']);_0x1a82cf[_0x369d('0x29')]=_[_0x369d('0x2a')](_0x5c27fd[_0x369d('0x29')]);_0x1a82cf[_0x369d('0x2b')]=_['intersection'](_0x1a82cf[_0x369d('0x27')],_0x1a82cf[_0x369d('0x29')]);_0x3ecf13[_0x369d('0x2c')]=_[_0x369d('0x2d')](_0x1a82cf[_0x369d('0x27')],qs['fields'](_0x5c27fd[_0x369d('0x29')]['fields']));_0x3ecf13[_0x369d('0x2c')]=_0x3ecf13[_0x369d('0x2c')][_0x369d('0x2e')]?_0x3ecf13['attributes']:_0x1a82cf['model'];if(!_0x5c27fd[_0x369d('0x29')][_0x369d('0x2f')]('nolimit')){_0x3ecf13[_0x369d('0x1a')]=qs[_0x369d('0x1a')](_0x5c27fd[_0x369d('0x29')]['limit']);_0x3ecf13[_0x369d('0x18')]=qs['offset'](_0x5c27fd[_0x369d('0x29')][_0x369d('0x18')]);}_0x3ecf13[_0x369d('0x30')]=qs[_0x369d('0x31')](_0x5c27fd['query'][_0x369d('0x31')]);_0x3ecf13['where']=qs[_0x369d('0x2b')](_[_0x369d('0x32')](_0x5c27fd[_0x369d('0x29')],_0x1a82cf[_0x369d('0x2b')]),_0x12a847);if(_0x5c27fd[_0x369d('0x29')][_0x369d('0x33')]){_0x3ecf13[_0x369d('0x34')]=_[_0x369d('0x35')](_0x3ecf13[_0x369d('0x34')],{'$or':_[_0x369d('0x23')](_0x12a847,function(_0x5dd32c){if(_0x5dd32c[_0x369d('0x25')]!==_0x369d('0x36')){var _0x1832d3={};_0x1832d3[_0x5dd32c['name']]={'$like':'%'+_0x5c27fd['query']['filter']+'%'};return _0x1832d3;}})});}_0x3ecf13=_[_0x369d('0x35')]({},_0x3ecf13,_0x5c27fd[_0x369d('0x37')]);var _0x25c8c8={'where':_0x3ecf13[_0x369d('0x34')]};return db[_0x369d('0x24')][_0x369d('0x1b')](_0x25c8c8)['then'](function(_0x54eb98){_0x58c16f[_0x369d('0x1b')]=_0x54eb98;if(_0x5c27fd[_0x369d('0x29')][_0x369d('0x38')]){_0x3ecf13['include']=[{'all':!![]}];}return db[_0x369d('0x24')][_0x369d('0x39')](_0x3ecf13);})['then'](function(_0x2d9d97){_0x58c16f['rows']=_0x2d9d97;return _0x58c16f;})['then'](respondWithFilteredResult(_0x26de15,_0x3ecf13))['catch'](handleError(_0x26de15,null));};exports[_0x369d('0x3a')]=function(_0x20527b,_0x49ba66){var _0x133157={'raw':!![],'where':{'id':_0x20527b['params']['id']}},_0x4f9d0c={};_0x4f9d0c['model']=_['keys'](db['CmCustomField'][_0x369d('0x3b')]);_0x4f9d0c['query']=_[_0x369d('0x2a')](_0x20527b[_0x369d('0x29')]);_0x4f9d0c['filters']=_[_0x369d('0x2d')](_0x4f9d0c[_0x369d('0x27')],_0x4f9d0c[_0x369d('0x29')]);_0x133157[_0x369d('0x2c')]=_[_0x369d('0x2d')](_0x4f9d0c['model'],qs[_0x369d('0x3c')](_0x20527b[_0x369d('0x29')][_0x369d('0x3c')]));_0x133157[_0x369d('0x2c')]=_0x133157[_0x369d('0x2c')][_0x369d('0x2e')]?_0x133157[_0x369d('0x2c')]:_0x4f9d0c[_0x369d('0x27')];if(_0x20527b[_0x369d('0x29')][_0x369d('0x38')]){_0x133157['include']=[{'all':!![]}];}_0x133157=_['merge']({},_0x133157,_0x20527b['options']);return db[_0x369d('0x24')][_0x369d('0x3d')](_0x133157)[_0x369d('0x1e')](handleEntityNotFound(_0x49ba66,null))['then'](respondWithResult(_0x49ba66,null))['catch'](handleError(_0x49ba66,null));};exports[_0x369d('0x3e')]=function(_0x536dab,_0x5e7e2f){if(_0x536dab['body']['id']){delete _0x536dab[_0x369d('0x3f')]['id'];}return db[_0x369d('0x24')][_0x369d('0x3d')]({'where':{'id':_0x536dab[_0x369d('0x40')]['id']}})['then'](handleEntityNotFound(_0x5e7e2f,null))[_0x369d('0x1e')](saveUpdates(_0x536dab[_0x369d('0x3f')],null))[_0x369d('0x1e')](respondWithResult(_0x5e7e2f,null))['catch'](handleError(_0x5e7e2f,null));};exports[_0x369d('0x41')]=function(_0x47a3fd,_0x26cca5){return db[_0x369d('0x24')][_0x369d('0x3d')]({'where':{'id':_0x47a3fd[_0x369d('0x40')]['id']}})['then'](handleEntityNotFound(_0x26cca5,null))[_0x369d('0x1e')](removeEntity(_0x26cca5,null))[_0x369d('0x42')](handleError(_0x26cca5,null));};exports[_0x369d('0x43')]=function(_0x2a45a8,_0x3a0e4e){var _0x3029ed;return db['sequelize'][_0x369d('0x44')](function(_0x11751f){return db[_0x369d('0x24')]['create'](_0x2a45a8[_0x369d('0x3f')],{'transaction':_0x11751f})[_0x369d('0x1e')](function(_0x1a093a){_0x3029ed=_0x1a093a;var _0x5c131c={'type':db[_0x369d('0x45')]['TEXT'],'transaction':_0x11751f};switch(_0x2a45a8[_0x369d('0x3f')][_0x369d('0x25')]){case _0x369d('0x46'):_0x5c131c[_0x369d('0x25')]=db[_0x369d('0x45')][_0x369d('0x47')];break;case _0x369d('0x48'):_0x5c131c[_0x369d('0x25')]=db[_0x369d('0x45')][_0x369d('0x49')];break;case'switch':_0x5c131c[_0x369d('0x25')]=db[_0x369d('0x45')][_0x369d('0x4a')];_0x5c131c[_0x369d('0x4b')]=![];break;default:}return db[_0x369d('0x4c')][_0x369d('0x4d')][_0x369d('0x4e')](_0x369d('0x4f'),util[_0x369d('0x50')](_0x369d('0x51'),_0x3029ed['id']),_0x5c131c);})[_0x369d('0x1e')](function(){return _0x3029ed;});})[_0x369d('0x1e')](respondWithResult(_0x3a0e4e,0xc9))[_0x369d('0x42')](handleError(_0x3a0e4e,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index c2bfcc0..d365ec7 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 _0xa4f3=['moment','path','rimraf','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x4c3025,_0x556f28){var _0x31fb41=function(_0x585620){while(--_0x585620){_0x4c3025['push'](_0x4c3025['shift']());}};_0x31fb41(++_0x556f28);}(_0xa4f3,0xc4));var _0x3a4f=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xa4f3[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x3a4f('0x0'));var util=require(_0x3a4f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3a4f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a4f('0x3'));var rimraf=require(_0x3a4f('0x4'));var config=require('../../config/environment');var attributes=require(_0x3a4f('0x5'));module[_0x3a4f('0x6')]=function(_0x44f53a,_0x51c57c){return _0x44f53a['define'](_0x3a4f('0x7'),attributes,{'tableName':_0x3a4f('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52ae=['exports','define','CmCustomField','cm_custom_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','./cmCustomField.attributes'];(function(_0x56a2b9,_0x4211ea){var _0x411ce1=function(_0x17506e){while(--_0x17506e){_0x56a2b9['push'](_0x56a2b9['shift']());}};_0x411ce1(++_0x4211ea);}(_0x52ae,0x64));var _0xe52a=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x52ae[_0x2a67fe];return _0x57e726;};'use strict';var _=require('lodash');var util=require(_0xe52a('0x0'));var logger=require(_0xe52a('0x1'))(_0xe52a('0x2'));var moment=require(_0xe52a('0x3'));var BPromise=require(_0xe52a('0x4'));var rp=require(_0xe52a('0x5'));var fs=require('fs');var path=require(_0xe52a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe52a('0x7'));module[_0xe52a('0x8')]=function(_0x12899d,_0x42dd25){return _0x12899d[_0xe52a('0x9')](_0xe52a('0xa'),attributes,{'tableName':_0xe52a('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 3dc8c0d..86edc26 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 _0x0570=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result'];(function(_0x56ebd0,_0x41689d){var _0x147469=function(_0x26162c){while(--_0x26162c){_0x56ebd0['push'](_0x56ebd0['shift']());}};_0x147469(++_0x41689d);}(_0x0570,0x115));var _0x0057=function(_0xa4dbe9,_0x514594){_0xa4dbe9=_0xa4dbe9-0x0;var _0x340919=_0x0570[_0xa4dbe9];return _0x340919;};'use strict';var _=require(_0x0057('0x0'));var util=require(_0x0057('0x1'));var moment=require(_0x0057('0x2'));var BPromise=require('bluebird');var rs=require(_0x0057('0x3'));var fs=require('fs');var Redis=require(_0x0057('0x4'));var db=require(_0x0057('0x5'))['db'];var utils=require(_0x0057('0x6'));var logger=require('../../config/logger')(_0x0057('0x7'));var config=require('../../config/environment');var jayson=require(_0x0057('0x8'));var client=jayson[_0x0057('0x9')][_0x0057('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45da9d,_0x254fb2,_0x32929d){return new BPromise(function(_0x540350,_0x30beb4){return client[_0x0057('0xb')](_0x45da9d,_0x32929d)['then'](function(_0x327450){logger[_0x0057('0xc')]('CmCustomField,\x20%s,\x20%s',_0x254fb2,_0x0057('0xd'));logger[_0x0057('0xe')](_0x0057('0xf'),_0x254fb2,_0x0057('0xd'),JSON[_0x0057('0x10')](_0x327450));if(_0x327450[_0x0057('0x11')]){if(_0x327450['error'][_0x0057('0x12')]===0x1f4){logger['error'](_0x0057('0x13'),_0x254fb2,_0x327450[_0x0057('0x11')]['message']);return _0x30beb4(_0x327450[_0x0057('0x11')]['message']);}logger['error'](_0x0057('0x13'),_0x254fb2,_0x327450[_0x0057('0x11')][_0x0057('0x14')]);return _0x540350(_0x327450[_0x0057('0x11')]['message']);}else{logger[_0x0057('0xc')](_0x0057('0x13'),_0x254fb2,_0x0057('0xd'));_0x540350(_0x327450[_0x0057('0x15')][_0x0057('0x14')]);}})[_0x0057('0x16')](function(_0x1c791c){logger[_0x0057('0x11')]('CmCustomField,\x20%s,\x20%s',_0x254fb2,_0x1c791c);_0x30beb4(_0x1c791c);});});} \ No newline at end of file +var _0xaeec=['debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','CmCustomField,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x104cc1,_0x482c5a){var _0x2862ad=function(_0x186c8b){while(--_0x186c8b){_0x104cc1['push'](_0x104cc1['shift']());}};_0x2862ad(++_0x482c5a);}(_0xaeec,0x137));var _0xcaee=function(_0x499e62,_0x1dd8ea){_0x499e62=_0x499e62-0x0;var _0x173645=_0xaeec[_0x499e62];return _0x173645;};'use strict';var _=require('lodash');var util=require(_0xcaee('0x0'));var moment=require(_0xcaee('0x1'));var BPromise=require(_0xcaee('0x2'));var rs=require(_0xcaee('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcaee('0x4'));var logger=require(_0xcaee('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcaee('0x6'));var client=jayson[_0xcaee('0x7')][_0xcaee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x284e7c,_0x1949b1,_0xcdeee0){return new BPromise(function(_0x410b40,_0x174be6){return client[_0xcaee('0x9')](_0x284e7c,_0xcdeee0)['then'](function(_0x34b507){logger[_0xcaee('0xa')]('CmCustomField,\x20%s,\x20%s',_0x1949b1,_0xcaee('0xb'));logger[_0xcaee('0xc')](_0xcaee('0xd'),_0x1949b1,_0xcaee('0xb'),JSON[_0xcaee('0xe')](_0x34b507));if(_0x34b507[_0xcaee('0xf')]){if(_0x34b507[_0xcaee('0xf')]['code']===0x1f4){logger[_0xcaee('0xf')](_0xcaee('0x10'),_0x1949b1,_0x34b507[_0xcaee('0xf')][_0xcaee('0x11')]);return _0x174be6(_0x34b507[_0xcaee('0xf')]['message']);}logger['error'](_0xcaee('0x10'),_0x1949b1,_0x34b507[_0xcaee('0xf')][_0xcaee('0x11')]);return _0x410b40(_0x34b507['error'][_0xcaee('0x11')]);}else{logger[_0xcaee('0xa')](_0xcaee('0x10'),_0x1949b1,_0xcaee('0xb'));_0x410b40(_0x34b507[_0xcaee('0x12')]['message']);}})['catch'](function(_0x38c986){logger[_0xcaee('0xf')]('CmCustomField,\x20%s,\x20%s',_0x1949b1,_0x38c986);_0x174be6(_0x38c986);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index ba86328..d118705 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 _0xaf1b=['isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get'];(function(_0x5e8398,_0x1b4120){var _0x192dc6=function(_0x346f6d){while(--_0x346f6d){_0x5e8398['push'](_0x5e8398['shift']());}};_0x192dc6(++_0x1b4120);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x17fe67,_0x4b169c){_0x17fe67=_0x17fe67-0x0;var _0x4aab6a=_0xaf1b[_0x17fe67];return _0x4aab6a;};'use strict';var multer=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var path=require(_0xbaf1('0x2'));var timeout=require(_0xbaf1('0x3'));var express=require(_0xbaf1('0x4'));var router=express[_0xbaf1('0x5')]();var fs_extra=require(_0xbaf1('0x6'));var auth=require(_0xbaf1('0x7'));var interaction=require(_0xbaf1('0x8'));var config=require(_0xbaf1('0x9'));var controller=require(_0xbaf1('0xa'));router[_0xbaf1('0xb')]('/',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0xd')]);router['get'](_0xbaf1('0xe'),auth['isAuthenticated'](),controller[_0xbaf1('0xf')]);router['post']('/',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x10')]);router[_0xbaf1('0x11')]('/:id',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x12')]);router['delete'](_0xbaf1('0xe'),auth['isAuthenticated'](),controller[_0xbaf1('0x13')]);module[_0xbaf1('0x14')]=router; \ No newline at end of file +var _0xdc03=['../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','create','put','/:id','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x329d13,_0x1aff27){var _0x33efd9=function(_0x265b7d){while(--_0x265b7d){_0x329d13['push'](_0x329d13['shift']());}};_0x33efd9(++_0x1aff27);}(_0xdc03,0x65));var _0x3dc0=function(_0x43e1c8,_0x5a72dc){_0x43e1c8=_0x43e1c8-0x0;var _0x2bdff3=_0xdc03[_0x43e1c8];return _0x2bdff3;};'use strict';var multer=require(_0x3dc0('0x0'));var util=require('util');var path=require(_0x3dc0('0x1'));var timeout=require(_0x3dc0('0x2'));var express=require('express');var router=express[_0x3dc0('0x3')]();var fs_extra=require(_0x3dc0('0x4'));var auth=require(_0x3dc0('0x5'));var interaction=require(_0x3dc0('0x6'));var config=require(_0x3dc0('0x7'));var controller=require(_0x3dc0('0x8'));router['get']('/',auth[_0x3dc0('0x9')](),controller[_0x3dc0('0xa')]);router[_0x3dc0('0xb')]('/:id',auth[_0x3dc0('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3dc0('0xc')]);router[_0x3dc0('0xd')](_0x3dc0('0xe'),auth[_0x3dc0('0x9')](),controller[_0x3dc0('0xf')]);router[_0x3dc0('0x10')](_0x3dc0('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3dc0('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 099d235..6163b20 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 _0xa343=['contactListQueue','moment','sequelize','STRING','DATE','format','INTEGER','BOOLEAN'];(function(_0x551b1c,_0x3584f9){var _0x131273=function(_0x553185){while(--_0x553185){_0x551b1c['push'](_0x551b1c['shift']());}};_0x131273(++_0x3584f9);}(_0xa343,0x79));var _0x3a34=function(_0x39753c,_0x2824ad){_0x39753c=_0x39753c-0x0;var _0x194f8d=_0xa343[_0x39753c];return _0x194f8d;};'use strict';var moment=require(_0x3a34('0x0'));var Sequelize=require(_0x3a34('0x1'));module['exports']={'phone':{'type':Sequelize[_0x3a34('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3a34('0x3')],'defaultValue':moment()[_0x3a34('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x3a34('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3a34('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3a34('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3a34('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3a34('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3a34('0x3')]},'priority':{'type':Sequelize[_0x3a34('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3a34('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x3a34('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x3a34('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x3a34('0x5')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x3a34('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3a34('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3a34('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3a34('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x3a34('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3a34('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x3a34('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x0ff3=['exports','STRING','BOOLEAN','DATE','INTEGER','UNSIGNED','contactListQueue','moment','sequelize'];(function(_0x41d2a4,_0x16accb){var _0x4a0708=function(_0x5add14){while(--_0x5add14){_0x41d2a4['push'](_0x41d2a4['shift']());}};_0x4a0708(++_0x16accb);}(_0x0ff3,0x7c));var _0x30ff=function(_0x3d3e50,_0x67882c){_0x3d3e50=_0x3d3e50-0x0;var _0x4273cb=_0x0ff3[_0x3d3e50];return _0x4273cb;};'use strict';var moment=require(_0x30ff('0x0'));var Sequelize=require(_0x30ff('0x1'));module[_0x30ff('0x2')]={'phone':{'type':Sequelize[_0x30ff('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x30ff('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x30ff('0x5')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x30ff('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x30ff('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x30ff('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x30ff('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x30ff('0x5')]},'priority':{'type':Sequelize[_0x30ff('0x6')](0x2)[_0x30ff('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x30ff('0x8')},'ListId':{'type':Sequelize[_0x30ff('0x6')],'unique':_0x30ff('0x8')},'UserId':{'type':Sequelize[_0x30ff('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x30ff('0x8')},'CampaignId':{'type':Sequelize[_0x30ff('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x30ff('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x30ff('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x30ff('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x30ff('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x30ff('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x30ff('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x30ff('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index fd877ea..9714ceb 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 _0xa990=['describe','destroy','find','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','statedesc','deleted','campaign','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','format','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','dialOrderByScheduledAt','findOne','scheduledat','recallme','LOCK','UPDATE','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','transaction','CmList','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','set','update','then','sendStatus','error','stack','name','index','map','CmHopper','rawAttributes','type','model','keys','query','filters','intersection','concat','$gt','$gte','$lt','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$any','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','rows','catch','show','include','create','body','params'];(function(_0xc39e82,_0x43e999){var _0x35e900=function(_0x5e6e94){while(--_0x5e6e94){_0xc39e82['push'](_0xc39e82['shift']());}};_0x35e900(++_0x43e999);}(_0xa990,0xc9));var _0x0a99=function(_0x474b1c,_0x26b7ee){_0x474b1c=_0x474b1c-0x0;var _0x31618a=_0xa990[_0x474b1c];return _0x31618a;};'use strict';var moment=require(_0x0a99('0x0'));var _=require(_0x0a99('0x1'));var qs=require(_0x0a99('0x2'));var logger=require(_0x0a99('0x3'))(_0x0a99('0x4'));var shared=require(_0x0a99('0x5'));var db=require(_0x0a99('0x6'))['db'];function respondWithResult(_0x394f1c,_0x4d4992){_0x4d4992=_0x4d4992||0xc8;return function(_0x4d1781){if(_0x4d1781){return _0x394f1c[_0x0a99('0x7')](_0x4d4992)[_0x0a99('0x8')](_0x4d1781);}};}function respondWithFilteredResult(_0xfdb594,_0x320560){return function(_0x45b195){if(_0x45b195){var _0x398d95=typeof _0x320560[_0x0a99('0x9')]===_0x0a99('0xa')&&typeof _0x320560[_0x0a99('0xb')]===_0x0a99('0xa');var _0x1eaa2a=_0x45b195['count'];var _0x813e91=_0x398d95?0x0:_0x320560[_0x0a99('0x9')];var _0x5b5ec3=_0x398d95?_0x45b195['count']:_0x320560[_0x0a99('0x9')]+_0x320560[_0x0a99('0xb')];var _0x1eb2bd;if(_0x5b5ec3>=_0x1eaa2a){_0x5b5ec3=_0x1eaa2a;_0x1eb2bd=0xc8;}else{_0x1eb2bd=0xce;}_0xfdb594[_0x0a99('0x7')](_0x1eb2bd);return _0xfdb594[_0x0a99('0xc')]('Content-Range',_0x813e91+'-'+_0x5b5ec3+'/'+_0x1eaa2a)[_0x0a99('0x8')](_0x45b195);}return null;};}function saveUpdates(_0x3aaaad,_0x57ab88){return function(_0xb6a34d){if(_0xb6a34d){return _0xb6a34d[_0x0a99('0xd')](_0x3aaaad)[_0x0a99('0xe')](function(_0x2bbf1a){return _0x2bbf1a;});}return null;};}function handleEntityNotFound(_0x346061,_0x23d018){return function(_0x18c124){if(!_0x18c124){_0x346061[_0x0a99('0xf')](0x194);}return _0x18c124;};}function handleError(_0x4b6946,_0x5a17e1){_0x5a17e1=_0x5a17e1||0x1f4;return function(_0x2c40db){logger[_0x0a99('0x10')](_0x2c40db[_0x0a99('0x11')]);if(_0x2c40db['name']){delete _0x2c40db[_0x0a99('0x12')];}_0x4b6946['status'](_0x5a17e1)['send'](_0x2c40db);};}exports[_0x0a99('0x13')]=function(_0x3bab16,_0x3de006){var _0x544c2={},_0x572ce5={},_0x564ae9={'count':0x0,'rows':[]};var _0x27a14f=_[_0x0a99('0x14')](db[_0x0a99('0x15')][_0x0a99('0x16')],function(_0x5e6c7e){return{'name':_0x5e6c7e['fieldName'],'type':_0x5e6c7e[_0x0a99('0x17')]['key']};});_0x572ce5[_0x0a99('0x18')]=_['map'](_0x27a14f,_0x0a99('0x12'));_0x572ce5['query']=_[_0x0a99('0x19')](_0x3bab16[_0x0a99('0x1a')]);_0x572ce5[_0x0a99('0x1b')]=_[_0x0a99('0x1c')](_0x572ce5[_0x0a99('0x18')],_0x572ce5[_0x0a99('0x1a')]);_0x572ce5[_0x0a99('0x1b')]=_[_0x0a99('0x1d')](_0x572ce5[_0x0a99('0x1b')],['$and','$or',_0x0a99('0x1e'),_0x0a99('0x1f'),_0x0a99('0x20'),'$lte','$ne',_0x0a99('0x21'),_0x0a99('0x22'),_0x0a99('0x23'),_0x0a99('0x24'),_0x0a99('0x25'),_0x0a99('0x26'),_0x0a99('0x27'),_0x0a99('0x28'),_0x0a99('0x29'),'$notILike',_0x0a99('0x27'),'$overlap','$contains','$contained',_0x0a99('0x2a')]);_0x544c2[_0x0a99('0x2b')]=_[_0x0a99('0x1c')](_0x572ce5[_0x0a99('0x18')],qs[_0x0a99('0x2c')](_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x2c')]));_0x544c2['attributes']=_0x544c2[_0x0a99('0x2b')][_0x0a99('0x2d')]?_0x544c2[_0x0a99('0x2b')]:_0x572ce5[_0x0a99('0x18')];if(!_0x3bab16['query']['hasOwnProperty']('nolimit')){_0x544c2[_0x0a99('0xb')]=qs[_0x0a99('0xb')](_0x3bab16[_0x0a99('0x1a')]['limit']);_0x544c2[_0x0a99('0x9')]=qs[_0x0a99('0x9')](_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x9')]);}_0x544c2[_0x0a99('0x2e')]=qs[_0x0a99('0x2f')](_0x3bab16[_0x0a99('0x1a')]['sort']);_0x544c2[_0x0a99('0x30')]=qs[_0x0a99('0x1b')](_[_0x0a99('0x31')](_0x3bab16[_0x0a99('0x1a')],_0x572ce5[_0x0a99('0x1b')]),_0x27a14f);if(_0x3bab16['query'][_0x0a99('0x32')]){_0x544c2['where']=_['merge'](_0x544c2['where'],{'$or':_['map'](_0x27a14f,function(_0x155a14){if(_0x155a14['type']!==_0x0a99('0x33')){var _0x3d5e0f={};_0x3d5e0f[_0x155a14[_0x0a99('0x12')]]={'$like':'%'+_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x32')]+'%'};return _0x3d5e0f;}})});}_0x544c2=_[_0x0a99('0x34')]({},_0x544c2,_0x3bab16[_0x0a99('0x35')]);var _0x3bc3fc={'where':_0x544c2[_0x0a99('0x30')]};return db[_0x0a99('0x15')][_0x0a99('0x36')](_0x3bc3fc)[_0x0a99('0xe')](function(_0x472850){_0x564ae9['count']=_0x472850;if(_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x37')]){_0x544c2['include']=[{'all':!![]}];}return db[_0x0a99('0x15')]['findAll'](_0x544c2);})[_0x0a99('0xe')](function(_0x563fbc){_0x564ae9[_0x0a99('0x38')]=_0x563fbc;return _0x564ae9;})[_0x0a99('0xe')](respondWithFilteredResult(_0x3de006,_0x544c2))[_0x0a99('0x39')](handleError(_0x3de006,null));};exports[_0x0a99('0x3a')]=function(_0x4a5c58,_0x19774f){var _0x11e046={'raw':!![],'where':{'id':_0x4a5c58['params']['id']}},_0x3b7efc={};_0x3b7efc[_0x0a99('0x18')]=_[_0x0a99('0x19')](db[_0x0a99('0x15')][_0x0a99('0x16')]);_0x3b7efc['query']=_[_0x0a99('0x19')](_0x4a5c58['query']);_0x3b7efc['filters']=_[_0x0a99('0x1c')](_0x3b7efc['model'],_0x3b7efc[_0x0a99('0x1a')]);_0x11e046['attributes']=_[_0x0a99('0x1c')](_0x3b7efc[_0x0a99('0x18')],qs[_0x0a99('0x2c')](_0x4a5c58[_0x0a99('0x1a')]['fields']));_0x11e046[_0x0a99('0x2b')]=_0x11e046[_0x0a99('0x2b')][_0x0a99('0x2d')]?_0x11e046[_0x0a99('0x2b')]:_0x3b7efc['model'];if(_0x4a5c58['query']['includeAll']){_0x11e046[_0x0a99('0x3b')]=[{'all':!![]}];}_0x11e046=_['merge']({},_0x11e046,_0x4a5c58[_0x0a99('0x35')]);return db['CmHopper']['find'](_0x11e046)['then'](handleEntityNotFound(_0x19774f,null))['then'](respondWithResult(_0x19774f,null))[_0x0a99('0x39')](handleError(_0x19774f,null));};exports['create']=function(_0x3e6213,_0x78cd0c){return db['CmHopper'][_0x0a99('0x3c')](_0x3e6213[_0x0a99('0x3d')],{})['then'](respondWithResult(_0x78cd0c,0xc9))[_0x0a99('0x39')](handleError(_0x78cd0c,null));};exports['update']=function(_0x3107bc,_0x278454){if(_0x3107bc['body']['id']){delete _0x3107bc[_0x0a99('0x3d')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x3107bc[_0x0a99('0x3e')]['id']}})[_0x0a99('0xe')](handleEntityNotFound(_0x278454,null))[_0x0a99('0xe')](saveUpdates(_0x3107bc[_0x0a99('0x3d')],null))[_0x0a99('0xe')](respondWithResult(_0x278454,null))['catch'](handleError(_0x278454,null));};exports[_0x0a99('0x3f')]=function(_0x174298,_0x4525d1){return db[_0x0a99('0x15')][_0x0a99('0x3f')]()[_0x0a99('0xe')](respondWithResult(_0x4525d1,null))[_0x0a99('0x39')](handleError(_0x4525d1,null));};exports[_0x0a99('0x40')]=function(_0x1cd328,_0x1621d9){var _0x52c754;var _0x50e04f=_0x1cd328[_0x0a99('0x3e')]['id'];return db[_0x0a99('0x15')][_0x0a99('0x41')]({'where':{'id':_0x1cd328[_0x0a99('0x3e')]['id']}})[_0x0a99('0xe')](handleEntityNotFound(_0x1621d9,null))[_0x0a99('0xe')](function(_0x5cda7d){if(_0x5cda7d){return _0x5cda7d[_0x0a99('0x40')]()[_0x0a99('0xe')](function(_0x55fee0){return _0x55fee0;});}})[_0x0a99('0xe')](function(_0x474e8b){_0x52c754=_0x474e8b;if(_0x474e8b){if(_0x474e8b['VoiceQueueId']||_0x474e8b[_0x0a99('0x42')]){return db[_0x474e8b[_0x0a99('0x43')]?_0x0a99('0x44'):_0x0a99('0x45')][_0x0a99('0x41')]({'where':{'id':_0x474e8b[_0x0a99('0x43')]?_0x474e8b[_0x0a99('0x43')]:_0x474e8b['CampaignId']},'attributes':['id',_0x0a99('0x12')],'raw':!![]});}}})[_0x0a99('0xe')](function(_0x1e9e9d){var _0x5a6762={};if(_0x1e9e9d){_[_0x0a99('0x34')](_0x5a6762,_[_0x0a99('0x46')](_0x52c754[_0x0a99('0x47')],['createdAt',_0x0a99('0x48'),'id']));_0x5a6762[_0x0a99('0x49')]=0x15;_0x5a6762[_0x0a99('0x4a')]=_0x0a99('0x4b');_0x5a6762[_0x0a99('0x4c')]=_0x1e9e9d[_0x0a99('0x12')];_0x5a6762['membername']=_0x1cd328[_0x0a99('0x4d')]['name'];_0x5a6762[_0x0a99('0x4e')]=_0x1cd328[_0x0a99('0x4d')]['id'];_0x5a6762[_0x0a99('0x4b')]=!![];_0x5a6762[_0x0a99('0x4f')]=moment()['format'](_0x0a99('0x50'));_0x5a6762['calleridnum']=_0x52c754[_0x0a99('0x51')];_0x5a6762[_0x0a99('0x52')]=_0x52c754[_0x0a99('0x43')]?_0x0a99('0x53'):_0x0a99('0x54');return db[_0x0a99('0x55')][_0x0a99('0x41')]({'where':{'id':_0x5a6762[_0x0a99('0x56')]},'attributes':[_0x0a99('0x57'),_0x0a99('0x58')]})[_0x0a99('0xe')](function(_0x3f2e09){if(!_[_0x0a99('0x59')](_0x1621d9)&&!_['isNil'](_0x3f2e09[_0x0a99('0x57')])){_0x5a6762[_0x0a99('0x5a')]=_0x3f2e09[_0x0a99('0x57')];if(!_['isNil'](_0x3f2e09[_0x0a99('0x58')])){_0x5a6762[_0x0a99('0x5a')]+='\x20'+_0x3f2e09[_0x0a99('0x58')];}}})['finally'](function(){return db[_0x0a99('0x5b')][_0x0a99('0x3c')](_0x5a6762);});}})[_0x0a99('0xe')](function(_0x144032){return db['CmHopperAdditionalPhone'][_0x0a99('0x40')]({'where':{'CmHopperId':_0x50e04f}});})[_0x0a99('0xe')](function(){return _0x1621d9[_0x0a99('0x7')](0xcc)['end']();})['catch'](handleError(_0x1621d9,null));};exports[_0x0a99('0x5c')]=function(_0x528a5d,_0x53b1f4){var _0x5406a7=[];return db[_0x0a99('0x55')]['describe']()[_0x0a99('0xe')](function(_0x436942){_0x5406a7=_[_0x0a99('0x19')](_0x436942);return _0x528a5d[_0x0a99('0x4d')][_0x0a99('0x5d')]({'where':{'type':_0x0a99('0x5e'),'dialActive':!![],'dialMethod':_0x0a99('0x5f')},'attributes':['id','dialOrderByScheduledAt',_0x0a99('0x60')],'raw':!![]});})[_0x0a99('0xe')](function(_0x2d3b63){if(_0x2d3b63&&_0x2d3b63['length']){return db[_0x0a99('0x61')]['transaction'](function(_0x2109db){var _0x51d18a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a99('0x62')](_0x0a99('0x50'))},'VoiceQueueId':{'$in':_['map'](_0x2d3b63,'id')},'$or':[{'UserId':null},{'UserId':_0x528a5d[_0x0a99('0x4d')]['id']}]};var _0x4ce300={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2d3b63)[_0x0a99('0x32')]([_0x0a99('0x60'),0x0])[_0x0a99('0x14')]('id')[_0x0a99('0x63')]()},'$or':[{'UserId':null},{'UserId':_0x528a5d[_0x0a99('0x4d')]['id']}]};var _0x9b52c7={'$or':[_0x51d18a,_0x4ce300]};var _0x44aa5d=[];if(_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x64')]&&_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x64')]===_0x0a99('0x65')){if(!_[_0x0a99('0x66')](_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x67')])){_0x9b52c7['id']={'$in':_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x67')]};}_0x44aa5d=[[_0x0a99('0x68'),'ASC'],['scheduledAt',_0x2d3b63[0x0]['dialOrderByScheduledAt']===_0x0a99('0x69')?_0x0a99('0x6a'):_0x0a99('0x69')],db['sequelize'][_0x0a99('0x6b')](_0x0a99('0x6c')),['id',_0x0a99('0x6a')]];}else{if(!_[_0x0a99('0x66')](_0x528a5d['body'][_0x0a99('0x67')])){_0x9b52c7['id']={'$notIn':_0x528a5d[_0x0a99('0x3d')]['hopperIds']};}_0x44aa5d=[['priority',_0x0a99('0x6a')],[_0x0a99('0x6d'),_0x2d3b63[0x0][_0x0a99('0x6e')]],db[_0x0a99('0x61')][_0x0a99('0x6b')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x0a99('0x15')][_0x0a99('0x6f')]({'attributes':['id',_0x0a99('0x70'),_0x0a99('0x51'),_0x0a99('0x71')],'where':_0x9b52c7,'order':_0x44aa5d,'transaction':_0x2109db,'lock':_0x2109db[_0x0a99('0x72')][_0x0a99('0x73')],'include':[{'model':db[_0x0a99('0x55')],'as':'Contact','attributes':_0x5406a7,'include':[{'model':db[_0x0a99('0x74')],'as':_0x0a99('0x75'),'attributes':['id',_0x0a99('0x12')]}]},{'model':db['CmList'],'as':_0x0a99('0x76'),'attributes':['id','name']},{'model':db[_0x0a99('0x44')],'as':_0x0a99('0x77'),'attributes':['id',_0x0a99('0x12'),_0x0a99('0x78')]}]})['then'](function(_0x3435e3){if(_0x3435e3){return _0x3435e3[_0x0a99('0xd')]({'UserId':_0x528a5d[_0x0a99('0x4d')]['id']},{'transaction':_0x2109db});}});});}})[_0x0a99('0xe')](handleEntityNotFound(_0x53b1f4,null))[_0x0a99('0xe')](respondWithResult(_0x53b1f4,null))[_0x0a99('0x39')](handleError(_0x53b1f4,null));};exports[_0x0a99('0x79')]=function(_0x4c6a12,_0x656dd,_0x31950f){var _0x436163=[];var _0x2bae3d=_0x4c6a12['params']['id'];var _0x1a40e9=_0x4c6a12['user']['id'];return db['CmContact'][_0x0a99('0x3f')]()[_0x0a99('0xe')](function(_0x3bed6e){_0x436163=_[_0x0a99('0x19')](_0x3bed6e);return db[_0x0a99('0x61')][_0x0a99('0x7a')](function(_0x24a389){const _0x353660={'id':_0x2bae3d};return db['CmHopper'][_0x0a99('0x6f')]({'attributes':['id','scheduledat','recallme'],'where':_0x353660,'transaction':_0x24a389,'lock':_0x24a389['LOCK'][_0x0a99('0x73')],'include':[{'model':db[_0x0a99('0x55')],'as':'Contact','attributes':_0x436163,'include':[{'model':db['CmCompany'],'as':_0x0a99('0x75'),'attributes':['id',_0x0a99('0x12')]}]},{'model':db[_0x0a99('0x7b')],'as':_0x0a99('0x76'),'attributes':['id',_0x0a99('0x12')]},{'model':db[_0x0a99('0x44')],'as':_0x0a99('0x77'),'attributes':['id',_0x0a99('0x12'),_0x0a99('0x78')]}]})['then'](function(_0x51627a){if(_0x51627a){return _0x51627a[_0x0a99('0xd')]({'UserId':_0x1a40e9},{'transaction':_0x24a389});}});});})[_0x0a99('0xe')](handleEntityNotFound(_0x656dd,null))[_0x0a99('0xe')](respondWithResult(_0x656dd,null))[_0x0a99('0x39')](handleError(_0x656dd,null));};exports[_0x0a99('0x7c')]=function(_0x22b737,_0x3a6773){return _0x22b737['user']['getVoiceQueues']({'where':{'type':_0x0a99('0x5e'),'dialActive':!![],'dialMethod':_0x0a99('0x5f')},'attributes':['id'],'raw':!![]})['then'](function(_0x587442){if(_0x587442&&_0x587442[_0x0a99('0x2d')]){return db['CmHopper'][_0x0a99('0x36')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a99('0x62')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x587442,'id')},'$or':[{'UserId':null},{'UserId':_0x22b737[_0x0a99('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x17436d){if(!_['isNil'](_0x17436d)&&_[_0x0a99('0x7d')](_0x17436d)){return _0x3a6773[_0x0a99('0x7')](0xc8)[_0x0a99('0x8')]({'contacts':_0x17436d});}else{logger[_0x0a99('0x10')](_0x0a99('0x7e'),_0x0a99('0x7c'),0x194,_0x0a99('0x7f'));_0x3a6773[_0x0a99('0xf')](0x194);}})[_0x0a99('0x39')](handleError(_0x3a6773,null));};exports[_0x0a99('0x80')]=function(_0x2d3efa,_0xe18018){var _0x51df2a=shared[_0x0a99('0x81')];var _0x2f4d34=[];_[_0x0a99('0x14')](_0x51df2a,function(_0x25c31b){_0x2f4d34[_0x0a99('0x82')]({'id':_0x25c31b[_0x0a99('0x12')],'name':_0x25c31b[_0x0a99('0x12')],'utcOffset':_0x25c31b[_0x0a99('0x83')]});});return _0xe18018[_0x0a99('0x7')](0xc8)[_0x0a99('0x8')]({'tz':_0x2f4d34});};exports['getTimezone']=function(_0x5607f1,_0x505a2c){var _0x59228e=shared[_0x0a99('0x81')];var _0x38932f={};if(!_[_0x0a99('0x59')](_0x59228e[_0x5607f1[_0x0a99('0x3d')]['id']]))_0x38932f=_0x59228e[_0x5607f1[_0x0a99('0x3d')]['id']];return _0x505a2c[_0x0a99('0x7')](0xc8)[_0x0a99('0x8')](_0x38932f);}; \ No newline at end of file +var _0xcb81=['hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','rows','rawAttributes','find','catch','create','body','params','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','omit','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','outbound','preview','dialOrderByScheduledAt','sequelize','dialPreviewAutoRecallMe','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','findOne','scheduledat','phone','recallme','LOCK','Company','CmList','Queue','dialActive','getPreviewRecall','transaction','UPDATE','Contact','CmCompany','List','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','utcOffset','moment','lodash','../../config/logger','status','json','offset','undefined','limit','count','set','update','sendStatus','stack','name','send','index','map','CmHopper','fieldName','type','key','query','keys','filters','concat','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','attributes','intersection','model','fields','length'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0xcb81,0x154));var _0x1cb8=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0xcb81[_0x2ddfd9];return _0x2668f0;};'use strict';var moment=require(_0x1cb8('0x0'));var _=require(_0x1cb8('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x1cb8('0x2'))('api');var shared=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithResult(_0x38c3ea,_0x33a8f2){_0x33a8f2=_0x33a8f2||0xc8;return function(_0x237e94){if(_0x237e94){return _0x38c3ea[_0x1cb8('0x3')](_0x33a8f2)[_0x1cb8('0x4')](_0x237e94);}};}function respondWithFilteredResult(_0x4e5c19,_0x98d682){return function(_0x2ac2d6){if(_0x2ac2d6){var _0x584b16=typeof _0x98d682[_0x1cb8('0x5')]===_0x1cb8('0x6')&&typeof _0x98d682[_0x1cb8('0x7')]==='undefined';var _0x1ff267=_0x2ac2d6['count'];var _0x480823=_0x584b16?0x0:_0x98d682[_0x1cb8('0x5')];var _0x2158a9=_0x584b16?_0x2ac2d6[_0x1cb8('0x8')]:_0x98d682[_0x1cb8('0x5')]+_0x98d682[_0x1cb8('0x7')];var _0x32715a;if(_0x2158a9>=_0x1ff267){_0x2158a9=_0x1ff267;_0x32715a=0xc8;}else{_0x32715a=0xce;}_0x4e5c19[_0x1cb8('0x3')](_0x32715a);return _0x4e5c19[_0x1cb8('0x9')]('Content-Range',_0x480823+'-'+_0x2158a9+'/'+_0x1ff267)[_0x1cb8('0x4')](_0x2ac2d6);}return null;};}function saveUpdates(_0x1ffe94,_0x1938ee){return function(_0x299eea){if(_0x299eea){return _0x299eea[_0x1cb8('0xa')](_0x1ffe94)['then'](function(_0x389c12){return _0x389c12;});}return null;};}function handleEntityNotFound(_0x2c600,_0xcb6ad1){return function(_0x14d84d){if(!_0x14d84d){_0x2c600[_0x1cb8('0xb')](0x194);}return _0x14d84d;};}function handleError(_0xe5402a,_0x339ad0){_0x339ad0=_0x339ad0||0x1f4;return function(_0x243930){logger['error'](_0x243930[_0x1cb8('0xc')]);if(_0x243930['name']){delete _0x243930[_0x1cb8('0xd')];}_0xe5402a[_0x1cb8('0x3')](_0x339ad0)[_0x1cb8('0xe')](_0x243930);};}exports[_0x1cb8('0xf')]=function(_0x2635a8,_0x308088){var _0x3bfbcf={},_0x9f0adb={},_0x2631db={'count':0x0,'rows':[]};var _0x1f9fd7=_[_0x1cb8('0x10')](db[_0x1cb8('0x11')]['rawAttributes'],function(_0x429d10){return{'name':_0x429d10[_0x1cb8('0x12')],'type':_0x429d10[_0x1cb8('0x13')][_0x1cb8('0x14')]};});_0x9f0adb['model']=_[_0x1cb8('0x10')](_0x1f9fd7,'name');_0x9f0adb[_0x1cb8('0x15')]=_[_0x1cb8('0x16')](_0x2635a8[_0x1cb8('0x15')]);_0x9f0adb[_0x1cb8('0x17')]=_['intersection'](_0x9f0adb['model'],_0x9f0adb[_0x1cb8('0x15')]);_0x9f0adb[_0x1cb8('0x17')]=_[_0x1cb8('0x18')](_0x9f0adb[_0x1cb8('0x17')],[_0x1cb8('0x19'),_0x1cb8('0x1a'),_0x1cb8('0x1b'),'$gte',_0x1cb8('0x1c'),_0x1cb8('0x1d'),_0x1cb8('0x1e'),_0x1cb8('0x1f'),_0x1cb8('0x20'),_0x1cb8('0x21'),'$notBetween',_0x1cb8('0x22'),_0x1cb8('0x23'),_0x1cb8('0x24'),_0x1cb8('0x25'),_0x1cb8('0x26'),'$notILike',_0x1cb8('0x24'),_0x1cb8('0x27'),_0x1cb8('0x28'),_0x1cb8('0x29'),'$any']);_0x3bfbcf[_0x1cb8('0x2a')]=_[_0x1cb8('0x2b')](_0x9f0adb[_0x1cb8('0x2c')],qs['fields'](_0x2635a8[_0x1cb8('0x15')][_0x1cb8('0x2d')]));_0x3bfbcf[_0x1cb8('0x2a')]=_0x3bfbcf['attributes'][_0x1cb8('0x2e')]?_0x3bfbcf[_0x1cb8('0x2a')]:_0x9f0adb[_0x1cb8('0x2c')];if(!_0x2635a8[_0x1cb8('0x15')][_0x1cb8('0x2f')]('nolimit')){_0x3bfbcf[_0x1cb8('0x7')]=qs[_0x1cb8('0x7')](_0x2635a8[_0x1cb8('0x15')][_0x1cb8('0x7')]);_0x3bfbcf[_0x1cb8('0x5')]=qs[_0x1cb8('0x5')](_0x2635a8[_0x1cb8('0x15')][_0x1cb8('0x5')]);}_0x3bfbcf[_0x1cb8('0x30')]=qs['sort'](_0x2635a8['query'][_0x1cb8('0x31')]);_0x3bfbcf[_0x1cb8('0x32')]=qs[_0x1cb8('0x17')](_['pick'](_0x2635a8['query'],_0x9f0adb[_0x1cb8('0x17')]),_0x1f9fd7);if(_0x2635a8[_0x1cb8('0x15')][_0x1cb8('0x33')]){_0x3bfbcf[_0x1cb8('0x32')]=_[_0x1cb8('0x34')](_0x3bfbcf[_0x1cb8('0x32')],{'$or':_[_0x1cb8('0x10')](_0x1f9fd7,function(_0x43dce0){if(_0x43dce0['type']!==_0x1cb8('0x35')){var _0x1a6518={};_0x1a6518[_0x43dce0[_0x1cb8('0xd')]]={'$like':'%'+_0x2635a8[_0x1cb8('0x15')][_0x1cb8('0x33')]+'%'};return _0x1a6518;}})});}_0x3bfbcf=_[_0x1cb8('0x34')]({},_0x3bfbcf,_0x2635a8[_0x1cb8('0x36')]);var _0x2ad7f6={'where':_0x3bfbcf[_0x1cb8('0x32')]};return db['CmHopper'][_0x1cb8('0x8')](_0x2ad7f6)[_0x1cb8('0x37')](function(_0x5e9f5f){_0x2631db[_0x1cb8('0x8')]=_0x5e9f5f;if(_0x2635a8[_0x1cb8('0x15')][_0x1cb8('0x38')]){_0x3bfbcf[_0x1cb8('0x39')]=[{'all':!![]}];}return db[_0x1cb8('0x11')]['findAll'](_0x3bfbcf);})[_0x1cb8('0x37')](function(_0x4666bc){_0x2631db[_0x1cb8('0x3a')]=_0x4666bc;return _0x2631db;})['then'](respondWithFilteredResult(_0x308088,_0x3bfbcf))['catch'](handleError(_0x308088,null));};exports['show']=function(_0xca5f83,_0x35e713){var _0x328f7e={'raw':!![],'where':{'id':_0xca5f83['params']['id']}},_0x4783c8={};_0x4783c8['model']=_[_0x1cb8('0x16')](db[_0x1cb8('0x11')][_0x1cb8('0x3b')]);_0x4783c8[_0x1cb8('0x15')]=_[_0x1cb8('0x16')](_0xca5f83[_0x1cb8('0x15')]);_0x4783c8[_0x1cb8('0x17')]=_[_0x1cb8('0x2b')](_0x4783c8['model'],_0x4783c8[_0x1cb8('0x15')]);_0x328f7e[_0x1cb8('0x2a')]=_[_0x1cb8('0x2b')](_0x4783c8[_0x1cb8('0x2c')],qs['fields'](_0xca5f83[_0x1cb8('0x15')]['fields']));_0x328f7e[_0x1cb8('0x2a')]=_0x328f7e[_0x1cb8('0x2a')]['length']?_0x328f7e[_0x1cb8('0x2a')]:_0x4783c8[_0x1cb8('0x2c')];if(_0xca5f83[_0x1cb8('0x15')]['includeAll']){_0x328f7e['include']=[{'all':!![]}];}_0x328f7e=_[_0x1cb8('0x34')]({},_0x328f7e,_0xca5f83['options']);return db[_0x1cb8('0x11')][_0x1cb8('0x3c')](_0x328f7e)[_0x1cb8('0x37')](handleEntityNotFound(_0x35e713,null))[_0x1cb8('0x37')](respondWithResult(_0x35e713,null))[_0x1cb8('0x3d')](handleError(_0x35e713,null));};exports[_0x1cb8('0x3e')]=function(_0x15e960,_0x5cc9e1){return db[_0x1cb8('0x11')][_0x1cb8('0x3e')](_0x15e960[_0x1cb8('0x3f')],{})[_0x1cb8('0x37')](respondWithResult(_0x5cc9e1,0xc9))['catch'](handleError(_0x5cc9e1,null));};exports[_0x1cb8('0xa')]=function(_0x7f7a09,_0x1b83a6){if(_0x7f7a09[_0x1cb8('0x3f')]['id']){delete _0x7f7a09[_0x1cb8('0x3f')]['id'];}return db['CmHopper'][_0x1cb8('0x3c')]({'where':{'id':_0x7f7a09[_0x1cb8('0x40')]['id']}})[_0x1cb8('0x37')](handleEntityNotFound(_0x1b83a6,null))[_0x1cb8('0x37')](saveUpdates(_0x7f7a09[_0x1cb8('0x3f')],null))['then'](respondWithResult(_0x1b83a6,null))[_0x1cb8('0x3d')](handleError(_0x1b83a6,null));};exports[_0x1cb8('0x41')]=function(_0x5598b1,_0x423916){return db[_0x1cb8('0x11')][_0x1cb8('0x41')]()[_0x1cb8('0x37')](respondWithResult(_0x423916,null))[_0x1cb8('0x3d')](handleError(_0x423916,null));};exports[_0x1cb8('0x42')]=function(_0x3b063c,_0x219541){var _0xd530f8;var _0x713a43=_0x3b063c[_0x1cb8('0x40')]['id'];return db[_0x1cb8('0x11')][_0x1cb8('0x3c')]({'where':{'id':_0x3b063c[_0x1cb8('0x40')]['id']}})['then'](handleEntityNotFound(_0x219541,null))[_0x1cb8('0x37')](function(_0x1e1272){if(_0x1e1272){return _0x1e1272[_0x1cb8('0x42')]()[_0x1cb8('0x37')](function(_0x21aba7){return _0x21aba7;});}})[_0x1cb8('0x37')](function(_0x2f853d){_0xd530f8=_0x2f853d;if(_0x2f853d){if(_0x2f853d['VoiceQueueId']||_0x2f853d[_0x1cb8('0x43')]){return db[_0x2f853d[_0x1cb8('0x44')]?_0x1cb8('0x45'):'Campaign']['find']({'where':{'id':_0x2f853d[_0x1cb8('0x44')]?_0x2f853d[_0x1cb8('0x44')]:_0x2f853d[_0x1cb8('0x43')]},'attributes':['id',_0x1cb8('0xd')],'raw':!![]});}}})[_0x1cb8('0x37')](function(_0x4d59db){var _0xd89636={};if(_0x4d59db){_[_0x1cb8('0x34')](_0xd89636,_[_0x1cb8('0x46')](_0xd530f8['dataValues'],['createdAt','updatedAt','id']));_0xd89636[_0x1cb8('0x47')]=0x15;_0xd89636['statedesc']=_0x1cb8('0x48');_0xd89636[_0x1cb8('0x49')]=_0x4d59db[_0x1cb8('0xd')];_0xd89636[_0x1cb8('0x4a')]=_0x3b063c[_0x1cb8('0x4b')]['name'];_0xd89636[_0x1cb8('0x4c')]=_0x3b063c[_0x1cb8('0x4b')]['id'];_0xd89636[_0x1cb8('0x48')]=!![];_0xd89636[_0x1cb8('0x4d')]=moment()[_0x1cb8('0x4e')](_0x1cb8('0x4f'));_0xd89636[_0x1cb8('0x50')]=_0xd530f8['phone'];_0xd89636[_0x1cb8('0x51')]=_0xd530f8[_0x1cb8('0x44')]?_0x1cb8('0x52'):_0x1cb8('0x53');return db[_0x1cb8('0x54')][_0x1cb8('0x3c')]({'where':{'id':_0xd89636[_0x1cb8('0x55')]},'attributes':['firstName','lastName']})['then'](function(_0x17ade3){if(!_['isNil'](_0x219541)&&!_[_0x1cb8('0x56')](_0x17ade3[_0x1cb8('0x57')])){_0xd89636[_0x1cb8('0x58')]=_0x17ade3[_0x1cb8('0x57')];if(!_[_0x1cb8('0x56')](_0x17ade3['lastName'])){_0xd89636['calleridname']+='\x20'+_0x17ade3['lastName'];}}})[_0x1cb8('0x59')](function(){return db[_0x1cb8('0x5a')]['create'](_0xd89636);});}})[_0x1cb8('0x37')](function(_0x5306fb){return db[_0x1cb8('0x5b')][_0x1cb8('0x42')]({'where':{'CmHopperId':_0x713a43}});})['then'](function(){return _0x219541[_0x1cb8('0x3')](0xcc)[_0x1cb8('0x5c')]();})[_0x1cb8('0x3d')](handleError(_0x219541,null));};exports[_0x1cb8('0x5d')]=function(_0x1396fc,_0x16ec38){var _0x416817=[];return db[_0x1cb8('0x54')][_0x1cb8('0x41')]()[_0x1cb8('0x37')](function(_0x2fb1a7){_0x416817=_[_0x1cb8('0x16')](_0x2fb1a7);return _0x1396fc[_0x1cb8('0x4b')]['getVoiceQueues']({'where':{'type':_0x1cb8('0x5e'),'dialActive':!![],'dialMethod':_0x1cb8('0x5f')},'attributes':['id',_0x1cb8('0x60'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x1cb8('0x37')](function(_0x39de0b){if(_0x39de0b&&_0x39de0b[_0x1cb8('0x2e')]){return db[_0x1cb8('0x61')]['transaction'](function(_0x37f282){var _0x2b92f1={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x1cb8('0x4f'))},'VoiceQueueId':{'$in':_[_0x1cb8('0x10')](_0x39de0b,'id')},'$or':[{'UserId':null},{'UserId':_0x1396fc['user']['id']}]};var _0x41a5b2={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x39de0b)[_0x1cb8('0x33')]([_0x1cb8('0x62'),0x0])[_0x1cb8('0x10')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x1396fc['user']['id']}]};var _0x4e6a41={'$or':[_0x2b92f1,_0x41a5b2]};var _0x7f7524=[];if(_0x1396fc[_0x1cb8('0x3f')][_0x1cb8('0x63')]&&_0x1396fc[_0x1cb8('0x3f')][_0x1cb8('0x63')]===_0x1cb8('0x64')){if(!_[_0x1cb8('0x65')](_0x1396fc['body'][_0x1cb8('0x66')])){_0x4e6a41['id']={'$in':_0x1396fc[_0x1cb8('0x3f')][_0x1cb8('0x66')]};}_0x7f7524=[['priority',_0x1cb8('0x67')],[_0x1cb8('0x68'),_0x39de0b[0x0][_0x1cb8('0x60')]===_0x1cb8('0x67')?_0x1cb8('0x69'):'ASC'],db[_0x1cb8('0x61')][_0x1cb8('0x6a')](_0x1cb8('0x6b')),['id','DESC']];}else{if(!_[_0x1cb8('0x65')](_0x1396fc[_0x1cb8('0x3f')]['hopperIds'])){_0x4e6a41['id']={'$notIn':_0x1396fc[_0x1cb8('0x3f')]['hopperIds']};}_0x7f7524=[['priority',_0x1cb8('0x69')],[_0x1cb8('0x68'),_0x39de0b[0x0][_0x1cb8('0x60')]],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x1cb8('0x67')]];}return db[_0x1cb8('0x11')][_0x1cb8('0x6c')]({'attributes':['id',_0x1cb8('0x6d'),_0x1cb8('0x6e'),_0x1cb8('0x6f')],'where':_0x4e6a41,'order':_0x7f7524,'transaction':_0x37f282,'lock':_0x37f282[_0x1cb8('0x70')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x416817,'include':[{'model':db['CmCompany'],'as':_0x1cb8('0x71'),'attributes':['id','name']}]},{'model':db[_0x1cb8('0x72')],'as':'List','attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0x1cb8('0x73'),'attributes':['id',_0x1cb8('0xd'),_0x1cb8('0x74')]}]})[_0x1cb8('0x37')](function(_0x26f661){if(_0x26f661){return _0x26f661[_0x1cb8('0xa')]({'UserId':_0x1396fc[_0x1cb8('0x4b')]['id']},{'transaction':_0x37f282});}});});}})[_0x1cb8('0x37')](handleEntityNotFound(_0x16ec38,null))[_0x1cb8('0x37')](respondWithResult(_0x16ec38,null))[_0x1cb8('0x3d')](handleError(_0x16ec38,null));};exports[_0x1cb8('0x75')]=function(_0x1f1bc9,_0x279a03,_0x1cc13f){var _0xafc24b=[];var _0x38aa03=_0x1f1bc9['params']['id'];var _0xd1ee6d=_0x1f1bc9[_0x1cb8('0x4b')]['id'];return db[_0x1cb8('0x54')][_0x1cb8('0x41')]()[_0x1cb8('0x37')](function(_0x284c46){_0xafc24b=_['keys'](_0x284c46);return db[_0x1cb8('0x61')][_0x1cb8('0x76')](function(_0x19c7ca){const _0xe2c1b8={'id':_0x38aa03};return db[_0x1cb8('0x11')]['findOne']({'attributes':['id',_0x1cb8('0x6d'),_0x1cb8('0x6f')],'where':_0xe2c1b8,'transaction':_0x19c7ca,'lock':_0x19c7ca['LOCK'][_0x1cb8('0x77')],'include':[{'model':db['CmContact'],'as':_0x1cb8('0x78'),'attributes':_0xafc24b,'include':[{'model':db[_0x1cb8('0x79')],'as':_0x1cb8('0x71'),'attributes':['id','name']}]},{'model':db[_0x1cb8('0x72')],'as':_0x1cb8('0x7a'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0x1cb8('0x73'),'attributes':['id',_0x1cb8('0xd'),'dialActive']}]})[_0x1cb8('0x37')](function(_0x257156){if(_0x257156){return _0x257156[_0x1cb8('0xa')]({'UserId':_0xd1ee6d},{'transaction':_0x19c7ca});}});});})[_0x1cb8('0x37')](handleEntityNotFound(_0x279a03,null))[_0x1cb8('0x37')](respondWithResult(_0x279a03,null))[_0x1cb8('0x3d')](handleError(_0x279a03,null));};exports[_0x1cb8('0x7b')]=function(_0x4eb044,_0x438d49){return _0x4eb044['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x1cb8('0x5f')},'attributes':['id'],'raw':!![]})[_0x1cb8('0x37')](function(_0x4ab060){if(_0x4ab060&&_0x4ab060[_0x1cb8('0x2e')]){return db[_0x1cb8('0x11')][_0x1cb8('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x1cb8('0x10')](_0x4ab060,'id')},'$or':[{'UserId':null},{'UserId':_0x4eb044['user']['id']}]}});}return 0x0;})[_0x1cb8('0x37')](function(_0x3ec1ce){if(!_[_0x1cb8('0x56')](_0x3ec1ce)&&_['isNumber'](_0x3ec1ce)){return _0x438d49['status'](0xc8)[_0x1cb8('0x4')]({'contacts':_0x3ec1ce});}else{logger['error'](_0x1cb8('0x7c'),_0x1cb8('0x7b'),0x194,_0x1cb8('0x7d'));_0x438d49[_0x1cb8('0xb')](0x194);}})[_0x1cb8('0x3d')](handleError(_0x438d49,null));};exports[_0x1cb8('0x7e')]=function(_0x111011,_0x2f22cd){var _0x99de73=shared[_0x1cb8('0x7f')];var _0x255cec=[];_[_0x1cb8('0x10')](_0x99de73,function(_0xdb3ec3){_0x255cec['push']({'id':_0xdb3ec3['name'],'name':_0xdb3ec3[_0x1cb8('0xd')],'utcOffset':_0xdb3ec3[_0x1cb8('0x80')]});});return _0x2f22cd[_0x1cb8('0x3')](0xc8)[_0x1cb8('0x4')]({'tz':_0x255cec});};exports['getTimezone']=function(_0x745acb,_0x1e343c){var _0x4b48a6=shared[_0x1cb8('0x7f')];var _0x157290={};if(!_['isNil'](_0x4b48a6[_0x745acb[_0x1cb8('0x3f')]['id']]))_0x157290=_0x4b48a6[_0x745acb[_0x1cb8('0x3f')]['id']];return _0x1e343c[_0x1cb8('0x3')](0xc8)[_0x1cb8('0x4')](_0x157290);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 6532c82..5bb084c 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 _0x2542=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x26edfc,_0x18bee9){var _0x52a7c1=function(_0x59e008){while(--_0x59e008){_0x26edfc['push'](_0x26edfc['shift']());}};_0x52a7c1(++_0x18bee9);}(_0x2542,0x169));var _0x2254=function(_0x186957,_0x4083df){_0x186957=_0x186957-0x0;var _0x560b7c=_0x2542[_0x186957];return _0x560b7c;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd117=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xd117,0x182));var _0x7d11=function(_0x4b7b9b,_0xa4aff9){_0x4b7b9b=_0x4b7b9b-0x0;var _0x3be710=_0xd117[_0x4b7b9b];return _0x3be710;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x7d11('0xe'),'fields':[_0x7d11('0xe')]},{'name':_0x7d11('0xf'),'fields':['phone']},{'name':_0x7d11('0x10'),'fields':[_0x7d11('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 633b853..19b69ed 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 _0x4f34=['List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','map','model','include','then','info','debug','stringify','error','message','ShowCmHopper','find','catch','CreateCmHopper','create','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','order','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','name','UserId','update','includes','push','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','NOW()','voicePause','CmList'];(function(_0x470d13,_0x3f22fa){var _0x18cc32=function(_0x58b827){while(--_0x58b827){_0x470d13['push'](_0x470d13['shift']());}};_0x18cc32(++_0x3f22fa);}(_0x4f34,0xae));var _0x44f3=function(_0x2dee81,_0x58c3df){_0x2dee81=_0x2dee81-0x0;var _0xa3a214=_0x4f34[_0x2dee81];return _0xa3a214;};'use strict';var _=require(_0x44f3('0x0'));var util=require(_0x44f3('0x1'));var moment=require(_0x44f3('0x2'));var BPromise=require(_0x44f3('0x3'));var db=require(_0x44f3('0x4'))['db'];var logger=require(_0x44f3('0x5'))(_0x44f3('0x6'));exports[_0x44f3('0x7')]=function(_0x485752){var _0x3c5e88=this;return new Promise(function(_0x33b6ac,_0xfd29d7){return db[_0x44f3('0x8')][_0x44f3('0x9')]({'raw':_0x485752[_0x44f3('0xa')]?_0x485752['options'][_0x44f3('0xb')]===undefined?!![]:![]:!![],'where':_0x485752['options']?_0x485752[_0x44f3('0xa')][_0x44f3('0xc')]||null:null,'attributes':_0x485752[_0x44f3('0xa')]?_0x485752[_0x44f3('0xa')][_0x44f3('0xd')]||null:null,'limit':_0x485752[_0x44f3('0xa')]?_0x485752[_0x44f3('0xa')][_0x44f3('0xe')]||null:null,'include':_0x485752['options']?_0x485752['options']['include']?_[_0x44f3('0xf')](_0x485752[_0x44f3('0xa')]['include'],function(_0x17f25a){return{'model':db[_0x17f25a[_0x44f3('0x10')]],'as':_0x17f25a['as'],'attributes':_0x17f25a[_0x44f3('0xd')],'include':_0x17f25a[_0x44f3('0x11')]?_[_0x44f3('0xf')](_0x17f25a[_0x44f3('0x11')],function(_0x41d4ee){return{'model':db[_0x41d4ee['model']],'as':_0x41d4ee['as'],'attributes':_0x41d4ee[_0x44f3('0xd')],'include':_0x41d4ee[_0x44f3('0x11')]?_['map'](_0x41d4ee[_0x44f3('0x11')],function(_0x3de4df){return{'model':db[_0x3de4df[_0x44f3('0x10')]],'as':_0x3de4df['as'],'attributes':_0x3de4df[_0x44f3('0xd')]};}):[]};}):[]};}):[]:[]})[_0x44f3('0x12')](function(_0x4fd26d){logger[_0x44f3('0x13')](_0x44f3('0x7'),_0x485752);logger[_0x44f3('0x14')](_0x44f3('0x7'),_0x485752,JSON[_0x44f3('0x15')](_0x4fd26d));_0x33b6ac(_0x4fd26d);})['catch'](function(_0x147495){logger[_0x44f3('0x16')](_0x44f3('0x7'),_0x147495[_0x44f3('0x17')],_0x485752);_0xfd29d7(_0x3c5e88[_0x44f3('0x16')](0x1f4,_0x147495[_0x44f3('0x17')]));});});};exports[_0x44f3('0x18')]=function(_0x4cf4dd){var _0x2c8514=this;return new Promise(function(_0x316693,_0x52d04c){return db[_0x44f3('0x8')][_0x44f3('0x19')]({'raw':_0x4cf4dd[_0x44f3('0xa')]?_0x4cf4dd['options'][_0x44f3('0xb')]===undefined?!![]:![]:!![],'where':_0x4cf4dd[_0x44f3('0xa')]?_0x4cf4dd[_0x44f3('0xa')][_0x44f3('0xc')]||null:null,'attributes':_0x4cf4dd[_0x44f3('0xa')]?_0x4cf4dd[_0x44f3('0xa')][_0x44f3('0xd')]||null:null,'include':_0x4cf4dd[_0x44f3('0xa')]?_0x4cf4dd['options']['include']?_[_0x44f3('0xf')](_0x4cf4dd[_0x44f3('0xa')][_0x44f3('0x11')],function(_0x332663){return{'model':db[_0x332663[_0x44f3('0x10')]],'as':_0x332663['as'],'attributes':_0x332663[_0x44f3('0xd')],'include':_0x332663[_0x44f3('0x11')]?_['map'](_0x332663['include'],function(_0x2414bb){return{'model':db[_0x2414bb['model']],'as':_0x2414bb['as'],'attributes':_0x2414bb['attributes'],'include':_0x2414bb['include']?_[_0x44f3('0xf')](_0x2414bb[_0x44f3('0x11')],function(_0x421531){return{'model':db[_0x421531[_0x44f3('0x10')]],'as':_0x421531['as'],'attributes':_0x421531[_0x44f3('0xd')]};}):[]};}):[]};}):[]:[]})[_0x44f3('0x12')](function(_0x8f8d04){logger[_0x44f3('0x13')](_0x44f3('0x18'),_0x4cf4dd);logger[_0x44f3('0x14')](_0x44f3('0x18'),_0x4cf4dd,JSON[_0x44f3('0x15')](_0x8f8d04));_0x316693(_0x8f8d04);})[_0x44f3('0x1a')](function(_0x170e48){logger[_0x44f3('0x16')](_0x44f3('0x18'),_0x170e48[_0x44f3('0x17')],_0x4cf4dd);_0x52d04c(_0x2c8514[_0x44f3('0x16')](0x1f4,_0x170e48[_0x44f3('0x17')]));});});};exports[_0x44f3('0x1b')]=function(_0x513677){var _0x3bf583=this;return new Promise(function(_0x39b091,_0x7ec595){return db['CmHopper'][_0x44f3('0x1c')](_0x513677[_0x44f3('0x1d')],{'raw':_0x513677[_0x44f3('0xa')]?_0x513677[_0x44f3('0xa')][_0x44f3('0xb')]===undefined?!![]:![]:!![]})['then'](function(_0x282de0){logger['info'](_0x44f3('0x1b'),_0x513677);logger[_0x44f3('0x14')]('CreateCmHopper',_0x513677,JSON[_0x44f3('0x15')](_0x282de0));_0x39b091(_0x282de0);})[_0x44f3('0x1a')](function(_0x5d4e43){logger[_0x44f3('0x16')]('CreateCmHopper',_0x5d4e43['message'],_0x513677);_0x7ec595(_0x3bf583['error'](0x1f4,_0x5d4e43[_0x44f3('0x17')]));});});};exports['UpdateCmHopper']=function(_0x496b07){var _0x161afb=this;return new Promise(function(_0x5a6c5b,_0x4572f5){return db[_0x44f3('0x8')]['update'](_0x496b07[_0x44f3('0x1d')],{'raw':_0x496b07[_0x44f3('0xa')]?_0x496b07['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x496b07['options']?_0x496b07['options'][_0x44f3('0xc')]||null:null,'attributes':_0x496b07[_0x44f3('0xa')]?_0x496b07[_0x44f3('0xa')][_0x44f3('0xd')]||null:null,'limit':_0x496b07[_0x44f3('0xa')]?_0x496b07['options'][_0x44f3('0xe')]||null:null})['then'](function(_0x4f3d9){logger[_0x44f3('0x13')]('UpdateCmHopper',_0x496b07);logger[_0x44f3('0x13')](_0x44f3('0x1e'),JSON['stringify'](_0x496b07[_0x44f3('0xa')][_0x44f3('0xc')]),_0x496b07['body']['active']);logger[_0x44f3('0x14')]('UpdateCmHopper',_0x496b07,JSON[_0x44f3('0x15')](_0x4f3d9));_0x5a6c5b(_0x4f3d9);})['catch'](function(_0x48345d){logger[_0x44f3('0x16')](_0x44f3('0x1f'),_0x48345d[_0x44f3('0x17')],_0x496b07);_0x4572f5(_0x161afb[_0x44f3('0x16')](0x1f4,_0x48345d['message']));});});};exports['DestroyCmHopper']=function(_0x595d9d){var _0x377cdb=this;return new Promise(function(_0x21aa64,_0x518ce9){return db[_0x44f3('0x8')][_0x44f3('0x20')]({'where':_0x595d9d[_0x44f3('0xa')]?_0x595d9d[_0x44f3('0xa')]['where']||null:null})['then'](function(_0x58d6ef){logger['info'](_0x44f3('0x21'),_0x595d9d);logger[_0x44f3('0x14')](_0x44f3('0x21'),_0x595d9d,JSON[_0x44f3('0x15')](_0x58d6ef));_0x21aa64(_0x58d6ef);})[_0x44f3('0x1a')](function(_0x809476){logger[_0x44f3('0x16')]('DestroyCmHopper',_0x809476['message'],_0x595d9d);_0x518ce9(_0x377cdb['error'](0x1f4,_0x809476[_0x44f3('0x17')]));});});};exports[_0x44f3('0x22')]=function(_0xb511a3){var _0x298f00=this;return new Promise(function(_0x2e2724,_0xcb9b19){return db['CmContact'][_0x44f3('0x23')]()[_0x44f3('0x12')](function(_0x2ce287){return db[_0x44f3('0x24')][_0x44f3('0x25')](function(_0xf13466){return db[_0x44f3('0x8')]['findAll']({'where':_0xb511a3['options']?_0xb511a3['options'][_0x44f3('0xc')]||null:null,'attributes':_0xb511a3['options']?_0xb511a3[_0x44f3('0xa')]['attributes']||null:null,'limit':_0xb511a3[_0x44f3('0xa')]?_0xb511a3[_0x44f3('0xa')][_0x44f3('0xe')]||null:null,'order':_0xb511a3[_0x44f3('0xa')]?_0xb511a3['options'][_0x44f3('0x26')]||null:null,'transaction':_0xf13466,'lock':_0xf13466[_0x44f3('0x27')][_0x44f3('0x28')],'include':[{'model':db[_0x44f3('0x29')],'as':_0x44f3('0x2a'),'attributes':_[_0x44f3('0x2b')](_0x2ce287)},{'model':db[_0x44f3('0x2c')],'as':_0x44f3('0x2d'),'attributes':['id',_0x44f3('0x2e'),'voicePause']}]})['then'](function(_0x53da11){var _0x3b3076=[];var _0x54a690=[];for(var _0x34f90f=0x0;_0x34f90f<_0x53da11['length'];_0x34f90f+=0x1){var _0x5a189e=_0x53da11[_0x34f90f][_0x44f3('0x2f')];if(_0x5a189e===null){_0x3b3076['push'](_0x53da11[_0x34f90f][_0x44f3('0x30')](_0xb511a3[_0x44f3('0x1d')],{'transaction':_0xf13466}));}else if(!_0x54a690[_0x44f3('0x31')](_0x5a189e)){_0x54a690[_0x44f3('0x32')](_0x5a189e);_0x3b3076['push'](_0x53da11[_0x34f90f][_0x44f3('0x30')](_0xb511a3[_0x44f3('0x1d')],{'transaction':_0xf13466}));}}return BPromise[_0x44f3('0x33')](_0x3b3076);});})[_0x44f3('0x12')](function(_0x18bdea){logger['info'](_0x44f3('0x22'),_0xb511a3);if(_0x18bdea[_0x44f3('0x34')]>0x0){logger['info'](_0x44f3('0x35'),_0x18bdea[0x0][_0x44f3('0x36')]['id'],_0x18bdea[0x0][_0x44f3('0x36')][_0x44f3('0x37')],_0x18bdea[0x0][_0x44f3('0x36')][_0x44f3('0x38')]);}logger[_0x44f3('0x14')](_0x44f3('0x22'),_0xb511a3,JSON['stringify'](_0x18bdea));_0x2e2724(_0x18bdea);})[_0x44f3('0x1a')](function(_0x5cd1cb){logger['error'](_0x44f3('0x22'),_0x5cd1cb[_0x44f3('0x17')],_0xb511a3);_0xcb9b19(_0x298f00[_0x44f3('0x16')](0x1f4,_0x5cd1cb['message']));});});});};exports[_0x44f3('0x39')]=function(_0x278d72){var _0x46d8af=this;return new Promise(function(_0x490dbb,_0x379fb7){return db[_0x44f3('0x24')][_0x44f3('0x25')](function(_0x26641f){return db[_0x44f3('0x3a')]['create'](_0x278d72[_0x44f3('0x1d')],{'raw':_0x278d72[_0x44f3('0xa')]?_0x278d72[_0x44f3('0xa')]['raw']===undefined?!![]:![]:!![],'transaction':_0x26641f})['then'](function(){logger['info'](_0x44f3('0x3b'),JSON['stringify'](_0x278d72[_0x44f3('0xa')][_0x44f3('0xc')]),_0x278d72['options']['where']['active']);return db['CmHopper'][_0x44f3('0x20')]({'where':_0x278d72[_0x44f3('0xa')]?_0x278d72[_0x44f3('0xa')][_0x44f3('0xc')]||null:null,'transaction':_0x26641f});});})[_0x44f3('0x12')](function(_0x234c24){logger[_0x44f3('0x13')]('MoveContactManagedDialer',_0x278d72);logger[_0x44f3('0x14')]('MoveContactManagedDialer',_0x278d72,JSON[_0x44f3('0x15')](_0x234c24));_0x490dbb(_0x234c24);})[_0x44f3('0x1a')](function(_0x28f438){logger[_0x44f3('0x16')]('MoveContactManagedDialer',_0x28f438[_0x44f3('0x17')],_0x278d72);_0x379fb7(_0x46d8af[_0x44f3('0x16')](0x1f4,_0x28f438[_0x44f3('0x17')]));});});};exports[_0x44f3('0x3c')]=function(_0xd5897a){var _0x115f47=this;return new Promise(function(_0x21e300,_0x4e2c8c){return db[_0x44f3('0x8')][_0x44f3('0x9')]({'raw':_0xd5897a['options']?_0xd5897a[_0x44f3('0xa')][_0x44f3('0xb')]===undefined?!![]:![]:!![],'where':_0xd5897a[_0x44f3('0xa')]?_0xd5897a[_0x44f3('0xa')][_0x44f3('0xc')]||null:null,'attributes':[[db[_0x44f3('0x24')]['fn'](_0x44f3('0x3d'),db[_0x44f3('0x24')]['fn']('IF',db[_0x44f3('0x24')][_0x44f3('0x3e')](_0x44f3('0x3f')+util[_0x44f3('0x40')](_0x44f3('0x41'),moment()[_0x44f3('0x40')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x44f3('0x42')))),_0x44f3('0x43')]]})[_0x44f3('0x12')](function(_0x1d47a4){logger['info'](_0x44f3('0x3c'),_0xd5897a);logger['debug']('CountReScheduled',_0xd5897a,JSON['stringify'](_0x1d47a4));_0x21e300(_0x1d47a4);})[_0x44f3('0x1a')](function(_0x391d59){logger[_0x44f3('0x16')]('CountReScheduled',_0x391d59[_0x44f3('0x17')],_0xd5897a);_0x4e2c8c(_0x115f47[_0x44f3('0x16')](0x1f4,_0x391d59[_0x44f3('0x17')]));});});};exports[_0x44f3('0x44')]=function(_0x4b97cd){var _0x4363f1=this;return new Promise(function(_0x3ac196,_0x2d7622){return db[_0x44f3('0x29')][_0x44f3('0x23')]()[_0x44f3('0x12')](function(){return db[_0x44f3('0x24')]['transaction'](function(_0xdb672e){return db['CmHopper'][_0x44f3('0x9')]({'where':_0x4b97cd[_0x44f3('0xa')]?_0x4b97cd[_0x44f3('0xa')]['where']||null:null,'attributes':_0x4b97cd[_0x44f3('0xa')]?_0x4b97cd[_0x44f3('0xa')][_0x44f3('0xd')]||null:null,'limit':0x1,'order':_0x4b97cd[_0x44f3('0xa')]?_0x4b97cd['options'][_0x44f3('0x26')]||null:null,'group':db['CmHopper']['UserId'],'transaction':_0xdb672e,'lock':_0xdb672e[_0x44f3('0x27')][_0x44f3('0x28')],'include':_0x4b97cd['options']?_0x4b97cd[_0x44f3('0xa')][_0x44f3('0x11')]?_[_0x44f3('0xf')](_0x4b97cd[_0x44f3('0xa')]['include'],function(_0x5f2c24){return{'model':db[_0x5f2c24[_0x44f3('0x10')]],'as':_0x5f2c24['as'],'attributes':_0x5f2c24['attributes'],'include':_0x5f2c24['include']?_[_0x44f3('0xf')](_0x5f2c24[_0x44f3('0x11')],function(_0x278be9){return{'model':db[_0x278be9[_0x44f3('0x10')]],'as':_0x278be9['as'],'attributes':_0x278be9[_0x44f3('0xd')],'include':_0x278be9['include']?_[_0x44f3('0xf')](_0x278be9[_0x44f3('0x11')],function(_0x2f6fd7){return{'model':db[_0x2f6fd7['model']],'as':_0x2f6fd7['as'],'attributes':_0x2f6fd7[_0x44f3('0xd')]};}):[]};}):[]};}):[]:[]})[_0x44f3('0x12')](function(_0x348294){var _0x2276a8=[];for(var _0x1a9396=0x0;_0x1a9396<_0x348294[_0x44f3('0x34')];_0x1a9396+=0x1){_0x2276a8['push'](_0x348294[_0x1a9396][_0x44f3('0x30')](_0x4b97cd[_0x44f3('0x1d')],{'transaction':_0xdb672e}));}return BPromise[_0x44f3('0x33')](_0x2276a8);});})['then'](function(_0xab74a5){logger['info']('GetContactRecallMe',_0x4b97cd);logger['debug']('GetContactRecallMe',_0x4b97cd,JSON['stringify'](_0xab74a5));_0x3ac196(_0xab74a5);})['catch'](function(_0x493163){logger[_0x44f3('0x16')](_0x44f3('0x44'),_0x493163[_0x44f3('0x17')],_0x4b97cd);_0x2d7622(_0x4363f1[_0x44f3('0x16')](0x1f4,_0x493163[_0x44f3('0x17')]));});});});};exports[_0x44f3('0x45')]=function(_0x328abb){var _0x26df8d=this;return new Promise(function(_0x2c5515,_0x39b1cf){db['CmContact'][_0x44f3('0x23')]()['then'](function(_0x5a5b33){return db[_0x44f3('0x8')][_0x44f3('0x9')]({'raw':_0x328abb[_0x44f3('0xa')]?_0x328abb['options'][_0x44f3('0xb')]===undefined?!![]:![]:!![],'where':_0x328abb['options']?_0x328abb[_0x44f3('0xa')]['where']||null:null,'attributes':_0x328abb[_0x44f3('0xa')]?_0x328abb[_0x44f3('0xa')][_0x44f3('0xd')]||null:null,'limit':_0x328abb[_0x44f3('0xa')]?_0x328abb[_0x44f3('0xa')][_0x44f3('0xe')]||null:null,'include':_0x328abb[_0x44f3('0xa')]?_0x328abb[_0x44f3('0xa')]['include']?_['map'](_0x328abb[_0x44f3('0xa')][_0x44f3('0x11')],function(_0x1d1745){return{'model':db[_0x1d1745[_0x44f3('0x10')]],'as':_0x1d1745['as'],'attributes':_0x1d1745['as']===_0x44f3('0x2a')?_[_0x44f3('0x2b')](_0x5a5b33):_0x1d1745[_0x44f3('0xd')],'include':_0x1d1745[_0x44f3('0x11')]?_[_0x44f3('0xf')](_0x1d1745['include'],function(_0x45d91e){return{'model':db[_0x45d91e[_0x44f3('0x10')]],'as':_0x45d91e['as'],'attributes':_0x45d91e[_0x44f3('0xd')],'include':_0x45d91e[_0x44f3('0x11')]?_[_0x44f3('0xf')](_0x45d91e[_0x44f3('0x11')],function(_0xa96f8d){return{'model':db[_0xa96f8d['model']],'as':_0xa96f8d['as'],'attributes':_0xa96f8d[_0x44f3('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa911f8){logger[_0x44f3('0x13')](_0x44f3('0x7'),_0x328abb);logger['debug'](_0x44f3('0x7'),_0x328abb,JSON[_0x44f3('0x15')](_0xa911f8));_0x2c5515(_0xa911f8);})['catch'](function(_0x2a22bf){logger['error'](_0x44f3('0x7'),_0x2a22bf[_0x44f3('0x17')],_0x328abb);_0x39b1cf(_0x26df8d[_0x44f3('0x16')](0x1f4,_0x2a22bf['message']));});});});};exports[_0x44f3('0x46')]=function(_0x124255){var _0xe4a24b=this;return new Promise(function(_0x2a6512,_0x297def){return db[_0x44f3('0x29')][_0x44f3('0x47')]({'raw':!![],'where':{'phone':_0x124255[_0x44f3('0xa')][_0x44f3('0xc')][_0x44f3('0x48')]},'attributes':['id',_0x44f3('0x49')],'order':[['id',_0x44f3('0x4a')]]})[_0x44f3('0x12')](function(_0x25eae3){logger[_0x44f3('0x13')](_0x44f3('0x4b'),_0x124255);logger[_0x44f3('0x14')]('getContactByPhone',_0x124255,JSON[_0x44f3('0x15')](_0x25eae3));_0x2a6512(_0x25eae3);})[_0x44f3('0x1a')](function(_0x4bc8b9){logger[_0x44f3('0x16')](_0x44f3('0x4b'),_0x4bc8b9[_0x44f3('0x17')],_0x124255);_0x297def(_0xe4a24b[_0x44f3('0x16')](0x1f4,_0x4bc8b9['message']));});});};exports[_0x44f3('0x4c')]=function(_0x55f443){var _0x14dd45=this;return new Promise(function(_0x1c3ef0,_0x202477){return db['sequelize']['transaction'](function(_0x5c1f49){var _0x50baf3=_0x55f443[_0x44f3('0xa')]&&_0x55f443[_0x44f3('0xa')][_0x44f3('0xc')]?_0x55f443[_0x44f3('0xa')][_0x44f3('0xc')]:{};return db[_0x44f3('0x8')][_0x44f3('0x30')](_0x55f443['body'],{'where':_0x50baf3,'transaction':_0x5c1f49})['then'](function(_0x13c1b4){logger[_0x44f3('0x13')](_0x44f3('0x4c'),_0x55f443);logger['debug'](_0x44f3('0x4c'),_0x55f443,JSON['stringify'](_0x13c1b4));_0x1c3ef0(_0x13c1b4);})[_0x44f3('0x1a')](function(_0x5ef058){logger[_0x44f3('0x16')](_0x44f3('0x4c'),_0x5ef058[_0x44f3('0x17')],_0x55f443);_0x202477(_0x14dd45[_0x44f3('0x16')](0x1f4,_0x5ef058[_0x44f3('0x17')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x12b1cb){var _0x2e645a=this;var _0x10e38d=_0x12b1cb['body'][_0x44f3('0xc')][_0x44f3('0x4d')];var _0x421b6c=_0x12b1cb[_0x44f3('0x1d')][_0x44f3('0xc')][_0x44f3('0x4e')];var _0x5c5056=_0x12b1cb[_0x44f3('0x1d')]['where'][_0x44f3('0x4f')];return new Promise(function(_0x3565ad,_0x2d0e3b){return db['CmHopper'][_0x44f3('0x9')]({'where':{'voiceQueueId':{'$in':_0x10e38d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x44f3('0x24')]['literal'](_0x44f3('0x50')+_0x421b6c+'\x20MINUTE'),'$gt':db[_0x44f3('0x24')]['literal'](_0x44f3('0x51'))}},'UserId':{'$in':_0x5c5056}},'include':[{'model':db[_0x44f3('0x29')],'as':_0x44f3('0x2a')},{'model':db[_0x44f3('0x2c')],'as':'Agent','attributes':['id',_0x44f3('0x2e'),_0x44f3('0x52')]},{'model':db[_0x44f3('0x53')],'as':_0x44f3('0x54')}]})[_0x44f3('0x12')](function(_0x8596f9){if(_0x8596f9['length']>0x0){return db[_0x44f3('0x24')][_0x44f3('0x25')](function(_0x5302ed){return db[_0x44f3('0x8')][_0x44f3('0x30')]({'recallmeNotifiedDate':db['sequelize'][_0x44f3('0x3e')](_0x44f3('0x51'))},{'where':{'id':{'$in':_[_0x44f3('0xf')](_0x8596f9,'id')}},'transaction':_0x5302ed})[_0x44f3('0x12')](function(){_0x3565ad(_0x8596f9);})[_0x44f3('0x1a')](function(_0x4e7f0e){logger[_0x44f3('0x16')](_0x44f3('0x55'),_0x4e7f0e[_0x44f3('0x17')],_0x12b1cb);_0x2d0e3b(_0x2e645a[_0x44f3('0x16')](0x1f4,_0x4e7f0e['message']));});})[_0x44f3('0x1a')](function(_0x2aba5d){logger[_0x44f3('0x16')](_0x44f3('0x55'),_0x2aba5d[_0x44f3('0x17')],_0x12b1cb);_0x2d0e3b(_0x2e645a[_0x44f3('0x16')](0x1f4,_0x2aba5d[_0x44f3('0x17')]));});}else{_0x3565ad(_0x8596f9);}});});}; \ No newline at end of file +var _0x3676=['\x20MINUTE','NOW()','User','name','CmList','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','findAll','raw','options','attributes','include','map','model','then','debug','stringify','catch','message','ShowCmHopper','CmHopper','find','where','info','error','create','body','CreateCmHopper','UpdateCmHopper','update','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','keys','Agent','voicePause','length','push','includes','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','UserId','GetContactRecallMe','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20'];(function(_0x1074ce,_0xee01f6){var _0x20a935=function(_0xf9fdec){while(--_0xf9fdec){_0x1074ce['push'](_0x1074ce['shift']());}};_0x20a935(++_0xee01f6);}(_0x3676,0x14d));var _0x6367=function(_0x43026b,_0x928d8c){_0x43026b=_0x43026b-0x0;var _0x4a96cd=_0x3676[_0x43026b];return _0x4a96cd;};'use strict';var _=require(_0x6367('0x0'));var util=require('util');var moment=require(_0x6367('0x1'));var BPromise=require(_0x6367('0x2'));var db=require(_0x6367('0x3'))['db'];var logger=require(_0x6367('0x4'))(_0x6367('0x5'));exports[_0x6367('0x6')]=function(_0x3c1f2c){var _0x1ba970=this;return new Promise(function(_0x2157d8,_0x313bdc){return db['CmHopper'][_0x6367('0x7')]({'raw':_0x3c1f2c['options']?_0x3c1f2c['options'][_0x6367('0x8')]===undefined?!![]:![]:!![],'where':_0x3c1f2c[_0x6367('0x9')]?_0x3c1f2c['options']['where']||null:null,'attributes':_0x3c1f2c[_0x6367('0x9')]?_0x3c1f2c[_0x6367('0x9')][_0x6367('0xa')]||null:null,'limit':_0x3c1f2c['options']?_0x3c1f2c[_0x6367('0x9')]['limit']||null:null,'include':_0x3c1f2c['options']?_0x3c1f2c['options'][_0x6367('0xb')]?_[_0x6367('0xc')](_0x3c1f2c[_0x6367('0x9')][_0x6367('0xb')],function(_0x4a7b7d){return{'model':db[_0x4a7b7d[_0x6367('0xd')]],'as':_0x4a7b7d['as'],'attributes':_0x4a7b7d[_0x6367('0xa')],'include':_0x4a7b7d[_0x6367('0xb')]?_['map'](_0x4a7b7d[_0x6367('0xb')],function(_0x5b6a5d){return{'model':db[_0x5b6a5d[_0x6367('0xd')]],'as':_0x5b6a5d['as'],'attributes':_0x5b6a5d[_0x6367('0xa')],'include':_0x5b6a5d['include']?_['map'](_0x5b6a5d[_0x6367('0xb')],function(_0x46afdb){return{'model':db[_0x46afdb[_0x6367('0xd')]],'as':_0x46afdb['as'],'attributes':_0x46afdb[_0x6367('0xa')]};}):[]};}):[]};}):[]:[]})[_0x6367('0xe')](function(_0x47b37f){logger['info'](_0x6367('0x6'),_0x3c1f2c);logger[_0x6367('0xf')]('GetCmHopper',_0x3c1f2c,JSON[_0x6367('0x10')](_0x47b37f));_0x2157d8(_0x47b37f);})[_0x6367('0x11')](function(_0x42b942){logger['error'](_0x6367('0x6'),_0x42b942[_0x6367('0x12')],_0x3c1f2c);_0x313bdc(_0x1ba970['error'](0x1f4,_0x42b942[_0x6367('0x12')]));});});};exports[_0x6367('0x13')]=function(_0x3213e6){var _0x46f12c=this;return new Promise(function(_0x47c37f,_0x1449c6){return db[_0x6367('0x14')][_0x6367('0x15')]({'raw':_0x3213e6[_0x6367('0x9')]?_0x3213e6[_0x6367('0x9')][_0x6367('0x8')]===undefined?!![]:![]:!![],'where':_0x3213e6[_0x6367('0x9')]?_0x3213e6['options'][_0x6367('0x16')]||null:null,'attributes':_0x3213e6[_0x6367('0x9')]?_0x3213e6['options'][_0x6367('0xa')]||null:null,'include':_0x3213e6[_0x6367('0x9')]?_0x3213e6['options'][_0x6367('0xb')]?_[_0x6367('0xc')](_0x3213e6['options'][_0x6367('0xb')],function(_0x260832){return{'model':db[_0x260832['model']],'as':_0x260832['as'],'attributes':_0x260832[_0x6367('0xa')],'include':_0x260832[_0x6367('0xb')]?_[_0x6367('0xc')](_0x260832['include'],function(_0x4922b2){return{'model':db[_0x4922b2[_0x6367('0xd')]],'as':_0x4922b2['as'],'attributes':_0x4922b2[_0x6367('0xa')],'include':_0x4922b2[_0x6367('0xb')]?_['map'](_0x4922b2[_0x6367('0xb')],function(_0x10b291){return{'model':db[_0x10b291[_0x6367('0xd')]],'as':_0x10b291['as'],'attributes':_0x10b291[_0x6367('0xa')]};}):[]};}):[]};}):[]:[]})[_0x6367('0xe')](function(_0x302bea){logger[_0x6367('0x17')](_0x6367('0x13'),_0x3213e6);logger[_0x6367('0xf')]('ShowCmHopper',_0x3213e6,JSON[_0x6367('0x10')](_0x302bea));_0x47c37f(_0x302bea);})[_0x6367('0x11')](function(_0x102a08){logger['error'](_0x6367('0x13'),_0x102a08[_0x6367('0x12')],_0x3213e6);_0x1449c6(_0x46f12c[_0x6367('0x18')](0x1f4,_0x102a08['message']));});});};exports['CreateCmHopper']=function(_0x331e77){var _0x1014c0=this;return new Promise(function(_0x46df78,_0x4215ca){return db[_0x6367('0x14')][_0x6367('0x19')](_0x331e77[_0x6367('0x1a')],{'raw':_0x331e77[_0x6367('0x9')]?_0x331e77[_0x6367('0x9')]['raw']===undefined?!![]:![]:!![]})[_0x6367('0xe')](function(_0x45ebdf){logger[_0x6367('0x17')](_0x6367('0x1b'),_0x331e77);logger[_0x6367('0xf')](_0x6367('0x1b'),_0x331e77,JSON['stringify'](_0x45ebdf));_0x46df78(_0x45ebdf);})['catch'](function(_0x116d80){logger['error'](_0x6367('0x1b'),_0x116d80['message'],_0x331e77);_0x4215ca(_0x1014c0[_0x6367('0x18')](0x1f4,_0x116d80[_0x6367('0x12')]));});});};exports[_0x6367('0x1c')]=function(_0x4ddf67){var _0x2e579d=this;return new Promise(function(_0x2b9e4e,_0x5880a1){return db[_0x6367('0x14')][_0x6367('0x1d')](_0x4ddf67[_0x6367('0x1a')],{'raw':_0x4ddf67[_0x6367('0x9')]?_0x4ddf67['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ddf67['options']?_0x4ddf67['options'][_0x6367('0x16')]||null:null,'attributes':_0x4ddf67[_0x6367('0x9')]?_0x4ddf67['options']['attributes']||null:null,'limit':_0x4ddf67['options']?_0x4ddf67['options'][_0x6367('0x1e')]||null:null})[_0x6367('0xe')](function(_0xd895f6){logger[_0x6367('0x17')](_0x6367('0x1c'),_0x4ddf67);logger[_0x6367('0x17')](_0x6367('0x1f'),JSON[_0x6367('0x10')](_0x4ddf67[_0x6367('0x9')]['where']),_0x4ddf67[_0x6367('0x1a')][_0x6367('0x20')]);logger['debug']('UpdateCmHopper',_0x4ddf67,JSON[_0x6367('0x10')](_0xd895f6));_0x2b9e4e(_0xd895f6);})[_0x6367('0x11')](function(_0x558f08){logger[_0x6367('0x18')](_0x6367('0x1c'),_0x558f08['message'],_0x4ddf67);_0x5880a1(_0x2e579d[_0x6367('0x18')](0x1f4,_0x558f08[_0x6367('0x12')]));});});};exports[_0x6367('0x21')]=function(_0x1beb27){var _0x44b439=this;return new Promise(function(_0x89d71b,_0x514fa9){return db[_0x6367('0x14')]['destroy']({'where':_0x1beb27[_0x6367('0x9')]?_0x1beb27['options']['where']||null:null})[_0x6367('0xe')](function(_0x1746b9){logger[_0x6367('0x17')](_0x6367('0x21'),_0x1beb27);logger[_0x6367('0xf')](_0x6367('0x21'),_0x1beb27,JSON['stringify'](_0x1746b9));_0x89d71b(_0x1746b9);})[_0x6367('0x11')](function(_0x16876c){logger['error'](_0x6367('0x21'),_0x16876c[_0x6367('0x12')],_0x1beb27);_0x514fa9(_0x44b439[_0x6367('0x18')](0x1f4,_0x16876c[_0x6367('0x12')]));});});};exports[_0x6367('0x22')]=function(_0x1c31bb){var _0x474ee8=this;return new Promise(function(_0x3bc55c,_0xbdd9ee){return db[_0x6367('0x23')][_0x6367('0x24')]()[_0x6367('0xe')](function(_0x4ca4aa){return db[_0x6367('0x25')][_0x6367('0x26')](function(_0x3a5de6){return db['CmHopper'][_0x6367('0x7')]({'where':_0x1c31bb[_0x6367('0x9')]?_0x1c31bb[_0x6367('0x9')][_0x6367('0x16')]||null:null,'attributes':_0x1c31bb[_0x6367('0x9')]?_0x1c31bb[_0x6367('0x9')][_0x6367('0xa')]||null:null,'limit':_0x1c31bb[_0x6367('0x9')]?_0x1c31bb[_0x6367('0x9')][_0x6367('0x1e')]||null:null,'order':_0x1c31bb[_0x6367('0x9')]?_0x1c31bb['options'][_0x6367('0x27')]||null:null,'transaction':_0x3a5de6,'lock':_0x3a5de6[_0x6367('0x28')][_0x6367('0x29')],'include':[{'model':db[_0x6367('0x23')],'as':'Contact','attributes':_[_0x6367('0x2a')](_0x4ca4aa)},{'model':db['User'],'as':_0x6367('0x2b'),'attributes':['id','name',_0x6367('0x2c')]}]})['then'](function(_0x27c6b5){var _0x3a679b=[];var _0x2f9625=[];for(var _0x199d5b=0x0;_0x199d5b<_0x27c6b5[_0x6367('0x2d')];_0x199d5b+=0x1){var _0x68ec11=_0x27c6b5[_0x199d5b]['UserId'];if(_0x68ec11===null){_0x3a679b[_0x6367('0x2e')](_0x27c6b5[_0x199d5b]['update'](_0x1c31bb['body'],{'transaction':_0x3a5de6}));}else if(!_0x2f9625[_0x6367('0x2f')](_0x68ec11)){_0x2f9625['push'](_0x68ec11);_0x3a679b[_0x6367('0x2e')](_0x27c6b5[_0x199d5b]['update'](_0x1c31bb[_0x6367('0x1a')],{'transaction':_0x3a5de6}));}}return BPromise['all'](_0x3a679b);});})['then'](function(_0x35ec4d){logger[_0x6367('0x17')]('GetContactDialer',_0x1c31bb);if(_0x35ec4d['length']>0x0){logger[_0x6367('0x17')](_0x6367('0x30'),_0x35ec4d[0x0][_0x6367('0x31')]['id'],_0x35ec4d[0x0][_0x6367('0x31')][_0x6367('0x32')],_0x35ec4d[0x0][_0x6367('0x31')]['active']);}logger[_0x6367('0xf')]('GetContactDialer',_0x1c31bb,JSON['stringify'](_0x35ec4d));_0x3bc55c(_0x35ec4d);})[_0x6367('0x11')](function(_0x343e36){logger[_0x6367('0x18')](_0x6367('0x22'),_0x343e36[_0x6367('0x12')],_0x1c31bb);_0xbdd9ee(_0x474ee8['error'](0x1f4,_0x343e36['message']));});});});};exports[_0x6367('0x33')]=function(_0x476ece){var _0x6ca6de=this;return new Promise(function(_0x12a5db,_0x516d00){return db['sequelize'][_0x6367('0x26')](function(_0x1a55e3){return db[_0x6367('0x34')][_0x6367('0x19')](_0x476ece['body'],{'raw':_0x476ece[_0x6367('0x9')]?_0x476ece[_0x6367('0x9')][_0x6367('0x8')]===undefined?!![]:![]:!![],'transaction':_0x1a55e3})['then'](function(){logger[_0x6367('0x17')](_0x6367('0x35'),JSON[_0x6367('0x10')](_0x476ece[_0x6367('0x9')][_0x6367('0x16')]),_0x476ece[_0x6367('0x9')][_0x6367('0x16')][_0x6367('0x20')]);return db[_0x6367('0x14')][_0x6367('0x36')]({'where':_0x476ece[_0x6367('0x9')]?_0x476ece[_0x6367('0x9')]['where']||null:null,'transaction':_0x1a55e3});});})[_0x6367('0xe')](function(_0x23d2a0){logger[_0x6367('0x17')]('MoveContactManagedDialer',_0x476ece);logger[_0x6367('0xf')](_0x6367('0x33'),_0x476ece,JSON[_0x6367('0x10')](_0x23d2a0));_0x12a5db(_0x23d2a0);})['catch'](function(_0x138b86){logger[_0x6367('0x18')](_0x6367('0x33'),_0x138b86[_0x6367('0x12')],_0x476ece);_0x516d00(_0x6ca6de[_0x6367('0x18')](0x1f4,_0x138b86[_0x6367('0x12')]));});});};exports[_0x6367('0x37')]=function(_0x33c65c){var _0x19d067=this;return new Promise(function(_0x47e021,_0x486eea){return db[_0x6367('0x14')][_0x6367('0x7')]({'raw':_0x33c65c[_0x6367('0x9')]?_0x33c65c[_0x6367('0x9')][_0x6367('0x8')]===undefined?!![]:![]:!![],'where':_0x33c65c[_0x6367('0x9')]?_0x33c65c[_0x6367('0x9')][_0x6367('0x16')]||null:null,'attributes':[[db[_0x6367('0x25')]['fn'](_0x6367('0x38'),db[_0x6367('0x25')]['fn']('IF',db[_0x6367('0x25')][_0x6367('0x39')](_0x6367('0x3a')+util[_0x6367('0x3b')](_0x6367('0x3c'),moment()[_0x6367('0x3b')](_0x6367('0x3d')))+_0x6367('0x3e')))),'contactsRescheduled']]})['then'](function(_0xba6c5f){logger[_0x6367('0x17')](_0x6367('0x37'),_0x33c65c);logger[_0x6367('0xf')]('CountReScheduled',_0x33c65c,JSON['stringify'](_0xba6c5f));_0x47e021(_0xba6c5f);})[_0x6367('0x11')](function(_0x58cd9f){logger[_0x6367('0x18')](_0x6367('0x37'),_0x58cd9f[_0x6367('0x12')],_0x33c65c);_0x486eea(_0x19d067[_0x6367('0x18')](0x1f4,_0x58cd9f['message']));});});};exports['GetContactRecallMe']=function(_0x5ee52f){var _0x3ca471=this;return new Promise(function(_0x4ddc63,_0x46df9a){return db[_0x6367('0x23')][_0x6367('0x24')]()['then'](function(){return db[_0x6367('0x25')]['transaction'](function(_0x2b4833){return db[_0x6367('0x14')]['findAll']({'where':_0x5ee52f[_0x6367('0x9')]?_0x5ee52f[_0x6367('0x9')]['where']||null:null,'attributes':_0x5ee52f[_0x6367('0x9')]?_0x5ee52f['options'][_0x6367('0xa')]||null:null,'limit':0x1,'order':_0x5ee52f[_0x6367('0x9')]?_0x5ee52f[_0x6367('0x9')][_0x6367('0x27')]||null:null,'group':db[_0x6367('0x14')][_0x6367('0x3f')],'transaction':_0x2b4833,'lock':_0x2b4833[_0x6367('0x28')][_0x6367('0x29')],'include':_0x5ee52f[_0x6367('0x9')]?_0x5ee52f[_0x6367('0x9')][_0x6367('0xb')]?_[_0x6367('0xc')](_0x5ee52f[_0x6367('0x9')][_0x6367('0xb')],function(_0x14d19e){return{'model':db[_0x14d19e['model']],'as':_0x14d19e['as'],'attributes':_0x14d19e[_0x6367('0xa')],'include':_0x14d19e[_0x6367('0xb')]?_[_0x6367('0xc')](_0x14d19e[_0x6367('0xb')],function(_0x39ced1){return{'model':db[_0x39ced1[_0x6367('0xd')]],'as':_0x39ced1['as'],'attributes':_0x39ced1[_0x6367('0xa')],'include':_0x39ced1[_0x6367('0xb')]?_[_0x6367('0xc')](_0x39ced1[_0x6367('0xb')],function(_0x25cddd){return{'model':db[_0x25cddd['model']],'as':_0x25cddd['as'],'attributes':_0x25cddd[_0x6367('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ae1ab){var _0x3179fe=[];for(var _0x1f3488=0x0;_0x1f3488<_0x1ae1ab[_0x6367('0x2d')];_0x1f3488+=0x1){_0x3179fe['push'](_0x1ae1ab[_0x1f3488][_0x6367('0x1d')](_0x5ee52f[_0x6367('0x1a')],{'transaction':_0x2b4833}));}return BPromise['all'](_0x3179fe);});})[_0x6367('0xe')](function(_0x2ad8a5){logger[_0x6367('0x17')](_0x6367('0x40'),_0x5ee52f);logger[_0x6367('0xf')]('GetContactRecallMe',_0x5ee52f,JSON[_0x6367('0x10')](_0x2ad8a5));_0x4ddc63(_0x2ad8a5);})[_0x6367('0x11')](function(_0x225d89){logger['error']('GetContactRecallMe',_0x225d89['message'],_0x5ee52f);_0x46df9a(_0x3ca471[_0x6367('0x18')](0x1f4,_0x225d89[_0x6367('0x12')]));});});});};exports['GetCmHopperPreview']=function(_0x3f8c1e){var _0x39107b=this;return new Promise(function(_0x1332e4,_0x2f4694){db[_0x6367('0x23')][_0x6367('0x24')]()['then'](function(_0x3cbefd){return db[_0x6367('0x14')][_0x6367('0x7')]({'raw':_0x3f8c1e['options']?_0x3f8c1e[_0x6367('0x9')][_0x6367('0x8')]===undefined?!![]:![]:!![],'where':_0x3f8c1e[_0x6367('0x9')]?_0x3f8c1e['options'][_0x6367('0x16')]||null:null,'attributes':_0x3f8c1e['options']?_0x3f8c1e['options'][_0x6367('0xa')]||null:null,'limit':_0x3f8c1e[_0x6367('0x9')]?_0x3f8c1e['options'][_0x6367('0x1e')]||null:null,'include':_0x3f8c1e['options']?_0x3f8c1e['options'][_0x6367('0xb')]?_['map'](_0x3f8c1e[_0x6367('0x9')][_0x6367('0xb')],function(_0x40d716){return{'model':db[_0x40d716[_0x6367('0xd')]],'as':_0x40d716['as'],'attributes':_0x40d716['as']==='Contact'?_[_0x6367('0x2a')](_0x3cbefd):_0x40d716[_0x6367('0xa')],'include':_0x40d716['include']?_[_0x6367('0xc')](_0x40d716[_0x6367('0xb')],function(_0x3e4042){return{'model':db[_0x3e4042[_0x6367('0xd')]],'as':_0x3e4042['as'],'attributes':_0x3e4042[_0x6367('0xa')],'include':_0x3e4042[_0x6367('0xb')]?_[_0x6367('0xc')](_0x3e4042[_0x6367('0xb')],function(_0x10f192){return{'model':db[_0x10f192[_0x6367('0xd')]],'as':_0x10f192['as'],'attributes':_0x10f192['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a89cc){logger[_0x6367('0x17')](_0x6367('0x6'),_0x3f8c1e);logger[_0x6367('0xf')]('GetCmHopper',_0x3f8c1e,JSON[_0x6367('0x10')](_0x3a89cc));_0x1332e4(_0x3a89cc);})[_0x6367('0x11')](function(_0x5e578d){logger[_0x6367('0x18')]('GetCmHopper',_0x5e578d[_0x6367('0x12')],_0x3f8c1e);_0x2f4694(_0x39107b[_0x6367('0x18')](0x1f4,_0x5e578d[_0x6367('0x12')]));});});});};exports[_0x6367('0x41')]=function(_0x419800){var _0x2b1d30=this;return new Promise(function(_0x4ad4df,_0x4cbff3){return db[_0x6367('0x23')][_0x6367('0x42')]({'raw':!![],'where':{'phone':_0x419800['options'][_0x6367('0x16')][_0x6367('0x43')]},'attributes':['id',_0x6367('0x44')],'order':[['id',_0x6367('0x45')]]})['then'](function(_0x1e2a94){logger[_0x6367('0x17')](_0x6367('0x46'),_0x419800);logger[_0x6367('0xf')](_0x6367('0x46'),_0x419800,JSON[_0x6367('0x10')](_0x1e2a94));_0x4ad4df(_0x1e2a94);})[_0x6367('0x11')](function(_0x3e06eb){logger[_0x6367('0x18')](_0x6367('0x46'),_0x3e06eb[_0x6367('0x12')],_0x419800);_0x4cbff3(_0x2b1d30['error'](0x1f4,_0x3e06eb[_0x6367('0x12')]));});});};exports['ResetActiveCalls']=function(_0x43f08f){var _0x32f611=this;return new Promise(function(_0x32cb7e,_0x57b327){return db['sequelize']['transaction'](function(_0x3be944){var _0xaf3e9b=_0x43f08f[_0x6367('0x9')]&&_0x43f08f[_0x6367('0x9')]['where']?_0x43f08f[_0x6367('0x9')]['where']:{};return db[_0x6367('0x14')][_0x6367('0x1d')](_0x43f08f['body'],{'where':_0xaf3e9b,'transaction':_0x3be944})[_0x6367('0xe')](function(_0x466fe8){logger[_0x6367('0x17')]('ResetActiveCalls',_0x43f08f);logger[_0x6367('0xf')](_0x6367('0x47'),_0x43f08f,JSON[_0x6367('0x10')](_0x466fe8));_0x32cb7e(_0x466fe8);})[_0x6367('0x11')](function(_0x17eefc){logger[_0x6367('0x18')]('ResetActiveCalls',_0x17eefc[_0x6367('0x12')],_0x43f08f);_0x57b327(_0x32f611[_0x6367('0x18')](0x1f4,_0x17eefc['message']));});});});};exports[_0x6367('0x48')]=function(_0x1b8ab8){var _0x530ab1=this;var _0x24ad8e=_0x1b8ab8[_0x6367('0x1a')]['where'][_0x6367('0x49')];var _0x49c92b=_0x1b8ab8['body'][_0x6367('0x16')][_0x6367('0x4a')];var _0x5c8c96=_0x1b8ab8[_0x6367('0x1a')][_0x6367('0x16')][_0x6367('0x4b')];return new Promise(function(_0x1227be,_0x36f6bc){return db[_0x6367('0x14')]['findAll']({'where':{'voiceQueueId':{'$in':_0x24ad8e},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x6367('0x25')][_0x6367('0x39')](_0x6367('0x4c')+_0x49c92b+_0x6367('0x4d')),'$gt':db[_0x6367('0x25')][_0x6367('0x39')](_0x6367('0x4e'))}},'UserId':{'$in':_0x5c8c96}},'include':[{'model':db['CmContact'],'as':'Contact'},{'model':db[_0x6367('0x4f')],'as':_0x6367('0x2b'),'attributes':['id',_0x6367('0x50'),_0x6367('0x2c')]},{'model':db[_0x6367('0x51')],'as':'List'}]})[_0x6367('0xe')](function(_0x131bab){if(_0x131bab[_0x6367('0x2d')]>0x0){return db[_0x6367('0x25')]['transaction'](function(_0x54311a){return db[_0x6367('0x14')][_0x6367('0x1d')]({'recallmeNotifiedDate':db[_0x6367('0x25')][_0x6367('0x39')]('NOW()')},{'where':{'id':{'$in':_[_0x6367('0xc')](_0x131bab,'id')}},'transaction':_0x54311a})[_0x6367('0xe')](function(){_0x1227be(_0x131bab);})['catch'](function(_0x4d9208){logger['error'](_0x6367('0x48'),_0x4d9208[_0x6367('0x12')],_0x1b8ab8);_0x36f6bc(_0x530ab1[_0x6367('0x18')](0x1f4,_0x4d9208[_0x6367('0x12')]));});})['catch'](function(_0x3a9b2f){logger[_0x6367('0x18')](_0x6367('0x48'),_0x3a9b2f[_0x6367('0x12')],_0x1b8ab8);_0x36f6bc(_0x530ab1[_0x6367('0x18')](0x1f4,_0x3a9b2f[_0x6367('0x12')]));});}else{_0x1227be(_0x131bab);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index f95faab..b0dc899 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 _0x7f4b=['../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','describe','getOpenContacts','/timezones','/:id','getPreviewRecall','post','/preview','getPreview','getTimezone','update','destroy','exports','express','Router'];(function(_0x19017b,_0x56d52c){var _0x3becdc=function(_0x1e0fde){while(--_0x1e0fde){_0x19017b['push'](_0x19017b['shift']());}};_0x3becdc(++_0x56d52c);}(_0x7f4b,0x17a));var _0xb7f4=function(_0x15dafa,_0x3bd9b2){_0x15dafa=_0x15dafa-0x0;var _0x390812=_0x7f4b[_0x15dafa];return _0x390812;};'use strict';var express=require(_0xb7f4('0x0'));var router=express[_0xb7f4('0x1')]();var auth=require(_0xb7f4('0x2'));var controller=require(_0xb7f4('0x3'));router[_0xb7f4('0x4')]('/',auth[_0xb7f4('0x5')](),controller[_0xb7f4('0x6')]);router[_0xb7f4('0x4')]('/describe',auth['isAuthenticated'](),controller[_0xb7f4('0x7')]);router['get']('/opencontacts',auth[_0xb7f4('0x5')](),controller[_0xb7f4('0x8')]);router[_0xb7f4('0x4')](_0xb7f4('0x9'),auth[_0xb7f4('0x5')](),controller['getTimezones']);router['get'](_0xb7f4('0xa'),auth[_0xb7f4('0x5')](),controller['show']);router[_0xb7f4('0x4')]('/:id/previewrecall',auth['isAuthenticated'](),controller[_0xb7f4('0xb')]);router[_0xb7f4('0xc')]('/',auth[_0xb7f4('0x5')](),controller['create']);router[_0xb7f4('0xc')](_0xb7f4('0xd'),auth[_0xb7f4('0x5')](),controller[_0xb7f4('0xe')]);router['post']('/timezone',auth[_0xb7f4('0x5')](),controller[_0xb7f4('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb7f4('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb7f4('0x11')]);module[_0xb7f4('0x12')]=router; \ No newline at end of file +var _0x5a7e=['/preview','getPreview','getTimezone','put','update','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','get','/describe','getOpenContacts','/timezones','getTimezones','/:id','show','post','create'];(function(_0x62b23c,_0xd30b47){var _0x12436b=function(_0x217d64){while(--_0x217d64){_0x62b23c['push'](_0x62b23c['shift']());}};_0x12436b(++_0xd30b47);}(_0x5a7e,0x14a));var _0xe5a7=function(_0x1dfb39,_0x43448f){_0x1dfb39=_0x1dfb39-0x0;var _0x51a58e=_0x5a7e[_0x1dfb39];return _0x51a58e;};'use strict';var express=require(_0xe5a7('0x0'));var router=express[_0xe5a7('0x1')]();var auth=require(_0xe5a7('0x2'));var controller=require(_0xe5a7('0x3'));router['get']('/',auth[_0xe5a7('0x4')](),controller[_0xe5a7('0x5')]);router[_0xe5a7('0x6')](_0xe5a7('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0xe5a7('0x6')]('/opencontacts',auth[_0xe5a7('0x4')](),controller[_0xe5a7('0x8')]);router[_0xe5a7('0x6')](_0xe5a7('0x9'),auth['isAuthenticated'](),controller[_0xe5a7('0xa')]);router[_0xe5a7('0x6')](_0xe5a7('0xb'),auth[_0xe5a7('0x4')](),controller[_0xe5a7('0xc')]);router[_0xe5a7('0x6')]('/:id/previewrecall',auth[_0xe5a7('0x4')](),controller['getPreviewRecall']);router[_0xe5a7('0xd')]('/',auth[_0xe5a7('0x4')](),controller[_0xe5a7('0xe')]);router['post'](_0xe5a7('0xf'),auth[_0xe5a7('0x4')](),controller[_0xe5a7('0x10')]);router[_0xe5a7('0xd')]('/timezone',auth[_0xe5a7('0x4')](),controller[_0xe5a7('0x11')]);router[_0xe5a7('0x12')](_0xe5a7('0xb'),auth[_0xe5a7('0x4')](),controller[_0xe5a7('0x13')]);router[_0xe5a7('0x14')](_0xe5a7('0xb'),auth[_0xe5a7('0x4')](),controller[_0xe5a7('0x15')]);module[_0xe5a7('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 9f2897a..a9a11e8 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 _0x7ce6=['INTEGER','moment','sequelize','exports','STRING','format'];(function(_0x55c050,_0x25a3f5){var _0x1b1ca1=function(_0x5837f5){while(--_0x5837f5){_0x55c050['push'](_0x55c050['shift']());}};_0x1b1ca1(++_0x25a3f5);}(_0x7ce6,0xaf));var _0x67ce=function(_0x3f06b2,_0x535a4d){_0x3f06b2=_0x3f06b2-0x0;var _0x1eb0f0=_0x7ce6[_0x3f06b2];return _0x1eb0f0;};'use strict';var moment=require(_0x67ce('0x0'));var Sequelize=require(_0x67ce('0x1'));module[_0x67ce('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x67ce('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x67ce('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x67ce('0x5')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x67ce('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x67ce('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x67ce('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x67ce('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e88=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','INTEGER'];(function(_0x1442bb,_0x1f994e){var _0x1d9b35=function(_0x2c925e){while(--_0x2c925e){_0x1442bb['push'](_0x1442bb['shift']());}};_0x1d9b35(++_0x1f994e);}(_0x8e88,0x165));var _0x88e8=function(_0x36a469,_0x59d84c){_0x36a469=_0x36a469-0x0;var _0x3347fc=_0x8e88[_0x36a469];return _0x3347fc;};'use strict';var moment=require(_0x88e8('0x0'));var Sequelize=require('sequelize');module[_0x88e8('0x1')]={'CmHopperId':{'type':Sequelize[_0x88e8('0x2')]},'phone':{'type':Sequelize[_0x88e8('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x88e8('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x88e8('0x4')](_0x88e8('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x88e8('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x88e8('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x88e8('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x88e8('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x88e8('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x88e8('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 fe30e6d..9ca7479 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 _0xaa50=['filters','pick','merge','type','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','CmHopperAdditionalPhones','destroy','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xaa50,0x68));var _0x0aa5=function(_0x6ce39b,_0x4e3ca9){_0x6ce39b=_0x6ce39b-0x0;var _0x3587db=_0xaa50[_0x6ce39b];return _0x3587db;};'use strict';var emlformat=require(_0x0aa5('0x0'));var rimraf=require(_0x0aa5('0x1'));var zipdir=require(_0x0aa5('0x2'));var jsonpatch=require(_0x0aa5('0x3'));var rp=require(_0x0aa5('0x4'));var moment=require(_0x0aa5('0x5'));var BPromise=require(_0x0aa5('0x6'));var Mustache=require(_0x0aa5('0x7'));var util=require(_0x0aa5('0x8'));var path=require(_0x0aa5('0x9'));var sox=require(_0x0aa5('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0aa5('0xb'));var _=require(_0x0aa5('0xc'));var squel=require(_0x0aa5('0xd'));var crypto=require(_0x0aa5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0aa5('0xf'));var toCsv=require(_0x0aa5('0x10'));var querystring=require(_0x0aa5('0x11'));var Papa=require('papaparse');var Redis=require(_0x0aa5('0x12'));var authService=require(_0x0aa5('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0aa5('0x14'));var licenseUtil=require(_0x0aa5('0x15'));var db=require(_0x0aa5('0x16'))['db'];function respondWithStatusCode(_0x1dd571,_0x34e060){_0x34e060=_0x34e060||0xcc;return function(_0x5b80b9){if(_0x5b80b9){return _0x1dd571[_0x0aa5('0x17')](_0x34e060);}return _0x1dd571[_0x0aa5('0x18')](_0x34e060)[_0x0aa5('0x19')]();};}function respondWithResult(_0x256f20,_0x26eb95){_0x26eb95=_0x26eb95||0xc8;return function(_0x5db81c){if(_0x5db81c){return _0x256f20[_0x0aa5('0x18')](_0x26eb95)[_0x0aa5('0x1a')](_0x5db81c);}};}function respondWithFilteredResult(_0x231e2b,_0x4e561c){return function(_0x44c645){if(_0x44c645){var _0x1f776e=typeof _0x4e561c[_0x0aa5('0x1b')]===_0x0aa5('0x1c')&&typeof _0x4e561c[_0x0aa5('0x1d')]==='undefined';var _0x4d216f=_0x44c645[_0x0aa5('0x1e')];var _0x60573=_0x1f776e?0x0:_0x4e561c[_0x0aa5('0x1b')];var _0x2b5976=_0x1f776e?_0x44c645[_0x0aa5('0x1e')]:_0x4e561c[_0x0aa5('0x1b')]+_0x4e561c[_0x0aa5('0x1d')];var _0xa01b35;if(_0x2b5976>=_0x4d216f){_0x2b5976=_0x4d216f;_0xa01b35=0xc8;}else{_0xa01b35=0xce;}_0x231e2b[_0x0aa5('0x18')](_0xa01b35);return _0x231e2b['set'](_0x0aa5('0x1f'),_0x60573+'-'+_0x2b5976+'/'+_0x4d216f)['json'](_0x44c645);}return null;};}function patchUpdates(_0x28de2a){return function(_0x492be9){try{jsonpatch[_0x0aa5('0x20')](_0x492be9,_0x28de2a,!![]);}catch(_0x5e0b37){return BPromise[_0x0aa5('0x21')](_0x5e0b37);}return _0x492be9['save']();};}function saveUpdates(_0x5b7038,_0x451d92){return function(_0x50f82b){if(_0x50f82b){return _0x50f82b[_0x0aa5('0x22')](_0x5b7038)[_0x0aa5('0x23')](function(_0x1ee277){return _0x1ee277;});}return null;};}function removeEntity(_0x4c3964,_0x5083db){return function(_0x13a2d5){if(_0x13a2d5){return _0x13a2d5['destroy']()['then'](function(){var _0xf39661=_0x13a2d5[_0x0aa5('0x24')]({'plain':!![]});var _0x9c81b8=_0x0aa5('0x25');return db['UserProfileResource'][_0x0aa5('0x26')]({'where':{'type':_0x9c81b8,'resourceId':_0xf39661['id']}})[_0x0aa5('0x23')](function(){return _0x13a2d5;});})['then'](function(){_0x4c3964[_0x0aa5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x993190,_0x2501af){return function(_0x49302f){if(!_0x49302f){_0x993190[_0x0aa5('0x17')](0x194);}return _0x49302f;};}function handleError(_0x5d3c3c,_0x3d7014){_0x3d7014=_0x3d7014||0x1f4;return function(_0x2319ff){logger[_0x0aa5('0x27')](_0x2319ff[_0x0aa5('0x28')]);if(_0x2319ff['name']){delete _0x2319ff[_0x0aa5('0x29')];}_0x5d3c3c[_0x0aa5('0x18')](_0x3d7014)[_0x0aa5('0x2a')](_0x2319ff);};}exports[_0x0aa5('0x2b')]=function(_0x1c6b54,_0x4e11c9){var _0x57202c={},_0x36ad84={},_0x2ef1ae={'count':0x0,'rows':[]};var _0x1c3cb6=_[_0x0aa5('0x2c')](db[_0x0aa5('0x2d')][_0x0aa5('0x2e')],function(_0xd8469d){return{'name':_0xd8469d[_0x0aa5('0x2f')],'type':_0xd8469d['type']['key']};});_0x36ad84['model']=_[_0x0aa5('0x2c')](_0x1c3cb6,_0x0aa5('0x29'));_0x36ad84[_0x0aa5('0x30')]=_[_0x0aa5('0x31')](_0x1c6b54[_0x0aa5('0x30')]);_0x36ad84['filters']=_[_0x0aa5('0x32')](_0x36ad84[_0x0aa5('0x33')],_0x36ad84[_0x0aa5('0x30')]);_0x57202c[_0x0aa5('0x34')]=_['intersection'](_0x36ad84['model'],qs[_0x0aa5('0x35')](_0x1c6b54[_0x0aa5('0x30')][_0x0aa5('0x35')]));_0x57202c['attributes']=_0x57202c[_0x0aa5('0x34')][_0x0aa5('0x36')]?_0x57202c['attributes']:_0x36ad84['model'];if(!_0x1c6b54[_0x0aa5('0x30')]['hasOwnProperty'](_0x0aa5('0x37'))){_0x57202c[_0x0aa5('0x1d')]=qs[_0x0aa5('0x1d')](_0x1c6b54[_0x0aa5('0x30')]['limit']);_0x57202c[_0x0aa5('0x1b')]=qs[_0x0aa5('0x1b')](_0x1c6b54[_0x0aa5('0x30')][_0x0aa5('0x1b')]);}_0x57202c['order']=qs[_0x0aa5('0x38')](_0x1c6b54[_0x0aa5('0x30')]['sort']);_0x57202c[_0x0aa5('0x39')]=qs[_0x0aa5('0x3a')](_[_0x0aa5('0x3b')](_0x1c6b54[_0x0aa5('0x30')],_0x36ad84[_0x0aa5('0x3a')]),_0x1c3cb6);if(_0x1c6b54['query']['filter']){_0x57202c[_0x0aa5('0x39')]=_[_0x0aa5('0x3c')](_0x57202c[_0x0aa5('0x39')],{'$or':_[_0x0aa5('0x2c')](_0x1c3cb6,function(_0x153ffe){if(_0x153ffe[_0x0aa5('0x3d')]!=='VIRTUAL'){var _0x280a6d={};_0x280a6d[_0x153ffe[_0x0aa5('0x29')]]={'$like':'%'+_0x1c6b54[_0x0aa5('0x30')][_0x0aa5('0x3e')]+'%'};return _0x280a6d;}})});}_0x57202c=_[_0x0aa5('0x3c')]({},_0x57202c,_0x1c6b54[_0x0aa5('0x3f')]);var _0x525579={'where':_0x57202c['where']};return db['CmHopperAdditionalPhone']['count'](_0x525579)[_0x0aa5('0x23')](function(_0x577a30){_0x2ef1ae['count']=_0x577a30;if(_0x1c6b54[_0x0aa5('0x30')][_0x0aa5('0x40')]){_0x57202c['include']=[{'all':!![]}];}return db[_0x0aa5('0x2d')][_0x0aa5('0x41')](_0x57202c);})[_0x0aa5('0x23')](function(_0x4f8150){_0x2ef1ae[_0x0aa5('0x42')]=_0x4f8150;return _0x2ef1ae;})['then'](respondWithFilteredResult(_0x4e11c9,_0x57202c))[_0x0aa5('0x43')](handleError(_0x4e11c9,null));};exports[_0x0aa5('0x44')]=function(_0x3ecb86,_0x349b75){var _0x1c87ec={'raw':!![],'where':{'id':_0x3ecb86[_0x0aa5('0x45')]['id']}},_0x5c895={};_0x5c895[_0x0aa5('0x33')]=_[_0x0aa5('0x31')](db[_0x0aa5('0x2d')][_0x0aa5('0x2e')]);_0x5c895[_0x0aa5('0x30')]=_[_0x0aa5('0x31')](_0x3ecb86[_0x0aa5('0x30')]);_0x5c895['filters']=_[_0x0aa5('0x32')](_0x5c895[_0x0aa5('0x33')],_0x5c895[_0x0aa5('0x30')]);_0x1c87ec[_0x0aa5('0x34')]=_['intersection'](_0x5c895[_0x0aa5('0x33')],qs['fields'](_0x3ecb86['query'][_0x0aa5('0x35')]));_0x1c87ec[_0x0aa5('0x34')]=_0x1c87ec[_0x0aa5('0x34')][_0x0aa5('0x36')]?_0x1c87ec[_0x0aa5('0x34')]:_0x5c895[_0x0aa5('0x33')];if(_0x3ecb86[_0x0aa5('0x30')][_0x0aa5('0x40')]){_0x1c87ec[_0x0aa5('0x46')]=[{'all':!![]}];}_0x1c87ec=_[_0x0aa5('0x3c')]({},_0x1c87ec,_0x3ecb86[_0x0aa5('0x3f')]);return db[_0x0aa5('0x2d')][_0x0aa5('0x47')](_0x1c87ec)['then'](handleEntityNotFound(_0x349b75,null))['then'](respondWithResult(_0x349b75,null))[_0x0aa5('0x43')](handleError(_0x349b75,null));};exports['create']=function(_0x356aff,_0x3d02a9){return db[_0x0aa5('0x2d')][_0x0aa5('0x48')](_0x356aff[_0x0aa5('0x49')],{})[_0x0aa5('0x23')](function(_0x1d8a5c){var _0x4e3315=_0x356aff['user']['get']({'plain':!![]});if(!_0x4e3315)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e3315[_0x0aa5('0x4a')]===_0x0aa5('0x4b')){var _0x268659=_0x1d8a5c[_0x0aa5('0x24')]({'plain':!![]});var _0x408412=_0x0aa5('0x25');return db[_0x0aa5('0x4c')][_0x0aa5('0x47')]({'where':{'name':_0x408412,'userProfileId':_0x4e3315[_0x0aa5('0x4d')]},'raw':!![]})[_0x0aa5('0x23')](function(_0x4583e3){if(_0x4583e3&&_0x4583e3[_0x0aa5('0x4e')]===0x0){return db[_0x0aa5('0x4f')][_0x0aa5('0x48')]({'name':_0x268659['name'],'resourceId':_0x268659['id'],'type':_0x4583e3[_0x0aa5('0x29')],'sectionId':_0x4583e3['id']},{})[_0x0aa5('0x23')](function(){return _0x1d8a5c;});}else{return _0x1d8a5c;}})[_0x0aa5('0x43')](function(_0x29ce40){logger[_0x0aa5('0x27')](_0x0aa5('0x50'),_0x29ce40);throw _0x29ce40;});}return _0x1d8a5c;})[_0x0aa5('0x23')](respondWithResult(_0x3d02a9,0xc9))['catch'](handleError(_0x3d02a9,null));};exports['update']=function(_0x1254cd,_0x957897){if(_0x1254cd[_0x0aa5('0x49')]['id']){delete _0x1254cd['body']['id'];}return db['CmHopperAdditionalPhone'][_0x0aa5('0x47')]({'where':{'id':_0x1254cd['params']['id']}})[_0x0aa5('0x23')](handleEntityNotFound(_0x957897,null))[_0x0aa5('0x23')](saveUpdates(_0x1254cd['body'],null))[_0x0aa5('0x23')](respondWithResult(_0x957897,null))[_0x0aa5('0x43')](handleError(_0x957897,null));};exports[_0x0aa5('0x26')]=function(_0x49813c,_0x1e481b){return db[_0x0aa5('0x2d')][_0x0aa5('0x47')]({'where':{'id':_0x49813c[_0x0aa5('0x45')]['id']}})[_0x0aa5('0x23')](handleEntityNotFound(_0x1e481b,null))[_0x0aa5('0x23')](removeEntity(_0x1e481b,null))[_0x0aa5('0x43')](handleError(_0x1e481b,null));}; \ No newline at end of file +var _0xaf98=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','update','then','destroy','get','CmHopperAdditionalPhones','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x5b7a17,_0x5336ea){var _0x1f42d8=function(_0x1f853a){while(--_0x1f853a){_0x5b7a17['push'](_0x5b7a17['shift']());}};_0x1f42d8(++_0x5336ea);}(_0xaf98,0xa0));var _0x8af9=function(_0x2d2376,_0x5080bc){_0x2d2376=_0x2d2376-0x0;var _0x993785=_0xaf98[_0x2d2376];return _0x993785;};'use strict';var emlformat=require(_0x8af9('0x0'));var rimraf=require(_0x8af9('0x1'));var zipdir=require(_0x8af9('0x2'));var jsonpatch=require(_0x8af9('0x3'));var rp=require(_0x8af9('0x4'));var moment=require(_0x8af9('0x5'));var BPromise=require(_0x8af9('0x6'));var Mustache=require('mustache');var util=require(_0x8af9('0x7'));var path=require(_0x8af9('0x8'));var sox=require(_0x8af9('0x9'));var csv=require(_0x8af9('0xa'));var ejs=require(_0x8af9('0xb'));var fs=require('fs');var fs_extra=require(_0x8af9('0xc'));var _=require(_0x8af9('0xd'));var squel=require(_0x8af9('0xe'));var crypto=require('crypto');var jsforce=require(_0x8af9('0xf'));var deskjs=require(_0x8af9('0x10'));var toCsv=require(_0x8af9('0xa'));var querystring=require(_0x8af9('0x11'));var Papa=require(_0x8af9('0x12'));var Redis=require(_0x8af9('0x13'));var authService=require(_0x8af9('0x14'));var qs=require(_0x8af9('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8af9('0x16'))('api');var utils=require(_0x8af9('0x17'));var config=require(_0x8af9('0x18'));var licenseUtil=require(_0x8af9('0x19'));var db=require(_0x8af9('0x1a'))['db'];function respondWithStatusCode(_0x2a03d2,_0x32a9bc){_0x32a9bc=_0x32a9bc||0xcc;return function(_0xeb477a){if(_0xeb477a){return _0x2a03d2[_0x8af9('0x1b')](_0x32a9bc);}return _0x2a03d2['status'](_0x32a9bc)[_0x8af9('0x1c')]();};}function respondWithResult(_0x40f04e,_0x3e32f2){_0x3e32f2=_0x3e32f2||0xc8;return function(_0x3fa50a){if(_0x3fa50a){return _0x40f04e[_0x8af9('0x1d')](_0x3e32f2)['json'](_0x3fa50a);}};}function respondWithFilteredResult(_0x3350da,_0x2b228f){return function(_0x36871f){if(_0x36871f){var _0x53b03b=typeof _0x2b228f['offset']===_0x8af9('0x1e')&&typeof _0x2b228f[_0x8af9('0x1f')]===_0x8af9('0x1e');var _0x235822=_0x36871f['count'];var _0x34e265=_0x53b03b?0x0:_0x2b228f[_0x8af9('0x20')];var _0x3be9e8=_0x53b03b?_0x36871f[_0x8af9('0x21')]:_0x2b228f['offset']+_0x2b228f[_0x8af9('0x1f')];var _0x417276;if(_0x3be9e8>=_0x235822){_0x3be9e8=_0x235822;_0x417276=0xc8;}else{_0x417276=0xce;}_0x3350da[_0x8af9('0x1d')](_0x417276);return _0x3350da[_0x8af9('0x22')](_0x8af9('0x23'),_0x34e265+'-'+_0x3be9e8+'/'+_0x235822)[_0x8af9('0x24')](_0x36871f);}return null;};}function patchUpdates(_0xb00967){return function(_0x453859){try{jsonpatch[_0x8af9('0x25')](_0x453859,_0xb00967,!![]);}catch(_0x3294d8){return BPromise[_0x8af9('0x26')](_0x3294d8);}return _0x453859['save']();};}function saveUpdates(_0x4ac771,_0x5af315){return function(_0x3f53cd){if(_0x3f53cd){return _0x3f53cd[_0x8af9('0x27')](_0x4ac771)[_0x8af9('0x28')](function(_0x1d0122){return _0x1d0122;});}return null;};}function removeEntity(_0x5c299e,_0x1e0b8a){return function(_0xc99ba6){if(_0xc99ba6){return _0xc99ba6[_0x8af9('0x29')]()[_0x8af9('0x28')](function(){var _0x29d819=_0xc99ba6[_0x8af9('0x2a')]({'plain':!![]});var _0x5bccd0=_0x8af9('0x2b');return db['UserProfileResource'][_0x8af9('0x29')]({'where':{'type':_0x5bccd0,'resourceId':_0x29d819['id']}})[_0x8af9('0x28')](function(){return _0xc99ba6;});})[_0x8af9('0x28')](function(){_0x5c299e[_0x8af9('0x1d')](0xcc)[_0x8af9('0x1c')]();});}};}function handleEntityNotFound(_0x33de8a,_0x37147b){return function(_0x35bc42){if(!_0x35bc42){_0x33de8a[_0x8af9('0x1b')](0x194);}return _0x35bc42;};}function handleError(_0x4b9ab2,_0x16c0b3){_0x16c0b3=_0x16c0b3||0x1f4;return function(_0x459911){logger['error'](_0x459911['stack']);if(_0x459911[_0x8af9('0x2c')]){delete _0x459911[_0x8af9('0x2c')];}_0x4b9ab2[_0x8af9('0x1d')](_0x16c0b3)[_0x8af9('0x2d')](_0x459911);};}exports[_0x8af9('0x2e')]=function(_0x38d269,_0x49fe95){var _0x287ed0={},_0xba74ac={},_0x41dc2a={'count':0x0,'rows':[]};var _0x3bc0c1=_[_0x8af9('0x2f')](db[_0x8af9('0x30')][_0x8af9('0x31')],function(_0x45fbdf){return{'name':_0x45fbdf[_0x8af9('0x32')],'type':_0x45fbdf[_0x8af9('0x33')][_0x8af9('0x34')]};});_0xba74ac[_0x8af9('0x35')]=_['map'](_0x3bc0c1,_0x8af9('0x2c'));_0xba74ac[_0x8af9('0x36')]=_[_0x8af9('0x37')](_0x38d269['query']);_0xba74ac['filters']=_[_0x8af9('0x38')](_0xba74ac['model'],_0xba74ac['query']);_0x287ed0[_0x8af9('0x39')]=_[_0x8af9('0x38')](_0xba74ac[_0x8af9('0x35')],qs[_0x8af9('0x3a')](_0x38d269['query'][_0x8af9('0x3a')]));_0x287ed0[_0x8af9('0x39')]=_0x287ed0['attributes'][_0x8af9('0x3b')]?_0x287ed0[_0x8af9('0x39')]:_0xba74ac['model'];if(!_0x38d269[_0x8af9('0x36')][_0x8af9('0x3c')](_0x8af9('0x3d'))){_0x287ed0[_0x8af9('0x1f')]=qs[_0x8af9('0x1f')](_0x38d269[_0x8af9('0x36')][_0x8af9('0x1f')]);_0x287ed0[_0x8af9('0x20')]=qs[_0x8af9('0x20')](_0x38d269[_0x8af9('0x36')]['offset']);}_0x287ed0[_0x8af9('0x3e')]=qs[_0x8af9('0x3f')](_0x38d269[_0x8af9('0x36')]['sort']);_0x287ed0[_0x8af9('0x40')]=qs[_0x8af9('0x41')](_[_0x8af9('0x42')](_0x38d269[_0x8af9('0x36')],_0xba74ac['filters']),_0x3bc0c1);if(_0x38d269[_0x8af9('0x36')][_0x8af9('0x43')]){_0x287ed0[_0x8af9('0x40')]=_[_0x8af9('0x44')](_0x287ed0['where'],{'$or':_['map'](_0x3bc0c1,function(_0x129364){if(_0x129364['type']!=='VIRTUAL'){var _0x3ab01e={};_0x3ab01e[_0x129364['name']]={'$like':'%'+_0x38d269[_0x8af9('0x36')][_0x8af9('0x43')]+'%'};return _0x3ab01e;}})});}_0x287ed0=_[_0x8af9('0x44')]({},_0x287ed0,_0x38d269[_0x8af9('0x45')]);var _0x4205de={'where':_0x287ed0[_0x8af9('0x40')]};return db[_0x8af9('0x30')]['count'](_0x4205de)['then'](function(_0x452e26){_0x41dc2a[_0x8af9('0x21')]=_0x452e26;if(_0x38d269[_0x8af9('0x36')][_0x8af9('0x46')]){_0x287ed0['include']=[{'all':!![]}];}return db[_0x8af9('0x30')][_0x8af9('0x47')](_0x287ed0);})[_0x8af9('0x28')](function(_0x7aa974){_0x41dc2a['rows']=_0x7aa974;return _0x41dc2a;})[_0x8af9('0x28')](respondWithFilteredResult(_0x49fe95,_0x287ed0))[_0x8af9('0x48')](handleError(_0x49fe95,null));};exports[_0x8af9('0x49')]=function(_0x18e31a,_0x46506b){var _0x512e1d={'raw':!![],'where':{'id':_0x18e31a[_0x8af9('0x4a')]['id']}},_0x53d1c9={};_0x53d1c9[_0x8af9('0x35')]=_[_0x8af9('0x37')](db[_0x8af9('0x30')][_0x8af9('0x31')]);_0x53d1c9[_0x8af9('0x36')]=_[_0x8af9('0x37')](_0x18e31a[_0x8af9('0x36')]);_0x53d1c9[_0x8af9('0x41')]=_[_0x8af9('0x38')](_0x53d1c9['model'],_0x53d1c9[_0x8af9('0x36')]);_0x512e1d[_0x8af9('0x39')]=_['intersection'](_0x53d1c9[_0x8af9('0x35')],qs[_0x8af9('0x3a')](_0x18e31a[_0x8af9('0x36')]['fields']));_0x512e1d[_0x8af9('0x39')]=_0x512e1d[_0x8af9('0x39')][_0x8af9('0x3b')]?_0x512e1d[_0x8af9('0x39')]:_0x53d1c9[_0x8af9('0x35')];if(_0x18e31a['query']['includeAll']){_0x512e1d[_0x8af9('0x4b')]=[{'all':!![]}];}_0x512e1d=_['merge']({},_0x512e1d,_0x18e31a[_0x8af9('0x45')]);return db['CmHopperAdditionalPhone']['find'](_0x512e1d)[_0x8af9('0x28')](handleEntityNotFound(_0x46506b,null))[_0x8af9('0x28')](respondWithResult(_0x46506b,null))[_0x8af9('0x48')](handleError(_0x46506b,null));};exports[_0x8af9('0x4c')]=function(_0x3fe3ad,_0x7512fa){return db[_0x8af9('0x30')]['create'](_0x3fe3ad['body'],{})[_0x8af9('0x28')](function(_0x346fe5){var _0x360615=_0x3fe3ad['user']['get']({'plain':!![]});if(!_0x360615)throw new Error(_0x8af9('0x4d'));if(_0x360615[_0x8af9('0x4e')]===_0x8af9('0x4f')){var _0x4db37c=_0x346fe5[_0x8af9('0x2a')]({'plain':!![]});var _0x44fbed=_0x8af9('0x2b');return db['UserProfileSection'][_0x8af9('0x50')]({'where':{'name':_0x44fbed,'userProfileId':_0x360615[_0x8af9('0x51')]},'raw':!![]})[_0x8af9('0x28')](function(_0x2b8f89){if(_0x2b8f89&&_0x2b8f89[_0x8af9('0x52')]===0x0){return db[_0x8af9('0x53')]['create']({'name':_0x4db37c[_0x8af9('0x2c')],'resourceId':_0x4db37c['id'],'type':_0x2b8f89['name'],'sectionId':_0x2b8f89['id']},{})[_0x8af9('0x28')](function(){return _0x346fe5;});}else{return _0x346fe5;}})[_0x8af9('0x48')](function(_0x2d61c8){logger[_0x8af9('0x54')](_0x8af9('0x55'),_0x2d61c8);throw _0x2d61c8;});}return _0x346fe5;})[_0x8af9('0x28')](respondWithResult(_0x7512fa,0xc9))['catch'](handleError(_0x7512fa,null));};exports[_0x8af9('0x27')]=function(_0x5709fd,_0x317684){if(_0x5709fd['body']['id']){delete _0x5709fd['body']['id'];}return db[_0x8af9('0x30')][_0x8af9('0x50')]({'where':{'id':_0x5709fd[_0x8af9('0x4a')]['id']}})[_0x8af9('0x28')](handleEntityNotFound(_0x317684,null))[_0x8af9('0x28')](saveUpdates(_0x5709fd[_0x8af9('0x56')],null))[_0x8af9('0x28')](respondWithResult(_0x317684,null))[_0x8af9('0x48')](handleError(_0x317684,null));};exports['destroy']=function(_0x38f1c3,_0x155088){return db['CmHopperAdditionalPhone'][_0x8af9('0x50')]({'where':{'id':_0x38f1c3[_0x8af9('0x4a')]['id']}})[_0x8af9('0x28')](handleEntityNotFound(_0x155088,null))[_0x8af9('0x28')](removeEntity(_0x155088,null))[_0x8af9('0x48')](handleError(_0x155088,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 1938d9d..cc2d58a 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 _0x79a1=['./cmHopperAdditionalPhone.attributes','exports','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79a1,0x1e2));var _0x179a=function(_0x307829,_0x45d1ad){_0x307829=_0x307829-0x0;var _0xaa0073=_0x79a1[_0x307829];return _0xaa0073;};'use strict';var _=require('lodash');var util=require(_0x179a('0x0'));var logger=require('../../config/logger')(_0x179a('0x1'));var moment=require(_0x179a('0x2'));var BPromise=require(_0x179a('0x3'));var rp=require(_0x179a('0x4'));var fs=require('fs');var path=require(_0x179a('0x5'));var rimraf=require(_0x179a('0x6'));var config=require(_0x179a('0x7'));var attributes=require(_0x179a('0x8'));module[_0x179a('0x9')]=function(_0x318555,_0x573b65){return _0x318555['define']('CmHopperAdditionalPhone',attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22c4=['../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','lodash'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0x22c4,0x81));var _0x422c=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x22c4[_0x5d6e30];return _0x3d3f3b;};'use strict';var _=require(_0x422c('0x0'));var util=require('util');var logger=require(_0x422c('0x1'))(_0x422c('0x2'));var moment=require(_0x422c('0x3'));var BPromise=require(_0x422c('0x4'));var rp=require(_0x422c('0x5'));var fs=require('fs');var path=require(_0x422c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x422c('0x7'));module[_0x422c('0x8')]=function(_0x1db2da,_0x382314){return _0x1db2da['define'](_0x422c('0x9'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index a0b0971..84f2ce8 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 _0x8a78=['phone','isNil','createdAt','updatedAt','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','VoiceQueueId','CampaignId','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countdropretry','SwapAdditionalPhones','ListId','duration','waitTime','scheduledat','add','minutes'];(function(_0x409f9f,_0x365478){var _0x107f83=function(_0x61b4c4){while(--_0x61b4c4){_0x409f9f['push'](_0x409f9f['shift']());}};_0x107f83(++_0x365478);}(_0x8a78,0x158));var _0x88a7=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0x8a78[_0x5a8aa3];return _0x5d0458;};'use strict';var _=require(_0x88a7('0x0'));var util=require(_0x88a7('0x1'));var moment=require(_0x88a7('0x2'));var BPromise=require(_0x88a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88a7('0x4'));var db=require(_0x88a7('0x5'))['db'];var utils=require(_0x88a7('0x6'));var logger=require(_0x88a7('0x7'))(_0x88a7('0x8'));var config=require('../../config/environment');var jayson=require(_0x88a7('0x9'));var client=jayson['client'][_0x88a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x443560,_0x118b71,_0x38201b){return new BPromise(function(_0x585571,_0xd25e66){return client[_0x88a7('0xb')](_0x443560,_0x38201b)[_0x88a7('0xc')](function(_0x2ef7f8){logger[_0x88a7('0xd')](_0x88a7('0xe'),_0x118b71,_0x88a7('0xf'));logger[_0x88a7('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x118b71,_0x88a7('0xf'),JSON[_0x88a7('0x11')](_0x2ef7f8));if(_0x2ef7f8['error']){if(_0x2ef7f8[_0x88a7('0x12')]['code']===0x1f4){logger[_0x88a7('0x12')](_0x88a7('0xe'),_0x118b71,_0x2ef7f8[_0x88a7('0x12')]['message']);return _0xd25e66(_0x2ef7f8[_0x88a7('0x12')][_0x88a7('0x13')]);}logger[_0x88a7('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x118b71,_0x2ef7f8[_0x88a7('0x12')][_0x88a7('0x13')]);return _0x585571(_0x2ef7f8['error'][_0x88a7('0x13')]);}else{logger['info'](_0x88a7('0xe'),_0x118b71,_0x88a7('0xf'));_0x585571(_0x2ef7f8[_0x88a7('0x14')][_0x88a7('0x13')]);}})[_0x88a7('0x15')](function(_0x38f265){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x118b71,_0x38f265);_0xd25e66(_0x38f265);});});}exports[_0x88a7('0x16')]=function(_0x27da04){var _0x49a061=this;return new Promise(function(_0x28c99f,_0x3086fd){return db[_0x88a7('0x17')][_0x88a7('0x18')]({'raw':!![],'where':{'ContactId':_0x27da04['body']['ContactId'],'ListId':_0x27da04[_0x88a7('0x19')]['ListId'],'VoiceQueueId':_0x27da04[_0x88a7('0x19')][_0x88a7('0x1a')]===undefined?null:_0x27da04['body']['VoiceQueueId'],'CampaignId':_0x27da04['body'][_0x88a7('0x1b')]===undefined?null:_0x27da04[_0x88a7('0x19')][_0x88a7('0x1b')]}})[_0x88a7('0xc')](function(_0x127e73){if(_0x127e73!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x127e73['id'],'OrderBy':{'$gt':_0x127e73['OrderBy']}},'order':[[_0x88a7('0x1c'),_0x88a7('0x1d')]]})[_0x88a7('0xc')](function(_0x2f1c0a){var _0x2b0194=0x0;if(_0x2f1c0a){if(_0x2f1c0a[_0x88a7('0x1e')]+_0x2f1c0a[_0x88a7('0x1f')]+_0x2f1c0a[_0x88a7('0x20')]+_0x2f1c0a[_0x88a7('0x21')]+_0x2f1c0a['countdropretry']+_0x2f1c0a[_0x88a7('0x22')]+_0x2f1c0a[_0x88a7('0x23')]+_0x2f1c0a[_0x88a7('0x24')]<_0x27da04[_0x88a7('0x25')][_0x88a7('0x26')])_0x2b0194=0x1;_0x28c99f({'additional':_0x2b0194});}else{return db[_0x88a7('0x27')][_0x88a7('0x18')]({'raw':!![],'where':{'CmHopperId':_0x127e73['id']},'order':[['OrderBy','ASC']]})[_0x88a7('0xc')](function(_0x919f87){var _0x20809e=0x0;if(_0x919f87){if(_0x919f87[_0x88a7('0x1e')]+_0x919f87['countcongestionretry']+_0x919f87[_0x88a7('0x20')]+_0x919f87[_0x88a7('0x21')]+_0x919f87[_0x88a7('0x28')]+_0x919f87[_0x88a7('0x22')]+_0x919f87[_0x88a7('0x23')]+_0x919f87[_0x88a7('0x24')]<_0x27da04[_0x88a7('0x25')][_0x88a7('0x26')])_0x20809e=0x1;_0x28c99f({'additional':_0x20809e});}else{_0x28c99f({'additional':0x0});}})[_0x88a7('0x15')](function(_0x34b0a2){logger[_0x88a7('0x12')](_0x88a7('0x16'),_0x34b0a2[_0x88a7('0x13')]);_0x3086fd(_0x49a061[_0x88a7('0x12')](0x1f4,_0x34b0a2[_0x88a7('0x13')]));});}})['catch'](function(_0x13583d){logger['error'](_0x88a7('0x16'),_0x13583d[_0x88a7('0x13')]);_0x3086fd(_0x49a061[_0x88a7('0x12')](0x1f4,_0x13583d[_0x88a7('0x13')]));});}else _0x28c99f({'additional':0x0});});});};exports[_0x88a7('0x29')]=function(_0x4de659){var _0x3867ec=this;return new Promise(function(_0x44a7d9,_0xf15103){return db[_0x88a7('0x17')][_0x88a7('0x18')]({'raw':!![],'where':{'ContactId':_0x4de659[_0x88a7('0x19')]['ContactId'],'ListId':_0x4de659['body'][_0x88a7('0x2a')],'VoiceQueueId':_0x4de659[_0x88a7('0x19')][_0x88a7('0x1a')]===undefined?null:_0x4de659[_0x88a7('0x19')][_0x88a7('0x1a')],'CampaignId':_0x4de659['body'][_0x88a7('0x1b')]===undefined?null:_0x4de659[_0x88a7('0x19')]['CampaignId']}})['then'](function(_0x4cefa8){if(_0x4cefa8!=null){return db[_0x88a7('0x27')][_0x88a7('0x18')]({'raw':!![],'where':{'CmHopperId':_0x4cefa8['id'],'OrderBy':{'$gte':_0x4cefa8[_0x88a7('0x1c')]}},'order':[[_0x88a7('0x1c'),'ASC']]})[_0x88a7('0xc')](function(_0x36a7a8){if(_0x36a7a8)return activateAdditionalPhone(_0x4cefa8,_0x4de659[_0x88a7('0x19')],_0x36a7a8,_0x4de659[_0x88a7('0x2b')],_0x4de659[_0x88a7('0x2c')])['then'](function(_0x6d886c){_0x44a7d9(_0x6d886c);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x4cefa8['id']},'order':[[_0x88a7('0x1c'),_0x88a7('0x1d')]]})[_0x88a7('0xc')](function(_0x3f36d7){if(_0x3f36d7)return activateAdditionalPhone(_0x4cefa8,_0x4de659[_0x88a7('0x19')],_0x3f36d7,_0x4de659[_0x88a7('0x2b')],_0x4de659[_0x88a7('0x2c')])[_0x88a7('0xc')](function(_0x1f4089){_0x44a7d9(_0x1f4089);});else{_0x44a7d9({'id':_0x4cefa8['id'],'phone':''});}})[_0x88a7('0x15')](function(_0x1ee504){logger[_0x88a7('0x12')]('VerifyAdditionalPhones',_0x1ee504[_0x88a7('0x13')]);_0xf15103(_0x3867ec[_0x88a7('0x12')](0x1f4,_0x1ee504[_0x88a7('0x13')]));});}})[_0x88a7('0x15')](function(_0x28b301){logger[_0x88a7('0x12')](_0x88a7('0x16'),_0x28b301[_0x88a7('0x13')]);_0xf15103(_0x3867ec[_0x88a7('0x12')](0x1f4,_0x28b301[_0x88a7('0x13')]));});}else _0x44a7d9(0x1);});});};function activateAdditionalPhone(_0x2eba50,_0x2777e9,_0x6114ad,_0x5afa23,_0x4896c1){return new Promise(function(_0x57b4df,_0x232894){var _0x2d8655;if(_['isNil'](_0x6114ad[_0x88a7('0x2d')])){_0x6114ad[_0x88a7('0x2d')]=moment();}if(moment()>moment(_0x6114ad['scheduledat'])){_0x2d8655=moment()[_0x88a7('0x2e')](_0x4896c1||0x3,'minutes');}else{if(_0x6114ad['OrderBy']==0x0){_0x2d8655=moment(_0x6114ad[_0x88a7('0x2d')]);}else{_0x2d8655=moment()['add'](_0x4896c1||0x3,_0x88a7('0x2f'));}}if(_['isNil'](_0x2d8655)){_0x2d8655=moment()[_0x88a7('0x2e')](_0x4896c1||0x3,_0x88a7('0x2f'));}var _0x210373={'phone':_0x2eba50[_0x88a7('0x30')],'active':0x0,'OrderBy':_[_0x88a7('0x31')](_0x2eba50[_0x88a7('0x1c')])?0x0:_0x2eba50[_0x88a7('0x1c')],'scheduledat':moment()[_0x88a7('0x2e')](_0x5afa23||0x1,_0x88a7('0x2f')),'countbusyretry':_0x2777e9[_0x88a7('0x1e')],'countcongestionretry':_0x2777e9['countcongestionretry'],'countnoanswerretry':_0x2777e9[_0x88a7('0x20')],'countnosuchnumberretry':_0x2777e9[_0x88a7('0x21')],'countdropretry':_0x2777e9[_0x88a7('0x28')],'countabandonedretry':_0x2777e9['countabandonedretry'],'countmachineretry':_0x2777e9[_0x88a7('0x23')],'countagentrejectretry':_0x2777e9[_0x88a7('0x24')],'createdAt':_0x2777e9[_0x88a7('0x32')],'updatedAt':_0x2777e9[_0x88a7('0x33')]};var _0x438ca6={'CmHopperId':_0x2eba50['id'],'phone':_0x6114ad['phone'],'active':0x0,'OrderBy':_[_0x88a7('0x31')](_0x6114ad[_0x88a7('0x1c')])?0x0:_0x6114ad[_0x88a7('0x1c')],'scheduledat':_0x2d8655,'countbusyretry':_0x6114ad['countbusyretry'],'countcongestionretry':_0x6114ad[_0x88a7('0x1f')],'countnoanswerretry':_0x6114ad[_0x88a7('0x20')],'countnosuchnumberretry':_0x6114ad[_0x88a7('0x21')],'countdropretry':_0x6114ad['countdropretry'],'countabandonedretry':_0x6114ad['countabandonedretry'],'countmachineretry':_0x6114ad['countmachineretry'],'countagentrejectretry':_0x6114ad[_0x88a7('0x24')],'createdAt':_0x6114ad[_0x88a7('0x32')],'updatedAt':_0x6114ad['updatedAt']};return db['sequelize'][_0x88a7('0x34')](function(_0x127f0f){return db[_0x88a7('0x27')][_0x88a7('0x35')](_0x210373,{'where':{'id':_0x6114ad['id']}},{'transaction':_0x127f0f})[_0x88a7('0xc')](function(){return db['CmHopper'][_0x88a7('0x35')](_0x438ca6,{'where':{'id':_0x2eba50['id']}},{'transaction':_0x127f0f});});})[_0x88a7('0xc')](function(_0x59eacd){_0x57b4df({'id':_0x2eba50['id'],'phone':_0x6114ad[_0x88a7('0x30')]});})[_0x88a7('0x15')](function(_0x44f07c){logger[_0x88a7('0x12')](_0x88a7('0x36'),_0x44f07c[_0x88a7('0x13')]);_0x232894({'error':_0x44f07c[_0x88a7('0x13')]});});});}exports['IncrementPreviewCounters']=function(_0x44f1c2){var _0x47b188=this;return new Promise(function(_0x26c8fa,_0x3dd32d){return db['CmHopper']['update'](_0x44f1c2[_0x88a7('0x19')]['field'],{'where':{'id':_0x44f1c2['body']['id']}})['then'](function(_0x3ac732){_0x26c8fa(_0x3ac732);})[_0x88a7('0x15')](function(_0xa8c475){logger[_0x88a7('0x12')](_0x88a7('0x37'),_0xa8c475[_0x88a7('0x13')]);_0x3dd32d(_0x47b188[_0x88a7('0x12')](0x1f4,_0xa8c475[_0x88a7('0x13')]));});});}; \ No newline at end of file +var _0x8b1a=['stringify','error','code','message','request\x20sent','result','catch','VerifyAdditionalPhones','body','ContactId','VoiceQueueId','CampaignId','OrderBy','ASC','then','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','findOne','countnoanswerretry','countdropretry','countmachineretry','SwapAdditionalPhones','CmHopper','waitTime','duration','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','countagentrejectretry','sequelize','transaction','update','IncrementPreviewCounters','field','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8b1a,0x152));var _0xa8b1=function(_0x564e3e,_0xf366d3){_0x564e3e=_0x564e3e-0x0;var _0x4fe7ee=_0x8b1a[_0x564e3e];return _0x4fe7ee;};'use strict';var _=require(_0xa8b1('0x0'));var util=require(_0xa8b1('0x1'));var moment=require(_0xa8b1('0x2'));var BPromise=require('bluebird');var rs=require(_0xa8b1('0x3'));var fs=require('fs');var Redis=require(_0xa8b1('0x4'));var db=require(_0xa8b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8b1('0x6'))(_0xa8b1('0x7'));var config=require(_0xa8b1('0x8'));var jayson=require(_0xa8b1('0x9'));var client=jayson[_0xa8b1('0xa')][_0xa8b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5db169,_0x2a3030,_0x459cf9){return new BPromise(function(_0x5d958d,_0xabb2b9){return client[_0xa8b1('0xc')](_0x5db169,_0x459cf9)['then'](function(_0x112113){logger[_0xa8b1('0xd')](_0xa8b1('0xe'),_0x2a3030,'request\x20sent');logger['debug'](_0xa8b1('0xf'),_0x2a3030,'request\x20sent',JSON[_0xa8b1('0x10')](_0x112113));if(_0x112113[_0xa8b1('0x11')]){if(_0x112113[_0xa8b1('0x11')][_0xa8b1('0x12')]===0x1f4){logger[_0xa8b1('0x11')](_0xa8b1('0xe'),_0x2a3030,_0x112113[_0xa8b1('0x11')][_0xa8b1('0x13')]);return _0xabb2b9(_0x112113['error'][_0xa8b1('0x13')]);}logger[_0xa8b1('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2a3030,_0x112113[_0xa8b1('0x11')]['message']);return _0x5d958d(_0x112113[_0xa8b1('0x11')]['message']);}else{logger[_0xa8b1('0xd')](_0xa8b1('0xe'),_0x2a3030,_0xa8b1('0x14'));_0x5d958d(_0x112113[_0xa8b1('0x15')][_0xa8b1('0x13')]);}})[_0xa8b1('0x16')](function(_0x219e46){logger[_0xa8b1('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2a3030,_0x219e46);_0xabb2b9(_0x219e46);});});}exports[_0xa8b1('0x17')]=function(_0x457967){var _0x5a05ac=this;return new Promise(function(_0x59ff94,_0x47c3be){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x457967[_0xa8b1('0x18')][_0xa8b1('0x19')],'ListId':_0x457967[_0xa8b1('0x18')]['ListId'],'VoiceQueueId':_0x457967['body'][_0xa8b1('0x1a')]===undefined?null:_0x457967['body'][_0xa8b1('0x1a')],'CampaignId':_0x457967[_0xa8b1('0x18')][_0xa8b1('0x1b')]===undefined?null:_0x457967[_0xa8b1('0x18')][_0xa8b1('0x1b')]}})['then'](function(_0x2ab5a0){if(_0x2ab5a0!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x2ab5a0['id'],'OrderBy':{'$gt':_0x2ab5a0[_0xa8b1('0x1c')]}},'order':[[_0xa8b1('0x1c'),_0xa8b1('0x1d')]]})[_0xa8b1('0x1e')](function(_0xc557fa){var _0x348ac8=0x0;if(_0xc557fa){if(_0xc557fa[_0xa8b1('0x1f')]+_0xc557fa[_0xa8b1('0x20')]+_0xc557fa['countnoanswerretry']+_0xc557fa[_0xa8b1('0x21')]+_0xc557fa['countdropretry']+_0xc557fa[_0xa8b1('0x22')]+_0xc557fa['countmachineretry']+_0xc557fa['countagentrejectretry']<_0x457967[_0xa8b1('0x23')][_0xa8b1('0x24')])_0x348ac8=0x1;_0x59ff94({'additional':_0x348ac8});}else{return db[_0xa8b1('0x25')][_0xa8b1('0x26')]({'raw':!![],'where':{'CmHopperId':_0x2ab5a0['id']},'order':[[_0xa8b1('0x1c'),_0xa8b1('0x1d')]]})[_0xa8b1('0x1e')](function(_0x72a6d2){var _0x1f5314=0x0;if(_0x72a6d2){if(_0x72a6d2[_0xa8b1('0x1f')]+_0x72a6d2[_0xa8b1('0x20')]+_0x72a6d2[_0xa8b1('0x27')]+_0x72a6d2['countnosuchnumberretry']+_0x72a6d2[_0xa8b1('0x28')]+_0x72a6d2[_0xa8b1('0x22')]+_0x72a6d2[_0xa8b1('0x29')]+_0x72a6d2['countagentrejectretry']<_0x457967[_0xa8b1('0x23')][_0xa8b1('0x24')])_0x1f5314=0x1;_0x59ff94({'additional':_0x1f5314});}else{_0x59ff94({'additional':0x0});}})[_0xa8b1('0x16')](function(_0x44d393){logger[_0xa8b1('0x11')](_0xa8b1('0x17'),_0x44d393['message']);_0x47c3be(_0x5a05ac['error'](0x1f4,_0x44d393['message']));});}})['catch'](function(_0x4cd2b1){logger['error']('VerifyAdditionalPhones',_0x4cd2b1[_0xa8b1('0x13')]);_0x47c3be(_0x5a05ac[_0xa8b1('0x11')](0x1f4,_0x4cd2b1[_0xa8b1('0x13')]));});}else _0x59ff94({'additional':0x0});});});};exports[_0xa8b1('0x2a')]=function(_0x47a7d1){var _0x1d8cc2=this;return new Promise(function(_0x46cde7,_0x4f24a5){return db[_0xa8b1('0x2b')][_0xa8b1('0x26')]({'raw':!![],'where':{'ContactId':_0x47a7d1['body'][_0xa8b1('0x19')],'ListId':_0x47a7d1[_0xa8b1('0x18')]['ListId'],'VoiceQueueId':_0x47a7d1[_0xa8b1('0x18')][_0xa8b1('0x1a')]===undefined?null:_0x47a7d1[_0xa8b1('0x18')][_0xa8b1('0x1a')],'CampaignId':_0x47a7d1['body'][_0xa8b1('0x1b')]===undefined?null:_0x47a7d1[_0xa8b1('0x18')][_0xa8b1('0x1b')]}})[_0xa8b1('0x1e')](function(_0x134649){if(_0x134649!=null){return db[_0xa8b1('0x25')][_0xa8b1('0x26')]({'raw':!![],'where':{'CmHopperId':_0x134649['id'],'OrderBy':{'$gte':_0x134649['OrderBy']}},'order':[['OrderBy',_0xa8b1('0x1d')]]})['then'](function(_0x4fe7b1){if(_0x4fe7b1)return activateAdditionalPhone(_0x134649,_0x47a7d1[_0xa8b1('0x18')],_0x4fe7b1,_0x47a7d1['duration'],_0x47a7d1[_0xa8b1('0x2c')])[_0xa8b1('0x1e')](function(_0x4f8fc2){_0x46cde7(_0x4f8fc2);});else{return db[_0xa8b1('0x25')][_0xa8b1('0x26')]({'raw':!![],'where':{'CmHopperId':_0x134649['id']},'order':[[_0xa8b1('0x1c'),'ASC']]})[_0xa8b1('0x1e')](function(_0x43d0fe){if(_0x43d0fe)return activateAdditionalPhone(_0x134649,_0x47a7d1[_0xa8b1('0x18')],_0x43d0fe,_0x47a7d1[_0xa8b1('0x2d')],_0x47a7d1[_0xa8b1('0x2c')])['then'](function(_0x548af1){_0x46cde7(_0x548af1);});else{_0x46cde7({'id':_0x134649['id'],'phone':''});}})[_0xa8b1('0x16')](function(_0x503817){logger['error'](_0xa8b1('0x17'),_0x503817['message']);_0x4f24a5(_0x1d8cc2[_0xa8b1('0x11')](0x1f4,_0x503817[_0xa8b1('0x13')]));});}})[_0xa8b1('0x16')](function(_0x51e686){logger[_0xa8b1('0x11')](_0xa8b1('0x17'),_0x51e686['message']);_0x4f24a5(_0x1d8cc2['error'](0x1f4,_0x51e686[_0xa8b1('0x13')]));});}else _0x46cde7(0x1);});});};function activateAdditionalPhone(_0x4f5b5d,_0x22998b,_0x13d0c3,_0x4cfbf8,_0x4e07ed){return new Promise(function(_0x2e19e7,_0x563aff){var _0x2f1d67;if(_[_0xa8b1('0x2e')](_0x13d0c3[_0xa8b1('0x2f')])){_0x13d0c3[_0xa8b1('0x2f')]=moment();}if(moment()>moment(_0x13d0c3['scheduledat'])){_0x2f1d67=moment()[_0xa8b1('0x30')](_0x4e07ed||0x3,_0xa8b1('0x31'));}else{if(_0x13d0c3[_0xa8b1('0x1c')]==0x0){_0x2f1d67=moment(_0x13d0c3['scheduledat']);}else{_0x2f1d67=moment()['add'](_0x4e07ed||0x3,_0xa8b1('0x31'));}}if(_['isNil'](_0x2f1d67)){_0x2f1d67=moment()[_0xa8b1('0x30')](_0x4e07ed||0x3,_0xa8b1('0x31'));}var _0x2b8de5={'phone':_0x4f5b5d[_0xa8b1('0x32')],'active':0x0,'OrderBy':_[_0xa8b1('0x2e')](_0x4f5b5d['OrderBy'])?0x0:_0x4f5b5d[_0xa8b1('0x1c')],'scheduledat':moment()[_0xa8b1('0x30')](_0x4cfbf8||0x1,_0xa8b1('0x31')),'countbusyretry':_0x22998b[_0xa8b1('0x1f')],'countcongestionretry':_0x22998b[_0xa8b1('0x20')],'countnoanswerretry':_0x22998b[_0xa8b1('0x27')],'countnosuchnumberretry':_0x22998b[_0xa8b1('0x21')],'countdropretry':_0x22998b[_0xa8b1('0x28')],'countabandonedretry':_0x22998b[_0xa8b1('0x22')],'countmachineretry':_0x22998b[_0xa8b1('0x29')],'countagentrejectretry':_0x22998b['countagentrejectretry'],'createdAt':_0x22998b[_0xa8b1('0x33')],'updatedAt':_0x22998b[_0xa8b1('0x34')]};var _0x5cbdcd={'CmHopperId':_0x4f5b5d['id'],'phone':_0x13d0c3[_0xa8b1('0x32')],'active':0x0,'OrderBy':_[_0xa8b1('0x2e')](_0x13d0c3[_0xa8b1('0x1c')])?0x0:_0x13d0c3[_0xa8b1('0x1c')],'scheduledat':_0x2f1d67,'countbusyretry':_0x13d0c3[_0xa8b1('0x1f')],'countcongestionretry':_0x13d0c3[_0xa8b1('0x20')],'countnoanswerretry':_0x13d0c3['countnoanswerretry'],'countnosuchnumberretry':_0x13d0c3[_0xa8b1('0x21')],'countdropretry':_0x13d0c3[_0xa8b1('0x28')],'countabandonedretry':_0x13d0c3[_0xa8b1('0x22')],'countmachineretry':_0x13d0c3[_0xa8b1('0x29')],'countagentrejectretry':_0x13d0c3[_0xa8b1('0x35')],'createdAt':_0x13d0c3[_0xa8b1('0x33')],'updatedAt':_0x13d0c3[_0xa8b1('0x34')]};return db[_0xa8b1('0x36')][_0xa8b1('0x37')](function(_0x2e0f19){return db['CmHopperAdditionalPhone']['update'](_0x2b8de5,{'where':{'id':_0x13d0c3['id']}},{'transaction':_0x2e0f19})['then'](function(){return db['CmHopper'][_0xa8b1('0x38')](_0x5cbdcd,{'where':{'id':_0x4f5b5d['id']}},{'transaction':_0x2e0f19});});})[_0xa8b1('0x1e')](function(_0xc41037){_0x2e19e7({'id':_0x4f5b5d['id'],'phone':_0x13d0c3[_0xa8b1('0x32')]});})[_0xa8b1('0x16')](function(_0x4a1432){logger[_0xa8b1('0x11')]('activateAdditionalPhone',_0x4a1432[_0xa8b1('0x13')]);_0x563aff({'error':_0x4a1432['message']});});});}exports[_0xa8b1('0x39')]=function(_0x53518b){var _0x4c5e10=this;return new Promise(function(_0x4f863e,_0x109705){return db['CmHopper'][_0xa8b1('0x38')](_0x53518b['body'][_0xa8b1('0x3a')],{'where':{'id':_0x53518b[_0xa8b1('0x18')]['id']}})[_0xa8b1('0x1e')](function(_0x1216f5){_0x4f863e(_0x1216f5);})[_0xa8b1('0x16')](function(_0x49293d){logger[_0xa8b1('0x11')](_0xa8b1('0x39'),_0x49293d['message']);_0x109705(_0x4c5e10[_0xa8b1('0x11')](0x1f4,_0x49293d[_0xa8b1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 65dfa7e..3daf9b6 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 _0x065f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','/:id','show','create','put','update','delete','destroy','multer','path','express','fs-extra'];(function(_0x14d507,_0x583185){var _0x14f333=function(_0x50e26f){while(--_0x50e26f){_0x14d507['push'](_0x14d507['shift']());}};_0x14f333(++_0x583185);}(_0x065f,0xac));var _0xf065=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x065f[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xf065('0x0'));var util=require('util');var path=require(_0xf065('0x1'));var timeout=require('connect-timeout');var express=require(_0xf065('0x2'));var router=express['Router']();var fs_extra=require(_0xf065('0x3'));var auth=require(_0xf065('0x4'));var interaction=require(_0xf065('0x5'));var config=require(_0xf065('0x6'));var controller=require(_0xf065('0x7'));router['get']('/',auth[_0xf065('0x8')](),controller['index']);router['get'](_0xf065('0x9'),auth[_0xf065('0x8')](),controller[_0xf065('0xa')]);router['post']('/',auth[_0xf065('0x8')](),controller[_0xf065('0xb')]);router[_0xf065('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xf065('0xd')]);router[_0xf065('0xe')](_0xf065('0x9'),auth[_0xf065('0x8')](),controller[_0xf065('0xf')]);module['exports']=router; \ No newline at end of file +var _0xcd34=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','exports'];(function(_0x414fa5,_0x4079a2){var _0x20ec04=function(_0x56099d){while(--_0x56099d){_0x414fa5['push'](_0x414fa5['shift']());}};_0x20ec04(++_0x4079a2);}(_0xcd34,0x10a));var _0x4cd3=function(_0x4eb359,_0x1720fe){_0x4eb359=_0x4eb359-0x0;var _0x15ea8d=_0xcd34[_0x4eb359];return _0x15ea8d;};'use strict';var multer=require(_0x4cd3('0x0'));var util=require(_0x4cd3('0x1'));var path=require(_0x4cd3('0x2'));var timeout=require(_0x4cd3('0x3'));var express=require('express');var router=express[_0x4cd3('0x4')]();var fs_extra=require(_0x4cd3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4cd3('0x6'));var config=require(_0x4cd3('0x7'));var controller=require(_0x4cd3('0x8'));router[_0x4cd3('0x9')]('/',auth[_0x4cd3('0xa')](),controller[_0x4cd3('0xb')]);router[_0x4cd3('0x9')]('/:id',auth[_0x4cd3('0xa')](),controller[_0x4cd3('0xc')]);router[_0x4cd3('0xd')]('/',auth[_0x4cd3('0xa')](),controller[_0x4cd3('0xe')]);router[_0x4cd3('0xf')](_0x4cd3('0x10'),auth[_0x4cd3('0xa')](),controller[_0x4cd3('0x11')]);router['delete'](_0x4cd3('0x10'),auth[_0x4cd3('0xa')](),controller['destroy']);module[_0x4cd3('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 0f6d1f3..7761f5c 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 _0xcf62=['INTEGER','contactListQueue','moment','sequelize'];(function(_0x5bb761,_0x27a790){var _0x3fe5dd=function(_0x453fdc){while(--_0x453fdc){_0x5bb761['push'](_0x5bb761['shift']());}};_0x3fe5dd(++_0x27a790);}(_0xcf62,0x102));var _0x2cf6=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xcf62[_0x4fbfd9];return _0x31dc94;};'use strict';var moment=require(_0x2cf6('0x0'));var Sequelize=require(_0x2cf6('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x2cf6('0x2')],'unique':_0x2cf6('0x3')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x2cf6('0x3')},'VoiceQueueId':{'type':Sequelize[_0x2cf6('0x2')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0xfa23=['exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x391932,_0x3c1b9f){var _0x49ca90=function(_0x589776){while(--_0x589776){_0x391932['push'](_0x391932['shift']());}};_0x49ca90(++_0x3c1b9f);}(_0xfa23,0x1d5));var _0x3fa2=function(_0x38c74e,_0x1090b3){_0x38c74e=_0x38c74e-0x0;var _0x758e83=_0xfa23[_0x38c74e];return _0x758e83;};'use strict';var moment=require(_0x3fa2('0x0'));var Sequelize=require('sequelize');module[_0x3fa2('0x1')]={'phone':{'type':Sequelize[_0x3fa2('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x3fa2('0x3')],'unique':_0x3fa2('0x4')},'ListId':{'type':Sequelize[_0x3fa2('0x3')],'unique':_0x3fa2('0x4')},'VoiceQueueId':{'type':Sequelize[_0x3fa2('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 21eede3..e3beeb8 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 _0x01d9=['map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index'];(function(_0x4091b0,_0x521b1c){var _0x46be1c=function(_0x18b19a){while(--_0x18b19a){_0x4091b0['push'](_0x4091b0['shift']());}};_0x46be1c(++_0x521b1c);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':!![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['CmHopperBlack'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x27')]=function(_0x24b6fa,_0x27459b){if(_0x24b6fa[_0x901d('0x4b')]['id']){delete _0x24b6fa[_0x901d('0x4b')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x24b6fa[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x27459b,null))[_0x901d('0x28')](saveUpdates(_0x24b6fa['body'],null))['then'](respondWithResult(_0x27459b,null))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x29')]=function(_0x1040af,_0x6b6b9c){return db[_0x901d('0x2f')]['find']({'where':{'id':_0x1040af['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x6b6b9c,null))[_0x901d('0x28')](removeEntity(_0x6b6b9c,null))['catch'](handleError(_0x6b6b9c,null));};exports[_0x901d('0x4c')]=function(_0x165207,_0x4d2b2d){return db[_0x901d('0x2f')]['describe']()[_0x901d('0x28')](respondWithResult(_0x4d2b2d,null))[_0x901d('0x46')](handleError(_0x4d2b2d,null));}; \ No newline at end of file +var _0x25de=['end','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','model','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','CmHopperBlack','includeAll','include','show','params','keys','rawAttributes','catch','update','body','find','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1fab16,_0x36e47f){var _0x720c6c=function(_0x2b4fa5){while(--_0x2b4fa5){_0x1fab16['push'](_0x1fab16['shift']());}};_0x720c6c(++_0x36e47f);}(_0x25de,0xc6));var _0xe25d=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0x25de[_0x3c6dce];return _0x1450e9;};'use strict';var emlformat=require(_0xe25d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe25d('0x1'));var rp=require(_0xe25d('0x2'));var moment=require(_0xe25d('0x3'));var BPromise=require(_0xe25d('0x4'));var Mustache=require(_0xe25d('0x5'));var util=require(_0xe25d('0x6'));var path=require(_0xe25d('0x7'));var sox=require(_0xe25d('0x8'));var csv=require(_0xe25d('0x9'));var ejs=require(_0xe25d('0xa'));var fs=require('fs');var fs_extra=require(_0xe25d('0xb'));var _=require(_0xe25d('0xc'));var squel=require(_0xe25d('0xd'));var crypto=require(_0xe25d('0xe'));var jsforce=require(_0xe25d('0xf'));var deskjs=require(_0xe25d('0x10'));var toCsv=require(_0xe25d('0x9'));var querystring=require(_0xe25d('0x11'));var Papa=require(_0xe25d('0x12'));var Redis=require('ioredis');var authService=require(_0xe25d('0x13'));var qs=require(_0xe25d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe25d('0x15'));var logger=require(_0xe25d('0x16'))(_0xe25d('0x17'));var utils=require(_0xe25d('0x18'));var config=require(_0xe25d('0x19'));var licenseUtil=require(_0xe25d('0x1a'));var db=require(_0xe25d('0x1b'))['db'];function respondWithStatusCode(_0x4b3612,_0xa1c802){_0xa1c802=_0xa1c802||0xcc;return function(_0x1441e4){if(_0x1441e4){return _0x4b3612[_0xe25d('0x1c')](_0xa1c802);}return _0x4b3612[_0xe25d('0x1d')](_0xa1c802)[_0xe25d('0x1e')]();};}function respondWithResult(_0x386ba6,_0x284190){_0x284190=_0x284190||0xc8;return function(_0x6a5da0){if(_0x6a5da0){return _0x386ba6[_0xe25d('0x1d')](_0x284190)['json'](_0x6a5da0);}};}function respondWithFilteredResult(_0x5ee03b,_0x64a7a5){return function(_0x3af1d1){if(_0x3af1d1){var _0x30a5a5=typeof _0x64a7a5[_0xe25d('0x1f')]===_0xe25d('0x20')&&typeof _0x64a7a5[_0xe25d('0x21')]===_0xe25d('0x20');var _0x1c3392=_0x3af1d1[_0xe25d('0x22')];var _0x4d3f19=_0x30a5a5?0x0:_0x64a7a5['offset'];var _0xbfa795=_0x30a5a5?_0x3af1d1[_0xe25d('0x22')]:_0x64a7a5[_0xe25d('0x1f')]+_0x64a7a5['limit'];var _0x5c525b;if(_0xbfa795>=_0x1c3392){_0xbfa795=_0x1c3392;_0x5c525b=0xc8;}else{_0x5c525b=0xce;}_0x5ee03b[_0xe25d('0x1d')](_0x5c525b);return _0x5ee03b['set'](_0xe25d('0x23'),_0x4d3f19+'-'+_0xbfa795+'/'+_0x1c3392)['json'](_0x3af1d1);}return null;};}function patchUpdates(_0x349e4b){return function(_0x19de45){try{jsonpatch[_0xe25d('0x24')](_0x19de45,_0x349e4b,!![]);}catch(_0x4b933e){return BPromise[_0xe25d('0x25')](_0x4b933e);}return _0x19de45[_0xe25d('0x26')]();};}function saveUpdates(_0x58cd17,_0x22d462){return function(_0x483482){if(_0x483482){return _0x483482['update'](_0x58cd17)[_0xe25d('0x27')](function(_0x335441){return _0x335441;});}return null;};}function removeEntity(_0x309b33,_0x44a178){return function(_0x4452d9){if(_0x4452d9){return _0x4452d9[_0xe25d('0x28')]()[_0xe25d('0x27')](function(){_0x309b33[_0xe25d('0x1d')](0xcc)[_0xe25d('0x1e')]();});}};}function handleEntityNotFound(_0x36b055,_0x6a45e2){return function(_0x34986c){if(!_0x34986c){_0x36b055[_0xe25d('0x1c')](0x194);}return _0x34986c;};}function handleError(_0x8ce7e1,_0x43f27f){_0x43f27f=_0x43f27f||0x1f4;return function(_0x1e78ca){logger[_0xe25d('0x29')](_0x1e78ca[_0xe25d('0x2a')]);if(_0x1e78ca[_0xe25d('0x2b')]){delete _0x1e78ca['name'];}_0x8ce7e1[_0xe25d('0x1d')](_0x43f27f)[_0xe25d('0x2c')](_0x1e78ca);};}exports[_0xe25d('0x2d')]=function(_0x5492ed,_0x291e2e){var _0x5c5b8c={},_0x492039={},_0x25f724={'count':0x0,'rows':[]};var _0x201f78=_[_0xe25d('0x2e')](db['CmHopperBlack']['rawAttributes'],function(_0x4dc05b){return{'name':_0x4dc05b[_0xe25d('0x2f')],'type':_0x4dc05b[_0xe25d('0x30')]['key']};});_0x492039[_0xe25d('0x31')]=_[_0xe25d('0x2e')](_0x201f78,_0xe25d('0x2b'));_0x492039['query']=_['keys'](_0x5492ed['query']);_0x492039['filters']=_[_0xe25d('0x32')](_0x492039[_0xe25d('0x31')],_0x492039[_0xe25d('0x33')]);_0x5c5b8c['attributes']=_[_0xe25d('0x32')](_0x492039[_0xe25d('0x31')],qs[_0xe25d('0x34')](_0x5492ed[_0xe25d('0x33')][_0xe25d('0x34')]));_0x5c5b8c[_0xe25d('0x35')]=_0x5c5b8c[_0xe25d('0x35')][_0xe25d('0x36')]?_0x5c5b8c[_0xe25d('0x35')]:_0x492039[_0xe25d('0x31')];if(!_0x5492ed[_0xe25d('0x33')][_0xe25d('0x37')](_0xe25d('0x38'))){_0x5c5b8c['limit']=qs[_0xe25d('0x21')](_0x5492ed[_0xe25d('0x33')][_0xe25d('0x21')]);_0x5c5b8c[_0xe25d('0x1f')]=qs['offset'](_0x5492ed['query'][_0xe25d('0x1f')]);}_0x5c5b8c['order']=qs[_0xe25d('0x39')](_0x5492ed[_0xe25d('0x33')]['sort']);_0x5c5b8c[_0xe25d('0x3a')]=qs[_0xe25d('0x3b')](_[_0xe25d('0x3c')](_0x5492ed[_0xe25d('0x33')],_0x492039[_0xe25d('0x3b')]),_0x201f78);if(_0x5492ed[_0xe25d('0x33')][_0xe25d('0x3d')]){_0x5c5b8c[_0xe25d('0x3a')]=_[_0xe25d('0x3e')](_0x5c5b8c[_0xe25d('0x3a')],{'$or':_[_0xe25d('0x2e')](_0x201f78,function(_0x4c53c2){if(_0x4c53c2[_0xe25d('0x30')]!=='VIRTUAL'){var _0x32c561={};_0x32c561[_0x4c53c2['name']]={'$like':'%'+_0x5492ed['query']['filter']+'%'};return _0x32c561;}})});}_0x5c5b8c=_[_0xe25d('0x3e')]({},_0x5c5b8c,_0x5492ed[_0xe25d('0x3f')]);var _0xb4bfa0={'where':_0x5c5b8c[_0xe25d('0x3a')]};return db[_0xe25d('0x40')][_0xe25d('0x22')](_0xb4bfa0)['then'](function(_0x549ebd){_0x25f724[_0xe25d('0x22')]=_0x549ebd;if(_0x5492ed['query'][_0xe25d('0x41')]){_0x5c5b8c[_0xe25d('0x42')]=[{'all':!![]}];}return db[_0xe25d('0x40')]['findAll'](_0x5c5b8c);})[_0xe25d('0x27')](function(_0x35832c){_0x25f724['rows']=_0x35832c;return _0x25f724;})[_0xe25d('0x27')](respondWithFilteredResult(_0x291e2e,_0x5c5b8c))['catch'](handleError(_0x291e2e,null));};exports[_0xe25d('0x43')]=function(_0x26aabd,_0x597bd8){var _0x1a6246={'raw':!![],'where':{'id':_0x26aabd[_0xe25d('0x44')]['id']}},_0x45c58b={};_0x45c58b[_0xe25d('0x31')]=_[_0xe25d('0x45')](db['CmHopperBlack'][_0xe25d('0x46')]);_0x45c58b[_0xe25d('0x33')]=_[_0xe25d('0x45')](_0x26aabd[_0xe25d('0x33')]);_0x45c58b['filters']=_[_0xe25d('0x32')](_0x45c58b['model'],_0x45c58b[_0xe25d('0x33')]);_0x1a6246[_0xe25d('0x35')]=_[_0xe25d('0x32')](_0x45c58b[_0xe25d('0x31')],qs[_0xe25d('0x34')](_0x26aabd[_0xe25d('0x33')][_0xe25d('0x34')]));_0x1a6246[_0xe25d('0x35')]=_0x1a6246[_0xe25d('0x35')][_0xe25d('0x36')]?_0x1a6246[_0xe25d('0x35')]:_0x45c58b[_0xe25d('0x31')];if(_0x26aabd['query'][_0xe25d('0x41')]){_0x1a6246[_0xe25d('0x42')]=[{'all':!![]}];}_0x1a6246=_[_0xe25d('0x3e')]({},_0x1a6246,_0x26aabd['options']);return db[_0xe25d('0x40')]['find'](_0x1a6246)[_0xe25d('0x27')](handleEntityNotFound(_0x597bd8,null))[_0xe25d('0x27')](respondWithResult(_0x597bd8,null))[_0xe25d('0x47')](handleError(_0x597bd8,null));};exports[_0xe25d('0x48')]=function(_0x4bd31f,_0x2bc5ea){if(_0x4bd31f[_0xe25d('0x49')]['id']){delete _0x4bd31f['body']['id'];}return db['CmHopperBlack'][_0xe25d('0x4a')]({'where':{'id':_0x4bd31f[_0xe25d('0x44')]['id']}})['then'](handleEntityNotFound(_0x2bc5ea,null))[_0xe25d('0x27')](saveUpdates(_0x4bd31f[_0xe25d('0x49')],null))[_0xe25d('0x27')](respondWithResult(_0x2bc5ea,null))['catch'](handleError(_0x2bc5ea,null));};exports[_0xe25d('0x28')]=function(_0x19328c,_0x5dddfa){return db[_0xe25d('0x40')][_0xe25d('0x4a')]({'where':{'id':_0x19328c[_0xe25d('0x44')]['id']}})['then'](handleEntityNotFound(_0x5dddfa,null))[_0xe25d('0x27')](removeEntity(_0x5dddfa,null))['catch'](handleError(_0x5dddfa,null));};exports[_0xe25d('0x4b')]=function(_0x74994,_0x2322c2){return db['CmHopperBlack']['describe']()[_0xe25d('0x27')](respondWithResult(_0x2322c2,null))[_0xe25d('0x47')](handleError(_0x2322c2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 771c038..e9baa1f 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 _0x77cc=['path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4615c7,_0x6d6e6d){var _0x3a3635=function(_0x16886b){while(--_0x16886b){_0x4615c7['push'](_0x4615c7['shift']());}};_0x3a3635(++_0x6d6e6d);}(_0x77cc,0x1ac));var _0xc77c=function(_0x437aa2,_0x48d508){_0x437aa2=_0x437aa2-0x0;var _0x28ac4d=_0x77cc[_0x437aa2];return _0x28ac4d;};'use strict';var _=require(_0xc77c('0x0'));var util=require(_0xc77c('0x1'));var logger=require(_0xc77c('0x2'))(_0xc77c('0x3'));var moment=require('moment');var BPromise=require(_0xc77c('0x4'));var rp=require(_0xc77c('0x5'));var fs=require('fs');var path=require(_0xc77c('0x6'));var rimraf=require(_0xc77c('0x7'));var config=require(_0xc77c('0x8'));var attributes=require(_0xc77c('0x9'));module[_0xc77c('0xa')]=function(_0x88b735,_0x5a97ac){return _0x88b735[_0xc77c('0xb')](_0xc77c('0xc'),attributes,{'tableName':_0xc77c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe71d=['rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','request-promise','path'];(function(_0x3bf83c,_0xe09652){var _0x2f7323=function(_0x1d2920){while(--_0x1d2920){_0x3bf83c['push'](_0x3bf83c['shift']());}};_0x2f7323(++_0xe09652);}(_0xe71d,0xa2));var _0xde71=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xe71d[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0xde71('0x0'));var util=require(_0xde71('0x1'));var logger=require('../../config/logger')(_0xde71('0x2'));var moment=require(_0xde71('0x3'));var BPromise=require('bluebird');var rp=require(_0xde71('0x4'));var fs=require('fs');var path=require(_0xde71('0x5'));var rimraf=require(_0xde71('0x6'));var config=require('../../config/environment');var attributes=require(_0xde71('0x7'));module[_0xde71('0x8')]=function(_0x26578a,_0x1528d0){return _0x26578a[_0xde71('0x9')](_0xde71('0xa'),attributes,{'tableName':_0xde71('0xb'),'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 90c0f42..9fc0e79 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 _0x2466=['../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','limit','include','map','model','attributes','debug','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0xb1cbf9,_0x1aef47){var _0x42ffcf=function(_0x53a93e){while(--_0x53a93e){_0xb1cbf9['push'](_0xb1cbf9['shift']());}};_0x42ffcf(++_0x1aef47);}(_0x2466,0x6a));var _0x6246=function(_0x3d4787,_0x4dc553){_0x3d4787=_0x3d4787-0x0;var _0x450480=_0x2466[_0x3d4787];return _0x450480;};'use strict';var _=require(_0x6246('0x0'));var util=require(_0x6246('0x1'));var moment=require(_0x6246('0x2'));var BPromise=require('bluebird');var rs=require(_0x6246('0x3'));var fs=require('fs');var Redis=require(_0x6246('0x4'));var db=require(_0x6246('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6246('0x6'))(_0x6246('0x7'));var config=require(_0x6246('0x8'));var jayson=require(_0x6246('0x9'));var client=jayson[_0x6246('0xa')][_0x6246('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x209ef5,_0x2467d4,_0x3a50f9){return new BPromise(function(_0x1e331f,_0x39cfe9){return client[_0x6246('0xc')](_0x209ef5,_0x3a50f9)[_0x6246('0xd')](function(_0x368c83){logger[_0x6246('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x2467d4,'request\x20sent');logger['debug'](_0x6246('0xf'),_0x2467d4,'request\x20sent',JSON[_0x6246('0x10')](_0x368c83));if(_0x368c83[_0x6246('0x11')]){if(_0x368c83['error']['code']===0x1f4){logger[_0x6246('0x11')](_0x6246('0x12'),_0x2467d4,_0x368c83[_0x6246('0x11')][_0x6246('0x13')]);return _0x39cfe9(_0x368c83['error'][_0x6246('0x13')]);}logger[_0x6246('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x2467d4,_0x368c83['error'][_0x6246('0x13')]);return _0x1e331f(_0x368c83[_0x6246('0x11')][_0x6246('0x13')]);}else{logger[_0x6246('0xe')](_0x6246('0x12'),_0x2467d4,'request\x20sent');_0x1e331f(_0x368c83[_0x6246('0x14')]['message']);}})[_0x6246('0x15')](function(_0x2df66c){logger[_0x6246('0x11')](_0x6246('0x12'),_0x2467d4,_0x2df66c);_0x39cfe9(_0x2df66c);});});}exports[_0x6246('0x16')]=function(_0x12b023){var _0xaaf8d1=this;return new Promise(function(_0x3040a7,_0x505cdb){return db[_0x6246('0x17')][_0x6246('0x18')]({'raw':_0x12b023['options']?_0x12b023[_0x6246('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x12b023[_0x6246('0x19')]?_0x12b023[_0x6246('0x19')][_0x6246('0x1a')]||null:null,'attributes':_0x12b023['options']?_0x12b023['options']['attributes']||null:null,'limit':_0x12b023[_0x6246('0x19')]?_0x12b023[_0x6246('0x19')][_0x6246('0x1b')]||null:null,'include':_0x12b023[_0x6246('0x19')]?_0x12b023[_0x6246('0x19')][_0x6246('0x1c')]?_[_0x6246('0x1d')](_0x12b023['options'][_0x6246('0x1c')],function(_0x5113ca){return{'model':db[_0x5113ca[_0x6246('0x1e')]],'as':_0x5113ca['as'],'attributes':_0x5113ca['attributes'],'include':_0x5113ca['include']?_['map'](_0x5113ca[_0x6246('0x1c')],function(_0x52bce9){return{'model':db[_0x52bce9[_0x6246('0x1e')]],'as':_0x52bce9['as'],'attributes':_0x52bce9[_0x6246('0x1f')],'include':_0x52bce9[_0x6246('0x1c')]?_[_0x6246('0x1d')](_0x52bce9[_0x6246('0x1c')],function(_0x4b3fd6){return{'model':db[_0x4b3fd6[_0x6246('0x1e')]],'as':_0x4b3fd6['as'],'attributes':_0x4b3fd6[_0x6246('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6246('0xd')](function(_0x3fe106){logger[_0x6246('0xe')](_0x6246('0x16'),_0x12b023);logger[_0x6246('0x20')]('GetCmHopperBlack',_0x12b023,JSON[_0x6246('0x10')](_0x3fe106));_0x3040a7(_0x3fe106);})[_0x6246('0x15')](function(_0x1a6061){logger[_0x6246('0x11')](_0x6246('0x16'),_0x1a6061[_0x6246('0x13')],_0x12b023);_0x505cdb(_0xaaf8d1['error'](0x1f4,_0x1a6061['message']));});});};exports[_0x6246('0x21')]=function(_0x5e5263){var _0x26199b=this;return new Promise(function(_0x580707,_0x50b81e){return db[_0x6246('0x17')][_0x6246('0x22')](_0x5e5263[_0x6246('0x23')],{'raw':_0x5e5263[_0x6246('0x19')]?_0x5e5263[_0x6246('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e5263['options']?_0x5e5263[_0x6246('0x19')]['where']||null:null,'attributes':_0x5e5263[_0x6246('0x19')]?_0x5e5263['options'][_0x6246('0x1f')]||null:null,'limit':_0x5e5263['options']?_0x5e5263['options'][_0x6246('0x1b')]||null:null})[_0x6246('0xd')](function(_0x537ca7){logger['info']('UpdateCmHopperBlack',_0x5e5263);logger[_0x6246('0x20')](_0x6246('0x21'),_0x5e5263,JSON[_0x6246('0x10')](_0x537ca7));_0x580707(_0x537ca7);})[_0x6246('0x15')](function(_0x21398d){logger[_0x6246('0x11')](_0x6246('0x21'),_0x21398d[_0x6246('0x13')],_0x5e5263);_0x50b81e(_0x26199b[_0x6246('0x11')](0x1f4,_0x21398d[_0x6246('0x13')]));});});};exports[_0x6246('0x24')]=function(_0x2e4ccb){var _0x42b4cc=this;return new Promise(function(_0xeb86fd,_0x49acf2){return db[_0x6246('0x17')][_0x6246('0x25')]({'where':_0x2e4ccb[_0x6246('0x19')]?_0x2e4ccb[_0x6246('0x19')][_0x6246('0x1a')]||null:null})['then'](function(_0x55ffa5){logger[_0x6246('0xe')]('DestroyCmHopperBlack',_0x2e4ccb);logger['debug'](_0x6246('0x24'),_0x2e4ccb,JSON[_0x6246('0x10')](_0x55ffa5));_0xeb86fd(_0x55ffa5);})[_0x6246('0x15')](function(_0x114d12){logger[_0x6246('0x11')](_0x6246('0x24'),_0x114d12[_0x6246('0x13')],_0x2e4ccb);_0x49acf2(_0x42b4cc['error'](0x1f4,_0x114d12[_0x6246('0x13')]));});});}; \ No newline at end of file +var _0xb8b2=['rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperBlack,\x20%s,\x20%s','message','info','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','catch','UpdateCmHopperBlack','body','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x306ce9,_0x5308c6){var _0x3f653d=function(_0x45352e){while(--_0x45352e){_0x306ce9['push'](_0x306ce9['shift']());}};_0x3f653d(++_0x5308c6);}(_0xb8b2,0x1e7));var _0x2b8b=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0xb8b2[_0x513047];return _0x15b779;};'use strict';var _=require(_0x2b8b('0x0'));var util=require(_0x2b8b('0x1'));var moment=require(_0x2b8b('0x2'));var BPromise=require('bluebird');var rs=require(_0x2b8b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b8b('0x4'))['db'];var utils=require(_0x2b8b('0x5'));var logger=require(_0x2b8b('0x6'))(_0x2b8b('0x7'));var config=require(_0x2b8b('0x8'));var jayson=require(_0x2b8b('0x9'));var client=jayson[_0x2b8b('0xa')][_0x2b8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52d174,_0x51eb60,_0x5d3870){return new BPromise(function(_0x34999a,_0x59b21b){return client[_0x2b8b('0xc')](_0x52d174,_0x5d3870)[_0x2b8b('0xd')](function(_0x58e11a){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x51eb60,_0x2b8b('0xe'));logger[_0x2b8b('0xf')](_0x2b8b('0x10'),_0x51eb60,_0x2b8b('0xe'),JSON[_0x2b8b('0x11')](_0x58e11a));if(_0x58e11a['error']){if(_0x58e11a['error']['code']===0x1f4){logger[_0x2b8b('0x12')](_0x2b8b('0x13'),_0x51eb60,_0x58e11a['error'][_0x2b8b('0x14')]);return _0x59b21b(_0x58e11a[_0x2b8b('0x12')]['message']);}logger[_0x2b8b('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x51eb60,_0x58e11a['error'][_0x2b8b('0x14')]);return _0x34999a(_0x58e11a[_0x2b8b('0x12')][_0x2b8b('0x14')]);}else{logger[_0x2b8b('0x15')]('CmHopperBlack,\x20%s,\x20%s',_0x51eb60,_0x2b8b('0xe'));_0x34999a(_0x58e11a['result'][_0x2b8b('0x14')]);}})['catch'](function(_0x1a8cf2){logger[_0x2b8b('0x12')](_0x2b8b('0x13'),_0x51eb60,_0x1a8cf2);_0x59b21b(_0x1a8cf2);});});}exports[_0x2b8b('0x16')]=function(_0x1d234a){var _0x2d6d68=this;return new Promise(function(_0x27a691,_0x4363e3){return db[_0x2b8b('0x17')][_0x2b8b('0x18')]({'raw':_0x1d234a[_0x2b8b('0x19')]?_0x1d234a[_0x2b8b('0x19')][_0x2b8b('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d234a['options']?_0x1d234a[_0x2b8b('0x19')][_0x2b8b('0x1b')]||null:null,'attributes':_0x1d234a['options']?_0x1d234a[_0x2b8b('0x19')][_0x2b8b('0x1c')]||null:null,'limit':_0x1d234a[_0x2b8b('0x19')]?_0x1d234a[_0x2b8b('0x19')][_0x2b8b('0x1d')]||null:null,'include':_0x1d234a[_0x2b8b('0x19')]?_0x1d234a[_0x2b8b('0x19')][_0x2b8b('0x1e')]?_[_0x2b8b('0x1f')](_0x1d234a[_0x2b8b('0x19')][_0x2b8b('0x1e')],function(_0x178952){return{'model':db[_0x178952[_0x2b8b('0x20')]],'as':_0x178952['as'],'attributes':_0x178952[_0x2b8b('0x1c')],'include':_0x178952['include']?_['map'](_0x178952['include'],function(_0x95071d){return{'model':db[_0x95071d['model']],'as':_0x95071d['as'],'attributes':_0x95071d[_0x2b8b('0x1c')],'include':_0x95071d[_0x2b8b('0x1e')]?_[_0x2b8b('0x1f')](_0x95071d[_0x2b8b('0x1e')],function(_0x233f03){return{'model':db[_0x233f03[_0x2b8b('0x20')]],'as':_0x233f03['as'],'attributes':_0x233f03[_0x2b8b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2b8b('0xd')](function(_0x3754c3){logger[_0x2b8b('0x15')](_0x2b8b('0x16'),_0x1d234a);logger[_0x2b8b('0xf')]('GetCmHopperBlack',_0x1d234a,JSON[_0x2b8b('0x11')](_0x3754c3));_0x27a691(_0x3754c3);})[_0x2b8b('0x21')](function(_0x553899){logger[_0x2b8b('0x12')](_0x2b8b('0x16'),_0x553899[_0x2b8b('0x14')],_0x1d234a);_0x4363e3(_0x2d6d68['error'](0x1f4,_0x553899[_0x2b8b('0x14')]));});});};exports[_0x2b8b('0x22')]=function(_0x9d61e7){var _0x39b958=this;return new Promise(function(_0x374889,_0x8130e8){return db[_0x2b8b('0x17')]['update'](_0x9d61e7[_0x2b8b('0x23')],{'raw':_0x9d61e7[_0x2b8b('0x19')]?_0x9d61e7[_0x2b8b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9d61e7[_0x2b8b('0x19')]?_0x9d61e7[_0x2b8b('0x19')]['where']||null:null,'attributes':_0x9d61e7['options']?_0x9d61e7['options'][_0x2b8b('0x1c')]||null:null,'limit':_0x9d61e7[_0x2b8b('0x19')]?_0x9d61e7[_0x2b8b('0x19')][_0x2b8b('0x1d')]||null:null})[_0x2b8b('0xd')](function(_0x5dd2de){logger[_0x2b8b('0x15')](_0x2b8b('0x22'),_0x9d61e7);logger[_0x2b8b('0xf')](_0x2b8b('0x22'),_0x9d61e7,JSON[_0x2b8b('0x11')](_0x5dd2de));_0x374889(_0x5dd2de);})['catch'](function(_0x35c48f){logger[_0x2b8b('0x12')]('UpdateCmHopperBlack',_0x35c48f[_0x2b8b('0x14')],_0x9d61e7);_0x8130e8(_0x39b958[_0x2b8b('0x12')](0x1f4,_0x35c48f[_0x2b8b('0x14')]));});});};exports[_0x2b8b('0x24')]=function(_0x2647ff){var _0x1faa74=this;return new Promise(function(_0x283694,_0x5e0baa){return db[_0x2b8b('0x17')][_0x2b8b('0x25')]({'where':_0x2647ff['options']?_0x2647ff['options']['where']||null:null})[_0x2b8b('0xd')](function(_0x1ebd8c){logger['info']('DestroyCmHopperBlack',_0x2647ff);logger['debug']('DestroyCmHopperBlack',_0x2647ff,JSON['stringify'](_0x1ebd8c));_0x283694(_0x1ebd8c);})[_0x2b8b('0x21')](function(_0x4cb7cf){logger[_0x2b8b('0x12')]('DestroyCmHopperBlack',_0x4cb7cf[_0x2b8b('0x14')],_0x2647ff);_0x5e0baa(_0x1faa74[_0x2b8b('0x12')](0x1f4,_0x4cb7cf[_0x2b8b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 90badf2..d4ae940 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 _0xafb9=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','show','put','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x49c002,_0xc95790){var _0x550cc6=function(_0x136c2b){while(--_0x136c2b){_0x49c002['push'](_0x49c002['shift']());}};_0x550cc6(++_0xc95790);}(_0xafb9,0x68));var _0x9afb=function(_0x1d2bea,_0x5e06f7){_0x1d2bea=_0x1d2bea-0x0;var _0x1b4f88=_0xafb9[_0x1d2bea];return _0x1b4f88;};'use strict';var multer=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var path=require(_0x9afb('0x2'));var timeout=require(_0x9afb('0x3'));var express=require(_0x9afb('0x4'));var router=express[_0x9afb('0x5')]();var fs_extra=require(_0x9afb('0x6'));var auth=require(_0x9afb('0x7'));var interaction=require(_0x9afb('0x8'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x9afb('0x9')]('/',auth['isAuthenticated'](),controller[_0x9afb('0xa')]);router['get']('/describe',auth[_0x9afb('0xb')](),controller[_0x9afb('0xc')]);router[_0x9afb('0x9')]('/:id',auth[_0x9afb('0xb')](),controller[_0x9afb('0xd')]);router[_0x9afb('0xe')](_0x9afb('0xf'),auth[_0x9afb('0xb')](),controller['update']);router['delete'](_0x9afb('0xf'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x10')]);module[_0x9afb('0x11')]=router; \ No newline at end of file +var _0x3d04=['show','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','describe','/:id'];(function(_0x1695e0,_0x223cce){var _0x17c6b0=function(_0x54600e){while(--_0x54600e){_0x1695e0['push'](_0x1695e0['shift']());}};_0x17c6b0(++_0x223cce);}(_0x3d04,0xbe));var _0x43d0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d04[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var path=require(_0x43d0('0x2'));var timeout=require(_0x43d0('0x3'));var express=require(_0x43d0('0x4'));var router=express[_0x43d0('0x5')]();var fs_extra=require(_0x43d0('0x6'));var auth=require(_0x43d0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x43d0('0x8'));var controller=require(_0x43d0('0x9'));router[_0x43d0('0xa')]('/',auth[_0x43d0('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x43d0('0xc')]);router[_0x43d0('0xa')](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller[_0x43d0('0xe')]);router['put']('/:id',auth[_0x43d0('0xb')](),controller['update']);router['delete'](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller[_0x43d0('0xf')]);module[_0x43d0('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 298b31d..b3d2b54 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 _0xcb58=['exports','STRING','DATE','INTEGER','endtime','setDataValue','diff','seconds','BOOLEAN','sequelize'];(function(_0xf248da,_0x51dbd2){var _0x3dd20e=function(_0x3506a7){while(--_0x3506a7){_0xf248da['push'](_0xf248da['shift']());}};_0x3dd20e(++_0x51dbd2);}(_0xcb58,0x1a3));var _0x8cb5=function(_0x139016,_0xffbd4e){_0x139016=_0x139016-0x0;var _0x36da7c=_0xcb58[_0x139016];return _0x36da7c;};'use strict';var Sequelize=require(_0x8cb5('0x0'));var moment=require('moment');module[_0x8cb5('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8cb5('0x2')]},'scheduledat':{'type':Sequelize[_0x8cb5('0x3')]},'countbusyretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8cb5('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x8cb5('0x2')]},'originatecalleridname':{'type':Sequelize[_0x8cb5('0x2')]},'calleridnum':{'type':Sequelize[_0x8cb5('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x8cb5('0x3')]},'responsetime':{'type':Sequelize[_0x8cb5('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x8cb5('0x3')]},'endtime':{'type':Sequelize[_0x8cb5('0x3')]},'ringtime':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8cb5('0x2')]},'campaign':{'type':Sequelize[_0x8cb5('0x2')]},'campaigntype':{'type':Sequelize[_0x8cb5('0x2')]},'membername':{'type':Sequelize[_0x8cb5('0x2')]},'reason':{'type':Sequelize[_0x8cb5('0x2')]},'disposition':{'type':Sequelize[_0x8cb5('0x2')]},'secondDisposition':{'type':Sequelize[_0x8cb5('0x2')]},'thirdDisposition':{'type':Sequelize[_0x8cb5('0x2')]},'dispositionat':{'type':Sequelize[_0x8cb5('0x3')],'set':function(_0x5d4f29){var _0x4be419=this['getDataValue'](_0x8cb5('0x5'));if(_0x4be419&&_0x5d4f29){this[_0x8cb5('0x6')]('followuptime',moment(_0x5d4f29)[_0x8cb5('0x7')](moment(_0x4be419),_0x8cb5('0x8')));}}},'amd':{'type':Sequelize[_0x8cb5('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8cb5('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8cb5('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x8cb5('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x8cb5('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8cb5('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8cb5('0x3')]},'deleted':{'type':Sequelize[_0x8cb5('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8cb5('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8cb5('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe392=['sequelize','exports','INTEGER','DATE','STRING','endtime','setDataValue','followuptime','seconds','BOOLEAN'];(function(_0x3bc054,_0x44f192){var _0x3871bb=function(_0x2369b1){while(--_0x2369b1){_0x3bc054['push'](_0x3bc054['shift']());}};_0x3871bb(++_0x44f192);}(_0xe392,0xd2));var _0x2e39=function(_0x699c5a,_0xa9b993){_0x699c5a=_0x699c5a-0x0;var _0xda3a36=_0xe392[_0x699c5a];return _0xda3a36;};'use strict';var Sequelize=require(_0x2e39('0x0'));var moment=require('moment');module[_0x2e39('0x1')]={'state':{'type':Sequelize[_0x2e39('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x2e39('0x3')]},'countbusyretry':{'type':Sequelize[_0x2e39('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2e39('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2e39('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2e39('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x2e39('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2e39('0x4')]},'starttime':{'type':Sequelize[_0x2e39('0x3')]},'responsetime':{'type':Sequelize[_0x2e39('0x3')]},'answertime':{'type':Sequelize[_0x2e39('0x3')]},'droptime':{'type':Sequelize[_0x2e39('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x2e39('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2e39('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2e39('0x4')]},'campaign':{'type':Sequelize[_0x2e39('0x4')]},'campaigntype':{'type':Sequelize[_0x2e39('0x4')]},'membername':{'type':Sequelize[_0x2e39('0x4')]},'reason':{'type':Sequelize[_0x2e39('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2e39('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2e39('0x4')]},'dispositionat':{'type':Sequelize[_0x2e39('0x3')],'set':function(_0x10b589){var _0xe75ea0=this['getDataValue'](_0x2e39('0x5'));if(_0xe75ea0&&_0x10b589){this[_0x2e39('0x6')](_0x2e39('0x7'),moment(_0x10b589)['diff'](moment(_0xe75ea0),_0x2e39('0x8')));}}},'amd':{'type':Sequelize[_0x2e39('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2e39('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2e39('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2e39('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2e39('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x2e39('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x2e39('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2e39('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x2e39('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2e39('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2e39('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2e39('0x2')],'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 6cb4be4..495ef72 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 _0xd117=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','CmHopperFinal','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format'];(function(_0x5397fe,_0x430598){var _0x289fff=function(_0x4f0bde){while(--_0x4f0bde){_0x5397fe['push'](_0x5397fe['shift']());}};_0x289fff(++_0x430598);}(_0xd117,0x182));var _0x7d11=function(_0x4a563b,_0x36f42d){_0x4a563b=_0x4a563b-0x0;var _0x2935ef=_0xd117[_0x4a563b];return _0x2935ef;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':!![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['describe']()['then'](respondWithResult(_0x193631,null))['catch'](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x1e5bb5,_0x20297a){if(_0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')]){delete _0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'uniqueid':_0x1e5bb5[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x20297a,null))[_0x7d11('0x22')](saveUpdates(_0x1e5bb5['body'],null))[_0x7d11('0x22')](respondWithResult(_0x20297a,null))[_0x7d11('0x40')](handleError(_0x20297a,null));};exports[_0x7d11('0x4a')]=function(_0x553a03,_0x503ebc,_0x14db1c){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x553a03['params']['id']},'attributes':[[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x4e')))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),_0x7d11('0x50')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize']['literal'](_0x7d11('0x51')))),_0x7d11('0x52')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x57')))),_0x7d11('0x58')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x503ebc,null))[_0x7d11('0x22')](respondWithResult(_0x503ebc,null))['catch'](handleError(_0x503ebc,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x52d62d,_0x32c551,_0x12f05b){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'CampaignId':_0x52d62d[_0x7d11('0x42')]['id']},'attributes':[[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x59')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x5a')))),'busyContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x51')))),'congestionContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db['sequelize']['fn']('IF',db[_0x7d11('0x4c')]['literal'](_0x7d11('0x57')))),'reCallContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x7d11('0x5b')]]})[_0x7d11('0x22')](handleEntityNotFound(_0x32c551,null))[_0x7d11('0x22')](respondWithResult(_0x32c551,null))['catch'](handleError(_0x32c551,null));};exports[_0x7d11('0x5c')]=function(_0x3c656b,_0x31cb39,_0x1b89de){return db[_0x7d11('0x5d')][_0x7d11('0x45')]({'where':{'id':_0x3c656b['params']['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x31cb39,null))['then'](function(_0x1fd598){var _0x4c88c6;if(_0x1fd598){_0x4c88c6=squel['insert']()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')]([_0x7d11('0x61'),_0x7d11('0x62'),_0x7d11('0x63'),_0x7d11('0x64'),_0x7d11('0x65'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field'](_0x7d11('0x69'),'phone')[_0x7d11('0x6a')](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')]('ANY_VALUE(ListId)','ListId')[_0x7d11('0x6a')](_0x7d11('0x6d'),_0x7d11('0x65'))[_0x7d11('0x6a')](_0x7d11('0x6b'),'createdAt')[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())[_0x7d11('0x38')]('state\x20=\x20?',_0x3c656b['body'][_0x7d11('0x72')][_0x7d11('0x71')]())[_0x7d11('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel['select']()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))['where'](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))[_0x7d11('0x38')](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x74'))['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())['where'](_0x7d11('0x75')))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db[_0x7d11('0x4c')]['query'](_0x4c88c6);}return[];})['then'](respondWithResult(_0x31cb39,null))['catch'](handleError(_0x31cb39,null));};exports[_0x7d11('0x77')]=function(_0x4c15e9,_0x2a9e92,_0x5459d1){return db['Campaign'][_0x7d11('0x45')]({'where':{'id':_0x4c15e9[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x2a9e92,null))[_0x7d11('0x22')](function(_0x345fb3){var _0x32a17a;if(_0x345fb3){_0x32a17a=squel[_0x7d11('0x78')]()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')](['phone',_0x7d11('0x62'),_0x7d11('0x63'),'ListId',_0x7d11('0x79'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field']('ANY_VALUE(calleridnum)',_0x7d11('0x61'))['field'](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')](_0x7d11('0x7a'),'ListId')[_0x7d11('0x6a')](_0x7d11('0x7b'),_0x7d11('0x79'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x66'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))['where'](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())[_0x7d11('0x38')](_0x7d11('0x7d'),_0x4c15e9['body'][_0x7d11('0x72')]['toString']())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7d11('0x68')]()[_0x7d11('0x6a')]('calleridnum')['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())['where']('state\x20=\x204'))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db['sequelize'][_0x7d11('0x2d')](_0x32a17a);}return[];})[_0x7d11('0x22')](respondWithResult(_0x2a9e92,null))['catch'](handleError(_0x2a9e92,null));};exports[_0x7d11('0x7e')]=function(_0x1cb457,_0x59f0db,_0x5e5faf){return db[_0x7d11('0x7f')][_0x7d11('0x80')]({'where':{'VoiceQueueId':_0x1cb457['body']['VoiceQueueId'],'CampaignId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x79')],'ContactId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x63')]}})['then'](handleEntityNotFound(_0x59f0db,null))[_0x7d11('0x22')](function(_0x2cfa77){if(_0x2cfa77){return _0x2cfa77;}return null;})[_0x7d11('0x22')](respondWithResult(_0x59f0db,null))[_0x7d11('0x40')](handleError(_0x59f0db,null));}; \ No newline at end of file +var _0x5fab=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','describe','body','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','select','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','NOW()','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','Campaign','insert','CampaignId','createdAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','status'];(function(_0x525ab5,_0x404107){var _0x4a5fed=function(_0x2f4514){while(--_0x2f4514){_0x525ab5['push'](_0x525ab5['shift']());}};_0x4a5fed(++_0x404107);}(_0x5fab,0x177));var _0xb5fa=function(_0x61711c,_0x5b2962){_0x61711c=_0x61711c-0x0;var _0x4cf0e9=_0x5fab[_0x61711c];return _0x4cf0e9;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['CmHopperFinal'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':!![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')]()[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,null))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x42a359,_0x3a39f2){if(_0x42a359['body']['uniqueid']){delete _0x42a359[_0xb5fa('0x4d')]['uniqueid'];}return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')]({'where':{'uniqueid':_0x42a359['params']['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x3a39f2,null))[_0xb5fa('0x43')](saveUpdates(_0x42a359[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x3a39f2,null))[_0xb5fa('0x4b')](handleError(_0x3a39f2,null));};exports[_0xb5fa('0x4e')]=function(_0x51d5f7,_0x27a651,_0x4fd5bf){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x51d5f7[_0xb5fa('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x58')))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5a')))),'dropContacts'],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),_0xb5fa('0x5f')]]})[_0xb5fa('0x43')](handleEntityNotFound(_0x27a651,null))[_0xb5fa('0x43')](respondWithResult(_0x27a651,null))[_0xb5fa('0x4b')](handleError(_0x27a651,null));};exports[_0xb5fa('0x60')]=function(_0x18cde9,_0x40d7d5,_0xd2ba4e){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'CampaignId':_0x18cde9[_0xb5fa('0x46')]['id']},'attributes':[[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db['sequelize']['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x208,\x201,\x20null'))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb5fa('0x61')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x62')))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),'answeringMachine']]})[_0xb5fa('0x43')](handleEntityNotFound(_0x40d7d5,null))[_0xb5fa('0x43')](respondWithResult(_0x40d7d5,null))[_0xb5fa('0x4b')](handleError(_0x40d7d5,null));};exports[_0xb5fa('0x63')]=function(_0x339dfb,_0x56e6b0,_0x1585cd){return db['VoiceQueue'][_0xb5fa('0x4a')]({'where':{'id':_0x339dfb[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x56e6b0,null))[_0xb5fa('0x43')](function(_0x5e44d8){var _0x4d1117;if(_0x5e44d8){_0x4d1117=squel['insert']()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')]([_0xb5fa('0x67'),_0xb5fa('0x68'),_0xb5fa('0x69'),'ListId',_0xb5fa('0x6a'),'createdAt','updatedAt'],squel[_0xb5fa('0x6b')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))['field'](_0xb5fa('0x70'),_0xb5fa('0x6a'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'createdAt')[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x72'))[_0xb5fa('0x73')](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb['params']['id'][_0xb5fa('0x76')]())['where'](_0xb5fa('0x77'),_0x339dfb[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))['from'](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb[_0xb5fa('0x46')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')](_0xb5fa('0x74'))['where']('VoiceQueueId\x20=\x20?',_0x339dfb[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db[_0xb5fa('0x50')]['query'](_0x4d1117);}return[];})[_0xb5fa('0x43')](respondWithResult(_0x56e6b0,null))[_0xb5fa('0x4b')](handleError(_0x56e6b0,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x5e6852,_0x391412,_0x3150ac){return db[_0xb5fa('0x7d')][_0xb5fa('0x4a')]({'where':{'id':_0x5e6852[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x391412,null))[_0xb5fa('0x43')](function(_0x25b278){var _0x1a0255;if(_0x25b278){_0x1a0255=squel[_0xb5fa('0x7e')]()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')](['phone','scheduledAt',_0xb5fa('0x69'),'ListId',_0xb5fa('0x7f'),_0xb5fa('0x80'),'updatedAt'],squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')]('ANY_VALUE(calleridnum)',_0xb5fa('0x67'))[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))[_0xb5fa('0x6c')](_0xb5fa('0x81'),_0xb5fa('0x7f'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x80'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'updatedAt')['from'](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x77'),_0x5e6852[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))[_0xb5fa('0x73')](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]()))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')]('cm_hopper_final')[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db['sequelize'][_0xb5fa('0x33')](_0x1a0255);}return[];})['then'](respondWithResult(_0x391412,null))['catch'](handleError(_0x391412,null));};exports[_0xb5fa('0x83')]=function(_0x27dbe8,_0x2faf23,_0x4d607d){return db[_0xb5fa('0x84')][_0xb5fa('0x85')]({'where':{'VoiceQueueId':_0x27dbe8[_0xb5fa('0x4d')]['VoiceQueueId'],'CampaignId':_0x27dbe8[_0xb5fa('0x4d')][_0xb5fa('0x7f')],'ContactId':_0x27dbe8['body'][_0xb5fa('0x69')]}})[_0xb5fa('0x43')](handleEntityNotFound(_0x2faf23,null))[_0xb5fa('0x43')](function(_0xf15d5c){if(_0xf15d5c){return _0xf15d5c;}return null;})[_0xb5fa('0x43')](respondWithResult(_0x2faf23,null))[_0xb5fa('0x4b')](handleError(_0x2faf23,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index a5da2ef..66be20b 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 _0x15e8=['exports','define','cm_hopper_final','calleridnum','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x2a92fc,_0x34d1e6){var _0x236359=function(_0x4845e3){while(--_0x4845e3){_0x2a92fc['push'](_0x2a92fc['shift']());}};_0x236359(++_0x34d1e6);}(_0x15e8,0x1e5));var _0x815e=function(_0x120da5,_0x35e37c){_0x120da5=_0x120da5-0x0;var _0x2564ab=_0x15e8[_0x120da5];return _0x2564ab;};'use strict';var _=require(_0x815e('0x0'));var util=require(_0x815e('0x1'));var logger=require('../../config/logger')(_0x815e('0x2'));var moment=require(_0x815e('0x3'));var BPromise=require(_0x815e('0x4'));var rp=require(_0x815e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x815e('0x6'));var config=require(_0x815e('0x7'));var attributes=require(_0x815e('0x8'));module[_0x815e('0x9')]=function(_0x2eaf6d,_0x4e3286){return _0x2eaf6d[_0x815e('0xa')]('CmHopperFinal',attributes,{'tableName':_0x815e('0xb'),'paranoid':![],'indexes':[{'name':_0x815e('0xc'),'fields':['calleridnum']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xef05=['CmHopperFinal','calleridnum','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','define'];(function(_0x179c89,_0x3a69b2){var _0x4b87e5=function(_0xbdf6f2){while(--_0xbdf6f2){_0x179c89['push'](_0x179c89['shift']());}};_0x4b87e5(++_0x3a69b2);}(_0xef05,0x1d7));var _0x5ef0=function(_0x27c1c5,_0x43e4cf){_0x27c1c5=_0x27c1c5-0x0;var _0x57a7e0=_0xef05[_0x27c1c5];return _0x57a7e0;};'use strict';var _=require(_0x5ef0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5ef0('0x1'));var moment=require(_0x5ef0('0x2'));var BPromise=require(_0x5ef0('0x3'));var rp=require(_0x5ef0('0x4'));var fs=require('fs');var path=require(_0x5ef0('0x5'));var rimraf=require(_0x5ef0('0x6'));var config=require(_0x5ef0('0x7'));var attributes=require(_0x5ef0('0x8'));module['exports']=function(_0x203642,_0x8d4b59){return _0x203642[_0x5ef0('0x9')](_0x5ef0('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x5ef0('0xb'),'fields':[_0x5ef0('0xb')]},{'name':_0x5ef0('0xc'),'fields':[_0x5ef0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index ec8d32e..d652a8c 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5c2219,_0x15ef42){var _0x4d9944=function(_0x4eee87){while(--_0x4eee87){_0x5c2219['push'](_0x5c2219['shift']());}};_0x4d9944(++_0x15ef42);}(_0x7a54,0x106));var _0x47a5=function(_0x4e8bbe,_0x157092){_0x4e8bbe=_0x4e8bbe-0x0;var _0x54b8e4=_0x7a54[_0x4e8bbe];return _0x54b8e4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x1047d5,_0x58e9bc){var _0x36367d=function(_0x538fa9){while(--_0x538fa9){_0x1047d5['push'](_0x1047d5['shift']());}};_0x36367d(++_0x58e9bc);}(_0xb10b,0x12a));var _0xbb10=function(_0x143ca0,_0x586bd3){_0x143ca0=_0x143ca0-0x0;var _0x11f1c5=_0xb10b[_0x143ca0];return _0x11f1c5;};'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 d018051..f24f459 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 _0x28ce=['update','exports','multer','path','express','fs-extra','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put'];(function(_0x305a0f,_0x34b1d9){var _0x109a91=function(_0x50688b){while(--_0x50688b){_0x305a0f['push'](_0x305a0f['shift']());}};_0x109a91(++_0x34b1d9);}(_0x28ce,0xf2));var _0xe28c=function(_0x1711b3,_0x417d1f){_0x1711b3=_0x1711b3-0x0;var _0x227c40=_0x28ce[_0x1711b3];return _0x227c40;};'use strict';var multer=require(_0xe28c('0x0'));var util=require('util');var path=require(_0xe28c('0x1'));var timeout=require('connect-timeout');var express=require(_0xe28c('0x2'));var router=express['Router']();var fs_extra=require(_0xe28c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe28c('0x4'));var controller=require(_0xe28c('0x5'));router[_0xe28c('0x6')]('/',auth[_0xe28c('0x7')](),controller['index']);router[_0xe28c('0x6')](_0xe28c('0x8'),auth[_0xe28c('0x7')](),controller[_0xe28c('0x9')]);router[_0xe28c('0x6')](_0xe28c('0xa'),auth[_0xe28c('0x7')](),controller['show']);router[_0xe28c('0x6')]('/voice/queue/countAttributes/:id',auth[_0xe28c('0x7')](),controller[_0xe28c('0xb')]);router[_0xe28c('0x6')](_0xe28c('0xc'),auth[_0xe28c('0x7')](),controller[_0xe28c('0xd')]);router[_0xe28c('0xe')](_0xe28c('0xf'),auth[_0xe28c('0x7')](),controller[_0xe28c('0x10')]);router['post'](_0xe28c('0x11'),auth[_0xe28c('0x7')](),controller[_0xe28c('0x12')]);router[_0xe28c('0xe')](_0xe28c('0x13'),auth[_0xe28c('0x7')](),controller[_0xe28c('0x14')]);router[_0xe28c('0x15')](_0xe28c('0xa'),auth[_0xe28c('0x7')](),controller[_0xe28c('0x16')]);module[_0xe28c('0x17')]=router; \ No newline at end of file +var _0x5217=['checkContactHopper','put','update','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','moveContactsIvrCampaignHopperFinal','/checkContactHopper'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x5217,0xbb));var _0x7521=function(_0x1f8b9f,_0x3223b0){_0x1f8b9f=_0x1f8b9f-0x0;var _0x754464=_0x5217[_0x1f8b9f];return _0x754464;};'use strict';var multer=require(_0x7521('0x0'));var util=require('util');var path=require(_0x7521('0x1'));var timeout=require('connect-timeout');var express=require(_0x7521('0x2'));var router=express[_0x7521('0x3')]();var fs_extra=require(_0x7521('0x4'));var auth=require(_0x7521('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7521('0x6'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7521('0x7')]);router[_0x7521('0x8')]('/describe',auth[_0x7521('0x9')](),controller[_0x7521('0xa')]);router['get'](_0x7521('0xb'),auth[_0x7521('0x9')](),controller[_0x7521('0xc')]);router[_0x7521('0x8')](_0x7521('0xd'),auth[_0x7521('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x7521('0x8')]('/campaign/countAttributes/:id',auth[_0x7521('0x9')](),controller[_0x7521('0xe')]);router['post'](_0x7521('0xf'),auth[_0x7521('0x9')](),controller[_0x7521('0x10')]);router[_0x7521('0x11')]('/voice/campaign/moveContacts/:id',auth[_0x7521('0x9')](),controller[_0x7521('0x12')]);router[_0x7521('0x11')](_0x7521('0x13'),auth[_0x7521('0x9')](),controller[_0x7521('0x14')]);router[_0x7521('0x15')](_0x7521('0xb'),auth[_0x7521('0x9')](),controller[_0x7521('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index e7af2eb..454f494 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 _0xb50f=['DATE','BOOLEAN','INTEGER','STRING'];(function(_0x3bdf9d,_0x551f5d){var _0x2dca38=function(_0x2eadec){while(--_0x2eadec){_0x3bdf9d['push'](_0x3bdf9d['shift']());}};_0x2dca38(++_0x551f5d);}(_0xb50f,0x66));var _0xfb50=function(_0x28a5eb,_0x513eac){_0x28a5eb=_0x28a5eb-0x0;var _0xb4d010=_0xb50f[_0x28a5eb];return _0xb4d010;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xfb50('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xfb50('0x1')]},'scheduledat':{'type':Sequelize[_0xfb50('0x2')]},'countbusyretry':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xfb50('0x1')]},'originatecalleridname':{'type':Sequelize[_0xfb50('0x1')]},'calleridnum':{'type':Sequelize[_0xfb50('0x1')]},'calleridname':{'type':Sequelize[_0xfb50('0x1')]},'starttime':{'type':Sequelize[_0xfb50('0x2')]},'responsetime':{'type':Sequelize[_0xfb50('0x2')]},'answertime':{'type':Sequelize[_0xfb50('0x2')]},'droptime':{'type':Sequelize[_0xfb50('0x2')]},'endtime':{'type':Sequelize[_0xfb50('0x2')]},'ringtime':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfb50('0x1')]},'campaign':{'type':Sequelize[_0xfb50('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xfb50('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0xfb50('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0xfb50('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfb50('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfb50('0x2')]},'recallme':{'type':Sequelize[_0xfb50('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xfb50('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xfb50('0x1')]}}; \ No newline at end of file +var _0x1b38=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x3cffb3,_0x284b2d){var _0x57a846=function(_0x32a354){while(--_0x32a354){_0x3cffb3['push'](_0x3cffb3['shift']());}};_0x57a846(++_0x284b2d);}(_0x1b38,0x95));var _0x81b3=function(_0x35552f,_0x68a4de){_0x35552f=_0x35552f-0x0;var _0x4d9e8f=_0x1b38[_0x35552f];return _0x4d9e8f;};'use strict';var Sequelize=require(_0x81b3('0x0'));module[_0x81b3('0x1')]={'state':{'type':Sequelize[_0x81b3('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x81b3('0x3')]},'scheduledat':{'type':Sequelize[_0x81b3('0x4')]},'countbusyretry':{'type':Sequelize[_0x81b3('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x81b3('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x81b3('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x81b3('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x81b3('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x81b3('0x3')]},'calleridnum':{'type':Sequelize[_0x81b3('0x3')]},'calleridname':{'type':Sequelize[_0x81b3('0x3')]},'starttime':{'type':Sequelize[_0x81b3('0x4')]},'responsetime':{'type':Sequelize[_0x81b3('0x4')]},'answertime':{'type':Sequelize[_0x81b3('0x4')]},'droptime':{'type':Sequelize[_0x81b3('0x4')]},'endtime':{'type':Sequelize[_0x81b3('0x4')]},'ringtime':{'type':Sequelize[_0x81b3('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x81b3('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x81b3('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x81b3('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x81b3('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x81b3('0x3')]},'membername':{'type':Sequelize[_0x81b3('0x3')]},'reason':{'type':Sequelize[_0x81b3('0x3')]},'amd':{'type':Sequelize[_0x81b3('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x81b3('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x81b3('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x81b3('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x81b3('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x81b3('0x4')]},'edited':{'type':Sequelize[_0x81b3('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x81b3('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x81b3('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x81b3('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x81b3('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x81b3('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index d010de2..5213fb5 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 _0x5626=['filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','rawAttributes','keys','length','include','find','create','body','describe','uniqueid','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','stack','name','send','index','CmHopperHistory','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x15fa90,_0x1189ff){var _0x91c2f7=function(_0x4151c7){while(--_0x4151c7){_0x15fa90['push'](_0x15fa90['shift']());}};_0x91c2f7(++_0x1189ff);}(_0x5626,0x1da));var _0x6562=function(_0x2bf1cc,_0x32742f){_0x2bf1cc=_0x2bf1cc-0x0;var _0x15e663=_0x5626[_0x2bf1cc];return _0x15e663;};'use strict';var emlformat=require(_0x6562('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6562('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6562('0x2'));var moment=require(_0x6562('0x3'));var BPromise=require(_0x6562('0x4'));var Mustache=require(_0x6562('0x5'));var util=require(_0x6562('0x6'));var path=require(_0x6562('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6562('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6562('0x9'));var jsforce=require(_0x6562('0xa'));var deskjs=require(_0x6562('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6562('0xc'));var Papa=require(_0x6562('0xd'));var Redis=require(_0x6562('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6562('0xf'));var as=require(_0x6562('0x10'));var hardwareService=require(_0x6562('0x11'));var logger=require(_0x6562('0x12'))(_0x6562('0x13'));var utils=require(_0x6562('0x14'));var config=require(_0x6562('0x15'));var licenseUtil=require(_0x6562('0x16'));var db=require(_0x6562('0x17'))['db'];function respondWithStatusCode(_0x5e82fd,_0x293e77){_0x293e77=_0x293e77||0xcc;return function(_0x20ac12){if(_0x20ac12){return _0x5e82fd[_0x6562('0x18')](_0x293e77);}return _0x5e82fd['status'](_0x293e77)[_0x6562('0x19')]();};}function respondWithResult(_0x1ee64d,_0x12e67e){_0x12e67e=_0x12e67e||0xc8;return function(_0x11b7f8){if(_0x11b7f8){return _0x1ee64d[_0x6562('0x1a')](_0x12e67e)[_0x6562('0x1b')](_0x11b7f8);}};}function respondWithFilteredResult(_0x5f3088,_0x3b4c11){return function(_0x8f6c6){if(_0x8f6c6){var _0x3132f9=typeof _0x3b4c11['offset']===_0x6562('0x1c')&&typeof _0x3b4c11[_0x6562('0x1d')]==='undefined';var _0x5bfce1=_0x8f6c6[_0x6562('0x1e')];var _0x413159=_0x3132f9?0x0:_0x3b4c11[_0x6562('0x1f')];var _0x10bd05=_0x3132f9?_0x8f6c6['count']:_0x3b4c11['offset']+_0x3b4c11[_0x6562('0x1d')];var _0x23160b;if(_0x10bd05>=_0x5bfce1){_0x10bd05=_0x5bfce1;_0x23160b=0xc8;}else{_0x23160b=0xce;}_0x5f3088['status'](_0x23160b);return _0x5f3088[_0x6562('0x20')](_0x6562('0x21'),_0x413159+'-'+_0x10bd05+'/'+_0x5bfce1)[_0x6562('0x1b')](_0x8f6c6);}return null;};}function patchUpdates(_0x5c5b2e){return function(_0x494b39){try{jsonpatch[_0x6562('0x22')](_0x494b39,_0x5c5b2e,!![]);}catch(_0x22c3c9){return BPromise['reject'](_0x22c3c9);}return _0x494b39['save']();};}function saveUpdates(_0x14fac1,_0x343f2e){return function(_0x1e522){if(_0x1e522){return _0x1e522[_0x6562('0x23')](_0x14fac1)[_0x6562('0x24')](function(_0x177929){return _0x177929;});}return null;};}function removeEntity(_0x581b4f,_0x31191b){return function(_0x299b39){if(_0x299b39){return _0x299b39[_0x6562('0x25')]()[_0x6562('0x24')](function(){_0x581b4f[_0x6562('0x1a')](0xcc)[_0x6562('0x19')]();});}};}function handleEntityNotFound(_0x6d1579,_0x54bd1c){return function(_0x18b032){if(!_0x18b032){_0x6d1579[_0x6562('0x18')](0x194);}return _0x18b032;};}function handleError(_0x120547,_0x198848){_0x198848=_0x198848||0x1f4;return function(_0x4ec3c1){logger['error'](_0x4ec3c1[_0x6562('0x26')]);if(_0x4ec3c1[_0x6562('0x27')]){delete _0x4ec3c1['name'];}_0x120547[_0x6562('0x1a')](_0x198848)[_0x6562('0x28')](_0x4ec3c1);};}exports[_0x6562('0x29')]=function(_0x57154d,_0x326e29){var _0x510981={},_0x213be5={},_0x2af0f9={'count':0x0,'rows':[]};var _0x3c2ec5=_['map'](db[_0x6562('0x2a')]['rawAttributes'],function(_0x1b340b){return{'name':_0x1b340b[_0x6562('0x2b')],'type':_0x1b340b[_0x6562('0x2c')]['key']};});_0x213be5[_0x6562('0x2d')]=_[_0x6562('0x2e')](_0x3c2ec5,'name');_0x213be5[_0x6562('0x2f')]=_['keys'](_0x57154d[_0x6562('0x2f')]);_0x213be5[_0x6562('0x30')]=_[_0x6562('0x31')](_0x213be5[_0x6562('0x2d')],_0x213be5[_0x6562('0x2f')]);_0x510981[_0x6562('0x32')]=_['intersection'](_0x213be5[_0x6562('0x2d')],qs[_0x6562('0x33')](_0x57154d[_0x6562('0x2f')][_0x6562('0x33')]));_0x510981[_0x6562('0x32')]=_0x510981[_0x6562('0x32')]['length']?_0x510981[_0x6562('0x32')]:_0x213be5['model'];if(!_0x57154d['query'][_0x6562('0x34')](_0x6562('0x35'))){_0x510981[_0x6562('0x1d')]=qs[_0x6562('0x1d')](_0x57154d[_0x6562('0x2f')][_0x6562('0x1d')]);_0x510981[_0x6562('0x1f')]=qs['offset'](_0x57154d[_0x6562('0x2f')][_0x6562('0x1f')]);}_0x510981[_0x6562('0x36')]=qs[_0x6562('0x37')](_0x57154d['query'][_0x6562('0x37')]);_0x510981[_0x6562('0x38')]=qs[_0x6562('0x30')](_[_0x6562('0x39')](_0x57154d['query'],_0x213be5[_0x6562('0x30')]),_0x3c2ec5);if(_0x57154d['query'][_0x6562('0x3a')]){_0x510981[_0x6562('0x38')]=_['merge'](_0x510981['where'],{'$or':_['map'](_0x3c2ec5,function(_0x4c386d){if(_0x4c386d[_0x6562('0x2c')]!==_0x6562('0x3b')){var _0x1b076f={};_0x1b076f[_0x4c386d[_0x6562('0x27')]]={'$like':'%'+_0x57154d[_0x6562('0x2f')][_0x6562('0x3a')]+'%'};return _0x1b076f;}})});}_0x510981=_[_0x6562('0x3c')]({},_0x510981,_0x57154d['options']);var _0x22390d={'where':_0x510981[_0x6562('0x38')]};return db['CmHopperHistory']['count'](_0x22390d)[_0x6562('0x24')](function(_0x25ebf3){_0x2af0f9[_0x6562('0x1e')]=_0x25ebf3;if(_0x57154d[_0x6562('0x2f')][_0x6562('0x3d')]){_0x510981['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x6562('0x3e')](_0x510981);})[_0x6562('0x24')](function(_0x34a3b4){_0x2af0f9[_0x6562('0x3f')]=_0x34a3b4;return _0x2af0f9;})['then'](respondWithFilteredResult(_0x326e29,_0x510981))[_0x6562('0x40')](handleError(_0x326e29,null));};exports[_0x6562('0x41')]=function(_0x2d5af6,_0x194b39){var _0x521069={'raw':!![],'where':{'id':_0x2d5af6['params']['id']}},_0x12f389={};_0x12f389[_0x6562('0x2d')]=_['keys'](db[_0x6562('0x2a')][_0x6562('0x42')]);_0x12f389[_0x6562('0x2f')]=_[_0x6562('0x43')](_0x2d5af6[_0x6562('0x2f')]);_0x12f389[_0x6562('0x30')]=_[_0x6562('0x31')](_0x12f389['model'],_0x12f389[_0x6562('0x2f')]);_0x521069[_0x6562('0x32')]=_[_0x6562('0x31')](_0x12f389[_0x6562('0x2d')],qs[_0x6562('0x33')](_0x2d5af6[_0x6562('0x2f')][_0x6562('0x33')]));_0x521069[_0x6562('0x32')]=_0x521069[_0x6562('0x32')][_0x6562('0x44')]?_0x521069['attributes']:_0x12f389[_0x6562('0x2d')];if(_0x2d5af6['query']['includeAll']){_0x521069[_0x6562('0x45')]=[{'all':!![]}];}_0x521069=_[_0x6562('0x3c')]({},_0x521069,_0x2d5af6['options']);return db[_0x6562('0x2a')][_0x6562('0x46')](_0x521069)[_0x6562('0x24')](handleEntityNotFound(_0x194b39,null))[_0x6562('0x24')](respondWithResult(_0x194b39,null))['catch'](handleError(_0x194b39,null));};exports['create']=function(_0x24afbc,_0x47c7c5){return db['CmHopperHistory'][_0x6562('0x47')](_0x24afbc[_0x6562('0x48')],{})[_0x6562('0x24')](respondWithResult(_0x47c7c5,0xc9))[_0x6562('0x40')](handleError(_0x47c7c5,null));};exports[_0x6562('0x49')]=function(_0x334029,_0x256e32){return db[_0x6562('0x2a')][_0x6562('0x49')]()[_0x6562('0x24')](respondWithResult(_0x256e32,null))[_0x6562('0x40')](handleError(_0x256e32,null));};exports[_0x6562('0x23')]=function(_0x2d448d,_0x266c86){if(_0x2d448d['body'][_0x6562('0x4a')]){delete _0x2d448d[_0x6562('0x48')][_0x6562('0x4a')];}return db['CmHopperHistory'][_0x6562('0x46')]({'where':{'uniqueid':_0x2d448d[_0x6562('0x4b')]['id']}})[_0x6562('0x24')](handleEntityNotFound(_0x266c86,null))['then'](saveUpdates(_0x2d448d[_0x6562('0x48')],null))[_0x6562('0x24')](respondWithResult(_0x266c86,null))[_0x6562('0x40')](handleError(_0x266c86,null));}; \ No newline at end of file +var _0x7478=['order','sort','where','pick','filter','merge','type','options','CmHopperHistory','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x7478,0xf3));var _0x8747=function(_0x8eaad,_0x2920ce){_0x8eaad=_0x8eaad-0x0;var _0x188d71=_0x7478[_0x8eaad];return _0x188d71;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8747('0x0'));var zipdir=require(_0x8747('0x1'));var jsonpatch=require(_0x8747('0x2'));var rp=require(_0x8747('0x3'));var moment=require(_0x8747('0x4'));var BPromise=require(_0x8747('0x5'));var Mustache=require(_0x8747('0x6'));var util=require(_0x8747('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8747('0x8'));var ejs=require(_0x8747('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8747('0xa'));var jsforce=require(_0x8747('0xb'));var deskjs=require(_0x8747('0xc'));var toCsv=require(_0x8747('0x8'));var querystring=require(_0x8747('0xd'));var Papa=require(_0x8747('0xe'));var Redis=require(_0x8747('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8747('0x10'));var as=require(_0x8747('0x11'));var hardwareService=require(_0x8747('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x8747('0x13'));var config=require(_0x8747('0x14'));var licenseUtil=require(_0x8747('0x15'));var db=require(_0x8747('0x16'))['db'];function respondWithStatusCode(_0x18e753,_0x69706d){_0x69706d=_0x69706d||0xcc;return function(_0x307974){if(_0x307974){return _0x18e753['sendStatus'](_0x69706d);}return _0x18e753[_0x8747('0x17')](_0x69706d)['end']();};}function respondWithResult(_0x573fad,_0x3ab5e1){_0x3ab5e1=_0x3ab5e1||0xc8;return function(_0x5c2ee7){if(_0x5c2ee7){return _0x573fad[_0x8747('0x17')](_0x3ab5e1)[_0x8747('0x18')](_0x5c2ee7);}};}function respondWithFilteredResult(_0x1b671d,_0xcd3fbf){return function(_0x2e5dfe){if(_0x2e5dfe){var _0xbb8020=typeof _0xcd3fbf['offset']==='undefined'&&typeof _0xcd3fbf[_0x8747('0x19')]===_0x8747('0x1a');var _0x34b440=_0x2e5dfe[_0x8747('0x1b')];var _0x55bd9e=_0xbb8020?0x0:_0xcd3fbf[_0x8747('0x1c')];var _0x46bf90=_0xbb8020?_0x2e5dfe[_0x8747('0x1b')]:_0xcd3fbf[_0x8747('0x1c')]+_0xcd3fbf[_0x8747('0x19')];var _0x2d69c4;if(_0x46bf90>=_0x34b440){_0x46bf90=_0x34b440;_0x2d69c4=0xc8;}else{_0x2d69c4=0xce;}_0x1b671d[_0x8747('0x17')](_0x2d69c4);return _0x1b671d['set'](_0x8747('0x1d'),_0x55bd9e+'-'+_0x46bf90+'/'+_0x34b440)[_0x8747('0x18')](_0x2e5dfe);}return null;};}function patchUpdates(_0x2c397d){return function(_0x116af9){try{jsonpatch[_0x8747('0x1e')](_0x116af9,_0x2c397d,!![]);}catch(_0x415e2e){return BPromise[_0x8747('0x1f')](_0x415e2e);}return _0x116af9[_0x8747('0x20')]();};}function saveUpdates(_0x2299a2,_0x171e69){return function(_0x492b1b){if(_0x492b1b){return _0x492b1b[_0x8747('0x21')](_0x2299a2)[_0x8747('0x22')](function(_0x2a3c9f){return _0x2a3c9f;});}return null;};}function removeEntity(_0xb22765,_0x2c0cb4){return function(_0x595f22){if(_0x595f22){return _0x595f22[_0x8747('0x23')]()[_0x8747('0x22')](function(){_0xb22765['status'](0xcc)[_0x8747('0x24')]();});}};}function handleEntityNotFound(_0x385692,_0x1ae979){return function(_0x2ff763){if(!_0x2ff763){_0x385692['sendStatus'](0x194);}return _0x2ff763;};}function handleError(_0x28ab53,_0x336b9f){_0x336b9f=_0x336b9f||0x1f4;return function(_0x518979){logger[_0x8747('0x25')](_0x518979[_0x8747('0x26')]);if(_0x518979[_0x8747('0x27')]){delete _0x518979[_0x8747('0x27')];}_0x28ab53[_0x8747('0x17')](_0x336b9f)[_0x8747('0x28')](_0x518979);};}exports[_0x8747('0x29')]=function(_0x45bebb,_0x1fe2a5){var _0x1ef5a4={},_0x4727e4={},_0x53cd33={'count':0x0,'rows':[]};var _0x511c97=_[_0x8747('0x2a')](db['CmHopperHistory'][_0x8747('0x2b')],function(_0x5cff8e){return{'name':_0x5cff8e['fieldName'],'type':_0x5cff8e['type']['key']};});_0x4727e4[_0x8747('0x2c')]=_[_0x8747('0x2a')](_0x511c97,_0x8747('0x27'));_0x4727e4['query']=_['keys'](_0x45bebb[_0x8747('0x2d')]);_0x4727e4[_0x8747('0x2e')]=_[_0x8747('0x2f')](_0x4727e4[_0x8747('0x2c')],_0x4727e4['query']);_0x1ef5a4[_0x8747('0x30')]=_[_0x8747('0x2f')](_0x4727e4[_0x8747('0x2c')],qs[_0x8747('0x31')](_0x45bebb[_0x8747('0x2d')][_0x8747('0x31')]));_0x1ef5a4[_0x8747('0x30')]=_0x1ef5a4[_0x8747('0x30')][_0x8747('0x32')]?_0x1ef5a4[_0x8747('0x30')]:_0x4727e4[_0x8747('0x2c')];if(!_0x45bebb[_0x8747('0x2d')][_0x8747('0x33')](_0x8747('0x34'))){_0x1ef5a4[_0x8747('0x19')]=qs[_0x8747('0x19')](_0x45bebb[_0x8747('0x2d')][_0x8747('0x19')]);_0x1ef5a4['offset']=qs['offset'](_0x45bebb[_0x8747('0x2d')][_0x8747('0x1c')]);}_0x1ef5a4[_0x8747('0x35')]=qs[_0x8747('0x36')](_0x45bebb[_0x8747('0x2d')][_0x8747('0x36')]);_0x1ef5a4[_0x8747('0x37')]=qs[_0x8747('0x2e')](_[_0x8747('0x38')](_0x45bebb[_0x8747('0x2d')],_0x4727e4[_0x8747('0x2e')]),_0x511c97);if(_0x45bebb[_0x8747('0x2d')][_0x8747('0x39')]){_0x1ef5a4[_0x8747('0x37')]=_[_0x8747('0x3a')](_0x1ef5a4[_0x8747('0x37')],{'$or':_['map'](_0x511c97,function(_0x543255){if(_0x543255[_0x8747('0x3b')]!=='VIRTUAL'){var _0x3fca55={};_0x3fca55[_0x543255['name']]={'$like':'%'+_0x45bebb['query'][_0x8747('0x39')]+'%'};return _0x3fca55;}})});}_0x1ef5a4=_['merge']({},_0x1ef5a4,_0x45bebb[_0x8747('0x3c')]);var _0x105120={'where':_0x1ef5a4[_0x8747('0x37')]};return db[_0x8747('0x3d')][_0x8747('0x1b')](_0x105120)['then'](function(_0x1c3117){_0x53cd33[_0x8747('0x1b')]=_0x1c3117;if(_0x45bebb['query'][_0x8747('0x3e')]){_0x1ef5a4[_0x8747('0x3f')]=[{'all':!![]}];}return db[_0x8747('0x3d')][_0x8747('0x40')](_0x1ef5a4);})[_0x8747('0x22')](function(_0x33abf3){_0x53cd33[_0x8747('0x41')]=_0x33abf3;return _0x53cd33;})[_0x8747('0x22')](respondWithFilteredResult(_0x1fe2a5,_0x1ef5a4))[_0x8747('0x42')](handleError(_0x1fe2a5,null));};exports[_0x8747('0x43')]=function(_0x1bb1e4,_0x31fb6f){var _0x4a2dee={'raw':!![],'where':{'id':_0x1bb1e4[_0x8747('0x44')]['id']}},_0x59bc90={};_0x59bc90['model']=_[_0x8747('0x45')](db[_0x8747('0x3d')][_0x8747('0x2b')]);_0x59bc90[_0x8747('0x2d')]=_[_0x8747('0x45')](_0x1bb1e4['query']);_0x59bc90['filters']=_['intersection'](_0x59bc90[_0x8747('0x2c')],_0x59bc90[_0x8747('0x2d')]);_0x4a2dee[_0x8747('0x30')]=_[_0x8747('0x2f')](_0x59bc90[_0x8747('0x2c')],qs['fields'](_0x1bb1e4[_0x8747('0x2d')][_0x8747('0x31')]));_0x4a2dee[_0x8747('0x30')]=_0x4a2dee[_0x8747('0x30')][_0x8747('0x32')]?_0x4a2dee[_0x8747('0x30')]:_0x59bc90['model'];if(_0x1bb1e4[_0x8747('0x2d')][_0x8747('0x3e')]){_0x4a2dee['include']=[{'all':!![]}];}_0x4a2dee=_['merge']({},_0x4a2dee,_0x1bb1e4[_0x8747('0x3c')]);return db[_0x8747('0x3d')][_0x8747('0x46')](_0x4a2dee)[_0x8747('0x22')](handleEntityNotFound(_0x31fb6f,null))[_0x8747('0x22')](respondWithResult(_0x31fb6f,null))[_0x8747('0x42')](handleError(_0x31fb6f,null));};exports[_0x8747('0x47')]=function(_0x28608b,_0x17c7cc){return db[_0x8747('0x3d')]['create'](_0x28608b[_0x8747('0x48')],{})[_0x8747('0x22')](respondWithResult(_0x17c7cc,0xc9))['catch'](handleError(_0x17c7cc,null));};exports[_0x8747('0x49')]=function(_0x41655b,_0x20ef19){return db['CmHopperHistory'][_0x8747('0x49')]()[_0x8747('0x22')](respondWithResult(_0x20ef19,null))[_0x8747('0x42')](handleError(_0x20ef19,null));};exports[_0x8747('0x21')]=function(_0x4359dd,_0x238d79){if(_0x4359dd[_0x8747('0x48')]['uniqueid']){delete _0x4359dd[_0x8747('0x48')]['uniqueid'];}return db['CmHopperHistory'][_0x8747('0x46')]({'where':{'uniqueid':_0x4359dd[_0x8747('0x44')]['id']}})['then'](handleEntityNotFound(_0x238d79,null))[_0x8747('0x22')](saveUpdates(_0x4359dd[_0x8747('0x48')],null))[_0x8747('0x22')](respondWithResult(_0x238d79,null))[_0x8747('0x42')](handleError(_0x238d79,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index ad7debf..b961461 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 _0xaafc=['endtime','uniqueid','util','../../config/logger','api','moment','request-promise','path','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xaafc,0x176));var _0xcaaf=function(_0x2acda9,_0x58bb23){_0x2acda9=_0x2acda9-0x0;var _0x425922=_0xaafc[_0x2acda9];return _0x425922;};'use strict';var _=require('lodash');var util=require(_0xcaaf('0x0'));var logger=require(_0xcaaf('0x1'))(_0xcaaf('0x2'));var moment=require(_0xcaaf('0x3'));var BPromise=require('bluebird');var rp=require(_0xcaaf('0x4'));var fs=require('fs');var path=require(_0xcaaf('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcaaf('0x6'));module['exports']=function(_0x291f15,_0x54757a){return _0x291f15[_0xcaaf('0x7')](_0xcaaf('0x8'),attributes,{'tableName':_0xcaaf('0x9'),'paranoid':![],'indexes':[{'name':_0xcaaf('0xa'),'fields':['endtime']},{'name':_0xcaaf('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0137=['../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x36d754,_0x7ce514){var _0xcf4f02=function(_0x3b336e){while(--_0x3b336e){_0x36d754['push'](_0x36d754['shift']());}};_0xcf4f02(++_0x7ce514);}(_0x0137,0x1d8));var _0x7013=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x0137[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var logger=require(_0x7013('0x2'))(_0x7013('0x3'));var moment=require(_0x7013('0x4'));var BPromise=require('bluebird');var rp=require(_0x7013('0x5'));var fs=require('fs');var path=require(_0x7013('0x6'));var rimraf=require(_0x7013('0x7'));var config=require(_0x7013('0x8'));var attributes=require(_0x7013('0x9'));module[_0x7013('0xa')]=function(_0x50b822,_0x24cb85){return _0x50b822[_0x7013('0xb')]('CmHopperHistory',attributes,{'tableName':_0x7013('0xc'),'paranoid':![],'indexes':[{'name':_0x7013('0xd'),'fields':[_0x7013('0xd')]},{'name':'uniqueid','fields':[_0x7013('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 7917fce..8650858 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 _0xe706=['GetCampaignHopperHistory','findAll','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateCmHopperHistory','create','body','options','raw','stringify','AvgHandleTime','CmHopperHistory','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`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=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xe706,0xa3));var _0x6e70=function(_0x3e6aed,_0x97a2f1){_0x3e6aed=_0x3e6aed-0x0;var _0x3220dd=_0xe706[_0x3e6aed];return _0x3220dd;};'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']('CmHopperHistory,\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']('CmHopperHistory,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['CmHopperHistory'][_0x6e70('0x1a')](_0x5ea7a5[_0x6e70('0x1b')],{'raw':_0x5ea7a5[_0x6e70('0x1c')]?_0x5ea7a5[_0x6e70('0x1c')][_0x6e70('0x1d')]===undefined?!![]:![]:!![]})[_0x6e70('0xe')](function(_0x1b2453){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('CreateCmHopperHistory',_0x5ea7a5,JSON[_0x6e70('0x1e')](_0x1b2453));_0x173afe(_0x1b2453);})[_0x6e70('0x18')](function(_0x27b294){logger['error'](_0x6e70('0x19'),_0x27b294[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0x27b294['message']));});});};exports[_0x6e70('0x1f')]=function(_0x538b9c){var _0x50aec2=this;return new Promise(function(_0x4e97c7,_0x41e352){return db[_0x6e70('0x20')]['findAll']({'raw':_0x538b9c[_0x6e70('0x1c')]?_0x538b9c[_0x6e70('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x538b9c[_0x6e70('0x1c')]?_0x538b9c[_0x6e70('0x1c')][_0x6e70('0x21')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x6e70('0x22')][_0x6e70('0x23')]('id')),_0x6e70('0x24')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x27')))),_0x6e70('0x28')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x29')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x6e70('0x22')]['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x2a')))),_0x6e70('0x2b')],[db['sequelize']['fn'](_0x6e70('0x2c'),db[_0x6e70('0x22')]['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x2d')))),'predictiveIntervalAvgHoldtime'],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x2c'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x2e')))),_0x6e70('0x2f')]]})[_0x6e70('0xe')](function(_0xf146fd){logger[_0x6e70('0xf')]('AvgHandleTime',_0x538b9c);logger[_0x6e70('0x12')]('AvgHandleTime',_0x538b9c,JSON[_0x6e70('0x1e')](_0xf146fd));_0x4e97c7(_0xf146fd);})[_0x6e70('0x18')](function(_0x98c683){logger[_0x6e70('0x14')](_0x6e70('0x1f'),_0x98c683[_0x6e70('0x16')],_0x538b9c);_0x41e352(_0x50aec2[_0x6e70('0x14')](0x1f4,_0x98c683[_0x6e70('0x16')]));});});};exports[_0x6e70('0x30')]=function(_0x198dd1){var _0x2a5444=this;return new Promise(function(_0x23d5e2,_0x5594d3){return db['CmHopperHistory']['findAll']({'raw':_0x198dd1['options']?_0x198dd1[_0x6e70('0x1c')][_0x6e70('0x1d')]===undefined?!![]:![]:!![],'where':_0x198dd1[_0x6e70('0x1c')]?_0x198dd1[_0x6e70('0x1c')][_0x6e70('0x21')]||null:null,'attributes':[[_0x6e70('0x31'),'name'],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x32')))),_0x6e70('0x33')],[db[_0x6e70('0x22')]['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x34')))),_0x6e70('0x35')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x6e70('0x27')))),_0x6e70('0x36')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x37')))),_0x6e70('0x38')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6e70('0x22')]['literal'](_0x6e70('0x39')))),_0x6e70('0x3a')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db[_0x6e70('0x22')]['literal'](_0x6e70('0x3b')))),_0x6e70('0x3c')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x3d')))),_0x6e70('0x3e')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x3f')))),_0x6e70('0x40')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')]['literal'](_0x6e70('0x41')))),'outboundBlacklistCallsDay'],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x42')))),_0x6e70('0x43')],[db['sequelize']['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x44')))),_0x6e70('0x45')],[db[_0x6e70('0x22')]['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x46')))),_0x6e70('0x47')],[db['sequelize']['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x48')))),_0x6e70('0x45')],[db['sequelize']['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x49')))),'outboundReCallsDay']],'group':[_0x6e70('0x31')]})[_0x6e70('0xe')](function(_0x2c20d3){logger[_0x6e70('0xf')](_0x6e70('0x30'),_0x198dd1);logger[_0x6e70('0x12')]('GetVoiceQueueHopperHistory',_0x198dd1,JSON[_0x6e70('0x1e')](_0x2c20d3));_0x23d5e2(_0x2c20d3);})[_0x6e70('0x18')](function(_0x5c2396){logger[_0x6e70('0x14')](_0x6e70('0x30'),_0x5c2396['message'],_0x198dd1);_0x5594d3(_0x2a5444[_0x6e70('0x14')](0x1f4,_0x5c2396[_0x6e70('0x16')]));});});};exports[_0x6e70('0x4a')]=function(_0x46d536){var _0xfcadfe=this;return new Promise(function(_0x53f8fc,_0x385825){return db[_0x6e70('0x20')][_0x6e70('0x4b')]({'raw':_0x46d536[_0x6e70('0x1c')]?_0x46d536[_0x6e70('0x1c')][_0x6e70('0x1d')]===undefined?!![]:![]:!![],'where':_0x46d536[_0x6e70('0x1c')]?_0x46d536[_0x6e70('0x1c')][_0x6e70('0x21')]||null:null,'attributes':[[_0x6e70('0x31'),_0x6e70('0x4c')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')][_0x6e70('0x23')]('id')),_0x6e70('0x4d')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')]['literal'](_0x6e70('0x27')))),_0x6e70('0x4e')]],'group':[_0x6e70('0x31')]})[_0x6e70('0xe')](function(_0x36757e){logger[_0x6e70('0xf')]('GetCampaignHopperHistory',_0x46d536);logger[_0x6e70('0x12')](_0x6e70('0x4a'),_0x46d536,JSON['stringify'](_0x36757e));_0x53f8fc(_0x36757e);})[_0x6e70('0x18')](function(_0x692205){logger[_0x6e70('0x14')]('GetCampaignHopperHistory',_0x692205['message'],_0x46d536);_0x385825(_0xfcadfe[_0x6e70('0x14')](0x1f4,_0x692205[_0x6e70('0x16')]));});});}; \ No newline at end of file +var _0x4e83=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','AvgHandleTime','raw','where','COUNT','col','sequelize','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e83,0x88));var _0x34e8=function(_0x1fa873,_0x1319ab){_0x1fa873=_0x1fa873-0x0;var _0x599fbc=_0x4e83[_0x1fa873];return _0x599fbc;};'use strict';var _=require('lodash');var util=require(_0x34e8('0x0'));var moment=require(_0x34e8('0x1'));var BPromise=require(_0x34e8('0x2'));var rs=require(_0x34e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34e8('0x4'))['db'];var utils=require(_0x34e8('0x5'));var logger=require(_0x34e8('0x6'))(_0x34e8('0x7'));var config=require(_0x34e8('0x8'));var jayson=require(_0x34e8('0x9'));var client=jayson[_0x34e8('0xa')][_0x34e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x320b00,_0x146a1f,_0x188f11){return new BPromise(function(_0x18e178,_0x3ace57){return client['request'](_0x320b00,_0x188f11)[_0x34e8('0xc')](function(_0x200425){logger[_0x34e8('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x146a1f,_0x34e8('0xe'));logger[_0x34e8('0xf')](_0x34e8('0x10'),_0x146a1f,_0x34e8('0xe'),JSON[_0x34e8('0x11')](_0x200425));if(_0x200425['error']){if(_0x200425[_0x34e8('0x12')]['code']===0x1f4){logger[_0x34e8('0x12')](_0x34e8('0x13'),_0x146a1f,_0x200425[_0x34e8('0x12')][_0x34e8('0x14')]);return _0x3ace57(_0x200425[_0x34e8('0x12')][_0x34e8('0x14')]);}logger['error'](_0x34e8('0x13'),_0x146a1f,_0x200425['error'][_0x34e8('0x14')]);return _0x18e178(_0x200425['error'][_0x34e8('0x14')]);}else{logger[_0x34e8('0xd')](_0x34e8('0x13'),_0x146a1f,'request\x20sent');_0x18e178(_0x200425[_0x34e8('0x15')]['message']);}})[_0x34e8('0x16')](function(_0xed8219){logger[_0x34e8('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x146a1f,_0xed8219);_0x3ace57(_0xed8219);});});}exports[_0x34e8('0x17')]=function(_0x1a2fa7){var _0x3b83bb=this;return new Promise(function(_0x38edda,_0x326416){return db[_0x34e8('0x18')][_0x34e8('0x19')](_0x1a2fa7[_0x34e8('0x1a')],{'raw':_0x1a2fa7[_0x34e8('0x1b')]?_0x1a2fa7[_0x34e8('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x34e8('0xc')](function(_0x7462d9){logger[_0x34e8('0xd')](_0x34e8('0x17'),_0x1a2fa7);logger[_0x34e8('0xf')](_0x34e8('0x17'),_0x1a2fa7,JSON[_0x34e8('0x11')](_0x7462d9));_0x38edda(_0x7462d9);})[_0x34e8('0x16')](function(_0x39947b){logger[_0x34e8('0x12')](_0x34e8('0x17'),_0x39947b[_0x34e8('0x14')],_0x1a2fa7);_0x326416(_0x3b83bb[_0x34e8('0x12')](0x1f4,_0x39947b[_0x34e8('0x14')]));});});};exports[_0x34e8('0x1c')]=function(_0x250321){var _0x3df27a=this;return new Promise(function(_0x210d13,_0x3ad08e){return db[_0x34e8('0x18')]['findAll']({'raw':_0x250321['options']?_0x250321['options'][_0x34e8('0x1d')]===undefined?!![]:![]:!![],'where':_0x250321[_0x34e8('0x1b')]?_0x250321[_0x34e8('0x1b')][_0x34e8('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x34e8('0x1f'),db['sequelize'][_0x34e8('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0x34e8('0x21')]['fn']('COUNT',db[_0x34e8('0x21')]['fn']('IF',db[_0x34e8('0x21')][_0x34e8('0x22')](_0x34e8('0x23')))),'predictiveIntervalAnsweredCalls'],[db[_0x34e8('0x21')]['fn'](_0x34e8('0x1f'),db[_0x34e8('0x21')]['fn']('IF',db['sequelize'][_0x34e8('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),_0x34e8('0x24')],[db['sequelize']['fn'](_0x34e8('0x1f'),db[_0x34e8('0x21')]['fn']('IF',db[_0x34e8('0x21')][_0x34e8('0x22')](_0x34e8('0x25')))),_0x34e8('0x26')],[db[_0x34e8('0x21')]['fn']('AVG',db[_0x34e8('0x21')]['fn']('IF',db['sequelize'][_0x34e8('0x22')](_0x34e8('0x27')))),_0x34e8('0x28')],[db[_0x34e8('0x21')]['fn'](_0x34e8('0x29'),db[_0x34e8('0x21')]['fn']('IF',db[_0x34e8('0x21')]['literal'](_0x34e8('0x2a')))),_0x34e8('0x2b')]]})[_0x34e8('0xc')](function(_0x35e21c){logger[_0x34e8('0xd')](_0x34e8('0x1c'),_0x250321);logger[_0x34e8('0xf')](_0x34e8('0x1c'),_0x250321,JSON[_0x34e8('0x11')](_0x35e21c));_0x210d13(_0x35e21c);})[_0x34e8('0x16')](function(_0x370d43){logger[_0x34e8('0x12')](_0x34e8('0x1c'),_0x370d43['message'],_0x250321);_0x3ad08e(_0x3df27a[_0x34e8('0x12')](0x1f4,_0x370d43['message']));});});};exports[_0x34e8('0x2c')]=function(_0x183edc){var _0x3f0dce=this;return new Promise(function(_0x22bc84,_0x2afc29){return db['CmHopperHistory'][_0x34e8('0x2d')]({'raw':_0x183edc[_0x34e8('0x1b')]?_0x183edc[_0x34e8('0x1b')][_0x34e8('0x1d')]===undefined?!![]:![]:!![],'where':_0x183edc[_0x34e8('0x1b')]?_0x183edc[_0x34e8('0x1b')]['where']||null:null,'attributes':[[_0x34e8('0x2e'),_0x34e8('0x2f')],[db[_0x34e8('0x21')]['fn'](_0x34e8('0x1f'),db['sequelize']['fn']('IF',db[_0x34e8('0x21')]['literal'](_0x34e8('0x30')))),_0x34e8('0x31')],[db[_0x34e8('0x21')]['fn'](_0x34e8('0x1f'),db[_0x34e8('0x21')]['fn']('IF',db['sequelize'][_0x34e8('0x22')]('`state`\x20=\x203,\x201,\x20null'))),_0x34e8('0x32')],[db[_0x34e8('0x21')]['fn'](_0x34e8('0x1f'),db[_0x34e8('0x21')]['fn']('IF',db[_0x34e8('0x21')][_0x34e8('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x34e8('0x33')],[db[_0x34e8('0x21')]['fn'](_0x34e8('0x1f'),db['sequelize']['fn']('IF',db[_0x34e8('0x21')][_0x34e8('0x22')]('`state`\x20=\x205,\x201,\x20null'))),_0x34e8('0x34')],[db[_0x34e8('0x21')]['fn'](_0x34e8('0x1f'),db[_0x34e8('0x21')]['fn']('IF',db['sequelize'][_0x34e8('0x22')](_0x34e8('0x35')))),_0x34e8('0x36')],[db[_0x34e8('0x21')]['fn'](_0x34e8('0x1f'),db[_0x34e8('0x21')]['fn']('IF',db[_0x34e8('0x21')][_0x34e8('0x22')](_0x34e8('0x37')))),_0x34e8('0x38')],[db[_0x34e8('0x21')]['fn'](_0x34e8('0x1f'),db['sequelize']['fn']('IF',db[_0x34e8('0x21')]['literal'](_0x34e8('0x39')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x34e8('0x3a')))),'outboundUnknownCallsDay'],[db['sequelize']['fn'](_0x34e8('0x1f'),db[_0x34e8('0x21')]['fn']('IF',db[_0x34e8('0x21')][_0x34e8('0x22')](_0x34e8('0x3b')))),_0x34e8('0x3c')],[db['sequelize']['fn'](_0x34e8('0x1f'),db[_0x34e8('0x21')]['fn']('IF',db[_0x34e8('0x21')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0x34e8('0x3d')],[db['sequelize']['fn'](_0x34e8('0x1f'),db['sequelize']['fn']('IF',db[_0x34e8('0x21')][_0x34e8('0x22')](_0x34e8('0x3e')))),'outboundRejectCallsDay'],[db[_0x34e8('0x21')]['fn'](_0x34e8('0x1f'),db['sequelize']['fn']('IF',db[_0x34e8('0x21')][_0x34e8('0x22')](_0x34e8('0x3f')))),_0x34e8('0x40')],[db['sequelize']['fn'](_0x34e8('0x1f'),db[_0x34e8('0x21')]['fn']('IF',db[_0x34e8('0x21')]['literal'](_0x34e8('0x41')))),'outboundRejectCallsDay'],[db[_0x34e8('0x21')]['fn'](_0x34e8('0x1f'),db[_0x34e8('0x21')]['fn']('IF',db['sequelize'][_0x34e8('0x22')](_0x34e8('0x42')))),_0x34e8('0x43')]],'group':[_0x34e8('0x2e')]})[_0x34e8('0xc')](function(_0x313205){logger['info'](_0x34e8('0x2c'),_0x183edc);logger['debug'](_0x34e8('0x2c'),_0x183edc,JSON['stringify'](_0x313205));_0x22bc84(_0x313205);})['catch'](function(_0x4f3185){logger[_0x34e8('0x12')](_0x34e8('0x2c'),_0x4f3185[_0x34e8('0x14')],_0x183edc);_0x2afc29(_0x3f0dce[_0x34e8('0x12')](0x1f4,_0x4f3185[_0x34e8('0x14')]));});});};exports[_0x34e8('0x44')]=function(_0x58ea5a){var _0x2aebd3=this;return new Promise(function(_0x15a7b6,_0x29d7e5){return db['CmHopperHistory'][_0x34e8('0x2d')]({'raw':_0x58ea5a['options']?_0x58ea5a[_0x34e8('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x58ea5a['options']?_0x58ea5a[_0x34e8('0x1b')][_0x34e8('0x1e')]||null:null,'attributes':[[_0x34e8('0x2e'),'name'],[db['sequelize']['fn'](_0x34e8('0x1f'),db['sequelize'][_0x34e8('0x20')]('id')),_0x34e8('0x45')],[db[_0x34e8('0x21')]['fn'](_0x34e8('0x1f'),db[_0x34e8('0x21')]['fn']('IF',db['sequelize']['literal'](_0x34e8('0x23')))),_0x34e8('0x46')]],'group':['campaign']})[_0x34e8('0xc')](function(_0x4d1876){logger[_0x34e8('0xd')](_0x34e8('0x44'),_0x58ea5a);logger[_0x34e8('0xf')](_0x34e8('0x44'),_0x58ea5a,JSON['stringify'](_0x4d1876));_0x15a7b6(_0x4d1876);})[_0x34e8('0x16')](function(_0x56fb47){logger['error'](_0x34e8('0x44'),_0x56fb47[_0x34e8('0x14')],_0x58ea5a);_0x29d7e5(_0x2aebd3[_0x34e8('0x12')](0x1f4,_0x56fb47[_0x34e8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 352e023..2767f23 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 _0xbf89=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','get','/describe','describe','/:id','show','put','update'];(function(_0x44d52b,_0x450552){var _0xc022f1=function(_0x246fd9){while(--_0x246fd9){_0x44d52b['push'](_0x44d52b['shift']());}};_0xc022f1(++_0x450552);}(_0xbf89,0xa3));var _0x9bf8=function(_0xd5709b,_0x101823){_0xd5709b=_0xd5709b-0x0;var _0x3dc484=_0xbf89[_0xd5709b];return _0x3dc484;};'use strict';var multer=require(_0x9bf8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9bf8('0x1'));var express=require(_0x9bf8('0x2'));var router=express[_0x9bf8('0x3')]();var fs_extra=require(_0x9bf8('0x4'));var auth=require(_0x9bf8('0x5'));var interaction=require(_0x9bf8('0x6'));var config=require(_0x9bf8('0x7'));var controller=require(_0x9bf8('0x8'));router['get']('/',auth[_0x9bf8('0x9')](),controller['index']);router[_0x9bf8('0xa')](_0x9bf8('0xb'),auth[_0x9bf8('0x9')](),controller[_0x9bf8('0xc')]);router[_0x9bf8('0xa')](_0x9bf8('0xd'),auth[_0x9bf8('0x9')](),controller[_0x9bf8('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9bf8('0xf')](_0x9bf8('0xd'),auth[_0x9bf8('0x9')](),controller[_0x9bf8('0x10')]);module[_0x9bf8('0x11')]=router; \ No newline at end of file +var _0x9a1b=['get','isAuthenticated','/describe','describe','/:id','show','post','create','put','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller'];(function(_0x1b2dcd,_0x378314){var _0x3ad1ae=function(_0xb452ae){while(--_0xb452ae){_0x1b2dcd['push'](_0x1b2dcd['shift']());}};_0x3ad1ae(++_0x378314);}(_0x9a1b,0x13a));var _0xb9a1=function(_0x5a7a57,_0x1a78d7){_0x5a7a57=_0x5a7a57-0x0;var _0x48ebe9=_0x9a1b[_0x5a7a57];return _0x48ebe9;};'use strict';var multer=require(_0xb9a1('0x0'));var util=require(_0xb9a1('0x1'));var path=require(_0xb9a1('0x2'));var timeout=require(_0xb9a1('0x3'));var express=require(_0xb9a1('0x4'));var router=express[_0xb9a1('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb9a1('0x6'));var config=require(_0xb9a1('0x7'));var controller=require(_0xb9a1('0x8'));router[_0xb9a1('0x9')]('/',auth[_0xb9a1('0xa')](),controller['index']);router[_0xb9a1('0x9')](_0xb9a1('0xb'),auth[_0xb9a1('0xa')](),controller[_0xb9a1('0xc')]);router[_0xb9a1('0x9')](_0xb9a1('0xd'),auth[_0xb9a1('0xa')](),controller[_0xb9a1('0xe')]);router[_0xb9a1('0xf')]('/',auth[_0xb9a1('0xa')](),controller[_0xb9a1('0x10')]);router[_0xb9a1('0x11')](_0xb9a1('0xd'),auth[_0xb9a1('0xa')](),controller['update']);module[_0xb9a1('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 8830fdc..1efdee4 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 _0xafe6=['STRING','sequelize','exports'];(function(_0x3e540c,_0x504924){var _0xe0faa4=function(_0x987813){while(--_0x987813){_0x3e540c['push'](_0x3e540c['shift']());}};_0xe0faa4(++_0x504924);}(_0xafe6,0xac));var _0x6afe=function(_0x3dd027,_0xe45609){_0x3dd027=_0x3dd027-0x0;var _0x177e67=_0xafe6[_0x3dd027];return _0x177e67;};'use strict';var Sequelize=require(_0x6afe('0x0'));module[_0x6afe('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6afe('0x2')]},'dialPrefix':{'type':Sequelize[_0x6afe('0x2')]}}; \ No newline at end of file +var _0xdc03=['STRING','name','sequelize'];(function(_0x52c4e9,_0x5412d0){var _0x252a03=function(_0x57857c){while(--_0x57857c){_0x52c4e9['push'](_0x52c4e9['shift']());}};_0x252a03(++_0x5412d0);}(_0xdc03,0x65));var _0x3dc0=function(_0x34c3c0,_0x59ea62){_0x34c3c0=_0x34c3c0-0x0;var _0x306f70=_0xdc03[_0x34c3c0];return _0x306f70;};'use strict';var Sequelize=require(_0x3dc0('0x0'));module['exports']={'name':{'type':Sequelize[_0x3dc0('0x1')],'unique':_0x3dc0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x3dc0('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 98a3c73..7a4615c 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 _0x03de=['addContacts','CmContact','tags','isArray','each','omit','ids','push','errors','message','json','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','select','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','customField_','alias','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','from','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','text/csv','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','defaultValue','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','limit','count','offset','set','apply','update','then','destroy','Lists','name','index','map','CmList','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','body','ListId','Disposition','findOne','length','options','findAll','removeDispositions'];(function(_0x1d793b,_0x30138e){var _0x69586a=function(_0x2b439c){while(--_0x2b439c){_0x1d793b['push'](_0x1d793b['shift']());}};_0x69586a(++_0x30138e);}(_0x03de,0xde));var _0xe03d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03de[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe03d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe03d('0x1'));var jsonpatch=require(_0xe03d('0x2'));var rp=require('request-promise');var moment=require(_0xe03d('0x3'));var BPromise=require(_0xe03d('0x4'));var Mustache=require(_0xe03d('0x5'));var util=require(_0xe03d('0x6'));var path=require(_0xe03d('0x7'));var sox=require('sox');var csv=require(_0xe03d('0x8'));var ejs=require(_0xe03d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe03d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe03d('0xb'));var deskjs=require(_0xe03d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe03d('0xd'));var Papa=require(_0xe03d('0xe'));var Redis=require(_0xe03d('0xf'));var authService=require(_0xe03d('0x10'));var qs=require(_0xe03d('0x11'));var as=require(_0xe03d('0x12'));var hardwareService=require(_0xe03d('0x13'));var logger=require(_0xe03d('0x14'))(_0xe03d('0x15'));var utils=require(_0xe03d('0x16'));var config=require(_0xe03d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe03d('0x18'))['db'];var csv_results;config[_0xe03d('0x19')]=_[_0xe03d('0x1a')](config[_0xe03d('0x19')],{'host':_0xe03d('0x1b'),'port':0x18eb});var socket=require(_0xe03d('0x1c'))(new Redis(config[_0xe03d('0x19')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0xe9663d,_0x296367){_0x296367=_0x296367||0xcc;return function(_0x2c7e8c){if(_0x2c7e8c){return _0xe9663d[_0xe03d('0x1d')](_0x296367);}return _0xe9663d[_0xe03d('0x1e')](_0x296367)[_0xe03d('0x1f')]();};}function respondWithResult(_0x4e062a,_0x2045d4){_0x2045d4=_0x2045d4||0xc8;return function(_0xe089c){if(_0xe089c){return _0x4e062a[_0xe03d('0x1e')](_0x2045d4)['json'](_0xe089c);}};}function respondWithFilteredResult(_0x213cc1,_0x3deee1){return function(_0x3abdec){if(_0x3abdec){var _0x3c4f08=typeof _0x3deee1['offset']==='undefined'&&typeof _0x3deee1[_0xe03d('0x20')]==='undefined';var _0x3676de=_0x3abdec[_0xe03d('0x21')];var _0x5dac64=_0x3c4f08?0x0:_0x3deee1[_0xe03d('0x22')];var _0x41ac6f=_0x3c4f08?_0x3abdec[_0xe03d('0x21')]:_0x3deee1[_0xe03d('0x22')]+_0x3deee1[_0xe03d('0x20')];var _0x23a3dc;if(_0x41ac6f>=_0x3676de){_0x41ac6f=_0x3676de;_0x23a3dc=0xc8;}else{_0x23a3dc=0xce;}_0x213cc1[_0xe03d('0x1e')](_0x23a3dc);return _0x213cc1[_0xe03d('0x23')]('Content-Range',_0x5dac64+'-'+_0x41ac6f+'/'+_0x3676de)['json'](_0x3abdec);}return null;};}function patchUpdates(_0x5cc28d){return function(_0x5091ac){try{jsonpatch[_0xe03d('0x24')](_0x5091ac,_0x5cc28d,!![]);}catch(_0x399a9c){return BPromise['reject'](_0x399a9c);}return _0x5091ac['save']();};}function saveUpdates(_0x40b043,_0x5bcebe){return function(_0x37867e){if(_0x37867e){return _0x37867e[_0xe03d('0x25')](_0x40b043)[_0xe03d('0x26')](function(_0x30accf){return _0x30accf;});}return null;};}function removeEntity(_0x32a598,_0x5a1af7){return function(_0x2d9e7f){if(_0x2d9e7f){return _0x2d9e7f[_0xe03d('0x27')]()[_0xe03d('0x26')](function(){var _0xfed4e9=_0x2d9e7f['get']({'plain':!![]});var _0x5bbd26=_0xe03d('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x5bbd26,'resourceId':_0xfed4e9['id']}})[_0xe03d('0x26')](function(){return _0x2d9e7f;});})['then'](function(){_0x32a598[_0xe03d('0x1e')](0xcc)[_0xe03d('0x1f')]();});}};}function handleEntityNotFound(_0x2d96b1,_0x5e418d){return function(_0x162506){if(!_0x162506){_0x2d96b1[_0xe03d('0x1d')](0x194);}return _0x162506;};}function handleError(_0x22eba2,_0x54079f){_0x54079f=_0x54079f||0x1f4;return function(_0x4bcd7a){logger['error'](_0x4bcd7a['stack']);if(_0x4bcd7a['name']){delete _0x4bcd7a[_0xe03d('0x29')];}_0x22eba2[_0xe03d('0x1e')](_0x54079f)['send'](_0x4bcd7a);};}exports[_0xe03d('0x2a')]=function(_0x5c6cd2,_0x582fe3){var _0x559fa4={},_0x258108={},_0x1b0e29={'count':0x0,'rows':[]};var _0xa153c8=_[_0xe03d('0x2b')](db[_0xe03d('0x2c')][_0xe03d('0x2d')],function(_0x3d8aab){return{'name':_0x3d8aab[_0xe03d('0x2e')],'type':_0x3d8aab[_0xe03d('0x2f')][_0xe03d('0x30')]};});_0x258108['model']=_[_0xe03d('0x2b')](_0xa153c8,_0xe03d('0x29'));_0x258108[_0xe03d('0x31')]=_[_0xe03d('0x32')](_0x5c6cd2[_0xe03d('0x31')]);_0x258108['filters']=_[_0xe03d('0x33')](_0x258108[_0xe03d('0x34')],_0x258108[_0xe03d('0x31')]);_0x559fa4['attributes']=_[_0xe03d('0x33')](_0x258108[_0xe03d('0x34')],qs[_0xe03d('0x35')](_0x5c6cd2['query'][_0xe03d('0x35')]));_0x559fa4[_0xe03d('0x36')]=_0x559fa4['attributes']['length']?_0x559fa4[_0xe03d('0x36')]:_0x258108[_0xe03d('0x34')];if(!_0x5c6cd2['query'][_0xe03d('0x37')](_0xe03d('0x38'))){_0x559fa4[_0xe03d('0x20')]=qs[_0xe03d('0x20')](_0x5c6cd2[_0xe03d('0x31')][_0xe03d('0x20')]);_0x559fa4[_0xe03d('0x22')]=qs[_0xe03d('0x22')](_0x5c6cd2[_0xe03d('0x31')][_0xe03d('0x22')]);}_0x559fa4[_0xe03d('0x39')]=qs[_0xe03d('0x3a')](_0x5c6cd2[_0xe03d('0x31')][_0xe03d('0x3a')]);_0x559fa4[_0xe03d('0x3b')]=qs[_0xe03d('0x3c')](_[_0xe03d('0x3d')](_0x5c6cd2[_0xe03d('0x31')],_0x258108[_0xe03d('0x3c')]),_0xa153c8);if(_0x5c6cd2['query'][_0xe03d('0x3e')]){_0x559fa4[_0xe03d('0x3b')]=_['merge'](_0x559fa4['where'],{'$or':_[_0xe03d('0x2b')](_0xa153c8,function(_0x34357c){if(_0x34357c['type']!==_0xe03d('0x3f')){var _0x4b7f30={};_0x4b7f30[_0x34357c[_0xe03d('0x29')]]={'$like':'%'+_0x5c6cd2['query']['filter']+'%'};return _0x4b7f30;}})});}_0x559fa4=_[_0xe03d('0x40')]({},_0x559fa4,_0x5c6cd2['options']);var _0x4ede1f={'where':_0x559fa4['where']};return db[_0xe03d('0x2c')][_0xe03d('0x21')](_0x4ede1f)[_0xe03d('0x26')](function(_0x7d01bb){_0x1b0e29['count']=_0x7d01bb;if(_0x5c6cd2[_0xe03d('0x31')][_0xe03d('0x41')]){_0x559fa4[_0xe03d('0x42')]=[{'all':!![]}];}return db[_0xe03d('0x2c')]['findAll'](_0x559fa4);})[_0xe03d('0x26')](function(_0x6e3c24){_0x1b0e29[_0xe03d('0x43')]=_0x6e3c24;return _0x1b0e29;})['then'](respondWithFilteredResult(_0x582fe3,_0x559fa4))[_0xe03d('0x44')](handleError(_0x582fe3,null));};exports[_0xe03d('0x45')]=function(_0x131640,_0x158dfb){var _0x3c4292={'raw':![],'where':{'id':_0x131640['params']['id']}},_0x2e1711={};_0x2e1711[_0xe03d('0x34')]=_[_0xe03d('0x32')](db['CmList']['rawAttributes']);_0x2e1711[_0xe03d('0x31')]=_['keys'](_0x131640['query']);_0x2e1711[_0xe03d('0x3c')]=_[_0xe03d('0x33')](_0x2e1711['model'],_0x2e1711[_0xe03d('0x31')]);_0x3c4292[_0xe03d('0x36')]=_[_0xe03d('0x33')](_0x2e1711[_0xe03d('0x34')],qs['fields'](_0x131640[_0xe03d('0x31')][_0xe03d('0x35')]));_0x3c4292[_0xe03d('0x36')]=_0x3c4292['attributes']['length']?_0x3c4292[_0xe03d('0x36')]:_0x2e1711[_0xe03d('0x34')];if(_0x131640[_0xe03d('0x31')][_0xe03d('0x41')]){_0x3c4292['include']=[{'all':!![]}];}_0x3c4292=_['merge']({},_0x3c4292,_0x131640['options']);return db['CmList'][_0xe03d('0x46')](_0x3c4292)[_0xe03d('0x26')](handleEntityNotFound(_0x158dfb,null))['then'](respondWithResult(_0x158dfb,null))['catch'](handleError(_0x158dfb,null));};exports[_0xe03d('0x47')]=function(_0x233bb7,_0x375f26){return db[_0xe03d('0x2c')][_0xe03d('0x47')](_0x233bb7['body'],{})[_0xe03d('0x26')](function(_0x16fef4){var _0x592f3b=_0x233bb7[_0xe03d('0x48')][_0xe03d('0x49')]({'plain':!![]});if(!_0x592f3b)throw new Error(_0xe03d('0x4a'));if(_0x592f3b[_0xe03d('0x4b')]===_0xe03d('0x48')){var _0x1cbfc9=_0x16fef4[_0xe03d('0x49')]({'plain':!![]});var _0x4b3f7d='Lists';return db['UserProfileSection'][_0xe03d('0x46')]({'where':{'name':_0x4b3f7d,'userProfileId':_0x592f3b[_0xe03d('0x4c')]},'raw':!![]})[_0xe03d('0x26')](function(_0x5bf438){if(_0x5bf438&&_0x5bf438['autoAssociation']===0x0){return db[_0xe03d('0x4d')][_0xe03d('0x47')]({'name':_0x1cbfc9[_0xe03d('0x29')],'resourceId':_0x1cbfc9['id'],'type':_0x5bf438[_0xe03d('0x29')],'sectionId':_0x5bf438['id']},{})[_0xe03d('0x26')](function(){return _0x16fef4;});}else{return _0x16fef4;}})[_0xe03d('0x44')](function(_0x402ab3){logger[_0xe03d('0x4e')](_0xe03d('0x4f'),_0x402ab3);throw _0x402ab3;});}return _0x16fef4;})[_0xe03d('0x26')](respondWithResult(_0x375f26,0xc9))['catch'](handleError(_0x375f26,null));};exports['update']=function(_0x719ff0,_0x3d56ce){if(_0x719ff0['body']['id']){delete _0x719ff0['body']['id'];}return db[_0xe03d('0x2c')][_0xe03d('0x46')]({'where':{'id':_0x719ff0[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x3d56ce,null))['then'](saveUpdates(_0x719ff0['body'],null))[_0xe03d('0x26')](respondWithResult(_0x3d56ce,null))[_0xe03d('0x44')](handleError(_0x3d56ce,null));};exports['destroy']=function(_0xe6cbb5,_0x4f431a){return db[_0xe03d('0x2c')]['find']({'where':{'id':_0xe6cbb5[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x4f431a,null))[_0xe03d('0x26')](removeEntity(_0x4f431a,null))['catch'](handleError(_0x4f431a,null));};exports[_0xe03d('0x51')]=function(_0x810ac,_0x1ba8a2){return db[_0xe03d('0x2c')][_0xe03d('0x51')]()[_0xe03d('0x26')](respondWithResult(_0x1ba8a2,null))[_0xe03d('0x44')](handleError(_0x1ba8a2,null));};exports['addDisposition']=function(_0xf0e622,_0x500896,_0x90f5fc){if(_0xf0e622[_0xe03d('0x52')]['id']){delete _0xf0e622['body']['id'];}return db['CmList'][_0xe03d('0x46')]({'where':{'id':_0xf0e622[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x500896,null))[_0xe03d('0x26')](function(_0x547409){if(_0x547409){_0xf0e622[_0xe03d('0x52')][_0xe03d('0x53')]=_0x547409['id'];return db[_0xe03d('0x54')][_0xe03d('0x47')](_0xf0e622[_0xe03d('0x52')]);}})[_0xe03d('0x26')](respondWithResult(_0x500896,null))[_0xe03d('0x44')](handleError(_0x500896,null));};exports['getDispositions']=function(_0x52a78a,_0x28595f,_0x9de0fa){var _0x5f5026={'raw':![],'where':{}};var _0x3f3927={};var _0x54339c={'count':0x0,'rows':[]};return db[_0xe03d('0x2c')][_0xe03d('0x55')]({'where':{'id':_0x52a78a[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x28595f,null))[_0xe03d('0x26')](function(_0x4288d1){if(_0x4288d1){_0x3f3927[_0xe03d('0x34')]=_[_0xe03d('0x32')](db['Disposition'][_0xe03d('0x2d')]);_0x3f3927[_0xe03d('0x31')]=_['keys'](_0x52a78a[_0xe03d('0x31')]);_0x3f3927['filters']=_[_0xe03d('0x33')](_0x3f3927[_0xe03d('0x34')],_0x3f3927['query']);_0x5f5026[_0xe03d('0x36')]=_[_0xe03d('0x33')](_0x3f3927['model'],qs[_0xe03d('0x35')](_0x52a78a[_0xe03d('0x31')]['fields']));_0x5f5026['attributes']=_0x5f5026['attributes'][_0xe03d('0x56')]?_0x5f5026['attributes']:_0x3f3927[_0xe03d('0x34')];if(!_0x52a78a[_0xe03d('0x31')][_0xe03d('0x37')]('nolimit')){_0x5f5026[_0xe03d('0x20')]=qs['limit'](_0x52a78a[_0xe03d('0x31')][_0xe03d('0x20')]);_0x5f5026[_0xe03d('0x22')]=qs[_0xe03d('0x22')](_0x52a78a[_0xe03d('0x31')]['offset']);}_0x5f5026[_0xe03d('0x39')]=qs[_0xe03d('0x3a')](_0x52a78a[_0xe03d('0x31')][_0xe03d('0x3a')]);_0x5f5026['where']=qs['filters'](_[_0xe03d('0x3d')](_0x52a78a[_0xe03d('0x31')],_0x3f3927[_0xe03d('0x3c')]));_0x5f5026[_0xe03d('0x3b')][_0xe03d('0x53')]=_0x4288d1['id'];if(_0x52a78a[_0xe03d('0x31')][_0xe03d('0x3e')]){_0x5f5026['where']=_[_0xe03d('0x40')](_0x5f5026['where'],{'$or':_[_0xe03d('0x2b')](_0x5f5026[_0xe03d('0x36')],function(_0x4c226f){var _0x4d1280={};_0x4d1280[_0x4c226f]={'$like':'%'+_0x52a78a[_0xe03d('0x31')][_0xe03d('0x3e')]+'%'};return _0x4d1280;})});}_0x5f5026=_[_0xe03d('0x40')]({},_0x5f5026,_0x52a78a[_0xe03d('0x57')]);return db['Disposition']['count']({'where':_0x5f5026['where']})[_0xe03d('0x26')](function(_0x184da6){_0x54339c[_0xe03d('0x21')]=_0x184da6;if(_0x52a78a['query'][_0xe03d('0x41')]){_0x5f5026['include']=[{'all':!![]}];}return db[_0xe03d('0x54')][_0xe03d('0x58')](_0x5f5026);})[_0xe03d('0x26')](function(_0x2fe98e){_0x54339c[_0xe03d('0x43')]=_0x2fe98e;return _0x54339c;});}})[_0xe03d('0x26')](respondWithFilteredResult(_0x28595f,_0x5f5026))['catch'](handleError(_0x28595f,null));};exports[_0xe03d('0x59')]=function(_0x1ec7a7,_0x7d029f,_0x478a8a){return db['CmList'][_0xe03d('0x46')]({'where':{'id':_0x1ec7a7[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x7d029f,null))[_0xe03d('0x26')](function(_0x3b5f1d){if(_0x3b5f1d){return _0x3b5f1d[_0xe03d('0x59')](_0x1ec7a7['query']['ids']);}})[_0xe03d('0x26')](respondWithStatusCode(_0x7d029f,null))['catch'](handleError(_0x7d029f,null));};exports[_0xe03d('0x5a')]=function(_0x50798a,_0x391e66,_0x49b983){return db[_0xe03d('0x2c')][_0xe03d('0x46')]({'where':{'id':_0x50798a[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x391e66,null))[_0xe03d('0x26')](function(_0x4c45b9){if(_0x4c45b9){var _0x8f213f=[];var _0x12023c={'success':[],'errors':[]};return db[_0xe03d('0x5b')][_0xe03d('0x51')]()[_0xe03d('0x26')](function(_0xa9c77f){if(_0x50798a[_0xe03d('0x52')]['tags']&&_['isArray'](_0x50798a[_0xe03d('0x52')][_0xe03d('0x5c')])){if(_0x50798a[_0xe03d('0x52')][_0xe03d('0x5c')][_0xe03d('0x56')]){_0x50798a[_0xe03d('0x52')][_0xe03d('0x5c')]=_0x50798a[_0xe03d('0x52')][_0xe03d('0x5c')]['join'](';')+';';}else{_0x50798a[_0xe03d('0x52')][_0xe03d('0x5c')]=null;}}else{_0x50798a['body'][_0xe03d('0x5c')]=null;}if(_0x50798a[_0xe03d('0x52')]&&_[_0xe03d('0x5d')](_0x50798a['body'])){for(var _0x3e995c=0x0;_0x3e995c<_0x50798a[_0xe03d('0x52')][_0xe03d('0x56')];_0x3e995c+=0x1){_0x50798a['body'][_0x3e995c][_0xe03d('0x53')]=_0x50798a[_0xe03d('0x50')]['id'];_0x8f213f['push'](_0x50798a[_0xe03d('0x52')][_0x3e995c]);}return BPromise[_0xe03d('0x5e')](_0x8f213f,function(_0x5d3fdd){return db[_0xe03d('0x5b')]['create'](_[_0xe03d('0x5f')](_0x5d3fdd,[_0xe03d('0x60'),'id'])||{},{'fields':_['keys'](_0xa9c77f),'raw':!![]})['then'](function(_0x3d4482){_0x12023c['success'][_0xe03d('0x61')](_0x3d4482['dataValues']);})[_0xe03d('0x44')](function(_0x5b407c){_0x12023c[_0xe03d('0x62')][_0xe03d('0x61')]({'data':_0x5d3fdd,'error':_0x5b407c[_0xe03d('0x63')]});});})[_0xe03d('0x26')](function(_0x26a944){return _0x12023c;})[_0xe03d('0x44')](function(_0x237113){return _0x237113;});}else{_0x391e66[_0xe03d('0x1e')](0x190)[_0xe03d('0x64')]({'message':_0xe03d('0x65')});}});}})[_0xe03d('0x26')](respondWithResult(_0x391e66,null))['catch'](handleError(_0x391e66,null));};exports[_0xe03d('0x66')]=function(_0x22d6ad,_0x2bbcbe,_0x7cd9f){var _0x30894b;return db[_0xe03d('0x2c')][_0xe03d('0x46')]({'where':{'id':_0x22d6ad[_0xe03d('0x50')]['id']},'include':[{'model':db[_0xe03d('0x67')],'as':_0xe03d('0x68')}]})[_0xe03d('0x26')](handleEntityNotFound(_0x2bbcbe,null))[_0xe03d('0x26')](function(_0x149255){if(_0x149255){_0x30894b=_0x149255;return db[_0xe03d('0x5b')][_0xe03d('0x2d')];}})[_0xe03d('0x26')](function(_0x4b6f01){if(_0x4b6f01){var _0x244245={};var _0x2ded2f={};_0x2ded2f[_0xe03d('0x34')]=_['concat'](_[_0xe03d('0x32')](_0x4b6f01),_[_0xe03d('0x2b')](_0x30894b['CustomFields'],function(_0x435d0e){return util[_0xe03d('0x69')](_0xe03d('0x6a'),_0x435d0e['id']);}));_0x2ded2f[_0xe03d('0x31')]=_[_0xe03d('0x32')](_0x22d6ad[_0xe03d('0x31')]);_0x2ded2f[_0xe03d('0x3c')]=_['intersection'](_0x2ded2f[_0xe03d('0x34')],_0x2ded2f['query']);_0x244245[_0xe03d('0x36')]=_[_0xe03d('0x33')](_0x2ded2f[_0xe03d('0x34')],qs[_0xe03d('0x35')](_0x22d6ad[_0xe03d('0x31')]['fields']));_0x244245[_0xe03d('0x36')]=_0x244245[_0xe03d('0x36')][_0xe03d('0x56')]?_0x244245['attributes']:_0x2ded2f[_0xe03d('0x34')];if(!_0x22d6ad[_0xe03d('0x31')][_0xe03d('0x37')](_0xe03d('0x38'))){_0x244245[_0xe03d('0x20')]=qs['limit'](_0x22d6ad['query'][_0xe03d('0x20')]);_0x244245['offset']=qs['offset'](_0x22d6ad['query'][_0xe03d('0x22')]);}_0x244245[_0xe03d('0x39')]=qs['sort'](_0x22d6ad[_0xe03d('0x31')]['sort']);_0x244245[_0xe03d('0x3b')]=qs['filters'](_['pick'](_0x22d6ad[_0xe03d('0x31')],_0x2ded2f[_0xe03d('0x3c')]));_0x244245[_0xe03d('0x6b')]=!![];if(_0x22d6ad[_0xe03d('0x31')]['filter']){_0x244245[_0xe03d('0x3b')]=_[_0xe03d('0x40')](_0x244245[_0xe03d('0x3b')],{'$or':_[_0xe03d('0x2b')](_0x244245[_0xe03d('0x36')],function(_0x2c64e5){var _0x4bf15b={};_0x4bf15b[_0x2c64e5]={'$like':'%'+_0x22d6ad['query'][_0xe03d('0x3e')]+'%'};return _0x4bf15b;})});}_0x244245=_[_0xe03d('0x40')]({},_0x244245,_0x22d6ad[_0xe03d('0x57')]);return _0x30894b[_0xe03d('0x66')](_0x244245);}})[_0xe03d('0x26')](respondWithResult(_0x2bbcbe,null))[_0xe03d('0x44')](handleError(_0x2bbcbe,null));};exports[_0xe03d('0x6c')]=function(_0x46196f,_0x431bff,_0x448e92){var _0x287e24;var _0x3ae1b6;var _0x2eaeb5;var _0x465494=_0x46196f[_0xe03d('0x50')]['id'];csv_results=[];return db[_0xe03d('0x6d')][_0xe03d('0x58')]({'attributes':['id',_0xe03d('0x29')],'raw':!![],'order':[_0xe03d('0x6e')]})[_0xe03d('0x26')](function(_0x3a7d42){_0x287e24=_0x3a7d42;var _0x574880=_['keys'](db[_0xe03d('0x5b')][_0xe03d('0x2d')]);return db[_0xe03d('0x67')][_0xe03d('0x58')]({'raw':!![],'attributes':['id','alias']})[_0xe03d('0x26')](function(_0x4acce6){_0x3ae1b6=_0x4acce6;var _0x2d5d63=squel[_0xe03d('0x6f')]()[_0xe03d('0x35')](_0x574880)['from'](_0xe03d('0x70'),'c')['where'](_0xe03d('0x71'),_0x465494)[_0xe03d('0x3b')]('c.deletedAt\x20is\x20null')[_0xe03d('0x72')]();for(var _0xdb6334=0x0;_0xdb6334<_0x3ae1b6[_0xe03d('0x56')];_0xdb6334++){_0x2d5d63[_0xe03d('0x73')](_0xe03d('0x74')+_0x3ae1b6[_0xdb6334]['id'],_0xe03d('0x75')+_0x3ae1b6[_0xdb6334][_0xe03d('0x76')]);}for(var _0xdb6334=0x0;_0xdb6334<_0x287e24[_0xe03d('0x56')];_0xdb6334++){_0x2d5d63[_0xe03d('0x73')](squel[_0xe03d('0x6f')]()['field'](_0xe03d('0x77'))['from'](_0xe03d('0x78'))[_0xe03d('0x3b')]('ItemTypeId\x20=\x20?',_0x287e24[_0xdb6334]['id'])[_0xe03d('0x3b')](_0xe03d('0x79')),_0xe03d('0x7a')+_0x287e24[_0xdb6334][_0xe03d('0x29')]);_0x2d5d63[_0xe03d('0x73')](squel[_0xe03d('0x6f')]()['field'](_0xe03d('0x7b'))[_0xe03d('0x7c')](_0xe03d('0x78'))[_0xe03d('0x3b')](_0xe03d('0x7d'),_0x287e24[_0xdb6334]['id'])[_0xe03d('0x3b')]('CmContactId\x20=\x20c.id'),_0xe03d('0x7e')+_0x287e24[_0xdb6334]['name']);}var _0x205b69=[];_0x205b69[_0xe03d('0x61')](_0x2d5d63[_0xe03d('0x7f')]());BPromise['each'](_0x205b69,handleQuery)[_0xe03d('0x26')](function(_0x378401){handleQuery(_0x2d5d63[_0xe03d('0x7f')]());var _0x32b800=csv_results[0x0];if(!_[_0xe03d('0x80')](_0x32b800)){var _0x21e873=toCsv(_0x32b800);var _0xd43937=Date['now']();fs[_0xe03d('0x81')](util[_0xe03d('0x69')](_0xe03d('0x82'),_0x465494,_0xd43937),_0x21e873);_0x431bff['setHeader'](_0xe03d('0x83'),_0xe03d('0x84')+util[_0xe03d('0x69')](_0xe03d('0x85'),_0x465494,_0xd43937));_0x431bff[_0xe03d('0x86')]('Content-type',_0xe03d('0x87'));return _0x431bff['download'](util['format'](_0xe03d('0x82'),_0x465494,_0xd43937));}else{return _0x431bff[_0xe03d('0x1d')](0xcc);}});});});};exports[_0xe03d('0x88')]=function(_0x4ac148,_0x48656f,_0x1fac86){var _0x431391;delete _0x4ac148[_0xe03d('0x52')]['id'];return db[_0xe03d('0x2c')]['findOne']({'where':{'id':_0x4ac148[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x48656f,null))[_0xe03d('0x26')](function(_0x7ace1d){if(_0x7ace1d){return db[_0xe03d('0x89')][_0xe03d('0x8a')](function(_0x4f0530){return db[_0xe03d('0x67')][_0xe03d('0x47')](_0x4ac148[_0xe03d('0x52')],{'transaction':_0x4f0530})['then'](function(_0x28fa9b){_0x431391=_0x28fa9b;return _0x7ace1d[_0xe03d('0x8b')](_0x28fa9b,{'transaction':_0x4f0530});})[_0xe03d('0x26')](function(){var _0x2187fc={'type':db['Sequelize'][_0xe03d('0x8c')],'transaction':_0x4f0530};switch(_0x4ac148[_0xe03d('0x52')][_0xe03d('0x2f')]){case _0xe03d('0x8d'):_0x2187fc[_0xe03d('0x2f')]=db[_0xe03d('0x8e')]['TEXT'];break;case _0xe03d('0x8f'):_0x2187fc[_0xe03d('0x2f')]=db[_0xe03d('0x8e')][_0xe03d('0x90')];break;case'switch':_0x2187fc[_0xe03d('0x2f')]=db[_0xe03d('0x8e')]['BOOLEAN'];_0x2187fc[_0xe03d('0x91')]=![];break;default:}return db[_0xe03d('0x89')]['queryInterface']['addColumn']('cm_contacts',util[_0xe03d('0x69')]('cf_%s',_0x431391['id']),_0x2187fc);})[_0xe03d('0x26')](function(){return _0x431391;});});}})[_0xe03d('0x26')](respondWithResult(_0x48656f,null))[_0xe03d('0x44')](handleError(_0x48656f,null));};exports['getCustomFields']=function(_0xbad843,_0x1737a4,_0x24d54c){var _0x279872={};var _0x4b4ff7={};var _0x1214d0;var _0x3d06a0;return db[_0xe03d('0x2c')][_0xe03d('0x55')]({'where':{'id':_0xbad843[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x1737a4,null))['then'](function(_0x55a115){if(_0x55a115){_0x1214d0=_0x55a115;_0x4b4ff7['model']=_[_0xe03d('0x32')](db[_0xe03d('0x67')][_0xe03d('0x2d')]);_0x4b4ff7[_0xe03d('0x31')]=_[_0xe03d('0x32')](_0xbad843[_0xe03d('0x31')]);_0x4b4ff7[_0xe03d('0x3c')]=_[_0xe03d('0x33')](_0x4b4ff7[_0xe03d('0x34')],_0x4b4ff7['query']);_0x279872[_0xe03d('0x36')]=_[_0xe03d('0x33')](_0x4b4ff7[_0xe03d('0x34')],qs[_0xe03d('0x35')](_0xbad843[_0xe03d('0x31')][_0xe03d('0x35')]));_0x279872[_0xe03d('0x36')]=_0x279872[_0xe03d('0x36')][_0xe03d('0x56')]?_0x279872[_0xe03d('0x36')]:_0x4b4ff7[_0xe03d('0x34')];_0x279872[_0xe03d('0x39')]=qs[_0xe03d('0x3a')](_0xbad843[_0xe03d('0x31')][_0xe03d('0x3a')]);_0x279872[_0xe03d('0x3b')]=qs[_0xe03d('0x3c')](_[_0xe03d('0x3d')](_0xbad843[_0xe03d('0x31')],_0x4b4ff7[_0xe03d('0x3c')]));_0x279872[_0xe03d('0x3b')]=_['merge'](_0x279872[_0xe03d('0x3b')],{'$or':[{'ListId':_0x55a115['id']},{'ListId':null}]});if(_0xbad843[_0xe03d('0x31')][_0xe03d('0x3e')]){_0x279872['where']=_[_0xe03d('0x40')](_0x279872[_0xe03d('0x3b')],{'$or':_[_0xe03d('0x2b')](_0x279872[_0xe03d('0x36')],function(_0x58468e){var _0x470bf3={};_0x470bf3[_0x58468e]={'$like':'%'+_0xbad843['query'][_0xe03d('0x3e')]+'%'};return _0x470bf3;})});}_0x279872=_[_0xe03d('0x40')]({},_0x279872,_0xbad843['options']);return db[_0xe03d('0x67')][_0xe03d('0x92')](_0x279872);}})[_0xe03d('0x26')](respondWithResult(_0x1737a4,null))['catch'](handleError(_0x1737a4,null));};exports[_0xe03d('0x93')]=function(_0x91ce9,_0x51a705){return db[_0xe03d('0x67')][_0xe03d('0x92')]({'where':{'ListId':null}})[_0xe03d('0x26')](handleEntityNotFound(_0x51a705,null))[_0xe03d('0x26')](function(_0x4282d5){return _0x4282d5;})[_0xe03d('0x26')](respondWithResult(_0x51a705,null))[_0xe03d('0x44')](handleError(_0x51a705,null));};exports[_0xe03d('0x94')]=function(_0x2d5fcb,_0x3e3ec8,_0x3c43d5){return db[_0xe03d('0x2c')][_0xe03d('0x46')]({'where':{'id':_0x2d5fcb[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x3e3ec8,null))['then'](function(_0x194e9a){if(_0x194e9a){return _0x194e9a[_0xe03d('0x94')](_0x2d5fcb[_0xe03d('0x52')][_0xe03d('0x60')],_[_0xe03d('0x5f')](_0x2d5fcb[_0xe03d('0x52')],[_0xe03d('0x60'),'id'])||{})[_0xe03d('0x95')](function(_0x25c0c7){for(var _0x17cb94=0x0;_0x17cb94<_0x2d5fcb[_0xe03d('0x52')]['ids']['length'];_0x17cb94+=0x1){socket[_0xe03d('0x96')](_0xe03d('0x97'),{'UserId':Number(_0x2d5fcb[_0xe03d('0x52')][_0xe03d('0x60')][_0x17cb94]),'CmListId':Number(_0x2d5fcb[_0xe03d('0x50')]['id'])});}return _0x25c0c7;});}})[_0xe03d('0x26')](respondWithResult(_0x3e3ec8,null))[_0xe03d('0x44')](handleError(_0x3e3ec8,null));};exports[_0xe03d('0x98')]=function(_0x4a1dd1,_0x3075dc,_0x482cac){return db['CmList'][_0xe03d('0x46')]({'where':{'id':_0x4a1dd1[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x3075dc,null))['then'](function(_0x568c9b){if(_0x568c9b){return _0x568c9b['removeAgents'](_0x4a1dd1[_0xe03d('0x31')]['ids'])[_0xe03d('0x26')](function(){if(_[_0xe03d('0x5d')](_0x4a1dd1[_0xe03d('0x31')][_0xe03d('0x60')])){for(var _0x107332=0x0;_0x107332<_0x4a1dd1[_0xe03d('0x31')]['ids'][_0xe03d('0x56')];_0x107332+=0x1){socket[_0xe03d('0x96')](_0xe03d('0x99'),{'UserId':Number(_0x4a1dd1['query'][_0xe03d('0x60')][_0x107332]),'CmListId':Number(_0x4a1dd1['params']['id'])});}}else{socket[_0xe03d('0x96')](_0xe03d('0x99'),{'UserId':Number(_0x4a1dd1[_0xe03d('0x31')]['ids']),'CmListId':Number(_0x4a1dd1[_0xe03d('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x3075dc,null))['catch'](handleError(_0x3075dc,null));};exports['getAgents']=function(_0x538340,_0x2b289b,_0x4e2fd7){var _0x3dcc34={};var _0x129006={};var _0x3bf415;var _0x475453;return db[_0xe03d('0x2c')][_0xe03d('0x55')]({'where':{'id':_0x538340[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x2b289b,null))['then'](function(_0x3a2392){if(_0x3a2392){_0x3bf415=_0x3a2392;_0x129006[_0xe03d('0x34')]=_[_0xe03d('0x32')](db[_0xe03d('0x9a')][_0xe03d('0x2d')]);_0x129006[_0xe03d('0x31')]=_[_0xe03d('0x32')](_0x538340[_0xe03d('0x31')]);_0x129006[_0xe03d('0x3c')]=_['intersection'](_0x129006[_0xe03d('0x34')],_0x129006['query']);_0x3dcc34[_0xe03d('0x36')]=_[_0xe03d('0x33')](_0x129006['model'],qs['fields'](_0x538340[_0xe03d('0x31')][_0xe03d('0x35')]));_0x3dcc34[_0xe03d('0x36')]=_0x3dcc34[_0xe03d('0x36')]['length']?_0x3dcc34[_0xe03d('0x36')]:_0x129006['model'];_0x3dcc34[_0xe03d('0x39')]=qs['sort'](_0x538340[_0xe03d('0x31')][_0xe03d('0x3a')]);_0x3dcc34[_0xe03d('0x3b')]=qs[_0xe03d('0x3c')](_[_0xe03d('0x3d')](_0x538340[_0xe03d('0x31')],_0x129006[_0xe03d('0x3c')]));if(_0x538340['query'][_0xe03d('0x3e')]){_0x3dcc34[_0xe03d('0x3b')]=_[_0xe03d('0x40')](_0x3dcc34[_0xe03d('0x3b')],{'$or':_[_0xe03d('0x2b')](_0x3dcc34[_0xe03d('0x36')],function(_0x440204){var _0x1f1a3c={};_0x1f1a3c[_0x440204]={'$like':'%'+_0x538340[_0xe03d('0x31')][_0xe03d('0x3e')]+'%'};return _0x1f1a3c;})});}_0x3dcc34=_['merge']({},_0x3dcc34,_0x538340[_0xe03d('0x57')]);return _0x3bf415['getAgents'](_0x3dcc34);}})['then'](function(_0x2e4be9){if(_0x2e4be9){_0x475453=_0x2e4be9[_0xe03d('0x56')];if(!_0x538340['query'][_0xe03d('0x37')](_0xe03d('0x38'))){_0x3dcc34[_0xe03d('0x20')]=qs[_0xe03d('0x20')](_0x538340['query'][_0xe03d('0x20')]);_0x3dcc34[_0xe03d('0x22')]=qs['offset'](_0x538340[_0xe03d('0x31')][_0xe03d('0x22')]);}return _0x3bf415[_0xe03d('0x9b')](_0x3dcc34);}})[_0xe03d('0x26')](function(_0x52e167){if(_0x52e167){return _0x52e167?{'count':_0x475453,'rows':_0x52e167}:null;}})[_0xe03d('0x26')](respondWithResult(_0x2b289b,null))['catch'](handleError(_0x2b289b,null));};function handleQuery(_0x246f2a){logger['info'](_0x246f2a);return db['sequelize']['query'](_0x246f2a)[_0xe03d('0x95')](function(_0x3d4144){csv_results[_0xe03d('0x61')](_0x3d4144);})[_0xe03d('0x44')](function(_0x2863fb){logger[_0xe03d('0x4e')](_0x2863fb[_0xe03d('0x63')]);});} \ No newline at end of file +var _0xbe57=['toString','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','number','Sequelize','INTEGER','defaultValue','queryInterface','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','message','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','Lists','UserProfileResource','sendStatus','name','index','map','CmList','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','ListId','Disposition','findOne','order','ids','addContacts','CmContact','describe','tags','isArray','join','push','each','dataValues','errors','Malformed\x20request\x20syntax','CmCustomField','CustomFields','rawAttributes','concat','raw','getContacts','getContactsCsv','ContactItemType','select','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','c.cf_','customField_','alias','item','from','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description','cm_contact_has_items','description_additionalPhone_'];(function(_0x41e212,_0x5f0e87){var _0x1a1999=function(_0x574b30){while(--_0x574b30){_0x41e212['push'](_0x41e212['shift']());}};_0x1a1999(++_0x5f0e87);}(_0xbe57,0x166));var _0x7be5=function(_0x50867d,_0x1087ee){_0x50867d=_0x50867d-0x0;var _0x50b02a=_0xbe57[_0x50867d];return _0x50b02a;};'use strict';var emlformat=require(_0x7be5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7be5('0x1'));var jsonpatch=require(_0x7be5('0x2'));var rp=require(_0x7be5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7be5('0x4'));var util=require(_0x7be5('0x5'));var path=require(_0x7be5('0x6'));var sox=require(_0x7be5('0x7'));var csv=require(_0x7be5('0x8'));var ejs=require(_0x7be5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7be5('0xa'));var crypto=require(_0x7be5('0xb'));var jsforce=require(_0x7be5('0xc'));var deskjs=require(_0x7be5('0xd'));var toCsv=require(_0x7be5('0x8'));var querystring=require(_0x7be5('0xe'));var Papa=require(_0x7be5('0xf'));var Redis=require('ioredis');var authService=require(_0x7be5('0x10'));var qs=require(_0x7be5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7be5('0x12'));var logger=require(_0x7be5('0x13'))(_0x7be5('0x14'));var utils=require(_0x7be5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7be5('0x16'));var db=require(_0x7be5('0x17'))['db'];var csv_results;config['redis']=_[_0x7be5('0x18')](config[_0x7be5('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x7be5('0x1a'))(new Redis(config[_0x7be5('0x19')]));require('./cmList.socket')[_0x7be5('0x1b')](socket);function respondWithStatusCode(_0x16a666,_0x4c79b4){_0x4c79b4=_0x4c79b4||0xcc;return function(_0x1004ee){if(_0x1004ee){return _0x16a666['sendStatus'](_0x4c79b4);}return _0x16a666[_0x7be5('0x1c')](_0x4c79b4)[_0x7be5('0x1d')]();};}function respondWithResult(_0x640c06,_0x1e1e43){_0x1e1e43=_0x1e1e43||0xc8;return function(_0x5fdab){if(_0x5fdab){return _0x640c06[_0x7be5('0x1c')](_0x1e1e43)['json'](_0x5fdab);}};}function respondWithFilteredResult(_0x1c20f4,_0x1b3ac4){return function(_0x40cb44){if(_0x40cb44){var _0x58cea8=typeof _0x1b3ac4[_0x7be5('0x1e')]===_0x7be5('0x1f')&&typeof _0x1b3ac4[_0x7be5('0x20')]===_0x7be5('0x1f');var _0x42b83c=_0x40cb44[_0x7be5('0x21')];var _0x82252d=_0x58cea8?0x0:_0x1b3ac4[_0x7be5('0x1e')];var _0x2e80cb=_0x58cea8?_0x40cb44[_0x7be5('0x21')]:_0x1b3ac4['offset']+_0x1b3ac4['limit'];var _0xd585e2;if(_0x2e80cb>=_0x42b83c){_0x2e80cb=_0x42b83c;_0xd585e2=0xc8;}else{_0xd585e2=0xce;}_0x1c20f4[_0x7be5('0x1c')](_0xd585e2);return _0x1c20f4[_0x7be5('0x22')](_0x7be5('0x23'),_0x82252d+'-'+_0x2e80cb+'/'+_0x42b83c)[_0x7be5('0x24')](_0x40cb44);}return null;};}function patchUpdates(_0x2c6ad0){return function(_0x4feb78){try{jsonpatch['apply'](_0x4feb78,_0x2c6ad0,!![]);}catch(_0x17d96c){return BPromise[_0x7be5('0x25')](_0x17d96c);}return _0x4feb78[_0x7be5('0x26')]();};}function saveUpdates(_0x3b482d,_0x51af27){return function(_0x3a1bcd){if(_0x3a1bcd){return _0x3a1bcd[_0x7be5('0x27')](_0x3b482d)[_0x7be5('0x28')](function(_0x263632){return _0x263632;});}return null;};}function removeEntity(_0x48bd45,_0x11bbfb){return function(_0x2c12f8){if(_0x2c12f8){return _0x2c12f8[_0x7be5('0x29')]()['then'](function(){var _0x141135=_0x2c12f8[_0x7be5('0x2a')]({'plain':!![]});var _0x1d8007=_0x7be5('0x2b');return db[_0x7be5('0x2c')]['destroy']({'where':{'type':_0x1d8007,'resourceId':_0x141135['id']}})[_0x7be5('0x28')](function(){return _0x2c12f8;});})[_0x7be5('0x28')](function(){_0x48bd45[_0x7be5('0x1c')](0xcc)[_0x7be5('0x1d')]();});}};}function handleEntityNotFound(_0x424437,_0x47dd62){return function(_0x1d0f8d){if(!_0x1d0f8d){_0x424437[_0x7be5('0x2d')](0x194);}return _0x1d0f8d;};}function handleError(_0x472ed0,_0x9dfe4a){_0x9dfe4a=_0x9dfe4a||0x1f4;return function(_0x5be7aa){logger['error'](_0x5be7aa['stack']);if(_0x5be7aa[_0x7be5('0x2e')]){delete _0x5be7aa[_0x7be5('0x2e')];}_0x472ed0['status'](_0x9dfe4a)['send'](_0x5be7aa);};}exports[_0x7be5('0x2f')]=function(_0x25dec8,_0xeed4b5){var _0xd7d696={},_0x3ba143={},_0xdc91ac={'count':0x0,'rows':[]};var _0x22f94c=_[_0x7be5('0x30')](db[_0x7be5('0x31')]['rawAttributes'],function(_0x239cef){return{'name':_0x239cef[_0x7be5('0x32')],'type':_0x239cef[_0x7be5('0x33')]['key']};});_0x3ba143[_0x7be5('0x34')]=_[_0x7be5('0x30')](_0x22f94c,'name');_0x3ba143[_0x7be5('0x35')]=_[_0x7be5('0x36')](_0x25dec8[_0x7be5('0x35')]);_0x3ba143[_0x7be5('0x37')]=_['intersection'](_0x3ba143[_0x7be5('0x34')],_0x3ba143[_0x7be5('0x35')]);_0xd7d696[_0x7be5('0x38')]=_[_0x7be5('0x39')](_0x3ba143[_0x7be5('0x34')],qs['fields'](_0x25dec8['query'][_0x7be5('0x3a')]));_0xd7d696[_0x7be5('0x38')]=_0xd7d696['attributes'][_0x7be5('0x3b')]?_0xd7d696[_0x7be5('0x38')]:_0x3ba143['model'];if(!_0x25dec8[_0x7be5('0x35')][_0x7be5('0x3c')](_0x7be5('0x3d'))){_0xd7d696[_0x7be5('0x20')]=qs[_0x7be5('0x20')](_0x25dec8[_0x7be5('0x35')][_0x7be5('0x20')]);_0xd7d696[_0x7be5('0x1e')]=qs[_0x7be5('0x1e')](_0x25dec8[_0x7be5('0x35')]['offset']);}_0xd7d696['order']=qs[_0x7be5('0x3e')](_0x25dec8['query']['sort']);_0xd7d696['where']=qs[_0x7be5('0x37')](_[_0x7be5('0x3f')](_0x25dec8['query'],_0x3ba143[_0x7be5('0x37')]),_0x22f94c);if(_0x25dec8[_0x7be5('0x35')][_0x7be5('0x40')]){_0xd7d696[_0x7be5('0x41')]=_['merge'](_0xd7d696[_0x7be5('0x41')],{'$or':_[_0x7be5('0x30')](_0x22f94c,function(_0x4264be){if(_0x4264be[_0x7be5('0x33')]!==_0x7be5('0x42')){var _0x165b47={};_0x165b47[_0x4264be[_0x7be5('0x2e')]]={'$like':'%'+_0x25dec8['query']['filter']+'%'};return _0x165b47;}})});}_0xd7d696=_[_0x7be5('0x43')]({},_0xd7d696,_0x25dec8[_0x7be5('0x44')]);var _0x13241d={'where':_0xd7d696[_0x7be5('0x41')]};return db[_0x7be5('0x31')][_0x7be5('0x21')](_0x13241d)[_0x7be5('0x28')](function(_0x3e9e33){_0xdc91ac[_0x7be5('0x21')]=_0x3e9e33;if(_0x25dec8['query'][_0x7be5('0x45')]){_0xd7d696[_0x7be5('0x46')]=[{'all':!![]}];}return db['CmList'][_0x7be5('0x47')](_0xd7d696);})[_0x7be5('0x28')](function(_0x5d1663){_0xdc91ac[_0x7be5('0x48')]=_0x5d1663;return _0xdc91ac;})[_0x7be5('0x28')](respondWithFilteredResult(_0xeed4b5,_0xd7d696))[_0x7be5('0x49')](handleError(_0xeed4b5,null));};exports[_0x7be5('0x4a')]=function(_0x4cec42,_0x58f89b){var _0x582ce={'raw':![],'where':{'id':_0x4cec42[_0x7be5('0x4b')]['id']}},_0x2aba3c={};_0x2aba3c[_0x7be5('0x34')]=_[_0x7be5('0x36')](db['CmList']['rawAttributes']);_0x2aba3c[_0x7be5('0x35')]=_[_0x7be5('0x36')](_0x4cec42[_0x7be5('0x35')]);_0x2aba3c[_0x7be5('0x37')]=_['intersection'](_0x2aba3c[_0x7be5('0x34')],_0x2aba3c[_0x7be5('0x35')]);_0x582ce['attributes']=_['intersection'](_0x2aba3c['model'],qs['fields'](_0x4cec42['query'][_0x7be5('0x3a')]));_0x582ce['attributes']=_0x582ce[_0x7be5('0x38')][_0x7be5('0x3b')]?_0x582ce['attributes']:_0x2aba3c[_0x7be5('0x34')];if(_0x4cec42['query']['includeAll']){_0x582ce['include']=[{'all':!![]}];}_0x582ce=_['merge']({},_0x582ce,_0x4cec42[_0x7be5('0x44')]);return db[_0x7be5('0x31')][_0x7be5('0x4c')](_0x582ce)[_0x7be5('0x28')](handleEntityNotFound(_0x58f89b,null))[_0x7be5('0x28')](respondWithResult(_0x58f89b,null))[_0x7be5('0x49')](handleError(_0x58f89b,null));};exports[_0x7be5('0x4d')]=function(_0x489928,_0x46a124){return db[_0x7be5('0x31')][_0x7be5('0x4d')](_0x489928[_0x7be5('0x4e')],{})[_0x7be5('0x28')](function(_0x4b9740){var _0x1c5dd7=_0x489928[_0x7be5('0x4f')][_0x7be5('0x2a')]({'plain':!![]});if(!_0x1c5dd7)throw new Error(_0x7be5('0x50'));if(_0x1c5dd7['role']===_0x7be5('0x4f')){var _0x38bdd8=_0x4b9740[_0x7be5('0x2a')]({'plain':!![]});var _0x114f2c=_0x7be5('0x2b');return db['UserProfileSection'][_0x7be5('0x4c')]({'where':{'name':_0x114f2c,'userProfileId':_0x1c5dd7[_0x7be5('0x51')]},'raw':!![]})['then'](function(_0x38f654){if(_0x38f654&&_0x38f654[_0x7be5('0x52')]===0x0){return db[_0x7be5('0x2c')]['create']({'name':_0x38bdd8['name'],'resourceId':_0x38bdd8['id'],'type':_0x38f654['name'],'sectionId':_0x38f654['id']},{})['then'](function(){return _0x4b9740;});}else{return _0x4b9740;}})['catch'](function(_0x14f71d){logger[_0x7be5('0x53')](_0x7be5('0x54'),_0x14f71d);throw _0x14f71d;});}return _0x4b9740;})[_0x7be5('0x28')](respondWithResult(_0x46a124,0xc9))[_0x7be5('0x49')](handleError(_0x46a124,null));};exports[_0x7be5('0x27')]=function(_0x13ab1e,_0x4eaadf){if(_0x13ab1e[_0x7be5('0x4e')]['id']){delete _0x13ab1e[_0x7be5('0x4e')]['id'];}return db[_0x7be5('0x31')][_0x7be5('0x4c')]({'where':{'id':_0x13ab1e[_0x7be5('0x4b')]['id']}})[_0x7be5('0x28')](handleEntityNotFound(_0x4eaadf,null))[_0x7be5('0x28')](saveUpdates(_0x13ab1e[_0x7be5('0x4e')],null))[_0x7be5('0x28')](respondWithResult(_0x4eaadf,null))[_0x7be5('0x49')](handleError(_0x4eaadf,null));};exports[_0x7be5('0x29')]=function(_0x46c84e,_0x5d9d4d){return db['CmList'][_0x7be5('0x4c')]({'where':{'id':_0x46c84e[_0x7be5('0x4b')]['id']}})[_0x7be5('0x28')](handleEntityNotFound(_0x5d9d4d,null))[_0x7be5('0x28')](removeEntity(_0x5d9d4d,null))[_0x7be5('0x49')](handleError(_0x5d9d4d,null));};exports['describe']=function(_0x5924b6,_0x62e1f4){return db['CmList']['describe']()[_0x7be5('0x28')](respondWithResult(_0x62e1f4,null))[_0x7be5('0x49')](handleError(_0x62e1f4,null));};exports[_0x7be5('0x55')]=function(_0x1a57d6,_0x441084,_0xa6d1d){if(_0x1a57d6[_0x7be5('0x4e')]['id']){delete _0x1a57d6['body']['id'];}return db['CmList']['find']({'where':{'id':_0x1a57d6['params']['id']}})['then'](handleEntityNotFound(_0x441084,null))['then'](function(_0x37feb3){if(_0x37feb3){_0x1a57d6[_0x7be5('0x4e')][_0x7be5('0x56')]=_0x37feb3['id'];return db[_0x7be5('0x57')][_0x7be5('0x4d')](_0x1a57d6[_0x7be5('0x4e')]);}})[_0x7be5('0x28')](respondWithResult(_0x441084,null))[_0x7be5('0x49')](handleError(_0x441084,null));};exports['getDispositions']=function(_0x44c283,_0x3cd091,_0x432f22){var _0x302b64={'raw':![],'where':{}};var _0x467481={};var _0x513856={'count':0x0,'rows':[]};return db[_0x7be5('0x31')][_0x7be5('0x58')]({'where':{'id':_0x44c283['params']['id']}})[_0x7be5('0x28')](handleEntityNotFound(_0x3cd091,null))['then'](function(_0x56f324){if(_0x56f324){_0x467481[_0x7be5('0x34')]=_[_0x7be5('0x36')](db[_0x7be5('0x57')]['rawAttributes']);_0x467481[_0x7be5('0x35')]=_[_0x7be5('0x36')](_0x44c283[_0x7be5('0x35')]);_0x467481[_0x7be5('0x37')]=_[_0x7be5('0x39')](_0x467481[_0x7be5('0x34')],_0x467481[_0x7be5('0x35')]);_0x302b64[_0x7be5('0x38')]=_[_0x7be5('0x39')](_0x467481[_0x7be5('0x34')],qs[_0x7be5('0x3a')](_0x44c283[_0x7be5('0x35')][_0x7be5('0x3a')]));_0x302b64['attributes']=_0x302b64[_0x7be5('0x38')][_0x7be5('0x3b')]?_0x302b64[_0x7be5('0x38')]:_0x467481[_0x7be5('0x34')];if(!_0x44c283[_0x7be5('0x35')][_0x7be5('0x3c')](_0x7be5('0x3d'))){_0x302b64[_0x7be5('0x20')]=qs['limit'](_0x44c283['query'][_0x7be5('0x20')]);_0x302b64['offset']=qs['offset'](_0x44c283[_0x7be5('0x35')][_0x7be5('0x1e')]);}_0x302b64[_0x7be5('0x59')]=qs[_0x7be5('0x3e')](_0x44c283[_0x7be5('0x35')][_0x7be5('0x3e')]);_0x302b64[_0x7be5('0x41')]=qs[_0x7be5('0x37')](_[_0x7be5('0x3f')](_0x44c283[_0x7be5('0x35')],_0x467481['filters']));_0x302b64['where']['ListId']=_0x56f324['id'];if(_0x44c283[_0x7be5('0x35')][_0x7be5('0x40')]){_0x302b64[_0x7be5('0x41')]=_['merge'](_0x302b64[_0x7be5('0x41')],{'$or':_[_0x7be5('0x30')](_0x302b64[_0x7be5('0x38')],function(_0xdeac95){var _0x479444={};_0x479444[_0xdeac95]={'$like':'%'+_0x44c283[_0x7be5('0x35')]['filter']+'%'};return _0x479444;})});}_0x302b64=_[_0x7be5('0x43')]({},_0x302b64,_0x44c283[_0x7be5('0x44')]);return db[_0x7be5('0x57')][_0x7be5('0x21')]({'where':_0x302b64[_0x7be5('0x41')]})[_0x7be5('0x28')](function(_0x16d417){_0x513856['count']=_0x16d417;if(_0x44c283[_0x7be5('0x35')][_0x7be5('0x45')]){_0x302b64['include']=[{'all':!![]}];}return db[_0x7be5('0x57')][_0x7be5('0x47')](_0x302b64);})[_0x7be5('0x28')](function(_0x517346){_0x513856[_0x7be5('0x48')]=_0x517346;return _0x513856;});}})[_0x7be5('0x28')](respondWithFilteredResult(_0x3cd091,_0x302b64))[_0x7be5('0x49')](handleError(_0x3cd091,null));};exports['removeDispositions']=function(_0x40997e,_0x1963ba,_0x37105a){return db['CmList']['find']({'where':{'id':_0x40997e[_0x7be5('0x4b')]['id']}})[_0x7be5('0x28')](handleEntityNotFound(_0x1963ba,null))[_0x7be5('0x28')](function(_0x26acf0){if(_0x26acf0){return _0x26acf0['removeDispositions'](_0x40997e[_0x7be5('0x35')][_0x7be5('0x5a')]);}})[_0x7be5('0x28')](respondWithStatusCode(_0x1963ba,null))[_0x7be5('0x49')](handleError(_0x1963ba,null));};exports[_0x7be5('0x5b')]=function(_0x186dc3,_0x3ef3fb,_0x1bd59b){return db[_0x7be5('0x31')][_0x7be5('0x4c')]({'where':{'id':_0x186dc3[_0x7be5('0x4b')]['id']}})[_0x7be5('0x28')](handleEntityNotFound(_0x3ef3fb,null))[_0x7be5('0x28')](function(_0x557f93){if(_0x557f93){var _0x27d7f4=[];var _0x1511c0={'success':[],'errors':[]};return db[_0x7be5('0x5c')][_0x7be5('0x5d')]()[_0x7be5('0x28')](function(_0x1a3812){if(_0x186dc3['body'][_0x7be5('0x5e')]&&_[_0x7be5('0x5f')](_0x186dc3[_0x7be5('0x4e')]['tags'])){if(_0x186dc3[_0x7be5('0x4e')][_0x7be5('0x5e')][_0x7be5('0x3b')]){_0x186dc3[_0x7be5('0x4e')][_0x7be5('0x5e')]=_0x186dc3[_0x7be5('0x4e')][_0x7be5('0x5e')][_0x7be5('0x60')](';')+';';}else{_0x186dc3[_0x7be5('0x4e')][_0x7be5('0x5e')]=null;}}else{_0x186dc3['body'][_0x7be5('0x5e')]=null;}if(_0x186dc3[_0x7be5('0x4e')]&&_['isArray'](_0x186dc3[_0x7be5('0x4e')])){for(var _0x1fb457=0x0;_0x1fb457<_0x186dc3[_0x7be5('0x4e')][_0x7be5('0x3b')];_0x1fb457+=0x1){_0x186dc3[_0x7be5('0x4e')][_0x1fb457]['ListId']=_0x186dc3[_0x7be5('0x4b')]['id'];_0x27d7f4[_0x7be5('0x61')](_0x186dc3[_0x7be5('0x4e')][_0x1fb457]);}return BPromise[_0x7be5('0x62')](_0x27d7f4,function(_0x1f7675){return db[_0x7be5('0x5c')][_0x7be5('0x4d')](_['omit'](_0x1f7675,[_0x7be5('0x5a'),'id'])||{},{'fields':_[_0x7be5('0x36')](_0x1a3812),'raw':!![]})['then'](function(_0x15812c){_0x1511c0['success']['push'](_0x15812c[_0x7be5('0x63')]);})[_0x7be5('0x49')](function(_0x173fdf){_0x1511c0[_0x7be5('0x64')]['push']({'data':_0x1f7675,'error':_0x173fdf['message']});});})['then'](function(_0x364a06){return _0x1511c0;})[_0x7be5('0x49')](function(_0x282f1d){return _0x282f1d;});}else{_0x3ef3fb[_0x7be5('0x1c')](0x190)[_0x7be5('0x24')]({'message':_0x7be5('0x65')});}});}})[_0x7be5('0x28')](respondWithResult(_0x3ef3fb,null))[_0x7be5('0x49')](handleError(_0x3ef3fb,null));};exports['getContacts']=function(_0x24b358,_0x536764,_0xea5a6c){var _0x32f3a6;return db[_0x7be5('0x31')]['find']({'where':{'id':_0x24b358['params']['id']},'include':[{'model':db[_0x7be5('0x66')],'as':_0x7be5('0x67')}]})[_0x7be5('0x28')](handleEntityNotFound(_0x536764,null))['then'](function(_0x55cb14){if(_0x55cb14){_0x32f3a6=_0x55cb14;return db[_0x7be5('0x5c')][_0x7be5('0x68')];}})[_0x7be5('0x28')](function(_0x289d83){if(_0x289d83){var _0x3af10a={};var _0x1612d5={};_0x1612d5['model']=_[_0x7be5('0x69')](_[_0x7be5('0x36')](_0x289d83),_[_0x7be5('0x30')](_0x32f3a6['CustomFields'],function(_0x170818){return util['format']('cf_%d',_0x170818['id']);}));_0x1612d5[_0x7be5('0x35')]=_[_0x7be5('0x36')](_0x24b358[_0x7be5('0x35')]);_0x1612d5[_0x7be5('0x37')]=_[_0x7be5('0x39')](_0x1612d5[_0x7be5('0x34')],_0x1612d5[_0x7be5('0x35')]);_0x3af10a[_0x7be5('0x38')]=_['intersection'](_0x1612d5['model'],qs['fields'](_0x24b358[_0x7be5('0x35')][_0x7be5('0x3a')]));_0x3af10a[_0x7be5('0x38')]=_0x3af10a[_0x7be5('0x38')][_0x7be5('0x3b')]?_0x3af10a[_0x7be5('0x38')]:_0x1612d5['model'];if(!_0x24b358[_0x7be5('0x35')][_0x7be5('0x3c')](_0x7be5('0x3d'))){_0x3af10a[_0x7be5('0x20')]=qs['limit'](_0x24b358[_0x7be5('0x35')][_0x7be5('0x20')]);_0x3af10a[_0x7be5('0x1e')]=qs[_0x7be5('0x1e')](_0x24b358[_0x7be5('0x35')][_0x7be5('0x1e')]);}_0x3af10a['order']=qs[_0x7be5('0x3e')](_0x24b358[_0x7be5('0x35')][_0x7be5('0x3e')]);_0x3af10a[_0x7be5('0x41')]=qs[_0x7be5('0x37')](_[_0x7be5('0x3f')](_0x24b358[_0x7be5('0x35')],_0x1612d5[_0x7be5('0x37')]));_0x3af10a[_0x7be5('0x6a')]=!![];if(_0x24b358[_0x7be5('0x35')][_0x7be5('0x40')]){_0x3af10a[_0x7be5('0x41')]=_[_0x7be5('0x43')](_0x3af10a[_0x7be5('0x41')],{'$or':_['map'](_0x3af10a[_0x7be5('0x38')],function(_0x295ff6){var _0x4d44b2={};_0x4d44b2[_0x295ff6]={'$like':'%'+_0x24b358[_0x7be5('0x35')][_0x7be5('0x40')]+'%'};return _0x4d44b2;})});}_0x3af10a=_['merge']({},_0x3af10a,_0x24b358['options']);return _0x32f3a6[_0x7be5('0x6b')](_0x3af10a);}})['then'](respondWithResult(_0x536764,null))['catch'](handleError(_0x536764,null));};exports[_0x7be5('0x6c')]=function(_0x478b34,_0x129f07,_0x16e6fb){var _0x1c17b0;var _0x1089b2;var _0x53fff3;var _0x36db52=_0x478b34[_0x7be5('0x4b')]['id'];csv_results=[];return db[_0x7be5('0x6d')][_0x7be5('0x47')]({'attributes':['id',_0x7be5('0x2e')],'raw':!![],'order':['OrderBy']})['then'](function(_0x5b7603){_0x1c17b0=_0x5b7603;var _0x50e05c=_[_0x7be5('0x36')](db['CmContact'][_0x7be5('0x68')]);return db[_0x7be5('0x66')][_0x7be5('0x47')]({'raw':!![],'attributes':['id','alias']})[_0x7be5('0x28')](function(_0x1f6666){_0x1089b2=_0x1f6666;var _0x555bdc=squel[_0x7be5('0x6e')]()[_0x7be5('0x3a')](_0x50e05c)['from'](_0x7be5('0x6f'),'c')[_0x7be5('0x41')](_0x7be5('0x70'),_0x36db52)[_0x7be5('0x41')](_0x7be5('0x71'))['distinct']();for(var _0x171beb=0x0;_0x171beb<_0x1089b2[_0x7be5('0x3b')];_0x171beb++){_0x555bdc[_0x7be5('0x72')](_0x7be5('0x73')+_0x1089b2[_0x171beb]['id'],_0x7be5('0x74')+_0x1089b2[_0x171beb][_0x7be5('0x75')]);}for(var _0x171beb=0x0;_0x171beb<_0x1c17b0[_0x7be5('0x3b')];_0x171beb++){_0x555bdc[_0x7be5('0x72')](squel[_0x7be5('0x6e')]()[_0x7be5('0x72')](_0x7be5('0x76'))[_0x7be5('0x77')]('cm_contact_has_items')[_0x7be5('0x41')](_0x7be5('0x78'),_0x1c17b0[_0x171beb]['id'])[_0x7be5('0x41')](_0x7be5('0x79')),'additionalPhone_'+_0x1c17b0[_0x171beb][_0x7be5('0x2e')]);_0x555bdc[_0x7be5('0x72')](squel[_0x7be5('0x6e')]()[_0x7be5('0x72')](_0x7be5('0x7a'))['from'](_0x7be5('0x7b'))[_0x7be5('0x41')]('ItemTypeId\x20=\x20?',_0x1c17b0[_0x171beb]['id'])['where'](_0x7be5('0x79')),_0x7be5('0x7c')+_0x1c17b0[_0x171beb][_0x7be5('0x2e')]);}var _0x259b14=[];_0x259b14[_0x7be5('0x61')](_0x555bdc[_0x7be5('0x7d')]());BPromise[_0x7be5('0x62')](_0x259b14,handleQuery)[_0x7be5('0x28')](function(_0x34977a){handleQuery(_0x555bdc[_0x7be5('0x7d')]());var _0x43c656=csv_results[0x0];if(!_['isEmpty'](_0x43c656)){var _0x3dbd3c=toCsv(_0x43c656);var _0x13eab4=Date[_0x7be5('0x7e')]();fs[_0x7be5('0x7f')](util[_0x7be5('0x80')](_0x7be5('0x81'),_0x36db52,_0x13eab4),_0x3dbd3c);_0x129f07[_0x7be5('0x82')](_0x7be5('0x83'),_0x7be5('0x84')+util[_0x7be5('0x80')]('list_%d_%s.csv',_0x36db52,_0x13eab4));_0x129f07[_0x7be5('0x82')](_0x7be5('0x85'),_0x7be5('0x86'));return _0x129f07[_0x7be5('0x87')](util[_0x7be5('0x80')](_0x7be5('0x81'),_0x36db52,_0x13eab4));}else{return _0x129f07[_0x7be5('0x2d')](0xcc);}});});});};exports[_0x7be5('0x88')]=function(_0x133b2c,_0x194bdf,_0x213fe8){var _0x23a88c;delete _0x133b2c[_0x7be5('0x4e')]['id'];return db[_0x7be5('0x31')][_0x7be5('0x58')]({'where':{'id':_0x133b2c[_0x7be5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x194bdf,null))['then'](function(_0x4e821f){if(_0x4e821f){return db[_0x7be5('0x89')][_0x7be5('0x8a')](function(_0x23042d){return db[_0x7be5('0x66')][_0x7be5('0x4d')](_0x133b2c[_0x7be5('0x4e')],{'transaction':_0x23042d})['then'](function(_0x506773){_0x23a88c=_0x506773;return _0x4e821f[_0x7be5('0x8b')](_0x506773,{'transaction':_0x23042d});})[_0x7be5('0x28')](function(){var _0xf2ae99={'type':db['Sequelize'][_0x7be5('0x8c')],'transaction':_0x23042d};switch(_0x133b2c[_0x7be5('0x4e')][_0x7be5('0x33')]){case _0x7be5('0x8d'):_0xf2ae99[_0x7be5('0x33')]=db['Sequelize'][_0x7be5('0x8c')];break;case _0x7be5('0x8e'):_0xf2ae99[_0x7be5('0x33')]=db[_0x7be5('0x8f')][_0x7be5('0x90')];break;case'switch':_0xf2ae99[_0x7be5('0x33')]=db['Sequelize']['BOOLEAN'];_0xf2ae99[_0x7be5('0x91')]=![];break;default:}return db[_0x7be5('0x89')][_0x7be5('0x92')]['addColumn']('cm_contacts',util[_0x7be5('0x80')]('cf_%s',_0x23a88c['id']),_0xf2ae99);})[_0x7be5('0x28')](function(){return _0x23a88c;});});}})[_0x7be5('0x28')](respondWithResult(_0x194bdf,null))[_0x7be5('0x49')](handleError(_0x194bdf,null));};exports[_0x7be5('0x93')]=function(_0x4e4fac,_0x993fca,_0x3be878){var _0x3b6588={};var _0xa0d60a={};var _0x8f7ad3;var _0x5a71fb;return db[_0x7be5('0x31')]['findOne']({'where':{'id':_0x4e4fac[_0x7be5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x993fca,null))[_0x7be5('0x28')](function(_0x16f355){if(_0x16f355){_0x8f7ad3=_0x16f355;_0xa0d60a[_0x7be5('0x34')]=_['keys'](db[_0x7be5('0x66')]['rawAttributes']);_0xa0d60a[_0x7be5('0x35')]=_['keys'](_0x4e4fac['query']);_0xa0d60a[_0x7be5('0x37')]=_[_0x7be5('0x39')](_0xa0d60a[_0x7be5('0x34')],_0xa0d60a[_0x7be5('0x35')]);_0x3b6588[_0x7be5('0x38')]=_[_0x7be5('0x39')](_0xa0d60a['model'],qs[_0x7be5('0x3a')](_0x4e4fac[_0x7be5('0x35')][_0x7be5('0x3a')]));_0x3b6588[_0x7be5('0x38')]=_0x3b6588['attributes'][_0x7be5('0x3b')]?_0x3b6588[_0x7be5('0x38')]:_0xa0d60a['model'];_0x3b6588[_0x7be5('0x59')]=qs[_0x7be5('0x3e')](_0x4e4fac['query'][_0x7be5('0x3e')]);_0x3b6588[_0x7be5('0x41')]=qs[_0x7be5('0x37')](_[_0x7be5('0x3f')](_0x4e4fac[_0x7be5('0x35')],_0xa0d60a[_0x7be5('0x37')]));_0x3b6588[_0x7be5('0x41')]=_[_0x7be5('0x43')](_0x3b6588[_0x7be5('0x41')],{'$or':[{'ListId':_0x16f355['id']},{'ListId':null}]});if(_0x4e4fac[_0x7be5('0x35')][_0x7be5('0x40')]){_0x3b6588['where']=_[_0x7be5('0x43')](_0x3b6588[_0x7be5('0x41')],{'$or':_[_0x7be5('0x30')](_0x3b6588['attributes'],function(_0x14558f){var _0x4631f2={};_0x4631f2[_0x14558f]={'$like':'%'+_0x4e4fac[_0x7be5('0x35')][_0x7be5('0x40')]+'%'};return _0x4631f2;})});}_0x3b6588=_[_0x7be5('0x43')]({},_0x3b6588,_0x4e4fac['options']);return db[_0x7be5('0x66')][_0x7be5('0x94')](_0x3b6588);}})[_0x7be5('0x28')](respondWithResult(_0x993fca,null))['catch'](handleError(_0x993fca,null));};exports[_0x7be5('0x95')]=function(_0x22e5d6,_0x1e0128){return db[_0x7be5('0x66')]['findAndCountAll']({'where':{'ListId':null}})[_0x7be5('0x28')](handleEntityNotFound(_0x1e0128,null))[_0x7be5('0x28')](function(_0x39c330){return _0x39c330;})[_0x7be5('0x28')](respondWithResult(_0x1e0128,null))[_0x7be5('0x49')](handleError(_0x1e0128,null));};exports[_0x7be5('0x96')]=function(_0x2262e2,_0x14625d,_0x163dca){return db[_0x7be5('0x31')]['find']({'where':{'id':_0x2262e2['params']['id']}})[_0x7be5('0x28')](handleEntityNotFound(_0x14625d,null))[_0x7be5('0x28')](function(_0x2b90b0){if(_0x2b90b0){return _0x2b90b0[_0x7be5('0x96')](_0x2262e2[_0x7be5('0x4e')][_0x7be5('0x5a')],_[_0x7be5('0x97')](_0x2262e2[_0x7be5('0x4e')],[_0x7be5('0x5a'),'id'])||{})[_0x7be5('0x98')](function(_0x2f8250){for(var _0x25607c=0x0;_0x25607c<_0x2262e2[_0x7be5('0x4e')][_0x7be5('0x5a')][_0x7be5('0x3b')];_0x25607c+=0x1){socket[_0x7be5('0x99')](_0x7be5('0x9a'),{'UserId':Number(_0x2262e2[_0x7be5('0x4e')][_0x7be5('0x5a')][_0x25607c]),'CmListId':Number(_0x2262e2[_0x7be5('0x4b')]['id'])});}return _0x2f8250;});}})[_0x7be5('0x28')](respondWithResult(_0x14625d,null))[_0x7be5('0x49')](handleError(_0x14625d,null));};exports[_0x7be5('0x9b')]=function(_0x3a6243,_0x19e84f,_0x127de3){return db['CmList']['find']({'where':{'id':_0x3a6243[_0x7be5('0x4b')]['id']}})[_0x7be5('0x28')](handleEntityNotFound(_0x19e84f,null))[_0x7be5('0x28')](function(_0x47a31c){if(_0x47a31c){return _0x47a31c['removeAgents'](_0x3a6243[_0x7be5('0x35')]['ids'])[_0x7be5('0x28')](function(){if(_[_0x7be5('0x5f')](_0x3a6243['query'][_0x7be5('0x5a')])){for(var _0x4e02da=0x0;_0x4e02da<_0x3a6243[_0x7be5('0x35')]['ids'][_0x7be5('0x3b')];_0x4e02da+=0x1){socket[_0x7be5('0x99')](_0x7be5('0x9c'),{'UserId':Number(_0x3a6243[_0x7be5('0x35')]['ids'][_0x4e02da]),'CmListId':Number(_0x3a6243[_0x7be5('0x4b')]['id'])});}}else{socket[_0x7be5('0x99')](_0x7be5('0x9c'),{'UserId':Number(_0x3a6243['query'][_0x7be5('0x5a')]),'CmListId':Number(_0x3a6243[_0x7be5('0x4b')]['id'])});}});}})[_0x7be5('0x28')](respondWithStatusCode(_0x19e84f,null))[_0x7be5('0x49')](handleError(_0x19e84f,null));};exports[_0x7be5('0x9d')]=function(_0x353791,_0x17792c,_0x19b639){var _0x2059a7={};var _0x5ed163={};var _0x15a1fb;var _0x580f9a;return db[_0x7be5('0x31')][_0x7be5('0x58')]({'where':{'id':_0x353791['params']['id']}})[_0x7be5('0x28')](handleEntityNotFound(_0x17792c,null))[_0x7be5('0x28')](function(_0x5808ff){if(_0x5808ff){_0x15a1fb=_0x5808ff;_0x5ed163['model']=_[_0x7be5('0x36')](db[_0x7be5('0x9e')][_0x7be5('0x68')]);_0x5ed163['query']=_[_0x7be5('0x36')](_0x353791['query']);_0x5ed163['filters']=_[_0x7be5('0x39')](_0x5ed163[_0x7be5('0x34')],_0x5ed163[_0x7be5('0x35')]);_0x2059a7[_0x7be5('0x38')]=_['intersection'](_0x5ed163[_0x7be5('0x34')],qs['fields'](_0x353791[_0x7be5('0x35')][_0x7be5('0x3a')]));_0x2059a7[_0x7be5('0x38')]=_0x2059a7['attributes'][_0x7be5('0x3b')]?_0x2059a7[_0x7be5('0x38')]:_0x5ed163[_0x7be5('0x34')];_0x2059a7[_0x7be5('0x59')]=qs['sort'](_0x353791['query']['sort']);_0x2059a7[_0x7be5('0x41')]=qs[_0x7be5('0x37')](_['pick'](_0x353791['query'],_0x5ed163[_0x7be5('0x37')]));if(_0x353791['query'][_0x7be5('0x40')]){_0x2059a7[_0x7be5('0x41')]=_[_0x7be5('0x43')](_0x2059a7[_0x7be5('0x41')],{'$or':_[_0x7be5('0x30')](_0x2059a7['attributes'],function(_0x2f253e){var _0x61ad4d={};_0x61ad4d[_0x2f253e]={'$like':'%'+_0x353791[_0x7be5('0x35')][_0x7be5('0x40')]+'%'};return _0x61ad4d;})});}_0x2059a7=_['merge']({},_0x2059a7,_0x353791['options']);return _0x15a1fb['getAgents'](_0x2059a7);}})[_0x7be5('0x28')](function(_0x9a439c){if(_0x9a439c){_0x580f9a=_0x9a439c[_0x7be5('0x3b')];if(!_0x353791[_0x7be5('0x35')]['hasOwnProperty'](_0x7be5('0x3d'))){_0x2059a7['limit']=qs['limit'](_0x353791['query'][_0x7be5('0x20')]);_0x2059a7[_0x7be5('0x1e')]=qs[_0x7be5('0x1e')](_0x353791[_0x7be5('0x35')][_0x7be5('0x1e')]);}return _0x15a1fb[_0x7be5('0x9d')](_0x2059a7);}})[_0x7be5('0x28')](function(_0x1867a1){if(_0x1867a1){return _0x1867a1?{'count':_0x580f9a,'rows':_0x1867a1}:null;}})[_0x7be5('0x28')](respondWithResult(_0x17792c,null))['catch'](handleError(_0x17792c,null));};function handleQuery(_0x36f0f5){logger[_0x7be5('0x9f')](_0x36f0f5);return db[_0x7be5('0x89')]['query'](_0x36f0f5)[_0x7be5('0x98')](function(_0x22f87e){csv_results[_0x7be5('0x61')](_0x22f87e);})[_0x7be5('0x49')](function(_0x4f56bd){logger['error'](_0x4f56bd[_0x7be5('0xa0')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index e3fdb6d..1a347ba 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(_0x231351,_0x302a2b){var _0x37766c=function(_0x32dd68){while(--_0x32dd68){_0x231351['push'](_0x231351['shift']());}};_0x37766c(++_0x302a2b);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x390dfd,_0x444dcf){var _0x66c15d=function(_0x2daa12){while(--_0x2daa12){_0x390dfd['push'](_0x390dfd['shift']());}};_0x66c15d(++_0x444dcf);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 4788dec..887ef7e 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 _0x22fb=['define','CmList','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x48d999,_0x522309){var _0x33f0ab=function(_0x53c8ed){while(--_0x53c8ed){_0x48d999['push'](_0x48d999['shift']());}};_0x33f0ab(++_0x522309);}(_0x22fb,0x192));var _0xb22f=function(_0x510ab8,_0x23db33){_0x510ab8=_0x510ab8-0x0;var _0x55cb43=_0x22fb[_0x510ab8];return _0x55cb43;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));module[_0xb22f('0x7')]=function(_0x2d1fb3,_0xc3ffcc){return _0x2d1fb3[_0xb22f('0x8')](_0xb22f('0x9'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdb7=['request-promise','path','rimraf','./cmList.attributes','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3eca5a,_0x20d490){_0x3eca5a=_0x3eca5a-0x0;var _0x15470e=_0xbdb7[_0x3eca5a];return _0x15470e;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('CmList',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 3bf96e1..f58bf6c 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 _0xaab0=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x49ce5d,_0x4eb106){var _0x43f4f7=function(_0x21b881){while(--_0x21b881){_0x49ce5d['push'](_0x49ce5d['shift']());}};_0x43f4f7(++_0x4eb106);}(_0xaab0,0x1b6));var _0x0aab=function(_0x4114dd,_0x2ad862){_0x4114dd=_0x4114dd-0x0;var _0x26f44c=_0xaab0[_0x4114dd];return _0x26f44c;};'use strict';var _=require(_0x0aab('0x0'));var util=require(_0x0aab('0x1'));var moment=require(_0x0aab('0x2'));var BPromise=require('bluebird');var rs=require(_0x0aab('0x3'));var fs=require('fs');var Redis=require(_0x0aab('0x4'));var db=require(_0x0aab('0x5'))['db'];var utils=require(_0x0aab('0x6'));var logger=require(_0x0aab('0x7'))(_0x0aab('0x8'));var config=require(_0x0aab('0x9'));var jayson=require(_0x0aab('0xa'));var client=jayson[_0x0aab('0xb')]['http']({'port':0x232a});config[_0x0aab('0xc')]=_[_0x0aab('0xd')](config['redis'],{'host':_0x0aab('0xe'),'port':0x18eb});var socket=require(_0x0aab('0xf'))(new Redis(config[_0x0aab('0xc')]));require('./cmList.socket')[_0x0aab('0x10')](socket);function respondWithRpcPromise(_0x6fbbe1,_0x3684e7,_0x2ca118){return new BPromise(function(_0x1249d8,_0x81b958){return client[_0x0aab('0x11')](_0x6fbbe1,_0x2ca118)[_0x0aab('0x12')](function(_0x4aaa6a){logger['info']('CmList,\x20%s,\x20%s',_0x3684e7,_0x0aab('0x13'));logger['debug'](_0x0aab('0x14'),_0x3684e7,'request\x20sent',JSON[_0x0aab('0x15')](_0x4aaa6a));if(_0x4aaa6a[_0x0aab('0x16')]){if(_0x4aaa6a['error'][_0x0aab('0x17')]===0x1f4){logger[_0x0aab('0x16')](_0x0aab('0x18'),_0x3684e7,_0x4aaa6a[_0x0aab('0x16')][_0x0aab('0x19')]);return _0x81b958(_0x4aaa6a['error'][_0x0aab('0x19')]);}logger['error']('CmList,\x20%s,\x20%s',_0x3684e7,_0x4aaa6a['error'][_0x0aab('0x19')]);return _0x1249d8(_0x4aaa6a[_0x0aab('0x16')]['message']);}else{logger['info'](_0x0aab('0x18'),_0x3684e7,_0x0aab('0x13'));_0x1249d8(_0x4aaa6a[_0x0aab('0x1a')]['message']);}})[_0x0aab('0x1b')](function(_0x539dd4){logger[_0x0aab('0x16')](_0x0aab('0x18'),_0x3684e7,_0x539dd4);_0x81b958(_0x539dd4);});});} \ No newline at end of file +var _0x56ab=['stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s'];(function(_0x50fe3c,_0x51e3e8){var _0x1b8ca8=function(_0x5b2aa9){while(--_0x5b2aa9){_0x50fe3c['push'](_0x50fe3c['shift']());}};_0x1b8ca8(++_0x51e3e8);}(_0x56ab,0x7f));var _0xb56a=function(_0x396735,_0x3eedcf){_0x396735=_0x396735-0x0;var _0x352251=_0x56ab[_0x396735];return _0x352251;};'use strict';var _=require('lodash');var util=require(_0xb56a('0x0'));var moment=require(_0xb56a('0x1'));var BPromise=require('bluebird');var rs=require(_0xb56a('0x2'));var fs=require('fs');var Redis=require(_0xb56a('0x3'));var db=require(_0xb56a('0x4'))['db'];var utils=require(_0xb56a('0x5'));var logger=require(_0xb56a('0x6'))(_0xb56a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb56a('0x8')]['http']({'port':0x232a});config[_0xb56a('0x9')]=_['defaults'](config[_0xb56a('0x9')],{'host':_0xb56a('0xa'),'port':0x18eb});var socket=require(_0xb56a('0xb'))(new Redis(config[_0xb56a('0x9')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x556eea,_0x183a1b,_0x3e5d17){return new BPromise(function(_0x90e7dd,_0x59a78c){return client['request'](_0x556eea,_0x3e5d17)[_0xb56a('0xc')](function(_0x5b9a3a){logger[_0xb56a('0xd')]('CmList,\x20%s,\x20%s',_0x183a1b,_0xb56a('0xe'));logger[_0xb56a('0xf')](_0xb56a('0x10'),_0x183a1b,_0xb56a('0xe'),JSON[_0xb56a('0x11')](_0x5b9a3a));if(_0x5b9a3a[_0xb56a('0x12')]){if(_0x5b9a3a[_0xb56a('0x12')][_0xb56a('0x13')]===0x1f4){logger['error'](_0xb56a('0x14'),_0x183a1b,_0x5b9a3a[_0xb56a('0x12')][_0xb56a('0x15')]);return _0x59a78c(_0x5b9a3a[_0xb56a('0x12')][_0xb56a('0x15')]);}logger['error']('CmList,\x20%s,\x20%s',_0x183a1b,_0x5b9a3a[_0xb56a('0x12')]['message']);return _0x90e7dd(_0x5b9a3a['error']['message']);}else{logger[_0xb56a('0xd')](_0xb56a('0x14'),_0x183a1b,_0xb56a('0xe'));_0x90e7dd(_0x5b9a3a[_0xb56a('0x16')]['message']);}})[_0xb56a('0x17')](function(_0x15f18f){logger[_0xb56a('0x12')](_0xb56a('0x14'),_0x183a1b,_0x15f18f);_0x59a78c(_0x15f18f);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 2b3d0a3..b25c2a1 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 _0x4551=['length','cmList:','save','remove','update','emit','removeListener','register'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x4551,0x1a2));var _0x1455=function(_0x51a09f,_0x333271){_0x51a09f=_0x51a09f-0x0;var _0x38df4f=_0x4551[_0x51a09f];return _0x38df4f;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x1455('0x0'),_0x1455('0x1'),_0x1455('0x2')];function createListener(_0x29966,_0x4fa192){return function(_0x3bdd8d){_0x4fa192[_0x1455('0x3')](_0x29966,_0x3bdd8d);};}function removeListener(_0x2c5b97,_0x22d36c){return function(){CmListEvents[_0x1455('0x4')](_0x2c5b97,_0x22d36c);};}exports[_0x1455('0x5')]=function(_0x5077bc){for(var _0x2f030f=0x0,_0x1c9835=events[_0x1455('0x6')];_0x2f030f<_0x1c9835;_0x2f030f++){var _0x173594=events[_0x2f030f];var _0x4f4616=createListener(_0x1455('0x7')+_0x173594,_0x5077bc);CmListEvents['on'](_0x173594,_0x4f4616);}}; \ No newline at end of file +var _0x2543=['emit','removeListener','register','length','cmList:','save','remove','update'];(function(_0x21edb7,_0x360928){var _0x20eabc=function(_0x3dec11){while(--_0x3dec11){_0x21edb7['push'](_0x21edb7['shift']());}};_0x20eabc(++_0x360928);}(_0x2543,0x125));var _0x3254=function(_0x392be3,_0xf1d603){_0x392be3=_0x392be3-0x0;var _0x1453b2=_0x2543[_0x392be3];return _0x1453b2;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x3254('0x0'),_0x3254('0x1'),_0x3254('0x2')];function createListener(_0x659d90,_0x561223){return function(_0x1ad284){_0x561223[_0x3254('0x3')](_0x659d90,_0x1ad284);};}function removeListener(_0x19cbcd,_0x2dfdba){return function(){CmListEvents[_0x3254('0x4')](_0x19cbcd,_0x2dfdba);};}exports[_0x3254('0x5')]=function(_0x510a05){for(var _0x187546=0x0,_0x20f118=events[_0x3254('0x6')];_0x187546<_0x20f118;_0x187546++){var _0x5ced6e=events[_0x187546];var _0xf94a48=createListener(_0x3254('0x7')+_0x5ced6e,_0x510a05);CmListEvents['on'](_0x5ced6e,_0xf94a48);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index cf32caa..007c8f4 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 _0x073c=['/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','create','post','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','describe','/global_fields','/:id','show','/:id/dispositions','getDispositions'];(function(_0x115f84,_0x414879){var _0x2467df=function(_0x177ab2){while(--_0x177ab2){_0x115f84['push'](_0x115f84['shift']());}};_0x2467df(++_0x414879);}(_0x073c,0x118));var _0xc073=function(_0x4549ee,_0x2d3817){_0x4549ee=_0x4549ee-0x0;var _0x18a540=_0x073c[_0x4549ee];return _0x18a540;};'use strict';var multer=require('multer');var util=require(_0xc073('0x0'));var path=require(_0xc073('0x1'));var timeout=require(_0xc073('0x2'));var express=require(_0xc073('0x3'));var router=express[_0xc073('0x4')]();var fs_extra=require(_0xc073('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc073('0x6'));var config=require('../../config/environment');var controller=require(_0xc073('0x7'));router[_0xc073('0x8')]('/',auth[_0xc073('0x9')](),controller[_0xc073('0xa')]);router[_0xc073('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xc073('0xb')]);router['get'](_0xc073('0xc'),auth[_0xc073('0x9')](),controller['getGlobalCustomFields']);router[_0xc073('0x8')](_0xc073('0xd'),auth[_0xc073('0x9')](),controller[_0xc073('0xe')]);router['get'](_0xc073('0xf'),auth[_0xc073('0x9')](),controller[_0xc073('0x10')]);router[_0xc073('0x8')](_0xc073('0x11'),auth[_0xc073('0x9')](),controller[_0xc073('0x12')]);router['get'](_0xc073('0x13'),auth[_0xc073('0x9')](),controller[_0xc073('0x14')]);router[_0xc073('0x8')](_0xc073('0x15'),auth[_0xc073('0x9')](),controller[_0xc073('0x16')]);router[_0xc073('0x8')](_0xc073('0x17'),auth[_0xc073('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xc073('0x18')]);router[_0xc073('0x19')](_0xc073('0xf'),auth['isAuthenticated'](),controller[_0xc073('0x1a')]);router['post']('/:id/contacts',auth[_0xc073('0x9')](),controller[_0xc073('0x1b')]);router[_0xc073('0x19')](_0xc073('0x15'),auth[_0xc073('0x9')](),controller[_0xc073('0x1c')]);router['post'](_0xc073('0x17'),auth[_0xc073('0x9')](),controller[_0xc073('0x1d')]);router[_0xc073('0x1e')](_0xc073('0xd'),auth[_0xc073('0x9')](),controller[_0xc073('0x1f')]);router[_0xc073('0x20')](_0xc073('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc073('0x20')](_0xc073('0xf'),auth[_0xc073('0x9')](),controller['removeDispositions']);router['delete'](_0xc073('0x17'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x16e4=['/:id/dispositions','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/global_fields','show','getDispositions','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','/:id/contacts','addContacts','addCustomField','addAgents','put','/:id','update','delete','destroy'];(function(_0x3894a3,_0x5c91ed){var _0x636e77=function(_0x254adf){while(--_0x254adf){_0x3894a3['push'](_0x3894a3['shift']());}};_0x636e77(++_0x5c91ed);}(_0x16e4,0x97));var _0x416e=function(_0x4b9fb1,_0x59cf71){_0x4b9fb1=_0x4b9fb1-0x0;var _0x360df6=_0x16e4[_0x4b9fb1];return _0x360df6;};'use strict';var multer=require(_0x416e('0x0'));var util=require(_0x416e('0x1'));var path=require(_0x416e('0x2'));var timeout=require(_0x416e('0x3'));var express=require(_0x416e('0x4'));var router=express[_0x416e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x416e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x416e('0x7'));var controller=require(_0x416e('0x8'));router['get']('/',auth[_0x416e('0x9')](),controller[_0x416e('0xa')]);router[_0x416e('0xb')](_0x416e('0xc'),auth[_0x416e('0x9')](),controller[_0x416e('0xd')]);router[_0x416e('0xb')](_0x416e('0xe'),auth[_0x416e('0x9')](),controller['getGlobalCustomFields']);router[_0x416e('0xb')]('/:id',auth[_0x416e('0x9')](),controller[_0x416e('0xf')]);router[_0x416e('0xb')]('/:id/dispositions',auth[_0x416e('0x9')](),controller[_0x416e('0x10')]);router[_0x416e('0xb')]('/:id/contacts',auth[_0x416e('0x9')](),controller['getContacts']);router[_0x416e('0xb')](_0x416e('0x11'),auth[_0x416e('0x9')](),controller[_0x416e('0x12')]);router['get'](_0x416e('0x13'),auth[_0x416e('0x9')](),controller[_0x416e('0x14')]);router[_0x416e('0xb')](_0x416e('0x15'),auth[_0x416e('0x9')](),controller[_0x416e('0x16')]);router[_0x416e('0x17')]('/',auth[_0x416e('0x9')](),controller['create']);router['post']('/:id/dispositions',auth[_0x416e('0x9')](),controller[_0x416e('0x18')]);router[_0x416e('0x17')](_0x416e('0x19'),auth['isAuthenticated'](),controller[_0x416e('0x1a')]);router[_0x416e('0x17')]('/:id/fields',auth[_0x416e('0x9')](),controller[_0x416e('0x1b')]);router[_0x416e('0x17')](_0x416e('0x15'),auth[_0x416e('0x9')](),controller[_0x416e('0x1c')]);router[_0x416e('0x1d')](_0x416e('0x1e'),auth[_0x416e('0x9')](),controller[_0x416e('0x1f')]);router[_0x416e('0x20')]('/:id',auth[_0x416e('0x9')](),controller[_0x416e('0x21')]);router[_0x416e('0x20')](_0x416e('0x22'),auth[_0x416e('0x9')](),controller[_0x416e('0x23')]);router['delete'](_0x416e('0x15'),auth[_0x416e('0x9')](),controller[_0x416e('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 1e9cb5d..d96fa58 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 _0xca6e=['VIRTUAL','getDataValue','field','STRING','sequelize','exports'];(function(_0x243fd3,_0x25e8d3){var _0x1575b7=function(_0x44d893){while(--_0x44d893){_0x243fd3['push'](_0x243fd3['shift']());}};_0x1575b7(++_0x25e8d3);}(_0xca6e,0x166));var _0xeca6=function(_0x39bf30,_0x165a71){_0x39bf30=_0x39bf30-0x0;var _0x3268d0=_0xca6e[_0x39bf30];return _0x3268d0;};'use strict';var Sequelize=require(_0xeca6('0x0'));module[_0xeca6('0x1')]={'name':{'type':Sequelize[_0xeca6('0x2')],'get':function(_0x33a58a){return this[_0xeca6('0x3')](_0xeca6('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xeca6('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xeca6('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0x30c8=['VIRTUAL','STRING','sequelize','exports'];(function(_0x3548ac,_0x369f96){var _0x1497fc=function(_0x5b6ce8){while(--_0x5b6ce8){_0x3548ac['push'](_0x3548ac['shift']());}};_0x1497fc(++_0x369f96);}(_0x30c8,0x76));var _0x830c=function(_0x272aee,_0x34a74b){_0x272aee=_0x272aee-0x0;var _0x2371ac=_0x30c8[_0x272aee];return _0x2371ac;};'use strict';var Sequelize=require(_0x830c('0x0'));module[_0x830c('0x1')]={'name':{'type':Sequelize[_0x830c('0x2')],'get':function(_0x40ef96){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x830c('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x830c('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 92c0543..0a91224 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(_0x2cd6b7,_0x45a398){var _0x30fc99=function(_0x156b06){while(--_0x156b06){_0x2cd6b7['push'](_0x2cd6b7['shift']());}};_0x30fc99(++_0x45a398);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x5529e0,_0x5f2e6f){var _0x11788e=function(_0xe3886){while(--_0xe3886){_0x5529e0['push'](_0x5529e0['shift']());}};_0x11788e(++_0x5f2e6f);}(_0x7a54,0x106));var _0x47a5=function(_0x299d12,_0x9c3563){_0x299d12=_0x299d12-0x0;var _0x2bc1f5=_0x7a54[_0x299d12];return _0x2bc1f5;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index e5812b0..aa04d2f 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 _0x8e33=['api','moment','bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger'];(function(_0x5be092,_0x150a2e){var _0x114300=function(_0x5d7465){while(--_0x5d7465){_0x5be092['push'](_0x5be092['shift']());}};_0x114300(++_0x150a2e);}(_0x8e33,0xcf));var _0x38e3=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x8e33[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x38e3('0x0'));var util=require(_0x38e3('0x1'));var logger=require(_0x38e3('0x2'))(_0x38e3('0x3'));var moment=require(_0x38e3('0x4'));var BPromise=require(_0x38e3('0x5'));var rp=require(_0x38e3('0x6'));var fs=require('fs');var path=require(_0x38e3('0x7'));var rimraf=require(_0x38e3('0x8'));var config=require('../../config/environment');var attributes=require(_0x38e3('0x9'));module[_0x38e3('0xa')]=function(_0x3d02a8,_0x4ff946){return _0x3d02a8[_0x38e3('0xb')](_0x38e3('0xc'),attributes,{'tableName':_0x38e3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe49b=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','Condition','tools_conditions'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xe49b,0xfc));var _0xbe49=function(_0x3d8c76,_0x4bf40e){_0x3d8c76=_0x3d8c76-0x0;var _0x3de364=_0xe49b[_0x3d8c76];return _0x3de364;};'use strict';var _=require(_0xbe49('0x0'));var util=require(_0xbe49('0x1'));var logger=require(_0xbe49('0x2'))(_0xbe49('0x3'));var moment=require(_0xbe49('0x4'));var BPromise=require('bluebird');var rp=require(_0xbe49('0x5'));var fs=require('fs');var path=require(_0xbe49('0x6'));var rimraf=require(_0xbe49('0x7'));var config=require(_0xbe49('0x8'));var attributes=require('./condition.attributes');module['exports']=function(_0x5c3837,_0x50b686){return _0x5c3837[_0xbe49('0x9')](_0xbe49('0xa'),attributes,{'tableName':_0xbe49('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 61cfb1b..3210330 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 _0x403e=['debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent'];(function(_0x44a573,_0x1e6efc){var _0x4babc6=function(_0x5495aa){while(--_0x5495aa){_0x44a573['push'](_0x44a573['shift']());}};_0x4babc6(++_0x1e6efc);}(_0x403e,0xa7));var _0xe403=function(_0x2906dd,_0xd7dc72){_0x2906dd=_0x2906dd-0x0;var _0xe9e2f0=_0x403e[_0x2906dd];return _0xe9e2f0;};'use strict';var _=require(_0xe403('0x0'));var util=require(_0xe403('0x1'));var moment=require(_0xe403('0x2'));var BPromise=require(_0xe403('0x3'));var rs=require(_0xe403('0x4'));var fs=require('fs');var Redis=require(_0xe403('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe403('0x6'));var logger=require(_0xe403('0x7'))(_0xe403('0x8'));var config=require(_0xe403('0x9'));var jayson=require(_0xe403('0xa'));var client=jayson[_0xe403('0xb')][_0xe403('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x261f8f,_0x117bc9,_0x4cbb69){return new BPromise(function(_0x4ee264,_0x14d79d){return client['request'](_0x261f8f,_0x4cbb69)[_0xe403('0xd')](function(_0x4105dc){logger[_0xe403('0xe')](_0xe403('0xf'),_0x117bc9,_0xe403('0x10'));logger[_0xe403('0x11')](_0xe403('0x12'),_0x117bc9,_0xe403('0x10'),JSON[_0xe403('0x13')](_0x4105dc));if(_0x4105dc[_0xe403('0x14')]){if(_0x4105dc[_0xe403('0x14')]['code']===0x1f4){logger[_0xe403('0x14')]('Condition,\x20%s,\x20%s',_0x117bc9,_0x4105dc['error'][_0xe403('0x15')]);return _0x14d79d(_0x4105dc[_0xe403('0x14')][_0xe403('0x15')]);}logger[_0xe403('0x14')](_0xe403('0xf'),_0x117bc9,_0x4105dc['error'][_0xe403('0x15')]);return _0x4ee264(_0x4105dc[_0xe403('0x14')][_0xe403('0x15')]);}else{logger[_0xe403('0xe')](_0xe403('0xf'),_0x117bc9,'request\x20sent');_0x4ee264(_0x4105dc[_0xe403('0x16')]['message']);}})['catch'](function(_0x3debd6){logger['error'](_0xe403('0xf'),_0x117bc9,_0x3debd6);_0x14d79d(_0x3debd6);});});} \ No newline at end of file +var _0x7ed8=['message','result','lodash','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x7ed8,0x142));var _0x87ed=function(_0x183f43,_0x3b0c06){_0x183f43=_0x183f43-0x0;var _0x23fa24=_0x7ed8[_0x183f43];return _0x23fa24;};'use strict';var _=require(_0x87ed('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x87ed('0x1'));var rs=require(_0x87ed('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x87ed('0x3'));var logger=require('../../config/logger')(_0x87ed('0x4'));var config=require(_0x87ed('0x5'));var jayson=require(_0x87ed('0x6'));var client=jayson['client'][_0x87ed('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34cba1,_0x2d20e2,_0x56d91a){return new BPromise(function(_0x20e271,_0x20693c){return client[_0x87ed('0x8')](_0x34cba1,_0x56d91a)[_0x87ed('0x9')](function(_0x357c58){logger[_0x87ed('0xa')]('Condition,\x20%s,\x20%s',_0x2d20e2,_0x87ed('0xb'));logger[_0x87ed('0xc')](_0x87ed('0xd'),_0x2d20e2,_0x87ed('0xb'),JSON[_0x87ed('0xe')](_0x357c58));if(_0x357c58[_0x87ed('0xf')]){if(_0x357c58[_0x87ed('0xf')][_0x87ed('0x10')]===0x1f4){logger[_0x87ed('0xf')](_0x87ed('0x11'),_0x2d20e2,_0x357c58[_0x87ed('0xf')]['message']);return _0x20693c(_0x357c58[_0x87ed('0xf')][_0x87ed('0x12')]);}logger[_0x87ed('0xf')](_0x87ed('0x11'),_0x2d20e2,_0x357c58['error'][_0x87ed('0x12')]);return _0x20e271(_0x357c58['error'][_0x87ed('0x12')]);}else{logger[_0x87ed('0xa')](_0x87ed('0x11'),_0x2d20e2,_0x87ed('0xb'));_0x20e271(_0x357c58[_0x87ed('0x13')][_0x87ed('0x12')]);}})['catch'](function(_0x31c8ea){logger[_0x87ed('0xf')](_0x87ed('0x11'),_0x2d20e2,_0x31c8ea);_0x20693c(_0x31c8ea);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 7c2d304..2077895 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 _0x5ce5=['./condition.controller','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xa8dcea,_0x1315c4){var _0x1f381f=function(_0x381e29){while(--_0x381e29){_0xa8dcea['push'](_0xa8dcea['shift']());}};_0x1f381f(++_0x1315c4);}(_0x5ce5,0xa0));var _0x55ce=function(_0x54f6f7,_0x192530){_0x54f6f7=_0x54f6f7-0x0;var _0x264e49=_0x5ce5[_0x54f6f7];return _0x264e49;};'use strict';var multer=require(_0x55ce('0x0'));var util=require(_0x55ce('0x1'));var path=require(_0x55ce('0x2'));var timeout=require(_0x55ce('0x3'));var express=require(_0x55ce('0x4'));var router=express[_0x55ce('0x5')]();var fs_extra=require(_0x55ce('0x6'));var auth=require(_0x55ce('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x55ce('0x8'));router['put'](_0x55ce('0x9'),auth[_0x55ce('0xa')](),controller[_0x55ce('0xb')]);router['delete'](_0x55ce('0x9'),auth[_0x55ce('0xa')](),controller[_0x55ce('0xc')]);module[_0x55ce('0xd')]=router; \ No newline at end of file +var _0x7a2b=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','destroy'];(function(_0x5d5eed,_0x266c09){var _0x3200d2=function(_0xbb2c9e){while(--_0xbb2c9e){_0x5d5eed['push'](_0x5d5eed['shift']());}};_0x3200d2(++_0x266c09);}(_0x7a2b,0x160));var _0xb7a2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x7a2b[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0xb7a2('0x0'));var util=require(_0xb7a2('0x1'));var path=require(_0xb7a2('0x2'));var timeout=require(_0xb7a2('0x3'));var express=require(_0xb7a2('0x4'));var router=express[_0xb7a2('0x5')]();var fs_extra=require(_0xb7a2('0x6'));var auth=require(_0xb7a2('0x7'));var interaction=require(_0xb7a2('0x8'));var config=require(_0xb7a2('0x9'));var controller=require(_0xb7a2('0xa'));router['put'](_0xb7a2('0xb'),auth[_0xb7a2('0xc')](),controller[_0xb7a2('0xd')]);router[_0xb7a2('0xe')](_0xb7a2('0xb'),auth['isAuthenticated'](),controller[_0xb7a2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 0c3175e..e7c45dd 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 _0x8dd5=['STRING','INTEGER','sequelize','exports'];(function(_0x501f3d,_0x236061){var _0x1431ef=function(_0x4c3580){while(--_0x4c3580){_0x501f3d['push'](_0x501f3d['shift']());}};_0x1431ef(++_0x236061);}(_0x8dd5,0x196));var _0x58dd=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0x8dd5[_0x4d82ea];return _0x257f4a;};'use strict';var Sequelize=require(_0x58dd('0x0'));module[_0x58dd('0x1')]={'name':{'type':Sequelize[_0x58dd('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x58dd('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x58dd('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xfde6=['STRING','name'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xfde6,0x19f));var _0x6fde=function(_0x195155,_0x5bc11f){_0x195155=_0x195155-0x0;var _0x62cf02=_0xfde6[_0x195155];return _0x62cf02;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6fde('0x0')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x6fde('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 9b4a36f..25ddda6 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 _0x4b17=['sort','pick','filters','filter','where','merge','options','ContactItemType','include','findAll','rows','show','length','includeAll','find','catch','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','params','eml-format','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','fields','query'];(function(_0x3239f5,_0x50e77c){var _0x3559c8=function(_0x4f9f83){while(--_0x4f9f83){_0x3239f5['push'](_0x3239f5['shift']());}};_0x3559c8(++_0x50e77c);}(_0x4b17,0x10f));var _0x74b1=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0x4b17[_0x4a8bad];return _0x30cf32;};'use strict';var emlformat=require(_0x74b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b1('0x2'));var moment=require(_0x74b1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74b1('0x4'));var util=require('util');var path=require('path');var sox=require(_0x74b1('0x5'));var csv=require(_0x74b1('0x6'));var ejs=require(_0x74b1('0x7'));var fs=require('fs');var fs_extra=require(_0x74b1('0x8'));var _=require(_0x74b1('0x9'));var squel=require(_0x74b1('0xa'));var crypto=require(_0x74b1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x74b1('0xc'));var toCsv=require(_0x74b1('0x6'));var querystring=require(_0x74b1('0xd'));var Papa=require(_0x74b1('0xe'));var Redis=require(_0x74b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x74b1('0x10'));var as=require(_0x74b1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b1('0x12'))(_0x74b1('0x13'));var utils=require(_0x74b1('0x14'));var config=require(_0x74b1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x74b1('0x16'))['db'];function respondWithStatusCode(_0x5cfe85,_0x5f2865){_0x5f2865=_0x5f2865||0xcc;return function(_0x239d04){if(_0x239d04){return _0x5cfe85[_0x74b1('0x17')](_0x5f2865);}return _0x5cfe85['status'](_0x5f2865)['end']();};}function respondWithResult(_0x500ce2,_0x86390){_0x86390=_0x86390||0xc8;return function(_0x5c12eb){if(_0x5c12eb){return _0x500ce2['status'](_0x86390)[_0x74b1('0x18')](_0x5c12eb);}};}function respondWithFilteredResult(_0x12a2c0,_0x3779c5){return function(_0x420662){if(_0x420662){var _0x16b147=typeof _0x3779c5[_0x74b1('0x19')]==='undefined'&&typeof _0x3779c5[_0x74b1('0x1a')]===_0x74b1('0x1b');var _0x1a0851=_0x420662[_0x74b1('0x1c')];var _0xde2736=_0x16b147?0x0:_0x3779c5[_0x74b1('0x19')];var _0x1ab838=_0x16b147?_0x420662['count']:_0x3779c5[_0x74b1('0x19')]+_0x3779c5[_0x74b1('0x1a')];var _0x524ece;if(_0x1ab838>=_0x1a0851){_0x1ab838=_0x1a0851;_0x524ece=0xc8;}else{_0x524ece=0xce;}_0x12a2c0[_0x74b1('0x1d')](_0x524ece);return _0x12a2c0[_0x74b1('0x1e')](_0x74b1('0x1f'),_0xde2736+'-'+_0x1ab838+'/'+_0x1a0851)[_0x74b1('0x18')](_0x420662);}return null;};}function patchUpdates(_0x13bb44){return function(_0x33fee9){try{jsonpatch[_0x74b1('0x20')](_0x33fee9,_0x13bb44,!![]);}catch(_0xaac5f7){return BPromise['reject'](_0xaac5f7);}return _0x33fee9[_0x74b1('0x21')]();};}function saveUpdates(_0x4f1ec9,_0x5da0f7){return function(_0x481bf2){if(_0x481bf2){return _0x481bf2[_0x74b1('0x22')](_0x4f1ec9)[_0x74b1('0x23')](function(_0x405a22){return _0x405a22;});}return null;};}function removeEntity(_0x44bf7e,_0x563781){return function(_0x4ee88b){if(_0x4ee88b){return _0x4ee88b[_0x74b1('0x24')]()['then'](function(){var _0x3a7ef9=_0x4ee88b[_0x74b1('0x25')]({'plain':!![]});var _0xb5af0=_0x74b1('0x26');return db[_0x74b1('0x27')][_0x74b1('0x24')]({'where':{'type':_0xb5af0,'resourceId':_0x3a7ef9['id']}})[_0x74b1('0x23')](function(){return _0x4ee88b;});})[_0x74b1('0x23')](function(){_0x44bf7e['status'](0xcc)[_0x74b1('0x28')]();});}};}function handleEntityNotFound(_0x42b69d,_0x4099af){return function(_0x5c32d2){if(!_0x5c32d2){_0x42b69d[_0x74b1('0x17')](0x194);}return _0x5c32d2;};}function handleError(_0x351392,_0x94b1f8){_0x94b1f8=_0x94b1f8||0x1f4;return function(_0x1b011a){logger[_0x74b1('0x29')](_0x1b011a[_0x74b1('0x2a')]);if(_0x1b011a[_0x74b1('0x2b')]){delete _0x1b011a[_0x74b1('0x2b')];}_0x351392['status'](_0x94b1f8)[_0x74b1('0x2c')](_0x1b011a);};}exports[_0x74b1('0x2d')]=function(_0x51ce6d,_0x543b5){var _0x45404f={},_0x1ac433={},_0x5f4d1b={'count':0x0,'rows':[]};var _0x113300=_[_0x74b1('0x2e')](db['ContactItemType'][_0x74b1('0x2f')],function(_0x33ec7c){return{'name':_0x33ec7c[_0x74b1('0x30')],'type':_0x33ec7c[_0x74b1('0x31')][_0x74b1('0x32')]};});_0x1ac433[_0x74b1('0x33')]=_[_0x74b1('0x2e')](_0x113300,_0x74b1('0x2b'));_0x1ac433['query']=_[_0x74b1('0x34')](_0x51ce6d['query']);_0x1ac433['filters']=_[_0x74b1('0x35')](_0x1ac433['model'],_0x1ac433['query']);_0x45404f[_0x74b1('0x36')]=_[_0x74b1('0x35')](_0x1ac433[_0x74b1('0x33')],qs[_0x74b1('0x37')](_0x51ce6d[_0x74b1('0x38')][_0x74b1('0x37')]));_0x45404f[_0x74b1('0x36')]=_0x45404f[_0x74b1('0x36')]['length']?_0x45404f['attributes']:_0x1ac433['model'];if(!_0x51ce6d[_0x74b1('0x38')]['hasOwnProperty']('nolimit')){_0x45404f[_0x74b1('0x1a')]=qs[_0x74b1('0x1a')](_0x51ce6d[_0x74b1('0x38')]['limit']);_0x45404f[_0x74b1('0x19')]=qs['offset'](_0x51ce6d[_0x74b1('0x38')][_0x74b1('0x19')]);}_0x45404f['order']=qs['sort'](_0x51ce6d[_0x74b1('0x38')][_0x74b1('0x39')]);_0x45404f['where']=qs['filters'](_[_0x74b1('0x3a')](_0x51ce6d['query'],_0x1ac433[_0x74b1('0x3b')]),_0x113300);if(_0x51ce6d[_0x74b1('0x38')][_0x74b1('0x3c')]){_0x45404f[_0x74b1('0x3d')]=_[_0x74b1('0x3e')](_0x45404f['where'],{'$or':_[_0x74b1('0x2e')](_0x113300,function(_0x5a981b){if(_0x5a981b[_0x74b1('0x31')]!=='VIRTUAL'){var _0x23cac2={};_0x23cac2[_0x5a981b['name']]={'$like':'%'+_0x51ce6d['query'][_0x74b1('0x3c')]+'%'};return _0x23cac2;}})});}_0x45404f=_[_0x74b1('0x3e')]({},_0x45404f,_0x51ce6d[_0x74b1('0x3f')]);var _0x49f7da={'where':_0x45404f[_0x74b1('0x3d')]};return db[_0x74b1('0x40')][_0x74b1('0x1c')](_0x49f7da)['then'](function(_0xfecdc){_0x5f4d1b[_0x74b1('0x1c')]=_0xfecdc;if(_0x51ce6d['query']['includeAll']){_0x45404f[_0x74b1('0x41')]=[{'all':!![]}];}return db[_0x74b1('0x40')][_0x74b1('0x42')](_0x45404f);})[_0x74b1('0x23')](function(_0x1d9f5b){_0x5f4d1b[_0x74b1('0x43')]=_0x1d9f5b;return _0x5f4d1b;})[_0x74b1('0x23')](respondWithFilteredResult(_0x543b5,_0x45404f))['catch'](handleError(_0x543b5,null));};exports[_0x74b1('0x44')]=function(_0x118623,_0x456c6e){var _0x452fa0={'raw':!![],'where':{'id':_0x118623['params']['id']}},_0x17a44f={};_0x17a44f[_0x74b1('0x33')]=_[_0x74b1('0x34')](db['ContactItemType']['rawAttributes']);_0x17a44f[_0x74b1('0x38')]=_[_0x74b1('0x34')](_0x118623['query']);_0x17a44f[_0x74b1('0x3b')]=_[_0x74b1('0x35')](_0x17a44f[_0x74b1('0x33')],_0x17a44f[_0x74b1('0x38')]);_0x452fa0[_0x74b1('0x36')]=_[_0x74b1('0x35')](_0x17a44f[_0x74b1('0x33')],qs['fields'](_0x118623['query']['fields']));_0x452fa0[_0x74b1('0x36')]=_0x452fa0[_0x74b1('0x36')][_0x74b1('0x45')]?_0x452fa0[_0x74b1('0x36')]:_0x17a44f[_0x74b1('0x33')];if(_0x118623['query'][_0x74b1('0x46')]){_0x452fa0[_0x74b1('0x41')]=[{'all':!![]}];}_0x452fa0=_[_0x74b1('0x3e')]({},_0x452fa0,_0x118623[_0x74b1('0x3f')]);return db[_0x74b1('0x40')][_0x74b1('0x47')](_0x452fa0)[_0x74b1('0x23')](handleEntityNotFound(_0x456c6e,null))[_0x74b1('0x23')](respondWithResult(_0x456c6e,null))[_0x74b1('0x48')](handleError(_0x456c6e,null));};exports[_0x74b1('0x49')]=function(_0x186516,_0x3038f9){return db['ContactItemType'][_0x74b1('0x49')](_0x186516[_0x74b1('0x4a')],{})['then'](function(_0xf3735e){var _0x4923d2=_0x186516[_0x74b1('0x4b')][_0x74b1('0x25')]({'plain':!![]});if(!_0x4923d2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4923d2[_0x74b1('0x4c')]===_0x74b1('0x4b')){var _0x326b98=_0xf3735e['get']({'plain':!![]});var _0x497006=_0x74b1('0x26');return db[_0x74b1('0x4d')][_0x74b1('0x47')]({'where':{'name':_0x497006,'userProfileId':_0x4923d2[_0x74b1('0x4e')]},'raw':!![]})['then'](function(_0x1e7507){if(_0x1e7507&&_0x1e7507['autoAssociation']===0x0){return db[_0x74b1('0x27')][_0x74b1('0x49')]({'name':_0x326b98['name'],'resourceId':_0x326b98['id'],'type':_0x1e7507[_0x74b1('0x2b')],'sectionId':_0x1e7507['id']},{})[_0x74b1('0x23')](function(){return _0xf3735e;});}else{return _0xf3735e;}})[_0x74b1('0x48')](function(_0x54a221){logger[_0x74b1('0x29')](_0x74b1('0x4f'),_0x54a221);throw _0x54a221;});}return _0xf3735e;})['then'](respondWithResult(_0x3038f9,0xc9))[_0x74b1('0x48')](handleError(_0x3038f9,null));};exports['update']=function(_0x4ba250,_0x18cd64){if(_0x4ba250[_0x74b1('0x4a')]['id']){delete _0x4ba250[_0x74b1('0x4a')]['id'];}return db[_0x74b1('0x40')][_0x74b1('0x47')]({'where':{'id':_0x4ba250['params']['id']}})[_0x74b1('0x23')](handleEntityNotFound(_0x18cd64,null))[_0x74b1('0x23')](saveUpdates(_0x4ba250['body'],null))[_0x74b1('0x23')](respondWithResult(_0x18cd64,null))[_0x74b1('0x48')](handleError(_0x18cd64,null));};exports[_0x74b1('0x24')]=function(_0x5634d1,_0x2fac5d){return db[_0x74b1('0x40')][_0x74b1('0x47')]({'where':{'id':_0x5634d1['params']['id']}})[_0x74b1('0x23')](handleEntityNotFound(_0x2fac5d,null))[_0x74b1('0x23')](db[_0x74b1('0x50')][_0x74b1('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x5634d1[_0x74b1('0x51')]['id']}}))[_0x74b1('0x23')](removeEntity(_0x2fac5d,null))['catch'](handleError(_0x2fac5d,null));}; \ No newline at end of file +var _0xed3c=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ContactItemTypes','UserProfileSection','userProfileId','autoAssociation','body','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed3c,0x1a6));var _0xced3=function(_0x2b9316,_0x26a84f){_0x2b9316=_0x2b9316-0x0;var _0x27fc1d=_0xed3c[_0x2b9316];return _0x27fc1d;};'use strict';var emlformat=require(_0xced3('0x0'));var rimraf=require(_0xced3('0x1'));var zipdir=require(_0xced3('0x2'));var jsonpatch=require(_0xced3('0x3'));var rp=require('request-promise');var moment=require(_0xced3('0x4'));var BPromise=require(_0xced3('0x5'));var Mustache=require(_0xced3('0x6'));var util=require('util');var path=require('path');var sox=require(_0xced3('0x7'));var csv=require(_0xced3('0x8'));var ejs=require(_0xced3('0x9'));var fs=require('fs');var fs_extra=require(_0xced3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xced3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xced3('0xc'));var Redis=require(_0xced3('0xd'));var authService=require(_0xced3('0xe'));var qs=require(_0xced3('0xf'));var as=require(_0xced3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced3('0x11'))(_0xced3('0x12'));var utils=require(_0xced3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xced3('0x14'));var db=require(_0xced3('0x15'))['db'];function respondWithStatusCode(_0x42d879,_0x3b2ac4){_0x3b2ac4=_0x3b2ac4||0xcc;return function(_0x457caf){if(_0x457caf){return _0x42d879[_0xced3('0x16')](_0x3b2ac4);}return _0x42d879[_0xced3('0x17')](_0x3b2ac4)['end']();};}function respondWithResult(_0x65bb58,_0x5e186e){_0x5e186e=_0x5e186e||0xc8;return function(_0xf2db6f){if(_0xf2db6f){return _0x65bb58[_0xced3('0x17')](_0x5e186e)[_0xced3('0x18')](_0xf2db6f);}};}function respondWithFilteredResult(_0x39e4aa,_0x4dd4c3){return function(_0x146a21){if(_0x146a21){var _0x322c2d=typeof _0x4dd4c3['offset']===_0xced3('0x19')&&typeof _0x4dd4c3[_0xced3('0x1a')]===_0xced3('0x19');var _0x17f611=_0x146a21['count'];var _0x4569af=_0x322c2d?0x0:_0x4dd4c3['offset'];var _0x353580=_0x322c2d?_0x146a21[_0xced3('0x1b')]:_0x4dd4c3[_0xced3('0x1c')]+_0x4dd4c3[_0xced3('0x1a')];var _0x44143f;if(_0x353580>=_0x17f611){_0x353580=_0x17f611;_0x44143f=0xc8;}else{_0x44143f=0xce;}_0x39e4aa[_0xced3('0x17')](_0x44143f);return _0x39e4aa[_0xced3('0x1d')](_0xced3('0x1e'),_0x4569af+'-'+_0x353580+'/'+_0x17f611)[_0xced3('0x18')](_0x146a21);}return null;};}function patchUpdates(_0x17c011){return function(_0x2008f2){try{jsonpatch['apply'](_0x2008f2,_0x17c011,!![]);}catch(_0x5b8b1f){return BPromise['reject'](_0x5b8b1f);}return _0x2008f2[_0xced3('0x1f')]();};}function saveUpdates(_0x342b9e,_0x21e074){return function(_0x4bf915){if(_0x4bf915){return _0x4bf915[_0xced3('0x20')](_0x342b9e)[_0xced3('0x21')](function(_0x526854){return _0x526854;});}return null;};}function removeEntity(_0x559fa2,_0x3adf14){return function(_0x101708){if(_0x101708){return _0x101708[_0xced3('0x22')]()[_0xced3('0x21')](function(){var _0x50f7c1=_0x101708[_0xced3('0x23')]({'plain':!![]});var _0x23f92b='ContactItemTypes';return db[_0xced3('0x24')]['destroy']({'where':{'type':_0x23f92b,'resourceId':_0x50f7c1['id']}})[_0xced3('0x21')](function(){return _0x101708;});})[_0xced3('0x21')](function(){_0x559fa2[_0xced3('0x17')](0xcc)[_0xced3('0x25')]();});}};}function handleEntityNotFound(_0x2ec2c4,_0x502cf1){return function(_0x5454c0){if(!_0x5454c0){_0x2ec2c4[_0xced3('0x16')](0x194);}return _0x5454c0;};}function handleError(_0x5bb425,_0x2ab8a8){_0x2ab8a8=_0x2ab8a8||0x1f4;return function(_0x1e6923){logger['error'](_0x1e6923[_0xced3('0x26')]);if(_0x1e6923[_0xced3('0x27')]){delete _0x1e6923[_0xced3('0x27')];}_0x5bb425[_0xced3('0x17')](_0x2ab8a8)[_0xced3('0x28')](_0x1e6923);};}exports[_0xced3('0x29')]=function(_0x895a32,_0x41d003){var _0x116cc7={},_0x559b8e={},_0xa78899={'count':0x0,'rows':[]};var _0x1b8baa=_[_0xced3('0x2a')](db[_0xced3('0x2b')][_0xced3('0x2c')],function(_0x21e4a2){return{'name':_0x21e4a2[_0xced3('0x2d')],'type':_0x21e4a2[_0xced3('0x2e')][_0xced3('0x2f')]};});_0x559b8e[_0xced3('0x30')]=_[_0xced3('0x2a')](_0x1b8baa,_0xced3('0x27'));_0x559b8e[_0xced3('0x31')]=_[_0xced3('0x32')](_0x895a32[_0xced3('0x31')]);_0x559b8e[_0xced3('0x33')]=_[_0xced3('0x34')](_0x559b8e[_0xced3('0x30')],_0x559b8e[_0xced3('0x31')]);_0x116cc7[_0xced3('0x35')]=_[_0xced3('0x34')](_0x559b8e['model'],qs[_0xced3('0x36')](_0x895a32['query'][_0xced3('0x36')]));_0x116cc7[_0xced3('0x35')]=_0x116cc7[_0xced3('0x35')][_0xced3('0x37')]?_0x116cc7[_0xced3('0x35')]:_0x559b8e[_0xced3('0x30')];if(!_0x895a32[_0xced3('0x31')][_0xced3('0x38')](_0xced3('0x39'))){_0x116cc7[_0xced3('0x1a')]=qs['limit'](_0x895a32[_0xced3('0x31')][_0xced3('0x1a')]);_0x116cc7['offset']=qs[_0xced3('0x1c')](_0x895a32[_0xced3('0x31')][_0xced3('0x1c')]);}_0x116cc7['order']=qs['sort'](_0x895a32[_0xced3('0x31')]['sort']);_0x116cc7[_0xced3('0x3a')]=qs[_0xced3('0x33')](_['pick'](_0x895a32[_0xced3('0x31')],_0x559b8e[_0xced3('0x33')]),_0x1b8baa);if(_0x895a32[_0xced3('0x31')]['filter']){_0x116cc7[_0xced3('0x3a')]=_['merge'](_0x116cc7['where'],{'$or':_[_0xced3('0x2a')](_0x1b8baa,function(_0x31e281){if(_0x31e281[_0xced3('0x2e')]!=='VIRTUAL'){var _0xb2cf20={};_0xb2cf20[_0x31e281[_0xced3('0x27')]]={'$like':'%'+_0x895a32[_0xced3('0x31')][_0xced3('0x3b')]+'%'};return _0xb2cf20;}})});}_0x116cc7=_[_0xced3('0x3c')]({},_0x116cc7,_0x895a32[_0xced3('0x3d')]);var _0x30e890={'where':_0x116cc7[_0xced3('0x3a')]};return db[_0xced3('0x2b')][_0xced3('0x1b')](_0x30e890)[_0xced3('0x21')](function(_0x38855f){_0xa78899[_0xced3('0x1b')]=_0x38855f;if(_0x895a32[_0xced3('0x31')][_0xced3('0x3e')]){_0x116cc7['include']=[{'all':!![]}];}return db[_0xced3('0x2b')][_0xced3('0x3f')](_0x116cc7);})[_0xced3('0x21')](function(_0x1a6c1f){_0xa78899[_0xced3('0x40')]=_0x1a6c1f;return _0xa78899;})[_0xced3('0x21')](respondWithFilteredResult(_0x41d003,_0x116cc7))[_0xced3('0x41')](handleError(_0x41d003,null));};exports[_0xced3('0x42')]=function(_0x1ab7e0,_0x4cea5c){var _0x6c0238={'raw':!![],'where':{'id':_0x1ab7e0[_0xced3('0x43')]['id']}},_0x47ab23={};_0x47ab23[_0xced3('0x30')]=_[_0xced3('0x32')](db['ContactItemType'][_0xced3('0x2c')]);_0x47ab23[_0xced3('0x31')]=_[_0xced3('0x32')](_0x1ab7e0[_0xced3('0x31')]);_0x47ab23['filters']=_[_0xced3('0x34')](_0x47ab23[_0xced3('0x30')],_0x47ab23[_0xced3('0x31')]);_0x6c0238[_0xced3('0x35')]=_[_0xced3('0x34')](_0x47ab23['model'],qs[_0xced3('0x36')](_0x1ab7e0[_0xced3('0x31')][_0xced3('0x36')]));_0x6c0238[_0xced3('0x35')]=_0x6c0238[_0xced3('0x35')][_0xced3('0x37')]?_0x6c0238[_0xced3('0x35')]:_0x47ab23['model'];if(_0x1ab7e0[_0xced3('0x31')][_0xced3('0x3e')]){_0x6c0238['include']=[{'all':!![]}];}_0x6c0238=_['merge']({},_0x6c0238,_0x1ab7e0[_0xced3('0x3d')]);return db['ContactItemType'][_0xced3('0x44')](_0x6c0238)[_0xced3('0x21')](handleEntityNotFound(_0x4cea5c,null))[_0xced3('0x21')](respondWithResult(_0x4cea5c,null))[_0xced3('0x41')](handleError(_0x4cea5c,null));};exports[_0xced3('0x45')]=function(_0x1b3396,_0x3700ed){return db[_0xced3('0x2b')][_0xced3('0x45')](_0x1b3396['body'],{})[_0xced3('0x21')](function(_0x8df206){var _0x2aa876=_0x1b3396[_0xced3('0x46')][_0xced3('0x23')]({'plain':!![]});if(!_0x2aa876)throw new Error(_0xced3('0x47'));if(_0x2aa876['role']===_0xced3('0x46')){var _0x629ecf=_0x8df206[_0xced3('0x23')]({'plain':!![]});var _0x409da0=_0xced3('0x48');return db[_0xced3('0x49')][_0xced3('0x44')]({'where':{'name':_0x409da0,'userProfileId':_0x2aa876[_0xced3('0x4a')]},'raw':!![]})[_0xced3('0x21')](function(_0x44d779){if(_0x44d779&&_0x44d779[_0xced3('0x4b')]===0x0){return db[_0xced3('0x24')]['create']({'name':_0x629ecf[_0xced3('0x27')],'resourceId':_0x629ecf['id'],'type':_0x44d779['name'],'sectionId':_0x44d779['id']},{})[_0xced3('0x21')](function(){return _0x8df206;});}else{return _0x8df206;}})[_0xced3('0x41')](function(_0xc93e05){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc93e05);throw _0xc93e05;});}return _0x8df206;})[_0xced3('0x21')](respondWithResult(_0x3700ed,0xc9))[_0xced3('0x41')](handleError(_0x3700ed,null));};exports['update']=function(_0x3f41cc,_0x4ae67d){if(_0x3f41cc[_0xced3('0x4c')]['id']){delete _0x3f41cc[_0xced3('0x4c')]['id'];}return db['ContactItemType'][_0xced3('0x44')]({'where':{'id':_0x3f41cc[_0xced3('0x43')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x4ae67d,null))['then'](saveUpdates(_0x3f41cc[_0xced3('0x4c')],null))['then'](respondWithResult(_0x4ae67d,null))[_0xced3('0x41')](handleError(_0x4ae67d,null));};exports[_0xced3('0x22')]=function(_0x4694b8,_0x168c36){return db[_0xced3('0x2b')][_0xced3('0x44')]({'where':{'id':_0x4694b8[_0xced3('0x43')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x168c36,null))[_0xced3('0x21')](db[_0xced3('0x4d')][_0xced3('0x20')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4694b8['params']['id']}}))[_0xced3('0x21')](removeEntity(_0x168c36,null))[_0xced3('0x41')](handleError(_0x168c36,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 9e917ae..33736c7 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 _0xa88e=['path','rimraf','./contactItemType.attributes','exports','tools_contact_item_types','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0xa88e,0x1bd));var _0xea88=function(_0x431dca,_0x4c1359){_0x431dca=_0x431dca-0x0;var _0x40f13d=_0xa88e[_0x431dca];return _0x40f13d;};'use strict';var _=require(_0xea88('0x0'));var util=require('util');var logger=require(_0xea88('0x1'))(_0xea88('0x2'));var moment=require(_0xea88('0x3'));var BPromise=require(_0xea88('0x4'));var rp=require(_0xea88('0x5'));var fs=require('fs');var path=require(_0xea88('0x6'));var rimraf=require(_0xea88('0x7'));var config=require('../../config/environment');var attributes=require(_0xea88('0x8'));module[_0xea88('0x9')]=function(_0xf4416c,_0x35de82){return _0xf4416c['define']('ContactItemType',attributes,{'tableName':_0xea88('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1f5=['path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','lodash','util','api','moment','request-promise'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0xd1f5,0xdf));var _0x5d1f=function(_0x5a537e,_0xbe7cab){_0x5a537e=_0x5a537e-0x0;var _0x2e2ba6=_0xd1f5[_0x5a537e];return _0x2e2ba6;};'use strict';var _=require(_0x5d1f('0x0'));var util=require(_0x5d1f('0x1'));var logger=require('../../config/logger')(_0x5d1f('0x2'));var moment=require(_0x5d1f('0x3'));var BPromise=require('bluebird');var rp=require(_0x5d1f('0x4'));var fs=require('fs');var path=require(_0x5d1f('0x5'));var rimraf=require(_0x5d1f('0x6'));var config=require(_0x5d1f('0x7'));var attributes=require(_0x5d1f('0x8'));module[_0x5d1f('0x9')]=function(_0x2a90ef,_0x25b637){return _0x2a90ef[_0x5d1f('0xa')](_0x5d1f('0xb'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index fdb34a6..0d36fb2 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 _0xab06=['message','result','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4f2b44,_0xb210ed){var _0x3d64fe=function(_0x382d61){while(--_0x382d61){_0x4f2b44['push'](_0x4f2b44['shift']());}};_0x3d64fe(++_0xb210ed);}(_0xab06,0x1e7));var _0x6ab0=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xab06[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require(_0x6ab0('0x0'));var moment=require('moment');var BPromise=require(_0x6ab0('0x1'));var rs=require(_0x6ab0('0x2'));var fs=require('fs');var Redis=require(_0x6ab0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6ab0('0x4'))(_0x6ab0('0x5'));var config=require(_0x6ab0('0x6'));var jayson=require(_0x6ab0('0x7'));var client=jayson[_0x6ab0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xddfd86,_0x2cd8a2,_0x966c46){return new BPromise(function(_0x1f9514,_0x1fc9d8){return client[_0x6ab0('0x9')](_0xddfd86,_0x966c46)[_0x6ab0('0xa')](function(_0x4ec2db){logger[_0x6ab0('0xb')](_0x6ab0('0xc'),_0x2cd8a2,_0x6ab0('0xd'));logger[_0x6ab0('0xe')](_0x6ab0('0xf'),_0x2cd8a2,'request\x20sent',JSON[_0x6ab0('0x10')](_0x4ec2db));if(_0x4ec2db['error']){if(_0x4ec2db[_0x6ab0('0x11')][_0x6ab0('0x12')]===0x1f4){logger[_0x6ab0('0x11')](_0x6ab0('0xc'),_0x2cd8a2,_0x4ec2db['error'][_0x6ab0('0x13')]);return _0x1fc9d8(_0x4ec2db[_0x6ab0('0x11')][_0x6ab0('0x13')]);}logger[_0x6ab0('0x11')](_0x6ab0('0xc'),_0x2cd8a2,_0x4ec2db['error'][_0x6ab0('0x13')]);return _0x1f9514(_0x4ec2db[_0x6ab0('0x11')][_0x6ab0('0x13')]);}else{logger[_0x6ab0('0xb')](_0x6ab0('0xc'),_0x2cd8a2,'request\x20sent');_0x1f9514(_0x4ec2db[_0x6ab0('0x14')][_0x6ab0('0x13')]);}})[_0x6ab0('0x15')](function(_0x43edb5){logger[_0x6ab0('0x11')](_0x6ab0('0xc'),_0x2cd8a2,_0x43edb5);_0x1fc9d8(_0x43edb5);});});} \ No newline at end of file +var _0x620f=['../../mysqldb','rpc','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x2be3a1,_0x133950){var _0x149877=function(_0x4c92cc){while(--_0x4c92cc){_0x2be3a1['push'](_0x2be3a1['shift']());}};_0x149877(++_0x133950);}(_0x620f,0x160));var _0xf620=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x620f[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xf620('0x0'));var util=require(_0xf620('0x1'));var moment=require(_0xf620('0x2'));var BPromise=require('bluebird');var rs=require(_0xf620('0x3'));var fs=require('fs');var Redis=require(_0xf620('0x4'));var db=require(_0xf620('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf620('0x6'));var config=require('../../config/environment');var jayson=require(_0xf620('0x7'));var client=jayson[_0xf620('0x8')][_0xf620('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x288521,_0x1c308b,_0x17c0c1){return new BPromise(function(_0x98379c,_0x54231d){return client[_0xf620('0xa')](_0x288521,_0x17c0c1)[_0xf620('0xb')](function(_0x5924d7){logger[_0xf620('0xc')](_0xf620('0xd'),_0x1c308b,_0xf620('0xe'));logger['debug'](_0xf620('0xf'),_0x1c308b,_0xf620('0xe'),JSON[_0xf620('0x10')](_0x5924d7));if(_0x5924d7[_0xf620('0x11')]){if(_0x5924d7[_0xf620('0x11')][_0xf620('0x12')]===0x1f4){logger[_0xf620('0x11')](_0xf620('0xd'),_0x1c308b,_0x5924d7[_0xf620('0x11')][_0xf620('0x13')]);return _0x54231d(_0x5924d7[_0xf620('0x11')][_0xf620('0x13')]);}logger[_0xf620('0x11')](_0xf620('0xd'),_0x1c308b,_0x5924d7[_0xf620('0x11')]['message']);return _0x98379c(_0x5924d7[_0xf620('0x11')][_0xf620('0x13')]);}else{logger[_0xf620('0xc')](_0xf620('0xd'),_0x1c308b,'request\x20sent');_0x98379c(_0x5924d7[_0xf620('0x14')]['message']);}})['catch'](function(_0x18f05f){logger[_0xf620('0x11')](_0xf620('0xd'),_0x1c308b,_0x18f05f);_0x54231d(_0x18f05f);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 58d303a..1d9cadb 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 _0x05f0=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1c74d2,_0x5b1c47){var _0x1187b7=function(_0x5043c7){while(--_0x5043c7){_0x1c74d2['push'](_0x1c74d2['shift']());}};_0x1187b7(++_0x5b1c47);}(_0x05f0,0x165));var _0x005f=function(_0x38b2d9,_0x19fd42){_0x38b2d9=_0x38b2d9-0x0;var _0x23a3e1=_0x05f0[_0x38b2d9];return _0x23a3e1;};'use strict';var multer=require(_0x005f('0x0'));var util=require(_0x005f('0x1'));var path=require(_0x005f('0x2'));var timeout=require(_0x005f('0x3'));var express=require(_0x005f('0x4'));var router=express[_0x005f('0x5')]();var fs_extra=require(_0x005f('0x6'));var auth=require(_0x005f('0x7'));var interaction=require(_0x005f('0x8'));var config=require('../../config/environment');var controller=require(_0x005f('0x9'));router[_0x005f('0xa')]('/',auth[_0x005f('0xb')](),controller['index']);router[_0x005f('0xa')](_0x005f('0xc'),auth[_0x005f('0xb')](),controller[_0x005f('0xd')]);router[_0x005f('0xe')]('/',auth[_0x005f('0xb')](),controller[_0x005f('0xf')]);router[_0x005f('0x10')](_0x005f('0xc'),auth['isAuthenticated'](),controller[_0x005f('0x11')]);router[_0x005f('0x12')](_0x005f('0xc'),auth[_0x005f('0xb')](),controller[_0x005f('0x13')]);module[_0x005f('0x14')]=router; \ No newline at end of file +var _0x7fb2=['express','Router','../../components/auth/service','./contactItemType.controller','get','isAuthenticated','/:id','post','create','destroy','exports','connect-timeout'];(function(_0x4bd9bc,_0x269a25){var _0x307d01=function(_0x26db86){while(--_0x26db86){_0x4bd9bc['push'](_0x4bd9bc['shift']());}};_0x307d01(++_0x269a25);}(_0x7fb2,0x1bb));var _0x27fb=function(_0x55c8ec,_0xccd842){_0x55c8ec=_0x55c8ec-0x0;var _0x5beecf=_0x7fb2[_0x55c8ec];return _0x5beecf;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x27fb('0x0'));var express=require(_0x27fb('0x1'));var router=express[_0x27fb('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x27fb('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x27fb('0x4'));router[_0x27fb('0x5')]('/',auth[_0x27fb('0x6')](),controller['index']);router[_0x27fb('0x5')](_0x27fb('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x27fb('0x8')]('/',auth['isAuthenticated'](),controller[_0x27fb('0x9')]);router['put'](_0x27fb('0x7'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x27fb('0x6')](),controller[_0x27fb('0xa')]);module[_0x27fb('0xb')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index b4ed4f1..c4b4f71 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 _0x757a=['exports','STRING'];(function(_0x141c9c,_0x498319){var _0x3ba4b4=function(_0x185faa){while(--_0x185faa){_0x141c9c['push'](_0x141c9c['shift']());}};_0x3ba4b4(++_0x498319);}(_0x757a,0xde));var _0xa757=function(_0x2e8ed0,_0x88ca87){_0x2e8ed0=_0x2e8ed0-0x0;var _0x24de36=_0x757a[_0x2e8ed0];return _0x24de36;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x3bc939,_0xfe5f31){var _0xfe902e=function(_0x124614){while(--_0x124614){_0x3bc939['push'](_0x3bc939['shift']());}};_0xfe902e(++_0xfe5f31);}(_0x2032,0xd9));var _0x2203=function(_0x3f8d52,_0x5752cd){_0x3f8d52=_0x3f8d52-0x0;var _0x530dea=_0x2032[_0x3f8d52];return _0x530dea;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'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 6f9b582..e0dea0d 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 _0x4724=['../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','then','get','CustomDashboards','UserProfileResource','stack','name','send','index','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','map','VIRTUAL','merge','options','Dashboard','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','body','updatedAt','iframe','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','nolimit','eml-format','rimraf','request-promise','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api'];(function(_0xcc86ba,_0x1adb0b){var _0x15f863=function(_0x353598){while(--_0x353598){_0xcc86ba['push'](_0xcc86ba['shift']());}};_0x15f863(++_0x1adb0b);}(_0x4724,0x15e));var _0x4472=function(_0x895ad0,_0xf67203){_0x895ad0=_0x895ad0-0x0;var _0x3d32f9=_0x4724[_0x895ad0];return _0x3d32f9;};'use strict';var emlformat=require(_0x4472('0x0'));var rimraf=require(_0x4472('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4472('0x2'));var moment=require('moment');var BPromise=require(_0x4472('0x3'));var Mustache=require(_0x4472('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4472('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4472('0x6'));var squel=require(_0x4472('0x7'));var crypto=require(_0x4472('0x8'));var jsforce=require(_0x4472('0x9'));var deskjs=require(_0x4472('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4472('0xb'));var Papa=require(_0x4472('0xc'));var Redis=require(_0x4472('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4472('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4472('0xf'));var utils=require('../../config/utils');var config=require(_0x4472('0x10'));var licenseUtil=require(_0x4472('0x11'));var db=require('../../mysqldb')['db'];config[_0x4472('0x12')]=_[_0x4472('0x13')](config[_0x4472('0x12')],{'host':_0x4472('0x14'),'port':0x18eb});var socket=require(_0x4472('0x15'))(new Redis(config[_0x4472('0x12')]));require(_0x4472('0x16'))[_0x4472('0x17')](socket);function respondWithStatusCode(_0x20a93d,_0x59828c){_0x59828c=_0x59828c||0xcc;return function(_0x3be893){if(_0x3be893){return _0x20a93d[_0x4472('0x18')](_0x59828c);}return _0x20a93d[_0x4472('0x19')](_0x59828c)[_0x4472('0x1a')]();};}function respondWithResult(_0x4db7a3,_0x36d00b){_0x36d00b=_0x36d00b||0xc8;return function(_0x1bc728){if(_0x1bc728){return _0x4db7a3[_0x4472('0x19')](_0x36d00b)[_0x4472('0x1b')](_0x1bc728);}};}function respondWithFilteredResult(_0x282306,_0x33772c){return function(_0x1b5d59){if(_0x1b5d59){var _0x353de0=typeof _0x33772c[_0x4472('0x1c')]===_0x4472('0x1d')&&typeof _0x33772c['limit']===_0x4472('0x1d');var _0x48d21e=_0x1b5d59[_0x4472('0x1e')];var _0x8d28bd=_0x353de0?0x0:_0x33772c[_0x4472('0x1c')];var _0x2c43f9=_0x353de0?_0x1b5d59[_0x4472('0x1e')]:_0x33772c[_0x4472('0x1c')]+_0x33772c[_0x4472('0x1f')];var _0x169689;if(_0x2c43f9>=_0x48d21e){_0x2c43f9=_0x48d21e;_0x169689=0xc8;}else{_0x169689=0xce;}_0x282306[_0x4472('0x19')](_0x169689);return _0x282306[_0x4472('0x20')](_0x4472('0x21'),_0x8d28bd+'-'+_0x2c43f9+'/'+_0x48d21e)[_0x4472('0x1b')](_0x1b5d59);}return null;};}function patchUpdates(_0x5f3b2f){return function(_0x1924c1){try{jsonpatch[_0x4472('0x22')](_0x1924c1,_0x5f3b2f,!![]);}catch(_0x323764){return BPromise['reject'](_0x323764);}return _0x1924c1['save']();};}function saveUpdates(_0x55e4fc,_0x4e4b62){return function(_0x5b5fd7){if(_0x5b5fd7){return _0x5b5fd7[_0x4472('0x23')](_0x55e4fc)['then'](function(_0x30a824){return _0x30a824;});}return null;};}function removeEntity(_0x30667c,_0x6d9828){return function(_0x33e1fa){if(_0x33e1fa){return _0x33e1fa[_0x4472('0x24')]()[_0x4472('0x25')](function(){var _0x8eb4bf=_0x33e1fa[_0x4472('0x26')]({'plain':!![]});var _0x88e805=_0x4472('0x27');return db[_0x4472('0x28')][_0x4472('0x24')]({'where':{'type':_0x88e805,'resourceId':_0x8eb4bf['id']}})['then'](function(){return _0x33e1fa;});})['then'](function(){_0x30667c['status'](0xcc)[_0x4472('0x1a')]();});}};}function handleEntityNotFound(_0x135f23,_0x1d13d6){return function(_0x538ea1){if(!_0x538ea1){_0x135f23[_0x4472('0x18')](0x194);}return _0x538ea1;};}function handleError(_0x1db8e9,_0x3a8a14){_0x3a8a14=_0x3a8a14||0x1f4;return function(_0x32a945){logger['error'](_0x32a945[_0x4472('0x29')]);if(_0x32a945[_0x4472('0x2a')]){delete _0x32a945[_0x4472('0x2a')];}_0x1db8e9[_0x4472('0x19')](_0x3a8a14)[_0x4472('0x2b')](_0x32a945);};}exports[_0x4472('0x2c')]=function(_0x2f9183,_0x57d352){var _0x40a8fb={},_0x1b4c7f={},_0x55d710={'count':0x0,'rows':[]};var _0x4e7991=_['map'](db['Dashboard'][_0x4472('0x2d')],function(_0x9e0cbd){return{'name':_0x9e0cbd['fieldName'],'type':_0x9e0cbd[_0x4472('0x2e')]['key']};});_0x1b4c7f[_0x4472('0x2f')]=_['map'](_0x4e7991,_0x4472('0x2a'));_0x1b4c7f[_0x4472('0x30')]=_[_0x4472('0x31')](_0x2f9183[_0x4472('0x30')]);_0x1b4c7f[_0x4472('0x32')]=_[_0x4472('0x33')](_0x1b4c7f[_0x4472('0x2f')],_0x1b4c7f[_0x4472('0x30')]);_0x40a8fb[_0x4472('0x34')]=_[_0x4472('0x33')](_0x1b4c7f['model'],qs['fields'](_0x2f9183['query'][_0x4472('0x35')]));_0x40a8fb[_0x4472('0x34')]=_0x40a8fb['attributes']['length']?_0x40a8fb[_0x4472('0x34')]:_0x1b4c7f[_0x4472('0x2f')];if(!_0x2f9183[_0x4472('0x30')][_0x4472('0x36')]('nolimit')){_0x40a8fb['limit']=qs[_0x4472('0x1f')](_0x2f9183['query'][_0x4472('0x1f')]);_0x40a8fb['offset']=qs[_0x4472('0x1c')](_0x2f9183[_0x4472('0x30')][_0x4472('0x1c')]);}_0x40a8fb[_0x4472('0x37')]=qs[_0x4472('0x38')](_0x2f9183['query'][_0x4472('0x38')]);_0x40a8fb[_0x4472('0x39')]=qs[_0x4472('0x32')](_[_0x4472('0x3a')](_0x2f9183[_0x4472('0x30')],_0x1b4c7f[_0x4472('0x32')]),_0x4e7991);if(_0x2f9183[_0x4472('0x30')][_0x4472('0x3b')]){_0x40a8fb['where']=_['merge'](_0x40a8fb[_0x4472('0x39')],{'$or':_[_0x4472('0x3c')](_0x4e7991,function(_0x31602f){if(_0x31602f[_0x4472('0x2e')]!==_0x4472('0x3d')){var _0x4dccec={};_0x4dccec[_0x31602f[_0x4472('0x2a')]]={'$like':'%'+_0x2f9183['query']['filter']+'%'};return _0x4dccec;}})});}_0x40a8fb=_[_0x4472('0x3e')]({},_0x40a8fb,_0x2f9183[_0x4472('0x3f')]);var _0x3f6e28={'where':_0x40a8fb[_0x4472('0x39')]};return db[_0x4472('0x40')]['count'](_0x3f6e28)[_0x4472('0x25')](function(_0x158800){_0x55d710[_0x4472('0x1e')]=_0x158800;if(_0x2f9183[_0x4472('0x30')][_0x4472('0x41')]){_0x40a8fb[_0x4472('0x42')]=[{'all':!![]}];}return db['Dashboard'][_0x4472('0x43')](_0x40a8fb);})[_0x4472('0x25')](function(_0x44d94d){_0x55d710[_0x4472('0x44')]=_0x44d94d;return _0x55d710;})[_0x4472('0x25')](respondWithFilteredResult(_0x57d352,_0x40a8fb))[_0x4472('0x45')](handleError(_0x57d352,null));};exports[_0x4472('0x46')]=function(_0x1619aa,_0x140dcc){var _0x524f74={'raw':![],'where':{'id':_0x1619aa[_0x4472('0x47')]['id']}},_0x34a1d1={};_0x34a1d1['model']=_['keys'](db[_0x4472('0x40')][_0x4472('0x2d')]);_0x34a1d1['query']=_['keys'](_0x1619aa[_0x4472('0x30')]);_0x34a1d1[_0x4472('0x32')]=_[_0x4472('0x33')](_0x34a1d1['model'],_0x34a1d1['query']);_0x524f74['attributes']=_[_0x4472('0x33')](_0x34a1d1[_0x4472('0x2f')],qs['fields'](_0x1619aa[_0x4472('0x30')][_0x4472('0x35')]));_0x524f74[_0x4472('0x34')]=_0x524f74[_0x4472('0x34')][_0x4472('0x48')]?_0x524f74['attributes']:_0x34a1d1[_0x4472('0x2f')];if(_0x1619aa[_0x4472('0x30')][_0x4472('0x41')]){_0x524f74[_0x4472('0x42')]=[{'all':!![]}];}_0x524f74=_[_0x4472('0x3e')]({},_0x524f74,_0x1619aa['options']);return db['Dashboard'][_0x4472('0x49')](_0x524f74)[_0x4472('0x25')](handleEntityNotFound(_0x140dcc,null))[_0x4472('0x25')](respondWithResult(_0x140dcc,null))[_0x4472('0x45')](handleError(_0x140dcc,null));};exports['create']=function(_0x5904e4,_0x471452){return db['Dashboard'][_0x4472('0x4a')](_0x5904e4['body'],{})['then'](function(_0x4b9f50){var _0x5d852a=_0x5904e4[_0x4472('0x4b')][_0x4472('0x26')]({'plain':!![]});if(!_0x5d852a)throw new Error(_0x4472('0x4c'));if(_0x5d852a[_0x4472('0x4d')]===_0x4472('0x4b')){var _0x3a2af7=_0x4b9f50[_0x4472('0x26')]({'plain':!![]});var _0x18d175=_0x4472('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x18d175,'userProfileId':_0x5d852a[_0x4472('0x4e')]},'raw':!![]})[_0x4472('0x25')](function(_0x30c189){if(_0x30c189&&_0x30c189['autoAssociation']===0x0){return db[_0x4472('0x28')]['create']({'name':_0x3a2af7[_0x4472('0x2a')],'resourceId':_0x3a2af7['id'],'type':_0x30c189['name'],'sectionId':_0x30c189['id']},{})[_0x4472('0x25')](function(){return _0x4b9f50;});}else{return _0x4b9f50;}})['catch'](function(_0xd04054){logger[_0x4472('0x4f')](_0x4472('0x50'),_0xd04054);throw _0xd04054;});}return _0x4b9f50;})[_0x4472('0x25')](respondWithResult(_0x471452,0xc9))['catch'](handleError(_0x471452,null));};exports['clone']=function(_0x20fc44,_0x3c35a7){var _0x59f27c={'where':{'id':_0x20fc44[_0x4472('0x47')]['id']}},_0x4cc4be={};_0x4cc4be[_0x4472('0x2f')]=_[_0x4472('0x31')](db['Dashboard']['rawAttributes']);_0x59f27c[_0x4472('0x34')]=_[_0x4472('0x33')](_0x4cc4be['model'],qs[_0x4472('0x35')](_0x20fc44[_0x4472('0x30')][_0x4472('0x35')]));_0x59f27c[_0x4472('0x34')]=_0x59f27c[_0x4472('0x34')][_0x4472('0x48')]?_0x59f27c[_0x4472('0x34')]:_0x4cc4be[_0x4472('0x2f')];if(_0x20fc44[_0x4472('0x30')][_0x4472('0x41')]){_0x59f27c[_0x4472('0x42')]=[{'all':!![]}];}_0x59f27c=_['merge']({},_0x59f27c,_0x20fc44[_0x4472('0x3f')]);return db['Dashboard'][_0x4472('0x49')](_0x59f27c)[_0x4472('0x25')](handleEntityNotFound(_0x3c35a7,null))[_0x4472('0x25')](function(_0x4806b8){if(_0x4806b8){var _0x5be669=_0x4806b8['get']({'plain':!![]});_0x5be669=qs[_0x4472('0x51')](_0x5be669,['id',_0x4472('0x52'),'updatedAt']);_0x20fc44[_0x4472('0x53')]=_[_0x4472('0x51')](_0x20fc44[_0x4472('0x53')],['id','createdAt',_0x4472('0x54')]);return db[_0x4472('0x40')]['create'](_['merge'](_0x5be669,_0x20fc44['body']),{'include':_0x20fc44[_0x4472('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x4472('0x25')](function(_0x3cbf61){var _0x54564b=_0x20fc44[_0x4472('0x4b')][_0x4472('0x26')]({'plain':!![]});if(!_0x54564b)throw new Error(_0x4472('0x4c'));if(_0x54564b[_0x4472('0x4d')]===_0x4472('0x4b')){var _0x5610bf=_0x3cbf61['get']({'plain':!![]});var _0x485fff='CustomDashboards';return db['UserProfileSection'][_0x4472('0x49')]({'where':{'name':_0x485fff,'userProfileId':_0x54564b['userProfileId']},'raw':!![]})['then'](function(_0x6ea8aa){if(_0x6ea8aa&&_0x6ea8aa['autoAssociation']===0x0){return db['UserProfileResource'][_0x4472('0x4a')]({'name':_0x5610bf[_0x4472('0x2a')],'resourceId':_0x5610bf['id'],'type':_0x6ea8aa[_0x4472('0x2a')],'sectionId':_0x6ea8aa['id']},{})[_0x4472('0x25')](function(){return _0x3cbf61;});}else{return _0x3cbf61;}})[_0x4472('0x45')](function(_0x50611d){logger[_0x4472('0x4f')](_0x4472('0x50'),_0x50611d);throw _0x50611d;});}return _0x3cbf61;});}})[_0x4472('0x25')](respondWithResult(_0x3c35a7,0xc9))[_0x4472('0x45')](handleError(_0x3c35a7,null));};exports[_0x4472('0x23')]=function(_0x2fa0b2,_0x18af90){if(_0x2fa0b2[_0x4472('0x53')]['id']){delete _0x2fa0b2[_0x4472('0x53')]['id'];}return db[_0x4472('0x40')]['find']({'where':{'id':_0x2fa0b2[_0x4472('0x47')]['id']}})[_0x4472('0x25')](handleEntityNotFound(_0x18af90,null))[_0x4472('0x25')](saveUpdates(_0x2fa0b2[_0x4472('0x53')],null))[_0x4472('0x25')](respondWithResult(_0x18af90,null))[_0x4472('0x45')](handleError(_0x18af90,null));};exports[_0x4472('0x24')]=function(_0x5b7c97,_0x2f73a6){return db['Dashboard'][_0x4472('0x49')]({'where':{'id':_0x5b7c97[_0x4472('0x47')]['id']}})[_0x4472('0x25')](handleEntityNotFound(_0x2f73a6,null))[_0x4472('0x25')](removeEntity(_0x2f73a6,null))['catch'](handleError(_0x2f73a6,null));};function widgetAttributes(_0x8f6339){try{switch(_0x8f6339[_0x4472('0x2e')]){case _0x4472('0x55'):return[{'name':_0x4472('0x56'),'value':_0x8f6339[_0x4472('0x56')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x0]?_0x8f6339[_0x4472('0x57')][0x0][_0x4472('0x58')]:undefined)||_0x4472('0x59')}];case'custom':return[{'name':'attrPath','value':_0x8f6339[_0x4472('0x5a')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x0]?_0x8f6339[_0x4472('0x57')][0x0][_0x4472('0x58')]:undefined)||''}];case'clock':return[{'name':_0x4472('0x5b'),'value':_0x8f6339[_0x4472('0x5b')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x0]?_0x8f6339[_0x4472('0x57')][0x0][_0x4472('0x58')]:undefined)||_0x4472('0x5c')},{'name':_0x4472('0x5d'),'value':_0x8f6339[_0x4472('0x5d')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x1]?_0x8f6339[_0x4472('0x57')][0x1][_0x4472('0x58')]:undefined)||_0x4472('0x5e')},{'name':_0x4472('0x5f'),'value':_0x8f6339[_0x4472('0x5f')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x2]?_0x8f6339[_0x4472('0x57')][0x2][_0x4472('0x58')]:undefined)||0xc}];case _0x4472('0x60'):return[{'name':_0x4472('0x61'),'value':_0x8f6339[_0x4472('0x61')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x0]?_0x8f6339[_0x4472('0x57')][0x0][_0x4472('0x58')]:undefined)||'total'},{'name':_0x4472('0x62'),'value':_0x8f6339[_0x4472('0x62')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x1]?_0x8f6339[_0x4472('0x57')][0x1][_0x4472('0x58')]:undefined)||[]},{'name':_0x4472('0x5f'),'value':_0x8f6339[_0x4472('0x5f')]||(_0x8f6339['attrs']&&_0x8f6339['attrs'][0x2]?_0x8f6339['attrs'][0x2][_0x4472('0x58')]:undefined)||0x14},{'name':_0x4472('0x63'),'value':_0x8f6339['attrChannel']||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x3]?_0x8f6339[_0x4472('0x57')][0x3][_0x4472('0x58')]:undefined)||_0x4472('0x64')},{'name':_0x4472('0x65'),'value':_0x8f6339[_0x4472('0x65')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x4]?_0x8f6339['attrs'][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x8f6339[_0x4472('0x66')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x5]?_0x8f6339[_0x4472('0x57')][0x5][_0x4472('0x58')]:undefined)||''},{'name':_0x4472('0x67'),'value':_0x8f6339[_0x4472('0x67')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x6]?_0x8f6339[_0x4472('0x57')][0x6][_0x4472('0x58')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x8f6339[_0x4472('0x68')]||(_0x8f6339['attrs']&&_0x8f6339['attrs'][0x7]?_0x8f6339[_0x4472('0x57')][0x7][_0x4472('0x58')]:undefined)||''},{'name':_0x4472('0x69'),'value':_0x8f6339['attrWhatsappAccounts']||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x8]?_0x8f6339['attrs'][0x8][_0x4472('0x58')]:undefined)||''},{'name':_0x4472('0x6a'),'value':_0x8f6339[_0x4472('0x6a')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x9]?_0x8f6339[_0x4472('0x57')][0x9][_0x4472('0x58')]:undefined)||''}];case _0x4472('0x6b'):case'pie-chart':return[{'name':_0x4472('0x6c'),'value':_0x8f6339[_0x4472('0x6c')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x0]?_0x8f6339['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x4472('0x6d'),'value':_0x8f6339[_0x4472('0x6d')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x1]?_0x8f6339[_0x4472('0x57')][0x1][_0x4472('0x58')]:undefined)||null},{'name':_0x4472('0x6e'),'value':_0x8f6339[_0x4472('0x6e')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339['attrs'][0x2]?_0x8f6339['attrs'][0x2][_0x4472('0x58')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x8f6339[_0x4472('0x62')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339['attrs'][0x3]?_0x8f6339[_0x4472('0x57')][0x3][_0x4472('0x58')]:undefined)||[]},{'name':_0x4472('0x63'),'value':_0x8f6339[_0x4472('0x63')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x4]?_0x8f6339[_0x4472('0x57')][0x4][_0x4472('0x58')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x8f6339[_0x4472('0x65')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x5]?_0x8f6339[_0x4472('0x57')][0x5][_0x4472('0x58')]:undefined)||''},{'name':_0x4472('0x66'),'value':_0x8f6339[_0x4472('0x66')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x6]?_0x8f6339[_0x4472('0x57')][0x6][_0x4472('0x58')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x8f6339['attrSmsAccounts']||(_0x8f6339['attrs']&&_0x8f6339['attrs'][0x7]?_0x8f6339['attrs'][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x8f6339[_0x4472('0x68')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x8]?_0x8f6339[_0x4472('0x57')][0x8][_0x4472('0x58')]:undefined)||''},{'name':_0x4472('0x69'),'value':_0x8f6339[_0x4472('0x69')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x9]?_0x8f6339['attrs'][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x8f6339[_0x4472('0x6a')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339['attrs'][0xa]?_0x8f6339[_0x4472('0x57')][0xa][_0x4472('0x58')]:undefined)||''}];case _0x4472('0x6f'):return[{'name':_0x4472('0x70'),'type':_0x8f6339['reportType']||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x0]?_0x8f6339[_0x4472('0x57')][0x0][_0x4472('0x2e')]:undefined)||null,'value':_0x8f6339[_0x4472('0x70')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339['attrs'][0x0]?_0x8f6339[_0x4472('0x57')][0x0][_0x4472('0x58')]:undefined)||null},{'name':_0x4472('0x71'),'value':_0x8f6339[_0x4472('0x71')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x1]?_0x8f6339[_0x4472('0x57')][0x1][_0x4472('0x58')]:undefined)||0x0}];default:return[];}}catch(_0x40e54c){logger[_0x4472('0x4f')](_0x4472('0x72'),JSON[_0x4472('0x73')](_0x40e54c));return[];}}exports[_0x4472('0x74')]=function(_0x34f06e,_0x4565c5,_0x36ce1c){if(_0x34f06e[_0x4472('0x53')]['id']){delete _0x34f06e[_0x4472('0x53')]['id'];}return db[_0x4472('0x40')][_0x4472('0x49')]({'where':{'id':_0x34f06e['params']['id']}})['then'](handleEntityNotFound(_0x4565c5,null))[_0x4472('0x25')](function(_0x4c2109){if(_0x4c2109){_0x34f06e[_0x4472('0x53')][_0x4472('0x75')]=_0x4c2109['id'];_0x34f06e[_0x4472('0x53')][_0x4472('0x57')]=widgetAttributes(_0x34f06e['body']);return db[_0x4472('0x76')]['create'](_0x34f06e[_0x4472('0x53')]);}})[_0x4472('0x25')](respondWithResult(_0x4565c5,null))[_0x4472('0x45')](handleError(_0x4565c5,null));};exports[_0x4472('0x77')]=function(_0x160e36,_0x5ec5e8,_0x3027a6){var _0x4eff99={};var _0x482dbc={};var _0x4d1e20;var _0x5320ad;return db[_0x4472('0x40')][_0x4472('0x78')]({'where':{'id':_0x160e36[_0x4472('0x47')]['id']}})[_0x4472('0x25')](handleEntityNotFound(_0x5ec5e8,null))[_0x4472('0x25')](function(_0x51d991){if(_0x51d991){_0x4d1e20=_0x51d991;_0x482dbc[_0x4472('0x2f')]=_[_0x4472('0x31')](db[_0x4472('0x76')][_0x4472('0x2d')]);_0x482dbc[_0x4472('0x30')]=_[_0x4472('0x31')](_0x160e36[_0x4472('0x30')]);_0x482dbc[_0x4472('0x32')]=_['intersection'](_0x482dbc[_0x4472('0x2f')],_0x482dbc[_0x4472('0x30')]);_0x4eff99[_0x4472('0x34')]=_[_0x4472('0x33')](_0x482dbc[_0x4472('0x2f')],qs['fields'](_0x160e36[_0x4472('0x30')]['fields']));_0x4eff99[_0x4472('0x34')]=_0x4eff99[_0x4472('0x34')][_0x4472('0x48')]?_0x4eff99[_0x4472('0x34')]:_0x482dbc[_0x4472('0x2f')];_0x4eff99[_0x4472('0x37')]=qs[_0x4472('0x38')](_0x160e36[_0x4472('0x30')]['sort']);_0x4eff99['where']=qs[_0x4472('0x32')](_['pick'](_0x160e36['query'],_0x482dbc[_0x4472('0x32')]));if(_0x160e36['query']['filter']){_0x4eff99[_0x4472('0x39')]=_[_0x4472('0x3e')](_0x4eff99[_0x4472('0x39')],{'$or':_['map'](_0x4eff99[_0x4472('0x34')],function(_0xc3e2e9){var _0x3476c0={};_0x3476c0[_0xc3e2e9]={'$like':'%'+_0x160e36['query']['filter']+'%'};return _0x3476c0;})});}_0x4eff99=_[_0x4472('0x3e')]({},_0x4eff99,_0x160e36['options']);return _0x4d1e20[_0x4472('0x77')](_0x4eff99);}})[_0x4472('0x25')](function(_0x42d773){if(_0x42d773){_0x5320ad=_0x42d773[_0x4472('0x48')];if(!_0x160e36['query']['hasOwnProperty'](_0x4472('0x79'))){_0x4eff99[_0x4472('0x1f')]=qs['limit'](_0x160e36[_0x4472('0x30')][_0x4472('0x1f')]);_0x4eff99[_0x4472('0x1c')]=qs[_0x4472('0x1c')](_0x160e36[_0x4472('0x30')]['offset']);}return _0x4d1e20['getItems'](_0x4eff99);}})[_0x4472('0x25')](function(_0xd93a8d){if(_0xd93a8d){return _0xd93a8d?{'count':_0x5320ad,'rows':_0xd93a8d}:null;}})['then'](respondWithResult(_0x5ec5e8,null))[_0x4472('0x45')](handleError(_0x5ec5e8,null));}; \ No newline at end of file +var _0x8373=['counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','getItems','DashboardItem','order','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','sort','where','pick','filter','merge','options','Dashboard','includeAll','include','rows','catch','show','params','find','create','body','user','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize'];(function(_0x3777d2,_0x3de1fa){var _0x3029ab=function(_0x532487){while(--_0x532487){_0x3777d2['push'](_0x3777d2['shift']());}};_0x3029ab(++_0x3de1fa);}(_0x8373,0x11d));var _0x3837=function(_0x243efe,_0x1b3b6b){_0x243efe=_0x243efe-0x0;var _0x51549b=_0x8373[_0x243efe];return _0x51549b;};'use strict';var emlformat=require(_0x3837('0x0'));var rimraf=require(_0x3837('0x1'));var zipdir=require(_0x3837('0x2'));var jsonpatch=require(_0x3837('0x3'));var rp=require(_0x3837('0x4'));var moment=require('moment');var BPromise=require(_0x3837('0x5'));var Mustache=require(_0x3837('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3837('0x7'));var ejs=require(_0x3837('0x8'));var fs=require('fs');var fs_extra=require(_0x3837('0x9'));var _=require(_0x3837('0xa'));var squel=require('squel');var crypto=require(_0x3837('0xb'));var jsforce=require(_0x3837('0xc'));var deskjs=require(_0x3837('0xd'));var toCsv=require(_0x3837('0x7'));var querystring=require('querystring');var Papa=require(_0x3837('0xe'));var Redis=require(_0x3837('0xf'));var authService=require(_0x3837('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3837('0x11'));var logger=require(_0x3837('0x12'))('api');var utils=require(_0x3837('0x13'));var config=require(_0x3837('0x14'));var licenseUtil=require(_0x3837('0x15'));var db=require(_0x3837('0x16'))['db'];config[_0x3837('0x17')]=_[_0x3837('0x18')](config[_0x3837('0x17')],{'host':_0x3837('0x19'),'port':0x18eb});var socket=require(_0x3837('0x1a'))(new Redis(config[_0x3837('0x17')]));require('./dashboard.socket')[_0x3837('0x1b')](socket);function respondWithStatusCode(_0x5ae448,_0x55c4ea){_0x55c4ea=_0x55c4ea||0xcc;return function(_0xfb4e83){if(_0xfb4e83){return _0x5ae448[_0x3837('0x1c')](_0x55c4ea);}return _0x5ae448[_0x3837('0x1d')](_0x55c4ea)[_0x3837('0x1e')]();};}function respondWithResult(_0x395266,_0x518fcd){_0x518fcd=_0x518fcd||0xc8;return function(_0x49cc86){if(_0x49cc86){return _0x395266['status'](_0x518fcd)['json'](_0x49cc86);}};}function respondWithFilteredResult(_0x53bc1c,_0x1752f9){return function(_0x575145){if(_0x575145){var _0x53ccd8=typeof _0x1752f9[_0x3837('0x1f')]===_0x3837('0x20')&&typeof _0x1752f9['limit']==='undefined';var _0x7dd367=_0x575145[_0x3837('0x21')];var _0x569c43=_0x53ccd8?0x0:_0x1752f9[_0x3837('0x1f')];var _0x24b315=_0x53ccd8?_0x575145[_0x3837('0x21')]:_0x1752f9['offset']+_0x1752f9[_0x3837('0x22')];var _0x5c172d;if(_0x24b315>=_0x7dd367){_0x24b315=_0x7dd367;_0x5c172d=0xc8;}else{_0x5c172d=0xce;}_0x53bc1c['status'](_0x5c172d);return _0x53bc1c[_0x3837('0x23')](_0x3837('0x24'),_0x569c43+'-'+_0x24b315+'/'+_0x7dd367)[_0x3837('0x25')](_0x575145);}return null;};}function patchUpdates(_0x20d050){return function(_0x17cf85){try{jsonpatch[_0x3837('0x26')](_0x17cf85,_0x20d050,!![]);}catch(_0x2b3d6b){return BPromise[_0x3837('0x27')](_0x2b3d6b);}return _0x17cf85[_0x3837('0x28')]();};}function saveUpdates(_0x1cfd94,_0xd9facb){return function(_0x143947){if(_0x143947){return _0x143947[_0x3837('0x29')](_0x1cfd94)[_0x3837('0x2a')](function(_0x4bcc19){return _0x4bcc19;});}return null;};}function removeEntity(_0x5414ad,_0x29c16c){return function(_0x352c94){if(_0x352c94){return _0x352c94[_0x3837('0x2b')]()['then'](function(){var _0x537235=_0x352c94[_0x3837('0x2c')]({'plain':!![]});var _0x497380=_0x3837('0x2d');return db[_0x3837('0x2e')]['destroy']({'where':{'type':_0x497380,'resourceId':_0x537235['id']}})['then'](function(){return _0x352c94;});})[_0x3837('0x2a')](function(){_0x5414ad[_0x3837('0x1d')](0xcc)[_0x3837('0x1e')]();});}};}function handleEntityNotFound(_0x463e16,_0x28489a){return function(_0x28c579){if(!_0x28c579){_0x463e16[_0x3837('0x1c')](0x194);}return _0x28c579;};}function handleError(_0x266d64,_0x275304){_0x275304=_0x275304||0x1f4;return function(_0x4ae190){logger[_0x3837('0x2f')](_0x4ae190[_0x3837('0x30')]);if(_0x4ae190[_0x3837('0x31')]){delete _0x4ae190['name'];}_0x266d64[_0x3837('0x1d')](_0x275304)[_0x3837('0x32')](_0x4ae190);};}exports['index']=function(_0x29a591,_0x1c57b7){var _0xec9336={},_0x3af9d4={},_0x24cc52={'count':0x0,'rows':[]};var _0x506910=_[_0x3837('0x33')](db['Dashboard'][_0x3837('0x34')],function(_0x4d0818){return{'name':_0x4d0818[_0x3837('0x35')],'type':_0x4d0818[_0x3837('0x36')][_0x3837('0x37')]};});_0x3af9d4['model']=_['map'](_0x506910,_0x3837('0x31'));_0x3af9d4[_0x3837('0x38')]=_[_0x3837('0x39')](_0x29a591[_0x3837('0x38')]);_0x3af9d4[_0x3837('0x3a')]=_[_0x3837('0x3b')](_0x3af9d4['model'],_0x3af9d4['query']);_0xec9336['attributes']=_[_0x3837('0x3b')](_0x3af9d4[_0x3837('0x3c')],qs[_0x3837('0x3d')](_0x29a591[_0x3837('0x38')][_0x3837('0x3d')]));_0xec9336[_0x3837('0x3e')]=_0xec9336['attributes'][_0x3837('0x3f')]?_0xec9336[_0x3837('0x3e')]:_0x3af9d4[_0x3837('0x3c')];if(!_0x29a591[_0x3837('0x38')]['hasOwnProperty']('nolimit')){_0xec9336[_0x3837('0x22')]=qs[_0x3837('0x22')](_0x29a591['query']['limit']);_0xec9336['offset']=qs[_0x3837('0x1f')](_0x29a591['query']['offset']);}_0xec9336['order']=qs[_0x3837('0x40')](_0x29a591[_0x3837('0x38')][_0x3837('0x40')]);_0xec9336[_0x3837('0x41')]=qs['filters'](_[_0x3837('0x42')](_0x29a591['query'],_0x3af9d4['filters']),_0x506910);if(_0x29a591['query'][_0x3837('0x43')]){_0xec9336[_0x3837('0x41')]=_[_0x3837('0x44')](_0xec9336['where'],{'$or':_[_0x3837('0x33')](_0x506910,function(_0x5d1253){if(_0x5d1253[_0x3837('0x36')]!=='VIRTUAL'){var _0x5ec36f={};_0x5ec36f[_0x5d1253[_0x3837('0x31')]]={'$like':'%'+_0x29a591[_0x3837('0x38')][_0x3837('0x43')]+'%'};return _0x5ec36f;}})});}_0xec9336=_['merge']({},_0xec9336,_0x29a591[_0x3837('0x45')]);var _0x19ddf9={'where':_0xec9336[_0x3837('0x41')]};return db[_0x3837('0x46')]['count'](_0x19ddf9)[_0x3837('0x2a')](function(_0xa89ea0){_0x24cc52[_0x3837('0x21')]=_0xa89ea0;if(_0x29a591['query'][_0x3837('0x47')]){_0xec9336[_0x3837('0x48')]=[{'all':!![]}];}return db[_0x3837('0x46')]['findAll'](_0xec9336);})['then'](function(_0x436449){_0x24cc52[_0x3837('0x49')]=_0x436449;return _0x24cc52;})[_0x3837('0x2a')](respondWithFilteredResult(_0x1c57b7,_0xec9336))[_0x3837('0x4a')](handleError(_0x1c57b7,null));};exports[_0x3837('0x4b')]=function(_0x236bb0,_0x4ba3d8){var _0x23f30f={'raw':![],'where':{'id':_0x236bb0[_0x3837('0x4c')]['id']}},_0x39e879={};_0x39e879[_0x3837('0x3c')]=_[_0x3837('0x39')](db[_0x3837('0x46')][_0x3837('0x34')]);_0x39e879['query']=_[_0x3837('0x39')](_0x236bb0[_0x3837('0x38')]);_0x39e879[_0x3837('0x3a')]=_[_0x3837('0x3b')](_0x39e879['model'],_0x39e879['query']);_0x23f30f['attributes']=_[_0x3837('0x3b')](_0x39e879[_0x3837('0x3c')],qs['fields'](_0x236bb0['query']['fields']));_0x23f30f['attributes']=_0x23f30f[_0x3837('0x3e')]['length']?_0x23f30f['attributes']:_0x39e879['model'];if(_0x236bb0[_0x3837('0x38')]['includeAll']){_0x23f30f[_0x3837('0x48')]=[{'all':!![]}];}_0x23f30f=_[_0x3837('0x44')]({},_0x23f30f,_0x236bb0[_0x3837('0x45')]);return db[_0x3837('0x46')][_0x3837('0x4d')](_0x23f30f)[_0x3837('0x2a')](handleEntityNotFound(_0x4ba3d8,null))[_0x3837('0x2a')](respondWithResult(_0x4ba3d8,null))[_0x3837('0x4a')](handleError(_0x4ba3d8,null));};exports[_0x3837('0x4e')]=function(_0x488249,_0x39fd38){return db[_0x3837('0x46')][_0x3837('0x4e')](_0x488249[_0x3837('0x4f')],{})[_0x3837('0x2a')](function(_0x3fd4d1){var _0x49b74f=_0x488249[_0x3837('0x50')][_0x3837('0x2c')]({'plain':!![]});if(!_0x49b74f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49b74f['role']==='user'){var _0x4feff1=_0x3fd4d1[_0x3837('0x2c')]({'plain':!![]});var _0x1c3fea='CustomDashboards';return db['UserProfileSection'][_0x3837('0x4d')]({'where':{'name':_0x1c3fea,'userProfileId':_0x49b74f['userProfileId']},'raw':!![]})['then'](function(_0x4420bd){if(_0x4420bd&&_0x4420bd[_0x3837('0x51')]===0x0){return db[_0x3837('0x2e')][_0x3837('0x4e')]({'name':_0x4feff1[_0x3837('0x31')],'resourceId':_0x4feff1['id'],'type':_0x4420bd[_0x3837('0x31')],'sectionId':_0x4420bd['id']},{})[_0x3837('0x2a')](function(){return _0x3fd4d1;});}else{return _0x3fd4d1;}})['catch'](function(_0x5de14e){logger[_0x3837('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5de14e);throw _0x5de14e;});}return _0x3fd4d1;})[_0x3837('0x2a')](respondWithResult(_0x39fd38,0xc9))[_0x3837('0x4a')](handleError(_0x39fd38,null));};exports[_0x3837('0x52')]=function(_0x828a4e,_0x5d99f3){var _0xf40d7e={'where':{'id':_0x828a4e[_0x3837('0x4c')]['id']}},_0x260e84={};_0x260e84[_0x3837('0x3c')]=_[_0x3837('0x39')](db[_0x3837('0x46')][_0x3837('0x34')]);_0xf40d7e[_0x3837('0x3e')]=_[_0x3837('0x3b')](_0x260e84[_0x3837('0x3c')],qs['fields'](_0x828a4e[_0x3837('0x38')][_0x3837('0x3d')]));_0xf40d7e['attributes']=_0xf40d7e['attributes'][_0x3837('0x3f')]?_0xf40d7e[_0x3837('0x3e')]:_0x260e84[_0x3837('0x3c')];if(_0x828a4e[_0x3837('0x38')][_0x3837('0x47')]){_0xf40d7e[_0x3837('0x48')]=[{'all':!![]}];}_0xf40d7e=_[_0x3837('0x44')]({},_0xf40d7e,_0x828a4e[_0x3837('0x45')]);return db[_0x3837('0x46')][_0x3837('0x4d')](_0xf40d7e)[_0x3837('0x2a')](handleEntityNotFound(_0x5d99f3,null))[_0x3837('0x2a')](function(_0x3c15ef){if(_0x3c15ef){var _0x54c3de=_0x3c15ef['get']({'plain':!![]});_0x54c3de=qs[_0x3837('0x53')](_0x54c3de,['id',_0x3837('0x54'),_0x3837('0x55')]);_0x828a4e[_0x3837('0x4f')]=_[_0x3837('0x53')](_0x828a4e[_0x3837('0x4f')],['id','createdAt','updatedAt']);return db[_0x3837('0x46')][_0x3837('0x4e')](_['merge'](_0x54c3de,_0x828a4e['body']),{'include':_0x828a4e['query']['includeAll']?[{'all':!![]}]:undefined})[_0x3837('0x2a')](function(_0x86fa63){var _0x53bf4c=_0x828a4e[_0x3837('0x50')][_0x3837('0x2c')]({'plain':!![]});if(!_0x53bf4c)throw new Error(_0x3837('0x56'));if(_0x53bf4c[_0x3837('0x57')]===_0x3837('0x50')){var _0x5057ca=_0x86fa63[_0x3837('0x2c')]({'plain':!![]});var _0x461460=_0x3837('0x2d');return db[_0x3837('0x58')][_0x3837('0x4d')]({'where':{'name':_0x461460,'userProfileId':_0x53bf4c[_0x3837('0x59')]},'raw':!![]})[_0x3837('0x2a')](function(_0x582ec3){if(_0x582ec3&&_0x582ec3[_0x3837('0x51')]===0x0){return db[_0x3837('0x2e')][_0x3837('0x4e')]({'name':_0x5057ca[_0x3837('0x31')],'resourceId':_0x5057ca['id'],'type':_0x582ec3[_0x3837('0x31')],'sectionId':_0x582ec3['id']},{})[_0x3837('0x2a')](function(){return _0x86fa63;});}else{return _0x86fa63;}})[_0x3837('0x4a')](function(_0x16fd34){logger[_0x3837('0x2f')](_0x3837('0x5a'),_0x16fd34);throw _0x16fd34;});}return _0x86fa63;});}})[_0x3837('0x2a')](respondWithResult(_0x5d99f3,0xc9))[_0x3837('0x4a')](handleError(_0x5d99f3,null));};exports[_0x3837('0x29')]=function(_0x15ca6b,_0x232e8b){if(_0x15ca6b[_0x3837('0x4f')]['id']){delete _0x15ca6b[_0x3837('0x4f')]['id'];}return db[_0x3837('0x46')]['find']({'where':{'id':_0x15ca6b[_0x3837('0x4c')]['id']}})[_0x3837('0x2a')](handleEntityNotFound(_0x232e8b,null))[_0x3837('0x2a')](saveUpdates(_0x15ca6b[_0x3837('0x4f')],null))[_0x3837('0x2a')](respondWithResult(_0x232e8b,null))[_0x3837('0x4a')](handleError(_0x232e8b,null));};exports['destroy']=function(_0x1f971b,_0xcc396b){return db[_0x3837('0x46')][_0x3837('0x4d')]({'where':{'id':_0x1f971b[_0x3837('0x4c')]['id']}})[_0x3837('0x2a')](handleEntityNotFound(_0xcc396b,null))['then'](removeEntity(_0xcc396b,null))[_0x3837('0x4a')](handleError(_0xcc396b,null));};function widgetAttributes(_0x51c810){try{switch(_0x51c810['type']){case _0x3837('0x5b'):return[{'name':'attrUrl','value':_0x51c810[_0x3837('0x5c')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x0]?_0x51c810[_0x3837('0x5d')][0x0][_0x3837('0x5e')]:undefined)||'https://'}];case _0x3837('0x5f'):return[{'name':'attrPath','value':_0x51c810[_0x3837('0x60')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x0]?_0x51c810[_0x3837('0x5d')][0x0][_0x3837('0x5e')]:undefined)||''}];case _0x3837('0x61'):return[{'name':_0x3837('0x62'),'value':_0x51c810[_0x3837('0x62')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x0]?_0x51c810[_0x3837('0x5d')][0x0][_0x3837('0x5e')]:undefined)||'HH:mm:ss'},{'name':_0x3837('0x63'),'value':_0x51c810[_0x3837('0x63')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x1]?_0x51c810['attrs'][0x1][_0x3837('0x5e')]:undefined)||_0x3837('0x64')},{'name':_0x3837('0x65'),'value':_0x51c810['attrFontSize']||(_0x51c810['attrs']&&_0x51c810[_0x3837('0x5d')][0x2]?_0x51c810[_0x3837('0x5d')][0x2][_0x3837('0x5e')]:undefined)||0xc}];case _0x3837('0x66'):return[{'name':'attrMetric','value':_0x51c810[_0x3837('0x67')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x0]?_0x51c810[_0x3837('0x5d')][0x0][_0x3837('0x5e')]:undefined)||_0x3837('0x68')},{'name':_0x3837('0x69'),'value':_0x51c810[_0x3837('0x69')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x1]?_0x51c810[_0x3837('0x5d')][0x1][_0x3837('0x5e')]:undefined)||[]},{'name':_0x3837('0x65'),'value':_0x51c810[_0x3837('0x65')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810['attrs'][0x2]?_0x51c810[_0x3837('0x5d')][0x2][_0x3837('0x5e')]:undefined)||0x14},{'name':_0x3837('0x6a'),'value':_0x51c810['attrChannel']||(_0x51c810['attrs']&&_0x51c810[_0x3837('0x5d')][0x3]?_0x51c810[_0x3837('0x5d')][0x3][_0x3837('0x5e')]:undefined)||_0x3837('0x6b')},{'name':'attrEmailAccounts','value':_0x51c810['attrEmailAccounts']||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x4]?_0x51c810['attrs'][0x4][_0x3837('0x5e')]:undefined)||''},{'name':_0x3837('0x6c'),'value':_0x51c810['attrFaxAccounts']||(_0x51c810['attrs']&&_0x51c810['attrs'][0x5]?_0x51c810['attrs'][0x5][_0x3837('0x5e')]:undefined)||''},{'name':_0x3837('0x6d'),'value':_0x51c810[_0x3837('0x6d')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x6]?_0x51c810[_0x3837('0x5d')][0x6][_0x3837('0x5e')]:undefined)||''},{'name':_0x3837('0x6e'),'value':_0x51c810[_0x3837('0x6e')]||(_0x51c810['attrs']&&_0x51c810['attrs'][0x7]?_0x51c810[_0x3837('0x5d')][0x7][_0x3837('0x5e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x51c810['attrWhatsappAccounts']||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x8]?_0x51c810[_0x3837('0x5d')][0x8][_0x3837('0x5e')]:undefined)||''},{'name':_0x3837('0x6f'),'value':_0x51c810[_0x3837('0x6f')]||(_0x51c810['attrs']&&_0x51c810[_0x3837('0x5d')][0x9]?_0x51c810[_0x3837('0x5d')][0x9]['value']:undefined)||''}];case _0x3837('0x70'):case _0x3837('0x71'):return[{'name':_0x3837('0x72'),'value':_0x51c810[_0x3837('0x72')]||(_0x51c810['attrs']&&_0x51c810['attrs'][0x0]?_0x51c810[_0x3837('0x5d')][0x0]['value']:undefined)||_0x3837('0x68')},{'name':_0x3837('0x73'),'value':_0x51c810[_0x3837('0x73')]||(_0x51c810['attrs']&&_0x51c810[_0x3837('0x5d')][0x1]?_0x51c810[_0x3837('0x5d')][0x1][_0x3837('0x5e')]:undefined)||null},{'name':_0x3837('0x74'),'value':_0x51c810[_0x3837('0x74')]||(_0x51c810['attrs']&&_0x51c810['attrs'][0x2]?_0x51c810['attrs'][0x2][_0x3837('0x5e')]:undefined)||null},{'name':_0x3837('0x69'),'value':_0x51c810[_0x3837('0x69')]||(_0x51c810['attrs']&&_0x51c810[_0x3837('0x5d')][0x3]?_0x51c810[_0x3837('0x5d')][0x3][_0x3837('0x5e')]:undefined)||[]},{'name':'attrChannel','value':_0x51c810[_0x3837('0x6a')]||(_0x51c810['attrs']&&_0x51c810['attrs'][0x4]?_0x51c810[_0x3837('0x5d')][0x4][_0x3837('0x5e')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x51c810['attrEmailAccounts']||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x5]?_0x51c810[_0x3837('0x5d')][0x5][_0x3837('0x5e')]:undefined)||''},{'name':_0x3837('0x6c'),'value':_0x51c810[_0x3837('0x6c')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x6]?_0x51c810['attrs'][0x6][_0x3837('0x5e')]:undefined)||''},{'name':_0x3837('0x6d'),'value':_0x51c810['attrSmsAccounts']||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x7]?_0x51c810[_0x3837('0x5d')][0x7][_0x3837('0x5e')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x51c810[_0x3837('0x6e')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x8]?_0x51c810[_0x3837('0x5d')][0x8][_0x3837('0x5e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x51c810[_0x3837('0x75')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x9]?_0x51c810['attrs'][0x9][_0x3837('0x5e')]:undefined)||''},{'name':_0x3837('0x6f'),'value':_0x51c810[_0x3837('0x6f')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0xa]?_0x51c810['attrs'][0xa][_0x3837('0x5e')]:undefined)||''}];case _0x3837('0x76'):return[{'name':_0x3837('0x77'),'type':_0x51c810[_0x3837('0x78')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x0]?_0x51c810[_0x3837('0x5d')][0x0][_0x3837('0x36')]:undefined)||null,'value':_0x51c810['attrReport']||(_0x51c810[_0x3837('0x5d')]&&_0x51c810[_0x3837('0x5d')][0x0]?_0x51c810[_0x3837('0x5d')][0x0]['value']:undefined)||null},{'name':_0x3837('0x79'),'value':_0x51c810[_0x3837('0x79')]||(_0x51c810[_0x3837('0x5d')]&&_0x51c810['attrs'][0x1]?_0x51c810[_0x3837('0x5d')][0x1][_0x3837('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x334b0f){logger['error'](_0x3837('0x7a'),JSON['stringify'](_0x334b0f));return[];}}exports[_0x3837('0x7b')]=function(_0x9b42c,_0x17dc5a,_0x1ba0c6){if(_0x9b42c[_0x3837('0x4f')]['id']){delete _0x9b42c[_0x3837('0x4f')]['id'];}return db[_0x3837('0x46')][_0x3837('0x4d')]({'where':{'id':_0x9b42c[_0x3837('0x4c')]['id']}})[_0x3837('0x2a')](handleEntityNotFound(_0x17dc5a,null))[_0x3837('0x2a')](function(_0x1ce12d){if(_0x1ce12d){_0x9b42c[_0x3837('0x4f')]['DashboardId']=_0x1ce12d['id'];_0x9b42c['body'][_0x3837('0x5d')]=widgetAttributes(_0x9b42c['body']);return db['DashboardItem'][_0x3837('0x4e')](_0x9b42c[_0x3837('0x4f')]);}})[_0x3837('0x2a')](respondWithResult(_0x17dc5a,null))['catch'](handleError(_0x17dc5a,null));};exports[_0x3837('0x7c')]=function(_0x523376,_0x5ce489,_0x11f098){var _0x2480f0={};var _0x5c5b94={};var _0x32671d;var _0x50a292;return db[_0x3837('0x46')]['findOne']({'where':{'id':_0x523376[_0x3837('0x4c')]['id']}})[_0x3837('0x2a')](handleEntityNotFound(_0x5ce489,null))[_0x3837('0x2a')](function(_0x2f48fd){if(_0x2f48fd){_0x32671d=_0x2f48fd;_0x5c5b94[_0x3837('0x3c')]=_[_0x3837('0x39')](db[_0x3837('0x7d')][_0x3837('0x34')]);_0x5c5b94[_0x3837('0x38')]=_[_0x3837('0x39')](_0x523376[_0x3837('0x38')]);_0x5c5b94[_0x3837('0x3a')]=_[_0x3837('0x3b')](_0x5c5b94[_0x3837('0x3c')],_0x5c5b94['query']);_0x2480f0[_0x3837('0x3e')]=_[_0x3837('0x3b')](_0x5c5b94['model'],qs[_0x3837('0x3d')](_0x523376[_0x3837('0x38')][_0x3837('0x3d')]));_0x2480f0[_0x3837('0x3e')]=_0x2480f0[_0x3837('0x3e')][_0x3837('0x3f')]?_0x2480f0['attributes']:_0x5c5b94['model'];_0x2480f0[_0x3837('0x7e')]=qs['sort'](_0x523376['query']['sort']);_0x2480f0[_0x3837('0x41')]=qs['filters'](_[_0x3837('0x42')](_0x523376[_0x3837('0x38')],_0x5c5b94[_0x3837('0x3a')]));if(_0x523376[_0x3837('0x38')][_0x3837('0x43')]){_0x2480f0[_0x3837('0x41')]=_['merge'](_0x2480f0[_0x3837('0x41')],{'$or':_[_0x3837('0x33')](_0x2480f0[_0x3837('0x3e')],function(_0x25cbe8){var _0x5c18fc={};_0x5c18fc[_0x25cbe8]={'$like':'%'+_0x523376[_0x3837('0x38')][_0x3837('0x43')]+'%'};return _0x5c18fc;})});}_0x2480f0=_['merge']({},_0x2480f0,_0x523376['options']);return _0x32671d[_0x3837('0x7c')](_0x2480f0);}})['then'](function(_0x4454ca){if(_0x4454ca){_0x50a292=_0x4454ca[_0x3837('0x3f')];if(!_0x523376[_0x3837('0x38')][_0x3837('0x7f')](_0x3837('0x80'))){_0x2480f0['limit']=qs[_0x3837('0x22')](_0x523376[_0x3837('0x38')][_0x3837('0x22')]);_0x2480f0[_0x3837('0x1f')]=qs['offset'](_0x523376['query'][_0x3837('0x1f')]);}return _0x32671d['getItems'](_0x2480f0);}})[_0x3837('0x2a')](function(_0xd27f49){if(_0xd27f49){return _0xd27f49?{'count':_0x50a292,'rows':_0xd27f49}:null;}})['then'](respondWithResult(_0x5ce489,null))['catch'](handleError(_0x5ce489,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 7a94023..47adee4 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 _0x2bfa=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x45cc12,_0x1f4c9d){var _0x3c6386=function(_0x9074ed){while(--_0x9074ed){_0x45cc12['push'](_0x45cc12['shift']());}};_0x3c6386(++_0x1f4c9d);}(_0x2bfa,0x188));var _0xa2bf=function(_0x372cc5,_0x52471d){_0x372cc5=_0x372cc5-0x0;var _0x301ca6=_0x2bfa[_0x372cc5];return _0x301ca6;};'use strict';var EventEmitter=require(_0xa2bf('0x0'));var Dashboard=require(_0xa2bf('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xa2bf('0x2')](0x0);var events={'afterCreate':_0xa2bf('0x3'),'afterUpdate':_0xa2bf('0x4'),'afterDestroy':_0xa2bf('0x5')};function emitEvent(_0x4f6e6a){return function(_0x3ffb84,_0x1a976f,_0x1476dd){DashboardEvents[_0xa2bf('0x6')](_0x4f6e6a+':'+_0x3ffb84['id'],_0x3ffb84);DashboardEvents[_0xa2bf('0x6')](_0x4f6e6a,_0x3ffb84);_0x1476dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xa2bf('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x60e7=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0x45bc15,_0x4087e6){var _0x3aa7d9=function(_0x377193){while(--_0x377193){_0x45bc15['push'](_0x45bc15['shift']());}};_0x3aa7d9(++_0x4087e6);}(_0x60e7,0xef));var _0x760e=function(_0x407d2e,_0x2ddec7){_0x407d2e=_0x407d2e-0x0;var _0x4157d4=_0x60e7[_0x407d2e];return _0x4157d4;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x760e('0x0'))['db'][_0x760e('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x760e('0x2')](0x0);var events={'afterCreate':_0x760e('0x3'),'afterUpdate':_0x760e('0x4'),'afterDestroy':_0x760e('0x5')};function emitEvent(_0x3896b6){return function(_0x2976d6,_0x13ee92,_0x21146e){DashboardEvents['emit'](_0x3896b6+':'+_0x2976d6['id'],_0x2976d6);DashboardEvents[_0x760e('0x6')](_0x3896b6,_0x2976d6);_0x21146e(null);};}for(var e in events){if(events[_0x760e('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x760e('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 20996bd..be76708 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 _0x165f=['bluebird','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash','../../config/logger','moment'];(function(_0x467cec,_0x47b1af){var _0xea5dbd=function(_0xe0eeb9){while(--_0xe0eeb9){_0x467cec['push'](_0x467cec['shift']());}};_0xea5dbd(++_0x47b1af);}(_0x165f,0x6b));var _0xf165=function(_0x27b283,_0x5505bf){_0x27b283=_0x27b283-0x0;var _0xcacb64=_0x165f[_0x27b283];return _0xcacb64;};'use strict';var _=require(_0xf165('0x0'));var util=require('util');var logger=require(_0xf165('0x1'))('api');var moment=require(_0xf165('0x2'));var BPromise=require(_0xf165('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf165('0x4'));var rimraf=require(_0xf165('0x5'));var config=require(_0xf165('0x6'));var attributes=require(_0xf165('0x7'));module['exports']=function(_0x413e24,_0x1764ae){return _0x413e24[_0xf165('0x8')](_0xf165('0x9'),attributes,{'tableName':_0xf165('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf78b=['dashboards','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./dashboard.attributes','exports','define','Dashboard'];(function(_0x6625d6,_0x30e596){var _0x1c656e=function(_0x20d6ea){while(--_0x20d6ea){_0x6625d6['push'](_0x6625d6['shift']());}};_0x1c656e(++_0x30e596);}(_0xf78b,0x6d));var _0xbf78=function(_0x7413b2,_0x11ede8){_0x7413b2=_0x7413b2-0x0;var _0xceb691=_0xf78b[_0x7413b2];return _0xceb691;};'use strict';var _=require(_0xbf78('0x0'));var util=require(_0xbf78('0x1'));var logger=require(_0xbf78('0x2'))('api');var moment=require(_0xbf78('0x3'));var BPromise=require(_0xbf78('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf78('0x5'));var rimraf=require(_0xbf78('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf78('0x7'));module[_0xbf78('0x8')]=function(_0xaceaeb,_0x1217e4){return _0xaceaeb[_0xbf78('0x9')](_0xbf78('0xa'),attributes,{'tableName':_0xbf78('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 9a7a831..7d4835f 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 _0x9e63=['./dashboard.socket','register','request','info','request\x20sent','debug','error','code','Dashboard,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x48fddb,_0x37a2d3){var _0x22dad1=function(_0x4d32d6){while(--_0x4d32d6){_0x48fddb['push'](_0x48fddb['shift']());}};_0x22dad1(++_0x37a2d3);}(_0x9e63,0xec));var _0x39e6=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x9e63[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x39e6('0x0'));var util=require(_0x39e6('0x1'));var moment=require(_0x39e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x39e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39e6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x39e6('0x5'))('rpc');var config=require(_0x39e6('0x6'));var jayson=require(_0x39e6('0x7'));var client=jayson[_0x39e6('0x8')][_0x39e6('0x9')]({'port':0x232a});config[_0x39e6('0xa')]=_[_0x39e6('0xb')](config[_0x39e6('0xa')],{'host':_0x39e6('0xc'),'port':0x18eb});var socket=require(_0x39e6('0xd'))(new Redis(config[_0x39e6('0xa')]));require(_0x39e6('0xe'))[_0x39e6('0xf')](socket);function respondWithRpcPromise(_0x22aa11,_0x46fb0d,_0x451640){return new BPromise(function(_0x2f6417,_0xa2f8fa){return client[_0x39e6('0x10')](_0x22aa11,_0x451640)['then'](function(_0x46e6f0){logger[_0x39e6('0x11')]('Dashboard,\x20%s,\x20%s',_0x46fb0d,_0x39e6('0x12'));logger[_0x39e6('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x46fb0d,_0x39e6('0x12'),JSON['stringify'](_0x46e6f0));if(_0x46e6f0[_0x39e6('0x14')]){if(_0x46e6f0[_0x39e6('0x14')][_0x39e6('0x15')]===0x1f4){logger['error'](_0x39e6('0x16'),_0x46fb0d,_0x46e6f0['error']['message']);return _0xa2f8fa(_0x46e6f0[_0x39e6('0x14')]['message']);}logger['error'](_0x39e6('0x16'),_0x46fb0d,_0x46e6f0['error']['message']);return _0x2f6417(_0x46e6f0[_0x39e6('0x14')][_0x39e6('0x17')]);}else{logger[_0x39e6('0x11')]('Dashboard,\x20%s,\x20%s',_0x46fb0d,_0x39e6('0x12'));_0x2f6417(_0x46e6f0['result'][_0x39e6('0x17')]);}})[_0x39e6('0x18')](function(_0x443e3f){logger[_0x39e6('0x14')]('Dashboard,\x20%s,\x20%s',_0x46fb0d,_0x443e3f);_0xa2f8fa(_0x443e3f);});});} \ No newline at end of file +var _0x4099=['request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4099,0xb7));var _0x9409=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0x4099[_0x3e531a];return _0x3c2574;};'use strict';var _=require('lodash');var util=require(_0x9409('0x0'));var moment=require(_0x9409('0x1'));var BPromise=require(_0x9409('0x2'));var rs=require(_0x9409('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9409('0x4'))(_0x9409('0x5'));var config=require(_0x9409('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9409('0x7')][_0x9409('0x8')]({'port':0x232a});config[_0x9409('0x9')]=_[_0x9409('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9409('0xb'))(new Redis(config[_0x9409('0x9')]));require('./dashboard.socket')[_0x9409('0xc')](socket);function respondWithRpcPromise(_0x388e7e,_0x58c52e,_0xf85241){return new BPromise(function(_0x426be9,_0x1f1b39){return client[_0x9409('0xd')](_0x388e7e,_0xf85241)[_0x9409('0xe')](function(_0x408f2d){logger[_0x9409('0xf')](_0x9409('0x10'),_0x58c52e,_0x9409('0x11'));logger[_0x9409('0x12')](_0x9409('0x13'),_0x58c52e,_0x9409('0x11'),JSON[_0x9409('0x14')](_0x408f2d));if(_0x408f2d['error']){if(_0x408f2d[_0x9409('0x15')]['code']===0x1f4){logger[_0x9409('0x15')]('Dashboard,\x20%s,\x20%s',_0x58c52e,_0x408f2d[_0x9409('0x15')][_0x9409('0x16')]);return _0x1f1b39(_0x408f2d['error'][_0x9409('0x16')]);}logger[_0x9409('0x15')](_0x9409('0x10'),_0x58c52e,_0x408f2d['error'][_0x9409('0x16')]);return _0x426be9(_0x408f2d[_0x9409('0x15')][_0x9409('0x16')]);}else{logger['info'](_0x9409('0x10'),_0x58c52e,_0x9409('0x11'));_0x426be9(_0x408f2d[_0x9409('0x17')]['message']);}})[_0x9409('0x18')](function(_0x15fae9){logger[_0x9409('0x15')](_0x9409('0x10'),_0x58c52e,_0x15fae9);_0x1f1b39(_0x15fae9);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 3eb4a7f..c9b8600 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 _0x55f9=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener','register','length'];(function(_0x8980,_0x3e943b){var _0x3491a6=function(_0x1acbf3){while(--_0x1acbf3){_0x8980['push'](_0x8980['shift']());}};_0x3491a6(++_0x3e943b);}(_0x55f9,0xa3));var _0x955f=function(_0x5a2e46,_0x3b4094){_0x5a2e46=_0x5a2e46-0x0;var _0x33bdbf=_0x55f9[_0x5a2e46];return _0x33bdbf;};'use strict';var DashboardEvents=require(_0x955f('0x0'));var events=[_0x955f('0x1'),_0x955f('0x2'),_0x955f('0x3')];function createListener(_0x100857,_0x15f2c1){return function(_0x26560f){_0x15f2c1[_0x955f('0x4')](_0x100857,_0x26560f);};}function removeListener(_0x1cab26,_0x10b31a){return function(){DashboardEvents[_0x955f('0x5')](_0x1cab26,_0x10b31a);};}exports[_0x955f('0x6')]=function(_0x237bf7){for(var _0x1305d1=0x0,_0x480037=events[_0x955f('0x7')];_0x1305d1<_0x480037;_0x1305d1++){var _0xf813a8=events[_0x1305d1];var _0x19777c=createListener(_0x955f('0x8')+_0xf813a8,_0x237bf7);DashboardEvents['on'](_0xf813a8,_0x19777c);}}; \ No newline at end of file +var _0x0458=['save','update','emit','removeListener','register','./dashboard.events'];(function(_0x43d46c,_0x1a5979){var _0x30b335=function(_0x30968e){while(--_0x30968e){_0x43d46c['push'](_0x43d46c['shift']());}};_0x30b335(++_0x1a5979);}(_0x0458,0x14f));var _0x8045=function(_0x10d4e4,_0x1bb225){_0x10d4e4=_0x10d4e4-0x0;var _0x480ed1=_0x0458[_0x10d4e4];return _0x480ed1;};'use strict';var DashboardEvents=require(_0x8045('0x0'));var events=[_0x8045('0x1'),'remove',_0x8045('0x2')];function createListener(_0xf0b664,_0x2c200b){return function(_0x1afb90){_0x2c200b[_0x8045('0x3')](_0xf0b664,_0x1afb90);};}function removeListener(_0x3db703,_0x5e6f29){return function(){DashboardEvents[_0x8045('0x4')](_0x3db703,_0x5e6f29);};}exports[_0x8045('0x5')]=function(_0x265d05){for(var _0x42bca6=0x0,_0x1032d2=events['length'];_0x42bca6<_0x1032d2;_0x42bca6++){var _0x1590a6=events[_0x42bca6];var _0x77e4b=createListener('dashboard:'+_0x1590a6,_0x265d05);DashboardEvents['on'](_0x1590a6,_0x77e4b);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index abdaf1a..725cce5 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 _0x83dc=['path','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','create','post','/:id/items','addItem','put','update','delete','destroy','exports','multer'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x83dc,0x97));var _0xc83d=function(_0x22062d,_0x4a7dcd){_0x22062d=_0x22062d-0x0;var _0x173a35=_0x83dc[_0x22062d];return _0x173a35;};'use strict';var multer=require(_0xc83d('0x0'));var util=require('util');var path=require(_0xc83d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc83d('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc83d('0x3'));var config=require(_0xc83d('0x4'));var controller=require(_0xc83d('0x5'));router[_0xc83d('0x6')]('/',auth[_0xc83d('0x7')](),controller[_0xc83d('0x8')]);router[_0xc83d('0x6')](_0xc83d('0x9'),auth[_0xc83d('0x7')](),controller['show']);router['get']('/:id/items',auth['isAuthenticated'](),controller['getItems']);router['post']('/',auth['isAuthenticated'](),controller[_0xc83d('0xa')]);router['post']('/:id/clone',auth[_0xc83d('0x7')](),controller['clone']);router[_0xc83d('0xb')](_0xc83d('0xc'),auth[_0xc83d('0x7')](),controller[_0xc83d('0xd')]);router[_0xc83d('0xe')](_0xc83d('0x9'),auth[_0xc83d('0x7')](),controller[_0xc83d('0xf')]);router[_0xc83d('0x10')](_0xc83d('0x9'),auth[_0xc83d('0x7')](),controller[_0xc83d('0x11')]);module[_0xc83d('0x12')]=router; \ No newline at end of file +var _0xd12f=['addItem','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','getItems','create','post','/:id/clone','clone','/:id/items'];(function(_0x22433e,_0xfef270){var _0x46ecab=function(_0x38cedb){while(--_0x38cedb){_0x22433e['push'](_0x22433e['shift']());}};_0x46ecab(++_0xfef270);}(_0xd12f,0x1d2));var _0xfd12=function(_0x7c596,_0x2bf61f){_0x7c596=_0x7c596-0x0;var _0x427fc0=_0xd12f[_0x7c596];return _0x427fc0;};'use strict';var multer=require(_0xfd12('0x0'));var util=require(_0xfd12('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfd12('0x2'));var router=express[_0xfd12('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfd12('0x4'));var interaction=require(_0xfd12('0x5'));var config=require(_0xfd12('0x6'));var controller=require(_0xfd12('0x7'));router[_0xfd12('0x8')]('/',auth[_0xfd12('0x9')](),controller[_0xfd12('0xa')]);router[_0xfd12('0x8')](_0xfd12('0xb'),auth[_0xfd12('0x9')](),controller['show']);router[_0xfd12('0x8')]('/:id/items',auth[_0xfd12('0x9')](),controller[_0xfd12('0xc')]);router['post']('/',auth[_0xfd12('0x9')](),controller[_0xfd12('0xd')]);router[_0xfd12('0xe')](_0xfd12('0xf'),auth[_0xfd12('0x9')](),controller[_0xfd12('0x10')]);router[_0xfd12('0xe')](_0xfd12('0x11'),auth[_0xfd12('0x9')](),controller[_0xfd12('0x12')]);router['put'](_0xfd12('0xb'),auth[_0xfd12('0x9')](),controller['update']);router[_0xfd12('0x13')](_0xfd12('0xb'),auth[_0xfd12('0x9')](),controller[_0xfd12('0x14')]);module[_0xfd12('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 703a3d0..1da7b9f 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 _0x2675=['parse','attrs','setDataValue','stringify','INTEGER','sequelize','STRING','long'];(function(_0x2663a7,_0x164a83){var _0x8f02cd=function(_0x119e42){while(--_0x119e42){_0x2663a7['push'](_0x2663a7['shift']());}};_0x8f02cd(++_0x164a83);}(_0x2675,0x75));var _0x5267=function(_0x41c3d5,_0x1ae06e){_0x41c3d5=_0x41c3d5-0x0;var _0x347671=_0x2675[_0x41c3d5];return _0x347671;};'use strict';var Sequelize=require(_0x5267('0x0'));var squel=require('squel');var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x5267('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5267('0x1')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x5267('0x2')),'get':function(){try{return JSON[_0x5267('0x3')](this['getDataValue'](_0x5267('0x4')));}catch(_0xf2b350){return[];}},'set':function(_0x4bd042){try{this[_0x5267('0x5')](_0x5267('0x4'),JSON[_0x5267('0x6')](_0x4bd042));}catch(_0x527c16){this[_0x5267('0x5')](_0x5267('0x4'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x5267('0x7')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5267('0x7')]},'col':{'type':Sequelize[_0x5267('0x7')]},'background':{'type':Sequelize[_0x5267('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5267('0x1')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5267('0x1')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x2bd8=['TEXT','long','parse','attrs','stringify','setDataValue','INTEGER','sequelize','lodash','exports','STRING'];(function(_0xcb3b26,_0x1525e2){var _0x5cad2d=function(_0xd8f565){while(--_0xd8f565){_0xcb3b26['push'](_0xcb3b26['shift']());}};_0x5cad2d(++_0x1525e2);}(_0x2bd8,0x130));var _0x82bd=function(_0x2a0ff4,_0x36df38){_0x2a0ff4=_0x2a0ff4-0x0;var _0x51b42c=_0x2bd8[_0x2a0ff4];return _0x51b42c;};'use strict';var Sequelize=require(_0x82bd('0x0'));var squel=require('squel');var _=require(_0x82bd('0x1'));module[_0x82bd('0x2')]={'title':{'type':Sequelize[_0x82bd('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x82bd('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x82bd('0x4')](_0x82bd('0x5')),'get':function(){try{return JSON[_0x82bd('0x6')](this['getDataValue'](_0x82bd('0x7')));}catch(_0x2e1a98){return[];}},'set':function(_0x3bf810){try{this['setDataValue'](_0x82bd('0x7'),JSON[_0x82bd('0x8')](_0x3bf810));}catch(_0x226f60){this[_0x82bd('0x9')]('attrs',JSON[_0x82bd('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x82bd('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x82bd('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x82bd('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 8806f54..b924609 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 _0x9bb8=['attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','pie-chart','total','attrSerie3','attrChatWebsites','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','intersection','attributes','fields','length','includeAll','include','merge','options','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts'];(function(_0x3bab18,_0x53d735){var _0x12585f=function(_0x6cb5c4){while(--_0x6cb5c4){_0x3bab18['push'](_0x3bab18['shift']());}};_0x12585f(++_0x53d735);}(_0x9bb8,0x1ae));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x89bb('0x0'));var rimraf=require(_0x89bb('0x1'));var zipdir=require(_0x89bb('0x2'));var jsonpatch=require(_0x89bb('0x3'));var rp=require(_0x89bb('0x4'));var moment=require(_0x89bb('0x5'));var BPromise=require(_0x89bb('0x6'));var Mustache=require(_0x89bb('0x7'));var util=require(_0x89bb('0x8'));var path=require(_0x89bb('0x9'));var sox=require(_0x89bb('0xa'));var csv=require(_0x89bb('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x89bb('0xc'));var _=require(_0x89bb('0xd'));var squel=require(_0x89bb('0xe'));var crypto=require(_0x89bb('0xf'));var jsforce=require(_0x89bb('0x10'));var deskjs=require(_0x89bb('0x11'));var toCsv=require('to-csv');var querystring=require(_0x89bb('0x12'));var Papa=require(_0x89bb('0x13'));var Redis=require('ioredis');var authService=require(_0x89bb('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x89bb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x89bb('0x16'))('api');var utils=require(_0x89bb('0x17'));var config=require(_0x89bb('0x18'));var licenseUtil=require(_0x89bb('0x19'));var db=require(_0x89bb('0x1a'))['db'];config['redis']=_[_0x89bb('0x1b')](config[_0x89bb('0x1c')],{'host':_0x89bb('0x1d'),'port':0x18eb});var socket=require(_0x89bb('0x1e'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x89bb('0x1f')](socket);function respondWithStatusCode(_0x2de474,_0x25cbb9){_0x25cbb9=_0x25cbb9||0xcc;return function(_0x228056){if(_0x228056){return _0x2de474[_0x89bb('0x20')](_0x25cbb9);}return _0x2de474[_0x89bb('0x21')](_0x25cbb9)['end']();};}function respondWithResult(_0x8b96d,_0x14def2){_0x14def2=_0x14def2||0xc8;return function(_0x5a45c8){if(_0x5a45c8){return _0x8b96d[_0x89bb('0x21')](_0x14def2)[_0x89bb('0x22')](_0x5a45c8);}};}function respondWithFilteredResult(_0x1ff3b5,_0x39fac5){return function(_0x310e3d){if(_0x310e3d){var _0x58f826=typeof _0x39fac5[_0x89bb('0x23')]===_0x89bb('0x24')&&typeof _0x39fac5[_0x89bb('0x25')]===_0x89bb('0x24');var _0x6dd873=_0x310e3d[_0x89bb('0x26')];var _0x41880f=_0x58f826?0x0:_0x39fac5[_0x89bb('0x23')];var _0x239657=_0x58f826?_0x310e3d[_0x89bb('0x26')]:_0x39fac5['offset']+_0x39fac5[_0x89bb('0x25')];var _0x3b8dc4;if(_0x239657>=_0x6dd873){_0x239657=_0x6dd873;_0x3b8dc4=0xc8;}else{_0x3b8dc4=0xce;}_0x1ff3b5[_0x89bb('0x21')](_0x3b8dc4);return _0x1ff3b5[_0x89bb('0x27')](_0x89bb('0x28'),_0x41880f+'-'+_0x239657+'/'+_0x6dd873)[_0x89bb('0x22')](_0x310e3d);}return null;};}function patchUpdates(_0x4f2f49){return function(_0x38d1f7){try{jsonpatch[_0x89bb('0x29')](_0x38d1f7,_0x4f2f49,!![]);}catch(_0x3e6f3d){return BPromise[_0x89bb('0x2a')](_0x3e6f3d);}return _0x38d1f7[_0x89bb('0x2b')]();};}function saveUpdates(_0x7fec2c,_0x141e70){return function(_0x308726){if(_0x308726){return _0x308726[_0x89bb('0x2c')](_0x7fec2c)[_0x89bb('0x2d')](function(_0x4c25f6){return _0x4c25f6;});}return null;};}function removeEntity(_0x59fac8,_0x22ef81){return function(_0x1597b2){if(_0x1597b2){return _0x1597b2[_0x89bb('0x2e')]()[_0x89bb('0x2d')](function(){_0x59fac8[_0x89bb('0x21')](0xcc)[_0x89bb('0x2f')]();});}};}function handleEntityNotFound(_0x5082af,_0x8ef56d){return function(_0x34b852){if(!_0x34b852){_0x5082af[_0x89bb('0x20')](0x194);}return _0x34b852;};}function handleError(_0x372103,_0x26403f){_0x26403f=_0x26403f||0x1f4;return function(_0x4fc489){logger[_0x89bb('0x30')](_0x4fc489[_0x89bb('0x31')]);if(_0x4fc489[_0x89bb('0x32')]){delete _0x4fc489['name'];}_0x372103[_0x89bb('0x21')](_0x26403f)[_0x89bb('0x33')](_0x4fc489);};}exports[_0x89bb('0x34')]=function(_0x1f2a2e,_0x56284d){var _0x40c0d2={'raw':![],'where':{'id':_0x1f2a2e[_0x89bb('0x35')]['id']}},_0x577515={};_0x577515[_0x89bb('0x36')]=_['keys'](db[_0x89bb('0x37')][_0x89bb('0x38')]);_0x577515[_0x89bb('0x39')]=_[_0x89bb('0x3a')](_0x1f2a2e[_0x89bb('0x39')]);_0x577515['filters']=_[_0x89bb('0x3b')](_0x577515[_0x89bb('0x36')],_0x577515[_0x89bb('0x39')]);_0x40c0d2[_0x89bb('0x3c')]=_['intersection'](_0x577515[_0x89bb('0x36')],qs[_0x89bb('0x3d')](_0x1f2a2e[_0x89bb('0x39')]['fields']));_0x40c0d2[_0x89bb('0x3c')]=_0x40c0d2[_0x89bb('0x3c')][_0x89bb('0x3e')]?_0x40c0d2[_0x89bb('0x3c')]:_0x577515[_0x89bb('0x36')];if(_0x1f2a2e[_0x89bb('0x39')][_0x89bb('0x3f')]){_0x40c0d2[_0x89bb('0x40')]=[{'all':!![]}];}_0x40c0d2=_[_0x89bb('0x41')]({},_0x40c0d2,_0x1f2a2e[_0x89bb('0x42')]);return db[_0x89bb('0x37')]['find'](_0x40c0d2)[_0x89bb('0x2d')](handleEntityNotFound(_0x56284d,null))[_0x89bb('0x2d')](respondWithResult(_0x56284d,null))['catch'](handleError(_0x56284d,null));};exports[_0x89bb('0x2e')]=function(_0x1c6f7f,_0x5761b3){return db['DashboardItem']['find']({'where':{'id':_0x1c6f7f[_0x89bb('0x35')]['id']}})['then'](handleEntityNotFound(_0x5761b3,null))['then'](removeEntity(_0x5761b3,null))['catch'](handleError(_0x5761b3,null));};function widgetAttributes(_0x3a75e1){try{switch(_0x3a75e1[_0x89bb('0x43')]){case _0x89bb('0x44'):return[{'name':'attrUrl','value':_0x3a75e1[_0x89bb('0x45')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x0]?_0x3a75e1[_0x89bb('0x46')][0x0][_0x89bb('0x47')]:undefined)||_0x89bb('0x48')}];case'custom':return[{'name':_0x89bb('0x49'),'value':_0x3a75e1[_0x89bb('0x49')]||(_0x3a75e1['attrs']&&_0x3a75e1[_0x89bb('0x46')][0x0]?_0x3a75e1[_0x89bb('0x46')][0x0][_0x89bb('0x47')]:undefined)||''}];case _0x89bb('0x4a'):return[{'name':_0x89bb('0x4b'),'value':_0x3a75e1[_0x89bb('0x4b')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x0]?_0x3a75e1[_0x89bb('0x46')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x89bb('0x4c'),'value':_0x3a75e1[_0x89bb('0x4c')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x1]?_0x3a75e1[_0x89bb('0x46')][0x1]['value']:undefined)||_0x89bb('0x4d')},{'name':_0x89bb('0x4e'),'value':_0x3a75e1[_0x89bb('0x4e')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x2]?_0x3a75e1['attrs'][0x2]['value']:undefined)||0xc}];case _0x89bb('0x4f'):return[{'name':_0x89bb('0x50'),'value':_0x3a75e1[_0x89bb('0x50')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x0]?_0x3a75e1[_0x89bb('0x46')][0x0][_0x89bb('0x47')]:undefined)||'total'},{'name':_0x89bb('0x51'),'value':_0x3a75e1['attrVoiceQueues']||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x1]?_0x3a75e1[_0x89bb('0x46')][0x1][_0x89bb('0x47')]:undefined)||[]},{'name':_0x89bb('0x4e'),'value':_0x3a75e1[_0x89bb('0x4e')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x2]?_0x3a75e1[_0x89bb('0x46')][0x2]['value']:undefined)||0x14},{'name':_0x89bb('0x52'),'value':_0x3a75e1[_0x89bb('0x52')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x3]?_0x3a75e1['attrs'][0x3]['value']:undefined)||_0x89bb('0x53')},{'name':'attrEmailAccounts','value':_0x3a75e1[_0x89bb('0x54')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x4]?_0x3a75e1[_0x89bb('0x46')][0x4]['value']:undefined)||''},{'name':_0x89bb('0x55'),'value':_0x3a75e1[_0x89bb('0x55')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x5]?_0x3a75e1[_0x89bb('0x46')][0x5][_0x89bb('0x47')]:undefined)||''},{'name':_0x89bb('0x56'),'value':_0x3a75e1[_0x89bb('0x56')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1['attrs'][0x6]?_0x3a75e1[_0x89bb('0x46')][0x6][_0x89bb('0x47')]:undefined)||''},{'name':_0x89bb('0x57'),'value':_0x3a75e1['attrOpenchannelAccounts']||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x7]?_0x3a75e1['attrs'][0x7][_0x89bb('0x47')]:undefined)||''},{'name':_0x89bb('0x58'),'value':_0x3a75e1[_0x89bb('0x58')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x8]?_0x3a75e1[_0x89bb('0x46')][0x8][_0x89bb('0x47')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3a75e1['attrChatWebsites']||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x9]?_0x3a75e1['attrs'][0x9][_0x89bb('0x47')]:undefined)||''}];case'multibar-chart':case _0x89bb('0x59'):return[{'name':'attrSerie1','value':_0x3a75e1['attrSerie1']||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x0]?_0x3a75e1['attrs'][0x0][_0x89bb('0x47')]:undefined)||_0x89bb('0x5a')},{'name':'attrSerie2','value':_0x3a75e1['attrSerie2']||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x1]?_0x3a75e1[_0x89bb('0x46')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x3a75e1[_0x89bb('0x5b')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x2]?_0x3a75e1[_0x89bb('0x46')][0x2][_0x89bb('0x47')]:undefined)||null},{'name':_0x89bb('0x51'),'value':_0x3a75e1[_0x89bb('0x51')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1['attrs'][0x3]?_0x3a75e1[_0x89bb('0x46')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x3a75e1[_0x89bb('0x52')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x4]?_0x3a75e1[_0x89bb('0x46')][0x4]['value']:undefined)||'voice'},{'name':_0x89bb('0x54'),'value':_0x3a75e1[_0x89bb('0x54')]||(_0x3a75e1['attrs']&&_0x3a75e1[_0x89bb('0x46')][0x5]?_0x3a75e1[_0x89bb('0x46')][0x5]['value']:undefined)||''},{'name':_0x89bb('0x55'),'value':_0x3a75e1['attrFaxAccounts']||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x6]?_0x3a75e1['attrs'][0x6][_0x89bb('0x47')]:undefined)||''},{'name':_0x89bb('0x56'),'value':_0x3a75e1[_0x89bb('0x56')]||(_0x3a75e1['attrs']&&_0x3a75e1['attrs'][0x7]?_0x3a75e1[_0x89bb('0x46')][0x7]['value']:undefined)||''},{'name':_0x89bb('0x57'),'value':_0x3a75e1[_0x89bb('0x57')]||(_0x3a75e1['attrs']&&_0x3a75e1[_0x89bb('0x46')][0x8]?_0x3a75e1[_0x89bb('0x46')][0x8]['value']:undefined)||''},{'name':_0x89bb('0x58'),'value':_0x3a75e1[_0x89bb('0x58')]||(_0x3a75e1['attrs']&&_0x3a75e1['attrs'][0x9]?_0x3a75e1[_0x89bb('0x46')][0x9][_0x89bb('0x47')]:undefined)||''},{'name':_0x89bb('0x5c'),'value':_0x3a75e1[_0x89bb('0x5c')]||(_0x3a75e1['attrs']&&_0x3a75e1[_0x89bb('0x46')][0xa]?_0x3a75e1[_0x89bb('0x46')][0xa][_0x89bb('0x47')]:undefined)||''}];case _0x89bb('0x5d'):return[{'name':_0x89bb('0x5e'),'type':_0x3a75e1[_0x89bb('0x5f')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1['attrs'][0x0]?_0x3a75e1[_0x89bb('0x46')][0x0][_0x89bb('0x43')]:undefined)||null,'value':_0x3a75e1[_0x89bb('0x5e')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1['attrs'][0x0]?_0x3a75e1['attrs'][0x0][_0x89bb('0x47')]:undefined)||null},{'name':'attrRefresh','value':_0x3a75e1[_0x89bb('0x60')]||(_0x3a75e1['attrs']&&_0x3a75e1[_0x89bb('0x46')][0x1]?_0x3a75e1[_0x89bb('0x46')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1529a8){logger[_0x89bb('0x30')](_0x89bb('0x61'),JSON[_0x89bb('0x62')](_0x1529a8));return[];}}exports[_0x89bb('0x63')]=function(_0x2a186e,_0x110345){if(_0x2a186e[_0x89bb('0x64')]){_0x2a186e[_0x89bb('0x64')][_0x89bb('0x46')]=widgetAttributes(_0x2a186e[_0x89bb('0x64')]);}return db[_0x89bb('0x37')][_0x89bb('0x63')](_0x2a186e[_0x89bb('0x64')],{})[_0x89bb('0x2d')](respondWithResult(_0x110345,0xc9))[_0x89bb('0x65')](handleError(_0x110345,null));};exports['update']=function(_0x2e3373,_0x3a5187){if(_0x2e3373[_0x89bb('0x64')]['id']){delete _0x2e3373[_0x89bb('0x64')]['id'];}_0x2e3373[_0x89bb('0x64')][_0x89bb('0x46')]=widgetAttributes(_0x2e3373[_0x89bb('0x64')]);return db[_0x89bb('0x37')][_0x89bb('0x66')]({'where':{'id':_0x2e3373[_0x89bb('0x35')]['id']}})['then'](handleEntityNotFound(_0x3a5187,null))[_0x89bb('0x2d')](saveUpdates(_0x2e3373[_0x89bb('0x64')],null))[_0x89bb('0x2d')](respondWithResult(_0x3a5187,null))[_0x89bb('0x65')](handleError(_0x3a5187,null));}; \ No newline at end of file +var _0xfcbe=['then','destroy','end','sendStatus','error','stack','name','send','params','model','keys','query','filters','intersection','attributes','length','includeAll','include','merge','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update'];(function(_0xabec92,_0x4e077a){var _0x376c76=function(_0xc60252){while(--_0xc60252){_0xabec92['push'](_0xabec92['shift']());}};_0x376c76(++_0x4e077a);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x335520,_0x2f2d5d){_0x335520=_0x335520-0x0;var _0x38b057=_0xfcbe[_0x335520];return _0x38b057;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefcb('0x0'));var zipdir=require(_0xefcb('0x1'));var jsonpatch=require(_0xefcb('0x2'));var rp=require(_0xefcb('0x3'));var moment=require(_0xefcb('0x4'));var BPromise=require(_0xefcb('0x5'));var Mustache=require('mustache');var util=require(_0xefcb('0x6'));var path=require(_0xefcb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xefcb('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xefcb('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xefcb('0xa'));var toCsv=require(_0xefcb('0xb'));var querystring=require(_0xefcb('0xc'));var Papa=require('papaparse');var Redis=require(_0xefcb('0xd'));var authService=require(_0xefcb('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefcb('0xf'));var logger=require(_0xefcb('0x10'))(_0xefcb('0x11'));var utils=require(_0xefcb('0x12'));var config=require(_0xefcb('0x13'));var licenseUtil=require(_0xefcb('0x14'));var db=require('../../mysqldb')['db'];config[_0xefcb('0x15')]=_[_0xefcb('0x16')](config[_0xefcb('0x15')],{'host':_0xefcb('0x17'),'port':0x18eb});var socket=require(_0xefcb('0x18'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0xefcb('0x19')](socket);function respondWithStatusCode(_0xd13e37,_0x586dce){_0x586dce=_0x586dce||0xcc;return function(_0x26f660){if(_0x26f660){return _0xd13e37['sendStatus'](_0x586dce);}return _0xd13e37[_0xefcb('0x1a')](_0x586dce)['end']();};}function respondWithResult(_0x172816,_0x46a22a){_0x46a22a=_0x46a22a||0xc8;return function(_0x440e20){if(_0x440e20){return _0x172816[_0xefcb('0x1a')](_0x46a22a)[_0xefcb('0x1b')](_0x440e20);}};}function respondWithFilteredResult(_0x13d883,_0x5e5c6c){return function(_0x15fbec){if(_0x15fbec){var _0x8de41a=typeof _0x5e5c6c[_0xefcb('0x1c')]===_0xefcb('0x1d')&&typeof _0x5e5c6c[_0xefcb('0x1e')]===_0xefcb('0x1d');var _0x3a3ffe=_0x15fbec['count'];var _0x39ab04=_0x8de41a?0x0:_0x5e5c6c[_0xefcb('0x1c')];var _0x5695b4=_0x8de41a?_0x15fbec[_0xefcb('0x1f')]:_0x5e5c6c[_0xefcb('0x1c')]+_0x5e5c6c[_0xefcb('0x1e')];var _0x2b0be0;if(_0x5695b4>=_0x3a3ffe){_0x5695b4=_0x3a3ffe;_0x2b0be0=0xc8;}else{_0x2b0be0=0xce;}_0x13d883[_0xefcb('0x1a')](_0x2b0be0);return _0x13d883['set'](_0xefcb('0x20'),_0x39ab04+'-'+_0x5695b4+'/'+_0x3a3ffe)[_0xefcb('0x1b')](_0x15fbec);}return null;};}function patchUpdates(_0x2ab79d){return function(_0x2444cf){try{jsonpatch[_0xefcb('0x21')](_0x2444cf,_0x2ab79d,!![]);}catch(_0x345629){return BPromise[_0xefcb('0x22')](_0x345629);}return _0x2444cf[_0xefcb('0x23')]();};}function saveUpdates(_0x52e7dd,_0x5844e2){return function(_0x5991c6){if(_0x5991c6){return _0x5991c6[_0xefcb('0x24')](_0x52e7dd)[_0xefcb('0x25')](function(_0x457ff6){return _0x457ff6;});}return null;};}function removeEntity(_0x1717b7,_0x20f51f){return function(_0x2285a3){if(_0x2285a3){return _0x2285a3[_0xefcb('0x26')]()['then'](function(){_0x1717b7[_0xefcb('0x1a')](0xcc)[_0xefcb('0x27')]();});}};}function handleEntityNotFound(_0xa42610,_0x11286f){return function(_0x18f4ef){if(!_0x18f4ef){_0xa42610[_0xefcb('0x28')](0x194);}return _0x18f4ef;};}function handleError(_0x16757b,_0x36521c){_0x36521c=_0x36521c||0x1f4;return function(_0x1c7ee1){logger[_0xefcb('0x29')](_0x1c7ee1[_0xefcb('0x2a')]);if(_0x1c7ee1[_0xefcb('0x2b')]){delete _0x1c7ee1[_0xefcb('0x2b')];}_0x16757b[_0xefcb('0x1a')](_0x36521c)[_0xefcb('0x2c')](_0x1c7ee1);};}exports['show']=function(_0x221f55,_0x3995cc){var _0x296427={'raw':![],'where':{'id':_0x221f55[_0xefcb('0x2d')]['id']}},_0x232d45={};_0x232d45[_0xefcb('0x2e')]=_[_0xefcb('0x2f')](db['DashboardItem']['rawAttributes']);_0x232d45[_0xefcb('0x30')]=_[_0xefcb('0x2f')](_0x221f55['query']);_0x232d45[_0xefcb('0x31')]=_[_0xefcb('0x32')](_0x232d45[_0xefcb('0x2e')],_0x232d45['query']);_0x296427[_0xefcb('0x33')]=_[_0xefcb('0x32')](_0x232d45[_0xefcb('0x2e')],qs['fields'](_0x221f55['query']['fields']));_0x296427['attributes']=_0x296427[_0xefcb('0x33')][_0xefcb('0x34')]?_0x296427[_0xefcb('0x33')]:_0x232d45[_0xefcb('0x2e')];if(_0x221f55[_0xefcb('0x30')][_0xefcb('0x35')]){_0x296427[_0xefcb('0x36')]=[{'all':!![]}];}_0x296427=_[_0xefcb('0x37')]({},_0x296427,_0x221f55[_0xefcb('0x38')]);return db[_0xefcb('0x39')][_0xefcb('0x3a')](_0x296427)[_0xefcb('0x25')](handleEntityNotFound(_0x3995cc,null))[_0xefcb('0x25')](respondWithResult(_0x3995cc,null))[_0xefcb('0x3b')](handleError(_0x3995cc,null));};exports[_0xefcb('0x26')]=function(_0x102933,_0x4b2a43){return db[_0xefcb('0x39')][_0xefcb('0x3a')]({'where':{'id':_0x102933[_0xefcb('0x2d')]['id']}})[_0xefcb('0x25')](handleEntityNotFound(_0x4b2a43,null))['then'](removeEntity(_0x4b2a43,null))[_0xefcb('0x3b')](handleError(_0x4b2a43,null));};function widgetAttributes(_0x5e5b5a){try{switch(_0x5e5b5a[_0xefcb('0x3c')]){case _0xefcb('0x3d'):return[{'name':_0xefcb('0x3e'),'value':_0x5e5b5a[_0xefcb('0x3e')]||(_0x5e5b5a['attrs']&&_0x5e5b5a[_0xefcb('0x3f')][0x0]?_0x5e5b5a[_0xefcb('0x3f')][0x0][_0xefcb('0x40')]:undefined)||'https://'}];case _0xefcb('0x41'):return[{'name':_0xefcb('0x42'),'value':_0x5e5b5a[_0xefcb('0x42')]||(_0x5e5b5a['attrs']&&_0x5e5b5a['attrs'][0x0]?_0x5e5b5a[_0xefcb('0x3f')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0xefcb('0x43'),'value':_0x5e5b5a[_0xefcb('0x43')]||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a['attrs'][0x0]?_0x5e5b5a['attrs'][0x0]['value']:undefined)||_0xefcb('0x44')},{'name':_0xefcb('0x45'),'value':_0x5e5b5a['attrTimezone']||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a['attrs'][0x1]?_0x5e5b5a[_0xefcb('0x3f')][0x1][_0xefcb('0x40')]:undefined)||_0xefcb('0x46')},{'name':_0xefcb('0x47'),'value':_0x5e5b5a[_0xefcb('0x47')]||(_0x5e5b5a['attrs']&&_0x5e5b5a['attrs'][0x2]?_0x5e5b5a[_0xefcb('0x3f')][0x2][_0xefcb('0x40')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x5e5b5a['attrMetric']||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x0]?_0x5e5b5a['attrs'][0x0][_0xefcb('0x40')]:undefined)||'total'},{'name':_0xefcb('0x48'),'value':_0x5e5b5a[_0xefcb('0x48')]||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x1]?_0x5e5b5a[_0xefcb('0x3f')][0x1]['value']:undefined)||[]},{'name':_0xefcb('0x47'),'value':_0x5e5b5a['attrFontSize']||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a['attrs'][0x2]?_0x5e5b5a[_0xefcb('0x3f')][0x2]['value']:undefined)||0x14},{'name':_0xefcb('0x49'),'value':_0x5e5b5a['attrChannel']||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x3]?_0x5e5b5a[_0xefcb('0x3f')][0x3][_0xefcb('0x40')]:undefined)||_0xefcb('0x4a')},{'name':_0xefcb('0x4b'),'value':_0x5e5b5a['attrEmailAccounts']||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a['attrs'][0x4]?_0x5e5b5a[_0xefcb('0x3f')][0x4][_0xefcb('0x40')]:undefined)||''},{'name':_0xefcb('0x4c'),'value':_0x5e5b5a[_0xefcb('0x4c')]||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x5]?_0x5e5b5a['attrs'][0x5][_0xefcb('0x40')]:undefined)||''},{'name':_0xefcb('0x4d'),'value':_0x5e5b5a[_0xefcb('0x4d')]||(_0x5e5b5a['attrs']&&_0x5e5b5a['attrs'][0x6]?_0x5e5b5a[_0xefcb('0x3f')][0x6][_0xefcb('0x40')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x5e5b5a[_0xefcb('0x4e')]||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x7]?_0x5e5b5a[_0xefcb('0x3f')][0x7][_0xefcb('0x40')]:undefined)||''},{'name':_0xefcb('0x4f'),'value':_0x5e5b5a['attrWhatsappAccounts']||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x8]?_0x5e5b5a[_0xefcb('0x3f')][0x8][_0xefcb('0x40')]:undefined)||''},{'name':_0xefcb('0x50'),'value':_0x5e5b5a[_0xefcb('0x50')]||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a['attrs'][0x9]?_0x5e5b5a[_0xefcb('0x3f')][0x9][_0xefcb('0x40')]:undefined)||''}];case _0xefcb('0x51'):case _0xefcb('0x52'):return[{'name':_0xefcb('0x53'),'value':_0x5e5b5a[_0xefcb('0x53')]||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x0]?_0x5e5b5a[_0xefcb('0x3f')][0x0][_0xefcb('0x40')]:undefined)||_0xefcb('0x54')},{'name':_0xefcb('0x55'),'value':_0x5e5b5a[_0xefcb('0x55')]||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x1]?_0x5e5b5a[_0xefcb('0x3f')][0x1]['value']:undefined)||null},{'name':_0xefcb('0x56'),'value':_0x5e5b5a[_0xefcb('0x56')]||(_0x5e5b5a['attrs']&&_0x5e5b5a[_0xefcb('0x3f')][0x2]?_0x5e5b5a[_0xefcb('0x3f')][0x2][_0xefcb('0x40')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x5e5b5a['attrVoiceQueues']||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x3]?_0x5e5b5a[_0xefcb('0x3f')][0x3][_0xefcb('0x40')]:undefined)||[]},{'name':'attrChannel','value':_0x5e5b5a[_0xefcb('0x49')]||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x4]?_0x5e5b5a[_0xefcb('0x3f')][0x4][_0xefcb('0x40')]:undefined)||_0xefcb('0x4a')},{'name':_0xefcb('0x4b'),'value':_0x5e5b5a['attrEmailAccounts']||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x5]?_0x5e5b5a[_0xefcb('0x3f')][0x5][_0xefcb('0x40')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x5e5b5a[_0xefcb('0x4c')]||(_0x5e5b5a['attrs']&&_0x5e5b5a[_0xefcb('0x3f')][0x6]?_0x5e5b5a[_0xefcb('0x3f')][0x6][_0xefcb('0x40')]:undefined)||''},{'name':_0xefcb('0x4d'),'value':_0x5e5b5a[_0xefcb('0x4d')]||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a['attrs'][0x7]?_0x5e5b5a[_0xefcb('0x3f')][0x7][_0xefcb('0x40')]:undefined)||''},{'name':_0xefcb('0x4e'),'value':_0x5e5b5a[_0xefcb('0x4e')]||(_0x5e5b5a['attrs']&&_0x5e5b5a[_0xefcb('0x3f')][0x8]?_0x5e5b5a[_0xefcb('0x3f')][0x8][_0xefcb('0x40')]:undefined)||''},{'name':_0xefcb('0x4f'),'value':_0x5e5b5a['attrWhatsappAccounts']||(_0x5e5b5a['attrs']&&_0x5e5b5a[_0xefcb('0x3f')][0x9]?_0x5e5b5a[_0xefcb('0x3f')][0x9][_0xefcb('0x40')]:undefined)||''},{'name':_0xefcb('0x50'),'value':_0x5e5b5a[_0xefcb('0x50')]||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a['attrs'][0xa]?_0x5e5b5a[_0xefcb('0x3f')][0xa]['value']:undefined)||''}];case _0xefcb('0x57'):return[{'name':_0xefcb('0x58'),'type':_0x5e5b5a['reportType']||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x0]?_0x5e5b5a[_0xefcb('0x3f')][0x0]['type']:undefined)||null,'value':_0x5e5b5a[_0xefcb('0x58')]||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x0]?_0x5e5b5a[_0xefcb('0x3f')][0x0][_0xefcb('0x40')]:undefined)||null},{'name':_0xefcb('0x59'),'value':_0x5e5b5a[_0xefcb('0x59')]||(_0x5e5b5a[_0xefcb('0x3f')]&&_0x5e5b5a[_0xefcb('0x3f')][0x1]?_0x5e5b5a[_0xefcb('0x3f')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x18e5a3){logger[_0xefcb('0x29')](_0xefcb('0x5a'),JSON[_0xefcb('0x5b')](_0x18e5a3));return[];}}exports[_0xefcb('0x5c')]=function(_0x16a9f0,_0x10d516){if(_0x16a9f0[_0xefcb('0x5d')]){_0x16a9f0[_0xefcb('0x5d')]['attrs']=widgetAttributes(_0x16a9f0[_0xefcb('0x5d')]);}return db[_0xefcb('0x39')][_0xefcb('0x5c')](_0x16a9f0[_0xefcb('0x5d')],{})[_0xefcb('0x25')](respondWithResult(_0x10d516,0xc9))[_0xefcb('0x3b')](handleError(_0x10d516,null));};exports[_0xefcb('0x24')]=function(_0x49a2e6,_0x537e0d){if(_0x49a2e6[_0xefcb('0x5d')]['id']){delete _0x49a2e6[_0xefcb('0x5d')]['id'];}_0x49a2e6['body'][_0xefcb('0x3f')]=widgetAttributes(_0x49a2e6[_0xefcb('0x5d')]);return db[_0xefcb('0x39')][_0xefcb('0x3a')]({'where':{'id':_0x49a2e6['params']['id']}})[_0xefcb('0x25')](handleEntityNotFound(_0x537e0d,null))[_0xefcb('0x25')](saveUpdates(_0x49a2e6[_0xefcb('0x5d')],null))[_0xefcb('0x25')](respondWithResult(_0x537e0d,null))[_0xefcb('0x3b')](handleError(_0x537e0d,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 3bb8843..8677bb9 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 _0x7764=['events','../../mysqldb','DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x5c854f,_0x557516){var _0x5e1f97=function(_0x524ecc){while(--_0x524ecc){_0x5c854f['push'](_0x5c854f['shift']());}};_0x5e1f97(++_0x557516);}(_0x7764,0x120));var _0x4776=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x7764[_0x40bffc];return _0x3007e9;};'use strict';var EventEmitter=require(_0x4776('0x0'));var DashboardItem=require(_0x4776('0x1'))['db'][_0x4776('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x4776('0x3')](0x0);var events={'afterCreate':_0x4776('0x4'),'afterUpdate':_0x4776('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5c4442){return function(_0x54c34c,_0x37c97a,_0x4150fa){DashboardItemEvents[_0x4776('0x6')](_0x5c4442+':'+_0x54c34c['id'],_0x54c34c);DashboardItemEvents[_0x4776('0x6')](_0x5c4442,_0x54c34c);_0x4150fa(null);};}for(var e in events){if(events[_0x4776('0x7')](e)){var event=events[e];DashboardItem[_0x4776('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xbeba=['events','../../mysqldb','DashboardItem','save','update','emit','hasOwnProperty'];(function(_0x266bf2,_0x4ed0fe){var _0x1a4c6c=function(_0x377d59){while(--_0x377d59){_0x266bf2['push'](_0x266bf2['shift']());}};_0x1a4c6c(++_0x4ed0fe);}(_0xbeba,0xb6));var _0xabeb=function(_0x520ea4,_0x1b0891){_0x520ea4=_0x520ea4-0x0;var _0x4362c2=_0xbeba[_0x520ea4];return _0x4362c2;};'use strict';var EventEmitter=require(_0xabeb('0x0'));var DashboardItem=require(_0xabeb('0x1'))['db'][_0xabeb('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xabeb('0x3'),'afterUpdate':_0xabeb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1297fd){return function(_0x5d061e,_0x521fc6,_0x279cc1){DashboardItemEvents[_0xabeb('0x5')](_0x1297fd+':'+_0x5d061e['id'],_0x5d061e);DashboardItemEvents['emit'](_0x1297fd,_0x5d061e);_0x279cc1(null);};}for(var e in events){if(events[_0xabeb('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 4dce35d..cefffbf 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 _0x9d86=['dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define'];(function(_0xc81ca7,_0xb90d5){var _0x366401=function(_0x181f0a){while(--_0x181f0a){_0xc81ca7['push'](_0xc81ca7['shift']());}};_0x366401(++_0xb90d5);}(_0x9d86,0x1a5));var _0x69d8=function(_0xc8fdb7,_0x161dc0){_0xc8fdb7=_0xc8fdb7-0x0;var _0x29632b=_0x9d86[_0xc8fdb7];return _0x29632b;};'use strict';var _=require(_0x69d8('0x0'));var util=require(_0x69d8('0x1'));var logger=require(_0x69d8('0x2'))(_0x69d8('0x3'));var moment=require(_0x69d8('0x4'));var BPromise=require(_0x69d8('0x5'));var rp=require(_0x69d8('0x6'));var fs=require('fs');var path=require(_0x69d8('0x7'));var rimraf=require(_0x69d8('0x8'));var config=require(_0x69d8('0x9'));var attributes=require(_0x69d8('0xa'));module[_0x69d8('0xb')]=function(_0x148ceb,_0xd5bb14){return _0x148ceb[_0x69d8('0xc')]('DashboardItem',attributes,{'tableName':_0x69d8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5907=['rimraf','../../config/environment','./dashboardItem.attributes','exports','define','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x2b4fea,_0xc01e5f){var _0x48419d=function(_0x21b02d){while(--_0x21b02d){_0x2b4fea['push'](_0x2b4fea['shift']());}};_0x48419d(++_0xc01e5f);}(_0x5907,0x7e));var _0x7590=function(_0x2a25ab,_0x342895){_0x2a25ab=_0x2a25ab-0x0;var _0x540092=_0x5907[_0x2a25ab];return _0x540092;};'use strict';var _=require(_0x7590('0x0'));var util=require('util');var logger=require(_0x7590('0x1'))(_0x7590('0x2'));var moment=require(_0x7590('0x3'));var BPromise=require('bluebird');var rp=require(_0x7590('0x4'));var fs=require('fs');var path=require(_0x7590('0x5'));var rimraf=require(_0x7590('0x6'));var config=require(_0x7590('0x7'));var attributes=require(_0x7590('0x8'));module[_0x7590('0x9')]=function(_0xc8a28a,_0x29ebac){return _0xc8a28a[_0x7590('0xa')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 7ef7e06..44a2b48 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 _0x7672=['DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7672,0x13a));var _0x2767=function(_0x15fc69,_0x3e63c7){_0x15fc69=_0x15fc69-0x0;var _0x8f2ff7=_0x7672[_0x15fc69];return _0x8f2ff7;};'use strict';var _=require(_0x2767('0x0'));var util=require(_0x2767('0x1'));var moment=require('moment');var BPromise=require(_0x2767('0x2'));var rs=require(_0x2767('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2767('0x4'))['db'];var utils=require(_0x2767('0x5'));var logger=require(_0x2767('0x6'))(_0x2767('0x7'));var config=require(_0x2767('0x8'));var jayson=require(_0x2767('0x9'));var client=jayson[_0x2767('0xa')][_0x2767('0xb')]({'port':0x232a});config[_0x2767('0xc')]=_[_0x2767('0xd')](config['redis'],{'host':_0x2767('0xe'),'port':0x18eb});var socket=require(_0x2767('0xf'))(new Redis(config[_0x2767('0xc')]));require(_0x2767('0x10'))[_0x2767('0x11')](socket);function respondWithRpcPromise(_0x11a3ba,_0x3e8885,_0x573389){return new BPromise(function(_0x4f700a,_0x17c38a){return client[_0x2767('0x12')](_0x11a3ba,_0x573389)[_0x2767('0x13')](function(_0x25d2f9){logger[_0x2767('0x14')](_0x2767('0x15'),_0x3e8885,'request\x20sent');logger['debug'](_0x2767('0x16'),_0x3e8885,'request\x20sent',JSON['stringify'](_0x25d2f9));if(_0x25d2f9[_0x2767('0x17')]){if(_0x25d2f9[_0x2767('0x17')][_0x2767('0x18')]===0x1f4){logger[_0x2767('0x17')](_0x2767('0x15'),_0x3e8885,_0x25d2f9[_0x2767('0x17')][_0x2767('0x19')]);return _0x17c38a(_0x25d2f9['error'][_0x2767('0x19')]);}logger[_0x2767('0x17')]('DashboardItem,\x20%s,\x20%s',_0x3e8885,_0x25d2f9[_0x2767('0x17')][_0x2767('0x19')]);return _0x4f700a(_0x25d2f9[_0x2767('0x17')]['message']);}else{logger[_0x2767('0x14')](_0x2767('0x15'),_0x3e8885,'request\x20sent');_0x4f700a(_0x25d2f9[_0x2767('0x1a')][_0x2767('0x19')]);}})[_0x2767('0x1b')](function(_0x24e1e7){logger[_0x2767('0x17')](_0x2767('0x15'),_0x3e8885,_0x24e1e7);_0x17c38a(_0x24e1e7);});});} \ No newline at end of file +var _0xf1a2=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf1a2,0x1f2));var _0x2f1a=function(_0x59b0c9,_0x4a08cf){_0x59b0c9=_0x59b0c9-0x0;var _0x5139d6=_0xf1a2[_0x59b0c9];return _0x5139d6;};'use strict';var _=require(_0x2f1a('0x0'));var util=require(_0x2f1a('0x1'));var moment=require(_0x2f1a('0x2'));var BPromise=require(_0x2f1a('0x3'));var rs=require(_0x2f1a('0x4'));var fs=require('fs');var Redis=require(_0x2f1a('0x5'));var db=require(_0x2f1a('0x6'))['db'];var utils=require(_0x2f1a('0x7'));var logger=require(_0x2f1a('0x8'))(_0x2f1a('0x9'));var config=require(_0x2f1a('0xa'));var jayson=require(_0x2f1a('0xb'));var client=jayson[_0x2f1a('0xc')][_0x2f1a('0xd')]({'port':0x232a});config[_0x2f1a('0xe')]=_[_0x2f1a('0xf')](config[_0x2f1a('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2f1a('0x10'))[_0x2f1a('0x11')](socket);function respondWithRpcPromise(_0x1f65a1,_0x7d638b,_0x9047c6){return new BPromise(function(_0x34780c,_0x395f9d){return client[_0x2f1a('0x12')](_0x1f65a1,_0x9047c6)[_0x2f1a('0x13')](function(_0x6ad614){logger[_0x2f1a('0x14')](_0x2f1a('0x15'),_0x7d638b,_0x2f1a('0x16'));logger[_0x2f1a('0x17')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x7d638b,_0x2f1a('0x16'),JSON[_0x2f1a('0x18')](_0x6ad614));if(_0x6ad614['error']){if(_0x6ad614['error']['code']===0x1f4){logger[_0x2f1a('0x19')](_0x2f1a('0x15'),_0x7d638b,_0x6ad614[_0x2f1a('0x19')][_0x2f1a('0x1a')]);return _0x395f9d(_0x6ad614[_0x2f1a('0x19')][_0x2f1a('0x1a')]);}logger[_0x2f1a('0x19')](_0x2f1a('0x15'),_0x7d638b,_0x6ad614[_0x2f1a('0x19')][_0x2f1a('0x1a')]);return _0x34780c(_0x6ad614[_0x2f1a('0x19')][_0x2f1a('0x1a')]);}else{logger[_0x2f1a('0x14')](_0x2f1a('0x15'),_0x7d638b,_0x2f1a('0x16'));_0x34780c(_0x6ad614[_0x2f1a('0x1b')][_0x2f1a('0x1a')]);}})['catch'](function(_0x4db3ec){logger[_0x2f1a('0x19')](_0x2f1a('0x15'),_0x7d638b,_0x4db3ec);_0x395f9d(_0x4db3ec);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 69512c3..f86137f 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 _0x8931=['removeListener','register','length','save','remove','update','emit'];(function(_0x4b634f,_0x4c0372){var _0x302e3c=function(_0x1e3e3f){while(--_0x1e3e3f){_0x4b634f['push'](_0x4b634f['shift']());}};_0x302e3c(++_0x4c0372);}(_0x8931,0xab));var _0x1893=function(_0x5c9d27,_0x62a242){_0x5c9d27=_0x5c9d27-0x0;var _0x2841fa=_0x8931[_0x5c9d27];return _0x2841fa;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x1893('0x0'),_0x1893('0x1'),_0x1893('0x2')];function createListener(_0xa131e7,_0x5aa25e){return function(_0x466233){_0x5aa25e[_0x1893('0x3')](_0xa131e7,_0x466233);};}function removeListener(_0x349fc2,_0x5b2fd0){return function(){DashboardItemEvents[_0x1893('0x4')](_0x349fc2,_0x5b2fd0);};}exports[_0x1893('0x5')]=function(_0x2d7175){for(var _0x429f8e=0x0,_0x34bdc8=events[_0x1893('0x6')];_0x429f8e<_0x34bdc8;_0x429f8e++){var _0x52eea3=events[_0x429f8e];var _0x2417df=createListener('dashboardItem:'+_0x52eea3,_0x2d7175);DashboardItemEvents['on'](_0x52eea3,_0x2417df);}}; \ No newline at end of file +var _0x4935=['save','remove','update','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x447312,_0x4743ba){var _0x1243dc=function(_0x39eb9b){while(--_0x39eb9b){_0x447312['push'](_0x447312['shift']());}};_0x1243dc(++_0x4743ba);}(_0x4935,0x86));var _0x5493=function(_0xfc456e,_0x19e4ef){_0xfc456e=_0xfc456e-0x0;var _0x2b7008=_0x4935[_0xfc456e];return _0x2b7008;};'use strict';var DashboardItemEvents=require(_0x5493('0x0'));var events=[_0x5493('0x1'),_0x5493('0x2'),_0x5493('0x3')];function createListener(_0x20008f,_0x19cc29){return function(_0x1c9dd3){_0x19cc29[_0x5493('0x4')](_0x20008f,_0x1c9dd3);};}function removeListener(_0x400357,_0xf3971a){return function(){DashboardItemEvents[_0x5493('0x5')](_0x400357,_0xf3971a);};}exports[_0x5493('0x6')]=function(_0x11cdab){for(var _0x13b0fd=0x0,_0x34e9bf=events[_0x5493('0x7')];_0x13b0fd<_0x34e9bf;_0x13b0fd++){var _0x26f7c8=events[_0x13b0fd];var _0x4c7d3d=createListener(_0x5493('0x8')+_0x26f7c8,_0x11cdab);DashboardItemEvents['on'](_0x26f7c8,_0x4c7d3d);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index f3cf545..af39a94 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 _0x9222=['get','/:id','show','post','create','isAuthenticated','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1254e9,_0x30c989){var _0x5226fc=function(_0x1148b){while(--_0x1148b){_0x1254e9['push'](_0x1254e9['shift']());}};_0x5226fc(++_0x30c989);}(_0x9222,0x128));var _0x2922=function(_0x43d064,_0x3c6490){_0x43d064=_0x43d064-0x0;var _0x5c4de3=_0x9222[_0x43d064];return _0x5c4de3;};'use strict';var multer=require(_0x2922('0x0'));var util=require(_0x2922('0x1'));var path=require('path');var timeout=require(_0x2922('0x2'));var express=require(_0x2922('0x3'));var router=express[_0x2922('0x4')]();var fs_extra=require(_0x2922('0x5'));var auth=require(_0x2922('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2922('0x7'));var controller=require('./dashboardItem.controller');router[_0x2922('0x8')](_0x2922('0x9'),auth['isAuthenticated'](),controller[_0x2922('0xa')]);router[_0x2922('0xb')]('/',auth['isAuthenticated'](),controller[_0x2922('0xc')]);router['put'](_0x2922('0x9'),auth[_0x2922('0xd')](),controller['update']);router[_0x2922('0xe')](_0x2922('0x9'),auth[_0x2922('0xd')](),controller['destroy']);module[_0x2922('0xf')]=router; \ No newline at end of file +var _0x2f7d=['/:id','isAuthenticated','show','post','create','put','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./dashboardItem.controller','get'];(function(_0x3e6e6c,_0x1d2200){var _0x5792c6=function(_0x53ce58){while(--_0x53ce58){_0x3e6e6c['push'](_0x3e6e6c['shift']());}};_0x5792c6(++_0x1d2200);}(_0x2f7d,0xd8));var _0xd2f7=function(_0xb71da5,_0x48302b){_0xb71da5=_0xb71da5-0x0;var _0x21f118=_0x2f7d[_0xb71da5];return _0x21f118;};'use strict';var multer=require('multer');var util=require(_0xd2f7('0x0'));var path=require(_0xd2f7('0x1'));var timeout=require(_0xd2f7('0x2'));var express=require('express');var router=express[_0xd2f7('0x3')]();var fs_extra=require(_0xd2f7('0x4'));var auth=require(_0xd2f7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2f7('0x6'));router[_0xd2f7('0x7')](_0xd2f7('0x8'),auth[_0xd2f7('0x9')](),controller[_0xd2f7('0xa')]);router[_0xd2f7('0xb')]('/',auth[_0xd2f7('0x9')](),controller[_0xd2f7('0xc')]);router[_0xd2f7('0xd')](_0xd2f7('0x8'),auth[_0xd2f7('0x9')](),controller['update']);router[_0xd2f7('0xe')](_0xd2f7('0x8'),auth[_0xd2f7('0x9')](),controller['destroy']);module[_0xd2f7('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 21bebbd..80442f5 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 _0x25fe=['third','sequelize','STRING','first'];(function(_0x11686f,_0x33dceb){var _0x1866ec=function(_0x1a9f7d){while(--_0x1a9f7d){_0x11686f['push'](_0x11686f['shift']());}};_0x1866ec(++_0x33dceb);}(_0x25fe,0x1c1));var _0xe25f=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0x25fe[_0x4a6cf8];return _0x22205e;};'use strict';var Sequelize=require(_0xe25f('0x0'));module['exports']={'name':{'type':Sequelize[_0xe25f('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xe25f('0x2'),'second',_0xe25f('0x3')),'allowNull':![],'defaultValue':_0xe25f('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3d6f=['third','exports','STRING','second'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x3d6f,0x105));var _0xf3d6=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x3d6f[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require('sequelize');module[_0xf3d6('0x0')]={'name':{'type':Sequelize[_0xf3d6('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0xf3d6('0x2'),_0xf3d6('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xf3d6('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index b957d3c..394e58a 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 _0x114b=['count','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','Disposition','findAll','rows','catch','show','params','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','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x2f59e3,_0x1209b3){var _0x393520=function(_0xf93809){while(--_0xf93809){_0x2f59e3['push'](_0x2f59e3['shift']());}};_0x393520(++_0x1209b3);}(_0x114b,0x1e9));var _0xb114=function(_0x123013,_0x5568d3){_0x123013=_0x123013-0x0;var _0x1caf78=_0x114b[_0x123013];return _0x1caf78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb114('0x0'));var zipdir=require(_0xb114('0x1'));var jsonpatch=require(_0xb114('0x2'));var rp=require(_0xb114('0x3'));var moment=require(_0xb114('0x4'));var BPromise=require(_0xb114('0x5'));var Mustache=require(_0xb114('0x6'));var util=require('util');var path=require(_0xb114('0x7'));var sox=require(_0xb114('0x8'));var csv=require(_0xb114('0x9'));var ejs=require(_0xb114('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb114('0xb'));var crypto=require(_0xb114('0xc'));var jsforce=require(_0xb114('0xd'));var deskjs=require(_0xb114('0xe'));var toCsv=require(_0xb114('0x9'));var querystring=require(_0xb114('0xf'));var Papa=require(_0xb114('0x10'));var Redis=require(_0xb114('0x11'));var authService=require(_0xb114('0x12'));var qs=require(_0xb114('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb114('0x14'));var logger=require(_0xb114('0x15'))(_0xb114('0x16'));var utils=require('../../config/utils');var config=require(_0xb114('0x17'));var licenseUtil=require(_0xb114('0x18'));var db=require(_0xb114('0x19'))['db'];function respondWithStatusCode(_0x23d40e,_0x4a8410){_0x4a8410=_0x4a8410||0xcc;return function(_0x5a32c1){if(_0x5a32c1){return _0x23d40e[_0xb114('0x1a')](_0x4a8410);}return _0x23d40e[_0xb114('0x1b')](_0x4a8410)[_0xb114('0x1c')]();};}function respondWithResult(_0x514efe,_0x6f587a){_0x6f587a=_0x6f587a||0xc8;return function(_0x5836aa){if(_0x5836aa){return _0x514efe['status'](_0x6f587a)[_0xb114('0x1d')](_0x5836aa);}};}function respondWithFilteredResult(_0x15db33,_0xeaab75){return function(_0x1e3238){if(_0x1e3238){var _0x7508ee=typeof _0xeaab75[_0xb114('0x1e')]===_0xb114('0x1f')&&typeof _0xeaab75[_0xb114('0x20')]===_0xb114('0x1f');var _0x29f58c=_0x1e3238[_0xb114('0x21')];var _0x152f7d=_0x7508ee?0x0:_0xeaab75[_0xb114('0x1e')];var _0x5b8062=_0x7508ee?_0x1e3238[_0xb114('0x21')]:_0xeaab75[_0xb114('0x1e')]+_0xeaab75[_0xb114('0x20')];var _0xf76fa7;if(_0x5b8062>=_0x29f58c){_0x5b8062=_0x29f58c;_0xf76fa7=0xc8;}else{_0xf76fa7=0xce;}_0x15db33[_0xb114('0x1b')](_0xf76fa7);return _0x15db33[_0xb114('0x22')](_0xb114('0x23'),_0x152f7d+'-'+_0x5b8062+'/'+_0x29f58c)[_0xb114('0x1d')](_0x1e3238);}return null;};}function patchUpdates(_0x1f83ee){return function(_0x12d66d){try{jsonpatch[_0xb114('0x24')](_0x12d66d,_0x1f83ee,!![]);}catch(_0x2c036d){return BPromise[_0xb114('0x25')](_0x2c036d);}return _0x12d66d[_0xb114('0x26')]();};}function saveUpdates(_0x41ae5a,_0x1e0e32){return function(_0x1c30a1){if(_0x1c30a1){return _0x1c30a1[_0xb114('0x27')](_0x41ae5a)[_0xb114('0x28')](function(_0x35395f){return _0x35395f;});}return null;};}function removeEntity(_0xe2ac2c,_0x5ead94){return function(_0x54032b){if(_0x54032b){return _0x54032b[_0xb114('0x29')]()[_0xb114('0x28')](function(){var _0x3a2bf2=_0x54032b[_0xb114('0x2a')]({'plain':!![]});var _0x26a203=_0xb114('0x2b');return db[_0xb114('0x2c')]['destroy']({'where':{'type':_0x26a203,'resourceId':_0x3a2bf2['id']}})[_0xb114('0x28')](function(){return _0x54032b;});})[_0xb114('0x28')](function(){_0xe2ac2c[_0xb114('0x1b')](0xcc)[_0xb114('0x1c')]();});}};}function handleEntityNotFound(_0x2a74e7,_0x21776f){return function(_0x48631c){if(!_0x48631c){_0x2a74e7[_0xb114('0x1a')](0x194);}return _0x48631c;};}function handleError(_0x4e66de,_0x5ac5eb){_0x5ac5eb=_0x5ac5eb||0x1f4;return function(_0x5cae5c){logger[_0xb114('0x2d')](_0x5cae5c[_0xb114('0x2e')]);if(_0x5cae5c[_0xb114('0x2f')]){delete _0x5cae5c[_0xb114('0x2f')];}_0x4e66de[_0xb114('0x1b')](_0x5ac5eb)[_0xb114('0x30')](_0x5cae5c);};}exports[_0xb114('0x31')]=function(_0x3f5f95,_0x234926){var _0x3cee8b={},_0x3c480f={},_0x49c4a3={'count':0x0,'rows':[]};var _0x2cf9b4=_['map'](db['Disposition'][_0xb114('0x32')],function(_0x5c8688){return{'name':_0x5c8688[_0xb114('0x33')],'type':_0x5c8688[_0xb114('0x34')][_0xb114('0x35')]};});_0x3c480f[_0xb114('0x36')]=_[_0xb114('0x37')](_0x2cf9b4,'name');_0x3c480f['query']=_[_0xb114('0x38')](_0x3f5f95[_0xb114('0x39')]);_0x3c480f[_0xb114('0x3a')]=_[_0xb114('0x3b')](_0x3c480f[_0xb114('0x36')],_0x3c480f['query']);_0x3cee8b[_0xb114('0x3c')]=_[_0xb114('0x3b')](_0x3c480f['model'],qs[_0xb114('0x3d')](_0x3f5f95['query'][_0xb114('0x3d')]));_0x3cee8b['attributes']=_0x3cee8b[_0xb114('0x3c')][_0xb114('0x3e')]?_0x3cee8b[_0xb114('0x3c')]:_0x3c480f['model'];if(!_0x3f5f95[_0xb114('0x39')]['hasOwnProperty']('nolimit')){_0x3cee8b[_0xb114('0x20')]=qs['limit'](_0x3f5f95[_0xb114('0x39')][_0xb114('0x20')]);_0x3cee8b[_0xb114('0x1e')]=qs[_0xb114('0x1e')](_0x3f5f95[_0xb114('0x39')][_0xb114('0x1e')]);}_0x3cee8b[_0xb114('0x3f')]=qs[_0xb114('0x40')](_0x3f5f95[_0xb114('0x39')][_0xb114('0x40')]);_0x3cee8b[_0xb114('0x41')]=qs['filters'](_[_0xb114('0x42')](_0x3f5f95[_0xb114('0x39')],_0x3c480f[_0xb114('0x3a')]),_0x2cf9b4);if(_0x3f5f95[_0xb114('0x39')][_0xb114('0x43')]){_0x3cee8b[_0xb114('0x41')]=_['merge'](_0x3cee8b[_0xb114('0x41')],{'$or':_[_0xb114('0x37')](_0x2cf9b4,function(_0x18d0f5){if(_0x18d0f5[_0xb114('0x34')]!=='VIRTUAL'){var _0x4fb73a={};_0x4fb73a[_0x18d0f5['name']]={'$like':'%'+_0x3f5f95['query'][_0xb114('0x43')]+'%'};return _0x4fb73a;}})});}_0x3cee8b=_[_0xb114('0x44')]({},_0x3cee8b,_0x3f5f95[_0xb114('0x45')]);var _0x5d8824={'where':_0x3cee8b[_0xb114('0x41')]};return db['Disposition'][_0xb114('0x21')](_0x5d8824)[_0xb114('0x28')](function(_0x2e0a0e){_0x49c4a3[_0xb114('0x21')]=_0x2e0a0e;if(_0x3f5f95[_0xb114('0x39')][_0xb114('0x46')]){_0x3cee8b['include']=[{'all':!![]}];}return db[_0xb114('0x47')][_0xb114('0x48')](_0x3cee8b);})[_0xb114('0x28')](function(_0x14134b){_0x49c4a3[_0xb114('0x49')]=_0x14134b;return _0x49c4a3;})[_0xb114('0x28')](respondWithFilteredResult(_0x234926,_0x3cee8b))[_0xb114('0x4a')](handleError(_0x234926,null));};exports[_0xb114('0x4b')]=function(_0x309beb,_0x2bc2ff){var _0x119127={'raw':!![],'where':{'id':_0x309beb[_0xb114('0x4c')]['id']}},_0x1f2572={};_0x1f2572['model']=_[_0xb114('0x38')](db['Disposition'][_0xb114('0x32')]);_0x1f2572[_0xb114('0x39')]=_[_0xb114('0x38')](_0x309beb[_0xb114('0x39')]);_0x1f2572[_0xb114('0x3a')]=_[_0xb114('0x3b')](_0x1f2572[_0xb114('0x36')],_0x1f2572['query']);_0x119127[_0xb114('0x3c')]=_[_0xb114('0x3b')](_0x1f2572[_0xb114('0x36')],qs[_0xb114('0x3d')](_0x309beb[_0xb114('0x39')]['fields']));_0x119127[_0xb114('0x3c')]=_0x119127['attributes']['length']?_0x119127[_0xb114('0x3c')]:_0x1f2572[_0xb114('0x36')];if(_0x309beb[_0xb114('0x39')][_0xb114('0x46')]){_0x119127[_0xb114('0x4d')]=[{'all':!![]}];}_0x119127=_[_0xb114('0x44')]({},_0x119127,_0x309beb[_0xb114('0x45')]);return db[_0xb114('0x47')][_0xb114('0x4e')](_0x119127)[_0xb114('0x28')](handleEntityNotFound(_0x2bc2ff,null))[_0xb114('0x28')](respondWithResult(_0x2bc2ff,null))[_0xb114('0x4a')](handleError(_0x2bc2ff,null));};exports[_0xb114('0x4f')]=function(_0x3e8ad1,_0x4f3a18){return db[_0xb114('0x47')][_0xb114('0x4f')](_0x3e8ad1[_0xb114('0x50')],{})[_0xb114('0x28')](function(_0x132ab9){var _0x3ca7a6=_0x3e8ad1[_0xb114('0x51')]['get']({'plain':!![]});if(!_0x3ca7a6)throw new Error(_0xb114('0x52'));if(_0x3ca7a6['role']==='user'){var _0x3947eb=_0x132ab9['get']({'plain':!![]});var _0x59da66=_0xb114('0x2b');return db[_0xb114('0x53')][_0xb114('0x4e')]({'where':{'name':_0x59da66,'userProfileId':_0x3ca7a6[_0xb114('0x54')]},'raw':!![]})[_0xb114('0x28')](function(_0x3e8cf8){if(_0x3e8cf8&&_0x3e8cf8[_0xb114('0x55')]===0x0){return db[_0xb114('0x2c')][_0xb114('0x4f')]({'name':_0x3947eb['name'],'resourceId':_0x3947eb['id'],'type':_0x3e8cf8[_0xb114('0x2f')],'sectionId':_0x3e8cf8['id']},{})['then'](function(){return _0x132ab9;});}else{return _0x132ab9;}})['catch'](function(_0x360f0a){logger['error'](_0xb114('0x56'),_0x360f0a);throw _0x360f0a;});}return _0x132ab9;})['then'](respondWithResult(_0x4f3a18,0xc9))[_0xb114('0x4a')](handleError(_0x4f3a18,null));};exports['update']=function(_0x72d60f,_0x2c893a){if(_0x72d60f['body']['id']){delete _0x72d60f[_0xb114('0x50')]['id'];}return db[_0xb114('0x47')][_0xb114('0x4e')]({'where':{'id':_0x72d60f['params']['id']}})[_0xb114('0x28')](handleEntityNotFound(_0x2c893a,null))[_0xb114('0x28')](saveUpdates(_0x72d60f[_0xb114('0x50')],null))[_0xb114('0x28')](respondWithResult(_0x2c893a,null))[_0xb114('0x4a')](handleError(_0x2c893a,null));};exports[_0xb114('0x29')]=function(_0x19533a,_0x15a7a8){return db[_0xb114('0x47')][_0xb114('0x4e')]({'where':{'id':_0x19533a[_0xb114('0x4c')]['id']}})[_0xb114('0x28')](handleEntityNotFound(_0x15a7a8,null))[_0xb114('0x28')](removeEntity(_0x15a7a8,null))[_0xb114('0x4a')](handleError(_0x15a7a8,null));}; \ No newline at end of file +var _0x36e8=['fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','map','Disposition','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0xab7c7f,_0x3301e4){var _0x175e65=function(_0x5e6def){while(--_0x5e6def){_0xab7c7f['push'](_0xab7c7f['shift']());}};_0x175e65(++_0x3301e4);}(_0x36e8,0x16a));var _0x836e=function(_0x32e89e,_0x43d63f){_0x32e89e=_0x32e89e-0x0;var _0xed0ab=_0x36e8[_0x32e89e];return _0xed0ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x836e('0x0'));var zipdir=require(_0x836e('0x1'));var jsonpatch=require(_0x836e('0x2'));var rp=require(_0x836e('0x3'));var moment=require(_0x836e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x836e('0x5'));var util=require(_0x836e('0x6'));var path=require('path');var sox=require(_0x836e('0x7'));var csv=require('to-csv');var ejs=require(_0x836e('0x8'));var fs=require('fs');var fs_extra=require(_0x836e('0x9'));var _=require(_0x836e('0xa'));var squel=require(_0x836e('0xb'));var crypto=require(_0x836e('0xc'));var jsforce=require(_0x836e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x836e('0xe'));var querystring=require(_0x836e('0xf'));var Papa=require('papaparse');var Redis=require(_0x836e('0x10'));var authService=require(_0x836e('0x11'));var qs=require(_0x836e('0x12'));var as=require(_0x836e('0x13'));var hardwareService=require(_0x836e('0x14'));var logger=require(_0x836e('0x15'))(_0x836e('0x16'));var utils=require(_0x836e('0x17'));var config=require(_0x836e('0x18'));var licenseUtil=require(_0x836e('0x19'));var db=require(_0x836e('0x1a'))['db'];function respondWithStatusCode(_0x478480,_0x9eaf26){_0x9eaf26=_0x9eaf26||0xcc;return function(_0x175b61){if(_0x175b61){return _0x478480['sendStatus'](_0x9eaf26);}return _0x478480[_0x836e('0x1b')](_0x9eaf26)[_0x836e('0x1c')]();};}function respondWithResult(_0x13a6fa,_0x332719){_0x332719=_0x332719||0xc8;return function(_0x18e5c3){if(_0x18e5c3){return _0x13a6fa['status'](_0x332719)[_0x836e('0x1d')](_0x18e5c3);}};}function respondWithFilteredResult(_0x425f9b,_0x13f088){return function(_0xe088b3){if(_0xe088b3){var _0x244596=typeof _0x13f088[_0x836e('0x1e')]===_0x836e('0x1f')&&typeof _0x13f088[_0x836e('0x20')]===_0x836e('0x1f');var _0x3d799e=_0xe088b3[_0x836e('0x21')];var _0x5dfe13=_0x244596?0x0:_0x13f088['offset'];var _0x35565d=_0x244596?_0xe088b3['count']:_0x13f088[_0x836e('0x1e')]+_0x13f088['limit'];var _0x271c19;if(_0x35565d>=_0x3d799e){_0x35565d=_0x3d799e;_0x271c19=0xc8;}else{_0x271c19=0xce;}_0x425f9b['status'](_0x271c19);return _0x425f9b[_0x836e('0x22')](_0x836e('0x23'),_0x5dfe13+'-'+_0x35565d+'/'+_0x3d799e)[_0x836e('0x1d')](_0xe088b3);}return null;};}function patchUpdates(_0x312bbc){return function(_0x295bb1){try{jsonpatch['apply'](_0x295bb1,_0x312bbc,!![]);}catch(_0x18370e){return BPromise['reject'](_0x18370e);}return _0x295bb1[_0x836e('0x24')]();};}function saveUpdates(_0xcb9c37,_0x5889ee){return function(_0x7b7e72){if(_0x7b7e72){return _0x7b7e72[_0x836e('0x25')](_0xcb9c37)[_0x836e('0x26')](function(_0x12cb61){return _0x12cb61;});}return null;};}function removeEntity(_0x2295ea,_0xceb3d0){return function(_0x24b7fa){if(_0x24b7fa){return _0x24b7fa[_0x836e('0x27')]()[_0x836e('0x26')](function(){var _0x6ea50a=_0x24b7fa[_0x836e('0x28')]({'plain':!![]});var _0xf378d5=_0x836e('0x29');return db[_0x836e('0x2a')][_0x836e('0x27')]({'where':{'type':_0xf378d5,'resourceId':_0x6ea50a['id']}})[_0x836e('0x26')](function(){return _0x24b7fa;});})['then'](function(){_0x2295ea[_0x836e('0x1b')](0xcc)[_0x836e('0x1c')]();});}};}function handleEntityNotFound(_0xf6c447,_0x468c65){return function(_0x5cbeb5){if(!_0x5cbeb5){_0xf6c447['sendStatus'](0x194);}return _0x5cbeb5;};}function handleError(_0x233caa,_0x3592a9){_0x3592a9=_0x3592a9||0x1f4;return function(_0x3e3c19){logger[_0x836e('0x2b')](_0x3e3c19[_0x836e('0x2c')]);if(_0x3e3c19[_0x836e('0x2d')]){delete _0x3e3c19[_0x836e('0x2d')];}_0x233caa[_0x836e('0x1b')](_0x3592a9)[_0x836e('0x2e')](_0x3e3c19);};}exports['index']=function(_0x314e8f,_0xe4e16e){var _0x541d96={},_0xd35f74={},_0x10a69f={'count':0x0,'rows':[]};var _0x3231f7=_[_0x836e('0x2f')](db[_0x836e('0x30')]['rawAttributes'],function(_0x3128fe){return{'name':_0x3128fe[_0x836e('0x31')],'type':_0x3128fe[_0x836e('0x32')][_0x836e('0x33')]};});_0xd35f74[_0x836e('0x34')]=_[_0x836e('0x2f')](_0x3231f7,_0x836e('0x2d'));_0xd35f74[_0x836e('0x35')]=_[_0x836e('0x36')](_0x314e8f['query']);_0xd35f74[_0x836e('0x37')]=_[_0x836e('0x38')](_0xd35f74['model'],_0xd35f74[_0x836e('0x35')]);_0x541d96[_0x836e('0x39')]=_['intersection'](_0xd35f74[_0x836e('0x34')],qs['fields'](_0x314e8f[_0x836e('0x35')][_0x836e('0x3a')]));_0x541d96[_0x836e('0x39')]=_0x541d96[_0x836e('0x39')][_0x836e('0x3b')]?_0x541d96[_0x836e('0x39')]:_0xd35f74['model'];if(!_0x314e8f[_0x836e('0x35')][_0x836e('0x3c')]('nolimit')){_0x541d96[_0x836e('0x20')]=qs['limit'](_0x314e8f[_0x836e('0x35')]['limit']);_0x541d96['offset']=qs['offset'](_0x314e8f['query'][_0x836e('0x1e')]);}_0x541d96[_0x836e('0x3d')]=qs[_0x836e('0x3e')](_0x314e8f['query'][_0x836e('0x3e')]);_0x541d96[_0x836e('0x3f')]=qs[_0x836e('0x37')](_[_0x836e('0x40')](_0x314e8f['query'],_0xd35f74[_0x836e('0x37')]),_0x3231f7);if(_0x314e8f[_0x836e('0x35')][_0x836e('0x41')]){_0x541d96['where']=_[_0x836e('0x42')](_0x541d96[_0x836e('0x3f')],{'$or':_[_0x836e('0x2f')](_0x3231f7,function(_0x4b3a0a){if(_0x4b3a0a['type']!=='VIRTUAL'){var _0x4cc789={};_0x4cc789[_0x4b3a0a[_0x836e('0x2d')]]={'$like':'%'+_0x314e8f[_0x836e('0x35')][_0x836e('0x41')]+'%'};return _0x4cc789;}})});}_0x541d96=_[_0x836e('0x42')]({},_0x541d96,_0x314e8f[_0x836e('0x43')]);var _0x444fb0={'where':_0x541d96[_0x836e('0x3f')]};return db[_0x836e('0x30')][_0x836e('0x21')](_0x444fb0)[_0x836e('0x26')](function(_0x21bfb4){_0x10a69f[_0x836e('0x21')]=_0x21bfb4;if(_0x314e8f[_0x836e('0x35')][_0x836e('0x44')]){_0x541d96['include']=[{'all':!![]}];}return db[_0x836e('0x30')][_0x836e('0x45')](_0x541d96);})[_0x836e('0x26')](function(_0x5c5d3c){_0x10a69f['rows']=_0x5c5d3c;return _0x10a69f;})[_0x836e('0x26')](respondWithFilteredResult(_0xe4e16e,_0x541d96))[_0x836e('0x46')](handleError(_0xe4e16e,null));};exports[_0x836e('0x47')]=function(_0x532695,_0x4e40d2){var _0x29f237={'raw':!![],'where':{'id':_0x532695['params']['id']}},_0x10c249={};_0x10c249['model']=_[_0x836e('0x36')](db[_0x836e('0x30')][_0x836e('0x48')]);_0x10c249[_0x836e('0x35')]=_['keys'](_0x532695[_0x836e('0x35')]);_0x10c249[_0x836e('0x37')]=_[_0x836e('0x38')](_0x10c249[_0x836e('0x34')],_0x10c249['query']);_0x29f237[_0x836e('0x39')]=_[_0x836e('0x38')](_0x10c249[_0x836e('0x34')],qs['fields'](_0x532695[_0x836e('0x35')][_0x836e('0x3a')]));_0x29f237[_0x836e('0x39')]=_0x29f237[_0x836e('0x39')][_0x836e('0x3b')]?_0x29f237['attributes']:_0x10c249[_0x836e('0x34')];if(_0x532695['query'][_0x836e('0x44')]){_0x29f237[_0x836e('0x49')]=[{'all':!![]}];}_0x29f237=_[_0x836e('0x42')]({},_0x29f237,_0x532695[_0x836e('0x43')]);return db[_0x836e('0x30')][_0x836e('0x4a')](_0x29f237)[_0x836e('0x26')](handleEntityNotFound(_0x4e40d2,null))[_0x836e('0x26')](respondWithResult(_0x4e40d2,null))[_0x836e('0x46')](handleError(_0x4e40d2,null));};exports['create']=function(_0x268bc8,_0x3d9ca3){return db['Disposition'][_0x836e('0x4b')](_0x268bc8[_0x836e('0x4c')],{})['then'](function(_0x2c5317){var _0x1e122c=_0x268bc8['user'][_0x836e('0x28')]({'plain':!![]});if(!_0x1e122c)throw new Error(_0x836e('0x4d'));if(_0x1e122c[_0x836e('0x4e')]==='user'){var _0x5f0328=_0x2c5317[_0x836e('0x28')]({'plain':!![]});var _0x1a0a36=_0x836e('0x29');return db[_0x836e('0x4f')]['find']({'where':{'name':_0x1a0a36,'userProfileId':_0x1e122c[_0x836e('0x50')]},'raw':!![]})[_0x836e('0x26')](function(_0x3141cd){if(_0x3141cd&&_0x3141cd[_0x836e('0x51')]===0x0){return db[_0x836e('0x2a')][_0x836e('0x4b')]({'name':_0x5f0328[_0x836e('0x2d')],'resourceId':_0x5f0328['id'],'type':_0x3141cd[_0x836e('0x2d')],'sectionId':_0x3141cd['id']},{})[_0x836e('0x26')](function(){return _0x2c5317;});}else{return _0x2c5317;}})['catch'](function(_0x13e570){logger[_0x836e('0x2b')](_0x836e('0x52'),_0x13e570);throw _0x13e570;});}return _0x2c5317;})['then'](respondWithResult(_0x3d9ca3,0xc9))[_0x836e('0x46')](handleError(_0x3d9ca3,null));};exports[_0x836e('0x25')]=function(_0x207f62,_0x3e9a16){if(_0x207f62[_0x836e('0x4c')]['id']){delete _0x207f62['body']['id'];}return db[_0x836e('0x30')][_0x836e('0x4a')]({'where':{'id':_0x207f62[_0x836e('0x53')]['id']}})[_0x836e('0x26')](handleEntityNotFound(_0x3e9a16,null))[_0x836e('0x26')](saveUpdates(_0x207f62[_0x836e('0x4c')],null))[_0x836e('0x26')](respondWithResult(_0x3e9a16,null))[_0x836e('0x46')](handleError(_0x3e9a16,null));};exports[_0x836e('0x27')]=function(_0x516452,_0x3a4ee4){return db['Disposition'][_0x836e('0x4a')]({'where':{'id':_0x516452['params']['id']}})[_0x836e('0x26')](handleEntityNotFound(_0x3a4ee4,null))[_0x836e('0x26')](removeEntity(_0x3a4ee4,null))['catch'](handleError(_0x3a4ee4,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index b8928a1..e1e73a9 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 _0x4df9=['ListId','name_chat','name_mail','MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','tools_dispositions','name'];(function(_0x2eab2d,_0x23b7d6){var _0x1d503e=function(_0x4c6ed4){while(--_0x4c6ed4){_0x2eab2d['push'](_0x2eab2d['shift']());}};_0x1d503e(++_0x23b7d6);}(_0x4df9,0x19a));var _0x94df=function(_0x23f496,_0x9d8d75){_0x23f496=_0x23f496-0x0;var _0x5e063f=_0x4df9[_0x23f496];return _0x5e063f;};'use strict';var _=require('lodash');var util=require(_0x94df('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x94df('0x1'));var BPromise=require('bluebird');var rp=require(_0x94df('0x2'));var fs=require('fs');var path=require(_0x94df('0x3'));var rimraf=require(_0x94df('0x4'));var config=require(_0x94df('0x5'));var attributes=require(_0x94df('0x6'));module[_0x94df('0x7')]=function(_0x3a7718,_0x5bd414){return _0x3a7718['define']('Disposition',attributes,{'tableName':_0x94df('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x94df('0x9'),_0x94df('0xa')]},{'unique':!![],'name':_0x94df('0xb'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0x94df('0xc'),'fields':[_0x94df('0x9'),_0x94df('0xd')]},{'unique':!![],'name':'name_sms','fields':['name',_0x94df('0xe')]},{'unique':!![],'name':_0x94df('0xf'),'fields':[_0x94df('0x9'),_0x94df('0x10')]},{'unique':!![],'name':_0x94df('0x11'),'fields':['name',_0x94df('0x12')]},{'unique':!![],'name':_0x94df('0x13'),'fields':[_0x94df('0x9'),_0x94df('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x092d=['rimraf','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','name_sms','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','../../config/logger','api','bluebird','path'];(function(_0x1ce479,_0x2cff6d){var _0x25a45e=function(_0x2c4ba1){while(--_0x2c4ba1){_0x1ce479['push'](_0x1ce479['shift']());}};_0x25a45e(++_0x2cff6d);}(_0x092d,0x1f3));var _0xd092=function(_0x386408,_0x584c61){_0x386408=_0x386408-0x0;var _0xedb599=_0x092d[_0x386408];return _0xedb599;};'use strict';var _=require(_0xd092('0x0'));var util=require('util');var logger=require(_0xd092('0x1'))(_0xd092('0x2'));var moment=require('moment');var BPromise=require(_0xd092('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd092('0x4'));var rimraf=require(_0xd092('0x5'));var config=require('../../config/environment');var attributes=require(_0xd092('0x6'));module[_0xd092('0x7')]=function(_0x2ba85d,_0x4f804d){return _0x2ba85d['define'](_0xd092('0x8'),attributes,{'tableName':_0xd092('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xd092('0xa'),'fields':[_0xd092('0xb'),_0xd092('0xc')]},{'unique':!![],'name':_0xd092('0xd'),'fields':['name',_0xd092('0xe')]},{'unique':!![],'name':_0xd092('0xf'),'fields':[_0xd092('0xb'),'MailAccountId']},{'unique':!![],'name':_0xd092('0x10'),'fields':[_0xd092('0xb'),'SmsAccountId']},{'unique':!![],'name':_0xd092('0x11'),'fields':[_0xd092('0xb'),'FaxAccountId']},{'unique':!![],'name':_0xd092('0x12'),'fields':[_0xd092('0xb'),_0xd092('0x13')]},{'unique':!![],'name':_0xd092('0x14'),'fields':[_0xd092('0xb'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 46c0787..6357a1a 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(_0x266f01,_0x437a19){var _0x504f30=function(_0x486a55){while(--_0x486a55){_0x266f01['push'](_0x266f01['shift']());}};_0x504f30(++_0x437a19);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x478377,_0x28c1dd){var _0x46c036=function(_0x5b3044){while(--_0x5b3044){_0x478377['push'](_0x478377['shift']());}};_0x46c036(++_0x28c1dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 9966075..ecb1af5 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 _0x9345=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5cffea,_0x44c4bf){var _0x3ce1ca=function(_0x62be98){while(--_0x62be98){_0x5cffea['push'](_0x5cffea['shift']());}};_0x3ce1ca(++_0x44c4bf);}(_0x9345,0x90));var _0x5934=function(_0xc5e02a,_0xd9da3c){_0xc5e02a=_0xc5e02a-0x0;var _0xbeca77=_0x9345[_0xc5e02a];return _0xbeca77;};'use strict';var multer=require(_0x5934('0x0'));var util=require(_0x5934('0x1'));var path=require(_0x5934('0x2'));var timeout=require(_0x5934('0x3'));var express=require(_0x5934('0x4'));var router=express[_0x5934('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5934('0x6'));var interaction=require(_0x5934('0x7'));var config=require(_0x5934('0x8'));var controller=require('./disposition.controller');router[_0x5934('0x9')]('/',auth['isAuthenticated'](),controller[_0x5934('0xa')]);router[_0x5934('0x9')](_0x5934('0xb'),auth[_0x5934('0xc')](),controller[_0x5934('0xd')]);router[_0x5934('0xe')]('/',auth[_0x5934('0xc')](),controller[_0x5934('0xf')]);router[_0x5934('0x10')]('/:id',auth[_0x5934('0xc')](),controller[_0x5934('0x11')]);router[_0x5934('0x12')]('/:id',auth[_0x5934('0xc')](),controller[_0x5934('0x13')]);module[_0x5934('0x14')]=router; \ No newline at end of file +var _0xe72f=['create','put','update','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','post'];(function(_0x322acf,_0x4203cf){var _0x4b2c50=function(_0xf8eb96){while(--_0xf8eb96){_0x322acf['push'](_0x322acf['shift']());}};_0x4b2c50(++_0x4203cf);}(_0xe72f,0x73));var _0xfe72=function(_0x4c8498,_0xe01693){_0x4c8498=_0x4c8498-0x0;var _0x58e888=_0xe72f[_0x4c8498];return _0x58e888;};'use strict';var multer=require('multer');var util=require(_0xfe72('0x0'));var path=require('path');var timeout=require(_0xfe72('0x1'));var express=require(_0xfe72('0x2'));var router=express[_0xfe72('0x3')]();var fs_extra=require(_0xfe72('0x4'));var auth=require(_0xfe72('0x5'));var interaction=require(_0xfe72('0x6'));var config=require(_0xfe72('0x7'));var controller=require('./disposition.controller');router[_0xfe72('0x8')]('/',auth['isAuthenticated'](),controller[_0xfe72('0x9')]);router['get'](_0xfe72('0xa'),auth[_0xfe72('0xb')](),controller['show']);router[_0xfe72('0xc')]('/',auth[_0xfe72('0xb')](),controller[_0xfe72('0xd')]);router[_0xfe72('0xe')](_0xfe72('0xa'),auth['isAuthenticated'](),controller[_0xfe72('0xf')]);router['delete']('/:id',auth[_0xfe72('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 20d958f..2c74190 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 _0x8958=['7200','9600','12000','ENUM','14400','INTEGER','SIP','IAX','KHOMP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','yes','xCALLY\x20Motion\x20Fax','STRING','localstationid','2400','4800'];(function(_0x2de55d,_0xef404b){var _0x391470=function(_0x2f81c3){while(--_0x2f81c3){_0x2de55d['push'](_0x2de55d['shift']());}};_0x391470(++_0xef404b);}(_0x8958,0x93));var _0x8895=function(_0x518d89,_0x206af3){_0x518d89=_0x518d89-0x0;var _0x502df8=_0x8958[_0x518d89];return _0x502df8;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x8895('0x1')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x8895('0x2')},'localstationid':{'type':Sequelize[_0x8895('0x3')],'unique':_0x8895('0x4')},'minrate':{'type':Sequelize['ENUM'](_0x8895('0x5'),_0x8895('0x6'),_0x8895('0x7'),_0x8895('0x8'),_0x8895('0x9'),'14400'),'defaultValue':_0x8895('0x6')},'maxrate':{'type':Sequelize[_0x8895('0xa')](_0x8895('0x5'),_0x8895('0x6'),_0x8895('0x7'),_0x8895('0x8'),_0x8895('0x9'),_0x8895('0xb')),'defaultValue':_0x8895('0xb')},'modem':{'type':Sequelize[_0x8895('0x3')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x8895('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x8895('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x8895('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x8895('0xa')](_0x8895('0xd'),_0x8895('0xe'),'DADHI',_0x8895('0xf')),'defaultValue':_0x8895('0xd')},'key':{'type':Sequelize[_0x8895('0x3')],'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[_0x8895('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8895('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8895('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8895('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8895('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8895('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8895('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x8895('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x8895('0x10')],'defaultValue':![],'comment':_0x8895('0x12'),'set':function(_0x2848b7){if(!_0x2848b7)this[_0x8895('0x13')](_0x8895('0x14'),null);this[_0x8895('0x13')](_0x8895('0x15'),_0x2848b7);}}}; \ No newline at end of file +var _0x90ec=['KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','localstationid','4800','9600','12000','2400','7200','14400','v17,v27,v29','SIP','IAX'];(function(_0x2e2bcc,_0x54c1c8){var _0x33af9d=function(_0x29933e){while(--_0x29933e){_0x2e2bcc['push'](_0x2e2bcc['shift']());}};_0x33af9d(++_0x54c1c8);}(_0x90ec,0x1d4));var _0xc90e=function(_0x34ae72,_0x50be13){_0x34ae72=_0x34ae72-0x0;var _0x21fcf4=_0x90ec[_0x34ae72];return _0x21fcf4;};'use strict';var Sequelize=require(_0xc90e('0x0'));module[_0xc90e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc90e('0x2')]},'ecm':{'type':Sequelize[_0xc90e('0x3')](_0xc90e('0x4'),'no'),'defaultValue':_0xc90e('0x4')},'headerinfo':{'type':Sequelize[_0xc90e('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xc90e('0x2')],'unique':_0xc90e('0x5')},'minrate':{'type':Sequelize[_0xc90e('0x3')]('2400',_0xc90e('0x6'),'7200',_0xc90e('0x7'),_0xc90e('0x8'),'14400'),'defaultValue':_0xc90e('0x6')},'maxrate':{'type':Sequelize[_0xc90e('0x3')](_0xc90e('0x9'),_0xc90e('0x6'),_0xc90e('0xa'),_0xc90e('0x7'),_0xc90e('0x8'),_0xc90e('0xb')),'defaultValue':_0xc90e('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xc90e('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['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xc90e('0xd'),_0xc90e('0xe'),'DADHI',_0xc90e('0xf')),'defaultValue':_0xc90e('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc90e('0x10')],'defaultValue':function(){return _0xc90e('0x11');}},'notificationSound':{'type':Sequelize[_0xc90e('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc90e('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc90e('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc90e('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc90e('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc90e('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc90e('0x13')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc90e('0x12')],'defaultValue':![],'comment':_0xc90e('0x14'),'set':function(_0x558b22){if(!_0x558b22)this[_0xc90e('0x15')](_0xc90e('0x16'),null);this[_0xc90e('0x15')]('mandatoryDisposition',_0x558b22);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 20fd3ad..520e36c 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 _0x6739=['merge','includeAll','include','findAll','catch','show','Pause','keys','rawAttributes','options','find','create','user','get','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','intersection','pick','rows','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','exten','localstationid','app','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','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','transaction','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','root','basename','CheckAfterSend','isNil','\x22%s\x22\x20<%s>','fax','defaults','ListId','List\x20not\x20found','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','spread','out','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','zip-dir','request-promise','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/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','FaxAccounts','UserProfileResource','stack','send','mandatoryDispositionPause','FaxAccount','type','key','model','map','name','query','filters','attributes','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL'];(function(_0x51baef,_0x15ab1a){var _0x593586=function(_0x3ea835){while(--_0x3ea835){_0x51baef['push'](_0x51baef['shift']());}};_0x593586(++_0x15ab1a);}(_0x6739,0x141));var _0x9673=function(_0x24dd66,_0x3af898){_0x24dd66=_0x24dd66-0x0;var _0x3b994a=_0x6739[_0x24dd66];return _0x3b994a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9673('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9673('0x1'));var moment=require('moment');var BPromise=require(_0x9673('0x2'));var Mustache=require(_0x9673('0x3'));var util=require(_0x9673('0x4'));var path=require(_0x9673('0x5'));var sox=require(_0x9673('0x6'));var csv=require(_0x9673('0x7'));var ejs=require(_0x9673('0x8'));var fs=require('fs');var fs_extra=require(_0x9673('0x9'));var _=require(_0x9673('0xa'));var squel=require(_0x9673('0xb'));var crypto=require(_0x9673('0xc'));var jsforce=require(_0x9673('0xd'));var deskjs=require(_0x9673('0xe'));var toCsv=require(_0x9673('0x7'));var querystring=require(_0x9673('0xf'));var Papa=require(_0x9673('0x10'));var Redis=require(_0x9673('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9673('0x12'));var hardwareService=require(_0x9673('0x13'));var logger=require(_0x9673('0x14'))(_0x9673('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9673('0x16'));var db=require(_0x9673('0x17'))['db'];config[_0x9673('0x18')]=_['defaults'](config[_0x9673('0x18')],{'host':_0x9673('0x19'),'port':0x18eb});var socket=require(_0x9673('0x1a'))(new Redis(config[_0x9673('0x18')]));require(_0x9673('0x1b'))[_0x9673('0x1c')](socket);var jayson=require(_0x9673('0x1d'));var client=jayson[_0x9673('0x1e')][_0x9673('0x1f')]({'port':0x232c});var client9002=jayson[_0x9673('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43fd64,_0x1aed05,_0x4e900a,_0x496f47){return new BPromise(function(_0x2368b9,_0x5da677){var _0x51185e=_0x496f47||client;return _0x51185e[_0x9673('0x20')](_0x43fd64,_0x4e900a)[_0x9673('0x21')](function(_0x18a5d5){logger['info'](_0x9673('0x22'),_0x1aed05,_0x9673('0x23'));logger[_0x9673('0x24')](_0x9673('0x25'),_0x1aed05,_0x9673('0x23'),JSON[_0x9673('0x26')](_0x18a5d5));if(_0x18a5d5['error']){if(_0x18a5d5[_0x9673('0x27')][_0x9673('0x28')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x1aed05,_0x18a5d5[_0x9673('0x27')][_0x9673('0x29')]);return _0x5da677(_0x18a5d5['error'][_0x9673('0x29')]);}logger[_0x9673('0x27')]('FaxAccount,\x20%s,\x20%s',_0x1aed05,_0x18a5d5[_0x9673('0x27')][_0x9673('0x29')]);return _0x2368b9(_0x18a5d5[_0x9673('0x27')][_0x9673('0x29')]);}else{logger[_0x9673('0x2a')](_0x9673('0x22'),_0x1aed05,'request\x20sent');_0x2368b9(_0x18a5d5[_0x9673('0x2b')][_0x9673('0x29')]);}})['catch'](function(_0x39d876){logger['error'](_0x9673('0x22'),_0x1aed05,_0x39d876);_0x5da677(_0x39d876);});});}function respondWithStatusCode(_0x382e47,_0x5ec1f9){_0x5ec1f9=_0x5ec1f9||0xcc;return function(_0x5ed424){if(_0x5ed424){return _0x382e47[_0x9673('0x2c')](_0x5ec1f9);}return _0x382e47['status'](_0x5ec1f9)['end']();};}function respondWithResult(_0x5b3c65,_0x35ef4e){_0x35ef4e=_0x35ef4e||0xc8;return function(_0xbf5400){if(_0xbf5400){return _0x5b3c65[_0x9673('0x2d')](_0x35ef4e)[_0x9673('0x2e')](_0xbf5400);}};}function respondWithFilteredResult(_0xf8964,_0xf75b50){return function(_0x3d0e86){if(_0x3d0e86){var _0x17fa2b=typeof _0xf75b50[_0x9673('0x2f')]===_0x9673('0x30')&&typeof _0xf75b50['limit']==='undefined';var _0x186bcc=_0x3d0e86['count'];var _0x5af24d=_0x17fa2b?0x0:_0xf75b50[_0x9673('0x2f')];var _0x35a990=_0x17fa2b?_0x3d0e86[_0x9673('0x31')]:_0xf75b50[_0x9673('0x2f')]+_0xf75b50[_0x9673('0x32')];var _0x40cce7;if(_0x35a990>=_0x186bcc){_0x35a990=_0x186bcc;_0x40cce7=0xc8;}else{_0x40cce7=0xce;}_0xf8964[_0x9673('0x2d')](_0x40cce7);return _0xf8964[_0x9673('0x33')](_0x9673('0x34'),_0x5af24d+'-'+_0x35a990+'/'+_0x186bcc)['json'](_0x3d0e86);}return null;};}function patchUpdates(_0x5c6fe0){return function(_0xf864fb){try{jsonpatch[_0x9673('0x35')](_0xf864fb,_0x5c6fe0,!![]);}catch(_0x2be483){return BPromise[_0x9673('0x36')](_0x2be483);}return _0xf864fb[_0x9673('0x37')]();};}function saveUpdates(_0x2697bb,_0x164a71){return function(_0x18edae){if(_0x18edae){return _0x18edae['update'](_0x2697bb)[_0x9673('0x21')](function(_0x59dd3f){return _0x59dd3f;});}return null;};}function removeEntity(_0x3d42b2,_0x2ec826){return function(_0x2d59cc){if(_0x2d59cc){return _0x2d59cc[_0x9673('0x38')]()[_0x9673('0x21')](function(){var _0x196877=_0x2d59cc['get']({'plain':!![]});var _0x5e2ab7=_0x9673('0x39');return db[_0x9673('0x3a')]['destroy']({'where':{'type':_0x5e2ab7,'resourceId':_0x196877['id']}})[_0x9673('0x21')](function(){return _0x2d59cc;});})[_0x9673('0x21')](function(){_0x3d42b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eb5e7,_0x55fcfc){return function(_0x1ee02f){if(!_0x1ee02f){_0x3eb5e7[_0x9673('0x2c')](0x194);}return _0x1ee02f;};}function handleError(_0x593b08,_0x7cc8f9){_0x7cc8f9=_0x7cc8f9||0x1f4;return function(_0x55a7db){logger['error'](_0x55a7db[_0x9673('0x3b')]);if(_0x55a7db['name']){delete _0x55a7db['name'];}_0x593b08['status'](_0x7cc8f9)[_0x9673('0x3c')](_0x55a7db);};}exports['index']=function(_0x38ec96,_0x5e8792){var _0x35ba98={'include':[{'model':db['Pause'],'as':_0x9673('0x3d')}]},_0x52fb30={},_0xb71e1b={'count':0x0,'rows':[]};var _0x1b4412=_['map'](db[_0x9673('0x3e')]['rawAttributes'],function(_0x3402f5){return{'name':_0x3402f5['fieldName'],'type':_0x3402f5[_0x9673('0x3f')][_0x9673('0x40')]};});_0x52fb30[_0x9673('0x41')]=_[_0x9673('0x42')](_0x1b4412,_0x9673('0x43'));_0x52fb30[_0x9673('0x44')]=_['keys'](_0x38ec96['query']);_0x52fb30[_0x9673('0x45')]=_['intersection'](_0x52fb30['model'],_0x52fb30[_0x9673('0x44')]);_0x35ba98[_0x9673('0x46')]=_['intersection'](_0x52fb30[_0x9673('0x41')],qs[_0x9673('0x47')](_0x38ec96[_0x9673('0x44')]['fields']));_0x35ba98[_0x9673('0x46')]=_0x35ba98[_0x9673('0x46')][_0x9673('0x48')]?_0x35ba98['attributes']:_0x52fb30['model'];if(!_0x38ec96['query'][_0x9673('0x49')]('nolimit')){_0x35ba98['limit']=qs[_0x9673('0x32')](_0x38ec96[_0x9673('0x44')]['limit']);_0x35ba98[_0x9673('0x2f')]=qs['offset'](_0x38ec96[_0x9673('0x44')]['offset']);}_0x35ba98[_0x9673('0x4a')]=qs[_0x9673('0x4b')](_0x38ec96[_0x9673('0x44')][_0x9673('0x4b')]);_0x35ba98['where']=qs['filters'](_['pick'](_0x38ec96[_0x9673('0x44')],_0x52fb30[_0x9673('0x45')]),_0x1b4412);if(_0x38ec96[_0x9673('0x44')][_0x9673('0x4c')]){_0x35ba98[_0x9673('0x4d')]=_['merge'](_0x35ba98[_0x9673('0x4d')],{'$or':_[_0x9673('0x42')](_0x1b4412,function(_0x37eab3){if(_0x37eab3[_0x9673('0x3f')]!==_0x9673('0x4e')){var _0x416ce9={};_0x416ce9[_0x37eab3[_0x9673('0x43')]]={'$like':'%'+_0x38ec96['query'][_0x9673('0x4c')]+'%'};return _0x416ce9;}})});}_0x35ba98=_[_0x9673('0x4f')]({},_0x35ba98,_0x38ec96['options']);var _0x52a0b9={'where':_0x35ba98[_0x9673('0x4d')]};return db[_0x9673('0x3e')][_0x9673('0x31')](_0x52a0b9)[_0x9673('0x21')](function(_0x31555d){_0xb71e1b[_0x9673('0x31')]=_0x31555d;if(_0x38ec96[_0x9673('0x44')][_0x9673('0x50')]){_0x35ba98[_0x9673('0x51')]=[{'all':!![]}];}return db[_0x9673('0x3e')][_0x9673('0x52')](_0x35ba98);})[_0x9673('0x21')](function(_0x48ea86){_0xb71e1b['rows']=_0x48ea86;return _0xb71e1b;})[_0x9673('0x21')](respondWithFilteredResult(_0x5e8792,_0x35ba98))[_0x9673('0x53')](handleError(_0x5e8792,null));};exports[_0x9673('0x54')]=function(_0x51c586,_0x8c693){var _0x3a02c0={'raw':![],'where':{'id':_0x51c586['params']['id']},'include':[{'model':db[_0x9673('0x55')],'as':_0x9673('0x3d')}]},_0x48bc86={};_0x48bc86[_0x9673('0x41')]=_[_0x9673('0x56')](db['FaxAccount'][_0x9673('0x57')]);_0x48bc86[_0x9673('0x44')]=_[_0x9673('0x56')](_0x51c586[_0x9673('0x44')]);_0x48bc86[_0x9673('0x45')]=_['intersection'](_0x48bc86[_0x9673('0x41')],_0x48bc86[_0x9673('0x44')]);_0x3a02c0['attributes']=_['intersection'](_0x48bc86[_0x9673('0x41')],qs[_0x9673('0x47')](_0x51c586[_0x9673('0x44')][_0x9673('0x47')]));_0x3a02c0[_0x9673('0x46')]=_0x3a02c0[_0x9673('0x46')][_0x9673('0x48')]?_0x3a02c0[_0x9673('0x46')]:_0x48bc86[_0x9673('0x41')];if(_0x51c586[_0x9673('0x44')]['includeAll']){_0x3a02c0['include']=[{'all':!![]}];}_0x3a02c0=_[_0x9673('0x4f')]({},_0x3a02c0,_0x51c586[_0x9673('0x58')]);return db[_0x9673('0x3e')][_0x9673('0x59')](_0x3a02c0)['then'](handleEntityNotFound(_0x8c693,null))[_0x9673('0x21')](respondWithResult(_0x8c693,null))[_0x9673('0x53')](handleError(_0x8c693,null));};exports[_0x9673('0x5a')]=function(_0x15380e,_0x7defcc){return db['FaxAccount']['create'](_0x15380e['body'],{})[_0x9673('0x21')](function(_0x385bca){var _0x2a4d2b=_0x15380e[_0x9673('0x5b')][_0x9673('0x5c')]({'plain':!![]});if(!_0x2a4d2b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a4d2b[_0x9673('0x5d')]==='user'){var _0x30e237=_0x385bca[_0x9673('0x5c')]({'plain':!![]});var _0x2c7a1c=_0x9673('0x39');return db['UserProfileSection']['find']({'where':{'name':_0x2c7a1c,'userProfileId':_0x2a4d2b['userProfileId']},'raw':!![]})[_0x9673('0x21')](function(_0x2046d5){if(_0x2046d5&&_0x2046d5['autoAssociation']===0x0){return db[_0x9673('0x3a')][_0x9673('0x5a')]({'name':_0x30e237['name'],'resourceId':_0x30e237['id'],'type':_0x2046d5[_0x9673('0x43')],'sectionId':_0x2046d5['id']},{})[_0x9673('0x21')](function(){return _0x385bca;});}else{return _0x385bca;}})[_0x9673('0x53')](function(_0x5e2892){logger[_0x9673('0x27')](_0x9673('0x5e'),_0x5e2892);throw _0x5e2892;});}return _0x385bca;})[_0x9673('0x21')](respondWithResult(_0x7defcc,0xc9))[_0x9673('0x53')](handleError(_0x7defcc,null));};exports[_0x9673('0x5f')]=function(_0x5b4da8,_0x5d0229){if(_0x5b4da8[_0x9673('0x60')]['id']){delete _0x5b4da8[_0x9673('0x60')]['id'];}return db['FaxAccount'][_0x9673('0x59')]({'where':{'id':_0x5b4da8['params']['id']},'include':[{'model':db[_0x9673('0x55')],'as':_0x9673('0x3d')}]})['then'](handleEntityNotFound(_0x5d0229,null))[_0x9673('0x21')](saveUpdates(_0x5b4da8[_0x9673('0x60')],null))[_0x9673('0x21')](respondWithResult(_0x5d0229,null))['catch'](handleError(_0x5d0229,null));};exports['destroy']=function(_0x54a16b,_0x3e4fa1){return db['FaxAccount']['find']({'where':{'id':_0x54a16b[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x3e4fa1,null))[_0x9673('0x21')](removeEntity(_0x3e4fa1,null))['catch'](handleError(_0x3e4fa1,null));};exports[_0x9673('0x62')]=function(_0x38d2d2,_0x43ba1a){return db[_0x9673('0x3e')][_0x9673('0x62')]()['then'](respondWithResult(_0x43ba1a,null))[_0x9673('0x53')](handleError(_0x43ba1a,null));};exports[_0x9673('0x63')]=function(_0x322127,_0x41c6f8,_0x534f14){if(_0x322127[_0x9673('0x60')]['id']){delete _0x322127[_0x9673('0x60')]['id'];}return db[_0x9673('0x3e')][_0x9673('0x59')]({'where':{'id':_0x322127['params']['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x41c6f8,null))[_0x9673('0x21')](function(_0x5e0d1a){if(_0x5e0d1a){_0x322127[_0x9673('0x60')][_0x9673('0x64')]=_0x5e0d1a['id'];return db[_0x9673('0x65')][_0x9673('0x5a')](_0x322127[_0x9673('0x60')]);}})[_0x9673('0x21')](respondWithResult(_0x41c6f8,null))['catch'](handleError(_0x41c6f8,null));};exports[_0x9673('0x66')]=function(_0x1d872e,_0x8f42a0,_0x2e3ee0){var _0x54751c={'raw':![],'where':{}};var _0xedc3dd={};var _0x418ec7={'count':0x0,'rows':[]};return db[_0x9673('0x3e')][_0x9673('0x67')]({'where':{'id':_0x1d872e[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x8f42a0,null))[_0x9673('0x21')](function(_0x526f33){if(_0x526f33){_0xedc3dd[_0x9673('0x41')]=_[_0x9673('0x56')](db[_0x9673('0x65')][_0x9673('0x57')]);_0xedc3dd[_0x9673('0x44')]=_['keys'](_0x1d872e[_0x9673('0x44')]);_0xedc3dd[_0x9673('0x45')]=_[_0x9673('0x68')](_0xedc3dd['model'],_0xedc3dd[_0x9673('0x44')]);_0x54751c[_0x9673('0x46')]=_['intersection'](_0xedc3dd[_0x9673('0x41')],qs[_0x9673('0x47')](_0x1d872e[_0x9673('0x44')][_0x9673('0x47')]));_0x54751c[_0x9673('0x46')]=_0x54751c[_0x9673('0x46')]['length']?_0x54751c[_0x9673('0x46')]:_0xedc3dd[_0x9673('0x41')];if(!_0x1d872e[_0x9673('0x44')][_0x9673('0x49')]('nolimit')){_0x54751c[_0x9673('0x32')]=qs[_0x9673('0x32')](_0x1d872e['query']['limit']);_0x54751c[_0x9673('0x2f')]=qs[_0x9673('0x2f')](_0x1d872e[_0x9673('0x44')]['offset']);}_0x54751c[_0x9673('0x4a')]=qs[_0x9673('0x4b')](_0x1d872e[_0x9673('0x44')][_0x9673('0x4b')]);_0x54751c[_0x9673('0x4d')]=qs[_0x9673('0x45')](_[_0x9673('0x69')](_0x1d872e[_0x9673('0x44')],_0xedc3dd[_0x9673('0x45')]));_0x54751c[_0x9673('0x4d')][_0x9673('0x64')]=_0x526f33['id'];if(_0x1d872e[_0x9673('0x44')][_0x9673('0x4c')]){_0x54751c[_0x9673('0x4d')]=_[_0x9673('0x4f')](_0x54751c[_0x9673('0x4d')],{'$or':_[_0x9673('0x42')](_0x54751c[_0x9673('0x46')],function(_0x5a5b0c){var _0x3ee61f={};_0x3ee61f[_0x5a5b0c]={'$like':'%'+_0x1d872e['query'][_0x9673('0x4c')]+'%'};return _0x3ee61f;})});}_0x54751c=_['merge']({},_0x54751c,_0x1d872e[_0x9673('0x58')]);return db[_0x9673('0x65')][_0x9673('0x31')]({'where':_0x54751c[_0x9673('0x4d')]})[_0x9673('0x21')](function(_0x4e3b99){_0x418ec7[_0x9673('0x31')]=_0x4e3b99;if(_0x1d872e[_0x9673('0x44')][_0x9673('0x50')]){_0x54751c[_0x9673('0x51')]=[{'all':!![]}];}return db['Disposition'][_0x9673('0x52')](_0x54751c);})[_0x9673('0x21')](function(_0x5c9c86){_0x418ec7[_0x9673('0x6a')]=_0x5c9c86;return _0x418ec7;});}})[_0x9673('0x21')](respondWithFilteredResult(_0x8f42a0,_0x54751c))[_0x9673('0x53')](handleError(_0x8f42a0,null));};exports['removeDispositions']=function(_0x563944,_0x468411,_0x214ad4){return db[_0x9673('0x3e')][_0x9673('0x59')]({'where':{'id':_0x563944['params']['id']}})['then'](handleEntityNotFound(_0x468411,null))[_0x9673('0x21')](function(_0x5493e0){if(_0x5493e0){return _0x5493e0['removeDispositions'](_0x563944['query']['ids']);}})[_0x9673('0x21')](respondWithStatusCode(_0x468411,null))[_0x9673('0x53')](handleError(_0x468411,null));};exports[_0x9673('0x6b')]=function(_0x541e27,_0x29a025,_0x16fb54){if(_0x541e27[_0x9673('0x60')]['id']){delete _0x541e27[_0x9673('0x60')]['id'];}return db['FaxAccount'][_0x9673('0x59')]({'where':{'id':_0x541e27[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x29a025,null))[_0x9673('0x21')](function(_0x1e75d2){if(_0x1e75d2){_0x541e27['body']['FaxAccountId']=_0x1e75d2['id'];return db[_0x9673('0x6c')][_0x9673('0x5a')](_0x541e27['body']);}})[_0x9673('0x21')](respondWithResult(_0x29a025,null))[_0x9673('0x53')](handleError(_0x29a025,null));};exports[_0x9673('0x6d')]=function(_0x2d7488,_0xa93a97,_0x36d2c7){var _0x39e20e={'raw':![],'where':{}};var _0x2f5ad1={};var _0x3679e8={'count':0x0,'rows':[]};return db[_0x9673('0x3e')][_0x9673('0x67')]({'where':{'id':_0x2d7488[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0xa93a97,null))['then'](function(_0x1c2f84){if(_0x1c2f84){_0x2f5ad1[_0x9673('0x41')]=_['keys'](db['CannedAnswer'][_0x9673('0x57')]);_0x2f5ad1['query']=_['keys'](_0x2d7488[_0x9673('0x44')]);_0x2f5ad1[_0x9673('0x45')]=_[_0x9673('0x68')](_0x2f5ad1[_0x9673('0x41')],_0x2f5ad1['query']);_0x39e20e[_0x9673('0x46')]=_['intersection'](_0x2f5ad1['model'],qs[_0x9673('0x47')](_0x2d7488['query'][_0x9673('0x47')]));_0x39e20e[_0x9673('0x46')]=_0x39e20e[_0x9673('0x46')]['length']?_0x39e20e['attributes']:_0x2f5ad1['model'];if(!_0x2d7488[_0x9673('0x44')][_0x9673('0x49')](_0x9673('0x6e'))){_0x39e20e[_0x9673('0x32')]=qs[_0x9673('0x32')](_0x2d7488[_0x9673('0x44')][_0x9673('0x32')]);_0x39e20e[_0x9673('0x2f')]=qs[_0x9673('0x2f')](_0x2d7488[_0x9673('0x44')][_0x9673('0x2f')]);}_0x39e20e[_0x9673('0x4a')]=qs[_0x9673('0x4b')](_0x2d7488[_0x9673('0x44')][_0x9673('0x4b')]);_0x39e20e[_0x9673('0x4d')]=qs[_0x9673('0x45')](_[_0x9673('0x69')](_0x2d7488['query'],_0x2f5ad1['filters']));_0x39e20e[_0x9673('0x4d')][_0x9673('0x64')]=_0x1c2f84['id'];if(_0x2d7488[_0x9673('0x44')]['filter']){_0x39e20e['where']=_[_0x9673('0x4f')](_0x39e20e[_0x9673('0x4d')],{'$or':_[_0x9673('0x42')](_0x39e20e['attributes'],function(_0x3a3fbd){var _0x35a21d={};_0x35a21d[_0x3a3fbd]={'$like':'%'+_0x2d7488[_0x9673('0x44')]['filter']+'%'};return _0x35a21d;})});}_0x39e20e=_[_0x9673('0x4f')]({},_0x39e20e,_0x2d7488[_0x9673('0x58')]);return db[_0x9673('0x6c')]['count']({'where':_0x39e20e[_0x9673('0x4d')]})['then'](function(_0x2f7904){_0x3679e8[_0x9673('0x31')]=_0x2f7904;if(_0x2d7488[_0x9673('0x44')][_0x9673('0x50')]){_0x39e20e[_0x9673('0x51')]=[{'all':!![]}];}return db[_0x9673('0x6c')][_0x9673('0x52')](_0x39e20e);})[_0x9673('0x21')](function(_0xfef522){_0x3679e8[_0x9673('0x6a')]=_0xfef522;return _0x3679e8;});}})[_0x9673('0x21')](respondWithFilteredResult(_0xa93a97,_0x39e20e))[_0x9673('0x53')](handleError(_0xa93a97,null));};exports[_0x9673('0x6f')]=function(_0x1d9aa4,_0x2f9b67,_0x37b233){return db[_0x9673('0x3e')][_0x9673('0x59')]({'where':{'id':_0x1d9aa4['params']['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x2f9b67,null))['then'](function(_0x2186cc){if(_0x2186cc){return _0x2186cc['removeAnswers'](_0x1d9aa4['query'][_0x9673('0x70')]);}})[_0x9673('0x21')](respondWithStatusCode(_0x2f9b67,null))[_0x9673('0x53')](handleError(_0x2f9b67,null));};exports[_0x9673('0x71')]=function(_0xd73cd1,_0x380a33,_0x3e3890){return db[_0x9673('0x72')]['find']({'where':{'id':_0xd73cd1[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x380a33,null))[_0x9673('0x21')](function(_0x28a4d2){if(_0x28a4d2){return _0x28a4d2[_0x9673('0x71')](_0xd73cd1['body'][_0x9673('0x70')],_[_0x9673('0x73')](_0xd73cd1[_0x9673('0x60')],[_0x9673('0x70'),'id'])||{});}})[_0x9673('0x21')](respondWithResult(_0x380a33,null))['catch'](handleError(_0x380a33,null));};exports[_0x9673('0x74')]=function(_0x253c40,_0x379b59,_0x40fc90){var _0x17b47f={'raw':![],'where':{}};var _0x4ed828={};var _0x2ec904={'count':0x0,'rows':[]};return db[_0x9673('0x3e')]['findOne']({'where':{'id':_0x253c40['params']['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x379b59,null))[_0x9673('0x21')](function(_0x50fc1b){if(_0x50fc1b){_0x4ed828[_0x9673('0x41')]=_[_0x9673('0x56')](db[_0x9673('0x72')]['rawAttributes']);_0x4ed828[_0x9673('0x44')]=_['keys'](_0x253c40[_0x9673('0x44')]);_0x4ed828[_0x9673('0x45')]=_[_0x9673('0x68')](_0x4ed828[_0x9673('0x41')],_0x4ed828[_0x9673('0x44')]);_0x17b47f[_0x9673('0x46')]=_[_0x9673('0x68')](_0x4ed828['model'],qs[_0x9673('0x47')](_0x253c40[_0x9673('0x44')][_0x9673('0x47')]));_0x17b47f['attributes']=_0x17b47f['attributes'][_0x9673('0x48')]?_0x17b47f['attributes']:_0x4ed828[_0x9673('0x41')];if(!_0x253c40[_0x9673('0x44')][_0x9673('0x49')](_0x9673('0x6e'))){_0x17b47f[_0x9673('0x32')]=qs[_0x9673('0x32')](_0x253c40[_0x9673('0x44')][_0x9673('0x32')]);_0x17b47f[_0x9673('0x2f')]=qs[_0x9673('0x2f')](_0x253c40[_0x9673('0x44')]['offset']);}_0x17b47f['order']=qs['sort'](_0x253c40[_0x9673('0x44')]['sort']);_0x17b47f['where']=qs[_0x9673('0x45')](_[_0x9673('0x69')](_0x253c40[_0x9673('0x44')],_0x4ed828[_0x9673('0x45')]));_0x17b47f['where'][_0x9673('0x64')]=_0x50fc1b['id'];if(_0x253c40['query'][_0x9673('0x4c')]){_0x17b47f[_0x9673('0x4d')]=_[_0x9673('0x4f')](_0x17b47f[_0x9673('0x4d')],{'$or':_[_0x9673('0x42')](_0x17b47f[_0x9673('0x46')],function(_0x13d255){var _0x32561f={};_0x32561f[_0x13d255]={'$like':'%'+_0x253c40['query'][_0x9673('0x4c')]+'%'};return _0x32561f;})});}_0x17b47f=_[_0x9673('0x4f')]({},_0x17b47f,_0x253c40[_0x9673('0x58')]);return db[_0x9673('0x72')]['count']({'where':_0x17b47f[_0x9673('0x4d')]})[_0x9673('0x21')](function(_0x3dfff4){_0x2ec904[_0x9673('0x31')]=_0x3dfff4;if(_0x253c40[_0x9673('0x44')]['includeAll']){_0x17b47f[_0x9673('0x51')]=[{'model':db[_0x9673('0x75')],'as':_0x9673('0x76'),'required':![]},{'model':db[_0x9673('0x77')],'as':_0x9673('0x78'),'attributes':[_0x9673('0x43'),_0x9673('0x79'),_0x9673('0x7a')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x9673('0x43'),_0x9673('0x7b')],'where':_0x253c40[_0x9673('0x44')][_0x9673('0x7c')]?{'id':_0x253c40[_0x9673('0x44')][_0x9673('0x7c')]}:undefined,'required':_0x253c40['query'][_0x9673('0x7c')]?!![]:![]}];}return db[_0x9673('0x72')][_0x9673('0x52')](_0x17b47f);})[_0x9673('0x21')](function(_0xfc4dd4){_0x2ec904[_0x9673('0x6a')]=_0xfc4dd4;return _0x2ec904;});}})[_0x9673('0x21')](respondWithFilteredResult(_0x379b59,_0x17b47f))['catch'](handleError(_0x379b59,null));};exports[_0x9673('0x7d')]=function(_0x202df0,_0x370f86){var _0x385b43=_0x202df0['params']['id'];var _0x5b3c0e=_0x202df0[_0x9673('0x60')];var _0x41fb46=0xc8;var _0x1addaf=null;return db[_0x9673('0x7e')]['transaction']({'isolationLevel':db[_0x9673('0x7e')][_0x9673('0x7f')][_0x9673('0x80')][_0x9673('0x81')]},function(_0x1edb7f){return db[_0x9673('0x3e')][_0x9673('0x67')]({'where':{'id':_0x385b43},'transaction':_0x1edb7f})[_0x9673('0x21')](function(_0x2f95da){if(_0x2f95da){return db[_0x9673('0x82')]['destroy']({'where':{'FaxAccountId':_0x385b43},'transaction':_0x1edb7f})[_0x9673('0x21')](function(){var _0x179e04=_[_0x9673('0x42')](_0x5b3c0e,function(_0x6e3f06){_0x6e3f06['FaxAccountId']=_0x385b43;return _0x6e3f06;});return db[_0x9673('0x82')][_0x9673('0x83')](_0x179e04,{'transaction':_0x1edb7f});});}else{_0x41fb46=0x194;_0x1addaf=[];}});})['then'](function(){if(_0x41fb46!==0x194){return db[_0x9673('0x82')][_0x9673('0x84')]({'where':{'FaxAccountId':_0x385b43},'order':_0x9673('0x85')})[_0x9673('0x21')](function(_0x20da35){_0x1addaf=_0x20da35;});}})[_0x9673('0x53')](function(_0x1f4086){_0x41fb46=0x1f4;logger[_0x9673('0x27')](_0x1f4086[_0x9673('0x3b')]);if(_0x1f4086[_0x9673('0x43')]){delete _0x1f4086[_0x9673('0x43')];}_0x1addaf=_0x1f4086;})[_0x9673('0x86')](function(){if(_0x1addaf===null){_0x370f86['sendStatus'](_0x41fb46);}else{if(_0x41fb46===0x1f4){_0x370f86[_0x9673('0x2d')](_0x41fb46)[_0x9673('0x3c')](_0x1addaf);}else{_0x370f86[_0x9673('0x2d')](_0x41fb46)[_0x9673('0x2e')](_0x1addaf);}}});};exports[_0x9673('0x87')]=function(_0x799005,_0x5519b0,_0x42addf){var _0x56e244={};var _0x2fa300={};var _0x1da689;var _0x4a1c96;return db['FaxAccount'][_0x9673('0x67')]({'where':{'id':_0x799005[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x5519b0,null))[_0x9673('0x21')](function(_0x5d63b9){if(_0x5d63b9){_0x1da689=_0x5d63b9;_0x2fa300[_0x9673('0x41')]=_[_0x9673('0x56')](db[_0x9673('0x82')][_0x9673('0x57')]);_0x2fa300[_0x9673('0x44')]=_['keys'](_0x799005[_0x9673('0x44')]);_0x2fa300[_0x9673('0x45')]=_[_0x9673('0x68')](_0x2fa300[_0x9673('0x41')],_0x2fa300[_0x9673('0x44')]);_0x56e244[_0x9673('0x46')]=_['intersection'](_0x2fa300[_0x9673('0x41')],qs[_0x9673('0x47')](_0x799005['query'][_0x9673('0x47')]));_0x56e244[_0x9673('0x46')]=_0x56e244[_0x9673('0x46')][_0x9673('0x48')]?_0x56e244[_0x9673('0x46')]:_0x2fa300[_0x9673('0x41')];_0x56e244[_0x9673('0x4a')]=qs[_0x9673('0x4b')](_0x799005[_0x9673('0x44')][_0x9673('0x4b')]);_0x56e244[_0x9673('0x4d')]=qs['filters'](_['pick'](_0x799005[_0x9673('0x44')],_0x2fa300[_0x9673('0x45')]));if(_0x799005[_0x9673('0x44')][_0x9673('0x4c')]){_0x56e244[_0x9673('0x4d')]=_[_0x9673('0x4f')](_0x56e244['where'],{'$or':_[_0x9673('0x42')](_0x56e244[_0x9673('0x46')],function(_0x57abc1){var _0x419301={};_0x419301[_0x57abc1]={'$like':'%'+_0x799005[_0x9673('0x44')][_0x9673('0x4c')]+'%'};return _0x419301;})});}_0x56e244=_[_0x9673('0x4f')]({},_0x56e244,_0x799005[_0x9673('0x58')]);return _0x1da689[_0x9673('0x87')](_0x56e244);}})[_0x9673('0x21')](function(_0xd2f52d){if(_0xd2f52d){_0x4a1c96=_0xd2f52d['length'];if(!_0x799005[_0x9673('0x44')]['hasOwnProperty'](_0x9673('0x6e'))){_0x56e244[_0x9673('0x32')]=qs['limit'](_0x799005['query'][_0x9673('0x32')]);_0x56e244['offset']=qs[_0x9673('0x2f')](_0x799005[_0x9673('0x44')][_0x9673('0x2f')]);}return _0x1da689[_0x9673('0x87')](_0x56e244);}})[_0x9673('0x21')](function(_0x3f17a7){if(_0x3f17a7){return _0x3f17a7?{'count':_0x4a1c96,'rows':_0x3f17a7}:null;}})[_0x9673('0x21')](respondWithResult(_0x5519b0,null))['catch'](handleError(_0x5519b0,null));};function Extension(_0x229c4f,_0x169ad3,_0x3dc618,_0x5d05ff){this[_0x9673('0x88')]='from-voip-provider';this[_0x9673('0x89')]=_0x229c4f[_0x9673('0x8a')];this[_0x9673('0x8b')]=_0x5d05ff;this[_0x9673('0x3f')]='system';this[_0x9673('0x8c')]=_0x9673('0x8d');this[_0x9673('0x64')]=_0x229c4f['id'];this['priority']=_0x169ad3;this[_0x9673('0x8e')]=_0x3dc618;}function createExtensionsReciveFax(_0x2442ca){var _0x370cf5=0x1;var _0x5eed9b=[];_0x5eed9b[_0x9673('0x8f')](new Extension(_0x2442ca,_0x370cf5,'',_0x9673('0x90')));_0x370cf5+=0x1;_0x5eed9b[_0x9673('0x8f')](new Extension(_0x2442ca,_0x370cf5,_0x9673('0x91'),_0x9673('0x92')));_0x370cf5+=0x1;for(var _0x2f1ad6 in _0x2442ca){if(_0x2442ca[_0x9673('0x49')](_0x2f1ad6)&&(_0x2f1ad6===_0x9673('0x93')||_0x2f1ad6===_0x9673('0x8a')||_0x2f1ad6===_0x9673('0x94')||_0x2f1ad6===_0x9673('0x95')||_0x2f1ad6==='headerinfo'||_0x2f1ad6===_0x9673('0x96')||_0x2f1ad6==='minrate'||_0x2f1ad6===_0x9673('0x97')||_0x2f1ad6===_0x9673('0x98'))){_0x5eed9b[_0x9673('0x8f')](new Extension(_0x2442ca,_0x370cf5,_0x9673('0x99')+_0x2f1ad6+')='+_0x2442ca[_0x2f1ad6],_0x9673('0x92')));_0x370cf5+=0x1;}}_0x5eed9b[_0x9673('0x8f')](new Extension(_0x2442ca,_0x370cf5,'6','Wait'));_0x370cf5+=0x1;_0x5eed9b[_0x9673('0x8f')](new Extension(_0x2442ca,_0x370cf5,_0x9673('0x9a'),_0x9673('0x9b')));_0x370cf5=0x0;return _0x5eed9b;}exports[_0x9673('0x9c')]=function(_0x1747e6,_0x34241d,_0x245eda){var _0x5c68d7;return db[_0x9673('0x7e')][_0x9673('0x9d')](function(_0xd7e5a3){return db[_0x9673('0x3e')][_0x9673('0x5a')](_0x1747e6[_0x9673('0x60')],{'transaction':_0xd7e5a3})[_0x9673('0x21')](function(_0x27a1c8){_0x5c68d7=_0x27a1c8['get']({'plain':!![]});return db[_0x9673('0x9e')][_0x9673('0x83')](createExtensionsReciveFax(_0x5c68d7),{'transaction':_0xd7e5a3});});})[_0x9673('0x21')](function(){return _0x5c68d7;})[_0x9673('0x21')](respondWithResult(_0x34241d,null))[_0x9673('0x53')](handleError(_0x34241d,null));};exports[_0x9673('0x9f')]=function(_0x39e9e0,_0x1a88a2,_0x30c6e5){var _0x2eb75f;return db[_0x9673('0x7e')][_0x9673('0x9d')](function(_0x28ac47){return db[_0x9673('0x3e')]['update'](_0x39e9e0[_0x9673('0x60')],{'where':{'id':_0x39e9e0[_0x9673('0x60')]['id']},'transaction':_0x28ac47})[_0x9673('0x21')](function(_0x2855a2){return db[_0x9673('0x9e')][_0x9673('0x38')]({'where':{'FaxAccountId':_0x39e9e0[_0x9673('0x60')]['id']},'transaction':_0x28ac47})[_0x9673('0x21')](function(_0x54806f){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0x9673('0x73')](_0x39e9e0[_0x9673('0x60')],[_0x9673('0xa0'),_0x9673('0x40'),_0x9673('0xa1'),_0x9673('0xa2'),_0x9673('0xa3'),'ListId'])),{'transaction':_0x28ac47});});});})[_0x9673('0x21')](function(){return db['FaxAccount'][_0x9673('0xa4')](_0x39e9e0[_0x9673('0x60')]['id']);})[_0x9673('0x21')](respondWithResult(_0x1a88a2,null))['catch'](handleError(_0x1a88a2,null));};exports['getMessages']=function(_0x3cff70,_0x3d54a7,_0x4bb283){var _0x2caf40={'raw':!![],'where':{}};var _0x47c050={};var _0x5090f0={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9673('0x67')]({'where':{'id':_0x3cff70['params']['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x3d54a7,null))[_0x9673('0x21')](function(_0x5717f7){if(_0x5717f7){_0x47c050['model']=_[_0x9673('0x56')](db[_0x9673('0xa5')][_0x9673('0x57')]);_0x47c050[_0x9673('0x44')]=_[_0x9673('0x56')](_0x3cff70['query']);_0x47c050[_0x9673('0x45')]=_[_0x9673('0x68')](_0x47c050['model'],_0x47c050[_0x9673('0x44')]);_0x2caf40['attributes']=_[_0x9673('0x68')](_0x47c050[_0x9673('0x41')],qs[_0x9673('0x47')](_0x3cff70['query']['fields']));_0x2caf40['attributes']=_0x2caf40['attributes'][_0x9673('0x48')]?_0x2caf40[_0x9673('0x46')]:_0x47c050[_0x9673('0x41')];if(!_0x3cff70['query'][_0x9673('0x49')]('nolimit')){_0x2caf40[_0x9673('0x32')]=qs[_0x9673('0x32')](_0x3cff70[_0x9673('0x44')]['limit']);_0x2caf40['offset']=qs[_0x9673('0x2f')](_0x3cff70[_0x9673('0x44')]['offset']);}_0x2caf40[_0x9673('0x4a')]=qs[_0x9673('0x4b')](_0x3cff70[_0x9673('0x44')][_0x9673('0x4b')]);_0x2caf40[_0x9673('0x4d')]=qs[_0x9673('0x45')](_[_0x9673('0x69')](_0x3cff70[_0x9673('0x44')],_0x47c050[_0x9673('0x45')]));_0x2caf40['where'][_0x9673('0x64')]=_0x5717f7['id'];if(_0x3cff70[_0x9673('0x44')]['filter']){_0x2caf40['where']=_['merge'](_0x2caf40[_0x9673('0x4d')],{'$or':_[_0x9673('0x42')](_0x2caf40[_0x9673('0x46')],function(_0x41a7a7){var _0x2ad2c4={};_0x2ad2c4[_0x41a7a7]={'$like':'%'+_0x3cff70[_0x9673('0x44')][_0x9673('0x4c')]+'%'};return _0x2ad2c4;})});}if(_0x3cff70[_0x9673('0x44')][_0x9673('0xa6')]){var _0x42bee1=_0x3cff70[_0x9673('0x44')][_0x9673('0xa6')][_0x9673('0xa7')](',');var _0x53f701={};_0x53f701[_0x42bee1[0x0]]={'$gte':moment(_0x42bee1[0x1])[_0x9673('0xa8')](_0x9673('0xa9'))};_0x2caf40[_0x9673('0x4d')]=_[_0x9673('0x4f')](_0x2caf40[_0x9673('0x4d')],_0x53f701);}_0x2caf40=_[_0x9673('0x4f')]({},_0x2caf40,_0x3cff70[_0x9673('0x58')]);return db[_0x9673('0xa5')][_0x9673('0x31')]({'where':_0x2caf40[_0x9673('0x4d')]})[_0x9673('0x21')](function(_0xce966d){_0x5090f0[_0x9673('0x31')]=_0xce966d;if(_0x3cff70[_0x9673('0x44')][_0x9673('0x50')]){_0x2caf40['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x2caf40);})['then'](function(_0x3f4135){_0x5090f0[_0x9673('0x6a')]=_0x3f4135;return _0x5090f0;});}})[_0x9673('0x21')](respondWithFilteredResult(_0x3d54a7,_0x2caf40))[_0x9673('0x53')](handleError(_0x3d54a7,null));};exports[_0x9673('0x3c')]=function(_0x5b6ae5,_0x5a2a65,_0x315317){var _0x28c154,_0x301b09={},_0x33243d;if(_0x5b6ae5[_0x9673('0x60')]['to']){_0x33243d=_0x5b6ae5[_0x9673('0x60')]['to'][0x0];}return db[_0x9673('0x3e')][_0x9673('0x59')]({'where':{'id':_0x5b6ae5['params']['id']},'include':[{'model':db[_0x9673('0xaa')],'as':_0x9673('0xab'),'include':[{'model':db[_0x9673('0x75')],'as':_0x9673('0xac'),'where':{'fax':_0x33243d},'limit':0x1,'order':[[_0x9673('0xa2'),_0x9673('0xad')]]}]}]})['then'](handleEntityNotFound(_0x5a2a65,null))['then'](function(_0xf2abc7){_0x28c154=_0xf2abc7;if(_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')]&&_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][_0x9673('0x48')]){for(var _0xbcca6b=0x0;_0xbcca6b<_0x5b6ae5[_0x9673('0x60')]['attachments'][_0x9673('0x48')];_0xbcca6b+=0x1){_0x5b6ae5['body'][_0x9673('0xae')][_0xbcca6b]={'filename':_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][_0xbcca6b][_0x9673('0x43')],'id':_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][_0xbcca6b]['id'],'path':path['join'](config[_0x9673('0xaf')],'server/files/attachments',_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][_0xbcca6b][_0x9673('0xb0')])};}}return respondWithRpcPromise(_0x9673('0xb1'),_0x9673('0xb1'),{'FaxAccountId':_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x61')]['id'])?undefined:_0x5b6ae5[_0x9673('0x61')]['id'],'path':_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][0x0][_0x9673('0x5')])?undefined:_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][0x0][_0x9673('0x5')],'fax':_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x60')]['to'][0x0])?undefined:_0x5b6ae5[_0x9673('0x60')]['to'][0x0]},client9002);})[_0x9673('0x21')](function(){if(_0x28c154){if(_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x60')]['from'])){_0x5b6ae5['body']['from']=util[_0x9673('0xa8')](_0x9673('0xb3'),_0x28c154[_0x9673('0x43')],_0x28c154[_0x9673('0xb4')]);}if(_0x28c154[_0x9673('0xab')]){if(_0x28c154[_0x9673('0xab')][_0x9673('0xac')][_0x9673('0x48')]){return _0x28c154['List'][_0x9673('0xac')][0x0];}else{return db['CmContact']['create'](_[_0x9673('0xb5')](_0x5b6ae5[_0x9673('0x60')],{'firstName':_0x5b6ae5['body']['to'][0x0],'phone':_0x5b6ae5[_0x9673('0x60')]['to'][0x0],'fax':_0x5b6ae5['body']['to'][0x0],'ListId':_0x28c154[_0x9673('0xb6')]}));}}else{throw new Error(_0x9673('0xb7'));}}else{throw new Error(_0x9673('0xb8'));}})[_0x9673('0x21')](function(_0x110368){if(_0x110368){return db[_0x9673('0x72')][_0x9673('0x59')]({'where':{'ContactId':_0x110368['id'],'closed':![],'FaxAccountId':_0x28c154['id']}})['then'](function(_0x158698){if(_0x158698){return[_0x158698,![]];}return db[_0x9673('0x72')]['create']({'UserId':_0x5b6ae5[_0x9673('0x5b')]['id'],'ContactId':_0x110368['id'],'FaxAccountId':_0x28c154['id'],'fax':_0x5b6ae5[_0x9673('0x60')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x9673('0x4f')](_0x5b6ae5['body'],{'read':![],'body':_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][0x0]['filename'],'FaxAccountId':_0x28c154['id'],'UserId':_0x5b6ae5[_0x9673('0x5b')]['id'],'ContactId':_0x110368['id'],'AttachmentId':_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x9673('0xb9')}]})['then'](function(_0x21ebf0){return[_0x21ebf0,!![]];});});}else{throw new Error(_0x9673('0xba'));}})[_0x9673('0xbb')](function(_0xdea74a,_0x29858d){if(_0x29858d){return _0xdea74a;}return db['FaxMessage'][_0x9673('0x5a')]({'direction':_0x9673('0xbc'),'read':![],'body':_0x5b6ae5[_0x9673('0x60')]['attachments'][0x0][_0x9673('0xbd')],'FaxAccountId':_0x28c154['id'],'FaxInteractionId':_0xdea74a['id'],'UserId':_0x5b6ae5[_0x9673('0x5b')]['id'],'ContactId':_0xdea74a[_0x9673('0xbe')],'AttachmentId':_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][0x0]['id']})[_0x9673('0x21')](function(_0x472beb){_0xdea74a['dataValues'][_0x9673('0xb9')]=[];_0xdea74a[_0x9673('0xbf')][_0x9673('0xb9')]['push'](_0x472beb[_0x9673('0xbf')]);return _0xdea74a;});})[_0x9673('0x21')](function(_0x474b2b){respondWithRpcPromise(_0x9673('0xc0'),'SendFax',{'FaxAccountId':_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x61')]['id'])?undefined:_0x5b6ae5[_0x9673('0x61')]['id'],'path':_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][0x0][_0x9673('0x5')])?undefined:_0x5b6ae5['body'][_0x9673('0xae')][0x0]['path'],'fax':_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x60')]['to'][0x0])?undefined:_0x5b6ae5['body']['to'][0x0],'AttachmentId':_0x5b6ae5[_0x9673('0x60')]['attachments'][0x0]['id']},client9002)['then'](function(_0xb13376){logger[_0x9673('0x2a')](_0x9673('0xc1'),_0xb13376);})['catch'](function(_0x3ca4fd){logger[_0x9673('0x2a')]('SendFaxRpc,\x20%s',_0x3ca4fd);});return _0x474b2b;})['then'](respondWithResult(_0x5a2a65,null))[_0x9673('0x53')](handleError(_0x5a2a65,null));};exports[_0x9673('0xc2')]=function(_0x3f88b7,_0x2417a9,_0x2057fc){return db['FaxAccount'][_0x9673('0x59')]({'where':{'id':_0x3f88b7[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x2417a9,null))[_0x9673('0x21')](function(_0x45734d){if(_0x45734d){return _0x45734d[_0x9673('0xc2')](_0x3f88b7[_0x9673('0x60')][_0x9673('0x70')],_[_0x9673('0x73')](_0x3f88b7[_0x9673('0x60')],[_0x9673('0x70'),'id'])||{})[_0x9673('0xbb')](function(_0x4fb16d){for(var _0x116f6d=0x0;_0x116f6d<_0x3f88b7[_0x9673('0x60')][_0x9673('0x70')][_0x9673('0x48')];_0x116f6d+=0x1){socket['emit'](_0x9673('0xc3'),{'UserId':Number(_0x3f88b7[_0x9673('0x60')]['ids'][_0x116f6d]),'FaxAccountId':Number(_0x3f88b7['params']['id'])});}return _0x4fb16d;});}})['then'](respondWithResult(_0x2417a9,null))[_0x9673('0x53')](handleError(_0x2417a9,null));};exports['removeAgents']=function(_0x588d54,_0x37fcf4,_0x32ad53){return db['FaxAccount'][_0x9673('0x59')]({'where':{'id':_0x588d54[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x37fcf4,null))[_0x9673('0x21')](function(_0x119a81){if(_0x119a81){return _0x119a81[_0x9673('0xc4')](_0x588d54['query'][_0x9673('0x70')])[_0x9673('0x21')](function(){if(_[_0x9673('0xc5')](_0x588d54['query'][_0x9673('0x70')])){for(var _0x2ca301=0x0;_0x2ca301<_0x588d54[_0x9673('0x44')]['ids'][_0x9673('0x48')];_0x2ca301+=0x1){socket['emit'](_0x9673('0xc6'),{'UserId':Number(_0x588d54[_0x9673('0x44')]['ids'][_0x2ca301]),'FaxAccountId':Number(_0x588d54[_0x9673('0x61')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x588d54[_0x9673('0x44')][_0x9673('0x70')]),'FaxAccountId':Number(_0x588d54[_0x9673('0x61')]['id'])});}});}})[_0x9673('0x21')](respondWithStatusCode(_0x37fcf4,null))['catch'](handleError(_0x37fcf4,null));};exports[_0x9673('0xc7')]=function(_0x1bb7dd,_0x53f9b8,_0x389e3e){var _0x406a0d={};var _0x24851f={};var _0xabd656;var _0x497cf4;return db[_0x9673('0x3e')][_0x9673('0x67')]({'where':{'id':_0x1bb7dd[_0x9673('0x61')]['id']}})['then'](handleEntityNotFound(_0x53f9b8,null))[_0x9673('0x21')](function(_0x2a8ce0){if(_0x2a8ce0){_0xabd656=_0x2a8ce0;_0x24851f[_0x9673('0x41')]=_[_0x9673('0x56')](db[_0x9673('0x77')][_0x9673('0x57')]);_0x24851f[_0x9673('0x44')]=_[_0x9673('0x56')](_0x1bb7dd[_0x9673('0x44')]);_0x24851f[_0x9673('0x45')]=_[_0x9673('0x68')](_0x24851f[_0x9673('0x41')],_0x24851f['query']);_0x406a0d['attributes']=_[_0x9673('0x68')](_0x24851f[_0x9673('0x41')],qs[_0x9673('0x47')](_0x1bb7dd[_0x9673('0x44')][_0x9673('0x47')]));_0x406a0d[_0x9673('0x46')]=_0x406a0d[_0x9673('0x46')]['length']?_0x406a0d[_0x9673('0x46')]:_0x24851f[_0x9673('0x41')];_0x406a0d[_0x9673('0x4a')]=qs['sort'](_0x1bb7dd['query'][_0x9673('0x4b')]);_0x406a0d[_0x9673('0x4d')]=qs['filters'](_[_0x9673('0x69')](_0x1bb7dd[_0x9673('0x44')],_0x24851f[_0x9673('0x45')]));if(_0x1bb7dd['query'][_0x9673('0x4c')]){_0x406a0d[_0x9673('0x4d')]=_['merge'](_0x406a0d['where'],{'$or':_[_0x9673('0x42')](_0x406a0d[_0x9673('0x46')],function(_0x272765){var _0x1c6a1f={};_0x1c6a1f[_0x272765]={'$like':'%'+_0x1bb7dd[_0x9673('0x44')][_0x9673('0x4c')]+'%'};return _0x1c6a1f;})});}_0x406a0d=_[_0x9673('0x4f')]({},_0x406a0d,_0x1bb7dd[_0x9673('0x58')]);return _0xabd656[_0x9673('0xc7')](_0x406a0d);}})[_0x9673('0x21')](function(_0x4010c8){if(_0x4010c8){_0x497cf4=_0x4010c8[_0x9673('0x48')];if(!_0x1bb7dd[_0x9673('0x44')][_0x9673('0x49')](_0x9673('0x6e'))){_0x406a0d[_0x9673('0x32')]=qs[_0x9673('0x32')](_0x1bb7dd[_0x9673('0x44')][_0x9673('0x32')]);_0x406a0d['offset']=qs[_0x9673('0x2f')](_0x1bb7dd[_0x9673('0x44')][_0x9673('0x2f')]);}return _0xabd656[_0x9673('0xc7')](_0x406a0d);}})['then'](function(_0x47402f){if(_0x47402f){return _0x47402f?{'count':_0x497cf4,'rows':_0x47402f}:null;}})[_0x9673('0x21')](respondWithResult(_0x53f9b8,null))['catch'](handleError(_0x53f9b8,null));}; \ No newline at end of file +var _0x7585=['FaxAccountId','filter','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','headerinfo','maxrate','FAXOPT(','Set','Wait','addAccountApplications','VoiceExtension','updateAccountApplications','tech','updatedAt','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','path','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','omit','emit','userFaxAccount:save','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','json','offset','limit','undefined','count','status','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','stack','send','index','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','include','findAll','rows','show','mandatoryDispositionPause','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','addDisposition','Disposition','getDispositions','findOne'];(function(_0x3a76ec,_0x406234){var _0x242dae=function(_0x435755){while(--_0x435755){_0x3a76ec['push'](_0x3a76ec['shift']());}};_0x242dae(++_0x406234);}(_0x7585,0x11c));var _0x5758=function(_0x26a209,_0x18b5bf){_0x26a209=_0x26a209-0x0;var _0xda245b=_0x7585[_0x26a209];return _0xda245b;};'use strict';var emlformat=require(_0x5758('0x0'));var rimraf=require(_0x5758('0x1'));var zipdir=require(_0x5758('0x2'));var jsonpatch=require(_0x5758('0x3'));var rp=require(_0x5758('0x4'));var moment=require('moment');var BPromise=require(_0x5758('0x5'));var Mustache=require(_0x5758('0x6'));var util=require(_0x5758('0x7'));var path=require('path');var sox=require(_0x5758('0x8'));var csv=require(_0x5758('0x9'));var ejs=require(_0x5758('0xa'));var fs=require('fs');var fs_extra=require(_0x5758('0xb'));var _=require(_0x5758('0xc'));var squel=require(_0x5758('0xd'));var crypto=require(_0x5758('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5758('0x9'));var querystring=require(_0x5758('0xf'));var Papa=require(_0x5758('0x10'));var Redis=require(_0x5758('0x11'));var authService=require(_0x5758('0x12'));var qs=require(_0x5758('0x13'));var as=require(_0x5758('0x14'));var hardwareService=require(_0x5758('0x15'));var logger=require(_0x5758('0x16'))(_0x5758('0x17'));var utils=require(_0x5758('0x18'));var config=require(_0x5758('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5758('0x1a'))['db'];config[_0x5758('0x1b')]=_['defaults'](config[_0x5758('0x1b')],{'host':_0x5758('0x1c'),'port':0x18eb});var socket=require(_0x5758('0x1d'))(new Redis(config[_0x5758('0x1b')]));require(_0x5758('0x1e'))[_0x5758('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5758('0x20')][_0x5758('0x21')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x115bda,_0x231931,_0x1cf3b6,_0x487435){return new BPromise(function(_0x1e1a15,_0x2ed626){var _0x50c3f3=_0x487435||client;return _0x50c3f3[_0x5758('0x22')](_0x115bda,_0x1cf3b6)[_0x5758('0x23')](function(_0x3bc6b8){logger[_0x5758('0x24')](_0x5758('0x25'),_0x231931,_0x5758('0x26'));logger['debug'](_0x5758('0x27'),_0x231931,'request\x20sent',JSON['stringify'](_0x3bc6b8));if(_0x3bc6b8[_0x5758('0x28')]){if(_0x3bc6b8[_0x5758('0x28')][_0x5758('0x29')]===0x1f4){logger[_0x5758('0x28')](_0x5758('0x25'),_0x231931,_0x3bc6b8[_0x5758('0x28')][_0x5758('0x2a')]);return _0x2ed626(_0x3bc6b8[_0x5758('0x28')]['message']);}logger[_0x5758('0x28')](_0x5758('0x25'),_0x231931,_0x3bc6b8['error'][_0x5758('0x2a')]);return _0x1e1a15(_0x3bc6b8[_0x5758('0x28')][_0x5758('0x2a')]);}else{logger[_0x5758('0x24')](_0x5758('0x25'),_0x231931,'request\x20sent');_0x1e1a15(_0x3bc6b8[_0x5758('0x2b')][_0x5758('0x2a')]);}})[_0x5758('0x2c')](function(_0x120ff6){logger['error'](_0x5758('0x25'),_0x231931,_0x120ff6);_0x2ed626(_0x120ff6);});});}function respondWithStatusCode(_0x419207,_0xec75cf){_0xec75cf=_0xec75cf||0xcc;return function(_0x4cb2cc){if(_0x4cb2cc){return _0x419207[_0x5758('0x2d')](_0xec75cf);}return _0x419207['status'](_0xec75cf)[_0x5758('0x2e')]();};}function respondWithResult(_0x17b3a4,_0x217dd5){_0x217dd5=_0x217dd5||0xc8;return function(_0x1f5674){if(_0x1f5674){return _0x17b3a4['status'](_0x217dd5)[_0x5758('0x2f')](_0x1f5674);}};}function respondWithFilteredResult(_0x316fb3,_0x38e977){return function(_0x14897d){if(_0x14897d){var _0x1a6257=typeof _0x38e977[_0x5758('0x30')]==='undefined'&&typeof _0x38e977[_0x5758('0x31')]===_0x5758('0x32');var _0x3d0988=_0x14897d[_0x5758('0x33')];var _0x1a10f7=_0x1a6257?0x0:_0x38e977['offset'];var _0x111ac7=_0x1a6257?_0x14897d[_0x5758('0x33')]:_0x38e977[_0x5758('0x30')]+_0x38e977[_0x5758('0x31')];var _0x47443b;if(_0x111ac7>=_0x3d0988){_0x111ac7=_0x3d0988;_0x47443b=0xc8;}else{_0x47443b=0xce;}_0x316fb3[_0x5758('0x34')](_0x47443b);return _0x316fb3['set'](_0x5758('0x35'),_0x1a10f7+'-'+_0x111ac7+'/'+_0x3d0988)['json'](_0x14897d);}return null;};}function patchUpdates(_0x4a0986){return function(_0x48cb02){try{jsonpatch[_0x5758('0x36')](_0x48cb02,_0x4a0986,!![]);}catch(_0x357d5a){return BPromise[_0x5758('0x37')](_0x357d5a);}return _0x48cb02[_0x5758('0x38')]();};}function saveUpdates(_0x2400a1,_0x58c172){return function(_0x426173){if(_0x426173){return _0x426173[_0x5758('0x39')](_0x2400a1)['then'](function(_0x7cf2d2){return _0x7cf2d2;});}return null;};}function removeEntity(_0x587193,_0x318c95){return function(_0x15c660){if(_0x15c660){return _0x15c660[_0x5758('0x3a')]()['then'](function(){var _0x29dcf8=_0x15c660[_0x5758('0x3b')]({'plain':!![]});var _0x562d12=_0x5758('0x3c');return db['UserProfileResource'][_0x5758('0x3a')]({'where':{'type':_0x562d12,'resourceId':_0x29dcf8['id']}})[_0x5758('0x23')](function(){return _0x15c660;});})[_0x5758('0x23')](function(){_0x587193[_0x5758('0x34')](0xcc)[_0x5758('0x2e')]();});}};}function handleEntityNotFound(_0x120acf,_0x5d4ffb){return function(_0x136b2f){if(!_0x136b2f){_0x120acf[_0x5758('0x2d')](0x194);}return _0x136b2f;};}function handleError(_0x2b5464,_0x1790ac){_0x1790ac=_0x1790ac||0x1f4;return function(_0x84d922){logger[_0x5758('0x28')](_0x84d922[_0x5758('0x3d')]);if(_0x84d922['name']){delete _0x84d922['name'];}_0x2b5464[_0x5758('0x34')](_0x1790ac)[_0x5758('0x3e')](_0x84d922);};}exports[_0x5758('0x3f')]=function(_0x3d3318,_0x583a2b){var _0x2db212={'include':[{'model':db[_0x5758('0x40')],'as':'mandatoryDispositionPause'}]},_0x4577fc={},_0x24d31f={'count':0x0,'rows':[]};var _0x28229a=_[_0x5758('0x41')](db[_0x5758('0x42')][_0x5758('0x43')],function(_0x2ea753){return{'name':_0x2ea753[_0x5758('0x44')],'type':_0x2ea753[_0x5758('0x45')][_0x5758('0x46')]};});_0x4577fc[_0x5758('0x47')]=_[_0x5758('0x41')](_0x28229a,_0x5758('0x48'));_0x4577fc['query']=_['keys'](_0x3d3318[_0x5758('0x49')]);_0x4577fc[_0x5758('0x4a')]=_[_0x5758('0x4b')](_0x4577fc[_0x5758('0x47')],_0x4577fc[_0x5758('0x49')]);_0x2db212[_0x5758('0x4c')]=_[_0x5758('0x4b')](_0x4577fc['model'],qs[_0x5758('0x4d')](_0x3d3318[_0x5758('0x49')][_0x5758('0x4d')]));_0x2db212[_0x5758('0x4c')]=_0x2db212[_0x5758('0x4c')][_0x5758('0x4e')]?_0x2db212['attributes']:_0x4577fc[_0x5758('0x47')];if(!_0x3d3318[_0x5758('0x49')][_0x5758('0x4f')](_0x5758('0x50'))){_0x2db212[_0x5758('0x31')]=qs[_0x5758('0x31')](_0x3d3318[_0x5758('0x49')][_0x5758('0x31')]);_0x2db212[_0x5758('0x30')]=qs['offset'](_0x3d3318[_0x5758('0x49')]['offset']);}_0x2db212[_0x5758('0x51')]=qs['sort'](_0x3d3318[_0x5758('0x49')][_0x5758('0x52')]);_0x2db212[_0x5758('0x53')]=qs[_0x5758('0x4a')](_[_0x5758('0x54')](_0x3d3318[_0x5758('0x49')],_0x4577fc[_0x5758('0x4a')]),_0x28229a);if(_0x3d3318['query']['filter']){_0x2db212[_0x5758('0x53')]=_['merge'](_0x2db212[_0x5758('0x53')],{'$or':_[_0x5758('0x41')](_0x28229a,function(_0x3a7cdf){if(_0x3a7cdf['type']!==_0x5758('0x55')){var _0x4302ce={};_0x4302ce[_0x3a7cdf['name']]={'$like':'%'+_0x3d3318[_0x5758('0x49')]['filter']+'%'};return _0x4302ce;}})});}_0x2db212=_[_0x5758('0x56')]({},_0x2db212,_0x3d3318[_0x5758('0x57')]);var _0x49dbfc={'where':_0x2db212['where']};return db[_0x5758('0x42')][_0x5758('0x33')](_0x49dbfc)['then'](function(_0x3d31b6){_0x24d31f[_0x5758('0x33')]=_0x3d31b6;if(_0x3d3318[_0x5758('0x49')]['includeAll']){_0x2db212[_0x5758('0x58')]=[{'all':!![]}];}return db[_0x5758('0x42')][_0x5758('0x59')](_0x2db212);})[_0x5758('0x23')](function(_0x4a3509){_0x24d31f[_0x5758('0x5a')]=_0x4a3509;return _0x24d31f;})[_0x5758('0x23')](respondWithFilteredResult(_0x583a2b,_0x2db212))[_0x5758('0x2c')](handleError(_0x583a2b,null));};exports[_0x5758('0x5b')]=function(_0x170fe0,_0x155b6b){var _0x209014={'raw':![],'where':{'id':_0x170fe0['params']['id']},'include':[{'model':db['Pause'],'as':_0x5758('0x5c')}]},_0x443031={};_0x443031[_0x5758('0x47')]=_[_0x5758('0x5d')](db[_0x5758('0x42')]['rawAttributes']);_0x443031[_0x5758('0x49')]=_[_0x5758('0x5d')](_0x170fe0['query']);_0x443031[_0x5758('0x4a')]=_[_0x5758('0x4b')](_0x443031[_0x5758('0x47')],_0x443031[_0x5758('0x49')]);_0x209014[_0x5758('0x4c')]=_[_0x5758('0x4b')](_0x443031[_0x5758('0x47')],qs['fields'](_0x170fe0[_0x5758('0x49')]['fields']));_0x209014[_0x5758('0x4c')]=_0x209014[_0x5758('0x4c')][_0x5758('0x4e')]?_0x209014[_0x5758('0x4c')]:_0x443031[_0x5758('0x47')];if(_0x170fe0[_0x5758('0x49')][_0x5758('0x5e')]){_0x209014[_0x5758('0x58')]=[{'all':!![]}];}_0x209014=_[_0x5758('0x56')]({},_0x209014,_0x170fe0[_0x5758('0x57')]);return db['FaxAccount']['find'](_0x209014)[_0x5758('0x23')](handleEntityNotFound(_0x155b6b,null))[_0x5758('0x23')](respondWithResult(_0x155b6b,null))['catch'](handleError(_0x155b6b,null));};exports[_0x5758('0x5f')]=function(_0x3ea38f,_0xf35d01){return db[_0x5758('0x42')][_0x5758('0x5f')](_0x3ea38f[_0x5758('0x60')],{})['then'](function(_0x3fb2b5){var _0x283476=_0x3ea38f[_0x5758('0x61')]['get']({'plain':!![]});if(!_0x283476)throw new Error(_0x5758('0x62'));if(_0x283476[_0x5758('0x63')]===_0x5758('0x61')){var _0x211b03=_0x3fb2b5[_0x5758('0x3b')]({'plain':!![]});var _0x33c243=_0x5758('0x3c');return db['UserProfileSection']['find']({'where':{'name':_0x33c243,'userProfileId':_0x283476[_0x5758('0x64')]},'raw':!![]})[_0x5758('0x23')](function(_0x2d12ae){if(_0x2d12ae&&_0x2d12ae[_0x5758('0x65')]===0x0){return db['UserProfileResource'][_0x5758('0x5f')]({'name':_0x211b03[_0x5758('0x48')],'resourceId':_0x211b03['id'],'type':_0x2d12ae[_0x5758('0x48')],'sectionId':_0x2d12ae['id']},{})['then'](function(){return _0x3fb2b5;});}else{return _0x3fb2b5;}})[_0x5758('0x2c')](function(_0x3c2935){logger[_0x5758('0x28')](_0x5758('0x66'),_0x3c2935);throw _0x3c2935;});}return _0x3fb2b5;})[_0x5758('0x23')](respondWithResult(_0xf35d01,0xc9))[_0x5758('0x2c')](handleError(_0xf35d01,null));};exports['update']=function(_0x2ba97a,_0x5ca272){if(_0x2ba97a[_0x5758('0x60')]['id']){delete _0x2ba97a[_0x5758('0x60')]['id'];}return db[_0x5758('0x42')][_0x5758('0x67')]({'where':{'id':_0x2ba97a[_0x5758('0x68')]['id']},'include':[{'model':db['Pause'],'as':_0x5758('0x5c')}]})[_0x5758('0x23')](handleEntityNotFound(_0x5ca272,null))[_0x5758('0x23')](saveUpdates(_0x2ba97a[_0x5758('0x60')],null))['then'](respondWithResult(_0x5ca272,null))[_0x5758('0x2c')](handleError(_0x5ca272,null));};exports[_0x5758('0x3a')]=function(_0x41edb4,_0x36e964){return db[_0x5758('0x42')][_0x5758('0x67')]({'where':{'id':_0x41edb4['params']['id']}})[_0x5758('0x23')](handleEntityNotFound(_0x36e964,null))[_0x5758('0x23')](removeEntity(_0x36e964,null))['catch'](handleError(_0x36e964,null));};exports['describe']=function(_0x29c6fe,_0x49fed5){return db[_0x5758('0x42')][_0x5758('0x69')]()[_0x5758('0x23')](respondWithResult(_0x49fed5,null))[_0x5758('0x2c')](handleError(_0x49fed5,null));};exports[_0x5758('0x6a')]=function(_0x202685,_0x173b1f,_0x19b4c4){if(_0x202685[_0x5758('0x60')]['id']){delete _0x202685[_0x5758('0x60')]['id'];}return db[_0x5758('0x42')][_0x5758('0x67')]({'where':{'id':_0x202685[_0x5758('0x68')]['id']}})['then'](handleEntityNotFound(_0x173b1f,null))[_0x5758('0x23')](function(_0x1dbcd5){if(_0x1dbcd5){_0x202685[_0x5758('0x60')]['FaxAccountId']=_0x1dbcd5['id'];return db[_0x5758('0x6b')][_0x5758('0x5f')](_0x202685[_0x5758('0x60')]);}})[_0x5758('0x23')](respondWithResult(_0x173b1f,null))[_0x5758('0x2c')](handleError(_0x173b1f,null));};exports[_0x5758('0x6c')]=function(_0x4eb684,_0xa0476d,_0x79382c){var _0x36ede7={'raw':![],'where':{}};var _0x1ff0b5={};var _0xceec49={'count':0x0,'rows':[]};return db[_0x5758('0x42')][_0x5758('0x6d')]({'where':{'id':_0x4eb684['params']['id']}})[_0x5758('0x23')](handleEntityNotFound(_0xa0476d,null))[_0x5758('0x23')](function(_0x52db6f){if(_0x52db6f){_0x1ff0b5[_0x5758('0x47')]=_[_0x5758('0x5d')](db[_0x5758('0x6b')][_0x5758('0x43')]);_0x1ff0b5[_0x5758('0x49')]=_[_0x5758('0x5d')](_0x4eb684[_0x5758('0x49')]);_0x1ff0b5['filters']=_['intersection'](_0x1ff0b5[_0x5758('0x47')],_0x1ff0b5[_0x5758('0x49')]);_0x36ede7[_0x5758('0x4c')]=_[_0x5758('0x4b')](_0x1ff0b5[_0x5758('0x47')],qs['fields'](_0x4eb684[_0x5758('0x49')]['fields']));_0x36ede7[_0x5758('0x4c')]=_0x36ede7[_0x5758('0x4c')][_0x5758('0x4e')]?_0x36ede7['attributes']:_0x1ff0b5[_0x5758('0x47')];if(!_0x4eb684[_0x5758('0x49')]['hasOwnProperty'](_0x5758('0x50'))){_0x36ede7['limit']=qs[_0x5758('0x31')](_0x4eb684[_0x5758('0x49')][_0x5758('0x31')]);_0x36ede7['offset']=qs[_0x5758('0x30')](_0x4eb684[_0x5758('0x49')]['offset']);}_0x36ede7[_0x5758('0x51')]=qs[_0x5758('0x52')](_0x4eb684[_0x5758('0x49')][_0x5758('0x52')]);_0x36ede7[_0x5758('0x53')]=qs[_0x5758('0x4a')](_[_0x5758('0x54')](_0x4eb684['query'],_0x1ff0b5[_0x5758('0x4a')]));_0x36ede7[_0x5758('0x53')][_0x5758('0x6e')]=_0x52db6f['id'];if(_0x4eb684['query'][_0x5758('0x6f')]){_0x36ede7[_0x5758('0x53')]=_[_0x5758('0x56')](_0x36ede7[_0x5758('0x53')],{'$or':_[_0x5758('0x41')](_0x36ede7[_0x5758('0x4c')],function(_0x54a57a){var _0x51fe8e={};_0x51fe8e[_0x54a57a]={'$like':'%'+_0x4eb684[_0x5758('0x49')]['filter']+'%'};return _0x51fe8e;})});}_0x36ede7=_['merge']({},_0x36ede7,_0x4eb684[_0x5758('0x57')]);return db['Disposition'][_0x5758('0x33')]({'where':_0x36ede7[_0x5758('0x53')]})[_0x5758('0x23')](function(_0x1b1d06){_0xceec49[_0x5758('0x33')]=_0x1b1d06;if(_0x4eb684[_0x5758('0x49')][_0x5758('0x5e')]){_0x36ede7[_0x5758('0x58')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x36ede7);})['then'](function(_0x2c1264){_0xceec49['rows']=_0x2c1264;return _0xceec49;});}})[_0x5758('0x23')](respondWithFilteredResult(_0xa0476d,_0x36ede7))['catch'](handleError(_0xa0476d,null));};exports['removeDispositions']=function(_0x3d30a0,_0x244cd4,_0x53ba48){return db['FaxAccount'][_0x5758('0x67')]({'where':{'id':_0x3d30a0[_0x5758('0x68')]['id']}})[_0x5758('0x23')](handleEntityNotFound(_0x244cd4,null))[_0x5758('0x23')](function(_0x19add1){if(_0x19add1){return _0x19add1[_0x5758('0x70')](_0x3d30a0['query']['ids']);}})[_0x5758('0x23')](respondWithStatusCode(_0x244cd4,null))[_0x5758('0x2c')](handleError(_0x244cd4,null));};exports[_0x5758('0x71')]=function(_0x1ee0e3,_0x1b9996,_0x37902f){if(_0x1ee0e3['body']['id']){delete _0x1ee0e3[_0x5758('0x60')]['id'];}return db[_0x5758('0x42')][_0x5758('0x67')]({'where':{'id':_0x1ee0e3[_0x5758('0x68')]['id']}})[_0x5758('0x23')](handleEntityNotFound(_0x1b9996,null))[_0x5758('0x23')](function(_0x1225fa){if(_0x1225fa){_0x1ee0e3[_0x5758('0x60')]['FaxAccountId']=_0x1225fa['id'];return db[_0x5758('0x72')][_0x5758('0x5f')](_0x1ee0e3['body']);}})['then'](respondWithResult(_0x1b9996,null))['catch'](handleError(_0x1b9996,null));};exports[_0x5758('0x73')]=function(_0x181123,_0x41c508,_0x157457){var _0x28588e={'raw':![],'where':{}};var _0x187350={};var _0x54a78e={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5758('0x6d')]({'where':{'id':_0x181123[_0x5758('0x68')]['id']}})[_0x5758('0x23')](handleEntityNotFound(_0x41c508,null))['then'](function(_0x19cb7d){if(_0x19cb7d){_0x187350[_0x5758('0x47')]=_['keys'](db[_0x5758('0x72')][_0x5758('0x43')]);_0x187350['query']=_[_0x5758('0x5d')](_0x181123[_0x5758('0x49')]);_0x187350[_0x5758('0x4a')]=_[_0x5758('0x4b')](_0x187350['model'],_0x187350[_0x5758('0x49')]);_0x28588e[_0x5758('0x4c')]=_['intersection'](_0x187350[_0x5758('0x47')],qs[_0x5758('0x4d')](_0x181123[_0x5758('0x49')][_0x5758('0x4d')]));_0x28588e['attributes']=_0x28588e['attributes'][_0x5758('0x4e')]?_0x28588e[_0x5758('0x4c')]:_0x187350[_0x5758('0x47')];if(!_0x181123[_0x5758('0x49')]['hasOwnProperty']('nolimit')){_0x28588e[_0x5758('0x31')]=qs[_0x5758('0x31')](_0x181123['query']['limit']);_0x28588e['offset']=qs['offset'](_0x181123[_0x5758('0x49')]['offset']);}_0x28588e[_0x5758('0x51')]=qs[_0x5758('0x52')](_0x181123[_0x5758('0x49')][_0x5758('0x52')]);_0x28588e[_0x5758('0x53')]=qs['filters'](_['pick'](_0x181123[_0x5758('0x49')],_0x187350[_0x5758('0x4a')]));_0x28588e[_0x5758('0x53')][_0x5758('0x6e')]=_0x19cb7d['id'];if(_0x181123[_0x5758('0x49')][_0x5758('0x6f')]){_0x28588e[_0x5758('0x53')]=_['merge'](_0x28588e[_0x5758('0x53')],{'$or':_[_0x5758('0x41')](_0x28588e[_0x5758('0x4c')],function(_0x2b5083){var _0x4a021d={};_0x4a021d[_0x2b5083]={'$like':'%'+_0x181123[_0x5758('0x49')][_0x5758('0x6f')]+'%'};return _0x4a021d;})});}_0x28588e=_['merge']({},_0x28588e,_0x181123['options']);return db[_0x5758('0x72')][_0x5758('0x33')]({'where':_0x28588e[_0x5758('0x53')]})[_0x5758('0x23')](function(_0x5521ed){_0x54a78e[_0x5758('0x33')]=_0x5521ed;if(_0x181123[_0x5758('0x49')][_0x5758('0x5e')]){_0x28588e[_0x5758('0x58')]=[{'all':!![]}];}return db[_0x5758('0x72')][_0x5758('0x59')](_0x28588e);})[_0x5758('0x23')](function(_0x5462c6){_0x54a78e['rows']=_0x5462c6;return _0x54a78e;});}})[_0x5758('0x23')](respondWithFilteredResult(_0x41c508,_0x28588e))[_0x5758('0x2c')](handleError(_0x41c508,null));};exports[_0x5758('0x74')]=function(_0x21e4e2,_0x1dc969,_0x4fe8e3){return db[_0x5758('0x42')][_0x5758('0x67')]({'where':{'id':_0x21e4e2[_0x5758('0x68')]['id']}})[_0x5758('0x23')](handleEntityNotFound(_0x1dc969,null))[_0x5758('0x23')](function(_0x5e4db7){if(_0x5e4db7){return _0x5e4db7[_0x5758('0x74')](_0x21e4e2[_0x5758('0x49')][_0x5758('0x75')]);}})[_0x5758('0x23')](respondWithStatusCode(_0x1dc969,null))[_0x5758('0x2c')](handleError(_0x1dc969,null));};exports[_0x5758('0x76')]=function(_0x4ae7e8,_0x2a7022,_0x5d5ff5){return db[_0x5758('0x77')][_0x5758('0x67')]({'where':{'id':_0x4ae7e8[_0x5758('0x68')]['id']}})[_0x5758('0x23')](handleEntityNotFound(_0x2a7022,null))[_0x5758('0x23')](function(_0x18fb4e){if(_0x18fb4e){return _0x18fb4e['addInteraction'](_0x4ae7e8['body']['ids'],_['omit'](_0x4ae7e8[_0x5758('0x60')],[_0x5758('0x75'),'id'])||{});}})[_0x5758('0x23')](respondWithResult(_0x2a7022,null))[_0x5758('0x2c')](handleError(_0x2a7022,null));};exports[_0x5758('0x78')]=function(_0x2b8989,_0x3c25be,_0x28a56f){var _0x4e3b46={'raw':![],'where':{}};var _0xc75478={};var _0x1c79d6={'count':0x0,'rows':[]};return db[_0x5758('0x42')][_0x5758('0x6d')]({'where':{'id':_0x2b8989['params']['id']}})[_0x5758('0x23')](handleEntityNotFound(_0x3c25be,null))[_0x5758('0x23')](function(_0xffb2b8){if(_0xffb2b8){_0xc75478[_0x5758('0x47')]=_[_0x5758('0x5d')](db[_0x5758('0x77')][_0x5758('0x43')]);_0xc75478[_0x5758('0x49')]=_[_0x5758('0x5d')](_0x2b8989[_0x5758('0x49')]);_0xc75478['filters']=_[_0x5758('0x4b')](_0xc75478[_0x5758('0x47')],_0xc75478[_0x5758('0x49')]);_0x4e3b46[_0x5758('0x4c')]=_['intersection'](_0xc75478[_0x5758('0x47')],qs[_0x5758('0x4d')](_0x2b8989['query'][_0x5758('0x4d')]));_0x4e3b46[_0x5758('0x4c')]=_0x4e3b46['attributes']['length']?_0x4e3b46['attributes']:_0xc75478[_0x5758('0x47')];if(!_0x2b8989[_0x5758('0x49')][_0x5758('0x4f')]('nolimit')){_0x4e3b46[_0x5758('0x31')]=qs[_0x5758('0x31')](_0x2b8989['query'][_0x5758('0x31')]);_0x4e3b46['offset']=qs[_0x5758('0x30')](_0x2b8989[_0x5758('0x49')][_0x5758('0x30')]);}_0x4e3b46['order']=qs[_0x5758('0x52')](_0x2b8989['query'][_0x5758('0x52')]);_0x4e3b46[_0x5758('0x53')]=qs[_0x5758('0x4a')](_['pick'](_0x2b8989[_0x5758('0x49')],_0xc75478[_0x5758('0x4a')]));_0x4e3b46[_0x5758('0x53')][_0x5758('0x6e')]=_0xffb2b8['id'];if(_0x2b8989['query'][_0x5758('0x6f')]){_0x4e3b46[_0x5758('0x53')]=_[_0x5758('0x56')](_0x4e3b46[_0x5758('0x53')],{'$or':_[_0x5758('0x41')](_0x4e3b46[_0x5758('0x4c')],function(_0x4cb49){var _0x24123d={};_0x24123d[_0x4cb49]={'$like':'%'+_0x2b8989['query']['filter']+'%'};return _0x24123d;})});}_0x4e3b46=_['merge']({},_0x4e3b46,_0x2b8989[_0x5758('0x57')]);return db[_0x5758('0x77')][_0x5758('0x33')]({'where':_0x4e3b46['where']})[_0x5758('0x23')](function(_0x55473e){_0x1c79d6[_0x5758('0x33')]=_0x55473e;if(_0x2b8989[_0x5758('0x49')][_0x5758('0x5e')]){_0x4e3b46['include']=[{'model':db[_0x5758('0x79')],'as':_0x5758('0x7a'),'required':![]},{'model':db[_0x5758('0x7b')],'as':_0x5758('0x7c'),'attributes':[_0x5758('0x48'),_0x5758('0x7d'),_0x5758('0x7e')],'required':![]},{'model':db['Tag'],'as':_0x5758('0x7f'),'attributes':['id','name','color'],'where':_0x2b8989[_0x5758('0x49')][_0x5758('0x80')]?{'id':_0x2b8989[_0x5758('0x49')][_0x5758('0x80')]}:undefined,'required':_0x2b8989[_0x5758('0x49')][_0x5758('0x80')]?!![]:![]}];}return db[_0x5758('0x77')][_0x5758('0x59')](_0x4e3b46);})[_0x5758('0x23')](function(_0xc61e2){_0x1c79d6[_0x5758('0x5a')]=_0xc61e2;return _0x1c79d6;});}})['then'](respondWithFilteredResult(_0x3c25be,_0x4e3b46))[_0x5758('0x2c')](handleError(_0x3c25be,null));};exports[_0x5758('0x81')]=function(_0x1d589b,_0x5a71bb){var _0x5097d3=_0x1d589b[_0x5758('0x68')]['id'];var _0x2fdf41=_0x1d589b[_0x5758('0x60')];var _0x5771b5=0xc8;var _0x3ece4e=null;return db[_0x5758('0x82')][_0x5758('0x83')]({'isolationLevel':db['sequelize']['Transaction'][_0x5758('0x84')][_0x5758('0x85')]},function(_0xab160e){return db['FaxAccount'][_0x5758('0x6d')]({'where':{'id':_0x5097d3},'transaction':_0xab160e})[_0x5758('0x23')](function(_0xe82faa){if(_0xe82faa){return db[_0x5758('0x86')][_0x5758('0x3a')]({'where':{'FaxAccountId':_0x5097d3},'transaction':_0xab160e})[_0x5758('0x23')](function(){var _0xc3a31c=_[_0x5758('0x41')](_0x2fdf41,function(_0x2eff1c){_0x2eff1c[_0x5758('0x6e')]=_0x5097d3;return _0x2eff1c;});return db[_0x5758('0x86')][_0x5758('0x87')](_0xc3a31c,{'transaction':_0xab160e});});}else{_0x5771b5=0x194;_0x3ece4e=[];}});})['then'](function(){if(_0x5771b5!==0x194){return db['FaxApplication'][_0x5758('0x88')]({'where':{'FaxAccountId':_0x5097d3},'order':_0x5758('0x89')})[_0x5758('0x23')](function(_0x2eb2f1){_0x3ece4e=_0x2eb2f1;});}})[_0x5758('0x2c')](function(_0x5bc6e9){_0x5771b5=0x1f4;logger['error'](_0x5bc6e9[_0x5758('0x3d')]);if(_0x5bc6e9[_0x5758('0x48')]){delete _0x5bc6e9['name'];}_0x3ece4e=_0x5bc6e9;})[_0x5758('0x8a')](function(){if(_0x3ece4e===null){_0x5a71bb[_0x5758('0x2d')](_0x5771b5);}else{if(_0x5771b5===0x1f4){_0x5a71bb[_0x5758('0x34')](_0x5771b5)[_0x5758('0x3e')](_0x3ece4e);}else{_0x5a71bb[_0x5758('0x34')](_0x5771b5)[_0x5758('0x2f')](_0x3ece4e);}}});};exports[_0x5758('0x8b')]=function(_0x27e438,_0x2ca51b,_0x278e97){var _0x578b85={};var _0x3a6600={};var _0x43110c;var _0x9fdd5d;return db[_0x5758('0x42')][_0x5758('0x6d')]({'where':{'id':_0x27e438[_0x5758('0x68')]['id']}})[_0x5758('0x23')](handleEntityNotFound(_0x2ca51b,null))[_0x5758('0x23')](function(_0x27e896){if(_0x27e896){_0x43110c=_0x27e896;_0x3a6600['model']=_[_0x5758('0x5d')](db['FaxApplication'][_0x5758('0x43')]);_0x3a6600[_0x5758('0x49')]=_['keys'](_0x27e438[_0x5758('0x49')]);_0x3a6600[_0x5758('0x4a')]=_[_0x5758('0x4b')](_0x3a6600['model'],_0x3a6600[_0x5758('0x49')]);_0x578b85[_0x5758('0x4c')]=_[_0x5758('0x4b')](_0x3a6600[_0x5758('0x47')],qs[_0x5758('0x4d')](_0x27e438[_0x5758('0x49')][_0x5758('0x4d')]));_0x578b85[_0x5758('0x4c')]=_0x578b85['attributes'][_0x5758('0x4e')]?_0x578b85['attributes']:_0x3a6600[_0x5758('0x47')];_0x578b85[_0x5758('0x51')]=qs['sort'](_0x27e438[_0x5758('0x49')][_0x5758('0x52')]);_0x578b85[_0x5758('0x53')]=qs[_0x5758('0x4a')](_[_0x5758('0x54')](_0x27e438[_0x5758('0x49')],_0x3a6600[_0x5758('0x4a')]));if(_0x27e438[_0x5758('0x49')][_0x5758('0x6f')]){_0x578b85['where']=_['merge'](_0x578b85[_0x5758('0x53')],{'$or':_[_0x5758('0x41')](_0x578b85[_0x5758('0x4c')],function(_0x577a87){var _0x3fcc81={};_0x3fcc81[_0x577a87]={'$like':'%'+_0x27e438['query']['filter']+'%'};return _0x3fcc81;})});}_0x578b85=_['merge']({},_0x578b85,_0x27e438['options']);return _0x43110c[_0x5758('0x8b')](_0x578b85);}})['then'](function(_0x54a99d){if(_0x54a99d){_0x9fdd5d=_0x54a99d['length'];if(!_0x27e438[_0x5758('0x49')][_0x5758('0x4f')](_0x5758('0x50'))){_0x578b85['limit']=qs[_0x5758('0x31')](_0x27e438[_0x5758('0x49')][_0x5758('0x31')]);_0x578b85['offset']=qs[_0x5758('0x30')](_0x27e438[_0x5758('0x49')][_0x5758('0x30')]);}return _0x43110c[_0x5758('0x8b')](_0x578b85);}})[_0x5758('0x23')](function(_0xc2e326){if(_0xc2e326){return _0xc2e326?{'count':_0x9fdd5d,'rows':_0xc2e326}:null;}})['then'](respondWithResult(_0x2ca51b,null))['catch'](handleError(_0x2ca51b,null));};function Extension(_0x4768b8,_0x107358,_0x4b0193,_0x317a0c){this[_0x5758('0x8c')]=_0x5758('0x8d');this[_0x5758('0x8e')]=_0x4768b8[_0x5758('0x8f')];this[_0x5758('0x90')]=_0x317a0c;this[_0x5758('0x45')]='system';this['description']=_0x5758('0x91');this[_0x5758('0x6e')]=_0x4768b8['id'];this['priority']=_0x107358;this[_0x5758('0x92')]=_0x4b0193;}function createExtensionsReciveFax(_0x240081){var _0x246fe7=0x1;var _0x2bf310=[];_0x2bf310[_0x5758('0x93')](new Extension(_0x240081,_0x246fe7,'','Answer'));_0x246fe7+=0x1;_0x2bf310[_0x5758('0x93')](new Extension(_0x240081,_0x246fe7,_0x5758('0x94'),'Set'));_0x246fe7+=0x1;for(var _0x427c7d in _0x240081){if(_0x240081[_0x5758('0x4f')](_0x427c7d)&&(_0x427c7d==='ecm'||_0x427c7d==='localstationid'||_0x427c7d==='gateway'||_0x427c7d==='faxdetect'||_0x427c7d===_0x5758('0x95')||_0x427c7d===_0x5758('0x96')||_0x427c7d==='minrate'||_0x427c7d==='modem'||_0x427c7d==='t38timeout')){_0x2bf310[_0x5758('0x93')](new Extension(_0x240081,_0x246fe7,_0x5758('0x97')+_0x427c7d+')='+_0x240081[_0x427c7d],_0x5758('0x98')));_0x246fe7+=0x1;}}_0x2bf310[_0x5758('0x93')](new Extension(_0x240081,_0x246fe7,'6',_0x5758('0x99')));_0x246fe7+=0x1;_0x2bf310[_0x5758('0x93')](new Extension(_0x240081,_0x246fe7,'/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'));_0x246fe7=0x0;return _0x2bf310;}exports[_0x5758('0x9a')]=function(_0x2d9aa7,_0x4fd253,_0x35309b){var _0x169c55;return db[_0x5758('0x82')]['transaction'](function(_0x1271ef){return db['FaxAccount'][_0x5758('0x5f')](_0x2d9aa7['body'],{'transaction':_0x1271ef})[_0x5758('0x23')](function(_0x47fbb6){_0x169c55=_0x47fbb6[_0x5758('0x3b')]({'plain':!![]});return db[_0x5758('0x9b')][_0x5758('0x87')](createExtensionsReciveFax(_0x169c55),{'transaction':_0x1271ef});});})[_0x5758('0x23')](function(){return _0x169c55;})['then'](respondWithResult(_0x4fd253,null))[_0x5758('0x2c')](handleError(_0x4fd253,null));};exports[_0x5758('0x9c')]=function(_0x3d76e3,_0x13cb81,_0x4ce716){var _0x47cb9a;return db[_0x5758('0x82')][_0x5758('0x83')](function(_0x15b031){return db['FaxAccount'][_0x5758('0x39')](_0x3d76e3[_0x5758('0x60')],{'where':{'id':_0x3d76e3[_0x5758('0x60')]['id']},'transaction':_0x15b031})[_0x5758('0x23')](function(_0xfa8391){return db[_0x5758('0x9b')][_0x5758('0x3a')]({'where':{'FaxAccountId':_0x3d76e3['body']['id']},'transaction':_0x15b031})[_0x5758('0x23')](function(_0x548cd2){return db[_0x5758('0x9b')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x3d76e3[_0x5758('0x60')],[_0x5758('0x9d'),_0x5758('0x46'),'createdAt',_0x5758('0x9e'),'TrunkId','ListId'])),{'transaction':_0x15b031});});});})[_0x5758('0x23')](function(){return db[_0x5758('0x42')][_0x5758('0x9f')](_0x3d76e3['body']['id']);})[_0x5758('0x23')](respondWithResult(_0x13cb81,null))[_0x5758('0x2c')](handleError(_0x13cb81,null));};exports[_0x5758('0xa0')]=function(_0x1be423,_0x2ef587,_0x25bd6d){var _0x425710={'raw':!![],'where':{}};var _0x50dfe8={};var _0x2c73fe={'count':0x0,'rows':[]};return db[_0x5758('0x42')][_0x5758('0x6d')]({'where':{'id':_0x1be423[_0x5758('0x68')]['id']}})['then'](handleEntityNotFound(_0x2ef587,null))['then'](function(_0x3fb1c3){if(_0x3fb1c3){_0x50dfe8[_0x5758('0x47')]=_[_0x5758('0x5d')](db[_0x5758('0xa1')]['rawAttributes']);_0x50dfe8[_0x5758('0x49')]=_['keys'](_0x1be423['query']);_0x50dfe8['filters']=_['intersection'](_0x50dfe8[_0x5758('0x47')],_0x50dfe8[_0x5758('0x49')]);_0x425710[_0x5758('0x4c')]=_[_0x5758('0x4b')](_0x50dfe8[_0x5758('0x47')],qs['fields'](_0x1be423[_0x5758('0x49')][_0x5758('0x4d')]));_0x425710[_0x5758('0x4c')]=_0x425710[_0x5758('0x4c')][_0x5758('0x4e')]?_0x425710['attributes']:_0x50dfe8[_0x5758('0x47')];if(!_0x1be423[_0x5758('0x49')][_0x5758('0x4f')](_0x5758('0x50'))){_0x425710[_0x5758('0x31')]=qs[_0x5758('0x31')](_0x1be423[_0x5758('0x49')]['limit']);_0x425710[_0x5758('0x30')]=qs[_0x5758('0x30')](_0x1be423[_0x5758('0x49')][_0x5758('0x30')]);}_0x425710[_0x5758('0x51')]=qs[_0x5758('0x52')](_0x1be423[_0x5758('0x49')][_0x5758('0x52')]);_0x425710[_0x5758('0x53')]=qs[_0x5758('0x4a')](_[_0x5758('0x54')](_0x1be423[_0x5758('0x49')],_0x50dfe8[_0x5758('0x4a')]));_0x425710['where'][_0x5758('0x6e')]=_0x3fb1c3['id'];if(_0x1be423[_0x5758('0x49')][_0x5758('0x6f')]){_0x425710[_0x5758('0x53')]=_[_0x5758('0x56')](_0x425710[_0x5758('0x53')],{'$or':_['map'](_0x425710[_0x5758('0x4c')],function(_0x12f906){var _0x5670bd={};_0x5670bd[_0x12f906]={'$like':'%'+_0x1be423[_0x5758('0x49')]['filter']+'%'};return _0x5670bd;})});}if(_0x1be423[_0x5758('0x49')][_0x5758('0xa2')]){var _0x5de65e=_0x1be423[_0x5758('0x49')]['$gte'][_0x5758('0xa3')](',');var _0x11ea41={};_0x11ea41[_0x5de65e[0x0]]={'$gte':moment(_0x5de65e[0x1])[_0x5758('0xa4')](_0x5758('0xa5'))};_0x425710['where']=_[_0x5758('0x56')](_0x425710[_0x5758('0x53')],_0x11ea41);}_0x425710=_[_0x5758('0x56')]({},_0x425710,_0x1be423[_0x5758('0x57')]);return db['FaxMessage'][_0x5758('0x33')]({'where':_0x425710[_0x5758('0x53')]})[_0x5758('0x23')](function(_0x25b58a){_0x2c73fe[_0x5758('0x33')]=_0x25b58a;if(_0x1be423[_0x5758('0x49')]['includeAll']){_0x425710['include']=[{'all':!![]}];}return db[_0x5758('0xa1')][_0x5758('0x59')](_0x425710);})['then'](function(_0x3dfa81){_0x2c73fe[_0x5758('0x5a')]=_0x3dfa81;return _0x2c73fe;});}})['then'](respondWithFilteredResult(_0x2ef587,_0x425710))['catch'](handleError(_0x2ef587,null));};exports[_0x5758('0x3e')]=function(_0x6af8a1,_0x4d05b1,_0x387da6){var _0x3dec47,_0x3e63e7={},_0x22ed7e;if(_0x6af8a1['body']['to']){_0x22ed7e=_0x6af8a1[_0x5758('0x60')]['to'][0x0];}return db[_0x5758('0x42')][_0x5758('0x67')]({'where':{'id':_0x6af8a1[_0x5758('0x68')]['id']},'include':[{'model':db['CmList'],'as':_0x5758('0xa6'),'include':[{'model':db[_0x5758('0x79')],'as':_0x5758('0xa7'),'where':{'fax':_0x22ed7e},'limit':0x1,'order':[['updatedAt',_0x5758('0xa8')]]}]}]})[_0x5758('0x23')](handleEntityNotFound(_0x4d05b1,null))[_0x5758('0x23')](function(_0x265e93){_0x3dec47=_0x265e93;if(_0x6af8a1[_0x5758('0x60')]['attachments']&&_0x6af8a1[_0x5758('0x60')][_0x5758('0xa9')]['length']){for(var _0x109dd7=0x0;_0x109dd7<_0x6af8a1[_0x5758('0x60')][_0x5758('0xa9')][_0x5758('0x4e')];_0x109dd7+=0x1){_0x6af8a1['body'][_0x5758('0xa9')][_0x109dd7]={'filename':_0x6af8a1[_0x5758('0x60')][_0x5758('0xa9')][_0x109dd7][_0x5758('0x48')],'id':_0x6af8a1['body'][_0x5758('0xa9')][_0x109dd7]['id'],'path':path[_0x5758('0xaa')](config[_0x5758('0xab')],_0x5758('0xac'),_0x6af8a1[_0x5758('0x60')][_0x5758('0xa9')][_0x109dd7][_0x5758('0xad')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_['isNil'](_0x6af8a1['params']['id'])?undefined:_0x6af8a1['params']['id'],'path':_['isNil'](_0x6af8a1['body'][_0x5758('0xa9')][0x0]['path'])?undefined:_0x6af8a1['body'][_0x5758('0xa9')][0x0][_0x5758('0xae')],'fax':_['isNil'](_0x6af8a1[_0x5758('0x60')]['to'][0x0])?undefined:_0x6af8a1['body']['to'][0x0]},client9002);})[_0x5758('0x23')](function(){if(_0x3dec47){if(_[_0x5758('0xaf')](_0x6af8a1[_0x5758('0x60')][_0x5758('0xb0')])){_0x6af8a1[_0x5758('0x60')][_0x5758('0xb0')]=util[_0x5758('0xa4')](_0x5758('0xb1'),_0x3dec47['name'],_0x3dec47[_0x5758('0xb2')]);}if(_0x3dec47[_0x5758('0xa6')]){if(_0x3dec47[_0x5758('0xa6')]['Contacts'][_0x5758('0x4e')]){return _0x3dec47[_0x5758('0xa6')]['Contacts'][0x0];}else{return db[_0x5758('0x79')]['create'](_['defaults'](_0x6af8a1[_0x5758('0x60')],{'firstName':_0x6af8a1[_0x5758('0x60')]['to'][0x0],'phone':_0x6af8a1[_0x5758('0x60')]['to'][0x0],'fax':_0x6af8a1[_0x5758('0x60')]['to'][0x0],'ListId':_0x3dec47[_0x5758('0xb3')]}));}}else{throw new Error(_0x5758('0xb4'));}}else{throw new Error(_0x5758('0xb5'));}})[_0x5758('0x23')](function(_0x38fbda){if(_0x38fbda){return db['FaxInteraction']['find']({'where':{'ContactId':_0x38fbda['id'],'closed':![],'FaxAccountId':_0x3dec47['id']}})[_0x5758('0x23')](function(_0x2eda11){if(_0x2eda11){return[_0x2eda11,![]];}return db['FaxInteraction'][_0x5758('0x5f')]({'UserId':_0x6af8a1[_0x5758('0x61')]['id'],'ContactId':_0x38fbda['id'],'FaxAccountId':_0x3dec47['id'],'fax':_0x6af8a1['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x5758('0x56')](_0x6af8a1[_0x5758('0x60')],{'read':![],'body':_0x6af8a1['body']['attachments'][0x0][_0x5758('0xb6')],'FaxAccountId':_0x3dec47['id'],'UserId':_0x6af8a1[_0x5758('0x61')]['id'],'ContactId':_0x38fbda['id'],'AttachmentId':_0x6af8a1[_0x5758('0x60')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x5758('0xa1')],'as':_0x5758('0xb7')}]})[_0x5758('0x23')](function(_0x3e60a6){return[_0x3e60a6,!![]];});});}else{throw new Error(_0x5758('0xb8'));}})['spread'](function(_0x2fc4b3,_0x3bb301){if(_0x3bb301){return _0x2fc4b3;}return db[_0x5758('0xa1')][_0x5758('0x5f')]({'direction':_0x5758('0xb9'),'read':![],'body':_0x6af8a1[_0x5758('0x60')][_0x5758('0xa9')][0x0][_0x5758('0xb6')],'FaxAccountId':_0x3dec47['id'],'FaxInteractionId':_0x2fc4b3['id'],'UserId':_0x6af8a1[_0x5758('0x61')]['id'],'ContactId':_0x2fc4b3[_0x5758('0xba')],'AttachmentId':_0x6af8a1[_0x5758('0x60')]['attachments'][0x0]['id']})[_0x5758('0x23')](function(_0x25cf05){_0x2fc4b3['dataValues'][_0x5758('0xb7')]=[];_0x2fc4b3['dataValues'][_0x5758('0xb7')][_0x5758('0x93')](_0x25cf05[_0x5758('0xbb')]);return _0x2fc4b3;});})['then'](function(_0x4d13b5){respondWithRpcPromise(_0x5758('0xbc'),_0x5758('0xbc'),{'FaxAccountId':_['isNil'](_0x6af8a1[_0x5758('0x68')]['id'])?undefined:_0x6af8a1[_0x5758('0x68')]['id'],'path':_['isNil'](_0x6af8a1[_0x5758('0x60')][_0x5758('0xa9')][0x0]['path'])?undefined:_0x6af8a1[_0x5758('0x60')][_0x5758('0xa9')][0x0][_0x5758('0xae')],'fax':_['isNil'](_0x6af8a1[_0x5758('0x60')]['to'][0x0])?undefined:_0x6af8a1[_0x5758('0x60')]['to'][0x0],'AttachmentId':_0x6af8a1[_0x5758('0x60')][_0x5758('0xa9')][0x0]['id']},client9002)[_0x5758('0x23')](function(_0x18ee11){logger['info'](_0x5758('0xbd'),_0x18ee11);})[_0x5758('0x2c')](function(_0xd8f263){logger[_0x5758('0x24')]('SendFaxRpc,\x20%s',_0xd8f263);});return _0x4d13b5;})[_0x5758('0x23')](respondWithResult(_0x4d05b1,null))[_0x5758('0x2c')](handleError(_0x4d05b1,null));};exports[_0x5758('0xbe')]=function(_0x5c0ff5,_0x38de88,_0x4280d9){return db['FaxAccount'][_0x5758('0x67')]({'where':{'id':_0x5c0ff5[_0x5758('0x68')]['id']}})[_0x5758('0x23')](handleEntityNotFound(_0x38de88,null))[_0x5758('0x23')](function(_0xc54a9f){if(_0xc54a9f){return _0xc54a9f[_0x5758('0xbe')](_0x5c0ff5[_0x5758('0x60')][_0x5758('0x75')],_[_0x5758('0xbf')](_0x5c0ff5[_0x5758('0x60')],['ids','id'])||{})['spread'](function(_0x16c8c5){for(var _0x121f05=0x0;_0x121f05<_0x5c0ff5[_0x5758('0x60')][_0x5758('0x75')][_0x5758('0x4e')];_0x121f05+=0x1){socket[_0x5758('0xc0')](_0x5758('0xc1'),{'UserId':Number(_0x5c0ff5[_0x5758('0x60')][_0x5758('0x75')][_0x121f05]),'FaxAccountId':Number(_0x5c0ff5[_0x5758('0x68')]['id'])});}return _0x16c8c5;});}})[_0x5758('0x23')](respondWithResult(_0x38de88,null))[_0x5758('0x2c')](handleError(_0x38de88,null));};exports['removeAgents']=function(_0x2dd76e,_0x4cc8ba,_0x55b224){return db[_0x5758('0x42')][_0x5758('0x67')]({'where':{'id':_0x2dd76e[_0x5758('0x68')]['id']}})[_0x5758('0x23')](handleEntityNotFound(_0x4cc8ba,null))['then'](function(_0x5f0f3e){if(_0x5f0f3e){return _0x5f0f3e['removeAgents'](_0x2dd76e['query']['ids'])[_0x5758('0x23')](function(){if(_[_0x5758('0xc2')](_0x2dd76e[_0x5758('0x49')][_0x5758('0x75')])){for(var _0x4c09ba=0x0;_0x4c09ba<_0x2dd76e[_0x5758('0x49')]['ids'][_0x5758('0x4e')];_0x4c09ba+=0x1){socket[_0x5758('0xc0')](_0x5758('0xc3'),{'UserId':Number(_0x2dd76e[_0x5758('0x49')]['ids'][_0x4c09ba]),'FaxAccountId':Number(_0x2dd76e[_0x5758('0x68')]['id'])});}}else{socket['emit'](_0x5758('0xc3'),{'UserId':Number(_0x2dd76e[_0x5758('0x49')][_0x5758('0x75')]),'FaxAccountId':Number(_0x2dd76e[_0x5758('0x68')]['id'])});}});}})[_0x5758('0x23')](respondWithStatusCode(_0x4cc8ba,null))['catch'](handleError(_0x4cc8ba,null));};exports[_0x5758('0xc4')]=function(_0x14a762,_0xa14c32,_0x3aee97){var _0x15282b={};var _0x5d286d={};var _0x576afd;var _0x4a49bc;return db[_0x5758('0x42')][_0x5758('0x6d')]({'where':{'id':_0x14a762[_0x5758('0x68')]['id']}})['then'](handleEntityNotFound(_0xa14c32,null))[_0x5758('0x23')](function(_0x42f08a){if(_0x42f08a){_0x576afd=_0x42f08a;_0x5d286d['model']=_['keys'](db[_0x5758('0x7b')][_0x5758('0x43')]);_0x5d286d[_0x5758('0x49')]=_[_0x5758('0x5d')](_0x14a762[_0x5758('0x49')]);_0x5d286d[_0x5758('0x4a')]=_[_0x5758('0x4b')](_0x5d286d['model'],_0x5d286d['query']);_0x15282b['attributes']=_[_0x5758('0x4b')](_0x5d286d['model'],qs['fields'](_0x14a762[_0x5758('0x49')][_0x5758('0x4d')]));_0x15282b[_0x5758('0x4c')]=_0x15282b[_0x5758('0x4c')][_0x5758('0x4e')]?_0x15282b[_0x5758('0x4c')]:_0x5d286d['model'];_0x15282b[_0x5758('0x51')]=qs[_0x5758('0x52')](_0x14a762[_0x5758('0x49')][_0x5758('0x52')]);_0x15282b[_0x5758('0x53')]=qs[_0x5758('0x4a')](_[_0x5758('0x54')](_0x14a762['query'],_0x5d286d[_0x5758('0x4a')]));if(_0x14a762[_0x5758('0x49')][_0x5758('0x6f')]){_0x15282b[_0x5758('0x53')]=_[_0x5758('0x56')](_0x15282b[_0x5758('0x53')],{'$or':_[_0x5758('0x41')](_0x15282b['attributes'],function(_0x7a364f){var _0x758277={};_0x758277[_0x7a364f]={'$like':'%'+_0x14a762[_0x5758('0x49')][_0x5758('0x6f')]+'%'};return _0x758277;})});}_0x15282b=_[_0x5758('0x56')]({},_0x15282b,_0x14a762[_0x5758('0x57')]);return _0x576afd[_0x5758('0xc4')](_0x15282b);}})[_0x5758('0x23')](function(_0x5367f7){if(_0x5367f7){_0x4a49bc=_0x5367f7[_0x5758('0x4e')];if(!_0x14a762[_0x5758('0x49')]['hasOwnProperty'](_0x5758('0x50'))){_0x15282b[_0x5758('0x31')]=qs[_0x5758('0x31')](_0x14a762[_0x5758('0x49')][_0x5758('0x31')]);_0x15282b[_0x5758('0x30')]=qs[_0x5758('0x30')](_0x14a762['query'][_0x5758('0x30')]);}return _0x576afd['getAgents'](_0x15282b);}})['then'](function(_0x171b1f){if(_0x171b1f){return _0x171b1f?{'count':_0x4a49bc,'rows':_0x171b1f}:null;}})['then'](respondWithResult(_0xa14c32,null))[_0x5758('0x2c')](handleError(_0xa14c32,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 5ae86ba..7c151c8 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 _0x646e=['hasOwnProperty','exports','../../mysqldb','FaxAccount','save','emit'];(function(_0x2d123d,_0x33d75c){var _0x59e4f8=function(_0x52e357){while(--_0x52e357){_0x2d123d['push'](_0x2d123d['shift']());}};_0x59e4f8(++_0x33d75c);}(_0x646e,0xc2));var _0xe646=function(_0x45b2fc,_0x2bc1f5){_0x45b2fc=_0x45b2fc-0x0;var _0x44ccfd=_0x646e[_0x45b2fc];return _0x44ccfd;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xe646('0x0'))['db'][_0xe646('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe646('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2d32c1){return function(_0x4e9938,_0x31495d,_0x4d98db){FaxAccountEvents[_0xe646('0x3')](_0x2d32c1+':'+_0x4e9938['id'],_0x4e9938);FaxAccountEvents[_0xe646('0x3')](_0x2d32c1,_0x4e9938);_0x4d98db(null);};}for(var e in events){if(events[_0xe646('0x4')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xe646('0x5')]=FaxAccountEvents; \ No newline at end of file +var _0xb5d0=['events','../../mysqldb','FaxAccount','setMaxListeners','save','update','emit','hook','exports'];(function(_0x53c99e,_0x1f751c){var _0x5936c8=function(_0x4bb202){while(--_0x4bb202){_0x53c99e['push'](_0x53c99e['shift']());}};_0x5936c8(++_0x1f751c);}(_0xb5d0,0x75));var _0x0b5d=function(_0x44decb,_0x5e98c4){_0x44decb=_0x44decb-0x0;var _0x1e249a=_0xb5d0[_0x44decb];return _0x1e249a;};'use strict';var EventEmitter=require(_0x0b5d('0x0'));var FaxAccount=require(_0x0b5d('0x1'))['db'][_0x0b5d('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0b5d('0x3')](0x0);var events={'afterCreate':_0x0b5d('0x4'),'afterUpdate':_0x0b5d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1742a5){return function(_0x28afb1,_0xf942cf,_0x3a3850){FaxAccountEvents[_0x0b5d('0x6')](_0x1742a5+':'+_0x28afb1['id'],_0x28afb1);FaxAccountEvents[_0x0b5d('0x6')](_0x1742a5,_0x28afb1);_0x3a3850(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x0b5d('0x7')](e,emitEvent(event));}}module[_0x0b5d('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 a0138b2..ade24b5 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 _0x6966=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount'];(function(_0x5575e9,_0x3619ca){var _0x58d2cf=function(_0x1c4ebf){while(--_0x1c4ebf){_0x5575e9['push'](_0x5575e9['shift']());}};_0x58d2cf(++_0x3619ca);}(_0x6966,0x1e0));var _0x6696=function(_0x4c0629,_0xc61b41){_0x4c0629=_0x4c0629-0x0;var _0xe34b2a=_0x6966[_0x4c0629];return _0xe34b2a;};'use strict';var _=require(_0x6696('0x0'));var util=require(_0x6696('0x1'));var logger=require(_0x6696('0x2'))(_0x6696('0x3'));var moment=require(_0x6696('0x4'));var BPromise=require(_0x6696('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6696('0x6'));var rimraf=require(_0x6696('0x7'));var config=require(_0x6696('0x8'));var attributes=require(_0x6696('0x9'));module[_0x6696('0xa')]=function(_0x1a72d8,_0x4b3096){return _0x1a72d8['define'](_0x6696('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x967a=['exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5a7c25,_0x5d2b30){var _0x5df5ec=function(_0x352e46){while(--_0x352e46){_0x5a7c25['push'](_0x5a7c25['shift']());}};_0x5df5ec(++_0x5d2b30);}(_0x967a,0x7c));var _0xa967=function(_0x5cca41,_0x4ac32e){_0x5cca41=_0x5cca41-0x0;var _0x54f846=_0x967a[_0x5cca41];return _0x54f846;};'use strict';var _=require(_0xa967('0x0'));var util=require(_0xa967('0x1'));var logger=require(_0xa967('0x2'))(_0xa967('0x3'));var moment=require(_0xa967('0x4'));var BPromise=require(_0xa967('0x5'));var rp=require(_0xa967('0x6'));var fs=require('fs');var path=require(_0xa967('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0xa967('0x8')]=function(_0x5ce9e4,_0x33872e){return _0x5ce9e4[_0xa967('0x9')](_0xa967('0xa'),attributes,{'tableName':_0xa967('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index e8ad90d..b190653 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 _0xc86d=['attributes','NotifyFaxAccount','body','fax','CmContact','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','account','CmList','List','Contacts','DESC','Applications','get','applications','list','orderBy','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','unshift','agent','name','waitForTheAssignedAgent','FaxQueue','queueId','queue','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','limit','include','map','model'];(function(_0x20d615,_0x1e10d2){var _0x4aede2=function(_0x4fe09b){while(--_0x4fe09b){_0x20d615['push'](_0x20d615['shift']());}};_0x4aede2(++_0x1e10d2);}(_0xc86d,0x149));var _0xdc86=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xc86d[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xdc86('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdc86('0x1'));var rs=require(_0xdc86('0x2'));var fs=require('fs');var Redis=require(_0xdc86('0x3'));var db=require(_0xdc86('0x4'))['db'];var utils=require(_0xdc86('0x5'));var logger=require(_0xdc86('0x6'))('rpc');var config=require(_0xdc86('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdc86('0x8')][_0xdc86('0x9')]({'port':0x232c});config[_0xdc86('0xa')]=_[_0xdc86('0xb')](config[_0xdc86('0xa')],{'host':_0xdc86('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc86('0xa')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x2f4b3e,_0x249151,_0x4e71cc){return new BPromise(function(_0x114a70,_0x2e7924){return client[_0xdc86('0xd')](_0x2f4b3e,_0x4e71cc)[_0xdc86('0xe')](function(_0x5c303b){logger[_0xdc86('0xf')](_0xdc86('0x10'),_0x249151,_0xdc86('0x11'));logger[_0xdc86('0x12')](_0xdc86('0x13'),_0x249151,_0xdc86('0x11'),JSON[_0xdc86('0x14')](_0x5c303b));if(_0x5c303b[_0xdc86('0x15')]){if(_0x5c303b[_0xdc86('0x15')][_0xdc86('0x16')]===0x1f4){logger[_0xdc86('0x15')](_0xdc86('0x10'),_0x249151,_0x5c303b[_0xdc86('0x15')][_0xdc86('0x17')]);return _0x2e7924(_0x5c303b[_0xdc86('0x15')][_0xdc86('0x17')]);}logger['error'](_0xdc86('0x10'),_0x249151,_0x5c303b[_0xdc86('0x15')][_0xdc86('0x17')]);return _0x114a70(_0x5c303b[_0xdc86('0x15')][_0xdc86('0x17')]);}else{logger['info'](_0xdc86('0x10'),_0x249151,_0xdc86('0x11'));_0x114a70(_0x5c303b[_0xdc86('0x18')][_0xdc86('0x17')]);}})[_0xdc86('0x19')](function(_0x55f678){logger['error'](_0xdc86('0x10'),_0x249151,_0x55f678);_0x2e7924(_0x55f678);});});}exports[_0xdc86('0x1a')]=function(_0x592d66){var _0x8a1699=this;return new Promise(function(_0x4d5b15,_0x490de8){return db[_0xdc86('0x1b')]['findAll']({'raw':_0x592d66[_0xdc86('0x1c')]?_0x592d66[_0xdc86('0x1c')][_0xdc86('0x1d')]===undefined?!![]:![]:!![],'where':_0x592d66['options']?_0x592d66[_0xdc86('0x1c')][_0xdc86('0x1e')]||null:null,'attributes':_0x592d66['options']?_0x592d66[_0xdc86('0x1c')]['attributes']||null:null,'limit':_0x592d66[_0xdc86('0x1c')]?_0x592d66['options'][_0xdc86('0x1f')]||null:null,'include':_0x592d66[_0xdc86('0x1c')]?_0x592d66[_0xdc86('0x1c')][_0xdc86('0x20')]?_[_0xdc86('0x21')](_0x592d66[_0xdc86('0x1c')][_0xdc86('0x20')],function(_0x9d6e48){return{'model':db[_0x9d6e48[_0xdc86('0x22')]],'as':_0x9d6e48['as'],'attributes':_0x9d6e48['attributes'],'include':_0x9d6e48['include']?_[_0xdc86('0x21')](_0x9d6e48[_0xdc86('0x20')],function(_0x42b242){return{'model':db[_0x42b242[_0xdc86('0x22')]],'as':_0x42b242['as'],'attributes':_0x42b242[_0xdc86('0x23')],'include':_0x42b242['include']?_[_0xdc86('0x21')](_0x42b242[_0xdc86('0x20')],function(_0x5ad350){return{'model':db[_0x5ad350['model']],'as':_0x5ad350['as'],'attributes':_0x5ad350[_0xdc86('0x23')]};}):[]};}):[]};}):[]:[]})[_0xdc86('0xe')](function(_0x244063){logger[_0xdc86('0xf')](_0xdc86('0x1a'),_0x592d66);logger[_0xdc86('0x12')](_0xdc86('0x1a'),_0x592d66,JSON[_0xdc86('0x14')](_0x244063));_0x4d5b15(_0x244063);})[_0xdc86('0x19')](function(_0x3dff59){logger[_0xdc86('0x15')]('GetFaxAccount',_0x3dff59['message'],_0x592d66);_0x490de8(_0x8a1699[_0xdc86('0x15')](0x1f4,_0x3dff59[_0xdc86('0x17')]));});});};exports[_0xdc86('0x24')]=function(_0x4a5525,_0x82f00d,_0x480282){var _0x46a128=this;return new Promise(function(_0x3112f1,_0x3e2758){var _0x48bcd1={'body':_0x4a5525[_0xdc86('0x25')],'channel':_0xdc86('0x26')};var _0x28b0f1=[];var _0x36448a=[];var _0x258796={};return db[_0xdc86('0x27')]['describe']()[_0xdc86('0xe')](function(_0x1908ab){if(!_0x1908ab){throw new db['Sequelize'][(_0xdc86('0x28'))](_0xdc86('0x29'));}_0x28b0f1=_[_0xdc86('0x2a')](_[_0xdc86('0x2b')](_0x1908ab),[_0xdc86('0x2c'),_0xdc86('0x2d')]);_0x36448a=_['difference'](_[_0xdc86('0x2b')](_0x1908ab),[_0xdc86('0x2c'),_0xdc86('0x2d'),_0xdc86('0x2e'),_0xdc86('0x2f')]);if(_0x4a5525[_0xdc86('0x25')]['id']){delete _0x4a5525[_0xdc86('0x25')]['id'];}if(_[_0xdc86('0x30')](_0x4a5525[_0xdc86('0x25')][_0xdc86('0x31')])){throw new db[(_0xdc86('0x32'))][(_0xdc86('0x28'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x4a5525['body']['body'])||_0x4a5525['body']['body']===''){throw new db[(_0xdc86('0x32'))][(_0xdc86('0x28'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdc86('0x30')](_0x4a5525['body']['mapKey'])){throw new db['Sequelize'][(_0xdc86('0x28'))](_0xdc86('0x33')+_0x36448a);}if(!_['includes'](_0x36448a,_0x4a5525[_0xdc86('0x25')]['mapKey'])){throw new db['Sequelize'][(_0xdc86('0x28'))](_0xdc86('0x34')+_0x36448a);}_0x258796[_0x4a5525[_0xdc86('0x25')][_0xdc86('0x35')]]=_0x4a5525[_0xdc86('0x25')][_0xdc86('0x31')];})['then'](function(){return db[_0xdc86('0x1b')][_0xdc86('0x36')]({'where':{'id':_0x4a5525[_0xdc86('0x37')]['id']},'include':[{'model':db[_0xdc86('0x38')],'as':_0xdc86('0x39'),'include':[{'model':db[_0xdc86('0x27')],'as':_0xdc86('0x3a'),'where':_0x258796,'limit':0x1,'order':[['updatedAt',_0xdc86('0x3b')]]}]},{'model':db['FaxApplication'],'as':_0xdc86('0x3c')}]});})['then'](function(_0x33d269){if(_0x33d269&&_0x33d269[_0xdc86('0x39')]){var _0x112fff=_0x33d269[_0xdc86('0x3d')]({'plain':!![]});_0x48bcd1[_0xdc86('0x37')]=_0x112fff;_0x48bcd1[_0xdc86('0x3e')]=_0x112fff[_0xdc86('0x3c')];_0x48bcd1[_0xdc86('0x3f')]=_0x112fff[_0xdc86('0x39')];_0x48bcd1['applications']=_[_0xdc86('0x40')](_0x48bcd1[_0xdc86('0x3e')],['priority'],[_0xdc86('0x41')]);if(_0x48bcd1[_0xdc86('0x37')][_0xdc86('0x3c')]){delete _0x48bcd1[_0xdc86('0x37')][_0xdc86('0x3c')];}if(_0x48bcd1[_0xdc86('0x37')][_0xdc86('0x39')]&&_0x48bcd1[_0xdc86('0x37')][_0xdc86('0x39')]['Contacts'][_0xdc86('0x42')]){return _0x48bcd1['account'][_0xdc86('0x39')][_0xdc86('0x3a')][0x0];}var _0x385a04=_[_0xdc86('0xb')](_0x4a5525['body'],{'firstName':_0x4a5525[_0xdc86('0x25')][_0xdc86('0x31')],'ListId':_0x112fff[_0xdc86('0x2f')]});_0x385a04[_0x4a5525[_0xdc86('0x25')][_0xdc86('0x35')]]=_0x4a5525[_0xdc86('0x25')][_0xdc86('0x31')];return db[_0xdc86('0x27')][_0xdc86('0x43')](_0x385a04,{'fields':_0x28b0f1,'raw':!![]});}})['then'](function(_0x3c92c8){_0x48bcd1[_0xdc86('0x44')]=_0x3c92c8;if(_0x3c92c8){var _0x143af3={'ContactId':_0x3c92c8['id'],'FaxAccountId':_0x4a5525[_0xdc86('0x37')]['id'],'fax':_0x3c92c8[_0xdc86('0x26')]};return db[_0xdc86('0x45')]['find']({'where':{'ContactId':_0x3c92c8['id'],'closed':![],'FaxAccountId':_0x4a5525[_0xdc86('0x37')]['id']}})[_0xdc86('0xe')](function(_0xd0f9b9){if(_0xd0f9b9){return[_0xd0f9b9,![]];}return db[_0xdc86('0x45')][_0xdc86('0x43')](_0x143af3)['then'](function(_0x1fb782){return[_0x1fb782,!![]];});});}else{throw new Error(_0xdc86('0x46'));}})[_0xdc86('0x47')](function(_0x245faa,_0x38ea23){var _0x31aecd=_0x245faa[_0xdc86('0x3d')]({'plain':!![]});if(_0x38ea23){if(_0x48bcd1[_0xdc86('0x37')][_0xdc86('0x48')]){_0x48bcd1['applications'][_0xdc86('0x49')]({'id':0x0,'priority':_0x48bcd1[_0xdc86('0x3e')]['length']+0x1,'app':'close','appdata':_0xdc86('0x4a'),'interval':_0xdc86('0x4b')});}_0x31aecd[_0xdc86('0x4c')]=!![];}else{_0x31aecd['created']=![];}_0x48bcd1[_0xdc86('0x4d')]=_0x31aecd;return db[_0xdc86('0x4e')][_0xdc86('0x43')]({'body':_0x4a5525[_0xdc86('0x25')][_0xdc86('0x25')],'FaxAccountId':_0x4a5525['account']['id'],'FaxInteractionId':_0x245faa['id'],'direction':'in','ContactId':_0x245faa[_0xdc86('0x4f')],'AttachmentId':_0x4a5525[_0xdc86('0x25')][_0xdc86('0x50')]});})[_0xdc86('0xe')](function(_0x56cff1){_0x48bcd1[_0xdc86('0x17')]=_0x56cff1;if(!_0x48bcd1['interaction'][_0xdc86('0x51')])return;return db['User'][_0xdc86('0x36')]({'attributes':['id','name'],'where':{'id':_0x48bcd1['interaction'][_0xdc86('0x51')]}});})[_0xdc86('0xe')](function(_0x6bec5e){if(_0x6bec5e){_0x48bcd1[_0xdc86('0x3e')][_0xdc86('0x52')]({'id':0x0,'priority':0x0,'app':_0xdc86('0x53'),'appdata':_0x6bec5e[_0xdc86('0x54')]+','+(_0x48bcd1[_0xdc86('0x37')][_0xdc86('0x55')]||0xa),'interval':'*,*,*,*'});}if(!_0x48bcd1[_0xdc86('0x4d')]['queueId'])return;return db[_0xdc86('0x56')]['find']({'attributes':['id',_0xdc86('0x54')],'where':{'id':_0x48bcd1['interaction'][_0xdc86('0x57')]}});})[_0xdc86('0xe')](function(_0x5b6534){if(_0x5b6534){_0x48bcd1[_0xdc86('0x3e')][_0xdc86('0x52')]({'id':0x0,'priority':0x1,'app':_0xdc86('0x58'),'appdata':_0x5b6534[_0xdc86('0x54')]+','+(_0x48bcd1[_0xdc86('0x37')]['waitForTheAssignedQueue']||0x12c),'interval':_0xdc86('0x4b')});}return respondWithRpcPromise(_0xdc86('0x59'),_0xdc86('0x5a'),_0x48bcd1);})[_0xdc86('0xe')](function(_0x4dd2fc){_0x3112f1(_0x4dd2fc);})[_0xdc86('0x19')](function(_0x5afdae){_0x3e2758(_0x46a128[_0xdc86('0x15')](0x1f4,_0x5afdae[_0xdc86('0x17')]));});});}; \ No newline at end of file +var _0x837f=['describe','Sequelize','ValidationError','difference','updatedAt','keys','createdAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','DESC','Applications','list','applications','orderBy','priority','asc','Contacts','ListId','create','contact','FaxInteraction','find','spread','get','push','length','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','User','name','interaction','UserId','unshift','agent','waitForTheAssignedAgent','queueId','FaxQueue','queue','waitForTheAssignedQueue','Start','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','debug','catch','NotifyFaxAccount','body','fax','CmContact'];(function(_0x3089ee,_0x571adc){var _0x55d0eb=function(_0x411549){while(--_0x411549){_0x3089ee['push'](_0x3089ee['shift']());}};_0x55d0eb(++_0x571adc);}(_0x837f,0x159));var _0xf837=function(_0x183944,_0x2b804f){_0x183944=_0x183944-0x0;var _0xd5e1d5=_0x837f[_0x183944];return _0xd5e1d5;};'use strict';var _=require('lodash');var util=require(_0xf837('0x0'));var moment=require(_0xf837('0x1'));var BPromise=require(_0xf837('0x2'));var rs=require(_0xf837('0x3'));var fs=require('fs');var Redis=require(_0xf837('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf837('0x5'))('rpc');var config=require(_0xf837('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf837('0x7')][_0xf837('0x8')]({'port':0x232c});config[_0xf837('0x9')]=_[_0xf837('0xa')](config[_0xf837('0x9')],{'host':_0xf837('0xb'),'port':0x18eb});var socket=require(_0xf837('0xc'))(new Redis(config[_0xf837('0x9')]));require(_0xf837('0xd'))[_0xf837('0xe')](socket);function respondWithRpcPromise(_0x255d89,_0x5ab418,_0x2065de){return new BPromise(function(_0x18f2bf,_0x311902){return client[_0xf837('0xf')](_0x255d89,_0x2065de)['then'](function(_0x5c2462){logger[_0xf837('0x10')](_0xf837('0x11'),_0x5ab418,'request\x20sent');logger['debug'](_0xf837('0x12'),_0x5ab418,_0xf837('0x13'),JSON[_0xf837('0x14')](_0x5c2462));if(_0x5c2462[_0xf837('0x15')]){if(_0x5c2462[_0xf837('0x15')][_0xf837('0x16')]===0x1f4){logger[_0xf837('0x15')]('FaxAccount,\x20%s,\x20%s',_0x5ab418,_0x5c2462[_0xf837('0x15')][_0xf837('0x17')]);return _0x311902(_0x5c2462[_0xf837('0x15')][_0xf837('0x17')]);}logger['error'](_0xf837('0x11'),_0x5ab418,_0x5c2462[_0xf837('0x15')][_0xf837('0x17')]);return _0x18f2bf(_0x5c2462[_0xf837('0x15')][_0xf837('0x17')]);}else{logger[_0xf837('0x10')](_0xf837('0x11'),_0x5ab418,'request\x20sent');_0x18f2bf(_0x5c2462[_0xf837('0x18')][_0xf837('0x17')]);}})['catch'](function(_0x3522fd){logger[_0xf837('0x15')](_0xf837('0x11'),_0x5ab418,_0x3522fd);_0x311902(_0x3522fd);});});}exports[_0xf837('0x19')]=function(_0x271bfc){var _0x3faf68=this;return new Promise(function(_0x1abbae,_0x9baef3){return db[_0xf837('0x1a')][_0xf837('0x1b')]({'raw':_0x271bfc[_0xf837('0x1c')]?_0x271bfc[_0xf837('0x1c')][_0xf837('0x1d')]===undefined?!![]:![]:!![],'where':_0x271bfc[_0xf837('0x1c')]?_0x271bfc[_0xf837('0x1c')][_0xf837('0x1e')]||null:null,'attributes':_0x271bfc[_0xf837('0x1c')]?_0x271bfc[_0xf837('0x1c')][_0xf837('0x1f')]||null:null,'limit':_0x271bfc[_0xf837('0x1c')]?_0x271bfc['options'][_0xf837('0x20')]||null:null,'include':_0x271bfc[_0xf837('0x1c')]?_0x271bfc[_0xf837('0x1c')][_0xf837('0x21')]?_['map'](_0x271bfc[_0xf837('0x1c')][_0xf837('0x21')],function(_0x2fa332){return{'model':db[_0x2fa332[_0xf837('0x22')]],'as':_0x2fa332['as'],'attributes':_0x2fa332[_0xf837('0x1f')],'include':_0x2fa332[_0xf837('0x21')]?_[_0xf837('0x23')](_0x2fa332[_0xf837('0x21')],function(_0x2ded63){return{'model':db[_0x2ded63[_0xf837('0x22')]],'as':_0x2ded63['as'],'attributes':_0x2ded63[_0xf837('0x1f')],'include':_0x2ded63[_0xf837('0x21')]?_[_0xf837('0x23')](_0x2ded63['include'],function(_0x3b3fd5){return{'model':db[_0x3b3fd5[_0xf837('0x22')]],'as':_0x3b3fd5['as'],'attributes':_0x3b3fd5[_0xf837('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf837('0x24')](function(_0x270d4c){logger[_0xf837('0x10')](_0xf837('0x19'),_0x271bfc);logger[_0xf837('0x25')]('GetFaxAccount',_0x271bfc,JSON[_0xf837('0x14')](_0x270d4c));_0x1abbae(_0x270d4c);})[_0xf837('0x26')](function(_0x5de977){logger[_0xf837('0x15')]('GetFaxAccount',_0x5de977['message'],_0x271bfc);_0x9baef3(_0x3faf68[_0xf837('0x15')](0x1f4,_0x5de977['message']));});});};exports[_0xf837('0x27')]=function(_0x286777,_0x515af7,_0x1156d7){var _0x4dfef6=this;return new Promise(function(_0x17e6f5,_0x6145b1){var _0x64ee7d={'body':_0x286777[_0xf837('0x28')],'channel':_0xf837('0x29')};var _0x3c22f9=[];var _0x490bb4=[];var _0x23777f={};return db[_0xf837('0x2a')][_0xf837('0x2b')]()[_0xf837('0x24')](function(_0x5326ea){if(!_0x5326ea){throw new db[(_0xf837('0x2c'))][(_0xf837('0x2d'))]('no\x20available\x20attributes');}_0x3c22f9=_[_0xf837('0x2e')](_['keys'](_0x5326ea),['createdAt',_0xf837('0x2f')]);_0x490bb4=_[_0xf837('0x2e')](_[_0xf837('0x30')](_0x5326ea),[_0xf837('0x31'),'updatedAt',_0xf837('0x32'),'ListId']);if(_0x286777[_0xf837('0x28')]['id']){delete _0x286777[_0xf837('0x28')]['id'];}if(_[_0xf837('0x33')](_0x286777[_0xf837('0x28')][_0xf837('0x34')])){throw new db[(_0xf837('0x2c'))][(_0xf837('0x2d'))](_0xf837('0x35'));}if(_[_0xf837('0x33')](_0x286777[_0xf837('0x28')][_0xf837('0x28')])||_0x286777[_0xf837('0x28')][_0xf837('0x28')]===''){throw new db[(_0xf837('0x2c'))][(_0xf837('0x2d'))](_0xf837('0x36'));}if(_[_0xf837('0x33')](_0x286777['body'][_0xf837('0x37')])){throw new db[(_0xf837('0x2c'))]['ValidationError'](_0xf837('0x38')+_0x490bb4);}if(!_['includes'](_0x490bb4,_0x286777[_0xf837('0x28')]['mapKey'])){throw new db['Sequelize'][(_0xf837('0x2d'))](_0xf837('0x39')+_0x490bb4);}_0x23777f[_0x286777[_0xf837('0x28')][_0xf837('0x37')]]=_0x286777[_0xf837('0x28')][_0xf837('0x34')];})[_0xf837('0x24')](function(){return db[_0xf837('0x1a')]['find']({'where':{'id':_0x286777[_0xf837('0x3a')]['id']},'include':[{'model':db[_0xf837('0x3b')],'as':_0xf837('0x3c'),'include':[{'model':db[_0xf837('0x2a')],'as':'Contacts','where':_0x23777f,'limit':0x1,'order':[[_0xf837('0x2f'),_0xf837('0x3d')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xf837('0x24')](function(_0x9570){if(_0x9570&&_0x9570['List']){var _0xbfe9a=_0x9570['get']({'plain':!![]});_0x64ee7d['account']=_0xbfe9a;_0x64ee7d['applications']=_0xbfe9a[_0xf837('0x3e')];_0x64ee7d[_0xf837('0x3f')]=_0xbfe9a['List'];_0x64ee7d[_0xf837('0x40')]=_[_0xf837('0x41')](_0x64ee7d[_0xf837('0x40')],[_0xf837('0x42')],[_0xf837('0x43')]);if(_0x64ee7d[_0xf837('0x3a')]['Applications']){delete _0x64ee7d[_0xf837('0x3a')][_0xf837('0x3e')];}if(_0x64ee7d[_0xf837('0x3a')][_0xf837('0x3c')]&&_0x64ee7d[_0xf837('0x3a')][_0xf837('0x3c')][_0xf837('0x44')]['length']){return _0x64ee7d['account']['List'][_0xf837('0x44')][0x0];}var _0x392c=_[_0xf837('0xa')](_0x286777[_0xf837('0x28')],{'firstName':_0x286777[_0xf837('0x28')][_0xf837('0x34')],'ListId':_0xbfe9a[_0xf837('0x45')]});_0x392c[_0x286777[_0xf837('0x28')][_0xf837('0x37')]]=_0x286777[_0xf837('0x28')][_0xf837('0x34')];return db[_0xf837('0x2a')][_0xf837('0x46')](_0x392c,{'fields':_0x3c22f9,'raw':!![]});}})['then'](function(_0x222dbf){_0x64ee7d[_0xf837('0x47')]=_0x222dbf;if(_0x222dbf){var _0x42f9e3={'ContactId':_0x222dbf['id'],'FaxAccountId':_0x286777[_0xf837('0x3a')]['id'],'fax':_0x222dbf['fax']};return db[_0xf837('0x48')][_0xf837('0x49')]({'where':{'ContactId':_0x222dbf['id'],'closed':![],'FaxAccountId':_0x286777[_0xf837('0x3a')]['id']}})[_0xf837('0x24')](function(_0x1058ae){if(_0x1058ae){return[_0x1058ae,![]];}return db['FaxInteraction'][_0xf837('0x46')](_0x42f9e3)[_0xf837('0x24')](function(_0x27bfe2){return[_0x27bfe2,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf837('0x4a')](function(_0x26b0e8,_0x3e39f5){var _0x2e372e=_0x26b0e8[_0xf837('0x4b')]({'plain':!![]});if(_0x3e39f5){if(_0x64ee7d[_0xf837('0x3a')]['autoclose']){_0x64ee7d['applications'][_0xf837('0x4c')]({'id':0x0,'priority':_0x64ee7d[_0xf837('0x40')][_0xf837('0x4d')]+0x1,'app':_0xf837('0x4e'),'appdata':_0xf837('0x4f'),'interval':_0xf837('0x50')});}_0x2e372e[_0xf837('0x51')]=!![];}else{_0x2e372e[_0xf837('0x51')]=![];}_0x64ee7d['interaction']=_0x2e372e;return db[_0xf837('0x52')][_0xf837('0x46')]({'body':_0x286777[_0xf837('0x28')]['body'],'FaxAccountId':_0x286777[_0xf837('0x3a')]['id'],'FaxInteractionId':_0x26b0e8['id'],'direction':'in','ContactId':_0x26b0e8[_0xf837('0x53')],'AttachmentId':_0x286777['body'][_0xf837('0x54')]});})['then'](function(_0x5eb11f){_0x64ee7d[_0xf837('0x17')]=_0x5eb11f;if(!_0x64ee7d['interaction']['UserId'])return;return db[_0xf837('0x55')]['find']({'attributes':['id',_0xf837('0x56')],'where':{'id':_0x64ee7d[_0xf837('0x57')][_0xf837('0x58')]}});})[_0xf837('0x24')](function(_0x2d6f14){if(_0x2d6f14){_0x64ee7d[_0xf837('0x40')][_0xf837('0x59')]({'id':0x0,'priority':0x0,'app':_0xf837('0x5a'),'appdata':_0x2d6f14['name']+','+(_0x64ee7d[_0xf837('0x3a')][_0xf837('0x5b')]||0xa),'interval':_0xf837('0x50')});}if(!_0x64ee7d[_0xf837('0x57')][_0xf837('0x5c')])return;return db[_0xf837('0x5d')]['find']({'attributes':['id',_0xf837('0x56')],'where':{'id':_0x64ee7d[_0xf837('0x57')][_0xf837('0x5c')]}});})[_0xf837('0x24')](function(_0x172529){if(_0x172529){_0x64ee7d[_0xf837('0x40')]['unshift']({'id':0x0,'priority':0x1,'app':_0xf837('0x5e'),'appdata':_0x172529[_0xf837('0x56')]+','+(_0x64ee7d[_0xf837('0x3a')][_0xf837('0x5f')]||0x12c),'interval':_0xf837('0x50')});}return respondWithRpcPromise(_0xf837('0x60'),'startRouting',_0x64ee7d);})['then'](function(_0x4d6927){_0x17e6f5(_0x4d6927);})['catch'](function(_0x557706){_0x6145b1(_0x4dfef6[_0xf837('0x15')](0x1f4,_0x557706[_0xf837('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index d51154f..86a7d70 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 _0x5ae1=['./faxAccount.events','save','remove','update','emit','removeListener','register','length','faxAccount:'];(function(_0x36fef0,_0x16711c){var _0xb36b84=function(_0x442947){while(--_0x442947){_0x36fef0['push'](_0x36fef0['shift']());}};_0xb36b84(++_0x16711c);}(_0x5ae1,0xc6));var _0x15ae=function(_0x3f1c5c,_0x4acff6){_0x3f1c5c=_0x3f1c5c-0x0;var _0x1e0133=_0x5ae1[_0x3f1c5c];return _0x1e0133;};'use strict';var FaxAccountEvents=require(_0x15ae('0x0'));var events=[_0x15ae('0x1'),_0x15ae('0x2'),_0x15ae('0x3')];function createListener(_0x2b5522,_0x3e2882){return function(_0x4219fd){_0x3e2882[_0x15ae('0x4')](_0x2b5522,_0x4219fd);};}function removeListener(_0x5ed2fe,_0x5c045a){return function(){FaxAccountEvents[_0x15ae('0x5')](_0x5ed2fe,_0x5c045a);};}exports[_0x15ae('0x6')]=function(_0x3fa0e8){for(var _0x4b0b38=0x0,_0x152c3d=events[_0x15ae('0x7')];_0x4b0b38<_0x152c3d;_0x4b0b38++){var _0x363566=events[_0x4b0b38];var _0x97a044=createListener(_0x15ae('0x8')+_0x363566,_0x3fa0e8);FaxAccountEvents['on'](_0x363566,_0x97a044);}}; \ No newline at end of file +var _0x4547=['remove','update','emit','removeListener','register','./faxAccount.events','save'];(function(_0x3260b8,_0x42afb5){var _0x190030=function(_0x4a9e1b){while(--_0x4a9e1b){_0x3260b8['push'](_0x3260b8['shift']());}};_0x190030(++_0x42afb5);}(_0x4547,0x14e));var _0x7454=function(_0x1ac6ec,_0x1f81fc){_0x1ac6ec=_0x1ac6ec-0x0;var _0x48a489=_0x4547[_0x1ac6ec];return _0x48a489;};'use strict';var FaxAccountEvents=require(_0x7454('0x0'));var events=[_0x7454('0x1'),_0x7454('0x2'),_0x7454('0x3')];function createListener(_0x3cbbd5,_0x5cc4f7){return function(_0x40929b){_0x5cc4f7[_0x7454('0x4')](_0x3cbbd5,_0x40929b);};}function removeListener(_0x39f66b,_0x5b6f35){return function(){FaxAccountEvents[_0x7454('0x5')](_0x39f66b,_0x5b6f35);};}exports[_0x7454('0x6')]=function(_0x240157){for(var _0x568e6e=0x0,_0x257732=events['length'];_0x568e6e<_0x257732;_0x568e6e++){var _0x495f23=events[_0x568e6e];var _0x22c100=createListener('faxAccount:'+_0x495f23,_0x240157);FaxAccountEvents['on'](_0x495f23,_0x22c100);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 764f1ea..ebc2e23 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 _0x604c=['create','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','./faxAccount.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post'];(function(_0x4add67,_0x5a57c3){var _0x336e8d=function(_0x111030){while(--_0x111030){_0x4add67['push'](_0x4add67['shift']());}};_0x336e8d(++_0x5a57c3);}(_0x604c,0x65));var _0xc604=function(_0x3d814e,_0x5f2ff4){_0x3d814e=_0x3d814e-0x0;var _0x2eb125=_0x604c[_0x3d814e];return _0x2eb125;};'use strict';var multer=require(_0xc604('0x0'));var util=require(_0xc604('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc604('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc604('0x3'));var interaction=require(_0xc604('0x4'));var config=require('../../config/environment');var controller=require(_0xc604('0x5'));router[_0xc604('0x6')]('/',auth[_0xc604('0x7')](),controller['index']);router[_0xc604('0x6')]('/describe',auth[_0xc604('0x7')](),controller[_0xc604('0x8')]);router[_0xc604('0x6')](_0xc604('0x9'),auth[_0xc604('0x7')](),controller[_0xc604('0xa')]);router['get'](_0xc604('0xb'),auth[_0xc604('0x7')](),controller[_0xc604('0xc')]);router[_0xc604('0x6')]('/:id/canned_answers',auth[_0xc604('0x7')](),controller[_0xc604('0xd')]);router[_0xc604('0x6')](_0xc604('0xe'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xc604('0x6')](_0xc604('0xf'),auth[_0xc604('0x7')](),controller[_0xc604('0x10')]);router['get'](_0xc604('0x11'),auth[_0xc604('0x7')](),controller[_0xc604('0x12')]);router[_0xc604('0x6')](_0xc604('0x13'),auth['isAuthenticated'](),controller[_0xc604('0x14')]);router[_0xc604('0x15')]('/',auth[_0xc604('0x7')](),controller[_0xc604('0x16')]);router[_0xc604('0x15')](_0xc604('0xb'),auth[_0xc604('0x7')](),controller[_0xc604('0x17')]);router[_0xc604('0x15')](_0xc604('0x18'),auth[_0xc604('0x7')](),controller[_0xc604('0x19')]);router[_0xc604('0x15')](_0xc604('0xe'),auth[_0xc604('0x7')](),controller[_0xc604('0x1a')]);router[_0xc604('0x15')]('/:id/applications',auth[_0xc604('0x7')](),controller[_0xc604('0x1b')]);router[_0xc604('0x15')](_0xc604('0x1c'),auth[_0xc604('0x7')](),controller['addAccountApplications']);router['post'](_0xc604('0x1d'),auth[_0xc604('0x7')](),controller[_0xc604('0x1e')]);router[_0xc604('0x15')](_0xc604('0x1f'),auth['isAuthenticated'](),controller[_0xc604('0x20')]);router['post'](_0xc604('0x13'),auth[_0xc604('0x7')](),controller[_0xc604('0x21')]);router[_0xc604('0x22')]('/:id',auth[_0xc604('0x7')](),controller[_0xc604('0x23')]);router[_0xc604('0x24')]('/:id',auth[_0xc604('0x7')](),controller[_0xc604('0x25')]);router[_0xc604('0x24')](_0xc604('0xb'),auth['isAuthenticated'](),controller[_0xc604('0x26')]);router[_0xc604('0x24')]('/:id/canned_answers',auth[_0xc604('0x7')](),controller[_0xc604('0x27')]);router[_0xc604('0x24')]('/:id/users',auth[_0xc604('0x7')](),controller['removeAgents']);module[_0xc604('0x28')]=router; \ No newline at end of file +var _0xc580=['fs-extra','../../config/environment','./faxAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router'];(function(_0x467bdf,_0x33ab38){var _0x4f00b7=function(_0x4231f2){while(--_0x4231f2){_0x467bdf['push'](_0x467bdf['shift']());}};_0x4f00b7(++_0x33ab38);}(_0xc580,0x15b));var _0x0c58=function(_0x43ee35,_0x38309e){_0x43ee35=_0x43ee35-0x0;var _0x30724c=_0xc580[_0x43ee35];return _0x30724c;};'use strict';var multer=require(_0x0c58('0x0'));var util=require('util');var path=require(_0x0c58('0x1'));var timeout=require(_0x0c58('0x2'));var express=require(_0x0c58('0x3'));var router=express[_0x0c58('0x4')]();var fs_extra=require(_0x0c58('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0c58('0x6'));var controller=require(_0x0c58('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0c58('0x8')](_0x0c58('0x9'),auth[_0x0c58('0xa')](),controller['describe']);router[_0x0c58('0x8')](_0x0c58('0xb'),auth[_0x0c58('0xa')](),controller[_0x0c58('0xc')]);router[_0x0c58('0x8')](_0x0c58('0xd'),auth[_0x0c58('0xa')](),controller[_0x0c58('0xe')]);router[_0x0c58('0x8')](_0x0c58('0xf'),auth[_0x0c58('0xa')](),controller[_0x0c58('0x10')]);router[_0x0c58('0x8')](_0x0c58('0x11'),auth['isAuthenticated'](),controller[_0x0c58('0x12')]);router[_0x0c58('0x8')](_0x0c58('0x13'),auth[_0x0c58('0xa')](),controller[_0x0c58('0x14')]);router['get'](_0x0c58('0x15'),auth[_0x0c58('0xa')](),controller[_0x0c58('0x16')]);router[_0x0c58('0x8')](_0x0c58('0x17'),auth['isAuthenticated'](),controller[_0x0c58('0x18')]);router[_0x0c58('0x19')]('/',auth['isAuthenticated'](),controller[_0x0c58('0x1a')]);router['post'](_0x0c58('0xd'),auth['isAuthenticated'](),controller[_0x0c58('0x1b')]);router[_0x0c58('0x19')](_0x0c58('0xf'),auth[_0x0c58('0xa')](),controller[_0x0c58('0x1c')]);router['post'](_0x0c58('0x11'),auth[_0x0c58('0xa')](),controller[_0x0c58('0x1d')]);router[_0x0c58('0x19')](_0x0c58('0x13'),auth[_0x0c58('0xa')](),controller[_0x0c58('0x1e')]);router[_0x0c58('0x19')](_0x0c58('0x1f'),auth[_0x0c58('0xa')](),controller[_0x0c58('0x20')]);router[_0x0c58('0x19')](_0x0c58('0x21'),auth[_0x0c58('0xa')](),controller[_0x0c58('0x22')]);router[_0x0c58('0x19')]('/:id/send',auth[_0x0c58('0xa')](),controller[_0x0c58('0x23')]);router[_0x0c58('0x19')](_0x0c58('0x17'),auth[_0x0c58('0xa')](),controller[_0x0c58('0x24')]);router[_0x0c58('0x25')](_0x0c58('0xb'),auth['isAuthenticated'](),controller[_0x0c58('0x26')]);router[_0x0c58('0x27')](_0x0c58('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x0c58('0x27')](_0x0c58('0xd'),auth[_0x0c58('0xa')](),controller[_0x0c58('0x28')]);router[_0x0c58('0x27')](_0x0c58('0xf'),auth[_0x0c58('0xa')](),controller[_0x0c58('0x29')]);router['delete'](_0x0c58('0x17'),auth[_0x0c58('0xa')](),controller[_0x0c58('0x2a')]);module[_0x0c58('0x2b')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 10dbd2f..1d341b3 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 _0x775e=['INTEGER','STRING','sequelize'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x775e,0x1be));var _0xe775=function(_0x367699,_0x4b9a13){_0x367699=_0x367699-0x0;var _0x583bd3=_0x775e[_0x367699];return _0x583bd3;};'use strict';var Sequelize=require(_0xe775('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe775('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe775('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe775('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xe2ba=['TEXT','STRING','*,*,*,*','INTEGER'];(function(_0x529e00,_0x2ce4aa){var _0x1c98e9=function(_0xb1f226){while(--_0xb1f226){_0x529e00['push'](_0x529e00['shift']());}};_0x1c98e9(++_0x2ce4aa);}(_0xe2ba,0x17f));var _0xae2b=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xe2ba[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xae2b('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xae2b('0x1')]()},'description':{'type':Sequelize[_0xae2b('0x2')]},'interval':{'type':Sequelize[_0xae2b('0x2')],'defaultValue':_0xae2b('0x3')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 1d47af2..cd59867 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 _0x030d=['util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','nolimit','limit','order','sort','pick','filter','where','merge','options','FaxApplication','includeAll','include','findAll','show','params','find','catch','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x56c497,_0x4d812e){var _0xc8dd8e=function(_0x44110e){while(--_0x44110e){_0x56c497['push'](_0x56c497['shift']());}};_0xc8dd8e(++_0x4d812e);}(_0x030d,0x93));var _0xd030=function(_0x46a4a5,_0x1799e9){_0x46a4a5=_0x46a4a5-0x0;var _0xcef2c5=_0x030d[_0x46a4a5];return _0xcef2c5;};'use strict';var emlformat=require(_0xd030('0x0'));var rimraf=require(_0xd030('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd030('0x2'));var rp=require(_0xd030('0x3'));var moment=require(_0xd030('0x4'));var BPromise=require(_0xd030('0x5'));var Mustache=require(_0xd030('0x6'));var util=require(_0xd030('0x7'));var path=require(_0xd030('0x8'));var sox=require(_0xd030('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd030('0xa'));var _=require(_0xd030('0xb'));var squel=require(_0xd030('0xc'));var crypto=require(_0xd030('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd030('0xe'));var toCsv=require(_0xd030('0xf'));var querystring=require('querystring');var Papa=require(_0xd030('0x10'));var Redis=require(_0xd030('0x11'));var authService=require(_0xd030('0x12'));var qs=require(_0xd030('0x13'));var as=require(_0xd030('0x14'));var hardwareService=require(_0xd030('0x15'));var logger=require(_0xd030('0x16'))(_0xd030('0x17'));var utils=require(_0xd030('0x18'));var config=require(_0xd030('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd030('0x1a'))['db'];function respondWithStatusCode(_0x521c8b,_0x584196){_0x584196=_0x584196||0xcc;return function(_0x3dd3fb){if(_0x3dd3fb){return _0x521c8b['sendStatus'](_0x584196);}return _0x521c8b[_0xd030('0x1b')](_0x584196)[_0xd030('0x1c')]();};}function respondWithResult(_0x537939,_0x2744d6){_0x2744d6=_0x2744d6||0xc8;return function(_0x151dc5){if(_0x151dc5){return _0x537939[_0xd030('0x1b')](_0x2744d6)['json'](_0x151dc5);}};}function respondWithFilteredResult(_0x22b332,_0x21e8c2){return function(_0x22fbd6){if(_0x22fbd6){var _0x2ed1b9=typeof _0x21e8c2[_0xd030('0x1d')]===_0xd030('0x1e')&&typeof _0x21e8c2['limit']===_0xd030('0x1e');var _0x48cb0d=_0x22fbd6[_0xd030('0x1f')];var _0xfcdaa3=_0x2ed1b9?0x0:_0x21e8c2[_0xd030('0x1d')];var _0x3defe1=_0x2ed1b9?_0x22fbd6[_0xd030('0x1f')]:_0x21e8c2['offset']+_0x21e8c2['limit'];var _0x164a46;if(_0x3defe1>=_0x48cb0d){_0x3defe1=_0x48cb0d;_0x164a46=0xc8;}else{_0x164a46=0xce;}_0x22b332[_0xd030('0x1b')](_0x164a46);return _0x22b332[_0xd030('0x20')](_0xd030('0x21'),_0xfcdaa3+'-'+_0x3defe1+'/'+_0x48cb0d)['json'](_0x22fbd6);}return null;};}function patchUpdates(_0x570d0a){return function(_0x28ae70){try{jsonpatch[_0xd030('0x22')](_0x28ae70,_0x570d0a,!![]);}catch(_0x5578d9){return BPromise[_0xd030('0x23')](_0x5578d9);}return _0x28ae70[_0xd030('0x24')]();};}function saveUpdates(_0x48b810,_0x433dd7){return function(_0x57d833){if(_0x57d833){return _0x57d833['update'](_0x48b810)[_0xd030('0x25')](function(_0x31ee1e){return _0x31ee1e;});}return null;};}function removeEntity(_0x5afd12,_0x5d3dc7){return function(_0x40796d){if(_0x40796d){return _0x40796d[_0xd030('0x26')]()['then'](function(){_0x5afd12['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a8133,_0x241a8a){return function(_0x4e05f6){if(!_0x4e05f6){_0x4a8133[_0xd030('0x27')](0x194);}return _0x4e05f6;};}function handleError(_0x224150,_0x380850){_0x380850=_0x380850||0x1f4;return function(_0x405939){logger[_0xd030('0x28')](_0x405939[_0xd030('0x29')]);if(_0x405939[_0xd030('0x2a')]){delete _0x405939[_0xd030('0x2a')];}_0x224150['status'](_0x380850)[_0xd030('0x2b')](_0x405939);};}exports[_0xd030('0x2c')]=function(_0x59c487,_0x1e59f8){var _0x1ab09b={},_0x5d3635={},_0x562ddc={'count':0x0,'rows':[]};var _0x4bb0b6=_[_0xd030('0x2d')](db['FaxApplication'][_0xd030('0x2e')],function(_0x3da84d){return{'name':_0x3da84d[_0xd030('0x2f')],'type':_0x3da84d[_0xd030('0x30')][_0xd030('0x31')]};});_0x5d3635[_0xd030('0x32')]=_[_0xd030('0x2d')](_0x4bb0b6,_0xd030('0x2a'));_0x5d3635['query']=_[_0xd030('0x33')](_0x59c487['query']);_0x5d3635[_0xd030('0x34')]=_[_0xd030('0x35')](_0x5d3635[_0xd030('0x32')],_0x5d3635[_0xd030('0x36')]);_0x1ab09b['attributes']=_[_0xd030('0x35')](_0x5d3635[_0xd030('0x32')],qs[_0xd030('0x37')](_0x59c487[_0xd030('0x36')][_0xd030('0x37')]));_0x1ab09b[_0xd030('0x38')]=_0x1ab09b['attributes']['length']?_0x1ab09b[_0xd030('0x38')]:_0x5d3635[_0xd030('0x32')];if(!_0x59c487[_0xd030('0x36')]['hasOwnProperty'](_0xd030('0x39'))){_0x1ab09b[_0xd030('0x3a')]=qs[_0xd030('0x3a')](_0x59c487[_0xd030('0x36')][_0xd030('0x3a')]);_0x1ab09b[_0xd030('0x1d')]=qs[_0xd030('0x1d')](_0x59c487['query']['offset']);}_0x1ab09b[_0xd030('0x3b')]=qs[_0xd030('0x3c')](_0x59c487[_0xd030('0x36')][_0xd030('0x3c')]);_0x1ab09b['where']=qs[_0xd030('0x34')](_[_0xd030('0x3d')](_0x59c487[_0xd030('0x36')],_0x5d3635[_0xd030('0x34')]),_0x4bb0b6);if(_0x59c487[_0xd030('0x36')][_0xd030('0x3e')]){_0x1ab09b[_0xd030('0x3f')]=_[_0xd030('0x40')](_0x1ab09b['where'],{'$or':_[_0xd030('0x2d')](_0x4bb0b6,function(_0x2dd533){if(_0x2dd533[_0xd030('0x30')]!=='VIRTUAL'){var _0x159e92={};_0x159e92[_0x2dd533[_0xd030('0x2a')]]={'$like':'%'+_0x59c487[_0xd030('0x36')][_0xd030('0x3e')]+'%'};return _0x159e92;}})});}_0x1ab09b=_[_0xd030('0x40')]({},_0x1ab09b,_0x59c487[_0xd030('0x41')]);var _0x38fcac={'where':_0x1ab09b[_0xd030('0x3f')]};return db[_0xd030('0x42')]['count'](_0x38fcac)[_0xd030('0x25')](function(_0x2eca32){_0x562ddc['count']=_0x2eca32;if(_0x59c487[_0xd030('0x36')][_0xd030('0x43')]){_0x1ab09b[_0xd030('0x44')]=[{'all':!![]}];}return db[_0xd030('0x42')][_0xd030('0x45')](_0x1ab09b);})[_0xd030('0x25')](function(_0x535ef0){_0x562ddc['rows']=_0x535ef0;return _0x562ddc;})[_0xd030('0x25')](respondWithFilteredResult(_0x1e59f8,_0x1ab09b))['catch'](handleError(_0x1e59f8,null));};exports[_0xd030('0x46')]=function(_0x35edf8,_0x414b66){var _0x31aff3={'raw':!![],'where':{'id':_0x35edf8[_0xd030('0x47')]['id']}},_0x5703cb={};_0x5703cb[_0xd030('0x32')]=_[_0xd030('0x33')](db[_0xd030('0x42')][_0xd030('0x2e')]);_0x5703cb['query']=_[_0xd030('0x33')](_0x35edf8[_0xd030('0x36')]);_0x5703cb[_0xd030('0x34')]=_[_0xd030('0x35')](_0x5703cb[_0xd030('0x32')],_0x5703cb[_0xd030('0x36')]);_0x31aff3[_0xd030('0x38')]=_[_0xd030('0x35')](_0x5703cb[_0xd030('0x32')],qs[_0xd030('0x37')](_0x35edf8[_0xd030('0x36')][_0xd030('0x37')]));_0x31aff3[_0xd030('0x38')]=_0x31aff3['attributes']['length']?_0x31aff3[_0xd030('0x38')]:_0x5703cb['model'];if(_0x35edf8[_0xd030('0x36')][_0xd030('0x43')]){_0x31aff3[_0xd030('0x44')]=[{'all':!![]}];}_0x31aff3=_[_0xd030('0x40')]({},_0x31aff3,_0x35edf8[_0xd030('0x41')]);return db[_0xd030('0x42')][_0xd030('0x48')](_0x31aff3)[_0xd030('0x25')](handleEntityNotFound(_0x414b66,null))[_0xd030('0x25')](respondWithResult(_0x414b66,null))[_0xd030('0x49')](handleError(_0x414b66,null));};exports[_0xd030('0x4a')]=function(_0x2056cf,_0x180f91){return db['FaxApplication']['create'](_0x2056cf[_0xd030('0x4b')],{})['then'](respondWithResult(_0x180f91,0xc9))[_0xd030('0x49')](handleError(_0x180f91,null));};exports[_0xd030('0x4c')]=function(_0x4b7109,_0x397462){if(_0x4b7109['body']['id']){delete _0x4b7109[_0xd030('0x4b')]['id'];}return db[_0xd030('0x42')][_0xd030('0x48')]({'where':{'id':_0x4b7109[_0xd030('0x47')]['id']}})[_0xd030('0x25')](handleEntityNotFound(_0x397462,null))[_0xd030('0x25')](saveUpdates(_0x4b7109['body'],null))[_0xd030('0x25')](respondWithResult(_0x397462,null))[_0xd030('0x49')](handleError(_0x397462,null));};exports[_0xd030('0x26')]=function(_0x4e78d6,_0x3505a2){return db[_0xd030('0x42')][_0xd030('0x48')]({'where':{'id':_0x4e78d6[_0xd030('0x47')]['id']}})['then'](handleEntityNotFound(_0x3505a2,null))[_0xd030('0x25')](removeEntity(_0x3505a2,null))[_0xd030('0x49')](handleError(_0x3505a2,null));}; \ No newline at end of file +var _0xbafb=['FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','find','create','body','destroy','params','eml-format','zip-dir','fast-json-patch','moment','util','path','ejs','fs-extra','lodash','squel','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','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','update','then','stack','name','send','index','map'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xbafb,0x19d));var _0xbbaf=function(_0x2d2013,_0x4028b8){_0x2d2013=_0x2d2013-0x0;var _0x5b31b6=_0xbafb[_0x2d2013];return _0x5b31b6;};'use strict';var emlformat=require(_0xbbaf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbbaf('0x1'));var jsonpatch=require(_0xbbaf('0x2'));var rp=require('request-promise');var moment=require(_0xbbaf('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbbaf('0x4'));var path=require(_0xbbaf('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbbaf('0x6'));var fs=require('fs');var fs_extra=require(_0xbbaf('0x7'));var _=require(_0xbbaf('0x8'));var squel=require(_0xbbaf('0x9'));var crypto=require(_0xbbaf('0xa'));var jsforce=require(_0xbbaf('0xb'));var deskjs=require(_0xbbaf('0xc'));var toCsv=require(_0xbbaf('0xd'));var querystring=require(_0xbbaf('0xe'));var Papa=require(_0xbbaf('0xf'));var Redis=require('ioredis');var authService=require(_0xbbaf('0x10'));var qs=require(_0xbbaf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbbaf('0x12'));var logger=require(_0xbbaf('0x13'))(_0xbbaf('0x14'));var utils=require(_0xbbaf('0x15'));var config=require(_0xbbaf('0x16'));var licenseUtil=require(_0xbbaf('0x17'));var db=require(_0xbbaf('0x18'))['db'];function respondWithStatusCode(_0x17e520,_0x12775a){_0x12775a=_0x12775a||0xcc;return function(_0x20d086){if(_0x20d086){return _0x17e520[_0xbbaf('0x19')](_0x12775a);}return _0x17e520['status'](_0x12775a)[_0xbbaf('0x1a')]();};}function respondWithResult(_0x5d0070,_0x4ff322){_0x4ff322=_0x4ff322||0xc8;return function(_0x1c307d){if(_0x1c307d){return _0x5d0070[_0xbbaf('0x1b')](_0x4ff322)['json'](_0x1c307d);}};}function respondWithFilteredResult(_0x20b34f,_0x294caa){return function(_0x193884){if(_0x193884){var _0x1f13b3=typeof _0x294caa['offset']===_0xbbaf('0x1c')&&typeof _0x294caa[_0xbbaf('0x1d')]===_0xbbaf('0x1c');var _0x5edafe=_0x193884[_0xbbaf('0x1e')];var _0x40eb97=_0x1f13b3?0x0:_0x294caa[_0xbbaf('0x1f')];var _0xaf1cd0=_0x1f13b3?_0x193884[_0xbbaf('0x1e')]:_0x294caa[_0xbbaf('0x1f')]+_0x294caa[_0xbbaf('0x1d')];var _0x1321a3;if(_0xaf1cd0>=_0x5edafe){_0xaf1cd0=_0x5edafe;_0x1321a3=0xc8;}else{_0x1321a3=0xce;}_0x20b34f[_0xbbaf('0x1b')](_0x1321a3);return _0x20b34f['set'](_0xbbaf('0x20'),_0x40eb97+'-'+_0xaf1cd0+'/'+_0x5edafe)[_0xbbaf('0x21')](_0x193884);}return null;};}function patchUpdates(_0x47700b){return function(_0x10afdb){try{jsonpatch[_0xbbaf('0x22')](_0x10afdb,_0x47700b,!![]);}catch(_0x35f6d){return BPromise[_0xbbaf('0x23')](_0x35f6d);}return _0x10afdb['save']();};}function saveUpdates(_0x4e54c2,_0x1bc1c4){return function(_0xd65fd8){if(_0xd65fd8){return _0xd65fd8[_0xbbaf('0x24')](_0x4e54c2)[_0xbbaf('0x25')](function(_0x2a1c64){return _0x2a1c64;});}return null;};}function removeEntity(_0x349d9c,_0x469fc4){return function(_0x18820e){if(_0x18820e){return _0x18820e['destroy']()[_0xbbaf('0x25')](function(){_0x349d9c['status'](0xcc)[_0xbbaf('0x1a')]();});}};}function handleEntityNotFound(_0xe7b060,_0x4a7048){return function(_0x49649f){if(!_0x49649f){_0xe7b060[_0xbbaf('0x19')](0x194);}return _0x49649f;};}function handleError(_0xceb6d8,_0x4c26e1){_0x4c26e1=_0x4c26e1||0x1f4;return function(_0x20f678){logger['error'](_0x20f678[_0xbbaf('0x26')]);if(_0x20f678[_0xbbaf('0x27')]){delete _0x20f678[_0xbbaf('0x27')];}_0xceb6d8[_0xbbaf('0x1b')](_0x4c26e1)[_0xbbaf('0x28')](_0x20f678);};}exports[_0xbbaf('0x29')]=function(_0x14b623,_0x4477db){var _0x17633a={},_0x2187a4={},_0x1f11e7={'count':0x0,'rows':[]};var _0x50497e=_[_0xbbaf('0x2a')](db[_0xbbaf('0x2b')][_0xbbaf('0x2c')],function(_0x1f7b7c){return{'name':_0x1f7b7c[_0xbbaf('0x2d')],'type':_0x1f7b7c[_0xbbaf('0x2e')][_0xbbaf('0x2f')]};});_0x2187a4[_0xbbaf('0x30')]=_[_0xbbaf('0x2a')](_0x50497e,_0xbbaf('0x27'));_0x2187a4[_0xbbaf('0x31')]=_[_0xbbaf('0x32')](_0x14b623[_0xbbaf('0x31')]);_0x2187a4[_0xbbaf('0x33')]=_[_0xbbaf('0x34')](_0x2187a4[_0xbbaf('0x30')],_0x2187a4[_0xbbaf('0x31')]);_0x17633a['attributes']=_[_0xbbaf('0x34')](_0x2187a4[_0xbbaf('0x30')],qs[_0xbbaf('0x35')](_0x14b623['query']['fields']));_0x17633a[_0xbbaf('0x36')]=_0x17633a[_0xbbaf('0x36')][_0xbbaf('0x37')]?_0x17633a[_0xbbaf('0x36')]:_0x2187a4['model'];if(!_0x14b623[_0xbbaf('0x31')][_0xbbaf('0x38')](_0xbbaf('0x39'))){_0x17633a[_0xbbaf('0x1d')]=qs[_0xbbaf('0x1d')](_0x14b623[_0xbbaf('0x31')][_0xbbaf('0x1d')]);_0x17633a[_0xbbaf('0x1f')]=qs[_0xbbaf('0x1f')](_0x14b623[_0xbbaf('0x31')][_0xbbaf('0x1f')]);}_0x17633a[_0xbbaf('0x3a')]=qs['sort'](_0x14b623['query'][_0xbbaf('0x3b')]);_0x17633a[_0xbbaf('0x3c')]=qs['filters'](_[_0xbbaf('0x3d')](_0x14b623['query'],_0x2187a4[_0xbbaf('0x33')]),_0x50497e);if(_0x14b623['query'][_0xbbaf('0x3e')]){_0x17633a[_0xbbaf('0x3c')]=_['merge'](_0x17633a[_0xbbaf('0x3c')],{'$or':_[_0xbbaf('0x2a')](_0x50497e,function(_0x48d20e){if(_0x48d20e['type']!==_0xbbaf('0x3f')){var _0x3c2fcd={};_0x3c2fcd[_0x48d20e[_0xbbaf('0x27')]]={'$like':'%'+_0x14b623[_0xbbaf('0x31')][_0xbbaf('0x3e')]+'%'};return _0x3c2fcd;}})});}_0x17633a=_[_0xbbaf('0x40')]({},_0x17633a,_0x14b623['options']);var _0x32dba6={'where':_0x17633a[_0xbbaf('0x3c')]};return db[_0xbbaf('0x2b')][_0xbbaf('0x1e')](_0x32dba6)['then'](function(_0x4e6d92){_0x1f11e7[_0xbbaf('0x1e')]=_0x4e6d92;if(_0x14b623['query'][_0xbbaf('0x41')]){_0x17633a[_0xbbaf('0x42')]=[{'all':!![]}];}return db[_0xbbaf('0x2b')][_0xbbaf('0x43')](_0x17633a);})[_0xbbaf('0x25')](function(_0xe58e97){_0x1f11e7[_0xbbaf('0x44')]=_0xe58e97;return _0x1f11e7;})[_0xbbaf('0x25')](respondWithFilteredResult(_0x4477db,_0x17633a))[_0xbbaf('0x45')](handleError(_0x4477db,null));};exports[_0xbbaf('0x46')]=function(_0x30837a,_0x907f7e){var _0x32a5f8={'raw':!![],'where':{'id':_0x30837a['params']['id']}},_0x421a4b={};_0x421a4b[_0xbbaf('0x30')]=_[_0xbbaf('0x32')](db['FaxApplication'][_0xbbaf('0x2c')]);_0x421a4b['query']=_['keys'](_0x30837a[_0xbbaf('0x31')]);_0x421a4b[_0xbbaf('0x33')]=_[_0xbbaf('0x34')](_0x421a4b[_0xbbaf('0x30')],_0x421a4b[_0xbbaf('0x31')]);_0x32a5f8[_0xbbaf('0x36')]=_[_0xbbaf('0x34')](_0x421a4b[_0xbbaf('0x30')],qs[_0xbbaf('0x35')](_0x30837a['query'][_0xbbaf('0x35')]));_0x32a5f8[_0xbbaf('0x36')]=_0x32a5f8[_0xbbaf('0x36')]['length']?_0x32a5f8[_0xbbaf('0x36')]:_0x421a4b[_0xbbaf('0x30')];if(_0x30837a[_0xbbaf('0x31')]['includeAll']){_0x32a5f8[_0xbbaf('0x42')]=[{'all':!![]}];}_0x32a5f8=_[_0xbbaf('0x40')]({},_0x32a5f8,_0x30837a['options']);return db['FaxApplication'][_0xbbaf('0x47')](_0x32a5f8)[_0xbbaf('0x25')](handleEntityNotFound(_0x907f7e,null))['then'](respondWithResult(_0x907f7e,null))['catch'](handleError(_0x907f7e,null));};exports[_0xbbaf('0x48')]=function(_0x2beacc,_0x5c9a4e){return db[_0xbbaf('0x2b')][_0xbbaf('0x48')](_0x2beacc[_0xbbaf('0x49')],{})[_0xbbaf('0x25')](respondWithResult(_0x5c9a4e,0xc9))['catch'](handleError(_0x5c9a4e,null));};exports[_0xbbaf('0x24')]=function(_0x4a778e,_0x362da9){if(_0x4a778e['body']['id']){delete _0x4a778e['body']['id'];}return db['FaxApplication'][_0xbbaf('0x47')]({'where':{'id':_0x4a778e['params']['id']}})[_0xbbaf('0x25')](handleEntityNotFound(_0x362da9,null))[_0xbbaf('0x25')](saveUpdates(_0x4a778e[_0xbbaf('0x49')],null))[_0xbbaf('0x25')](respondWithResult(_0x362da9,null))['catch'](handleError(_0x362da9,null));};exports[_0xbbaf('0x4a')]=function(_0x3fd52a,_0x277d62){return db[_0xbbaf('0x2b')][_0xbbaf('0x47')]({'where':{'id':_0x3fd52a[_0xbbaf('0x4b')]['id']}})[_0xbbaf('0x25')](handleEntityNotFound(_0x277d62,null))['then'](removeEntity(_0x277d62,null))[_0xbbaf('0x45')](handleError(_0x277d62,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index ac242e0..b784ede 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 _0x9caf=['rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x58a4bd,_0x54aa48){var _0x56fc89=function(_0xbb1887){while(--_0xbb1887){_0x58a4bd['push'](_0x58a4bd['shift']());}};_0x56fc89(++_0x54aa48);}(_0x9caf,0x1ab));var _0xf9ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9caf[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf9ca('0x0'));var util=require(_0xf9ca('0x1'));var logger=require(_0xf9ca('0x2'))(_0xf9ca('0x3'));var moment=require(_0xf9ca('0x4'));var BPromise=require(_0xf9ca('0x5'));var rp=require(_0xf9ca('0x6'));var fs=require('fs');var path=require(_0xf9ca('0x7'));var rimraf=require(_0xf9ca('0x8'));var config=require(_0xf9ca('0x9'));var attributes=require(_0xf9ca('0xa'));module['exports']=function(_0x53cda1,_0x917e6d){return _0x53cda1[_0xf9ca('0xb')](_0xf9ca('0xc'),attributes,{'tableName':_0xf9ca('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf9ca('0xe')});}; \ No newline at end of file +var _0x5c80=['request-promise','path','rimraf','../../config/environment','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird'];(function(_0x20447d,_0x47372e){var _0x3bcb23=function(_0x138ba3){while(--_0x138ba3){_0x20447d['push'](_0x20447d['shift']());}};_0x3bcb23(++_0x47372e);}(_0x5c80,0x110));var _0x05c8=function(_0x119c85,_0x4f0693){_0x119c85=_0x119c85-0x0;var _0x213b2e=_0x5c80[_0x119c85];return _0x213b2e;};'use strict';var _=require(_0x05c8('0x0'));var util=require('util');var logger=require(_0x05c8('0x1'))(_0x05c8('0x2'));var moment=require('moment');var BPromise=require(_0x05c8('0x3'));var rp=require(_0x05c8('0x4'));var fs=require('fs');var path=require(_0x05c8('0x5'));var rimraf=require(_0x05c8('0x6'));var config=require(_0x05c8('0x7'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0x3bad6c,_0x48bad6){return _0x3bad6c[_0x05c8('0x8')](_0x05c8('0x9'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x05c8('0xa'),'collate':_0x05c8('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 6ff40a9..b3d06ff 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 _0x9055=['options','raw','where','attributes','UpdateFaxApplication','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','catch','FaxApplication','update','body'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9055,0x1eb));var _0x5905=function(_0x2b857c,_0x220756){_0x2b857c=_0x2b857c-0x0;var _0x43e2af=_0x9055[_0x2b857c];return _0x43e2af;};'use strict';var _=require(_0x5905('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5905('0x1'));var db=require(_0x5905('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5905('0x3'))(_0x5905('0x4'));var config=require(_0x5905('0x5'));var jayson=require(_0x5905('0x6'));var client=jayson[_0x5905('0x7')][_0x5905('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x275cea,_0x412c90,_0x59d027){return new BPromise(function(_0x551d85,_0x24b89f){return client['request'](_0x275cea,_0x59d027)[_0x5905('0x9')](function(_0x530680){logger[_0x5905('0xa')]('FaxApplication,\x20%s,\x20%s',_0x412c90,_0x5905('0xb'));logger[_0x5905('0xc')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x412c90,'request\x20sent',JSON[_0x5905('0xd')](_0x530680));if(_0x530680[_0x5905('0xe')]){if(_0x530680[_0x5905('0xe')]['code']===0x1f4){logger[_0x5905('0xe')](_0x5905('0xf'),_0x412c90,_0x530680['error'][_0x5905('0x10')]);return _0x24b89f(_0x530680[_0x5905('0xe')]['message']);}logger[_0x5905('0xe')](_0x5905('0xf'),_0x412c90,_0x530680[_0x5905('0xe')][_0x5905('0x10')]);return _0x551d85(_0x530680[_0x5905('0xe')][_0x5905('0x10')]);}else{logger[_0x5905('0xa')](_0x5905('0xf'),_0x412c90,_0x5905('0xb'));_0x551d85(_0x530680[_0x5905('0x11')][_0x5905('0x10')]);}})[_0x5905('0x12')](function(_0x374e70){logger['error'](_0x5905('0xf'),_0x412c90,_0x374e70);_0x24b89f(_0x374e70);});});}exports['UpdateFaxApplication']=function(_0xa4e4fb){var _0x594aba=this;return new Promise(function(_0x234d36,_0x73b880){return db[_0x5905('0x13')][_0x5905('0x14')](_0xa4e4fb[_0x5905('0x15')],{'raw':_0xa4e4fb[_0x5905('0x16')]?_0xa4e4fb[_0x5905('0x16')][_0x5905('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa4e4fb[_0x5905('0x16')]?_0xa4e4fb[_0x5905('0x16')][_0x5905('0x18')]||null:null,'attributes':_0xa4e4fb['options']?_0xa4e4fb[_0x5905('0x16')][_0x5905('0x19')]||null:null,'limit':_0xa4e4fb['options']?_0xa4e4fb[_0x5905('0x16')]['limit']||null:null})[_0x5905('0x9')](function(_0x23abec){logger[_0x5905('0xa')](_0x5905('0x1a'),_0xa4e4fb);logger['debug'](_0x5905('0x1a'),_0xa4e4fb,JSON[_0x5905('0xd')](_0x23abec));_0x234d36(_0x23abec);})[_0x5905('0x12')](function(_0x18ac01){logger['error']('UpdateFaxApplication',_0x18ac01[_0x5905('0x10')],_0xa4e4fb);_0x73b880(_0x594aba[_0x5905('0xe')](0x1f4,_0x18ac01['message']));});});}; \ No newline at end of file +var _0xb8b7=['then','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','FaxApplication,\x20%s,\x20%s','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxApplication','update','body','options','raw','where','attributes'];(function(_0x3889ae,_0x4770c3){var _0x6533dd=function(_0x4275f7){while(--_0x4275f7){_0x3889ae['push'](_0x3889ae['shift']());}};_0x6533dd(++_0x4770c3);}(_0xb8b7,0x114));var _0x7b8b=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb8b7[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b8b('0x0'));var db=require(_0x7b8b('0x1'))['db'];var utils=require(_0x7b8b('0x2'));var logger=require('../../config/logger')(_0x7b8b('0x3'));var config=require(_0x7b8b('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b8b('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x31829a,_0x144e9c,_0x282b72){return new BPromise(function(_0x23e5fb,_0xc8e0a6){return client[_0x7b8b('0x6')](_0x31829a,_0x282b72)['then'](function(_0x5ac0e8){logger[_0x7b8b('0x7')](_0x7b8b('0x8'),_0x144e9c,'request\x20sent');logger['debug'](_0x7b8b('0x9'),_0x144e9c,_0x7b8b('0xa'),JSON[_0x7b8b('0xb')](_0x5ac0e8));if(_0x5ac0e8[_0x7b8b('0xc')]){if(_0x5ac0e8['error'][_0x7b8b('0xd')]===0x1f4){logger['error'](_0x7b8b('0x8'),_0x144e9c,_0x5ac0e8['error'][_0x7b8b('0xe')]);return _0xc8e0a6(_0x5ac0e8[_0x7b8b('0xc')][_0x7b8b('0xe')]);}logger[_0x7b8b('0xc')]('FaxApplication,\x20%s,\x20%s',_0x144e9c,_0x5ac0e8[_0x7b8b('0xc')][_0x7b8b('0xe')]);return _0x23e5fb(_0x5ac0e8[_0x7b8b('0xc')][_0x7b8b('0xe')]);}else{logger[_0x7b8b('0x7')](_0x7b8b('0x8'),_0x144e9c,_0x7b8b('0xa'));_0x23e5fb(_0x5ac0e8[_0x7b8b('0xf')][_0x7b8b('0xe')]);}})[_0x7b8b('0x10')](function(_0x1a3821){logger['error']('FaxApplication,\x20%s,\x20%s',_0x144e9c,_0x1a3821);_0xc8e0a6(_0x1a3821);});});}exports[_0x7b8b('0x11')]=function(_0x19e1c1){var _0xf8c9e6=this;return new Promise(function(_0x294fbd,_0x41af8d){return db['FaxApplication'][_0x7b8b('0x12')](_0x19e1c1[_0x7b8b('0x13')],{'raw':_0x19e1c1[_0x7b8b('0x14')]?_0x19e1c1[_0x7b8b('0x14')][_0x7b8b('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19e1c1[_0x7b8b('0x14')]?_0x19e1c1[_0x7b8b('0x14')][_0x7b8b('0x16')]||null:null,'attributes':_0x19e1c1[_0x7b8b('0x14')]?_0x19e1c1['options'][_0x7b8b('0x17')]||null:null,'limit':_0x19e1c1[_0x7b8b('0x14')]?_0x19e1c1[_0x7b8b('0x14')]['limit']||null:null})[_0x7b8b('0x18')](function(_0x1bb0d2){logger[_0x7b8b('0x7')]('UpdateFaxApplication',_0x19e1c1);logger['debug'](_0x7b8b('0x11'),_0x19e1c1,JSON[_0x7b8b('0xb')](_0x1bb0d2));_0x294fbd(_0x1bb0d2);})[_0x7b8b('0x10')](function(_0x45097f){logger[_0x7b8b('0xc')](_0x7b8b('0x11'),_0x45097f[_0x7b8b('0xe')],_0x19e1c1);_0x41af8d(_0xf8c9e6[_0x7b8b('0xc')](0x1f4,_0x45097f['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 117c2d5..6764f07 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 _0xd4a2=['../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','connect-timeout','Router'];(function(_0x12badd,_0x15f22f){var _0x272e27=function(_0x49080b){while(--_0x49080b){_0x12badd['push'](_0x12badd['shift']());}};_0x272e27(++_0x15f22f);}(_0xd4a2,0x173));var _0x2d4a=function(_0x386428,_0x1a68a4){_0x386428=_0x386428-0x0;var _0x23e840=_0xd4a2[_0x386428];return _0x23e840;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0xb')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0xd')](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0xf')](_0x2d4a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x2d4a('0x10')]=router; \ No newline at end of file +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(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0x4cf8,0x1e1));var _0x84cf=function(_0xf852,_0x4ddd76){_0xf852=_0xf852-0x0;var _0x5b2550=_0x4cf8[_0xf852];return _0x5b2550;};'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 diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 237ee50..5fecdcc 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 _0xeb3b=['BOOLEAN','DATE','STRING','out','ENUM','INTEGER','sequelize','exports'];(function(_0x3106bb,_0xf00fb0){var _0x1c5b0b=function(_0xdb838c){while(--_0xdb838c){_0x3106bb['push'](_0x3106bb['shift']());}};_0x1c5b0b(++_0xf00fb0);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1f4e09,_0x1fc591){_0x1f4e09=_0x1f4e09-0x0;var _0x10deec=_0xeb3b[_0x1f4e09];return _0x10deec;};'use strict';var Sequelize=require(_0xbeb3('0x0'));module[_0xbeb3('0x1')]={'closed':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbeb3('0x3')]},'disposition':{'type':Sequelize[_0xbeb3('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbeb3('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xbeb3('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xbeb3('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbeb3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xbeb3('0x6')]('in',_0xbeb3('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xbeb3('0x7')]}}; \ No newline at end of file +var _0x0424=['ENUM','out','INTEGER','BOOLEAN','DATE','STRING'];(function(_0x5b14b6,_0x2ffc98){var _0x4342c4=function(_0xd1cb9d){while(--_0xd1cb9d){_0x5b14b6['push'](_0x5b14b6['shift']());}};_0x4342c4(++_0x2ffc98);}(_0x0424,0x159));var _0x4042=function(_0x49c653,_0x390195){_0x49c653=_0x49c653-0x0;var _0x31e169=_0x0424[_0x49c653];return _0x31e169;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x4042('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4042('0x1')]},'disposition':{'type':Sequelize[_0x4042('0x2')]},'secondDisposition':{'type':Sequelize[_0x4042('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4042('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x4042('0x3')]('in',_0x4042('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4042('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x4042('0x3')]('in',_0x4042('0x4')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x4042('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 477287b..ec7367f 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 _0x9d23=['sort','where','FaxInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','omit','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','server','tmp','join','root','files','attachments','Attachment','Messages','createdAt','get','mkdirSync','createReadStream','pipe','basename','resolve','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','destroy','then','error','name','index','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','fax','query','user','catch','show','keys','filters','model','intersection','fields','attributes','includeAll','include','merge','options','find','create','body','update','params','describe','addMessage','FaxMessage','ids','getMessages','findOne','length','nolimit'];(function(_0x87f37f,_0x295180){var _0x302610=function(_0x1bc70d){while(--_0x1bc70d){_0x87f37f['push'](_0x87f37f['shift']());}};_0x302610(++_0x295180);}(_0x9d23,0x8f));var _0x39d2=function(_0x2db67e,_0x5b30d0){_0x2db67e=_0x2db67e-0x0;var _0x1871b8=_0x9d23[_0x2db67e];return _0x1871b8;};'use strict';var rimraf=require(_0x39d2('0x0'));var zipdir=require(_0x39d2('0x1'));var moment=require('moment');var BPromise=require(_0x39d2('0x2'));var util=require(_0x39d2('0x3'));var path=require(_0x39d2('0x4'));var fs=require('fs');var _=require(_0x39d2('0x5'));var Redis=require('ioredis');var interaction=require(_0x39d2('0x6'));var qs=require(_0x39d2('0x7'));var logger=require(_0x39d2('0x8'))('api');var config=require(_0x39d2('0x9'));var db=require(_0x39d2('0xa'))['db'];config[_0x39d2('0xb')]=_[_0x39d2('0xc')](config[_0x39d2('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x39d2('0xd'))(new Redis(config[_0x39d2('0xb')]));require(_0x39d2('0xe'))[_0x39d2('0xf')](socket);function respondWithStatusCode(_0x15f6d4,_0x2d5515){_0x2d5515=_0x2d5515||0xcc;return function(_0x49ad08){if(_0x49ad08){return _0x15f6d4[_0x39d2('0x10')](_0x2d5515);}return _0x15f6d4['status'](_0x2d5515)[_0x39d2('0x11')]();};}function respondWithResult(_0x147627,_0x18cc32){_0x18cc32=_0x18cc32||0xc8;return function(_0xa0b650){if(_0xa0b650){return _0x147627[_0x39d2('0x12')](_0x18cc32)[_0x39d2('0x13')](_0xa0b650);}};}function respondWithFilteredResult(_0x2c5c8f,_0x96dae3){return function(_0x41a347){if(_0x41a347){var _0x8b6b3e=typeof _0x96dae3[_0x39d2('0x14')]==='undefined'&&typeof _0x96dae3['limit']===_0x39d2('0x15');var _0x495a8c=_0x41a347['count'];var _0x2627fd=_0x8b6b3e?0x0:_0x96dae3[_0x39d2('0x14')];var _0x195f05=_0x8b6b3e?_0x41a347[_0x39d2('0x16')]:_0x96dae3[_0x39d2('0x14')]+_0x96dae3[_0x39d2('0x17')];var _0x284935;if(_0x195f05>=_0x495a8c){_0x195f05=_0x495a8c;_0x284935=0xc8;}else{_0x284935=0xce;}_0x2c5c8f['status'](_0x284935);return _0x2c5c8f[_0x39d2('0x18')](_0x39d2('0x19'),_0x2627fd+'-'+_0x195f05+'/'+_0x495a8c)[_0x39d2('0x13')](_0x41a347);}return null;};}function saveUpdates(_0x1b0d1e){return function(_0xc65311){if(_0xc65311){return _0xc65311['update'](_0x1b0d1e)['then'](function(_0xd12343){return _0xd12343;});}return null;};}function removeEntity(_0x85bcd){return function(_0x415c81){if(_0x415c81){return _0x415c81[_0x39d2('0x1a')]()[_0x39d2('0x1b')](function(){_0x85bcd[_0x39d2('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x375f74){return function(_0x31ef05){if(!_0x31ef05){_0x375f74[_0x39d2('0x10')](0x194);}return _0x31ef05;};}function handleError(_0x2efdc0,_0x2b9c71){_0x2b9c71=_0x2b9c71||0x1f4;return function(_0x16323c){logger[_0x39d2('0x1c')](_0x16323c['stack']);if(_0x16323c[_0x39d2('0x1d')]){delete _0x16323c[_0x39d2('0x1d')];}_0x2efdc0[_0x39d2('0x12')](_0x2b9c71)['send'](_0x16323c);};}exports[_0x39d2('0x1e')]=function(_0xccf30c,_0x93aa7b){var _0x29a07e={};var _0x4c99b9=_['map'](db[_0x39d2('0x1f')][_0x39d2('0x20')],function(_0xd5197d){return{'name':_0xd5197d[_0x39d2('0x21')],'type':_0xd5197d[_0x39d2('0x22')][_0x39d2('0x23')]};});_0x29a07e=qs[_0x39d2('0x24')](_0x4c99b9,_0xccf30c);return interaction['findAll'](_0x39d2('0x25'),_0xccf30c[_0x39d2('0x26')],_0xccf30c[_0x39d2('0x27')],_0x29a07e,_0x4c99b9)[_0x39d2('0x1b')](respondWithFilteredResult(_0x93aa7b,_0x29a07e))[_0x39d2('0x28')](handleError(_0x93aa7b,null));};exports[_0x39d2('0x29')]=function(_0xe46662,_0x2d43a7){var _0x457475={'raw':![],'where':{'id':_0xe46662['params']['id']}},_0x48bdc6={};_0x48bdc6['model']=_[_0x39d2('0x2a')](db['FaxInteraction'][_0x39d2('0x20')]);_0x48bdc6['query']=_[_0x39d2('0x2a')](_0xe46662[_0x39d2('0x26')]);_0x48bdc6[_0x39d2('0x2b')]=_['intersection'](_0x48bdc6[_0x39d2('0x2c')],_0x48bdc6['query']);_0x457475['attributes']=_[_0x39d2('0x2d')](_0x48bdc6[_0x39d2('0x2c')],qs['fields'](_0xe46662[_0x39d2('0x26')][_0x39d2('0x2e')]));_0x457475['attributes']=_0x457475[_0x39d2('0x2f')]['length']?_0x457475[_0x39d2('0x2f')]:_0x48bdc6[_0x39d2('0x2c')];if(_0xe46662[_0x39d2('0x26')][_0x39d2('0x30')]){_0x457475[_0x39d2('0x31')]=[{'all':!![]}];}_0x457475=_[_0x39d2('0x32')]({},_0x457475,_0xe46662[_0x39d2('0x33')]);return db['FaxInteraction'][_0x39d2('0x34')](_0x457475)['then'](handleEntityNotFound(_0x2d43a7,null))[_0x39d2('0x1b')](respondWithResult(_0x2d43a7,null))[_0x39d2('0x28')](handleError(_0x2d43a7,null));};exports[_0x39d2('0x35')]=function(_0x1b3f47,_0x592fdb){return db[_0x39d2('0x1f')][_0x39d2('0x35')](_0x1b3f47[_0x39d2('0x36')],{})[_0x39d2('0x1b')](respondWithResult(_0x592fdb,0xc9))[_0x39d2('0x28')](handleError(_0x592fdb,null));};exports[_0x39d2('0x37')]=function(_0x2fa205,_0x56510c){if(_0x2fa205['body']['id']){delete _0x2fa205[_0x39d2('0x36')]['id'];}return db[_0x39d2('0x1f')][_0x39d2('0x34')]({'where':{'id':_0x2fa205['params']['id']}})[_0x39d2('0x1b')](handleEntityNotFound(_0x56510c,null))['then'](saveUpdates(_0x2fa205[_0x39d2('0x36')],null))[_0x39d2('0x1b')](respondWithResult(_0x56510c,null))[_0x39d2('0x28')](handleError(_0x56510c,null));};exports['destroy']=function(_0x229394,_0x49aac4){return db[_0x39d2('0x1f')][_0x39d2('0x34')]({'where':{'id':_0x229394[_0x39d2('0x38')]['id']}})['then'](handleEntityNotFound(_0x49aac4,null))[_0x39d2('0x1b')](removeEntity(_0x49aac4,null))[_0x39d2('0x28')](handleError(_0x49aac4,null));};exports[_0x39d2('0x39')]=function(_0x59dffb,_0x1e8436){return db[_0x39d2('0x1f')][_0x39d2('0x39')]()['then'](respondWithResult(_0x1e8436,null))[_0x39d2('0x28')](handleError(_0x1e8436,null));};exports[_0x39d2('0x3a')]=function(_0x1709f5,_0x363d4c){return db[_0x39d2('0x3b')]['find']({'where':{'id':_0x1709f5[_0x39d2('0x38')]['id']}})['then'](handleEntityNotFound(_0x363d4c,null))['then'](function(_0x94a429){if(_0x94a429){return _0x94a429[_0x39d2('0x3a')](_0x1709f5[_0x39d2('0x36')][_0x39d2('0x3c')],_['omit'](_0x1709f5['body'],[_0x39d2('0x3c'),'id'])||{});}})[_0x39d2('0x1b')](respondWithResult(_0x363d4c,null))[_0x39d2('0x28')](handleError(_0x363d4c,null));};exports[_0x39d2('0x3d')]=function(_0x2b4f0d,_0x1bc246){var _0x526171={'raw':![],'where':{}};var _0x567082={};var _0x2c455c={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x39d2('0x3e')]({'where':{'id':_0x2b4f0d[_0x39d2('0x38')]['id']}})['then'](handleEntityNotFound(_0x1bc246,null))[_0x39d2('0x1b')](function(_0x168618){if(_0x168618){_0x567082[_0x39d2('0x2c')]=_[_0x39d2('0x2a')](db[_0x39d2('0x3b')]['rawAttributes']);_0x567082[_0x39d2('0x26')]=_[_0x39d2('0x2a')](_0x2b4f0d[_0x39d2('0x26')]);_0x567082[_0x39d2('0x2b')]=_['intersection'](_0x567082['model'],_0x567082[_0x39d2('0x26')]);_0x526171[_0x39d2('0x2f')]=_['intersection'](_0x567082['model'],qs[_0x39d2('0x2e')](_0x2b4f0d['query'][_0x39d2('0x2e')]));_0x526171[_0x39d2('0x2f')]=_0x526171[_0x39d2('0x2f')][_0x39d2('0x3f')]?_0x526171[_0x39d2('0x2f')]:_0x567082[_0x39d2('0x2c')];if(!_0x2b4f0d['query']['hasOwnProperty'](_0x39d2('0x40'))){_0x526171[_0x39d2('0x17')]=qs[_0x39d2('0x17')](_0x2b4f0d[_0x39d2('0x26')][_0x39d2('0x17')]);_0x526171[_0x39d2('0x14')]=qs[_0x39d2('0x14')](_0x2b4f0d[_0x39d2('0x26')][_0x39d2('0x14')]);}_0x526171['order']=qs[_0x39d2('0x41')](_0x2b4f0d[_0x39d2('0x26')]['sort']);_0x526171['where']=qs[_0x39d2('0x2b')](_['pick'](_0x2b4f0d['query'],_0x567082[_0x39d2('0x2b')]));_0x526171[_0x39d2('0x42')][_0x39d2('0x43')]=_0x168618['id'];if(_0x2b4f0d['query'][_0x39d2('0x44')]){_0x526171['where']=_[_0x39d2('0x32')](_0x526171[_0x39d2('0x42')],{'$or':_[_0x39d2('0x45')](_0x526171[_0x39d2('0x2f')],function(_0x1392c2){var _0x4fde8a={};_0x4fde8a[_0x1392c2]={'$like':'%'+_0x2b4f0d['query'][_0x39d2('0x44')]+'%'};return _0x4fde8a;})});}if(_0x2b4f0d[_0x39d2('0x26')][_0x39d2('0x46')]){var _0x4ea633=_0x2b4f0d[_0x39d2('0x26')][_0x39d2('0x46')][_0x39d2('0x47')](',');var _0x1d74bd={};_0x1d74bd[_0x4ea633[0x0]]={'$gte':moment(_0x4ea633[0x1])[_0x39d2('0x48')](_0x39d2('0x49'))};_0x526171[_0x39d2('0x42')]=_[_0x39d2('0x32')](_0x526171[_0x39d2('0x42')],_0x1d74bd);}_0x526171=_[_0x39d2('0x32')]({},_0x526171,_0x2b4f0d['options']);return db[_0x39d2('0x3b')][_0x39d2('0x16')]({'where':_0x526171[_0x39d2('0x42')]})[_0x39d2('0x1b')](function(_0x351615){_0x2c455c[_0x39d2('0x16')]=_0x351615;if(_0x2b4f0d['query'][_0x39d2('0x30')]){_0x526171[_0x39d2('0x31')]=[{'all':!![]}];}return db[_0x39d2('0x3b')][_0x39d2('0x4a')](_0x526171);})[_0x39d2('0x1b')](function(_0x43d569){_0x2c455c[_0x39d2('0x4b')]=_0x43d569;return _0x2c455c;});}})[_0x39d2('0x1b')](respondWithFilteredResult(_0x1bc246,_0x526171))[_0x39d2('0x28')](handleError(_0x1bc246,null));};exports[_0x39d2('0x4c')]=function(_0x83ddcc,_0xfed317){return db[_0x39d2('0x1f')][_0x39d2('0x34')]({'where':{'id':_0x83ddcc[_0x39d2('0x38')]['id']}})[_0x39d2('0x1b')](handleEntityNotFound(_0xfed317,null))[_0x39d2('0x1b')](function(_0x55d1b5){if(_0x55d1b5){return _0x55d1b5['setTags'](_0x83ddcc[_0x39d2('0x36')][_0x39d2('0x3c')],_[_0x39d2('0x4d')](_0x83ddcc['body'],['ids','id'])||{})['spread'](function(){return db[_0x39d2('0x4e')][_0x39d2('0x4a')]({'attributes':['id','name',_0x39d2('0x4f')],'where':{'id':_0x83ddcc[_0x39d2('0x36')][_0x39d2('0x3c')]}});})['then'](function(_0x150b2e){socket[_0x39d2('0x50')](_0x39d2('0x51'),{'id':Number(_0x83ddcc[_0x39d2('0x38')]['id']),'tags':_0x150b2e||[]});return{'id':Number(_0x83ddcc[_0x39d2('0x38')]['id']),'tags':_0x150b2e||[]};});}})[_0x39d2('0x1b')](respondWithResult(_0xfed317,null))[_0x39d2('0x28')](handleError(_0xfed317,null));};exports[_0x39d2('0x52')]=function(_0x133f3e,_0x4c979a){return db[_0x39d2('0x1f')][_0x39d2('0x34')]({'where':{'id':_0x133f3e[_0x39d2('0x38')]['id']}})[_0x39d2('0x1b')](handleEntityNotFound(_0x4c979a,null))[_0x39d2('0x1b')](function(_0x186ea3){if(_0x186ea3){return _0x186ea3[_0x39d2('0x52')](_0x133f3e[_0x39d2('0x26')][_0x39d2('0x3c')]);}})['then'](respondWithStatusCode(_0x4c979a,null))[_0x39d2('0x28')](handleError(_0x4c979a,null));};exports[_0x39d2('0x53')]=function(_0x21a637,_0x6222b8){var _0x1813ae=moment()[_0x39d2('0x54')]()[_0x39d2('0x55')]();var _0x1c8a88=path['join'](config['root'],_0x39d2('0x56'),'files',_0x39d2('0x57'));var _0x50683c=path[_0x39d2('0x58')](config[_0x39d2('0x59')],'server',_0x39d2('0x5a'),_0x39d2('0x5b'));var _0x2d215e=path[_0x39d2('0x58')](_0x1c8a88,_0x1813ae);var _0x5219ed=util['format']('transcript-%d-%s.zip',_0x21a637[_0x39d2('0x38')]['id'],_0x1813ae);var _0x3c69d9=path[_0x39d2('0x58')](_0x1c8a88,_0x5219ed);var _0x24ab14=[];_0x24ab14['push']({'model':db[_0x39d2('0x5c')],'as':_0x39d2('0x5c'),'raw':!![]});var _0x7d13f0=[{'model':db['FaxMessage'],'as':_0x39d2('0x5d'),'attributes':['id',_0x39d2('0x36'),_0x39d2('0x5e')],'include':_0x24ab14}];return db['FaxInteraction']['find']({'where':{'id':_0x21a637['params']['id']},'include':_0x7d13f0})['then'](handleEntityNotFound(_0x6222b8,null))['then'](function(_0x277ec2){if(_0x277ec2&&_0x277ec2['Messages']){var _0xcaf08f=_0x277ec2[_0x39d2('0x5f')]({'plain':!![]});fs[_0x39d2('0x60')](_0x2d215e);for(var _0x5bae66=0x0;_0x5bae66<_0xcaf08f['Messages'][_0x39d2('0x3f')];_0x5bae66++){var _0x57ff7f=_0xcaf08f[_0x39d2('0x5d')][_0x5bae66]['Attachment'];if(_0x57ff7f){var _0x19d445=path[_0x39d2('0x58')](_0x50683c,_0x57ff7f['basename']);if(fs['existsSync'](_0x19d445)){fs[_0x39d2('0x61')](_0x19d445)[_0x39d2('0x62')](fs['createWriteStream'](path[_0x39d2('0x58')](_0x2d215e,_0x57ff7f[_0x39d2('0x63')])));}}}return BPromise[_0x39d2('0x64')]()['then'](function(){return new BPromise(function(_0x157581,_0xfc5803){zipdir(_0x2d215e,{'saveTo':_0x3c69d9},function(_0x3ea948,_0xedcb17){if(_0x3ea948)return _0xfc5803(_0x3ea948);return _0x157581(_0xedcb17);});})[_0x39d2('0x1b')](function(){return new BPromise(function(_0x52589f,_0x366094){rimraf(_0x2d215e,function(_0x55e0d8){if(_0x55e0d8)_0x366094(_0x55e0d8);return _0x52589f();});});})[_0x39d2('0x1b')](function(){return _0x6222b8['download'](_0x3c69d9,_0x5219ed,function(_0x380c57){if(_0x380c57){console[_0x39d2('0x65')](_0x39d2('0x66'),_0x380c57);}else{fs[_0x39d2('0x67')](_0x3c69d9);}});});});}else{return _0x6222b8[_0x39d2('0x10')](0xc8);}})[_0x39d2('0x28')](handleError(_0x6222b8,null));}; \ No newline at end of file +var _0x2ca1=['name','send','map','FaxInteraction','type','getOptions','findAll','query','user','show','params','model','keys','rawAttributes','intersection','attributes','fields','length','includeAll','include','merge','catch','create','body','find','describe','addMessage','FaxMessage','ids','omit','findOne','filters','hasOwnProperty','nolimit','sort','where','pick','FaxInteractionId','filter','$gte','format','addTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','createdAt','Messages','get','existsSync','createReadStream','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack'];(function(_0x3b6cf6,_0xdae96d){var _0x1801b4=function(_0x42c46a){while(--_0x42c46a){_0x3b6cf6['push'](_0x3b6cf6['shift']());}};_0x1801b4(++_0xdae96d);}(_0x2ca1,0x10a));var _0x12ca=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x2ca1[_0x5447fd];return _0x15b28a;};'use strict';var rimraf=require(_0x12ca('0x0'));var zipdir=require(_0x12ca('0x1'));var moment=require(_0x12ca('0x2'));var BPromise=require(_0x12ca('0x3'));var util=require('util');var path=require(_0x12ca('0x4'));var fs=require('fs');var _=require(_0x12ca('0x5'));var Redis=require(_0x12ca('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x12ca('0x7'));var logger=require(_0x12ca('0x8'))(_0x12ca('0x9'));var config=require(_0x12ca('0xa'));var db=require(_0x12ca('0xb'))['db'];config[_0x12ca('0xc')]=_[_0x12ca('0xd')](config['redis'],{'host':_0x12ca('0xe'),'port':0x18eb});var socket=require(_0x12ca('0xf'))(new Redis(config[_0x12ca('0xc')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0xd11e9d,_0xc4ba4){_0xc4ba4=_0xc4ba4||0xcc;return function(_0x3f40e7){if(_0x3f40e7){return _0xd11e9d[_0x12ca('0x10')](_0xc4ba4);}return _0xd11e9d[_0x12ca('0x11')](_0xc4ba4)[_0x12ca('0x12')]();};}function respondWithResult(_0x1cba29,_0x5d16d6){_0x5d16d6=_0x5d16d6||0xc8;return function(_0x308be8){if(_0x308be8){return _0x1cba29[_0x12ca('0x11')](_0x5d16d6)[_0x12ca('0x13')](_0x308be8);}};}function respondWithFilteredResult(_0x16be44,_0x57276f){return function(_0x3f6725){if(_0x3f6725){var _0x421b76=typeof _0x57276f[_0x12ca('0x14')]===_0x12ca('0x15')&&typeof _0x57276f[_0x12ca('0x16')]===_0x12ca('0x15');var _0x14f1ac=_0x3f6725[_0x12ca('0x17')];var _0x1ddf25=_0x421b76?0x0:_0x57276f['offset'];var _0x297353=_0x421b76?_0x3f6725['count']:_0x57276f[_0x12ca('0x14')]+_0x57276f[_0x12ca('0x16')];var _0x4e8a31;if(_0x297353>=_0x14f1ac){_0x297353=_0x14f1ac;_0x4e8a31=0xc8;}else{_0x4e8a31=0xce;}_0x16be44[_0x12ca('0x11')](_0x4e8a31);return _0x16be44[_0x12ca('0x18')](_0x12ca('0x19'),_0x1ddf25+'-'+_0x297353+'/'+_0x14f1ac)[_0x12ca('0x13')](_0x3f6725);}return null;};}function saveUpdates(_0xbcb9e4){return function(_0x59e643){if(_0x59e643){return _0x59e643[_0x12ca('0x1a')](_0xbcb9e4)[_0x12ca('0x1b')](function(_0x26dfee){return _0x26dfee;});}return null;};}function removeEntity(_0x48a19e){return function(_0x5a9f60){if(_0x5a9f60){return _0x5a9f60[_0x12ca('0x1c')]()['then'](function(){_0x48a19e[_0x12ca('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f5fcb){return function(_0x39eb40){if(!_0x39eb40){_0x3f5fcb[_0x12ca('0x10')](0x194);}return _0x39eb40;};}function handleError(_0x37ee20,_0x320351){_0x320351=_0x320351||0x1f4;return function(_0x3c4701){logger[_0x12ca('0x1d')](_0x3c4701[_0x12ca('0x1e')]);if(_0x3c4701['name']){delete _0x3c4701[_0x12ca('0x1f')];}_0x37ee20['status'](_0x320351)[_0x12ca('0x20')](_0x3c4701);};}exports['index']=function(_0x15943d,_0x5c5043){var _0x5e74c6={};var _0x1cf3a8=_[_0x12ca('0x21')](db[_0x12ca('0x22')]['rawAttributes'],function(_0x5d9ab6){return{'name':_0x5d9ab6['fieldName'],'type':_0x5d9ab6[_0x12ca('0x23')]['key']};});_0x5e74c6=qs[_0x12ca('0x24')](_0x1cf3a8,_0x15943d);return interaction[_0x12ca('0x25')]('fax',_0x15943d[_0x12ca('0x26')],_0x15943d[_0x12ca('0x27')],_0x5e74c6,_0x1cf3a8)['then'](respondWithFilteredResult(_0x5c5043,_0x5e74c6))['catch'](handleError(_0x5c5043,null));};exports[_0x12ca('0x28')]=function(_0x579fb1,_0xa82737){var _0x31bb93={'raw':![],'where':{'id':_0x579fb1[_0x12ca('0x29')]['id']}},_0x32156c={};_0x32156c[_0x12ca('0x2a')]=_[_0x12ca('0x2b')](db[_0x12ca('0x22')][_0x12ca('0x2c')]);_0x32156c[_0x12ca('0x26')]=_[_0x12ca('0x2b')](_0x579fb1[_0x12ca('0x26')]);_0x32156c['filters']=_[_0x12ca('0x2d')](_0x32156c[_0x12ca('0x2a')],_0x32156c[_0x12ca('0x26')]);_0x31bb93[_0x12ca('0x2e')]=_[_0x12ca('0x2d')](_0x32156c['model'],qs[_0x12ca('0x2f')](_0x579fb1['query']['fields']));_0x31bb93[_0x12ca('0x2e')]=_0x31bb93[_0x12ca('0x2e')][_0x12ca('0x30')]?_0x31bb93[_0x12ca('0x2e')]:_0x32156c[_0x12ca('0x2a')];if(_0x579fb1[_0x12ca('0x26')][_0x12ca('0x31')]){_0x31bb93[_0x12ca('0x32')]=[{'all':!![]}];}_0x31bb93=_[_0x12ca('0x33')]({},_0x31bb93,_0x579fb1['options']);return db[_0x12ca('0x22')]['find'](_0x31bb93)[_0x12ca('0x1b')](handleEntityNotFound(_0xa82737,null))[_0x12ca('0x1b')](respondWithResult(_0xa82737,null))[_0x12ca('0x34')](handleError(_0xa82737,null));};exports[_0x12ca('0x35')]=function(_0x2bd922,_0x28b21a){return db[_0x12ca('0x22')][_0x12ca('0x35')](_0x2bd922[_0x12ca('0x36')],{})[_0x12ca('0x1b')](respondWithResult(_0x28b21a,0xc9))[_0x12ca('0x34')](handleError(_0x28b21a,null));};exports['update']=function(_0x1db7aa,_0x34b24f){if(_0x1db7aa['body']['id']){delete _0x1db7aa[_0x12ca('0x36')]['id'];}return db['FaxInteraction'][_0x12ca('0x37')]({'where':{'id':_0x1db7aa[_0x12ca('0x29')]['id']}})['then'](handleEntityNotFound(_0x34b24f,null))['then'](saveUpdates(_0x1db7aa[_0x12ca('0x36')],null))[_0x12ca('0x1b')](respondWithResult(_0x34b24f,null))[_0x12ca('0x34')](handleError(_0x34b24f,null));};exports[_0x12ca('0x1c')]=function(_0x59860b,_0xb19c92){return db['FaxInteraction'][_0x12ca('0x37')]({'where':{'id':_0x59860b[_0x12ca('0x29')]['id']}})[_0x12ca('0x1b')](handleEntityNotFound(_0xb19c92,null))[_0x12ca('0x1b')](removeEntity(_0xb19c92,null))[_0x12ca('0x34')](handleError(_0xb19c92,null));};exports[_0x12ca('0x38')]=function(_0x3924cc,_0x49e890){return db['FaxInteraction']['describe']()[_0x12ca('0x1b')](respondWithResult(_0x49e890,null))['catch'](handleError(_0x49e890,null));};exports[_0x12ca('0x39')]=function(_0x535d8b,_0x209f99){return db[_0x12ca('0x3a')]['find']({'where':{'id':_0x535d8b[_0x12ca('0x29')]['id']}})[_0x12ca('0x1b')](handleEntityNotFound(_0x209f99,null))[_0x12ca('0x1b')](function(_0xcdbfcf){if(_0xcdbfcf){return _0xcdbfcf[_0x12ca('0x39')](_0x535d8b[_0x12ca('0x36')][_0x12ca('0x3b')],_[_0x12ca('0x3c')](_0x535d8b[_0x12ca('0x36')],[_0x12ca('0x3b'),'id'])||{});}})[_0x12ca('0x1b')](respondWithResult(_0x209f99,null))[_0x12ca('0x34')](handleError(_0x209f99,null));};exports['getMessages']=function(_0x59818e,_0x1b442d){var _0x172fd4={'raw':![],'where':{}};var _0x37b6db={};var _0x61b748={'count':0x0,'rows':[]};return db[_0x12ca('0x22')][_0x12ca('0x3d')]({'where':{'id':_0x59818e[_0x12ca('0x29')]['id']}})['then'](handleEntityNotFound(_0x1b442d,null))[_0x12ca('0x1b')](function(_0x209221){if(_0x209221){_0x37b6db[_0x12ca('0x2a')]=_[_0x12ca('0x2b')](db[_0x12ca('0x3a')][_0x12ca('0x2c')]);_0x37b6db['query']=_[_0x12ca('0x2b')](_0x59818e['query']);_0x37b6db[_0x12ca('0x3e')]=_['intersection'](_0x37b6db[_0x12ca('0x2a')],_0x37b6db['query']);_0x172fd4[_0x12ca('0x2e')]=_[_0x12ca('0x2d')](_0x37b6db[_0x12ca('0x2a')],qs[_0x12ca('0x2f')](_0x59818e[_0x12ca('0x26')][_0x12ca('0x2f')]));_0x172fd4[_0x12ca('0x2e')]=_0x172fd4[_0x12ca('0x2e')][_0x12ca('0x30')]?_0x172fd4[_0x12ca('0x2e')]:_0x37b6db[_0x12ca('0x2a')];if(!_0x59818e[_0x12ca('0x26')][_0x12ca('0x3f')](_0x12ca('0x40'))){_0x172fd4[_0x12ca('0x16')]=qs[_0x12ca('0x16')](_0x59818e[_0x12ca('0x26')]['limit']);_0x172fd4[_0x12ca('0x14')]=qs['offset'](_0x59818e[_0x12ca('0x26')][_0x12ca('0x14')]);}_0x172fd4['order']=qs[_0x12ca('0x41')](_0x59818e[_0x12ca('0x26')][_0x12ca('0x41')]);_0x172fd4[_0x12ca('0x42')]=qs[_0x12ca('0x3e')](_[_0x12ca('0x43')](_0x59818e[_0x12ca('0x26')],_0x37b6db['filters']));_0x172fd4[_0x12ca('0x42')][_0x12ca('0x44')]=_0x209221['id'];if(_0x59818e[_0x12ca('0x26')]['filter']){_0x172fd4['where']=_[_0x12ca('0x33')](_0x172fd4[_0x12ca('0x42')],{'$or':_[_0x12ca('0x21')](_0x172fd4[_0x12ca('0x2e')],function(_0xc3a717){var _0x2961ce={};_0x2961ce[_0xc3a717]={'$like':'%'+_0x59818e[_0x12ca('0x26')][_0x12ca('0x45')]+'%'};return _0x2961ce;})});}if(_0x59818e[_0x12ca('0x26')][_0x12ca('0x46')]){var _0x30f368=_0x59818e[_0x12ca('0x26')][_0x12ca('0x46')]['split'](',');var _0x2259b8={};_0x2259b8[_0x30f368[0x0]]={'$gte':moment(_0x30f368[0x1])[_0x12ca('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x172fd4['where']=_[_0x12ca('0x33')](_0x172fd4[_0x12ca('0x42')],_0x2259b8);}_0x172fd4=_['merge']({},_0x172fd4,_0x59818e['options']);return db[_0x12ca('0x3a')][_0x12ca('0x17')]({'where':_0x172fd4[_0x12ca('0x42')]})[_0x12ca('0x1b')](function(_0xa056e3){_0x61b748[_0x12ca('0x17')]=_0xa056e3;if(_0x59818e['query'][_0x12ca('0x31')]){_0x172fd4[_0x12ca('0x32')]=[{'all':!![]}];}return db[_0x12ca('0x3a')][_0x12ca('0x25')](_0x172fd4);})[_0x12ca('0x1b')](function(_0x44d906){_0x61b748['rows']=_0x44d906;return _0x61b748;});}})[_0x12ca('0x1b')](respondWithFilteredResult(_0x1b442d,_0x172fd4))[_0x12ca('0x34')](handleError(_0x1b442d,null));};exports[_0x12ca('0x48')]=function(_0x37dea3,_0x537644){return db['FaxInteraction']['find']({'where':{'id':_0x37dea3[_0x12ca('0x29')]['id']}})[_0x12ca('0x1b')](handleEntityNotFound(_0x537644,null))[_0x12ca('0x1b')](function(_0x53bfe5){if(_0x53bfe5){return _0x53bfe5['setTags'](_0x37dea3[_0x12ca('0x36')][_0x12ca('0x3b')],_[_0x12ca('0x3c')](_0x37dea3['body'],[_0x12ca('0x3b'),'id'])||{})[_0x12ca('0x49')](function(){return db[_0x12ca('0x4a')][_0x12ca('0x25')]({'attributes':['id',_0x12ca('0x1f'),_0x12ca('0x4b')],'where':{'id':_0x37dea3['body']['ids']}});})[_0x12ca('0x1b')](function(_0x1abbb9){socket[_0x12ca('0x4c')]('faxInteractionTags:save',{'id':Number(_0x37dea3[_0x12ca('0x29')]['id']),'tags':_0x1abbb9||[]});return{'id':Number(_0x37dea3[_0x12ca('0x29')]['id']),'tags':_0x1abbb9||[]};});}})['then'](respondWithResult(_0x537644,null))[_0x12ca('0x34')](handleError(_0x537644,null));};exports[_0x12ca('0x4d')]=function(_0x37ace0,_0x537f5e){return db['FaxInteraction'][_0x12ca('0x37')]({'where':{'id':_0x37ace0['params']['id']}})['then'](handleEntityNotFound(_0x537f5e,null))['then'](function(_0x116d29){if(_0x116d29){return _0x116d29[_0x12ca('0x4d')](_0x37ace0['query']['ids']);}})[_0x12ca('0x1b')](respondWithStatusCode(_0x537f5e,null))[_0x12ca('0x34')](handleError(_0x537f5e,null));};exports[_0x12ca('0x4e')]=function(_0x9f71eb,_0xb5d1a8){var _0x41036e=moment()[_0x12ca('0x4f')]()[_0x12ca('0x50')]();var _0x19303e=path[_0x12ca('0x51')](config[_0x12ca('0x52')],_0x12ca('0x53'),_0x12ca('0x54'),_0x12ca('0x55'));var _0x68079f=path[_0x12ca('0x51')](config[_0x12ca('0x52')],_0x12ca('0x53'),'files',_0x12ca('0x56'));var _0x464f3f=path[_0x12ca('0x51')](_0x19303e,_0x41036e);var _0x417559=util['format'](_0x12ca('0x57'),_0x9f71eb[_0x12ca('0x29')]['id'],_0x41036e);var _0x478f65=path[_0x12ca('0x51')](_0x19303e,_0x417559);var _0x2cd7df=[];_0x2cd7df[_0x12ca('0x58')]({'model':db[_0x12ca('0x59')],'as':_0x12ca('0x59'),'raw':!![]});var _0x11e50d=[{'model':db[_0x12ca('0x3a')],'as':'Messages','attributes':['id','body',_0x12ca('0x5a')],'include':_0x2cd7df}];return db[_0x12ca('0x22')][_0x12ca('0x37')]({'where':{'id':_0x9f71eb[_0x12ca('0x29')]['id']},'include':_0x11e50d})[_0x12ca('0x1b')](handleEntityNotFound(_0xb5d1a8,null))['then'](function(_0x23b953){if(_0x23b953&&_0x23b953[_0x12ca('0x5b')]){var _0x3c00d7=_0x23b953[_0x12ca('0x5c')]({'plain':!![]});fs['mkdirSync'](_0x464f3f);for(var _0xa28732=0x0;_0xa28732<_0x3c00d7[_0x12ca('0x5b')]['length'];_0xa28732++){var _0x5d7ce1=_0x3c00d7[_0x12ca('0x5b')][_0xa28732][_0x12ca('0x59')];if(_0x5d7ce1){var _0x2c61fa=path[_0x12ca('0x51')](_0x68079f,_0x5d7ce1['basename']);if(fs[_0x12ca('0x5d')](_0x2c61fa)){fs[_0x12ca('0x5e')](_0x2c61fa)['pipe'](fs['createWriteStream'](path[_0x12ca('0x51')](_0x464f3f,_0x5d7ce1['basename'])));}}}return BPromise[_0x12ca('0x5f')]()['then'](function(){return new BPromise(function(_0x35ac34,_0x19cfd7){zipdir(_0x464f3f,{'saveTo':_0x478f65},function(_0x39a21c,_0x3814cf){if(_0x39a21c)return _0x19cfd7(_0x39a21c);return _0x35ac34(_0x3814cf);});})[_0x12ca('0x1b')](function(){return new BPromise(function(_0x1f0b6f,_0x1c4a64){rimraf(_0x464f3f,function(_0x729870){if(_0x729870)_0x1c4a64(_0x729870);return _0x1f0b6f();});});})[_0x12ca('0x1b')](function(){return _0xb5d1a8['download'](_0x478f65,_0x417559,function(_0x1fb6ec){if(_0x1fb6ec){console[_0x12ca('0x60')](_0x12ca('0x61'),_0x1fb6ec);}else{fs[_0x12ca('0x62')](_0x478f65);}});});});}else{return _0xb5d1a8['sendStatus'](0xc8);}})[_0x12ca('0x34')](handleError(_0xb5d1a8,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index c90b901..30f2c8f 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 _0x8286=['findAll','length','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map'];(function(_0x2c6c98,_0x1f5be7){var _0x430633=function(_0x35ead4){while(--_0x35ead4){_0x2c6c98['push'](_0x2c6c98['shift']());}};_0x430633(++_0x1f5be7);}(_0x8286,0x127));var _0x6828=function(_0x5e10ba,_0x47c29d){_0x5e10ba=_0x5e10ba-0x0;var _0x4b447b=_0x8286[_0x5e10ba];return _0x4b447b;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x6828('0x0'))['db'][_0x6828('0x1')];var FaxMessage=require(_0x6828('0x0'))['db'][_0x6828('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x6828('0x3')](0x0);var events={'afterCreate':_0x6828('0x4'),'afterUpdate':_0x6828('0x5'),'afterDestroy':_0x6828('0x6')};function emitEvent(_0x23fa40){return function(_0x1f8846,_0x54a075,_0x2487bd){_0x1f8846[_0x6828('0x7')]({'attributes':['id'],'raw':!![]})[_0x6828('0x8')](function(_0x4e91f2){_0x1f8846['setDataValue'](_0x6828('0x9'),_0x4e91f2[_0x6828('0xa')](function(_0x1f9604){return{'id':_0x1f9604['id']};}));return FaxMessage[_0x6828('0xb')]({'where':{'FaxInteractionId':_0x1f8846['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6828('0x8')](function(_0x445d8b){_0x1f8846['setDataValue']('unreadMessages',_0x445d8b[_0x6828('0xc')]);FaxInteractionEvents[_0x6828('0xd')](_0x23fa40+':'+_0x1f8846['id'],_0x1f8846);FaxInteractionEvents[_0x6828('0xd')](_0x23fa40,_0x1f8846);_0x2487bd(null);})['catch'](_0x2487bd(null));};}for(var e in events){if(events[_0x6828('0xe')](e)){var event=events[e];FaxInteraction[_0x6828('0xf')](e,emitEvent(event));}}module[_0x6828('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x5194=['setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction'];(function(_0x382719,_0x91d5cb){var _0x48cff9=function(_0xf539c3){while(--_0xf539c3){_0x382719['push'](_0x382719['shift']());}};_0x48cff9(++_0x91d5cb);}(_0x5194,0x195));var _0x4519=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x5194[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require(_0x4519('0x0'));var FaxInteraction=require(_0x4519('0x1'))['db'][_0x4519('0x2')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x4519('0x3')](0x0);var events={'afterCreate':_0x4519('0x4'),'afterUpdate':_0x4519('0x5'),'afterDestroy':_0x4519('0x6')};function emitEvent(_0x1aabaf){return function(_0x2cad89,_0x49c6ad,_0x1bc958){_0x2cad89['getUsers']({'attributes':['id'],'raw':!![]})[_0x4519('0x7')](function(_0x41b7ae){_0x2cad89[_0x4519('0x8')](_0x4519('0x9'),_0x41b7ae[_0x4519('0xa')](function(_0x46758c){return{'id':_0x46758c['id']};}));return FaxMessage[_0x4519('0xb')]({'where':{'FaxInteractionId':_0x2cad89['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4519('0x7')](function(_0x3bf0b6){_0x2cad89[_0x4519('0x8')]('unreadMessages',_0x3bf0b6[_0x4519('0xc')]);FaxInteractionEvents[_0x4519('0xd')](_0x1aabaf+':'+_0x2cad89['id'],_0x2cad89);FaxInteractionEvents['emit'](_0x1aabaf,_0x2cad89);_0x1bc958(null);})[_0x4519('0xe')](_0x1bc958(null));};}for(var e in events){if(events[_0x4519('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x4519('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index d39ad21..6c2e354 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 _0x03fa=['closed','closedAt','format','lodash','api','moment','bluebird','request-promise','rimraf','define','FaxInteraction','changed'];(function(_0x442030,_0x5f363e){var _0x569fed=function(_0x50f88d){while(--_0x50f88d){_0x442030['push'](_0x442030['shift']());}};_0x569fed(++_0x5f363e);}(_0x03fa,0x117));var _0xa03f=function(_0x8c0251,_0x5b79bc){_0x8c0251=_0x8c0251-0x0;var _0x83108b=_0x03fa[_0x8c0251];return _0x83108b;};'use strict';var _=require(_0xa03f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa03f('0x1'));var moment=require(_0xa03f('0x2'));var BPromise=require(_0xa03f('0x3'));var rp=require(_0xa03f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa03f('0x5'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x40108a,_0x1bb9e6){return _0x40108a[_0xa03f('0x6')](_0xa03f('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a1050,_0x104f42,_0x42f4ca){if(_0x1a1050[_0xa03f('0x8')](_0xa03f('0x9'))){_0x1a1050[_0xa03f('0xa')]=moment()[_0xa03f('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x42f4ca(null,_0x1a1050);}}});}; \ No newline at end of file +var _0x0018=['request-promise','path','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x0018,0x1aa));var _0x8001=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0018[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x8001('0x0'));var util=require(_0x8001('0x1'));var logger=require(_0x8001('0x2'))(_0x8001('0x3'));var moment=require(_0x8001('0x4'));var BPromise=require(_0x8001('0x5'));var rp=require(_0x8001('0x6'));var fs=require('fs');var path=require(_0x8001('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8001('0x8'));module[_0x8001('0x9')]=function(_0x183850,_0x33d797){return _0x183850[_0x8001('0xa')](_0x8001('0xb'),attributes,{'tableName':_0x8001('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x460f4a,_0xf39064,_0x59ebaa){if(_0x460f4a[_0x8001('0xd')]('closed')){_0x460f4a[_0x8001('0xe')]=moment()['format'](_0x8001('0xf'));}_0x59ebaa(null,_0x460f4a);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 3ea3077..61800ac 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 _0x2856=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateFaxInteraction','update','body','options','where','limit','debug','stringify','catch','FaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x112411,_0x5b32a2){var _0x4ccd23=function(_0x19471f){while(--_0x19471f){_0x112411['push'](_0x112411['shift']());}};_0x4ccd23(++_0x5b32a2);}(_0x2856,0x1ce));var _0x6285=function(_0x78a8f4,_0x259809){_0x78a8f4=_0x78a8f4-0x0;var _0x2b3291=_0x2856[_0x78a8f4];return _0x2b3291;};'use strict';var _=require(_0x6285('0x0'));var util=require(_0x6285('0x1'));var moment=require(_0x6285('0x2'));var BPromise=require(_0x6285('0x3'));var rs=require(_0x6285('0x4'));var fs=require('fs');var Redis=require(_0x6285('0x5'));var db=require(_0x6285('0x6'))['db'];var utils=require(_0x6285('0x7'));var logger=require(_0x6285('0x8'))(_0x6285('0x9'));var config=require(_0x6285('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6285('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6285('0xc'),'port':0x18eb});var socket=require(_0x6285('0xd'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x6285('0xe')](socket);function respondWithRpcPromise(_0x589e1b,_0x3d49d7,_0x4e35e2){return new BPromise(function(_0x521358,_0x2dddad){return client[_0x6285('0xf')](_0x589e1b,_0x4e35e2)[_0x6285('0x10')](function(_0x158116){logger[_0x6285('0x11')](_0x6285('0x12'),_0x3d49d7,_0x6285('0x13'));logger['debug'](_0x6285('0x14'),_0x3d49d7,_0x6285('0x13'),JSON['stringify'](_0x158116));if(_0x158116['error']){if(_0x158116[_0x6285('0x15')][_0x6285('0x16')]===0x1f4){logger['error'](_0x6285('0x12'),_0x3d49d7,_0x158116[_0x6285('0x15')][_0x6285('0x17')]);return _0x2dddad(_0x158116['error'][_0x6285('0x17')]);}logger[_0x6285('0x15')](_0x6285('0x12'),_0x3d49d7,_0x158116['error'][_0x6285('0x17')]);return _0x521358(_0x158116[_0x6285('0x15')]['message']);}else{logger[_0x6285('0x11')](_0x6285('0x12'),_0x3d49d7,'request\x20sent');_0x521358(_0x158116['result'][_0x6285('0x17')]);}})['catch'](function(_0x3ee0ee){logger[_0x6285('0x15')](_0x6285('0x12'),_0x3d49d7,_0x3ee0ee);_0x2dddad(_0x3ee0ee);});});}exports[_0x6285('0x18')]=function(_0x197252){var _0xcbcddd=this;return new Promise(function(_0x4d60df,_0x5ef08c){return db['FaxInteraction'][_0x6285('0x19')](_0x197252[_0x6285('0x1a')],{'raw':_0x197252['options']?_0x197252[_0x6285('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x197252['options']?_0x197252[_0x6285('0x1b')][_0x6285('0x1c')]||null:null,'attributes':_0x197252['options']?_0x197252[_0x6285('0x1b')]['attributes']||null:null,'limit':_0x197252[_0x6285('0x1b')]?_0x197252[_0x6285('0x1b')][_0x6285('0x1d')]||null:null})[_0x6285('0x10')](function(_0x2eae68){logger[_0x6285('0x11')](_0x6285('0x18'),_0x197252);logger[_0x6285('0x1e')](_0x6285('0x18'),_0x197252,JSON[_0x6285('0x1f')](_0x2eae68));_0x4d60df(_0x2eae68);})[_0x6285('0x20')](function(_0x469118){logger[_0x6285('0x15')](_0x6285('0x18'),_0x469118[_0x6285('0x17')],_0x197252);_0x5ef08c(_0xcbcddd[_0x6285('0x15')](0x1f4,_0x469118[_0x6285('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x470e2b){return new Promise(function(_0x31d6f5,_0x539393){return db[_0x6285('0x21')][_0x6285('0x22')]({'where':_0x470e2b[_0x6285('0x1b')]?_0x470e2b[_0x6285('0x1b')][_0x6285('0x1c')]||null:null})[_0x6285('0x10')](function(_0x5bbf9c){if(_0x5bbf9c){return _0x5bbf9c[_0x6285('0x23')](_0x470e2b[_0x6285('0x1a')][_0x6285('0x24')],_[_0x6285('0x25')](_0x470e2b[_0x6285('0x1a')],[_0x6285('0x24'),'id'])||{});}})['spread'](function(_0x397435){logger[_0x6285('0x11')](_0x6285('0x26'),_0x470e2b);logger[_0x6285('0x1e')]('AddTags',_0x470e2b,JSON[_0x6285('0x1f')](_0x397435));_0x31d6f5(_0x397435);})[_0x6285('0x20')](function(_0x3cc37e){logger[_0x6285('0x15')]('AddTags',_0x3cc37e[_0x6285('0x17')],_0x470e2b);_0x539393(_this[_0x6285('0x15')](0x1f4,_0x3cc37e[_0x6285('0x17')]));});});}; \ No newline at end of file +var _0x7090=['FaxInteraction','update','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','then','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','FaxInteraction,\x20%s,\x20%s','message','info','catch','UpdateFaxInteraction'];(function(_0x255d9f,_0x558dbf){var _0x435eb4=function(_0x3ca94d){while(--_0x3ca94d){_0x255d9f['push'](_0x255d9f['shift']());}};_0x435eb4(++_0x558dbf);}(_0x7090,0xbe));var _0x0709=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x7090[_0x235f49];return _0x551139;};'use strict';var _=require(_0x0709('0x0'));var util=require(_0x0709('0x1'));var moment=require(_0x0709('0x2'));var BPromise=require(_0x0709('0x3'));var rs=require(_0x0709('0x4'));var fs=require('fs');var Redis=require(_0x0709('0x5'));var db=require(_0x0709('0x6'))['db'];var utils=require(_0x0709('0x7'));var logger=require(_0x0709('0x8'))(_0x0709('0x9'));var config=require(_0x0709('0xa'));var jayson=require(_0x0709('0xb'));var client=jayson[_0x0709('0xc')][_0x0709('0xd')]({'port':0x232a});config[_0x0709('0xe')]=_[_0x0709('0xf')](config[_0x0709('0xe')],{'host':_0x0709('0x10'),'port':0x18eb});var socket=require(_0x0709('0x11'))(new Redis(config[_0x0709('0xe')]));require(_0x0709('0x12'))['register'](socket);function respondWithRpcPromise(_0x474470,_0x1bb7ab,_0x108e35){return new BPromise(function(_0x13a26e,_0x3dab00){return client['request'](_0x474470,_0x108e35)[_0x0709('0x13')](function(_0x582232){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x1bb7ab,_0x0709('0x14'));logger[_0x0709('0x15')](_0x0709('0x16'),_0x1bb7ab,'request\x20sent',JSON[_0x0709('0x17')](_0x582232));if(_0x582232[_0x0709('0x18')]){if(_0x582232[_0x0709('0x18')]['code']===0x1f4){logger[_0x0709('0x18')](_0x0709('0x19'),_0x1bb7ab,_0x582232[_0x0709('0x18')][_0x0709('0x1a')]);return _0x3dab00(_0x582232['error'][_0x0709('0x1a')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x1bb7ab,_0x582232[_0x0709('0x18')][_0x0709('0x1a')]);return _0x13a26e(_0x582232['error'][_0x0709('0x1a')]);}else{logger[_0x0709('0x1b')]('FaxInteraction,\x20%s,\x20%s',_0x1bb7ab,_0x0709('0x14'));_0x13a26e(_0x582232['result'][_0x0709('0x1a')]);}})[_0x0709('0x1c')](function(_0x574eb8){logger[_0x0709('0x18')](_0x0709('0x19'),_0x1bb7ab,_0x574eb8);_0x3dab00(_0x574eb8);});});}exports[_0x0709('0x1d')]=function(_0x10fafc){var _0x1fc18e=this;return new Promise(function(_0x191e69,_0xe670ac){return db[_0x0709('0x1e')][_0x0709('0x1f')](_0x10fafc['body'],{'raw':_0x10fafc[_0x0709('0x20')]?_0x10fafc[_0x0709('0x20')][_0x0709('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10fafc['options']?_0x10fafc[_0x0709('0x20')][_0x0709('0x22')]||null:null,'attributes':_0x10fafc[_0x0709('0x20')]?_0x10fafc['options'][_0x0709('0x23')]||null:null,'limit':_0x10fafc[_0x0709('0x20')]?_0x10fafc[_0x0709('0x20')][_0x0709('0x24')]||null:null})[_0x0709('0x13')](function(_0x253912){logger[_0x0709('0x1b')]('UpdateFaxInteraction',_0x10fafc);logger[_0x0709('0x15')]('UpdateFaxInteraction',_0x10fafc,JSON[_0x0709('0x17')](_0x253912));_0x191e69(_0x253912);})[_0x0709('0x1c')](function(_0x3c866b){logger[_0x0709('0x18')](_0x0709('0x1d'),_0x3c866b['message'],_0x10fafc);_0xe670ac(_0x1fc18e[_0x0709('0x18')](0x1f4,_0x3c866b['message']));});});};exports[_0x0709('0x25')]=function(_0x219b64){return new Promise(function(_0x5601f5,_0x40e773){return db['FaxInteraction'][_0x0709('0x26')]({'where':_0x219b64[_0x0709('0x20')]?_0x219b64[_0x0709('0x20')][_0x0709('0x22')]||null:null})[_0x0709('0x13')](function(_0x58f7fe){if(_0x58f7fe){return _0x58f7fe[_0x0709('0x27')](_0x219b64[_0x0709('0x28')][_0x0709('0x29')],_['omit'](_0x219b64[_0x0709('0x28')],[_0x0709('0x29'),'id'])||{});}})[_0x0709('0x2a')](function(_0x3b27fd){logger[_0x0709('0x1b')](_0x0709('0x2b'),_0x219b64);logger[_0x0709('0x15')](_0x0709('0x2b'),_0x219b64,JSON[_0x0709('0x17')](_0x3b27fd));_0x5601f5(_0x3b27fd);})[_0x0709('0x1c')](function(_0x389d8c){logger[_0x0709('0x18')](_0x0709('0x2b'),_0x389d8c[_0x0709('0x1a')],_0x219b64);_0x40e773(_this[_0x0709('0x18')](0x1f4,_0x389d8c[_0x0709('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index a071992..b3bc3af 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 _0xce6e=['register','save','remove','update','emit'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0xce6e,0x114));var _0xece6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce6e[_0x3dd15e];return _0x231fd0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xece6('0x0'),_0xece6('0x1'),_0xece6('0x2')];function createListener(_0x26b042,_0x84057e){return function(_0x86d314){_0x84057e[_0xece6('0x3')](_0x26b042,_0x86d314);};}function removeListener(_0x3620ff,_0x28ad5d){return function(){FaxInteractionEvents['removeListener'](_0x3620ff,_0x28ad5d);};}exports[_0xece6('0x4')]=function(_0x499d39){for(var _0x276984=0x0,_0xc95104=events['length'];_0x276984<_0xc95104;_0x276984++){var _0x524794=events[_0x276984];var _0x393567=createListener('faxInteraction:'+_0x524794,_0x499d39);FaxInteractionEvents['on'](_0x524794,_0x393567);}}; \ No newline at end of file +var _0xe219=['faxInteraction:','./faxInteraction.events','save','remove','emit','register'];(function(_0x5c0165,_0x401a98){var _0x1af691=function(_0x304362){while(--_0x304362){_0x5c0165['push'](_0x5c0165['shift']());}};_0x1af691(++_0x401a98);}(_0xe219,0xd3));var _0x9e21=function(_0x285d82,_0x388e71){_0x285d82=_0x285d82-0x0;var _0x5f2b4f=_0xe219[_0x285d82];return _0x5f2b4f;};'use strict';var FaxInteractionEvents=require(_0x9e21('0x0'));var events=[_0x9e21('0x1'),_0x9e21('0x2'),'update'];function createListener(_0x2dd04f,_0x39fa38){return function(_0x4faee9){_0x39fa38[_0x9e21('0x3')](_0x2dd04f,_0x4faee9);};}function removeListener(_0x5e92cb,_0x287505){return function(){FaxInteractionEvents['removeListener'](_0x5e92cb,_0x287505);};}exports[_0x9e21('0x4')]=function(_0x5ea3f1){for(var _0x20365b=0x0,_0x84e2b3=events['length'];_0x20365b<_0x84e2b3;_0x20365b++){var _0x471bda=events[_0x20365b];var _0x3fc189=createListener(_0x9e21('0x5')+_0x471bda,_0x5ea3f1);FaxInteractionEvents['on'](_0x471bda,_0x3fc189);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 23c2af5..16af16d 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 _0xc8e0=['destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','post','addMessage','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','delete','faxinteraction:destroy'];(function(_0x24a2da,_0x1e81f9){var _0x2eb574=function(_0x164eb1){while(--_0x164eb1){_0x24a2da['push'](_0x24a2da['shift']());}};_0x2eb574(++_0x1e81f9);}(_0xc8e0,0xb7));var _0x0c8e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc8e0[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x0c8e('0x0'));var util=require(_0x0c8e('0x1'));var path=require(_0x0c8e('0x2'));var timeout=require(_0x0c8e('0x3'));var express=require(_0x0c8e('0x4'));var router=express[_0x0c8e('0x5')]();var fs_extra=require(_0x0c8e('0x6'));var auth=require(_0x0c8e('0x7'));var interaction=require(_0x0c8e('0x8'));var config=require(_0x0c8e('0x9'));var controller=require('./faxInteraction.controller');router[_0x0c8e('0xa')]('/',auth[_0x0c8e('0xb')](),controller[_0x0c8e('0xc')]);router[_0x0c8e('0xa')](_0x0c8e('0xd'),auth['isAuthenticated'](),controller[_0x0c8e('0xe')]);router[_0x0c8e('0xa')](_0x0c8e('0xf'),auth['isAuthenticated'](),controller[_0x0c8e('0x10')]);router[_0x0c8e('0xa')]('/:id/messages',auth[_0x0c8e('0xb')](),controller[_0x0c8e('0x11')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x0c8e('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0c8e('0x12')]('/:id/messages',auth[_0x0c8e('0xb')](),controller[_0x0c8e('0x13')]);router[_0x0c8e('0x12')]('/:id/tags',auth[_0x0c8e('0xb')](),interaction[_0x0c8e('0x14')](_0x0c8e('0x15'),_0x0c8e('0x16')),controller['addTags']);router[_0x0c8e('0x17')]('/:id',auth[_0x0c8e('0xb')](),interaction[_0x0c8e('0x14')](_0x0c8e('0x15'),_0x0c8e('0x18')),controller['update']);router[_0x0c8e('0x19')](_0x0c8e('0xf'),auth['isAuthenticated'](),interaction[_0x0c8e('0x14')](_0x0c8e('0x15'),_0x0c8e('0x1a')),controller[_0x0c8e('0x1b')]);router[_0x0c8e('0x19')](_0x0c8e('0x1c'),auth[_0x0c8e('0xb')](),controller[_0x0c8e('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xa234=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','fax','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./faxInteraction.controller'];(function(_0x346dba,_0x4301dd){var _0x3fafe1=function(_0x27bc63){while(--_0x27bc63){_0x346dba['push'](_0x346dba['shift']());}};_0x3fafe1(++_0x4301dd);}(_0xa234,0x142));var _0x4a23=function(_0x20e08b,_0x481bd7){_0x20e08b=_0x20e08b-0x0;var _0x1b8bc7=_0xa234[_0x20e08b];return _0x1b8bc7;};'use strict';var multer=require(_0x4a23('0x0'));var util=require(_0x4a23('0x1'));var path=require(_0x4a23('0x2'));var timeout=require(_0x4a23('0x3'));var express=require(_0x4a23('0x4'));var router=express['Router']();var fs_extra=require(_0x4a23('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4a23('0x6'));var config=require('../../config/environment');var controller=require(_0x4a23('0x7'));router[_0x4a23('0x8')]('/',auth[_0x4a23('0x9')](),controller[_0x4a23('0xa')]);router[_0x4a23('0x8')](_0x4a23('0xb'),auth['isAuthenticated'](),controller[_0x4a23('0xc')]);router[_0x4a23('0x8')](_0x4a23('0xd'),auth[_0x4a23('0x9')](),controller[_0x4a23('0xe')]);router[_0x4a23('0x8')](_0x4a23('0xf'),auth[_0x4a23('0x9')](),controller[_0x4a23('0x10')]);router[_0x4a23('0x8')](_0x4a23('0x11'),auth['isAuthenticated'](),controller[_0x4a23('0x12')]);router[_0x4a23('0x13')]('/',auth[_0x4a23('0x9')](),controller['create']);router[_0x4a23('0x13')](_0x4a23('0xf'),auth[_0x4a23('0x9')](),controller[_0x4a23('0x14')]);router['post'](_0x4a23('0x15'),auth[_0x4a23('0x9')](),interaction[_0x4a23('0x16')](_0x4a23('0x17'),'faxinteraction:addtags'),controller['addTags']);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x4a23('0x16')](_0x4a23('0x17'),_0x4a23('0x18')),controller[_0x4a23('0x19')]);router['delete'](_0x4a23('0xd'),auth['isAuthenticated'](),interaction[_0x4a23('0x16')](_0x4a23('0x17'),_0x4a23('0x1a')),controller[_0x4a23('0x1b')]);router[_0x4a23('0x1c')](_0x4a23('0x15'),auth['isAuthenticated'](),controller[_0x4a23('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 7ee6296..dd58260 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 _0xc112=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0xbc3484,_0x236cad){var _0x1c0096=function(_0x5710cb){while(--_0x5710cb){_0xbc3484['push'](_0xbc3484['shift']());}};_0x1c0096(++_0x236cad);}(_0xc112,0xec));var _0x2c11=function(_0x1ff9bb,_0x29f13e){_0x1ff9bb=_0x1ff9bb-0x0;var _0x1ed027=_0xc112[_0x1ff9bb];return _0x1ed027;};'use strict';var Sequelize=require(_0x2c11('0x0'));module[_0x2c11('0x1')]={'body':{'type':Sequelize[_0x2c11('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2c11('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2c11('0x4')]('in',_0x2c11('0x5')),'defaultValue':_0x2c11('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x2c11('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x2c11('0x6')]}}; \ No newline at end of file +var _0x032a=['TEXT','DATE','exports','medium','BOOLEAN','ENUM','out'];(function(_0x34f282,_0x3fc6d9){var _0x57a2af=function(_0x1af099){while(--_0x1af099){_0x34f282['push'](_0x34f282['shift']());}};_0x57a2af(++_0x3fc6d9);}(_0x032a,0xf0));var _0xa032=function(_0x2e2104,_0x11287d){_0x2e2104=_0x2e2104-0x0;var _0x1280c5=_0x032a[_0x2e2104];return _0x1280c5;};'use strict';var Sequelize=require('sequelize');module[_0xa032('0x0')]={'body':{'type':Sequelize['TEXT'](_0xa032('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xa032('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa032('0x3')]('in',_0xa032('0x4')),'defaultValue':_0xa032('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xa032('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0xa032('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index ffe1668..5281315 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 _0x10c4=['RejectMessage','rejectMessage','Sequelize','QueryTypes','agent','channel','rejectmessage','create','Attachment','SendFax','/var/opt/motion2/server/files/attachments/%s','AttachmentId','join','root','files','attachments','download','basename','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','jayson/promise','client','http','request','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','FaxMessage','includeAll','findAll','rows','show','params','rawAttributes','length','include','body','find','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','email','internal','manual','interface','SIP/%s','motionChannel','event','EventManager','acceptmessage','../../config/logger','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x995166,_0x2501b9){var _0x4910be=function(_0x1abb92){while(--_0x1abb92){_0x995166['push'](_0x995166['shift']());}};_0x4910be(++_0x2501b9);}(_0x10c4,0xa1));var _0x410c=function(_0x2abcba,_0x3fdaee){_0x2abcba=_0x2abcba-0x0;var _0x3b1267=_0x10c4[_0x2abcba];return _0x3b1267;};'use strict';var emlformat=require(_0x410c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x410c('0x1'));var jsonpatch=require(_0x410c('0x2'));var rp=require(_0x410c('0x3'));var moment=require(_0x410c('0x4'));var BPromise=require(_0x410c('0x5'));var Mustache=require(_0x410c('0x6'));var util=require('util');var path=require(_0x410c('0x7'));var sox=require(_0x410c('0x8'));var csv=require(_0x410c('0x9'));var ejs=require(_0x410c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x410c('0xb'));var squel=require('squel');var crypto=require(_0x410c('0xc'));var jsforce=require(_0x410c('0xd'));var deskjs=require(_0x410c('0xe'));var toCsv=require(_0x410c('0x9'));var querystring=require(_0x410c('0xf'));var Papa=require(_0x410c('0x10'));var Redis=require(_0x410c('0x11'));var authService=require(_0x410c('0x12'));var qs=require(_0x410c('0x13'));var as=require(_0x410c('0x14'));var hardwareService=require(_0x410c('0x15'));var logger=require('../../config/logger')(_0x410c('0x16'));var utils=require('../../config/utils');var config=require(_0x410c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x410c('0x18'))['db'];config[_0x410c('0x19')]=_[_0x410c('0x1a')](config[_0x410c('0x19')],{'host':_0x410c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x410c('0x19')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x410c('0x1c'));var client=jayson[_0x410c('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0x410c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x504eac,_0x559c7a,_0x39395c,_0x469686){return new BPromise(function(_0x1cf487,_0x45ce6b){var _0x422884=_0x469686||client;return _0x422884[_0x410c('0x1f')](_0x504eac,_0x39395c)['then'](function(_0x29cda7){logger['info'](_0x410c('0x20'),_0x559c7a,_0x410c('0x21'));logger['debug'](_0x410c('0x22'),_0x559c7a,_0x410c('0x21'),JSON[_0x410c('0x23')](_0x29cda7));if(_0x29cda7[_0x410c('0x24')]){if(_0x29cda7[_0x410c('0x24')]['code']===0x1f4){logger[_0x410c('0x24')](_0x410c('0x20'),_0x559c7a,_0x29cda7[_0x410c('0x24')][_0x410c('0x25')]);return _0x45ce6b(_0x29cda7[_0x410c('0x24')][_0x410c('0x25')]);}logger[_0x410c('0x24')](_0x410c('0x20'),_0x559c7a,_0x29cda7[_0x410c('0x24')]['message']);return _0x1cf487(_0x29cda7[_0x410c('0x24')][_0x410c('0x25')]);}else{logger[_0x410c('0x26')](_0x410c('0x20'),_0x559c7a,_0x410c('0x21'));_0x1cf487(_0x29cda7[_0x410c('0x27')][_0x410c('0x25')]);}})[_0x410c('0x28')](function(_0x854dea){logger[_0x410c('0x24')](_0x410c('0x20'),_0x559c7a,_0x854dea);_0x45ce6b(_0x854dea);});});}function respondWithStatusCode(_0x3c69f0,_0x1320bd){_0x1320bd=_0x1320bd||0xcc;return function(_0x3ba3b9){if(_0x3ba3b9){return _0x3c69f0[_0x410c('0x29')](_0x1320bd);}return _0x3c69f0['status'](_0x1320bd)['end']();};}function respondWithResult(_0x1dca86,_0x1bc093){_0x1bc093=_0x1bc093||0xc8;return function(_0x270cf6){if(_0x270cf6){return _0x1dca86[_0x410c('0x2a')](_0x1bc093)[_0x410c('0x2b')](_0x270cf6);}};}function respondWithFilteredResult(_0x340039,_0x1d4b5b){return function(_0x582e67){if(_0x582e67){var _0x141a82=typeof _0x1d4b5b[_0x410c('0x2c')]===_0x410c('0x2d')&&typeof _0x1d4b5b[_0x410c('0x2e')]===_0x410c('0x2d');var _0x1529ab=_0x582e67[_0x410c('0x2f')];var _0x2431af=_0x141a82?0x0:_0x1d4b5b['offset'];var _0x5a0c7d=_0x141a82?_0x582e67['count']:_0x1d4b5b['offset']+_0x1d4b5b[_0x410c('0x2e')];var _0x43399b;if(_0x5a0c7d>=_0x1529ab){_0x5a0c7d=_0x1529ab;_0x43399b=0xc8;}else{_0x43399b=0xce;}_0x340039['status'](_0x43399b);return _0x340039['set'](_0x410c('0x30'),_0x2431af+'-'+_0x5a0c7d+'/'+_0x1529ab)[_0x410c('0x2b')](_0x582e67);}return null;};}function patchUpdates(_0x20f0e9){return function(_0x2cdd14){try{jsonpatch[_0x410c('0x31')](_0x2cdd14,_0x20f0e9,!![]);}catch(_0x16c210){return BPromise[_0x410c('0x32')](_0x16c210);}return _0x2cdd14[_0x410c('0x33')]();};}function saveUpdates(_0x2740bf,_0xf2af2d){return function(_0x11e828){if(_0x11e828){return _0x11e828[_0x410c('0x34')](_0x2740bf)[_0x410c('0x35')](function(_0x47daab){return _0x47daab;});}return null;};}function removeEntity(_0x26e035,_0x1d885a){return function(_0x36d997){if(_0x36d997){return _0x36d997[_0x410c('0x36')]()[_0x410c('0x35')](function(){_0x26e035['status'](0xcc)[_0x410c('0x37')]();});}};}function handleEntityNotFound(_0x3fd3cc,_0xf74537){return function(_0x549923){if(!_0x549923){_0x3fd3cc[_0x410c('0x29')](0x194);}return _0x549923;};}function handleError(_0x450768,_0x510e82){_0x510e82=_0x510e82||0x1f4;return function(_0x5a63da){logger[_0x410c('0x24')](_0x5a63da[_0x410c('0x38')]);if(_0x5a63da['name']){delete _0x5a63da[_0x410c('0x39')];}_0x450768[_0x410c('0x2a')](_0x510e82)[_0x410c('0x3a')](_0x5a63da);};}exports[_0x410c('0x3b')]=function(_0x5bfe4a,_0x56aed5){var _0x268ef5={},_0x587b63={},_0x795c1f={'count':0x0,'rows':[]};var _0x44fa90=_[_0x410c('0x3c')](db['FaxMessage']['rawAttributes'],function(_0x4464ab){return{'name':_0x4464ab['fieldName'],'type':_0x4464ab[_0x410c('0x3d')][_0x410c('0x3e')]};});_0x587b63[_0x410c('0x3f')]=_[_0x410c('0x3c')](_0x44fa90,_0x410c('0x39'));_0x587b63['query']=_[_0x410c('0x40')](_0x5bfe4a[_0x410c('0x41')]);_0x587b63[_0x410c('0x42')]=_[_0x410c('0x43')](_0x587b63['model'],_0x587b63[_0x410c('0x41')]);_0x268ef5[_0x410c('0x44')]=_[_0x410c('0x43')](_0x587b63[_0x410c('0x3f')],qs['fields'](_0x5bfe4a[_0x410c('0x41')][_0x410c('0x45')]));_0x268ef5[_0x410c('0x44')]=_0x268ef5[_0x410c('0x44')]['length']?_0x268ef5[_0x410c('0x44')]:_0x587b63[_0x410c('0x3f')];if(!_0x5bfe4a[_0x410c('0x41')][_0x410c('0x46')](_0x410c('0x47'))){_0x268ef5['limit']=qs[_0x410c('0x2e')](_0x5bfe4a[_0x410c('0x41')][_0x410c('0x2e')]);_0x268ef5[_0x410c('0x2c')]=qs[_0x410c('0x2c')](_0x5bfe4a[_0x410c('0x41')][_0x410c('0x2c')]);}_0x268ef5['order']=qs[_0x410c('0x48')](_0x5bfe4a[_0x410c('0x41')][_0x410c('0x48')]);_0x268ef5[_0x410c('0x49')]=qs['filters'](_[_0x410c('0x4a')](_0x5bfe4a[_0x410c('0x41')],_0x587b63[_0x410c('0x42')]),_0x44fa90);if(_0x5bfe4a[_0x410c('0x41')]['filter']){_0x268ef5[_0x410c('0x49')]=_[_0x410c('0x4b')](_0x268ef5[_0x410c('0x49')],{'$or':_[_0x410c('0x3c')](_0x44fa90,function(_0x58727e){if(_0x58727e['type']!=='VIRTUAL'){var _0x43c848={};_0x43c848[_0x58727e[_0x410c('0x39')]]={'$like':'%'+_0x5bfe4a[_0x410c('0x41')][_0x410c('0x4c')]+'%'};return _0x43c848;}})});}_0x268ef5=_[_0x410c('0x4b')]({},_0x268ef5,_0x5bfe4a[_0x410c('0x4d')]);var _0x45a5a1={'where':_0x268ef5[_0x410c('0x49')]};return db[_0x410c('0x4e')][_0x410c('0x2f')](_0x45a5a1)[_0x410c('0x35')](function(_0x8393b1){_0x795c1f[_0x410c('0x2f')]=_0x8393b1;if(_0x5bfe4a[_0x410c('0x41')][_0x410c('0x4f')]){_0x268ef5['include']=[{'all':!![]}];}return db[_0x410c('0x4e')][_0x410c('0x50')](_0x268ef5);})['then'](function(_0x251131){_0x795c1f[_0x410c('0x51')]=_0x251131;return _0x795c1f;})[_0x410c('0x35')](respondWithFilteredResult(_0x56aed5,_0x268ef5))['catch'](handleError(_0x56aed5,null));};exports[_0x410c('0x52')]=function(_0xab5040,_0x26e4ac){var _0x3d45d5={'raw':!![],'where':{'id':_0xab5040[_0x410c('0x53')]['id']}},_0x1f5311={};_0x1f5311[_0x410c('0x3f')]=_[_0x410c('0x40')](db[_0x410c('0x4e')][_0x410c('0x54')]);_0x1f5311['query']=_[_0x410c('0x40')](_0xab5040[_0x410c('0x41')]);_0x1f5311[_0x410c('0x42')]=_[_0x410c('0x43')](_0x1f5311[_0x410c('0x3f')],_0x1f5311[_0x410c('0x41')]);_0x3d45d5[_0x410c('0x44')]=_['intersection'](_0x1f5311['model'],qs[_0x410c('0x45')](_0xab5040[_0x410c('0x41')][_0x410c('0x45')]));_0x3d45d5[_0x410c('0x44')]=_0x3d45d5[_0x410c('0x44')][_0x410c('0x55')]?_0x3d45d5['attributes']:_0x1f5311[_0x410c('0x3f')];if(_0xab5040[_0x410c('0x41')][_0x410c('0x4f')]){_0x3d45d5[_0x410c('0x56')]=[{'all':!![]}];}_0x3d45d5=_['merge']({},_0x3d45d5,_0xab5040[_0x410c('0x4d')]);return db[_0x410c('0x4e')]['find'](_0x3d45d5)[_0x410c('0x35')](handleEntityNotFound(_0x26e4ac,null))[_0x410c('0x35')](respondWithResult(_0x26e4ac,null))['catch'](handleError(_0x26e4ac,null));};exports[_0x410c('0x34')]=function(_0xbe7822,_0x1c22a6){if(_0xbe7822[_0x410c('0x57')]['id']){delete _0xbe7822['body']['id'];}return db[_0x410c('0x4e')]['find']({'where':{'id':_0xbe7822[_0x410c('0x53')]['id']}})[_0x410c('0x35')](handleEntityNotFound(_0x1c22a6,null))['then'](saveUpdates(_0xbe7822[_0x410c('0x57')],null))[_0x410c('0x35')](respondWithResult(_0x1c22a6,null))[_0x410c('0x28')](handleError(_0x1c22a6,null));};exports[_0x410c('0x36')]=function(_0x28acd4,_0x19a8ef){return db[_0x410c('0x4e')][_0x410c('0x58')]({'where':{'id':_0x28acd4['params']['id']}})[_0x410c('0x35')](handleEntityNotFound(_0x19a8ef,null))[_0x410c('0x35')](removeEntity(_0x19a8ef,null))[_0x410c('0x28')](handleError(_0x19a8ef,null));};exports['describe']=function(_0x1ed0a1,_0x4e5725){return db['FaxMessage']['describe']()[_0x410c('0x35')](respondWithResult(_0x4e5725,null))[_0x410c('0x28')](handleError(_0x4e5725,null));};var interaction_log=require('../../config/logger')(_0x410c('0x59'));exports[_0x410c('0x5a')]=function(_0x8f281,_0x5ab2a2,_0x441f39){var _0x5468ec={'agent':{},'channel':_0x410c('0x5b')};if(_0x8f281[_0x410c('0x57')]['id']){delete _0x8f281['body']['id'];}_0x8f281[_0x410c('0x57')][_0x410c('0x5c')]=!![];_0x8f281[_0x410c('0x57')][_0x410c('0x5d')]=moment()[_0x410c('0x5e')](_0x410c('0x5f'));_0x8f281[_0x410c('0x57')][_0x410c('0x60')]=_0x8f281[_0x410c('0x57')][_0x410c('0x60')]||_0x8f281[_0x410c('0x61')]['id'];_0x5468ec['agent']['id']=_0x8f281[_0x410c('0x57')][_0x410c('0x60')];return db[_0x410c('0x4e')][_0x410c('0x58')]({'where':{'id':_0x8f281[_0x410c('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5ab2a2,null))[_0x410c('0x35')](saveUpdates(_0x8f281[_0x410c('0x57')],null))['then'](function(_0x4a8a18){if(_0x4a8a18){_0x5468ec['message']=_0x4a8a18[_0x410c('0x62')]({'plain':!![]});return db[_0x410c('0x63')][_0x410c('0x58')]({'where':{'id':_0x4a8a18['FaxInteractionId']}});}return null;})[_0x410c('0x35')](handleEntityNotFound(_0x5ab2a2,null))[_0x410c('0x35')](function(_0x396e24){if(_0x396e24){return _0x396e24[_0x410c('0x34')]({'UserId':_0x8f281[_0x410c('0x57')][_0x410c('0x60')],'read1stAt':_[_0x410c('0x64')](_0x396e24[_0x410c('0x65')])?moment()['format'](_0x410c('0x5f')):undefined});}return null;})[_0x410c('0x35')](function(_0x7c9765){if(_0x7c9765){_0x5468ec['interaction']=_0x7c9765[_0x410c('0x62')]({'plain':!![]});interaction_log[_0x410c('0x26')](_0x410c('0x66'),_0x8f281[_0x410c('0x61')]['id'],_0x8f281[_0x410c('0x61')]['name'],_0x8f281[_0x410c('0x61')][_0x410c('0x67')],_0x5468ec[_0x410c('0x68')]['id'],_0x8f281[_0x410c('0x57')]?JSON[_0x410c('0x23')](_0x8f281[_0x410c('0x57')]):'null');return respondWithRpcPromise(_0x410c('0x69'),_0x410c('0x6a'),_0x5468ec);}return null;})['then'](function(_0x576fdf){var _0x338c09=_0x410c('0x6b')+_0x576fdf['message'][_0x410c('0x6c')];return db[_0x410c('0x6d')][_0x410c('0x41')](_0x338c09,{'type':db['Sequelize']['QueryTypes'][_0x410c('0x6e')],'raw':!![]})['then'](function(_0x571a76){return _0x571a76;});})['then'](function(_0x495e5c){if(_0x495e5c){_0x5468ec['message'][_0x410c('0x6f')]=_0x495e5c[0x0];if(!_0x8f281['body'][_0x410c('0x60')])return;return db[_0x410c('0x70')][_0x410c('0x58')]({'where':{'id':_0x8f281[_0x410c('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0x410c('0x39'),'fullname',_0x410c('0x71'),_0x410c('0x72')],'raw':!![]});}return null;})[_0x410c('0x35')](function(_0x4b8419){if(!_0x4b8419)return null;_0x5468ec[_0x410c('0x25')]['agent']=_0x4b8419;return _0x5468ec;})[_0x410c('0x35')](function(_0x1c92f8){if(_0x1c92f8){if(_0x8f281['body'][_0x410c('0x73')]){_0x5468ec[_0x410c('0x25')][_0x410c('0x74')]=util[_0x410c('0x5e')](_0x410c('0x75'),_0x8f281[_0x410c('0x61')]['name']);_0x5468ec['message']['channel']=_0x5468ec['channel'];_0x5468ec[_0x410c('0x25')][_0x410c('0x76')]=_0x5468ec['channel'];_0x5468ec[_0x410c('0x25')][_0x410c('0x77')]=_0x410c('0x5a');return respondWithRpcPromise(_0x410c('0x78'),_0x410c('0x78'),{'event':_0x410c('0x79'),'message':_0x5468ec[_0x410c('0x25')]},client9002)[_0x410c('0x35')](function(){return _0x5468ec;});}return _0x5468ec;}return null;})[_0x410c('0x35')](respondWithResult(_0x5ab2a2,null))[_0x410c('0x28')](handleError(_0x5ab2a2,null));};var interaction_log=require(_0x410c('0x7a'))(_0x410c('0x59'));exports[_0x410c('0x32')]=function(_0x468ce8,_0x50cc7a,_0x157e63){var _0x43712f={'agent':{},'channel':_0x410c('0x5b')};if(_0x468ce8[_0x410c('0x57')]['id']){delete _0x468ce8[_0x410c('0x57')]['id'];}_0x468ce8[_0x410c('0x57')]['UserId']=_0x468ce8[_0x410c('0x57')][_0x410c('0x60')]||_0x468ce8[_0x410c('0x61')]['id'];_0x43712f['agent']['id']=_0x468ce8['body']['UserId'];return db['FaxMessage'][_0x410c('0x58')]({'where':{'id':_0x468ce8[_0x410c('0x53')]['id'],'UserId':null}})[_0x410c('0x35')](handleEntityNotFound(_0x50cc7a,null))[_0x410c('0x35')](function(_0x5b40f8){if(_0x5b40f8){_0x43712f[_0x410c('0x25')]=_0x5b40f8[_0x410c('0x62')]({'plain':!![]});return db[_0x410c('0x63')][_0x410c('0x58')]({'where':{'id':_0x5b40f8[_0x410c('0x7b')]}});}return null;})['then'](handleEntityNotFound(_0x50cc7a,null))[_0x410c('0x35')](function(_0x5ac824){if(_0x5ac824){_0x43712f[_0x410c('0x68')]=_0x5ac824['get']({'plain':!![]});interaction_log[_0x410c('0x26')](_0x410c('0x7c'),_0x468ce8['user']['id'],_0x468ce8['user']['name'],_0x468ce8[_0x410c('0x61')][_0x410c('0x67')],_0x43712f[_0x410c('0x68')]['id'],_0x468ce8[_0x410c('0x57')]?JSON[_0x410c('0x23')](_0x468ce8['body']):'null');return respondWithRpcPromise(_0x410c('0x7d'),_0x410c('0x7e'),_0x43712f);}return null;})[_0x410c('0x35')](function(_0x32dad1){var _0x473feb=_0x410c('0x6b')+_0x32dad1['message'][_0x410c('0x6c')];return db['sequelize']['query'](_0x473feb,{'type':db[_0x410c('0x7f')][_0x410c('0x80')][_0x410c('0x6e')],'raw':!![]})[_0x410c('0x35')](function(_0x454cbe){return _0x454cbe;});})[_0x410c('0x35')](function(_0x3d2acb){if(_0x3d2acb){_0x43712f[_0x410c('0x25')][_0x410c('0x6f')]=_0x3d2acb[0x0];if(!_0x468ce8[_0x410c('0x57')][_0x410c('0x60')])return;return db['User'][_0x410c('0x58')]({'where':{'id':_0x468ce8[_0x410c('0x57')][_0x410c('0x60')],'role':_0x410c('0x81')},'attributes':['id',_0x410c('0x39'),'fullname',_0x410c('0x71'),'internal'],'raw':!![]});}return null;})[_0x410c('0x35')](function(_0x19be75){if(!_0x19be75)return null;_0x43712f[_0x410c('0x25')]['agent']=_0x19be75;return _0x43712f;})['then'](function(_0x558b3e){if(_0x558b3e){_0x558b3e[_0x410c('0x25')][_0x410c('0x74')]=util[_0x410c('0x5e')](_0x410c('0x75'),_0x468ce8['user']['name']);_0x558b3e[_0x410c('0x25')]['channel']=_0x43712f[_0x410c('0x82')];_0x558b3e[_0x410c('0x25')][_0x410c('0x76')]=_0x43712f[_0x410c('0x82')];_0x558b3e[_0x410c('0x25')][_0x410c('0x77')]='reject';respondWithRpcPromise(_0x410c('0x78'),'EventManager',{'event':_0x410c('0x83'),'message':_0x558b3e['message']},client9002);return _0x43712f;}return null;})[_0x410c('0x35')](respondWithResult(_0x50cc7a,null))['catch'](handleError(_0x50cc7a,null));};exports['create']=function(_0x20e98b,_0x17d4c0){var _0x409e2a;return db[_0x410c('0x4e')][_0x410c('0x84')](_0x20e98b['body'],{})['then'](function(_0x20ae14){_0x409e2a=_0x20ae14;return db['CmContact']['findOne']({'where':{'id':_0x409e2a[_0x410c('0x6c')]}});})[_0x410c('0x35')](function(_0x5090cb){if(_[_0x410c('0x64')](_0x5090cb)){return;}else{_0x409e2a['fax']=_0x5090cb[_0x410c('0x5b')];return db[_0x410c('0x85')]['findOne']({'where':{'id':_0x409e2a['AttachmentId']}});}})[_0x410c('0x35')](function(_0x381780){return respondWithRpcPromise(_0x410c('0x86'),_0x410c('0x86'),{'FaxAccountId':_['isNil'](_0x20e98b[_0x410c('0x57')])?undefined:_0x20e98b[_0x410c('0x57')]['FaxAccountId'],'path':_[_0x410c('0x64')](_0x381780)?undefined:util[_0x410c('0x5e')](_0x410c('0x87'),_0x381780['basename']),'fax':_[_0x410c('0x64')](_0x409e2a['fax'])?undefined:_0x409e2a[_0x410c('0x5b')],'AttachmentId':_0x409e2a[_0x410c('0x88')]},client9002);})[_0x410c('0x35')](respondWithResult(_0x17d4c0,0xc9))['catch'](handleError(_0x17d4c0,null));};exports['download']=function(_0x1008c2,_0x3a067d){var _0x598eb1=path[_0x410c('0x89')](config[_0x410c('0x8a')],'server',_0x410c('0x8b'),_0x410c('0x8c'));return db[_0x410c('0x4e')][_0x410c('0x58')]({'where':{'id':_0x1008c2[_0x410c('0x53')]['id']},'include':[{'model':db[_0x410c('0x85')],'as':_0x410c('0x85')}]})[_0x410c('0x35')](handleEntityNotFound(_0x3a067d,null))[_0x410c('0x35')](function(_0x104417){if(_0x104417){return _0x3a067d[_0x410c('0x8d')](path[_0x410c('0x89')](_0x598eb1,_0x104417['Attachment'][_0x410c('0x8e')]));}})['catch'](handleError(_0x3a067d,null));}; \ No newline at end of file +var _0x5b25=['AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','interface','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','root','files','attachments','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','end','stack','name','send','index','FaxMessage','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','show','params','keys','find','body','destroy','describe','fax-interactions','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null'];(function(_0x327615,_0x128547){var _0xd86a49=function(_0x1bba0d){while(--_0x1bba0d){_0x327615['push'](_0x327615['shift']());}};_0xd86a49(++_0x128547);}(_0x5b25,0xb3));var _0x55b2=function(_0x4535f9,_0xea7ab0){_0x4535f9=_0x4535f9-0x0;var _0x47694f=_0x5b25[_0x4535f9];return _0x47694f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x55b2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55b2('0x1'));var rp=require(_0x55b2('0x2'));var moment=require(_0x55b2('0x3'));var BPromise=require(_0x55b2('0x4'));var Mustache=require(_0x55b2('0x5'));var util=require(_0x55b2('0x6'));var path=require(_0x55b2('0x7'));var sox=require(_0x55b2('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55b2('0x9'));var _=require(_0x55b2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x55b2('0xb'));var deskjs=require(_0x55b2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x55b2('0xd'));var Papa=require(_0x55b2('0xe'));var Redis=require('ioredis');var authService=require(_0x55b2('0xf'));var qs=require(_0x55b2('0x10'));var as=require(_0x55b2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x55b2('0x12'))(_0x55b2('0x13'));var utils=require(_0x55b2('0x14'));var config=require(_0x55b2('0x15'));var licenseUtil=require(_0x55b2('0x16'));var db=require(_0x55b2('0x17'))['db'];config[_0x55b2('0x18')]=_[_0x55b2('0x19')](config[_0x55b2('0x18')],{'host':_0x55b2('0x1a'),'port':0x18eb});var socket=require(_0x55b2('0x1b'))(new Redis(config[_0x55b2('0x18')]));require(_0x55b2('0x1c'))[_0x55b2('0x1d')](socket);var jayson=require(_0x55b2('0x1e'));var client=jayson[_0x55b2('0x1f')][_0x55b2('0x20')]({'port':0x232c});var client9002=jayson[_0x55b2('0x1f')][_0x55b2('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3fab93,_0x1c237c,_0x4f36cc,_0x102a9d){return new BPromise(function(_0x1cb6f0,_0x364536){var _0x1f3672=_0x102a9d||client;return _0x1f3672['request'](_0x3fab93,_0x4f36cc)['then'](function(_0x903377){logger[_0x55b2('0x21')](_0x55b2('0x22'),_0x1c237c,'request\x20sent');logger[_0x55b2('0x23')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x1c237c,_0x55b2('0x24'),JSON['stringify'](_0x903377));if(_0x903377['error']){if(_0x903377[_0x55b2('0x25')][_0x55b2('0x26')]===0x1f4){logger[_0x55b2('0x25')](_0x55b2('0x22'),_0x1c237c,_0x903377[_0x55b2('0x25')][_0x55b2('0x27')]);return _0x364536(_0x903377[_0x55b2('0x25')]['message']);}logger['error'](_0x55b2('0x22'),_0x1c237c,_0x903377['error'][_0x55b2('0x27')]);return _0x1cb6f0(_0x903377[_0x55b2('0x25')][_0x55b2('0x27')]);}else{logger['info'](_0x55b2('0x22'),_0x1c237c,'request\x20sent');_0x1cb6f0(_0x903377[_0x55b2('0x28')][_0x55b2('0x27')]);}})[_0x55b2('0x29')](function(_0x34aec4){logger[_0x55b2('0x25')](_0x55b2('0x22'),_0x1c237c,_0x34aec4);_0x364536(_0x34aec4);});});}function respondWithStatusCode(_0x13110e,_0x512b01){_0x512b01=_0x512b01||0xcc;return function(_0x57a740){if(_0x57a740){return _0x13110e[_0x55b2('0x2a')](_0x512b01);}return _0x13110e[_0x55b2('0x2b')](_0x512b01)['end']();};}function respondWithResult(_0x19724f,_0x31fb68){_0x31fb68=_0x31fb68||0xc8;return function(_0x116752){if(_0x116752){return _0x19724f[_0x55b2('0x2b')](_0x31fb68)[_0x55b2('0x2c')](_0x116752);}};}function respondWithFilteredResult(_0x1f514a,_0x462cf1){return function(_0x20a2b4){if(_0x20a2b4){var _0x4145f6=typeof _0x462cf1['offset']==='undefined'&&typeof _0x462cf1['limit']==='undefined';var _0x143a29=_0x20a2b4[_0x55b2('0x2d')];var _0x3e86eb=_0x4145f6?0x0:_0x462cf1[_0x55b2('0x2e')];var _0x605934=_0x4145f6?_0x20a2b4[_0x55b2('0x2d')]:_0x462cf1[_0x55b2('0x2e')]+_0x462cf1[_0x55b2('0x2f')];var _0x2b180b;if(_0x605934>=_0x143a29){_0x605934=_0x143a29;_0x2b180b=0xc8;}else{_0x2b180b=0xce;}_0x1f514a[_0x55b2('0x2b')](_0x2b180b);return _0x1f514a[_0x55b2('0x30')](_0x55b2('0x31'),_0x3e86eb+'-'+_0x605934+'/'+_0x143a29)[_0x55b2('0x2c')](_0x20a2b4);}return null;};}function patchUpdates(_0x2731ae){return function(_0x40676e){try{jsonpatch[_0x55b2('0x32')](_0x40676e,_0x2731ae,!![]);}catch(_0x57abe5){return BPromise[_0x55b2('0x33')](_0x57abe5);}return _0x40676e['save']();};}function saveUpdates(_0x5d46a4,_0x3f50a5){return function(_0x232ace){if(_0x232ace){return _0x232ace[_0x55b2('0x34')](_0x5d46a4)[_0x55b2('0x35')](function(_0x33e7e8){return _0x33e7e8;});}return null;};}function removeEntity(_0x3ac4da,_0x44c960){return function(_0x1bee9f){if(_0x1bee9f){return _0x1bee9f['destroy']()[_0x55b2('0x35')](function(){_0x3ac4da[_0x55b2('0x2b')](0xcc)[_0x55b2('0x36')]();});}};}function handleEntityNotFound(_0x53bfc4,_0x259e86){return function(_0x346224){if(!_0x346224){_0x53bfc4['sendStatus'](0x194);}return _0x346224;};}function handleError(_0x3c91d,_0x3195f4){_0x3195f4=_0x3195f4||0x1f4;return function(_0x5ba3ea){logger['error'](_0x5ba3ea[_0x55b2('0x37')]);if(_0x5ba3ea[_0x55b2('0x38')]){delete _0x5ba3ea['name'];}_0x3c91d[_0x55b2('0x2b')](_0x3195f4)[_0x55b2('0x39')](_0x5ba3ea);};}exports[_0x55b2('0x3a')]=function(_0x2e5034,_0x4a5502){var _0x16b819={},_0x5dba0e={},_0x3d9dff={'count':0x0,'rows':[]};var _0x7835eb=_['map'](db[_0x55b2('0x3b')][_0x55b2('0x3c')],function(_0x1f1005){return{'name':_0x1f1005[_0x55b2('0x3d')],'type':_0x1f1005[_0x55b2('0x3e')]['key']};});_0x5dba0e[_0x55b2('0x3f')]=_[_0x55b2('0x40')](_0x7835eb,_0x55b2('0x38'));_0x5dba0e[_0x55b2('0x41')]=_['keys'](_0x2e5034[_0x55b2('0x41')]);_0x5dba0e[_0x55b2('0x42')]=_[_0x55b2('0x43')](_0x5dba0e[_0x55b2('0x3f')],_0x5dba0e[_0x55b2('0x41')]);_0x16b819[_0x55b2('0x44')]=_['intersection'](_0x5dba0e['model'],qs['fields'](_0x2e5034[_0x55b2('0x41')][_0x55b2('0x45')]));_0x16b819['attributes']=_0x16b819[_0x55b2('0x44')][_0x55b2('0x46')]?_0x16b819['attributes']:_0x5dba0e[_0x55b2('0x3f')];if(!_0x2e5034[_0x55b2('0x41')][_0x55b2('0x47')](_0x55b2('0x48'))){_0x16b819[_0x55b2('0x2f')]=qs['limit'](_0x2e5034['query'][_0x55b2('0x2f')]);_0x16b819[_0x55b2('0x2e')]=qs[_0x55b2('0x2e')](_0x2e5034[_0x55b2('0x41')][_0x55b2('0x2e')]);}_0x16b819[_0x55b2('0x49')]=qs['sort'](_0x2e5034[_0x55b2('0x41')][_0x55b2('0x4a')]);_0x16b819['where']=qs[_0x55b2('0x42')](_['pick'](_0x2e5034[_0x55b2('0x41')],_0x5dba0e['filters']),_0x7835eb);if(_0x2e5034[_0x55b2('0x41')]['filter']){_0x16b819[_0x55b2('0x4b')]=_[_0x55b2('0x4c')](_0x16b819['where'],{'$or':_['map'](_0x7835eb,function(_0xa699da){if(_0xa699da['type']!=='VIRTUAL'){var _0x4b889f={};_0x4b889f[_0xa699da[_0x55b2('0x38')]]={'$like':'%'+_0x2e5034['query'][_0x55b2('0x4d')]+'%'};return _0x4b889f;}})});}_0x16b819=_[_0x55b2('0x4c')]({},_0x16b819,_0x2e5034[_0x55b2('0x4e')]);var _0x3c34e5={'where':_0x16b819[_0x55b2('0x4b')]};return db[_0x55b2('0x3b')][_0x55b2('0x2d')](_0x3c34e5)[_0x55b2('0x35')](function(_0x24f876){_0x3d9dff[_0x55b2('0x2d')]=_0x24f876;if(_0x2e5034[_0x55b2('0x41')][_0x55b2('0x4f')]){_0x16b819[_0x55b2('0x50')]=[{'all':!![]}];}return db[_0x55b2('0x3b')]['findAll'](_0x16b819);})[_0x55b2('0x35')](function(_0x53aff5){_0x3d9dff['rows']=_0x53aff5;return _0x3d9dff;})[_0x55b2('0x35')](respondWithFilteredResult(_0x4a5502,_0x16b819))['catch'](handleError(_0x4a5502,null));};exports[_0x55b2('0x51')]=function(_0x519617,_0xdd2cec){var _0xcd02db={'raw':!![],'where':{'id':_0x519617[_0x55b2('0x52')]['id']}},_0x40cee1={};_0x40cee1[_0x55b2('0x3f')]=_[_0x55b2('0x53')](db[_0x55b2('0x3b')][_0x55b2('0x3c')]);_0x40cee1[_0x55b2('0x41')]=_[_0x55b2('0x53')](_0x519617['query']);_0x40cee1['filters']=_[_0x55b2('0x43')](_0x40cee1[_0x55b2('0x3f')],_0x40cee1[_0x55b2('0x41')]);_0xcd02db[_0x55b2('0x44')]=_[_0x55b2('0x43')](_0x40cee1[_0x55b2('0x3f')],qs[_0x55b2('0x45')](_0x519617[_0x55b2('0x41')][_0x55b2('0x45')]));_0xcd02db[_0x55b2('0x44')]=_0xcd02db[_0x55b2('0x44')][_0x55b2('0x46')]?_0xcd02db['attributes']:_0x40cee1[_0x55b2('0x3f')];if(_0x519617[_0x55b2('0x41')][_0x55b2('0x4f')]){_0xcd02db['include']=[{'all':!![]}];}_0xcd02db=_['merge']({},_0xcd02db,_0x519617[_0x55b2('0x4e')]);return db[_0x55b2('0x3b')][_0x55b2('0x54')](_0xcd02db)[_0x55b2('0x35')](handleEntityNotFound(_0xdd2cec,null))[_0x55b2('0x35')](respondWithResult(_0xdd2cec,null))[_0x55b2('0x29')](handleError(_0xdd2cec,null));};exports[_0x55b2('0x34')]=function(_0x323d15,_0x3248ac){if(_0x323d15[_0x55b2('0x55')]['id']){delete _0x323d15['body']['id'];}return db['FaxMessage'][_0x55b2('0x54')]({'where':{'id':_0x323d15[_0x55b2('0x52')]['id']}})[_0x55b2('0x35')](handleEntityNotFound(_0x3248ac,null))[_0x55b2('0x35')](saveUpdates(_0x323d15[_0x55b2('0x55')],null))[_0x55b2('0x35')](respondWithResult(_0x3248ac,null))[_0x55b2('0x29')](handleError(_0x3248ac,null));};exports[_0x55b2('0x56')]=function(_0x4100b8,_0x38640c){return db[_0x55b2('0x3b')][_0x55b2('0x54')]({'where':{'id':_0x4100b8['params']['id']}})[_0x55b2('0x35')](handleEntityNotFound(_0x38640c,null))[_0x55b2('0x35')](removeEntity(_0x38640c,null))[_0x55b2('0x29')](handleError(_0x38640c,null));};exports[_0x55b2('0x57')]=function(_0x30630d,_0x4bb20b){return db[_0x55b2('0x3b')]['describe']()[_0x55b2('0x35')](respondWithResult(_0x4bb20b,null))[_0x55b2('0x29')](handleError(_0x4bb20b,null));};var interaction_log=require('../../config/logger')(_0x55b2('0x58'));exports['accept']=function(_0x46a7b2,_0x34f855,_0x551fc7){var _0x35127c={'agent':{},'channel':_0x55b2('0x59')};if(_0x46a7b2[_0x55b2('0x55')]['id']){delete _0x46a7b2['body']['id'];}_0x46a7b2['body']['read']=!![];_0x46a7b2['body'][_0x55b2('0x5a')]=moment()['format'](_0x55b2('0x5b'));_0x46a7b2[_0x55b2('0x55')][_0x55b2('0x5c')]=_0x46a7b2[_0x55b2('0x55')][_0x55b2('0x5c')]||_0x46a7b2[_0x55b2('0x5d')]['id'];_0x35127c[_0x55b2('0x5e')]['id']=_0x46a7b2[_0x55b2('0x55')][_0x55b2('0x5c')];return db[_0x55b2('0x3b')][_0x55b2('0x54')]({'where':{'id':_0x46a7b2[_0x55b2('0x52')]['id'],'UserId':null}})[_0x55b2('0x35')](handleEntityNotFound(_0x34f855,null))[_0x55b2('0x35')](saveUpdates(_0x46a7b2['body'],null))[_0x55b2('0x35')](function(_0x4b2562){if(_0x4b2562){_0x35127c[_0x55b2('0x27')]=_0x4b2562[_0x55b2('0x5f')]({'plain':!![]});return db[_0x55b2('0x60')][_0x55b2('0x54')]({'where':{'id':_0x4b2562[_0x55b2('0x61')]}});}return null;})[_0x55b2('0x35')](handleEntityNotFound(_0x34f855,null))[_0x55b2('0x35')](function(_0x37c6ec){if(_0x37c6ec){return _0x37c6ec['update']({'UserId':_0x46a7b2[_0x55b2('0x55')][_0x55b2('0x5c')],'read1stAt':_[_0x55b2('0x62')](_0x37c6ec[_0x55b2('0x63')])?moment()[_0x55b2('0x64')](_0x55b2('0x5b')):undefined});}return null;})[_0x55b2('0x35')](function(_0x563e6a){if(_0x563e6a){_0x35127c['interaction']=_0x563e6a[_0x55b2('0x5f')]({'plain':!![]});interaction_log[_0x55b2('0x21')](_0x55b2('0x65'),_0x46a7b2[_0x55b2('0x5d')]['id'],_0x46a7b2[_0x55b2('0x5d')][_0x55b2('0x38')],_0x46a7b2['user']['role'],_0x35127c[_0x55b2('0x66')]['id'],_0x46a7b2['body']?JSON[_0x55b2('0x67')](_0x46a7b2['body']):_0x55b2('0x68'));return respondWithRpcPromise(_0x55b2('0x69'),_0x55b2('0x6a'),_0x35127c);}return null;})[_0x55b2('0x35')](function(_0xdf1f30){var _0xf37e63='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xdf1f30[_0x55b2('0x27')][_0x55b2('0x6b')];return db[_0x55b2('0x6c')][_0x55b2('0x41')](_0xf37e63,{'type':db['Sequelize'][_0x55b2('0x6d')][_0x55b2('0x6e')],'raw':!![]})[_0x55b2('0x35')](function(_0x438a8b){return _0x438a8b;});})[_0x55b2('0x35')](function(_0x143166){if(_0x143166){_0x35127c[_0x55b2('0x27')][_0x55b2('0x6f')]=_0x143166[0x0];if(!_0x46a7b2[_0x55b2('0x55')]['UserId'])return;return db[_0x55b2('0x70')][_0x55b2('0x54')]({'where':{'id':_0x46a7b2['body']['UserId'],'role':'agent'},'attributes':['id','name',_0x55b2('0x71'),_0x55b2('0x72'),_0x55b2('0x73')],'raw':!![]});}return null;})[_0x55b2('0x35')](function(_0x598ed1){if(!_0x598ed1)return null;_0x35127c[_0x55b2('0x27')][_0x55b2('0x5e')]=_0x598ed1;return _0x35127c;})['then'](function(_0x4de59c){if(_0x4de59c){if(_0x46a7b2[_0x55b2('0x55')][_0x55b2('0x74')]){_0x35127c[_0x55b2('0x27')]['interface']=util[_0x55b2('0x64')](_0x55b2('0x75'),_0x46a7b2[_0x55b2('0x5d')]['name']);_0x35127c[_0x55b2('0x27')][_0x55b2('0x76')]=_0x35127c[_0x55b2('0x76')];_0x35127c[_0x55b2('0x27')][_0x55b2('0x77')]=_0x35127c[_0x55b2('0x76')];_0x35127c[_0x55b2('0x27')][_0x55b2('0x78')]='accept';return respondWithRpcPromise(_0x55b2('0x79'),_0x55b2('0x79'),{'event':'acceptmessage','message':_0x35127c['message']},client9002)[_0x55b2('0x35')](function(){return _0x35127c;});}return _0x35127c;}return null;})[_0x55b2('0x35')](respondWithResult(_0x34f855,null))[_0x55b2('0x29')](handleError(_0x34f855,null));};var interaction_log=require(_0x55b2('0x12'))(_0x55b2('0x58'));exports[_0x55b2('0x33')]=function(_0x432879,_0x25a754,_0x1ce3dc){var _0x2c7b38={'agent':{},'channel':'fax'};if(_0x432879[_0x55b2('0x55')]['id']){delete _0x432879[_0x55b2('0x55')]['id'];}_0x432879['body'][_0x55b2('0x5c')]=_0x432879[_0x55b2('0x55')][_0x55b2('0x5c')]||_0x432879[_0x55b2('0x5d')]['id'];_0x2c7b38[_0x55b2('0x5e')]['id']=_0x432879[_0x55b2('0x55')][_0x55b2('0x5c')];return db['FaxMessage'][_0x55b2('0x54')]({'where':{'id':_0x432879['params']['id'],'UserId':null}})[_0x55b2('0x35')](handleEntityNotFound(_0x25a754,null))[_0x55b2('0x35')](function(_0x54822c){if(_0x54822c){_0x2c7b38[_0x55b2('0x27')]=_0x54822c[_0x55b2('0x5f')]({'plain':!![]});return db[_0x55b2('0x60')][_0x55b2('0x54')]({'where':{'id':_0x54822c['FaxInteractionId']}});}return null;})[_0x55b2('0x35')](handleEntityNotFound(_0x25a754,null))['then'](function(_0x578d8a){if(_0x578d8a){_0x2c7b38[_0x55b2('0x66')]=_0x578d8a['get']({'plain':!![]});interaction_log[_0x55b2('0x21')](_0x55b2('0x7a'),_0x432879['user']['id'],_0x432879[_0x55b2('0x5d')][_0x55b2('0x38')],_0x432879[_0x55b2('0x5d')][_0x55b2('0x7b')],_0x2c7b38['interaction']['id'],_0x432879[_0x55b2('0x55')]?JSON[_0x55b2('0x67')](_0x432879[_0x55b2('0x55')]):_0x55b2('0x68'));return respondWithRpcPromise(_0x55b2('0x7c'),_0x55b2('0x7d'),_0x2c7b38);}return null;})[_0x55b2('0x35')](function(_0x14d52f){var _0x2f79be=_0x55b2('0x7e')+_0x14d52f[_0x55b2('0x27')][_0x55b2('0x6b')];return db[_0x55b2('0x6c')]['query'](_0x2f79be,{'type':db[_0x55b2('0x7f')]['QueryTypes']['SELECT'],'raw':!![]})[_0x55b2('0x35')](function(_0x348bb6){return _0x348bb6;});})[_0x55b2('0x35')](function(_0x3486a0){if(_0x3486a0){_0x2c7b38[_0x55b2('0x27')][_0x55b2('0x6f')]=_0x3486a0[0x0];if(!_0x432879['body'][_0x55b2('0x5c')])return;return db[_0x55b2('0x70')][_0x55b2('0x54')]({'where':{'id':_0x432879[_0x55b2('0x55')][_0x55b2('0x5c')],'role':_0x55b2('0x5e')},'attributes':['id',_0x55b2('0x38'),_0x55b2('0x71'),_0x55b2('0x72'),_0x55b2('0x73')],'raw':!![]});}return null;})[_0x55b2('0x35')](function(_0x3a3a1c){if(!_0x3a3a1c)return null;_0x2c7b38[_0x55b2('0x27')]['agent']=_0x3a3a1c;return _0x2c7b38;})[_0x55b2('0x35')](function(_0x273160){if(_0x273160){_0x273160[_0x55b2('0x27')][_0x55b2('0x80')]=util[_0x55b2('0x64')](_0x55b2('0x75'),_0x432879[_0x55b2('0x5d')]['name']);_0x273160[_0x55b2('0x27')]['channel']=_0x2c7b38[_0x55b2('0x76')];_0x273160[_0x55b2('0x27')][_0x55b2('0x77')]=_0x2c7b38[_0x55b2('0x76')];_0x273160[_0x55b2('0x27')][_0x55b2('0x78')]='reject';respondWithRpcPromise(_0x55b2('0x79'),_0x55b2('0x79'),{'event':_0x55b2('0x81'),'message':_0x273160['message']},client9002);return _0x2c7b38;}return null;})['then'](respondWithResult(_0x25a754,null))[_0x55b2('0x29')](handleError(_0x25a754,null));};exports[_0x55b2('0x82')]=function(_0x352d80,_0x358ee1){var _0x565bc1;return db['FaxMessage']['create'](_0x352d80[_0x55b2('0x55')],{})['then'](function(_0x59dacd){_0x565bc1=_0x59dacd;return db[_0x55b2('0x83')]['findOne']({'where':{'id':_0x565bc1[_0x55b2('0x6b')]}});})[_0x55b2('0x35')](function(_0x5a17fc){if(_[_0x55b2('0x62')](_0x5a17fc)){return;}else{_0x565bc1['fax']=_0x5a17fc[_0x55b2('0x59')];return db[_0x55b2('0x84')][_0x55b2('0x85')]({'where':{'id':_0x565bc1[_0x55b2('0x86')]}});}})['then'](function(_0x340383){return respondWithRpcPromise(_0x55b2('0x87'),'SendFax',{'FaxAccountId':_[_0x55b2('0x62')](_0x352d80[_0x55b2('0x55')])?undefined:_0x352d80[_0x55b2('0x55')]['FaxAccountId'],'path':_[_0x55b2('0x62')](_0x340383)?undefined:util['format'](_0x55b2('0x88'),_0x340383[_0x55b2('0x89')]),'fax':_[_0x55b2('0x62')](_0x565bc1[_0x55b2('0x59')])?undefined:_0x565bc1['fax'],'AttachmentId':_0x565bc1[_0x55b2('0x86')]},client9002);})[_0x55b2('0x35')](respondWithResult(_0x358ee1,0xc9))['catch'](handleError(_0x358ee1,null));};exports['download']=function(_0x12f114,_0x309042){var _0x246308=path[_0x55b2('0x8a')](config[_0x55b2('0x8b')],'server',_0x55b2('0x8c'),_0x55b2('0x8d'));return db['FaxMessage'][_0x55b2('0x54')]({'where':{'id':_0x12f114[_0x55b2('0x52')]['id']},'include':[{'model':db[_0x55b2('0x84')],'as':_0x55b2('0x84')}]})[_0x55b2('0x35')](handleEntityNotFound(_0x309042,null))['then'](function(_0x3e52f){if(_0x3e52f){return _0x309042['download'](path[_0x55b2('0x8a')](_0x246308,_0x3e52f['Attachment'][_0x55b2('0x89')]));}})[_0x55b2('0x29')](handleError(_0x309042,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 5cee931..017d8f5 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 _0xa647=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x342359,_0x159fcc){var _0x22d408=function(_0x2bddb6){while(--_0x2bddb6){_0x342359['push'](_0x342359['shift']());}};_0x22d408(++_0x159fcc);}(_0xa647,0x81));var _0x7a64=function(_0x304353,_0x7bd7b3){_0x304353=_0x304353-0x0;var _0x11365b=_0xa647[_0x304353];return _0x11365b;};'use strict';var EventEmitter=require(_0x7a64('0x0'));var FaxMessage=require(_0x7a64('0x1'))['db'][_0x7a64('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7a64('0x3')](0x0);var events={'afterCreate':_0x7a64('0x4'),'afterUpdate':_0x7a64('0x5'),'afterDestroy':_0x7a64('0x6')};function emitEvent(_0x30b8b7){return function(_0x1c7a04,_0x2e1029,_0x46b8b0){FaxMessageEvents[_0x7a64('0x7')](_0x30b8b7+':'+_0x1c7a04['id'],_0x1c7a04);FaxMessageEvents['emit'](_0x30b8b7,_0x1c7a04);_0x46b8b0(null);};}for(var e in events){if(events[_0x7a64('0x8')](e)){var event=events[e];FaxMessage[_0x7a64('0x9')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xf417=['FaxMessage','setMaxListeners','update','hasOwnProperty','exports','../../mysqldb'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xf417,0x8f));var _0x7f41=function(_0x516ac4,_0x8b2375){_0x516ac4=_0x516ac4-0x0;var _0x35c675=_0xf417[_0x516ac4];return _0x35c675;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x7f41('0x0'))['db'][_0x7f41('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7f41('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7f41('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4c7081){return function(_0x2b7d4c,_0x5170ec,_0x51b0cb){FaxMessageEvents['emit'](_0x4c7081+':'+_0x2b7d4c['id'],_0x2b7d4c);FaxMessageEvents['emit'](_0x4c7081,_0x2b7d4c);_0x51b0cb(null);};}for(var e in events){if(events[_0x7f41('0x4')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x7f41('0x5')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index c514f34..bb7233d 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 _0x3786=['define','fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x618b26,_0x4b6914){var _0x1565bd=function(_0x37a132){while(--_0x37a132){_0x618b26['push'](_0x618b26['shift']());}};_0x1565bd(++_0x4b6914);}(_0x3786,0x17f));var _0x6378=function(_0x3464bb,_0x4f8459){_0x3464bb=_0x3464bb-0x0;var _0x3b9e2a=_0x3786[_0x3464bb];return _0x3b9e2a;};'use strict';var _=require(_0x6378('0x0'));var util=require(_0x6378('0x1'));var logger=require('../../config/logger')(_0x6378('0x2'));var moment=require(_0x6378('0x3'));var BPromise=require(_0x6378('0x4'));var rp=require(_0x6378('0x5'));var fs=require('fs');var path=require(_0x6378('0x6'));var rimraf=require('rimraf');var config=require(_0x6378('0x7'));var attributes=require('./faxMessage.attributes');module[_0x6378('0x8')]=function(_0x241e60,_0x3170b2){return _0x241e60[_0x6378('0x9')]('FaxMessage',attributes,{'tableName':_0x6378('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x6378('0xb')],'type':_0x6378('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c8dde,_0x2763e5,_0x7592a5){var _0x3773c4=_0x241e60[_0x6378('0xd')];var _0x347bac=_0x1c8dde[_0x6378('0xe')]({'plain':!![]});if(_0x347bac[_0x6378('0xf')]['toLowerCase']()==='in'||_0x347bac[_0x6378('0xf')][_0x6378('0x10')]()===_0x6378('0x11')&&!_0x347bac['secret']&&!_[_0x6378('0x12')](_0x347bac[_0x6378('0x13')])){_0x3773c4['FaxInteraction']['findOne']({'where':{'id':_0x347bac[_0x6378('0x14')]}})[_0x6378('0x15')](function(_0x1efa50){if(_0x1efa50){_0x1efa50[_0x6378('0x16')]({'lastMsgAt':_0x347bac[_0x6378('0x17')],'lastMsgDirection':_0x347bac[_0x6378('0xf')]['toLowerCase']()});}})[_0x6378('0x18')](function(_0x8e4bcd){console[_0x6378('0x19')](_0x8e4bcd);});}_0x7592a5();}},'charset':_0x6378('0x1a'),'collate':_0x6378('0x1b')});}; \ No newline at end of file +var _0x6ba7=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','FaxInteraction','findOne','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util'];(function(_0x4b87ef,_0x1aa1ab){var _0x287e5e=function(_0x66f401){while(--_0x66f401){_0x4b87ef['push'](_0x4b87ef['shift']());}};_0x287e5e(++_0x1aa1ab);}(_0x6ba7,0x10c));var _0x76ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6ba7[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x76ba('0x0'));var util=require(_0x76ba('0x1'));var logger=require(_0x76ba('0x2'))(_0x76ba('0x3'));var moment=require(_0x76ba('0x4'));var BPromise=require(_0x76ba('0x5'));var rp=require(_0x76ba('0x6'));var fs=require('fs');var path=require(_0x76ba('0x7'));var rimraf=require(_0x76ba('0x8'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0x76ba('0x9')]=function(_0xfbb5a9,_0x142cb5){return _0xfbb5a9['define'](_0x76ba('0xa'),attributes,{'tableName':_0x76ba('0xb'),'paranoid':![],'indexes':[{'name':_0x76ba('0xc'),'fields':['body'],'type':_0x76ba('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x44d83f,_0x28d209,_0x4b80f5){var _0x4ab733=_0xfbb5a9[_0x76ba('0xe')];var _0xcd0c1a=_0x44d83f[_0x76ba('0xf')]({'plain':!![]});if(_0xcd0c1a[_0x76ba('0x10')][_0x76ba('0x11')]()==='in'||_0xcd0c1a[_0x76ba('0x10')]['toLowerCase']()===_0x76ba('0x12')&&!_0xcd0c1a[_0x76ba('0x13')]&&!_[_0x76ba('0x14')](_0xcd0c1a['UserId'])){_0x4ab733[_0x76ba('0x15')][_0x76ba('0x16')]({'where':{'id':_0xcd0c1a['FaxInteractionId']}})['then'](function(_0x537ef5){if(_0x537ef5){_0x537ef5['update']({'lastMsgAt':_0xcd0c1a[_0x76ba('0x17')],'lastMsgDirection':_0xcd0c1a[_0x76ba('0x10')]['toLowerCase']()});}})[_0x76ba('0x18')](function(_0x10cf25){console[_0x76ba('0x19')](_0x10cf25);});}_0x4b80f5();}},'charset':'utf8mb4','collate':_0x76ba('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index a81cf9c..20c5f88 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 _0x6f0d=['../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4be8ba,_0x5d10ba){var _0x1af822=function(_0x40ed8a){while(--_0x40ed8a){_0x4be8ba['push'](_0x4be8ba['shift']());}};_0x1af822(++_0x5d10ba);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xfc5cfd,_0x1d10bb){_0xfc5cfd=_0xfc5cfd-0x0;var _0x2dcfba=_0x6f0d[_0xfc5cfd];return _0x2dcfba;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});config[_0xd6f0('0xa')]=_[_0xd6f0('0xb')](config[_0xd6f0('0xa')],{'host':_0xd6f0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd6f0('0xd'))[_0xd6f0('0xe')](socket);function respondWithRpcPromise(_0x2854cd,_0x382a2e,_0x225dcf){return new BPromise(function(_0x4db64a,_0x136eee){return client[_0xd6f0('0xf')](_0x2854cd,_0x225dcf)[_0xd6f0('0x10')](function(_0x44bba6){logger['info'](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));logger[_0xd6f0('0x13')](_0xd6f0('0x14'),_0x382a2e,_0xd6f0('0x12'),JSON[_0xd6f0('0x15')](_0x44bba6));if(_0x44bba6[_0xd6f0('0x16')]){if(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x17')]===0x1f4){logger['error'](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')]['message']);return _0x136eee(_0x44bba6[_0xd6f0('0x16')]['message']);}logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);return _0x4db64a(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);}else{logger[_0xd6f0('0x19')](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));_0x4db64a(_0x44bba6[_0xd6f0('0x1a')][_0xd6f0('0x18')]);}})[_0xd6f0('0x1b')](function(_0x327231){logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x327231);_0x136eee(_0x327231);});});}exports[_0xd6f0('0x1c')]=function(_0x5cd367){var _0x48ac38=this;return new Promise(function(_0x3939aa,_0x264104){return db[_0xd6f0('0x1d')]['create'](_0x5cd367[_0xd6f0('0x1e')],{'raw':_0x5cd367[_0xd6f0('0x1f')]?_0x5cd367['options'][_0xd6f0('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1ee584){logger[_0xd6f0('0x19')]('CreateFaxMessage',_0x5cd367);logger[_0xd6f0('0x13')](_0xd6f0('0x1c'),_0x5cd367,JSON['stringify'](_0x1ee584));_0x3939aa(_0x1ee584);})[_0xd6f0('0x1b')](function(_0x402070){logger[_0xd6f0('0x16')]('CreateFaxMessage',_0x402070[_0xd6f0('0x18')],_0x5cd367);_0x264104(_0x48ac38[_0xd6f0('0x16')](0x1f4,_0x402070['message']));});});};exports[_0xd6f0('0x21')]=function(_0x551be8){var _0x2042d5=this;return new Promise(function(_0x3fb5c3,_0x1630dc){return db[_0xd6f0('0x1d')][_0xd6f0('0x22')](_0x551be8[_0xd6f0('0x1e')],{'raw':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['where']||null:null,'attributes':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x23')]||null:null,'limit':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x24')]||null:null})[_0xd6f0('0x10')](function(_0x3151f8){logger[_0xd6f0('0x19')](_0xd6f0('0x21'),_0x551be8);logger[_0xd6f0('0x13')](_0xd6f0('0x21'),_0x551be8,JSON[_0xd6f0('0x15')](_0x3151f8));_0x3fb5c3(_0x3151f8);})[_0xd6f0('0x1b')](function(_0xbdd223){logger[_0xd6f0('0x16')](_0xd6f0('0x21'),_0xbdd223[_0xd6f0('0x18')],_0x551be8);_0x1630dc(_0x2042d5[_0xd6f0('0x16')](0x1f4,_0xbdd223[_0xd6f0('0x18')]));});});}; \ No newline at end of file +var _0xd2ea=['../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','FaxMessage','create','body','options','raw','CreateFaxMessage','stringify','catch','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1e075b,_0x2caadc){var _0x537ed5=function(_0x4c5f54){while(--_0x4c5f54){_0x1e075b['push'](_0x1e075b['shift']());}};_0x537ed5(++_0x2caadc);}(_0xd2ea,0x15f));var _0xad2e=function(_0xa6c82d,_0x2ef85e){_0xa6c82d=_0xa6c82d-0x0;var _0x22f0f6=_0xd2ea[_0xa6c82d];return _0x22f0f6;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});config[_0xad2e('0xc')]=_[_0xad2e('0xd')](config[_0xad2e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xad2e('0xe'))(new Redis(config[_0xad2e('0xc')]));require('./faxMessage.socket')[_0xad2e('0xf')](socket);function respondWithRpcPromise(_0x51f575,_0x430443,_0x415a41){return new BPromise(function(_0x9879f2,_0x24c5da){return client['request'](_0x51f575,_0x415a41)[_0xad2e('0x10')](function(_0x5707a5){logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));logger[_0xad2e('0x14')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x430443,_0xad2e('0x13'),JSON['stringify'](_0x5707a5));if(_0x5707a5[_0xad2e('0x15')]){if(_0x5707a5['error']['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x24c5da(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}logger[_0xad2e('0x15')](_0xad2e('0x12'),_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x9879f2(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}else{logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));_0x9879f2(_0x5707a5[_0xad2e('0x17')][_0xad2e('0x16')]);}})['catch'](function(_0x245617){logger[_0xad2e('0x15')]('FaxMessage,\x20%s,\x20%s',_0x430443,_0x245617);_0x24c5da(_0x245617);});});}exports['CreateFaxMessage']=function(_0x48d8b5){var _0x4a4b2d=this;return new Promise(function(_0x18c38d,_0x293adc){return db[_0xad2e('0x18')][_0xad2e('0x19')](_0x48d8b5[_0xad2e('0x1a')],{'raw':_0x48d8b5[_0xad2e('0x1b')]?_0x48d8b5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![]})[_0xad2e('0x10')](function(_0x154d54){logger[_0xad2e('0x11')](_0xad2e('0x1d'),_0x48d8b5);logger[_0xad2e('0x14')](_0xad2e('0x1d'),_0x48d8b5,JSON[_0xad2e('0x1e')](_0x154d54));_0x18c38d(_0x154d54);})[_0xad2e('0x1f')](function(_0x59630b){logger[_0xad2e('0x15')](_0xad2e('0x1d'),_0x59630b[_0xad2e('0x16')],_0x48d8b5);_0x293adc(_0x4a4b2d[_0xad2e('0x15')](0x1f4,_0x59630b[_0xad2e('0x16')]));});});};exports[_0xad2e('0x20')]=function(_0x1161d5){var _0x175055=this;return new Promise(function(_0xfd90a4,_0x50d446){return db[_0xad2e('0x18')]['update'](_0x1161d5[_0xad2e('0x1a')],{'raw':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x21')]||null:null,'attributes':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x22')]||null:null,'limit':_0x1161d5['options']?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x23')]||null:null})[_0xad2e('0x10')](function(_0x4379f4){logger[_0xad2e('0x11')](_0xad2e('0x20'),_0x1161d5);logger[_0xad2e('0x14')](_0xad2e('0x20'),_0x1161d5,JSON[_0xad2e('0x1e')](_0x4379f4));_0xfd90a4(_0x4379f4);})[_0xad2e('0x1f')](function(_0xcc4c66){logger['error'](_0xad2e('0x20'),_0xcc4c66['message'],_0x1161d5);_0x50d446(_0x175055[_0xad2e('0x15')](0x1f4,_0xcc4c66[_0xad2e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 472d640..31c6e6b 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 _0x0d50=['faxMessage:','./faxMessage.events','save','update','emit','removeListener'];(function(_0x33b4b0,_0x567d6f){var _0x5b49d4=function(_0x1ad890){while(--_0x1ad890){_0x33b4b0['push'](_0x33b4b0['shift']());}};_0x5b49d4(++_0x567d6f);}(_0x0d50,0x1ed));var _0x00d5=function(_0x4eab11,_0x420bfb){_0x4eab11=_0x4eab11-0x0;var _0x417a63=_0x0d50[_0x4eab11];return _0x417a63;};'use strict';var FaxMessageEvents=require(_0x00d5('0x0'));var events=[_0x00d5('0x1'),'remove',_0x00d5('0x2')];function createListener(_0x1f444a,_0x3da281){return function(_0x489edd){_0x3da281[_0x00d5('0x3')](_0x1f444a,_0x489edd);};}function removeListener(_0x91faa,_0x4e1b85){return function(){FaxMessageEvents[_0x00d5('0x4')](_0x91faa,_0x4e1b85);};}exports['register']=function(_0x42c818){for(var _0x4e9436=0x0,_0x379618=events['length'];_0x4e9436<_0x379618;_0x4e9436++){var _0x53d769=events[_0x4e9436];var _0x40507f=createListener(_0x00d5('0x5')+_0x53d769,_0x42c818);FaxMessageEvents['on'](_0x53d769,_0x40507f);}}; \ No newline at end of file +var _0xe280=['faxMessage:','./faxMessage.events','remove','update','emit','removeListener','length'];(function(_0x17d703,_0x2266eb){var _0x4fd652=function(_0x4147ad){while(--_0x4147ad){_0x17d703['push'](_0x17d703['shift']());}};_0x4fd652(++_0x2266eb);}(_0xe280,0x158));var _0x0e28=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xe280[_0x3740fe];return _0x55492b;};'use strict';var FaxMessageEvents=require(_0x0e28('0x0'));var events=['save',_0x0e28('0x1'),_0x0e28('0x2')];function createListener(_0x2cfd18,_0x1ad908){return function(_0x16b8b9){_0x1ad908[_0x0e28('0x3')](_0x2cfd18,_0x16b8b9);};}function removeListener(_0x2b02c0,_0x48e871){return function(){FaxMessageEvents[_0x0e28('0x4')](_0x2b02c0,_0x48e871);};}exports['register']=function(_0x10d320){for(var _0xfb2dd8=0x0,_0x5d0cb6=events[_0x0e28('0x5')];_0xfb2dd8<_0x5d0cb6;_0xfb2dd8++){var _0x43bfe9=events[_0xfb2dd8];var _0x481ca1=createListener(_0x0e28('0x6')+_0x43bfe9,_0x10d320);FaxMessageEvents['on'](_0x43bfe9,_0x481ca1);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index c61a424..d7994b2 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf72b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','path','express'];(function(_0x130af1,_0x5ec669){var _0x51e977=function(_0x20a5f9){while(--_0x20a5f9){_0x130af1['push'](_0x130af1['shift']());}};_0x51e977(++_0x5ec669);}(_0xf72b,0x1d9));var _0xbf72=function(_0x42e97f,_0x9fe760){_0x42e97f=_0x42e97f-0x0;var _0x3a8d6b=_0xf72b[_0x42e97f];return _0x3a8d6b;};'use strict';var multer=require(_0xbf72('0x0'));var util=require('util');var path=require(_0xbf72('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf72('0x2'));var router=express[_0xbf72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf72('0x4'));var interaction=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var controller=require(_0xbf72('0x7'));router[_0xbf72('0x8')]('/',auth[_0xbf72('0x9')](),controller['index']);router[_0xbf72('0x8')](_0xbf72('0xa'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xb')]);router[_0xbf72('0x8')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0xd')]);router['get'](_0xbf72('0xe'),auth[_0xbf72('0x9')](),controller['download']);router[_0xbf72('0xf')]('/',auth[_0xbf72('0x9')](),interaction[_0xbf72('0x10')](_0xbf72('0x11'),_0xbf72('0x12')),controller[_0xbf72('0x13')]);router[_0xbf72('0x14')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0x15')]);router[_0xbf72('0x14')](_0xbf72('0x16'),auth['isAuthenticated'](),controller[_0xbf72('0x17')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xbf72('0x18')]);router[_0xbf72('0x19')](_0xbf72('0xc'),auth[_0xbf72('0x9')](),controller[_0xbf72('0x1a')]);module[_0xbf72('0x1b')]=router; \ No newline at end of file +var _0xbf6e=['accept','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept'];(function(_0x117a06,_0x3860e4){var _0x53bfc2=function(_0xe0458c){while(--_0xe0458c){_0x117a06['push'](_0x117a06['shift']());}};_0x53bfc2(++_0x3860e4);}(_0xbf6e,0x149));var _0xebf6=function(_0x2a5755,_0x17f587){_0x2a5755=_0x2a5755-0x0;var _0x1700da=_0xbf6e[_0x2a5755];return _0x1700da;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebf6('0x0'));var timeout=require(_0xebf6('0x1'));var express=require(_0xebf6('0x2'));var router=express[_0xebf6('0x3')]();var fs_extra=require(_0xebf6('0x4'));var auth=require(_0xebf6('0x5'));var interaction=require(_0xebf6('0x6'));var config=require('../../config/environment');var controller=require(_0xebf6('0x7'));router[_0xebf6('0x8')]('/',auth[_0xebf6('0x9')](),controller[_0xebf6('0xa')]);router[_0xebf6('0x8')](_0xebf6('0xb'),auth[_0xebf6('0x9')](),controller['describe']);router[_0xebf6('0x8')](_0xebf6('0xc'),auth[_0xebf6('0x9')](),controller['show']);router[_0xebf6('0x8')](_0xebf6('0xd'),auth['isAuthenticated'](),controller[_0xebf6('0xe')]);router[_0xebf6('0xf')]('/',auth[_0xebf6('0x9')](),interaction[_0xebf6('0x10')](_0xebf6('0x11'),_0xebf6('0x12')),controller['create']);router[_0xebf6('0x13')](_0xebf6('0xc'),auth['isAuthenticated'](),controller[_0xebf6('0x14')]);router[_0xebf6('0x13')](_0xebf6('0x15'),auth[_0xebf6('0x9')](),controller[_0xebf6('0x16')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xebf6('0x17')]);router[_0xebf6('0x18')]('/:id',auth[_0xebf6('0x9')](),controller[_0xebf6('0x19')]);module[_0xebf6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 701308a..20b7871 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 _0xe112=['ENUM','rrmemory','sequelize','exports','name','INTEGER'];(function(_0x5822fc,_0x3c98c5){var _0x1186b6=function(_0x4b3a58){while(--_0x4b3a58){_0x5822fc['push'](_0x5822fc['shift']());}};_0x1186b6(++_0x3c98c5);}(_0xe112,0x1f4));var _0x2e11=function(_0x54d305,_0x406a76){_0x54d305=_0x54d305-0x0;var _0x18d362=_0xe112[_0x54d305];return _0x18d362;};'use strict';var Sequelize=require(_0x2e11('0x0'));module[_0x2e11('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2e11('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2e11('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2e11('0x4')](_0x2e11('0x5'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2e11('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x724b=['INTEGER','sequelize','exports','STRING','ENUM','rrmemory','roundrobin'];(function(_0x18a26,_0x3bdffb){var _0x595e67=function(_0xea85d6){while(--_0xea85d6){_0x18a26['push'](_0x18a26['shift']());}};_0x595e67(++_0x3bdffb);}(_0x724b,0xb0));var _0xb724=function(_0x1f45b9,_0x8a8b08){_0x1f45b9=_0x1f45b9-0x0;var _0xf31ea3=_0x724b[_0x1f45b9];return _0xf31ea3;};'use strict';var Sequelize=require(_0xb724('0x0'));module[_0xb724('0x1')]={'name':{'type':Sequelize[_0xb724('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb724('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb724('0x3')](_0xb724('0x4'),'beepall',_0xb724('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xb724('0x6')],'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 bebdada..e7f6f62 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 _0xdb8b=['count','set','Content-Range','update','then','get','FaxQueues','UserProfileResource','destroy','sendStatus','error','stack','name','send','FaxQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','fields','attributes','includeAll','merge','options','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserFaxQueue','length','hasOwnProperty','order','sort','pick','filter','map','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','SIP','Team','nolimit','getTeams','addTeams','ids','User','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','sequelize','toString','SELECT','every','TeamId','includes','all','compact','value','removeAgents','userFaxQueue:remove','addAgents','omit','spread','getAgents','util','lodash','squel','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','status','end','json','offset','limit'];(function(_0x4af961,_0x197ee9){var _0x5b84dd=function(_0x3d01aa){while(--_0x3d01aa){_0x4af961['push'](_0x4af961['shift']());}};_0x5b84dd(++_0x197ee9);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x2cac0d,_0x500c7b){_0x2cac0d=_0x2cac0d-0x0;var _0x378bc0=_0xdb8b[_0x2cac0d];return _0x378bc0;};'use strict';var BPromise=require('bluebird');var util=require(_0xbdb8('0x0'));var _=require(_0xbdb8('0x1'));var squel=require(_0xbdb8('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xbdb8('0x3'))('api');var config=require(_0xbdb8('0x4'));var db=require(_0xbdb8('0x5'))['db'];config[_0xbdb8('0x6')]=_[_0xbdb8('0x7')](config['redis'],{'host':_0xbdb8('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbdb8('0x6')]));require(_0xbdb8('0x9'))[_0xbdb8('0xa')](socket);function respondWithStatusCode(_0x227caa,_0x2525e2){_0x2525e2=_0x2525e2||0xcc;return function(_0x8b1e35){if(_0x8b1e35){return _0x227caa['sendStatus'](_0x2525e2);}return _0x227caa[_0xbdb8('0xb')](_0x2525e2)[_0xbdb8('0xc')]();};}function respondWithResult(_0x3cc8d1,_0x682657){_0x682657=_0x682657||0xc8;return function(_0x2fba54){if(_0x2fba54){return _0x3cc8d1[_0xbdb8('0xb')](_0x682657)[_0xbdb8('0xd')](_0x2fba54);}};}function respondWithFilteredResult(_0x55f17e,_0x58e22a){return function(_0x179863){if(_0x179863){var _0x5e0107=typeof _0x58e22a[_0xbdb8('0xe')]==='undefined'&&typeof _0x58e22a[_0xbdb8('0xf')]==='undefined';var _0xc13639=_0x179863[_0xbdb8('0x10')];var _0x1e8888=_0x5e0107?0x0:_0x58e22a[_0xbdb8('0xe')];var _0x20984d=_0x5e0107?_0x179863[_0xbdb8('0x10')]:_0x58e22a[_0xbdb8('0xe')]+_0x58e22a[_0xbdb8('0xf')];var _0x149568;if(_0x20984d>=_0xc13639){_0x20984d=_0xc13639;_0x149568=0xc8;}else{_0x149568=0xce;}_0x55f17e[_0xbdb8('0xb')](_0x149568);return _0x55f17e[_0xbdb8('0x11')](_0xbdb8('0x12'),_0x1e8888+'-'+_0x20984d+'/'+_0xc13639)[_0xbdb8('0xd')](_0x179863);}return null;};}function saveUpdates(_0x5438df){return function(_0x4dff58){if(_0x4dff58){return _0x4dff58[_0xbdb8('0x13')](_0x5438df)[_0xbdb8('0x14')](function(_0x5e5330){return _0x5e5330;});}return null;};}function removeEntity(_0x50e009){return function(_0x133800){if(_0x133800){return _0x133800['destroy']()[_0xbdb8('0x14')](function(){var _0x303557=_0x133800[_0xbdb8('0x15')]({'plain':!![]});var _0x442393=_0xbdb8('0x16');return db[_0xbdb8('0x17')][_0xbdb8('0x18')]({'where':{'type':_0x442393,'resourceId':_0x303557['id']}})[_0xbdb8('0x14')](function(){return _0x133800;});})[_0xbdb8('0x14')](function(){_0x50e009[_0xbdb8('0xb')](0xcc)[_0xbdb8('0xc')]();});}};}function handleEntityNotFound(_0x3febb9){return function(_0x51c4c3){if(!_0x51c4c3){_0x3febb9[_0xbdb8('0x19')](0x194);}return _0x51c4c3;};}function handleError(_0x2074e0,_0x3588ee){_0x3588ee=_0x3588ee||0x1f4;return function(_0x14c7af){logger[_0xbdb8('0x1a')](_0x14c7af[_0xbdb8('0x1b')]);if(_0x14c7af[_0xbdb8('0x1c')]){delete _0x14c7af[_0xbdb8('0x1c')];}_0x2074e0[_0xbdb8('0xb')](_0x3588ee)[_0xbdb8('0x1d')](_0x14c7af);};}exports['index']=function(_0x167edd,_0x2b3d5e){var _0x4e9e42={};var _0x1da624={'count':0x0,'rows':[]};var _0x38709a=_['map'](db[_0xbdb8('0x1e')][_0xbdb8('0x1f')],function(_0x1985d1){return{'name':_0x1985d1[_0xbdb8('0x20')],'type':_0x1985d1[_0xbdb8('0x21')][_0xbdb8('0x22')]};});_0x4e9e42=qs[_0xbdb8('0x23')](_0x38709a,_0x167edd);var _0x593db0={'where':_0x4e9e42[_0xbdb8('0x24')]};return db['FaxQueue']['count'](_0x593db0)[_0xbdb8('0x14')](function(_0xdb9223){_0x1da624[_0xbdb8('0x10')]=_0xdb9223;_0x4e9e42[_0xbdb8('0x25')]=qs['include'](_0x167edd[_0xbdb8('0x26')]);return db[_0xbdb8('0x1e')][_0xbdb8('0x27')](_0x4e9e42);})[_0xbdb8('0x14')](function(_0x4ec9a0){_0x1da624[_0xbdb8('0x28')]=_0x4ec9a0;return _0x1da624;})[_0xbdb8('0x14')](respondWithFilteredResult(_0x2b3d5e,_0x4e9e42))[_0xbdb8('0x29')](handleError(_0x2b3d5e,null));};exports[_0xbdb8('0x2a')]=function(_0x26e0d4,_0x4584d0){var _0x21db32={'raw':!![],'where':{'id':_0x26e0d4[_0xbdb8('0x2b')]['id']}},_0x56e164={};_0x56e164[_0xbdb8('0x2c')]=_['keys'](db['FaxQueue'][_0xbdb8('0x1f')]);_0x56e164[_0xbdb8('0x26')]=_[_0xbdb8('0x2d')](_0x26e0d4['query']);_0x56e164[_0xbdb8('0x2e')]=_[_0xbdb8('0x2f')](_0x56e164[_0xbdb8('0x2c')],_0x56e164[_0xbdb8('0x26')]);_0x21db32['attributes']=_[_0xbdb8('0x2f')](_0x56e164['model'],qs['fields'](_0x26e0d4[_0xbdb8('0x26')][_0xbdb8('0x30')]));_0x21db32['attributes']=_0x21db32[_0xbdb8('0x31')]['length']?_0x21db32[_0xbdb8('0x31')]:_0x56e164[_0xbdb8('0x2c')];if(_0x26e0d4['query'][_0xbdb8('0x32')]){_0x21db32[_0xbdb8('0x25')]=[{'all':!![]}];}_0x21db32=_[_0xbdb8('0x33')]({},_0x21db32,_0x26e0d4[_0xbdb8('0x34')]);return db['FaxQueue'][_0xbdb8('0x35')](_0x21db32)[_0xbdb8('0x14')](handleEntityNotFound(_0x4584d0,null))[_0xbdb8('0x14')](respondWithResult(_0x4584d0,null))['catch'](handleError(_0x4584d0,null));};exports['create']=function(_0x2cf995,_0x2f1c79){return db['FaxQueue']['create'](_0x2cf995['body'],{})[_0xbdb8('0x14')](function(_0x111752){var _0x2f1c00=_0x2cf995['user'][_0xbdb8('0x15')]({'plain':!![]});if(!_0x2f1c00)throw new Error(_0xbdb8('0x36'));if(_0x2f1c00['role']==='user'){var _0x2b4021=_0x111752[_0xbdb8('0x15')]({'plain':!![]});var _0x30acc5=_0xbdb8('0x16');return db['UserProfileSection'][_0xbdb8('0x35')]({'where':{'name':_0x30acc5,'userProfileId':_0x2f1c00['userProfileId']},'raw':!![]})[_0xbdb8('0x14')](function(_0x531338){if(_0x531338&&_0x531338[_0xbdb8('0x37')]===0x0){return db[_0xbdb8('0x17')]['create']({'name':_0x2b4021['name'],'resourceId':_0x2b4021['id'],'type':_0x531338[_0xbdb8('0x1c')],'sectionId':_0x531338['id']},{})['then'](function(){return _0x111752;});}else{return _0x111752;}})[_0xbdb8('0x29')](function(_0x3006a1){logger['error'](_0xbdb8('0x38'),_0x3006a1);throw _0x3006a1;});}return _0x111752;})[_0xbdb8('0x14')](respondWithResult(_0x2f1c79,0xc9))[_0xbdb8('0x29')](handleError(_0x2f1c79,null));};exports[_0xbdb8('0x13')]=function(_0x3a51db,_0x3d9c75){if(_0x3a51db[_0xbdb8('0x39')]['id']){delete _0x3a51db['body']['id'];}return db['FaxQueue'][_0xbdb8('0x35')]({'where':{'id':_0x3a51db[_0xbdb8('0x2b')]['id']}})[_0xbdb8('0x14')](handleEntityNotFound(_0x3d9c75,null))['then'](saveUpdates(_0x3a51db[_0xbdb8('0x39')],null))[_0xbdb8('0x14')](respondWithResult(_0x3d9c75,null))[_0xbdb8('0x29')](handleError(_0x3d9c75,null));};exports[_0xbdb8('0x18')]=function(_0x3b1511,_0x379225){return db[_0xbdb8('0x1e')][_0xbdb8('0x35')]({'where':{'id':_0x3b1511['params']['id']}})[_0xbdb8('0x14')](handleEntityNotFound(_0x379225,null))[_0xbdb8('0x14')](removeEntity(_0x379225,null))[_0xbdb8('0x29')](handleError(_0x379225,null));};exports[_0xbdb8('0x3a')]=function(_0x1e373d,_0x56ef57){return db[_0xbdb8('0x1e')][_0xbdb8('0x3a')]()[_0xbdb8('0x14')](respondWithResult(_0x56ef57,null))['catch'](handleError(_0x56ef57,null));};exports[_0xbdb8('0x3b')]=function(_0x3139dc,_0xb0ad22){var _0x517070={'raw':!![],'where':{}},_0x46ed4d={},_0x397217;return db[_0xbdb8('0x1e')][_0xbdb8('0x3c')]({'where':{'id':_0x3139dc['params']['id']}})[_0xbdb8('0x14')](handleEntityNotFound(_0xb0ad22,null))['then'](function(_0x36da0f){if(_0x36da0f){_0x397217=_0x36da0f['get']({'plain':!![]});_0x46ed4d[_0xbdb8('0x2c')]=_[_0xbdb8('0x2d')](db[_0xbdb8('0x3d')][_0xbdb8('0x1f')]);_0x46ed4d['query']=_[_0xbdb8('0x2d')](_0x3139dc[_0xbdb8('0x26')]);_0x46ed4d[_0xbdb8('0x2e')]=_[_0xbdb8('0x2f')](_0x46ed4d[_0xbdb8('0x2c')],_0x46ed4d['query']);_0x517070[_0xbdb8('0x31')]=_[_0xbdb8('0x2f')](_0x46ed4d['model'],qs[_0xbdb8('0x30')](_0x3139dc[_0xbdb8('0x26')][_0xbdb8('0x30')]));_0x517070['attributes']=_0x517070['attributes'][_0xbdb8('0x3e')]?_0x517070[_0xbdb8('0x31')]:_0x46ed4d[_0xbdb8('0x2c')];if(!_0x3139dc[_0xbdb8('0x26')][_0xbdb8('0x3f')]('nolimit')){_0x517070[_0xbdb8('0xf')]=qs[_0xbdb8('0xf')](_0x3139dc[_0xbdb8('0x26')][_0xbdb8('0xf')]);_0x517070[_0xbdb8('0xe')]=qs[_0xbdb8('0xe')](_0x3139dc[_0xbdb8('0x26')][_0xbdb8('0xe')]);}_0x517070[_0xbdb8('0x40')]=qs[_0xbdb8('0x41')](_0x3139dc[_0xbdb8('0x26')][_0xbdb8('0x41')]);_0x517070['where']=qs['filters'](_[_0xbdb8('0x42')](_0x3139dc[_0xbdb8('0x26')],_0x46ed4d[_0xbdb8('0x2e')]));_0x517070[_0xbdb8('0x24')]['FaxQueueId']=_0x36da0f['id'];if(_0x3139dc[_0xbdb8('0x26')][_0xbdb8('0x43')]){_0x517070['where']=_[_0xbdb8('0x33')](_0x517070[_0xbdb8('0x24')],{'$or':_[_0xbdb8('0x44')](_0x517070[_0xbdb8('0x31')],function(_0x96208f){var _0x424e2f={};_0x424e2f[_0x96208f]={'$like':'%'+_0x3139dc['query'][_0xbdb8('0x43')]+'%'};return _0x424e2f;})});}_0x517070=_[_0xbdb8('0x33')]({},_0x517070,_0x3139dc['options']);return db['UserFaxQueue'][_0xbdb8('0x27')](_0x517070);}})[_0xbdb8('0x14')](function(_0x3adfa7){if(_0x3adfa7){return db['User'][_0xbdb8('0x45')]({'where':{'id':_['map'](_0x3adfa7,_0xbdb8('0x46')),'role':'agent'},'attributes':['id',_0xbdb8('0x1c'),_0xbdb8('0x47'),_0xbdb8('0x48'),_0xbdb8('0x49')]});}})[_0xbdb8('0x14')](function(_0x20a820){if(_0x20a820){return{'count':_0x20a820['count'],'rows':_[_0xbdb8('0x44')](_0x20a820['rows'],function(_0x5ecc7a){return{'membername':_0x5ecc7a[_0xbdb8('0x1c')],'UserId':_0x5ecc7a['id'],'queue_name':_0x397217[_0xbdb8('0x1c')],'FaxQueueId':_0x397217['id'],'interface':util[_0xbdb8('0x4a')](_0xbdb8('0x4b'),_0xbdb8('0x4c'),_0x5ecc7a[_0xbdb8('0x1c')]),'penalty':0x0,'paused':_0x5ecc7a[_0xbdb8('0x47')],'createdAt':_0x5ecc7a[_0xbdb8('0x49')],'updatedAt':_0x5ecc7a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbdb8('0x14')](respondWithFilteredResult(_0xb0ad22,_0x517070))[_0xbdb8('0x29')](handleError(_0xb0ad22,null));};exports['getTeams']=function(_0x191752,_0x4cfcc9){var _0x30f8ac={};var _0x16e20f={};var _0x642c80;var _0x2a64dd;return db['FaxQueue'][_0xbdb8('0x3c')]({'where':{'id':_0x191752[_0xbdb8('0x2b')]['id']}})[_0xbdb8('0x14')](handleEntityNotFound(_0x4cfcc9,null))[_0xbdb8('0x14')](function(_0x170204){if(_0x170204){_0x642c80=_0x170204;_0x16e20f[_0xbdb8('0x2c')]=_['keys'](db[_0xbdb8('0x4d')][_0xbdb8('0x1f')]);_0x16e20f['query']=_['keys'](_0x191752[_0xbdb8('0x26')]);_0x16e20f['filters']=_[_0xbdb8('0x2f')](_0x16e20f['model'],_0x16e20f[_0xbdb8('0x26')]);_0x30f8ac['attributes']=_[_0xbdb8('0x2f')](_0x16e20f[_0xbdb8('0x2c')],qs[_0xbdb8('0x30')](_0x191752[_0xbdb8('0x26')][_0xbdb8('0x30')]));_0x30f8ac[_0xbdb8('0x31')]=_0x30f8ac[_0xbdb8('0x31')]['length']?_0x30f8ac[_0xbdb8('0x31')]:_0x16e20f[_0xbdb8('0x2c')];_0x30f8ac['order']=qs['sort'](_0x191752['query']['sort']);_0x30f8ac[_0xbdb8('0x24')]=qs[_0xbdb8('0x2e')](_[_0xbdb8('0x42')](_0x191752[_0xbdb8('0x26')],_0x16e20f[_0xbdb8('0x2e')]));if(_0x191752['query'][_0xbdb8('0x43')]){_0x30f8ac['where']=_['merge'](_0x30f8ac['where'],{'$or':_['map'](_0x30f8ac['attributes'],function(_0x378327){var _0x4f8c0d={};_0x4f8c0d[_0x378327]={'$like':'%'+_0x191752[_0xbdb8('0x26')][_0xbdb8('0x43')]+'%'};return _0x4f8c0d;})});}_0x30f8ac=_[_0xbdb8('0x33')]({},_0x30f8ac,_0x191752[_0xbdb8('0x34')]);return _0x642c80['getTeams'](_0x30f8ac);}})[_0xbdb8('0x14')](function(_0x5212e0){if(_0x5212e0){_0x2a64dd=_0x5212e0[_0xbdb8('0x3e')];if(!_0x191752[_0xbdb8('0x26')]['hasOwnProperty'](_0xbdb8('0x4e'))){_0x30f8ac[_0xbdb8('0xf')]=qs[_0xbdb8('0xf')](_0x191752[_0xbdb8('0x26')]['limit']);_0x30f8ac[_0xbdb8('0xe')]=qs[_0xbdb8('0xe')](_0x191752[_0xbdb8('0x26')]['offset']);}return _0x642c80[_0xbdb8('0x4f')](_0x30f8ac);}})[_0xbdb8('0x14')](function(_0x127590){if(_0x127590){return _0x127590?{'count':_0x2a64dd,'rows':_0x127590}:null;}})[_0xbdb8('0x14')](respondWithResult(_0x4cfcc9,null))[_0xbdb8('0x29')](handleError(_0x4cfcc9,null));};exports[_0xbdb8('0x50')]=function(_0x29ab4a,_0x467698){var _0x153d83=_0x29ab4a[_0xbdb8('0x39')][_0xbdb8('0x51')];return db[_0xbdb8('0x4d')][_0xbdb8('0x27')]({'where':{'id':_0x153d83},'attributes':['id'],'include':[{'model':db[_0xbdb8('0x52')],'as':_0xbdb8('0x53'),'attributes':['id',_0xbdb8('0x1c'),_0xbdb8('0x54'),_0xbdb8('0x55'),'interface'],'raw':!![]}]})[_0xbdb8('0x14')](function(_0x137721){if(_0x137721){var _0x5d1ee4=_[_0xbdb8('0x56')](_0x137721,function(_0x1c550e){var _0x3d8a92=_0x1c550e[_0xbdb8('0x15')]({'plain':!![]});return _0x3d8a92['Agents'];});return db[_0xbdb8('0x1e')][_0xbdb8('0x35')]({'where':{'id':_0x29ab4a[_0xbdb8('0x2b')]['id']}})[_0xbdb8('0x14')](function(_0x1e548d){return db['sequelize'][_0xbdb8('0x57')](function(_0x3dd767){return _0x1e548d[_0xbdb8('0x50')](_0x153d83,{'transaction':_0x3dd767})['then'](function(){return BPromise[_0xbdb8('0x58')](_0x5d1ee4,function(_0x133c47){return db[_0xbdb8('0x3d')][_0xbdb8('0x59')]({'where':{'UserId':_0x133c47['id'],'FaxQueueId':_0x29ab4a[_0xbdb8('0x2b')]['id']},'transaction':_0x3dd767});});})['then'](function(){_0x5d1ee4[_0xbdb8('0x5a')](function(_0x55c5d8){socket[_0xbdb8('0x5b')](_0xbdb8('0x5c'),{'UserId':_0x55c5d8['id'],'FaxQueueId':_0x1e548d['id']});});});});});}})[_0xbdb8('0x14')](respondWithStatusCode(_0x467698,null))['catch'](handleError(_0x467698,null));};exports['removeTeams']=function(_0x23d946,_0xcc03f2){return db[_0xbdb8('0x4d')][_0xbdb8('0x27')]({'where':{'id':_0x23d946['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xbdb8('0x52')],'as':_0xbdb8('0x53'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xcc03f2,null))[_0xbdb8('0x14')](function(_0x3c74d5){var _0x11d321=_['map'](_0x3c74d5,'id');var _0x937f85=[];var _0x566a02=[];var _0x57d724=squel[_0xbdb8('0x5d')]();_0x57d724[_0xbdb8('0x5e')](_0xbdb8('0x5f'))['from']('team_has_fax_queues','tq')[_0xbdb8('0x60')](_0xbdb8('0x61'),'ut',_0xbdb8('0x62'))[_0xbdb8('0x24')](_0xbdb8('0x63'),_0x23d946['params']['id']);for(var _0x581511=0x0;_0x581511<_0x3c74d5[_0xbdb8('0x3e')];_0x581511+=0x1){let _0x5f140b=_0x3c74d5[_0x581511];for(var _0x16aafc=0x0;_0x16aafc<_0x5f140b[_0xbdb8('0x53')][_0xbdb8('0x3e')];_0x16aafc+=0x1){let _0xa93299=_0x5f140b[_0xbdb8('0x53')][_0x16aafc];var _0x264fb1=_0x57d724[_0xbdb8('0x64')]();_0x264fb1[_0xbdb8('0x24')]('ut.UserId\x20=\x20?',_0xa93299['id']);_0x566a02[_0xbdb8('0x65')](db[_0xbdb8('0x66')][_0xbdb8('0x26')](_0x264fb1[_0xbdb8('0x67')](),{'type':db[_0xbdb8('0x66')]['QueryTypes'][_0xbdb8('0x68')]})[_0xbdb8('0x14')](function(_0x12dd63){if(_0x12dd63[_0xbdb8('0x3e')]===0x1){return _0xa93299['id'];}else{var _0x9091e2=_[_0xbdb8('0x69')](_[_0xbdb8('0x44')](_0x12dd63,_0xbdb8('0x6a')),function(_0x4b4902){return _[_0xbdb8('0x6b')](_0x11d321,_0x4b4902);});if(_0x9091e2){return _0xa93299['id'];}}}));}}return BPromise[_0xbdb8('0x6c')](_0x566a02)[_0xbdb8('0x14')](function(_0x52232e){_0x937f85=_(_0x937f85)['union'](_0x52232e)[_0xbdb8('0x6d')]()[_0xbdb8('0x6e')]();return db[_0xbdb8('0x1e')][_0xbdb8('0x35')]({'where':{'id':_0x23d946[_0xbdb8('0x2b')]['id']}})[_0xbdb8('0x14')](function(_0x3dfebf){return db[_0xbdb8('0x66')][_0xbdb8('0x57')](function(_0x31b179){return _0x3dfebf['removeTeams'](_0x23d946[_0xbdb8('0x26')][_0xbdb8('0x51')],{'transaction':_0x31b179})[_0xbdb8('0x14')](function(){if(!_['isEmpty'](_0x937f85)){return _0x3dfebf[_0xbdb8('0x6f')](_0x937f85,{'transaction':_0x31b179});}})['then'](function(){_0x937f85['forEach'](function(_0x3f9e7a){socket[_0xbdb8('0x5b')](_0xbdb8('0x70'),{'UserId':_0x3f9e7a,'FaxQueueId':_0x3dfebf['id']});});});});});});})[_0xbdb8('0x14')](respondWithStatusCode(_0xcc03f2,null))[_0xbdb8('0x29')](handleError(_0xcc03f2,null));};exports[_0xbdb8('0x71')]=function(_0x5878f1,_0x528b4b){return db[_0xbdb8('0x1e')][_0xbdb8('0x35')]({'where':{'id':_0x5878f1[_0xbdb8('0x2b')]['id']}})['then'](handleEntityNotFound(_0x528b4b,null))['then'](function(_0x21e12e){if(_0x21e12e){return _0x21e12e[_0xbdb8('0x71')](_0x5878f1[_0xbdb8('0x39')]['ids'],_[_0xbdb8('0x72')](_0x5878f1[_0xbdb8('0x39')],[_0xbdb8('0x51'),'id'])||{})[_0xbdb8('0x73')](function(_0x52c0fc){for(var _0x374004=0x0;_0x374004<_0x5878f1[_0xbdb8('0x39')]['ids'][_0xbdb8('0x3e')];_0x374004+=0x1){socket['emit'](_0xbdb8('0x5c'),{'UserId':Number(_0x5878f1[_0xbdb8('0x39')][_0xbdb8('0x51')][_0x374004]),'FaxQueueId':Number(_0x5878f1[_0xbdb8('0x2b')]['id'])});}return _0x52c0fc;});}})['then'](respondWithResult(_0x528b4b,null))['catch'](handleError(_0x528b4b,null));};exports[_0xbdb8('0x6f')]=function(_0x463c76,_0x3abb37){return db[_0xbdb8('0x1e')]['find']({'where':{'id':_0x463c76[_0xbdb8('0x2b')]['id']}})[_0xbdb8('0x14')](handleEntityNotFound(_0x3abb37,null))['then'](function(_0x2abbd1){if(_0x2abbd1){return _0x2abbd1[_0xbdb8('0x6f')](_0x463c76[_0xbdb8('0x26')][_0xbdb8('0x51')])[_0xbdb8('0x14')](function(){if(_['isArray'](_0x463c76['query'][_0xbdb8('0x51')])){for(var _0x5de32e=0x0;_0x5de32e<_0x463c76[_0xbdb8('0x26')][_0xbdb8('0x51')]['length'];_0x5de32e+=0x1){socket[_0xbdb8('0x5b')](_0xbdb8('0x70'),{'UserId':Number(_0x463c76[_0xbdb8('0x26')][_0xbdb8('0x51')][_0x5de32e]),'FaxQueueId':Number(_0x463c76[_0xbdb8('0x2b')]['id'])});}}else{socket[_0xbdb8('0x5b')](_0xbdb8('0x70'),{'UserId':Number(_0x463c76[_0xbdb8('0x26')][_0xbdb8('0x51')]),'FaxQueueId':Number(_0x463c76[_0xbdb8('0x2b')]['id'])});}});}})[_0xbdb8('0x14')](respondWithStatusCode(_0x3abb37,null))[_0xbdb8('0x29')](handleError(_0x3abb37,null));};exports[_0xbdb8('0x74')]=function(_0x220e4f,_0x1ac073){var _0x2a21d9={};var _0x53d8bc={};var _0x1a3e58;var _0x41b93b;return db[_0xbdb8('0x1e')][_0xbdb8('0x3c')]({'where':{'id':_0x220e4f[_0xbdb8('0x2b')]['id']}})[_0xbdb8('0x14')](handleEntityNotFound(_0x1ac073,null))[_0xbdb8('0x14')](function(_0x10038a){if(_0x10038a){_0x1a3e58=_0x10038a;_0x53d8bc[_0xbdb8('0x2c')]=_[_0xbdb8('0x2d')](db[_0xbdb8('0x52')][_0xbdb8('0x1f')]);_0x53d8bc[_0xbdb8('0x26')]=_[_0xbdb8('0x2d')](_0x220e4f[_0xbdb8('0x26')]);_0x53d8bc[_0xbdb8('0x2e')]=_[_0xbdb8('0x2f')](_0x53d8bc['model'],_0x53d8bc[_0xbdb8('0x26')]);_0x2a21d9[_0xbdb8('0x31')]=_[_0xbdb8('0x2f')](_0x53d8bc[_0xbdb8('0x2c')],qs[_0xbdb8('0x30')](_0x220e4f['query'][_0xbdb8('0x30')]));_0x2a21d9['attributes']=_0x2a21d9[_0xbdb8('0x31')][_0xbdb8('0x3e')]?_0x2a21d9[_0xbdb8('0x31')]:_0x53d8bc[_0xbdb8('0x2c')];_0x2a21d9['order']=qs[_0xbdb8('0x41')](_0x220e4f[_0xbdb8('0x26')][_0xbdb8('0x41')]);_0x2a21d9[_0xbdb8('0x24')]=qs[_0xbdb8('0x2e')](_[_0xbdb8('0x42')](_0x220e4f[_0xbdb8('0x26')],_0x53d8bc['filters']));if(_0x220e4f[_0xbdb8('0x26')][_0xbdb8('0x43')]){_0x2a21d9[_0xbdb8('0x24')]=_[_0xbdb8('0x33')](_0x2a21d9[_0xbdb8('0x24')],{'$or':_[_0xbdb8('0x44')](_0x2a21d9[_0xbdb8('0x31')],function(_0x304e48){var _0x4a27e5={};_0x4a27e5[_0x304e48]={'$like':'%'+_0x220e4f[_0xbdb8('0x26')][_0xbdb8('0x43')]+'%'};return _0x4a27e5;})});}_0x2a21d9=_[_0xbdb8('0x33')]({},_0x2a21d9,_0x220e4f['options']);return _0x1a3e58[_0xbdb8('0x74')](_0x2a21d9);}})[_0xbdb8('0x14')](function(_0x4a07f8){if(_0x4a07f8){_0x41b93b=_0x4a07f8[_0xbdb8('0x3e')];if(!_0x220e4f[_0xbdb8('0x26')]['hasOwnProperty'](_0xbdb8('0x4e'))){_0x2a21d9[_0xbdb8('0xf')]=qs[_0xbdb8('0xf')](_0x220e4f[_0xbdb8('0x26')][_0xbdb8('0xf')]);_0x2a21d9['offset']=qs[_0xbdb8('0xe')](_0x220e4f[_0xbdb8('0x26')][_0xbdb8('0xe')]);}return _0x1a3e58[_0xbdb8('0x74')](_0x2a21d9);}})[_0xbdb8('0x14')](function(_0x177847){if(_0x177847){return _0x177847?{'count':_0x41b93b,'rows':_0x177847}:null;}})[_0xbdb8('0x14')](respondWithResult(_0x1ac073,null))['catch'](handleError(_0x1ac073,null));}; \ No newline at end of file +var _0xe928=['include','query','show','params','model','keys','intersection','attributes','fields','includeAll','merge','options','find','create','body','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserFaxQueue','filters','length','hasOwnProperty','nolimit','sort','pick','FaxQueueId','filter','User','findAndCountAll','UserId','updatedAt','rows','%s/%s','SIP','createdAt','getTeams','Team','order','addTeams','ids','findAll','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','select','tq.TeamId','team_has_fax_queues','join','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','spread','removeAgents','getAgents','bluebird','util','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','FaxQueues','name','send','index','map','FaxQueue','rawAttributes','getOptions','where'];(function(_0x2c889a,_0x284565){var _0x237060=function(_0x48483a){while(--_0x48483a){_0x2c889a['push'](_0x2c889a['shift']());}};_0x237060(++_0x284565);}(_0xe928,0x145));var _0x8e92=function(_0xa16401,_0x9a9949){_0xa16401=_0xa16401-0x0;var _0x3d5676=_0xe928[_0xa16401];return _0x3d5676;};'use strict';var BPromise=require(_0x8e92('0x0'));var util=require(_0x8e92('0x1'));var _=require(_0x8e92('0x2'));var squel=require('squel');var Redis=require(_0x8e92('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x8e92('0x4'))(_0x8e92('0x5'));var config=require(_0x8e92('0x6'));var db=require(_0x8e92('0x7'))['db'];config['redis']=_[_0x8e92('0x8')](config['redis'],{'host':_0x8e92('0x9'),'port':0x18eb});var socket=require(_0x8e92('0xa'))(new Redis(config[_0x8e92('0xb')]));require(_0x8e92('0xc'))['register'](socket);function respondWithStatusCode(_0x361fd2,_0x594b63){_0x594b63=_0x594b63||0xcc;return function(_0x439990){if(_0x439990){return _0x361fd2[_0x8e92('0xd')](_0x594b63);}return _0x361fd2[_0x8e92('0xe')](_0x594b63)[_0x8e92('0xf')]();};}function respondWithResult(_0x45c1a4,_0x79e446){_0x79e446=_0x79e446||0xc8;return function(_0x5d396b){if(_0x5d396b){return _0x45c1a4[_0x8e92('0xe')](_0x79e446)[_0x8e92('0x10')](_0x5d396b);}};}function respondWithFilteredResult(_0x2ad0d9,_0x52bcfb){return function(_0x3dd795){if(_0x3dd795){var _0x28ef67=typeof _0x52bcfb[_0x8e92('0x11')]===_0x8e92('0x12')&&typeof _0x52bcfb[_0x8e92('0x13')]===_0x8e92('0x12');var _0x5073f7=_0x3dd795['count'];var _0x97be72=_0x28ef67?0x0:_0x52bcfb['offset'];var _0x1cf5ee=_0x28ef67?_0x3dd795[_0x8e92('0x14')]:_0x52bcfb['offset']+_0x52bcfb[_0x8e92('0x13')];var _0x57ff38;if(_0x1cf5ee>=_0x5073f7){_0x1cf5ee=_0x5073f7;_0x57ff38=0xc8;}else{_0x57ff38=0xce;}_0x2ad0d9[_0x8e92('0xe')](_0x57ff38);return _0x2ad0d9[_0x8e92('0x15')](_0x8e92('0x16'),_0x97be72+'-'+_0x1cf5ee+'/'+_0x5073f7)[_0x8e92('0x10')](_0x3dd795);}return null;};}function saveUpdates(_0x1c4b12){return function(_0x1a80d2){if(_0x1a80d2){return _0x1a80d2[_0x8e92('0x17')](_0x1c4b12)[_0x8e92('0x18')](function(_0x55f325){return _0x55f325;});}return null;};}function removeEntity(_0x3dfb4c){return function(_0x192b0b){if(_0x192b0b){return _0x192b0b[_0x8e92('0x19')]()[_0x8e92('0x18')](function(){var _0x250988=_0x192b0b['get']({'plain':!![]});var _0x261b07=_0x8e92('0x1a');return db['UserProfileResource']['destroy']({'where':{'type':_0x261b07,'resourceId':_0x250988['id']}})['then'](function(){return _0x192b0b;});})[_0x8e92('0x18')](function(){_0x3dfb4c['status'](0xcc)[_0x8e92('0xf')]();});}};}function handleEntityNotFound(_0x5deddc){return function(_0x63cf41){if(!_0x63cf41){_0x5deddc[_0x8e92('0xd')](0x194);}return _0x63cf41;};}function handleError(_0x368253,_0x70f846){_0x70f846=_0x70f846||0x1f4;return function(_0x53fc94){logger['error'](_0x53fc94['stack']);if(_0x53fc94['name']){delete _0x53fc94[_0x8e92('0x1b')];}_0x368253[_0x8e92('0xe')](_0x70f846)[_0x8e92('0x1c')](_0x53fc94);};}exports[_0x8e92('0x1d')]=function(_0x250f84,_0x3ddfff){var _0x585adb={};var _0x1b0e14={'count':0x0,'rows':[]};var _0x22cdbe=_[_0x8e92('0x1e')](db[_0x8e92('0x1f')][_0x8e92('0x20')],function(_0x2aaf1d){return{'name':_0x2aaf1d['fieldName'],'type':_0x2aaf1d['type']['key']};});_0x585adb=qs[_0x8e92('0x21')](_0x22cdbe,_0x250f84);var _0x59b173={'where':_0x585adb[_0x8e92('0x22')]};return db['FaxQueue'][_0x8e92('0x14')](_0x59b173)['then'](function(_0x208384){_0x1b0e14[_0x8e92('0x14')]=_0x208384;_0x585adb[_0x8e92('0x23')]=qs[_0x8e92('0x23')](_0x250f84[_0x8e92('0x24')]);return db[_0x8e92('0x1f')]['findAll'](_0x585adb);})[_0x8e92('0x18')](function(_0x405df5){_0x1b0e14['rows']=_0x405df5;return _0x1b0e14;})[_0x8e92('0x18')](respondWithFilteredResult(_0x3ddfff,_0x585adb))['catch'](handleError(_0x3ddfff,null));};exports[_0x8e92('0x25')]=function(_0x2500d9,_0x4fb57b){var _0x10d131={'raw':!![],'where':{'id':_0x2500d9[_0x8e92('0x26')]['id']}},_0x303016={};_0x303016[_0x8e92('0x27')]=_[_0x8e92('0x28')](db[_0x8e92('0x1f')][_0x8e92('0x20')]);_0x303016[_0x8e92('0x24')]=_[_0x8e92('0x28')](_0x2500d9['query']);_0x303016['filters']=_[_0x8e92('0x29')](_0x303016['model'],_0x303016['query']);_0x10d131[_0x8e92('0x2a')]=_[_0x8e92('0x29')](_0x303016[_0x8e92('0x27')],qs['fields'](_0x2500d9[_0x8e92('0x24')][_0x8e92('0x2b')]));_0x10d131[_0x8e92('0x2a')]=_0x10d131['attributes']['length']?_0x10d131[_0x8e92('0x2a')]:_0x303016['model'];if(_0x2500d9[_0x8e92('0x24')][_0x8e92('0x2c')]){_0x10d131[_0x8e92('0x23')]=[{'all':!![]}];}_0x10d131=_[_0x8e92('0x2d')]({},_0x10d131,_0x2500d9[_0x8e92('0x2e')]);return db['FaxQueue'][_0x8e92('0x2f')](_0x10d131)[_0x8e92('0x18')](handleEntityNotFound(_0x4fb57b,null))[_0x8e92('0x18')](respondWithResult(_0x4fb57b,null))['catch'](handleError(_0x4fb57b,null));};exports['create']=function(_0xa2a8a2,_0x54e964){return db[_0x8e92('0x1f')][_0x8e92('0x30')](_0xa2a8a2[_0x8e92('0x31')],{})[_0x8e92('0x18')](function(_0x503868){var _0x4b74c4=_0xa2a8a2['user'][_0x8e92('0x32')]({'plain':!![]});if(!_0x4b74c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b74c4[_0x8e92('0x33')]==='user'){var _0x4c1cc6=_0x503868['get']({'plain':!![]});var _0x284b85=_0x8e92('0x1a');return db[_0x8e92('0x34')][_0x8e92('0x2f')]({'where':{'name':_0x284b85,'userProfileId':_0x4b74c4[_0x8e92('0x35')]},'raw':!![]})[_0x8e92('0x18')](function(_0x5e0f6f){if(_0x5e0f6f&&_0x5e0f6f[_0x8e92('0x36')]===0x0){return db[_0x8e92('0x37')][_0x8e92('0x30')]({'name':_0x4c1cc6[_0x8e92('0x1b')],'resourceId':_0x4c1cc6['id'],'type':_0x5e0f6f['name'],'sectionId':_0x5e0f6f['id']},{})[_0x8e92('0x18')](function(){return _0x503868;});}else{return _0x503868;}})[_0x8e92('0x38')](function(_0x5c4a29){logger[_0x8e92('0x39')](_0x8e92('0x3a'),_0x5c4a29);throw _0x5c4a29;});}return _0x503868;})['then'](respondWithResult(_0x54e964,0xc9))['catch'](handleError(_0x54e964,null));};exports[_0x8e92('0x17')]=function(_0x4fd1e2,_0x543e7f){if(_0x4fd1e2[_0x8e92('0x31')]['id']){delete _0x4fd1e2[_0x8e92('0x31')]['id'];}return db[_0x8e92('0x1f')]['find']({'where':{'id':_0x4fd1e2[_0x8e92('0x26')]['id']}})[_0x8e92('0x18')](handleEntityNotFound(_0x543e7f,null))[_0x8e92('0x18')](saveUpdates(_0x4fd1e2[_0x8e92('0x31')],null))['then'](respondWithResult(_0x543e7f,null))[_0x8e92('0x38')](handleError(_0x543e7f,null));};exports['destroy']=function(_0x3b8209,_0x2c7202){return db['FaxQueue'][_0x8e92('0x2f')]({'where':{'id':_0x3b8209[_0x8e92('0x26')]['id']}})[_0x8e92('0x18')](handleEntityNotFound(_0x2c7202,null))[_0x8e92('0x18')](removeEntity(_0x2c7202,null))[_0x8e92('0x38')](handleError(_0x2c7202,null));};exports[_0x8e92('0x3b')]=function(_0x2c3b05,_0x3c2035){return db[_0x8e92('0x1f')][_0x8e92('0x3b')]()[_0x8e92('0x18')](respondWithResult(_0x3c2035,null))[_0x8e92('0x38')](handleError(_0x3c2035,null));};exports['getMembers']=function(_0x1d9124,_0x2d92d2){var _0x121267={'raw':!![],'where':{}},_0x2a4600={},_0x4f32b7;return db[_0x8e92('0x1f')][_0x8e92('0x3c')]({'where':{'id':_0x1d9124[_0x8e92('0x26')]['id']}})['then'](handleEntityNotFound(_0x2d92d2,null))[_0x8e92('0x18')](function(_0x268f4c){if(_0x268f4c){_0x4f32b7=_0x268f4c[_0x8e92('0x32')]({'plain':!![]});_0x2a4600[_0x8e92('0x27')]=_[_0x8e92('0x28')](db[_0x8e92('0x3d')][_0x8e92('0x20')]);_0x2a4600[_0x8e92('0x24')]=_[_0x8e92('0x28')](_0x1d9124[_0x8e92('0x24')]);_0x2a4600[_0x8e92('0x3e')]=_[_0x8e92('0x29')](_0x2a4600['model'],_0x2a4600[_0x8e92('0x24')]);_0x121267[_0x8e92('0x2a')]=_[_0x8e92('0x29')](_0x2a4600[_0x8e92('0x27')],qs[_0x8e92('0x2b')](_0x1d9124[_0x8e92('0x24')]['fields']));_0x121267[_0x8e92('0x2a')]=_0x121267[_0x8e92('0x2a')][_0x8e92('0x3f')]?_0x121267[_0x8e92('0x2a')]:_0x2a4600[_0x8e92('0x27')];if(!_0x1d9124[_0x8e92('0x24')][_0x8e92('0x40')](_0x8e92('0x41'))){_0x121267[_0x8e92('0x13')]=qs[_0x8e92('0x13')](_0x1d9124[_0x8e92('0x24')][_0x8e92('0x13')]);_0x121267[_0x8e92('0x11')]=qs[_0x8e92('0x11')](_0x1d9124['query'][_0x8e92('0x11')]);}_0x121267['order']=qs['sort'](_0x1d9124[_0x8e92('0x24')][_0x8e92('0x42')]);_0x121267['where']=qs['filters'](_[_0x8e92('0x43')](_0x1d9124[_0x8e92('0x24')],_0x2a4600[_0x8e92('0x3e')]));_0x121267[_0x8e92('0x22')][_0x8e92('0x44')]=_0x268f4c['id'];if(_0x1d9124[_0x8e92('0x24')][_0x8e92('0x45')]){_0x121267[_0x8e92('0x22')]=_[_0x8e92('0x2d')](_0x121267[_0x8e92('0x22')],{'$or':_[_0x8e92('0x1e')](_0x121267[_0x8e92('0x2a')],function(_0x39cba0){var _0x3e726d={};_0x3e726d[_0x39cba0]={'$like':'%'+_0x1d9124[_0x8e92('0x24')][_0x8e92('0x45')]+'%'};return _0x3e726d;})});}_0x121267=_['merge']({},_0x121267,_0x1d9124[_0x8e92('0x2e')]);return db[_0x8e92('0x3d')]['findAll'](_0x121267);}})['then'](function(_0x8b5e2c){if(_0x8b5e2c){return db[_0x8e92('0x46')][_0x8e92('0x47')]({'where':{'id':_[_0x8e92('0x1e')](_0x8b5e2c,_0x8e92('0x48')),'role':'agent'},'attributes':['id',_0x8e92('0x1b'),'faxPause',_0x8e92('0x49'),'createdAt']});}})[_0x8e92('0x18')](function(_0x335ecb){if(_0x335ecb){return{'count':_0x335ecb[_0x8e92('0x14')],'rows':_[_0x8e92('0x1e')](_0x335ecb[_0x8e92('0x4a')],function(_0x649e06){return{'membername':_0x649e06[_0x8e92('0x1b')],'UserId':_0x649e06['id'],'queue_name':_0x4f32b7[_0x8e92('0x1b')],'FaxQueueId':_0x4f32b7['id'],'interface':util['format'](_0x8e92('0x4b'),_0x8e92('0x4c'),_0x649e06[_0x8e92('0x1b')]),'penalty':0x0,'paused':_0x649e06['faxPause'],'createdAt':_0x649e06[_0x8e92('0x4d')],'updatedAt':_0x649e06[_0x8e92('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8e92('0x18')](respondWithFilteredResult(_0x2d92d2,_0x121267))[_0x8e92('0x38')](handleError(_0x2d92d2,null));};exports[_0x8e92('0x4e')]=function(_0x2227d8,_0x3dbb85){var _0x5a72d9={};var _0x20654f={};var _0x279e78;var _0x341374;return db['FaxQueue']['findOne']({'where':{'id':_0x2227d8['params']['id']}})[_0x8e92('0x18')](handleEntityNotFound(_0x3dbb85,null))[_0x8e92('0x18')](function(_0x341fe7){if(_0x341fe7){_0x279e78=_0x341fe7;_0x20654f[_0x8e92('0x27')]=_[_0x8e92('0x28')](db[_0x8e92('0x4f')][_0x8e92('0x20')]);_0x20654f['query']=_[_0x8e92('0x28')](_0x2227d8[_0x8e92('0x24')]);_0x20654f[_0x8e92('0x3e')]=_[_0x8e92('0x29')](_0x20654f[_0x8e92('0x27')],_0x20654f[_0x8e92('0x24')]);_0x5a72d9['attributes']=_[_0x8e92('0x29')](_0x20654f[_0x8e92('0x27')],qs['fields'](_0x2227d8[_0x8e92('0x24')]['fields']));_0x5a72d9[_0x8e92('0x2a')]=_0x5a72d9[_0x8e92('0x2a')][_0x8e92('0x3f')]?_0x5a72d9['attributes']:_0x20654f[_0x8e92('0x27')];_0x5a72d9[_0x8e92('0x50')]=qs[_0x8e92('0x42')](_0x2227d8['query'][_0x8e92('0x42')]);_0x5a72d9[_0x8e92('0x22')]=qs[_0x8e92('0x3e')](_['pick'](_0x2227d8[_0x8e92('0x24')],_0x20654f['filters']));if(_0x2227d8[_0x8e92('0x24')][_0x8e92('0x45')]){_0x5a72d9['where']=_[_0x8e92('0x2d')](_0x5a72d9[_0x8e92('0x22')],{'$or':_['map'](_0x5a72d9[_0x8e92('0x2a')],function(_0x403d00){var _0x227ee8={};_0x227ee8[_0x403d00]={'$like':'%'+_0x2227d8['query'][_0x8e92('0x45')]+'%'};return _0x227ee8;})});}_0x5a72d9=_[_0x8e92('0x2d')]({},_0x5a72d9,_0x2227d8[_0x8e92('0x2e')]);return _0x279e78['getTeams'](_0x5a72d9);}})['then'](function(_0x2da202){if(_0x2da202){_0x341374=_0x2da202[_0x8e92('0x3f')];if(!_0x2227d8[_0x8e92('0x24')][_0x8e92('0x40')](_0x8e92('0x41'))){_0x5a72d9['limit']=qs[_0x8e92('0x13')](_0x2227d8[_0x8e92('0x24')][_0x8e92('0x13')]);_0x5a72d9[_0x8e92('0x11')]=qs[_0x8e92('0x11')](_0x2227d8['query'][_0x8e92('0x11')]);}return _0x279e78[_0x8e92('0x4e')](_0x5a72d9);}})[_0x8e92('0x18')](function(_0x243c43){if(_0x243c43){return _0x243c43?{'count':_0x341374,'rows':_0x243c43}:null;}})[_0x8e92('0x18')](respondWithResult(_0x3dbb85,null))[_0x8e92('0x38')](handleError(_0x3dbb85,null));};exports[_0x8e92('0x51')]=function(_0x30ea14,_0x552daf){var _0x822e78=_0x30ea14[_0x8e92('0x31')][_0x8e92('0x52')];return db[_0x8e92('0x4f')][_0x8e92('0x53')]({'where':{'id':_0x822e78},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8e92('0x54'),'attributes':['id',_0x8e92('0x1b'),_0x8e92('0x55'),_0x8e92('0x56'),_0x8e92('0x57')],'raw':!![]}]})[_0x8e92('0x18')](function(_0x1d5ed1){if(_0x1d5ed1){var _0x599147=_['flatMap'](_0x1d5ed1,function(_0x59ea77){var _0x66c8c2=_0x59ea77[_0x8e92('0x32')]({'plain':!![]});return _0x66c8c2[_0x8e92('0x54')];});return db[_0x8e92('0x1f')][_0x8e92('0x2f')]({'where':{'id':_0x30ea14[_0x8e92('0x26')]['id']}})[_0x8e92('0x18')](function(_0xae3f5a){return db[_0x8e92('0x58')][_0x8e92('0x59')](function(_0x21b95a){return _0xae3f5a['addTeams'](_0x822e78,{'transaction':_0x21b95a})[_0x8e92('0x18')](function(){return BPromise[_0x8e92('0x5a')](_0x599147,function(_0x26bac3){return db[_0x8e92('0x3d')][_0x8e92('0x5b')]({'where':{'UserId':_0x26bac3['id'],'FaxQueueId':_0x30ea14[_0x8e92('0x26')]['id']},'transaction':_0x21b95a});});})[_0x8e92('0x18')](function(){_0x599147['forEach'](function(_0x40f54d){socket[_0x8e92('0x5c')](_0x8e92('0x5d'),{'UserId':_0x40f54d['id'],'FaxQueueId':_0xae3f5a['id']});});});});});}})[_0x8e92('0x18')](respondWithStatusCode(_0x552daf,null))[_0x8e92('0x38')](handleError(_0x552daf,null));};exports[_0x8e92('0x5e')]=function(_0xb09de1,_0x27e766){return db[_0x8e92('0x4f')]['findAll']({'where':{'id':_0xb09de1[_0x8e92('0x24')][_0x8e92('0x52')]},'attributes':['id'],'include':[{'model':db[_0x8e92('0x46')],'as':_0x8e92('0x54'),'attributes':['id'],'raw':!![]}]})[_0x8e92('0x18')](handleEntityNotFound(_0x27e766,null))[_0x8e92('0x18')](function(_0x24ebac){var _0x4815c4=_[_0x8e92('0x1e')](_0x24ebac,'id');var _0x196821=[];var _0x4f1ea1=[];var _0x338b63=squel[_0x8e92('0x5f')]();_0x338b63['field'](_0x8e92('0x60'))['from'](_0x8e92('0x61'),'tq')[_0x8e92('0x62')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8e92('0x63'),_0xb09de1[_0x8e92('0x26')]['id']);for(var _0x252574=0x0;_0x252574<_0x24ebac['length'];_0x252574+=0x1){let _0x3ce8cc=_0x24ebac[_0x252574];for(var _0x1a62a4=0x0;_0x1a62a4<_0x3ce8cc['Agents'][_0x8e92('0x3f')];_0x1a62a4+=0x1){let _0x31040b=_0x3ce8cc[_0x8e92('0x54')][_0x1a62a4];var _0x307b65=_0x338b63[_0x8e92('0x64')]();_0x307b65[_0x8e92('0x22')](_0x8e92('0x65'),_0x31040b['id']);_0x4f1ea1[_0x8e92('0x66')](db['sequelize'][_0x8e92('0x24')](_0x307b65[_0x8e92('0x67')](),{'type':db[_0x8e92('0x58')]['QueryTypes'][_0x8e92('0x68')]})[_0x8e92('0x18')](function(_0x2ed5f7){if(_0x2ed5f7['length']===0x1){return _0x31040b['id'];}else{var _0x257229=_[_0x8e92('0x69')](_[_0x8e92('0x1e')](_0x2ed5f7,_0x8e92('0x6a')),function(_0x311b97){return _[_0x8e92('0x6b')](_0x4815c4,_0x311b97);});if(_0x257229){return _0x31040b['id'];}}}));}}return BPromise[_0x8e92('0x6c')](_0x4f1ea1)[_0x8e92('0x18')](function(_0x154154){_0x196821=_(_0x196821)[_0x8e92('0x6d')](_0x154154)[_0x8e92('0x6e')]()[_0x8e92('0x6f')]();return db['FaxQueue']['find']({'where':{'id':_0xb09de1['params']['id']}})['then'](function(_0x29700b){return db[_0x8e92('0x58')][_0x8e92('0x59')](function(_0x74e9cd){return _0x29700b[_0x8e92('0x5e')](_0xb09de1[_0x8e92('0x24')]['ids'],{'transaction':_0x74e9cd})[_0x8e92('0x18')](function(){if(!_[_0x8e92('0x70')](_0x196821)){return _0x29700b['removeAgents'](_0x196821,{'transaction':_0x74e9cd});}})[_0x8e92('0x18')](function(){_0x196821[_0x8e92('0x71')](function(_0x4744f0){socket['emit'](_0x8e92('0x72'),{'UserId':_0x4744f0,'FaxQueueId':_0x29700b['id']});});});});});});})[_0x8e92('0x18')](respondWithStatusCode(_0x27e766,null))[_0x8e92('0x38')](handleError(_0x27e766,null));};exports['addAgents']=function(_0x14045e,_0x3beb2c){return db[_0x8e92('0x1f')][_0x8e92('0x2f')]({'where':{'id':_0x14045e['params']['id']}})[_0x8e92('0x18')](handleEntityNotFound(_0x3beb2c,null))[_0x8e92('0x18')](function(_0x3cf167){if(_0x3cf167){return _0x3cf167[_0x8e92('0x73')](_0x14045e[_0x8e92('0x31')][_0x8e92('0x52')],_[_0x8e92('0x74')](_0x14045e[_0x8e92('0x31')],[_0x8e92('0x52'),'id'])||{})[_0x8e92('0x75')](function(_0x2b8401){for(var _0x2a85e3=0x0;_0x2a85e3<_0x14045e[_0x8e92('0x31')][_0x8e92('0x52')][_0x8e92('0x3f')];_0x2a85e3+=0x1){socket[_0x8e92('0x5c')](_0x8e92('0x5d'),{'UserId':Number(_0x14045e[_0x8e92('0x31')][_0x8e92('0x52')][_0x2a85e3]),'FaxQueueId':Number(_0x14045e[_0x8e92('0x26')]['id'])});}return _0x2b8401;});}})['then'](respondWithResult(_0x3beb2c,null))[_0x8e92('0x38')](handleError(_0x3beb2c,null));};exports['removeAgents']=function(_0x119f80,_0x37ae0f){return db[_0x8e92('0x1f')]['find']({'where':{'id':_0x119f80['params']['id']}})[_0x8e92('0x18')](handleEntityNotFound(_0x37ae0f,null))['then'](function(_0x3e7c40){if(_0x3e7c40){return _0x3e7c40[_0x8e92('0x76')](_0x119f80[_0x8e92('0x24')]['ids'])[_0x8e92('0x18')](function(){if(_['isArray'](_0x119f80[_0x8e92('0x24')][_0x8e92('0x52')])){for(var _0x5d225f=0x0;_0x5d225f<_0x119f80[_0x8e92('0x24')][_0x8e92('0x52')]['length'];_0x5d225f+=0x1){socket[_0x8e92('0x5c')]('userFaxQueue:remove',{'UserId':Number(_0x119f80[_0x8e92('0x24')][_0x8e92('0x52')][_0x5d225f]),'FaxQueueId':Number(_0x119f80[_0x8e92('0x26')]['id'])});}}else{socket[_0x8e92('0x5c')]('userFaxQueue:remove',{'UserId':Number(_0x119f80['query'][_0x8e92('0x52')]),'FaxQueueId':Number(_0x119f80[_0x8e92('0x26')]['id'])});}});}})['then'](respondWithStatusCode(_0x37ae0f,null))['catch'](handleError(_0x37ae0f,null));};exports[_0x8e92('0x77')]=function(_0x4aaaa0,_0xd321e2){var _0x358808={};var _0x1552ce={};var _0x812fad;var _0x3776fb;return db['FaxQueue'][_0x8e92('0x3c')]({'where':{'id':_0x4aaaa0[_0x8e92('0x26')]['id']}})['then'](handleEntityNotFound(_0xd321e2,null))[_0x8e92('0x18')](function(_0x1d4e43){if(_0x1d4e43){_0x812fad=_0x1d4e43;_0x1552ce['model']=_[_0x8e92('0x28')](db[_0x8e92('0x46')][_0x8e92('0x20')]);_0x1552ce['query']=_['keys'](_0x4aaaa0[_0x8e92('0x24')]);_0x1552ce[_0x8e92('0x3e')]=_[_0x8e92('0x29')](_0x1552ce[_0x8e92('0x27')],_0x1552ce[_0x8e92('0x24')]);_0x358808[_0x8e92('0x2a')]=_[_0x8e92('0x29')](_0x1552ce[_0x8e92('0x27')],qs[_0x8e92('0x2b')](_0x4aaaa0[_0x8e92('0x24')][_0x8e92('0x2b')]));_0x358808[_0x8e92('0x2a')]=_0x358808[_0x8e92('0x2a')][_0x8e92('0x3f')]?_0x358808[_0x8e92('0x2a')]:_0x1552ce[_0x8e92('0x27')];_0x358808['order']=qs['sort'](_0x4aaaa0[_0x8e92('0x24')][_0x8e92('0x42')]);_0x358808['where']=qs[_0x8e92('0x3e')](_[_0x8e92('0x43')](_0x4aaaa0[_0x8e92('0x24')],_0x1552ce[_0x8e92('0x3e')]));if(_0x4aaaa0['query'][_0x8e92('0x45')]){_0x358808[_0x8e92('0x22')]=_[_0x8e92('0x2d')](_0x358808[_0x8e92('0x22')],{'$or':_[_0x8e92('0x1e')](_0x358808['attributes'],function(_0x25398a){var _0xaf8dad={};_0xaf8dad[_0x25398a]={'$like':'%'+_0x4aaaa0[_0x8e92('0x24')]['filter']+'%'};return _0xaf8dad;})});}_0x358808=_[_0x8e92('0x2d')]({},_0x358808,_0x4aaaa0['options']);return _0x812fad[_0x8e92('0x77')](_0x358808);}})[_0x8e92('0x18')](function(_0xfe7107){if(_0xfe7107){_0x3776fb=_0xfe7107[_0x8e92('0x3f')];if(!_0x4aaaa0[_0x8e92('0x24')][_0x8e92('0x40')]('nolimit')){_0x358808[_0x8e92('0x13')]=qs[_0x8e92('0x13')](_0x4aaaa0[_0x8e92('0x24')][_0x8e92('0x13')]);_0x358808[_0x8e92('0x11')]=qs[_0x8e92('0x11')](_0x4aaaa0['query'][_0x8e92('0x11')]);}return _0x812fad['getAgents'](_0x358808);}})[_0x8e92('0x18')](function(_0x52108c){if(_0x52108c){return _0x52108c?{'count':_0x3776fb,'rows':_0x52108c}:null;}})['then'](respondWithResult(_0xd321e2,null))[_0x8e92('0x38')](handleError(_0xd321e2,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index a72edb9..ba90301 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 _0x06d1=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0x06d1,0x161));var _0x106d=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x06d1[_0x334841];return _0x5beb4b;};'use strict';var EventEmitter=require(_0x106d('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x106d('0x1')](0x0);var events={'afterCreate':_0x106d('0x2'),'afterUpdate':_0x106d('0x3'),'afterDestroy':_0x106d('0x4')};function emitEvent(_0xf5192d){return function(_0x4d432e,_0x47083d,_0x2baea4){FaxQueueEvents[_0x106d('0x5')](_0xf5192d+':'+_0x4d432e['id'],_0x4d432e);FaxQueueEvents[_0x106d('0x5')](_0xf5192d,_0x4d432e);_0x2baea4(null);};}for(var e in events){if(events[_0x106d('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x106d('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0xe934=['FaxQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2ad5b5,_0x37e095){var _0x507be3=function(_0x3b3b78){while(--_0x3b3b78){_0x2ad5b5['push'](_0x2ad5b5['shift']());}};_0x507be3(++_0x37e095);}(_0xe934,0xf0));var _0x4e93=function(_0x2595a6,_0x48fc45){_0x2595a6=_0x2595a6-0x0;var _0x460197=_0xe934[_0x2595a6];return _0x460197;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0x4e93('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x4e93('0x1')](0x0);var events={'afterCreate':_0x4e93('0x2'),'afterUpdate':'update','afterDestroy':_0x4e93('0x3')};function emitEvent(_0x5c9df2){return function(_0xa6d3a9,_0x322625,_0x2d308f){FaxQueueEvents[_0x4e93('0x4')](_0x5c9df2+':'+_0xa6d3a9['id'],_0xa6d3a9);FaxQueueEvents['emit'](_0x5c9df2,_0xa6d3a9);_0x2d308f(null);};}for(var e in events){if(events[_0x4e93('0x5')](e)){var event=events[e];FaxQueue[_0x4e93('0x6')](e,emitEvent(event));}}module[_0x4e93('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 fe5121f..d05e393 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 _0xfe0b=['rimraf','../../config/environment','exports','define','fax_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x14b555,_0xa1805c){var _0x5c5f38=function(_0x1d74db){while(--_0x1d74db){_0x14b555['push'](_0x14b555['shift']());}};_0x5c5f38(++_0xa1805c);}(_0xfe0b,0x89));var _0xbfe0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfe0b[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xbfe0('0x0'));var util=require(_0xbfe0('0x1'));var logger=require(_0xbfe0('0x2'))(_0xbfe0('0x3'));var moment=require('moment');var BPromise=require(_0xbfe0('0x4'));var rp=require(_0xbfe0('0x5'));var fs=require('fs');var path=require(_0xbfe0('0x6'));var rimraf=require(_0xbfe0('0x7'));var config=require(_0xbfe0('0x8'));var attributes=require('./faxQueue.attributes');module[_0xbfe0('0x9')]=function(_0x30213b,_0x188a90){return _0x30213b[_0xbfe0('0xa')]('FaxQueue',attributes,{'tableName':_0xbfe0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0022=['exports','define','FaxQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x6469e3,_0x4fadec){var _0x34a1a5=function(_0x2ad071){while(--_0x2ad071){_0x6469e3['push'](_0x6469e3['shift']());}};_0x34a1a5(++_0x4fadec);}(_0x0022,0xb7));var _0x2002=function(_0xc6b011,_0x5d1f19){_0xc6b011=_0xc6b011-0x0;var _0x420171=_0x0022[_0xc6b011];return _0x420171;};'use strict';var _=require(_0x2002('0x0'));var util=require(_0x2002('0x1'));var logger=require(_0x2002('0x2'))(_0x2002('0x3'));var moment=require(_0x2002('0x4'));var BPromise=require(_0x2002('0x5'));var rp=require(_0x2002('0x6'));var fs=require('fs');var path=require(_0x2002('0x7'));var rimraf=require(_0x2002('0x8'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0x2002('0x9')]=function(_0x4362bd,_0x2be97c){return _0x4362bd[_0x2002('0xa')](_0x2002('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 c9cb373..1856e85 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 _0x6602=['then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','map','include','model','attributes','info','ShowFaxQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./faxQueue.socket','request'];(function(_0x551ae9,_0x539204){var _0xb0e09c=function(_0x348c04){while(--_0x348c04){_0x551ae9['push'](_0x551ae9['shift']());}};_0xb0e09c(++_0x539204);}(_0x6602,0xf5));var _0x2660=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x6602[_0x307d86];return _0x361745;};'use strict';var _=require(_0x2660('0x0'));var util=require(_0x2660('0x1'));var moment=require(_0x2660('0x2'));var BPromise=require(_0x2660('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2660('0x4'));var db=require(_0x2660('0x5'))['db'];var utils=require(_0x2660('0x6'));var logger=require(_0x2660('0x7'))(_0x2660('0x8'));var config=require(_0x2660('0x9'));var jayson=require(_0x2660('0xa'));var client=jayson[_0x2660('0xb')][_0x2660('0xc')]({'port':0x232a});config['redis']=_[_0x2660('0xd')](config['redis'],{'host':_0x2660('0xe'),'port':0x18eb});var socket=require(_0x2660('0xf'))(new Redis(config[_0x2660('0x10')]));require(_0x2660('0x11'))['register'](socket);function respondWithRpcPromise(_0x109cef,_0x52b00d,_0x2f0309){return new BPromise(function(_0x3769b1,_0x19d1f5){return client[_0x2660('0x12')](_0x109cef,_0x2f0309)[_0x2660('0x13')](function(_0x2a5b4a){logger['info'](_0x2660('0x14'),_0x52b00d,_0x2660('0x15'));logger[_0x2660('0x16')](_0x2660('0x17'),_0x52b00d,_0x2660('0x15'),JSON[_0x2660('0x18')](_0x2a5b4a));if(_0x2a5b4a[_0x2660('0x19')]){if(_0x2a5b4a['error'][_0x2660('0x1a')]===0x1f4){logger[_0x2660('0x19')]('FaxQueue,\x20%s,\x20%s',_0x52b00d,_0x2a5b4a[_0x2660('0x19')]['message']);return _0x19d1f5(_0x2a5b4a[_0x2660('0x19')][_0x2660('0x1b')]);}logger['error'](_0x2660('0x14'),_0x52b00d,_0x2a5b4a[_0x2660('0x19')][_0x2660('0x1b')]);return _0x3769b1(_0x2a5b4a['error'][_0x2660('0x1b')]);}else{logger['info'](_0x2660('0x14'),_0x52b00d,'request\x20sent');_0x3769b1(_0x2a5b4a[_0x2660('0x1c')]['message']);}})[_0x2660('0x1d')](function(_0x390f1a){logger['error'](_0x2660('0x14'),_0x52b00d,_0x390f1a);_0x19d1f5(_0x390f1a);});});}exports[_0x2660('0x1e')]=function(_0x302680){var _0x3661ab=this;return new Promise(function(_0x3b362e,_0x7994c6){return db[_0x2660('0x1f')][_0x2660('0x20')]({'raw':_0x302680[_0x2660('0x21')]?_0x302680[_0x2660('0x21')][_0x2660('0x22')]===undefined?!![]:![]:!![],'where':_0x302680['options']?_0x302680[_0x2660('0x21')][_0x2660('0x23')]||null:null,'attributes':_0x302680[_0x2660('0x21')]?_0x302680[_0x2660('0x21')]['attributes']||null:null,'limit':_0x302680[_0x2660('0x21')]?_0x302680['options'][_0x2660('0x24')]||null:null,'include':_0x302680[_0x2660('0x21')]?_0x302680['options']['include']?_[_0x2660('0x25')](_0x302680['options'][_0x2660('0x26')],function(_0x13b35b){return{'model':db[_0x13b35b[_0x2660('0x27')]],'as':_0x13b35b['as'],'attributes':_0x13b35b[_0x2660('0x28')],'include':_0x13b35b[_0x2660('0x26')]?_[_0x2660('0x25')](_0x13b35b[_0x2660('0x26')],function(_0x3e62b5){return{'model':db[_0x3e62b5[_0x2660('0x27')]],'as':_0x3e62b5['as'],'attributes':_0x3e62b5[_0x2660('0x28')],'include':_0x3e62b5['include']?_[_0x2660('0x25')](_0x3e62b5[_0x2660('0x26')],function(_0x1a325e){return{'model':db[_0x1a325e['model']],'as':_0x1a325e['as'],'attributes':_0x1a325e['attributes']};}):[]};}):[]};}):[]:[]})[_0x2660('0x13')](function(_0x37b064){logger[_0x2660('0x29')](_0x2660('0x1e'),_0x302680);logger['debug']('GetFaxQueue',_0x302680,JSON['stringify'](_0x37b064));_0x3b362e(_0x37b064);})[_0x2660('0x1d')](function(_0x479b0c){logger['error'](_0x2660('0x1e'),_0x479b0c[_0x2660('0x1b')],_0x302680);_0x7994c6(_0x3661ab[_0x2660('0x19')](0x1f4,_0x479b0c[_0x2660('0x1b')]));});});};exports[_0x2660('0x2a')]=function(_0x33a9d6){var _0x283ed6=this;return new Promise(function(_0x58ac04,_0x24bf34){return db['FaxQueue'][_0x2660('0x2b')]({'raw':_0x33a9d6[_0x2660('0x21')]?_0x33a9d6[_0x2660('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x33a9d6[_0x2660('0x21')]?_0x33a9d6[_0x2660('0x21')][_0x2660('0x23')]||null:null,'attributes':_0x33a9d6['options']?_0x33a9d6[_0x2660('0x21')][_0x2660('0x28')]||null:null,'include':_0x33a9d6[_0x2660('0x21')]?_0x33a9d6[_0x2660('0x21')][_0x2660('0x26')]?_[_0x2660('0x25')](_0x33a9d6[_0x2660('0x21')][_0x2660('0x26')],function(_0x13b622){return{'model':db[_0x13b622[_0x2660('0x27')]],'as':_0x13b622['as'],'attributes':_0x13b622['attributes'],'include':_0x13b622[_0x2660('0x26')]?_[_0x2660('0x25')](_0x13b622['include'],function(_0x40da4d){return{'model':db[_0x40da4d[_0x2660('0x27')]],'as':_0x40da4d['as'],'attributes':_0x40da4d[_0x2660('0x28')],'include':_0x40da4d[_0x2660('0x26')]?_['map'](_0x40da4d[_0x2660('0x26')],function(_0x2bf121){return{'model':db[_0x2bf121['model']],'as':_0x2bf121['as'],'attributes':_0x2bf121[_0x2660('0x28')]};}):[]};}):[]};}):[]:[]})[_0x2660('0x13')](function(_0x5630da){logger['info'](_0x2660('0x2a'),_0x33a9d6);logger['debug'](_0x2660('0x2a'),_0x33a9d6,JSON[_0x2660('0x18')](_0x5630da));_0x58ac04(_0x5630da);})[_0x2660('0x1d')](function(_0x19a2a8){logger[_0x2660('0x19')](_0x2660('0x2a'),_0x19a2a8[_0x2660('0x1b')],_0x33a9d6);_0x24bf34(_0x283ed6[_0x2660('0x19')](0x1f4,_0x19a2a8[_0x2660('0x1b')]));});});}; \ No newline at end of file +var _0x80de=['limit','include','map','model','ShowFaxQueue','find','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','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','where','attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x80de,0x12d));var _0xe80d=function(_0x1bee26,_0x24cfdc){_0x1bee26=_0x1bee26-0x0;var _0x418d96=_0x80de[_0x1bee26];return _0x418d96;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe80d('0x0'));var BPromise=require(_0xe80d('0x1'));var rs=require(_0xe80d('0x2'));var fs=require('fs');var Redis=require(_0xe80d('0x3'));var db=require(_0xe80d('0x4'))['db'];var utils=require(_0xe80d('0x5'));var logger=require(_0xe80d('0x6'))(_0xe80d('0x7'));var config=require(_0xe80d('0x8'));var jayson=require(_0xe80d('0x9'));var client=jayson[_0xe80d('0xa')][_0xe80d('0xb')]({'port':0x232a});config[_0xe80d('0xc')]=_[_0xe80d('0xd')](config['redis'],{'host':_0xe80d('0xe'),'port':0x18eb});var socket=require(_0xe80d('0xf'))(new Redis(config[_0xe80d('0xc')]));require(_0xe80d('0x10'))[_0xe80d('0x11')](socket);function respondWithRpcPromise(_0x392ccc,_0x320ca5,_0x24bb10){return new BPromise(function(_0x45e882,_0x3392e8){return client[_0xe80d('0x12')](_0x392ccc,_0x24bb10)[_0xe80d('0x13')](function(_0x348538){logger[_0xe80d('0x14')](_0xe80d('0x15'),_0x320ca5,_0xe80d('0x16'));logger[_0xe80d('0x17')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x320ca5,'request\x20sent',JSON[_0xe80d('0x18')](_0x348538));if(_0x348538[_0xe80d('0x19')]){if(_0x348538[_0xe80d('0x19')][_0xe80d('0x1a')]===0x1f4){logger[_0xe80d('0x19')](_0xe80d('0x15'),_0x320ca5,_0x348538['error'][_0xe80d('0x1b')]);return _0x3392e8(_0x348538[_0xe80d('0x19')][_0xe80d('0x1b')]);}logger[_0xe80d('0x19')](_0xe80d('0x15'),_0x320ca5,_0x348538[_0xe80d('0x19')]['message']);return _0x45e882(_0x348538[_0xe80d('0x19')][_0xe80d('0x1b')]);}else{logger[_0xe80d('0x14')](_0xe80d('0x15'),_0x320ca5,_0xe80d('0x16'));_0x45e882(_0x348538[_0xe80d('0x1c')][_0xe80d('0x1b')]);}})[_0xe80d('0x1d')](function(_0x39dec4){logger['error'](_0xe80d('0x15'),_0x320ca5,_0x39dec4);_0x3392e8(_0x39dec4);});});}exports[_0xe80d('0x1e')]=function(_0x184d96){var _0x725efc=this;return new Promise(function(_0x119d96,_0x267cd2){return db[_0xe80d('0x1f')]['findAll']({'raw':_0x184d96[_0xe80d('0x20')]?_0x184d96[_0xe80d('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x184d96[_0xe80d('0x20')]?_0x184d96[_0xe80d('0x20')][_0xe80d('0x21')]||null:null,'attributes':_0x184d96[_0xe80d('0x20')]?_0x184d96[_0xe80d('0x20')][_0xe80d('0x22')]||null:null,'limit':_0x184d96[_0xe80d('0x20')]?_0x184d96[_0xe80d('0x20')][_0xe80d('0x23')]||null:null,'include':_0x184d96['options']?_0x184d96['options'][_0xe80d('0x24')]?_[_0xe80d('0x25')](_0x184d96[_0xe80d('0x20')][_0xe80d('0x24')],function(_0x97dc6c){return{'model':db[_0x97dc6c['model']],'as':_0x97dc6c['as'],'attributes':_0x97dc6c['attributes'],'include':_0x97dc6c[_0xe80d('0x24')]?_[_0xe80d('0x25')](_0x97dc6c['include'],function(_0x2fe44e){return{'model':db[_0x2fe44e['model']],'as':_0x2fe44e['as'],'attributes':_0x2fe44e['attributes'],'include':_0x2fe44e[_0xe80d('0x24')]?_['map'](_0x2fe44e[_0xe80d('0x24')],function(_0x1b9114){return{'model':db[_0x1b9114[_0xe80d('0x26')]],'as':_0x1b9114['as'],'attributes':_0x1b9114[_0xe80d('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe80d('0x13')](function(_0x1f3143){logger[_0xe80d('0x14')](_0xe80d('0x1e'),_0x184d96);logger[_0xe80d('0x17')](_0xe80d('0x1e'),_0x184d96,JSON[_0xe80d('0x18')](_0x1f3143));_0x119d96(_0x1f3143);})[_0xe80d('0x1d')](function(_0x53c0b1){logger[_0xe80d('0x19')]('GetFaxQueue',_0x53c0b1[_0xe80d('0x1b')],_0x184d96);_0x267cd2(_0x725efc[_0xe80d('0x19')](0x1f4,_0x53c0b1[_0xe80d('0x1b')]));});});};exports[_0xe80d('0x27')]=function(_0x2802c4){var _0x3666ea=this;return new Promise(function(_0x1ecfcc,_0x4bfb6e){return db[_0xe80d('0x1f')][_0xe80d('0x28')]({'raw':_0x2802c4[_0xe80d('0x20')]?_0x2802c4[_0xe80d('0x20')][_0xe80d('0x29')]===undefined?!![]:![]:!![],'where':_0x2802c4[_0xe80d('0x20')]?_0x2802c4[_0xe80d('0x20')][_0xe80d('0x21')]||null:null,'attributes':_0x2802c4[_0xe80d('0x20')]?_0x2802c4[_0xe80d('0x20')][_0xe80d('0x22')]||null:null,'include':_0x2802c4['options']?_0x2802c4[_0xe80d('0x20')][_0xe80d('0x24')]?_[_0xe80d('0x25')](_0x2802c4[_0xe80d('0x20')]['include'],function(_0x1b6a65){return{'model':db[_0x1b6a65[_0xe80d('0x26')]],'as':_0x1b6a65['as'],'attributes':_0x1b6a65['attributes'],'include':_0x1b6a65[_0xe80d('0x24')]?_[_0xe80d('0x25')](_0x1b6a65[_0xe80d('0x24')],function(_0x1ea3c3){return{'model':db[_0x1ea3c3[_0xe80d('0x26')]],'as':_0x1ea3c3['as'],'attributes':_0x1ea3c3['attributes'],'include':_0x1ea3c3[_0xe80d('0x24')]?_[_0xe80d('0x25')](_0x1ea3c3[_0xe80d('0x24')],function(_0x200fd7){return{'model':db[_0x200fd7[_0xe80d('0x26')]],'as':_0x200fd7['as'],'attributes':_0x200fd7['attributes']};}):[]};}):[]};}):[]:[]})[_0xe80d('0x13')](function(_0x173fa2){logger[_0xe80d('0x14')](_0xe80d('0x27'),_0x2802c4);logger[_0xe80d('0x17')]('ShowFaxQueue',_0x2802c4,JSON[_0xe80d('0x18')](_0x173fa2));_0x1ecfcc(_0x173fa2);})[_0xe80d('0x1d')](function(_0x2fd309){logger['error'](_0xe80d('0x27'),_0x2fd309[_0xe80d('0x1b')],_0x2802c4);_0x4bfb6e(_0x3666ea['error'](0x1f4,_0x2fd309[_0xe80d('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index cdf3789..a2539fb 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 _0xa9f6=['./faxQueue.events','save','remove','update','emit','removeListener','length','faxQueue:'];(function(_0x472c4e,_0x889f6a){var _0x5ab82e=function(_0x11b003){while(--_0x11b003){_0x472c4e['push'](_0x472c4e['shift']());}};_0x5ab82e(++_0x889f6a);}(_0xa9f6,0x198));var _0x6a9f=function(_0x4e6df7,_0x4483fe){_0x4e6df7=_0x4e6df7-0x0;var _0x41cc0a=_0xa9f6[_0x4e6df7];return _0x41cc0a;};'use strict';var FaxQueueEvents=require(_0x6a9f('0x0'));var events=[_0x6a9f('0x1'),_0x6a9f('0x2'),_0x6a9f('0x3')];function createListener(_0x3c9a47,_0x3f0b07){return function(_0x32d6d){_0x3f0b07[_0x6a9f('0x4')](_0x3c9a47,_0x32d6d);};}function removeListener(_0xb04c46,_0x371c90){return function(){FaxQueueEvents[_0x6a9f('0x5')](_0xb04c46,_0x371c90);};}exports['register']=function(_0x4afc54){for(var _0x257a41=0x0,_0x2108ab=events[_0x6a9f('0x6')];_0x257a41<_0x2108ab;_0x257a41++){var _0x134f9c=events[_0x257a41];var _0x59292a=createListener(_0x6a9f('0x7')+_0x134f9c,_0x4afc54);FaxQueueEvents['on'](_0x134f9c,_0x59292a);}}; \ No newline at end of file +var _0x8bbf=['emit','removeListener','length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0x8bbf,0x184));var _0xf8bb=function(_0x223097,_0x3de0a8){_0x223097=_0x223097-0x0;var _0x144b40=_0x8bbf[_0x223097];return _0x144b40;};'use strict';var FaxQueueEvents=require(_0xf8bb('0x0'));var events=[_0xf8bb('0x1'),_0xf8bb('0x2'),_0xf8bb('0x3')];function createListener(_0x51aa74,_0x5248db){return function(_0x285f42){_0x5248db[_0xf8bb('0x4')](_0x51aa74,_0x285f42);};}function removeListener(_0x2bd69e,_0x377ab9){return function(){FaxQueueEvents[_0xf8bb('0x5')](_0x2bd69e,_0x377ab9);};}exports['register']=function(_0x2f140b){for(var _0x34387d=0x0,_0x8ca2ab=events[_0xf8bb('0x6')];_0x34387d<_0x8ca2ab;_0x34387d++){var _0x22143f=events[_0x34387d];var _0x183f5c=createListener(_0xf8bb('0x7')+_0x22143f,_0x2f140b);FaxQueueEvents['on'](_0x22143f,_0x183f5c);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 8926b75..6b853db 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 _0x6b1b=['../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','delete','/:id','destroy','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x6b1b[_0x1fc122];return _0xa2cb13;};'use strict';var multer=require('multer');var util=require(_0xb6b1('0x0'));var path=require(_0xb6b1('0x1'));var timeout=require(_0xb6b1('0x2'));var express=require('express');var router=express[_0xb6b1('0x3')]();var fs_extra=require(_0xb6b1('0x4'));var auth=require(_0xb6b1('0x5'));var interaction=require(_0xb6b1('0x6'));var config=require(_0xb6b1('0x7'));var controller=require(_0xb6b1('0x8'));router[_0xb6b1('0x9')]('/',auth[_0xb6b1('0xa')](),controller[_0xb6b1('0xb')]);router[_0xb6b1('0x9')](_0xb6b1('0xc'),auth['isAuthenticated'](),controller[_0xb6b1('0xd')]);router['get']('/:id',auth[_0xb6b1('0xa')](),controller['show']);router[_0xb6b1('0x9')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router['get'](_0xb6b1('0xe'),auth[_0xb6b1('0xa')](),controller['getTeams']);router[_0xb6b1('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xb6b1('0xf')]);router[_0xb6b1('0x10')]('/',auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x11')]);router[_0xb6b1('0x10')](_0xb6b1('0xe'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x12')]);router[_0xb6b1('0x10')](_0xb6b1('0x13'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb6b1('0x15')](_0xb6b1('0x16'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x17')]);router[_0xb6b1('0x15')](_0xb6b1('0xe'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xb6b1('0x15')](_0xb6b1('0x13'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x18')]);module[_0xb6b1('0x19')]=router; \ No newline at end of file +var _0x4888=['/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index'];(function(_0xa94b29,_0x5688df){var _0x18f8a7=function(_0x29a16f){while(--_0x29a16f){_0xa94b29['push'](_0xa94b29['shift']());}};_0x18f8a7(++_0x5688df);}(_0x4888,0x198));var _0x8488=function(_0x21b36c,_0x543483){_0x21b36c=_0x21b36c-0x0;var _0x236627=_0x4888[_0x21b36c];return _0x236627;};'use strict';var multer=require('multer');var util=require(_0x8488('0x0'));var path=require(_0x8488('0x1'));var timeout=require(_0x8488('0x2'));var express=require(_0x8488('0x3'));var router=express[_0x8488('0x4')]();var fs_extra=require(_0x8488('0x5'));var auth=require(_0x8488('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8488('0x7'));var controller=require(_0x8488('0x8'));router[_0x8488('0x9')]('/',auth[_0x8488('0xa')](),controller[_0x8488('0xb')]);router[_0x8488('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x8488('0xc'),auth[_0x8488('0xa')](),controller['show']);router[_0x8488('0x9')](_0x8488('0xd'),auth[_0x8488('0xa')](),controller[_0x8488('0xe')]);router['get'](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x10')]);router[_0x8488('0x9')](_0x8488('0x11'),auth['isAuthenticated'](),controller[_0x8488('0x12')]);router[_0x8488('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8488('0x13')]('/:id/teams',auth[_0x8488('0xa')](),controller['addTeams']);router['post'](_0x8488('0x11'),auth[_0x8488('0xa')](),controller[_0x8488('0x14')]);router[_0x8488('0x15')](_0x8488('0xc'),auth[_0x8488('0xa')](),controller[_0x8488('0x16')]);router['delete'](_0x8488('0xc'),auth[_0x8488('0xa')](),controller[_0x8488('0x17')]);router[_0x8488('0x18')](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x19')]);router[_0x8488('0x18')](_0x8488('0x11'),auth[_0x8488('0xa')](),controller[_0x8488('0x1a')]);module[_0x8488('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 0aff256..fea1589 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 _0x8d56=['DATE','moment','sequelize','exports','STRING'];(function(_0x41b29e,_0x34b288){var _0xacd517=function(_0x3318df){while(--_0x3318df){_0x41b29e['push'](_0x41b29e['shift']());}};_0xacd517(++_0x34b288);}(_0x8d56,0x1c3));var _0x68d5=function(_0x4f34d8,_0x40f022){_0x4f34d8=_0x4f34d8-0x0;var _0xc97536=_0x8d56[_0x4f34d8];return _0xc97536;};'use strict';var moment=require(_0x68d5('0x0'));var Sequelize=require(_0x68d5('0x1'));module[_0x68d5('0x2')]={'uniqueid':{'type':Sequelize[_0x68d5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x68d5('0x3')]},'joinAt':{'type':Sequelize[_0x68d5('0x4')]},'leaveAt':{'type':Sequelize[_0x68d5('0x4')]},'acceptAt':{'type':Sequelize[_0x68d5('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x68d5('0x3')]}}; \ No newline at end of file +var _0x82a7=['sequelize','exports','STRING','DATE'];(function(_0xb28d42,_0x36eeaf){var _0x496af2=function(_0x36e26f){while(--_0x36e26f){_0xb28d42['push'](_0xb28d42['shift']());}};_0x496af2(++_0x36eeaf);}(_0x82a7,0x1c4));var _0x782a=function(_0x5d6f2d,_0x40c854){_0x5d6f2d=_0x5d6f2d-0x0;var _0x2df10b=_0x82a7[_0x5d6f2d];return _0x2df10b;};'use strict';var moment=require('moment');var Sequelize=require(_0x782a('0x0'));module[_0x782a('0x1')]={'uniqueid':{'type':Sequelize[_0x782a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x782a('0x2')]},'joinAt':{'type':Sequelize[_0x782a('0x3')]},'leaveAt':{'type':Sequelize[_0x782a('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x782a('0x3')]},'reason':{'type':Sequelize[_0x782a('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 4a8187d..a2f880e 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 _0x22dd=['findAll','catch','params','attributes','include','find','create','body','destroy','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','offset','set','Content-Range','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','FaxQueueReport','count','includeAll'];(function(_0x67143c,_0x433024){var _0x1dbbc3=function(_0x35a77f){while(--_0x35a77f){_0x67143c['push'](_0x67143c['shift']());}};_0x1dbbc3(++_0x433024);}(_0x22dd,0xe4));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd22d('0x0'));var rimraf=require(_0xd22d('0x1'));var zipdir=require(_0xd22d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd22d('0x3'));var BPromise=require(_0xd22d('0x4'));var Mustache=require(_0xd22d('0x5'));var util=require(_0xd22d('0x6'));var path=require(_0xd22d('0x7'));var sox=require(_0xd22d('0x8'));var csv=require(_0xd22d('0x9'));var ejs=require(_0xd22d('0xa'));var fs=require('fs');var fs_extra=require(_0xd22d('0xb'));var _=require(_0xd22d('0xc'));var squel=require('squel');var crypto=require(_0xd22d('0xd'));var jsforce=require(_0xd22d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd22d('0x9'));var querystring=require('querystring');var Papa=require(_0xd22d('0xf'));var Redis=require('ioredis');var authService=require(_0xd22d('0x10'));var qs=require(_0xd22d('0x11'));var as=require(_0xd22d('0x12'));var hardwareService=require(_0xd22d('0x13'));var logger=require(_0xd22d('0x14'))(_0xd22d('0x15'));var utils=require(_0xd22d('0x16'));var config=require(_0xd22d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd22d('0x18'))['db'];function respondWithStatusCode(_0x46f164,_0x51a8ea){_0x51a8ea=_0x51a8ea||0xcc;return function(_0x38978b){if(_0x38978b){return _0x46f164[_0xd22d('0x19')](_0x51a8ea);}return _0x46f164['status'](_0x51a8ea)['end']();};}function respondWithResult(_0x5994fe,_0x156546){_0x156546=_0x156546||0xc8;return function(_0x5dc338){if(_0x5dc338){return _0x5994fe[_0xd22d('0x1a')](_0x156546)['json'](_0x5dc338);}};}function respondWithFilteredResult(_0x78d93e,_0x5b91bd){return function(_0x5027d){if(_0x5027d){var _0x377e75=typeof _0x5b91bd['offset']===_0xd22d('0x1b')&&typeof _0x5b91bd[_0xd22d('0x1c')]===_0xd22d('0x1b');var _0x11c410=_0x5027d['count'];var _0x5c516a=_0x377e75?0x0:_0x5b91bd[_0xd22d('0x1d')];var _0x5a0a0b=_0x377e75?_0x5027d['count']:_0x5b91bd['offset']+_0x5b91bd[_0xd22d('0x1c')];var _0x46f8b6;if(_0x5a0a0b>=_0x11c410){_0x5a0a0b=_0x11c410;_0x46f8b6=0xc8;}else{_0x46f8b6=0xce;}_0x78d93e[_0xd22d('0x1a')](_0x46f8b6);return _0x78d93e[_0xd22d('0x1e')](_0xd22d('0x1f'),_0x5c516a+'-'+_0x5a0a0b+'/'+_0x11c410)['json'](_0x5027d);}return null;};}function patchUpdates(_0x2bfc84){return function(_0x4e18f5){try{jsonpatch['apply'](_0x4e18f5,_0x2bfc84,!![]);}catch(_0x478c1f){return BPromise[_0xd22d('0x20')](_0x478c1f);}return _0x4e18f5[_0xd22d('0x21')]();};}function saveUpdates(_0x1ecab6,_0x420836){return function(_0x1be46f){if(_0x1be46f){return _0x1be46f[_0xd22d('0x22')](_0x1ecab6)[_0xd22d('0x23')](function(_0x52039a){return _0x52039a;});}return null;};}function removeEntity(_0x3b07b3,_0x8340e5){return function(_0x55bce9){if(_0x55bce9){return _0x55bce9['destroy']()[_0xd22d('0x23')](function(){_0x3b07b3[_0xd22d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b0959,_0x370902){return function(_0xee8f2){if(!_0xee8f2){_0x2b0959[_0xd22d('0x19')](0x194);}return _0xee8f2;};}function handleError(_0x2b47c2,_0x2c7b5a){_0x2c7b5a=_0x2c7b5a||0x1f4;return function(_0x2d45ab){logger[_0xd22d('0x24')](_0x2d45ab[_0xd22d('0x25')]);if(_0x2d45ab['name']){delete _0x2d45ab[_0xd22d('0x26')];}_0x2b47c2[_0xd22d('0x1a')](_0x2c7b5a)['send'](_0x2d45ab);};}exports[_0xd22d('0x27')]=function(_0x5f00f9,_0x5381a8){var _0x2d377d={},_0x96a17e={},_0xb3e1f2={'count':0x0,'rows':[]};var _0x16b1c7=_[_0xd22d('0x28')](db['FaxQueueReport'][_0xd22d('0x29')],function(_0x5b47f9){return{'name':_0x5b47f9[_0xd22d('0x2a')],'type':_0x5b47f9[_0xd22d('0x2b')][_0xd22d('0x2c')]};});_0x96a17e[_0xd22d('0x2d')]=_[_0xd22d('0x28')](_0x16b1c7,'name');_0x96a17e[_0xd22d('0x2e')]=_[_0xd22d('0x2f')](_0x5f00f9['query']);_0x96a17e[_0xd22d('0x30')]=_['intersection'](_0x96a17e[_0xd22d('0x2d')],_0x96a17e[_0xd22d('0x2e')]);_0x2d377d['attributes']=_[_0xd22d('0x31')](_0x96a17e[_0xd22d('0x2d')],qs[_0xd22d('0x32')](_0x5f00f9['query'][_0xd22d('0x32')]));_0x2d377d['attributes']=_0x2d377d['attributes'][_0xd22d('0x33')]?_0x2d377d['attributes']:_0x96a17e[_0xd22d('0x2d')];if(!_0x5f00f9['query'][_0xd22d('0x34')](_0xd22d('0x35'))){_0x2d377d['limit']=qs['limit'](_0x5f00f9[_0xd22d('0x2e')][_0xd22d('0x1c')]);_0x2d377d[_0xd22d('0x1d')]=qs[_0xd22d('0x1d')](_0x5f00f9[_0xd22d('0x2e')][_0xd22d('0x1d')]);}_0x2d377d[_0xd22d('0x36')]=qs['sort'](_0x5f00f9['query'][_0xd22d('0x37')]);_0x2d377d[_0xd22d('0x38')]=qs['filters'](_[_0xd22d('0x39')](_0x5f00f9[_0xd22d('0x2e')],_0x96a17e['filters']),_0x16b1c7);if(_0x5f00f9['query']['filter']){_0x2d377d[_0xd22d('0x38')]=_[_0xd22d('0x3a')](_0x2d377d[_0xd22d('0x38')],{'$or':_['map'](_0x16b1c7,function(_0x3d9dfa){if(_0x3d9dfa['type']!=='VIRTUAL'){var _0x1ad490={};_0x1ad490[_0x3d9dfa[_0xd22d('0x26')]]={'$like':'%'+_0x5f00f9['query'][_0xd22d('0x3b')]+'%'};return _0x1ad490;}})});}_0x2d377d=_[_0xd22d('0x3a')]({},_0x2d377d,_0x5f00f9[_0xd22d('0x3c')]);var _0x5c1876={'where':_0x2d377d[_0xd22d('0x38')]};return db[_0xd22d('0x3d')][_0xd22d('0x3e')](_0x5c1876)[_0xd22d('0x23')](function(_0x332830){_0xb3e1f2[_0xd22d('0x3e')]=_0x332830;if(_0x5f00f9[_0xd22d('0x2e')][_0xd22d('0x3f')]){_0x2d377d['include']=[{'all':!![]}];}return db[_0xd22d('0x3d')][_0xd22d('0x40')](_0x2d377d);})[_0xd22d('0x23')](function(_0x1c5007){_0xb3e1f2['rows']=_0x1c5007;return _0xb3e1f2;})[_0xd22d('0x23')](respondWithFilteredResult(_0x5381a8,_0x2d377d))[_0xd22d('0x41')](handleError(_0x5381a8,null));};exports['show']=function(_0x1dea34,_0x360026){var _0x111e84={'raw':!![],'where':{'id':_0x1dea34[_0xd22d('0x42')]['id']}},_0x9ecd41={};_0x9ecd41[_0xd22d('0x2d')]=_[_0xd22d('0x2f')](db['FaxQueueReport'][_0xd22d('0x29')]);_0x9ecd41['query']=_[_0xd22d('0x2f')](_0x1dea34[_0xd22d('0x2e')]);_0x9ecd41[_0xd22d('0x30')]=_[_0xd22d('0x31')](_0x9ecd41['model'],_0x9ecd41[_0xd22d('0x2e')]);_0x111e84[_0xd22d('0x43')]=_['intersection'](_0x9ecd41[_0xd22d('0x2d')],qs[_0xd22d('0x32')](_0x1dea34[_0xd22d('0x2e')]['fields']));_0x111e84[_0xd22d('0x43')]=_0x111e84[_0xd22d('0x43')][_0xd22d('0x33')]?_0x111e84[_0xd22d('0x43')]:_0x9ecd41[_0xd22d('0x2d')];if(_0x1dea34['query'][_0xd22d('0x3f')]){_0x111e84[_0xd22d('0x44')]=[{'all':!![]}];}_0x111e84=_[_0xd22d('0x3a')]({},_0x111e84,_0x1dea34[_0xd22d('0x3c')]);return db[_0xd22d('0x3d')][_0xd22d('0x45')](_0x111e84)[_0xd22d('0x23')](handleEntityNotFound(_0x360026,null))['then'](respondWithResult(_0x360026,null))[_0xd22d('0x41')](handleError(_0x360026,null));};exports[_0xd22d('0x46')]=function(_0x2cbd41,_0x1ec1ec){return db[_0xd22d('0x3d')]['create'](_0x2cbd41[_0xd22d('0x47')],{})[_0xd22d('0x23')](respondWithResult(_0x1ec1ec,0xc9))[_0xd22d('0x41')](handleError(_0x1ec1ec,null));};exports[_0xd22d('0x22')]=function(_0x1ac8e9,_0x1330c1){if(_0x1ac8e9[_0xd22d('0x47')]['id']){delete _0x1ac8e9['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x1ac8e9[_0xd22d('0x42')]['id']}})[_0xd22d('0x23')](handleEntityNotFound(_0x1330c1,null))['then'](saveUpdates(_0x1ac8e9[_0xd22d('0x47')],null))[_0xd22d('0x23')](respondWithResult(_0x1330c1,null))[_0xd22d('0x41')](handleError(_0x1330c1,null));};exports[_0xd22d('0x48')]=function(_0x125b86,_0x463384){return db['FaxQueueReport'][_0xd22d('0x45')]({'where':{'id':_0x125b86['params']['id']}})[_0xd22d('0x23')](handleEntityNotFound(_0x463384,null))[_0xd22d('0x23')](removeEntity(_0x463384,null))[_0xd22d('0x41')](handleError(_0x463384,null));};exports['describe']=function(_0x2f0375,_0x43df58){return db['FaxQueueReport']['describe']()[_0xd22d('0x23')](respondWithResult(_0x43df58,null))[_0xd22d('0x41')](handleError(_0x43df58,null));}; \ No newline at end of file +var _0x8b29=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','limit','undefined','count','offset','status','set','json','reject','then','error','name','index','FaxQueueReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','keys','find','create','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8b29,0xbe));var _0x98b2=function(_0x57d087,_0x159ee9){_0x57d087=_0x57d087-0x0;var _0x697c20=_0x8b29[_0x57d087];return _0x697c20;};'use strict';var emlformat=require(_0x98b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x98b2('0x1'));var jsonpatch=require(_0x98b2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x98b2('0x3'));var Mustache=require(_0x98b2('0x4'));var util=require('util');var path=require(_0x98b2('0x5'));var sox=require('sox');var csv=require(_0x98b2('0x6'));var ejs=require(_0x98b2('0x7'));var fs=require('fs');var fs_extra=require(_0x98b2('0x8'));var _=require(_0x98b2('0x9'));var squel=require(_0x98b2('0xa'));var crypto=require(_0x98b2('0xb'));var jsforce=require(_0x98b2('0xc'));var deskjs=require(_0x98b2('0xd'));var toCsv=require(_0x98b2('0x6'));var querystring=require(_0x98b2('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x98b2('0xf'));var qs=require(_0x98b2('0x10'));var as=require(_0x98b2('0x11'));var hardwareService=require(_0x98b2('0x12'));var logger=require(_0x98b2('0x13'))(_0x98b2('0x14'));var utils=require('../../config/utils');var config=require(_0x98b2('0x15'));var licenseUtil=require(_0x98b2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27865e,_0x1180fe){_0x1180fe=_0x1180fe||0xcc;return function(_0x2a6337){if(_0x2a6337){return _0x27865e['sendStatus'](_0x1180fe);}return _0x27865e['status'](_0x1180fe)[_0x98b2('0x17')]();};}function respondWithResult(_0x56bcbd,_0x2966e2){_0x2966e2=_0x2966e2||0xc8;return function(_0x49b151){if(_0x49b151){return _0x56bcbd['status'](_0x2966e2)['json'](_0x49b151);}};}function respondWithFilteredResult(_0x831ee8,_0x413464){return function(_0xe49e9a){if(_0xe49e9a){var _0x5ecea1=typeof _0x413464['offset']==='undefined'&&typeof _0x413464[_0x98b2('0x18')]===_0x98b2('0x19');var _0x145d65=_0xe49e9a[_0x98b2('0x1a')];var _0x4b9f2c=_0x5ecea1?0x0:_0x413464[_0x98b2('0x1b')];var _0x588837=_0x5ecea1?_0xe49e9a[_0x98b2('0x1a')]:_0x413464['offset']+_0x413464[_0x98b2('0x18')];var _0x1dfc04;if(_0x588837>=_0x145d65){_0x588837=_0x145d65;_0x1dfc04=0xc8;}else{_0x1dfc04=0xce;}_0x831ee8[_0x98b2('0x1c')](_0x1dfc04);return _0x831ee8[_0x98b2('0x1d')]('Content-Range',_0x4b9f2c+'-'+_0x588837+'/'+_0x145d65)[_0x98b2('0x1e')](_0xe49e9a);}return null;};}function patchUpdates(_0x242cbd){return function(_0x5dfdf7){try{jsonpatch['apply'](_0x5dfdf7,_0x242cbd,!![]);}catch(_0x5d6b38){return BPromise[_0x98b2('0x1f')](_0x5d6b38);}return _0x5dfdf7['save']();};}function saveUpdates(_0x4ddded,_0x3796c0){return function(_0x37fc18){if(_0x37fc18){return _0x37fc18['update'](_0x4ddded)[_0x98b2('0x20')](function(_0x13d149){return _0x13d149;});}return null;};}function removeEntity(_0xfae112,_0x4f33d8){return function(_0x2a5587){if(_0x2a5587){return _0x2a5587['destroy']()[_0x98b2('0x20')](function(){_0xfae112['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x7b6ebc,_0xe99d27){return function(_0x5fcd00){if(!_0x5fcd00){_0x7b6ebc['sendStatus'](0x194);}return _0x5fcd00;};}function handleError(_0x4f1e1b,_0x50c699){_0x50c699=_0x50c699||0x1f4;return function(_0x11c6aa){logger[_0x98b2('0x21')](_0x11c6aa['stack']);if(_0x11c6aa[_0x98b2('0x22')]){delete _0x11c6aa[_0x98b2('0x22')];}_0x4f1e1b[_0x98b2('0x1c')](_0x50c699)['send'](_0x11c6aa);};}exports[_0x98b2('0x23')]=function(_0x1dee11,_0x1f1c55){var _0xb4c6c4={},_0x25393d={},_0x5dd95f={'count':0x0,'rows':[]};var _0x23883f=_['map'](db[_0x98b2('0x24')][_0x98b2('0x25')],function(_0x4d197c){return{'name':_0x4d197c[_0x98b2('0x26')],'type':_0x4d197c[_0x98b2('0x27')]['key']};});_0x25393d[_0x98b2('0x28')]=_[_0x98b2('0x29')](_0x23883f,_0x98b2('0x22'));_0x25393d[_0x98b2('0x2a')]=_['keys'](_0x1dee11['query']);_0x25393d[_0x98b2('0x2b')]=_[_0x98b2('0x2c')](_0x25393d[_0x98b2('0x28')],_0x25393d[_0x98b2('0x2a')]);_0xb4c6c4[_0x98b2('0x2d')]=_[_0x98b2('0x2c')](_0x25393d['model'],qs[_0x98b2('0x2e')](_0x1dee11[_0x98b2('0x2a')][_0x98b2('0x2e')]));_0xb4c6c4[_0x98b2('0x2d')]=_0xb4c6c4[_0x98b2('0x2d')][_0x98b2('0x2f')]?_0xb4c6c4[_0x98b2('0x2d')]:_0x25393d[_0x98b2('0x28')];if(!_0x1dee11[_0x98b2('0x2a')][_0x98b2('0x30')](_0x98b2('0x31'))){_0xb4c6c4[_0x98b2('0x18')]=qs[_0x98b2('0x18')](_0x1dee11['query']['limit']);_0xb4c6c4[_0x98b2('0x1b')]=qs[_0x98b2('0x1b')](_0x1dee11[_0x98b2('0x2a')][_0x98b2('0x1b')]);}_0xb4c6c4[_0x98b2('0x32')]=qs[_0x98b2('0x33')](_0x1dee11['query'][_0x98b2('0x33')]);_0xb4c6c4[_0x98b2('0x34')]=qs[_0x98b2('0x2b')](_[_0x98b2('0x35')](_0x1dee11['query'],_0x25393d[_0x98b2('0x2b')]),_0x23883f);if(_0x1dee11[_0x98b2('0x2a')][_0x98b2('0x36')]){_0xb4c6c4[_0x98b2('0x34')]=_[_0x98b2('0x37')](_0xb4c6c4[_0x98b2('0x34')],{'$or':_[_0x98b2('0x29')](_0x23883f,function(_0x591ad2){if(_0x591ad2[_0x98b2('0x27')]!=='VIRTUAL'){var _0x18e14e={};_0x18e14e[_0x591ad2[_0x98b2('0x22')]]={'$like':'%'+_0x1dee11[_0x98b2('0x2a')][_0x98b2('0x36')]+'%'};return _0x18e14e;}})});}_0xb4c6c4=_['merge']({},_0xb4c6c4,_0x1dee11['options']);var _0x3d8bc7={'where':_0xb4c6c4[_0x98b2('0x34')]};return db[_0x98b2('0x24')]['count'](_0x3d8bc7)[_0x98b2('0x20')](function(_0x542a29){_0x5dd95f[_0x98b2('0x1a')]=_0x542a29;if(_0x1dee11[_0x98b2('0x2a')][_0x98b2('0x38')]){_0xb4c6c4[_0x98b2('0x39')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x98b2('0x3a')](_0xb4c6c4);})[_0x98b2('0x20')](function(_0x197749){_0x5dd95f['rows']=_0x197749;return _0x5dd95f;})[_0x98b2('0x20')](respondWithFilteredResult(_0x1f1c55,_0xb4c6c4))[_0x98b2('0x3b')](handleError(_0x1f1c55,null));};exports[_0x98b2('0x3c')]=function(_0x97f0dd,_0xbf3665){var _0x3415e9={'raw':!![],'where':{'id':_0x97f0dd[_0x98b2('0x3d')]['id']}},_0x4a6c03={};_0x4a6c03['model']=_[_0x98b2('0x3e')](db[_0x98b2('0x24')][_0x98b2('0x25')]);_0x4a6c03[_0x98b2('0x2a')]=_[_0x98b2('0x3e')](_0x97f0dd[_0x98b2('0x2a')]);_0x4a6c03[_0x98b2('0x2b')]=_[_0x98b2('0x2c')](_0x4a6c03[_0x98b2('0x28')],_0x4a6c03['query']);_0x3415e9[_0x98b2('0x2d')]=_['intersection'](_0x4a6c03[_0x98b2('0x28')],qs[_0x98b2('0x2e')](_0x97f0dd[_0x98b2('0x2a')][_0x98b2('0x2e')]));_0x3415e9[_0x98b2('0x2d')]=_0x3415e9[_0x98b2('0x2d')]['length']?_0x3415e9[_0x98b2('0x2d')]:_0x4a6c03[_0x98b2('0x28')];if(_0x97f0dd[_0x98b2('0x2a')][_0x98b2('0x38')]){_0x3415e9[_0x98b2('0x39')]=[{'all':!![]}];}_0x3415e9=_['merge']({},_0x3415e9,_0x97f0dd['options']);return db[_0x98b2('0x24')][_0x98b2('0x3f')](_0x3415e9)[_0x98b2('0x20')](handleEntityNotFound(_0xbf3665,null))[_0x98b2('0x20')](respondWithResult(_0xbf3665,null))['catch'](handleError(_0xbf3665,null));};exports['create']=function(_0x4d53c4,_0xea5f5d){return db[_0x98b2('0x24')][_0x98b2('0x40')](_0x4d53c4[_0x98b2('0x41')],{})[_0x98b2('0x20')](respondWithResult(_0xea5f5d,0xc9))[_0x98b2('0x3b')](handleError(_0xea5f5d,null));};exports[_0x98b2('0x42')]=function(_0x2b08ed,_0x3c2477){if(_0x2b08ed['body']['id']){delete _0x2b08ed[_0x98b2('0x41')]['id'];}return db['FaxQueueReport'][_0x98b2('0x3f')]({'where':{'id':_0x2b08ed[_0x98b2('0x3d')]['id']}})[_0x98b2('0x20')](handleEntityNotFound(_0x3c2477,null))[_0x98b2('0x20')](saveUpdates(_0x2b08ed['body'],null))[_0x98b2('0x20')](respondWithResult(_0x3c2477,null))[_0x98b2('0x3b')](handleError(_0x3c2477,null));};exports[_0x98b2('0x43')]=function(_0x1e13b8,_0x6ce50d){return db['FaxQueueReport'][_0x98b2('0x3f')]({'where':{'id':_0x1e13b8[_0x98b2('0x3d')]['id']}})[_0x98b2('0x20')](handleEntityNotFound(_0x6ce50d,null))[_0x98b2('0x20')](removeEntity(_0x6ce50d,null))[_0x98b2('0x3b')](handleError(_0x6ce50d,null));};exports[_0x98b2('0x44')]=function(_0x3e4b54,_0x144b62){return db[_0x98b2('0x24')][_0x98b2('0x44')]()[_0x98b2('0x20')](respondWithResult(_0x144b62,null))[_0x98b2('0x3b')](handleError(_0x144b62,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 6f3b77f..4cba4f2 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 _0x7217=['api','moment','bluebird','request-promise','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger'];(function(_0x49c824,_0x18e9be){var _0x29dc99=function(_0x1b1080){while(--_0x1b1080){_0x49c824['push'](_0x49c824['shift']());}};_0x29dc99(++_0x18e9be);}(_0x7217,0x19e));var _0x7721=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x7217[_0x34bf97];return _0x292719;};'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 +var _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x32e6d3,_0x22a43c){var _0xb71ca=function(_0xd5f2f4){while(--_0xd5f2f4){_0x32e6d3['push'](_0x32e6d3['shift']());}};_0xb71ca(++_0x22a43c);}(_0x5fab,0x177));var _0xb5fa=function(_0x52a6be,_0xe01d8d){_0x52a6be=_0x52a6be-0x0;var _0x449c4f=_0x5fab[_0x52a6be];return _0x449c4f;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 2dfbe9a..50bdbd6 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 _0xdfb5=['request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','FaxQueueReport','create','options','CreateFaxQueueReport','update','body','raw','where','attributes','limit','UpdateFaxQueueReport','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x40216e,_0x50106c){var _0x46aa0d=function(_0x1f8e4d){while(--_0x1f8e4d){_0x40216e['push'](_0x40216e['shift']());}};_0x46aa0d(++_0x50106c);}(_0xdfb5,0xfe));var _0x5dfb=function(_0x7d62b0,_0x1cada3){_0x7d62b0=_0x7d62b0-0x0;var _0x22d8be=_0xdfb5[_0x7d62b0];return _0x22d8be;};'use strict';var _=require(_0x5dfb('0x0'));var util=require(_0x5dfb('0x1'));var moment=require('moment');var BPromise=require(_0x5dfb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dfb('0x3'));var db=require(_0x5dfb('0x4'))['db'];var utils=require(_0x5dfb('0x5'));var logger=require('../../config/logger')(_0x5dfb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5dfb('0x7'));var client=jayson[_0x5dfb('0x8')][_0x5dfb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d8cc3,_0x486883,_0x12d49c){return new BPromise(function(_0x2cdcb6,_0x31ca3d){return client[_0x5dfb('0xa')](_0x4d8cc3,_0x12d49c)[_0x5dfb('0xb')](function(_0x4f6c61){logger[_0x5dfb('0xc')](_0x5dfb('0xd'),_0x486883,'request\x20sent');logger[_0x5dfb('0xe')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x486883,_0x5dfb('0xf'),JSON['stringify'](_0x4f6c61));if(_0x4f6c61[_0x5dfb('0x10')]){if(_0x4f6c61[_0x5dfb('0x10')][_0x5dfb('0x11')]===0x1f4){logger[_0x5dfb('0x10')](_0x5dfb('0xd'),_0x486883,_0x4f6c61[_0x5dfb('0x10')][_0x5dfb('0x12')]);return _0x31ca3d(_0x4f6c61[_0x5dfb('0x10')]['message']);}logger[_0x5dfb('0x10')](_0x5dfb('0xd'),_0x486883,_0x4f6c61['error'][_0x5dfb('0x12')]);return _0x2cdcb6(_0x4f6c61[_0x5dfb('0x10')]['message']);}else{logger[_0x5dfb('0xc')](_0x5dfb('0xd'),_0x486883,_0x5dfb('0xf'));_0x2cdcb6(_0x4f6c61[_0x5dfb('0x13')]['message']);}})[_0x5dfb('0x14')](function(_0x524130){logger[_0x5dfb('0x10')](_0x5dfb('0xd'),_0x486883,_0x524130);_0x31ca3d(_0x524130);});});}exports['CreateFaxQueueReport']=function(_0xe46c1a){var _0x328d52=this;return new Promise(function(_0x413f9c,_0x440be2){return db[_0x5dfb('0x15')][_0x5dfb('0x16')](_0xe46c1a['body'],{'raw':_0xe46c1a[_0x5dfb('0x17')]?_0xe46c1a[_0x5dfb('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x5dfb('0xb')](function(_0x2309b1){logger[_0x5dfb('0xc')](_0x5dfb('0x18'),_0xe46c1a);logger['debug'](_0x5dfb('0x18'),_0xe46c1a,JSON['stringify'](_0x2309b1));_0x413f9c(_0x2309b1);})[_0x5dfb('0x14')](function(_0x8b5d4a){logger['error'](_0x5dfb('0x18'),_0x8b5d4a['message'],_0xe46c1a);_0x440be2(_0x328d52[_0x5dfb('0x10')](0x1f4,_0x8b5d4a[_0x5dfb('0x12')]));});});};exports['UpdateFaxQueueReport']=function(_0x2ab3d6){var _0x203320=this;return new Promise(function(_0xcef2de,_0x38e051){return db[_0x5dfb('0x15')][_0x5dfb('0x19')](_0x2ab3d6[_0x5dfb('0x1a')],{'raw':_0x2ab3d6['options']?_0x2ab3d6['options'][_0x5dfb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab3d6[_0x5dfb('0x17')]?_0x2ab3d6[_0x5dfb('0x17')][_0x5dfb('0x1c')]||null:null,'attributes':_0x2ab3d6[_0x5dfb('0x17')]?_0x2ab3d6['options'][_0x5dfb('0x1d')]||null:null,'limit':_0x2ab3d6['options']?_0x2ab3d6[_0x5dfb('0x17')][_0x5dfb('0x1e')]||null:null})['then'](function(_0x15e85d){logger['info'](_0x5dfb('0x1f'),_0x2ab3d6);logger[_0x5dfb('0xe')](_0x5dfb('0x1f'),_0x2ab3d6,JSON[_0x5dfb('0x20')](_0x15e85d));_0xcef2de(_0x15e85d);})[_0x5dfb('0x14')](function(_0x1a331a){logger[_0x5dfb('0x10')]('UpdateFaxQueueReport',_0x1a331a['message'],_0x2ab3d6);_0x38e051(_0x203320[_0x5dfb('0x10')](0x1f4,_0x1a331a['message']));});});}; \ No newline at end of file +var _0xda7c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','CreateFaxQueueReport','FaxQueueReport','options','raw','UpdateFaxQueueReport','update','body','where','attributes','limit','util','moment','randomstring'];(function(_0x33fe46,_0x5de37b){var _0x5e2025=function(_0x53103b){while(--_0x53103b){_0x33fe46['push'](_0x33fe46['shift']());}};_0x5e2025(++_0x5de37b);}(_0xda7c,0x75));var _0xcda7=function(_0xd48af9,_0x13aee9){_0xd48af9=_0xd48af9-0x0;var _0x1d0828=_0xda7c[_0xd48af9];return _0x1d0828;};'use strict';var _=require('lodash');var util=require(_0xcda7('0x0'));var moment=require(_0xcda7('0x1'));var BPromise=require('bluebird');var rs=require(_0xcda7('0x2'));var fs=require('fs');var Redis=require(_0xcda7('0x3'));var db=require(_0xcda7('0x4'))['db'];var utils=require(_0xcda7('0x5'));var logger=require(_0xcda7('0x6'))(_0xcda7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcda7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e64f7,_0x294146,_0x3beb10){return new BPromise(function(_0x1afb46,_0x1193dd){return client[_0xcda7('0x9')](_0x2e64f7,_0x3beb10)[_0xcda7('0xa')](function(_0x12d11b){logger[_0xcda7('0xb')](_0xcda7('0xc'),_0x294146,'request\x20sent');logger[_0xcda7('0xd')](_0xcda7('0xe'),_0x294146,'request\x20sent',JSON[_0xcda7('0xf')](_0x12d11b));if(_0x12d11b['error']){if(_0x12d11b['error'][_0xcda7('0x10')]===0x1f4){logger[_0xcda7('0x11')](_0xcda7('0xc'),_0x294146,_0x12d11b['error'][_0xcda7('0x12')]);return _0x1193dd(_0x12d11b[_0xcda7('0x11')][_0xcda7('0x12')]);}logger[_0xcda7('0x11')](_0xcda7('0xc'),_0x294146,_0x12d11b[_0xcda7('0x11')][_0xcda7('0x12')]);return _0x1afb46(_0x12d11b['error']['message']);}else{logger['info'](_0xcda7('0xc'),_0x294146,'request\x20sent');_0x1afb46(_0x12d11b['result']['message']);}})[_0xcda7('0x13')](function(_0x4a115f){logger[_0xcda7('0x11')](_0xcda7('0xc'),_0x294146,_0x4a115f);_0x1193dd(_0x4a115f);});});}exports[_0xcda7('0x14')]=function(_0x236cff){var _0x2710ec=this;return new Promise(function(_0x4c7eab,_0xb01449){return db[_0xcda7('0x15')]['create'](_0x236cff['body'],{'raw':_0x236cff[_0xcda7('0x16')]?_0x236cff[_0xcda7('0x16')][_0xcda7('0x17')]===undefined?!![]:![]:!![]})[_0xcda7('0xa')](function(_0x26cce3){logger[_0xcda7('0xb')](_0xcda7('0x14'),_0x236cff);logger[_0xcda7('0xd')](_0xcda7('0x14'),_0x236cff,JSON[_0xcda7('0xf')](_0x26cce3));_0x4c7eab(_0x26cce3);})[_0xcda7('0x13')](function(_0x40ea1b){logger[_0xcda7('0x11')](_0xcda7('0x14'),_0x40ea1b[_0xcda7('0x12')],_0x236cff);_0xb01449(_0x2710ec[_0xcda7('0x11')](0x1f4,_0x40ea1b['message']));});});};exports[_0xcda7('0x18')]=function(_0x5cf070){var _0x544e54=this;return new Promise(function(_0x656cce,_0x1f69d0){return db[_0xcda7('0x15')][_0xcda7('0x19')](_0x5cf070[_0xcda7('0x1a')],{'raw':_0x5cf070[_0xcda7('0x16')]?_0x5cf070[_0xcda7('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cf070[_0xcda7('0x16')]?_0x5cf070[_0xcda7('0x16')][_0xcda7('0x1b')]||null:null,'attributes':_0x5cf070['options']?_0x5cf070[_0xcda7('0x16')][_0xcda7('0x1c')]||null:null,'limit':_0x5cf070['options']?_0x5cf070[_0xcda7('0x16')][_0xcda7('0x1d')]||null:null})[_0xcda7('0xa')](function(_0x382496){logger[_0xcda7('0xb')](_0xcda7('0x18'),_0x5cf070);logger[_0xcda7('0xd')](_0xcda7('0x18'),_0x5cf070,JSON[_0xcda7('0xf')](_0x382496));_0x656cce(_0x382496);})[_0xcda7('0x13')](function(_0x9afd82){logger['error']('UpdateFaxQueueReport',_0x9afd82[_0xcda7('0x12')],_0x5cf070);_0x1f69d0(_0x544e54[_0xcda7('0x11')](0x1f4,_0x9afd82[_0xcda7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 3d1c75c..3cf45f0 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 _0x0a58=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','put','update','delete','destroy','exports','multer','path'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0x0a58,0x141));var _0x80a5=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0a58[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x80a5('0x0'));var util=require('util');var path=require(_0x80a5('0x1'));var timeout=require(_0x80a5('0x2'));var express=require(_0x80a5('0x3'));var router=express[_0x80a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x80a5('0x5'));var interaction=require(_0x80a5('0x6'));var config=require(_0x80a5('0x7'));var controller=require(_0x80a5('0x8'));router[_0x80a5('0x9')]('/',auth[_0x80a5('0xa')](),controller[_0x80a5('0xb')]);router[_0x80a5('0x9')](_0x80a5('0xc'),auth[_0x80a5('0xa')](),controller['describe']);router[_0x80a5('0x9')](_0x80a5('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x80a5('0xa')](),controller['create']);router[_0x80a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x80a5('0xf')]);router[_0x80a5('0x10')](_0x80a5('0xd'),auth[_0x80a5('0xa')](),controller[_0x80a5('0x11')]);module[_0x80a5('0x12')]=router; \ No newline at end of file +var _0x6ec5=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','exports','multer','util'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x6ec5,0x18d));var _0x56ec=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6ec5[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x56ec('0x0'));var util=require(_0x56ec('0x1'));var path=require(_0x56ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x56ec('0x3'));var router=express['Router']();var fs_extra=require(_0x56ec('0x4'));var auth=require(_0x56ec('0x5'));var interaction=require(_0x56ec('0x6'));var config=require(_0x56ec('0x7'));var controller=require(_0x56ec('0x8'));router[_0x56ec('0x9')]('/',auth[_0x56ec('0xa')](),controller[_0x56ec('0xb')]);router['get'](_0x56ec('0xc'),auth[_0x56ec('0xa')](),controller['describe']);router[_0x56ec('0x9')](_0x56ec('0xd'),auth[_0x56ec('0xa')](),controller[_0x56ec('0xe')]);router[_0x56ec('0xf')]('/',auth[_0x56ec('0xa')](),controller['create']);router[_0x56ec('0x10')](_0x56ec('0xd'),auth[_0x56ec('0xa')](),controller[_0x56ec('0x11')]);router['delete'](_0x56ec('0xd'),auth[_0x56ec('0xa')](),controller['destroy']);module[_0x56ec('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index cf431f1..99ce4a7 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1f6040,_0x3cafe5){var _0x502b86=function(_0x301f03){while(--_0x301f03){_0x1f6040['push'](_0x1f6040['shift']());}};_0x502b86(++_0x3cafe5);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xbebf50,_0x44ec09){_0xbebf50=_0xbebf50-0x0;var _0xce1496=_0xf3cd[_0xbebf50];return _0xce1496;};'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 +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xe7d3dc,_0x41be5e){var _0x948361=function(_0x3f90ab){while(--_0x3f90ab){_0xe7d3dc['push'](_0xe7d3dc['shift']());}};_0x948361(++_0x41be5e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4a45b4,_0x59804f){_0x4a45b4=_0x4a45b4-0x0;var _0x1a99c9=_0xf3cd[_0x4a45b4];return _0x1a99c9;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index ce495a2..aba9b75 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 _0xc6c5=['intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','FaxTransferReport','includeAll','include','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','name','send','index','map','rawAttributes','fieldName','query','keys'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc6c5,0x64));var _0x5c6c=function(_0x466c17,_0x68fc5b){_0x466c17=_0x466c17-0x0;var _0x158a6a=_0xc6c5[_0x466c17];return _0x158a6a;};'use strict';var emlformat=require(_0x5c6c('0x0'));var rimraf=require(_0x5c6c('0x1'));var zipdir=require(_0x5c6c('0x2'));var jsonpatch=require(_0x5c6c('0x3'));var rp=require(_0x5c6c('0x4'));var moment=require(_0x5c6c('0x5'));var BPromise=require(_0x5c6c('0x6'));var Mustache=require(_0x5c6c('0x7'));var util=require(_0x5c6c('0x8'));var path=require(_0x5c6c('0x9'));var sox=require(_0x5c6c('0xa'));var csv=require(_0x5c6c('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c6c('0xc'));var _=require(_0x5c6c('0xd'));var squel=require(_0x5c6c('0xe'));var crypto=require(_0x5c6c('0xf'));var jsforce=require(_0x5c6c('0x10'));var deskjs=require(_0x5c6c('0x11'));var toCsv=require(_0x5c6c('0xb'));var querystring=require('querystring');var Papa=require(_0x5c6c('0x12'));var Redis=require(_0x5c6c('0x13'));var authService=require(_0x5c6c('0x14'));var qs=require(_0x5c6c('0x15'));var as=require(_0x5c6c('0x16'));var hardwareService=require(_0x5c6c('0x17'));var logger=require(_0x5c6c('0x18'))(_0x5c6c('0x19'));var utils=require('../../config/utils');var config=require(_0x5c6c('0x1a'));var licenseUtil=require(_0x5c6c('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21ef9d,_0x3f0ee4){_0x3f0ee4=_0x3f0ee4||0xcc;return function(_0x518a11){if(_0x518a11){return _0x21ef9d[_0x5c6c('0x1c')](_0x3f0ee4);}return _0x21ef9d[_0x5c6c('0x1d')](_0x3f0ee4)[_0x5c6c('0x1e')]();};}function respondWithResult(_0x2f77a4,_0x6f2de1){_0x6f2de1=_0x6f2de1||0xc8;return function(_0xb4c5ad){if(_0xb4c5ad){return _0x2f77a4[_0x5c6c('0x1d')](_0x6f2de1)[_0x5c6c('0x1f')](_0xb4c5ad);}};}function respondWithFilteredResult(_0xf09c52,_0x26bd0f){return function(_0x1814fb){if(_0x1814fb){var _0x3ef155=typeof _0x26bd0f[_0x5c6c('0x20')]===_0x5c6c('0x21')&&typeof _0x26bd0f[_0x5c6c('0x22')]===_0x5c6c('0x21');var _0x339baf=_0x1814fb[_0x5c6c('0x23')];var _0x3e872d=_0x3ef155?0x0:_0x26bd0f[_0x5c6c('0x20')];var _0xbd22ba=_0x3ef155?_0x1814fb[_0x5c6c('0x23')]:_0x26bd0f[_0x5c6c('0x20')]+_0x26bd0f[_0x5c6c('0x22')];var _0x273122;if(_0xbd22ba>=_0x339baf){_0xbd22ba=_0x339baf;_0x273122=0xc8;}else{_0x273122=0xce;}_0xf09c52[_0x5c6c('0x1d')](_0x273122);return _0xf09c52[_0x5c6c('0x24')](_0x5c6c('0x25'),_0x3e872d+'-'+_0xbd22ba+'/'+_0x339baf)[_0x5c6c('0x1f')](_0x1814fb);}return null;};}function patchUpdates(_0x4019e1){return function(_0x3739b5){try{jsonpatch[_0x5c6c('0x26')](_0x3739b5,_0x4019e1,!![]);}catch(_0x1b1082){return BPromise[_0x5c6c('0x27')](_0x1b1082);}return _0x3739b5[_0x5c6c('0x28')]();};}function saveUpdates(_0x5455cb,_0x1ed81c){return function(_0x5181f3){if(_0x5181f3){return _0x5181f3['update'](_0x5455cb)['then'](function(_0x10e7e8){return _0x10e7e8;});}return null;};}function removeEntity(_0x148726,_0x43567c){return function(_0x3a5a48){if(_0x3a5a48){return _0x3a5a48['destroy']()[_0x5c6c('0x29')](function(){_0x148726['status'](0xcc)[_0x5c6c('0x1e')]();});}};}function handleEntityNotFound(_0x3eb35d,_0x49f180){return function(_0x152984){if(!_0x152984){_0x3eb35d[_0x5c6c('0x1c')](0x194);}return _0x152984;};}function handleError(_0x10a4bd,_0x18812c){_0x18812c=_0x18812c||0x1f4;return function(_0x45b551){logger['error'](_0x45b551['stack']);if(_0x45b551['name']){delete _0x45b551[_0x5c6c('0x2a')];}_0x10a4bd['status'](_0x18812c)[_0x5c6c('0x2b')](_0x45b551);};}exports[_0x5c6c('0x2c')]=function(_0x188883,_0x17c284){var _0x1cd5c9={},_0x1fbac9={},_0x1cc5fd={'count':0x0,'rows':[]};var _0xcd4daa=_[_0x5c6c('0x2d')](db['FaxTransferReport'][_0x5c6c('0x2e')],function(_0x4dd62c){return{'name':_0x4dd62c[_0x5c6c('0x2f')],'type':_0x4dd62c['type']['key']};});_0x1fbac9['model']=_[_0x5c6c('0x2d')](_0xcd4daa,'name');_0x1fbac9[_0x5c6c('0x30')]=_[_0x5c6c('0x31')](_0x188883[_0x5c6c('0x30')]);_0x1fbac9['filters']=_[_0x5c6c('0x32')](_0x1fbac9[_0x5c6c('0x33')],_0x1fbac9[_0x5c6c('0x30')]);_0x1cd5c9[_0x5c6c('0x34')]=_[_0x5c6c('0x32')](_0x1fbac9[_0x5c6c('0x33')],qs[_0x5c6c('0x35')](_0x188883[_0x5c6c('0x30')][_0x5c6c('0x35')]));_0x1cd5c9[_0x5c6c('0x34')]=_0x1cd5c9[_0x5c6c('0x34')][_0x5c6c('0x36')]?_0x1cd5c9[_0x5c6c('0x34')]:_0x1fbac9[_0x5c6c('0x33')];if(!_0x188883[_0x5c6c('0x30')][_0x5c6c('0x37')]('nolimit')){_0x1cd5c9['limit']=qs[_0x5c6c('0x22')](_0x188883[_0x5c6c('0x30')]['limit']);_0x1cd5c9['offset']=qs['offset'](_0x188883[_0x5c6c('0x30')]['offset']);}_0x1cd5c9['order']=qs[_0x5c6c('0x38')](_0x188883[_0x5c6c('0x30')]['sort']);_0x1cd5c9[_0x5c6c('0x39')]=qs[_0x5c6c('0x3a')](_[_0x5c6c('0x3b')](_0x188883['query'],_0x1fbac9[_0x5c6c('0x3a')]),_0xcd4daa);if(_0x188883['query'][_0x5c6c('0x3c')]){_0x1cd5c9[_0x5c6c('0x39')]=_[_0x5c6c('0x3d')](_0x1cd5c9[_0x5c6c('0x39')],{'$or':_[_0x5c6c('0x2d')](_0xcd4daa,function(_0x37f35b){if(_0x37f35b[_0x5c6c('0x3e')]!==_0x5c6c('0x3f')){var _0x26913c={};_0x26913c[_0x37f35b['name']]={'$like':'%'+_0x188883[_0x5c6c('0x30')][_0x5c6c('0x3c')]+'%'};return _0x26913c;}})});}_0x1cd5c9=_[_0x5c6c('0x3d')]({},_0x1cd5c9,_0x188883[_0x5c6c('0x40')]);var _0x3ba4ff={'where':_0x1cd5c9[_0x5c6c('0x39')]};return db[_0x5c6c('0x41')][_0x5c6c('0x23')](_0x3ba4ff)[_0x5c6c('0x29')](function(_0x416456){_0x1cc5fd[_0x5c6c('0x23')]=_0x416456;if(_0x188883[_0x5c6c('0x30')][_0x5c6c('0x42')]){_0x1cd5c9[_0x5c6c('0x43')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x1cd5c9);})[_0x5c6c('0x29')](function(_0x25b35e){_0x1cc5fd[_0x5c6c('0x44')]=_0x25b35e;return _0x1cc5fd;})[_0x5c6c('0x29')](respondWithFilteredResult(_0x17c284,_0x1cd5c9))[_0x5c6c('0x45')](handleError(_0x17c284,null));};exports[_0x5c6c('0x46')]=function(_0x5884cf,_0x198277){var _0x5437c5={'raw':!![],'where':{'id':_0x5884cf[_0x5c6c('0x47')]['id']}},_0x334eef={};_0x334eef[_0x5c6c('0x33')]=_[_0x5c6c('0x31')](db[_0x5c6c('0x41')][_0x5c6c('0x2e')]);_0x334eef['query']=_[_0x5c6c('0x31')](_0x5884cf[_0x5c6c('0x30')]);_0x334eef['filters']=_['intersection'](_0x334eef['model'],_0x334eef[_0x5c6c('0x30')]);_0x5437c5[_0x5c6c('0x34')]=_['intersection'](_0x334eef[_0x5c6c('0x33')],qs[_0x5c6c('0x35')](_0x5884cf[_0x5c6c('0x30')][_0x5c6c('0x35')]));_0x5437c5[_0x5c6c('0x34')]=_0x5437c5['attributes'][_0x5c6c('0x36')]?_0x5437c5['attributes']:_0x334eef[_0x5c6c('0x33')];if(_0x5884cf[_0x5c6c('0x30')]['includeAll']){_0x5437c5['include']=[{'all':!![]}];}_0x5437c5=_[_0x5c6c('0x3d')]({},_0x5437c5,_0x5884cf[_0x5c6c('0x40')]);return db[_0x5c6c('0x41')]['find'](_0x5437c5)[_0x5c6c('0x29')](handleEntityNotFound(_0x198277,null))[_0x5c6c('0x29')](respondWithResult(_0x198277,null))['catch'](handleError(_0x198277,null));};exports[_0x5c6c('0x48')]=function(_0x1de0df,_0x5bd09e){return db[_0x5c6c('0x41')][_0x5c6c('0x48')](_0x1de0df['body'],{})[_0x5c6c('0x29')](respondWithResult(_0x5bd09e,0xc9))[_0x5c6c('0x45')](handleError(_0x5bd09e,null));};exports['update']=function(_0x143ffb,_0x42f8d4){if(_0x143ffb[_0x5c6c('0x49')]['id']){delete _0x143ffb[_0x5c6c('0x49')]['id'];}return db[_0x5c6c('0x41')][_0x5c6c('0x4a')]({'where':{'id':_0x143ffb[_0x5c6c('0x47')]['id']}})[_0x5c6c('0x29')](handleEntityNotFound(_0x42f8d4,null))['then'](saveUpdates(_0x143ffb['body'],null))[_0x5c6c('0x29')](respondWithResult(_0x42f8d4,null))[_0x5c6c('0x45')](handleError(_0x42f8d4,null));};exports['destroy']=function(_0x48feb0,_0x27e471){return db[_0x5c6c('0x41')][_0x5c6c('0x4a')]({'where':{'id':_0x48feb0['params']['id']}})[_0x5c6c('0x29')](handleEntityNotFound(_0x27e471,null))[_0x5c6c('0x29')](removeEntity(_0x27e471,null))[_0x5c6c('0x45')](handleError(_0x27e471,null));};exports['describe']=function(_0x3f9264,_0x133b69){return db[_0x5c6c('0x41')]['describe']()[_0x5c6c('0x29')](respondWithResult(_0x133b69,null))[_0x5c6c('0x45')](handleError(_0x133b69,null));}; \ No newline at end of file +var _0x8f87=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','offset','limit','status','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','index','map','FaxTransferReport','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','options','count','includeAll','include','rows','params','rawAttributes','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox'];(function(_0x37b338,_0x52ed34){var _0x392bc6=function(_0x5c1ffc){while(--_0x5c1ffc){_0x37b338['push'](_0x37b338['shift']());}};_0x392bc6(++_0x52ed34);}(_0x8f87,0xc5));var _0x78f8=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x8f87[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x78f8('0x0'));var zipdir=require(_0x78f8('0x1'));var jsonpatch=require(_0x78f8('0x2'));var rp=require(_0x78f8('0x3'));var moment=require(_0x78f8('0x4'));var BPromise=require(_0x78f8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x78f8('0x6'));var csv=require('to-csv');var ejs=require(_0x78f8('0x7'));var fs=require('fs');var fs_extra=require(_0x78f8('0x8'));var _=require(_0x78f8('0x9'));var squel=require(_0x78f8('0xa'));var crypto=require(_0x78f8('0xb'));var jsforce=require(_0x78f8('0xc'));var deskjs=require(_0x78f8('0xd'));var toCsv=require(_0x78f8('0xe'));var querystring=require('querystring');var Papa=require(_0x78f8('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x78f8('0x10'));var as=require(_0x78f8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x78f8('0x12'));var config=require(_0x78f8('0x13'));var licenseUtil=require(_0x78f8('0x14'));var db=require(_0x78f8('0x15'))['db'];function respondWithStatusCode(_0x3ade69,_0x4a45c8){_0x4a45c8=_0x4a45c8||0xcc;return function(_0x407a03){if(_0x407a03){return _0x3ade69['sendStatus'](_0x4a45c8);}return _0x3ade69['status'](_0x4a45c8)['end']();};}function respondWithResult(_0xc44350,_0x26c866){_0x26c866=_0x26c866||0xc8;return function(_0x343ed0){if(_0x343ed0){return _0xc44350['status'](_0x26c866)[_0x78f8('0x16')](_0x343ed0);}};}function respondWithFilteredResult(_0xf153c1,_0x4efd00){return function(_0x274aa6){if(_0x274aa6){var _0x1d49d5=typeof _0x4efd00[_0x78f8('0x17')]==='undefined'&&typeof _0x4efd00[_0x78f8('0x18')]==='undefined';var _0x532d17=_0x274aa6['count'];var _0x4a5a4b=_0x1d49d5?0x0:_0x4efd00[_0x78f8('0x17')];var _0x1d5ba4=_0x1d49d5?_0x274aa6['count']:_0x4efd00[_0x78f8('0x17')]+_0x4efd00['limit'];var _0x54f31f;if(_0x1d5ba4>=_0x532d17){_0x1d5ba4=_0x532d17;_0x54f31f=0xc8;}else{_0x54f31f=0xce;}_0xf153c1[_0x78f8('0x19')](_0x54f31f);return _0xf153c1[_0x78f8('0x1a')](_0x78f8('0x1b'),_0x4a5a4b+'-'+_0x1d5ba4+'/'+_0x532d17)['json'](_0x274aa6);}return null;};}function patchUpdates(_0x1441a5){return function(_0x55b835){try{jsonpatch['apply'](_0x55b835,_0x1441a5,!![]);}catch(_0x1cbc1a){return BPromise[_0x78f8('0x1c')](_0x1cbc1a);}return _0x55b835[_0x78f8('0x1d')]();};}function saveUpdates(_0x2f203e,_0x48b70f){return function(_0x518930){if(_0x518930){return _0x518930[_0x78f8('0x1e')](_0x2f203e)[_0x78f8('0x1f')](function(_0x489114){return _0x489114;});}return null;};}function removeEntity(_0x308d60,_0x278e3a){return function(_0x4b0530){if(_0x4b0530){return _0x4b0530[_0x78f8('0x20')]()['then'](function(){_0x308d60[_0x78f8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40ec72,_0x2f4fb1){return function(_0x42dbe2){if(!_0x42dbe2){_0x40ec72[_0x78f8('0x21')](0x194);}return _0x42dbe2;};}function handleError(_0x559e31,_0x48c66a){_0x48c66a=_0x48c66a||0x1f4;return function(_0x72f029){logger[_0x78f8('0x22')](_0x72f029['stack']);if(_0x72f029[_0x78f8('0x23')]){delete _0x72f029['name'];}_0x559e31['status'](_0x48c66a)['send'](_0x72f029);};}exports[_0x78f8('0x24')]=function(_0x4f4a75,_0x3e4f40){var _0x417251={},_0x10d4bd={},_0x4ed85d={'count':0x0,'rows':[]};var _0x467648=_[_0x78f8('0x25')](db[_0x78f8('0x26')]['rawAttributes'],function(_0x84b3cd){return{'name':_0x84b3cd[_0x78f8('0x27')],'type':_0x84b3cd[_0x78f8('0x28')][_0x78f8('0x29')]};});_0x10d4bd['model']=_[_0x78f8('0x25')](_0x467648,_0x78f8('0x23'));_0x10d4bd[_0x78f8('0x2a')]=_[_0x78f8('0x2b')](_0x4f4a75[_0x78f8('0x2a')]);_0x10d4bd[_0x78f8('0x2c')]=_['intersection'](_0x10d4bd[_0x78f8('0x2d')],_0x10d4bd[_0x78f8('0x2a')]);_0x417251['attributes']=_[_0x78f8('0x2e')](_0x10d4bd[_0x78f8('0x2d')],qs['fields'](_0x4f4a75[_0x78f8('0x2a')][_0x78f8('0x2f')]));_0x417251[_0x78f8('0x30')]=_0x417251[_0x78f8('0x30')][_0x78f8('0x31')]?_0x417251[_0x78f8('0x30')]:_0x10d4bd[_0x78f8('0x2d')];if(!_0x4f4a75['query']['hasOwnProperty']('nolimit')){_0x417251['limit']=qs['limit'](_0x4f4a75[_0x78f8('0x2a')][_0x78f8('0x18')]);_0x417251[_0x78f8('0x17')]=qs['offset'](_0x4f4a75[_0x78f8('0x2a')]['offset']);}_0x417251[_0x78f8('0x32')]=qs[_0x78f8('0x33')](_0x4f4a75[_0x78f8('0x2a')][_0x78f8('0x33')]);_0x417251[_0x78f8('0x34')]=qs[_0x78f8('0x2c')](_[_0x78f8('0x35')](_0x4f4a75['query'],_0x10d4bd['filters']),_0x467648);if(_0x4f4a75[_0x78f8('0x2a')][_0x78f8('0x36')]){_0x417251[_0x78f8('0x34')]=_[_0x78f8('0x37')](_0x417251['where'],{'$or':_[_0x78f8('0x25')](_0x467648,function(_0xc5942e){if(_0xc5942e[_0x78f8('0x28')]!=='VIRTUAL'){var _0x5218b4={};_0x5218b4[_0xc5942e[_0x78f8('0x23')]]={'$like':'%'+_0x4f4a75[_0x78f8('0x2a')][_0x78f8('0x36')]+'%'};return _0x5218b4;}})});}_0x417251=_['merge']({},_0x417251,_0x4f4a75[_0x78f8('0x38')]);var _0x2cdca9={'where':_0x417251['where']};return db[_0x78f8('0x26')]['count'](_0x2cdca9)[_0x78f8('0x1f')](function(_0x3e2023){_0x4ed85d[_0x78f8('0x39')]=_0x3e2023;if(_0x4f4a75[_0x78f8('0x2a')][_0x78f8('0x3a')]){_0x417251[_0x78f8('0x3b')]=[{'all':!![]}];}return db[_0x78f8('0x26')]['findAll'](_0x417251);})['then'](function(_0x13f5f7){_0x4ed85d[_0x78f8('0x3c')]=_0x13f5f7;return _0x4ed85d;})[_0x78f8('0x1f')](respondWithFilteredResult(_0x3e4f40,_0x417251))['catch'](handleError(_0x3e4f40,null));};exports['show']=function(_0x3df5cc,_0xfb19de){var _0xe1b8ec={'raw':!![],'where':{'id':_0x3df5cc[_0x78f8('0x3d')]['id']}},_0x685e17={};_0x685e17[_0x78f8('0x2d')]=_[_0x78f8('0x2b')](db['FaxTransferReport'][_0x78f8('0x3e')]);_0x685e17[_0x78f8('0x2a')]=_[_0x78f8('0x2b')](_0x3df5cc[_0x78f8('0x2a')]);_0x685e17[_0x78f8('0x2c')]=_[_0x78f8('0x2e')](_0x685e17[_0x78f8('0x2d')],_0x685e17[_0x78f8('0x2a')]);_0xe1b8ec[_0x78f8('0x30')]=_[_0x78f8('0x2e')](_0x685e17['model'],qs[_0x78f8('0x2f')](_0x3df5cc['query'][_0x78f8('0x2f')]));_0xe1b8ec[_0x78f8('0x30')]=_0xe1b8ec[_0x78f8('0x30')][_0x78f8('0x31')]?_0xe1b8ec[_0x78f8('0x30')]:_0x685e17[_0x78f8('0x2d')];if(_0x3df5cc[_0x78f8('0x2a')]['includeAll']){_0xe1b8ec[_0x78f8('0x3b')]=[{'all':!![]}];}_0xe1b8ec=_[_0x78f8('0x37')]({},_0xe1b8ec,_0x3df5cc['options']);return db['FaxTransferReport'][_0x78f8('0x3f')](_0xe1b8ec)[_0x78f8('0x1f')](handleEntityNotFound(_0xfb19de,null))[_0x78f8('0x1f')](respondWithResult(_0xfb19de,null))['catch'](handleError(_0xfb19de,null));};exports[_0x78f8('0x40')]=function(_0x2f5a1e,_0x4dbc5f){return db['FaxTransferReport'][_0x78f8('0x40')](_0x2f5a1e[_0x78f8('0x41')],{})[_0x78f8('0x1f')](respondWithResult(_0x4dbc5f,0xc9))[_0x78f8('0x42')](handleError(_0x4dbc5f,null));};exports[_0x78f8('0x1e')]=function(_0x373f19,_0x5116d9){if(_0x373f19[_0x78f8('0x41')]['id']){delete _0x373f19[_0x78f8('0x41')]['id'];}return db['FaxTransferReport'][_0x78f8('0x3f')]({'where':{'id':_0x373f19[_0x78f8('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5116d9,null))[_0x78f8('0x1f')](saveUpdates(_0x373f19[_0x78f8('0x41')],null))[_0x78f8('0x1f')](respondWithResult(_0x5116d9,null))['catch'](handleError(_0x5116d9,null));};exports['destroy']=function(_0x2ad31d,_0x2e7667){return db['FaxTransferReport'][_0x78f8('0x3f')]({'where':{'id':_0x2ad31d[_0x78f8('0x3d')]['id']}})[_0x78f8('0x1f')](handleEntityNotFound(_0x2e7667,null))[_0x78f8('0x1f')](removeEntity(_0x2e7667,null))[_0x78f8('0x42')](handleError(_0x2e7667,null));};exports['describe']=function(_0x2300bf,_0x594332){return db[_0x78f8('0x26')][_0x78f8('0x43')]()['then'](respondWithResult(_0x594332,null))['catch'](handleError(_0x594332,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 1f467d4..3d9b441 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 _0x6ef1=['./faxTransferReport.attributes','define','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0x6ef1,0xac));var _0x16ef=function(_0x10668a,_0x234880){_0x10668a=_0x10668a-0x0;var _0xa44d3=_0x6ef1[_0x10668a];return _0xa44d3;};'use strict';var _=require(_0x16ef('0x0'));var util=require(_0x16ef('0x1'));var logger=require(_0x16ef('0x2'))(_0x16ef('0x3'));var moment=require(_0x16ef('0x4'));var BPromise=require(_0x16ef('0x5'));var rp=require(_0x16ef('0x6'));var fs=require('fs');var path=require(_0x16ef('0x7'));var rimraf=require(_0x16ef('0x8'));var config=require(_0x16ef('0x9'));var attributes=require(_0x16ef('0xa'));module['exports']=function(_0xf1f5bd,_0x198926){return _0xf1f5bd[_0x16ef('0xb')](_0x16ef('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x16ef('0xd'),'fields':[_0x16ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf48c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf48c,0x10e));var _0xcf48=function(_0x3b52e8,_0x48241c){_0x3b52e8=_0x3b52e8-0x0;var _0x47a576=_0xf48c[_0x3b52e8];return _0x47a576;};'use strict';var _=require(_0xcf48('0x0'));var util=require(_0xcf48('0x1'));var logger=require(_0xcf48('0x2'))('api');var moment=require(_0xcf48('0x3'));var BPromise=require(_0xcf48('0x4'));var rp=require(_0xcf48('0x5'));var fs=require('fs');var path=require(_0xcf48('0x6'));var rimraf=require(_0xcf48('0x7'));var config=require(_0xcf48('0x8'));var attributes=require(_0xcf48('0x9'));module[_0xcf48('0xa')]=function(_0xaea91b,_0x2555de){return _0xaea91b['define'](_0xcf48('0xb'),attributes,{'tableName':_0xcf48('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index a1c7dd4..52fea75 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 _0xa7a1=['rpc','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3fc97b,_0x20ca29){var _0x3a0c82=function(_0x1c15ec){while(--_0x1c15ec){_0x3fc97b['push'](_0x3fc97b['shift']());}};_0x3a0c82(++_0x20ca29);}(_0xa7a1,0x8a));var _0x1a7a=function(_0x31cac2,_0x560126){_0x31cac2=_0x31cac2-0x0;var _0x4da10c=_0xa7a1[_0x31cac2];return _0x4da10c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1a7a('0x0'));var BPromise=require(_0x1a7a('0x1'));var rs=require(_0x1a7a('0x2'));var fs=require('fs');var Redis=require(_0x1a7a('0x3'));var db=require(_0x1a7a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a7a('0x5'))(_0x1a7a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15d023,_0x2fd96f,_0x26dd64){return new BPromise(function(_0x455666,_0x4639b1){return client[_0x1a7a('0x7')](_0x15d023,_0x26dd64)['then'](function(_0x4eb68a){logger[_0x1a7a('0x8')](_0x1a7a('0x9'),_0x2fd96f,_0x1a7a('0xa'));logger[_0x1a7a('0xb')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2fd96f,_0x1a7a('0xa'),JSON[_0x1a7a('0xc')](_0x4eb68a));if(_0x4eb68a[_0x1a7a('0xd')]){if(_0x4eb68a[_0x1a7a('0xd')][_0x1a7a('0xe')]===0x1f4){logger[_0x1a7a('0xd')](_0x1a7a('0x9'),_0x2fd96f,_0x4eb68a[_0x1a7a('0xd')]['message']);return _0x4639b1(_0x4eb68a[_0x1a7a('0xd')][_0x1a7a('0xf')]);}logger[_0x1a7a('0xd')](_0x1a7a('0x9'),_0x2fd96f,_0x4eb68a[_0x1a7a('0xd')][_0x1a7a('0xf')]);return _0x455666(_0x4eb68a[_0x1a7a('0xd')][_0x1a7a('0xf')]);}else{logger[_0x1a7a('0x8')]('FaxTransferReport,\x20%s,\x20%s',_0x2fd96f,_0x1a7a('0xa'));_0x455666(_0x4eb68a[_0x1a7a('0x10')][_0x1a7a('0xf')]);}})[_0x1a7a('0x11')](function(_0x2ed4cc){logger[_0x1a7a('0xd')](_0x1a7a('0x9'),_0x2fd96f,_0x2ed4cc);_0x4639b1(_0x2ed4cc);});});} \ No newline at end of file +var _0xa666=['stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x331430,_0x117b87){var _0x4b850c=function(_0x4a4dda){while(--_0x4a4dda){_0x331430['push'](_0x331430['shift']());}};_0x4b850c(++_0x117b87);}(_0xa666,0x84));var _0x6a66=function(_0x20c298,_0x47ee6a){_0x20c298=_0x20c298-0x0;var _0x467fee=_0xa666[_0x20c298];return _0x467fee;};'use strict';var _=require('lodash');var util=require(_0x6a66('0x0'));var moment=require('moment');var BPromise=require(_0x6a66('0x1'));var rs=require(_0x6a66('0x2'));var fs=require('fs');var Redis=require(_0x6a66('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a66('0x4'));var logger=require(_0x6a66('0x5'))(_0x6a66('0x6'));var config=require(_0x6a66('0x7'));var jayson=require(_0x6a66('0x8'));var client=jayson['client'][_0x6a66('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50a369,_0x3ffc75,_0x4ae833){return new BPromise(function(_0x1010d9,_0x26996c){return client[_0x6a66('0xa')](_0x50a369,_0x4ae833)[_0x6a66('0xb')](function(_0x2195d9){logger[_0x6a66('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x3ffc75,_0x6a66('0xd'));logger['debug'](_0x6a66('0xe'),_0x3ffc75,_0x6a66('0xd'),JSON[_0x6a66('0xf')](_0x2195d9));if(_0x2195d9[_0x6a66('0x10')]){if(_0x2195d9[_0x6a66('0x10')][_0x6a66('0x11')]===0x1f4){logger[_0x6a66('0x10')](_0x6a66('0x12'),_0x3ffc75,_0x2195d9[_0x6a66('0x10')][_0x6a66('0x13')]);return _0x26996c(_0x2195d9[_0x6a66('0x10')][_0x6a66('0x13')]);}logger[_0x6a66('0x10')](_0x6a66('0x12'),_0x3ffc75,_0x2195d9[_0x6a66('0x10')]['message']);return _0x1010d9(_0x2195d9['error']['message']);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x3ffc75,_0x6a66('0xd'));_0x1010d9(_0x2195d9[_0x6a66('0x14')][_0x6a66('0x13')]);}})['catch'](function(_0x29c863){logger[_0x6a66('0x10')](_0x6a66('0x12'),_0x3ffc75,_0x29c863);_0x26996c(_0x29c863);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index ad883bd..775e33c 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 _0x48c8=['index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated'];(function(_0x454cfb,_0x3246d4){var _0x5b7654=function(_0x8055dc){while(--_0x8055dc){_0x454cfb['push'](_0x454cfb['shift']());}};_0x5b7654(++_0x3246d4);}(_0x48c8,0x131));var _0x848c=function(_0x4a782b,_0x55584a){_0x4a782b=_0x4a782b-0x0;var _0x5cb5a0=_0x48c8[_0x4a782b];return _0x5cb5a0;};'use strict';var multer=require(_0x848c('0x0'));var util=require(_0x848c('0x1'));var path=require('path');var timeout=require(_0x848c('0x2'));var express=require(_0x848c('0x3'));var router=express[_0x848c('0x4')]();var fs_extra=require(_0x848c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x848c('0x6'));var config=require(_0x848c('0x7'));var controller=require(_0x848c('0x8'));router['get']('/',auth[_0x848c('0x9')](),controller[_0x848c('0xa')]);router['get'](_0x848c('0xb'),auth[_0x848c('0x9')](),controller['describe']);router['get'](_0x848c('0xc'),auth['isAuthenticated'](),controller[_0x848c('0xd')]);router[_0x848c('0xe')]('/',auth[_0x848c('0x9')](),controller[_0x848c('0xf')]);router[_0x848c('0x10')](_0x848c('0xc'),auth['isAuthenticated'](),controller[_0x848c('0x11')]);router[_0x848c('0x12')](_0x848c('0xc'),auth[_0x848c('0x9')](),controller[_0x848c('0x13')]);module[_0x848c('0x14')]=router; \ No newline at end of file +var _0x8c32=['connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','delete','destroy','multer','util','path'];(function(_0x5485a3,_0x3ff799){var _0x4c1410=function(_0x3ddccb){while(--_0x3ddccb){_0x5485a3['push'](_0x5485a3['shift']());}};_0x4c1410(++_0x3ff799);}(_0x8c32,0x129));var _0x28c3=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x8c32[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var path=require(_0x28c3('0x2'));var timeout=require(_0x28c3('0x3'));var express=require('express');var router=express[_0x28c3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x28c3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x28c3('0x6'));var controller=require('./faxTransferReport.controller');router[_0x28c3('0x7')]('/',auth[_0x28c3('0x8')](),controller['index']);router[_0x28c3('0x7')]('/describe',auth[_0x28c3('0x8')](),controller['describe']);router[_0x28c3('0x7')](_0x28c3('0x9'),auth[_0x28c3('0x8')](),controller['show']);router[_0x28c3('0xa')]('/',auth[_0x28c3('0x8')](),controller[_0x28c3('0xb')]);router[_0x28c3('0xc')](_0x28c3('0x9'),auth[_0x28c3('0x8')](),controller['update']);router[_0x28c3('0xd')](_0x28c3('0x9'),auth[_0x28c3('0x8')](),controller[_0x28c3('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 42b1360..c6a514d 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 _0x6074=['./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x6074,0xd6));var _0x4607=function(_0x35ba71,_0xa2fbbd){_0x35ba71=_0x35ba71-0x0;var _0x5f04f4=_0x6074[_0x35ba71];return _0x5f04f4;};'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['getFields']);router[_0x4607('0xf')]('/',auth[_0x4607('0x8')](),controller[_0x4607('0x10')]);router[_0x4607('0xf')](_0x4607('0xc'),auth[_0x4607('0x8')](),controller['addConfiguration']);router[_0x4607('0x11')](_0x4607('0xa'),auth[_0x4607('0x8')](),controller[_0x4607('0x12')]);router['delete'](_0x4607('0xa'),auth[_0x4607('0x8')](),controller['destroy']);module[_0x4607('0x13')]=router; \ No newline at end of file +var _0x2b9f=['create','post','addConfiguration','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2b9f,0x10e));var _0xf2b9=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x2b9f[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require(_0xf2b9('0x0'));var util=require(_0xf2b9('0x1'));var path=require(_0xf2b9('0x2'));var timeout=require(_0xf2b9('0x3'));var express=require(_0xf2b9('0x4'));var router=express[_0xf2b9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf2b9('0x6'));var interaction=require(_0xf2b9('0x7'));var config=require(_0xf2b9('0x8'));var controller=require(_0xf2b9('0x9'));router['get']('/',auth[_0xf2b9('0xa')](),controller[_0xf2b9('0xb')]);router['get'](_0xf2b9('0xc'),auth[_0xf2b9('0xa')](),controller[_0xf2b9('0xd')]);router[_0xf2b9('0xe')](_0xf2b9('0xf'),auth[_0xf2b9('0xa')](),controller[_0xf2b9('0x10')]);router[_0xf2b9('0xe')](_0xf2b9('0x11'),auth[_0xf2b9('0xa')](),controller['getFields']);router['post']('/',auth[_0xf2b9('0xa')](),controller[_0xf2b9('0x12')]);router[_0xf2b9('0x13')](_0xf2b9('0xf'),auth[_0xf2b9('0xa')](),controller[_0xf2b9('0x14')]);router[_0xf2b9('0x15')](_0xf2b9('0xc'),auth[_0xf2b9('0xa')](),controller['update']);router[_0xf2b9('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xf2b9('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 9588e06..bcedb65 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 _0xbd8b=['ENUM','integrationTab','newTab','sequelize','STRING','basic'];(function(_0x567cca,_0x2d643d){var _0x338a5e=function(_0x377f10){while(--_0x377f10){_0x567cca['push'](_0x567cca['shift']());}};_0x338a5e(++_0x2d643d);}(_0xbd8b,0xc9));var _0xbbd8=function(_0x1dee97,_0x292954){_0x1dee97=_0x1dee97-0x0;var _0x54af5c=_0xbd8b[_0x1dee97];return _0x54af5c;};'use strict';var Sequelize=require(_0xbbd8('0x0'));module['exports']={'name':{'type':Sequelize[_0xbbd8('0x1')]},'description':{'type':Sequelize[_0xbbd8('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbbd8('0x1')]},'authType':{'type':Sequelize['ENUM'](_0xbbd8('0x2')),'defaultValue':_0xbbd8('0x2')},'password':{'type':Sequelize[_0xbbd8('0x1')]},'consumerKey':{'type':Sequelize[_0xbbd8('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xbbd8('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xbbd8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xbbd8('0x3')](_0xbbd8('0x4'),_0xbbd8('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x597b=['newTab','sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0x597b,0x120));var _0xb597=function(_0x149076,_0x35394c){_0x149076=_0x149076-0x0;var _0x479ff3=_0x597b[_0x149076];return _0x479ff3;};'use strict';var Sequelize=require(_0xb597('0x0'));module[_0xb597('0x1')]={'name':{'type':Sequelize[_0xb597('0x2')]},'description':{'type':Sequelize[_0xb597('0x2')]},'username':{'type':Sequelize[_0xb597('0x2')]},'remoteUri':{'type':Sequelize[_0xb597('0x2')]},'authType':{'type':Sequelize[_0xb597('0x3')](_0xb597('0x4')),'defaultValue':_0xb597('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xb597('0x2')]},'consumerSecret':{'type':Sequelize[_0xb597('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xb597('0x2')]},'serverUrl':{'type':Sequelize[_0xb597('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb597('0x5'),_0xb597('0x6')),'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 ee792ca..7bd08d7 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 _0x554c=['DeskAccount','rawAttributes','type','key','keys','query','filters','intersection','fields','attributes','length','model','sort','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','getConfigurations','findOne','DeskConfiguration','order','where','pick','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','format','basic','headers','Authorization','toString','concat','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','map'];(function(_0x3743e5,_0x4b6bb9){var _0x370603=function(_0x1d8df1){while(--_0x1d8df1){_0x3743e5['push'](_0x3743e5['shift']());}};_0x370603(++_0x4b6bb9);}(_0x554c,0x127));var _0xc554=function(_0x2dbae6,_0x424afb){_0x2dbae6=_0x2dbae6-0x0;var _0x37f9ae=_0x554c[_0x2dbae6];return _0x37f9ae;};'use strict';var emlformat=require(_0xc554('0x0'));var rimraf=require(_0xc554('0x1'));var zipdir=require(_0xc554('0x2'));var jsonpatch=require(_0xc554('0x3'));var rp=require('request-promise');var moment=require(_0xc554('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc554('0x5'));var util=require(_0xc554('0x6'));var path=require(_0xc554('0x7'));var sox=require('sox');var csv=require(_0xc554('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc554('0x9'));var squel=require(_0xc554('0xa'));var crypto=require(_0xc554('0xb'));var jsforce=require(_0xc554('0xc'));var deskjs=require(_0xc554('0xd'));var toCsv=require(_0xc554('0x8'));var querystring=require(_0xc554('0xe'));var Papa=require(_0xc554('0xf'));var Redis=require(_0xc554('0x10'));var authService=require(_0xc554('0x11'));var qs=require(_0xc554('0x12'));var as=require(_0xc554('0x13'));var hardwareService=require(_0xc554('0x14'));var logger=require(_0xc554('0x15'))(_0xc554('0x16'));var utils=require(_0xc554('0x17'));var config=require(_0xc554('0x18'));var licenseUtil=require(_0xc554('0x19'));var db=require(_0xc554('0x1a'))['db'];var integrations=require(_0xc554('0x1b'));function respondWithStatusCode(_0x11ac26,_0x7ff077){_0x7ff077=_0x7ff077||0xcc;return function(_0x493c68){if(_0x493c68){return _0x11ac26[_0xc554('0x1c')](_0x7ff077);}return _0x11ac26[_0xc554('0x1d')](_0x7ff077)[_0xc554('0x1e')]();};}function respondWithResult(_0x1fc61c,_0x44df8){_0x44df8=_0x44df8||0xc8;return function(_0x4937bb){if(_0x4937bb){return _0x1fc61c[_0xc554('0x1d')](_0x44df8)[_0xc554('0x1f')](_0x4937bb);}};}function respondWithFilteredResult(_0x173f63,_0x2e99c5){return function(_0x54a34b){if(_0x54a34b){var _0x5b98d6=typeof _0x2e99c5[_0xc554('0x20')]===_0xc554('0x21')&&typeof _0x2e99c5[_0xc554('0x22')]===_0xc554('0x21');var _0x51c89b=_0x54a34b['count'];var _0x5009df=_0x5b98d6?0x0:_0x2e99c5[_0xc554('0x20')];var _0x6b2cf5=_0x5b98d6?_0x54a34b[_0xc554('0x23')]:_0x2e99c5[_0xc554('0x20')]+_0x2e99c5[_0xc554('0x22')];var _0x35bf8a;if(_0x6b2cf5>=_0x51c89b){_0x6b2cf5=_0x51c89b;_0x35bf8a=0xc8;}else{_0x35bf8a=0xce;}_0x173f63[_0xc554('0x1d')](_0x35bf8a);return _0x173f63[_0xc554('0x24')](_0xc554('0x25'),_0x5009df+'-'+_0x6b2cf5+'/'+_0x51c89b)[_0xc554('0x1f')](_0x54a34b);}return null;};}function patchUpdates(_0x3197e3){return function(_0x351f54){try{jsonpatch[_0xc554('0x26')](_0x351f54,_0x3197e3,!![]);}catch(_0x5633e1){return BPromise[_0xc554('0x27')](_0x5633e1);}return _0x351f54['save']();};}function saveUpdates(_0x1506ef,_0x4c9b3b){return function(_0x45624b){if(_0x45624b){return _0x45624b[_0xc554('0x28')](_0x1506ef)['then'](function(_0x433e9b){return _0x433e9b;});}return null;};}function removeEntity(_0x32a1fd,_0x1c80fb){return function(_0xb171bb){if(_0xb171bb){return _0xb171bb[_0xc554('0x29')]()[_0xc554('0x2a')](function(){_0x32a1fd[_0xc554('0x1d')](0xcc)[_0xc554('0x1e')]();});}};}function handleEntityNotFound(_0x4a6384,_0x176efe){return function(_0x53edcc){if(!_0x53edcc){_0x4a6384[_0xc554('0x1c')](0x194);}return _0x53edcc;};}function handleError(_0x5e636d,_0x7ed7ca){_0x7ed7ca=_0x7ed7ca||0x1f4;return function(_0x7f1ebc){logger[_0xc554('0x2b')](_0x7f1ebc['stack']);if(_0x7f1ebc[_0xc554('0x2c')]){delete _0x7f1ebc[_0xc554('0x2c')];}_0x5e636d[_0xc554('0x1d')](_0x7ed7ca)[_0xc554('0x2d')](_0x7f1ebc);};}exports['index']=function(_0x1287f4,_0x58cde9){var _0x6fef5a={},_0x4fc458={},_0x22fd71={'count':0x0,'rows':[]};var _0x50d3f3=_[_0xc554('0x2e')](db[_0xc554('0x2f')][_0xc554('0x30')],function(_0xe05459){return{'name':_0xe05459['fieldName'],'type':_0xe05459[_0xc554('0x31')][_0xc554('0x32')]};});_0x4fc458['model']=_['map'](_0x50d3f3,_0xc554('0x2c'));_0x4fc458['query']=_[_0xc554('0x33')](_0x1287f4[_0xc554('0x34')]);_0x4fc458[_0xc554('0x35')]=_[_0xc554('0x36')](_0x4fc458['model'],_0x4fc458['query']);_0x6fef5a['attributes']=_[_0xc554('0x36')](_0x4fc458['model'],qs['fields'](_0x1287f4[_0xc554('0x34')][_0xc554('0x37')]));_0x6fef5a[_0xc554('0x38')]=_0x6fef5a[_0xc554('0x38')][_0xc554('0x39')]?_0x6fef5a[_0xc554('0x38')]:_0x4fc458[_0xc554('0x3a')];if(!_0x1287f4[_0xc554('0x34')]['hasOwnProperty']('nolimit')){_0x6fef5a[_0xc554('0x22')]=qs[_0xc554('0x22')](_0x1287f4[_0xc554('0x34')][_0xc554('0x22')]);_0x6fef5a[_0xc554('0x20')]=qs[_0xc554('0x20')](_0x1287f4[_0xc554('0x34')]['offset']);}_0x6fef5a['order']=qs[_0xc554('0x3b')](_0x1287f4[_0xc554('0x34')][_0xc554('0x3b')]);_0x6fef5a['where']=qs[_0xc554('0x35')](_['pick'](_0x1287f4[_0xc554('0x34')],_0x4fc458[_0xc554('0x35')]),_0x50d3f3);if(_0x1287f4[_0xc554('0x34')]['filter']){_0x6fef5a['where']=_[_0xc554('0x3c')](_0x6fef5a['where'],{'$or':_[_0xc554('0x2e')](_0x50d3f3,function(_0x2cdcb0){if(_0x2cdcb0['type']!=='VIRTUAL'){var _0x3902fb={};_0x3902fb[_0x2cdcb0[_0xc554('0x2c')]]={'$like':'%'+_0x1287f4[_0xc554('0x34')]['filter']+'%'};return _0x3902fb;}})});}_0x6fef5a=_[_0xc554('0x3c')]({},_0x6fef5a,_0x1287f4[_0xc554('0x3d')]);var _0x4e26c4={'where':_0x6fef5a['where']};return db[_0xc554('0x2f')][_0xc554('0x23')](_0x4e26c4)[_0xc554('0x2a')](function(_0x5c33ea){_0x22fd71[_0xc554('0x23')]=_0x5c33ea;if(_0x1287f4[_0xc554('0x34')][_0xc554('0x3e')]){_0x6fef5a['include']=[{'all':!![]}];}return db[_0xc554('0x2f')][_0xc554('0x3f')](_0x6fef5a);})['then'](function(_0x5c2b57){_0x22fd71[_0xc554('0x40')]=_0x5c2b57;return _0x22fd71;})[_0xc554('0x2a')](respondWithFilteredResult(_0x58cde9,_0x6fef5a))[_0xc554('0x41')](handleError(_0x58cde9,null));};exports[_0xc554('0x42')]=function(_0x5168e5,_0x3d49fd){var _0x23e5f3={'raw':![],'where':{'id':_0x5168e5[_0xc554('0x43')]['id']}},_0x53bdff={};_0x53bdff[_0xc554('0x3a')]=_[_0xc554('0x33')](db[_0xc554('0x2f')][_0xc554('0x30')]);_0x53bdff['query']=_['keys'](_0x5168e5[_0xc554('0x34')]);_0x53bdff[_0xc554('0x35')]=_[_0xc554('0x36')](_0x53bdff[_0xc554('0x3a')],_0x53bdff[_0xc554('0x34')]);_0x23e5f3[_0xc554('0x38')]=_[_0xc554('0x36')](_0x53bdff['model'],qs[_0xc554('0x37')](_0x5168e5[_0xc554('0x34')][_0xc554('0x37')]));_0x23e5f3['attributes']=_0x23e5f3['attributes'][_0xc554('0x39')]?_0x23e5f3[_0xc554('0x38')]:_0x53bdff[_0xc554('0x3a')];if(_0x5168e5['query']['includeAll']){_0x23e5f3[_0xc554('0x44')]=[{'all':!![]}];}_0x23e5f3=_['merge']({},_0x23e5f3,_0x5168e5[_0xc554('0x3d')]);return db[_0xc554('0x2f')][_0xc554('0x45')](_0x23e5f3)[_0xc554('0x2a')](handleEntityNotFound(_0x3d49fd,null))[_0xc554('0x2a')](respondWithResult(_0x3d49fd,null))[_0xc554('0x41')](handleError(_0x3d49fd,null));};exports[_0xc554('0x46')]=function(_0x3173b8,_0x241f68){return db[_0xc554('0x2f')]['create'](_0x3173b8[_0xc554('0x47')],{})[_0xc554('0x2a')](respondWithResult(_0x241f68,0xc9))[_0xc554('0x41')](handleError(_0x241f68,null));};exports['update']=function(_0x3592aa,_0x130126){if(_0x3592aa[_0xc554('0x47')]['id']){delete _0x3592aa[_0xc554('0x47')]['id'];}return db[_0xc554('0x2f')][_0xc554('0x45')]({'where':{'id':_0x3592aa['params']['id']}})[_0xc554('0x2a')](handleEntityNotFound(_0x130126,null))[_0xc554('0x2a')](saveUpdates(_0x3592aa[_0xc554('0x47')],null))[_0xc554('0x2a')](respondWithResult(_0x130126,null))[_0xc554('0x41')](handleError(_0x130126,null));};exports['destroy']=function(_0x4c2b14,_0x4c7603){return db['DeskAccount'][_0xc554('0x45')]({'where':{'id':_0x4c2b14[_0xc554('0x43')]['id']}})[_0xc554('0x2a')](handleEntityNotFound(_0x4c7603,null))[_0xc554('0x2a')](removeEntity(_0x4c7603,null))[_0xc554('0x41')](handleError(_0x4c7603,null));};exports[_0xc554('0x48')]=function(_0x276161,_0x4e77aa,_0x31cc47){var _0x1214d6={};var _0x1f1309={};var _0xb95fb1;var _0x2595aa;return db[_0xc554('0x2f')][_0xc554('0x49')]({'where':{'id':_0x276161[_0xc554('0x43')]['id']}})[_0xc554('0x2a')](handleEntityNotFound(_0x4e77aa,null))[_0xc554('0x2a')](function(_0xc33439){if(_0xc33439){_0xb95fb1=_0xc33439;_0x1f1309[_0xc554('0x3a')]=_[_0xc554('0x33')](db[_0xc554('0x4a')]['rawAttributes']);_0x1f1309[_0xc554('0x34')]=_[_0xc554('0x33')](_0x276161['query']);_0x1f1309[_0xc554('0x35')]=_[_0xc554('0x36')](_0x1f1309[_0xc554('0x3a')],_0x1f1309['query']);_0x1214d6['attributes']=_[_0xc554('0x36')](_0x1f1309[_0xc554('0x3a')],qs[_0xc554('0x37')](_0x276161[_0xc554('0x34')][_0xc554('0x37')]));_0x1214d6[_0xc554('0x38')]=_0x1214d6[_0xc554('0x38')][_0xc554('0x39')]?_0x1214d6[_0xc554('0x38')]:_0x1f1309[_0xc554('0x3a')];_0x1214d6[_0xc554('0x4b')]=qs[_0xc554('0x3b')](_0x276161[_0xc554('0x34')][_0xc554('0x3b')]);_0x1214d6[_0xc554('0x4c')]=qs[_0xc554('0x35')](_[_0xc554('0x4d')](_0x276161[_0xc554('0x34')],_0x1f1309[_0xc554('0x35')]));if(_0x276161[_0xc554('0x34')]['filter']){_0x1214d6[_0xc554('0x4c')]=_[_0xc554('0x3c')](_0x1214d6['where'],{'$or':_[_0xc554('0x2e')](_0x1214d6[_0xc554('0x38')],function(_0x60abe9){var _0xfbf9fd={};_0xfbf9fd[_0x60abe9]={'$like':'%'+_0x276161[_0xc554('0x34')]['filter']+'%'};return _0xfbf9fd;})});}_0x1214d6=_[_0xc554('0x3c')]({},_0x1214d6,_0x276161['options']);return _0xb95fb1['getConfigurations'](_0x1214d6);}})[_0xc554('0x2a')](function(_0x363ca0){if(_0x363ca0){_0x2595aa=_0x363ca0[_0xc554('0x39')];if(!_0x276161['query'][_0xc554('0x4e')](_0xc554('0x4f'))){_0x1214d6[_0xc554('0x22')]=qs[_0xc554('0x22')](_0x276161[_0xc554('0x34')][_0xc554('0x22')]);_0x1214d6[_0xc554('0x20')]=qs[_0xc554('0x20')](_0x276161[_0xc554('0x34')][_0xc554('0x20')]);}return _0xb95fb1[_0xc554('0x48')](_0x1214d6);}})[_0xc554('0x2a')](function(_0x5c27b0){if(_0x5c27b0){return _0x5c27b0?{'count':_0x2595aa,'rows':_0x5c27b0}:null;}})[_0xc554('0x2a')](respondWithResult(_0x4e77aa,null))[_0xc554('0x41')](handleError(_0x4e77aa,null));};exports[_0xc554('0x50')]=function(_0x2e5a49,_0x35e61c,_0x3904b3){if(_0x2e5a49[_0xc554('0x47')]['id']){delete _0x2e5a49['body']['id'];}return db[_0xc554('0x2f')][_0xc554('0x49')]({'where':{'id':_0x2e5a49[_0xc554('0x43')]['id']}})[_0xc554('0x2a')](handleEntityNotFound(_0x35e61c,null))[_0xc554('0x2a')](function(_0x52d12c){if(_0x52d12c){_0x2e5a49[_0xc554('0x47')][_0xc554('0x51')]=_0x52d12c['id'];_0x2e5a49[_0xc554('0x47')][_0xc554('0x52')]=integrations['getSubjects'](_0x2e5a49[_0xc554('0x47')][_0xc554('0x53')],_0x2e5a49[_0xc554('0x47')][_0xc554('0x31')]);_0x2e5a49[_0xc554('0x47')][_0xc554('0x54')]=integrations[_0xc554('0x55')](_0x2e5a49['body'][_0xc554('0x53')],_0x2e5a49['body'][_0xc554('0x31')]);return db[_0xc554('0x4a')][_0xc554('0x46')](_0x2e5a49[_0xc554('0x47')],{'include':[{'model':db['DeskField'],'as':_0xc554('0x52')},{'model':db[_0xc554('0x56')],'as':_0xc554('0x54')}]});}return null;})[_0xc554('0x2a')](respondWithResult(_0x35e61c,null))[_0xc554('0x41')](handleError(_0x35e61c,null));};exports[_0xc554('0x57')]=function(_0x2ea0d5,_0x3f4cfb,_0x293da1){var _0x2af638=[{'name':_0xc554('0x58'),'label':_0xc554('0x58'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x301584='';return db[_0xc554('0x2f')][_0xc554('0x49')]({'where':{'id':_0x2ea0d5[_0xc554('0x43')]['id']},'attributes':['id','remoteUri',_0xc554('0x59'),_0xc554('0x5a'),_0xc554('0x5b'),_0xc554('0x5c'),_0xc554('0x5d'),_0xc554('0x5e'),_0xc554('0x5f')]})['then'](handleEntityNotFound(_0x3f4cfb,null))[_0xc554('0x2a')](function(_0x479575){if(_0x479575){_0x301584=_0x479575['remoteUri'];var _0xf23b3f=_0x301584['slice'](-0x1);if(_0xf23b3f==='/'){_0x301584=_0x301584[_0xc554('0x60')](0x0,_0x301584[_0xc554('0x61')](_0xf23b3f));}var _0x14c837={'method':_0xc554('0x62'),'uri':util[_0xc554('0x63')]('%s/custom_fields',_0x301584),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x479575['authType']===_0xc554('0x64')){_0x14c837[_0xc554('0x65')][_0xc554('0x66')]=util[_0xc554('0x63')]('Basic\x20%s',new Buffer(util[_0xc554('0x63')]('%s:%s',_0x479575[_0xc554('0x5a')],_0x479575[_0xc554('0x5b')]))[_0xc554('0x67')]('base64'));}return rp(_0x14c837)[_0xc554('0x2a')](function(_0x1d6bf4){return _0x2af638[_0xc554('0x68')](_[_0xc554('0x2e')](_0x1d6bf4[_0xc554('0x69')][_0xc554('0x6a')],function(_0x1ffd01){return{'id':_0x1ffd01['name'],'name':_0x1ffd01[_0xc554('0x2c')],'type':_0x1ffd01[_0xc554('0x31')],'active':_0x1ffd01[_0xc554('0x6b')],'label':_0x1ffd01[_0xc554('0x6c')],'custom':!![]};}));});}})[_0xc554('0x2a')](function(_0x4ea1d5){return{'count':_0x4ea1d5[_0xc554('0x39')],'rows':_0x4ea1d5};})[_0xc554('0x2a')](respondWithResult(_0x3f4cfb,null))[_0xc554('0x41')](function(_0x22f1da){var _0x5285ba=_0x2ea0d5[_0xc554('0x34')]['test']?0x1f4:_0x22f1da[_0xc554('0x6d')]||0x1f4;logger[_0xc554('0x2b')](_0xc554('0x6e'),_0xc554('0x57'),_0x5285ba,JSON[_0xc554('0x6f')](_0x22f1da));delete _0x22f1da['name'];if(_0x5285ba===0x191){_0x5285ba=0x190;}_0x3f4cfb['status'](_0x5285ba)[_0xc554('0x2d')](_0x2ea0d5[_0xc554('0x34')][_0xc554('0x70')]?{'message':_0xc554('0x71'),'statusCode':_0x22f1da[_0xc554('0x6d')]}:_0x22f1da);});}; \ No newline at end of file +var _0x4a03=['Basic\x20%s','%s:%s','toString','concat','_embedded','entries','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','offset','count','limit','apply','reject','save','then','destroy','end','sendStatus','stack','name','index','DeskAccount','rawAttributes','fieldName','type','key','map','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','create','body','update','getConfigurations','findOne','DeskConfiguration','AccountId','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','application/json','headers','Authorization'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4a03,0xf7));var _0x34a0=function(_0x5d8f8d,_0x5da5bc){_0x5d8f8d=_0x5d8f8d-0x0;var _0x4ccc6b=_0x4a03[_0x5d8f8d];return _0x4ccc6b;};'use strict';var emlformat=require(_0x34a0('0x0'));var rimraf=require(_0x34a0('0x1'));var zipdir=require(_0x34a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x34a0('0x3'));var moment=require(_0x34a0('0x4'));var BPromise=require(_0x34a0('0x5'));var Mustache=require(_0x34a0('0x6'));var util=require('util');var path=require(_0x34a0('0x7'));var sox=require(_0x34a0('0x8'));var csv=require(_0x34a0('0x9'));var ejs=require(_0x34a0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34a0('0xb'));var squel=require(_0x34a0('0xc'));var crypto=require(_0x34a0('0xd'));var jsforce=require(_0x34a0('0xe'));var deskjs=require(_0x34a0('0xf'));var toCsv=require(_0x34a0('0x9'));var querystring=require(_0x34a0('0x10'));var Papa=require(_0x34a0('0x11'));var Redis=require(_0x34a0('0x12'));var authService=require(_0x34a0('0x13'));var qs=require(_0x34a0('0x14'));var as=require(_0x34a0('0x15'));var hardwareService=require(_0x34a0('0x16'));var logger=require('../../config/logger')(_0x34a0('0x17'));var utils=require(_0x34a0('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x34a0('0x19'));var db=require(_0x34a0('0x1a'))['db'];var integrations=require(_0x34a0('0x1b'));function respondWithStatusCode(_0x37bcfa,_0x5b73bd){_0x5b73bd=_0x5b73bd||0xcc;return function(_0x30f4c4){if(_0x30f4c4){return _0x37bcfa['sendStatus'](_0x5b73bd);}return _0x37bcfa[_0x34a0('0x1c')](_0x5b73bd)['end']();};}function respondWithResult(_0x340749,_0x4974de){_0x4974de=_0x4974de||0xc8;return function(_0x2f65e9){if(_0x2f65e9){return _0x340749[_0x34a0('0x1c')](_0x4974de)[_0x34a0('0x1d')](_0x2f65e9);}};}function respondWithFilteredResult(_0x288af8,_0x40f642){return function(_0x2f3055){if(_0x2f3055){var _0x29aa8c=typeof _0x40f642['offset']===_0x34a0('0x1e')&&typeof _0x40f642['limit']==='undefined';var _0x595c6e=_0x2f3055['count'];var _0x3e3ed8=_0x29aa8c?0x0:_0x40f642[_0x34a0('0x1f')];var _0x949f8a=_0x29aa8c?_0x2f3055[_0x34a0('0x20')]:_0x40f642[_0x34a0('0x1f')]+_0x40f642[_0x34a0('0x21')];var _0x2000f9;if(_0x949f8a>=_0x595c6e){_0x949f8a=_0x595c6e;_0x2000f9=0xc8;}else{_0x2000f9=0xce;}_0x288af8['status'](_0x2000f9);return _0x288af8['set']('Content-Range',_0x3e3ed8+'-'+_0x949f8a+'/'+_0x595c6e)[_0x34a0('0x1d')](_0x2f3055);}return null;};}function patchUpdates(_0xd600fc){return function(_0x236bd1){try{jsonpatch[_0x34a0('0x22')](_0x236bd1,_0xd600fc,!![]);}catch(_0x5eea1a){return BPromise[_0x34a0('0x23')](_0x5eea1a);}return _0x236bd1[_0x34a0('0x24')]();};}function saveUpdates(_0x388233,_0x485656){return function(_0x2f04ee){if(_0x2f04ee){return _0x2f04ee['update'](_0x388233)[_0x34a0('0x25')](function(_0x1a0f29){return _0x1a0f29;});}return null;};}function removeEntity(_0x568cf1,_0x14bd9e){return function(_0x5e957e){if(_0x5e957e){return _0x5e957e[_0x34a0('0x26')]()['then'](function(){_0x568cf1[_0x34a0('0x1c')](0xcc)[_0x34a0('0x27')]();});}};}function handleEntityNotFound(_0x930e33,_0x2b360b){return function(_0x4998bc){if(!_0x4998bc){_0x930e33[_0x34a0('0x28')](0x194);}return _0x4998bc;};}function handleError(_0xa9c263,_0x4fc730){_0x4fc730=_0x4fc730||0x1f4;return function(_0x5daebf){logger['error'](_0x5daebf[_0x34a0('0x29')]);if(_0x5daebf[_0x34a0('0x2a')]){delete _0x5daebf[_0x34a0('0x2a')];}_0xa9c263[_0x34a0('0x1c')](_0x4fc730)['send'](_0x5daebf);};}exports[_0x34a0('0x2b')]=function(_0x176bbf,_0x11ac1a){var _0x36b98b={},_0x5d84de={},_0x1394c3={'count':0x0,'rows':[]};var _0x54c969=_['map'](db[_0x34a0('0x2c')][_0x34a0('0x2d')],function(_0x4de2bc){return{'name':_0x4de2bc[_0x34a0('0x2e')],'type':_0x4de2bc[_0x34a0('0x2f')][_0x34a0('0x30')]};});_0x5d84de['model']=_[_0x34a0('0x31')](_0x54c969,_0x34a0('0x2a'));_0x5d84de['query']=_['keys'](_0x176bbf['query']);_0x5d84de[_0x34a0('0x32')]=_[_0x34a0('0x33')](_0x5d84de['model'],_0x5d84de[_0x34a0('0x34')]);_0x36b98b[_0x34a0('0x35')]=_[_0x34a0('0x33')](_0x5d84de[_0x34a0('0x36')],qs[_0x34a0('0x37')](_0x176bbf[_0x34a0('0x34')][_0x34a0('0x37')]));_0x36b98b[_0x34a0('0x35')]=_0x36b98b['attributes'][_0x34a0('0x38')]?_0x36b98b[_0x34a0('0x35')]:_0x5d84de['model'];if(!_0x176bbf['query'][_0x34a0('0x39')](_0x34a0('0x3a'))){_0x36b98b[_0x34a0('0x21')]=qs[_0x34a0('0x21')](_0x176bbf[_0x34a0('0x34')]['limit']);_0x36b98b[_0x34a0('0x1f')]=qs['offset'](_0x176bbf[_0x34a0('0x34')][_0x34a0('0x1f')]);}_0x36b98b[_0x34a0('0x3b')]=qs[_0x34a0('0x3c')](_0x176bbf[_0x34a0('0x34')][_0x34a0('0x3c')]);_0x36b98b[_0x34a0('0x3d')]=qs[_0x34a0('0x32')](_[_0x34a0('0x3e')](_0x176bbf[_0x34a0('0x34')],_0x5d84de[_0x34a0('0x32')]),_0x54c969);if(_0x176bbf[_0x34a0('0x34')][_0x34a0('0x3f')]){_0x36b98b[_0x34a0('0x3d')]=_[_0x34a0('0x40')](_0x36b98b['where'],{'$or':_[_0x34a0('0x31')](_0x54c969,function(_0x13f1f5){if(_0x13f1f5[_0x34a0('0x2f')]!==_0x34a0('0x41')){var _0x4947c1={};_0x4947c1[_0x13f1f5[_0x34a0('0x2a')]]={'$like':'%'+_0x176bbf[_0x34a0('0x34')]['filter']+'%'};return _0x4947c1;}})});}_0x36b98b=_[_0x34a0('0x40')]({},_0x36b98b,_0x176bbf[_0x34a0('0x42')]);var _0x5bb9bd={'where':_0x36b98b[_0x34a0('0x3d')]};return db[_0x34a0('0x2c')][_0x34a0('0x20')](_0x5bb9bd)[_0x34a0('0x25')](function(_0x3ef71e){_0x1394c3[_0x34a0('0x20')]=_0x3ef71e;if(_0x176bbf['query'][_0x34a0('0x43')]){_0x36b98b[_0x34a0('0x44')]=[{'all':!![]}];}return db[_0x34a0('0x2c')][_0x34a0('0x45')](_0x36b98b);})[_0x34a0('0x25')](function(_0x2aea4d){_0x1394c3['rows']=_0x2aea4d;return _0x1394c3;})[_0x34a0('0x25')](respondWithFilteredResult(_0x11ac1a,_0x36b98b))[_0x34a0('0x46')](handleError(_0x11ac1a,null));};exports['show']=function(_0x3e7a49,_0xdf79db){var _0x3199f2={'raw':![],'where':{'id':_0x3e7a49[_0x34a0('0x47')]['id']}},_0x162d7d={};_0x162d7d['model']=_[_0x34a0('0x48')](db['DeskAccount'][_0x34a0('0x2d')]);_0x162d7d[_0x34a0('0x34')]=_[_0x34a0('0x48')](_0x3e7a49['query']);_0x162d7d[_0x34a0('0x32')]=_[_0x34a0('0x33')](_0x162d7d['model'],_0x162d7d['query']);_0x3199f2[_0x34a0('0x35')]=_[_0x34a0('0x33')](_0x162d7d['model'],qs[_0x34a0('0x37')](_0x3e7a49[_0x34a0('0x34')]['fields']));_0x3199f2[_0x34a0('0x35')]=_0x3199f2[_0x34a0('0x35')]['length']?_0x3199f2[_0x34a0('0x35')]:_0x162d7d[_0x34a0('0x36')];if(_0x3e7a49['query'][_0x34a0('0x43')]){_0x3199f2[_0x34a0('0x44')]=[{'all':!![]}];}_0x3199f2=_[_0x34a0('0x40')]({},_0x3199f2,_0x3e7a49[_0x34a0('0x42')]);return db[_0x34a0('0x2c')][_0x34a0('0x49')](_0x3199f2)['then'](handleEntityNotFound(_0xdf79db,null))['then'](respondWithResult(_0xdf79db,null))[_0x34a0('0x46')](handleError(_0xdf79db,null));};exports['create']=function(_0x1544e3,_0x5e261c){return db[_0x34a0('0x2c')][_0x34a0('0x4a')](_0x1544e3[_0x34a0('0x4b')],{})[_0x34a0('0x25')](respondWithResult(_0x5e261c,0xc9))['catch'](handleError(_0x5e261c,null));};exports[_0x34a0('0x4c')]=function(_0x3b4d4b,_0x2e7b62){if(_0x3b4d4b[_0x34a0('0x4b')]['id']){delete _0x3b4d4b['body']['id'];}return db[_0x34a0('0x2c')][_0x34a0('0x49')]({'where':{'id':_0x3b4d4b['params']['id']}})[_0x34a0('0x25')](handleEntityNotFound(_0x2e7b62,null))[_0x34a0('0x25')](saveUpdates(_0x3b4d4b[_0x34a0('0x4b')],null))['then'](respondWithResult(_0x2e7b62,null))['catch'](handleError(_0x2e7b62,null));};exports['destroy']=function(_0x3b4823,_0x53544f){return db['DeskAccount'][_0x34a0('0x49')]({'where':{'id':_0x3b4823[_0x34a0('0x47')]['id']}})['then'](handleEntityNotFound(_0x53544f,null))[_0x34a0('0x25')](removeEntity(_0x53544f,null))['catch'](handleError(_0x53544f,null));};exports[_0x34a0('0x4d')]=function(_0x48ac99,_0xc1ce82,_0x1efbb4){var _0x4fb636={};var _0x4f14ea={};var _0x940405;var _0x43a6bc;return db[_0x34a0('0x2c')][_0x34a0('0x4e')]({'where':{'id':_0x48ac99[_0x34a0('0x47')]['id']}})['then'](handleEntityNotFound(_0xc1ce82,null))[_0x34a0('0x25')](function(_0x167c64){if(_0x167c64){_0x940405=_0x167c64;_0x4f14ea[_0x34a0('0x36')]=_[_0x34a0('0x48')](db[_0x34a0('0x4f')]['rawAttributes']);_0x4f14ea[_0x34a0('0x34')]=_[_0x34a0('0x48')](_0x48ac99[_0x34a0('0x34')]);_0x4f14ea[_0x34a0('0x32')]=_[_0x34a0('0x33')](_0x4f14ea[_0x34a0('0x36')],_0x4f14ea[_0x34a0('0x34')]);_0x4fb636[_0x34a0('0x35')]=_[_0x34a0('0x33')](_0x4f14ea[_0x34a0('0x36')],qs[_0x34a0('0x37')](_0x48ac99[_0x34a0('0x34')][_0x34a0('0x37')]));_0x4fb636[_0x34a0('0x35')]=_0x4fb636[_0x34a0('0x35')]['length']?_0x4fb636[_0x34a0('0x35')]:_0x4f14ea['model'];_0x4fb636[_0x34a0('0x3b')]=qs['sort'](_0x48ac99[_0x34a0('0x34')][_0x34a0('0x3c')]);_0x4fb636[_0x34a0('0x3d')]=qs['filters'](_['pick'](_0x48ac99[_0x34a0('0x34')],_0x4f14ea[_0x34a0('0x32')]));if(_0x48ac99[_0x34a0('0x34')]['filter']){_0x4fb636[_0x34a0('0x3d')]=_['merge'](_0x4fb636[_0x34a0('0x3d')],{'$or':_[_0x34a0('0x31')](_0x4fb636[_0x34a0('0x35')],function(_0x19b9e8){var _0x4a89e7={};_0x4a89e7[_0x19b9e8]={'$like':'%'+_0x48ac99[_0x34a0('0x34')][_0x34a0('0x3f')]+'%'};return _0x4a89e7;})});}_0x4fb636=_['merge']({},_0x4fb636,_0x48ac99['options']);return _0x940405['getConfigurations'](_0x4fb636);}})[_0x34a0('0x25')](function(_0x25dd84){if(_0x25dd84){_0x43a6bc=_0x25dd84['length'];if(!_0x48ac99[_0x34a0('0x34')][_0x34a0('0x39')](_0x34a0('0x3a'))){_0x4fb636[_0x34a0('0x21')]=qs[_0x34a0('0x21')](_0x48ac99[_0x34a0('0x34')]['limit']);_0x4fb636[_0x34a0('0x1f')]=qs[_0x34a0('0x1f')](_0x48ac99[_0x34a0('0x34')][_0x34a0('0x1f')]);}return _0x940405[_0x34a0('0x4d')](_0x4fb636);}})[_0x34a0('0x25')](function(_0x13664a){if(_0x13664a){return _0x13664a?{'count':_0x43a6bc,'rows':_0x13664a}:null;}})[_0x34a0('0x25')](respondWithResult(_0xc1ce82,null))[_0x34a0('0x46')](handleError(_0xc1ce82,null));};exports['addConfiguration']=function(_0x387375,_0x3cfc20,_0x550706){if(_0x387375[_0x34a0('0x4b')]['id']){delete _0x387375[_0x34a0('0x4b')]['id'];}return db[_0x34a0('0x2c')][_0x34a0('0x4e')]({'where':{'id':_0x387375[_0x34a0('0x47')]['id']}})[_0x34a0('0x25')](handleEntityNotFound(_0x3cfc20,null))[_0x34a0('0x25')](function(_0x2921d6){if(_0x2921d6){_0x387375[_0x34a0('0x4b')][_0x34a0('0x50')]=_0x2921d6['id'];_0x387375[_0x34a0('0x4b')]['Subjects']=integrations['getSubjects'](_0x387375[_0x34a0('0x4b')][_0x34a0('0x51')],_0x387375[_0x34a0('0x4b')][_0x34a0('0x2f')]);_0x387375['body'][_0x34a0('0x52')]=integrations[_0x34a0('0x53')](_0x387375['body'][_0x34a0('0x51')],_0x387375[_0x34a0('0x4b')][_0x34a0('0x2f')]);return db[_0x34a0('0x4f')][_0x34a0('0x4a')](_0x387375[_0x34a0('0x4b')],{'include':[{'model':db[_0x34a0('0x54')],'as':_0x34a0('0x55')},{'model':db[_0x34a0('0x54')],'as':_0x34a0('0x52')}]});}return null;})[_0x34a0('0x25')](respondWithResult(_0x3cfc20,null))[_0x34a0('0x46')](handleError(_0x3cfc20,null));};exports[_0x34a0('0x56')]=function(_0x1a6306,_0x517afb,_0x23284d){var _0x5b1b9f=[{'name':_0x34a0('0x57'),'label':_0x34a0('0x57'),'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 _0x111f34='';return db[_0x34a0('0x2c')][_0x34a0('0x4e')]({'where':{'id':_0x1a6306[_0x34a0('0x47')]['id']},'attributes':['id','remoteUri',_0x34a0('0x58'),_0x34a0('0x59'),_0x34a0('0x5a'),_0x34a0('0x5b'),_0x34a0('0x5c'),_0x34a0('0x5d'),_0x34a0('0x5e')]})['then'](handleEntityNotFound(_0x517afb,null))['then'](function(_0x2c122c){if(_0x2c122c){_0x111f34=_0x2c122c[_0x34a0('0x5f')];var _0x53b19f=_0x111f34[_0x34a0('0x60')](-0x1);if(_0x53b19f==='/'){_0x111f34=_0x111f34[_0x34a0('0x61')](0x0,_0x111f34[_0x34a0('0x62')](_0x53b19f));}var _0x8d949={'method':_0x34a0('0x63'),'uri':util[_0x34a0('0x64')]('%s/custom_fields',_0x111f34),'headers':{'Content-Type':_0x34a0('0x65'),'Accept':_0x34a0('0x65')},'json':!![]};if(_0x2c122c[_0x34a0('0x58')]==='basic'){_0x8d949[_0x34a0('0x66')][_0x34a0('0x67')]=util['format'](_0x34a0('0x68'),new Buffer(util[_0x34a0('0x64')](_0x34a0('0x69'),_0x2c122c[_0x34a0('0x59')],_0x2c122c['password']))[_0x34a0('0x6a')]('base64'));}return rp(_0x8d949)[_0x34a0('0x25')](function(_0xc4c58a){return _0x5b1b9f[_0x34a0('0x6b')](_['map'](_0xc4c58a[_0x34a0('0x6c')][_0x34a0('0x6d')],function(_0x2659a8){return{'id':_0x2659a8['name'],'name':_0x2659a8[_0x34a0('0x2a')],'type':_0x2659a8[_0x34a0('0x2f')],'active':_0x2659a8['active'],'label':_0x2659a8[_0x34a0('0x6e')],'custom':!![]};}));});}})['then'](function(_0x95c886){return{'count':_0x95c886['length'],'rows':_0x95c886};})[_0x34a0('0x25')](respondWithResult(_0x517afb,null))[_0x34a0('0x46')](function(_0x895589){var _0x5f185b=_0x1a6306[_0x34a0('0x34')][_0x34a0('0x6f')]?0x1f4:_0x895589['statusCode']||0x1f4;logger['error'](_0x34a0('0x70'),'getFields',_0x5f185b,JSON[_0x34a0('0x71')](_0x895589));delete _0x895589['name'];if(_0x5f185b===0x191){_0x5f185b=0x190;}_0x517afb[_0x34a0('0x1c')](_0x5f185b)[_0x34a0('0x72')](_0x1a6306[_0x34a0('0x34')]['test']?{'message':_0x34a0('0x73'),'statusCode':_0x895589[_0x34a0('0x74')]}:_0x895589);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index d1a1724..a98bea5 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 _0x7587=['../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes'];(function(_0x212072,_0x4586d3){var _0x35db9e=function(_0x4312b8){while(--_0x4312b8){_0x212072['push'](_0x212072['shift']());}};_0x35db9e(++_0x4586d3);}(_0x7587,0x1b1));var _0x7758=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7587[_0x40ac5e];return _0x2839d6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7758('0x0'))('api');var moment=require(_0x7758('0x1'));var BPromise=require(_0x7758('0x2'));var rp=require(_0x7758('0x3'));var fs=require('fs');var path=require(_0x7758('0x4'));var rimraf=require('rimraf');var config=require(_0x7758('0x5'));var attributes=require(_0x7758('0x6'));var integrations=require(_0x7758('0x7'));module['exports']=function(_0x10d056,_0x4e0a04){return _0x10d056[_0x7758('0x8')](_0x7758('0x9'),attributes,{'tableName':_0x7758('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a85=['moment','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','DeskAccount','lodash','util','../../config/logger','api'];(function(_0x10f059,_0xb56fdd){var _0x4ab4ed=function(_0x4419b9){while(--_0x4419b9){_0x10f059['push'](_0x10f059['shift']());}};_0x4ab4ed(++_0xb56fdd);}(_0x4a85,0x80));var _0x54a8=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x4a85[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x54a8('0x0'));var util=require(_0x54a8('0x1'));var logger=require(_0x54a8('0x2'))(_0x54a8('0x3'));var moment=require(_0x54a8('0x4'));var BPromise=require('bluebird');var rp=require(_0x54a8('0x5'));var fs=require('fs');var path=require(_0x54a8('0x6'));var rimraf=require(_0x54a8('0x7'));var config=require(_0x54a8('0x8'));var attributes=require(_0x54a8('0x9'));var integrations=require(_0x54a8('0xa'));module['exports']=function(_0x52c251,_0x16c1b8){return _0x52c251['define'](_0x54a8('0xb'),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 3653362..d851d45 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 _0x7aee=['stringify','ShowDeskAccount','DeskAccount','find','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetDeskAccount','findAll','options','where','attributes','limit','include','map','model'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7aee,0x14e));var _0xe7ae=function(_0x1b6308,_0x26cedc){_0x1b6308=_0x1b6308-0x0;var _0x55dffd=_0x7aee[_0x1b6308];return _0x55dffd;};'use strict';var _=require('lodash');var util=require(_0xe7ae('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe7ae('0x1'));var fs=require('fs');var Redis=require(_0xe7ae('0x2'));var db=require(_0xe7ae('0x3'))['db'];var utils=require(_0xe7ae('0x4'));var logger=require(_0xe7ae('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe7ae('0x6'));var client=jayson[_0xe7ae('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17de9a,_0x315635,_0x21e269){return new BPromise(function(_0x4544b1,_0x4b7990){return client['request'](_0x17de9a,_0x21e269)[_0xe7ae('0x8')](function(_0x57d2fa){logger['info'](_0xe7ae('0x9'),_0x315635,_0xe7ae('0xa'));logger[_0xe7ae('0xb')](_0xe7ae('0xc'),_0x315635,_0xe7ae('0xa'),JSON['stringify'](_0x57d2fa));if(_0x57d2fa[_0xe7ae('0xd')]){if(_0x57d2fa[_0xe7ae('0xd')][_0xe7ae('0xe')]===0x1f4){logger[_0xe7ae('0xd')](_0xe7ae('0x9'),_0x315635,_0x57d2fa[_0xe7ae('0xd')][_0xe7ae('0xf')]);return _0x4b7990(_0x57d2fa[_0xe7ae('0xd')][_0xe7ae('0xf')]);}logger[_0xe7ae('0xd')](_0xe7ae('0x9'),_0x315635,_0x57d2fa['error']['message']);return _0x4544b1(_0x57d2fa[_0xe7ae('0xd')][_0xe7ae('0xf')]);}else{logger['info'](_0xe7ae('0x9'),_0x315635,'request\x20sent');_0x4544b1(_0x57d2fa['result'][_0xe7ae('0xf')]);}})[_0xe7ae('0x10')](function(_0x3468c0){logger[_0xe7ae('0xd')](_0xe7ae('0x9'),_0x315635,_0x3468c0);_0x4b7990(_0x3468c0);});});}exports[_0xe7ae('0x11')]=function(_0x44c7ee){var _0x57f33f=this;return new Promise(function(_0x209174,_0x4d8a18){return db['DeskAccount'][_0xe7ae('0x12')]({'raw':_0x44c7ee[_0xe7ae('0x13')]?_0x44c7ee['options']['raw']===undefined?!![]:![]:!![],'where':_0x44c7ee[_0xe7ae('0x13')]?_0x44c7ee['options'][_0xe7ae('0x14')]||null:null,'attributes':_0x44c7ee['options']?_0x44c7ee['options'][_0xe7ae('0x15')]||null:null,'limit':_0x44c7ee[_0xe7ae('0x13')]?_0x44c7ee[_0xe7ae('0x13')][_0xe7ae('0x16')]||null:null,'include':_0x44c7ee[_0xe7ae('0x13')]?_0x44c7ee[_0xe7ae('0x13')][_0xe7ae('0x17')]?_[_0xe7ae('0x18')](_0x44c7ee[_0xe7ae('0x13')]['include'],function(_0x284915){return{'model':db[_0x284915[_0xe7ae('0x19')]],'as':_0x284915['as'],'attributes':_0x284915[_0xe7ae('0x15')],'include':_0x284915[_0xe7ae('0x17')]?_[_0xe7ae('0x18')](_0x284915['include'],function(_0x5d145a){return{'model':db[_0x5d145a[_0xe7ae('0x19')]],'as':_0x5d145a['as'],'attributes':_0x5d145a[_0xe7ae('0x15')],'include':_0x5d145a[_0xe7ae('0x17')]?_[_0xe7ae('0x18')](_0x5d145a[_0xe7ae('0x17')],function(_0x3defbb){return{'model':db[_0x3defbb['model']],'as':_0x3defbb['as'],'attributes':_0x3defbb[_0xe7ae('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29b5d8){logger['info'](_0xe7ae('0x11'),_0x44c7ee);logger[_0xe7ae('0xb')](_0xe7ae('0x11'),_0x44c7ee,JSON[_0xe7ae('0x1a')](_0x29b5d8));_0x209174(_0x29b5d8);})[_0xe7ae('0x10')](function(_0xb9b137){logger[_0xe7ae('0xd')](_0xe7ae('0x11'),_0xb9b137[_0xe7ae('0xf')],_0x44c7ee);_0x4d8a18(_0x57f33f['error'](0x1f4,_0xb9b137[_0xe7ae('0xf')]));});});};exports[_0xe7ae('0x1b')]=function(_0x3fd668){var _0x1861d2=this;return new Promise(function(_0x181f6a,_0x5f00e8){return db[_0xe7ae('0x1c')][_0xe7ae('0x1d')]({'raw':_0x3fd668[_0xe7ae('0x13')]?_0x3fd668[_0xe7ae('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x3fd668[_0xe7ae('0x13')]?_0x3fd668[_0xe7ae('0x13')]['where']||null:null,'attributes':_0x3fd668[_0xe7ae('0x13')]?_0x3fd668['options'][_0xe7ae('0x15')]||null:null,'include':_0x3fd668['options']?_0x3fd668[_0xe7ae('0x13')][_0xe7ae('0x17')]?_[_0xe7ae('0x18')](_0x3fd668['options'][_0xe7ae('0x17')],function(_0x32fdc6){return{'model':db[_0x32fdc6[_0xe7ae('0x19')]],'as':_0x32fdc6['as'],'attributes':_0x32fdc6[_0xe7ae('0x15')],'include':_0x32fdc6['include']?_[_0xe7ae('0x18')](_0x32fdc6[_0xe7ae('0x17')],function(_0x3fd4ec){return{'model':db[_0x3fd4ec['model']],'as':_0x3fd4ec['as'],'attributes':_0x3fd4ec[_0xe7ae('0x15')],'include':_0x3fd4ec[_0xe7ae('0x17')]?_['map'](_0x3fd4ec[_0xe7ae('0x17')],function(_0x12c651){return{'model':db[_0x12c651['model']],'as':_0x12c651['as'],'attributes':_0x12c651['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x32b92c){logger['info'](_0xe7ae('0x1b'),_0x3fd668);logger[_0xe7ae('0xb')](_0xe7ae('0x1b'),_0x3fd668,JSON[_0xe7ae('0x1a')](_0x32b92c));_0x181f6a(_0x32b92c);})['catch'](function(_0x11ea81){logger['error'](_0xe7ae('0x1b'),_0x11ea81[_0xe7ae('0xf')],_0x3fd668);_0x5f00e8(_0x1861d2[_0xe7ae('0xd')](0x1f4,_0x11ea81[_0xe7ae('0xf')]));});});}; \ No newline at end of file +var _0x3de9=['model','attributes','GetDeskAccount','catch','ShowDeskAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','DeskAccount','findAll','options','raw','where','limit','include','map'];(function(_0x1b3470,_0x3fadda){var _0x2f54cb=function(_0x3c8028){while(--_0x3c8028){_0x1b3470['push'](_0x1b3470['shift']());}};_0x2f54cb(++_0x3fadda);}(_0x3de9,0x186));var _0x93de=function(_0x5cfdb0,_0x1f43bd){_0x5cfdb0=_0x5cfdb0-0x0;var _0xe9e7fc=_0x3de9[_0x5cfdb0];return _0xe9e7fc;};'use strict';var _=require('lodash');var util=require(_0x93de('0x0'));var moment=require(_0x93de('0x1'));var BPromise=require(_0x93de('0x2'));var rs=require(_0x93de('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93de('0x4'))['db'];var utils=require(_0x93de('0x5'));var logger=require(_0x93de('0x6'))('rpc');var config=require(_0x93de('0x7'));var jayson=require(_0x93de('0x8'));var client=jayson[_0x93de('0x9')][_0x93de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44a762,_0x1a381d,_0x4cc1c5){return new BPromise(function(_0x4617cc,_0x535937){return client[_0x93de('0xb')](_0x44a762,_0x4cc1c5)[_0x93de('0xc')](function(_0x29ebff){logger[_0x93de('0xd')](_0x93de('0xe'),_0x1a381d,_0x93de('0xf'));logger[_0x93de('0x10')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x1a381d,_0x93de('0xf'),JSON[_0x93de('0x11')](_0x29ebff));if(_0x29ebff['error']){if(_0x29ebff[_0x93de('0x12')][_0x93de('0x13')]===0x1f4){logger[_0x93de('0x12')](_0x93de('0xe'),_0x1a381d,_0x29ebff[_0x93de('0x12')][_0x93de('0x14')]);return _0x535937(_0x29ebff[_0x93de('0x12')][_0x93de('0x14')]);}logger[_0x93de('0x12')](_0x93de('0xe'),_0x1a381d,_0x29ebff[_0x93de('0x12')]['message']);return _0x4617cc(_0x29ebff[_0x93de('0x12')][_0x93de('0x14')]);}else{logger[_0x93de('0xd')](_0x93de('0xe'),_0x1a381d,'request\x20sent');_0x4617cc(_0x29ebff[_0x93de('0x15')]['message']);}})['catch'](function(_0x4b724c){logger[_0x93de('0x12')](_0x93de('0xe'),_0x1a381d,_0x4b724c);_0x535937(_0x4b724c);});});}exports['GetDeskAccount']=function(_0x106683){var _0x595f4c=this;return new Promise(function(_0x5a4854,_0x447462){return db[_0x93de('0x16')][_0x93de('0x17')]({'raw':_0x106683[_0x93de('0x18')]?_0x106683[_0x93de('0x18')][_0x93de('0x19')]===undefined?!![]:![]:!![],'where':_0x106683['options']?_0x106683[_0x93de('0x18')][_0x93de('0x1a')]||null:null,'attributes':_0x106683[_0x93de('0x18')]?_0x106683[_0x93de('0x18')]['attributes']||null:null,'limit':_0x106683[_0x93de('0x18')]?_0x106683[_0x93de('0x18')][_0x93de('0x1b')]||null:null,'include':_0x106683['options']?_0x106683['options'][_0x93de('0x1c')]?_[_0x93de('0x1d')](_0x106683[_0x93de('0x18')]['include'],function(_0x28c6ee){return{'model':db[_0x28c6ee[_0x93de('0x1e')]],'as':_0x28c6ee['as'],'attributes':_0x28c6ee[_0x93de('0x1f')],'include':_0x28c6ee[_0x93de('0x1c')]?_[_0x93de('0x1d')](_0x28c6ee[_0x93de('0x1c')],function(_0x532210){return{'model':db[_0x532210[_0x93de('0x1e')]],'as':_0x532210['as'],'attributes':_0x532210[_0x93de('0x1f')],'include':_0x532210[_0x93de('0x1c')]?_[_0x93de('0x1d')](_0x532210[_0x93de('0x1c')],function(_0x387b01){return{'model':db[_0x387b01[_0x93de('0x1e')]],'as':_0x387b01['as'],'attributes':_0x387b01[_0x93de('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x93de('0xc')](function(_0x1101d5){logger[_0x93de('0xd')](_0x93de('0x20'),_0x106683);logger['debug'](_0x93de('0x20'),_0x106683,JSON[_0x93de('0x11')](_0x1101d5));_0x5a4854(_0x1101d5);})[_0x93de('0x21')](function(_0x8cc45b){logger['error'](_0x93de('0x20'),_0x8cc45b['message'],_0x106683);_0x447462(_0x595f4c[_0x93de('0x12')](0x1f4,_0x8cc45b[_0x93de('0x14')]));});});};exports[_0x93de('0x22')]=function(_0x46e932){var _0x368452=this;return new Promise(function(_0x30142a,_0x1b188c){return db['DeskAccount']['find']({'raw':_0x46e932[_0x93de('0x18')]?_0x46e932[_0x93de('0x18')][_0x93de('0x19')]===undefined?!![]:![]:!![],'where':_0x46e932[_0x93de('0x18')]?_0x46e932[_0x93de('0x18')]['where']||null:null,'attributes':_0x46e932['options']?_0x46e932['options'][_0x93de('0x1f')]||null:null,'include':_0x46e932['options']?_0x46e932[_0x93de('0x18')]['include']?_['map'](_0x46e932[_0x93de('0x18')][_0x93de('0x1c')],function(_0x561016){return{'model':db[_0x561016[_0x93de('0x1e')]],'as':_0x561016['as'],'attributes':_0x561016[_0x93de('0x1f')],'include':_0x561016['include']?_[_0x93de('0x1d')](_0x561016['include'],function(_0x3951f4){return{'model':db[_0x3951f4['model']],'as':_0x3951f4['as'],'attributes':_0x3951f4['attributes'],'include':_0x3951f4[_0x93de('0x1c')]?_[_0x93de('0x1d')](_0x3951f4[_0x93de('0x1c')],function(_0x189942){return{'model':db[_0x189942[_0x93de('0x1e')]],'as':_0x189942['as'],'attributes':_0x189942[_0x93de('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x93de('0xc')](function(_0x5731f6){logger[_0x93de('0xd')](_0x93de('0x22'),_0x46e932);logger[_0x93de('0x10')](_0x93de('0x22'),_0x46e932,JSON[_0x93de('0x11')](_0x5731f6));_0x30142a(_0x5731f6);})[_0x93de('0x21')](function(_0x11f843){logger['error'](_0x93de('0x22'),_0x11f843[_0x93de('0x14')],_0x46e932);_0x1b188c(_0x368452[_0x93de('0x12')](0x1f4,_0x11f843[_0x93de('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 5d79ab8..9c98a22 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 _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x328f3b,_0x449c71){var _0x326d7b=function(_0xbc39c3){while(--_0xbc39c3){_0x328f3b['push'](_0x328f3b['shift']());}};_0x326d7b(++_0x449c71);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file +var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x3e7bb8,_0x11f26c){var _0x160bf4=function(_0xbc65a5){while(--_0xbc65a5){_0x3e7bb8['push'](_0x3e7bb8['shift']());}};_0x160bf4(++_0x11f26c);}(_0x3e74,0x175));var _0x43e7=function(_0x2ca624,_0x5955db){_0x2ca624=_0x2ca624-0x0;var _0x1da4da=_0x3e74[_0x2ca624];return _0x1da4da;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index f27b114..64cb74a 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 _0x12c2=['STRING','sequelize'];(function(_0x523a68,_0x149c08){var _0x2e1b0d=function(_0x3e5d8e){while(--_0x3e5d8e){_0x523a68['push'](_0x523a68['shift']());}};_0x2e1b0d(++_0x149c08);}(_0x12c2,0xd3));var _0x212c=function(_0x1a7ab0,_0x10e9b8){_0x1a7ab0=_0x1a7ab0-0x0;var _0x2fc724=_0x12c2[_0x1a7ab0];return _0x2fc724;};'use strict';var Sequelize=require(_0x212c('0x0'));module['exports']={'name':{'type':Sequelize[_0x212c('0x1')]},'description':{'type':Sequelize[_0x212c('0x1')]}}; \ No newline at end of file +var _0x2112=['exports','STRING','sequelize'];(function(_0x5a2462,_0x537186){var _0x57e4cc=function(_0xee5056){while(--_0xee5056){_0x5a2462['push'](_0x5a2462['shift']());}};_0x57e4cc(++_0x537186);}(_0x2112,0x95));var _0x2211=function(_0x261ae3,_0x4a4f4a){_0x261ae3=_0x261ae3-0x0;var _0x51f828=_0x2112[_0x261ae3];return _0x51f828;};'use strict';var Sequelize=require(_0x2211('0x0'));module[_0x2211('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2211('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 5a5575a..d976ff8 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 _0xd69a=['getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','DeskConfiguration','includeAll','catch','include','options','find','create','body','params','destroy','findOne','DeskField','getFields','nolimit','getSubjects','getDescriptions'];(function(_0x11524b,_0x1884a4){var _0x20c8e1=function(_0x21a15e){while(--_0x21a15e){_0x11524b['push'](_0x11524b['shift']());}};_0x20c8e1(++_0x1884a4);}(_0xd69a,0xa5));var _0xad69=function(_0x3c8fcc,_0x27cdf2){_0x3c8fcc=_0x3c8fcc-0x0;var _0x622b9b=_0xd69a[_0x3c8fcc];return _0x622b9b;};'use strict';var emlformat=require(_0xad69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad69('0x1'));var jsonpatch=require(_0xad69('0x2'));var rp=require(_0xad69('0x3'));var moment=require(_0xad69('0x4'));var BPromise=require(_0xad69('0x5'));var Mustache=require(_0xad69('0x6'));var util=require(_0xad69('0x7'));var path=require(_0xad69('0x8'));var sox=require(_0xad69('0x9'));var csv=require(_0xad69('0xa'));var ejs=require(_0xad69('0xb'));var fs=require('fs');var fs_extra=require(_0xad69('0xc'));var _=require(_0xad69('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xad69('0xe'));var authService=require(_0xad69('0xf'));var qs=require(_0xad69('0x10'));var as=require(_0xad69('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad69('0x12'))(_0xad69('0x13'));var utils=require(_0xad69('0x14'));var config=require(_0xad69('0x15'));var licenseUtil=require(_0xad69('0x16'));var db=require(_0xad69('0x17'))['db'];function respondWithStatusCode(_0x264223,_0x161141){_0x161141=_0x161141||0xcc;return function(_0xc756ae){if(_0xc756ae){return _0x264223[_0xad69('0x18')](_0x161141);}return _0x264223['status'](_0x161141)[_0xad69('0x19')]();};}function respondWithResult(_0x45602d,_0x19560f){_0x19560f=_0x19560f||0xc8;return function(_0x4d868b){if(_0x4d868b){return _0x45602d[_0xad69('0x1a')](_0x19560f)['json'](_0x4d868b);}};}function respondWithFilteredResult(_0x51aa6f,_0x5ebdd0){return function(_0x48b9da){if(_0x48b9da){var _0x5c92ec=typeof _0x5ebdd0[_0xad69('0x1b')]===_0xad69('0x1c')&&typeof _0x5ebdd0[_0xad69('0x1d')]==='undefined';var _0x32840d=_0x48b9da[_0xad69('0x1e')];var _0x549c56=_0x5c92ec?0x0:_0x5ebdd0[_0xad69('0x1b')];var _0x5bf8a3=_0x5c92ec?_0x48b9da[_0xad69('0x1e')]:_0x5ebdd0['offset']+_0x5ebdd0[_0xad69('0x1d')];var _0x39fb80;if(_0x5bf8a3>=_0x32840d){_0x5bf8a3=_0x32840d;_0x39fb80=0xc8;}else{_0x39fb80=0xce;}_0x51aa6f['status'](_0x39fb80);return _0x51aa6f['set'](_0xad69('0x1f'),_0x549c56+'-'+_0x5bf8a3+'/'+_0x32840d)[_0xad69('0x20')](_0x48b9da);}return null;};}function patchUpdates(_0x11aef6){return function(_0x2dee43){try{jsonpatch[_0xad69('0x21')](_0x2dee43,_0x11aef6,!![]);}catch(_0x48ca70){return BPromise[_0xad69('0x22')](_0x48ca70);}return _0x2dee43[_0xad69('0x23')]();};}function saveUpdates(_0x511e6c,_0x4e26e4){return function(_0x111033){if(_0x111033){return _0x111033[_0xad69('0x24')](_0x511e6c)[_0xad69('0x25')](function(_0x3da05e){return _0x3da05e;});}return null;};}function removeEntity(_0x2ca6aa,_0x150ce2){return function(_0x166f19){if(_0x166f19){return _0x166f19['destroy']()['then'](function(){_0x2ca6aa[_0xad69('0x1a')](0xcc)[_0xad69('0x19')]();});}};}function handleEntityNotFound(_0x2de583,_0x2a52a2){return function(_0xc6621){if(!_0xc6621){_0x2de583[_0xad69('0x18')](0x194);}return _0xc6621;};}function handleError(_0x4fbe87,_0x21468c){_0x21468c=_0x21468c||0x1f4;return function(_0x1a338e){logger['error'](_0x1a338e['stack']);if(_0x1a338e[_0xad69('0x26')]){delete _0x1a338e[_0xad69('0x26')];}_0x4fbe87[_0xad69('0x1a')](_0x21468c)[_0xad69('0x27')](_0x1a338e);};}exports[_0xad69('0x28')]=function(_0x16283d,_0x1d6387){var _0x286113={},_0x555c2a={},_0x41cf75={'count':0x0,'rows':[]};var _0x2e6214=_[_0xad69('0x29')](db['DeskConfiguration'][_0xad69('0x2a')],function(_0x42da3d){return{'name':_0x42da3d[_0xad69('0x2b')],'type':_0x42da3d[_0xad69('0x2c')][_0xad69('0x2d')]};});_0x555c2a[_0xad69('0x2e')]=_[_0xad69('0x29')](_0x2e6214,_0xad69('0x26'));_0x555c2a[_0xad69('0x2f')]=_[_0xad69('0x30')](_0x16283d[_0xad69('0x2f')]);_0x555c2a[_0xad69('0x31')]=_[_0xad69('0x32')](_0x555c2a['model'],_0x555c2a[_0xad69('0x2f')]);_0x286113[_0xad69('0x33')]=_[_0xad69('0x32')](_0x555c2a[_0xad69('0x2e')],qs[_0xad69('0x34')](_0x16283d['query']['fields']));_0x286113[_0xad69('0x33')]=_0x286113['attributes'][_0xad69('0x35')]?_0x286113[_0xad69('0x33')]:_0x555c2a['model'];if(!_0x16283d[_0xad69('0x2f')][_0xad69('0x36')]('nolimit')){_0x286113[_0xad69('0x1d')]=qs['limit'](_0x16283d[_0xad69('0x2f')][_0xad69('0x1d')]);_0x286113['offset']=qs[_0xad69('0x1b')](_0x16283d[_0xad69('0x2f')][_0xad69('0x1b')]);}_0x286113[_0xad69('0x37')]=qs[_0xad69('0x38')](_0x16283d[_0xad69('0x2f')][_0xad69('0x38')]);_0x286113[_0xad69('0x39')]=qs[_0xad69('0x31')](_[_0xad69('0x3a')](_0x16283d['query'],_0x555c2a[_0xad69('0x31')]),_0x2e6214);if(_0x16283d[_0xad69('0x2f')][_0xad69('0x3b')]){_0x286113[_0xad69('0x39')]=_['merge'](_0x286113[_0xad69('0x39')],{'$or':_[_0xad69('0x29')](_0x2e6214,function(_0x2dba43){if(_0x2dba43[_0xad69('0x2c')]!==_0xad69('0x3c')){var _0xcf4c24={};_0xcf4c24[_0x2dba43[_0xad69('0x26')]]={'$like':'%'+_0x16283d['query'][_0xad69('0x3b')]+'%'};return _0xcf4c24;}})});}_0x286113=_[_0xad69('0x3d')]({},_0x286113,_0x16283d['options']);var _0xee81f2={'where':_0x286113[_0xad69('0x39')]};return db[_0xad69('0x3e')][_0xad69('0x1e')](_0xee81f2)[_0xad69('0x25')](function(_0x3ab881){_0x41cf75[_0xad69('0x1e')]=_0x3ab881;if(_0x16283d['query'][_0xad69('0x3f')]){_0x286113['include']=[{'all':!![]}];}return db[_0xad69('0x3e')]['findAll'](_0x286113);})[_0xad69('0x25')](function(_0x21673f){_0x41cf75['rows']=_0x21673f;return _0x41cf75;})[_0xad69('0x25')](respondWithFilteredResult(_0x1d6387,_0x286113))[_0xad69('0x40')](handleError(_0x1d6387,null));};exports['show']=function(_0x45bcaa,_0x4d007d){var _0x280bab={'raw':![],'where':{'id':_0x45bcaa['params']['id']}},_0x4b9b51={};_0x4b9b51[_0xad69('0x2e')]=_[_0xad69('0x30')](db['DeskConfiguration'][_0xad69('0x2a')]);_0x4b9b51[_0xad69('0x2f')]=_[_0xad69('0x30')](_0x45bcaa[_0xad69('0x2f')]);_0x4b9b51[_0xad69('0x31')]=_[_0xad69('0x32')](_0x4b9b51['model'],_0x4b9b51[_0xad69('0x2f')]);_0x280bab[_0xad69('0x33')]=_[_0xad69('0x32')](_0x4b9b51['model'],qs['fields'](_0x45bcaa[_0xad69('0x2f')][_0xad69('0x34')]));_0x280bab[_0xad69('0x33')]=_0x280bab[_0xad69('0x33')][_0xad69('0x35')]?_0x280bab[_0xad69('0x33')]:_0x4b9b51[_0xad69('0x2e')];if(_0x45bcaa[_0xad69('0x2f')]['includeAll']){_0x280bab[_0xad69('0x41')]=[{'all':!![]}];}_0x280bab=_[_0xad69('0x3d')]({},_0x280bab,_0x45bcaa[_0xad69('0x42')]);return db[_0xad69('0x3e')][_0xad69('0x43')](_0x280bab)[_0xad69('0x25')](handleEntityNotFound(_0x4d007d,null))['then'](respondWithResult(_0x4d007d,null))['catch'](handleError(_0x4d007d,null));};exports[_0xad69('0x44')]=function(_0x52c028,_0x448029){return db[_0xad69('0x3e')][_0xad69('0x44')](_0x52c028[_0xad69('0x45')],{})[_0xad69('0x25')](respondWithResult(_0x448029,0xc9))[_0xad69('0x40')](handleError(_0x448029,null));};exports[_0xad69('0x24')]=function(_0x56bb3b,_0x199fd6){if(_0x56bb3b[_0xad69('0x45')]['id']){delete _0x56bb3b[_0xad69('0x45')]['id'];}return db[_0xad69('0x3e')]['find']({'where':{'id':_0x56bb3b[_0xad69('0x46')]['id']}})['then'](handleEntityNotFound(_0x199fd6,null))[_0xad69('0x25')](saveUpdates(_0x56bb3b['body'],null))[_0xad69('0x25')](respondWithResult(_0x199fd6,null))[_0xad69('0x40')](handleError(_0x199fd6,null));};exports[_0xad69('0x47')]=function(_0x2b4df3,_0x1a95c4){return db[_0xad69('0x3e')][_0xad69('0x43')]({'where':{'id':_0x2b4df3[_0xad69('0x46')]['id']}})[_0xad69('0x25')](handleEntityNotFound(_0x1a95c4,null))['then'](removeEntity(_0x1a95c4,null))[_0xad69('0x40')](handleError(_0x1a95c4,null));};exports['getFields']=function(_0x1d0583,_0x5234f8,_0x2e3507){var _0x41d912={};var _0x1b77ab={};var _0x179a0c;var _0x239c68;return db['DeskConfiguration'][_0xad69('0x48')]({'where':{'id':_0x1d0583[_0xad69('0x46')]['id']}})[_0xad69('0x25')](handleEntityNotFound(_0x5234f8,null))[_0xad69('0x25')](function(_0x3a54b8){if(_0x3a54b8){_0x179a0c=_0x3a54b8;_0x1b77ab[_0xad69('0x2e')]=_[_0xad69('0x30')](db[_0xad69('0x49')][_0xad69('0x2a')]);_0x1b77ab[_0xad69('0x2f')]=_['keys'](_0x1d0583[_0xad69('0x2f')]);_0x1b77ab[_0xad69('0x31')]=_[_0xad69('0x32')](_0x1b77ab[_0xad69('0x2e')],_0x1b77ab[_0xad69('0x2f')]);_0x41d912[_0xad69('0x33')]=_[_0xad69('0x32')](_0x1b77ab[_0xad69('0x2e')],qs[_0xad69('0x34')](_0x1d0583[_0xad69('0x2f')][_0xad69('0x34')]));_0x41d912[_0xad69('0x33')]=_0x41d912['attributes'][_0xad69('0x35')]?_0x41d912[_0xad69('0x33')]:_0x1b77ab[_0xad69('0x2e')];_0x41d912[_0xad69('0x37')]=qs[_0xad69('0x38')](_0x1d0583['query'][_0xad69('0x38')]);_0x41d912[_0xad69('0x39')]=qs[_0xad69('0x31')](_[_0xad69('0x3a')](_0x1d0583[_0xad69('0x2f')],_0x1b77ab[_0xad69('0x31')]));if(_0x1d0583[_0xad69('0x2f')][_0xad69('0x3b')]){_0x41d912[_0xad69('0x39')]=_[_0xad69('0x3d')](_0x41d912[_0xad69('0x39')],{'$or':_['map'](_0x41d912[_0xad69('0x33')],function(_0x5f189b){var _0x2e0507={};_0x2e0507[_0x5f189b]={'$like':'%'+_0x1d0583[_0xad69('0x2f')][_0xad69('0x3b')]+'%'};return _0x2e0507;})});}_0x41d912=_[_0xad69('0x3d')]({},_0x41d912,_0x1d0583[_0xad69('0x42')]);return _0x179a0c[_0xad69('0x4a')](_0x41d912);}})[_0xad69('0x25')](function(_0x576b5d){if(_0x576b5d){_0x239c68=_0x576b5d['length'];if(!_0x1d0583['query'][_0xad69('0x36')](_0xad69('0x4b'))){_0x41d912[_0xad69('0x1d')]=qs[_0xad69('0x1d')](_0x1d0583['query'][_0xad69('0x1d')]);_0x41d912[_0xad69('0x1b')]=qs['offset'](_0x1d0583[_0xad69('0x2f')][_0xad69('0x1b')]);}return _0x179a0c[_0xad69('0x4a')](_0x41d912);}})[_0xad69('0x25')](function(_0x46d1dc){if(_0x46d1dc){return _0x46d1dc?{'count':_0x239c68,'rows':_0x46d1dc}:null;}})[_0xad69('0x25')](respondWithResult(_0x5234f8,null))['catch'](handleError(_0x5234f8,null));};exports['getSubjects']=function(_0x344354,_0x9a45dc,_0x568627){var _0xefe739={};var _0x1f49e3={};var _0x36139e;var _0x2c54bc;return db['DeskConfiguration']['findOne']({'where':{'id':_0x344354[_0xad69('0x46')]['id']}})['then'](handleEntityNotFound(_0x9a45dc,null))[_0xad69('0x25')](function(_0x4ed2bb){if(_0x4ed2bb){_0x36139e=_0x4ed2bb;_0x1f49e3[_0xad69('0x2e')]=_[_0xad69('0x30')](db[_0xad69('0x49')]['rawAttributes']);_0x1f49e3[_0xad69('0x2f')]=_[_0xad69('0x30')](_0x344354[_0xad69('0x2f')]);_0x1f49e3[_0xad69('0x31')]=_['intersection'](_0x1f49e3[_0xad69('0x2e')],_0x1f49e3[_0xad69('0x2f')]);_0xefe739[_0xad69('0x33')]=_[_0xad69('0x32')](_0x1f49e3[_0xad69('0x2e')],qs[_0xad69('0x34')](_0x344354[_0xad69('0x2f')][_0xad69('0x34')]));_0xefe739[_0xad69('0x33')]=_0xefe739[_0xad69('0x33')][_0xad69('0x35')]?_0xefe739[_0xad69('0x33')]:_0x1f49e3[_0xad69('0x2e')];_0xefe739[_0xad69('0x37')]=qs[_0xad69('0x38')](_0x344354[_0xad69('0x2f')]['sort']);_0xefe739[_0xad69('0x39')]=qs[_0xad69('0x31')](_[_0xad69('0x3a')](_0x344354[_0xad69('0x2f')],_0x1f49e3['filters']));if(_0x344354[_0xad69('0x2f')][_0xad69('0x3b')]){_0xefe739[_0xad69('0x39')]=_['merge'](_0xefe739[_0xad69('0x39')],{'$or':_[_0xad69('0x29')](_0xefe739[_0xad69('0x33')],function(_0x4a17fe){var _0x398a64={};_0x398a64[_0x4a17fe]={'$like':'%'+_0x344354[_0xad69('0x2f')][_0xad69('0x3b')]+'%'};return _0x398a64;})});}_0xefe739=_[_0xad69('0x3d')]({},_0xefe739,_0x344354[_0xad69('0x42')]);return _0x36139e[_0xad69('0x4c')](_0xefe739);}})[_0xad69('0x25')](function(_0x38ffde){if(_0x38ffde){_0x2c54bc=_0x38ffde[_0xad69('0x35')];if(!_0x344354[_0xad69('0x2f')][_0xad69('0x36')](_0xad69('0x4b'))){_0xefe739['limit']=qs[_0xad69('0x1d')](_0x344354[_0xad69('0x2f')][_0xad69('0x1d')]);_0xefe739['offset']=qs['offset'](_0x344354[_0xad69('0x2f')]['offset']);}return _0x36139e[_0xad69('0x4c')](_0xefe739);}})[_0xad69('0x25')](function(_0x11c036){if(_0x11c036){return _0x11c036?{'count':_0x2c54bc,'rows':_0x11c036}:null;}})['then'](respondWithResult(_0x9a45dc,null))[_0xad69('0x40')](handleError(_0x9a45dc,null));};exports[_0xad69('0x4d')]=function(_0x4ee2b1,_0xaef3a0,_0x23046a){var _0x4c4899={};var _0x302c2c={};var _0x1338d7;var _0x32567a;return db[_0xad69('0x3e')][_0xad69('0x48')]({'where':{'id':_0x4ee2b1[_0xad69('0x46')]['id']}})[_0xad69('0x25')](handleEntityNotFound(_0xaef3a0,null))[_0xad69('0x25')](function(_0x248291){if(_0x248291){_0x1338d7=_0x248291;_0x302c2c[_0xad69('0x2e')]=_[_0xad69('0x30')](db[_0xad69('0x49')][_0xad69('0x2a')]);_0x302c2c[_0xad69('0x2f')]=_['keys'](_0x4ee2b1[_0xad69('0x2f')]);_0x302c2c[_0xad69('0x31')]=_[_0xad69('0x32')](_0x302c2c[_0xad69('0x2e')],_0x302c2c[_0xad69('0x2f')]);_0x4c4899[_0xad69('0x33')]=_['intersection'](_0x302c2c[_0xad69('0x2e')],qs[_0xad69('0x34')](_0x4ee2b1['query'][_0xad69('0x34')]));_0x4c4899[_0xad69('0x33')]=_0x4c4899[_0xad69('0x33')][_0xad69('0x35')]?_0x4c4899[_0xad69('0x33')]:_0x302c2c[_0xad69('0x2e')];_0x4c4899['order']=qs[_0xad69('0x38')](_0x4ee2b1['query']['sort']);_0x4c4899[_0xad69('0x39')]=qs['filters'](_[_0xad69('0x3a')](_0x4ee2b1['query'],_0x302c2c[_0xad69('0x31')]));if(_0x4ee2b1[_0xad69('0x2f')]['filter']){_0x4c4899[_0xad69('0x39')]=_[_0xad69('0x3d')](_0x4c4899[_0xad69('0x39')],{'$or':_['map'](_0x4c4899[_0xad69('0x33')],function(_0x2d88cc){var _0x1b0c16={};_0x1b0c16[_0x2d88cc]={'$like':'%'+_0x4ee2b1['query']['filter']+'%'};return _0x1b0c16;})});}_0x4c4899=_[_0xad69('0x3d')]({},_0x4c4899,_0x4ee2b1[_0xad69('0x42')]);return _0x1338d7[_0xad69('0x4d')](_0x4c4899);}})[_0xad69('0x25')](function(_0x1b518b){if(_0x1b518b){_0x32567a=_0x1b518b[_0xad69('0x35')];if(!_0x4ee2b1[_0xad69('0x2f')][_0xad69('0x36')]('nolimit')){_0x4c4899['limit']=qs['limit'](_0x4ee2b1[_0xad69('0x2f')][_0xad69('0x1d')]);_0x4c4899[_0xad69('0x1b')]=qs[_0xad69('0x1b')](_0x4ee2b1[_0xad69('0x2f')]['offset']);}return _0x1338d7[_0xad69('0x4d')](_0x4c4899);}})[_0xad69('0x25')](function(_0x183e77){if(_0x183e77){return _0x183e77?{'count':_0x32567a,'rows':_0x183e77}:null;}})['then'](respondWithResult(_0xaef3a0,null))[_0xad69('0x40')](handleError(_0xaef3a0,null));};exports[_0xad69('0x4e')]=function(_0x826fda,_0x57c474,_0x66ce0c){var _0x34682d={};var _0x57143d={};var _0x1b9bd9;var _0x241d78;return db[_0xad69('0x3e')][_0xad69('0x48')]({'where':{'id':_0x826fda[_0xad69('0x46')]['id']}})['then'](handleEntityNotFound(_0x57c474,null))[_0xad69('0x25')](function(_0x31f21f){if(_0x31f21f){_0x1b9bd9=_0x31f21f;_0x57143d['model']=_[_0xad69('0x30')](db[_0xad69('0x4f')][_0xad69('0x2a')]);_0x57143d[_0xad69('0x2f')]=_['keys'](_0x826fda[_0xad69('0x2f')]);_0x57143d[_0xad69('0x31')]=_['intersection'](_0x57143d['model'],_0x57143d[_0xad69('0x2f')]);_0x34682d[_0xad69('0x33')]=_[_0xad69('0x32')](_0x57143d[_0xad69('0x2e')],qs[_0xad69('0x34')](_0x826fda[_0xad69('0x2f')][_0xad69('0x34')]));_0x34682d[_0xad69('0x33')]=_0x34682d['attributes'][_0xad69('0x35')]?_0x34682d[_0xad69('0x33')]:_0x57143d[_0xad69('0x2e')];_0x34682d[_0xad69('0x37')]=qs[_0xad69('0x38')](_0x826fda[_0xad69('0x2f')][_0xad69('0x38')]);_0x34682d[_0xad69('0x39')]=qs[_0xad69('0x31')](_[_0xad69('0x3a')](_0x826fda[_0xad69('0x2f')],_0x57143d['filters']));if(_0x826fda[_0xad69('0x2f')][_0xad69('0x3b')]){_0x34682d[_0xad69('0x39')]=_[_0xad69('0x3d')](_0x34682d[_0xad69('0x39')],{'$or':_['map'](_0x34682d[_0xad69('0x33')],function(_0x4767e6){var _0x75c3a9={};_0x75c3a9[_0x4767e6]={'$like':'%'+_0x826fda['query']['filter']+'%'};return _0x75c3a9;})});}_0x34682d=_[_0xad69('0x3d')]({},_0x34682d,_0x826fda['options']);return _0x1b9bd9[_0xad69('0x4e')](_0x34682d);}})[_0xad69('0x25')](function(_0x27bdbf){if(_0x27bdbf){_0x241d78=_0x27bdbf['length'];if(!_0x826fda[_0xad69('0x2f')]['hasOwnProperty'](_0xad69('0x4b'))){_0x34682d['limit']=qs[_0xad69('0x1d')](_0x826fda['query']['limit']);_0x34682d[_0xad69('0x1b')]=qs[_0xad69('0x1b')](_0x826fda[_0xad69('0x2f')]['offset']);}return _0x1b9bd9[_0xad69('0x4e')](_0x34682d);}})[_0xad69('0x25')](function(_0x18ad04){if(_0x18ad04){return _0x18ad04?{'count':_0x241d78,'rows':_0x18ad04}:null;}})['then'](respondWithResult(_0x57c474,null))[_0xad69('0x40')](handleError(_0x57c474,null));};exports['setTags']=function(_0x27e197,_0x20855f,_0x59f3e4){if(_0x27e197[_0xad69('0x45')]['id']){delete _0x27e197[_0xad69('0x45')]['id'];}return db[_0xad69('0x3e')][_0xad69('0x48')]({'where':{'id':_0x27e197[_0xad69('0x46')]['id']}})[_0xad69('0x25')](handleEntityNotFound(_0x20855f,null))[_0xad69('0x25')](function(_0x2ccfb9){if(_0x2ccfb9){return _0x2ccfb9[_0xad69('0x50')](_0x27e197[_0xad69('0x45')]['ids']||[]);}return null;})[_0xad69('0x25')](respondWithResult(_0x20855f,null))[_0xad69('0x40')](handleError(_0x20855f,null));}; \ No newline at end of file +var _0x3206=['map','DeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','getFields','DeskField','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x2ad0ca,_0x586d85){var _0x4c8877=function(_0x1ea347){while(--_0x1ea347){_0x2ad0ca['push'](_0x2ad0ca['shift']());}};_0x4c8877(++_0x586d85);}(_0x3206,0x1e4));var _0x6320=function(_0x3e9266,_0xf51328){_0x3e9266=_0x3e9266-0x0;var _0x18b80c=_0x3206[_0x3e9266];return _0x18b80c;};'use strict';var emlformat=require(_0x6320('0x0'));var rimraf=require(_0x6320('0x1'));var zipdir=require(_0x6320('0x2'));var jsonpatch=require(_0x6320('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6320('0x4'));var path=require(_0x6320('0x5'));var sox=require(_0x6320('0x6'));var csv=require(_0x6320('0x7'));var ejs=require(_0x6320('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6320('0x9'));var squel=require('squel');var crypto=require(_0x6320('0xa'));var jsforce=require(_0x6320('0xb'));var deskjs=require(_0x6320('0xc'));var toCsv=require(_0x6320('0x7'));var querystring=require(_0x6320('0xd'));var Papa=require(_0x6320('0xe'));var Redis=require(_0x6320('0xf'));var authService=require(_0x6320('0x10'));var qs=require(_0x6320('0x11'));var as=require(_0x6320('0x12'));var hardwareService=require(_0x6320('0x13'));var logger=require(_0x6320('0x14'))(_0x6320('0x15'));var utils=require(_0x6320('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6320('0x17'));var db=require(_0x6320('0x18'))['db'];function respondWithStatusCode(_0x4e31df,_0x4951d0){_0x4951d0=_0x4951d0||0xcc;return function(_0x292918){if(_0x292918){return _0x4e31df[_0x6320('0x19')](_0x4951d0);}return _0x4e31df[_0x6320('0x1a')](_0x4951d0)[_0x6320('0x1b')]();};}function respondWithResult(_0x1bd040,_0x33db44){_0x33db44=_0x33db44||0xc8;return function(_0x49d969){if(_0x49d969){return _0x1bd040[_0x6320('0x1a')](_0x33db44)[_0x6320('0x1c')](_0x49d969);}};}function respondWithFilteredResult(_0x57a188,_0x39ea62){return function(_0x372169){if(_0x372169){var _0x4a61af=typeof _0x39ea62[_0x6320('0x1d')]===_0x6320('0x1e')&&typeof _0x39ea62[_0x6320('0x1f')]===_0x6320('0x1e');var _0x768e2c=_0x372169[_0x6320('0x20')];var _0x36a061=_0x4a61af?0x0:_0x39ea62[_0x6320('0x1d')];var _0x3b84c9=_0x4a61af?_0x372169[_0x6320('0x20')]:_0x39ea62['offset']+_0x39ea62[_0x6320('0x1f')];var _0x14ea2d;if(_0x3b84c9>=_0x768e2c){_0x3b84c9=_0x768e2c;_0x14ea2d=0xc8;}else{_0x14ea2d=0xce;}_0x57a188[_0x6320('0x1a')](_0x14ea2d);return _0x57a188['set'](_0x6320('0x21'),_0x36a061+'-'+_0x3b84c9+'/'+_0x768e2c)[_0x6320('0x1c')](_0x372169);}return null;};}function patchUpdates(_0x1f0f64){return function(_0x568dbe){try{jsonpatch[_0x6320('0x22')](_0x568dbe,_0x1f0f64,!![]);}catch(_0x240e11){return BPromise[_0x6320('0x23')](_0x240e11);}return _0x568dbe[_0x6320('0x24')]();};}function saveUpdates(_0x1c7b6c,_0x2c5999){return function(_0x3cbb58){if(_0x3cbb58){return _0x3cbb58[_0x6320('0x25')](_0x1c7b6c)[_0x6320('0x26')](function(_0x5cd23e){return _0x5cd23e;});}return null;};}function removeEntity(_0x11d6e4,_0x19377d){return function(_0x5d2f56){if(_0x5d2f56){return _0x5d2f56['destroy']()['then'](function(){_0x11d6e4['status'](0xcc)[_0x6320('0x1b')]();});}};}function handleEntityNotFound(_0x3ab864,_0xd82e7a){return function(_0x5b92b5){if(!_0x5b92b5){_0x3ab864[_0x6320('0x19')](0x194);}return _0x5b92b5;};}function handleError(_0x4865e6,_0x32a81){_0x32a81=_0x32a81||0x1f4;return function(_0x495fee){logger[_0x6320('0x27')](_0x495fee[_0x6320('0x28')]);if(_0x495fee[_0x6320('0x29')]){delete _0x495fee[_0x6320('0x29')];}_0x4865e6[_0x6320('0x1a')](_0x32a81)[_0x6320('0x2a')](_0x495fee);};}exports[_0x6320('0x2b')]=function(_0x5cf022,_0x1155bb){var _0x14430a={},_0x3de5f5={},_0x5a350a={'count':0x0,'rows':[]};var _0xd55d7d=_[_0x6320('0x2c')](db[_0x6320('0x2d')][_0x6320('0x2e')],function(_0x23b188){return{'name':_0x23b188[_0x6320('0x2f')],'type':_0x23b188[_0x6320('0x30')][_0x6320('0x31')]};});_0x3de5f5['model']=_[_0x6320('0x2c')](_0xd55d7d,_0x6320('0x29'));_0x3de5f5[_0x6320('0x32')]=_[_0x6320('0x33')](_0x5cf022[_0x6320('0x32')]);_0x3de5f5[_0x6320('0x34')]=_[_0x6320('0x35')](_0x3de5f5[_0x6320('0x36')],_0x3de5f5[_0x6320('0x32')]);_0x14430a[_0x6320('0x37')]=_[_0x6320('0x35')](_0x3de5f5['model'],qs['fields'](_0x5cf022[_0x6320('0x32')][_0x6320('0x38')]));_0x14430a[_0x6320('0x37')]=_0x14430a[_0x6320('0x37')][_0x6320('0x39')]?_0x14430a[_0x6320('0x37')]:_0x3de5f5[_0x6320('0x36')];if(!_0x5cf022['query'][_0x6320('0x3a')](_0x6320('0x3b'))){_0x14430a[_0x6320('0x1f')]=qs[_0x6320('0x1f')](_0x5cf022[_0x6320('0x32')][_0x6320('0x1f')]);_0x14430a[_0x6320('0x1d')]=qs[_0x6320('0x1d')](_0x5cf022[_0x6320('0x32')]['offset']);}_0x14430a[_0x6320('0x3c')]=qs['sort'](_0x5cf022[_0x6320('0x32')][_0x6320('0x3d')]);_0x14430a[_0x6320('0x3e')]=qs['filters'](_[_0x6320('0x3f')](_0x5cf022[_0x6320('0x32')],_0x3de5f5[_0x6320('0x34')]),_0xd55d7d);if(_0x5cf022[_0x6320('0x32')][_0x6320('0x40')]){_0x14430a['where']=_[_0x6320('0x41')](_0x14430a[_0x6320('0x3e')],{'$or':_[_0x6320('0x2c')](_0xd55d7d,function(_0x40cecd){if(_0x40cecd[_0x6320('0x30')]!==_0x6320('0x42')){var _0x2ce0b4={};_0x2ce0b4[_0x40cecd['name']]={'$like':'%'+_0x5cf022[_0x6320('0x32')][_0x6320('0x40')]+'%'};return _0x2ce0b4;}})});}_0x14430a=_[_0x6320('0x41')]({},_0x14430a,_0x5cf022[_0x6320('0x43')]);var _0x105142={'where':_0x14430a[_0x6320('0x3e')]};return db[_0x6320('0x2d')]['count'](_0x105142)[_0x6320('0x26')](function(_0x916d12){_0x5a350a[_0x6320('0x20')]=_0x916d12;if(_0x5cf022[_0x6320('0x32')][_0x6320('0x44')]){_0x14430a[_0x6320('0x45')]=[{'all':!![]}];}return db[_0x6320('0x2d')][_0x6320('0x46')](_0x14430a);})[_0x6320('0x26')](function(_0x10a05b){_0x5a350a[_0x6320('0x47')]=_0x10a05b;return _0x5a350a;})['then'](respondWithFilteredResult(_0x1155bb,_0x14430a))[_0x6320('0x48')](handleError(_0x1155bb,null));};exports[_0x6320('0x49')]=function(_0x230ae5,_0x48b74f){var _0x173fa2={'raw':![],'where':{'id':_0x230ae5['params']['id']}},_0x698d5b={};_0x698d5b[_0x6320('0x36')]=_[_0x6320('0x33')](db[_0x6320('0x2d')][_0x6320('0x2e')]);_0x698d5b[_0x6320('0x32')]=_[_0x6320('0x33')](_0x230ae5[_0x6320('0x32')]);_0x698d5b[_0x6320('0x34')]=_[_0x6320('0x35')](_0x698d5b[_0x6320('0x36')],_0x698d5b[_0x6320('0x32')]);_0x173fa2['attributes']=_['intersection'](_0x698d5b['model'],qs[_0x6320('0x38')](_0x230ae5[_0x6320('0x32')][_0x6320('0x38')]));_0x173fa2['attributes']=_0x173fa2[_0x6320('0x37')][_0x6320('0x39')]?_0x173fa2[_0x6320('0x37')]:_0x698d5b[_0x6320('0x36')];if(_0x230ae5[_0x6320('0x32')][_0x6320('0x44')]){_0x173fa2[_0x6320('0x45')]=[{'all':!![]}];}_0x173fa2=_['merge']({},_0x173fa2,_0x230ae5['options']);return db[_0x6320('0x2d')][_0x6320('0x4a')](_0x173fa2)[_0x6320('0x26')](handleEntityNotFound(_0x48b74f,null))['then'](respondWithResult(_0x48b74f,null))[_0x6320('0x48')](handleError(_0x48b74f,null));};exports[_0x6320('0x4b')]=function(_0x501535,_0x1fe82d){return db[_0x6320('0x2d')][_0x6320('0x4b')](_0x501535[_0x6320('0x4c')],{})[_0x6320('0x26')](respondWithResult(_0x1fe82d,0xc9))[_0x6320('0x48')](handleError(_0x1fe82d,null));};exports[_0x6320('0x25')]=function(_0x5436f2,_0x4f45a5){if(_0x5436f2[_0x6320('0x4c')]['id']){delete _0x5436f2[_0x6320('0x4c')]['id'];}return db[_0x6320('0x2d')][_0x6320('0x4a')]({'where':{'id':_0x5436f2[_0x6320('0x4d')]['id']}})[_0x6320('0x26')](handleEntityNotFound(_0x4f45a5,null))[_0x6320('0x26')](saveUpdates(_0x5436f2[_0x6320('0x4c')],null))[_0x6320('0x26')](respondWithResult(_0x4f45a5,null))[_0x6320('0x48')](handleError(_0x4f45a5,null));};exports[_0x6320('0x4e')]=function(_0x3c1507,_0x45281d){return db[_0x6320('0x2d')][_0x6320('0x4a')]({'where':{'id':_0x3c1507[_0x6320('0x4d')]['id']}})[_0x6320('0x26')](handleEntityNotFound(_0x45281d,null))[_0x6320('0x26')](removeEntity(_0x45281d,null))[_0x6320('0x48')](handleError(_0x45281d,null));};exports[_0x6320('0x4f')]=function(_0x261318,_0x4a697e,_0x2ed46c){var _0xf03ebe={};var _0x590482={};var _0x200796;var _0x2be599;return db['DeskConfiguration']['findOne']({'where':{'id':_0x261318[_0x6320('0x4d')]['id']}})[_0x6320('0x26')](handleEntityNotFound(_0x4a697e,null))[_0x6320('0x26')](function(_0x2a79b3){if(_0x2a79b3){_0x200796=_0x2a79b3;_0x590482['model']=_[_0x6320('0x33')](db[_0x6320('0x50')][_0x6320('0x2e')]);_0x590482[_0x6320('0x32')]=_[_0x6320('0x33')](_0x261318['query']);_0x590482[_0x6320('0x34')]=_[_0x6320('0x35')](_0x590482[_0x6320('0x36')],_0x590482[_0x6320('0x32')]);_0xf03ebe[_0x6320('0x37')]=_[_0x6320('0x35')](_0x590482[_0x6320('0x36')],qs[_0x6320('0x38')](_0x261318['query'][_0x6320('0x38')]));_0xf03ebe[_0x6320('0x37')]=_0xf03ebe[_0x6320('0x37')][_0x6320('0x39')]?_0xf03ebe[_0x6320('0x37')]:_0x590482[_0x6320('0x36')];_0xf03ebe[_0x6320('0x3c')]=qs[_0x6320('0x3d')](_0x261318[_0x6320('0x32')][_0x6320('0x3d')]);_0xf03ebe[_0x6320('0x3e')]=qs[_0x6320('0x34')](_[_0x6320('0x3f')](_0x261318[_0x6320('0x32')],_0x590482[_0x6320('0x34')]));if(_0x261318['query'][_0x6320('0x40')]){_0xf03ebe[_0x6320('0x3e')]=_[_0x6320('0x41')](_0xf03ebe[_0x6320('0x3e')],{'$or':_['map'](_0xf03ebe[_0x6320('0x37')],function(_0x72b07){var _0x4032e9={};_0x4032e9[_0x72b07]={'$like':'%'+_0x261318[_0x6320('0x32')]['filter']+'%'};return _0x4032e9;})});}_0xf03ebe=_['merge']({},_0xf03ebe,_0x261318[_0x6320('0x43')]);return _0x200796[_0x6320('0x4f')](_0xf03ebe);}})[_0x6320('0x26')](function(_0x39ed11){if(_0x39ed11){_0x2be599=_0x39ed11[_0x6320('0x39')];if(!_0x261318[_0x6320('0x32')][_0x6320('0x3a')]('nolimit')){_0xf03ebe[_0x6320('0x1f')]=qs['limit'](_0x261318['query'][_0x6320('0x1f')]);_0xf03ebe[_0x6320('0x1d')]=qs[_0x6320('0x1d')](_0x261318[_0x6320('0x32')]['offset']);}return _0x200796['getFields'](_0xf03ebe);}})[_0x6320('0x26')](function(_0xa9b82f){if(_0xa9b82f){return _0xa9b82f?{'count':_0x2be599,'rows':_0xa9b82f}:null;}})['then'](respondWithResult(_0x4a697e,null))['catch'](handleError(_0x4a697e,null));};exports[_0x6320('0x51')]=function(_0x207ccf,_0xde15d,_0x24e417){var _0x1204eb={};var _0x284554={};var _0x1d3e4b;var _0x1e71c4;return db[_0x6320('0x2d')][_0x6320('0x52')]({'where':{'id':_0x207ccf['params']['id']}})[_0x6320('0x26')](handleEntityNotFound(_0xde15d,null))[_0x6320('0x26')](function(_0x6fcd88){if(_0x6fcd88){_0x1d3e4b=_0x6fcd88;_0x284554[_0x6320('0x36')]=_[_0x6320('0x33')](db[_0x6320('0x50')][_0x6320('0x2e')]);_0x284554[_0x6320('0x32')]=_[_0x6320('0x33')](_0x207ccf['query']);_0x284554[_0x6320('0x34')]=_['intersection'](_0x284554[_0x6320('0x36')],_0x284554[_0x6320('0x32')]);_0x1204eb[_0x6320('0x37')]=_['intersection'](_0x284554['model'],qs['fields'](_0x207ccf[_0x6320('0x32')][_0x6320('0x38')]));_0x1204eb[_0x6320('0x37')]=_0x1204eb[_0x6320('0x37')]['length']?_0x1204eb[_0x6320('0x37')]:_0x284554[_0x6320('0x36')];_0x1204eb[_0x6320('0x3c')]=qs['sort'](_0x207ccf[_0x6320('0x32')][_0x6320('0x3d')]);_0x1204eb['where']=qs[_0x6320('0x34')](_[_0x6320('0x3f')](_0x207ccf[_0x6320('0x32')],_0x284554[_0x6320('0x34')]));if(_0x207ccf['query'][_0x6320('0x40')]){_0x1204eb[_0x6320('0x3e')]=_[_0x6320('0x41')](_0x1204eb['where'],{'$or':_[_0x6320('0x2c')](_0x1204eb[_0x6320('0x37')],function(_0x55b7aa){var _0x54fece={};_0x54fece[_0x55b7aa]={'$like':'%'+_0x207ccf[_0x6320('0x32')][_0x6320('0x40')]+'%'};return _0x54fece;})});}_0x1204eb=_[_0x6320('0x41')]({},_0x1204eb,_0x207ccf[_0x6320('0x43')]);return _0x1d3e4b[_0x6320('0x51')](_0x1204eb);}})['then'](function(_0x271546){if(_0x271546){_0x1e71c4=_0x271546['length'];if(!_0x207ccf[_0x6320('0x32')][_0x6320('0x3a')](_0x6320('0x3b'))){_0x1204eb['limit']=qs[_0x6320('0x1f')](_0x207ccf['query'][_0x6320('0x1f')]);_0x1204eb[_0x6320('0x1d')]=qs['offset'](_0x207ccf[_0x6320('0x32')][_0x6320('0x1d')]);}return _0x1d3e4b[_0x6320('0x51')](_0x1204eb);}})[_0x6320('0x26')](function(_0x3e9fef){if(_0x3e9fef){return _0x3e9fef?{'count':_0x1e71c4,'rows':_0x3e9fef}:null;}})['then'](respondWithResult(_0xde15d,null))[_0x6320('0x48')](handleError(_0xde15d,null));};exports['getDescriptions']=function(_0x5fb069,_0x505885,_0x2344b3){var _0x1de60f={};var _0x140adc={};var _0x2b02c9;var _0x4eb3ab;return db['DeskConfiguration'][_0x6320('0x52')]({'where':{'id':_0x5fb069[_0x6320('0x4d')]['id']}})[_0x6320('0x26')](handleEntityNotFound(_0x505885,null))[_0x6320('0x26')](function(_0x156ab3){if(_0x156ab3){_0x2b02c9=_0x156ab3;_0x140adc[_0x6320('0x36')]=_[_0x6320('0x33')](db[_0x6320('0x50')]['rawAttributes']);_0x140adc['query']=_[_0x6320('0x33')](_0x5fb069[_0x6320('0x32')]);_0x140adc[_0x6320('0x34')]=_[_0x6320('0x35')](_0x140adc['model'],_0x140adc['query']);_0x1de60f[_0x6320('0x37')]=_[_0x6320('0x35')](_0x140adc[_0x6320('0x36')],qs[_0x6320('0x38')](_0x5fb069[_0x6320('0x32')][_0x6320('0x38')]));_0x1de60f[_0x6320('0x37')]=_0x1de60f['attributes']['length']?_0x1de60f['attributes']:_0x140adc[_0x6320('0x36')];_0x1de60f['order']=qs[_0x6320('0x3d')](_0x5fb069[_0x6320('0x32')][_0x6320('0x3d')]);_0x1de60f['where']=qs[_0x6320('0x34')](_[_0x6320('0x3f')](_0x5fb069[_0x6320('0x32')],_0x140adc['filters']));if(_0x5fb069[_0x6320('0x32')][_0x6320('0x40')]){_0x1de60f['where']=_[_0x6320('0x41')](_0x1de60f[_0x6320('0x3e')],{'$or':_[_0x6320('0x2c')](_0x1de60f['attributes'],function(_0x3becb2){var _0x2445a9={};_0x2445a9[_0x3becb2]={'$like':'%'+_0x5fb069[_0x6320('0x32')]['filter']+'%'};return _0x2445a9;})});}_0x1de60f=_[_0x6320('0x41')]({},_0x1de60f,_0x5fb069[_0x6320('0x43')]);return _0x2b02c9[_0x6320('0x53')](_0x1de60f);}})[_0x6320('0x26')](function(_0x3fe452){if(_0x3fe452){_0x4eb3ab=_0x3fe452[_0x6320('0x39')];if(!_0x5fb069[_0x6320('0x32')][_0x6320('0x3a')](_0x6320('0x3b'))){_0x1de60f[_0x6320('0x1f')]=qs[_0x6320('0x1f')](_0x5fb069['query'][_0x6320('0x1f')]);_0x1de60f[_0x6320('0x1d')]=qs[_0x6320('0x1d')](_0x5fb069[_0x6320('0x32')]['offset']);}return _0x2b02c9[_0x6320('0x53')](_0x1de60f);}})['then'](function(_0x1a0cfc){if(_0x1a0cfc){return _0x1a0cfc?{'count':_0x4eb3ab,'rows':_0x1a0cfc}:null;}})[_0x6320('0x26')](respondWithResult(_0x505885,null))[_0x6320('0x48')](handleError(_0x505885,null));};exports[_0x6320('0x54')]=function(_0x42803f,_0x5eddf1,_0x1c0ca1){var _0x4cb668={};var _0x46950a={};var _0x38c532;var _0x366c76;return db['DeskConfiguration'][_0x6320('0x52')]({'where':{'id':_0x42803f[_0x6320('0x4d')]['id']}})[_0x6320('0x26')](handleEntityNotFound(_0x5eddf1,null))[_0x6320('0x26')](function(_0x1867f2){if(_0x1867f2){_0x38c532=_0x1867f2;_0x46950a['model']=_[_0x6320('0x33')](db[_0x6320('0x55')][_0x6320('0x2e')]);_0x46950a['query']=_[_0x6320('0x33')](_0x42803f['query']);_0x46950a[_0x6320('0x34')]=_[_0x6320('0x35')](_0x46950a[_0x6320('0x36')],_0x46950a[_0x6320('0x32')]);_0x4cb668[_0x6320('0x37')]=_[_0x6320('0x35')](_0x46950a[_0x6320('0x36')],qs[_0x6320('0x38')](_0x42803f['query'][_0x6320('0x38')]));_0x4cb668[_0x6320('0x37')]=_0x4cb668[_0x6320('0x37')][_0x6320('0x39')]?_0x4cb668[_0x6320('0x37')]:_0x46950a[_0x6320('0x36')];_0x4cb668[_0x6320('0x3c')]=qs['sort'](_0x42803f[_0x6320('0x32')]['sort']);_0x4cb668[_0x6320('0x3e')]=qs[_0x6320('0x34')](_['pick'](_0x42803f[_0x6320('0x32')],_0x46950a[_0x6320('0x34')]));if(_0x42803f[_0x6320('0x32')]['filter']){_0x4cb668[_0x6320('0x3e')]=_[_0x6320('0x41')](_0x4cb668[_0x6320('0x3e')],{'$or':_[_0x6320('0x2c')](_0x4cb668[_0x6320('0x37')],function(_0xb8f51b){var _0x4c9643={};_0x4c9643[_0xb8f51b]={'$like':'%'+_0x42803f[_0x6320('0x32')][_0x6320('0x40')]+'%'};return _0x4c9643;})});}_0x4cb668=_['merge']({},_0x4cb668,_0x42803f[_0x6320('0x43')]);return _0x38c532['getTags'](_0x4cb668);}})[_0x6320('0x26')](function(_0x32c869){if(_0x32c869){_0x366c76=_0x32c869[_0x6320('0x39')];if(!_0x42803f[_0x6320('0x32')]['hasOwnProperty'](_0x6320('0x3b'))){_0x4cb668[_0x6320('0x1f')]=qs[_0x6320('0x1f')](_0x42803f[_0x6320('0x32')][_0x6320('0x1f')]);_0x4cb668[_0x6320('0x1d')]=qs[_0x6320('0x1d')](_0x42803f[_0x6320('0x32')][_0x6320('0x1d')]);}return _0x38c532[_0x6320('0x54')](_0x4cb668);}})['then'](function(_0x1a9e60){if(_0x1a9e60){return _0x1a9e60?{'count':_0x366c76,'rows':_0x1a9e60}:null;}})[_0x6320('0x26')](respondWithResult(_0x5eddf1,null))[_0x6320('0x48')](handleError(_0x5eddf1,null));};exports[_0x6320('0x56')]=function(_0x55d00e,_0x412e2d,_0x5cc5f6){if(_0x55d00e[_0x6320('0x4c')]['id']){delete _0x55d00e[_0x6320('0x4c')]['id'];}return db[_0x6320('0x2d')]['findOne']({'where':{'id':_0x55d00e[_0x6320('0x4d')]['id']}})[_0x6320('0x26')](handleEntityNotFound(_0x412e2d,null))[_0x6320('0x26')](function(_0x40d308){if(_0x40d308){return _0x40d308[_0x6320('0x56')](_0x55d00e[_0x6320('0x4c')][_0x6320('0x57')]||[]);}return null;})[_0x6320('0x26')](respondWithResult(_0x412e2d,null))[_0x6320('0x48')](handleError(_0x412e2d,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index cd4a500..40f7a95 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 _0xfe8c=['moment','bluebird','path','rimraf','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api'];(function(_0x12156d,_0x189f41){var _0x584b56=function(_0x1beec9){while(--_0x1beec9){_0x12156d['push'](_0x12156d['shift']());}};_0x584b56(++_0x189f41);}(_0xfe8c,0x1b5));var _0xcfe8=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xfe8c[_0x377a6e];return _0x37f751;};'use strict';var _=require(_0xcfe8('0x0'));var util=require('util');var logger=require(_0xcfe8('0x1'))(_0xcfe8('0x2'));var moment=require(_0xcfe8('0x3'));var BPromise=require(_0xcfe8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcfe8('0x5'));var rimraf=require(_0xcfe8('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0xcfe8('0x7')]=function(_0x5c52e8,_0x301401){return _0x5c52e8[_0xcfe8('0x8')](_0xcfe8('0x9'),attributes,{'tableName':_0xcfe8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1548=['define','DeskConfiguration','int_desk_configurations','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x35eb4a,_0x5d57bf){var _0x4b1492=function(_0x7cb654){while(--_0x7cb654){_0x35eb4a['push'](_0x35eb4a['shift']());}};_0x4b1492(++_0x5d57bf);}(_0x1548,0x99));var _0x8154=function(_0x434a8d,_0x39979b){_0x434a8d=_0x434a8d-0x0;var _0x2dce46=_0x1548[_0x434a8d];return _0x2dce46;};'use strict';var _=require('lodash');var util=require(_0x8154('0x0'));var logger=require(_0x8154('0x1'))('api');var moment=require(_0x8154('0x2'));var BPromise=require(_0x8154('0x3'));var rp=require(_0x8154('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8154('0x5'));var config=require(_0x8154('0x6'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0xbc30e,_0x5f115e){return _0xbc30e[_0x8154('0x7')](_0x8154('0x8'),attributes,{'tableName':_0x8154('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 98b3969..5b2d115 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 _0x09e4=['code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x31b813,_0x3792c3){var _0x3d6737=function(_0x163a79){while(--_0x163a79){_0x31b813['push'](_0x31b813['shift']());}};_0x3d6737(++_0x3792c3);}(_0x09e4,0x1ce));var _0x409e=function(_0x1b5080,_0x3e7cc9){_0x1b5080=_0x1b5080-0x0;var _0x195c87=_0x09e4[_0x1b5080];return _0x195c87;};'use strict';var _=require(_0x409e('0x0'));var util=require(_0x409e('0x1'));var moment=require(_0x409e('0x2'));var BPromise=require(_0x409e('0x3'));var rs=require(_0x409e('0x4'));var fs=require('fs');var Redis=require(_0x409e('0x5'));var db=require(_0x409e('0x6'))['db'];var utils=require(_0x409e('0x7'));var logger=require('../../config/logger')(_0x409e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x409e('0x9')][_0x409e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcb9d17,_0x3f124e,_0x5d718e){return new BPromise(function(_0x21255d,_0x420144){return client[_0x409e('0xb')](_0xcb9d17,_0x5d718e)[_0x409e('0xc')](function(_0x5305d4){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x3f124e,_0x409e('0xd'));logger[_0x409e('0xe')](_0x409e('0xf'),_0x3f124e,'request\x20sent',JSON[_0x409e('0x10')](_0x5305d4));if(_0x5305d4[_0x409e('0x11')]){if(_0x5305d4[_0x409e('0x11')][_0x409e('0x12')]===0x1f4){logger[_0x409e('0x11')](_0x409e('0x13'),_0x3f124e,_0x5305d4[_0x409e('0x11')][_0x409e('0x14')]);return _0x420144(_0x5305d4['error']['message']);}logger[_0x409e('0x11')](_0x409e('0x13'),_0x3f124e,_0x5305d4['error'][_0x409e('0x14')]);return _0x21255d(_0x5305d4[_0x409e('0x11')][_0x409e('0x14')]);}else{logger[_0x409e('0x15')](_0x409e('0x13'),_0x3f124e,_0x409e('0xd'));_0x21255d(_0x5305d4[_0x409e('0x16')][_0x409e('0x14')]);}})[_0x409e('0x17')](function(_0x59fd27){logger[_0x409e('0x11')](_0x409e('0x13'),_0x3f124e,_0x59fd27);_0x420144(_0x59fd27);});});} \ No newline at end of file +var _0xa321=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','request','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment'];(function(_0x83d08e,_0x228942){var _0x404d4f=function(_0x161ce){while(--_0x161ce){_0x83d08e['push'](_0x83d08e['shift']());}};_0x404d4f(++_0x228942);}(_0xa321,0x9d));var _0x1a32=function(_0x28c4db,_0x2ccd05){_0x28c4db=_0x28c4db-0x0;var _0x5907ed=_0xa321[_0x28c4db];return _0x5907ed;};'use strict';var _=require(_0x1a32('0x0'));var util=require(_0x1a32('0x1'));var moment=require(_0x1a32('0x2'));var BPromise=require(_0x1a32('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a32('0x4'));var db=require(_0x1a32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a32('0x6'))(_0x1a32('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1a32('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4859d6,_0x13b4d2,_0x1fa204){return new BPromise(function(_0xdfa9fe,_0x3f4723){return client[_0x1a32('0x9')](_0x4859d6,_0x1fa204)['then'](function(_0x343faf){logger[_0x1a32('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0x13b4d2,_0x1a32('0xb'));logger[_0x1a32('0xc')](_0x1a32('0xd'),_0x13b4d2,_0x1a32('0xb'),JSON[_0x1a32('0xe')](_0x343faf));if(_0x343faf[_0x1a32('0xf')]){if(_0x343faf['error'][_0x1a32('0x10')]===0x1f4){logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x343faf['error'][_0x1a32('0x12')]);return _0x3f4723(_0x343faf[_0x1a32('0xf')][_0x1a32('0x12')]);}logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x343faf['error'][_0x1a32('0x12')]);return _0xdfa9fe(_0x343faf[_0x1a32('0xf')][_0x1a32('0x12')]);}else{logger[_0x1a32('0xa')](_0x1a32('0x11'),_0x13b4d2,_0x1a32('0xb'));_0xdfa9fe(_0x343faf['result'][_0x1a32('0x12')]);}})[_0x1a32('0x13')](function(_0x47bb8e){logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x47bb8e);_0x3f4723(_0x47bb8e);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 770ed5b..1fc2836 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 _0xc88f=['create','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x35199d,_0x3e120e){var _0x1a75e5=function(_0x49581f){while(--_0x49581f){_0x35199d['push'](_0x35199d['shift']());}};_0x1a75e5(++_0x3e120e);}(_0xc88f,0x19b));var _0xfc88=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc88f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xfc88('0x0'));var util=require(_0xfc88('0x1'));var path=require(_0xfc88('0x2'));var timeout=require(_0xfc88('0x3'));var express=require(_0xfc88('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfc88('0x5'));var interaction=require(_0xfc88('0x6'));var config=require('../../config/environment');var controller=require(_0xfc88('0x7'));router['get']('/',auth[_0xfc88('0x8')](),controller[_0xfc88('0x9')]);router[_0xfc88('0xa')](_0xfc88('0xb'),auth[_0xfc88('0x8')](),controller[_0xfc88('0xc')]);router[_0xfc88('0xd')]('/',auth[_0xfc88('0x8')](),controller[_0xfc88('0xe')]);router['put'](_0xfc88('0xb'),auth[_0xfc88('0x8')](),controller[_0xfc88('0xf')]);router['delete'](_0xfc88('0xb'),auth['isAuthenticated'](),controller[_0xfc88('0x10')]);module['exports']=router; \ No newline at end of file +var _0xed48=['util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','/:id','isAuthenticated','show','create','update','delete','destroy','exports'];(function(_0x17f60d,_0x5c4756){var _0x47eba1=function(_0x55c8d1){while(--_0x55c8d1){_0x17f60d['push'](_0x17f60d['shift']());}};_0x47eba1(++_0x5c4756);}(_0xed48,0x90));var _0x8ed4=function(_0x27c24e,_0x5db1c7){_0x27c24e=_0x27c24e-0x0;var _0x39004a=_0xed48[_0x27c24e];return _0x39004a;};'use strict';var multer=require('multer');var util=require(_0x8ed4('0x0'));var path=require('path');var timeout=require(_0x8ed4('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8ed4('0x2'));var auth=require(_0x8ed4('0x3'));var interaction=require(_0x8ed4('0x4'));var config=require(_0x8ed4('0x5'));var controller=require(_0x8ed4('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8ed4('0x7')](_0x8ed4('0x8'),auth[_0x8ed4('0x9')](),controller[_0x8ed4('0xa')]);router['post']('/',auth[_0x8ed4('0x9')](),controller[_0x8ed4('0xb')]);router['put'](_0x8ed4('0x8'),auth[_0x8ed4('0x9')](),controller[_0x8ed4('0xc')]);router[_0x8ed4('0xd')](_0x8ed4('0x8'),auth[_0x8ed4('0x9')](),controller[_0x8ed4('0xe')]);module[_0x8ed4('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index f9b1fb6..9bf500f 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 _0xbc13=['customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x46404d,_0x1e7bc2){var _0x4d81b3=function(_0x5c272c){while(--_0x5c272c){_0x46404d['push'](_0x46404d['shift']());}};_0x4d81b3(++_0x1e7bc2);}(_0xbc13,0xf4));var _0x3bc1=function(_0x539533,_0x59b89b){_0x539533=_0x539533-0x0;var _0x3942f3=_0xbc13[_0x539533];return _0x3942f3;};'use strict';var Sequelize=require(_0x3bc1('0x0'));module[_0x3bc1('0x1')]={'type':{'type':Sequelize[_0x3bc1('0x2')]('string',_0x3bc1('0x3'),_0x3bc1('0x4'),_0x3bc1('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x3bc1('0x6')]},'key':{'type':Sequelize[_0x3bc1('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x3bc1('0x3'),_0x3bc1('0x4'))},'keyContent':{'type':Sequelize[_0x3bc1('0x6')]},'idField':{'type':Sequelize[_0x3bc1('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3bc1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3bc1('0x6')]}}; \ No newline at end of file +var _0x23fe=['picklist','STRING','BOOLEAN','sequelize','ENUM','string','keyValue'];(function(_0x5df0a3,_0x26948f){var _0x36c3c2=function(_0x402b69){while(--_0x402b69){_0x5df0a3['push'](_0x5df0a3['shift']());}};_0x36c3c2(++_0x26948f);}(_0x23fe,0x14c));var _0xe23f=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x23fe[_0x5834bc];return _0x3e183a;};'use strict';var Sequelize=require(_0xe23f('0x0'));module['exports']={'type':{'type':Sequelize[_0xe23f('0x1')](_0xe23f('0x2'),'variable','customVariable',_0xe23f('0x3'),_0xe23f('0x4')),'defaultValue':_0xe23f('0x2')},'content':{'type':Sequelize[_0xe23f('0x5')]},'key':{'type':Sequelize[_0xe23f('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xe23f('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xe23f('0x5')]},'idField':{'type':Sequelize[_0xe23f('0x5')]},'nameField':{'type':Sequelize[_0xe23f('0x5')]},'customField':{'type':Sequelize[_0xe23f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index ee9a483..3470628 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 _0x0e6a=['name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','show','params','keys','includeAll','include','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','error'];(function(_0x3e4a61,_0x59a7c0){var _0x2361b5=function(_0x218adf){while(--_0x218adf){_0x3e4a61['push'](_0x3e4a61['shift']());}};_0x2361b5(++_0x59a7c0);}(_0x0e6a,0x100));var _0xa0e6=function(_0x59e444,_0x2ff6cd){_0x59e444=_0x59e444-0x0;var _0x4924fb=_0x0e6a[_0x59e444];return _0x4924fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa0e6('0x0'));var zipdir=require(_0xa0e6('0x1'));var jsonpatch=require(_0xa0e6('0x2'));var rp=require(_0xa0e6('0x3'));var moment=require(_0xa0e6('0x4'));var BPromise=require(_0xa0e6('0x5'));var Mustache=require('mustache');var util=require(_0xa0e6('0x6'));var path=require(_0xa0e6('0x7'));var sox=require(_0xa0e6('0x8'));var csv=require(_0xa0e6('0x9'));var ejs=require(_0xa0e6('0xa'));var fs=require('fs');var fs_extra=require(_0xa0e6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa0e6('0xc'));var jsforce=require(_0xa0e6('0xd'));var deskjs=require(_0xa0e6('0xe'));var toCsv=require(_0xa0e6('0x9'));var querystring=require(_0xa0e6('0xf'));var Papa=require(_0xa0e6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa0e6('0x11'));var as=require(_0xa0e6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0e6('0x13'))('api');var utils=require(_0xa0e6('0x14'));var config=require(_0xa0e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1854b2,_0xb8b194){_0xb8b194=_0xb8b194||0xcc;return function(_0x27118c){if(_0x27118c){return _0x1854b2[_0xa0e6('0x16')](_0xb8b194);}return _0x1854b2[_0xa0e6('0x17')](_0xb8b194)['end']();};}function respondWithResult(_0x1165bf,_0x558c9d){_0x558c9d=_0x558c9d||0xc8;return function(_0x14d99c){if(_0x14d99c){return _0x1165bf[_0xa0e6('0x17')](_0x558c9d)['json'](_0x14d99c);}};}function respondWithFilteredResult(_0x197e8b,_0x2da5c7){return function(_0x1bfdb1){if(_0x1bfdb1){var _0x301a37=typeof _0x2da5c7[_0xa0e6('0x18')]===_0xa0e6('0x19')&&typeof _0x2da5c7[_0xa0e6('0x1a')]==='undefined';var _0x5b4294=_0x1bfdb1['count'];var _0x3cc453=_0x301a37?0x0:_0x2da5c7[_0xa0e6('0x18')];var _0x5b9aa6=_0x301a37?_0x1bfdb1[_0xa0e6('0x1b')]:_0x2da5c7[_0xa0e6('0x18')]+_0x2da5c7[_0xa0e6('0x1a')];var _0x5c0718;if(_0x5b9aa6>=_0x5b4294){_0x5b9aa6=_0x5b4294;_0x5c0718=0xc8;}else{_0x5c0718=0xce;}_0x197e8b['status'](_0x5c0718);return _0x197e8b[_0xa0e6('0x1c')](_0xa0e6('0x1d'),_0x3cc453+'-'+_0x5b9aa6+'/'+_0x5b4294)['json'](_0x1bfdb1);}return null;};}function patchUpdates(_0x2dc797){return function(_0x290a58){try{jsonpatch['apply'](_0x290a58,_0x2dc797,!![]);}catch(_0x200849){return BPromise[_0xa0e6('0x1e')](_0x200849);}return _0x290a58['save']();};}function saveUpdates(_0x2eddca,_0x582ee5){return function(_0x2361ad){if(_0x2361ad){return _0x2361ad[_0xa0e6('0x1f')](_0x2eddca)[_0xa0e6('0x20')](function(_0x2e3224){return _0x2e3224;});}return null;};}function removeEntity(_0x421503,_0x1182ee){return function(_0x4683ad){if(_0x4683ad){return _0x4683ad[_0xa0e6('0x21')]()[_0xa0e6('0x20')](function(){_0x421503[_0xa0e6('0x17')](0xcc)[_0xa0e6('0x22')]();});}};}function handleEntityNotFound(_0x275269,_0xf35c98){return function(_0x144b7c){if(!_0x144b7c){_0x275269[_0xa0e6('0x16')](0x194);}return _0x144b7c;};}function handleError(_0x301854,_0x12b46f){_0x12b46f=_0x12b46f||0x1f4;return function(_0x35aa2a){logger[_0xa0e6('0x23')](_0x35aa2a['stack']);if(_0x35aa2a[_0xa0e6('0x24')]){delete _0x35aa2a[_0xa0e6('0x24')];}_0x301854[_0xa0e6('0x17')](_0x12b46f)[_0xa0e6('0x25')](_0x35aa2a);};}exports[_0xa0e6('0x26')]=function(_0x17c0a5,_0x2a5d3c){var _0x51c173={},_0x500a3d={},_0x12185c={'count':0x0,'rows':[]};var _0x2f4c57=_[_0xa0e6('0x27')](db[_0xa0e6('0x28')][_0xa0e6('0x29')],function(_0x1dc830){return{'name':_0x1dc830[_0xa0e6('0x2a')],'type':_0x1dc830[_0xa0e6('0x2b')][_0xa0e6('0x2c')]};});_0x500a3d[_0xa0e6('0x2d')]=_[_0xa0e6('0x27')](_0x2f4c57,'name');_0x500a3d['query']=_['keys'](_0x17c0a5[_0xa0e6('0x2e')]);_0x500a3d[_0xa0e6('0x2f')]=_[_0xa0e6('0x30')](_0x500a3d[_0xa0e6('0x2d')],_0x500a3d['query']);_0x51c173[_0xa0e6('0x31')]=_['intersection'](_0x500a3d[_0xa0e6('0x2d')],qs[_0xa0e6('0x32')](_0x17c0a5[_0xa0e6('0x2e')][_0xa0e6('0x32')]));_0x51c173['attributes']=_0x51c173['attributes'][_0xa0e6('0x33')]?_0x51c173[_0xa0e6('0x31')]:_0x500a3d[_0xa0e6('0x2d')];if(!_0x17c0a5['query'][_0xa0e6('0x34')](_0xa0e6('0x35'))){_0x51c173[_0xa0e6('0x1a')]=qs[_0xa0e6('0x1a')](_0x17c0a5[_0xa0e6('0x2e')][_0xa0e6('0x1a')]);_0x51c173[_0xa0e6('0x18')]=qs[_0xa0e6('0x18')](_0x17c0a5[_0xa0e6('0x2e')][_0xa0e6('0x18')]);}_0x51c173[_0xa0e6('0x36')]=qs[_0xa0e6('0x37')](_0x17c0a5[_0xa0e6('0x2e')][_0xa0e6('0x37')]);_0x51c173[_0xa0e6('0x38')]=qs[_0xa0e6('0x2f')](_[_0xa0e6('0x39')](_0x17c0a5[_0xa0e6('0x2e')],_0x500a3d[_0xa0e6('0x2f')]),_0x2f4c57);if(_0x17c0a5[_0xa0e6('0x2e')]['filter']){_0x51c173[_0xa0e6('0x38')]=_[_0xa0e6('0x3a')](_0x51c173[_0xa0e6('0x38')],{'$or':_[_0xa0e6('0x27')](_0x2f4c57,function(_0x41aa76){if(_0x41aa76[_0xa0e6('0x2b')]!==_0xa0e6('0x3b')){var _0x541e0d={};_0x541e0d[_0x41aa76[_0xa0e6('0x24')]]={'$like':'%'+_0x17c0a5[_0xa0e6('0x2e')][_0xa0e6('0x3c')]+'%'};return _0x541e0d;}})});}_0x51c173=_[_0xa0e6('0x3a')]({},_0x51c173,_0x17c0a5[_0xa0e6('0x3d')]);var _0x3127a8={'where':_0x51c173[_0xa0e6('0x38')]};return db[_0xa0e6('0x28')]['count'](_0x3127a8)[_0xa0e6('0x20')](function(_0x10964d){_0x12185c[_0xa0e6('0x1b')]=_0x10964d;if(_0x17c0a5[_0xa0e6('0x2e')]['includeAll']){_0x51c173['include']=[{'all':!![]}];}return db[_0xa0e6('0x28')][_0xa0e6('0x3e')](_0x51c173);})[_0xa0e6('0x20')](function(_0x11b884){_0x12185c[_0xa0e6('0x3f')]=_0x11b884;return _0x12185c;})[_0xa0e6('0x20')](respondWithFilteredResult(_0x2a5d3c,_0x51c173))['catch'](handleError(_0x2a5d3c,null));};exports[_0xa0e6('0x40')]=function(_0x5db983,_0x3bebb2){var _0x3c3dc7={'raw':!![],'where':{'id':_0x5db983[_0xa0e6('0x41')]['id']}},_0x1b2195={};_0x1b2195[_0xa0e6('0x2d')]=_[_0xa0e6('0x42')](db[_0xa0e6('0x28')][_0xa0e6('0x29')]);_0x1b2195[_0xa0e6('0x2e')]=_[_0xa0e6('0x42')](_0x5db983[_0xa0e6('0x2e')]);_0x1b2195[_0xa0e6('0x2f')]=_['intersection'](_0x1b2195[_0xa0e6('0x2d')],_0x1b2195[_0xa0e6('0x2e')]);_0x3c3dc7[_0xa0e6('0x31')]=_[_0xa0e6('0x30')](_0x1b2195[_0xa0e6('0x2d')],qs['fields'](_0x5db983[_0xa0e6('0x2e')][_0xa0e6('0x32')]));_0x3c3dc7[_0xa0e6('0x31')]=_0x3c3dc7[_0xa0e6('0x31')][_0xa0e6('0x33')]?_0x3c3dc7[_0xa0e6('0x31')]:_0x1b2195[_0xa0e6('0x2d')];if(_0x5db983[_0xa0e6('0x2e')][_0xa0e6('0x43')]){_0x3c3dc7[_0xa0e6('0x44')]=[{'all':!![]}];}_0x3c3dc7=_[_0xa0e6('0x3a')]({},_0x3c3dc7,_0x5db983['options']);return db['DeskField'][_0xa0e6('0x45')](_0x3c3dc7)[_0xa0e6('0x20')](handleEntityNotFound(_0x3bebb2,null))[_0xa0e6('0x20')](respondWithResult(_0x3bebb2,null))[_0xa0e6('0x46')](handleError(_0x3bebb2,null));};exports['create']=function(_0x8987a0,_0x3cf8d1){return db[_0xa0e6('0x28')][_0xa0e6('0x47')](_0x8987a0['body'],{})['then'](respondWithResult(_0x3cf8d1,0xc9))[_0xa0e6('0x46')](handleError(_0x3cf8d1,null));};exports['update']=function(_0x356a2d,_0x3e2a28){if(_0x356a2d['body']['id']){delete _0x356a2d[_0xa0e6('0x48')]['id'];}return db['DeskField'][_0xa0e6('0x45')]({'where':{'id':_0x356a2d[_0xa0e6('0x41')]['id']}})['then'](handleEntityNotFound(_0x3e2a28,null))[_0xa0e6('0x20')](saveUpdates(_0x356a2d[_0xa0e6('0x48')],null))[_0xa0e6('0x20')](respondWithResult(_0x3e2a28,null))[_0xa0e6('0x46')](handleError(_0x3e2a28,null));};exports[_0xa0e6('0x21')]=function(_0x11a924,_0x1745ea){return db[_0xa0e6('0x28')][_0xa0e6('0x45')]({'where':{'id':_0x11a924[_0xa0e6('0x41')]['id']}})[_0xa0e6('0x20')](handleEntityNotFound(_0x1745ea,null))[_0xa0e6('0x20')](removeEntity(_0x1745ea,null))['catch'](handleError(_0x1745ea,null));}; \ No newline at end of file +var _0xdb70=['params','keys','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','DeskField','rawAttributes','fieldName','key','map','query','filters','attributes','intersection','fields','length','model','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show'];(function(_0x20126d,_0x1623b5){var _0x4e80c8=function(_0x1c370b){while(--_0x1c370b){_0x20126d['push'](_0x20126d['shift']());}};_0x4e80c8(++_0x1623b5);}(_0xdb70,0xa0));var _0x0db7=function(_0x2b0f81,_0x3917f0){_0x2b0f81=_0x2b0f81-0x0;var _0x5ce74c=_0xdb70[_0x2b0f81];return _0x5ce74c;};'use strict';var emlformat=require(_0x0db7('0x0'));var rimraf=require(_0x0db7('0x1'));var zipdir=require(_0x0db7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0db7('0x3'));var moment=require(_0x0db7('0x4'));var BPromise=require(_0x0db7('0x5'));var Mustache=require(_0x0db7('0x6'));var util=require(_0x0db7('0x7'));var path=require(_0x0db7('0x8'));var sox=require(_0x0db7('0x9'));var csv=require(_0x0db7('0xa'));var ejs=require(_0x0db7('0xb'));var fs=require('fs');var fs_extra=require(_0x0db7('0xc'));var _=require(_0x0db7('0xd'));var squel=require('squel');var crypto=require(_0x0db7('0xe'));var jsforce=require(_0x0db7('0xf'));var deskjs=require(_0x0db7('0x10'));var toCsv=require(_0x0db7('0xa'));var querystring=require(_0x0db7('0x11'));var Papa=require(_0x0db7('0x12'));var Redis=require('ioredis');var authService=require(_0x0db7('0x13'));var qs=require(_0x0db7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0db7('0x15'));var logger=require(_0x0db7('0x16'))(_0x0db7('0x17'));var utils=require(_0x0db7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0db7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9aed4f,_0x2959a2){_0x2959a2=_0x2959a2||0xcc;return function(_0x33ec07){if(_0x33ec07){return _0x9aed4f[_0x0db7('0x1a')](_0x2959a2);}return _0x9aed4f[_0x0db7('0x1b')](_0x2959a2)['end']();};}function respondWithResult(_0x76c036,_0x195556){_0x195556=_0x195556||0xc8;return function(_0x45f594){if(_0x45f594){return _0x76c036[_0x0db7('0x1b')](_0x195556)[_0x0db7('0x1c')](_0x45f594);}};}function respondWithFilteredResult(_0x446448,_0x41b2b3){return function(_0x2edbe9){if(_0x2edbe9){var _0xb9127d=typeof _0x41b2b3[_0x0db7('0x1d')]==='undefined'&&typeof _0x41b2b3[_0x0db7('0x1e')]===_0x0db7('0x1f');var _0x18cf37=_0x2edbe9[_0x0db7('0x20')];var _0x31082b=_0xb9127d?0x0:_0x41b2b3[_0x0db7('0x1d')];var _0x52e95e=_0xb9127d?_0x2edbe9['count']:_0x41b2b3[_0x0db7('0x1d')]+_0x41b2b3[_0x0db7('0x1e')];var _0xe9a55d;if(_0x52e95e>=_0x18cf37){_0x52e95e=_0x18cf37;_0xe9a55d=0xc8;}else{_0xe9a55d=0xce;}_0x446448['status'](_0xe9a55d);return _0x446448[_0x0db7('0x21')](_0x0db7('0x22'),_0x31082b+'-'+_0x52e95e+'/'+_0x18cf37)[_0x0db7('0x1c')](_0x2edbe9);}return null;};}function patchUpdates(_0x211fc0){return function(_0x5a0b04){try{jsonpatch[_0x0db7('0x23')](_0x5a0b04,_0x211fc0,!![]);}catch(_0x48feb2){return BPromise[_0x0db7('0x24')](_0x48feb2);}return _0x5a0b04['save']();};}function saveUpdates(_0x59b7e4,_0x135429){return function(_0x156aaa){if(_0x156aaa){return _0x156aaa[_0x0db7('0x25')](_0x59b7e4)[_0x0db7('0x26')](function(_0x18fc1c){return _0x18fc1c;});}return null;};}function removeEntity(_0x368243,_0xc05009){return function(_0x274bf1){if(_0x274bf1){return _0x274bf1[_0x0db7('0x27')]()[_0x0db7('0x26')](function(){_0x368243[_0x0db7('0x1b')](0xcc)[_0x0db7('0x28')]();});}};}function handleEntityNotFound(_0x299c22,_0x55f339){return function(_0x521565){if(!_0x521565){_0x299c22['sendStatus'](0x194);}return _0x521565;};}function handleError(_0x594e6a,_0x568e60){_0x568e60=_0x568e60||0x1f4;return function(_0x5d2e46){logger[_0x0db7('0x29')](_0x5d2e46[_0x0db7('0x2a')]);if(_0x5d2e46[_0x0db7('0x2b')]){delete _0x5d2e46['name'];}_0x594e6a['status'](_0x568e60)[_0x0db7('0x2c')](_0x5d2e46);};}exports[_0x0db7('0x2d')]=function(_0x3f2169,_0x37ade4){var _0x29ed0a={},_0xfc7311={},_0x4ca418={'count':0x0,'rows':[]};var _0x2de626=_['map'](db[_0x0db7('0x2e')][_0x0db7('0x2f')],function(_0x1481aa){return{'name':_0x1481aa[_0x0db7('0x30')],'type':_0x1481aa['type'][_0x0db7('0x31')]};});_0xfc7311['model']=_[_0x0db7('0x32')](_0x2de626,_0x0db7('0x2b'));_0xfc7311[_0x0db7('0x33')]=_['keys'](_0x3f2169[_0x0db7('0x33')]);_0xfc7311[_0x0db7('0x34')]=_['intersection'](_0xfc7311['model'],_0xfc7311[_0x0db7('0x33')]);_0x29ed0a[_0x0db7('0x35')]=_[_0x0db7('0x36')](_0xfc7311['model'],qs['fields'](_0x3f2169[_0x0db7('0x33')][_0x0db7('0x37')]));_0x29ed0a[_0x0db7('0x35')]=_0x29ed0a['attributes'][_0x0db7('0x38')]?_0x29ed0a[_0x0db7('0x35')]:_0xfc7311[_0x0db7('0x39')];if(!_0x3f2169[_0x0db7('0x33')]['hasOwnProperty'](_0x0db7('0x3a'))){_0x29ed0a['limit']=qs[_0x0db7('0x1e')](_0x3f2169['query'][_0x0db7('0x1e')]);_0x29ed0a[_0x0db7('0x1d')]=qs[_0x0db7('0x1d')](_0x3f2169['query']['offset']);}_0x29ed0a[_0x0db7('0x3b')]=qs[_0x0db7('0x3c')](_0x3f2169[_0x0db7('0x33')][_0x0db7('0x3c')]);_0x29ed0a[_0x0db7('0x3d')]=qs[_0x0db7('0x34')](_['pick'](_0x3f2169[_0x0db7('0x33')],_0xfc7311[_0x0db7('0x34')]),_0x2de626);if(_0x3f2169['query'][_0x0db7('0x3e')]){_0x29ed0a['where']=_[_0x0db7('0x3f')](_0x29ed0a['where'],{'$or':_[_0x0db7('0x32')](_0x2de626,function(_0x27ed23){if(_0x27ed23['type']!==_0x0db7('0x40')){var _0x100ef9={};_0x100ef9[_0x27ed23['name']]={'$like':'%'+_0x3f2169[_0x0db7('0x33')]['filter']+'%'};return _0x100ef9;}})});}_0x29ed0a=_[_0x0db7('0x3f')]({},_0x29ed0a,_0x3f2169[_0x0db7('0x41')]);var _0x32c295={'where':_0x29ed0a[_0x0db7('0x3d')]};return db[_0x0db7('0x2e')]['count'](_0x32c295)[_0x0db7('0x26')](function(_0x2545bf){_0x4ca418[_0x0db7('0x20')]=_0x2545bf;if(_0x3f2169[_0x0db7('0x33')][_0x0db7('0x42')]){_0x29ed0a[_0x0db7('0x43')]=[{'all':!![]}];}return db[_0x0db7('0x2e')][_0x0db7('0x44')](_0x29ed0a);})[_0x0db7('0x26')](function(_0x4591fe){_0x4ca418[_0x0db7('0x45')]=_0x4591fe;return _0x4ca418;})[_0x0db7('0x26')](respondWithFilteredResult(_0x37ade4,_0x29ed0a))['catch'](handleError(_0x37ade4,null));};exports[_0x0db7('0x46')]=function(_0x4a9066,_0x23558a){var _0x150936={'raw':!![],'where':{'id':_0x4a9066[_0x0db7('0x47')]['id']}},_0x55732f={};_0x55732f['model']=_[_0x0db7('0x48')](db[_0x0db7('0x2e')][_0x0db7('0x2f')]);_0x55732f[_0x0db7('0x33')]=_[_0x0db7('0x48')](_0x4a9066[_0x0db7('0x33')]);_0x55732f[_0x0db7('0x34')]=_[_0x0db7('0x36')](_0x55732f[_0x0db7('0x39')],_0x55732f['query']);_0x150936['attributes']=_['intersection'](_0x55732f[_0x0db7('0x39')],qs[_0x0db7('0x37')](_0x4a9066[_0x0db7('0x33')][_0x0db7('0x37')]));_0x150936[_0x0db7('0x35')]=_0x150936[_0x0db7('0x35')]['length']?_0x150936[_0x0db7('0x35')]:_0x55732f[_0x0db7('0x39')];if(_0x4a9066['query'][_0x0db7('0x42')]){_0x150936[_0x0db7('0x43')]=[{'all':!![]}];}_0x150936=_[_0x0db7('0x3f')]({},_0x150936,_0x4a9066['options']);return db[_0x0db7('0x2e')][_0x0db7('0x49')](_0x150936)[_0x0db7('0x26')](handleEntityNotFound(_0x23558a,null))[_0x0db7('0x26')](respondWithResult(_0x23558a,null))[_0x0db7('0x4a')](handleError(_0x23558a,null));};exports['create']=function(_0x23d9b3,_0x2388fa){return db[_0x0db7('0x2e')][_0x0db7('0x4b')](_0x23d9b3['body'],{})['then'](respondWithResult(_0x2388fa,0xc9))[_0x0db7('0x4a')](handleError(_0x2388fa,null));};exports['update']=function(_0x534daa,_0x3281bd){if(_0x534daa[_0x0db7('0x4c')]['id']){delete _0x534daa['body']['id'];}return db[_0x0db7('0x2e')][_0x0db7('0x49')]({'where':{'id':_0x534daa[_0x0db7('0x47')]['id']}})[_0x0db7('0x26')](handleEntityNotFound(_0x3281bd,null))['then'](saveUpdates(_0x534daa['body'],null))['then'](respondWithResult(_0x3281bd,null))[_0x0db7('0x4a')](handleError(_0x3281bd,null));};exports[_0x0db7('0x27')]=function(_0x1ac5df,_0x10863b){return db['DeskField'][_0x0db7('0x49')]({'where':{'id':_0x1ac5df['params']['id']}})['then'](handleEntityNotFound(_0x10863b,null))['then'](removeEntity(_0x10863b,null))[_0x0db7('0x4a')](handleError(_0x10863b,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 0803eb4..9a2d73c 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 _0x00ef=['request-promise','path','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','../../config/logger','moment'];(function(_0x55498a,_0x1ee0e4){var _0x27b7f4=function(_0x32cefb){while(--_0x32cefb){_0x55498a['push'](_0x55498a['shift']());}};_0x27b7f4(++_0x1ee0e4);}(_0x00ef,0x1e1));var _0xf00e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x00ef[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf00e('0x0'));var util=require('util');var logger=require(_0xf00e('0x1'))('api');var moment=require(_0xf00e('0x2'));var BPromise=require('bluebird');var rp=require(_0xf00e('0x3'));var fs=require('fs');var path=require(_0xf00e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf00e('0x5'));module['exports']=function(_0x565b58,_0x625d26){return _0x565b58[_0xf00e('0x6')](_0xf00e('0x7'),attributes,{'tableName':_0xf00e('0x8'),'paranoid':![],'indexes':[{'name':_0xf00e('0x9'),'fields':['idField',_0xf00e('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbb41=['desk_unique_index','idField','FieldId','lodash','util','api','path','rimraf','../../config/environment','./intDeskField.attributes','exports'];(function(_0x52482a,_0x2c80bd){var _0x436c25=function(_0x176c8d){while(--_0x176c8d){_0x52482a['push'](_0x52482a['shift']());}};_0x436c25(++_0x2c80bd);}(_0xbb41,0x7c));var _0x1bb4=function(_0xbef445,_0x4d994a){_0xbef445=_0xbef445-0x0;var _0x12d448=_0xbb41[_0xbef445];return _0x12d448;};'use strict';var _=require(_0x1bb4('0x0'));var util=require(_0x1bb4('0x1'));var logger=require('../../config/logger')(_0x1bb4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1bb4('0x3'));var rimraf=require(_0x1bb4('0x4'));var config=require(_0x1bb4('0x5'));var attributes=require(_0x1bb4('0x6'));module[_0x1bb4('0x7')]=function(_0x4dead6,_0x39ff9a){return _0x4dead6['define']('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x1bb4('0x8'),'fields':[_0x1bb4('0x9'),_0x1bb4('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 77ae952..d61b259 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 _0x7173=['request\x20sent','stringify','error','code','message','result','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x5dc650,_0x5d3864){var _0x4161df=function(_0x285079){while(--_0x285079){_0x5dc650['push'](_0x5dc650['shift']());}};_0x4161df(++_0x5d3864);}(_0x7173,0x6f));var _0x3717=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x7173[_0x367e5b];return _0x4b909e;};'use strict';var _=require('lodash');var util=require(_0x3717('0x0'));var moment=require(_0x3717('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3717('0x2'));var db=require(_0x3717('0x3'))['db'];var utils=require(_0x3717('0x4'));var logger=require(_0x3717('0x5'))('rpc');var config=require(_0x3717('0x6'));var jayson=require(_0x3717('0x7'));var client=jayson[_0x3717('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x244a74,_0x6b2b64,_0x55ed74){return new BPromise(function(_0x1cff08,_0x3f2cda){return client[_0x3717('0x9')](_0x244a74,_0x55ed74)[_0x3717('0xa')](function(_0xedb150){logger[_0x3717('0xb')](_0x3717('0xc'),_0x6b2b64,'request\x20sent');logger[_0x3717('0xd')](_0x3717('0xe'),_0x6b2b64,_0x3717('0xf'),JSON[_0x3717('0x10')](_0xedb150));if(_0xedb150[_0x3717('0x11')]){if(_0xedb150[_0x3717('0x11')][_0x3717('0x12')]===0x1f4){logger[_0x3717('0x11')]('DeskField,\x20%s,\x20%s',_0x6b2b64,_0xedb150[_0x3717('0x11')]['message']);return _0x3f2cda(_0xedb150['error']['message']);}logger['error'](_0x3717('0xc'),_0x6b2b64,_0xedb150['error']['message']);return _0x1cff08(_0xedb150[_0x3717('0x11')][_0x3717('0x13')]);}else{logger[_0x3717('0xb')]('DeskField,\x20%s,\x20%s',_0x6b2b64,'request\x20sent');_0x1cff08(_0xedb150[_0x3717('0x14')][_0x3717('0x13')]);}})['catch'](function(_0x4d944f){logger[_0x3717('0x11')](_0x3717('0xc'),_0x6b2b64,_0x4d944f);_0x3f2cda(_0x4d944f);});});} \ No newline at end of file +var _0x5147=['info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4d9de7,_0x366cfe){var _0x1c8d66=function(_0x14b430){while(--_0x14b430){_0x4d9de7['push'](_0x4d9de7['shift']());}};_0x1c8d66(++_0x366cfe);}(_0x5147,0x8f));var _0x7514=function(_0x3e8254,_0x57a1ef){_0x3e8254=_0x3e8254-0x0;var _0xc4dc5a=_0x5147[_0x3e8254];return _0xc4dc5a;};'use strict';var _=require(_0x7514('0x0'));var util=require(_0x7514('0x1'));var moment=require(_0x7514('0x2'));var BPromise=require(_0x7514('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7514('0x4'));var logger=require('../../config/logger')(_0x7514('0x5'));var config=require(_0x7514('0x6'));var jayson=require(_0x7514('0x7'));var client=jayson['client'][_0x7514('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x201308,_0x1bfbad,_0x1e7ba4){return new BPromise(function(_0x43455e,_0x53a4a0){return client[_0x7514('0x9')](_0x201308,_0x1e7ba4)[_0x7514('0xa')](function(_0x2212be){logger[_0x7514('0xb')]('DeskField,\x20%s,\x20%s',_0x1bfbad,_0x7514('0xc'));logger[_0x7514('0xd')](_0x7514('0xe'),_0x1bfbad,_0x7514('0xc'),JSON[_0x7514('0xf')](_0x2212be));if(_0x2212be[_0x7514('0x10')]){if(_0x2212be[_0x7514('0x10')][_0x7514('0x11')]===0x1f4){logger[_0x7514('0x10')](_0x7514('0x12'),_0x1bfbad,_0x2212be[_0x7514('0x10')]['message']);return _0x53a4a0(_0x2212be[_0x7514('0x10')]['message']);}logger[_0x7514('0x10')]('DeskField,\x20%s,\x20%s',_0x1bfbad,_0x2212be[_0x7514('0x10')][_0x7514('0x13')]);return _0x43455e(_0x2212be[_0x7514('0x10')]['message']);}else{logger['info'](_0x7514('0x12'),_0x1bfbad,_0x7514('0xc'));_0x43455e(_0x2212be[_0x7514('0x14')][_0x7514('0x13')]);}})[_0x7514('0x15')](function(_0x3f351f){logger[_0x7514('0x10')]('DeskField,\x20%s,\x20%s',_0x1bfbad,_0x3f351f);_0x53a4a0(_0x3f351f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 142e30c..f74bfa7 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 _0x4b83=['isAuthenticated','/:id/configurations','getConfigurations','post','put','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id'];(function(_0x48aade,_0x70232){var _0x2ae465=function(_0x523c4d){while(--_0x523c4d){_0x48aade['push'](_0x48aade['shift']());}};_0x2ae465(++_0x70232);}(_0x4b83,0x76));var _0x34b8=function(_0x5aeea8,_0x1a5245){_0x5aeea8=_0x5aeea8-0x0;var _0x23c4ba=_0x4b83[_0x5aeea8];return _0x23c4ba;};'use strict';var multer=require(_0x34b8('0x0'));var util=require(_0x34b8('0x1'));var path=require(_0x34b8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x34b8('0x3')]();var fs_extra=require(_0x34b8('0x4'));var auth=require(_0x34b8('0x5'));var interaction=require(_0x34b8('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x34b8('0x7')]);router[_0x34b8('0x8')](_0x34b8('0x9'),auth[_0x34b8('0xa')](),controller['show']);router[_0x34b8('0x8')](_0x34b8('0xb'),auth[_0x34b8('0xa')](),controller[_0x34b8('0xc')]);router['get']('/:id/fields',auth[_0x34b8('0xa')](),controller['getFields']);router['post']('/',auth[_0x34b8('0xa')](),controller['create']);router[_0x34b8('0xd')](_0x34b8('0xb'),auth[_0x34b8('0xa')](),controller['addConfiguration']);router[_0x34b8('0xe')](_0x34b8('0x9'),auth[_0x34b8('0xa')](),controller['update']);router[_0x34b8('0xf')](_0x34b8('0x9'),auth[_0x34b8('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9e5a=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x32a7c9,_0x1d19b6){var _0x1663b2=function(_0x3b2bcc){while(--_0x3b2bcc){_0x32a7c9['push'](_0x32a7c9['shift']());}};_0x1663b2(++_0x1d19b6);}(_0x9e5a,0x17e));var _0xa9e5=function(_0x533220,_0x39c777){_0x533220=_0x533220-0x0;var _0x421e6c=_0x9e5a[_0x533220];return _0x421e6c;};'use strict';var multer=require(_0xa9e5('0x0'));var util=require(_0xa9e5('0x1'));var path=require(_0xa9e5('0x2'));var timeout=require(_0xa9e5('0x3'));var express=require(_0xa9e5('0x4'));var router=express[_0xa9e5('0x5')]();var fs_extra=require(_0xa9e5('0x6'));var auth=require(_0xa9e5('0x7'));var interaction=require(_0xa9e5('0x8'));var config=require(_0xa9e5('0x9'));var controller=require('./intDynamics365Account.controller');router[_0xa9e5('0xa')]('/',auth[_0xa9e5('0xb')](),controller[_0xa9e5('0xc')]);router[_0xa9e5('0xa')](_0xa9e5('0xd'),auth[_0xa9e5('0xb')](),controller[_0xa9e5('0xe')]);router[_0xa9e5('0xa')](_0xa9e5('0xf'),auth[_0xa9e5('0xb')](),controller['getConfigurations']);router['get'](_0xa9e5('0x10'),auth['isAuthenticated'](),controller[_0xa9e5('0x11')]);router['post']('/',auth[_0xa9e5('0xb')](),controller[_0xa9e5('0x12')]);router[_0xa9e5('0x13')](_0xa9e5('0xf'),auth[_0xa9e5('0xb')](),controller[_0xa9e5('0x14')]);router[_0xa9e5('0x15')](_0xa9e5('0xd'),auth[_0xa9e5('0xb')](),controller[_0xa9e5('0x16')]);router[_0xa9e5('0x17')](_0xa9e5('0xd'),auth[_0xa9e5('0xb')](),controller[_0xa9e5('0x18')]);module[_0xa9e5('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index c11c5b8..9c868bd 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 _0x535f=['exports','STRING','BOOLEAN'];(function(_0xda4ac2,_0x55a808){var _0x5a234d=function(_0x44258d){while(--_0x44258d){_0xda4ac2['push'](_0xda4ac2['shift']());}};_0x5a234d(++_0x55a808);}(_0x535f,0x111));var _0xf535=function(_0x14397a,_0x3491e8){_0x14397a=_0x14397a-0x0;var _0x125527=_0x535f[_0x14397a];return _0x125527;};'use strict';var Sequelize=require('sequelize');module[_0xf535('0x0')]={'name':{'type':Sequelize[_0xf535('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf535('0x1')]},'remoteUri':{'type':Sequelize[_0xf535('0x1')]},'tenantId':{'type':Sequelize[_0xf535('0x1')]},'clientId':{'type':Sequelize[_0xf535('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf535('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xf535('0x1')]},'modernAuthentication':{'type':Sequelize[_0xf535('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5395=['sequelize','STRING','BOOLEAN'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x5395,0x150));var _0x5539=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5395[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x5539('0x0'));module['exports']={'name':{'type':Sequelize[_0x5539('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5539('0x1')]},'tenantId':{'type':Sequelize[_0x5539('0x1')]},'clientId':{'type':Sequelize[_0x5539('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x5539('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5539('0x1')]},'modernAuthentication':{'type':Sequelize[_0x5539('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index a81b262..83a87e7 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 _0x59d5=['contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','onholdtime','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data7','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','concat','statusCode','error','stack','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName','EntityDefinitions(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../components/parsers/qs','../../config/logger','../../components/integrations/configuration','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','end','sendStatus','name','send','index','map','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','Dynamics365Account','then','includeAll','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','incident','PhoneCall','title','description','customerid','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits'];(function(_0x450605,_0x29ba61){var _0xf9d26d=function(_0x49d90b){while(--_0x49d90b){_0x450605['push'](_0x450605['shift']());}};_0xf9d26d(++_0x29ba61);}(_0x59d5,0x67));var _0x559d=function(_0x42b9bb,_0x3f7741){_0x42b9bb=_0x42b9bb-0x0;var _0x3058fb=_0x59d5[_0x42b9bb];return _0x3058fb;};'use strict';var rp=require(_0x559d('0x0'));var util=require(_0x559d('0x1'));var _=require('lodash');var qs=require(_0x559d('0x2'));var logger=require(_0x559d('0x3'))('api');var db=require('../../mysqldb')['db'];var integrations=require(_0x559d('0x4'));function respondWithResult(_0x1864ba,_0x2c75b5){_0x2c75b5=_0x2c75b5||0xc8;return function(_0x4159c2){if(_0x4159c2){return _0x1864ba[_0x559d('0x5')](_0x2c75b5)[_0x559d('0x6')](_0x4159c2);}};}function respondWithFilteredResult(_0x425dc9,_0x26583f){return function(_0x1f7bb7){if(_0x1f7bb7){var _0x2bb172=typeof _0x26583f[_0x559d('0x7')]==='undefined'&&typeof _0x26583f[_0x559d('0x8')]===_0x559d('0x9');var _0x1b4401=_0x1f7bb7[_0x559d('0xa')];var _0x4d528a=_0x2bb172?0x0:_0x26583f['offset'];var _0x3110fa=_0x2bb172?_0x1f7bb7[_0x559d('0xa')]:_0x26583f[_0x559d('0x7')]+_0x26583f[_0x559d('0x8')];var _0x3e1b6e;if(_0x3110fa>=_0x1b4401){_0x3110fa=_0x1b4401;_0x3e1b6e=0xc8;}else{_0x3e1b6e=0xce;}_0x425dc9['status'](_0x3e1b6e);return _0x425dc9[_0x559d('0xb')](_0x559d('0xc'),_0x4d528a+'-'+_0x3110fa+'/'+_0x1b4401)['json'](_0x1f7bb7);}return null;};}function saveUpdates(_0x2a166e){return function(_0x593281){if(_0x593281){return _0x593281[_0x559d('0xd')](_0x2a166e)['then'](function(_0x122d89){return _0x122d89;});}return null;};}function removeEntity(_0xd6b4dc){return function(_0x24d74b){if(_0x24d74b){return _0x24d74b[_0x559d('0xe')]()['then'](function(){_0xd6b4dc[_0x559d('0x5')](0xcc)[_0x559d('0xf')]();});}};}function handleEntityNotFound(_0x21ad10){return function(_0x383c4d){if(!_0x383c4d){_0x21ad10[_0x559d('0x10')](0x194);}return _0x383c4d;};}function handleError(_0xfb7cbd,_0x203db1){_0x203db1=_0x203db1||0x1f4;return function(_0x3c5073){logger['error'](_0x3c5073['stack']);if(_0x3c5073[_0x559d('0x11')]){delete _0x3c5073['name'];}_0xfb7cbd[_0x559d('0x5')](_0x203db1)[_0x559d('0x12')](_0x3c5073);};}exports[_0x559d('0x13')]=function(_0x28d6ae,_0x4262b8){var _0x124b0a={},_0x3225b3={},_0x585252={'count':0x0,'rows':[]};var _0x29d855=_[_0x559d('0x14')](db['Dynamics365Account']['rawAttributes'],function(_0x1d9e31){return{'name':_0x1d9e31['fieldName'],'type':_0x1d9e31['type'][_0x559d('0x15')]};});_0x3225b3[_0x559d('0x16')]=_[_0x559d('0x14')](_0x29d855,_0x559d('0x11'));_0x3225b3[_0x559d('0x17')]=_['keys'](_0x28d6ae[_0x559d('0x17')]);_0x3225b3['filters']=_[_0x559d('0x18')](_0x3225b3['model'],_0x3225b3['query']);_0x124b0a[_0x559d('0x19')]=_['intersection'](_0x3225b3['model'],qs[_0x559d('0x1a')](_0x28d6ae['query'][_0x559d('0x1a')]));_0x124b0a[_0x559d('0x19')]=_0x124b0a['attributes'][_0x559d('0x1b')]?_0x124b0a[_0x559d('0x19')]:_0x3225b3[_0x559d('0x16')];if(!_0x28d6ae['query']['hasOwnProperty'](_0x559d('0x1c'))){_0x124b0a[_0x559d('0x8')]=qs[_0x559d('0x8')](_0x28d6ae['query'][_0x559d('0x8')]);_0x124b0a[_0x559d('0x7')]=qs[_0x559d('0x7')](_0x28d6ae[_0x559d('0x17')][_0x559d('0x7')]);}_0x124b0a['order']=qs['sort'](_0x28d6ae['query'][_0x559d('0x1d')]);_0x124b0a[_0x559d('0x1e')]=qs['filters'](_[_0x559d('0x1f')](_0x28d6ae[_0x559d('0x17')],_0x3225b3[_0x559d('0x20')]),_0x29d855);if(_0x28d6ae[_0x559d('0x17')][_0x559d('0x21')]){_0x124b0a['where']=_[_0x559d('0x22')](_0x124b0a['where'],{'$or':_[_0x559d('0x14')](_0x29d855,function(_0x406b1c){if(_0x406b1c[_0x559d('0x23')]!==_0x559d('0x24')){var _0x3d1e0a={};_0x3d1e0a[_0x406b1c[_0x559d('0x11')]]={'$like':'%'+_0x28d6ae[_0x559d('0x17')]['filter']+'%'};return _0x3d1e0a;}})});}_0x124b0a=_[_0x559d('0x22')]({},_0x124b0a,_0x28d6ae[_0x559d('0x25')]);var _0x9db3ba={'where':_0x124b0a[_0x559d('0x1e')]};return db[_0x559d('0x26')][_0x559d('0xa')](_0x9db3ba)[_0x559d('0x27')](function(_0x39a5db){_0x585252['count']=_0x39a5db;if(_0x28d6ae[_0x559d('0x17')][_0x559d('0x28')]){_0x124b0a['include']=[{'all':!![]}];}return db[_0x559d('0x26')][_0x559d('0x29')](_0x124b0a);})[_0x559d('0x27')](function(_0x4be5d2){_0x585252[_0x559d('0x2a')]=_0x4be5d2;return _0x585252;})[_0x559d('0x27')](respondWithFilteredResult(_0x4262b8,_0x124b0a))[_0x559d('0x2b')](handleError(_0x4262b8,null));};exports[_0x559d('0x2c')]=function(_0x5ad548,_0x466df8){var _0xe9d0d6={'raw':![],'where':{'id':_0x5ad548['params']['id']}},_0x72e191={};_0x72e191['model']=_[_0x559d('0x2d')](db['Dynamics365Account'][_0x559d('0x2e')]);_0x72e191['query']=_[_0x559d('0x2d')](_0x5ad548[_0x559d('0x17')]);_0x72e191[_0x559d('0x20')]=_[_0x559d('0x18')](_0x72e191[_0x559d('0x16')],_0x72e191['query']);_0xe9d0d6[_0x559d('0x19')]=_['intersection'](_0x72e191[_0x559d('0x16')],qs[_0x559d('0x1a')](_0x5ad548[_0x559d('0x17')][_0x559d('0x1a')]));_0xe9d0d6[_0x559d('0x19')]=_0xe9d0d6['attributes'][_0x559d('0x1b')]?_0xe9d0d6[_0x559d('0x19')]:_0x72e191[_0x559d('0x16')];if(_0x5ad548[_0x559d('0x17')][_0x559d('0x28')]){_0xe9d0d6['include']=[{'all':!![]}];}_0xe9d0d6=_['merge']({},_0xe9d0d6,_0x5ad548[_0x559d('0x25')]);return db[_0x559d('0x26')][_0x559d('0x2f')](_0xe9d0d6)['then'](handleEntityNotFound(_0x466df8,null))[_0x559d('0x27')](respondWithResult(_0x466df8,null))['catch'](handleError(_0x466df8,null));};exports[_0x559d('0x30')]=function(_0x58a78f,_0x3d2c3f){return db['Dynamics365Account'][_0x559d('0x30')](_0x58a78f[_0x559d('0x31')],{})['then'](respondWithResult(_0x3d2c3f,0xc9))[_0x559d('0x2b')](handleError(_0x3d2c3f,null));};exports['update']=function(_0x19b02d,_0x40ff18){if(_0x19b02d['body']['id']){delete _0x19b02d[_0x559d('0x31')]['id'];}return db[_0x559d('0x26')][_0x559d('0x2f')]({'where':{'id':_0x19b02d['params']['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x40ff18,null))['then'](saveUpdates(_0x19b02d[_0x559d('0x31')],null))[_0x559d('0x27')](respondWithResult(_0x40ff18,null))[_0x559d('0x2b')](handleError(_0x40ff18,null));};exports[_0x559d('0xe')]=function(_0x197518,_0x1ebaa4){return db[_0x559d('0x26')][_0x559d('0x2f')]({'where':{'id':_0x197518[_0x559d('0x32')]['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x1ebaa4,null))['then'](removeEntity(_0x1ebaa4,null))[_0x559d('0x2b')](handleError(_0x1ebaa4,null));};exports[_0x559d('0x33')]=function(_0x58a7aa,_0x5c9449){var _0x2f1a40={};var _0x2b5ad9={};var _0x586dcd;var _0x4db7d1;return db['Dynamics365Account'][_0x559d('0x34')]({'where':{'id':_0x58a7aa[_0x559d('0x32')]['id']}})['then'](handleEntityNotFound(_0x5c9449,null))[_0x559d('0x27')](function(_0x31a6ef){if(_0x31a6ef){_0x586dcd=_0x31a6ef;_0x2b5ad9[_0x559d('0x16')]=_[_0x559d('0x2d')](db[_0x559d('0x35')][_0x559d('0x2e')]);_0x2b5ad9[_0x559d('0x17')]=_[_0x559d('0x2d')](_0x58a7aa['query']);_0x2b5ad9[_0x559d('0x20')]=_[_0x559d('0x18')](_0x2b5ad9[_0x559d('0x16')],_0x2b5ad9[_0x559d('0x17')]);_0x2f1a40[_0x559d('0x19')]=_[_0x559d('0x18')](_0x2b5ad9['model'],qs[_0x559d('0x1a')](_0x58a7aa[_0x559d('0x17')][_0x559d('0x1a')]));_0x2f1a40[_0x559d('0x19')]=_0x2f1a40[_0x559d('0x19')][_0x559d('0x1b')]?_0x2f1a40['attributes']:_0x2b5ad9[_0x559d('0x16')];_0x2f1a40[_0x559d('0x36')]=qs[_0x559d('0x1d')](_0x58a7aa['query'][_0x559d('0x1d')]);_0x2f1a40['where']=qs[_0x559d('0x20')](_[_0x559d('0x1f')](_0x58a7aa['query'],_0x2b5ad9['filters']));if(_0x58a7aa[_0x559d('0x17')][_0x559d('0x21')]){_0x2f1a40[_0x559d('0x1e')]=_['merge'](_0x2f1a40['where'],{'$or':_[_0x559d('0x14')](_0x2f1a40[_0x559d('0x19')],function(_0x55290e){var _0x31dcf3={};_0x31dcf3[_0x55290e]={'$like':'%'+_0x58a7aa[_0x559d('0x17')][_0x559d('0x21')]+'%'};return _0x31dcf3;})});}_0x2f1a40=_[_0x559d('0x22')]({},_0x2f1a40,_0x58a7aa[_0x559d('0x25')]);return _0x586dcd['getConfigurations'](_0x2f1a40);}})[_0x559d('0x27')](function(_0x49f58a){if(_0x49f58a){_0x4db7d1=_0x49f58a['length'];if(!_0x58a7aa['query'][_0x559d('0x37')](_0x559d('0x1c'))){_0x2f1a40[_0x559d('0x8')]=qs[_0x559d('0x8')](_0x58a7aa[_0x559d('0x17')]['limit']);_0x2f1a40['offset']=qs[_0x559d('0x7')](_0x58a7aa[_0x559d('0x17')]['offset']);}return _0x586dcd[_0x559d('0x33')](_0x2f1a40);}})[_0x559d('0x27')](function(_0x5799e2){if(_0x5799e2){return _0x5799e2?{'count':_0x4db7d1,'rows':_0x5799e2}:null;}})[_0x559d('0x27')](respondWithResult(_0x5c9449,null))[_0x559d('0x2b')](handleError(_0x5c9449,null));};exports[_0x559d('0x38')]=function(_0x3e76d6,_0x80512f){if(_0x3e76d6['body']['id']){delete _0x3e76d6[_0x559d('0x31')]['id'];}return db[_0x559d('0x26')][_0x559d('0x34')]({'where':{'id':_0x3e76d6['params']['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x80512f,null))[_0x559d('0x27')](function(_0x4a449d){if(_0x4a449d){_0x3e76d6[_0x559d('0x31')][_0x559d('0x39')]=_0x4a449d['id'];_0x3e76d6['body'][_0x559d('0x3a')]=integrations[_0x559d('0x3b')](_0x3e76d6['body']['channel'],_0x3e76d6[_0x559d('0x31')]['type']);_0x3e76d6[_0x559d('0x31')][_0x559d('0x3c')]=integrations[_0x559d('0x3d')](_0x3e76d6['body']['channel'],_0x3e76d6[_0x559d('0x31')]['type']);return db[_0x559d('0x35')][_0x559d('0x30')](_0x3e76d6[_0x559d('0x31')],{'include':[{'model':db[_0x559d('0x3e')],'as':_0x559d('0x3a')},{'model':db[_0x559d('0x3e')],'as':_0x559d('0x3c')}]});}return null;})[_0x559d('0x27')](respondWithResult(_0x80512f,null))['catch'](handleError(_0x80512f,null));};function sanitizeRemoteUri(_0x363c3){var _0x39fe6a=_0x363c3[_0x559d('0x3f')](-0x1);if(_0x39fe6a==='/')return _0x363c3[_0x559d('0x40')](0x0,_0x363c3[_0x559d('0x41')](_0x39fe6a));return _0x363c3;}function getWebApiUrl(_0x157851){return util[_0x559d('0x42')](_0x559d('0x43'),_0x157851);}exports[_0x559d('0x44')]=function(_0x199dfc,_0x1e327f){var _0x24c6b9=_0x199dfc[_0x559d('0x17')]['ticketType'];var _0x206613=_0x24c6b9===_0x559d('0x45')?'Incident':_0x559d('0x46');var _0x75a0ad='';var _0x1c9348='';var _0x45a90f='';var _0x3dc18b='';var _0x1170e2='';var _0x3feffc='';var _0x10a78='';var _0xdfd64e='';var _0x17434b=[_0x559d('0x47'),_0x559d('0x48'),_0x559d('0x49'),'ownerid','caseorigincode',_0x559d('0x4a'),_0x559d('0x4b'),_0x559d('0x4c'),'directioncode',_0x559d('0x4d')];var _0x450ad8=[_0x559d('0x4e'),_0x559d('0x4f'),_0x559d('0x50'),'billedserviceunits',_0x559d('0x51'),_0x559d('0x52'),_0x559d('0x53'),_0x559d('0x54'),'createdbyexternalpartyname',_0x559d('0x55'),'createdbyname',_0x559d('0x56'),_0x559d('0x57'),_0x559d('0x58'),_0x559d('0x59'),_0x559d('0x5a'),_0x559d('0x5b'),_0x559d('0x5c'),'emailaddress',_0x559d('0x5d'),_0x559d('0x5e'),_0x559d('0x5f'),_0x559d('0x60'),'exchangerate','firstresponsebykpiidname',_0x559d('0x61'),_0x559d('0x62'),_0x559d('0x63'),_0x559d('0x64'),_0x559d('0x65'),'masteridname',_0x559d('0x66'),_0x559d('0x67'),_0x559d('0x68'),'modifiedbyyominame','modifiedon',_0x559d('0x69'),'modifiedonbehalfbyyominame',_0x559d('0x6a'),'msdyn_iotalertname',_0x559d('0x6b'),_0x559d('0x6c'),'overriddencreatedon','owneridname','owneridtype',_0x559d('0x6d'),_0x559d('0x6e'),_0x559d('0x6f'),'primarycontactidyominame',_0x559d('0x70'),_0x559d('0x71'),'productserialnumber',_0x559d('0x72'),_0x559d('0x73'),_0x559d('0x74'),_0x559d('0x75'),'responsiblecontactidyominame','sentimentvalue',_0x559d('0x76'),'slaname',_0x559d('0x77'),_0x559d('0x78'),_0x559d('0x79'),_0x559d('0x7a'),_0x559d('0x7b'),_0x559d('0x7c'),_0x559d('0x7d'),_0x559d('0x7e'),_0x559d('0x7f'),'versionnumber'];var _0x54106b=_0x17434b['concat'](_0x450ad8);return db[_0x559d('0x26')][_0x559d('0x34')]({'where':{'id':_0x199dfc[_0x559d('0x32')]['id']},'attributes':['id',_0x559d('0x80'),_0x559d('0x81'),_0x559d('0x82'),_0x559d('0x83'),_0x559d('0x84'),_0x559d('0x85'),_0x559d('0x86')],'include':[{'model':db['CloudProvider'],'as':_0x559d('0x87'),'attributes':['id','data5','data7']}]})[_0x559d('0x27')](handleEntityNotFound(_0x1e327f,null))[_0x559d('0x27')](function(_0x3145b1){if(_0x3145b1){if(_0x3145b1[_0x559d('0x86')]){_0x3145b1['access_token']=_0x3145b1[_0x559d('0x87')]['data5'];_0xdfd64e=sanitizeRemoteUri(_0x3145b1[_0x559d('0x87')][_0x559d('0x88')]);_0x10a78=getWebApiUrl(_0xdfd64e);return _0x3145b1;}_0xdfd64e=sanitizeRemoteUri(_0x3145b1[_0x559d('0x82')]);_0x10a78=getWebApiUrl(_0xdfd64e);var _0x2275bd={'method':_0x559d('0x89'),'uri':_0x559d('0x8a')+_0x3145b1['tenantId']+_0x559d('0x8b'),'form':{'client_id':_0x3145b1['clientId'],'resource':_0xdfd64e,'username':_0x3145b1['username'],'password':_0x3145b1[_0x559d('0x81')],'grant_type':_0x559d('0x81'),'client_secret':_0x3145b1[_0x559d('0x85')]},'json':!![]};return rp(_0x2275bd);}})[_0x559d('0x27')](function(_0x137657){_0x3feffc=_0x137657['access_token'];var _0x6f8b1c={'method':_0x559d('0x8c'),'uri':encodeURI(_0x10a78+_0x559d('0x8d')+_0x206613+'\x27'),'headers':{'Authorization':_0x559d('0x8e')+_0x3feffc,'If-None-Match':null,'OData-Version':_0x559d('0x8f')},'json':!![]};return rp(_0x6f8b1c);})[_0x559d('0x27')](function(_0x2a2dfc){var _0x1f21ea=_0x2a2dfc[_0x559d('0x90')][0x0];var _0x5e9a66=_0x1f21ea[_0x559d('0x91')];var _0x223261={'method':'GET','uri':_0x10a78+'EntityDefinitions('+_0x5e9a66+_0x559d('0x92'),'headers':{'Authorization':'Bearer\x20'+_0x3feffc,'If-None-Match':null,'OData-Version':_0x559d('0x8f')},'json':!![]};return rp(_0x223261);})[_0x559d('0x27')](function(_0x2107dc){_0x75a0ad=_0x2107dc;_0x1c9348=_0x75a0ad['Attributes'];_0x1c9348=_['remove'](_0x1c9348,function(_0x37b200){return!_0x54106b[_0x559d('0x93')](_0x37b200[_0x559d('0x94')]);});var _0x4022d6=[];var _0x3f4270=[];_0x1c9348[_0x559d('0x95')](function(_0x105461){if(_0x105461['@odata.type']){var _0x169ad4=_0x105461[_0x559d('0x96')][_0x559d('0x40')](_0x105461[_0x559d('0x96')][_0x559d('0x41')]('.')+0x1);if(_0x169ad4===_0x559d('0x97')){_0x4022d6[_0x559d('0x98')](getSelectList(_0x10a78,_0x24c6b9,_0x3f4270,_0x75a0ad['MetadataId'],_0x105461[_0x559d('0x91')],_0x3feffc));}}});return Promise[_0x559d('0x99')](_0x4022d6);})[_0x559d('0x27')](function(_0x5c1353){_0x45a90f=_0x5c1353[0x0];var _0x47e280=[];var _0x4ea974=[];_0x1c9348[_0x559d('0x95')](function(_0x3b4beb){if(!_[_0x559d('0x9a')](_0x3b4beb[_0x559d('0x96')])){var _0x3580f4=_0x3b4beb['@odata.type']['substring'](_0x3b4beb[_0x559d('0x96')][_0x559d('0x41')]('.')+0x1);if(_0x3580f4===_0x559d('0x9b')){_0x47e280[_0x559d('0x98')](getBooleanList(_0x10a78,_0x24c6b9,_0x4ea974,_0x75a0ad['MetadataId'],_0x3b4beb['MetadataId'],_0x3feffc));}}});return Promise[_0x559d('0x99')](_0x47e280);})[_0x559d('0x27')](function(_0x281a3c){_0x3dc18b=_0x281a3c[0x0];var _0x32796d=[];var _0x25f4b6=[];_0x1c9348[_0x559d('0x95')](function(_0x5a6eab){if(_0x5a6eab[_0x559d('0x96')]){var _0x407437=_0x5a6eab['@odata.type'][_0x559d('0x40')](_0x5a6eab[_0x559d('0x96')][_0x559d('0x41')]('.')+0x1);if(_0x407437===_0x559d('0x9c')||_0x407437===_0x559d('0x9d')||_0x407437===_0x559d('0x9e')||_0x407437===_0x559d('0x9f')||_0x407437===_0x559d('0xa0')||_0x407437==='DateTimeAttributeMetadata'||_0x407437===_0x559d('0xa1')||_0x407437===_0x559d('0xa2')||_0x407437==='StateAttributeMetadata'||_0x407437===_0x559d('0xa3')){_0x32796d['push'](getInputList(_0x10a78,_0x24c6b9,_0x407437,_0x25f4b6,_0x75a0ad[_0x559d('0x91')],_0x5a6eab['MetadataId'],_0x3feffc));}}});return Promise[_0x559d('0x99')](_0x32796d);})[_0x559d('0x27')](function(_0x29bfbb){_0x1170e2=_0x29bfbb[0x0];var _0x3a1788=_0x45a90f['concat'](_0x3dc18b)[_0x559d('0xa4')](_0x1170e2);var _0x2b42c5={'count':_0x3a1788[_0x559d('0x1b')],'rows':_0x3a1788};return _0x2b42c5;})[_0x559d('0x27')](respondWithResult(_0x1e327f,null))['catch'](function(_0x2e7dca){var _0x45c343=_0x199dfc[_0x559d('0x17')]['test']?0x1f4:_0x2e7dca[_0x559d('0xa5')]||0x1f4;logger[_0x559d('0xa6')](_0x2e7dca[_0x559d('0xa7')]);delete _0x2e7dca[_0x559d('0x11')];if(_0x45c343===0x191){_0x45c343=0x190;}_0x1e327f[_0x559d('0x5')](_0x45c343)[_0x559d('0x12')](_0x199dfc['query'][_0x559d('0xa8')]?{'message':_0x559d('0xa9'),'statusCode':_0x2e7dca[_0x559d('0xa5')]}:_0x2e7dca);});};function getSelectList(_0x1d59f7,_0x595386,_0x542ffe,_0x274d2b,_0x45d289,_0x3619cd){var _0x43d70f={'method':_0x559d('0x8c'),'uri':_0x1d59f7+'EntityDefinitions('+_0x274d2b+_0x559d('0xaa')+_0x45d289+_0x559d('0xab')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x559d('0x8e')+_0x3619cd,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x43d70f)['then'](function(_0x3d0c4e){var _0x5cd822=[];var _0x53f15d=_0x3d0c4e[_0x559d('0xac')][_0x559d('0xad')];_0x53f15d['forEach'](function(_0x1421df){_0x5cd822['push']({'name':_0x1421df[_0x559d('0xae')][_0x559d('0xaf')][_0x559d('0xae')],'value':String(_0x1421df[_0x559d('0xb0')])});});var _0xe52bdb={'id':_0x595386+'_'+_0x3d0c4e['LogicalName'],'name':_0x3d0c4e[_0x559d('0xb1')][_0x559d('0xaf')][_0x559d('0xae')],'custom':![],'options':_0x5cd822};_0x542ffe[_0x559d('0x98')](_0xe52bdb);return _0x542ffe;});}function getBooleanList(_0x51793e,_0xaa5401,_0x22ec5e,_0x38aa7a,_0x5e70b9,_0x174068){var _0x541b28={'method':_0x559d('0x8c'),'uri':_0x51793e+_0x559d('0xb2')+_0x38aa7a+_0x559d('0xaa')+_0x5e70b9+_0x559d('0xb3'),'headers':{'Authorization':_0x559d('0x8e')+_0x174068,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x541b28)[_0x559d('0x27')](function(_0x12b8cf){var _0x827a1=[];_0x827a1[_0x559d('0x98')]({'name':_0x12b8cf[_0x559d('0xac')]['TrueOption'][_0x559d('0xae')][_0x559d('0xaf')][_0x559d('0xae')],'value':_0x559d('0xb4')},{'name':_0x12b8cf[_0x559d('0xac')]['FalseOption']['Label'][_0x559d('0xaf')][_0x559d('0xae')],'value':_0x559d('0xb5')});var _0x6fedac={'id':_0xaa5401+'_'+_0x12b8cf[_0x559d('0x94')],'name':_0x12b8cf[_0x559d('0xb1')][_0x559d('0xaf')][_0x559d('0xae')],'custom':![],'options':_0x827a1};_0x22ec5e[_0x559d('0x98')](_0x6fedac);return _0x22ec5e;});}function getInputList(_0x46a40d,_0x4d96cd,_0x5de23a,_0x2794bc,_0x1173ac,_0x2c8731,_0x27afb8){var _0x1bead4={'method':'GET','uri':_0x46a40d+_0x559d('0xb2')+_0x1173ac+_0x559d('0xaa')+_0x2c8731+_0x559d('0xb6')+_0x5de23a+_0x559d('0xb7'),'headers':{'Authorization':'Bearer\x20'+_0x27afb8,'If-None-Match':null,'OData-Version':_0x559d('0x8f')},'json':!![]};return rp(_0x1bead4)['then'](function(_0x3ea161){var _0x422f73={'id':_0x4d96cd+'_'+_0x3ea161[_0x559d('0x94')],'name':_0x3ea161['DisplayName']['UserLocalizedLabel']?_0x3ea161[_0x559d('0xb1')][_0x559d('0xaf')][_0x559d('0xae')]:_0x3ea161[_0x559d('0x94')],'custom':![],'options':[]};_0x2794bc[_0x559d('0x98')](_0x422f73);return _0x2794bc;});} \ No newline at end of file +var _0x04d3=['OptionSet','Options','Value','LogicalName','DisplayName','Label',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','UserLocalizedLabel','false',')/Microsoft.Dynamics.CRM.','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','set','update','then','destroy','sendStatus','error','stack','name','map','Dynamics365Account','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','merge','find','create','body','getConfigurations','findOne','Dynamics365Configuration','filter','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','tenantId','CloudProvider','data5','data7','modernAuthentication','access_token','remoteUri','https://login.microsoftonline.com/','/oauth2/token','password','clientSecret','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(','4.0','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','isNil','BooleanAttributeMetadata','lastIndexOf','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','all','test','Wrong\x20credentials','statusCode','GET','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)'];(function(_0x4b96e5,_0x28eddf){var _0x5aabe5=function(_0x5d32fd){while(--_0x5d32fd){_0x4b96e5['push'](_0x4b96e5['shift']());}};_0x5aabe5(++_0x28eddf);}(_0x04d3,0x19a));var _0x304d=function(_0x869091,_0x3b4cd7){_0x869091=_0x869091-0x0;var _0x5992c5=_0x04d3[_0x869091];return _0x5992c5;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x304d('0x0'));var qs=require(_0x304d('0x1'));var logger=require(_0x304d('0x2'))(_0x304d('0x3'));var db=require(_0x304d('0x4'))['db'];var integrations=require(_0x304d('0x5'));function respondWithResult(_0x9ab8c0,_0x5b5fc2){_0x5b5fc2=_0x5b5fc2||0xc8;return function(_0x3bdb4b){if(_0x3bdb4b){return _0x9ab8c0[_0x304d('0x6')](_0x5b5fc2)[_0x304d('0x7')](_0x3bdb4b);}};}function respondWithFilteredResult(_0x13d29b,_0x2bb31e){return function(_0x1bd6a4){if(_0x1bd6a4){var _0x1a284f=typeof _0x2bb31e['offset']===_0x304d('0x8')&&typeof _0x2bb31e[_0x304d('0x9')]===_0x304d('0x8');var _0x32b6b5=_0x1bd6a4[_0x304d('0xa')];var _0x3644cd=_0x1a284f?0x0:_0x2bb31e['offset'];var _0x21bddb=_0x1a284f?_0x1bd6a4[_0x304d('0xa')]:_0x2bb31e['offset']+_0x2bb31e[_0x304d('0x9')];var _0x5399bf;if(_0x21bddb>=_0x32b6b5){_0x21bddb=_0x32b6b5;_0x5399bf=0xc8;}else{_0x5399bf=0xce;}_0x13d29b[_0x304d('0x6')](_0x5399bf);return _0x13d29b[_0x304d('0xb')]('Content-Range',_0x3644cd+'-'+_0x21bddb+'/'+_0x32b6b5)['json'](_0x1bd6a4);}return null;};}function saveUpdates(_0x3db9ce){return function(_0x199cb5){if(_0x199cb5){return _0x199cb5[_0x304d('0xc')](_0x3db9ce)[_0x304d('0xd')](function(_0x449e8c){return _0x449e8c;});}return null;};}function removeEntity(_0x5a3eb1){return function(_0x5cf212){if(_0x5cf212){return _0x5cf212[_0x304d('0xe')]()[_0x304d('0xd')](function(){_0x5a3eb1[_0x304d('0x6')](0xcc)['end']();});}};}function handleEntityNotFound(_0x192b67){return function(_0x1dc4f2){if(!_0x1dc4f2){_0x192b67[_0x304d('0xf')](0x194);}return _0x1dc4f2;};}function handleError(_0x23184e,_0x3fdc86){_0x3fdc86=_0x3fdc86||0x1f4;return function(_0x54ec22){logger[_0x304d('0x10')](_0x54ec22[_0x304d('0x11')]);if(_0x54ec22[_0x304d('0x12')]){delete _0x54ec22['name'];}_0x23184e[_0x304d('0x6')](_0x3fdc86)['send'](_0x54ec22);};}exports['index']=function(_0x4f4973,_0x29cbd5){var _0x5c9209={},_0x14aad0={},_0x1af120={'count':0x0,'rows':[]};var _0x1d7f0b=_[_0x304d('0x13')](db[_0x304d('0x14')]['rawAttributes'],function(_0x3e0a80){return{'name':_0x3e0a80[_0x304d('0x15')],'type':_0x3e0a80[_0x304d('0x16')][_0x304d('0x17')]};});_0x14aad0[_0x304d('0x18')]=_[_0x304d('0x13')](_0x1d7f0b,'name');_0x14aad0[_0x304d('0x19')]=_[_0x304d('0x1a')](_0x4f4973[_0x304d('0x19')]);_0x14aad0[_0x304d('0x1b')]=_[_0x304d('0x1c')](_0x14aad0[_0x304d('0x18')],_0x14aad0[_0x304d('0x19')]);_0x5c9209[_0x304d('0x1d')]=_[_0x304d('0x1c')](_0x14aad0[_0x304d('0x18')],qs[_0x304d('0x1e')](_0x4f4973[_0x304d('0x19')][_0x304d('0x1e')]));_0x5c9209['attributes']=_0x5c9209[_0x304d('0x1d')]['length']?_0x5c9209[_0x304d('0x1d')]:_0x14aad0[_0x304d('0x18')];if(!_0x4f4973[_0x304d('0x19')][_0x304d('0x1f')](_0x304d('0x20'))){_0x5c9209[_0x304d('0x9')]=qs['limit'](_0x4f4973['query'][_0x304d('0x9')]);_0x5c9209['offset']=qs['offset'](_0x4f4973[_0x304d('0x19')][_0x304d('0x21')]);}_0x5c9209[_0x304d('0x22')]=qs[_0x304d('0x23')](_0x4f4973[_0x304d('0x19')][_0x304d('0x23')]);_0x5c9209[_0x304d('0x24')]=qs[_0x304d('0x1b')](_[_0x304d('0x25')](_0x4f4973[_0x304d('0x19')],_0x14aad0[_0x304d('0x1b')]),_0x1d7f0b);if(_0x4f4973[_0x304d('0x19')]['filter']){_0x5c9209['where']=_['merge'](_0x5c9209[_0x304d('0x24')],{'$or':_[_0x304d('0x13')](_0x1d7f0b,function(_0x2eee55){if(_0x2eee55['type']!=='VIRTUAL'){var _0x193cac={};_0x193cac[_0x2eee55['name']]={'$like':'%'+_0x4f4973[_0x304d('0x19')]['filter']+'%'};return _0x193cac;}})});}_0x5c9209=_['merge']({},_0x5c9209,_0x4f4973[_0x304d('0x26')]);var _0x12ad2a={'where':_0x5c9209[_0x304d('0x24')]};return db[_0x304d('0x14')][_0x304d('0xa')](_0x12ad2a)[_0x304d('0xd')](function(_0x5bcd10){_0x1af120['count']=_0x5bcd10;if(_0x4f4973[_0x304d('0x19')][_0x304d('0x27')]){_0x5c9209['include']=[{'all':!![]}];}return db[_0x304d('0x14')][_0x304d('0x28')](_0x5c9209);})['then'](function(_0x5978b3){_0x1af120[_0x304d('0x29')]=_0x5978b3;return _0x1af120;})[_0x304d('0xd')](respondWithFilteredResult(_0x29cbd5,_0x5c9209))[_0x304d('0x2a')](handleError(_0x29cbd5,null));};exports[_0x304d('0x2b')]=function(_0x109721,_0x45f621){var _0x5addd0={'raw':![],'where':{'id':_0x109721[_0x304d('0x2c')]['id']}},_0x286696={};_0x286696['model']=_[_0x304d('0x1a')](db[_0x304d('0x14')][_0x304d('0x2d')]);_0x286696['query']=_['keys'](_0x109721[_0x304d('0x19')]);_0x286696[_0x304d('0x1b')]=_['intersection'](_0x286696['model'],_0x286696[_0x304d('0x19')]);_0x5addd0[_0x304d('0x1d')]=_[_0x304d('0x1c')](_0x286696[_0x304d('0x18')],qs[_0x304d('0x1e')](_0x109721['query']['fields']));_0x5addd0['attributes']=_0x5addd0[_0x304d('0x1d')][_0x304d('0x2e')]?_0x5addd0['attributes']:_0x286696['model'];if(_0x109721[_0x304d('0x19')]['includeAll']){_0x5addd0['include']=[{'all':!![]}];}_0x5addd0=_[_0x304d('0x2f')]({},_0x5addd0,_0x109721[_0x304d('0x26')]);return db[_0x304d('0x14')][_0x304d('0x30')](_0x5addd0)[_0x304d('0xd')](handleEntityNotFound(_0x45f621,null))['then'](respondWithResult(_0x45f621,null))[_0x304d('0x2a')](handleError(_0x45f621,null));};exports['create']=function(_0x50ee83,_0x35c9ea){return db[_0x304d('0x14')][_0x304d('0x31')](_0x50ee83[_0x304d('0x32')],{})['then'](respondWithResult(_0x35c9ea,0xc9))['catch'](handleError(_0x35c9ea,null));};exports['update']=function(_0x42b27f,_0xf82389){if(_0x42b27f['body']['id']){delete _0x42b27f[_0x304d('0x32')]['id'];}return db[_0x304d('0x14')][_0x304d('0x30')]({'where':{'id':_0x42b27f[_0x304d('0x2c')]['id']}})['then'](handleEntityNotFound(_0xf82389,null))[_0x304d('0xd')](saveUpdates(_0x42b27f['body'],null))['then'](respondWithResult(_0xf82389,null))[_0x304d('0x2a')](handleError(_0xf82389,null));};exports[_0x304d('0xe')]=function(_0x3d9400,_0x5bd3f0){return db[_0x304d('0x14')][_0x304d('0x30')]({'where':{'id':_0x3d9400['params']['id']}})['then'](handleEntityNotFound(_0x5bd3f0,null))[_0x304d('0xd')](removeEntity(_0x5bd3f0,null))[_0x304d('0x2a')](handleError(_0x5bd3f0,null));};exports[_0x304d('0x33')]=function(_0x41eb56,_0x508163){var _0x3ee980={};var _0x145b7c={};var _0x488b7f;var _0x124aba;return db[_0x304d('0x14')][_0x304d('0x34')]({'where':{'id':_0x41eb56[_0x304d('0x2c')]['id']}})[_0x304d('0xd')](handleEntityNotFound(_0x508163,null))[_0x304d('0xd')](function(_0x1c406b){if(_0x1c406b){_0x488b7f=_0x1c406b;_0x145b7c[_0x304d('0x18')]=_[_0x304d('0x1a')](db[_0x304d('0x35')]['rawAttributes']);_0x145b7c[_0x304d('0x19')]=_[_0x304d('0x1a')](_0x41eb56['query']);_0x145b7c[_0x304d('0x1b')]=_[_0x304d('0x1c')](_0x145b7c[_0x304d('0x18')],_0x145b7c[_0x304d('0x19')]);_0x3ee980[_0x304d('0x1d')]=_[_0x304d('0x1c')](_0x145b7c['model'],qs[_0x304d('0x1e')](_0x41eb56['query'][_0x304d('0x1e')]));_0x3ee980[_0x304d('0x1d')]=_0x3ee980['attributes']['length']?_0x3ee980[_0x304d('0x1d')]:_0x145b7c[_0x304d('0x18')];_0x3ee980[_0x304d('0x22')]=qs[_0x304d('0x23')](_0x41eb56[_0x304d('0x19')][_0x304d('0x23')]);_0x3ee980['where']=qs[_0x304d('0x1b')](_['pick'](_0x41eb56['query'],_0x145b7c[_0x304d('0x1b')]));if(_0x41eb56[_0x304d('0x19')][_0x304d('0x36')]){_0x3ee980['where']=_['merge'](_0x3ee980[_0x304d('0x24')],{'$or':_[_0x304d('0x13')](_0x3ee980[_0x304d('0x1d')],function(_0x9bb5a5){var _0x287443={};_0x287443[_0x9bb5a5]={'$like':'%'+_0x41eb56[_0x304d('0x19')][_0x304d('0x36')]+'%'};return _0x287443;})});}_0x3ee980=_[_0x304d('0x2f')]({},_0x3ee980,_0x41eb56[_0x304d('0x26')]);return _0x488b7f[_0x304d('0x33')](_0x3ee980);}})[_0x304d('0xd')](function(_0x454ece){if(_0x454ece){_0x124aba=_0x454ece[_0x304d('0x2e')];if(!_0x41eb56[_0x304d('0x19')][_0x304d('0x1f')](_0x304d('0x20'))){_0x3ee980[_0x304d('0x9')]=qs[_0x304d('0x9')](_0x41eb56[_0x304d('0x19')][_0x304d('0x9')]);_0x3ee980[_0x304d('0x21')]=qs[_0x304d('0x21')](_0x41eb56[_0x304d('0x19')][_0x304d('0x21')]);}return _0x488b7f[_0x304d('0x33')](_0x3ee980);}})['then'](function(_0x307c8d){if(_0x307c8d){return _0x307c8d?{'count':_0x124aba,'rows':_0x307c8d}:null;}})['then'](respondWithResult(_0x508163,null))[_0x304d('0x2a')](handleError(_0x508163,null));};exports[_0x304d('0x37')]=function(_0x1ae08f,_0x274c7c){if(_0x1ae08f[_0x304d('0x32')]['id']){delete _0x1ae08f[_0x304d('0x32')]['id'];}return db['Dynamics365Account'][_0x304d('0x34')]({'where':{'id':_0x1ae08f['params']['id']}})[_0x304d('0xd')](handleEntityNotFound(_0x274c7c,null))[_0x304d('0xd')](function(_0x4f7b92){if(_0x4f7b92){_0x1ae08f[_0x304d('0x32')][_0x304d('0x38')]=_0x4f7b92['id'];_0x1ae08f[_0x304d('0x32')][_0x304d('0x39')]=integrations[_0x304d('0x3a')](_0x1ae08f[_0x304d('0x32')][_0x304d('0x3b')],_0x1ae08f[_0x304d('0x32')][_0x304d('0x16')]);_0x1ae08f[_0x304d('0x32')]['Descriptions']=integrations[_0x304d('0x3c')](_0x1ae08f[_0x304d('0x32')][_0x304d('0x3b')],_0x1ae08f['body']['type']);return db['Dynamics365Configuration'][_0x304d('0x31')](_0x1ae08f['body'],{'include':[{'model':db[_0x304d('0x3d')],'as':_0x304d('0x39')},{'model':db[_0x304d('0x3d')],'as':_0x304d('0x3e')}]});}return null;})['then'](respondWithResult(_0x274c7c,null))[_0x304d('0x2a')](handleError(_0x274c7c,null));};function sanitizeRemoteUri(_0x344441){var _0x4f8f15=_0x344441[_0x304d('0x3f')](-0x1);if(_0x4f8f15==='/')return _0x344441[_0x304d('0x40')](0x0,_0x344441['lastIndexOf'](_0x4f8f15));return _0x344441;}function getWebApiUrl(_0x3b62da){return util['format'](_0x304d('0x41'),_0x3b62da);}exports[_0x304d('0x42')]=function(_0x54ee53,_0x13abcc){var _0x4b3866=_0x54ee53[_0x304d('0x19')][_0x304d('0x43')];var _0x577a02=_0x4b3866===_0x304d('0x44')?_0x304d('0x45'):_0x304d('0x46');var _0x1b8c4e='';var _0x4211ba='';var _0x4ee5cf='';var _0x31f439='';var _0x64eff6='';var _0x22bd3d='';var _0x13f5f1='';var _0x39a423='';var _0x3bfb64=[_0x304d('0x47'),_0x304d('0x48'),_0x304d('0x49'),_0x304d('0x4a'),_0x304d('0x4b'),_0x304d('0x4c'),_0x304d('0x4d'),_0x304d('0x4e'),_0x304d('0x4f'),'phonecall_activity_parties'];var _0x2f05aa=[_0x304d('0x50'),_0x304d('0x51'),_0x304d('0x52'),_0x304d('0x53'),_0x304d('0x54'),_0x304d('0x55'),_0x304d('0x56'),_0x304d('0x57'),_0x304d('0x58'),_0x304d('0x59'),_0x304d('0x5a'),_0x304d('0x5b'),_0x304d('0x5c'),_0x304d('0x5d'),'createdonbehalfbyyominame',_0x304d('0x5e'),_0x304d('0x5f'),_0x304d('0x60'),_0x304d('0x61'),_0x304d('0x62'),_0x304d('0x63'),_0x304d('0x64'),'escalatedon',_0x304d('0x65'),_0x304d('0x66'),_0x304d('0x67'),_0x304d('0x68'),_0x304d('0x69'),'kbarticleidname',_0x304d('0x6a'),_0x304d('0x6b'),_0x304d('0x6c'),_0x304d('0x6d'),_0x304d('0x6e'),_0x304d('0x6f'),_0x304d('0x70'),_0x304d('0x71'),'modifiedonbehalfbyyominame',_0x304d('0x72'),_0x304d('0x73'),_0x304d('0x74'),_0x304d('0x75'),_0x304d('0x76'),_0x304d('0x77'),_0x304d('0x78'),_0x304d('0x79'),'parentcaseidname',_0x304d('0x7a'),_0x304d('0x7b'),_0x304d('0x7c'),_0x304d('0x7d'),_0x304d('0x7e'),'resolveby',_0x304d('0x7f'),_0x304d('0x80'),_0x304d('0x81'),'responsiblecontactidyominame',_0x304d('0x82'),_0x304d('0x83'),_0x304d('0x84'),_0x304d('0x85'),_0x304d('0x86'),_0x304d('0x87'),_0x304d('0x88'),'ticketnumber',_0x304d('0x89'),_0x304d('0x8a'),_0x304d('0x8b'),_0x304d('0x8c'),_0x304d('0x8d')];var _0x32b11b=_0x3bfb64[_0x304d('0x8e')](_0x2f05aa);return db[_0x304d('0x14')]['findOne']({'where':{'id':_0x54ee53[_0x304d('0x2c')]['id']},'attributes':['id',_0x304d('0x8f'),'password','remoteUri',_0x304d('0x90'),'clientId','clientSecret','modernAuthentication'],'include':[{'model':db[_0x304d('0x91')],'as':_0x304d('0x91'),'attributes':['id',_0x304d('0x92'),_0x304d('0x93')]}]})['then'](handleEntityNotFound(_0x13abcc,null))['then'](function(_0x5001a4){if(_0x5001a4){if(_0x5001a4[_0x304d('0x94')]){_0x5001a4[_0x304d('0x95')]=_0x5001a4[_0x304d('0x91')][_0x304d('0x92')];_0x39a423=sanitizeRemoteUri(_0x5001a4[_0x304d('0x91')]['data7']);_0x13f5f1=getWebApiUrl(_0x39a423);return _0x5001a4;}_0x39a423=sanitizeRemoteUri(_0x5001a4[_0x304d('0x96')]);_0x13f5f1=getWebApiUrl(_0x39a423);var _0x1c4c57={'method':'POST','uri':_0x304d('0x97')+_0x5001a4[_0x304d('0x90')]+_0x304d('0x98'),'form':{'client_id':_0x5001a4['clientId'],'resource':_0x39a423,'username':_0x5001a4[_0x304d('0x8f')],'password':_0x5001a4[_0x304d('0x99')],'grant_type':'password','client_secret':_0x5001a4[_0x304d('0x9a')]},'json':!![]};return rp(_0x1c4c57);}})['then'](function(_0x181c6a){_0x22bd3d=_0x181c6a[_0x304d('0x95')];var _0x3225f1={'method':'GET','uri':encodeURI(_0x13f5f1+_0x304d('0x9b')+_0x577a02+'\x27'),'headers':{'Authorization':_0x304d('0x9c')+_0x22bd3d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3225f1);})[_0x304d('0xd')](function(_0x428df2){var _0x51cf2e=_0x428df2[_0x304d('0x9d')][0x0];var _0x96a439=_0x51cf2e[_0x304d('0x9e')];var _0x33ba2c={'method':'GET','uri':_0x13f5f1+_0x304d('0x9f')+_0x96a439+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x304d('0x9c')+_0x22bd3d,'If-None-Match':null,'OData-Version':_0x304d('0xa0')},'json':!![]};return rp(_0x33ba2c);})['then'](function(_0x536889){_0x1b8c4e=_0x536889;_0x4211ba=_0x1b8c4e[_0x304d('0xa1')];_0x4211ba=_[_0x304d('0xa2')](_0x4211ba,function(_0x53368a){return!_0x32b11b[_0x304d('0xa3')](_0x53368a['LogicalName']);});var _0x4858c8=[];var _0x1a723b=[];_0x4211ba[_0x304d('0xa4')](function(_0x5f45ea){if(_0x5f45ea[_0x304d('0xa5')]){var _0x2a3c96=_0x5f45ea[_0x304d('0xa5')][_0x304d('0x40')](_0x5f45ea[_0x304d('0xa5')]['lastIndexOf']('.')+0x1);if(_0x2a3c96===_0x304d('0xa6')){_0x4858c8[_0x304d('0xa7')](getSelectList(_0x13f5f1,_0x4b3866,_0x1a723b,_0x1b8c4e['MetadataId'],_0x5f45ea[_0x304d('0x9e')],_0x22bd3d));}}});return Promise['all'](_0x4858c8);})['then'](function(_0x7c3efb){_0x4ee5cf=_0x7c3efb[0x0];var _0x49a576=[];var _0x3511ac=[];_0x4211ba['forEach'](function(_0x4c1e5a){if(!_[_0x304d('0xa8')](_0x4c1e5a['@odata.type'])){var _0x204c04=_0x4c1e5a[_0x304d('0xa5')][_0x304d('0x40')](_0x4c1e5a[_0x304d('0xa5')]['lastIndexOf']('.')+0x1);if(_0x204c04===_0x304d('0xa9')){_0x49a576['push'](getBooleanList(_0x13f5f1,_0x4b3866,_0x3511ac,_0x1b8c4e[_0x304d('0x9e')],_0x4c1e5a['MetadataId'],_0x22bd3d));}}});return Promise['all'](_0x49a576);})['then'](function(_0x5dda28){_0x31f439=_0x5dda28[0x0];var _0xe579f7=[];var _0x54a08b=[];_0x4211ba[_0x304d('0xa4')](function(_0x16dd00){if(_0x16dd00[_0x304d('0xa5')]){var _0x3661ad=_0x16dd00[_0x304d('0xa5')][_0x304d('0x40')](_0x16dd00[_0x304d('0xa5')][_0x304d('0xaa')]('.')+0x1);if(_0x3661ad===_0x304d('0xab')||_0x3661ad===_0x304d('0xac')||_0x3661ad===_0x304d('0xad')||_0x3661ad===_0x304d('0xae')||_0x3661ad===_0x304d('0xaf')||_0x3661ad===_0x304d('0xb0')||_0x3661ad===_0x304d('0xb1')||_0x3661ad===_0x304d('0xb2')||_0x3661ad===_0x304d('0xb3')||_0x3661ad===_0x304d('0xb4')){_0xe579f7[_0x304d('0xa7')](getInputList(_0x13f5f1,_0x4b3866,_0x3661ad,_0x54a08b,_0x1b8c4e['MetadataId'],_0x16dd00[_0x304d('0x9e')],_0x22bd3d));}}});return Promise[_0x304d('0xb5')](_0xe579f7);})[_0x304d('0xd')](function(_0x103388){_0x64eff6=_0x103388[0x0];var _0x3ec539=_0x4ee5cf[_0x304d('0x8e')](_0x31f439)[_0x304d('0x8e')](_0x64eff6);var _0x153b1e={'count':_0x3ec539[_0x304d('0x2e')],'rows':_0x3ec539};return _0x153b1e;})[_0x304d('0xd')](respondWithResult(_0x13abcc,null))['catch'](function(_0x856d33){var _0x287f25=_0x54ee53['query'][_0x304d('0xb6')]?0x1f4:_0x856d33['statusCode']||0x1f4;logger[_0x304d('0x10')](_0x856d33[_0x304d('0x11')]);delete _0x856d33[_0x304d('0x12')];if(_0x287f25===0x191){_0x287f25=0x190;}_0x13abcc['status'](_0x287f25)['send'](_0x54ee53[_0x304d('0x19')]['test']?{'message':_0x304d('0xb7'),'statusCode':_0x856d33[_0x304d('0xb8')]}:_0x856d33);});};function getSelectList(_0x1b6503,_0x19c838,_0x511fe5,_0x4c2454,_0x57b43c,_0x3f5d5c){var _0x31f96b={'method':_0x304d('0xb9'),'uri':_0x1b6503+_0x304d('0x9f')+_0x4c2454+')/Attributes('+_0x57b43c+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x304d('0xba'),'headers':{'Authorization':_0x304d('0x9c')+_0x3f5d5c,'If-None-Match':null,'OData-Version':_0x304d('0xa0')},'json':!![]};return rp(_0x31f96b)[_0x304d('0xd')](function(_0x1e24a5){var _0x93fcb5=[];var _0x5899aa=_0x1e24a5[_0x304d('0xbb')][_0x304d('0xbc')];_0x5899aa[_0x304d('0xa4')](function(_0x413315){_0x93fcb5['push']({'name':_0x413315['Label']['UserLocalizedLabel']['Label'],'value':String(_0x413315[_0x304d('0xbd')])});});var _0x3463b6={'id':_0x19c838+'_'+_0x1e24a5[_0x304d('0xbe')],'name':_0x1e24a5[_0x304d('0xbf')]['UserLocalizedLabel'][_0x304d('0xc0')],'custom':![],'options':_0x93fcb5};_0x511fe5[_0x304d('0xa7')](_0x3463b6);return _0x511fe5;});}function getBooleanList(_0x1c970e,_0x11c62a,_0x1fbcca,_0x1d521a,_0xc159d,_0x5c7992){var _0x5bdda5={'method':_0x304d('0xb9'),'uri':_0x1c970e+'EntityDefinitions('+_0x1d521a+_0x304d('0xc1')+_0xc159d+_0x304d('0xc2'),'headers':{'Authorization':'Bearer\x20'+_0x5c7992,'If-None-Match':null,'OData-Version':_0x304d('0xa0')},'json':!![]};return rp(_0x5bdda5)[_0x304d('0xd')](function(_0x1e886d){var _0x5d20b0=[];_0x5d20b0[_0x304d('0xa7')]({'name':_0x1e886d[_0x304d('0xbb')][_0x304d('0xc3')][_0x304d('0xc0')][_0x304d('0xc4')][_0x304d('0xc0')],'value':'true'},{'name':_0x1e886d[_0x304d('0xbb')]['FalseOption'][_0x304d('0xc0')][_0x304d('0xc4')]['Label'],'value':_0x304d('0xc5')});var _0x33cfc3={'id':_0x11c62a+'_'+_0x1e886d[_0x304d('0xbe')],'name':_0x1e886d[_0x304d('0xbf')][_0x304d('0xc4')][_0x304d('0xc0')],'custom':![],'options':_0x5d20b0};_0x1fbcca[_0x304d('0xa7')](_0x33cfc3);return _0x1fbcca;});}function getInputList(_0x226dd0,_0x4ed6d6,_0x265b96,_0x4f3829,_0x62aa4a,_0x4b9373,_0x404ed5){var _0x4bcabd={'method':'GET','uri':_0x226dd0+_0x304d('0x9f')+_0x62aa4a+_0x304d('0xc1')+_0x4b9373+_0x304d('0xc6')+_0x265b96+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x304d('0x9c')+_0x404ed5,'If-None-Match':null,'OData-Version':_0x304d('0xa0')},'json':!![]};return rp(_0x4bcabd)[_0x304d('0xd')](function(_0x4e1f29){var _0x405e90={'id':_0x4ed6d6+'_'+_0x4e1f29[_0x304d('0xbe')],'name':_0x4e1f29[_0x304d('0xbf')][_0x304d('0xc4')]?_0x4e1f29[_0x304d('0xbf')][_0x304d('0xc4')][_0x304d('0xc0')]:_0x4e1f29['LogicalName'],'custom':![],'options':[]};_0x4f3829[_0x304d('0xa7')](_0x405e90);return _0x4f3829;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 647c349..cf68a9c 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_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'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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(_0x52db03,_0x5445e8){var _0x112083=function(_0x237de4){while(--_0x237de4){_0x52db03['push'](_0x52db03['shift']());}};_0x112083(++_0x5445e8);}(_0xe706,0xa3));var _0x6e70=function(_0x2e0d05,_0x268558){_0x2e0d05=_0x2e0d05-0x0;var _0x5480f8=_0xe706[_0x2e0d05];return _0x5480f8;};'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 diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index b45f505..1e54dc7 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 _0xb135=['find','map','ShowDynamics365Account','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','include','model'];(function(_0x380058,_0x48f651){var _0x5860a=function(_0x4a0ffb){while(--_0x4a0ffb){_0x380058['push'](_0x380058['shift']());}};_0x5860a(++_0x48f651);}(_0xb135,0x1b0));var _0x5b13=function(_0x172b2c,_0x7a963a){_0x172b2c=_0x172b2c-0x0;var _0x5631c2=_0xb135[_0x172b2c];return _0x5631c2;};'use strict';var _=require(_0x5b13('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5b13('0x1'));var rs=require(_0x5b13('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b13('0x3'))['db'];var utils=require(_0x5b13('0x4'));var logger=require(_0x5b13('0x5'))(_0x5b13('0x6'));var config=require('../../config/environment');var jayson=require(_0x5b13('0x7'));var client=jayson['client'][_0x5b13('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x340727,_0x7e9569,_0x1391c1){return new BPromise(function(_0x96181a,_0x574655){return client[_0x5b13('0x9')](_0x340727,_0x1391c1)[_0x5b13('0xa')](function(_0x368843){logger[_0x5b13('0xb')](_0x5b13('0xc'),_0x7e9569,_0x5b13('0xd'));logger[_0x5b13('0xe')](_0x5b13('0xf'),_0x7e9569,'request\x20sent',JSON[_0x5b13('0x10')](_0x368843));if(_0x368843[_0x5b13('0x11')]){if(_0x368843[_0x5b13('0x11')][_0x5b13('0x12')]===0x1f4){logger['error'](_0x5b13('0xc'),_0x7e9569,_0x368843[_0x5b13('0x11')]['message']);return _0x574655(_0x368843[_0x5b13('0x11')][_0x5b13('0x13')]);}logger[_0x5b13('0x11')](_0x5b13('0xc'),_0x7e9569,_0x368843[_0x5b13('0x11')][_0x5b13('0x13')]);return _0x96181a(_0x368843['error'][_0x5b13('0x13')]);}else{logger[_0x5b13('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x7e9569,_0x5b13('0xd'));_0x96181a(_0x368843[_0x5b13('0x14')]['message']);}})[_0x5b13('0x15')](function(_0x3bec61){logger[_0x5b13('0x11')](_0x5b13('0xc'),_0x7e9569,_0x3bec61);_0x574655(_0x3bec61);});});}exports[_0x5b13('0x16')]=function(_0x45e7ad){var _0x5bbfdc=this;return new Promise(function(_0x462d10,_0x3271b7){return db[_0x5b13('0x17')][_0x5b13('0x18')]({'raw':_0x45e7ad['options']?_0x45e7ad[_0x5b13('0x19')][_0x5b13('0x1a')]===undefined?!![]:![]:!![],'where':_0x45e7ad[_0x5b13('0x19')]?_0x45e7ad[_0x5b13('0x19')]['where']||null:null,'attributes':_0x45e7ad[_0x5b13('0x19')]?_0x45e7ad['options'][_0x5b13('0x1b')]||null:null,'limit':_0x45e7ad['options']?_0x45e7ad[_0x5b13('0x19')]['limit']||null:null,'include':_0x45e7ad[_0x5b13('0x19')]?_0x45e7ad[_0x5b13('0x19')]['include']?_['map'](_0x45e7ad[_0x5b13('0x19')][_0x5b13('0x1c')],function(_0x2087a5){return{'model':db[_0x2087a5[_0x5b13('0x1d')]],'as':_0x2087a5['as'],'attributes':_0x2087a5[_0x5b13('0x1b')],'include':_0x2087a5[_0x5b13('0x1c')]?_['map'](_0x2087a5[_0x5b13('0x1c')],function(_0x38f620){return{'model':db[_0x38f620[_0x5b13('0x1d')]],'as':_0x38f620['as'],'attributes':_0x38f620[_0x5b13('0x1b')],'include':_0x38f620[_0x5b13('0x1c')]?_['map'](_0x38f620[_0x5b13('0x1c')],function(_0x17f181){return{'model':db[_0x17f181[_0x5b13('0x1d')]],'as':_0x17f181['as'],'attributes':_0x17f181[_0x5b13('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5b13('0xa')](function(_0x64ae8a){logger['info']('GetDynamics365Account',_0x45e7ad);logger['debug'](_0x5b13('0x16'),_0x45e7ad,JSON[_0x5b13('0x10')](_0x64ae8a));_0x462d10(_0x64ae8a);})[_0x5b13('0x15')](function(_0x4c7816){logger[_0x5b13('0x11')](_0x5b13('0x16'),_0x4c7816[_0x5b13('0x13')],_0x45e7ad);_0x3271b7(_0x5bbfdc[_0x5b13('0x11')](0x1f4,_0x4c7816['message']));});});};exports['ShowDynamics365Account']=function(_0x56a77f){var _0x5e316d=this;return new Promise(function(_0x2f3e90,_0x2867a8){return db[_0x5b13('0x17')][_0x5b13('0x1e')]({'raw':_0x56a77f[_0x5b13('0x19')]?_0x56a77f[_0x5b13('0x19')][_0x5b13('0x1a')]===undefined?!![]:![]:!![],'where':_0x56a77f[_0x5b13('0x19')]?_0x56a77f[_0x5b13('0x19')]['where']||null:null,'attributes':_0x56a77f['options']?_0x56a77f[_0x5b13('0x19')]['attributes']||null:null,'include':_0x56a77f[_0x5b13('0x19')]?_0x56a77f['options']['include']?_[_0x5b13('0x1f')](_0x56a77f[_0x5b13('0x19')]['include'],function(_0x19d9df){return{'model':db[_0x19d9df[_0x5b13('0x1d')]],'as':_0x19d9df['as'],'attributes':_0x19d9df['attributes'],'include':_0x19d9df['include']?_['map'](_0x19d9df[_0x5b13('0x1c')],function(_0x5f1dc2){return{'model':db[_0x5f1dc2['model']],'as':_0x5f1dc2['as'],'attributes':_0x5f1dc2['attributes'],'include':_0x5f1dc2[_0x5b13('0x1c')]?_[_0x5b13('0x1f')](_0x5f1dc2[_0x5b13('0x1c')],function(_0x38b3ff){return{'model':db[_0x38b3ff[_0x5b13('0x1d')]],'as':_0x38b3ff['as'],'attributes':_0x38b3ff['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b13('0xa')](function(_0x8f9476){logger[_0x5b13('0xb')]('ShowDynamics365Account',_0x56a77f);logger[_0x5b13('0xe')](_0x5b13('0x20'),_0x56a77f,JSON[_0x5b13('0x10')](_0x8f9476));_0x2f3e90(_0x8f9476);})['catch'](function(_0x32b8af){logger[_0x5b13('0x11')]('ShowDynamics365Account',_0x32b8af['message'],_0x56a77f);_0x2867a8(_0x5e316d[_0x5b13('0x11')](0x1f4,_0x32b8af[_0x5b13('0x13')]));});});}; \ No newline at end of file +var _0xc103=['attributes','limit','include','map','model','ShowDynamics365Account','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where'];(function(_0x88f9f7,_0x1753ff){var _0x5f3769=function(_0x4758f2){while(--_0x4758f2){_0x88f9f7['push'](_0x88f9f7['shift']());}};_0x5f3769(++_0x1753ff);}(_0xc103,0x1b7));var _0x3c10=function(_0x587f89,_0x2272f3){_0x587f89=_0x587f89-0x0;var _0x18c8c7=_0xc103[_0x587f89];return _0x18c8c7;};'use strict';var _=require('lodash');var util=require(_0x3c10('0x0'));var moment=require(_0x3c10('0x1'));var BPromise=require(_0x3c10('0x2'));var rs=require(_0x3c10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c10('0x4'))['db'];var utils=require(_0x3c10('0x5'));var logger=require('../../config/logger')(_0x3c10('0x6'));var config=require(_0x3c10('0x7'));var jayson=require(_0x3c10('0x8'));var client=jayson[_0x3c10('0x9')][_0x3c10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39d68c,_0xd43ac5,_0x2e0a62){return new BPromise(function(_0x4c89ed,_0x276fee){return client[_0x3c10('0xb')](_0x39d68c,_0x2e0a62)[_0x3c10('0xc')](function(_0x3fc995){logger[_0x3c10('0xd')](_0x3c10('0xe'),_0xd43ac5,'request\x20sent');logger[_0x3c10('0xf')](_0x3c10('0x10'),_0xd43ac5,'request\x20sent',JSON[_0x3c10('0x11')](_0x3fc995));if(_0x3fc995[_0x3c10('0x12')]){if(_0x3fc995[_0x3c10('0x12')][_0x3c10('0x13')]===0x1f4){logger[_0x3c10('0x12')](_0x3c10('0xe'),_0xd43ac5,_0x3fc995[_0x3c10('0x12')][_0x3c10('0x14')]);return _0x276fee(_0x3fc995[_0x3c10('0x12')][_0x3c10('0x14')]);}logger[_0x3c10('0x12')](_0x3c10('0xe'),_0xd43ac5,_0x3fc995[_0x3c10('0x12')][_0x3c10('0x14')]);return _0x4c89ed(_0x3fc995[_0x3c10('0x12')][_0x3c10('0x14')]);}else{logger[_0x3c10('0xd')](_0x3c10('0xe'),_0xd43ac5,_0x3c10('0x15'));_0x4c89ed(_0x3fc995[_0x3c10('0x16')][_0x3c10('0x14')]);}})[_0x3c10('0x17')](function(_0xfe4ca){logger[_0x3c10('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0xd43ac5,_0xfe4ca);_0x276fee(_0xfe4ca);});});}exports[_0x3c10('0x18')]=function(_0x5f1a63){var _0x1b5f8f=this;return new Promise(function(_0x402314,_0x2bab3f){return db[_0x3c10('0x19')][_0x3c10('0x1a')]({'raw':_0x5f1a63[_0x3c10('0x1b')]?_0x5f1a63[_0x3c10('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5f1a63[_0x3c10('0x1b')]?_0x5f1a63['options'][_0x3c10('0x1c')]||null:null,'attributes':_0x5f1a63['options']?_0x5f1a63['options'][_0x3c10('0x1d')]||null:null,'limit':_0x5f1a63[_0x3c10('0x1b')]?_0x5f1a63[_0x3c10('0x1b')][_0x3c10('0x1e')]||null:null,'include':_0x5f1a63[_0x3c10('0x1b')]?_0x5f1a63[_0x3c10('0x1b')][_0x3c10('0x1f')]?_[_0x3c10('0x20')](_0x5f1a63['options'][_0x3c10('0x1f')],function(_0x3e3005){return{'model':db[_0x3e3005['model']],'as':_0x3e3005['as'],'attributes':_0x3e3005[_0x3c10('0x1d')],'include':_0x3e3005['include']?_[_0x3c10('0x20')](_0x3e3005[_0x3c10('0x1f')],function(_0x5ac2c3){return{'model':db[_0x5ac2c3[_0x3c10('0x21')]],'as':_0x5ac2c3['as'],'attributes':_0x5ac2c3[_0x3c10('0x1d')],'include':_0x5ac2c3['include']?_[_0x3c10('0x20')](_0x5ac2c3[_0x3c10('0x1f')],function(_0x41dde9){return{'model':db[_0x41dde9[_0x3c10('0x21')]],'as':_0x41dde9['as'],'attributes':_0x41dde9[_0x3c10('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3c10('0xc')](function(_0x582be5){logger['info'](_0x3c10('0x18'),_0x5f1a63);logger[_0x3c10('0xf')](_0x3c10('0x18'),_0x5f1a63,JSON[_0x3c10('0x11')](_0x582be5));_0x402314(_0x582be5);})[_0x3c10('0x17')](function(_0x2a09fa){logger[_0x3c10('0x12')]('GetDynamics365Account',_0x2a09fa[_0x3c10('0x14')],_0x5f1a63);_0x2bab3f(_0x1b5f8f[_0x3c10('0x12')](0x1f4,_0x2a09fa['message']));});});};exports[_0x3c10('0x22')]=function(_0x229801){var _0x38775a=this;return new Promise(function(_0x51bc0e,_0x133496){return db['Dynamics365Account'][_0x3c10('0x23')]({'raw':_0x229801['options']?_0x229801[_0x3c10('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x229801['options']?_0x229801[_0x3c10('0x1b')][_0x3c10('0x1c')]||null:null,'attributes':_0x229801[_0x3c10('0x1b')]?_0x229801[_0x3c10('0x1b')][_0x3c10('0x1d')]||null:null,'include':_0x229801[_0x3c10('0x1b')]?_0x229801[_0x3c10('0x1b')][_0x3c10('0x1f')]?_[_0x3c10('0x20')](_0x229801[_0x3c10('0x1b')][_0x3c10('0x1f')],function(_0x5b48a5){return{'model':db[_0x5b48a5['model']],'as':_0x5b48a5['as'],'attributes':_0x5b48a5[_0x3c10('0x1d')],'include':_0x5b48a5['include']?_[_0x3c10('0x20')](_0x5b48a5['include'],function(_0x370ba6){return{'model':db[_0x370ba6[_0x3c10('0x21')]],'as':_0x370ba6['as'],'attributes':_0x370ba6[_0x3c10('0x1d')],'include':_0x370ba6['include']?_[_0x3c10('0x20')](_0x370ba6[_0x3c10('0x1f')],function(_0x51e071){return{'model':db[_0x51e071[_0x3c10('0x21')]],'as':_0x51e071['as'],'attributes':_0x51e071[_0x3c10('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3c10('0xc')](function(_0x5d2a9a){logger[_0x3c10('0xd')](_0x3c10('0x22'),_0x229801);logger[_0x3c10('0xf')](_0x3c10('0x22'),_0x229801,JSON[_0x3c10('0x11')](_0x5d2a9a));_0x51bc0e(_0x5d2a9a);})[_0x3c10('0x17')](function(_0x3d6aaa){logger[_0x3c10('0x12')](_0x3c10('0x22'),_0x3d6aaa[_0x3c10('0x14')],_0x229801);_0x133496(_0x38775a['error'](0x1f4,_0x3d6aaa[_0x3c10('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index b51bdbf..2871820 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 _0xdf8d=['getSubjects','getDescriptions','create','put','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x24ec40,_0x375368){var _0x517d60=function(_0x2016de){while(--_0x2016de){_0x24ec40['push'](_0x24ec40['shift']());}};_0x517d60(++_0x375368);}(_0xdf8d,0x1bf));var _0xddf8=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0xdf8d[_0x2afbb0];return _0x411ff2;};'use strict';var multer=require(_0xddf8('0x0'));var util=require('util');var path=require(_0xddf8('0x1'));var timeout=require('connect-timeout');var express=require(_0xddf8('0x2'));var router=express[_0xddf8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xddf8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xddf8('0x5'));var controller=require('./intDynamics365Configuration.controller');router[_0xddf8('0x6')]('/',auth[_0xddf8('0x7')](),controller['index']);router[_0xddf8('0x6')](_0xddf8('0x8'),auth[_0xddf8('0x7')](),controller[_0xddf8('0x9')]);router[_0xddf8('0x6')](_0xddf8('0xa'),auth['isAuthenticated'](),controller[_0xddf8('0xb')]);router[_0xddf8('0x6')](_0xddf8('0xc'),auth[_0xddf8('0x7')](),controller[_0xddf8('0xd')]);router[_0xddf8('0x6')]('/:id/descriptions',auth[_0xddf8('0x7')](),controller[_0xddf8('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xddf8('0xf')]);router[_0xddf8('0x10')](_0xddf8('0x8'),auth[_0xddf8('0x7')](),controller[_0xddf8('0x11')]);router['delete'](_0xddf8('0x8'),auth[_0xddf8('0x7')](),controller[_0xddf8('0x12')]);module[_0xddf8('0x13')]=router; \ No newline at end of file +var _0x3bb8=['../../config/environment','./intDynamics365Configuration.controller','index','get','show','/:id/fields','isAuthenticated','getFields','/:id/descriptions','post','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0xc34b91,_0x27f43c){var _0x474fc2=function(_0x293336){while(--_0x293336){_0xc34b91['push'](_0xc34b91['shift']());}};_0x474fc2(++_0x27f43c);}(_0x3bb8,0x173));var _0x83bb=function(_0x47569c,_0x1a156c){_0x47569c=_0x47569c-0x0;var _0x593f8c=_0x3bb8[_0x47569c];return _0x593f8c;};'use strict';var multer=require(_0x83bb('0x0'));var util=require(_0x83bb('0x1'));var path=require(_0x83bb('0x2'));var timeout=require(_0x83bb('0x3'));var express=require(_0x83bb('0x4'));var router=express['Router']();var fs_extra=require(_0x83bb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x83bb('0x6'));var config=require(_0x83bb('0x7'));var controller=require(_0x83bb('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x83bb('0x9')]);router[_0x83bb('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x83bb('0xb')]);router['get'](_0x83bb('0xc'),auth[_0x83bb('0xd')](),controller[_0x83bb('0xe')]);router[_0x83bb('0xa')]('/:id/subjects',auth[_0x83bb('0xd')](),controller['getSubjects']);router[_0x83bb('0xa')](_0x83bb('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x83bb('0x10')]('/',auth[_0x83bb('0xd')](),controller['create']);router['put'](_0x83bb('0x11'),auth[_0x83bb('0xd')](),controller[_0x83bb('0x12')]);router['delete']('/:id',auth[_0x83bb('0xd')](),controller[_0x83bb('0x13')]);module[_0x83bb('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index a7e16c6..bdd2d14 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 _0x3bc4=['contact','nothing','BOOLEAN','sequelize','exports','STRING','ENUM','incident'];(function(_0x30d24e,_0x5be7d3){var _0x4e4069=function(_0x4382db){while(--_0x4382db){_0x30d24e['push'](_0x30d24e['shift']());}};_0x4e4069(++_0x5be7d3);}(_0x3bc4,0x153));var _0x43bc=function(_0x3d91fd,_0x3a768b){_0x3d91fd=_0x3d91fd-0x0;var _0x137a3a=_0x3bc4[_0x3d91fd];return _0x137a3a;};'use strict';var Sequelize=require(_0x43bc('0x0'));module[_0x43bc('0x1')]={'name':{'type':Sequelize[_0x43bc('0x2')]},'description':{'type':Sequelize[_0x43bc('0x2')]},'ticketType':{'type':Sequelize[_0x43bc('0x3')](_0x43bc('0x4'),'phonecall'),'defaultValue':_0x43bc('0x4')},'moduleCreate':{'type':Sequelize[_0x43bc('0x3')](_0x43bc('0x5'),_0x43bc('0x6')),'defaultValue':_0x43bc('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x43bc('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x43bc('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd80b=['phonecall','incident','contact','nothing','BOOLEAN','sequelize','exports','STRING','ENUM'];(function(_0x4315f7,_0x5e14ed){var _0x3d7aea=function(_0x5a64ea){while(--_0x5a64ea){_0x4315f7['push'](_0x4315f7['shift']());}};_0x3d7aea(++_0x5e14ed);}(_0xd80b,0x10a));var _0xbd80=function(_0x3964f1,_0x208205){_0x3964f1=_0x3964f1-0x0;var _0x4051ea=_0xd80b[_0x3964f1];return _0x4051ea;};'use strict';var Sequelize=require(_0xbd80('0x0'));module[_0xbd80('0x1')]={'name':{'type':Sequelize[_0xbd80('0x2')]},'description':{'type':Sequelize[_0xbd80('0x2')]},'ticketType':{'type':Sequelize[_0xbd80('0x3')]('incident',_0xbd80('0x4')),'defaultValue':_0xbd80('0x5')},'moduleCreate':{'type':Sequelize[_0xbd80('0x3')](_0xbd80('0x6'),_0xbd80('0x7')),'defaultValue':_0xbd80('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xbd80('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index bcd5066..d9d279a 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 _0x2178=['request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','keys','find','create','body','update','params','getFields','Dynamics365Field','hasOwnProperty','getSubjects','order','getDescriptions','findOne','eml-format','rimraf','fast-json-patch'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0x2178,0x131));var _0x8217=function(_0x192136,_0x434d09){_0x192136=_0x192136-0x0;var _0x2524a5=_0x2178[_0x192136];return _0x2524a5;};'use strict';var emlformat=require(_0x8217('0x0'));var rimraf=require(_0x8217('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8217('0x2'));var rp=require(_0x8217('0x3'));var moment=require(_0x8217('0x4'));var BPromise=require(_0x8217('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8217('0x6'));var csv=require(_0x8217('0x7'));var ejs=require(_0x8217('0x8'));var fs=require('fs');var fs_extra=require(_0x8217('0x9'));var _=require('lodash');var squel=require(_0x8217('0xa'));var crypto=require(_0x8217('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8217('0x7'));var querystring=require('querystring');var Papa=require(_0x8217('0xc'));var Redis=require(_0x8217('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x8217('0xe'));var as=require(_0x8217('0xf'));var hardwareService=require(_0x8217('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x8217('0x11'));var config=require(_0x8217('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x8217('0x13'))['db'];function respondWithStatusCode(_0x5a787a,_0x41b092){_0x41b092=_0x41b092||0xcc;return function(_0x36fa50){if(_0x36fa50){return _0x5a787a[_0x8217('0x14')](_0x41b092);}return _0x5a787a[_0x8217('0x15')](_0x41b092)[_0x8217('0x16')]();};}function respondWithResult(_0x24cc93,_0x5ae8cb){_0x5ae8cb=_0x5ae8cb||0xc8;return function(_0x3d8eba){if(_0x3d8eba){return _0x24cc93['status'](_0x5ae8cb)[_0x8217('0x17')](_0x3d8eba);}};}function respondWithFilteredResult(_0x7ccfd4,_0x1a1bfa){return function(_0x29a264){if(_0x29a264){var _0x62e2c0=typeof _0x1a1bfa[_0x8217('0x18')]===_0x8217('0x19')&&typeof _0x1a1bfa[_0x8217('0x1a')]===_0x8217('0x19');var _0x122f7b=_0x29a264['count'];var _0x241a34=_0x62e2c0?0x0:_0x1a1bfa[_0x8217('0x18')];var _0x195250=_0x62e2c0?_0x29a264[_0x8217('0x1b')]:_0x1a1bfa[_0x8217('0x18')]+_0x1a1bfa[_0x8217('0x1a')];var _0x509d35;if(_0x195250>=_0x122f7b){_0x195250=_0x122f7b;_0x509d35=0xc8;}else{_0x509d35=0xce;}_0x7ccfd4['status'](_0x509d35);return _0x7ccfd4[_0x8217('0x1c')](_0x8217('0x1d'),_0x241a34+'-'+_0x195250+'/'+_0x122f7b)[_0x8217('0x17')](_0x29a264);}return null;};}function patchUpdates(_0x4225d0){return function(_0x36f999){try{jsonpatch[_0x8217('0x1e')](_0x36f999,_0x4225d0,!![]);}catch(_0x3d7766){return BPromise[_0x8217('0x1f')](_0x3d7766);}return _0x36f999[_0x8217('0x20')]();};}function saveUpdates(_0x1ca81a,_0x5b3c3b){return function(_0x55ee67){if(_0x55ee67){return _0x55ee67['update'](_0x1ca81a)[_0x8217('0x21')](function(_0x126dbc){return _0x126dbc;});}return null;};}function removeEntity(_0x46fd3c,_0x43a686){return function(_0x35987b){if(_0x35987b){return _0x35987b[_0x8217('0x22')]()[_0x8217('0x21')](function(){_0x46fd3c['status'](0xcc)[_0x8217('0x16')]();});}};}function handleEntityNotFound(_0x569421,_0x248582){return function(_0x1d1562){if(!_0x1d1562){_0x569421[_0x8217('0x14')](0x194);}return _0x1d1562;};}function handleError(_0x528e64,_0x5cec74){_0x5cec74=_0x5cec74||0x1f4;return function(_0x2f6fee){logger[_0x8217('0x23')](_0x2f6fee[_0x8217('0x24')]);if(_0x2f6fee[_0x8217('0x25')]){delete _0x2f6fee[_0x8217('0x25')];}_0x528e64['status'](_0x5cec74)[_0x8217('0x26')](_0x2f6fee);};}exports['index']=function(_0x1bf9c7,_0x2fe551){var _0x4babcb={},_0x401475={},_0x3a8990={'count':0x0,'rows':[]};var _0x70110=_[_0x8217('0x27')](db[_0x8217('0x28')][_0x8217('0x29')],function(_0x515935){return{'name':_0x515935[_0x8217('0x2a')],'type':_0x515935[_0x8217('0x2b')][_0x8217('0x2c')]};});_0x401475[_0x8217('0x2d')]=_[_0x8217('0x27')](_0x70110,_0x8217('0x25'));_0x401475[_0x8217('0x2e')]=_['keys'](_0x1bf9c7['query']);_0x401475[_0x8217('0x2f')]=_[_0x8217('0x30')](_0x401475[_0x8217('0x2d')],_0x401475['query']);_0x4babcb[_0x8217('0x31')]=_['intersection'](_0x401475['model'],qs[_0x8217('0x32')](_0x1bf9c7[_0x8217('0x2e')][_0x8217('0x32')]));_0x4babcb[_0x8217('0x31')]=_0x4babcb['attributes'][_0x8217('0x33')]?_0x4babcb['attributes']:_0x401475[_0x8217('0x2d')];if(!_0x1bf9c7[_0x8217('0x2e')]['hasOwnProperty'](_0x8217('0x34'))){_0x4babcb['limit']=qs[_0x8217('0x1a')](_0x1bf9c7[_0x8217('0x2e')][_0x8217('0x1a')]);_0x4babcb[_0x8217('0x18')]=qs[_0x8217('0x18')](_0x1bf9c7[_0x8217('0x2e')][_0x8217('0x18')]);}_0x4babcb['order']=qs[_0x8217('0x35')](_0x1bf9c7[_0x8217('0x2e')]['sort']);_0x4babcb[_0x8217('0x36')]=qs['filters'](_[_0x8217('0x37')](_0x1bf9c7['query'],_0x401475['filters']),_0x70110);if(_0x1bf9c7[_0x8217('0x2e')][_0x8217('0x38')]){_0x4babcb[_0x8217('0x36')]=_['merge'](_0x4babcb['where'],{'$or':_[_0x8217('0x27')](_0x70110,function(_0xab8687){if(_0xab8687[_0x8217('0x2b')]!==_0x8217('0x39')){var _0x1dfb7d={};_0x1dfb7d[_0xab8687['name']]={'$like':'%'+_0x1bf9c7[_0x8217('0x2e')][_0x8217('0x38')]+'%'};return _0x1dfb7d;}})});}_0x4babcb=_[_0x8217('0x3a')]({},_0x4babcb,_0x1bf9c7[_0x8217('0x3b')]);var _0x29b589={'where':_0x4babcb['where']};return db[_0x8217('0x28')][_0x8217('0x1b')](_0x29b589)[_0x8217('0x21')](function(_0x10985b){_0x3a8990[_0x8217('0x1b')]=_0x10985b;if(_0x1bf9c7[_0x8217('0x2e')][_0x8217('0x3c')]){_0x4babcb[_0x8217('0x3d')]=[{'all':!![]}];}return db[_0x8217('0x28')]['findAll'](_0x4babcb);})[_0x8217('0x21')](function(_0x4a15d3){_0x3a8990['rows']=_0x4a15d3;return _0x3a8990;})[_0x8217('0x21')](respondWithFilteredResult(_0x2fe551,_0x4babcb))[_0x8217('0x3e')](handleError(_0x2fe551,null));};exports[_0x8217('0x3f')]=function(_0x2a3853,_0x1fa8af){var _0x3c5c9e={'raw':![],'where':{'id':_0x2a3853['params']['id']}},_0x4b4367={};_0x4b4367[_0x8217('0x2d')]=_[_0x8217('0x40')](db[_0x8217('0x28')][_0x8217('0x29')]);_0x4b4367['query']=_[_0x8217('0x40')](_0x2a3853[_0x8217('0x2e')]);_0x4b4367[_0x8217('0x2f')]=_['intersection'](_0x4b4367[_0x8217('0x2d')],_0x4b4367[_0x8217('0x2e')]);_0x3c5c9e[_0x8217('0x31')]=_[_0x8217('0x30')](_0x4b4367[_0x8217('0x2d')],qs['fields'](_0x2a3853['query'][_0x8217('0x32')]));_0x3c5c9e[_0x8217('0x31')]=_0x3c5c9e[_0x8217('0x31')]['length']?_0x3c5c9e[_0x8217('0x31')]:_0x4b4367['model'];if(_0x2a3853[_0x8217('0x2e')][_0x8217('0x3c')]){_0x3c5c9e['include']=[{'all':!![]}];}_0x3c5c9e=_['merge']({},_0x3c5c9e,_0x2a3853[_0x8217('0x3b')]);return db[_0x8217('0x28')][_0x8217('0x41')](_0x3c5c9e)['then'](handleEntityNotFound(_0x1fa8af,null))[_0x8217('0x21')](respondWithResult(_0x1fa8af,null))[_0x8217('0x3e')](handleError(_0x1fa8af,null));};exports[_0x8217('0x42')]=function(_0x288304,_0x49cfb4){return db[_0x8217('0x28')][_0x8217('0x42')](_0x288304[_0x8217('0x43')],{})[_0x8217('0x21')](respondWithResult(_0x49cfb4,0xc9))[_0x8217('0x3e')](handleError(_0x49cfb4,null));};exports[_0x8217('0x44')]=function(_0x127fb4,_0x2240cb){if(_0x127fb4[_0x8217('0x43')]['id']){delete _0x127fb4['body']['id'];}return db[_0x8217('0x28')]['find']({'where':{'id':_0x127fb4[_0x8217('0x45')]['id']}})[_0x8217('0x21')](handleEntityNotFound(_0x2240cb,null))['then'](saveUpdates(_0x127fb4[_0x8217('0x43')],null))[_0x8217('0x21')](respondWithResult(_0x2240cb,null))[_0x8217('0x3e')](handleError(_0x2240cb,null));};exports['destroy']=function(_0x30508f,_0x16b6d7){return db[_0x8217('0x28')][_0x8217('0x41')]({'where':{'id':_0x30508f[_0x8217('0x45')]['id']}})[_0x8217('0x21')](handleEntityNotFound(_0x16b6d7,null))['then'](removeEntity(_0x16b6d7,null))[_0x8217('0x3e')](handleError(_0x16b6d7,null));};exports[_0x8217('0x46')]=function(_0x2fd2d3,_0x8c67de,_0x368634){var _0xf0f388={};var _0x4e3325={};var _0x1f12a2;var _0x2767c0;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2fd2d3[_0x8217('0x45')]['id']}})[_0x8217('0x21')](handleEntityNotFound(_0x8c67de,null))[_0x8217('0x21')](function(_0x2a29af){if(_0x2a29af){_0x1f12a2=_0x2a29af;_0x4e3325[_0x8217('0x2d')]=_[_0x8217('0x40')](db[_0x8217('0x47')]['rawAttributes']);_0x4e3325[_0x8217('0x2e')]=_[_0x8217('0x40')](_0x2fd2d3[_0x8217('0x2e')]);_0x4e3325[_0x8217('0x2f')]=_[_0x8217('0x30')](_0x4e3325[_0x8217('0x2d')],_0x4e3325[_0x8217('0x2e')]);_0xf0f388[_0x8217('0x31')]=_['intersection'](_0x4e3325['model'],qs['fields'](_0x2fd2d3[_0x8217('0x2e')]['fields']));_0xf0f388[_0x8217('0x31')]=_0xf0f388[_0x8217('0x31')][_0x8217('0x33')]?_0xf0f388['attributes']:_0x4e3325[_0x8217('0x2d')];_0xf0f388['order']=qs['sort'](_0x2fd2d3[_0x8217('0x2e')][_0x8217('0x35')]);_0xf0f388[_0x8217('0x36')]=qs[_0x8217('0x2f')](_[_0x8217('0x37')](_0x2fd2d3[_0x8217('0x2e')],_0x4e3325[_0x8217('0x2f')]));if(_0x2fd2d3[_0x8217('0x2e')]['filter']){_0xf0f388['where']=_[_0x8217('0x3a')](_0xf0f388['where'],{'$or':_[_0x8217('0x27')](_0xf0f388['attributes'],function(_0x14295a){var _0x25799e={};_0x25799e[_0x14295a]={'$like':'%'+_0x2fd2d3['query'][_0x8217('0x38')]+'%'};return _0x25799e;})});}_0xf0f388=_[_0x8217('0x3a')]({},_0xf0f388,_0x2fd2d3[_0x8217('0x3b')]);return _0x1f12a2[_0x8217('0x46')](_0xf0f388);}})[_0x8217('0x21')](function(_0x392ff0){if(_0x392ff0){_0x2767c0=_0x392ff0[_0x8217('0x33')];if(!_0x2fd2d3[_0x8217('0x2e')][_0x8217('0x48')](_0x8217('0x34'))){_0xf0f388[_0x8217('0x1a')]=qs['limit'](_0x2fd2d3[_0x8217('0x2e')]['limit']);_0xf0f388['offset']=qs[_0x8217('0x18')](_0x2fd2d3[_0x8217('0x2e')][_0x8217('0x18')]);}return _0x1f12a2['getFields'](_0xf0f388);}})[_0x8217('0x21')](function(_0x1751cd){if(_0x1751cd){return _0x1751cd?{'count':_0x2767c0,'rows':_0x1751cd}:null;}})[_0x8217('0x21')](respondWithResult(_0x8c67de,null))[_0x8217('0x3e')](handleError(_0x8c67de,null));};exports[_0x8217('0x49')]=function(_0xa1fea8,_0x224ffc,_0x1a1c12){var _0x159eab={};var _0x138aa4={};var _0xc1b466;var _0x361a4b;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0xa1fea8['params']['id']}})[_0x8217('0x21')](handleEntityNotFound(_0x224ffc,null))[_0x8217('0x21')](function(_0x1f906b){if(_0x1f906b){_0xc1b466=_0x1f906b;_0x138aa4['model']=_[_0x8217('0x40')](db[_0x8217('0x47')]['rawAttributes']);_0x138aa4[_0x8217('0x2e')]=_['keys'](_0xa1fea8['query']);_0x138aa4[_0x8217('0x2f')]=_[_0x8217('0x30')](_0x138aa4[_0x8217('0x2d')],_0x138aa4[_0x8217('0x2e')]);_0x159eab['attributes']=_[_0x8217('0x30')](_0x138aa4[_0x8217('0x2d')],qs[_0x8217('0x32')](_0xa1fea8[_0x8217('0x2e')][_0x8217('0x32')]));_0x159eab['attributes']=_0x159eab[_0x8217('0x31')][_0x8217('0x33')]?_0x159eab[_0x8217('0x31')]:_0x138aa4[_0x8217('0x2d')];_0x159eab[_0x8217('0x4a')]=qs[_0x8217('0x35')](_0xa1fea8[_0x8217('0x2e')]['sort']);_0x159eab[_0x8217('0x36')]=qs[_0x8217('0x2f')](_['pick'](_0xa1fea8[_0x8217('0x2e')],_0x138aa4[_0x8217('0x2f')]));if(_0xa1fea8[_0x8217('0x2e')][_0x8217('0x38')]){_0x159eab['where']=_['merge'](_0x159eab['where'],{'$or':_[_0x8217('0x27')](_0x159eab[_0x8217('0x31')],function(_0x5587d9){var _0x9443c4={};_0x9443c4[_0x5587d9]={'$like':'%'+_0xa1fea8['query'][_0x8217('0x38')]+'%'};return _0x9443c4;})});}_0x159eab=_[_0x8217('0x3a')]({},_0x159eab,_0xa1fea8[_0x8217('0x3b')]);return _0xc1b466[_0x8217('0x49')](_0x159eab);}})['then'](function(_0x41c28c){if(_0x41c28c){_0x361a4b=_0x41c28c[_0x8217('0x33')];if(!_0xa1fea8[_0x8217('0x2e')][_0x8217('0x48')]('nolimit')){_0x159eab[_0x8217('0x1a')]=qs[_0x8217('0x1a')](_0xa1fea8[_0x8217('0x2e')][_0x8217('0x1a')]);_0x159eab[_0x8217('0x18')]=qs['offset'](_0xa1fea8[_0x8217('0x2e')][_0x8217('0x18')]);}return _0xc1b466[_0x8217('0x49')](_0x159eab);}})[_0x8217('0x21')](function(_0x136550){if(_0x136550){return _0x136550?{'count':_0x361a4b,'rows':_0x136550}:null;}})[_0x8217('0x21')](respondWithResult(_0x224ffc,null))[_0x8217('0x3e')](handleError(_0x224ffc,null));};exports[_0x8217('0x4b')]=function(_0x471f1b,_0x313a00,_0xaa8859){var _0x1bc89d={};var _0xf5f6d0={};var _0x586792;var _0x43e1f2;return db[_0x8217('0x28')][_0x8217('0x4c')]({'where':{'id':_0x471f1b[_0x8217('0x45')]['id']}})['then'](handleEntityNotFound(_0x313a00,null))['then'](function(_0x30731a){if(_0x30731a){_0x586792=_0x30731a;_0xf5f6d0[_0x8217('0x2d')]=_[_0x8217('0x40')](db[_0x8217('0x47')][_0x8217('0x29')]);_0xf5f6d0[_0x8217('0x2e')]=_[_0x8217('0x40')](_0x471f1b['query']);_0xf5f6d0[_0x8217('0x2f')]=_[_0x8217('0x30')](_0xf5f6d0[_0x8217('0x2d')],_0xf5f6d0[_0x8217('0x2e')]);_0x1bc89d[_0x8217('0x31')]=_[_0x8217('0x30')](_0xf5f6d0[_0x8217('0x2d')],qs['fields'](_0x471f1b['query'][_0x8217('0x32')]));_0x1bc89d[_0x8217('0x31')]=_0x1bc89d[_0x8217('0x31')][_0x8217('0x33')]?_0x1bc89d[_0x8217('0x31')]:_0xf5f6d0[_0x8217('0x2d')];_0x1bc89d[_0x8217('0x4a')]=qs[_0x8217('0x35')](_0x471f1b[_0x8217('0x2e')]['sort']);_0x1bc89d[_0x8217('0x36')]=qs['filters'](_['pick'](_0x471f1b[_0x8217('0x2e')],_0xf5f6d0[_0x8217('0x2f')]));if(_0x471f1b[_0x8217('0x2e')][_0x8217('0x38')]){_0x1bc89d[_0x8217('0x36')]=_[_0x8217('0x3a')](_0x1bc89d[_0x8217('0x36')],{'$or':_['map'](_0x1bc89d[_0x8217('0x31')],function(_0x5bc565){var _0x43c3e1={};_0x43c3e1[_0x5bc565]={'$like':'%'+_0x471f1b[_0x8217('0x2e')][_0x8217('0x38')]+'%'};return _0x43c3e1;})});}_0x1bc89d=_[_0x8217('0x3a')]({},_0x1bc89d,_0x471f1b[_0x8217('0x3b')]);return _0x586792[_0x8217('0x4b')](_0x1bc89d);}})[_0x8217('0x21')](function(_0x2430d7){if(_0x2430d7){_0x43e1f2=_0x2430d7[_0x8217('0x33')];if(!_0x471f1b['query']['hasOwnProperty'](_0x8217('0x34'))){_0x1bc89d[_0x8217('0x1a')]=qs['limit'](_0x471f1b[_0x8217('0x2e')]['limit']);_0x1bc89d[_0x8217('0x18')]=qs[_0x8217('0x18')](_0x471f1b[_0x8217('0x2e')][_0x8217('0x18')]);}return _0x586792['getDescriptions'](_0x1bc89d);}})[_0x8217('0x21')](function(_0xd683cd){if(_0xd683cd){return _0xd683cd?{'count':_0x43e1f2,'rows':_0xd683cd}:null;}})[_0x8217('0x21')](respondWithResult(_0x313a00,null))[_0x8217('0x3e')](handleError(_0x313a00,null));}; \ No newline at end of file +var _0xf43c=['sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','show','params','model','rawAttributes','filters','catch','create','body','find','getFields','Dynamics365Field','fields','getSubjects','getDescriptions','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','limit','set','Content-Range','save','update','then','destroy','error','name','send','Dynamics365Configuration','fieldName','map','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xf43c,0x65));var _0xcf43=function(_0x53d42a,_0x9c2eb4){_0x53d42a=_0x53d42a-0x0;var _0x127711=_0xf43c[_0x53d42a];return _0x127711;};'use strict';var emlformat=require(_0xcf43('0x0'));var rimraf=require(_0xcf43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcf43('0x2'));var rp=require(_0xcf43('0x3'));var moment=require(_0xcf43('0x4'));var BPromise=require(_0xcf43('0x5'));var Mustache=require(_0xcf43('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcf43('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf43('0x8'));var _=require(_0xcf43('0x9'));var squel=require(_0xcf43('0xa'));var crypto=require(_0xcf43('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcf43('0xc'));var toCsv=require(_0xcf43('0x7'));var querystring=require(_0xcf43('0xd'));var Papa=require(_0xcf43('0xe'));var Redis=require(_0xcf43('0xf'));var authService=require(_0xcf43('0x10'));var qs=require(_0xcf43('0x11'));var as=require(_0xcf43('0x12'));var hardwareService=require(_0xcf43('0x13'));var logger=require(_0xcf43('0x14'))(_0xcf43('0x15'));var utils=require(_0xcf43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcf43('0x17'));var db=require(_0xcf43('0x18'))['db'];function respondWithStatusCode(_0x142705,_0x2a4834){_0x2a4834=_0x2a4834||0xcc;return function(_0x25609f){if(_0x25609f){return _0x142705[_0xcf43('0x19')](_0x2a4834);}return _0x142705[_0xcf43('0x1a')](_0x2a4834)[_0xcf43('0x1b')]();};}function respondWithResult(_0x238a1b,_0x54affe){_0x54affe=_0x54affe||0xc8;return function(_0x4457ba){if(_0x4457ba){return _0x238a1b['status'](_0x54affe)['json'](_0x4457ba);}};}function respondWithFilteredResult(_0x519aea,_0x75b0b7){return function(_0x25b628){if(_0x25b628){var _0x4e2da8=typeof _0x75b0b7[_0xcf43('0x1c')]==='undefined'&&typeof _0x75b0b7['limit']==='undefined';var _0x161fef=_0x25b628[_0xcf43('0x1d')];var _0x26f26c=_0x4e2da8?0x0:_0x75b0b7['offset'];var _0x2069ca=_0x4e2da8?_0x25b628[_0xcf43('0x1d')]:_0x75b0b7[_0xcf43('0x1c')]+_0x75b0b7[_0xcf43('0x1e')];var _0xa97fc;if(_0x2069ca>=_0x161fef){_0x2069ca=_0x161fef;_0xa97fc=0xc8;}else{_0xa97fc=0xce;}_0x519aea[_0xcf43('0x1a')](_0xa97fc);return _0x519aea[_0xcf43('0x1f')](_0xcf43('0x20'),_0x26f26c+'-'+_0x2069ca+'/'+_0x161fef)['json'](_0x25b628);}return null;};}function patchUpdates(_0x2c24f2){return function(_0x448210){try{jsonpatch['apply'](_0x448210,_0x2c24f2,!![]);}catch(_0x22affb){return BPromise['reject'](_0x22affb);}return _0x448210[_0xcf43('0x21')]();};}function saveUpdates(_0x6c69bf,_0x15c2f2){return function(_0x3b6716){if(_0x3b6716){return _0x3b6716[_0xcf43('0x22')](_0x6c69bf)[_0xcf43('0x23')](function(_0x6b1b76){return _0x6b1b76;});}return null;};}function removeEntity(_0x1a80fb,_0x1cd1f6){return function(_0xf03246){if(_0xf03246){return _0xf03246[_0xcf43('0x24')]()[_0xcf43('0x23')](function(){_0x1a80fb[_0xcf43('0x1a')](0xcc)[_0xcf43('0x1b')]();});}};}function handleEntityNotFound(_0x93135,_0x390fe5){return function(_0x5148c6){if(!_0x5148c6){_0x93135[_0xcf43('0x19')](0x194);}return _0x5148c6;};}function handleError(_0x45f8d2,_0x4d7fd2){_0x4d7fd2=_0x4d7fd2||0x1f4;return function(_0x28ee80){logger[_0xcf43('0x25')](_0x28ee80['stack']);if(_0x28ee80[_0xcf43('0x26')]){delete _0x28ee80['name'];}_0x45f8d2[_0xcf43('0x1a')](_0x4d7fd2)[_0xcf43('0x27')](_0x28ee80);};}exports['index']=function(_0x12d326,_0x25a69b){var _0x248de0={},_0x3d21a4={},_0x201287={'count':0x0,'rows':[]};var _0x3e2561=_['map'](db[_0xcf43('0x28')]['rawAttributes'],function(_0x4f5684){return{'name':_0x4f5684[_0xcf43('0x29')],'type':_0x4f5684['type']['key']};});_0x3d21a4['model']=_[_0xcf43('0x2a')](_0x3e2561,_0xcf43('0x26'));_0x3d21a4['query']=_[_0xcf43('0x2b')](_0x12d326[_0xcf43('0x2c')]);_0x3d21a4['filters']=_[_0xcf43('0x2d')](_0x3d21a4['model'],_0x3d21a4[_0xcf43('0x2c')]);_0x248de0[_0xcf43('0x2e')]=_[_0xcf43('0x2d')](_0x3d21a4['model'],qs['fields'](_0x12d326[_0xcf43('0x2c')]['fields']));_0x248de0[_0xcf43('0x2e')]=_0x248de0['attributes'][_0xcf43('0x2f')]?_0x248de0['attributes']:_0x3d21a4['model'];if(!_0x12d326[_0xcf43('0x2c')][_0xcf43('0x30')](_0xcf43('0x31'))){_0x248de0['limit']=qs[_0xcf43('0x1e')](_0x12d326[_0xcf43('0x2c')]['limit']);_0x248de0[_0xcf43('0x1c')]=qs[_0xcf43('0x1c')](_0x12d326[_0xcf43('0x2c')][_0xcf43('0x1c')]);}_0x248de0[_0xcf43('0x32')]=qs[_0xcf43('0x33')](_0x12d326[_0xcf43('0x2c')][_0xcf43('0x33')]);_0x248de0[_0xcf43('0x34')]=qs['filters'](_[_0xcf43('0x35')](_0x12d326[_0xcf43('0x2c')],_0x3d21a4['filters']),_0x3e2561);if(_0x12d326[_0xcf43('0x2c')][_0xcf43('0x36')]){_0x248de0[_0xcf43('0x34')]=_['merge'](_0x248de0[_0xcf43('0x34')],{'$or':_[_0xcf43('0x2a')](_0x3e2561,function(_0x270c43){if(_0x270c43[_0xcf43('0x37')]!==_0xcf43('0x38')){var _0x53eaa7={};_0x53eaa7[_0x270c43[_0xcf43('0x26')]]={'$like':'%'+_0x12d326['query'][_0xcf43('0x36')]+'%'};return _0x53eaa7;}})});}_0x248de0=_[_0xcf43('0x39')]({},_0x248de0,_0x12d326[_0xcf43('0x3a')]);var _0xb49a01={'where':_0x248de0[_0xcf43('0x34')]};return db[_0xcf43('0x28')][_0xcf43('0x1d')](_0xb49a01)['then'](function(_0x3a0985){_0x201287[_0xcf43('0x1d')]=_0x3a0985;if(_0x12d326['query'][_0xcf43('0x3b')]){_0x248de0[_0xcf43('0x3c')]=[{'all':!![]}];}return db[_0xcf43('0x28')]['findAll'](_0x248de0);})[_0xcf43('0x23')](function(_0x488129){_0x201287['rows']=_0x488129;return _0x201287;})[_0xcf43('0x23')](respondWithFilteredResult(_0x25a69b,_0x248de0))['catch'](handleError(_0x25a69b,null));};exports[_0xcf43('0x3d')]=function(_0x38dada,_0xf91a13){var _0x519c5e={'raw':![],'where':{'id':_0x38dada[_0xcf43('0x3e')]['id']}},_0x39e61e={};_0x39e61e[_0xcf43('0x3f')]=_[_0xcf43('0x2b')](db[_0xcf43('0x28')][_0xcf43('0x40')]);_0x39e61e[_0xcf43('0x2c')]=_['keys'](_0x38dada[_0xcf43('0x2c')]);_0x39e61e[_0xcf43('0x41')]=_[_0xcf43('0x2d')](_0x39e61e[_0xcf43('0x3f')],_0x39e61e[_0xcf43('0x2c')]);_0x519c5e[_0xcf43('0x2e')]=_[_0xcf43('0x2d')](_0x39e61e[_0xcf43('0x3f')],qs['fields'](_0x38dada['query']['fields']));_0x519c5e[_0xcf43('0x2e')]=_0x519c5e[_0xcf43('0x2e')][_0xcf43('0x2f')]?_0x519c5e[_0xcf43('0x2e')]:_0x39e61e[_0xcf43('0x3f')];if(_0x38dada['query'][_0xcf43('0x3b')]){_0x519c5e[_0xcf43('0x3c')]=[{'all':!![]}];}_0x519c5e=_[_0xcf43('0x39')]({},_0x519c5e,_0x38dada[_0xcf43('0x3a')]);return db[_0xcf43('0x28')]['find'](_0x519c5e)[_0xcf43('0x23')](handleEntityNotFound(_0xf91a13,null))['then'](respondWithResult(_0xf91a13,null))[_0xcf43('0x42')](handleError(_0xf91a13,null));};exports[_0xcf43('0x43')]=function(_0x44411b,_0x4b55d6){return db[_0xcf43('0x28')]['create'](_0x44411b[_0xcf43('0x44')],{})[_0xcf43('0x23')](respondWithResult(_0x4b55d6,0xc9))[_0xcf43('0x42')](handleError(_0x4b55d6,null));};exports['update']=function(_0x19ffa0,_0x5eb2ad){if(_0x19ffa0['body']['id']){delete _0x19ffa0['body']['id'];}return db[_0xcf43('0x28')][_0xcf43('0x45')]({'where':{'id':_0x19ffa0[_0xcf43('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5eb2ad,null))[_0xcf43('0x23')](saveUpdates(_0x19ffa0['body'],null))[_0xcf43('0x23')](respondWithResult(_0x5eb2ad,null))['catch'](handleError(_0x5eb2ad,null));};exports[_0xcf43('0x24')]=function(_0x2f836d,_0x22c10d){return db[_0xcf43('0x28')]['find']({'where':{'id':_0x2f836d[_0xcf43('0x3e')]['id']}})[_0xcf43('0x23')](handleEntityNotFound(_0x22c10d,null))[_0xcf43('0x23')](removeEntity(_0x22c10d,null))[_0xcf43('0x42')](handleError(_0x22c10d,null));};exports[_0xcf43('0x46')]=function(_0x451e3c,_0x583b1f,_0xa03ab){var _0x2c72be={};var _0x211b15={};var _0x77eb7c;var _0xf0f1d7;return db[_0xcf43('0x28')]['findOne']({'where':{'id':_0x451e3c[_0xcf43('0x3e')]['id']}})[_0xcf43('0x23')](handleEntityNotFound(_0x583b1f,null))[_0xcf43('0x23')](function(_0x2eebe5){if(_0x2eebe5){_0x77eb7c=_0x2eebe5;_0x211b15[_0xcf43('0x3f')]=_[_0xcf43('0x2b')](db[_0xcf43('0x47')][_0xcf43('0x40')]);_0x211b15[_0xcf43('0x2c')]=_[_0xcf43('0x2b')](_0x451e3c[_0xcf43('0x2c')]);_0x211b15['filters']=_['intersection'](_0x211b15['model'],_0x211b15[_0xcf43('0x2c')]);_0x2c72be[_0xcf43('0x2e')]=_[_0xcf43('0x2d')](_0x211b15[_0xcf43('0x3f')],qs[_0xcf43('0x48')](_0x451e3c[_0xcf43('0x2c')][_0xcf43('0x48')]));_0x2c72be[_0xcf43('0x2e')]=_0x2c72be[_0xcf43('0x2e')][_0xcf43('0x2f')]?_0x2c72be[_0xcf43('0x2e')]:_0x211b15[_0xcf43('0x3f')];_0x2c72be[_0xcf43('0x32')]=qs['sort'](_0x451e3c[_0xcf43('0x2c')][_0xcf43('0x33')]);_0x2c72be[_0xcf43('0x34')]=qs[_0xcf43('0x41')](_[_0xcf43('0x35')](_0x451e3c[_0xcf43('0x2c')],_0x211b15[_0xcf43('0x41')]));if(_0x451e3c[_0xcf43('0x2c')][_0xcf43('0x36')]){_0x2c72be['where']=_[_0xcf43('0x39')](_0x2c72be[_0xcf43('0x34')],{'$or':_['map'](_0x2c72be['attributes'],function(_0x1e3980){var _0x2e178d={};_0x2e178d[_0x1e3980]={'$like':'%'+_0x451e3c[_0xcf43('0x2c')][_0xcf43('0x36')]+'%'};return _0x2e178d;})});}_0x2c72be=_[_0xcf43('0x39')]({},_0x2c72be,_0x451e3c[_0xcf43('0x3a')]);return _0x77eb7c['getFields'](_0x2c72be);}})['then'](function(_0x44062a){if(_0x44062a){_0xf0f1d7=_0x44062a[_0xcf43('0x2f')];if(!_0x451e3c[_0xcf43('0x2c')]['hasOwnProperty']('nolimit')){_0x2c72be['limit']=qs[_0xcf43('0x1e')](_0x451e3c['query'][_0xcf43('0x1e')]);_0x2c72be[_0xcf43('0x1c')]=qs[_0xcf43('0x1c')](_0x451e3c[_0xcf43('0x2c')][_0xcf43('0x1c')]);}return _0x77eb7c[_0xcf43('0x46')](_0x2c72be);}})[_0xcf43('0x23')](function(_0x42d6a1){if(_0x42d6a1){return _0x42d6a1?{'count':_0xf0f1d7,'rows':_0x42d6a1}:null;}})[_0xcf43('0x23')](respondWithResult(_0x583b1f,null))[_0xcf43('0x42')](handleError(_0x583b1f,null));};exports[_0xcf43('0x49')]=function(_0x471c05,_0x284911,_0x13cdaa){var _0x79576d={};var _0x5bd5ec={};var _0x4b1727;var _0x220517;return db[_0xcf43('0x28')]['findOne']({'where':{'id':_0x471c05[_0xcf43('0x3e')]['id']}})[_0xcf43('0x23')](handleEntityNotFound(_0x284911,null))[_0xcf43('0x23')](function(_0x4e5933){if(_0x4e5933){_0x4b1727=_0x4e5933;_0x5bd5ec[_0xcf43('0x3f')]=_['keys'](db[_0xcf43('0x47')][_0xcf43('0x40')]);_0x5bd5ec[_0xcf43('0x2c')]=_['keys'](_0x471c05[_0xcf43('0x2c')]);_0x5bd5ec[_0xcf43('0x41')]=_['intersection'](_0x5bd5ec[_0xcf43('0x3f')],_0x5bd5ec[_0xcf43('0x2c')]);_0x79576d[_0xcf43('0x2e')]=_[_0xcf43('0x2d')](_0x5bd5ec[_0xcf43('0x3f')],qs[_0xcf43('0x48')](_0x471c05[_0xcf43('0x2c')][_0xcf43('0x48')]));_0x79576d[_0xcf43('0x2e')]=_0x79576d[_0xcf43('0x2e')][_0xcf43('0x2f')]?_0x79576d[_0xcf43('0x2e')]:_0x5bd5ec[_0xcf43('0x3f')];_0x79576d['order']=qs['sort'](_0x471c05[_0xcf43('0x2c')][_0xcf43('0x33')]);_0x79576d[_0xcf43('0x34')]=qs[_0xcf43('0x41')](_['pick'](_0x471c05[_0xcf43('0x2c')],_0x5bd5ec['filters']));if(_0x471c05['query'][_0xcf43('0x36')]){_0x79576d[_0xcf43('0x34')]=_[_0xcf43('0x39')](_0x79576d[_0xcf43('0x34')],{'$or':_[_0xcf43('0x2a')](_0x79576d[_0xcf43('0x2e')],function(_0x222c13){var _0x470c2e={};_0x470c2e[_0x222c13]={'$like':'%'+_0x471c05['query'][_0xcf43('0x36')]+'%'};return _0x470c2e;})});}_0x79576d=_[_0xcf43('0x39')]({},_0x79576d,_0x471c05['options']);return _0x4b1727[_0xcf43('0x49')](_0x79576d);}})[_0xcf43('0x23')](function(_0x375a4d){if(_0x375a4d){_0x220517=_0x375a4d[_0xcf43('0x2f')];if(!_0x471c05['query'][_0xcf43('0x30')](_0xcf43('0x31'))){_0x79576d[_0xcf43('0x1e')]=qs['limit'](_0x471c05[_0xcf43('0x2c')][_0xcf43('0x1e')]);_0x79576d['offset']=qs[_0xcf43('0x1c')](_0x471c05[_0xcf43('0x2c')][_0xcf43('0x1c')]);}return _0x4b1727['getSubjects'](_0x79576d);}})[_0xcf43('0x23')](function(_0x1f1413){if(_0x1f1413){return _0x1f1413?{'count':_0x220517,'rows':_0x1f1413}:null;}})[_0xcf43('0x23')](respondWithResult(_0x284911,null))[_0xcf43('0x42')](handleError(_0x284911,null));};exports[_0xcf43('0x4a')]=function(_0x559142,_0x1ee093,_0x796364){var _0x2b5ecb={};var _0x580ab3={};var _0x2aa3cb;var _0x18ef3f;return db[_0xcf43('0x28')][_0xcf43('0x4b')]({'where':{'id':_0x559142[_0xcf43('0x3e')]['id']}})[_0xcf43('0x23')](handleEntityNotFound(_0x1ee093,null))[_0xcf43('0x23')](function(_0x2d1b9c){if(_0x2d1b9c){_0x2aa3cb=_0x2d1b9c;_0x580ab3[_0xcf43('0x3f')]=_[_0xcf43('0x2b')](db['Dynamics365Field'][_0xcf43('0x40')]);_0x580ab3[_0xcf43('0x2c')]=_[_0xcf43('0x2b')](_0x559142[_0xcf43('0x2c')]);_0x580ab3[_0xcf43('0x41')]=_[_0xcf43('0x2d')](_0x580ab3[_0xcf43('0x3f')],_0x580ab3['query']);_0x2b5ecb[_0xcf43('0x2e')]=_[_0xcf43('0x2d')](_0x580ab3[_0xcf43('0x3f')],qs['fields'](_0x559142[_0xcf43('0x2c')][_0xcf43('0x48')]));_0x2b5ecb[_0xcf43('0x2e')]=_0x2b5ecb[_0xcf43('0x2e')]['length']?_0x2b5ecb['attributes']:_0x580ab3[_0xcf43('0x3f')];_0x2b5ecb[_0xcf43('0x32')]=qs[_0xcf43('0x33')](_0x559142[_0xcf43('0x2c')][_0xcf43('0x33')]);_0x2b5ecb[_0xcf43('0x34')]=qs[_0xcf43('0x41')](_['pick'](_0x559142[_0xcf43('0x2c')],_0x580ab3[_0xcf43('0x41')]));if(_0x559142[_0xcf43('0x2c')]['filter']){_0x2b5ecb['where']=_['merge'](_0x2b5ecb[_0xcf43('0x34')],{'$or':_['map'](_0x2b5ecb[_0xcf43('0x2e')],function(_0x1110a9){var _0x22dac8={};_0x22dac8[_0x1110a9]={'$like':'%'+_0x559142[_0xcf43('0x2c')][_0xcf43('0x36')]+'%'};return _0x22dac8;})});}_0x2b5ecb=_[_0xcf43('0x39')]({},_0x2b5ecb,_0x559142[_0xcf43('0x3a')]);return _0x2aa3cb[_0xcf43('0x4a')](_0x2b5ecb);}})['then'](function(_0x406c59){if(_0x406c59){_0x18ef3f=_0x406c59[_0xcf43('0x2f')];if(!_0x559142['query']['hasOwnProperty'](_0xcf43('0x31'))){_0x2b5ecb[_0xcf43('0x1e')]=qs[_0xcf43('0x1e')](_0x559142['query'][_0xcf43('0x1e')]);_0x2b5ecb[_0xcf43('0x1c')]=qs[_0xcf43('0x1c')](_0x559142[_0xcf43('0x2c')]['offset']);}return _0x2aa3cb[_0xcf43('0x4a')](_0x2b5ecb);}})[_0xcf43('0x23')](function(_0x378ffc){if(_0x378ffc){return _0x378ffc?{'count':_0x18ef3f,'rows':_0x378ffc}:null;}})[_0xcf43('0x23')](respondWithResult(_0x1ee093,null))['catch'](handleError(_0x1ee093,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index a6feec2..76de54e 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0x14dc4a,_0x4ebb82){var _0x11db59=function(_0x50a776){while(--_0x50a776){_0x14dc4a['push'](_0x14dc4a['shift']());}};_0x11db59(++_0x4ebb82);}(_0x9f62,0x154));var _0x29f6=function(_0x539a5e,_0x4ba728){_0x539a5e=_0x539a5e-0x0;var _0x5821e7=_0x9f62[_0x539a5e];return _0x5821e7;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5b3=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0xe5b3,0x133));var _0x3e5b=function(_0x2de039,_0x1dfb71){_0x2de039=_0x2de039-0x0;var _0x302ca7=_0xe5b3[_0x2de039];return _0x302ca7;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var BPromise=require(_0x3e5b('0x4'));var rp=require(_0x3e5b('0x5'));var fs=require('fs');var path=require(_0x3e5b('0x6'));var rimraf=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var attributes=require(_0x3e5b('0x9'));module[_0x3e5b('0xa')]=function(_0x54e1fb,_0x174923){return _0x54e1fb[_0x3e5b('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0x3e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 03abf6e..8159c37 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 _0xf8ee=['result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xc4a935,_0x343a56){var _0x5724c3=function(_0xfbf1c0){while(--_0xfbf1c0){_0xc4a935['push'](_0xc4a935['shift']());}};_0x5724c3(++_0x343a56);}(_0xf8ee,0x80));var _0xef8e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf8ee[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xef8e('0x0'));var util=require(_0xef8e('0x1'));var moment=require(_0xef8e('0x2'));var BPromise=require(_0xef8e('0x3'));var rs=require(_0xef8e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xef8e('0x5'));var logger=require(_0xef8e('0x6'))(_0xef8e('0x7'));var config=require('../../config/environment');var jayson=require(_0xef8e('0x8'));var client=jayson['client'][_0xef8e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfeea55,_0x40bbc3,_0x564af8){return new BPromise(function(_0x2e9332,_0x3d41c9){return client[_0xef8e('0xa')](_0xfeea55,_0x564af8)['then'](function(_0x2d9505){logger[_0xef8e('0xb')](_0xef8e('0xc'),_0x40bbc3,_0xef8e('0xd'));logger[_0xef8e('0xe')](_0xef8e('0xf'),_0x40bbc3,_0xef8e('0xd'),JSON[_0xef8e('0x10')](_0x2d9505));if(_0x2d9505['error']){if(_0x2d9505[_0xef8e('0x11')]['code']===0x1f4){logger[_0xef8e('0x11')](_0xef8e('0xc'),_0x40bbc3,_0x2d9505[_0xef8e('0x11')]['message']);return _0x3d41c9(_0x2d9505[_0xef8e('0x11')][_0xef8e('0x12')]);}logger[_0xef8e('0x11')](_0xef8e('0xc'),_0x40bbc3,_0x2d9505[_0xef8e('0x11')][_0xef8e('0x12')]);return _0x2e9332(_0x2d9505[_0xef8e('0x11')][_0xef8e('0x12')]);}else{logger['info'](_0xef8e('0xc'),_0x40bbc3,_0xef8e('0xd'));_0x2e9332(_0x2d9505[_0xef8e('0x13')][_0xef8e('0x12')]);}})[_0xef8e('0x14')](function(_0x19a7c8){logger[_0xef8e('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x40bbc3,_0x19a7c8);_0x3d41c9(_0x19a7c8);});});} \ No newline at end of file +var _0xdb52=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','lodash','util','moment'];(function(_0x412342,_0x180734){var _0x3e62cb=function(_0x501fc6){while(--_0x501fc6){_0x412342['push'](_0x412342['shift']());}};_0x3e62cb(++_0x180734);}(_0xdb52,0x115));var _0x2db5=function(_0x89973f,_0x6c55d2){_0x89973f=_0x89973f-0x0;var _0x56a8c7=_0xdb52[_0x89973f];return _0x56a8c7;};'use strict';var _=require(_0x2db5('0x0'));var util=require(_0x2db5('0x1'));var moment=require(_0x2db5('0x2'));var BPromise=require(_0x2db5('0x3'));var rs=require(_0x2db5('0x4'));var fs=require('fs');var Redis=require(_0x2db5('0x5'));var db=require(_0x2db5('0x6'))['db'];var utils=require(_0x2db5('0x7'));var logger=require('../../config/logger')(_0x2db5('0x8'));var config=require(_0x2db5('0x9'));var jayson=require(_0x2db5('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x347e23,_0x5de0db,_0x5a9023){return new BPromise(function(_0x29c8a5,_0x1ee6d7){return client['request'](_0x347e23,_0x5a9023)[_0x2db5('0xb')](function(_0xe60d9c){logger['info'](_0x2db5('0xc'),_0x5de0db,'request\x20sent');logger[_0x2db5('0xd')](_0x2db5('0xe'),_0x5de0db,_0x2db5('0xf'),JSON['stringify'](_0xe60d9c));if(_0xe60d9c[_0x2db5('0x10')]){if(_0xe60d9c[_0x2db5('0x10')]['code']===0x1f4){logger[_0x2db5('0x10')](_0x2db5('0xc'),_0x5de0db,_0xe60d9c[_0x2db5('0x10')][_0x2db5('0x11')]);return _0x1ee6d7(_0xe60d9c[_0x2db5('0x10')][_0x2db5('0x11')]);}logger[_0x2db5('0x10')](_0x2db5('0xc'),_0x5de0db,_0xe60d9c[_0x2db5('0x10')][_0x2db5('0x11')]);return _0x29c8a5(_0xe60d9c[_0x2db5('0x10')][_0x2db5('0x11')]);}else{logger[_0x2db5('0x12')](_0x2db5('0xc'),_0x5de0db,_0x2db5('0xf'));_0x29c8a5(_0xe60d9c['result'][_0x2db5('0x11')]);}})[_0x2db5('0x13')](function(_0x519391){logger['error'](_0x2db5('0xc'),_0x5de0db,_0x519391);_0x1ee6d7(_0x519391);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index e43ceff..a39f051 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 _0xb026=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','create','put','/:id'];(function(_0x4839a2,_0x1f67eb){var _0x465147=function(_0x4eae2e){while(--_0x4eae2e){_0x4839a2['push'](_0x4839a2['shift']());}};_0x465147(++_0x1f67eb);}(_0xb026,0x12a));var _0x6b02=function(_0x527a20,_0x347399){_0x527a20=_0x527a20-0x0;var _0x21f5e0=_0xb026[_0x527a20];return _0x21f5e0;};'use strict';var multer=require(_0x6b02('0x0'));var util=require(_0x6b02('0x1'));var path=require(_0x6b02('0x2'));var timeout=require(_0x6b02('0x3'));var express=require(_0x6b02('0x4'));var router=express[_0x6b02('0x5')]();var fs_extra=require(_0x6b02('0x6'));var auth=require(_0x6b02('0x7'));var interaction=require(_0x6b02('0x8'));var config=require(_0x6b02('0x9'));var controller=require(_0x6b02('0xa'));router[_0x6b02('0xb')]('/',auth[_0x6b02('0xc')](),controller[_0x6b02('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x6b02('0xc')](),controller[_0x6b02('0xe')]);router[_0x6b02('0xf')](_0x6b02('0x10'),auth['isAuthenticated'](),controller[_0x6b02('0x11')]);router[_0x6b02('0x12')](_0x6b02('0x10'),auth['isAuthenticated'](),controller[_0x6b02('0x13')]);module[_0x6b02('0x14')]=router; \ No newline at end of file +var _0xfc21=['create','put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id'];(function(_0x308f04,_0x1ba009){var _0x3bde41=function(_0x506455){while(--_0x506455){_0x308f04['push'](_0x308f04['shift']());}};_0x3bde41(++_0x1ba009);}(_0xfc21,0x84));var _0x1fc2=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xfc21[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x1fc2('0x0'));var util=require('util');var path=require(_0x1fc2('0x1'));var timeout=require(_0x1fc2('0x2'));var express=require(_0x1fc2('0x3'));var router=express[_0x1fc2('0x4')]();var fs_extra=require(_0x1fc2('0x5'));var auth=require(_0x1fc2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1fc2('0x7'));router[_0x1fc2('0x8')]('/',auth[_0x1fc2('0x9')](),controller[_0x1fc2('0xa')]);router[_0x1fc2('0x8')](_0x1fc2('0xb'),auth[_0x1fc2('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x1fc2('0xc')]);router[_0x1fc2('0xd')](_0x1fc2('0xb'),auth['isAuthenticated'](),controller[_0x1fc2('0xe')]);router['delete'](_0x1fc2('0xb'),auth[_0x1fc2('0x9')](),controller[_0x1fc2('0xf')]);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 bb458d3..3286e77 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 _0x62f5=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0xf55250,_0x288fca){var _0x379237=function(_0x5cd0d7){while(--_0x5cd0d7){_0xf55250['push'](_0xf55250['shift']());}};_0x379237(++_0x288fca);}(_0x62f5,0x1df));var _0x562f=function(_0x5bbcce,_0x5b3d0f){_0x5bbcce=_0x5bbcce-0x0;var _0x3d955b=_0x62f5[_0x5bbcce];return _0x3d955b;};'use strict';var Sequelize=require(_0x562f('0x0'));module[_0x562f('0x1')]={'type':{'type':Sequelize[_0x562f('0x2')](_0x562f('0x3'),_0x562f('0x4'),_0x562f('0x5'),_0x562f('0x6'),_0x562f('0x7')),'defaultValue':_0x562f('0x3')},'content':{'type':Sequelize[_0x562f('0x8')]},'key':{'type':Sequelize[_0x562f('0x8')]},'keyType':{'type':Sequelize[_0x562f('0x2')](_0x562f('0x3'),_0x562f('0x4'),_0x562f('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x562f('0x8')]},'customField':{'type':Sequelize[_0x562f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x562f('0x8')]}}; \ No newline at end of file +var _0xa361=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','string','variable'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xa361,0x9e));var _0x1a36=function(_0x5c4067,_0x3a8bc4){_0x5c4067=_0x5c4067-0x0;var _0x4653e6=_0xa361[_0x5c4067];return _0x4653e6;};'use strict';var Sequelize=require(_0x1a36('0x0'));module[_0x1a36('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1a36('0x2'),_0x1a36('0x3'),_0x1a36('0x4'),_0x1a36('0x5'),_0x1a36('0x6')),'defaultValue':_0x1a36('0x2')},'content':{'type':Sequelize[_0x1a36('0x7')]},'key':{'type':Sequelize[_0x1a36('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x1a36('0x2'),_0x1a36('0x3'),_0x1a36('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1a36('0x7')]},'customField':{'type':Sequelize[_0x1a36('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a36('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 32fe30c..165c2de 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 _0xd766=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','Dynamics365Field','rawAttributes','type','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x541ebd,_0x594de1){var _0x312623=function(_0x2ff4c1){while(--_0x2ff4c1){_0x541ebd['push'](_0x541ebd['shift']());}};_0x312623(++_0x594de1);}(_0xd766,0x1b2));var _0x6d76=function(_0x53417c,_0x126dee){_0x53417c=_0x53417c-0x0;var _0x49407d=_0xd766[_0x53417c];return _0x49407d;};'use strict';var emlformat=require(_0x6d76('0x0'));var rimraf=require(_0x6d76('0x1'));var zipdir=require(_0x6d76('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d76('0x3'));var moment=require(_0x6d76('0x4'));var BPromise=require(_0x6d76('0x5'));var Mustache=require(_0x6d76('0x6'));var util=require('util');var path=require(_0x6d76('0x7'));var sox=require('sox');var csv=require(_0x6d76('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d76('0x9'));var _=require(_0x6d76('0xa'));var squel=require(_0x6d76('0xb'));var crypto=require(_0x6d76('0xc'));var jsforce=require(_0x6d76('0xd'));var deskjs=require(_0x6d76('0xe'));var toCsv=require(_0x6d76('0x8'));var querystring=require(_0x6d76('0xf'));var Papa=require(_0x6d76('0x10'));var Redis=require(_0x6d76('0x11'));var authService=require(_0x6d76('0x12'));var qs=require(_0x6d76('0x13'));var as=require(_0x6d76('0x14'));var hardwareService=require(_0x6d76('0x15'));var logger=require(_0x6d76('0x16'))(_0x6d76('0x17'));var utils=require(_0x6d76('0x18'));var config=require(_0x6d76('0x19'));var licenseUtil=require(_0x6d76('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e3528,_0x426eae){_0x426eae=_0x426eae||0xcc;return function(_0x400010){if(_0x400010){return _0x3e3528[_0x6d76('0x1b')](_0x426eae);}return _0x3e3528[_0x6d76('0x1c')](_0x426eae)['end']();};}function respondWithResult(_0x32b8d1,_0x1a309e){_0x1a309e=_0x1a309e||0xc8;return function(_0x34b974){if(_0x34b974){return _0x32b8d1['status'](_0x1a309e)[_0x6d76('0x1d')](_0x34b974);}};}function respondWithFilteredResult(_0x54f681,_0x2d9a4c){return function(_0x1c716e){if(_0x1c716e){var _0x171254=typeof _0x2d9a4c[_0x6d76('0x1e')]===_0x6d76('0x1f')&&typeof _0x2d9a4c[_0x6d76('0x20')]===_0x6d76('0x1f');var _0x535ef2=_0x1c716e[_0x6d76('0x21')];var _0x460529=_0x171254?0x0:_0x2d9a4c[_0x6d76('0x1e')];var _0x2a1345=_0x171254?_0x1c716e[_0x6d76('0x21')]:_0x2d9a4c[_0x6d76('0x1e')]+_0x2d9a4c['limit'];var _0x2fcd02;if(_0x2a1345>=_0x535ef2){_0x2a1345=_0x535ef2;_0x2fcd02=0xc8;}else{_0x2fcd02=0xce;}_0x54f681[_0x6d76('0x1c')](_0x2fcd02);return _0x54f681[_0x6d76('0x22')](_0x6d76('0x23'),_0x460529+'-'+_0x2a1345+'/'+_0x535ef2)[_0x6d76('0x1d')](_0x1c716e);}return null;};}function patchUpdates(_0x16fa68){return function(_0x104926){try{jsonpatch[_0x6d76('0x24')](_0x104926,_0x16fa68,!![]);}catch(_0x43c55f){return BPromise[_0x6d76('0x25')](_0x43c55f);}return _0x104926[_0x6d76('0x26')]();};}function saveUpdates(_0x33e76e,_0x51ac17){return function(_0x38f167){if(_0x38f167){return _0x38f167[_0x6d76('0x27')](_0x33e76e)[_0x6d76('0x28')](function(_0x46d5e4){return _0x46d5e4;});}return null;};}function removeEntity(_0x174356,_0x5f3ce5){return function(_0x516602){if(_0x516602){return _0x516602[_0x6d76('0x29')]()[_0x6d76('0x28')](function(){_0x174356['status'](0xcc)[_0x6d76('0x2a')]();});}};}function handleEntityNotFound(_0x10334c,_0x4a6427){return function(_0x118df7){if(!_0x118df7){_0x10334c[_0x6d76('0x1b')](0x194);}return _0x118df7;};}function handleError(_0x56003,_0x3480b7){_0x3480b7=_0x3480b7||0x1f4;return function(_0xb5e0e0){logger['error'](_0xb5e0e0[_0x6d76('0x2b')]);if(_0xb5e0e0[_0x6d76('0x2c')]){delete _0xb5e0e0[_0x6d76('0x2c')];}_0x56003[_0x6d76('0x1c')](_0x3480b7)[_0x6d76('0x2d')](_0xb5e0e0);};}exports[_0x6d76('0x2e')]=function(_0x146e7e,_0x509147){var _0x3a6b2d={},_0x1ff433={},_0x599df5={'count':0x0,'rows':[]};var _0x212a9d=_[_0x6d76('0x2f')](db[_0x6d76('0x30')][_0x6d76('0x31')],function(_0x8bfb93){return{'name':_0x8bfb93['fieldName'],'type':_0x8bfb93[_0x6d76('0x32')]['key']};});_0x1ff433['model']=_[_0x6d76('0x2f')](_0x212a9d,_0x6d76('0x2c'));_0x1ff433[_0x6d76('0x33')]=_[_0x6d76('0x34')](_0x146e7e[_0x6d76('0x33')]);_0x1ff433[_0x6d76('0x35')]=_[_0x6d76('0x36')](_0x1ff433['model'],_0x1ff433[_0x6d76('0x33')]);_0x3a6b2d[_0x6d76('0x37')]=_['intersection'](_0x1ff433['model'],qs[_0x6d76('0x38')](_0x146e7e[_0x6d76('0x33')][_0x6d76('0x38')]));_0x3a6b2d[_0x6d76('0x37')]=_0x3a6b2d[_0x6d76('0x37')][_0x6d76('0x39')]?_0x3a6b2d[_0x6d76('0x37')]:_0x1ff433[_0x6d76('0x3a')];if(!_0x146e7e[_0x6d76('0x33')][_0x6d76('0x3b')](_0x6d76('0x3c'))){_0x3a6b2d['limit']=qs[_0x6d76('0x20')](_0x146e7e[_0x6d76('0x33')]['limit']);_0x3a6b2d[_0x6d76('0x1e')]=qs[_0x6d76('0x1e')](_0x146e7e['query']['offset']);}_0x3a6b2d[_0x6d76('0x3d')]=qs['sort'](_0x146e7e[_0x6d76('0x33')]['sort']);_0x3a6b2d[_0x6d76('0x3e')]=qs[_0x6d76('0x35')](_[_0x6d76('0x3f')](_0x146e7e[_0x6d76('0x33')],_0x1ff433[_0x6d76('0x35')]),_0x212a9d);if(_0x146e7e[_0x6d76('0x33')][_0x6d76('0x40')]){_0x3a6b2d[_0x6d76('0x3e')]=_[_0x6d76('0x41')](_0x3a6b2d['where'],{'$or':_['map'](_0x212a9d,function(_0x170d6d){if(_0x170d6d[_0x6d76('0x32')]!==_0x6d76('0x42')){var _0x5ef65e={};_0x5ef65e[_0x170d6d[_0x6d76('0x2c')]]={'$like':'%'+_0x146e7e['query']['filter']+'%'};return _0x5ef65e;}})});}_0x3a6b2d=_[_0x6d76('0x41')]({},_0x3a6b2d,_0x146e7e[_0x6d76('0x43')]);var _0x8522dd={'where':_0x3a6b2d[_0x6d76('0x3e')]};return db[_0x6d76('0x30')]['count'](_0x8522dd)['then'](function(_0x3d5a27){_0x599df5[_0x6d76('0x21')]=_0x3d5a27;if(_0x146e7e['query'][_0x6d76('0x44')]){_0x3a6b2d[_0x6d76('0x45')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x3a6b2d);})[_0x6d76('0x28')](function(_0x1084af){_0x599df5[_0x6d76('0x46')]=_0x1084af;return _0x599df5;})[_0x6d76('0x28')](respondWithFilteredResult(_0x509147,_0x3a6b2d))[_0x6d76('0x47')](handleError(_0x509147,null));};exports[_0x6d76('0x48')]=function(_0xc7fe07,_0x1a6bc){var _0x1ebff7={'raw':!![],'where':{'id':_0xc7fe07[_0x6d76('0x49')]['id']}},_0x4ee7be={};_0x4ee7be[_0x6d76('0x3a')]=_[_0x6d76('0x34')](db['Dynamics365Field']['rawAttributes']);_0x4ee7be['query']=_[_0x6d76('0x34')](_0xc7fe07['query']);_0x4ee7be['filters']=_[_0x6d76('0x36')](_0x4ee7be[_0x6d76('0x3a')],_0x4ee7be[_0x6d76('0x33')]);_0x1ebff7[_0x6d76('0x37')]=_['intersection'](_0x4ee7be[_0x6d76('0x3a')],qs[_0x6d76('0x38')](_0xc7fe07[_0x6d76('0x33')][_0x6d76('0x38')]));_0x1ebff7[_0x6d76('0x37')]=_0x1ebff7[_0x6d76('0x37')][_0x6d76('0x39')]?_0x1ebff7[_0x6d76('0x37')]:_0x4ee7be['model'];if(_0xc7fe07[_0x6d76('0x33')][_0x6d76('0x44')]){_0x1ebff7[_0x6d76('0x45')]=[{'all':!![]}];}_0x1ebff7=_[_0x6d76('0x41')]({},_0x1ebff7,_0xc7fe07[_0x6d76('0x43')]);return db[_0x6d76('0x30')][_0x6d76('0x4a')](_0x1ebff7)['then'](handleEntityNotFound(_0x1a6bc,null))[_0x6d76('0x28')](respondWithResult(_0x1a6bc,null))['catch'](handleError(_0x1a6bc,null));};exports[_0x6d76('0x4b')]=function(_0xf138b5,_0x485727){return db[_0x6d76('0x30')][_0x6d76('0x4b')](_0xf138b5[_0x6d76('0x4c')],{})[_0x6d76('0x28')](respondWithResult(_0x485727,0xc9))[_0x6d76('0x47')](handleError(_0x485727,null));};exports[_0x6d76('0x27')]=function(_0x16a564,_0x50bcdd){if(_0x16a564[_0x6d76('0x4c')]['id']){delete _0x16a564['body']['id'];}return db[_0x6d76('0x30')][_0x6d76('0x4a')]({'where':{'id':_0x16a564[_0x6d76('0x49')]['id']}})[_0x6d76('0x28')](handleEntityNotFound(_0x50bcdd,null))[_0x6d76('0x28')](saveUpdates(_0x16a564[_0x6d76('0x4c')],null))[_0x6d76('0x28')](respondWithResult(_0x50bcdd,null))[_0x6d76('0x47')](handleError(_0x50bcdd,null));};exports[_0x6d76('0x29')]=function(_0x25b6f0,_0x2f1efb){return db[_0x6d76('0x30')]['find']({'where':{'id':_0x25b6f0[_0x6d76('0x49')]['id']}})[_0x6d76('0x28')](handleEntityNotFound(_0x2f1efb,null))[_0x6d76('0x28')](removeEntity(_0x2f1efb,null))[_0x6d76('0x47')](handleError(_0x2f1efb,null));}; \ No newline at end of file +var _0x4c92=['mustache','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','Dynamics365Field','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','include','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x531c83,_0x41d6ad){var _0x4ec290=function(_0x4cf4bb){while(--_0x4cf4bb){_0x531c83['push'](_0x531c83['shift']());}};_0x4ec290(++_0x41d6ad);}(_0x4c92,0x11f));var _0x24c9=function(_0x4dd014,_0x34d70f){_0x4dd014=_0x4dd014-0x0;var _0x3040ae=_0x4c92[_0x4dd014];return _0x3040ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x24c9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x24c9('0x1'));var rp=require(_0x24c9('0x2'));var moment=require(_0x24c9('0x3'));var BPromise=require(_0x24c9('0x4'));var Mustache=require(_0x24c9('0x5'));var util=require(_0x24c9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x24c9('0x7'));var ejs=require(_0x24c9('0x8'));var fs=require('fs');var fs_extra=require(_0x24c9('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x24c9('0xa'));var jsforce=require(_0x24c9('0xb'));var deskjs=require(_0x24c9('0xc'));var toCsv=require(_0x24c9('0x7'));var querystring=require(_0x24c9('0xd'));var Papa=require(_0x24c9('0xe'));var Redis=require(_0x24c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x24c9('0x10'));var as=require(_0x24c9('0x11'));var hardwareService=require(_0x24c9('0x12'));var logger=require(_0x24c9('0x13'))('api');var utils=require(_0x24c9('0x14'));var config=require(_0x24c9('0x15'));var licenseUtil=require(_0x24c9('0x16'));var db=require(_0x24c9('0x17'))['db'];function respondWithStatusCode(_0x4624cb,_0x454d50){_0x454d50=_0x454d50||0xcc;return function(_0x57bece){if(_0x57bece){return _0x4624cb[_0x24c9('0x18')](_0x454d50);}return _0x4624cb[_0x24c9('0x19')](_0x454d50)[_0x24c9('0x1a')]();};}function respondWithResult(_0x21f687,_0x1d51ba){_0x1d51ba=_0x1d51ba||0xc8;return function(_0x864264){if(_0x864264){return _0x21f687[_0x24c9('0x19')](_0x1d51ba)['json'](_0x864264);}};}function respondWithFilteredResult(_0x38d39a,_0x165b58){return function(_0x41508e){if(_0x41508e){var _0xb3cf42=typeof _0x165b58[_0x24c9('0x1b')]===_0x24c9('0x1c')&&typeof _0x165b58[_0x24c9('0x1d')]===_0x24c9('0x1c');var _0x4e98f3=_0x41508e[_0x24c9('0x1e')];var _0x319a84=_0xb3cf42?0x0:_0x165b58[_0x24c9('0x1b')];var _0x47bf96=_0xb3cf42?_0x41508e[_0x24c9('0x1e')]:_0x165b58[_0x24c9('0x1b')]+_0x165b58[_0x24c9('0x1d')];var _0x3cb6c4;if(_0x47bf96>=_0x4e98f3){_0x47bf96=_0x4e98f3;_0x3cb6c4=0xc8;}else{_0x3cb6c4=0xce;}_0x38d39a[_0x24c9('0x19')](_0x3cb6c4);return _0x38d39a[_0x24c9('0x1f')](_0x24c9('0x20'),_0x319a84+'-'+_0x47bf96+'/'+_0x4e98f3)[_0x24c9('0x21')](_0x41508e);}return null;};}function patchUpdates(_0x3840f6){return function(_0x54e9f2){try{jsonpatch[_0x24c9('0x22')](_0x54e9f2,_0x3840f6,!![]);}catch(_0x140c20){return BPromise[_0x24c9('0x23')](_0x140c20);}return _0x54e9f2[_0x24c9('0x24')]();};}function saveUpdates(_0x216656,_0x5c0f03){return function(_0x441df9){if(_0x441df9){return _0x441df9[_0x24c9('0x25')](_0x216656)[_0x24c9('0x26')](function(_0x4063c9){return _0x4063c9;});}return null;};}function removeEntity(_0x46c990,_0x3cf202){return function(_0x4fcc49){if(_0x4fcc49){return _0x4fcc49[_0x24c9('0x27')]()['then'](function(){_0x46c990[_0x24c9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a827a,_0x36ebd9){return function(_0x39b9b0){if(!_0x39b9b0){_0x1a827a[_0x24c9('0x18')](0x194);}return _0x39b9b0;};}function handleError(_0x20e412,_0x5daf81){_0x5daf81=_0x5daf81||0x1f4;return function(_0x33265b){logger[_0x24c9('0x28')](_0x33265b[_0x24c9('0x29')]);if(_0x33265b[_0x24c9('0x2a')]){delete _0x33265b[_0x24c9('0x2a')];}_0x20e412['status'](_0x5daf81)[_0x24c9('0x2b')](_0x33265b);};}exports['index']=function(_0x587fa6,_0x1f9c40){var _0x56b5ca={},_0x218b19={},_0x1b8854={'count':0x0,'rows':[]};var _0x1c570f=_[_0x24c9('0x2c')](db[_0x24c9('0x2d')][_0x24c9('0x2e')],function(_0x1c9bf3){return{'name':_0x1c9bf3['fieldName'],'type':_0x1c9bf3[_0x24c9('0x2f')]['key']};});_0x218b19[_0x24c9('0x30')]=_[_0x24c9('0x2c')](_0x1c570f,_0x24c9('0x2a'));_0x218b19[_0x24c9('0x31')]=_[_0x24c9('0x32')](_0x587fa6['query']);_0x218b19[_0x24c9('0x33')]=_['intersection'](_0x218b19['model'],_0x218b19[_0x24c9('0x31')]);_0x56b5ca[_0x24c9('0x34')]=_[_0x24c9('0x35')](_0x218b19[_0x24c9('0x30')],qs['fields'](_0x587fa6[_0x24c9('0x31')][_0x24c9('0x36')]));_0x56b5ca[_0x24c9('0x34')]=_0x56b5ca[_0x24c9('0x34')][_0x24c9('0x37')]?_0x56b5ca[_0x24c9('0x34')]:_0x218b19[_0x24c9('0x30')];if(!_0x587fa6[_0x24c9('0x31')]['hasOwnProperty'](_0x24c9('0x38'))){_0x56b5ca[_0x24c9('0x1d')]=qs[_0x24c9('0x1d')](_0x587fa6[_0x24c9('0x31')][_0x24c9('0x1d')]);_0x56b5ca[_0x24c9('0x1b')]=qs['offset'](_0x587fa6['query']['offset']);}_0x56b5ca[_0x24c9('0x39')]=qs[_0x24c9('0x3a')](_0x587fa6['query'][_0x24c9('0x3a')]);_0x56b5ca[_0x24c9('0x3b')]=qs[_0x24c9('0x33')](_[_0x24c9('0x3c')](_0x587fa6['query'],_0x218b19[_0x24c9('0x33')]),_0x1c570f);if(_0x587fa6[_0x24c9('0x31')][_0x24c9('0x3d')]){_0x56b5ca['where']=_[_0x24c9('0x3e')](_0x56b5ca['where'],{'$or':_[_0x24c9('0x2c')](_0x1c570f,function(_0x55e451){if(_0x55e451[_0x24c9('0x2f')]!==_0x24c9('0x3f')){var _0x5cfc14={};_0x5cfc14[_0x55e451[_0x24c9('0x2a')]]={'$like':'%'+_0x587fa6['query'][_0x24c9('0x3d')]+'%'};return _0x5cfc14;}})});}_0x56b5ca=_[_0x24c9('0x3e')]({},_0x56b5ca,_0x587fa6[_0x24c9('0x40')]);var _0x5105a0={'where':_0x56b5ca[_0x24c9('0x3b')]};return db[_0x24c9('0x2d')][_0x24c9('0x1e')](_0x5105a0)['then'](function(_0x34e7d6){_0x1b8854[_0x24c9('0x1e')]=_0x34e7d6;if(_0x587fa6[_0x24c9('0x31')]['includeAll']){_0x56b5ca['include']=[{'all':!![]}];}return db[_0x24c9('0x2d')]['findAll'](_0x56b5ca);})[_0x24c9('0x26')](function(_0x460d83){_0x1b8854[_0x24c9('0x41')]=_0x460d83;return _0x1b8854;})[_0x24c9('0x26')](respondWithFilteredResult(_0x1f9c40,_0x56b5ca))[_0x24c9('0x42')](handleError(_0x1f9c40,null));};exports[_0x24c9('0x43')]=function(_0xf767f7,_0x58831e){var _0x247732={'raw':!![],'where':{'id':_0xf767f7[_0x24c9('0x44')]['id']}},_0x3822fa={};_0x3822fa[_0x24c9('0x30')]=_[_0x24c9('0x32')](db[_0x24c9('0x2d')][_0x24c9('0x2e')]);_0x3822fa[_0x24c9('0x31')]=_[_0x24c9('0x32')](_0xf767f7[_0x24c9('0x31')]);_0x3822fa[_0x24c9('0x33')]=_[_0x24c9('0x35')](_0x3822fa['model'],_0x3822fa[_0x24c9('0x31')]);_0x247732[_0x24c9('0x34')]=_['intersection'](_0x3822fa[_0x24c9('0x30')],qs[_0x24c9('0x36')](_0xf767f7[_0x24c9('0x31')][_0x24c9('0x36')]));_0x247732['attributes']=_0x247732[_0x24c9('0x34')][_0x24c9('0x37')]?_0x247732[_0x24c9('0x34')]:_0x3822fa[_0x24c9('0x30')];if(_0xf767f7[_0x24c9('0x31')]['includeAll']){_0x247732[_0x24c9('0x45')]=[{'all':!![]}];}_0x247732=_['merge']({},_0x247732,_0xf767f7[_0x24c9('0x40')]);return db[_0x24c9('0x2d')][_0x24c9('0x46')](_0x247732)[_0x24c9('0x26')](handleEntityNotFound(_0x58831e,null))['then'](respondWithResult(_0x58831e,null))[_0x24c9('0x42')](handleError(_0x58831e,null));};exports['create']=function(_0x122897,_0x4fecc1){return db[_0x24c9('0x2d')][_0x24c9('0x47')](_0x122897[_0x24c9('0x48')],{})[_0x24c9('0x26')](respondWithResult(_0x4fecc1,0xc9))['catch'](handleError(_0x4fecc1,null));};exports[_0x24c9('0x25')]=function(_0x573730,_0x475059){if(_0x573730[_0x24c9('0x48')]['id']){delete _0x573730[_0x24c9('0x48')]['id'];}return db[_0x24c9('0x2d')]['find']({'where':{'id':_0x573730[_0x24c9('0x44')]['id']}})[_0x24c9('0x26')](handleEntityNotFound(_0x475059,null))[_0x24c9('0x26')](saveUpdates(_0x573730[_0x24c9('0x48')],null))[_0x24c9('0x26')](respondWithResult(_0x475059,null))['catch'](handleError(_0x475059,null));};exports[_0x24c9('0x27')]=function(_0x2b09cc,_0x428217){return db[_0x24c9('0x2d')][_0x24c9('0x46')]({'where':{'id':_0x2b09cc[_0x24c9('0x44')]['id']}})[_0x24c9('0x26')](handleEntityNotFound(_0x428217,null))[_0x24c9('0x26')](removeEntity(_0x428217,null))[_0x24c9('0x42')](handleError(_0x428217,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 844804a..7f02748 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 _0x65e2=['../../config/environment','./intDynamics365Field.attributes','exports','dynamics365_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x6b1b0e,_0x1123b5){var _0x3967ce=function(_0x465bba){while(--_0x465bba){_0x6b1b0e['push'](_0x6b1b0e['shift']());}};_0x3967ce(++_0x1123b5);}(_0x65e2,0xad));var _0x265e=function(_0x23103a,_0x444e3f){_0x23103a=_0x23103a-0x0;var _0x56bcc6=_0x65e2[_0x23103a];return _0x56bcc6;};'use strict';var _=require(_0x265e('0x0'));var util=require(_0x265e('0x1'));var logger=require(_0x265e('0x2'))(_0x265e('0x3'));var moment=require(_0x265e('0x4'));var BPromise=require(_0x265e('0x5'));var rp=require(_0x265e('0x6'));var fs=require('fs');var path=require(_0x265e('0x7'));var rimraf=require(_0x265e('0x8'));var config=require(_0x265e('0x9'));var attributes=require(_0x265e('0xa'));module[_0x265e('0xb')]=function(_0x44a00f,_0x1e9307){return _0x44a00f['define']('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x265e('0xc'),'fields':['idField',_0x265e('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b4f=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash'];(function(_0x236ed6,_0x562e24){var _0x2507e4=function(_0x1fdd4b){while(--_0x1fdd4b){_0x236ed6['push'](_0x236ed6['shift']());}};_0x2507e4(++_0x562e24);}(_0x1b4f,0x1d3));var _0xf1b4=function(_0x2781e5,_0x3a5b8d){_0x2781e5=_0x2781e5-0x0;var _0x4920d1=_0x1b4f[_0x2781e5];return _0x4920d1;};'use strict';var _=require(_0xf1b4('0x0'));var util=require('util');var logger=require(_0xf1b4('0x1'))(_0xf1b4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf1b4('0x3'));var fs=require('fs');var path=require(_0xf1b4('0x4'));var rimraf=require(_0xf1b4('0x5'));var config=require(_0xf1b4('0x6'));var attributes=require(_0xf1b4('0x7'));module['exports']=function(_0x3e7904,_0x1e0953){return _0x3e7904[_0xf1b4('0x8')]('Dynamics365Field',attributes,{'tableName':_0xf1b4('0x9'),'paranoid':![],'indexes':[{'name':_0xf1b4('0xa'),'fields':[_0xf1b4('0xb'),_0xf1b4('0xc')],'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 87cc4da..b1e6715 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 _0x29cb=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x29cb,0x199));var _0xb29c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x29cb[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0xb29c('0x0'));var moment=require(_0xb29c('0x1'));var BPromise=require(_0xb29c('0x2'));var rs=require(_0xb29c('0x3'));var fs=require('fs');var Redis=require(_0xb29c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb29c('0x5'));var logger=require(_0xb29c('0x6'))('rpc');var config=require(_0xb29c('0x7'));var jayson=require(_0xb29c('0x8'));var client=jayson[_0xb29c('0x9')][_0xb29c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3427e1,_0x24ecdc,_0x15c749){return new BPromise(function(_0x3747a3,_0x387dc5){return client[_0xb29c('0xb')](_0x3427e1,_0x15c749)[_0xb29c('0xc')](function(_0x1ade98){logger[_0xb29c('0xd')](_0xb29c('0xe'),_0x24ecdc,_0xb29c('0xf'));logger[_0xb29c('0x10')](_0xb29c('0x11'),_0x24ecdc,'request\x20sent',JSON[_0xb29c('0x12')](_0x1ade98));if(_0x1ade98[_0xb29c('0x13')]){if(_0x1ade98['error']['code']===0x1f4){logger[_0xb29c('0x13')](_0xb29c('0xe'),_0x24ecdc,_0x1ade98[_0xb29c('0x13')][_0xb29c('0x14')]);return _0x387dc5(_0x1ade98[_0xb29c('0x13')][_0xb29c('0x14')]);}logger[_0xb29c('0x13')](_0xb29c('0xe'),_0x24ecdc,_0x1ade98[_0xb29c('0x13')][_0xb29c('0x14')]);return _0x3747a3(_0x1ade98[_0xb29c('0x13')]['message']);}else{logger[_0xb29c('0xd')](_0xb29c('0xe'),_0x24ecdc,_0xb29c('0xf'));_0x3747a3(_0x1ade98[_0xb29c('0x15')][_0xb29c('0x14')]);}})[_0xb29c('0x16')](function(_0xd94272){logger['error'](_0xb29c('0xe'),_0x24ecdc,_0xd94272);_0x387dc5(_0xd94272);});});} \ No newline at end of file +var _0xa94f=['then','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x5339e6,_0xd921cf){var _0x5f298d=function(_0x12e17b){while(--_0x12e17b){_0x5339e6['push'](_0x5339e6['shift']());}};_0x5f298d(++_0xd921cf);}(_0xa94f,0x1d5));var _0xfa94=function(_0x2966f6,_0x9550cd){_0x2966f6=_0x2966f6-0x0;var _0x36c4b3=_0xa94f[_0x2966f6];return _0x36c4b3;};'use strict';var _=require(_0xfa94('0x0'));var util=require(_0xfa94('0x1'));var moment=require(_0xfa94('0x2'));var BPromise=require(_0xfa94('0x3'));var rs=require(_0xfa94('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfa94('0x5'));var logger=require(_0xfa94('0x6'))(_0xfa94('0x7'));var config=require('../../config/environment');var jayson=require(_0xfa94('0x8'));var client=jayson[_0xfa94('0x9')][_0xfa94('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa1dde,_0x1c8487,_0x4869b3){return new BPromise(function(_0x81ad55,_0x30f8b5){return client['request'](_0xa1dde,_0x4869b3)[_0xfa94('0xb')](function(_0x15f7bd){logger['info'](_0xfa94('0xc'),_0x1c8487,'request\x20sent');logger[_0xfa94('0xd')](_0xfa94('0xe'),_0x1c8487,_0xfa94('0xf'),JSON[_0xfa94('0x10')](_0x15f7bd));if(_0x15f7bd[_0xfa94('0x11')]){if(_0x15f7bd[_0xfa94('0x11')]['code']===0x1f4){logger[_0xfa94('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x1c8487,_0x15f7bd[_0xfa94('0x11')]['message']);return _0x30f8b5(_0x15f7bd[_0xfa94('0x11')][_0xfa94('0x12')]);}logger[_0xfa94('0x11')](_0xfa94('0xc'),_0x1c8487,_0x15f7bd['error'][_0xfa94('0x12')]);return _0x81ad55(_0x15f7bd['error'][_0xfa94('0x12')]);}else{logger['info'](_0xfa94('0xc'),_0x1c8487,_0xfa94('0xf'));_0x81ad55(_0x15f7bd[_0xfa94('0x13')][_0xfa94('0x12')]);}})['catch'](function(_0x1ba389){logger[_0xfa94('0x11')](_0xfa94('0xc'),_0x1c8487,_0x1ba389);_0x30f8b5(_0x1ba389);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 768bafd..1fd53be 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 _0xd41a=['index','/:id/configurations','getConfigurations','isAuthenticated','getFields','post','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get'];(function(_0x3a826f,_0x47b9a1){var _0x14d1b0=function(_0x51e878){while(--_0x51e878){_0x3a826f['push'](_0x3a826f['shift']());}};_0x14d1b0(++_0x47b9a1);}(_0xd41a,0x1c2));var _0xad41=function(_0x3f0b15,_0x29a0c6){_0x3f0b15=_0x3f0b15-0x0;var _0x371196=_0xd41a[_0x3f0b15];return _0x371196;};'use strict';var multer=require('multer');var util=require(_0xad41('0x0'));var path=require(_0xad41('0x1'));var timeout=require(_0xad41('0x2'));var express=require(_0xad41('0x3'));var router=express[_0xad41('0x4')]();var fs_extra=require(_0xad41('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xad41('0x6'));var config=require(_0xad41('0x7'));var controller=require(_0xad41('0x8'));router[_0xad41('0x9')]('/',auth['isAuthenticated'](),controller[_0xad41('0xa')]);router[_0xad41('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xad41('0x9')](_0xad41('0xb'),auth['isAuthenticated'](),controller[_0xad41('0xc')]);router['get']('/:id/fields',auth[_0xad41('0xd')](),controller[_0xad41('0xe')]);router[_0xad41('0xf')]('/',auth[_0xad41('0xd')](),controller['create']);router[_0xad41('0xf')](_0xad41('0xb'),auth[_0xad41('0xd')](),controller[_0xad41('0x10')]);router[_0xad41('0x11')](_0xad41('0x12'),auth[_0xad41('0xd')](),controller[_0xad41('0x13')]);router[_0xad41('0x14')](_0xad41('0x12'),auth[_0xad41('0xd')](),controller[_0xad41('0x15')]);module[_0xad41('0x16')]=router; \ No newline at end of file +var _0x9e55=['isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9e55,0x195));var _0x59e5=function(_0x589dc7,_0x96e756){_0x589dc7=_0x589dc7-0x0;var _0x2a999a=_0x9e55[_0x589dc7];return _0x2a999a;};'use strict';var multer=require(_0x59e5('0x0'));var util=require('util');var path=require(_0x59e5('0x1'));var timeout=require(_0x59e5('0x2'));var express=require(_0x59e5('0x3'));var router=express[_0x59e5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x59e5('0x5'));var interaction=require(_0x59e5('0x6'));var config=require(_0x59e5('0x7'));var controller=require(_0x59e5('0x8'));router['get']('/',auth[_0x59e5('0x9')](),controller['index']);router[_0x59e5('0xa')](_0x59e5('0xb'),auth[_0x59e5('0x9')](),controller[_0x59e5('0xc')]);router[_0x59e5('0xa')](_0x59e5('0xd'),auth[_0x59e5('0x9')](),controller[_0x59e5('0xe')]);router[_0x59e5('0xa')](_0x59e5('0xf'),auth[_0x59e5('0x9')](),controller[_0x59e5('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x59e5('0x11')]);router[_0x59e5('0x12')](_0x59e5('0xd'),auth[_0x59e5('0x9')](),controller['addConfiguration']);router[_0x59e5('0x13')]('/:id',auth[_0x59e5('0x9')](),controller[_0x59e5('0x14')]);router['delete'](_0x59e5('0xb'),auth[_0x59e5('0x9')](),controller[_0x59e5('0x15')]);module[_0x59e5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 3cf0aa1..ab3f316 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 _0xd824=['exports','STRING','username','remoteUri','sequelize'];(function(_0x20448a,_0x23db6b){var _0x10f231=function(_0x16c0fb){while(--_0x16c0fb){_0x20448a['push'](_0x20448a['shift']());}};_0x10f231(++_0x23db6b);}(_0xd824,0xc2));var _0x4d82=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd824[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x4d82('0x0'));module[_0x4d82('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x3')},'apiKey':{'type':Sequelize[_0x4d82('0x2')]},'remoteUri':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x4')},'serverUrl':{'type':Sequelize[_0x4d82('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3a6d=['exports','STRING','username','sequelize'];(function(_0x4310e8,_0x3ba783){var _0x301445=function(_0x5907ee){while(--_0x5907ee){_0x4310e8['push'](_0x4310e8['shift']());}};_0x301445(++_0x3ba783);}(_0x3a6d,0x143));var _0xd3a6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3a6d[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xd3a6('0x0'));module[_0xd3a6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd3a6('0x2')]},'username':{'type':Sequelize[_0xd3a6('0x2')],'unique':_0xd3a6('0x3')},'apiKey':{'type':Sequelize[_0xd3a6('0x2')]},'remoteUri':{'type':Sequelize[_0xd3a6('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xd3a6('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 ab5dfb0..40ac1f4 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 _0x765b=['path','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','name','index','FreshdeskAccount','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','include','findAll','catch','show','find','create','body','update','getConfigurations','findOne','params','hasOwnProperty','addConfiguration','Subjects','Descriptions','channel','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s:X','toString','requester','subject','agent','priority','group','source','ticket_type','remove','includes','custom_text','custom_dropdown','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','fast-json-patch','moment','mustache','util'];(function(_0x2e6069,_0x17642f){var _0x47627e=function(_0x172877){while(--_0x172877){_0x2e6069['push'](_0x2e6069['shift']());}};_0x47627e(++_0x17642f);}(_0x765b,0x18c));var _0xb765=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x765b[_0x2d8fc2];return _0x3a9e53;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb765('0x0'));var rp=require('request-promise');var moment=require(_0xb765('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xb765('0x2'));var util=require(_0xb765('0x3'));var path=require(_0xb765('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb765('0x5'));var squel=require('squel');var crypto=require(_0xb765('0x6'));var jsforce=require(_0xb765('0x7'));var deskjs=require(_0xb765('0x8'));var toCsv=require('to-csv');var querystring=require(_0xb765('0x9'));var Papa=require(_0xb765('0xa'));var Redis=require(_0xb765('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb765('0xc'));var logger=require(_0xb765('0xd'))(_0xb765('0xe'));var utils=require(_0xb765('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xb765('0x10'));var db=require(_0xb765('0x11'))['db'];var integrations=require(_0xb765('0x12'));function respondWithStatusCode(_0x3f9acb,_0x38ee06){_0x38ee06=_0x38ee06||0xcc;return function(_0xadac12){if(_0xadac12){return _0x3f9acb[_0xb765('0x13')](_0x38ee06);}return _0x3f9acb[_0xb765('0x14')](_0x38ee06)[_0xb765('0x15')]();};}function respondWithResult(_0x4d8eff,_0x2aebdb){_0x2aebdb=_0x2aebdb||0xc8;return function(_0x5d8852){if(_0x5d8852){return _0x4d8eff[_0xb765('0x14')](_0x2aebdb)[_0xb765('0x16')](_0x5d8852);}};}function respondWithFilteredResult(_0x4cecc1,_0x4b8e26){return function(_0x3f73f4){if(_0x3f73f4){var _0x2ab6b8=typeof _0x4b8e26[_0xb765('0x17')]===_0xb765('0x18')&&typeof _0x4b8e26[_0xb765('0x19')]===_0xb765('0x18');var _0x9bd542=_0x3f73f4[_0xb765('0x1a')];var _0x5c182f=_0x2ab6b8?0x0:_0x4b8e26[_0xb765('0x17')];var _0x132aab=_0x2ab6b8?_0x3f73f4[_0xb765('0x1a')]:_0x4b8e26[_0xb765('0x17')]+_0x4b8e26[_0xb765('0x19')];var _0x360b9e;if(_0x132aab>=_0x9bd542){_0x132aab=_0x9bd542;_0x360b9e=0xc8;}else{_0x360b9e=0xce;}_0x4cecc1[_0xb765('0x14')](_0x360b9e);return _0x4cecc1[_0xb765('0x1b')](_0xb765('0x1c'),_0x5c182f+'-'+_0x132aab+'/'+_0x9bd542)[_0xb765('0x16')](_0x3f73f4);}return null;};}function patchUpdates(_0x44936d){return function(_0x1b1184){try{jsonpatch['apply'](_0x1b1184,_0x44936d,!![]);}catch(_0x5d72a1){return BPromise[_0xb765('0x1d')](_0x5d72a1);}return _0x1b1184['save']();};}function saveUpdates(_0x3d69c7,_0x2e0196){return function(_0x461da8){if(_0x461da8){return _0x461da8['update'](_0x3d69c7)[_0xb765('0x1e')](function(_0x1a740c){return _0x1a740c;});}return null;};}function removeEntity(_0x5d1ea0,_0x3a05b1){return function(_0x3684e8){if(_0x3684e8){return _0x3684e8[_0xb765('0x1f')]()[_0xb765('0x1e')](function(){_0x5d1ea0['status'](0xcc)[_0xb765('0x15')]();});}};}function handleEntityNotFound(_0x6a5457,_0x4e12b8){return function(_0x4dc7d1){if(!_0x4dc7d1){_0x6a5457[_0xb765('0x13')](0x194);}return _0x4dc7d1;};}function handleError(_0x4715d7,_0x1c561a){_0x1c561a=_0x1c561a||0x1f4;return function(_0x562bd3){logger['error'](_0x562bd3['stack']);if(_0x562bd3[_0xb765('0x20')]){delete _0x562bd3[_0xb765('0x20')];}_0x4715d7[_0xb765('0x14')](_0x1c561a)['send'](_0x562bd3);};}exports[_0xb765('0x21')]=function(_0x3c7206,_0x48a84a){var _0x2842c2={},_0xe9f0b9={},_0x439162={'count':0x0,'rows':[]};var _0x5ce321=_['map'](db[_0xb765('0x22')][_0xb765('0x23')],function(_0x1d8970){return{'name':_0x1d8970['fieldName'],'type':_0x1d8970[_0xb765('0x24')][_0xb765('0x25')]};});_0xe9f0b9['model']=_['map'](_0x5ce321,_0xb765('0x20'));_0xe9f0b9[_0xb765('0x26')]=_[_0xb765('0x27')](_0x3c7206[_0xb765('0x26')]);_0xe9f0b9[_0xb765('0x28')]=_[_0xb765('0x29')](_0xe9f0b9[_0xb765('0x2a')],_0xe9f0b9['query']);_0x2842c2[_0xb765('0x2b')]=_[_0xb765('0x29')](_0xe9f0b9[_0xb765('0x2a')],qs[_0xb765('0x2c')](_0x3c7206['query']['fields']));_0x2842c2['attributes']=_0x2842c2[_0xb765('0x2b')][_0xb765('0x2d')]?_0x2842c2['attributes']:_0xe9f0b9[_0xb765('0x2a')];if(!_0x3c7206['query']['hasOwnProperty'](_0xb765('0x2e'))){_0x2842c2[_0xb765('0x19')]=qs['limit'](_0x3c7206[_0xb765('0x26')][_0xb765('0x19')]);_0x2842c2['offset']=qs[_0xb765('0x17')](_0x3c7206[_0xb765('0x26')][_0xb765('0x17')]);}_0x2842c2[_0xb765('0x2f')]=qs[_0xb765('0x30')](_0x3c7206[_0xb765('0x26')][_0xb765('0x30')]);_0x2842c2[_0xb765('0x31')]=qs['filters'](_[_0xb765('0x32')](_0x3c7206[_0xb765('0x26')],_0xe9f0b9['filters']),_0x5ce321);if(_0x3c7206[_0xb765('0x26')]['filter']){_0x2842c2[_0xb765('0x31')]=_[_0xb765('0x33')](_0x2842c2['where'],{'$or':_[_0xb765('0x34')](_0x5ce321,function(_0x19dbf4){if(_0x19dbf4['type']!=='VIRTUAL'){var _0x21c90e={};_0x21c90e[_0x19dbf4[_0xb765('0x20')]]={'$like':'%'+_0x3c7206[_0xb765('0x26')][_0xb765('0x35')]+'%'};return _0x21c90e;}})});}_0x2842c2=_['merge']({},_0x2842c2,_0x3c7206[_0xb765('0x36')]);var _0x25a243={'where':_0x2842c2[_0xb765('0x31')]};return db['FreshdeskAccount'][_0xb765('0x1a')](_0x25a243)[_0xb765('0x1e')](function(_0x3a46d9){_0x439162[_0xb765('0x1a')]=_0x3a46d9;if(_0x3c7206['query'][_0xb765('0x37')]){_0x2842c2[_0xb765('0x38')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xb765('0x39')](_0x2842c2);})[_0xb765('0x1e')](function(_0x29a469){_0x439162['rows']=_0x29a469;return _0x439162;})['then'](respondWithFilteredResult(_0x48a84a,_0x2842c2))[_0xb765('0x3a')](handleError(_0x48a84a,null));};exports[_0xb765('0x3b')]=function(_0x542372,_0x42a715){var _0x516b98={'raw':![],'where':{'id':_0x542372['params']['id']}},_0x4a0bd5={};_0x4a0bd5['model']=_[_0xb765('0x27')](db[_0xb765('0x22')][_0xb765('0x23')]);_0x4a0bd5[_0xb765('0x26')]=_[_0xb765('0x27')](_0x542372['query']);_0x4a0bd5[_0xb765('0x28')]=_[_0xb765('0x29')](_0x4a0bd5['model'],_0x4a0bd5[_0xb765('0x26')]);_0x516b98[_0xb765('0x2b')]=_['intersection'](_0x4a0bd5[_0xb765('0x2a')],qs[_0xb765('0x2c')](_0x542372[_0xb765('0x26')][_0xb765('0x2c')]));_0x516b98[_0xb765('0x2b')]=_0x516b98[_0xb765('0x2b')][_0xb765('0x2d')]?_0x516b98[_0xb765('0x2b')]:_0x4a0bd5[_0xb765('0x2a')];if(_0x542372['query'][_0xb765('0x37')]){_0x516b98[_0xb765('0x38')]=[{'all':!![]}];}_0x516b98=_[_0xb765('0x33')]({},_0x516b98,_0x542372['options']);return db['FreshdeskAccount'][_0xb765('0x3c')](_0x516b98)['then'](handleEntityNotFound(_0x42a715,null))[_0xb765('0x1e')](respondWithResult(_0x42a715,null))[_0xb765('0x3a')](handleError(_0x42a715,null));};exports['create']=function(_0x12eff7,_0x164dc9){return db[_0xb765('0x22')][_0xb765('0x3d')](_0x12eff7[_0xb765('0x3e')],{})[_0xb765('0x1e')](respondWithResult(_0x164dc9,0xc9))['catch'](handleError(_0x164dc9,null));};exports[_0xb765('0x3f')]=function(_0x2540fc,_0x7ae096){if(_0x2540fc[_0xb765('0x3e')]['id']){delete _0x2540fc[_0xb765('0x3e')]['id'];}return db[_0xb765('0x22')][_0xb765('0x3c')]({'where':{'id':_0x2540fc['params']['id']}})[_0xb765('0x1e')](handleEntityNotFound(_0x7ae096,null))['then'](saveUpdates(_0x2540fc[_0xb765('0x3e')],null))[_0xb765('0x1e')](respondWithResult(_0x7ae096,null))[_0xb765('0x3a')](handleError(_0x7ae096,null));};exports[_0xb765('0x1f')]=function(_0x5f37de,_0x41d67e){return db['FreshdeskAccount'][_0xb765('0x3c')]({'where':{'id':_0x5f37de['params']['id']}})[_0xb765('0x1e')](handleEntityNotFound(_0x41d67e,null))['then'](removeEntity(_0x41d67e,null))['catch'](handleError(_0x41d67e,null));};exports[_0xb765('0x40')]=function(_0x580a3d,_0x46a585,_0x405be7){var _0x39c4ca={};var _0x27cd8f={};var _0x14c3b0;var _0x3c9ace;return db['FreshdeskAccount'][_0xb765('0x41')]({'where':{'id':_0x580a3d[_0xb765('0x42')]['id']}})[_0xb765('0x1e')](handleEntityNotFound(_0x46a585,null))[_0xb765('0x1e')](function(_0x334e43){if(_0x334e43){_0x14c3b0=_0x334e43;_0x27cd8f[_0xb765('0x2a')]=_[_0xb765('0x27')](db['FreshdeskConfiguration'][_0xb765('0x23')]);_0x27cd8f[_0xb765('0x26')]=_['keys'](_0x580a3d['query']);_0x27cd8f[_0xb765('0x28')]=_[_0xb765('0x29')](_0x27cd8f[_0xb765('0x2a')],_0x27cd8f[_0xb765('0x26')]);_0x39c4ca[_0xb765('0x2b')]=_[_0xb765('0x29')](_0x27cd8f['model'],qs['fields'](_0x580a3d['query'][_0xb765('0x2c')]));_0x39c4ca[_0xb765('0x2b')]=_0x39c4ca['attributes'][_0xb765('0x2d')]?_0x39c4ca['attributes']:_0x27cd8f[_0xb765('0x2a')];_0x39c4ca[_0xb765('0x2f')]=qs[_0xb765('0x30')](_0x580a3d[_0xb765('0x26')][_0xb765('0x30')]);_0x39c4ca['where']=qs[_0xb765('0x28')](_[_0xb765('0x32')](_0x580a3d[_0xb765('0x26')],_0x27cd8f[_0xb765('0x28')]));if(_0x580a3d[_0xb765('0x26')][_0xb765('0x35')]){_0x39c4ca[_0xb765('0x31')]=_[_0xb765('0x33')](_0x39c4ca[_0xb765('0x31')],{'$or':_['map'](_0x39c4ca[_0xb765('0x2b')],function(_0x40a98a){var _0x3e76e2={};_0x3e76e2[_0x40a98a]={'$like':'%'+_0x580a3d[_0xb765('0x26')]['filter']+'%'};return _0x3e76e2;})});}_0x39c4ca=_[_0xb765('0x33')]({},_0x39c4ca,_0x580a3d[_0xb765('0x36')]);return _0x14c3b0['getConfigurations'](_0x39c4ca);}})[_0xb765('0x1e')](function(_0xd589c5){if(_0xd589c5){_0x3c9ace=_0xd589c5[_0xb765('0x2d')];if(!_0x580a3d[_0xb765('0x26')][_0xb765('0x43')]('nolimit')){_0x39c4ca[_0xb765('0x19')]=qs[_0xb765('0x19')](_0x580a3d[_0xb765('0x26')]['limit']);_0x39c4ca['offset']=qs[_0xb765('0x17')](_0x580a3d[_0xb765('0x26')][_0xb765('0x17')]);}return _0x14c3b0['getConfigurations'](_0x39c4ca);}})[_0xb765('0x1e')](function(_0x1e6b28){if(_0x1e6b28){return _0x1e6b28?{'count':_0x3c9ace,'rows':_0x1e6b28}:null;}})[_0xb765('0x1e')](respondWithResult(_0x46a585,null))[_0xb765('0x3a')](handleError(_0x46a585,null));};exports[_0xb765('0x44')]=function(_0x4a5a24,_0x1b3d82,_0x2a7296){if(_0x4a5a24[_0xb765('0x3e')]['id']){delete _0x4a5a24['body']['id'];}return db[_0xb765('0x22')][_0xb765('0x41')]({'where':{'id':_0x4a5a24[_0xb765('0x42')]['id']}})['then'](handleEntityNotFound(_0x1b3d82,null))[_0xb765('0x1e')](function(_0xf8ed84){if(_0xf8ed84){_0x4a5a24[_0xb765('0x3e')]['AccountId']=_0xf8ed84['id'];_0x4a5a24['body'][_0xb765('0x45')]=integrations['getSubjects'](_0x4a5a24['body']['channel'],_0x4a5a24[_0xb765('0x3e')]['type']);_0x4a5a24[_0xb765('0x3e')][_0xb765('0x46')]=integrations['getDescriptions'](_0x4a5a24[_0xb765('0x3e')][_0xb765('0x47')],_0x4a5a24['body'][_0xb765('0x24')]);return db[_0xb765('0x48')][_0xb765('0x3d')](_0x4a5a24[_0xb765('0x3e')],{'include':[{'model':db[_0xb765('0x49')],'as':_0xb765('0x45')},{'model':db['FreshdeskField'],'as':_0xb765('0x46')}]});}return null;})['then'](respondWithResult(_0x1b3d82,null))[_0xb765('0x3a')](handleError(_0x1b3d82,null));};exports[_0xb765('0x4a')]=function(_0x457bc9,_0x58be22,_0x35dc72){var _0x497d66='';return db[_0xb765('0x22')][_0xb765('0x41')]({'where':{'id':_0x457bc9['params']['id']},'attributes':['id',_0xb765('0x4b'),_0xb765('0x4c')]})[_0xb765('0x1e')](handleEntityNotFound(_0x58be22,null))['then'](function(_0x2b15b9){if(_0x2b15b9){_0x497d66=_0x2b15b9['remoteUri'];var _0x35735d=_0x497d66[_0xb765('0x4d')](-0x1);if(_0x35735d==='/'){_0x497d66=_0x497d66[_0xb765('0x4e')](0x0,_0x497d66[_0xb765('0x4f')](_0x35735d));}return rp({'method':_0xb765('0x50'),'uri':util['format']('%s/%s',_0x497d66,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xb765('0x51')]('Basic\x20%s',new Buffer(util[_0xb765('0x51')](_0xb765('0x52'),_0x2b15b9[_0xb765('0x4c')]))[_0xb765('0x53')]('base64'))},'json':!![]});}})['then'](function(_0x16b20c){if(_0x16b20c){var _0x2654cd=[_0xb765('0x54'),_0xb765('0x55'),_0xb765('0x56'),'description',_0xb765('0x14'),_0xb765('0x57'),_0xb765('0x58'),_0xb765('0x59'),_0xb765('0x5a'),_0xb765('0x58'),'company'];_[_0xb765('0x5b')](_0x16b20c,function(_0x3a152a){return _0x2654cd[_0xb765('0x5c')](_0x3a152a[_0xb765('0x20')])||!_0x3a152a['default']&&_0x3a152a['type']!==_0xb765('0x5d')&&_0x3a152a[_0xb765('0x24')]!==_0xb765('0x5e');});return{'count':_0x16b20c[_0xb765('0x2d')],'rows':_['map'](_0x16b20c,function(_0x46a5e6){return{'id':_0x46a5e6['name'],'name':_0x46a5e6['label'],'custom':!_0x46a5e6['default'],'options':_0x46a5e6[_0xb765('0x5f')]?_[_0xb765('0x34')](_0x46a5e6['choices'],function(_0x10e9cb){return{'name':_['capitalize'](_0x10e9cb),'value':_0x10e9cb};}):[]};})};}})[_0xb765('0x1e')](respondWithResult(_0x58be22,null))['catch'](function(_0x3da051){var _0x375223=_0x457bc9[_0xb765('0x26')][_0xb765('0x60')]?0x1f4:_0x3da051[_0xb765('0x61')]||0x1f4;logger['error'](_0xb765('0x62'),_0xb765('0x4a'),_0x375223,JSON['stringify'](_0x3da051));delete _0x3da051[_0xb765('0x20')];if(_0x375223===0x191){_0x375223=0x190;}_0x58be22[_0xb765('0x14')](_0x375223)['send'](_0x457bc9['query'][_0xb765('0x60')]?{'message':_0xb765('0x63'),'statusCode':_0x3da051[_0xb765('0x61')]}:_0x3da051);});}; \ No newline at end of file +var _0xffdc=['default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','FreshdeskAccount','rawAttributes','type','key','map','name','keys','filters','intersection','query','model','fields','attributes','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','findOne','FreshdeskConfiguration','getConfigurations','hasOwnProperty','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','description','priority','group','source','company','remove','includes'];(function(_0x47be3e,_0x114ec9){var _0x25b97b=function(_0x4a8c48){while(--_0x4a8c48){_0x47be3e['push'](_0x47be3e['shift']());}};_0x25b97b(++_0x114ec9);}(_0xffdc,0x7f));var _0xcffd=function(_0x228540,_0x31248d){_0x228540=_0x228540-0x0;var _0x6e8c86=_0xffdc[_0x228540];return _0x6e8c86;};'use strict';var emlformat=require(_0xcffd('0x0'));var rimraf=require(_0xcffd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcffd('0x2'));var rp=require(_0xcffd('0x3'));var moment=require('moment');var BPromise=require(_0xcffd('0x4'));var Mustache=require(_0xcffd('0x5'));var util=require(_0xcffd('0x6'));var path=require(_0xcffd('0x7'));var sox=require(_0xcffd('0x8'));var csv=require('to-csv');var ejs=require(_0xcffd('0x9'));var fs=require('fs');var fs_extra=require(_0xcffd('0xa'));var _=require(_0xcffd('0xb'));var squel=require(_0xcffd('0xc'));var crypto=require(_0xcffd('0xd'));var jsforce=require(_0xcffd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcffd('0xf'));var querystring=require(_0xcffd('0x10'));var Papa=require('papaparse');var Redis=require(_0xcffd('0x11'));var authService=require(_0xcffd('0x12'));var qs=require(_0xcffd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcffd('0x14'));var logger=require(_0xcffd('0x15'))(_0xcffd('0x16'));var utils=require(_0xcffd('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcffd('0x18'))['db'];var integrations=require(_0xcffd('0x19'));function respondWithStatusCode(_0x1340b0,_0x4ec693){_0x4ec693=_0x4ec693||0xcc;return function(_0x25156f){if(_0x25156f){return _0x1340b0['sendStatus'](_0x4ec693);}return _0x1340b0['status'](_0x4ec693)[_0xcffd('0x1a')]();};}function respondWithResult(_0x20e134,_0x4edde4){_0x4edde4=_0x4edde4||0xc8;return function(_0x1cda29){if(_0x1cda29){return _0x20e134[_0xcffd('0x1b')](_0x4edde4)[_0xcffd('0x1c')](_0x1cda29);}};}function respondWithFilteredResult(_0x32f579,_0x4ec386){return function(_0x4921d1){if(_0x4921d1){var _0xb5ffdc=typeof _0x4ec386[_0xcffd('0x1d')]===_0xcffd('0x1e')&&typeof _0x4ec386[_0xcffd('0x1f')]===_0xcffd('0x1e');var _0x55b5db=_0x4921d1[_0xcffd('0x20')];var _0x5c3701=_0xb5ffdc?0x0:_0x4ec386[_0xcffd('0x1d')];var _0x33c713=_0xb5ffdc?_0x4921d1[_0xcffd('0x20')]:_0x4ec386[_0xcffd('0x1d')]+_0x4ec386[_0xcffd('0x1f')];var _0x1b6037;if(_0x33c713>=_0x55b5db){_0x33c713=_0x55b5db;_0x1b6037=0xc8;}else{_0x1b6037=0xce;}_0x32f579[_0xcffd('0x1b')](_0x1b6037);return _0x32f579[_0xcffd('0x21')]('Content-Range',_0x5c3701+'-'+_0x33c713+'/'+_0x55b5db)[_0xcffd('0x1c')](_0x4921d1);}return null;};}function patchUpdates(_0x1f36f4){return function(_0x3d337d){try{jsonpatch[_0xcffd('0x22')](_0x3d337d,_0x1f36f4,!![]);}catch(_0x44f32d){return BPromise[_0xcffd('0x23')](_0x44f32d);}return _0x3d337d[_0xcffd('0x24')]();};}function saveUpdates(_0x5d2d3c,_0x52fc51){return function(_0x2cc75){if(_0x2cc75){return _0x2cc75[_0xcffd('0x25')](_0x5d2d3c)[_0xcffd('0x26')](function(_0x3935ff){return _0x3935ff;});}return null;};}function removeEntity(_0x3c3839,_0x345a4d){return function(_0x2723db){if(_0x2723db){return _0x2723db[_0xcffd('0x27')]()[_0xcffd('0x26')](function(){_0x3c3839[_0xcffd('0x1b')](0xcc)[_0xcffd('0x1a')]();});}};}function handleEntityNotFound(_0x1f232a,_0x544ae7){return function(_0x102f93){if(!_0x102f93){_0x1f232a[_0xcffd('0x28')](0x194);}return _0x102f93;};}function handleError(_0x2c66a7,_0x547bdb){_0x547bdb=_0x547bdb||0x1f4;return function(_0x21bad3){logger[_0xcffd('0x29')](_0x21bad3[_0xcffd('0x2a')]);if(_0x21bad3['name']){delete _0x21bad3['name'];}_0x2c66a7[_0xcffd('0x1b')](_0x547bdb)[_0xcffd('0x2b')](_0x21bad3);};}exports['index']=function(_0x3cb0dd,_0x6641e){var _0x5a97cf={},_0x3f46ea={},_0x3ab051={'count':0x0,'rows':[]};var _0x5783d3=_['map'](db[_0xcffd('0x2c')][_0xcffd('0x2d')],function(_0x318cdf){return{'name':_0x318cdf['fieldName'],'type':_0x318cdf[_0xcffd('0x2e')][_0xcffd('0x2f')]};});_0x3f46ea['model']=_[_0xcffd('0x30')](_0x5783d3,_0xcffd('0x31'));_0x3f46ea['query']=_[_0xcffd('0x32')](_0x3cb0dd['query']);_0x3f46ea[_0xcffd('0x33')]=_[_0xcffd('0x34')](_0x3f46ea['model'],_0x3f46ea[_0xcffd('0x35')]);_0x5a97cf['attributes']=_['intersection'](_0x3f46ea[_0xcffd('0x36')],qs[_0xcffd('0x37')](_0x3cb0dd[_0xcffd('0x35')]['fields']));_0x5a97cf['attributes']=_0x5a97cf[_0xcffd('0x38')][_0xcffd('0x39')]?_0x5a97cf['attributes']:_0x3f46ea['model'];if(!_0x3cb0dd[_0xcffd('0x35')]['hasOwnProperty'](_0xcffd('0x3a'))){_0x5a97cf[_0xcffd('0x1f')]=qs[_0xcffd('0x1f')](_0x3cb0dd[_0xcffd('0x35')][_0xcffd('0x1f')]);_0x5a97cf[_0xcffd('0x1d')]=qs['offset'](_0x3cb0dd[_0xcffd('0x35')][_0xcffd('0x1d')]);}_0x5a97cf[_0xcffd('0x3b')]=qs[_0xcffd('0x3c')](_0x3cb0dd[_0xcffd('0x35')][_0xcffd('0x3c')]);_0x5a97cf['where']=qs[_0xcffd('0x33')](_['pick'](_0x3cb0dd[_0xcffd('0x35')],_0x3f46ea['filters']),_0x5783d3);if(_0x3cb0dd[_0xcffd('0x35')][_0xcffd('0x3d')]){_0x5a97cf[_0xcffd('0x3e')]=_[_0xcffd('0x3f')](_0x5a97cf[_0xcffd('0x3e')],{'$or':_[_0xcffd('0x30')](_0x5783d3,function(_0x392ee3){if(_0x392ee3['type']!==_0xcffd('0x40')){var _0x24f534={};_0x24f534[_0x392ee3[_0xcffd('0x31')]]={'$like':'%'+_0x3cb0dd['query'][_0xcffd('0x3d')]+'%'};return _0x24f534;}})});}_0x5a97cf=_[_0xcffd('0x3f')]({},_0x5a97cf,_0x3cb0dd[_0xcffd('0x41')]);var _0x47ea69={'where':_0x5a97cf['where']};return db['FreshdeskAccount'][_0xcffd('0x20')](_0x47ea69)[_0xcffd('0x26')](function(_0x3d3650){_0x3ab051['count']=_0x3d3650;if(_0x3cb0dd[_0xcffd('0x35')][_0xcffd('0x42')]){_0x5a97cf[_0xcffd('0x43')]=[{'all':!![]}];}return db[_0xcffd('0x2c')][_0xcffd('0x44')](_0x5a97cf);})[_0xcffd('0x26')](function(_0x5ec655){_0x3ab051[_0xcffd('0x45')]=_0x5ec655;return _0x3ab051;})[_0xcffd('0x26')](respondWithFilteredResult(_0x6641e,_0x5a97cf))['catch'](handleError(_0x6641e,null));};exports[_0xcffd('0x46')]=function(_0x587a53,_0x5cb0a9){var _0x23e8fc={'raw':![],'where':{'id':_0x587a53[_0xcffd('0x47')]['id']}},_0xeebe28={};_0xeebe28[_0xcffd('0x36')]=_[_0xcffd('0x32')](db[_0xcffd('0x2c')][_0xcffd('0x2d')]);_0xeebe28[_0xcffd('0x35')]=_[_0xcffd('0x32')](_0x587a53[_0xcffd('0x35')]);_0xeebe28['filters']=_[_0xcffd('0x34')](_0xeebe28[_0xcffd('0x36')],_0xeebe28['query']);_0x23e8fc['attributes']=_[_0xcffd('0x34')](_0xeebe28[_0xcffd('0x36')],qs[_0xcffd('0x37')](_0x587a53[_0xcffd('0x35')][_0xcffd('0x37')]));_0x23e8fc['attributes']=_0x23e8fc['attributes']['length']?_0x23e8fc[_0xcffd('0x38')]:_0xeebe28[_0xcffd('0x36')];if(_0x587a53[_0xcffd('0x35')][_0xcffd('0x42')]){_0x23e8fc[_0xcffd('0x43')]=[{'all':!![]}];}_0x23e8fc=_[_0xcffd('0x3f')]({},_0x23e8fc,_0x587a53[_0xcffd('0x41')]);return db[_0xcffd('0x2c')][_0xcffd('0x48')](_0x23e8fc)[_0xcffd('0x26')](handleEntityNotFound(_0x5cb0a9,null))[_0xcffd('0x26')](respondWithResult(_0x5cb0a9,null))[_0xcffd('0x49')](handleError(_0x5cb0a9,null));};exports[_0xcffd('0x4a')]=function(_0x3f23c1,_0x52f2cd){return db[_0xcffd('0x2c')]['create'](_0x3f23c1['body'],{})[_0xcffd('0x26')](respondWithResult(_0x52f2cd,0xc9))['catch'](handleError(_0x52f2cd,null));};exports[_0xcffd('0x25')]=function(_0x42b396,_0x589e6c){if(_0x42b396[_0xcffd('0x4b')]['id']){delete _0x42b396[_0xcffd('0x4b')]['id'];}return db[_0xcffd('0x2c')][_0xcffd('0x48')]({'where':{'id':_0x42b396[_0xcffd('0x47')]['id']}})['then'](handleEntityNotFound(_0x589e6c,null))[_0xcffd('0x26')](saveUpdates(_0x42b396[_0xcffd('0x4b')],null))[_0xcffd('0x26')](respondWithResult(_0x589e6c,null))[_0xcffd('0x49')](handleError(_0x589e6c,null));};exports[_0xcffd('0x27')]=function(_0x2cc53f,_0x8c341){return db['FreshdeskAccount']['find']({'where':{'id':_0x2cc53f['params']['id']}})['then'](handleEntityNotFound(_0x8c341,null))['then'](removeEntity(_0x8c341,null))[_0xcffd('0x49')](handleError(_0x8c341,null));};exports['getConfigurations']=function(_0x53b879,_0x40c270,_0x44945a){var _0xef5848={};var _0x23b75e={};var _0x229766;var _0x8f3139;return db[_0xcffd('0x2c')][_0xcffd('0x4c')]({'where':{'id':_0x53b879[_0xcffd('0x47')]['id']}})[_0xcffd('0x26')](handleEntityNotFound(_0x40c270,null))[_0xcffd('0x26')](function(_0x347d99){if(_0x347d99){_0x229766=_0x347d99;_0x23b75e[_0xcffd('0x36')]=_[_0xcffd('0x32')](db[_0xcffd('0x4d')]['rawAttributes']);_0x23b75e[_0xcffd('0x35')]=_[_0xcffd('0x32')](_0x53b879[_0xcffd('0x35')]);_0x23b75e[_0xcffd('0x33')]=_[_0xcffd('0x34')](_0x23b75e[_0xcffd('0x36')],_0x23b75e[_0xcffd('0x35')]);_0xef5848[_0xcffd('0x38')]=_[_0xcffd('0x34')](_0x23b75e[_0xcffd('0x36')],qs[_0xcffd('0x37')](_0x53b879[_0xcffd('0x35')][_0xcffd('0x37')]));_0xef5848[_0xcffd('0x38')]=_0xef5848[_0xcffd('0x38')][_0xcffd('0x39')]?_0xef5848[_0xcffd('0x38')]:_0x23b75e['model'];_0xef5848[_0xcffd('0x3b')]=qs[_0xcffd('0x3c')](_0x53b879['query']['sort']);_0xef5848[_0xcffd('0x3e')]=qs[_0xcffd('0x33')](_['pick'](_0x53b879[_0xcffd('0x35')],_0x23b75e[_0xcffd('0x33')]));if(_0x53b879[_0xcffd('0x35')]['filter']){_0xef5848[_0xcffd('0x3e')]=_[_0xcffd('0x3f')](_0xef5848[_0xcffd('0x3e')],{'$or':_[_0xcffd('0x30')](_0xef5848[_0xcffd('0x38')],function(_0x41e801){var _0x289ecf={};_0x289ecf[_0x41e801]={'$like':'%'+_0x53b879[_0xcffd('0x35')][_0xcffd('0x3d')]+'%'};return _0x289ecf;})});}_0xef5848=_[_0xcffd('0x3f')]({},_0xef5848,_0x53b879[_0xcffd('0x41')]);return _0x229766[_0xcffd('0x4e')](_0xef5848);}})[_0xcffd('0x26')](function(_0x5c0edf){if(_0x5c0edf){_0x8f3139=_0x5c0edf[_0xcffd('0x39')];if(!_0x53b879[_0xcffd('0x35')][_0xcffd('0x4f')](_0xcffd('0x3a'))){_0xef5848[_0xcffd('0x1f')]=qs[_0xcffd('0x1f')](_0x53b879[_0xcffd('0x35')][_0xcffd('0x1f')]);_0xef5848[_0xcffd('0x1d')]=qs[_0xcffd('0x1d')](_0x53b879[_0xcffd('0x35')][_0xcffd('0x1d')]);}return _0x229766[_0xcffd('0x4e')](_0xef5848);}})[_0xcffd('0x26')](function(_0x378ec9){if(_0x378ec9){return _0x378ec9?{'count':_0x8f3139,'rows':_0x378ec9}:null;}})['then'](respondWithResult(_0x40c270,null))[_0xcffd('0x49')](handleError(_0x40c270,null));};exports['addConfiguration']=function(_0x406dc5,_0x269e15,_0x7e39b0){if(_0x406dc5[_0xcffd('0x4b')]['id']){delete _0x406dc5[_0xcffd('0x4b')]['id'];}return db[_0xcffd('0x2c')][_0xcffd('0x4c')]({'where':{'id':_0x406dc5[_0xcffd('0x47')]['id']}})[_0xcffd('0x26')](handleEntityNotFound(_0x269e15,null))[_0xcffd('0x26')](function(_0x15b097){if(_0x15b097){_0x406dc5[_0xcffd('0x4b')]['AccountId']=_0x15b097['id'];_0x406dc5['body'][_0xcffd('0x50')]=integrations[_0xcffd('0x51')](_0x406dc5[_0xcffd('0x4b')][_0xcffd('0x52')],_0x406dc5[_0xcffd('0x4b')]['type']);_0x406dc5[_0xcffd('0x4b')]['Descriptions']=integrations[_0xcffd('0x53')](_0x406dc5[_0xcffd('0x4b')][_0xcffd('0x52')],_0x406dc5[_0xcffd('0x4b')][_0xcffd('0x2e')]);return db[_0xcffd('0x4d')][_0xcffd('0x4a')](_0x406dc5[_0xcffd('0x4b')],{'include':[{'model':db[_0xcffd('0x54')],'as':_0xcffd('0x50')},{'model':db[_0xcffd('0x54')],'as':'Descriptions'}]});}return null;})[_0xcffd('0x26')](respondWithResult(_0x269e15,null))[_0xcffd('0x49')](handleError(_0x269e15,null));};exports[_0xcffd('0x55')]=function(_0x2a44d0,_0x1cc2a7,_0x40b8fa){var _0x50b3fe='';return db[_0xcffd('0x2c')]['findOne']({'where':{'id':_0x2a44d0['params']['id']},'attributes':['id',_0xcffd('0x56'),_0xcffd('0x57')]})[_0xcffd('0x26')](handleEntityNotFound(_0x1cc2a7,null))['then'](function(_0x104206){if(_0x104206){_0x50b3fe=_0x104206[_0xcffd('0x56')];var _0x15637c=_0x50b3fe['slice'](-0x1);if(_0x15637c==='/'){_0x50b3fe=_0x50b3fe[_0xcffd('0x58')](0x0,_0x50b3fe[_0xcffd('0x59')](_0x15637c));}return rp({'method':_0xcffd('0x5a'),'uri':util[_0xcffd('0x5b')](_0xcffd('0x5c'),_0x50b3fe,_0xcffd('0x5d')),'headers':{'Authorization':util[_0xcffd('0x5b')](_0xcffd('0x5e'),new Buffer(util[_0xcffd('0x5b')](_0xcffd('0x5f'),_0x104206[_0xcffd('0x57')]))[_0xcffd('0x60')](_0xcffd('0x61')))},'json':!![]});}})[_0xcffd('0x26')](function(_0x539329){if(_0x539329){var _0x1044ec=[_0xcffd('0x62'),_0xcffd('0x63'),'agent',_0xcffd('0x64'),_0xcffd('0x1b'),_0xcffd('0x65'),_0xcffd('0x66'),_0xcffd('0x67'),'ticket_type',_0xcffd('0x66'),_0xcffd('0x68')];_[_0xcffd('0x69')](_0x539329,function(_0x483da9){return _0x1044ec[_0xcffd('0x6a')](_0x483da9[_0xcffd('0x31')])||!_0x483da9[_0xcffd('0x6b')]&&_0x483da9['type']!==_0xcffd('0x6c')&&_0x483da9[_0xcffd('0x2e')]!==_0xcffd('0x6d');});return{'count':_0x539329['length'],'rows':_[_0xcffd('0x30')](_0x539329,function(_0x57dc3d){return{'id':_0x57dc3d[_0xcffd('0x31')],'name':_0x57dc3d[_0xcffd('0x6e')],'custom':!_0x57dc3d['default'],'options':_0x57dc3d[_0xcffd('0x6f')]?_[_0xcffd('0x30')](_0x57dc3d[_0xcffd('0x6f')],function(_0x1876a3){return{'name':_[_0xcffd('0x70')](_0x1876a3),'value':_0x1876a3};}):[]};})};}})[_0xcffd('0x26')](respondWithResult(_0x1cc2a7,null))[_0xcffd('0x49')](function(_0xe8fcc2){var _0x4e11be=_0x2a44d0[_0xcffd('0x35')][_0xcffd('0x71')]?0x1f4:_0xe8fcc2[_0xcffd('0x72')]||0x1f4;logger['error'](_0xcffd('0x73'),_0xcffd('0x55'),_0x4e11be,JSON[_0xcffd('0x74')](_0xe8fcc2));delete _0xe8fcc2[_0xcffd('0x31')];if(_0x4e11be===0x191){_0x4e11be=0x190;}_0x1cc2a7[_0xcffd('0x1b')](_0x4e11be)[_0xcffd('0x2b')](_0x2a44d0[_0xcffd('0x35')][_0xcffd('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0xe8fcc2['statusCode']}:_0xe8fcc2);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index ed40670..21d081d 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 _0x837b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x837b,0x1b6));var _0xb837=function(_0x3b83ad,_0x51290d){_0x3b83ad=_0x3b83ad-0x0;var _0x20e6fd=_0x837b[_0x3b83ad];return _0x20e6fd;};'use strict';var _=require(_0xb837('0x0'));var util=require(_0xb837('0x1'));var logger=require(_0xb837('0x2'))(_0xb837('0x3'));var moment=require(_0xb837('0x4'));var BPromise=require(_0xb837('0x5'));var rp=require(_0xb837('0x6'));var fs=require('fs');var path=require(_0xb837('0x7'));var rimraf=require(_0xb837('0x8'));var config=require(_0xb837('0x9'));var attributes=require(_0xb837('0xa'));var integrations=require('../../components/integrations/configuration');module[_0xb837('0xb')]=function(_0x4344fa,_0x41b1cd){return _0x4344fa[_0xb837('0xc')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4eff=['rimraf','../../components/integrations/configuration','lodash','util','path'];(function(_0x5cc752,_0x110df6){var _0x487970=function(_0x5e14d9){while(--_0x5e14d9){_0x5cc752['push'](_0x5cc752['shift']());}};_0x487970(++_0x110df6);}(_0x4eff,0x93));var _0xf4ef=function(_0x414cf3,_0x10bb91){_0x414cf3=_0x414cf3-0x0;var _0x6e8ead=_0x4eff[_0x414cf3];return _0x6e8ead;};'use strict';var _=require(_0xf4ef('0x0'));var util=require(_0xf4ef('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4ef('0x2'));var rimraf=require(_0xf4ef('0x3'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xf4ef('0x4'));module['exports']=function(_0x291f49,_0x21e501){return _0x291f49['define']('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 aaf1788..9b8107c 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 _0xa1fb=['options','raw','where','limit','include','map','model','attributes','ShowFreshdeskAccount','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','FreshdeskAccount'];(function(_0x357979,_0x56feef){var _0xabb42f=function(_0x447f9d){while(--_0x447f9d){_0x357979['push'](_0x357979['shift']());}};_0xabb42f(++_0x56feef);}(_0xa1fb,0x1c9));var _0xba1f=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xa1fb[_0x35da42];return _0x370035;};'use strict';var _=require('lodash');var util=require(_0xba1f('0x0'));var moment=require(_0xba1f('0x1'));var BPromise=require(_0xba1f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba1f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xba1f('0x4'));var logger=require(_0xba1f('0x5'))(_0xba1f('0x6'));var config=require(_0xba1f('0x7'));var jayson=require(_0xba1f('0x8'));var client=jayson['client'][_0xba1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d4d4,_0x365af2,_0x13749d){return new BPromise(function(_0x44a462,_0x62c9e8){return client['request'](_0x31d4d4,_0x13749d)[_0xba1f('0xa')](function(_0x4c44a7){logger[_0xba1f('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x365af2,_0xba1f('0xc'));logger[_0xba1f('0xd')](_0xba1f('0xe'),_0x365af2,_0xba1f('0xc'),JSON[_0xba1f('0xf')](_0x4c44a7));if(_0x4c44a7['error']){if(_0x4c44a7[_0xba1f('0x10')]['code']===0x1f4){logger['error'](_0xba1f('0x11'),_0x365af2,_0x4c44a7[_0xba1f('0x10')][_0xba1f('0x12')]);return _0x62c9e8(_0x4c44a7['error'][_0xba1f('0x12')]);}logger[_0xba1f('0x10')](_0xba1f('0x11'),_0x365af2,_0x4c44a7['error'][_0xba1f('0x12')]);return _0x44a462(_0x4c44a7[_0xba1f('0x10')][_0xba1f('0x12')]);}else{logger['info'](_0xba1f('0x11'),_0x365af2,_0xba1f('0xc'));_0x44a462(_0x4c44a7[_0xba1f('0x13')][_0xba1f('0x12')]);}})[_0xba1f('0x14')](function(_0x25e152){logger[_0xba1f('0x10')](_0xba1f('0x11'),_0x365af2,_0x25e152);_0x62c9e8(_0x25e152);});});}exports[_0xba1f('0x15')]=function(_0x55aeba){var _0x41e81a=this;return new Promise(function(_0x295a24,_0xfeffe){return db[_0xba1f('0x16')]['findAll']({'raw':_0x55aeba[_0xba1f('0x17')]?_0x55aeba[_0xba1f('0x17')][_0xba1f('0x18')]===undefined?!![]:![]:!![],'where':_0x55aeba['options']?_0x55aeba[_0xba1f('0x17')][_0xba1f('0x19')]||null:null,'attributes':_0x55aeba['options']?_0x55aeba[_0xba1f('0x17')]['attributes']||null:null,'limit':_0x55aeba[_0xba1f('0x17')]?_0x55aeba[_0xba1f('0x17')][_0xba1f('0x1a')]||null:null,'include':_0x55aeba[_0xba1f('0x17')]?_0x55aeba[_0xba1f('0x17')][_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x55aeba[_0xba1f('0x17')][_0xba1f('0x1b')],function(_0x179a18){return{'model':db[_0x179a18[_0xba1f('0x1d')]],'as':_0x179a18['as'],'attributes':_0x179a18[_0xba1f('0x1e')],'include':_0x179a18[_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x179a18[_0xba1f('0x1b')],function(_0x22b038){return{'model':db[_0x22b038['model']],'as':_0x22b038['as'],'attributes':_0x22b038[_0xba1f('0x1e')],'include':_0x22b038[_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x22b038[_0xba1f('0x1b')],function(_0x524073){return{'model':db[_0x524073[_0xba1f('0x1d')]],'as':_0x524073['as'],'attributes':_0x524073[_0xba1f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xba1f('0xa')](function(_0x17d02e){logger[_0xba1f('0xb')]('GetFreshdeskAccount',_0x55aeba);logger[_0xba1f('0xd')](_0xba1f('0x15'),_0x55aeba,JSON[_0xba1f('0xf')](_0x17d02e));_0x295a24(_0x17d02e);})[_0xba1f('0x14')](function(_0x485805){logger[_0xba1f('0x10')](_0xba1f('0x15'),_0x485805[_0xba1f('0x12')],_0x55aeba);_0xfeffe(_0x41e81a[_0xba1f('0x10')](0x1f4,_0x485805[_0xba1f('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x405ea0){var _0x56866b=this;return new Promise(function(_0x497c95,_0xde539e){return db[_0xba1f('0x16')]['find']({'raw':_0x405ea0['options']?_0x405ea0[_0xba1f('0x17')][_0xba1f('0x18')]===undefined?!![]:![]:!![],'where':_0x405ea0['options']?_0x405ea0[_0xba1f('0x17')][_0xba1f('0x19')]||null:null,'attributes':_0x405ea0[_0xba1f('0x17')]?_0x405ea0[_0xba1f('0x17')][_0xba1f('0x1e')]||null:null,'include':_0x405ea0['options']?_0x405ea0['options'][_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x405ea0[_0xba1f('0x17')]['include'],function(_0x363279){return{'model':db[_0x363279[_0xba1f('0x1d')]],'as':_0x363279['as'],'attributes':_0x363279['attributes'],'include':_0x363279[_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x363279[_0xba1f('0x1b')],function(_0x1bfe99){return{'model':db[_0x1bfe99['model']],'as':_0x1bfe99['as'],'attributes':_0x1bfe99[_0xba1f('0x1e')],'include':_0x1bfe99[_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x1bfe99[_0xba1f('0x1b')],function(_0x55b692){return{'model':db[_0x55b692[_0xba1f('0x1d')]],'as':_0x55b692['as'],'attributes':_0x55b692[_0xba1f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x527b79){logger[_0xba1f('0xb')](_0xba1f('0x1f'),_0x405ea0);logger[_0xba1f('0xd')](_0xba1f('0x1f'),_0x405ea0,JSON[_0xba1f('0xf')](_0x527b79));_0x497c95(_0x527b79);})[_0xba1f('0x14')](function(_0x22787f){logger[_0xba1f('0x10')](_0xba1f('0x1f'),_0x22787f[_0xba1f('0x12')],_0x405ea0);_0xde539e(_0x56866b[_0xba1f('0x10')](0x1f4,_0x22787f['message']));});});}; \ No newline at end of file +var _0x21d8=['debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','FreshdeskAccount','findAll','options','raw','where','include','map','model','attributes','GetFreshdeskAccount','ShowFreshdeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x5d8e93,_0x104f28){var _0x13ea71=function(_0x4f53fa){while(--_0x4f53fa){_0x5d8e93['push'](_0x5d8e93['shift']());}};_0x13ea71(++_0x104f28);}(_0x21d8,0x145));var _0x821d=function(_0x1a5d4f,_0x37e65e){_0x1a5d4f=_0x1a5d4f-0x0;var _0x599c8a=_0x21d8[_0x1a5d4f];return _0x599c8a;};'use strict';var _=require(_0x821d('0x0'));var util=require('util');var moment=require(_0x821d('0x1'));var BPromise=require(_0x821d('0x2'));var rs=require(_0x821d('0x3'));var fs=require('fs');var Redis=require(_0x821d('0x4'));var db=require(_0x821d('0x5'))['db'];var utils=require(_0x821d('0x6'));var logger=require(_0x821d('0x7'))(_0x821d('0x8'));var config=require(_0x821d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x821d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14e026,_0x51ed2a,_0x5ac2b7){return new BPromise(function(_0x4444a1,_0x57e05f){return client[_0x821d('0xb')](_0x14e026,_0x5ac2b7)[_0x821d('0xc')](function(_0xc3a9fa){logger['info'](_0x821d('0xd'),_0x51ed2a,_0x821d('0xe'));logger[_0x821d('0xf')](_0x821d('0x10'),_0x51ed2a,_0x821d('0xe'),JSON[_0x821d('0x11')](_0xc3a9fa));if(_0xc3a9fa[_0x821d('0x12')]){if(_0xc3a9fa[_0x821d('0x12')]['code']===0x1f4){logger[_0x821d('0x12')](_0x821d('0xd'),_0x51ed2a,_0xc3a9fa[_0x821d('0x12')]['message']);return _0x57e05f(_0xc3a9fa['error'][_0x821d('0x13')]);}logger[_0x821d('0x12')](_0x821d('0xd'),_0x51ed2a,_0xc3a9fa['error'][_0x821d('0x13')]);return _0x4444a1(_0xc3a9fa['error']['message']);}else{logger[_0x821d('0x14')]('FreshdeskAccount,\x20%s,\x20%s',_0x51ed2a,_0x821d('0xe'));_0x4444a1(_0xc3a9fa[_0x821d('0x15')][_0x821d('0x13')]);}})[_0x821d('0x16')](function(_0x27675a){logger[_0x821d('0x12')](_0x821d('0xd'),_0x51ed2a,_0x27675a);_0x57e05f(_0x27675a);});});}exports['GetFreshdeskAccount']=function(_0x3a24ea){var _0x39129b=this;return new Promise(function(_0x3d18e7,_0x582a5f){return db[_0x821d('0x17')][_0x821d('0x18')]({'raw':_0x3a24ea[_0x821d('0x19')]?_0x3a24ea['options'][_0x821d('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a24ea[_0x821d('0x19')]?_0x3a24ea['options'][_0x821d('0x1b')]||null:null,'attributes':_0x3a24ea[_0x821d('0x19')]?_0x3a24ea[_0x821d('0x19')]['attributes']||null:null,'limit':_0x3a24ea[_0x821d('0x19')]?_0x3a24ea[_0x821d('0x19')]['limit']||null:null,'include':_0x3a24ea[_0x821d('0x19')]?_0x3a24ea['options'][_0x821d('0x1c')]?_[_0x821d('0x1d')](_0x3a24ea[_0x821d('0x19')]['include'],function(_0x5dbf25){return{'model':db[_0x5dbf25[_0x821d('0x1e')]],'as':_0x5dbf25['as'],'attributes':_0x5dbf25[_0x821d('0x1f')],'include':_0x5dbf25[_0x821d('0x1c')]?_['map'](_0x5dbf25[_0x821d('0x1c')],function(_0xbc3ced){return{'model':db[_0xbc3ced[_0x821d('0x1e')]],'as':_0xbc3ced['as'],'attributes':_0xbc3ced[_0x821d('0x1f')],'include':_0xbc3ced[_0x821d('0x1c')]?_['map'](_0xbc3ced[_0x821d('0x1c')],function(_0x464f6e){return{'model':db[_0x464f6e[_0x821d('0x1e')]],'as':_0x464f6e['as'],'attributes':_0x464f6e[_0x821d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17a70d){logger[_0x821d('0x14')](_0x821d('0x20'),_0x3a24ea);logger[_0x821d('0xf')](_0x821d('0x20'),_0x3a24ea,JSON['stringify'](_0x17a70d));_0x3d18e7(_0x17a70d);})[_0x821d('0x16')](function(_0x1a333d){logger[_0x821d('0x12')](_0x821d('0x20'),_0x1a333d[_0x821d('0x13')],_0x3a24ea);_0x582a5f(_0x39129b[_0x821d('0x12')](0x1f4,_0x1a333d['message']));});});};exports[_0x821d('0x21')]=function(_0x36ff5a){var _0x321efc=this;return new Promise(function(_0x57ede5,_0xf29c90){return db[_0x821d('0x17')]['find']({'raw':_0x36ff5a['options']?_0x36ff5a[_0x821d('0x19')][_0x821d('0x1a')]===undefined?!![]:![]:!![],'where':_0x36ff5a[_0x821d('0x19')]?_0x36ff5a['options'][_0x821d('0x1b')]||null:null,'attributes':_0x36ff5a[_0x821d('0x19')]?_0x36ff5a[_0x821d('0x19')][_0x821d('0x1f')]||null:null,'include':_0x36ff5a['options']?_0x36ff5a[_0x821d('0x19')][_0x821d('0x1c')]?_['map'](_0x36ff5a[_0x821d('0x19')][_0x821d('0x1c')],function(_0x203154){return{'model':db[_0x203154[_0x821d('0x1e')]],'as':_0x203154['as'],'attributes':_0x203154[_0x821d('0x1f')],'include':_0x203154['include']?_['map'](_0x203154[_0x821d('0x1c')],function(_0x289713){return{'model':db[_0x289713[_0x821d('0x1e')]],'as':_0x289713['as'],'attributes':_0x289713['attributes'],'include':_0x289713[_0x821d('0x1c')]?_['map'](_0x289713['include'],function(_0x4f9079){return{'model':db[_0x4f9079[_0x821d('0x1e')]],'as':_0x4f9079['as'],'attributes':_0x4f9079[_0x821d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x821d('0xc')](function(_0x33937d){logger[_0x821d('0x14')](_0x821d('0x21'),_0x36ff5a);logger[_0x821d('0xf')](_0x821d('0x21'),_0x36ff5a,JSON['stringify'](_0x33937d));_0x57ede5(_0x33937d);})[_0x821d('0x16')](function(_0x20e81e){logger[_0x821d('0x12')]('ShowFreshdeskAccount',_0x20e81e[_0x821d('0x13')],_0x36ff5a);_0xf29c90(_0x321efc[_0x821d('0x12')](0x1f4,_0x20e81e[_0x821d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 17e0966..4806cc7 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 _0x3317=['./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5d24ee,_0x5dad4b){var _0x58c363=function(_0x52b267){while(--_0x52b267){_0x5d24ee['push'](_0x5d24ee['shift']());}};_0x58c363(++_0x5dad4b);}(_0x3317,0xd0));var _0x7331=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x3317[_0x4d07cc];return _0x42de3b;};'use strict';var multer=require(_0x7331('0x0'));var util=require(_0x7331('0x1'));var path=require(_0x7331('0x2'));var timeout=require(_0x7331('0x3'));var express=require(_0x7331('0x4'));var router=express['Router']();var fs_extra=require(_0x7331('0x5'));var auth=require(_0x7331('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7331('0x7'));var controller=require(_0x7331('0x8'));router[_0x7331('0x9')]('/',auth[_0x7331('0xa')](),controller['index']);router['get'](_0x7331('0xb'),auth['isAuthenticated'](),controller[_0x7331('0xc')]);router[_0x7331('0x9')](_0x7331('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0x7331('0x9')](_0x7331('0xe'),auth[_0x7331('0xa')](),controller['getSubjects']);router['get'](_0x7331('0xf'),auth[_0x7331('0xa')](),controller[_0x7331('0x10')]);router['get'](_0x7331('0x11'),auth[_0x7331('0xa')](),controller[_0x7331('0x12')]);router['post']('/',auth[_0x7331('0xa')](),controller['create']);router[_0x7331('0x13')]('/:id/tags',auth[_0x7331('0xa')](),controller[_0x7331('0x14')]);router[_0x7331('0x15')](_0x7331('0xb'),auth[_0x7331('0xa')](),controller['update']);router[_0x7331('0x16')]('/:id',auth[_0x7331('0xa')](),controller['destroy']);module[_0x7331('0x17')]=router; \ No newline at end of file +var _0x977e=['create','setTags','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','post'];(function(_0x348d88,_0x42a524){var _0xa34656=function(_0x3dfd2f){while(--_0x3dfd2f){_0x348d88['push'](_0x348d88['shift']());}};_0xa34656(++_0x42a524);}(_0x977e,0x11a));var _0xe977=function(_0x31403e,_0x1815de){_0x31403e=_0x31403e-0x0;var _0x5971a7=_0x977e[_0x31403e];return _0x5971a7;};'use strict';var multer=require(_0xe977('0x0'));var util=require(_0xe977('0x1'));var path=require(_0xe977('0x2'));var timeout=require(_0xe977('0x3'));var express=require('express');var router=express[_0xe977('0x4')]();var fs_extra=require(_0xe977('0x5'));var auth=require(_0xe977('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe977('0x7'));var controller=require(_0xe977('0x8'));router[_0xe977('0x9')]('/',auth[_0xe977('0xa')](),controller[_0xe977('0xb')]);router[_0xe977('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe977('0xc')]);router[_0xe977('0x9')]('/:id/fields',auth[_0xe977('0xa')](),controller[_0xe977('0xd')]);router[_0xe977('0x9')](_0xe977('0xe'),auth[_0xe977('0xa')](),controller[_0xe977('0xf')]);router['get'](_0xe977('0x10'),auth[_0xe977('0xa')](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0xe977('0xa')](),controller['getTags']);router[_0xe977('0x11')]('/',auth[_0xe977('0xa')](),controller[_0xe977('0x12')]);router[_0xe977('0x11')]('/:id/tags',auth['isAuthenticated'](),controller[_0xe977('0x13')]);router[_0xe977('0x14')](_0xe977('0x15'),auth['isAuthenticated'](),controller[_0xe977('0x16')]);router[_0xe977('0x17')](_0xe977('0x15'),auth[_0xe977('0xa')](),controller[_0xe977('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 68e9d70..916d853 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 _0x6a11=['exports','STRING','sequelize'];(function(_0x1944a2,_0x236286){var _0x36596c=function(_0x5d5c01){while(--_0x5d5c01){_0x1944a2['push'](_0x1944a2['shift']());}};_0x36596c(++_0x236286);}(_0x6a11,0xda));var _0x16a1=function(_0x37a5cd,_0xb8014d){_0x37a5cd=_0x37a5cd-0x0;var _0x2ecb34=_0x6a11[_0x37a5cd];return _0x2ecb34;};'use strict';var Sequelize=require(_0x16a1('0x0'));module[_0x16a1('0x1')]={'name':{'type':Sequelize[_0x16a1('0x2')]},'description':{'type':Sequelize[_0x16a1('0x2')]}}; \ No newline at end of file +var _0x6182=['STRING','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6182,0x13f));var _0x2618=function(_0x272e64,_0x48938e){_0x272e64=_0x272e64-0x0;var _0x40f795=_0x6182[_0x272e64];return _0x40f795;};'use strict';var Sequelize=require('sequelize');module[_0x2618('0x0')]={'name':{'type':Sequelize[_0x2618('0x1')]},'description':{'type':Sequelize[_0x2618('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index da3543e..925d0dd 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 _0xdd64=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','findAll','catch','params','includeAll','include','find','create','body','update','getFields','FreshdeskField','options','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format'];(function(_0x25c1f6,_0x4a75bc){var _0x20247b=function(_0x5c9757){while(--_0x5c9757){_0x25c1f6['push'](_0x25c1f6['shift']());}};_0x20247b(++_0x4a75bc);}(_0xdd64,0xaf));var _0x4dd6=function(_0xd85ded,_0x5bc576){_0xd85ded=_0xd85ded-0x0;var _0x19c544=_0xdd64[_0xd85ded];return _0x19c544;};'use strict';var emlformat=require(_0x4dd6('0x0'));var rimraf=require(_0x4dd6('0x1'));var zipdir=require(_0x4dd6('0x2'));var jsonpatch=require(_0x4dd6('0x3'));var rp=require(_0x4dd6('0x4'));var moment=require(_0x4dd6('0x5'));var BPromise=require(_0x4dd6('0x6'));var Mustache=require(_0x4dd6('0x7'));var util=require(_0x4dd6('0x8'));var path=require(_0x4dd6('0x9'));var sox=require('sox');var csv=require(_0x4dd6('0xa'));var ejs=require(_0x4dd6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4dd6('0xc'));var crypto=require(_0x4dd6('0xd'));var jsforce=require(_0x4dd6('0xe'));var deskjs=require(_0x4dd6('0xf'));var toCsv=require(_0x4dd6('0xa'));var querystring=require(_0x4dd6('0x10'));var Papa=require(_0x4dd6('0x11'));var Redis=require(_0x4dd6('0x12'));var authService=require(_0x4dd6('0x13'));var qs=require(_0x4dd6('0x14'));var as=require(_0x4dd6('0x15'));var hardwareService=require(_0x4dd6('0x16'));var logger=require(_0x4dd6('0x17'))(_0x4dd6('0x18'));var utils=require('../../config/utils');var config=require(_0x4dd6('0x19'));var licenseUtil=require(_0x4dd6('0x1a'));var db=require(_0x4dd6('0x1b'))['db'];function respondWithStatusCode(_0x1a9f2e,_0x2ed6dc){_0x2ed6dc=_0x2ed6dc||0xcc;return function(_0x1af144){if(_0x1af144){return _0x1a9f2e[_0x4dd6('0x1c')](_0x2ed6dc);}return _0x1a9f2e[_0x4dd6('0x1d')](_0x2ed6dc)[_0x4dd6('0x1e')]();};}function respondWithResult(_0x5f3f14,_0x4eb8d1){_0x4eb8d1=_0x4eb8d1||0xc8;return function(_0x314a55){if(_0x314a55){return _0x5f3f14[_0x4dd6('0x1d')](_0x4eb8d1)[_0x4dd6('0x1f')](_0x314a55);}};}function respondWithFilteredResult(_0x2bb203,_0x4644e2){return function(_0x8e1337){if(_0x8e1337){var _0xcd286e=typeof _0x4644e2['offset']===_0x4dd6('0x20')&&typeof _0x4644e2[_0x4dd6('0x21')]===_0x4dd6('0x20');var _0x477ec1=_0x8e1337[_0x4dd6('0x22')];var _0x287168=_0xcd286e?0x0:_0x4644e2[_0x4dd6('0x23')];var _0x317150=_0xcd286e?_0x8e1337['count']:_0x4644e2[_0x4dd6('0x23')]+_0x4644e2[_0x4dd6('0x21')];var _0x1674f5;if(_0x317150>=_0x477ec1){_0x317150=_0x477ec1;_0x1674f5=0xc8;}else{_0x1674f5=0xce;}_0x2bb203[_0x4dd6('0x1d')](_0x1674f5);return _0x2bb203[_0x4dd6('0x24')](_0x4dd6('0x25'),_0x287168+'-'+_0x317150+'/'+_0x477ec1)['json'](_0x8e1337);}return null;};}function patchUpdates(_0x62f8b2){return function(_0x2f663f){try{jsonpatch[_0x4dd6('0x26')](_0x2f663f,_0x62f8b2,!![]);}catch(_0x5cd66a){return BPromise[_0x4dd6('0x27')](_0x5cd66a);}return _0x2f663f['save']();};}function saveUpdates(_0x30077f,_0x122fa6){return function(_0x4f4f51){if(_0x4f4f51){return _0x4f4f51['update'](_0x30077f)[_0x4dd6('0x28')](function(_0x1791b4){return _0x1791b4;});}return null;};}function removeEntity(_0xcefea8,_0x284269){return function(_0x43932d){if(_0x43932d){return _0x43932d[_0x4dd6('0x29')]()['then'](function(){_0xcefea8['status'](0xcc)[_0x4dd6('0x1e')]();});}};}function handleEntityNotFound(_0x3b90d9,_0x513804){return function(_0x5149ad){if(!_0x5149ad){_0x3b90d9[_0x4dd6('0x1c')](0x194);}return _0x5149ad;};}function handleError(_0x4c94f4,_0x54fd5f){_0x54fd5f=_0x54fd5f||0x1f4;return function(_0x532988){logger['error'](_0x532988[_0x4dd6('0x2a')]);if(_0x532988[_0x4dd6('0x2b')]){delete _0x532988[_0x4dd6('0x2b')];}_0x4c94f4['status'](_0x54fd5f)[_0x4dd6('0x2c')](_0x532988);};}exports[_0x4dd6('0x2d')]=function(_0x1abb82,_0x11103e){var _0x3ae962={},_0x340b0e={},_0x4e7b7a={'count':0x0,'rows':[]};var _0x18a327=_[_0x4dd6('0x2e')](db[_0x4dd6('0x2f')][_0x4dd6('0x30')],function(_0x547f8a){return{'name':_0x547f8a[_0x4dd6('0x31')],'type':_0x547f8a[_0x4dd6('0x32')][_0x4dd6('0x33')]};});_0x340b0e[_0x4dd6('0x34')]=_[_0x4dd6('0x2e')](_0x18a327,'name');_0x340b0e[_0x4dd6('0x35')]=_[_0x4dd6('0x36')](_0x1abb82[_0x4dd6('0x35')]);_0x340b0e['filters']=_[_0x4dd6('0x37')](_0x340b0e[_0x4dd6('0x34')],_0x340b0e[_0x4dd6('0x35')]);_0x3ae962[_0x4dd6('0x38')]=_[_0x4dd6('0x37')](_0x340b0e[_0x4dd6('0x34')],qs[_0x4dd6('0x39')](_0x1abb82[_0x4dd6('0x35')][_0x4dd6('0x39')]));_0x3ae962['attributes']=_0x3ae962[_0x4dd6('0x38')][_0x4dd6('0x3a')]?_0x3ae962[_0x4dd6('0x38')]:_0x340b0e[_0x4dd6('0x34')];if(!_0x1abb82[_0x4dd6('0x35')][_0x4dd6('0x3b')](_0x4dd6('0x3c'))){_0x3ae962[_0x4dd6('0x21')]=qs[_0x4dd6('0x21')](_0x1abb82[_0x4dd6('0x35')][_0x4dd6('0x21')]);_0x3ae962['offset']=qs[_0x4dd6('0x23')](_0x1abb82[_0x4dd6('0x35')][_0x4dd6('0x23')]);}_0x3ae962[_0x4dd6('0x3d')]=qs['sort'](_0x1abb82[_0x4dd6('0x35')][_0x4dd6('0x3e')]);_0x3ae962[_0x4dd6('0x3f')]=qs[_0x4dd6('0x40')](_[_0x4dd6('0x41')](_0x1abb82[_0x4dd6('0x35')],_0x340b0e[_0x4dd6('0x40')]),_0x18a327);if(_0x1abb82[_0x4dd6('0x35')]['filter']){_0x3ae962[_0x4dd6('0x3f')]=_['merge'](_0x3ae962['where'],{'$or':_[_0x4dd6('0x2e')](_0x18a327,function(_0x47bbbe){if(_0x47bbbe[_0x4dd6('0x32')]!==_0x4dd6('0x42')){var _0x38258e={};_0x38258e[_0x47bbbe[_0x4dd6('0x2b')]]={'$like':'%'+_0x1abb82[_0x4dd6('0x35')][_0x4dd6('0x43')]+'%'};return _0x38258e;}})});}_0x3ae962=_[_0x4dd6('0x44')]({},_0x3ae962,_0x1abb82['options']);var _0x1aac6c={'where':_0x3ae962[_0x4dd6('0x3f')]};return db[_0x4dd6('0x2f')][_0x4dd6('0x22')](_0x1aac6c)[_0x4dd6('0x28')](function(_0x4c5f8b){_0x4e7b7a['count']=_0x4c5f8b;if(_0x1abb82['query']['includeAll']){_0x3ae962['include']=[{'all':!![]}];}return db[_0x4dd6('0x2f')][_0x4dd6('0x45')](_0x3ae962);})[_0x4dd6('0x28')](function(_0x5e67dc){_0x4e7b7a['rows']=_0x5e67dc;return _0x4e7b7a;})[_0x4dd6('0x28')](respondWithFilteredResult(_0x11103e,_0x3ae962))[_0x4dd6('0x46')](handleError(_0x11103e,null));};exports['show']=function(_0x1923a2,_0x2cbdcb){var _0x465ad4={'raw':![],'where':{'id':_0x1923a2[_0x4dd6('0x47')]['id']}},_0x28c53c={};_0x28c53c['model']=_[_0x4dd6('0x36')](db['FreshdeskConfiguration']['rawAttributes']);_0x28c53c['query']=_['keys'](_0x1923a2[_0x4dd6('0x35')]);_0x28c53c[_0x4dd6('0x40')]=_[_0x4dd6('0x37')](_0x28c53c['model'],_0x28c53c[_0x4dd6('0x35')]);_0x465ad4[_0x4dd6('0x38')]=_['intersection'](_0x28c53c['model'],qs[_0x4dd6('0x39')](_0x1923a2[_0x4dd6('0x35')][_0x4dd6('0x39')]));_0x465ad4[_0x4dd6('0x38')]=_0x465ad4['attributes']['length']?_0x465ad4[_0x4dd6('0x38')]:_0x28c53c[_0x4dd6('0x34')];if(_0x1923a2[_0x4dd6('0x35')][_0x4dd6('0x48')]){_0x465ad4[_0x4dd6('0x49')]=[{'all':!![]}];}_0x465ad4=_[_0x4dd6('0x44')]({},_0x465ad4,_0x1923a2['options']);return db[_0x4dd6('0x2f')][_0x4dd6('0x4a')](_0x465ad4)[_0x4dd6('0x28')](handleEntityNotFound(_0x2cbdcb,null))['then'](respondWithResult(_0x2cbdcb,null))[_0x4dd6('0x46')](handleError(_0x2cbdcb,null));};exports[_0x4dd6('0x4b')]=function(_0x1d01e7,_0x519077){return db[_0x4dd6('0x2f')]['create'](_0x1d01e7[_0x4dd6('0x4c')],{})[_0x4dd6('0x28')](respondWithResult(_0x519077,0xc9))[_0x4dd6('0x46')](handleError(_0x519077,null));};exports[_0x4dd6('0x4d')]=function(_0x43c42f,_0x2551df){if(_0x43c42f[_0x4dd6('0x4c')]['id']){delete _0x43c42f[_0x4dd6('0x4c')]['id'];}return db[_0x4dd6('0x2f')][_0x4dd6('0x4a')]({'where':{'id':_0x43c42f[_0x4dd6('0x47')]['id']}})['then'](handleEntityNotFound(_0x2551df,null))[_0x4dd6('0x28')](saveUpdates(_0x43c42f[_0x4dd6('0x4c')],null))[_0x4dd6('0x28')](respondWithResult(_0x2551df,null))[_0x4dd6('0x46')](handleError(_0x2551df,null));};exports[_0x4dd6('0x29')]=function(_0x25aff9,_0xb55f88){return db[_0x4dd6('0x2f')][_0x4dd6('0x4a')]({'where':{'id':_0x25aff9['params']['id']}})[_0x4dd6('0x28')](handleEntityNotFound(_0xb55f88,null))[_0x4dd6('0x28')](removeEntity(_0xb55f88,null))['catch'](handleError(_0xb55f88,null));};exports[_0x4dd6('0x4e')]=function(_0x276817,_0x7b6513,_0x5df4ff){var _0x130c6b={};var _0x11ca09={};var _0x5c9e75;var _0x4ef5d3;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x276817[_0x4dd6('0x47')]['id']}})[_0x4dd6('0x28')](handleEntityNotFound(_0x7b6513,null))[_0x4dd6('0x28')](function(_0x3d5528){if(_0x3d5528){_0x5c9e75=_0x3d5528;_0x11ca09['model']=_[_0x4dd6('0x36')](db[_0x4dd6('0x4f')][_0x4dd6('0x30')]);_0x11ca09[_0x4dd6('0x35')]=_[_0x4dd6('0x36')](_0x276817[_0x4dd6('0x35')]);_0x11ca09[_0x4dd6('0x40')]=_[_0x4dd6('0x37')](_0x11ca09['model'],_0x11ca09[_0x4dd6('0x35')]);_0x130c6b[_0x4dd6('0x38')]=_['intersection'](_0x11ca09['model'],qs[_0x4dd6('0x39')](_0x276817['query'][_0x4dd6('0x39')]));_0x130c6b[_0x4dd6('0x38')]=_0x130c6b['attributes'][_0x4dd6('0x3a')]?_0x130c6b[_0x4dd6('0x38')]:_0x11ca09['model'];_0x130c6b[_0x4dd6('0x3d')]=qs['sort'](_0x276817['query']['sort']);_0x130c6b[_0x4dd6('0x3f')]=qs['filters'](_[_0x4dd6('0x41')](_0x276817[_0x4dd6('0x35')],_0x11ca09[_0x4dd6('0x40')]));if(_0x276817['query'][_0x4dd6('0x43')]){_0x130c6b['where']=_[_0x4dd6('0x44')](_0x130c6b['where'],{'$or':_[_0x4dd6('0x2e')](_0x130c6b[_0x4dd6('0x38')],function(_0x53d9d2){var _0x491e8b={};_0x491e8b[_0x53d9d2]={'$like':'%'+_0x276817['query']['filter']+'%'};return _0x491e8b;})});}_0x130c6b=_[_0x4dd6('0x44')]({},_0x130c6b,_0x276817[_0x4dd6('0x50')]);return _0x5c9e75['getFields'](_0x130c6b);}})[_0x4dd6('0x28')](function(_0x5e6a83){if(_0x5e6a83){_0x4ef5d3=_0x5e6a83[_0x4dd6('0x3a')];if(!_0x276817[_0x4dd6('0x35')][_0x4dd6('0x3b')](_0x4dd6('0x3c'))){_0x130c6b['limit']=qs[_0x4dd6('0x21')](_0x276817[_0x4dd6('0x35')]['limit']);_0x130c6b[_0x4dd6('0x23')]=qs[_0x4dd6('0x23')](_0x276817['query'][_0x4dd6('0x23')]);}return _0x5c9e75[_0x4dd6('0x4e')](_0x130c6b);}})[_0x4dd6('0x28')](function(_0x2be5ad){if(_0x2be5ad){return _0x2be5ad?{'count':_0x4ef5d3,'rows':_0x2be5ad}:null;}})[_0x4dd6('0x28')](respondWithResult(_0x7b6513,null))[_0x4dd6('0x46')](handleError(_0x7b6513,null));};exports[_0x4dd6('0x51')]=function(_0x4d5c86,_0x25cd90,_0x5e3487){var _0x1f5709={};var _0x33db64={};var _0x5e141e;var _0x914e06;return db[_0x4dd6('0x2f')][_0x4dd6('0x52')]({'where':{'id':_0x4d5c86['params']['id']}})['then'](handleEntityNotFound(_0x25cd90,null))[_0x4dd6('0x28')](function(_0x1249bc){if(_0x1249bc){_0x5e141e=_0x1249bc;_0x33db64[_0x4dd6('0x34')]=_['keys'](db[_0x4dd6('0x4f')][_0x4dd6('0x30')]);_0x33db64[_0x4dd6('0x35')]=_[_0x4dd6('0x36')](_0x4d5c86[_0x4dd6('0x35')]);_0x33db64[_0x4dd6('0x40')]=_[_0x4dd6('0x37')](_0x33db64['model'],_0x33db64['query']);_0x1f5709[_0x4dd6('0x38')]=_[_0x4dd6('0x37')](_0x33db64[_0x4dd6('0x34')],qs[_0x4dd6('0x39')](_0x4d5c86[_0x4dd6('0x35')][_0x4dd6('0x39')]));_0x1f5709['attributes']=_0x1f5709['attributes'][_0x4dd6('0x3a')]?_0x1f5709[_0x4dd6('0x38')]:_0x33db64[_0x4dd6('0x34')];_0x1f5709['order']=qs[_0x4dd6('0x3e')](_0x4d5c86['query'][_0x4dd6('0x3e')]);_0x1f5709[_0x4dd6('0x3f')]=qs['filters'](_['pick'](_0x4d5c86[_0x4dd6('0x35')],_0x33db64['filters']));if(_0x4d5c86[_0x4dd6('0x35')][_0x4dd6('0x43')]){_0x1f5709[_0x4dd6('0x3f')]=_[_0x4dd6('0x44')](_0x1f5709[_0x4dd6('0x3f')],{'$or':_[_0x4dd6('0x2e')](_0x1f5709['attributes'],function(_0x2477e7){var _0x20c0b5={};_0x20c0b5[_0x2477e7]={'$like':'%'+_0x4d5c86[_0x4dd6('0x35')][_0x4dd6('0x43')]+'%'};return _0x20c0b5;})});}_0x1f5709=_[_0x4dd6('0x44')]({},_0x1f5709,_0x4d5c86[_0x4dd6('0x50')]);return _0x5e141e['getSubjects'](_0x1f5709);}})[_0x4dd6('0x28')](function(_0x29ad30){if(_0x29ad30){_0x914e06=_0x29ad30[_0x4dd6('0x3a')];if(!_0x4d5c86[_0x4dd6('0x35')]['hasOwnProperty'](_0x4dd6('0x3c'))){_0x1f5709['limit']=qs[_0x4dd6('0x21')](_0x4d5c86[_0x4dd6('0x35')][_0x4dd6('0x21')]);_0x1f5709['offset']=qs[_0x4dd6('0x23')](_0x4d5c86['query'][_0x4dd6('0x23')]);}return _0x5e141e['getSubjects'](_0x1f5709);}})[_0x4dd6('0x28')](function(_0x4fc214){if(_0x4fc214){return _0x4fc214?{'count':_0x914e06,'rows':_0x4fc214}:null;}})[_0x4dd6('0x28')](respondWithResult(_0x25cd90,null))[_0x4dd6('0x46')](handleError(_0x25cd90,null));};exports['getDescriptions']=function(_0x429267,_0xef97bf,_0x3e8229){var _0x39b254={};var _0x5c2dc5={};var _0xdb1d8e;var _0x5497f2;return db[_0x4dd6('0x2f')][_0x4dd6('0x52')]({'where':{'id':_0x429267['params']['id']}})['then'](handleEntityNotFound(_0xef97bf,null))[_0x4dd6('0x28')](function(_0x3350f0){if(_0x3350f0){_0xdb1d8e=_0x3350f0;_0x5c2dc5['model']=_[_0x4dd6('0x36')](db['FreshdeskField'][_0x4dd6('0x30')]);_0x5c2dc5[_0x4dd6('0x35')]=_[_0x4dd6('0x36')](_0x429267[_0x4dd6('0x35')]);_0x5c2dc5[_0x4dd6('0x40')]=_['intersection'](_0x5c2dc5[_0x4dd6('0x34')],_0x5c2dc5[_0x4dd6('0x35')]);_0x39b254[_0x4dd6('0x38')]=_['intersection'](_0x5c2dc5[_0x4dd6('0x34')],qs[_0x4dd6('0x39')](_0x429267['query']['fields']));_0x39b254[_0x4dd6('0x38')]=_0x39b254[_0x4dd6('0x38')][_0x4dd6('0x3a')]?_0x39b254[_0x4dd6('0x38')]:_0x5c2dc5['model'];_0x39b254[_0x4dd6('0x3d')]=qs[_0x4dd6('0x3e')](_0x429267['query'][_0x4dd6('0x3e')]);_0x39b254['where']=qs[_0x4dd6('0x40')](_[_0x4dd6('0x41')](_0x429267[_0x4dd6('0x35')],_0x5c2dc5[_0x4dd6('0x40')]));if(_0x429267[_0x4dd6('0x35')][_0x4dd6('0x43')]){_0x39b254[_0x4dd6('0x3f')]=_[_0x4dd6('0x44')](_0x39b254[_0x4dd6('0x3f')],{'$or':_[_0x4dd6('0x2e')](_0x39b254[_0x4dd6('0x38')],function(_0x46dba9){var _0x135337={};_0x135337[_0x46dba9]={'$like':'%'+_0x429267['query'][_0x4dd6('0x43')]+'%'};return _0x135337;})});}_0x39b254=_[_0x4dd6('0x44')]({},_0x39b254,_0x429267[_0x4dd6('0x50')]);return _0xdb1d8e[_0x4dd6('0x53')](_0x39b254);}})[_0x4dd6('0x28')](function(_0x18c4df){if(_0x18c4df){_0x5497f2=_0x18c4df['length'];if(!_0x429267[_0x4dd6('0x35')][_0x4dd6('0x3b')](_0x4dd6('0x3c'))){_0x39b254[_0x4dd6('0x21')]=qs[_0x4dd6('0x21')](_0x429267['query'][_0x4dd6('0x21')]);_0x39b254[_0x4dd6('0x23')]=qs[_0x4dd6('0x23')](_0x429267[_0x4dd6('0x35')][_0x4dd6('0x23')]);}return _0xdb1d8e[_0x4dd6('0x53')](_0x39b254);}})[_0x4dd6('0x28')](function(_0x19d1f7){if(_0x19d1f7){return _0x19d1f7?{'count':_0x5497f2,'rows':_0x19d1f7}:null;}})['then'](respondWithResult(_0xef97bf,null))[_0x4dd6('0x46')](handleError(_0xef97bf,null));};exports[_0x4dd6('0x54')]=function(_0x23a9d6,_0x3b6d65,_0x4de604){var _0x366a57={};var _0x15cd97={};var _0x2f8d1b;var _0xa18d8f;return db[_0x4dd6('0x2f')][_0x4dd6('0x52')]({'where':{'id':_0x23a9d6['params']['id']}})[_0x4dd6('0x28')](handleEntityNotFound(_0x3b6d65,null))[_0x4dd6('0x28')](function(_0x2b3fee){if(_0x2b3fee){_0x2f8d1b=_0x2b3fee;_0x15cd97[_0x4dd6('0x34')]=_[_0x4dd6('0x36')](db[_0x4dd6('0x55')][_0x4dd6('0x30')]);_0x15cd97['query']=_['keys'](_0x23a9d6[_0x4dd6('0x35')]);_0x15cd97[_0x4dd6('0x40')]=_[_0x4dd6('0x37')](_0x15cd97[_0x4dd6('0x34')],_0x15cd97[_0x4dd6('0x35')]);_0x366a57[_0x4dd6('0x38')]=_[_0x4dd6('0x37')](_0x15cd97['model'],qs['fields'](_0x23a9d6['query'][_0x4dd6('0x39')]));_0x366a57['attributes']=_0x366a57[_0x4dd6('0x38')][_0x4dd6('0x3a')]?_0x366a57[_0x4dd6('0x38')]:_0x15cd97[_0x4dd6('0x34')];_0x366a57[_0x4dd6('0x3d')]=qs[_0x4dd6('0x3e')](_0x23a9d6['query'][_0x4dd6('0x3e')]);_0x366a57[_0x4dd6('0x3f')]=qs[_0x4dd6('0x40')](_[_0x4dd6('0x41')](_0x23a9d6[_0x4dd6('0x35')],_0x15cd97[_0x4dd6('0x40')]));if(_0x23a9d6[_0x4dd6('0x35')]['filter']){_0x366a57[_0x4dd6('0x3f')]=_['merge'](_0x366a57['where'],{'$or':_[_0x4dd6('0x2e')](_0x366a57[_0x4dd6('0x38')],function(_0x20c015){var _0x4769ef={};_0x4769ef[_0x20c015]={'$like':'%'+_0x23a9d6[_0x4dd6('0x35')]['filter']+'%'};return _0x4769ef;})});}_0x366a57=_['merge']({},_0x366a57,_0x23a9d6[_0x4dd6('0x50')]);return _0x2f8d1b[_0x4dd6('0x54')](_0x366a57);}})['then'](function(_0x1939ca){if(_0x1939ca){_0xa18d8f=_0x1939ca['length'];if(!_0x23a9d6['query'][_0x4dd6('0x3b')](_0x4dd6('0x3c'))){_0x366a57[_0x4dd6('0x21')]=qs[_0x4dd6('0x21')](_0x23a9d6[_0x4dd6('0x35')][_0x4dd6('0x21')]);_0x366a57[_0x4dd6('0x23')]=qs[_0x4dd6('0x23')](_0x23a9d6['query'][_0x4dd6('0x23')]);}return _0x2f8d1b[_0x4dd6('0x54')](_0x366a57);}})[_0x4dd6('0x28')](function(_0xdaea6){if(_0xdaea6){return _0xdaea6?{'count':_0xa18d8f,'rows':_0xdaea6}:null;}})[_0x4dd6('0x28')](respondWithResult(_0x3b6d65,null))[_0x4dd6('0x46')](handleError(_0x3b6d65,null));};exports[_0x4dd6('0x56')]=function(_0x1a106f,_0x15e837,_0x2b6300){if(_0x1a106f[_0x4dd6('0x4c')]['id']){delete _0x1a106f['body']['id'];}return db[_0x4dd6('0x2f')][_0x4dd6('0x52')]({'where':{'id':_0x1a106f[_0x4dd6('0x47')]['id']}})[_0x4dd6('0x28')](handleEntityNotFound(_0x15e837,null))[_0x4dd6('0x28')](function(_0x365c51){if(_0x365c51){return _0x365c51['setTags'](_0x1a106f[_0x4dd6('0x4c')][_0x4dd6('0x57')]||[]);}return null;})['then'](respondWithResult(_0x15e837,null))['catch'](handleError(_0x15e837,null));}; \ No newline at end of file +var _0x1a69=['nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','getFields','findOne','FreshdeskField','getSubjects','rawAttributes','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','FreshdeskConfiguration','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1a69,0x1cd));var _0x91a6=function(_0x55bce9,_0x5cd005){_0x55bce9=_0x55bce9-0x0;var _0x578ff2=_0x1a69[_0x55bce9];return _0x578ff2;};'use strict';var emlformat=require(_0x91a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91a6('0x1'));var jsonpatch=require(_0x91a6('0x2'));var rp=require(_0x91a6('0x3'));var moment=require(_0x91a6('0x4'));var BPromise=require(_0x91a6('0x5'));var Mustache=require(_0x91a6('0x6'));var util=require('util');var path=require(_0x91a6('0x7'));var sox=require(_0x91a6('0x8'));var csv=require(_0x91a6('0x9'));var ejs=require(_0x91a6('0xa'));var fs=require('fs');var fs_extra=require(_0x91a6('0xb'));var _=require(_0x91a6('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x91a6('0xd'));var deskjs=require(_0x91a6('0xe'));var toCsv=require(_0x91a6('0x9'));var querystring=require(_0x91a6('0xf'));var Papa=require(_0x91a6('0x10'));var Redis=require('ioredis');var authService=require(_0x91a6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x91a6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x91a6('0x13'))(_0x91a6('0x14'));var utils=require('../../config/utils');var config=require(_0x91a6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x91a6('0x16'))['db'];function respondWithStatusCode(_0x3e7556,_0x3dc85b){_0x3dc85b=_0x3dc85b||0xcc;return function(_0x4d7ebb){if(_0x4d7ebb){return _0x3e7556[_0x91a6('0x17')](_0x3dc85b);}return _0x3e7556['status'](_0x3dc85b)['end']();};}function respondWithResult(_0x47917a,_0x119e1c){_0x119e1c=_0x119e1c||0xc8;return function(_0x5417c7){if(_0x5417c7){return _0x47917a[_0x91a6('0x18')](_0x119e1c)[_0x91a6('0x19')](_0x5417c7);}};}function respondWithFilteredResult(_0x5df8f1,_0x44922d){return function(_0x555738){if(_0x555738){var _0x164ba0=typeof _0x44922d[_0x91a6('0x1a')]===_0x91a6('0x1b')&&typeof _0x44922d[_0x91a6('0x1c')]===_0x91a6('0x1b');var _0x4ccb39=_0x555738[_0x91a6('0x1d')];var _0x2b914e=_0x164ba0?0x0:_0x44922d[_0x91a6('0x1a')];var _0x1dda63=_0x164ba0?_0x555738[_0x91a6('0x1d')]:_0x44922d['offset']+_0x44922d['limit'];var _0x2a5aff;if(_0x1dda63>=_0x4ccb39){_0x1dda63=_0x4ccb39;_0x2a5aff=0xc8;}else{_0x2a5aff=0xce;}_0x5df8f1[_0x91a6('0x18')](_0x2a5aff);return _0x5df8f1[_0x91a6('0x1e')](_0x91a6('0x1f'),_0x2b914e+'-'+_0x1dda63+'/'+_0x4ccb39)[_0x91a6('0x19')](_0x555738);}return null;};}function patchUpdates(_0x5c2fba){return function(_0x1f7fbf){try{jsonpatch[_0x91a6('0x20')](_0x1f7fbf,_0x5c2fba,!![]);}catch(_0x3cc627){return BPromise[_0x91a6('0x21')](_0x3cc627);}return _0x1f7fbf[_0x91a6('0x22')]();};}function saveUpdates(_0x352f69,_0x12ffbd){return function(_0x1af9f2){if(_0x1af9f2){return _0x1af9f2['update'](_0x352f69)[_0x91a6('0x23')](function(_0x2833b9){return _0x2833b9;});}return null;};}function removeEntity(_0x356089,_0x4955e0){return function(_0x284dd7){if(_0x284dd7){return _0x284dd7[_0x91a6('0x24')]()[_0x91a6('0x23')](function(){_0x356089[_0x91a6('0x18')](0xcc)[_0x91a6('0x25')]();});}};}function handleEntityNotFound(_0x4242bd,_0x57478c){return function(_0x408f55){if(!_0x408f55){_0x4242bd[_0x91a6('0x17')](0x194);}return _0x408f55;};}function handleError(_0x26a161,_0x5451d0){_0x5451d0=_0x5451d0||0x1f4;return function(_0x52a5e8){logger[_0x91a6('0x26')](_0x52a5e8[_0x91a6('0x27')]);if(_0x52a5e8['name']){delete _0x52a5e8[_0x91a6('0x28')];}_0x26a161[_0x91a6('0x18')](_0x5451d0)[_0x91a6('0x29')](_0x52a5e8);};}exports[_0x91a6('0x2a')]=function(_0x224295,_0x2fc5d0){var _0x2c1ddd={},_0x39b49d={},_0x2c9e1c={'count':0x0,'rows':[]};var _0x288b53=_['map'](db[_0x91a6('0x2b')]['rawAttributes'],function(_0x53075){return{'name':_0x53075[_0x91a6('0x2c')],'type':_0x53075[_0x91a6('0x2d')][_0x91a6('0x2e')]};});_0x39b49d[_0x91a6('0x2f')]=_['map'](_0x288b53,_0x91a6('0x28'));_0x39b49d[_0x91a6('0x30')]=_['keys'](_0x224295[_0x91a6('0x30')]);_0x39b49d[_0x91a6('0x31')]=_[_0x91a6('0x32')](_0x39b49d['model'],_0x39b49d[_0x91a6('0x30')]);_0x2c1ddd['attributes']=_[_0x91a6('0x32')](_0x39b49d[_0x91a6('0x2f')],qs[_0x91a6('0x33')](_0x224295[_0x91a6('0x30')][_0x91a6('0x33')]));_0x2c1ddd[_0x91a6('0x34')]=_0x2c1ddd[_0x91a6('0x34')][_0x91a6('0x35')]?_0x2c1ddd[_0x91a6('0x34')]:_0x39b49d[_0x91a6('0x2f')];if(!_0x224295[_0x91a6('0x30')][_0x91a6('0x36')](_0x91a6('0x37'))){_0x2c1ddd[_0x91a6('0x1c')]=qs[_0x91a6('0x1c')](_0x224295['query'][_0x91a6('0x1c')]);_0x2c1ddd[_0x91a6('0x1a')]=qs[_0x91a6('0x1a')](_0x224295['query'][_0x91a6('0x1a')]);}_0x2c1ddd[_0x91a6('0x38')]=qs[_0x91a6('0x39')](_0x224295['query'][_0x91a6('0x39')]);_0x2c1ddd[_0x91a6('0x3a')]=qs[_0x91a6('0x31')](_[_0x91a6('0x3b')](_0x224295[_0x91a6('0x30')],_0x39b49d[_0x91a6('0x31')]),_0x288b53);if(_0x224295[_0x91a6('0x30')]['filter']){_0x2c1ddd[_0x91a6('0x3a')]=_['merge'](_0x2c1ddd[_0x91a6('0x3a')],{'$or':_[_0x91a6('0x3c')](_0x288b53,function(_0x9a1d69){if(_0x9a1d69[_0x91a6('0x2d')]!==_0x91a6('0x3d')){var _0x5d3c6a={};_0x5d3c6a[_0x9a1d69['name']]={'$like':'%'+_0x224295[_0x91a6('0x30')][_0x91a6('0x3e')]+'%'};return _0x5d3c6a;}})});}_0x2c1ddd=_[_0x91a6('0x3f')]({},_0x2c1ddd,_0x224295[_0x91a6('0x40')]);var _0x3d0b12={'where':_0x2c1ddd['where']};return db[_0x91a6('0x2b')][_0x91a6('0x1d')](_0x3d0b12)[_0x91a6('0x23')](function(_0x4f63db){_0x2c9e1c['count']=_0x4f63db;if(_0x224295[_0x91a6('0x30')][_0x91a6('0x41')]){_0x2c1ddd[_0x91a6('0x42')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x91a6('0x43')](_0x2c1ddd);})[_0x91a6('0x23')](function(_0x4b98f2){_0x2c9e1c[_0x91a6('0x44')]=_0x4b98f2;return _0x2c9e1c;})[_0x91a6('0x23')](respondWithFilteredResult(_0x2fc5d0,_0x2c1ddd))['catch'](handleError(_0x2fc5d0,null));};exports[_0x91a6('0x45')]=function(_0x150453,_0x339c2b){var _0x39221e={'raw':![],'where':{'id':_0x150453[_0x91a6('0x46')]['id']}},_0x4fecaf={};_0x4fecaf['model']=_[_0x91a6('0x47')](db[_0x91a6('0x2b')]['rawAttributes']);_0x4fecaf[_0x91a6('0x30')]=_['keys'](_0x150453[_0x91a6('0x30')]);_0x4fecaf[_0x91a6('0x31')]=_[_0x91a6('0x32')](_0x4fecaf[_0x91a6('0x2f')],_0x4fecaf[_0x91a6('0x30')]);_0x39221e['attributes']=_[_0x91a6('0x32')](_0x4fecaf[_0x91a6('0x2f')],qs[_0x91a6('0x33')](_0x150453[_0x91a6('0x30')][_0x91a6('0x33')]));_0x39221e[_0x91a6('0x34')]=_0x39221e[_0x91a6('0x34')][_0x91a6('0x35')]?_0x39221e[_0x91a6('0x34')]:_0x4fecaf[_0x91a6('0x2f')];if(_0x150453[_0x91a6('0x30')][_0x91a6('0x41')]){_0x39221e[_0x91a6('0x42')]=[{'all':!![]}];}_0x39221e=_[_0x91a6('0x3f')]({},_0x39221e,_0x150453[_0x91a6('0x40')]);return db['FreshdeskConfiguration'][_0x91a6('0x48')](_0x39221e)[_0x91a6('0x23')](handleEntityNotFound(_0x339c2b,null))[_0x91a6('0x23')](respondWithResult(_0x339c2b,null))[_0x91a6('0x49')](handleError(_0x339c2b,null));};exports[_0x91a6('0x4a')]=function(_0x5d7ace,_0x35cea6){return db[_0x91a6('0x2b')]['create'](_0x5d7ace[_0x91a6('0x4b')],{})['then'](respondWithResult(_0x35cea6,0xc9))[_0x91a6('0x49')](handleError(_0x35cea6,null));};exports['update']=function(_0x4cddee,_0xc45c39){if(_0x4cddee[_0x91a6('0x4b')]['id']){delete _0x4cddee[_0x91a6('0x4b')]['id'];}return db['FreshdeskConfiguration'][_0x91a6('0x48')]({'where':{'id':_0x4cddee['params']['id']}})['then'](handleEntityNotFound(_0xc45c39,null))[_0x91a6('0x23')](saveUpdates(_0x4cddee[_0x91a6('0x4b')],null))[_0x91a6('0x23')](respondWithResult(_0xc45c39,null))[_0x91a6('0x49')](handleError(_0xc45c39,null));};exports[_0x91a6('0x24')]=function(_0x1152f6,_0x3efd0d){return db[_0x91a6('0x2b')][_0x91a6('0x48')]({'where':{'id':_0x1152f6[_0x91a6('0x46')]['id']}})[_0x91a6('0x23')](handleEntityNotFound(_0x3efd0d,null))['then'](removeEntity(_0x3efd0d,null))[_0x91a6('0x49')](handleError(_0x3efd0d,null));};exports[_0x91a6('0x4c')]=function(_0x27384e,_0x33ae1d,_0x1e977e){var _0x241b18={};var _0x5b8f52={};var _0x1dc481;var _0x44dfb8;return db[_0x91a6('0x2b')][_0x91a6('0x4d')]({'where':{'id':_0x27384e[_0x91a6('0x46')]['id']}})[_0x91a6('0x23')](handleEntityNotFound(_0x33ae1d,null))[_0x91a6('0x23')](function(_0x152543){if(_0x152543){_0x1dc481=_0x152543;_0x5b8f52[_0x91a6('0x2f')]=_['keys'](db[_0x91a6('0x4e')]['rawAttributes']);_0x5b8f52[_0x91a6('0x30')]=_[_0x91a6('0x47')](_0x27384e[_0x91a6('0x30')]);_0x5b8f52['filters']=_[_0x91a6('0x32')](_0x5b8f52['model'],_0x5b8f52[_0x91a6('0x30')]);_0x241b18['attributes']=_[_0x91a6('0x32')](_0x5b8f52[_0x91a6('0x2f')],qs[_0x91a6('0x33')](_0x27384e[_0x91a6('0x30')]['fields']));_0x241b18[_0x91a6('0x34')]=_0x241b18[_0x91a6('0x34')][_0x91a6('0x35')]?_0x241b18[_0x91a6('0x34')]:_0x5b8f52[_0x91a6('0x2f')];_0x241b18[_0x91a6('0x38')]=qs[_0x91a6('0x39')](_0x27384e[_0x91a6('0x30')][_0x91a6('0x39')]);_0x241b18[_0x91a6('0x3a')]=qs[_0x91a6('0x31')](_[_0x91a6('0x3b')](_0x27384e['query'],_0x5b8f52[_0x91a6('0x31')]));if(_0x27384e[_0x91a6('0x30')][_0x91a6('0x3e')]){_0x241b18['where']=_[_0x91a6('0x3f')](_0x241b18[_0x91a6('0x3a')],{'$or':_[_0x91a6('0x3c')](_0x241b18[_0x91a6('0x34')],function(_0x535c16){var _0x207416={};_0x207416[_0x535c16]={'$like':'%'+_0x27384e['query'][_0x91a6('0x3e')]+'%'};return _0x207416;})});}_0x241b18=_['merge']({},_0x241b18,_0x27384e[_0x91a6('0x40')]);return _0x1dc481['getFields'](_0x241b18);}})['then'](function(_0x54b9ca){if(_0x54b9ca){_0x44dfb8=_0x54b9ca[_0x91a6('0x35')];if(!_0x27384e[_0x91a6('0x30')][_0x91a6('0x36')](_0x91a6('0x37'))){_0x241b18[_0x91a6('0x1c')]=qs[_0x91a6('0x1c')](_0x27384e[_0x91a6('0x30')][_0x91a6('0x1c')]);_0x241b18[_0x91a6('0x1a')]=qs['offset'](_0x27384e['query'][_0x91a6('0x1a')]);}return _0x1dc481[_0x91a6('0x4c')](_0x241b18);}})['then'](function(_0xc9c05){if(_0xc9c05){return _0xc9c05?{'count':_0x44dfb8,'rows':_0xc9c05}:null;}})[_0x91a6('0x23')](respondWithResult(_0x33ae1d,null))[_0x91a6('0x49')](handleError(_0x33ae1d,null));};exports[_0x91a6('0x4f')]=function(_0x88ba19,_0x31a517,_0x3b1942){var _0xf47e05={};var _0x11861a={};var _0x450da8;var _0xc3cd4a;return db[_0x91a6('0x2b')][_0x91a6('0x4d')]({'where':{'id':_0x88ba19[_0x91a6('0x46')]['id']}})[_0x91a6('0x23')](handleEntityNotFound(_0x31a517,null))[_0x91a6('0x23')](function(_0x2f620a){if(_0x2f620a){_0x450da8=_0x2f620a;_0x11861a['model']=_['keys'](db[_0x91a6('0x4e')][_0x91a6('0x50')]);_0x11861a[_0x91a6('0x30')]=_[_0x91a6('0x47')](_0x88ba19[_0x91a6('0x30')]);_0x11861a['filters']=_['intersection'](_0x11861a['model'],_0x11861a[_0x91a6('0x30')]);_0xf47e05[_0x91a6('0x34')]=_[_0x91a6('0x32')](_0x11861a[_0x91a6('0x2f')],qs[_0x91a6('0x33')](_0x88ba19[_0x91a6('0x30')]['fields']));_0xf47e05[_0x91a6('0x34')]=_0xf47e05[_0x91a6('0x34')][_0x91a6('0x35')]?_0xf47e05['attributes']:_0x11861a[_0x91a6('0x2f')];_0xf47e05[_0x91a6('0x38')]=qs[_0x91a6('0x39')](_0x88ba19[_0x91a6('0x30')]['sort']);_0xf47e05['where']=qs[_0x91a6('0x31')](_[_0x91a6('0x3b')](_0x88ba19['query'],_0x11861a['filters']));if(_0x88ba19[_0x91a6('0x30')][_0x91a6('0x3e')]){_0xf47e05['where']=_[_0x91a6('0x3f')](_0xf47e05[_0x91a6('0x3a')],{'$or':_[_0x91a6('0x3c')](_0xf47e05[_0x91a6('0x34')],function(_0x34fe16){var _0x26089f={};_0x26089f[_0x34fe16]={'$like':'%'+_0x88ba19[_0x91a6('0x30')][_0x91a6('0x3e')]+'%'};return _0x26089f;})});}_0xf47e05=_[_0x91a6('0x3f')]({},_0xf47e05,_0x88ba19[_0x91a6('0x40')]);return _0x450da8[_0x91a6('0x4f')](_0xf47e05);}})['then'](function(_0x21f613){if(_0x21f613){_0xc3cd4a=_0x21f613[_0x91a6('0x35')];if(!_0x88ba19['query']['hasOwnProperty']('nolimit')){_0xf47e05[_0x91a6('0x1c')]=qs[_0x91a6('0x1c')](_0x88ba19[_0x91a6('0x30')][_0x91a6('0x1c')]);_0xf47e05[_0x91a6('0x1a')]=qs['offset'](_0x88ba19['query'][_0x91a6('0x1a')]);}return _0x450da8[_0x91a6('0x4f')](_0xf47e05);}})['then'](function(_0x39cade){if(_0x39cade){return _0x39cade?{'count':_0xc3cd4a,'rows':_0x39cade}:null;}})[_0x91a6('0x23')](respondWithResult(_0x31a517,null))[_0x91a6('0x49')](handleError(_0x31a517,null));};exports['getDescriptions']=function(_0x59cec3,_0x36284c,_0x5e50bf){var _0x4bab2e={};var _0x4bc597={};var _0x32a86a;var _0x17ca70;return db[_0x91a6('0x2b')][_0x91a6('0x4d')]({'where':{'id':_0x59cec3[_0x91a6('0x46')]['id']}})[_0x91a6('0x23')](handleEntityNotFound(_0x36284c,null))['then'](function(_0x4e44a3){if(_0x4e44a3){_0x32a86a=_0x4e44a3;_0x4bc597['model']=_[_0x91a6('0x47')](db[_0x91a6('0x4e')][_0x91a6('0x50')]);_0x4bc597[_0x91a6('0x30')]=_[_0x91a6('0x47')](_0x59cec3['query']);_0x4bc597[_0x91a6('0x31')]=_['intersection'](_0x4bc597[_0x91a6('0x2f')],_0x4bc597['query']);_0x4bab2e[_0x91a6('0x34')]=_['intersection'](_0x4bc597[_0x91a6('0x2f')],qs[_0x91a6('0x33')](_0x59cec3['query'][_0x91a6('0x33')]));_0x4bab2e[_0x91a6('0x34')]=_0x4bab2e[_0x91a6('0x34')][_0x91a6('0x35')]?_0x4bab2e[_0x91a6('0x34')]:_0x4bc597[_0x91a6('0x2f')];_0x4bab2e[_0x91a6('0x38')]=qs['sort'](_0x59cec3[_0x91a6('0x30')][_0x91a6('0x39')]);_0x4bab2e[_0x91a6('0x3a')]=qs['filters'](_[_0x91a6('0x3b')](_0x59cec3[_0x91a6('0x30')],_0x4bc597[_0x91a6('0x31')]));if(_0x59cec3[_0x91a6('0x30')][_0x91a6('0x3e')]){_0x4bab2e['where']=_['merge'](_0x4bab2e[_0x91a6('0x3a')],{'$or':_[_0x91a6('0x3c')](_0x4bab2e[_0x91a6('0x34')],function(_0x2bfb73){var _0x2b0fe8={};_0x2b0fe8[_0x2bfb73]={'$like':'%'+_0x59cec3[_0x91a6('0x30')][_0x91a6('0x3e')]+'%'};return _0x2b0fe8;})});}_0x4bab2e=_[_0x91a6('0x3f')]({},_0x4bab2e,_0x59cec3[_0x91a6('0x40')]);return _0x32a86a['getDescriptions'](_0x4bab2e);}})[_0x91a6('0x23')](function(_0x31babb){if(_0x31babb){_0x17ca70=_0x31babb[_0x91a6('0x35')];if(!_0x59cec3['query']['hasOwnProperty'](_0x91a6('0x37'))){_0x4bab2e['limit']=qs[_0x91a6('0x1c')](_0x59cec3[_0x91a6('0x30')][_0x91a6('0x1c')]);_0x4bab2e['offset']=qs[_0x91a6('0x1a')](_0x59cec3['query']['offset']);}return _0x32a86a[_0x91a6('0x51')](_0x4bab2e);}})['then'](function(_0x15fac6){if(_0x15fac6){return _0x15fac6?{'count':_0x17ca70,'rows':_0x15fac6}:null;}})[_0x91a6('0x23')](respondWithResult(_0x36284c,null))['catch'](handleError(_0x36284c,null));};exports[_0x91a6('0x52')]=function(_0x1dc745,_0x1f0ecd,_0x5aeb53){var _0x2b2aab={};var _0x2d23c0={};var _0x3e06fc;var _0x1dca6c;return db['FreshdeskConfiguration'][_0x91a6('0x4d')]({'where':{'id':_0x1dc745[_0x91a6('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f0ecd,null))[_0x91a6('0x23')](function(_0x577017){if(_0x577017){_0x3e06fc=_0x577017;_0x2d23c0['model']=_[_0x91a6('0x47')](db[_0x91a6('0x53')][_0x91a6('0x50')]);_0x2d23c0['query']=_[_0x91a6('0x47')](_0x1dc745['query']);_0x2d23c0['filters']=_[_0x91a6('0x32')](_0x2d23c0[_0x91a6('0x2f')],_0x2d23c0['query']);_0x2b2aab[_0x91a6('0x34')]=_[_0x91a6('0x32')](_0x2d23c0[_0x91a6('0x2f')],qs[_0x91a6('0x33')](_0x1dc745[_0x91a6('0x30')][_0x91a6('0x33')]));_0x2b2aab[_0x91a6('0x34')]=_0x2b2aab[_0x91a6('0x34')][_0x91a6('0x35')]?_0x2b2aab[_0x91a6('0x34')]:_0x2d23c0['model'];_0x2b2aab[_0x91a6('0x38')]=qs[_0x91a6('0x39')](_0x1dc745[_0x91a6('0x30')][_0x91a6('0x39')]);_0x2b2aab[_0x91a6('0x3a')]=qs[_0x91a6('0x31')](_[_0x91a6('0x3b')](_0x1dc745[_0x91a6('0x30')],_0x2d23c0['filters']));if(_0x1dc745['query'][_0x91a6('0x3e')]){_0x2b2aab[_0x91a6('0x3a')]=_[_0x91a6('0x3f')](_0x2b2aab[_0x91a6('0x3a')],{'$or':_[_0x91a6('0x3c')](_0x2b2aab[_0x91a6('0x34')],function(_0x34bd5){var _0x2c5330={};_0x2c5330[_0x34bd5]={'$like':'%'+_0x1dc745[_0x91a6('0x30')][_0x91a6('0x3e')]+'%'};return _0x2c5330;})});}_0x2b2aab=_[_0x91a6('0x3f')]({},_0x2b2aab,_0x1dc745[_0x91a6('0x40')]);return _0x3e06fc[_0x91a6('0x52')](_0x2b2aab);}})[_0x91a6('0x23')](function(_0x2fb0eb){if(_0x2fb0eb){_0x1dca6c=_0x2fb0eb[_0x91a6('0x35')];if(!_0x1dc745[_0x91a6('0x30')]['hasOwnProperty'](_0x91a6('0x37'))){_0x2b2aab['limit']=qs[_0x91a6('0x1c')](_0x1dc745[_0x91a6('0x30')][_0x91a6('0x1c')]);_0x2b2aab['offset']=qs[_0x91a6('0x1a')](_0x1dc745[_0x91a6('0x30')][_0x91a6('0x1a')]);}return _0x3e06fc[_0x91a6('0x52')](_0x2b2aab);}})[_0x91a6('0x23')](function(_0x337bfc){if(_0x337bfc){return _0x337bfc?{'count':_0x1dca6c,'rows':_0x337bfc}:null;}})['then'](respondWithResult(_0x1f0ecd,null))[_0x91a6('0x49')](handleError(_0x1f0ecd,null));};exports['setTags']=function(_0x431a4b,_0x49a931,_0x10579a){if(_0x431a4b[_0x91a6('0x4b')]['id']){delete _0x431a4b[_0x91a6('0x4b')]['id'];}return db['FreshdeskConfiguration'][_0x91a6('0x4d')]({'where':{'id':_0x431a4b[_0x91a6('0x46')]['id']}})[_0x91a6('0x23')](handleEntityNotFound(_0x49a931,null))['then'](function(_0x32d951){if(_0x32d951){return _0x32d951[_0x91a6('0x54')](_0x431a4b['body'][_0x91a6('0x55')]||[]);}return null;})['then'](respondWithResult(_0x49a931,null))['catch'](handleError(_0x49a931,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 19d9898..bfed535 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 _0xb008=['exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x4f6f84,_0x31e197){var _0x20d989=function(_0x34db70){while(--_0x34db70){_0x4f6f84['push'](_0x4f6f84['shift']());}};_0x20d989(++_0x31e197);}(_0xb008,0xdf));var _0x8b00=function(_0x1b5689,_0x36d5b6){_0x1b5689=_0x1b5689-0x0;var _0x53295d=_0xb008[_0x1b5689];return _0x53295d;};'use strict';var _=require(_0x8b00('0x0'));var util=require(_0x8b00('0x1'));var logger=require('../../config/logger')(_0x8b00('0x2'));var moment=require(_0x8b00('0x3'));var BPromise=require('bluebird');var rp=require(_0x8b00('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b00('0x5'));var config=require(_0x8b00('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x8b00('0x7')]=function(_0x49c38b,_0x24bccc){return _0x49c38b['define'](_0x8b00('0x8'),attributes,{'tableName':_0x8b00('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x73a2=['./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x299d67,_0x52c048){var _0xb8027b=function(_0x47543d){while(--_0x47543d){_0x299d67['push'](_0x299d67['shift']());}};_0xb8027b(++_0x52c048);}(_0x73a2,0x12c));var _0x273a=function(_0x500f0f,_0xdf1119){_0x500f0f=_0x500f0f-0x0;var _0x351b3b=_0x73a2[_0x500f0f];return _0x351b3b;};'use strict';var _=require(_0x273a('0x0'));var util=require(_0x273a('0x1'));var logger=require(_0x273a('0x2'))(_0x273a('0x3'));var moment=require(_0x273a('0x4'));var BPromise=require('bluebird');var rp=require(_0x273a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x273a('0x6'));var config=require(_0x273a('0x7'));var attributes=require(_0x273a('0x8'));module[_0x273a('0x9')]=function(_0x53e9c5,_0x3d55b3){return _0x53e9c5['define'](_0x273a('0xa'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 808126e..f575fe4 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 _0xf4ce=['error','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x47b409,_0x4fb731){var _0x2fdefb=function(_0x2f61ae){while(--_0x2f61ae){_0x47b409['push'](_0x47b409['shift']());}};_0x2fdefb(++_0x4fb731);}(_0xf4ce,0x16a));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(_0xef4c('0x2'));var BPromise=require(_0xef4c('0x3'));var rs=require(_0xef4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef4c('0x5'))['db'];var utils=require(_0xef4c('0x6'));var logger=require(_0xef4c('0x7'))(_0xef4c('0x8'));var config=require(_0xef4c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xef4c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39e75c,_0x10a6ad,_0x46a3b0){return new BPromise(function(_0x5639b3,_0x4a1ac1){return client['request'](_0x39e75c,_0x46a3b0)[_0xef4c('0xb')](function(_0x5ad9b6){logger[_0xef4c('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x10a6ad,'request\x20sent');logger['debug'](_0xef4c('0xd'),_0x10a6ad,_0xef4c('0xe'),JSON[_0xef4c('0xf')](_0x5ad9b6));if(_0x5ad9b6[_0xef4c('0x10')]){if(_0x5ad9b6['error']['code']===0x1f4){logger['error'](_0xef4c('0x11'),_0x10a6ad,_0x5ad9b6[_0xef4c('0x10')][_0xef4c('0x12')]);return _0x4a1ac1(_0x5ad9b6[_0xef4c('0x10')]['message']);}logger[_0xef4c('0x10')](_0xef4c('0x11'),_0x10a6ad,_0x5ad9b6[_0xef4c('0x10')][_0xef4c('0x12')]);return _0x5639b3(_0x5ad9b6['error'][_0xef4c('0x12')]);}else{logger[_0xef4c('0xc')](_0xef4c('0x11'),_0x10a6ad,_0xef4c('0xe'));_0x5639b3(_0x5ad9b6[_0xef4c('0x13')][_0xef4c('0x12')]);}})[_0xef4c('0x14')](function(_0x17dd6e){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x10a6ad,_0x17dd6e);_0x4a1ac1(_0x17dd6e);});});} \ No newline at end of file +var _0x4149=['message','request\x20sent','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2d595f,_0xdfdb46){var _0x1e26a2=function(_0x17f26a){while(--_0x17f26a){_0x2d595f['push'](_0x2d595f['shift']());}};_0x1e26a2(++_0xdfdb46);}(_0x4149,0x67));var _0x9414=function(_0x2416c1,_0x1bd086){_0x2416c1=_0x2416c1-0x0;var _0x491df9=_0x4149[_0x2416c1];return _0x491df9;};'use strict';var _=require(_0x9414('0x0'));var util=require(_0x9414('0x1'));var moment=require(_0x9414('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9414('0x3'));var db=require(_0x9414('0x4'))['db'];var utils=require(_0x9414('0x5'));var logger=require('../../config/logger')(_0x9414('0x6'));var config=require('../../config/environment');var jayson=require(_0x9414('0x7'));var client=jayson[_0x9414('0x8')][_0x9414('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ee5ff,_0x26bdea,_0x2feb20){return new BPromise(function(_0x1efb1a,_0x1945e6){return client[_0x9414('0xa')](_0x4ee5ff,_0x2feb20)[_0x9414('0xb')](function(_0x4f42b7){logger[_0x9414('0xc')](_0x9414('0xd'),_0x26bdea,'request\x20sent');logger['debug'](_0x9414('0xe'),_0x26bdea,'request\x20sent',JSON['stringify'](_0x4f42b7));if(_0x4f42b7[_0x9414('0xf')]){if(_0x4f42b7[_0x9414('0xf')][_0x9414('0x10')]===0x1f4){logger[_0x9414('0xf')](_0x9414('0xd'),_0x26bdea,_0x4f42b7[_0x9414('0xf')][_0x9414('0x11')]);return _0x1945e6(_0x4f42b7[_0x9414('0xf')][_0x9414('0x11')]);}logger[_0x9414('0xf')](_0x9414('0xd'),_0x26bdea,_0x4f42b7[_0x9414('0xf')][_0x9414('0x11')]);return _0x1efb1a(_0x4f42b7[_0x9414('0xf')][_0x9414('0x11')]);}else{logger[_0x9414('0xc')](_0x9414('0xd'),_0x26bdea,_0x9414('0x12'));_0x1efb1a(_0x4f42b7['result'][_0x9414('0x11')]);}})[_0x9414('0x13')](function(_0x3790ad){logger[_0x9414('0xf')](_0x9414('0xd'),_0x26bdea,_0x3790ad);_0x1945e6(_0x3790ad);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 652fbc9..fb66a60 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 _0xcc58=['fs-extra','../../components/interaction/service','../../config/environment','get','index','post','create','/:id','isAuthenticated','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x4ded61,_0x133b6b){var _0x2dcbea=function(_0x4804ab){while(--_0x4804ab){_0x4ded61['push'](_0x4ded61['shift']());}};_0x2dcbea(++_0x133b6b);}(_0xcc58,0x1e8));var _0x8cc5=function(_0x18c743,_0x58c7dc){_0x18c743=_0x18c743-0x0;var _0x391638=_0xcc58[_0x18c743];return _0x391638;};'use strict';var multer=require(_0x8cc5('0x0'));var util=require(_0x8cc5('0x1'));var path=require('path');var timeout=require(_0x8cc5('0x2'));var express=require(_0x8cc5('0x3'));var router=express[_0x8cc5('0x4')]();var fs_extra=require(_0x8cc5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8cc5('0x6'));var config=require(_0x8cc5('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x8cc5('0x8')]('/',auth['isAuthenticated'](),controller[_0x8cc5('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8cc5('0xa')]('/',auth['isAuthenticated'](),controller[_0x8cc5('0xb')]);router['put'](_0x8cc5('0xc'),auth[_0x8cc5('0xd')](),controller['update']);router[_0x8cc5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x8cc5('0xf')]);module[_0x8cc5('0x10')]=router; \ No newline at end of file +var _0xfa5b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xfa5b,0xc4));var _0xbfa5=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xfa5b[_0x46f1a6];return _0x38429a;};'use strict';var multer=require(_0xbfa5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbfa5('0x1'));var express=require(_0xbfa5('0x2'));var router=express[_0xbfa5('0x3')]();var fs_extra=require(_0xbfa5('0x4'));var auth=require(_0xbfa5('0x5'));var interaction=require(_0xbfa5('0x6'));var config=require('../../config/environment');var controller=require(_0xbfa5('0x7'));router[_0xbfa5('0x8')]('/',auth[_0xbfa5('0x9')](),controller['index']);router[_0xbfa5('0x8')](_0xbfa5('0xa'),auth[_0xbfa5('0x9')](),controller['show']);router[_0xbfa5('0xb')]('/',auth['isAuthenticated'](),controller[_0xbfa5('0xc')]);router[_0xbfa5('0xd')](_0xbfa5('0xa'),auth[_0xbfa5('0x9')](),controller[_0xbfa5('0xe')]);router[_0xbfa5('0xf')]('/:id',auth[_0xbfa5('0x9')](),controller[_0xbfa5('0x10')]);module[_0xbfa5('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 14aa618..9002949 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 _0xa246=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa246,0x182));var _0x6a24=function(_0x54621d,_0x46e154){_0x54621d=_0x54621d-0x0;var _0x19c48c=_0xa246[_0x54621d];return _0x19c48c;};'use strict';var Sequelize=require(_0x6a24('0x0'));module[_0x6a24('0x1')]={'type':{'type':Sequelize[_0x6a24('0x2')](_0x6a24('0x3'),_0x6a24('0x4'),_0x6a24('0x5'),_0x6a24('0x6'),_0x6a24('0x7')),'defaultValue':_0x6a24('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x6a24('0x3'),'variable',_0x6a24('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6a24('0x8')]},'nameField':{'type':Sequelize[_0x6a24('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6a24('0x8')]}}; \ No newline at end of file +var _0xde1b=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x3ff81e,_0x2f9f83){var _0x1ab1a3=function(_0xbbd30f){while(--_0xbbd30f){_0x3ff81e['push'](_0x3ff81e['shift']());}};_0x1ab1a3(++_0x2f9f83);}(_0xde1b,0x170));var _0xbde1=function(_0x553f48,_0x111afa){_0x553f48=_0x553f48-0x0;var _0x971a9f=_0xde1b[_0x553f48];return _0x971a9f;};'use strict';var Sequelize=require(_0xbde1('0x0'));module[_0xbde1('0x1')]={'type':{'type':Sequelize[_0xbde1('0x2')](_0xbde1('0x3'),_0xbde1('0x4'),_0xbde1('0x5'),_0xbde1('0x6'),_0xbde1('0x7')),'defaultValue':_0xbde1('0x3')},'content':{'type':Sequelize[_0xbde1('0x8')]},'key':{'type':Sequelize[_0xbde1('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xbde1('0x3'),_0xbde1('0x4'),_0xbde1('0x5'))},'keyContent':{'type':Sequelize[_0xbde1('0x8')]},'idField':{'type':Sequelize[_0xbde1('0x8')]},'nameField':{'type':Sequelize[_0xbde1('0x8')]},'customField':{'type':Sequelize[_0xbde1('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbde1('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index d1eafb6..0957855 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 _0x593e=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','map','FreshdeskField','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x5151e8,_0x4cc286){var _0x39a3bd=function(_0x2fb213){while(--_0x2fb213){_0x5151e8['push'](_0x5151e8['shift']());}};_0x39a3bd(++_0x4cc286);}(_0x593e,0xcb));var _0xe593=function(_0x14e5a4,_0x46699d){_0x14e5a4=_0x14e5a4-0x0;var _0x859da8=_0x593e[_0x14e5a4];return _0x859da8;};'use strict';var emlformat=require(_0xe593('0x0'));var rimraf=require(_0xe593('0x1'));var zipdir=require(_0xe593('0x2'));var jsonpatch=require(_0xe593('0x3'));var rp=require(_0xe593('0x4'));var moment=require(_0xe593('0x5'));var BPromise=require(_0xe593('0x6'));var Mustache=require(_0xe593('0x7'));var util=require('util');var path=require(_0xe593('0x8'));var sox=require(_0xe593('0x9'));var csv=require(_0xe593('0xa'));var ejs=require(_0xe593('0xb'));var fs=require('fs');var fs_extra=require(_0xe593('0xc'));var _=require(_0xe593('0xd'));var squel=require(_0xe593('0xe'));var crypto=require(_0xe593('0xf'));var jsforce=require(_0xe593('0x10'));var deskjs=require(_0xe593('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe593('0x12'));var Papa=require(_0xe593('0x13'));var Redis=require(_0xe593('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe593('0x15'));var hardwareService=require(_0xe593('0x16'));var logger=require(_0xe593('0x17'))('api');var utils=require(_0xe593('0x18'));var config=require(_0xe593('0x19'));var licenseUtil=require(_0xe593('0x1a'));var db=require(_0xe593('0x1b'))['db'];function respondWithStatusCode(_0x8ee313,_0x31dad0){_0x31dad0=_0x31dad0||0xcc;return function(_0x24c9fd){if(_0x24c9fd){return _0x8ee313[_0xe593('0x1c')](_0x31dad0);}return _0x8ee313[_0xe593('0x1d')](_0x31dad0)[_0xe593('0x1e')]();};}function respondWithResult(_0x499819,_0x2907e4){_0x2907e4=_0x2907e4||0xc8;return function(_0x1de391){if(_0x1de391){return _0x499819['status'](_0x2907e4)[_0xe593('0x1f')](_0x1de391);}};}function respondWithFilteredResult(_0x44837b,_0x5d4c6a){return function(_0x2ae9b6){if(_0x2ae9b6){var _0x40416c=typeof _0x5d4c6a[_0xe593('0x20')]===_0xe593('0x21')&&typeof _0x5d4c6a[_0xe593('0x22')]===_0xe593('0x21');var _0x48f3b4=_0x2ae9b6[_0xe593('0x23')];var _0x470d07=_0x40416c?0x0:_0x5d4c6a['offset'];var _0xd1020e=_0x40416c?_0x2ae9b6[_0xe593('0x23')]:_0x5d4c6a['offset']+_0x5d4c6a[_0xe593('0x22')];var _0x3dba1b;if(_0xd1020e>=_0x48f3b4){_0xd1020e=_0x48f3b4;_0x3dba1b=0xc8;}else{_0x3dba1b=0xce;}_0x44837b[_0xe593('0x1d')](_0x3dba1b);return _0x44837b[_0xe593('0x24')](_0xe593('0x25'),_0x470d07+'-'+_0xd1020e+'/'+_0x48f3b4)[_0xe593('0x1f')](_0x2ae9b6);}return null;};}function patchUpdates(_0x3d2a51){return function(_0x4ea53f){try{jsonpatch['apply'](_0x4ea53f,_0x3d2a51,!![]);}catch(_0x1634d4){return BPromise['reject'](_0x1634d4);}return _0x4ea53f['save']();};}function saveUpdates(_0x1bb8e8,_0x3c65b5){return function(_0x57379d){if(_0x57379d){return _0x57379d[_0xe593('0x26')](_0x1bb8e8)['then'](function(_0x1672bf){return _0x1672bf;});}return null;};}function removeEntity(_0x2c191f,_0x185cea){return function(_0x44d997){if(_0x44d997){return _0x44d997[_0xe593('0x27')]()[_0xe593('0x28')](function(){_0x2c191f[_0xe593('0x1d')](0xcc)[_0xe593('0x1e')]();});}};}function handleEntityNotFound(_0x4fc483,_0x47aea){return function(_0x347d7d){if(!_0x347d7d){_0x4fc483['sendStatus'](0x194);}return _0x347d7d;};}function handleError(_0x59bd4c,_0xf8d492){_0xf8d492=_0xf8d492||0x1f4;return function(_0x25238f){logger[_0xe593('0x29')](_0x25238f[_0xe593('0x2a')]);if(_0x25238f[_0xe593('0x2b')]){delete _0x25238f[_0xe593('0x2b')];}_0x59bd4c['status'](_0xf8d492)[_0xe593('0x2c')](_0x25238f);};}exports['index']=function(_0x1dacf6,_0xda61a7){var _0x4a2eaa={},_0x337ee0={},_0x561a01={'count':0x0,'rows':[]};var _0x44a68c=_[_0xe593('0x2d')](db[_0xe593('0x2e')]['rawAttributes'],function(_0x1ae8d9){return{'name':_0x1ae8d9[_0xe593('0x2f')],'type':_0x1ae8d9[_0xe593('0x30')][_0xe593('0x31')]};});_0x337ee0[_0xe593('0x32')]=_[_0xe593('0x2d')](_0x44a68c,_0xe593('0x2b'));_0x337ee0['query']=_[_0xe593('0x33')](_0x1dacf6[_0xe593('0x34')]);_0x337ee0['filters']=_[_0xe593('0x35')](_0x337ee0['model'],_0x337ee0[_0xe593('0x34')]);_0x4a2eaa[_0xe593('0x36')]=_[_0xe593('0x35')](_0x337ee0[_0xe593('0x32')],qs[_0xe593('0x37')](_0x1dacf6[_0xe593('0x34')][_0xe593('0x37')]));_0x4a2eaa[_0xe593('0x36')]=_0x4a2eaa[_0xe593('0x36')][_0xe593('0x38')]?_0x4a2eaa['attributes']:_0x337ee0[_0xe593('0x32')];if(!_0x1dacf6[_0xe593('0x34')][_0xe593('0x39')]('nolimit')){_0x4a2eaa['limit']=qs[_0xe593('0x22')](_0x1dacf6['query'][_0xe593('0x22')]);_0x4a2eaa[_0xe593('0x20')]=qs[_0xe593('0x20')](_0x1dacf6[_0xe593('0x34')][_0xe593('0x20')]);}_0x4a2eaa[_0xe593('0x3a')]=qs[_0xe593('0x3b')](_0x1dacf6['query']['sort']);_0x4a2eaa[_0xe593('0x3c')]=qs['filters'](_[_0xe593('0x3d')](_0x1dacf6['query'],_0x337ee0[_0xe593('0x3e')]),_0x44a68c);if(_0x1dacf6['query']['filter']){_0x4a2eaa[_0xe593('0x3c')]=_[_0xe593('0x3f')](_0x4a2eaa[_0xe593('0x3c')],{'$or':_['map'](_0x44a68c,function(_0x55d902){if(_0x55d902['type']!==_0xe593('0x40')){var _0x584945={};_0x584945[_0x55d902[_0xe593('0x2b')]]={'$like':'%'+_0x1dacf6[_0xe593('0x34')][_0xe593('0x41')]+'%'};return _0x584945;}})});}_0x4a2eaa=_[_0xe593('0x3f')]({},_0x4a2eaa,_0x1dacf6['options']);var _0x196325={'where':_0x4a2eaa['where']};return db[_0xe593('0x2e')]['count'](_0x196325)['then'](function(_0x590d34){_0x561a01[_0xe593('0x23')]=_0x590d34;if(_0x1dacf6['query'][_0xe593('0x42')]){_0x4a2eaa[_0xe593('0x43')]=[{'all':!![]}];}return db[_0xe593('0x2e')]['findAll'](_0x4a2eaa);})[_0xe593('0x28')](function(_0x3f9784){_0x561a01[_0xe593('0x44')]=_0x3f9784;return _0x561a01;})[_0xe593('0x28')](respondWithFilteredResult(_0xda61a7,_0x4a2eaa))[_0xe593('0x45')](handleError(_0xda61a7,null));};exports[_0xe593('0x46')]=function(_0x1236bb,_0x2e14d3){var _0x4b36e1={'raw':!![],'where':{'id':_0x1236bb[_0xe593('0x47')]['id']}},_0x211065={};_0x211065[_0xe593('0x32')]=_[_0xe593('0x33')](db[_0xe593('0x2e')]['rawAttributes']);_0x211065['query']=_[_0xe593('0x33')](_0x1236bb[_0xe593('0x34')]);_0x211065[_0xe593('0x3e')]=_['intersection'](_0x211065[_0xe593('0x32')],_0x211065[_0xe593('0x34')]);_0x4b36e1['attributes']=_['intersection'](_0x211065[_0xe593('0x32')],qs[_0xe593('0x37')](_0x1236bb[_0xe593('0x34')]['fields']));_0x4b36e1[_0xe593('0x36')]=_0x4b36e1[_0xe593('0x36')][_0xe593('0x38')]?_0x4b36e1[_0xe593('0x36')]:_0x211065['model'];if(_0x1236bb['query']['includeAll']){_0x4b36e1['include']=[{'all':!![]}];}_0x4b36e1=_[_0xe593('0x3f')]({},_0x4b36e1,_0x1236bb['options']);return db[_0xe593('0x2e')][_0xe593('0x48')](_0x4b36e1)[_0xe593('0x28')](handleEntityNotFound(_0x2e14d3,null))[_0xe593('0x28')](respondWithResult(_0x2e14d3,null))[_0xe593('0x45')](handleError(_0x2e14d3,null));};exports[_0xe593('0x49')]=function(_0x7b6f77,_0x297c3e){return db['FreshdeskField'][_0xe593('0x49')](_0x7b6f77[_0xe593('0x4a')],{})[_0xe593('0x28')](respondWithResult(_0x297c3e,0xc9))['catch'](handleError(_0x297c3e,null));};exports[_0xe593('0x26')]=function(_0x5dfdb1,_0x39ec9e){if(_0x5dfdb1[_0xe593('0x4a')]['id']){delete _0x5dfdb1[_0xe593('0x4a')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x5dfdb1[_0xe593('0x47')]['id']}})[_0xe593('0x28')](handleEntityNotFound(_0x39ec9e,null))['then'](saveUpdates(_0x5dfdb1['body'],null))['then'](respondWithResult(_0x39ec9e,null))['catch'](handleError(_0x39ec9e,null));};exports['destroy']=function(_0x383645,_0x1e48d8){return db[_0xe593('0x2e')][_0xe593('0x48')]({'where':{'id':_0x383645[_0xe593('0x47')]['id']}})[_0xe593('0x28')](handleEntityNotFound(_0x1e48d8,null))[_0xe593('0x28')](removeEntity(_0x1e48d8,null))[_0xe593('0x45')](handleError(_0x1e48d8,null));}; \ No newline at end of file +var _0xfe57=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','save','update','then','name','send','map','FreshdeskField','fieldName','key','model','query','filters','intersection','fields','attributes','length','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','params','keys','includeAll','find','catch','create','body','destroy','eml-format','rimraf','request-promise'];(function(_0x2ecc79,_0x1ec9f1){var _0x20d579=function(_0x5db6be){while(--_0x5db6be){_0x2ecc79['push'](_0x2ecc79['shift']());}};_0x20d579(++_0x1ec9f1);}(_0xfe57,0x195));var _0x7fe5=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0xfe57[_0x470bfb];return _0x2f5d97;};'use strict';var emlformat=require(_0x7fe5('0x0'));var rimraf=require(_0x7fe5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7fe5('0x2'));var moment=require(_0x7fe5('0x3'));var BPromise=require(_0x7fe5('0x4'));var Mustache=require(_0x7fe5('0x5'));var util=require(_0x7fe5('0x6'));var path=require(_0x7fe5('0x7'));var sox=require(_0x7fe5('0x8'));var csv=require(_0x7fe5('0x9'));var ejs=require(_0x7fe5('0xa'));var fs=require('fs');var fs_extra=require(_0x7fe5('0xb'));var _=require(_0x7fe5('0xc'));var squel=require(_0x7fe5('0xd'));var crypto=require(_0x7fe5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7fe5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7fe5('0x10'));var Papa=require(_0x7fe5('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7fe5('0x12'));var as=require(_0x7fe5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fe5('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7fe5('0x15'));var licenseUtil=require(_0x7fe5('0x16'));var db=require(_0x7fe5('0x17'))['db'];function respondWithStatusCode(_0x225fc3,_0x53f76c){_0x53f76c=_0x53f76c||0xcc;return function(_0x329c95){if(_0x329c95){return _0x225fc3[_0x7fe5('0x18')](_0x53f76c);}return _0x225fc3['status'](_0x53f76c)[_0x7fe5('0x19')]();};}function respondWithResult(_0x54cfb2,_0x1f84b5){_0x1f84b5=_0x1f84b5||0xc8;return function(_0x2d297b){if(_0x2d297b){return _0x54cfb2['status'](_0x1f84b5)[_0x7fe5('0x1a')](_0x2d297b);}};}function respondWithFilteredResult(_0x56e76f,_0x39f175){return function(_0x221ab2){if(_0x221ab2){var _0xbdf0a4=typeof _0x39f175[_0x7fe5('0x1b')]===_0x7fe5('0x1c')&&typeof _0x39f175[_0x7fe5('0x1d')]==='undefined';var _0x166e23=_0x221ab2[_0x7fe5('0x1e')];var _0x340d5e=_0xbdf0a4?0x0:_0x39f175[_0x7fe5('0x1b')];var _0x2533db=_0xbdf0a4?_0x221ab2[_0x7fe5('0x1e')]:_0x39f175[_0x7fe5('0x1b')]+_0x39f175[_0x7fe5('0x1d')];var _0x478523;if(_0x2533db>=_0x166e23){_0x2533db=_0x166e23;_0x478523=0xc8;}else{_0x478523=0xce;}_0x56e76f[_0x7fe5('0x1f')](_0x478523);return _0x56e76f['set']('Content-Range',_0x340d5e+'-'+_0x2533db+'/'+_0x166e23)[_0x7fe5('0x1a')](_0x221ab2);}return null;};}function patchUpdates(_0x459c2d){return function(_0x2f6592){try{jsonpatch[_0x7fe5('0x20')](_0x2f6592,_0x459c2d,!![]);}catch(_0x39c560){return BPromise[_0x7fe5('0x21')](_0x39c560);}return _0x2f6592[_0x7fe5('0x22')]();};}function saveUpdates(_0xdd9df7,_0x1b271c){return function(_0x28a7fd){if(_0x28a7fd){return _0x28a7fd[_0x7fe5('0x23')](_0xdd9df7)[_0x7fe5('0x24')](function(_0x54ee98){return _0x54ee98;});}return null;};}function removeEntity(_0x3e7340,_0x2f39e0){return function(_0x43e547){if(_0x43e547){return _0x43e547['destroy']()[_0x7fe5('0x24')](function(){_0x3e7340['status'](0xcc)[_0x7fe5('0x19')]();});}};}function handleEntityNotFound(_0x53f522,_0x5c3b37){return function(_0x190355){if(!_0x190355){_0x53f522[_0x7fe5('0x18')](0x194);}return _0x190355;};}function handleError(_0x2a96f4,_0x399c55){_0x399c55=_0x399c55||0x1f4;return function(_0x4393c3){logger['error'](_0x4393c3['stack']);if(_0x4393c3[_0x7fe5('0x25')]){delete _0x4393c3[_0x7fe5('0x25')];}_0x2a96f4[_0x7fe5('0x1f')](_0x399c55)[_0x7fe5('0x26')](_0x4393c3);};}exports['index']=function(_0x46f816,_0x4a77e9){var _0x150ab9={},_0x1420de={},_0x204bc8={'count':0x0,'rows':[]};var _0x28a689=_[_0x7fe5('0x27')](db[_0x7fe5('0x28')]['rawAttributes'],function(_0xe521c6){return{'name':_0xe521c6[_0x7fe5('0x29')],'type':_0xe521c6['type'][_0x7fe5('0x2a')]};});_0x1420de[_0x7fe5('0x2b')]=_[_0x7fe5('0x27')](_0x28a689,_0x7fe5('0x25'));_0x1420de[_0x7fe5('0x2c')]=_['keys'](_0x46f816['query']);_0x1420de[_0x7fe5('0x2d')]=_[_0x7fe5('0x2e')](_0x1420de[_0x7fe5('0x2b')],_0x1420de[_0x7fe5('0x2c')]);_0x150ab9['attributes']=_[_0x7fe5('0x2e')](_0x1420de[_0x7fe5('0x2b')],qs[_0x7fe5('0x2f')](_0x46f816[_0x7fe5('0x2c')][_0x7fe5('0x2f')]));_0x150ab9[_0x7fe5('0x30')]=_0x150ab9['attributes'][_0x7fe5('0x31')]?_0x150ab9[_0x7fe5('0x30')]:_0x1420de[_0x7fe5('0x2b')];if(!_0x46f816[_0x7fe5('0x2c')]['hasOwnProperty']('nolimit')){_0x150ab9[_0x7fe5('0x1d')]=qs['limit'](_0x46f816[_0x7fe5('0x2c')]['limit']);_0x150ab9[_0x7fe5('0x1b')]=qs['offset'](_0x46f816['query']['offset']);}_0x150ab9['order']=qs[_0x7fe5('0x32')](_0x46f816[_0x7fe5('0x2c')]['sort']);_0x150ab9[_0x7fe5('0x33')]=qs[_0x7fe5('0x2d')](_['pick'](_0x46f816[_0x7fe5('0x2c')],_0x1420de['filters']),_0x28a689);if(_0x46f816['query'][_0x7fe5('0x34')]){_0x150ab9[_0x7fe5('0x33')]=_[_0x7fe5('0x35')](_0x150ab9[_0x7fe5('0x33')],{'$or':_[_0x7fe5('0x27')](_0x28a689,function(_0x4c4b05){if(_0x4c4b05[_0x7fe5('0x36')]!==_0x7fe5('0x37')){var _0x5839b2={};_0x5839b2[_0x4c4b05[_0x7fe5('0x25')]]={'$like':'%'+_0x46f816[_0x7fe5('0x2c')][_0x7fe5('0x34')]+'%'};return _0x5839b2;}})});}_0x150ab9=_[_0x7fe5('0x35')]({},_0x150ab9,_0x46f816[_0x7fe5('0x38')]);var _0x1c81c8={'where':_0x150ab9[_0x7fe5('0x33')]};return db['FreshdeskField']['count'](_0x1c81c8)[_0x7fe5('0x24')](function(_0x5f5db0){_0x204bc8[_0x7fe5('0x1e')]=_0x5f5db0;if(_0x46f816[_0x7fe5('0x2c')]['includeAll']){_0x150ab9[_0x7fe5('0x39')]=[{'all':!![]}];}return db[_0x7fe5('0x28')][_0x7fe5('0x3a')](_0x150ab9);})[_0x7fe5('0x24')](function(_0x2fd004){_0x204bc8[_0x7fe5('0x3b')]=_0x2fd004;return _0x204bc8;})[_0x7fe5('0x24')](respondWithFilteredResult(_0x4a77e9,_0x150ab9))['catch'](handleError(_0x4a77e9,null));};exports['show']=function(_0x411002,_0x4f81ca){var _0xad0b05={'raw':!![],'where':{'id':_0x411002[_0x7fe5('0x3c')]['id']}},_0x1a3e0d={};_0x1a3e0d[_0x7fe5('0x2b')]=_['keys'](db[_0x7fe5('0x28')]['rawAttributes']);_0x1a3e0d['query']=_[_0x7fe5('0x3d')](_0x411002[_0x7fe5('0x2c')]);_0x1a3e0d['filters']=_[_0x7fe5('0x2e')](_0x1a3e0d[_0x7fe5('0x2b')],_0x1a3e0d[_0x7fe5('0x2c')]);_0xad0b05[_0x7fe5('0x30')]=_[_0x7fe5('0x2e')](_0x1a3e0d['model'],qs[_0x7fe5('0x2f')](_0x411002[_0x7fe5('0x2c')]['fields']));_0xad0b05[_0x7fe5('0x30')]=_0xad0b05[_0x7fe5('0x30')][_0x7fe5('0x31')]?_0xad0b05[_0x7fe5('0x30')]:_0x1a3e0d['model'];if(_0x411002[_0x7fe5('0x2c')][_0x7fe5('0x3e')]){_0xad0b05[_0x7fe5('0x39')]=[{'all':!![]}];}_0xad0b05=_['merge']({},_0xad0b05,_0x411002[_0x7fe5('0x38')]);return db[_0x7fe5('0x28')][_0x7fe5('0x3f')](_0xad0b05)['then'](handleEntityNotFound(_0x4f81ca,null))[_0x7fe5('0x24')](respondWithResult(_0x4f81ca,null))[_0x7fe5('0x40')](handleError(_0x4f81ca,null));};exports[_0x7fe5('0x41')]=function(_0x4b8642,_0x19c4a6){return db[_0x7fe5('0x28')][_0x7fe5('0x41')](_0x4b8642[_0x7fe5('0x42')],{})[_0x7fe5('0x24')](respondWithResult(_0x19c4a6,0xc9))[_0x7fe5('0x40')](handleError(_0x19c4a6,null));};exports[_0x7fe5('0x23')]=function(_0x447b57,_0x446f01){if(_0x447b57[_0x7fe5('0x42')]['id']){delete _0x447b57[_0x7fe5('0x42')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x447b57['params']['id']}})['then'](handleEntityNotFound(_0x446f01,null))[_0x7fe5('0x24')](saveUpdates(_0x447b57['body'],null))[_0x7fe5('0x24')](respondWithResult(_0x446f01,null))[_0x7fe5('0x40')](handleError(_0x446f01,null));};exports[_0x7fe5('0x43')]=function(_0x1d9ca8,_0x362f33){return db['FreshdeskField'][_0x7fe5('0x3f')]({'where':{'id':_0x1d9ca8[_0x7fe5('0x3c')]['id']}})[_0x7fe5('0x24')](handleEntityNotFound(_0x362f33,null))[_0x7fe5('0x24')](removeEntity(_0x362f33,null))[_0x7fe5('0x40')](handleError(_0x362f33,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index f6c55b0..f640c4f 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 _0x6b19=['FieldId','lodash','util','api','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','freshdesk_unique_index'];(function(_0x5c8614,_0x126dca){var _0x4ca884=function(_0x28543d){while(--_0x28543d){_0x5c8614['push'](_0x5c8614['shift']());}};_0x4ca884(++_0x126dca);}(_0x6b19,0xe8));var _0x96b1=function(_0x1736be,_0x3061d2){_0x1736be=_0x1736be-0x0;var _0x44f4f4=_0x6b19[_0x1736be];return _0x44f4f4;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var logger=require('../../config/logger')(_0x96b1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x96b1('0x3'));var fs=require('fs');var path=require(_0x96b1('0x4'));var rimraf=require(_0x96b1('0x5'));var config=require(_0x96b1('0x6'));var attributes=require(_0x96b1('0x7'));module['exports']=function(_0x8b5ab8,_0x546193){return _0x8b5ab8[_0x96b1('0x8')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x96b1('0x9'),'fields':['idField',_0x96b1('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7005=['../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1bdfb6,_0x2dd242){var _0x5c124d=function(_0x3af4c3){while(--_0x3af4c3){_0x1bdfb6['push'](_0x1bdfb6['shift']());}};_0x5c124d(++_0x2dd242);}(_0x7005,0x148));var _0x5700=function(_0x157fa2,_0xef76ec){_0x157fa2=_0x157fa2-0x0;var _0x45418e=_0x7005[_0x157fa2];return _0x45418e;};'use strict';var _=require('lodash');var util=require(_0x5700('0x0'));var logger=require(_0x5700('0x1'))(_0x5700('0x2'));var moment=require(_0x5700('0x3'));var BPromise=require(_0x5700('0x4'));var rp=require(_0x5700('0x5'));var fs=require('fs');var path=require(_0x5700('0x6'));var rimraf=require(_0x5700('0x7'));var config=require(_0x5700('0x8'));var attributes=require(_0x5700('0x9'));module['exports']=function(_0x97c365,_0x212fab){return _0x97c365[_0x5700('0xa')](_0x5700('0xb'),attributes,{'tableName':_0x5700('0xc'),'paranoid':![],'indexes':[{'name':_0x5700('0xd'),'fields':[_0x5700('0xe'),_0x5700('0xf')],'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 ed55904..8c78c01 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 _0x898e=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x31c949,_0x3203cb){var _0x584fb5=function(_0x4bd390){while(--_0x4bd390){_0x31c949['push'](_0x31c949['shift']());}};_0x584fb5(++_0x3203cb);}(_0x898e,0x8a));var _0xe898=function(_0x2537a2,_0x26f290){_0x2537a2=_0x2537a2-0x0;var _0xb761ac=_0x898e[_0x2537a2];return _0xb761ac;};'use strict';var _=require(_0xe898('0x0'));var util=require(_0xe898('0x1'));var moment=require(_0xe898('0x2'));var BPromise=require(_0xe898('0x3'));var rs=require(_0xe898('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe898('0x5'))['db'];var utils=require(_0xe898('0x6'));var logger=require('../../config/logger')(_0xe898('0x7'));var config=require(_0xe898('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe898('0x9')][_0xe898('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d7cf8,_0x11fb0d,_0x10629f){return new BPromise(function(_0x56be92,_0x1580ae){return client[_0xe898('0xb')](_0x5d7cf8,_0x10629f)[_0xe898('0xc')](function(_0x55b6ca){logger[_0xe898('0xd')](_0xe898('0xe'),_0x11fb0d,_0xe898('0xf'));logger[_0xe898('0x10')](_0xe898('0x11'),_0x11fb0d,_0xe898('0xf'),JSON[_0xe898('0x12')](_0x55b6ca));if(_0x55b6ca[_0xe898('0x13')]){if(_0x55b6ca[_0xe898('0x13')][_0xe898('0x14')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x11fb0d,_0x55b6ca[_0xe898('0x13')][_0xe898('0x15')]);return _0x1580ae(_0x55b6ca[_0xe898('0x13')][_0xe898('0x15')]);}logger[_0xe898('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x11fb0d,_0x55b6ca[_0xe898('0x13')][_0xe898('0x15')]);return _0x56be92(_0x55b6ca[_0xe898('0x13')][_0xe898('0x15')]);}else{logger[_0xe898('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x11fb0d,_0xe898('0xf'));_0x56be92(_0x55b6ca[_0xe898('0x16')]['message']);}})[_0xe898('0x17')](function(_0x5b867d){logger['error'](_0xe898('0xe'),_0x11fb0d,_0x5b867d);_0x1580ae(_0x5b867d);});});} \ No newline at end of file +var _0xf1a4=['catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','error','code','FreshdeskField,\x20%s,\x20%s','message','result'];(function(_0x1a5a09,_0x4a4f52){var _0x2868d0=function(_0x19acfd){while(--_0x19acfd){_0x1a5a09['push'](_0x1a5a09['shift']());}};_0x2868d0(++_0x4a4f52);}(_0xf1a4,0x79));var _0x4f1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1a4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4f1a('0x0'));var util=require(_0x4f1a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4f1a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f1a('0x3'))['db'];var utils=require(_0x4f1a('0x4'));var logger=require(_0x4f1a('0x5'))(_0x4f1a('0x6'));var config=require(_0x4f1a('0x7'));var jayson=require(_0x4f1a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x306ebe,_0x104421,_0x1b01df){return new BPromise(function(_0x515276,_0x4e8920){return client[_0x4f1a('0x9')](_0x306ebe,_0x1b01df)[_0x4f1a('0xa')](function(_0xc28a08){logger[_0x4f1a('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x104421,_0x4f1a('0xc'));logger[_0x4f1a('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x104421,_0x4f1a('0xc'),JSON['stringify'](_0xc28a08));if(_0xc28a08['error']){if(_0xc28a08[_0x4f1a('0xe')][_0x4f1a('0xf')]===0x1f4){logger['error'](_0x4f1a('0x10'),_0x104421,_0xc28a08[_0x4f1a('0xe')][_0x4f1a('0x11')]);return _0x4e8920(_0xc28a08[_0x4f1a('0xe')][_0x4f1a('0x11')]);}logger['error'](_0x4f1a('0x10'),_0x104421,_0xc28a08[_0x4f1a('0xe')]['message']);return _0x515276(_0xc28a08[_0x4f1a('0xe')][_0x4f1a('0x11')]);}else{logger[_0x4f1a('0xb')](_0x4f1a('0x10'),_0x104421,_0x4f1a('0xc'));_0x515276(_0xc28a08[_0x4f1a('0x12')][_0x4f1a('0x11')]);}})[_0x4f1a('0x13')](function(_0x29e312){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x104421,_0x29e312);_0x4e8920(_0x29e312);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 5bff6d4..151f373 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 _0x0972=['create','addConfiguration','put','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x0972,0x64));var _0x2097=function(_0x2b610e,_0x5bc192){_0x2b610e=_0x2b610e-0x0;var _0x4b7611=_0x0972[_0x2b610e];return _0x4b7611;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/:id',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['getConfigurations']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0xe')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0xe')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller[_0x2097('0x10')]);router[_0x2097('0x11')](_0x2097('0x12'),auth[_0x2097('0x8')](),controller[_0x2097('0x13')]);router[_0x2097('0x14')](_0x2097('0x12'),auth[_0x2097('0x8')](),controller[_0x2097('0x15')]);module[_0x2097('0x16')]=router; \ No newline at end of file +var _0xb62e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index','get','show','/:id/configurations','/:id/fields','getFields','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','Router'];(function(_0x3c47e9,_0x2fa0e6){var _0x17fe2e=function(_0x1c28ab){while(--_0x1c28ab){_0x3c47e9['push'](_0x3c47e9['shift']());}};_0x17fe2e(++_0x2fa0e6);}(_0xb62e,0x1de));var _0xeb62=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xb62e[_0x1035c1];return _0x308d67;};'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('0xc')](_0xeb62('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xeb62('0xc')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0x11')]('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);router[_0xeb62('0x11')](_0xeb62('0xe'),auth[_0xeb62('0xa')](),controller['addConfiguration']);router[_0xeb62('0x13')](_0xeb62('0x14'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x15')]);router['delete'](_0xeb62('0x14'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 250fd5b..7ec1d24 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(_0x1a58cf,_0x7ce26c){var _0x4b30cd=function(_0x56fc85){while(--_0x56fc85){_0x1a58cf['push'](_0x1a58cf['shift']());}};_0x4b30cd(++_0x7ce26c);}(_0x7880,0x1f4));var _0x0788=function(_0x34651f,_0x1b07dd){_0x34651f=_0x34651f-0x0;var _0x2d88fe=_0x7880[_0x34651f];return _0x2d88fe;};'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 _0x5204=['exports','STRING','username','sequelize'];(function(_0x1ff7c2,_0x6433f9){var _0x4ed378=function(_0x32dcec){while(--_0x32dcec){_0x1ff7c2['push'](_0x1ff7c2['shift']());}};_0x4ed378(++_0x6433f9);}(_0x5204,0xdf));var _0x4520=function(_0xf4666e,_0x571140){_0xf4666e=_0xf4666e-0x0;var _0x1853f1=_0x5204[_0xf4666e];return _0x1853f1;};'use strict';var Sequelize=require(_0x4520('0x0'));module[_0x4520('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4520('0x2')]},'username':{'type':Sequelize[_0x4520('0x2')],'unique':_0x4520('0x3')},'apiKey':{'type':Sequelize[_0x4520('0x2')]},'remoteUri':{'type':Sequelize[_0x4520('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4520('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 df85f11..c7ef5aa 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 _0x5c91=['../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','FreshsalesAccount','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','apiKey','slice','%s%s','/api/selector/owners','Token\x20token=','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1d6e70,_0x19134f){var _0x42d627=function(_0x18c993){while(--_0x18c993){_0x1d6e70['push'](_0x1d6e70['shift']());}};_0x42d627(++_0x19134f);}(_0x5c91,0x110));var _0x15c9=function(_0x448ec7,_0x5c3f72){_0x448ec7=_0x448ec7-0x0;var _0x234108=_0x5c91[_0x448ec7];return _0x234108;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x15c9('0x0'));var rp=require(_0x15c9('0x1'));var moment=require(_0x15c9('0x2'));var BPromise=require(_0x15c9('0x3'));var Mustache=require(_0x15c9('0x4'));var util=require(_0x15c9('0x5'));var path=require('path');var sox=require(_0x15c9('0x6'));var csv=require(_0x15c9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15c9('0x8'));var squel=require('squel');var crypto=require(_0x15c9('0x9'));var jsforce=require(_0x15c9('0xa'));var deskjs=require(_0x15c9('0xb'));var toCsv=require(_0x15c9('0x7'));var querystring=require(_0x15c9('0xc'));var Papa=require('papaparse');var Redis=require(_0x15c9('0xd'));var authService=require(_0x15c9('0xe'));var qs=require(_0x15c9('0xf'));var as=require(_0x15c9('0x10'));var hardwareService=require(_0x15c9('0x11'));var logger=require(_0x15c9('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x15c9('0x13'));var licenseUtil=require(_0x15c9('0x14'));var db=require(_0x15c9('0x15'))['db'];var integrations=require(_0x15c9('0x16'));function respondWithStatusCode(_0x4fc27a,_0x51c8d4){_0x51c8d4=_0x51c8d4||0xcc;return function(_0x2a681b){if(_0x2a681b){return _0x4fc27a['sendStatus'](_0x51c8d4);}return _0x4fc27a[_0x15c9('0x17')](_0x51c8d4)[_0x15c9('0x18')]();};}function respondWithResult(_0x32d0ae,_0x35223c){_0x35223c=_0x35223c||0xc8;return function(_0x3bd4bd){if(_0x3bd4bd){return _0x32d0ae[_0x15c9('0x17')](_0x35223c)[_0x15c9('0x19')](_0x3bd4bd);}};}function respondWithFilteredResult(_0xd8cd52,_0x3eae5a){return function(_0x1d8a0c){if(_0x1d8a0c){var _0x2b7f5b=typeof _0x3eae5a['offset']===_0x15c9('0x1a')&&typeof _0x3eae5a[_0x15c9('0x1b')]===_0x15c9('0x1a');var _0x156a26=_0x1d8a0c[_0x15c9('0x1c')];var _0x50ff64=_0x2b7f5b?0x0:_0x3eae5a['offset'];var _0x284597=_0x2b7f5b?_0x1d8a0c[_0x15c9('0x1c')]:_0x3eae5a['offset']+_0x3eae5a[_0x15c9('0x1b')];var _0x3888b8;if(_0x284597>=_0x156a26){_0x284597=_0x156a26;_0x3888b8=0xc8;}else{_0x3888b8=0xce;}_0xd8cd52[_0x15c9('0x17')](_0x3888b8);return _0xd8cd52['set'](_0x15c9('0x1d'),_0x50ff64+'-'+_0x284597+'/'+_0x156a26)[_0x15c9('0x19')](_0x1d8a0c);}return null;};}function patchUpdates(_0x4dfdd5){return function(_0x10e6d8){try{jsonpatch[_0x15c9('0x1e')](_0x10e6d8,_0x4dfdd5,!![]);}catch(_0x512352){return BPromise[_0x15c9('0x1f')](_0x512352);}return _0x10e6d8[_0x15c9('0x20')]();};}function saveUpdates(_0xa01119,_0x1afde){return function(_0x48564d){if(_0x48564d){return _0x48564d[_0x15c9('0x21')](_0xa01119)[_0x15c9('0x22')](function(_0x54f739){return _0x54f739;});}return null;};}function removeEntity(_0x5114fe,_0x4fb2e1){return function(_0x15c59d){if(_0x15c59d){return _0x15c59d[_0x15c9('0x23')]()[_0x15c9('0x22')](function(){_0x5114fe[_0x15c9('0x17')](0xcc)[_0x15c9('0x18')]();});}};}function handleEntityNotFound(_0x50954a,_0x57b5c5){return function(_0x3c04e6){if(!_0x3c04e6){_0x50954a[_0x15c9('0x24')](0x194);}return _0x3c04e6;};}function handleError(_0x4a7576,_0x3c0728){_0x3c0728=_0x3c0728||0x1f4;return function(_0x59c851){logger['error'](_0x59c851[_0x15c9('0x25')]);if(_0x59c851['name']){delete _0x59c851['name'];}_0x4a7576['status'](_0x3c0728)[_0x15c9('0x26')](_0x59c851);};}exports[_0x15c9('0x27')]=function(_0x430a02,_0xd56d86){var _0x18cb7b={},_0x35a5c9={},_0x472d04={'count':0x0,'rows':[]};var _0x2137b9=_[_0x15c9('0x28')](db[_0x15c9('0x29')][_0x15c9('0x2a')],function(_0x1a82b){return{'name':_0x1a82b['fieldName'],'type':_0x1a82b[_0x15c9('0x2b')][_0x15c9('0x2c')]};});_0x35a5c9[_0x15c9('0x2d')]=_[_0x15c9('0x28')](_0x2137b9,_0x15c9('0x2e'));_0x35a5c9[_0x15c9('0x2f')]=_['keys'](_0x430a02[_0x15c9('0x2f')]);_0x35a5c9[_0x15c9('0x30')]=_[_0x15c9('0x31')](_0x35a5c9[_0x15c9('0x2d')],_0x35a5c9[_0x15c9('0x2f')]);_0x18cb7b[_0x15c9('0x32')]=_[_0x15c9('0x31')](_0x35a5c9[_0x15c9('0x2d')],qs['fields'](_0x430a02[_0x15c9('0x2f')][_0x15c9('0x33')]));_0x18cb7b[_0x15c9('0x32')]=_0x18cb7b[_0x15c9('0x32')][_0x15c9('0x34')]?_0x18cb7b[_0x15c9('0x32')]:_0x35a5c9[_0x15c9('0x2d')];if(!_0x430a02[_0x15c9('0x2f')][_0x15c9('0x35')](_0x15c9('0x36'))){_0x18cb7b[_0x15c9('0x1b')]=qs[_0x15c9('0x1b')](_0x430a02[_0x15c9('0x2f')][_0x15c9('0x1b')]);_0x18cb7b[_0x15c9('0x37')]=qs['offset'](_0x430a02[_0x15c9('0x2f')][_0x15c9('0x37')]);}_0x18cb7b[_0x15c9('0x38')]=qs[_0x15c9('0x39')](_0x430a02[_0x15c9('0x2f')][_0x15c9('0x39')]);_0x18cb7b['where']=qs[_0x15c9('0x30')](_[_0x15c9('0x3a')](_0x430a02['query'],_0x35a5c9[_0x15c9('0x30')]),_0x2137b9);if(_0x430a02['query'][_0x15c9('0x3b')]){_0x18cb7b['where']=_[_0x15c9('0x3c')](_0x18cb7b[_0x15c9('0x3d')],{'$or':_[_0x15c9('0x28')](_0x2137b9,function(_0x243c53){if(_0x243c53[_0x15c9('0x2b')]!==_0x15c9('0x3e')){var _0xedabf6={};_0xedabf6[_0x243c53[_0x15c9('0x2e')]]={'$like':'%'+_0x430a02[_0x15c9('0x2f')][_0x15c9('0x3b')]+'%'};return _0xedabf6;}})});}_0x18cb7b=_[_0x15c9('0x3c')]({},_0x18cb7b,_0x430a02['options']);var _0x4e418c={'where':_0x18cb7b[_0x15c9('0x3d')]};return db[_0x15c9('0x29')]['count'](_0x4e418c)['then'](function(_0x183924){_0x472d04['count']=_0x183924;if(_0x430a02[_0x15c9('0x2f')][_0x15c9('0x3f')]){_0x18cb7b['include']=[{'all':!![]}];}return db[_0x15c9('0x29')][_0x15c9('0x40')](_0x18cb7b);})[_0x15c9('0x22')](function(_0x356e6e){_0x472d04[_0x15c9('0x41')]=_0x356e6e;return _0x472d04;})['then'](respondWithFilteredResult(_0xd56d86,_0x18cb7b))[_0x15c9('0x42')](handleError(_0xd56d86,null));};exports[_0x15c9('0x43')]=function(_0x4c1ffe,_0x391ddb){var _0x1c1535={'raw':![],'where':{'id':_0x4c1ffe[_0x15c9('0x44')]['id']}},_0x44ac7e={};_0x44ac7e['model']=_[_0x15c9('0x45')](db[_0x15c9('0x29')]['rawAttributes']);_0x44ac7e[_0x15c9('0x2f')]=_[_0x15c9('0x45')](_0x4c1ffe[_0x15c9('0x2f')]);_0x44ac7e[_0x15c9('0x30')]=_[_0x15c9('0x31')](_0x44ac7e[_0x15c9('0x2d')],_0x44ac7e[_0x15c9('0x2f')]);_0x1c1535[_0x15c9('0x32')]=_['intersection'](_0x44ac7e[_0x15c9('0x2d')],qs[_0x15c9('0x33')](_0x4c1ffe[_0x15c9('0x2f')][_0x15c9('0x33')]));_0x1c1535[_0x15c9('0x32')]=_0x1c1535['attributes'][_0x15c9('0x34')]?_0x1c1535[_0x15c9('0x32')]:_0x44ac7e[_0x15c9('0x2d')];if(_0x4c1ffe[_0x15c9('0x2f')][_0x15c9('0x3f')]){_0x1c1535[_0x15c9('0x46')]=[{'all':!![]}];}_0x1c1535=_[_0x15c9('0x3c')]({},_0x1c1535,_0x4c1ffe[_0x15c9('0x47')]);return db[_0x15c9('0x29')][_0x15c9('0x48')](_0x1c1535)[_0x15c9('0x22')](handleEntityNotFound(_0x391ddb,null))[_0x15c9('0x22')](respondWithResult(_0x391ddb,null))['catch'](handleError(_0x391ddb,null));};exports['create']=function(_0x26d9df,_0x351b6c){return db[_0x15c9('0x29')][_0x15c9('0x49')](_0x26d9df['body'],{})['then'](respondWithResult(_0x351b6c,0xc9))['catch'](handleError(_0x351b6c,null));};exports[_0x15c9('0x21')]=function(_0x1aee88,_0x31c9d2){if(_0x1aee88[_0x15c9('0x4a')]['id']){delete _0x1aee88[_0x15c9('0x4a')]['id'];}return db[_0x15c9('0x29')][_0x15c9('0x48')]({'where':{'id':_0x1aee88['params']['id']}})['then'](handleEntityNotFound(_0x31c9d2,null))['then'](saveUpdates(_0x1aee88[_0x15c9('0x4a')],null))[_0x15c9('0x22')](respondWithResult(_0x31c9d2,null))[_0x15c9('0x42')](handleError(_0x31c9d2,null));};exports['destroy']=function(_0x216dba,_0x3cf68f){return db[_0x15c9('0x29')][_0x15c9('0x48')]({'where':{'id':_0x216dba['params']['id']}})[_0x15c9('0x22')](handleEntityNotFound(_0x3cf68f,null))[_0x15c9('0x22')](removeEntity(_0x3cf68f,null))[_0x15c9('0x42')](handleError(_0x3cf68f,null));};exports[_0x15c9('0x4b')]=function(_0x412c25,_0x58411d,_0x34fe7e){var _0x56b5e7={};var _0x26f39b={};var _0x429fb7;var _0x154b81;return db[_0x15c9('0x29')][_0x15c9('0x4c')]({'where':{'id':_0x412c25['params']['id']}})['then'](handleEntityNotFound(_0x58411d,null))[_0x15c9('0x22')](function(_0x1724e5){if(_0x1724e5){_0x429fb7=_0x1724e5;_0x26f39b['model']=_[_0x15c9('0x45')](db['FreshsalesConfiguration']['rawAttributes']);_0x26f39b['query']=_[_0x15c9('0x45')](_0x412c25[_0x15c9('0x2f')]);_0x26f39b[_0x15c9('0x30')]=_[_0x15c9('0x31')](_0x26f39b['model'],_0x26f39b[_0x15c9('0x2f')]);_0x56b5e7[_0x15c9('0x32')]=_[_0x15c9('0x31')](_0x26f39b[_0x15c9('0x2d')],qs[_0x15c9('0x33')](_0x412c25[_0x15c9('0x2f')]['fields']));_0x56b5e7['attributes']=_0x56b5e7[_0x15c9('0x32')]['length']?_0x56b5e7[_0x15c9('0x32')]:_0x26f39b[_0x15c9('0x2d')];_0x56b5e7[_0x15c9('0x38')]=qs[_0x15c9('0x39')](_0x412c25['query'][_0x15c9('0x39')]);_0x56b5e7[_0x15c9('0x3d')]=qs[_0x15c9('0x30')](_['pick'](_0x412c25[_0x15c9('0x2f')],_0x26f39b[_0x15c9('0x30')]));if(_0x412c25[_0x15c9('0x2f')][_0x15c9('0x3b')]){_0x56b5e7[_0x15c9('0x3d')]=_[_0x15c9('0x3c')](_0x56b5e7[_0x15c9('0x3d')],{'$or':_[_0x15c9('0x28')](_0x56b5e7[_0x15c9('0x32')],function(_0x1e76cd){var _0x177a6a={};_0x177a6a[_0x1e76cd]={'$like':'%'+_0x412c25[_0x15c9('0x2f')][_0x15c9('0x3b')]+'%'};return _0x177a6a;})});}_0x56b5e7=_[_0x15c9('0x3c')]({},_0x56b5e7,_0x412c25[_0x15c9('0x47')]);return _0x429fb7[_0x15c9('0x4b')](_0x56b5e7);}})[_0x15c9('0x22')](function(_0x4e294d){if(_0x4e294d){_0x154b81=_0x4e294d[_0x15c9('0x34')];if(!_0x412c25['query'][_0x15c9('0x35')]('nolimit')){_0x56b5e7[_0x15c9('0x1b')]=qs[_0x15c9('0x1b')](_0x412c25[_0x15c9('0x2f')][_0x15c9('0x1b')]);_0x56b5e7['offset']=qs[_0x15c9('0x37')](_0x412c25['query'][_0x15c9('0x37')]);}return _0x429fb7[_0x15c9('0x4b')](_0x56b5e7);}})[_0x15c9('0x22')](function(_0x4e348e){if(_0x4e348e){return _0x4e348e?{'count':_0x154b81,'rows':_0x4e348e}:null;}})[_0x15c9('0x22')](respondWithResult(_0x58411d,null))[_0x15c9('0x42')](handleError(_0x58411d,null));};exports[_0x15c9('0x4d')]=function(_0x440037,_0x13e2b1,_0x7e4423){if(_0x440037[_0x15c9('0x4a')]['id']){delete _0x440037[_0x15c9('0x4a')]['id'];}return db[_0x15c9('0x29')][_0x15c9('0x4c')]({'where':{'id':_0x440037[_0x15c9('0x44')]['id']}})['then'](handleEntityNotFound(_0x13e2b1,null))[_0x15c9('0x22')](function(_0x26ff45){if(_0x26ff45){_0x440037['body'][_0x15c9('0x4e')]=_0x26ff45['id'];_0x440037[_0x15c9('0x4a')][_0x15c9('0x4f')]=integrations['getSubjects'](_0x440037[_0x15c9('0x4a')]['channel'],_0x440037[_0x15c9('0x4a')][_0x15c9('0x2b')]);_0x440037[_0x15c9('0x4a')][_0x15c9('0x50')]=integrations[_0x15c9('0x51')](_0x440037[_0x15c9('0x4a')]['channel'],_0x440037[_0x15c9('0x4a')][_0x15c9('0x2b')]);return db[_0x15c9('0x52')][_0x15c9('0x49')](_0x440037[_0x15c9('0x4a')],{'include':[{'model':db[_0x15c9('0x53')],'as':_0x15c9('0x4f')},{'model':db['FreshsalesField'],'as':_0x15c9('0x50')}]});}return null;})['then'](respondWithResult(_0x13e2b1,null))['catch'](handleError(_0x13e2b1,null));};exports[_0x15c9('0x54')]=function(_0x511d22,_0x52ce25,_0x3968a1){var _0x31b9c7='';var _0x50c8ba='';return db[_0x15c9('0x29')][_0x15c9('0x4c')]({'where':{'id':_0x511d22[_0x15c9('0x44')]['id']},'attributes':['id',_0x15c9('0x55'),_0x15c9('0x56'),_0x15c9('0x57')]})[_0x15c9('0x22')](handleEntityNotFound(_0x52ce25,null))[_0x15c9('0x22')](function(_0x189fb6){if(_0x189fb6){_0x50c8ba=_0x189fb6[_0x15c9('0x55')];_0x31b9c7=_0x189fb6[_0x15c9('0x56')];var _0x446859=_0x189fb6[_0x15c9('0x56')][_0x15c9('0x58')](-0x1);if(_0x446859==='/'){_0x31b9c7=_0x31b9c7['substring'](0x0,_0x31b9c7['lastIndexOf'](_0x446859));}return rp({'method':'GET','uri':util['format'](_0x15c9('0x59'),_0x31b9c7,_0x15c9('0x5a')),'headers':{'Authorization':_0x15c9('0x5b')+_0x189fb6[_0x15c9('0x57')]},'json':!![]});}})[_0x15c9('0x22')](function(_0x549152){if(_0x549152){var _0x151c8e=_0x549152['users'];var _0x5a62be=![];var _0x39d9ce=null;for(_0x39d9ce=0x0;_0x39d9ce<_0x151c8e[_0x15c9('0x34')];_0x39d9ce++){if(_0x151c8e[_0x39d9ce]['email']===_0x50c8ba){_0x5a62be=!![];}}if(_0x5a62be){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x15c9('0x22')](respondWithResult(_0x52ce25,null))[_0x15c9('0x42')](function(_0x1151b8){var _0x11136b=_0x511d22['query']['test']?0x1f4:_0x1151b8[_0x15c9('0x5c')]||0x1f4;logger['error'](_0x15c9('0x5d'),_0x15c9('0x54'),_0x11136b,JSON[_0x15c9('0x5e')](_0x1151b8));delete _0x1151b8[_0x15c9('0x2e')];if(_0x11136b===0x191){_0x11136b=0x190;}_0x52ce25['status'](_0x11136b)[_0x15c9('0x26')](_0x511d22[_0x15c9('0x2f')][_0x15c9('0x5f')]?{'message':_0x15c9('0x60'),'statusCode':_0x1151b8[_0x15c9('0x5c')]}:_0x1151b8);});}; \ No newline at end of file +var _0xeca5=['request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','map','FreshsalesAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','destroy','findOne','FreshsalesConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','/api/selector/owners','Token\x20token=','apiKey','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch'];(function(_0x49e2b8,_0x5cf700){var _0x1f2213=function(_0x51f2bb){while(--_0x51f2bb){_0x49e2b8['push'](_0x49e2b8['shift']());}};_0x1f2213(++_0x5cf700);}(_0xeca5,0xc9));var _0x5eca=function(_0xe9a692,_0x3a68f3){_0xe9a692=_0xe9a692-0x0;var _0x319fab=_0xeca5[_0xe9a692];return _0x319fab;};'use strict';var emlformat=require(_0x5eca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5eca('0x1'));var jsonpatch=require(_0x5eca('0x2'));var rp=require(_0x5eca('0x3'));var moment=require(_0x5eca('0x4'));var BPromise=require(_0x5eca('0x5'));var Mustache=require(_0x5eca('0x6'));var util=require(_0x5eca('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5eca('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5eca('0x9'));var _=require('lodash');var squel=require(_0x5eca('0xa'));var crypto=require('crypto');var jsforce=require(_0x5eca('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5eca('0xc'));var Papa=require(_0x5eca('0xd'));var Redis=require('ioredis');var authService=require(_0x5eca('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5eca('0xf'));var logger=require(_0x5eca('0x10'))(_0x5eca('0x11'));var utils=require(_0x5eca('0x12'));var config=require(_0x5eca('0x13'));var licenseUtil=require(_0x5eca('0x14'));var db=require(_0x5eca('0x15'))['db'];var integrations=require(_0x5eca('0x16'));function respondWithStatusCode(_0x19f660,_0x5032ee){_0x5032ee=_0x5032ee||0xcc;return function(_0xa8af6f){if(_0xa8af6f){return _0x19f660[_0x5eca('0x17')](_0x5032ee);}return _0x19f660[_0x5eca('0x18')](_0x5032ee)[_0x5eca('0x19')]();};}function respondWithResult(_0x1371f6,_0x1b518f){_0x1b518f=_0x1b518f||0xc8;return function(_0x1851ee){if(_0x1851ee){return _0x1371f6[_0x5eca('0x18')](_0x1b518f)[_0x5eca('0x1a')](_0x1851ee);}};}function respondWithFilteredResult(_0x4b4eb8,_0x4f7f1e){return function(_0x2d34f5){if(_0x2d34f5){var _0x576f3c=typeof _0x4f7f1e[_0x5eca('0x1b')]===_0x5eca('0x1c')&&typeof _0x4f7f1e[_0x5eca('0x1d')]===_0x5eca('0x1c');var _0x2e8a39=_0x2d34f5[_0x5eca('0x1e')];var _0x2c115e=_0x576f3c?0x0:_0x4f7f1e['offset'];var _0x431e80=_0x576f3c?_0x2d34f5['count']:_0x4f7f1e[_0x5eca('0x1b')]+_0x4f7f1e['limit'];var _0xeac6ce;if(_0x431e80>=_0x2e8a39){_0x431e80=_0x2e8a39;_0xeac6ce=0xc8;}else{_0xeac6ce=0xce;}_0x4b4eb8['status'](_0xeac6ce);return _0x4b4eb8[_0x5eca('0x1f')](_0x5eca('0x20'),_0x2c115e+'-'+_0x431e80+'/'+_0x2e8a39)[_0x5eca('0x1a')](_0x2d34f5);}return null;};}function patchUpdates(_0x294b40){return function(_0x2e6453){try{jsonpatch[_0x5eca('0x21')](_0x2e6453,_0x294b40,!![]);}catch(_0x5517d9){return BPromise['reject'](_0x5517d9);}return _0x2e6453[_0x5eca('0x22')]();};}function saveUpdates(_0x227981,_0x48deaf){return function(_0x1e297d){if(_0x1e297d){return _0x1e297d[_0x5eca('0x23')](_0x227981)[_0x5eca('0x24')](function(_0x91009d){return _0x91009d;});}return null;};}function removeEntity(_0x1f6bcb,_0xabd62f){return function(_0x100671){if(_0x100671){return _0x100671['destroy']()[_0x5eca('0x24')](function(){_0x1f6bcb[_0x5eca('0x18')](0xcc)[_0x5eca('0x19')]();});}};}function handleEntityNotFound(_0x36a0cc,_0x36c18f){return function(_0x487c07){if(!_0x487c07){_0x36a0cc['sendStatus'](0x194);}return _0x487c07;};}function handleError(_0x3b9c28,_0x56ba83){_0x56ba83=_0x56ba83||0x1f4;return function(_0x398190){logger[_0x5eca('0x25')](_0x398190[_0x5eca('0x26')]);if(_0x398190[_0x5eca('0x27')]){delete _0x398190['name'];}_0x3b9c28[_0x5eca('0x18')](_0x56ba83)[_0x5eca('0x28')](_0x398190);};}exports['index']=function(_0x450af5,_0x2c0944){var _0x487b8c={},_0xddf804={},_0x42f023={'count':0x0,'rows':[]};var _0x4f18b1=_[_0x5eca('0x29')](db[_0x5eca('0x2a')][_0x5eca('0x2b')],function(_0x281ed6){return{'name':_0x281ed6['fieldName'],'type':_0x281ed6[_0x5eca('0x2c')][_0x5eca('0x2d')]};});_0xddf804[_0x5eca('0x2e')]=_['map'](_0x4f18b1,_0x5eca('0x27'));_0xddf804[_0x5eca('0x2f')]=_[_0x5eca('0x30')](_0x450af5[_0x5eca('0x2f')]);_0xddf804[_0x5eca('0x31')]=_[_0x5eca('0x32')](_0xddf804[_0x5eca('0x2e')],_0xddf804[_0x5eca('0x2f')]);_0x487b8c[_0x5eca('0x33')]=_[_0x5eca('0x32')](_0xddf804[_0x5eca('0x2e')],qs['fields'](_0x450af5['query'][_0x5eca('0x34')]));_0x487b8c[_0x5eca('0x33')]=_0x487b8c[_0x5eca('0x33')][_0x5eca('0x35')]?_0x487b8c[_0x5eca('0x33')]:_0xddf804['model'];if(!_0x450af5[_0x5eca('0x2f')][_0x5eca('0x36')](_0x5eca('0x37'))){_0x487b8c['limit']=qs[_0x5eca('0x1d')](_0x450af5['query'][_0x5eca('0x1d')]);_0x487b8c[_0x5eca('0x1b')]=qs[_0x5eca('0x1b')](_0x450af5[_0x5eca('0x2f')][_0x5eca('0x1b')]);}_0x487b8c[_0x5eca('0x38')]=qs['sort'](_0x450af5[_0x5eca('0x2f')][_0x5eca('0x39')]);_0x487b8c['where']=qs[_0x5eca('0x31')](_[_0x5eca('0x3a')](_0x450af5[_0x5eca('0x2f')],_0xddf804[_0x5eca('0x31')]),_0x4f18b1);if(_0x450af5[_0x5eca('0x2f')][_0x5eca('0x3b')]){_0x487b8c[_0x5eca('0x3c')]=_[_0x5eca('0x3d')](_0x487b8c['where'],{'$or':_['map'](_0x4f18b1,function(_0x270c8c){if(_0x270c8c['type']!==_0x5eca('0x3e')){var _0x5adcfc={};_0x5adcfc[_0x270c8c[_0x5eca('0x27')]]={'$like':'%'+_0x450af5['query'][_0x5eca('0x3b')]+'%'};return _0x5adcfc;}})});}_0x487b8c=_[_0x5eca('0x3d')]({},_0x487b8c,_0x450af5[_0x5eca('0x3f')]);var _0x243828={'where':_0x487b8c[_0x5eca('0x3c')]};return db[_0x5eca('0x2a')][_0x5eca('0x1e')](_0x243828)[_0x5eca('0x24')](function(_0x196b61){_0x42f023[_0x5eca('0x1e')]=_0x196b61;if(_0x450af5[_0x5eca('0x2f')][_0x5eca('0x40')]){_0x487b8c[_0x5eca('0x41')]=[{'all':!![]}];}return db[_0x5eca('0x2a')][_0x5eca('0x42')](_0x487b8c);})[_0x5eca('0x24')](function(_0x5b0bc8){_0x42f023[_0x5eca('0x43')]=_0x5b0bc8;return _0x42f023;})[_0x5eca('0x24')](respondWithFilteredResult(_0x2c0944,_0x487b8c))['catch'](handleError(_0x2c0944,null));};exports[_0x5eca('0x44')]=function(_0x4dbb33,_0x481b48){var _0x8a1477={'raw':![],'where':{'id':_0x4dbb33[_0x5eca('0x45')]['id']}},_0x484fb0={};_0x484fb0[_0x5eca('0x2e')]=_[_0x5eca('0x30')](db['FreshsalesAccount'][_0x5eca('0x2b')]);_0x484fb0[_0x5eca('0x2f')]=_[_0x5eca('0x30')](_0x4dbb33[_0x5eca('0x2f')]);_0x484fb0[_0x5eca('0x31')]=_[_0x5eca('0x32')](_0x484fb0[_0x5eca('0x2e')],_0x484fb0[_0x5eca('0x2f')]);_0x8a1477[_0x5eca('0x33')]=_[_0x5eca('0x32')](_0x484fb0['model'],qs[_0x5eca('0x34')](_0x4dbb33[_0x5eca('0x2f')]['fields']));_0x8a1477['attributes']=_0x8a1477['attributes']['length']?_0x8a1477['attributes']:_0x484fb0[_0x5eca('0x2e')];if(_0x4dbb33[_0x5eca('0x2f')][_0x5eca('0x40')]){_0x8a1477[_0x5eca('0x41')]=[{'all':!![]}];}_0x8a1477=_['merge']({},_0x8a1477,_0x4dbb33[_0x5eca('0x3f')]);return db[_0x5eca('0x2a')][_0x5eca('0x46')](_0x8a1477)['then'](handleEntityNotFound(_0x481b48,null))[_0x5eca('0x24')](respondWithResult(_0x481b48,null))['catch'](handleError(_0x481b48,null));};exports['create']=function(_0x39b931,_0x5e8e79){return db[_0x5eca('0x2a')][_0x5eca('0x47')](_0x39b931[_0x5eca('0x48')],{})[_0x5eca('0x24')](respondWithResult(_0x5e8e79,0xc9))[_0x5eca('0x49')](handleError(_0x5e8e79,null));};exports[_0x5eca('0x23')]=function(_0x548ab4,_0x1110d3){if(_0x548ab4[_0x5eca('0x48')]['id']){delete _0x548ab4[_0x5eca('0x48')]['id'];}return db[_0x5eca('0x2a')][_0x5eca('0x46')]({'where':{'id':_0x548ab4[_0x5eca('0x45')]['id']}})[_0x5eca('0x24')](handleEntityNotFound(_0x1110d3,null))[_0x5eca('0x24')](saveUpdates(_0x548ab4['body'],null))[_0x5eca('0x24')](respondWithResult(_0x1110d3,null))[_0x5eca('0x49')](handleError(_0x1110d3,null));};exports[_0x5eca('0x4a')]=function(_0x53d0da,_0x238198){return db[_0x5eca('0x2a')][_0x5eca('0x46')]({'where':{'id':_0x53d0da[_0x5eca('0x45')]['id']}})[_0x5eca('0x24')](handleEntityNotFound(_0x238198,null))[_0x5eca('0x24')](removeEntity(_0x238198,null))[_0x5eca('0x49')](handleError(_0x238198,null));};exports['getConfigurations']=function(_0x521cdd,_0x20eb29,_0x2461e1){var _0x1433c0={};var _0x3df328={};var _0x4f74ba;var _0x16f583;return db['FreshsalesAccount'][_0x5eca('0x4b')]({'where':{'id':_0x521cdd[_0x5eca('0x45')]['id']}})['then'](handleEntityNotFound(_0x20eb29,null))[_0x5eca('0x24')](function(_0x5c7894){if(_0x5c7894){_0x4f74ba=_0x5c7894;_0x3df328['model']=_[_0x5eca('0x30')](db[_0x5eca('0x4c')][_0x5eca('0x2b')]);_0x3df328[_0x5eca('0x2f')]=_[_0x5eca('0x30')](_0x521cdd[_0x5eca('0x2f')]);_0x3df328['filters']=_['intersection'](_0x3df328[_0x5eca('0x2e')],_0x3df328[_0x5eca('0x2f')]);_0x1433c0['attributes']=_[_0x5eca('0x32')](_0x3df328[_0x5eca('0x2e')],qs[_0x5eca('0x34')](_0x521cdd['query'][_0x5eca('0x34')]));_0x1433c0['attributes']=_0x1433c0[_0x5eca('0x33')]['length']?_0x1433c0[_0x5eca('0x33')]:_0x3df328['model'];_0x1433c0[_0x5eca('0x38')]=qs[_0x5eca('0x39')](_0x521cdd[_0x5eca('0x2f')][_0x5eca('0x39')]);_0x1433c0['where']=qs[_0x5eca('0x31')](_[_0x5eca('0x3a')](_0x521cdd[_0x5eca('0x2f')],_0x3df328[_0x5eca('0x31')]));if(_0x521cdd['query'][_0x5eca('0x3b')]){_0x1433c0[_0x5eca('0x3c')]=_['merge'](_0x1433c0[_0x5eca('0x3c')],{'$or':_[_0x5eca('0x29')](_0x1433c0[_0x5eca('0x33')],function(_0x24f1b0){var _0x1e2406={};_0x1e2406[_0x24f1b0]={'$like':'%'+_0x521cdd[_0x5eca('0x2f')]['filter']+'%'};return _0x1e2406;})});}_0x1433c0=_['merge']({},_0x1433c0,_0x521cdd[_0x5eca('0x3f')]);return _0x4f74ba[_0x5eca('0x4d')](_0x1433c0);}})[_0x5eca('0x24')](function(_0x411153){if(_0x411153){_0x16f583=_0x411153[_0x5eca('0x35')];if(!_0x521cdd[_0x5eca('0x2f')]['hasOwnProperty']('nolimit')){_0x1433c0[_0x5eca('0x1d')]=qs[_0x5eca('0x1d')](_0x521cdd[_0x5eca('0x2f')][_0x5eca('0x1d')]);_0x1433c0[_0x5eca('0x1b')]=qs[_0x5eca('0x1b')](_0x521cdd['query']['offset']);}return _0x4f74ba['getConfigurations'](_0x1433c0);}})[_0x5eca('0x24')](function(_0xc65aaf){if(_0xc65aaf){return _0xc65aaf?{'count':_0x16f583,'rows':_0xc65aaf}:null;}})['then'](respondWithResult(_0x20eb29,null))['catch'](handleError(_0x20eb29,null));};exports['addConfiguration']=function(_0x320574,_0xadd124,_0x251c09){if(_0x320574['body']['id']){delete _0x320574['body']['id'];}return db[_0x5eca('0x2a')][_0x5eca('0x4b')]({'where':{'id':_0x320574[_0x5eca('0x45')]['id']}})[_0x5eca('0x24')](handleEntityNotFound(_0xadd124,null))['then'](function(_0x5825a0){if(_0x5825a0){_0x320574[_0x5eca('0x48')][_0x5eca('0x4e')]=_0x5825a0['id'];_0x320574[_0x5eca('0x48')][_0x5eca('0x4f')]=integrations[_0x5eca('0x50')](_0x320574['body'][_0x5eca('0x51')],_0x320574[_0x5eca('0x48')][_0x5eca('0x2c')]);_0x320574[_0x5eca('0x48')][_0x5eca('0x52')]=integrations[_0x5eca('0x53')](_0x320574[_0x5eca('0x48')]['channel'],_0x320574['body']['type']);return db[_0x5eca('0x4c')]['create'](_0x320574[_0x5eca('0x48')],{'include':[{'model':db[_0x5eca('0x54')],'as':_0x5eca('0x4f')},{'model':db[_0x5eca('0x54')],'as':_0x5eca('0x52')}]});}return null;})['then'](respondWithResult(_0xadd124,null))['catch'](handleError(_0xadd124,null));};exports[_0x5eca('0x55')]=function(_0x35399e,_0x136849,_0x17ef05){var _0x470c90='';var _0x1232e2='';return db[_0x5eca('0x2a')]['findOne']({'where':{'id':_0x35399e[_0x5eca('0x45')]['id']},'attributes':['id',_0x5eca('0x56'),_0x5eca('0x57'),'apiKey']})[_0x5eca('0x24')](handleEntityNotFound(_0x136849,null))['then'](function(_0xea4c84){if(_0xea4c84){_0x1232e2=_0xea4c84[_0x5eca('0x56')];_0x470c90=_0xea4c84['remoteUri'];var _0x1f4e38=_0xea4c84[_0x5eca('0x57')][_0x5eca('0x58')](-0x1);if(_0x1f4e38==='/'){_0x470c90=_0x470c90[_0x5eca('0x59')](0x0,_0x470c90[_0x5eca('0x5a')](_0x1f4e38));}return rp({'method':_0x5eca('0x5b'),'uri':util['format']('%s%s',_0x470c90,_0x5eca('0x5c')),'headers':{'Authorization':_0x5eca('0x5d')+_0xea4c84[_0x5eca('0x5e')]},'json':!![]});}})[_0x5eca('0x24')](function(_0x3b9ae4){if(_0x3b9ae4){var _0x4d4dbb=_0x3b9ae4['users'];var _0x612408=![];var _0x40f53b=null;for(_0x40f53b=0x0;_0x40f53b<_0x4d4dbb[_0x5eca('0x35')];_0x40f53b++){if(_0x4d4dbb[_0x40f53b][_0x5eca('0x5f')]===_0x1232e2){_0x612408=!![];}}if(_0x612408){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x5eca('0x60')});}}})[_0x5eca('0x24')](respondWithResult(_0x136849,null))[_0x5eca('0x49')](function(_0x3a6a0b){var _0x18d10d=_0x35399e['query'][_0x5eca('0x61')]?0x1f4:_0x3a6a0b[_0x5eca('0x62')]||0x1f4;logger['error'](_0x5eca('0x63'),'getFields',_0x18d10d,JSON[_0x5eca('0x64')](_0x3a6a0b));delete _0x3a6a0b['name'];if(_0x18d10d===0x191){_0x18d10d=0x190;}_0x136849[_0x5eca('0x18')](_0x18d10d)[_0x5eca('0x28')](_0x35399e[_0x5eca('0x2f')]['test']?{'message':_0x5eca('0x65'),'statusCode':_0x3a6a0b[_0x5eca('0x62')]}:_0x3a6a0b);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 82fc961..22ccdf7 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 _0xc2c7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','int_freshsales_accounts'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4be79b,_0x1d1f5f){_0x4be79b=_0x4be79b-0x0;var _0x293f58=_0xc2c7[_0x4be79b];return _0x293f58;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var logger=require(_0x7c2c('0x1'))(_0x7c2c('0x2'));var moment=require(_0x7c2c('0x3'));var BPromise=require(_0x7c2c('0x4'));var rp=require(_0x7c2c('0x5'));var fs=require('fs');var path=require(_0x7c2c('0x6'));var rimraf=require(_0x7c2c('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x7c2c('0x8'));module[_0x7c2c('0x9')]=function(_0x23c038,_0x54f027){return _0x23c038['define']('FreshsalesAccount',attributes,{'tableName':_0x7c2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8aad=['FreshsalesAccount','int_freshsales_accounts','lodash','util','api','bluebird','request-promise','../../config/environment','exports'];(function(_0x513483,_0x105ccd){var _0x384a1e=function(_0x47bb41){while(--_0x47bb41){_0x513483['push'](_0x513483['shift']());}};_0x384a1e(++_0x105ccd);}(_0x8aad,0x146));var _0xd8aa=function(_0x21b4a8,_0x364df6){_0x21b4a8=_0x21b4a8-0x0;var _0x11d55c=_0x8aad[_0x21b4a8];return _0x11d55c;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var logger=require('../../config/logger')(_0xd8aa('0x2'));var moment=require('moment');var BPromise=require(_0xd8aa('0x3'));var rp=require(_0xd8aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8aa('0x5'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xd8aa('0x6')]=function(_0x43ddeb,_0x16ea12){return _0x43ddeb['define'](_0xd8aa('0x7'),attributes,{'tableName':_0xd8aa('0x8'),'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 8097a99..fe9dd94 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 _0x82c4=['findAll','options','raw','attributes','include','map','model','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFreshsalesAccount'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x82c4,0x1ca));var _0x482c=function(_0x13b593,_0x85a736){_0x13b593=_0x13b593-0x0;var _0x1d2958=_0x82c4[_0x13b593];return _0x1d2958;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var moment=require(_0x482c('0x2'));var BPromise=require(_0x482c('0x3'));var rs=require(_0x482c('0x4'));var fs=require('fs');var Redis=require(_0x482c('0x5'));var db=require(_0x482c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x482c('0x7'))('rpc');var config=require(_0x482c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x482c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfdb92,_0x32a503,_0x35cdab){return new BPromise(function(_0x1c10f2,_0x3846d8){return client['request'](_0xfdb92,_0x35cdab)[_0x482c('0xa')](function(_0x135cc1){logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));logger[_0x482c('0xe')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x32a503,_0x482c('0xd'),JSON[_0x482c('0xf')](_0x135cc1));if(_0x135cc1[_0x482c('0x10')]){if(_0x135cc1['error'][_0x482c('0x11')]===0x1f4){logger[_0x482c('0x10')](_0x482c('0xc'),_0x32a503,_0x135cc1['error']['message']);return _0x3846d8(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x32a503,_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);return _0x1c10f2(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}else{logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));_0x1c10f2(_0x135cc1[_0x482c('0x13')][_0x482c('0x12')]);}})[_0x482c('0x14')](function(_0x363403){logger[_0x482c('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x32a503,_0x363403);_0x3846d8(_0x363403);});});}exports[_0x482c('0x15')]=function(_0x5b6f7e){var _0x3aed45=this;return new Promise(function(_0x258148,_0x4af05a){return db['FreshsalesAccount'][_0x482c('0x16')]({'raw':_0x5b6f7e['options']?_0x5b6f7e[_0x482c('0x17')][_0x482c('0x18')]===undefined?!![]:![]:!![],'where':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e[_0x482c('0x17')]['where']||null:null,'attributes':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e[_0x482c('0x17')][_0x482c('0x19')]||null:null,'limit':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e[_0x482c('0x17')]['limit']||null:null,'include':_0x5b6f7e['options']?_0x5b6f7e[_0x482c('0x17')][_0x482c('0x1a')]?_[_0x482c('0x1b')](_0x5b6f7e['options'][_0x482c('0x1a')],function(_0x579d2f){return{'model':db[_0x579d2f[_0x482c('0x1c')]],'as':_0x579d2f['as'],'attributes':_0x579d2f[_0x482c('0x19')],'include':_0x579d2f['include']?_[_0x482c('0x1b')](_0x579d2f['include'],function(_0x589bc6){return{'model':db[_0x589bc6[_0x482c('0x1c')]],'as':_0x589bc6['as'],'attributes':_0x589bc6[_0x482c('0x19')],'include':_0x589bc6[_0x482c('0x1a')]?_[_0x482c('0x1b')](_0x589bc6[_0x482c('0x1a')],function(_0x215826){return{'model':db[_0x215826[_0x482c('0x1c')]],'as':_0x215826['as'],'attributes':_0x215826['attributes']};}):[]};}):[]};}):[]:[]})[_0x482c('0xa')](function(_0x255417){logger['info'](_0x482c('0x15'),_0x5b6f7e);logger['debug']('GetFreshsalesAccount',_0x5b6f7e,JSON[_0x482c('0xf')](_0x255417));_0x258148(_0x255417);})['catch'](function(_0x1ac1c4){logger[_0x482c('0x10')](_0x482c('0x15'),_0x1ac1c4[_0x482c('0x12')],_0x5b6f7e);_0x4af05a(_0x3aed45[_0x482c('0x10')](0x1f4,_0x1ac1c4[_0x482c('0x12')]));});});};exports[_0x482c('0x1d')]=function(_0x3e9b22){var _0x24b4df=this;return new Promise(function(_0x2d3800,_0x3135a7){return db[_0x482c('0x1e')][_0x482c('0x1f')]({'raw':_0x3e9b22[_0x482c('0x17')]?_0x3e9b22[_0x482c('0x17')][_0x482c('0x18')]===undefined?!![]:![]:!![],'where':_0x3e9b22[_0x482c('0x17')]?_0x3e9b22[_0x482c('0x17')]['where']||null:null,'attributes':_0x3e9b22['options']?_0x3e9b22['options'][_0x482c('0x19')]||null:null,'include':_0x3e9b22[_0x482c('0x17')]?_0x3e9b22[_0x482c('0x17')][_0x482c('0x1a')]?_['map'](_0x3e9b22[_0x482c('0x17')]['include'],function(_0x31428c){return{'model':db[_0x31428c[_0x482c('0x1c')]],'as':_0x31428c['as'],'attributes':_0x31428c[_0x482c('0x19')],'include':_0x31428c[_0x482c('0x1a')]?_[_0x482c('0x1b')](_0x31428c[_0x482c('0x1a')],function(_0x129a31){return{'model':db[_0x129a31[_0x482c('0x1c')]],'as':_0x129a31['as'],'attributes':_0x129a31['attributes'],'include':_0x129a31['include']?_[_0x482c('0x1b')](_0x129a31['include'],function(_0xe62a02){return{'model':db[_0xe62a02[_0x482c('0x1c')]],'as':_0xe62a02['as'],'attributes':_0xe62a02[_0x482c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29cbaa){logger[_0x482c('0xb')](_0x482c('0x1d'),_0x3e9b22);logger[_0x482c('0xe')]('ShowFreshsalesAccount',_0x3e9b22,JSON[_0x482c('0xf')](_0x29cbaa));_0x2d3800(_0x29cbaa);})['catch'](function(_0x1de7f4){logger['error'](_0x482c('0x1d'),_0x1de7f4['message'],_0x3e9b22);_0x3135a7(_0x24b4df[_0x482c('0x10')](0x1f4,_0x1de7f4[_0x482c('0x12')]));});});}; \ No newline at end of file +var _0x781d=['model','map','GetFreshsalesAccount','find','ShowFreshsalesAccount','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','FreshsalesAccount','findAll','options','where','attributes','limit','include'];(function(_0x4cb095,_0x58da07){var _0x2b565d=function(_0x4d41b3){while(--_0x4d41b3){_0x4cb095['push'](_0x4cb095['shift']());}};_0x2b565d(++_0x58da07);}(_0x781d,0x14a));var _0xd781=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x781d[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd781('0x2'));var fs=require('fs');var Redis=require(_0xd781('0x3'));var db=require(_0xd781('0x4'))['db'];var utils=require(_0xd781('0x5'));var logger=require(_0xd781('0x6'))(_0xd781('0x7'));var config=require(_0xd781('0x8'));var jayson=require(_0xd781('0x9'));var client=jayson[_0xd781('0xa')][_0xd781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a07f0,_0x133509,_0x1a242d){return new BPromise(function(_0x50610d,_0x248172){return client['request'](_0x5a07f0,_0x1a242d)[_0xd781('0xc')](function(_0x5c18c8){logger[_0xd781('0xd')](_0xd781('0xe'),_0x133509,'request\x20sent');logger[_0xd781('0xf')](_0xd781('0x10'),_0x133509,'request\x20sent',JSON['stringify'](_0x5c18c8));if(_0x5c18c8[_0xd781('0x11')]){if(_0x5c18c8[_0xd781('0x11')][_0xd781('0x12')]===0x1f4){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);return _0x248172(_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);}logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8['error'][_0xd781('0x13')]);return _0x50610d(_0x5c18c8[_0xd781('0x11')]['message']);}else{logger[_0xd781('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x133509,_0xd781('0x14'));_0x50610d(_0x5c18c8[_0xd781('0x15')][_0xd781('0x13')]);}})[_0xd781('0x16')](function(_0x42a9c1){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x42a9c1);_0x248172(_0x42a9c1);});});}exports['GetFreshsalesAccount']=function(_0x1407fc){var _0x3f2922=this;return new Promise(function(_0x395d9c,_0x2f1273){return db[_0xd781('0x17')][_0xd781('0x18')]({'raw':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')][_0xd781('0x1a')]||null:null,'attributes':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')][_0xd781('0x1b')]||null:null,'limit':_0x1407fc[_0xd781('0x19')]?_0x1407fc['options'][_0xd781('0x1c')]||null:null,'include':_0x1407fc['options']?_0x1407fc['options'][_0xd781('0x1d')]?_['map'](_0x1407fc[_0xd781('0x19')][_0xd781('0x1d')],function(_0x395087){return{'model':db[_0x395087[_0xd781('0x1e')]],'as':_0x395087['as'],'attributes':_0x395087[_0xd781('0x1b')],'include':_0x395087[_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x395087[_0xd781('0x1d')],function(_0x10940b){return{'model':db[_0x10940b['model']],'as':_0x10940b['as'],'attributes':_0x10940b['attributes'],'include':_0x10940b[_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x10940b[_0xd781('0x1d')],function(_0x57b41e){return{'model':db[_0x57b41e[_0xd781('0x1e')]],'as':_0x57b41e['as'],'attributes':_0x57b41e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e29c8){logger['info'](_0xd781('0x20'),_0x1407fc);logger[_0xd781('0xf')]('GetFreshsalesAccount',_0x1407fc,JSON['stringify'](_0x1e29c8));_0x395d9c(_0x1e29c8);})[_0xd781('0x16')](function(_0x5b0464){logger[_0xd781('0x11')]('GetFreshsalesAccount',_0x5b0464[_0xd781('0x13')],_0x1407fc);_0x2f1273(_0x3f2922[_0xd781('0x11')](0x1f4,_0x5b0464['message']));});});};exports['ShowFreshsalesAccount']=function(_0x432d14){var _0x29e81a=this;return new Promise(function(_0x1c7d83,_0x5a389c){return db['FreshsalesAccount'][_0xd781('0x21')]({'raw':_0x432d14[_0xd781('0x19')]?_0x432d14[_0xd781('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1a')]||null:null,'attributes':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1b')]||null:null,'include':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x432d14[_0xd781('0x19')]['include'],function(_0x23dffb){return{'model':db[_0x23dffb[_0xd781('0x1e')]],'as':_0x23dffb['as'],'attributes':_0x23dffb[_0xd781('0x1b')],'include':_0x23dffb[_0xd781('0x1d')]?_['map'](_0x23dffb[_0xd781('0x1d')],function(_0x3f20e2){return{'model':db[_0x3f20e2['model']],'as':_0x3f20e2['as'],'attributes':_0x3f20e2[_0xd781('0x1b')],'include':_0x3f20e2['include']?_[_0xd781('0x1f')](_0x3f20e2[_0xd781('0x1d')],function(_0x57fdb6){return{'model':db[_0x57fdb6[_0xd781('0x1e')]],'as':_0x57fdb6['as'],'attributes':_0x57fdb6[_0xd781('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a29b7){logger['info'](_0xd781('0x22'),_0x432d14);logger[_0xd781('0xf')]('ShowFreshsalesAccount',_0x432d14,JSON[_0xd781('0x23')](_0x2a29b7));_0x1c7d83(_0x2a29b7);})[_0xd781('0x16')](function(_0x5651de){logger[_0xd781('0x11')](_0xd781('0x22'),_0x5651de[_0xd781('0x13')],_0x432d14);_0x5a389c(_0x29e81a['error'](0x1f4,_0x5651de[_0xd781('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index f1d3f5d..1620927 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 _0x23d2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','post','create','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x17348b,_0x1a42ba){var _0x3a9762=function(_0x654285){while(--_0x654285){_0x17348b['push'](_0x17348b['shift']());}};_0x3a9762(++_0x1a42ba);}(_0x23d2,0x11e));var _0x223d=function(_0x780fe0,_0x284a0b){_0x780fe0=_0x780fe0-0x0;var _0x21c4d6=_0x23d2[_0x780fe0];return _0x21c4d6;};'use strict';var multer=require(_0x223d('0x0'));var util=require('util');var path=require(_0x223d('0x1'));var timeout=require(_0x223d('0x2'));var express=require(_0x223d('0x3'));var router=express[_0x223d('0x4')]();var fs_extra=require(_0x223d('0x5'));var auth=require(_0x223d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x223d('0x7'));router['get']('/',auth[_0x223d('0x8')](),controller[_0x223d('0x9')]);router[_0x223d('0xa')]('/:id',auth[_0x223d('0x8')](),controller['show']);router[_0x223d('0xa')](_0x223d('0xb'),auth['isAuthenticated'](),controller[_0x223d('0xc')]);router['get']('/:id/descriptions',auth[_0x223d('0x8')](),controller[_0x223d('0xd')]);router['get'](_0x223d('0xe'),auth[_0x223d('0x8')](),controller[_0x223d('0xf')]);router[_0x223d('0x10')]('/',auth['isAuthenticated'](),controller[_0x223d('0x11')]);router[_0x223d('0x12')](_0x223d('0x13'),auth[_0x223d('0x8')](),controller[_0x223d('0x14')]);router[_0x223d('0x15')](_0x223d('0x13'),auth[_0x223d('0x8')](),controller[_0x223d('0x16')]);module[_0x223d('0x17')]=router; \ No newline at end of file +var _0x9cc8=['/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','show','/:id/subjects'];(function(_0x5edea5,_0x505a4e){var _0x2b6a68=function(_0x12faac){while(--_0x12faac){_0x5edea5['push'](_0x5edea5['shift']());}};_0x2b6a68(++_0x505a4e);}(_0x9cc8,0xe2));var _0x89cc=function(_0x531926,_0x187364){_0x531926=_0x531926-0x0;var _0x4d0620=_0x9cc8[_0x531926];return _0x4d0620;};'use strict';var multer=require(_0x89cc('0x0'));var util=require(_0x89cc('0x1'));var path=require('path');var timeout=require(_0x89cc('0x2'));var express=require(_0x89cc('0x3'));var router=express['Router']();var fs_extra=require(_0x89cc('0x4'));var auth=require(_0x89cc('0x5'));var interaction=require(_0x89cc('0x6'));var config=require(_0x89cc('0x7'));var controller=require(_0x89cc('0x8'));router[_0x89cc('0x9')]('/',auth[_0x89cc('0xa')](),controller['index']);router[_0x89cc('0x9')](_0x89cc('0xb'),auth[_0x89cc('0xa')](),controller[_0x89cc('0xc')]);router[_0x89cc('0x9')](_0x89cc('0xd'),auth[_0x89cc('0xa')](),controller['getSubjects']);router[_0x89cc('0x9')](_0x89cc('0xe'),auth[_0x89cc('0xa')](),controller[_0x89cc('0xf')]);router['get'](_0x89cc('0x10'),auth[_0x89cc('0xa')](),controller[_0x89cc('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x89cc('0x12')]);router[_0x89cc('0x13')](_0x89cc('0xb'),auth[_0x89cc('0xa')](),controller[_0x89cc('0x14')]);router[_0x89cc('0x15')]('/:id',auth[_0x89cc('0xa')](),controller[_0x89cc('0x16')]);module[_0x89cc('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 684a2c3..73b50d3 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 _0xd6c3=['sequelize','exports','STRING'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0xd6c3,0xd2));var _0x3d6c=function(_0x15ed08,_0x259c24){_0x15ed08=_0x15ed08-0x0;var _0x4cafd3=_0xd6c3[_0x15ed08];return _0x4cafd3;};'use strict';var Sequelize=require(_0x3d6c('0x0'));module[_0x3d6c('0x1')]={'name':{'type':Sequelize[_0x3d6c('0x2')]},'description':{'type':Sequelize[_0x3d6c('0x2')]}}; \ No newline at end of file +var _0x162e=['sequelize'];(function(_0x18bfc5,_0x133887){var _0x37692b=function(_0x1aefd3){while(--_0x1aefd3){_0x18bfc5['push'](_0x18bfc5['shift']());}};_0x37692b(++_0x133887);}(_0x162e,0x1a1));var _0xe162=function(_0x2a40f7,_0x2de2f1){_0x2a40f7=_0x2a40f7-0x0;var _0x556b9a=_0x162e[_0x2a40f7];return _0x556b9a;};'use strict';var Sequelize=require(_0xe162('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 2d807f5..4bd3021 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 _0x9483=['util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','getSubjects','findOne','order','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x112891,_0x52380a){var _0x20e441=function(_0x27f6d0){while(--_0x27f6d0){_0x112891['push'](_0x112891['shift']());}};_0x20e441(++_0x52380a);}(_0x9483,0x12e));var _0x3948=function(_0x50ef00,_0x38fd75){_0x50ef00=_0x50ef00-0x0;var _0x347fc1=_0x9483[_0x50ef00];return _0x347fc1;};'use strict';var emlformat=require(_0x3948('0x0'));var rimraf=require(_0x3948('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3948('0x2'));var rp=require(_0x3948('0x3'));var moment=require(_0x3948('0x4'));var BPromise=require(_0x3948('0x5'));var Mustache=require('mustache');var util=require(_0x3948('0x6'));var path=require(_0x3948('0x7'));var sox=require('sox');var csv=require(_0x3948('0x8'));var ejs=require(_0x3948('0x9'));var fs=require('fs');var fs_extra=require(_0x3948('0xa'));var _=require(_0x3948('0xb'));var squel=require(_0x3948('0xc'));var crypto=require(_0x3948('0xd'));var jsforce=require(_0x3948('0xe'));var deskjs=require(_0x3948('0xf'));var toCsv=require(_0x3948('0x8'));var querystring=require(_0x3948('0x10'));var Papa=require(_0x3948('0x11'));var Redis=require(_0x3948('0x12'));var authService=require(_0x3948('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3948('0x14'));var hardwareService=require(_0x3948('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3948('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x485d92,_0x227c19){_0x227c19=_0x227c19||0xcc;return function(_0x1004f2){if(_0x1004f2){return _0x485d92[_0x3948('0x17')](_0x227c19);}return _0x485d92[_0x3948('0x18')](_0x227c19)[_0x3948('0x19')]();};}function respondWithResult(_0x3b2cc4,_0xf0c470){_0xf0c470=_0xf0c470||0xc8;return function(_0x56dd18){if(_0x56dd18){return _0x3b2cc4[_0x3948('0x18')](_0xf0c470)[_0x3948('0x1a')](_0x56dd18);}};}function respondWithFilteredResult(_0x4309b1,_0x1f0e90){return function(_0x16ec7f){if(_0x16ec7f){var _0x3aa26f=typeof _0x1f0e90[_0x3948('0x1b')]==='undefined'&&typeof _0x1f0e90[_0x3948('0x1c')]==='undefined';var _0x1bee8e=_0x16ec7f['count'];var _0x47d732=_0x3aa26f?0x0:_0x1f0e90[_0x3948('0x1b')];var _0x49f85c=_0x3aa26f?_0x16ec7f[_0x3948('0x1d')]:_0x1f0e90['offset']+_0x1f0e90[_0x3948('0x1c')];var _0x2acc56;if(_0x49f85c>=_0x1bee8e){_0x49f85c=_0x1bee8e;_0x2acc56=0xc8;}else{_0x2acc56=0xce;}_0x4309b1[_0x3948('0x18')](_0x2acc56);return _0x4309b1[_0x3948('0x1e')](_0x3948('0x1f'),_0x47d732+'-'+_0x49f85c+'/'+_0x1bee8e)[_0x3948('0x1a')](_0x16ec7f);}return null;};}function patchUpdates(_0x3d9177){return function(_0x390ef0){try{jsonpatch['apply'](_0x390ef0,_0x3d9177,!![]);}catch(_0x23402e){return BPromise[_0x3948('0x20')](_0x23402e);}return _0x390ef0[_0x3948('0x21')]();};}function saveUpdates(_0x2af58b,_0x2734b8){return function(_0x30a0b2){if(_0x30a0b2){return _0x30a0b2[_0x3948('0x22')](_0x2af58b)[_0x3948('0x23')](function(_0x41602d){return _0x41602d;});}return null;};}function removeEntity(_0x59d526,_0x595277){return function(_0x2adc0a){if(_0x2adc0a){return _0x2adc0a[_0x3948('0x24')]()['then'](function(){_0x59d526[_0x3948('0x18')](0xcc)[_0x3948('0x19')]();});}};}function handleEntityNotFound(_0x29b8e6,_0x2b246b){return function(_0x1e0eba){if(!_0x1e0eba){_0x29b8e6[_0x3948('0x17')](0x194);}return _0x1e0eba;};}function handleError(_0x6360c5,_0x1ae121){_0x1ae121=_0x1ae121||0x1f4;return function(_0x50258e){logger[_0x3948('0x25')](_0x50258e['stack']);if(_0x50258e[_0x3948('0x26')]){delete _0x50258e[_0x3948('0x26')];}_0x6360c5[_0x3948('0x18')](_0x1ae121)[_0x3948('0x27')](_0x50258e);};}exports[_0x3948('0x28')]=function(_0x3e1f11,_0x41f0a2){var _0x2d7ee0={},_0x302bd2={},_0x5888d4={'count':0x0,'rows':[]};var _0x208709=_[_0x3948('0x29')](db[_0x3948('0x2a')][_0x3948('0x2b')],function(_0x123038){return{'name':_0x123038['fieldName'],'type':_0x123038['type'][_0x3948('0x2c')]};});_0x302bd2[_0x3948('0x2d')]=_[_0x3948('0x29')](_0x208709,_0x3948('0x26'));_0x302bd2['query']=_['keys'](_0x3e1f11[_0x3948('0x2e')]);_0x302bd2[_0x3948('0x2f')]=_[_0x3948('0x30')](_0x302bd2['model'],_0x302bd2[_0x3948('0x2e')]);_0x2d7ee0[_0x3948('0x31')]=_[_0x3948('0x30')](_0x302bd2[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x3e1f11['query'][_0x3948('0x32')]));_0x2d7ee0[_0x3948('0x31')]=_0x2d7ee0[_0x3948('0x31')][_0x3948('0x33')]?_0x2d7ee0['attributes']:_0x302bd2['model'];if(!_0x3e1f11[_0x3948('0x2e')][_0x3948('0x34')](_0x3948('0x35'))){_0x2d7ee0[_0x3948('0x1c')]=qs[_0x3948('0x1c')](_0x3e1f11[_0x3948('0x2e')]['limit']);_0x2d7ee0['offset']=qs['offset'](_0x3e1f11[_0x3948('0x2e')][_0x3948('0x1b')]);}_0x2d7ee0['order']=qs[_0x3948('0x36')](_0x3e1f11['query'][_0x3948('0x36')]);_0x2d7ee0['where']=qs[_0x3948('0x2f')](_[_0x3948('0x37')](_0x3e1f11[_0x3948('0x2e')],_0x302bd2[_0x3948('0x2f')]),_0x208709);if(_0x3e1f11[_0x3948('0x2e')][_0x3948('0x38')]){_0x2d7ee0[_0x3948('0x39')]=_[_0x3948('0x3a')](_0x2d7ee0[_0x3948('0x39')],{'$or':_['map'](_0x208709,function(_0x1096cb){if(_0x1096cb['type']!=='VIRTUAL'){var _0x2ef665={};_0x2ef665[_0x1096cb[_0x3948('0x26')]]={'$like':'%'+_0x3e1f11['query'][_0x3948('0x38')]+'%'};return _0x2ef665;}})});}_0x2d7ee0=_[_0x3948('0x3a')]({},_0x2d7ee0,_0x3e1f11[_0x3948('0x3b')]);var _0x4052f7={'where':_0x2d7ee0[_0x3948('0x39')]};return db[_0x3948('0x2a')][_0x3948('0x1d')](_0x4052f7)[_0x3948('0x23')](function(_0x2600eb){_0x5888d4[_0x3948('0x1d')]=_0x2600eb;if(_0x3e1f11['query']['includeAll']){_0x2d7ee0[_0x3948('0x3c')]=[{'all':!![]}];}return db[_0x3948('0x2a')][_0x3948('0x3d')](_0x2d7ee0);})[_0x3948('0x23')](function(_0x5266f0){_0x5888d4[_0x3948('0x3e')]=_0x5266f0;return _0x5888d4;})[_0x3948('0x23')](respondWithFilteredResult(_0x41f0a2,_0x2d7ee0))[_0x3948('0x3f')](handleError(_0x41f0a2,null));};exports[_0x3948('0x40')]=function(_0x5a528c,_0x190f9e){var _0x2aff13={'raw':![],'where':{'id':_0x5a528c[_0x3948('0x41')]['id']}},_0x149b98={};_0x149b98['model']=_[_0x3948('0x42')](db[_0x3948('0x2a')][_0x3948('0x2b')]);_0x149b98['query']=_['keys'](_0x5a528c[_0x3948('0x2e')]);_0x149b98[_0x3948('0x2f')]=_['intersection'](_0x149b98[_0x3948('0x2d')],_0x149b98[_0x3948('0x2e')]);_0x2aff13[_0x3948('0x31')]=_[_0x3948('0x30')](_0x149b98[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x5a528c[_0x3948('0x2e')]['fields']));_0x2aff13['attributes']=_0x2aff13['attributes'][_0x3948('0x33')]?_0x2aff13[_0x3948('0x31')]:_0x149b98[_0x3948('0x2d')];if(_0x5a528c['query'][_0x3948('0x43')]){_0x2aff13[_0x3948('0x3c')]=[{'all':!![]}];}_0x2aff13=_[_0x3948('0x3a')]({},_0x2aff13,_0x5a528c[_0x3948('0x3b')]);return db['FreshsalesConfiguration'][_0x3948('0x44')](_0x2aff13)[_0x3948('0x23')](handleEntityNotFound(_0x190f9e,null))[_0x3948('0x23')](respondWithResult(_0x190f9e,null))[_0x3948('0x3f')](handleError(_0x190f9e,null));};exports[_0x3948('0x45')]=function(_0x2c5130,_0x4fe2a3){return db['FreshsalesConfiguration'][_0x3948('0x45')](_0x2c5130['body'],{})[_0x3948('0x23')](respondWithResult(_0x4fe2a3,0xc9))['catch'](handleError(_0x4fe2a3,null));};exports[_0x3948('0x22')]=function(_0x5543ed,_0x5ddfbc){if(_0x5543ed['body']['id']){delete _0x5543ed['body']['id'];}return db['FreshsalesConfiguration'][_0x3948('0x44')]({'where':{'id':_0x5543ed[_0x3948('0x41')]['id']}})[_0x3948('0x23')](handleEntityNotFound(_0x5ddfbc,null))[_0x3948('0x23')](saveUpdates(_0x5543ed[_0x3948('0x46')],null))['then'](respondWithResult(_0x5ddfbc,null))[_0x3948('0x3f')](handleError(_0x5ddfbc,null));};exports['destroy']=function(_0x23d8e7,_0x612cd){return db[_0x3948('0x2a')]['find']({'where':{'id':_0x23d8e7[_0x3948('0x41')]['id']}})['then'](handleEntityNotFound(_0x612cd,null))[_0x3948('0x23')](removeEntity(_0x612cd,null))[_0x3948('0x3f')](handleError(_0x612cd,null));};exports[_0x3948('0x47')]=function(_0x447b54,_0x3a6bd4,_0xfcf558){var _0xb38802={};var _0x1afa30={};var _0x4905cf;var _0x4c4424;return db['FreshsalesConfiguration'][_0x3948('0x48')]({'where':{'id':_0x447b54['params']['id']}})[_0x3948('0x23')](handleEntityNotFound(_0x3a6bd4,null))['then'](function(_0x484cf6){if(_0x484cf6){_0x4905cf=_0x484cf6;_0x1afa30['model']=_[_0x3948('0x42')](db['FreshsalesField'][_0x3948('0x2b')]);_0x1afa30[_0x3948('0x2e')]=_['keys'](_0x447b54[_0x3948('0x2e')]);_0x1afa30[_0x3948('0x2f')]=_[_0x3948('0x30')](_0x1afa30[_0x3948('0x2d')],_0x1afa30[_0x3948('0x2e')]);_0xb38802[_0x3948('0x31')]=_[_0x3948('0x30')](_0x1afa30[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x447b54[_0x3948('0x2e')]['fields']));_0xb38802[_0x3948('0x31')]=_0xb38802[_0x3948('0x31')]['length']?_0xb38802['attributes']:_0x1afa30[_0x3948('0x2d')];_0xb38802[_0x3948('0x49')]=qs[_0x3948('0x36')](_0x447b54['query'][_0x3948('0x36')]);_0xb38802[_0x3948('0x39')]=qs[_0x3948('0x2f')](_[_0x3948('0x37')](_0x447b54['query'],_0x1afa30[_0x3948('0x2f')]));if(_0x447b54[_0x3948('0x2e')]['filter']){_0xb38802[_0x3948('0x39')]=_['merge'](_0xb38802[_0x3948('0x39')],{'$or':_['map'](_0xb38802['attributes'],function(_0x33b37e){var _0x13a855={};_0x13a855[_0x33b37e]={'$like':'%'+_0x447b54['query'][_0x3948('0x38')]+'%'};return _0x13a855;})});}_0xb38802=_[_0x3948('0x3a')]({},_0xb38802,_0x447b54['options']);return _0x4905cf[_0x3948('0x47')](_0xb38802);}})[_0x3948('0x23')](function(_0x476560){if(_0x476560){_0x4c4424=_0x476560['length'];if(!_0x447b54[_0x3948('0x2e')]['hasOwnProperty']('nolimit')){_0xb38802[_0x3948('0x1c')]=qs[_0x3948('0x1c')](_0x447b54[_0x3948('0x2e')][_0x3948('0x1c')]);_0xb38802['offset']=qs[_0x3948('0x1b')](_0x447b54[_0x3948('0x2e')][_0x3948('0x1b')]);}return _0x4905cf[_0x3948('0x47')](_0xb38802);}})[_0x3948('0x23')](function(_0x2449d9){if(_0x2449d9){return _0x2449d9?{'count':_0x4c4424,'rows':_0x2449d9}:null;}})[_0x3948('0x23')](respondWithResult(_0x3a6bd4,null))[_0x3948('0x3f')](handleError(_0x3a6bd4,null));};exports['getDescriptions']=function(_0x3d0ed4,_0x13f386,_0x124131){var _0x13aedb={};var _0x509638={};var _0x5ebd0a;var _0x4a6296;return db[_0x3948('0x2a')][_0x3948('0x48')]({'where':{'id':_0x3d0ed4[_0x3948('0x41')]['id']}})[_0x3948('0x23')](handleEntityNotFound(_0x13f386,null))[_0x3948('0x23')](function(_0x155583){if(_0x155583){_0x5ebd0a=_0x155583;_0x509638[_0x3948('0x2d')]=_[_0x3948('0x42')](db[_0x3948('0x4a')][_0x3948('0x2b')]);_0x509638[_0x3948('0x2e')]=_[_0x3948('0x42')](_0x3d0ed4['query']);_0x509638[_0x3948('0x2f')]=_['intersection'](_0x509638['model'],_0x509638[_0x3948('0x2e')]);_0x13aedb[_0x3948('0x31')]=_[_0x3948('0x30')](_0x509638[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x3d0ed4[_0x3948('0x2e')][_0x3948('0x32')]));_0x13aedb['attributes']=_0x13aedb[_0x3948('0x31')][_0x3948('0x33')]?_0x13aedb[_0x3948('0x31')]:_0x509638[_0x3948('0x2d')];_0x13aedb['order']=qs[_0x3948('0x36')](_0x3d0ed4['query'][_0x3948('0x36')]);_0x13aedb[_0x3948('0x39')]=qs[_0x3948('0x2f')](_['pick'](_0x3d0ed4[_0x3948('0x2e')],_0x509638[_0x3948('0x2f')]));if(_0x3d0ed4[_0x3948('0x2e')][_0x3948('0x38')]){_0x13aedb[_0x3948('0x39')]=_[_0x3948('0x3a')](_0x13aedb[_0x3948('0x39')],{'$or':_[_0x3948('0x29')](_0x13aedb[_0x3948('0x31')],function(_0xf77c8){var _0x506f0b={};_0x506f0b[_0xf77c8]={'$like':'%'+_0x3d0ed4[_0x3948('0x2e')][_0x3948('0x38')]+'%'};return _0x506f0b;})});}_0x13aedb=_['merge']({},_0x13aedb,_0x3d0ed4['options']);return _0x5ebd0a['getDescriptions'](_0x13aedb);}})[_0x3948('0x23')](function(_0x5c4016){if(_0x5c4016){_0x4a6296=_0x5c4016[_0x3948('0x33')];if(!_0x3d0ed4[_0x3948('0x2e')][_0x3948('0x34')](_0x3948('0x35'))){_0x13aedb[_0x3948('0x1c')]=qs[_0x3948('0x1c')](_0x3d0ed4[_0x3948('0x2e')][_0x3948('0x1c')]);_0x13aedb[_0x3948('0x1b')]=qs[_0x3948('0x1b')](_0x3d0ed4[_0x3948('0x2e')][_0x3948('0x1b')]);}return _0x5ebd0a[_0x3948('0x4b')](_0x13aedb);}})[_0x3948('0x23')](function(_0x293c7a){if(_0x293c7a){return _0x293c7a?{'count':_0x4a6296,'rows':_0x293c7a}:null;}})[_0x3948('0x23')](respondWithResult(_0x13f386,null))[_0x3948('0x3f')](handleError(_0x13f386,null));};exports['getFields']=function(_0x1c1074,_0x469208,_0x18b8e0){var _0x3867f5={};var _0x344a89={};var _0x368703;var _0x562229;return db[_0x3948('0x2a')][_0x3948('0x48')]({'where':{'id':_0x1c1074[_0x3948('0x41')]['id']}})[_0x3948('0x23')](handleEntityNotFound(_0x469208,null))[_0x3948('0x23')](function(_0x9bb8c0){if(_0x9bb8c0){_0x368703=_0x9bb8c0;_0x344a89[_0x3948('0x2d')]=_[_0x3948('0x42')](db[_0x3948('0x4a')][_0x3948('0x2b')]);_0x344a89[_0x3948('0x2e')]=_[_0x3948('0x42')](_0x1c1074['query']);_0x344a89[_0x3948('0x2f')]=_['intersection'](_0x344a89[_0x3948('0x2d')],_0x344a89[_0x3948('0x2e')]);_0x3867f5[_0x3948('0x31')]=_[_0x3948('0x30')](_0x344a89[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x1c1074[_0x3948('0x2e')][_0x3948('0x32')]));_0x3867f5[_0x3948('0x31')]=_0x3867f5['attributes'][_0x3948('0x33')]?_0x3867f5[_0x3948('0x31')]:_0x344a89[_0x3948('0x2d')];_0x3867f5[_0x3948('0x49')]=qs[_0x3948('0x36')](_0x1c1074[_0x3948('0x2e')][_0x3948('0x36')]);_0x3867f5[_0x3948('0x39')]=qs[_0x3948('0x2f')](_['pick'](_0x1c1074['query'],_0x344a89[_0x3948('0x2f')]));if(_0x1c1074['query']['filter']){_0x3867f5[_0x3948('0x39')]=_[_0x3948('0x3a')](_0x3867f5[_0x3948('0x39')],{'$or':_['map'](_0x3867f5['attributes'],function(_0x36ce97){var _0x1a5056={};_0x1a5056[_0x36ce97]={'$like':'%'+_0x1c1074[_0x3948('0x2e')][_0x3948('0x38')]+'%'};return _0x1a5056;})});}_0x3867f5=_['merge']({},_0x3867f5,_0x1c1074[_0x3948('0x3b')]);return _0x368703[_0x3948('0x4c')](_0x3867f5);}})['then'](function(_0x9a4fc0){if(_0x9a4fc0){_0x562229=_0x9a4fc0[_0x3948('0x33')];if(!_0x1c1074[_0x3948('0x2e')][_0x3948('0x34')](_0x3948('0x35'))){_0x3867f5[_0x3948('0x1c')]=qs[_0x3948('0x1c')](_0x1c1074[_0x3948('0x2e')][_0x3948('0x1c')]);_0x3867f5['offset']=qs[_0x3948('0x1b')](_0x1c1074['query']['offset']);}return _0x368703[_0x3948('0x4c')](_0x3867f5);}})['then'](function(_0x32d60f){if(_0x32d60f){return _0x32d60f?{'count':_0x562229,'rows':_0x32d60f}:null;}})[_0x3948('0x23')](respondWithResult(_0x469208,null))[_0x3948('0x3f')](handleError(_0x469208,null));}; \ No newline at end of file +var _0xb238=['set','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','key','map','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','findAll','catch','show','params','include','options','find','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb238,0x11c));var _0x8b23=function(_0x377570,_0xfd20e1){_0x377570=_0x377570-0x0;var _0x43e675=_0xb238[_0x377570];return _0x43e675;};'use strict';var emlformat=require(_0x8b23('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b23('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b23('0x2'));var moment=require(_0x8b23('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8b23('0x4'));var util=require(_0x8b23('0x5'));var path=require('path');var sox=require(_0x8b23('0x6'));var csv=require(_0x8b23('0x7'));var ejs=require(_0x8b23('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8b23('0x9'));var crypto=require('crypto');var jsforce=require(_0x8b23('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8b23('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b23('0xc'));var qs=require(_0x8b23('0xd'));var as=require(_0x8b23('0xe'));var hardwareService=require(_0x8b23('0xf'));var logger=require('../../config/logger')(_0x8b23('0x10'));var utils=require(_0x8b23('0x11'));var config=require(_0x8b23('0x12'));var licenseUtil=require(_0x8b23('0x13'));var db=require(_0x8b23('0x14'))['db'];function respondWithStatusCode(_0x542643,_0x22fef4){_0x22fef4=_0x22fef4||0xcc;return function(_0xb6f7ef){if(_0xb6f7ef){return _0x542643[_0x8b23('0x15')](_0x22fef4);}return _0x542643['status'](_0x22fef4)[_0x8b23('0x16')]();};}function respondWithResult(_0x52d688,_0xa7cf54){_0xa7cf54=_0xa7cf54||0xc8;return function(_0x4ba3ee){if(_0x4ba3ee){return _0x52d688[_0x8b23('0x17')](_0xa7cf54)['json'](_0x4ba3ee);}};}function respondWithFilteredResult(_0x3e4f22,_0x3e8678){return function(_0x305436){if(_0x305436){var _0xb04fa7=typeof _0x3e8678[_0x8b23('0x18')]===_0x8b23('0x19')&&typeof _0x3e8678[_0x8b23('0x1a')]==='undefined';var _0x537c4f=_0x305436[_0x8b23('0x1b')];var _0xaa15df=_0xb04fa7?0x0:_0x3e8678[_0x8b23('0x18')];var _0x5b2321=_0xb04fa7?_0x305436[_0x8b23('0x1b')]:_0x3e8678[_0x8b23('0x18')]+_0x3e8678[_0x8b23('0x1a')];var _0x41bfce;if(_0x5b2321>=_0x537c4f){_0x5b2321=_0x537c4f;_0x41bfce=0xc8;}else{_0x41bfce=0xce;}_0x3e4f22[_0x8b23('0x17')](_0x41bfce);return _0x3e4f22[_0x8b23('0x1c')](_0x8b23('0x1d'),_0xaa15df+'-'+_0x5b2321+'/'+_0x537c4f)['json'](_0x305436);}return null;};}function patchUpdates(_0x5e3162){return function(_0x46e8fa){try{jsonpatch[_0x8b23('0x1e')](_0x46e8fa,_0x5e3162,!![]);}catch(_0x16917b){return BPromise[_0x8b23('0x1f')](_0x16917b);}return _0x46e8fa[_0x8b23('0x20')]();};}function saveUpdates(_0x32d603,_0x100f2e){return function(_0x249d18){if(_0x249d18){return _0x249d18[_0x8b23('0x21')](_0x32d603)[_0x8b23('0x22')](function(_0x7f04ba){return _0x7f04ba;});}return null;};}function removeEntity(_0x15c727,_0x2760d7){return function(_0x2dfc7d){if(_0x2dfc7d){return _0x2dfc7d[_0x8b23('0x23')]()[_0x8b23('0x22')](function(){_0x15c727[_0x8b23('0x17')](0xcc)[_0x8b23('0x16')]();});}};}function handleEntityNotFound(_0x439c69,_0x441a31){return function(_0x4cf381){if(!_0x4cf381){_0x439c69['sendStatus'](0x194);}return _0x4cf381;};}function handleError(_0x335a90,_0xe20477){_0xe20477=_0xe20477||0x1f4;return function(_0x32ef94){logger['error'](_0x32ef94[_0x8b23('0x24')]);if(_0x32ef94['name']){delete _0x32ef94['name'];}_0x335a90['status'](_0xe20477)[_0x8b23('0x25')](_0x32ef94);};}exports[_0x8b23('0x26')]=function(_0x221e77,_0x4fd678){var _0x196134={},_0x5c2897={},_0x15937e={'count':0x0,'rows':[]};var _0x33ee48=_['map'](db[_0x8b23('0x27')][_0x8b23('0x28')],function(_0x5a0425){return{'name':_0x5a0425[_0x8b23('0x29')],'type':_0x5a0425[_0x8b23('0x2a')][_0x8b23('0x2b')]};});_0x5c2897['model']=_[_0x8b23('0x2c')](_0x33ee48,_0x8b23('0x2d'));_0x5c2897[_0x8b23('0x2e')]=_[_0x8b23('0x2f')](_0x221e77[_0x8b23('0x2e')]);_0x5c2897['filters']=_[_0x8b23('0x30')](_0x5c2897[_0x8b23('0x31')],_0x5c2897[_0x8b23('0x2e')]);_0x196134[_0x8b23('0x32')]=_[_0x8b23('0x30')](_0x5c2897[_0x8b23('0x31')],qs[_0x8b23('0x33')](_0x221e77[_0x8b23('0x2e')][_0x8b23('0x33')]));_0x196134[_0x8b23('0x32')]=_0x196134[_0x8b23('0x32')][_0x8b23('0x34')]?_0x196134[_0x8b23('0x32')]:_0x5c2897[_0x8b23('0x31')];if(!_0x221e77[_0x8b23('0x2e')][_0x8b23('0x35')](_0x8b23('0x36'))){_0x196134[_0x8b23('0x1a')]=qs['limit'](_0x221e77[_0x8b23('0x2e')]['limit']);_0x196134[_0x8b23('0x18')]=qs[_0x8b23('0x18')](_0x221e77[_0x8b23('0x2e')][_0x8b23('0x18')]);}_0x196134[_0x8b23('0x37')]=qs[_0x8b23('0x38')](_0x221e77[_0x8b23('0x2e')][_0x8b23('0x38')]);_0x196134[_0x8b23('0x39')]=qs[_0x8b23('0x3a')](_[_0x8b23('0x3b')](_0x221e77[_0x8b23('0x2e')],_0x5c2897[_0x8b23('0x3a')]),_0x33ee48);if(_0x221e77[_0x8b23('0x2e')]['filter']){_0x196134['where']=_[_0x8b23('0x3c')](_0x196134[_0x8b23('0x39')],{'$or':_['map'](_0x33ee48,function(_0x4191d4){if(_0x4191d4[_0x8b23('0x2a')]!==_0x8b23('0x3d')){var _0x3d8e70={};_0x3d8e70[_0x4191d4['name']]={'$like':'%'+_0x221e77[_0x8b23('0x2e')][_0x8b23('0x3e')]+'%'};return _0x3d8e70;}})});}_0x196134=_[_0x8b23('0x3c')]({},_0x196134,_0x221e77['options']);var _0x185d8f={'where':_0x196134[_0x8b23('0x39')]};return db[_0x8b23('0x27')][_0x8b23('0x1b')](_0x185d8f)[_0x8b23('0x22')](function(_0x59262b){_0x15937e['count']=_0x59262b;if(_0x221e77[_0x8b23('0x2e')][_0x8b23('0x3f')]){_0x196134['include']=[{'all':!![]}];}return db[_0x8b23('0x27')][_0x8b23('0x40')](_0x196134);})['then'](function(_0x4ec89d){_0x15937e['rows']=_0x4ec89d;return _0x15937e;})['then'](respondWithFilteredResult(_0x4fd678,_0x196134))[_0x8b23('0x41')](handleError(_0x4fd678,null));};exports[_0x8b23('0x42')]=function(_0x4a943c,_0x390ea2){var _0x4a1293={'raw':![],'where':{'id':_0x4a943c[_0x8b23('0x43')]['id']}},_0x5b870d={};_0x5b870d[_0x8b23('0x31')]=_['keys'](db[_0x8b23('0x27')]['rawAttributes']);_0x5b870d['query']=_[_0x8b23('0x2f')](_0x4a943c[_0x8b23('0x2e')]);_0x5b870d[_0x8b23('0x3a')]=_[_0x8b23('0x30')](_0x5b870d[_0x8b23('0x31')],_0x5b870d[_0x8b23('0x2e')]);_0x4a1293['attributes']=_[_0x8b23('0x30')](_0x5b870d[_0x8b23('0x31')],qs[_0x8b23('0x33')](_0x4a943c[_0x8b23('0x2e')][_0x8b23('0x33')]));_0x4a1293[_0x8b23('0x32')]=_0x4a1293['attributes']['length']?_0x4a1293[_0x8b23('0x32')]:_0x5b870d['model'];if(_0x4a943c[_0x8b23('0x2e')][_0x8b23('0x3f')]){_0x4a1293[_0x8b23('0x44')]=[{'all':!![]}];}_0x4a1293=_[_0x8b23('0x3c')]({},_0x4a1293,_0x4a943c[_0x8b23('0x45')]);return db['FreshsalesConfiguration'][_0x8b23('0x46')](_0x4a1293)['then'](handleEntityNotFound(_0x390ea2,null))['then'](respondWithResult(_0x390ea2,null))['catch'](handleError(_0x390ea2,null));};exports[_0x8b23('0x47')]=function(_0xd1d06e,_0x145b98){return db[_0x8b23('0x27')][_0x8b23('0x47')](_0xd1d06e[_0x8b23('0x48')],{})[_0x8b23('0x22')](respondWithResult(_0x145b98,0xc9))['catch'](handleError(_0x145b98,null));};exports[_0x8b23('0x21')]=function(_0x472223,_0x2820fc){if(_0x472223[_0x8b23('0x48')]['id']){delete _0x472223['body']['id'];}return db[_0x8b23('0x27')][_0x8b23('0x46')]({'where':{'id':_0x472223[_0x8b23('0x43')]['id']}})[_0x8b23('0x22')](handleEntityNotFound(_0x2820fc,null))[_0x8b23('0x22')](saveUpdates(_0x472223[_0x8b23('0x48')],null))[_0x8b23('0x22')](respondWithResult(_0x2820fc,null))[_0x8b23('0x41')](handleError(_0x2820fc,null));};exports[_0x8b23('0x23')]=function(_0x5ef704,_0x48a501){return db['FreshsalesConfiguration'][_0x8b23('0x46')]({'where':{'id':_0x5ef704[_0x8b23('0x43')]['id']}})[_0x8b23('0x22')](handleEntityNotFound(_0x48a501,null))[_0x8b23('0x22')](removeEntity(_0x48a501,null))[_0x8b23('0x41')](handleError(_0x48a501,null));};exports[_0x8b23('0x49')]=function(_0x6c54e5,_0x5bad7a,_0x5a3415){var _0x5f40e2={};var _0x433125={};var _0x5774c2;var _0x1021c8;return db[_0x8b23('0x27')][_0x8b23('0x4a')]({'where':{'id':_0x6c54e5[_0x8b23('0x43')]['id']}})['then'](handleEntityNotFound(_0x5bad7a,null))['then'](function(_0x40a9aa){if(_0x40a9aa){_0x5774c2=_0x40a9aa;_0x433125[_0x8b23('0x31')]=_[_0x8b23('0x2f')](db[_0x8b23('0x4b')][_0x8b23('0x28')]);_0x433125[_0x8b23('0x2e')]=_['keys'](_0x6c54e5[_0x8b23('0x2e')]);_0x433125[_0x8b23('0x3a')]=_['intersection'](_0x433125[_0x8b23('0x31')],_0x433125[_0x8b23('0x2e')]);_0x5f40e2['attributes']=_[_0x8b23('0x30')](_0x433125['model'],qs[_0x8b23('0x33')](_0x6c54e5['query'][_0x8b23('0x33')]));_0x5f40e2[_0x8b23('0x32')]=_0x5f40e2[_0x8b23('0x32')][_0x8b23('0x34')]?_0x5f40e2[_0x8b23('0x32')]:_0x433125[_0x8b23('0x31')];_0x5f40e2['order']=qs[_0x8b23('0x38')](_0x6c54e5[_0x8b23('0x2e')][_0x8b23('0x38')]);_0x5f40e2[_0x8b23('0x39')]=qs[_0x8b23('0x3a')](_[_0x8b23('0x3b')](_0x6c54e5[_0x8b23('0x2e')],_0x433125[_0x8b23('0x3a')]));if(_0x6c54e5[_0x8b23('0x2e')]['filter']){_0x5f40e2['where']=_['merge'](_0x5f40e2[_0x8b23('0x39')],{'$or':_[_0x8b23('0x2c')](_0x5f40e2[_0x8b23('0x32')],function(_0x5dedbb){var _0x5ad854={};_0x5ad854[_0x5dedbb]={'$like':'%'+_0x6c54e5[_0x8b23('0x2e')]['filter']+'%'};return _0x5ad854;})});}_0x5f40e2=_['merge']({},_0x5f40e2,_0x6c54e5[_0x8b23('0x45')]);return _0x5774c2[_0x8b23('0x49')](_0x5f40e2);}})[_0x8b23('0x22')](function(_0x281c1f){if(_0x281c1f){_0x1021c8=_0x281c1f[_0x8b23('0x34')];if(!_0x6c54e5[_0x8b23('0x2e')][_0x8b23('0x35')](_0x8b23('0x36'))){_0x5f40e2[_0x8b23('0x1a')]=qs[_0x8b23('0x1a')](_0x6c54e5[_0x8b23('0x2e')]['limit']);_0x5f40e2[_0x8b23('0x18')]=qs[_0x8b23('0x18')](_0x6c54e5[_0x8b23('0x2e')][_0x8b23('0x18')]);}return _0x5774c2['getSubjects'](_0x5f40e2);}})[_0x8b23('0x22')](function(_0x465303){if(_0x465303){return _0x465303?{'count':_0x1021c8,'rows':_0x465303}:null;}})[_0x8b23('0x22')](respondWithResult(_0x5bad7a,null))['catch'](handleError(_0x5bad7a,null));};exports['getDescriptions']=function(_0x4d8b01,_0x5047c3,_0x33ad89){var _0x553f1a={};var _0x5448cb={};var _0x4f04c8;var _0x34fa3d;return db[_0x8b23('0x27')]['findOne']({'where':{'id':_0x4d8b01[_0x8b23('0x43')]['id']}})[_0x8b23('0x22')](handleEntityNotFound(_0x5047c3,null))['then'](function(_0x3ed1b8){if(_0x3ed1b8){_0x4f04c8=_0x3ed1b8;_0x5448cb[_0x8b23('0x31')]=_[_0x8b23('0x2f')](db[_0x8b23('0x4b')]['rawAttributes']);_0x5448cb[_0x8b23('0x2e')]=_['keys'](_0x4d8b01[_0x8b23('0x2e')]);_0x5448cb[_0x8b23('0x3a')]=_[_0x8b23('0x30')](_0x5448cb[_0x8b23('0x31')],_0x5448cb['query']);_0x553f1a['attributes']=_[_0x8b23('0x30')](_0x5448cb[_0x8b23('0x31')],qs['fields'](_0x4d8b01['query']['fields']));_0x553f1a[_0x8b23('0x32')]=_0x553f1a[_0x8b23('0x32')][_0x8b23('0x34')]?_0x553f1a[_0x8b23('0x32')]:_0x5448cb['model'];_0x553f1a[_0x8b23('0x37')]=qs['sort'](_0x4d8b01[_0x8b23('0x2e')][_0x8b23('0x38')]);_0x553f1a[_0x8b23('0x39')]=qs[_0x8b23('0x3a')](_['pick'](_0x4d8b01[_0x8b23('0x2e')],_0x5448cb[_0x8b23('0x3a')]));if(_0x4d8b01['query'][_0x8b23('0x3e')]){_0x553f1a[_0x8b23('0x39')]=_[_0x8b23('0x3c')](_0x553f1a['where'],{'$or':_[_0x8b23('0x2c')](_0x553f1a[_0x8b23('0x32')],function(_0x4cbe7d){var _0x2c5b7a={};_0x2c5b7a[_0x4cbe7d]={'$like':'%'+_0x4d8b01[_0x8b23('0x2e')][_0x8b23('0x3e')]+'%'};return _0x2c5b7a;})});}_0x553f1a=_[_0x8b23('0x3c')]({},_0x553f1a,_0x4d8b01[_0x8b23('0x45')]);return _0x4f04c8[_0x8b23('0x4c')](_0x553f1a);}})[_0x8b23('0x22')](function(_0x56dc62){if(_0x56dc62){_0x34fa3d=_0x56dc62['length'];if(!_0x4d8b01[_0x8b23('0x2e')][_0x8b23('0x35')](_0x8b23('0x36'))){_0x553f1a[_0x8b23('0x1a')]=qs[_0x8b23('0x1a')](_0x4d8b01[_0x8b23('0x2e')]['limit']);_0x553f1a[_0x8b23('0x18')]=qs['offset'](_0x4d8b01['query'][_0x8b23('0x18')]);}return _0x4f04c8[_0x8b23('0x4c')](_0x553f1a);}})['then'](function(_0x38147d){if(_0x38147d){return _0x38147d?{'count':_0x34fa3d,'rows':_0x38147d}:null;}})[_0x8b23('0x22')](respondWithResult(_0x5047c3,null))['catch'](handleError(_0x5047c3,null));};exports[_0x8b23('0x4d')]=function(_0x2d81eb,_0x35681f,_0x536dc3){var _0x5f0994={};var _0x154dda={};var _0x350b37;var _0x2ff4fe;return db[_0x8b23('0x27')][_0x8b23('0x4a')]({'where':{'id':_0x2d81eb[_0x8b23('0x43')]['id']}})[_0x8b23('0x22')](handleEntityNotFound(_0x35681f,null))[_0x8b23('0x22')](function(_0x568fc9){if(_0x568fc9){_0x350b37=_0x568fc9;_0x154dda[_0x8b23('0x31')]=_[_0x8b23('0x2f')](db[_0x8b23('0x4b')]['rawAttributes']);_0x154dda[_0x8b23('0x2e')]=_[_0x8b23('0x2f')](_0x2d81eb['query']);_0x154dda[_0x8b23('0x3a')]=_['intersection'](_0x154dda[_0x8b23('0x31')],_0x154dda[_0x8b23('0x2e')]);_0x5f0994['attributes']=_[_0x8b23('0x30')](_0x154dda['model'],qs[_0x8b23('0x33')](_0x2d81eb[_0x8b23('0x2e')]['fields']));_0x5f0994[_0x8b23('0x32')]=_0x5f0994[_0x8b23('0x32')][_0x8b23('0x34')]?_0x5f0994[_0x8b23('0x32')]:_0x154dda[_0x8b23('0x31')];_0x5f0994[_0x8b23('0x37')]=qs[_0x8b23('0x38')](_0x2d81eb[_0x8b23('0x2e')][_0x8b23('0x38')]);_0x5f0994['where']=qs[_0x8b23('0x3a')](_[_0x8b23('0x3b')](_0x2d81eb['query'],_0x154dda[_0x8b23('0x3a')]));if(_0x2d81eb[_0x8b23('0x2e')][_0x8b23('0x3e')]){_0x5f0994[_0x8b23('0x39')]=_[_0x8b23('0x3c')](_0x5f0994[_0x8b23('0x39')],{'$or':_[_0x8b23('0x2c')](_0x5f0994[_0x8b23('0x32')],function(_0x28828c){var _0x39e666={};_0x39e666[_0x28828c]={'$like':'%'+_0x2d81eb[_0x8b23('0x2e')]['filter']+'%'};return _0x39e666;})});}_0x5f0994=_['merge']({},_0x5f0994,_0x2d81eb[_0x8b23('0x45')]);return _0x350b37[_0x8b23('0x4d')](_0x5f0994);}})[_0x8b23('0x22')](function(_0x1a4fc6){if(_0x1a4fc6){_0x2ff4fe=_0x1a4fc6[_0x8b23('0x34')];if(!_0x2d81eb[_0x8b23('0x2e')][_0x8b23('0x35')]('nolimit')){_0x5f0994['limit']=qs[_0x8b23('0x1a')](_0x2d81eb[_0x8b23('0x2e')][_0x8b23('0x1a')]);_0x5f0994[_0x8b23('0x18')]=qs[_0x8b23('0x18')](_0x2d81eb[_0x8b23('0x2e')][_0x8b23('0x18')]);}return _0x350b37[_0x8b23('0x4d')](_0x5f0994);}})[_0x8b23('0x22')](function(_0x8a6f73){if(_0x8a6f73){return _0x8a6f73?{'count':_0x2ff4fe,'rows':_0x8a6f73}:null;}})[_0x8b23('0x22')](respondWithResult(_0x35681f,null))['catch'](handleError(_0x35681f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index b40d1be..5892834 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 _0x60d4=['../../config/logger','api','bluebird','request-promise','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x60d4,0xee));var _0x460d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x60d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x460d('0x0'));var util=require(_0x460d('0x1'));var logger=require(_0x460d('0x2'))(_0x460d('0x3'));var moment=require('moment');var BPromise=require(_0x460d('0x4'));var rp=require(_0x460d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x460d('0x6'));var config=require('../../config/environment');var attributes=require(_0x460d('0x7'));module[_0x460d('0x8')]=function(_0x5010e7,_0x1c04c9){return _0x5010e7[_0x460d('0x9')](_0x460d('0xa'),attributes,{'tableName':_0x460d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x005e=['FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x29f80e,_0x9027ff){var _0x5c7eaa=function(_0x48ec7c){while(--_0x48ec7c){_0x29f80e['push'](_0x29f80e['shift']());}};_0x5c7eaa(++_0x9027ff);}(_0x005e,0x70));var _0xe005=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x005e[_0x3430aa];return _0x2ac5c;};'use strict';var _=require(_0xe005('0x0'));var util=require(_0xe005('0x1'));var logger=require(_0xe005('0x2'))(_0xe005('0x3'));var moment=require(_0xe005('0x4'));var BPromise=require(_0xe005('0x5'));var rp=require(_0xe005('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe005('0x7'));var attributes=require(_0xe005('0x8'));module['exports']=function(_0x7585d7,_0x5e096d){return _0x7585d7['define'](_0xe005('0x9'),attributes,{'tableName':_0xe005('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 9f904b9..2943825 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 _0xf599=['client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf599,0x160));var _0x9f59=function(_0xf6f160,_0x20915a){_0xf6f160=_0xf6f160-0x0;var _0xd6aa49=_0xf599[_0xf6f160];return _0xd6aa49;};'use strict';var _=require(_0x9f59('0x0'));var util=require(_0x9f59('0x1'));var moment=require('moment');var BPromise=require(_0x9f59('0x2'));var rs=require(_0x9f59('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f59('0x4'))['db'];var utils=require(_0x9f59('0x5'));var logger=require('../../config/logger')(_0x9f59('0x6'));var config=require(_0x9f59('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9f59('0x8')][_0x9f59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bdb2d,_0x5e8084,_0x59cf54){return new BPromise(function(_0x1e37a6,_0x3e6bce){return client[_0x9f59('0xa')](_0x2bdb2d,_0x59cf54)[_0x9f59('0xb')](function(_0x301232){logger[_0x9f59('0xc')](_0x9f59('0xd'),_0x5e8084,'request\x20sent');logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x5e8084,_0x9f59('0xe'),JSON[_0x9f59('0xf')](_0x301232));if(_0x301232['error']){if(_0x301232[_0x9f59('0x10')][_0x9f59('0x11')]===0x1f4){logger[_0x9f59('0x10')](_0x9f59('0xd'),_0x5e8084,_0x301232['error']['message']);return _0x3e6bce(_0x301232['error']['message']);}logger[_0x9f59('0x10')](_0x9f59('0xd'),_0x5e8084,_0x301232[_0x9f59('0x10')][_0x9f59('0x12')]);return _0x1e37a6(_0x301232[_0x9f59('0x10')]['message']);}else{logger[_0x9f59('0xc')](_0x9f59('0xd'),_0x5e8084,_0x9f59('0xe'));_0x1e37a6(_0x301232['result'][_0x9f59('0x12')]);}})[_0x9f59('0x13')](function(_0x2abae6){logger['error'](_0x9f59('0xd'),_0x5e8084,_0x2abae6);_0x3e6bce(_0x2abae6);});});} \ No newline at end of file +var _0x8fc6=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4724ba,_0x372142){var _0x3c2f63=function(_0x44f80b){while(--_0x44f80b){_0x4724ba['push'](_0x4724ba['shift']());}};_0x3c2f63(++_0x372142);}(_0x8fc6,0x17b));var _0x68fc=function(_0x120c03,_0x1a8eab){_0x120c03=_0x120c03-0x0;var _0x2f04a8=_0x8fc6[_0x120c03];return _0x2f04a8;};'use strict';var _=require('lodash');var util=require(_0x68fc('0x0'));var moment=require('moment');var BPromise=require(_0x68fc('0x1'));var rs=require(_0x68fc('0x2'));var fs=require('fs');var Redis=require(_0x68fc('0x3'));var db=require(_0x68fc('0x4'))['db'];var utils=require(_0x68fc('0x5'));var logger=require(_0x68fc('0x6'))(_0x68fc('0x7'));var config=require(_0x68fc('0x8'));var jayson=require(_0x68fc('0x9'));var client=jayson[_0x68fc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51c82b,_0x17e5f8,_0x58f6de){return new BPromise(function(_0x273f04,_0x4b9698){return client['request'](_0x51c82b,_0x58f6de)['then'](function(_0x450e2e){logger[_0x68fc('0xb')](_0x68fc('0xc'),_0x17e5f8,_0x68fc('0xd'));logger[_0x68fc('0xe')](_0x68fc('0xf'),_0x17e5f8,_0x68fc('0xd'),JSON[_0x68fc('0x10')](_0x450e2e));if(_0x450e2e[_0x68fc('0x11')]){if(_0x450e2e[_0x68fc('0x11')][_0x68fc('0x12')]===0x1f4){logger[_0x68fc('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x17e5f8,_0x450e2e['error']['message']);return _0x4b9698(_0x450e2e[_0x68fc('0x11')][_0x68fc('0x13')]);}logger['error'](_0x68fc('0xc'),_0x17e5f8,_0x450e2e['error'][_0x68fc('0x13')]);return _0x273f04(_0x450e2e[_0x68fc('0x11')][_0x68fc('0x13')]);}else{logger[_0x68fc('0xb')](_0x68fc('0xc'),_0x17e5f8,_0x68fc('0xd'));_0x273f04(_0x450e2e[_0x68fc('0x14')]['message']);}})[_0x68fc('0x15')](function(_0x5b58e6){logger['error'](_0x68fc('0xc'),_0x17e5f8,_0x5b58e6);_0x4b9698(_0x5b58e6);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index cfc9317..efffdf1 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 _0x9990=['get','isAuthenticated','/:id','show','post','create','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller'];(function(_0x3d4a27,_0x2929c2){var _0x30df43=function(_0x19475e){while(--_0x19475e){_0x3d4a27['push'](_0x3d4a27['shift']());}};_0x30df43(++_0x2929c2);}(_0x9990,0xf6));var _0x0999=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x9990[_0x3a6e4b];return _0x36572d;};'use strict';var multer=require('multer');var util=require(_0x0999('0x0'));var path=require(_0x0999('0x1'));var timeout=require(_0x0999('0x2'));var express=require(_0x0999('0x3'));var router=express[_0x0999('0x4')]();var fs_extra=require(_0x0999('0x5'));var auth=require(_0x0999('0x6'));var interaction=require(_0x0999('0x7'));var config=require('../../config/environment');var controller=require(_0x0999('0x8'));router[_0x0999('0x9')]('/',auth[_0x0999('0xa')](),controller['index']);router[_0x0999('0x9')](_0x0999('0xb'),auth[_0x0999('0xa')](),controller[_0x0999('0xc')]);router[_0x0999('0xd')]('/',auth[_0x0999('0xa')](),controller[_0x0999('0xe')]);router['put'](_0x0999('0xb'),auth[_0x0999('0xa')](),controller[_0x0999('0xf')]);router['delete'](_0x0999('0xb'),auth[_0x0999('0xa')](),controller[_0x0999('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4f6f=['update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','create','put','/:id'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4f6f,0x157));var _0xf4f6=function(_0x59e862,_0x477bf2){_0x59e862=_0x59e862-0x0;var _0x1a25ee=_0x4f6f[_0x59e862];return _0x1a25ee;};'use strict';var multer=require(_0xf4f6('0x0'));var util=require(_0xf4f6('0x1'));var path=require(_0xf4f6('0x2'));var timeout=require('connect-timeout');var express=require(_0xf4f6('0x3'));var router=express['Router']();var fs_extra=require(_0xf4f6('0x4'));var auth=require(_0xf4f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf4f6('0x6'));var controller=require(_0xf4f6('0x7'));router['get']('/',auth[_0xf4f6('0x8')](),controller[_0xf4f6('0x9')]);router[_0xf4f6('0xa')]('/:id',auth[_0xf4f6('0x8')](),controller['show']);router['post']('/',auth[_0xf4f6('0x8')](),controller[_0xf4f6('0xb')]);router[_0xf4f6('0xc')](_0xf4f6('0xd'),auth[_0xf4f6('0x8')](),controller[_0xf4f6('0xe')]);router['delete'](_0xf4f6('0xd'),auth[_0xf4f6('0x8')](),controller[_0xf4f6('0xf')]);module[_0xf4f6('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index e02f5f0..e06248a 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 _0x7711=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x59ac70,_0x3a4be3){var _0xf38123=function(_0x2035a8){while(--_0x2035a8){_0x59ac70['push'](_0x59ac70['shift']());}};_0xf38123(++_0x3a4be3);}(_0x7711,0x102));var _0x1771=function(_0x27e469,_0x1fc5e){_0x27e469=_0x27e469-0x0;var _0x563bad=_0x7711[_0x27e469];return _0x563bad;};'use strict';var Sequelize=require(_0x1771('0x0'));module[_0x1771('0x1')]={'type':{'type':Sequelize[_0x1771('0x2')](_0x1771('0x3'),_0x1771('0x4'),'customVariable',_0x1771('0x5'),_0x1771('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1771('0x7')]},'key':{'type':Sequelize[_0x1771('0x7')]},'keyType':{'type':Sequelize[_0x1771('0x2')](_0x1771('0x3'),_0x1771('0x4'),_0x1771('0x8'))},'keyContent':{'type':Sequelize[_0x1771('0x7')]},'idField':{'type':Sequelize[_0x1771('0x7')]},'nameField':{'type':Sequelize[_0x1771('0x7')]},'customField':{'type':Sequelize[_0x1771('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1771('0x7')]}}; \ No newline at end of file +var _0xbee8=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xbee8,0x78));var _0x8bee=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0xbee8[_0x5eef05];return _0x56d4b8;};'use strict';var Sequelize=require(_0x8bee('0x0'));module[_0x8bee('0x1')]={'type':{'type':Sequelize[_0x8bee('0x2')](_0x8bee('0x3'),_0x8bee('0x4'),'customVariable',_0x8bee('0x5'),_0x8bee('0x6')),'defaultValue':_0x8bee('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8bee('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x8bee('0x3'),'variable',_0x8bee('0x8'))},'keyContent':{'type':Sequelize[_0x8bee('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8bee('0x7')]},'customField':{'type':Sequelize[_0x8bee('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8bee('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 278766f..c8f5d10 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 _0x198a=['index','map','FreshsalesField','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','name','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','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','count','limit','set','Content-Range','apply','save','update','then','destroy','error','send'];(function(_0x3470ef,_0x3bc4b3){var _0x4286a4=function(_0x597635){while(--_0x597635){_0x3470ef['push'](_0x3470ef['shift']());}};_0x4286a4(++_0x3bc4b3);}(_0x198a,0x1e3));var _0xa198=function(_0x3e89ca,_0x41c7e0){_0x3e89ca=_0x3e89ca-0x0;var _0x3e93d8=_0x198a[_0x3e89ca];return _0x3e93d8;};'use strict';var emlformat=require(_0xa198('0x0'));var rimraf=require(_0xa198('0x1'));var zipdir=require(_0xa198('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa198('0x3'));var BPromise=require(_0xa198('0x4'));var Mustache=require(_0xa198('0x5'));var util=require(_0xa198('0x6'));var path=require('path');var sox=require(_0xa198('0x7'));var csv=require(_0xa198('0x8'));var ejs=require(_0xa198('0x9'));var fs=require('fs');var fs_extra=require(_0xa198('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa198('0xb'));var jsforce=require(_0xa198('0xc'));var deskjs=require(_0xa198('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa198('0xe'));var Papa=require('papaparse');var Redis=require(_0xa198('0xf'));var authService=require(_0xa198('0x10'));var qs=require(_0xa198('0x11'));var as=require(_0xa198('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa198('0x13'))(_0xa198('0x14'));var utils=require(_0xa198('0x15'));var config=require(_0xa198('0x16'));var licenseUtil=require(_0xa198('0x17'));var db=require(_0xa198('0x18'))['db'];function respondWithStatusCode(_0x3d4034,_0x1c862a){_0x1c862a=_0x1c862a||0xcc;return function(_0x7616eb){if(_0x7616eb){return _0x3d4034[_0xa198('0x19')](_0x1c862a);}return _0x3d4034['status'](_0x1c862a)[_0xa198('0x1a')]();};}function respondWithResult(_0x4f5e7b,_0x19ebbf){_0x19ebbf=_0x19ebbf||0xc8;return function(_0x3305af){if(_0x3305af){return _0x4f5e7b[_0xa198('0x1b')](_0x19ebbf)[_0xa198('0x1c')](_0x3305af);}};}function respondWithFilteredResult(_0xb3f12d,_0x42f94a){return function(_0x4f893a){if(_0x4f893a){var _0x2c3848=typeof _0x42f94a[_0xa198('0x1d')]==='undefined'&&typeof _0x42f94a['limit']===_0xa198('0x1e');var _0x55e892=_0x4f893a[_0xa198('0x1f')];var _0x561c42=_0x2c3848?0x0:_0x42f94a[_0xa198('0x1d')];var _0x3e1a1f=_0x2c3848?_0x4f893a[_0xa198('0x1f')]:_0x42f94a[_0xa198('0x1d')]+_0x42f94a[_0xa198('0x20')];var _0x30e00e;if(_0x3e1a1f>=_0x55e892){_0x3e1a1f=_0x55e892;_0x30e00e=0xc8;}else{_0x30e00e=0xce;}_0xb3f12d[_0xa198('0x1b')](_0x30e00e);return _0xb3f12d[_0xa198('0x21')](_0xa198('0x22'),_0x561c42+'-'+_0x3e1a1f+'/'+_0x55e892)[_0xa198('0x1c')](_0x4f893a);}return null;};}function patchUpdates(_0x1e3ba6){return function(_0x172ed4){try{jsonpatch[_0xa198('0x23')](_0x172ed4,_0x1e3ba6,!![]);}catch(_0x1ac010){return BPromise['reject'](_0x1ac010);}return _0x172ed4[_0xa198('0x24')]();};}function saveUpdates(_0x168344,_0x40d4aa){return function(_0x134941){if(_0x134941){return _0x134941[_0xa198('0x25')](_0x168344)[_0xa198('0x26')](function(_0x3fc065){return _0x3fc065;});}return null;};}function removeEntity(_0x1ee730,_0x11aa3e){return function(_0xa00f01){if(_0xa00f01){return _0xa00f01[_0xa198('0x27')]()['then'](function(){_0x1ee730[_0xa198('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a1f81,_0x452c81){return function(_0x5a4b6b){if(!_0x5a4b6b){_0x5a1f81[_0xa198('0x19')](0x194);}return _0x5a4b6b;};}function handleError(_0x59ebf9,_0x424f29){_0x424f29=_0x424f29||0x1f4;return function(_0x475506){logger[_0xa198('0x28')](_0x475506['stack']);if(_0x475506['name']){delete _0x475506['name'];}_0x59ebf9[_0xa198('0x1b')](_0x424f29)[_0xa198('0x29')](_0x475506);};}exports[_0xa198('0x2a')]=function(_0x14511,_0x2521ef){var _0x5cc51f={},_0x2eeb35={},_0x57fba6={'count':0x0,'rows':[]};var _0x27e5a8=_[_0xa198('0x2b')](db[_0xa198('0x2c')]['rawAttributes'],function(_0x164ec5){return{'name':_0x164ec5['fieldName'],'type':_0x164ec5['type']['key']};});_0x2eeb35['model']=_['map'](_0x27e5a8,'name');_0x2eeb35['query']=_[_0xa198('0x2d')](_0x14511[_0xa198('0x2e')]);_0x2eeb35['filters']=_[_0xa198('0x2f')](_0x2eeb35[_0xa198('0x30')],_0x2eeb35[_0xa198('0x2e')]);_0x5cc51f['attributes']=_[_0xa198('0x2f')](_0x2eeb35[_0xa198('0x30')],qs[_0xa198('0x31')](_0x14511[_0xa198('0x2e')][_0xa198('0x31')]));_0x5cc51f[_0xa198('0x32')]=_0x5cc51f[_0xa198('0x32')][_0xa198('0x33')]?_0x5cc51f[_0xa198('0x32')]:_0x2eeb35[_0xa198('0x30')];if(!_0x14511[_0xa198('0x2e')][_0xa198('0x34')]('nolimit')){_0x5cc51f[_0xa198('0x20')]=qs[_0xa198('0x20')](_0x14511['query']['limit']);_0x5cc51f[_0xa198('0x1d')]=qs[_0xa198('0x1d')](_0x14511[_0xa198('0x2e')][_0xa198('0x1d')]);}_0x5cc51f[_0xa198('0x35')]=qs[_0xa198('0x36')](_0x14511[_0xa198('0x2e')][_0xa198('0x36')]);_0x5cc51f[_0xa198('0x37')]=qs['filters'](_[_0xa198('0x38')](_0x14511[_0xa198('0x2e')],_0x2eeb35[_0xa198('0x39')]),_0x27e5a8);if(_0x14511[_0xa198('0x2e')][_0xa198('0x3a')]){_0x5cc51f[_0xa198('0x37')]=_[_0xa198('0x3b')](_0x5cc51f[_0xa198('0x37')],{'$or':_[_0xa198('0x2b')](_0x27e5a8,function(_0xf0ef21){if(_0xf0ef21[_0xa198('0x3c')]!==_0xa198('0x3d')){var _0x1c3ede={};_0x1c3ede[_0xf0ef21[_0xa198('0x3e')]]={'$like':'%'+_0x14511['query'][_0xa198('0x3a')]+'%'};return _0x1c3ede;}})});}_0x5cc51f=_[_0xa198('0x3b')]({},_0x5cc51f,_0x14511[_0xa198('0x3f')]);var _0x123192={'where':_0x5cc51f['where']};return db[_0xa198('0x2c')][_0xa198('0x1f')](_0x123192)['then'](function(_0x595a09){_0x57fba6['count']=_0x595a09;if(_0x14511[_0xa198('0x2e')][_0xa198('0x40')]){_0x5cc51f[_0xa198('0x41')]=[{'all':!![]}];}return db[_0xa198('0x2c')][_0xa198('0x42')](_0x5cc51f);})[_0xa198('0x26')](function(_0x5de2d6){_0x57fba6[_0xa198('0x43')]=_0x5de2d6;return _0x57fba6;})[_0xa198('0x26')](respondWithFilteredResult(_0x2521ef,_0x5cc51f))['catch'](handleError(_0x2521ef,null));};exports[_0xa198('0x44')]=function(_0x2f920a,_0x6d2564){var _0x426e24={'raw':!![],'where':{'id':_0x2f920a[_0xa198('0x45')]['id']}},_0x393e3d={};_0x393e3d['model']=_[_0xa198('0x2d')](db[_0xa198('0x2c')][_0xa198('0x46')]);_0x393e3d[_0xa198('0x2e')]=_[_0xa198('0x2d')](_0x2f920a[_0xa198('0x2e')]);_0x393e3d[_0xa198('0x39')]=_['intersection'](_0x393e3d[_0xa198('0x30')],_0x393e3d[_0xa198('0x2e')]);_0x426e24[_0xa198('0x32')]=_[_0xa198('0x2f')](_0x393e3d['model'],qs[_0xa198('0x31')](_0x2f920a[_0xa198('0x2e')]['fields']));_0x426e24[_0xa198('0x32')]=_0x426e24[_0xa198('0x32')][_0xa198('0x33')]?_0x426e24[_0xa198('0x32')]:_0x393e3d['model'];if(_0x2f920a['query'][_0xa198('0x40')]){_0x426e24['include']=[{'all':!![]}];}_0x426e24=_['merge']({},_0x426e24,_0x2f920a[_0xa198('0x3f')]);return db[_0xa198('0x2c')][_0xa198('0x47')](_0x426e24)[_0xa198('0x26')](handleEntityNotFound(_0x6d2564,null))[_0xa198('0x26')](respondWithResult(_0x6d2564,null))[_0xa198('0x48')](handleError(_0x6d2564,null));};exports[_0xa198('0x49')]=function(_0x43b819,_0x3ab666){return db['FreshsalesField']['create'](_0x43b819[_0xa198('0x4a')],{})[_0xa198('0x26')](respondWithResult(_0x3ab666,0xc9))[_0xa198('0x48')](handleError(_0x3ab666,null));};exports[_0xa198('0x25')]=function(_0x437a1c,_0x5b5c40){if(_0x437a1c[_0xa198('0x4a')]['id']){delete _0x437a1c[_0xa198('0x4a')]['id'];}return db[_0xa198('0x2c')]['find']({'where':{'id':_0x437a1c[_0xa198('0x45')]['id']}})[_0xa198('0x26')](handleEntityNotFound(_0x5b5c40,null))[_0xa198('0x26')](saveUpdates(_0x437a1c['body'],null))['then'](respondWithResult(_0x5b5c40,null))[_0xa198('0x48')](handleError(_0x5b5c40,null));};exports[_0xa198('0x27')]=function(_0x56fb39,_0x5714f2){return db[_0xa198('0x2c')][_0xa198('0x47')]({'where':{'id':_0x56fb39[_0xa198('0x45')]['id']}})[_0xa198('0x26')](handleEntityNotFound(_0x5714f2,null))[_0xa198('0x26')](removeEntity(_0x5714f2,null))['catch'](handleError(_0x5714f2,null));}; \ No newline at end of file +var _0x76ba=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x20cf1e,_0x27512c){var _0xce4c7a=function(_0x4432ee){while(--_0x4432ee){_0x20cf1e['push'](_0x20cf1e['shift']());}};_0xce4c7a(++_0x27512c);}(_0x76ba,0x1ee));var _0xa76b=function(_0x56fd5e,_0x50e199){_0x56fd5e=_0x56fd5e-0x0;var _0x703700=_0x76ba[_0x56fd5e];return _0x703700;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa76b('0x0'));var zipdir=require(_0xa76b('0x1'));var jsonpatch=require(_0xa76b('0x2'));var rp=require(_0xa76b('0x3'));var moment=require(_0xa76b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa76b('0x5'));var sox=require(_0xa76b('0x6'));var csv=require('to-csv');var ejs=require(_0xa76b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa76b('0x8'));var crypto=require(_0xa76b('0x9'));var jsforce=require(_0xa76b('0xa'));var deskjs=require(_0xa76b('0xb'));var toCsv=require(_0xa76b('0xc'));var querystring=require(_0xa76b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa76b('0xe'));var qs=require(_0xa76b('0xf'));var as=require(_0xa76b('0x10'));var hardwareService=require(_0xa76b('0x11'));var logger=require(_0xa76b('0x12'))(_0xa76b('0x13'));var utils=require(_0xa76b('0x14'));var config=require(_0xa76b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa76b('0x16'))['db'];function respondWithStatusCode(_0x27f7fe,_0x1d4a5c){_0x1d4a5c=_0x1d4a5c||0xcc;return function(_0x363775){if(_0x363775){return _0x27f7fe[_0xa76b('0x17')](_0x1d4a5c);}return _0x27f7fe[_0xa76b('0x18')](_0x1d4a5c)[_0xa76b('0x19')]();};}function respondWithResult(_0x4893f3,_0x11e094){_0x11e094=_0x11e094||0xc8;return function(_0x7b045){if(_0x7b045){return _0x4893f3['status'](_0x11e094)[_0xa76b('0x1a')](_0x7b045);}};}function respondWithFilteredResult(_0x1da8e9,_0x2140cc){return function(_0x19f7eb){if(_0x19f7eb){var _0x4bf43=typeof _0x2140cc[_0xa76b('0x1b')]===_0xa76b('0x1c')&&typeof _0x2140cc[_0xa76b('0x1d')]===_0xa76b('0x1c');var _0xfcab=_0x19f7eb[_0xa76b('0x1e')];var _0xc9683c=_0x4bf43?0x0:_0x2140cc[_0xa76b('0x1b')];var _0xa931cf=_0x4bf43?_0x19f7eb[_0xa76b('0x1e')]:_0x2140cc[_0xa76b('0x1b')]+_0x2140cc['limit'];var _0x181b8d;if(_0xa931cf>=_0xfcab){_0xa931cf=_0xfcab;_0x181b8d=0xc8;}else{_0x181b8d=0xce;}_0x1da8e9['status'](_0x181b8d);return _0x1da8e9[_0xa76b('0x1f')](_0xa76b('0x20'),_0xc9683c+'-'+_0xa931cf+'/'+_0xfcab)['json'](_0x19f7eb);}return null;};}function patchUpdates(_0x5e3a7f){return function(_0x639c75){try{jsonpatch['apply'](_0x639c75,_0x5e3a7f,!![]);}catch(_0x299ad9){return BPromise[_0xa76b('0x21')](_0x299ad9);}return _0x639c75['save']();};}function saveUpdates(_0x2a6225,_0x4595aa){return function(_0x1d4174){if(_0x1d4174){return _0x1d4174[_0xa76b('0x22')](_0x2a6225)[_0xa76b('0x23')](function(_0x2dd740){return _0x2dd740;});}return null;};}function removeEntity(_0x43510e,_0xdb40d4){return function(_0x201ba6){if(_0x201ba6){return _0x201ba6[_0xa76b('0x24')]()[_0xa76b('0x23')](function(){_0x43510e[_0xa76b('0x18')](0xcc)[_0xa76b('0x19')]();});}};}function handleEntityNotFound(_0x250809,_0x380227){return function(_0x5da22a){if(!_0x5da22a){_0x250809[_0xa76b('0x17')](0x194);}return _0x5da22a;};}function handleError(_0x224cfd,_0x1813f5){_0x1813f5=_0x1813f5||0x1f4;return function(_0x27d011){logger[_0xa76b('0x25')](_0x27d011[_0xa76b('0x26')]);if(_0x27d011['name']){delete _0x27d011[_0xa76b('0x27')];}_0x224cfd[_0xa76b('0x18')](_0x1813f5)[_0xa76b('0x28')](_0x27d011);};}exports[_0xa76b('0x29')]=function(_0x1aeef5,_0x375df4){var _0x41b382={},_0x1f2491={},_0x44c55e={'count':0x0,'rows':[]};var _0x2dc465=_[_0xa76b('0x2a')](db[_0xa76b('0x2b')][_0xa76b('0x2c')],function(_0x10db2d){return{'name':_0x10db2d[_0xa76b('0x2d')],'type':_0x10db2d[_0xa76b('0x2e')][_0xa76b('0x2f')]};});_0x1f2491[_0xa76b('0x30')]=_['map'](_0x2dc465,_0xa76b('0x27'));_0x1f2491[_0xa76b('0x31')]=_['keys'](_0x1aeef5[_0xa76b('0x31')]);_0x1f2491['filters']=_[_0xa76b('0x32')](_0x1f2491[_0xa76b('0x30')],_0x1f2491[_0xa76b('0x31')]);_0x41b382[_0xa76b('0x33')]=_[_0xa76b('0x32')](_0x1f2491[_0xa76b('0x30')],qs[_0xa76b('0x34')](_0x1aeef5[_0xa76b('0x31')][_0xa76b('0x34')]));_0x41b382[_0xa76b('0x33')]=_0x41b382['attributes'][_0xa76b('0x35')]?_0x41b382[_0xa76b('0x33')]:_0x1f2491[_0xa76b('0x30')];if(!_0x1aeef5['query'][_0xa76b('0x36')](_0xa76b('0x37'))){_0x41b382[_0xa76b('0x1d')]=qs[_0xa76b('0x1d')](_0x1aeef5['query']['limit']);_0x41b382[_0xa76b('0x1b')]=qs[_0xa76b('0x1b')](_0x1aeef5[_0xa76b('0x31')][_0xa76b('0x1b')]);}_0x41b382['order']=qs[_0xa76b('0x38')](_0x1aeef5[_0xa76b('0x31')]['sort']);_0x41b382['where']=qs['filters'](_[_0xa76b('0x39')](_0x1aeef5[_0xa76b('0x31')],_0x1f2491[_0xa76b('0x3a')]),_0x2dc465);if(_0x1aeef5[_0xa76b('0x31')][_0xa76b('0x3b')]){_0x41b382['where']=_[_0xa76b('0x3c')](_0x41b382[_0xa76b('0x3d')],{'$or':_[_0xa76b('0x2a')](_0x2dc465,function(_0x551e9c){if(_0x551e9c[_0xa76b('0x2e')]!==_0xa76b('0x3e')){var _0x228bbc={};_0x228bbc[_0x551e9c[_0xa76b('0x27')]]={'$like':'%'+_0x1aeef5['query'][_0xa76b('0x3b')]+'%'};return _0x228bbc;}})});}_0x41b382=_[_0xa76b('0x3c')]({},_0x41b382,_0x1aeef5[_0xa76b('0x3f')]);var _0x14984e={'where':_0x41b382[_0xa76b('0x3d')]};return db[_0xa76b('0x2b')][_0xa76b('0x1e')](_0x14984e)[_0xa76b('0x23')](function(_0x41e1d3){_0x44c55e[_0xa76b('0x1e')]=_0x41e1d3;if(_0x1aeef5[_0xa76b('0x31')]['includeAll']){_0x41b382[_0xa76b('0x40')]=[{'all':!![]}];}return db[_0xa76b('0x2b')][_0xa76b('0x41')](_0x41b382);})['then'](function(_0x4634b8){_0x44c55e[_0xa76b('0x42')]=_0x4634b8;return _0x44c55e;})[_0xa76b('0x23')](respondWithFilteredResult(_0x375df4,_0x41b382))[_0xa76b('0x43')](handleError(_0x375df4,null));};exports[_0xa76b('0x44')]=function(_0x50525e,_0x4f98ed){var _0x200aee={'raw':!![],'where':{'id':_0x50525e['params']['id']}},_0x56fc7f={};_0x56fc7f[_0xa76b('0x30')]=_['keys'](db[_0xa76b('0x2b')]['rawAttributes']);_0x56fc7f['query']=_['keys'](_0x50525e[_0xa76b('0x31')]);_0x56fc7f[_0xa76b('0x3a')]=_[_0xa76b('0x32')](_0x56fc7f[_0xa76b('0x30')],_0x56fc7f[_0xa76b('0x31')]);_0x200aee['attributes']=_[_0xa76b('0x32')](_0x56fc7f[_0xa76b('0x30')],qs[_0xa76b('0x34')](_0x50525e[_0xa76b('0x31')][_0xa76b('0x34')]));_0x200aee[_0xa76b('0x33')]=_0x200aee[_0xa76b('0x33')][_0xa76b('0x35')]?_0x200aee[_0xa76b('0x33')]:_0x56fc7f[_0xa76b('0x30')];if(_0x50525e[_0xa76b('0x31')]['includeAll']){_0x200aee[_0xa76b('0x40')]=[{'all':!![]}];}_0x200aee=_['merge']({},_0x200aee,_0x50525e[_0xa76b('0x3f')]);return db[_0xa76b('0x2b')][_0xa76b('0x45')](_0x200aee)[_0xa76b('0x23')](handleEntityNotFound(_0x4f98ed,null))[_0xa76b('0x23')](respondWithResult(_0x4f98ed,null))[_0xa76b('0x43')](handleError(_0x4f98ed,null));};exports[_0xa76b('0x46')]=function(_0x202a17,_0x3c3eb8){return db[_0xa76b('0x2b')]['create'](_0x202a17[_0xa76b('0x47')],{})[_0xa76b('0x23')](respondWithResult(_0x3c3eb8,0xc9))['catch'](handleError(_0x3c3eb8,null));};exports[_0xa76b('0x22')]=function(_0x102ab4,_0x445ecb){if(_0x102ab4[_0xa76b('0x47')]['id']){delete _0x102ab4['body']['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x102ab4[_0xa76b('0x48')]['id']}})['then'](handleEntityNotFound(_0x445ecb,null))[_0xa76b('0x23')](saveUpdates(_0x102ab4[_0xa76b('0x47')],null))[_0xa76b('0x23')](respondWithResult(_0x445ecb,null))[_0xa76b('0x43')](handleError(_0x445ecb,null));};exports[_0xa76b('0x24')]=function(_0x6da637,_0x5f35aa){return db[_0xa76b('0x2b')]['find']({'where':{'id':_0x6da637[_0xa76b('0x48')]['id']}})['then'](handleEntityNotFound(_0x5f35aa,null))['then'](removeEntity(_0x5f35aa,null))[_0xa76b('0x43')](handleError(_0x5f35aa,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 3dadf47..b0dbf33 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 _0x68b7=['moment','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','idField','lodash','../../config/logger','api'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x68b7,0x8c));var _0x768b=function(_0xf8a7eb,_0x5539b5){_0xf8a7eb=_0xf8a7eb-0x0;var _0x131659=_0x68b7[_0xf8a7eb];return _0x131659;};'use strict';var _=require(_0x768b('0x0'));var util=require('util');var logger=require(_0x768b('0x1'))(_0x768b('0x2'));var moment=require(_0x768b('0x3'));var BPromise=require('bluebird');var rp=require(_0x768b('0x4'));var fs=require('fs');var path=require(_0x768b('0x5'));var rimraf=require(_0x768b('0x6'));var config=require('../../config/environment');var attributes=require(_0x768b('0x7'));module[_0x768b('0x8')]=function(_0x18aaaa,_0x31aba4){return _0x18aaaa[_0x768b('0x9')](_0x768b('0xa'),attributes,{'tableName':_0x768b('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x768b('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8374=['FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x2e8f4d,_0x579dbe){var _0x3daff6=function(_0x3e7032){while(--_0x3e7032){_0x2e8f4d['push'](_0x2e8f4d['shift']());}};_0x3daff6(++_0x579dbe);}(_0x8374,0x174));var _0x4837=function(_0x4905de,_0x137130){_0x4905de=_0x4905de-0x0;var _0x40c66a=_0x8374[_0x4905de];return _0x40c66a;};'use strict';var _=require(_0x4837('0x0'));var util=require(_0x4837('0x1'));var logger=require(_0x4837('0x2'))(_0x4837('0x3'));var moment=require(_0x4837('0x4'));var BPromise=require(_0x4837('0x5'));var rp=require(_0x4837('0x6'));var fs=require('fs');var path=require(_0x4837('0x7'));var rimraf=require(_0x4837('0x8'));var config=require(_0x4837('0x9'));var attributes=require(_0x4837('0xa'));module[_0x4837('0xb')]=function(_0x2bd5a7,_0x425c07){return _0x2bd5a7['define'](_0x4837('0xc'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x4837('0xd'),'fields':[_0x4837('0xe'),_0x4837('0xf')],'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 10654ab..91b34d7 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 _0x2bd8=['info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x4ea558,_0x4587e8){var _0x146d7c=function(_0x1e16ad){while(--_0x1e16ad){_0x4ea558['push'](_0x4ea558['shift']());}};_0x146d7c(++_0x4587e8);}(_0x2bd8,0x130));var _0x82bd=function(_0x42a3ab,_0x72d67f){_0x42a3ab=_0x42a3ab-0x0;var _0x59baee=_0x2bd8[_0x42a3ab];return _0x59baee;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var moment=require(_0x82bd('0x1'));var BPromise=require(_0x82bd('0x2'));var rs=require(_0x82bd('0x3'));var fs=require('fs');var Redis=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];var utils=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('rpc');var config=require(_0x82bd('0x8'));var jayson=require(_0x82bd('0x9'));var client=jayson[_0x82bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){return client[_0x82bd('0xb')](_0x19dbb1,_0x226f60)['then'](function(_0x4a9b2c){logger['info'](_0x82bd('0xc'),_0x77d7a9,'request\x20sent');logger['debug'](_0x82bd('0xd'),_0x77d7a9,'request\x20sent',JSON['stringify'](_0x4a9b2c));if(_0x4a9b2c[_0x82bd('0xe')]){if(_0x4a9b2c[_0x82bd('0xe')]['code']===0x1f4){logger[_0x82bd('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x4a9b2c[_0x82bd('0xe')]['message']);return _0x4dc3a6(_0x4a9b2c[_0x82bd('0xe')][_0x82bd('0xf')]);}logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x4a9b2c['error'][_0x82bd('0xf')]);return _0x1f7463(_0x4a9b2c[_0x82bd('0xe')]['message']);}else{logger[_0x82bd('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x82bd('0x11'));_0x1f7463(_0x4a9b2c[_0x82bd('0x12')][_0x82bd('0xf')]);}})[_0x82bd('0x13')](function(_0x209081){logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x209081);_0x4dc3a6(_0x209081);});});} \ No newline at end of file +var _0x71ab=['http','request','then','info','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshsalesField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3098ea,_0x48e418){var _0x295107=function(_0x52a44b){while(--_0x52a44b){_0x3098ea['push'](_0x3098ea['shift']());}};_0x295107(++_0x48e418);}(_0x71ab,0x64));var _0xb71a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x71ab[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var moment=require('moment');var BPromise=require(_0xb71a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var utils=require(_0xb71a('0x4'));var logger=require(_0xb71a('0x5'))(_0xb71a('0x6'));var config=require(_0xb71a('0x7'));var jayson=require(_0xb71a('0x8'));var client=jayson[_0xb71a('0x9')][_0xb71a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a84e,_0x4358ce,_0x2a4c86){return new BPromise(function(_0x43ca14,_0x471ab6){return client[_0xb71a('0xb')](_0x35a84e,_0x2a4c86)[_0xb71a('0xc')](function(_0x378c96){logger[_0xb71a('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0xb71a('0xe'));logger['debug'](_0xb71a('0xf'),_0x4358ce,_0xb71a('0xe'),JSON[_0xb71a('0x10')](_0x378c96));if(_0x378c96['error']){if(_0x378c96[_0xb71a('0x11')]['code']===0x1f4){logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error'][_0xb71a('0x12')]);return _0x471ab6(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error']['message']);return _0x43ca14(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}else{logger[_0xb71a('0xd')](_0xb71a('0x13'),_0x4358ce,_0xb71a('0xe'));_0x43ca14(_0x378c96[_0xb71a('0x14')][_0xb71a('0x12')]);}})[_0xb71a('0x15')](function(_0x7710a8){logger['error'](_0xb71a('0x13'),_0x4358ce,_0x7710a8);_0x471ab6(_0x7710a8);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 162b936..d3dd343 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(_0x1f65d0,_0x34317a){var _0x36b5d1=function(_0x27bbf0){while(--_0x27bbf0){_0x1f65d0['push'](_0x1f65d0['shift']());}};_0x36b5d1(++_0x34317a);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x14f5d3,_0x416e9d){var _0x1aeba4=function(_0x1af450){while(--_0x1af450){_0x14f5d3['push'](_0x14f5d3['shift']());}};_0x1aeba4(++_0x416e9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 9a352de..942b991 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 _0x2517=['newTab','integrationTab','sequelize','exports','STRING','username','ENUM'];(function(_0x3e0763,_0x3d12be){var _0x351ca2=function(_0x9beae7){while(--_0x9beae7){_0x3e0763['push'](_0x3e0763['shift']());}};_0x351ca2(++_0x3d12be);}(_0x2517,0xfe));var _0x7251=function(_0x3723d5,_0x421f4b){_0x3723d5=_0x3723d5-0x0;var _0x215936=_0x2517[_0x3723d5];return _0x215936;};'use strict';var Sequelize=require(_0x7251('0x0'));module[_0x7251('0x1')]={'name':{'type':Sequelize[_0x7251('0x2')]},'description':{'type':Sequelize[_0x7251('0x2')]},'username':{'type':Sequelize[_0x7251('0x2')],'unique':_0x7251('0x3')},'remoteUri':{'type':Sequelize[_0x7251('0x2')]},'password':{'type':Sequelize[_0x7251('0x2')]},'clientId':{'type':Sequelize[_0x7251('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x7251('0x2')]},'serverUrl':{'type':Sequelize[_0x7251('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7251('0x4')]('integrationTab',_0x7251('0x5')),'defaultValue':_0x7251('0x6')}}; \ No newline at end of file +var _0x1cdb=['ENUM','integrationTab','newTab','exports','STRING','username'];(function(_0x24ae4b,_0x1424da){var _0xe918c6=function(_0x3a4906){while(--_0x3a4906){_0x24ae4b['push'](_0x24ae4b['shift']());}};_0xe918c6(++_0x1424da);}(_0x1cdb,0x117));var _0xb1cd=function(_0x179210,_0x4198d6){_0x179210=_0x179210-0x0;var _0x5ca5bb=_0x1cdb[_0x179210];return _0x5ca5bb;};'use strict';var Sequelize=require('sequelize');module[_0xb1cd('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb1cd('0x1')],'unique':_0xb1cd('0x2')},'remoteUri':{'type':Sequelize[_0xb1cd('0x1')]},'password':{'type':Sequelize[_0xb1cd('0x1')]},'clientId':{'type':Sequelize[_0xb1cd('0x1')]},'clientSecret':{'type':Sequelize[_0xb1cd('0x1')]},'securityToken':{'type':Sequelize[_0xb1cd('0x1')]},'serverUrl':{'type':Sequelize[_0xb1cd('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb1cd('0x3')](_0xb1cd('0x4'),_0xb1cd('0x5')),'defaultValue':_0xb1cd('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 01db50b..ffce239 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 _0x1b36=['IsRecurrence','Subject','string','email','phone','remove','includes','label','custom','picklistValues','value','boolean','true','False','false','test','statusCode','stringify','zip-dir','request-promise','moment','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','SalesforceAccount','includeAll','findAll','catch','params','include','find','create','body','getConfigurations','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','SalesforceField','Descriptions','getFields','Task','findOne','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','Connection','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x1b36,0xfc));var _0x61b3=function(_0x45a082,_0x396c1c){_0x45a082=_0x45a082-0x0;var _0x22cf7c=_0x1b36[_0x45a082];return _0x22cf7c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x61b3('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61b3('0x1'));var moment=require(_0x61b3('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x61b3('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x61b3('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61b3('0x5'));var _=require('lodash');var squel=require(_0x61b3('0x6'));var crypto=require(_0x61b3('0x7'));var jsforce=require(_0x61b3('0x8'));var deskjs=require(_0x61b3('0x9'));var toCsv=require(_0x61b3('0x4'));var querystring=require(_0x61b3('0xa'));var Papa=require('papaparse');var Redis=require(_0x61b3('0xb'));var authService=require(_0x61b3('0xc'));var qs=require(_0x61b3('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x61b3('0xe'));var logger=require(_0x61b3('0xf'))(_0x61b3('0x10'));var utils=require(_0x61b3('0x11'));var config=require(_0x61b3('0x12'));var licenseUtil=require(_0x61b3('0x13'));var db=require(_0x61b3('0x14'))['db'];var integrations=require(_0x61b3('0x15'));function respondWithStatusCode(_0x2aee3f,_0x5857e1){_0x5857e1=_0x5857e1||0xcc;return function(_0x39d1cb){if(_0x39d1cb){return _0x2aee3f[_0x61b3('0x16')](_0x5857e1);}return _0x2aee3f[_0x61b3('0x17')](_0x5857e1)['end']();};}function respondWithResult(_0x1d1cef,_0x45d6f1){_0x45d6f1=_0x45d6f1||0xc8;return function(_0x5698e2){if(_0x5698e2){return _0x1d1cef[_0x61b3('0x17')](_0x45d6f1)[_0x61b3('0x18')](_0x5698e2);}};}function respondWithFilteredResult(_0x2dba96,_0x109759){return function(_0x4c7bfb){if(_0x4c7bfb){var _0x4e1eb5=typeof _0x109759['offset']===_0x61b3('0x19')&&typeof _0x109759[_0x61b3('0x1a')]===_0x61b3('0x19');var _0x477ac6=_0x4c7bfb[_0x61b3('0x1b')];var _0x5d76d9=_0x4e1eb5?0x0:_0x109759[_0x61b3('0x1c')];var _0x2e2056=_0x4e1eb5?_0x4c7bfb[_0x61b3('0x1b')]:_0x109759['offset']+_0x109759['limit'];var _0x4d91cf;if(_0x2e2056>=_0x477ac6){_0x2e2056=_0x477ac6;_0x4d91cf=0xc8;}else{_0x4d91cf=0xce;}_0x2dba96[_0x61b3('0x17')](_0x4d91cf);return _0x2dba96['set'](_0x61b3('0x1d'),_0x5d76d9+'-'+_0x2e2056+'/'+_0x477ac6)[_0x61b3('0x18')](_0x4c7bfb);}return null;};}function patchUpdates(_0x1f0023){return function(_0x39079a){try{jsonpatch[_0x61b3('0x1e')](_0x39079a,_0x1f0023,!![]);}catch(_0x1c3d76){return BPromise[_0x61b3('0x1f')](_0x1c3d76);}return _0x39079a['save']();};}function saveUpdates(_0x53c00a,_0xf97917){return function(_0x6b65b8){if(_0x6b65b8){return _0x6b65b8[_0x61b3('0x20')](_0x53c00a)[_0x61b3('0x21')](function(_0x123ded){return _0x123ded;});}return null;};}function removeEntity(_0x2a3305,_0x190334){return function(_0x31fe88){if(_0x31fe88){return _0x31fe88[_0x61b3('0x22')]()['then'](function(){_0x2a3305[_0x61b3('0x17')](0xcc)[_0x61b3('0x23')]();});}};}function handleEntityNotFound(_0x41492c,_0x5823b7){return function(_0x13e8e2){if(!_0x13e8e2){_0x41492c[_0x61b3('0x16')](0x194);}return _0x13e8e2;};}function handleError(_0x19494f,_0x2164e1){_0x2164e1=_0x2164e1||0x1f4;return function(_0x29b10a){logger[_0x61b3('0x24')](_0x29b10a['stack']);if(_0x29b10a[_0x61b3('0x25')]){delete _0x29b10a[_0x61b3('0x25')];}_0x19494f[_0x61b3('0x17')](_0x2164e1)[_0x61b3('0x26')](_0x29b10a);};}exports[_0x61b3('0x27')]=function(_0x189076,_0xb2bc32){var _0x3af444={},_0x107ab5={},_0xc82cd9={'count':0x0,'rows':[]};var _0x5546c4=_[_0x61b3('0x28')](db['SalesforceAccount'][_0x61b3('0x29')],function(_0xa6205a){return{'name':_0xa6205a[_0x61b3('0x2a')],'type':_0xa6205a[_0x61b3('0x2b')][_0x61b3('0x2c')]};});_0x107ab5[_0x61b3('0x2d')]=_[_0x61b3('0x28')](_0x5546c4,_0x61b3('0x25'));_0x107ab5[_0x61b3('0x2e')]=_[_0x61b3('0x2f')](_0x189076[_0x61b3('0x2e')]);_0x107ab5[_0x61b3('0x30')]=_[_0x61b3('0x31')](_0x107ab5[_0x61b3('0x2d')],_0x107ab5[_0x61b3('0x2e')]);_0x3af444[_0x61b3('0x32')]=_[_0x61b3('0x31')](_0x107ab5[_0x61b3('0x2d')],qs[_0x61b3('0x33')](_0x189076[_0x61b3('0x2e')]['fields']));_0x3af444['attributes']=_0x3af444['attributes'][_0x61b3('0x34')]?_0x3af444['attributes']:_0x107ab5[_0x61b3('0x2d')];if(!_0x189076[_0x61b3('0x2e')][_0x61b3('0x35')](_0x61b3('0x36'))){_0x3af444['limit']=qs[_0x61b3('0x1a')](_0x189076['query'][_0x61b3('0x1a')]);_0x3af444[_0x61b3('0x1c')]=qs[_0x61b3('0x1c')](_0x189076[_0x61b3('0x2e')][_0x61b3('0x1c')]);}_0x3af444[_0x61b3('0x37')]=qs[_0x61b3('0x38')](_0x189076[_0x61b3('0x2e')][_0x61b3('0x38')]);_0x3af444['where']=qs[_0x61b3('0x30')](_[_0x61b3('0x39')](_0x189076['query'],_0x107ab5[_0x61b3('0x30')]),_0x5546c4);if(_0x189076[_0x61b3('0x2e')]['filter']){_0x3af444[_0x61b3('0x3a')]=_[_0x61b3('0x3b')](_0x3af444[_0x61b3('0x3a')],{'$or':_[_0x61b3('0x28')](_0x5546c4,function(_0x577737){if(_0x577737[_0x61b3('0x2b')]!==_0x61b3('0x3c')){var _0x184d6a={};_0x184d6a[_0x577737['name']]={'$like':'%'+_0x189076[_0x61b3('0x2e')][_0x61b3('0x3d')]+'%'};return _0x184d6a;}})});}_0x3af444=_[_0x61b3('0x3b')]({},_0x3af444,_0x189076[_0x61b3('0x3e')]);var _0xa94adc={'where':_0x3af444[_0x61b3('0x3a')]};return db[_0x61b3('0x3f')][_0x61b3('0x1b')](_0xa94adc)[_0x61b3('0x21')](function(_0x299d3a){_0xc82cd9[_0x61b3('0x1b')]=_0x299d3a;if(_0x189076[_0x61b3('0x2e')][_0x61b3('0x40')]){_0x3af444['include']=[{'all':!![]}];}return db[_0x61b3('0x3f')][_0x61b3('0x41')](_0x3af444);})[_0x61b3('0x21')](function(_0x228302){_0xc82cd9['rows']=_0x228302;return _0xc82cd9;})['then'](respondWithFilteredResult(_0xb2bc32,_0x3af444))[_0x61b3('0x42')](handleError(_0xb2bc32,null));};exports['show']=function(_0x25fca4,_0xc63f7f){var _0x3c90d6={'raw':![],'where':{'id':_0x25fca4[_0x61b3('0x43')]['id']}},_0x1b3842={};_0x1b3842['model']=_[_0x61b3('0x2f')](db[_0x61b3('0x3f')][_0x61b3('0x29')]);_0x1b3842['query']=_[_0x61b3('0x2f')](_0x25fca4[_0x61b3('0x2e')]);_0x1b3842[_0x61b3('0x30')]=_[_0x61b3('0x31')](_0x1b3842[_0x61b3('0x2d')],_0x1b3842[_0x61b3('0x2e')]);_0x3c90d6[_0x61b3('0x32')]=_['intersection'](_0x1b3842[_0x61b3('0x2d')],qs[_0x61b3('0x33')](_0x25fca4[_0x61b3('0x2e')][_0x61b3('0x33')]));_0x3c90d6[_0x61b3('0x32')]=_0x3c90d6[_0x61b3('0x32')]['length']?_0x3c90d6[_0x61b3('0x32')]:_0x1b3842[_0x61b3('0x2d')];if(_0x25fca4[_0x61b3('0x2e')][_0x61b3('0x40')]){_0x3c90d6[_0x61b3('0x44')]=[{'all':!![]}];}_0x3c90d6=_['merge']({},_0x3c90d6,_0x25fca4[_0x61b3('0x3e')]);return db[_0x61b3('0x3f')][_0x61b3('0x45')](_0x3c90d6)[_0x61b3('0x21')](handleEntityNotFound(_0xc63f7f,null))[_0x61b3('0x21')](respondWithResult(_0xc63f7f,null))[_0x61b3('0x42')](handleError(_0xc63f7f,null));};exports[_0x61b3('0x46')]=function(_0x37db93,_0x38f037){return db[_0x61b3('0x3f')][_0x61b3('0x46')](_0x37db93['body'],{})[_0x61b3('0x21')](respondWithResult(_0x38f037,0xc9))[_0x61b3('0x42')](handleError(_0x38f037,null));};exports[_0x61b3('0x20')]=function(_0x5d8d8c,_0x1ea5f9){if(_0x5d8d8c[_0x61b3('0x47')]['id']){delete _0x5d8d8c[_0x61b3('0x47')]['id'];}return db[_0x61b3('0x3f')][_0x61b3('0x45')]({'where':{'id':_0x5d8d8c[_0x61b3('0x43')]['id']}})[_0x61b3('0x21')](handleEntityNotFound(_0x1ea5f9,null))['then'](saveUpdates(_0x5d8d8c['body'],null))[_0x61b3('0x21')](respondWithResult(_0x1ea5f9,null))[_0x61b3('0x42')](handleError(_0x1ea5f9,null));};exports['destroy']=function(_0x3710e8,_0x39e5bf){return db[_0x61b3('0x3f')][_0x61b3('0x45')]({'where':{'id':_0x3710e8[_0x61b3('0x43')]['id']}})[_0x61b3('0x21')](handleEntityNotFound(_0x39e5bf,null))[_0x61b3('0x21')](removeEntity(_0x39e5bf,null))['catch'](handleError(_0x39e5bf,null));};exports[_0x61b3('0x48')]=function(_0x2ebfe3,_0x929145,_0xf6c254){var _0x246b91={};var _0x3bcd4d={};var _0x12943a;var _0x3b511a;return db['SalesforceAccount']['findOne']({'where':{'id':_0x2ebfe3['params']['id']}})['then'](handleEntityNotFound(_0x929145,null))['then'](function(_0x398a42){if(_0x398a42){_0x12943a=_0x398a42;_0x3bcd4d[_0x61b3('0x2d')]=_[_0x61b3('0x2f')](db[_0x61b3('0x49')]['rawAttributes']);_0x3bcd4d[_0x61b3('0x2e')]=_[_0x61b3('0x2f')](_0x2ebfe3[_0x61b3('0x2e')]);_0x3bcd4d['filters']=_['intersection'](_0x3bcd4d[_0x61b3('0x2d')],_0x3bcd4d[_0x61b3('0x2e')]);_0x246b91[_0x61b3('0x32')]=_[_0x61b3('0x31')](_0x3bcd4d[_0x61b3('0x2d')],qs[_0x61b3('0x33')](_0x2ebfe3[_0x61b3('0x2e')][_0x61b3('0x33')]));_0x246b91[_0x61b3('0x32')]=_0x246b91[_0x61b3('0x32')][_0x61b3('0x34')]?_0x246b91[_0x61b3('0x32')]:_0x3bcd4d[_0x61b3('0x2d')];_0x246b91['order']=qs[_0x61b3('0x38')](_0x2ebfe3[_0x61b3('0x2e')]['sort']);_0x246b91[_0x61b3('0x3a')]=qs[_0x61b3('0x30')](_[_0x61b3('0x39')](_0x2ebfe3[_0x61b3('0x2e')],_0x3bcd4d[_0x61b3('0x30')]));if(_0x2ebfe3[_0x61b3('0x2e')][_0x61b3('0x3d')]){_0x246b91[_0x61b3('0x3a')]=_[_0x61b3('0x3b')](_0x246b91[_0x61b3('0x3a')],{'$or':_[_0x61b3('0x28')](_0x246b91[_0x61b3('0x32')],function(_0x599ad1){var _0x47f081={};_0x47f081[_0x599ad1]={'$like':'%'+_0x2ebfe3[_0x61b3('0x2e')][_0x61b3('0x3d')]+'%'};return _0x47f081;})});}_0x246b91=_[_0x61b3('0x3b')]({},_0x246b91,_0x2ebfe3[_0x61b3('0x3e')]);return _0x12943a[_0x61b3('0x48')](_0x246b91);}})[_0x61b3('0x21')](function(_0x501452){if(_0x501452){_0x3b511a=_0x501452['length'];if(!_0x2ebfe3[_0x61b3('0x2e')][_0x61b3('0x35')](_0x61b3('0x36'))){_0x246b91['limit']=qs[_0x61b3('0x1a')](_0x2ebfe3[_0x61b3('0x2e')][_0x61b3('0x1a')]);_0x246b91[_0x61b3('0x1c')]=qs['offset'](_0x2ebfe3[_0x61b3('0x2e')][_0x61b3('0x1c')]);}return _0x12943a[_0x61b3('0x48')](_0x246b91);}})[_0x61b3('0x21')](function(_0x2a5363){if(_0x2a5363){return _0x2a5363?{'count':_0x3b511a,'rows':_0x2a5363}:null;}})['then'](respondWithResult(_0x929145,null))[_0x61b3('0x42')](handleError(_0x929145,null));};exports[_0x61b3('0x4a')]=function(_0x4c74cc,_0x4d5c51,_0xead944){if(_0x4c74cc[_0x61b3('0x47')]['id']){delete _0x4c74cc[_0x61b3('0x47')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x4c74cc[_0x61b3('0x43')]['id']}})[_0x61b3('0x21')](handleEntityNotFound(_0x4d5c51,null))[_0x61b3('0x21')](function(_0x24a7b0){if(_0x24a7b0){_0x4c74cc['body'][_0x61b3('0x4b')]=_0x24a7b0['id'];_0x4c74cc[_0x61b3('0x47')][_0x61b3('0x4c')]=integrations[_0x61b3('0x4d')](_0x4c74cc[_0x61b3('0x47')]['channel'],_0x4c74cc[_0x61b3('0x47')][_0x61b3('0x2b')]);_0x4c74cc[_0x61b3('0x47')]['Descriptions']=integrations['getDescriptions'](_0x4c74cc['body'][_0x61b3('0x4e')],_0x4c74cc['body'][_0x61b3('0x2b')]);return db['SalesforceConfiguration'][_0x61b3('0x46')](_0x4c74cc['body'],{'include':[{'model':db[_0x61b3('0x4f')],'as':_0x61b3('0x4c')},{'model':db[_0x61b3('0x4f')],'as':_0x61b3('0x50')}]});}return null;})[_0x61b3('0x21')](respondWithResult(_0x4d5c51,null))[_0x61b3('0x42')](handleError(_0x4d5c51,null));};exports[_0x61b3('0x51')]=function(_0x2a821b,_0x39a273,_0x75508e){var _0xcabb74;var _0x350e56='';var _0x40795d=_0x61b3('0x52');return db[_0x61b3('0x3f')][_0x61b3('0x53')]({'where':{'id':_0x2a821b[_0x61b3('0x43')]['id']},'attributes':['id',_0x61b3('0x54'),_0x61b3('0x55'),_0x61b3('0x56'),_0x61b3('0x57'),_0x61b3('0x58'),_0x61b3('0x59')]})[_0x61b3('0x21')](handleEntityNotFound(_0x39a273,null))['then'](function(_0x9ac050){if(_0x9ac050){_0x350e56=_0x9ac050['remoteUri'];var _0x17c071=_0x350e56[_0x61b3('0x5a')](-0x1);if(_0x17c071==='/'){_0x350e56=_0x350e56[_0x61b3('0x5b')](0x0,_0x350e56['lastIndexOf'](_0x17c071));}_0xcabb74=new jsforce[(_0x61b3('0x5c'))]({'oauth2':{'loginUrl':_0x350e56,'clientId':_0x9ac050[_0x61b3('0x55')],'clientSecret':_0x9ac050['clientSecret']}});return _0xcabb74['login'](_0x9ac050[_0x61b3('0x57')],_0x9ac050[_0x61b3('0x58')]['concat'](_0x9ac050[_0x61b3('0x59')]));}})[_0x61b3('0x21')](function(_0x4d2b46){if(_0x4d2b46){if(!_[_0x61b3('0x5d')](_0x2a821b[_0x61b3('0x2e')][_0x61b3('0x5e')])){_0x40795d=_0x2a821b[_0x61b3('0x2e')][_0x61b3('0x5e')];}return _0xcabb74[_0x61b3('0x5f')](_0x40795d)[_0x61b3('0x60')]();}})[_0x61b3('0x21')](function(_0x1fdadc){var _0x45975b=['OwnerId',_0x61b3('0x61'),_0x61b3('0x62'),_0x61b3('0x63'),_0x61b3('0x64'),'Description'];var _0x4f8290=[_0x61b3('0x65'),'int','picklist','boolean',_0x61b3('0x66'),'textarea',_0x61b3('0x67')];if(_0x1fdadc){_[_0x61b3('0x68')](_0x1fdadc[_0x61b3('0x33')],function(_0xd478fa){return _0x45975b[_0x61b3('0x69')](_0xd478fa['name'])||!_0x4f8290[_0x61b3('0x69')](_0xd478fa[_0x61b3('0x2b')]);});return{'count':_0x1fdadc['fields']['length'],'rows':_[_0x61b3('0x28')](_0x1fdadc[_0x61b3('0x33')],function(_0x18d1b6){return{'id':_0x18d1b6[_0x61b3('0x25')],'name':_0x18d1b6[_0x61b3('0x6a')],'custom':_0x18d1b6[_0x61b3('0x6b')],'options':_0x18d1b6[_0x61b3('0x6c')][_0x61b3('0x34')]>0x0?_[_0x61b3('0x28')](_0x18d1b6['picklistValues'],function(_0x488865){return{'name':_0x488865[_0x61b3('0x6a')],'value':_0x488865[_0x61b3('0x6d')]};}):_0x18d1b6[_0x61b3('0x2b')]==_0x61b3('0x6e')?[{'name':'True','value':_0x61b3('0x6f')},{'name':_0x61b3('0x70'),'value':_0x61b3('0x71')}]:[]};})};}})[_0x61b3('0x21')](respondWithResult(_0x39a273,null))[_0x61b3('0x42')](function(_0x5a58e6){var _0x34d36b=_0x2a821b[_0x61b3('0x2e')][_0x61b3('0x72')]?0x1f4:_0x5a58e6[_0x61b3('0x73')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x61b3('0x51'),_0x34d36b,JSON[_0x61b3('0x74')](_0x5a58e6));delete _0x5a58e6[_0x61b3('0x25')];if(_0x34d36b===0x191){_0x34d36b=0x190;}_0x39a273[_0x61b3('0x17')](_0x34d36b)[_0x61b3('0x26')](_0x2a821b[_0x61b3('0x2e')][_0x61b3('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x5a58e6[_0x61b3('0x73')]}:_0x5a58e6);});}; \ No newline at end of file +var _0x540f=['clientId','clientSecret','username','securityToken','lastIndexOf','Connection','login','password','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','Subject','Description','email','textarea','remove','includes','label','custom','picklistValues','value','boolean','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','SalesforceAccount','count','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','params','getConfigurations','findOne','SalesforceConfiguration','options','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri'];(function(_0x25ab75,_0x32b0f6){var _0x42873f=function(_0x56e6e3){while(--_0x56e6e3){_0x25ab75['push'](_0x25ab75['shift']());}};_0x42873f(++_0x32b0f6);}(_0x540f,0x11a));var _0xf540=function(_0x3be7ff,_0x12e714){_0x3be7ff=_0x3be7ff-0x0;var _0x186721=_0x540f[_0x3be7ff];return _0x186721;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf540('0x0'));var zipdir=require(_0xf540('0x1'));var jsonpatch=require(_0xf540('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf540('0x3'));var Mustache=require(_0xf540('0x4'));var util=require(_0xf540('0x5'));var path=require(_0xf540('0x6'));var sox=require(_0xf540('0x7'));var csv=require('to-csv');var ejs=require(_0xf540('0x8'));var fs=require('fs');var fs_extra=require(_0xf540('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf540('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf540('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf540('0xc'));var Redis=require(_0xf540('0xd'));var authService=require(_0xf540('0xe'));var qs=require(_0xf540('0xf'));var as=require(_0xf540('0x10'));var hardwareService=require(_0xf540('0x11'));var logger=require(_0xf540('0x12'))('api');var utils=require(_0xf540('0x13'));var config=require(_0xf540('0x14'));var licenseUtil=require(_0xf540('0x15'));var db=require(_0xf540('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xee7774,_0x465f41){_0x465f41=_0x465f41||0xcc;return function(_0x38f9d5){if(_0x38f9d5){return _0xee7774[_0xf540('0x17')](_0x465f41);}return _0xee7774[_0xf540('0x18')](_0x465f41)[_0xf540('0x19')]();};}function respondWithResult(_0x5d9287,_0x1f65fb){_0x1f65fb=_0x1f65fb||0xc8;return function(_0x530db9){if(_0x530db9){return _0x5d9287[_0xf540('0x18')](_0x1f65fb)[_0xf540('0x1a')](_0x530db9);}};}function respondWithFilteredResult(_0x54fb93,_0x5a2fad){return function(_0x49518a){if(_0x49518a){var _0x4a1ad6=typeof _0x5a2fad[_0xf540('0x1b')]===_0xf540('0x1c')&&typeof _0x5a2fad[_0xf540('0x1d')]===_0xf540('0x1c');var _0x5bd736=_0x49518a['count'];var _0x2fa0de=_0x4a1ad6?0x0:_0x5a2fad[_0xf540('0x1b')];var _0x190956=_0x4a1ad6?_0x49518a['count']:_0x5a2fad[_0xf540('0x1b')]+_0x5a2fad['limit'];var _0x1fc881;if(_0x190956>=_0x5bd736){_0x190956=_0x5bd736;_0x1fc881=0xc8;}else{_0x1fc881=0xce;}_0x54fb93[_0xf540('0x18')](_0x1fc881);return _0x54fb93[_0xf540('0x1e')](_0xf540('0x1f'),_0x2fa0de+'-'+_0x190956+'/'+_0x5bd736)[_0xf540('0x1a')](_0x49518a);}return null;};}function patchUpdates(_0x1c1a1d){return function(_0x1027a4){try{jsonpatch['apply'](_0x1027a4,_0x1c1a1d,!![]);}catch(_0x5e04be){return BPromise[_0xf540('0x20')](_0x5e04be);}return _0x1027a4[_0xf540('0x21')]();};}function saveUpdates(_0x1bcf3d,_0x4f5d49){return function(_0x320036){if(_0x320036){return _0x320036[_0xf540('0x22')](_0x1bcf3d)[_0xf540('0x23')](function(_0x51f4fb){return _0x51f4fb;});}return null;};}function removeEntity(_0x1c86cd,_0x5a56fa){return function(_0x3131ec){if(_0x3131ec){return _0x3131ec[_0xf540('0x24')]()['then'](function(){_0x1c86cd[_0xf540('0x18')](0xcc)[_0xf540('0x19')]();});}};}function handleEntityNotFound(_0x7949e3,_0xf5770a){return function(_0x26888f){if(!_0x26888f){_0x7949e3[_0xf540('0x17')](0x194);}return _0x26888f;};}function handleError(_0x5b7da6,_0x17f848){_0x17f848=_0x17f848||0x1f4;return function(_0x2bfe2a){logger[_0xf540('0x25')](_0x2bfe2a[_0xf540('0x26')]);if(_0x2bfe2a[_0xf540('0x27')]){delete _0x2bfe2a[_0xf540('0x27')];}_0x5b7da6[_0xf540('0x18')](_0x17f848)[_0xf540('0x28')](_0x2bfe2a);};}exports[_0xf540('0x29')]=function(_0x344dc6,_0x1cb741){var _0x394356={},_0x447aed={},_0x2fada5={'count':0x0,'rows':[]};var _0x1c45b4=_['map'](db['SalesforceAccount']['rawAttributes'],function(_0x3f0667){return{'name':_0x3f0667[_0xf540('0x2a')],'type':_0x3f0667['type'][_0xf540('0x2b')]};});_0x447aed[_0xf540('0x2c')]=_[_0xf540('0x2d')](_0x1c45b4,_0xf540('0x27'));_0x447aed[_0xf540('0x2e')]=_[_0xf540('0x2f')](_0x344dc6[_0xf540('0x2e')]);_0x447aed['filters']=_[_0xf540('0x30')](_0x447aed[_0xf540('0x2c')],_0x447aed[_0xf540('0x2e')]);_0x394356[_0xf540('0x31')]=_['intersection'](_0x447aed[_0xf540('0x2c')],qs['fields'](_0x344dc6[_0xf540('0x2e')][_0xf540('0x32')]));_0x394356[_0xf540('0x31')]=_0x394356[_0xf540('0x31')][_0xf540('0x33')]?_0x394356[_0xf540('0x31')]:_0x447aed['model'];if(!_0x344dc6[_0xf540('0x2e')][_0xf540('0x34')](_0xf540('0x35'))){_0x394356[_0xf540('0x1d')]=qs[_0xf540('0x1d')](_0x344dc6[_0xf540('0x2e')][_0xf540('0x1d')]);_0x394356[_0xf540('0x1b')]=qs[_0xf540('0x1b')](_0x344dc6[_0xf540('0x2e')]['offset']);}_0x394356[_0xf540('0x36')]=qs[_0xf540('0x37')](_0x344dc6[_0xf540('0x2e')][_0xf540('0x37')]);_0x394356['where']=qs[_0xf540('0x38')](_[_0xf540('0x39')](_0x344dc6[_0xf540('0x2e')],_0x447aed[_0xf540('0x38')]),_0x1c45b4);if(_0x344dc6[_0xf540('0x2e')]['filter']){_0x394356[_0xf540('0x3a')]=_[_0xf540('0x3b')](_0x394356['where'],{'$or':_['map'](_0x1c45b4,function(_0x7433f){if(_0x7433f[_0xf540('0x3c')]!==_0xf540('0x3d')){var _0x144098={};_0x144098[_0x7433f[_0xf540('0x27')]]={'$like':'%'+_0x344dc6[_0xf540('0x2e')][_0xf540('0x3e')]+'%'};return _0x144098;}})});}_0x394356=_[_0xf540('0x3b')]({},_0x394356,_0x344dc6['options']);var _0x47ecab={'where':_0x394356[_0xf540('0x3a')]};return db[_0xf540('0x3f')][_0xf540('0x40')](_0x47ecab)[_0xf540('0x23')](function(_0x2358cb){_0x2fada5[_0xf540('0x40')]=_0x2358cb;if(_0x344dc6[_0xf540('0x2e')][_0xf540('0x41')]){_0x394356[_0xf540('0x42')]=[{'all':!![]}];}return db[_0xf540('0x3f')][_0xf540('0x43')](_0x394356);})[_0xf540('0x23')](function(_0x12dab3){_0x2fada5[_0xf540('0x44')]=_0x12dab3;return _0x2fada5;})[_0xf540('0x23')](respondWithFilteredResult(_0x1cb741,_0x394356))['catch'](handleError(_0x1cb741,null));};exports[_0xf540('0x45')]=function(_0x529025,_0x3ba5dd){var _0x240130={'raw':![],'where':{'id':_0x529025['params']['id']}},_0x1a578f={};_0x1a578f[_0xf540('0x2c')]=_[_0xf540('0x2f')](db[_0xf540('0x3f')][_0xf540('0x46')]);_0x1a578f[_0xf540('0x2e')]=_[_0xf540('0x2f')](_0x529025[_0xf540('0x2e')]);_0x1a578f[_0xf540('0x38')]=_[_0xf540('0x30')](_0x1a578f[_0xf540('0x2c')],_0x1a578f[_0xf540('0x2e')]);_0x240130[_0xf540('0x31')]=_[_0xf540('0x30')](_0x1a578f['model'],qs['fields'](_0x529025[_0xf540('0x2e')][_0xf540('0x32')]));_0x240130[_0xf540('0x31')]=_0x240130[_0xf540('0x31')]['length']?_0x240130[_0xf540('0x31')]:_0x1a578f[_0xf540('0x2c')];if(_0x529025[_0xf540('0x2e')][_0xf540('0x41')]){_0x240130['include']=[{'all':!![]}];}_0x240130=_[_0xf540('0x3b')]({},_0x240130,_0x529025['options']);return db[_0xf540('0x3f')][_0xf540('0x47')](_0x240130)[_0xf540('0x23')](handleEntityNotFound(_0x3ba5dd,null))[_0xf540('0x23')](respondWithResult(_0x3ba5dd,null))[_0xf540('0x48')](handleError(_0x3ba5dd,null));};exports[_0xf540('0x49')]=function(_0x21075f,_0x57dd7f){return db['SalesforceAccount'][_0xf540('0x49')](_0x21075f[_0xf540('0x4a')],{})[_0xf540('0x23')](respondWithResult(_0x57dd7f,0xc9))[_0xf540('0x48')](handleError(_0x57dd7f,null));};exports[_0xf540('0x22')]=function(_0x6a3964,_0x5deefe){if(_0x6a3964[_0xf540('0x4a')]['id']){delete _0x6a3964['body']['id'];}return db[_0xf540('0x3f')][_0xf540('0x47')]({'where':{'id':_0x6a3964[_0xf540('0x4b')]['id']}})[_0xf540('0x23')](handleEntityNotFound(_0x5deefe,null))[_0xf540('0x23')](saveUpdates(_0x6a3964['body'],null))[_0xf540('0x23')](respondWithResult(_0x5deefe,null))[_0xf540('0x48')](handleError(_0x5deefe,null));};exports[_0xf540('0x24')]=function(_0x259fa3,_0x4c22af){return db[_0xf540('0x3f')][_0xf540('0x47')]({'where':{'id':_0x259fa3[_0xf540('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c22af,null))[_0xf540('0x23')](removeEntity(_0x4c22af,null))[_0xf540('0x48')](handleError(_0x4c22af,null));};exports[_0xf540('0x4c')]=function(_0x2bee54,_0x18c258,_0x9b1f15){var _0x59aadb={};var _0x2b8665={};var _0x19e8c8;var _0x461788;return db[_0xf540('0x3f')][_0xf540('0x4d')]({'where':{'id':_0x2bee54[_0xf540('0x4b')]['id']}})[_0xf540('0x23')](handleEntityNotFound(_0x18c258,null))[_0xf540('0x23')](function(_0x3312ac){if(_0x3312ac){_0x19e8c8=_0x3312ac;_0x2b8665[_0xf540('0x2c')]=_[_0xf540('0x2f')](db[_0xf540('0x4e')][_0xf540('0x46')]);_0x2b8665[_0xf540('0x2e')]=_[_0xf540('0x2f')](_0x2bee54[_0xf540('0x2e')]);_0x2b8665[_0xf540('0x38')]=_[_0xf540('0x30')](_0x2b8665[_0xf540('0x2c')],_0x2b8665[_0xf540('0x2e')]);_0x59aadb['attributes']=_[_0xf540('0x30')](_0x2b8665['model'],qs[_0xf540('0x32')](_0x2bee54[_0xf540('0x2e')]['fields']));_0x59aadb[_0xf540('0x31')]=_0x59aadb[_0xf540('0x31')][_0xf540('0x33')]?_0x59aadb['attributes']:_0x2b8665['model'];_0x59aadb['order']=qs[_0xf540('0x37')](_0x2bee54['query'][_0xf540('0x37')]);_0x59aadb['where']=qs[_0xf540('0x38')](_[_0xf540('0x39')](_0x2bee54['query'],_0x2b8665[_0xf540('0x38')]));if(_0x2bee54[_0xf540('0x2e')][_0xf540('0x3e')]){_0x59aadb[_0xf540('0x3a')]=_[_0xf540('0x3b')](_0x59aadb[_0xf540('0x3a')],{'$or':_[_0xf540('0x2d')](_0x59aadb[_0xf540('0x31')],function(_0x3077a7){var _0x36bc45={};_0x36bc45[_0x3077a7]={'$like':'%'+_0x2bee54[_0xf540('0x2e')][_0xf540('0x3e')]+'%'};return _0x36bc45;})});}_0x59aadb=_[_0xf540('0x3b')]({},_0x59aadb,_0x2bee54[_0xf540('0x4f')]);return _0x19e8c8[_0xf540('0x4c')](_0x59aadb);}})[_0xf540('0x23')](function(_0x1f7d3e){if(_0x1f7d3e){_0x461788=_0x1f7d3e[_0xf540('0x33')];if(!_0x2bee54[_0xf540('0x2e')][_0xf540('0x34')](_0xf540('0x35'))){_0x59aadb[_0xf540('0x1d')]=qs['limit'](_0x2bee54['query'][_0xf540('0x1d')]);_0x59aadb['offset']=qs[_0xf540('0x1b')](_0x2bee54[_0xf540('0x2e')][_0xf540('0x1b')]);}return _0x19e8c8[_0xf540('0x4c')](_0x59aadb);}})[_0xf540('0x23')](function(_0x13c8d0){if(_0x13c8d0){return _0x13c8d0?{'count':_0x461788,'rows':_0x13c8d0}:null;}})[_0xf540('0x23')](respondWithResult(_0x18c258,null))[_0xf540('0x48')](handleError(_0x18c258,null));};exports[_0xf540('0x50')]=function(_0x5c1e30,_0x4b137e,_0x312c71){if(_0x5c1e30['body']['id']){delete _0x5c1e30[_0xf540('0x4a')]['id'];}return db[_0xf540('0x3f')]['findOne']({'where':{'id':_0x5c1e30[_0xf540('0x4b')]['id']}})[_0xf540('0x23')](handleEntityNotFound(_0x4b137e,null))[_0xf540('0x23')](function(_0x44b77e){if(_0x44b77e){_0x5c1e30[_0xf540('0x4a')][_0xf540('0x51')]=_0x44b77e['id'];_0x5c1e30[_0xf540('0x4a')][_0xf540('0x52')]=integrations[_0xf540('0x53')](_0x5c1e30[_0xf540('0x4a')]['channel'],_0x5c1e30[_0xf540('0x4a')][_0xf540('0x3c')]);_0x5c1e30[_0xf540('0x4a')][_0xf540('0x54')]=integrations[_0xf540('0x55')](_0x5c1e30[_0xf540('0x4a')]['channel'],_0x5c1e30[_0xf540('0x4a')]['type']);return db[_0xf540('0x4e')][_0xf540('0x49')](_0x5c1e30['body'],{'include':[{'model':db[_0xf540('0x56')],'as':_0xf540('0x52')},{'model':db[_0xf540('0x56')],'as':_0xf540('0x54')}]});}return null;})[_0xf540('0x23')](respondWithResult(_0x4b137e,null))[_0xf540('0x48')](handleError(_0x4b137e,null));};exports[_0xf540('0x57')]=function(_0x379a1c,_0x5c0cf1,_0x41073b){var _0x57ffca;var _0x313764='';var _0x2d46d9=_0xf540('0x58');return db['SalesforceAccount']['findOne']({'where':{'id':_0x379a1c[_0xf540('0x4b')]['id']},'attributes':['id',_0xf540('0x59'),_0xf540('0x5a'),_0xf540('0x5b'),_0xf540('0x5c'),'password',_0xf540('0x5d')]})['then'](handleEntityNotFound(_0x5c0cf1,null))['then'](function(_0x3168bc){if(_0x3168bc){_0x313764=_0x3168bc[_0xf540('0x59')];var _0x237454=_0x313764['slice'](-0x1);if(_0x237454==='/'){_0x313764=_0x313764['substring'](0x0,_0x313764[_0xf540('0x5e')](_0x237454));}_0x57ffca=new jsforce[(_0xf540('0x5f'))]({'oauth2':{'loginUrl':_0x313764,'clientId':_0x3168bc['clientId'],'clientSecret':_0x3168bc[_0xf540('0x5b')]}});return _0x57ffca[_0xf540('0x60')](_0x3168bc[_0xf540('0x5c')],_0x3168bc[_0xf540('0x61')]['concat'](_0x3168bc[_0xf540('0x5d')]));}})['then'](function(_0x208fc6){if(_0x208fc6){if(!_[_0xf540('0x62')](_0x379a1c['query'][_0xf540('0x63')])){_0x2d46d9=_0x379a1c[_0xf540('0x2e')][_0xf540('0x63')];}return _0x57ffca[_0xf540('0x64')](_0x2d46d9)[_0xf540('0x65')]();}})[_0xf540('0x23')](function(_0x57af0d){var _0x356310=[_0xf540('0x66'),_0xf540('0x67'),_0xf540('0x68'),'IsRecurrence',_0xf540('0x69'),_0xf540('0x6a')];var _0x4fffcd=['string','int','picklist','boolean',_0xf540('0x6b'),_0xf540('0x6c'),'phone'];if(_0x57af0d){_[_0xf540('0x6d')](_0x57af0d[_0xf540('0x32')],function(_0xa745fe){return _0x356310[_0xf540('0x6e')](_0xa745fe[_0xf540('0x27')])||!_0x4fffcd['includes'](_0xa745fe[_0xf540('0x3c')]);});return{'count':_0x57af0d[_0xf540('0x32')][_0xf540('0x33')],'rows':_[_0xf540('0x2d')](_0x57af0d['fields'],function(_0x3040d7){return{'id':_0x3040d7[_0xf540('0x27')],'name':_0x3040d7[_0xf540('0x6f')],'custom':_0x3040d7[_0xf540('0x70')],'options':_0x3040d7[_0xf540('0x71')][_0xf540('0x33')]>0x0?_[_0xf540('0x2d')](_0x3040d7[_0xf540('0x71')],function(_0xcde4ce){return{'name':_0xcde4ce['label'],'value':_0xcde4ce[_0xf540('0x72')]};}):_0x3040d7[_0xf540('0x3c')]==_0xf540('0x73')?[{'name':'True','value':_0xf540('0x74')},{'name':_0xf540('0x75'),'value':_0xf540('0x76')}]:[]};})};}})['then'](respondWithResult(_0x5c0cf1,null))[_0xf540('0x48')](function(_0x4bdb5b){var _0x40ba50=_0x379a1c['query'][_0xf540('0x77')]?0x1f4:_0x4bdb5b[_0xf540('0x78')]||0x1f4;logger['error'](_0xf540('0x79'),_0xf540('0x57'),_0x40ba50,JSON[_0xf540('0x7a')](_0x4bdb5b));delete _0x4bdb5b[_0xf540('0x27')];if(_0x40ba50===0x191){_0x40ba50=0x190;}_0x5c0cf1[_0xf540('0x18')](_0x40ba50)['send'](_0x379a1c[_0xf540('0x2e')]['test']?{'message':_0xf540('0x7b'),'statusCode':_0x4bdb5b[_0xf540('0x78')]}:_0x4bdb5b);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index f33d5c6..7cce4a8 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 _0x2504=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts'];(function(_0x481457,_0x1c3300){var _0xc73cb8=function(_0x3cd329){while(--_0x3cd329){_0x481457['push'](_0x481457['shift']());}};_0xc73cb8(++_0x1c3300);}(_0x2504,0xee));var _0x4250=function(_0x47649a,_0x36744a){_0x47649a=_0x47649a-0x0;var _0x1ddb5a=_0x2504[_0x47649a];return _0x1ddb5a;};'use strict';var _=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var logger=require(_0x4250('0x2'))(_0x4250('0x3'));var moment=require(_0x4250('0x4'));var BPromise=require(_0x4250('0x5'));var rp=require(_0x4250('0x6'));var fs=require('fs');var path=require(_0x4250('0x7'));var rimraf=require(_0x4250('0x8'));var config=require(_0x4250('0x9'));var attributes=require(_0x4250('0xa'));var integrations=require(_0x4250('0xb'));module['exports']=function(_0x473cb8,_0x4e177e){return _0x473cb8['define'](_0x4250('0xc'),attributes,{'tableName':_0x4250('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37b2=['int_salesforce_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount'];(function(_0x3011b7,_0x56b4b0){var _0x304ca2=function(_0x5832be){while(--_0x5832be){_0x3011b7['push'](_0x3011b7['shift']());}};_0x304ca2(++_0x56b4b0);}(_0x37b2,0x199));var _0x237b=function(_0x5bb3a0,_0x3fd23a){_0x5bb3a0=_0x5bb3a0-0x0;var _0x1469dd=_0x37b2[_0x5bb3a0];return _0x1469dd;};'use strict';var _=require(_0x237b('0x0'));var util=require(_0x237b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x237b('0x2'));var rp=require(_0x237b('0x3'));var fs=require('fs');var path=require(_0x237b('0x4'));var rimraf=require(_0x237b('0x5'));var config=require(_0x237b('0x6'));var attributes=require(_0x237b('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x237b('0x8')]=function(_0x1702cd,_0x3e1ee6){return _0x1702cd[_0x237b('0x9')](_0x237b('0xa'),attributes,{'tableName':_0x237b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index cd1d8fa..62590d9 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 _0x2743=['include','map','model','attributes','catch','ShowSalesforceAccount','SalesforceAccount','find','where','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','GetSalesforceAccount','findAll','options','limit'];(function(_0x42e103,_0x6498f3){var _0x2a6eba=function(_0x1683ed){while(--_0x1683ed){_0x42e103['push'](_0x42e103['shift']());}};_0x2a6eba(++_0x6498f3);}(_0x2743,0x13b));var _0x3274=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2743[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3274('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3274('0x1'));var rs=require(_0x3274('0x2'));var fs=require('fs');var Redis=require(_0x3274('0x3'));var db=require(_0x3274('0x4'))['db'];var utils=require(_0x3274('0x5'));var logger=require('../../config/logger')(_0x3274('0x6'));var config=require(_0x3274('0x7'));var jayson=require(_0x3274('0x8'));var client=jayson[_0x3274('0x9')][_0x3274('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40557c,_0x4221fd,_0x3236cc){return new BPromise(function(_0x5cf004,_0x2afedd){return client['request'](_0x40557c,_0x3236cc)[_0x3274('0xb')](function(_0x6dc464){logger[_0x3274('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x4221fd,_0x3274('0xd'));logger[_0x3274('0xe')](_0x3274('0xf'),_0x4221fd,_0x3274('0xd'),JSON[_0x3274('0x10')](_0x6dc464));if(_0x6dc464[_0x3274('0x11')]){if(_0x6dc464[_0x3274('0x11')][_0x3274('0x12')]===0x1f4){logger[_0x3274('0x11')](_0x3274('0x13'),_0x4221fd,_0x6dc464[_0x3274('0x11')]['message']);return _0x2afedd(_0x6dc464[_0x3274('0x11')][_0x3274('0x14')]);}logger[_0x3274('0x11')](_0x3274('0x13'),_0x4221fd,_0x6dc464[_0x3274('0x11')]['message']);return _0x5cf004(_0x6dc464['error'][_0x3274('0x14')]);}else{logger[_0x3274('0xc')](_0x3274('0x13'),_0x4221fd,_0x3274('0xd'));_0x5cf004(_0x6dc464['result'][_0x3274('0x14')]);}})['catch'](function(_0x1a1f95){logger[_0x3274('0x11')](_0x3274('0x13'),_0x4221fd,_0x1a1f95);_0x2afedd(_0x1a1f95);});});}exports[_0x3274('0x15')]=function(_0x579b36){var _0x3a2571=this;return new Promise(function(_0x52a5b8,_0x94314a){return db['SalesforceAccount'][_0x3274('0x16')]({'raw':_0x579b36['options']?_0x579b36[_0x3274('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x579b36[_0x3274('0x17')]?_0x579b36[_0x3274('0x17')]['where']||null:null,'attributes':_0x579b36[_0x3274('0x17')]?_0x579b36[_0x3274('0x17')]['attributes']||null:null,'limit':_0x579b36[_0x3274('0x17')]?_0x579b36[_0x3274('0x17')][_0x3274('0x18')]||null:null,'include':_0x579b36['options']?_0x579b36['options'][_0x3274('0x19')]?_[_0x3274('0x1a')](_0x579b36[_0x3274('0x17')][_0x3274('0x19')],function(_0x5bd69f){return{'model':db[_0x5bd69f[_0x3274('0x1b')]],'as':_0x5bd69f['as'],'attributes':_0x5bd69f[_0x3274('0x1c')],'include':_0x5bd69f[_0x3274('0x19')]?_[_0x3274('0x1a')](_0x5bd69f[_0x3274('0x19')],function(_0x4e5399){return{'model':db[_0x4e5399[_0x3274('0x1b')]],'as':_0x4e5399['as'],'attributes':_0x4e5399[_0x3274('0x1c')],'include':_0x4e5399[_0x3274('0x19')]?_[_0x3274('0x1a')](_0x4e5399[_0x3274('0x19')],function(_0x3dd53a){return{'model':db[_0x3dd53a['model']],'as':_0x3dd53a['as'],'attributes':_0x3dd53a[_0x3274('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1722af){logger[_0x3274('0xc')]('GetSalesforceAccount',_0x579b36);logger[_0x3274('0xe')](_0x3274('0x15'),_0x579b36,JSON[_0x3274('0x10')](_0x1722af));_0x52a5b8(_0x1722af);})[_0x3274('0x1d')](function(_0x44c305){logger[_0x3274('0x11')]('GetSalesforceAccount',_0x44c305[_0x3274('0x14')],_0x579b36);_0x94314a(_0x3a2571[_0x3274('0x11')](0x1f4,_0x44c305[_0x3274('0x14')]));});});};exports[_0x3274('0x1e')]=function(_0x184f6d){var _0x4b1e4b=this;return new Promise(function(_0x266a28,_0x2890d2){return db[_0x3274('0x1f')][_0x3274('0x20')]({'raw':_0x184f6d[_0x3274('0x17')]?_0x184f6d[_0x3274('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x184f6d[_0x3274('0x17')]?_0x184f6d[_0x3274('0x17')][_0x3274('0x21')]||null:null,'attributes':_0x184f6d[_0x3274('0x17')]?_0x184f6d[_0x3274('0x17')][_0x3274('0x1c')]||null:null,'include':_0x184f6d['options']?_0x184f6d[_0x3274('0x17')][_0x3274('0x19')]?_[_0x3274('0x1a')](_0x184f6d[_0x3274('0x17')]['include'],function(_0x5c1e90){return{'model':db[_0x5c1e90[_0x3274('0x1b')]],'as':_0x5c1e90['as'],'attributes':_0x5c1e90[_0x3274('0x1c')],'include':_0x5c1e90[_0x3274('0x19')]?_['map'](_0x5c1e90[_0x3274('0x19')],function(_0x510ffd){return{'model':db[_0x510ffd[_0x3274('0x1b')]],'as':_0x510ffd['as'],'attributes':_0x510ffd[_0x3274('0x1c')],'include':_0x510ffd['include']?_[_0x3274('0x1a')](_0x510ffd[_0x3274('0x19')],function(_0x2354e9){return{'model':db[_0x2354e9[_0x3274('0x1b')]],'as':_0x2354e9['as'],'attributes':_0x2354e9['attributes']};}):[]};}):[]};}):[]:[]})[_0x3274('0xb')](function(_0x400381){logger['info'](_0x3274('0x1e'),_0x184f6d);logger[_0x3274('0xe')](_0x3274('0x1e'),_0x184f6d,JSON[_0x3274('0x10')](_0x400381));_0x266a28(_0x400381);})[_0x3274('0x1d')](function(_0x5ca2fa){logger[_0x3274('0x11')](_0x3274('0x1e'),_0x5ca2fa['message'],_0x184f6d);_0x2890d2(_0x4b1e4b['error'](0x1f4,_0x5ca2fa['message']));});});}; \ No newline at end of file +var _0x8239=['../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','map','include','model','attributes','ShowSalesforceAccount','find','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2a26ad,_0x44d8eb){var _0xf9f25d=function(_0x2df971){while(--_0x2df971){_0x2a26ad['push'](_0x2a26ad['shift']());}};_0xf9f25d(++_0x44d8eb);}(_0x8239,0x1e2));var _0x9823=function(_0x43fd7f,_0x5b301d){_0x43fd7f=_0x43fd7f-0x0;var _0x4dd2c5=_0x8239[_0x43fd7f];return _0x4dd2c5;};'use strict';var _=require('lodash');var util=require(_0x9823('0x0'));var moment=require(_0x9823('0x1'));var BPromise=require(_0x9823('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9823('0x3'));var db=require(_0x9823('0x4'))['db'];var utils=require(_0x9823('0x5'));var logger=require(_0x9823('0x6'))(_0x9823('0x7'));var config=require(_0x9823('0x8'));var jayson=require(_0x9823('0x9'));var client=jayson[_0x9823('0xa')][_0x9823('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cd0e6,_0x570e3f,_0x589db9){return new BPromise(function(_0x3dadbd,_0x25445f){return client[_0x9823('0xc')](_0x3cd0e6,_0x589db9)[_0x9823('0xd')](function(_0x8fc375){logger[_0x9823('0xe')](_0x9823('0xf'),_0x570e3f,'request\x20sent');logger[_0x9823('0x10')](_0x9823('0x11'),_0x570e3f,'request\x20sent',JSON[_0x9823('0x12')](_0x8fc375));if(_0x8fc375[_0x9823('0x13')]){if(_0x8fc375[_0x9823('0x13')][_0x9823('0x14')]===0x1f4){logger[_0x9823('0x13')](_0x9823('0xf'),_0x570e3f,_0x8fc375['error'][_0x9823('0x15')]);return _0x25445f(_0x8fc375[_0x9823('0x13')][_0x9823('0x15')]);}logger[_0x9823('0x13')](_0x9823('0xf'),_0x570e3f,_0x8fc375[_0x9823('0x13')]['message']);return _0x3dadbd(_0x8fc375[_0x9823('0x13')][_0x9823('0x15')]);}else{logger[_0x9823('0xe')](_0x9823('0xf'),_0x570e3f,_0x9823('0x16'));_0x3dadbd(_0x8fc375['result'][_0x9823('0x15')]);}})[_0x9823('0x17')](function(_0x38c835){logger['error'](_0x9823('0xf'),_0x570e3f,_0x38c835);_0x25445f(_0x38c835);});});}exports[_0x9823('0x18')]=function(_0x347426){var _0x36defc=this;return new Promise(function(_0x23c73e,_0x328d03){return db[_0x9823('0x19')][_0x9823('0x1a')]({'raw':_0x347426[_0x9823('0x1b')]?_0x347426[_0x9823('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x347426[_0x9823('0x1b')]?_0x347426[_0x9823('0x1b')]['where']||null:null,'attributes':_0x347426[_0x9823('0x1b')]?_0x347426[_0x9823('0x1b')]['attributes']||null:null,'limit':_0x347426[_0x9823('0x1b')]?_0x347426[_0x9823('0x1b')]['limit']||null:null,'include':_0x347426['options']?_0x347426[_0x9823('0x1b')]['include']?_[_0x9823('0x1c')](_0x347426[_0x9823('0x1b')][_0x9823('0x1d')],function(_0x493880){return{'model':db[_0x493880[_0x9823('0x1e')]],'as':_0x493880['as'],'attributes':_0x493880['attributes'],'include':_0x493880[_0x9823('0x1d')]?_[_0x9823('0x1c')](_0x493880[_0x9823('0x1d')],function(_0x1fa0b2){return{'model':db[_0x1fa0b2[_0x9823('0x1e')]],'as':_0x1fa0b2['as'],'attributes':_0x1fa0b2[_0x9823('0x1f')],'include':_0x1fa0b2['include']?_[_0x9823('0x1c')](_0x1fa0b2[_0x9823('0x1d')],function(_0x529694){return{'model':db[_0x529694[_0x9823('0x1e')]],'as':_0x529694['as'],'attributes':_0x529694['attributes']};}):[]};}):[]};}):[]:[]})[_0x9823('0xd')](function(_0xa2e84c){logger[_0x9823('0xe')](_0x9823('0x18'),_0x347426);logger['debug'](_0x9823('0x18'),_0x347426,JSON['stringify'](_0xa2e84c));_0x23c73e(_0xa2e84c);})['catch'](function(_0x34469b){logger[_0x9823('0x13')](_0x9823('0x18'),_0x34469b[_0x9823('0x15')],_0x347426);_0x328d03(_0x36defc['error'](0x1f4,_0x34469b[_0x9823('0x15')]));});});};exports[_0x9823('0x20')]=function(_0x4499f7){var _0x4c0634=this;return new Promise(function(_0x444144,_0x18db33){return db[_0x9823('0x19')][_0x9823('0x21')]({'raw':_0x4499f7['options']?_0x4499f7[_0x9823('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4499f7['options']?_0x4499f7[_0x9823('0x1b')][_0x9823('0x22')]||null:null,'attributes':_0x4499f7[_0x9823('0x1b')]?_0x4499f7[_0x9823('0x1b')][_0x9823('0x1f')]||null:null,'include':_0x4499f7[_0x9823('0x1b')]?_0x4499f7[_0x9823('0x1b')]['include']?_[_0x9823('0x1c')](_0x4499f7['options'][_0x9823('0x1d')],function(_0x4ecd43){return{'model':db[_0x4ecd43['model']],'as':_0x4ecd43['as'],'attributes':_0x4ecd43['attributes'],'include':_0x4ecd43['include']?_['map'](_0x4ecd43['include'],function(_0x3cdcf5){return{'model':db[_0x3cdcf5['model']],'as':_0x3cdcf5['as'],'attributes':_0x3cdcf5[_0x9823('0x1f')],'include':_0x3cdcf5[_0x9823('0x1d')]?_[_0x9823('0x1c')](_0x3cdcf5['include'],function(_0x413cde){return{'model':db[_0x413cde[_0x9823('0x1e')]],'as':_0x413cde['as'],'attributes':_0x413cde[_0x9823('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9823('0xd')](function(_0x1d788f){logger[_0x9823('0xe')](_0x9823('0x20'),_0x4499f7);logger[_0x9823('0x10')](_0x9823('0x20'),_0x4499f7,JSON[_0x9823('0x12')](_0x1d788f));_0x444144(_0x1d788f);})['catch'](function(_0x1b5c1b){logger[_0x9823('0x13')](_0x9823('0x20'),_0x1b5c1b['message'],_0x4499f7);_0x18db33(_0x4c0634[_0x9823('0x13')](0x1f4,_0x1b5c1b[_0x9823('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index f648d26..37c86ae 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x524a0f,_0x1f812d){var _0x1da965=function(_0x362356){while(--_0x362356){_0x524a0f['push'](_0x524a0f['shift']());}};_0x1da965(++_0x1f812d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x156e34,_0x4baee0){var _0x3c67cc=function(_0x1fd373){while(--_0x1fd373){_0x156e34['push'](_0x156e34['shift']());}};_0x3c67cc(++_0x4baee0);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 8f3096e..3870b9b 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 _0x57c0=['lead','account_contact_lead','account','nothing','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x57c0,0xa0));var _0x057c=function(_0x2c4570,_0x21871d){_0x2c4570=_0x2c4570-0x0;var _0x26f4b0=_0x57c0[_0x2c4570];return _0x26f4b0;};'use strict';var Sequelize=require(_0x057c('0x0'));module[_0x057c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x057c('0x2')]},'ticketType':{'type':Sequelize[_0x057c('0x3')](_0x057c('0x4'),_0x057c('0x5')),'defaultValue':_0x057c('0x4')},'moduleSearch':{'type':Sequelize[_0x057c('0x3')](_0x057c('0x6'),_0x057c('0x7'),_0x057c('0x8'),_0x057c('0x9'),_0x057c('0xa')),'defaultValue':_0x057c('0x6')},'moduleCreate':{'type':Sequelize[_0x057c('0x3')](_0x057c('0xb'),_0x057c('0x7'),_0x057c('0x8'),_0x057c('0xa')),'defaultValue':_0x057c('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x057c('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x057c('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe885=['sequelize','exports','STRING','ENUM','Task','Case','contact','lead','account_contact_lead','account'];(function(_0x4958c3,_0x251612){var _0x2f9f6c=function(_0x3612a9){while(--_0x3612a9){_0x4958c3['push'](_0x4958c3['shift']());}};_0x2f9f6c(++_0x251612);}(_0xe885,0x104));var _0x5e88=function(_0x551776,_0x48c7dd){_0x551776=_0x551776-0x0;var _0x379704=_0xe885[_0x551776];return _0x379704;};'use strict';var Sequelize=require(_0x5e88('0x0'));module[_0x5e88('0x1')]={'name':{'type':Sequelize[_0x5e88('0x2')]},'description':{'type':Sequelize[_0x5e88('0x2')]},'ticketType':{'type':Sequelize[_0x5e88('0x3')](_0x5e88('0x4'),_0x5e88('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x5e88('0x3')]('contact_lead',_0x5e88('0x6'),_0x5e88('0x7'),_0x5e88('0x8'),_0x5e88('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x5e88('0x3')]('nothing',_0x5e88('0x6'),_0x5e88('0x7'),'account'),'defaultValue':_0x5e88('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x5e88('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x5e88('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x5e88('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 98fd799..aaf2323 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 _0x1f17=['query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','findOne','order','nolimit','getFields','getSubjects','getDescriptions','SalesforceField','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','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','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','SalesforceConfiguration','fieldName','type','model','map'];(function(_0x1cd8d0,_0x9fd33c){var _0xd91b2=function(_0x229fce){while(--_0x229fce){_0x1cd8d0['push'](_0x1cd8d0['shift']());}};_0xd91b2(++_0x9fd33c);}(_0x1f17,0x71));var _0x71f1=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0x1f17[_0x3cc9d9];return _0x1a425d;};'use strict';var emlformat=require(_0x71f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x71f1('0x1'));var jsonpatch=require(_0x71f1('0x2'));var rp=require(_0x71f1('0x3'));var moment=require('moment');var BPromise=require(_0x71f1('0x4'));var Mustache=require(_0x71f1('0x5'));var util=require('util');var path=require(_0x71f1('0x6'));var sox=require('sox');var csv=require(_0x71f1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x71f1('0x8'));var squel=require('squel');var crypto=require(_0x71f1('0x9'));var jsforce=require(_0x71f1('0xa'));var deskjs=require(_0x71f1('0xb'));var toCsv=require(_0x71f1('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x71f1('0xc'));var authService=require(_0x71f1('0xd'));var qs=require(_0x71f1('0xe'));var as=require(_0x71f1('0xf'));var hardwareService=require(_0x71f1('0x10'));var logger=require('../../config/logger')(_0x71f1('0x11'));var utils=require(_0x71f1('0x12'));var config=require(_0x71f1('0x13'));var licenseUtil=require(_0x71f1('0x14'));var db=require(_0x71f1('0x15'))['db'];function respondWithStatusCode(_0x36d424,_0x33b1a1){_0x33b1a1=_0x33b1a1||0xcc;return function(_0x2f0e1e){if(_0x2f0e1e){return _0x36d424['sendStatus'](_0x33b1a1);}return _0x36d424[_0x71f1('0x16')](_0x33b1a1)[_0x71f1('0x17')]();};}function respondWithResult(_0x57fad5,_0x1e60f0){_0x1e60f0=_0x1e60f0||0xc8;return function(_0x399d21){if(_0x399d21){return _0x57fad5[_0x71f1('0x16')](_0x1e60f0)[_0x71f1('0x18')](_0x399d21);}};}function respondWithFilteredResult(_0x4ae480,_0x4ba8c8){return function(_0x37c695){if(_0x37c695){var _0x1abae3=typeof _0x4ba8c8[_0x71f1('0x19')]===_0x71f1('0x1a')&&typeof _0x4ba8c8[_0x71f1('0x1b')]==='undefined';var _0x4ac912=_0x37c695[_0x71f1('0x1c')];var _0x5e49fc=_0x1abae3?0x0:_0x4ba8c8[_0x71f1('0x19')];var _0x44ee79=_0x1abae3?_0x37c695[_0x71f1('0x1c')]:_0x4ba8c8[_0x71f1('0x19')]+_0x4ba8c8[_0x71f1('0x1b')];var _0x536e76;if(_0x44ee79>=_0x4ac912){_0x44ee79=_0x4ac912;_0x536e76=0xc8;}else{_0x536e76=0xce;}_0x4ae480[_0x71f1('0x16')](_0x536e76);return _0x4ae480[_0x71f1('0x1d')](_0x71f1('0x1e'),_0x5e49fc+'-'+_0x44ee79+'/'+_0x4ac912)[_0x71f1('0x18')](_0x37c695);}return null;};}function patchUpdates(_0x1a2410){return function(_0xde337e){try{jsonpatch[_0x71f1('0x1f')](_0xde337e,_0x1a2410,!![]);}catch(_0x1be421){return BPromise[_0x71f1('0x20')](_0x1be421);}return _0xde337e[_0x71f1('0x21')]();};}function saveUpdates(_0x44b338,_0x392101){return function(_0x1aca33){if(_0x1aca33){return _0x1aca33[_0x71f1('0x22')](_0x44b338)[_0x71f1('0x23')](function(_0x300563){return _0x300563;});}return null;};}function removeEntity(_0x387546,_0x5116c4){return function(_0x469147){if(_0x469147){return _0x469147[_0x71f1('0x24')]()[_0x71f1('0x23')](function(){_0x387546[_0x71f1('0x16')](0xcc)[_0x71f1('0x17')]();});}};}function handleEntityNotFound(_0x419b8a,_0x46d977){return function(_0x1e79da){if(!_0x1e79da){_0x419b8a[_0x71f1('0x25')](0x194);}return _0x1e79da;};}function handleError(_0x222ce9,_0x46aba2){_0x46aba2=_0x46aba2||0x1f4;return function(_0xc493ba){logger[_0x71f1('0x26')](_0xc493ba[_0x71f1('0x27')]);if(_0xc493ba[_0x71f1('0x28')]){delete _0xc493ba[_0x71f1('0x28')];}_0x222ce9[_0x71f1('0x16')](_0x46aba2)['send'](_0xc493ba);};}exports[_0x71f1('0x29')]=function(_0x2b5716,_0x1aea12){var _0x338b51={},_0x4287bd={},_0x109ac4={'count':0x0,'rows':[]};var _0x5ce2bc=_['map'](db[_0x71f1('0x2a')]['rawAttributes'],function(_0x54a50b){return{'name':_0x54a50b[_0x71f1('0x2b')],'type':_0x54a50b[_0x71f1('0x2c')]['key']};});_0x4287bd[_0x71f1('0x2d')]=_[_0x71f1('0x2e')](_0x5ce2bc,_0x71f1('0x28'));_0x4287bd[_0x71f1('0x2f')]=_[_0x71f1('0x30')](_0x2b5716[_0x71f1('0x2f')]);_0x4287bd[_0x71f1('0x31')]=_[_0x71f1('0x32')](_0x4287bd[_0x71f1('0x2d')],_0x4287bd['query']);_0x338b51['attributes']=_[_0x71f1('0x32')](_0x4287bd[_0x71f1('0x2d')],qs[_0x71f1('0x33')](_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x33')]));_0x338b51['attributes']=_0x338b51['attributes'][_0x71f1('0x34')]?_0x338b51[_0x71f1('0x35')]:_0x4287bd[_0x71f1('0x2d')];if(!_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x36')]('nolimit')){_0x338b51[_0x71f1('0x1b')]=qs['limit'](_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x1b')]);_0x338b51['offset']=qs['offset'](_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x19')]);}_0x338b51['order']=qs[_0x71f1('0x37')](_0x2b5716[_0x71f1('0x2f')]['sort']);_0x338b51['where']=qs[_0x71f1('0x31')](_[_0x71f1('0x38')](_0x2b5716['query'],_0x4287bd[_0x71f1('0x31')]),_0x5ce2bc);if(_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x39')]){_0x338b51['where']=_[_0x71f1('0x3a')](_0x338b51[_0x71f1('0x3b')],{'$or':_['map'](_0x5ce2bc,function(_0x20f9e1){if(_0x20f9e1[_0x71f1('0x2c')]!==_0x71f1('0x3c')){var _0x36d3e3={};_0x36d3e3[_0x20f9e1['name']]={'$like':'%'+_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x39')]+'%'};return _0x36d3e3;}})});}_0x338b51=_[_0x71f1('0x3a')]({},_0x338b51,_0x2b5716[_0x71f1('0x3d')]);var _0xd78829={'where':_0x338b51['where']};return db[_0x71f1('0x2a')][_0x71f1('0x1c')](_0xd78829)['then'](function(_0x27bb40){_0x109ac4['count']=_0x27bb40;if(_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x3e')]){_0x338b51[_0x71f1('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x71f1('0x40')](_0x338b51);})[_0x71f1('0x23')](function(_0x1b9a75){_0x109ac4[_0x71f1('0x41')]=_0x1b9a75;return _0x109ac4;})[_0x71f1('0x23')](respondWithFilteredResult(_0x1aea12,_0x338b51))[_0x71f1('0x42')](handleError(_0x1aea12,null));};exports[_0x71f1('0x43')]=function(_0x425013,_0x1856d7){var _0x5c1c48={'raw':![],'where':{'id':_0x425013[_0x71f1('0x44')]['id']}},_0x4d591a={};_0x4d591a[_0x71f1('0x2d')]=_['keys'](db['SalesforceConfiguration'][_0x71f1('0x45')]);_0x4d591a['query']=_[_0x71f1('0x30')](_0x425013[_0x71f1('0x2f')]);_0x4d591a[_0x71f1('0x31')]=_[_0x71f1('0x32')](_0x4d591a['model'],_0x4d591a[_0x71f1('0x2f')]);_0x5c1c48[_0x71f1('0x35')]=_['intersection'](_0x4d591a[_0x71f1('0x2d')],qs['fields'](_0x425013[_0x71f1('0x2f')][_0x71f1('0x33')]));_0x5c1c48[_0x71f1('0x35')]=_0x5c1c48[_0x71f1('0x35')][_0x71f1('0x34')]?_0x5c1c48[_0x71f1('0x35')]:_0x4d591a[_0x71f1('0x2d')];if(_0x425013['query']['includeAll']){_0x5c1c48[_0x71f1('0x3f')]=[{'all':!![]}];}_0x5c1c48=_[_0x71f1('0x3a')]({},_0x5c1c48,_0x425013['options']);return db['SalesforceConfiguration'][_0x71f1('0x46')](_0x5c1c48)[_0x71f1('0x23')](handleEntityNotFound(_0x1856d7,null))[_0x71f1('0x23')](respondWithResult(_0x1856d7,null))[_0x71f1('0x42')](handleError(_0x1856d7,null));};exports[_0x71f1('0x47')]=function(_0x1237ea,_0x1416a8){return db['SalesforceConfiguration'][_0x71f1('0x47')](_0x1237ea[_0x71f1('0x48')],{})[_0x71f1('0x23')](respondWithResult(_0x1416a8,0xc9))[_0x71f1('0x42')](handleError(_0x1416a8,null));};exports[_0x71f1('0x22')]=function(_0x2739bf,_0x5ba03a){if(_0x2739bf[_0x71f1('0x48')]['id']){delete _0x2739bf[_0x71f1('0x48')]['id'];}return db[_0x71f1('0x2a')][_0x71f1('0x46')]({'where':{'id':_0x2739bf[_0x71f1('0x44')]['id']}})[_0x71f1('0x23')](handleEntityNotFound(_0x5ba03a,null))[_0x71f1('0x23')](saveUpdates(_0x2739bf[_0x71f1('0x48')],null))['then'](respondWithResult(_0x5ba03a,null))['catch'](handleError(_0x5ba03a,null));};exports[_0x71f1('0x24')]=function(_0x5b4e8,_0x24b64b){return db['SalesforceConfiguration'][_0x71f1('0x46')]({'where':{'id':_0x5b4e8[_0x71f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x24b64b,null))[_0x71f1('0x23')](removeEntity(_0x24b64b,null))[_0x71f1('0x42')](handleError(_0x24b64b,null));};exports['getFields']=function(_0x4e1cb6,_0x2154fa,_0x1c0d83){var _0x424a14={};var _0x3e6957={};var _0x15177b;var _0x21f9da;return db[_0x71f1('0x2a')][_0x71f1('0x49')]({'where':{'id':_0x4e1cb6[_0x71f1('0x44')]['id']}})[_0x71f1('0x23')](handleEntityNotFound(_0x2154fa,null))[_0x71f1('0x23')](function(_0x20cd9d){if(_0x20cd9d){_0x15177b=_0x20cd9d;_0x3e6957['model']=_['keys'](db['SalesforceField'][_0x71f1('0x45')]);_0x3e6957[_0x71f1('0x2f')]=_[_0x71f1('0x30')](_0x4e1cb6[_0x71f1('0x2f')]);_0x3e6957['filters']=_['intersection'](_0x3e6957['model'],_0x3e6957[_0x71f1('0x2f')]);_0x424a14[_0x71f1('0x35')]=_[_0x71f1('0x32')](_0x3e6957[_0x71f1('0x2d')],qs[_0x71f1('0x33')](_0x4e1cb6[_0x71f1('0x2f')][_0x71f1('0x33')]));_0x424a14['attributes']=_0x424a14[_0x71f1('0x35')][_0x71f1('0x34')]?_0x424a14[_0x71f1('0x35')]:_0x3e6957[_0x71f1('0x2d')];_0x424a14[_0x71f1('0x4a')]=qs['sort'](_0x4e1cb6[_0x71f1('0x2f')][_0x71f1('0x37')]);_0x424a14[_0x71f1('0x3b')]=qs['filters'](_['pick'](_0x4e1cb6[_0x71f1('0x2f')],_0x3e6957[_0x71f1('0x31')]));if(_0x4e1cb6['query'][_0x71f1('0x39')]){_0x424a14[_0x71f1('0x3b')]=_['merge'](_0x424a14[_0x71f1('0x3b')],{'$or':_[_0x71f1('0x2e')](_0x424a14['attributes'],function(_0x25932d){var _0x2f4150={};_0x2f4150[_0x25932d]={'$like':'%'+_0x4e1cb6['query'][_0x71f1('0x39')]+'%'};return _0x2f4150;})});}_0x424a14=_[_0x71f1('0x3a')]({},_0x424a14,_0x4e1cb6[_0x71f1('0x3d')]);return _0x15177b['getFields'](_0x424a14);}})['then'](function(_0x5c72bf){if(_0x5c72bf){_0x21f9da=_0x5c72bf[_0x71f1('0x34')];if(!_0x4e1cb6[_0x71f1('0x2f')][_0x71f1('0x36')](_0x71f1('0x4b'))){_0x424a14[_0x71f1('0x1b')]=qs[_0x71f1('0x1b')](_0x4e1cb6['query'][_0x71f1('0x1b')]);_0x424a14['offset']=qs['offset'](_0x4e1cb6[_0x71f1('0x2f')][_0x71f1('0x19')]);}return _0x15177b[_0x71f1('0x4c')](_0x424a14);}})[_0x71f1('0x23')](function(_0x5abd12){if(_0x5abd12){return _0x5abd12?{'count':_0x21f9da,'rows':_0x5abd12}:null;}})[_0x71f1('0x23')](respondWithResult(_0x2154fa,null))[_0x71f1('0x42')](handleError(_0x2154fa,null));};exports['getSubjects']=function(_0x270366,_0x534b2a,_0x2ef98b){var _0xc2bf6c={};var _0x5c955e={};var _0x45d161;var _0x1545ae;return db[_0x71f1('0x2a')]['findOne']({'where':{'id':_0x270366[_0x71f1('0x44')]['id']}})[_0x71f1('0x23')](handleEntityNotFound(_0x534b2a,null))[_0x71f1('0x23')](function(_0x3f778b){if(_0x3f778b){_0x45d161=_0x3f778b;_0x5c955e[_0x71f1('0x2d')]=_[_0x71f1('0x30')](db['SalesforceField']['rawAttributes']);_0x5c955e[_0x71f1('0x2f')]=_[_0x71f1('0x30')](_0x270366['query']);_0x5c955e[_0x71f1('0x31')]=_[_0x71f1('0x32')](_0x5c955e[_0x71f1('0x2d')],_0x5c955e['query']);_0xc2bf6c[_0x71f1('0x35')]=_['intersection'](_0x5c955e['model'],qs[_0x71f1('0x33')](_0x270366[_0x71f1('0x2f')][_0x71f1('0x33')]));_0xc2bf6c[_0x71f1('0x35')]=_0xc2bf6c[_0x71f1('0x35')][_0x71f1('0x34')]?_0xc2bf6c[_0x71f1('0x35')]:_0x5c955e[_0x71f1('0x2d')];_0xc2bf6c[_0x71f1('0x4a')]=qs[_0x71f1('0x37')](_0x270366[_0x71f1('0x2f')][_0x71f1('0x37')]);_0xc2bf6c[_0x71f1('0x3b')]=qs['filters'](_['pick'](_0x270366[_0x71f1('0x2f')],_0x5c955e[_0x71f1('0x31')]));if(_0x270366[_0x71f1('0x2f')][_0x71f1('0x39')]){_0xc2bf6c['where']=_[_0x71f1('0x3a')](_0xc2bf6c[_0x71f1('0x3b')],{'$or':_[_0x71f1('0x2e')](_0xc2bf6c[_0x71f1('0x35')],function(_0x128f7e){var _0x3b2e61={};_0x3b2e61[_0x128f7e]={'$like':'%'+_0x270366[_0x71f1('0x2f')][_0x71f1('0x39')]+'%'};return _0x3b2e61;})});}_0xc2bf6c=_[_0x71f1('0x3a')]({},_0xc2bf6c,_0x270366[_0x71f1('0x3d')]);return _0x45d161[_0x71f1('0x4d')](_0xc2bf6c);}})['then'](function(_0x1857cf){if(_0x1857cf){_0x1545ae=_0x1857cf[_0x71f1('0x34')];if(!_0x270366['query'][_0x71f1('0x36')](_0x71f1('0x4b'))){_0xc2bf6c[_0x71f1('0x1b')]=qs[_0x71f1('0x1b')](_0x270366[_0x71f1('0x2f')][_0x71f1('0x1b')]);_0xc2bf6c['offset']=qs['offset'](_0x270366[_0x71f1('0x2f')][_0x71f1('0x19')]);}return _0x45d161['getSubjects'](_0xc2bf6c);}})[_0x71f1('0x23')](function(_0x2790cb){if(_0x2790cb){return _0x2790cb?{'count':_0x1545ae,'rows':_0x2790cb}:null;}})[_0x71f1('0x23')](respondWithResult(_0x534b2a,null))[_0x71f1('0x42')](handleError(_0x534b2a,null));};exports[_0x71f1('0x4e')]=function(_0x1478c6,_0x9ce385,_0x466130){var _0x4788ed={};var _0x54bff4={};var _0x5efbfb;var _0x537adb;return db[_0x71f1('0x2a')]['findOne']({'where':{'id':_0x1478c6[_0x71f1('0x44')]['id']}})[_0x71f1('0x23')](handleEntityNotFound(_0x9ce385,null))[_0x71f1('0x23')](function(_0x397337){if(_0x397337){_0x5efbfb=_0x397337;_0x54bff4['model']=_[_0x71f1('0x30')](db[_0x71f1('0x4f')][_0x71f1('0x45')]);_0x54bff4['query']=_[_0x71f1('0x30')](_0x1478c6[_0x71f1('0x2f')]);_0x54bff4[_0x71f1('0x31')]=_[_0x71f1('0x32')](_0x54bff4[_0x71f1('0x2d')],_0x54bff4['query']);_0x4788ed['attributes']=_[_0x71f1('0x32')](_0x54bff4[_0x71f1('0x2d')],qs['fields'](_0x1478c6[_0x71f1('0x2f')][_0x71f1('0x33')]));_0x4788ed['attributes']=_0x4788ed[_0x71f1('0x35')][_0x71f1('0x34')]?_0x4788ed['attributes']:_0x54bff4[_0x71f1('0x2d')];_0x4788ed[_0x71f1('0x4a')]=qs['sort'](_0x1478c6[_0x71f1('0x2f')][_0x71f1('0x37')]);_0x4788ed[_0x71f1('0x3b')]=qs[_0x71f1('0x31')](_[_0x71f1('0x38')](_0x1478c6[_0x71f1('0x2f')],_0x54bff4[_0x71f1('0x31')]));if(_0x1478c6[_0x71f1('0x2f')][_0x71f1('0x39')]){_0x4788ed[_0x71f1('0x3b')]=_[_0x71f1('0x3a')](_0x4788ed[_0x71f1('0x3b')],{'$or':_['map'](_0x4788ed[_0x71f1('0x35')],function(_0x207bd1){var _0x273897={};_0x273897[_0x207bd1]={'$like':'%'+_0x1478c6['query']['filter']+'%'};return _0x273897;})});}_0x4788ed=_[_0x71f1('0x3a')]({},_0x4788ed,_0x1478c6['options']);return _0x5efbfb[_0x71f1('0x4e')](_0x4788ed);}})['then'](function(_0xe47ca4){if(_0xe47ca4){_0x537adb=_0xe47ca4[_0x71f1('0x34')];if(!_0x1478c6[_0x71f1('0x2f')][_0x71f1('0x36')](_0x71f1('0x4b'))){_0x4788ed[_0x71f1('0x1b')]=qs[_0x71f1('0x1b')](_0x1478c6['query'][_0x71f1('0x1b')]);_0x4788ed[_0x71f1('0x19')]=qs[_0x71f1('0x19')](_0x1478c6['query']['offset']);}return _0x5efbfb['getDescriptions'](_0x4788ed);}})['then'](function(_0x225e1a){if(_0x225e1a){return _0x225e1a?{'count':_0x537adb,'rows':_0x225e1a}:null;}})['then'](respondWithResult(_0x9ce385,null))[_0x71f1('0x42')](handleError(_0x9ce385,null));}; \ No newline at end of file +var _0x5251=['../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','order','filter','nolimit','getSubjects','findOne','SalesforceField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3a8e27,_0x23642a){var _0x3171af=function(_0x4e1e16){while(--_0x4e1e16){_0x3a8e27['push'](_0x3a8e27['shift']());}};_0x3171af(++_0x23642a);}(_0x5251,0x1c9));var _0x1525=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5251[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x1525('0x0'));var rimraf=require(_0x1525('0x1'));var zipdir=require(_0x1525('0x2'));var jsonpatch=require(_0x1525('0x3'));var rp=require(_0x1525('0x4'));var moment=require(_0x1525('0x5'));var BPromise=require(_0x1525('0x6'));var Mustache=require('mustache');var util=require(_0x1525('0x7'));var path=require(_0x1525('0x8'));var sox=require(_0x1525('0x9'));var csv=require('to-csv');var ejs=require(_0x1525('0xa'));var fs=require('fs');var fs_extra=require(_0x1525('0xb'));var _=require('lodash');var squel=require(_0x1525('0xc'));var crypto=require(_0x1525('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1525('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1525('0xf'));var Redis=require(_0x1525('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1525('0x11'));var as=require(_0x1525('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1525('0x13'))(_0x1525('0x14'));var utils=require(_0x1525('0x15'));var config=require(_0x1525('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1525('0x17'))['db'];function respondWithStatusCode(_0x5b887c,_0x3f2bd4){_0x3f2bd4=_0x3f2bd4||0xcc;return function(_0x174933){if(_0x174933){return _0x5b887c[_0x1525('0x18')](_0x3f2bd4);}return _0x5b887c[_0x1525('0x19')](_0x3f2bd4)[_0x1525('0x1a')]();};}function respondWithResult(_0x479f9e,_0x33f190){_0x33f190=_0x33f190||0xc8;return function(_0x1ecadf){if(_0x1ecadf){return _0x479f9e[_0x1525('0x19')](_0x33f190)[_0x1525('0x1b')](_0x1ecadf);}};}function respondWithFilteredResult(_0x509017,_0x538c3e){return function(_0x177b0a){if(_0x177b0a){var _0xf754f2=typeof _0x538c3e['offset']===_0x1525('0x1c')&&typeof _0x538c3e[_0x1525('0x1d')]==='undefined';var _0x598be4=_0x177b0a['count'];var _0x4c285d=_0xf754f2?0x0:_0x538c3e[_0x1525('0x1e')];var _0x5f66fa=_0xf754f2?_0x177b0a[_0x1525('0x1f')]:_0x538c3e[_0x1525('0x1e')]+_0x538c3e[_0x1525('0x1d')];var _0x156abf;if(_0x5f66fa>=_0x598be4){_0x5f66fa=_0x598be4;_0x156abf=0xc8;}else{_0x156abf=0xce;}_0x509017[_0x1525('0x19')](_0x156abf);return _0x509017['set']('Content-Range',_0x4c285d+'-'+_0x5f66fa+'/'+_0x598be4)[_0x1525('0x1b')](_0x177b0a);}return null;};}function patchUpdates(_0x18b1e3){return function(_0xbc8666){try{jsonpatch[_0x1525('0x20')](_0xbc8666,_0x18b1e3,!![]);}catch(_0x4288c6){return BPromise[_0x1525('0x21')](_0x4288c6);}return _0xbc8666[_0x1525('0x22')]();};}function saveUpdates(_0x274f2d,_0x414981){return function(_0x4ebff1){if(_0x4ebff1){return _0x4ebff1[_0x1525('0x23')](_0x274f2d)[_0x1525('0x24')](function(_0x5b2d61){return _0x5b2d61;});}return null;};}function removeEntity(_0x49be15,_0x1a920c){return function(_0x336989){if(_0x336989){return _0x336989[_0x1525('0x25')]()[_0x1525('0x24')](function(){_0x49be15[_0x1525('0x19')](0xcc)[_0x1525('0x1a')]();});}};}function handleEntityNotFound(_0x3494ce,_0x44bf8c){return function(_0xb1e56c){if(!_0xb1e56c){_0x3494ce['sendStatus'](0x194);}return _0xb1e56c;};}function handleError(_0x156e02,_0x5ad27e){_0x5ad27e=_0x5ad27e||0x1f4;return function(_0x2536dd){logger[_0x1525('0x26')](_0x2536dd[_0x1525('0x27')]);if(_0x2536dd[_0x1525('0x28')]){delete _0x2536dd[_0x1525('0x28')];}_0x156e02[_0x1525('0x19')](_0x5ad27e)[_0x1525('0x29')](_0x2536dd);};}exports[_0x1525('0x2a')]=function(_0x5f2c9e,_0x327e60){var _0xd5cb8b={},_0xe6085f={},_0x12c035={'count':0x0,'rows':[]};var _0x450499=_[_0x1525('0x2b')](db[_0x1525('0x2c')][_0x1525('0x2d')],function(_0x20e7c4){return{'name':_0x20e7c4[_0x1525('0x2e')],'type':_0x20e7c4[_0x1525('0x2f')]['key']};});_0xe6085f[_0x1525('0x30')]=_[_0x1525('0x2b')](_0x450499,_0x1525('0x28'));_0xe6085f[_0x1525('0x31')]=_[_0x1525('0x32')](_0x5f2c9e['query']);_0xe6085f['filters']=_['intersection'](_0xe6085f[_0x1525('0x30')],_0xe6085f[_0x1525('0x31')]);_0xd5cb8b[_0x1525('0x33')]=_[_0x1525('0x34')](_0xe6085f['model'],qs[_0x1525('0x35')](_0x5f2c9e['query'][_0x1525('0x35')]));_0xd5cb8b['attributes']=_0xd5cb8b[_0x1525('0x33')][_0x1525('0x36')]?_0xd5cb8b['attributes']:_0xe6085f['model'];if(!_0x5f2c9e[_0x1525('0x31')][_0x1525('0x37')]('nolimit')){_0xd5cb8b['limit']=qs[_0x1525('0x1d')](_0x5f2c9e[_0x1525('0x31')][_0x1525('0x1d')]);_0xd5cb8b[_0x1525('0x1e')]=qs['offset'](_0x5f2c9e[_0x1525('0x31')][_0x1525('0x1e')]);}_0xd5cb8b['order']=qs[_0x1525('0x38')](_0x5f2c9e[_0x1525('0x31')]['sort']);_0xd5cb8b[_0x1525('0x39')]=qs[_0x1525('0x3a')](_[_0x1525('0x3b')](_0x5f2c9e[_0x1525('0x31')],_0xe6085f['filters']),_0x450499);if(_0x5f2c9e[_0x1525('0x31')]['filter']){_0xd5cb8b[_0x1525('0x39')]=_[_0x1525('0x3c')](_0xd5cb8b[_0x1525('0x39')],{'$or':_['map'](_0x450499,function(_0x433063){if(_0x433063[_0x1525('0x2f')]!==_0x1525('0x3d')){var _0x13d51e={};_0x13d51e[_0x433063[_0x1525('0x28')]]={'$like':'%'+_0x5f2c9e['query']['filter']+'%'};return _0x13d51e;}})});}_0xd5cb8b=_['merge']({},_0xd5cb8b,_0x5f2c9e[_0x1525('0x3e')]);var _0x3ed4af={'where':_0xd5cb8b[_0x1525('0x39')]};return db[_0x1525('0x2c')][_0x1525('0x1f')](_0x3ed4af)[_0x1525('0x24')](function(_0x58dbde){_0x12c035[_0x1525('0x1f')]=_0x58dbde;if(_0x5f2c9e[_0x1525('0x31')][_0x1525('0x3f')]){_0xd5cb8b[_0x1525('0x40')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x1525('0x41')](_0xd5cb8b);})[_0x1525('0x24')](function(_0x3d3cb7){_0x12c035[_0x1525('0x42')]=_0x3d3cb7;return _0x12c035;})[_0x1525('0x24')](respondWithFilteredResult(_0x327e60,_0xd5cb8b))[_0x1525('0x43')](handleError(_0x327e60,null));};exports[_0x1525('0x44')]=function(_0x5e5e23,_0x1bd81e){var _0x109d32={'raw':![],'where':{'id':_0x5e5e23[_0x1525('0x45')]['id']}},_0x1f00cb={};_0x1f00cb[_0x1525('0x30')]=_['keys'](db[_0x1525('0x2c')][_0x1525('0x2d')]);_0x1f00cb[_0x1525('0x31')]=_[_0x1525('0x32')](_0x5e5e23[_0x1525('0x31')]);_0x1f00cb[_0x1525('0x3a')]=_[_0x1525('0x34')](_0x1f00cb['model'],_0x1f00cb[_0x1525('0x31')]);_0x109d32[_0x1525('0x33')]=_[_0x1525('0x34')](_0x1f00cb[_0x1525('0x30')],qs[_0x1525('0x35')](_0x5e5e23['query'][_0x1525('0x35')]));_0x109d32['attributes']=_0x109d32[_0x1525('0x33')][_0x1525('0x36')]?_0x109d32[_0x1525('0x33')]:_0x1f00cb[_0x1525('0x30')];if(_0x5e5e23[_0x1525('0x31')][_0x1525('0x3f')]){_0x109d32[_0x1525('0x40')]=[{'all':!![]}];}_0x109d32=_[_0x1525('0x3c')]({},_0x109d32,_0x5e5e23[_0x1525('0x3e')]);return db[_0x1525('0x2c')][_0x1525('0x46')](_0x109d32)[_0x1525('0x24')](handleEntityNotFound(_0x1bd81e,null))[_0x1525('0x24')](respondWithResult(_0x1bd81e,null))[_0x1525('0x43')](handleError(_0x1bd81e,null));};exports['create']=function(_0x505492,_0x2c562f){return db[_0x1525('0x2c')][_0x1525('0x47')](_0x505492[_0x1525('0x48')],{})[_0x1525('0x24')](respondWithResult(_0x2c562f,0xc9))['catch'](handleError(_0x2c562f,null));};exports['update']=function(_0x381c2b,_0x24e701){if(_0x381c2b[_0x1525('0x48')]['id']){delete _0x381c2b[_0x1525('0x48')]['id'];}return db[_0x1525('0x2c')][_0x1525('0x46')]({'where':{'id':_0x381c2b[_0x1525('0x45')]['id']}})['then'](handleEntityNotFound(_0x24e701,null))['then'](saveUpdates(_0x381c2b[_0x1525('0x48')],null))[_0x1525('0x24')](respondWithResult(_0x24e701,null))[_0x1525('0x43')](handleError(_0x24e701,null));};exports[_0x1525('0x25')]=function(_0x2baee4,_0x5972ea){return db[_0x1525('0x2c')][_0x1525('0x46')]({'where':{'id':_0x2baee4['params']['id']}})[_0x1525('0x24')](handleEntityNotFound(_0x5972ea,null))[_0x1525('0x24')](removeEntity(_0x5972ea,null))[_0x1525('0x43')](handleError(_0x5972ea,null));};exports[_0x1525('0x49')]=function(_0xd4303f,_0x1345c3,_0x163881){var _0x2e690a={};var _0x593672={};var _0x3b86e7;var _0x4a6ae2;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0xd4303f[_0x1525('0x45')]['id']}})[_0x1525('0x24')](handleEntityNotFound(_0x1345c3,null))[_0x1525('0x24')](function(_0x3cf57d){if(_0x3cf57d){_0x3b86e7=_0x3cf57d;_0x593672[_0x1525('0x30')]=_[_0x1525('0x32')](db['SalesforceField']['rawAttributes']);_0x593672[_0x1525('0x31')]=_[_0x1525('0x32')](_0xd4303f['query']);_0x593672[_0x1525('0x3a')]=_['intersection'](_0x593672['model'],_0x593672[_0x1525('0x31')]);_0x2e690a[_0x1525('0x33')]=_[_0x1525('0x34')](_0x593672['model'],qs[_0x1525('0x35')](_0xd4303f[_0x1525('0x31')][_0x1525('0x35')]));_0x2e690a[_0x1525('0x33')]=_0x2e690a[_0x1525('0x33')]['length']?_0x2e690a['attributes']:_0x593672['model'];_0x2e690a[_0x1525('0x4a')]=qs[_0x1525('0x38')](_0xd4303f[_0x1525('0x31')][_0x1525('0x38')]);_0x2e690a[_0x1525('0x39')]=qs[_0x1525('0x3a')](_[_0x1525('0x3b')](_0xd4303f[_0x1525('0x31')],_0x593672[_0x1525('0x3a')]));if(_0xd4303f[_0x1525('0x31')][_0x1525('0x4b')]){_0x2e690a['where']=_[_0x1525('0x3c')](_0x2e690a['where'],{'$or':_[_0x1525('0x2b')](_0x2e690a[_0x1525('0x33')],function(_0x5472c1){var _0x489167={};_0x489167[_0x5472c1]={'$like':'%'+_0xd4303f[_0x1525('0x31')][_0x1525('0x4b')]+'%'};return _0x489167;})});}_0x2e690a=_[_0x1525('0x3c')]({},_0x2e690a,_0xd4303f[_0x1525('0x3e')]);return _0x3b86e7['getFields'](_0x2e690a);}})[_0x1525('0x24')](function(_0x584629){if(_0x584629){_0x4a6ae2=_0x584629[_0x1525('0x36')];if(!_0xd4303f['query']['hasOwnProperty'](_0x1525('0x4c'))){_0x2e690a[_0x1525('0x1d')]=qs[_0x1525('0x1d')](_0xd4303f[_0x1525('0x31')]['limit']);_0x2e690a[_0x1525('0x1e')]=qs[_0x1525('0x1e')](_0xd4303f[_0x1525('0x31')]['offset']);}return _0x3b86e7[_0x1525('0x49')](_0x2e690a);}})[_0x1525('0x24')](function(_0x3100e6){if(_0x3100e6){return _0x3100e6?{'count':_0x4a6ae2,'rows':_0x3100e6}:null;}})[_0x1525('0x24')](respondWithResult(_0x1345c3,null))[_0x1525('0x43')](handleError(_0x1345c3,null));};exports[_0x1525('0x4d')]=function(_0x37f640,_0x462f12,_0x4e0309){var _0x2f9aeb={};var _0x302d41={};var _0x5dae9a;var _0x23914d;return db[_0x1525('0x2c')]['findOne']({'where':{'id':_0x37f640['params']['id']}})[_0x1525('0x24')](handleEntityNotFound(_0x462f12,null))['then'](function(_0x34af15){if(_0x34af15){_0x5dae9a=_0x34af15;_0x302d41['model']=_[_0x1525('0x32')](db['SalesforceField'][_0x1525('0x2d')]);_0x302d41[_0x1525('0x31')]=_['keys'](_0x37f640['query']);_0x302d41['filters']=_[_0x1525('0x34')](_0x302d41[_0x1525('0x30')],_0x302d41[_0x1525('0x31')]);_0x2f9aeb[_0x1525('0x33')]=_[_0x1525('0x34')](_0x302d41[_0x1525('0x30')],qs[_0x1525('0x35')](_0x37f640[_0x1525('0x31')][_0x1525('0x35')]));_0x2f9aeb[_0x1525('0x33')]=_0x2f9aeb[_0x1525('0x33')]['length']?_0x2f9aeb[_0x1525('0x33')]:_0x302d41['model'];_0x2f9aeb[_0x1525('0x4a')]=qs['sort'](_0x37f640[_0x1525('0x31')][_0x1525('0x38')]);_0x2f9aeb[_0x1525('0x39')]=qs[_0x1525('0x3a')](_[_0x1525('0x3b')](_0x37f640['query'],_0x302d41[_0x1525('0x3a')]));if(_0x37f640['query'][_0x1525('0x4b')]){_0x2f9aeb[_0x1525('0x39')]=_[_0x1525('0x3c')](_0x2f9aeb['where'],{'$or':_[_0x1525('0x2b')](_0x2f9aeb[_0x1525('0x33')],function(_0x3886ab){var _0x46cddd={};_0x46cddd[_0x3886ab]={'$like':'%'+_0x37f640[_0x1525('0x31')][_0x1525('0x4b')]+'%'};return _0x46cddd;})});}_0x2f9aeb=_['merge']({},_0x2f9aeb,_0x37f640[_0x1525('0x3e')]);return _0x5dae9a['getSubjects'](_0x2f9aeb);}})[_0x1525('0x24')](function(_0x161fff){if(_0x161fff){_0x23914d=_0x161fff['length'];if(!_0x37f640[_0x1525('0x31')][_0x1525('0x37')](_0x1525('0x4c'))){_0x2f9aeb[_0x1525('0x1d')]=qs['limit'](_0x37f640['query'][_0x1525('0x1d')]);_0x2f9aeb[_0x1525('0x1e')]=qs[_0x1525('0x1e')](_0x37f640[_0x1525('0x31')][_0x1525('0x1e')]);}return _0x5dae9a['getSubjects'](_0x2f9aeb);}})['then'](function(_0x47c78a){if(_0x47c78a){return _0x47c78a?{'count':_0x23914d,'rows':_0x47c78a}:null;}})[_0x1525('0x24')](respondWithResult(_0x462f12,null))[_0x1525('0x43')](handleError(_0x462f12,null));};exports['getDescriptions']=function(_0x3aefda,_0x548348,_0x5e8152){var _0x855a65={};var _0x423bd1={};var _0x11f99d;var _0x112598;return db[_0x1525('0x2c')][_0x1525('0x4e')]({'where':{'id':_0x3aefda[_0x1525('0x45')]['id']}})[_0x1525('0x24')](handleEntityNotFound(_0x548348,null))[_0x1525('0x24')](function(_0x9422b9){if(_0x9422b9){_0x11f99d=_0x9422b9;_0x423bd1['model']=_['keys'](db[_0x1525('0x4f')][_0x1525('0x2d')]);_0x423bd1[_0x1525('0x31')]=_[_0x1525('0x32')](_0x3aefda[_0x1525('0x31')]);_0x423bd1[_0x1525('0x3a')]=_['intersection'](_0x423bd1[_0x1525('0x30')],_0x423bd1[_0x1525('0x31')]);_0x855a65[_0x1525('0x33')]=_['intersection'](_0x423bd1[_0x1525('0x30')],qs[_0x1525('0x35')](_0x3aefda[_0x1525('0x31')][_0x1525('0x35')]));_0x855a65[_0x1525('0x33')]=_0x855a65[_0x1525('0x33')]['length']?_0x855a65['attributes']:_0x423bd1[_0x1525('0x30')];_0x855a65[_0x1525('0x4a')]=qs[_0x1525('0x38')](_0x3aefda[_0x1525('0x31')]['sort']);_0x855a65[_0x1525('0x39')]=qs['filters'](_[_0x1525('0x3b')](_0x3aefda[_0x1525('0x31')],_0x423bd1[_0x1525('0x3a')]));if(_0x3aefda['query']['filter']){_0x855a65[_0x1525('0x39')]=_[_0x1525('0x3c')](_0x855a65[_0x1525('0x39')],{'$or':_[_0x1525('0x2b')](_0x855a65['attributes'],function(_0x54463d){var _0x1c9d59={};_0x1c9d59[_0x54463d]={'$like':'%'+_0x3aefda['query'][_0x1525('0x4b')]+'%'};return _0x1c9d59;})});}_0x855a65=_[_0x1525('0x3c')]({},_0x855a65,_0x3aefda['options']);return _0x11f99d['getDescriptions'](_0x855a65);}})[_0x1525('0x24')](function(_0x11cc36){if(_0x11cc36){_0x112598=_0x11cc36['length'];if(!_0x3aefda[_0x1525('0x31')][_0x1525('0x37')](_0x1525('0x4c'))){_0x855a65[_0x1525('0x1d')]=qs[_0x1525('0x1d')](_0x3aefda[_0x1525('0x31')][_0x1525('0x1d')]);_0x855a65[_0x1525('0x1e')]=qs[_0x1525('0x1e')](_0x3aefda[_0x1525('0x31')][_0x1525('0x1e')]);}return _0x11f99d['getDescriptions'](_0x855a65);}})[_0x1525('0x24')](function(_0x36110a){if(_0x36110a){return _0x36110a?{'count':_0x112598,'rows':_0x36110a}:null;}})['then'](respondWithResult(_0x548348,null))[_0x1525('0x43')](handleError(_0x548348,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 084e106..2d583a4 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 _0x3167=['exports','define','SalesforceConfiguration','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./intSalesforceConfiguration.attributes'];(function(_0x333f02,_0x5446f8){var _0x30eee5=function(_0x14f491){while(--_0x14f491){_0x333f02['push'](_0x333f02['shift']());}};_0x30eee5(++_0x5446f8);}(_0x3167,0x14d));var _0x7316=function(_0x458656,_0x4292d8){_0x458656=_0x458656-0x0;var _0x24e475=_0x3167[_0x458656];return _0x24e475;};'use strict';var _=require(_0x7316('0x0'));var util=require(_0x7316('0x1'));var logger=require(_0x7316('0x2'))(_0x7316('0x3'));var moment=require(_0x7316('0x4'));var BPromise=require(_0x7316('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7316('0x6'));var config=require('../../config/environment');var attributes=require(_0x7316('0x7'));module[_0x7316('0x8')]=function(_0x3e1b1c,_0x238cf4){return _0x3e1b1c[_0x7316('0x9')](_0x7316('0xa'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd64b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api'];(function(_0x4529b3,_0x390ebb){var _0x21e907=function(_0x1c19dc){while(--_0x1c19dc){_0x4529b3['push'](_0x4529b3['shift']());}};_0x21e907(++_0x390ebb);}(_0xd64b,0x1aa));var _0xbd64=function(_0x49dd5a,_0x1da7e6){_0x49dd5a=_0x49dd5a-0x0;var _0x91c8da=_0xd64b[_0x49dd5a];return _0x91c8da;};'use strict';var _=require(_0xbd64('0x0'));var util=require(_0xbd64('0x1'));var logger=require('../../config/logger')(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var rp=require(_0xbd64('0x5'));var fs=require('fs');var path=require(_0xbd64('0x6'));var rimraf=require(_0xbd64('0x7'));var config=require(_0xbd64('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x38316c,_0x2c9bad){return _0x38316c['define'](_0xbd64('0x9'),attributes,{'tableName':_0xbd64('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index ed30cbe..ef86053 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 _0x875e=['SalesforceConfiguration,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x394dea,_0x252474){var _0x3a2054=function(_0xd47d76){while(--_0xd47d76){_0x394dea['push'](_0x394dea['shift']());}};_0x3a2054(++_0x252474);}(_0x875e,0x82));var _0xe875=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x875e[_0x18a436];return _0x5c2cf8;};'use strict';var _=require(_0xe875('0x0'));var util=require(_0xe875('0x1'));var moment=require(_0xe875('0x2'));var BPromise=require('bluebird');var rs=require(_0xe875('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe875('0x4'))['db'];var utils=require(_0xe875('0x5'));var logger=require(_0xe875('0x6'))(_0xe875('0x7'));var config=require('../../config/environment');var jayson=require(_0xe875('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd54ffb,_0x362b6c,_0x1ecfd0){return new BPromise(function(_0x29b7a1,_0x3389a1){return client[_0xe875('0x9')](_0xd54ffb,_0x1ecfd0)[_0xe875('0xa')](function(_0xfc4137){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x362b6c,_0xe875('0xb'));logger[_0xe875('0xc')](_0xe875('0xd'),_0x362b6c,_0xe875('0xb'),JSON['stringify'](_0xfc4137));if(_0xfc4137[_0xe875('0xe')]){if(_0xfc4137[_0xe875('0xe')][_0xe875('0xf')]===0x1f4){logger[_0xe875('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x362b6c,_0xfc4137['error'][_0xe875('0x10')]);return _0x3389a1(_0xfc4137[_0xe875('0xe')][_0xe875('0x10')]);}logger[_0xe875('0xe')](_0xe875('0x11'),_0x362b6c,_0xfc4137['error'][_0xe875('0x10')]);return _0x29b7a1(_0xfc4137[_0xe875('0xe')][_0xe875('0x10')]);}else{logger[_0xe875('0x12')](_0xe875('0x11'),_0x362b6c,_0xe875('0xb'));_0x29b7a1(_0xfc4137[_0xe875('0x13')][_0xe875('0x10')]);}})[_0xe875('0x14')](function(_0x451561){logger[_0xe875('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x362b6c,_0x451561);_0x3389a1(_0x451561);});});} \ No newline at end of file +var _0xf9b2=['request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x57e0df,_0x1ec332){var _0x214be3=function(_0x53ab02){while(--_0x53ab02){_0x57e0df['push'](_0x57e0df['shift']());}};_0x214be3(++_0x1ec332);}(_0xf9b2,0xa8));var _0x2f9b=function(_0x36c774,_0xc37ccb){_0x36c774=_0x36c774-0x0;var _0x393556=_0xf9b2[_0x36c774];return _0x393556;};'use strict';var _=require('lodash');var util=require(_0x2f9b('0x0'));var moment=require(_0x2f9b('0x1'));var BPromise=require(_0x2f9b('0x2'));var rs=require(_0x2f9b('0x3'));var fs=require('fs');var Redis=require(_0x2f9b('0x4'));var db=require(_0x2f9b('0x5'))['db'];var utils=require(_0x2f9b('0x6'));var logger=require(_0x2f9b('0x7'))(_0x2f9b('0x8'));var config=require(_0x2f9b('0x9'));var jayson=require(_0x2f9b('0xa'));var client=jayson[_0x2f9b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3381bf,_0x7a41c5,_0x12d389){return new BPromise(function(_0x2934ad,_0x23375e){return client[_0x2f9b('0xc')](_0x3381bf,_0x12d389)[_0x2f9b('0xd')](function(_0x5e4694){logger[_0x2f9b('0xe')](_0x2f9b('0xf'),_0x7a41c5,_0x2f9b('0x10'));logger[_0x2f9b('0x11')](_0x2f9b('0x12'),_0x7a41c5,_0x2f9b('0x10'),JSON['stringify'](_0x5e4694));if(_0x5e4694[_0x2f9b('0x13')]){if(_0x5e4694[_0x2f9b('0x13')][_0x2f9b('0x14')]===0x1f4){logger['error'](_0x2f9b('0xf'),_0x7a41c5,_0x5e4694[_0x2f9b('0x13')][_0x2f9b('0x15')]);return _0x23375e(_0x5e4694[_0x2f9b('0x13')][_0x2f9b('0x15')]);}logger[_0x2f9b('0x13')](_0x2f9b('0xf'),_0x7a41c5,_0x5e4694[_0x2f9b('0x13')]['message']);return _0x2934ad(_0x5e4694[_0x2f9b('0x13')][_0x2f9b('0x15')]);}else{logger[_0x2f9b('0xe')](_0x2f9b('0xf'),_0x7a41c5,_0x2f9b('0x10'));_0x2934ad(_0x5e4694['result'][_0x2f9b('0x15')]);}})[_0x2f9b('0x16')](function(_0x33770d){logger[_0x2f9b('0x13')](_0x2f9b('0xf'),_0x7a41c5,_0x33770d);_0x23375e(_0x33770d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 1a9fed6..f07d733 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 _0x3973=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','put','delete','multer','util','path'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x3973,0x1ec));var _0x3397=function(_0x21e06b,_0x14d7df){_0x21e06b=_0x21e06b-0x0;var _0x16872a=_0x3973[_0x21e06b];return _0x16872a;};'use strict';var multer=require(_0x3397('0x0'));var util=require(_0x3397('0x1'));var path=require(_0x3397('0x2'));var timeout=require(_0x3397('0x3'));var express=require(_0x3397('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3397('0x5'));var interaction=require(_0x3397('0x6'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x3397('0x7')]('/',auth[_0x3397('0x8')](),controller[_0x3397('0x9')]);router[_0x3397('0x7')](_0x3397('0xa'),auth[_0x3397('0x8')](),controller['show']);router[_0x3397('0xb')]('/',auth[_0x3397('0x8')](),controller[_0x3397('0xc')]);router[_0x3397('0xd')](_0x3397('0xa'),auth[_0x3397('0x8')](),controller['update']);router[_0x3397('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3b0d=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','create','put','/:id','update','destroy'];(function(_0x1a3fce,_0x4f7a41){var _0x1d4684=function(_0x13af5f){while(--_0x13af5f){_0x1a3fce['push'](_0x1a3fce['shift']());}};_0x1d4684(++_0x4f7a41);}(_0x3b0d,0x132));var _0xd3b0=function(_0x31c68e,_0x5f0385){_0x31c68e=_0x31c68e-0x0;var _0x159e5d=_0x3b0d[_0x31c68e];return _0x159e5d;};'use strict';var multer=require('multer');var util=require(_0xd3b0('0x0'));var path=require(_0xd3b0('0x1'));var timeout=require(_0xd3b0('0x2'));var express=require('express');var router=express[_0xd3b0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd3b0('0x4'));var interaction=require(_0xd3b0('0x5'));var config=require(_0xd3b0('0x6'));var controller=require(_0xd3b0('0x7'));router[_0xd3b0('0x8')]('/',auth[_0xd3b0('0x9')](),controller[_0xd3b0('0xa')]);router[_0xd3b0('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd3b0('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd3b0('0xc')]);router[_0xd3b0('0xd')](_0xd3b0('0xe'),auth['isAuthenticated'](),controller[_0xd3b0('0xf')]);router['delete']('/:id',auth[_0xd3b0('0x9')](),controller[_0xd3b0('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index b069106..2cb2519 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 _0x7c62=['STRING','variable','sequelize','exports','ENUM','customVariable','string'];(function(_0x4bed3e,_0x56e922){var _0x5d0f37=function(_0x21a458){while(--_0x21a458){_0x4bed3e['push'](_0x4bed3e['shift']());}};_0x5d0f37(++_0x56e922);}(_0x7c62,0xd4));var _0x27c6=function(_0x26aa22,_0x1b10a5){_0x26aa22=_0x26aa22-0x0;var _0x377a7c=_0x7c62[_0x26aa22];return _0x377a7c;};'use strict';var Sequelize=require(_0x27c6('0x0'));module[_0x27c6('0x1')]={'type':{'type':Sequelize[_0x27c6('0x2')]('string','variable',_0x27c6('0x3'),'keyValue','picklist'),'defaultValue':_0x27c6('0x4')},'content':{'type':Sequelize[_0x27c6('0x5')]},'key':{'type':Sequelize[_0x27c6('0x5')]},'keyType':{'type':Sequelize[_0x27c6('0x2')](_0x27c6('0x4'),_0x27c6('0x6'),_0x27c6('0x3'))},'keyContent':{'type':Sequelize[_0x27c6('0x5')]},'idField':{'type':Sequelize[_0x27c6('0x5')]},'variableName':{'type':Sequelize[_0x27c6('0x5')]}}; \ No newline at end of file +var _0x707a=['STRING','exports','ENUM','variable','customVariable','picklist','string'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x707a,0x158));var _0xa707=function(_0x5a3a3d,_0x552273){_0x5a3a3d=_0x5a3a3d-0x0;var _0x57b95b=_0x707a[_0x5a3a3d];return _0x57b95b;};'use strict';var Sequelize=require('sequelize');module[_0xa707('0x0')]={'type':{'type':Sequelize[_0xa707('0x1')]('string',_0xa707('0x2'),_0xa707('0x3'),'keyValue',_0xa707('0x4')),'defaultValue':_0xa707('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa707('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xa707('0x2'),_0xa707('0x3'))},'keyContent':{'type':Sequelize[_0xa707('0x6')]},'idField':{'type':Sequelize[_0xa707('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index f236b26..99aa601 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 _0x6d7a=['length','hasOwnProperty','offset','where','filter','merge','type','VIRTUAL','options','count','includeAll','include','params','model','create','body','update','catch','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','key','query','keys','filters','intersection','fields','attributes'];(function(_0x4bff06,_0x529ea1){var _0x5a1c2e=function(_0x16e026){while(--_0x16e026){_0x4bff06['push'](_0x4bff06['shift']());}};_0x5a1c2e(++_0x529ea1);}(_0x6d7a,0x133));var _0xa6d7=function(_0x1d5127,_0x2aab5f){_0x1d5127=_0x1d5127-0x0;var _0x1b1e28=_0x6d7a[_0x1d5127];return _0x1b1e28;};'use strict';var emlformat=require(_0xa6d7('0x0'));var rimraf=require(_0xa6d7('0x1'));var zipdir=require(_0xa6d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6d7('0x3'));var moment=require(_0xa6d7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa6d7('0x5'));var util=require('util');var path=require(_0xa6d7('0x6'));var sox=require('sox');var csv=require(_0xa6d7('0x7'));var ejs=require(_0xa6d7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa6d7('0x9'));var squel=require(_0xa6d7('0xa'));var crypto=require(_0xa6d7('0xb'));var jsforce=require(_0xa6d7('0xc'));var deskjs=require(_0xa6d7('0xd'));var toCsv=require(_0xa6d7('0x7'));var querystring=require(_0xa6d7('0xe'));var Papa=require(_0xa6d7('0xf'));var Redis=require('ioredis');var authService=require(_0xa6d7('0x10'));var qs=require(_0xa6d7('0x11'));var as=require(_0xa6d7('0x12'));var hardwareService=require(_0xa6d7('0x13'));var logger=require(_0xa6d7('0x14'))(_0xa6d7('0x15'));var utils=require(_0xa6d7('0x16'));var config=require(_0xa6d7('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x71a11,_0x9fbb84){_0x9fbb84=_0x9fbb84||0xcc;return function(_0x13064c){if(_0x13064c){return _0x71a11[_0xa6d7('0x18')](_0x9fbb84);}return _0x71a11[_0xa6d7('0x19')](_0x9fbb84)[_0xa6d7('0x1a')]();};}function respondWithResult(_0x160acb,_0x28c4e0){_0x28c4e0=_0x28c4e0||0xc8;return function(_0x468849){if(_0x468849){return _0x160acb[_0xa6d7('0x19')](_0x28c4e0)[_0xa6d7('0x1b')](_0x468849);}};}function respondWithFilteredResult(_0x34f62b,_0x114ebb){return function(_0x32b33f){if(_0x32b33f){var _0x2388ae=typeof _0x114ebb['offset']===_0xa6d7('0x1c')&&typeof _0x114ebb['limit']==='undefined';var _0x4c8e27=_0x32b33f['count'];var _0x50da72=_0x2388ae?0x0:_0x114ebb['offset'];var _0x3c6aa5=_0x2388ae?_0x32b33f['count']:_0x114ebb['offset']+_0x114ebb[_0xa6d7('0x1d')];var _0x1c757a;if(_0x3c6aa5>=_0x4c8e27){_0x3c6aa5=_0x4c8e27;_0x1c757a=0xc8;}else{_0x1c757a=0xce;}_0x34f62b[_0xa6d7('0x19')](_0x1c757a);return _0x34f62b[_0xa6d7('0x1e')](_0xa6d7('0x1f'),_0x50da72+'-'+_0x3c6aa5+'/'+_0x4c8e27)[_0xa6d7('0x1b')](_0x32b33f);}return null;};}function patchUpdates(_0x5c659d){return function(_0x47dc31){try{jsonpatch[_0xa6d7('0x20')](_0x47dc31,_0x5c659d,!![]);}catch(_0x25111f){return BPromise[_0xa6d7('0x21')](_0x25111f);}return _0x47dc31[_0xa6d7('0x22')]();};}function saveUpdates(_0x350cb3,_0xe40d04){return function(_0x22a7e1){if(_0x22a7e1){return _0x22a7e1['update'](_0x350cb3)['then'](function(_0x58c6c7){return _0x58c6c7;});}return null;};}function removeEntity(_0x4667e6,_0x5d4636){return function(_0x3123ce){if(_0x3123ce){return _0x3123ce[_0xa6d7('0x23')]()[_0xa6d7('0x24')](function(){_0x4667e6['status'](0xcc)[_0xa6d7('0x1a')]();});}};}function handleEntityNotFound(_0x4e0a6d,_0x454aa2){return function(_0x57ac7d){if(!_0x57ac7d){_0x4e0a6d[_0xa6d7('0x18')](0x194);}return _0x57ac7d;};}function handleError(_0x26be1e,_0xa8e93c){_0xa8e93c=_0xa8e93c||0x1f4;return function(_0xb4f80e){logger[_0xa6d7('0x25')](_0xb4f80e[_0xa6d7('0x26')]);if(_0xb4f80e[_0xa6d7('0x27')]){delete _0xb4f80e[_0xa6d7('0x27')];}_0x26be1e[_0xa6d7('0x19')](_0xa8e93c)[_0xa6d7('0x28')](_0xb4f80e);};}exports[_0xa6d7('0x29')]=function(_0x4cb487,_0x46f3b1){var _0x4f343e={},_0x374c4e={},_0x18036e={'count':0x0,'rows':[]};var _0x2a6933=_[_0xa6d7('0x2a')](db[_0xa6d7('0x2b')][_0xa6d7('0x2c')],function(_0x3144a4){return{'name':_0x3144a4[_0xa6d7('0x2d')],'type':_0x3144a4['type'][_0xa6d7('0x2e')]};});_0x374c4e['model']=_[_0xa6d7('0x2a')](_0x2a6933,_0xa6d7('0x27'));_0x374c4e[_0xa6d7('0x2f')]=_[_0xa6d7('0x30')](_0x4cb487[_0xa6d7('0x2f')]);_0x374c4e[_0xa6d7('0x31')]=_[_0xa6d7('0x32')](_0x374c4e['model'],_0x374c4e[_0xa6d7('0x2f')]);_0x4f343e['attributes']=_['intersection'](_0x374c4e['model'],qs[_0xa6d7('0x33')](_0x4cb487[_0xa6d7('0x2f')][_0xa6d7('0x33')]));_0x4f343e[_0xa6d7('0x34')]=_0x4f343e[_0xa6d7('0x34')][_0xa6d7('0x35')]?_0x4f343e[_0xa6d7('0x34')]:_0x374c4e['model'];if(!_0x4cb487[_0xa6d7('0x2f')][_0xa6d7('0x36')]('nolimit')){_0x4f343e[_0xa6d7('0x1d')]=qs[_0xa6d7('0x1d')](_0x4cb487['query'][_0xa6d7('0x1d')]);_0x4f343e[_0xa6d7('0x37')]=qs[_0xa6d7('0x37')](_0x4cb487[_0xa6d7('0x2f')][_0xa6d7('0x37')]);}_0x4f343e['order']=qs['sort'](_0x4cb487['query']['sort']);_0x4f343e[_0xa6d7('0x38')]=qs[_0xa6d7('0x31')](_['pick'](_0x4cb487['query'],_0x374c4e[_0xa6d7('0x31')]),_0x2a6933);if(_0x4cb487['query'][_0xa6d7('0x39')]){_0x4f343e[_0xa6d7('0x38')]=_[_0xa6d7('0x3a')](_0x4f343e[_0xa6d7('0x38')],{'$or':_[_0xa6d7('0x2a')](_0x2a6933,function(_0x30ec3b){if(_0x30ec3b[_0xa6d7('0x3b')]!==_0xa6d7('0x3c')){var _0x23e449={};_0x23e449[_0x30ec3b['name']]={'$like':'%'+_0x4cb487['query'][_0xa6d7('0x39')]+'%'};return _0x23e449;}})});}_0x4f343e=_[_0xa6d7('0x3a')]({},_0x4f343e,_0x4cb487[_0xa6d7('0x3d')]);var _0x4d590c={'where':_0x4f343e['where']};return db[_0xa6d7('0x2b')]['count'](_0x4d590c)[_0xa6d7('0x24')](function(_0x286256){_0x18036e[_0xa6d7('0x3e')]=_0x286256;if(_0x4cb487[_0xa6d7('0x2f')][_0xa6d7('0x3f')]){_0x4f343e[_0xa6d7('0x40')]=[{'all':!![]}];}return db[_0xa6d7('0x2b')]['findAll'](_0x4f343e);})[_0xa6d7('0x24')](function(_0x579bff){_0x18036e['rows']=_0x579bff;return _0x18036e;})[_0xa6d7('0x24')](respondWithFilteredResult(_0x46f3b1,_0x4f343e))['catch'](handleError(_0x46f3b1,null));};exports['show']=function(_0x250c9d,_0x58da93){var _0xeea526={'raw':!![],'where':{'id':_0x250c9d[_0xa6d7('0x41')]['id']}},_0x5c8139={};_0x5c8139[_0xa6d7('0x42')]=_[_0xa6d7('0x30')](db[_0xa6d7('0x2b')]['rawAttributes']);_0x5c8139[_0xa6d7('0x2f')]=_[_0xa6d7('0x30')](_0x250c9d[_0xa6d7('0x2f')]);_0x5c8139['filters']=_[_0xa6d7('0x32')](_0x5c8139['model'],_0x5c8139[_0xa6d7('0x2f')]);_0xeea526[_0xa6d7('0x34')]=_[_0xa6d7('0x32')](_0x5c8139[_0xa6d7('0x42')],qs[_0xa6d7('0x33')](_0x250c9d[_0xa6d7('0x2f')][_0xa6d7('0x33')]));_0xeea526[_0xa6d7('0x34')]=_0xeea526['attributes']['length']?_0xeea526['attributes']:_0x5c8139['model'];if(_0x250c9d[_0xa6d7('0x2f')][_0xa6d7('0x3f')]){_0xeea526['include']=[{'all':!![]}];}_0xeea526=_['merge']({},_0xeea526,_0x250c9d[_0xa6d7('0x3d')]);return db[_0xa6d7('0x2b')]['find'](_0xeea526)['then'](handleEntityNotFound(_0x58da93,null))[_0xa6d7('0x24')](respondWithResult(_0x58da93,null))['catch'](handleError(_0x58da93,null));};exports['create']=function(_0x5ca068,_0x4178be){return db[_0xa6d7('0x2b')][_0xa6d7('0x43')](_0x5ca068[_0xa6d7('0x44')],{})[_0xa6d7('0x24')](respondWithResult(_0x4178be,0xc9))['catch'](handleError(_0x4178be,null));};exports[_0xa6d7('0x45')]=function(_0x10bd2c,_0x58616f){if(_0x10bd2c[_0xa6d7('0x44')]['id']){delete _0x10bd2c[_0xa6d7('0x44')]['id'];}return db[_0xa6d7('0x2b')]['find']({'where':{'id':_0x10bd2c[_0xa6d7('0x41')]['id']}})[_0xa6d7('0x24')](handleEntityNotFound(_0x58616f,null))[_0xa6d7('0x24')](saveUpdates(_0x10bd2c[_0xa6d7('0x44')],null))[_0xa6d7('0x24')](respondWithResult(_0x58616f,null))[_0xa6d7('0x46')](handleError(_0x58616f,null));};exports['destroy']=function(_0x5345fe,_0x2011f9){return db['SalesforceField'][_0xa6d7('0x47')]({'where':{'id':_0x5345fe[_0xa6d7('0x41')]['id']}})[_0xa6d7('0x24')](handleEntityNotFound(_0x2011f9,null))[_0xa6d7('0x24')](removeEntity(_0x2011f9,null))[_0xa6d7('0x46')](handleError(_0x2011f9,null));}; \ No newline at end of file +var _0x40b2=['zip-dir','request-promise','moment','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','name','send','index','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SalesforceField','include','catch','show','params','keys','create','body','find','rimraf'];(function(_0x1fc88a,_0x2d4c80){var _0xf8c52=function(_0x1e0975){while(--_0x1e0975){_0x1fc88a['push'](_0x1fc88a['shift']());}};_0xf8c52(++_0x2d4c80);}(_0x40b2,0x89));var _0x240b=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x40b2[_0xdea41a];return _0x15d0d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x240b('0x0'));var zipdir=require(_0x240b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x240b('0x2'));var moment=require(_0x240b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x240b('0x4'));var path=require(_0x240b('0x5'));var sox=require(_0x240b('0x6'));var csv=require('to-csv');var ejs=require(_0x240b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x240b('0x8'));var jsforce=require(_0x240b('0x9'));var deskjs=require(_0x240b('0xa'));var toCsv=require(_0x240b('0xb'));var querystring=require(_0x240b('0xc'));var Papa=require(_0x240b('0xd'));var Redis=require(_0x240b('0xe'));var authService=require(_0x240b('0xf'));var qs=require(_0x240b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x240b('0x11'))(_0x240b('0x12'));var utils=require(_0x240b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x240b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x325c7e,_0x158ee0){_0x158ee0=_0x158ee0||0xcc;return function(_0x2680e7){if(_0x2680e7){return _0x325c7e[_0x240b('0x15')](_0x158ee0);}return _0x325c7e[_0x240b('0x16')](_0x158ee0)[_0x240b('0x17')]();};}function respondWithResult(_0x19fc3c,_0x26a861){_0x26a861=_0x26a861||0xc8;return function(_0xb27be7){if(_0xb27be7){return _0x19fc3c['status'](_0x26a861)[_0x240b('0x18')](_0xb27be7);}};}function respondWithFilteredResult(_0x31aeeb,_0x1319ed){return function(_0x46b4e2){if(_0x46b4e2){var _0x3493d1=typeof _0x1319ed[_0x240b('0x19')]===_0x240b('0x1a')&&typeof _0x1319ed['limit']===_0x240b('0x1a');var _0x4ca035=_0x46b4e2[_0x240b('0x1b')];var _0x59a936=_0x3493d1?0x0:_0x1319ed['offset'];var _0x9daa96=_0x3493d1?_0x46b4e2['count']:_0x1319ed[_0x240b('0x19')]+_0x1319ed[_0x240b('0x1c')];var _0x47e6a7;if(_0x9daa96>=_0x4ca035){_0x9daa96=_0x4ca035;_0x47e6a7=0xc8;}else{_0x47e6a7=0xce;}_0x31aeeb[_0x240b('0x16')](_0x47e6a7);return _0x31aeeb[_0x240b('0x1d')](_0x240b('0x1e'),_0x59a936+'-'+_0x9daa96+'/'+_0x4ca035)[_0x240b('0x18')](_0x46b4e2);}return null;};}function patchUpdates(_0x47b668){return function(_0x47759c){try{jsonpatch[_0x240b('0x1f')](_0x47759c,_0x47b668,!![]);}catch(_0x119346){return BPromise[_0x240b('0x20')](_0x119346);}return _0x47759c[_0x240b('0x21')]();};}function saveUpdates(_0x5aa6e3,_0x2d5bea){return function(_0x34c356){if(_0x34c356){return _0x34c356['update'](_0x5aa6e3)['then'](function(_0x47d705){return _0x47d705;});}return null;};}function removeEntity(_0x1d48b7,_0x2b3789){return function(_0xdfcc1e){if(_0xdfcc1e){return _0xdfcc1e[_0x240b('0x22')]()[_0x240b('0x23')](function(){_0x1d48b7[_0x240b('0x16')](0xcc)[_0x240b('0x17')]();});}};}function handleEntityNotFound(_0x509e56,_0x325566){return function(_0x3e6473){if(!_0x3e6473){_0x509e56[_0x240b('0x15')](0x194);}return _0x3e6473;};}function handleError(_0x247432,_0x4109b8){_0x4109b8=_0x4109b8||0x1f4;return function(_0x101aca){logger[_0x240b('0x24')](_0x101aca['stack']);if(_0x101aca['name']){delete _0x101aca[_0x240b('0x25')];}_0x247432[_0x240b('0x16')](_0x4109b8)[_0x240b('0x26')](_0x101aca);};}exports[_0x240b('0x27')]=function(_0x4304e9,_0x1f04da){var _0x33d8fe={},_0xb6821a={},_0x4cb980={'count':0x0,'rows':[]};var _0x3c9a4f=_['map'](db['SalesforceField']['rawAttributes'],function(_0x4f67fb){return{'name':_0x4f67fb[_0x240b('0x28')],'type':_0x4f67fb[_0x240b('0x29')][_0x240b('0x2a')]};});_0xb6821a[_0x240b('0x2b')]=_[_0x240b('0x2c')](_0x3c9a4f,_0x240b('0x25'));_0xb6821a[_0x240b('0x2d')]=_['keys'](_0x4304e9[_0x240b('0x2d')]);_0xb6821a[_0x240b('0x2e')]=_['intersection'](_0xb6821a[_0x240b('0x2b')],_0xb6821a[_0x240b('0x2d')]);_0x33d8fe['attributes']=_[_0x240b('0x2f')](_0xb6821a[_0x240b('0x2b')],qs[_0x240b('0x30')](_0x4304e9[_0x240b('0x2d')][_0x240b('0x30')]));_0x33d8fe['attributes']=_0x33d8fe[_0x240b('0x31')][_0x240b('0x32')]?_0x33d8fe[_0x240b('0x31')]:_0xb6821a[_0x240b('0x2b')];if(!_0x4304e9[_0x240b('0x2d')]['hasOwnProperty'](_0x240b('0x33'))){_0x33d8fe[_0x240b('0x1c')]=qs[_0x240b('0x1c')](_0x4304e9['query'][_0x240b('0x1c')]);_0x33d8fe[_0x240b('0x19')]=qs[_0x240b('0x19')](_0x4304e9[_0x240b('0x2d')][_0x240b('0x19')]);}_0x33d8fe[_0x240b('0x34')]=qs['sort'](_0x4304e9[_0x240b('0x2d')][_0x240b('0x35')]);_0x33d8fe[_0x240b('0x36')]=qs[_0x240b('0x2e')](_[_0x240b('0x37')](_0x4304e9[_0x240b('0x2d')],_0xb6821a[_0x240b('0x2e')]),_0x3c9a4f);if(_0x4304e9[_0x240b('0x2d')][_0x240b('0x38')]){_0x33d8fe[_0x240b('0x36')]=_['merge'](_0x33d8fe[_0x240b('0x36')],{'$or':_[_0x240b('0x2c')](_0x3c9a4f,function(_0x2d0f2e){if(_0x2d0f2e[_0x240b('0x29')]!==_0x240b('0x39')){var _0x94cfe7={};_0x94cfe7[_0x2d0f2e[_0x240b('0x25')]]={'$like':'%'+_0x4304e9['query'][_0x240b('0x38')]+'%'};return _0x94cfe7;}})});}_0x33d8fe=_[_0x240b('0x3a')]({},_0x33d8fe,_0x4304e9[_0x240b('0x3b')]);var _0xb78213={'where':_0x33d8fe[_0x240b('0x36')]};return db[_0x240b('0x3c')][_0x240b('0x1b')](_0xb78213)[_0x240b('0x23')](function(_0x3766df){_0x4cb980[_0x240b('0x1b')]=_0x3766df;if(_0x4304e9[_0x240b('0x2d')]['includeAll']){_0x33d8fe[_0x240b('0x3d')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x33d8fe);})[_0x240b('0x23')](function(_0x1b8ef8){_0x4cb980['rows']=_0x1b8ef8;return _0x4cb980;})[_0x240b('0x23')](respondWithFilteredResult(_0x1f04da,_0x33d8fe))[_0x240b('0x3e')](handleError(_0x1f04da,null));};exports[_0x240b('0x3f')]=function(_0x3b1d9b,_0x251edb){var _0x39f345={'raw':!![],'where':{'id':_0x3b1d9b[_0x240b('0x40')]['id']}},_0x1b632b={};_0x1b632b[_0x240b('0x2b')]=_[_0x240b('0x41')](db[_0x240b('0x3c')]['rawAttributes']);_0x1b632b['query']=_[_0x240b('0x41')](_0x3b1d9b['query']);_0x1b632b['filters']=_[_0x240b('0x2f')](_0x1b632b['model'],_0x1b632b['query']);_0x39f345[_0x240b('0x31')]=_[_0x240b('0x2f')](_0x1b632b['model'],qs[_0x240b('0x30')](_0x3b1d9b[_0x240b('0x2d')][_0x240b('0x30')]));_0x39f345[_0x240b('0x31')]=_0x39f345[_0x240b('0x31')][_0x240b('0x32')]?_0x39f345[_0x240b('0x31')]:_0x1b632b[_0x240b('0x2b')];if(_0x3b1d9b[_0x240b('0x2d')]['includeAll']){_0x39f345['include']=[{'all':!![]}];}_0x39f345=_[_0x240b('0x3a')]({},_0x39f345,_0x3b1d9b[_0x240b('0x3b')]);return db[_0x240b('0x3c')]['find'](_0x39f345)[_0x240b('0x23')](handleEntityNotFound(_0x251edb,null))[_0x240b('0x23')](respondWithResult(_0x251edb,null))[_0x240b('0x3e')](handleError(_0x251edb,null));};exports[_0x240b('0x42')]=function(_0x46ed9f,_0x4177dc){return db['SalesforceField']['create'](_0x46ed9f[_0x240b('0x43')],{})['then'](respondWithResult(_0x4177dc,0xc9))[_0x240b('0x3e')](handleError(_0x4177dc,null));};exports['update']=function(_0x59cde3,_0x5d724d){if(_0x59cde3[_0x240b('0x43')]['id']){delete _0x59cde3[_0x240b('0x43')]['id'];}return db[_0x240b('0x3c')]['find']({'where':{'id':_0x59cde3[_0x240b('0x40')]['id']}})[_0x240b('0x23')](handleEntityNotFound(_0x5d724d,null))['then'](saveUpdates(_0x59cde3[_0x240b('0x43')],null))['then'](respondWithResult(_0x5d724d,null))[_0x240b('0x3e')](handleError(_0x5d724d,null));};exports[_0x240b('0x22')]=function(_0x3b272d,_0x331f5c){return db[_0x240b('0x3c')][_0x240b('0x44')]({'where':{'id':_0x3b272d[_0x240b('0x40')]['id']}})[_0x240b('0x23')](handleEntityNotFound(_0x331f5c,null))[_0x240b('0x23')](removeEntity(_0x331f5c,null))['catch'](handleError(_0x331f5c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 2d5954d..02e31fc 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 _0x0fcf=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0fcf,0x8d));var _0xf0fc=function(_0xadb514,_0x19bd2a){_0xadb514=_0xadb514-0x0;var _0x5dccb1=_0x0fcf[_0xadb514];return _0x5dccb1;};'use strict';var _=require(_0xf0fc('0x0'));var util=require(_0xf0fc('0x1'));var logger=require(_0xf0fc('0x2'))(_0xf0fc('0x3'));var moment=require(_0xf0fc('0x4'));var BPromise=require(_0xf0fc('0x5'));var rp=require(_0xf0fc('0x6'));var fs=require('fs');var path=require(_0xf0fc('0x7'));var rimraf=require(_0xf0fc('0x8'));var config=require(_0xf0fc('0x9'));var attributes=require('./intSalesforceField.attributes');module[_0xf0fc('0xa')]=function(_0x593724,_0xfbd44){return _0x593724[_0xf0fc('0xb')](_0xf0fc('0xc'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xf0fc('0xd'),'fields':[_0xf0fc('0xe'),_0xf0fc('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x47e8=['SalesforceField','int_salesforce_fields','idField','FieldId','lodash','util','moment','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x47e8,0x86));var _0x847e=function(_0x36bc58,_0x27f03c){_0x36bc58=_0x36bc58-0x0;var _0x4a547e=_0x47e8[_0x36bc58];return _0x4a547e;};'use strict';var _=require(_0x847e('0x0'));var util=require(_0x847e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x847e('0x2'));var BPromise=require('bluebird');var rp=require(_0x847e('0x3'));var fs=require('fs');var path=require(_0x847e('0x4'));var rimraf=require('rimraf');var config=require(_0x847e('0x5'));var attributes=require(_0x847e('0x6'));module[_0x847e('0x7')]=function(_0x4ab626,_0x630499){return _0x4ab626[_0x847e('0x8')](_0x847e('0x9'),attributes,{'tableName':_0x847e('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x847e('0xb'),_0x847e('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 48ddcf9..77acf59 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 _0xb625=['message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0xb625,0xd2));var _0x5b62=function(_0x3076b5,_0x6bc9df){_0x3076b5=_0x3076b5-0x0;var _0x5ef5da=_0xb625[_0x3076b5];return _0x5ef5da;};'use strict';var _=require(_0x5b62('0x0'));var util=require(_0x5b62('0x1'));var moment=require(_0x5b62('0x2'));var BPromise=require(_0x5b62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b62('0x4'));var db=require(_0x5b62('0x5'))['db'];var utils=require(_0x5b62('0x6'));var logger=require(_0x5b62('0x7'))(_0x5b62('0x8'));var config=require(_0x5b62('0x9'));var jayson=require(_0x5b62('0xa'));var client=jayson[_0x5b62('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a5c9a,_0x53f36c,_0xb2581c){return new BPromise(function(_0x3b97bf,_0x5f59dd){return client['request'](_0x3a5c9a,_0xb2581c)[_0x5b62('0xc')](function(_0x19ce83){logger[_0x5b62('0xd')](_0x5b62('0xe'),_0x53f36c,'request\x20sent');logger[_0x5b62('0xf')](_0x5b62('0x10'),_0x53f36c,'request\x20sent',JSON[_0x5b62('0x11')](_0x19ce83));if(_0x19ce83[_0x5b62('0x12')]){if(_0x19ce83['error'][_0x5b62('0x13')]===0x1f4){logger[_0x5b62('0x12')](_0x5b62('0xe'),_0x53f36c,_0x19ce83[_0x5b62('0x12')][_0x5b62('0x14')]);return _0x5f59dd(_0x19ce83[_0x5b62('0x12')][_0x5b62('0x14')]);}logger[_0x5b62('0x12')](_0x5b62('0xe'),_0x53f36c,_0x19ce83[_0x5b62('0x12')][_0x5b62('0x14')]);return _0x3b97bf(_0x19ce83[_0x5b62('0x12')][_0x5b62('0x14')]);}else{logger[_0x5b62('0xd')](_0x5b62('0xe'),_0x53f36c,_0x5b62('0x15'));_0x3b97bf(_0x19ce83[_0x5b62('0x16')][_0x5b62('0x14')]);}})['catch'](function(_0x21ec29){logger[_0x5b62('0x12')](_0x5b62('0xe'),_0x53f36c,_0x21ec29);_0x5f59dd(_0x21ec29);});});} \ No newline at end of file +var _0x0ec8=['SalesforceField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','SalesforceField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5216e0,_0x4f8cb9){var _0x5b3f40=function(_0x30c832){while(--_0x30c832){_0x5216e0['push'](_0x5216e0['shift']());}};_0x5b3f40(++_0x4f8cb9);}(_0x0ec8,0x128));var _0x80ec=function(_0x3a5a34,_0x3dbeba){_0x3a5a34=_0x3a5a34-0x0;var _0x36645f=_0x0ec8[_0x3a5a34];return _0x36645f;};'use strict';var _=require(_0x80ec('0x0'));var util=require(_0x80ec('0x1'));var moment=require(_0x80ec('0x2'));var BPromise=require(_0x80ec('0x3'));var rs=require(_0x80ec('0x4'));var fs=require('fs');var Redis=require(_0x80ec('0x5'));var db=require(_0x80ec('0x6'))['db'];var utils=require(_0x80ec('0x7'));var logger=require(_0x80ec('0x8'))('rpc');var config=require(_0x80ec('0x9'));var jayson=require(_0x80ec('0xa'));var client=jayson['client'][_0x80ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33fb4a,_0x31df4b,_0x58dea5){return new BPromise(function(_0x469e2a,_0x31b1ab){return client[_0x80ec('0xc')](_0x33fb4a,_0x58dea5)['then'](function(_0x3c3778){logger['info'](_0x80ec('0xd'),_0x31df4b,_0x80ec('0xe'));logger[_0x80ec('0xf')](_0x80ec('0x10'),_0x31df4b,'request\x20sent',JSON[_0x80ec('0x11')](_0x3c3778));if(_0x3c3778['error']){if(_0x3c3778['error'][_0x80ec('0x12')]===0x1f4){logger[_0x80ec('0x13')](_0x80ec('0xd'),_0x31df4b,_0x3c3778['error'][_0x80ec('0x14')]);return _0x31b1ab(_0x3c3778['error']['message']);}logger[_0x80ec('0x13')](_0x80ec('0xd'),_0x31df4b,_0x3c3778[_0x80ec('0x13')][_0x80ec('0x14')]);return _0x469e2a(_0x3c3778[_0x80ec('0x13')][_0x80ec('0x14')]);}else{logger[_0x80ec('0x15')](_0x80ec('0xd'),_0x31df4b,_0x80ec('0xe'));_0x469e2a(_0x3c3778[_0x80ec('0x16')]['message']);}})[_0x80ec('0x17')](function(_0x595183){logger[_0x80ec('0x13')](_0x80ec('0xd'),_0x31df4b,_0x595183);_0x31b1ab(_0x595183);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index d595a61..fbf43b1 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 _0xf966=['isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./intServicenowAccount.controller','get'];(function(_0x31004a,_0x91730){var _0x14ac70=function(_0x37db9e){while(--_0x37db9e){_0x31004a['push'](_0x31004a['shift']());}};_0x14ac70(++_0x91730);}(_0xf966,0x65));var _0x6f96=function(_0x164515,_0x4c9255){_0x164515=_0x164515-0x0;var _0x2409d0=_0xf966[_0x164515];return _0x2409d0;};'use strict';var multer=require(_0x6f96('0x0'));var util=require(_0x6f96('0x1'));var path=require(_0x6f96('0x2'));var timeout=require(_0x6f96('0x3'));var express=require(_0x6f96('0x4'));var router=express[_0x6f96('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6f96('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f96('0x7'));router[_0x6f96('0x8')]('/',auth[_0x6f96('0x9')](),controller[_0x6f96('0xa')]);router[_0x6f96('0x8')](_0x6f96('0xb'),auth['isAuthenticated'](),controller[_0x6f96('0xc')]);router[_0x6f96('0x8')](_0x6f96('0xd'),auth[_0x6f96('0x9')](),controller['getConfigurations']);router[_0x6f96('0x8')](_0x6f96('0xe'),auth['isAuthenticated'](),controller[_0x6f96('0xf')]);router['post']('/',auth[_0x6f96('0x9')](),controller[_0x6f96('0x10')]);router[_0x6f96('0x11')](_0x6f96('0xd'),auth[_0x6f96('0x9')](),controller[_0x6f96('0x12')]);router['put'](_0x6f96('0xb'),auth[_0x6f96('0x9')](),controller[_0x6f96('0x13')]);router[_0x6f96('0x14')](_0x6f96('0xb'),auth[_0x6f96('0x9')](),controller['destroy']);module[_0x6f96('0x15')]=router; \ No newline at end of file +var _0x9bfa=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer'];(function(_0x4edfa1,_0x20f7fd){var _0x5eee19=function(_0x1ee7ce){while(--_0x1ee7ce){_0x4edfa1['push'](_0x4edfa1['shift']());}};_0x5eee19(++_0x20f7fd);}(_0x9bfa,0x167));var _0xa9bf=function(_0xe9ec07,_0x2cb0b5){_0xe9ec07=_0xe9ec07-0x0;var _0x39170c=_0x9bfa[_0xe9ec07];return _0x39170c;};'use strict';var multer=require(_0xa9bf('0x0'));var util=require(_0xa9bf('0x1'));var path=require('path');var timeout=require(_0xa9bf('0x2'));var express=require(_0xa9bf('0x3'));var router=express[_0xa9bf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa9bf('0x5'));var interaction=require(_0xa9bf('0x6'));var config=require(_0xa9bf('0x7'));var controller=require(_0xa9bf('0x8'));router[_0xa9bf('0x9')]('/',auth[_0xa9bf('0xa')](),controller[_0xa9bf('0xb')]);router[_0xa9bf('0x9')]('/:id',auth[_0xa9bf('0xa')](),controller[_0xa9bf('0xc')]);router[_0xa9bf('0x9')](_0xa9bf('0xd'),auth['isAuthenticated'](),controller[_0xa9bf('0xe')]);router[_0xa9bf('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xa9bf('0xf')]);router['post']('/',auth[_0xa9bf('0xa')](),controller[_0xa9bf('0x10')]);router['post'](_0xa9bf('0xd'),auth[_0xa9bf('0xa')](),controller[_0xa9bf('0x11')]);router[_0xa9bf('0x12')](_0xa9bf('0x13'),auth[_0xa9bf('0xa')](),controller[_0xa9bf('0x14')]);router[_0xa9bf('0x15')](_0xa9bf('0x13'),auth[_0xa9bf('0xa')](),controller[_0xa9bf('0x16')]);module[_0xa9bf('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index d56a53f..f6effec 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 _0xe8ea=['exports','STRING','username','remoteUri','sequelize'];(function(_0x496b11,_0x576cb0){var _0x3030ac=function(_0x38185b){while(--_0x38185b){_0x496b11['push'](_0x496b11['shift']());}};_0x3030ac(++_0x576cb0);}(_0xe8ea,0xd1));var _0xae8e=function(_0x3149b6,_0x4a1273){_0x3149b6=_0x3149b6-0x0;var _0x547bad=_0xe8ea[_0x3149b6];return _0x547bad;};'use strict';var Sequelize=require(_0xae8e('0x0'));module[_0xae8e('0x1')]={'name':{'type':Sequelize[_0xae8e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xae8e('0x2')],'unique':_0xae8e('0x3')},'password':{'type':Sequelize[_0xae8e('0x2')]},'email':{'type':Sequelize[_0xae8e('0x2')]},'remoteUri':{'type':Sequelize[_0xae8e('0x2')],'unique':_0xae8e('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x00d9=['username','remoteUri','exports','STRING'];(function(_0x5b6092,_0x5563bd){var _0x3de6aa=function(_0x22732d){while(--_0x22732d){_0x5b6092['push'](_0x5b6092['shift']());}};_0x3de6aa(++_0x5563bd);}(_0x00d9,0x9e));var _0x900d=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x00d9[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require('sequelize');module[_0x900d('0x0')]={'name':{'type':Sequelize[_0x900d('0x1')]},'description':{'type':Sequelize[_0x900d('0x1')]},'username':{'type':Sequelize[_0x900d('0x1')],'unique':_0x900d('0x2')},'password':{'type':Sequelize[_0x900d('0x1')]},'email':{'type':Sequelize[_0x900d('0x1')]},'remoteUri':{'type':Sequelize[_0x900d('0x1')],'unique':_0x900d('0x3')},'serverUrl':{'type':Sequelize[_0x900d('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 7b87117..a801ea3 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 _0x39ac=['delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','activity_due','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','correlation_id','location','username','password','remoteUri','serverUrl','substring','lastIndexOf','%s/api/now/table/','incident?sysparm_display_value=all','result','log','remove','forEach','internalType','label','push','all','TCL:\x20_object','includes','concat','ServiceNow\x20error:\x20','statusCode','send','Wrong\x20credentials','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','value','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../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','limit','count','apply','reject','save','update','then','error','stack','name','index','ServicenowAccount','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','getConfigurations','findOne','ServicenowConfiguration','map','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','ServicenowField','made_sla','hold_reason','subcategory','close_code','incident_state','category','parent','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','correlation_display'];(function(_0x1eaced,_0x5987b9){var _0x4b5bcd=function(_0x39889e){while(--_0x39889e){_0x1eaced['push'](_0x1eaced['shift']());}};_0x4b5bcd(++_0x5987b9);}(_0x39ac,0xe9));var _0xc39a=function(_0x181b98,_0xb45686){_0x181b98=_0x181b98-0x0;var _0x319a5d=_0x39ac[_0x181b98];return _0x319a5d;};'use strict';var emlformat=require(_0xc39a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc39a('0x1'));var jsonpatch=require(_0xc39a('0x2'));var rp=require(_0xc39a('0x3'));var moment=require(_0xc39a('0x4'));var BPromise=require(_0xc39a('0x5'));var Mustache=require(_0xc39a('0x6'));var util=require(_0xc39a('0x7'));var path=require('path');var sox=require(_0xc39a('0x8'));var csv=require(_0xc39a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc39a('0xa'));var _=require('lodash');var squel=require(_0xc39a('0xb'));var crypto=require('crypto');var jsforce=require(_0xc39a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc39a('0xd'));var Papa=require(_0xc39a('0xe'));var Redis=require(_0xc39a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc39a('0x10'));var as=require(_0xc39a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc39a('0x12'))(_0xc39a('0x13'));var utils=require(_0xc39a('0x14'));var config=require(_0xc39a('0x15'));var licenseUtil=require(_0xc39a('0x16'));var db=require(_0xc39a('0x17'))['db'];var integrations=require(_0xc39a('0x18'));function respondWithStatusCode(_0xbf200d,_0x51d27d){_0x51d27d=_0x51d27d||0xcc;return function(_0x32d8cb){if(_0x32d8cb){return _0xbf200d[_0xc39a('0x19')](_0x51d27d);}return _0xbf200d[_0xc39a('0x1a')](_0x51d27d)[_0xc39a('0x1b')]();};}function respondWithResult(_0xdd14d1,_0xde0aa4){_0xde0aa4=_0xde0aa4||0xc8;return function(_0x34718f){if(_0x34718f){return _0xdd14d1[_0xc39a('0x1a')](_0xde0aa4)[_0xc39a('0x1c')](_0x34718f);}};}function respondWithFilteredResult(_0x15ab81,_0x30fec9){return function(_0x3785aa){if(_0x3785aa){var _0x184fa3=typeof _0x30fec9[_0xc39a('0x1d')]===_0xc39a('0x1e')&&typeof _0x30fec9[_0xc39a('0x1f')]===_0xc39a('0x1e');var _0x2d1b22=_0x3785aa[_0xc39a('0x20')];var _0x52a823=_0x184fa3?0x0:_0x30fec9[_0xc39a('0x1d')];var _0x21083b=_0x184fa3?_0x3785aa[_0xc39a('0x20')]:_0x30fec9[_0xc39a('0x1d')]+_0x30fec9[_0xc39a('0x1f')];var _0x32e300;if(_0x21083b>=_0x2d1b22){_0x21083b=_0x2d1b22;_0x32e300=0xc8;}else{_0x32e300=0xce;}_0x15ab81['status'](_0x32e300);return _0x15ab81['set']('Content-Range',_0x52a823+'-'+_0x21083b+'/'+_0x2d1b22)['json'](_0x3785aa);}return null;};}function patchUpdates(_0x3256ae){return function(_0x15dedb){try{jsonpatch[_0xc39a('0x21')](_0x15dedb,_0x3256ae,!![]);}catch(_0x2e3db3){return BPromise[_0xc39a('0x22')](_0x2e3db3);}return _0x15dedb[_0xc39a('0x23')]();};}function saveUpdates(_0x1d9334,_0x260724){return function(_0x3c846e){if(_0x3c846e){return _0x3c846e[_0xc39a('0x24')](_0x1d9334)[_0xc39a('0x25')](function(_0x23bb20){return _0x23bb20;});}return null;};}function removeEntity(_0x2c96da,_0x26127f){return function(_0x2d08c7){if(_0x2d08c7){return _0x2d08c7['destroy']()[_0xc39a('0x25')](function(){_0x2c96da['status'](0xcc)[_0xc39a('0x1b')]();});}};}function handleEntityNotFound(_0x2d1e83,_0x5ecdbe){return function(_0x227842){if(!_0x227842){_0x2d1e83[_0xc39a('0x19')](0x194);}return _0x227842;};}function handleError(_0x4703d3,_0x526f07){_0x526f07=_0x526f07||0x1f4;return function(_0x3287ab){logger[_0xc39a('0x26')](_0x3287ab[_0xc39a('0x27')]);if(_0x3287ab[_0xc39a('0x28')]){delete _0x3287ab[_0xc39a('0x28')];}_0x4703d3[_0xc39a('0x1a')](_0x526f07)['send'](_0x3287ab);};}exports[_0xc39a('0x29')]=function(_0xbf2b5a,_0x3873aa){var _0x5b39e6={},_0xbdff3a={},_0x143f18={'count':0x0,'rows':[]};var _0x3d9b55=_['map'](db[_0xc39a('0x2a')][_0xc39a('0x2b')],function(_0x337911){return{'name':_0x337911['fieldName'],'type':_0x337911[_0xc39a('0x2c')][_0xc39a('0x2d')]};});_0xbdff3a['model']=_['map'](_0x3d9b55,_0xc39a('0x28'));_0xbdff3a[_0xc39a('0x2e')]=_[_0xc39a('0x2f')](_0xbf2b5a[_0xc39a('0x2e')]);_0xbdff3a[_0xc39a('0x30')]=_['intersection'](_0xbdff3a['model'],_0xbdff3a[_0xc39a('0x2e')]);_0x5b39e6[_0xc39a('0x31')]=_[_0xc39a('0x32')](_0xbdff3a[_0xc39a('0x33')],qs[_0xc39a('0x34')](_0xbf2b5a['query']['fields']));_0x5b39e6[_0xc39a('0x31')]=_0x5b39e6['attributes'][_0xc39a('0x35')]?_0x5b39e6[_0xc39a('0x31')]:_0xbdff3a[_0xc39a('0x33')];if(!_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x36')]('nolimit')){_0x5b39e6[_0xc39a('0x1f')]=qs['limit'](_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x1f')]);_0x5b39e6[_0xc39a('0x1d')]=qs[_0xc39a('0x1d')](_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x1d')]);}_0x5b39e6[_0xc39a('0x37')]=qs[_0xc39a('0x38')](_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x38')]);_0x5b39e6[_0xc39a('0x39')]=qs[_0xc39a('0x30')](_[_0xc39a('0x3a')](_0xbf2b5a['query'],_0xbdff3a[_0xc39a('0x30')]),_0x3d9b55);if(_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x3b')]){_0x5b39e6[_0xc39a('0x39')]=_[_0xc39a('0x3c')](_0x5b39e6[_0xc39a('0x39')],{'$or':_['map'](_0x3d9b55,function(_0x5c01dc){if(_0x5c01dc[_0xc39a('0x2c')]!==_0xc39a('0x3d')){var _0x241b25={};_0x241b25[_0x5c01dc[_0xc39a('0x28')]]={'$like':'%'+_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x3b')]+'%'};return _0x241b25;}})});}_0x5b39e6=_['merge']({},_0x5b39e6,_0xbf2b5a[_0xc39a('0x3e')]);var _0x4ff5e0={'where':_0x5b39e6[_0xc39a('0x39')]};return db[_0xc39a('0x2a')][_0xc39a('0x20')](_0x4ff5e0)['then'](function(_0xef886e){_0x143f18[_0xc39a('0x20')]=_0xef886e;if(_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x3f')]){_0x5b39e6[_0xc39a('0x40')]=[{'all':!![]}];}return db[_0xc39a('0x2a')][_0xc39a('0x41')](_0x5b39e6);})[_0xc39a('0x25')](function(_0x57fac2){_0x143f18[_0xc39a('0x42')]=_0x57fac2;return _0x143f18;})[_0xc39a('0x25')](respondWithFilteredResult(_0x3873aa,_0x5b39e6))['catch'](handleError(_0x3873aa,null));};exports[_0xc39a('0x43')]=function(_0x3291b3,_0x611e28){var _0x20985={'raw':![],'where':{'id':_0x3291b3[_0xc39a('0x44')]['id']}},_0x207676={};_0x207676[_0xc39a('0x33')]=_[_0xc39a('0x2f')](db['ServicenowAccount']['rawAttributes']);_0x207676[_0xc39a('0x2e')]=_[_0xc39a('0x2f')](_0x3291b3[_0xc39a('0x2e')]);_0x207676[_0xc39a('0x30')]=_[_0xc39a('0x32')](_0x207676[_0xc39a('0x33')],_0x207676[_0xc39a('0x2e')]);_0x20985['attributes']=_[_0xc39a('0x32')](_0x207676[_0xc39a('0x33')],qs['fields'](_0x3291b3[_0xc39a('0x2e')][_0xc39a('0x34')]));_0x20985['attributes']=_0x20985['attributes'][_0xc39a('0x35')]?_0x20985['attributes']:_0x207676['model'];if(_0x3291b3[_0xc39a('0x2e')][_0xc39a('0x3f')]){_0x20985[_0xc39a('0x40')]=[{'all':!![]}];}_0x20985=_[_0xc39a('0x3c')]({},_0x20985,_0x3291b3['options']);return db['ServicenowAccount']['find'](_0x20985)['then'](handleEntityNotFound(_0x611e28,null))[_0xc39a('0x25')](respondWithResult(_0x611e28,null))[_0xc39a('0x45')](handleError(_0x611e28,null));};exports[_0xc39a('0x46')]=function(_0x5e7281,_0x1a1769){return db[_0xc39a('0x2a')][_0xc39a('0x46')](_0x5e7281['body'],{})[_0xc39a('0x25')](respondWithResult(_0x1a1769,0xc9))[_0xc39a('0x45')](handleError(_0x1a1769,null));};exports[_0xc39a('0x24')]=function(_0x14766e,_0x247fc3){if(_0x14766e[_0xc39a('0x47')]['id']){delete _0x14766e[_0xc39a('0x47')]['id'];}return db['ServicenowAccount'][_0xc39a('0x48')]({'where':{'id':_0x14766e[_0xc39a('0x44')]['id']}})[_0xc39a('0x25')](handleEntityNotFound(_0x247fc3,null))[_0xc39a('0x25')](saveUpdates(_0x14766e[_0xc39a('0x47')],null))['then'](respondWithResult(_0x247fc3,null))['catch'](handleError(_0x247fc3,null));};exports['destroy']=function(_0x3b59a3,_0x3aa553){return db[_0xc39a('0x2a')]['find']({'where':{'id':_0x3b59a3[_0xc39a('0x44')]['id']}})['then'](handleEntityNotFound(_0x3aa553,null))[_0xc39a('0x25')](removeEntity(_0x3aa553,null))[_0xc39a('0x45')](handleError(_0x3aa553,null));};exports[_0xc39a('0x49')]=function(_0x4144c0,_0x1215e6,_0x201e6a){var _0x5eec08={};var _0x56dd34={};var _0x67d44;var _0x4fc167;return db[_0xc39a('0x2a')][_0xc39a('0x4a')]({'where':{'id':_0x4144c0[_0xc39a('0x44')]['id']}})[_0xc39a('0x25')](handleEntityNotFound(_0x1215e6,null))[_0xc39a('0x25')](function(_0x488fa7){if(_0x488fa7){_0x67d44=_0x488fa7;_0x56dd34[_0xc39a('0x33')]=_[_0xc39a('0x2f')](db[_0xc39a('0x4b')][_0xc39a('0x2b')]);_0x56dd34[_0xc39a('0x2e')]=_[_0xc39a('0x2f')](_0x4144c0['query']);_0x56dd34[_0xc39a('0x30')]=_['intersection'](_0x56dd34[_0xc39a('0x33')],_0x56dd34[_0xc39a('0x2e')]);_0x5eec08[_0xc39a('0x31')]=_[_0xc39a('0x32')](_0x56dd34[_0xc39a('0x33')],qs[_0xc39a('0x34')](_0x4144c0[_0xc39a('0x2e')][_0xc39a('0x34')]));_0x5eec08['attributes']=_0x5eec08[_0xc39a('0x31')][_0xc39a('0x35')]?_0x5eec08['attributes']:_0x56dd34[_0xc39a('0x33')];_0x5eec08[_0xc39a('0x37')]=qs[_0xc39a('0x38')](_0x4144c0[_0xc39a('0x2e')]['sort']);_0x5eec08['where']=qs[_0xc39a('0x30')](_[_0xc39a('0x3a')](_0x4144c0['query'],_0x56dd34[_0xc39a('0x30')]));if(_0x4144c0[_0xc39a('0x2e')][_0xc39a('0x3b')]){_0x5eec08[_0xc39a('0x39')]=_[_0xc39a('0x3c')](_0x5eec08['where'],{'$or':_[_0xc39a('0x4c')](_0x5eec08[_0xc39a('0x31')],function(_0x555ed8){var _0x3a7ef3={};_0x3a7ef3[_0x555ed8]={'$like':'%'+_0x4144c0[_0xc39a('0x2e')]['filter']+'%'};return _0x3a7ef3;})});}_0x5eec08=_['merge']({},_0x5eec08,_0x4144c0[_0xc39a('0x3e')]);return _0x67d44[_0xc39a('0x49')](_0x5eec08);}})[_0xc39a('0x25')](function(_0x59e521){if(_0x59e521){_0x4fc167=_0x59e521['length'];if(!_0x4144c0[_0xc39a('0x2e')][_0xc39a('0x36')](_0xc39a('0x4d'))){_0x5eec08[_0xc39a('0x1f')]=qs['limit'](_0x4144c0[_0xc39a('0x2e')]['limit']);_0x5eec08[_0xc39a('0x1d')]=qs[_0xc39a('0x1d')](_0x4144c0[_0xc39a('0x2e')][_0xc39a('0x1d')]);}return _0x67d44[_0xc39a('0x49')](_0x5eec08);}})[_0xc39a('0x25')](function(_0x1b71e3){if(_0x1b71e3){return _0x1b71e3?{'count':_0x4fc167,'rows':_0x1b71e3}:null;}})[_0xc39a('0x25')](respondWithResult(_0x1215e6,null))[_0xc39a('0x45')](handleError(_0x1215e6,null));};exports[_0xc39a('0x4e')]=function(_0x41da93,_0x549d10,_0x4f069f){if(_0x41da93[_0xc39a('0x47')]['id']){delete _0x41da93['body']['id'];}return db[_0xc39a('0x2a')]['findOne']({'where':{'id':_0x41da93[_0xc39a('0x44')]['id']}})[_0xc39a('0x25')](handleEntityNotFound(_0x549d10,null))[_0xc39a('0x25')](function(_0x2d86cd){if(_0x2d86cd){_0x41da93['body']['AccountId']=_0x2d86cd['id'];_0x41da93['body'][_0xc39a('0x4f')]=integrations[_0xc39a('0x50')](_0x41da93['body'][_0xc39a('0x51')],_0x41da93[_0xc39a('0x47')]['type']);_0x41da93[_0xc39a('0x47')][_0xc39a('0x52')]=integrations['getDescriptions'](_0x41da93['body'][_0xc39a('0x51')],_0x41da93['body'][_0xc39a('0x2c')]);return db[_0xc39a('0x4b')]['create'](_0x41da93[_0xc39a('0x47')],{'include':[{'model':db[_0xc39a('0x53')],'as':'Subjects'},{'model':db[_0xc39a('0x53')],'as':_0xc39a('0x52')}]});}return null;})['then'](respondWithResult(_0x549d10,null))[_0xc39a('0x45')](handleError(_0x549d10,null));};exports['getFields']=function(_0x3017e0,_0x345118,_0x9897cf){var _0x38c49c=[_0xc39a('0x54'),_0xc39a('0x55'),'knowledge',_0xc39a('0x56'),_0xc39a('0x57'),'notify',_0xc39a('0x58'),'severity',_0xc39a('0x59')];var _0x1b09d7=[_0xc39a('0x5a'),_0xc39a('0x54'),'caused_by','watch_list',_0xc39a('0x5b'),_0xc39a('0x5c'),_0xc39a('0x5d'),_0xc39a('0x55'),_0xc39a('0x5e'),_0xc39a('0x5f'),_0xc39a('0x60'),_0xc39a('0x61'),_0xc39a('0x62'),_0xc39a('0x63'),'sys_created_on',_0xc39a('0x64'),'state',_0xc39a('0x65'),_0xc39a('0x66'),_0xc39a('0x37'),_0xc39a('0x67'),_0xc39a('0x68'),_0xc39a('0x69'),_0xc39a('0x6a'),_0xc39a('0x6b'),_0xc39a('0x6c'),_0xc39a('0x6d'),_0xc39a('0x6e'),'priority',_0xc39a('0x6f'),_0xc39a('0x70'),_0xc39a('0x71'),'expected_start',_0xc39a('0x72'),_0xc39a('0x73'),_0xc39a('0x74'),_0xc39a('0x75'),'reopened_time',_0xc39a('0x76'),_0xc39a('0x77'),_0xc39a('0x78'),_0xc39a('0x56'),_0xc39a('0x79'),'short_description',_0xc39a('0x57'),_0xc39a('0x7a'),_0xc39a('0x7b'),_0xc39a('0x7c'),_0xc39a('0x7d'),_0xc39a('0x7e'),'additional_assignee_list',_0xc39a('0x7f'),_0xc39a('0x80'),'notify',_0xc39a('0x81'),_0xc39a('0x82'),_0xc39a('0x83'),_0xc39a('0x84'),'parent_incident',_0xc39a('0x85'),_0xc39a('0x86'),_0xc39a('0x87'),_0xc39a('0x58'),_0xc39a('0x88'),_0xc39a('0x89'),_0xc39a('0x8a'),'reassignment_count',_0xc39a('0x8b'),_0xc39a('0x8c'),'severity',_0xc39a('0x8d'),'sla_due',_0xc39a('0x8e'),_0xc39a('0x8f'),_0xc39a('0x90'),_0xc39a('0x91'),_0xc39a('0x92'),'sys_tags','escalation','upon_approval',_0xc39a('0x93'),_0xc39a('0x94'),_0xc39a('0x59')];var _0x1e2ec8='';var _0x131c9d='';var _0x5080ce=[];var _0x302155='';var _0x4ac05b='';var _0x5553c4=[];var _0x3acd9f='';var _0x56b1f7='';var _0x29c8e9={};var _0x1a4482='';return db[_0xc39a('0x2a')][_0xc39a('0x4a')]({'where':{'id':_0x3017e0['params']['id']},'attributes':['id',_0xc39a('0x95'),_0xc39a('0x96'),'email',_0xc39a('0x97'),_0xc39a('0x98')]})[_0xc39a('0x25')](handleEntityNotFound(_0x345118,null))[_0xc39a('0x25')](function(_0x50d847){if(_0x50d847){_0x1a4482=_0x50d847['remoteUri'];var _0x3dde2d=_0x1a4482['slice'](-0x1);if(_0x3dde2d==='/'){_0x1a4482=_0x1a4482[_0xc39a('0x99')](0x0,_0x1a4482[_0xc39a('0x9a')](_0x3dde2d));}_0x56b1f7=util['format']('%s/api/now/doc/table/schema/',_0x1a4482);_0x3acd9f=util['format'](_0xc39a('0x9b'),_0x1a4482);_0x29c8e9={'user':_0x50d847['username'],'pass':_0x50d847[_0xc39a('0x96')]};var _0x108784={'method':'GET','uri':_0x56b1f7+_0xc39a('0x9c'),'auth':_0x29c8e9,'json':!![]};return rp(_0x108784);}})[_0xc39a('0x25')](function(_0x570fa1){if(_0x570fa1['result'][_0xc39a('0x35')]>0x0){_0x1e2ec8=_0x570fa1[_0xc39a('0x9d')];}console[_0xc39a('0x9e')]('incident\x20table\x20objects',_0x1e2ec8);_0x5553c4=[];_0x131c9d=Object['assign']([],_0x1e2ec8);_[_0xc39a('0x9f')](_0x131c9d,function(_0x1f8a54){return!_0x38c49c['includes'](_0x1f8a54[_0xc39a('0x28')]);});_0x131c9d[_0xc39a('0xa0')](function(_0x404031){var _0x30af2f=createFieldObject(_0x3acd9f,_0x29c8e9,_0x404031[_0xc39a('0xa1')],_0x404031[_0xc39a('0x28')],_0x404031[_0xc39a('0xa2')],![]);_0x5553c4[_0xc39a('0xa3')](_0x30af2f);});return Promise[_0xc39a('0xa4')](_0x5553c4);})['then'](function(_0x5613c1){_0x5080ce=_0x5613c1;_0x302155=Object['assign']([],_0x1e2ec8);console[_0xc39a('0x9e')](_0xc39a('0xa5'),_0x1e2ec8);_[_0xc39a('0x9f')](_0x302155,function(_0x3d0d78){return _0x1b09d7[_0xc39a('0xa6')](_0x3d0d78[_0xc39a('0x28')]);});console[_0xc39a('0x9e')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x302155);_0x5553c4=[];_0x302155[_0xc39a('0xa0')](function(_0x5b4347){var _0x4af095=createFieldObject(_0x3acd9f,_0x29c8e9,_0x5b4347[_0xc39a('0xa1')],_0x5b4347['name'],_0x5b4347[_0xc39a('0xa2')],!![]);_0x5553c4[_0xc39a('0xa3')](_0x4af095);});return Promise['all'](_0x5553c4);})['then'](function(_0x51e56c){_0x4ac05b=_0x51e56c;var _0x570ab3=_0x5080ce[_0xc39a('0xa7')](_0x4ac05b);return{'count':_0x570ab3[_0xc39a('0x35')],'rows':_0x570ab3};})[_0xc39a('0x25')](respondWithResult(_0x345118,null))[_0xc39a('0x45')](function(_0xaba8e1){console[_0xc39a('0x9e')](_0xc39a('0xa8')+_0xaba8e1);var _0xcddfcc=_0x3017e0[_0xc39a('0x2e')]['test']?0x1f4:_0xaba8e1[_0xc39a('0xa9')]||0x1f4;logger[_0xc39a('0x26')](_0xaba8e1[_0xc39a('0x27')]);delete _0xaba8e1[_0xc39a('0x28')];if(_0xcddfcc===0x191){_0xcddfcc=0x190;}_0x345118['status'](_0xcddfcc)[_0xc39a('0xaa')](_0x3017e0[_0xc39a('0x2e')]['test']?{'message':_0xc39a('0xab'),'statusCode':_0xaba8e1[_0xc39a('0xa9')]}:_0xaba8e1);});};function createFieldObject(_0x1b1cc2,_0x3d4448,_0x31b854,_0x2bb8ed,_0x159e40,_0x20ec6a){return new Promise(function(_0x2e07a1,_0x2098c3){var _0x49ade2={'id':_0x2bb8ed,'name':_0x159e40,'custom':_0x20ec6a};if(_0x31b854==='boolean'){_0x49ade2[_0xc39a('0x3e')]=[{'name':'True','value':_0xc39a('0xac')},{'name':_0xc39a('0xad'),'value':_0xc39a('0xae')}];_0x2e07a1(_0x49ade2);}else{var _0x239d31={'method':_0xc39a('0xaf'),'uri':_0x1b1cc2+_0xc39a('0xb0')+_0x2bb8ed,'auth':_0x3d4448,'json':!![]};return rp(_0x239d31)[_0xc39a('0x25')](function(_0x2ce6d3){var _0x44a5dc=[];if(_0x2ce6d3['result'][_0xc39a('0x35')]>0x0){_0x2ce6d3[_0xc39a('0x9d')][_0xc39a('0xa0')](function(_0xbb551f){if(_0xbb551f['inactive']==='false'){var _0x510674={'name':_0xbb551f[_0xc39a('0xa2')],'value':_0xbb551f[_0xc39a('0xb1')]};_0x44a5dc['push'](_0x510674);}});}_0x49ade2[_0xc39a('0x3e')]=_0x44a5dc;if(_0x49ade2[_0xc39a('0x3e')]['length']>0x0){_0x2e07a1(_0x49ade2);}else{if(_0x20ec6a==![]){_0x2e07a1();}else{_0x2e07a1(_0x49ade2);}}});}});} \ No newline at end of file +var _0xc4c2=['subcategory','close_code','notify','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','opened_by','user_input','sys_domain','calendar_stc','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','sys_id','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','username','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','ServicenowConfiguration','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','getDescriptions','channel','ServicenowField','Descriptions','knowledge'];(function(_0x335f21,_0x43fcbb){var _0x3db1f3=function(_0x1179f8){while(--_0x1179f8){_0x335f21['push'](_0x335f21['shift']());}};_0x3db1f3(++_0x43fcbb);}(_0xc4c2,0x64));var _0x2c4c=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xc4c2[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require(_0x2c4c('0x0'));var rimraf=require(_0x2c4c('0x1'));var zipdir=require(_0x2c4c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c4c('0x3'));var moment=require(_0x2c4c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2c4c('0x5'));var path=require(_0x2c4c('0x6'));var sox=require(_0x2c4c('0x7'));var csv=require('to-csv');var ejs=require(_0x2c4c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c4c('0x9'));var squel=require(_0x2c4c('0xa'));var crypto=require('crypto');var jsforce=require(_0x2c4c('0xb'));var deskjs=require(_0x2c4c('0xc'));var toCsv=require(_0x2c4c('0xd'));var querystring=require(_0x2c4c('0xe'));var Papa=require(_0x2c4c('0xf'));var Redis=require(_0x2c4c('0x10'));var authService=require(_0x2c4c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2c4c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c4c('0x13'))(_0x2c4c('0x14'));var utils=require(_0x2c4c('0x15'));var config=require(_0x2c4c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c4c('0x17'))['db'];var integrations=require(_0x2c4c('0x18'));function respondWithStatusCode(_0x4aa296,_0x10f622){_0x10f622=_0x10f622||0xcc;return function(_0xf4785d){if(_0xf4785d){return _0x4aa296[_0x2c4c('0x19')](_0x10f622);}return _0x4aa296['status'](_0x10f622)[_0x2c4c('0x1a')]();};}function respondWithResult(_0x35cf60,_0x3302da){_0x3302da=_0x3302da||0xc8;return function(_0x560941){if(_0x560941){return _0x35cf60[_0x2c4c('0x1b')](_0x3302da)[_0x2c4c('0x1c')](_0x560941);}};}function respondWithFilteredResult(_0x11f391,_0xfd14cb){return function(_0xce3d30){if(_0xce3d30){var _0x491ae0=typeof _0xfd14cb[_0x2c4c('0x1d')]===_0x2c4c('0x1e')&&typeof _0xfd14cb['limit']===_0x2c4c('0x1e');var _0x89ec9d=_0xce3d30[_0x2c4c('0x1f')];var _0x1766cf=_0x491ae0?0x0:_0xfd14cb[_0x2c4c('0x1d')];var _0x28cd3a=_0x491ae0?_0xce3d30[_0x2c4c('0x1f')]:_0xfd14cb[_0x2c4c('0x1d')]+_0xfd14cb[_0x2c4c('0x20')];var _0x4eb2b1;if(_0x28cd3a>=_0x89ec9d){_0x28cd3a=_0x89ec9d;_0x4eb2b1=0xc8;}else{_0x4eb2b1=0xce;}_0x11f391['status'](_0x4eb2b1);return _0x11f391[_0x2c4c('0x21')](_0x2c4c('0x22'),_0x1766cf+'-'+_0x28cd3a+'/'+_0x89ec9d)[_0x2c4c('0x1c')](_0xce3d30);}return null;};}function patchUpdates(_0x49592b){return function(_0x1d28ad){try{jsonpatch['apply'](_0x1d28ad,_0x49592b,!![]);}catch(_0x134e20){return BPromise['reject'](_0x134e20);}return _0x1d28ad['save']();};}function saveUpdates(_0x3401ce,_0x7a9675){return function(_0xb7901c){if(_0xb7901c){return _0xb7901c[_0x2c4c('0x23')](_0x3401ce)[_0x2c4c('0x24')](function(_0x5c9a11){return _0x5c9a11;});}return null;};}function removeEntity(_0x1269a9,_0x1059e7){return function(_0xa15156){if(_0xa15156){return _0xa15156[_0x2c4c('0x25')]()[_0x2c4c('0x24')](function(){_0x1269a9[_0x2c4c('0x1b')](0xcc)[_0x2c4c('0x1a')]();});}};}function handleEntityNotFound(_0x3cf418,_0x24a9a8){return function(_0x346cd3){if(!_0x346cd3){_0x3cf418[_0x2c4c('0x19')](0x194);}return _0x346cd3;};}function handleError(_0x30cb60,_0x4466e7){_0x4466e7=_0x4466e7||0x1f4;return function(_0x3a2803){logger[_0x2c4c('0x26')](_0x3a2803[_0x2c4c('0x27')]);if(_0x3a2803[_0x2c4c('0x28')]){delete _0x3a2803[_0x2c4c('0x28')];}_0x30cb60[_0x2c4c('0x1b')](_0x4466e7)[_0x2c4c('0x29')](_0x3a2803);};}exports[_0x2c4c('0x2a')]=function(_0x25484b,_0x1d9e7a){var _0x159ae2={},_0x5d8e19={},_0x4c16ae={'count':0x0,'rows':[]};var _0x401c29=_[_0x2c4c('0x2b')](db[_0x2c4c('0x2c')]['rawAttributes'],function(_0x43b0e7){return{'name':_0x43b0e7[_0x2c4c('0x2d')],'type':_0x43b0e7['type'][_0x2c4c('0x2e')]};});_0x5d8e19[_0x2c4c('0x2f')]=_[_0x2c4c('0x2b')](_0x401c29,_0x2c4c('0x28'));_0x5d8e19['query']=_[_0x2c4c('0x30')](_0x25484b[_0x2c4c('0x31')]);_0x5d8e19[_0x2c4c('0x32')]=_['intersection'](_0x5d8e19[_0x2c4c('0x2f')],_0x5d8e19[_0x2c4c('0x31')]);_0x159ae2[_0x2c4c('0x33')]=_[_0x2c4c('0x34')](_0x5d8e19['model'],qs[_0x2c4c('0x35')](_0x25484b[_0x2c4c('0x31')][_0x2c4c('0x35')]));_0x159ae2['attributes']=_0x159ae2[_0x2c4c('0x33')][_0x2c4c('0x36')]?_0x159ae2['attributes']:_0x5d8e19[_0x2c4c('0x2f')];if(!_0x25484b['query'][_0x2c4c('0x37')]('nolimit')){_0x159ae2[_0x2c4c('0x20')]=qs[_0x2c4c('0x20')](_0x25484b[_0x2c4c('0x31')][_0x2c4c('0x20')]);_0x159ae2[_0x2c4c('0x1d')]=qs['offset'](_0x25484b[_0x2c4c('0x31')]['offset']);}_0x159ae2[_0x2c4c('0x38')]=qs[_0x2c4c('0x39')](_0x25484b[_0x2c4c('0x31')]['sort']);_0x159ae2[_0x2c4c('0x3a')]=qs[_0x2c4c('0x32')](_[_0x2c4c('0x3b')](_0x25484b['query'],_0x5d8e19[_0x2c4c('0x32')]),_0x401c29);if(_0x25484b[_0x2c4c('0x31')][_0x2c4c('0x3c')]){_0x159ae2[_0x2c4c('0x3a')]=_[_0x2c4c('0x3d')](_0x159ae2[_0x2c4c('0x3a')],{'$or':_[_0x2c4c('0x2b')](_0x401c29,function(_0x3b450e){if(_0x3b450e[_0x2c4c('0x3e')]!==_0x2c4c('0x3f')){var _0x24773b={};_0x24773b[_0x3b450e[_0x2c4c('0x28')]]={'$like':'%'+_0x25484b['query'][_0x2c4c('0x3c')]+'%'};return _0x24773b;}})});}_0x159ae2=_[_0x2c4c('0x3d')]({},_0x159ae2,_0x25484b[_0x2c4c('0x40')]);var _0x358e5a={'where':_0x159ae2['where']};return db[_0x2c4c('0x2c')][_0x2c4c('0x1f')](_0x358e5a)['then'](function(_0x16edd0){_0x4c16ae[_0x2c4c('0x1f')]=_0x16edd0;if(_0x25484b['query'][_0x2c4c('0x41')]){_0x159ae2[_0x2c4c('0x42')]=[{'all':!![]}];}return db[_0x2c4c('0x2c')][_0x2c4c('0x43')](_0x159ae2);})[_0x2c4c('0x24')](function(_0x1c5e2a){_0x4c16ae[_0x2c4c('0x44')]=_0x1c5e2a;return _0x4c16ae;})[_0x2c4c('0x24')](respondWithFilteredResult(_0x1d9e7a,_0x159ae2))[_0x2c4c('0x45')](handleError(_0x1d9e7a,null));};exports[_0x2c4c('0x46')]=function(_0x3d898b,_0x3d9c67){var _0x5189b4={'raw':![],'where':{'id':_0x3d898b[_0x2c4c('0x47')]['id']}},_0x62fa5b={};_0x62fa5b[_0x2c4c('0x2f')]=_[_0x2c4c('0x30')](db['ServicenowAccount'][_0x2c4c('0x48')]);_0x62fa5b[_0x2c4c('0x31')]=_[_0x2c4c('0x30')](_0x3d898b['query']);_0x62fa5b['filters']=_[_0x2c4c('0x34')](_0x62fa5b[_0x2c4c('0x2f')],_0x62fa5b['query']);_0x5189b4['attributes']=_[_0x2c4c('0x34')](_0x62fa5b['model'],qs[_0x2c4c('0x35')](_0x3d898b[_0x2c4c('0x31')][_0x2c4c('0x35')]));_0x5189b4[_0x2c4c('0x33')]=_0x5189b4['attributes'][_0x2c4c('0x36')]?_0x5189b4[_0x2c4c('0x33')]:_0x62fa5b[_0x2c4c('0x2f')];if(_0x3d898b['query']['includeAll']){_0x5189b4[_0x2c4c('0x42')]=[{'all':!![]}];}_0x5189b4=_[_0x2c4c('0x3d')]({},_0x5189b4,_0x3d898b[_0x2c4c('0x40')]);return db[_0x2c4c('0x2c')][_0x2c4c('0x49')](_0x5189b4)['then'](handleEntityNotFound(_0x3d9c67,null))['then'](respondWithResult(_0x3d9c67,null))[_0x2c4c('0x45')](handleError(_0x3d9c67,null));};exports[_0x2c4c('0x4a')]=function(_0x36174a,_0x20ee77){return db[_0x2c4c('0x2c')][_0x2c4c('0x4a')](_0x36174a[_0x2c4c('0x4b')],{})['then'](respondWithResult(_0x20ee77,0xc9))['catch'](handleError(_0x20ee77,null));};exports[_0x2c4c('0x23')]=function(_0x2506e0,_0x515ef0){if(_0x2506e0[_0x2c4c('0x4b')]['id']){delete _0x2506e0[_0x2c4c('0x4b')]['id'];}return db[_0x2c4c('0x2c')]['find']({'where':{'id':_0x2506e0[_0x2c4c('0x47')]['id']}})[_0x2c4c('0x24')](handleEntityNotFound(_0x515ef0,null))[_0x2c4c('0x24')](saveUpdates(_0x2506e0['body'],null))[_0x2c4c('0x24')](respondWithResult(_0x515ef0,null))[_0x2c4c('0x45')](handleError(_0x515ef0,null));};exports[_0x2c4c('0x25')]=function(_0xfcc86f,_0x297ddd){return db[_0x2c4c('0x2c')][_0x2c4c('0x49')]({'where':{'id':_0xfcc86f['params']['id']}})[_0x2c4c('0x24')](handleEntityNotFound(_0x297ddd,null))['then'](removeEntity(_0x297ddd,null))[_0x2c4c('0x45')](handleError(_0x297ddd,null));};exports[_0x2c4c('0x4c')]=function(_0x27b46b,_0x2bdf49,_0xb5e13d){var _0x24f424={};var _0x4a0baa={};var _0x3fe41e;var _0x8190bd;return db[_0x2c4c('0x2c')]['findOne']({'where':{'id':_0x27b46b[_0x2c4c('0x47')]['id']}})[_0x2c4c('0x24')](handleEntityNotFound(_0x2bdf49,null))[_0x2c4c('0x24')](function(_0x22b537){if(_0x22b537){_0x3fe41e=_0x22b537;_0x4a0baa['model']=_[_0x2c4c('0x30')](db[_0x2c4c('0x4d')][_0x2c4c('0x48')]);_0x4a0baa[_0x2c4c('0x31')]=_[_0x2c4c('0x30')](_0x27b46b[_0x2c4c('0x31')]);_0x4a0baa['filters']=_[_0x2c4c('0x34')](_0x4a0baa[_0x2c4c('0x2f')],_0x4a0baa[_0x2c4c('0x31')]);_0x24f424[_0x2c4c('0x33')]=_[_0x2c4c('0x34')](_0x4a0baa[_0x2c4c('0x2f')],qs[_0x2c4c('0x35')](_0x27b46b['query'][_0x2c4c('0x35')]));_0x24f424[_0x2c4c('0x33')]=_0x24f424[_0x2c4c('0x33')][_0x2c4c('0x36')]?_0x24f424[_0x2c4c('0x33')]:_0x4a0baa['model'];_0x24f424[_0x2c4c('0x38')]=qs[_0x2c4c('0x39')](_0x27b46b[_0x2c4c('0x31')][_0x2c4c('0x39')]);_0x24f424[_0x2c4c('0x3a')]=qs[_0x2c4c('0x32')](_[_0x2c4c('0x3b')](_0x27b46b['query'],_0x4a0baa[_0x2c4c('0x32')]));if(_0x27b46b[_0x2c4c('0x31')][_0x2c4c('0x3c')]){_0x24f424[_0x2c4c('0x3a')]=_['merge'](_0x24f424['where'],{'$or':_[_0x2c4c('0x2b')](_0x24f424[_0x2c4c('0x33')],function(_0xa46830){var _0x34fa57={};_0x34fa57[_0xa46830]={'$like':'%'+_0x27b46b['query'][_0x2c4c('0x3c')]+'%'};return _0x34fa57;})});}_0x24f424=_[_0x2c4c('0x3d')]({},_0x24f424,_0x27b46b[_0x2c4c('0x40')]);return _0x3fe41e[_0x2c4c('0x4c')](_0x24f424);}})['then'](function(_0x5c1426){if(_0x5c1426){_0x8190bd=_0x5c1426[_0x2c4c('0x36')];if(!_0x27b46b[_0x2c4c('0x31')][_0x2c4c('0x37')](_0x2c4c('0x4e'))){_0x24f424['limit']=qs[_0x2c4c('0x20')](_0x27b46b[_0x2c4c('0x31')]['limit']);_0x24f424[_0x2c4c('0x1d')]=qs[_0x2c4c('0x1d')](_0x27b46b['query'][_0x2c4c('0x1d')]);}return _0x3fe41e[_0x2c4c('0x4c')](_0x24f424);}})[_0x2c4c('0x24')](function(_0x15a94f){if(_0x15a94f){return _0x15a94f?{'count':_0x8190bd,'rows':_0x15a94f}:null;}})[_0x2c4c('0x24')](respondWithResult(_0x2bdf49,null))[_0x2c4c('0x45')](handleError(_0x2bdf49,null));};exports[_0x2c4c('0x4f')]=function(_0x56179d,_0x573c73,_0x30d9e7){if(_0x56179d[_0x2c4c('0x4b')]['id']){delete _0x56179d['body']['id'];}return db[_0x2c4c('0x2c')][_0x2c4c('0x50')]({'where':{'id':_0x56179d[_0x2c4c('0x47')]['id']}})[_0x2c4c('0x24')](handleEntityNotFound(_0x573c73,null))[_0x2c4c('0x24')](function(_0x7576d5){if(_0x7576d5){_0x56179d['body'][_0x2c4c('0x51')]=_0x7576d5['id'];_0x56179d[_0x2c4c('0x4b')][_0x2c4c('0x52')]=integrations[_0x2c4c('0x53')](_0x56179d[_0x2c4c('0x4b')]['channel'],_0x56179d[_0x2c4c('0x4b')]['type']);_0x56179d[_0x2c4c('0x4b')]['Descriptions']=integrations[_0x2c4c('0x54')](_0x56179d[_0x2c4c('0x4b')][_0x2c4c('0x55')],_0x56179d[_0x2c4c('0x4b')][_0x2c4c('0x3e')]);return db[_0x2c4c('0x4d')][_0x2c4c('0x4a')](_0x56179d[_0x2c4c('0x4b')],{'include':[{'model':db[_0x2c4c('0x56')],'as':_0x2c4c('0x52')},{'model':db[_0x2c4c('0x56')],'as':_0x2c4c('0x57')}]});}return null;})[_0x2c4c('0x24')](respondWithResult(_0x573c73,null))[_0x2c4c('0x45')](handleError(_0x573c73,null));};exports['getFields']=function(_0x3dc335,_0x4cfb5f,_0x1d825f){var _0xad01d=['made_sla','hold_reason',_0x2c4c('0x58'),_0x2c4c('0x59'),_0x2c4c('0x5a'),_0x2c4c('0x5b'),'incident_state',_0x2c4c('0x5c'),_0x2c4c('0x5d')];var _0x95c89d=[_0x2c4c('0x5e'),_0x2c4c('0x5f'),_0x2c4c('0x60'),_0x2c4c('0x61'),_0x2c4c('0x62'),_0x2c4c('0x63'),_0x2c4c('0x64'),_0x2c4c('0x65'),_0x2c4c('0x66'),_0x2c4c('0x67'),'resolved_by','sys_updated_by',_0x2c4c('0x68'),_0x2c4c('0x69'),'sys_created_on',_0x2c4c('0x6a'),'state','sys_created_by',_0x2c4c('0x58'),_0x2c4c('0x38'),_0x2c4c('0x6b'),'closed_at','cmdb_ci',_0x2c4c('0x6c'),_0x2c4c('0x6d'),_0x2c4c('0x6e'),_0x2c4c('0x6f'),_0x2c4c('0x70'),_0x2c4c('0x71'),_0x2c4c('0x72'),_0x2c4c('0x73'),_0x2c4c('0x74'),'expected_start',_0x2c4c('0x75'),_0x2c4c('0x76'),_0x2c4c('0x77'),_0x2c4c('0x78'),_0x2c4c('0x79'),_0x2c4c('0x7a'),_0x2c4c('0x7b'),_0x2c4c('0x7c'),_0x2c4c('0x59'),_0x2c4c('0x7d'),_0x2c4c('0x7e'),_0x2c4c('0x5a'),_0x2c4c('0x7f'),_0x2c4c('0x80'),'work_start',_0x2c4c('0x81'),_0x2c4c('0x82'),_0x2c4c('0x83'),_0x2c4c('0x84'),'calendar_duration',_0x2c4c('0x5b'),_0x2c4c('0x85'),_0x2c4c('0x86'),_0x2c4c('0x87'),_0x2c4c('0x88'),'parent_incident',_0x2c4c('0x89'),'contact_type',_0x2c4c('0x8a'),_0x2c4c('0x8b'),_0x2c4c('0x8c'),_0x2c4c('0x8d'),_0x2c4c('0x8e'),_0x2c4c('0x8f'),_0x2c4c('0x90'),_0x2c4c('0x91'),_0x2c4c('0x5c'),_0x2c4c('0x92'),'sla_due',_0x2c4c('0x93'),_0x2c4c('0x94'),_0x2c4c('0x95'),_0x2c4c('0x96'),_0x2c4c('0x97'),_0x2c4c('0x98'),_0x2c4c('0x99'),_0x2c4c('0x9a'),'correlation_id','location','category'];var _0x12625e='';var _0x478524='';var _0x407def=[];var _0x4c3fc6='';var _0x413d1a='';var _0x6713c2=[];var _0x4a1312='';var _0xf93021='';var _0x283197={};var _0x140f38='';return db[_0x2c4c('0x2c')]['findOne']({'where':{'id':_0x3dc335[_0x2c4c('0x47')]['id']},'attributes':['id',_0x2c4c('0x9b'),'password',_0x2c4c('0x9c'),_0x2c4c('0x9d'),_0x2c4c('0x9e')]})['then'](handleEntityNotFound(_0x4cfb5f,null))[_0x2c4c('0x24')](function(_0xb88972){if(_0xb88972){_0x140f38=_0xb88972[_0x2c4c('0x9d')];var _0x1d661d=_0x140f38[_0x2c4c('0x9f')](-0x1);if(_0x1d661d==='/'){_0x140f38=_0x140f38[_0x2c4c('0xa0')](0x0,_0x140f38[_0x2c4c('0xa1')](_0x1d661d));}_0xf93021=util[_0x2c4c('0xa2')]('%s/api/now/doc/table/schema/',_0x140f38);_0x4a1312=util[_0x2c4c('0xa2')](_0x2c4c('0xa3'),_0x140f38);_0x283197={'user':_0xb88972[_0x2c4c('0x9b')],'pass':_0xb88972[_0x2c4c('0xa4')]};var _0x53c451={'method':_0x2c4c('0xa5'),'uri':_0xf93021+_0x2c4c('0xa6'),'auth':_0x283197,'json':!![]};return rp(_0x53c451);}})[_0x2c4c('0x24')](function(_0x5839ea){if(_0x5839ea['result'][_0x2c4c('0x36')]>0x0){_0x12625e=_0x5839ea['result'];}console[_0x2c4c('0xa7')](_0x2c4c('0xa8'),_0x12625e);_0x6713c2=[];_0x478524=Object[_0x2c4c('0xa9')]([],_0x12625e);_[_0x2c4c('0xaa')](_0x478524,function(_0x10a550){return!_0xad01d[_0x2c4c('0xab')](_0x10a550[_0x2c4c('0x28')]);});_0x478524['forEach'](function(_0x5cce8f){var _0x89f6ff=createFieldObject(_0x4a1312,_0x283197,_0x5cce8f[_0x2c4c('0xac')],_0x5cce8f['name'],_0x5cce8f[_0x2c4c('0xad')],![]);_0x6713c2[_0x2c4c('0xae')](_0x89f6ff);});return Promise['all'](_0x6713c2);})[_0x2c4c('0x24')](function(_0x4bb611){_0x407def=_0x4bb611;_0x4c3fc6=Object[_0x2c4c('0xa9')]([],_0x12625e);console[_0x2c4c('0xa7')](_0x2c4c('0xaf'),_0x12625e);_['remove'](_0x4c3fc6,function(_0x223042){return _0x95c89d[_0x2c4c('0xab')](_0x223042[_0x2c4c('0x28')]);});console['log'](_0x2c4c('0xb0'),_0x4c3fc6);_0x6713c2=[];_0x4c3fc6[_0x2c4c('0xb1')](function(_0x733bc4){var _0x8eb594=createFieldObject(_0x4a1312,_0x283197,_0x733bc4[_0x2c4c('0xac')],_0x733bc4[_0x2c4c('0x28')],_0x733bc4[_0x2c4c('0xad')],!![]);_0x6713c2[_0x2c4c('0xae')](_0x8eb594);});return Promise['all'](_0x6713c2);})[_0x2c4c('0x24')](function(_0x569952){_0x413d1a=_0x569952;var _0x3cdbaf=_0x407def[_0x2c4c('0xb2')](_0x413d1a);return{'count':_0x3cdbaf[_0x2c4c('0x36')],'rows':_0x3cdbaf};})['then'](respondWithResult(_0x4cfb5f,null))['catch'](function(_0x65f58b){console[_0x2c4c('0xa7')]('ServiceNow\x20error:\x20'+_0x65f58b);var _0x3ec606=_0x3dc335[_0x2c4c('0x31')][_0x2c4c('0xb3')]?0x1f4:_0x65f58b[_0x2c4c('0xb4')]||0x1f4;logger[_0x2c4c('0x26')](_0x65f58b[_0x2c4c('0x27')]);delete _0x65f58b[_0x2c4c('0x28')];if(_0x3ec606===0x191){_0x3ec606=0x190;}_0x4cfb5f[_0x2c4c('0x1b')](_0x3ec606)[_0x2c4c('0x29')](_0x3dc335[_0x2c4c('0x31')][_0x2c4c('0xb3')]?{'message':_0x2c4c('0xb5'),'statusCode':_0x65f58b['statusCode']}:_0x65f58b);});};function createFieldObject(_0x4b613e,_0x985e14,_0x450dc8,_0x57b091,_0x47553b,_0xc4b407){return new Promise(function(_0x4bbb07,_0x30a226){var _0x207caf={'id':_0x57b091,'name':_0x47553b,'custom':_0xc4b407};if(_0x450dc8===_0x2c4c('0xb6')){_0x207caf[_0x2c4c('0x40')]=[{'name':_0x2c4c('0xb7'),'value':_0x2c4c('0xb8')},{'name':_0x2c4c('0xb9'),'value':_0x2c4c('0xba')}];_0x4bbb07(_0x207caf);}else{var _0x5b82f6={'method':_0x2c4c('0xa5'),'uri':_0x4b613e+_0x2c4c('0xbb')+_0x57b091,'auth':_0x985e14,'json':!![]};return rp(_0x5b82f6)[_0x2c4c('0x24')](function(_0x56afa4){var _0x851d76=[];if(_0x56afa4['result']['length']>0x0){_0x56afa4['result'][_0x2c4c('0xb1')](function(_0x5bf988){if(_0x5bf988[_0x2c4c('0xbc')]===_0x2c4c('0xba')){var _0x51cb3d={'name':_0x5bf988['label'],'value':_0x5bf988['value']};_0x851d76[_0x2c4c('0xae')](_0x51cb3d);}});}_0x207caf['options']=_0x851d76;if(_0x207caf[_0x2c4c('0x40')][_0x2c4c('0x36')]>0x0){_0x4bbb07(_0x207caf);}else{if(_0xc4b407==![]){_0x4bbb07();}else{_0x4bbb07(_0x207caf);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 25e42d0..76c22a9 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util'];(function(_0x568a61,_0x2124f8){var _0x334c3b=function(_0x1afc39){while(--_0x1afc39){_0x568a61['push'](_0x568a61['shift']());}};_0x334c3b(++_0x2124f8);}(_0x7a54,0x106));var _0x47a5=function(_0x5d57bc,_0x41c13c){_0x5d57bc=_0x5d57bc-0x0;var _0x5b63bf=_0x7a54[_0x5d57bc];return _0x5b63bf;};'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'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46ed=['bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util','api','moment'];(function(_0x302301,_0x1ad4fd){var _0x49c175=function(_0x1f9d2b){while(--_0x1f9d2b){_0x302301['push'](_0x302301['shift']());}};_0x49c175(++_0x1ad4fd);}(_0x46ed,0x168));var _0xd46e=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x46ed[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));var integrations=require(_0xd46e('0x8'));module[_0xd46e('0x9')]=function(_0x25cf78,_0x45e680){return _0x25cf78[_0xd46e('0xa')](_0xd46e('0xb'),attributes,{'tableName':_0xd46e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 882a0eb..042e2f3 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 _0x1f99=['result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','stringify','ShowServicenowAccount','ServicenowAccount','find','lodash','moment','bluebird','../../config/logger','rpc','../../config/environment','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x45500d,_0x28f732){var _0x4171d4=function(_0x311a6f){while(--_0x311a6f){_0x45500d['push'](_0x45500d['shift']());}};_0x4171d4(++_0x28f732);}(_0x1f99,0x70));var _0x91f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f99[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x91f9('0x0'));var util=require('util');var moment=require(_0x91f9('0x1'));var BPromise=require(_0x91f9('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(_0x91f9('0x3'))(_0x91f9('0x4'));var config=require(_0x91f9('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36f55b,_0x18d531,_0x23faac){return new BPromise(function(_0x1c292f,_0x40954a){return client[_0x91f9('0x6')](_0x36f55b,_0x23faac)[_0x91f9('0x7')](function(_0x2bcbdd){logger[_0x91f9('0x8')](_0x91f9('0x9'),_0x18d531,_0x91f9('0xa'));logger[_0x91f9('0xb')](_0x91f9('0xc'),_0x18d531,'request\x20sent',JSON['stringify'](_0x2bcbdd));if(_0x2bcbdd[_0x91f9('0xd')]){if(_0x2bcbdd[_0x91f9('0xd')][_0x91f9('0xe')]===0x1f4){logger[_0x91f9('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x18d531,_0x2bcbdd[_0x91f9('0xd')][_0x91f9('0xf')]);return _0x40954a(_0x2bcbdd['error']['message']);}logger[_0x91f9('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x18d531,_0x2bcbdd[_0x91f9('0xd')]['message']);return _0x1c292f(_0x2bcbdd['error'][_0x91f9('0xf')]);}else{logger[_0x91f9('0x8')](_0x91f9('0x9'),_0x18d531,_0x91f9('0xa'));_0x1c292f(_0x2bcbdd[_0x91f9('0x10')]['message']);}})[_0x91f9('0x11')](function(_0x446176){logger[_0x91f9('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x18d531,_0x446176);_0x40954a(_0x446176);});});}exports['GetServicenowAccount']=function(_0x4dc2ef){var _0x87259b=this;return new Promise(function(_0x1afad1,_0x54bc87){return db['ServicenowAccount'][_0x91f9('0x12')]({'raw':_0x4dc2ef[_0x91f9('0x13')]?_0x4dc2ef[_0x91f9('0x13')][_0x91f9('0x14')]===undefined?!![]:![]:!![],'where':_0x4dc2ef[_0x91f9('0x13')]?_0x4dc2ef[_0x91f9('0x13')][_0x91f9('0x15')]||null:null,'attributes':_0x4dc2ef[_0x91f9('0x13')]?_0x4dc2ef[_0x91f9('0x13')][_0x91f9('0x16')]||null:null,'limit':_0x4dc2ef[_0x91f9('0x13')]?_0x4dc2ef[_0x91f9('0x13')][_0x91f9('0x17')]||null:null,'include':_0x4dc2ef[_0x91f9('0x13')]?_0x4dc2ef[_0x91f9('0x13')][_0x91f9('0x18')]?_[_0x91f9('0x19')](_0x4dc2ef[_0x91f9('0x13')][_0x91f9('0x18')],function(_0x3ca44f){return{'model':db[_0x3ca44f['model']],'as':_0x3ca44f['as'],'attributes':_0x3ca44f['attributes'],'include':_0x3ca44f[_0x91f9('0x18')]?_['map'](_0x3ca44f[_0x91f9('0x18')],function(_0x4fd7a0){return{'model':db[_0x4fd7a0[_0x91f9('0x1a')]],'as':_0x4fd7a0['as'],'attributes':_0x4fd7a0['attributes'],'include':_0x4fd7a0[_0x91f9('0x18')]?_[_0x91f9('0x19')](_0x4fd7a0[_0x91f9('0x18')],function(_0x58b7e6){return{'model':db[_0x58b7e6[_0x91f9('0x1a')]],'as':_0x58b7e6['as'],'attributes':_0x58b7e6[_0x91f9('0x16')]};}):[]};}):[]};}):[]:[]})[_0x91f9('0x7')](function(_0x5193e5){logger[_0x91f9('0x8')](_0x91f9('0x1b'),_0x4dc2ef);logger['debug'](_0x91f9('0x1b'),_0x4dc2ef,JSON[_0x91f9('0x1c')](_0x5193e5));_0x1afad1(_0x5193e5);})[_0x91f9('0x11')](function(_0x181a52){logger[_0x91f9('0xd')](_0x91f9('0x1b'),_0x181a52[_0x91f9('0xf')],_0x4dc2ef);_0x54bc87(_0x87259b['error'](0x1f4,_0x181a52[_0x91f9('0xf')]));});});};exports[_0x91f9('0x1d')]=function(_0x34af17){var _0x148fd3=this;return new Promise(function(_0x250cdc,_0xb701f1){return db[_0x91f9('0x1e')][_0x91f9('0x1f')]({'raw':_0x34af17[_0x91f9('0x13')]?_0x34af17[_0x91f9('0x13')][_0x91f9('0x14')]===undefined?!![]:![]:!![],'where':_0x34af17[_0x91f9('0x13')]?_0x34af17[_0x91f9('0x13')][_0x91f9('0x15')]||null:null,'attributes':_0x34af17[_0x91f9('0x13')]?_0x34af17[_0x91f9('0x13')][_0x91f9('0x16')]||null:null,'include':_0x34af17['options']?_0x34af17[_0x91f9('0x13')][_0x91f9('0x18')]?_['map'](_0x34af17[_0x91f9('0x13')]['include'],function(_0x538f49){return{'model':db[_0x538f49[_0x91f9('0x1a')]],'as':_0x538f49['as'],'attributes':_0x538f49[_0x91f9('0x16')],'include':_0x538f49[_0x91f9('0x18')]?_[_0x91f9('0x19')](_0x538f49[_0x91f9('0x18')],function(_0x54e54a){return{'model':db[_0x54e54a[_0x91f9('0x1a')]],'as':_0x54e54a['as'],'attributes':_0x54e54a[_0x91f9('0x16')],'include':_0x54e54a[_0x91f9('0x18')]?_['map'](_0x54e54a[_0x91f9('0x18')],function(_0x3c1617){return{'model':db[_0x3c1617[_0x91f9('0x1a')]],'as':_0x3c1617['as'],'attributes':_0x3c1617[_0x91f9('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd74b37){logger[_0x91f9('0x8')](_0x91f9('0x1d'),_0x34af17);logger[_0x91f9('0xb')](_0x91f9('0x1d'),_0x34af17,JSON[_0x91f9('0x1c')](_0xd74b37));_0x250cdc(_0xd74b37);})[_0x91f9('0x11')](function(_0x4bd59f){logger[_0x91f9('0xd')](_0x91f9('0x1d'),_0x4bd59f['message'],_0x34af17);_0xb701f1(_0x148fd3[_0x91f9('0xd')](0x1f4,_0x4bd59f[_0x91f9('0xf')]));});});}; \ No newline at end of file +var _0x87d1=['limit','include','map','model','stringify','catch','ShowServicenowAccount','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes'];(function(_0x138d53,_0x5bfefa){var _0x4010c1=function(_0x571130){while(--_0x571130){_0x138d53['push'](_0x138d53['shift']());}};_0x4010c1(++_0x5bfefa);}(_0x87d1,0x10b));var _0x187d=function(_0x4f3e72,_0x35ea1b){_0x4f3e72=_0x4f3e72-0x0;var _0x323db6=_0x87d1[_0x4f3e72];return _0x323db6;};'use strict';var _=require(_0x187d('0x0'));var util=require(_0x187d('0x1'));var moment=require(_0x187d('0x2'));var BPromise=require(_0x187d('0x3'));var rs=require(_0x187d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x187d('0x5'))['db'];var utils=require(_0x187d('0x6'));var logger=require('../../config/logger')(_0x187d('0x7'));var config=require(_0x187d('0x8'));var jayson=require(_0x187d('0x9'));var client=jayson[_0x187d('0xa')][_0x187d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20a008,_0x20e034,_0x59ccd5){return new BPromise(function(_0x30967e,_0x5de22d){return client[_0x187d('0xc')](_0x20a008,_0x59ccd5)[_0x187d('0xd')](function(_0x4899ee){logger['info'](_0x187d('0xe'),_0x20e034,_0x187d('0xf'));logger['debug'](_0x187d('0x10'),_0x20e034,_0x187d('0xf'),JSON['stringify'](_0x4899ee));if(_0x4899ee[_0x187d('0x11')]){if(_0x4899ee['error'][_0x187d('0x12')]===0x1f4){logger[_0x187d('0x11')](_0x187d('0xe'),_0x20e034,_0x4899ee[_0x187d('0x11')]['message']);return _0x5de22d(_0x4899ee[_0x187d('0x11')][_0x187d('0x13')]);}logger[_0x187d('0x11')](_0x187d('0xe'),_0x20e034,_0x4899ee[_0x187d('0x11')][_0x187d('0x13')]);return _0x30967e(_0x4899ee['error'][_0x187d('0x13')]);}else{logger[_0x187d('0x14')](_0x187d('0xe'),_0x20e034,'request\x20sent');_0x30967e(_0x4899ee[_0x187d('0x15')]['message']);}})['catch'](function(_0x2ea794){logger['error'](_0x187d('0xe'),_0x20e034,_0x2ea794);_0x5de22d(_0x2ea794);});});}exports[_0x187d('0x16')]=function(_0x4611e4){var _0x5159a1=this;return new Promise(function(_0x345b85,_0x25d284){return db[_0x187d('0x17')][_0x187d('0x18')]({'raw':_0x4611e4[_0x187d('0x19')]?_0x4611e4[_0x187d('0x19')][_0x187d('0x1a')]===undefined?!![]:![]:!![],'where':_0x4611e4['options']?_0x4611e4[_0x187d('0x19')][_0x187d('0x1b')]||null:null,'attributes':_0x4611e4[_0x187d('0x19')]?_0x4611e4[_0x187d('0x19')][_0x187d('0x1c')]||null:null,'limit':_0x4611e4[_0x187d('0x19')]?_0x4611e4['options'][_0x187d('0x1d')]||null:null,'include':_0x4611e4[_0x187d('0x19')]?_0x4611e4[_0x187d('0x19')][_0x187d('0x1e')]?_[_0x187d('0x1f')](_0x4611e4['options'][_0x187d('0x1e')],function(_0xcf04e5){return{'model':db[_0xcf04e5[_0x187d('0x20')]],'as':_0xcf04e5['as'],'attributes':_0xcf04e5[_0x187d('0x1c')],'include':_0xcf04e5[_0x187d('0x1e')]?_[_0x187d('0x1f')](_0xcf04e5['include'],function(_0x18e015){return{'model':db[_0x18e015[_0x187d('0x20')]],'as':_0x18e015['as'],'attributes':_0x18e015[_0x187d('0x1c')],'include':_0x18e015[_0x187d('0x1e')]?_[_0x187d('0x1f')](_0x18e015[_0x187d('0x1e')],function(_0x59b819){return{'model':db[_0x59b819[_0x187d('0x20')]],'as':_0x59b819['as'],'attributes':_0x59b819[_0x187d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x187d('0xd')](function(_0x5a1b6d){logger[_0x187d('0x14')](_0x187d('0x16'),_0x4611e4);logger['debug'](_0x187d('0x16'),_0x4611e4,JSON[_0x187d('0x21')](_0x5a1b6d));_0x345b85(_0x5a1b6d);})[_0x187d('0x22')](function(_0x4c51c8){logger[_0x187d('0x11')](_0x187d('0x16'),_0x4c51c8[_0x187d('0x13')],_0x4611e4);_0x25d284(_0x5159a1[_0x187d('0x11')](0x1f4,_0x4c51c8[_0x187d('0x13')]));});});};exports[_0x187d('0x23')]=function(_0x18bd60){var _0x3ead6d=this;return new Promise(function(_0x1e6003,_0x1bcd5b){return db['ServicenowAccount']['find']({'raw':_0x18bd60[_0x187d('0x19')]?_0x18bd60[_0x187d('0x19')][_0x187d('0x1a')]===undefined?!![]:![]:!![],'where':_0x18bd60[_0x187d('0x19')]?_0x18bd60[_0x187d('0x19')][_0x187d('0x1b')]||null:null,'attributes':_0x18bd60[_0x187d('0x19')]?_0x18bd60[_0x187d('0x19')][_0x187d('0x1c')]||null:null,'include':_0x18bd60[_0x187d('0x19')]?_0x18bd60[_0x187d('0x19')][_0x187d('0x1e')]?_['map'](_0x18bd60[_0x187d('0x19')][_0x187d('0x1e')],function(_0x3ab63d){return{'model':db[_0x3ab63d['model']],'as':_0x3ab63d['as'],'attributes':_0x3ab63d[_0x187d('0x1c')],'include':_0x3ab63d['include']?_[_0x187d('0x1f')](_0x3ab63d[_0x187d('0x1e')],function(_0x161232){return{'model':db[_0x161232[_0x187d('0x20')]],'as':_0x161232['as'],'attributes':_0x161232[_0x187d('0x1c')],'include':_0x161232[_0x187d('0x1e')]?_[_0x187d('0x1f')](_0x161232[_0x187d('0x1e')],function(_0x404dd6){return{'model':db[_0x404dd6[_0x187d('0x20')]],'as':_0x404dd6['as'],'attributes':_0x404dd6[_0x187d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x187d('0xd')](function(_0x1e2e62){logger['info'](_0x187d('0x23'),_0x18bd60);logger[_0x187d('0x24')](_0x187d('0x23'),_0x18bd60,JSON[_0x187d('0x21')](_0x1e2e62));_0x1e6003(_0x1e2e62);})[_0x187d('0x22')](function(_0x2bd8ab){logger[_0x187d('0x11')](_0x187d('0x23'),_0x2bd8ab[_0x187d('0x13')],_0x18bd60);_0x1bcd5b(_0x3ead6d[_0x187d('0x11')](0x1f4,_0x2bd8ab['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 8112169..4814475 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 _0x54ae=['./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','/:id','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x42ad41,_0x5eb9bc){var _0x2e1ea4=function(_0x2ffe5a){while(--_0x2ffe5a){_0x42ad41['push'](_0x42ad41['shift']());}};_0x2e1ea4(++_0x5eb9bc);}(_0x54ae,0xaa));var _0xe54a=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x54ae[_0x2ca2d0];return _0x521c23;};'use strict';var multer=require(_0xe54a('0x0'));var util=require('util');var path=require(_0xe54a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe54a('0x2')]();var fs_extra=require(_0xe54a('0x3'));var auth=require(_0xe54a('0x4'));var interaction=require(_0xe54a('0x5'));var config=require('../../config/environment');var controller=require(_0xe54a('0x6'));router[_0xe54a('0x7')]('/',auth[_0xe54a('0x8')](),controller[_0xe54a('0x9')]);router[_0xe54a('0x7')]('/:id',auth[_0xe54a('0x8')](),controller['show']);router[_0xe54a('0x7')](_0xe54a('0xa'),auth[_0xe54a('0x8')](),controller[_0xe54a('0xb')]);router['get'](_0xe54a('0xc'),auth[_0xe54a('0x8')](),controller[_0xe54a('0xd')]);router[_0xe54a('0x7')](_0xe54a('0xe'),auth[_0xe54a('0x8')](),controller['getDescriptions']);router[_0xe54a('0xf')]('/',auth[_0xe54a('0x8')](),controller[_0xe54a('0x10')]);router[_0xe54a('0x11')](_0xe54a('0x12'),auth[_0xe54a('0x8')](),controller['update']);router[_0xe54a('0x13')](_0xe54a('0x12'),auth[_0xe54a('0x8')](),controller[_0xe54a('0x14')]);module[_0xe54a('0x15')]=router; \ No newline at end of file +var _0xf097=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','/:id/fields'];(function(_0xd3fc3c,_0x3cc89a){var _0x1c29ac=function(_0x4f418a){while(--_0x4f418a){_0xd3fc3c['push'](_0xd3fc3c['shift']());}};_0x1c29ac(++_0x3cc89a);}(_0xf097,0x1b3));var _0x7f09=function(_0x5e2f03,_0x33fc82){_0x5e2f03=_0x5e2f03-0x0;var _0x47e557=_0xf097[_0x5e2f03];return _0x47e557;};'use strict';var multer=require(_0x7f09('0x0'));var util=require(_0x7f09('0x1'));var path=require(_0x7f09('0x2'));var timeout=require(_0x7f09('0x3'));var express=require(_0x7f09('0x4'));var router=express[_0x7f09('0x5')]();var fs_extra=require(_0x7f09('0x6'));var auth=require(_0x7f09('0x7'));var interaction=require(_0x7f09('0x8'));var config=require(_0x7f09('0x9'));var controller=require(_0x7f09('0xa'));router[_0x7f09('0xb')]('/',auth[_0x7f09('0xc')](),controller['index']);router[_0x7f09('0xb')](_0x7f09('0xd'),auth[_0x7f09('0xc')](),controller['show']);router[_0x7f09('0xb')](_0x7f09('0xe'),auth[_0x7f09('0xc')](),controller[_0x7f09('0xf')]);router[_0x7f09('0xb')](_0x7f09('0x10'),auth[_0x7f09('0xc')](),controller[_0x7f09('0x11')]);router[_0x7f09('0xb')](_0x7f09('0x12'),auth['isAuthenticated'](),controller[_0x7f09('0x13')]);router[_0x7f09('0x14')]('/',auth[_0x7f09('0xc')](),controller[_0x7f09('0x15')]);router[_0x7f09('0x16')]('/:id',auth[_0x7f09('0xc')](),controller['update']);router[_0x7f09('0x17')](_0x7f09('0xd'),auth[_0x7f09('0xc')](),controller['destroy']);module[_0x7f09('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index b80f7f1..d8ff697 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 _0x684a=['STRING','exports'];(function(_0x4dd2d3,_0x4c6bfc){var _0x488c8f=function(_0x2aa871){while(--_0x2aa871){_0x4dd2d3['push'](_0x4dd2d3['shift']());}};_0x488c8f(++_0x4c6bfc);}(_0x684a,0x85));var _0xa684=function(_0x144b47,_0xe33df){_0x144b47=_0x144b47-0x0;var _0x40a39d=_0x684a[_0x144b47];return _0x40a39d;};'use strict';var Sequelize=require('sequelize');module[_0xa684('0x0')]={'name':{'type':Sequelize[_0xa684('0x1')]},'description':{'type':Sequelize[_0xa684('0x1')]}}; \ No newline at end of file +var _0x0213=['sequelize','exports','STRING'];(function(_0x56ff5e,_0x257c79){var _0x26d7c6=function(_0x3cd248){while(--_0x3cd248){_0x56ff5e['push'](_0x56ff5e['shift']());}};_0x26d7c6(++_0x257c79);}(_0x0213,0x11a));var _0x3021=function(_0x6287b6,_0x5682e7){_0x6287b6=_0x6287b6-0x0;var _0x5d6be4=_0x0213[_0x6287b6];return _0x5d6be4;};'use strict';var Sequelize=require(_0x3021('0x0'));module[_0x3021('0x1')]={'name':{'type':Sequelize[_0x3021('0x2')]},'description':{'type':Sequelize[_0x3021('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index ec4645e..4ec659a 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 _0x482f=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','params','find','catch','create','body','getFields','findOne','ServicenowField','order','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query'];(function(_0x113a1a,_0x22a2c9){var _0x14d16e=function(_0x150dbd){while(--_0x150dbd){_0x113a1a['push'](_0x113a1a['shift']());}};_0x14d16e(++_0x22a2c9);}(_0x482f,0x1c1));var _0xf482=function(_0x28c013,_0x228d51){_0x28c013=_0x28c013-0x0;var _0x5a1768=_0x482f[_0x28c013];return _0x5a1768;};'use strict';var emlformat=require(_0xf482('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf482('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf482('0x2'));var moment=require(_0xf482('0x3'));var BPromise=require(_0xf482('0x4'));var Mustache=require(_0xf482('0x5'));var util=require(_0xf482('0x6'));var path=require(_0xf482('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf482('0x8'));var fs=require('fs');var fs_extra=require(_0xf482('0x9'));var _=require(_0xf482('0xa'));var squel=require(_0xf482('0xb'));var crypto=require('crypto');var jsforce=require(_0xf482('0xc'));var deskjs=require(_0xf482('0xd'));var toCsv=require(_0xf482('0xe'));var querystring=require(_0xf482('0xf'));var Papa=require(_0xf482('0x10'));var Redis=require(_0xf482('0x11'));var authService=require(_0xf482('0x12'));var qs=require(_0xf482('0x13'));var as=require(_0xf482('0x14'));var hardwareService=require(_0xf482('0x15'));var logger=require(_0xf482('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xf482('0x17'));var licenseUtil=require(_0xf482('0x18'));var db=require(_0xf482('0x19'))['db'];function respondWithStatusCode(_0x54c2e1,_0x991564){_0x991564=_0x991564||0xcc;return function(_0x161cd1){if(_0x161cd1){return _0x54c2e1['sendStatus'](_0x991564);}return _0x54c2e1[_0xf482('0x1a')](_0x991564)['end']();};}function respondWithResult(_0x3806be,_0x580ce2){_0x580ce2=_0x580ce2||0xc8;return function(_0x4dbcfa){if(_0x4dbcfa){return _0x3806be[_0xf482('0x1a')](_0x580ce2)[_0xf482('0x1b')](_0x4dbcfa);}};}function respondWithFilteredResult(_0x574918,_0x3fb2ee){return function(_0x25233a){if(_0x25233a){var _0x5138dd=typeof _0x3fb2ee[_0xf482('0x1c')]===_0xf482('0x1d')&&typeof _0x3fb2ee[_0xf482('0x1e')]===_0xf482('0x1d');var _0x5937e6=_0x25233a['count'];var _0x3d5c3b=_0x5138dd?0x0:_0x3fb2ee['offset'];var _0x26ee42=_0x5138dd?_0x25233a[_0xf482('0x1f')]:_0x3fb2ee[_0xf482('0x1c')]+_0x3fb2ee['limit'];var _0x21ccf2;if(_0x26ee42>=_0x5937e6){_0x26ee42=_0x5937e6;_0x21ccf2=0xc8;}else{_0x21ccf2=0xce;}_0x574918['status'](_0x21ccf2);return _0x574918[_0xf482('0x20')](_0xf482('0x21'),_0x3d5c3b+'-'+_0x26ee42+'/'+_0x5937e6)['json'](_0x25233a);}return null;};}function patchUpdates(_0x1311f0){return function(_0x21b381){try{jsonpatch[_0xf482('0x22')](_0x21b381,_0x1311f0,!![]);}catch(_0x28438d){return BPromise[_0xf482('0x23')](_0x28438d);}return _0x21b381[_0xf482('0x24')]();};}function saveUpdates(_0x66c74f,_0x2ed25c){return function(_0x3bc22a){if(_0x3bc22a){return _0x3bc22a[_0xf482('0x25')](_0x66c74f)[_0xf482('0x26')](function(_0x19e1b6){return _0x19e1b6;});}return null;};}function removeEntity(_0x5a9f68,_0x24dd7e){return function(_0x5811c2){if(_0x5811c2){return _0x5811c2[_0xf482('0x27')]()[_0xf482('0x26')](function(){_0x5a9f68['status'](0xcc)[_0xf482('0x28')]();});}};}function handleEntityNotFound(_0x23ae9b,_0x2701c3){return function(_0x4d0d22){if(!_0x4d0d22){_0x23ae9b[_0xf482('0x29')](0x194);}return _0x4d0d22;};}function handleError(_0x31896a,_0x4e6bee){_0x4e6bee=_0x4e6bee||0x1f4;return function(_0x28ba43){logger[_0xf482('0x2a')](_0x28ba43[_0xf482('0x2b')]);if(_0x28ba43['name']){delete _0x28ba43[_0xf482('0x2c')];}_0x31896a['status'](_0x4e6bee)[_0xf482('0x2d')](_0x28ba43);};}exports[_0xf482('0x2e')]=function(_0x30aef4,_0x3108e7){var _0x1fe6ec={},_0x1f49f0={},_0x439a04={'count':0x0,'rows':[]};var _0x212093=_[_0xf482('0x2f')](db[_0xf482('0x30')][_0xf482('0x31')],function(_0x409abc){return{'name':_0x409abc[_0xf482('0x32')],'type':_0x409abc[_0xf482('0x33')][_0xf482('0x34')]};});_0x1f49f0[_0xf482('0x35')]=_[_0xf482('0x2f')](_0x212093,_0xf482('0x2c'));_0x1f49f0[_0xf482('0x36')]=_[_0xf482('0x37')](_0x30aef4[_0xf482('0x36')]);_0x1f49f0[_0xf482('0x38')]=_[_0xf482('0x39')](_0x1f49f0[_0xf482('0x35')],_0x1f49f0[_0xf482('0x36')]);_0x1fe6ec['attributes']=_[_0xf482('0x39')](_0x1f49f0[_0xf482('0x35')],qs[_0xf482('0x3a')](_0x30aef4[_0xf482('0x36')][_0xf482('0x3a')]));_0x1fe6ec[_0xf482('0x3b')]=_0x1fe6ec[_0xf482('0x3b')][_0xf482('0x3c')]?_0x1fe6ec[_0xf482('0x3b')]:_0x1f49f0[_0xf482('0x35')];if(!_0x30aef4[_0xf482('0x36')][_0xf482('0x3d')](_0xf482('0x3e'))){_0x1fe6ec[_0xf482('0x1e')]=qs['limit'](_0x30aef4[_0xf482('0x36')][_0xf482('0x1e')]);_0x1fe6ec['offset']=qs[_0xf482('0x1c')](_0x30aef4[_0xf482('0x36')][_0xf482('0x1c')]);}_0x1fe6ec['order']=qs[_0xf482('0x3f')](_0x30aef4[_0xf482('0x36')][_0xf482('0x3f')]);_0x1fe6ec['where']=qs[_0xf482('0x38')](_[_0xf482('0x40')](_0x30aef4[_0xf482('0x36')],_0x1f49f0[_0xf482('0x38')]),_0x212093);if(_0x30aef4[_0xf482('0x36')][_0xf482('0x41')]){_0x1fe6ec[_0xf482('0x42')]=_[_0xf482('0x43')](_0x1fe6ec[_0xf482('0x42')],{'$or':_['map'](_0x212093,function(_0xd2feca){if(_0xd2feca[_0xf482('0x33')]!==_0xf482('0x44')){var _0x491da9={};_0x491da9[_0xd2feca[_0xf482('0x2c')]]={'$like':'%'+_0x30aef4[_0xf482('0x36')][_0xf482('0x41')]+'%'};return _0x491da9;}})});}_0x1fe6ec=_[_0xf482('0x43')]({},_0x1fe6ec,_0x30aef4[_0xf482('0x45')]);var _0xd1535d={'where':_0x1fe6ec[_0xf482('0x42')]};return db[_0xf482('0x30')]['count'](_0xd1535d)[_0xf482('0x26')](function(_0xae93a7){_0x439a04[_0xf482('0x1f')]=_0xae93a7;if(_0x30aef4[_0xf482('0x36')][_0xf482('0x46')]){_0x1fe6ec['include']=[{'all':!![]}];}return db[_0xf482('0x30')][_0xf482('0x47')](_0x1fe6ec);})[_0xf482('0x26')](function(_0x1f38c1){_0x439a04['rows']=_0x1f38c1;return _0x439a04;})[_0xf482('0x26')](respondWithFilteredResult(_0x3108e7,_0x1fe6ec))['catch'](handleError(_0x3108e7,null));};exports[_0xf482('0x48')]=function(_0x13cb2e,_0x124567){var _0x5ed194={'raw':![],'where':{'id':_0x13cb2e[_0xf482('0x49')]['id']}},_0x557eab={};_0x557eab[_0xf482('0x35')]=_[_0xf482('0x37')](db[_0xf482('0x30')][_0xf482('0x31')]);_0x557eab[_0xf482('0x36')]=_['keys'](_0x13cb2e[_0xf482('0x36')]);_0x557eab['filters']=_[_0xf482('0x39')](_0x557eab[_0xf482('0x35')],_0x557eab[_0xf482('0x36')]);_0x5ed194['attributes']=_[_0xf482('0x39')](_0x557eab[_0xf482('0x35')],qs[_0xf482('0x3a')](_0x13cb2e[_0xf482('0x36')][_0xf482('0x3a')]));_0x5ed194[_0xf482('0x3b')]=_0x5ed194[_0xf482('0x3b')][_0xf482('0x3c')]?_0x5ed194['attributes']:_0x557eab[_0xf482('0x35')];if(_0x13cb2e['query']['includeAll']){_0x5ed194['include']=[{'all':!![]}];}_0x5ed194=_[_0xf482('0x43')]({},_0x5ed194,_0x13cb2e[_0xf482('0x45')]);return db[_0xf482('0x30')][_0xf482('0x4a')](_0x5ed194)[_0xf482('0x26')](handleEntityNotFound(_0x124567,null))['then'](respondWithResult(_0x124567,null))[_0xf482('0x4b')](handleError(_0x124567,null));};exports[_0xf482('0x4c')]=function(_0x4de85b,_0x1c2beb){return db[_0xf482('0x30')][_0xf482('0x4c')](_0x4de85b['body'],{})[_0xf482('0x26')](respondWithResult(_0x1c2beb,0xc9))[_0xf482('0x4b')](handleError(_0x1c2beb,null));};exports[_0xf482('0x25')]=function(_0x32bac2,_0x31a27c){if(_0x32bac2['body']['id']){delete _0x32bac2['body']['id'];}return db[_0xf482('0x30')][_0xf482('0x4a')]({'where':{'id':_0x32bac2[_0xf482('0x49')]['id']}})[_0xf482('0x26')](handleEntityNotFound(_0x31a27c,null))[_0xf482('0x26')](saveUpdates(_0x32bac2[_0xf482('0x4d')],null))[_0xf482('0x26')](respondWithResult(_0x31a27c,null))[_0xf482('0x4b')](handleError(_0x31a27c,null));};exports[_0xf482('0x27')]=function(_0x4e6bd2,_0x3702c6){return db[_0xf482('0x30')][_0xf482('0x4a')]({'where':{'id':_0x4e6bd2[_0xf482('0x49')]['id']}})[_0xf482('0x26')](handleEntityNotFound(_0x3702c6,null))[_0xf482('0x26')](removeEntity(_0x3702c6,null))['catch'](handleError(_0x3702c6,null));};exports[_0xf482('0x4e')]=function(_0x12207c,_0x2374b7,_0x26923f){var _0x2bef6f={};var _0x47570c={};var _0x3f8e96;var _0x1742d2;return db[_0xf482('0x30')][_0xf482('0x4f')]({'where':{'id':_0x12207c[_0xf482('0x49')]['id']}})[_0xf482('0x26')](handleEntityNotFound(_0x2374b7,null))[_0xf482('0x26')](function(_0xa64793){if(_0xa64793){_0x3f8e96=_0xa64793;_0x47570c[_0xf482('0x35')]=_[_0xf482('0x37')](db[_0xf482('0x50')][_0xf482('0x31')]);_0x47570c[_0xf482('0x36')]=_['keys'](_0x12207c[_0xf482('0x36')]);_0x47570c[_0xf482('0x38')]=_[_0xf482('0x39')](_0x47570c[_0xf482('0x35')],_0x47570c[_0xf482('0x36')]);_0x2bef6f['attributes']=_['intersection'](_0x47570c[_0xf482('0x35')],qs[_0xf482('0x3a')](_0x12207c['query'][_0xf482('0x3a')]));_0x2bef6f[_0xf482('0x3b')]=_0x2bef6f[_0xf482('0x3b')]['length']?_0x2bef6f[_0xf482('0x3b')]:_0x47570c[_0xf482('0x35')];_0x2bef6f[_0xf482('0x51')]=qs[_0xf482('0x3f')](_0x12207c[_0xf482('0x36')][_0xf482('0x3f')]);_0x2bef6f[_0xf482('0x42')]=qs[_0xf482('0x38')](_[_0xf482('0x40')](_0x12207c[_0xf482('0x36')],_0x47570c[_0xf482('0x38')]));if(_0x12207c['query'][_0xf482('0x41')]){_0x2bef6f[_0xf482('0x42')]=_[_0xf482('0x43')](_0x2bef6f[_0xf482('0x42')],{'$or':_[_0xf482('0x2f')](_0x2bef6f[_0xf482('0x3b')],function(_0x59ddf2){var _0x3e6b42={};_0x3e6b42[_0x59ddf2]={'$like':'%'+_0x12207c[_0xf482('0x36')][_0xf482('0x41')]+'%'};return _0x3e6b42;})});}_0x2bef6f=_[_0xf482('0x43')]({},_0x2bef6f,_0x12207c[_0xf482('0x45')]);return _0x3f8e96['getFields'](_0x2bef6f);}})[_0xf482('0x26')](function(_0x17a0db){if(_0x17a0db){_0x1742d2=_0x17a0db[_0xf482('0x3c')];if(!_0x12207c['query'][_0xf482('0x3d')]('nolimit')){_0x2bef6f['limit']=qs[_0xf482('0x1e')](_0x12207c[_0xf482('0x36')][_0xf482('0x1e')]);_0x2bef6f['offset']=qs[_0xf482('0x1c')](_0x12207c['query'][_0xf482('0x1c')]);}return _0x3f8e96[_0xf482('0x4e')](_0x2bef6f);}})[_0xf482('0x26')](function(_0x10f56a){if(_0x10f56a){return _0x10f56a?{'count':_0x1742d2,'rows':_0x10f56a}:null;}})[_0xf482('0x26')](respondWithResult(_0x2374b7,null))['catch'](handleError(_0x2374b7,null));};exports[_0xf482('0x52')]=function(_0x388966,_0x29936a,_0x29eea0){var _0x79f45c={};var _0x1a691a={};var _0x1ca4f2;var _0x11cbaa;return db[_0xf482('0x30')][_0xf482('0x4f')]({'where':{'id':_0x388966[_0xf482('0x49')]['id']}})['then'](handleEntityNotFound(_0x29936a,null))[_0xf482('0x26')](function(_0x4dbca6){if(_0x4dbca6){_0x1ca4f2=_0x4dbca6;_0x1a691a[_0xf482('0x35')]=_[_0xf482('0x37')](db['ServicenowField'][_0xf482('0x31')]);_0x1a691a[_0xf482('0x36')]=_[_0xf482('0x37')](_0x388966['query']);_0x1a691a[_0xf482('0x38')]=_[_0xf482('0x39')](_0x1a691a[_0xf482('0x35')],_0x1a691a[_0xf482('0x36')]);_0x79f45c[_0xf482('0x3b')]=_['intersection'](_0x1a691a[_0xf482('0x35')],qs['fields'](_0x388966['query'][_0xf482('0x3a')]));_0x79f45c[_0xf482('0x3b')]=_0x79f45c[_0xf482('0x3b')]['length']?_0x79f45c[_0xf482('0x3b')]:_0x1a691a[_0xf482('0x35')];_0x79f45c[_0xf482('0x51')]=qs[_0xf482('0x3f')](_0x388966[_0xf482('0x36')]['sort']);_0x79f45c[_0xf482('0x42')]=qs['filters'](_[_0xf482('0x40')](_0x388966[_0xf482('0x36')],_0x1a691a['filters']));if(_0x388966[_0xf482('0x36')]['filter']){_0x79f45c[_0xf482('0x42')]=_['merge'](_0x79f45c[_0xf482('0x42')],{'$or':_[_0xf482('0x2f')](_0x79f45c['attributes'],function(_0x482ed9){var _0x264a2e={};_0x264a2e[_0x482ed9]={'$like':'%'+_0x388966[_0xf482('0x36')][_0xf482('0x41')]+'%'};return _0x264a2e;})});}_0x79f45c=_[_0xf482('0x43')]({},_0x79f45c,_0x388966[_0xf482('0x45')]);return _0x1ca4f2[_0xf482('0x52')](_0x79f45c);}})[_0xf482('0x26')](function(_0x5ef78d){if(_0x5ef78d){_0x11cbaa=_0x5ef78d[_0xf482('0x3c')];if(!_0x388966[_0xf482('0x36')]['hasOwnProperty'](_0xf482('0x3e'))){_0x79f45c[_0xf482('0x1e')]=qs['limit'](_0x388966['query'][_0xf482('0x1e')]);_0x79f45c[_0xf482('0x1c')]=qs['offset'](_0x388966['query'][_0xf482('0x1c')]);}return _0x1ca4f2[_0xf482('0x52')](_0x79f45c);}})['then'](function(_0x20eee5){if(_0x20eee5){return _0x20eee5?{'count':_0x11cbaa,'rows':_0x20eee5}:null;}})['then'](respondWithResult(_0x29936a,null))[_0xf482('0x4b')](handleError(_0x29936a,null));};exports[_0xf482('0x53')]=function(_0x23807e,_0x41b7ae,_0x1b826a){var _0x37f535={};var _0x547ae2={};var _0x42044c;var _0x51c285;return db[_0xf482('0x30')]['findOne']({'where':{'id':_0x23807e[_0xf482('0x49')]['id']}})['then'](handleEntityNotFound(_0x41b7ae,null))['then'](function(_0x35e494){if(_0x35e494){_0x42044c=_0x35e494;_0x547ae2['model']=_[_0xf482('0x37')](db[_0xf482('0x50')][_0xf482('0x31')]);_0x547ae2[_0xf482('0x36')]=_[_0xf482('0x37')](_0x23807e[_0xf482('0x36')]);_0x547ae2[_0xf482('0x38')]=_[_0xf482('0x39')](_0x547ae2['model'],_0x547ae2[_0xf482('0x36')]);_0x37f535[_0xf482('0x3b')]=_[_0xf482('0x39')](_0x547ae2[_0xf482('0x35')],qs['fields'](_0x23807e[_0xf482('0x36')][_0xf482('0x3a')]));_0x37f535[_0xf482('0x3b')]=_0x37f535[_0xf482('0x3b')][_0xf482('0x3c')]?_0x37f535['attributes']:_0x547ae2[_0xf482('0x35')];_0x37f535[_0xf482('0x51')]=qs['sort'](_0x23807e[_0xf482('0x36')]['sort']);_0x37f535[_0xf482('0x42')]=qs[_0xf482('0x38')](_[_0xf482('0x40')](_0x23807e[_0xf482('0x36')],_0x547ae2[_0xf482('0x38')]));if(_0x23807e['query'][_0xf482('0x41')]){_0x37f535[_0xf482('0x42')]=_[_0xf482('0x43')](_0x37f535['where'],{'$or':_[_0xf482('0x2f')](_0x37f535[_0xf482('0x3b')],function(_0x4e6e07){var _0xdc50d={};_0xdc50d[_0x4e6e07]={'$like':'%'+_0x23807e[_0xf482('0x36')][_0xf482('0x41')]+'%'};return _0xdc50d;})});}_0x37f535=_[_0xf482('0x43')]({},_0x37f535,_0x23807e[_0xf482('0x45')]);return _0x42044c[_0xf482('0x53')](_0x37f535);}})[_0xf482('0x26')](function(_0x429ed7){if(_0x429ed7){_0x51c285=_0x429ed7['length'];if(!_0x23807e[_0xf482('0x36')][_0xf482('0x3d')]('nolimit')){_0x37f535['limit']=qs[_0xf482('0x1e')](_0x23807e[_0xf482('0x36')]['limit']);_0x37f535[_0xf482('0x1c')]=qs[_0xf482('0x1c')](_0x23807e[_0xf482('0x36')]['offset']);}return _0x42044c['getDescriptions'](_0x37f535);}})[_0xf482('0x26')](function(_0x5b26d9){if(_0x5b26d9){return _0x5b26d9?{'count':_0x51c285,'rows':_0x5b26d9}:null;}})['then'](respondWithResult(_0x41b7ae,null))[_0xf482('0x4b')](handleError(_0x41b7ae,null));}; \ No newline at end of file +var _0x5f40=['create','body','find','getFields','ServicenowField','rawAttributes','order','pick','getSubjects','hasOwnProperty','getDescriptions','findOne','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','nolimit','limit','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','catch'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x5f40,0x192));var _0x05f4=function(_0x5242bd,_0xa047d1){_0x5242bd=_0x5242bd-0x0;var _0x2507db=_0x5f40[_0x5242bd];return _0x2507db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x05f4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x05f4('0x1'));var rp=require('request-promise');var moment=require(_0x05f4('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x05f4('0x3'));var path=require('path');var sox=require(_0x05f4('0x4'));var csv=require(_0x05f4('0x5'));var ejs=require(_0x05f4('0x6'));var fs=require('fs');var fs_extra=require(_0x05f4('0x7'));var _=require(_0x05f4('0x8'));var squel=require(_0x05f4('0x9'));var crypto=require(_0x05f4('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x05f4('0xb'));var Papa=require(_0x05f4('0xc'));var Redis=require(_0x05f4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x05f4('0xe'));var as=require(_0x05f4('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x05f4('0x10'))(_0x05f4('0x11'));var utils=require('../../config/utils');var config=require(_0x05f4('0x12'));var licenseUtil=require(_0x05f4('0x13'));var db=require(_0x05f4('0x14'))['db'];function respondWithStatusCode(_0x332818,_0x1ac994){_0x1ac994=_0x1ac994||0xcc;return function(_0x517e9f){if(_0x517e9f){return _0x332818[_0x05f4('0x15')](_0x1ac994);}return _0x332818[_0x05f4('0x16')](_0x1ac994)['end']();};}function respondWithResult(_0x18b642,_0x405eb6){_0x405eb6=_0x405eb6||0xc8;return function(_0x17bdd8){if(_0x17bdd8){return _0x18b642['status'](_0x405eb6)[_0x05f4('0x17')](_0x17bdd8);}};}function respondWithFilteredResult(_0x5d95c7,_0xf22ae4){return function(_0x408a8a){if(_0x408a8a){var _0xe0f295=typeof _0xf22ae4[_0x05f4('0x18')]===_0x05f4('0x19')&&typeof _0xf22ae4['limit']===_0x05f4('0x19');var _0x415524=_0x408a8a[_0x05f4('0x1a')];var _0x2ab203=_0xe0f295?0x0:_0xf22ae4[_0x05f4('0x18')];var _0x32e655=_0xe0f295?_0x408a8a[_0x05f4('0x1a')]:_0xf22ae4[_0x05f4('0x18')]+_0xf22ae4['limit'];var _0x32b10e;if(_0x32e655>=_0x415524){_0x32e655=_0x415524;_0x32b10e=0xc8;}else{_0x32b10e=0xce;}_0x5d95c7[_0x05f4('0x16')](_0x32b10e);return _0x5d95c7[_0x05f4('0x1b')](_0x05f4('0x1c'),_0x2ab203+'-'+_0x32e655+'/'+_0x415524)[_0x05f4('0x17')](_0x408a8a);}return null;};}function patchUpdates(_0x68859f){return function(_0x49430f){try{jsonpatch['apply'](_0x49430f,_0x68859f,!![]);}catch(_0x557f20){return BPromise[_0x05f4('0x1d')](_0x557f20);}return _0x49430f[_0x05f4('0x1e')]();};}function saveUpdates(_0x175baf,_0x40d638){return function(_0x42a2da){if(_0x42a2da){return _0x42a2da['update'](_0x175baf)[_0x05f4('0x1f')](function(_0x3a01e2){return _0x3a01e2;});}return null;};}function removeEntity(_0x595ba5,_0x1c6ab7){return function(_0xabb188){if(_0xabb188){return _0xabb188[_0x05f4('0x20')]()['then'](function(){_0x595ba5[_0x05f4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe880c5,_0x4ed4f8){return function(_0xf20b7f){if(!_0xf20b7f){_0xe880c5[_0x05f4('0x15')](0x194);}return _0xf20b7f;};}function handleError(_0x10d575,_0x24a777){_0x24a777=_0x24a777||0x1f4;return function(_0x38e9dc){logger[_0x05f4('0x21')](_0x38e9dc[_0x05f4('0x22')]);if(_0x38e9dc[_0x05f4('0x23')]){delete _0x38e9dc['name'];}_0x10d575[_0x05f4('0x16')](_0x24a777)[_0x05f4('0x24')](_0x38e9dc);};}exports[_0x05f4('0x25')]=function(_0x1fe239,_0x59579e){var _0xb4e22={},_0x25fde3={},_0x1e44f5={'count':0x0,'rows':[]};var _0x18c76d=_[_0x05f4('0x26')](db[_0x05f4('0x27')]['rawAttributes'],function(_0xa3e1b3){return{'name':_0xa3e1b3[_0x05f4('0x28')],'type':_0xa3e1b3[_0x05f4('0x29')][_0x05f4('0x2a')]};});_0x25fde3[_0x05f4('0x2b')]=_['map'](_0x18c76d,_0x05f4('0x23'));_0x25fde3['query']=_[_0x05f4('0x2c')](_0x1fe239['query']);_0x25fde3[_0x05f4('0x2d')]=_[_0x05f4('0x2e')](_0x25fde3[_0x05f4('0x2b')],_0x25fde3['query']);_0xb4e22[_0x05f4('0x2f')]=_['intersection'](_0x25fde3['model'],qs[_0x05f4('0x30')](_0x1fe239[_0x05f4('0x31')][_0x05f4('0x30')]));_0xb4e22[_0x05f4('0x2f')]=_0xb4e22['attributes'][_0x05f4('0x32')]?_0xb4e22[_0x05f4('0x2f')]:_0x25fde3['model'];if(!_0x1fe239[_0x05f4('0x31')]['hasOwnProperty'](_0x05f4('0x33'))){_0xb4e22[_0x05f4('0x34')]=qs[_0x05f4('0x34')](_0x1fe239[_0x05f4('0x31')]['limit']);_0xb4e22[_0x05f4('0x18')]=qs['offset'](_0x1fe239['query'][_0x05f4('0x18')]);}_0xb4e22['order']=qs[_0x05f4('0x35')](_0x1fe239[_0x05f4('0x31')]['sort']);_0xb4e22['where']=qs[_0x05f4('0x2d')](_['pick'](_0x1fe239[_0x05f4('0x31')],_0x25fde3[_0x05f4('0x2d')]),_0x18c76d);if(_0x1fe239['query'][_0x05f4('0x36')]){_0xb4e22[_0x05f4('0x37')]=_[_0x05f4('0x38')](_0xb4e22[_0x05f4('0x37')],{'$or':_[_0x05f4('0x26')](_0x18c76d,function(_0x17210e){if(_0x17210e[_0x05f4('0x29')]!==_0x05f4('0x39')){var _0x53e425={};_0x53e425[_0x17210e[_0x05f4('0x23')]]={'$like':'%'+_0x1fe239[_0x05f4('0x31')]['filter']+'%'};return _0x53e425;}})});}_0xb4e22=_[_0x05f4('0x38')]({},_0xb4e22,_0x1fe239[_0x05f4('0x3a')]);var _0x24154b={'where':_0xb4e22[_0x05f4('0x37')]};return db[_0x05f4('0x27')][_0x05f4('0x1a')](_0x24154b)[_0x05f4('0x1f')](function(_0x1f604e){_0x1e44f5[_0x05f4('0x1a')]=_0x1f604e;if(_0x1fe239['query']['includeAll']){_0xb4e22[_0x05f4('0x3b')]=[{'all':!![]}];}return db[_0x05f4('0x27')][_0x05f4('0x3c')](_0xb4e22);})[_0x05f4('0x1f')](function(_0x497bdb){_0x1e44f5[_0x05f4('0x3d')]=_0x497bdb;return _0x1e44f5;})[_0x05f4('0x1f')](respondWithFilteredResult(_0x59579e,_0xb4e22))['catch'](handleError(_0x59579e,null));};exports[_0x05f4('0x3e')]=function(_0x1b2c52,_0x102d74){var _0x4cdf91={'raw':![],'where':{'id':_0x1b2c52[_0x05f4('0x3f')]['id']}},_0x5e8dd6={};_0x5e8dd6[_0x05f4('0x2b')]=_[_0x05f4('0x2c')](db[_0x05f4('0x27')]['rawAttributes']);_0x5e8dd6[_0x05f4('0x31')]=_[_0x05f4('0x2c')](_0x1b2c52[_0x05f4('0x31')]);_0x5e8dd6[_0x05f4('0x2d')]=_[_0x05f4('0x2e')](_0x5e8dd6['model'],_0x5e8dd6['query']);_0x4cdf91[_0x05f4('0x2f')]=_[_0x05f4('0x2e')](_0x5e8dd6[_0x05f4('0x2b')],qs[_0x05f4('0x30')](_0x1b2c52[_0x05f4('0x31')][_0x05f4('0x30')]));_0x4cdf91[_0x05f4('0x2f')]=_0x4cdf91[_0x05f4('0x2f')][_0x05f4('0x32')]?_0x4cdf91['attributes']:_0x5e8dd6[_0x05f4('0x2b')];if(_0x1b2c52[_0x05f4('0x31')][_0x05f4('0x40')]){_0x4cdf91[_0x05f4('0x3b')]=[{'all':!![]}];}_0x4cdf91=_[_0x05f4('0x38')]({},_0x4cdf91,_0x1b2c52[_0x05f4('0x3a')]);return db[_0x05f4('0x27')]['find'](_0x4cdf91)['then'](handleEntityNotFound(_0x102d74,null))[_0x05f4('0x1f')](respondWithResult(_0x102d74,null))[_0x05f4('0x41')](handleError(_0x102d74,null));};exports[_0x05f4('0x42')]=function(_0x5cd210,_0x376e86){return db[_0x05f4('0x27')][_0x05f4('0x42')](_0x5cd210['body'],{})[_0x05f4('0x1f')](respondWithResult(_0x376e86,0xc9))[_0x05f4('0x41')](handleError(_0x376e86,null));};exports['update']=function(_0xab4d90,_0x3afb37){if(_0xab4d90[_0x05f4('0x43')]['id']){delete _0xab4d90[_0x05f4('0x43')]['id'];}return db[_0x05f4('0x27')][_0x05f4('0x44')]({'where':{'id':_0xab4d90[_0x05f4('0x3f')]['id']}})[_0x05f4('0x1f')](handleEntityNotFound(_0x3afb37,null))['then'](saveUpdates(_0xab4d90['body'],null))['then'](respondWithResult(_0x3afb37,null))[_0x05f4('0x41')](handleError(_0x3afb37,null));};exports[_0x05f4('0x20')]=function(_0x72d1c1,_0x67d5d1){return db['ServicenowConfiguration'][_0x05f4('0x44')]({'where':{'id':_0x72d1c1[_0x05f4('0x3f')]['id']}})[_0x05f4('0x1f')](handleEntityNotFound(_0x67d5d1,null))['then'](removeEntity(_0x67d5d1,null))[_0x05f4('0x41')](handleError(_0x67d5d1,null));};exports[_0x05f4('0x45')]=function(_0x4e39b4,_0x414a8d,_0x566dce){var _0x42d383={};var _0x38fdf4={};var _0x5c8c3e;var _0x2aa73e;return db[_0x05f4('0x27')]['findOne']({'where':{'id':_0x4e39b4[_0x05f4('0x3f')]['id']}})[_0x05f4('0x1f')](handleEntityNotFound(_0x414a8d,null))['then'](function(_0x5bd9f0){if(_0x5bd9f0){_0x5c8c3e=_0x5bd9f0;_0x38fdf4[_0x05f4('0x2b')]=_[_0x05f4('0x2c')](db[_0x05f4('0x46')][_0x05f4('0x47')]);_0x38fdf4[_0x05f4('0x31')]=_[_0x05f4('0x2c')](_0x4e39b4['query']);_0x38fdf4['filters']=_[_0x05f4('0x2e')](_0x38fdf4[_0x05f4('0x2b')],_0x38fdf4[_0x05f4('0x31')]);_0x42d383[_0x05f4('0x2f')]=_[_0x05f4('0x2e')](_0x38fdf4[_0x05f4('0x2b')],qs[_0x05f4('0x30')](_0x4e39b4[_0x05f4('0x31')][_0x05f4('0x30')]));_0x42d383['attributes']=_0x42d383[_0x05f4('0x2f')][_0x05f4('0x32')]?_0x42d383[_0x05f4('0x2f')]:_0x38fdf4['model'];_0x42d383[_0x05f4('0x48')]=qs['sort'](_0x4e39b4[_0x05f4('0x31')][_0x05f4('0x35')]);_0x42d383['where']=qs[_0x05f4('0x2d')](_[_0x05f4('0x49')](_0x4e39b4['query'],_0x38fdf4['filters']));if(_0x4e39b4[_0x05f4('0x31')][_0x05f4('0x36')]){_0x42d383[_0x05f4('0x37')]=_['merge'](_0x42d383['where'],{'$or':_[_0x05f4('0x26')](_0x42d383['attributes'],function(_0xdac89e){var _0x541e3a={};_0x541e3a[_0xdac89e]={'$like':'%'+_0x4e39b4[_0x05f4('0x31')][_0x05f4('0x36')]+'%'};return _0x541e3a;})});}_0x42d383=_['merge']({},_0x42d383,_0x4e39b4[_0x05f4('0x3a')]);return _0x5c8c3e['getFields'](_0x42d383);}})['then'](function(_0x21c226){if(_0x21c226){_0x2aa73e=_0x21c226[_0x05f4('0x32')];if(!_0x4e39b4[_0x05f4('0x31')]['hasOwnProperty'](_0x05f4('0x33'))){_0x42d383[_0x05f4('0x34')]=qs[_0x05f4('0x34')](_0x4e39b4[_0x05f4('0x31')][_0x05f4('0x34')]);_0x42d383[_0x05f4('0x18')]=qs[_0x05f4('0x18')](_0x4e39b4['query'][_0x05f4('0x18')]);}return _0x5c8c3e[_0x05f4('0x45')](_0x42d383);}})['then'](function(_0x232b7d){if(_0x232b7d){return _0x232b7d?{'count':_0x2aa73e,'rows':_0x232b7d}:null;}})[_0x05f4('0x1f')](respondWithResult(_0x414a8d,null))[_0x05f4('0x41')](handleError(_0x414a8d,null));};exports[_0x05f4('0x4a')]=function(_0x58b9e2,_0x1e3747,_0x16ace4){var _0xaeb9a0={};var _0x1fb783={};var _0x3ad323;var _0x56f59b;return db[_0x05f4('0x27')]['findOne']({'where':{'id':_0x58b9e2[_0x05f4('0x3f')]['id']}})[_0x05f4('0x1f')](handleEntityNotFound(_0x1e3747,null))[_0x05f4('0x1f')](function(_0x74907){if(_0x74907){_0x3ad323=_0x74907;_0x1fb783[_0x05f4('0x2b')]=_[_0x05f4('0x2c')](db[_0x05f4('0x46')][_0x05f4('0x47')]);_0x1fb783[_0x05f4('0x31')]=_[_0x05f4('0x2c')](_0x58b9e2[_0x05f4('0x31')]);_0x1fb783[_0x05f4('0x2d')]=_['intersection'](_0x1fb783[_0x05f4('0x2b')],_0x1fb783[_0x05f4('0x31')]);_0xaeb9a0['attributes']=_['intersection'](_0x1fb783['model'],qs[_0x05f4('0x30')](_0x58b9e2[_0x05f4('0x31')][_0x05f4('0x30')]));_0xaeb9a0[_0x05f4('0x2f')]=_0xaeb9a0[_0x05f4('0x2f')][_0x05f4('0x32')]?_0xaeb9a0[_0x05f4('0x2f')]:_0x1fb783[_0x05f4('0x2b')];_0xaeb9a0['order']=qs[_0x05f4('0x35')](_0x58b9e2[_0x05f4('0x31')][_0x05f4('0x35')]);_0xaeb9a0[_0x05f4('0x37')]=qs[_0x05f4('0x2d')](_[_0x05f4('0x49')](_0x58b9e2[_0x05f4('0x31')],_0x1fb783['filters']));if(_0x58b9e2[_0x05f4('0x31')][_0x05f4('0x36')]){_0xaeb9a0['where']=_[_0x05f4('0x38')](_0xaeb9a0['where'],{'$or':_[_0x05f4('0x26')](_0xaeb9a0[_0x05f4('0x2f')],function(_0x1cfdba){var _0x45f7e8={};_0x45f7e8[_0x1cfdba]={'$like':'%'+_0x58b9e2[_0x05f4('0x31')][_0x05f4('0x36')]+'%'};return _0x45f7e8;})});}_0xaeb9a0=_[_0x05f4('0x38')]({},_0xaeb9a0,_0x58b9e2[_0x05f4('0x3a')]);return _0x3ad323[_0x05f4('0x4a')](_0xaeb9a0);}})['then'](function(_0x4ff27a){if(_0x4ff27a){_0x56f59b=_0x4ff27a['length'];if(!_0x58b9e2[_0x05f4('0x31')][_0x05f4('0x4b')](_0x05f4('0x33'))){_0xaeb9a0[_0x05f4('0x34')]=qs['limit'](_0x58b9e2['query'][_0x05f4('0x34')]);_0xaeb9a0[_0x05f4('0x18')]=qs[_0x05f4('0x18')](_0x58b9e2[_0x05f4('0x31')]['offset']);}return _0x3ad323[_0x05f4('0x4a')](_0xaeb9a0);}})[_0x05f4('0x1f')](function(_0x3c8d6b){if(_0x3c8d6b){return _0x3c8d6b?{'count':_0x56f59b,'rows':_0x3c8d6b}:null;}})[_0x05f4('0x1f')](respondWithResult(_0x1e3747,null))['catch'](handleError(_0x1e3747,null));};exports[_0x05f4('0x4c')]=function(_0x569c5b,_0x132d18,_0x399200){var _0x198697={};var _0xe32cd={};var _0x46f0fa;var _0x40b2c1;return db[_0x05f4('0x27')][_0x05f4('0x4d')]({'where':{'id':_0x569c5b[_0x05f4('0x3f')]['id']}})[_0x05f4('0x1f')](handleEntityNotFound(_0x132d18,null))['then'](function(_0x43a3de){if(_0x43a3de){_0x46f0fa=_0x43a3de;_0xe32cd[_0x05f4('0x2b')]=_['keys'](db['ServicenowField'][_0x05f4('0x47')]);_0xe32cd[_0x05f4('0x31')]=_['keys'](_0x569c5b[_0x05f4('0x31')]);_0xe32cd[_0x05f4('0x2d')]=_[_0x05f4('0x2e')](_0xe32cd['model'],_0xe32cd[_0x05f4('0x31')]);_0x198697[_0x05f4('0x2f')]=_[_0x05f4('0x2e')](_0xe32cd[_0x05f4('0x2b')],qs['fields'](_0x569c5b['query'][_0x05f4('0x30')]));_0x198697[_0x05f4('0x2f')]=_0x198697[_0x05f4('0x2f')][_0x05f4('0x32')]?_0x198697[_0x05f4('0x2f')]:_0xe32cd[_0x05f4('0x2b')];_0x198697['order']=qs[_0x05f4('0x35')](_0x569c5b[_0x05f4('0x31')]['sort']);_0x198697[_0x05f4('0x37')]=qs[_0x05f4('0x2d')](_[_0x05f4('0x49')](_0x569c5b['query'],_0xe32cd['filters']));if(_0x569c5b[_0x05f4('0x31')][_0x05f4('0x36')]){_0x198697[_0x05f4('0x37')]=_[_0x05f4('0x38')](_0x198697[_0x05f4('0x37')],{'$or':_['map'](_0x198697[_0x05f4('0x2f')],function(_0x242a0c){var _0x3870f5={};_0x3870f5[_0x242a0c]={'$like':'%'+_0x569c5b[_0x05f4('0x31')]['filter']+'%'};return _0x3870f5;})});}_0x198697=_[_0x05f4('0x38')]({},_0x198697,_0x569c5b[_0x05f4('0x3a')]);return _0x46f0fa['getDescriptions'](_0x198697);}})[_0x05f4('0x1f')](function(_0x52296f){if(_0x52296f){_0x40b2c1=_0x52296f[_0x05f4('0x32')];if(!_0x569c5b['query']['hasOwnProperty']('nolimit')){_0x198697['limit']=qs[_0x05f4('0x34')](_0x569c5b[_0x05f4('0x31')][_0x05f4('0x34')]);_0x198697[_0x05f4('0x18')]=qs[_0x05f4('0x18')](_0x569c5b[_0x05f4('0x31')]['offset']);}return _0x46f0fa[_0x05f4('0x4c')](_0x198697);}})[_0x05f4('0x1f')](function(_0x450d8b){if(_0x450d8b){return _0x450d8b?{'count':_0x40b2c1,'rows':_0x450d8b}:null;}})[_0x05f4('0x1f')](respondWithResult(_0x132d18,null))[_0x05f4('0x41')](handleError(_0x132d18,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index f41152c..e5cc2e4 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 _0x5d86=['int_servicenow_configurations','lodash','util','moment','request-promise','path','../../config/environment','exports','define'];(function(_0x549899,_0x5edefe){var _0x53cc91=function(_0x5e0ba3){while(--_0x5e0ba3){_0x549899['push'](_0x549899['shift']());}};_0x53cc91(++_0x5edefe);}(_0x5d86,0x76));var _0x65d8=function(_0x180c9b,_0x13d173){_0x180c9b=_0x180c9b-0x0;var _0x3ff116=_0x5d86[_0x180c9b];return _0x3ff116;};'use strict';var _=require(_0x65d8('0x0'));var util=require(_0x65d8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x65d8('0x2'));var BPromise=require('bluebird');var rp=require(_0x65d8('0x3'));var fs=require('fs');var path=require(_0x65d8('0x4'));var rimraf=require('rimraf');var config=require(_0x65d8('0x5'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x65d8('0x6')]=function(_0x50c922,_0x1581a6){return _0x50c922[_0x65d8('0x7')]('ServicenowConfiguration',attributes,{'tableName':_0x65d8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddb8=['path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','util','../../config/logger','api','bluebird','request-promise'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xddb8,0xd7));var _0x8ddb=function(_0x5aab82,_0x27ca03){_0x5aab82=_0x5aab82-0x0;var _0x3b5272=_0xddb8[_0x5aab82];return _0x3b5272;};'use strict';var _=require('lodash');var util=require(_0x8ddb('0x0'));var logger=require(_0x8ddb('0x1'))(_0x8ddb('0x2'));var moment=require('moment');var BPromise=require(_0x8ddb('0x3'));var rp=require(_0x8ddb('0x4'));var fs=require('fs');var path=require(_0x8ddb('0x5'));var rimraf=require(_0x8ddb('0x6'));var config=require(_0x8ddb('0x7'));var attributes=require(_0x8ddb('0x8'));module['exports']=function(_0x5a52ec,_0x2ebc4b){return _0x5a52ec[_0x8ddb('0x9')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','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 f00e91c..a3fa74e 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 _0xef78=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','bluebird','randomstring','ioredis'];(function(_0x39f28c,_0x53199a){var _0x4ca8d9=function(_0x515895){while(--_0x515895){_0x39f28c['push'](_0x39f28c['shift']());}};_0x4ca8d9(++_0x53199a);}(_0xef78,0x18b));var _0x8ef7=function(_0x2507c0,_0x31c7f1){_0x2507c0=_0x2507c0-0x0;var _0x40eb0d=_0xef78[_0x2507c0];return _0x40eb0d;};'use strict';var _=require(_0x8ef7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8ef7('0x1'));var rs=require(_0x8ef7('0x2'));var fs=require('fs');var Redis=require(_0x8ef7('0x3'));var db=require(_0x8ef7('0x4'))['db'];var utils=require(_0x8ef7('0x5'));var logger=require(_0x8ef7('0x6'))(_0x8ef7('0x7'));var config=require('../../config/environment');var jayson=require(_0x8ef7('0x8'));var client=jayson['client'][_0x8ef7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d1ed0,_0x717607,_0x42e91b){return new BPromise(function(_0x54be63,_0x7f1f4f){return client[_0x8ef7('0xa')](_0x4d1ed0,_0x42e91b)[_0x8ef7('0xb')](function(_0x1df65a){logger[_0x8ef7('0xc')](_0x8ef7('0xd'),_0x717607,_0x8ef7('0xe'));logger['debug'](_0x8ef7('0xf'),_0x717607,_0x8ef7('0xe'),JSON['stringify'](_0x1df65a));if(_0x1df65a[_0x8ef7('0x10')]){if(_0x1df65a[_0x8ef7('0x10')]['code']===0x1f4){logger[_0x8ef7('0x10')](_0x8ef7('0xd'),_0x717607,_0x1df65a[_0x8ef7('0x10')][_0x8ef7('0x11')]);return _0x7f1f4f(_0x1df65a['error'][_0x8ef7('0x11')]);}logger[_0x8ef7('0x10')](_0x8ef7('0xd'),_0x717607,_0x1df65a[_0x8ef7('0x10')]['message']);return _0x54be63(_0x1df65a[_0x8ef7('0x10')]['message']);}else{logger['info'](_0x8ef7('0xd'),_0x717607,_0x8ef7('0xe'));_0x54be63(_0x1df65a[_0x8ef7('0x12')][_0x8ef7('0x11')]);}})['catch'](function(_0x518af0){logger[_0x8ef7('0x10')](_0x8ef7('0xd'),_0x717607,_0x518af0);_0x7f1f4f(_0x518af0);});});} \ No newline at end of file +var _0x7eab=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x196bb9,_0x6b442a){var _0x439e43=function(_0x41fce4){while(--_0x41fce4){_0x196bb9['push'](_0x196bb9['shift']());}};_0x439e43(++_0x6b442a);}(_0x7eab,0xf8));var _0xb7ea=function(_0x3828d2,_0x2bab59){_0x3828d2=_0x3828d2-0x0;var _0x469d22=_0x7eab[_0x3828d2];return _0x469d22;};'use strict';var _=require('lodash');var util=require(_0xb7ea('0x0'));var moment=require(_0xb7ea('0x1'));var BPromise=require(_0xb7ea('0x2'));var rs=require(_0xb7ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7ea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7ea('0x5'))(_0xb7ea('0x6'));var config=require(_0xb7ea('0x7'));var jayson=require(_0xb7ea('0x8'));var client=jayson[_0xb7ea('0x9')][_0xb7ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c5429,_0x494c1a,_0x43ae67){return new BPromise(function(_0x43e317,_0x47e08b){return client[_0xb7ea('0xb')](_0x4c5429,_0x43ae67)[_0xb7ea('0xc')](function(_0x25ccc3){logger[_0xb7ea('0xd')](_0xb7ea('0xe'),_0x494c1a,_0xb7ea('0xf'));logger[_0xb7ea('0x10')](_0xb7ea('0x11'),_0x494c1a,'request\x20sent',JSON['stringify'](_0x25ccc3));if(_0x25ccc3[_0xb7ea('0x12')]){if(_0x25ccc3[_0xb7ea('0x12')][_0xb7ea('0x13')]===0x1f4){logger[_0xb7ea('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x494c1a,_0x25ccc3[_0xb7ea('0x12')][_0xb7ea('0x14')]);return _0x47e08b(_0x25ccc3[_0xb7ea('0x12')]['message']);}logger['error'](_0xb7ea('0xe'),_0x494c1a,_0x25ccc3['error'][_0xb7ea('0x14')]);return _0x43e317(_0x25ccc3[_0xb7ea('0x12')][_0xb7ea('0x14')]);}else{logger[_0xb7ea('0xd')](_0xb7ea('0xe'),_0x494c1a,_0xb7ea('0xf'));_0x43e317(_0x25ccc3[_0xb7ea('0x15')][_0xb7ea('0x14')]);}})['catch'](function(_0x52729d){logger['error'](_0xb7ea('0xe'),_0x494c1a,_0x52729d);_0x47e08b(_0x52729d);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index b3cf732..5a0043c 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 _0xce6e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','get','show','post','/:id','delete','exports','multer','util','path','express'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0xce6e,0x15c));var _0xece6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce6e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xece6('0x0'));var util=require(_0xece6('0x1'));var path=require(_0xece6('0x2'));var timeout=require('connect-timeout');var express=require(_0xece6('0x3'));var router=express[_0xece6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xece6('0x5'));var interaction=require(_0xece6('0x6'));var config=require(_0xece6('0x7'));var controller=require(_0xece6('0x8'));router['get']('/',auth[_0xece6('0x9')](),controller['index']);router[_0xece6('0xa')]('/:id',auth[_0xece6('0x9')](),controller[_0xece6('0xb')]);router[_0xece6('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xece6('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xece6('0xe')](_0xece6('0xd'),auth[_0xece6('0x9')](),controller['destroy']);module[_0xece6('0xf')]=router; \ No newline at end of file +var _0x844f=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x1f946a,_0x38f2f3){var _0x4c71cf=function(_0x5c09d4){while(--_0x5c09d4){_0x1f946a['push'](_0x1f946a['shift']());}};_0x4c71cf(++_0x38f2f3);}(_0x844f,0x11b));var _0xf844=function(_0x5c4c71,_0x3445f8){_0x5c4c71=_0x5c4c71-0x0;var _0x167d6b=_0x844f[_0x5c4c71];return _0x167d6b;};'use strict';var multer=require(_0xf844('0x0'));var util=require('util');var path=require(_0xf844('0x1'));var timeout=require(_0xf844('0x2'));var express=require(_0xf844('0x3'));var router=express[_0xf844('0x4')]();var fs_extra=require(_0xf844('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf844('0x6'));var config=require(_0xf844('0x7'));var controller=require('./intServicenowField.controller');router[_0xf844('0x8')]('/',auth[_0xf844('0x9')](),controller[_0xf844('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf844('0xb')]('/',auth[_0xf844('0x9')](),controller[_0xf844('0xc')]);router[_0xf844('0xd')](_0xf844('0xe'),auth[_0xf844('0x9')](),controller[_0xf844('0xf')]);router[_0xf844('0x10')](_0xf844('0xe'),auth[_0xf844('0x9')](),controller[_0xf844('0x11')]);module[_0xf844('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 db20a81..729e702 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 _0xceae=['string','STRING','ENUM','sequelize','exports','variable','customVariable','keyValue','picklist'];(function(_0x4555aa,_0x1edfcf){var _0x3bccd9=function(_0x2313e6){while(--_0x2313e6){_0x4555aa['push'](_0x4555aa['shift']());}};_0x3bccd9(++_0x1edfcf);}(_0xceae,0xa5));var _0xecea=function(_0x36d45b,_0x417426){_0x36d45b=_0x36d45b-0x0;var _0x3dc01c=_0xceae[_0x36d45b];return _0x3dc01c;};'use strict';var Sequelize=require(_0xecea('0x0'));module[_0xecea('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xecea('0x2'),_0xecea('0x3'),_0xecea('0x4'),_0xecea('0x5')),'defaultValue':_0xecea('0x6')},'content':{'type':Sequelize[_0xecea('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xecea('0x8')](_0xecea('0x6'),_0xecea('0x2'),_0xecea('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xecea('0x7')]},'nameField':{'type':Sequelize[_0xecea('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xecea('0x7')]}}; \ No newline at end of file +var _0x36f9=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist'];(function(_0x385f40,_0x1380ca){var _0x5b4feb=function(_0x1a19d5){while(--_0x1a19d5){_0x385f40['push'](_0x385f40['shift']());}};_0x5b4feb(++_0x1380ca);}(_0x36f9,0xda));var _0x936f=function(_0x225332,_0x3d3b80){_0x225332=_0x225332-0x0;var _0x1dc536=_0x36f9[_0x225332];return _0x1dc536;};'use strict';var Sequelize=require(_0x936f('0x0'));module[_0x936f('0x1')]={'type':{'type':Sequelize[_0x936f('0x2')](_0x936f('0x3'),_0x936f('0x4'),'customVariable',_0x936f('0x5'),_0x936f('0x6')),'defaultValue':_0x936f('0x3')},'content':{'type':Sequelize[_0x936f('0x7')]},'key':{'type':Sequelize[_0x936f('0x7')]},'keyType':{'type':Sequelize[_0x936f('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x936f('0x7')]},'nameField':{'type':Sequelize[_0x936f('0x7')]},'customField':{'type':Sequelize[_0x936f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x936f('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 0eda542..b57080a 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 _0x6e3f=['ServicenowField','findAll','rows','catch','show','params','merge','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','options','includeAll','include'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6e3f,0x191));var _0xf6e3=function(_0x4d4141,_0x404fb1){_0x4d4141=_0x4d4141-0x0;var _0xe29ea5=_0x6e3f[_0x4d4141];return _0xe29ea5;};'use strict';var emlformat=require(_0xf6e3('0x0'));var rimraf=require(_0xf6e3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6e3('0x2'));var rp=require(_0xf6e3('0x3'));var moment=require(_0xf6e3('0x4'));var BPromise=require(_0xf6e3('0x5'));var Mustache=require(_0xf6e3('0x6'));var util=require('util');var path=require(_0xf6e3('0x7'));var sox=require(_0xf6e3('0x8'));var csv=require(_0xf6e3('0x9'));var ejs=require(_0xf6e3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf6e3('0xb'));var squel=require(_0xf6e3('0xc'));var crypto=require(_0xf6e3('0xd'));var jsforce=require(_0xf6e3('0xe'));var deskjs=require(_0xf6e3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf6e3('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf6e3('0x11'));var qs=require(_0xf6e3('0x12'));var as=require(_0xf6e3('0x13'));var hardwareService=require(_0xf6e3('0x14'));var logger=require(_0xf6e3('0x15'))(_0xf6e3('0x16'));var utils=require(_0xf6e3('0x17'));var config=require(_0xf6e3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf6e3('0x19'))['db'];function respondWithStatusCode(_0x5ed64b,_0x5b253e){_0x5b253e=_0x5b253e||0xcc;return function(_0x38ff0d){if(_0x38ff0d){return _0x5ed64b['sendStatus'](_0x5b253e);}return _0x5ed64b[_0xf6e3('0x1a')](_0x5b253e)[_0xf6e3('0x1b')]();};}function respondWithResult(_0x5d2077,_0x431e2b){_0x431e2b=_0x431e2b||0xc8;return function(_0x4ee2ec){if(_0x4ee2ec){return _0x5d2077['status'](_0x431e2b)['json'](_0x4ee2ec);}};}function respondWithFilteredResult(_0x4487dd,_0x1b150e){return function(_0x476d6e){if(_0x476d6e){var _0x1aa4bf=typeof _0x1b150e[_0xf6e3('0x1c')]===_0xf6e3('0x1d')&&typeof _0x1b150e['limit']===_0xf6e3('0x1d');var _0xe39462=_0x476d6e[_0xf6e3('0x1e')];var _0x3777c7=_0x1aa4bf?0x0:_0x1b150e[_0xf6e3('0x1c')];var _0x4feed2=_0x1aa4bf?_0x476d6e[_0xf6e3('0x1e')]:_0x1b150e[_0xf6e3('0x1c')]+_0x1b150e[_0xf6e3('0x1f')];var _0x2365f2;if(_0x4feed2>=_0xe39462){_0x4feed2=_0xe39462;_0x2365f2=0xc8;}else{_0x2365f2=0xce;}_0x4487dd['status'](_0x2365f2);return _0x4487dd[_0xf6e3('0x20')](_0xf6e3('0x21'),_0x3777c7+'-'+_0x4feed2+'/'+_0xe39462)[_0xf6e3('0x22')](_0x476d6e);}return null;};}function patchUpdates(_0x190e21){return function(_0x2d3f80){try{jsonpatch[_0xf6e3('0x23')](_0x2d3f80,_0x190e21,!![]);}catch(_0x50dff0){return BPromise[_0xf6e3('0x24')](_0x50dff0);}return _0x2d3f80[_0xf6e3('0x25')]();};}function saveUpdates(_0xa1150,_0x3bda29){return function(_0x2970f9){if(_0x2970f9){return _0x2970f9[_0xf6e3('0x26')](_0xa1150)[_0xf6e3('0x27')](function(_0xbad9d9){return _0xbad9d9;});}return null;};}function removeEntity(_0x59f076,_0x5922b9){return function(_0x4d86fe){if(_0x4d86fe){return _0x4d86fe['destroy']()['then'](function(){_0x59f076[_0xf6e3('0x1a')](0xcc)[_0xf6e3('0x1b')]();});}};}function handleEntityNotFound(_0x5eab35,_0x57d2d7){return function(_0x3f5726){if(!_0x3f5726){_0x5eab35['sendStatus'](0x194);}return _0x3f5726;};}function handleError(_0x502e,_0xe72e93){_0xe72e93=_0xe72e93||0x1f4;return function(_0x4ec1b6){logger[_0xf6e3('0x28')](_0x4ec1b6[_0xf6e3('0x29')]);if(_0x4ec1b6['name']){delete _0x4ec1b6[_0xf6e3('0x2a')];}_0x502e[_0xf6e3('0x1a')](_0xe72e93)['send'](_0x4ec1b6);};}exports[_0xf6e3('0x2b')]=function(_0x1503e8,_0x5cbdde){var _0x654006={},_0x10da61={},_0x29cc66={'count':0x0,'rows':[]};var _0x52aaea=_[_0xf6e3('0x2c')](db['ServicenowField'][_0xf6e3('0x2d')],function(_0x159231){return{'name':_0x159231[_0xf6e3('0x2e')],'type':_0x159231['type'][_0xf6e3('0x2f')]};});_0x10da61[_0xf6e3('0x30')]=_[_0xf6e3('0x2c')](_0x52aaea,_0xf6e3('0x2a'));_0x10da61[_0xf6e3('0x31')]=_[_0xf6e3('0x32')](_0x1503e8['query']);_0x10da61['filters']=_[_0xf6e3('0x33')](_0x10da61[_0xf6e3('0x30')],_0x10da61['query']);_0x654006[_0xf6e3('0x34')]=_[_0xf6e3('0x33')](_0x10da61[_0xf6e3('0x30')],qs['fields'](_0x1503e8[_0xf6e3('0x31')][_0xf6e3('0x35')]));_0x654006[_0xf6e3('0x34')]=_0x654006[_0xf6e3('0x34')][_0xf6e3('0x36')]?_0x654006[_0xf6e3('0x34')]:_0x10da61[_0xf6e3('0x30')];if(!_0x1503e8['query']['hasOwnProperty'](_0xf6e3('0x37'))){_0x654006[_0xf6e3('0x1f')]=qs[_0xf6e3('0x1f')](_0x1503e8[_0xf6e3('0x31')][_0xf6e3('0x1f')]);_0x654006[_0xf6e3('0x1c')]=qs[_0xf6e3('0x1c')](_0x1503e8[_0xf6e3('0x31')][_0xf6e3('0x1c')]);}_0x654006[_0xf6e3('0x38')]=qs[_0xf6e3('0x39')](_0x1503e8[_0xf6e3('0x31')][_0xf6e3('0x39')]);_0x654006[_0xf6e3('0x3a')]=qs['filters'](_[_0xf6e3('0x3b')](_0x1503e8[_0xf6e3('0x31')],_0x10da61[_0xf6e3('0x3c')]),_0x52aaea);if(_0x1503e8[_0xf6e3('0x31')][_0xf6e3('0x3d')]){_0x654006[_0xf6e3('0x3a')]=_['merge'](_0x654006[_0xf6e3('0x3a')],{'$or':_['map'](_0x52aaea,function(_0x1f237e){if(_0x1f237e[_0xf6e3('0x3e')]!==_0xf6e3('0x3f')){var _0x19339b={};_0x19339b[_0x1f237e[_0xf6e3('0x2a')]]={'$like':'%'+_0x1503e8['query'][_0xf6e3('0x3d')]+'%'};return _0x19339b;}})});}_0x654006=_['merge']({},_0x654006,_0x1503e8[_0xf6e3('0x40')]);var _0x1d8406={'where':_0x654006[_0xf6e3('0x3a')]};return db['ServicenowField'][_0xf6e3('0x1e')](_0x1d8406)[_0xf6e3('0x27')](function(_0x441191){_0x29cc66[_0xf6e3('0x1e')]=_0x441191;if(_0x1503e8[_0xf6e3('0x31')][_0xf6e3('0x41')]){_0x654006[_0xf6e3('0x42')]=[{'all':!![]}];}return db[_0xf6e3('0x43')][_0xf6e3('0x44')](_0x654006);})[_0xf6e3('0x27')](function(_0x5a898a){_0x29cc66[_0xf6e3('0x45')]=_0x5a898a;return _0x29cc66;})[_0xf6e3('0x27')](respondWithFilteredResult(_0x5cbdde,_0x654006))[_0xf6e3('0x46')](handleError(_0x5cbdde,null));};exports[_0xf6e3('0x47')]=function(_0x3e4690,_0x3f5348){var _0x4dacaa={'raw':!![],'where':{'id':_0x3e4690[_0xf6e3('0x48')]['id']}},_0x309b87={};_0x309b87[_0xf6e3('0x30')]=_['keys'](db[_0xf6e3('0x43')][_0xf6e3('0x2d')]);_0x309b87[_0xf6e3('0x31')]=_[_0xf6e3('0x32')](_0x3e4690['query']);_0x309b87[_0xf6e3('0x3c')]=_['intersection'](_0x309b87[_0xf6e3('0x30')],_0x309b87['query']);_0x4dacaa[_0xf6e3('0x34')]=_['intersection'](_0x309b87[_0xf6e3('0x30')],qs[_0xf6e3('0x35')](_0x3e4690[_0xf6e3('0x31')][_0xf6e3('0x35')]));_0x4dacaa[_0xf6e3('0x34')]=_0x4dacaa[_0xf6e3('0x34')][_0xf6e3('0x36')]?_0x4dacaa[_0xf6e3('0x34')]:_0x309b87[_0xf6e3('0x30')];if(_0x3e4690[_0xf6e3('0x31')][_0xf6e3('0x41')]){_0x4dacaa[_0xf6e3('0x42')]=[{'all':!![]}];}_0x4dacaa=_[_0xf6e3('0x49')]({},_0x4dacaa,_0x3e4690['options']);return db[_0xf6e3('0x43')][_0xf6e3('0x4a')](_0x4dacaa)[_0xf6e3('0x27')](handleEntityNotFound(_0x3f5348,null))[_0xf6e3('0x27')](respondWithResult(_0x3f5348,null))['catch'](handleError(_0x3f5348,null));};exports[_0xf6e3('0x4b')]=function(_0x918d7e,_0x56d38b){return db[_0xf6e3('0x43')][_0xf6e3('0x4b')](_0x918d7e[_0xf6e3('0x4c')],{})[_0xf6e3('0x27')](respondWithResult(_0x56d38b,0xc9))['catch'](handleError(_0x56d38b,null));};exports['update']=function(_0x35d7e0,_0x331efb){if(_0x35d7e0[_0xf6e3('0x4c')]['id']){delete _0x35d7e0[_0xf6e3('0x4c')]['id'];}return db['ServicenowField'][_0xf6e3('0x4a')]({'where':{'id':_0x35d7e0['params']['id']}})[_0xf6e3('0x27')](handleEntityNotFound(_0x331efb,null))['then'](saveUpdates(_0x35d7e0[_0xf6e3('0x4c')],null))[_0xf6e3('0x27')](respondWithResult(_0x331efb,null))['catch'](handleError(_0x331efb,null));};exports[_0xf6e3('0x4d')]=function(_0x2f61df,_0xffd8d7){return db[_0xf6e3('0x43')][_0xf6e3('0x4a')]({'where':{'id':_0x2f61df[_0xf6e3('0x48')]['id']}})['then'](handleEntityNotFound(_0xffd8d7,null))[_0xf6e3('0x27')](removeEntity(_0xffd8d7,null))['catch'](handleError(_0xffd8d7,null));}; \ No newline at end of file +var _0x0b90=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','ServicenowField','findAll','rows','then','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0x461930,_0x329a2a){var _0x382394=function(_0x58a6c5){while(--_0x58a6c5){_0x461930['push'](_0x461930['shift']());}};_0x382394(++_0x329a2a);}(_0x0b90,0x121));var _0x00b9=function(_0x3308e1,_0x3a318d){_0x3308e1=_0x3308e1-0x0;var _0x368941=_0x0b90[_0x3308e1];return _0x368941;};'use strict';var emlformat=require(_0x00b9('0x0'));var rimraf=require(_0x00b9('0x1'));var zipdir=require(_0x00b9('0x2'));var jsonpatch=require(_0x00b9('0x3'));var rp=require(_0x00b9('0x4'));var moment=require(_0x00b9('0x5'));var BPromise=require(_0x00b9('0x6'));var Mustache=require(_0x00b9('0x7'));var util=require(_0x00b9('0x8'));var path=require(_0x00b9('0x9'));var sox=require(_0x00b9('0xa'));var csv=require(_0x00b9('0xb'));var ejs=require(_0x00b9('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00b9('0xd'));var squel=require(_0x00b9('0xe'));var crypto=require(_0x00b9('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x00b9('0x10'));var toCsv=require('to-csv');var querystring=require(_0x00b9('0x11'));var Papa=require(_0x00b9('0x12'));var Redis=require(_0x00b9('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x00b9('0x14'));var as=require(_0x00b9('0x15'));var hardwareService=require(_0x00b9('0x16'));var logger=require(_0x00b9('0x17'))(_0x00b9('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x00b9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bacfc,_0x12a71f){_0x12a71f=_0x12a71f||0xcc;return function(_0x34a3af){if(_0x34a3af){return _0x1bacfc[_0x00b9('0x1a')](_0x12a71f);}return _0x1bacfc[_0x00b9('0x1b')](_0x12a71f)['end']();};}function respondWithResult(_0x105842,_0x6878f5){_0x6878f5=_0x6878f5||0xc8;return function(_0x385726){if(_0x385726){return _0x105842['status'](_0x6878f5)['json'](_0x385726);}};}function respondWithFilteredResult(_0x41e164,_0x473fbb){return function(_0x529f75){if(_0x529f75){var _0x250624=typeof _0x473fbb[_0x00b9('0x1c')]===_0x00b9('0x1d')&&typeof _0x473fbb[_0x00b9('0x1e')]===_0x00b9('0x1d');var _0x50da52=_0x529f75[_0x00b9('0x1f')];var _0x3648fb=_0x250624?0x0:_0x473fbb[_0x00b9('0x1c')];var _0x1e8b30=_0x250624?_0x529f75['count']:_0x473fbb['offset']+_0x473fbb[_0x00b9('0x1e')];var _0x36c43e;if(_0x1e8b30>=_0x50da52){_0x1e8b30=_0x50da52;_0x36c43e=0xc8;}else{_0x36c43e=0xce;}_0x41e164['status'](_0x36c43e);return _0x41e164['set'](_0x00b9('0x20'),_0x3648fb+'-'+_0x1e8b30+'/'+_0x50da52)['json'](_0x529f75);}return null;};}function patchUpdates(_0x49d2be){return function(_0x248650){try{jsonpatch[_0x00b9('0x21')](_0x248650,_0x49d2be,!![]);}catch(_0x5c389e){return BPromise[_0x00b9('0x22')](_0x5c389e);}return _0x248650[_0x00b9('0x23')]();};}function saveUpdates(_0x506dee,_0x279546){return function(_0x1f755f){if(_0x1f755f){return _0x1f755f[_0x00b9('0x24')](_0x506dee)['then'](function(_0x3cfed9){return _0x3cfed9;});}return null;};}function removeEntity(_0xc65d8d,_0x1f2e64){return function(_0x345c0d){if(_0x345c0d){return _0x345c0d[_0x00b9('0x25')]()['then'](function(){_0xc65d8d[_0x00b9('0x1b')](0xcc)[_0x00b9('0x26')]();});}};}function handleEntityNotFound(_0x32467f,_0x4b3cec){return function(_0x719d20){if(!_0x719d20){_0x32467f[_0x00b9('0x1a')](0x194);}return _0x719d20;};}function handleError(_0x4a7e96,_0x5314eb){_0x5314eb=_0x5314eb||0x1f4;return function(_0x401a5c){logger['error'](_0x401a5c[_0x00b9('0x27')]);if(_0x401a5c['name']){delete _0x401a5c[_0x00b9('0x28')];}_0x4a7e96[_0x00b9('0x1b')](_0x5314eb)[_0x00b9('0x29')](_0x401a5c);};}exports[_0x00b9('0x2a')]=function(_0x4b6417,_0x1f0518){var _0x4ec4fb={},_0x1b4fe2={},_0x3642c2={'count':0x0,'rows':[]};var _0x951ec9=_[_0x00b9('0x2b')](db['ServicenowField'][_0x00b9('0x2c')],function(_0x28af1f){return{'name':_0x28af1f[_0x00b9('0x2d')],'type':_0x28af1f[_0x00b9('0x2e')][_0x00b9('0x2f')]};});_0x1b4fe2['model']=_[_0x00b9('0x2b')](_0x951ec9,_0x00b9('0x28'));_0x1b4fe2['query']=_[_0x00b9('0x30')](_0x4b6417[_0x00b9('0x31')]);_0x1b4fe2[_0x00b9('0x32')]=_[_0x00b9('0x33')](_0x1b4fe2['model'],_0x1b4fe2[_0x00b9('0x31')]);_0x4ec4fb[_0x00b9('0x34')]=_[_0x00b9('0x33')](_0x1b4fe2[_0x00b9('0x35')],qs['fields'](_0x4b6417[_0x00b9('0x31')][_0x00b9('0x36')]));_0x4ec4fb['attributes']=_0x4ec4fb[_0x00b9('0x34')][_0x00b9('0x37')]?_0x4ec4fb['attributes']:_0x1b4fe2[_0x00b9('0x35')];if(!_0x4b6417['query'][_0x00b9('0x38')]('nolimit')){_0x4ec4fb['limit']=qs[_0x00b9('0x1e')](_0x4b6417['query'][_0x00b9('0x1e')]);_0x4ec4fb[_0x00b9('0x1c')]=qs[_0x00b9('0x1c')](_0x4b6417[_0x00b9('0x31')][_0x00b9('0x1c')]);}_0x4ec4fb[_0x00b9('0x39')]=qs['sort'](_0x4b6417[_0x00b9('0x31')][_0x00b9('0x3a')]);_0x4ec4fb[_0x00b9('0x3b')]=qs[_0x00b9('0x32')](_[_0x00b9('0x3c')](_0x4b6417[_0x00b9('0x31')],_0x1b4fe2['filters']),_0x951ec9);if(_0x4b6417[_0x00b9('0x31')]['filter']){_0x4ec4fb[_0x00b9('0x3b')]=_[_0x00b9('0x3d')](_0x4ec4fb[_0x00b9('0x3b')],{'$or':_[_0x00b9('0x2b')](_0x951ec9,function(_0x49b2aa){if(_0x49b2aa[_0x00b9('0x2e')]!==_0x00b9('0x3e')){var _0x3a80c4={};_0x3a80c4[_0x49b2aa['name']]={'$like':'%'+_0x4b6417[_0x00b9('0x31')][_0x00b9('0x3f')]+'%'};return _0x3a80c4;}})});}_0x4ec4fb=_['merge']({},_0x4ec4fb,_0x4b6417[_0x00b9('0x40')]);var _0x22f582={'where':_0x4ec4fb['where']};return db['ServicenowField'][_0x00b9('0x1f')](_0x22f582)['then'](function(_0x346434){_0x3642c2['count']=_0x346434;if(_0x4b6417[_0x00b9('0x31')][_0x00b9('0x41')]){_0x4ec4fb[_0x00b9('0x42')]=[{'all':!![]}];}return db[_0x00b9('0x43')][_0x00b9('0x44')](_0x4ec4fb);})['then'](function(_0x5cc4b6){_0x3642c2[_0x00b9('0x45')]=_0x5cc4b6;return _0x3642c2;})[_0x00b9('0x46')](respondWithFilteredResult(_0x1f0518,_0x4ec4fb))[_0x00b9('0x47')](handleError(_0x1f0518,null));};exports[_0x00b9('0x48')]=function(_0x3864d4,_0x569020){var _0x560c6c={'raw':!![],'where':{'id':_0x3864d4[_0x00b9('0x49')]['id']}},_0x11b0f4={};_0x11b0f4[_0x00b9('0x35')]=_[_0x00b9('0x30')](db[_0x00b9('0x43')][_0x00b9('0x2c')]);_0x11b0f4[_0x00b9('0x31')]=_[_0x00b9('0x30')](_0x3864d4[_0x00b9('0x31')]);_0x11b0f4[_0x00b9('0x32')]=_['intersection'](_0x11b0f4[_0x00b9('0x35')],_0x11b0f4[_0x00b9('0x31')]);_0x560c6c[_0x00b9('0x34')]=_['intersection'](_0x11b0f4[_0x00b9('0x35')],qs[_0x00b9('0x36')](_0x3864d4[_0x00b9('0x31')][_0x00b9('0x36')]));_0x560c6c[_0x00b9('0x34')]=_0x560c6c[_0x00b9('0x34')][_0x00b9('0x37')]?_0x560c6c['attributes']:_0x11b0f4[_0x00b9('0x35')];if(_0x3864d4['query'][_0x00b9('0x41')]){_0x560c6c[_0x00b9('0x42')]=[{'all':!![]}];}_0x560c6c=_[_0x00b9('0x3d')]({},_0x560c6c,_0x3864d4[_0x00b9('0x40')]);return db['ServicenowField'][_0x00b9('0x4a')](_0x560c6c)[_0x00b9('0x46')](handleEntityNotFound(_0x569020,null))[_0x00b9('0x46')](respondWithResult(_0x569020,null))[_0x00b9('0x47')](handleError(_0x569020,null));};exports[_0x00b9('0x4b')]=function(_0x4b5050,_0x492d26){return db[_0x00b9('0x43')][_0x00b9('0x4b')](_0x4b5050[_0x00b9('0x4c')],{})[_0x00b9('0x46')](respondWithResult(_0x492d26,0xc9))[_0x00b9('0x47')](handleError(_0x492d26,null));};exports[_0x00b9('0x24')]=function(_0x13afff,_0x50d74b){if(_0x13afff[_0x00b9('0x4c')]['id']){delete _0x13afff[_0x00b9('0x4c')]['id'];}return db[_0x00b9('0x43')][_0x00b9('0x4a')]({'where':{'id':_0x13afff[_0x00b9('0x49')]['id']}})[_0x00b9('0x46')](handleEntityNotFound(_0x50d74b,null))[_0x00b9('0x46')](saveUpdates(_0x13afff[_0x00b9('0x4c')],null))['then'](respondWithResult(_0x50d74b,null))['catch'](handleError(_0x50d74b,null));};exports[_0x00b9('0x25')]=function(_0x17cd6b,_0x1c9af3){return db[_0x00b9('0x43')][_0x00b9('0x4a')]({'where':{'id':_0x17cd6b[_0x00b9('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c9af3,null))[_0x00b9('0x46')](removeEntity(_0x1c9af3,null))[_0x00b9('0x47')](handleError(_0x1c9af3,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index d5c5f5e..9eb986d 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 _0x2fe6=['exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes'];(function(_0x3c57a1,_0x120278){var _0x2744b0=function(_0x4d4b4e){while(--_0x4d4b4e){_0x3c57a1['push'](_0x3c57a1['shift']());}};_0x2744b0(++_0x120278);}(_0x2fe6,0x7b));var _0x62fe=function(_0x13f779,_0x5a9934){_0x13f779=_0x13f779-0x0;var _0x17dcac=_0x2fe6[_0x13f779];return _0x17dcac;};'use strict';var _=require(_0x62fe('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x62fe('0x1'));var BPromise=require('bluebird');var rp=require(_0x62fe('0x2'));var fs=require('fs');var path=require(_0x62fe('0x3'));var rimraf=require(_0x62fe('0x4'));var config=require(_0x62fe('0x5'));var attributes=require(_0x62fe('0x6'));module[_0x62fe('0x7')]=function(_0xd62252,_0x9782c9){return _0xd62252[_0x62fe('0x8')](_0x62fe('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x62fe('0xa'),'fields':[_0x62fe('0xb'),_0x62fe('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd55a=['idField','FieldId','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','exports','define','int_servicenow_fields'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xd55a,0xb6));var _0xad55=function(_0x4484ce,_0x116c03){_0x4484ce=_0x4484ce-0x0;var _0x24770a=_0xd55a[_0x4484ce];return _0x24770a;};'use strict';var _=require(_0xad55('0x0'));var util=require(_0xad55('0x1'));var logger=require(_0xad55('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xad55('0x3'));var fs=require('fs');var path=require(_0xad55('0x4'));var rimraf=require(_0xad55('0x5'));var config=require(_0xad55('0x6'));var attributes=require('./intServicenowField.attributes');module[_0xad55('0x7')]=function(_0xa2a33,_0x291293){return _0xa2a33[_0xad55('0x8')]('ServicenowField',attributes,{'tableName':_0xad55('0x9'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xad55('0xa'),_0xad55('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 7deb657..728db59 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x1b3a5c,_0x2f9d5f){var _0x2ae8cb=function(_0x549ab8){while(--_0x549ab8){_0x1b3a5c['push'](_0x1b3a5c['shift']());}};_0x2ae8cb(++_0x2f9d5f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x32056c,_0x1b6db7){var _0x317313=function(_0x6456b6){while(--_0x6456b6){_0x32056c['push'](_0x32056c['shift']());}};_0x317313(++_0x1b6db7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 359fb2c..5d1a0f8 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x44b738,_0x3c9e38){var _0x49308b=function(_0x288ed2){while(--_0x288ed2){_0x44b738['push'](_0x44b738['shift']());}};_0x49308b(++_0x3c9e38);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +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(_0xc6bce3,_0x4ee2c2){var _0x8b64fc=function(_0x487f3e){while(--_0x487f3e){_0xc6bce3['push'](_0xc6bce3['shift']());}};_0x8b64fc(++_0x4ee2c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 93bbe82..625a554 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(_0x4aea9b,_0x1a6500){var _0x23a590=function(_0x6d8ade){while(--_0x6d8ade){_0x4aea9b['push'](_0x4aea9b['shift']());}};_0x23a590(++_0x1a6500);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x239efc,_0x55e615){var _0x28aa2c=function(_0x189e5b){while(--_0x189e5b){_0x239efc['push'](_0x239efc['shift']());}};_0x28aa2c(++_0x55e615);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 f17bbe4..110ddbd 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 _0x6c77=['status','json','offset','limit','count','set','apply','reject','then','destroy','end','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','length','create','body','find','params','SugarcrmConfiguration','filter','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','username','remoteUri','slice','lastIndexOf','POST','format','%s%s','login','JSON','stringify','password','PLAIN','Invalid\x20Login','/service/v4_1/rest.php','get_module_fields','module_fields','remove','includes','label','values','value','statusCode','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration'];(function(_0x1fbb69,_0x541d33){var _0x4bb876=function(_0x499882){while(--_0x499882){_0x1fbb69['push'](_0x1fbb69['shift']());}};_0x4bb876(++_0x541d33);}(_0x6c77,0x143));var _0x76c7=function(_0x1c47b0,_0x19e61c){_0x1c47b0=_0x1c47b0-0x0;var _0x5ae2e3=_0x6c77[_0x1c47b0];return _0x5ae2e3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76c7('0x0'));var zipdir=require(_0x76c7('0x1'));var jsonpatch=require(_0x76c7('0x2'));var rp=require(_0x76c7('0x3'));var moment=require('moment');var BPromise=require(_0x76c7('0x4'));var Mustache=require(_0x76c7('0x5'));var util=require(_0x76c7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x76c7('0x7'));var ejs=require(_0x76c7('0x8'));var fs=require('fs');var fs_extra=require(_0x76c7('0x9'));var _=require(_0x76c7('0xa'));var squel=require(_0x76c7('0xb'));var crypto=require(_0x76c7('0xc'));var jsforce=require(_0x76c7('0xd'));var deskjs=require(_0x76c7('0xe'));var toCsv=require(_0x76c7('0x7'));var querystring=require(_0x76c7('0xf'));var Papa=require(_0x76c7('0x10'));var Redis=require(_0x76c7('0x11'));var authService=require(_0x76c7('0x12'));var qs=require(_0x76c7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x76c7('0x14'))('api');var utils=require(_0x76c7('0x15'));var config=require(_0x76c7('0x16'));var licenseUtil=require(_0x76c7('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x76c7('0x18'));function respondWithStatusCode(_0x166c2e,_0x1842bc){_0x1842bc=_0x1842bc||0xcc;return function(_0x3a4cf1){if(_0x3a4cf1){return _0x166c2e['sendStatus'](_0x1842bc);}return _0x166c2e['status'](_0x1842bc)['end']();};}function respondWithResult(_0x19d239,_0x4d7a40){_0x4d7a40=_0x4d7a40||0xc8;return function(_0x439507){if(_0x439507){return _0x19d239[_0x76c7('0x19')](_0x4d7a40)[_0x76c7('0x1a')](_0x439507);}};}function respondWithFilteredResult(_0x2ba6e1,_0x39dfc9){return function(_0xd2f189){if(_0xd2f189){var _0x544bf6=typeof _0x39dfc9[_0x76c7('0x1b')]==='undefined'&&typeof _0x39dfc9[_0x76c7('0x1c')]==='undefined';var _0xcabbd8=_0xd2f189[_0x76c7('0x1d')];var _0x3a630e=_0x544bf6?0x0:_0x39dfc9['offset'];var _0x1062e6=_0x544bf6?_0xd2f189[_0x76c7('0x1d')]:_0x39dfc9[_0x76c7('0x1b')]+_0x39dfc9[_0x76c7('0x1c')];var _0x2763e4;if(_0x1062e6>=_0xcabbd8){_0x1062e6=_0xcabbd8;_0x2763e4=0xc8;}else{_0x2763e4=0xce;}_0x2ba6e1['status'](_0x2763e4);return _0x2ba6e1[_0x76c7('0x1e')]('Content-Range',_0x3a630e+'-'+_0x1062e6+'/'+_0xcabbd8)[_0x76c7('0x1a')](_0xd2f189);}return null;};}function patchUpdates(_0x435986){return function(_0x3cd65b){try{jsonpatch[_0x76c7('0x1f')](_0x3cd65b,_0x435986,!![]);}catch(_0x30ed83){return BPromise[_0x76c7('0x20')](_0x30ed83);}return _0x3cd65b['save']();};}function saveUpdates(_0x301998,_0x47b101){return function(_0x2f6bc1){if(_0x2f6bc1){return _0x2f6bc1['update'](_0x301998)[_0x76c7('0x21')](function(_0x443c8d){return _0x443c8d;});}return null;};}function removeEntity(_0x1a38a9,_0x4e9d53){return function(_0x147a9f){if(_0x147a9f){return _0x147a9f[_0x76c7('0x22')]()[_0x76c7('0x21')](function(){_0x1a38a9[_0x76c7('0x19')](0xcc)[_0x76c7('0x23')]();});}};}function handleEntityNotFound(_0x1de46c,_0x2c2638){return function(_0x4a8991){if(!_0x4a8991){_0x1de46c[_0x76c7('0x24')](0x194);}return _0x4a8991;};}function handleError(_0x8e8569,_0x38dcd5){_0x38dcd5=_0x38dcd5||0x1f4;return function(_0x54950f){logger[_0x76c7('0x25')](_0x54950f[_0x76c7('0x26')]);if(_0x54950f[_0x76c7('0x27')]){delete _0x54950f[_0x76c7('0x27')];}_0x8e8569[_0x76c7('0x19')](_0x38dcd5)[_0x76c7('0x28')](_0x54950f);};}exports[_0x76c7('0x29')]=function(_0xa0a3c9,_0x3729dd){var _0x5a7e14={},_0x13db2c={},_0x3d3ffb={'count':0x0,'rows':[]};var _0x2d158d=_[_0x76c7('0x2a')](db[_0x76c7('0x2b')][_0x76c7('0x2c')],function(_0x74a30e){return{'name':_0x74a30e[_0x76c7('0x2d')],'type':_0x74a30e[_0x76c7('0x2e')][_0x76c7('0x2f')]};});_0x13db2c[_0x76c7('0x30')]=_[_0x76c7('0x2a')](_0x2d158d,_0x76c7('0x27'));_0x13db2c['query']=_[_0x76c7('0x31')](_0xa0a3c9['query']);_0x13db2c[_0x76c7('0x32')]=_[_0x76c7('0x33')](_0x13db2c[_0x76c7('0x30')],_0x13db2c[_0x76c7('0x34')]);_0x5a7e14['attributes']=_[_0x76c7('0x33')](_0x13db2c['model'],qs[_0x76c7('0x35')](_0xa0a3c9[_0x76c7('0x34')][_0x76c7('0x35')]));_0x5a7e14[_0x76c7('0x36')]=_0x5a7e14[_0x76c7('0x36')]['length']?_0x5a7e14[_0x76c7('0x36')]:_0x13db2c[_0x76c7('0x30')];if(!_0xa0a3c9[_0x76c7('0x34')][_0x76c7('0x37')](_0x76c7('0x38'))){_0x5a7e14[_0x76c7('0x1c')]=qs[_0x76c7('0x1c')](_0xa0a3c9[_0x76c7('0x34')]['limit']);_0x5a7e14['offset']=qs[_0x76c7('0x1b')](_0xa0a3c9[_0x76c7('0x34')][_0x76c7('0x1b')]);}_0x5a7e14[_0x76c7('0x39')]=qs[_0x76c7('0x3a')](_0xa0a3c9[_0x76c7('0x34')][_0x76c7('0x3a')]);_0x5a7e14[_0x76c7('0x3b')]=qs[_0x76c7('0x32')](_[_0x76c7('0x3c')](_0xa0a3c9[_0x76c7('0x34')],_0x13db2c[_0x76c7('0x32')]),_0x2d158d);if(_0xa0a3c9['query']['filter']){_0x5a7e14[_0x76c7('0x3b')]=_[_0x76c7('0x3d')](_0x5a7e14[_0x76c7('0x3b')],{'$or':_[_0x76c7('0x2a')](_0x2d158d,function(_0x4e1565){if(_0x4e1565[_0x76c7('0x2e')]!==_0x76c7('0x3e')){var _0x524fb6={};_0x524fb6[_0x4e1565[_0x76c7('0x27')]]={'$like':'%'+_0xa0a3c9[_0x76c7('0x34')]['filter']+'%'};return _0x524fb6;}})});}_0x5a7e14=_[_0x76c7('0x3d')]({},_0x5a7e14,_0xa0a3c9[_0x76c7('0x3f')]);var _0x55a284={'where':_0x5a7e14[_0x76c7('0x3b')]};return db[_0x76c7('0x2b')][_0x76c7('0x1d')](_0x55a284)[_0x76c7('0x21')](function(_0x39aad1){_0x3d3ffb[_0x76c7('0x1d')]=_0x39aad1;if(_0xa0a3c9[_0x76c7('0x34')][_0x76c7('0x40')]){_0x5a7e14[_0x76c7('0x41')]=[{'all':!![]}];}return db[_0x76c7('0x2b')]['findAll'](_0x5a7e14);})[_0x76c7('0x21')](function(_0x241c6c){_0x3d3ffb[_0x76c7('0x42')]=_0x241c6c;return _0x3d3ffb;})[_0x76c7('0x21')](respondWithFilteredResult(_0x3729dd,_0x5a7e14))[_0x76c7('0x43')](handleError(_0x3729dd,null));};exports[_0x76c7('0x44')]=function(_0x1ec193,_0x532666){var _0x3ad283={'raw':![],'where':{'id':_0x1ec193['params']['id']}},_0x170373={};_0x170373[_0x76c7('0x30')]=_[_0x76c7('0x31')](db[_0x76c7('0x2b')]['rawAttributes']);_0x170373[_0x76c7('0x34')]=_[_0x76c7('0x31')](_0x1ec193['query']);_0x170373[_0x76c7('0x32')]=_['intersection'](_0x170373[_0x76c7('0x30')],_0x170373['query']);_0x3ad283[_0x76c7('0x36')]=_[_0x76c7('0x33')](_0x170373[_0x76c7('0x30')],qs[_0x76c7('0x35')](_0x1ec193[_0x76c7('0x34')][_0x76c7('0x35')]));_0x3ad283[_0x76c7('0x36')]=_0x3ad283['attributes'][_0x76c7('0x45')]?_0x3ad283[_0x76c7('0x36')]:_0x170373[_0x76c7('0x30')];if(_0x1ec193[_0x76c7('0x34')][_0x76c7('0x40')]){_0x3ad283[_0x76c7('0x41')]=[{'all':!![]}];}_0x3ad283=_[_0x76c7('0x3d')]({},_0x3ad283,_0x1ec193['options']);return db[_0x76c7('0x2b')]['find'](_0x3ad283)[_0x76c7('0x21')](handleEntityNotFound(_0x532666,null))[_0x76c7('0x21')](respondWithResult(_0x532666,null))[_0x76c7('0x43')](handleError(_0x532666,null));};exports[_0x76c7('0x46')]=function(_0x50c5a0,_0x48aa31){return db[_0x76c7('0x2b')]['create'](_0x50c5a0[_0x76c7('0x47')],{})[_0x76c7('0x21')](respondWithResult(_0x48aa31,0xc9))['catch'](handleError(_0x48aa31,null));};exports['update']=function(_0x5d0788,_0x1aa61c){if(_0x5d0788['body']['id']){delete _0x5d0788[_0x76c7('0x47')]['id'];}return db[_0x76c7('0x2b')][_0x76c7('0x48')]({'where':{'id':_0x5d0788['params']['id']}})[_0x76c7('0x21')](handleEntityNotFound(_0x1aa61c,null))[_0x76c7('0x21')](saveUpdates(_0x5d0788[_0x76c7('0x47')],null))[_0x76c7('0x21')](respondWithResult(_0x1aa61c,null))[_0x76c7('0x43')](handleError(_0x1aa61c,null));};exports[_0x76c7('0x22')]=function(_0x533bfc,_0x1b3616){return db['SugarcrmAccount'][_0x76c7('0x48')]({'where':{'id':_0x533bfc[_0x76c7('0x49')]['id']}})[_0x76c7('0x21')](handleEntityNotFound(_0x1b3616,null))[_0x76c7('0x21')](removeEntity(_0x1b3616,null))[_0x76c7('0x43')](handleError(_0x1b3616,null));};exports['getConfigurations']=function(_0x1bf53c,_0x4f5a21,_0x16ba57){var _0x4782da={};var _0x496e7d={};var _0x1e950d;var _0x465cf1;return db[_0x76c7('0x2b')]['findOne']({'where':{'id':_0x1bf53c[_0x76c7('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f5a21,null))['then'](function(_0x1bb9f7){if(_0x1bb9f7){_0x1e950d=_0x1bb9f7;_0x496e7d[_0x76c7('0x30')]=_[_0x76c7('0x31')](db[_0x76c7('0x4a')][_0x76c7('0x2c')]);_0x496e7d['query']=_[_0x76c7('0x31')](_0x1bf53c[_0x76c7('0x34')]);_0x496e7d[_0x76c7('0x32')]=_[_0x76c7('0x33')](_0x496e7d['model'],_0x496e7d[_0x76c7('0x34')]);_0x4782da[_0x76c7('0x36')]=_[_0x76c7('0x33')](_0x496e7d[_0x76c7('0x30')],qs[_0x76c7('0x35')](_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x35')]));_0x4782da[_0x76c7('0x36')]=_0x4782da[_0x76c7('0x36')]['length']?_0x4782da[_0x76c7('0x36')]:_0x496e7d[_0x76c7('0x30')];_0x4782da[_0x76c7('0x39')]=qs[_0x76c7('0x3a')](_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x3a')]);_0x4782da[_0x76c7('0x3b')]=qs[_0x76c7('0x32')](_[_0x76c7('0x3c')](_0x1bf53c[_0x76c7('0x34')],_0x496e7d['filters']));if(_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x4b')]){_0x4782da[_0x76c7('0x3b')]=_[_0x76c7('0x3d')](_0x4782da[_0x76c7('0x3b')],{'$or':_[_0x76c7('0x2a')](_0x4782da['attributes'],function(_0x58280d){var _0x368465={};_0x368465[_0x58280d]={'$like':'%'+_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x4b')]+'%'};return _0x368465;})});}_0x4782da=_[_0x76c7('0x3d')]({},_0x4782da,_0x1bf53c[_0x76c7('0x3f')]);return _0x1e950d[_0x76c7('0x4c')](_0x4782da);}})[_0x76c7('0x21')](function(_0x1ddfd2){if(_0x1ddfd2){_0x465cf1=_0x1ddfd2[_0x76c7('0x45')];if(!_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x37')]('nolimit')){_0x4782da[_0x76c7('0x1c')]=qs['limit'](_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x1c')]);_0x4782da[_0x76c7('0x1b')]=qs[_0x76c7('0x1b')](_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x1b')]);}return _0x1e950d[_0x76c7('0x4c')](_0x4782da);}})[_0x76c7('0x21')](function(_0x3ba835){if(_0x3ba835){return _0x3ba835?{'count':_0x465cf1,'rows':_0x3ba835}:null;}})[_0x76c7('0x21')](respondWithResult(_0x4f5a21,null))[_0x76c7('0x43')](handleError(_0x4f5a21,null));};exports[_0x76c7('0x4d')]=function(_0x3a6e83,_0x39c0a4,_0x549b8c){if(_0x3a6e83[_0x76c7('0x47')]['id']){delete _0x3a6e83['body']['id'];}return db[_0x76c7('0x2b')][_0x76c7('0x4e')]({'where':{'id':_0x3a6e83[_0x76c7('0x49')]['id']}})[_0x76c7('0x21')](handleEntityNotFound(_0x39c0a4,null))[_0x76c7('0x21')](function(_0x91b6f2){if(_0x91b6f2){_0x3a6e83[_0x76c7('0x47')][_0x76c7('0x4f')]=_0x91b6f2['id'];_0x3a6e83[_0x76c7('0x47')][_0x76c7('0x50')]=integrations[_0x76c7('0x51')](_0x3a6e83[_0x76c7('0x47')]['channel'],_0x3a6e83['body'][_0x76c7('0x2e')]);_0x3a6e83[_0x76c7('0x47')][_0x76c7('0x52')]=integrations['getDescriptions'](_0x3a6e83[_0x76c7('0x47')][_0x76c7('0x53')],_0x3a6e83[_0x76c7('0x47')]['type']);return db['SugarcrmConfiguration']['create'](_0x3a6e83[_0x76c7('0x47')],{'include':[{'model':db['SugarcrmField'],'as':_0x76c7('0x50')},{'model':db[_0x76c7('0x54')],'as':_0x76c7('0x52')}]});}return null;})[_0x76c7('0x21')](respondWithResult(_0x39c0a4,null))['catch'](handleError(_0x39c0a4,null));};exports[_0x76c7('0x55')]=function(_0x34abcc,_0x2a3d10,_0x12e57d){var _0x748a5f='';var _0x186c2f=['id','name',_0x76c7('0x56'),'created_by',_0x76c7('0x57'),_0x76c7('0x58'),_0x76c7('0x59'),_0x76c7('0x5a'),_0x76c7('0x5b'),_0x76c7('0x5c'),'parent_name','direction'];return db[_0x76c7('0x2b')][_0x76c7('0x4e')]({'where':{'id':_0x34abcc[_0x76c7('0x49')]['id']},'attributes':['id',_0x76c7('0x5d'),'password','remoteUri']})[_0x76c7('0x21')](handleEntityNotFound(_0x2a3d10,null))[_0x76c7('0x21')](function(_0x3dcf88){if(_0x3dcf88){_0x748a5f=_0x3dcf88[_0x76c7('0x5e')];var _0x2efa62=_0x748a5f[_0x76c7('0x5f')](-0x1);if(_0x2efa62==='/'){_0x748a5f=_0x748a5f['substring'](0x0,_0x748a5f[_0x76c7('0x60')](_0x2efa62));}return rp({'method':_0x76c7('0x61'),'uri':util[_0x76c7('0x62')](_0x76c7('0x63'),_0x748a5f,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x76c7('0x64'),'input_type':'JSON','response_type':_0x76c7('0x65'),'rest_data':JSON[_0x76c7('0x66')]({'user_auth':{'user_name':_0x3dcf88[_0x76c7('0x5d')],'password':_0x3dcf88[_0x76c7('0x67')],'encryption':_0x76c7('0x68')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x76c7('0x21')](function(_0x16e5f0){if(_0x16e5f0&&_0x16e5f0['name']!==_0x76c7('0x69')&&_0x16e5f0[_0x76c7('0x27')]!=='Password\x20Expired'){return rp({'method':_0x76c7('0x61'),'uri':util[_0x76c7('0x62')](_0x76c7('0x63'),_0x748a5f,_0x76c7('0x6a')),'json':!![],'form':{'method':_0x76c7('0x6b'),'input_type':_0x76c7('0x65'),'response_type':'JSON','rest_data':JSON[_0x76c7('0x66')]({'session':_0x16e5f0['id'],'module_name':'Calls'})}})[_0x76c7('0x21')](function(_0x1fd3f7){if(_0x1fd3f7){var _0x4801dd=_['values'](_0x1fd3f7[_0x76c7('0x6c')]);_[_0x76c7('0x6d')](_0x4801dd,function(_0x4ff97d){return _0x186c2f[_0x76c7('0x6e')](_0x4ff97d[_0x76c7('0x27')]);});return{'count':_0x4801dd['length'],'rows':_['map'](_0x4801dd,function(_0x23eaea){return{'id':_0x23eaea[_0x76c7('0x27')],'name':_0x23eaea[_0x76c7('0x6f')],'custom':_['endsWith'](_0x23eaea['name'],'_c')?!![]:![],'options':_0x23eaea['options']?_[_0x76c7('0x2a')](_[_0x76c7('0x70')](_0x23eaea[_0x76c7('0x3f')]),function(_0x1738cc){return{'name':_0x1738cc[_0x76c7('0x71')],'value':_0x1738cc[_0x76c7('0x27')]};}):[]};})};}})[_0x76c7('0x21')](respondWithResult(_0x2a3d10,null))[_0x76c7('0x43')](function(_0x64b780){var _0xd77d9d=_0x34abcc[_0x76c7('0x34')]['test']?0x1f4:_0x64b780[_0x76c7('0x72')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x76c7('0x55'),_0xd77d9d,JSON[_0x76c7('0x66')](_0x64b780));delete _0x64b780[_0x76c7('0x27')];if(_0xd77d9d===0x191){_0xd77d9d=0x190;}_0x2a3d10['status'](_0xd77d9d)[_0x76c7('0x28')](_0x34abcc[_0x76c7('0x34')]['test']?{'message':_0x76c7('0x73'),'statusCode':_0x64b780[_0x76c7('0x72')]}:_0x64b780);});}else{var _0x512c76=0x1f4;_0x2a3d10[_0x76c7('0x19')](_0x512c76)[_0x76c7('0x28')]({'message':_0x76c7('0x73'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x5f9f=['fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','name','send','map','SugarcrmAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','AccountId','channel','Descriptions','getDescriptions','SugarcrmField','Subjects','assigned_user_id','created_by','description','date_start','parent_id','parent_type','direction','username','password','remoteUri','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','module_fields','remove','includes','label','endsWith','values','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5f9f,0x6d));var _0xf5f9=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x5f9f[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xf5f9('0x0'));var rimraf=require(_0xf5f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf5f9('0x2'));var rp=require(_0xf5f9('0x3'));var moment=require(_0xf5f9('0x4'));var BPromise=require(_0xf5f9('0x5'));var Mustache=require(_0xf5f9('0x6'));var util=require(_0xf5f9('0x7'));var path=require(_0xf5f9('0x8'));var sox=require('sox');var csv=require(_0xf5f9('0x9'));var ejs=require(_0xf5f9('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f9('0xb'));var _=require(_0xf5f9('0xc'));var squel=require('squel');var crypto=require(_0xf5f9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf5f9('0xe'));var toCsv=require(_0xf5f9('0x9'));var querystring=require(_0xf5f9('0xf'));var Papa=require('papaparse');var Redis=require(_0xf5f9('0x10'));var authService=require(_0xf5f9('0x11'));var qs=require(_0xf5f9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf5f9('0x13'));var logger=require(_0xf5f9('0x14'))(_0xf5f9('0x15'));var utils=require(_0xf5f9('0x16'));var config=require(_0xf5f9('0x17'));var licenseUtil=require(_0xf5f9('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf5f9('0x19'));function respondWithStatusCode(_0x37f1a4,_0x3e9e9c){_0x3e9e9c=_0x3e9e9c||0xcc;return function(_0x5cdcd7){if(_0x5cdcd7){return _0x37f1a4[_0xf5f9('0x1a')](_0x3e9e9c);}return _0x37f1a4[_0xf5f9('0x1b')](_0x3e9e9c)[_0xf5f9('0x1c')]();};}function respondWithResult(_0x48bcad,_0x2e945d){_0x2e945d=_0x2e945d||0xc8;return function(_0x24f524){if(_0x24f524){return _0x48bcad[_0xf5f9('0x1b')](_0x2e945d)['json'](_0x24f524);}};}function respondWithFilteredResult(_0x5ca60e,_0x1252d9){return function(_0x138058){if(_0x138058){var _0x19ffc9=typeof _0x1252d9[_0xf5f9('0x1d')]==='undefined'&&typeof _0x1252d9[_0xf5f9('0x1e')]===_0xf5f9('0x1f');var _0x5c1391=_0x138058['count'];var _0x367175=_0x19ffc9?0x0:_0x1252d9[_0xf5f9('0x1d')];var _0x5ab03c=_0x19ffc9?_0x138058[_0xf5f9('0x20')]:_0x1252d9[_0xf5f9('0x1d')]+_0x1252d9['limit'];var _0x25919a;if(_0x5ab03c>=_0x5c1391){_0x5ab03c=_0x5c1391;_0x25919a=0xc8;}else{_0x25919a=0xce;}_0x5ca60e[_0xf5f9('0x1b')](_0x25919a);return _0x5ca60e[_0xf5f9('0x21')](_0xf5f9('0x22'),_0x367175+'-'+_0x5ab03c+'/'+_0x5c1391)[_0xf5f9('0x23')](_0x138058);}return null;};}function patchUpdates(_0x357ed8){return function(_0x3e6827){try{jsonpatch[_0xf5f9('0x24')](_0x3e6827,_0x357ed8,!![]);}catch(_0x4fc687){return BPromise['reject'](_0x4fc687);}return _0x3e6827[_0xf5f9('0x25')]();};}function saveUpdates(_0x2b4913,_0x43202f){return function(_0x24b2f1){if(_0x24b2f1){return _0x24b2f1[_0xf5f9('0x26')](_0x2b4913)[_0xf5f9('0x27')](function(_0x5ea36c){return _0x5ea36c;});}return null;};}function removeEntity(_0x1c99b2,_0x5b13eb){return function(_0x524c1a){if(_0x524c1a){return _0x524c1a[_0xf5f9('0x28')]()[_0xf5f9('0x27')](function(){_0x1c99b2[_0xf5f9('0x1b')](0xcc)[_0xf5f9('0x1c')]();});}};}function handleEntityNotFound(_0x3a5eff,_0x4ed4b6){return function(_0xf654aa){if(!_0xf654aa){_0x3a5eff['sendStatus'](0x194);}return _0xf654aa;};}function handleError(_0x5c4b36,_0x1c91d1){_0x1c91d1=_0x1c91d1||0x1f4;return function(_0x31134d){logger['error'](_0x31134d['stack']);if(_0x31134d[_0xf5f9('0x29')]){delete _0x31134d[_0xf5f9('0x29')];}_0x5c4b36['status'](_0x1c91d1)[_0xf5f9('0x2a')](_0x31134d);};}exports['index']=function(_0x3e3d49,_0x45260f){var _0x1776d0={},_0x4aeb5b={},_0x367bc5={'count':0x0,'rows':[]};var _0x270e84=_[_0xf5f9('0x2b')](db[_0xf5f9('0x2c')][_0xf5f9('0x2d')],function(_0x4ae810){return{'name':_0x4ae810['fieldName'],'type':_0x4ae810['type'][_0xf5f9('0x2e')]};});_0x4aeb5b[_0xf5f9('0x2f')]=_[_0xf5f9('0x2b')](_0x270e84,_0xf5f9('0x29'));_0x4aeb5b[_0xf5f9('0x30')]=_[_0xf5f9('0x31')](_0x3e3d49[_0xf5f9('0x30')]);_0x4aeb5b[_0xf5f9('0x32')]=_[_0xf5f9('0x33')](_0x4aeb5b[_0xf5f9('0x2f')],_0x4aeb5b[_0xf5f9('0x30')]);_0x1776d0[_0xf5f9('0x34')]=_[_0xf5f9('0x33')](_0x4aeb5b[_0xf5f9('0x2f')],qs['fields'](_0x3e3d49['query'][_0xf5f9('0x35')]));_0x1776d0['attributes']=_0x1776d0['attributes'][_0xf5f9('0x36')]?_0x1776d0[_0xf5f9('0x34')]:_0x4aeb5b[_0xf5f9('0x2f')];if(!_0x3e3d49[_0xf5f9('0x30')][_0xf5f9('0x37')](_0xf5f9('0x38'))){_0x1776d0[_0xf5f9('0x1e')]=qs[_0xf5f9('0x1e')](_0x3e3d49[_0xf5f9('0x30')][_0xf5f9('0x1e')]);_0x1776d0['offset']=qs[_0xf5f9('0x1d')](_0x3e3d49['query']['offset']);}_0x1776d0[_0xf5f9('0x39')]=qs[_0xf5f9('0x3a')](_0x3e3d49[_0xf5f9('0x30')][_0xf5f9('0x3a')]);_0x1776d0[_0xf5f9('0x3b')]=qs[_0xf5f9('0x32')](_[_0xf5f9('0x3c')](_0x3e3d49['query'],_0x4aeb5b[_0xf5f9('0x32')]),_0x270e84);if(_0x3e3d49['query'][_0xf5f9('0x3d')]){_0x1776d0[_0xf5f9('0x3b')]=_['merge'](_0x1776d0[_0xf5f9('0x3b')],{'$or':_[_0xf5f9('0x2b')](_0x270e84,function(_0x88f9c9){if(_0x88f9c9[_0xf5f9('0x3e')]!==_0xf5f9('0x3f')){var _0x5f2fbe={};_0x5f2fbe[_0x88f9c9[_0xf5f9('0x29')]]={'$like':'%'+_0x3e3d49[_0xf5f9('0x30')][_0xf5f9('0x3d')]+'%'};return _0x5f2fbe;}})});}_0x1776d0=_[_0xf5f9('0x40')]({},_0x1776d0,_0x3e3d49[_0xf5f9('0x41')]);var _0x37e111={'where':_0x1776d0[_0xf5f9('0x3b')]};return db['SugarcrmAccount']['count'](_0x37e111)['then'](function(_0xaef729){_0x367bc5[_0xf5f9('0x20')]=_0xaef729;if(_0x3e3d49['query'][_0xf5f9('0x42')]){_0x1776d0['include']=[{'all':!![]}];}return db[_0xf5f9('0x2c')][_0xf5f9('0x43')](_0x1776d0);})[_0xf5f9('0x27')](function(_0x41193d){_0x367bc5[_0xf5f9('0x44')]=_0x41193d;return _0x367bc5;})[_0xf5f9('0x27')](respondWithFilteredResult(_0x45260f,_0x1776d0))[_0xf5f9('0x45')](handleError(_0x45260f,null));};exports['show']=function(_0x29978f,_0x2c58c2){var _0x585105={'raw':![],'where':{'id':_0x29978f[_0xf5f9('0x46')]['id']}},_0x150f7c={};_0x150f7c['model']=_[_0xf5f9('0x31')](db['SugarcrmAccount'][_0xf5f9('0x2d')]);_0x150f7c[_0xf5f9('0x30')]=_['keys'](_0x29978f[_0xf5f9('0x30')]);_0x150f7c['filters']=_[_0xf5f9('0x33')](_0x150f7c[_0xf5f9('0x2f')],_0x150f7c[_0xf5f9('0x30')]);_0x585105['attributes']=_[_0xf5f9('0x33')](_0x150f7c[_0xf5f9('0x2f')],qs['fields'](_0x29978f[_0xf5f9('0x30')][_0xf5f9('0x35')]));_0x585105[_0xf5f9('0x34')]=_0x585105[_0xf5f9('0x34')][_0xf5f9('0x36')]?_0x585105[_0xf5f9('0x34')]:_0x150f7c[_0xf5f9('0x2f')];if(_0x29978f[_0xf5f9('0x30')]['includeAll']){_0x585105['include']=[{'all':!![]}];}_0x585105=_[_0xf5f9('0x40')]({},_0x585105,_0x29978f['options']);return db[_0xf5f9('0x2c')][_0xf5f9('0x47')](_0x585105)[_0xf5f9('0x27')](handleEntityNotFound(_0x2c58c2,null))[_0xf5f9('0x27')](respondWithResult(_0x2c58c2,null))[_0xf5f9('0x45')](handleError(_0x2c58c2,null));};exports[_0xf5f9('0x48')]=function(_0x3e4f48,_0x1743e9){return db[_0xf5f9('0x2c')][_0xf5f9('0x48')](_0x3e4f48[_0xf5f9('0x49')],{})[_0xf5f9('0x27')](respondWithResult(_0x1743e9,0xc9))[_0xf5f9('0x45')](handleError(_0x1743e9,null));};exports['update']=function(_0x3b9a15,_0x5f9a9){if(_0x3b9a15[_0xf5f9('0x49')]['id']){delete _0x3b9a15[_0xf5f9('0x49')]['id'];}return db[_0xf5f9('0x2c')][_0xf5f9('0x47')]({'where':{'id':_0x3b9a15[_0xf5f9('0x46')]['id']}})[_0xf5f9('0x27')](handleEntityNotFound(_0x5f9a9,null))[_0xf5f9('0x27')](saveUpdates(_0x3b9a15[_0xf5f9('0x49')],null))[_0xf5f9('0x27')](respondWithResult(_0x5f9a9,null))['catch'](handleError(_0x5f9a9,null));};exports['destroy']=function(_0x3caed6,_0x5b1c46){return db[_0xf5f9('0x2c')][_0xf5f9('0x47')]({'where':{'id':_0x3caed6[_0xf5f9('0x46')]['id']}})[_0xf5f9('0x27')](handleEntityNotFound(_0x5b1c46,null))[_0xf5f9('0x27')](removeEntity(_0x5b1c46,null))['catch'](handleError(_0x5b1c46,null));};exports[_0xf5f9('0x4a')]=function(_0x2dab9f,_0x345996,_0x22896c){var _0x4c9431={};var _0x117eda={};var _0x20e4de;var _0x5f7016;return db[_0xf5f9('0x2c')][_0xf5f9('0x4b')]({'where':{'id':_0x2dab9f['params']['id']}})[_0xf5f9('0x27')](handleEntityNotFound(_0x345996,null))[_0xf5f9('0x27')](function(_0x207060){if(_0x207060){_0x20e4de=_0x207060;_0x117eda[_0xf5f9('0x2f')]=_[_0xf5f9('0x31')](db[_0xf5f9('0x4c')][_0xf5f9('0x2d')]);_0x117eda['query']=_[_0xf5f9('0x31')](_0x2dab9f[_0xf5f9('0x30')]);_0x117eda[_0xf5f9('0x32')]=_[_0xf5f9('0x33')](_0x117eda['model'],_0x117eda[_0xf5f9('0x30')]);_0x4c9431[_0xf5f9('0x34')]=_[_0xf5f9('0x33')](_0x117eda[_0xf5f9('0x2f')],qs['fields'](_0x2dab9f['query'][_0xf5f9('0x35')]));_0x4c9431[_0xf5f9('0x34')]=_0x4c9431[_0xf5f9('0x34')][_0xf5f9('0x36')]?_0x4c9431[_0xf5f9('0x34')]:_0x117eda[_0xf5f9('0x2f')];_0x4c9431[_0xf5f9('0x39')]=qs[_0xf5f9('0x3a')](_0x2dab9f[_0xf5f9('0x30')][_0xf5f9('0x3a')]);_0x4c9431[_0xf5f9('0x3b')]=qs[_0xf5f9('0x32')](_[_0xf5f9('0x3c')](_0x2dab9f[_0xf5f9('0x30')],_0x117eda[_0xf5f9('0x32')]));if(_0x2dab9f[_0xf5f9('0x30')]['filter']){_0x4c9431['where']=_[_0xf5f9('0x40')](_0x4c9431[_0xf5f9('0x3b')],{'$or':_[_0xf5f9('0x2b')](_0x4c9431[_0xf5f9('0x34')],function(_0x26941e){var _0x4d3acd={};_0x4d3acd[_0x26941e]={'$like':'%'+_0x2dab9f['query'][_0xf5f9('0x3d')]+'%'};return _0x4d3acd;})});}_0x4c9431=_['merge']({},_0x4c9431,_0x2dab9f[_0xf5f9('0x41')]);return _0x20e4de[_0xf5f9('0x4a')](_0x4c9431);}})['then'](function(_0x323035){if(_0x323035){_0x5f7016=_0x323035[_0xf5f9('0x36')];if(!_0x2dab9f[_0xf5f9('0x30')][_0xf5f9('0x37')](_0xf5f9('0x38'))){_0x4c9431[_0xf5f9('0x1e')]=qs[_0xf5f9('0x1e')](_0x2dab9f['query'][_0xf5f9('0x1e')]);_0x4c9431[_0xf5f9('0x1d')]=qs['offset'](_0x2dab9f['query'][_0xf5f9('0x1d')]);}return _0x20e4de['getConfigurations'](_0x4c9431);}})[_0xf5f9('0x27')](function(_0x187fa2){if(_0x187fa2){return _0x187fa2?{'count':_0x5f7016,'rows':_0x187fa2}:null;}})[_0xf5f9('0x27')](respondWithResult(_0x345996,null))['catch'](handleError(_0x345996,null));};exports['addConfiguration']=function(_0x5a5232,_0x37c2ea,_0x4bf57d){if(_0x5a5232[_0xf5f9('0x49')]['id']){delete _0x5a5232[_0xf5f9('0x49')]['id'];}return db['SugarcrmAccount'][_0xf5f9('0x4b')]({'where':{'id':_0x5a5232['params']['id']}})['then'](handleEntityNotFound(_0x37c2ea,null))['then'](function(_0x2a99d9){if(_0x2a99d9){_0x5a5232['body'][_0xf5f9('0x4d')]=_0x2a99d9['id'];_0x5a5232[_0xf5f9('0x49')]['Subjects']=integrations['getSubjects'](_0x5a5232[_0xf5f9('0x49')][_0xf5f9('0x4e')],_0x5a5232[_0xf5f9('0x49')][_0xf5f9('0x3e')]);_0x5a5232[_0xf5f9('0x49')][_0xf5f9('0x4f')]=integrations[_0xf5f9('0x50')](_0x5a5232[_0xf5f9('0x49')][_0xf5f9('0x4e')],_0x5a5232[_0xf5f9('0x49')][_0xf5f9('0x3e')]);return db[_0xf5f9('0x4c')][_0xf5f9('0x48')](_0x5a5232[_0xf5f9('0x49')],{'include':[{'model':db[_0xf5f9('0x51')],'as':_0xf5f9('0x52')},{'model':db[_0xf5f9('0x51')],'as':_0xf5f9('0x4f')}]});}return null;})[_0xf5f9('0x27')](respondWithResult(_0x37c2ea,null))[_0xf5f9('0x45')](handleError(_0x37c2ea,null));};exports['getFields']=function(_0x141a30,_0x1ea089,_0x5e6908){var _0x303ae5='';var _0x5b7b7a=['id',_0xf5f9('0x29'),_0xf5f9('0x53'),_0xf5f9('0x54'),_0xf5f9('0x55'),_0xf5f9('0x56'),'duration_hours','duration_minutes',_0xf5f9('0x57'),_0xf5f9('0x58'),'parent_name',_0xf5f9('0x59')];return db[_0xf5f9('0x2c')][_0xf5f9('0x4b')]({'where':{'id':_0x141a30[_0xf5f9('0x46')]['id']},'attributes':['id',_0xf5f9('0x5a'),_0xf5f9('0x5b'),_0xf5f9('0x5c')]})[_0xf5f9('0x27')](handleEntityNotFound(_0x1ea089,null))['then'](function(_0x2d6ecb){if(_0x2d6ecb){_0x303ae5=_0x2d6ecb[_0xf5f9('0x5c')];var _0xb0773=_0x303ae5['slice'](-0x1);if(_0xb0773==='/'){_0x303ae5=_0x303ae5[_0xf5f9('0x5d')](0x0,_0x303ae5[_0xf5f9('0x5e')](_0xb0773));}return rp({'method':_0xf5f9('0x5f'),'uri':util['format'](_0xf5f9('0x60'),_0x303ae5,_0xf5f9('0x61')),'json':!![],'form':{'method':_0xf5f9('0x62'),'input_type':_0xf5f9('0x63'),'response_type':_0xf5f9('0x63'),'rest_data':JSON[_0xf5f9('0x64')]({'user_auth':{'user_name':_0x2d6ecb[_0xf5f9('0x5a')],'password':_0x2d6ecb[_0xf5f9('0x5b')],'encryption':_0xf5f9('0x65')},'application':_0xf5f9('0x66')})}});}})[_0xf5f9('0x27')](function(_0xbc21d4){if(_0xbc21d4&&_0xbc21d4[_0xf5f9('0x29')]!==_0xf5f9('0x67')&&_0xbc21d4[_0xf5f9('0x29')]!==_0xf5f9('0x68')){return rp({'method':'POST','uri':util[_0xf5f9('0x69')]('%s%s',_0x303ae5,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xf5f9('0x6a'),'input_type':_0xf5f9('0x63'),'response_type':_0xf5f9('0x63'),'rest_data':JSON['stringify']({'session':_0xbc21d4['id'],'module_name':_0xf5f9('0x6b')})}})[_0xf5f9('0x27')](function(_0x26135b){if(_0x26135b){var _0x546180=_['values'](_0x26135b[_0xf5f9('0x6c')]);_[_0xf5f9('0x6d')](_0x546180,function(_0x18da47){return _0x5b7b7a[_0xf5f9('0x6e')](_0x18da47[_0xf5f9('0x29')]);});return{'count':_0x546180['length'],'rows':_[_0xf5f9('0x2b')](_0x546180,function(_0x17e7b4){return{'id':_0x17e7b4['name'],'name':_0x17e7b4[_0xf5f9('0x6f')],'custom':_[_0xf5f9('0x70')](_0x17e7b4[_0xf5f9('0x29')],'_c')?!![]:![],'options':_0x17e7b4[_0xf5f9('0x41')]?_['map'](_[_0xf5f9('0x71')](_0x17e7b4['options']),function(_0x21db11){return{'name':_0x21db11[_0xf5f9('0x72')],'value':_0x21db11[_0xf5f9('0x29')]};}):[]};})};}})[_0xf5f9('0x27')](respondWithResult(_0x1ea089,null))[_0xf5f9('0x45')](function(_0x584e4f){var _0x154d7e=_0x141a30[_0xf5f9('0x30')][_0xf5f9('0x73')]?0x1f4:_0x584e4f[_0xf5f9('0x74')]||0x1f4;logger[_0xf5f9('0x75')](_0xf5f9('0x76'),_0xf5f9('0x77'),_0x154d7e,JSON['stringify'](_0x584e4f));delete _0x584e4f['name'];if(_0x154d7e===0x191){_0x154d7e=0x190;}_0x1ea089[_0xf5f9('0x1b')](_0x154d7e)[_0xf5f9('0x2a')](_0x141a30[_0xf5f9('0x30')][_0xf5f9('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x584e4f[_0xf5f9('0x74')]}:_0x584e4f);});}else{var _0x570824=0x1f4;_0x1ea089['status'](_0x570824)[_0xf5f9('0x2a')]({'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 a46a84e..f315b68 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 _0xb1dc=['exports','define','SugarcrmAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration'];(function(_0x4f5efe,_0x58ab97){var _0x3bfb40=function(_0x15c92b){while(--_0x15c92b){_0x4f5efe['push'](_0x4f5efe['shift']());}};_0x3bfb40(++_0x58ab97);}(_0xb1dc,0xb7));var _0xcb1d=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0xb1dc[_0x1faaa1];return _0x994ec;};'use strict';var _=require(_0xcb1d('0x0'));var util=require(_0xcb1d('0x1'));var logger=require(_0xcb1d('0x2'))(_0xcb1d('0x3'));var moment=require(_0xcb1d('0x4'));var BPromise=require(_0xcb1d('0x5'));var rp=require(_0xcb1d('0x6'));var fs=require('fs');var path=require(_0xcb1d('0x7'));var rimraf=require(_0xcb1d('0x8'));var config=require(_0xcb1d('0x9'));var attributes=require(_0xcb1d('0xa'));var integrations=require(_0xcb1d('0xb'));module[_0xcb1d('0xc')]=function(_0x2dbb99,_0x1fc363){return _0x2dbb99[_0xcb1d('0xd')](_0xcb1d('0xe'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfce=['int_sugarcrm_accounts','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../components/integrations/configuration','exports','SugarcrmAccount'];(function(_0x70fd53,_0x2a95a6){var _0x4b71c5=function(_0x4b349d){while(--_0x4b349d){_0x70fd53['push'](_0x70fd53['shift']());}};_0x4b71c5(++_0x2a95a6);}(_0xbfce,0x161));var _0xebfc=function(_0x136c8a,_0x160dcd){_0x136c8a=_0x136c8a-0x0;var _0x2d18a2=_0xbfce[_0x136c8a];return _0x2d18a2;};'use strict';var _=require('lodash');var util=require(_0xebfc('0x0'));var logger=require(_0xebfc('0x1'))(_0xebfc('0x2'));var moment=require(_0xebfc('0x3'));var BPromise=require(_0xebfc('0x4'));var rp=require(_0xebfc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xebfc('0x6'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xebfc('0x7'));module[_0xebfc('0x8')]=function(_0x565c17,_0x3e6767){return _0x565c17['define'](_0xebfc('0x9'),attributes,{'tableName':_0xebfc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 75efc28..f670c12 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 _0x5a64=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','GetSugarcrmAccount','findAll','options','raw','limit','map','include','attributes','model','ShowSugarcrmAccount','find'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x5a64,0x1ba));var _0x45a6=function(_0x5cdd74,_0x557b3c){_0x5cdd74=_0x5cdd74-0x0;var _0x113ef8=_0x5a64[_0x5cdd74];return _0x113ef8;};'use strict';var _=require(_0x45a6('0x0'));var util=require(_0x45a6('0x1'));var moment=require(_0x45a6('0x2'));var BPromise=require(_0x45a6('0x3'));var rs=require(_0x45a6('0x4'));var fs=require('fs');var Redis=require(_0x45a6('0x5'));var db=require(_0x45a6('0x6'))['db'];var utils=require(_0x45a6('0x7'));var logger=require('../../config/logger')(_0x45a6('0x8'));var config=require(_0x45a6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x45a6('0xa')][_0x45a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x236301,_0xf5317b,_0x4d279d){return new BPromise(function(_0x415d06,_0x4b1eb1){return client[_0x45a6('0xc')](_0x236301,_0x4d279d)[_0x45a6('0xd')](function(_0x61683){logger[_0x45a6('0xe')](_0x45a6('0xf'),_0xf5317b,'request\x20sent');logger[_0x45a6('0x10')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0xf5317b,'request\x20sent',JSON[_0x45a6('0x11')](_0x61683));if(_0x61683[_0x45a6('0x12')]){if(_0x61683['error']['code']===0x1f4){logger[_0x45a6('0x12')](_0x45a6('0xf'),_0xf5317b,_0x61683[_0x45a6('0x12')][_0x45a6('0x13')]);return _0x4b1eb1(_0x61683[_0x45a6('0x12')][_0x45a6('0x13')]);}logger[_0x45a6('0x12')](_0x45a6('0xf'),_0xf5317b,_0x61683['error']['message']);return _0x415d06(_0x61683['error'][_0x45a6('0x13')]);}else{logger[_0x45a6('0xe')](_0x45a6('0xf'),_0xf5317b,_0x45a6('0x14'));_0x415d06(_0x61683[_0x45a6('0x15')][_0x45a6('0x13')]);}})[_0x45a6('0x16')](function(_0x2aba5c){logger[_0x45a6('0x12')](_0x45a6('0xf'),_0xf5317b,_0x2aba5c);_0x4b1eb1(_0x2aba5c);});});}exports[_0x45a6('0x17')]=function(_0x5904c1){var _0x30e5c5=this;return new Promise(function(_0x45d2d0,_0xc86b1a){return db['SugarcrmAccount'][_0x45a6('0x18')]({'raw':_0x5904c1[_0x45a6('0x19')]?_0x5904c1[_0x45a6('0x19')][_0x45a6('0x1a')]===undefined?!![]:![]:!![],'where':_0x5904c1['options']?_0x5904c1['options']['where']||null:null,'attributes':_0x5904c1['options']?_0x5904c1[_0x45a6('0x19')]['attributes']||null:null,'limit':_0x5904c1[_0x45a6('0x19')]?_0x5904c1['options'][_0x45a6('0x1b')]||null:null,'include':_0x5904c1[_0x45a6('0x19')]?_0x5904c1[_0x45a6('0x19')]['include']?_[_0x45a6('0x1c')](_0x5904c1[_0x45a6('0x19')][_0x45a6('0x1d')],function(_0x23614d){return{'model':db[_0x23614d['model']],'as':_0x23614d['as'],'attributes':_0x23614d[_0x45a6('0x1e')],'include':_0x23614d[_0x45a6('0x1d')]?_['map'](_0x23614d[_0x45a6('0x1d')],function(_0x20125e){return{'model':db[_0x20125e[_0x45a6('0x1f')]],'as':_0x20125e['as'],'attributes':_0x20125e[_0x45a6('0x1e')],'include':_0x20125e[_0x45a6('0x1d')]?_['map'](_0x20125e[_0x45a6('0x1d')],function(_0x58894d){return{'model':db[_0x58894d[_0x45a6('0x1f')]],'as':_0x58894d['as'],'attributes':_0x58894d['attributes']};}):[]};}):[]};}):[]:[]})[_0x45a6('0xd')](function(_0x2f5751){logger[_0x45a6('0xe')](_0x45a6('0x17'),_0x5904c1);logger[_0x45a6('0x10')]('GetSugarcrmAccount',_0x5904c1,JSON['stringify'](_0x2f5751));_0x45d2d0(_0x2f5751);})[_0x45a6('0x16')](function(_0x1d76e3){logger['error'](_0x45a6('0x17'),_0x1d76e3[_0x45a6('0x13')],_0x5904c1);_0xc86b1a(_0x30e5c5['error'](0x1f4,_0x1d76e3['message']));});});};exports[_0x45a6('0x20')]=function(_0x725007){var _0x58a997=this;return new Promise(function(_0x41da77,_0x4bf12b){return db['SugarcrmAccount'][_0x45a6('0x21')]({'raw':_0x725007[_0x45a6('0x19')]?_0x725007['options'][_0x45a6('0x1a')]===undefined?!![]:![]:!![],'where':_0x725007[_0x45a6('0x19')]?_0x725007[_0x45a6('0x19')]['where']||null:null,'attributes':_0x725007[_0x45a6('0x19')]?_0x725007[_0x45a6('0x19')][_0x45a6('0x1e')]||null:null,'include':_0x725007[_0x45a6('0x19')]?_0x725007[_0x45a6('0x19')][_0x45a6('0x1d')]?_[_0x45a6('0x1c')](_0x725007[_0x45a6('0x19')][_0x45a6('0x1d')],function(_0x4ee107){return{'model':db[_0x4ee107['model']],'as':_0x4ee107['as'],'attributes':_0x4ee107[_0x45a6('0x1e')],'include':_0x4ee107[_0x45a6('0x1d')]?_[_0x45a6('0x1c')](_0x4ee107['include'],function(_0x145029){return{'model':db[_0x145029[_0x45a6('0x1f')]],'as':_0x145029['as'],'attributes':_0x145029[_0x45a6('0x1e')],'include':_0x145029[_0x45a6('0x1d')]?_[_0x45a6('0x1c')](_0x145029[_0x45a6('0x1d')],function(_0x392a6b){return{'model':db[_0x392a6b[_0x45a6('0x1f')]],'as':_0x392a6b['as'],'attributes':_0x392a6b[_0x45a6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x45a6('0xd')](function(_0x496eca){logger[_0x45a6('0xe')](_0x45a6('0x20'),_0x725007);logger[_0x45a6('0x10')](_0x45a6('0x20'),_0x725007,JSON['stringify'](_0x496eca));_0x41da77(_0x496eca);})[_0x45a6('0x16')](function(_0x567d4c){logger[_0x45a6('0x12')](_0x45a6('0x20'),_0x567d4c[_0x45a6('0x13')],_0x725007);_0x4bf12b(_0x58a997[_0x45a6('0x12')](0x1f4,_0x567d4c[_0x45a6('0x13')]));});});}; \ No newline at end of file +var _0x3f7e=['findAll','options','raw','attributes','limit','map','include','model','ShowSugarcrmAccount','find','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount'];(function(_0xcc609a,_0x4f71c7){var _0x594738=function(_0x255d87){while(--_0x255d87){_0xcc609a['push'](_0xcc609a['shift']());}};_0x594738(++_0x4f71c7);}(_0x3f7e,0x168));var _0xe3f7=function(_0x2f87ac,_0x327588){_0x2f87ac=_0x2f87ac-0x0;var _0x31ed26=_0x3f7e[_0x2f87ac];return _0x31ed26;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe3f7('0x0'));var BPromise=require(_0xe3f7('0x1'));var rs=require(_0xe3f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3f7('0x3'))['db'];var utils=require(_0xe3f7('0x4'));var logger=require(_0xe3f7('0x5'))(_0xe3f7('0x6'));var config=require(_0xe3f7('0x7'));var jayson=require(_0xe3f7('0x8'));var client=jayson[_0xe3f7('0x9')][_0xe3f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf0311d,_0x5017bb,_0xfca0d6){return new BPromise(function(_0x19c958,_0x1411b4){return client[_0xe3f7('0xb')](_0xf0311d,_0xfca0d6)[_0xe3f7('0xc')](function(_0x28464f){logger[_0xe3f7('0xd')](_0xe3f7('0xe'),_0x5017bb,'request\x20sent');logger[_0xe3f7('0xf')](_0xe3f7('0x10'),_0x5017bb,'request\x20sent',JSON[_0xe3f7('0x11')](_0x28464f));if(_0x28464f['error']){if(_0x28464f[_0xe3f7('0x12')][_0xe3f7('0x13')]===0x1f4){logger['error'](_0xe3f7('0xe'),_0x5017bb,_0x28464f[_0xe3f7('0x12')][_0xe3f7('0x14')]);return _0x1411b4(_0x28464f[_0xe3f7('0x12')]['message']);}logger['error'](_0xe3f7('0xe'),_0x5017bb,_0x28464f[_0xe3f7('0x12')][_0xe3f7('0x14')]);return _0x19c958(_0x28464f['error'][_0xe3f7('0x14')]);}else{logger[_0xe3f7('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x5017bb,'request\x20sent');_0x19c958(_0x28464f[_0xe3f7('0x15')][_0xe3f7('0x14')]);}})[_0xe3f7('0x16')](function(_0x4510b4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x5017bb,_0x4510b4);_0x1411b4(_0x4510b4);});});}exports[_0xe3f7('0x17')]=function(_0x2d3565){var _0x500657=this;return new Promise(function(_0x3b9d33,_0xa5b180){return db[_0xe3f7('0x18')][_0xe3f7('0x19')]({'raw':_0x2d3565[_0xe3f7('0x1a')]?_0x2d3565['options'][_0xe3f7('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d3565[_0xe3f7('0x1a')]?_0x2d3565[_0xe3f7('0x1a')]['where']||null:null,'attributes':_0x2d3565['options']?_0x2d3565['options'][_0xe3f7('0x1c')]||null:null,'limit':_0x2d3565['options']?_0x2d3565['options'][_0xe3f7('0x1d')]||null:null,'include':_0x2d3565['options']?_0x2d3565[_0xe3f7('0x1a')]['include']?_[_0xe3f7('0x1e')](_0x2d3565['options'][_0xe3f7('0x1f')],function(_0x3781d0){return{'model':db[_0x3781d0['model']],'as':_0x3781d0['as'],'attributes':_0x3781d0[_0xe3f7('0x1c')],'include':_0x3781d0[_0xe3f7('0x1f')]?_[_0xe3f7('0x1e')](_0x3781d0[_0xe3f7('0x1f')],function(_0x1271b8){return{'model':db[_0x1271b8['model']],'as':_0x1271b8['as'],'attributes':_0x1271b8[_0xe3f7('0x1c')],'include':_0x1271b8['include']?_['map'](_0x1271b8[_0xe3f7('0x1f')],function(_0x5deffd){return{'model':db[_0x5deffd[_0xe3f7('0x20')]],'as':_0x5deffd['as'],'attributes':_0x5deffd[_0xe3f7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe3f7('0xc')](function(_0x31fed0){logger[_0xe3f7('0xd')](_0xe3f7('0x17'),_0x2d3565);logger[_0xe3f7('0xf')](_0xe3f7('0x17'),_0x2d3565,JSON[_0xe3f7('0x11')](_0x31fed0));_0x3b9d33(_0x31fed0);})[_0xe3f7('0x16')](function(_0x2f8903){logger[_0xe3f7('0x12')](_0xe3f7('0x17'),_0x2f8903[_0xe3f7('0x14')],_0x2d3565);_0xa5b180(_0x500657[_0xe3f7('0x12')](0x1f4,_0x2f8903[_0xe3f7('0x14')]));});});};exports[_0xe3f7('0x21')]=function(_0x2ac861){var _0x12c1e5=this;return new Promise(function(_0x7834fb,_0x114239){return db['SugarcrmAccount'][_0xe3f7('0x22')]({'raw':_0x2ac861[_0xe3f7('0x1a')]?_0x2ac861[_0xe3f7('0x1a')][_0xe3f7('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ac861[_0xe3f7('0x1a')]?_0x2ac861[_0xe3f7('0x1a')]['where']||null:null,'attributes':_0x2ac861['options']?_0x2ac861[_0xe3f7('0x1a')][_0xe3f7('0x1c')]||null:null,'include':_0x2ac861['options']?_0x2ac861[_0xe3f7('0x1a')][_0xe3f7('0x1f')]?_[_0xe3f7('0x1e')](_0x2ac861[_0xe3f7('0x1a')]['include'],function(_0x3204e4){return{'model':db[_0x3204e4[_0xe3f7('0x20')]],'as':_0x3204e4['as'],'attributes':_0x3204e4['attributes'],'include':_0x3204e4['include']?_[_0xe3f7('0x1e')](_0x3204e4['include'],function(_0x31982e){return{'model':db[_0x31982e[_0xe3f7('0x20')]],'as':_0x31982e['as'],'attributes':_0x31982e[_0xe3f7('0x1c')],'include':_0x31982e['include']?_['map'](_0x31982e['include'],function(_0x4ffe70){return{'model':db[_0x4ffe70[_0xe3f7('0x20')]],'as':_0x4ffe70['as'],'attributes':_0x4ffe70[_0xe3f7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe3f7('0xc')](function(_0x441775){logger[_0xe3f7('0xd')]('ShowSugarcrmAccount',_0x2ac861);logger[_0xe3f7('0xf')]('ShowSugarcrmAccount',_0x2ac861,JSON[_0xe3f7('0x11')](_0x441775));_0x7834fb(_0x441775);})['catch'](function(_0x57fba8){logger[_0xe3f7('0x12')](_0xe3f7('0x21'),_0x57fba8[_0xe3f7('0x14')],_0x2ac861);_0x114239(_0x12c1e5[_0xe3f7('0x12')](0x1f4,_0x57fba8['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index b04416d..7c4bdb1 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 _0x9759=['show','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9759,0x120));var _0x9975=function(_0xf1ad6,_0x5130cf){_0xf1ad6=_0xf1ad6-0x0;var _0xa14879=_0x9759[_0xf1ad6];return _0xa14879;};'use strict';var multer=require(_0x9975('0x0'));var util=require(_0x9975('0x1'));var path=require(_0x9975('0x2'));var timeout=require(_0x9975('0x3'));var express=require(_0x9975('0x4'));var router=express[_0x9975('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9975('0x6'));var config=require(_0x9975('0x7'));var controller=require(_0x9975('0x8'));router[_0x9975('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x9975('0xa')](),controller[_0x9975('0xb')]);router[_0x9975('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x9975('0x9')](_0x9975('0xc'),auth[_0x9975('0xa')](),controller[_0x9975('0xd')]);router[_0x9975('0x9')]('/:id/descriptions',auth[_0x9975('0xa')](),controller[_0x9975('0xe')]);router[_0x9975('0xf')]('/',auth[_0x9975('0xa')](),controller[_0x9975('0x10')]);router[_0x9975('0x11')](_0x9975('0x12'),auth[_0x9975('0xa')](),controller[_0x9975('0x13')]);router[_0x9975('0x14')](_0x9975('0x12'),auth[_0x9975('0xa')](),controller[_0x9975('0x15')]);module[_0x9975('0x16')]=router; \ No newline at end of file +var _0x1ddc=['../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3cad2c,_0x5292dc){var _0x257ef9=function(_0x5ef23b){while(--_0x5ef23b){_0x3cad2c['push'](_0x3cad2c['shift']());}};_0x257ef9(++_0x5292dc);}(_0x1ddc,0xed));var _0xc1dd=function(_0x7de738,_0x3cdc1f){_0x7de738=_0x7de738-0x0;var _0x307a4b=_0x1ddc[_0x7de738];return _0x307a4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc1dd('0x0'));var timeout=require(_0xc1dd('0x1'));var express=require('express');var router=express[_0xc1dd('0x2')]();var fs_extra=require(_0xc1dd('0x3'));var auth=require(_0xc1dd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc1dd('0x5'));var controller=require(_0xc1dd('0x6'));router[_0xc1dd('0x7')]('/',auth[_0xc1dd('0x8')](),controller[_0xc1dd('0x9')]);router['get'](_0xc1dd('0xa'),auth[_0xc1dd('0x8')](),controller[_0xc1dd('0xb')]);router[_0xc1dd('0x7')](_0xc1dd('0xc'),auth[_0xc1dd('0x8')](),controller[_0xc1dd('0xd')]);router[_0xc1dd('0x7')](_0xc1dd('0xe'),auth[_0xc1dd('0x8')](),controller[_0xc1dd('0xf')]);router[_0xc1dd('0x7')]('/:id/descriptions',auth[_0xc1dd('0x8')](),controller[_0xc1dd('0x10')]);router[_0xc1dd('0x11')]('/',auth['isAuthenticated'](),controller[_0xc1dd('0x12')]);router['put'](_0xc1dd('0xa'),auth[_0xc1dd('0x8')](),controller[_0xc1dd('0x13')]);router[_0xc1dd('0x14')](_0xc1dd('0xa'),auth[_0xc1dd('0x8')](),controller['destroy']);module[_0xc1dd('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index c4a50fb..55a3c01 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 _0x8e11=['exports','STRING'];(function(_0x1ea17a,_0x7bdd9e){var _0x22eabe=function(_0x7123c6){while(--_0x7123c6){_0x1ea17a['push'](_0x1ea17a['shift']());}};_0x22eabe(++_0x7bdd9e);}(_0x8e11,0x72));var _0x18e1=function(_0x7a0228,_0x239f44){_0x7a0228=_0x7a0228-0x0;var _0x564448=_0x8e11[_0x7a0228];return _0x564448;};'use strict';var Sequelize=require('sequelize');module[_0x18e1('0x0')]={'name':{'type':Sequelize[_0x18e1('0x1')]},'description':{'type':Sequelize[_0x18e1('0x1')]}}; \ No newline at end of file +var _0xf4e6=['sequelize','exports','STRING'];(function(_0xbe4e2f,_0x1290fb){var _0x12c0bf=function(_0x40c0c8){while(--_0x40c0c8){_0xbe4e2f['push'](_0xbe4e2f['shift']());}};_0x12c0bf(++_0x1290fb);}(_0xf4e6,0x129));var _0x6f4e=function(_0x1afabf,_0x56fdcc){_0x1afabf=_0x1afabf-0x0;var _0x497ff1=_0xf4e6[_0x1afabf];return _0x497ff1;};'use strict';var Sequelize=require(_0x6f4e('0x0'));module[_0x6f4e('0x1')]={'name':{'type':Sequelize[_0x6f4e('0x2')]},'description':{'type':Sequelize[_0x6f4e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 26ef4dc..e516142 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 _0xf0a6=['limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','VIRTUAL','filter','merge','options','includeAll','catch','show','params','include','find','create','body','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x35a1a3,_0x3a86e3){var _0x596022=function(_0x747fe0){while(--_0x747fe0){_0x35a1a3['push'](_0x35a1a3['shift']());}};_0x596022(++_0x3a86e3);}(_0xf0a6,0x7f));var _0x6f0a=function(_0x57f959,_0x3ce8ef){_0x57f959=_0x57f959-0x0;var _0xef3d9f=_0xf0a6[_0x57f959];return _0xef3d9f;};'use strict';var emlformat=require(_0x6f0a('0x0'));var rimraf=require(_0x6f0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f0a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6f0a('0x3'));var path=require('path');var sox=require(_0x6f0a('0x4'));var csv=require(_0x6f0a('0x5'));var ejs=require(_0x6f0a('0x6'));var fs=require('fs');var fs_extra=require(_0x6f0a('0x7'));var _=require(_0x6f0a('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6f0a('0x9'));var deskjs=require(_0x6f0a('0xa'));var toCsv=require(_0x6f0a('0x5'));var querystring=require(_0x6f0a('0xb'));var Papa=require(_0x6f0a('0xc'));var Redis=require(_0x6f0a('0xd'));var authService=require(_0x6f0a('0xe'));var qs=require(_0x6f0a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f0a('0x10'));var logger=require(_0x6f0a('0x11'))(_0x6f0a('0x12'));var utils=require(_0x6f0a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6f0a('0x14'))['db'];function respondWithStatusCode(_0x2e3bef,_0x19f44f){_0x19f44f=_0x19f44f||0xcc;return function(_0x5b1b51){if(_0x5b1b51){return _0x2e3bef[_0x6f0a('0x15')](_0x19f44f);}return _0x2e3bef[_0x6f0a('0x16')](_0x19f44f)[_0x6f0a('0x17')]();};}function respondWithResult(_0x2136e2,_0x48ab60){_0x48ab60=_0x48ab60||0xc8;return function(_0x1cc4d9){if(_0x1cc4d9){return _0x2136e2[_0x6f0a('0x16')](_0x48ab60)[_0x6f0a('0x18')](_0x1cc4d9);}};}function respondWithFilteredResult(_0x59bb60,_0x23a2e9){return function(_0x3dbc84){if(_0x3dbc84){var _0x4fca4a=typeof _0x23a2e9[_0x6f0a('0x19')]===_0x6f0a('0x1a')&&typeof _0x23a2e9[_0x6f0a('0x1b')]===_0x6f0a('0x1a');var _0x835a25=_0x3dbc84['count'];var _0x34e31c=_0x4fca4a?0x0:_0x23a2e9['offset'];var _0x537fe4=_0x4fca4a?_0x3dbc84[_0x6f0a('0x1c')]:_0x23a2e9[_0x6f0a('0x19')]+_0x23a2e9[_0x6f0a('0x1b')];var _0x1e0d5b;if(_0x537fe4>=_0x835a25){_0x537fe4=_0x835a25;_0x1e0d5b=0xc8;}else{_0x1e0d5b=0xce;}_0x59bb60[_0x6f0a('0x16')](_0x1e0d5b);return _0x59bb60[_0x6f0a('0x1d')](_0x6f0a('0x1e'),_0x34e31c+'-'+_0x537fe4+'/'+_0x835a25)[_0x6f0a('0x18')](_0x3dbc84);}return null;};}function patchUpdates(_0x312fda){return function(_0x38281e){try{jsonpatch[_0x6f0a('0x1f')](_0x38281e,_0x312fda,!![]);}catch(_0x5624be){return BPromise[_0x6f0a('0x20')](_0x5624be);}return _0x38281e[_0x6f0a('0x21')]();};}function saveUpdates(_0x3520a6,_0x7c5561){return function(_0x3877db){if(_0x3877db){return _0x3877db[_0x6f0a('0x22')](_0x3520a6)['then'](function(_0x53b135){return _0x53b135;});}return null;};}function removeEntity(_0xf51c8b,_0xcaf377){return function(_0xd7536){if(_0xd7536){return _0xd7536[_0x6f0a('0x23')]()[_0x6f0a('0x24')](function(){_0xf51c8b[_0x6f0a('0x16')](0xcc)[_0x6f0a('0x17')]();});}};}function handleEntityNotFound(_0x18be37,_0x1b279d){return function(_0x452076){if(!_0x452076){_0x18be37[_0x6f0a('0x15')](0x194);}return _0x452076;};}function handleError(_0x5645bd,_0x2b545c){_0x2b545c=_0x2b545c||0x1f4;return function(_0x347165){logger[_0x6f0a('0x25')](_0x347165[_0x6f0a('0x26')]);if(_0x347165[_0x6f0a('0x27')]){delete _0x347165[_0x6f0a('0x27')];}_0x5645bd['status'](_0x2b545c)['send'](_0x347165);};}exports[_0x6f0a('0x28')]=function(_0x520397,_0x307ea2){var _0x38c097={},_0x26dd5e={},_0x59ffa2={'count':0x0,'rows':[]};var _0x4c40e4=_[_0x6f0a('0x29')](db[_0x6f0a('0x2a')][_0x6f0a('0x2b')],function(_0x498508){return{'name':_0x498508['fieldName'],'type':_0x498508[_0x6f0a('0x2c')][_0x6f0a('0x2d')]};});_0x26dd5e[_0x6f0a('0x2e')]=_[_0x6f0a('0x29')](_0x4c40e4,'name');_0x26dd5e[_0x6f0a('0x2f')]=_[_0x6f0a('0x30')](_0x520397[_0x6f0a('0x2f')]);_0x26dd5e['filters']=_[_0x6f0a('0x31')](_0x26dd5e['model'],_0x26dd5e[_0x6f0a('0x2f')]);_0x38c097['attributes']=_[_0x6f0a('0x31')](_0x26dd5e['model'],qs[_0x6f0a('0x32')](_0x520397[_0x6f0a('0x2f')]['fields']));_0x38c097[_0x6f0a('0x33')]=_0x38c097[_0x6f0a('0x33')][_0x6f0a('0x34')]?_0x38c097[_0x6f0a('0x33')]:_0x26dd5e[_0x6f0a('0x2e')];if(!_0x520397[_0x6f0a('0x2f')][_0x6f0a('0x35')](_0x6f0a('0x36'))){_0x38c097[_0x6f0a('0x1b')]=qs[_0x6f0a('0x1b')](_0x520397[_0x6f0a('0x2f')][_0x6f0a('0x1b')]);_0x38c097[_0x6f0a('0x19')]=qs[_0x6f0a('0x19')](_0x520397[_0x6f0a('0x2f')][_0x6f0a('0x19')]);}_0x38c097[_0x6f0a('0x37')]=qs['sort'](_0x520397[_0x6f0a('0x2f')][_0x6f0a('0x38')]);_0x38c097[_0x6f0a('0x39')]=qs['filters'](_[_0x6f0a('0x3a')](_0x520397[_0x6f0a('0x2f')],_0x26dd5e[_0x6f0a('0x3b')]),_0x4c40e4);if(_0x520397[_0x6f0a('0x2f')]['filter']){_0x38c097[_0x6f0a('0x39')]=_['merge'](_0x38c097[_0x6f0a('0x39')],{'$or':_[_0x6f0a('0x29')](_0x4c40e4,function(_0x428cf1){if(_0x428cf1[_0x6f0a('0x2c')]!==_0x6f0a('0x3c')){var _0x570d7d={};_0x570d7d[_0x428cf1['name']]={'$like':'%'+_0x520397[_0x6f0a('0x2f')][_0x6f0a('0x3d')]+'%'};return _0x570d7d;}})});}_0x38c097=_[_0x6f0a('0x3e')]({},_0x38c097,_0x520397[_0x6f0a('0x3f')]);var _0x2d45a3={'where':_0x38c097[_0x6f0a('0x39')]};return db[_0x6f0a('0x2a')][_0x6f0a('0x1c')](_0x2d45a3)[_0x6f0a('0x24')](function(_0x3a8e9f){_0x59ffa2[_0x6f0a('0x1c')]=_0x3a8e9f;if(_0x520397['query'][_0x6f0a('0x40')]){_0x38c097['include']=[{'all':!![]}];}return db[_0x6f0a('0x2a')]['findAll'](_0x38c097);})[_0x6f0a('0x24')](function(_0x252806){_0x59ffa2['rows']=_0x252806;return _0x59ffa2;})['then'](respondWithFilteredResult(_0x307ea2,_0x38c097))[_0x6f0a('0x41')](handleError(_0x307ea2,null));};exports[_0x6f0a('0x42')]=function(_0x5740ef,_0x1a5568){var _0x104e21={'raw':![],'where':{'id':_0x5740ef[_0x6f0a('0x43')]['id']}},_0x5d2454={};_0x5d2454[_0x6f0a('0x2e')]=_['keys'](db[_0x6f0a('0x2a')]['rawAttributes']);_0x5d2454[_0x6f0a('0x2f')]=_[_0x6f0a('0x30')](_0x5740ef['query']);_0x5d2454[_0x6f0a('0x3b')]=_[_0x6f0a('0x31')](_0x5d2454[_0x6f0a('0x2e')],_0x5d2454['query']);_0x104e21[_0x6f0a('0x33')]=_[_0x6f0a('0x31')](_0x5d2454['model'],qs[_0x6f0a('0x32')](_0x5740ef[_0x6f0a('0x2f')][_0x6f0a('0x32')]));_0x104e21['attributes']=_0x104e21[_0x6f0a('0x33')]['length']?_0x104e21['attributes']:_0x5d2454['model'];if(_0x5740ef['query'][_0x6f0a('0x40')]){_0x104e21[_0x6f0a('0x44')]=[{'all':!![]}];}_0x104e21=_['merge']({},_0x104e21,_0x5740ef[_0x6f0a('0x3f')]);return db[_0x6f0a('0x2a')][_0x6f0a('0x45')](_0x104e21)['then'](handleEntityNotFound(_0x1a5568,null))[_0x6f0a('0x24')](respondWithResult(_0x1a5568,null))['catch'](handleError(_0x1a5568,null));};exports[_0x6f0a('0x46')]=function(_0x2e5ddb,_0x15864d){return db['SugarcrmConfiguration'][_0x6f0a('0x46')](_0x2e5ddb[_0x6f0a('0x47')],{})[_0x6f0a('0x24')](respondWithResult(_0x15864d,0xc9))[_0x6f0a('0x41')](handleError(_0x15864d,null));};exports[_0x6f0a('0x22')]=function(_0x460b3d,_0x25d9ae){if(_0x460b3d[_0x6f0a('0x47')]['id']){delete _0x460b3d[_0x6f0a('0x47')]['id'];}return db['SugarcrmConfiguration'][_0x6f0a('0x45')]({'where':{'id':_0x460b3d[_0x6f0a('0x43')]['id']}})[_0x6f0a('0x24')](handleEntityNotFound(_0x25d9ae,null))['then'](saveUpdates(_0x460b3d[_0x6f0a('0x47')],null))[_0x6f0a('0x24')](respondWithResult(_0x25d9ae,null))[_0x6f0a('0x41')](handleError(_0x25d9ae,null));};exports[_0x6f0a('0x23')]=function(_0x30993c,_0x2ef87c){return db['SugarcrmConfiguration'][_0x6f0a('0x45')]({'where':{'id':_0x30993c[_0x6f0a('0x43')]['id']}})[_0x6f0a('0x24')](handleEntityNotFound(_0x2ef87c,null))[_0x6f0a('0x24')](removeEntity(_0x2ef87c,null))['catch'](handleError(_0x2ef87c,null));};exports[_0x6f0a('0x48')]=function(_0x2bfa18,_0x2b0c55,_0x2aace2){var _0x131ec3={};var _0x15ea7a={};var _0x33ce48;var _0x537f73;return db[_0x6f0a('0x2a')][_0x6f0a('0x49')]({'where':{'id':_0x2bfa18[_0x6f0a('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b0c55,null))[_0x6f0a('0x24')](function(_0x2f40c3){if(_0x2f40c3){_0x33ce48=_0x2f40c3;_0x15ea7a[_0x6f0a('0x2e')]=_['keys'](db[_0x6f0a('0x4a')][_0x6f0a('0x2b')]);_0x15ea7a['query']=_[_0x6f0a('0x30')](_0x2bfa18['query']);_0x15ea7a['filters']=_[_0x6f0a('0x31')](_0x15ea7a['model'],_0x15ea7a[_0x6f0a('0x2f')]);_0x131ec3[_0x6f0a('0x33')]=_[_0x6f0a('0x31')](_0x15ea7a[_0x6f0a('0x2e')],qs['fields'](_0x2bfa18['query'][_0x6f0a('0x32')]));_0x131ec3['attributes']=_0x131ec3[_0x6f0a('0x33')][_0x6f0a('0x34')]?_0x131ec3['attributes']:_0x15ea7a[_0x6f0a('0x2e')];_0x131ec3[_0x6f0a('0x37')]=qs[_0x6f0a('0x38')](_0x2bfa18[_0x6f0a('0x2f')][_0x6f0a('0x38')]);_0x131ec3['where']=qs[_0x6f0a('0x3b')](_[_0x6f0a('0x3a')](_0x2bfa18[_0x6f0a('0x2f')],_0x15ea7a[_0x6f0a('0x3b')]));if(_0x2bfa18['query'][_0x6f0a('0x3d')]){_0x131ec3[_0x6f0a('0x39')]=_['merge'](_0x131ec3['where'],{'$or':_['map'](_0x131ec3[_0x6f0a('0x33')],function(_0x2efe80){var _0xc3c990={};_0xc3c990[_0x2efe80]={'$like':'%'+_0x2bfa18['query']['filter']+'%'};return _0xc3c990;})});}_0x131ec3=_['merge']({},_0x131ec3,_0x2bfa18[_0x6f0a('0x3f')]);return _0x33ce48[_0x6f0a('0x48')](_0x131ec3);}})[_0x6f0a('0x24')](function(_0x46a711){if(_0x46a711){_0x537f73=_0x46a711[_0x6f0a('0x34')];if(!_0x2bfa18[_0x6f0a('0x2f')][_0x6f0a('0x35')](_0x6f0a('0x36'))){_0x131ec3[_0x6f0a('0x1b')]=qs['limit'](_0x2bfa18[_0x6f0a('0x2f')][_0x6f0a('0x1b')]);_0x131ec3['offset']=qs[_0x6f0a('0x19')](_0x2bfa18[_0x6f0a('0x2f')]['offset']);}return _0x33ce48[_0x6f0a('0x48')](_0x131ec3);}})['then'](function(_0x22b276){if(_0x22b276){return _0x22b276?{'count':_0x537f73,'rows':_0x22b276}:null;}})[_0x6f0a('0x24')](respondWithResult(_0x2b0c55,null))['catch'](handleError(_0x2b0c55,null));};exports[_0x6f0a('0x4b')]=function(_0x331873,_0x341b1f,_0x46fe7b){var _0x2e0c79={};var _0x45c729={};var _0x3bf67a;var _0x5156b2;return db[_0x6f0a('0x2a')][_0x6f0a('0x49')]({'where':{'id':_0x331873[_0x6f0a('0x43')]['id']}})[_0x6f0a('0x24')](handleEntityNotFound(_0x341b1f,null))[_0x6f0a('0x24')](function(_0x118f27){if(_0x118f27){_0x3bf67a=_0x118f27;_0x45c729['model']=_['keys'](db['SugarcrmField'][_0x6f0a('0x2b')]);_0x45c729[_0x6f0a('0x2f')]=_[_0x6f0a('0x30')](_0x331873[_0x6f0a('0x2f')]);_0x45c729[_0x6f0a('0x3b')]=_[_0x6f0a('0x31')](_0x45c729[_0x6f0a('0x2e')],_0x45c729['query']);_0x2e0c79[_0x6f0a('0x33')]=_['intersection'](_0x45c729[_0x6f0a('0x2e')],qs[_0x6f0a('0x32')](_0x331873[_0x6f0a('0x2f')][_0x6f0a('0x32')]));_0x2e0c79[_0x6f0a('0x33')]=_0x2e0c79['attributes'][_0x6f0a('0x34')]?_0x2e0c79[_0x6f0a('0x33')]:_0x45c729[_0x6f0a('0x2e')];_0x2e0c79[_0x6f0a('0x37')]=qs[_0x6f0a('0x38')](_0x331873[_0x6f0a('0x2f')][_0x6f0a('0x38')]);_0x2e0c79[_0x6f0a('0x39')]=qs['filters'](_['pick'](_0x331873[_0x6f0a('0x2f')],_0x45c729['filters']));if(_0x331873[_0x6f0a('0x2f')]['filter']){_0x2e0c79['where']=_[_0x6f0a('0x3e')](_0x2e0c79[_0x6f0a('0x39')],{'$or':_['map'](_0x2e0c79['attributes'],function(_0x50d387){var _0x452380={};_0x452380[_0x50d387]={'$like':'%'+_0x331873[_0x6f0a('0x2f')][_0x6f0a('0x3d')]+'%'};return _0x452380;})});}_0x2e0c79=_[_0x6f0a('0x3e')]({},_0x2e0c79,_0x331873[_0x6f0a('0x3f')]);return _0x3bf67a['getSubjects'](_0x2e0c79);}})[_0x6f0a('0x24')](function(_0x55bf4e){if(_0x55bf4e){_0x5156b2=_0x55bf4e[_0x6f0a('0x34')];if(!_0x331873[_0x6f0a('0x2f')][_0x6f0a('0x35')](_0x6f0a('0x36'))){_0x2e0c79[_0x6f0a('0x1b')]=qs[_0x6f0a('0x1b')](_0x331873[_0x6f0a('0x2f')][_0x6f0a('0x1b')]);_0x2e0c79[_0x6f0a('0x19')]=qs[_0x6f0a('0x19')](_0x331873[_0x6f0a('0x2f')][_0x6f0a('0x19')]);}return _0x3bf67a[_0x6f0a('0x4b')](_0x2e0c79);}})[_0x6f0a('0x24')](function(_0x50436f){if(_0x50436f){return _0x50436f?{'count':_0x5156b2,'rows':_0x50436f}:null;}})[_0x6f0a('0x24')](respondWithResult(_0x341b1f,null))[_0x6f0a('0x41')](handleError(_0x341b1f,null));};exports[_0x6f0a('0x4c')]=function(_0x59c02b,_0x337b05,_0x55a0d8){var _0xfff1af={};var _0x3f5d68={};var _0x55e404;var _0x3e87c8;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x59c02b['params']['id']}})[_0x6f0a('0x24')](handleEntityNotFound(_0x337b05,null))['then'](function(_0x337013){if(_0x337013){_0x55e404=_0x337013;_0x3f5d68[_0x6f0a('0x2e')]=_['keys'](db[_0x6f0a('0x4a')][_0x6f0a('0x2b')]);_0x3f5d68[_0x6f0a('0x2f')]=_[_0x6f0a('0x30')](_0x59c02b[_0x6f0a('0x2f')]);_0x3f5d68[_0x6f0a('0x3b')]=_[_0x6f0a('0x31')](_0x3f5d68[_0x6f0a('0x2e')],_0x3f5d68[_0x6f0a('0x2f')]);_0xfff1af[_0x6f0a('0x33')]=_[_0x6f0a('0x31')](_0x3f5d68['model'],qs[_0x6f0a('0x32')](_0x59c02b[_0x6f0a('0x2f')]['fields']));_0xfff1af[_0x6f0a('0x33')]=_0xfff1af['attributes'][_0x6f0a('0x34')]?_0xfff1af[_0x6f0a('0x33')]:_0x3f5d68['model'];_0xfff1af[_0x6f0a('0x37')]=qs['sort'](_0x59c02b[_0x6f0a('0x2f')]['sort']);_0xfff1af[_0x6f0a('0x39')]=qs['filters'](_[_0x6f0a('0x3a')](_0x59c02b[_0x6f0a('0x2f')],_0x3f5d68[_0x6f0a('0x3b')]));if(_0x59c02b[_0x6f0a('0x2f')][_0x6f0a('0x3d')]){_0xfff1af[_0x6f0a('0x39')]=_[_0x6f0a('0x3e')](_0xfff1af[_0x6f0a('0x39')],{'$or':_[_0x6f0a('0x29')](_0xfff1af[_0x6f0a('0x33')],function(_0x168af5){var _0x33bda5={};_0x33bda5[_0x168af5]={'$like':'%'+_0x59c02b[_0x6f0a('0x2f')]['filter']+'%'};return _0x33bda5;})});}_0xfff1af=_[_0x6f0a('0x3e')]({},_0xfff1af,_0x59c02b['options']);return _0x55e404[_0x6f0a('0x4c')](_0xfff1af);}})[_0x6f0a('0x24')](function(_0x1d126c){if(_0x1d126c){_0x3e87c8=_0x1d126c[_0x6f0a('0x34')];if(!_0x59c02b['query'][_0x6f0a('0x35')](_0x6f0a('0x36'))){_0xfff1af[_0x6f0a('0x1b')]=qs['limit'](_0x59c02b[_0x6f0a('0x2f')]['limit']);_0xfff1af[_0x6f0a('0x19')]=qs[_0x6f0a('0x19')](_0x59c02b[_0x6f0a('0x2f')][_0x6f0a('0x19')]);}return _0x55e404['getDescriptions'](_0xfff1af);}})[_0x6f0a('0x24')](function(_0x1efa52){if(_0x1efa52){return _0x1efa52?{'count':_0x3e87c8,'rows':_0x1efa52}:null;}})[_0x6f0a('0x24')](respondWithResult(_0x337b05,null))[_0x6f0a('0x41')](handleError(_0x337b05,null));}; \ No newline at end of file +var _0x2161=['body','catch','update','find','params','getFields','findOne','map','nolimit','getSubjects','SugarcrmField','sort','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','where','pick','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','keys','length','create'];(function(_0x4e177b,_0x199e92){var _0x59e5e1=function(_0x46318b){while(--_0x46318b){_0x4e177b['push'](_0x4e177b['shift']());}};_0x59e5e1(++_0x199e92);}(_0x2161,0xb5));var _0x1216=function(_0x40fede,_0x203a11){_0x40fede=_0x40fede-0x0;var _0x482694=_0x2161[_0x40fede];return _0x482694;};'use strict';var emlformat=require(_0x1216('0x0'));var rimraf=require(_0x1216('0x1'));var zipdir=require(_0x1216('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1216('0x3'));var BPromise=require(_0x1216('0x4'));var Mustache=require(_0x1216('0x5'));var util=require(_0x1216('0x6'));var path=require(_0x1216('0x7'));var sox=require(_0x1216('0x8'));var csv=require(_0x1216('0x9'));var ejs=require(_0x1216('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1216('0xb'));var squel=require(_0x1216('0xc'));var crypto=require(_0x1216('0xd'));var jsforce=require(_0x1216('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1216('0x9'));var querystring=require(_0x1216('0xf'));var Papa=require(_0x1216('0x10'));var Redis=require(_0x1216('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1216('0x12'));var as=require(_0x1216('0x13'));var hardwareService=require(_0x1216('0x14'));var logger=require(_0x1216('0x15'))(_0x1216('0x16'));var utils=require('../../config/utils');var config=require(_0x1216('0x17'));var licenseUtil=require(_0x1216('0x18'));var db=require(_0x1216('0x19'))['db'];function respondWithStatusCode(_0x3307bc,_0x2a2a0b){_0x2a2a0b=_0x2a2a0b||0xcc;return function(_0x4558d5){if(_0x4558d5){return _0x3307bc[_0x1216('0x1a')](_0x2a2a0b);}return _0x3307bc[_0x1216('0x1b')](_0x2a2a0b)[_0x1216('0x1c')]();};}function respondWithResult(_0x4f80aa,_0x40483b){_0x40483b=_0x40483b||0xc8;return function(_0x2ccc7a){if(_0x2ccc7a){return _0x4f80aa[_0x1216('0x1b')](_0x40483b)[_0x1216('0x1d')](_0x2ccc7a);}};}function respondWithFilteredResult(_0x972dde,_0x4c9f58){return function(_0x26de00){if(_0x26de00){var _0x14b3fd=typeof _0x4c9f58[_0x1216('0x1e')]===_0x1216('0x1f')&&typeof _0x4c9f58['limit']===_0x1216('0x1f');var _0x248c42=_0x26de00['count'];var _0x4373b5=_0x14b3fd?0x0:_0x4c9f58['offset'];var _0x450f81=_0x14b3fd?_0x26de00['count']:_0x4c9f58[_0x1216('0x1e')]+_0x4c9f58[_0x1216('0x20')];var _0x583dbd;if(_0x450f81>=_0x248c42){_0x450f81=_0x248c42;_0x583dbd=0xc8;}else{_0x583dbd=0xce;}_0x972dde['status'](_0x583dbd);return _0x972dde[_0x1216('0x21')](_0x1216('0x22'),_0x4373b5+'-'+_0x450f81+'/'+_0x248c42)[_0x1216('0x1d')](_0x26de00);}return null;};}function patchUpdates(_0x1c22e8){return function(_0x2d1e16){try{jsonpatch[_0x1216('0x23')](_0x2d1e16,_0x1c22e8,!![]);}catch(_0x24d11e){return BPromise['reject'](_0x24d11e);}return _0x2d1e16[_0x1216('0x24')]();};}function saveUpdates(_0x4214be,_0x131662){return function(_0x53bcc7){if(_0x53bcc7){return _0x53bcc7['update'](_0x4214be)['then'](function(_0x15f4b6){return _0x15f4b6;});}return null;};}function removeEntity(_0x48b1ff,_0x4351a3){return function(_0x289915){if(_0x289915){return _0x289915[_0x1216('0x25')]()[_0x1216('0x26')](function(){_0x48b1ff[_0x1216('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5d23,_0xb6bdc8){return function(_0x3681fa){if(!_0x3681fa){_0x4c5d23[_0x1216('0x1a')](0x194);}return _0x3681fa;};}function handleError(_0x1a894e,_0x40f97e){_0x40f97e=_0x40f97e||0x1f4;return function(_0x4f9f12){logger[_0x1216('0x27')](_0x4f9f12[_0x1216('0x28')]);if(_0x4f9f12[_0x1216('0x29')]){delete _0x4f9f12[_0x1216('0x29')];}_0x1a894e[_0x1216('0x1b')](_0x40f97e)[_0x1216('0x2a')](_0x4f9f12);};}exports[_0x1216('0x2b')]=function(_0x4db819,_0x21e844){var _0x4c2ac2={},_0xb46858={},_0x3031e0={'count':0x0,'rows':[]};var _0x478ae0=_['map'](db[_0x1216('0x2c')][_0x1216('0x2d')],function(_0x192864){return{'name':_0x192864[_0x1216('0x2e')],'type':_0x192864['type']['key']};});_0xb46858[_0x1216('0x2f')]=_['map'](_0x478ae0,_0x1216('0x29'));_0xb46858[_0x1216('0x30')]=_['keys'](_0x4db819[_0x1216('0x30')]);_0xb46858[_0x1216('0x31')]=_[_0x1216('0x32')](_0xb46858[_0x1216('0x2f')],_0xb46858[_0x1216('0x30')]);_0x4c2ac2['attributes']=_[_0x1216('0x32')](_0xb46858[_0x1216('0x2f')],qs[_0x1216('0x33')](_0x4db819[_0x1216('0x30')][_0x1216('0x33')]));_0x4c2ac2[_0x1216('0x34')]=_0x4c2ac2[_0x1216('0x34')]['length']?_0x4c2ac2['attributes']:_0xb46858['model'];if(!_0x4db819[_0x1216('0x30')][_0x1216('0x35')]('nolimit')){_0x4c2ac2['limit']=qs['limit'](_0x4db819[_0x1216('0x30')][_0x1216('0x20')]);_0x4c2ac2['offset']=qs[_0x1216('0x1e')](_0x4db819['query'][_0x1216('0x1e')]);}_0x4c2ac2[_0x1216('0x36')]=qs['sort'](_0x4db819[_0x1216('0x30')]['sort']);_0x4c2ac2[_0x1216('0x37')]=qs[_0x1216('0x31')](_[_0x1216('0x38')](_0x4db819[_0x1216('0x30')],_0xb46858['filters']),_0x478ae0);if(_0x4db819[_0x1216('0x30')][_0x1216('0x39')]){_0x4c2ac2[_0x1216('0x37')]=_['merge'](_0x4c2ac2[_0x1216('0x37')],{'$or':_['map'](_0x478ae0,function(_0x1bd705){if(_0x1bd705[_0x1216('0x3a')]!==_0x1216('0x3b')){var _0x1e478f={};_0x1e478f[_0x1bd705[_0x1216('0x29')]]={'$like':'%'+_0x4db819[_0x1216('0x30')][_0x1216('0x39')]+'%'};return _0x1e478f;}})});}_0x4c2ac2=_[_0x1216('0x3c')]({},_0x4c2ac2,_0x4db819[_0x1216('0x3d')]);var _0x22dbec={'where':_0x4c2ac2['where']};return db[_0x1216('0x2c')][_0x1216('0x3e')](_0x22dbec)[_0x1216('0x26')](function(_0x5989b5){_0x3031e0[_0x1216('0x3e')]=_0x5989b5;if(_0x4db819[_0x1216('0x30')][_0x1216('0x3f')]){_0x4c2ac2[_0x1216('0x40')]=[{'all':!![]}];}return db[_0x1216('0x2c')][_0x1216('0x41')](_0x4c2ac2);})[_0x1216('0x26')](function(_0x3a43fd){_0x3031e0[_0x1216('0x42')]=_0x3a43fd;return _0x3031e0;})['then'](respondWithFilteredResult(_0x21e844,_0x4c2ac2))['catch'](handleError(_0x21e844,null));};exports[_0x1216('0x43')]=function(_0x2c2159,_0xbcd7e7){var _0x5c5a1d={'raw':![],'where':{'id':_0x2c2159['params']['id']}},_0x3eae48={};_0x3eae48[_0x1216('0x2f')]=_[_0x1216('0x44')](db[_0x1216('0x2c')][_0x1216('0x2d')]);_0x3eae48['query']=_[_0x1216('0x44')](_0x2c2159[_0x1216('0x30')]);_0x3eae48['filters']=_['intersection'](_0x3eae48[_0x1216('0x2f')],_0x3eae48[_0x1216('0x30')]);_0x5c5a1d[_0x1216('0x34')]=_[_0x1216('0x32')](_0x3eae48['model'],qs[_0x1216('0x33')](_0x2c2159[_0x1216('0x30')][_0x1216('0x33')]));_0x5c5a1d['attributes']=_0x5c5a1d[_0x1216('0x34')][_0x1216('0x45')]?_0x5c5a1d[_0x1216('0x34')]:_0x3eae48[_0x1216('0x2f')];if(_0x2c2159[_0x1216('0x30')][_0x1216('0x3f')]){_0x5c5a1d[_0x1216('0x40')]=[{'all':!![]}];}_0x5c5a1d=_['merge']({},_0x5c5a1d,_0x2c2159[_0x1216('0x3d')]);return db[_0x1216('0x2c')]['find'](_0x5c5a1d)[_0x1216('0x26')](handleEntityNotFound(_0xbcd7e7,null))[_0x1216('0x26')](respondWithResult(_0xbcd7e7,null))['catch'](handleError(_0xbcd7e7,null));};exports['create']=function(_0x593ced,_0x45d50e){return db[_0x1216('0x2c')][_0x1216('0x46')](_0x593ced[_0x1216('0x47')],{})[_0x1216('0x26')](respondWithResult(_0x45d50e,0xc9))[_0x1216('0x48')](handleError(_0x45d50e,null));};exports[_0x1216('0x49')]=function(_0x300479,_0x1aa99a){if(_0x300479[_0x1216('0x47')]['id']){delete _0x300479[_0x1216('0x47')]['id'];}return db[_0x1216('0x2c')][_0x1216('0x4a')]({'where':{'id':_0x300479[_0x1216('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1aa99a,null))[_0x1216('0x26')](saveUpdates(_0x300479[_0x1216('0x47')],null))[_0x1216('0x26')](respondWithResult(_0x1aa99a,null))['catch'](handleError(_0x1aa99a,null));};exports[_0x1216('0x25')]=function(_0x5ce5d3,_0x5ef934){return db[_0x1216('0x2c')][_0x1216('0x4a')]({'where':{'id':_0x5ce5d3['params']['id']}})['then'](handleEntityNotFound(_0x5ef934,null))[_0x1216('0x26')](removeEntity(_0x5ef934,null))[_0x1216('0x48')](handleError(_0x5ef934,null));};exports[_0x1216('0x4c')]=function(_0x3b4f88,_0x285d4e,_0x4e15a1){var _0x2682ee={};var _0x5dff2c={};var _0x457e77;var _0x355b15;return db[_0x1216('0x2c')][_0x1216('0x4d')]({'where':{'id':_0x3b4f88['params']['id']}})[_0x1216('0x26')](handleEntityNotFound(_0x285d4e,null))['then'](function(_0x23566b){if(_0x23566b){_0x457e77=_0x23566b;_0x5dff2c[_0x1216('0x2f')]=_[_0x1216('0x44')](db['SugarcrmField'][_0x1216('0x2d')]);_0x5dff2c[_0x1216('0x30')]=_[_0x1216('0x44')](_0x3b4f88[_0x1216('0x30')]);_0x5dff2c['filters']=_['intersection'](_0x5dff2c['model'],_0x5dff2c[_0x1216('0x30')]);_0x2682ee[_0x1216('0x34')]=_[_0x1216('0x32')](_0x5dff2c['model'],qs['fields'](_0x3b4f88[_0x1216('0x30')][_0x1216('0x33')]));_0x2682ee[_0x1216('0x34')]=_0x2682ee[_0x1216('0x34')][_0x1216('0x45')]?_0x2682ee[_0x1216('0x34')]:_0x5dff2c[_0x1216('0x2f')];_0x2682ee['order']=qs['sort'](_0x3b4f88[_0x1216('0x30')]['sort']);_0x2682ee['where']=qs['filters'](_['pick'](_0x3b4f88[_0x1216('0x30')],_0x5dff2c[_0x1216('0x31')]));if(_0x3b4f88['query'][_0x1216('0x39')]){_0x2682ee[_0x1216('0x37')]=_['merge'](_0x2682ee[_0x1216('0x37')],{'$or':_[_0x1216('0x4e')](_0x2682ee['attributes'],function(_0x334165){var _0x3604f0={};_0x3604f0[_0x334165]={'$like':'%'+_0x3b4f88['query']['filter']+'%'};return _0x3604f0;})});}_0x2682ee=_[_0x1216('0x3c')]({},_0x2682ee,_0x3b4f88[_0x1216('0x3d')]);return _0x457e77['getFields'](_0x2682ee);}})[_0x1216('0x26')](function(_0x16dade){if(_0x16dade){_0x355b15=_0x16dade[_0x1216('0x45')];if(!_0x3b4f88['query']['hasOwnProperty'](_0x1216('0x4f'))){_0x2682ee[_0x1216('0x20')]=qs[_0x1216('0x20')](_0x3b4f88['query'][_0x1216('0x20')]);_0x2682ee[_0x1216('0x1e')]=qs[_0x1216('0x1e')](_0x3b4f88[_0x1216('0x30')]['offset']);}return _0x457e77['getFields'](_0x2682ee);}})[_0x1216('0x26')](function(_0x416412){if(_0x416412){return _0x416412?{'count':_0x355b15,'rows':_0x416412}:null;}})[_0x1216('0x26')](respondWithResult(_0x285d4e,null))['catch'](handleError(_0x285d4e,null));};exports[_0x1216('0x50')]=function(_0x2b8d43,_0x351e2e,_0x331f6a){var _0x235df2={};var _0x543434={};var _0x48a304;var _0x837d4c;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x2b8d43[_0x1216('0x4b')]['id']}})[_0x1216('0x26')](handleEntityNotFound(_0x351e2e,null))[_0x1216('0x26')](function(_0x3e00be){if(_0x3e00be){_0x48a304=_0x3e00be;_0x543434[_0x1216('0x2f')]=_['keys'](db[_0x1216('0x51')][_0x1216('0x2d')]);_0x543434[_0x1216('0x30')]=_[_0x1216('0x44')](_0x2b8d43['query']);_0x543434[_0x1216('0x31')]=_[_0x1216('0x32')](_0x543434[_0x1216('0x2f')],_0x543434[_0x1216('0x30')]);_0x235df2[_0x1216('0x34')]=_[_0x1216('0x32')](_0x543434['model'],qs[_0x1216('0x33')](_0x2b8d43[_0x1216('0x30')][_0x1216('0x33')]));_0x235df2[_0x1216('0x34')]=_0x235df2[_0x1216('0x34')][_0x1216('0x45')]?_0x235df2[_0x1216('0x34')]:_0x543434[_0x1216('0x2f')];_0x235df2[_0x1216('0x36')]=qs[_0x1216('0x52')](_0x2b8d43[_0x1216('0x30')]['sort']);_0x235df2['where']=qs[_0x1216('0x31')](_['pick'](_0x2b8d43[_0x1216('0x30')],_0x543434[_0x1216('0x31')]));if(_0x2b8d43[_0x1216('0x30')][_0x1216('0x39')]){_0x235df2[_0x1216('0x37')]=_[_0x1216('0x3c')](_0x235df2[_0x1216('0x37')],{'$or':_[_0x1216('0x4e')](_0x235df2[_0x1216('0x34')],function(_0x506ee1){var _0x4ba3fe={};_0x4ba3fe[_0x506ee1]={'$like':'%'+_0x2b8d43[_0x1216('0x30')][_0x1216('0x39')]+'%'};return _0x4ba3fe;})});}_0x235df2=_['merge']({},_0x235df2,_0x2b8d43['options']);return _0x48a304['getSubjects'](_0x235df2);}})[_0x1216('0x26')](function(_0x3a3d78){if(_0x3a3d78){_0x837d4c=_0x3a3d78['length'];if(!_0x2b8d43['query'][_0x1216('0x35')]('nolimit')){_0x235df2['limit']=qs['limit'](_0x2b8d43['query'][_0x1216('0x20')]);_0x235df2[_0x1216('0x1e')]=qs[_0x1216('0x1e')](_0x2b8d43[_0x1216('0x30')][_0x1216('0x1e')]);}return _0x48a304[_0x1216('0x50')](_0x235df2);}})[_0x1216('0x26')](function(_0x5b9c63){if(_0x5b9c63){return _0x5b9c63?{'count':_0x837d4c,'rows':_0x5b9c63}:null;}})[_0x1216('0x26')](respondWithResult(_0x351e2e,null))['catch'](handleError(_0x351e2e,null));};exports[_0x1216('0x53')]=function(_0x5e01a4,_0x462e7a,_0x2fc400){var _0x4556ea={};var _0x44a2eb={};var _0x37af7b;var _0x102be6;return db[_0x1216('0x2c')][_0x1216('0x4d')]({'where':{'id':_0x5e01a4[_0x1216('0x4b')]['id']}})[_0x1216('0x26')](handleEntityNotFound(_0x462e7a,null))[_0x1216('0x26')](function(_0x5310c7){if(_0x5310c7){_0x37af7b=_0x5310c7;_0x44a2eb[_0x1216('0x2f')]=_[_0x1216('0x44')](db[_0x1216('0x51')][_0x1216('0x2d')]);_0x44a2eb['query']=_['keys'](_0x5e01a4[_0x1216('0x30')]);_0x44a2eb[_0x1216('0x31')]=_['intersection'](_0x44a2eb[_0x1216('0x2f')],_0x44a2eb[_0x1216('0x30')]);_0x4556ea['attributes']=_[_0x1216('0x32')](_0x44a2eb['model'],qs[_0x1216('0x33')](_0x5e01a4['query'][_0x1216('0x33')]));_0x4556ea[_0x1216('0x34')]=_0x4556ea[_0x1216('0x34')][_0x1216('0x45')]?_0x4556ea[_0x1216('0x34')]:_0x44a2eb[_0x1216('0x2f')];_0x4556ea[_0x1216('0x36')]=qs[_0x1216('0x52')](_0x5e01a4['query'][_0x1216('0x52')]);_0x4556ea['where']=qs[_0x1216('0x31')](_[_0x1216('0x38')](_0x5e01a4[_0x1216('0x30')],_0x44a2eb[_0x1216('0x31')]));if(_0x5e01a4[_0x1216('0x30')][_0x1216('0x39')]){_0x4556ea[_0x1216('0x37')]=_[_0x1216('0x3c')](_0x4556ea[_0x1216('0x37')],{'$or':_[_0x1216('0x4e')](_0x4556ea[_0x1216('0x34')],function(_0x191e4f){var _0x23b1e1={};_0x23b1e1[_0x191e4f]={'$like':'%'+_0x5e01a4[_0x1216('0x30')]['filter']+'%'};return _0x23b1e1;})});}_0x4556ea=_[_0x1216('0x3c')]({},_0x4556ea,_0x5e01a4[_0x1216('0x3d')]);return _0x37af7b[_0x1216('0x53')](_0x4556ea);}})[_0x1216('0x26')](function(_0x54c1f1){if(_0x54c1f1){_0x102be6=_0x54c1f1[_0x1216('0x45')];if(!_0x5e01a4[_0x1216('0x30')][_0x1216('0x35')](_0x1216('0x4f'))){_0x4556ea[_0x1216('0x20')]=qs['limit'](_0x5e01a4[_0x1216('0x30')][_0x1216('0x20')]);_0x4556ea[_0x1216('0x1e')]=qs['offset'](_0x5e01a4[_0x1216('0x30')][_0x1216('0x1e')]);}return _0x37af7b[_0x1216('0x53')](_0x4556ea);}})[_0x1216('0x26')](function(_0x325cbe){if(_0x325cbe){return _0x325cbe?{'count':_0x102be6,'rows':_0x325cbe}:null;}})['then'](respondWithResult(_0x462e7a,null))[_0x1216('0x48')](handleError(_0x462e7a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 26e4513..a849cdf 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 _0xcdc7=['moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','api'];(function(_0x50dc2f,_0x2512fc){var _0xefb8c5=function(_0x3fe9aa){while(--_0x3fe9aa){_0x50dc2f['push'](_0x50dc2f['shift']());}};_0xefb8c5(++_0x2512fc);}(_0xcdc7,0xa3));var _0x7cdc=function(_0x3e9e8b,_0xc8ed51){_0x3e9e8b=_0x3e9e8b-0x0;var _0x58e996=_0xcdc7[_0x3e9e8b];return _0x58e996;};'use strict';var _=require(_0x7cdc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7cdc('0x1'));var moment=require(_0x7cdc('0x2'));var BPromise=require(_0x7cdc('0x3'));var rp=require(_0x7cdc('0x4'));var fs=require('fs');var path=require(_0x7cdc('0x5'));var rimraf=require('rimraf');var config=require(_0x7cdc('0x6'));var attributes=require(_0x7cdc('0x7'));module[_0x7cdc('0x8')]=function(_0x14ae95,_0x3905e2){return _0x14ae95[_0x7cdc('0x9')](_0x7cdc('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cf1=['./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x360bc9,_0x110450){var _0xdeb61b=function(_0x3bd7fa){while(--_0x3bd7fa){_0x360bc9['push'](_0x360bc9['shift']());}};_0xdeb61b(++_0x110450);}(_0x7cf1,0x88));var _0x17cf=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0x7cf1[_0x54edc9];return _0x2ae7a9;};'use strict';var _=require(_0x17cf('0x0'));var util=require(_0x17cf('0x1'));var logger=require(_0x17cf('0x2'))(_0x17cf('0x3'));var moment=require(_0x17cf('0x4'));var BPromise=require(_0x17cf('0x5'));var rp=require(_0x17cf('0x6'));var fs=require('fs');var path=require(_0x17cf('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x17cf('0x8'));module[_0x17cf('0x9')]=function(_0x3a8601,_0x4e8d36){return _0x3a8601[_0x17cf('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0x17cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 37e8cf0..127deb7 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 _0xfb3e=['lodash','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0xa9671b,_0x11378d){var _0x205591=function(_0x5dc88d){while(--_0x5dc88d){_0xa9671b['push'](_0xa9671b['shift']());}};_0x205591(++_0x11378d);}(_0xfb3e,0x1c2));var _0xefb3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xfb3e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xefb3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xefb3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xefb3('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xefb3('0x3'))('rpc');var config=require(_0xefb3('0x4'));var jayson=require(_0xefb3('0x5'));var client=jayson[_0xefb3('0x6')][_0xefb3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f6478,_0x353f03,_0x4f7461){return new BPromise(function(_0x41f986,_0x547006){return client['request'](_0x1f6478,_0x4f7461)['then'](function(_0x1de63a){logger[_0xefb3('0x8')](_0xefb3('0x9'),_0x353f03,_0xefb3('0xa'));logger[_0xefb3('0xb')](_0xefb3('0xc'),_0x353f03,_0xefb3('0xa'),JSON[_0xefb3('0xd')](_0x1de63a));if(_0x1de63a['error']){if(_0x1de63a[_0xefb3('0xe')]['code']===0x1f4){logger[_0xefb3('0xe')](_0xefb3('0x9'),_0x353f03,_0x1de63a[_0xefb3('0xe')][_0xefb3('0xf')]);return _0x547006(_0x1de63a['error'][_0xefb3('0xf')]);}logger[_0xefb3('0xe')](_0xefb3('0x9'),_0x353f03,_0x1de63a[_0xefb3('0xe')][_0xefb3('0xf')]);return _0x41f986(_0x1de63a[_0xefb3('0xe')]['message']);}else{logger[_0xefb3('0x8')](_0xefb3('0x9'),_0x353f03,_0xefb3('0xa'));_0x41f986(_0x1de63a[_0xefb3('0x10')]['message']);}})[_0xefb3('0x11')](function(_0x2234f9){logger['error'](_0xefb3('0x9'),_0x353f03,_0x2234f9);_0x547006(_0x2234f9);});});} \ No newline at end of file +var _0xae1d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x42d525,_0x1247cb){var _0x7f0c3c=function(_0x5016f1){while(--_0x5016f1){_0x42d525['push'](_0x42d525['shift']());}};_0x7f0c3c(++_0x1247cb);}(_0xae1d,0x81));var _0xdae1=function(_0x67b97a,_0x503a86){_0x67b97a=_0x67b97a-0x0;var _0x1c50b2=_0xae1d[_0x67b97a];return _0x1c50b2;};'use strict';var _=require(_0xdae1('0x0'));var util=require(_0xdae1('0x1'));var moment=require(_0xdae1('0x2'));var BPromise=require('bluebird');var rs=require(_0xdae1('0x3'));var fs=require('fs');var Redis=require(_0xdae1('0x4'));var db=require(_0xdae1('0x5'))['db'];var utils=require(_0xdae1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xdae1('0x7'));var jayson=require(_0xdae1('0x8'));var client=jayson[_0xdae1('0x9')][_0xdae1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5be939,_0x4be9b7,_0x242f8b){return new BPromise(function(_0x577dcc,_0x1fc2d5){return client['request'](_0x5be939,_0x242f8b)[_0xdae1('0xb')](function(_0x1e55bb){logger['info'](_0xdae1('0xc'),_0x4be9b7,'request\x20sent');logger['debug'](_0xdae1('0xd'),_0x4be9b7,_0xdae1('0xe'),JSON[_0xdae1('0xf')](_0x1e55bb));if(_0x1e55bb[_0xdae1('0x10')]){if(_0x1e55bb['error'][_0xdae1('0x11')]===0x1f4){logger[_0xdae1('0x10')](_0xdae1('0xc'),_0x4be9b7,_0x1e55bb[_0xdae1('0x10')][_0xdae1('0x12')]);return _0x1fc2d5(_0x1e55bb[_0xdae1('0x10')][_0xdae1('0x12')]);}logger[_0xdae1('0x10')](_0xdae1('0xc'),_0x4be9b7,_0x1e55bb[_0xdae1('0x10')][_0xdae1('0x12')]);return _0x577dcc(_0x1e55bb[_0xdae1('0x10')][_0xdae1('0x12')]);}else{logger[_0xdae1('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4be9b7,'request\x20sent');_0x577dcc(_0x1e55bb[_0xdae1('0x14')][_0xdae1('0x12')]);}})[_0xdae1('0x15')](function(_0x5678fb){logger['error'](_0xdae1('0xc'),_0x4be9b7,_0x5678fb);_0x1fc2d5(_0x5678fb);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index c61c8b5..57c7caa 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 _0x3ac5=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x3ac5,0xe0));var _0x53ac=function(_0x34dcde,_0x35aed){_0x34dcde=_0x34dcde-0x0;var _0x264419=_0x3ac5[_0x34dcde];return _0x264419;};'use strict';var multer=require(_0x53ac('0x0'));var util=require(_0x53ac('0x1'));var path=require(_0x53ac('0x2'));var timeout=require(_0x53ac('0x3'));var express=require(_0x53ac('0x4'));var router=express[_0x53ac('0x5')]();var fs_extra=require(_0x53ac('0x6'));var auth=require(_0x53ac('0x7'));var interaction=require(_0x53ac('0x8'));var config=require(_0x53ac('0x9'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0x53ac('0xa')](),controller[_0x53ac('0xb')]);router[_0x53ac('0xc')](_0x53ac('0xd'),auth['isAuthenticated'](),controller[_0x53ac('0xe')]);router['post']('/',auth[_0x53ac('0xa')](),controller[_0x53ac('0xf')]);router[_0x53ac('0x10')](_0x53ac('0xd'),auth['isAuthenticated'](),controller[_0x53ac('0x11')]);router[_0x53ac('0x12')](_0x53ac('0xd'),auth[_0x53ac('0xa')](),controller[_0x53ac('0x13')]);module[_0x53ac('0x14')]=router; \ No newline at end of file +var _0x6147=['/:id','show','post','create','put','delete','exports','multer','path','connect-timeout','express','../../config/environment','get','isAuthenticated','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6147,0x1ab));var _0x7614=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x6147[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require(_0x7614('0x0'));var util=require('util');var path=require(_0x7614('0x1'));var timeout=require(_0x7614('0x2'));var express=require(_0x7614('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7614('0x4'));var controller=require('./intSugarcrmField.controller');router[_0x7614('0x5')]('/',auth[_0x7614('0x6')](),controller[_0x7614('0x7')]);router[_0x7614('0x5')](_0x7614('0x8'),auth[_0x7614('0x6')](),controller[_0x7614('0x9')]);router[_0x7614('0xa')]('/',auth['isAuthenticated'](),controller[_0x7614('0xb')]);router[_0x7614('0xc')](_0x7614('0x8'),auth[_0x7614('0x6')](),controller['update']);router[_0x7614('0xd')]('/:id',auth[_0x7614('0x6')](),controller['destroy']);module[_0x7614('0xe')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 49b1d6d..cf0ac76 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 _0xca6b=['string','variable','customVariable','picklist','STRING','BOOLEAN','ENUM'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xca6b,0x179));var _0xbca6=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xca6b[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xbca6('0x0')](_0xbca6('0x1'),_0xbca6('0x2'),_0xbca6('0x3'),'keyValue',_0xbca6('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbca6('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xbca6('0x1'),_0xbca6('0x2'),_0xbca6('0x3'))},'keyContent':{'type':Sequelize[_0xbca6('0x5')]},'idField':{'type':Sequelize[_0xbca6('0x5')]},'nameField':{'type':Sequelize[_0xbca6('0x5')]},'customField':{'type':Sequelize[_0xbca6('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x46bc=['ENUM','variable','BOOLEAN','exports','string','customVariable','keyValue','picklist','STRING'];(function(_0x4a1d74,_0x160630){var _0x16d901=function(_0x42eae9){while(--_0x42eae9){_0x4a1d74['push'](_0x4a1d74['shift']());}};_0x16d901(++_0x160630);}(_0x46bc,0x12c));var _0xc46b=function(_0x53f37f,_0xfb0b18){_0x53f37f=_0x53f37f-0x0;var _0x2fe5f8=_0x46bc[_0x53f37f];return _0x2fe5f8;};'use strict';var Sequelize=require('sequelize');module[_0xc46b('0x0')]={'type':{'type':Sequelize['ENUM'](_0xc46b('0x1'),'variable',_0xc46b('0x2'),_0xc46b('0x3'),_0xc46b('0x4')),'defaultValue':_0xc46b('0x1')},'content':{'type':Sequelize[_0xc46b('0x5')]},'key':{'type':Sequelize[_0xc46b('0x5')]},'keyType':{'type':Sequelize[_0xc46b('0x6')](_0xc46b('0x1'),_0xc46b('0x7'),_0xc46b('0x2'))},'keyContent':{'type':Sequelize[_0xc46b('0x5')]},'idField':{'type':Sequelize[_0xc46b('0x5')]},'nameField':{'type':Sequelize[_0xc46b('0x5')]},'customField':{'type':Sequelize[_0xc46b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc46b('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 3d3f3fe..d68b702 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 _0x369c=['fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','show','length','includeAll','options','find','create','body','params','catch','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','rawAttributes'];(function(_0x15aacc,_0x907610){var _0x511759=function(_0xf00a28){while(--_0xf00a28){_0x15aacc['push'](_0x15aacc['shift']());}};_0x511759(++_0x907610);}(_0x369c,0x190));var _0xc369=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x369c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc369('0x0'));var jsonpatch=require(_0xc369('0x1'));var rp=require(_0xc369('0x2'));var moment=require('moment');var BPromise=require(_0xc369('0x3'));var Mustache=require(_0xc369('0x4'));var util=require(_0xc369('0x5'));var path=require(_0xc369('0x6'));var sox=require(_0xc369('0x7'));var csv=require('to-csv');var ejs=require(_0xc369('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc369('0x9'));var squel=require(_0xc369('0xa'));var crypto=require(_0xc369('0xb'));var jsforce=require(_0xc369('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc369('0xd'));var Papa=require(_0xc369('0xe'));var Redis=require('ioredis');var authService=require(_0xc369('0xf'));var qs=require(_0xc369('0x10'));var as=require(_0xc369('0x11'));var hardwareService=require(_0xc369('0x12'));var logger=require(_0xc369('0x13'))(_0xc369('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc369('0x15'));var db=require(_0xc369('0x16'))['db'];function respondWithStatusCode(_0x3c3408,_0x300010){_0x300010=_0x300010||0xcc;return function(_0x7b701c){if(_0x7b701c){return _0x3c3408[_0xc369('0x17')](_0x300010);}return _0x3c3408[_0xc369('0x18')](_0x300010)['end']();};}function respondWithResult(_0xb3b4b6,_0x1c3866){_0x1c3866=_0x1c3866||0xc8;return function(_0x25b059){if(_0x25b059){return _0xb3b4b6['status'](_0x1c3866)[_0xc369('0x19')](_0x25b059);}};}function respondWithFilteredResult(_0x2d45b9,_0x21498c){return function(_0x470e8c){if(_0x470e8c){var _0x2fe402=typeof _0x21498c[_0xc369('0x1a')]===_0xc369('0x1b')&&typeof _0x21498c[_0xc369('0x1c')]===_0xc369('0x1b');var _0x228e2=_0x470e8c[_0xc369('0x1d')];var _0x35530c=_0x2fe402?0x0:_0x21498c['offset'];var _0x4909dd=_0x2fe402?_0x470e8c[_0xc369('0x1d')]:_0x21498c[_0xc369('0x1a')]+_0x21498c[_0xc369('0x1c')];var _0x2f37dc;if(_0x4909dd>=_0x228e2){_0x4909dd=_0x228e2;_0x2f37dc=0xc8;}else{_0x2f37dc=0xce;}_0x2d45b9[_0xc369('0x18')](_0x2f37dc);return _0x2d45b9['set'](_0xc369('0x1e'),_0x35530c+'-'+_0x4909dd+'/'+_0x228e2)[_0xc369('0x19')](_0x470e8c);}return null;};}function patchUpdates(_0x4ff5a0){return function(_0x454a74){try{jsonpatch[_0xc369('0x1f')](_0x454a74,_0x4ff5a0,!![]);}catch(_0x367a53){return BPromise[_0xc369('0x20')](_0x367a53);}return _0x454a74['save']();};}function saveUpdates(_0x29dd04,_0x1c5d4d){return function(_0x547eba){if(_0x547eba){return _0x547eba[_0xc369('0x21')](_0x29dd04)[_0xc369('0x22')](function(_0x23dcb8){return _0x23dcb8;});}return null;};}function removeEntity(_0x4cc240,_0x5a63f0){return function(_0x3ede20){if(_0x3ede20){return _0x3ede20[_0xc369('0x23')]()[_0xc369('0x22')](function(){_0x4cc240[_0xc369('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20a24c,_0x3d1a1f){return function(_0xa5e9f5){if(!_0xa5e9f5){_0x20a24c[_0xc369('0x17')](0x194);}return _0xa5e9f5;};}function handleError(_0xff4145,_0x34a8bf){_0x34a8bf=_0x34a8bf||0x1f4;return function(_0xb57ed5){logger[_0xc369('0x24')](_0xb57ed5[_0xc369('0x25')]);if(_0xb57ed5[_0xc369('0x26')]){delete _0xb57ed5[_0xc369('0x26')];}_0xff4145['status'](_0x34a8bf)[_0xc369('0x27')](_0xb57ed5);};}exports[_0xc369('0x28')]=function(_0x5c321b,_0x4ec244){var _0xf2b38f={},_0x379dfe={},_0x39177d={'count':0x0,'rows':[]};var _0x12c3a7=_[_0xc369('0x29')](db[_0xc369('0x2a')][_0xc369('0x2b')],function(_0x3fe0c3){return{'name':_0x3fe0c3[_0xc369('0x2c')],'type':_0x3fe0c3[_0xc369('0x2d')][_0xc369('0x2e')]};});_0x379dfe[_0xc369('0x2f')]=_[_0xc369('0x29')](_0x12c3a7,_0xc369('0x26'));_0x379dfe[_0xc369('0x30')]=_[_0xc369('0x31')](_0x5c321b[_0xc369('0x30')]);_0x379dfe['filters']=_[_0xc369('0x32')](_0x379dfe[_0xc369('0x2f')],_0x379dfe[_0xc369('0x30')]);_0xf2b38f[_0xc369('0x33')]=_[_0xc369('0x32')](_0x379dfe[_0xc369('0x2f')],qs[_0xc369('0x34')](_0x5c321b[_0xc369('0x30')][_0xc369('0x34')]));_0xf2b38f['attributes']=_0xf2b38f[_0xc369('0x33')]['length']?_0xf2b38f['attributes']:_0x379dfe[_0xc369('0x2f')];if(!_0x5c321b[_0xc369('0x30')][_0xc369('0x35')](_0xc369('0x36'))){_0xf2b38f[_0xc369('0x1c')]=qs[_0xc369('0x1c')](_0x5c321b[_0xc369('0x30')]['limit']);_0xf2b38f[_0xc369('0x1a')]=qs[_0xc369('0x1a')](_0x5c321b['query'][_0xc369('0x1a')]);}_0xf2b38f[_0xc369('0x37')]=qs['sort'](_0x5c321b['query'][_0xc369('0x38')]);_0xf2b38f[_0xc369('0x39')]=qs[_0xc369('0x3a')](_[_0xc369('0x3b')](_0x5c321b[_0xc369('0x30')],_0x379dfe['filters']),_0x12c3a7);if(_0x5c321b[_0xc369('0x30')][_0xc369('0x3c')]){_0xf2b38f[_0xc369('0x39')]=_[_0xc369('0x3d')](_0xf2b38f[_0xc369('0x39')],{'$or':_[_0xc369('0x29')](_0x12c3a7,function(_0x1e5d41){if(_0x1e5d41['type']!==_0xc369('0x3e')){var _0x4e6f19={};_0x4e6f19[_0x1e5d41[_0xc369('0x26')]]={'$like':'%'+_0x5c321b[_0xc369('0x30')]['filter']+'%'};return _0x4e6f19;}})});}_0xf2b38f=_[_0xc369('0x3d')]({},_0xf2b38f,_0x5c321b['options']);var _0x1ead7a={'where':_0xf2b38f['where']};return db[_0xc369('0x2a')][_0xc369('0x1d')](_0x1ead7a)[_0xc369('0x22')](function(_0x105c89){_0x39177d['count']=_0x105c89;if(_0x5c321b['query']['includeAll']){_0xf2b38f[_0xc369('0x3f')]=[{'all':!![]}];}return db[_0xc369('0x2a')][_0xc369('0x40')](_0xf2b38f);})[_0xc369('0x22')](function(_0x1d3934){_0x39177d['rows']=_0x1d3934;return _0x39177d;})[_0xc369('0x22')](respondWithFilteredResult(_0x4ec244,_0xf2b38f))['catch'](handleError(_0x4ec244,null));};exports[_0xc369('0x41')]=function(_0x149b33,_0xaf41ef){var _0x486059={'raw':!![],'where':{'id':_0x149b33['params']['id']}},_0x5dfbf2={};_0x5dfbf2[_0xc369('0x2f')]=_[_0xc369('0x31')](db['SugarcrmField'][_0xc369('0x2b')]);_0x5dfbf2[_0xc369('0x30')]=_[_0xc369('0x31')](_0x149b33[_0xc369('0x30')]);_0x5dfbf2[_0xc369('0x3a')]=_[_0xc369('0x32')](_0x5dfbf2[_0xc369('0x2f')],_0x5dfbf2[_0xc369('0x30')]);_0x486059[_0xc369('0x33')]=_[_0xc369('0x32')](_0x5dfbf2[_0xc369('0x2f')],qs['fields'](_0x149b33[_0xc369('0x30')]['fields']));_0x486059['attributes']=_0x486059[_0xc369('0x33')][_0xc369('0x42')]?_0x486059[_0xc369('0x33')]:_0x5dfbf2[_0xc369('0x2f')];if(_0x149b33[_0xc369('0x30')][_0xc369('0x43')]){_0x486059[_0xc369('0x3f')]=[{'all':!![]}];}_0x486059=_[_0xc369('0x3d')]({},_0x486059,_0x149b33[_0xc369('0x44')]);return db[_0xc369('0x2a')][_0xc369('0x45')](_0x486059)[_0xc369('0x22')](handleEntityNotFound(_0xaf41ef,null))[_0xc369('0x22')](respondWithResult(_0xaf41ef,null))['catch'](handleError(_0xaf41ef,null));};exports[_0xc369('0x46')]=function(_0x388222,_0x136dc5){return db[_0xc369('0x2a')][_0xc369('0x46')](_0x388222[_0xc369('0x47')],{})[_0xc369('0x22')](respondWithResult(_0x136dc5,0xc9))['catch'](handleError(_0x136dc5,null));};exports['update']=function(_0xb37051,_0x20aaa2){if(_0xb37051[_0xc369('0x47')]['id']){delete _0xb37051[_0xc369('0x47')]['id'];}return db[_0xc369('0x2a')][_0xc369('0x45')]({'where':{'id':_0xb37051[_0xc369('0x48')]['id']}})[_0xc369('0x22')](handleEntityNotFound(_0x20aaa2,null))[_0xc369('0x22')](saveUpdates(_0xb37051[_0xc369('0x47')],null))[_0xc369('0x22')](respondWithResult(_0x20aaa2,null))[_0xc369('0x49')](handleError(_0x20aaa2,null));};exports['destroy']=function(_0x56d7e8,_0x46e205){return db[_0xc369('0x2a')]['find']({'where':{'id':_0x56d7e8[_0xc369('0x48')]['id']}})[_0xc369('0x22')](handleEntityNotFound(_0x46e205,null))[_0xc369('0x22')](removeEntity(_0x46e205,null))['catch'](handleError(_0x46e205,null));}; \ No newline at end of file +var _0x1b75=['findAll','rows','catch','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','SugarcrmField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include'];(function(_0x55b86a,_0x9f9772){var _0x46f950=function(_0x3113b0){while(--_0x3113b0){_0x55b86a['push'](_0x55b86a['shift']());}};_0x46f950(++_0x9f9772);}(_0x1b75,0x17f));var _0x51b7=function(_0x11f249,_0x4ca4a8){_0x11f249=_0x11f249-0x0;var _0x5c3656=_0x1b75[_0x11f249];return _0x5c3656;};'use strict';var emlformat=require(_0x51b7('0x0'));var rimraf=require(_0x51b7('0x1'));var zipdir=require(_0x51b7('0x2'));var jsonpatch=require(_0x51b7('0x3'));var rp=require(_0x51b7('0x4'));var moment=require(_0x51b7('0x5'));var BPromise=require(_0x51b7('0x6'));var Mustache=require('mustache');var util=require(_0x51b7('0x7'));var path=require(_0x51b7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x51b7('0x9'));var fs=require('fs');var fs_extra=require(_0x51b7('0xa'));var _=require('lodash');var squel=require(_0x51b7('0xb'));var crypto=require('crypto');var jsforce=require(_0x51b7('0xc'));var deskjs=require(_0x51b7('0xd'));var toCsv=require(_0x51b7('0xe'));var querystring=require('querystring');var Papa=require(_0x51b7('0xf'));var Redis=require(_0x51b7('0x10'));var authService=require(_0x51b7('0x11'));var qs=require(_0x51b7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51b7('0x13'));var logger=require(_0x51b7('0x14'))('api');var utils=require(_0x51b7('0x15'));var config=require(_0x51b7('0x16'));var licenseUtil=require(_0x51b7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17d226,_0x226648){_0x226648=_0x226648||0xcc;return function(_0x4a999d){if(_0x4a999d){return _0x17d226[_0x51b7('0x18')](_0x226648);}return _0x17d226['status'](_0x226648)[_0x51b7('0x19')]();};}function respondWithResult(_0x4b0dc0,_0x5c6dc0){_0x5c6dc0=_0x5c6dc0||0xc8;return function(_0x581f53){if(_0x581f53){return _0x4b0dc0[_0x51b7('0x1a')](_0x5c6dc0)[_0x51b7('0x1b')](_0x581f53);}};}function respondWithFilteredResult(_0x1aa23b,_0xa2e2df){return function(_0x1b6daa){if(_0x1b6daa){var _0x57fc7b=typeof _0xa2e2df[_0x51b7('0x1c')]==='undefined'&&typeof _0xa2e2df[_0x51b7('0x1d')]===_0x51b7('0x1e');var _0x2062ba=_0x1b6daa[_0x51b7('0x1f')];var _0x4ebcce=_0x57fc7b?0x0:_0xa2e2df[_0x51b7('0x1c')];var _0x3fc16a=_0x57fc7b?_0x1b6daa['count']:_0xa2e2df[_0x51b7('0x1c')]+_0xa2e2df[_0x51b7('0x1d')];var _0x2bd5ee;if(_0x3fc16a>=_0x2062ba){_0x3fc16a=_0x2062ba;_0x2bd5ee=0xc8;}else{_0x2bd5ee=0xce;}_0x1aa23b[_0x51b7('0x1a')](_0x2bd5ee);return _0x1aa23b[_0x51b7('0x20')](_0x51b7('0x21'),_0x4ebcce+'-'+_0x3fc16a+'/'+_0x2062ba)[_0x51b7('0x1b')](_0x1b6daa);}return null;};}function patchUpdates(_0x5a3019){return function(_0x3e428e){try{jsonpatch['apply'](_0x3e428e,_0x5a3019,!![]);}catch(_0x44fde2){return BPromise[_0x51b7('0x22')](_0x44fde2);}return _0x3e428e[_0x51b7('0x23')]();};}function saveUpdates(_0x392041,_0x46e742){return function(_0x8bdb78){if(_0x8bdb78){return _0x8bdb78['update'](_0x392041)[_0x51b7('0x24')](function(_0x2ce662){return _0x2ce662;});}return null;};}function removeEntity(_0x4143a0,_0x33a91e){return function(_0x1d1cb0){if(_0x1d1cb0){return _0x1d1cb0[_0x51b7('0x25')]()[_0x51b7('0x24')](function(){_0x4143a0[_0x51b7('0x1a')](0xcc)[_0x51b7('0x19')]();});}};}function handleEntityNotFound(_0x1fed56,_0x751d99){return function(_0xc4c07f){if(!_0xc4c07f){_0x1fed56['sendStatus'](0x194);}return _0xc4c07f;};}function handleError(_0x33f573,_0x38e44c){_0x38e44c=_0x38e44c||0x1f4;return function(_0x595a87){logger[_0x51b7('0x26')](_0x595a87[_0x51b7('0x27')]);if(_0x595a87[_0x51b7('0x28')]){delete _0x595a87[_0x51b7('0x28')];}_0x33f573[_0x51b7('0x1a')](_0x38e44c)[_0x51b7('0x29')](_0x595a87);};}exports[_0x51b7('0x2a')]=function(_0x5644b6,_0x339711){var _0x5a5e48={},_0x14adfd={},_0x475879={'count':0x0,'rows':[]};var _0x5c053a=_[_0x51b7('0x2b')](db[_0x51b7('0x2c')][_0x51b7('0x2d')],function(_0x5a3017){return{'name':_0x5a3017['fieldName'],'type':_0x5a3017[_0x51b7('0x2e')][_0x51b7('0x2f')]};});_0x14adfd[_0x51b7('0x30')]=_[_0x51b7('0x2b')](_0x5c053a,_0x51b7('0x28'));_0x14adfd[_0x51b7('0x31')]=_[_0x51b7('0x32')](_0x5644b6[_0x51b7('0x31')]);_0x14adfd[_0x51b7('0x33')]=_[_0x51b7('0x34')](_0x14adfd[_0x51b7('0x30')],_0x14adfd['query']);_0x5a5e48[_0x51b7('0x35')]=_[_0x51b7('0x34')](_0x14adfd[_0x51b7('0x30')],qs[_0x51b7('0x36')](_0x5644b6[_0x51b7('0x31')][_0x51b7('0x36')]));_0x5a5e48[_0x51b7('0x35')]=_0x5a5e48[_0x51b7('0x35')]['length']?_0x5a5e48[_0x51b7('0x35')]:_0x14adfd['model'];if(!_0x5644b6[_0x51b7('0x31')][_0x51b7('0x37')](_0x51b7('0x38'))){_0x5a5e48[_0x51b7('0x1d')]=qs[_0x51b7('0x1d')](_0x5644b6['query'][_0x51b7('0x1d')]);_0x5a5e48['offset']=qs[_0x51b7('0x1c')](_0x5644b6[_0x51b7('0x31')][_0x51b7('0x1c')]);}_0x5a5e48[_0x51b7('0x39')]=qs[_0x51b7('0x3a')](_0x5644b6[_0x51b7('0x31')][_0x51b7('0x3a')]);_0x5a5e48[_0x51b7('0x3b')]=qs[_0x51b7('0x33')](_[_0x51b7('0x3c')](_0x5644b6[_0x51b7('0x31')],_0x14adfd[_0x51b7('0x33')]),_0x5c053a);if(_0x5644b6[_0x51b7('0x31')][_0x51b7('0x3d')]){_0x5a5e48[_0x51b7('0x3b')]=_['merge'](_0x5a5e48[_0x51b7('0x3b')],{'$or':_[_0x51b7('0x2b')](_0x5c053a,function(_0x1aa671){if(_0x1aa671[_0x51b7('0x2e')]!==_0x51b7('0x3e')){var _0x4d0dc3={};_0x4d0dc3[_0x1aa671[_0x51b7('0x28')]]={'$like':'%'+_0x5644b6[_0x51b7('0x31')][_0x51b7('0x3d')]+'%'};return _0x4d0dc3;}})});}_0x5a5e48=_[_0x51b7('0x3f')]({},_0x5a5e48,_0x5644b6[_0x51b7('0x40')]);var _0x423cb7={'where':_0x5a5e48[_0x51b7('0x3b')]};return db[_0x51b7('0x2c')]['count'](_0x423cb7)[_0x51b7('0x24')](function(_0x4dfd6e){_0x475879[_0x51b7('0x1f')]=_0x4dfd6e;if(_0x5644b6[_0x51b7('0x31')][_0x51b7('0x41')]){_0x5a5e48[_0x51b7('0x42')]=[{'all':!![]}];}return db['SugarcrmField'][_0x51b7('0x43')](_0x5a5e48);})[_0x51b7('0x24')](function(_0x4b700f){_0x475879[_0x51b7('0x44')]=_0x4b700f;return _0x475879;})[_0x51b7('0x24')](respondWithFilteredResult(_0x339711,_0x5a5e48))[_0x51b7('0x45')](handleError(_0x339711,null));};exports['show']=function(_0x614644,_0x47729e){var _0x47f989={'raw':!![],'where':{'id':_0x614644[_0x51b7('0x46')]['id']}},_0xe28cdd={};_0xe28cdd[_0x51b7('0x30')]=_[_0x51b7('0x32')](db[_0x51b7('0x2c')][_0x51b7('0x2d')]);_0xe28cdd[_0x51b7('0x31')]=_[_0x51b7('0x32')](_0x614644['query']);_0xe28cdd[_0x51b7('0x33')]=_['intersection'](_0xe28cdd[_0x51b7('0x30')],_0xe28cdd['query']);_0x47f989[_0x51b7('0x35')]=_[_0x51b7('0x34')](_0xe28cdd[_0x51b7('0x30')],qs[_0x51b7('0x36')](_0x614644[_0x51b7('0x31')][_0x51b7('0x36')]));_0x47f989[_0x51b7('0x35')]=_0x47f989[_0x51b7('0x35')]['length']?_0x47f989[_0x51b7('0x35')]:_0xe28cdd[_0x51b7('0x30')];if(_0x614644[_0x51b7('0x31')]['includeAll']){_0x47f989[_0x51b7('0x42')]=[{'all':!![]}];}_0x47f989=_[_0x51b7('0x3f')]({},_0x47f989,_0x614644[_0x51b7('0x40')]);return db[_0x51b7('0x2c')][_0x51b7('0x47')](_0x47f989)['then'](handleEntityNotFound(_0x47729e,null))[_0x51b7('0x24')](respondWithResult(_0x47729e,null))[_0x51b7('0x45')](handleError(_0x47729e,null));};exports[_0x51b7('0x48')]=function(_0x340584,_0x1ece29){return db['SugarcrmField'][_0x51b7('0x48')](_0x340584[_0x51b7('0x49')],{})['then'](respondWithResult(_0x1ece29,0xc9))[_0x51b7('0x45')](handleError(_0x1ece29,null));};exports[_0x51b7('0x4a')]=function(_0x5a0127,_0x5c63b5){if(_0x5a0127[_0x51b7('0x49')]['id']){delete _0x5a0127[_0x51b7('0x49')]['id'];}return db[_0x51b7('0x2c')][_0x51b7('0x47')]({'where':{'id':_0x5a0127[_0x51b7('0x46')]['id']}})[_0x51b7('0x24')](handleEntityNotFound(_0x5c63b5,null))[_0x51b7('0x24')](saveUpdates(_0x5a0127['body'],null))[_0x51b7('0x24')](respondWithResult(_0x5c63b5,null))['catch'](handleError(_0x5c63b5,null));};exports[_0x51b7('0x25')]=function(_0x41a07c,_0x285c08){return db[_0x51b7('0x2c')][_0x51b7('0x47')]({'where':{'id':_0x41a07c[_0x51b7('0x46')]['id']}})[_0x51b7('0x24')](handleEntityNotFound(_0x285c08,null))['then'](removeEntity(_0x285c08,null))['catch'](handleError(_0x285c08,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 54bffe3..85d34b9 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 _0x33c0=['int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','api','bluebird','request-promise','path','../../config/environment','exports','define','SugarcrmField'];(function(_0x35d086,_0x385b52){var _0xae0642=function(_0x28f28b){while(--_0x28f28b){_0x35d086['push'](_0x35d086['shift']());}};_0xae0642(++_0x385b52);}(_0x33c0,0x86));var _0x033c=function(_0x9f7d39,_0x4ae560){_0x9f7d39=_0x9f7d39-0x0;var _0x5a2c19=_0x33c0[_0x9f7d39];return _0x5a2c19;};'use strict';var _=require(_0x033c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x033c('0x1'));var moment=require('moment');var BPromise=require(_0x033c('0x2'));var rp=require(_0x033c('0x3'));var fs=require('fs');var path=require(_0x033c('0x4'));var rimraf=require('rimraf');var config=require(_0x033c('0x5'));var attributes=require('./intSugarcrmField.attributes');module[_0x033c('0x6')]=function(_0x15b478,_0x50d338){return _0x15b478[_0x033c('0x7')](_0x033c('0x8'),attributes,{'tableName':_0x033c('0x9'),'paranoid':![],'indexes':[{'name':_0x033c('0xa'),'fields':[_0x033c('0xb'),_0x033c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbfd1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x3e8280,_0x3a8e86){var _0x48738c=function(_0x372d12){while(--_0x372d12){_0x3e8280['push'](_0x3e8280['shift']());}};_0x48738c(++_0x3a8e86);}(_0xbfd1,0xc1));var _0x1bfd=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0xbfd1[_0x1cbcf1];return _0x3a06f0;};'use strict';var _=require('lodash');var util=require(_0x1bfd('0x0'));var logger=require(_0x1bfd('0x1'))(_0x1bfd('0x2'));var moment=require(_0x1bfd('0x3'));var BPromise=require(_0x1bfd('0x4'));var rp=require(_0x1bfd('0x5'));var fs=require('fs');var path=require(_0x1bfd('0x6'));var rimraf=require(_0x1bfd('0x7'));var config=require(_0x1bfd('0x8'));var attributes=require(_0x1bfd('0x9'));module[_0x1bfd('0xa')]=function(_0x46ffa7,_0x8d397b){return _0x46ffa7['define']('SugarcrmField',attributes,{'tableName':_0x1bfd('0xb'),'paranoid':![],'indexes':[{'name':_0x1bfd('0xc'),'fields':[_0x1bfd('0xd'),_0x1bfd('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 7eae76a..40e2611 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 _0x9f06=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','message','SugarcrmField,\x20%s,\x20%s','info','result','lodash','util'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x9f06,0x1e2));var _0x69f0=function(_0x30d5a8,_0x25d8ab){_0x30d5a8=_0x30d5a8-0x0;var _0x3c33d5=_0x9f06[_0x30d5a8];return _0x3c33d5;};'use strict';var _=require(_0x69f0('0x0'));var util=require(_0x69f0('0x1'));var moment=require('moment');var BPromise=require(_0x69f0('0x2'));var rs=require(_0x69f0('0x3'));var fs=require('fs');var Redis=require(_0x69f0('0x4'));var db=require(_0x69f0('0x5'))['db'];var utils=require(_0x69f0('0x6'));var logger=require('../../config/logger')(_0x69f0('0x7'));var config=require(_0x69f0('0x8'));var jayson=require(_0x69f0('0x9'));var client=jayson[_0x69f0('0xa')][_0x69f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ca22f,_0x21ff75,_0x598e8b){return new BPromise(function(_0x4c8922,_0x4eb19f){return client[_0x69f0('0xc')](_0x2ca22f,_0x598e8b)[_0x69f0('0xd')](function(_0x3577e4){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x21ff75,_0x69f0('0xe'));logger[_0x69f0('0xf')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x21ff75,'request\x20sent',JSON['stringify'](_0x3577e4));if(_0x3577e4[_0x69f0('0x10')]){if(_0x3577e4[_0x69f0('0x10')][_0x69f0('0x11')]===0x1f4){logger[_0x69f0('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x21ff75,_0x3577e4['error'][_0x69f0('0x12')]);return _0x4eb19f(_0x3577e4[_0x69f0('0x10')][_0x69f0('0x12')]);}logger['error'](_0x69f0('0x13'),_0x21ff75,_0x3577e4[_0x69f0('0x10')][_0x69f0('0x12')]);return _0x4c8922(_0x3577e4['error'][_0x69f0('0x12')]);}else{logger[_0x69f0('0x14')](_0x69f0('0x13'),_0x21ff75,_0x69f0('0xe'));_0x4c8922(_0x3577e4[_0x69f0('0x15')][_0x69f0('0x12')]);}})['catch'](function(_0x5223e9){logger[_0x69f0('0x10')](_0x69f0('0x13'),_0x21ff75,_0x5223e9);_0x4eb19f(_0x5223e9);});});} \ No newline at end of file +var _0x970c=['client','http','then','info','SugarcrmField,\x20%s,\x20%s','debug','request\x20sent','code','error','message','result','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0xdc4c22,_0x175f9c){var _0x16888f=function(_0x185937){while(--_0x185937){_0xdc4c22['push'](_0xdc4c22['shift']());}};_0x16888f(++_0x175f9c);}(_0x970c,0x1df));var _0xc970=function(_0x59db85,_0x5300d8){_0x59db85=_0x59db85-0x0;var _0x35ff42=_0x970c[_0x59db85];return _0x35ff42;};'use strict';var _=require(_0xc970('0x0'));var util=require('util');var moment=require(_0xc970('0x1'));var BPromise=require(_0xc970('0x2'));var rs=require(_0xc970('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc970('0x4'))(_0xc970('0x5'));var config=require(_0xc970('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc970('0x7')][_0xc970('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x384605,_0x5f3eec,_0x220774){return new BPromise(function(_0x4321ac,_0x4f8d31){return client['request'](_0x384605,_0x220774)[_0xc970('0x9')](function(_0x207947){logger[_0xc970('0xa')](_0xc970('0xb'),_0x5f3eec,'request\x20sent');logger[_0xc970('0xc')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x5f3eec,_0xc970('0xd'),JSON['stringify'](_0x207947));if(_0x207947['error']){if(_0x207947['error'][_0xc970('0xe')]===0x1f4){logger[_0xc970('0xf')](_0xc970('0xb'),_0x5f3eec,_0x207947['error'][_0xc970('0x10')]);return _0x4f8d31(_0x207947[_0xc970('0xf')][_0xc970('0x10')]);}logger[_0xc970('0xf')](_0xc970('0xb'),_0x5f3eec,_0x207947['error']['message']);return _0x4321ac(_0x207947['error'][_0xc970('0x10')]);}else{logger[_0xc970('0xa')](_0xc970('0xb'),_0x5f3eec,_0xc970('0xd'));_0x4321ac(_0x207947[_0xc970('0x11')][_0xc970('0x10')]);}})['catch'](function(_0x226e2c){logger[_0xc970('0xf')](_0xc970('0xb'),_0x5f3eec,_0x226e2c);_0x4f8d31(_0x226e2c);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index fb341dc..9840127 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 _0x5dea=['create','put','update','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','getFields','post'];(function(_0x364439,_0x212e33){var _0x3c09c0=function(_0x184bf3){while(--_0x184bf3){_0x364439['push'](_0x364439['shift']());}};_0x3c09c0(++_0x212e33);}(_0x5dea,0x1bc));var _0xa5de=function(_0x5a3ef6,_0x5508ed){_0x5a3ef6=_0x5a3ef6-0x0;var _0x34da2b=_0x5dea[_0x5a3ef6];return _0x34da2b;};'use strict';var multer=require(_0xa5de('0x0'));var util=require(_0xa5de('0x1'));var path=require(_0xa5de('0x2'));var timeout=require(_0xa5de('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa5de('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa5de('0x5'));var config=require(_0xa5de('0x6'));var controller=require(_0xa5de('0x7'));router[_0xa5de('0x8')]('/',auth['isAuthenticated'](),controller[_0xa5de('0x9')]);router['get'](_0xa5de('0xa'),auth[_0xa5de('0xb')](),controller['show']);router[_0xa5de('0x8')](_0xa5de('0xc'),auth[_0xa5de('0xb')](),controller[_0xa5de('0xd')]);router[_0xa5de('0x8')]('/:id/fields',auth[_0xa5de('0xb')](),controller[_0xa5de('0xe')]);router[_0xa5de('0xf')]('/',auth[_0xa5de('0xb')](),controller[_0xa5de('0x10')]);router['post'](_0xa5de('0xc'),auth[_0xa5de('0xb')](),controller['addConfiguration']);router[_0xa5de('0x11')](_0xa5de('0xa'),auth[_0xa5de('0xb')](),controller[_0xa5de('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa5de('0x13')]=router; \ No newline at end of file +var _0x26bc=['getConfigurations','/:id/fields','getFields','create','post','addConfiguration','/:id','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','isAuthenticated','index','get','show','/:id/configurations'];(function(_0x5dbb3e,_0x4b494d){var _0x138d23=function(_0x414fb4){while(--_0x414fb4){_0x5dbb3e['push'](_0x5dbb3e['shift']());}};_0x138d23(++_0x4b494d);}(_0x26bc,0x162));var _0xc26b=function(_0x56ccc1,_0x10ec1b){_0x56ccc1=_0x56ccc1-0x0;var _0x1863bd=_0x26bc[_0x56ccc1];return _0x1863bd;};'use strict';var multer=require(_0xc26b('0x0'));var util=require(_0xc26b('0x1'));var path=require(_0xc26b('0x2'));var timeout=require(_0xc26b('0x3'));var express=require(_0xc26b('0x4'));var router=express['Router']();var fs_extra=require(_0xc26b('0x5'));var auth=require(_0xc26b('0x6'));var interaction=require(_0xc26b('0x7'));var config=require('../../config/environment');var controller=require(_0xc26b('0x8'));router['get']('/',auth[_0xc26b('0x9')](),controller[_0xc26b('0xa')]);router[_0xc26b('0xb')]('/:id',auth[_0xc26b('0x9')](),controller[_0xc26b('0xc')]);router[_0xc26b('0xb')](_0xc26b('0xd'),auth[_0xc26b('0x9')](),controller[_0xc26b('0xe')]);router[_0xc26b('0xb')](_0xc26b('0xf'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x10')]);router['post']('/',auth[_0xc26b('0x9')](),controller[_0xc26b('0x11')]);router[_0xc26b('0x12')](_0xc26b('0xd'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x13')]);router['put'](_0xc26b('0x14'),auth['isAuthenticated'](),controller['update']);router[_0xc26b('0x15')](_0xc26b('0x14'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index f5290f8..84fcc15 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 _0x27aa=['HelpDesk','sequelize','STRING'];(function(_0x4d934b,_0x52f8e9){var _0xc0338b=function(_0x1a356c){while(--_0x1a356c){_0x4d934b['push'](_0x4d934b['shift']());}};_0xc0338b(++_0x52f8e9);}(_0x27aa,0x109));var _0xa27a=function(_0x167b84,_0x3233e2){_0x167b84=_0x167b84-0x0;var _0x30d147=_0x27aa[_0x167b84];return _0x30d147;};'use strict';var Sequelize=require(_0xa27a('0x0'));module['exports']={'name':{'type':Sequelize[_0xa27a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa27a('0x1')]},'username':{'type':Sequelize[_0xa27a('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xa27a('0x1')],'allowNull':![],'defaultValue':_0xa27a('0x2')},'remoteUri':{'type':Sequelize[_0xa27a('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xa27a('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xa27a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xeee8=['HelpDesk','exports','STRING'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0xeee8,0x1bd));var _0x8eee=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeee8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x8eee('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eee('0x1')]},'username':{'type':Sequelize[_0x8eee('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8eee('0x1')],'allowNull':![],'defaultValue':_0x8eee('0x2')},'remoteUri':{'type':Sequelize[_0x8eee('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8eee('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8eee('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 6b0ceb5..3fca9b6 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 _0x6444=['rows','show','intersection','includeAll','merge','catch','create','body','find','params','getConfigurations','VtigerConfiguration','rawAttributes','order','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','%s/webservice.php','getchallenge','success','POST','login','result','token','GET','sessionName','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','undefined','limit','count','offset','status','Content-Range','json','reject','save','update','destroy','then','end','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','options','VtigerAccount','include','findAll'];(function(_0x1dcdca,_0x3544cf){var _0x27ec22=function(_0x4089e6){while(--_0x4089e6){_0x1dcdca['push'](_0x1dcdca['shift']());}};_0x27ec22(++_0x3544cf);}(_0x6444,0x1af));var _0x4644=function(_0x52ec0e,_0x10a03c){_0x52ec0e=_0x52ec0e-0x0;var _0x2d649c=_0x6444[_0x52ec0e];return _0x2d649c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4644('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4644('0x1'));var rp=require(_0x4644('0x2'));var moment=require('moment');var BPromise=require(_0x4644('0x3'));var Mustache=require(_0x4644('0x4'));var util=require(_0x4644('0x5'));var path=require('path');var sox=require(_0x4644('0x6'));var csv=require(_0x4644('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4644('0x8'));var _=require(_0x4644('0x9'));var squel=require(_0x4644('0xa'));var crypto=require(_0x4644('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4644('0xc'));var toCsv=require(_0x4644('0x7'));var querystring=require(_0x4644('0xd'));var Papa=require(_0x4644('0xe'));var Redis=require(_0x4644('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4644('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4644('0x11'));var logger=require(_0x4644('0x12'))(_0x4644('0x13'));var utils=require(_0x4644('0x14'));var config=require(_0x4644('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4644('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x35d351,_0x2b0716){_0x2b0716=_0x2b0716||0xcc;return function(_0x65a0fe){if(_0x65a0fe){return _0x35d351[_0x4644('0x17')](_0x2b0716);}return _0x35d351['status'](_0x2b0716)['end']();};}function respondWithResult(_0x28e82b,_0x591dda){_0x591dda=_0x591dda||0xc8;return function(_0x266d1f){if(_0x266d1f){return _0x28e82b['status'](_0x591dda)['json'](_0x266d1f);}};}function respondWithFilteredResult(_0x52933b,_0x28fa03){return function(_0x5339f9){if(_0x5339f9){var _0x3b4688=typeof _0x28fa03['offset']===_0x4644('0x18')&&typeof _0x28fa03[_0x4644('0x19')]===_0x4644('0x18');var _0x243efc=_0x5339f9[_0x4644('0x1a')];var _0x1f0b18=_0x3b4688?0x0:_0x28fa03[_0x4644('0x1b')];var _0x34318b=_0x3b4688?_0x5339f9[_0x4644('0x1a')]:_0x28fa03[_0x4644('0x1b')]+_0x28fa03[_0x4644('0x19')];var _0x510cda;if(_0x34318b>=_0x243efc){_0x34318b=_0x243efc;_0x510cda=0xc8;}else{_0x510cda=0xce;}_0x52933b[_0x4644('0x1c')](_0x510cda);return _0x52933b['set'](_0x4644('0x1d'),_0x1f0b18+'-'+_0x34318b+'/'+_0x243efc)[_0x4644('0x1e')](_0x5339f9);}return null;};}function patchUpdates(_0x28ab10){return function(_0x1915c4){try{jsonpatch['apply'](_0x1915c4,_0x28ab10,!![]);}catch(_0x389ea9){return BPromise[_0x4644('0x1f')](_0x389ea9);}return _0x1915c4[_0x4644('0x20')]();};}function saveUpdates(_0x44b82b,_0x376856){return function(_0x369f93){if(_0x369f93){return _0x369f93[_0x4644('0x21')](_0x44b82b)['then'](function(_0x560b81){return _0x560b81;});}return null;};}function removeEntity(_0x41d574,_0x36a253){return function(_0x422b5a){if(_0x422b5a){return _0x422b5a[_0x4644('0x22')]()[_0x4644('0x23')](function(){_0x41d574[_0x4644('0x1c')](0xcc)[_0x4644('0x24')]();});}};}function handleEntityNotFound(_0x15cae7,_0x489abe){return function(_0x26940f){if(!_0x26940f){_0x15cae7[_0x4644('0x17')](0x194);}return _0x26940f;};}function handleError(_0x44a0fe,_0x5ab938){_0x5ab938=_0x5ab938||0x1f4;return function(_0x4fd7c3){logger['error'](_0x4fd7c3[_0x4644('0x25')]);if(_0x4fd7c3[_0x4644('0x26')]){delete _0x4fd7c3['name'];}_0x44a0fe[_0x4644('0x1c')](_0x5ab938)[_0x4644('0x27')](_0x4fd7c3);};}exports[_0x4644('0x28')]=function(_0x297dfc,_0x2fd086){var _0x221dc2={},_0x1558cb={},_0x33eb52={'count':0x0,'rows':[]};var _0x23fc1a=_[_0x4644('0x29')](db['VtigerAccount']['rawAttributes'],function(_0x1a10fa){return{'name':_0x1a10fa[_0x4644('0x2a')],'type':_0x1a10fa[_0x4644('0x2b')][_0x4644('0x2c')]};});_0x1558cb[_0x4644('0x2d')]=_[_0x4644('0x29')](_0x23fc1a,_0x4644('0x26'));_0x1558cb[_0x4644('0x2e')]=_[_0x4644('0x2f')](_0x297dfc[_0x4644('0x2e')]);_0x1558cb[_0x4644('0x30')]=_['intersection'](_0x1558cb[_0x4644('0x2d')],_0x1558cb[_0x4644('0x2e')]);_0x221dc2['attributes']=_['intersection'](_0x1558cb[_0x4644('0x2d')],qs['fields'](_0x297dfc[_0x4644('0x2e')][_0x4644('0x31')]));_0x221dc2[_0x4644('0x32')]=_0x221dc2[_0x4644('0x32')][_0x4644('0x33')]?_0x221dc2[_0x4644('0x32')]:_0x1558cb[_0x4644('0x2d')];if(!_0x297dfc[_0x4644('0x2e')][_0x4644('0x34')]('nolimit')){_0x221dc2[_0x4644('0x19')]=qs[_0x4644('0x19')](_0x297dfc[_0x4644('0x2e')][_0x4644('0x19')]);_0x221dc2[_0x4644('0x1b')]=qs[_0x4644('0x1b')](_0x297dfc[_0x4644('0x2e')][_0x4644('0x1b')]);}_0x221dc2['order']=qs['sort'](_0x297dfc[_0x4644('0x2e')][_0x4644('0x35')]);_0x221dc2['where']=qs[_0x4644('0x30')](_[_0x4644('0x36')](_0x297dfc['query'],_0x1558cb['filters']),_0x23fc1a);if(_0x297dfc['query'][_0x4644('0x37')]){_0x221dc2[_0x4644('0x38')]=_['merge'](_0x221dc2[_0x4644('0x38')],{'$or':_[_0x4644('0x29')](_0x23fc1a,function(_0x291db8){if(_0x291db8['type']!=='VIRTUAL'){var _0x22a35a={};_0x22a35a[_0x291db8[_0x4644('0x26')]]={'$like':'%'+_0x297dfc[_0x4644('0x2e')][_0x4644('0x37')]+'%'};return _0x22a35a;}})});}_0x221dc2=_['merge']({},_0x221dc2,_0x297dfc[_0x4644('0x39')]);var _0x120ff5={'where':_0x221dc2['where']};return db[_0x4644('0x3a')][_0x4644('0x1a')](_0x120ff5)[_0x4644('0x23')](function(_0xfa6aa1){_0x33eb52[_0x4644('0x1a')]=_0xfa6aa1;if(_0x297dfc[_0x4644('0x2e')]['includeAll']){_0x221dc2[_0x4644('0x3b')]=[{'all':!![]}];}return db[_0x4644('0x3a')][_0x4644('0x3c')](_0x221dc2);})[_0x4644('0x23')](function(_0x178482){_0x33eb52[_0x4644('0x3d')]=_0x178482;return _0x33eb52;})[_0x4644('0x23')](respondWithFilteredResult(_0x2fd086,_0x221dc2))['catch'](handleError(_0x2fd086,null));};exports[_0x4644('0x3e')]=function(_0x45c2b3,_0xe7f70d){var _0x2e3470={'raw':![],'where':{'id':_0x45c2b3['params']['id']}},_0x3dfab5={};_0x3dfab5[_0x4644('0x2d')]=_[_0x4644('0x2f')](db[_0x4644('0x3a')]['rawAttributes']);_0x3dfab5[_0x4644('0x2e')]=_[_0x4644('0x2f')](_0x45c2b3[_0x4644('0x2e')]);_0x3dfab5['filters']=_[_0x4644('0x3f')](_0x3dfab5[_0x4644('0x2d')],_0x3dfab5[_0x4644('0x2e')]);_0x2e3470[_0x4644('0x32')]=_[_0x4644('0x3f')](_0x3dfab5[_0x4644('0x2d')],qs[_0x4644('0x31')](_0x45c2b3[_0x4644('0x2e')][_0x4644('0x31')]));_0x2e3470[_0x4644('0x32')]=_0x2e3470[_0x4644('0x32')]['length']?_0x2e3470['attributes']:_0x3dfab5[_0x4644('0x2d')];if(_0x45c2b3[_0x4644('0x2e')][_0x4644('0x40')]){_0x2e3470['include']=[{'all':!![]}];}_0x2e3470=_[_0x4644('0x41')]({},_0x2e3470,_0x45c2b3['options']);return db[_0x4644('0x3a')]['find'](_0x2e3470)[_0x4644('0x23')](handleEntityNotFound(_0xe7f70d,null))[_0x4644('0x23')](respondWithResult(_0xe7f70d,null))[_0x4644('0x42')](handleError(_0xe7f70d,null));};exports['create']=function(_0x5b21a6,_0x37fd7b){return db['VtigerAccount'][_0x4644('0x43')](_0x5b21a6[_0x4644('0x44')],{})[_0x4644('0x23')](respondWithResult(_0x37fd7b,0xc9))[_0x4644('0x42')](handleError(_0x37fd7b,null));};exports[_0x4644('0x21')]=function(_0x222c65,_0x2d7ddb){if(_0x222c65[_0x4644('0x44')]['id']){delete _0x222c65[_0x4644('0x44')]['id'];}return db['VtigerAccount'][_0x4644('0x45')]({'where':{'id':_0x222c65[_0x4644('0x46')]['id']}})[_0x4644('0x23')](handleEntityNotFound(_0x2d7ddb,null))['then'](saveUpdates(_0x222c65[_0x4644('0x44')],null))[_0x4644('0x23')](respondWithResult(_0x2d7ddb,null))['catch'](handleError(_0x2d7ddb,null));};exports[_0x4644('0x22')]=function(_0x449a18,_0x5680cd){return db['VtigerAccount'][_0x4644('0x45')]({'where':{'id':_0x449a18[_0x4644('0x46')]['id']}})[_0x4644('0x23')](handleEntityNotFound(_0x5680cd,null))['then'](removeEntity(_0x5680cd,null))[_0x4644('0x42')](handleError(_0x5680cd,null));};exports[_0x4644('0x47')]=function(_0x16b911,_0x2da394,_0x4ad28c){var _0x371149={};var _0x32220b={};var _0xaec0b7;var _0x3efccf;return db['VtigerAccount']['findOne']({'where':{'id':_0x16b911['params']['id']}})['then'](handleEntityNotFound(_0x2da394,null))[_0x4644('0x23')](function(_0x103a5c){if(_0x103a5c){_0xaec0b7=_0x103a5c;_0x32220b[_0x4644('0x2d')]=_[_0x4644('0x2f')](db[_0x4644('0x48')][_0x4644('0x49')]);_0x32220b[_0x4644('0x2e')]=_[_0x4644('0x2f')](_0x16b911['query']);_0x32220b[_0x4644('0x30')]=_[_0x4644('0x3f')](_0x32220b[_0x4644('0x2d')],_0x32220b['query']);_0x371149[_0x4644('0x32')]=_[_0x4644('0x3f')](_0x32220b[_0x4644('0x2d')],qs[_0x4644('0x31')](_0x16b911[_0x4644('0x2e')]['fields']));_0x371149[_0x4644('0x32')]=_0x371149['attributes'][_0x4644('0x33')]?_0x371149['attributes']:_0x32220b[_0x4644('0x2d')];_0x371149[_0x4644('0x4a')]=qs['sort'](_0x16b911[_0x4644('0x2e')][_0x4644('0x35')]);_0x371149['where']=qs[_0x4644('0x30')](_['pick'](_0x16b911['query'],_0x32220b[_0x4644('0x30')]));if(_0x16b911['query'][_0x4644('0x37')]){_0x371149[_0x4644('0x38')]=_[_0x4644('0x41')](_0x371149[_0x4644('0x38')],{'$or':_['map'](_0x371149[_0x4644('0x32')],function(_0x7eb656){var _0x4fff7c={};_0x4fff7c[_0x7eb656]={'$like':'%'+_0x16b911[_0x4644('0x2e')]['filter']+'%'};return _0x4fff7c;})});}_0x371149=_['merge']({},_0x371149,_0x16b911[_0x4644('0x39')]);return _0xaec0b7[_0x4644('0x47')](_0x371149);}})['then'](function(_0x42a590){if(_0x42a590){_0x3efccf=_0x42a590['length'];if(!_0x16b911[_0x4644('0x2e')][_0x4644('0x34')](_0x4644('0x4b'))){_0x371149[_0x4644('0x19')]=qs[_0x4644('0x19')](_0x16b911[_0x4644('0x2e')]['limit']);_0x371149[_0x4644('0x1b')]=qs[_0x4644('0x1b')](_0x16b911[_0x4644('0x2e')][_0x4644('0x1b')]);}return _0xaec0b7[_0x4644('0x47')](_0x371149);}})[_0x4644('0x23')](function(_0x218453){if(_0x218453){return _0x218453?{'count':_0x3efccf,'rows':_0x218453}:null;}})[_0x4644('0x23')](respondWithResult(_0x2da394,null))[_0x4644('0x42')](handleError(_0x2da394,null));};exports[_0x4644('0x4c')]=function(_0x53387f,_0x5b1656,_0x349b88){if(_0x53387f[_0x4644('0x44')]['id']){delete _0x53387f['body']['id'];}return db[_0x4644('0x3a')][_0x4644('0x4d')]({'where':{'id':_0x53387f[_0x4644('0x46')]['id']}})['then'](handleEntityNotFound(_0x5b1656,null))[_0x4644('0x23')](function(_0x598c57){if(_0x598c57){_0x53387f['body'][_0x4644('0x4e')]=_0x598c57['id'];_0x53387f[_0x4644('0x44')][_0x4644('0x4f')]=integrations[_0x4644('0x50')](_0x53387f[_0x4644('0x44')][_0x4644('0x51')],_0x53387f['body']['type']);_0x53387f[_0x4644('0x44')]['Descriptions']=integrations[_0x4644('0x52')](_0x53387f[_0x4644('0x44')][_0x4644('0x51')],_0x53387f['body'][_0x4644('0x2b')]);return db[_0x4644('0x48')][_0x4644('0x43')](_0x53387f[_0x4644('0x44')],{'include':[{'model':db['VtigerField'],'as':_0x4644('0x4f')},{'model':db[_0x4644('0x53')],'as':_0x4644('0x54')}]});}return null;})['then'](respondWithResult(_0x5b1656,null))[_0x4644('0x42')](handleError(_0x5b1656,null));};var md5=require('md5');exports['getFields']=function(_0x860cbf,_0x32c71b,_0x4184b3){var _0x1a4b15=null;var _0x609ad2=null;var _0x2084fa=null;var _0x535550=null;var _0x506f97='';return db[_0x4644('0x3a')]['findOne']({'where':{'id':_0x860cbf[_0x4644('0x46')]['id']},'attributes':['id',_0x4644('0x26'),_0x4644('0x55'),_0x4644('0x56'),_0x4644('0x57'),_0x4644('0x58'),_0x4644('0x59'),_0x4644('0x5a')]})['then'](handleEntityNotFound(_0x32c71b,null))[_0x4644('0x23')](function(_0x2f33fd){if(_0x2f33fd){_0x1a4b15=_0x2f33fd[_0x4644('0x55')];_0x609ad2=_0x2f33fd['accessKey'];_0x2084fa=_0x2f33fd['moduleName'];_0x506f97=_0x2f33fd[_0x4644('0x58')];var _0x3da835=_0x506f97[_0x4644('0x5b')](-0x1);if(_0x3da835==='/'){_0x506f97=_0x506f97[_0x4644('0x5c')](0x0,_0x506f97['lastIndexOf'](_0x3da835));}_0x535550=util[_0x4644('0x5d')](_0x4644('0x5e'),_0x506f97);var _0x39fb36={'method':'GET','uri':_0x535550,'qs':{'operation':_0x4644('0x5f'),'username':_0x2f33fd[_0x4644('0x55')]},'json':!![]};return rp(_0x39fb36);}})[_0x4644('0x23')](function(_0x4ff5d9){if(_0x4ff5d9[_0x4644('0x60')]){var _0x3dde9a={'method':_0x4644('0x61'),'uri':_0x535550,'form':{'operation':_0x4644('0x62'),'username':_0x1a4b15,'accessKey':md5(_0x4ff5d9[_0x4644('0x63')][_0x4644('0x64')]+_0x609ad2)},'json':!![]};return rp(_0x3dde9a);}})[_0x4644('0x23')](function(_0x212da7){if(_0x212da7['success']){var _0xed1c6={'method':_0x4644('0x65'),'uri':_0x535550,'qs':{'operation':'describe','username':_0x1a4b15,'sessionName':_0x212da7['result'][_0x4644('0x66')],'elementType':_0x2084fa},'json':!![]};return rp(_0xed1c6);}})[_0x4644('0x23')](function(_0x1a2edd){if(_0x1a2edd['success']){var _0x5d2d2d=['autogenerated',_0x4644('0x67'),_0x4644('0x68')];_[_0x4644('0x69')](_0x1a2edd[_0x4644('0x63')][_0x4644('0x31')],function(_0x554d56){return _0x5d2d2d[_0x4644('0x6a')](_0x554d56[_0x4644('0x2b')][_0x4644('0x26')]);});_[_0x4644('0x69')](_0x1a2edd['result']['fields'],function(_0x28b833){return _0x28b833[_0x4644('0x6b')]===_0x4644('0x6c');});return{'count':_0x1a2edd[_0x4644('0x63')][_0x4644('0x31')][_0x4644('0x33')],'rows':_[_0x4644('0x29')](_0x1a2edd[_0x4644('0x63')]['fields'],function(_0x3458b6){return{'id':_0x3458b6[_0x4644('0x26')],'name':_0x3458b6[_0x4644('0x6d')],'custom':_[_0x4644('0x6e')](_0x3458b6[_0x4644('0x26')],_0x4644('0x6f'))?!![]:![],'options':_0x3458b6['type']['name']===_0x4644('0x70')&&_0x3458b6[_0x4644('0x2b')][_0x4644('0x71')][_0x4644('0x33')]>0x0?_['map'](_0x3458b6[_0x4644('0x2b')][_0x4644('0x71')],function(_0x4f1aa4){return{'name':_0x4f1aa4[_0x4644('0x6d')],'value':_0x4f1aa4[_0x4644('0x72')]};}):[]};})};}})['then'](respondWithResult(_0x32c71b,null))[_0x4644('0x42')](function(_0x7180c1){console[_0x4644('0x73')](_0x4644('0x74')+_0x7180c1);var _0x10d9fe=_0x860cbf[_0x4644('0x2e')][_0x4644('0x75')]?0x1f4:_0x7180c1[_0x4644('0x76')]||0x1f4;logger[_0x4644('0x77')](_0x4644('0x78'),_0x4644('0x79'),_0x10d9fe,JSON['stringify'](_0x7180c1));delete _0x7180c1[_0x4644('0x26')];if(_0x10d9fe===0x191){_0x10d9fe=0x190;}_0x32c71b[_0x4644('0x1c')](_0x10d9fe)[_0x4644('0x27')](_0x860cbf['query']['test']?{'message':_0x4644('0x7a'),'statusCode':_0x7180c1['statusCode']}:_0x7180c1);});}; \ No newline at end of file +var _0xadd5=['include','findAll','rows','catch','show','params','keys','options','find','create','body','destroy','getConfigurations','findOne','VtigerConfiguration','order','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','%s/webservice.php','GET','POST','login','result','success','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','cf_','picklistValues','value','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','save','update','then','error','stack','name','index','VtigerAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll'];(function(_0x56c24a,_0x1af9af){var _0x3e5e46=function(_0xb1a2a1){while(--_0xb1a2a1){_0x56c24a['push'](_0x56c24a['shift']());}};_0x3e5e46(++_0x1af9af);}(_0xadd5,0x19f));var _0x5add=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xadd5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5add('0x0'));var rimraf=require(_0x5add('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5add('0x2'));var rp=require(_0x5add('0x3'));var moment=require(_0x5add('0x4'));var BPromise=require(_0x5add('0x5'));var Mustache=require('mustache');var util=require(_0x5add('0x6'));var path=require(_0x5add('0x7'));var sox=require(_0x5add('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5add('0x9'));var _=require(_0x5add('0xa'));var squel=require('squel');var crypto=require(_0x5add('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5add('0xc'));var toCsv=require(_0x5add('0xd'));var querystring=require(_0x5add('0xe'));var Papa=require(_0x5add('0xf'));var Redis=require(_0x5add('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5add('0x11'));var as=require(_0x5add('0x12'));var hardwareService=require(_0x5add('0x13'));var logger=require(_0x5add('0x14'))('api');var utils=require(_0x5add('0x15'));var config=require(_0x5add('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5add('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5ce518,_0x3743f1){_0x3743f1=_0x3743f1||0xcc;return function(_0x2fcc93){if(_0x2fcc93){return _0x5ce518[_0x5add('0x18')](_0x3743f1);}return _0x5ce518[_0x5add('0x19')](_0x3743f1)[_0x5add('0x1a')]();};}function respondWithResult(_0x1e8e8c,_0x511af5){_0x511af5=_0x511af5||0xc8;return function(_0x451c53){if(_0x451c53){return _0x1e8e8c['status'](_0x511af5)[_0x5add('0x1b')](_0x451c53);}};}function respondWithFilteredResult(_0x5138ef,_0x30dc5c){return function(_0x4fdaf4){if(_0x4fdaf4){var _0x918ba3=typeof _0x30dc5c[_0x5add('0x1c')]==='undefined'&&typeof _0x30dc5c[_0x5add('0x1d')]===_0x5add('0x1e');var _0x4b4ae2=_0x4fdaf4[_0x5add('0x1f')];var _0x382464=_0x918ba3?0x0:_0x30dc5c[_0x5add('0x1c')];var _0x1d899d=_0x918ba3?_0x4fdaf4[_0x5add('0x1f')]:_0x30dc5c[_0x5add('0x1c')]+_0x30dc5c['limit'];var _0x374e83;if(_0x1d899d>=_0x4b4ae2){_0x1d899d=_0x4b4ae2;_0x374e83=0xc8;}else{_0x374e83=0xce;}_0x5138ef[_0x5add('0x19')](_0x374e83);return _0x5138ef[_0x5add('0x20')]('Content-Range',_0x382464+'-'+_0x1d899d+'/'+_0x4b4ae2)['json'](_0x4fdaf4);}return null;};}function patchUpdates(_0x1ff492){return function(_0x1d9674){try{jsonpatch['apply'](_0x1d9674,_0x1ff492,!![]);}catch(_0x1ba64f){return BPromise['reject'](_0x1ba64f);}return _0x1d9674[_0x5add('0x21')]();};}function saveUpdates(_0x30278e,_0x3643ec){return function(_0x4e7b2f){if(_0x4e7b2f){return _0x4e7b2f[_0x5add('0x22')](_0x30278e)[_0x5add('0x23')](function(_0x29d86a){return _0x29d86a;});}return null;};}function removeEntity(_0x1ec232,_0x5c23db){return function(_0x4cac53){if(_0x4cac53){return _0x4cac53['destroy']()[_0x5add('0x23')](function(){_0x1ec232[_0x5add('0x19')](0xcc)[_0x5add('0x1a')]();});}};}function handleEntityNotFound(_0xf24402,_0x3add87){return function(_0x245fe8){if(!_0x245fe8){_0xf24402[_0x5add('0x18')](0x194);}return _0x245fe8;};}function handleError(_0x4f8c8f,_0x5d04eb){_0x5d04eb=_0x5d04eb||0x1f4;return function(_0x4a1320){logger[_0x5add('0x24')](_0x4a1320[_0x5add('0x25')]);if(_0x4a1320[_0x5add('0x26')]){delete _0x4a1320[_0x5add('0x26')];}_0x4f8c8f[_0x5add('0x19')](_0x5d04eb)['send'](_0x4a1320);};}exports[_0x5add('0x27')]=function(_0x1c54ea,_0x48490b){var _0x2c1651={},_0x54259d={},_0x1aa3ff={'count':0x0,'rows':[]};var _0x30c3d4=_['map'](db[_0x5add('0x28')][_0x5add('0x29')],function(_0x109e85){return{'name':_0x109e85[_0x5add('0x2a')],'type':_0x109e85[_0x5add('0x2b')][_0x5add('0x2c')]};});_0x54259d[_0x5add('0x2d')]=_[_0x5add('0x2e')](_0x30c3d4,'name');_0x54259d[_0x5add('0x2f')]=_['keys'](_0x1c54ea['query']);_0x54259d[_0x5add('0x30')]=_[_0x5add('0x31')](_0x54259d[_0x5add('0x2d')],_0x54259d['query']);_0x2c1651[_0x5add('0x32')]=_[_0x5add('0x31')](_0x54259d[_0x5add('0x2d')],qs[_0x5add('0x33')](_0x1c54ea[_0x5add('0x2f')][_0x5add('0x33')]));_0x2c1651[_0x5add('0x32')]=_0x2c1651[_0x5add('0x32')][_0x5add('0x34')]?_0x2c1651[_0x5add('0x32')]:_0x54259d[_0x5add('0x2d')];if(!_0x1c54ea[_0x5add('0x2f')][_0x5add('0x35')](_0x5add('0x36'))){_0x2c1651[_0x5add('0x1d')]=qs[_0x5add('0x1d')](_0x1c54ea[_0x5add('0x2f')]['limit']);_0x2c1651[_0x5add('0x1c')]=qs['offset'](_0x1c54ea['query']['offset']);}_0x2c1651['order']=qs['sort'](_0x1c54ea[_0x5add('0x2f')][_0x5add('0x37')]);_0x2c1651[_0x5add('0x38')]=qs[_0x5add('0x30')](_['pick'](_0x1c54ea[_0x5add('0x2f')],_0x54259d[_0x5add('0x30')]),_0x30c3d4);if(_0x1c54ea[_0x5add('0x2f')][_0x5add('0x39')]){_0x2c1651[_0x5add('0x38')]=_['merge'](_0x2c1651[_0x5add('0x38')],{'$or':_['map'](_0x30c3d4,function(_0x37869e){if(_0x37869e[_0x5add('0x2b')]!==_0x5add('0x3a')){var _0x2d446a={};_0x2d446a[_0x37869e['name']]={'$like':'%'+_0x1c54ea[_0x5add('0x2f')]['filter']+'%'};return _0x2d446a;}})});}_0x2c1651=_[_0x5add('0x3b')]({},_0x2c1651,_0x1c54ea['options']);var _0x433f6d={'where':_0x2c1651[_0x5add('0x38')]};return db[_0x5add('0x28')][_0x5add('0x1f')](_0x433f6d)[_0x5add('0x23')](function(_0x20d3c2){_0x1aa3ff[_0x5add('0x1f')]=_0x20d3c2;if(_0x1c54ea[_0x5add('0x2f')][_0x5add('0x3c')]){_0x2c1651[_0x5add('0x3d')]=[{'all':!![]}];}return db[_0x5add('0x28')][_0x5add('0x3e')](_0x2c1651);})[_0x5add('0x23')](function(_0x290231){_0x1aa3ff[_0x5add('0x3f')]=_0x290231;return _0x1aa3ff;})[_0x5add('0x23')](respondWithFilteredResult(_0x48490b,_0x2c1651))[_0x5add('0x40')](handleError(_0x48490b,null));};exports[_0x5add('0x41')]=function(_0x167baf,_0x296f88){var _0x31456f={'raw':![],'where':{'id':_0x167baf[_0x5add('0x42')]['id']}},_0x57b0e3={};_0x57b0e3[_0x5add('0x2d')]=_[_0x5add('0x43')](db[_0x5add('0x28')][_0x5add('0x29')]);_0x57b0e3[_0x5add('0x2f')]=_[_0x5add('0x43')](_0x167baf[_0x5add('0x2f')]);_0x57b0e3[_0x5add('0x30')]=_[_0x5add('0x31')](_0x57b0e3[_0x5add('0x2d')],_0x57b0e3[_0x5add('0x2f')]);_0x31456f[_0x5add('0x32')]=_['intersection'](_0x57b0e3[_0x5add('0x2d')],qs['fields'](_0x167baf[_0x5add('0x2f')]['fields']));_0x31456f['attributes']=_0x31456f[_0x5add('0x32')][_0x5add('0x34')]?_0x31456f[_0x5add('0x32')]:_0x57b0e3[_0x5add('0x2d')];if(_0x167baf[_0x5add('0x2f')][_0x5add('0x3c')]){_0x31456f[_0x5add('0x3d')]=[{'all':!![]}];}_0x31456f=_[_0x5add('0x3b')]({},_0x31456f,_0x167baf[_0x5add('0x44')]);return db[_0x5add('0x28')][_0x5add('0x45')](_0x31456f)[_0x5add('0x23')](handleEntityNotFound(_0x296f88,null))[_0x5add('0x23')](respondWithResult(_0x296f88,null))[_0x5add('0x40')](handleError(_0x296f88,null));};exports[_0x5add('0x46')]=function(_0x5b418b,_0x3a95f6){return db[_0x5add('0x28')]['create'](_0x5b418b[_0x5add('0x47')],{})['then'](respondWithResult(_0x3a95f6,0xc9))[_0x5add('0x40')](handleError(_0x3a95f6,null));};exports['update']=function(_0x5ed0cb,_0x2cb69c){if(_0x5ed0cb[_0x5add('0x47')]['id']){delete _0x5ed0cb[_0x5add('0x47')]['id'];}return db[_0x5add('0x28')][_0x5add('0x45')]({'where':{'id':_0x5ed0cb[_0x5add('0x42')]['id']}})['then'](handleEntityNotFound(_0x2cb69c,null))['then'](saveUpdates(_0x5ed0cb[_0x5add('0x47')],null))['then'](respondWithResult(_0x2cb69c,null))[_0x5add('0x40')](handleError(_0x2cb69c,null));};exports[_0x5add('0x48')]=function(_0x5d8abb,_0x53c6b5){return db[_0x5add('0x28')][_0x5add('0x45')]({'where':{'id':_0x5d8abb[_0x5add('0x42')]['id']}})[_0x5add('0x23')](handleEntityNotFound(_0x53c6b5,null))[_0x5add('0x23')](removeEntity(_0x53c6b5,null))['catch'](handleError(_0x53c6b5,null));};exports[_0x5add('0x49')]=function(_0x294899,_0x2f168e,_0x4ddc48){var _0x5e415e={};var _0x50f441={};var _0x191cd6;var _0x45055c;return db[_0x5add('0x28')][_0x5add('0x4a')]({'where':{'id':_0x294899[_0x5add('0x42')]['id']}})[_0x5add('0x23')](handleEntityNotFound(_0x2f168e,null))['then'](function(_0x1195b3){if(_0x1195b3){_0x191cd6=_0x1195b3;_0x50f441[_0x5add('0x2d')]=_[_0x5add('0x43')](db[_0x5add('0x4b')][_0x5add('0x29')]);_0x50f441[_0x5add('0x2f')]=_['keys'](_0x294899[_0x5add('0x2f')]);_0x50f441[_0x5add('0x30')]=_[_0x5add('0x31')](_0x50f441[_0x5add('0x2d')],_0x50f441['query']);_0x5e415e[_0x5add('0x32')]=_[_0x5add('0x31')](_0x50f441[_0x5add('0x2d')],qs[_0x5add('0x33')](_0x294899['query'][_0x5add('0x33')]));_0x5e415e[_0x5add('0x32')]=_0x5e415e[_0x5add('0x32')]['length']?_0x5e415e[_0x5add('0x32')]:_0x50f441[_0x5add('0x2d')];_0x5e415e[_0x5add('0x4c')]=qs[_0x5add('0x37')](_0x294899['query'][_0x5add('0x37')]);_0x5e415e[_0x5add('0x38')]=qs[_0x5add('0x30')](_[_0x5add('0x4d')](_0x294899[_0x5add('0x2f')],_0x50f441['filters']));if(_0x294899[_0x5add('0x2f')][_0x5add('0x39')]){_0x5e415e[_0x5add('0x38')]=_[_0x5add('0x3b')](_0x5e415e[_0x5add('0x38')],{'$or':_[_0x5add('0x2e')](_0x5e415e[_0x5add('0x32')],function(_0x1a9103){var _0x2c1a4e={};_0x2c1a4e[_0x1a9103]={'$like':'%'+_0x294899[_0x5add('0x2f')]['filter']+'%'};return _0x2c1a4e;})});}_0x5e415e=_['merge']({},_0x5e415e,_0x294899[_0x5add('0x44')]);return _0x191cd6['getConfigurations'](_0x5e415e);}})[_0x5add('0x23')](function(_0x1f6dec){if(_0x1f6dec){_0x45055c=_0x1f6dec['length'];if(!_0x294899[_0x5add('0x2f')]['hasOwnProperty']('nolimit')){_0x5e415e[_0x5add('0x1d')]=qs['limit'](_0x294899['query']['limit']);_0x5e415e[_0x5add('0x1c')]=qs[_0x5add('0x1c')](_0x294899[_0x5add('0x2f')][_0x5add('0x1c')]);}return _0x191cd6[_0x5add('0x49')](_0x5e415e);}})[_0x5add('0x23')](function(_0x5fa3aa){if(_0x5fa3aa){return _0x5fa3aa?{'count':_0x45055c,'rows':_0x5fa3aa}:null;}})['then'](respondWithResult(_0x2f168e,null))[_0x5add('0x40')](handleError(_0x2f168e,null));};exports[_0x5add('0x4e')]=function(_0x1f4f8b,_0x6a1779,_0x5c1657){if(_0x1f4f8b[_0x5add('0x47')]['id']){delete _0x1f4f8b['body']['id'];}return db[_0x5add('0x28')][_0x5add('0x4a')]({'where':{'id':_0x1f4f8b[_0x5add('0x42')]['id']}})['then'](handleEntityNotFound(_0x6a1779,null))[_0x5add('0x23')](function(_0x3faa68){if(_0x3faa68){_0x1f4f8b[_0x5add('0x47')][_0x5add('0x4f')]=_0x3faa68['id'];_0x1f4f8b[_0x5add('0x47')][_0x5add('0x50')]=integrations[_0x5add('0x51')](_0x1f4f8b[_0x5add('0x47')][_0x5add('0x52')],_0x1f4f8b['body']['type']);_0x1f4f8b[_0x5add('0x47')][_0x5add('0x53')]=integrations[_0x5add('0x54')](_0x1f4f8b['body'][_0x5add('0x52')],_0x1f4f8b['body'][_0x5add('0x2b')]);return db['VtigerConfiguration']['create'](_0x1f4f8b[_0x5add('0x47')],{'include':[{'model':db['VtigerField'],'as':_0x5add('0x50')},{'model':db[_0x5add('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x6a1779,null))['catch'](handleError(_0x6a1779,null));};var md5=require('md5');exports[_0x5add('0x56')]=function(_0x520c50,_0x525a90,_0x5e7fd6){var _0x14fccb=null;var _0x4aea40=null;var _0xb384a=null;var _0x9312d3=null;var _0x592e86='';return db['VtigerAccount'][_0x5add('0x4a')]({'where':{'id':_0x520c50[_0x5add('0x42')]['id']},'attributes':['id','name',_0x5add('0x57'),_0x5add('0x58'),_0x5add('0x59'),_0x5add('0x5a'),_0x5add('0x5b'),_0x5add('0x5c')]})[_0x5add('0x23')](handleEntityNotFound(_0x525a90,null))['then'](function(_0x518d4b){if(_0x518d4b){_0x14fccb=_0x518d4b[_0x5add('0x57')];_0x4aea40=_0x518d4b[_0x5add('0x5c')];_0xb384a=_0x518d4b['moduleName'];_0x592e86=_0x518d4b[_0x5add('0x5a')];var _0x385e25=_0x592e86[_0x5add('0x5d')](-0x1);if(_0x385e25==='/'){_0x592e86=_0x592e86[_0x5add('0x5e')](0x0,_0x592e86['lastIndexOf'](_0x385e25));}_0x9312d3=util[_0x5add('0x5f')](_0x5add('0x60'),_0x592e86);var _0x5d12b7={'method':_0x5add('0x61'),'uri':_0x9312d3,'qs':{'operation':'getchallenge','username':_0x518d4b[_0x5add('0x57')]},'json':!![]};return rp(_0x5d12b7);}})['then'](function(_0x19725d){if(_0x19725d['success']){var _0x3087aa={'method':_0x5add('0x62'),'uri':_0x9312d3,'form':{'operation':_0x5add('0x63'),'username':_0x14fccb,'accessKey':md5(_0x19725d[_0x5add('0x64')]['token']+_0x4aea40)},'json':!![]};return rp(_0x3087aa);}})[_0x5add('0x23')](function(_0xc91688){if(_0xc91688[_0x5add('0x65')]){var _0x4e71ef={'method':'GET','uri':_0x9312d3,'qs':{'operation':'describe','username':_0x14fccb,'sessionName':_0xc91688[_0x5add('0x64')][_0x5add('0x66')],'elementType':_0xb384a},'json':!![]};return rp(_0x4e71ef);}})[_0x5add('0x23')](function(_0x4ca634){if(_0x4ca634[_0x5add('0x65')]){var _0x6da9a9=[_0x5add('0x67'),_0x5add('0x68'),_0x5add('0x69')];_[_0x5add('0x6a')](_0x4ca634[_0x5add('0x64')][_0x5add('0x33')],function(_0x51e110){return _0x6da9a9[_0x5add('0x6b')](_0x51e110[_0x5add('0x2b')][_0x5add('0x26')]);});_['remove'](_0x4ca634[_0x5add('0x64')][_0x5add('0x33')],function(_0x41ba62){return _0x41ba62[_0x5add('0x6c')]===_0x5add('0x6d');});return{'count':_0x4ca634[_0x5add('0x64')][_0x5add('0x33')][_0x5add('0x34')],'rows':_['map'](_0x4ca634['result']['fields'],function(_0x55a05b){return{'id':_0x55a05b[_0x5add('0x26')],'name':_0x55a05b[_0x5add('0x6e')],'custom':_['startsWith'](_0x55a05b[_0x5add('0x26')],_0x5add('0x6f'))?!![]:![],'options':_0x55a05b[_0x5add('0x2b')]['name']==='picklist'&&_0x55a05b[_0x5add('0x2b')]['picklistValues'][_0x5add('0x34')]>0x0?_[_0x5add('0x2e')](_0x55a05b[_0x5add('0x2b')][_0x5add('0x70')],function(_0xe4a890){return{'name':_0xe4a890[_0x5add('0x6e')],'value':_0xe4a890[_0x5add('0x71')]};}):[]};})};}})[_0x5add('0x23')](respondWithResult(_0x525a90,null))[_0x5add('0x40')](function(_0x16d312){console[_0x5add('0x72')]('vTiger\x20error:\x20'+_0x16d312);var _0x555140=_0x520c50[_0x5add('0x2f')][_0x5add('0x73')]?0x1f4:_0x16d312[_0x5add('0x74')]||0x1f4;logger[_0x5add('0x24')](_0x5add('0x75'),'getFields',_0x555140,JSON['stringify'](_0x16d312));delete _0x16d312[_0x5add('0x26')];if(_0x555140===0x191){_0x555140=0x190;}_0x525a90[_0x5add('0x19')](_0x555140)['send'](_0x520c50['query'][_0x5add('0x73')]?{'message':_0x5add('0x76'),'statusCode':_0x16d312['statusCode']}:_0x16d312);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 6cbfe4b..2833724 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 _0x4979=['rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','util','../../config/logger','api','moment','request-promise','path'];(function(_0x113cde,_0xa79d69){var _0x1c09a4=function(_0x35e50b){while(--_0x35e50b){_0x113cde['push'](_0x113cde['shift']());}};_0x1c09a4(++_0xa79d69);}(_0x4979,0x96));var _0x9497=function(_0x57dbce,_0x2a4604){_0x57dbce=_0x57dbce-0x0;var _0x2ab396=_0x4979[_0x57dbce];return _0x2ab396;};'use strict';var _=require('lodash');var util=require(_0x9497('0x0'));var logger=require(_0x9497('0x1'))(_0x9497('0x2'));var moment=require(_0x9497('0x3'));var BPromise=require('bluebird');var rp=require(_0x9497('0x4'));var fs=require('fs');var path=require(_0x9497('0x5'));var rimraf=require(_0x9497('0x6'));var config=require(_0x9497('0x7'));var attributes=require(_0x9497('0x8'));var integrations=require(_0x9497('0x9'));module[_0x9497('0xa')]=function(_0x4661b5,_0x3a4258){return _0x4661b5[_0x9497('0xb')]('VtigerAccount',attributes,{'tableName':_0x9497('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x998b=['path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','int_vtiger_accounts','lodash','util','../../config/logger','request-promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x998b,0xa1));var _0xb998=function(_0x253799,_0x46b344){_0x253799=_0x253799-0x0;var _0x155388=_0x998b[_0x253799];return _0x155388;};'use strict';var _=require(_0xb998('0x0'));var util=require(_0xb998('0x1'));var logger=require(_0xb998('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb998('0x3'));var fs=require('fs');var path=require(_0xb998('0x4'));var rimraf=require(_0xb998('0x5'));var config=require(_0xb998('0x6'));var attributes=require(_0xb998('0x7'));var integrations=require(_0xb998('0x8'));module[_0xb998('0x9')]=function(_0x14eab6,_0x375579){return _0x14eab6['define']('VtigerAccount',attributes,{'tableName':_0xb998('0xa'),'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 b0fd293..fb1c9a6 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 _0xcf66=['raw','where','attributes','limit','include','map','model','info','ShowVtigerAccount','find','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','options'];(function(_0x4759e7,_0x103555){var _0xd31f0e=function(_0x53f9c8){while(--_0x53f9c8){_0x4759e7['push'](_0x4759e7['shift']());}};_0xd31f0e(++_0x103555);}(_0xcf66,0x71));var _0x6cf6=function(_0x43e9ce,_0x4ccea0){_0x43e9ce=_0x43e9ce-0x0;var _0x533e90=_0xcf66[_0x43e9ce];return _0x533e90;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb082,_0x94c6a9,_0x308d0d){return new BPromise(function(_0x36b892,_0x748c93){return client[_0x6cf6('0xa')](_0x5eb082,_0x308d0d)[_0x6cf6('0xb')](function(_0x5b3827){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x94c6a9,_0x6cf6('0xc'));logger['debug'](_0x6cf6('0xd'),_0x94c6a9,_0x6cf6('0xc'),JSON[_0x6cf6('0xe')](_0x5b3827));if(_0x5b3827[_0x6cf6('0xf')]){if(_0x5b3827['error']['code']===0x1f4){logger['error'](_0x6cf6('0x10'),_0x94c6a9,_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);return _0x748c93(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}logger[_0x6cf6('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x94c6a9,_0x5b3827[_0x6cf6('0xf')]['message']);return _0x36b892(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}else{logger['info'](_0x6cf6('0x10'),_0x94c6a9,_0x6cf6('0xc'));_0x36b892(_0x5b3827[_0x6cf6('0x12')][_0x6cf6('0x11')]);}})[_0x6cf6('0x13')](function(_0x2bdb12){logger[_0x6cf6('0xf')](_0x6cf6('0x10'),_0x94c6a9,_0x2bdb12);_0x748c93(_0x2bdb12);});});}exports[_0x6cf6('0x14')]=function(_0x2ca2b1){var _0x5e8b11=this;return new Promise(function(_0x11d994,_0x22915c){return db[_0x6cf6('0x15')]['findAll']({'raw':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x17')]===undefined?!![]:![]:!![],'where':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x18')]||null:null,'attributes':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1['options'][_0x6cf6('0x19')]||null:null,'limit':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x1a')]||null:null,'include':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x2ca2b1['options']['include'],function(_0x276225){return{'model':db[_0x276225['model']],'as':_0x276225['as'],'attributes':_0x276225[_0x6cf6('0x19')],'include':_0x276225[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x276225[_0x6cf6('0x1b')],function(_0x3f9871){return{'model':db[_0x3f9871[_0x6cf6('0x1d')]],'as':_0x3f9871['as'],'attributes':_0x3f9871[_0x6cf6('0x19')],'include':_0x3f9871['include']?_[_0x6cf6('0x1c')](_0x3f9871[_0x6cf6('0x1b')],function(_0x3eaa31){return{'model':db[_0x3eaa31['model']],'as':_0x3eaa31['as'],'attributes':_0x3eaa31[_0x6cf6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6cf6('0xb')](function(_0x2224db){logger[_0x6cf6('0x1e')]('GetVtigerAccount',_0x2ca2b1);logger['debug'](_0x6cf6('0x14'),_0x2ca2b1,JSON[_0x6cf6('0xe')](_0x2224db));_0x11d994(_0x2224db);})[_0x6cf6('0x13')](function(_0x5869e9){logger['error'](_0x6cf6('0x14'),_0x5869e9['message'],_0x2ca2b1);_0x22915c(_0x5e8b11['error'](0x1f4,_0x5869e9['message']));});});};exports[_0x6cf6('0x1f')]=function(_0x65433){var _0x33d308=this;return new Promise(function(_0x42f488,_0x11c848){return db['VtigerAccount'][_0x6cf6('0x20')]({'raw':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x18')]||null:null,'attributes':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x19')]||null:null,'include':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x65433[_0x6cf6('0x16')][_0x6cf6('0x1b')],function(_0x4620b6){return{'model':db[_0x4620b6[_0x6cf6('0x1d')]],'as':_0x4620b6['as'],'attributes':_0x4620b6[_0x6cf6('0x19')],'include':_0x4620b6[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x4620b6[_0x6cf6('0x1b')],function(_0x5cc6cd){return{'model':db[_0x5cc6cd[_0x6cf6('0x1d')]],'as':_0x5cc6cd['as'],'attributes':_0x5cc6cd[_0x6cf6('0x19')],'include':_0x5cc6cd[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x5cc6cd[_0x6cf6('0x1b')],function(_0x2cf3a3){return{'model':db[_0x2cf3a3[_0x6cf6('0x1d')]],'as':_0x2cf3a3['as'],'attributes':_0x2cf3a3[_0x6cf6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6cf6('0xb')](function(_0x3718a1){logger[_0x6cf6('0x1e')]('ShowVtigerAccount',_0x65433);logger[_0x6cf6('0x21')](_0x6cf6('0x1f'),_0x65433,JSON[_0x6cf6('0xe')](_0x3718a1));_0x42f488(_0x3718a1);})[_0x6cf6('0x13')](function(_0x31c822){logger[_0x6cf6('0xf')](_0x6cf6('0x1f'),_0x31c822[_0x6cf6('0x11')],_0x65433);_0x11c848(_0x33d308[_0x6cf6('0xf')](0x1f4,_0x31c822['message']));});});}; \ No newline at end of file +var _0xb688=['request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','GetVtigerAccount','stringify','ShowVtigerAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x7cdaf1,_0x40e620){var _0xf58e9a=function(_0xc05694){while(--_0xc05694){_0x7cdaf1['push'](_0x7cdaf1['shift']());}};_0xf58e9a(++_0x40e620);}(_0xb688,0xcf));var _0x8b68=function(_0x150ace,_0x2a956b){_0x150ace=_0x150ace-0x0;var _0x24aff5=_0xb688[_0x150ace];return _0x24aff5;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ee56,_0x37677d,_0x2bbffd){return new BPromise(function(_0x130892,_0xa5571b){return client[_0x8b68('0xb')](_0x57ee56,_0x2bbffd)[_0x8b68('0xc')](function(_0x261753){logger[_0x8b68('0xd')](_0x8b68('0xe'),_0x37677d,_0x8b68('0xf'));logger[_0x8b68('0x10')](_0x8b68('0x11'),_0x37677d,_0x8b68('0xf'),JSON['stringify'](_0x261753));if(_0x261753[_0x8b68('0x12')]){if(_0x261753[_0x8b68('0x12')][_0x8b68('0x13')]===0x1f4){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);return _0xa5571b(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}logger['error'](_0x8b68('0xe'),_0x37677d,_0x261753['error']['message']);return _0x130892(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}else{logger[_0x8b68('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x37677d,'request\x20sent');_0x130892(_0x261753[_0x8b68('0x15')]['message']);}})[_0x8b68('0x16')](function(_0xb44923){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0xb44923);_0xa5571b(_0xb44923);});});}exports['GetVtigerAccount']=function(_0xd17693){var _0x203dd4=this;return new Promise(function(_0x4a68c7,_0x42b3bd){return db[_0x8b68('0x17')][_0x8b68('0x18')]({'raw':_0xd17693[_0x8b68('0x19')]?_0xd17693[_0x8b68('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xd17693[_0x8b68('0x19')]?_0xd17693[_0x8b68('0x19')][_0x8b68('0x1a')]||null:null,'attributes':_0xd17693[_0x8b68('0x19')]?_0xd17693[_0x8b68('0x19')][_0x8b68('0x1b')]||null:null,'limit':_0xd17693['options']?_0xd17693['options'][_0x8b68('0x1c')]||null:null,'include':_0xd17693['options']?_0xd17693[_0x8b68('0x19')][_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0xd17693[_0x8b68('0x19')][_0x8b68('0x1d')],function(_0x173524){return{'model':db[_0x173524['model']],'as':_0x173524['as'],'attributes':_0x173524[_0x8b68('0x1b')],'include':_0x173524[_0x8b68('0x1d')]?_['map'](_0x173524[_0x8b68('0x1d')],function(_0x3cf8d2){return{'model':db[_0x3cf8d2[_0x8b68('0x1f')]],'as':_0x3cf8d2['as'],'attributes':_0x3cf8d2['attributes'],'include':_0x3cf8d2['include']?_['map'](_0x3cf8d2[_0x8b68('0x1d')],function(_0x448e43){return{'model':db[_0x448e43[_0x8b68('0x1f')]],'as':_0x448e43['as'],'attributes':_0x448e43['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b68('0xc')](function(_0x53aaa2){logger['info'](_0x8b68('0x20'),_0xd17693);logger['debug'](_0x8b68('0x20'),_0xd17693,JSON[_0x8b68('0x21')](_0x53aaa2));_0x4a68c7(_0x53aaa2);})['catch'](function(_0x494ce4){logger[_0x8b68('0x12')](_0x8b68('0x20'),_0x494ce4[_0x8b68('0x14')],_0xd17693);_0x42b3bd(_0x203dd4[_0x8b68('0x12')](0x1f4,_0x494ce4[_0x8b68('0x14')]));});});};exports[_0x8b68('0x22')]=function(_0x460c37){var _0x5b7ed1=this;return new Promise(function(_0x3b6d1b,_0x50a1e9){return db[_0x8b68('0x17')][_0x8b68('0x23')]({'raw':_0x460c37['options']?_0x460c37[_0x8b68('0x19')][_0x8b68('0x24')]===undefined?!![]:![]:!![],'where':_0x460c37[_0x8b68('0x19')]?_0x460c37['options']['where']||null:null,'attributes':_0x460c37[_0x8b68('0x19')]?_0x460c37[_0x8b68('0x19')][_0x8b68('0x1b')]||null:null,'include':_0x460c37[_0x8b68('0x19')]?_0x460c37[_0x8b68('0x19')][_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0x460c37[_0x8b68('0x19')][_0x8b68('0x1d')],function(_0x7fe301){return{'model':db[_0x7fe301[_0x8b68('0x1f')]],'as':_0x7fe301['as'],'attributes':_0x7fe301[_0x8b68('0x1b')],'include':_0x7fe301[_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0x7fe301[_0x8b68('0x1d')],function(_0x151277){return{'model':db[_0x151277[_0x8b68('0x1f')]],'as':_0x151277['as'],'attributes':_0x151277[_0x8b68('0x1b')],'include':_0x151277[_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0x151277[_0x8b68('0x1d')],function(_0x43b971){return{'model':db[_0x43b971['model']],'as':_0x43b971['as'],'attributes':_0x43b971['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b68('0xc')](function(_0x262d6c){logger[_0x8b68('0xd')](_0x8b68('0x22'),_0x460c37);logger[_0x8b68('0x10')](_0x8b68('0x22'),_0x460c37,JSON[_0x8b68('0x21')](_0x262d6c));_0x3b6d1b(_0x262d6c);})[_0x8b68('0x16')](function(_0x5b628e){logger[_0x8b68('0x12')](_0x8b68('0x22'),_0x5b628e[_0x8b68('0x14')],_0x460c37);_0x50a1e9(_0x5b7ed1[_0x8b68('0x12')](0x1f4,_0x5b628e[_0x8b68('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 5e60cad..a903558 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 _0x120d=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','post','create','delete','destroy'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0x120d,0xd2));var _0xd120=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0x120d[_0x1acc2d];return _0xabfa6d;};'use strict';var multer=require(_0xd120('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd120('0x1'));var express=require(_0xd120('0x2'));var router=express[_0xd120('0x3')]();var fs_extra=require(_0xd120('0x4'));var auth=require(_0xd120('0x5'));var interaction=require(_0xd120('0x6'));var config=require(_0xd120('0x7'));var controller=require(_0xd120('0x8'));router[_0xd120('0x9')]('/',auth[_0xd120('0xa')](),controller[_0xd120('0xb')]);router[_0xd120('0x9')](_0xd120('0xc'),auth['isAuthenticated'](),controller[_0xd120('0xd')]);router[_0xd120('0x9')]('/:id/fields',auth[_0xd120('0xa')](),controller[_0xd120('0xe')]);router['get'](_0xd120('0xf'),auth[_0xd120('0xa')](),controller[_0xd120('0x10')]);router[_0xd120('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xd120('0x11')]('/',auth[_0xd120('0xa')](),controller[_0xd120('0x12')]);router['put'](_0xd120('0xc'),auth[_0xd120('0xa')](),controller['update']);router[_0xd120('0x13')](_0xd120('0xc'),auth[_0xd120('0xa')](),controller[_0xd120('0x14')]);module['exports']=router; \ No newline at end of file +var _0xcf66=['create','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/descriptions','post'];(function(_0x18571a,_0x41f0b6){var _0x3aa60c=function(_0x325637){while(--_0x325637){_0x18571a['push'](_0x18571a['shift']());}};_0x3aa60c(++_0x41f0b6);}(_0xcf66,0x1e7));var _0x6cf6=function(_0x5d4b91,_0x55ca8e){_0x5d4b91=_0x5d4b91-0x0;var _0x2b337d=_0xcf66[_0x5d4b91];return _0x2b337d;};'use strict';var multer=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var path=require(_0x6cf6('0x2'));var timeout=require('connect-timeout');var express=require(_0x6cf6('0x3'));var router=express[_0x6cf6('0x4')]();var fs_extra=require(_0x6cf6('0x5'));var auth=require(_0x6cf6('0x6'));var interaction=require(_0x6cf6('0x7'));var config=require(_0x6cf6('0x8'));var controller=require(_0x6cf6('0x9'));router[_0x6cf6('0xa')]('/',auth['isAuthenticated'](),controller[_0x6cf6('0xb')]);router[_0x6cf6('0xa')](_0x6cf6('0xc'),auth[_0x6cf6('0xd')](),controller[_0x6cf6('0xe')]);router[_0x6cf6('0xa')](_0x6cf6('0xf'),auth['isAuthenticated'](),controller[_0x6cf6('0x10')]);router[_0x6cf6('0xa')]('/:id/subjects',auth[_0x6cf6('0xd')](),controller['getSubjects']);router[_0x6cf6('0xa')](_0x6cf6('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6cf6('0x12')]('/',auth[_0x6cf6('0xd')](),controller[_0x6cf6('0x13')]);router['put'](_0x6cf6('0xc'),auth[_0x6cf6('0xd')](),controller[_0x6cf6('0x14')]);router['delete'](_0x6cf6('0xc'),auth[_0x6cf6('0xd')](),controller['destroy']);module[_0x6cf6('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 73499b9..1e7766d 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 _0xc582=['STRING','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc582,0x79));var _0x2c58=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc582[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x2c58('0x0'));module[_0x2c58('0x1')]={'name':{'type':Sequelize[_0x2c58('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7524=['sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7524,0x1ef));var _0x4752=function(_0x232b9f,_0x586865){_0x232b9f=_0x232b9f-0x0;var _0x210676=_0x7524[_0x232b9f];return _0x210676;};'use strict';var Sequelize=require(_0x4752('0x0'));module[_0x4752('0x1')]={'name':{'type':Sequelize[_0x4752('0x2')]},'description':{'type':Sequelize[_0x4752('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index c7dfa42..8796a70 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 _0x63eb=['model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','VtigerConfiguration','include','findAll','rows','catch','show','params','length','includeAll','create','body','update','find','getFields','VtigerField','getSubjects','findOne','pick','nolimit','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','Content-Range','json','apply','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','key'];(function(_0x46215c,_0xc59ffb){var _0x9f54d2=function(_0x24c5ec){while(--_0x24c5ec){_0x46215c['push'](_0x46215c['shift']());}};_0x9f54d2(++_0xc59ffb);}(_0x63eb,0x10d));var _0xb63e=function(_0x443fc9,_0x24fc48){_0x443fc9=_0x443fc9-0x0;var _0x13fdb4=_0x63eb[_0x443fc9];return _0x13fdb4;};'use strict';var emlformat=require(_0xb63e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb63e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb63e('0x2'));var moment=require(_0xb63e('0x3'));var BPromise=require(_0xb63e('0x4'));var Mustache=require(_0xb63e('0x5'));var util=require(_0xb63e('0x6'));var path=require(_0xb63e('0x7'));var sox=require(_0xb63e('0x8'));var csv=require(_0xb63e('0x9'));var ejs=require(_0xb63e('0xa'));var fs=require('fs');var fs_extra=require(_0xb63e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb63e('0xc'));var toCsv=require(_0xb63e('0x9'));var querystring=require('querystring');var Papa=require(_0xb63e('0xd'));var Redis=require(_0xb63e('0xe'));var authService=require(_0xb63e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb63e('0x10'));var hardwareService=require(_0xb63e('0x11'));var logger=require(_0xb63e('0x12'))(_0xb63e('0x13'));var utils=require(_0xb63e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb63e('0x15'));var db=require(_0xb63e('0x16'))['db'];function respondWithStatusCode(_0x54b891,_0x43f6cb){_0x43f6cb=_0x43f6cb||0xcc;return function(_0x97f8ad){if(_0x97f8ad){return _0x54b891['sendStatus'](_0x43f6cb);}return _0x54b891['status'](_0x43f6cb)[_0xb63e('0x17')]();};}function respondWithResult(_0x186f79,_0x1719bb){_0x1719bb=_0x1719bb||0xc8;return function(_0xc3dc2b){if(_0xc3dc2b){return _0x186f79['status'](_0x1719bb)['json'](_0xc3dc2b);}};}function respondWithFilteredResult(_0x3a65f3,_0x569952){return function(_0x8c6d1f){if(_0x8c6d1f){var _0x965ebc=typeof _0x569952[_0xb63e('0x18')]===_0xb63e('0x19')&&typeof _0x569952[_0xb63e('0x1a')]==='undefined';var _0x2e0bea=_0x8c6d1f[_0xb63e('0x1b')];var _0x5c9c54=_0x965ebc?0x0:_0x569952[_0xb63e('0x18')];var _0x3ffa41=_0x965ebc?_0x8c6d1f[_0xb63e('0x1b')]:_0x569952['offset']+_0x569952['limit'];var _0x271aea;if(_0x3ffa41>=_0x2e0bea){_0x3ffa41=_0x2e0bea;_0x271aea=0xc8;}else{_0x271aea=0xce;}_0x3a65f3[_0xb63e('0x1c')](_0x271aea);return _0x3a65f3['set'](_0xb63e('0x1d'),_0x5c9c54+'-'+_0x3ffa41+'/'+_0x2e0bea)[_0xb63e('0x1e')](_0x8c6d1f);}return null;};}function patchUpdates(_0x4daa02){return function(_0x5f2fd3){try{jsonpatch[_0xb63e('0x1f')](_0x5f2fd3,_0x4daa02,!![]);}catch(_0x18ed9c){return BPromise['reject'](_0x18ed9c);}return _0x5f2fd3['save']();};}function saveUpdates(_0x4cafb1,_0x12ff05){return function(_0x21e036){if(_0x21e036){return _0x21e036['update'](_0x4cafb1)[_0xb63e('0x20')](function(_0x5913e9){return _0x5913e9;});}return null;};}function removeEntity(_0x5f2d91,_0x114fb5){return function(_0x189d6a){if(_0x189d6a){return _0x189d6a[_0xb63e('0x21')]()[_0xb63e('0x20')](function(){_0x5f2d91[_0xb63e('0x1c')](0xcc)[_0xb63e('0x17')]();});}};}function handleEntityNotFound(_0x644624,_0x14af95){return function(_0x1cb297){if(!_0x1cb297){_0x644624[_0xb63e('0x22')](0x194);}return _0x1cb297;};}function handleError(_0x4e95e5,_0x36c99a){_0x36c99a=_0x36c99a||0x1f4;return function(_0x1d44c7){logger[_0xb63e('0x23')](_0x1d44c7['stack']);if(_0x1d44c7[_0xb63e('0x24')]){delete _0x1d44c7[_0xb63e('0x24')];}_0x4e95e5['status'](_0x36c99a)[_0xb63e('0x25')](_0x1d44c7);};}exports['index']=function(_0x44be2f,_0x8d039c){var _0x51c1ef={},_0xc3c0f2={},_0x2ec459={'count':0x0,'rows':[]};var _0x20b408=_[_0xb63e('0x26')](db['VtigerConfiguration'][_0xb63e('0x27')],function(_0x52b879){return{'name':_0x52b879[_0xb63e('0x28')],'type':_0x52b879[_0xb63e('0x29')][_0xb63e('0x2a')]};});_0xc3c0f2[_0xb63e('0x2b')]=_[_0xb63e('0x26')](_0x20b408,'name');_0xc3c0f2[_0xb63e('0x2c')]=_[_0xb63e('0x2d')](_0x44be2f[_0xb63e('0x2c')]);_0xc3c0f2[_0xb63e('0x2e')]=_[_0xb63e('0x2f')](_0xc3c0f2[_0xb63e('0x2b')],_0xc3c0f2[_0xb63e('0x2c')]);_0x51c1ef['attributes']=_[_0xb63e('0x2f')](_0xc3c0f2[_0xb63e('0x2b')],qs[_0xb63e('0x30')](_0x44be2f[_0xb63e('0x2c')]['fields']));_0x51c1ef[_0xb63e('0x31')]=_0x51c1ef['attributes']['length']?_0x51c1ef[_0xb63e('0x31')]:_0xc3c0f2[_0xb63e('0x2b')];if(!_0x44be2f[_0xb63e('0x2c')][_0xb63e('0x32')]('nolimit')){_0x51c1ef[_0xb63e('0x1a')]=qs['limit'](_0x44be2f[_0xb63e('0x2c')][_0xb63e('0x1a')]);_0x51c1ef[_0xb63e('0x18')]=qs[_0xb63e('0x18')](_0x44be2f[_0xb63e('0x2c')]['offset']);}_0x51c1ef[_0xb63e('0x33')]=qs[_0xb63e('0x34')](_0x44be2f[_0xb63e('0x2c')][_0xb63e('0x34')]);_0x51c1ef[_0xb63e('0x35')]=qs[_0xb63e('0x2e')](_['pick'](_0x44be2f['query'],_0xc3c0f2['filters']),_0x20b408);if(_0x44be2f[_0xb63e('0x2c')]['filter']){_0x51c1ef[_0xb63e('0x35')]=_[_0xb63e('0x36')](_0x51c1ef[_0xb63e('0x35')],{'$or':_['map'](_0x20b408,function(_0x416c63){if(_0x416c63['type']!==_0xb63e('0x37')){var _0x26ed6e={};_0x26ed6e[_0x416c63['name']]={'$like':'%'+_0x44be2f['query'][_0xb63e('0x38')]+'%'};return _0x26ed6e;}})});}_0x51c1ef=_[_0xb63e('0x36')]({},_0x51c1ef,_0x44be2f[_0xb63e('0x39')]);var _0x274272={'where':_0x51c1ef['where']};return db[_0xb63e('0x3a')][_0xb63e('0x1b')](_0x274272)['then'](function(_0xbe01e2){_0x2ec459[_0xb63e('0x1b')]=_0xbe01e2;if(_0x44be2f[_0xb63e('0x2c')]['includeAll']){_0x51c1ef[_0xb63e('0x3b')]=[{'all':!![]}];}return db[_0xb63e('0x3a')][_0xb63e('0x3c')](_0x51c1ef);})[_0xb63e('0x20')](function(_0x49f853){_0x2ec459[_0xb63e('0x3d')]=_0x49f853;return _0x2ec459;})[_0xb63e('0x20')](respondWithFilteredResult(_0x8d039c,_0x51c1ef))[_0xb63e('0x3e')](handleError(_0x8d039c,null));};exports[_0xb63e('0x3f')]=function(_0x3ff7dd,_0x2e5620){var _0xba3521={'raw':![],'where':{'id':_0x3ff7dd[_0xb63e('0x40')]['id']}},_0x45a520={};_0x45a520[_0xb63e('0x2b')]=_[_0xb63e('0x2d')](db[_0xb63e('0x3a')][_0xb63e('0x27')]);_0x45a520[_0xb63e('0x2c')]=_[_0xb63e('0x2d')](_0x3ff7dd[_0xb63e('0x2c')]);_0x45a520[_0xb63e('0x2e')]=_[_0xb63e('0x2f')](_0x45a520['model'],_0x45a520[_0xb63e('0x2c')]);_0xba3521['attributes']=_['intersection'](_0x45a520['model'],qs[_0xb63e('0x30')](_0x3ff7dd[_0xb63e('0x2c')][_0xb63e('0x30')]));_0xba3521[_0xb63e('0x31')]=_0xba3521[_0xb63e('0x31')][_0xb63e('0x41')]?_0xba3521[_0xb63e('0x31')]:_0x45a520[_0xb63e('0x2b')];if(_0x3ff7dd[_0xb63e('0x2c')][_0xb63e('0x42')]){_0xba3521['include']=[{'all':!![]}];}_0xba3521=_[_0xb63e('0x36')]({},_0xba3521,_0x3ff7dd[_0xb63e('0x39')]);return db[_0xb63e('0x3a')]['find'](_0xba3521)[_0xb63e('0x20')](handleEntityNotFound(_0x2e5620,null))[_0xb63e('0x20')](respondWithResult(_0x2e5620,null))[_0xb63e('0x3e')](handleError(_0x2e5620,null));};exports['create']=function(_0x30f84b,_0x1f09fd){return db[_0xb63e('0x3a')][_0xb63e('0x43')](_0x30f84b[_0xb63e('0x44')],{})[_0xb63e('0x20')](respondWithResult(_0x1f09fd,0xc9))[_0xb63e('0x3e')](handleError(_0x1f09fd,null));};exports[_0xb63e('0x45')]=function(_0x503d5e,_0x576886){if(_0x503d5e[_0xb63e('0x44')]['id']){delete _0x503d5e['body']['id'];}return db[_0xb63e('0x3a')]['find']({'where':{'id':_0x503d5e['params']['id']}})['then'](handleEntityNotFound(_0x576886,null))[_0xb63e('0x20')](saveUpdates(_0x503d5e[_0xb63e('0x44')],null))[_0xb63e('0x20')](respondWithResult(_0x576886,null))['catch'](handleError(_0x576886,null));};exports['destroy']=function(_0x137b54,_0x4c7a6f){return db[_0xb63e('0x3a')][_0xb63e('0x46')]({'where':{'id':_0x137b54[_0xb63e('0x40')]['id']}})[_0xb63e('0x20')](handleEntityNotFound(_0x4c7a6f,null))[_0xb63e('0x20')](removeEntity(_0x4c7a6f,null))[_0xb63e('0x3e')](handleError(_0x4c7a6f,null));};exports[_0xb63e('0x47')]=function(_0x3b05c6,_0xa6a634,_0x24b411){var _0x173172={};var _0x5b593f={};var _0x28792f;var _0x310cc7;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x3b05c6[_0xb63e('0x40')]['id']}})['then'](handleEntityNotFound(_0xa6a634,null))['then'](function(_0x3b9f1d){if(_0x3b9f1d){_0x28792f=_0x3b9f1d;_0x5b593f['model']=_[_0xb63e('0x2d')](db[_0xb63e('0x48')][_0xb63e('0x27')]);_0x5b593f[_0xb63e('0x2c')]=_[_0xb63e('0x2d')](_0x3b05c6['query']);_0x5b593f[_0xb63e('0x2e')]=_['intersection'](_0x5b593f[_0xb63e('0x2b')],_0x5b593f[_0xb63e('0x2c')]);_0x173172[_0xb63e('0x31')]=_[_0xb63e('0x2f')](_0x5b593f[_0xb63e('0x2b')],qs[_0xb63e('0x30')](_0x3b05c6['query'][_0xb63e('0x30')]));_0x173172[_0xb63e('0x31')]=_0x173172[_0xb63e('0x31')]['length']?_0x173172[_0xb63e('0x31')]:_0x5b593f[_0xb63e('0x2b')];_0x173172['order']=qs['sort'](_0x3b05c6[_0xb63e('0x2c')]['sort']);_0x173172[_0xb63e('0x35')]=qs[_0xb63e('0x2e')](_['pick'](_0x3b05c6[_0xb63e('0x2c')],_0x5b593f[_0xb63e('0x2e')]));if(_0x3b05c6[_0xb63e('0x2c')]['filter']){_0x173172[_0xb63e('0x35')]=_['merge'](_0x173172[_0xb63e('0x35')],{'$or':_[_0xb63e('0x26')](_0x173172[_0xb63e('0x31')],function(_0x1946e8){var _0x1a9cd1={};_0x1a9cd1[_0x1946e8]={'$like':'%'+_0x3b05c6[_0xb63e('0x2c')][_0xb63e('0x38')]+'%'};return _0x1a9cd1;})});}_0x173172=_[_0xb63e('0x36')]({},_0x173172,_0x3b05c6['options']);return _0x28792f[_0xb63e('0x47')](_0x173172);}})[_0xb63e('0x20')](function(_0x950e05){if(_0x950e05){_0x310cc7=_0x950e05[_0xb63e('0x41')];if(!_0x3b05c6[_0xb63e('0x2c')][_0xb63e('0x32')]('nolimit')){_0x173172['limit']=qs[_0xb63e('0x1a')](_0x3b05c6['query'][_0xb63e('0x1a')]);_0x173172[_0xb63e('0x18')]=qs[_0xb63e('0x18')](_0x3b05c6[_0xb63e('0x2c')][_0xb63e('0x18')]);}return _0x28792f[_0xb63e('0x47')](_0x173172);}})[_0xb63e('0x20')](function(_0x3e0f49){if(_0x3e0f49){return _0x3e0f49?{'count':_0x310cc7,'rows':_0x3e0f49}:null;}})[_0xb63e('0x20')](respondWithResult(_0xa6a634,null))['catch'](handleError(_0xa6a634,null));};exports[_0xb63e('0x49')]=function(_0x2cae1c,_0x17c590,_0x203a24){var _0x5cf082={};var _0x148bd4={};var _0x4f51a6;var _0x27021c;return db['VtigerConfiguration'][_0xb63e('0x4a')]({'where':{'id':_0x2cae1c['params']['id']}})['then'](handleEntityNotFound(_0x17c590,null))[_0xb63e('0x20')](function(_0x1ac350){if(_0x1ac350){_0x4f51a6=_0x1ac350;_0x148bd4[_0xb63e('0x2b')]=_['keys'](db[_0xb63e('0x48')][_0xb63e('0x27')]);_0x148bd4['query']=_[_0xb63e('0x2d')](_0x2cae1c[_0xb63e('0x2c')]);_0x148bd4[_0xb63e('0x2e')]=_[_0xb63e('0x2f')](_0x148bd4['model'],_0x148bd4[_0xb63e('0x2c')]);_0x5cf082[_0xb63e('0x31')]=_[_0xb63e('0x2f')](_0x148bd4[_0xb63e('0x2b')],qs[_0xb63e('0x30')](_0x2cae1c[_0xb63e('0x2c')][_0xb63e('0x30')]));_0x5cf082[_0xb63e('0x31')]=_0x5cf082[_0xb63e('0x31')][_0xb63e('0x41')]?_0x5cf082[_0xb63e('0x31')]:_0x148bd4[_0xb63e('0x2b')];_0x5cf082[_0xb63e('0x33')]=qs[_0xb63e('0x34')](_0x2cae1c['query'][_0xb63e('0x34')]);_0x5cf082[_0xb63e('0x35')]=qs[_0xb63e('0x2e')](_[_0xb63e('0x4b')](_0x2cae1c['query'],_0x148bd4[_0xb63e('0x2e')]));if(_0x2cae1c[_0xb63e('0x2c')]['filter']){_0x5cf082[_0xb63e('0x35')]=_[_0xb63e('0x36')](_0x5cf082[_0xb63e('0x35')],{'$or':_[_0xb63e('0x26')](_0x5cf082[_0xb63e('0x31')],function(_0x3c2202){var _0x17d163={};_0x17d163[_0x3c2202]={'$like':'%'+_0x2cae1c[_0xb63e('0x2c')][_0xb63e('0x38')]+'%'};return _0x17d163;})});}_0x5cf082=_[_0xb63e('0x36')]({},_0x5cf082,_0x2cae1c[_0xb63e('0x39')]);return _0x4f51a6[_0xb63e('0x49')](_0x5cf082);}})[_0xb63e('0x20')](function(_0x40639f){if(_0x40639f){_0x27021c=_0x40639f[_0xb63e('0x41')];if(!_0x2cae1c[_0xb63e('0x2c')][_0xb63e('0x32')](_0xb63e('0x4c'))){_0x5cf082['limit']=qs[_0xb63e('0x1a')](_0x2cae1c['query'][_0xb63e('0x1a')]);_0x5cf082[_0xb63e('0x18')]=qs[_0xb63e('0x18')](_0x2cae1c[_0xb63e('0x2c')][_0xb63e('0x18')]);}return _0x4f51a6[_0xb63e('0x49')](_0x5cf082);}})['then'](function(_0x3b96e2){if(_0x3b96e2){return _0x3b96e2?{'count':_0x27021c,'rows':_0x3b96e2}:null;}})[_0xb63e('0x20')](respondWithResult(_0x17c590,null))[_0xb63e('0x3e')](handleError(_0x17c590,null));};exports[_0xb63e('0x4d')]=function(_0x4cc498,_0x3fa697,_0x32e744){var _0x34c680={};var _0x27a69a={};var _0x34e5ff;var _0x2e0279;return db[_0xb63e('0x3a')][_0xb63e('0x4a')]({'where':{'id':_0x4cc498[_0xb63e('0x40')]['id']}})[_0xb63e('0x20')](handleEntityNotFound(_0x3fa697,null))[_0xb63e('0x20')](function(_0x370069){if(_0x370069){_0x34e5ff=_0x370069;_0x27a69a[_0xb63e('0x2b')]=_[_0xb63e('0x2d')](db['VtigerField'][_0xb63e('0x27')]);_0x27a69a[_0xb63e('0x2c')]=_['keys'](_0x4cc498[_0xb63e('0x2c')]);_0x27a69a['filters']=_[_0xb63e('0x2f')](_0x27a69a[_0xb63e('0x2b')],_0x27a69a[_0xb63e('0x2c')]);_0x34c680[_0xb63e('0x31')]=_['intersection'](_0x27a69a[_0xb63e('0x2b')],qs[_0xb63e('0x30')](_0x4cc498[_0xb63e('0x2c')][_0xb63e('0x30')]));_0x34c680['attributes']=_0x34c680[_0xb63e('0x31')][_0xb63e('0x41')]?_0x34c680[_0xb63e('0x31')]:_0x27a69a['model'];_0x34c680[_0xb63e('0x33')]=qs['sort'](_0x4cc498[_0xb63e('0x2c')]['sort']);_0x34c680[_0xb63e('0x35')]=qs[_0xb63e('0x2e')](_[_0xb63e('0x4b')](_0x4cc498['query'],_0x27a69a[_0xb63e('0x2e')]));if(_0x4cc498[_0xb63e('0x2c')][_0xb63e('0x38')]){_0x34c680[_0xb63e('0x35')]=_[_0xb63e('0x36')](_0x34c680[_0xb63e('0x35')],{'$or':_['map'](_0x34c680[_0xb63e('0x31')],function(_0x2a3399){var _0x1d746d={};_0x1d746d[_0x2a3399]={'$like':'%'+_0x4cc498[_0xb63e('0x2c')][_0xb63e('0x38')]+'%'};return _0x1d746d;})});}_0x34c680=_[_0xb63e('0x36')]({},_0x34c680,_0x4cc498['options']);return _0x34e5ff[_0xb63e('0x4d')](_0x34c680);}})[_0xb63e('0x20')](function(_0x5ed090){if(_0x5ed090){_0x2e0279=_0x5ed090[_0xb63e('0x41')];if(!_0x4cc498[_0xb63e('0x2c')][_0xb63e('0x32')](_0xb63e('0x4c'))){_0x34c680[_0xb63e('0x1a')]=qs['limit'](_0x4cc498[_0xb63e('0x2c')][_0xb63e('0x1a')]);_0x34c680[_0xb63e('0x18')]=qs[_0xb63e('0x18')](_0x4cc498['query']['offset']);}return _0x34e5ff['getDescriptions'](_0x34c680);}})[_0xb63e('0x20')](function(_0x1d3a09){if(_0x1d3a09){return _0x1d3a09?{'count':_0x2e0279,'rows':_0x1d3a09}:null;}})[_0xb63e('0x20')](respondWithResult(_0x3fa697,null))[_0xb63e('0x3e')](handleError(_0x3fa697,null));}; \ No newline at end of file +var _0x4cad=['nolimit','getSubjects','hasOwnProperty','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','index','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','VtigerField','filter','getFields'];(function(_0x3da27c,_0x15a0c2){var _0x465617=function(_0x1d0266){while(--_0x1d0266){_0x3da27c['push'](_0x3da27c['shift']());}};_0x465617(++_0x15a0c2);}(_0x4cad,0x1d8));var _0xd4ca=function(_0x49ecfc,_0x20caa5){_0x49ecfc=_0x49ecfc-0x0;var _0x2cca9c=_0x4cad[_0x49ecfc];return _0x2cca9c;};'use strict';var emlformat=require(_0xd4ca('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd4ca('0x1'));var rp=require(_0xd4ca('0x2'));var moment=require(_0xd4ca('0x3'));var BPromise=require(_0xd4ca('0x4'));var Mustache=require(_0xd4ca('0x5'));var util=require(_0xd4ca('0x6'));var path=require(_0xd4ca('0x7'));var sox=require('sox');var csv=require(_0xd4ca('0x8'));var ejs=require(_0xd4ca('0x9'));var fs=require('fs');var fs_extra=require(_0xd4ca('0xa'));var _=require(_0xd4ca('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd4ca('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd4ca('0x8'));var querystring=require(_0xd4ca('0xd'));var Papa=require(_0xd4ca('0xe'));var Redis=require(_0xd4ca('0xf'));var authService=require(_0xd4ca('0x10'));var qs=require(_0xd4ca('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4ca('0x12'))(_0xd4ca('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd4ca('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3678d0,_0x2c866b){_0x2c866b=_0x2c866b||0xcc;return function(_0x32fccb){if(_0x32fccb){return _0x3678d0[_0xd4ca('0x15')](_0x2c866b);}return _0x3678d0[_0xd4ca('0x16')](_0x2c866b)[_0xd4ca('0x17')]();};}function respondWithResult(_0x4186ab,_0xe424e){_0xe424e=_0xe424e||0xc8;return function(_0x4a79f2){if(_0x4a79f2){return _0x4186ab[_0xd4ca('0x16')](_0xe424e)[_0xd4ca('0x18')](_0x4a79f2);}};}function respondWithFilteredResult(_0x1385b0,_0x504a3a){return function(_0x230331){if(_0x230331){var _0xe39a91=typeof _0x504a3a[_0xd4ca('0x19')]===_0xd4ca('0x1a')&&typeof _0x504a3a[_0xd4ca('0x1b')]==='undefined';var _0xa60278=_0x230331[_0xd4ca('0x1c')];var _0x58fb14=_0xe39a91?0x0:_0x504a3a[_0xd4ca('0x19')];var _0x5ec1dc=_0xe39a91?_0x230331[_0xd4ca('0x1c')]:_0x504a3a[_0xd4ca('0x19')]+_0x504a3a[_0xd4ca('0x1b')];var _0x2d8c3c;if(_0x5ec1dc>=_0xa60278){_0x5ec1dc=_0xa60278;_0x2d8c3c=0xc8;}else{_0x2d8c3c=0xce;}_0x1385b0[_0xd4ca('0x16')](_0x2d8c3c);return _0x1385b0[_0xd4ca('0x1d')](_0xd4ca('0x1e'),_0x58fb14+'-'+_0x5ec1dc+'/'+_0xa60278)[_0xd4ca('0x18')](_0x230331);}return null;};}function patchUpdates(_0x5d9b33){return function(_0x3a7023){try{jsonpatch[_0xd4ca('0x1f')](_0x3a7023,_0x5d9b33,!![]);}catch(_0x5ab4e9){return BPromise['reject'](_0x5ab4e9);}return _0x3a7023[_0xd4ca('0x20')]();};}function saveUpdates(_0x4dac50,_0x2f73f5){return function(_0x31ea99){if(_0x31ea99){return _0x31ea99[_0xd4ca('0x21')](_0x4dac50)['then'](function(_0x37d12b){return _0x37d12b;});}return null;};}function removeEntity(_0xbb7f09,_0x45b86d){return function(_0x2364fe){if(_0x2364fe){return _0x2364fe['destroy']()[_0xd4ca('0x22')](function(){_0xbb7f09['status'](0xcc)[_0xd4ca('0x17')]();});}};}function handleEntityNotFound(_0x3f8a73,_0xf98d54){return function(_0x134636){if(!_0x134636){_0x3f8a73['sendStatus'](0x194);}return _0x134636;};}function handleError(_0x1191a4,_0x172d54){_0x172d54=_0x172d54||0x1f4;return function(_0x2f0243){logger[_0xd4ca('0x23')](_0x2f0243[_0xd4ca('0x24')]);if(_0x2f0243[_0xd4ca('0x25')]){delete _0x2f0243[_0xd4ca('0x25')];}_0x1191a4[_0xd4ca('0x16')](_0x172d54)['send'](_0x2f0243);};}exports[_0xd4ca('0x26')]=function(_0x3180ce,_0x2b3e93){var _0x4e2c9a={},_0x131a03={},_0x5e56d1={'count':0x0,'rows':[]};var _0x305d71=_['map'](db[_0xd4ca('0x27')][_0xd4ca('0x28')],function(_0x4d60d8){return{'name':_0x4d60d8[_0xd4ca('0x29')],'type':_0x4d60d8[_0xd4ca('0x2a')][_0xd4ca('0x2b')]};});_0x131a03[_0xd4ca('0x2c')]=_['map'](_0x305d71,_0xd4ca('0x25'));_0x131a03[_0xd4ca('0x2d')]=_[_0xd4ca('0x2e')](_0x3180ce[_0xd4ca('0x2d')]);_0x131a03[_0xd4ca('0x2f')]=_[_0xd4ca('0x30')](_0x131a03['model'],_0x131a03[_0xd4ca('0x2d')]);_0x4e2c9a['attributes']=_['intersection'](_0x131a03['model'],qs[_0xd4ca('0x31')](_0x3180ce['query'][_0xd4ca('0x31')]));_0x4e2c9a[_0xd4ca('0x32')]=_0x4e2c9a[_0xd4ca('0x32')][_0xd4ca('0x33')]?_0x4e2c9a['attributes']:_0x131a03['model'];if(!_0x3180ce['query']['hasOwnProperty']('nolimit')){_0x4e2c9a[_0xd4ca('0x1b')]=qs[_0xd4ca('0x1b')](_0x3180ce['query']['limit']);_0x4e2c9a[_0xd4ca('0x19')]=qs[_0xd4ca('0x19')](_0x3180ce[_0xd4ca('0x2d')][_0xd4ca('0x19')]);}_0x4e2c9a[_0xd4ca('0x34')]=qs[_0xd4ca('0x35')](_0x3180ce['query'][_0xd4ca('0x35')]);_0x4e2c9a[_0xd4ca('0x36')]=qs['filters'](_[_0xd4ca('0x37')](_0x3180ce[_0xd4ca('0x2d')],_0x131a03[_0xd4ca('0x2f')]),_0x305d71);if(_0x3180ce[_0xd4ca('0x2d')]['filter']){_0x4e2c9a['where']=_[_0xd4ca('0x38')](_0x4e2c9a[_0xd4ca('0x36')],{'$or':_[_0xd4ca('0x39')](_0x305d71,function(_0x4efb11){if(_0x4efb11[_0xd4ca('0x2a')]!==_0xd4ca('0x3a')){var _0x40b260={};_0x40b260[_0x4efb11['name']]={'$like':'%'+_0x3180ce[_0xd4ca('0x2d')]['filter']+'%'};return _0x40b260;}})});}_0x4e2c9a=_['merge']({},_0x4e2c9a,_0x3180ce[_0xd4ca('0x3b')]);var _0x487333={'where':_0x4e2c9a[_0xd4ca('0x36')]};return db[_0xd4ca('0x27')]['count'](_0x487333)[_0xd4ca('0x22')](function(_0x1701b4){_0x5e56d1[_0xd4ca('0x1c')]=_0x1701b4;if(_0x3180ce['query'][_0xd4ca('0x3c')]){_0x4e2c9a[_0xd4ca('0x3d')]=[{'all':!![]}];}return db[_0xd4ca('0x27')][_0xd4ca('0x3e')](_0x4e2c9a);})['then'](function(_0x174db5){_0x5e56d1[_0xd4ca('0x3f')]=_0x174db5;return _0x5e56d1;})[_0xd4ca('0x22')](respondWithFilteredResult(_0x2b3e93,_0x4e2c9a))[_0xd4ca('0x40')](handleError(_0x2b3e93,null));};exports[_0xd4ca('0x41')]=function(_0xf1f629,_0x3c08b1){var _0x40e2df={'raw':![],'where':{'id':_0xf1f629[_0xd4ca('0x42')]['id']}},_0x39e594={};_0x39e594['model']=_[_0xd4ca('0x2e')](db['VtigerConfiguration'][_0xd4ca('0x28')]);_0x39e594[_0xd4ca('0x2d')]=_[_0xd4ca('0x2e')](_0xf1f629['query']);_0x39e594[_0xd4ca('0x2f')]=_[_0xd4ca('0x30')](_0x39e594[_0xd4ca('0x2c')],_0x39e594['query']);_0x40e2df['attributes']=_[_0xd4ca('0x30')](_0x39e594[_0xd4ca('0x2c')],qs[_0xd4ca('0x31')](_0xf1f629['query']['fields']));_0x40e2df[_0xd4ca('0x32')]=_0x40e2df[_0xd4ca('0x32')]['length']?_0x40e2df[_0xd4ca('0x32')]:_0x39e594['model'];if(_0xf1f629[_0xd4ca('0x2d')][_0xd4ca('0x3c')]){_0x40e2df[_0xd4ca('0x3d')]=[{'all':!![]}];}_0x40e2df=_[_0xd4ca('0x38')]({},_0x40e2df,_0xf1f629[_0xd4ca('0x3b')]);return db[_0xd4ca('0x27')][_0xd4ca('0x43')](_0x40e2df)[_0xd4ca('0x22')](handleEntityNotFound(_0x3c08b1,null))[_0xd4ca('0x22')](respondWithResult(_0x3c08b1,null))[_0xd4ca('0x40')](handleError(_0x3c08b1,null));};exports[_0xd4ca('0x44')]=function(_0x5925cf,_0x5cd8e8){return db[_0xd4ca('0x27')][_0xd4ca('0x44')](_0x5925cf['body'],{})[_0xd4ca('0x22')](respondWithResult(_0x5cd8e8,0xc9))[_0xd4ca('0x40')](handleError(_0x5cd8e8,null));};exports[_0xd4ca('0x21')]=function(_0x27f36f,_0x25902c){if(_0x27f36f[_0xd4ca('0x45')]['id']){delete _0x27f36f['body']['id'];}return db['VtigerConfiguration'][_0xd4ca('0x43')]({'where':{'id':_0x27f36f['params']['id']}})[_0xd4ca('0x22')](handleEntityNotFound(_0x25902c,null))[_0xd4ca('0x22')](saveUpdates(_0x27f36f['body'],null))[_0xd4ca('0x22')](respondWithResult(_0x25902c,null))['catch'](handleError(_0x25902c,null));};exports['destroy']=function(_0x524ebb,_0x1547c4){return db['VtigerConfiguration'][_0xd4ca('0x43')]({'where':{'id':_0x524ebb['params']['id']}})[_0xd4ca('0x22')](handleEntityNotFound(_0x1547c4,null))[_0xd4ca('0x22')](removeEntity(_0x1547c4,null))[_0xd4ca('0x40')](handleError(_0x1547c4,null));};exports['getFields']=function(_0x566564,_0x8d081b,_0x2458e3){var _0x280641={};var _0x3c5337={};var _0x51b0ab;var _0x2ead44;return db[_0xd4ca('0x27')][_0xd4ca('0x46')]({'where':{'id':_0x566564['params']['id']}})[_0xd4ca('0x22')](handleEntityNotFound(_0x8d081b,null))['then'](function(_0x398042){if(_0x398042){_0x51b0ab=_0x398042;_0x3c5337[_0xd4ca('0x2c')]=_['keys'](db[_0xd4ca('0x47')][_0xd4ca('0x28')]);_0x3c5337[_0xd4ca('0x2d')]=_[_0xd4ca('0x2e')](_0x566564[_0xd4ca('0x2d')]);_0x3c5337[_0xd4ca('0x2f')]=_[_0xd4ca('0x30')](_0x3c5337[_0xd4ca('0x2c')],_0x3c5337[_0xd4ca('0x2d')]);_0x280641['attributes']=_['intersection'](_0x3c5337[_0xd4ca('0x2c')],qs[_0xd4ca('0x31')](_0x566564[_0xd4ca('0x2d')][_0xd4ca('0x31')]));_0x280641[_0xd4ca('0x32')]=_0x280641[_0xd4ca('0x32')]['length']?_0x280641[_0xd4ca('0x32')]:_0x3c5337[_0xd4ca('0x2c')];_0x280641['order']=qs['sort'](_0x566564['query'][_0xd4ca('0x35')]);_0x280641[_0xd4ca('0x36')]=qs[_0xd4ca('0x2f')](_[_0xd4ca('0x37')](_0x566564[_0xd4ca('0x2d')],_0x3c5337[_0xd4ca('0x2f')]));if(_0x566564[_0xd4ca('0x2d')]['filter']){_0x280641['where']=_[_0xd4ca('0x38')](_0x280641['where'],{'$or':_['map'](_0x280641[_0xd4ca('0x32')],function(_0x309227){var _0x2c2e79={};_0x2c2e79[_0x309227]={'$like':'%'+_0x566564[_0xd4ca('0x2d')][_0xd4ca('0x48')]+'%'};return _0x2c2e79;})});}_0x280641=_[_0xd4ca('0x38')]({},_0x280641,_0x566564['options']);return _0x51b0ab[_0xd4ca('0x49')](_0x280641);}})['then'](function(_0x468e9c){if(_0x468e9c){_0x2ead44=_0x468e9c['length'];if(!_0x566564[_0xd4ca('0x2d')]['hasOwnProperty'](_0xd4ca('0x4a'))){_0x280641['limit']=qs['limit'](_0x566564[_0xd4ca('0x2d')][_0xd4ca('0x1b')]);_0x280641[_0xd4ca('0x19')]=qs[_0xd4ca('0x19')](_0x566564[_0xd4ca('0x2d')][_0xd4ca('0x19')]);}return _0x51b0ab[_0xd4ca('0x49')](_0x280641);}})[_0xd4ca('0x22')](function(_0x3da995){if(_0x3da995){return _0x3da995?{'count':_0x2ead44,'rows':_0x3da995}:null;}})[_0xd4ca('0x22')](respondWithResult(_0x8d081b,null))[_0xd4ca('0x40')](handleError(_0x8d081b,null));};exports[_0xd4ca('0x4b')]=function(_0x4406af,_0x2f824,_0x52aabe){var _0x5ab573={};var _0x56e076={};var _0x143b68;var _0x2573b2;return db[_0xd4ca('0x27')][_0xd4ca('0x46')]({'where':{'id':_0x4406af[_0xd4ca('0x42')]['id']}})[_0xd4ca('0x22')](handleEntityNotFound(_0x2f824,null))[_0xd4ca('0x22')](function(_0x192d71){if(_0x192d71){_0x143b68=_0x192d71;_0x56e076[_0xd4ca('0x2c')]=_[_0xd4ca('0x2e')](db[_0xd4ca('0x47')]['rawAttributes']);_0x56e076[_0xd4ca('0x2d')]=_['keys'](_0x4406af[_0xd4ca('0x2d')]);_0x56e076[_0xd4ca('0x2f')]=_[_0xd4ca('0x30')](_0x56e076[_0xd4ca('0x2c')],_0x56e076['query']);_0x5ab573['attributes']=_[_0xd4ca('0x30')](_0x56e076['model'],qs[_0xd4ca('0x31')](_0x4406af[_0xd4ca('0x2d')][_0xd4ca('0x31')]));_0x5ab573['attributes']=_0x5ab573[_0xd4ca('0x32')][_0xd4ca('0x33')]?_0x5ab573[_0xd4ca('0x32')]:_0x56e076[_0xd4ca('0x2c')];_0x5ab573[_0xd4ca('0x34')]=qs[_0xd4ca('0x35')](_0x4406af[_0xd4ca('0x2d')][_0xd4ca('0x35')]);_0x5ab573[_0xd4ca('0x36')]=qs[_0xd4ca('0x2f')](_['pick'](_0x4406af[_0xd4ca('0x2d')],_0x56e076[_0xd4ca('0x2f')]));if(_0x4406af[_0xd4ca('0x2d')]['filter']){_0x5ab573[_0xd4ca('0x36')]=_[_0xd4ca('0x38')](_0x5ab573[_0xd4ca('0x36')],{'$or':_['map'](_0x5ab573[_0xd4ca('0x32')],function(_0x4443ca){var _0x1db681={};_0x1db681[_0x4443ca]={'$like':'%'+_0x4406af[_0xd4ca('0x2d')][_0xd4ca('0x48')]+'%'};return _0x1db681;})});}_0x5ab573=_[_0xd4ca('0x38')]({},_0x5ab573,_0x4406af['options']);return _0x143b68[_0xd4ca('0x4b')](_0x5ab573);}})['then'](function(_0x113059){if(_0x113059){_0x2573b2=_0x113059[_0xd4ca('0x33')];if(!_0x4406af['query'][_0xd4ca('0x4c')](_0xd4ca('0x4a'))){_0x5ab573[_0xd4ca('0x1b')]=qs[_0xd4ca('0x1b')](_0x4406af[_0xd4ca('0x2d')]['limit']);_0x5ab573['offset']=qs[_0xd4ca('0x19')](_0x4406af['query'][_0xd4ca('0x19')]);}return _0x143b68[_0xd4ca('0x4b')](_0x5ab573);}})['then'](function(_0x25d9c9){if(_0x25d9c9){return _0x25d9c9?{'count':_0x2573b2,'rows':_0x25d9c9}:null;}})[_0xd4ca('0x22')](respondWithResult(_0x2f824,null))[_0xd4ca('0x40')](handleError(_0x2f824,null));};exports['getDescriptions']=function(_0xee449f,_0x1e927f,_0x25c37f){var _0x5129f1={};var _0x55a765={};var _0x1f6307;var _0x495a0c;return db['VtigerConfiguration'][_0xd4ca('0x46')]({'where':{'id':_0xee449f[_0xd4ca('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e927f,null))[_0xd4ca('0x22')](function(_0x5793ae){if(_0x5793ae){_0x1f6307=_0x5793ae;_0x55a765[_0xd4ca('0x2c')]=_[_0xd4ca('0x2e')](db[_0xd4ca('0x47')][_0xd4ca('0x28')]);_0x55a765[_0xd4ca('0x2d')]=_['keys'](_0xee449f[_0xd4ca('0x2d')]);_0x55a765['filters']=_[_0xd4ca('0x30')](_0x55a765[_0xd4ca('0x2c')],_0x55a765[_0xd4ca('0x2d')]);_0x5129f1[_0xd4ca('0x32')]=_[_0xd4ca('0x30')](_0x55a765[_0xd4ca('0x2c')],qs['fields'](_0xee449f['query'][_0xd4ca('0x31')]));_0x5129f1['attributes']=_0x5129f1['attributes'][_0xd4ca('0x33')]?_0x5129f1[_0xd4ca('0x32')]:_0x55a765['model'];_0x5129f1['order']=qs[_0xd4ca('0x35')](_0xee449f[_0xd4ca('0x2d')][_0xd4ca('0x35')]);_0x5129f1['where']=qs['filters'](_[_0xd4ca('0x37')](_0xee449f[_0xd4ca('0x2d')],_0x55a765['filters']));if(_0xee449f[_0xd4ca('0x2d')][_0xd4ca('0x48')]){_0x5129f1[_0xd4ca('0x36')]=_['merge'](_0x5129f1['where'],{'$or':_['map'](_0x5129f1[_0xd4ca('0x32')],function(_0x5b2b87){var _0x5617ab={};_0x5617ab[_0x5b2b87]={'$like':'%'+_0xee449f[_0xd4ca('0x2d')]['filter']+'%'};return _0x5617ab;})});}_0x5129f1=_[_0xd4ca('0x38')]({},_0x5129f1,_0xee449f['options']);return _0x1f6307['getDescriptions'](_0x5129f1);}})['then'](function(_0x3f6b2c){if(_0x3f6b2c){_0x495a0c=_0x3f6b2c[_0xd4ca('0x33')];if(!_0xee449f[_0xd4ca('0x2d')]['hasOwnProperty']('nolimit')){_0x5129f1['limit']=qs[_0xd4ca('0x1b')](_0xee449f['query']['limit']);_0x5129f1['offset']=qs[_0xd4ca('0x19')](_0xee449f[_0xd4ca('0x2d')][_0xd4ca('0x19')]);}return _0x1f6307[_0xd4ca('0x4d')](_0x5129f1);}})[_0xd4ca('0x22')](function(_0x126fc9){if(_0x126fc9){return _0x126fc9?{'count':_0x495a0c,'rows':_0x126fc9}:null;}})[_0xd4ca('0x22')](respondWithResult(_0x1e927f,null))[_0xd4ca('0x40')](handleError(_0x1e927f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 8ed405a..fcae7c8 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 _0x82aa=['rimraf','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x82aa,0x1da));var _0xa82a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x82aa[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xa82a('0x0'));var util=require(_0xa82a('0x1'));var logger=require(_0xa82a('0x2'))(_0xa82a('0x3'));var moment=require(_0xa82a('0x4'));var BPromise=require(_0xa82a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa82a('0x6'));var config=require(_0xa82a('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xa82a('0x8')]=function(_0x359fc5,_0x53bba1){return _0x359fc5[_0xa82a('0x9')](_0xa82a('0xa'),attributes,{'tableName':_0xa82a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf72a=['api','moment','bluebird','request-promise','rimraf','../../config/environment','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger'];(function(_0x20ddbd,_0x27da91){var _0x5cdf4c=function(_0x24780d){while(--_0x24780d){_0x20ddbd['push'](_0x20ddbd['shift']());}};_0x5cdf4c(++_0x27da91);}(_0xf72a,0xcf));var _0xaf72=function(_0x38559b,_0x520985){_0x38559b=_0x38559b-0x0;var _0x46698d=_0xf72a[_0x38559b];return _0x46698d;};'use strict';var _=require('lodash');var util=require(_0xaf72('0x0'));var logger=require(_0xaf72('0x1'))(_0xaf72('0x2'));var moment=require(_0xaf72('0x3'));var BPromise=require(_0xaf72('0x4'));var rp=require(_0xaf72('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf72('0x6'));var config=require(_0xaf72('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x9fbc39,_0x2a3bf1){return _0x9fbc39[_0xaf72('0x8')](_0xaf72('0x9'),attributes,{'tableName':_0xaf72('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 9426d35..a46b198 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 _0x404f=['../../config/environment','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xdc3fc6,_0x11bd84){var _0x3128c4=function(_0xea0e68){while(--_0xea0e68){_0xdc3fc6['push'](_0xdc3fc6['shift']());}};_0x3128c4(++_0x11bd84);}(_0x404f,0x12d));var _0xf404=function(_0x542318,_0x49ac00){_0x542318=_0x542318-0x0;var _0x1d3987=_0x404f[_0x542318];return _0x1d3987;};'use strict';var _=require(_0xf404('0x0'));var util=require(_0xf404('0x1'));var moment=require('moment');var BPromise=require(_0xf404('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf404('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf404('0x4'));var logger=require(_0xf404('0x5'))(_0xf404('0x6'));var config=require(_0xf404('0x7'));var jayson=require(_0xf404('0x8'));var client=jayson['client'][_0xf404('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x339db0,_0xabc7d7,_0x37cc49){return new BPromise(function(_0xdf1fed,_0x57142f){return client[_0xf404('0xa')](_0x339db0,_0x37cc49)[_0xf404('0xb')](function(_0x13d043){logger[_0xf404('0xc')](_0xf404('0xd'),_0xabc7d7,_0xf404('0xe'));logger[_0xf404('0xf')](_0xf404('0x10'),_0xabc7d7,_0xf404('0xe'),JSON['stringify'](_0x13d043));if(_0x13d043[_0xf404('0x11')]){if(_0x13d043[_0xf404('0x11')][_0xf404('0x12')]===0x1f4){logger['error'](_0xf404('0xd'),_0xabc7d7,_0x13d043[_0xf404('0x11')][_0xf404('0x13')]);return _0x57142f(_0x13d043[_0xf404('0x11')][_0xf404('0x13')]);}logger[_0xf404('0x11')](_0xf404('0xd'),_0xabc7d7,_0x13d043[_0xf404('0x11')]['message']);return _0xdf1fed(_0x13d043['error'][_0xf404('0x13')]);}else{logger['info'](_0xf404('0xd'),_0xabc7d7,_0xf404('0xe'));_0xdf1fed(_0x13d043[_0xf404('0x14')][_0xf404('0x13')]);}})[_0xf404('0x15')](function(_0x408214){logger[_0xf404('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0xabc7d7,_0x408214);_0x57142f(_0x408214);});});} \ No newline at end of file +var _0xee6d=['../../mysqldb','rpc','../../config/environment','client','http','request','debug','request\x20sent','stringify','error','code','message','info','VtigerConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x331399,_0x5cc045){var _0x2ba8a9=function(_0x4ef7e3){while(--_0x4ef7e3){_0x331399['push'](_0x331399['shift']());}};_0x2ba8a9(++_0x5cc045);}(_0xee6d,0x94));var _0xdee6=function(_0xa9c400,_0x5e39e5){_0xa9c400=_0xa9c400-0x0;var _0x34651e=_0xee6d[_0xa9c400];return _0x34651e;};'use strict';var _=require(_0xdee6('0x0'));var util=require(_0xdee6('0x1'));var moment=require(_0xdee6('0x2'));var BPromise=require(_0xdee6('0x3'));var rs=require(_0xdee6('0x4'));var fs=require('fs');var Redis=require(_0xdee6('0x5'));var db=require(_0xdee6('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdee6('0x7'));var config=require(_0xdee6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdee6('0x9')][_0xdee6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x320eb3,_0x3c8a4e,_0x5512b1){return new BPromise(function(_0x14c455,_0x58d369){return client[_0xdee6('0xb')](_0x320eb3,_0x5512b1)['then'](function(_0x264359){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x3c8a4e,'request\x20sent');logger[_0xdee6('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3c8a4e,_0xdee6('0xd'),JSON[_0xdee6('0xe')](_0x264359));if(_0x264359[_0xdee6('0xf')]){if(_0x264359['error'][_0xdee6('0x10')]===0x1f4){logger[_0xdee6('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x3c8a4e,_0x264359[_0xdee6('0xf')][_0xdee6('0x11')]);return _0x58d369(_0x264359[_0xdee6('0xf')][_0xdee6('0x11')]);}logger[_0xdee6('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x3c8a4e,_0x264359[_0xdee6('0xf')][_0xdee6('0x11')]);return _0x14c455(_0x264359['error'][_0xdee6('0x11')]);}else{logger[_0xdee6('0x12')](_0xdee6('0x13'),_0x3c8a4e,_0xdee6('0xd'));_0x14c455(_0x264359[_0xdee6('0x14')][_0xdee6('0x11')]);}})[_0xdee6('0x15')](function(_0x5f2e24){logger[_0xdee6('0xf')](_0xdee6('0x13'),_0x3c8a4e,_0x5f2e24);_0x58d369(_0x5f2e24);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index f009bef..8b1250f 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 _0xbed3=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intVtigerField.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xbed3,0x10f));var _0x3bed=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbed3[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x3bed('0x0'));var util=require('util');var path=require(_0x3bed('0x1'));var timeout=require(_0x3bed('0x2'));var express=require(_0x3bed('0x3'));var router=express[_0x3bed('0x4')]();var fs_extra=require(_0x3bed('0x5'));var auth=require(_0x3bed('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3bed('0x7'));router['get']('/',auth[_0x3bed('0x8')](),controller[_0x3bed('0x9')]);router[_0x3bed('0xa')](_0x3bed('0xb'),auth[_0x3bed('0x8')](),controller['show']);router[_0x3bed('0xc')]('/',auth[_0x3bed('0x8')](),controller[_0x3bed('0xd')]);router[_0x3bed('0xe')](_0x3bed('0xb'),auth[_0x3bed('0x8')](),controller[_0x3bed('0xf')]);router[_0x3bed('0x10')](_0x3bed('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x3bed('0x11')]=router; \ No newline at end of file +var _0xedf4=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x412dd8,_0x355780){var _0x47b96=function(_0x58b680){while(--_0x58b680){_0x412dd8['push'](_0x412dd8['shift']());}};_0x47b96(++_0x355780);}(_0xedf4,0x18b));var _0x4edf=function(_0x308125,_0x151630){_0x308125=_0x308125-0x0;var _0x50883c=_0xedf4[_0x308125];return _0x50883c;};'use strict';var multer=require(_0x4edf('0x0'));var util=require(_0x4edf('0x1'));var path=require('path');var timeout=require(_0x4edf('0x2'));var express=require(_0x4edf('0x3'));var router=express[_0x4edf('0x4')]();var fs_extra=require(_0x4edf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4edf('0x6'));var config=require(_0x4edf('0x7'));var controller=require(_0x4edf('0x8'));router[_0x4edf('0x9')]('/',auth[_0x4edf('0xa')](),controller[_0x4edf('0xb')]);router[_0x4edf('0x9')](_0x4edf('0xc'),auth[_0x4edf('0xa')](),controller['show']);router['post']('/',auth[_0x4edf('0xa')](),controller[_0x4edf('0xd')]);router[_0x4edf('0xe')](_0x4edf('0xc'),auth[_0x4edf('0xa')](),controller[_0x4edf('0xf')]);router[_0x4edf('0x10')](_0x4edf('0xc'),auth['isAuthenticated'](),controller[_0x4edf('0x11')]);module[_0x4edf('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 394a91d..c9efbae 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 _0x6774=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x5baf82,_0x52df08){var _0x2e83ea=function(_0x23c822){while(--_0x23c822){_0x5baf82['push'](_0x5baf82['shift']());}};_0x2e83ea(++_0x52df08);}(_0x6774,0xc7));var _0x4677=function(_0x457647,_0xf944ac){_0x457647=_0x457647-0x0;var _0x440eb1=_0x6774[_0x457647];return _0x440eb1;};'use strict';var Sequelize=require(_0x4677('0x0'));module[_0x4677('0x1')]={'type':{'type':Sequelize[_0x4677('0x2')](_0x4677('0x3'),_0x4677('0x4'),_0x4677('0x5'),'keyValue',_0x4677('0x6')),'defaultValue':_0x4677('0x3')},'content':{'type':Sequelize[_0x4677('0x7')]},'key':{'type':Sequelize[_0x4677('0x7')]},'keyType':{'type':Sequelize[_0x4677('0x2')](_0x4677('0x3'),_0x4677('0x4'),_0x4677('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4677('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4677('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4677('0x7')]}}; \ No newline at end of file +var _0xb8a0=['picklist','string','STRING','BOOLEAN','ENUM','variable','customVariable','keyValue'];(function(_0x4560a1,_0x4bab97){var _0x4bab23=function(_0x2c247c){while(--_0x2c247c){_0x4560a1['push'](_0x4560a1['shift']());}};_0x4bab23(++_0x4bab97);}(_0xb8a0,0xdc));var _0x0b8a=function(_0x5f367a,_0x8a10af){_0x5f367a=_0x5f367a-0x0;var _0x1887fc=_0xb8a0[_0x5f367a];return _0x1887fc;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x0b8a('0x0')]('string',_0x0b8a('0x1'),_0x0b8a('0x2'),_0x0b8a('0x3'),_0x0b8a('0x4')),'defaultValue':_0x0b8a('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0b8a('0x6')]},'keyType':{'type':Sequelize[_0x0b8a('0x0')](_0x0b8a('0x5'),_0x0b8a('0x1'),_0x0b8a('0x2'))},'keyContent':{'type':Sequelize[_0x0b8a('0x6')]},'idField':{'type':Sequelize[_0x0b8a('0x6')]},'nameField':{'type':Sequelize[_0x0b8a('0x6')]},'customField':{'type':Sequelize[_0x0b8a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0b8a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 01fb0e6..407b216 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 _0x65f6=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','VtigerField','rawAttributes','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','include','findAll','rows','catch','show','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x65f6,0x77));var _0x665f=function(_0x532c54,_0x54f860){_0x532c54=_0x532c54-0x0;var _0x5887e5=_0x65f6[_0x532c54];return _0x5887e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x665f('0x0'));var zipdir=require(_0x665f('0x1'));var jsonpatch=require(_0x665f('0x2'));var rp=require(_0x665f('0x3'));var moment=require(_0x665f('0x4'));var BPromise=require(_0x665f('0x5'));var Mustache=require('mustache');var util=require(_0x665f('0x6'));var path=require('path');var sox=require(_0x665f('0x7'));var csv=require(_0x665f('0x8'));var ejs=require(_0x665f('0x9'));var fs=require('fs');var fs_extra=require(_0x665f('0xa'));var _=require('lodash');var squel=require(_0x665f('0xb'));var crypto=require(_0x665f('0xc'));var jsforce=require(_0x665f('0xd'));var deskjs=require(_0x665f('0xe'));var toCsv=require(_0x665f('0x8'));var querystring=require(_0x665f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x665f('0x10'));var as=require(_0x665f('0x11'));var hardwareService=require(_0x665f('0x12'));var logger=require(_0x665f('0x13'))(_0x665f('0x14'));var utils=require(_0x665f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x665f('0x16'));var db=require(_0x665f('0x17'))['db'];function respondWithStatusCode(_0x2b64d5,_0x4e7286){_0x4e7286=_0x4e7286||0xcc;return function(_0x2cc1f8){if(_0x2cc1f8){return _0x2b64d5[_0x665f('0x18')](_0x4e7286);}return _0x2b64d5[_0x665f('0x19')](_0x4e7286)[_0x665f('0x1a')]();};}function respondWithResult(_0x2ff680,_0x16f677){_0x16f677=_0x16f677||0xc8;return function(_0x58f48c){if(_0x58f48c){return _0x2ff680[_0x665f('0x19')](_0x16f677)[_0x665f('0x1b')](_0x58f48c);}};}function respondWithFilteredResult(_0x5ff7e0,_0x43960a){return function(_0x2fe036){if(_0x2fe036){var _0x13bb64=typeof _0x43960a[_0x665f('0x1c')]===_0x665f('0x1d')&&typeof _0x43960a[_0x665f('0x1e')]==='undefined';var _0x498c9b=_0x2fe036[_0x665f('0x1f')];var _0xfd7b35=_0x13bb64?0x0:_0x43960a[_0x665f('0x1c')];var _0x28ea1e=_0x13bb64?_0x2fe036['count']:_0x43960a[_0x665f('0x1c')]+_0x43960a[_0x665f('0x1e')];var _0x5a9715;if(_0x28ea1e>=_0x498c9b){_0x28ea1e=_0x498c9b;_0x5a9715=0xc8;}else{_0x5a9715=0xce;}_0x5ff7e0[_0x665f('0x19')](_0x5a9715);return _0x5ff7e0[_0x665f('0x20')](_0x665f('0x21'),_0xfd7b35+'-'+_0x28ea1e+'/'+_0x498c9b)[_0x665f('0x1b')](_0x2fe036);}return null;};}function patchUpdates(_0x389516){return function(_0x44afde){try{jsonpatch[_0x665f('0x22')](_0x44afde,_0x389516,!![]);}catch(_0x45b448){return BPromise[_0x665f('0x23')](_0x45b448);}return _0x44afde[_0x665f('0x24')]();};}function saveUpdates(_0x4ad07e,_0x32eb12){return function(_0x2c0370){if(_0x2c0370){return _0x2c0370[_0x665f('0x25')](_0x4ad07e)[_0x665f('0x26')](function(_0x4483af){return _0x4483af;});}return null;};}function removeEntity(_0x841de,_0x4cc8ec){return function(_0x270e36){if(_0x270e36){return _0x270e36[_0x665f('0x27')]()[_0x665f('0x26')](function(){_0x841de[_0x665f('0x19')](0xcc)[_0x665f('0x1a')]();});}};}function handleEntityNotFound(_0x9d1e8d,_0x40ff2b){return function(_0x538529){if(!_0x538529){_0x9d1e8d[_0x665f('0x18')](0x194);}return _0x538529;};}function handleError(_0x4d685c,_0x462bcd){_0x462bcd=_0x462bcd||0x1f4;return function(_0x1e2f6d){logger['error'](_0x1e2f6d[_0x665f('0x28')]);if(_0x1e2f6d['name']){delete _0x1e2f6d[_0x665f('0x29')];}_0x4d685c['status'](_0x462bcd)['send'](_0x1e2f6d);};}exports[_0x665f('0x2a')]=function(_0x5bc5a4,_0x2e8ff3){var _0x4b94f4={},_0x2bff02={},_0x3abc91={'count':0x0,'rows':[]};var _0x5b1821=_[_0x665f('0x2b')](db[_0x665f('0x2c')][_0x665f('0x2d')],function(_0x1c2cfc){return{'name':_0x1c2cfc['fieldName'],'type':_0x1c2cfc['type']['key']};});_0x2bff02['model']=_[_0x665f('0x2b')](_0x5b1821,_0x665f('0x29'));_0x2bff02['query']=_[_0x665f('0x2e')](_0x5bc5a4['query']);_0x2bff02[_0x665f('0x2f')]=_[_0x665f('0x30')](_0x2bff02[_0x665f('0x31')],_0x2bff02[_0x665f('0x32')]);_0x4b94f4['attributes']=_['intersection'](_0x2bff02[_0x665f('0x31')],qs[_0x665f('0x33')](_0x5bc5a4['query'][_0x665f('0x33')]));_0x4b94f4['attributes']=_0x4b94f4[_0x665f('0x34')][_0x665f('0x35')]?_0x4b94f4['attributes']:_0x2bff02[_0x665f('0x31')];if(!_0x5bc5a4[_0x665f('0x32')][_0x665f('0x36')](_0x665f('0x37'))){_0x4b94f4[_0x665f('0x1e')]=qs[_0x665f('0x1e')](_0x5bc5a4[_0x665f('0x32')][_0x665f('0x1e')]);_0x4b94f4[_0x665f('0x1c')]=qs[_0x665f('0x1c')](_0x5bc5a4['query'][_0x665f('0x1c')]);}_0x4b94f4['order']=qs[_0x665f('0x38')](_0x5bc5a4[_0x665f('0x32')][_0x665f('0x38')]);_0x4b94f4[_0x665f('0x39')]=qs['filters'](_['pick'](_0x5bc5a4[_0x665f('0x32')],_0x2bff02[_0x665f('0x2f')]),_0x5b1821);if(_0x5bc5a4[_0x665f('0x32')][_0x665f('0x3a')]){_0x4b94f4['where']=_[_0x665f('0x3b')](_0x4b94f4['where'],{'$or':_['map'](_0x5b1821,function(_0x2b2017){if(_0x2b2017[_0x665f('0x3c')]!=='VIRTUAL'){var _0x10b286={};_0x10b286[_0x2b2017['name']]={'$like':'%'+_0x5bc5a4[_0x665f('0x32')][_0x665f('0x3a')]+'%'};return _0x10b286;}})});}_0x4b94f4=_['merge']({},_0x4b94f4,_0x5bc5a4[_0x665f('0x3d')]);var _0x30be9d={'where':_0x4b94f4[_0x665f('0x39')]};return db[_0x665f('0x2c')]['count'](_0x30be9d)[_0x665f('0x26')](function(_0x15aeb5){_0x3abc91[_0x665f('0x1f')]=_0x15aeb5;if(_0x5bc5a4[_0x665f('0x32')]['includeAll']){_0x4b94f4[_0x665f('0x3e')]=[{'all':!![]}];}return db[_0x665f('0x2c')][_0x665f('0x3f')](_0x4b94f4);})[_0x665f('0x26')](function(_0x2232fd){_0x3abc91[_0x665f('0x40')]=_0x2232fd;return _0x3abc91;})['then'](respondWithFilteredResult(_0x2e8ff3,_0x4b94f4))[_0x665f('0x41')](handleError(_0x2e8ff3,null));};exports[_0x665f('0x42')]=function(_0x64ebb4,_0x624023){var _0x4e32b4={'raw':!![],'where':{'id':_0x64ebb4['params']['id']}},_0x576772={};_0x576772[_0x665f('0x31')]=_[_0x665f('0x2e')](db['VtigerField']['rawAttributes']);_0x576772['query']=_[_0x665f('0x2e')](_0x64ebb4['query']);_0x576772[_0x665f('0x2f')]=_['intersection'](_0x576772['model'],_0x576772[_0x665f('0x32')]);_0x4e32b4[_0x665f('0x34')]=_['intersection'](_0x576772[_0x665f('0x31')],qs['fields'](_0x64ebb4[_0x665f('0x32')][_0x665f('0x33')]));_0x4e32b4[_0x665f('0x34')]=_0x4e32b4[_0x665f('0x34')][_0x665f('0x35')]?_0x4e32b4[_0x665f('0x34')]:_0x576772['model'];if(_0x64ebb4[_0x665f('0x32')]['includeAll']){_0x4e32b4[_0x665f('0x3e')]=[{'all':!![]}];}_0x4e32b4=_['merge']({},_0x4e32b4,_0x64ebb4[_0x665f('0x3d')]);return db[_0x665f('0x2c')][_0x665f('0x43')](_0x4e32b4)[_0x665f('0x26')](handleEntityNotFound(_0x624023,null))[_0x665f('0x26')](respondWithResult(_0x624023,null))[_0x665f('0x41')](handleError(_0x624023,null));};exports['create']=function(_0x110527,_0x3df1ca){return db[_0x665f('0x2c')][_0x665f('0x44')](_0x110527['body'],{})[_0x665f('0x26')](respondWithResult(_0x3df1ca,0xc9))['catch'](handleError(_0x3df1ca,null));};exports[_0x665f('0x25')]=function(_0x359bb8,_0x5874d7){if(_0x359bb8[_0x665f('0x45')]['id']){delete _0x359bb8[_0x665f('0x45')]['id'];}return db[_0x665f('0x2c')]['find']({'where':{'id':_0x359bb8[_0x665f('0x46')]['id']}})['then'](handleEntityNotFound(_0x5874d7,null))[_0x665f('0x26')](saveUpdates(_0x359bb8['body'],null))[_0x665f('0x26')](respondWithResult(_0x5874d7,null))[_0x665f('0x41')](handleError(_0x5874d7,null));};exports[_0x665f('0x27')]=function(_0x4714b0,_0x51077b){return db[_0x665f('0x2c')][_0x665f('0x43')]({'where':{'id':_0x4714b0[_0x665f('0x46')]['id']}})[_0x665f('0x26')](handleEntityNotFound(_0x51077b,null))[_0x665f('0x26')](removeEntity(_0x51077b,null))[_0x665f('0x41')](handleError(_0x51077b,null));}; \ No newline at end of file +var _0x26fd=['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','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','filter','include','findAll','rows','show','params','keys','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x5f5cce,_0x138cc5){var _0x705ecf=function(_0x28bc5d){while(--_0x28bc5d){_0x5f5cce['push'](_0x5f5cce['shift']());}};_0x705ecf(++_0x138cc5);}(_0x26fd,0x12a));var _0xd26f=function(_0x229a9d,_0x4d3229){_0x229a9d=_0x229a9d-0x0;var _0x5bd600=_0x26fd[_0x229a9d];return _0x5bd600;};'use strict';var emlformat=require(_0xd26f('0x0'));var rimraf=require(_0xd26f('0x1'));var zipdir=require(_0xd26f('0x2'));var jsonpatch=require(_0xd26f('0x3'));var rp=require(_0xd26f('0x4'));var moment=require(_0xd26f('0x5'));var BPromise=require(_0xd26f('0x6'));var Mustache=require('mustache');var util=require(_0xd26f('0x7'));var path=require(_0xd26f('0x8'));var sox=require(_0xd26f('0x9'));var csv=require(_0xd26f('0xa'));var ejs=require(_0xd26f('0xb'));var fs=require('fs');var fs_extra=require(_0xd26f('0xc'));var _=require(_0xd26f('0xd'));var squel=require(_0xd26f('0xe'));var crypto=require(_0xd26f('0xf'));var jsforce=require(_0xd26f('0x10'));var deskjs=require(_0xd26f('0x11'));var toCsv=require(_0xd26f('0xa'));var querystring=require('querystring');var Papa=require(_0xd26f('0x12'));var Redis=require(_0xd26f('0x13'));var authService=require(_0xd26f('0x14'));var qs=require(_0xd26f('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd26f('0x16'));var logger=require(_0xd26f('0x17'))(_0xd26f('0x18'));var utils=require(_0xd26f('0x19'));var config=require(_0xd26f('0x1a'));var licenseUtil=require(_0xd26f('0x1b'));var db=require(_0xd26f('0x1c'))['db'];function respondWithStatusCode(_0x42af72,_0x441db1){_0x441db1=_0x441db1||0xcc;return function(_0x29cd1b){if(_0x29cd1b){return _0x42af72[_0xd26f('0x1d')](_0x441db1);}return _0x42af72[_0xd26f('0x1e')](_0x441db1)[_0xd26f('0x1f')]();};}function respondWithResult(_0x20d25c,_0x452f8a){_0x452f8a=_0x452f8a||0xc8;return function(_0x159236){if(_0x159236){return _0x20d25c[_0xd26f('0x1e')](_0x452f8a)['json'](_0x159236);}};}function respondWithFilteredResult(_0x54dd4b,_0x4af602){return function(_0x48f9b8){if(_0x48f9b8){var _0x3fb96a=typeof _0x4af602[_0xd26f('0x20')]===_0xd26f('0x21')&&typeof _0x4af602[_0xd26f('0x22')]===_0xd26f('0x21');var _0xa0f96c=_0x48f9b8[_0xd26f('0x23')];var _0x1a6b74=_0x3fb96a?0x0:_0x4af602['offset'];var _0x58c645=_0x3fb96a?_0x48f9b8[_0xd26f('0x23')]:_0x4af602[_0xd26f('0x20')]+_0x4af602[_0xd26f('0x22')];var _0x5e740e;if(_0x58c645>=_0xa0f96c){_0x58c645=_0xa0f96c;_0x5e740e=0xc8;}else{_0x5e740e=0xce;}_0x54dd4b[_0xd26f('0x1e')](_0x5e740e);return _0x54dd4b[_0xd26f('0x24')](_0xd26f('0x25'),_0x1a6b74+'-'+_0x58c645+'/'+_0xa0f96c)[_0xd26f('0x26')](_0x48f9b8);}return null;};}function patchUpdates(_0x1b2a41){return function(_0x2421fa){try{jsonpatch[_0xd26f('0x27')](_0x2421fa,_0x1b2a41,!![]);}catch(_0x5abcaf){return BPromise['reject'](_0x5abcaf);}return _0x2421fa[_0xd26f('0x28')]();};}function saveUpdates(_0x2bc7da,_0x2a950d){return function(_0x588d2b){if(_0x588d2b){return _0x588d2b[_0xd26f('0x29')](_0x2bc7da)[_0xd26f('0x2a')](function(_0x2bf940){return _0x2bf940;});}return null;};}function removeEntity(_0x54badd,_0x4ee467){return function(_0x1efec0){if(_0x1efec0){return _0x1efec0[_0xd26f('0x2b')]()['then'](function(){_0x54badd[_0xd26f('0x1e')](0xcc)[_0xd26f('0x1f')]();});}};}function handleEntityNotFound(_0x1e91b1,_0x175468){return function(_0x1c5600){if(!_0x1c5600){_0x1e91b1['sendStatus'](0x194);}return _0x1c5600;};}function handleError(_0x1372b7,_0x2506e7){_0x2506e7=_0x2506e7||0x1f4;return function(_0x58fdaa){logger['error'](_0x58fdaa[_0xd26f('0x2c')]);if(_0x58fdaa[_0xd26f('0x2d')]){delete _0x58fdaa[_0xd26f('0x2d')];}_0x1372b7[_0xd26f('0x1e')](_0x2506e7)[_0xd26f('0x2e')](_0x58fdaa);};}exports[_0xd26f('0x2f')]=function(_0x48822d,_0x401808){var _0x24b5e4={},_0x5ba569={},_0x349640={'count':0x0,'rows':[]};var _0x5364ec=_[_0xd26f('0x30')](db[_0xd26f('0x31')][_0xd26f('0x32')],function(_0x215c8a){return{'name':_0x215c8a[_0xd26f('0x33')],'type':_0x215c8a[_0xd26f('0x34')][_0xd26f('0x35')]};});_0x5ba569[_0xd26f('0x36')]=_[_0xd26f('0x30')](_0x5364ec,_0xd26f('0x2d'));_0x5ba569['query']=_['keys'](_0x48822d[_0xd26f('0x37')]);_0x5ba569[_0xd26f('0x38')]=_[_0xd26f('0x39')](_0x5ba569['model'],_0x5ba569[_0xd26f('0x37')]);_0x24b5e4[_0xd26f('0x3a')]=_[_0xd26f('0x39')](_0x5ba569['model'],qs[_0xd26f('0x3b')](_0x48822d['query'][_0xd26f('0x3b')]));_0x24b5e4[_0xd26f('0x3a')]=_0x24b5e4[_0xd26f('0x3a')][_0xd26f('0x3c')]?_0x24b5e4[_0xd26f('0x3a')]:_0x5ba569['model'];if(!_0x48822d[_0xd26f('0x37')][_0xd26f('0x3d')]('nolimit')){_0x24b5e4[_0xd26f('0x22')]=qs[_0xd26f('0x22')](_0x48822d['query'][_0xd26f('0x22')]);_0x24b5e4[_0xd26f('0x20')]=qs[_0xd26f('0x20')](_0x48822d['query'][_0xd26f('0x20')]);}_0x24b5e4[_0xd26f('0x3e')]=qs['sort'](_0x48822d[_0xd26f('0x37')]['sort']);_0x24b5e4[_0xd26f('0x3f')]=qs[_0xd26f('0x38')](_['pick'](_0x48822d[_0xd26f('0x37')],_0x5ba569[_0xd26f('0x38')]),_0x5364ec);if(_0x48822d[_0xd26f('0x37')][_0xd26f('0x40')]){_0x24b5e4[_0xd26f('0x3f')]=_['merge'](_0x24b5e4[_0xd26f('0x3f')],{'$or':_[_0xd26f('0x30')](_0x5364ec,function(_0x2626b2){if(_0x2626b2['type']!=='VIRTUAL'){var _0x11078d={};_0x11078d[_0x2626b2[_0xd26f('0x2d')]]={'$like':'%'+_0x48822d[_0xd26f('0x37')]['filter']+'%'};return _0x11078d;}})});}_0x24b5e4=_['merge']({},_0x24b5e4,_0x48822d['options']);var _0x624cee={'where':_0x24b5e4[_0xd26f('0x3f')]};return db[_0xd26f('0x31')][_0xd26f('0x23')](_0x624cee)[_0xd26f('0x2a')](function(_0x3e1abf){_0x349640['count']=_0x3e1abf;if(_0x48822d[_0xd26f('0x37')]['includeAll']){_0x24b5e4[_0xd26f('0x41')]=[{'all':!![]}];}return db[_0xd26f('0x31')][_0xd26f('0x42')](_0x24b5e4);})['then'](function(_0x480133){_0x349640[_0xd26f('0x43')]=_0x480133;return _0x349640;})[_0xd26f('0x2a')](respondWithFilteredResult(_0x401808,_0x24b5e4))['catch'](handleError(_0x401808,null));};exports[_0xd26f('0x44')]=function(_0xcb11ac,_0x70aa33){var _0xa868bf={'raw':!![],'where':{'id':_0xcb11ac[_0xd26f('0x45')]['id']}},_0x5af51c={};_0x5af51c['model']=_['keys'](db[_0xd26f('0x31')][_0xd26f('0x32')]);_0x5af51c['query']=_[_0xd26f('0x46')](_0xcb11ac[_0xd26f('0x37')]);_0x5af51c[_0xd26f('0x38')]=_[_0xd26f('0x39')](_0x5af51c[_0xd26f('0x36')],_0x5af51c[_0xd26f('0x37')]);_0xa868bf['attributes']=_[_0xd26f('0x39')](_0x5af51c[_0xd26f('0x36')],qs['fields'](_0xcb11ac['query'][_0xd26f('0x3b')]));_0xa868bf[_0xd26f('0x3a')]=_0xa868bf[_0xd26f('0x3a')][_0xd26f('0x3c')]?_0xa868bf['attributes']:_0x5af51c['model'];if(_0xcb11ac['query']['includeAll']){_0xa868bf[_0xd26f('0x41')]=[{'all':!![]}];}_0xa868bf=_[_0xd26f('0x47')]({},_0xa868bf,_0xcb11ac[_0xd26f('0x48')]);return db[_0xd26f('0x31')][_0xd26f('0x49')](_0xa868bf)[_0xd26f('0x2a')](handleEntityNotFound(_0x70aa33,null))[_0xd26f('0x2a')](respondWithResult(_0x70aa33,null))[_0xd26f('0x4a')](handleError(_0x70aa33,null));};exports[_0xd26f('0x4b')]=function(_0x575f54,_0x3402a9){return db[_0xd26f('0x31')][_0xd26f('0x4b')](_0x575f54[_0xd26f('0x4c')],{})[_0xd26f('0x2a')](respondWithResult(_0x3402a9,0xc9))[_0xd26f('0x4a')](handleError(_0x3402a9,null));};exports[_0xd26f('0x29')]=function(_0x2072aa,_0x51d9ae){if(_0x2072aa['body']['id']){delete _0x2072aa[_0xd26f('0x4c')]['id'];}return db[_0xd26f('0x31')]['find']({'where':{'id':_0x2072aa[_0xd26f('0x45')]['id']}})[_0xd26f('0x2a')](handleEntityNotFound(_0x51d9ae,null))['then'](saveUpdates(_0x2072aa[_0xd26f('0x4c')],null))[_0xd26f('0x2a')](respondWithResult(_0x51d9ae,null))[_0xd26f('0x4a')](handleError(_0x51d9ae,null));};exports['destroy']=function(_0x2f8595,_0x487c83){return db[_0xd26f('0x31')]['find']({'where':{'id':_0x2f8595[_0xd26f('0x45')]['id']}})[_0xd26f('0x2a')](handleEntityNotFound(_0x487c83,null))[_0xd26f('0x2a')](removeEntity(_0x487c83,null))['catch'](handleError(_0x487c83,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 1c6cc40..270ede4 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 _0x3a6d=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','vtiger_unique_index','FieldId'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x3a6d,0x15f));var _0xd3a6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3a6d[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd3a6('0x2'));var BPromise=require(_0xd3a6('0x3'));var rp=require(_0xd3a6('0x4'));var fs=require('fs');var path=require(_0xd3a6('0x5'));var rimraf=require(_0xd3a6('0x6'));var config=require(_0xd3a6('0x7'));var attributes=require(_0xd3a6('0x8'));module[_0xd3a6('0x9')]=function(_0x212956,_0x17b1a7){return _0x212956[_0xd3a6('0xa')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xd3a6('0xb'),'fields':['idField',_0xd3a6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x16a2=['vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','VtigerField','int_vtiger_fields'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x16a2,0x73));var _0x216a=function(_0x271537,_0x8b7b3b){_0x271537=_0x271537-0x0;var _0x19dc22=_0x16a2[_0x271537];return _0x19dc22;};'use strict';var _=require(_0x216a('0x0'));var util=require(_0x216a('0x1'));var logger=require(_0x216a('0x2'))(_0x216a('0x3'));var moment=require('moment');var BPromise=require(_0x216a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x216a('0x5'));var rimraf=require(_0x216a('0x6'));var config=require(_0x216a('0x7'));var attributes=require('./intVtigerField.attributes');module[_0x216a('0x8')]=function(_0x666aff,_0x136829){return _0x666aff['define'](_0x216a('0x9'),attributes,{'tableName':_0x216a('0xa'),'paranoid':![],'indexes':[{'name':_0x216a('0xb'),'fields':[_0x216a('0xc'),_0x216a('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 10e4ae2..5570916 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 _0xe200=['error','code','message','result','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4b280d,_0x4097f8){var _0x2e51f7=function(_0x4f87a2){while(--_0x4f87a2){_0x4b280d['push'](_0x4b280d['shift']());}};_0x2e51f7(++_0x4097f8);}(_0xe200,0x18b));var _0x0e20=function(_0x598ac0,_0x43cb83){_0x598ac0=_0x598ac0-0x0;var _0x557323=_0xe200[_0x598ac0];return _0x557323;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0e20('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e20('0x1'));var db=require(_0x0e20('0x2'))['db'];var utils=require(_0x0e20('0x3'));var logger=require('../../config/logger')(_0x0e20('0x4'));var config=require(_0x0e20('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0e20('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9fb423,_0x5a6d1c,_0x194a65){return new BPromise(function(_0x2bd8d1,_0x59a18c){return client['request'](_0x9fb423,_0x194a65)[_0x0e20('0x7')](function(_0x188b46){logger[_0x0e20('0x8')](_0x0e20('0x9'),_0x5a6d1c,_0x0e20('0xa'));logger['debug'](_0x0e20('0xb'),_0x5a6d1c,_0x0e20('0xa'),JSON[_0x0e20('0xc')](_0x188b46));if(_0x188b46['error']){if(_0x188b46[_0x0e20('0xd')][_0x0e20('0xe')]===0x1f4){logger[_0x0e20('0xd')](_0x0e20('0x9'),_0x5a6d1c,_0x188b46[_0x0e20('0xd')][_0x0e20('0xf')]);return _0x59a18c(_0x188b46[_0x0e20('0xd')][_0x0e20('0xf')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x5a6d1c,_0x188b46[_0x0e20('0xd')][_0x0e20('0xf')]);return _0x2bd8d1(_0x188b46[_0x0e20('0xd')][_0x0e20('0xf')]);}else{logger[_0x0e20('0x8')](_0x0e20('0x9'),_0x5a6d1c,'request\x20sent');_0x2bd8d1(_0x188b46[_0x0e20('0x10')][_0x0e20('0xf')]);}})['catch'](function(_0x4a83d4){logger[_0x0e20('0xd')](_0x0e20('0x9'),_0x5a6d1c,_0x4a83d4);_0x59a18c(_0x4a83d4);});});} \ No newline at end of file +var _0xc94a=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0xc94a,0x14a));var _0xac94=function(_0x14e730,_0x46b6ff){_0x14e730=_0x14e730-0x0;var _0x3fae2d=_0xc94a[_0x14e730];return _0x3fae2d;};'use strict';var _=require(_0xac94('0x0'));var util=require(_0xac94('0x1'));var moment=require('moment');var BPromise=require(_0xac94('0x2'));var rs=require(_0xac94('0x3'));var fs=require('fs');var Redis=require(_0xac94('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac94('0x5'));var logger=require(_0xac94('0x6'))(_0xac94('0x7'));var config=require(_0xac94('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xac94('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e07ec,_0x4ccb6c,_0x22b647){return new BPromise(function(_0x313002,_0x38c4d7){return client[_0xac94('0xa')](_0x4e07ec,_0x22b647)[_0xac94('0xb')](function(_0x177dd5){logger[_0xac94('0xc')]('VtigerField,\x20%s,\x20%s',_0x4ccb6c,_0xac94('0xd'));logger['debug'](_0xac94('0xe'),_0x4ccb6c,_0xac94('0xd'),JSON[_0xac94('0xf')](_0x177dd5));if(_0x177dd5['error']){if(_0x177dd5[_0xac94('0x10')][_0xac94('0x11')]===0x1f4){logger[_0xac94('0x10')](_0xac94('0x12'),_0x4ccb6c,_0x177dd5[_0xac94('0x10')][_0xac94('0x13')]);return _0x38c4d7(_0x177dd5[_0xac94('0x10')]['message']);}logger[_0xac94('0x10')](_0xac94('0x12'),_0x4ccb6c,_0x177dd5[_0xac94('0x10')]['message']);return _0x313002(_0x177dd5[_0xac94('0x10')][_0xac94('0x13')]);}else{logger[_0xac94('0xc')](_0xac94('0x12'),_0x4ccb6c,_0xac94('0xd'));_0x313002(_0x177dd5[_0xac94('0x14')][_0xac94('0x13')]);}})[_0xac94('0x15')](function(_0x241dad){logger[_0xac94('0x10')](_0xac94('0x12'),_0x4ccb6c,_0x241dad);_0x38c4d7(_0x241dad);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index b4e3a92..0fa5813 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 _0x7fbc=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','put','delete'];(function(_0x16889b,_0x5624ce){var _0x8bcf73=function(_0x21ca4c){while(--_0x21ca4c){_0x16889b['push'](_0x16889b['shift']());}};_0x8bcf73(++_0x5624ce);}(_0x7fbc,0x73));var _0xc7fb=function(_0x7cfbd0,_0x4d8181){_0x7cfbd0=_0x7cfbd0-0x0;var _0x273fe2=_0x7fbc[_0x7cfbd0];return _0x273fe2;};'use strict';var multer=require('multer');var util=require(_0xc7fb('0x0'));var path=require(_0xc7fb('0x1'));var timeout=require(_0xc7fb('0x2'));var express=require('express');var router=express[_0xc7fb('0x3')]();var fs_extra=require(_0xc7fb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc7fb('0x5'));var config=require(_0xc7fb('0x6'));var controller=require(_0xc7fb('0x7'));router['get']('/',auth[_0xc7fb('0x8')](),controller[_0xc7fb('0x9')]);router[_0xc7fb('0xa')](_0xc7fb('0xb'),auth[_0xc7fb('0x8')](),controller[_0xc7fb('0xc')]);router[_0xc7fb('0xa')](_0xc7fb('0xd'),auth[_0xc7fb('0x8')](),controller[_0xc7fb('0xe')]);router[_0xc7fb('0xa')]('/:id/fields',auth[_0xc7fb('0x8')](),controller[_0xc7fb('0xf')]);router['post']('/',auth[_0xc7fb('0x8')](),controller['create']);router['post'](_0xc7fb('0xd'),auth[_0xc7fb('0x8')](),controller['addConfiguration']);router[_0xc7fb('0x10')]('/:id',auth[_0xc7fb('0x8')](),controller['update']);router[_0xc7fb('0x11')](_0xc7fb('0xb'),auth[_0xc7fb('0x8')](),controller['destroy']);module[_0xc7fb('0x12')]=router; \ No newline at end of file +var _0x57f8=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','/:id','isAuthenticated','show','/:id/fields','post','create','addConfiguration','update','delete','destroy','exports','multer','util'];(function(_0x1d42fa,_0x567cf5){var _0x4a02c9=function(_0x1d0526){while(--_0x1d0526){_0x1d42fa['push'](_0x1d42fa['shift']());}};_0x4a02c9(++_0x567cf5);}(_0x57f8,0x140));var _0x857f=function(_0x4a09a8,_0x4ed12d){_0x4a09a8=_0x4a09a8-0x0;var _0x7d30a9=_0x57f8[_0x4a09a8];return _0x7d30a9;};'use strict';var multer=require(_0x857f('0x0'));var util=require(_0x857f('0x1'));var path=require(_0x857f('0x2'));var timeout=require(_0x857f('0x3'));var express=require(_0x857f('0x4'));var router=express[_0x857f('0x5')]();var fs_extra=require(_0x857f('0x6'));var auth=require(_0x857f('0x7'));var interaction=require(_0x857f('0x8'));var config=require(_0x857f('0x9'));var controller=require(_0x857f('0xa'));router[_0x857f('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x857f('0xb')](_0x857f('0xc'),auth[_0x857f('0xd')](),controller[_0x857f('0xe')]);router[_0x857f('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x857f('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x857f('0x10')]('/',auth[_0x857f('0xd')](),controller[_0x857f('0x11')]);router[_0x857f('0x10')]('/:id/configurations',auth[_0x857f('0xd')](),controller[_0x857f('0x12')]);router['put']('/:id',auth[_0x857f('0xd')](),controller[_0x857f('0x13')]);router[_0x857f('0x14')](_0x857f('0xc'),auth[_0x857f('0xd')](),controller[_0x857f('0x15')]);module[_0x857f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index a1ab561..59fa5e1 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 _0x326f=['integrationTab','newTab','sequelize','STRING','username','remoteUri','ENUM','password','token'];(function(_0x45ed41,_0x30682a){var _0x3afbce=function(_0x4239d4){while(--_0x4239d4){_0x45ed41['push'](_0x45ed41['shift']());}};_0x3afbce(++_0x30682a);}(_0x326f,0xd1));var _0xf326=function(_0x491142,_0xd39be3){_0x491142=_0x491142-0x0;var _0x2481b9=_0x326f[_0x491142];return _0x2481b9;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf326('0x1')]},'username':{'type':Sequelize[_0xf326('0x1')],'unique':_0xf326('0x2')},'password':{'type':Sequelize[_0xf326('0x1')]},'token':{'type':Sequelize[_0xf326('0x1')]},'remoteUri':{'type':Sequelize[_0xf326('0x1')],'unique':_0xf326('0x3')},'authType':{'type':Sequelize[_0xf326('0x4')](_0xf326('0x5'),_0xf326('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xf326('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf326('0x4')](_0xf326('0x7'),_0xf326('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x9af6=['token','integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x9af6,0x1d7));var _0x69af=function(_0xe9f412,_0x5813e3){_0xe9f412=_0xe9f412-0x0;var _0x4eceeb=_0x9af6[_0xe9f412];return _0x4eceeb;};'use strict';var Sequelize=require(_0x69af('0x0'));module[_0x69af('0x1')]={'name':{'type':Sequelize[_0x69af('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x69af('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x69af('0x2')],'unique':_0x69af('0x4')},'authType':{'type':Sequelize[_0x69af('0x5')]('password',_0x69af('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x69af('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x69af('0x5')](_0x69af('0x7'),_0x69af('0x8')),'defaultValue':_0x69af('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 7fe420c..be1a751 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 _0x236c=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','name','index','map','type','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','ZendeskAccount','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','fields','order','nolimit','Subjects','getSubjects','channel','Descriptions','ZendeskConfiguration','ZendeskField','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','headers','%s:%s','toString','Basic\x20%s','%s/token:%s','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format'];(function(_0x50406a,_0x2871ee){var _0xe06568=function(_0xa087a){while(--_0xa087a){_0x50406a['push'](_0x50406a['shift']());}};_0xe06568(++_0x2871ee);}(_0x236c,0x155));var _0xc236=function(_0x3284c6,_0x392da8){_0x3284c6=_0x3284c6-0x0;var _0x334b7d=_0x236c[_0x3284c6];return _0x334b7d;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5b9638,_0x5bce83){_0x5bce83=_0x5bce83||0xcc;return function(_0x599d36){if(_0x599d36){return _0x5b9638[_0xc236('0x18')](_0x5bce83);}return _0x5b9638[_0xc236('0x19')](_0x5bce83)[_0xc236('0x1a')]();};}function respondWithResult(_0x71bce2,_0x5052db){_0x5052db=_0x5052db||0xc8;return function(_0x13a42b){if(_0x13a42b){return _0x71bce2['status'](_0x5052db)['json'](_0x13a42b);}};}function respondWithFilteredResult(_0x9a65e8,_0x32f2fd){return function(_0x443a46){if(_0x443a46){var _0x1aeafc=typeof _0x32f2fd[_0xc236('0x1b')]==='undefined'&&typeof _0x32f2fd['limit']==='undefined';var _0x3f5884=_0x443a46[_0xc236('0x1c')];var _0x11ec65=_0x1aeafc?0x0:_0x32f2fd['offset'];var _0x13b432=_0x1aeafc?_0x443a46['count']:_0x32f2fd['offset']+_0x32f2fd[_0xc236('0x1d')];var _0x30adeb;if(_0x13b432>=_0x3f5884){_0x13b432=_0x3f5884;_0x30adeb=0xc8;}else{_0x30adeb=0xce;}_0x9a65e8[_0xc236('0x19')](_0x30adeb);return _0x9a65e8[_0xc236('0x1e')](_0xc236('0x1f'),_0x11ec65+'-'+_0x13b432+'/'+_0x3f5884)[_0xc236('0x20')](_0x443a46);}return null;};}function patchUpdates(_0x3f0e2f){return function(_0x27c96a){try{jsonpatch[_0xc236('0x21')](_0x27c96a,_0x3f0e2f,!![]);}catch(_0x32876d){return BPromise[_0xc236('0x22')](_0x32876d);}return _0x27c96a['save']();};}function saveUpdates(_0x208c3f,_0x34d73a){return function(_0x3bd41b){if(_0x3bd41b){return _0x3bd41b[_0xc236('0x23')](_0x208c3f)[_0xc236('0x24')](function(_0x21fab8){return _0x21fab8;});}return null;};}function removeEntity(_0x3a315b,_0xf921e6){return function(_0x1d65e2){if(_0x1d65e2){return _0x1d65e2[_0xc236('0x25')]()[_0xc236('0x24')](function(){_0x3a315b['status'](0xcc)[_0xc236('0x1a')]();});}};}function handleEntityNotFound(_0x21d78f,_0x356042){return function(_0x9017ec){if(!_0x9017ec){_0x21d78f['sendStatus'](0x194);}return _0x9017ec;};}function handleError(_0x42f248,_0x5da4b2){_0x5da4b2=_0x5da4b2||0x1f4;return function(_0x5351bc){logger[_0xc236('0x26')](_0x5351bc['stack']);if(_0x5351bc[_0xc236('0x27')]){delete _0x5351bc['name'];}_0x42f248[_0xc236('0x19')](_0x5da4b2)['send'](_0x5351bc);};}exports[_0xc236('0x28')]=function(_0x1d144b,_0x4f5175){var _0x5a61b5={},_0x265c8d={},_0x1fd31d={'count':0x0,'rows':[]};var _0x1f4995=_[_0xc236('0x29')](db['ZendeskAccount']['rawAttributes'],function(_0x28ffa5){return{'name':_0x28ffa5['fieldName'],'type':_0x28ffa5[_0xc236('0x2a')]['key']};});_0x265c8d[_0xc236('0x2b')]=_[_0xc236('0x29')](_0x1f4995,'name');_0x265c8d['query']=_[_0xc236('0x2c')](_0x1d144b[_0xc236('0x2d')]);_0x265c8d[_0xc236('0x2e')]=_[_0xc236('0x2f')](_0x265c8d[_0xc236('0x2b')],_0x265c8d[_0xc236('0x2d')]);_0x5a61b5[_0xc236('0x30')]=_[_0xc236('0x2f')](_0x265c8d[_0xc236('0x2b')],qs['fields'](_0x1d144b['query']['fields']));_0x5a61b5[_0xc236('0x30')]=_0x5a61b5[_0xc236('0x30')][_0xc236('0x31')]?_0x5a61b5[_0xc236('0x30')]:_0x265c8d[_0xc236('0x2b')];if(!_0x1d144b[_0xc236('0x2d')][_0xc236('0x32')]('nolimit')){_0x5a61b5[_0xc236('0x1d')]=qs[_0xc236('0x1d')](_0x1d144b[_0xc236('0x2d')]['limit']);_0x5a61b5[_0xc236('0x1b')]=qs[_0xc236('0x1b')](_0x1d144b[_0xc236('0x2d')][_0xc236('0x1b')]);}_0x5a61b5['order']=qs[_0xc236('0x33')](_0x1d144b[_0xc236('0x2d')][_0xc236('0x33')]);_0x5a61b5[_0xc236('0x34')]=qs[_0xc236('0x2e')](_[_0xc236('0x35')](_0x1d144b[_0xc236('0x2d')],_0x265c8d[_0xc236('0x2e')]),_0x1f4995);if(_0x1d144b[_0xc236('0x2d')][_0xc236('0x36')]){_0x5a61b5[_0xc236('0x34')]=_[_0xc236('0x37')](_0x5a61b5[_0xc236('0x34')],{'$or':_[_0xc236('0x29')](_0x1f4995,function(_0x12e802){if(_0x12e802[_0xc236('0x2a')]!==_0xc236('0x38')){var _0x4f5490={};_0x4f5490[_0x12e802['name']]={'$like':'%'+_0x1d144b['query']['filter']+'%'};return _0x4f5490;}})});}_0x5a61b5=_[_0xc236('0x37')]({},_0x5a61b5,_0x1d144b['options']);var _0x35905c={'where':_0x5a61b5[_0xc236('0x34')]};return db[_0xc236('0x39')][_0xc236('0x1c')](_0x35905c)[_0xc236('0x24')](function(_0x3b95ec){_0x1fd31d[_0xc236('0x1c')]=_0x3b95ec;if(_0x1d144b[_0xc236('0x2d')][_0xc236('0x3a')]){_0x5a61b5[_0xc236('0x3b')]=[{'all':!![]}];}return db[_0xc236('0x39')][_0xc236('0x3c')](_0x5a61b5);})[_0xc236('0x24')](function(_0x3df25e){_0x1fd31d[_0xc236('0x3d')]=_0x3df25e;return _0x1fd31d;})['then'](respondWithFilteredResult(_0x4f5175,_0x5a61b5))[_0xc236('0x3e')](handleError(_0x4f5175,null));};exports[_0xc236('0x3f')]=function(_0x506ba0,_0xb90a83){var _0x5b0bc5={'raw':![],'where':{'id':_0x506ba0['params']['id']}},_0x1cecc5={};_0x1cecc5[_0xc236('0x2b')]=_[_0xc236('0x2c')](db[_0xc236('0x39')]['rawAttributes']);_0x1cecc5[_0xc236('0x2d')]=_[_0xc236('0x2c')](_0x506ba0[_0xc236('0x2d')]);_0x1cecc5['filters']=_[_0xc236('0x2f')](_0x1cecc5[_0xc236('0x2b')],_0x1cecc5[_0xc236('0x2d')]);_0x5b0bc5[_0xc236('0x30')]=_[_0xc236('0x2f')](_0x1cecc5[_0xc236('0x2b')],qs['fields'](_0x506ba0[_0xc236('0x2d')]['fields']));_0x5b0bc5[_0xc236('0x30')]=_0x5b0bc5[_0xc236('0x30')][_0xc236('0x31')]?_0x5b0bc5[_0xc236('0x30')]:_0x1cecc5[_0xc236('0x2b')];if(_0x506ba0[_0xc236('0x2d')][_0xc236('0x3a')]){_0x5b0bc5['include']=[{'all':!![]}];}_0x5b0bc5=_[_0xc236('0x37')]({},_0x5b0bc5,_0x506ba0['options']);return db[_0xc236('0x39')][_0xc236('0x40')](_0x5b0bc5)['then'](handleEntityNotFound(_0xb90a83,null))[_0xc236('0x24')](respondWithResult(_0xb90a83,null))[_0xc236('0x3e')](handleError(_0xb90a83,null));};exports[_0xc236('0x41')]=function(_0x161890,_0x181dd6){return db[_0xc236('0x39')][_0xc236('0x41')](_0x161890['body'],{})['then'](respondWithResult(_0x181dd6,0xc9))[_0xc236('0x3e')](handleError(_0x181dd6,null));};exports[_0xc236('0x23')]=function(_0x510f7f,_0xcfaa44){if(_0x510f7f[_0xc236('0x42')]['id']){delete _0x510f7f[_0xc236('0x42')]['id'];}return db[_0xc236('0x39')][_0xc236('0x40')]({'where':{'id':_0x510f7f[_0xc236('0x43')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0xcfaa44,null))[_0xc236('0x24')](saveUpdates(_0x510f7f[_0xc236('0x42')],null))['then'](respondWithResult(_0xcfaa44,null))[_0xc236('0x3e')](handleError(_0xcfaa44,null));};exports[_0xc236('0x25')]=function(_0x41b7d5,_0x447a83){return db[_0xc236('0x39')][_0xc236('0x40')]({'where':{'id':_0x41b7d5[_0xc236('0x43')]['id']}})['then'](handleEntityNotFound(_0x447a83,null))[_0xc236('0x24')](removeEntity(_0x447a83,null))[_0xc236('0x3e')](handleError(_0x447a83,null));};exports[_0xc236('0x44')]=function(_0x16ff63,_0x4860d8,_0xa34c01){var _0x3e6da6={};var _0xad71ea={};var _0x2f3d08;var _0x9d81c8;return db['ZendeskAccount'][_0xc236('0x45')]({'where':{'id':_0x16ff63['params']['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x4860d8,null))[_0xc236('0x24')](function(_0x3f9e85){if(_0x3f9e85){_0x2f3d08=_0x3f9e85;_0xad71ea[_0xc236('0x2b')]=_[_0xc236('0x2c')](db['ZendeskConfiguration']['rawAttributes']);_0xad71ea[_0xc236('0x2d')]=_[_0xc236('0x2c')](_0x16ff63[_0xc236('0x2d')]);_0xad71ea[_0xc236('0x2e')]=_[_0xc236('0x2f')](_0xad71ea[_0xc236('0x2b')],_0xad71ea[_0xc236('0x2d')]);_0x3e6da6[_0xc236('0x30')]=_[_0xc236('0x2f')](_0xad71ea[_0xc236('0x2b')],qs['fields'](_0x16ff63['query'][_0xc236('0x46')]));_0x3e6da6[_0xc236('0x30')]=_0x3e6da6[_0xc236('0x30')][_0xc236('0x31')]?_0x3e6da6['attributes']:_0xad71ea[_0xc236('0x2b')];_0x3e6da6[_0xc236('0x47')]=qs['sort'](_0x16ff63[_0xc236('0x2d')][_0xc236('0x33')]);_0x3e6da6[_0xc236('0x34')]=qs[_0xc236('0x2e')](_['pick'](_0x16ff63[_0xc236('0x2d')],_0xad71ea[_0xc236('0x2e')]));if(_0x16ff63[_0xc236('0x2d')][_0xc236('0x36')]){_0x3e6da6[_0xc236('0x34')]=_[_0xc236('0x37')](_0x3e6da6[_0xc236('0x34')],{'$or':_['map'](_0x3e6da6[_0xc236('0x30')],function(_0x4c99a4){var _0x4289c5={};_0x4289c5[_0x4c99a4]={'$like':'%'+_0x16ff63[_0xc236('0x2d')][_0xc236('0x36')]+'%'};return _0x4289c5;})});}_0x3e6da6=_[_0xc236('0x37')]({},_0x3e6da6,_0x16ff63['options']);return _0x2f3d08[_0xc236('0x44')](_0x3e6da6);}})[_0xc236('0x24')](function(_0x379e99){if(_0x379e99){_0x9d81c8=_0x379e99['length'];if(!_0x16ff63[_0xc236('0x2d')][_0xc236('0x32')](_0xc236('0x48'))){_0x3e6da6[_0xc236('0x1d')]=qs[_0xc236('0x1d')](_0x16ff63[_0xc236('0x2d')]['limit']);_0x3e6da6['offset']=qs[_0xc236('0x1b')](_0x16ff63[_0xc236('0x2d')][_0xc236('0x1b')]);}return _0x2f3d08[_0xc236('0x44')](_0x3e6da6);}})[_0xc236('0x24')](function(_0x4649a3){if(_0x4649a3){return _0x4649a3?{'count':_0x9d81c8,'rows':_0x4649a3}:null;}})[_0xc236('0x24')](respondWithResult(_0x4860d8,null))['catch'](handleError(_0x4860d8,null));};exports['addConfiguration']=function(_0x4b59d3,_0x119710,_0x3c11da){if(_0x4b59d3[_0xc236('0x42')]['id']){delete _0x4b59d3[_0xc236('0x42')]['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0x4b59d3['params']['id']}})['then'](handleEntityNotFound(_0x119710,null))[_0xc236('0x24')](function(_0x5df2ba){if(_0x5df2ba){_0x4b59d3[_0xc236('0x42')]['AccountId']=_0x5df2ba['id'];_0x4b59d3[_0xc236('0x42')][_0xc236('0x49')]=integrations[_0xc236('0x4a')](_0x4b59d3[_0xc236('0x42')][_0xc236('0x4b')],_0x4b59d3[_0xc236('0x42')][_0xc236('0x2a')]);_0x4b59d3['body'][_0xc236('0x4c')]=integrations['getDescriptions'](_0x4b59d3[_0xc236('0x42')][_0xc236('0x4b')],_0x4b59d3[_0xc236('0x42')][_0xc236('0x2a')]);return db[_0xc236('0x4d')][_0xc236('0x41')](_0x4b59d3['body'],{'include':[{'model':db[_0xc236('0x4e')],'as':_0xc236('0x49')},{'model':db['ZendeskField'],'as':_0xc236('0x4c')}]});}return null;})[_0xc236('0x24')](respondWithResult(_0x119710,null))[_0xc236('0x3e')](handleError(_0x119710,null));};exports['getFields']=function(_0x226573,_0x45fe5a,_0x5897a1){var _0x2c8f89='';return db[_0xc236('0x39')][_0xc236('0x45')]({'where':{'id':_0x226573[_0xc236('0x43')]['id']},'attributes':['id',_0xc236('0x4f'),_0xc236('0x50'),_0xc236('0x51'),_0xc236('0x52'),_0xc236('0x53')]})['then'](handleEntityNotFound(_0x45fe5a,null))[_0xc236('0x24')](function(_0x2b9fd8){if(_0x2b9fd8){_0x2c8f89=_0x2b9fd8[_0xc236('0x53')];var _0x5d395b=_0x2c8f89[_0xc236('0x54')](-0x1);if(_0x5d395b==='/'){_0x2c8f89=_0x2c8f89[_0xc236('0x55')](0x0,_0x2c8f89[_0xc236('0x56')](_0x5d395b));}var _0x4ef002={'method':'GET','uri':util[_0xc236('0x57')]('%s/%s',_0x2c8f89,_0xc236('0x58')),'json':!![]};switch(_0x2b9fd8['authType']){case _0xc236('0x50'):_0x4ef002[_0xc236('0x59')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0xc236('0x5a'),_0x2b9fd8['username'],_0x2b9fd8[_0xc236('0x50')]))[_0xc236('0x5b')]('base64'))};break;case _0xc236('0x51'):_0x4ef002[_0xc236('0x59')]={'Authorization':util['format'](_0xc236('0x5c'),new Buffer(util[_0xc236('0x57')](_0xc236('0x5d'),_0x2b9fd8[_0xc236('0x4f')],_0x2b9fd8['token']))[_0xc236('0x5b')](_0xc236('0x5e')))};break;default:throw new db[(_0xc236('0x5f'))][(_0xc236('0x60'))](_0xc236('0x61'));}return rp(_0x4ef002);}})[_0xc236('0x24')](function(_0x141497){if(_0x141497){var _0x509f3b=['subject',_0xc236('0x62'),_0xc236('0x63'),_0xc236('0x64')];_[_0xc236('0x65')](_0x141497[_0xc236('0x58')],function(_0x49e417){return _0x509f3b[_0xc236('0x66')](_0x49e417[_0xc236('0x2a')]);});return{'count':_0x141497['ticket_fields']['length'],'rows':_[_0xc236('0x29')](_0x141497['ticket_fields'],function(_0x35e0d8){return{'id':_0x35e0d8['id'],'name':_0x35e0d8[_0xc236('0x67')]>0x7?_0x35e0d8[_0xc236('0x68')]:_0x35e0d8['type'],'custom':_0x35e0d8[_0xc236('0x67')]>0x7?!![]:![],'options':_0x35e0d8['system_field_options']?_0x35e0d8[_0xc236('0x69')]:_0x35e0d8[_0xc236('0x6a')]?_0x35e0d8[_0xc236('0x6a')]:[]};})};}})[_0xc236('0x24')](respondWithResult(_0x45fe5a,null))['catch'](function(_0x41c76d){var _0x22b942=_0x226573['query'][_0xc236('0x6b')]?0x1f4:_0x41c76d[_0xc236('0x6c')]||0x1f4;logger[_0xc236('0x26')](_0xc236('0x6d'),_0xc236('0x6e'),_0x22b942,JSON[_0xc236('0x6f')](_0x41c76d));delete _0x41c76d[_0xc236('0x27')];if(_0x22b942===0x191){_0x22b942=0x190;}_0x45fe5a['status'](_0x22b942)[_0xc236('0x70')](_0x226573[_0xc236('0x2d')][_0xc236('0x6b')]?{'message':_0xc236('0x71'),'statusCode':_0x41c76d['statusCode']}:_0x41c76d);});}; \ No newline at end of file +var _0x1d2d=['position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','send','index','ZendeskAccount','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','filter','options','findAll','catch','includeAll','find','create','body','params','getConfigurations','ZendeskConfiguration','hasOwnProperty','findOne','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','username','token','substring','lastIndexOf','GET','format','%s/%s','authType','password','headers','Basic\x20%s','%s:%s','toString','%s/token:%s','base64','Sequelize','subject','description','group','assignee','ticket_fields','includes'];(function(_0x3a26bd,_0x5f4fcc){var _0x3c9d42=function(_0x497060){while(--_0x497060){_0x3a26bd['push'](_0x3a26bd['shift']());}};_0x3c9d42(++_0x5f4fcc);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x285ea6,_0x3437de){_0x285ea6=_0x285ea6-0x0;var _0x57ce0c=_0x1d2d[_0x285ea6];return _0x57ce0c;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];var integrations=require(_0xd1d2('0x1b'));function respondWithStatusCode(_0x129d8f,_0xc3ee82){_0xc3ee82=_0xc3ee82||0xcc;return function(_0x2df8a5){if(_0x2df8a5){return _0x129d8f[_0xd1d2('0x1c')](_0xc3ee82);}return _0x129d8f[_0xd1d2('0x1d')](_0xc3ee82)[_0xd1d2('0x1e')]();};}function respondWithResult(_0x4cf702,_0x2e7fec){_0x2e7fec=_0x2e7fec||0xc8;return function(_0x3c0296){if(_0x3c0296){return _0x4cf702[_0xd1d2('0x1d')](_0x2e7fec)['json'](_0x3c0296);}};}function respondWithFilteredResult(_0x35381b,_0xc36ce){return function(_0x208425){if(_0x208425){var _0x2f4cf9=typeof _0xc36ce[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0xc36ce[_0xd1d2('0x21')]==='undefined';var _0x539d5a=_0x208425[_0xd1d2('0x22')];var _0x55320b=_0x2f4cf9?0x0:_0xc36ce[_0xd1d2('0x1f')];var _0x42565b=_0x2f4cf9?_0x208425[_0xd1d2('0x22')]:_0xc36ce[_0xd1d2('0x1f')]+_0xc36ce['limit'];var _0x4f1201;if(_0x42565b>=_0x539d5a){_0x42565b=_0x539d5a;_0x4f1201=0xc8;}else{_0x4f1201=0xce;}_0x35381b[_0xd1d2('0x1d')](_0x4f1201);return _0x35381b['set']('Content-Range',_0x55320b+'-'+_0x42565b+'/'+_0x539d5a)[_0xd1d2('0x23')](_0x208425);}return null;};}function patchUpdates(_0x27e26b){return function(_0x3414ce){try{jsonpatch[_0xd1d2('0x24')](_0x3414ce,_0x27e26b,!![]);}catch(_0x596cd8){return BPromise[_0xd1d2('0x25')](_0x596cd8);}return _0x3414ce[_0xd1d2('0x26')]();};}function saveUpdates(_0x24b8db,_0x4eb082){return function(_0x59e72c){if(_0x59e72c){return _0x59e72c[_0xd1d2('0x27')](_0x24b8db)[_0xd1d2('0x28')](function(_0x19d535){return _0x19d535;});}return null;};}function removeEntity(_0x2f92ee,_0x3f229c){return function(_0x33a171){if(_0x33a171){return _0x33a171[_0xd1d2('0x29')]()['then'](function(){_0x2f92ee[_0xd1d2('0x1d')](0xcc)[_0xd1d2('0x1e')]();});}};}function handleEntityNotFound(_0x41330f,_0x2e1709){return function(_0x5d3ee1){if(!_0x5d3ee1){_0x41330f[_0xd1d2('0x1c')](0x194);}return _0x5d3ee1;};}function handleError(_0x28b8be,_0x34faf7){_0x34faf7=_0x34faf7||0x1f4;return function(_0xe6ef3c){logger[_0xd1d2('0x2a')](_0xe6ef3c[_0xd1d2('0x2b')]);if(_0xe6ef3c['name']){delete _0xe6ef3c['name'];}_0x28b8be[_0xd1d2('0x1d')](_0x34faf7)[_0xd1d2('0x2c')](_0xe6ef3c);};}exports[_0xd1d2('0x2d')]=function(_0x2b4c1f,_0xc815ea){var _0x48ade1={},_0x39d694={},_0x41171c={'count':0x0,'rows':[]};var _0x383947=_['map'](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')],function(_0xbd855a){return{'name':_0xbd855a['fieldName'],'type':_0xbd855a[_0xd1d2('0x30')][_0xd1d2('0x31')]};});_0x39d694[_0xd1d2('0x32')]=_[_0xd1d2('0x33')](_0x383947,_0xd1d2('0x34'));_0x39d694[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0x2b4c1f[_0xd1d2('0x35')]);_0x39d694[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],_0x39d694[_0xd1d2('0x35')]);_0x48ade1[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x48ade1['attributes']=_0x48ade1[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x48ade1[_0xd1d2('0x39')]:_0x39d694['model'];if(!_0x2b4c1f[_0xd1d2('0x35')]['hasOwnProperty']('nolimit')){_0x48ade1[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x21')]);_0x48ade1[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x2b4c1f['query'][_0xd1d2('0x1f')]);}_0x48ade1[_0xd1d2('0x3c')]=qs['sort'](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x48ade1[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0x2b4c1f['query'],_0x39d694[_0xd1d2('0x37')]),_0x383947);if(_0x2b4c1f['query']['filter']){_0x48ade1['where']=_[_0xd1d2('0x3f')](_0x48ade1['where'],{'$or':_[_0xd1d2('0x33')](_0x383947,function(_0x4e7640){if(_0x4e7640['type']!=='VIRTUAL'){var _0x2dabfa={};_0x2dabfa[_0x4e7640[_0xd1d2('0x34')]]={'$like':'%'+_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x40')]+'%'};return _0x2dabfa;}})});}_0x48ade1=_[_0xd1d2('0x3f')]({},_0x48ade1,_0x2b4c1f[_0xd1d2('0x41')]);var _0x178f8b={'where':_0x48ade1[_0xd1d2('0x3e')]};return db[_0xd1d2('0x2e')][_0xd1d2('0x22')](_0x178f8b)[_0xd1d2('0x28')](function(_0x1fb5b5){_0x41171c[_0xd1d2('0x22')]=_0x1fb5b5;if(_0x2b4c1f[_0xd1d2('0x35')]['includeAll']){_0x48ade1['include']=[{'all':!![]}];}return db[_0xd1d2('0x2e')][_0xd1d2('0x42')](_0x48ade1);})[_0xd1d2('0x28')](function(_0x4d0fd9){_0x41171c['rows']=_0x4d0fd9;return _0x41171c;})[_0xd1d2('0x28')](respondWithFilteredResult(_0xc815ea,_0x48ade1))[_0xd1d2('0x43')](handleError(_0xc815ea,null));};exports['show']=function(_0x2fe92a,_0x4c5d49){var _0x5a3790={'raw':![],'where':{'id':_0x2fe92a['params']['id']}},_0x21eb24={};_0x21eb24['model']=_[_0xd1d2('0x36')](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')]);_0x21eb24['query']=_[_0xd1d2('0x36')](_0x2fe92a[_0xd1d2('0x35')]);_0x21eb24[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x21eb24['model'],_0x21eb24[_0xd1d2('0x35')]);_0x5a3790[_0xd1d2('0x39')]=_['intersection'](_0x21eb24[_0xd1d2('0x32')],qs['fields'](_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x5a3790[_0xd1d2('0x39')]=_0x5a3790[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x5a3790['attributes']:_0x21eb24['model'];if(_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x44')]){_0x5a3790['include']=[{'all':!![]}];}_0x5a3790=_[_0xd1d2('0x3f')]({},_0x5a3790,_0x2fe92a[_0xd1d2('0x41')]);return db[_0xd1d2('0x2e')][_0xd1d2('0x45')](_0x5a3790)[_0xd1d2('0x28')](handleEntityNotFound(_0x4c5d49,null))[_0xd1d2('0x28')](respondWithResult(_0x4c5d49,null))[_0xd1d2('0x43')](handleError(_0x4c5d49,null));};exports['create']=function(_0xed9e9,_0xc10c10){return db['ZendeskAccount'][_0xd1d2('0x46')](_0xed9e9[_0xd1d2('0x47')],{})['then'](respondWithResult(_0xc10c10,0xc9))['catch'](handleError(_0xc10c10,null));};exports[_0xd1d2('0x27')]=function(_0x182ea8,_0x4cb376){if(_0x182ea8[_0xd1d2('0x47')]['id']){delete _0x182ea8[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x45')]({'where':{'id':_0x182ea8[_0xd1d2('0x48')]['id']}})['then'](handleEntityNotFound(_0x4cb376,null))['then'](saveUpdates(_0x182ea8[_0xd1d2('0x47')],null))['then'](respondWithResult(_0x4cb376,null))[_0xd1d2('0x43')](handleError(_0x4cb376,null));};exports[_0xd1d2('0x29')]=function(_0x4f4cb9,_0x389fcb){return db[_0xd1d2('0x2e')]['find']({'where':{'id':_0x4f4cb9['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x389fcb,null))[_0xd1d2('0x28')](removeEntity(_0x389fcb,null))[_0xd1d2('0x43')](handleError(_0x389fcb,null));};exports[_0xd1d2('0x49')]=function(_0xa013ce,_0x34a793,_0x1f6150){var _0x3411c8={};var _0x33e332={};var _0x5e15cb;var _0x1958f3;return db['ZendeskAccount']['findOne']({'where':{'id':_0xa013ce[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x34a793,null))[_0xd1d2('0x28')](function(_0x47417f){if(_0x47417f){_0x5e15cb=_0x47417f;_0x33e332[_0xd1d2('0x32')]=_[_0xd1d2('0x36')](db[_0xd1d2('0x4a')][_0xd1d2('0x2f')]);_0x33e332[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0xa013ce[_0xd1d2('0x35')]);_0x33e332[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x33e332['model'],_0x33e332['query']);_0x3411c8[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x33e332[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x3411c8[_0xd1d2('0x39')]=_0x3411c8[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x3411c8[_0xd1d2('0x39')]:_0x33e332[_0xd1d2('0x32')];_0x3411c8['order']=qs['sort'](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x3411c8[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0xa013ce[_0xd1d2('0x35')],_0x33e332[_0xd1d2('0x37')]));if(_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x40')]){_0x3411c8[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x3411c8[_0xd1d2('0x3e')],{'$or':_['map'](_0x3411c8[_0xd1d2('0x39')],function(_0x24d92c){var _0x1d8788={};_0x1d8788[_0x24d92c]={'$like':'%'+_0xa013ce['query']['filter']+'%'};return _0x1d8788;})});}_0x3411c8=_[_0xd1d2('0x3f')]({},_0x3411c8,_0xa013ce[_0xd1d2('0x41')]);return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0x598e6c){if(_0x598e6c){_0x1958f3=_0x598e6c[_0xd1d2('0x3b')];if(!_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x4b')]('nolimit')){_0x3411c8[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0xa013ce['query'][_0xd1d2('0x21')]);_0x3411c8[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0xa013ce[_0xd1d2('0x35')]['offset']);}return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0xd82d10){if(_0xd82d10){return _0xd82d10?{'count':_0x1958f3,'rows':_0xd82d10}:null;}})[_0xd1d2('0x28')](respondWithResult(_0x34a793,null))[_0xd1d2('0x43')](handleError(_0x34a793,null));};exports['addConfiguration']=function(_0x47aa13,_0x500465,_0x541676){if(_0x47aa13['body']['id']){delete _0x47aa13[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x47aa13['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x500465,null))[_0xd1d2('0x28')](function(_0x22d617){if(_0x22d617){_0x47aa13['body'][_0xd1d2('0x4d')]=_0x22d617['id'];_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x4e')]=integrations[_0xd1d2('0x4f')](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13['body'][_0xd1d2('0x30')]);_0x47aa13[_0xd1d2('0x47')]['Descriptions']=integrations['getDescriptions'](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x30')]);return db['ZendeskConfiguration'][_0xd1d2('0x46')](_0x47aa13[_0xd1d2('0x47')],{'include':[{'model':db[_0xd1d2('0x51')],'as':_0xd1d2('0x4e')},{'model':db['ZendeskField'],'as':_0xd1d2('0x52')}]});}return null;})[_0xd1d2('0x28')](respondWithResult(_0x500465,null))[_0xd1d2('0x43')](handleError(_0x500465,null));};exports['getFields']=function(_0x46ff4d,_0x1ae9af,_0x4c35cb){var _0x2175ab='';return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x46ff4d[_0xd1d2('0x48')]['id']},'attributes':['id',_0xd1d2('0x53'),'password',_0xd1d2('0x54'),'authType','remoteUri']})['then'](handleEntityNotFound(_0x1ae9af,null))['then'](function(_0x89ec63){if(_0x89ec63){_0x2175ab=_0x89ec63['remoteUri'];var _0x37591f=_0x2175ab['slice'](-0x1);if(_0x37591f==='/'){_0x2175ab=_0x2175ab[_0xd1d2('0x55')](0x0,_0x2175ab[_0xd1d2('0x56')](_0x37591f));}var _0x16cc6c={'method':_0xd1d2('0x57'),'uri':util[_0xd1d2('0x58')](_0xd1d2('0x59'),_0x2175ab,'ticket_fields'),'json':!![]};switch(_0x89ec63[_0xd1d2('0x5a')]){case _0xd1d2('0x5b'):_0x16cc6c[_0xd1d2('0x5c')]={'Authorization':util[_0xd1d2('0x58')](_0xd1d2('0x5d'),new Buffer(util[_0xd1d2('0x58')](_0xd1d2('0x5e'),_0x89ec63[_0xd1d2('0x53')],_0x89ec63[_0xd1d2('0x5b')]))[_0xd1d2('0x5f')]('base64'))};break;case _0xd1d2('0x54'):_0x16cc6c[_0xd1d2('0x5c')]={'Authorization':util[_0xd1d2('0x58')](_0xd1d2('0x5d'),new Buffer(util['format'](_0xd1d2('0x60'),_0x89ec63[_0xd1d2('0x53')],_0x89ec63[_0xd1d2('0x54')]))['toString'](_0xd1d2('0x61')))};break;default:throw new db[(_0xd1d2('0x62'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x16cc6c);}})[_0xd1d2('0x28')](function(_0x268d6d){if(_0x268d6d){var _0x3fbd87=[_0xd1d2('0x63'),_0xd1d2('0x64'),_0xd1d2('0x65'),_0xd1d2('0x66')];_['remove'](_0x268d6d[_0xd1d2('0x67')],function(_0x9a98d4){return _0x3fbd87[_0xd1d2('0x68')](_0x9a98d4[_0xd1d2('0x30')]);});return{'count':_0x268d6d[_0xd1d2('0x67')][_0xd1d2('0x3b')],'rows':_[_0xd1d2('0x33')](_0x268d6d[_0xd1d2('0x67')],function(_0x44409e){return{'id':_0x44409e['id'],'name':_0x44409e[_0xd1d2('0x69')]>0x7?_0x44409e[_0xd1d2('0x6a')]:_0x44409e[_0xd1d2('0x30')],'custom':_0x44409e[_0xd1d2('0x69')]>0x7?!![]:![],'options':_0x44409e[_0xd1d2('0x6b')]?_0x44409e['system_field_options']:_0x44409e[_0xd1d2('0x6c')]?_0x44409e[_0xd1d2('0x6c')]:[]};})};}})[_0xd1d2('0x28')](respondWithResult(_0x1ae9af,null))[_0xd1d2('0x43')](function(_0x20a3f0){var _0x32c294=_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6d')]?0x1f4:_0x20a3f0[_0xd1d2('0x6e')]||0x1f4;logger[_0xd1d2('0x2a')](_0xd1d2('0x6f'),_0xd1d2('0x70'),_0x32c294,JSON[_0xd1d2('0x71')](_0x20a3f0));delete _0x20a3f0['name'];if(_0x32c294===0x191){_0x32c294=0x190;}_0x1ae9af[_0xd1d2('0x1d')](_0x32c294)[_0xd1d2('0x2c')](_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6d')]?{'message':_0xd1d2('0x72'),'statusCode':_0x20a3f0[_0xd1d2('0x6e')]}:_0x20a3f0);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 6077444..b673e18 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 _0xfad6=['path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x26b15e,_0x4cb99e){var _0xe0b7f=function(_0xada32f){while(--_0xada32f){_0x26b15e['push'](_0x26b15e['shift']());}};_0xe0b7f(++_0x4cb99e);}(_0xfad6,0xe8));var _0x6fad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfad6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6fad('0x0'));var logger=require(_0x6fad('0x1'))(_0x6fad('0x2'));var moment=require(_0x6fad('0x3'));var BPromise=require(_0x6fad('0x4'));var rp=require(_0x6fad('0x5'));var fs=require('fs');var path=require(_0x6fad('0x6'));var rimraf=require('rimraf');var config=require(_0x6fad('0x7'));var attributes=require(_0x6fad('0x8'));var integrations=require(_0x6fad('0x9'));module[_0x6fad('0xa')]=function(_0x13d144,_0x19cb71){return _0x13d144[_0x6fad('0xb')](_0x6fad('0xc'),attributes,{'tableName':_0x6fad('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5b2=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5b2,0x118));var _0x2e5b=function(_0x4e7b46,_0x1e5718){_0x4e7b46=_0x4e7b46-0x0;var _0x309599=_0xe5b2[_0x4e7b46];return _0x309599;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e5b('0x0'))('api');var moment=require(_0x2e5b('0x1'));var BPromise=require(_0x2e5b('0x2'));var rp=require(_0x2e5b('0x3'));var fs=require('fs');var path=require(_0x2e5b('0x4'));var rimraf=require('rimraf');var config=require(_0x2e5b('0x5'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x2e5b('0x6'));module[_0x2e5b('0x7')]=function(_0x4493ee,_0x701bde){return _0x4493ee['define'](_0x2e5b('0x8'),attributes,{'tableName':_0x2e5b('0x9'),'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 0e9d400..306bc9b 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 _0xfb65=['map','model','ShowZendeskAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetZendeskAccount','ZendeskAccount','findAll','raw','options','where','attributes','include'];(function(_0x27714d,_0x457b53){var _0x18e2fb=function(_0x28f1d9){while(--_0x28f1d9){_0x27714d['push'](_0x27714d['shift']());}};_0x18e2fb(++_0x457b53);}(_0xfb65,0x8c));var _0x5fb6=function(_0x2c2943,_0x385231){_0x2c2943=_0x2c2943-0x0;var _0x23a14f=_0xfb65[_0x2c2943];return _0x23a14f;};'use strict';var _=require('lodash');var util=require(_0x5fb6('0x0'));var moment=require(_0x5fb6('0x1'));var BPromise=require(_0x5fb6('0x2'));var rs=require(_0x5fb6('0x3'));var fs=require('fs');var Redis=require(_0x5fb6('0x4'));var db=require(_0x5fb6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fb6('0x6'))(_0x5fb6('0x7'));var config=require('../../config/environment');var jayson=require(_0x5fb6('0x8'));var client=jayson[_0x5fb6('0x9')][_0x5fb6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56d796,_0x3ef4dd,_0x4d142d){return new BPromise(function(_0x2c00c5,_0x502040){return client['request'](_0x56d796,_0x4d142d)[_0x5fb6('0xb')](function(_0x19eeb6){logger[_0x5fb6('0xc')](_0x5fb6('0xd'),_0x3ef4dd,'request\x20sent');logger[_0x5fb6('0xe')](_0x5fb6('0xf'),_0x3ef4dd,'request\x20sent',JSON[_0x5fb6('0x10')](_0x19eeb6));if(_0x19eeb6[_0x5fb6('0x11')]){if(_0x19eeb6[_0x5fb6('0x11')][_0x5fb6('0x12')]===0x1f4){logger[_0x5fb6('0x11')](_0x5fb6('0xd'),_0x3ef4dd,_0x19eeb6['error'][_0x5fb6('0x13')]);return _0x502040(_0x19eeb6[_0x5fb6('0x11')][_0x5fb6('0x13')]);}logger['error'](_0x5fb6('0xd'),_0x3ef4dd,_0x19eeb6['error'][_0x5fb6('0x13')]);return _0x2c00c5(_0x19eeb6[_0x5fb6('0x11')][_0x5fb6('0x13')]);}else{logger[_0x5fb6('0xc')](_0x5fb6('0xd'),_0x3ef4dd,_0x5fb6('0x14'));_0x2c00c5(_0x19eeb6['result'][_0x5fb6('0x13')]);}})[_0x5fb6('0x15')](function(_0x2930a7){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x3ef4dd,_0x2930a7);_0x502040(_0x2930a7);});});}exports[_0x5fb6('0x16')]=function(_0x5c06fc){var _0x3b0b87=this;return new Promise(function(_0x47196b,_0x50fc16){return db[_0x5fb6('0x17')][_0x5fb6('0x18')]({'raw':_0x5c06fc['options']?_0x5c06fc['options'][_0x5fb6('0x19')]===undefined?!![]:![]:!![],'where':_0x5c06fc[_0x5fb6('0x1a')]?_0x5c06fc[_0x5fb6('0x1a')][_0x5fb6('0x1b')]||null:null,'attributes':_0x5c06fc[_0x5fb6('0x1a')]?_0x5c06fc[_0x5fb6('0x1a')][_0x5fb6('0x1c')]||null:null,'limit':_0x5c06fc['options']?_0x5c06fc[_0x5fb6('0x1a')]['limit']||null:null,'include':_0x5c06fc[_0x5fb6('0x1a')]?_0x5c06fc[_0x5fb6('0x1a')][_0x5fb6('0x1d')]?_[_0x5fb6('0x1e')](_0x5c06fc['options'][_0x5fb6('0x1d')],function(_0x47cec9){return{'model':db[_0x47cec9['model']],'as':_0x47cec9['as'],'attributes':_0x47cec9[_0x5fb6('0x1c')],'include':_0x47cec9['include']?_[_0x5fb6('0x1e')](_0x47cec9[_0x5fb6('0x1d')],function(_0x4fa1e0){return{'model':db[_0x4fa1e0[_0x5fb6('0x1f')]],'as':_0x4fa1e0['as'],'attributes':_0x4fa1e0['attributes'],'include':_0x4fa1e0['include']?_[_0x5fb6('0x1e')](_0x4fa1e0[_0x5fb6('0x1d')],function(_0x12701d){return{'model':db[_0x12701d[_0x5fb6('0x1f')]],'as':_0x12701d['as'],'attributes':_0x12701d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5fb6('0xb')](function(_0x309bc0){logger[_0x5fb6('0xc')]('GetZendeskAccount',_0x5c06fc);logger[_0x5fb6('0xe')](_0x5fb6('0x16'),_0x5c06fc,JSON[_0x5fb6('0x10')](_0x309bc0));_0x47196b(_0x309bc0);})['catch'](function(_0x68b491){logger[_0x5fb6('0x11')](_0x5fb6('0x16'),_0x68b491['message'],_0x5c06fc);_0x50fc16(_0x3b0b87[_0x5fb6('0x11')](0x1f4,_0x68b491[_0x5fb6('0x13')]));});});};exports[_0x5fb6('0x20')]=function(_0x52ea14){var _0x315b08=this;return new Promise(function(_0x5f27fc,_0x349dd1){return db[_0x5fb6('0x17')][_0x5fb6('0x21')]({'raw':_0x52ea14[_0x5fb6('0x1a')]?_0x52ea14['options'][_0x5fb6('0x19')]===undefined?!![]:![]:!![],'where':_0x52ea14[_0x5fb6('0x1a')]?_0x52ea14[_0x5fb6('0x1a')][_0x5fb6('0x1b')]||null:null,'attributes':_0x52ea14[_0x5fb6('0x1a')]?_0x52ea14[_0x5fb6('0x1a')][_0x5fb6('0x1c')]||null:null,'include':_0x52ea14[_0x5fb6('0x1a')]?_0x52ea14[_0x5fb6('0x1a')][_0x5fb6('0x1d')]?_[_0x5fb6('0x1e')](_0x52ea14[_0x5fb6('0x1a')][_0x5fb6('0x1d')],function(_0x306964){return{'model':db[_0x306964['model']],'as':_0x306964['as'],'attributes':_0x306964['attributes'],'include':_0x306964['include']?_[_0x5fb6('0x1e')](_0x306964['include'],function(_0x251bb7){return{'model':db[_0x251bb7['model']],'as':_0x251bb7['as'],'attributes':_0x251bb7[_0x5fb6('0x1c')],'include':_0x251bb7[_0x5fb6('0x1d')]?_[_0x5fb6('0x1e')](_0x251bb7[_0x5fb6('0x1d')],function(_0x51d501){return{'model':db[_0x51d501[_0x5fb6('0x1f')]],'as':_0x51d501['as'],'attributes':_0x51d501[_0x5fb6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34b553){logger[_0x5fb6('0xc')]('ShowZendeskAccount',_0x52ea14);logger[_0x5fb6('0xe')](_0x5fb6('0x20'),_0x52ea14,JSON[_0x5fb6('0x10')](_0x34b553));_0x5f27fc(_0x34b553);})['catch'](function(_0x5bfb54){logger[_0x5fb6('0x11')](_0x5fb6('0x20'),_0x5bfb54[_0x5fb6('0x13')],_0x52ea14);_0x349dd1(_0x315b08['error'](0x1f4,_0x5bfb54[_0x5fb6('0x13')]));});});}; \ No newline at end of file +var _0x5a5d=['util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','ZendeskAccount,\x20%s,\x20%s','message','info','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','map','include','model','attributes','then','stringify','find','ShowZendeskAccount','lodash'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x5a5d,0x131));var _0xd5a5=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x5a5d[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0xd5a5('0x0'));var util=require(_0xd5a5('0x1'));var moment=require(_0xd5a5('0x2'));var BPromise=require('bluebird');var rs=require(_0xd5a5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd5a5('0x4'));var logger=require(_0xd5a5('0x5'))(_0xd5a5('0x6'));var config=require('../../config/environment');var jayson=require(_0xd5a5('0x7'));var client=jayson[_0xd5a5('0x8')][_0xd5a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ec2fd,_0x294f59,_0x23ddba){return new BPromise(function(_0x40d77a,_0x358ec4){return client['request'](_0x2ec2fd,_0x23ddba)['then'](function(_0x37ff5d){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x294f59,_0xd5a5('0xa'));logger[_0xd5a5('0xb')](_0xd5a5('0xc'),_0x294f59,_0xd5a5('0xa'),JSON['stringify'](_0x37ff5d));if(_0x37ff5d[_0xd5a5('0xd')]){if(_0x37ff5d['error'][_0xd5a5('0xe')]===0x1f4){logger[_0xd5a5('0xd')](_0xd5a5('0xf'),_0x294f59,_0x37ff5d[_0xd5a5('0xd')][_0xd5a5('0x10')]);return _0x358ec4(_0x37ff5d[_0xd5a5('0xd')][_0xd5a5('0x10')]);}logger['error'](_0xd5a5('0xf'),_0x294f59,_0x37ff5d['error'][_0xd5a5('0x10')]);return _0x40d77a(_0x37ff5d[_0xd5a5('0xd')]['message']);}else{logger[_0xd5a5('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x294f59,_0xd5a5('0xa'));_0x40d77a(_0x37ff5d[_0xd5a5('0x12')][_0xd5a5('0x10')]);}})[_0xd5a5('0x13')](function(_0x7d0315){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x294f59,_0x7d0315);_0x358ec4(_0x7d0315);});});}exports[_0xd5a5('0x14')]=function(_0x75601){var _0x36c327=this;return new Promise(function(_0x2c40ce,_0x45677f){return db[_0xd5a5('0x15')][_0xd5a5('0x16')]({'raw':_0x75601[_0xd5a5('0x17')]?_0x75601[_0xd5a5('0x17')][_0xd5a5('0x18')]===undefined?!![]:![]:!![],'where':_0x75601[_0xd5a5('0x17')]?_0x75601[_0xd5a5('0x17')][_0xd5a5('0x19')]||null:null,'attributes':_0x75601[_0xd5a5('0x17')]?_0x75601[_0xd5a5('0x17')]['attributes']||null:null,'limit':_0x75601['options']?_0x75601[_0xd5a5('0x17')]['limit']||null:null,'include':_0x75601[_0xd5a5('0x17')]?_0x75601[_0xd5a5('0x17')]['include']?_[_0xd5a5('0x1a')](_0x75601[_0xd5a5('0x17')][_0xd5a5('0x1b')],function(_0x2e939b){return{'model':db[_0x2e939b[_0xd5a5('0x1c')]],'as':_0x2e939b['as'],'attributes':_0x2e939b[_0xd5a5('0x1d')],'include':_0x2e939b['include']?_[_0xd5a5('0x1a')](_0x2e939b['include'],function(_0xb3415e){return{'model':db[_0xb3415e[_0xd5a5('0x1c')]],'as':_0xb3415e['as'],'attributes':_0xb3415e[_0xd5a5('0x1d')],'include':_0xb3415e[_0xd5a5('0x1b')]?_['map'](_0xb3415e[_0xd5a5('0x1b')],function(_0x30d339){return{'model':db[_0x30d339[_0xd5a5('0x1c')]],'as':_0x30d339['as'],'attributes':_0x30d339[_0xd5a5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd5a5('0x1e')](function(_0x274871){logger[_0xd5a5('0x11')](_0xd5a5('0x14'),_0x75601);logger[_0xd5a5('0xb')]('GetZendeskAccount',_0x75601,JSON[_0xd5a5('0x1f')](_0x274871));_0x2c40ce(_0x274871);})[_0xd5a5('0x13')](function(_0x239ee7){logger[_0xd5a5('0xd')]('GetZendeskAccount',_0x239ee7[_0xd5a5('0x10')],_0x75601);_0x45677f(_0x36c327[_0xd5a5('0xd')](0x1f4,_0x239ee7[_0xd5a5('0x10')]));});});};exports['ShowZendeskAccount']=function(_0x375941){var _0x1f89ef=this;return new Promise(function(_0x40afa5,_0x16594a){return db['ZendeskAccount'][_0xd5a5('0x20')]({'raw':_0x375941[_0xd5a5('0x17')]?_0x375941[_0xd5a5('0x17')][_0xd5a5('0x18')]===undefined?!![]:![]:!![],'where':_0x375941[_0xd5a5('0x17')]?_0x375941[_0xd5a5('0x17')][_0xd5a5('0x19')]||null:null,'attributes':_0x375941[_0xd5a5('0x17')]?_0x375941[_0xd5a5('0x17')][_0xd5a5('0x1d')]||null:null,'include':_0x375941[_0xd5a5('0x17')]?_0x375941['options'][_0xd5a5('0x1b')]?_['map'](_0x375941[_0xd5a5('0x17')]['include'],function(_0x30fd78){return{'model':db[_0x30fd78[_0xd5a5('0x1c')]],'as':_0x30fd78['as'],'attributes':_0x30fd78[_0xd5a5('0x1d')],'include':_0x30fd78[_0xd5a5('0x1b')]?_[_0xd5a5('0x1a')](_0x30fd78['include'],function(_0x17c7cb){return{'model':db[_0x17c7cb[_0xd5a5('0x1c')]],'as':_0x17c7cb['as'],'attributes':_0x17c7cb[_0xd5a5('0x1d')],'include':_0x17c7cb[_0xd5a5('0x1b')]?_['map'](_0x17c7cb[_0xd5a5('0x1b')],function(_0x2099f1){return{'model':db[_0x2099f1[_0xd5a5('0x1c')]],'as':_0x2099f1['as'],'attributes':_0x2099f1['attributes']};}):[]};}):[]};}):[]:[]})[_0xd5a5('0x1e')](function(_0x1a996d){logger['info'](_0xd5a5('0x21'),_0x375941);logger[_0xd5a5('0xb')]('ShowZendeskAccount',_0x375941,JSON[_0xd5a5('0x1f')](_0x1a996d));_0x40afa5(_0x1a996d);})[_0xd5a5('0x13')](function(_0x1a4d7c){logger[_0xd5a5('0xd')](_0xd5a5('0x21'),_0x1a4d7c[_0xd5a5('0x10')],_0x375941);_0x16594a(_0x1f89ef[_0xd5a5('0xd')](0x1f4,_0x1a4d7c[_0xd5a5('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 1c15d1f..5b82111 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 _0x4024=['util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/fields','getDescriptions','/:id/tags','getTags','create','post','setTags','put','/:id','update','delete','destroy','exports','multer'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0x4024,0x89));var _0x4402=function(_0xd7a51f,_0x1583cc){_0xd7a51f=_0xd7a51f-0x0;var _0x235558=_0x4024[_0xd7a51f];return _0x235558;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/:id',auth[_0x4402('0x7')](),controller['show']);router['get'](_0x4402('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0x4402('0x9')]('/:id/subjects',auth[_0x4402('0x7')](),controller['getSubjects']);router[_0x4402('0x9')]('/:id/descriptions',auth[_0x4402('0x7')](),controller[_0x4402('0xb')]);router['get'](_0x4402('0xc'),auth[_0x4402('0x7')](),controller[_0x4402('0xd')]);router['post']('/',auth[_0x4402('0x7')](),controller[_0x4402('0xe')]);router[_0x4402('0xf')](_0x4402('0xc'),auth[_0x4402('0x7')](),controller[_0x4402('0x10')]);router[_0x4402('0x11')](_0x4402('0x12'),auth[_0x4402('0x7')](),controller[_0x4402('0x13')]);router[_0x4402('0x14')](_0x4402('0x12'),auth[_0x4402('0x7')](),controller[_0x4402('0x15')]);module[_0x4402('0x16')]=router; \ No newline at end of file +var _0xb10b=['getFields','/:id/subjects','/:id/descriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0x4be94d,_0x14b967){var _0xba2fee=function(_0x5f04e0){while(--_0x5f04e0){_0x4be94d['push'](_0x4be94d['shift']());}};_0xba2fee(++_0x14b967);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b8050,_0x4d12c6){_0x1b8050=_0x1b8050-0x0;var _0x1ec2b1=_0xb10b[_0x1b8050];return _0x1ec2b1;};'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['getSubjects']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getDescriptions']);router[_0xbb10('0x9')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x12')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x12')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x15')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 155076d..a680a7b 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 _0xbc6a=['sequelize','exports','STRING'];(function(_0x47fbb0,_0x39af12){var _0x2c1a37=function(_0x142376){while(--_0x142376){_0x47fbb0['push'](_0x47fbb0['shift']());}};_0x2c1a37(++_0x39af12);}(_0xbc6a,0x9c));var _0xabc6=function(_0x1d03e2,_0x355bac){_0x1d03e2=_0x1d03e2-0x0;var _0x11e4cd=_0xbc6a[_0x1d03e2];return _0x11e4cd;};'use strict';var Sequelize=require(_0xabc6('0x0'));module[_0xabc6('0x1')]={'name':{'type':Sequelize[_0xabc6('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x70e1=['STRING','sequelize','exports'];(function(_0x2341ab,_0x326a6c){var _0x54533e=function(_0x413273){while(--_0x413273){_0x2341ab['push'](_0x2341ab['shift']());}};_0x54533e(++_0x326a6c);}(_0x70e1,0x18d));var _0x170e=function(_0x289cf5,_0x501dfc){_0x289cf5=_0x289cf5-0x0;var _0x1f316d=_0x70e1[_0x289cf5];return _0x1f316d;};'use strict';var Sequelize=require(_0x170e('0x0'));module[_0x170e('0x1')]={'name':{'type':Sequelize[_0x170e('0x2')]},'description':{'type':Sequelize[_0x170e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 0c6d3e5..d833ac7 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 _0xd440=['apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','findAll','rows','catch','show','includeAll','include','merge','find','create','update','body','params','getFields','findOne','ZendeskField','order','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xd440,0xe5));var _0x0d44=function(_0x541423,_0x10dc3b){_0x541423=_0x541423-0x0;var _0x252385=_0xd440[_0x541423];return _0x252385;};'use strict';var emlformat=require(_0x0d44('0x0'));var rimraf=require(_0x0d44('0x1'));var zipdir=require(_0x0d44('0x2'));var jsonpatch=require(_0x0d44('0x3'));var rp=require(_0x0d44('0x4'));var moment=require('moment');var BPromise=require(_0x0d44('0x5'));var Mustache=require(_0x0d44('0x6'));var util=require(_0x0d44('0x7'));var path=require(_0x0d44('0x8'));var sox=require(_0x0d44('0x9'));var csv=require(_0x0d44('0xa'));var ejs=require(_0x0d44('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d44('0xc'));var squel=require(_0x0d44('0xd'));var crypto=require(_0x0d44('0xe'));var jsforce=require(_0x0d44('0xf'));var deskjs=require(_0x0d44('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0d44('0x11'));var Redis=require(_0x0d44('0x12'));var authService=require(_0x0d44('0x13'));var qs=require(_0x0d44('0x14'));var as=require(_0x0d44('0x15'));var hardwareService=require(_0x0d44('0x16'));var logger=require(_0x0d44('0x17'))(_0x0d44('0x18'));var utils=require('../../config/utils');var config=require(_0x0d44('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d44('0x1a'))['db'];function respondWithStatusCode(_0x27b934,_0x41d52e){_0x41d52e=_0x41d52e||0xcc;return function(_0xc95aa7){if(_0xc95aa7){return _0x27b934['sendStatus'](_0x41d52e);}return _0x27b934[_0x0d44('0x1b')](_0x41d52e)['end']();};}function respondWithResult(_0x134beb,_0x2769b8){_0x2769b8=_0x2769b8||0xc8;return function(_0x56ff5a){if(_0x56ff5a){return _0x134beb['status'](_0x2769b8)[_0x0d44('0x1c')](_0x56ff5a);}};}function respondWithFilteredResult(_0x192be3,_0x2ba98e){return function(_0x252eff){if(_0x252eff){var _0x2ee485=typeof _0x2ba98e[_0x0d44('0x1d')]===_0x0d44('0x1e')&&typeof _0x2ba98e[_0x0d44('0x1f')]===_0x0d44('0x1e');var _0x265c31=_0x252eff[_0x0d44('0x20')];var _0x5951e9=_0x2ee485?0x0:_0x2ba98e[_0x0d44('0x1d')];var _0x4444c5=_0x2ee485?_0x252eff['count']:_0x2ba98e[_0x0d44('0x1d')]+_0x2ba98e['limit'];var _0x23eee4;if(_0x4444c5>=_0x265c31){_0x4444c5=_0x265c31;_0x23eee4=0xc8;}else{_0x23eee4=0xce;}_0x192be3[_0x0d44('0x1b')](_0x23eee4);return _0x192be3[_0x0d44('0x21')](_0x0d44('0x22'),_0x5951e9+'-'+_0x4444c5+'/'+_0x265c31)[_0x0d44('0x1c')](_0x252eff);}return null;};}function patchUpdates(_0x2ec473){return function(_0x5da965){try{jsonpatch[_0x0d44('0x23')](_0x5da965,_0x2ec473,!![]);}catch(_0x3aaaa0){return BPromise[_0x0d44('0x24')](_0x3aaaa0);}return _0x5da965[_0x0d44('0x25')]();};}function saveUpdates(_0xe54731,_0xb5b874){return function(_0x501184){if(_0x501184){return _0x501184['update'](_0xe54731)[_0x0d44('0x26')](function(_0x3329b6){return _0x3329b6;});}return null;};}function removeEntity(_0x30dff5,_0x321585){return function(_0x42b764){if(_0x42b764){return _0x42b764[_0x0d44('0x27')]()[_0x0d44('0x26')](function(){_0x30dff5[_0x0d44('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e439,_0x35cdf0){return function(_0x28985c){if(!_0x28985c){_0x17e439[_0x0d44('0x28')](0x194);}return _0x28985c;};}function handleError(_0x528469,_0xf2d37c){_0xf2d37c=_0xf2d37c||0x1f4;return function(_0x52ca1c){logger[_0x0d44('0x29')](_0x52ca1c[_0x0d44('0x2a')]);if(_0x52ca1c[_0x0d44('0x2b')]){delete _0x52ca1c[_0x0d44('0x2b')];}_0x528469[_0x0d44('0x1b')](_0xf2d37c)[_0x0d44('0x2c')](_0x52ca1c);};}exports[_0x0d44('0x2d')]=function(_0x1e96dd,_0x39648b){var _0x2cc472={},_0x1152f9={},_0x27b946={'count':0x0,'rows':[]};var _0x3dbb70=_[_0x0d44('0x2e')](db[_0x0d44('0x2f')][_0x0d44('0x30')],function(_0x52422f){return{'name':_0x52422f['fieldName'],'type':_0x52422f[_0x0d44('0x31')]['key']};});_0x1152f9[_0x0d44('0x32')]=_['map'](_0x3dbb70,'name');_0x1152f9[_0x0d44('0x33')]=_[_0x0d44('0x34')](_0x1e96dd[_0x0d44('0x33')]);_0x1152f9[_0x0d44('0x35')]=_['intersection'](_0x1152f9[_0x0d44('0x32')],_0x1152f9[_0x0d44('0x33')]);_0x2cc472[_0x0d44('0x36')]=_[_0x0d44('0x37')](_0x1152f9[_0x0d44('0x32')],qs[_0x0d44('0x38')](_0x1e96dd[_0x0d44('0x33')]['fields']));_0x2cc472['attributes']=_0x2cc472[_0x0d44('0x36')][_0x0d44('0x39')]?_0x2cc472[_0x0d44('0x36')]:_0x1152f9[_0x0d44('0x32')];if(!_0x1e96dd[_0x0d44('0x33')][_0x0d44('0x3a')](_0x0d44('0x3b'))){_0x2cc472[_0x0d44('0x1f')]=qs[_0x0d44('0x1f')](_0x1e96dd[_0x0d44('0x33')]['limit']);_0x2cc472[_0x0d44('0x1d')]=qs[_0x0d44('0x1d')](_0x1e96dd[_0x0d44('0x33')][_0x0d44('0x1d')]);}_0x2cc472['order']=qs[_0x0d44('0x3c')](_0x1e96dd[_0x0d44('0x33')][_0x0d44('0x3c')]);_0x2cc472[_0x0d44('0x3d')]=qs[_0x0d44('0x35')](_[_0x0d44('0x3e')](_0x1e96dd[_0x0d44('0x33')],_0x1152f9['filters']),_0x3dbb70);if(_0x1e96dd[_0x0d44('0x33')]['filter']){_0x2cc472[_0x0d44('0x3d')]=_['merge'](_0x2cc472['where'],{'$or':_[_0x0d44('0x2e')](_0x3dbb70,function(_0x45fb2b){if(_0x45fb2b[_0x0d44('0x31')]!==_0x0d44('0x3f')){var _0x21bbfe={};_0x21bbfe[_0x45fb2b[_0x0d44('0x2b')]]={'$like':'%'+_0x1e96dd[_0x0d44('0x33')][_0x0d44('0x40')]+'%'};return _0x21bbfe;}})});}_0x2cc472=_['merge']({},_0x2cc472,_0x1e96dd[_0x0d44('0x41')]);var _0x48236b={'where':_0x2cc472[_0x0d44('0x3d')]};return db[_0x0d44('0x2f')][_0x0d44('0x20')](_0x48236b)['then'](function(_0x337acc){_0x27b946[_0x0d44('0x20')]=_0x337acc;if(_0x1e96dd['query']['includeAll']){_0x2cc472['include']=[{'all':!![]}];}return db[_0x0d44('0x2f')][_0x0d44('0x42')](_0x2cc472);})[_0x0d44('0x26')](function(_0x23bf7f){_0x27b946[_0x0d44('0x43')]=_0x23bf7f;return _0x27b946;})[_0x0d44('0x26')](respondWithFilteredResult(_0x39648b,_0x2cc472))[_0x0d44('0x44')](handleError(_0x39648b,null));};exports[_0x0d44('0x45')]=function(_0x2ccb7a,_0x372e88){var _0x4dbedd={'raw':![],'where':{'id':_0x2ccb7a['params']['id']}},_0x2c70be={};_0x2c70be[_0x0d44('0x32')]=_[_0x0d44('0x34')](db[_0x0d44('0x2f')]['rawAttributes']);_0x2c70be[_0x0d44('0x33')]=_[_0x0d44('0x34')](_0x2ccb7a['query']);_0x2c70be[_0x0d44('0x35')]=_['intersection'](_0x2c70be[_0x0d44('0x32')],_0x2c70be['query']);_0x4dbedd[_0x0d44('0x36')]=_[_0x0d44('0x37')](_0x2c70be['model'],qs[_0x0d44('0x38')](_0x2ccb7a[_0x0d44('0x33')][_0x0d44('0x38')]));_0x4dbedd[_0x0d44('0x36')]=_0x4dbedd['attributes'][_0x0d44('0x39')]?_0x4dbedd[_0x0d44('0x36')]:_0x2c70be[_0x0d44('0x32')];if(_0x2ccb7a[_0x0d44('0x33')][_0x0d44('0x46')]){_0x4dbedd[_0x0d44('0x47')]=[{'all':!![]}];}_0x4dbedd=_[_0x0d44('0x48')]({},_0x4dbedd,_0x2ccb7a[_0x0d44('0x41')]);return db[_0x0d44('0x2f')][_0x0d44('0x49')](_0x4dbedd)[_0x0d44('0x26')](handleEntityNotFound(_0x372e88,null))[_0x0d44('0x26')](respondWithResult(_0x372e88,null))[_0x0d44('0x44')](handleError(_0x372e88,null));};exports['create']=function(_0x2d89c3,_0x90243){return db[_0x0d44('0x2f')][_0x0d44('0x4a')](_0x2d89c3['body'],{})[_0x0d44('0x26')](respondWithResult(_0x90243,0xc9))[_0x0d44('0x44')](handleError(_0x90243,null));};exports[_0x0d44('0x4b')]=function(_0x2878e8,_0x355408){if(_0x2878e8[_0x0d44('0x4c')]['id']){delete _0x2878e8[_0x0d44('0x4c')]['id'];}return db[_0x0d44('0x2f')][_0x0d44('0x49')]({'where':{'id':_0x2878e8[_0x0d44('0x4d')]['id']}})[_0x0d44('0x26')](handleEntityNotFound(_0x355408,null))['then'](saveUpdates(_0x2878e8[_0x0d44('0x4c')],null))[_0x0d44('0x26')](respondWithResult(_0x355408,null))['catch'](handleError(_0x355408,null));};exports['destroy']=function(_0x4846cc,_0x4000b7){return db['ZendeskConfiguration'][_0x0d44('0x49')]({'where':{'id':_0x4846cc['params']['id']}})[_0x0d44('0x26')](handleEntityNotFound(_0x4000b7,null))[_0x0d44('0x26')](removeEntity(_0x4000b7,null))[_0x0d44('0x44')](handleError(_0x4000b7,null));};exports[_0x0d44('0x4e')]=function(_0x2b2e65,_0x4595c5,_0x2ca022){var _0x335348={};var _0x5b61e3={};var _0x205316;var _0x16bac1;return db[_0x0d44('0x2f')][_0x0d44('0x4f')]({'where':{'id':_0x2b2e65[_0x0d44('0x4d')]['id']}})[_0x0d44('0x26')](handleEntityNotFound(_0x4595c5,null))[_0x0d44('0x26')](function(_0x49fa44){if(_0x49fa44){_0x205316=_0x49fa44;_0x5b61e3[_0x0d44('0x32')]=_[_0x0d44('0x34')](db[_0x0d44('0x50')][_0x0d44('0x30')]);_0x5b61e3[_0x0d44('0x33')]=_['keys'](_0x2b2e65[_0x0d44('0x33')]);_0x5b61e3['filters']=_['intersection'](_0x5b61e3['model'],_0x5b61e3[_0x0d44('0x33')]);_0x335348[_0x0d44('0x36')]=_[_0x0d44('0x37')](_0x5b61e3[_0x0d44('0x32')],qs[_0x0d44('0x38')](_0x2b2e65[_0x0d44('0x33')][_0x0d44('0x38')]));_0x335348['attributes']=_0x335348[_0x0d44('0x36')][_0x0d44('0x39')]?_0x335348[_0x0d44('0x36')]:_0x5b61e3['model'];_0x335348[_0x0d44('0x51')]=qs[_0x0d44('0x3c')](_0x2b2e65[_0x0d44('0x33')]['sort']);_0x335348[_0x0d44('0x3d')]=qs[_0x0d44('0x35')](_[_0x0d44('0x3e')](_0x2b2e65[_0x0d44('0x33')],_0x5b61e3[_0x0d44('0x35')]));if(_0x2b2e65['query'][_0x0d44('0x40')]){_0x335348[_0x0d44('0x3d')]=_[_0x0d44('0x48')](_0x335348[_0x0d44('0x3d')],{'$or':_[_0x0d44('0x2e')](_0x335348[_0x0d44('0x36')],function(_0x5ef669){var _0x5e2d7c={};_0x5e2d7c[_0x5ef669]={'$like':'%'+_0x2b2e65[_0x0d44('0x33')][_0x0d44('0x40')]+'%'};return _0x5e2d7c;})});}_0x335348=_[_0x0d44('0x48')]({},_0x335348,_0x2b2e65['options']);return _0x205316[_0x0d44('0x4e')](_0x335348);}})[_0x0d44('0x26')](function(_0x5c0216){if(_0x5c0216){_0x16bac1=_0x5c0216[_0x0d44('0x39')];if(!_0x2b2e65[_0x0d44('0x33')][_0x0d44('0x3a')](_0x0d44('0x3b'))){_0x335348['limit']=qs[_0x0d44('0x1f')](_0x2b2e65[_0x0d44('0x33')][_0x0d44('0x1f')]);_0x335348[_0x0d44('0x1d')]=qs[_0x0d44('0x1d')](_0x2b2e65[_0x0d44('0x33')]['offset']);}return _0x205316[_0x0d44('0x4e')](_0x335348);}})[_0x0d44('0x26')](function(_0x15224a){if(_0x15224a){return _0x15224a?{'count':_0x16bac1,'rows':_0x15224a}:null;}})['then'](respondWithResult(_0x4595c5,null))['catch'](handleError(_0x4595c5,null));};exports[_0x0d44('0x52')]=function(_0x22b7d3,_0x45b777,_0x44ac7e){var _0x5f2a49={};var _0x4dedbe={};var _0x57f9f8;var _0x296cc7;return db['ZendeskConfiguration'][_0x0d44('0x4f')]({'where':{'id':_0x22b7d3[_0x0d44('0x4d')]['id']}})[_0x0d44('0x26')](handleEntityNotFound(_0x45b777,null))[_0x0d44('0x26')](function(_0x35d611){if(_0x35d611){_0x57f9f8=_0x35d611;_0x4dedbe[_0x0d44('0x32')]=_[_0x0d44('0x34')](db[_0x0d44('0x50')][_0x0d44('0x30')]);_0x4dedbe['query']=_[_0x0d44('0x34')](_0x22b7d3[_0x0d44('0x33')]);_0x4dedbe[_0x0d44('0x35')]=_[_0x0d44('0x37')](_0x4dedbe[_0x0d44('0x32')],_0x4dedbe[_0x0d44('0x33')]);_0x5f2a49[_0x0d44('0x36')]=_[_0x0d44('0x37')](_0x4dedbe[_0x0d44('0x32')],qs['fields'](_0x22b7d3[_0x0d44('0x33')]['fields']));_0x5f2a49[_0x0d44('0x36')]=_0x5f2a49[_0x0d44('0x36')][_0x0d44('0x39')]?_0x5f2a49[_0x0d44('0x36')]:_0x4dedbe[_0x0d44('0x32')];_0x5f2a49[_0x0d44('0x51')]=qs[_0x0d44('0x3c')](_0x22b7d3[_0x0d44('0x33')][_0x0d44('0x3c')]);_0x5f2a49['where']=qs['filters'](_[_0x0d44('0x3e')](_0x22b7d3[_0x0d44('0x33')],_0x4dedbe[_0x0d44('0x35')]));if(_0x22b7d3[_0x0d44('0x33')][_0x0d44('0x40')]){_0x5f2a49[_0x0d44('0x3d')]=_[_0x0d44('0x48')](_0x5f2a49[_0x0d44('0x3d')],{'$or':_[_0x0d44('0x2e')](_0x5f2a49[_0x0d44('0x36')],function(_0xaa3341){var _0x353e28={};_0x353e28[_0xaa3341]={'$like':'%'+_0x22b7d3[_0x0d44('0x33')]['filter']+'%'};return _0x353e28;})});}_0x5f2a49=_[_0x0d44('0x48')]({},_0x5f2a49,_0x22b7d3[_0x0d44('0x41')]);return _0x57f9f8[_0x0d44('0x52')](_0x5f2a49);}})[_0x0d44('0x26')](function(_0x47714e){if(_0x47714e){_0x296cc7=_0x47714e[_0x0d44('0x39')];if(!_0x22b7d3[_0x0d44('0x33')][_0x0d44('0x3a')](_0x0d44('0x3b'))){_0x5f2a49[_0x0d44('0x1f')]=qs[_0x0d44('0x1f')](_0x22b7d3[_0x0d44('0x33')][_0x0d44('0x1f')]);_0x5f2a49[_0x0d44('0x1d')]=qs['offset'](_0x22b7d3['query'][_0x0d44('0x1d')]);}return _0x57f9f8[_0x0d44('0x52')](_0x5f2a49);}})['then'](function(_0x54fc82){if(_0x54fc82){return _0x54fc82?{'count':_0x296cc7,'rows':_0x54fc82}:null;}})[_0x0d44('0x26')](respondWithResult(_0x45b777,null))['catch'](handleError(_0x45b777,null));};exports['getDescriptions']=function(_0x1252c9,_0x423319,_0x2cd105){var _0x3eef3b={};var _0xae1653={};var _0x199a30;var _0x21aa5e;return db[_0x0d44('0x2f')][_0x0d44('0x4f')]({'where':{'id':_0x1252c9[_0x0d44('0x4d')]['id']}})[_0x0d44('0x26')](handleEntityNotFound(_0x423319,null))[_0x0d44('0x26')](function(_0x5a1aeb){if(_0x5a1aeb){_0x199a30=_0x5a1aeb;_0xae1653['model']=_[_0x0d44('0x34')](db[_0x0d44('0x50')][_0x0d44('0x30')]);_0xae1653[_0x0d44('0x33')]=_[_0x0d44('0x34')](_0x1252c9[_0x0d44('0x33')]);_0xae1653['filters']=_[_0x0d44('0x37')](_0xae1653[_0x0d44('0x32')],_0xae1653[_0x0d44('0x33')]);_0x3eef3b['attributes']=_['intersection'](_0xae1653['model'],qs[_0x0d44('0x38')](_0x1252c9[_0x0d44('0x33')][_0x0d44('0x38')]));_0x3eef3b[_0x0d44('0x36')]=_0x3eef3b[_0x0d44('0x36')][_0x0d44('0x39')]?_0x3eef3b[_0x0d44('0x36')]:_0xae1653[_0x0d44('0x32')];_0x3eef3b[_0x0d44('0x51')]=qs['sort'](_0x1252c9[_0x0d44('0x33')]['sort']);_0x3eef3b[_0x0d44('0x3d')]=qs['filters'](_[_0x0d44('0x3e')](_0x1252c9[_0x0d44('0x33')],_0xae1653['filters']));if(_0x1252c9[_0x0d44('0x33')][_0x0d44('0x40')]){_0x3eef3b[_0x0d44('0x3d')]=_[_0x0d44('0x48')](_0x3eef3b['where'],{'$or':_[_0x0d44('0x2e')](_0x3eef3b[_0x0d44('0x36')],function(_0x727456){var _0x564d62={};_0x564d62[_0x727456]={'$like':'%'+_0x1252c9[_0x0d44('0x33')]['filter']+'%'};return _0x564d62;})});}_0x3eef3b=_[_0x0d44('0x48')]({},_0x3eef3b,_0x1252c9[_0x0d44('0x41')]);return _0x199a30[_0x0d44('0x53')](_0x3eef3b);}})[_0x0d44('0x26')](function(_0x281f18){if(_0x281f18){_0x21aa5e=_0x281f18['length'];if(!_0x1252c9['query']['hasOwnProperty']('nolimit')){_0x3eef3b['limit']=qs[_0x0d44('0x1f')](_0x1252c9[_0x0d44('0x33')][_0x0d44('0x1f')]);_0x3eef3b[_0x0d44('0x1d')]=qs[_0x0d44('0x1d')](_0x1252c9['query'][_0x0d44('0x1d')]);}return _0x199a30['getDescriptions'](_0x3eef3b);}})[_0x0d44('0x26')](function(_0x10b4b3){if(_0x10b4b3){return _0x10b4b3?{'count':_0x21aa5e,'rows':_0x10b4b3}:null;}})[_0x0d44('0x26')](respondWithResult(_0x423319,null))[_0x0d44('0x44')](handleError(_0x423319,null));};exports['getTags']=function(_0x2df7d7,_0x24b2ae,_0x74c2c8){var _0x14d658={};var _0x3c48b0={};var _0x28e18c;var _0x55b842;return db[_0x0d44('0x2f')][_0x0d44('0x4f')]({'where':{'id':_0x2df7d7[_0x0d44('0x4d')]['id']}})[_0x0d44('0x26')](handleEntityNotFound(_0x24b2ae,null))[_0x0d44('0x26')](function(_0x564418){if(_0x564418){_0x28e18c=_0x564418;_0x3c48b0['model']=_[_0x0d44('0x34')](db[_0x0d44('0x54')]['rawAttributes']);_0x3c48b0[_0x0d44('0x33')]=_[_0x0d44('0x34')](_0x2df7d7[_0x0d44('0x33')]);_0x3c48b0[_0x0d44('0x35')]=_[_0x0d44('0x37')](_0x3c48b0['model'],_0x3c48b0[_0x0d44('0x33')]);_0x14d658['attributes']=_['intersection'](_0x3c48b0[_0x0d44('0x32')],qs[_0x0d44('0x38')](_0x2df7d7[_0x0d44('0x33')][_0x0d44('0x38')]));_0x14d658['attributes']=_0x14d658[_0x0d44('0x36')][_0x0d44('0x39')]?_0x14d658[_0x0d44('0x36')]:_0x3c48b0[_0x0d44('0x32')];_0x14d658[_0x0d44('0x51')]=qs[_0x0d44('0x3c')](_0x2df7d7[_0x0d44('0x33')][_0x0d44('0x3c')]);_0x14d658[_0x0d44('0x3d')]=qs[_0x0d44('0x35')](_['pick'](_0x2df7d7[_0x0d44('0x33')],_0x3c48b0[_0x0d44('0x35')]));if(_0x2df7d7[_0x0d44('0x33')][_0x0d44('0x40')]){_0x14d658[_0x0d44('0x3d')]=_['merge'](_0x14d658['where'],{'$or':_[_0x0d44('0x2e')](_0x14d658[_0x0d44('0x36')],function(_0x45ed20){var _0x2d4c43={};_0x2d4c43[_0x45ed20]={'$like':'%'+_0x2df7d7[_0x0d44('0x33')][_0x0d44('0x40')]+'%'};return _0x2d4c43;})});}_0x14d658=_[_0x0d44('0x48')]({},_0x14d658,_0x2df7d7['options']);return _0x28e18c[_0x0d44('0x55')](_0x14d658);}})[_0x0d44('0x26')](function(_0x9d658a){if(_0x9d658a){_0x55b842=_0x9d658a[_0x0d44('0x39')];if(!_0x2df7d7[_0x0d44('0x33')][_0x0d44('0x3a')]('nolimit')){_0x14d658[_0x0d44('0x1f')]=qs[_0x0d44('0x1f')](_0x2df7d7['query'][_0x0d44('0x1f')]);_0x14d658[_0x0d44('0x1d')]=qs[_0x0d44('0x1d')](_0x2df7d7['query']['offset']);}return _0x28e18c[_0x0d44('0x55')](_0x14d658);}})['then'](function(_0x32a67b){if(_0x32a67b){return _0x32a67b?{'count':_0x55b842,'rows':_0x32a67b}:null;}})[_0x0d44('0x26')](respondWithResult(_0x24b2ae,null))[_0x0d44('0x44')](handleError(_0x24b2ae,null));};exports[_0x0d44('0x56')]=function(_0x5cb483,_0x565238,_0x57dc89){if(_0x5cb483[_0x0d44('0x4c')]['id']){delete _0x5cb483[_0x0d44('0x4c')]['id'];}return db[_0x0d44('0x2f')]['findOne']({'where':{'id':_0x5cb483[_0x0d44('0x4d')]['id']}})['then'](handleEntityNotFound(_0x565238,null))[_0x0d44('0x26')](function(_0x569a39){if(_0x569a39){return _0x569a39[_0x0d44('0x56')](_0x5cb483[_0x0d44('0x4c')][_0x0d44('0x57')]||[]);}return null;})[_0x0d44('0x26')](respondWithResult(_0x565238,null))[_0x0d44('0x44')](handleError(_0x565238,null));}; \ No newline at end of file +var _0x08a9=['body','update','find','getFields','ZendeskField','order','getSubjects','getDescriptions','findOne','pick','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','then','destroy','sendStatus','stack','name','index','ZendeskConfiguration','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','type','VIRTUAL','options','includeAll','include','rows','show','params','merge','catch','create'];(function(_0x39ff8b,_0x34145){var _0x252988=function(_0x1d2c4c){while(--_0x1d2c4c){_0x39ff8b['push'](_0x39ff8b['shift']());}};_0x252988(++_0x34145);}(_0x08a9,0x10c));var _0x908a=function(_0xf105c1,_0x30dd5e){_0xf105c1=_0xf105c1-0x0;var _0x450364=_0x08a9[_0xf105c1];return _0x450364;};'use strict';var emlformat=require(_0x908a('0x0'));var rimraf=require(_0x908a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x908a('0x2'));var rp=require(_0x908a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x908a('0x4'));var util=require(_0x908a('0x5'));var path=require(_0x908a('0x6'));var sox=require('sox');var csv=require(_0x908a('0x7'));var ejs=require(_0x908a('0x8'));var fs=require('fs');var fs_extra=require(_0x908a('0x9'));var _=require(_0x908a('0xa'));var squel=require(_0x908a('0xb'));var crypto=require(_0x908a('0xc'));var jsforce=require(_0x908a('0xd'));var deskjs=require(_0x908a('0xe'));var toCsv=require(_0x908a('0x7'));var querystring=require(_0x908a('0xf'));var Papa=require(_0x908a('0x10'));var Redis=require(_0x908a('0x11'));var authService=require(_0x908a('0x12'));var qs=require(_0x908a('0x13'));var as=require(_0x908a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x908a('0x15'))(_0x908a('0x16'));var utils=require(_0x908a('0x17'));var config=require(_0x908a('0x18'));var licenseUtil=require(_0x908a('0x19'));var db=require(_0x908a('0x1a'))['db'];function respondWithStatusCode(_0x54a0f6,_0x35e2c5){_0x35e2c5=_0x35e2c5||0xcc;return function(_0x1d4cd9){if(_0x1d4cd9){return _0x54a0f6['sendStatus'](_0x35e2c5);}return _0x54a0f6[_0x908a('0x1b')](_0x35e2c5)[_0x908a('0x1c')]();};}function respondWithResult(_0x3c47d0,_0x2fbc3f){_0x2fbc3f=_0x2fbc3f||0xc8;return function(_0x8b977c){if(_0x8b977c){return _0x3c47d0[_0x908a('0x1b')](_0x2fbc3f)[_0x908a('0x1d')](_0x8b977c);}};}function respondWithFilteredResult(_0x1e6493,_0x3f9c91){return function(_0x4bd966){if(_0x4bd966){var _0x500721=typeof _0x3f9c91[_0x908a('0x1e')]===_0x908a('0x1f')&&typeof _0x3f9c91['limit']==='undefined';var _0x46dd75=_0x4bd966[_0x908a('0x20')];var _0x3dafa2=_0x500721?0x0:_0x3f9c91[_0x908a('0x1e')];var _0x41b27a=_0x500721?_0x4bd966[_0x908a('0x20')]:_0x3f9c91[_0x908a('0x1e')]+_0x3f9c91[_0x908a('0x21')];var _0x9bd9f2;if(_0x41b27a>=_0x46dd75){_0x41b27a=_0x46dd75;_0x9bd9f2=0xc8;}else{_0x9bd9f2=0xce;}_0x1e6493[_0x908a('0x1b')](_0x9bd9f2);return _0x1e6493[_0x908a('0x22')]('Content-Range',_0x3dafa2+'-'+_0x41b27a+'/'+_0x46dd75)[_0x908a('0x1d')](_0x4bd966);}return null;};}function patchUpdates(_0x1dcc97){return function(_0x59e935){try{jsonpatch[_0x908a('0x23')](_0x59e935,_0x1dcc97,!![]);}catch(_0x52adf3){return BPromise['reject'](_0x52adf3);}return _0x59e935[_0x908a('0x24')]();};}function saveUpdates(_0x4bca32,_0x649106){return function(_0x5d3d9d){if(_0x5d3d9d){return _0x5d3d9d['update'](_0x4bca32)[_0x908a('0x25')](function(_0x2d5d51){return _0x2d5d51;});}return null;};}function removeEntity(_0x1624e9,_0x504c0d){return function(_0x130a13){if(_0x130a13){return _0x130a13[_0x908a('0x26')]()[_0x908a('0x25')](function(){_0x1624e9[_0x908a('0x1b')](0xcc)[_0x908a('0x1c')]();});}};}function handleEntityNotFound(_0x2cf9c7,_0x3ffd77){return function(_0x1004e5){if(!_0x1004e5){_0x2cf9c7[_0x908a('0x27')](0x194);}return _0x1004e5;};}function handleError(_0x896b6,_0x1fa587){_0x1fa587=_0x1fa587||0x1f4;return function(_0x2b5af0){logger['error'](_0x2b5af0[_0x908a('0x28')]);if(_0x2b5af0[_0x908a('0x29')]){delete _0x2b5af0[_0x908a('0x29')];}_0x896b6['status'](_0x1fa587)['send'](_0x2b5af0);};}exports[_0x908a('0x2a')]=function(_0xc64033,_0x36a544){var _0x455af3={},_0x27d37c={},_0x11043e={'count':0x0,'rows':[]};var _0x2c5518=_['map'](db[_0x908a('0x2b')][_0x908a('0x2c')],function(_0x43521c){return{'name':_0x43521c[_0x908a('0x2d')],'type':_0x43521c['type'][_0x908a('0x2e')]};});_0x27d37c[_0x908a('0x2f')]=_[_0x908a('0x30')](_0x2c5518,_0x908a('0x29'));_0x27d37c['query']=_[_0x908a('0x31')](_0xc64033[_0x908a('0x32')]);_0x27d37c[_0x908a('0x33')]=_[_0x908a('0x34')](_0x27d37c[_0x908a('0x2f')],_0x27d37c['query']);_0x455af3[_0x908a('0x35')]=_[_0x908a('0x34')](_0x27d37c[_0x908a('0x2f')],qs[_0x908a('0x36')](_0xc64033[_0x908a('0x32')][_0x908a('0x36')]));_0x455af3[_0x908a('0x35')]=_0x455af3[_0x908a('0x35')][_0x908a('0x37')]?_0x455af3['attributes']:_0x27d37c[_0x908a('0x2f')];if(!_0xc64033[_0x908a('0x32')][_0x908a('0x38')](_0x908a('0x39'))){_0x455af3[_0x908a('0x21')]=qs['limit'](_0xc64033['query']['limit']);_0x455af3[_0x908a('0x1e')]=qs['offset'](_0xc64033[_0x908a('0x32')]['offset']);}_0x455af3['order']=qs[_0x908a('0x3a')](_0xc64033['query'][_0x908a('0x3a')]);_0x455af3['where']=qs['filters'](_['pick'](_0xc64033['query'],_0x27d37c[_0x908a('0x33')]),_0x2c5518);if(_0xc64033['query'][_0x908a('0x3b')]){_0x455af3[_0x908a('0x3c')]=_['merge'](_0x455af3[_0x908a('0x3c')],{'$or':_[_0x908a('0x30')](_0x2c5518,function(_0x3cf855){if(_0x3cf855[_0x908a('0x3d')]!==_0x908a('0x3e')){var _0x171d97={};_0x171d97[_0x3cf855['name']]={'$like':'%'+_0xc64033[_0x908a('0x32')][_0x908a('0x3b')]+'%'};return _0x171d97;}})});}_0x455af3=_['merge']({},_0x455af3,_0xc64033[_0x908a('0x3f')]);var _0x2f325b={'where':_0x455af3[_0x908a('0x3c')]};return db[_0x908a('0x2b')]['count'](_0x2f325b)[_0x908a('0x25')](function(_0x3f17c9){_0x11043e[_0x908a('0x20')]=_0x3f17c9;if(_0xc64033[_0x908a('0x32')][_0x908a('0x40')]){_0x455af3[_0x908a('0x41')]=[{'all':!![]}];}return db[_0x908a('0x2b')]['findAll'](_0x455af3);})[_0x908a('0x25')](function(_0x126456){_0x11043e[_0x908a('0x42')]=_0x126456;return _0x11043e;})[_0x908a('0x25')](respondWithFilteredResult(_0x36a544,_0x455af3))['catch'](handleError(_0x36a544,null));};exports[_0x908a('0x43')]=function(_0xe3ca82,_0xb52974){var _0x671dcb={'raw':![],'where':{'id':_0xe3ca82[_0x908a('0x44')]['id']}},_0x4c39f5={};_0x4c39f5[_0x908a('0x2f')]=_[_0x908a('0x31')](db[_0x908a('0x2b')]['rawAttributes']);_0x4c39f5[_0x908a('0x32')]=_[_0x908a('0x31')](_0xe3ca82[_0x908a('0x32')]);_0x4c39f5[_0x908a('0x33')]=_[_0x908a('0x34')](_0x4c39f5[_0x908a('0x2f')],_0x4c39f5[_0x908a('0x32')]);_0x671dcb[_0x908a('0x35')]=_[_0x908a('0x34')](_0x4c39f5[_0x908a('0x2f')],qs[_0x908a('0x36')](_0xe3ca82[_0x908a('0x32')][_0x908a('0x36')]));_0x671dcb[_0x908a('0x35')]=_0x671dcb['attributes'][_0x908a('0x37')]?_0x671dcb['attributes']:_0x4c39f5[_0x908a('0x2f')];if(_0xe3ca82[_0x908a('0x32')][_0x908a('0x40')]){_0x671dcb[_0x908a('0x41')]=[{'all':!![]}];}_0x671dcb=_[_0x908a('0x45')]({},_0x671dcb,_0xe3ca82[_0x908a('0x3f')]);return db['ZendeskConfiguration']['find'](_0x671dcb)[_0x908a('0x25')](handleEntityNotFound(_0xb52974,null))[_0x908a('0x25')](respondWithResult(_0xb52974,null))[_0x908a('0x46')](handleError(_0xb52974,null));};exports['create']=function(_0xa25f1e,_0x4a3963){return db[_0x908a('0x2b')][_0x908a('0x47')](_0xa25f1e[_0x908a('0x48')],{})[_0x908a('0x25')](respondWithResult(_0x4a3963,0xc9))['catch'](handleError(_0x4a3963,null));};exports[_0x908a('0x49')]=function(_0x37387b,_0x406706){if(_0x37387b[_0x908a('0x48')]['id']){delete _0x37387b[_0x908a('0x48')]['id'];}return db[_0x908a('0x2b')][_0x908a('0x4a')]({'where':{'id':_0x37387b[_0x908a('0x44')]['id']}})[_0x908a('0x25')](handleEntityNotFound(_0x406706,null))['then'](saveUpdates(_0x37387b[_0x908a('0x48')],null))[_0x908a('0x25')](respondWithResult(_0x406706,null))['catch'](handleError(_0x406706,null));};exports[_0x908a('0x26')]=function(_0x3db67f,_0x3ddbcc){return db[_0x908a('0x2b')][_0x908a('0x4a')]({'where':{'id':_0x3db67f[_0x908a('0x44')]['id']}})[_0x908a('0x25')](handleEntityNotFound(_0x3ddbcc,null))[_0x908a('0x25')](removeEntity(_0x3ddbcc,null))['catch'](handleError(_0x3ddbcc,null));};exports[_0x908a('0x4b')]=function(_0x30ebee,_0x4ae123,_0x241dd5){var _0x58af67={};var _0x4542c9={};var _0x1341a5;var _0x548886;return db[_0x908a('0x2b')]['findOne']({'where':{'id':_0x30ebee[_0x908a('0x44')]['id']}})[_0x908a('0x25')](handleEntityNotFound(_0x4ae123,null))[_0x908a('0x25')](function(_0x289256){if(_0x289256){_0x1341a5=_0x289256;_0x4542c9[_0x908a('0x2f')]=_['keys'](db[_0x908a('0x4c')][_0x908a('0x2c')]);_0x4542c9[_0x908a('0x32')]=_[_0x908a('0x31')](_0x30ebee[_0x908a('0x32')]);_0x4542c9[_0x908a('0x33')]=_['intersection'](_0x4542c9[_0x908a('0x2f')],_0x4542c9[_0x908a('0x32')]);_0x58af67[_0x908a('0x35')]=_[_0x908a('0x34')](_0x4542c9[_0x908a('0x2f')],qs['fields'](_0x30ebee[_0x908a('0x32')][_0x908a('0x36')]));_0x58af67[_0x908a('0x35')]=_0x58af67['attributes']['length']?_0x58af67[_0x908a('0x35')]:_0x4542c9[_0x908a('0x2f')];_0x58af67[_0x908a('0x4d')]=qs[_0x908a('0x3a')](_0x30ebee[_0x908a('0x32')][_0x908a('0x3a')]);_0x58af67[_0x908a('0x3c')]=qs[_0x908a('0x33')](_['pick'](_0x30ebee['query'],_0x4542c9[_0x908a('0x33')]));if(_0x30ebee[_0x908a('0x32')][_0x908a('0x3b')]){_0x58af67[_0x908a('0x3c')]=_[_0x908a('0x45')](_0x58af67[_0x908a('0x3c')],{'$or':_[_0x908a('0x30')](_0x58af67[_0x908a('0x35')],function(_0x1db873){var _0x43a18b={};_0x43a18b[_0x1db873]={'$like':'%'+_0x30ebee[_0x908a('0x32')][_0x908a('0x3b')]+'%'};return _0x43a18b;})});}_0x58af67=_[_0x908a('0x45')]({},_0x58af67,_0x30ebee[_0x908a('0x3f')]);return _0x1341a5[_0x908a('0x4b')](_0x58af67);}})[_0x908a('0x25')](function(_0x1cb297){if(_0x1cb297){_0x548886=_0x1cb297[_0x908a('0x37')];if(!_0x30ebee[_0x908a('0x32')]['hasOwnProperty']('nolimit')){_0x58af67[_0x908a('0x21')]=qs['limit'](_0x30ebee[_0x908a('0x32')][_0x908a('0x21')]);_0x58af67[_0x908a('0x1e')]=qs[_0x908a('0x1e')](_0x30ebee[_0x908a('0x32')][_0x908a('0x1e')]);}return _0x1341a5[_0x908a('0x4b')](_0x58af67);}})[_0x908a('0x25')](function(_0x4bd7f5){if(_0x4bd7f5){return _0x4bd7f5?{'count':_0x548886,'rows':_0x4bd7f5}:null;}})[_0x908a('0x25')](respondWithResult(_0x4ae123,null))[_0x908a('0x46')](handleError(_0x4ae123,null));};exports[_0x908a('0x4e')]=function(_0x2edb11,_0x52c359,_0x57d53d){var _0x25a5e2={};var _0x3180df={};var _0x56b973;var _0x150b0b;return db[_0x908a('0x2b')]['findOne']({'where':{'id':_0x2edb11[_0x908a('0x44')]['id']}})[_0x908a('0x25')](handleEntityNotFound(_0x52c359,null))[_0x908a('0x25')](function(_0x1b06ce){if(_0x1b06ce){_0x56b973=_0x1b06ce;_0x3180df['model']=_[_0x908a('0x31')](db[_0x908a('0x4c')][_0x908a('0x2c')]);_0x3180df[_0x908a('0x32')]=_['keys'](_0x2edb11['query']);_0x3180df['filters']=_[_0x908a('0x34')](_0x3180df[_0x908a('0x2f')],_0x3180df['query']);_0x25a5e2[_0x908a('0x35')]=_[_0x908a('0x34')](_0x3180df[_0x908a('0x2f')],qs[_0x908a('0x36')](_0x2edb11['query'][_0x908a('0x36')]));_0x25a5e2[_0x908a('0x35')]=_0x25a5e2[_0x908a('0x35')][_0x908a('0x37')]?_0x25a5e2['attributes']:_0x3180df['model'];_0x25a5e2['order']=qs[_0x908a('0x3a')](_0x2edb11[_0x908a('0x32')][_0x908a('0x3a')]);_0x25a5e2[_0x908a('0x3c')]=qs[_0x908a('0x33')](_['pick'](_0x2edb11['query'],_0x3180df[_0x908a('0x33')]));if(_0x2edb11[_0x908a('0x32')][_0x908a('0x3b')]){_0x25a5e2[_0x908a('0x3c')]=_[_0x908a('0x45')](_0x25a5e2[_0x908a('0x3c')],{'$or':_[_0x908a('0x30')](_0x25a5e2[_0x908a('0x35')],function(_0x3497ce){var _0x15c42f={};_0x15c42f[_0x3497ce]={'$like':'%'+_0x2edb11[_0x908a('0x32')][_0x908a('0x3b')]+'%'};return _0x15c42f;})});}_0x25a5e2=_['merge']({},_0x25a5e2,_0x2edb11['options']);return _0x56b973[_0x908a('0x4e')](_0x25a5e2);}})['then'](function(_0x3763d6){if(_0x3763d6){_0x150b0b=_0x3763d6[_0x908a('0x37')];if(!_0x2edb11[_0x908a('0x32')][_0x908a('0x38')](_0x908a('0x39'))){_0x25a5e2[_0x908a('0x21')]=qs[_0x908a('0x21')](_0x2edb11[_0x908a('0x32')][_0x908a('0x21')]);_0x25a5e2[_0x908a('0x1e')]=qs[_0x908a('0x1e')](_0x2edb11['query']['offset']);}return _0x56b973[_0x908a('0x4e')](_0x25a5e2);}})['then'](function(_0xa4e574){if(_0xa4e574){return _0xa4e574?{'count':_0x150b0b,'rows':_0xa4e574}:null;}})['then'](respondWithResult(_0x52c359,null))[_0x908a('0x46')](handleError(_0x52c359,null));};exports[_0x908a('0x4f')]=function(_0x294888,_0x334a76,_0x4963e3){var _0x4896dd={};var _0x298aef={};var _0x18a288;var _0x31ea0e;return db[_0x908a('0x2b')][_0x908a('0x50')]({'where':{'id':_0x294888[_0x908a('0x44')]['id']}})[_0x908a('0x25')](handleEntityNotFound(_0x334a76,null))[_0x908a('0x25')](function(_0x34c343){if(_0x34c343){_0x18a288=_0x34c343;_0x298aef[_0x908a('0x2f')]=_[_0x908a('0x31')](db['ZendeskField'][_0x908a('0x2c')]);_0x298aef[_0x908a('0x32')]=_[_0x908a('0x31')](_0x294888[_0x908a('0x32')]);_0x298aef[_0x908a('0x33')]=_[_0x908a('0x34')](_0x298aef[_0x908a('0x2f')],_0x298aef[_0x908a('0x32')]);_0x4896dd['attributes']=_[_0x908a('0x34')](_0x298aef[_0x908a('0x2f')],qs[_0x908a('0x36')](_0x294888[_0x908a('0x32')]['fields']));_0x4896dd[_0x908a('0x35')]=_0x4896dd[_0x908a('0x35')]['length']?_0x4896dd[_0x908a('0x35')]:_0x298aef['model'];_0x4896dd[_0x908a('0x4d')]=qs[_0x908a('0x3a')](_0x294888['query'][_0x908a('0x3a')]);_0x4896dd[_0x908a('0x3c')]=qs[_0x908a('0x33')](_[_0x908a('0x51')](_0x294888[_0x908a('0x32')],_0x298aef['filters']));if(_0x294888[_0x908a('0x32')]['filter']){_0x4896dd[_0x908a('0x3c')]=_[_0x908a('0x45')](_0x4896dd['where'],{'$or':_[_0x908a('0x30')](_0x4896dd[_0x908a('0x35')],function(_0x239fcb){var _0x39dae1={};_0x39dae1[_0x239fcb]={'$like':'%'+_0x294888[_0x908a('0x32')]['filter']+'%'};return _0x39dae1;})});}_0x4896dd=_['merge']({},_0x4896dd,_0x294888[_0x908a('0x3f')]);return _0x18a288[_0x908a('0x4f')](_0x4896dd);}})['then'](function(_0xb372cc){if(_0xb372cc){_0x31ea0e=_0xb372cc['length'];if(!_0x294888[_0x908a('0x32')][_0x908a('0x38')](_0x908a('0x39'))){_0x4896dd[_0x908a('0x21')]=qs[_0x908a('0x21')](_0x294888[_0x908a('0x32')][_0x908a('0x21')]);_0x4896dd[_0x908a('0x1e')]=qs[_0x908a('0x1e')](_0x294888['query'][_0x908a('0x1e')]);}return _0x18a288[_0x908a('0x4f')](_0x4896dd);}})[_0x908a('0x25')](function(_0x3e08ed){if(_0x3e08ed){return _0x3e08ed?{'count':_0x31ea0e,'rows':_0x3e08ed}:null;}})[_0x908a('0x25')](respondWithResult(_0x334a76,null))['catch'](handleError(_0x334a76,null));};exports[_0x908a('0x52')]=function(_0x4f1da2,_0x2c237a,_0x29b0f2){var _0x491cd4={};var _0x1c1347={};var _0x1e6dbc;var _0xa1150;return db['ZendeskConfiguration'][_0x908a('0x50')]({'where':{'id':_0x4f1da2[_0x908a('0x44')]['id']}})[_0x908a('0x25')](handleEntityNotFound(_0x2c237a,null))[_0x908a('0x25')](function(_0x3d3b5a){if(_0x3d3b5a){_0x1e6dbc=_0x3d3b5a;_0x1c1347['model']=_[_0x908a('0x31')](db['Tag']['rawAttributes']);_0x1c1347[_0x908a('0x32')]=_[_0x908a('0x31')](_0x4f1da2[_0x908a('0x32')]);_0x1c1347[_0x908a('0x33')]=_['intersection'](_0x1c1347[_0x908a('0x2f')],_0x1c1347[_0x908a('0x32')]);_0x491cd4[_0x908a('0x35')]=_[_0x908a('0x34')](_0x1c1347[_0x908a('0x2f')],qs[_0x908a('0x36')](_0x4f1da2[_0x908a('0x32')][_0x908a('0x36')]));_0x491cd4[_0x908a('0x35')]=_0x491cd4[_0x908a('0x35')][_0x908a('0x37')]?_0x491cd4[_0x908a('0x35')]:_0x1c1347['model'];_0x491cd4[_0x908a('0x4d')]=qs[_0x908a('0x3a')](_0x4f1da2[_0x908a('0x32')][_0x908a('0x3a')]);_0x491cd4[_0x908a('0x3c')]=qs[_0x908a('0x33')](_[_0x908a('0x51')](_0x4f1da2[_0x908a('0x32')],_0x1c1347[_0x908a('0x33')]));if(_0x4f1da2[_0x908a('0x32')][_0x908a('0x3b')]){_0x491cd4['where']=_[_0x908a('0x45')](_0x491cd4[_0x908a('0x3c')],{'$or':_['map'](_0x491cd4[_0x908a('0x35')],function(_0x4c3302){var _0x59ba57={};_0x59ba57[_0x4c3302]={'$like':'%'+_0x4f1da2[_0x908a('0x32')][_0x908a('0x3b')]+'%'};return _0x59ba57;})});}_0x491cd4=_[_0x908a('0x45')]({},_0x491cd4,_0x4f1da2[_0x908a('0x3f')]);return _0x1e6dbc[_0x908a('0x52')](_0x491cd4);}})[_0x908a('0x25')](function(_0x1bc5c8){if(_0x1bc5c8){_0xa1150=_0x1bc5c8['length'];if(!_0x4f1da2[_0x908a('0x32')][_0x908a('0x38')]('nolimit')){_0x491cd4[_0x908a('0x21')]=qs[_0x908a('0x21')](_0x4f1da2['query']['limit']);_0x491cd4[_0x908a('0x1e')]=qs[_0x908a('0x1e')](_0x4f1da2['query']['offset']);}return _0x1e6dbc[_0x908a('0x52')](_0x491cd4);}})['then'](function(_0x525cad){if(_0x525cad){return _0x525cad?{'count':_0xa1150,'rows':_0x525cad}:null;}})[_0x908a('0x25')](respondWithResult(_0x2c237a,null))[_0x908a('0x46')](handleError(_0x2c237a,null));};exports[_0x908a('0x53')]=function(_0x5d91e0,_0x2f6a2b,_0x5c073f){if(_0x5d91e0[_0x908a('0x48')]['id']){delete _0x5d91e0[_0x908a('0x48')]['id'];}return db[_0x908a('0x2b')][_0x908a('0x50')]({'where':{'id':_0x5d91e0['params']['id']}})[_0x908a('0x25')](handleEntityNotFound(_0x2f6a2b,null))[_0x908a('0x25')](function(_0x19fc10){if(_0x19fc10){return _0x19fc10['setTags'](_0x5d91e0[_0x908a('0x48')][_0x908a('0x54')]||[]);}return null;})[_0x908a('0x25')](respondWithResult(_0x2f6a2b,null))[_0x908a('0x46')](handleError(_0x2f6a2b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index ad96893..52f50a8 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 _0x160f=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','int_zendesk_configurations'];(function(_0x3bde9c,_0x364111){var _0x1ac8b9=function(_0x134bcd){while(--_0x134bcd){_0x3bde9c['push'](_0x3bde9c['shift']());}};_0x1ac8b9(++_0x364111);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var logger=require(_0xf160('0x2'))(_0xf160('0x3'));var moment=require('moment');var BPromise=require(_0xf160('0x4'));var rp=require(_0xf160('0x5'));var fs=require('fs');var path=require(_0xf160('0x6'));var rimraf=require(_0xf160('0x7'));var config=require(_0xf160('0x8'));var attributes=require(_0xf160('0x9'));module['exports']=function(_0x311d63,_0x11902f){return _0x311d63['define']('ZendeskConfiguration',attributes,{'tableName':_0xf160('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb44a=['../../config/logger','moment','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x477860,_0x1c25c5){var _0x2506e5=function(_0x3a17f5){while(--_0x3a17f5){_0x477860['push'](_0x477860['shift']());}};_0x2506e5(++_0x1c25c5);}(_0xb44a,0x1c2));var _0xab44=function(_0xf13ca6,_0x5735ea){_0xf13ca6=_0xf13ca6-0x0;var _0x4a4387=_0xb44a[_0xf13ca6];return _0x4a4387;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab44('0x0'))('api');var moment=require(_0xab44('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab44('0x2'));var rimraf=require('rimraf');var config=require(_0xab44('0x3'));var attributes=require(_0xab44('0x4'));module[_0xab44('0x5')]=function(_0x28681a,_0x2f3948){return _0x28681a[_0xab44('0x6')](_0xab44('0x7'),attributes,{'tableName':_0xab44('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 f5ae273..7d9aac3 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 _0xe06b=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x21c2c8,_0x44257e){var _0x4dd745=function(_0x1b3196){while(--_0x1b3196){_0x21c2c8['push'](_0x21c2c8['shift']());}};_0x4dd745(++_0x44257e);}(_0xe06b,0x11a));var _0xbe06=function(_0x3039e2,_0x31f0b9){_0x3039e2=_0x3039e2-0x0;var _0x53d88e=_0xe06b[_0x3039e2];return _0x53d88e;};'use strict';var _=require('lodash');var util=require(_0xbe06('0x0'));var moment=require(_0xbe06('0x1'));var BPromise=require(_0xbe06('0x2'));var rs=require(_0xbe06('0x3'));var fs=require('fs');var Redis=require(_0xbe06('0x4'));var db=require(_0xbe06('0x5'))['db'];var utils=require(_0xbe06('0x6'));var logger=require(_0xbe06('0x7'))(_0xbe06('0x8'));var config=require(_0xbe06('0x9'));var jayson=require(_0xbe06('0xa'));var client=jayson[_0xbe06('0xb')][_0xbe06('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4893e2,_0x2e9923,_0x4d9700){return new BPromise(function(_0x9f75a9,_0x5857c1){return client[_0xbe06('0xd')](_0x4893e2,_0x4d9700)[_0xbe06('0xe')](function(_0x1bbaf8){logger[_0xbe06('0xf')](_0xbe06('0x10'),_0x2e9923,_0xbe06('0x11'));logger[_0xbe06('0x12')](_0xbe06('0x13'),_0x2e9923,_0xbe06('0x11'),JSON[_0xbe06('0x14')](_0x1bbaf8));if(_0x1bbaf8[_0xbe06('0x15')]){if(_0x1bbaf8[_0xbe06('0x15')][_0xbe06('0x16')]===0x1f4){logger[_0xbe06('0x15')](_0xbe06('0x10'),_0x2e9923,_0x1bbaf8[_0xbe06('0x15')][_0xbe06('0x17')]);return _0x5857c1(_0x1bbaf8['error'][_0xbe06('0x17')]);}logger[_0xbe06('0x15')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2e9923,_0x1bbaf8[_0xbe06('0x15')][_0xbe06('0x17')]);return _0x9f75a9(_0x1bbaf8['error']['message']);}else{logger[_0xbe06('0xf')](_0xbe06('0x10'),_0x2e9923,_0xbe06('0x11'));_0x9f75a9(_0x1bbaf8['result'][_0xbe06('0x17')]);}})[_0xbe06('0x18')](function(_0x458929){logger[_0xbe06('0x15')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2e9923,_0x458929);_0x5857c1(_0x458929);});});} \ No newline at end of file +var _0x5e58=['result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','code','error','message'];(function(_0x215a40,_0x3f978f){var _0x403e9f=function(_0x5be04d){while(--_0x5be04d){_0x215a40['push'](_0x215a40['shift']());}};_0x403e9f(++_0x3f978f);}(_0x5e58,0x105));var _0x85e5=function(_0x30c57f,_0x4e26ca){_0x30c57f=_0x30c57f-0x0;var _0x570756=_0x5e58[_0x30c57f];return _0x570756;};'use strict';var _=require(_0x85e5('0x0'));var util=require('util');var moment=require(_0x85e5('0x1'));var BPromise=require(_0x85e5('0x2'));var rs=require(_0x85e5('0x3'));var fs=require('fs');var Redis=require(_0x85e5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x85e5('0x5'))(_0x85e5('0x6'));var config=require(_0x85e5('0x7'));var jayson=require(_0x85e5('0x8'));var client=jayson[_0x85e5('0x9')][_0x85e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11320b,_0x549a4c,_0x4a60a6){return new BPromise(function(_0xae077b,_0x3b3dd7){return client['request'](_0x11320b,_0x4a60a6)[_0x85e5('0xb')](function(_0x4c1f5d){logger[_0x85e5('0xc')](_0x85e5('0xd'),_0x549a4c,_0x85e5('0xe'));logger[_0x85e5('0xf')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x549a4c,'request\x20sent',JSON['stringify'](_0x4c1f5d));if(_0x4c1f5d['error']){if(_0x4c1f5d['error'][_0x85e5('0x10')]===0x1f4){logger[_0x85e5('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x549a4c,_0x4c1f5d['error'][_0x85e5('0x12')]);return _0x3b3dd7(_0x4c1f5d['error'][_0x85e5('0x12')]);}logger[_0x85e5('0x11')](_0x85e5('0xd'),_0x549a4c,_0x4c1f5d[_0x85e5('0x11')]['message']);return _0xae077b(_0x4c1f5d[_0x85e5('0x11')]['message']);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x549a4c,_0x85e5('0xe'));_0xae077b(_0x4c1f5d[_0x85e5('0x13')][_0x85e5('0x12')]);}})['catch'](function(_0x2b23c6){logger[_0x85e5('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x549a4c,_0x2b23c6);_0x3b3dd7(_0x2b23c6);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index b1e8c62..95f7940 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 _0x2087=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2087,0xeb));var _0x7208=function(_0xc4dc75,_0x323bfb){_0xc4dc75=_0xc4dc75-0x0;var _0x2b4314=_0x2087[_0xc4dc75];return _0x2b4314;};'use strict';var multer=require(_0x7208('0x0'));var util=require(_0x7208('0x1'));var path=require(_0x7208('0x2'));var timeout=require(_0x7208('0x3'));var express=require(_0x7208('0x4'));var router=express[_0x7208('0x5')]();var fs_extra=require(_0x7208('0x6'));var auth=require(_0x7208('0x7'));var interaction=require(_0x7208('0x8'));var config=require(_0x7208('0x9'));var controller=require('./intZendeskField.controller');router[_0x7208('0xa')]('/',auth[_0x7208('0xb')](),controller[_0x7208('0xc')]);router[_0x7208('0xa')](_0x7208('0xd'),auth[_0x7208('0xb')](),controller[_0x7208('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7208('0xf')]);router['put']('/:id',auth[_0x7208('0xb')](),controller[_0x7208('0x10')]);router[_0x7208('0x11')](_0x7208('0xd'),auth[_0x7208('0xb')](),controller[_0x7208('0x12')]);module[_0x7208('0x13')]=router; \ No newline at end of file +var _0xe0f7=['index','/:id','show','post','create','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3393d1,_0x39976d){var _0x322d08=function(_0x522991){while(--_0x522991){_0x3393d1['push'](_0x3393d1['shift']());}};_0x322d08(++_0x39976d);}(_0xe0f7,0xe5));var _0x7e0f=function(_0xecbe34,_0x55193c){_0xecbe34=_0xecbe34-0x0;var _0x2ce68=_0xe0f7[_0xecbe34];return _0x2ce68;};'use strict';var multer=require(_0x7e0f('0x0'));var util=require('util');var path=require(_0x7e0f('0x1'));var timeout=require(_0x7e0f('0x2'));var express=require('express');var router=express[_0x7e0f('0x3')]();var fs_extra=require(_0x7e0f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7e0f('0x5'));var config=require(_0x7e0f('0x6'));var controller=require('./intZendeskField.controller');router[_0x7e0f('0x7')]('/',auth[_0x7e0f('0x8')](),controller[_0x7e0f('0x9')]);router[_0x7e0f('0x7')](_0x7e0f('0xa'),auth[_0x7e0f('0x8')](),controller[_0x7e0f('0xb')]);router[_0x7e0f('0xc')]('/',auth[_0x7e0f('0x8')](),controller[_0x7e0f('0xd')]);router['put'](_0x7e0f('0xa'),auth[_0x7e0f('0x8')](),controller[_0x7e0f('0xe')]);router['delete'](_0x7e0f('0xa'),auth[_0x7e0f('0x8')](),controller[_0x7e0f('0xf')]);module[_0x7e0f('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index fdfbd60..ddfae38 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 _0x50dc=['sequelize','exports','string','customVariable','keyValue','picklist','STRING','ENUM','variable','BOOLEAN'];(function(_0x40b94e,_0xc1bad9){var _0x2e5a21=function(_0x5801d3){while(--_0x5801d3){_0x40b94e['push'](_0x40b94e['shift']());}};_0x2e5a21(++_0xc1bad9);}(_0x50dc,0xc8));var _0xc50d=function(_0x5bdc89,_0x179e7a){_0x5bdc89=_0x5bdc89-0x0;var _0x100db3=_0x50dc[_0x5bdc89];return _0x100db3;};'use strict';var Sequelize=require(_0xc50d('0x0'));module[_0xc50d('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc50d('0x2'),'variable',_0xc50d('0x3'),_0xc50d('0x4'),_0xc50d('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc50d('0x6')]},'key':{'type':Sequelize[_0xc50d('0x6')]},'keyType':{'type':Sequelize[_0xc50d('0x7')](_0xc50d('0x2'),_0xc50d('0x8'),_0xc50d('0x3'))},'keyContent':{'type':Sequelize[_0xc50d('0x6')]},'idField':{'type':Sequelize[_0xc50d('0x6')]},'nameField':{'type':Sequelize[_0xc50d('0x6')]},'customField':{'type':Sequelize[_0xc50d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc50d('0x6')]}}; \ No newline at end of file +var _0xf042=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x3a1ed2,_0x542605){var _0x29999a=function(_0x4c0abc){while(--_0x4c0abc){_0x3a1ed2['push'](_0x3a1ed2['shift']());}};_0x29999a(++_0x542605);}(_0xf042,0x1b8));var _0x2f04=function(_0x1a6643,_0x2f29e2){_0x1a6643=_0x1a6643-0x0;var _0x4a7031=_0xf042[_0x1a6643];return _0x4a7031;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2f04('0x0')](_0x2f04('0x1'),_0x2f04('0x2'),_0x2f04('0x3'),_0x2f04('0x4'),_0x2f04('0x5')),'defaultValue':_0x2f04('0x1')},'content':{'type':Sequelize[_0x2f04('0x6')]},'key':{'type':Sequelize[_0x2f04('0x6')]},'keyType':{'type':Sequelize[_0x2f04('0x0')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x2f04('0x6')]},'idField':{'type':Sequelize[_0x2f04('0x6')]},'nameField':{'type':Sequelize[_0x2f04('0x6')]},'customField':{'type':Sequelize[_0x2f04('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2f04('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 2e5155b..cd8eff5 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 _0x4512=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','ZendeskField','rawAttributes','type','key','model'];(function(_0x201ed2,_0x1042cc){var _0x138582=function(_0x682b4a){while(--_0x682b4a){_0x201ed2['push'](_0x201ed2['shift']());}};_0x138582(++_0x1042cc);}(_0x4512,0x1e7));var _0x2451=function(_0xf4add4,_0x5b9cc1){_0xf4add4=_0xf4add4-0x0;var _0x1c42fb=_0x4512[_0xf4add4];return _0x1c42fb;};'use strict';var emlformat=require(_0x2451('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2451('0x1'));var jsonpatch=require(_0x2451('0x2'));var rp=require('request-promise');var moment=require(_0x2451('0x3'));var BPromise=require(_0x2451('0x4'));var Mustache=require(_0x2451('0x5'));var util=require(_0x2451('0x6'));var path=require('path');var sox=require(_0x2451('0x7'));var csv=require('to-csv');var ejs=require(_0x2451('0x8'));var fs=require('fs');var fs_extra=require(_0x2451('0x9'));var _=require(_0x2451('0xa'));var squel=require(_0x2451('0xb'));var crypto=require(_0x2451('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2451('0xd'));var toCsv=require(_0x2451('0xe'));var querystring=require(_0x2451('0xf'));var Papa=require(_0x2451('0x10'));var Redis=require(_0x2451('0x11'));var authService=require(_0x2451('0x12'));var qs=require(_0x2451('0x13'));var as=require(_0x2451('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2451('0x15'))(_0x2451('0x16'));var utils=require(_0x2451('0x17'));var config=require(_0x2451('0x18'));var licenseUtil=require(_0x2451('0x19'));var db=require(_0x2451('0x1a'))['db'];function respondWithStatusCode(_0x4135c5,_0xe5c70c){_0xe5c70c=_0xe5c70c||0xcc;return function(_0x429a61){if(_0x429a61){return _0x4135c5[_0x2451('0x1b')](_0xe5c70c);}return _0x4135c5['status'](_0xe5c70c)[_0x2451('0x1c')]();};}function respondWithResult(_0x174347,_0x27d060){_0x27d060=_0x27d060||0xc8;return function(_0x3bbc00){if(_0x3bbc00){return _0x174347[_0x2451('0x1d')](_0x27d060)[_0x2451('0x1e')](_0x3bbc00);}};}function respondWithFilteredResult(_0x7a935a,_0x59f8ce){return function(_0x458682){if(_0x458682){var _0x52ef9e=typeof _0x59f8ce[_0x2451('0x1f')]===_0x2451('0x20')&&typeof _0x59f8ce[_0x2451('0x21')]===_0x2451('0x20');var _0x571301=_0x458682[_0x2451('0x22')];var _0x5cfd9f=_0x52ef9e?0x0:_0x59f8ce[_0x2451('0x1f')];var _0x4bf84e=_0x52ef9e?_0x458682[_0x2451('0x22')]:_0x59f8ce[_0x2451('0x1f')]+_0x59f8ce[_0x2451('0x21')];var _0xb53179;if(_0x4bf84e>=_0x571301){_0x4bf84e=_0x571301;_0xb53179=0xc8;}else{_0xb53179=0xce;}_0x7a935a[_0x2451('0x1d')](_0xb53179);return _0x7a935a[_0x2451('0x23')](_0x2451('0x24'),_0x5cfd9f+'-'+_0x4bf84e+'/'+_0x571301)[_0x2451('0x1e')](_0x458682);}return null;};}function patchUpdates(_0x4dd382){return function(_0x5cb073){try{jsonpatch[_0x2451('0x25')](_0x5cb073,_0x4dd382,!![]);}catch(_0x42eacf){return BPromise[_0x2451('0x26')](_0x42eacf);}return _0x5cb073[_0x2451('0x27')]();};}function saveUpdates(_0x5ec657,_0xeafcfe){return function(_0x2d5170){if(_0x2d5170){return _0x2d5170[_0x2451('0x28')](_0x5ec657)['then'](function(_0x1af07f){return _0x1af07f;});}return null;};}function removeEntity(_0x2f3ba2,_0x67ee8e){return function(_0x1616d4){if(_0x1616d4){return _0x1616d4[_0x2451('0x29')]()[_0x2451('0x2a')](function(){_0x2f3ba2['status'](0xcc)[_0x2451('0x1c')]();});}};}function handleEntityNotFound(_0x5e36b9,_0x4569d7){return function(_0x46dcb0){if(!_0x46dcb0){_0x5e36b9[_0x2451('0x1b')](0x194);}return _0x46dcb0;};}function handleError(_0x30661f,_0x41dff4){_0x41dff4=_0x41dff4||0x1f4;return function(_0x2d022d){logger['error'](_0x2d022d['stack']);if(_0x2d022d[_0x2451('0x2b')]){delete _0x2d022d[_0x2451('0x2b')];}_0x30661f[_0x2451('0x1d')](_0x41dff4)[_0x2451('0x2c')](_0x2d022d);};}exports[_0x2451('0x2d')]=function(_0x3a5bf1,_0x251728){var _0xd9d48c={},_0x10037c={},_0x426d32={'count':0x0,'rows':[]};var _0x41d8ca=_[_0x2451('0x2e')](db[_0x2451('0x2f')][_0x2451('0x30')],function(_0x3fc30d){return{'name':_0x3fc30d['fieldName'],'type':_0x3fc30d[_0x2451('0x31')][_0x2451('0x32')]};});_0x10037c[_0x2451('0x33')]=_[_0x2451('0x2e')](_0x41d8ca,_0x2451('0x2b'));_0x10037c[_0x2451('0x34')]=_['keys'](_0x3a5bf1[_0x2451('0x34')]);_0x10037c[_0x2451('0x35')]=_[_0x2451('0x36')](_0x10037c[_0x2451('0x33')],_0x10037c['query']);_0xd9d48c[_0x2451('0x37')]=_[_0x2451('0x36')](_0x10037c[_0x2451('0x33')],qs[_0x2451('0x38')](_0x3a5bf1[_0x2451('0x34')][_0x2451('0x38')]));_0xd9d48c['attributes']=_0xd9d48c[_0x2451('0x37')][_0x2451('0x39')]?_0xd9d48c[_0x2451('0x37')]:_0x10037c[_0x2451('0x33')];if(!_0x3a5bf1[_0x2451('0x34')][_0x2451('0x3a')](_0x2451('0x3b'))){_0xd9d48c[_0x2451('0x21')]=qs[_0x2451('0x21')](_0x3a5bf1[_0x2451('0x34')][_0x2451('0x21')]);_0xd9d48c[_0x2451('0x1f')]=qs[_0x2451('0x1f')](_0x3a5bf1[_0x2451('0x34')][_0x2451('0x1f')]);}_0xd9d48c[_0x2451('0x3c')]=qs[_0x2451('0x3d')](_0x3a5bf1[_0x2451('0x34')][_0x2451('0x3d')]);_0xd9d48c[_0x2451('0x3e')]=qs[_0x2451('0x35')](_['pick'](_0x3a5bf1['query'],_0x10037c['filters']),_0x41d8ca);if(_0x3a5bf1[_0x2451('0x34')][_0x2451('0x3f')]){_0xd9d48c[_0x2451('0x3e')]=_[_0x2451('0x40')](_0xd9d48c[_0x2451('0x3e')],{'$or':_['map'](_0x41d8ca,function(_0x1692e8){if(_0x1692e8[_0x2451('0x31')]!==_0x2451('0x41')){var _0x49f0fa={};_0x49f0fa[_0x1692e8[_0x2451('0x2b')]]={'$like':'%'+_0x3a5bf1[_0x2451('0x34')][_0x2451('0x3f')]+'%'};return _0x49f0fa;}})});}_0xd9d48c=_[_0x2451('0x40')]({},_0xd9d48c,_0x3a5bf1[_0x2451('0x42')]);var _0x361328={'where':_0xd9d48c[_0x2451('0x3e')]};return db[_0x2451('0x2f')][_0x2451('0x22')](_0x361328)[_0x2451('0x2a')](function(_0x3ed2c2){_0x426d32[_0x2451('0x22')]=_0x3ed2c2;if(_0x3a5bf1[_0x2451('0x34')][_0x2451('0x43')]){_0xd9d48c[_0x2451('0x44')]=[{'all':!![]}];}return db[_0x2451('0x2f')][_0x2451('0x45')](_0xd9d48c);})[_0x2451('0x2a')](function(_0x20cbcf){_0x426d32[_0x2451('0x46')]=_0x20cbcf;return _0x426d32;})[_0x2451('0x2a')](respondWithFilteredResult(_0x251728,_0xd9d48c))[_0x2451('0x47')](handleError(_0x251728,null));};exports['show']=function(_0x597381,_0x3b5cbc){var _0xe37f6b={'raw':!![],'where':{'id':_0x597381[_0x2451('0x48')]['id']}},_0x2d19d0={};_0x2d19d0[_0x2451('0x33')]=_['keys'](db[_0x2451('0x2f')][_0x2451('0x30')]);_0x2d19d0[_0x2451('0x34')]=_[_0x2451('0x49')](_0x597381[_0x2451('0x34')]);_0x2d19d0[_0x2451('0x35')]=_['intersection'](_0x2d19d0['model'],_0x2d19d0[_0x2451('0x34')]);_0xe37f6b[_0x2451('0x37')]=_[_0x2451('0x36')](_0x2d19d0[_0x2451('0x33')],qs[_0x2451('0x38')](_0x597381[_0x2451('0x34')][_0x2451('0x38')]));_0xe37f6b[_0x2451('0x37')]=_0xe37f6b['attributes'][_0x2451('0x39')]?_0xe37f6b['attributes']:_0x2d19d0[_0x2451('0x33')];if(_0x597381[_0x2451('0x34')][_0x2451('0x43')]){_0xe37f6b[_0x2451('0x44')]=[{'all':!![]}];}_0xe37f6b=_[_0x2451('0x40')]({},_0xe37f6b,_0x597381[_0x2451('0x42')]);return db[_0x2451('0x2f')][_0x2451('0x4a')](_0xe37f6b)[_0x2451('0x2a')](handleEntityNotFound(_0x3b5cbc,null))[_0x2451('0x2a')](respondWithResult(_0x3b5cbc,null))[_0x2451('0x47')](handleError(_0x3b5cbc,null));};exports[_0x2451('0x4b')]=function(_0x35c2b3,_0xa3be91){return db['ZendeskField'][_0x2451('0x4b')](_0x35c2b3[_0x2451('0x4c')],{})[_0x2451('0x2a')](respondWithResult(_0xa3be91,0xc9))[_0x2451('0x47')](handleError(_0xa3be91,null));};exports[_0x2451('0x28')]=function(_0x327c52,_0x1669ce){if(_0x327c52['body']['id']){delete _0x327c52[_0x2451('0x4c')]['id'];}return db['ZendeskField'][_0x2451('0x4a')]({'where':{'id':_0x327c52[_0x2451('0x48')]['id']}})[_0x2451('0x2a')](handleEntityNotFound(_0x1669ce,null))[_0x2451('0x2a')](saveUpdates(_0x327c52['body'],null))['then'](respondWithResult(_0x1669ce,null))[_0x2451('0x47')](handleError(_0x1669ce,null));};exports['destroy']=function(_0x110d60,_0x431aa0){return db[_0x2451('0x2f')][_0x2451('0x4a')]({'where':{'id':_0x110d60[_0x2451('0x48')]['id']}})[_0x2451('0x2a')](handleEntityNotFound(_0x431aa0,null))['then'](removeEntity(_0x431aa0,null))[_0x2451('0x47')](handleError(_0x431aa0,null));}; \ No newline at end of file +var _0xf611=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length'];(function(_0x221302,_0x3397bf){var _0x59d61c=function(_0x38450d){while(--_0x38450d){_0x221302['push'](_0x221302['shift']());}};_0x59d61c(++_0x3397bf);}(_0xf611,0xb6));var _0x1f61=function(_0x26da5e,_0x2f4830){_0x26da5e=_0x26da5e-0x0;var _0x19932c=_0xf611[_0x26da5e];return _0x19932c;};'use strict';var emlformat=require(_0x1f61('0x0'));var rimraf=require(_0x1f61('0x1'));var zipdir=require(_0x1f61('0x2'));var jsonpatch=require(_0x1f61('0x3'));var rp=require(_0x1f61('0x4'));var moment=require(_0x1f61('0x5'));var BPromise=require(_0x1f61('0x6'));var Mustache=require(_0x1f61('0x7'));var util=require(_0x1f61('0x8'));var path=require(_0x1f61('0x9'));var sox=require('sox');var csv=require(_0x1f61('0xa'));var ejs=require(_0x1f61('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f61('0xc'));var squel=require(_0x1f61('0xd'));var crypto=require('crypto');var jsforce=require(_0x1f61('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1f61('0xa'));var querystring=require('querystring');var Papa=require(_0x1f61('0xf'));var Redis=require(_0x1f61('0x10'));var authService=require(_0x1f61('0x11'));var qs=require(_0x1f61('0x12'));var as=require(_0x1f61('0x13'));var hardwareService=require(_0x1f61('0x14'));var logger=require(_0x1f61('0x15'))(_0x1f61('0x16'));var utils=require('../../config/utils');var config=require(_0x1f61('0x17'));var licenseUtil=require(_0x1f61('0x18'));var db=require(_0x1f61('0x19'))['db'];function respondWithStatusCode(_0x581e50,_0x9f87e1){_0x9f87e1=_0x9f87e1||0xcc;return function(_0x2b5882){if(_0x2b5882){return _0x581e50[_0x1f61('0x1a')](_0x9f87e1);}return _0x581e50[_0x1f61('0x1b')](_0x9f87e1)[_0x1f61('0x1c')]();};}function respondWithResult(_0x3eb186,_0x11184e){_0x11184e=_0x11184e||0xc8;return function(_0x4cca6d){if(_0x4cca6d){return _0x3eb186[_0x1f61('0x1b')](_0x11184e)[_0x1f61('0x1d')](_0x4cca6d);}};}function respondWithFilteredResult(_0x14abc9,_0x35da9a){return function(_0x49082a){if(_0x49082a){var _0xcf3191=typeof _0x35da9a[_0x1f61('0x1e')]===_0x1f61('0x1f')&&typeof _0x35da9a['limit']===_0x1f61('0x1f');var _0x662969=_0x49082a['count'];var _0x28441a=_0xcf3191?0x0:_0x35da9a[_0x1f61('0x1e')];var _0x3709a1=_0xcf3191?_0x49082a[_0x1f61('0x20')]:_0x35da9a[_0x1f61('0x1e')]+_0x35da9a[_0x1f61('0x21')];var _0xd44fa3;if(_0x3709a1>=_0x662969){_0x3709a1=_0x662969;_0xd44fa3=0xc8;}else{_0xd44fa3=0xce;}_0x14abc9[_0x1f61('0x1b')](_0xd44fa3);return _0x14abc9[_0x1f61('0x22')](_0x1f61('0x23'),_0x28441a+'-'+_0x3709a1+'/'+_0x662969)[_0x1f61('0x1d')](_0x49082a);}return null;};}function patchUpdates(_0x538b9c){return function(_0xf7bcae){try{jsonpatch[_0x1f61('0x24')](_0xf7bcae,_0x538b9c,!![]);}catch(_0x1de128){return BPromise[_0x1f61('0x25')](_0x1de128);}return _0xf7bcae[_0x1f61('0x26')]();};}function saveUpdates(_0x238b97,_0x58890b){return function(_0xa286f6){if(_0xa286f6){return _0xa286f6[_0x1f61('0x27')](_0x238b97)[_0x1f61('0x28')](function(_0x59551f){return _0x59551f;});}return null;};}function removeEntity(_0x474b5f,_0x1274b6){return function(_0x42f603){if(_0x42f603){return _0x42f603[_0x1f61('0x29')]()['then'](function(){_0x474b5f['status'](0xcc)[_0x1f61('0x1c')]();});}};}function handleEntityNotFound(_0x29c432,_0x44d48f){return function(_0x52ae9c){if(!_0x52ae9c){_0x29c432[_0x1f61('0x1a')](0x194);}return _0x52ae9c;};}function handleError(_0x1fac9e,_0x2e9ea7){_0x2e9ea7=_0x2e9ea7||0x1f4;return function(_0x5bfcfa){logger[_0x1f61('0x2a')](_0x5bfcfa[_0x1f61('0x2b')]);if(_0x5bfcfa[_0x1f61('0x2c')]){delete _0x5bfcfa['name'];}_0x1fac9e[_0x1f61('0x1b')](_0x2e9ea7)[_0x1f61('0x2d')](_0x5bfcfa);};}exports[_0x1f61('0x2e')]=function(_0x1335ec,_0x2d28c4){var _0x1399e8={},_0x31e603={},_0x5343ae={'count':0x0,'rows':[]};var _0x5281e5=_[_0x1f61('0x2f')](db[_0x1f61('0x30')][_0x1f61('0x31')],function(_0x25ce35){return{'name':_0x25ce35[_0x1f61('0x32')],'type':_0x25ce35[_0x1f61('0x33')][_0x1f61('0x34')]};});_0x31e603[_0x1f61('0x35')]=_['map'](_0x5281e5,_0x1f61('0x2c'));_0x31e603[_0x1f61('0x36')]=_[_0x1f61('0x37')](_0x1335ec[_0x1f61('0x36')]);_0x31e603[_0x1f61('0x38')]=_['intersection'](_0x31e603[_0x1f61('0x35')],_0x31e603['query']);_0x1399e8[_0x1f61('0x39')]=_[_0x1f61('0x3a')](_0x31e603[_0x1f61('0x35')],qs[_0x1f61('0x3b')](_0x1335ec[_0x1f61('0x36')][_0x1f61('0x3b')]));_0x1399e8[_0x1f61('0x39')]=_0x1399e8[_0x1f61('0x39')][_0x1f61('0x3c')]?_0x1399e8[_0x1f61('0x39')]:_0x31e603[_0x1f61('0x35')];if(!_0x1335ec['query'][_0x1f61('0x3d')](_0x1f61('0x3e'))){_0x1399e8[_0x1f61('0x21')]=qs[_0x1f61('0x21')](_0x1335ec['query'][_0x1f61('0x21')]);_0x1399e8[_0x1f61('0x1e')]=qs['offset'](_0x1335ec[_0x1f61('0x36')][_0x1f61('0x1e')]);}_0x1399e8[_0x1f61('0x3f')]=qs['sort'](_0x1335ec['query'][_0x1f61('0x40')]);_0x1399e8[_0x1f61('0x41')]=qs['filters'](_[_0x1f61('0x42')](_0x1335ec[_0x1f61('0x36')],_0x31e603[_0x1f61('0x38')]),_0x5281e5);if(_0x1335ec[_0x1f61('0x36')][_0x1f61('0x43')]){_0x1399e8['where']=_[_0x1f61('0x44')](_0x1399e8[_0x1f61('0x41')],{'$or':_[_0x1f61('0x2f')](_0x5281e5,function(_0x1713d9){if(_0x1713d9[_0x1f61('0x33')]!==_0x1f61('0x45')){var _0x49203f={};_0x49203f[_0x1713d9[_0x1f61('0x2c')]]={'$like':'%'+_0x1335ec[_0x1f61('0x36')][_0x1f61('0x43')]+'%'};return _0x49203f;}})});}_0x1399e8=_['merge']({},_0x1399e8,_0x1335ec[_0x1f61('0x46')]);var _0x160da9={'where':_0x1399e8['where']};return db[_0x1f61('0x30')]['count'](_0x160da9)[_0x1f61('0x28')](function(_0x5a2fd0){_0x5343ae[_0x1f61('0x20')]=_0x5a2fd0;if(_0x1335ec['query'][_0x1f61('0x47')]){_0x1399e8[_0x1f61('0x48')]=[{'all':!![]}];}return db[_0x1f61('0x30')][_0x1f61('0x49')](_0x1399e8);})[_0x1f61('0x28')](function(_0x4efe47){_0x5343ae[_0x1f61('0x4a')]=_0x4efe47;return _0x5343ae;})[_0x1f61('0x28')](respondWithFilteredResult(_0x2d28c4,_0x1399e8))[_0x1f61('0x4b')](handleError(_0x2d28c4,null));};exports[_0x1f61('0x4c')]=function(_0x4c1fe2,_0x265b96){var _0x388863={'raw':!![],'where':{'id':_0x4c1fe2[_0x1f61('0x4d')]['id']}},_0x248497={};_0x248497[_0x1f61('0x35')]=_[_0x1f61('0x37')](db[_0x1f61('0x30')][_0x1f61('0x31')]);_0x248497[_0x1f61('0x36')]=_['keys'](_0x4c1fe2['query']);_0x248497[_0x1f61('0x38')]=_[_0x1f61('0x3a')](_0x248497[_0x1f61('0x35')],_0x248497[_0x1f61('0x36')]);_0x388863[_0x1f61('0x39')]=_[_0x1f61('0x3a')](_0x248497[_0x1f61('0x35')],qs[_0x1f61('0x3b')](_0x4c1fe2[_0x1f61('0x36')][_0x1f61('0x3b')]));_0x388863[_0x1f61('0x39')]=_0x388863[_0x1f61('0x39')][_0x1f61('0x3c')]?_0x388863[_0x1f61('0x39')]:_0x248497[_0x1f61('0x35')];if(_0x4c1fe2['query'][_0x1f61('0x47')]){_0x388863[_0x1f61('0x48')]=[{'all':!![]}];}_0x388863=_['merge']({},_0x388863,_0x4c1fe2['options']);return db['ZendeskField'][_0x1f61('0x4e')](_0x388863)['then'](handleEntityNotFound(_0x265b96,null))[_0x1f61('0x28')](respondWithResult(_0x265b96,null))['catch'](handleError(_0x265b96,null));};exports[_0x1f61('0x4f')]=function(_0x4fb8ac,_0x2efe82){return db['ZendeskField'][_0x1f61('0x4f')](_0x4fb8ac[_0x1f61('0x50')],{})['then'](respondWithResult(_0x2efe82,0xc9))[_0x1f61('0x4b')](handleError(_0x2efe82,null));};exports[_0x1f61('0x27')]=function(_0x494391,_0x6bf50e){if(_0x494391[_0x1f61('0x50')]['id']){delete _0x494391[_0x1f61('0x50')]['id'];}return db[_0x1f61('0x30')][_0x1f61('0x4e')]({'where':{'id':_0x494391[_0x1f61('0x4d')]['id']}})[_0x1f61('0x28')](handleEntityNotFound(_0x6bf50e,null))['then'](saveUpdates(_0x494391['body'],null))['then'](respondWithResult(_0x6bf50e,null))[_0x1f61('0x4b')](handleError(_0x6bf50e,null));};exports[_0x1f61('0x29')]=function(_0x5d49b7,_0x5abc07){return db['ZendeskField']['find']({'where':{'id':_0x5d49b7[_0x1f61('0x4d')]['id']}})[_0x1f61('0x28')](handleEntityNotFound(_0x5abc07,null))[_0x1f61('0x28')](removeEntity(_0x5abc07,null))[_0x1f61('0x4b')](handleError(_0x5abc07,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index f9d4958..d89b868 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 _0x835c=['./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x835c,0xa7));var _0xc835=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x835c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xc835('0x0'));var util=require('util');var logger=require(_0xc835('0x1'))(_0xc835('0x2'));var moment=require(_0xc835('0x3'));var BPromise=require(_0xc835('0x4'));var rp=require(_0xc835('0x5'));var fs=require('fs');var path=require(_0xc835('0x6'));var rimraf=require(_0xc835('0x7'));var config=require(_0xc835('0x8'));var attributes=require(_0xc835('0x9'));module['exports']=function(_0x357a8c,_0x114307){return _0x357a8c[_0xc835('0xa')](_0xc835('0xb'),attributes,{'tableName':_0xc835('0xc'),'paranoid':![],'indexes':[{'name':_0xc835('0xd'),'fields':[_0xc835('0xe'),_0xc835('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5bb8=['../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x54f930,_0x32049f){var _0x2c0164=function(_0x33a3a6){while(--_0x33a3a6){_0x54f930['push'](_0x54f930['shift']());}};_0x2c0164(++_0x32049f);}(_0x5bb8,0x68));var _0x85bb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5bb8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x85bb('0x0'));var util=require(_0x85bb('0x1'));var logger=require('../../config/logger')(_0x85bb('0x2'));var moment=require(_0x85bb('0x3'));var BPromise=require(_0x85bb('0x4'));var rp=require(_0x85bb('0x5'));var fs=require('fs');var path=require(_0x85bb('0x6'));var rimraf=require(_0x85bb('0x7'));var config=require(_0x85bb('0x8'));var attributes=require(_0x85bb('0x9'));module[_0x85bb('0xa')]=function(_0x2112a8,_0x17c138){return _0x2112a8[_0x85bb('0xb')](_0x85bb('0xc'),attributes,{'tableName':_0x85bb('0xd'),'paranoid':![],'indexes':[{'name':_0x85bb('0xe'),'fields':[_0x85bb('0xf'),'FieldId'],'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 bb7237d..ec346d0 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 _0x3016=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','error','code','ZendeskField,\x20%s,\x20%s','message','result'];(function(_0x2b2ada,_0x3e95a6){var _0x4b8507=function(_0x144fe6){while(--_0x144fe6){_0x2b2ada['push'](_0x2b2ada['shift']());}};_0x4b8507(++_0x3e95a6);}(_0x3016,0x17a));var _0x6301=function(_0x6317ae,_0x4b3798){_0x6317ae=_0x6317ae-0x0;var _0x28f4a7=_0x3016[_0x6317ae];return _0x28f4a7;};'use strict';var _=require(_0x6301('0x0'));var util=require(_0x6301('0x1'));var moment=require(_0x6301('0x2'));var BPromise=require(_0x6301('0x3'));var rs=require(_0x6301('0x4'));var fs=require('fs');var Redis=require(_0x6301('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6301('0x6'))(_0x6301('0x7'));var config=require(_0x6301('0x8'));var jayson=require(_0x6301('0x9'));var client=jayson[_0x6301('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5377a4,_0x3ffad1,_0x452b8c){return new BPromise(function(_0x3742be,_0x31315b){return client[_0x6301('0xb')](_0x5377a4,_0x452b8c)[_0x6301('0xc')](function(_0x6d0456){logger[_0x6301('0xd')]('ZendeskField,\x20%s,\x20%s',_0x3ffad1,_0x6301('0xe'));logger[_0x6301('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x3ffad1,_0x6301('0xe'),JSON['stringify'](_0x6d0456));if(_0x6d0456['error']){if(_0x6d0456[_0x6301('0x10')][_0x6301('0x11')]===0x1f4){logger['error'](_0x6301('0x12'),_0x3ffad1,_0x6d0456['error'][_0x6301('0x13')]);return _0x31315b(_0x6d0456[_0x6301('0x10')][_0x6301('0x13')]);}logger[_0x6301('0x10')](_0x6301('0x12'),_0x3ffad1,_0x6d0456['error'][_0x6301('0x13')]);return _0x3742be(_0x6d0456[_0x6301('0x10')][_0x6301('0x13')]);}else{logger[_0x6301('0xd')](_0x6301('0x12'),_0x3ffad1,_0x6301('0xe'));_0x3742be(_0x6d0456[_0x6301('0x14')]['message']);}})['catch'](function(_0x419c5e){logger[_0x6301('0x10')](_0x6301('0x12'),_0x3ffad1,_0x419c5e);_0x31315b(_0x419c5e);});});} \ No newline at end of file +var _0xfead=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x139745,_0x503124){var _0x2cd695=function(_0x2ab1ba){while(--_0x2ab1ba){_0x139745['push'](_0x139745['shift']());}};_0x2cd695(++_0x503124);}(_0xfead,0x1a7));var _0xdfea=function(_0xb870e9,_0x21bbd3){_0xb870e9=_0xb870e9-0x0;var _0x561449=_0xfead[_0xb870e9];return _0x561449;};'use strict';var _=require(_0xdfea('0x0'));var util=require(_0xdfea('0x1'));var moment=require('moment');var BPromise=require(_0xdfea('0x2'));var rs=require(_0xdfea('0x3'));var fs=require('fs');var Redis=require(_0xdfea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdfea('0x5'));var logger=require(_0xdfea('0x6'))(_0xdfea('0x7'));var config=require(_0xdfea('0x8'));var jayson=require(_0xdfea('0x9'));var client=jayson['client'][_0xdfea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3558a5,_0x2ece74,_0x5365ad){return new BPromise(function(_0x42ed3b,_0x17515d){return client[_0xdfea('0xb')](_0x3558a5,_0x5365ad)[_0xdfea('0xc')](function(_0x4618b8){logger[_0xdfea('0xd')](_0xdfea('0xe'),_0x2ece74,'request\x20sent');logger[_0xdfea('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x2ece74,_0xdfea('0x10'),JSON['stringify'](_0x4618b8));if(_0x4618b8[_0xdfea('0x11')]){if(_0x4618b8[_0xdfea('0x11')][_0xdfea('0x12')]===0x1f4){logger[_0xdfea('0x11')](_0xdfea('0xe'),_0x2ece74,_0x4618b8[_0xdfea('0x11')][_0xdfea('0x13')]);return _0x17515d(_0x4618b8[_0xdfea('0x11')][_0xdfea('0x13')]);}logger[_0xdfea('0x11')](_0xdfea('0xe'),_0x2ece74,_0x4618b8[_0xdfea('0x11')][_0xdfea('0x13')]);return _0x42ed3b(_0x4618b8['error'][_0xdfea('0x13')]);}else{logger[_0xdfea('0xd')](_0xdfea('0xe'),_0x2ece74,_0xdfea('0x10'));_0x42ed3b(_0x4618b8[_0xdfea('0x14')][_0xdfea('0x13')]);}})[_0xdfea('0x15')](function(_0xca3ec){logger[_0xdfea('0x11')](_0xdfea('0xe'),_0x2ece74,_0xca3ec);_0x17515d(_0xca3ec);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 0d87e16..9d5eb4a 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 _0x25d0=['create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x4f4f59,_0x4215c1){var _0x322725=function(_0x4eda03){while(--_0x4eda03){_0x4f4f59['push'](_0x4f4f59['shift']());}};_0x322725(++_0x4215c1);}(_0x25d0,0x100));var _0x025d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x025d('0x0'));var util=require(_0x025d('0x1'));var path=require(_0x025d('0x2'));var timeout=require(_0x025d('0x3'));var express=require(_0x025d('0x4'));var router=express[_0x025d('0x5')]();var fs_extra=require(_0x025d('0x6'));var auth=require(_0x025d('0x7'));var interaction=require(_0x025d('0x8'));var config=require('../../config/environment');var controller=require(_0x025d('0x9'));router['get']('/',auth[_0x025d('0xa')](),controller[_0x025d('0xb')]);router[_0x025d('0xc')](_0x025d('0xd'),auth[_0x025d('0xa')](),controller[_0x025d('0xe')]);router[_0x025d('0xc')](_0x025d('0xf'),auth[_0x025d('0xa')](),controller[_0x025d('0x10')]);router['get'](_0x025d('0x11'),auth['isAuthenticated'](),controller['getFields']);router[_0x025d('0x12')]('/',auth['isAuthenticated'](),controller[_0x025d('0x13')]);router[_0x025d('0x12')]('/:id/configurations',auth[_0x025d('0xa')](),controller[_0x025d('0x14')]);router[_0x025d('0x15')](_0x025d('0xd'),auth[_0x025d('0xa')](),controller[_0x025d('0x16')]);router['delete'](_0x025d('0xd'),auth[_0x025d('0xa')](),controller[_0x025d('0x17')]);module[_0x025d('0x18')]=router; \ No newline at end of file +var _0xa43d=['create','addConfiguration','put','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','/:id/fields','getFields','post'];(function(_0x468ebb,_0x6f1d8d){var _0x8901c=function(_0x12c00e){while(--_0x12c00e){_0x468ebb['push'](_0x468ebb['shift']());}};_0x8901c(++_0x6f1d8d);}(_0xa43d,0x122));var _0xda43=function(_0x4375fb,_0x22650a){_0x4375fb=_0x4375fb-0x0;var _0x445a97=_0xa43d[_0x4375fb];return _0x445a97;};'use strict';var multer=require(_0xda43('0x0'));var util=require(_0xda43('0x1'));var path=require(_0xda43('0x2'));var timeout=require('connect-timeout');var express=require(_0xda43('0x3'));var router=express[_0xda43('0x4')]();var fs_extra=require(_0xda43('0x5'));var auth=require(_0xda43('0x6'));var interaction=require(_0xda43('0x7'));var config=require(_0xda43('0x8'));var controller=require(_0xda43('0x9'));router[_0xda43('0xa')]('/',auth['isAuthenticated'](),controller[_0xda43('0xb')]);router['get'](_0xda43('0xc'),auth[_0xda43('0xd')](),controller['show']);router[_0xda43('0xa')](_0xda43('0xe'),auth[_0xda43('0xd')](),controller['getConfigurations']);router[_0xda43('0xa')](_0xda43('0xf'),auth[_0xda43('0xd')](),controller[_0xda43('0x10')]);router[_0xda43('0x11')]('/',auth[_0xda43('0xd')](),controller[_0xda43('0x12')]);router['post'](_0xda43('0xe'),auth[_0xda43('0xd')](),controller[_0xda43('0x13')]);router[_0xda43('0x14')](_0xda43('0xc'),auth[_0xda43('0xd')](),controller['update']);router[_0xda43('0x15')](_0xda43('0xc'),auth[_0xda43('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index a5f6158..daca768 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 _0xb821=['STRING','exports'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xb821,0xa7));var _0x1b82=function(_0x127650,_0x18c9cf){_0x127650=_0x127650-0x0;var _0x24c7a2=_0xb821[_0x127650];return _0x24c7a2;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'name':{'type':Sequelize[_0x1b82('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x1b82('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1b82('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x1b82('0x1')]},'refreshToken':{'type':Sequelize[_0x1b82('0x1')]}}; \ No newline at end of file +var _0xee5b=['sequelize','STRING'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xee5b,0x1f4));var _0xbee5=function(_0x22c607,_0x54d5b5){_0x22c607=_0x22c607-0x0;var _0x2508db=_0xee5b[_0x22c607];return _0x2508db;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'name':{'type':Sequelize[_0xbee5('0x1')]},'description':{'type':Sequelize[_0xbee5('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xbee5('0x1')]},'clientId':{'type':Sequelize[_0xbee5('0x1')]},'clientSecret':{'type':Sequelize[_0xbee5('0x1')]},'serverUrl':{'type':Sequelize[_0xbee5('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'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 0864caa..0d81398 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 _0xafbf=['merge','VIRTUAL','options','ZohoAccount','then','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','params','destroy','find','findOne','ZohoConfiguration','getConfigurations','hasOwnProperty','nolimit','getSubjects','getDescriptions','channel','Subjects','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','getFields','host','serverUrl','code','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Zoho-oauthtoken\x20','response','message','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','system_mandatory','push','display_label','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','save','update','error','name','send','map','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick','filter'];(function(_0x1ee367,_0x3f99e6){var _0x1b2213=function(_0x42dd22){while(--_0x42dd22){_0x1ee367['push'](_0x1ee367['shift']());}};_0x1b2213(++_0x3f99e6);}(_0xafbf,0x13c));var _0xfafb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xafbf[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xfafb('0x0'));var rimraf=require(_0xfafb('0x1'));var zipdir=require(_0xfafb('0x2'));var jsonpatch=require(_0xfafb('0x3'));var rp=require(_0xfafb('0x4'));var moment=require(_0xfafb('0x5'));var BPromise=require(_0xfafb('0x6'));var Mustache=require(_0xfafb('0x7'));var util=require(_0xfafb('0x8'));var path=require(_0xfafb('0x9'));var sox=require('sox');var csv=require(_0xfafb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfafb('0xb'));var _=require('lodash');var squel=require(_0xfafb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfafb('0xd'));var toCsv=require(_0xfafb('0xa'));var querystring=require(_0xfafb('0xe'));var Papa=require(_0xfafb('0xf'));var Redis=require(_0xfafb('0x10'));var authService=require(_0xfafb('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfafb('0x12'));var logger=require(_0xfafb('0x13'))(_0xfafb('0x14'));var utils=require(_0xfafb('0x15'));var config=require(_0xfafb('0x16'));var licenseUtil=require(_0xfafb('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfafb('0x18'));function respondWithStatusCode(_0x1ded9f,_0x439ef3){_0x439ef3=_0x439ef3||0xcc;return function(_0x32bb69){if(_0x32bb69){return _0x1ded9f[_0xfafb('0x19')](_0x439ef3);}return _0x1ded9f[_0xfafb('0x1a')](_0x439ef3)[_0xfafb('0x1b')]();};}function respondWithResult(_0x3b3703,_0x40a649){_0x40a649=_0x40a649||0xc8;return function(_0x56dfb){if(_0x56dfb){return _0x3b3703[_0xfafb('0x1a')](_0x40a649)[_0xfafb('0x1c')](_0x56dfb);}};}function respondWithFilteredResult(_0x36edbe,_0x228587){return function(_0x4bb644){if(_0x4bb644){var _0x487a24=typeof _0x228587[_0xfafb('0x1d')]==='undefined'&&typeof _0x228587[_0xfafb('0x1e')]===_0xfafb('0x1f');var _0x5c1aa5=_0x4bb644[_0xfafb('0x20')];var _0x2a1a8d=_0x487a24?0x0:_0x228587[_0xfafb('0x1d')];var _0x30a095=_0x487a24?_0x4bb644[_0xfafb('0x20')]:_0x228587['offset']+_0x228587[_0xfafb('0x1e')];var _0x4dd280;if(_0x30a095>=_0x5c1aa5){_0x30a095=_0x5c1aa5;_0x4dd280=0xc8;}else{_0x4dd280=0xce;}_0x36edbe[_0xfafb('0x1a')](_0x4dd280);return _0x36edbe['set'](_0xfafb('0x21'),_0x2a1a8d+'-'+_0x30a095+'/'+_0x5c1aa5)[_0xfafb('0x1c')](_0x4bb644);}return null;};}function patchUpdates(_0x26bc85){return function(_0x34438d){try{jsonpatch['apply'](_0x34438d,_0x26bc85,!![]);}catch(_0x2db844){return BPromise['reject'](_0x2db844);}return _0x34438d[_0xfafb('0x22')]();};}function saveUpdates(_0x3eab3b,_0x1aaff6){return function(_0xb507ab){if(_0xb507ab){return _0xb507ab[_0xfafb('0x23')](_0x3eab3b)['then'](function(_0x16dd43){return _0x16dd43;});}return null;};}function removeEntity(_0x181b1c,_0x5a752c){return function(_0x5a3875){if(_0x5a3875){return _0x5a3875['destroy']()['then'](function(){_0x181b1c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4292e7,_0x5c77e1){return function(_0x52e378){if(!_0x52e378){_0x4292e7[_0xfafb('0x19')](0x194);}return _0x52e378;};}function handleError(_0x3506e7,_0x25bf9a){_0x25bf9a=_0x25bf9a||0x1f4;return function(_0xae9dc7){logger[_0xfafb('0x24')](_0xae9dc7['stack']);if(_0xae9dc7[_0xfafb('0x25')]){delete _0xae9dc7['name'];}_0x3506e7[_0xfafb('0x1a')](_0x25bf9a)[_0xfafb('0x26')](_0xae9dc7);};}exports['index']=function(_0x326ddb,_0x11688a){var _0x48b2fd={},_0x16be9d={},_0x59b44c={'count':0x0,'rows':[]};var _0x137695=_[_0xfafb('0x27')](db['ZohoAccount']['rawAttributes'],function(_0x102956){return{'name':_0x102956[_0xfafb('0x28')],'type':_0x102956[_0xfafb('0x29')][_0xfafb('0x2a')]};});_0x16be9d[_0xfafb('0x2b')]=_[_0xfafb('0x27')](_0x137695,_0xfafb('0x25'));_0x16be9d['query']=_[_0xfafb('0x2c')](_0x326ddb[_0xfafb('0x2d')]);_0x16be9d[_0xfafb('0x2e')]=_['intersection'](_0x16be9d[_0xfafb('0x2b')],_0x16be9d['query']);_0x48b2fd[_0xfafb('0x2f')]=_[_0xfafb('0x30')](_0x16be9d[_0xfafb('0x2b')],qs[_0xfafb('0x31')](_0x326ddb['query'][_0xfafb('0x31')]));_0x48b2fd['attributes']=_0x48b2fd[_0xfafb('0x2f')][_0xfafb('0x32')]?_0x48b2fd[_0xfafb('0x2f')]:_0x16be9d[_0xfafb('0x2b')];if(!_0x326ddb['query']['hasOwnProperty']('nolimit')){_0x48b2fd[_0xfafb('0x1e')]=qs[_0xfafb('0x1e')](_0x326ddb[_0xfafb('0x2d')][_0xfafb('0x1e')]);_0x48b2fd['offset']=qs[_0xfafb('0x1d')](_0x326ddb[_0xfafb('0x2d')][_0xfafb('0x1d')]);}_0x48b2fd[_0xfafb('0x33')]=qs['sort'](_0x326ddb[_0xfafb('0x2d')][_0xfafb('0x34')]);_0x48b2fd[_0xfafb('0x35')]=qs[_0xfafb('0x2e')](_[_0xfafb('0x36')](_0x326ddb['query'],_0x16be9d[_0xfafb('0x2e')]),_0x137695);if(_0x326ddb['query'][_0xfafb('0x37')]){_0x48b2fd[_0xfafb('0x35')]=_[_0xfafb('0x38')](_0x48b2fd[_0xfafb('0x35')],{'$or':_['map'](_0x137695,function(_0x568f87){if(_0x568f87['type']!==_0xfafb('0x39')){var _0x522b1e={};_0x522b1e[_0x568f87['name']]={'$like':'%'+_0x326ddb['query'][_0xfafb('0x37')]+'%'};return _0x522b1e;}})});}_0x48b2fd=_[_0xfafb('0x38')]({},_0x48b2fd,_0x326ddb[_0xfafb('0x3a')]);var _0x3ae526={'where':_0x48b2fd[_0xfafb('0x35')]};return db[_0xfafb('0x3b')][_0xfafb('0x20')](_0x3ae526)[_0xfafb('0x3c')](function(_0x16e79e){_0x59b44c[_0xfafb('0x20')]=_0x16e79e;if(_0x326ddb[_0xfafb('0x2d')][_0xfafb('0x3d')]){_0x48b2fd['include']=[{'all':!![]}];}return db[_0xfafb('0x3b')][_0xfafb('0x3e')](_0x48b2fd);})[_0xfafb('0x3c')](function(_0x2db2f7){_0x59b44c[_0xfafb('0x3f')]=_0x2db2f7;return _0x59b44c;})[_0xfafb('0x3c')](respondWithFilteredResult(_0x11688a,_0x48b2fd))[_0xfafb('0x40')](handleError(_0x11688a,null));};exports[_0xfafb('0x41')]=function(_0x321c46,_0x24aa9a){var _0x23295d={'raw':![],'where':{'id':_0x321c46['params']['id']}},_0xea081d={};_0xea081d[_0xfafb('0x2b')]=_[_0xfafb('0x2c')](db[_0xfafb('0x3b')][_0xfafb('0x42')]);_0xea081d['query']=_[_0xfafb('0x2c')](_0x321c46[_0xfafb('0x2d')]);_0xea081d['filters']=_['intersection'](_0xea081d['model'],_0xea081d[_0xfafb('0x2d')]);_0x23295d[_0xfafb('0x2f')]=_[_0xfafb('0x30')](_0xea081d[_0xfafb('0x2b')],qs[_0xfafb('0x31')](_0x321c46['query'][_0xfafb('0x31')]));_0x23295d[_0xfafb('0x2f')]=_0x23295d[_0xfafb('0x2f')][_0xfafb('0x32')]?_0x23295d[_0xfafb('0x2f')]:_0xea081d[_0xfafb('0x2b')];if(_0x321c46[_0xfafb('0x2d')]['includeAll']){_0x23295d[_0xfafb('0x43')]=[{'all':!![]}];}_0x23295d=_[_0xfafb('0x38')]({},_0x23295d,_0x321c46[_0xfafb('0x3a')]);return db['ZohoAccount']['find'](_0x23295d)[_0xfafb('0x3c')](handleEntityNotFound(_0x24aa9a,null))[_0xfafb('0x3c')](respondWithResult(_0x24aa9a,null))[_0xfafb('0x40')](handleError(_0x24aa9a,null));};exports[_0xfafb('0x44')]=function(_0x2c7b07,_0x5e1f4c){return db[_0xfafb('0x3b')][_0xfafb('0x44')](_0x2c7b07[_0xfafb('0x45')],{})['then'](respondWithResult(_0x5e1f4c,0xc9))[_0xfafb('0x40')](handleError(_0x5e1f4c,null));};exports[_0xfafb('0x23')]=function(_0x4991e5,_0xbc3a05){if(_0x4991e5[_0xfafb('0x45')]['id']){delete _0x4991e5[_0xfafb('0x45')]['id'];}return db[_0xfafb('0x3b')]['find']({'where':{'id':_0x4991e5[_0xfafb('0x46')]['id']}})[_0xfafb('0x3c')](handleEntityNotFound(_0xbc3a05,null))[_0xfafb('0x3c')](saveUpdates(_0x4991e5[_0xfafb('0x45')],null))['then'](respondWithResult(_0xbc3a05,null))[_0xfafb('0x40')](handleError(_0xbc3a05,null));};exports[_0xfafb('0x47')]=function(_0x3879de,_0x40446b){return db['ZohoAccount'][_0xfafb('0x48')]({'where':{'id':_0x3879de[_0xfafb('0x46')]['id']}})[_0xfafb('0x3c')](handleEntityNotFound(_0x40446b,null))[_0xfafb('0x3c')](removeEntity(_0x40446b,null))[_0xfafb('0x40')](handleError(_0x40446b,null));};exports['getConfigurations']=function(_0x858cc3,_0x57d635,_0xf2e014){var _0x5bf74c={};var _0x2196c6={};var _0x136cc0;var _0x2a95da;return db[_0xfafb('0x3b')][_0xfafb('0x49')]({'where':{'id':_0x858cc3[_0xfafb('0x46')]['id']}})[_0xfafb('0x3c')](handleEntityNotFound(_0x57d635,null))[_0xfafb('0x3c')](function(_0x2fa8d5){if(_0x2fa8d5){_0x136cc0=_0x2fa8d5;_0x2196c6[_0xfafb('0x2b')]=_[_0xfafb('0x2c')](db[_0xfafb('0x4a')]['rawAttributes']);_0x2196c6[_0xfafb('0x2d')]=_[_0xfafb('0x2c')](_0x858cc3['query']);_0x2196c6['filters']=_[_0xfafb('0x30')](_0x2196c6[_0xfafb('0x2b')],_0x2196c6[_0xfafb('0x2d')]);_0x5bf74c[_0xfafb('0x2f')]=_['intersection'](_0x2196c6[_0xfafb('0x2b')],qs[_0xfafb('0x31')](_0x858cc3[_0xfafb('0x2d')][_0xfafb('0x31')]));_0x5bf74c['attributes']=_0x5bf74c[_0xfafb('0x2f')][_0xfafb('0x32')]?_0x5bf74c['attributes']:_0x2196c6['model'];_0x5bf74c[_0xfafb('0x33')]=qs[_0xfafb('0x34')](_0x858cc3[_0xfafb('0x2d')][_0xfafb('0x34')]);_0x5bf74c[_0xfafb('0x35')]=qs[_0xfafb('0x2e')](_['pick'](_0x858cc3['query'],_0x2196c6[_0xfafb('0x2e')]));if(_0x858cc3['query'][_0xfafb('0x37')]){_0x5bf74c[_0xfafb('0x35')]=_[_0xfafb('0x38')](_0x5bf74c[_0xfafb('0x35')],{'$or':_[_0xfafb('0x27')](_0x5bf74c[_0xfafb('0x2f')],function(_0x22cede){var _0x147c56={};_0x147c56[_0x22cede]={'$like':'%'+_0x858cc3[_0xfafb('0x2d')][_0xfafb('0x37')]+'%'};return _0x147c56;})});}_0x5bf74c=_[_0xfafb('0x38')]({},_0x5bf74c,_0x858cc3[_0xfafb('0x3a')]);return _0x136cc0[_0xfafb('0x4b')](_0x5bf74c);}})['then'](function(_0x50fa21){if(_0x50fa21){_0x2a95da=_0x50fa21[_0xfafb('0x32')];if(!_0x858cc3[_0xfafb('0x2d')][_0xfafb('0x4c')](_0xfafb('0x4d'))){_0x5bf74c[_0xfafb('0x1e')]=qs[_0xfafb('0x1e')](_0x858cc3[_0xfafb('0x2d')][_0xfafb('0x1e')]);_0x5bf74c[_0xfafb('0x1d')]=qs['offset'](_0x858cc3[_0xfafb('0x2d')]['offset']);}return _0x136cc0[_0xfafb('0x4b')](_0x5bf74c);}})[_0xfafb('0x3c')](function(_0xc413d4){if(_0xc413d4){return _0xc413d4?{'count':_0x2a95da,'rows':_0xc413d4}:null;}})['then'](respondWithResult(_0x57d635,null))[_0xfafb('0x40')](handleError(_0x57d635,null));};exports['addConfiguration']=function(_0x2470c4,_0x99fd31,_0x58e405){if(_0x2470c4[_0xfafb('0x45')]['id']){delete _0x2470c4[_0xfafb('0x45')]['id'];}return db[_0xfafb('0x3b')][_0xfafb('0x49')]({'where':{'id':_0x2470c4[_0xfafb('0x46')]['id']}})[_0xfafb('0x3c')](handleEntityNotFound(_0x99fd31,null))['then'](function(_0xbb7543){if(_0xbb7543){_0x2470c4[_0xfafb('0x45')]['AccountId']=_0xbb7543['id'];_0x2470c4['body']['Subjects']=integrations[_0xfafb('0x4e')](_0x2470c4['body']['channel'],_0x2470c4[_0xfafb('0x45')][_0xfafb('0x29')]);_0x2470c4['body']['Descriptions']=integrations[_0xfafb('0x4f')](_0x2470c4[_0xfafb('0x45')][_0xfafb('0x50')],_0x2470c4[_0xfafb('0x45')]['type']);return db[_0xfafb('0x4a')][_0xfafb('0x44')](_0x2470c4[_0xfafb('0x45')],{'include':[{'model':db['ZohoField'],'as':_0xfafb('0x51')},{'model':db[_0xfafb('0x52')],'as':'Descriptions'}]});}return null;})[_0xfafb('0x3c')](respondWithResult(_0x99fd31,null))[_0xfafb('0x40')](handleError(_0x99fd31,null));};function getAccessToken(_0xae3ad4){return new Promise(function(_0x43605d,_0x2636ef){var _0xa9c9b7;switch(_0xae3ad4[_0xfafb('0x53')]){case'US':_0xa9c9b7=_0xfafb('0x54');break;case'AU':_0xa9c9b7=_0xfafb('0x55');break;case'EU':_0xa9c9b7=_0xfafb('0x56');break;case'IN':_0xa9c9b7='https://accounts.zoho.in';break;case'CN':_0xa9c9b7=_0xfafb('0x57');break;default:_0xa9c9b7=_0xfafb('0x56');break;}var _0x2726ad={'method':_0xfafb('0x58'),'uri':_0xa9c9b7+_0xfafb('0x59'),'qs':{'refresh_token':_0xae3ad4[_0xfafb('0x5a')],'client_id':_0xae3ad4[_0xfafb('0x5b')],'client_secret':_0xae3ad4[_0xfafb('0x5c')],'grant_type':_0xfafb('0x5d')},'json':!![]};return rp(_0x2726ad)[_0xfafb('0x3c')](function(_0x405e63){if(_0x405e63['access_token']){_0x43605d(_0x405e63['access_token']);}else{_0x2636ef('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xfafb('0x40')](function(_0xb4b570){_0x2636ef(_0xb4b570);});});}exports[_0xfafb('0x5e')]=function(_0x2508f2,_0x20c691,_0x1af5c5){var _0x1f7d21,_0x94cb98,_0x355cab,_0x1d5247,_0x165b12;return db['ZohoAccount']['findOne']({'where':{'id':_0x2508f2[_0xfafb('0x46')]['id']},'attributes':['id',_0xfafb('0x5f'),_0xfafb('0x53'),_0xfafb('0x5b'),_0xfafb('0x5c'),_0xfafb('0x60'),_0xfafb('0x61'),_0xfafb('0x5a')]})['then'](handleEntityNotFound(_0x20c691,null))[_0xfafb('0x3c')](function(_0x11ed81){_0x165b12=_0x11ed81;_0x1f7d21=_0x165b12[_0xfafb('0x5f')];_0x94cb98=_0x1f7d21==='zoho.eu'?'eu':_0xfafb('0x62');_0x355cab=_0x165b12['serverUrl'];var _0x2dd9a3=_0x355cab[_0xfafb('0x63')](-0x1);if(_0x2dd9a3==='/'||_0x2dd9a3==='\x5c'||_0x2dd9a3===':'){_0x355cab=_0x355cab[_0xfafb('0x64')](0x0,_0x355cab[_0xfafb('0x65')](_0x2dd9a3));}if(!_0x165b12[_0xfafb('0x5a')]){throw new Error(_0xfafb('0x66'));}return getAccessToken(_0x165b12);})['then'](function(_0x118b59){if(_0x118b59){return rp({'method':'GET','uri':util[_0xfafb('0x67')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x94cb98),'qs':{'module':'Calls'},'headers':{'Authorization':_0xfafb('0x68')+_0x118b59},'json':!![]});}})[_0xfafb('0x3c')](function(_0x164721){if(_0x164721){if(_0x164721[_0xfafb('0x69')]&&_0x164721[_0xfafb('0x69')][_0xfafb('0x24')]){throw new Error(_0x164721[_0xfafb('0x69')]['error'][_0xfafb('0x6a')]);}var _0x393979=[];var _0x3bcc67=[];var _0x3ab6af=['Owner',_0xfafb('0x6b'),'Description',_0xfafb('0x6c'),_0xfafb('0x6d'),_0xfafb('0x6e'),_0xfafb('0x6f'),'Call_Type'];_0x3bcc67=_[_0xfafb('0x70')](_0x164721[_0xfafb('0x31')],function(_0x3d60ec){return _0x3ab6af[_0xfafb('0x71')](_0x3d60ec['api_name']);});for(var _0xd42c03=0x0;_0xd42c03<_0x3bcc67[_0xfafb('0x32')];_0xd42c03++){if(_0x3bcc67[_0xd42c03][_0xfafb('0x72')]===![]){_0x393979[_0xfafb('0x73')]({'id':_0x3bcc67[_0xd42c03]['id'],'name':_0x3bcc67[_0xd42c03][_0xfafb('0x74')],'custom':_0x3bcc67[_0xd42c03]['custom_field'],'options':_0x3bcc67[_0xd42c03][_0xfafb('0x75')]===_0xfafb('0x76')&&_0x3bcc67[_0xd42c03][_0xfafb('0x77')][_0xfafb('0x32')]>-0x1?_[_0xfafb('0x27')](_0x3bcc67[_0xd42c03]['pick_list_values'],function(_0x1075f9){return{'name':_0x1075f9,'value':_0x1075f9};}):[]});}}return{'count':_0x393979[_0xfafb('0x32')],'rows':_0x393979};}else{return{'count':0x0,'rows':[]};}})[_0xfafb('0x3c')](respondWithResult(_0x20c691,null))[_0xfafb('0x40')](function(_0x73edc3){var _0x3f489a=_0x2508f2[_0xfafb('0x2d')]['test']?0x1f4:_0x73edc3[_0xfafb('0x78')]||0x1f4;logger['error'](_0xfafb('0x79'),'getFields',_0x3f489a,JSON[_0xfafb('0x7a')](_0x73edc3));delete _0x73edc3[_0xfafb('0x25')];if(_0x3f489a===0x191){_0x3f489a=0x190;}_0x20c691[_0xfafb('0x1a')](_0x3f489a)['send'](_0x2508f2[_0xfafb('0x2d')][_0xfafb('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x73edc3[_0xfafb('0x78')]}:_0x73edc3);});}; \ No newline at end of file +var _0xed92=['com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Description','Call_Duration','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','picklist','pick_list_values','test','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','ZohoAccount','findAll','rows','catch','show','params','filters','include','find','create','body','getConfigurations','findOne','ZohoConfiguration','order','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','host','zoho.eu'];(function(_0x46bf45,_0x201aaf){var _0x10cdc3=function(_0x1affe2){while(--_0x1affe2){_0x46bf45['push'](_0x46bf45['shift']());}};_0x10cdc3(++_0x201aaf);}(_0xed92,0x1a5));var _0x2ed9=function(_0x455428,_0x1cc187){_0x455428=_0x455428-0x0;var _0x4b2102=_0xed92[_0x455428];return _0x4b2102;};'use strict';var emlformat=require(_0x2ed9('0x0'));var rimraf=require(_0x2ed9('0x1'));var zipdir=require(_0x2ed9('0x2'));var jsonpatch=require(_0x2ed9('0x3'));var rp=require(_0x2ed9('0x4'));var moment=require(_0x2ed9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2ed9('0x6'));var util=require(_0x2ed9('0x7'));var path=require(_0x2ed9('0x8'));var sox=require(_0x2ed9('0x9'));var csv=require(_0x2ed9('0xa'));var ejs=require(_0x2ed9('0xb'));var fs=require('fs');var fs_extra=require(_0x2ed9('0xc'));var _=require(_0x2ed9('0xd'));var squel=require('squel');var crypto=require(_0x2ed9('0xe'));var jsforce=require(_0x2ed9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2ed9('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2ed9('0x10'));var authService=require(_0x2ed9('0x11'));var qs=require(_0x2ed9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ed9('0x13'));var logger=require('../../config/logger')(_0x2ed9('0x14'));var utils=require(_0x2ed9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2ed9('0x16'));var db=require(_0x2ed9('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1699d4,_0x51f3cb){_0x51f3cb=_0x51f3cb||0xcc;return function(_0x4047e1){if(_0x4047e1){return _0x1699d4[_0x2ed9('0x18')](_0x51f3cb);}return _0x1699d4[_0x2ed9('0x19')](_0x51f3cb)['end']();};}function respondWithResult(_0x172569,_0x1afd59){_0x1afd59=_0x1afd59||0xc8;return function(_0x398bf1){if(_0x398bf1){return _0x172569[_0x2ed9('0x19')](_0x1afd59)['json'](_0x398bf1);}};}function respondWithFilteredResult(_0x2a2ce7,_0x93e0fb){return function(_0x2d00f1){if(_0x2d00f1){var _0x16506e=typeof _0x93e0fb[_0x2ed9('0x1a')]===_0x2ed9('0x1b')&&typeof _0x93e0fb[_0x2ed9('0x1c')]==='undefined';var _0x3da0f7=_0x2d00f1[_0x2ed9('0x1d')];var _0x16f5e2=_0x16506e?0x0:_0x93e0fb[_0x2ed9('0x1a')];var _0x532d2=_0x16506e?_0x2d00f1[_0x2ed9('0x1d')]:_0x93e0fb['offset']+_0x93e0fb[_0x2ed9('0x1c')];var _0x3ae154;if(_0x532d2>=_0x3da0f7){_0x532d2=_0x3da0f7;_0x3ae154=0xc8;}else{_0x3ae154=0xce;}_0x2a2ce7[_0x2ed9('0x19')](_0x3ae154);return _0x2a2ce7['set'](_0x2ed9('0x1e'),_0x16f5e2+'-'+_0x532d2+'/'+_0x3da0f7)[_0x2ed9('0x1f')](_0x2d00f1);}return null;};}function patchUpdates(_0x6591ed){return function(_0x226760){try{jsonpatch[_0x2ed9('0x20')](_0x226760,_0x6591ed,!![]);}catch(_0x47ef2d){return BPromise[_0x2ed9('0x21')](_0x47ef2d);}return _0x226760[_0x2ed9('0x22')]();};}function saveUpdates(_0x2abfa3,_0x141609){return function(_0x45c81e){if(_0x45c81e){return _0x45c81e[_0x2ed9('0x23')](_0x2abfa3)[_0x2ed9('0x24')](function(_0x48da5a){return _0x48da5a;});}return null;};}function removeEntity(_0x504ffc,_0xf73b2b){return function(_0x445f53){if(_0x445f53){return _0x445f53['destroy']()['then'](function(){_0x504ffc[_0x2ed9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4da0b9,_0x1e526b){return function(_0x514cef){if(!_0x514cef){_0x4da0b9['sendStatus'](0x194);}return _0x514cef;};}function handleError(_0x44a99c,_0x4ea556){_0x4ea556=_0x4ea556||0x1f4;return function(_0x5598f7){logger[_0x2ed9('0x25')](_0x5598f7['stack']);if(_0x5598f7['name']){delete _0x5598f7[_0x2ed9('0x26')];}_0x44a99c[_0x2ed9('0x19')](_0x4ea556)[_0x2ed9('0x27')](_0x5598f7);};}exports[_0x2ed9('0x28')]=function(_0x563643,_0x1107a8){var _0x3ee9bc={},_0x47bbd9={},_0x8591df={'count':0x0,'rows':[]};var _0x4cccc5=_['map'](db['ZohoAccount'][_0x2ed9('0x29')],function(_0x3c9a62){return{'name':_0x3c9a62[_0x2ed9('0x2a')],'type':_0x3c9a62[_0x2ed9('0x2b')][_0x2ed9('0x2c')]};});_0x47bbd9[_0x2ed9('0x2d')]=_[_0x2ed9('0x2e')](_0x4cccc5,_0x2ed9('0x26'));_0x47bbd9[_0x2ed9('0x2f')]=_[_0x2ed9('0x30')](_0x563643['query']);_0x47bbd9['filters']=_[_0x2ed9('0x31')](_0x47bbd9['model'],_0x47bbd9[_0x2ed9('0x2f')]);_0x3ee9bc['attributes']=_['intersection'](_0x47bbd9['model'],qs[_0x2ed9('0x32')](_0x563643['query']['fields']));_0x3ee9bc[_0x2ed9('0x33')]=_0x3ee9bc[_0x2ed9('0x33')][_0x2ed9('0x34')]?_0x3ee9bc[_0x2ed9('0x33')]:_0x47bbd9[_0x2ed9('0x2d')];if(!_0x563643[_0x2ed9('0x2f')]['hasOwnProperty']('nolimit')){_0x3ee9bc[_0x2ed9('0x1c')]=qs['limit'](_0x563643[_0x2ed9('0x2f')][_0x2ed9('0x1c')]);_0x3ee9bc['offset']=qs[_0x2ed9('0x1a')](_0x563643[_0x2ed9('0x2f')][_0x2ed9('0x1a')]);}_0x3ee9bc['order']=qs[_0x2ed9('0x35')](_0x563643[_0x2ed9('0x2f')]['sort']);_0x3ee9bc[_0x2ed9('0x36')]=qs['filters'](_[_0x2ed9('0x37')](_0x563643['query'],_0x47bbd9['filters']),_0x4cccc5);if(_0x563643['query'][_0x2ed9('0x38')]){_0x3ee9bc[_0x2ed9('0x36')]=_['merge'](_0x3ee9bc['where'],{'$or':_[_0x2ed9('0x2e')](_0x4cccc5,function(_0x42f7ed){if(_0x42f7ed['type']!==_0x2ed9('0x39')){var _0x21a559={};_0x21a559[_0x42f7ed[_0x2ed9('0x26')]]={'$like':'%'+_0x563643[_0x2ed9('0x2f')][_0x2ed9('0x38')]+'%'};return _0x21a559;}})});}_0x3ee9bc=_[_0x2ed9('0x3a')]({},_0x3ee9bc,_0x563643[_0x2ed9('0x3b')]);var _0x4b92f6={'where':_0x3ee9bc[_0x2ed9('0x36')]};return db['ZohoAccount'][_0x2ed9('0x1d')](_0x4b92f6)[_0x2ed9('0x24')](function(_0x38f999){_0x8591df[_0x2ed9('0x1d')]=_0x38f999;if(_0x563643[_0x2ed9('0x2f')][_0x2ed9('0x3c')]){_0x3ee9bc['include']=[{'all':!![]}];}return db[_0x2ed9('0x3d')][_0x2ed9('0x3e')](_0x3ee9bc);})['then'](function(_0x32f12c){_0x8591df[_0x2ed9('0x3f')]=_0x32f12c;return _0x8591df;})[_0x2ed9('0x24')](respondWithFilteredResult(_0x1107a8,_0x3ee9bc))[_0x2ed9('0x40')](handleError(_0x1107a8,null));};exports[_0x2ed9('0x41')]=function(_0x1505d4,_0x4f8e8f){var _0x55b0ac={'raw':![],'where':{'id':_0x1505d4[_0x2ed9('0x42')]['id']}},_0x3d3659={};_0x3d3659[_0x2ed9('0x2d')]=_[_0x2ed9('0x30')](db[_0x2ed9('0x3d')][_0x2ed9('0x29')]);_0x3d3659['query']=_['keys'](_0x1505d4['query']);_0x3d3659[_0x2ed9('0x43')]=_[_0x2ed9('0x31')](_0x3d3659[_0x2ed9('0x2d')],_0x3d3659[_0x2ed9('0x2f')]);_0x55b0ac['attributes']=_[_0x2ed9('0x31')](_0x3d3659['model'],qs[_0x2ed9('0x32')](_0x1505d4['query'][_0x2ed9('0x32')]));_0x55b0ac[_0x2ed9('0x33')]=_0x55b0ac[_0x2ed9('0x33')][_0x2ed9('0x34')]?_0x55b0ac[_0x2ed9('0x33')]:_0x3d3659[_0x2ed9('0x2d')];if(_0x1505d4['query'][_0x2ed9('0x3c')]){_0x55b0ac[_0x2ed9('0x44')]=[{'all':!![]}];}_0x55b0ac=_[_0x2ed9('0x3a')]({},_0x55b0ac,_0x1505d4[_0x2ed9('0x3b')]);return db[_0x2ed9('0x3d')][_0x2ed9('0x45')](_0x55b0ac)['then'](handleEntityNotFound(_0x4f8e8f,null))[_0x2ed9('0x24')](respondWithResult(_0x4f8e8f,null))['catch'](handleError(_0x4f8e8f,null));};exports[_0x2ed9('0x46')]=function(_0xbd062c,_0x266f0c){return db[_0x2ed9('0x3d')][_0x2ed9('0x46')](_0xbd062c[_0x2ed9('0x47')],{})[_0x2ed9('0x24')](respondWithResult(_0x266f0c,0xc9))[_0x2ed9('0x40')](handleError(_0x266f0c,null));};exports[_0x2ed9('0x23')]=function(_0x32a1e0,_0x14f598){if(_0x32a1e0['body']['id']){delete _0x32a1e0[_0x2ed9('0x47')]['id'];}return db['ZohoAccount'][_0x2ed9('0x45')]({'where':{'id':_0x32a1e0['params']['id']}})['then'](handleEntityNotFound(_0x14f598,null))[_0x2ed9('0x24')](saveUpdates(_0x32a1e0[_0x2ed9('0x47')],null))[_0x2ed9('0x24')](respondWithResult(_0x14f598,null))[_0x2ed9('0x40')](handleError(_0x14f598,null));};exports['destroy']=function(_0x404577,_0x30ba00){return db[_0x2ed9('0x3d')][_0x2ed9('0x45')]({'where':{'id':_0x404577[_0x2ed9('0x42')]['id']}})[_0x2ed9('0x24')](handleEntityNotFound(_0x30ba00,null))[_0x2ed9('0x24')](removeEntity(_0x30ba00,null))[_0x2ed9('0x40')](handleError(_0x30ba00,null));};exports[_0x2ed9('0x48')]=function(_0x2eb676,_0x1eb925,_0x537572){var _0x2fce6c={};var _0x1671cc={};var _0x122127;var _0x8ae954;return db[_0x2ed9('0x3d')][_0x2ed9('0x49')]({'where':{'id':_0x2eb676[_0x2ed9('0x42')]['id']}})[_0x2ed9('0x24')](handleEntityNotFound(_0x1eb925,null))['then'](function(_0x123d74){if(_0x123d74){_0x122127=_0x123d74;_0x1671cc['model']=_[_0x2ed9('0x30')](db[_0x2ed9('0x4a')][_0x2ed9('0x29')]);_0x1671cc[_0x2ed9('0x2f')]=_[_0x2ed9('0x30')](_0x2eb676['query']);_0x1671cc['filters']=_['intersection'](_0x1671cc[_0x2ed9('0x2d')],_0x1671cc[_0x2ed9('0x2f')]);_0x2fce6c['attributes']=_[_0x2ed9('0x31')](_0x1671cc[_0x2ed9('0x2d')],qs[_0x2ed9('0x32')](_0x2eb676[_0x2ed9('0x2f')][_0x2ed9('0x32')]));_0x2fce6c[_0x2ed9('0x33')]=_0x2fce6c[_0x2ed9('0x33')][_0x2ed9('0x34')]?_0x2fce6c[_0x2ed9('0x33')]:_0x1671cc['model'];_0x2fce6c[_0x2ed9('0x4b')]=qs[_0x2ed9('0x35')](_0x2eb676[_0x2ed9('0x2f')]['sort']);_0x2fce6c[_0x2ed9('0x36')]=qs['filters'](_[_0x2ed9('0x37')](_0x2eb676[_0x2ed9('0x2f')],_0x1671cc[_0x2ed9('0x43')]));if(_0x2eb676['query']['filter']){_0x2fce6c[_0x2ed9('0x36')]=_[_0x2ed9('0x3a')](_0x2fce6c[_0x2ed9('0x36')],{'$or':_[_0x2ed9('0x2e')](_0x2fce6c['attributes'],function(_0x4c22e2){var _0x1cd9d5={};_0x1cd9d5[_0x4c22e2]={'$like':'%'+_0x2eb676[_0x2ed9('0x2f')][_0x2ed9('0x38')]+'%'};return _0x1cd9d5;})});}_0x2fce6c=_[_0x2ed9('0x3a')]({},_0x2fce6c,_0x2eb676[_0x2ed9('0x3b')]);return _0x122127[_0x2ed9('0x48')](_0x2fce6c);}})[_0x2ed9('0x24')](function(_0x3549fa){if(_0x3549fa){_0x8ae954=_0x3549fa['length'];if(!_0x2eb676[_0x2ed9('0x2f')][_0x2ed9('0x4c')]('nolimit')){_0x2fce6c[_0x2ed9('0x1c')]=qs['limit'](_0x2eb676['query']['limit']);_0x2fce6c[_0x2ed9('0x1a')]=qs[_0x2ed9('0x1a')](_0x2eb676[_0x2ed9('0x2f')][_0x2ed9('0x1a')]);}return _0x122127[_0x2ed9('0x48')](_0x2fce6c);}})[_0x2ed9('0x24')](function(_0x20259a){if(_0x20259a){return _0x20259a?{'count':_0x8ae954,'rows':_0x20259a}:null;}})['then'](respondWithResult(_0x1eb925,null))[_0x2ed9('0x40')](handleError(_0x1eb925,null));};exports[_0x2ed9('0x4d')]=function(_0x2a0589,_0x12ddf2,_0x15d4ea){if(_0x2a0589[_0x2ed9('0x47')]['id']){delete _0x2a0589[_0x2ed9('0x47')]['id'];}return db[_0x2ed9('0x3d')][_0x2ed9('0x49')]({'where':{'id':_0x2a0589[_0x2ed9('0x42')]['id']}})[_0x2ed9('0x24')](handleEntityNotFound(_0x12ddf2,null))[_0x2ed9('0x24')](function(_0x569ccf){if(_0x569ccf){_0x2a0589['body'][_0x2ed9('0x4e')]=_0x569ccf['id'];_0x2a0589[_0x2ed9('0x47')]['Subjects']=integrations[_0x2ed9('0x4f')](_0x2a0589[_0x2ed9('0x47')][_0x2ed9('0x50')],_0x2a0589['body'][_0x2ed9('0x2b')]);_0x2a0589[_0x2ed9('0x47')][_0x2ed9('0x51')]=integrations[_0x2ed9('0x52')](_0x2a0589[_0x2ed9('0x47')][_0x2ed9('0x50')],_0x2a0589['body'][_0x2ed9('0x2b')]);return db['ZohoConfiguration'][_0x2ed9('0x46')](_0x2a0589[_0x2ed9('0x47')],{'include':[{'model':db[_0x2ed9('0x53')],'as':_0x2ed9('0x54')},{'model':db[_0x2ed9('0x53')],'as':'Descriptions'}]});}return null;})[_0x2ed9('0x24')](respondWithResult(_0x12ddf2,null))[_0x2ed9('0x40')](handleError(_0x12ddf2,null));};function getAccessToken(_0x50677d){return new Promise(function(_0xfcb30,_0x39ecd8){var _0x1fa621;switch(_0x50677d[_0x2ed9('0x55')]){case'US':_0x1fa621=_0x2ed9('0x56');break;case'AU':_0x1fa621=_0x2ed9('0x57');break;case'EU':_0x1fa621='https://accounts.zoho.eu';break;case'IN':_0x1fa621=_0x2ed9('0x58');break;case'CN':_0x1fa621=_0x2ed9('0x59');break;default:_0x1fa621=_0x2ed9('0x5a');break;}var _0x1c79a4={'method':'POST','uri':_0x1fa621+_0x2ed9('0x5b'),'qs':{'refresh_token':_0x50677d[_0x2ed9('0x5c')],'client_id':_0x50677d[_0x2ed9('0x5d')],'client_secret':_0x50677d[_0x2ed9('0x5e')],'grant_type':_0x2ed9('0x5f')},'json':!![]};return rp(_0x1c79a4)['then'](function(_0x3dd46a){if(_0x3dd46a[_0x2ed9('0x60')]){_0xfcb30(_0x3dd46a['access_token']);}else{_0x39ecd8(_0x2ed9('0x61'));}})[_0x2ed9('0x40')](function(_0x431ccf){_0x39ecd8(_0x431ccf);});});}exports[_0x2ed9('0x62')]=function(_0x378a15,_0x4fdadb,_0x5b18ca){var _0x5500ff,_0x2bef6c,_0x5975cd,_0x4e97c6,_0x3ca776;return db[_0x2ed9('0x3d')][_0x2ed9('0x49')]({'where':{'id':_0x378a15[_0x2ed9('0x42')]['id']},'attributes':['id','host',_0x2ed9('0x55'),_0x2ed9('0x5d'),_0x2ed9('0x5e'),_0x2ed9('0x63'),_0x2ed9('0x64'),'refreshToken']})['then'](handleEntityNotFound(_0x4fdadb,null))[_0x2ed9('0x24')](function(_0x6b0093){_0x3ca776=_0x6b0093;_0x5500ff=_0x3ca776[_0x2ed9('0x65')];_0x2bef6c=_0x5500ff===_0x2ed9('0x66')?'eu':_0x2ed9('0x67');_0x5975cd=_0x3ca776['serverUrl'];var _0x50353d=_0x5975cd['slice'](-0x1);if(_0x50353d==='/'||_0x50353d==='\x5c'||_0x50353d===':'){_0x5975cd=_0x5975cd[_0x2ed9('0x68')](0x0,_0x5975cd[_0x2ed9('0x69')](_0x50353d));}if(!_0x3ca776[_0x2ed9('0x5c')]){throw new Error(_0x2ed9('0x6a'));}return getAccessToken(_0x3ca776);})['then'](function(_0xbb31c4){if(_0xbb31c4){return rp({'method':_0x2ed9('0x6b'),'uri':util[_0x2ed9('0x6c')](_0x2ed9('0x6d'),_0x2bef6c),'qs':{'module':_0x2ed9('0x6e')},'headers':{'Authorization':_0x2ed9('0x6f')+_0xbb31c4},'json':!![]});}})[_0x2ed9('0x24')](function(_0x2de727){if(_0x2de727){if(_0x2de727[_0x2ed9('0x70')]&&_0x2de727['response'][_0x2ed9('0x25')]){throw new Error(_0x2de727[_0x2ed9('0x70')][_0x2ed9('0x25')][_0x2ed9('0x71')]);}var _0x11482b=[];var _0x2c817d=[];var _0x5507bb=['Owner','Subject',_0x2ed9('0x72'),'WhoId',_0x2ed9('0x73'),'Call_Result',_0x2ed9('0x74'),_0x2ed9('0x75')];_0x2c817d=_[_0x2ed9('0x76')](_0x2de727['fields'],function(_0x3751f6){return _0x5507bb[_0x2ed9('0x77')](_0x3751f6[_0x2ed9('0x78')]);});for(var _0xf926a9=0x0;_0xf926a9<_0x2c817d['length'];_0xf926a9++){if(_0x2c817d[_0xf926a9][_0x2ed9('0x79')]===![]){_0x11482b[_0x2ed9('0x7a')]({'id':_0x2c817d[_0xf926a9]['id'],'name':_0x2c817d[_0xf926a9][_0x2ed9('0x7b')],'custom':_0x2c817d[_0xf926a9][_0x2ed9('0x7c')],'options':_0x2c817d[_0xf926a9]['data_type']===_0x2ed9('0x7d')&&_0x2c817d[_0xf926a9][_0x2ed9('0x7e')]['length']>-0x1?_['map'](_0x2c817d[_0xf926a9][_0x2ed9('0x7e')],function(_0x39df4e){return{'name':_0x39df4e,'value':_0x39df4e};}):[]});}}return{'count':_0x11482b[_0x2ed9('0x34')],'rows':_0x11482b};}else{return{'count':0x0,'rows':[]};}})[_0x2ed9('0x24')](respondWithResult(_0x4fdadb,null))[_0x2ed9('0x40')](function(_0x54287c){var _0x4297f9=_0x378a15[_0x2ed9('0x2f')][_0x2ed9('0x7f')]?0x1f4:_0x54287c['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x2ed9('0x62'),_0x4297f9,JSON[_0x2ed9('0x80')](_0x54287c));delete _0x54287c[_0x2ed9('0x26')];if(_0x4297f9===0x191){_0x4297f9=0x190;}_0x4fdadb[_0x2ed9('0x19')](_0x4297f9)[_0x2ed9('0x27')](_0x378a15['query']['test']?{'message':_0x2ed9('0x81'),'statusCode':_0x54287c[_0x2ed9('0x82')]}:_0x54287c);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index cce1e27..2fcd5e4 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 _0xe6d0=['https://accounts.zoho.com','https://accounts.zoho.eu','authorization_code','clientId','clientSecret','code','application/x-www-form-urlencoded','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','name','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','parse','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','slice','substring','lastIndexOf'];(function(_0x3a2c29,_0x3e1216){var _0x18cc5e=function(_0x3027a3){while(--_0x3027a3){_0x3a2c29['push'](_0x3a2c29['shift']());}};_0x18cc5e(++_0x3e1216);}(_0xe6d0,0x17e));var _0x0e6d=function(_0x5b2263,_0x2df183){_0x5b2263=_0x5b2263-0x0;var _0x487cbe=_0xe6d0[_0x5b2263];return _0x487cbe;};'use strict';var _=require(_0x0e6d('0x0'));var util=require(_0x0e6d('0x1'));var logger=require(_0x0e6d('0x2'))('api');var moment=require(_0x0e6d('0x3'));var BPromise=require(_0x0e6d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0e6d('0x5'));var config=require(_0x0e6d('0x6'));var attributes=require(_0x0e6d('0x7'));var integrations=require(_0x0e6d('0x8'));module[_0x0e6d('0x9')]=function(_0x174ec3,_0x386715){return _0x174ec3['define'](_0x0e6d('0xa'),attributes,{'tableName':_0x0e6d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x606776,_0x47b376,_0x46c97a){if(_0x606776[_0x0e6d('0xc')](_0x0e6d('0xd'))||_0x606776[_0x0e6d('0xc')](_0x0e6d('0xe'))||_0x606776[_0x0e6d('0xc')]('clientId')||_0x606776[_0x0e6d('0xc')]('clientSecret')||_0x606776[_0x0e6d('0xc')]('code')||_0x606776['changed']('host')){var _0xee55ee,_0x30d156;_0xee55ee=_0x606776[_0x0e6d('0xe')];var _0x2982ff=_0xee55ee[_0x0e6d('0xf')](-0x1);if(_0x2982ff==='/'||_0x2982ff==='\x5c'||_0x2982ff===':'){_0xee55ee=_0xee55ee[_0x0e6d('0x10')](0x0,_0xee55ee[_0x0e6d('0x11')](_0x2982ff));}switch(_0x606776[_0x0e6d('0xd')]){case'US':_0x30d156=_0x0e6d('0x12');break;case'AU':_0x30d156='https://accounts.zoho.com.au';break;case'IN':_0x30d156='https://accounts.zoho.in';break;case'CN':_0x30d156='https://accounts.zoho.com.cn';break;default:_0x30d156=_0x0e6d('0x13');break;}var _0x3b3734={'method':'POST','uri':_0x30d156+'/oauth/v2/token','form':{'grant_type':_0x0e6d('0x14'),'client_id':_0x606776[_0x0e6d('0x15')],'client_secret':_0x606776[_0x0e6d('0x16')],'redirect_uri':_0x606776[_0x0e6d('0xe')],'code':_0x606776[_0x0e6d('0x17')]},'headers':{'Content-Type':_0x0e6d('0x18')}};return rp(_0x3b3734)['then'](function(_0x2a5861){var _0x5856b0=JSON['parse'](_0x2a5861);if(_0x5856b0[_0x0e6d('0x19')]){_0x606776[_0x0e6d('0x1a')]=_0x5856b0[_0x0e6d('0x19')];logger[_0x0e6d('0x1b')](util[_0x0e6d('0x1c')](_0x0e6d('0x1d'),_0x606776['name'],_0x606776['id']));}else{logger[_0x0e6d('0x1e')](util[_0x0e6d('0x1c')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x606776[_0x0e6d('0x1f')],_0x606776['id']),util[_0x0e6d('0x20')](_0x5856b0,{'showHidden':![],'depth':null}));}return _0x46c97a(null,_0x47b376);})[_0x0e6d('0x21')](function(_0x57fca7){logger[_0x0e6d('0x1e')](util['format'](_0x0e6d('0x22'),_0x606776['name'],_0x606776['id']),util[_0x0e6d('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x46c97a(_0x57fca7);});}else{return _0x46c97a(null,_0x47b376);}},'beforeUpdate':function(_0x1b5b44,_0x14174c,_0x138ed2){if(_0x1b5b44['changed'](_0x0e6d('0xd'))||_0x1b5b44[_0x0e6d('0xc')](_0x0e6d('0xe'))||_0x1b5b44[_0x0e6d('0xc')](_0x0e6d('0x15'))||_0x1b5b44[_0x0e6d('0xc')](_0x0e6d('0x16'))||_0x1b5b44[_0x0e6d('0xc')]('code')||_0x1b5b44['changed']('host')){var _0x262b52,_0x51d33c;_0x262b52=_0x1b5b44['serverUrl'];var _0x1388f8=_0x262b52[_0x0e6d('0xf')](-0x1);if(_0x1388f8==='/'||_0x1388f8==='\x5c'||_0x1388f8===':'){_0x262b52=_0x262b52[_0x0e6d('0x10')](0x0,_0x262b52[_0x0e6d('0x11')](_0x1388f8));}switch(_0x1b5b44['zone']){case'US':_0x51d33c=_0x0e6d('0x12');break;case'AU':_0x51d33c='https://accounts.zoho.com.au';break;case'IN':_0x51d33c=_0x0e6d('0x23');break;case'CN':_0x51d33c=_0x0e6d('0x24');break;default:_0x51d33c=_0x0e6d('0x13');break;}var _0x467ac8={'method':_0x0e6d('0x25'),'uri':_0x51d33c+_0x0e6d('0x26'),'form':{'grant_type':_0x0e6d('0x14'),'client_id':_0x1b5b44['clientId'],'client_secret':_0x1b5b44[_0x0e6d('0x16')],'redirect_uri':_0x1b5b44['serverUrl'],'code':_0x1b5b44[_0x0e6d('0x17')]},'headers':{'Content-Type':_0x0e6d('0x18')}};return rp(_0x467ac8)['then'](function(_0x55619c){var _0x1e214b=JSON[_0x0e6d('0x27')](_0x55619c);if(_0x1e214b[_0x0e6d('0x19')]){_0x1b5b44[_0x0e6d('0x1a')]=_0x1e214b[_0x0e6d('0x19')];logger[_0x0e6d('0x1b')](util[_0x0e6d('0x1c')](_0x0e6d('0x1d'),_0x1b5b44[_0x0e6d('0x1f')],_0x1b5b44['id']));}else{logger[_0x0e6d('0x1e')](util[_0x0e6d('0x1c')](_0x0e6d('0x22'),_0x1b5b44[_0x0e6d('0x1f')],_0x1b5b44['id']),util[_0x0e6d('0x20')](_0x1e214b,{'showHidden':![],'depth':null}));}return _0x138ed2(null,_0x14174c);})[_0x0e6d('0x21')](function(_0x12b1be){logger[_0x0e6d('0x1e')](util[_0x0e6d('0x1c')](_0x0e6d('0x22'),_0x1b5b44[_0x0e6d('0x1f')],_0x1b5b44['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x138ed2(_0x12b1be);});}else{return _0x138ed2(null,_0x14174c);}}}});}; \ No newline at end of file +var _0x6860=['https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','serverUrl','application/x-www-form-urlencoded','then','parse','refresh_token','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','https://accounts.zoho.in','POST','refreshToken','info','lodash','../../config/logger','moment','request-promise','path','../../config/environment','exports','ZohoAccount','int_zoho_accounts','zone','changed','clientId','clientSecret','code','host','substring','lastIndexOf'];(function(_0x4233a2,_0x478e28){var _0x1c420e=function(_0x10b59e){while(--_0x10b59e){_0x4233a2['push'](_0x4233a2['shift']());}};_0x1c420e(++_0x478e28);}(_0x6860,0x1d0));var _0x0686=function(_0x596de6,_0x5cfb42){_0x596de6=_0x596de6-0x0;var _0x785d0a=_0x6860[_0x596de6];return _0x785d0a;};'use strict';var _=require(_0x0686('0x0'));var util=require('util');var logger=require(_0x0686('0x1'))('api');var moment=require(_0x0686('0x2'));var BPromise=require('bluebird');var rp=require(_0x0686('0x3'));var fs=require('fs');var path=require(_0x0686('0x4'));var rimraf=require('rimraf');var config=require(_0x0686('0x5'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0686('0x6')]=function(_0x357d41,_0x24ec8c){return _0x357d41['define'](_0x0686('0x7'),attributes,{'tableName':_0x0686('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4710ad,_0x239ed1,_0x334aa9){if(_0x4710ad['changed'](_0x0686('0x9'))||_0x4710ad['changed']('serverUrl')||_0x4710ad[_0x0686('0xa')](_0x0686('0xb'))||_0x4710ad[_0x0686('0xa')](_0x0686('0xc'))||_0x4710ad['changed'](_0x0686('0xd'))||_0x4710ad[_0x0686('0xa')](_0x0686('0xe'))){var _0x4b2ea7,_0x26d96b;_0x4b2ea7=_0x4710ad['serverUrl'];var _0x518f79=_0x4b2ea7['slice'](-0x1);if(_0x518f79==='/'||_0x518f79==='\x5c'||_0x518f79===':'){_0x4b2ea7=_0x4b2ea7[_0x0686('0xf')](0x0,_0x4b2ea7[_0x0686('0x10')](_0x518f79));}switch(_0x4710ad['zone']){case'US':_0x26d96b='https://accounts.zoho.com';break;case'AU':_0x26d96b=_0x0686('0x11');break;case'IN':_0x26d96b='https://accounts.zoho.in';break;case'CN':_0x26d96b=_0x0686('0x12');break;default:_0x26d96b=_0x0686('0x13');break;}var _0x2a7fe3={'method':'POST','uri':_0x26d96b+_0x0686('0x14'),'form':{'grant_type':'authorization_code','client_id':_0x4710ad[_0x0686('0xb')],'client_secret':_0x4710ad[_0x0686('0xc')],'redirect_uri':_0x4710ad[_0x0686('0x15')],'code':_0x4710ad[_0x0686('0xd')]},'headers':{'Content-Type':_0x0686('0x16')}};return rp(_0x2a7fe3)[_0x0686('0x17')](function(_0x247486){var _0x18b7b9=JSON[_0x0686('0x18')](_0x247486);if(_0x18b7b9[_0x0686('0x19')]){_0x4710ad['refreshToken']=_0x18b7b9[_0x0686('0x19')];logger['info'](util[_0x0686('0x1a')](_0x0686('0x1b'),_0x4710ad[_0x0686('0x1c')],_0x4710ad['id']));}else{logger[_0x0686('0x1d')](util[_0x0686('0x1a')](_0x0686('0x1e'),_0x4710ad[_0x0686('0x1c')],_0x4710ad['id']),util['inspect'](_0x18b7b9,{'showHidden':![],'depth':null}));}return _0x334aa9(null,_0x239ed1);})[_0x0686('0x1f')](function(_0x54a404){logger[_0x0686('0x1d')](util[_0x0686('0x1a')](_0x0686('0x1e'),_0x4710ad[_0x0686('0x1c')],_0x4710ad['id']),util[_0x0686('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x334aa9(_0x54a404);});}else{return _0x334aa9(null,_0x239ed1);}},'beforeUpdate':function(_0x1b6ecd,_0x19eab7,_0x3a0e7a){if(_0x1b6ecd[_0x0686('0xa')]('zone')||_0x1b6ecd['changed'](_0x0686('0x15'))||_0x1b6ecd['changed']('clientId')||_0x1b6ecd['changed'](_0x0686('0xc'))||_0x1b6ecd['changed']('code')||_0x1b6ecd[_0x0686('0xa')](_0x0686('0xe'))){var _0x434772,_0x4a732b;_0x434772=_0x1b6ecd[_0x0686('0x15')];var _0x51590a=_0x434772['slice'](-0x1);if(_0x51590a==='/'||_0x51590a==='\x5c'||_0x51590a===':'){_0x434772=_0x434772[_0x0686('0xf')](0x0,_0x434772[_0x0686('0x10')](_0x51590a));}switch(_0x1b6ecd[_0x0686('0x9')]){case'US':_0x4a732b='https://accounts.zoho.com';break;case'AU':_0x4a732b=_0x0686('0x11');break;case'IN':_0x4a732b=_0x0686('0x21');break;case'CN':_0x4a732b=_0x0686('0x12');break;default:_0x4a732b=_0x0686('0x13');break;}var _0x5af7fb={'method':_0x0686('0x22'),'uri':_0x4a732b+_0x0686('0x14'),'form':{'grant_type':'authorization_code','client_id':_0x1b6ecd[_0x0686('0xb')],'client_secret':_0x1b6ecd[_0x0686('0xc')],'redirect_uri':_0x1b6ecd[_0x0686('0x15')],'code':_0x1b6ecd[_0x0686('0xd')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x5af7fb)[_0x0686('0x17')](function(_0x1fdbc7){var _0x451c67=JSON[_0x0686('0x18')](_0x1fdbc7);if(_0x451c67['refresh_token']){_0x1b6ecd[_0x0686('0x23')]=_0x451c67[_0x0686('0x19')];logger[_0x0686('0x24')](util[_0x0686('0x1a')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1b6ecd[_0x0686('0x1c')],_0x1b6ecd['id']));}else{logger[_0x0686('0x1d')](util[_0x0686('0x1a')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1b6ecd[_0x0686('0x1c')],_0x1b6ecd['id']),util[_0x0686('0x20')](_0x451c67,{'showHidden':![],'depth':null}));}return _0x3a0e7a(null,_0x19eab7);})[_0x0686('0x1f')](function(_0xd95ea){logger[_0x0686('0x1d')](util[_0x0686('0x1a')](_0x0686('0x1e'),_0x1b6ecd[_0x0686('0x1c')],_0x1b6ecd['id']),util[_0x0686('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x3a0e7a(_0xd95ea);});}else{return _0x3a0e7a(null,_0x19eab7);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index cee6ee5..b2b4ce7 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 _0xd8d7=['ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','model','map','ZohoAccount','catch','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','rpc','jayson/promise','client','http','request','then','info'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xd8d7,0x1d4));var _0x7d8d=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xd8d7[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x7d8d('0x0'));var util=require(_0x7d8d('0x1'));var moment=require(_0x7d8d('0x2'));var BPromise=require(_0x7d8d('0x3'));var rs=require(_0x7d8d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7d8d('0x5'));var config=require('../../config/environment');var jayson=require(_0x7d8d('0x6'));var client=jayson[_0x7d8d('0x7')][_0x7d8d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc39292,_0x2294c2,_0x3036a9){return new BPromise(function(_0x1bac2e,_0x506fcd){return client[_0x7d8d('0x9')](_0xc39292,_0x3036a9)[_0x7d8d('0xa')](function(_0x3e2f6e){logger[_0x7d8d('0xb')](_0x7d8d('0xc'),_0x2294c2,_0x7d8d('0xd'));logger[_0x7d8d('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2294c2,_0x7d8d('0xd'),JSON[_0x7d8d('0xf')](_0x3e2f6e));if(_0x3e2f6e[_0x7d8d('0x10')]){if(_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x11')]===0x1f4){logger['error'](_0x7d8d('0xc'),_0x2294c2,_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);return _0x506fcd(_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);}logger[_0x7d8d('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x2294c2,_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);return _0x1bac2e(_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);}else{logger[_0x7d8d('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x2294c2,_0x7d8d('0xd'));_0x1bac2e(_0x3e2f6e['result'][_0x7d8d('0x12')]);}})['catch'](function(_0x12588c){logger[_0x7d8d('0x10')](_0x7d8d('0xc'),_0x2294c2,_0x12588c);_0x506fcd(_0x12588c);});});}exports[_0x7d8d('0x13')]=function(_0x1c00a3){var _0x31be40=this;return new Promise(function(_0x36dfbe,_0x37fe93){return db['ZohoAccount'][_0x7d8d('0x14')]({'raw':_0x1c00a3[_0x7d8d('0x15')]?_0x1c00a3[_0x7d8d('0x15')][_0x7d8d('0x16')]===undefined?!![]:![]:!![],'where':_0x1c00a3[_0x7d8d('0x15')]?_0x1c00a3[_0x7d8d('0x15')][_0x7d8d('0x17')]||null:null,'attributes':_0x1c00a3[_0x7d8d('0x15')]?_0x1c00a3[_0x7d8d('0x15')][_0x7d8d('0x18')]||null:null,'limit':_0x1c00a3[_0x7d8d('0x15')]?_0x1c00a3[_0x7d8d('0x15')][_0x7d8d('0x19')]||null:null,'include':_0x1c00a3[_0x7d8d('0x15')]?_0x1c00a3['options']['include']?_['map'](_0x1c00a3[_0x7d8d('0x15')][_0x7d8d('0x1a')],function(_0x2ab3b8){return{'model':db[_0x2ab3b8[_0x7d8d('0x1b')]],'as':_0x2ab3b8['as'],'attributes':_0x2ab3b8[_0x7d8d('0x18')],'include':_0x2ab3b8['include']?_[_0x7d8d('0x1c')](_0x2ab3b8[_0x7d8d('0x1a')],function(_0x459e88){return{'model':db[_0x459e88[_0x7d8d('0x1b')]],'as':_0x459e88['as'],'attributes':_0x459e88[_0x7d8d('0x18')],'include':_0x459e88[_0x7d8d('0x1a')]?_[_0x7d8d('0x1c')](_0x459e88['include'],function(_0x414da4){return{'model':db[_0x414da4[_0x7d8d('0x1b')]],'as':_0x414da4['as'],'attributes':_0x414da4[_0x7d8d('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7d8d('0xa')](function(_0xedad25){logger['info']('GetZohoAccount',_0x1c00a3);logger[_0x7d8d('0xe')](_0x7d8d('0x13'),_0x1c00a3,JSON[_0x7d8d('0xf')](_0xedad25));_0x36dfbe(_0xedad25);})['catch'](function(_0x18605b){logger[_0x7d8d('0x10')](_0x7d8d('0x13'),_0x18605b['message'],_0x1c00a3);_0x37fe93(_0x31be40[_0x7d8d('0x10')](0x1f4,_0x18605b[_0x7d8d('0x12')]));});});};exports['ShowZohoAccount']=function(_0x1a918c){var _0x46319a=this;return new Promise(function(_0x3c1fb2,_0x308383){return db[_0x7d8d('0x1d')]['find']({'raw':_0x1a918c['options']?_0x1a918c[_0x7d8d('0x15')][_0x7d8d('0x16')]===undefined?!![]:![]:!![],'where':_0x1a918c['options']?_0x1a918c[_0x7d8d('0x15')]['where']||null:null,'attributes':_0x1a918c[_0x7d8d('0x15')]?_0x1a918c[_0x7d8d('0x15')]['attributes']||null:null,'include':_0x1a918c[_0x7d8d('0x15')]?_0x1a918c[_0x7d8d('0x15')][_0x7d8d('0x1a')]?_[_0x7d8d('0x1c')](_0x1a918c['options'][_0x7d8d('0x1a')],function(_0x55262f){return{'model':db[_0x55262f[_0x7d8d('0x1b')]],'as':_0x55262f['as'],'attributes':_0x55262f[_0x7d8d('0x18')],'include':_0x55262f[_0x7d8d('0x1a')]?_[_0x7d8d('0x1c')](_0x55262f['include'],function(_0x35e469){return{'model':db[_0x35e469[_0x7d8d('0x1b')]],'as':_0x35e469['as'],'attributes':_0x35e469[_0x7d8d('0x18')],'include':_0x35e469[_0x7d8d('0x1a')]?_[_0x7d8d('0x1c')](_0x35e469[_0x7d8d('0x1a')],function(_0x3a90df){return{'model':db[_0x3a90df[_0x7d8d('0x1b')]],'as':_0x3a90df['as'],'attributes':_0x3a90df['attributes']};}):[]};}):[]};}):[]:[]})[_0x7d8d('0xa')](function(_0x3f87da){logger[_0x7d8d('0xb')]('ShowZohoAccount',_0x1a918c);logger['debug']('ShowZohoAccount',_0x1a918c,JSON[_0x7d8d('0xf')](_0x3f87da));_0x3c1fb2(_0x3f87da);})[_0x7d8d('0x1e')](function(_0x41432a){logger[_0x7d8d('0x10')](_0x7d8d('0x1f'),_0x41432a['message'],_0x1a918c);_0x308383(_0x46319a[_0x7d8d('0x10')](0x1f4,_0x41432a[_0x7d8d('0x12')]));});});}; \ No newline at end of file +var _0xc113=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoAccount,\x20%s,\x20%s','result','GetZohoAccount','ZohoAccount','findAll','raw','options','attributes','limit','include','map','model','then','catch','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring'];(function(_0x186578,_0xc005e9){var _0x3f8761=function(_0x4c22b9){while(--_0x4c22b9){_0x186578['push'](_0x186578['shift']());}};_0x3f8761(++_0xc005e9);}(_0xc113,0x1ab));var _0x3c11=function(_0x18f823,_0x9da780){_0x18f823=_0x18f823-0x0;var _0x2c2675=_0xc113[_0x18f823];return _0x2c2675;};'use strict';var _=require(_0x3c11('0x0'));var util=require(_0x3c11('0x1'));var moment=require(_0x3c11('0x2'));var BPromise=require(_0x3c11('0x3'));var rs=require(_0x3c11('0x4'));var fs=require('fs');var Redis=require(_0x3c11('0x5'));var db=require(_0x3c11('0x6'))['db'];var utils=require(_0x3c11('0x7'));var logger=require(_0x3c11('0x8'))('rpc');var config=require(_0x3c11('0x9'));var jayson=require(_0x3c11('0xa'));var client=jayson['client'][_0x3c11('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b181f,_0x2fa44d,_0x5d6f91){return new BPromise(function(_0x16959a,_0x4e98c0){return client['request'](_0x3b181f,_0x5d6f91)['then'](function(_0x7f14e6){logger[_0x3c11('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x2fa44d,_0x3c11('0xd'));logger[_0x3c11('0xe')](_0x3c11('0xf'),_0x2fa44d,'request\x20sent',JSON[_0x3c11('0x10')](_0x7f14e6));if(_0x7f14e6[_0x3c11('0x11')]){if(_0x7f14e6[_0x3c11('0x11')][_0x3c11('0x12')]===0x1f4){logger[_0x3c11('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x2fa44d,_0x7f14e6[_0x3c11('0x11')][_0x3c11('0x13')]);return _0x4e98c0(_0x7f14e6['error'][_0x3c11('0x13')]);}logger[_0x3c11('0x11')](_0x3c11('0x14'),_0x2fa44d,_0x7f14e6[_0x3c11('0x11')][_0x3c11('0x13')]);return _0x16959a(_0x7f14e6['error'][_0x3c11('0x13')]);}else{logger[_0x3c11('0xc')](_0x3c11('0x14'),_0x2fa44d,_0x3c11('0xd'));_0x16959a(_0x7f14e6[_0x3c11('0x15')]['message']);}})['catch'](function(_0x575e69){logger[_0x3c11('0x11')](_0x3c11('0x14'),_0x2fa44d,_0x575e69);_0x4e98c0(_0x575e69);});});}exports[_0x3c11('0x16')]=function(_0x42db8d){var _0x1a80a5=this;return new Promise(function(_0x35d32f,_0x3478ec){return db[_0x3c11('0x17')][_0x3c11('0x18')]({'raw':_0x42db8d['options']?_0x42db8d['options'][_0x3c11('0x19')]===undefined?!![]:![]:!![],'where':_0x42db8d['options']?_0x42db8d[_0x3c11('0x1a')]['where']||null:null,'attributes':_0x42db8d[_0x3c11('0x1a')]?_0x42db8d['options'][_0x3c11('0x1b')]||null:null,'limit':_0x42db8d['options']?_0x42db8d['options'][_0x3c11('0x1c')]||null:null,'include':_0x42db8d['options']?_0x42db8d[_0x3c11('0x1a')][_0x3c11('0x1d')]?_[_0x3c11('0x1e')](_0x42db8d[_0x3c11('0x1a')][_0x3c11('0x1d')],function(_0x4e456a){return{'model':db[_0x4e456a[_0x3c11('0x1f')]],'as':_0x4e456a['as'],'attributes':_0x4e456a['attributes'],'include':_0x4e456a[_0x3c11('0x1d')]?_[_0x3c11('0x1e')](_0x4e456a['include'],function(_0x29f3cd){return{'model':db[_0x29f3cd[_0x3c11('0x1f')]],'as':_0x29f3cd['as'],'attributes':_0x29f3cd[_0x3c11('0x1b')],'include':_0x29f3cd[_0x3c11('0x1d')]?_[_0x3c11('0x1e')](_0x29f3cd[_0x3c11('0x1d')],function(_0x1af1fb){return{'model':db[_0x1af1fb[_0x3c11('0x1f')]],'as':_0x1af1fb['as'],'attributes':_0x1af1fb[_0x3c11('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3c11('0x20')](function(_0x500073){logger[_0x3c11('0xc')](_0x3c11('0x16'),_0x42db8d);logger[_0x3c11('0xe')](_0x3c11('0x16'),_0x42db8d,JSON['stringify'](_0x500073));_0x35d32f(_0x500073);})[_0x3c11('0x21')](function(_0x21401c){logger['error'](_0x3c11('0x16'),_0x21401c[_0x3c11('0x13')],_0x42db8d);_0x3478ec(_0x1a80a5[_0x3c11('0x11')](0x1f4,_0x21401c[_0x3c11('0x13')]));});});};exports[_0x3c11('0x22')]=function(_0x1e4834){var _0x3c5377=this;return new Promise(function(_0x22158b,_0x517cd7){return db[_0x3c11('0x17')][_0x3c11('0x23')]({'raw':_0x1e4834[_0x3c11('0x1a')]?_0x1e4834[_0x3c11('0x1a')][_0x3c11('0x19')]===undefined?!![]:![]:!![],'where':_0x1e4834[_0x3c11('0x1a')]?_0x1e4834[_0x3c11('0x1a')]['where']||null:null,'attributes':_0x1e4834[_0x3c11('0x1a')]?_0x1e4834[_0x3c11('0x1a')][_0x3c11('0x1b')]||null:null,'include':_0x1e4834[_0x3c11('0x1a')]?_0x1e4834[_0x3c11('0x1a')][_0x3c11('0x1d')]?_['map'](_0x1e4834[_0x3c11('0x1a')]['include'],function(_0x4c374f){return{'model':db[_0x4c374f[_0x3c11('0x1f')]],'as':_0x4c374f['as'],'attributes':_0x4c374f[_0x3c11('0x1b')],'include':_0x4c374f['include']?_[_0x3c11('0x1e')](_0x4c374f[_0x3c11('0x1d')],function(_0x19b137){return{'model':db[_0x19b137['model']],'as':_0x19b137['as'],'attributes':_0x19b137[_0x3c11('0x1b')],'include':_0x19b137[_0x3c11('0x1d')]?_[_0x3c11('0x1e')](_0x19b137[_0x3c11('0x1d')],function(_0x482d92){return{'model':db[_0x482d92[_0x3c11('0x1f')]],'as':_0x482d92['as'],'attributes':_0x482d92[_0x3c11('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39d680){logger[_0x3c11('0xc')](_0x3c11('0x22'),_0x1e4834);logger['debug'](_0x3c11('0x22'),_0x1e4834,JSON['stringify'](_0x39d680));_0x22158b(_0x39d680);})[_0x3c11('0x21')](function(_0x49323c){logger['error'](_0x3c11('0x22'),_0x49323c['message'],_0x1e4834);_0x517cd7(_0x3c5377[_0x3c11('0x11')](0x1f4,_0x49323c['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 8c3cacb..1a42665 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 _0x92c9=['fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','multer','util','path','express'];(function(_0x566168,_0x4c39af){var _0x4e1f7a=function(_0x5ec3ee){while(--_0x5ec3ee){_0x566168['push'](_0x566168['shift']());}};_0x4e1f7a(++_0x4c39af);}(_0x92c9,0x1ac));var _0x992c=function(_0x4ae58a,_0x72bd08){_0x4ae58a=_0x4ae58a-0x0;var _0x3c0445=_0x92c9[_0x4ae58a];return _0x3c0445;};'use strict';var multer=require(_0x992c('0x0'));var util=require(_0x992c('0x1'));var path=require(_0x992c('0x2'));var timeout=require('connect-timeout');var express=require(_0x992c('0x3'));var router=express['Router']();var fs_extra=require(_0x992c('0x4'));var auth=require(_0x992c('0x5'));var interaction=require(_0x992c('0x6'));var config=require('../../config/environment');var controller=require(_0x992c('0x7'));router[_0x992c('0x8')]('/',auth[_0x992c('0x9')](),controller[_0x992c('0xa')]);router[_0x992c('0x8')]('/:id',auth[_0x992c('0x9')](),controller[_0x992c('0xb')]);router[_0x992c('0x8')](_0x992c('0xc'),auth[_0x992c('0x9')](),controller[_0x992c('0xd')]);router[_0x992c('0x8')](_0x992c('0xe'),auth[_0x992c('0x9')](),controller[_0x992c('0xf')]);router[_0x992c('0x8')](_0x992c('0x10'),auth['isAuthenticated'](),controller[_0x992c('0x11')]);router[_0x992c('0x12')]('/',auth[_0x992c('0x9')](),controller[_0x992c('0x13')]);router[_0x992c('0x14')](_0x992c('0x15'),auth[_0x992c('0x9')](),controller[_0x992c('0x16')]);router['delete'](_0x992c('0x15'),auth['isAuthenticated'](),controller[_0x992c('0x17')]);module['exports']=router; \ No newline at end of file +var _0x16a0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','destroy','exports','util'];(function(_0x316932,_0x1e80ca){var _0x4d2dd5=function(_0xe4918e){while(--_0xe4918e){_0x316932['push'](_0x316932['shift']());}};_0x4d2dd5(++_0x1e80ca);}(_0x16a0,0x99));var _0x016a=function(_0x5c7263,_0x23a072){_0x5c7263=_0x5c7263-0x0;var _0x360657=_0x16a0[_0x5c7263];return _0x360657;};'use strict';var multer=require('multer');var util=require(_0x016a('0x0'));var path=require('path');var timeout=require(_0x016a('0x1'));var express=require(_0x016a('0x2'));var router=express[_0x016a('0x3')]();var fs_extra=require(_0x016a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x016a('0x5'));var config=require('../../config/environment');var controller=require(_0x016a('0x6'));router[_0x016a('0x7')]('/',auth[_0x016a('0x8')](),controller[_0x016a('0x9')]);router[_0x016a('0x7')](_0x016a('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x016a('0xb'),auth[_0x016a('0x8')](),controller[_0x016a('0xc')]);router[_0x016a('0x7')](_0x016a('0xd'),auth[_0x016a('0x8')](),controller[_0x016a('0xe')]);router[_0x016a('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x016a('0xf')]);router[_0x016a('0x10')]('/',auth[_0x016a('0x8')](),controller[_0x016a('0x11')]);router[_0x016a('0x12')](_0x016a('0xa'),auth[_0x016a('0x8')](),controller['update']);router[_0x016a('0x13')](_0x016a('0xa'),auth['isAuthenticated'](),controller[_0x016a('0x14')]);module[_0x016a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index b4ccef4..8f6360c 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 _0x7025=['STRING','ENUM','contact','lead','contact_lead','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7025,0x132));var _0x5702=function(_0xa40a5c,_0x4d941f){_0xa40a5c=_0xa40a5c-0x0;var _0x2ccbc5=_0x7025[_0xa40a5c];return _0x2ccbc5;};'use strict';var Sequelize=require(_0x5702('0x0'));module[_0x5702('0x1')]={'name':{'type':Sequelize[_0x5702('0x2')]},'moduleCreate':{'type':Sequelize[_0x5702('0x3')]('lead',_0x5702('0x4'),'nothing'),'defaultValue':_0x5702('0x5')},'moduleSearch':{'type':Sequelize[_0x5702('0x3')](_0x5702('0x6'),_0x5702('0x4'),_0x5702('0x5')),'defaultValue':_0x5702('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8bea=['sequelize','exports','STRING','lead','contact','contact_lead'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x8bea,0xf6));var _0xa8be=function(_0x2532e8,_0x1cdb49){_0x2532e8=_0x2532e8-0x0;var _0x1d165c=_0x8bea[_0x2532e8];return _0x1d165c;};'use strict';var Sequelize=require(_0xa8be('0x0'));module[_0xa8be('0x1')]={'name':{'type':Sequelize[_0xa8be('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xa8be('0x3'),_0xa8be('0x4'),'nothing'),'defaultValue':_0xa8be('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xa8be('0x4'),'lead'),'defaultValue':_0xa8be('0x5')},'description':{'type':Sequelize[_0xa8be('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 4d96701..8a5aa6c 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 _0xae6d=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','includeAll','find','create','body','params','findOne','ZohoField','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','ZohoConfiguration','fieldName','key','model','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae6d,0x11b));var _0xdae6=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0xae6d[_0x1a8ff0];return _0x3588bf;};'use strict';var emlformat=require(_0xdae6('0x0'));var rimraf=require(_0xdae6('0x1'));var zipdir=require(_0xdae6('0x2'));var jsonpatch=require(_0xdae6('0x3'));var rp=require(_0xdae6('0x4'));var moment=require(_0xdae6('0x5'));var BPromise=require(_0xdae6('0x6'));var Mustache=require(_0xdae6('0x7'));var util=require(_0xdae6('0x8'));var path=require(_0xdae6('0x9'));var sox=require(_0xdae6('0xa'));var csv=require(_0xdae6('0xb'));var ejs=require(_0xdae6('0xc'));var fs=require('fs');var fs_extra=require(_0xdae6('0xd'));var _=require(_0xdae6('0xe'));var squel=require(_0xdae6('0xf'));var crypto=require('crypto');var jsforce=require(_0xdae6('0x10'));var deskjs=require(_0xdae6('0x11'));var toCsv=require(_0xdae6('0xb'));var querystring=require(_0xdae6('0x12'));var Papa=require(_0xdae6('0x13'));var Redis=require('ioredis');var authService=require(_0xdae6('0x14'));var qs=require(_0xdae6('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdae6('0x16'));var logger=require(_0xdae6('0x17'))(_0xdae6('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdae6('0x19'))['db'];function respondWithStatusCode(_0x1c32bb,_0x2b214c){_0x2b214c=_0x2b214c||0xcc;return function(_0x46cf35){if(_0x46cf35){return _0x1c32bb['sendStatus'](_0x2b214c);}return _0x1c32bb['status'](_0x2b214c)[_0xdae6('0x1a')]();};}function respondWithResult(_0x227cbb,_0x3c21c1){_0x3c21c1=_0x3c21c1||0xc8;return function(_0x4086a4){if(_0x4086a4){return _0x227cbb[_0xdae6('0x1b')](_0x3c21c1)['json'](_0x4086a4);}};}function respondWithFilteredResult(_0x308494,_0x4e9d54){return function(_0x41badb){if(_0x41badb){var _0x1e1522=typeof _0x4e9d54[_0xdae6('0x1c')]==='undefined'&&typeof _0x4e9d54[_0xdae6('0x1d')]===_0xdae6('0x1e');var _0x42063f=_0x41badb[_0xdae6('0x1f')];var _0x39f77d=_0x1e1522?0x0:_0x4e9d54[_0xdae6('0x1c')];var _0x62315c=_0x1e1522?_0x41badb[_0xdae6('0x1f')]:_0x4e9d54[_0xdae6('0x1c')]+_0x4e9d54[_0xdae6('0x1d')];var _0x4d895a;if(_0x62315c>=_0x42063f){_0x62315c=_0x42063f;_0x4d895a=0xc8;}else{_0x4d895a=0xce;}_0x308494[_0xdae6('0x1b')](_0x4d895a);return _0x308494[_0xdae6('0x20')]('Content-Range',_0x39f77d+'-'+_0x62315c+'/'+_0x42063f)[_0xdae6('0x21')](_0x41badb);}return null;};}function patchUpdates(_0x155a48){return function(_0x405cd4){try{jsonpatch[_0xdae6('0x22')](_0x405cd4,_0x155a48,!![]);}catch(_0x1af408){return BPromise[_0xdae6('0x23')](_0x1af408);}return _0x405cd4[_0xdae6('0x24')]();};}function saveUpdates(_0x4c236d,_0x490fdb){return function(_0x2c3e99){if(_0x2c3e99){return _0x2c3e99[_0xdae6('0x25')](_0x4c236d)[_0xdae6('0x26')](function(_0x1ff037){return _0x1ff037;});}return null;};}function removeEntity(_0x21dfc4,_0x52f57d){return function(_0x53049b){if(_0x53049b){return _0x53049b[_0xdae6('0x27')]()[_0xdae6('0x26')](function(){_0x21dfc4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34e71e,_0x4e1e5f){return function(_0x32d4bc){if(!_0x32d4bc){_0x34e71e[_0xdae6('0x28')](0x194);}return _0x32d4bc;};}function handleError(_0x3d1a09,_0x2c8a96){_0x2c8a96=_0x2c8a96||0x1f4;return function(_0x1fee12){logger['error'](_0x1fee12[_0xdae6('0x29')]);if(_0x1fee12[_0xdae6('0x2a')]){delete _0x1fee12[_0xdae6('0x2a')];}_0x3d1a09[_0xdae6('0x1b')](_0x2c8a96)[_0xdae6('0x2b')](_0x1fee12);};}exports['index']=function(_0xae5b6e,_0x2a3c73){var _0x54cac9={},_0x3c5d3e={},_0x27fd26={'count':0x0,'rows':[]};var _0x503ade=_['map'](db[_0xdae6('0x2c')]['rawAttributes'],function(_0x4ed1ac){return{'name':_0x4ed1ac[_0xdae6('0x2d')],'type':_0x4ed1ac['type'][_0xdae6('0x2e')]};});_0x3c5d3e[_0xdae6('0x2f')]=_[_0xdae6('0x30')](_0x503ade,_0xdae6('0x2a'));_0x3c5d3e[_0xdae6('0x31')]=_[_0xdae6('0x32')](_0xae5b6e[_0xdae6('0x31')]);_0x3c5d3e[_0xdae6('0x33')]=_[_0xdae6('0x34')](_0x3c5d3e[_0xdae6('0x2f')],_0x3c5d3e[_0xdae6('0x31')]);_0x54cac9[_0xdae6('0x35')]=_['intersection'](_0x3c5d3e['model'],qs['fields'](_0xae5b6e[_0xdae6('0x31')][_0xdae6('0x36')]));_0x54cac9[_0xdae6('0x35')]=_0x54cac9[_0xdae6('0x35')]['length']?_0x54cac9['attributes']:_0x3c5d3e[_0xdae6('0x2f')];if(!_0xae5b6e['query'][_0xdae6('0x37')](_0xdae6('0x38'))){_0x54cac9['limit']=qs['limit'](_0xae5b6e['query'][_0xdae6('0x1d')]);_0x54cac9[_0xdae6('0x1c')]=qs[_0xdae6('0x1c')](_0xae5b6e[_0xdae6('0x31')][_0xdae6('0x1c')]);}_0x54cac9[_0xdae6('0x39')]=qs[_0xdae6('0x3a')](_0xae5b6e[_0xdae6('0x31')][_0xdae6('0x3a')]);_0x54cac9[_0xdae6('0x3b')]=qs[_0xdae6('0x33')](_[_0xdae6('0x3c')](_0xae5b6e[_0xdae6('0x31')],_0x3c5d3e['filters']),_0x503ade);if(_0xae5b6e[_0xdae6('0x31')][_0xdae6('0x3d')]){_0x54cac9[_0xdae6('0x3b')]=_[_0xdae6('0x3e')](_0x54cac9[_0xdae6('0x3b')],{'$or':_['map'](_0x503ade,function(_0x56221c){if(_0x56221c[_0xdae6('0x3f')]!==_0xdae6('0x40')){var _0x4d2d93={};_0x4d2d93[_0x56221c['name']]={'$like':'%'+_0xae5b6e[_0xdae6('0x31')][_0xdae6('0x3d')]+'%'};return _0x4d2d93;}})});}_0x54cac9=_[_0xdae6('0x3e')]({},_0x54cac9,_0xae5b6e[_0xdae6('0x41')]);var _0x1fa103={'where':_0x54cac9[_0xdae6('0x3b')]};return db['ZohoConfiguration'][_0xdae6('0x1f')](_0x1fa103)[_0xdae6('0x26')](function(_0x482ce4){_0x27fd26[_0xdae6('0x1f')]=_0x482ce4;if(_0xae5b6e[_0xdae6('0x31')]['includeAll']){_0x54cac9[_0xdae6('0x42')]=[{'all':!![]}];}return db[_0xdae6('0x2c')][_0xdae6('0x43')](_0x54cac9);})[_0xdae6('0x26')](function(_0x436f53){_0x27fd26[_0xdae6('0x44')]=_0x436f53;return _0x27fd26;})[_0xdae6('0x26')](respondWithFilteredResult(_0x2a3c73,_0x54cac9))[_0xdae6('0x45')](handleError(_0x2a3c73,null));};exports[_0xdae6('0x46')]=function(_0xe88e54,_0x2754ac){var _0x2e845f={'raw':![],'where':{'id':_0xe88e54['params']['id']}},_0x9f4b80={};_0x9f4b80[_0xdae6('0x2f')]=_['keys'](db['ZohoConfiguration'][_0xdae6('0x47')]);_0x9f4b80['query']=_[_0xdae6('0x32')](_0xe88e54[_0xdae6('0x31')]);_0x9f4b80[_0xdae6('0x33')]=_['intersection'](_0x9f4b80['model'],_0x9f4b80[_0xdae6('0x31')]);_0x2e845f[_0xdae6('0x35')]=_['intersection'](_0x9f4b80[_0xdae6('0x2f')],qs[_0xdae6('0x36')](_0xe88e54['query']['fields']));_0x2e845f[_0xdae6('0x35')]=_0x2e845f[_0xdae6('0x35')][_0xdae6('0x48')]?_0x2e845f['attributes']:_0x9f4b80['model'];if(_0xe88e54[_0xdae6('0x31')][_0xdae6('0x49')]){_0x2e845f[_0xdae6('0x42')]=[{'all':!![]}];}_0x2e845f=_[_0xdae6('0x3e')]({},_0x2e845f,_0xe88e54[_0xdae6('0x41')]);return db[_0xdae6('0x2c')][_0xdae6('0x4a')](_0x2e845f)['then'](handleEntityNotFound(_0x2754ac,null))[_0xdae6('0x26')](respondWithResult(_0x2754ac,null))[_0xdae6('0x45')](handleError(_0x2754ac,null));};exports[_0xdae6('0x4b')]=function(_0x2bf5c4,_0x32e31d){return db[_0xdae6('0x2c')][_0xdae6('0x4b')](_0x2bf5c4[_0xdae6('0x4c')],{})['then'](respondWithResult(_0x32e31d,0xc9))[_0xdae6('0x45')](handleError(_0x32e31d,null));};exports[_0xdae6('0x25')]=function(_0x3e9bc6,_0x541da7){if(_0x3e9bc6[_0xdae6('0x4c')]['id']){delete _0x3e9bc6[_0xdae6('0x4c')]['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x3e9bc6['params']['id']}})['then'](handleEntityNotFound(_0x541da7,null))[_0xdae6('0x26')](saveUpdates(_0x3e9bc6[_0xdae6('0x4c')],null))[_0xdae6('0x26')](respondWithResult(_0x541da7,null))[_0xdae6('0x45')](handleError(_0x541da7,null));};exports[_0xdae6('0x27')]=function(_0x11696d,_0x191ac9){return db[_0xdae6('0x2c')][_0xdae6('0x4a')]({'where':{'id':_0x11696d[_0xdae6('0x4d')]['id']}})[_0xdae6('0x26')](handleEntityNotFound(_0x191ac9,null))[_0xdae6('0x26')](removeEntity(_0x191ac9,null))[_0xdae6('0x45')](handleError(_0x191ac9,null));};exports['getFields']=function(_0x47354b,_0x51f5d3,_0x512273){var _0x91c18f={};var _0x8e4dbc={};var _0x35f344;var _0xc15d0;return db[_0xdae6('0x2c')][_0xdae6('0x4e')]({'where':{'id':_0x47354b[_0xdae6('0x4d')]['id']}})[_0xdae6('0x26')](handleEntityNotFound(_0x51f5d3,null))['then'](function(_0xca9435){if(_0xca9435){_0x35f344=_0xca9435;_0x8e4dbc[_0xdae6('0x2f')]=_[_0xdae6('0x32')](db[_0xdae6('0x4f')][_0xdae6('0x47')]);_0x8e4dbc[_0xdae6('0x31')]=_[_0xdae6('0x32')](_0x47354b['query']);_0x8e4dbc['filters']=_[_0xdae6('0x34')](_0x8e4dbc[_0xdae6('0x2f')],_0x8e4dbc[_0xdae6('0x31')]);_0x91c18f[_0xdae6('0x35')]=_[_0xdae6('0x34')](_0x8e4dbc[_0xdae6('0x2f')],qs[_0xdae6('0x36')](_0x47354b[_0xdae6('0x31')][_0xdae6('0x36')]));_0x91c18f[_0xdae6('0x35')]=_0x91c18f['attributes']['length']?_0x91c18f['attributes']:_0x8e4dbc[_0xdae6('0x2f')];_0x91c18f['order']=qs['sort'](_0x47354b[_0xdae6('0x31')][_0xdae6('0x3a')]);_0x91c18f[_0xdae6('0x3b')]=qs[_0xdae6('0x33')](_['pick'](_0x47354b[_0xdae6('0x31')],_0x8e4dbc[_0xdae6('0x33')]));if(_0x47354b[_0xdae6('0x31')][_0xdae6('0x3d')]){_0x91c18f[_0xdae6('0x3b')]=_[_0xdae6('0x3e')](_0x91c18f[_0xdae6('0x3b')],{'$or':_[_0xdae6('0x30')](_0x91c18f[_0xdae6('0x35')],function(_0x47303b){var _0x556716={};_0x556716[_0x47303b]={'$like':'%'+_0x47354b[_0xdae6('0x31')][_0xdae6('0x3d')]+'%'};return _0x556716;})});}_0x91c18f=_[_0xdae6('0x3e')]({},_0x91c18f,_0x47354b['options']);return _0x35f344[_0xdae6('0x50')](_0x91c18f);}})[_0xdae6('0x26')](function(_0x271864){if(_0x271864){_0xc15d0=_0x271864['length'];if(!_0x47354b[_0xdae6('0x31')][_0xdae6('0x37')](_0xdae6('0x38'))){_0x91c18f[_0xdae6('0x1d')]=qs[_0xdae6('0x1d')](_0x47354b[_0xdae6('0x31')][_0xdae6('0x1d')]);_0x91c18f[_0xdae6('0x1c')]=qs[_0xdae6('0x1c')](_0x47354b[_0xdae6('0x31')][_0xdae6('0x1c')]);}return _0x35f344[_0xdae6('0x50')](_0x91c18f);}})[_0xdae6('0x26')](function(_0x2637cb){if(_0x2637cb){return _0x2637cb?{'count':_0xc15d0,'rows':_0x2637cb}:null;}})[_0xdae6('0x26')](respondWithResult(_0x51f5d3,null))[_0xdae6('0x45')](handleError(_0x51f5d3,null));};exports['getSubjects']=function(_0x4b4b7b,_0x3bc1e3,_0x2e95d9){var _0x1461b9={};var _0xb874e={};var _0xd2c85e;var _0x41efbd;return db[_0xdae6('0x2c')][_0xdae6('0x4e')]({'where':{'id':_0x4b4b7b['params']['id']}})[_0xdae6('0x26')](handleEntityNotFound(_0x3bc1e3,null))['then'](function(_0x3f9533){if(_0x3f9533){_0xd2c85e=_0x3f9533;_0xb874e[_0xdae6('0x2f')]=_['keys'](db[_0xdae6('0x4f')][_0xdae6('0x47')]);_0xb874e[_0xdae6('0x31')]=_['keys'](_0x4b4b7b['query']);_0xb874e[_0xdae6('0x33')]=_[_0xdae6('0x34')](_0xb874e[_0xdae6('0x2f')],_0xb874e[_0xdae6('0x31')]);_0x1461b9[_0xdae6('0x35')]=_[_0xdae6('0x34')](_0xb874e[_0xdae6('0x2f')],qs['fields'](_0x4b4b7b['query'][_0xdae6('0x36')]));_0x1461b9[_0xdae6('0x35')]=_0x1461b9[_0xdae6('0x35')][_0xdae6('0x48')]?_0x1461b9[_0xdae6('0x35')]:_0xb874e[_0xdae6('0x2f')];_0x1461b9[_0xdae6('0x39')]=qs[_0xdae6('0x3a')](_0x4b4b7b[_0xdae6('0x31')][_0xdae6('0x3a')]);_0x1461b9[_0xdae6('0x3b')]=qs['filters'](_[_0xdae6('0x3c')](_0x4b4b7b['query'],_0xb874e[_0xdae6('0x33')]));if(_0x4b4b7b[_0xdae6('0x31')][_0xdae6('0x3d')]){_0x1461b9[_0xdae6('0x3b')]=_[_0xdae6('0x3e')](_0x1461b9[_0xdae6('0x3b')],{'$or':_[_0xdae6('0x30')](_0x1461b9['attributes'],function(_0x366298){var _0x49a38a={};_0x49a38a[_0x366298]={'$like':'%'+_0x4b4b7b[_0xdae6('0x31')][_0xdae6('0x3d')]+'%'};return _0x49a38a;})});}_0x1461b9=_[_0xdae6('0x3e')]({},_0x1461b9,_0x4b4b7b[_0xdae6('0x41')]);return _0xd2c85e[_0xdae6('0x51')](_0x1461b9);}})['then'](function(_0x2798f1){if(_0x2798f1){_0x41efbd=_0x2798f1['length'];if(!_0x4b4b7b[_0xdae6('0x31')][_0xdae6('0x37')](_0xdae6('0x38'))){_0x1461b9[_0xdae6('0x1d')]=qs[_0xdae6('0x1d')](_0x4b4b7b['query'][_0xdae6('0x1d')]);_0x1461b9['offset']=qs[_0xdae6('0x1c')](_0x4b4b7b['query']['offset']);}return _0xd2c85e['getSubjects'](_0x1461b9);}})[_0xdae6('0x26')](function(_0x295b6b){if(_0x295b6b){return _0x295b6b?{'count':_0x41efbd,'rows':_0x295b6b}:null;}})[_0xdae6('0x26')](respondWithResult(_0x3bc1e3,null))[_0xdae6('0x45')](handleError(_0x3bc1e3,null));};exports['getDescriptions']=function(_0x513b15,_0x29b8bf,_0x38a90b){var _0x56b2df={};var _0x37db39={};var _0x205cf1;var _0x97ad10;return db[_0xdae6('0x2c')][_0xdae6('0x4e')]({'where':{'id':_0x513b15['params']['id']}})[_0xdae6('0x26')](handleEntityNotFound(_0x29b8bf,null))[_0xdae6('0x26')](function(_0x378b9f){if(_0x378b9f){_0x205cf1=_0x378b9f;_0x37db39[_0xdae6('0x2f')]=_[_0xdae6('0x32')](db[_0xdae6('0x4f')]['rawAttributes']);_0x37db39[_0xdae6('0x31')]=_[_0xdae6('0x32')](_0x513b15[_0xdae6('0x31')]);_0x37db39[_0xdae6('0x33')]=_[_0xdae6('0x34')](_0x37db39[_0xdae6('0x2f')],_0x37db39['query']);_0x56b2df[_0xdae6('0x35')]=_[_0xdae6('0x34')](_0x37db39[_0xdae6('0x2f')],qs['fields'](_0x513b15[_0xdae6('0x31')][_0xdae6('0x36')]));_0x56b2df[_0xdae6('0x35')]=_0x56b2df['attributes'][_0xdae6('0x48')]?_0x56b2df[_0xdae6('0x35')]:_0x37db39['model'];_0x56b2df[_0xdae6('0x39')]=qs['sort'](_0x513b15[_0xdae6('0x31')][_0xdae6('0x3a')]);_0x56b2df[_0xdae6('0x3b')]=qs[_0xdae6('0x33')](_[_0xdae6('0x3c')](_0x513b15['query'],_0x37db39[_0xdae6('0x33')]));if(_0x513b15[_0xdae6('0x31')][_0xdae6('0x3d')]){_0x56b2df[_0xdae6('0x3b')]=_[_0xdae6('0x3e')](_0x56b2df[_0xdae6('0x3b')],{'$or':_['map'](_0x56b2df[_0xdae6('0x35')],function(_0x30c127){var _0x1a6314={};_0x1a6314[_0x30c127]={'$like':'%'+_0x513b15['query'][_0xdae6('0x3d')]+'%'};return _0x1a6314;})});}_0x56b2df=_[_0xdae6('0x3e')]({},_0x56b2df,_0x513b15['options']);return _0x205cf1[_0xdae6('0x52')](_0x56b2df);}})[_0xdae6('0x26')](function(_0xc86f62){if(_0xc86f62){_0x97ad10=_0xc86f62[_0xdae6('0x48')];if(!_0x513b15[_0xdae6('0x31')][_0xdae6('0x37')]('nolimit')){_0x56b2df[_0xdae6('0x1d')]=qs[_0xdae6('0x1d')](_0x513b15[_0xdae6('0x31')][_0xdae6('0x1d')]);_0x56b2df[_0xdae6('0x1c')]=qs[_0xdae6('0x1c')](_0x513b15[_0xdae6('0x31')][_0xdae6('0x1c')]);}return _0x205cf1[_0xdae6('0x52')](_0x56b2df);}})['then'](function(_0x550500){if(_0x550500){return _0x550500?{'count':_0x97ad10,'rows':_0x550500}:null;}})[_0xdae6('0x26')](respondWithResult(_0x29b8bf,null))[_0xdae6('0x45')](handleError(_0x29b8bf,null));}; \ No newline at end of file +var _0x8f15=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','destroy','then','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','length','find','create','body','getFields','params','ZohoField','order','pick','getSubjects','findOne','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x11f0bf,_0x5360f5){var _0x347400=function(_0x1d0043){while(--_0x1d0043){_0x11f0bf['push'](_0x11f0bf['shift']());}};_0x347400(++_0x5360f5);}(_0x8f15,0x98));var _0x58f1=function(_0x14a804,_0x185102){_0x14a804=_0x14a804-0x0;var _0x3e5fcc=_0x8f15[_0x14a804];return _0x3e5fcc;};'use strict';var emlformat=require(_0x58f1('0x0'));var rimraf=require(_0x58f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x58f1('0x2'));var moment=require(_0x58f1('0x3'));var BPromise=require(_0x58f1('0x4'));var Mustache=require(_0x58f1('0x5'));var util=require(_0x58f1('0x6'));var path=require(_0x58f1('0x7'));var sox=require('sox');var csv=require(_0x58f1('0x8'));var ejs=require(_0x58f1('0x9'));var fs=require('fs');var fs_extra=require(_0x58f1('0xa'));var _=require(_0x58f1('0xb'));var squel=require(_0x58f1('0xc'));var crypto=require(_0x58f1('0xd'));var jsforce=require(_0x58f1('0xe'));var deskjs=require(_0x58f1('0xf'));var toCsv=require(_0x58f1('0x8'));var querystring=require(_0x58f1('0x10'));var Papa=require(_0x58f1('0x11'));var Redis=require(_0x58f1('0x12'));var authService=require(_0x58f1('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x58f1('0x14'));var logger=require(_0x58f1('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x58f1('0x16'));var licenseUtil=require(_0x58f1('0x17'));var db=require(_0x58f1('0x18'))['db'];function respondWithStatusCode(_0x41550d,_0x3c7646){_0x3c7646=_0x3c7646||0xcc;return function(_0x3167a2){if(_0x3167a2){return _0x41550d[_0x58f1('0x19')](_0x3c7646);}return _0x41550d[_0x58f1('0x1a')](_0x3c7646)[_0x58f1('0x1b')]();};}function respondWithResult(_0x7862e4,_0x4063f6){_0x4063f6=_0x4063f6||0xc8;return function(_0x40a1c8){if(_0x40a1c8){return _0x7862e4[_0x58f1('0x1a')](_0x4063f6)[_0x58f1('0x1c')](_0x40a1c8);}};}function respondWithFilteredResult(_0x17fdeb,_0x469832){return function(_0x32087){if(_0x32087){var _0x10cefa=typeof _0x469832[_0x58f1('0x1d')]==='undefined'&&typeof _0x469832[_0x58f1('0x1e')]===_0x58f1('0x1f');var _0x17053a=_0x32087[_0x58f1('0x20')];var _0x3ffc23=_0x10cefa?0x0:_0x469832[_0x58f1('0x1d')];var _0x1b852d=_0x10cefa?_0x32087[_0x58f1('0x20')]:_0x469832['offset']+_0x469832[_0x58f1('0x1e')];var _0x17c5e8;if(_0x1b852d>=_0x17053a){_0x1b852d=_0x17053a;_0x17c5e8=0xc8;}else{_0x17c5e8=0xce;}_0x17fdeb[_0x58f1('0x1a')](_0x17c5e8);return _0x17fdeb[_0x58f1('0x21')](_0x58f1('0x22'),_0x3ffc23+'-'+_0x1b852d+'/'+_0x17053a)['json'](_0x32087);}return null;};}function patchUpdates(_0x38194f){return function(_0x5cd5bf){try{jsonpatch['apply'](_0x5cd5bf,_0x38194f,!![]);}catch(_0x46a522){return BPromise['reject'](_0x46a522);}return _0x5cd5bf[_0x58f1('0x23')]();};}function saveUpdates(_0x130891,_0x58c7fd){return function(_0x54b67c){if(_0x54b67c){return _0x54b67c[_0x58f1('0x24')](_0x130891)['then'](function(_0x1142a0){return _0x1142a0;});}return null;};}function removeEntity(_0x361f28,_0x53a6eb){return function(_0x1184e4){if(_0x1184e4){return _0x1184e4[_0x58f1('0x25')]()[_0x58f1('0x26')](function(){_0x361f28[_0x58f1('0x1a')](0xcc)[_0x58f1('0x1b')]();});}};}function handleEntityNotFound(_0x227a26,_0x5e7b81){return function(_0x5f0ceb){if(!_0x5f0ceb){_0x227a26[_0x58f1('0x19')](0x194);}return _0x5f0ceb;};}function handleError(_0x7674db,_0x4b2ca6){_0x4b2ca6=_0x4b2ca6||0x1f4;return function(_0x33da9e){logger[_0x58f1('0x27')](_0x33da9e[_0x58f1('0x28')]);if(_0x33da9e[_0x58f1('0x29')]){delete _0x33da9e[_0x58f1('0x29')];}_0x7674db[_0x58f1('0x1a')](_0x4b2ca6)[_0x58f1('0x2a')](_0x33da9e);};}exports[_0x58f1('0x2b')]=function(_0x1fbdbc,_0x2b66ff){var _0x565b2e={},_0x437bc9={},_0x4d7915={'count':0x0,'rows':[]};var _0x544e7e=_[_0x58f1('0x2c')](db[_0x58f1('0x2d')][_0x58f1('0x2e')],function(_0x18ef6e){return{'name':_0x18ef6e['fieldName'],'type':_0x18ef6e['type'][_0x58f1('0x2f')]};});_0x437bc9[_0x58f1('0x30')]=_[_0x58f1('0x2c')](_0x544e7e,'name');_0x437bc9['query']=_[_0x58f1('0x31')](_0x1fbdbc[_0x58f1('0x32')]);_0x437bc9['filters']=_[_0x58f1('0x33')](_0x437bc9[_0x58f1('0x30')],_0x437bc9['query']);_0x565b2e[_0x58f1('0x34')]=_[_0x58f1('0x33')](_0x437bc9[_0x58f1('0x30')],qs[_0x58f1('0x35')](_0x1fbdbc[_0x58f1('0x32')]['fields']));_0x565b2e['attributes']=_0x565b2e[_0x58f1('0x34')]['length']?_0x565b2e[_0x58f1('0x34')]:_0x437bc9[_0x58f1('0x30')];if(!_0x1fbdbc[_0x58f1('0x32')][_0x58f1('0x36')](_0x58f1('0x37'))){_0x565b2e[_0x58f1('0x1e')]=qs[_0x58f1('0x1e')](_0x1fbdbc[_0x58f1('0x32')][_0x58f1('0x1e')]);_0x565b2e[_0x58f1('0x1d')]=qs['offset'](_0x1fbdbc[_0x58f1('0x32')][_0x58f1('0x1d')]);}_0x565b2e['order']=qs[_0x58f1('0x38')](_0x1fbdbc[_0x58f1('0x32')][_0x58f1('0x38')]);_0x565b2e[_0x58f1('0x39')]=qs[_0x58f1('0x3a')](_['pick'](_0x1fbdbc[_0x58f1('0x32')],_0x437bc9[_0x58f1('0x3a')]),_0x544e7e);if(_0x1fbdbc['query'][_0x58f1('0x3b')]){_0x565b2e[_0x58f1('0x39')]=_['merge'](_0x565b2e[_0x58f1('0x39')],{'$or':_[_0x58f1('0x2c')](_0x544e7e,function(_0x5c4443){if(_0x5c4443[_0x58f1('0x3c')]!==_0x58f1('0x3d')){var _0x1b83bf={};_0x1b83bf[_0x5c4443[_0x58f1('0x29')]]={'$like':'%'+_0x1fbdbc[_0x58f1('0x32')][_0x58f1('0x3b')]+'%'};return _0x1b83bf;}})});}_0x565b2e=_[_0x58f1('0x3e')]({},_0x565b2e,_0x1fbdbc[_0x58f1('0x3f')]);var _0x2e20e6={'where':_0x565b2e[_0x58f1('0x39')]};return db[_0x58f1('0x2d')][_0x58f1('0x20')](_0x2e20e6)[_0x58f1('0x26')](function(_0x5edcbf){_0x4d7915[_0x58f1('0x20')]=_0x5edcbf;if(_0x1fbdbc['query']['includeAll']){_0x565b2e[_0x58f1('0x40')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x58f1('0x41')](_0x565b2e);})[_0x58f1('0x26')](function(_0x486776){_0x4d7915[_0x58f1('0x42')]=_0x486776;return _0x4d7915;})['then'](respondWithFilteredResult(_0x2b66ff,_0x565b2e))[_0x58f1('0x43')](handleError(_0x2b66ff,null));};exports[_0x58f1('0x44')]=function(_0x232668,_0x26242f){var _0x54d169={'raw':![],'where':{'id':_0x232668['params']['id']}},_0x5dea43={};_0x5dea43[_0x58f1('0x30')]=_['keys'](db['ZohoConfiguration'][_0x58f1('0x2e')]);_0x5dea43[_0x58f1('0x32')]=_[_0x58f1('0x31')](_0x232668['query']);_0x5dea43[_0x58f1('0x3a')]=_[_0x58f1('0x33')](_0x5dea43[_0x58f1('0x30')],_0x5dea43[_0x58f1('0x32')]);_0x54d169[_0x58f1('0x34')]=_[_0x58f1('0x33')](_0x5dea43[_0x58f1('0x30')],qs[_0x58f1('0x35')](_0x232668[_0x58f1('0x32')][_0x58f1('0x35')]));_0x54d169[_0x58f1('0x34')]=_0x54d169['attributes'][_0x58f1('0x45')]?_0x54d169[_0x58f1('0x34')]:_0x5dea43[_0x58f1('0x30')];if(_0x232668[_0x58f1('0x32')]['includeAll']){_0x54d169[_0x58f1('0x40')]=[{'all':!![]}];}_0x54d169=_[_0x58f1('0x3e')]({},_0x54d169,_0x232668['options']);return db[_0x58f1('0x2d')][_0x58f1('0x46')](_0x54d169)[_0x58f1('0x26')](handleEntityNotFound(_0x26242f,null))['then'](respondWithResult(_0x26242f,null))[_0x58f1('0x43')](handleError(_0x26242f,null));};exports[_0x58f1('0x47')]=function(_0x5ad1d1,_0x438e9a){return db[_0x58f1('0x2d')]['create'](_0x5ad1d1[_0x58f1('0x48')],{})['then'](respondWithResult(_0x438e9a,0xc9))[_0x58f1('0x43')](handleError(_0x438e9a,null));};exports[_0x58f1('0x24')]=function(_0x2123a1,_0x1382e0){if(_0x2123a1['body']['id']){delete _0x2123a1['body']['id'];}return db['ZohoConfiguration'][_0x58f1('0x46')]({'where':{'id':_0x2123a1['params']['id']}})['then'](handleEntityNotFound(_0x1382e0,null))[_0x58f1('0x26')](saveUpdates(_0x2123a1[_0x58f1('0x48')],null))[_0x58f1('0x26')](respondWithResult(_0x1382e0,null))['catch'](handleError(_0x1382e0,null));};exports['destroy']=function(_0x40b008,_0x7a5c67){return db[_0x58f1('0x2d')][_0x58f1('0x46')]({'where':{'id':_0x40b008['params']['id']}})['then'](handleEntityNotFound(_0x7a5c67,null))['then'](removeEntity(_0x7a5c67,null))[_0x58f1('0x43')](handleError(_0x7a5c67,null));};exports[_0x58f1('0x49')]=function(_0x3a99e6,_0x146a5a,_0xee58c1){var _0x3e89a5={};var _0xa9bd3c={};var _0x56042b;var _0xd19116;return db[_0x58f1('0x2d')]['findOne']({'where':{'id':_0x3a99e6[_0x58f1('0x4a')]['id']}})[_0x58f1('0x26')](handleEntityNotFound(_0x146a5a,null))[_0x58f1('0x26')](function(_0x518161){if(_0x518161){_0x56042b=_0x518161;_0xa9bd3c[_0x58f1('0x30')]=_[_0x58f1('0x31')](db[_0x58f1('0x4b')][_0x58f1('0x2e')]);_0xa9bd3c[_0x58f1('0x32')]=_['keys'](_0x3a99e6[_0x58f1('0x32')]);_0xa9bd3c[_0x58f1('0x3a')]=_[_0x58f1('0x33')](_0xa9bd3c[_0x58f1('0x30')],_0xa9bd3c[_0x58f1('0x32')]);_0x3e89a5[_0x58f1('0x34')]=_[_0x58f1('0x33')](_0xa9bd3c[_0x58f1('0x30')],qs[_0x58f1('0x35')](_0x3a99e6[_0x58f1('0x32')][_0x58f1('0x35')]));_0x3e89a5[_0x58f1('0x34')]=_0x3e89a5[_0x58f1('0x34')][_0x58f1('0x45')]?_0x3e89a5[_0x58f1('0x34')]:_0xa9bd3c[_0x58f1('0x30')];_0x3e89a5[_0x58f1('0x4c')]=qs[_0x58f1('0x38')](_0x3a99e6['query']['sort']);_0x3e89a5[_0x58f1('0x39')]=qs[_0x58f1('0x3a')](_[_0x58f1('0x4d')](_0x3a99e6[_0x58f1('0x32')],_0xa9bd3c[_0x58f1('0x3a')]));if(_0x3a99e6[_0x58f1('0x32')][_0x58f1('0x3b')]){_0x3e89a5[_0x58f1('0x39')]=_[_0x58f1('0x3e')](_0x3e89a5['where'],{'$or':_[_0x58f1('0x2c')](_0x3e89a5['attributes'],function(_0x53a5bc){var _0xb36a63={};_0xb36a63[_0x53a5bc]={'$like':'%'+_0x3a99e6[_0x58f1('0x32')]['filter']+'%'};return _0xb36a63;})});}_0x3e89a5=_[_0x58f1('0x3e')]({},_0x3e89a5,_0x3a99e6[_0x58f1('0x3f')]);return _0x56042b[_0x58f1('0x49')](_0x3e89a5);}})[_0x58f1('0x26')](function(_0xaf8695){if(_0xaf8695){_0xd19116=_0xaf8695[_0x58f1('0x45')];if(!_0x3a99e6[_0x58f1('0x32')][_0x58f1('0x36')](_0x58f1('0x37'))){_0x3e89a5[_0x58f1('0x1e')]=qs['limit'](_0x3a99e6[_0x58f1('0x32')]['limit']);_0x3e89a5[_0x58f1('0x1d')]=qs[_0x58f1('0x1d')](_0x3a99e6['query'][_0x58f1('0x1d')]);}return _0x56042b['getFields'](_0x3e89a5);}})[_0x58f1('0x26')](function(_0x18a1ec){if(_0x18a1ec){return _0x18a1ec?{'count':_0xd19116,'rows':_0x18a1ec}:null;}})['then'](respondWithResult(_0x146a5a,null))[_0x58f1('0x43')](handleError(_0x146a5a,null));};exports[_0x58f1('0x4e')]=function(_0x2a9f36,_0x138a1,_0x1c8b68){var _0x27c9f2={};var _0x53939a={};var _0x4959ce;var _0x4ff686;return db['ZohoConfiguration'][_0x58f1('0x4f')]({'where':{'id':_0x2a9f36[_0x58f1('0x4a')]['id']}})[_0x58f1('0x26')](handleEntityNotFound(_0x138a1,null))['then'](function(_0xaee060){if(_0xaee060){_0x4959ce=_0xaee060;_0x53939a[_0x58f1('0x30')]=_[_0x58f1('0x31')](db[_0x58f1('0x4b')]['rawAttributes']);_0x53939a[_0x58f1('0x32')]=_[_0x58f1('0x31')](_0x2a9f36[_0x58f1('0x32')]);_0x53939a[_0x58f1('0x3a')]=_[_0x58f1('0x33')](_0x53939a['model'],_0x53939a['query']);_0x27c9f2['attributes']=_[_0x58f1('0x33')](_0x53939a[_0x58f1('0x30')],qs[_0x58f1('0x35')](_0x2a9f36[_0x58f1('0x32')]['fields']));_0x27c9f2[_0x58f1('0x34')]=_0x27c9f2[_0x58f1('0x34')][_0x58f1('0x45')]?_0x27c9f2[_0x58f1('0x34')]:_0x53939a['model'];_0x27c9f2[_0x58f1('0x4c')]=qs[_0x58f1('0x38')](_0x2a9f36['query'][_0x58f1('0x38')]);_0x27c9f2[_0x58f1('0x39')]=qs[_0x58f1('0x3a')](_[_0x58f1('0x4d')](_0x2a9f36['query'],_0x53939a[_0x58f1('0x3a')]));if(_0x2a9f36['query']['filter']){_0x27c9f2[_0x58f1('0x39')]=_[_0x58f1('0x3e')](_0x27c9f2['where'],{'$or':_[_0x58f1('0x2c')](_0x27c9f2[_0x58f1('0x34')],function(_0x4215f4){var _0x302b3a={};_0x302b3a[_0x4215f4]={'$like':'%'+_0x2a9f36[_0x58f1('0x32')][_0x58f1('0x3b')]+'%'};return _0x302b3a;})});}_0x27c9f2=_[_0x58f1('0x3e')]({},_0x27c9f2,_0x2a9f36[_0x58f1('0x3f')]);return _0x4959ce['getSubjects'](_0x27c9f2);}})[_0x58f1('0x26')](function(_0x2afccf){if(_0x2afccf){_0x4ff686=_0x2afccf[_0x58f1('0x45')];if(!_0x2a9f36[_0x58f1('0x32')][_0x58f1('0x36')](_0x58f1('0x37'))){_0x27c9f2[_0x58f1('0x1e')]=qs[_0x58f1('0x1e')](_0x2a9f36[_0x58f1('0x32')][_0x58f1('0x1e')]);_0x27c9f2[_0x58f1('0x1d')]=qs[_0x58f1('0x1d')](_0x2a9f36[_0x58f1('0x32')][_0x58f1('0x1d')]);}return _0x4959ce['getSubjects'](_0x27c9f2);}})[_0x58f1('0x26')](function(_0x26548c){if(_0x26548c){return _0x26548c?{'count':_0x4ff686,'rows':_0x26548c}:null;}})['then'](respondWithResult(_0x138a1,null))[_0x58f1('0x43')](handleError(_0x138a1,null));};exports[_0x58f1('0x50')]=function(_0x2fc17b,_0x2f1c07,_0x30c162){var _0xfb6298={};var _0x3422cf={};var _0x5a64f8;var _0x3ec6ef;return db[_0x58f1('0x2d')]['findOne']({'where':{'id':_0x2fc17b['params']['id']}})[_0x58f1('0x26')](handleEntityNotFound(_0x2f1c07,null))[_0x58f1('0x26')](function(_0x1bb778){if(_0x1bb778){_0x5a64f8=_0x1bb778;_0x3422cf[_0x58f1('0x30')]=_['keys'](db[_0x58f1('0x4b')][_0x58f1('0x2e')]);_0x3422cf[_0x58f1('0x32')]=_[_0x58f1('0x31')](_0x2fc17b[_0x58f1('0x32')]);_0x3422cf['filters']=_['intersection'](_0x3422cf[_0x58f1('0x30')],_0x3422cf['query']);_0xfb6298['attributes']=_[_0x58f1('0x33')](_0x3422cf['model'],qs[_0x58f1('0x35')](_0x2fc17b[_0x58f1('0x32')][_0x58f1('0x35')]));_0xfb6298[_0x58f1('0x34')]=_0xfb6298[_0x58f1('0x34')][_0x58f1('0x45')]?_0xfb6298[_0x58f1('0x34')]:_0x3422cf[_0x58f1('0x30')];_0xfb6298['order']=qs[_0x58f1('0x38')](_0x2fc17b[_0x58f1('0x32')]['sort']);_0xfb6298[_0x58f1('0x39')]=qs[_0x58f1('0x3a')](_['pick'](_0x2fc17b[_0x58f1('0x32')],_0x3422cf[_0x58f1('0x3a')]));if(_0x2fc17b['query'][_0x58f1('0x3b')]){_0xfb6298[_0x58f1('0x39')]=_[_0x58f1('0x3e')](_0xfb6298[_0x58f1('0x39')],{'$or':_['map'](_0xfb6298['attributes'],function(_0x21cf67){var _0x4c06d7={};_0x4c06d7[_0x21cf67]={'$like':'%'+_0x2fc17b['query'][_0x58f1('0x3b')]+'%'};return _0x4c06d7;})});}_0xfb6298=_[_0x58f1('0x3e')]({},_0xfb6298,_0x2fc17b[_0x58f1('0x3f')]);return _0x5a64f8[_0x58f1('0x50')](_0xfb6298);}})[_0x58f1('0x26')](function(_0x1316a2){if(_0x1316a2){_0x3ec6ef=_0x1316a2[_0x58f1('0x45')];if(!_0x2fc17b[_0x58f1('0x32')][_0x58f1('0x36')](_0x58f1('0x37'))){_0xfb6298['limit']=qs[_0x58f1('0x1e')](_0x2fc17b[_0x58f1('0x32')][_0x58f1('0x1e')]);_0xfb6298['offset']=qs[_0x58f1('0x1d')](_0x2fc17b[_0x58f1('0x32')][_0x58f1('0x1d')]);}return _0x5a64f8[_0x58f1('0x50')](_0xfb6298);}})[_0x58f1('0x26')](function(_0x5e4c06){if(_0x5e4c06){return _0x5e4c06?{'count':_0x3ec6ef,'rows':_0x5e4c06}:null;}})[_0x58f1('0x26')](respondWithResult(_0x2f1c07,null))[_0x58f1('0x43')](handleError(_0x2f1c07,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c6c95b1..36ccd10 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 _0xf15d=['bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','util','moment'];(function(_0x13e239,_0x2b5884){var _0x17a730=function(_0x4c62bc){while(--_0x4c62bc){_0x13e239['push'](_0x13e239['shift']());}};_0x17a730(++_0x2b5884);}(_0xf15d,0x1ae));var _0xdf15=function(_0xc5daa2,_0x4fe5ac){_0xc5daa2=_0xc5daa2-0x0;var _0x21e811=_0xf15d[_0xc5daa2];return _0x21e811;};'use strict';var _=require('lodash');var util=require(_0xdf15('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xdf15('0x1'));var BPromise=require(_0xdf15('0x2'));var rp=require(_0xdf15('0x3'));var fs=require('fs');var path=require(_0xdf15('0x4'));var rimraf=require(_0xdf15('0x5'));var config=require(_0xdf15('0x6'));var attributes=require(_0xdf15('0x7'));module[_0xdf15('0x8')]=function(_0x8a6b95,_0x48a3df){return _0x8a6b95[_0xdf15('0x9')](_0xdf15('0xa'),attributes,{'tableName':_0xdf15('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae83=['int_zoho_configurations','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xae83,0xbe));var _0x3ae8=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xae83[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x3ae8('0x0'));var util=require(_0x3ae8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3ae8('0x2'));var BPromise=require(_0x3ae8('0x3'));var rp=require(_0x3ae8('0x4'));var fs=require('fs');var path=require(_0x3ae8('0x5'));var rimraf=require(_0x3ae8('0x6'));var config=require(_0x3ae8('0x7'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0xf33bbb,_0x50ed01){return _0xf33bbb['define']('ZohoConfiguration',attributes,{'tableName':_0x3ae8('0x8'),'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 52447ee..d61077c 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 _0xefef=['error','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','message'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xefef,0xdf));var _0xfefe=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0xefef[_0x5c6994];return _0x1d5c84;};'use strict';var _=require(_0xfefe('0x0'));var util=require('util');var moment=require(_0xfefe('0x1'));var BPromise=require(_0xfefe('0x2'));var rs=require(_0xfefe('0x3'));var fs=require('fs');var Redis=require(_0xfefe('0x4'));var db=require(_0xfefe('0x5'))['db'];var utils=require(_0xfefe('0x6'));var logger=require(_0xfefe('0x7'))('rpc');var config=require(_0xfefe('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfefe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18730b,_0x5e80b9,_0x338c93){return new BPromise(function(_0xfbf67e,_0xf1aa5b){return client[_0xfefe('0xa')](_0x18730b,_0x338c93)[_0xfefe('0xb')](function(_0x4472f1){logger['info'](_0xfefe('0xc'),_0x5e80b9,_0xfefe('0xd'));logger['debug'](_0xfefe('0xe'),_0x5e80b9,_0xfefe('0xd'),JSON[_0xfefe('0xf')](_0x4472f1));if(_0x4472f1['error']){if(_0x4472f1['error']['code']===0x1f4){logger['error'](_0xfefe('0xc'),_0x5e80b9,_0x4472f1['error'][_0xfefe('0x10')]);return _0xf1aa5b(_0x4472f1[_0xfefe('0x11')][_0xfefe('0x10')]);}logger[_0xfefe('0x11')](_0xfefe('0xc'),_0x5e80b9,_0x4472f1[_0xfefe('0x11')][_0xfefe('0x10')]);return _0xfbf67e(_0x4472f1[_0xfefe('0x11')][_0xfefe('0x10')]);}else{logger[_0xfefe('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x5e80b9,_0xfefe('0xd'));_0xfbf67e(_0x4472f1[_0xfefe('0x13')][_0xfefe('0x10')]);}})['catch'](function(_0x24353f){logger['error'](_0xfefe('0xc'),_0x5e80b9,_0x24353f);_0xf1aa5b(_0x24353f);});});} \ No newline at end of file +var _0xdf33=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x206adf,_0x2ba1a3){var _0x171caa=function(_0x43abe7){while(--_0x43abe7){_0x206adf['push'](_0x206adf['shift']());}};_0x171caa(++_0x2ba1a3);}(_0xdf33,0x149));var _0x3df3=function(_0x4847f0,_0x232a73){_0x4847f0=_0x4847f0-0x0;var _0x1df8e4=_0xdf33[_0x4847f0];return _0x1df8e4;};'use strict';var _=require(_0x3df3('0x0'));var util=require(_0x3df3('0x1'));var moment=require(_0x3df3('0x2'));var BPromise=require(_0x3df3('0x3'));var rs=require(_0x3df3('0x4'));var fs=require('fs');var Redis=require(_0x3df3('0x5'));var db=require(_0x3df3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3df3('0x7'))(_0x3df3('0x8'));var config=require(_0x3df3('0x9'));var jayson=require(_0x3df3('0xa'));var client=jayson[_0x3df3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50d5f9,_0x53e0f3,_0xea04ac){return new BPromise(function(_0x456f0a,_0x42efdd){return client[_0x3df3('0xc')](_0x50d5f9,_0xea04ac)[_0x3df3('0xd')](function(_0x6a002b){logger['info'](_0x3df3('0xe'),_0x53e0f3,'request\x20sent');logger[_0x3df3('0xf')](_0x3df3('0x10'),_0x53e0f3,_0x3df3('0x11'),JSON[_0x3df3('0x12')](_0x6a002b));if(_0x6a002b[_0x3df3('0x13')]){if(_0x6a002b[_0x3df3('0x13')][_0x3df3('0x14')]===0x1f4){logger['error'](_0x3df3('0xe'),_0x53e0f3,_0x6a002b[_0x3df3('0x13')]['message']);return _0x42efdd(_0x6a002b[_0x3df3('0x13')][_0x3df3('0x15')]);}logger[_0x3df3('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x53e0f3,_0x6a002b['error'][_0x3df3('0x15')]);return _0x456f0a(_0x6a002b[_0x3df3('0x13')][_0x3df3('0x15')]);}else{logger[_0x3df3('0x16')](_0x3df3('0xe'),_0x53e0f3,_0x3df3('0x11'));_0x456f0a(_0x6a002b[_0x3df3('0x17')]['message']);}})[_0x3df3('0x18')](function(_0x46393e){logger[_0x3df3('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x53e0f3,_0x46393e);_0x42efdd(_0x46393e);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index a09b992..ba49d99 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 _0x2340=['./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2f7ed6,_0x32d850){var _0x27fbf6=function(_0x4810fb){while(--_0x4810fb){_0x2f7ed6['push'](_0x2f7ed6['shift']());}};_0x27fbf6(++_0x32d850);}(_0x2340,0xf5));var _0x0234=function(_0x4e1abb,_0x290f95){_0x4e1abb=_0x4e1abb-0x0;var _0x1b26a7=_0x2340[_0x4e1abb];return _0x1b26a7;};'use strict';var multer=require('multer');var util=require(_0x0234('0x0'));var path=require(_0x0234('0x1'));var timeout=require('connect-timeout');var express=require(_0x0234('0x2'));var router=express[_0x0234('0x3')]();var fs_extra=require(_0x0234('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0234('0x5'));var config=require(_0x0234('0x6'));var controller=require(_0x0234('0x7'));router[_0x0234('0x8')]('/',auth[_0x0234('0x9')](),controller[_0x0234('0xa')]);router['get'](_0x0234('0xb'),auth['isAuthenticated'](),controller[_0x0234('0xc')]);router[_0x0234('0xd')]('/',auth[_0x0234('0x9')](),controller['create']);router[_0x0234('0xe')](_0x0234('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x0234('0xf')](_0x0234('0xb'),auth[_0x0234('0x9')](),controller[_0x0234('0x10')]);module[_0x0234('0x11')]=router; \ No newline at end of file +var _0xd658=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x54b548,_0x5b960c){var _0x18c91a=function(_0x4013eb){while(--_0x4013eb){_0x54b548['push'](_0x54b548['shift']());}};_0x18c91a(++_0x5b960c);}(_0xd658,0xb5));var _0x8d65=function(_0x1882f5,_0x3bfc06){_0x1882f5=_0x1882f5-0x0;var _0x3d1045=_0xd658[_0x1882f5];return _0x3d1045;};'use strict';var multer=require('multer');var util=require(_0x8d65('0x0'));var path=require(_0x8d65('0x1'));var timeout=require(_0x8d65('0x2'));var express=require(_0x8d65('0x3'));var router=express[_0x8d65('0x4')]();var fs_extra=require(_0x8d65('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8d65('0x6'));var config=require(_0x8d65('0x7'));var controller=require(_0x8d65('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8d65('0x9')]);router['get'](_0x8d65('0xa'),auth[_0x8d65('0xb')](),controller[_0x8d65('0xc')]);router[_0x8d65('0xd')]('/',auth['isAuthenticated'](),controller[_0x8d65('0xe')]);router[_0x8d65('0xf')](_0x8d65('0xa'),auth[_0x8d65('0xb')](),controller[_0x8d65('0x10')]);router[_0x8d65('0x11')](_0x8d65('0xa'),auth['isAuthenticated'](),controller[_0x8d65('0x12')]);module[_0x8d65('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 16d63dc..62a8e1c 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 _0x4f76=['customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f76,0x1aa));var _0x64f7=function(_0x31b31b,_0x5f044e){_0x31b31b=_0x31b31b-0x0;var _0x2c8fc2=_0x4f76[_0x31b31b];return _0x2c8fc2;};'use strict';var Sequelize=require(_0x64f7('0x0'));module[_0x64f7('0x1')]={'type':{'type':Sequelize['ENUM'](_0x64f7('0x2'),_0x64f7('0x3'),_0x64f7('0x4'),_0x64f7('0x5'),_0x64f7('0x6')),'defaultValue':_0x64f7('0x2')},'content':{'type':Sequelize[_0x64f7('0x7')]},'key':{'type':Sequelize[_0x64f7('0x7')]},'keyType':{'type':Sequelize[_0x64f7('0x8')](_0x64f7('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x64f7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x64f7('0x7')]}}; \ No newline at end of file +var _0x0da0=['keyValue','STRING','ENUM','sequelize','exports','string','variable','customVariable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0da0,0x1f3));var _0x00da=function(_0x52f2c8,_0x31b39c){_0x52f2c8=_0x52f2c8-0x0;var _0x2befe9=_0x0da0[_0x52f2c8];return _0x2befe9;};'use strict';var Sequelize=require(_0x00da('0x0'));module[_0x00da('0x1')]={'type':{'type':Sequelize['ENUM'](_0x00da('0x2'),_0x00da('0x3'),_0x00da('0x4'),_0x00da('0x5'),'picklist'),'defaultValue':_0x00da('0x2')},'content':{'type':Sequelize[_0x00da('0x6')]},'key':{'type':Sequelize[_0x00da('0x6')]},'keyType':{'type':Sequelize[_0x00da('0x7')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x00da('0x6')]},'idField':{'type':Sequelize[_0x00da('0x6')]},'nameField':{'type':Sequelize[_0x00da('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x00da('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 2bf449a..3344677 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 _0x2f3a=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','keys','model','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../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','ZohoField','rawAttributes','fieldName','type','key','query','filters'];(function(_0x252a30,_0x919e04){var _0x3aa79a=function(_0x25ce22){while(--_0x25ce22){_0x252a30['push'](_0x252a30['shift']());}};_0x3aa79a(++_0x919e04);}(_0x2f3a,0x195));var _0xa2f3=function(_0x23ce33,_0x388cfe){_0x23ce33=_0x23ce33-0x0;var _0x1f3c67=_0x2f3a[_0x23ce33];return _0x1f3c67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2f3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa2f3('0x1'));var rp=require(_0xa2f3('0x2'));var moment=require(_0xa2f3('0x3'));var BPromise=require(_0xa2f3('0x4'));var Mustache=require(_0xa2f3('0x5'));var util=require('util');var path=require(_0xa2f3('0x6'));var sox=require(_0xa2f3('0x7'));var csv=require(_0xa2f3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa2f3('0x9'));var _=require('lodash');var squel=require(_0xa2f3('0xa'));var crypto=require(_0xa2f3('0xb'));var jsforce=require(_0xa2f3('0xc'));var deskjs=require(_0xa2f3('0xd'));var toCsv=require(_0xa2f3('0x8'));var querystring=require(_0xa2f3('0xe'));var Papa=require(_0xa2f3('0xf'));var Redis=require('ioredis');var authService=require(_0xa2f3('0x10'));var qs=require(_0xa2f3('0x11'));var as=require(_0xa2f3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2f3('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa2f3('0x14'));var licenseUtil=require(_0xa2f3('0x15'));var db=require(_0xa2f3('0x16'))['db'];function respondWithStatusCode(_0x3a64f6,_0x5ccd84){_0x5ccd84=_0x5ccd84||0xcc;return function(_0x441119){if(_0x441119){return _0x3a64f6[_0xa2f3('0x17')](_0x5ccd84);}return _0x3a64f6[_0xa2f3('0x18')](_0x5ccd84)[_0xa2f3('0x19')]();};}function respondWithResult(_0x89bbe0,_0x50f79f){_0x50f79f=_0x50f79f||0xc8;return function(_0x323d86){if(_0x323d86){return _0x89bbe0[_0xa2f3('0x18')](_0x50f79f)[_0xa2f3('0x1a')](_0x323d86);}};}function respondWithFilteredResult(_0x5d6790,_0x68664a){return function(_0x37ad71){if(_0x37ad71){var _0x552991=typeof _0x68664a[_0xa2f3('0x1b')]===_0xa2f3('0x1c')&&typeof _0x68664a[_0xa2f3('0x1d')]===_0xa2f3('0x1c');var _0x126f01=_0x37ad71[_0xa2f3('0x1e')];var _0x13255b=_0x552991?0x0:_0x68664a[_0xa2f3('0x1b')];var _0x519f3b=_0x552991?_0x37ad71[_0xa2f3('0x1e')]:_0x68664a[_0xa2f3('0x1b')]+_0x68664a[_0xa2f3('0x1d')];var _0x1e5fb1;if(_0x519f3b>=_0x126f01){_0x519f3b=_0x126f01;_0x1e5fb1=0xc8;}else{_0x1e5fb1=0xce;}_0x5d6790[_0xa2f3('0x18')](_0x1e5fb1);return _0x5d6790[_0xa2f3('0x1f')](_0xa2f3('0x20'),_0x13255b+'-'+_0x519f3b+'/'+_0x126f01)[_0xa2f3('0x1a')](_0x37ad71);}return null;};}function patchUpdates(_0x2194d1){return function(_0x2f0842){try{jsonpatch[_0xa2f3('0x21')](_0x2f0842,_0x2194d1,!![]);}catch(_0x1d2c84){return BPromise[_0xa2f3('0x22')](_0x1d2c84);}return _0x2f0842[_0xa2f3('0x23')]();};}function saveUpdates(_0x2c2444,_0x4f7285){return function(_0x1faca5){if(_0x1faca5){return _0x1faca5[_0xa2f3('0x24')](_0x2c2444)['then'](function(_0x3a9057){return _0x3a9057;});}return null;};}function removeEntity(_0x218326,_0x964bc5){return function(_0x5b0e36){if(_0x5b0e36){return _0x5b0e36[_0xa2f3('0x25')]()[_0xa2f3('0x26')](function(){_0x218326['status'](0xcc)[_0xa2f3('0x19')]();});}};}function handleEntityNotFound(_0x584135,_0x310456){return function(_0x4371ac){if(!_0x4371ac){_0x584135[_0xa2f3('0x17')](0x194);}return _0x4371ac;};}function handleError(_0x18bace,_0x13c950){_0x13c950=_0x13c950||0x1f4;return function(_0x116825){logger[_0xa2f3('0x27')](_0x116825['stack']);if(_0x116825[_0xa2f3('0x28')]){delete _0x116825['name'];}_0x18bace[_0xa2f3('0x18')](_0x13c950)[_0xa2f3('0x29')](_0x116825);};}exports[_0xa2f3('0x2a')]=function(_0x6b9f68,_0x1e2185){var _0xd8789d={},_0x5a07f5={},_0x198d30={'count':0x0,'rows':[]};var _0x1b4f38=_[_0xa2f3('0x2b')](db[_0xa2f3('0x2c')][_0xa2f3('0x2d')],function(_0x361f8d){return{'name':_0x361f8d[_0xa2f3('0x2e')],'type':_0x361f8d[_0xa2f3('0x2f')][_0xa2f3('0x30')]};});_0x5a07f5['model']=_[_0xa2f3('0x2b')](_0x1b4f38,_0xa2f3('0x28'));_0x5a07f5[_0xa2f3('0x31')]=_['keys'](_0x6b9f68[_0xa2f3('0x31')]);_0x5a07f5[_0xa2f3('0x32')]=_[_0xa2f3('0x33')](_0x5a07f5['model'],_0x5a07f5[_0xa2f3('0x31')]);_0xd8789d[_0xa2f3('0x34')]=_[_0xa2f3('0x33')](_0x5a07f5['model'],qs[_0xa2f3('0x35')](_0x6b9f68['query']['fields']));_0xd8789d[_0xa2f3('0x34')]=_0xd8789d[_0xa2f3('0x34')][_0xa2f3('0x36')]?_0xd8789d[_0xa2f3('0x34')]:_0x5a07f5['model'];if(!_0x6b9f68[_0xa2f3('0x31')][_0xa2f3('0x37')](_0xa2f3('0x38'))){_0xd8789d[_0xa2f3('0x1d')]=qs[_0xa2f3('0x1d')](_0x6b9f68[_0xa2f3('0x31')][_0xa2f3('0x1d')]);_0xd8789d[_0xa2f3('0x1b')]=qs['offset'](_0x6b9f68[_0xa2f3('0x31')][_0xa2f3('0x1b')]);}_0xd8789d[_0xa2f3('0x39')]=qs['sort'](_0x6b9f68['query'][_0xa2f3('0x3a')]);_0xd8789d[_0xa2f3('0x3b')]=qs['filters'](_[_0xa2f3('0x3c')](_0x6b9f68['query'],_0x5a07f5[_0xa2f3('0x32')]),_0x1b4f38);if(_0x6b9f68['query']['filter']){_0xd8789d[_0xa2f3('0x3b')]=_[_0xa2f3('0x3d')](_0xd8789d['where'],{'$or':_[_0xa2f3('0x2b')](_0x1b4f38,function(_0x51e710){if(_0x51e710[_0xa2f3('0x2f')]!==_0xa2f3('0x3e')){var _0x26a823={};_0x26a823[_0x51e710[_0xa2f3('0x28')]]={'$like':'%'+_0x6b9f68[_0xa2f3('0x31')][_0xa2f3('0x3f')]+'%'};return _0x26a823;}})});}_0xd8789d=_[_0xa2f3('0x3d')]({},_0xd8789d,_0x6b9f68[_0xa2f3('0x40')]);var _0x12bde9={'where':_0xd8789d[_0xa2f3('0x3b')]};return db[_0xa2f3('0x2c')]['count'](_0x12bde9)[_0xa2f3('0x26')](function(_0x2984ac){_0x198d30[_0xa2f3('0x1e')]=_0x2984ac;if(_0x6b9f68[_0xa2f3('0x31')][_0xa2f3('0x41')]){_0xd8789d[_0xa2f3('0x42')]=[{'all':!![]}];}return db[_0xa2f3('0x2c')][_0xa2f3('0x43')](_0xd8789d);})[_0xa2f3('0x26')](function(_0x246bc0){_0x198d30[_0xa2f3('0x44')]=_0x246bc0;return _0x198d30;})[_0xa2f3('0x26')](respondWithFilteredResult(_0x1e2185,_0xd8789d))[_0xa2f3('0x45')](handleError(_0x1e2185,null));};exports['show']=function(_0x12c715,_0xc823eb){var _0x2f7e3b={'raw':!![],'where':{'id':_0x12c715[_0xa2f3('0x46')]['id']}},_0x3d9f7d={};_0x3d9f7d['model']=_[_0xa2f3('0x47')](db[_0xa2f3('0x2c')][_0xa2f3('0x2d')]);_0x3d9f7d[_0xa2f3('0x31')]=_[_0xa2f3('0x47')](_0x12c715[_0xa2f3('0x31')]);_0x3d9f7d[_0xa2f3('0x32')]=_[_0xa2f3('0x33')](_0x3d9f7d['model'],_0x3d9f7d[_0xa2f3('0x31')]);_0x2f7e3b[_0xa2f3('0x34')]=_['intersection'](_0x3d9f7d[_0xa2f3('0x48')],qs[_0xa2f3('0x35')](_0x12c715[_0xa2f3('0x31')]['fields']));_0x2f7e3b[_0xa2f3('0x34')]=_0x2f7e3b[_0xa2f3('0x34')]['length']?_0x2f7e3b[_0xa2f3('0x34')]:_0x3d9f7d['model'];if(_0x12c715[_0xa2f3('0x31')][_0xa2f3('0x41')]){_0x2f7e3b['include']=[{'all':!![]}];}_0x2f7e3b=_['merge']({},_0x2f7e3b,_0x12c715[_0xa2f3('0x40')]);return db[_0xa2f3('0x2c')][_0xa2f3('0x49')](_0x2f7e3b)['then'](handleEntityNotFound(_0xc823eb,null))['then'](respondWithResult(_0xc823eb,null))['catch'](handleError(_0xc823eb,null));};exports[_0xa2f3('0x4a')]=function(_0x47dad0,_0x5bd376){return db[_0xa2f3('0x2c')][_0xa2f3('0x4a')](_0x47dad0['body'],{})[_0xa2f3('0x26')](respondWithResult(_0x5bd376,0xc9))['catch'](handleError(_0x5bd376,null));};exports[_0xa2f3('0x24')]=function(_0x195767,_0x466d9f){if(_0x195767['body']['id']){delete _0x195767['body']['id'];}return db[_0xa2f3('0x2c')][_0xa2f3('0x49')]({'where':{'id':_0x195767[_0xa2f3('0x46')]['id']}})[_0xa2f3('0x26')](handleEntityNotFound(_0x466d9f,null))[_0xa2f3('0x26')](saveUpdates(_0x195767[_0xa2f3('0x4b')],null))[_0xa2f3('0x26')](respondWithResult(_0x466d9f,null))[_0xa2f3('0x45')](handleError(_0x466d9f,null));};exports[_0xa2f3('0x25')]=function(_0x460104,_0x4d638b){return db[_0xa2f3('0x2c')][_0xa2f3('0x49')]({'where':{'id':_0x460104[_0xa2f3('0x46')]['id']}})[_0xa2f3('0x26')](handleEntityNotFound(_0x4d638b,null))[_0xa2f3('0x26')](removeEntity(_0x4d638b,null))['catch'](handleError(_0x4d638b,null));}; \ No newline at end of file +var _0x7db2=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','status','error','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','type','VIRTUAL','options','ZohoField','includeAll','rows','catch','show','params','include','find','create','body'];(function(_0x44a0c8,_0x19acfa){var _0x4950bd=function(_0x50e5db){while(--_0x50e5db){_0x44a0c8['push'](_0x44a0c8['shift']());}};_0x4950bd(++_0x19acfa);}(_0x7db2,0x118));var _0x27db=function(_0x578804,_0xcb2ba2){_0x578804=_0x578804-0x0;var _0x4fa25a=_0x7db2[_0x578804];return _0x4fa25a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27db('0x0'));var zipdir=require(_0x27db('0x1'));var jsonpatch=require(_0x27db('0x2'));var rp=require(_0x27db('0x3'));var moment=require(_0x27db('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x27db('0x5'));var util=require('util');var path=require('path');var sox=require(_0x27db('0x6'));var csv=require(_0x27db('0x7'));var ejs=require(_0x27db('0x8'));var fs=require('fs');var fs_extra=require(_0x27db('0x9'));var _=require(_0x27db('0xa'));var squel=require(_0x27db('0xb'));var crypto=require(_0x27db('0xc'));var jsforce=require(_0x27db('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x27db('0x7'));var querystring=require(_0x27db('0xe'));var Papa=require('papaparse');var Redis=require(_0x27db('0xf'));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(_0x27db('0x10'))(_0x27db('0x11'));var utils=require('../../config/utils');var config=require(_0x27db('0x12'));var licenseUtil=require(_0x27db('0x13'));var db=require(_0x27db('0x14'))['db'];function respondWithStatusCode(_0x54c994,_0x8960a4){_0x8960a4=_0x8960a4||0xcc;return function(_0x360bdf){if(_0x360bdf){return _0x54c994[_0x27db('0x15')](_0x8960a4);}return _0x54c994['status'](_0x8960a4)[_0x27db('0x16')]();};}function respondWithResult(_0x5bbbe7,_0x322741){_0x322741=_0x322741||0xc8;return function(_0x2138d6){if(_0x2138d6){return _0x5bbbe7['status'](_0x322741)[_0x27db('0x17')](_0x2138d6);}};}function respondWithFilteredResult(_0xba324c,_0x454de0){return function(_0x3a0dae){if(_0x3a0dae){var _0x4a618a=typeof _0x454de0['offset']===_0x27db('0x18')&&typeof _0x454de0[_0x27db('0x19')]===_0x27db('0x18');var _0x3799f0=_0x3a0dae[_0x27db('0x1a')];var _0xaab0c5=_0x4a618a?0x0:_0x454de0[_0x27db('0x1b')];var _0x43c1c3=_0x4a618a?_0x3a0dae['count']:_0x454de0[_0x27db('0x1b')]+_0x454de0[_0x27db('0x19')];var _0x2af63a;if(_0x43c1c3>=_0x3799f0){_0x43c1c3=_0x3799f0;_0x2af63a=0xc8;}else{_0x2af63a=0xce;}_0xba324c['status'](_0x2af63a);return _0xba324c[_0x27db('0x1c')]('Content-Range',_0xaab0c5+'-'+_0x43c1c3+'/'+_0x3799f0)[_0x27db('0x17')](_0x3a0dae);}return null;};}function patchUpdates(_0x12f8f3){return function(_0x2e4262){try{jsonpatch[_0x27db('0x1d')](_0x2e4262,_0x12f8f3,!![]);}catch(_0x52b69e){return BPromise[_0x27db('0x1e')](_0x52b69e);}return _0x2e4262[_0x27db('0x1f')]();};}function saveUpdates(_0x153f3c,_0x4f2945){return function(_0x4970ba){if(_0x4970ba){return _0x4970ba[_0x27db('0x20')](_0x153f3c)[_0x27db('0x21')](function(_0x500ee2){return _0x500ee2;});}return null;};}function removeEntity(_0x38ad92,_0x5c2ec2){return function(_0xefea9){if(_0xefea9){return _0xefea9[_0x27db('0x22')]()[_0x27db('0x21')](function(){_0x38ad92[_0x27db('0x23')](0xcc)[_0x27db('0x16')]();});}};}function handleEntityNotFound(_0xa3cc24,_0x50b0de){return function(_0x24de62){if(!_0x24de62){_0xa3cc24[_0x27db('0x15')](0x194);}return _0x24de62;};}function handleError(_0x5cd9a4,_0x4e5bf8){_0x4e5bf8=_0x4e5bf8||0x1f4;return function(_0x59695e){logger[_0x27db('0x24')](_0x59695e['stack']);if(_0x59695e['name']){delete _0x59695e[_0x27db('0x25')];}_0x5cd9a4[_0x27db('0x23')](_0x4e5bf8)['send'](_0x59695e);};}exports[_0x27db('0x26')]=function(_0x56eafb,_0xb89ee7){var _0x5d9c1c={},_0x54db02={},_0x27c679={'count':0x0,'rows':[]};var _0x51c0d2=_['map'](db['ZohoField'][_0x27db('0x27')],function(_0x4eba7d){return{'name':_0x4eba7d[_0x27db('0x28')],'type':_0x4eba7d['type'][_0x27db('0x29')]};});_0x54db02[_0x27db('0x2a')]=_[_0x27db('0x2b')](_0x51c0d2,_0x27db('0x25'));_0x54db02[_0x27db('0x2c')]=_[_0x27db('0x2d')](_0x56eafb['query']);_0x54db02[_0x27db('0x2e')]=_['intersection'](_0x54db02[_0x27db('0x2a')],_0x54db02[_0x27db('0x2c')]);_0x5d9c1c[_0x27db('0x2f')]=_[_0x27db('0x30')](_0x54db02['model'],qs[_0x27db('0x31')](_0x56eafb['query'][_0x27db('0x31')]));_0x5d9c1c[_0x27db('0x2f')]=_0x5d9c1c['attributes'][_0x27db('0x32')]?_0x5d9c1c[_0x27db('0x2f')]:_0x54db02[_0x27db('0x2a')];if(!_0x56eafb[_0x27db('0x2c')][_0x27db('0x33')](_0x27db('0x34'))){_0x5d9c1c[_0x27db('0x19')]=qs[_0x27db('0x19')](_0x56eafb[_0x27db('0x2c')][_0x27db('0x19')]);_0x5d9c1c['offset']=qs[_0x27db('0x1b')](_0x56eafb[_0x27db('0x2c')][_0x27db('0x1b')]);}_0x5d9c1c[_0x27db('0x35')]=qs['sort'](_0x56eafb[_0x27db('0x2c')]['sort']);_0x5d9c1c[_0x27db('0x36')]=qs['filters'](_['pick'](_0x56eafb[_0x27db('0x2c')],_0x54db02[_0x27db('0x2e')]),_0x51c0d2);if(_0x56eafb[_0x27db('0x2c')][_0x27db('0x37')]){_0x5d9c1c[_0x27db('0x36')]=_[_0x27db('0x38')](_0x5d9c1c[_0x27db('0x36')],{'$or':_[_0x27db('0x2b')](_0x51c0d2,function(_0x57016c){if(_0x57016c[_0x27db('0x39')]!==_0x27db('0x3a')){var _0x1627b0={};_0x1627b0[_0x57016c[_0x27db('0x25')]]={'$like':'%'+_0x56eafb[_0x27db('0x2c')][_0x27db('0x37')]+'%'};return _0x1627b0;}})});}_0x5d9c1c=_[_0x27db('0x38')]({},_0x5d9c1c,_0x56eafb[_0x27db('0x3b')]);var _0x4e063a={'where':_0x5d9c1c[_0x27db('0x36')]};return db[_0x27db('0x3c')][_0x27db('0x1a')](_0x4e063a)['then'](function(_0x595dd5){_0x27c679[_0x27db('0x1a')]=_0x595dd5;if(_0x56eafb[_0x27db('0x2c')][_0x27db('0x3d')]){_0x5d9c1c['include']=[{'all':!![]}];}return db[_0x27db('0x3c')]['findAll'](_0x5d9c1c);})['then'](function(_0x4fe5fe){_0x27c679[_0x27db('0x3e')]=_0x4fe5fe;return _0x27c679;})['then'](respondWithFilteredResult(_0xb89ee7,_0x5d9c1c))[_0x27db('0x3f')](handleError(_0xb89ee7,null));};exports[_0x27db('0x40')]=function(_0x5a570d,_0x3b16e6){var _0x4f6747={'raw':!![],'where':{'id':_0x5a570d[_0x27db('0x41')]['id']}},_0x2db0a9={};_0x2db0a9[_0x27db('0x2a')]=_['keys'](db[_0x27db('0x3c')][_0x27db('0x27')]);_0x2db0a9['query']=_['keys'](_0x5a570d[_0x27db('0x2c')]);_0x2db0a9[_0x27db('0x2e')]=_[_0x27db('0x30')](_0x2db0a9['model'],_0x2db0a9['query']);_0x4f6747[_0x27db('0x2f')]=_['intersection'](_0x2db0a9[_0x27db('0x2a')],qs[_0x27db('0x31')](_0x5a570d[_0x27db('0x2c')][_0x27db('0x31')]));_0x4f6747[_0x27db('0x2f')]=_0x4f6747[_0x27db('0x2f')][_0x27db('0x32')]?_0x4f6747[_0x27db('0x2f')]:_0x2db0a9['model'];if(_0x5a570d[_0x27db('0x2c')]['includeAll']){_0x4f6747[_0x27db('0x42')]=[{'all':!![]}];}_0x4f6747=_['merge']({},_0x4f6747,_0x5a570d[_0x27db('0x3b')]);return db[_0x27db('0x3c')][_0x27db('0x43')](_0x4f6747)['then'](handleEntityNotFound(_0x3b16e6,null))[_0x27db('0x21')](respondWithResult(_0x3b16e6,null))['catch'](handleError(_0x3b16e6,null));};exports[_0x27db('0x44')]=function(_0x6fc940,_0x56da71){return db[_0x27db('0x3c')][_0x27db('0x44')](_0x6fc940['body'],{})[_0x27db('0x21')](respondWithResult(_0x56da71,0xc9))[_0x27db('0x3f')](handleError(_0x56da71,null));};exports[_0x27db('0x20')]=function(_0x12dec5,_0x32b253){if(_0x12dec5[_0x27db('0x45')]['id']){delete _0x12dec5[_0x27db('0x45')]['id'];}return db[_0x27db('0x3c')][_0x27db('0x43')]({'where':{'id':_0x12dec5[_0x27db('0x41')]['id']}})[_0x27db('0x21')](handleEntityNotFound(_0x32b253,null))[_0x27db('0x21')](saveUpdates(_0x12dec5['body'],null))[_0x27db('0x21')](respondWithResult(_0x32b253,null))[_0x27db('0x3f')](handleError(_0x32b253,null));};exports['destroy']=function(_0x4c8e9a,_0x5446cc){return db[_0x27db('0x3c')][_0x27db('0x43')]({'where':{'id':_0x4c8e9a[_0x27db('0x41')]['id']}})[_0x27db('0x21')](handleEntityNotFound(_0x5446cc,null))[_0x27db('0x21')](removeEntity(_0x5446cc,null))[_0x27db('0x3f')](handleError(_0x5446cc,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 952485a..c0e1fad 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 _0x896e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash','util','../../config/logger','api'];(function(_0x205b46,_0x3ca65b){var _0x2b6ae8=function(_0x1f4ae9){while(--_0x1f4ae9){_0x205b46['push'](_0x205b46['shift']());}};_0x2b6ae8(++_0x3ca65b);}(_0x896e,0x1e9));var _0xe896=function(_0x8fcbd5,_0x26d50c){_0x8fcbd5=_0x8fcbd5-0x0;var _0xe8bd33=_0x896e[_0x8fcbd5];return _0xe8bd33;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var logger=require(_0xe896('0x2'))(_0xe896('0x3'));var moment=require(_0xe896('0x4'));var BPromise=require(_0xe896('0x5'));var rp=require(_0xe896('0x6'));var fs=require('fs');var path=require(_0xe896('0x7'));var rimraf=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var attributes=require(_0xe896('0xa'));module[_0xe896('0xb')]=function(_0x52ac80,_0x24c430){return _0x52ac80[_0xe896('0xc')](_0xe896('0xd'),attributes,{'tableName':_0xe896('0xe'),'paranoid':![],'indexes':[{'name':_0xe896('0xf'),'fields':['idField',_0xe896('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf61e=['idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','zoho_unique_index'];(function(_0xa76664,_0x5e32db){var _0x3f7743=function(_0x477dee){while(--_0x477dee){_0xa76664['push'](_0xa76664['shift']());}};_0x3f7743(++_0x5e32db);}(_0xf61e,0x191));var _0xef61=function(_0x3eb842,_0x49fc89){_0x3eb842=_0x3eb842-0x0;var _0x40852d=_0xf61e[_0x3eb842];return _0x40852d;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var logger=require(_0xef61('0x2'))(_0xef61('0x3'));var moment=require(_0xef61('0x4'));var BPromise=require(_0xef61('0x5'));var rp=require(_0xef61('0x6'));var fs=require('fs');var path=require(_0xef61('0x7'));var rimraf=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var attributes=require(_0xef61('0xa'));module[_0xef61('0xb')]=function(_0x5b00b2,_0x9e17f4){return _0x5b00b2[_0xef61('0xc')]('ZohoField',attributes,{'tableName':_0xef61('0xd'),'paranoid':![],'indexes':[{'name':_0xef61('0xe'),'fields':[_0xef61('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 95eaf6f..926cc26 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 _0x2010=['request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','ZohoField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x2010,0xce));var _0x0201=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2010[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0201('0x0'));var util=require(_0x0201('0x1'));var moment=require(_0x0201('0x2'));var BPromise=require(_0x0201('0x3'));var rs=require(_0x0201('0x4'));var fs=require('fs');var Redis=require(_0x0201('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0201('0x6'));var logger=require(_0x0201('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0201('0x8'));var client=jayson[_0x0201('0x9')][_0x0201('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265931,_0x29fc99,_0x8be28f){return new BPromise(function(_0x3d6467,_0x3652c1){return client[_0x0201('0xb')](_0x265931,_0x8be28f)[_0x0201('0xc')](function(_0x5c022c){logger[_0x0201('0xd')]('ZohoField,\x20%s,\x20%s',_0x29fc99,_0x0201('0xe'));logger[_0x0201('0xf')](_0x0201('0x10'),_0x29fc99,_0x0201('0xe'),JSON['stringify'](_0x5c022c));if(_0x5c022c[_0x0201('0x11')]){if(_0x5c022c[_0x0201('0x11')][_0x0201('0x12')]===0x1f4){logger[_0x0201('0x11')](_0x0201('0x13'),_0x29fc99,_0x5c022c[_0x0201('0x11')][_0x0201('0x14')]);return _0x3652c1(_0x5c022c[_0x0201('0x11')][_0x0201('0x14')]);}logger[_0x0201('0x11')](_0x0201('0x13'),_0x29fc99,_0x5c022c['error'][_0x0201('0x14')]);return _0x3d6467(_0x5c022c[_0x0201('0x11')][_0x0201('0x14')]);}else{logger[_0x0201('0xd')]('ZohoField,\x20%s,\x20%s',_0x29fc99,_0x0201('0xe'));_0x3d6467(_0x5c022c[_0x0201('0x15')]['message']);}})['catch'](function(_0x30050d){logger[_0x0201('0x11')](_0x0201('0x13'),_0x29fc99,_0x30050d);_0x3652c1(_0x30050d);});});} \ No newline at end of file +var _0x4087=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x4087,0x12b));var _0x7408=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4087[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x7408('0x0'));var moment=require(_0x7408('0x1'));var BPromise=require(_0x7408('0x2'));var rs=require(_0x7408('0x3'));var fs=require('fs');var Redis=require(_0x7408('0x4'));var db=require(_0x7408('0x5'))['db'];var utils=require(_0x7408('0x6'));var logger=require(_0x7408('0x7'))('rpc');var config=require(_0x7408('0x8'));var jayson=require(_0x7408('0x9'));var client=jayson[_0x7408('0xa')][_0x7408('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31785e,_0x1bcb55,_0x5704da){return new BPromise(function(_0x49695d,_0x47bccd){return client['request'](_0x31785e,_0x5704da)[_0x7408('0xc')](function(_0x173441){logger[_0x7408('0xd')]('ZohoField,\x20%s,\x20%s',_0x1bcb55,_0x7408('0xe'));logger[_0x7408('0xf')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x1bcb55,_0x7408('0xe'),JSON[_0x7408('0x10')](_0x173441));if(_0x173441[_0x7408('0x11')]){if(_0x173441[_0x7408('0x11')][_0x7408('0x12')]===0x1f4){logger['error'](_0x7408('0x13'),_0x1bcb55,_0x173441[_0x7408('0x11')][_0x7408('0x14')]);return _0x47bccd(_0x173441[_0x7408('0x11')][_0x7408('0x14')]);}logger[_0x7408('0x11')]('ZohoField,\x20%s,\x20%s',_0x1bcb55,_0x173441[_0x7408('0x11')][_0x7408('0x14')]);return _0x49695d(_0x173441[_0x7408('0x11')][_0x7408('0x14')]);}else{logger[_0x7408('0xd')](_0x7408('0x13'),_0x1bcb55,'request\x20sent');_0x49695d(_0x173441[_0x7408('0x15')][_0x7408('0x14')]);}})[_0x7408('0x16')](function(_0x53ba5c){logger[_0x7408('0x11')](_0x7408('0x13'),_0x1bcb55,_0x53ba5c);_0x47bccd(_0x53ba5c);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 87e68ec..c17f61c 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(_0x540136,_0x2ee616){var _0x7b8ef2=function(_0x5c415b){while(--_0x5c415b){_0x540136['push'](_0x540136['shift']());}};_0x7b8ef2(++_0x2ee616);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0xcb91[_0x48ec91];return _0x22766c;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x56149d,_0x234305){var _0x553c5b=function(_0x4dc50b){while(--_0x4dc50b){_0x56149d['push'](_0x56149d['shift']());}};_0x553c5b(++_0x234305);}(_0xe706,0xa3));var _0x6e70=function(_0x161ec6,_0x580285){_0x161ec6=_0x161ec6-0x0;var _0x477176=_0xe706[_0x161ec6];return _0x477176;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index e763733..d156a3c 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 _0x2ad5=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','exports'];(function(_0x57e00e,_0x36e79a){var _0x415e60=function(_0x5cd7fa){while(--_0x5cd7fa){_0x57e00e['push'](_0x57e00e['shift']());}};_0x415e60(++_0x36e79a);}(_0x2ad5,0x8b));var _0x52ad=function(_0x443410,_0x16dfbc){_0x443410=_0x443410-0x0;var _0xd3d76d=_0x2ad5[_0x443410];return _0xd3d76d;};'use strict';var Sequelize=require('sequelize');module[_0x52ad('0x0')]={'name':{'type':Sequelize[_0x52ad('0x1')],'allowNull':![],'unique':_0x52ad('0x2')},'version':{'type':Sequelize[_0x52ad('0x1')],'allowNull':![],'unique':_0x52ad('0x2')},'main':{'type':Sequelize[_0x52ad('0x1')],'defaultValue':_0x52ad('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x52ad('0x1')]},'type':{'type':Sequelize[_0x52ad('0x1')]},'size':{'type':Sequelize[_0x52ad('0x4')]},'active':{'type':Sequelize[_0x52ad('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x52ad('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x52ad('0x1')],'unique':_0x52ad('0x6')},'description':{'type':Sequelize[_0x52ad('0x1')]},'title':{'type':Sequelize[_0x52ad('0x1')]},'remoteUri':{'type':Sequelize[_0x52ad('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x44fd=['app.js','INTEGER','exports','STRING','unique_name_and_version'];(function(_0x408235,_0xd4ce29){var _0x47dd7d=function(_0xbcdad){while(--_0xbcdad){_0x408235['push'](_0x408235['shift']());}};_0x47dd7d(++_0xd4ce29);}(_0x44fd,0x106));var _0xd44f=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0x44fd[_0x4702ee];return _0x62ca7d;};'use strict';var Sequelize=require('sequelize');module[_0xd44f('0x0')]={'name':{'type':Sequelize[_0xd44f('0x1')],'allowNull':![],'unique':_0xd44f('0x2')},'version':{'type':Sequelize[_0xd44f('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xd44f('0x1')],'defaultValue':_0xd44f('0x3')},'filename':{'type':Sequelize[_0xd44f('0x1')]},'path':{'type':Sequelize[_0xd44f('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xd44f('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xd44f('0x1')]},'logo':{'type':Sequelize[_0xd44f('0x1')]},'state':{'type':Sequelize[_0xd44f('0x1')],'unique':'state'},'description':{'type':Sequelize[_0xd44f('0x1')]},'title':{'type':Sequelize[_0xd44f('0x1')]},'remoteUri':{'type':Sequelize[_0xd44f('0x1')]},'link':{'type':Sequelize[_0xd44f('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 65de995..6d76974 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 _0x430c=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x434543,_0x2fd498){var _0x3e6749=function(_0x5956f7){while(--_0x5956f7){_0x434543['push'](_0x434543['shift']());}};_0x3e6749(++_0x2fd498);}(_0x430c,0x1a1));var _0xc430=function(_0x26721d,_0x448ba5){_0x26721d=_0x26721d-0x0;var _0x1035c5=_0x430c[_0x26721d];return _0x1035c5;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));}; \ No newline at end of file +var _0x6d38=['sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','filters','intersection','create','catch','body','find','params','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','Integration','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order'];(function(_0x21440c,_0x306995){var _0x3ba1f0=function(_0x108d0a){while(--_0x108d0a){_0x21440c['push'](_0x21440c['shift']());}};_0x3ba1f0(++_0x306995);}(_0x6d38,0x1ef));var _0x86d3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x6d38[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['Integration'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')](_0x412d0e['body'],{})[_0x86d3('0x20')](respondWithResult(_0xd20863,0xc9))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x14fa58,_0x369b75){if(_0x14fa58[_0x86d3('0x41')]['id']){delete _0x14fa58[_0x86d3('0x41')]['id'];}return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x14fa58[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x369b75,null))[_0x86d3('0x20')](saveUpdates(_0x14fa58['body'],null))[_0x86d3('0x20')](respondWithResult(_0x369b75,null))[_0x86d3('0x40')](handleError(_0x369b75,null));};exports['destroy']=function(_0x43290d,_0x23a6ee){return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x43290d[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x23a6ee,null))['then'](removeEntity(_0x23a6ee,null))['catch'](handleError(_0x23a6ee,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 59a3127..722105e 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 _0xf39f=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./integration.attributes','exports','define','Integration','integrations'];(function(_0x458c52,_0x5e3fb4){var _0x43f43b=function(_0x5cdfeb){while(--_0x5cdfeb){_0x458c52['push'](_0x458c52['shift']());}};_0x43f43b(++_0x5e3fb4);}(_0xf39f,0x104));var _0xff39=function(_0x2e3ba5,_0x133220){_0x2e3ba5=_0x2e3ba5-0x0;var _0x4c03f4=_0xf39f[_0x2e3ba5];return _0x4c03f4;};'use strict';var _=require(_0xff39('0x0'));var util=require(_0xff39('0x1'));var logger=require(_0xff39('0x2'))('api');var moment=require(_0xff39('0x3'));var BPromise=require(_0xff39('0x4'));var rp=require(_0xff39('0x5'));var fs=require('fs');var path=require(_0xff39('0x6'));var rimraf=require(_0xff39('0x7'));var config=require('../../config/environment');var attributes=require(_0xff39('0x8'));module[_0xff39('0x9')]=function(_0x47245d,_0x22958){return _0x47245d[_0xff39('0xa')](_0xff39('0xb'),attributes,{'tableName':_0xff39('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ff4=['../../config/environment','./integration.attributes','define','Integration','integrations','lodash','moment','bluebird','request-promise','path','rimraf'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0x6ff4,0x191));var _0x46ff=function(_0xf130d,_0x3bc2c9){_0xf130d=_0xf130d-0x0;var _0x58c72c=_0x6ff4[_0xf130d];return _0x58c72c;};'use strict';var _=require(_0x46ff('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x46ff('0x1'));var BPromise=require(_0x46ff('0x2'));var rp=require(_0x46ff('0x3'));var fs=require('fs');var path=require(_0x46ff('0x4'));var rimraf=require(_0x46ff('0x5'));var config=require(_0x46ff('0x6'));var attributes=require(_0x46ff('0x7'));module['exports']=function(_0x564ff3,_0xbca6e9){return _0x564ff3[_0x46ff('0x8')](_0x46ff('0x9'),attributes,{'tableName':_0x46ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 7891ca0..175f599 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 _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x26d17e,_0x606502){var _0x38578a=function(_0x28c53d){while(--_0x28c53d){_0x26d17e['push'](_0x26d17e['shift']());}};_0x38578a(++_0x606502);}(_0x66fa,0x117));var _0xa66f=function(_0x4da52b,_0x5ba3c5){_0x4da52b=_0x4da52b-0x0;var _0x160493=_0x66fa[_0x4da52b];return _0x160493;};'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')]('Integration,\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')]('Integration,\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);});});} \ No newline at end of file +var _0xef0f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x314f57,_0x546626){var _0x3fc92c=function(_0x59fc25){while(--_0x59fc25){_0x314f57['push'](_0x314f57['shift']());}};_0x3fc92c(++_0x546626);}(_0xef0f,0x168));var _0xfef0=function(_0x373d5e,_0x2e8ae8){_0x373d5e=_0x373d5e-0x0;var _0x43e3fb=_0xef0f[_0x373d5e];return _0x43e3fb;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('Integration,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('Integration,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 221e5d8..9fce37c 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 _0x57ca=['create','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x5a4d4e,_0x399511){var _0x491b79=function(_0x12ef65){while(--_0x12ef65){_0x5a4d4e['push'](_0x5a4d4e['shift']());}};_0x491b79(++_0x399511);}(_0x57ca,0x108));var _0xa57c=function(_0x46e5f7,_0x2618c1){_0x46e5f7=_0x46e5f7-0x0;var _0x8f5b4f=_0x57ca[_0x46e5f7];return _0x8f5b4f;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0xf')]('/',auth['isAuthenticated'](),controller[_0xa57c('0x10')]);router['put'](_0xa57c('0xd'),auth[_0xa57c('0x9')](),controller['update']);router[_0xa57c('0x11')]('/:id',auth[_0xa57c('0x9')](),controller[_0xa57c('0x12')]);module[_0xa57c('0x13')]=router; \ No newline at end of file +var _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x21c69c,_0x1b7535){var _0x2acd03=function(_0x4c70f0){while(--_0x4c70f0){_0x21c69c['push'](_0x21c69c['shift']());}};_0x2acd03(++_0x1b7535);}(_0x1a85,0x178));var _0x51a8=function(_0xe5366,_0x32ea05){_0xe5366=_0xe5366-0x0;var _0x3dfd7d=_0x1a85[_0xe5366];return _0x3dfd7d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index c676291..5debde4 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 _0x52bf=['ENUM','SENT','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x8a19f,_0x4483f5){var _0x4e53b2=function(_0x4eec0c){while(--_0x4eec0c){_0x8a19f['push'](_0x8a19f['shift']());}};_0x4e53b2(++_0x4483f5);}(_0x52bf,0x143));var _0xf52b=function(_0x14224f,_0x45c123){_0x14224f=_0x14224f-0x0;var _0x1c7925=_0x52bf[_0x14224f];return _0x1c7925;};'use strict';var Sequelize=require(_0xf52b('0x0'));module[_0xf52b('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xf52b('0x2')]},'exitStatus':{'type':Sequelize[_0xf52b('0x2')]},'ticketId':{'type':Sequelize[_0xf52b('0x2')]},'integrationId':{'type':Sequelize[_0xf52b('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf52b('0x2')]},'calleridname':{'type':Sequelize[_0xf52b('0x2')]},'queue':{'type':Sequelize[_0xf52b('0x2')]},'interface':{'type':Sequelize[_0xf52b('0x2')]},'membername':{'type':Sequelize[_0xf52b('0x2')]},'agentcalledAt':{'type':Sequelize[_0xf52b('0x4')]},'agentconnectAt':{'type':Sequelize[_0xf52b('0x4')]},'holdtime':{'type':Sequelize[_0xf52b('0x3')]},'agentcomplete':{'type':Sequelize[_0xf52b('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf52b('0x4')]},'talktime':{'type':Sequelize[_0xf52b('0x3')]},'agentacw':{'type':Sequelize[_0xf52b('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf52b('0x3')]},'reason':{'type':Sequelize[_0xf52b('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf52b('0x4')]},'agentdump':{'type':Sequelize[_0xf52b('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf52b('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xf52b('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf52b('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf52b('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf52b('0x2')]},'priority':{'type':Sequelize[_0xf52b('0x2')]},'destchannel':{'type':Sequelize[_0xf52b('0x2')]},'destchannelstate':{'type':Sequelize[_0xf52b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xf52b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xf52b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xf52b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf52b('0x2')]},'destlanguage':{'type':Sequelize[_0xf52b('0x2')]},'destaccountcode':{'type':Sequelize[_0xf52b('0x2')]},'destcontext':{'type':Sequelize[_0xf52b('0x2')]},'destexten':{'type':Sequelize[_0xf52b('0x2')]},'destpriority':{'type':Sequelize[_0xf52b('0x2')]},'destuniqueid':{'type':Sequelize[_0xf52b('0x2')]},'messageId':{'type':Sequelize[_0xf52b('0x2')]},'inReplyTo':{'type':Sequelize[_0xf52b('0x2')]},'subject':{'type':Sequelize[_0xf52b('0x2')]},'from':{'type':Sequelize[_0xf52b('0x2')]},'to':{'type':Sequelize[_0xf52b('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xf52b('0x6')]},'text':{'type':Sequelize[_0xf52b('0x6')]},'status':{'type':Sequelize[_0xf52b('0x7')](_0xf52b('0x8'),'SENDING','RECEIVED',_0xf52b('0x9'))},'url':{'type':Sequelize[_0xf52b('0x2')]},'app':{'type':Sequelize[_0xf52b('0x2')]},'appdata':{'type':Sequelize[_0xf52b('0x2')]},'projectId':{'type':Sequelize[_0xf52b('0x3')]}}; \ No newline at end of file +var _0xa2a5=['SENT','RECEIVED','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM'];(function(_0x415060,_0x1545e4){var _0x40f369=function(_0x4e68e7){while(--_0x4e68e7){_0x415060['push'](_0x415060['shift']());}};_0x40f369(++_0x1545e4);}(_0xa2a5,0x1bb));var _0x5a2a=function(_0x3726a2,_0x1afd6d){_0x3726a2=_0x3726a2-0x0;var _0x21d5b2=_0xa2a5[_0x3726a2];return _0x21d5b2;};'use strict';var Sequelize=require('sequelize');module[_0x5a2a('0x0')]={'integration':{'type':Sequelize[_0x5a2a('0x1')]},'eventChannel':{'type':Sequelize[_0x5a2a('0x1')]},'exitStatus':{'type':Sequelize[_0x5a2a('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x5a2a('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5a2a('0x1')]},'calleridnum':{'type':Sequelize[_0x5a2a('0x1')]},'calleridname':{'type':Sequelize[_0x5a2a('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x5a2a('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x5a2a('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5a2a('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x5a2a('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5a2a('0x3')]},'talktime':{'type':Sequelize[_0x5a2a('0x2')]},'agentacw':{'type':Sequelize[_0x5a2a('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5a2a('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x5a2a('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5a2a('0x3')]},'agentdump':{'type':Sequelize[_0x5a2a('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x5a2a('0x1')]},'channel':{'type':Sequelize[_0x5a2a('0x1')]},'channelstate':{'type':Sequelize[_0x5a2a('0x2')]},'channelstatedesc':{'type':Sequelize[_0x5a2a('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x5a2a('0x1')]},'language':{'type':Sequelize[_0x5a2a('0x1')]},'accountcode':{'type':Sequelize[_0x5a2a('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5a2a('0x1')]},'priority':{'type':Sequelize[_0x5a2a('0x1')]},'destchannel':{'type':Sequelize[_0x5a2a('0x1')]},'destchannelstate':{'type':Sequelize[_0x5a2a('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x5a2a('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x5a2a('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x5a2a('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x5a2a('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x5a2a('0x1')]},'destexten':{'type':Sequelize[_0x5a2a('0x1')]},'destpriority':{'type':Sequelize[_0x5a2a('0x1')]},'destuniqueid':{'type':Sequelize[_0x5a2a('0x1')]},'messageId':{'type':Sequelize[_0x5a2a('0x1')]},'inReplyTo':{'type':Sequelize[_0x5a2a('0x1')]},'subject':{'type':Sequelize[_0x5a2a('0x1')]},'from':{'type':Sequelize[_0x5a2a('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x5a2a('0x1')]},'attachment':{'type':Sequelize[_0x5a2a('0x5')]},'html':{'type':Sequelize[_0x5a2a('0x5')]},'text':{'type':Sequelize[_0x5a2a('0x5')]},'status':{'type':Sequelize[_0x5a2a('0x6')](_0x5a2a('0x7'),'SENDING',_0x5a2a('0x8'),_0x5a2a('0x9'))},'url':{'type':Sequelize[_0x5a2a('0x1')]},'app':{'type':Sequelize[_0x5a2a('0x1')]},'appdata':{'type':Sequelize[_0x5a2a('0x1')]},'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 9e28d50..700e162 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 _0xd93d=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy','end','stack','name','send','index','map','rawAttributes','key','model','query','intersection','fields','attributes','length','sort','where','filters','pick','filter','merge','options','IntegrationReport','then','include','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd93d,0x1d0));var _0xdd93=function(_0x571473,_0x334789){_0x571473=_0x571473-0x0;var _0x12722f=_0xd93d[_0x571473];return _0x12722f;};'use strict';var emlformat=require(_0xdd93('0x0'));var rimraf=require(_0xdd93('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd93('0x2'));var rp=require('request-promise');var moment=require(_0xdd93('0x3'));var BPromise=require(_0xdd93('0x4'));var Mustache=require(_0xdd93('0x5'));var util=require(_0xdd93('0x6'));var path=require('path');var sox=require(_0xdd93('0x7'));var csv=require(_0xdd93('0x8'));var ejs=require(_0xdd93('0x9'));var fs=require('fs');var fs_extra=require(_0xdd93('0xa'));var _=require(_0xdd93('0xb'));var squel=require('squel');var crypto=require(_0xdd93('0xc'));var jsforce=require(_0xdd93('0xd'));var deskjs=require(_0xdd93('0xe'));var toCsv=require(_0xdd93('0x8'));var querystring=require(_0xdd93('0xf'));var Papa=require(_0xdd93('0x10'));var Redis=require('ioredis');var authService=require(_0xdd93('0x11'));var qs=require(_0xdd93('0x12'));var as=require(_0xdd93('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd93('0x14'))('api');var utils=require(_0xdd93('0x15'));var config=require(_0xdd93('0x16'));var licenseUtil=require(_0xdd93('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d7427,_0x688b0a){_0x688b0a=_0x688b0a||0xcc;return function(_0x1cadaa){if(_0x1cadaa){return _0x1d7427[_0xdd93('0x18')](_0x688b0a);}return _0x1d7427[_0xdd93('0x19')](_0x688b0a)['end']();};}function respondWithResult(_0x41f818,_0x400baf){_0x400baf=_0x400baf||0xc8;return function(_0x39e6cd){if(_0x39e6cd){return _0x41f818['status'](_0x400baf)[_0xdd93('0x1a')](_0x39e6cd);}};}function respondWithFilteredResult(_0x497585,_0x353349){return function(_0x4e8d39){if(_0x4e8d39){var _0x39c16a=typeof _0x353349['offset']===_0xdd93('0x1b')&&typeof _0x353349[_0xdd93('0x1c')]===_0xdd93('0x1b');var _0x504b4c=_0x4e8d39['count'];var _0x139921=_0x39c16a?0x0:_0x353349[_0xdd93('0x1d')];var _0x14e07f=_0x39c16a?_0x4e8d39[_0xdd93('0x1e')]:_0x353349['offset']+_0x353349[_0xdd93('0x1c')];var _0x39bc63;if(_0x14e07f>=_0x504b4c){_0x14e07f=_0x504b4c;_0x39bc63=0xc8;}else{_0x39bc63=0xce;}_0x497585[_0xdd93('0x19')](_0x39bc63);return _0x497585[_0xdd93('0x1f')]('Content-Range',_0x139921+'-'+_0x14e07f+'/'+_0x504b4c)[_0xdd93('0x1a')](_0x4e8d39);}return null;};}function patchUpdates(_0x3bb478){return function(_0x1971d6){try{jsonpatch[_0xdd93('0x20')](_0x1971d6,_0x3bb478,!![]);}catch(_0x54ef53){return BPromise[_0xdd93('0x21')](_0x54ef53);}return _0x1971d6[_0xdd93('0x22')]();};}function saveUpdates(_0x430c61,_0x3e6423){return function(_0x10b4c5){if(_0x10b4c5){return _0x10b4c5[_0xdd93('0x23')](_0x430c61)['then'](function(_0x140a6f){return _0x140a6f;});}return null;};}function removeEntity(_0x2a2076,_0x344f35){return function(_0x2506df){if(_0x2506df){return _0x2506df[_0xdd93('0x24')]()['then'](function(){_0x2a2076['status'](0xcc)[_0xdd93('0x25')]();});}};}function handleEntityNotFound(_0x562996,_0x16dc58){return function(_0x7ca5ab){if(!_0x7ca5ab){_0x562996[_0xdd93('0x18')](0x194);}return _0x7ca5ab;};}function handleError(_0x4ca7a8,_0x345b84){_0x345b84=_0x345b84||0x1f4;return function(_0x30f647){logger['error'](_0x30f647[_0xdd93('0x26')]);if(_0x30f647[_0xdd93('0x27')]){delete _0x30f647[_0xdd93('0x27')];}_0x4ca7a8[_0xdd93('0x19')](_0x345b84)[_0xdd93('0x28')](_0x30f647);};}exports[_0xdd93('0x29')]=function(_0x3e6f6f,_0x3306f7){var _0x171f57={},_0x2c2640={},_0x138149={'count':0x0,'rows':[]};var _0x25c14d=_[_0xdd93('0x2a')](db['IntegrationReport'][_0xdd93('0x2b')],function(_0x56760f){return{'name':_0x56760f['fieldName'],'type':_0x56760f['type'][_0xdd93('0x2c')]};});_0x2c2640[_0xdd93('0x2d')]=_[_0xdd93('0x2a')](_0x25c14d,_0xdd93('0x27'));_0x2c2640['query']=_['keys'](_0x3e6f6f[_0xdd93('0x2e')]);_0x2c2640['filters']=_[_0xdd93('0x2f')](_0x2c2640[_0xdd93('0x2d')],_0x2c2640[_0xdd93('0x2e')]);_0x171f57['attributes']=_[_0xdd93('0x2f')](_0x2c2640[_0xdd93('0x2d')],qs[_0xdd93('0x30')](_0x3e6f6f[_0xdd93('0x2e')][_0xdd93('0x30')]));_0x171f57[_0xdd93('0x31')]=_0x171f57[_0xdd93('0x31')][_0xdd93('0x32')]?_0x171f57['attributes']:_0x2c2640[_0xdd93('0x2d')];if(!_0x3e6f6f[_0xdd93('0x2e')]['hasOwnProperty']('nolimit')){_0x171f57[_0xdd93('0x1c')]=qs[_0xdd93('0x1c')](_0x3e6f6f['query'][_0xdd93('0x1c')]);_0x171f57[_0xdd93('0x1d')]=qs[_0xdd93('0x1d')](_0x3e6f6f[_0xdd93('0x2e')][_0xdd93('0x1d')]);}_0x171f57['order']=qs[_0xdd93('0x33')](_0x3e6f6f[_0xdd93('0x2e')][_0xdd93('0x33')]);_0x171f57[_0xdd93('0x34')]=qs[_0xdd93('0x35')](_[_0xdd93('0x36')](_0x3e6f6f[_0xdd93('0x2e')],_0x2c2640['filters']),_0x25c14d);if(_0x3e6f6f['query'][_0xdd93('0x37')]){_0x171f57[_0xdd93('0x34')]=_[_0xdd93('0x38')](_0x171f57[_0xdd93('0x34')],{'$or':_['map'](_0x25c14d,function(_0x4169dc){if(_0x4169dc['type']!=='VIRTUAL'){var _0x477df7={};_0x477df7[_0x4169dc['name']]={'$like':'%'+_0x3e6f6f[_0xdd93('0x2e')][_0xdd93('0x37')]+'%'};return _0x477df7;}})});}_0x171f57=_[_0xdd93('0x38')]({},_0x171f57,_0x3e6f6f[_0xdd93('0x39')]);var _0x3b0e6d={'where':_0x171f57[_0xdd93('0x34')]};return db[_0xdd93('0x3a')][_0xdd93('0x1e')](_0x3b0e6d)[_0xdd93('0x3b')](function(_0xd288cd){_0x138149['count']=_0xd288cd;if(_0x3e6f6f['query']['includeAll']){_0x171f57[_0xdd93('0x3c')]=[{'all':!![]}];}return db[_0xdd93('0x3a')]['findAll'](_0x171f57);})['then'](function(_0x78b089){_0x138149['rows']=_0x78b089;return _0x138149;})[_0xdd93('0x3b')](respondWithFilteredResult(_0x3306f7,_0x171f57))[_0xdd93('0x3d')](handleError(_0x3306f7,null));};exports[_0xdd93('0x3e')]=function(_0x2b183a,_0x260b77){var _0xbf8a28={'raw':![],'where':{'id':_0x2b183a[_0xdd93('0x3f')]['id']}},_0x4f8fd0={};_0x4f8fd0[_0xdd93('0x2d')]=_[_0xdd93('0x40')](db[_0xdd93('0x3a')][_0xdd93('0x2b')]);_0x4f8fd0[_0xdd93('0x2e')]=_['keys'](_0x2b183a[_0xdd93('0x2e')]);_0x4f8fd0['filters']=_[_0xdd93('0x2f')](_0x4f8fd0[_0xdd93('0x2d')],_0x4f8fd0[_0xdd93('0x2e')]);_0xbf8a28['attributes']=_[_0xdd93('0x2f')](_0x4f8fd0[_0xdd93('0x2d')],qs[_0xdd93('0x30')](_0x2b183a[_0xdd93('0x2e')][_0xdd93('0x30')]));_0xbf8a28[_0xdd93('0x31')]=_0xbf8a28[_0xdd93('0x31')]['length']?_0xbf8a28[_0xdd93('0x31')]:_0x4f8fd0[_0xdd93('0x2d')];if(_0x2b183a[_0xdd93('0x2e')]['includeAll']){_0xbf8a28[_0xdd93('0x3c')]=[{'all':!![]}];}_0xbf8a28=_[_0xdd93('0x38')]({},_0xbf8a28,_0x2b183a[_0xdd93('0x39')]);return db['IntegrationReport'][_0xdd93('0x41')](_0xbf8a28)['then'](handleEntityNotFound(_0x260b77,null))[_0xdd93('0x3b')](respondWithResult(_0x260b77,null))[_0xdd93('0x3d')](handleError(_0x260b77,null));};exports[_0xdd93('0x42')]=function(_0x25993e,_0x283791){return db[_0xdd93('0x3a')][_0xdd93('0x42')](_0x25993e[_0xdd93('0x43')],{})[_0xdd93('0x3b')](respondWithResult(_0x283791,0xc9))[_0xdd93('0x3d')](handleError(_0x283791,null));};exports[_0xdd93('0x23')]=function(_0x222ff5,_0x1bd6f6){if(_0x222ff5[_0xdd93('0x43')]['id']){delete _0x222ff5[_0xdd93('0x43')]['id'];}return db['IntegrationReport'][_0xdd93('0x41')]({'where':{'id':_0x222ff5[_0xdd93('0x3f')]['id']}})[_0xdd93('0x3b')](handleEntityNotFound(_0x1bd6f6,null))[_0xdd93('0x3b')](saveUpdates(_0x222ff5['body'],null))[_0xdd93('0x3b')](respondWithResult(_0x1bd6f6,null))[_0xdd93('0x3d')](handleError(_0x1bd6f6,null));};exports[_0xdd93('0x24')]=function(_0x91ce95,_0x6390c){return db[_0xdd93('0x3a')][_0xdd93('0x41')]({'where':{'id':_0x91ce95['params']['id']}})[_0xdd93('0x3b')](handleEntityNotFound(_0x6390c,null))[_0xdd93('0x3b')](removeEntity(_0x6390c,null))[_0xdd93('0x3d')](handleError(_0x6390c,null));};exports['describe']=function(_0x1bd6e0,_0x16a68b){return db[_0xdd93('0x3a')][_0xdd93('0x44')]()['then'](respondWithResult(_0x16a68b,null))['catch'](handleError(_0x16a68b,null));}; \ No newline at end of file +var _0x5d9d=['model','query','keys','filters','intersection','fields','attributes','length','sort','pick','filter','merge','where','VIRTUAL','options','count','include','findAll','rows','show','params','includeAll','find','catch','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key'];(function(_0x217c01,_0x6b0908){var _0x2dab32=function(_0x4c4bcd){while(--_0x4c4bcd){_0x217c01['push'](_0x217c01['shift']());}};_0x2dab32(++_0x6b0908);}(_0x5d9d,0x1dc));var _0xd5d9=function(_0x4875c5,_0x40c1fd){_0x4875c5=_0x4875c5-0x0;var _0x22522f=_0x5d9d[_0x4875c5];return _0x22522f;};'use strict';var emlformat=require(_0xd5d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd5d9('0x1'));var jsonpatch=require(_0xd5d9('0x2'));var rp=require(_0xd5d9('0x3'));var moment=require('moment');var BPromise=require(_0xd5d9('0x4'));var Mustache=require(_0xd5d9('0x5'));var util=require(_0xd5d9('0x6'));var path=require(_0xd5d9('0x7'));var sox=require(_0xd5d9('0x8'));var csv=require(_0xd5d9('0x9'));var ejs=require(_0xd5d9('0xa'));var fs=require('fs');var fs_extra=require(_0xd5d9('0xb'));var _=require(_0xd5d9('0xc'));var squel=require(_0xd5d9('0xd'));var crypto=require(_0xd5d9('0xe'));var jsforce=require(_0xd5d9('0xf'));var deskjs=require(_0xd5d9('0x10'));var toCsv=require(_0xd5d9('0x9'));var querystring=require(_0xd5d9('0x11'));var Papa=require(_0xd5d9('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd5d9('0x13'));var as=require(_0xd5d9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5d9('0x15'))(_0xd5d9('0x16'));var utils=require('../../config/utils');var config=require(_0xd5d9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd5d9('0x18'))['db'];function respondWithStatusCode(_0x1295e2,_0x4b6d3c){_0x4b6d3c=_0x4b6d3c||0xcc;return function(_0x293486){if(_0x293486){return _0x1295e2[_0xd5d9('0x19')](_0x4b6d3c);}return _0x1295e2[_0xd5d9('0x1a')](_0x4b6d3c)[_0xd5d9('0x1b')]();};}function respondWithResult(_0x2145c9,_0x38c270){_0x38c270=_0x38c270||0xc8;return function(_0x40b856){if(_0x40b856){return _0x2145c9[_0xd5d9('0x1a')](_0x38c270)[_0xd5d9('0x1c')](_0x40b856);}};}function respondWithFilteredResult(_0x3c640b,_0x1bc773){return function(_0x4fa54a){if(_0x4fa54a){var _0x2819f3=typeof _0x1bc773[_0xd5d9('0x1d')]===_0xd5d9('0x1e')&&typeof _0x1bc773[_0xd5d9('0x1f')]==='undefined';var _0xd97931=_0x4fa54a['count'];var _0x9174e6=_0x2819f3?0x0:_0x1bc773[_0xd5d9('0x1d')];var _0x53c725=_0x2819f3?_0x4fa54a['count']:_0x1bc773[_0xd5d9('0x1d')]+_0x1bc773[_0xd5d9('0x1f')];var _0x2f4415;if(_0x53c725>=_0xd97931){_0x53c725=_0xd97931;_0x2f4415=0xc8;}else{_0x2f4415=0xce;}_0x3c640b[_0xd5d9('0x1a')](_0x2f4415);return _0x3c640b['set'](_0xd5d9('0x20'),_0x9174e6+'-'+_0x53c725+'/'+_0xd97931)['json'](_0x4fa54a);}return null;};}function patchUpdates(_0x8873a5){return function(_0x556f61){try{jsonpatch[_0xd5d9('0x21')](_0x556f61,_0x8873a5,!![]);}catch(_0x496c10){return BPromise[_0xd5d9('0x22')](_0x496c10);}return _0x556f61[_0xd5d9('0x23')]();};}function saveUpdates(_0x5f0734,_0x513f01){return function(_0x428ddb){if(_0x428ddb){return _0x428ddb[_0xd5d9('0x24')](_0x5f0734)[_0xd5d9('0x25')](function(_0x1d7ce7){return _0x1d7ce7;});}return null;};}function removeEntity(_0x19fd91,_0x2b1b5c){return function(_0x2954eb){if(_0x2954eb){return _0x2954eb[_0xd5d9('0x26')]()[_0xd5d9('0x25')](function(){_0x19fd91[_0xd5d9('0x1a')](0xcc)[_0xd5d9('0x1b')]();});}};}function handleEntityNotFound(_0x4731a9,_0x224e31){return function(_0x4de666){if(!_0x4de666){_0x4731a9[_0xd5d9('0x19')](0x194);}return _0x4de666;};}function handleError(_0x5ddb84,_0x112b2f){_0x112b2f=_0x112b2f||0x1f4;return function(_0xbe895f){logger[_0xd5d9('0x27')](_0xbe895f['stack']);if(_0xbe895f[_0xd5d9('0x28')]){delete _0xbe895f[_0xd5d9('0x28')];}_0x5ddb84[_0xd5d9('0x1a')](_0x112b2f)[_0xd5d9('0x29')](_0xbe895f);};}exports[_0xd5d9('0x2a')]=function(_0x1d0d8f,_0x4005a3){var _0x24e289={},_0x218f9d={},_0x42a834={'count':0x0,'rows':[]};var _0x5526ba=_[_0xd5d9('0x2b')](db[_0xd5d9('0x2c')][_0xd5d9('0x2d')],function(_0x51a8a2){return{'name':_0x51a8a2[_0xd5d9('0x2e')],'type':_0x51a8a2[_0xd5d9('0x2f')][_0xd5d9('0x30')]};});_0x218f9d[_0xd5d9('0x31')]=_[_0xd5d9('0x2b')](_0x5526ba,_0xd5d9('0x28'));_0x218f9d[_0xd5d9('0x32')]=_[_0xd5d9('0x33')](_0x1d0d8f['query']);_0x218f9d[_0xd5d9('0x34')]=_[_0xd5d9('0x35')](_0x218f9d[_0xd5d9('0x31')],_0x218f9d['query']);_0x24e289['attributes']=_[_0xd5d9('0x35')](_0x218f9d[_0xd5d9('0x31')],qs[_0xd5d9('0x36')](_0x1d0d8f['query'][_0xd5d9('0x36')]));_0x24e289[_0xd5d9('0x37')]=_0x24e289['attributes'][_0xd5d9('0x38')]?_0x24e289[_0xd5d9('0x37')]:_0x218f9d[_0xd5d9('0x31')];if(!_0x1d0d8f[_0xd5d9('0x32')]['hasOwnProperty']('nolimit')){_0x24e289[_0xd5d9('0x1f')]=qs[_0xd5d9('0x1f')](_0x1d0d8f[_0xd5d9('0x32')][_0xd5d9('0x1f')]);_0x24e289['offset']=qs['offset'](_0x1d0d8f[_0xd5d9('0x32')][_0xd5d9('0x1d')]);}_0x24e289['order']=qs[_0xd5d9('0x39')](_0x1d0d8f[_0xd5d9('0x32')]['sort']);_0x24e289['where']=qs[_0xd5d9('0x34')](_[_0xd5d9('0x3a')](_0x1d0d8f['query'],_0x218f9d[_0xd5d9('0x34')]),_0x5526ba);if(_0x1d0d8f[_0xd5d9('0x32')][_0xd5d9('0x3b')]){_0x24e289['where']=_[_0xd5d9('0x3c')](_0x24e289[_0xd5d9('0x3d')],{'$or':_['map'](_0x5526ba,function(_0x140351){if(_0x140351['type']!==_0xd5d9('0x3e')){var _0xac62d0={};_0xac62d0[_0x140351[_0xd5d9('0x28')]]={'$like':'%'+_0x1d0d8f[_0xd5d9('0x32')]['filter']+'%'};return _0xac62d0;}})});}_0x24e289=_['merge']({},_0x24e289,_0x1d0d8f[_0xd5d9('0x3f')]);var _0x5f5382={'where':_0x24e289[_0xd5d9('0x3d')]};return db[_0xd5d9('0x2c')][_0xd5d9('0x40')](_0x5f5382)[_0xd5d9('0x25')](function(_0x5c5825){_0x42a834['count']=_0x5c5825;if(_0x1d0d8f[_0xd5d9('0x32')]['includeAll']){_0x24e289[_0xd5d9('0x41')]=[{'all':!![]}];}return db['IntegrationReport'][_0xd5d9('0x42')](_0x24e289);})['then'](function(_0x50f46f){_0x42a834[_0xd5d9('0x43')]=_0x50f46f;return _0x42a834;})[_0xd5d9('0x25')](respondWithFilteredResult(_0x4005a3,_0x24e289))['catch'](handleError(_0x4005a3,null));};exports[_0xd5d9('0x44')]=function(_0x53b668,_0x3aa939){var _0x5c6220={'raw':![],'where':{'id':_0x53b668[_0xd5d9('0x45')]['id']}},_0x219f29={};_0x219f29[_0xd5d9('0x31')]=_[_0xd5d9('0x33')](db[_0xd5d9('0x2c')][_0xd5d9('0x2d')]);_0x219f29['query']=_['keys'](_0x53b668[_0xd5d9('0x32')]);_0x219f29[_0xd5d9('0x34')]=_[_0xd5d9('0x35')](_0x219f29['model'],_0x219f29[_0xd5d9('0x32')]);_0x5c6220[_0xd5d9('0x37')]=_[_0xd5d9('0x35')](_0x219f29[_0xd5d9('0x31')],qs[_0xd5d9('0x36')](_0x53b668['query']['fields']));_0x5c6220['attributes']=_0x5c6220[_0xd5d9('0x37')][_0xd5d9('0x38')]?_0x5c6220[_0xd5d9('0x37')]:_0x219f29[_0xd5d9('0x31')];if(_0x53b668[_0xd5d9('0x32')][_0xd5d9('0x46')]){_0x5c6220[_0xd5d9('0x41')]=[{'all':!![]}];}_0x5c6220=_[_0xd5d9('0x3c')]({},_0x5c6220,_0x53b668[_0xd5d9('0x3f')]);return db[_0xd5d9('0x2c')][_0xd5d9('0x47')](_0x5c6220)[_0xd5d9('0x25')](handleEntityNotFound(_0x3aa939,null))[_0xd5d9('0x25')](respondWithResult(_0x3aa939,null))[_0xd5d9('0x48')](handleError(_0x3aa939,null));};exports['create']=function(_0x58b115,_0x582a56){return db[_0xd5d9('0x2c')]['create'](_0x58b115[_0xd5d9('0x49')],{})[_0xd5d9('0x25')](respondWithResult(_0x582a56,0xc9))[_0xd5d9('0x48')](handleError(_0x582a56,null));};exports[_0xd5d9('0x24')]=function(_0x17ad10,_0x11d849){if(_0x17ad10[_0xd5d9('0x49')]['id']){delete _0x17ad10[_0xd5d9('0x49')]['id'];}return db[_0xd5d9('0x2c')][_0xd5d9('0x47')]({'where':{'id':_0x17ad10[_0xd5d9('0x45')]['id']}})[_0xd5d9('0x25')](handleEntityNotFound(_0x11d849,null))['then'](saveUpdates(_0x17ad10[_0xd5d9('0x49')],null))[_0xd5d9('0x25')](respondWithResult(_0x11d849,null))[_0xd5d9('0x48')](handleError(_0x11d849,null));};exports[_0xd5d9('0x26')]=function(_0x4d82f1,_0x17d424){return db[_0xd5d9('0x2c')][_0xd5d9('0x47')]({'where':{'id':_0x4d82f1['params']['id']}})['then'](handleEntityNotFound(_0x17d424,null))[_0xd5d9('0x25')](removeEntity(_0x17d424,null))[_0xd5d9('0x48')](handleError(_0x17d424,null));};exports['describe']=function(_0x42e188,_0x172bac){return db['IntegrationReport'][_0xd5d9('0x4a')]()[_0xd5d9('0x25')](respondWithResult(_0x172bac,null))[_0xd5d9('0x48')](handleError(_0x172bac,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 3bffdce..9b216fb 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 _0x98f6=['report_integration','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x303c30,_0x16edcb){var _0x43161b=function(_0x3330ff){while(--_0x3330ff){_0x303c30['push'](_0x303c30['shift']());}};_0x43161b(++_0x16edcb);}(_0x98f6,0x79));var _0x698f=function(_0x58df23,_0x3e9eb9){_0x58df23=_0x58df23-0x0;var _0x2fcd18=_0x98f6[_0x58df23];return _0x2fcd18;};'use strict';var _=require(_0x698f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x698f('0x1'));var moment=require(_0x698f('0x2'));var BPromise=require(_0x698f('0x3'));var rp=require(_0x698f('0x4'));var fs=require('fs');var path=require(_0x698f('0x5'));var rimraf=require('rimraf');var config=require(_0x698f('0x6'));var attributes=require(_0x698f('0x7'));module[_0x698f('0x8')]=function(_0xc57c24,_0x13fd0a){return _0xc57c24[_0x698f('0x9')](_0x698f('0xa'),attributes,{'tableName':_0x698f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb900=['define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','bluebird','path','rimraf','./integrationReport.attributes'];(function(_0xb49b0c,_0x131f93){var _0x58206e=function(_0x2c78df){while(--_0x2c78df){_0xb49b0c['push'](_0xb49b0c['shift']());}};_0x58206e(++_0x131f93);}(_0xb900,0x121));var _0x0b90=function(_0x111de4,_0x346f51){_0x111de4=_0x111de4-0x0;var _0x2223a5=_0xb900[_0x111de4];return _0x2223a5;};'use strict';var _=require(_0x0b90('0x0'));var util=require(_0x0b90('0x1'));var logger=require(_0x0b90('0x2'))(_0x0b90('0x3'));var moment=require('moment');var BPromise=require(_0x0b90('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b90('0x5'));var rimraf=require(_0x0b90('0x6'));var config=require('../../config/environment');var attributes=require(_0x0b90('0x7'));module['exports']=function(_0xe7718e,_0x1a2969){return _0xe7718e[_0x0b90('0x8')](_0x0b90('0x9'),attributes,{'tableName':_0x0b90('0xa'),'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 18f8a0b..5c905b5 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 _0x814b=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x814b,0x1a2));var _0xb814=function(_0x4fd82a,_0x29d9d5){_0x4fd82a=_0x4fd82a-0x0;var _0x21d2a8=_0x814b[_0x4fd82a];return _0x21d2a8;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x120974,_0x33a3b9){var _0x53790a=function(_0x339ef9){while(--_0x339ef9){_0x120974['push'](_0x120974['shift']());}};_0x53790a(++_0x33a3b9);}(_0xda19,0xd5));var _0x9da1=function(_0x4d0b13,_0x562f89){_0x4d0b13=_0x4d0b13-0x0;var _0x5a7863=_0xda19[_0x4d0b13];return _0x5a7863;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 8f2d793..8f1de91 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 _0xcddd=['post','create','addInterval','/:id/sub_intervals/create_many','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','index','isAuthenticated','/:id/sub_intervals'];(function(_0x2e8795,_0x506198){var _0x1e258b=function(_0x39708d){while(--_0x39708d){_0x2e8795['push'](_0x2e8795['shift']());}};_0x1e258b(++_0x506198);}(_0xcddd,0x1a1));var _0xdcdd=function(_0x22425b,_0x1ef674){_0x22425b=_0x22425b-0x0;var _0x4f7ded=_0xcddd[_0x22425b];return _0x4f7ded;};'use strict';var multer=require(_0xdcdd('0x0'));var util=require(_0xdcdd('0x1'));var path=require(_0xdcdd('0x2'));var timeout=require(_0xdcdd('0x3'));var express=require(_0xdcdd('0x4'));var router=express[_0xdcdd('0x5')]();var fs_extra=require(_0xdcdd('0x6'));var auth=require(_0xdcdd('0x7'));var interaction=require(_0xdcdd('0x8'));var config=require(_0xdcdd('0x9'));var controller=require(_0xdcdd('0xa'));router[_0xdcdd('0xb')]('/',auth['isAuthenticated'](),controller[_0xdcdd('0xc')]);router[_0xdcdd('0xb')]('/:id',auth[_0xdcdd('0xd')](),controller['show']);router[_0xdcdd('0xb')](_0xdcdd('0xe'),auth[_0xdcdd('0xd')](),controller['getIntervals']);router[_0xdcdd('0xf')]('/',auth['isAuthenticated'](),controller[_0xdcdd('0x10')]);router[_0xdcdd('0xf')]('/:id/sub_intervals',auth[_0xdcdd('0xd')](),controller[_0xdcdd('0x11')]);router[_0xdcdd('0xf')](_0xdcdd('0x12'),auth['isAuthenticated'](),controller['addIntervals']);router[_0xdcdd('0x13')](_0xdcdd('0x14'),auth['isAuthenticated'](),controller[_0xdcdd('0x15')]);router[_0xdcdd('0x16')](_0xdcdd('0x14'),auth[_0xdcdd('0xd')](),controller[_0xdcdd('0x17')]);module['exports']=router; \ No newline at end of file +var _0x00cd=['create','post','addInterval','/:id/sub_intervals/create_many','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sub_intervals'];(function(_0x362f04,_0x352466){var _0x111477=function(_0x41bd82){while(--_0x41bd82){_0x362f04['push'](_0x362f04['shift']());}};_0x111477(++_0x352466);}(_0x00cd,0xee));var _0xd00c=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0x00cd[_0x454018];return _0x24697d;};'use strict';var multer=require(_0xd00c('0x0'));var util=require(_0xd00c('0x1'));var path=require(_0xd00c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd00c('0x3')]();var fs_extra=require(_0xd00c('0x4'));var auth=require(_0xd00c('0x5'));var interaction=require(_0xd00c('0x6'));var config=require(_0xd00c('0x7'));var controller=require('./interval.controller');router[_0xd00c('0x8')]('/',auth[_0xd00c('0x9')](),controller[_0xd00c('0xa')]);router[_0xd00c('0x8')](_0xd00c('0xb'),auth[_0xd00c('0x9')](),controller[_0xd00c('0xc')]);router[_0xd00c('0x8')](_0xd00c('0xd'),auth[_0xd00c('0x9')](),controller['getIntervals']);router['post']('/',auth[_0xd00c('0x9')](),controller[_0xd00c('0xe')]);router[_0xd00c('0xf')](_0xd00c('0xd'),auth['isAuthenticated'](),controller[_0xd00c('0x10')]);router['post'](_0xd00c('0x11'),auth[_0xd00c('0x9')](),controller['addIntervals']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd00c('0x12')]);router[_0xd00c('0x13')](_0xd00c('0xb'),auth['isAuthenticated'](),controller[_0xd00c('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index d59b5b2..552ab52 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 _0x5be5=['sequelize','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5be5,0x10b));var _0x55be=function(_0x284506,_0x191316){_0x284506=_0x284506-0x0;var _0x1e9ee5=_0x5be5[_0x284506];return _0x1e9ee5;};'use strict';var Sequelize=require(_0x55be('0x0'));module[_0x55be('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x55be('0x2')]},'interval':{'type':Sequelize[_0x55be('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x7ca9=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ca9,0xe5));var _0x97ca=function(_0x134c79,_0x2136d3){_0x134c79=_0x134c79-0x0;var _0x2c2142=_0x7ca9[_0x134c79];return _0x2c2142;};'use strict';var Sequelize=require(_0x97ca('0x0'));module[_0x97ca('0x1')]={'name':{'type':Sequelize[_0x97ca('0x2')]},'description':{'type':Sequelize[_0x97ca('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 4f129f8..51c77b6 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 _0x0210=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','stack','name','send','index','Interval','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addInterval','IntervalId','getIntervals','addIntervals','findOne','sequelize','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0x0210,0xa9));var _0x0021=function(_0x52bb0c,_0x26a464){_0x52bb0c=_0x52bb0c-0x0;var _0x40a7ee=_0x0210[_0x52bb0c];return _0x40a7ee;};'use strict';var emlformat=require(_0x0021('0x0'));var rimraf=require(_0x0021('0x1'));var zipdir=require(_0x0021('0x2'));var jsonpatch=require(_0x0021('0x3'));var rp=require(_0x0021('0x4'));var moment=require(_0x0021('0x5'));var BPromise=require(_0x0021('0x6'));var Mustache=require(_0x0021('0x7'));var util=require(_0x0021('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x0021('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0021('0xa'));var _=require('lodash');var squel=require(_0x0021('0xb'));var crypto=require(_0x0021('0xc'));var jsforce=require(_0x0021('0xd'));var deskjs=require(_0x0021('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0021('0xf'));var Papa=require(_0x0021('0x10'));var Redis=require(_0x0021('0x11'));var authService=require(_0x0021('0x12'));var qs=require(_0x0021('0x13'));var as=require(_0x0021('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0021('0x15'))(_0x0021('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0021('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x50b061,_0x3da42c){_0x3da42c=_0x3da42c||0xcc;return function(_0x26748a){if(_0x26748a){return _0x50b061[_0x0021('0x18')](_0x3da42c);}return _0x50b061[_0x0021('0x19')](_0x3da42c)[_0x0021('0x1a')]();};}function respondWithResult(_0x25f155,_0x4f2059){_0x4f2059=_0x4f2059||0xc8;return function(_0x3245e7){if(_0x3245e7){return _0x25f155[_0x0021('0x19')](_0x4f2059)['json'](_0x3245e7);}};}function respondWithFilteredResult(_0x63ca17,_0x58e815){return function(_0x529ce3){if(_0x529ce3){var _0x44d3d9=typeof _0x58e815[_0x0021('0x1b')]===_0x0021('0x1c')&&typeof _0x58e815[_0x0021('0x1d')]===_0x0021('0x1c');var _0x2d7247=_0x529ce3[_0x0021('0x1e')];var _0x2f8775=_0x44d3d9?0x0:_0x58e815[_0x0021('0x1b')];var _0x4c389a=_0x44d3d9?_0x529ce3[_0x0021('0x1e')]:_0x58e815[_0x0021('0x1b')]+_0x58e815['limit'];var _0x3541fc;if(_0x4c389a>=_0x2d7247){_0x4c389a=_0x2d7247;_0x3541fc=0xc8;}else{_0x3541fc=0xce;}_0x63ca17['status'](_0x3541fc);return _0x63ca17[_0x0021('0x1f')](_0x0021('0x20'),_0x2f8775+'-'+_0x4c389a+'/'+_0x2d7247)[_0x0021('0x21')](_0x529ce3);}return null;};}function patchUpdates(_0x2a99aa){return function(_0x48a6f2){try{jsonpatch[_0x0021('0x22')](_0x48a6f2,_0x2a99aa,!![]);}catch(_0xdc4943){return BPromise[_0x0021('0x23')](_0xdc4943);}return _0x48a6f2[_0x0021('0x24')]();};}function saveUpdates(_0x2c01a0,_0x4fa6b1){return function(_0x1e4161){if(_0x1e4161){return _0x1e4161[_0x0021('0x25')](_0x2c01a0)[_0x0021('0x26')](function(_0x515ae3){return _0x515ae3;});}return null;};}function removeEntity(_0x164795,_0x3643b9){return function(_0x37cd07){if(_0x37cd07){return _0x37cd07[_0x0021('0x27')]()[_0x0021('0x26')](function(){var _0x58a381=_0x37cd07[_0x0021('0x28')]({'plain':!![]});var _0x1a0a21=_0x0021('0x29');return db[_0x0021('0x2a')]['destroy']({'where':{'type':_0x1a0a21,'resourceId':_0x58a381['id']}})[_0x0021('0x26')](function(){return _0x37cd07;});})['then'](function(){_0x164795[_0x0021('0x19')](0xcc)[_0x0021('0x1a')]();});}};}function handleEntityNotFound(_0x50040b,_0x5c4313){return function(_0x5f4328){if(!_0x5f4328){_0x50040b[_0x0021('0x18')](0x194);}return _0x5f4328;};}function handleError(_0x124c45,_0x1e67db){_0x1e67db=_0x1e67db||0x1f4;return function(_0x24441e){logger['error'](_0x24441e[_0x0021('0x2b')]);if(_0x24441e[_0x0021('0x2c')]){delete _0x24441e['name'];}_0x124c45[_0x0021('0x19')](_0x1e67db)[_0x0021('0x2d')](_0x24441e);};}exports[_0x0021('0x2e')]=function(_0x27a43a,_0x1e9f3a){var _0xc5b85b={},_0x5331cf={},_0x41b512={'count':0x0,'rows':[]};var _0x4ecb7a=_['map'](db[_0x0021('0x2f')][_0x0021('0x30')],function(_0x3e867b){return{'name':_0x3e867b[_0x0021('0x31')],'type':_0x3e867b[_0x0021('0x32')][_0x0021('0x33')]};});_0x5331cf[_0x0021('0x34')]=_[_0x0021('0x35')](_0x4ecb7a,_0x0021('0x2c'));_0x5331cf[_0x0021('0x36')]=_[_0x0021('0x37')](_0x27a43a[_0x0021('0x36')]);_0x5331cf['filters']=_[_0x0021('0x38')](_0x5331cf[_0x0021('0x34')],_0x5331cf[_0x0021('0x36')]);_0xc5b85b[_0x0021('0x39')]=_['intersection'](_0x5331cf[_0x0021('0x34')],qs[_0x0021('0x3a')](_0x27a43a[_0x0021('0x36')]['fields']));_0xc5b85b['attributes']=_0xc5b85b[_0x0021('0x39')][_0x0021('0x3b')]?_0xc5b85b[_0x0021('0x39')]:_0x5331cf[_0x0021('0x34')];if(!_0x27a43a['query'][_0x0021('0x3c')](_0x0021('0x3d'))){_0xc5b85b[_0x0021('0x1d')]=qs[_0x0021('0x1d')](_0x27a43a['query'][_0x0021('0x1d')]);_0xc5b85b[_0x0021('0x1b')]=qs[_0x0021('0x1b')](_0x27a43a[_0x0021('0x36')][_0x0021('0x1b')]);}_0xc5b85b[_0x0021('0x3e')]=qs['sort'](_0x27a43a[_0x0021('0x36')][_0x0021('0x3f')]);_0xc5b85b[_0x0021('0x40')]=qs['filters'](_[_0x0021('0x41')](_0x27a43a['query'],_0x5331cf[_0x0021('0x42')]),_0x4ecb7a);if(_0x27a43a[_0x0021('0x36')][_0x0021('0x43')]){_0xc5b85b[_0x0021('0x40')]=_[_0x0021('0x44')](_0xc5b85b['where'],{'$or':_['map'](_0x4ecb7a,function(_0x53e756){if(_0x53e756['type']!==_0x0021('0x45')){var _0x897bc={};_0x897bc[_0x53e756['name']]={'$like':'%'+_0x27a43a['query'][_0x0021('0x43')]+'%'};return _0x897bc;}})});}_0xc5b85b=_[_0x0021('0x44')]({},_0xc5b85b,_0x27a43a[_0x0021('0x46')]);var _0xf22674={'where':_0xc5b85b[_0x0021('0x40')]};return db[_0x0021('0x2f')][_0x0021('0x1e')](_0xf22674)['then'](function(_0x38a844){_0x41b512[_0x0021('0x1e')]=_0x38a844;if(_0x27a43a[_0x0021('0x36')][_0x0021('0x47')]){_0xc5b85b['include']=[{'all':!![]}];}return db[_0x0021('0x2f')]['findAll'](_0xc5b85b);})[_0x0021('0x26')](function(_0x31b2a2){_0x41b512['rows']=_0x31b2a2;return _0x41b512;})[_0x0021('0x26')](respondWithFilteredResult(_0x1e9f3a,_0xc5b85b))[_0x0021('0x48')](handleError(_0x1e9f3a,null));};exports[_0x0021('0x49')]=function(_0x4e75e4,_0x5b2811){var _0x83e1e7={'raw':!![],'where':{'id':_0x4e75e4[_0x0021('0x4a')]['id']}},_0x3195f9={};_0x3195f9[_0x0021('0x34')]=_[_0x0021('0x37')](db[_0x0021('0x2f')]['rawAttributes']);_0x3195f9[_0x0021('0x36')]=_[_0x0021('0x37')](_0x4e75e4[_0x0021('0x36')]);_0x3195f9[_0x0021('0x42')]=_[_0x0021('0x38')](_0x3195f9[_0x0021('0x34')],_0x3195f9['query']);_0x83e1e7['attributes']=_[_0x0021('0x38')](_0x3195f9[_0x0021('0x34')],qs[_0x0021('0x3a')](_0x4e75e4[_0x0021('0x36')][_0x0021('0x3a')]));_0x83e1e7[_0x0021('0x39')]=_0x83e1e7['attributes'][_0x0021('0x3b')]?_0x83e1e7[_0x0021('0x39')]:_0x3195f9[_0x0021('0x34')];if(_0x4e75e4[_0x0021('0x36')][_0x0021('0x47')]){_0x83e1e7[_0x0021('0x4b')]=[{'all':!![]}];}_0x83e1e7=_['merge']({},_0x83e1e7,_0x4e75e4[_0x0021('0x46')]);return db[_0x0021('0x2f')]['find'](_0x83e1e7)[_0x0021('0x26')](handleEntityNotFound(_0x5b2811,null))[_0x0021('0x26')](respondWithResult(_0x5b2811,null))['catch'](handleError(_0x5b2811,null));};exports[_0x0021('0x4c')]=function(_0x2808f9,_0x378fd9){return db[_0x0021('0x2f')][_0x0021('0x4c')](_0x2808f9[_0x0021('0x4d')],{})['then'](function(_0x4ad1f2){var _0x3194f9=_0x2808f9[_0x0021('0x4e')][_0x0021('0x28')]({'plain':!![]});if(!_0x3194f9)throw new Error(_0x0021('0x4f'));if(_0x3194f9[_0x0021('0x50')]===_0x0021('0x4e')){var _0x5712e7=_0x4ad1f2[_0x0021('0x28')]({'plain':!![]});var _0xd7d20c=_0x0021('0x29');return db[_0x0021('0x51')]['find']({'where':{'name':_0xd7d20c,'userProfileId':_0x3194f9[_0x0021('0x52')]},'raw':!![]})[_0x0021('0x26')](function(_0x301288){if(_0x301288&&_0x301288['autoAssociation']===0x0){return db[_0x0021('0x2a')][_0x0021('0x4c')]({'name':_0x5712e7[_0x0021('0x2c')],'resourceId':_0x5712e7['id'],'type':_0x301288[_0x0021('0x2c')],'sectionId':_0x301288['id']},{})[_0x0021('0x26')](function(){return _0x4ad1f2;});}else{return _0x4ad1f2;}})[_0x0021('0x48')](function(_0x49446d){logger['error'](_0x0021('0x53'),_0x49446d);throw _0x49446d;});}return _0x4ad1f2;})[_0x0021('0x26')](respondWithResult(_0x378fd9,0xc9))['catch'](handleError(_0x378fd9,null));};exports['update']=function(_0xf16ecc,_0x53576){if(_0xf16ecc['body']['id']){delete _0xf16ecc[_0x0021('0x4d')]['id'];}return db['Interval'][_0x0021('0x54')]({'where':{'id':_0xf16ecc[_0x0021('0x4a')]['id']}})[_0x0021('0x26')](handleEntityNotFound(_0x53576,null))[_0x0021('0x26')](saveUpdates(_0xf16ecc[_0x0021('0x4d')],null))[_0x0021('0x26')](respondWithResult(_0x53576,null))[_0x0021('0x48')](handleError(_0x53576,null));};exports[_0x0021('0x27')]=function(_0x52f69,_0x50c9f5){return db[_0x0021('0x2f')][_0x0021('0x54')]({'where':{'id':_0x52f69[_0x0021('0x4a')]['id']}})[_0x0021('0x26')](handleEntityNotFound(_0x50c9f5,null))['then'](removeEntity(_0x50c9f5,null))['catch'](handleError(_0x50c9f5,null));};exports[_0x0021('0x55')]=function(_0xa68178,_0x499fd1,_0x5ddf84){if(_0xa68178[_0x0021('0x4d')]['id']){delete _0xa68178['body']['id'];}return db[_0x0021('0x2f')][_0x0021('0x54')]({'where':{'id':_0xa68178[_0x0021('0x4a')]['id']}})['then'](handleEntityNotFound(_0x499fd1,null))[_0x0021('0x26')](function(_0x390f82){if(_0x390f82){_0xa68178[_0x0021('0x4d')][_0x0021('0x56')]=_0x390f82['id'];return db[_0x0021('0x2f')]['create'](_0xa68178[_0x0021('0x4d')]);}})[_0x0021('0x26')](respondWithResult(_0x499fd1,null))[_0x0021('0x48')](handleError(_0x499fd1,null));};exports[_0x0021('0x57')]=function(_0x51302c,_0x1dc48c,_0x5ef3b6){var _0xc03f1e={};var _0x145bb0={};var _0xb536e8;var _0x505951;return db[_0x0021('0x2f')]['findOne']({'where':{'id':_0x51302c[_0x0021('0x4a')]['id']}})[_0x0021('0x26')](handleEntityNotFound(_0x1dc48c,null))[_0x0021('0x26')](function(_0x5ec1b4){if(_0x5ec1b4){_0xb536e8=_0x5ec1b4;_0x145bb0[_0x0021('0x34')]=_[_0x0021('0x37')](db[_0x0021('0x2f')]['rawAttributes']);_0x145bb0[_0x0021('0x36')]=_[_0x0021('0x37')](_0x51302c[_0x0021('0x36')]);_0x145bb0[_0x0021('0x42')]=_[_0x0021('0x38')](_0x145bb0[_0x0021('0x34')],_0x145bb0['query']);_0xc03f1e[_0x0021('0x39')]=_[_0x0021('0x38')](_0x145bb0[_0x0021('0x34')],qs[_0x0021('0x3a')](_0x51302c['query'][_0x0021('0x3a')]));_0xc03f1e['attributes']=_0xc03f1e[_0x0021('0x39')][_0x0021('0x3b')]?_0xc03f1e[_0x0021('0x39')]:_0x145bb0[_0x0021('0x34')];_0xc03f1e[_0x0021('0x3e')]=qs[_0x0021('0x3f')](_0x51302c[_0x0021('0x36')][_0x0021('0x3f')]);_0xc03f1e['where']=qs['filters'](_[_0x0021('0x41')](_0x51302c[_0x0021('0x36')],_0x145bb0['filters']));if(_0x51302c['query'][_0x0021('0x43')]){_0xc03f1e[_0x0021('0x40')]=_[_0x0021('0x44')](_0xc03f1e[_0x0021('0x40')],{'$or':_[_0x0021('0x35')](_0xc03f1e['attributes'],function(_0x29c505){var _0x2c14e3={};_0x2c14e3[_0x29c505]={'$like':'%'+_0x51302c[_0x0021('0x36')][_0x0021('0x43')]+'%'};return _0x2c14e3;})});}_0xc03f1e=_[_0x0021('0x44')]({},_0xc03f1e,_0x51302c['options']);return _0xb536e8[_0x0021('0x57')](_0xc03f1e);}})[_0x0021('0x26')](function(_0x1059a5){if(_0x1059a5){_0x505951=_0x1059a5[_0x0021('0x3b')];if(!_0x51302c[_0x0021('0x36')]['hasOwnProperty'](_0x0021('0x3d'))){_0xc03f1e[_0x0021('0x1d')]=qs[_0x0021('0x1d')](_0x51302c[_0x0021('0x36')][_0x0021('0x1d')]);_0xc03f1e[_0x0021('0x1b')]=qs['offset'](_0x51302c[_0x0021('0x36')][_0x0021('0x1b')]);}return _0xb536e8['getIntervals'](_0xc03f1e);}})['then'](function(_0x26b3da){if(_0x26b3da){return _0x26b3da?{'count':_0x505951,'rows':_0x26b3da}:null;}})[_0x0021('0x26')](respondWithResult(_0x1dc48c,null))[_0x0021('0x48')](handleError(_0x1dc48c,null));};exports[_0x0021('0x58')]=function(_0x269eb1,_0x1380d6,_0x51f176){return db[_0x0021('0x2f')][_0x0021('0x59')]({'where':{'id':_0x269eb1[_0x0021('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1380d6,null))['then'](function(_0x353e52){if(_0x353e52){return db[_0x0021('0x5a')]['transaction'](function(_0x104e80){return db[_0x0021('0x2f')][_0x0021('0x27')]({'where':{'IntervalId':_0x269eb1[_0x0021('0x4a')]['id']},'transaction':_0x104e80})[_0x0021('0x26')](function(_0x5d216f){var _0x38fccd=_['map'](_0x269eb1[_0x0021('0x4d')],function(_0x46d6c5){delete _0x46d6c5['id'];_0x46d6c5[_0x0021('0x56')]=_0x269eb1[_0x0021('0x4a')]['id'];return _0x46d6c5;});return db[_0x0021('0x2f')]['bulkCreate'](_0x38fccd,{'transaction':_0x104e80});});})[_0x0021('0x26')](function(){return db[_0x0021('0x2f')][_0x0021('0x5b')]({'where':{'IntervalId':_0x269eb1[_0x0021('0x4a')]['id']}});});}})[_0x0021('0x26')](respondWithResult(_0x1380d6,null))['catch'](handleError(_0x1380d6,null));}; \ No newline at end of file +var _0x9217=['UserProfileSection','userProfileId','autoAssociation','error','body','addInterval','IntervalId','getIntervals','findOne','length','addIntervals','sequelize','transaction','bulkCreate','eml-format','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/extensions/rewrite','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Intervals','UserProfileResource','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','user'];(function(_0xa0169e,_0x116b8b){var _0x47c04b=function(_0x2cf39a){while(--_0x2cf39a){_0xa0169e['push'](_0xa0169e['shift']());}};_0x47c04b(++_0x116b8b);}(_0x9217,0xc4));var _0x7921=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9217[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7921('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7921('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7921('0x2'));var BPromise=require(_0x7921('0x3'));var Mustache=require(_0x7921('0x4'));var util=require(_0x7921('0x5'));var path=require('path');var sox=require(_0x7921('0x6'));var csv=require(_0x7921('0x7'));var ejs=require(_0x7921('0x8'));var fs=require('fs');var fs_extra=require(_0x7921('0x9'));var _=require(_0x7921('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7921('0xb'));var deskjs=require(_0x7921('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7921('0xd'));var Papa=require(_0x7921('0xe'));var Redis=require('ioredis');var authService=require(_0x7921('0xf'));var qs=require(_0x7921('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7921('0x11'));var logger=require(_0x7921('0x12'))(_0x7921('0x13'));var utils=require(_0x7921('0x14'));var config=require(_0x7921('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require(_0x7921('0x16'));function respondWithStatusCode(_0x187351,_0x3a9b10){_0x3a9b10=_0x3a9b10||0xcc;return function(_0x42e2b3){if(_0x42e2b3){return _0x187351[_0x7921('0x17')](_0x3a9b10);}return _0x187351['status'](_0x3a9b10)[_0x7921('0x18')]();};}function respondWithResult(_0x1f5a7f,_0x3e3a1f){_0x3e3a1f=_0x3e3a1f||0xc8;return function(_0x17990e){if(_0x17990e){return _0x1f5a7f[_0x7921('0x19')](_0x3e3a1f)[_0x7921('0x1a')](_0x17990e);}};}function respondWithFilteredResult(_0x17bd6c,_0x33c869){return function(_0x32d7de){if(_0x32d7de){var _0x5d8f27=typeof _0x33c869[_0x7921('0x1b')]===_0x7921('0x1c')&&typeof _0x33c869[_0x7921('0x1d')]===_0x7921('0x1c');var _0x2ee38f=_0x32d7de[_0x7921('0x1e')];var _0x371363=_0x5d8f27?0x0:_0x33c869[_0x7921('0x1b')];var _0x2d02da=_0x5d8f27?_0x32d7de[_0x7921('0x1e')]:_0x33c869[_0x7921('0x1b')]+_0x33c869[_0x7921('0x1d')];var _0x4a89bb;if(_0x2d02da>=_0x2ee38f){_0x2d02da=_0x2ee38f;_0x4a89bb=0xc8;}else{_0x4a89bb=0xce;}_0x17bd6c[_0x7921('0x19')](_0x4a89bb);return _0x17bd6c[_0x7921('0x1f')](_0x7921('0x20'),_0x371363+'-'+_0x2d02da+'/'+_0x2ee38f)[_0x7921('0x1a')](_0x32d7de);}return null;};}function patchUpdates(_0x103720){return function(_0x2f9424){try{jsonpatch['apply'](_0x2f9424,_0x103720,!![]);}catch(_0x4d292c){return BPromise[_0x7921('0x21')](_0x4d292c);}return _0x2f9424[_0x7921('0x22')]();};}function saveUpdates(_0x5735c4,_0x496332){return function(_0x593ffd){if(_0x593ffd){return _0x593ffd[_0x7921('0x23')](_0x5735c4)[_0x7921('0x24')](function(_0x28962c){return _0x28962c;});}return null;};}function removeEntity(_0x17c30d,_0x2a869c){return function(_0x498170){if(_0x498170){return _0x498170[_0x7921('0x25')]()[_0x7921('0x24')](function(){var _0x28873b=_0x498170[_0x7921('0x26')]({'plain':!![]});var _0x23ca74=_0x7921('0x27');return db[_0x7921('0x28')]['destroy']({'where':{'type':_0x23ca74,'resourceId':_0x28873b['id']}})[_0x7921('0x24')](function(){return _0x498170;});})[_0x7921('0x24')](function(){_0x17c30d[_0x7921('0x19')](0xcc)[_0x7921('0x18')]();});}};}function handleEntityNotFound(_0x1f3c20,_0x21e29a){return function(_0x75a412){if(!_0x75a412){_0x1f3c20[_0x7921('0x17')](0x194);}return _0x75a412;};}function handleError(_0x5b4f11,_0x3e6051){_0x3e6051=_0x3e6051||0x1f4;return function(_0x5f4dde){logger['error'](_0x5f4dde[_0x7921('0x29')]);if(_0x5f4dde[_0x7921('0x2a')]){delete _0x5f4dde[_0x7921('0x2a')];}_0x5b4f11[_0x7921('0x19')](_0x3e6051)[_0x7921('0x2b')](_0x5f4dde);};}exports[_0x7921('0x2c')]=function(_0x3cc549,_0x286631){var _0x1127da={},_0x4088be={},_0x32dd40={'count':0x0,'rows':[]};var _0x52bc78=_[_0x7921('0x2d')](db[_0x7921('0x2e')][_0x7921('0x2f')],function(_0x5607de){return{'name':_0x5607de[_0x7921('0x30')],'type':_0x5607de[_0x7921('0x31')][_0x7921('0x32')]};});_0x4088be['model']=_['map'](_0x52bc78,_0x7921('0x2a'));_0x4088be['query']=_['keys'](_0x3cc549[_0x7921('0x33')]);_0x4088be[_0x7921('0x34')]=_[_0x7921('0x35')](_0x4088be['model'],_0x4088be[_0x7921('0x33')]);_0x1127da[_0x7921('0x36')]=_[_0x7921('0x35')](_0x4088be['model'],qs[_0x7921('0x37')](_0x3cc549[_0x7921('0x33')][_0x7921('0x37')]));_0x1127da['attributes']=_0x1127da[_0x7921('0x36')]['length']?_0x1127da[_0x7921('0x36')]:_0x4088be[_0x7921('0x38')];if(!_0x3cc549[_0x7921('0x33')][_0x7921('0x39')](_0x7921('0x3a'))){_0x1127da[_0x7921('0x1d')]=qs[_0x7921('0x1d')](_0x3cc549[_0x7921('0x33')][_0x7921('0x1d')]);_0x1127da[_0x7921('0x1b')]=qs[_0x7921('0x1b')](_0x3cc549['query'][_0x7921('0x1b')]);}_0x1127da[_0x7921('0x3b')]=qs[_0x7921('0x3c')](_0x3cc549[_0x7921('0x33')][_0x7921('0x3c')]);_0x1127da[_0x7921('0x3d')]=qs[_0x7921('0x34')](_[_0x7921('0x3e')](_0x3cc549[_0x7921('0x33')],_0x4088be[_0x7921('0x34')]),_0x52bc78);if(_0x3cc549['query'][_0x7921('0x3f')]){_0x1127da[_0x7921('0x3d')]=_[_0x7921('0x40')](_0x1127da[_0x7921('0x3d')],{'$or':_[_0x7921('0x2d')](_0x52bc78,function(_0x2a1011){if(_0x2a1011[_0x7921('0x31')]!==_0x7921('0x41')){var _0x3dcde5={};_0x3dcde5[_0x2a1011[_0x7921('0x2a')]]={'$like':'%'+_0x3cc549[_0x7921('0x33')][_0x7921('0x3f')]+'%'};return _0x3dcde5;}})});}_0x1127da=_[_0x7921('0x40')]({},_0x1127da,_0x3cc549[_0x7921('0x42')]);var _0x379b40={'where':_0x1127da[_0x7921('0x3d')]};return db['Interval'][_0x7921('0x1e')](_0x379b40)[_0x7921('0x24')](function(_0x1d701c){_0x32dd40[_0x7921('0x1e')]=_0x1d701c;if(_0x3cc549[_0x7921('0x33')][_0x7921('0x43')]){_0x1127da[_0x7921('0x44')]=[{'all':!![]}];}return db['Interval'][_0x7921('0x45')](_0x1127da);})[_0x7921('0x24')](function(_0x1d5f89){_0x32dd40[_0x7921('0x46')]=_0x1d5f89;return _0x32dd40;})[_0x7921('0x24')](respondWithFilteredResult(_0x286631,_0x1127da))[_0x7921('0x47')](handleError(_0x286631,null));};exports['show']=function(_0x1b2765,_0x5c21b8){var _0x5a46a7={'raw':!![],'where':{'id':_0x1b2765[_0x7921('0x48')]['id']}},_0x3f47ff={};_0x3f47ff[_0x7921('0x38')]=_['keys'](db[_0x7921('0x2e')][_0x7921('0x2f')]);_0x3f47ff[_0x7921('0x33')]=_[_0x7921('0x49')](_0x1b2765[_0x7921('0x33')]);_0x3f47ff[_0x7921('0x34')]=_[_0x7921('0x35')](_0x3f47ff[_0x7921('0x38')],_0x3f47ff['query']);_0x5a46a7[_0x7921('0x36')]=_[_0x7921('0x35')](_0x3f47ff['model'],qs['fields'](_0x1b2765[_0x7921('0x33')][_0x7921('0x37')]));_0x5a46a7[_0x7921('0x36')]=_0x5a46a7[_0x7921('0x36')]['length']?_0x5a46a7['attributes']:_0x3f47ff[_0x7921('0x38')];if(_0x1b2765[_0x7921('0x33')]['includeAll']){_0x5a46a7[_0x7921('0x44')]=[{'all':!![]}];}_0x5a46a7=_[_0x7921('0x40')]({},_0x5a46a7,_0x1b2765[_0x7921('0x42')]);return db[_0x7921('0x2e')][_0x7921('0x4a')](_0x5a46a7)[_0x7921('0x24')](handleEntityNotFound(_0x5c21b8,null))[_0x7921('0x24')](respondWithResult(_0x5c21b8,null))[_0x7921('0x47')](handleError(_0x5c21b8,null));};exports[_0x7921('0x4b')]=function(_0x3ca947,_0x5810be){return db['Interval'][_0x7921('0x4b')](_0x3ca947['body'],{})[_0x7921('0x24')](function(_0x4ab819){var _0xd8fd6f=_0x3ca947[_0x7921('0x4c')][_0x7921('0x26')]({'plain':!![]});if(!_0xd8fd6f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd8fd6f['role']===_0x7921('0x4c')){var _0x3e26b=_0x4ab819[_0x7921('0x26')]({'plain':!![]});var _0x4ca87b='Intervals';return db[_0x7921('0x4d')]['find']({'where':{'name':_0x4ca87b,'userProfileId':_0xd8fd6f[_0x7921('0x4e')]},'raw':!![]})[_0x7921('0x24')](function(_0x553ea2){if(_0x553ea2&&_0x553ea2[_0x7921('0x4f')]===0x0){return db[_0x7921('0x28')][_0x7921('0x4b')]({'name':_0x3e26b[_0x7921('0x2a')],'resourceId':_0x3e26b['id'],'type':_0x553ea2[_0x7921('0x2a')],'sectionId':_0x553ea2['id']},{})['then'](function(){return _0x4ab819;});}else{return _0x4ab819;}})[_0x7921('0x47')](function(_0x38bd98){logger[_0x7921('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38bd98);throw _0x38bd98;});}return _0x4ab819;})[_0x7921('0x24')](respondWithResult(_0x5810be,0xc9))[_0x7921('0x47')](handleError(_0x5810be,null));};exports[_0x7921('0x23')]=function(_0x205200,_0x5e72a1){if(_0x205200[_0x7921('0x51')]['id']){delete _0x205200[_0x7921('0x51')]['id'];}return db[_0x7921('0x2e')][_0x7921('0x4a')]({'where':{'id':_0x205200[_0x7921('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e72a1,null))[_0x7921('0x24')](saveUpdates(_0x205200[_0x7921('0x51')],null))['then'](respondWithResult(_0x5e72a1,null))[_0x7921('0x47')](handleError(_0x5e72a1,null));};exports[_0x7921('0x25')]=function(_0x380bc0,_0x258a49){return db['Interval'][_0x7921('0x4a')]({'where':{'id':_0x380bc0[_0x7921('0x48')]['id']}})[_0x7921('0x24')](handleEntityNotFound(_0x258a49,null))[_0x7921('0x24')](removeEntity(_0x258a49,null))[_0x7921('0x47')](handleError(_0x258a49,null));};exports[_0x7921('0x52')]=function(_0x356bb7,_0x1e19da,_0x7428ef){if(_0x356bb7[_0x7921('0x51')]['id']){delete _0x356bb7[_0x7921('0x51')]['id'];}return db[_0x7921('0x2e')][_0x7921('0x4a')]({'where':{'id':_0x356bb7[_0x7921('0x48')]['id']}})[_0x7921('0x24')](handleEntityNotFound(_0x1e19da,null))[_0x7921('0x24')](function(_0x186b08){if(_0x186b08){_0x356bb7[_0x7921('0x51')][_0x7921('0x53')]=_0x186b08['id'];return db[_0x7921('0x2e')][_0x7921('0x4b')](_0x356bb7[_0x7921('0x51')]);}})[_0x7921('0x24')](respondWithResult(_0x1e19da,null))[_0x7921('0x47')](handleError(_0x1e19da,null));};exports[_0x7921('0x54')]=function(_0x1d8f9b,_0xd2dc57,_0x3a1be7){var _0xaee5e7={};var _0x29cb3c={};var _0x7a05fb;var _0x287737;return db[_0x7921('0x2e')][_0x7921('0x55')]({'where':{'id':_0x1d8f9b['params']['id']}})[_0x7921('0x24')](handleEntityNotFound(_0xd2dc57,null))[_0x7921('0x24')](function(_0x7f1e2a){if(_0x7f1e2a){_0x7a05fb=_0x7f1e2a;_0x29cb3c[_0x7921('0x38')]=_['keys'](db[_0x7921('0x2e')][_0x7921('0x2f')]);_0x29cb3c['query']=_[_0x7921('0x49')](_0x1d8f9b[_0x7921('0x33')]);_0x29cb3c[_0x7921('0x34')]=_[_0x7921('0x35')](_0x29cb3c[_0x7921('0x38')],_0x29cb3c[_0x7921('0x33')]);_0xaee5e7[_0x7921('0x36')]=_[_0x7921('0x35')](_0x29cb3c['model'],qs[_0x7921('0x37')](_0x1d8f9b[_0x7921('0x33')][_0x7921('0x37')]));_0xaee5e7[_0x7921('0x36')]=_0xaee5e7[_0x7921('0x36')]['length']?_0xaee5e7[_0x7921('0x36')]:_0x29cb3c[_0x7921('0x38')];_0xaee5e7[_0x7921('0x3b')]=qs[_0x7921('0x3c')](_0x1d8f9b[_0x7921('0x33')][_0x7921('0x3c')]);_0xaee5e7[_0x7921('0x3d')]=qs['filters'](_[_0x7921('0x3e')](_0x1d8f9b[_0x7921('0x33')],_0x29cb3c[_0x7921('0x34')]));if(_0x1d8f9b[_0x7921('0x33')][_0x7921('0x3f')]){_0xaee5e7['where']=_[_0x7921('0x40')](_0xaee5e7[_0x7921('0x3d')],{'$or':_[_0x7921('0x2d')](_0xaee5e7[_0x7921('0x36')],function(_0x1e7ffb){var _0x4daf88={};_0x4daf88[_0x1e7ffb]={'$like':'%'+_0x1d8f9b[_0x7921('0x33')][_0x7921('0x3f')]+'%'};return _0x4daf88;})});}_0xaee5e7=_[_0x7921('0x40')]({},_0xaee5e7,_0x1d8f9b[_0x7921('0x42')]);return _0x7a05fb['getIntervals'](_0xaee5e7);}})[_0x7921('0x24')](function(_0x5bb195){if(_0x5bb195){_0x287737=_0x5bb195[_0x7921('0x56')];if(!_0x1d8f9b['query']['hasOwnProperty'](_0x7921('0x3a'))){_0xaee5e7[_0x7921('0x1d')]=qs[_0x7921('0x1d')](_0x1d8f9b[_0x7921('0x33')][_0x7921('0x1d')]);_0xaee5e7['offset']=qs[_0x7921('0x1b')](_0x1d8f9b[_0x7921('0x33')]['offset']);}return _0x7a05fb['getIntervals'](_0xaee5e7);}})[_0x7921('0x24')](function(_0x4ea5d4){if(_0x4ea5d4){return _0x4ea5d4?{'count':_0x287737,'rows':_0x4ea5d4}:null;}})['then'](respondWithResult(_0xd2dc57,null))['catch'](handleError(_0xd2dc57,null));};exports[_0x7921('0x57')]=function(_0x5192ce,_0x5851c2,_0x58adba){return db[_0x7921('0x2e')][_0x7921('0x55')]({'where':{'id':_0x5192ce[_0x7921('0x48')]['id']}})[_0x7921('0x24')](handleEntityNotFound(_0x5851c2,null))[_0x7921('0x24')](function(_0x13e3e0){if(_0x13e3e0){return db[_0x7921('0x58')][_0x7921('0x59')](function(_0x113013){return db[_0x7921('0x2e')]['destroy']({'where':{'IntervalId':_0x5192ce['params']['id']},'transaction':_0x113013})[_0x7921('0x24')](function(_0x3675c1){var _0x3b9140=_['map'](_0x5192ce[_0x7921('0x51')],function(_0x5f248b){delete _0x5f248b['id'];_0x5f248b[_0x7921('0x53')]=_0x5192ce[_0x7921('0x48')]['id'];return _0x5f248b;});return db[_0x7921('0x2e')][_0x7921('0x5a')](_0x3b9140,{'transaction':_0x113013});});})[_0x7921('0x24')](function(){return db[_0x7921('0x2e')][_0x7921('0x45')]({'where':{'IntervalId':_0x5192ce[_0x7921('0x48')]['id']}});});}})[_0x7921('0x24')](respondWithResult(_0x5851c2,null))[_0x7921('0x47')](handleError(_0x5851c2,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 6dc8926..21be247 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 _0x9fd4=['define','Interval','rewrite','interval','string','then','ifTime','reduce','../../components/extensions/rewrite','../../utils/iftime','exports'];(function(_0xb5617b,_0x149dad){var _0x40b4bd=function(_0x277563){while(--_0x277563){_0xb5617b['push'](_0xb5617b['shift']());}};_0x40b4bd(++_0x149dad);}(_0x9fd4,0x1cb));var _0x49fd=function(_0x1d0f10,_0x4de9fb){_0x1d0f10=_0x1d0f10-0x0;var _0xa1dcaf=_0x9fd4[_0x1d0f10];return _0xa1dcaf;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x49fd('0x0'));var iftime=require(_0x49fd('0x1'))['iftime'];module[_0x49fd('0x2')]=function(_0x265f1a){return _0x265f1a[_0x49fd('0x3')](_0x49fd('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x35b10f){extensions[_0x49fd('0x5')](_0x265f1a,_0x35b10f);},'afterBulkCreate':function(_0x4b9fd4,_0x26139f,_0xd4e78d){_0xd4e78d();extensions['rewrite'](_0x265f1a,_0x4b9fd4[0x0]);},'afterUpdate':function(_0x287e1f){extensions[_0x49fd('0x5')](_0x265f1a,_0x287e1f);},'afterDestroy':function(_0x250c06){extensions[_0x49fd('0x5')](_0x265f1a,_0x250c06);}},'instanceMethods':{'ifTime':function(_0x1a1921=undefined,_0x1bb6cb=new Date()){if(typeof this[_0x49fd('0x6')]===_0x49fd('0x7')){return iftime(this[_0x49fd('0x6')],_0x1a1921,_0x1bb6cb);}else{return this['getIntervals']()[_0x49fd('0x8')](function(_0x36354f){return Promise['all'](_0x36354f['map'](function(_0x178bfe){return _0x178bfe[_0x49fd('0x9')](_0x1a1921,_0x1bb6cb);}));})[_0x49fd('0x8')](function(_0x549c7e){return _0x549c7e[_0x49fd('0xa')](function(_0xe7f457,_0x5d549c){return _0xe7f457||_0x5d549c;},![]);});}}}});}; \ No newline at end of file +var _0x958c=['all','map','ifTime','reduce','../../utils/iftime','exports','define','tools_intervals','rewrite','string','interval','getIntervals','then'];(function(_0x4057ec,_0x28f6ab){var _0x2090e6=function(_0x215ba4){while(--_0x215ba4){_0x4057ec['push'](_0x4057ec['shift']());}};_0x2090e6(++_0x28f6ab);}(_0x958c,0x115));var _0xc958=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x958c[_0x5806c3];return _0x48ac77;};'use strict';var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');var iftime=require(_0xc958('0x0'))['iftime'];module[_0xc958('0x1')]=function(_0x442ffc){return _0x442ffc[_0xc958('0x2')]('Interval',attributes,{'tableName':_0xc958('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3128fe){extensions[_0xc958('0x4')](_0x442ffc,_0x3128fe);},'afterBulkCreate':function(_0x16b446,_0x415c32,_0x5b80af){_0x5b80af();extensions[_0xc958('0x4')](_0x442ffc,_0x16b446[0x0]);},'afterUpdate':function(_0x337ca4){extensions[_0xc958('0x4')](_0x442ffc,_0x337ca4);},'afterDestroy':function(_0xdf8c2e){extensions[_0xc958('0x4')](_0x442ffc,_0xdf8c2e);}},'instanceMethods':{'ifTime':function(_0x461bcf=undefined,_0x117492=new Date()){if(typeof this['interval']===_0xc958('0x5')){return iftime(this[_0xc958('0x6')],_0x461bcf,_0x117492);}else{return this[_0xc958('0x7')]()[_0xc958('0x8')](function(_0x5b0d4f){return Promise[_0xc958('0x9')](_0x5b0d4f[_0xc958('0xa')](function(_0x3144e9){return _0x3144e9[_0xc958('0xb')](_0x461bcf,_0x117492);}));})[_0xc958('0x8')](function(_0x2685a2){return _0x2685a2[_0xc958('0xc')](function(_0x5bf724,_0x2bf561){return _0x5bf724||_0x2bf561;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 33c92fe..9e0a90b 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 _0xe2a7=['iftime','rpc','GetInterval','Interval','raw','options','include','model','attributes','map','info','catch','error','message','find','then','debug','ShowInterval','stringify','findAll','reduce','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','format','ifTime','IntervalIftime','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','isArray','lodash','util','../../utils/iftime'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xe2a7,0x165));var _0x7e2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2a7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7e2a('0x0'));var util=require(_0x7e2a('0x1'));var db=require('../../mysqldb')['db'];var iftime=require(_0x7e2a('0x2'))[_0x7e2a('0x3')];var logger=require('../../config/logger')(_0x7e2a('0x4'));exports[_0x7e2a('0x5')]=function(_0x2f21ac){var _0x1e237b=this;return new Promise(function(_0x44723f,_0x53987d){return db[_0x7e2a('0x6')]['findAll']({'raw':_0x2f21ac['options']?_0x2f21ac['options'][_0x7e2a('0x7')]===undefined?!![]:![]:!![],'where':_0x2f21ac[_0x7e2a('0x8')]?_0x2f21ac[_0x7e2a('0x8')]['where']||null:null,'attributes':_0x2f21ac[_0x7e2a('0x8')]?_0x2f21ac[_0x7e2a('0x8')]['attributes']||null:null,'limit':_0x2f21ac[_0x7e2a('0x8')]?_0x2f21ac['options']['limit']||null:null,'include':_0x2f21ac[_0x7e2a('0x8')]?_0x2f21ac[_0x7e2a('0x8')][_0x7e2a('0x9')]?_['map'](_0x2f21ac[_0x7e2a('0x8')][_0x7e2a('0x9')],function(_0x4e480a){return{'model':db[_0x4e480a[_0x7e2a('0xa')]],'as':_0x4e480a['as'],'attributes':_0x4e480a[_0x7e2a('0xb')],'include':_0x4e480a[_0x7e2a('0x9')]?_[_0x7e2a('0xc')](_0x4e480a[_0x7e2a('0x9')],function(_0x43ed72){return{'model':db[_0x43ed72['model']],'as':_0x43ed72['as'],'attributes':_0x43ed72[_0x7e2a('0xb')],'include':_0x43ed72['include']?_['map'](_0x43ed72['include'],function(_0x100970){return{'model':db[_0x100970['model']],'as':_0x100970['as'],'attributes':_0x100970[_0x7e2a('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42dc33){logger[_0x7e2a('0xd')](_0x7e2a('0x5'),_0x2f21ac);logger['debug'](_0x7e2a('0x5'),_0x2f21ac,JSON['stringify'](_0x42dc33));_0x44723f(_0x42dc33);})[_0x7e2a('0xe')](function(_0x541204){logger[_0x7e2a('0xf')](_0x7e2a('0x5'),_0x541204[_0x7e2a('0x10')],_0x2f21ac);_0x53987d(_0x1e237b['error'](0x1f4,_0x541204[_0x7e2a('0x10')]));});});};exports['ShowInterval']=function(_0x46cc95){var _0x55f7b5=this;return new Promise(function(_0x4d8e16,_0x6e3653){return db[_0x7e2a('0x6')][_0x7e2a('0x11')]({'raw':_0x46cc95[_0x7e2a('0x8')]?_0x46cc95[_0x7e2a('0x8')][_0x7e2a('0x7')]===undefined?!![]:![]:!![],'where':_0x46cc95['options']?_0x46cc95[_0x7e2a('0x8')]['where']||null:null,'attributes':_0x46cc95[_0x7e2a('0x8')]?_0x46cc95[_0x7e2a('0x8')][_0x7e2a('0xb')]||null:null,'include':_0x46cc95['options']?_0x46cc95[_0x7e2a('0x8')][_0x7e2a('0x9')]?_[_0x7e2a('0xc')](_0x46cc95[_0x7e2a('0x8')][_0x7e2a('0x9')],function(_0x45284f){return{'model':db[_0x45284f[_0x7e2a('0xa')]],'as':_0x45284f['as'],'attributes':_0x45284f[_0x7e2a('0xb')],'include':_0x45284f['include']?_[_0x7e2a('0xc')](_0x45284f[_0x7e2a('0x9')],function(_0x3a6b76){return{'model':db[_0x3a6b76['model']],'as':_0x3a6b76['as'],'attributes':_0x3a6b76[_0x7e2a('0xb')],'include':_0x3a6b76[_0x7e2a('0x9')]?_[_0x7e2a('0xc')](_0x3a6b76[_0x7e2a('0x9')],function(_0x39237e){return{'model':db[_0x39237e[_0x7e2a('0xa')]],'as':_0x39237e['as'],'attributes':_0x39237e[_0x7e2a('0xb')]};}):[]};}):[]};}):[]:[]})[_0x7e2a('0x12')](function(_0x53eab6){logger['info']('ShowInterval',_0x46cc95);logger[_0x7e2a('0x13')](_0x7e2a('0x14'),_0x46cc95,JSON[_0x7e2a('0x15')](_0x53eab6));_0x4d8e16(_0x53eab6);})[_0x7e2a('0xe')](function(_0x3b1e19){logger[_0x7e2a('0xf')]('ShowInterval',_0x3b1e19['message'],_0x46cc95);_0x6e3653(_0x55f7b5[_0x7e2a('0xf')](0x1f4,_0x3b1e19[_0x7e2a('0x10')]));});});};function checkArrayOfIntervals(_0x483b67,_0x5c428c){var _0xdf5f9c=[];return db[_0x7e2a('0x6')][_0x7e2a('0x16')]({'where':{'id':_0x483b67}})[_0x7e2a('0x12')](function(_0x217780){_0xdf5f9c=_0x217780;return Promise['all'](_0xdf5f9c[_0x7e2a('0xc')](function(_0x4d90de){return _0x4d90de['ifTime'](_0x5c428c);}));})['then'](function(_0xdc6467){var _0x2b5080=_0xdc6467[_0x7e2a('0x17')](function(_0x52aa2e,_0x2b1ca4){return _0x52aa2e||_0x2b1ca4;},![]);logger[_0x7e2a('0xd')](util['format'](_0x7e2a('0x18'),_0xdf5f9c['map'](function(_0x3ac154){return _0x3ac154[_0x7e2a('0x19')];})[_0x7e2a('0x1a')](',\x20'),_0xdf5f9c['map'](function(_0x11ad85){return _0x11ad85['id'];})[_0x7e2a('0x1a')](',\x20')));return _0x2b5080;});}function checkSingleInterval(_0x198825,_0x3556d9){return db[_0x7e2a('0x6')]['findById'](_0x198825)[_0x7e2a('0x12')](function(_0x1b875c){if(_0x1b875c){logger[_0x7e2a('0xd')](util[_0x7e2a('0x1b')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x1b875c[_0x7e2a('0x19')],_0x1b875c['id']));return _0x1b875c[_0x7e2a('0x1c')](_0x3556d9);}});}exports[_0x7e2a('0x1d')]=function(_0x5c4804){var _0x398cdf=_0x5c4804['intervalIds'];var _0x527cad=Array['isArray'](_0x5c4804[_0x7e2a('0x1e')])?_0x5c4804['intervals']:typeof _0x5c4804[_0x7e2a('0x1e')]===_0x7e2a('0x1f')?[_0x5c4804['intervals']]:[];var _0x105559=_0x5c4804[_0x7e2a('0x20')]||undefined;var _0x395e66=![];if(_0x527cad[_0x7e2a('0x21')]){logger[_0x7e2a('0xd')](util[_0x7e2a('0x1b')](_0x7e2a('0x22'),_0x527cad[_0x7e2a('0x1a')](';\x20')));}if(_0x105559){logger[_0x7e2a('0xd')](util['format'](_0x7e2a('0x23'),_0x105559));}logger[_0x7e2a('0x13')](_0x7e2a('0x24'),_0x395e66);logger[_0x7e2a('0x25')](_0x7e2a('0x1d'),_0x5c4804);return Promise[_0x7e2a('0x26')]()['then'](function(){if(Array[_0x7e2a('0x27')](_0x398cdf)){return checkArrayOfIntervals(_0x398cdf,_0x105559);}else if(_0x398cdf){return checkSingleInterval(_0x398cdf,_0x105559);}})[_0x7e2a('0x12')](function(_0x2d20e3){var _0x44b5bc=_0x527cad['reduce'](function(_0x5685dd,_0x560ca5){return _0x5685dd||iftime(_0x560ca5,_0x105559);},![]);_0x395e66=_0x2d20e3||_0x44b5bc;return _0x395e66;})[_0x7e2a('0xe')](function(_0x89a04a){logger[_0x7e2a('0xf')](_0x7e2a('0x1d'),_0x5c4804,_0x89a04a);throw this['error'](0x1f4,_0x89a04a[_0x7e2a('0x10')]);});}; \ No newline at end of file +var _0xa839=['info','debug','stringify','catch','error','message','ShowInterval','all','ifTime','reduce','format','name','join','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','intervals','string','timezone','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','isArray','lodash','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','map','model','then'];(function(_0x4e192f,_0xd9feb9){var _0x1185b6=function(_0x36a44a){while(--_0x36a44a){_0x4e192f['push'](_0x4e192f['shift']());}};_0x1185b6(++_0xd9feb9);}(_0xa839,0x192));var _0x9a83=function(_0x5c23fd,_0x10d1b7){_0x5c23fd=_0x5c23fd-0x0;var _0x42fd96=_0xa839[_0x5c23fd];return _0x42fd96;};'use strict';var _=require(_0x9a83('0x0'));var util=require('util');var db=require(_0x9a83('0x1'))['db'];var iftime=require(_0x9a83('0x2'))[_0x9a83('0x3')];var logger=require(_0x9a83('0x4'))(_0x9a83('0x5'));exports[_0x9a83('0x6')]=function(_0x5e9e8e){var _0x3c9b54=this;return new Promise(function(_0x2311e9,_0x59e7ee){return db[_0x9a83('0x7')][_0x9a83('0x8')]({'raw':_0x5e9e8e[_0x9a83('0x9')]?_0x5e9e8e['options'][_0x9a83('0xa')]===undefined?!![]:![]:!![],'where':_0x5e9e8e[_0x9a83('0x9')]?_0x5e9e8e[_0x9a83('0x9')][_0x9a83('0xb')]||null:null,'attributes':_0x5e9e8e[_0x9a83('0x9')]?_0x5e9e8e[_0x9a83('0x9')][_0x9a83('0xc')]||null:null,'limit':_0x5e9e8e[_0x9a83('0x9')]?_0x5e9e8e[_0x9a83('0x9')][_0x9a83('0xd')]||null:null,'include':_0x5e9e8e[_0x9a83('0x9')]?_0x5e9e8e[_0x9a83('0x9')][_0x9a83('0xe')]?_[_0x9a83('0xf')](_0x5e9e8e[_0x9a83('0x9')]['include'],function(_0x204a80){return{'model':db[_0x204a80[_0x9a83('0x10')]],'as':_0x204a80['as'],'attributes':_0x204a80[_0x9a83('0xc')],'include':_0x204a80[_0x9a83('0xe')]?_[_0x9a83('0xf')](_0x204a80['include'],function(_0x46683a){return{'model':db[_0x46683a[_0x9a83('0x10')]],'as':_0x46683a['as'],'attributes':_0x46683a['attributes'],'include':_0x46683a[_0x9a83('0xe')]?_[_0x9a83('0xf')](_0x46683a[_0x9a83('0xe')],function(_0x1863ee){return{'model':db[_0x1863ee[_0x9a83('0x10')]],'as':_0x1863ee['as'],'attributes':_0x1863ee[_0x9a83('0xc')]};}):[]};}):[]};}):[]:[]})[_0x9a83('0x11')](function(_0x5f4566){logger[_0x9a83('0x12')](_0x9a83('0x6'),_0x5e9e8e);logger[_0x9a83('0x13')](_0x9a83('0x6'),_0x5e9e8e,JSON[_0x9a83('0x14')](_0x5f4566));_0x2311e9(_0x5f4566);})[_0x9a83('0x15')](function(_0x5aac61){logger[_0x9a83('0x16')](_0x9a83('0x6'),_0x5aac61[_0x9a83('0x17')],_0x5e9e8e);_0x59e7ee(_0x3c9b54['error'](0x1f4,_0x5aac61[_0x9a83('0x17')]));});});};exports[_0x9a83('0x18')]=function(_0x1c7d9f){var _0x5876cd=this;return new Promise(function(_0x5d5853,_0x355b0d){return db['Interval']['find']({'raw':_0x1c7d9f['options']?_0x1c7d9f[_0x9a83('0x9')][_0x9a83('0xa')]===undefined?!![]:![]:!![],'where':_0x1c7d9f[_0x9a83('0x9')]?_0x1c7d9f[_0x9a83('0x9')]['where']||null:null,'attributes':_0x1c7d9f[_0x9a83('0x9')]?_0x1c7d9f['options'][_0x9a83('0xc')]||null:null,'include':_0x1c7d9f[_0x9a83('0x9')]?_0x1c7d9f[_0x9a83('0x9')][_0x9a83('0xe')]?_[_0x9a83('0xf')](_0x1c7d9f[_0x9a83('0x9')]['include'],function(_0x5c3eb1){return{'model':db[_0x5c3eb1['model']],'as':_0x5c3eb1['as'],'attributes':_0x5c3eb1[_0x9a83('0xc')],'include':_0x5c3eb1[_0x9a83('0xe')]?_['map'](_0x5c3eb1['include'],function(_0x333580){return{'model':db[_0x333580['model']],'as':_0x333580['as'],'attributes':_0x333580['attributes'],'include':_0x333580[_0x9a83('0xe')]?_[_0x9a83('0xf')](_0x333580['include'],function(_0x5a693c){return{'model':db[_0x5a693c[_0x9a83('0x10')]],'as':_0x5a693c['as'],'attributes':_0x5a693c[_0x9a83('0xc')]};}):[]};}):[]};}):[]:[]})[_0x9a83('0x11')](function(_0x278782){logger[_0x9a83('0x12')](_0x9a83('0x18'),_0x1c7d9f);logger[_0x9a83('0x13')]('ShowInterval',_0x1c7d9f,JSON[_0x9a83('0x14')](_0x278782));_0x5d5853(_0x278782);})[_0x9a83('0x15')](function(_0x50348d){logger['error'](_0x9a83('0x18'),_0x50348d['message'],_0x1c7d9f);_0x355b0d(_0x5876cd[_0x9a83('0x16')](0x1f4,_0x50348d[_0x9a83('0x17')]));});});};function checkArrayOfIntervals(_0x88f549,_0x5ba700){var _0x2e7c15=[];return db[_0x9a83('0x7')][_0x9a83('0x8')]({'where':{'id':_0x88f549}})['then'](function(_0x160697){_0x2e7c15=_0x160697;return Promise[_0x9a83('0x19')](_0x2e7c15[_0x9a83('0xf')](function(_0xc5ced9){return _0xc5ced9[_0x9a83('0x1a')](_0x5ba700);}));})[_0x9a83('0x11')](function(_0x143b76){var _0x11e55c=_0x143b76[_0x9a83('0x1b')](function(_0x3b8fdd,_0x3ff409){return _0x3b8fdd||_0x3ff409;},![]);logger['info'](util[_0x9a83('0x1c')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x2e7c15[_0x9a83('0xf')](function(_0x25fe2e){return _0x25fe2e[_0x9a83('0x1d')];})[_0x9a83('0x1e')](',\x20'),_0x2e7c15['map'](function(_0x5aa7cf){return _0x5aa7cf['id'];})[_0x9a83('0x1e')](',\x20')));return _0x11e55c;});}function checkSingleInterval(_0x4d6dc5,_0x1cce13){return db[_0x9a83('0x7')]['findById'](_0x4d6dc5)[_0x9a83('0x11')](function(_0x277a48){if(_0x277a48){logger[_0x9a83('0x12')](util[_0x9a83('0x1c')](_0x9a83('0x1f'),_0x277a48['name'],_0x277a48['id']));return _0x277a48[_0x9a83('0x1a')](_0x1cce13);}});}exports[_0x9a83('0x20')]=function(_0x25c564){var _0x5a6ce7=_0x25c564[_0x9a83('0x21')];var _0x490504=Array['isArray'](_0x25c564[_0x9a83('0x22')])?_0x25c564[_0x9a83('0x22')]:typeof _0x25c564[_0x9a83('0x22')]===_0x9a83('0x23')?[_0x25c564[_0x9a83('0x22')]]:[];var _0x124720=_0x25c564[_0x9a83('0x24')]||undefined;var _0x4a5702=![];if(_0x490504['length']){logger[_0x9a83('0x12')](util[_0x9a83('0x1c')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x490504[_0x9a83('0x1e')](';\x20')));}if(_0x124720){logger[_0x9a83('0x12')](util[_0x9a83('0x1c')](_0x9a83('0x25'),_0x124720));}logger['debug'](_0x9a83('0x26'),_0x4a5702);logger[_0x9a83('0x27')]('IntervalIftime',_0x25c564);return Promise[_0x9a83('0x28')]()['then'](function(){if(Array[_0x9a83('0x29')](_0x5a6ce7)){return checkArrayOfIntervals(_0x5a6ce7,_0x124720);}else if(_0x5a6ce7){return checkSingleInterval(_0x5a6ce7,_0x124720);}})[_0x9a83('0x11')](function(_0x281f16){var _0x2846e2=_0x490504[_0x9a83('0x1b')](function(_0xe8355d,_0x4cb19d){return _0xe8355d||iftime(_0x4cb19d,_0x124720);},![]);_0x4a5702=_0x281f16||_0x2846e2;return _0x4a5702;})[_0x9a83('0x15')](function(_0x4bb0d2){logger[_0x9a83('0x16')](_0x9a83('0x20'),_0x25c564,_0x4bb0d2);throw this['error'](0x1f4,_0x4bb0d2[_0x9a83('0x17')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index c03d15e..27f7712 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x14aab5,_0x5328b8){var _0x19e794=function(_0x42cd5f){while(--_0x42cd5f){_0x14aab5['push'](_0x14aab5['shift']());}};_0x19e794(++_0x5328b8);}(_0xdb28,0x106));var _0x8db2=function(_0x5cec24,_0x570a65){_0x5cec24=_0x5cec24-0x0;var _0x592f2c=_0xdb28[_0x5cec24];return _0x592f2c;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file +var _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xb10b,0x12a));var _0xbb10=function(_0xa7662e,_0x22304d){_0xa7662e=_0xa7662e-0x0;var _0x425053=_0xb10b[_0xa7662e];return _0x425053;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index c9804a4..4aa1ff4 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 _0xf686=['key','MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','fields','email','customfield_11501','oldToken','newToken','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','base64','request','setEncoding','utf8','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','headers','remoteAddress','socket','connection','body','https','support','3eAmWpBVP0'];(function(_0x5ceba2,_0x171562){var _0xaed6b5=function(_0x451744){while(--_0x451744){_0x5ceba2['push'](_0x5ceba2['shift']());}};_0xaed6b5(++_0x171562);}(_0xf686,0xd9));var _0x6f68=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf686[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require('bluebird');var https=require(_0x6f68('0x0'));var logger=require('../../config/logger')('api');var USERNAME=_0x6f68('0x1');var PASSWORD=_0x6f68('0x2');function openIssue(_0x48e093,_0x402bd5){var _0x3e0436={'fields':{'project':{'key':_0x48e093[_0x6f68('0x3')]||_0x6f68('0x4')},'summary':(_0x48e093[_0x6f68('0x5')]||_0x6f68('0x6'))+_0x6f68('0x7')+_0x48e093['ip'],'description':_0x48e093[_0x6f68('0x8')]||JSON[_0x6f68('0x9')](_0x48e093),'issuetype':{'name':_0x48e093['issuetype']||_0x6f68('0xa')}}};_0x3e0436[_0x6f68('0xb')]['customfield_11500']=_0x48e093[_0x6f68('0xc')];_0x3e0436[_0x6f68('0xb')][_0x6f68('0xd')]=_0x48e093[_0x6f68('0xe')];_0x3e0436['fields']['customfield_11502']=_0x48e093[_0x6f68('0xf')];_0x3e0436[_0x6f68('0xb')]['customfield_11503']=_0x48e093[_0x6f68('0x10')];_0x3e0436['fields'][_0x6f68('0x11')]=_0x48e093[_0x6f68('0x12')];_0x3e0436[_0x6f68('0xb')][_0x6f68('0x13')]=_0x48e093['ip'];var _0x4ed45b={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x6f68('0x14'),'method':_0x6f68('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x6f68('0x16'),'Authorization':_0x6f68('0x17')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x6f68('0x18'))}};var _0x201029=JSON[_0x6f68('0x9')](_0x3e0436);var _0x2bff7b=https[_0x6f68('0x19')](_0x4ed45b,function(_0x2ed2e7){_0x2ed2e7[_0x6f68('0x1a')](_0x6f68('0x1b'));var _0x1ce164='';_0x2ed2e7['on']('data',function(_0x4dd947){_0x1ce164+=_0x4dd947;});_0x2ed2e7['on'](_0x6f68('0x1c'),function(){if(_0x402bd5){return _0x402bd5[_0x6f68('0x1d')](_0x2ed2e7[_0x6f68('0x1e')])[_0x6f68('0x1f')](JSON[_0x6f68('0x20')](_0x1ce164));}});});_0x2bff7b['on'](_0x6f68('0x21'),function(_0x4627a8){if(_0x402bd5){return _0x402bd5[_0x6f68('0x1d')](0x1f4)[_0x6f68('0x1f')]({'errors':[{'message':_0x6f68('0x22'),'type':_0x6f68('0x23')}]});}});_0x2bff7b[_0x6f68('0x24')](_0x201029);_0x2bff7b[_0x6f68('0x1c')]();}exports[_0x6f68('0x25')]=openIssue;exports[_0x6f68('0x26')]=function(_0x473beb,_0x21d96f){_0x473beb['body']['ip']=_0x473beb[_0x6f68('0x27')]['x-forwarded-for']||_0x473beb['connection'][_0x6f68('0x28')]||_0x473beb[_0x6f68('0x29')][_0x6f68('0x28')]||_0x473beb[_0x6f68('0x2a')][_0x6f68('0x29')][_0x6f68('0x28')];return openIssue(_0x473beb[_0x6f68('0x2b')],_0x21d96f);}; \ No newline at end of file +var _0xc462=['support','key','MOTGUI','summary','Report','description','issuetype','Bug','customfield_11500','email','fields','customfield_11501','oldToken','newToken','name','customfield_11504','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64','stringify','request','setEncoding','utf8','data','statusCode','json','parse','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','end','openIssue','send','body','headers','x-forwarded-for','connection','socket','remoteAddress','https','../../config/logger','api'];(function(_0x305a5b,_0x242353){var _0x206760=function(_0x41f8d5){while(--_0x41f8d5){_0x305a5b['push'](_0x305a5b['shift']());}};_0x206760(++_0x242353);}(_0xc462,0x105));var _0x2c46=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc462[_0x1caf6a];return _0x1bf493;};'use strict';var BPromise=require('bluebird');var https=require(_0x2c46('0x0'));var logger=require(_0x2c46('0x1'))(_0x2c46('0x2'));var USERNAME=_0x2c46('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x2e1984,_0x15b90b){var _0x318de5={'fields':{'project':{'key':_0x2e1984[_0x2c46('0x4')]||_0x2c46('0x5')},'summary':(_0x2e1984[_0x2c46('0x6')]||_0x2c46('0x7'))+'\x20from\x20'+_0x2e1984['ip'],'description':_0x2e1984[_0x2c46('0x8')]||JSON['stringify'](_0x2e1984),'issuetype':{'name':_0x2e1984[_0x2c46('0x9')]||_0x2c46('0xa')}}};_0x318de5['fields'][_0x2c46('0xb')]=_0x2e1984[_0x2c46('0xc')];_0x318de5[_0x2c46('0xd')][_0x2c46('0xe')]=_0x2e1984[_0x2c46('0xf')];_0x318de5[_0x2c46('0xd')]['customfield_11502']=_0x2e1984[_0x2c46('0x10')];_0x318de5[_0x2c46('0xd')]['customfield_11503']=_0x2e1984[_0x2c46('0x11')];_0x318de5[_0x2c46('0xd')][_0x2c46('0x12')]=_0x2e1984['reason'];_0x318de5['fields']['customfield_10102']=_0x2e1984['ip'];var _0x3889c9={'host':_0x2c46('0x13'),'port':0x1bb,'path':_0x2c46('0x14'),'method':_0x2c46('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x2c46('0x16'),'Authorization':_0x2c46('0x17')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x2c46('0x18'))}};var _0x1ea608=JSON[_0x2c46('0x19')](_0x318de5);var _0x1f1c63=https[_0x2c46('0x1a')](_0x3889c9,function(_0x31bcac){_0x31bcac[_0x2c46('0x1b')](_0x2c46('0x1c'));var _0x1a33e5='';_0x31bcac['on'](_0x2c46('0x1d'),function(_0x191533){_0x1a33e5+=_0x191533;});_0x31bcac['on']('end',function(){if(_0x15b90b){return _0x15b90b['status'](_0x31bcac[_0x2c46('0x1e')])[_0x2c46('0x1f')](JSON[_0x2c46('0x20')](_0x1a33e5));}});});_0x1f1c63['on']('error',function(_0x2fdb1c){if(_0x15b90b){return _0x15b90b[_0x2c46('0x21')](0x1f4)[_0x2c46('0x1f')]({'errors':[{'message':_0x2c46('0x22'),'type':'api.jira'}]});}});_0x1f1c63['write'](_0x1ea608);_0x1f1c63[_0x2c46('0x23')]();}exports[_0x2c46('0x24')]=openIssue;exports[_0x2c46('0x25')]=function(_0x9a6f7c,_0x42d74b){_0x9a6f7c[_0x2c46('0x26')]['ip']=_0x9a6f7c[_0x2c46('0x27')][_0x2c46('0x28')]||_0x9a6f7c[_0x2c46('0x29')]['remoteAddress']||_0x9a6f7c[_0x2c46('0x2a')]['remoteAddress']||_0x9a6f7c['connection'][_0x2c46('0x2a')][_0x2c46('0x2b')];return openIssue(_0x9a6f7c[_0x2c46('0x26')],_0x42d74b);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 5c14cc3..2e10400 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 _0x750a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','exports','util','express','Router'];(function(_0xc29019,_0x4c1f3b){var _0x25bdf4=function(_0xaf0bba){while(--_0xaf0bba){_0xc29019['push'](_0xc29019['shift']());}};_0x25bdf4(++_0x4c1f3b);}(_0x750a,0x140));var _0xa750=function(_0x10c398,_0x5ad5fd){_0x10c398=_0x10c398-0x0;var _0x3ab5b3=_0x750a[_0x10c398];return _0x3ab5b3;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['describe']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0xe')]('/',auth['isAuthenticated'](),controller[_0xa750('0xf')]);router[_0xa750('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa750('0x11')]);router['delete'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['destroy']);module[_0xa750('0x12')]=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(_0x537ca8,_0x164682){var _0x39db0b=function(_0x180d90){while(--_0x180d90){_0x537ca8['push'](_0x537ca8['shift']());}};_0x39db0b(++_0x164682);}(_0xe706,0xa3));var _0x6e70=function(_0x4d4f61,_0x56d7a7){_0x4d4f61=_0x4d4f61-0x0;var _0x297414=_0xe706[_0x4d4f61];return _0x297414;};'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 5cc6f99..82f137f 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(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7a54,0x106));var _0x47a5=function(_0x1f06af,_0x159b03){_0x1f06af=_0x1f06af-0x0;var _0x46f8d7=_0x7a54[_0x1f06af];return _0x46f8d7;};'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(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7a54,0x106));var _0x47a5=function(_0x1cfdfc,_0x418fd3){_0x1cfdfc=_0x1cfdfc-0x0;var _0x156329=_0x7a54[_0x1cfdfc];return _0x156329;};'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 dff9805..04d7f4b 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 _0x2675=['limit','count','Content-Range','json','apply','reject','destroy','then','error','name','send','index','map','JscriptyAnswerReport','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','length','options','find','create','body','update','params','describe','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x2cb046,_0x11465d){var _0x2fa703=function(_0x5300db){while(--_0x5300db){_0x2cb046['push'](_0x2cb046['shift']());}};_0x2fa703(++_0x11465d);}(_0x2675,0x75));var _0x5267=function(_0x32b2cc,_0x1f5116){_0x32b2cc=_0x32b2cc-0x0;var _0x39bc4c=_0x2675[_0x32b2cc];return _0x39bc4c;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];function respondWithStatusCode(_0x1f9be3,_0x1d7090){_0x1d7090=_0x1d7090||0xcc;return function(_0x1171b9){if(_0x1171b9){return _0x1f9be3[_0x5267('0x16')](_0x1d7090);}return _0x1f9be3[_0x5267('0x17')](_0x1d7090)[_0x5267('0x18')]();};}function respondWithResult(_0x1e2d3b,_0x16e5a7){_0x16e5a7=_0x16e5a7||0xc8;return function(_0x29349a){if(_0x29349a){return _0x1e2d3b[_0x5267('0x17')](_0x16e5a7)['json'](_0x29349a);}};}function respondWithFilteredResult(_0x52e24e,_0xa593fb){return function(_0x40d897){if(_0x40d897){var _0x38a147=typeof _0xa593fb[_0x5267('0x19')]===_0x5267('0x1a')&&typeof _0xa593fb[_0x5267('0x1b')]===_0x5267('0x1a');var _0x6831e0=_0x40d897[_0x5267('0x1c')];var _0xb1c97a=_0x38a147?0x0:_0xa593fb[_0x5267('0x19')];var _0x1ab03=_0x38a147?_0x40d897['count']:_0xa593fb[_0x5267('0x19')]+_0xa593fb[_0x5267('0x1b')];var _0x5069e8;if(_0x1ab03>=_0x6831e0){_0x1ab03=_0x6831e0;_0x5069e8=0xc8;}else{_0x5069e8=0xce;}_0x52e24e[_0x5267('0x17')](_0x5069e8);return _0x52e24e['set'](_0x5267('0x1d'),_0xb1c97a+'-'+_0x1ab03+'/'+_0x6831e0)[_0x5267('0x1e')](_0x40d897);}return null;};}function patchUpdates(_0x39c0c3){return function(_0x2a9f99){try{jsonpatch[_0x5267('0x1f')](_0x2a9f99,_0x39c0c3,!![]);}catch(_0x4dd637){return BPromise[_0x5267('0x20')](_0x4dd637);}return _0x2a9f99['save']();};}function saveUpdates(_0xa32663,_0x420fb8){return function(_0x3b53ac){if(_0x3b53ac){return _0x3b53ac['update'](_0xa32663)['then'](function(_0x5546e2){return _0x5546e2;});}return null;};}function removeEntity(_0x4a17c7,_0x5ea6a6){return function(_0x26c7f8){if(_0x26c7f8){return _0x26c7f8[_0x5267('0x21')]()[_0x5267('0x22')](function(){_0x4a17c7[_0x5267('0x17')](0xcc)[_0x5267('0x18')]();});}};}function handleEntityNotFound(_0x40d1be,_0x126a97){return function(_0x220e03){if(!_0x220e03){_0x40d1be[_0x5267('0x16')](0x194);}return _0x220e03;};}function handleError(_0x59f112,_0x5cb64f){_0x5cb64f=_0x5cb64f||0x1f4;return function(_0x354111){logger[_0x5267('0x23')](_0x354111['stack']);if(_0x354111[_0x5267('0x24')]){delete _0x354111['name'];}_0x59f112['status'](_0x5cb64f)[_0x5267('0x25')](_0x354111);};}exports[_0x5267('0x26')]=function(_0x1f33b7,_0x2d2ace){var _0x33c431={},_0x4f3d4d={},_0x5e87eb={'count':0x0,'rows':[]};var _0x18020c=_[_0x5267('0x27')](db[_0x5267('0x28')]['rawAttributes'],function(_0x58d685){return{'name':_0x58d685[_0x5267('0x29')],'type':_0x58d685[_0x5267('0x2a')][_0x5267('0x2b')]};});_0x4f3d4d['model']=_['map'](_0x18020c,_0x5267('0x24'));_0x4f3d4d[_0x5267('0x2c')]=_[_0x5267('0x2d')](_0x1f33b7[_0x5267('0x2c')]);_0x4f3d4d['filters']=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],_0x4f3d4d[_0x5267('0x2c')]);_0x33c431[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],qs[_0x5267('0x31')](_0x1f33b7[_0x5267('0x2c')]['fields']));_0x33c431['attributes']=_0x33c431[_0x5267('0x30')]['length']?_0x33c431[_0x5267('0x30')]:_0x4f3d4d[_0x5267('0x2f')];if(!_0x1f33b7[_0x5267('0x2c')][_0x5267('0x32')]('nolimit')){_0x33c431[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x1b')]);_0x33c431[_0x5267('0x19')]=qs[_0x5267('0x19')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x19')]);}_0x33c431['order']=qs[_0x5267('0x33')](_0x1f33b7['query'][_0x5267('0x33')]);_0x33c431[_0x5267('0x34')]=qs[_0x5267('0x35')](_[_0x5267('0x36')](_0x1f33b7[_0x5267('0x2c')],_0x4f3d4d[_0x5267('0x35')]),_0x18020c);if(_0x1f33b7[_0x5267('0x2c')]['filter']){_0x33c431[_0x5267('0x34')]=_[_0x5267('0x37')](_0x33c431[_0x5267('0x34')],{'$or':_[_0x5267('0x27')](_0x18020c,function(_0x82cea7){if(_0x82cea7[_0x5267('0x2a')]!==_0x5267('0x38')){var _0x487dfc={};_0x487dfc[_0x82cea7[_0x5267('0x24')]]={'$like':'%'+_0x1f33b7['query'][_0x5267('0x39')]+'%'};return _0x487dfc;}})});}_0x33c431=_['merge']({},_0x33c431,_0x1f33b7['options']);var _0x51bddd={'where':_0x33c431[_0x5267('0x34')]};return db['JscriptyAnswerReport'][_0x5267('0x1c')](_0x51bddd)[_0x5267('0x22')](function(_0x3d4b19){_0x5e87eb[_0x5267('0x1c')]=_0x3d4b19;if(_0x1f33b7['query'][_0x5267('0x3a')]){_0x33c431[_0x5267('0x3b')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x33c431);})[_0x5267('0x22')](function(_0x560cdf){_0x5e87eb[_0x5267('0x3c')]=_0x560cdf;return _0x5e87eb;})[_0x5267('0x22')](respondWithFilteredResult(_0x2d2ace,_0x33c431))[_0x5267('0x3d')](handleError(_0x2d2ace,null));};exports[_0x5267('0x3e')]=function(_0x36d0f1,_0x3012cb){var _0x27add5={'raw':!![],'where':{'id':_0x36d0f1['params']['id']}},_0x5697b3={};_0x5697b3[_0x5267('0x2f')]=_['keys'](db[_0x5267('0x28')][_0x5267('0x3f')]);_0x5697b3['query']=_[_0x5267('0x2d')](_0x36d0f1[_0x5267('0x2c')]);_0x5697b3[_0x5267('0x35')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],_0x5697b3[_0x5267('0x2c')]);_0x27add5[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],qs['fields'](_0x36d0f1[_0x5267('0x2c')][_0x5267('0x31')]));_0x27add5[_0x5267('0x30')]=_0x27add5[_0x5267('0x30')][_0x5267('0x40')]?_0x27add5['attributes']:_0x5697b3[_0x5267('0x2f')];if(_0x36d0f1['query'][_0x5267('0x3a')]){_0x27add5['include']=[{'all':!![]}];}_0x27add5=_['merge']({},_0x27add5,_0x36d0f1[_0x5267('0x41')]);return db['JscriptyAnswerReport'][_0x5267('0x42')](_0x27add5)[_0x5267('0x22')](handleEntityNotFound(_0x3012cb,null))[_0x5267('0x22')](respondWithResult(_0x3012cb,null))[_0x5267('0x3d')](handleError(_0x3012cb,null));};exports['create']=function(_0x12d6a8,_0x4ee826){return db['JscriptyAnswerReport'][_0x5267('0x43')](_0x12d6a8[_0x5267('0x44')],{})['then'](respondWithResult(_0x4ee826,0xc9))['catch'](handleError(_0x4ee826,null));};exports[_0x5267('0x45')]=function(_0xe0439e,_0x3d2436){if(_0xe0439e[_0x5267('0x44')]['id']){delete _0xe0439e[_0x5267('0x44')]['id'];}return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'id':_0xe0439e[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x3d2436,null))[_0x5267('0x22')](saveUpdates(_0xe0439e[_0x5267('0x44')],null))[_0x5267('0x22')](respondWithResult(_0x3d2436,null))[_0x5267('0x3d')](handleError(_0x3d2436,null));};exports[_0x5267('0x21')]=function(_0x4f7f75,_0x8636d0){return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'id':_0x4f7f75['params']['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x8636d0,null))[_0x5267('0x22')](removeEntity(_0x8636d0,null))[_0x5267('0x3d')](handleError(_0x8636d0,null));};exports[_0x5267('0x47')]=function(_0x119546,_0x1457cf){return db['JscriptyAnswerReport'][_0x5267('0x47')]()['then'](respondWithResult(_0x1457cf,null))[_0x5267('0x3d')](handleError(_0x1457cf,null));}; \ No newline at end of file +var _0xdb94=['keys','find','create','body','destroy','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','sort','pick','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch'];(function(_0x3103ef,_0x2bc529){var _0x1d75c7=function(_0x348dbc){while(--_0x348dbc){_0x3103ef['push'](_0x3103ef['shift']());}};_0x1d75c7(++_0x2bc529);}(_0xdb94,0xe5));var _0x4db9=function(_0x338825,_0x30963a){_0x338825=_0x338825-0x0;var _0x559dfb=_0xdb94[_0x338825];return _0x559dfb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4db9('0x0'));var zipdir=require(_0x4db9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4db9('0x2'));var moment=require(_0x4db9('0x3'));var BPromise=require(_0x4db9('0x4'));var Mustache=require(_0x4db9('0x5'));var util=require(_0x4db9('0x6'));var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require(_0x4db9('0x8'));var fs=require('fs');var fs_extra=require(_0x4db9('0x9'));var _=require(_0x4db9('0xa'));var squel=require(_0x4db9('0xb'));var crypto=require(_0x4db9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4db9('0xd'));var toCsv=require(_0x4db9('0xe'));var querystring=require(_0x4db9('0xf'));var Papa=require(_0x4db9('0x10'));var Redis=require(_0x4db9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4db9('0x12'));var as=require(_0x4db9('0x13'));var hardwareService=require(_0x4db9('0x14'));var logger=require(_0x4db9('0x15'))(_0x4db9('0x16'));var utils=require(_0x4db9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4db9('0x18'));var db=require(_0x4db9('0x19'))['db'];function respondWithStatusCode(_0x59f01c,_0x549c92){_0x549c92=_0x549c92||0xcc;return function(_0x19f2d3){if(_0x19f2d3){return _0x59f01c[_0x4db9('0x1a')](_0x549c92);}return _0x59f01c[_0x4db9('0x1b')](_0x549c92)['end']();};}function respondWithResult(_0x1a93be,_0x3dde55){_0x3dde55=_0x3dde55||0xc8;return function(_0x2018d2){if(_0x2018d2){return _0x1a93be[_0x4db9('0x1b')](_0x3dde55)[_0x4db9('0x1c')](_0x2018d2);}};}function respondWithFilteredResult(_0x585230,_0x1b1062){return function(_0x1a5a9c){if(_0x1a5a9c){var _0x5d4d70=typeof _0x1b1062[_0x4db9('0x1d')]===_0x4db9('0x1e')&&typeof _0x1b1062[_0x4db9('0x1f')]==='undefined';var _0xedc513=_0x1a5a9c[_0x4db9('0x20')];var _0x4c5f4f=_0x5d4d70?0x0:_0x1b1062['offset'];var _0x493923=_0x5d4d70?_0x1a5a9c[_0x4db9('0x20')]:_0x1b1062[_0x4db9('0x1d')]+_0x1b1062['limit'];var _0x375515;if(_0x493923>=_0xedc513){_0x493923=_0xedc513;_0x375515=0xc8;}else{_0x375515=0xce;}_0x585230[_0x4db9('0x1b')](_0x375515);return _0x585230[_0x4db9('0x21')](_0x4db9('0x22'),_0x4c5f4f+'-'+_0x493923+'/'+_0xedc513)[_0x4db9('0x1c')](_0x1a5a9c);}return null;};}function patchUpdates(_0x28b7f6){return function(_0x34a6ed){try{jsonpatch[_0x4db9('0x23')](_0x34a6ed,_0x28b7f6,!![]);}catch(_0x3256f4){return BPromise[_0x4db9('0x24')](_0x3256f4);}return _0x34a6ed[_0x4db9('0x25')]();};}function saveUpdates(_0x102402,_0x4d56a1){return function(_0x42cc40){if(_0x42cc40){return _0x42cc40[_0x4db9('0x26')](_0x102402)['then'](function(_0x37c81f){return _0x37c81f;});}return null;};}function removeEntity(_0x3f4931,_0x4419af){return function(_0x402898){if(_0x402898){return _0x402898['destroy']()[_0x4db9('0x27')](function(){_0x3f4931['status'](0xcc)[_0x4db9('0x28')]();});}};}function handleEntityNotFound(_0x1c82b6,_0x135aa7){return function(_0x47e89c){if(!_0x47e89c){_0x1c82b6[_0x4db9('0x1a')](0x194);}return _0x47e89c;};}function handleError(_0x622db6,_0x47464d){_0x47464d=_0x47464d||0x1f4;return function(_0x5e7d29){logger['error'](_0x5e7d29[_0x4db9('0x29')]);if(_0x5e7d29['name']){delete _0x5e7d29[_0x4db9('0x2a')];}_0x622db6[_0x4db9('0x1b')](_0x47464d)[_0x4db9('0x2b')](_0x5e7d29);};}exports[_0x4db9('0x2c')]=function(_0x384df5,_0x3c3fcf){var _0x1d0dc2={},_0x373a7d={},_0x4c4a47={'count':0x0,'rows':[]};var _0x35f757=_['map'](db[_0x4db9('0x2d')][_0x4db9('0x2e')],function(_0x1e7840){return{'name':_0x1e7840[_0x4db9('0x2f')],'type':_0x1e7840[_0x4db9('0x30')]['key']};});_0x373a7d[_0x4db9('0x31')]=_[_0x4db9('0x32')](_0x35f757,_0x4db9('0x2a'));_0x373a7d[_0x4db9('0x33')]=_['keys'](_0x384df5['query']);_0x373a7d[_0x4db9('0x34')]=_[_0x4db9('0x35')](_0x373a7d['model'],_0x373a7d['query']);_0x1d0dc2[_0x4db9('0x36')]=_['intersection'](_0x373a7d['model'],qs[_0x4db9('0x37')](_0x384df5[_0x4db9('0x33')]['fields']));_0x1d0dc2[_0x4db9('0x36')]=_0x1d0dc2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x1d0dc2[_0x4db9('0x36')]:_0x373a7d['model'];if(!_0x384df5[_0x4db9('0x33')]['hasOwnProperty']('nolimit')){_0x1d0dc2['limit']=qs[_0x4db9('0x1f')](_0x384df5[_0x4db9('0x33')]['limit']);_0x1d0dc2[_0x4db9('0x1d')]=qs[_0x4db9('0x1d')](_0x384df5['query']['offset']);}_0x1d0dc2['order']=qs[_0x4db9('0x39')](_0x384df5['query'][_0x4db9('0x39')]);_0x1d0dc2['where']=qs[_0x4db9('0x34')](_[_0x4db9('0x3a')](_0x384df5[_0x4db9('0x33')],_0x373a7d[_0x4db9('0x34')]),_0x35f757);if(_0x384df5[_0x4db9('0x33')]['filter']){_0x1d0dc2[_0x4db9('0x3b')]=_['merge'](_0x1d0dc2[_0x4db9('0x3b')],{'$or':_[_0x4db9('0x32')](_0x35f757,function(_0x15929e){if(_0x15929e[_0x4db9('0x30')]!==_0x4db9('0x3c')){var _0x4159d2={};_0x4159d2[_0x15929e['name']]={'$like':'%'+_0x384df5[_0x4db9('0x33')][_0x4db9('0x3d')]+'%'};return _0x4159d2;}})});}_0x1d0dc2=_['merge']({},_0x1d0dc2,_0x384df5['options']);var _0x404af3={'where':_0x1d0dc2[_0x4db9('0x3b')]};return db[_0x4db9('0x2d')][_0x4db9('0x20')](_0x404af3)[_0x4db9('0x27')](function(_0x36a648){_0x4c4a47[_0x4db9('0x20')]=_0x36a648;if(_0x384df5[_0x4db9('0x33')][_0x4db9('0x3e')]){_0x1d0dc2[_0x4db9('0x3f')]=[{'all':!![]}];}return db[_0x4db9('0x2d')][_0x4db9('0x40')](_0x1d0dc2);})['then'](function(_0x2716d6){_0x4c4a47[_0x4db9('0x41')]=_0x2716d6;return _0x4c4a47;})[_0x4db9('0x27')](respondWithFilteredResult(_0x3c3fcf,_0x1d0dc2))[_0x4db9('0x42')](handleError(_0x3c3fcf,null));};exports['show']=function(_0x57d32d,_0x248891){var _0x2b18a2={'raw':!![],'where':{'id':_0x57d32d['params']['id']}},_0x2fc233={};_0x2fc233[_0x4db9('0x31')]=_['keys'](db[_0x4db9('0x2d')][_0x4db9('0x2e')]);_0x2fc233[_0x4db9('0x33')]=_[_0x4db9('0x43')](_0x57d32d[_0x4db9('0x33')]);_0x2fc233['filters']=_[_0x4db9('0x35')](_0x2fc233[_0x4db9('0x31')],_0x2fc233[_0x4db9('0x33')]);_0x2b18a2[_0x4db9('0x36')]=_[_0x4db9('0x35')](_0x2fc233['model'],qs[_0x4db9('0x37')](_0x57d32d[_0x4db9('0x33')][_0x4db9('0x37')]));_0x2b18a2[_0x4db9('0x36')]=_0x2b18a2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x2b18a2[_0x4db9('0x36')]:_0x2fc233[_0x4db9('0x31')];if(_0x57d32d[_0x4db9('0x33')]['includeAll']){_0x2b18a2[_0x4db9('0x3f')]=[{'all':!![]}];}_0x2b18a2=_['merge']({},_0x2b18a2,_0x57d32d['options']);return db[_0x4db9('0x2d')][_0x4db9('0x44')](_0x2b18a2)['then'](handleEntityNotFound(_0x248891,null))['then'](respondWithResult(_0x248891,null))[_0x4db9('0x42')](handleError(_0x248891,null));};exports[_0x4db9('0x45')]=function(_0x3fc788,_0x7f0aac){return db[_0x4db9('0x2d')][_0x4db9('0x45')](_0x3fc788[_0x4db9('0x46')],{})[_0x4db9('0x27')](respondWithResult(_0x7f0aac,0xc9))[_0x4db9('0x42')](handleError(_0x7f0aac,null));};exports[_0x4db9('0x26')]=function(_0x43312c,_0x5495de){if(_0x43312c[_0x4db9('0x46')]['id']){delete _0x43312c[_0x4db9('0x46')]['id'];}return db['JscriptyAnswerReport'][_0x4db9('0x44')]({'where':{'id':_0x43312c['params']['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x5495de,null))[_0x4db9('0x27')](saveUpdates(_0x43312c[_0x4db9('0x46')],null))[_0x4db9('0x27')](respondWithResult(_0x5495de,null))[_0x4db9('0x42')](handleError(_0x5495de,null));};exports[_0x4db9('0x47')]=function(_0x3f1aac,_0x3b8d8c){return db[_0x4db9('0x2d')][_0x4db9('0x44')]({'where':{'id':_0x3f1aac[_0x4db9('0x48')]['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x3b8d8c,null))[_0x4db9('0x27')](removeEntity(_0x3b8d8c,null))['catch'](handleError(_0x3b8d8c,null));};exports['describe']=function(_0x5ececc,_0x161e2e){return db['JscriptyAnswerReport'][_0x4db9('0x49')]()['then'](respondWithResult(_0x161e2e,null))[_0x4db9('0x42')](handleError(_0x161e2e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index dad3097..9c1a286 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 _0xcaa5=['moment','path','rimraf','../../config/environment','exports','lodash','util','../../config/logger','api'];(function(_0x3a6a19,_0x500313){var _0xce7903=function(_0x121818){while(--_0x121818){_0x3a6a19['push'](_0x3a6a19['shift']());}};_0xce7903(++_0x500313);}(_0xcaa5,0x152));var _0x5caa=function(_0x1d5ccb,_0x136776){_0x1d5ccb=_0x1d5ccb-0x0;var _0x49fc07=_0xcaa5[_0x1d5ccb];return _0x49fc07;};'use strict';var _=require(_0x5caa('0x0'));var util=require(_0x5caa('0x1'));var logger=require(_0x5caa('0x2'))(_0x5caa('0x3'));var moment=require(_0x5caa('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5caa('0x5'));var rimraf=require(_0x5caa('0x6'));var config=require(_0x5caa('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x5caa('0x8')]=function(_0x3465ad,_0x1c6b77){return _0x3465ad['define']('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32e6=['../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0x4705f2,_0xaf76c1){var _0x14cf55=function(_0x290108){while(--_0x290108){_0x4705f2['push'](_0x4705f2['shift']());}};_0x14cf55(++_0xaf76c1);}(_0x32e6,0x144));var _0x632e=function(_0x238e24,_0x3c9aa3){_0x238e24=_0x238e24-0x0;var _0x28a23f=_0x32e6[_0x238e24];return _0x28a23f;};'use strict';var _=require(_0x632e('0x0'));var util=require(_0x632e('0x1'));var logger=require('../../config/logger')(_0x632e('0x2'));var moment=require('moment');var BPromise=require(_0x632e('0x3'));var rp=require(_0x632e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x632e('0x5'));var config=require(_0x632e('0x6'));var attributes=require(_0x632e('0x7'));module[_0x632e('0x8')]=function(_0xb21656,_0x3df9c9){return _0xb21656['define'](_0x632e('0x9'),attributes,{'tableName':_0x632e('0xa'),'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 4f193e6..37a50a1 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 _0x648f=['request\x20sent','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x648f,0x124));var _0xf648=function(_0x301148,_0x25b884){_0x301148=_0x301148-0x0;var _0x42ce24=_0x648f[_0x301148];return _0x42ce24;};'use strict';var _=require('lodash');var util=require(_0xf648('0x0'));var moment=require(_0xf648('0x1'));var BPromise=require(_0xf648('0x2'));var rs=require(_0xf648('0x3'));var fs=require('fs');var Redis=require(_0xf648('0x4'));var db=require(_0xf648('0x5'))['db'];var utils=require(_0xf648('0x6'));var logger=require(_0xf648('0x7'))(_0xf648('0x8'));var config=require(_0xf648('0x9'));var jayson=require(_0xf648('0xa'));var client=jayson['client'][_0xf648('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x394d25,_0x41da33,_0xe0e416){return new BPromise(function(_0x56e4d7,_0x4bbb06){return client[_0xf648('0xc')](_0x394d25,_0xe0e416)[_0xf648('0xd')](function(_0x2324fa){logger['info'](_0xf648('0xe'),_0x41da33,'request\x20sent');logger['debug'](_0xf648('0xf'),_0x41da33,_0xf648('0x10'),JSON['stringify'](_0x2324fa));if(_0x2324fa[_0xf648('0x11')]){if(_0x2324fa[_0xf648('0x11')][_0xf648('0x12')]===0x1f4){logger[_0xf648('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x41da33,_0x2324fa[_0xf648('0x11')][_0xf648('0x13')]);return _0x4bbb06(_0x2324fa[_0xf648('0x11')]['message']);}logger[_0xf648('0x11')](_0xf648('0xe'),_0x41da33,_0x2324fa[_0xf648('0x11')][_0xf648('0x13')]);return _0x56e4d7(_0x2324fa['error']['message']);}else{logger[_0xf648('0x14')](_0xf648('0xe'),_0x41da33,_0xf648('0x10'));_0x56e4d7(_0x2324fa[_0xf648('0x15')][_0xf648('0x13')]);}})['catch'](function(_0x5f5ddd){logger['error'](_0xf648('0xe'),_0x41da33,_0x5f5ddd);_0x4bbb06(_0x5f5ddd);});});} \ No newline at end of file +var _0xb25c=['../../mysqldb','../../config/logger','rpc','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x4a5a88,_0x1927f5){var _0x13dce4=function(_0x1b1f7f){while(--_0x1b1f7f){_0x4a5a88['push'](_0x4a5a88['shift']());}};_0x13dce4(++_0x1927f5);}(_0xb25c,0xb8));var _0xcb25=function(_0x5847ca,_0x11150f){_0x5847ca=_0x5847ca-0x0;var _0x331b65=_0xb25c[_0x5847ca];return _0x331b65;};'use strict';var _=require(_0xcb25('0x0'));var util=require(_0xcb25('0x1'));var moment=require(_0xcb25('0x2'));var BPromise=require(_0xcb25('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb25('0x4'));var db=require(_0xcb25('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb25('0x6'))(_0xcb25('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcb25('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x91f837,_0x476bb6,_0x514735){return new BPromise(function(_0x29af81,_0x29de7f){return client[_0xcb25('0x9')](_0x91f837,_0x514735)[_0xcb25('0xa')](function(_0x403f1b){logger[_0xcb25('0xb')](_0xcb25('0xc'),_0x476bb6,_0xcb25('0xd'));logger[_0xcb25('0xe')](_0xcb25('0xf'),_0x476bb6,_0xcb25('0xd'),JSON['stringify'](_0x403f1b));if(_0x403f1b[_0xcb25('0x10')]){if(_0x403f1b['error'][_0xcb25('0x11')]===0x1f4){logger[_0xcb25('0x10')](_0xcb25('0xc'),_0x476bb6,_0x403f1b['error'][_0xcb25('0x12')]);return _0x29de7f(_0x403f1b[_0xcb25('0x10')][_0xcb25('0x12')]);}logger[_0xcb25('0x10')](_0xcb25('0xc'),_0x476bb6,_0x403f1b[_0xcb25('0x10')][_0xcb25('0x12')]);return _0x29af81(_0x403f1b[_0xcb25('0x10')]['message']);}else{logger[_0xcb25('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x476bb6,'request\x20sent');_0x29af81(_0x403f1b[_0xcb25('0x13')]['message']);}})[_0xcb25('0x14')](function(_0x362702){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x476bb6,_0x362702);_0x29de7f(_0x362702);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 2f71bb9..f684de8 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 _0xd0b6=['../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','get','/:id','show','/:id/sessions','/:id/summary','30s','getSummary','post','/:id/clone','clone','put','exports','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x375242,_0x4fe67f){var _0xf3426b=function(_0x2e52bd){while(--_0x2e52bd){_0x375242['push'](_0x375242['shift']());}};_0xf3426b(++_0x4fe67f);}(_0xd0b6,0x19f));var _0x6d0b=function(_0x28edf8,_0x3ab79f){_0x28edf8=_0x28edf8-0x0;var _0xb0bbba=_0xd0b6[_0x28edf8];return _0xb0bbba;};'use strict';var multer=require('multer');var util=require(_0x6d0b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6d0b('0x1'));var router=express[_0x6d0b('0x2')]();var fs_extra=require(_0x6d0b('0x3'));var auth=require(_0x6d0b('0x4'));var interaction=require(_0x6d0b('0x5'));var config=require(_0x6d0b('0x6'));var controller=require(_0x6d0b('0x7'));router['get']('/',auth[_0x6d0b('0x8')](),controller['index']);router[_0x6d0b('0x9')](_0x6d0b('0xa'),auth[_0x6d0b('0x8')](),controller[_0x6d0b('0xb')]);router[_0x6d0b('0x9')](_0x6d0b('0xc'),auth['isAuthenticated'](),controller['getSessions']);router[_0x6d0b('0x9')]('/:id/answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x6d0b('0x9')](_0x6d0b('0xd'),auth[_0x6d0b('0x8')](),timeout(_0x6d0b('0xe')),controller[_0x6d0b('0xf')]);router[_0x6d0b('0x10')]('/',auth[_0x6d0b('0x8')](),controller['create']);router['post'](_0x6d0b('0x11'),auth[_0x6d0b('0x8')](),controller[_0x6d0b('0x12')]);router[_0x6d0b('0x13')]('/:id',auth[_0x6d0b('0x8')](),controller['update']);router['delete'](_0x6d0b('0xa'),auth[_0x6d0b('0x8')](),controller['destroy']);module[_0x6d0b('0x14')]=router; \ No newline at end of file +var _0x7bd1=['multer','util','path','express','Router','../../components/auth/service','./jscriptyProject.controller','get','isAuthenticated','index','show','/:id/sessions','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','put','/:id','delete','destroy','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7bd1,0x120));var _0x17bd=function(_0x22f23a,_0x1c7d7a){_0x22f23a=_0x22f23a-0x0;var _0xfca86f=_0x7bd1[_0x22f23a];return _0xfca86f;};'use strict';var multer=require(_0x17bd('0x0'));var util=require(_0x17bd('0x1'));var path=require(_0x17bd('0x2'));var timeout=require('connect-timeout');var express=require(_0x17bd('0x3'));var router=express[_0x17bd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x17bd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x17bd('0x6'));router[_0x17bd('0x7')]('/',auth[_0x17bd('0x8')](),controller[_0x17bd('0x9')]);router['get']('/:id',auth[_0x17bd('0x8')](),controller[_0x17bd('0xa')]);router[_0x17bd('0x7')](_0x17bd('0xb'),auth['isAuthenticated'](),controller['getSessions']);router[_0x17bd('0x7')]('/:id/answers',auth[_0x17bd('0x8')](),controller[_0x17bd('0xc')]);router[_0x17bd('0x7')](_0x17bd('0xd'),auth[_0x17bd('0x8')](),timeout(_0x17bd('0xe')),controller['getSummary']);router[_0x17bd('0xf')]('/',auth[_0x17bd('0x8')](),controller[_0x17bd('0x10')]);router[_0x17bd('0xf')](_0x17bd('0x11'),auth[_0x17bd('0x8')](),controller[_0x17bd('0x12')]);router[_0x17bd('0x13')](_0x17bd('0x14'),auth[_0x17bd('0x8')](),controller['update']);router[_0x17bd('0x15')](_0x17bd('0x14'),auth[_0x17bd('0x8')](),controller[_0x17bd('0x16')]);module[_0x17bd('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index a52e18d..f2bf8f0 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 _0x2cb9=['util','exports','STRING','name','TEXT','isObjectLike','formData','stringify','isString','setDataValue','getDataValue','description','BOOLEAN','lodash'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0x2cb9,0x99));var _0x92cb=function(_0x309719,_0xab8feb){_0x309719=_0x309719-0x0;var _0x1cbf70=_0x2cb9[_0x309719];return _0x1cbf70;};'use strict';var Sequelize=require('sequelize');var _=require(_0x92cb('0x0'));var util=require(_0x92cb('0x1'));module[_0x92cb('0x2')]={'name':{'type':Sequelize[_0x92cb('0x3')],'unique':_0x92cb('0x4')},'description':{'type':Sequelize[_0x92cb('0x3')]},'formData':{'type':Sequelize[_0x92cb('0x5')]('long'),'set':function(_0x9ea82e){if(_[_0x92cb('0x6')](_0x9ea82e)){this['setDataValue'](_0x92cb('0x7'),JSON[_0x92cb('0x8')](_0x9ea82e));}else if(_[_0x92cb('0x9')](_0x9ea82e)){this[_0x92cb('0xa')]('formData',_0x9ea82e);}else{this[_0x92cb('0xa')](_0x92cb('0x7'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x92cb('0xb')]('name')||'',this[_0x92cb('0xb')](_0x92cb('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x92cb('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0xc27a=['util','exports','STRING','TEXT','long','isObjectLike','setDataValue','formData','format','getDataValue','name','description','sequelize','lodash'];(function(_0x2d5a2e,_0x31fced){var _0x5bf02b=function(_0x2cfd11){while(--_0x2cfd11){_0x2d5a2e['push'](_0x2d5a2e['shift']());}};_0x5bf02b(++_0x31fced);}(_0xc27a,0xb4));var _0xac27=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0xc27a[_0x281e5e];return _0x5a22d2;};'use strict';var Sequelize=require(_0xac27('0x0'));var _=require(_0xac27('0x1'));var util=require(_0xac27('0x2'));module[_0xac27('0x3')]={'name':{'type':Sequelize[_0xac27('0x4')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xac27('0x5')](_0xac27('0x6')),'set':function(_0x394bcd){if(_[_0xac27('0x7')](_0x394bcd)){this[_0xac27('0x8')](_0xac27('0x9'),JSON['stringify'](_0x394bcd));}else if(_['isString'](_0x394bcd)){this[_0xac27('0x8')](_0xac27('0x9'),_0x394bcd);}else{this['setDataValue'](_0xac27('0x9'),util[_0xac27('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xac27('0xb')](_0xac27('0xc'))||'',this[_0xac27('0xb')](_0xac27('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'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 2f3f751..e55a4ab 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 _0x4502=['UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','hasOwnProperty','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','findAll','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','sendStatus','stack','name','index','map','JscriptyProject','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x16e60d,_0xab1f7e){var _0x12162d=function(_0x5b78d2){while(--_0x5b78d2){_0x16e60d['push'](_0x16e60d['shift']());}};_0x12162d(++_0xab1f7e);}(_0x4502,0xa0));var _0x2450=function(_0x430d7c,_0xff17e8){_0x430d7c=_0x430d7c-0x0;var _0x5d322a=_0x4502[_0x430d7c];return _0x5d322a;};'use strict';var emlformat=require(_0x2450('0x0'));var rimraf=require(_0x2450('0x1'));var zipdir=require(_0x2450('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2450('0x3'));var Mustache=require(_0x2450('0x4'));var util=require('util');var path=require(_0x2450('0x5'));var sox=require(_0x2450('0x6'));var csv=require(_0x2450('0x7'));var ejs=require(_0x2450('0x8'));var fs=require('fs');var fs_extra=require(_0x2450('0x9'));var _=require('lodash');var squel=require(_0x2450('0xa'));var crypto=require('crypto');var jsforce=require(_0x2450('0xb'));var deskjs=require(_0x2450('0xc'));var toCsv=require(_0x2450('0x7'));var querystring=require(_0x2450('0xd'));var Papa=require(_0x2450('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2450('0xf'));var as=require(_0x2450('0x10'));var hardwareService=require(_0x2450('0x11'));var logger=require(_0x2450('0x12'))('api');var utils=require(_0x2450('0x13'));var config=require(_0x2450('0x14'));var licenseUtil=require(_0x2450('0x15'));var db=require(_0x2450('0x16'))['db'];function respondWithStatusCode(_0x46b49f,_0x252bee){_0x252bee=_0x252bee||0xcc;return function(_0x22bda4){if(_0x22bda4){return _0x46b49f['sendStatus'](_0x252bee);}return _0x46b49f[_0x2450('0x17')](_0x252bee)[_0x2450('0x18')]();};}function respondWithResult(_0x3bc485,_0x2b7f29){_0x2b7f29=_0x2b7f29||0xc8;return function(_0x1b1fd7){if(_0x1b1fd7){return _0x3bc485[_0x2450('0x17')](_0x2b7f29)[_0x2450('0x19')](_0x1b1fd7);}};}function respondWithFilteredResult(_0x585f22,_0x12eddd){return function(_0xc50004){if(_0xc50004){var _0x110b9a=typeof _0x12eddd[_0x2450('0x1a')]===_0x2450('0x1b')&&typeof _0x12eddd[_0x2450('0x1c')]==='undefined';var _0x2bfcfb=_0xc50004[_0x2450('0x1d')];var _0x1ae639=_0x110b9a?0x0:_0x12eddd[_0x2450('0x1a')];var _0x11b331=_0x110b9a?_0xc50004[_0x2450('0x1d')]:_0x12eddd[_0x2450('0x1a')]+_0x12eddd['limit'];var _0x59abce;if(_0x11b331>=_0x2bfcfb){_0x11b331=_0x2bfcfb;_0x59abce=0xc8;}else{_0x59abce=0xce;}_0x585f22[_0x2450('0x17')](_0x59abce);return _0x585f22[_0x2450('0x1e')]('Content-Range',_0x1ae639+'-'+_0x11b331+'/'+_0x2bfcfb)[_0x2450('0x19')](_0xc50004);}return null;};}function patchUpdates(_0x3d8968){return function(_0xf75aff){try{jsonpatch[_0x2450('0x1f')](_0xf75aff,_0x3d8968,!![]);}catch(_0x2d2ac3){return BPromise[_0x2450('0x20')](_0x2d2ac3);}return _0xf75aff[_0x2450('0x21')]();};}function saveUpdates(_0x468e19,_0x1fb375){return function(_0x2556a2){if(_0x2556a2){return _0x2556a2[_0x2450('0x22')](_0x468e19)[_0x2450('0x23')](function(_0x3276a3){return _0x3276a3;});}return null;};}function removeEntity(_0x2731dd,_0x41e185){return function(_0xd566c0){if(_0xd566c0){return _0xd566c0[_0x2450('0x24')]()['then'](function(){var _0x12fc2d=_0xd566c0[_0x2450('0x25')]({'plain':!![]});var _0x22c841=_0x2450('0x26');return db[_0x2450('0x27')]['destroy']({'where':{'type':_0x22c841,'resourceId':_0x12fc2d['id']}})[_0x2450('0x23')](function(){return _0xd566c0;});})[_0x2450('0x23')](function(){_0x2731dd[_0x2450('0x17')](0xcc)[_0x2450('0x18')]();});}};}function handleEntityNotFound(_0x566d87,_0x36ab03){return function(_0x35a844){if(!_0x35a844){_0x566d87[_0x2450('0x28')](0x194);}return _0x35a844;};}function handleError(_0x2aaaf1,_0xd9be6b){_0xd9be6b=_0xd9be6b||0x1f4;return function(_0x2ec839){logger['error'](_0x2ec839[_0x2450('0x29')]);if(_0x2ec839[_0x2450('0x2a')]){delete _0x2ec839[_0x2450('0x2a')];}_0x2aaaf1[_0x2450('0x17')](_0xd9be6b)['send'](_0x2ec839);};}exports[_0x2450('0x2b')]=function(_0x11c663,_0x1e7caf){var _0x567cb0={},_0xc6ba2={},_0x39c0d6={'count':0x0,'rows':[]};var _0x5bb42c=_[_0x2450('0x2c')](db[_0x2450('0x2d')]['rawAttributes'],function(_0x3251ff){return{'name':_0x3251ff[_0x2450('0x2e')],'type':_0x3251ff[_0x2450('0x2f')][_0x2450('0x30')]};});_0xc6ba2[_0x2450('0x31')]=_[_0x2450('0x2c')](_0x5bb42c,_0x2450('0x2a'));_0xc6ba2[_0x2450('0x32')]=_['keys'](_0x11c663[_0x2450('0x32')]);_0xc6ba2['filters']=_[_0x2450('0x33')](_0xc6ba2[_0x2450('0x31')],_0xc6ba2[_0x2450('0x32')]);_0x567cb0[_0x2450('0x34')]=_[_0x2450('0x33')](_0xc6ba2['model'],qs[_0x2450('0x35')](_0x11c663[_0x2450('0x32')][_0x2450('0x35')]));_0x567cb0['attributes']=_0x567cb0[_0x2450('0x34')][_0x2450('0x36')]?_0x567cb0[_0x2450('0x34')]:_0xc6ba2[_0x2450('0x31')];if(!_0x11c663[_0x2450('0x32')]['hasOwnProperty'](_0x2450('0x37'))){_0x567cb0[_0x2450('0x1c')]=qs[_0x2450('0x1c')](_0x11c663[_0x2450('0x32')]['limit']);_0x567cb0['offset']=qs[_0x2450('0x1a')](_0x11c663[_0x2450('0x32')][_0x2450('0x1a')]);}_0x567cb0[_0x2450('0x38')]=qs['sort'](_0x11c663[_0x2450('0x32')][_0x2450('0x39')]);_0x567cb0['where']=qs[_0x2450('0x3a')](_[_0x2450('0x3b')](_0x11c663[_0x2450('0x32')],_0xc6ba2['filters']),_0x5bb42c);if(_0x11c663[_0x2450('0x32')]['filter']){_0x567cb0[_0x2450('0x3c')]=_[_0x2450('0x3d')](_0x567cb0['where'],{'$or':_[_0x2450('0x2c')](_0x5bb42c,function(_0x1644b4){if(_0x1644b4[_0x2450('0x2f')]!==_0x2450('0x3e')){var _0xfbf18c={};_0xfbf18c[_0x1644b4[_0x2450('0x2a')]]={'$like':'%'+_0x11c663[_0x2450('0x32')][_0x2450('0x3f')]+'%'};return _0xfbf18c;}})});}_0x567cb0=_[_0x2450('0x3d')]({},_0x567cb0,_0x11c663[_0x2450('0x40')]);var _0x402d32={'where':_0x567cb0[_0x2450('0x3c')]};return db[_0x2450('0x2d')][_0x2450('0x1d')](_0x402d32)[_0x2450('0x23')](function(_0x2667b0){_0x39c0d6[_0x2450('0x1d')]=_0x2667b0;if(_0x11c663['query'][_0x2450('0x41')]){_0x567cb0[_0x2450('0x42')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x567cb0);})[_0x2450('0x23')](function(_0x41606f){_0x39c0d6[_0x2450('0x43')]=_0x41606f;return _0x39c0d6;})[_0x2450('0x23')](respondWithFilteredResult(_0x1e7caf,_0x567cb0))[_0x2450('0x44')](handleError(_0x1e7caf,null));};exports['show']=function(_0x8e9cb9,_0x11ca3e){var _0x435408={'raw':![],'where':{'id':_0x8e9cb9[_0x2450('0x45')]['id']}},_0x28722d={};_0x28722d[_0x2450('0x31')]=_[_0x2450('0x46')](db[_0x2450('0x2d')][_0x2450('0x47')]);_0x28722d[_0x2450('0x32')]=_[_0x2450('0x46')](_0x8e9cb9[_0x2450('0x32')]);_0x28722d[_0x2450('0x3a')]=_['intersection'](_0x28722d['model'],_0x28722d[_0x2450('0x32')]);_0x435408[_0x2450('0x34')]=_[_0x2450('0x33')](_0x28722d[_0x2450('0x31')],qs['fields'](_0x8e9cb9[_0x2450('0x32')][_0x2450('0x35')]));_0x435408[_0x2450('0x34')]=_0x435408['attributes'][_0x2450('0x36')]?_0x435408['attributes']:_0x28722d[_0x2450('0x31')];if(_0x8e9cb9['query']['includeAll']){_0x435408['include']=[{'all':!![]}];}_0x435408=_[_0x2450('0x3d')]({},_0x435408,_0x8e9cb9[_0x2450('0x40')]);return db[_0x2450('0x2d')][_0x2450('0x48')](_0x435408)[_0x2450('0x23')](handleEntityNotFound(_0x11ca3e,null))[_0x2450('0x23')](respondWithResult(_0x11ca3e,null))[_0x2450('0x44')](handleError(_0x11ca3e,null));};exports[_0x2450('0x49')]=function(_0x57217a,_0x4e605e){return db['JscriptyProject'][_0x2450('0x49')](_0x57217a[_0x2450('0x4a')],{})[_0x2450('0x23')](function(_0x49a05d){var _0x5a6c44=_0x57217a[_0x2450('0x4b')][_0x2450('0x25')]({'plain':!![]});if(!_0x5a6c44)throw new Error(_0x2450('0x4c'));if(_0x5a6c44[_0x2450('0x4d')]==='user'){var _0x361024=_0x49a05d[_0x2450('0x25')]({'plain':!![]});var _0x2be718='Projects';return db[_0x2450('0x4e')][_0x2450('0x48')]({'where':{'name':_0x2be718,'userProfileId':_0x5a6c44[_0x2450('0x4f')]},'raw':!![]})[_0x2450('0x23')](function(_0x2b489c){if(_0x2b489c&&_0x2b489c[_0x2450('0x50')]===0x0){return db[_0x2450('0x27')][_0x2450('0x49')]({'name':_0x361024[_0x2450('0x2a')],'resourceId':_0x361024['id'],'type':_0x2b489c[_0x2450('0x2a')],'sectionId':_0x2b489c['id']},{})['then'](function(){return _0x49a05d;});}else{return _0x49a05d;}})[_0x2450('0x44')](function(_0x4df731){logger[_0x2450('0x51')](_0x2450('0x52'),_0x4df731);throw _0x4df731;});}return _0x49a05d;})[_0x2450('0x23')](respondWithResult(_0x4e605e,0xc9))['catch'](handleError(_0x4e605e,null));};exports[_0x2450('0x53')]=function(_0x19a64c,_0x156710){var _0x3e6d06={'where':{'id':_0x19a64c[_0x2450('0x45')]['id']}},_0x5b2108={};_0x5b2108[_0x2450('0x31')]=_[_0x2450('0x46')](db[_0x2450('0x2d')][_0x2450('0x47')]);_0x3e6d06[_0x2450('0x34')]=_[_0x2450('0x33')](_0x5b2108[_0x2450('0x31')],qs['fields'](_0x19a64c[_0x2450('0x32')][_0x2450('0x35')]));_0x3e6d06[_0x2450('0x34')]=_0x3e6d06[_0x2450('0x34')][_0x2450('0x36')]?_0x3e6d06[_0x2450('0x34')]:_0x5b2108[_0x2450('0x31')];if(_0x19a64c[_0x2450('0x32')][_0x2450('0x41')]){_0x3e6d06[_0x2450('0x42')]=[{'all':!![]}];}_0x3e6d06=_[_0x2450('0x3d')]({},_0x3e6d06,_0x19a64c[_0x2450('0x40')]);return db[_0x2450('0x2d')][_0x2450('0x48')](_0x3e6d06)[_0x2450('0x23')](handleEntityNotFound(_0x156710,null))[_0x2450('0x23')](function(_0x8f2eaa){if(_0x8f2eaa){var _0x37bc7e=_0x8f2eaa[_0x2450('0x25')]({'plain':!![]});_0x37bc7e=qs[_0x2450('0x54')](_0x37bc7e,['id',_0x2450('0x55'),_0x2450('0x56')]);_0x19a64c[_0x2450('0x4a')]=_[_0x2450('0x54')](_0x19a64c[_0x2450('0x4a')],['id',_0x2450('0x55'),'updatedAt']);return db[_0x2450('0x2d')][_0x2450('0x49')](_[_0x2450('0x3d')](_0x37bc7e,_0x19a64c[_0x2450('0x4a')]),{'include':_0x19a64c[_0x2450('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x2450('0x23')](function(_0x3ac5ed){var _0x3eba47=_0x19a64c[_0x2450('0x4b')]['get']({'plain':!![]});if(!_0x3eba47)throw new Error(_0x2450('0x4c'));if(_0x3eba47[_0x2450('0x4d')]==='user'){var _0x5a96d4=_0x3ac5ed[_0x2450('0x25')]({'plain':!![]});var _0x1123e4=_0x2450('0x26');return db[_0x2450('0x4e')]['find']({'where':{'name':_0x1123e4,'userProfileId':_0x3eba47['userProfileId']},'raw':!![]})[_0x2450('0x23')](function(_0x514b17){if(_0x514b17&&_0x514b17[_0x2450('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a96d4[_0x2450('0x2a')],'resourceId':_0x5a96d4['id'],'type':_0x514b17['name'],'sectionId':_0x514b17['id']},{})['then'](function(){return _0x3ac5ed;});}else{return _0x3ac5ed;}})['catch'](function(_0x1c228f){logger[_0x2450('0x51')](_0x2450('0x52'),_0x1c228f);throw _0x1c228f;});}return _0x3ac5ed;});}})['then'](respondWithResult(_0x156710,0xc9))[_0x2450('0x44')](handleError(_0x156710,null));};exports['update']=function(_0x28187a,_0x418cc5){if(_0x28187a[_0x2450('0x4a')]['id']){delete _0x28187a[_0x2450('0x4a')]['id'];}return db[_0x2450('0x2d')][_0x2450('0x48')]({'where':{'id':_0x28187a['params']['id']}})[_0x2450('0x23')](handleEntityNotFound(_0x418cc5,null))[_0x2450('0x23')](saveUpdates(_0x28187a['body'],null))[_0x2450('0x23')](respondWithResult(_0x418cc5,null))[_0x2450('0x44')](handleError(_0x418cc5,null));};exports['destroy']=function(_0x208972,_0x4b0672){return db[_0x2450('0x2d')][_0x2450('0x48')]({'where':{'id':_0x208972['params']['id']}})[_0x2450('0x23')](handleEntityNotFound(_0x4b0672,null))[_0x2450('0x23')](removeEntity(_0x4b0672,null))['catch'](handleError(_0x4b0672,null));};exports[_0x2450('0x57')]=function(_0x199129,_0x3b367b,_0x493c39){var _0x42e1cc={'raw':!![],'where':{}};var _0x19a1b7={};var _0x27d4da={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x2450('0x58')]({'where':{'id':_0x199129['params']['id']}})['then'](handleEntityNotFound(_0x3b367b,null))[_0x2450('0x23')](function(_0x49544a){if(_0x49544a){_0x19a1b7[_0x2450('0x31')]=_[_0x2450('0x46')](db[_0x2450('0x59')][_0x2450('0x47')]);_0x19a1b7[_0x2450('0x32')]=_[_0x2450('0x46')](_0x199129[_0x2450('0x32')]);_0x19a1b7['filters']=_[_0x2450('0x33')](_0x19a1b7[_0x2450('0x31')],_0x19a1b7[_0x2450('0x32')]);_0x42e1cc[_0x2450('0x34')]=_['intersection'](_0x19a1b7[_0x2450('0x31')],qs[_0x2450('0x35')](_0x199129[_0x2450('0x32')][_0x2450('0x35')]));_0x42e1cc[_0x2450('0x34')]=_0x42e1cc[_0x2450('0x34')]['length']?_0x42e1cc[_0x2450('0x34')]:_0x19a1b7[_0x2450('0x31')];if(!_0x199129[_0x2450('0x32')]['hasOwnProperty']('nolimit')){_0x42e1cc[_0x2450('0x1c')]=qs['limit'](_0x199129[_0x2450('0x32')][_0x2450('0x1c')]);_0x42e1cc[_0x2450('0x1a')]=qs[_0x2450('0x1a')](_0x199129[_0x2450('0x32')]['offset']);}_0x42e1cc[_0x2450('0x38')]=qs[_0x2450('0x39')](_0x199129[_0x2450('0x32')][_0x2450('0x39')]);_0x42e1cc['where']=qs[_0x2450('0x3a')](_[_0x2450('0x3b')](_0x199129['query'],_0x19a1b7['filters']));_0x42e1cc[_0x2450('0x3c')][_0x2450('0x5a')]=_0x49544a['id'];if(_0x199129[_0x2450('0x32')][_0x2450('0x3f')]){_0x42e1cc['where']=_[_0x2450('0x3d')](_0x42e1cc[_0x2450('0x3c')],{'$or':_[_0x2450('0x2c')](_0x42e1cc[_0x2450('0x34')],function(_0x30836d){var _0x31a79d={};_0x31a79d[_0x30836d]={'$like':'%'+_0x199129[_0x2450('0x32')][_0x2450('0x3f')]+'%'};return _0x31a79d;})});}_0x42e1cc=_[_0x2450('0x3d')]({},_0x42e1cc,_0x199129[_0x2450('0x40')]);return db['JscriptySessionReport']['count']({'where':_0x42e1cc[_0x2450('0x3c')]})[_0x2450('0x23')](function(_0x57d348){_0x27d4da['count']=_0x57d348;if(_0x199129[_0x2450('0x32')][_0x2450('0x41')]){_0x42e1cc['include']=[{'all':!![]}];}return db[_0x2450('0x59')]['findAll'](_0x42e1cc);})[_0x2450('0x23')](function(_0x4e6a85){_0x27d4da[_0x2450('0x43')]=_0x4e6a85;return _0x27d4da;});}})['then'](respondWithFilteredResult(_0x3b367b,_0x42e1cc))[_0x2450('0x44')](handleError(_0x3b367b,null));};exports[_0x2450('0x5b')]=function(_0x43154e,_0x46cb43,_0x56de45){var _0x34424d={'raw':!![],'where':{}};var _0xab9563={};var _0x663e7c={'count':0x0,'rows':[]};return db[_0x2450('0x2d')][_0x2450('0x58')]({'where':{'id':_0x43154e[_0x2450('0x45')]['id']}})['then'](handleEntityNotFound(_0x46cb43,null))['then'](function(_0x2c2c84){if(_0x2c2c84){_0xab9563[_0x2450('0x31')]=_[_0x2450('0x46')](db[_0x2450('0x5c')][_0x2450('0x47')]);_0xab9563[_0x2450('0x32')]=_[_0x2450('0x46')](_0x43154e[_0x2450('0x32')]);_0xab9563[_0x2450('0x3a')]=_[_0x2450('0x33')](_0xab9563[_0x2450('0x31')],_0xab9563[_0x2450('0x32')]);_0x34424d[_0x2450('0x34')]=_['intersection'](_0xab9563[_0x2450('0x31')],qs['fields'](_0x43154e[_0x2450('0x32')][_0x2450('0x35')]));_0x34424d[_0x2450('0x34')]=_0x34424d[_0x2450('0x34')][_0x2450('0x36')]?_0x34424d[_0x2450('0x34')]:_0xab9563['model'];if(!_0x43154e['query'][_0x2450('0x5d')](_0x2450('0x37'))){_0x34424d[_0x2450('0x1c')]=qs[_0x2450('0x1c')](_0x43154e[_0x2450('0x32')]['limit']);_0x34424d[_0x2450('0x1a')]=qs[_0x2450('0x1a')](_0x43154e[_0x2450('0x32')][_0x2450('0x1a')]);}_0x34424d[_0x2450('0x38')]=qs['sort'](_0x43154e[_0x2450('0x32')][_0x2450('0x39')]);_0x34424d['where']=qs['filters'](_[_0x2450('0x3b')](_0x43154e['query'],_0xab9563['filters']));_0x34424d[_0x2450('0x3c')][_0x2450('0x5a')]=_0x2c2c84['id'];if(_0x43154e[_0x2450('0x32')][_0x2450('0x3f')]){_0x34424d['where']=_['merge'](_0x34424d[_0x2450('0x3c')],{'$or':_[_0x2450('0x2c')](_0x34424d[_0x2450('0x34')],function(_0x198545){var _0xcb2ccc={};_0xcb2ccc[_0x198545]={'$like':'%'+_0x43154e[_0x2450('0x32')][_0x2450('0x3f')]+'%'};return _0xcb2ccc;})});}_0x34424d=_[_0x2450('0x3d')]({},_0x34424d,_0x43154e['options']);return db[_0x2450('0x5c')][_0x2450('0x1d')]({'where':_0x34424d[_0x2450('0x3c')]})[_0x2450('0x23')](function(_0x33a1f1){_0x663e7c[_0x2450('0x1d')]=_0x33a1f1;if(_0x43154e[_0x2450('0x32')][_0x2450('0x41')]){_0x34424d[_0x2450('0x42')]=[{'all':!![]}];}return db[_0x2450('0x5c')]['findAll'](_0x34424d);})[_0x2450('0x23')](function(_0x5a6a9d){_0x663e7c['rows']=_0x5a6a9d;return _0x663e7c;});}})[_0x2450('0x23')](respondWithFilteredResult(_0x46cb43,_0x34424d))[_0x2450('0x44')](handleError(_0x46cb43,null));};function char(_0xfa6f2d){return _0x2450('0x5e')===typeof _0xfa6f2d?String['fromCharCode']['apply'](null,arguments):_0xfa6f2d;}function needsEncapsulation(_0x253ff3){return!!_0x253ff3&&(_0x253ff3[_0x2450('0x5f')]()[_0x2450('0x60')](char(0xd))>=0x0||_0x253ff3[_0x2450('0x5f')]()[_0x2450('0x60')](char(0xa))>=0x0||_0x253ff3[_0x2450('0x5f')]()[_0x2450('0x60')](char(0x2c))>=0x0||_0x253ff3[_0x2450('0x5f')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x5dcb73){var _0x540c1b=char(0x22),_0x2eb08c='\x5c'+char(0x22),_0x4c3219=_0x5dcb73[_0x2450('0x5f')]()[_0x2450('0x61')](new RegExp(_0x540c1b,'g'),_0x2eb08c);return _0x540c1b+_0x4c3219+_0x540c1b;}exports[_0x2450('0x62')]=function(_0x3ff662,_0xa5df28,_0x2dfcce){var _0x1ff44a,_0x2f52b0;var _0x43434a={'where':{'ProjectId':_0x3ff662[_0x2450('0x45')]['id']}};if(_0x3ff662[_0x2450('0x32')][_0x2450('0x63')]){_0x43434a[_0x2450('0x3c')][_0x2450('0x64')]=JSON[_0x2450('0x65')](_0x3ff662[_0x2450('0x32')][_0x2450('0x63')]);}return db[_0x2450('0x59')]['findAll'](_0x43434a)[_0x2450('0x23')](handleEntityNotFound(_0xa5df28,null))[_0x2450('0x23')](function(_0x1bc6b6){if(_0x1bc6b6){_0x1ff44a=_0x1bc6b6;return db[_0x2450('0x66')][_0x2450('0x67')]({'where':{'SessionId':{'$in':_['map'](_0x1ff44a,'id')},'ProjectId':_0x3ff662[_0x2450('0x45')]['id']},'order':_0x2450('0x68')});}})[_0x2450('0x23')](handleEntityNotFound(_0xa5df28,null))[_0x2450('0x23')](function(_0x339ba2){if(_0x339ba2){_0x2f52b0=_0x339ba2;var _0x3491a8={};for(var _0x45ebaa=0x0,_0x341727=_0x2f52b0[_0x2450('0x36')];_0x45ebaa<_0x341727;_0x45ebaa++){if(!_0x3491a8[_0x2450('0x5d')](_0x2f52b0[_0x45ebaa]['questionId'])){_0x3491a8[_0x2f52b0[_0x45ebaa][_0x2450('0x69')]]=needsEncapsulation(_0x2f52b0[_0x45ebaa][_0x2450('0x6a')])?encapsulate(_0x2f52b0[_0x45ebaa][_0x2450('0x6a')]):_0x2f52b0[_0x45ebaa]['question'];}}var _0x10b0df=[],_0x5e1402={};for(var _0x3dab08=0x0,_0x520366=_0x1ff44a[_0x2450('0x36')];_0x3dab08<_0x520366;_0x3dab08++){_0x5e1402={'ProjectId':_0x3ff662[_0x2450('0x45')]['id'],'SessionId':_0x1ff44a[_0x3dab08]['id'],'StartTime':moment(_0x1ff44a[_0x3dab08][_0x2450('0x64')])['format'](_0x2450('0x6b'))};for(var _0x3ca1af=0x0,_0x2fb541=_0x2f52b0[_0x2450('0x36')];_0x3ca1af<_0x2fb541;_0x3ca1af++){if(_0x2f52b0[_0x3ca1af][_0x2450('0x6c')]==_0x1ff44a[_0x3dab08]['id']&&_0x3491a8['hasOwnProperty'](_0x2f52b0[_0x3ca1af][_0x2450('0x69')])){_0x5e1402[_0x3491a8[_0x2f52b0[_0x3ca1af][_0x2450('0x69')]]]=_0x2f52b0[_0x3ca1af][_0x2450('0x6d')];}}for(var _0x1e4d99 in _0x3491a8){if(!_0x5e1402[_0x2450('0x5d')](_0x3491a8[_0x1e4d99])){_0x5e1402[_0x3491a8[_0x1e4d99]]=null;}}_0x10b0df['push'](_0x5e1402);}return _0x10b0df;}})[_0x2450('0x23')](function(_0xce526e){if(!_['isEmpty'](_0xce526e)){var _0x55a646=toCsv(_0xce526e);var _0x304934=Date[_0x2450('0x6e')]();fs[_0x2450('0x6f')](util[_0x2450('0x70')](_0x2450('0x71'),_0x3ff662[_0x2450('0x45')]['id'],_0x304934),_0x55a646);_0xa5df28[_0x2450('0x72')]('Content-disposition',_0x2450('0x73')+util[_0x2450('0x70')](_0x2450('0x74'),_0x3ff662[_0x2450('0x45')]['id'],_0x304934));_0xa5df28['setHeader']('Content-type',_0x2450('0x75'));return _0xa5df28[_0x2450('0x76')](util[_0x2450('0x70')](_0x2450('0x71'),_0x3ff662[_0x2450('0x45')]['id'],_0x304934));}else{return _0xa5df28['sendStatus'](0xcc);}})[_0x2450('0x44')](handleError(_0xa5df28,null));}; \ No newline at end of file +var _0x174b=['hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','show','params','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','autoAssociation','getSessions','findOne','JscriptySessionReport','getAnswers','JscriptyAnswerReport','pick','ProjectId','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Content-type','text/csv','download','sendStatus','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','apply','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x5dabe1,_0x2f54ff){var _0x36cbaa=function(_0x32c5d6){while(--_0x32c5d6){_0x5dabe1['push'](_0x5dabe1['shift']());}};_0x36cbaa(++_0x2f54ff);}(_0x174b,0x19d));var _0xb174=function(_0x5d049a,_0x4010fa){_0x5d049a=_0x5d049a-0x0;var _0x2a3ec1=_0x174b[_0x5d049a];return _0x2a3ec1;};'use strict';var emlformat=require(_0xb174('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb174('0x1'));var rp=require(_0xb174('0x2'));var moment=require(_0xb174('0x3'));var BPromise=require(_0xb174('0x4'));var Mustache=require(_0xb174('0x5'));var util=require(_0xb174('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb174('0x7'));var ejs=require(_0xb174('0x8'));var fs=require('fs');var fs_extra=require(_0xb174('0x9'));var _=require(_0xb174('0xa'));var squel=require(_0xb174('0xb'));var crypto=require(_0xb174('0xc'));var jsforce=require(_0xb174('0xd'));var deskjs=require(_0xb174('0xe'));var toCsv=require(_0xb174('0x7'));var querystring=require(_0xb174('0xf'));var Papa=require('papaparse');var Redis=require(_0xb174('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb174('0x11'));var as=require(_0xb174('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb174('0x13'))('api');var utils=require(_0xb174('0x14'));var config=require(_0xb174('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb174('0x16'))['db'];function respondWithStatusCode(_0x3706ee,_0x13b2da){_0x13b2da=_0x13b2da||0xcc;return function(_0x344326){if(_0x344326){return _0x3706ee['sendStatus'](_0x13b2da);}return _0x3706ee[_0xb174('0x17')](_0x13b2da)['end']();};}function respondWithResult(_0x30c02d,_0x2a5c42){_0x2a5c42=_0x2a5c42||0xc8;return function(_0x40f7bc){if(_0x40f7bc){return _0x30c02d[_0xb174('0x17')](_0x2a5c42)['json'](_0x40f7bc);}};}function respondWithFilteredResult(_0x3a9636,_0x2cc2cc){return function(_0x30f414){if(_0x30f414){var _0x3e6388=typeof _0x2cc2cc[_0xb174('0x18')]===_0xb174('0x19')&&typeof _0x2cc2cc['limit']==='undefined';var _0x50abeb=_0x30f414['count'];var _0x2ab4dc=_0x3e6388?0x0:_0x2cc2cc['offset'];var _0xaf80a9=_0x3e6388?_0x30f414[_0xb174('0x1a')]:_0x2cc2cc['offset']+_0x2cc2cc[_0xb174('0x1b')];var _0x3f5cbe;if(_0xaf80a9>=_0x50abeb){_0xaf80a9=_0x50abeb;_0x3f5cbe=0xc8;}else{_0x3f5cbe=0xce;}_0x3a9636[_0xb174('0x17')](_0x3f5cbe);return _0x3a9636[_0xb174('0x1c')](_0xb174('0x1d'),_0x2ab4dc+'-'+_0xaf80a9+'/'+_0x50abeb)[_0xb174('0x1e')](_0x30f414);}return null;};}function patchUpdates(_0xcc8d9a){return function(_0x4dcfb8){try{jsonpatch[_0xb174('0x1f')](_0x4dcfb8,_0xcc8d9a,!![]);}catch(_0x3eb03c){return BPromise['reject'](_0x3eb03c);}return _0x4dcfb8['save']();};}function saveUpdates(_0x5248cb,_0x338dc4){return function(_0x1e5363){if(_0x1e5363){return _0x1e5363[_0xb174('0x20')](_0x5248cb)['then'](function(_0x282b5c){return _0x282b5c;});}return null;};}function removeEntity(_0x24456b,_0x25174e){return function(_0x5a3fbd){if(_0x5a3fbd){return _0x5a3fbd[_0xb174('0x21')]()[_0xb174('0x22')](function(){var _0x3b5abf=_0x5a3fbd[_0xb174('0x23')]({'plain':!![]});var _0x487e46='Projects';return db[_0xb174('0x24')]['destroy']({'where':{'type':_0x487e46,'resourceId':_0x3b5abf['id']}})[_0xb174('0x22')](function(){return _0x5a3fbd;});})[_0xb174('0x22')](function(){_0x24456b[_0xb174('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59a348,_0x294890){return function(_0xb8cbfe){if(!_0xb8cbfe){_0x59a348['sendStatus'](0x194);}return _0xb8cbfe;};}function handleError(_0x55312a,_0x17d31a){_0x17d31a=_0x17d31a||0x1f4;return function(_0x549fcf){logger[_0xb174('0x25')](_0x549fcf[_0xb174('0x26')]);if(_0x549fcf[_0xb174('0x27')]){delete _0x549fcf[_0xb174('0x27')];}_0x55312a[_0xb174('0x17')](_0x17d31a)[_0xb174('0x28')](_0x549fcf);};}exports[_0xb174('0x29')]=function(_0x530167,_0x589931){var _0x569d21={},_0xa46091={},_0x33ba22={'count':0x0,'rows':[]};var _0xda026e=_[_0xb174('0x2a')](db[_0xb174('0x2b')][_0xb174('0x2c')],function(_0x56ab33){return{'name':_0x56ab33[_0xb174('0x2d')],'type':_0x56ab33[_0xb174('0x2e')][_0xb174('0x2f')]};});_0xa46091[_0xb174('0x30')]=_['map'](_0xda026e,_0xb174('0x27'));_0xa46091[_0xb174('0x31')]=_[_0xb174('0x32')](_0x530167[_0xb174('0x31')]);_0xa46091[_0xb174('0x33')]=_[_0xb174('0x34')](_0xa46091[_0xb174('0x30')],_0xa46091[_0xb174('0x31')]);_0x569d21[_0xb174('0x35')]=_[_0xb174('0x34')](_0xa46091[_0xb174('0x30')],qs[_0xb174('0x36')](_0x530167[_0xb174('0x31')][_0xb174('0x36')]));_0x569d21[_0xb174('0x35')]=_0x569d21[_0xb174('0x35')]['length']?_0x569d21[_0xb174('0x35')]:_0xa46091[_0xb174('0x30')];if(!_0x530167['query'][_0xb174('0x37')](_0xb174('0x38'))){_0x569d21[_0xb174('0x1b')]=qs[_0xb174('0x1b')](_0x530167[_0xb174('0x31')]['limit']);_0x569d21[_0xb174('0x18')]=qs[_0xb174('0x18')](_0x530167[_0xb174('0x31')][_0xb174('0x18')]);}_0x569d21[_0xb174('0x39')]=qs[_0xb174('0x3a')](_0x530167['query'][_0xb174('0x3a')]);_0x569d21[_0xb174('0x3b')]=qs[_0xb174('0x33')](_['pick'](_0x530167[_0xb174('0x31')],_0xa46091[_0xb174('0x33')]),_0xda026e);if(_0x530167[_0xb174('0x31')][_0xb174('0x3c')]){_0x569d21[_0xb174('0x3b')]=_[_0xb174('0x3d')](_0x569d21[_0xb174('0x3b')],{'$or':_[_0xb174('0x2a')](_0xda026e,function(_0x18b5ee){if(_0x18b5ee[_0xb174('0x2e')]!=='VIRTUAL'){var _0x190265={};_0x190265[_0x18b5ee[_0xb174('0x27')]]={'$like':'%'+_0x530167[_0xb174('0x31')][_0xb174('0x3c')]+'%'};return _0x190265;}})});}_0x569d21=_[_0xb174('0x3d')]({},_0x569d21,_0x530167[_0xb174('0x3e')]);var _0x4bcf12={'where':_0x569d21['where']};return db[_0xb174('0x2b')][_0xb174('0x1a')](_0x4bcf12)['then'](function(_0x582eb0){_0x33ba22[_0xb174('0x1a')]=_0x582eb0;if(_0x530167[_0xb174('0x31')]['includeAll']){_0x569d21[_0xb174('0x3f')]=[{'all':!![]}];}return db[_0xb174('0x2b')][_0xb174('0x40')](_0x569d21);})[_0xb174('0x22')](function(_0x57177b){_0x33ba22[_0xb174('0x41')]=_0x57177b;return _0x33ba22;})[_0xb174('0x22')](respondWithFilteredResult(_0x589931,_0x569d21))['catch'](handleError(_0x589931,null));};exports[_0xb174('0x42')]=function(_0x390921,_0x57fb34){var _0x381654={'raw':![],'where':{'id':_0x390921[_0xb174('0x43')]['id']}},_0x5bf780={};_0x5bf780[_0xb174('0x30')]=_[_0xb174('0x32')](db[_0xb174('0x2b')]['rawAttributes']);_0x5bf780[_0xb174('0x31')]=_['keys'](_0x390921[_0xb174('0x31')]);_0x5bf780[_0xb174('0x33')]=_[_0xb174('0x34')](_0x5bf780[_0xb174('0x30')],_0x5bf780[_0xb174('0x31')]);_0x381654[_0xb174('0x35')]=_['intersection'](_0x5bf780[_0xb174('0x30')],qs[_0xb174('0x36')](_0x390921[_0xb174('0x31')][_0xb174('0x36')]));_0x381654[_0xb174('0x35')]=_0x381654[_0xb174('0x35')][_0xb174('0x44')]?_0x381654['attributes']:_0x5bf780[_0xb174('0x30')];if(_0x390921[_0xb174('0x31')][_0xb174('0x45')]){_0x381654['include']=[{'all':!![]}];}_0x381654=_['merge']({},_0x381654,_0x390921[_0xb174('0x3e')]);return db['JscriptyProject'][_0xb174('0x46')](_0x381654)['then'](handleEntityNotFound(_0x57fb34,null))['then'](respondWithResult(_0x57fb34,null))['catch'](handleError(_0x57fb34,null));};exports[_0xb174('0x47')]=function(_0x87a856,_0x1a6a2d){return db['JscriptyProject'][_0xb174('0x47')](_0x87a856[_0xb174('0x48')],{})[_0xb174('0x22')](function(_0x3aa3e4){var _0x456705=_0x87a856['user'][_0xb174('0x23')]({'plain':!![]});if(!_0x456705)throw new Error(_0xb174('0x49'));if(_0x456705[_0xb174('0x4a')]==='user'){var _0x337c17=_0x3aa3e4[_0xb174('0x23')]({'plain':!![]});var _0x4cc8f0=_0xb174('0x4b');return db['UserProfileSection'][_0xb174('0x46')]({'where':{'name':_0x4cc8f0,'userProfileId':_0x456705[_0xb174('0x4c')]},'raw':!![]})[_0xb174('0x22')](function(_0x5a700e){if(_0x5a700e&&_0x5a700e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x337c17[_0xb174('0x27')],'resourceId':_0x337c17['id'],'type':_0x5a700e['name'],'sectionId':_0x5a700e['id']},{})['then'](function(){return _0x3aa3e4;});}else{return _0x3aa3e4;}})[_0xb174('0x4d')](function(_0x3a63be){logger['error'](_0xb174('0x4e'),_0x3a63be);throw _0x3a63be;});}return _0x3aa3e4;})['then'](respondWithResult(_0x1a6a2d,0xc9))[_0xb174('0x4d')](handleError(_0x1a6a2d,null));};exports[_0xb174('0x4f')]=function(_0x4615b2,_0x3b1a5d){var _0x3d085e={'where':{'id':_0x4615b2['params']['id']}},_0x3db005={};_0x3db005[_0xb174('0x30')]=_[_0xb174('0x32')](db['JscriptyProject'][_0xb174('0x2c')]);_0x3d085e[_0xb174('0x35')]=_[_0xb174('0x34')](_0x3db005[_0xb174('0x30')],qs[_0xb174('0x36')](_0x4615b2[_0xb174('0x31')]['fields']));_0x3d085e['attributes']=_0x3d085e['attributes'][_0xb174('0x44')]?_0x3d085e[_0xb174('0x35')]:_0x3db005[_0xb174('0x30')];if(_0x4615b2[_0xb174('0x31')][_0xb174('0x45')]){_0x3d085e[_0xb174('0x3f')]=[{'all':!![]}];}_0x3d085e=_['merge']({},_0x3d085e,_0x4615b2[_0xb174('0x3e')]);return db[_0xb174('0x2b')]['find'](_0x3d085e)[_0xb174('0x22')](handleEntityNotFound(_0x3b1a5d,null))[_0xb174('0x22')](function(_0x4f95d4){if(_0x4f95d4){var _0x5dbe74=_0x4f95d4['get']({'plain':!![]});_0x5dbe74=qs[_0xb174('0x50')](_0x5dbe74,['id',_0xb174('0x51'),_0xb174('0x52')]);_0x4615b2['body']=_['omit'](_0x4615b2['body'],['id','createdAt',_0xb174('0x52')]);return db[_0xb174('0x2b')][_0xb174('0x47')](_[_0xb174('0x3d')](_0x5dbe74,_0x4615b2['body']),{'include':_0x4615b2[_0xb174('0x31')][_0xb174('0x45')]?[{'all':!![]}]:undefined})[_0xb174('0x22')](function(_0x5ac7b0){var _0x1a858b=_0x4615b2['user'][_0xb174('0x23')]({'plain':!![]});if(!_0x1a858b)throw new Error(_0xb174('0x49'));if(_0x1a858b[_0xb174('0x4a')]===_0xb174('0x53')){var _0xfc464=_0x5ac7b0[_0xb174('0x23')]({'plain':!![]});var _0x206daf=_0xb174('0x4b');return db['UserProfileSection'][_0xb174('0x46')]({'where':{'name':_0x206daf,'userProfileId':_0x1a858b['userProfileId']},'raw':!![]})['then'](function(_0x4a6979){if(_0x4a6979&&_0x4a6979[_0xb174('0x54')]===0x0){return db[_0xb174('0x24')][_0xb174('0x47')]({'name':_0xfc464['name'],'resourceId':_0xfc464['id'],'type':_0x4a6979[_0xb174('0x27')],'sectionId':_0x4a6979['id']},{})[_0xb174('0x22')](function(){return _0x5ac7b0;});}else{return _0x5ac7b0;}})[_0xb174('0x4d')](function(_0x3212a0){logger['error'](_0xb174('0x4e'),_0x3212a0);throw _0x3212a0;});}return _0x5ac7b0;});}})[_0xb174('0x22')](respondWithResult(_0x3b1a5d,0xc9))[_0xb174('0x4d')](handleError(_0x3b1a5d,null));};exports['update']=function(_0x40ac2e,_0x4d51d6){if(_0x40ac2e[_0xb174('0x48')]['id']){delete _0x40ac2e['body']['id'];}return db[_0xb174('0x2b')]['find']({'where':{'id':_0x40ac2e['params']['id']}})[_0xb174('0x22')](handleEntityNotFound(_0x4d51d6,null))[_0xb174('0x22')](saveUpdates(_0x40ac2e[_0xb174('0x48')],null))[_0xb174('0x22')](respondWithResult(_0x4d51d6,null))[_0xb174('0x4d')](handleError(_0x4d51d6,null));};exports[_0xb174('0x21')]=function(_0x4ec65b,_0x4d53c6){return db[_0xb174('0x2b')]['find']({'where':{'id':_0x4ec65b[_0xb174('0x43')]['id']}})[_0xb174('0x22')](handleEntityNotFound(_0x4d53c6,null))[_0xb174('0x22')](removeEntity(_0x4d53c6,null))[_0xb174('0x4d')](handleError(_0x4d53c6,null));};exports[_0xb174('0x55')]=function(_0x2e3b36,_0x4dd983,_0x366f5a){var _0x54a389={'raw':!![],'where':{}};var _0x14c779={};var _0x37fb67={'count':0x0,'rows':[]};return db[_0xb174('0x2b')][_0xb174('0x56')]({'where':{'id':_0x2e3b36['params']['id']}})[_0xb174('0x22')](handleEntityNotFound(_0x4dd983,null))[_0xb174('0x22')](function(_0x5a5ff2){if(_0x5a5ff2){_0x14c779[_0xb174('0x30')]=_[_0xb174('0x32')](db[_0xb174('0x57')][_0xb174('0x2c')]);_0x14c779[_0xb174('0x31')]=_[_0xb174('0x32')](_0x2e3b36[_0xb174('0x31')]);_0x14c779[_0xb174('0x33')]=_[_0xb174('0x34')](_0x14c779[_0xb174('0x30')],_0x14c779['query']);_0x54a389[_0xb174('0x35')]=_[_0xb174('0x34')](_0x14c779[_0xb174('0x30')],qs[_0xb174('0x36')](_0x2e3b36[_0xb174('0x31')]['fields']));_0x54a389['attributes']=_0x54a389['attributes'][_0xb174('0x44')]?_0x54a389[_0xb174('0x35')]:_0x14c779[_0xb174('0x30')];if(!_0x2e3b36[_0xb174('0x31')][_0xb174('0x37')]('nolimit')){_0x54a389[_0xb174('0x1b')]=qs[_0xb174('0x1b')](_0x2e3b36['query'][_0xb174('0x1b')]);_0x54a389[_0xb174('0x18')]=qs[_0xb174('0x18')](_0x2e3b36[_0xb174('0x31')][_0xb174('0x18')]);}_0x54a389[_0xb174('0x39')]=qs[_0xb174('0x3a')](_0x2e3b36['query'][_0xb174('0x3a')]);_0x54a389[_0xb174('0x3b')]=qs[_0xb174('0x33')](_['pick'](_0x2e3b36[_0xb174('0x31')],_0x14c779['filters']));_0x54a389[_0xb174('0x3b')]['ProjectId']=_0x5a5ff2['id'];if(_0x2e3b36[_0xb174('0x31')][_0xb174('0x3c')]){_0x54a389[_0xb174('0x3b')]=_['merge'](_0x54a389[_0xb174('0x3b')],{'$or':_['map'](_0x54a389['attributes'],function(_0x5e155d){var _0x4e0264={};_0x4e0264[_0x5e155d]={'$like':'%'+_0x2e3b36[_0xb174('0x31')][_0xb174('0x3c')]+'%'};return _0x4e0264;})});}_0x54a389=_[_0xb174('0x3d')]({},_0x54a389,_0x2e3b36[_0xb174('0x3e')]);return db['JscriptySessionReport']['count']({'where':_0x54a389[_0xb174('0x3b')]})[_0xb174('0x22')](function(_0x3695e4){_0x37fb67['count']=_0x3695e4;if(_0x2e3b36[_0xb174('0x31')]['includeAll']){_0x54a389[_0xb174('0x3f')]=[{'all':!![]}];}return db[_0xb174('0x57')][_0xb174('0x40')](_0x54a389);})[_0xb174('0x22')](function(_0xadb44b){_0x37fb67[_0xb174('0x41')]=_0xadb44b;return _0x37fb67;});}})[_0xb174('0x22')](respondWithFilteredResult(_0x4dd983,_0x54a389))[_0xb174('0x4d')](handleError(_0x4dd983,null));};exports[_0xb174('0x58')]=function(_0x564791,_0x4c5a1f,_0x51abad){var _0x4d1af8={'raw':!![],'where':{}};var _0x401bd3={};var _0x5db8e5={'count':0x0,'rows':[]};return db[_0xb174('0x2b')]['findOne']({'where':{'id':_0x564791[_0xb174('0x43')]['id']}})[_0xb174('0x22')](handleEntityNotFound(_0x4c5a1f,null))[_0xb174('0x22')](function(_0x5b77e1){if(_0x5b77e1){_0x401bd3[_0xb174('0x30')]=_[_0xb174('0x32')](db[_0xb174('0x59')][_0xb174('0x2c')]);_0x401bd3[_0xb174('0x31')]=_['keys'](_0x564791[_0xb174('0x31')]);_0x401bd3[_0xb174('0x33')]=_['intersection'](_0x401bd3[_0xb174('0x30')],_0x401bd3['query']);_0x4d1af8[_0xb174('0x35')]=_[_0xb174('0x34')](_0x401bd3[_0xb174('0x30')],qs[_0xb174('0x36')](_0x564791[_0xb174('0x31')]['fields']));_0x4d1af8[_0xb174('0x35')]=_0x4d1af8[_0xb174('0x35')][_0xb174('0x44')]?_0x4d1af8[_0xb174('0x35')]:_0x401bd3[_0xb174('0x30')];if(!_0x564791[_0xb174('0x31')]['hasOwnProperty'](_0xb174('0x38'))){_0x4d1af8[_0xb174('0x1b')]=qs[_0xb174('0x1b')](_0x564791[_0xb174('0x31')]['limit']);_0x4d1af8[_0xb174('0x18')]=qs[_0xb174('0x18')](_0x564791[_0xb174('0x31')][_0xb174('0x18')]);}_0x4d1af8[_0xb174('0x39')]=qs['sort'](_0x564791[_0xb174('0x31')]['sort']);_0x4d1af8[_0xb174('0x3b')]=qs[_0xb174('0x33')](_[_0xb174('0x5a')](_0x564791[_0xb174('0x31')],_0x401bd3['filters']));_0x4d1af8['where'][_0xb174('0x5b')]=_0x5b77e1['id'];if(_0x564791[_0xb174('0x31')][_0xb174('0x3c')]){_0x4d1af8[_0xb174('0x3b')]=_[_0xb174('0x3d')](_0x4d1af8[_0xb174('0x3b')],{'$or':_[_0xb174('0x2a')](_0x4d1af8['attributes'],function(_0x37166d){var _0x4c68ef={};_0x4c68ef[_0x37166d]={'$like':'%'+_0x564791[_0xb174('0x31')][_0xb174('0x3c')]+'%'};return _0x4c68ef;})});}_0x4d1af8=_['merge']({},_0x4d1af8,_0x564791[_0xb174('0x3e')]);return db[_0xb174('0x59')][_0xb174('0x1a')]({'where':_0x4d1af8['where']})['then'](function(_0x3f32c3){_0x5db8e5['count']=_0x3f32c3;if(_0x564791['query'][_0xb174('0x45')]){_0x4d1af8['include']=[{'all':!![]}];}return db[_0xb174('0x59')]['findAll'](_0x4d1af8);})['then'](function(_0x36feca){_0x5db8e5[_0xb174('0x41')]=_0x36feca;return _0x5db8e5;});}})['then'](respondWithFilteredResult(_0x4c5a1f,_0x4d1af8))[_0xb174('0x4d')](handleError(_0x4c5a1f,null));};function char(_0x1b655f){return _0xb174('0x5c')===typeof _0x1b655f?String[_0xb174('0x5d')][_0xb174('0x1f')](null,arguments):_0x1b655f;}function needsEncapsulation(_0x4391d7){return!!_0x4391d7&&(_0x4391d7[_0xb174('0x5e')]()[_0xb174('0x5f')](char(0xd))>=0x0||_0x4391d7['toString']()[_0xb174('0x5f')](char(0xa))>=0x0||_0x4391d7['toString']()[_0xb174('0x5f')](char(0x2c))>=0x0||_0x4391d7[_0xb174('0x5e')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x10681){var _0x10b1db=char(0x22),_0x5cd942='\x5c'+char(0x22),_0xe18616=_0x10681[_0xb174('0x5e')]()[_0xb174('0x60')](new RegExp(_0x10b1db,'g'),_0x5cd942);return _0x10b1db+_0xe18616+_0x10b1db;}exports[_0xb174('0x61')]=function(_0x1d863c,_0x522c50,_0x3b3160){var _0x347529,_0xeadfce;var _0x5be49f={'where':{'ProjectId':_0x1d863c[_0xb174('0x43')]['id']}};if(_0x1d863c[_0xb174('0x31')][_0xb174('0x62')]){_0x5be49f[_0xb174('0x3b')]['starttime']=JSON[_0xb174('0x63')](_0x1d863c[_0xb174('0x31')][_0xb174('0x62')]);}return db[_0xb174('0x57')][_0xb174('0x40')](_0x5be49f)[_0xb174('0x22')](handleEntityNotFound(_0x522c50,null))[_0xb174('0x22')](function(_0xbfcf62){if(_0xbfcf62){_0x347529=_0xbfcf62;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0xb174('0x2a')](_0x347529,'id')},'ProjectId':_0x1d863c[_0xb174('0x43')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x522c50,null))[_0xb174('0x22')](function(_0x23a274){if(_0x23a274){_0xeadfce=_0x23a274;var _0x264285={};for(var _0x12fc62=0x0,_0x5ae103=_0xeadfce[_0xb174('0x44')];_0x12fc62<_0x5ae103;_0x12fc62++){if(!_0x264285[_0xb174('0x37')](_0xeadfce[_0x12fc62]['questionId'])){_0x264285[_0xeadfce[_0x12fc62][_0xb174('0x64')]]=needsEncapsulation(_0xeadfce[_0x12fc62][_0xb174('0x65')])?encapsulate(_0xeadfce[_0x12fc62][_0xb174('0x65')]):_0xeadfce[_0x12fc62]['question'];}}var _0x584426=[],_0x2748d8={};for(var _0x4a6ee6=0x0,_0x388e2a=_0x347529[_0xb174('0x44')];_0x4a6ee6<_0x388e2a;_0x4a6ee6++){_0x2748d8={'ProjectId':_0x1d863c[_0xb174('0x43')]['id'],'SessionId':_0x347529[_0x4a6ee6]['id'],'StartTime':moment(_0x347529[_0x4a6ee6][_0xb174('0x66')])[_0xb174('0x67')](_0xb174('0x68'))};for(var _0xd9d379=0x0,_0x334711=_0xeadfce[_0xb174('0x44')];_0xd9d379<_0x334711;_0xd9d379++){if(_0xeadfce[_0xd9d379][_0xb174('0x69')]==_0x347529[_0x4a6ee6]['id']&&_0x264285[_0xb174('0x37')](_0xeadfce[_0xd9d379][_0xb174('0x64')])){_0x2748d8[_0x264285[_0xeadfce[_0xd9d379][_0xb174('0x64')]]]=_0xeadfce[_0xd9d379][_0xb174('0x6a')];}}for(var _0x28199e in _0x264285){if(!_0x2748d8['hasOwnProperty'](_0x264285[_0x28199e])){_0x2748d8[_0x264285[_0x28199e]]=null;}}_0x584426[_0xb174('0x6b')](_0x2748d8);}return _0x584426;}})[_0xb174('0x22')](function(_0x328777){if(!_[_0xb174('0x6c')](_0x328777)){var _0x4f56ea=toCsv(_0x328777);var _0x3d98ee=Date[_0xb174('0x6d')]();fs['writeFileSync'](util[_0xb174('0x67')](_0xb174('0x6e'),_0x1d863c[_0xb174('0x43')]['id'],_0x3d98ee),_0x4f56ea);_0x522c50[_0xb174('0x6f')](_0xb174('0x70'),'attachment;\x20filename='+util[_0xb174('0x67')]('Jscripty_Project_%d_Summary_%s.csv',_0x1d863c[_0xb174('0x43')]['id'],_0x3d98ee));_0x522c50[_0xb174('0x6f')](_0xb174('0x71'),_0xb174('0x72'));return _0x522c50[_0xb174('0x73')](util[_0xb174('0x67')](_0xb174('0x6e'),_0x1d863c['params']['id'],_0x3d98ee));}else{return _0x522c50[_0xb174('0x74')](0xcc);}})[_0xb174('0x4d')](handleError(_0x522c50,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 526c8d2..215c9f7 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 _0xb957=['moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','../../config/logger'];(function(_0xda6c79,_0x33d237){var _0x37d374=function(_0x23638b){while(--_0x23638b){_0xda6c79['push'](_0xda6c79['shift']());}};_0x37d374(++_0x33d237);}(_0xb957,0x6d));var _0x7b95=function(_0x226c94,_0x4fce4c){_0x226c94=_0x226c94-0x0;var _0x410936=_0xb957[_0x226c94];return _0x410936;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7b95('0x0'))('api');var moment=require(_0x7b95('0x1'));var BPromise=require(_0x7b95('0x2'));var rp=require(_0x7b95('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b95('0x4'));var config=require(_0x7b95('0x5'));var attributes=require(_0x7b95('0x6'));module[_0x7b95('0x7')]=function(_0x19ff14,_0x518099){return _0x19ff14[_0x7b95('0x8')](_0x7b95('0x9'),attributes,{'tableName':_0x7b95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c4e=['moment','request-promise','path','rimraf','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4c4e,0x152));var _0xe4c4=function(_0x86a646,_0x28d10f){_0x86a646=_0x86a646-0x0;var _0x2428a6=_0x4c4e[_0x86a646];return _0x2428a6;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var logger=require(_0xe4c4('0x1'))(_0xe4c4('0x2'));var moment=require(_0xe4c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe4c4('0x4'));var fs=require('fs');var path=require(_0xe4c4('0x5'));var rimraf=require(_0xe4c4('0x6'));var config=require('../../config/environment');var attributes=require(_0xe4c4('0x7'));module['exports']=function(_0x177732,_0x1a12a6){return _0x177732[_0xe4c4('0x8')](_0xe4c4('0x9'),attributes,{'tableName':_0xe4c4('0xa'),'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 7d02231..367cd53 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 _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(_0x1020e6,_0x5b3901){var _0x44ee20=function(_0x230987){while(--_0x230987){_0x1020e6['push'](_0x1020e6['shift']());}};_0x44ee20(++_0x5b3901);}(_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 +var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xac4a,0x13f));var _0xaac4=function(_0x5af5e6,_0x39f247){_0x5af5e6=_0x5af5e6-0x0;var _0x278e5d=_0xac4a[_0x5af5e6];return _0x278e5d;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index ff14d20..252cc53 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 _0x23a8=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0x3a0ebd,_0x47f368){var _0x51a660=function(_0x4023e6){while(--_0x4023e6){_0x3a0ebd['push'](_0x3a0ebd['shift']());}};_0x51a660(++_0x47f368);}(_0x23a8,0xd1));var _0x823a=function(_0x240837,_0x3dc212){_0x240837=_0x240837-0x0;var _0x36bd37=_0x23a8[_0x240837];return _0x36bd37;};'use strict';var multer=require(_0x823a('0x0'));var util=require(_0x823a('0x1'));var path=require(_0x823a('0x2'));var timeout=require(_0x823a('0x3'));var express=require(_0x823a('0x4'));var router=express['Router']();var fs_extra=require(_0x823a('0x5'));var auth=require(_0x823a('0x6'));var interaction=require(_0x823a('0x7'));var config=require('../../config/environment');var controller=require(_0x823a('0x8'));router[_0x823a('0x9')]('/',auth[_0x823a('0xa')](),controller[_0x823a('0xb')]);router[_0x823a('0x9')](_0x823a('0xc'),auth[_0x823a('0xa')](),controller[_0x823a('0xd')]);router[_0x823a('0x9')](_0x823a('0xe'),auth[_0x823a('0xa')](),controller[_0x823a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x823a('0x10')]);router['put'](_0x823a('0xe'),auth[_0x823a('0xa')](),controller[_0x823a('0x11')]);router[_0x823a('0x12')](_0x823a('0xe'),auth[_0x823a('0xa')](),controller[_0x823a('0x13')]);module[_0x823a('0x14')]=router; \ No newline at end of file +var _0xe2c4=['update','delete','destroy','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0xe9726c,_0x1f7162){var _0x128da0=function(_0x11eb40){while(--_0x11eb40){_0xe9726c['push'](_0xe9726c['shift']());}};_0x128da0(++_0x1f7162);}(_0xe2c4,0x153));var _0x4e2c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe2c4[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x4e2c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e2c('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x4e2c('0x2'));var interaction=require(_0x4e2c('0x3'));var config=require(_0x4e2c('0x4'));var controller=require(_0x4e2c('0x5'));router[_0x4e2c('0x6')]('/',auth[_0x4e2c('0x7')](),controller[_0x4e2c('0x8')]);router[_0x4e2c('0x6')](_0x4e2c('0x9'),auth[_0x4e2c('0x7')](),controller['describe']);router[_0x4e2c('0x6')](_0x4e2c('0xa'),auth[_0x4e2c('0x7')](),controller['show']);router['post']('/',auth[_0x4e2c('0x7')](),controller['create']);router['put'](_0x4e2c('0xa'),auth['isAuthenticated'](),controller[_0x4e2c('0xb')]);router[_0x4e2c('0xc')](_0x4e2c('0xa'),auth[_0x4e2c('0x7')](),controller[_0x4e2c('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 39cf85a..cbba03f 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(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x7a54,0x106));var _0x47a5=function(_0x4a0d44,_0xce757c){_0x4a0d44=_0x4a0d44-0x0;var _0x1bb33b=_0x7a54[_0x4a0d44];return _0x1bb33b;};'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(_0xd720fd,_0x263043){_0xd720fd=_0xd720fd-0x0;var _0x231a5a=_0x7a54[_0xd720fd];return _0x231a5a;};'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 4800700..0f08ccc 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 _0x5a5a=['../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','nolimit','sort','pick','filter','where','findAll','rows','show','params','fields','include','merge','options','catch','create','body','update','find','describe','rimraf','fast-json-patch','moment','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x1e6f49,_0x536d8e){var _0x528779=function(_0x206619){while(--_0x206619){_0x1e6f49['push'](_0x1e6f49['shift']());}};_0x528779(++_0x536d8e);}(_0x5a5a,0x191));var _0xa5a5=function(_0x589eb4,_0xaa2019){_0x589eb4=_0x589eb4-0x0;var _0xf50816=_0x5a5a[_0x589eb4];return _0xf50816;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5a5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa5a5('0x1'));var rp=require('request-promise');var moment=require(_0xa5a5('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa5a5('0x3'));var sox=require(_0xa5a5('0x4'));var csv=require(_0xa5a5('0x5'));var ejs=require(_0xa5a5('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa5a5('0x7'));var squel=require(_0xa5a5('0x8'));var crypto=require('crypto');var jsforce=require(_0xa5a5('0x9'));var deskjs=require(_0xa5a5('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa5a5('0xb'));var authService=require(_0xa5a5('0xc'));var qs=require(_0xa5a5('0xd'));var as=require(_0xa5a5('0xe'));var hardwareService=require(_0xa5a5('0xf'));var logger=require(_0xa5a5('0x10'))(_0xa5a5('0x11'));var utils=require('../../config/utils');var config=require(_0xa5a5('0x12'));var licenseUtil=require(_0xa5a5('0x13'));var db=require(_0xa5a5('0x14'))['db'];function respondWithStatusCode(_0x285a52,_0x7408a6){_0x7408a6=_0x7408a6||0xcc;return function(_0x2f20e1){if(_0x2f20e1){return _0x285a52['sendStatus'](_0x7408a6);}return _0x285a52[_0xa5a5('0x15')](_0x7408a6)[_0xa5a5('0x16')]();};}function respondWithResult(_0x34aeec,_0x81c371){_0x81c371=_0x81c371||0xc8;return function(_0x282757){if(_0x282757){return _0x34aeec['status'](_0x81c371)[_0xa5a5('0x17')](_0x282757);}};}function respondWithFilteredResult(_0x19f33a,_0x34047f){return function(_0xad442d){if(_0xad442d){var _0x4131ca=typeof _0x34047f[_0xa5a5('0x18')]===_0xa5a5('0x19')&&typeof _0x34047f[_0xa5a5('0x1a')]===_0xa5a5('0x19');var _0x4bb668=_0xad442d[_0xa5a5('0x1b')];var _0x44d2a4=_0x4131ca?0x0:_0x34047f[_0xa5a5('0x18')];var _0x1965a0=_0x4131ca?_0xad442d['count']:_0x34047f[_0xa5a5('0x18')]+_0x34047f[_0xa5a5('0x1a')];var _0xaa276;if(_0x1965a0>=_0x4bb668){_0x1965a0=_0x4bb668;_0xaa276=0xc8;}else{_0xaa276=0xce;}_0x19f33a[_0xa5a5('0x15')](_0xaa276);return _0x19f33a['set'](_0xa5a5('0x1c'),_0x44d2a4+'-'+_0x1965a0+'/'+_0x4bb668)[_0xa5a5('0x17')](_0xad442d);}return null;};}function patchUpdates(_0x5ac75e){return function(_0x3c0920){try{jsonpatch[_0xa5a5('0x1d')](_0x3c0920,_0x5ac75e,!![]);}catch(_0xb9547f){return BPromise[_0xa5a5('0x1e')](_0xb9547f);}return _0x3c0920[_0xa5a5('0x1f')]();};}function saveUpdates(_0x2a2fdc,_0x40531e){return function(_0x4618f4){if(_0x4618f4){return _0x4618f4['update'](_0x2a2fdc)[_0xa5a5('0x20')](function(_0x3042a1){return _0x3042a1;});}return null;};}function removeEntity(_0x4149a7,_0x1578bf){return function(_0x5113b4){if(_0x5113b4){return _0x5113b4[_0xa5a5('0x21')]()[_0xa5a5('0x20')](function(){_0x4149a7[_0xa5a5('0x15')](0xcc)[_0xa5a5('0x16')]();});}};}function handleEntityNotFound(_0x2391e3,_0x1bd72e){return function(_0x405d73){if(!_0x405d73){_0x2391e3[_0xa5a5('0x22')](0x194);}return _0x405d73;};}function handleError(_0x59b0d5,_0x176928){_0x176928=_0x176928||0x1f4;return function(_0x1affa6){logger['error'](_0x1affa6[_0xa5a5('0x23')]);if(_0x1affa6[_0xa5a5('0x24')]){delete _0x1affa6['name'];}_0x59b0d5[_0xa5a5('0x15')](_0x176928)[_0xa5a5('0x25')](_0x1affa6);};}exports[_0xa5a5('0x26')]=function(_0x549881,_0x3e8659){var _0x584706={},_0x411a61={},_0x21a370={'count':0x0,'rows':[]};var _0x6df566=_[_0xa5a5('0x27')](db[_0xa5a5('0x28')]['rawAttributes'],function(_0x184962){return{'name':_0x184962[_0xa5a5('0x29')],'type':_0x184962[_0xa5a5('0x2a')][_0xa5a5('0x2b')]};});_0x411a61['model']=_[_0xa5a5('0x27')](_0x6df566,_0xa5a5('0x24'));_0x411a61[_0xa5a5('0x2c')]=_[_0xa5a5('0x2d')](_0x549881[_0xa5a5('0x2c')]);_0x411a61[_0xa5a5('0x2e')]=_[_0xa5a5('0x2f')](_0x411a61[_0xa5a5('0x30')],_0x411a61[_0xa5a5('0x2c')]);_0x584706[_0xa5a5('0x31')]=_['intersection'](_0x411a61[_0xa5a5('0x30')],qs['fields'](_0x549881[_0xa5a5('0x2c')]['fields']));_0x584706[_0xa5a5('0x31')]=_0x584706[_0xa5a5('0x31')][_0xa5a5('0x32')]?_0x584706[_0xa5a5('0x31')]:_0x411a61[_0xa5a5('0x30')];if(!_0x549881[_0xa5a5('0x2c')]['hasOwnProperty'](_0xa5a5('0x33'))){_0x584706[_0xa5a5('0x1a')]=qs[_0xa5a5('0x1a')](_0x549881[_0xa5a5('0x2c')][_0xa5a5('0x1a')]);_0x584706[_0xa5a5('0x18')]=qs[_0xa5a5('0x18')](_0x549881['query']['offset']);}_0x584706['order']=qs['sort'](_0x549881[_0xa5a5('0x2c')][_0xa5a5('0x34')]);_0x584706['where']=qs['filters'](_[_0xa5a5('0x35')](_0x549881[_0xa5a5('0x2c')],_0x411a61[_0xa5a5('0x2e')]),_0x6df566);if(_0x549881[_0xa5a5('0x2c')][_0xa5a5('0x36')]){_0x584706[_0xa5a5('0x37')]=_['merge'](_0x584706['where'],{'$or':_[_0xa5a5('0x27')](_0x6df566,function(_0x51ae43){if(_0x51ae43[_0xa5a5('0x2a')]!=='VIRTUAL'){var _0x5c84ee={};_0x5c84ee[_0x51ae43[_0xa5a5('0x24')]]={'$like':'%'+_0x549881[_0xa5a5('0x2c')][_0xa5a5('0x36')]+'%'};return _0x5c84ee;}})});}_0x584706=_['merge']({},_0x584706,_0x549881['options']);var _0x1eef78={'where':_0x584706[_0xa5a5('0x37')]};return db[_0xa5a5('0x28')][_0xa5a5('0x1b')](_0x1eef78)[_0xa5a5('0x20')](function(_0x5ada97){_0x21a370['count']=_0x5ada97;if(_0x549881['query']['includeAll']){_0x584706['include']=[{'all':!![]}];}return db[_0xa5a5('0x28')][_0xa5a5('0x38')](_0x584706);})[_0xa5a5('0x20')](function(_0x266c0e){_0x21a370[_0xa5a5('0x39')]=_0x266c0e;return _0x21a370;})[_0xa5a5('0x20')](respondWithFilteredResult(_0x3e8659,_0x584706))['catch'](handleError(_0x3e8659,null));};exports[_0xa5a5('0x3a')]=function(_0x1a32c8,_0x4b6686){var _0x3d51e9={'raw':!![],'where':{'id':_0x1a32c8[_0xa5a5('0x3b')]['id']}},_0x450ca2={};_0x450ca2[_0xa5a5('0x30')]=_[_0xa5a5('0x2d')](db[_0xa5a5('0x28')]['rawAttributes']);_0x450ca2[_0xa5a5('0x2c')]=_[_0xa5a5('0x2d')](_0x1a32c8[_0xa5a5('0x2c')]);_0x450ca2['filters']=_[_0xa5a5('0x2f')](_0x450ca2['model'],_0x450ca2[_0xa5a5('0x2c')]);_0x3d51e9[_0xa5a5('0x31')]=_[_0xa5a5('0x2f')](_0x450ca2[_0xa5a5('0x30')],qs[_0xa5a5('0x3c')](_0x1a32c8['query'][_0xa5a5('0x3c')]));_0x3d51e9['attributes']=_0x3d51e9[_0xa5a5('0x31')][_0xa5a5('0x32')]?_0x3d51e9[_0xa5a5('0x31')]:_0x450ca2[_0xa5a5('0x30')];if(_0x1a32c8[_0xa5a5('0x2c')]['includeAll']){_0x3d51e9[_0xa5a5('0x3d')]=[{'all':!![]}];}_0x3d51e9=_[_0xa5a5('0x3e')]({},_0x3d51e9,_0x1a32c8[_0xa5a5('0x3f')]);return db[_0xa5a5('0x28')]['find'](_0x3d51e9)[_0xa5a5('0x20')](handleEntityNotFound(_0x4b6686,null))[_0xa5a5('0x20')](respondWithResult(_0x4b6686,null))[_0xa5a5('0x40')](handleError(_0x4b6686,null));};exports[_0xa5a5('0x41')]=function(_0x181eb4,_0x1b6c79){return db[_0xa5a5('0x28')][_0xa5a5('0x41')](_0x181eb4[_0xa5a5('0x42')],{})[_0xa5a5('0x20')](respondWithResult(_0x1b6c79,0xc9))[_0xa5a5('0x40')](handleError(_0x1b6c79,null));};exports[_0xa5a5('0x43')]=function(_0x59215b,_0x8a0489){if(_0x59215b[_0xa5a5('0x42')]['id']){delete _0x59215b[_0xa5a5('0x42')]['id'];}return db[_0xa5a5('0x28')][_0xa5a5('0x44')]({'where':{'id':_0x59215b[_0xa5a5('0x3b')]['id']}})['then'](handleEntityNotFound(_0x8a0489,null))[_0xa5a5('0x20')](saveUpdates(_0x59215b['body'],null))[_0xa5a5('0x20')](respondWithResult(_0x8a0489,null))[_0xa5a5('0x40')](handleError(_0x8a0489,null));};exports[_0xa5a5('0x21')]=function(_0x6d293a,_0x2a72e1){return db[_0xa5a5('0x28')][_0xa5a5('0x44')]({'where':{'id':_0x6d293a['params']['id']}})['then'](handleEntityNotFound(_0x2a72e1,null))[_0xa5a5('0x20')](removeEntity(_0x2a72e1,null))['catch'](handleError(_0x2a72e1,null));};exports[_0xa5a5('0x45')]=function(_0x510407,_0x3b6918){return db[_0xa5a5('0x28')][_0xa5a5('0x45')]()[_0xa5a5('0x20')](respondWithResult(_0x3b6918,null))[_0xa5a5('0x40')](handleError(_0x3b6918,null));}; \ No newline at end of file +var _0x3524=['show','params','length','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','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','limit','count','offset','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','filter','where','merge','options','include','findAll','rows','catch'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0x3524,0x14c));var _0x4352=function(_0x362cf3,_0x355fe3){_0x362cf3=_0x362cf3-0x0;var _0x539116=_0x3524[_0x362cf3];return _0x539116;};'use strict';var emlformat=require(_0x4352('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4352('0x1'));var jsonpatch=require(_0x4352('0x2'));var rp=require(_0x4352('0x3'));var moment=require(_0x4352('0x4'));var BPromise=require(_0x4352('0x5'));var Mustache=require(_0x4352('0x6'));var util=require(_0x4352('0x7'));var path=require(_0x4352('0x8'));var sox=require(_0x4352('0x9'));var csv=require(_0x4352('0xa'));var ejs=require(_0x4352('0xb'));var fs=require('fs');var fs_extra=require(_0x4352('0xc'));var _=require(_0x4352('0xd'));var squel=require(_0x4352('0xe'));var crypto=require(_0x4352('0xf'));var jsforce=require(_0x4352('0x10'));var deskjs=require(_0x4352('0x11'));var toCsv=require('to-csv');var querystring=require(_0x4352('0x12'));var Papa=require(_0x4352('0x13'));var Redis=require(_0x4352('0x14'));var authService=require(_0x4352('0x15'));var qs=require(_0x4352('0x16'));var as=require(_0x4352('0x17'));var hardwareService=require(_0x4352('0x18'));var logger=require(_0x4352('0x19'))(_0x4352('0x1a'));var utils=require(_0x4352('0x1b'));var config=require(_0x4352('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x4352('0x1d'))['db'];function respondWithStatusCode(_0x51ae38,_0xe351e3){_0xe351e3=_0xe351e3||0xcc;return function(_0x309195){if(_0x309195){return _0x51ae38[_0x4352('0x1e')](_0xe351e3);}return _0x51ae38[_0x4352('0x1f')](_0xe351e3)[_0x4352('0x20')]();};}function respondWithResult(_0x40b958,_0x1aab23){_0x1aab23=_0x1aab23||0xc8;return function(_0x5993e1){if(_0x5993e1){return _0x40b958[_0x4352('0x1f')](_0x1aab23)['json'](_0x5993e1);}};}function respondWithFilteredResult(_0x91793f,_0x508a6a){return function(_0x1280bf){if(_0x1280bf){var _0x1f32a9=typeof _0x508a6a['offset']==='undefined'&&typeof _0x508a6a[_0x4352('0x21')]==='undefined';var _0x2111f9=_0x1280bf[_0x4352('0x22')];var _0x3ea786=_0x1f32a9?0x0:_0x508a6a[_0x4352('0x23')];var _0x47f6a1=_0x1f32a9?_0x1280bf[_0x4352('0x22')]:_0x508a6a[_0x4352('0x23')]+_0x508a6a[_0x4352('0x21')];var _0x2e98c4;if(_0x47f6a1>=_0x2111f9){_0x47f6a1=_0x2111f9;_0x2e98c4=0xc8;}else{_0x2e98c4=0xce;}_0x91793f[_0x4352('0x1f')](_0x2e98c4);return _0x91793f[_0x4352('0x24')](_0x4352('0x25'),_0x3ea786+'-'+_0x47f6a1+'/'+_0x2111f9)[_0x4352('0x26')](_0x1280bf);}return null;};}function patchUpdates(_0x59191a){return function(_0x5597c0){try{jsonpatch[_0x4352('0x27')](_0x5597c0,_0x59191a,!![]);}catch(_0x539b7f){return BPromise[_0x4352('0x28')](_0x539b7f);}return _0x5597c0[_0x4352('0x29')]();};}function saveUpdates(_0x245e15,_0x5c0ef8){return function(_0x5c1b07){if(_0x5c1b07){return _0x5c1b07['update'](_0x245e15)['then'](function(_0x295205){return _0x295205;});}return null;};}function removeEntity(_0x563ed5,_0x3a4536){return function(_0x59e098){if(_0x59e098){return _0x59e098[_0x4352('0x2a')]()[_0x4352('0x2b')](function(){_0x563ed5[_0x4352('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45c195,_0x3b8e41){return function(_0x45babc){if(!_0x45babc){_0x45c195[_0x4352('0x1e')](0x194);}return _0x45babc;};}function handleError(_0x409c6c,_0x39d3d7){_0x39d3d7=_0x39d3d7||0x1f4;return function(_0x534c7a){logger[_0x4352('0x2c')](_0x534c7a[_0x4352('0x2d')]);if(_0x534c7a[_0x4352('0x2e')]){delete _0x534c7a['name'];}_0x409c6c[_0x4352('0x1f')](_0x39d3d7)[_0x4352('0x2f')](_0x534c7a);};}exports[_0x4352('0x30')]=function(_0x3ae7f4,_0xc7230b){var _0xbd2109={},_0x279426={},_0x541230={'count':0x0,'rows':[]};var _0x22ff2d=_[_0x4352('0x31')](db[_0x4352('0x32')][_0x4352('0x33')],function(_0x12a1c7){return{'name':_0x12a1c7[_0x4352('0x34')],'type':_0x12a1c7[_0x4352('0x35')][_0x4352('0x36')]};});_0x279426[_0x4352('0x37')]=_[_0x4352('0x31')](_0x22ff2d,_0x4352('0x2e'));_0x279426[_0x4352('0x38')]=_[_0x4352('0x39')](_0x3ae7f4['query']);_0x279426[_0x4352('0x3a')]=_['intersection'](_0x279426[_0x4352('0x37')],_0x279426[_0x4352('0x38')]);_0xbd2109[_0x4352('0x3b')]=_[_0x4352('0x3c')](_0x279426['model'],qs[_0x4352('0x3d')](_0x3ae7f4[_0x4352('0x38')][_0x4352('0x3d')]));_0xbd2109['attributes']=_0xbd2109[_0x4352('0x3b')]['length']?_0xbd2109[_0x4352('0x3b')]:_0x279426[_0x4352('0x37')];if(!_0x3ae7f4[_0x4352('0x38')]['hasOwnProperty'](_0x4352('0x3e'))){_0xbd2109[_0x4352('0x21')]=qs['limit'](_0x3ae7f4[_0x4352('0x38')][_0x4352('0x21')]);_0xbd2109[_0x4352('0x23')]=qs[_0x4352('0x23')](_0x3ae7f4[_0x4352('0x38')][_0x4352('0x23')]);}_0xbd2109[_0x4352('0x3f')]=qs[_0x4352('0x40')](_0x3ae7f4[_0x4352('0x38')][_0x4352('0x40')]);_0xbd2109['where']=qs['filters'](_['pick'](_0x3ae7f4[_0x4352('0x38')],_0x279426[_0x4352('0x3a')]),_0x22ff2d);if(_0x3ae7f4[_0x4352('0x38')][_0x4352('0x41')]){_0xbd2109[_0x4352('0x42')]=_[_0x4352('0x43')](_0xbd2109[_0x4352('0x42')],{'$or':_[_0x4352('0x31')](_0x22ff2d,function(_0x36d95d){if(_0x36d95d[_0x4352('0x35')]!=='VIRTUAL'){var _0x121581={};_0x121581[_0x36d95d[_0x4352('0x2e')]]={'$like':'%'+_0x3ae7f4[_0x4352('0x38')][_0x4352('0x41')]+'%'};return _0x121581;}})});}_0xbd2109=_[_0x4352('0x43')]({},_0xbd2109,_0x3ae7f4[_0x4352('0x44')]);var _0x166c90={'where':_0xbd2109[_0x4352('0x42')]};return db[_0x4352('0x32')][_0x4352('0x22')](_0x166c90)[_0x4352('0x2b')](function(_0xdbe309){_0x541230[_0x4352('0x22')]=_0xdbe309;if(_0x3ae7f4[_0x4352('0x38')]['includeAll']){_0xbd2109[_0x4352('0x45')]=[{'all':!![]}];}return db[_0x4352('0x32')][_0x4352('0x46')](_0xbd2109);})['then'](function(_0x29e207){_0x541230[_0x4352('0x47')]=_0x29e207;return _0x541230;})[_0x4352('0x2b')](respondWithFilteredResult(_0xc7230b,_0xbd2109))[_0x4352('0x48')](handleError(_0xc7230b,null));};exports[_0x4352('0x49')]=function(_0x5ddffa,_0x1160bf){var _0x490627={'raw':!![],'where':{'id':_0x5ddffa[_0x4352('0x4a')]['id']}},_0x58a942={};_0x58a942[_0x4352('0x37')]=_[_0x4352('0x39')](db[_0x4352('0x32')][_0x4352('0x33')]);_0x58a942['query']=_[_0x4352('0x39')](_0x5ddffa[_0x4352('0x38')]);_0x58a942[_0x4352('0x3a')]=_[_0x4352('0x3c')](_0x58a942[_0x4352('0x37')],_0x58a942['query']);_0x490627[_0x4352('0x3b')]=_[_0x4352('0x3c')](_0x58a942[_0x4352('0x37')],qs[_0x4352('0x3d')](_0x5ddffa[_0x4352('0x38')][_0x4352('0x3d')]));_0x490627[_0x4352('0x3b')]=_0x490627[_0x4352('0x3b')][_0x4352('0x4b')]?_0x490627['attributes']:_0x58a942[_0x4352('0x37')];if(_0x5ddffa['query'][_0x4352('0x4c')]){_0x490627[_0x4352('0x45')]=[{'all':!![]}];}_0x490627=_[_0x4352('0x43')]({},_0x490627,_0x5ddffa[_0x4352('0x44')]);return db[_0x4352('0x32')][_0x4352('0x4d')](_0x490627)[_0x4352('0x2b')](handleEntityNotFound(_0x1160bf,null))[_0x4352('0x2b')](respondWithResult(_0x1160bf,null))[_0x4352('0x48')](handleError(_0x1160bf,null));};exports[_0x4352('0x4e')]=function(_0x193ba1,_0x10ef36){return db[_0x4352('0x32')][_0x4352('0x4e')](_0x193ba1[_0x4352('0x4f')],{})[_0x4352('0x2b')](respondWithResult(_0x10ef36,0xc9))[_0x4352('0x48')](handleError(_0x10ef36,null));};exports['update']=function(_0x160f35,_0x503457){if(_0x160f35[_0x4352('0x4f')]['id']){delete _0x160f35[_0x4352('0x4f')]['id'];}return db[_0x4352('0x32')]['find']({'where':{'id':_0x160f35[_0x4352('0x4a')]['id']}})[_0x4352('0x2b')](handleEntityNotFound(_0x503457,null))[_0x4352('0x2b')](saveUpdates(_0x160f35['body'],null))['then'](respondWithResult(_0x503457,null))[_0x4352('0x48')](handleError(_0x503457,null));};exports[_0x4352('0x2a')]=function(_0x59ec74,_0x59b270){return db[_0x4352('0x32')][_0x4352('0x4d')]({'where':{'id':_0x59ec74['params']['id']}})[_0x4352('0x2b')](handleEntityNotFound(_0x59b270,null))[_0x4352('0x2b')](removeEntity(_0x59b270,null))[_0x4352('0x48')](handleError(_0x59b270,null));};exports[_0x4352('0x50')]=function(_0x283726,_0x3fcca0){return db[_0x4352('0x32')][_0x4352('0x50')]()[_0x4352('0x2b')](respondWithResult(_0x3fcca0,null))['catch'](handleError(_0x3fcca0,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 978ce0b..d934dc4 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 _0x2144=['moment','bluebird','path','rimraf','./jscriptyQuestionReport.attributes','exports','lodash','util','../../config/logger','api'];(function(_0xd44397,_0x3111b4){var _0x4cd1f8=function(_0x430274){while(--_0x430274){_0xd44397['push'](_0xd44397['shift']());}};_0x4cd1f8(++_0x3111b4);}(_0x2144,0x15a));var _0x4214=function(_0x4071cc,_0x2ba75f){_0x4071cc=_0x4071cc-0x0;var _0x2f2f8c=_0x2144[_0x4071cc];return _0x2f2f8c;};'use strict';var _=require(_0x4214('0x0'));var util=require(_0x4214('0x1'));var logger=require(_0x4214('0x2'))(_0x4214('0x3'));var moment=require(_0x4214('0x4'));var BPromise=require(_0x4214('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4214('0x6'));var rimraf=require(_0x4214('0x7'));var config=require('../../config/environment');var attributes=require(_0x4214('0x8'));module[_0x4214('0x9')]=function(_0x44a7ee,_0x3c1c44){return _0x44a7ee['define']('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd463=['../../config/environment','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x100cd0,_0x5b4781){var _0x5ef79e=function(_0x4f83f1){while(--_0x4f83f1){_0x100cd0['push'](_0x100cd0['shift']());}};_0x5ef79e(++_0x5b4781);}(_0xd463,0x1a7));var _0x3d46=function(_0x37e307,_0x378e6c){_0x37e307=_0x37e307-0x0;var _0x44a38c=_0xd463[_0x37e307];return _0x44a38c;};'use strict';var _=require(_0x3d46('0x0'));var util=require('util');var logger=require(_0x3d46('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3d46('0x2'));var rp=require(_0x3d46('0x3'));var fs=require('fs');var path=require(_0x3d46('0x4'));var rimraf=require(_0x3d46('0x5'));var config=require(_0x3d46('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x3d46('0x7')]=function(_0x1f99b7,_0x146772){return _0x1f99b7[_0x3d46('0x8')](_0x3d46('0x9'),attributes,{'tableName':_0x3d46('0xa'),'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 296c61b..c4a371e 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 _0xdf04=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x4d6f1e,_0x39bdc6){var _0x353276=function(_0x592922){while(--_0x592922){_0x4d6f1e['push'](_0x4d6f1e['shift']());}};_0x353276(++_0x39bdc6);}(_0xdf04,0x162));var _0x4df0=function(_0x44207b,_0x51e14b){_0x44207b=_0x44207b-0x0;var _0x881624=_0xdf04[_0x44207b];return _0x881624;};'use strict';var _=require(_0x4df0('0x0'));var util=require(_0x4df0('0x1'));var moment=require(_0x4df0('0x2'));var BPromise=require(_0x4df0('0x3'));var rs=require(_0x4df0('0x4'));var fs=require('fs');var Redis=require(_0x4df0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4df0('0x6'));var logger=require(_0x4df0('0x7'))(_0x4df0('0x8'));var config=require('../../config/environment');var jayson=require(_0x4df0('0x9'));var client=jayson[_0x4df0('0xa')][_0x4df0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bdf40,_0x2da3d6,_0x387e3a){return new BPromise(function(_0x2a0d6d,_0x54f69d){return client[_0x4df0('0xc')](_0x4bdf40,_0x387e3a)['then'](function(_0x3f55c5){logger[_0x4df0('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2da3d6,'request\x20sent');logger[_0x4df0('0xe')](_0x4df0('0xf'),_0x2da3d6,_0x4df0('0x10'),JSON[_0x4df0('0x11')](_0x3f55c5));if(_0x3f55c5[_0x4df0('0x12')]){if(_0x3f55c5['error']['code']===0x1f4){logger[_0x4df0('0x12')](_0x4df0('0x13'),_0x2da3d6,_0x3f55c5['error']['message']);return _0x54f69d(_0x3f55c5['error']['message']);}logger[_0x4df0('0x12')](_0x4df0('0x13'),_0x2da3d6,_0x3f55c5[_0x4df0('0x12')]['message']);return _0x2a0d6d(_0x3f55c5[_0x4df0('0x12')][_0x4df0('0x14')]);}else{logger[_0x4df0('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2da3d6,_0x4df0('0x10'));_0x2a0d6d(_0x3f55c5[_0x4df0('0x15')][_0x4df0('0x14')]);}})[_0x4df0('0x16')](function(_0x5b4b7b){logger[_0x4df0('0x12')](_0x4df0('0x13'),_0x2da3d6,_0x5b4b7b);_0x54f69d(_0x5b4b7b);});});} \ No newline at end of file +var _0x9040=['JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','error','code'];(function(_0x145690,_0x216725){var _0x4e66cf=function(_0x2f2cd7){while(--_0x2f2cd7){_0x145690['push'](_0x145690['shift']());}};_0x4e66cf(++_0x216725);}(_0x9040,0x12a));var _0x0904=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x9040[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x0904('0x0'));var util=require(_0x0904('0x1'));var moment=require(_0x0904('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0904('0x3'));var db=require(_0x0904('0x4'))['db'];var utils=require(_0x0904('0x5'));var logger=require(_0x0904('0x6'))(_0x0904('0x7'));var config=require(_0x0904('0x8'));var jayson=require(_0x0904('0x9'));var client=jayson[_0x0904('0xa')][_0x0904('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30f2b4,_0x2fdb84,_0x2e5797){return new BPromise(function(_0x43b06a,_0x6518b4){return client['request'](_0x30f2b4,_0x2e5797)[_0x0904('0xc')](function(_0x149d43){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x2fdb84,_0x0904('0xd'));logger[_0x0904('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2fdb84,_0x0904('0xd'),JSON['stringify'](_0x149d43));if(_0x149d43[_0x0904('0xf')]){if(_0x149d43[_0x0904('0xf')][_0x0904('0x10')]===0x1f4){logger[_0x0904('0xf')](_0x0904('0x11'),_0x2fdb84,_0x149d43[_0x0904('0xf')][_0x0904('0x12')]);return _0x6518b4(_0x149d43[_0x0904('0xf')][_0x0904('0x12')]);}logger['error'](_0x0904('0x11'),_0x2fdb84,_0x149d43[_0x0904('0xf')]['message']);return _0x43b06a(_0x149d43[_0x0904('0xf')][_0x0904('0x12')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x2fdb84,_0x0904('0xd'));_0x43b06a(_0x149d43[_0x0904('0x13')]['message']);}})[_0x0904('0x14')](function(_0x5803a8){logger[_0x0904('0xf')](_0x0904('0x11'),_0x2fdb84,_0x5803a8);_0x6518b4(_0x5803a8);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 5555c28..c74a97c 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 _0xfc8e=['/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfc8e,0x9c));var _0xefc8=function(_0x2cab21,_0x72aab5){_0x2cab21=_0x2cab21-0x0;var _0x4cf8ba=_0xfc8e[_0x2cab21];return _0x4cf8ba;};'use strict';var multer=require('multer');var util=require(_0xefc8('0x0'));var path=require('path');var timeout=require(_0xefc8('0x1'));var express=require(_0xefc8('0x2'));var router=express[_0xefc8('0x3')]();var fs_extra=require(_0xefc8('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xefc8('0x5'));router[_0xefc8('0x6')]('/',auth[_0xefc8('0x7')](),controller[_0xefc8('0x8')]);router[_0xefc8('0x6')]('/describe',auth[_0xefc8('0x7')](),controller[_0xefc8('0x9')]);router[_0xefc8('0x6')](_0xefc8('0xa'),auth[_0xefc8('0x7')](),controller[_0xefc8('0xb')]);router[_0xefc8('0x6')](_0xefc8('0xc'),auth[_0xefc8('0x7')](),controller[_0xefc8('0xd')]);router[_0xefc8('0xe')]('/',auth['isAuthenticated'](),controller[_0xefc8('0xf')]);router[_0xefc8('0x10')](_0xefc8('0xa'),auth[_0xefc8('0x7')](),controller[_0xefc8('0x11')]);router[_0xefc8('0x12')](_0xefc8('0xa'),auth[_0xefc8('0x7')](),controller[_0xefc8('0x13')]);module[_0xefc8('0x14')]=router; \ No newline at end of file +var _0xa298=['show','/:id/questions','post','create','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe'];(function(_0x16fa14,_0x2c2a55){var _0xcfac01=function(_0x42ede5){while(--_0x42ede5){_0x16fa14['push'](_0x16fa14['shift']());}};_0xcfac01(++_0x2c2a55);}(_0xa298,0x100));var _0x8a29=function(_0x694a74,_0x5e0f5b){_0x694a74=_0x694a74-0x0;var _0x162f25=_0xa298[_0x694a74];return _0x162f25;};'use strict';var multer=require(_0x8a29('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8a29('0x1'));var express=require('express');var router=express[_0x8a29('0x2')]();var fs_extra=require(_0x8a29('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8a29('0x4'));var config=require(_0x8a29('0x5'));var controller=require(_0x8a29('0x6'));router[_0x8a29('0x7')]('/',auth[_0x8a29('0x8')](),controller['index']);router[_0x8a29('0x7')]('/describe',auth[_0x8a29('0x8')](),controller[_0x8a29('0x9')]);router[_0x8a29('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x8a29('0xa')]);router['get'](_0x8a29('0xb'),auth[_0x8a29('0x8')](),controller['getQuestions']);router[_0x8a29('0xc')]('/',auth['isAuthenticated'](),controller[_0x8a29('0xd')]);router['put'](_0x8a29('0xe'),auth['isAuthenticated'](),controller[_0x8a29('0xf')]);router[_0x8a29('0x10')](_0x8a29('0xe'),auth[_0x8a29('0x8')](),controller[_0x8a29('0x11')]);module[_0x8a29('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 64c529e..ba06493 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 _0x8417=['exports','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','sequelize'];(function(_0x428659,_0x4e40bf){var _0x3e7c37=function(_0x5648f3){while(--_0x5648f3){_0x428659['push'](_0x428659['shift']());}};_0x3e7c37(++_0x4e40bf);}(_0x8417,0xfa));var _0x7841=function(_0x4620c5,_0x2079db){_0x4620c5=_0x4620c5-0x0;var _0x15310d=_0x8417[_0x4620c5];return _0x15310d;};'use strict';var moment=require(_0x7841('0x0'));var Sequelize=require(_0x7841('0x1'));module[_0x7841('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x4ce4b8){this[_0x7841('0x3')]('starttime',_0x4ce4b8);this[_0x7841('0x3')](_0x7841('0x4'),moment()['format'](_0x7841('0x5')));}},'endtime':{'type':Sequelize[_0x7841('0x6')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x7841('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7841('0x7')]},'calleridname':{'type':Sequelize[_0x7841('0x7')]},'calleridnum':{'type':Sequelize[_0x7841('0x7')]},'completed':{'type':Sequelize[_0x7841('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xff3d=['endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime'];(function(_0x3ab001,_0x1c14b1){var _0x251660=function(_0x1b4478){while(--_0x1b4478){_0x3ab001['push'](_0x3ab001['shift']());}};_0x251660(++_0x1c14b1);}(_0xff3d,0x126));var _0xdff3=function(_0x16c8b4,_0x594f30){_0x16c8b4=_0x16c8b4-0x0;var _0x3ba4c7=_0xff3d[_0x16c8b4];return _0x3ba4c7;};'use strict';var moment=require(_0xdff3('0x0'));var Sequelize=require(_0xdff3('0x1'));module[_0xdff3('0x2')]={'starttime':{'type':Sequelize[_0xdff3('0x3')],'set':function(_0xcc8956){this[_0xdff3('0x4')](_0xdff3('0x5'),_0xcc8956);this[_0xdff3('0x4')](_0xdff3('0x6'),moment()['format'](_0xdff3('0x7')));}},'endtime':{'type':Sequelize[_0xdff3('0x3')]},'membername':{'type':Sequelize[_0xdff3('0x8')]},'projectname':{'type':Sequelize[_0xdff3('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xdff3('0x8')]},'calleridname':{'type':Sequelize[_0xdff3('0x8')]},'calleridnum':{'type':Sequelize[_0xdff3('0x8')]},'completed':{'type':Sequelize[_0xdff3('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 9e641dd..170e733 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 _0x3476=['desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','include','options','find','catch','create','body','params','describe','getQuestions','findOne','order','SessionId','JscriptyQuestionReport','rimraf','fast-json-patch','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce'];(function(_0x258180,_0x593d87){var _0x37a1eb=function(_0x146f01){while(--_0x146f01){_0x258180['push'](_0x258180['shift']());}};_0x37a1eb(++_0x593d87);}(_0x3476,0x12a));var _0x6347=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x3476[_0x176329];return _0x31997c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6347('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6347('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6347('0x2'));var Mustache=require(_0x6347('0x3'));var util=require(_0x6347('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x6347('0x5'));var ejs=require(_0x6347('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6347('0x7'));var squel=require(_0x6347('0x8'));var crypto=require('crypto');var jsforce=require(_0x6347('0x9'));var deskjs=require(_0x6347('0xa'));var toCsv=require(_0x6347('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6347('0xb'));var authService=require(_0x6347('0xc'));var qs=require(_0x6347('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6347('0xe'));var logger=require(_0x6347('0xf'))(_0x6347('0x10'));var utils=require(_0x6347('0x11'));var config=require(_0x6347('0x12'));var licenseUtil=require(_0x6347('0x13'));var db=require(_0x6347('0x14'))['db'];function respondWithStatusCode(_0x1c9ada,_0x2d71c5){_0x2d71c5=_0x2d71c5||0xcc;return function(_0x72e624){if(_0x72e624){return _0x1c9ada['sendStatus'](_0x2d71c5);}return _0x1c9ada[_0x6347('0x15')](_0x2d71c5)[_0x6347('0x16')]();};}function respondWithResult(_0x2c8978,_0xfcdb0a){_0xfcdb0a=_0xfcdb0a||0xc8;return function(_0x32caa5){if(_0x32caa5){return _0x2c8978[_0x6347('0x15')](_0xfcdb0a)[_0x6347('0x17')](_0x32caa5);}};}function respondWithFilteredResult(_0x2cf7d3,_0x3b9262){return function(_0x295a5e){if(_0x295a5e){var _0x1a8159=typeof _0x3b9262['offset']===_0x6347('0x18')&&typeof _0x3b9262[_0x6347('0x19')]==='undefined';var _0x5c9cf3=_0x295a5e[_0x6347('0x1a')];var _0x5c2614=_0x1a8159?0x0:_0x3b9262[_0x6347('0x1b')];var _0x2052db=_0x1a8159?_0x295a5e[_0x6347('0x1a')]:_0x3b9262[_0x6347('0x1b')]+_0x3b9262[_0x6347('0x19')];var _0x70a6c8;if(_0x2052db>=_0x5c9cf3){_0x2052db=_0x5c9cf3;_0x70a6c8=0xc8;}else{_0x70a6c8=0xce;}_0x2cf7d3[_0x6347('0x15')](_0x70a6c8);return _0x2cf7d3[_0x6347('0x1c')](_0x6347('0x1d'),_0x5c2614+'-'+_0x2052db+'/'+_0x5c9cf3)[_0x6347('0x17')](_0x295a5e);}return null;};}function patchUpdates(_0x4e92d5){return function(_0x53c21b){try{jsonpatch['apply'](_0x53c21b,_0x4e92d5,!![]);}catch(_0x538c35){return BPromise[_0x6347('0x1e')](_0x538c35);}return _0x53c21b[_0x6347('0x1f')]();};}function saveUpdates(_0x59c27d,_0x296245){return function(_0x269078){if(_0x269078){return _0x269078['update'](_0x59c27d)[_0x6347('0x20')](function(_0x30dccf){return _0x30dccf;});}return null;};}function removeEntity(_0x515f7c,_0x155602){return function(_0x3c1c20){if(_0x3c1c20){return _0x3c1c20[_0x6347('0x21')]()[_0x6347('0x20')](function(){_0x515f7c['status'](0xcc)[_0x6347('0x16')]();});}};}function handleEntityNotFound(_0x2b5840,_0x3e6866){return function(_0xb46f5d){if(!_0xb46f5d){_0x2b5840[_0x6347('0x22')](0x194);}return _0xb46f5d;};}function handleError(_0x132d69,_0x2ec29f){_0x2ec29f=_0x2ec29f||0x1f4;return function(_0x1c7bd0){logger[_0x6347('0x23')](_0x1c7bd0[_0x6347('0x24')]);if(_0x1c7bd0[_0x6347('0x25')]){delete _0x1c7bd0[_0x6347('0x25')];}_0x132d69['status'](_0x2ec29f)[_0x6347('0x26')](_0x1c7bd0);};}exports[_0x6347('0x27')]=function(_0x3ed1ea,_0x24aa12){var _0x2bca9e={},_0x3068f2={},_0x3ddbd9={'count':0x0,'rows':[]};var _0x3d2349=_[_0x6347('0x28')](db[_0x6347('0x29')][_0x6347('0x2a')],function(_0x2ed56e){return{'name':_0x2ed56e['fieldName'],'type':_0x2ed56e[_0x6347('0x2b')][_0x6347('0x2c')]};});_0x3068f2[_0x6347('0x2d')]=_['map'](_0x3d2349,_0x6347('0x25'));_0x3068f2[_0x6347('0x2e')]=_[_0x6347('0x2f')](_0x3ed1ea['query']);_0x3068f2[_0x6347('0x30')]=_[_0x6347('0x31')](_0x3068f2['model'],_0x3068f2[_0x6347('0x2e')]);_0x2bca9e[_0x6347('0x32')]=_['intersection'](_0x3068f2[_0x6347('0x2d')],qs[_0x6347('0x33')](_0x3ed1ea['query']['fields']));_0x2bca9e['attributes']=_0x2bca9e[_0x6347('0x32')][_0x6347('0x34')]?_0x2bca9e[_0x6347('0x32')]:_0x3068f2[_0x6347('0x2d')];if(!_0x3ed1ea[_0x6347('0x2e')][_0x6347('0x35')](_0x6347('0x36'))){_0x2bca9e[_0x6347('0x19')]=qs[_0x6347('0x19')](_0x3ed1ea[_0x6347('0x2e')][_0x6347('0x19')]);_0x2bca9e[_0x6347('0x1b')]=qs[_0x6347('0x1b')](_0x3ed1ea[_0x6347('0x2e')][_0x6347('0x1b')]);}_0x2bca9e['order']=qs['sort'](_0x3ed1ea[_0x6347('0x2e')][_0x6347('0x37')]);_0x2bca9e[_0x6347('0x38')]=qs[_0x6347('0x30')](_[_0x6347('0x39')](_0x3ed1ea[_0x6347('0x2e')],_0x3068f2['filters']),_0x3d2349);if(_0x3ed1ea[_0x6347('0x2e')][_0x6347('0x3a')]){_0x2bca9e[_0x6347('0x38')]=_[_0x6347('0x3b')](_0x2bca9e[_0x6347('0x38')],{'$or':_[_0x6347('0x28')](_0x3d2349,function(_0x45613e){if(_0x45613e[_0x6347('0x2b')]!==_0x6347('0x3c')){var _0x1125c1={};_0x1125c1[_0x45613e[_0x6347('0x25')]]={'$like':'%'+_0x3ed1ea[_0x6347('0x2e')][_0x6347('0x3a')]+'%'};return _0x1125c1;}})});}_0x2bca9e=_[_0x6347('0x3b')]({},_0x2bca9e,_0x3ed1ea['options']);var _0x339b23={'where':_0x2bca9e[_0x6347('0x38')]};return db[_0x6347('0x29')]['count'](_0x339b23)[_0x6347('0x20')](function(_0x11f6c8){_0x3ddbd9[_0x6347('0x1a')]=_0x11f6c8;if(_0x3ed1ea['query'][_0x6347('0x3d')]){_0x2bca9e['include']=[{'all':!![]}];}return db[_0x6347('0x29')][_0x6347('0x3e')](_0x2bca9e);})['then'](function(_0x36c17a){_0x3ddbd9[_0x6347('0x3f')]=_0x36c17a;return _0x3ddbd9;})[_0x6347('0x20')](respondWithFilteredResult(_0x24aa12,_0x2bca9e))['catch'](handleError(_0x24aa12,null));};exports['show']=function(_0x5eaa02,_0xebc7eb){var _0x4e8945={'raw':!![],'where':{'id':_0x5eaa02['params']['id']}},_0x4fcd63={};_0x4fcd63[_0x6347('0x2d')]=_[_0x6347('0x2f')](db[_0x6347('0x29')][_0x6347('0x2a')]);_0x4fcd63[_0x6347('0x2e')]=_[_0x6347('0x2f')](_0x5eaa02[_0x6347('0x2e')]);_0x4fcd63[_0x6347('0x30')]=_[_0x6347('0x31')](_0x4fcd63[_0x6347('0x2d')],_0x4fcd63['query']);_0x4e8945[_0x6347('0x32')]=_['intersection'](_0x4fcd63[_0x6347('0x2d')],qs[_0x6347('0x33')](_0x5eaa02[_0x6347('0x2e')][_0x6347('0x33')]));_0x4e8945['attributes']=_0x4e8945[_0x6347('0x32')]['length']?_0x4e8945['attributes']:_0x4fcd63[_0x6347('0x2d')];if(_0x5eaa02['query']['includeAll']){_0x4e8945[_0x6347('0x40')]=[{'all':!![]}];}_0x4e8945=_[_0x6347('0x3b')]({},_0x4e8945,_0x5eaa02[_0x6347('0x41')]);return db[_0x6347('0x29')][_0x6347('0x42')](_0x4e8945)['then'](handleEntityNotFound(_0xebc7eb,null))[_0x6347('0x20')](respondWithResult(_0xebc7eb,null))[_0x6347('0x43')](handleError(_0xebc7eb,null));};exports[_0x6347('0x44')]=function(_0x4216f1,_0x5cf128){return db[_0x6347('0x29')][_0x6347('0x44')](_0x4216f1[_0x6347('0x45')],{})[_0x6347('0x20')](respondWithResult(_0x5cf128,0xc9))[_0x6347('0x43')](handleError(_0x5cf128,null));};exports['update']=function(_0x308588,_0x174016){if(_0x308588[_0x6347('0x45')]['id']){delete _0x308588[_0x6347('0x45')]['id'];}return db['JscriptySessionReport'][_0x6347('0x42')]({'where':{'id':_0x308588[_0x6347('0x46')]['id']}})['then'](handleEntityNotFound(_0x174016,null))[_0x6347('0x20')](saveUpdates(_0x308588[_0x6347('0x45')],null))['then'](respondWithResult(_0x174016,null))[_0x6347('0x43')](handleError(_0x174016,null));};exports[_0x6347('0x21')]=function(_0x3d649a,_0x1813b8){return db[_0x6347('0x29')][_0x6347('0x42')]({'where':{'id':_0x3d649a[_0x6347('0x46')]['id']}})[_0x6347('0x20')](handleEntityNotFound(_0x1813b8,null))['then'](removeEntity(_0x1813b8,null))[_0x6347('0x43')](handleError(_0x1813b8,null));};exports[_0x6347('0x47')]=function(_0x2d140c,_0x3c9b01){return db[_0x6347('0x29')][_0x6347('0x47')]()[_0x6347('0x20')](respondWithResult(_0x3c9b01,null))[_0x6347('0x43')](handleError(_0x3c9b01,null));};exports[_0x6347('0x48')]=function(_0x43bf76,_0x3ff9bf,_0x178277){var _0x494116={'raw':!![],'where':{}};var _0x2a0891={};var _0x4544ac={'count':0x0,'rows':[]};return db[_0x6347('0x29')][_0x6347('0x49')]({'where':{'id':_0x43bf76[_0x6347('0x46')]['id']}})[_0x6347('0x20')](handleEntityNotFound(_0x3ff9bf,null))[_0x6347('0x20')](function(_0x356aff){if(_0x356aff){_0x2a0891[_0x6347('0x2d')]=_[_0x6347('0x2f')](db['JscriptyQuestionReport']['rawAttributes']);_0x2a0891['query']=_[_0x6347('0x2f')](_0x43bf76[_0x6347('0x2e')]);_0x2a0891[_0x6347('0x30')]=_['intersection'](_0x2a0891[_0x6347('0x2d')],_0x2a0891[_0x6347('0x2e')]);_0x494116['attributes']=_[_0x6347('0x31')](_0x2a0891['model'],qs['fields'](_0x43bf76[_0x6347('0x2e')]['fields']));_0x494116[_0x6347('0x32')]=_0x494116[_0x6347('0x32')][_0x6347('0x34')]?_0x494116[_0x6347('0x32')]:_0x2a0891[_0x6347('0x2d')];if(!_0x43bf76[_0x6347('0x2e')][_0x6347('0x35')]('nolimit')){_0x494116[_0x6347('0x19')]=qs[_0x6347('0x19')](_0x43bf76[_0x6347('0x2e')][_0x6347('0x19')]);_0x494116[_0x6347('0x1b')]=qs[_0x6347('0x1b')](_0x43bf76['query'][_0x6347('0x1b')]);}_0x494116[_0x6347('0x4a')]=qs[_0x6347('0x37')](_0x43bf76['query'][_0x6347('0x37')]);_0x494116[_0x6347('0x38')]=qs['filters'](_[_0x6347('0x39')](_0x43bf76[_0x6347('0x2e')],_0x2a0891[_0x6347('0x30')]));_0x494116[_0x6347('0x38')][_0x6347('0x4b')]=_0x356aff['id'];if(_0x43bf76['query'][_0x6347('0x3a')]){_0x494116[_0x6347('0x38')]=_['merge'](_0x494116[_0x6347('0x38')],{'$or':_[_0x6347('0x28')](_0x494116[_0x6347('0x32')],function(_0x37b2e3){var _0x2e9487={};_0x2e9487[_0x37b2e3]={'$like':'%'+_0x43bf76[_0x6347('0x2e')][_0x6347('0x3a')]+'%'};return _0x2e9487;})});}_0x494116=_[_0x6347('0x3b')]({},_0x494116,_0x43bf76[_0x6347('0x41')]);return db[_0x6347('0x4c')][_0x6347('0x1a')]({'where':_0x494116[_0x6347('0x38')]})['then'](function(_0x65284b){_0x4544ac['count']=_0x65284b;if(_0x43bf76[_0x6347('0x2e')][_0x6347('0x3d')]){_0x494116[_0x6347('0x40')]=[{'all':!![]}];}return db[_0x6347('0x4c')][_0x6347('0x3e')](_0x494116);})['then'](function(_0x208140){_0x4544ac[_0x6347('0x3f')]=_0x208140;return _0x4544ac;});}})[_0x6347('0x20')](respondWithFilteredResult(_0x3ff9bf,_0x494116))['catch'](handleError(_0x3ff9bf,null));}; \ No newline at end of file +var _0x15a8=['sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','JscriptySessionReport','include','findAll','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','JscriptyQuestionReport','SessionId','filter','rows','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x15a8,0x12a));var _0x815a=function(_0x3d6745,_0x591e49){_0x3d6745=_0x3d6745-0x0;var _0x1a28e1=_0x15a8[_0x3d6745];return _0x1a28e1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x815a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x815a('0x1'));var moment=require(_0x815a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x815a('0x3'));var util=require('util');var path=require('path');var sox=require(_0x815a('0x4'));var csv=require(_0x815a('0x5'));var ejs=require(_0x815a('0x6'));var fs=require('fs');var fs_extra=require(_0x815a('0x7'));var _=require(_0x815a('0x8'));var squel=require(_0x815a('0x9'));var crypto=require(_0x815a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x815a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x815a('0xc'));var Papa=require(_0x815a('0xd'));var Redis=require(_0x815a('0xe'));var authService=require(_0x815a('0xf'));var qs=require(_0x815a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x815a('0x11'));var logger=require(_0x815a('0x12'))(_0x815a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x815a('0x14'));var db=require(_0x815a('0x15'))['db'];function respondWithStatusCode(_0x2db072,_0x47b9ef){_0x47b9ef=_0x47b9ef||0xcc;return function(_0x4bc661){if(_0x4bc661){return _0x2db072[_0x815a('0x16')](_0x47b9ef);}return _0x2db072['status'](_0x47b9ef)[_0x815a('0x17')]();};}function respondWithResult(_0x317195,_0x2ad325){_0x2ad325=_0x2ad325||0xc8;return function(_0x307357){if(_0x307357){return _0x317195[_0x815a('0x18')](_0x2ad325)[_0x815a('0x19')](_0x307357);}};}function respondWithFilteredResult(_0x363efe,_0x2421d5){return function(_0x31231d){if(_0x31231d){var _0x16a26f=typeof _0x2421d5['offset']===_0x815a('0x1a')&&typeof _0x2421d5[_0x815a('0x1b')]===_0x815a('0x1a');var _0x3c1510=_0x31231d[_0x815a('0x1c')];var _0x50962b=_0x16a26f?0x0:_0x2421d5[_0x815a('0x1d')];var _0x15822f=_0x16a26f?_0x31231d[_0x815a('0x1c')]:_0x2421d5['offset']+_0x2421d5[_0x815a('0x1b')];var _0x2f2ca4;if(_0x15822f>=_0x3c1510){_0x15822f=_0x3c1510;_0x2f2ca4=0xc8;}else{_0x2f2ca4=0xce;}_0x363efe[_0x815a('0x18')](_0x2f2ca4);return _0x363efe[_0x815a('0x1e')](_0x815a('0x1f'),_0x50962b+'-'+_0x15822f+'/'+_0x3c1510)['json'](_0x31231d);}return null;};}function patchUpdates(_0x188ed8){return function(_0x1057e3){try{jsonpatch[_0x815a('0x20')](_0x1057e3,_0x188ed8,!![]);}catch(_0x1f9a3a){return BPromise[_0x815a('0x21')](_0x1f9a3a);}return _0x1057e3[_0x815a('0x22')]();};}function saveUpdates(_0x23ce21,_0x4a9c53){return function(_0x3f4b69){if(_0x3f4b69){return _0x3f4b69[_0x815a('0x23')](_0x23ce21)[_0x815a('0x24')](function(_0x320ce6){return _0x320ce6;});}return null;};}function removeEntity(_0x3da9bc,_0x10b25e){return function(_0x2ded70){if(_0x2ded70){return _0x2ded70[_0x815a('0x25')]()[_0x815a('0x24')](function(){_0x3da9bc[_0x815a('0x18')](0xcc)[_0x815a('0x17')]();});}};}function handleEntityNotFound(_0x12af50,_0x377313){return function(_0x29f9af){if(!_0x29f9af){_0x12af50[_0x815a('0x16')](0x194);}return _0x29f9af;};}function handleError(_0x581872,_0x3a0f81){_0x3a0f81=_0x3a0f81||0x1f4;return function(_0x449bba){logger[_0x815a('0x26')](_0x449bba[_0x815a('0x27')]);if(_0x449bba['name']){delete _0x449bba[_0x815a('0x28')];}_0x581872['status'](_0x3a0f81)[_0x815a('0x29')](_0x449bba);};}exports[_0x815a('0x2a')]=function(_0x14808c,_0xf79a6b){var _0x27a9b6={},_0x16ada3={},_0x42a1df={'count':0x0,'rows':[]};var _0x2ef2eb=_['map'](db['JscriptySessionReport']['rawAttributes'],function(_0x4953b3){return{'name':_0x4953b3[_0x815a('0x2b')],'type':_0x4953b3[_0x815a('0x2c')][_0x815a('0x2d')]};});_0x16ada3[_0x815a('0x2e')]=_[_0x815a('0x2f')](_0x2ef2eb,'name');_0x16ada3[_0x815a('0x30')]=_[_0x815a('0x31')](_0x14808c['query']);_0x16ada3[_0x815a('0x32')]=_[_0x815a('0x33')](_0x16ada3[_0x815a('0x2e')],_0x16ada3[_0x815a('0x30')]);_0x27a9b6[_0x815a('0x34')]=_[_0x815a('0x33')](_0x16ada3[_0x815a('0x2e')],qs[_0x815a('0x35')](_0x14808c['query']['fields']));_0x27a9b6[_0x815a('0x34')]=_0x27a9b6['attributes']['length']?_0x27a9b6[_0x815a('0x34')]:_0x16ada3[_0x815a('0x2e')];if(!_0x14808c[_0x815a('0x30')][_0x815a('0x36')](_0x815a('0x37'))){_0x27a9b6[_0x815a('0x1b')]=qs[_0x815a('0x1b')](_0x14808c[_0x815a('0x30')][_0x815a('0x1b')]);_0x27a9b6[_0x815a('0x1d')]=qs[_0x815a('0x1d')](_0x14808c[_0x815a('0x30')]['offset']);}_0x27a9b6[_0x815a('0x38')]=qs[_0x815a('0x39')](_0x14808c[_0x815a('0x30')]['sort']);_0x27a9b6[_0x815a('0x3a')]=qs[_0x815a('0x32')](_[_0x815a('0x3b')](_0x14808c[_0x815a('0x30')],_0x16ada3[_0x815a('0x32')]),_0x2ef2eb);if(_0x14808c['query']['filter']){_0x27a9b6[_0x815a('0x3a')]=_[_0x815a('0x3c')](_0x27a9b6[_0x815a('0x3a')],{'$or':_[_0x815a('0x2f')](_0x2ef2eb,function(_0x3273fb){if(_0x3273fb['type']!==_0x815a('0x3d')){var _0x51da9d={};_0x51da9d[_0x3273fb[_0x815a('0x28')]]={'$like':'%'+_0x14808c[_0x815a('0x30')]['filter']+'%'};return _0x51da9d;}})});}_0x27a9b6=_[_0x815a('0x3c')]({},_0x27a9b6,_0x14808c[_0x815a('0x3e')]);var _0x1eb2ac={'where':_0x27a9b6[_0x815a('0x3a')]};return db[_0x815a('0x3f')][_0x815a('0x1c')](_0x1eb2ac)[_0x815a('0x24')](function(_0x5790fd){_0x42a1df[_0x815a('0x1c')]=_0x5790fd;if(_0x14808c[_0x815a('0x30')]['includeAll']){_0x27a9b6[_0x815a('0x40')]=[{'all':!![]}];}return db[_0x815a('0x3f')][_0x815a('0x41')](_0x27a9b6);})[_0x815a('0x24')](function(_0x5420e8){_0x42a1df['rows']=_0x5420e8;return _0x42a1df;})[_0x815a('0x24')](respondWithFilteredResult(_0xf79a6b,_0x27a9b6))[_0x815a('0x42')](handleError(_0xf79a6b,null));};exports[_0x815a('0x43')]=function(_0x248cb5,_0x52d08b){var _0x1509b1={'raw':!![],'where':{'id':_0x248cb5[_0x815a('0x44')]['id']}},_0x1c49c0={};_0x1c49c0[_0x815a('0x2e')]=_[_0x815a('0x31')](db['JscriptySessionReport'][_0x815a('0x45')]);_0x1c49c0[_0x815a('0x30')]=_['keys'](_0x248cb5[_0x815a('0x30')]);_0x1c49c0['filters']=_['intersection'](_0x1c49c0['model'],_0x1c49c0[_0x815a('0x30')]);_0x1509b1[_0x815a('0x34')]=_[_0x815a('0x33')](_0x1c49c0[_0x815a('0x2e')],qs[_0x815a('0x35')](_0x248cb5[_0x815a('0x30')][_0x815a('0x35')]));_0x1509b1[_0x815a('0x34')]=_0x1509b1[_0x815a('0x34')][_0x815a('0x46')]?_0x1509b1[_0x815a('0x34')]:_0x1c49c0[_0x815a('0x2e')];if(_0x248cb5[_0x815a('0x30')][_0x815a('0x47')]){_0x1509b1[_0x815a('0x40')]=[{'all':!![]}];}_0x1509b1=_[_0x815a('0x3c')]({},_0x1509b1,_0x248cb5[_0x815a('0x3e')]);return db['JscriptySessionReport'][_0x815a('0x48')](_0x1509b1)[_0x815a('0x24')](handleEntityNotFound(_0x52d08b,null))['then'](respondWithResult(_0x52d08b,null))[_0x815a('0x42')](handleError(_0x52d08b,null));};exports['create']=function(_0x25a048,_0xf7f360){return db[_0x815a('0x3f')][_0x815a('0x49')](_0x25a048[_0x815a('0x4a')],{})[_0x815a('0x24')](respondWithResult(_0xf7f360,0xc9))[_0x815a('0x42')](handleError(_0xf7f360,null));};exports[_0x815a('0x23')]=function(_0x58d906,_0x255e30){if(_0x58d906[_0x815a('0x4a')]['id']){delete _0x58d906[_0x815a('0x4a')]['id'];}return db[_0x815a('0x3f')][_0x815a('0x48')]({'where':{'id':_0x58d906[_0x815a('0x44')]['id']}})['then'](handleEntityNotFound(_0x255e30,null))[_0x815a('0x24')](saveUpdates(_0x58d906[_0x815a('0x4a')],null))[_0x815a('0x24')](respondWithResult(_0x255e30,null))[_0x815a('0x42')](handleError(_0x255e30,null));};exports[_0x815a('0x25')]=function(_0x416e49,_0x44a47a){return db[_0x815a('0x3f')]['find']({'where':{'id':_0x416e49[_0x815a('0x44')]['id']}})[_0x815a('0x24')](handleEntityNotFound(_0x44a47a,null))['then'](removeEntity(_0x44a47a,null))[_0x815a('0x42')](handleError(_0x44a47a,null));};exports[_0x815a('0x4b')]=function(_0x4ed8b5,_0x4679ad){return db[_0x815a('0x3f')][_0x815a('0x4b')]()['then'](respondWithResult(_0x4679ad,null))[_0x815a('0x42')](handleError(_0x4679ad,null));};exports['getQuestions']=function(_0x21f81b,_0x4272fe,_0x5b0a55){var _0x34876b={'raw':!![],'where':{}};var _0x31ee70={};var _0x122604={'count':0x0,'rows':[]};return db[_0x815a('0x3f')]['findOne']({'where':{'id':_0x21f81b[_0x815a('0x44')]['id']}})['then'](handleEntityNotFound(_0x4272fe,null))[_0x815a('0x24')](function(_0x48f8bb){if(_0x48f8bb){_0x31ee70[_0x815a('0x2e')]=_[_0x815a('0x31')](db[_0x815a('0x4c')][_0x815a('0x45')]);_0x31ee70[_0x815a('0x30')]=_[_0x815a('0x31')](_0x21f81b[_0x815a('0x30')]);_0x31ee70[_0x815a('0x32')]=_[_0x815a('0x33')](_0x31ee70[_0x815a('0x2e')],_0x31ee70[_0x815a('0x30')]);_0x34876b[_0x815a('0x34')]=_[_0x815a('0x33')](_0x31ee70[_0x815a('0x2e')],qs[_0x815a('0x35')](_0x21f81b[_0x815a('0x30')]['fields']));_0x34876b[_0x815a('0x34')]=_0x34876b[_0x815a('0x34')][_0x815a('0x46')]?_0x34876b[_0x815a('0x34')]:_0x31ee70[_0x815a('0x2e')];if(!_0x21f81b[_0x815a('0x30')][_0x815a('0x36')]('nolimit')){_0x34876b[_0x815a('0x1b')]=qs[_0x815a('0x1b')](_0x21f81b[_0x815a('0x30')][_0x815a('0x1b')]);_0x34876b[_0x815a('0x1d')]=qs[_0x815a('0x1d')](_0x21f81b['query'][_0x815a('0x1d')]);}_0x34876b[_0x815a('0x38')]=qs[_0x815a('0x39')](_0x21f81b[_0x815a('0x30')][_0x815a('0x39')]);_0x34876b[_0x815a('0x3a')]=qs['filters'](_[_0x815a('0x3b')](_0x21f81b[_0x815a('0x30')],_0x31ee70[_0x815a('0x32')]));_0x34876b[_0x815a('0x3a')][_0x815a('0x4d')]=_0x48f8bb['id'];if(_0x21f81b[_0x815a('0x30')][_0x815a('0x4e')]){_0x34876b[_0x815a('0x3a')]=_['merge'](_0x34876b['where'],{'$or':_['map'](_0x34876b[_0x815a('0x34')],function(_0x31e36c){var _0x52943c={};_0x52943c[_0x31e36c]={'$like':'%'+_0x21f81b['query']['filter']+'%'};return _0x52943c;})});}_0x34876b=_[_0x815a('0x3c')]({},_0x34876b,_0x21f81b[_0x815a('0x3e')]);return db[_0x815a('0x4c')][_0x815a('0x1c')]({'where':_0x34876b['where']})['then'](function(_0x2a9c1d){_0x122604[_0x815a('0x1c')]=_0x2a9c1d;if(_0x21f81b[_0x815a('0x30')][_0x815a('0x47')]){_0x34876b['include']=[{'all':!![]}];}return db[_0x815a('0x4c')][_0x815a('0x41')](_0x34876b);})[_0x815a('0x24')](function(_0x254a0f){_0x122604[_0x815a('0x4f')]=_0x254a0f;return _0x122604;});}})[_0x815a('0x24')](respondWithFilteredResult(_0x4272fe,_0x34876b))[_0x815a('0x42')](handleError(_0x4272fe,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index c2205f7..54bd11a 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 _0x8958=['define','JscriptySessionReport','report_jscripty_sessions','util','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x25ec03,_0x37ae5f){var _0x596657=function(_0x875259){while(--_0x875259){_0x25ec03['push'](_0x25ec03['shift']());}};_0x596657(++_0x37ae5f);}(_0x8958,0x93));var _0x8895=function(_0x45faee,_0x5ef86a){_0x45faee=_0x45faee-0x0;var _0x452e3d=_0x8958[_0x45faee];return _0x452e3d;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8895('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var attributes=require(_0x8895('0x4'));module['exports']=function(_0x22fa52,_0x2f03ad){return _0x22fa52[_0x8895('0x5')](_0x8895('0x6'),attributes,{'tableName':_0x8895('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11e5=['path','../../config/environment','define','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0xb12410,_0x42997d){var _0x1584f2=function(_0xe1672a){while(--_0xe1672a){_0xb12410['push'](_0xb12410['shift']());}};_0x1584f2(++_0x42997d);}(_0x11e5,0x8b));var _0x511e=function(_0x5ebd54,_0x928763){_0x5ebd54=_0x5ebd54-0x0;var _0x5f53f5=_0x11e5[_0x5ebd54];return _0x5f53f5;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var logger=require(_0x511e('0x1'))(_0x511e('0x2'));var moment=require('moment');var BPromise=require(_0x511e('0x3'));var rp=require(_0x511e('0x4'));var fs=require('fs');var path=require(_0x511e('0x5'));var rimraf=require('rimraf');var config=require(_0x511e('0x6'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x342539,_0x323f8c){return _0x342539[_0x511e('0x7')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index e15f3bf..ddd606f 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 _0x430c=['then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x430c,0x1a1));var _0xc430=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x430c[_0x2a5b3b];return _0xae665a;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc430('0x1'));var rs=require(_0xc430('0x2'));var fs=require('fs');var Redis=require(_0xc430('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc430('0x4'));var jayson=require(_0xc430('0x5'));var client=jayson['client'][_0xc430('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4de44f,_0x212354,_0x2e51c6){return new BPromise(function(_0x814a90,_0x13ae66){return client[_0xc430('0x7')](_0x4de44f,_0x2e51c6)[_0xc430('0x8')](function(_0x861581){logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');logger[_0xc430('0xb')](_0xc430('0xc'),_0x212354,'request\x20sent',JSON[_0xc430('0xd')](_0x861581));if(_0x861581['error']){if(_0x861581[_0xc430('0xe')]['code']===0x1f4){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x861581[_0xc430('0xe')][_0xc430('0xf')]);return _0x13ae66(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}logger[_0xc430('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x212354,_0x861581['error'][_0xc430('0xf')]);return _0x814a90(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}else{logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');_0x814a90(_0x861581[_0xc430('0x10')]['message']);}})['catch'](function(_0x2e7987){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x2e7987);_0x13ae66(_0x2e7987);});});} \ No newline at end of file +var _0x8952=['JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error'];(function(_0x5f3c49,_0x2c9716){var _0x5259ac=function(_0x54eb42){while(--_0x54eb42){_0x5f3c49['push'](_0x5f3c49['shift']());}};_0x5259ac(++_0x2c9716);}(_0x8952,0x17e));var _0x2895=function(_0xc6c651,_0x239018){_0xc6c651=_0xc6c651-0x0;var _0xa1eec3=_0x8952[_0xc6c651];return _0xa1eec3;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 5292c7d..1aba790 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 _0xd85c=['update','/download_log_file','isAuthenticated','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./license.controller','get','index'];(function(_0xb219b6,_0x112fae){var _0x2aefe4=function(_0x4b820a){while(--_0x4b820a){_0xb219b6['push'](_0xb219b6['shift']());}};_0x2aefe4(++_0x112fae);}(_0xd85c,0x155));var _0xcd85=function(_0x1770dc,_0x4aa2cf){_0x1770dc=_0x1770dc-0x0;var _0x166cba=_0xd85c[_0x1770dc];return _0x166cba;};'use strict';var multer=require(_0xcd85('0x0'));var util=require(_0xcd85('0x1'));var path=require(_0xcd85('0x2'));var timeout=require(_0xcd85('0x3'));var express=require(_0xcd85('0x4'));var router=express[_0xcd85('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcd85('0x6'));var config=require(_0xcd85('0x7'));var controller=require(_0xcd85('0x8'));router[_0xcd85('0x9')]('/',controller[_0xcd85('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xcd85('0xb')]);router[_0xcd85('0x9')](_0xcd85('0xc'),auth[_0xcd85('0xd')](),controller[_0xcd85('0xe')]);module[_0xcd85('0xf')]=router; \ No newline at end of file +var _0x9a87=['../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','isAuthenticated','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x25c9ba,_0x3b9b57){var _0x315234=function(_0x3745e1){while(--_0x3745e1){_0x25c9ba['push'](_0x25c9ba['shift']());}};_0x315234(++_0x3b9b57);}(_0x9a87,0x15a));var _0x79a8=function(_0x4c3593,_0x4ea381){_0x4c3593=_0x4c3593-0x0;var _0x1172d1=_0x9a87[_0x4c3593];return _0x1172d1;};'use strict';var multer=require(_0x79a8('0x0'));var util=require(_0x79a8('0x1'));var path=require('path');var timeout=require(_0x79a8('0x2'));var express=require('express');var router=express[_0x79a8('0x3')]();var fs_extra=require(_0x79a8('0x4'));var auth=require(_0x79a8('0x5'));var interaction=require(_0x79a8('0x6'));var config=require(_0x79a8('0x7'));var controller=require(_0x79a8('0x8'));router[_0x79a8('0x9')]('/',controller[_0x79a8('0xa')]);router['put']('/:id',auth[_0x79a8('0xb')](),controller['update']);router[_0x79a8('0x9')]('/download_log_file',auth['isAuthenticated'](),controller['downloadLogFile']);module[_0x79a8('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 490bece..65040d4 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 _0x393e=['INTEGER','exports','STRING'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x393e,0x118));var _0xe393=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x393e[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require('sequelize');module[_0xe393('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xe393('0x1')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xe393('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcac6=['sequelize','exports','TEXT'];(function(_0x223c0d,_0x3ec04d){var _0x207827=function(_0x39d240){while(--_0x39d240){_0x223c0d['push'](_0x223c0d['shift']());}};_0x207827(++_0x3ec04d);}(_0xcac6,0x14a));var _0x6cac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcac6[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x6cac('0x0'));module[_0x6cac('0x1')]={'license':{'type':Sequelize[_0x6cac('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 3f92bba..a5a92fd 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 _0x4dec=['fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','getLicense','catch','body','find','params','checkLicense','key','downloadLogFile','join','log','xcally','setHeader','attachment;\x20filename=','Content-Type','eml-format','rimraf','zip-dir'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0x4dec,0x81));var _0xc4de=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4dec[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xc4de('0x0'));var rimraf=require(_0xc4de('0x1'));var zipdir=require(_0xc4de('0x2'));var jsonpatch=require(_0xc4de('0x3'));var rp=require(_0xc4de('0x4'));var moment=require('moment');var BPromise=require(_0xc4de('0x5'));var Mustache=require(_0xc4de('0x6'));var util=require('util');var path=require(_0xc4de('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc4de('0x8'));var fs=require('fs');var fs_extra=require(_0xc4de('0x9'));var _=require(_0xc4de('0xa'));var squel=require(_0xc4de('0xb'));var crypto=require(_0xc4de('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc4de('0xd'));var querystring=require(_0xc4de('0xe'));var Papa=require(_0xc4de('0xf'));var Redis=require(_0xc4de('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc4de('0x11'));var as=require(_0xc4de('0x12'));var hardwareService=require(_0xc4de('0x13'));var logger=require('../../config/logger')(_0xc4de('0x14'));var utils=require(_0xc4de('0x15'));var config=require(_0xc4de('0x16'));var licenseUtil=require(_0xc4de('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f3022,_0x17fa9e){_0x17fa9e=_0x17fa9e||0xcc;return function(_0x308483){if(_0x308483){return _0x4f3022[_0xc4de('0x18')](_0x17fa9e);}return _0x4f3022[_0xc4de('0x19')](_0x17fa9e)['end']();};}function respondWithResult(_0x289193,_0x5d17d9){_0x5d17d9=_0x5d17d9||0xc8;return function(_0x290d88){if(_0x290d88){return _0x289193[_0xc4de('0x19')](_0x5d17d9)['json'](_0x290d88);}};}function respondWithFilteredResult(_0x2b3604,_0x4913db){return function(_0x3bab27){if(_0x3bab27){var _0x4e0d79=typeof _0x4913db[_0xc4de('0x1a')]===_0xc4de('0x1b')&&typeof _0x4913db[_0xc4de('0x1c')]===_0xc4de('0x1b');var _0x548f95=_0x3bab27[_0xc4de('0x1d')];var _0x75080f=_0x4e0d79?0x0:_0x4913db[_0xc4de('0x1a')];var _0x310cdc=_0x4e0d79?_0x3bab27[_0xc4de('0x1d')]:_0x4913db[_0xc4de('0x1a')]+_0x4913db['limit'];var _0x1c2bb3;if(_0x310cdc>=_0x548f95){_0x310cdc=_0x548f95;_0x1c2bb3=0xc8;}else{_0x1c2bb3=0xce;}_0x2b3604['status'](_0x1c2bb3);return _0x2b3604[_0xc4de('0x1e')](_0xc4de('0x1f'),_0x75080f+'-'+_0x310cdc+'/'+_0x548f95)['json'](_0x3bab27);}return null;};}function patchUpdates(_0x3bba63){return function(_0x5ee932){try{jsonpatch[_0xc4de('0x20')](_0x5ee932,_0x3bba63,!![]);}catch(_0x3d2ba2){return BPromise[_0xc4de('0x21')](_0x3d2ba2);}return _0x5ee932[_0xc4de('0x22')]();};}function saveUpdates(_0xc999c2,_0x22cda2){return function(_0x53a59b){if(_0x53a59b){return _0x53a59b[_0xc4de('0x23')](_0xc999c2)[_0xc4de('0x24')](function(_0xc51da8){return _0xc51da8;});}return null;};}function removeEntity(_0x2f904b,_0x2be156){return function(_0x25f7b4){if(_0x25f7b4){return _0x25f7b4['destroy']()[_0xc4de('0x24')](function(){_0x2f904b[_0xc4de('0x19')](0xcc)[_0xc4de('0x25')]();});}};}function handleEntityNotFound(_0x5099e5,_0x5c7881){return function(_0x4df386){if(!_0x4df386){_0x5099e5[_0xc4de('0x18')](0x194);}return _0x4df386;};}function handleError(_0x833da,_0x5b66fa){_0x5b66fa=_0x5b66fa||0x1f4;return function(_0x25e98c){logger[_0xc4de('0x26')](_0x25e98c['stack']);if(_0x25e98c[_0xc4de('0x27')]){delete _0x25e98c['name'];}_0x833da[_0xc4de('0x19')](_0x5b66fa)[_0xc4de('0x28')](_0x25e98c);};}var utilLicense=require(_0xc4de('0x17'));exports[_0xc4de('0x29')]=function(_0x2b2c7d,_0x5d2da6){var _0x3cded9={'raw':!![],'where':{'id':0x1}},_0x18c6ea={};_0x18c6ea[_0xc4de('0x2a')]=_[_0xc4de('0x2b')](db[_0xc4de('0x2c')][_0xc4de('0x2d')]);_0x18c6ea[_0xc4de('0x2e')]=_[_0xc4de('0x2b')](_0x2b2c7d[_0xc4de('0x2e')]);_0x18c6ea[_0xc4de('0x2f')]=_[_0xc4de('0x30')](_0x18c6ea[_0xc4de('0x2a')],_0x18c6ea[_0xc4de('0x2e')]);_0x3cded9[_0xc4de('0x31')]=_[_0xc4de('0x30')](_0x18c6ea[_0xc4de('0x2a')],qs[_0xc4de('0x32')](_0x2b2c7d[_0xc4de('0x2e')]['fields']));_0x3cded9['attributes']=_0x3cded9[_0xc4de('0x31')][_0xc4de('0x33')]?_0x3cded9[_0xc4de('0x31')]:_0x18c6ea[_0xc4de('0x2a')];_0x3cded9=_['merge']({},_0x3cded9,_0x2b2c7d['options']);return utilLicense[_0xc4de('0x34')](_0x3cded9)[_0xc4de('0x24')](respondWithResult(_0x5d2da6,null))[_0xc4de('0x35')](handleError(_0x5d2da6,null));};exports['update']=function(_0x216649,_0x126584){if(_0x216649[_0xc4de('0x36')]['id']){delete _0x216649['body']['id'];}return db[_0xc4de('0x2c')][_0xc4de('0x37')]({'where':{'id':_0x216649[_0xc4de('0x38')]['id']}})[_0xc4de('0x24')](handleEntityNotFound(_0x126584,null))['then'](function(_0x130a81){var _0x2855f5=_0x130a81['get']({'plain':!![]});return utilLicense[_0xc4de('0x39')](_0x2855f5,_0x216649['body'][_0xc4de('0x3a')]);})[_0xc4de('0x24')](function(_0x20d78e){if(!_0x20d78e['demo']){return saveUpdates(_0x216649['body'],null);}return _0x20d78e;})['then'](respondWithResult(_0x126584,null))[_0xc4de('0x35')](handleError(_0x126584,null));};exports[_0xc4de('0x3b')]=function(_0x35963c,_0x28644f){var _0x423992='license-info.log';var _0x19639a=path[_0xc4de('0x3c')]('/var',_0xc4de('0x3d'),_0xc4de('0x3e'),_0x423992);_0x28644f[_0xc4de('0x3f')]('Content-disposition',_0xc4de('0x40')+_0x423992);_0x28644f[_0xc4de('0x1e')](_0xc4de('0x41'),'text/plain');_0x28644f['download'](_0x19639a);}; \ No newline at end of file +var _0x1de5=['offset','Content-Range','reject','save','destroy','then','error','stack','send','index','keys','License','rawAttributes','filters','intersection','model','query','attributes','fields','length','options','catch','update','body','find','params','get','checkLicense','key','demo','license-info.log','/var','log','xcally','setHeader','attachment;\x20filename=','set','Content-Type','text/plain','download','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1de5,0x1de));var _0x51de=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x1de5[_0x46698a];return _0x356db0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51de('0x0'));var zipdir=require(_0x51de('0x1'));var jsonpatch=require(_0x51de('0x2'));var rp=require('request-promise');var moment=require(_0x51de('0x3'));var BPromise=require(_0x51de('0x4'));var Mustache=require(_0x51de('0x5'));var util=require(_0x51de('0x6'));var path=require('path');var sox=require(_0x51de('0x7'));var csv=require('to-csv');var ejs=require(_0x51de('0x8'));var fs=require('fs');var fs_extra=require(_0x51de('0x9'));var _=require(_0x51de('0xa'));var squel=require(_0x51de('0xb'));var crypto=require(_0x51de('0xc'));var jsforce=require(_0x51de('0xd'));var deskjs=require(_0x51de('0xe'));var toCsv=require(_0x51de('0xf'));var querystring=require(_0x51de('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x51de('0x11'));var qs=require(_0x51de('0x12'));var as=require(_0x51de('0x13'));var hardwareService=require(_0x51de('0x14'));var logger=require(_0x51de('0x15'))(_0x51de('0x16'));var utils=require(_0x51de('0x17'));var config=require(_0x51de('0x18'));var licenseUtil=require(_0x51de('0x19'));var db=require(_0x51de('0x1a'))['db'];function respondWithStatusCode(_0x1764a9,_0x612464){_0x612464=_0x612464||0xcc;return function(_0x4bad5e){if(_0x4bad5e){return _0x1764a9[_0x51de('0x1b')](_0x612464);}return _0x1764a9['status'](_0x612464)[_0x51de('0x1c')]();};}function respondWithResult(_0xb0e337,_0x4d9ba7){_0x4d9ba7=_0x4d9ba7||0xc8;return function(_0x578a8d){if(_0x578a8d){return _0xb0e337[_0x51de('0x1d')](_0x4d9ba7)[_0x51de('0x1e')](_0x578a8d);}};}function respondWithFilteredResult(_0x573daa,_0x5af958){return function(_0x4de886){if(_0x4de886){var _0x31fdf7=typeof _0x5af958['offset']==='undefined'&&typeof _0x5af958[_0x51de('0x1f')]==='undefined';var _0x4f52dc=_0x4de886[_0x51de('0x20')];var _0x17fbf7=_0x31fdf7?0x0:_0x5af958['offset'];var _0x43d371=_0x31fdf7?_0x4de886['count']:_0x5af958[_0x51de('0x21')]+_0x5af958[_0x51de('0x1f')];var _0x5a661f;if(_0x43d371>=_0x4f52dc){_0x43d371=_0x4f52dc;_0x5a661f=0xc8;}else{_0x5a661f=0xce;}_0x573daa[_0x51de('0x1d')](_0x5a661f);return _0x573daa['set'](_0x51de('0x22'),_0x17fbf7+'-'+_0x43d371+'/'+_0x4f52dc)[_0x51de('0x1e')](_0x4de886);}return null;};}function patchUpdates(_0x5ea971){return function(_0x19da7c){try{jsonpatch['apply'](_0x19da7c,_0x5ea971,!![]);}catch(_0x2ae87a){return BPromise[_0x51de('0x23')](_0x2ae87a);}return _0x19da7c[_0x51de('0x24')]();};}function saveUpdates(_0xe82cac,_0x1a8048){return function(_0x593ccb){if(_0x593ccb){return _0x593ccb['update'](_0xe82cac)['then'](function(_0x1bbf55){return _0x1bbf55;});}return null;};}function removeEntity(_0x1886be,_0x940629){return function(_0x536a3b){if(_0x536a3b){return _0x536a3b[_0x51de('0x25')]()[_0x51de('0x26')](function(){_0x1886be['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e7b75,_0x495bca){return function(_0xa70cf2){if(!_0xa70cf2){_0x4e7b75[_0x51de('0x1b')](0x194);}return _0xa70cf2;};}function handleError(_0x2cd8b4,_0x26712b){_0x26712b=_0x26712b||0x1f4;return function(_0x26088d){logger[_0x51de('0x27')](_0x26088d[_0x51de('0x28')]);if(_0x26088d['name']){delete _0x26088d['name'];}_0x2cd8b4[_0x51de('0x1d')](_0x26712b)[_0x51de('0x29')](_0x26088d);};}var utilLicense=require(_0x51de('0x19'));exports[_0x51de('0x2a')]=function(_0x525ffc,_0x5764e8){var _0x52601a={'raw':!![],'where':{'id':0x1}},_0x4d4286={};_0x4d4286['model']=_[_0x51de('0x2b')](db[_0x51de('0x2c')][_0x51de('0x2d')]);_0x4d4286['query']=_['keys'](_0x525ffc['query']);_0x4d4286[_0x51de('0x2e')]=_[_0x51de('0x2f')](_0x4d4286[_0x51de('0x30')],_0x4d4286[_0x51de('0x31')]);_0x52601a[_0x51de('0x32')]=_[_0x51de('0x2f')](_0x4d4286[_0x51de('0x30')],qs[_0x51de('0x33')](_0x525ffc[_0x51de('0x31')][_0x51de('0x33')]));_0x52601a[_0x51de('0x32')]=_0x52601a[_0x51de('0x32')][_0x51de('0x34')]?_0x52601a[_0x51de('0x32')]:_0x4d4286['model'];_0x52601a=_['merge']({},_0x52601a,_0x525ffc[_0x51de('0x35')]);return utilLicense['getLicense'](_0x52601a)['then'](respondWithResult(_0x5764e8,null))[_0x51de('0x36')](handleError(_0x5764e8,null));};exports[_0x51de('0x37')]=function(_0x3d9a33,_0x2e0fb7){if(_0x3d9a33[_0x51de('0x38')]['id']){delete _0x3d9a33[_0x51de('0x38')]['id'];}return db['License'][_0x51de('0x39')]({'where':{'id':_0x3d9a33[_0x51de('0x3a')]['id']}})[_0x51de('0x26')](handleEntityNotFound(_0x2e0fb7,null))[_0x51de('0x26')](function(_0x40d519){var _0xdf7cb2=_0x40d519[_0x51de('0x3b')]({'plain':!![]});return utilLicense[_0x51de('0x3c')](_0xdf7cb2,_0x3d9a33[_0x51de('0x38')][_0x51de('0x3d')]);})['then'](function(_0x19ab63){if(!_0x19ab63[_0x51de('0x3e')]){return saveUpdates(_0x3d9a33[_0x51de('0x38')],null);}return _0x19ab63;})[_0x51de('0x26')](respondWithResult(_0x2e0fb7,null))[_0x51de('0x36')](handleError(_0x2e0fb7,null));};exports['downloadLogFile']=function(_0x58eaba,_0x543cba){var _0x121f8a=_0x51de('0x3f');var _0x236817=path['join'](_0x51de('0x40'),_0x51de('0x41'),_0x51de('0x42'),_0x121f8a);_0x543cba[_0x51de('0x43')]('Content-disposition',_0x51de('0x44')+_0x121f8a);_0x543cba[_0x51de('0x45')](_0x51de('0x46'),_0x51de('0x47'));_0x543cba[_0x51de('0x48')](_0x236817);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 1499332..74d4e00 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 _0x800f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes','exports','License','license'];(function(_0x2c770a,_0x39607a){var _0x3424ba=function(_0x2b1f63){while(--_0x2b1f63){_0x2c770a['push'](_0x2c770a['shift']());}};_0x3424ba(++_0x39607a);}(_0x800f,0xdd));var _0xf800=function(_0x3f6aab,_0x500c95){_0x3f6aab=_0x3f6aab-0x0;var _0xf7a8a4=_0x800f[_0x3f6aab];return _0xf7a8a4;};'use strict';var _=require(_0xf800('0x0'));var util=require(_0xf800('0x1'));var logger=require(_0xf800('0x2'))(_0xf800('0x3'));var moment=require(_0xf800('0x4'));var BPromise=require(_0xf800('0x5'));var rp=require(_0xf800('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf800('0x7'));var config=require(_0xf800('0x8'));var attributes=require(_0xf800('0x9'));module[_0xf800('0xa')]=function(_0x4ffbf4,_0x25f2fc){return _0x4ffbf4['define'](_0xf800('0xb'),attributes,{'tableName':_0xf800('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb955=['rimraf','exports','define','license','api','request-promise','path'];(function(_0x37ae76,_0x38dd76){var _0xb5a920=function(_0x5a550b){while(--_0x5a550b){_0x37ae76['push'](_0x37ae76['shift']());}};_0xb5a920(++_0x38dd76);}(_0xb955,0x131));var _0x5b95=function(_0x589128,_0x1442e9){_0x589128=_0x589128-0x0;var _0xe0b932=_0xb955[_0x589128];return _0xe0b932;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5b95('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5b95('0x1'));var fs=require('fs');var path=require(_0x5b95('0x2'));var rimraf=require(_0x5b95('0x3'));var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0x5b95('0x4')]=function(_0x24f478,_0x2a3d4b){return _0x24f478[_0x5b95('0x5')]('License',attributes,{'tableName':_0x5b95('0x6'),'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 102f325..e5b2453 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 _0x51a3=['jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0x51a3,0xb0));var _0x351a=function(_0x4f595b,_0x21875e){_0x4f595b=_0x4f595b-0x0;var _0xc9597c=_0x51a3[_0x4f595b];return _0xc9597c;};'use strict';var _=require(_0x351a('0x0'));var util=require(_0x351a('0x1'));var moment=require('moment');var BPromise=require(_0x351a('0x2'));var rs=require(_0x351a('0x3'));var fs=require('fs');var Redis=require(_0x351a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x351a('0x5'))(_0x351a('0x6'));var config=require(_0x351a('0x7'));var jayson=require(_0x351a('0x8'));var client=jayson[_0x351a('0x9')][_0x351a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35601e,_0x1bbda0,_0x25bd3f){return new BPromise(function(_0x378c0e,_0x40b8f7){return client[_0x351a('0xb')](_0x35601e,_0x25bd3f)[_0x351a('0xc')](function(_0x26fa08){logger[_0x351a('0xd')](_0x351a('0xe'),_0x1bbda0,'request\x20sent');logger[_0x351a('0xf')](_0x351a('0x10'),_0x1bbda0,_0x351a('0x11'),JSON[_0x351a('0x12')](_0x26fa08));if(_0x26fa08[_0x351a('0x13')]){if(_0x26fa08[_0x351a('0x13')][_0x351a('0x14')]===0x1f4){logger[_0x351a('0x13')](_0x351a('0xe'),_0x1bbda0,_0x26fa08[_0x351a('0x13')][_0x351a('0x15')]);return _0x40b8f7(_0x26fa08['error'][_0x351a('0x15')]);}logger[_0x351a('0x13')](_0x351a('0xe'),_0x1bbda0,_0x26fa08[_0x351a('0x13')][_0x351a('0x15')]);return _0x378c0e(_0x26fa08[_0x351a('0x13')]['message']);}else{logger[_0x351a('0xd')]('License,\x20%s,\x20%s',_0x1bbda0,_0x351a('0x11'));_0x378c0e(_0x26fa08['result'][_0x351a('0x15')]);}})[_0x351a('0x16')](function(_0x5aa5a0){logger[_0x351a('0x13')](_0x351a('0xe'),_0x1bbda0,_0x5aa5a0);_0x40b8f7(_0x5aa5a0);});});} \ No newline at end of file +var _0x3feb=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3a7b72,_0x43751b){var _0x2752a3=function(_0x564050){while(--_0x564050){_0x3a7b72['push'](_0x3a7b72['shift']());}};_0x2752a3(++_0x43751b);}(_0x3feb,0x7a));var _0xb3fe=function(_0x5cd9cf,_0x81e149){_0x5cd9cf=_0x5cd9cf-0x0;var _0x281d05=_0x3feb[_0x5cd9cf];return _0x281d05;};'use strict';var _=require(_0xb3fe('0x0'));var util=require(_0xb3fe('0x1'));var moment=require(_0xb3fe('0x2'));var BPromise=require(_0xb3fe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb3fe('0x4'));var db=require(_0xb3fe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb3fe('0x6'))(_0xb3fe('0x7'));var config=require('../../config/environment');var jayson=require(_0xb3fe('0x8'));var client=jayson[_0xb3fe('0x9')][_0xb3fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd1179c,_0x36aa28,_0x46e423){return new BPromise(function(_0x2d403f,_0x32e42a){return client[_0xb3fe('0xb')](_0xd1179c,_0x46e423)[_0xb3fe('0xc')](function(_0x31def8){logger['info'](_0xb3fe('0xd'),_0x36aa28,_0xb3fe('0xe'));logger[_0xb3fe('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x36aa28,_0xb3fe('0xe'),JSON['stringify'](_0x31def8));if(_0x31def8[_0xb3fe('0x10')]){if(_0x31def8[_0xb3fe('0x10')][_0xb3fe('0x11')]===0x1f4){logger[_0xb3fe('0x10')](_0xb3fe('0xd'),_0x36aa28,_0x31def8[_0xb3fe('0x10')][_0xb3fe('0x12')]);return _0x32e42a(_0x31def8['error']['message']);}logger[_0xb3fe('0x10')](_0xb3fe('0xd'),_0x36aa28,_0x31def8[_0xb3fe('0x10')][_0xb3fe('0x12')]);return _0x2d403f(_0x31def8['error'][_0xb3fe('0x12')]);}else{logger['info'](_0xb3fe('0xd'),_0x36aa28,'request\x20sent');_0x2d403f(_0x31def8[_0xb3fe('0x13')][_0xb3fe('0x12')]);}})[_0xb3fe('0x14')](function(_0xe00cd2){logger[_0xb3fe('0x10')](_0xb3fe('0xd'),_0x36aa28,_0xe00cd2);_0x32e42a(_0xe00cd2);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index c3dc65c..d83e13f 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 _0x5eab=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','addDisposition','post','addAnswer','create','addImap','addInteraction','addApplications','/:id/send','addAgents','put','update','delete','removeDispositions','removeAnswers','/:id/in_servers','removeSmtp','destroy','removeAgents','exports','path','connect-timeout','express'];(function(_0x19d835,_0xe87640){var _0x3171f4=function(_0x595e6f){while(--_0x595e6f){_0x19d835['push'](_0x19d835['shift']());}};_0x3171f4(++_0xe87640);}(_0x5eab,0x11d));var _0xb5ea=function(_0x45f1b3,_0x2300fa){_0x45f1b3=_0x45f1b3-0x0;var _0x5744d6=_0x5eab[_0x45f1b3];return _0x5744d6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb5ea('0x0'));var timeout=require(_0xb5ea('0x1'));var express=require(_0xb5ea('0x2'));var router=express[_0xb5ea('0x3')]();var fs_extra=require(_0xb5ea('0x4'));var auth=require(_0xb5ea('0x5'));var interaction=require(_0xb5ea('0x6'));var config=require(_0xb5ea('0x7'));var controller=require('./mailAccount.controller');router[_0xb5ea('0x8')]('/',auth[_0xb5ea('0x9')](),controller['index']);router[_0xb5ea('0x8')](_0xb5ea('0xa'),auth[_0xb5ea('0x9')](),controller['describe']);router['get'](_0xb5ea('0xb'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0xc')]);router['get'](_0xb5ea('0xd'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0xe')]);router[_0xb5ea('0x8')](_0xb5ea('0xf'),auth['isAuthenticated'](),controller[_0xb5ea('0x10')]);router['get']('/:id/in_servers',auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x11')]);router[_0xb5ea('0x8')](_0xb5ea('0x12'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x13')]);router[_0xb5ea('0x8')](_0xb5ea('0x14'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x15')]);router['get'](_0xb5ea('0x16'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x17')]);router['get'](_0xb5ea('0x18'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x19')]);router[_0xb5ea('0x8')](_0xb5ea('0x1a'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0xb5ea('0x8')](_0xb5ea('0x1b'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x1c')]);router['post'](_0xb5ea('0xd'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x1d')]);router[_0xb5ea('0x1e')](_0xb5ea('0xf'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x1f')]);router[_0xb5ea('0x1e')]('/',auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x20')]);router[_0xb5ea('0x1e')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xb5ea('0x21')]);router[_0xb5ea('0x1e')](_0xb5ea('0x12'),auth[_0xb5ea('0x9')](),controller['addSmtp']);router[_0xb5ea('0x1e')](_0xb5ea('0x14'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x22')]);router[_0xb5ea('0x1e')](_0xb5ea('0x16'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x23')]);router[_0xb5ea('0x1e')](_0xb5ea('0x24'),auth[_0xb5ea('0x9')](),controller['send']);router['post'](_0xb5ea('0x1b'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x25')]);router[_0xb5ea('0x26')]('/:id',auth['isAuthenticated'](),controller[_0xb5ea('0x27')]);router[_0xb5ea('0x28')](_0xb5ea('0xd'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x29')]);router[_0xb5ea('0x28')]('/:id/canned_answers',auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x2a')]);router[_0xb5ea('0x28')](_0xb5ea('0x2b'),auth['isAuthenticated'](),controller['removeImap']);router[_0xb5ea('0x28')](_0xb5ea('0x12'),auth['isAuthenticated'](),controller[_0xb5ea('0x2c')]);router['delete'](_0xb5ea('0xb'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x2d')]);router[_0xb5ea('0x28')](_0xb5ea('0x1b'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x2e')]);module[_0xb5ea('0x2f')]=router; \ No newline at end of file +var _0xb04d=['/:id/out_servers','getInteractions','/:id/applications','getMessages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','send','addAgents','update','delete','removeImap','removeSmtp','removeAgents','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/in_servers','getImap'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb04d,0x192));var _0xdb04=function(_0x2ef6dd,_0x1eeeaa){_0x2ef6dd=_0x2ef6dd-0x0;var _0x1ede0a=_0xb04d[_0x2ef6dd];return _0x1ede0a;};'use strict';var multer=require(_0xdb04('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdb04('0x1'));var express=require(_0xdb04('0x2'));var router=express[_0xdb04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdb04('0x4'));var config=require(_0xdb04('0x5'));var controller=require(_0xdb04('0x6'));router[_0xdb04('0x7')]('/',auth[_0xdb04('0x8')](),controller['index']);router[_0xdb04('0x7')](_0xdb04('0x9'),auth[_0xdb04('0x8')](),controller[_0xdb04('0xa')]);router[_0xdb04('0x7')](_0xdb04('0xb'),auth[_0xdb04('0x8')](),controller['show']);router[_0xdb04('0x7')](_0xdb04('0xc'),auth[_0xdb04('0x8')](),controller['getDispositions']);router[_0xdb04('0x7')](_0xdb04('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xdb04('0x7')](_0xdb04('0xe'),auth[_0xdb04('0x8')](),controller[_0xdb04('0xf')]);router[_0xdb04('0x7')](_0xdb04('0x10'),auth[_0xdb04('0x8')](),controller['getSmtp']);router[_0xdb04('0x7')]('/:id/interactions',auth[_0xdb04('0x8')](),controller[_0xdb04('0x11')]);router['get'](_0xdb04('0x12'),auth[_0xdb04('0x8')](),controller['getApplications']);router[_0xdb04('0x7')]('/:id/messages',auth[_0xdb04('0x8')](),controller[_0xdb04('0x13')]);router['get'](_0xdb04('0x14'),auth['isAuthenticated'](),controller[_0xdb04('0x15')]);router[_0xdb04('0x7')](_0xdb04('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0xdb04('0x17')]('/:id/dispositions',auth[_0xdb04('0x8')](),controller[_0xdb04('0x18')]);router[_0xdb04('0x17')](_0xdb04('0xd'),auth[_0xdb04('0x8')](),controller['addAnswer']);router[_0xdb04('0x17')]('/',auth[_0xdb04('0x8')](),controller['create']);router[_0xdb04('0x17')]('/:id/in_servers',auth[_0xdb04('0x8')](),controller[_0xdb04('0x19')]);router['post']('/:id/out_servers',auth['isAuthenticated'](),controller[_0xdb04('0x1a')]);router['post'](_0xdb04('0x1b'),auth[_0xdb04('0x8')](),controller[_0xdb04('0x1c')]);router[_0xdb04('0x17')](_0xdb04('0x12'),auth[_0xdb04('0x8')](),controller[_0xdb04('0x1d')]);router[_0xdb04('0x17')]('/:id/send',auth[_0xdb04('0x8')](),controller[_0xdb04('0x1e')]);router[_0xdb04('0x17')](_0xdb04('0x16'),auth[_0xdb04('0x8')](),controller[_0xdb04('0x1f')]);router['put'](_0xdb04('0xb'),auth[_0xdb04('0x8')](),controller[_0xdb04('0x20')]);router[_0xdb04('0x21')](_0xdb04('0xc'),auth[_0xdb04('0x8')](),controller['removeDispositions']);router[_0xdb04('0x21')](_0xdb04('0xd'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xdb04('0x21')](_0xdb04('0xe'),auth[_0xdb04('0x8')](),controller[_0xdb04('0x22')]);router[_0xdb04('0x21')](_0xdb04('0x10'),auth[_0xdb04('0x8')](),controller[_0xdb04('0x23')]);router['delete']('/:id',auth[_0xdb04('0x8')](),controller['destroy']);router['delete'](_0xdb04('0x16'),auth[_0xdb04('0x8')](),controller[_0xdb04('0x24')]);module[_0xdb04('0x25')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 599b4ad..15dcf6d 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 _0x6cc5=['mandatoryDispositionPauseId','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0x6cc5,0x14b));var _0x56cc=function(_0x189e8a,_0x356211){_0x189e8a=_0x189e8a-0x0;var _0x33f0ab=_0x6cc5[_0x189e8a];return _0x33f0ab;};'use strict';var Sequelize=require('sequelize');module[_0x56cc('0x0')]={'description':{'type':Sequelize[_0x56cc('0x1')]},'name':{'type':Sequelize[_0x56cc('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x56cc('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x56cc('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x56cc('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x56cc('0x1')],'allowNull':![],'defaultValue':_0x56cc('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x56cc('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x56cc('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x56cc('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x56cc('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x56cc('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x56cc('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x56cc('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x56cc('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x56cc('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x56cc('0x2')],'defaultValue':![],'comment':_0x56cc('0x7'),'set':function(_0x1d6847){if(!_0x1d6847)this[_0x56cc('0x8')](_0x56cc('0x9'),null);this['setDataValue']('mandatoryDisposition',_0x1d6847);}},'provider':{'type':Sequelize[_0x56cc('0xa')](_0x56cc('0xb'),_0x56cc('0xc'),'yahoo',_0x56cc('0xd')),'defaultValue':null,'get':function(){if(!this[_0x56cc('0xe')](_0x56cc('0xf')))return _0x56cc('0x10');return this[_0x56cc('0xe')](_0x56cc('0xf'));},'set':function(_0x5b0e4f){if(_0x5b0e4f===_0x56cc('0x10'))_0x5b0e4f=null;return this[_0x56cc('0x8')](_0x56cc('0xf'),_0x5b0e4f);}}}; \ No newline at end of file +var _0x3203=['INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x17e712,_0x567dc6){var _0x1e3b88=function(_0x1ecddb){while(--_0x1ecddb){_0x17e712['push'](_0x17e712['shift']());}};_0x1e3b88(++_0x567dc6);}(_0x3203,0xe2));var _0x3320=function(_0x555ebb,_0x4b1b68){_0x555ebb=_0x555ebb-0x0;var _0x3c0a4a=_0x3203[_0x555ebb];return _0x3c0a4a;};'use strict';var Sequelize=require('sequelize');module[_0x3320('0x0')]={'description':{'type':Sequelize[_0x3320('0x1')]},'name':{'type':Sequelize[_0x3320('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x3320('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x3320('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x3320('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x3320('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x3320('0x3')]},'markAsUnread':{'type':Sequelize[_0x3320('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x3320('0x1')],'allowNull':![],'defaultValue':_0x3320('0x4')},'fontSize':{'type':Sequelize[_0x3320('0x5')](0x2)[_0x3320('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3320('0x3')],'defaultValue':function(){return _0x3320('0x7');}},'notificationSound':{'type':Sequelize[_0x3320('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3320('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3320('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3320('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3320('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3320('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3320('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x3320('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x3320('0x2')],'defaultValue':![],'comment':_0x3320('0x9'),'set':function(_0x586c9b){if(!_0x586c9b)this[_0x3320('0xa')](_0x3320('0xb'),null);this[_0x3320('0xa')](_0x3320('0xc'),_0x586c9b);}},'provider':{'type':Sequelize[_0x3320('0xd')](_0x3320('0xe'),_0x3320('0xf'),_0x3320('0x10'),_0x3320('0x11')),'defaultValue':null,'get':function(){if(!this[_0x3320('0x12')](_0x3320('0x13')))return _0x3320('0x14');return this[_0x3320('0x12')](_0x3320('0x13'));},'set':function(_0x1f6331){if(_0x1f6331===_0x3320('0x14'))_0x1f6331=null;return this[_0x3320('0xa')](_0x3320('0x13'),_0x1f6331);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 3dbc1af..9ca1b03 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 _0xdcf9=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','MailAccount','includeAll','include','rows','params','rawAttributes','find','body','custom','provider','secure','Mail\x20Account\x20not\x20found','describe','Disposition','create','findOne','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','email','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','MailAccountId','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','Contact','Owner','internal','Tag','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmContact','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','getSmtpOptions','SendMail','List','List\x20not\x20found','messageId','subject','attach','out','Interaction','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','emit','getAgents','User','moment','bluebird','util','path','lodash','juice','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','update','destroy','get','MailAccounts','UserProfileResource','end','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','username','pass','password','modernAuthentication','CloudProviderId','host','port','service','authentication','user','Smtp','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','fieldName','type'];(function(_0x176e11,_0xbd8c84){var _0x4817c0=function(_0x457036){while(--_0x457036){_0x176e11['push'](_0x176e11['shift']());}};_0x4817c0(++_0xbd8c84);}(_0xdcf9,0x13e));var _0x9dcf=function(_0x2ebf5e,_0x16af2b){_0x2ebf5e=_0x2ebf5e-0x0;var _0x4af3ef=_0xdcf9[_0x2ebf5e];return _0x4af3ef;};'use strict';var moment=require(_0x9dcf('0x0'));var BPromise=require(_0x9dcf('0x1'));var util=require(_0x9dcf('0x2'));var path=require(_0x9dcf('0x3'));var _=require(_0x9dcf('0x4'));var juice=require(_0x9dcf('0x5'));var Redis=require('ioredis');var qs=require(_0x9dcf('0x6'));var logger=require('../../config/logger')(_0x9dcf('0x7'));var config=require(_0x9dcf('0x8'));var db=require(_0x9dcf('0x9'))['db'];config['redis']=_[_0x9dcf('0xa')](config[_0x9dcf('0xb')],{'host':_0x9dcf('0xc'),'port':0x18eb});var socket=require(_0x9dcf('0xd'))(new Redis(config[_0x9dcf('0xb')]));require(_0x9dcf('0xe'))['register'](socket);var jayson=require(_0x9dcf('0xf'));var client=jayson[_0x9dcf('0x10')][_0x9dcf('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x1ba8d4,_0x5d4c90,_0x414ed,_0x596f48){return new BPromise(function(_0x4f845f,_0x3eb173){var _0x349140=_0x596f48||client;return _0x349140['request'](_0x1ba8d4,_0x414ed)[_0x9dcf('0x12')](function(_0x24c048){logger[_0x9dcf('0x13')](_0x9dcf('0x14'),_0x5d4c90,'request\x20sent');logger[_0x9dcf('0x15')](_0x9dcf('0x16'),_0x5d4c90,_0x9dcf('0x17'),JSON[_0x9dcf('0x18')](_0x24c048));if(_0x24c048['error']){if(_0x24c048[_0x9dcf('0x19')][_0x9dcf('0x1a')]===0x1f4){logger[_0x9dcf('0x19')](_0x9dcf('0x14'),_0x5d4c90,_0x24c048[_0x9dcf('0x19')][_0x9dcf('0x1b')]);return _0x3eb173(_0x24c048['error'][_0x9dcf('0x1b')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5d4c90,_0x24c048[_0x9dcf('0x19')]['message']);return _0x4f845f(_0x24c048[_0x9dcf('0x19')][_0x9dcf('0x1b')]);}else{logger[_0x9dcf('0x13')](_0x9dcf('0x14'),_0x5d4c90,_0x9dcf('0x17'));_0x4f845f(_0x24c048[_0x9dcf('0x1c')][_0x9dcf('0x1b')]);}})[_0x9dcf('0x1d')](function(_0x9659d8){logger[_0x9dcf('0x19')]('MailAccount,\x20%s,\x20%s',_0x5d4c90,_0x9659d8);_0x3eb173(_0x9659d8);});});}function respondWithStatusCode(_0x420065,_0x6cdfbf){_0x6cdfbf=_0x6cdfbf||0xcc;return function(_0x2f2e30){if(_0x2f2e30){return _0x420065[_0x9dcf('0x1e')](_0x6cdfbf);}return _0x420065[_0x9dcf('0x1f')](_0x6cdfbf)['end']();};}function respondWithResult(_0x66fd06,_0x410483){_0x410483=_0x410483||0xc8;return function(_0x2aa3d3){if(_0x2aa3d3){return _0x66fd06['status'](_0x410483)[_0x9dcf('0x20')](_0x2aa3d3);}};}function respondWithFilteredResult(_0x4e6bde,_0x2c8c46){return function(_0x44951b){if(_0x44951b){var _0x24efd6=typeof _0x2c8c46[_0x9dcf('0x21')]===_0x9dcf('0x22')&&typeof _0x2c8c46[_0x9dcf('0x23')]==='undefined';var _0x5541a6=_0x44951b[_0x9dcf('0x24')];var _0x1b8895=_0x24efd6?0x0:_0x2c8c46['offset'];var _0x32a61c=_0x24efd6?_0x44951b[_0x9dcf('0x24')]:_0x2c8c46[_0x9dcf('0x21')]+_0x2c8c46[_0x9dcf('0x23')];var _0x44d9bb;if(_0x32a61c>=_0x5541a6){_0x32a61c=_0x5541a6;_0x44d9bb=0xc8;}else{_0x44d9bb=0xce;}_0x4e6bde[_0x9dcf('0x1f')](_0x44d9bb);return _0x4e6bde[_0x9dcf('0x25')]('Content-Range',_0x1b8895+'-'+_0x32a61c+'/'+_0x5541a6)[_0x9dcf('0x20')](_0x44951b);}return null;};}function saveUpdates(_0x3cf370){return function(_0x167c8c){if(_0x167c8c){return _0x167c8c[_0x9dcf('0x26')](_0x3cf370)[_0x9dcf('0x12')](function(_0x2c97d4){return _0x2c97d4;});}return null;};}function removeEntity(_0x356211){return function(_0x211b29){if(_0x211b29){return _0x211b29[_0x9dcf('0x27')]()[_0x9dcf('0x12')](function(){var _0x4e2391=_0x211b29[_0x9dcf('0x28')]({'plain':!![]});var _0x20c790=_0x9dcf('0x29');return db[_0x9dcf('0x2a')][_0x9dcf('0x27')]({'where':{'type':_0x20c790,'resourceId':_0x4e2391['id']}})[_0x9dcf('0x12')](function(){return _0x211b29;});})[_0x9dcf('0x12')](function(){_0x356211[_0x9dcf('0x1f')](0xcc)[_0x9dcf('0x2b')]();});}};}function handleEntityNotFound(_0x4c0f42){return function(_0x481bc9){if(!_0x481bc9){_0x4c0f42['sendStatus'](0x194);}return _0x481bc9;};}function handleError(_0x4d6ecc,_0x5cf0b0){_0x5cf0b0=_0x5cf0b0||0x1f4;return function(_0x41db2e){logger[_0x9dcf('0x19')](_0x41db2e[_0x9dcf('0x2c')]);if(_0x41db2e[_0x9dcf('0x2d')]){delete _0x41db2e[_0x9dcf('0x2d')];}_0x4d6ecc[_0x9dcf('0x1f')](_0x5cf0b0)[_0x9dcf('0x2e')](_0x41db2e);};}function getImapHost(_0x437335){switch(_0x437335){case _0x9dcf('0x2f'):return _0x9dcf('0x30');case _0x9dcf('0x31'):return _0x9dcf('0x32');case _0x9dcf('0x33'):return _0x9dcf('0x34');case _0x9dcf('0x35'):return _0x9dcf('0x36');}throw new Error(_0x9dcf('0x37'),_0x437335);}function getSmtpHost(_0x814f01){switch(_0x814f01){case _0x9dcf('0x2f'):return _0x9dcf('0x38');case _0x9dcf('0x31'):return _0x9dcf('0x39');case _0x9dcf('0x33'):return _0x9dcf('0x3a');case _0x9dcf('0x35'):return _0x9dcf('0x3b');}throw new Error(_0x9dcf('0x37'),_0x814f01);}function getAuthenticationOptions(_0x4e36a1,_0x3a97d6){var _0x13a47b={};var _0xfdd9fe={};if(_0x4e36a1){_0x13a47b['user']=_0xfdd9fe['user']=_0x3a97d6[_0x9dcf('0x3c')];_0x13a47b['password']=_0xfdd9fe[_0x9dcf('0x3d')]=_0x3a97d6[_0x9dcf('0x3e')];if(_0x3a97d6[_0x9dcf('0x3f')]){_0x13a47b['modernAuthentication']=_0xfdd9fe[_0x9dcf('0x3f')]=!![];_0x13a47b['CloudProviderId']=_0xfdd9fe['CloudProviderId']=_0x3a97d6[_0x9dcf('0x40')];_0x13a47b[_0x9dcf('0x3e')]=_0xfdd9fe[_0x9dcf('0x3d')]=null;}else{_0x13a47b[_0x9dcf('0x40')]=_0xfdd9fe['CloudProviderId']=null;}_0x13a47b[_0x9dcf('0x41')]=getImapHost(_0x4e36a1);_0x13a47b[_0x9dcf('0x42')]=0x3e1;_0xfdd9fe[_0x9dcf('0x41')]=getSmtpHost(_0x4e36a1);_0xfdd9fe['port']=0x24b;_0xfdd9fe['secure']=![];_0x13a47b[_0x9dcf('0x43')]=_0xfdd9fe[_0x9dcf('0x43')]=null;}else{if(_0x3a97d6[_0x9dcf('0x44')]){_0x13a47b[_0x9dcf('0x45')]=_0xfdd9fe[_0x9dcf('0x45')]=_0x3a97d6[_0x9dcf('0x3c')];_0x13a47b[_0x9dcf('0x3e')]=_0xfdd9fe[_0x9dcf('0x3d')]=_0x3a97d6[_0x9dcf('0x3e')];}else{_0x13a47b[_0x9dcf('0x44')]=_0xfdd9fe[_0x9dcf('0x44')]=![];_0x13a47b[_0x9dcf('0x45')]=_0xfdd9fe[_0x9dcf('0x45')]=null;_0x13a47b['password']=_0xfdd9fe[_0x9dcf('0x3d')]=null;}_0x13a47b[_0x9dcf('0x41')]=_0x3a97d6['Imap']['host'];_0x13a47b[_0x9dcf('0x42')]=_0x3a97d6['Imap'][_0x9dcf('0x42')];_0xfdd9fe[_0x9dcf('0x41')]=_0x3a97d6[_0x9dcf('0x46')][_0x9dcf('0x41')];_0xfdd9fe[_0x9dcf('0x42')]=_0x3a97d6['Smtp'][_0x9dcf('0x42')];}return{'Imap':_0x13a47b,'Smtp':_0xfdd9fe};}exports[_0x9dcf('0x47')]=function(_0x3ffa18,_0x1f85e2){var _0x362030={'include':[{'model':db[_0x9dcf('0x48')],'as':_0x9dcf('0x49')},{'model':db[_0x9dcf('0x4a')],'as':'Smtp'},{'model':db[_0x9dcf('0x4b')],'as':_0x9dcf('0x4c')}]},_0x2ee479={},_0x260bc2={'count':0x0,'rows':[]};var _0x4513ae=_[_0x9dcf('0x4d')](db['MailAccount']['rawAttributes'],function(_0x42c116){return{'name':_0x42c116[_0x9dcf('0x4e')],'type':_0x42c116[_0x9dcf('0x4f')][_0x9dcf('0x50')]};});_0x2ee479[_0x9dcf('0x51')]=_[_0x9dcf('0x4d')](_0x4513ae,'name');_0x2ee479[_0x9dcf('0x52')]=_[_0x9dcf('0x53')](_0x3ffa18[_0x9dcf('0x52')]);_0x2ee479[_0x9dcf('0x54')]=_[_0x9dcf('0x55')](_0x2ee479[_0x9dcf('0x51')],_0x2ee479[_0x9dcf('0x52')]);_0x362030[_0x9dcf('0x56')]=_[_0x9dcf('0x55')](_0x2ee479[_0x9dcf('0x51')],qs[_0x9dcf('0x57')](_0x3ffa18[_0x9dcf('0x52')]['fields']));_0x362030[_0x9dcf('0x56')]=_0x362030[_0x9dcf('0x56')][_0x9dcf('0x58')]?_0x362030[_0x9dcf('0x56')]:_0x2ee479[_0x9dcf('0x51')];if(!_0x3ffa18[_0x9dcf('0x52')][_0x9dcf('0x59')]('nolimit')){_0x362030[_0x9dcf('0x23')]=qs[_0x9dcf('0x23')](_0x3ffa18['query']['limit']);_0x362030['offset']=qs[_0x9dcf('0x21')](_0x3ffa18[_0x9dcf('0x52')][_0x9dcf('0x21')]);}_0x362030['order']=qs[_0x9dcf('0x5a')](_0x3ffa18[_0x9dcf('0x52')][_0x9dcf('0x5a')]);_0x362030[_0x9dcf('0x5b')]=qs['filters'](_[_0x9dcf('0x5c')](_0x3ffa18[_0x9dcf('0x52')],_0x2ee479[_0x9dcf('0x54')]),_0x4513ae);if(_0x3ffa18['query'][_0x9dcf('0x5d')]){_0x362030[_0x9dcf('0x5b')]=_[_0x9dcf('0x5e')](_0x362030[_0x9dcf('0x5b')],{'$or':_['map'](_0x4513ae,function(_0x20ade2){if(_0x20ade2['type']!==_0x9dcf('0x5f')){var _0x1d6b78={};_0x1d6b78[_0x20ade2[_0x9dcf('0x2d')]]={'$like':'%'+_0x3ffa18[_0x9dcf('0x52')][_0x9dcf('0x5d')]+'%'};return _0x1d6b78;}})});}_0x362030=_['merge']({},_0x362030,_0x3ffa18[_0x9dcf('0x60')]);var _0x3296cc={'where':_0x362030['where']};return db[_0x9dcf('0x61')][_0x9dcf('0x24')](_0x3296cc)['then'](function(_0x3cfdce){_0x260bc2[_0x9dcf('0x24')]=_0x3cfdce;if(_0x3ffa18[_0x9dcf('0x52')][_0x9dcf('0x62')]){_0x362030[_0x9dcf('0x63')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x362030);})[_0x9dcf('0x12')](function(_0x1958fb){_0x260bc2[_0x9dcf('0x64')]=_0x1958fb;return _0x260bc2;})[_0x9dcf('0x12')](respondWithFilteredResult(_0x1f85e2,_0x362030))[_0x9dcf('0x1d')](handleError(_0x1f85e2,null));};exports['show']=function(_0x2f5f8c,_0x3b75a8){var _0x52de7e={'raw':![],'where':{'id':_0x2f5f8c[_0x9dcf('0x65')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x9dcf('0x4a')],'as':_0x9dcf('0x46')},{'model':db[_0x9dcf('0x4b')],'as':_0x9dcf('0x4c')}]},_0xd8cc5b={};_0xd8cc5b[_0x9dcf('0x51')]=_['keys'](db['MailAccount'][_0x9dcf('0x66')]);_0xd8cc5b['query']=_['keys'](_0x2f5f8c['query']);_0xd8cc5b[_0x9dcf('0x54')]=_[_0x9dcf('0x55')](_0xd8cc5b[_0x9dcf('0x51')],_0xd8cc5b[_0x9dcf('0x52')]);_0x52de7e['attributes']=_[_0x9dcf('0x55')](_0xd8cc5b['model'],qs[_0x9dcf('0x57')](_0x2f5f8c['query']['fields']));_0x52de7e[_0x9dcf('0x56')]=_0x52de7e['attributes']['length']?_0x52de7e['attributes']:_0xd8cc5b[_0x9dcf('0x51')];if(_0x2f5f8c[_0x9dcf('0x52')][_0x9dcf('0x62')]){_0x52de7e[_0x9dcf('0x63')]=[{'all':!![]}];}_0x52de7e=_[_0x9dcf('0x5e')]({},_0x52de7e,_0x2f5f8c[_0x9dcf('0x60')]);return db[_0x9dcf('0x61')][_0x9dcf('0x67')](_0x52de7e)[_0x9dcf('0x12')](handleEntityNotFound(_0x3b75a8,null))[_0x9dcf('0x12')](respondWithResult(_0x3b75a8,null))[_0x9dcf('0x1d')](handleError(_0x3b75a8,null));};exports[_0x9dcf('0x26')]=function(_0x332649,_0x3bdf1f){if(_0x332649[_0x9dcf('0x68')]['id']){delete _0x332649['body']['id'];}var _0x1e397c=_0x332649[_0x9dcf('0x68')]['provider']===_0x9dcf('0x69')?null:_0x332649[_0x9dcf('0x68')][_0x9dcf('0x6a')];var _0x24cf4d=_0x332649[_0x9dcf('0x68')][_0x9dcf('0x49')]||{};var _0x1c98d1=_0x332649[_0x9dcf('0x68')]['Smtp']||{};if(_0x1e397c){_0x24cf4d[_0x9dcf('0x41')]=getImapHost(_0x1e397c);_0x24cf4d['port']=0x3e1;_0x1c98d1[_0x9dcf('0x41')]=getSmtpHost(_0x1e397c);_0x1c98d1[_0x9dcf('0x42')]=0x24b;_0x1c98d1[_0x9dcf('0x6b')]=![];}if(_0x1c98d1[_0x9dcf('0x3f')]){_0x1c98d1[_0x9dcf('0x6b')]=![];}else{_0x1c98d1[_0x9dcf('0x40')]=null;}if(!_0x24cf4d[_0x9dcf('0x3f')])_0x24cf4d['CloudProviderId']=null;_0x332649[_0x9dcf('0x68')][_0x9dcf('0x49')]=_0x24cf4d;_0x332649['body'][_0x9dcf('0x46')]=_0x1c98d1;return db[_0x9dcf('0x61')]['find']({'where':{'id':_0x332649[_0x9dcf('0x65')]['id']},'include':[{'model':db[_0x9dcf('0x48')],'as':_0x9dcf('0x49')},{'model':db[_0x9dcf('0x4a')],'as':_0x9dcf('0x46')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3bdf1f,null))[_0x9dcf('0x12')](function(_0x155c8c){if(!_0x155c8c)throw new Error(_0x9dcf('0x6c'));if(_0x155c8c[_0x9dcf('0x43')])delete _0x332649[_0x9dcf('0x68')]['Imap'];return _0x155c8c;})['then'](saveUpdates(_0x332649[_0x9dcf('0x68')],null))[_0x9dcf('0x12')](function(_0x5b3f8c){if(!_0x332649[_0x9dcf('0x68')][_0x9dcf('0x49')])return _0x5b3f8c;return db['MailServerIn'][_0x9dcf('0x26')](_0x332649['body'][_0x9dcf('0x49')],{'where':{'MailAccountId':_0x5b3f8c['id']}})['then'](function(){return _0x5b3f8c;});})[_0x9dcf('0x12')](function(_0x1d6fe9){if(!_0x332649[_0x9dcf('0x68')][_0x9dcf('0x46')])return _0x1d6fe9;return db[_0x9dcf('0x4a')]['update'](_0x332649['body'][_0x9dcf('0x46')],{'where':{'MailAccountId':_0x1d6fe9['id']}})['then'](function(){return _0x1d6fe9;});})[_0x9dcf('0x12')](respondWithResult(_0x3bdf1f,null))[_0x9dcf('0x1d')](handleError(_0x3bdf1f,null));};exports['describe']=function(_0x5348b3,_0x9a4862){return db[_0x9dcf('0x61')][_0x9dcf('0x6d')]()[_0x9dcf('0x12')](respondWithResult(_0x9a4862,null))[_0x9dcf('0x1d')](handleError(_0x9a4862,null));};exports['addDisposition']=function(_0x133dff,_0x35eab6){if(_0x133dff[_0x9dcf('0x68')]['id']){delete _0x133dff[_0x9dcf('0x68')]['id'];}return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x133dff['params']['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x35eab6,null))[_0x9dcf('0x12')](function(_0xdbf8b5){if(_0xdbf8b5){_0x133dff['body']['MailAccountId']=_0xdbf8b5['id'];return db[_0x9dcf('0x6e')][_0x9dcf('0x6f')](_0x133dff[_0x9dcf('0x68')]);}})[_0x9dcf('0x12')](respondWithResult(_0x35eab6,null))[_0x9dcf('0x1d')](handleError(_0x35eab6,null));};exports['getDispositions']=function(_0x5338f6,_0x3cd4bd){var _0x31aa5c={'raw':![],'where':{}};var _0x563e9d={};var _0x555b75={'count':0x0,'rows':[]};return db[_0x9dcf('0x61')][_0x9dcf('0x70')]({'where':{'id':_0x5338f6[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x3cd4bd,null))['then'](function(_0x1a5a12){if(_0x1a5a12){_0x563e9d[_0x9dcf('0x51')]=_[_0x9dcf('0x53')](db[_0x9dcf('0x6e')][_0x9dcf('0x66')]);_0x563e9d[_0x9dcf('0x52')]=_[_0x9dcf('0x53')](_0x5338f6[_0x9dcf('0x52')]);_0x563e9d[_0x9dcf('0x54')]=_[_0x9dcf('0x55')](_0x563e9d[_0x9dcf('0x51')],_0x563e9d[_0x9dcf('0x52')]);_0x31aa5c['attributes']=_[_0x9dcf('0x55')](_0x563e9d[_0x9dcf('0x51')],qs[_0x9dcf('0x57')](_0x5338f6[_0x9dcf('0x52')]['fields']));_0x31aa5c['attributes']=_0x31aa5c[_0x9dcf('0x56')][_0x9dcf('0x58')]?_0x31aa5c[_0x9dcf('0x56')]:_0x563e9d['model'];if(!_0x5338f6['query'][_0x9dcf('0x59')]('nolimit')){_0x31aa5c[_0x9dcf('0x23')]=qs['limit'](_0x5338f6['query'][_0x9dcf('0x23')]);_0x31aa5c[_0x9dcf('0x21')]=qs['offset'](_0x5338f6['query'][_0x9dcf('0x21')]);}_0x31aa5c[_0x9dcf('0x71')]=qs[_0x9dcf('0x5a')](_0x5338f6[_0x9dcf('0x52')][_0x9dcf('0x5a')]);_0x31aa5c[_0x9dcf('0x5b')]=qs[_0x9dcf('0x54')](_['pick'](_0x5338f6[_0x9dcf('0x52')],_0x563e9d[_0x9dcf('0x54')]));_0x31aa5c[_0x9dcf('0x5b')]['MailAccountId']=_0x1a5a12['id'];if(_0x5338f6[_0x9dcf('0x52')][_0x9dcf('0x5d')]){_0x31aa5c[_0x9dcf('0x5b')]=_[_0x9dcf('0x5e')](_0x31aa5c[_0x9dcf('0x5b')],{'$or':_[_0x9dcf('0x4d')](_0x31aa5c[_0x9dcf('0x56')],function(_0x3b68c7){var _0x3c8836={};_0x3c8836[_0x3b68c7]={'$like':'%'+_0x5338f6['query']['filter']+'%'};return _0x3c8836;})});}_0x31aa5c=_[_0x9dcf('0x5e')]({},_0x31aa5c,_0x5338f6[_0x9dcf('0x60')]);return db[_0x9dcf('0x6e')][_0x9dcf('0x24')]({'where':_0x31aa5c[_0x9dcf('0x5b')]})[_0x9dcf('0x12')](function(_0xaa18c6){_0x555b75[_0x9dcf('0x24')]=_0xaa18c6;if(_0x5338f6['query'][_0x9dcf('0x62')]){_0x31aa5c[_0x9dcf('0x63')]=[{'all':!![]}];}return db['Disposition'][_0x9dcf('0x72')](_0x31aa5c);})[_0x9dcf('0x12')](function(_0x4acd42){_0x555b75[_0x9dcf('0x64')]=_0x4acd42;return _0x555b75;});}})[_0x9dcf('0x12')](respondWithFilteredResult(_0x3cd4bd,_0x31aa5c))['catch'](handleError(_0x3cd4bd,null));};exports[_0x9dcf('0x73')]=function(_0x2f8984,_0x4e6df1){return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x2f8984['params']['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x4e6df1,null))[_0x9dcf('0x12')](function(_0x2a29e9){if(_0x2a29e9){return _0x2a29e9[_0x9dcf('0x73')](_0x2f8984['query'][_0x9dcf('0x74')]);}})[_0x9dcf('0x12')](respondWithStatusCode(_0x4e6df1,null))['catch'](handleError(_0x4e6df1,null));};exports[_0x9dcf('0x75')]=function(_0x1c1039,_0x1025b1){if(_0x1c1039[_0x9dcf('0x68')]['id']){delete _0x1c1039[_0x9dcf('0x68')]['id'];}return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x1c1039[_0x9dcf('0x65')]['id']}})['then'](handleEntityNotFound(_0x1025b1,null))[_0x9dcf('0x12')](function(_0x2f6019){if(_0x2f6019){_0x1c1039[_0x9dcf('0x68')]['MailAccountId']=_0x2f6019['id'];return db[_0x9dcf('0x76')][_0x9dcf('0x6f')](_0x1c1039[_0x9dcf('0x68')]);}})[_0x9dcf('0x12')](respondWithResult(_0x1025b1,null))[_0x9dcf('0x1d')](handleError(_0x1025b1,null));};exports[_0x9dcf('0x77')]=function(_0x3a2af1,_0x5ec7e6){var _0x35a432={'raw':![],'where':{}};var _0x54bf03={};var _0x3e56da={'count':0x0,'rows':[]};return db['MailAccount'][_0x9dcf('0x70')]({'where':{'id':_0x3a2af1[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x5ec7e6,null))['then'](function(_0x480be9){if(_0x480be9){_0x54bf03['model']=_['keys'](db['CannedAnswer'][_0x9dcf('0x66')]);_0x54bf03[_0x9dcf('0x52')]=_[_0x9dcf('0x53')](_0x3a2af1[_0x9dcf('0x52')]);_0x54bf03[_0x9dcf('0x54')]=_['intersection'](_0x54bf03[_0x9dcf('0x51')],_0x54bf03['query']);_0x35a432['attributes']=_['intersection'](_0x54bf03['model'],qs[_0x9dcf('0x57')](_0x3a2af1[_0x9dcf('0x52')][_0x9dcf('0x57')]));_0x35a432['attributes']=_0x35a432[_0x9dcf('0x56')][_0x9dcf('0x58')]?_0x35a432[_0x9dcf('0x56')]:_0x54bf03[_0x9dcf('0x51')];if(!_0x3a2af1['query'][_0x9dcf('0x59')](_0x9dcf('0x78'))){_0x35a432['limit']=qs[_0x9dcf('0x23')](_0x3a2af1['query'][_0x9dcf('0x23')]);_0x35a432[_0x9dcf('0x21')]=qs[_0x9dcf('0x21')](_0x3a2af1[_0x9dcf('0x52')]['offset']);}_0x35a432['order']=qs[_0x9dcf('0x5a')](_0x3a2af1[_0x9dcf('0x52')]['sort']);_0x35a432[_0x9dcf('0x5b')]=qs['filters'](_[_0x9dcf('0x5c')](_0x3a2af1[_0x9dcf('0x52')],_0x54bf03['filters']));_0x35a432[_0x9dcf('0x5b')]['MailAccountId']=_0x480be9['id'];if(_0x3a2af1[_0x9dcf('0x52')][_0x9dcf('0x5d')]){_0x35a432[_0x9dcf('0x5b')]=_[_0x9dcf('0x5e')](_0x35a432[_0x9dcf('0x5b')],{'$or':_[_0x9dcf('0x4d')](_0x35a432[_0x9dcf('0x56')],function(_0x15cc5f){var _0x1313fa={};_0x1313fa[_0x15cc5f]={'$like':'%'+_0x3a2af1[_0x9dcf('0x52')][_0x9dcf('0x5d')]+'%'};return _0x1313fa;})});}_0x35a432=_[_0x9dcf('0x5e')]({},_0x35a432,_0x3a2af1[_0x9dcf('0x60')]);return db[_0x9dcf('0x76')]['count']({'where':_0x35a432[_0x9dcf('0x5b')]})[_0x9dcf('0x12')](function(_0x11a4b1){_0x3e56da[_0x9dcf('0x24')]=_0x11a4b1;if(_0x3a2af1['query'][_0x9dcf('0x62')]){_0x35a432[_0x9dcf('0x63')]=[{'all':!![]}];}return db[_0x9dcf('0x76')][_0x9dcf('0x72')](_0x35a432);})[_0x9dcf('0x12')](function(_0x49fb61){_0x3e56da['rows']=_0x49fb61;return _0x3e56da;});}})[_0x9dcf('0x12')](respondWithFilteredResult(_0x5ec7e6,_0x35a432))[_0x9dcf('0x1d')](handleError(_0x5ec7e6,null));};exports[_0x9dcf('0x79')]=function(_0x3a4c06,_0x4ed0f5){return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x3a4c06[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x4ed0f5,null))['then'](function(_0x54052e){if(_0x54052e){return _0x54052e[_0x9dcf('0x79')](_0x3a4c06[_0x9dcf('0x52')]['ids']);}})[_0x9dcf('0x12')](respondWithStatusCode(_0x4ed0f5,null))[_0x9dcf('0x1d')](handleError(_0x4ed0f5,null));};exports[_0x9dcf('0x6f')]=function(_0x580d53,_0x5b5375){var _0x56f86a={'name':_0x580d53['body'][_0x9dcf('0x2d')],'key':_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x50')],'provider':_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x6a')]==='custom'?null:_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x6a')],'email':_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x7a')],'ListId':_0x580d53[_0x9dcf('0x68')]['ListId'],'active':!_[_0x9dcf('0x7b')](_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x7c')])?_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x7c')]:!![],'description':_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x7d')]||null};var _0xec2398=getAuthenticationOptions(_0x56f86a[_0x9dcf('0x6a')],_0x580d53[_0x9dcf('0x68')]);_0x56f86a[_0x9dcf('0x49')]=_0xec2398[_0x9dcf('0x49')];_0x56f86a['Smtp']=_0xec2398['Smtp'];return db[_0x9dcf('0x61')][_0x9dcf('0x6f')](_0x56f86a,{'include':[{'model':db['MailServerOut'],'as':_0x9dcf('0x46')},{'model':db[_0x9dcf('0x48')],'as':_0x9dcf('0x49')}]})[_0x9dcf('0x12')](function(_0x3105b3){var _0x5c6195=_0x580d53['user'][_0x9dcf('0x28')]({'plain':!![]});if(!_0x5c6195)throw new Error(_0x9dcf('0x7e'));if(_0x5c6195[_0x9dcf('0x7f')]===_0x9dcf('0x45')){var _0x90b6f7=_0x3105b3[_0x9dcf('0x28')]({'plain':!![]});return db[_0x9dcf('0x80')][_0x9dcf('0x67')]({'where':{'name':_0x9dcf('0x29'),'userProfileId':_0x5c6195[_0x9dcf('0x81')]},'raw':!![]})[_0x9dcf('0x12')](function(_0x24bf47){if(_0x24bf47&&_0x24bf47[_0x9dcf('0x82')]===0x0){return db['UserProfileResource'][_0x9dcf('0x6f')]({'name':_0x90b6f7[_0x9dcf('0x2d')],'resourceId':_0x90b6f7['id'],'type':_0x24bf47['name'],'sectionId':_0x24bf47['id']},{})['then'](function(){return _0x3105b3;});}else{return _0x3105b3;}})[_0x9dcf('0x1d')](function(_0x18818f){logger[_0x9dcf('0x19')](_0x9dcf('0x83'),_0x18818f);throw _0x18818f;});}return _0x3105b3;})[_0x9dcf('0x12')](respondWithResult(_0x5b5375,0xc9))[_0x9dcf('0x1d')](handleError(_0x5b5375,null));};exports[_0x9dcf('0x84')]=function(_0x316c1b,_0x43e45a){return db['MailAccount'][_0x9dcf('0x70')]({'where':{'id':_0x316c1b[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x43e45a,null))[_0x9dcf('0x12')](function(_0x36c205){if(_0x36c205){return _0x36c205['getImap']();}return null;})[_0x9dcf('0x12')](respondWithResult(_0x43e45a,null))[_0x9dcf('0x1d')](handleError(_0x43e45a,null));};exports['addImap']=function(_0x15da14,_0x605ada){if(_0x15da14[_0x9dcf('0x68')]['id']){delete _0x15da14[_0x9dcf('0x68')]['id'];}return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x15da14[_0x9dcf('0x65')]['id']}})['then'](handleEntityNotFound(_0x605ada,null))[_0x9dcf('0x12')](function(_0x43ae4d){if(_0x43ae4d){_0x15da14[_0x9dcf('0x68')][_0x9dcf('0x85')]=_0x43ae4d['id'];return db[_0x9dcf('0x48')][_0x9dcf('0x6f')](_0x15da14[_0x9dcf('0x68')]);}})[_0x9dcf('0x12')](respondWithResult(_0x605ada,null))['catch'](handleError(_0x605ada,null));};exports[_0x9dcf('0x86')]=function(_0x53d182,_0x2653ee){return db[_0x9dcf('0x61')]['findOne']({'where':{'id':_0x53d182[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x2653ee,null))[_0x9dcf('0x12')](function(_0x39f783){if(_0x39f783){return _0x39f783['setImap'](null);}return null;})[_0x9dcf('0x12')](respondWithStatusCode(_0x2653ee,null))[_0x9dcf('0x1d')](handleError(_0x2653ee,null));};exports[_0x9dcf('0x87')]=function(_0x46c81d,_0x51c699){return db['MailAccount'][_0x9dcf('0x70')]({'where':{'id':_0x46c81d['params']['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x51c699,null))['then'](function(_0xbd912f){if(_0xbd912f){return _0xbd912f[_0x9dcf('0x87')]();}return null;})[_0x9dcf('0x12')](respondWithResult(_0x51c699,null))[_0x9dcf('0x1d')](handleError(_0x51c699,null));};exports[_0x9dcf('0x88')]=function(_0x2c413f,_0x58e979){if(_0x2c413f['body']['id']){delete _0x2c413f['body']['id'];}return db['MailAccount'][_0x9dcf('0x67')]({'where':{'id':_0x2c413f[_0x9dcf('0x65')]['id']}})['then'](handleEntityNotFound(_0x58e979,null))[_0x9dcf('0x12')](function(_0xd0bdab){if(_0xd0bdab){_0x2c413f[_0x9dcf('0x68')][_0x9dcf('0x85')]=_0xd0bdab['id'];return db[_0x9dcf('0x4a')][_0x9dcf('0x6f')](_0x2c413f[_0x9dcf('0x68')]);}})['then'](respondWithResult(_0x58e979,null))['catch'](handleError(_0x58e979,null));};exports[_0x9dcf('0x89')]=function(_0x4c0693,_0x14d2b7){return db[_0x9dcf('0x61')]['findOne']({'where':{'id':_0x4c0693['params']['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x14d2b7,null))[_0x9dcf('0x12')](function(_0x40d822){if(_0x40d822){return _0x40d822[_0x9dcf('0x8a')](null);}return null;})[_0x9dcf('0x12')](respondWithStatusCode(_0x14d2b7,null))[_0x9dcf('0x1d')](handleError(_0x14d2b7,null));};exports[_0x9dcf('0x8b')]=function(_0x49c160,_0xa29cf4){return db[_0x9dcf('0x8c')][_0x9dcf('0x67')]({'where':{'id':_0x49c160[_0x9dcf('0x65')]['id']}})['then'](handleEntityNotFound(_0xa29cf4,null))[_0x9dcf('0x12')](function(_0xc14866){if(_0xc14866){return _0xc14866[_0x9dcf('0x8b')](_0x49c160[_0x9dcf('0x68')][_0x9dcf('0x74')],_['omit'](_0x49c160[_0x9dcf('0x68')],['ids','id'])||{});}})['then'](respondWithResult(_0xa29cf4,null))['catch'](handleError(_0xa29cf4,null));};exports[_0x9dcf('0x8d')]=function(_0x4c6b9f,_0x1dace0){var _0x25bff4={'raw':![],'where':{}};var _0x4d6668={};var _0x58181d={'count':0x0,'rows':[]};return db[_0x9dcf('0x61')]['findOne']({'where':{'id':_0x4c6b9f[_0x9dcf('0x65')]['id']}})['then'](handleEntityNotFound(_0x1dace0,null))[_0x9dcf('0x12')](function(_0x1af33a){if(_0x1af33a){_0x4d6668[_0x9dcf('0x51')]=_['keys'](db[_0x9dcf('0x8c')][_0x9dcf('0x66')]);_0x4d6668[_0x9dcf('0x52')]=_[_0x9dcf('0x53')](_0x4c6b9f['query']);_0x4d6668['filters']=_['intersection'](_0x4d6668['model'],_0x4d6668[_0x9dcf('0x52')]);_0x25bff4[_0x9dcf('0x56')]=_[_0x9dcf('0x55')](_0x4d6668[_0x9dcf('0x51')],qs[_0x9dcf('0x57')](_0x4c6b9f[_0x9dcf('0x52')][_0x9dcf('0x57')]));_0x25bff4['attributes']=_0x25bff4['attributes'][_0x9dcf('0x58')]?_0x25bff4[_0x9dcf('0x56')]:_0x4d6668[_0x9dcf('0x51')];if(!_0x4c6b9f[_0x9dcf('0x52')][_0x9dcf('0x59')](_0x9dcf('0x78'))){_0x25bff4[_0x9dcf('0x23')]=qs[_0x9dcf('0x23')](_0x4c6b9f[_0x9dcf('0x52')]['limit']);_0x25bff4['offset']=qs['offset'](_0x4c6b9f[_0x9dcf('0x52')]['offset']);}_0x25bff4['order']=qs['sort'](_0x4c6b9f['query']['sort']);_0x25bff4['where']=qs[_0x9dcf('0x54')](_[_0x9dcf('0x5c')](_0x4c6b9f[_0x9dcf('0x52')],_0x4d6668['filters']));_0x25bff4['where'][_0x9dcf('0x85')]=_0x1af33a['id'];if(_0x4c6b9f[_0x9dcf('0x52')][_0x9dcf('0x5d')]){_0x25bff4[_0x9dcf('0x5b')]=_[_0x9dcf('0x5e')](_0x25bff4[_0x9dcf('0x5b')],{'$or':_[_0x9dcf('0x4d')](_0x25bff4['attributes'],function(_0x5d3cb0){var _0x55f690={};_0x55f690[_0x5d3cb0]={'$like':'%'+_0x4c6b9f[_0x9dcf('0x52')][_0x9dcf('0x5d')]+'%'};return _0x55f690;})});}_0x25bff4=_[_0x9dcf('0x5e')]({},_0x25bff4,_0x4c6b9f[_0x9dcf('0x60')]);return db['MailInteraction'][_0x9dcf('0x24')]({'where':_0x25bff4[_0x9dcf('0x5b')]})[_0x9dcf('0x12')](function(_0x19b73d){_0x58181d[_0x9dcf('0x24')]=_0x19b73d;if(_0x4c6b9f['query'][_0x9dcf('0x62')]){_0x25bff4[_0x9dcf('0x63')]=[{'model':db['CmContact'],'as':_0x9dcf('0x8e'),'required':![]},{'model':db['User'],'as':_0x9dcf('0x8f'),'attributes':[_0x9dcf('0x2d'),'fullname',_0x9dcf('0x90')],'required':![]},{'model':db[_0x9dcf('0x91')],'as':'Tags','attributes':['id',_0x9dcf('0x2d'),_0x9dcf('0x92')],'where':_0x4c6b9f['query'][_0x9dcf('0x93')]?{'id':_0x4c6b9f[_0x9dcf('0x52')][_0x9dcf('0x93')]}:undefined,'required':_0x4c6b9f[_0x9dcf('0x52')][_0x9dcf('0x93')]?!![]:![]}];}return db['MailInteraction'][_0x9dcf('0x72')](_0x25bff4);})[_0x9dcf('0x12')](function(_0x53bd73){_0x58181d[_0x9dcf('0x64')]=_0x53bd73;return _0x58181d;});}})[_0x9dcf('0x12')](respondWithFilteredResult(_0x1dace0,_0x25bff4))[_0x9dcf('0x1d')](handleError(_0x1dace0,null));};exports[_0x9dcf('0x94')]=function addApplications(_0x48b903,_0x23a099){var _0xbb8c8b=_0x48b903[_0x9dcf('0x65')]['id'];var _0x177298=_0x48b903[_0x9dcf('0x68')];var _0x1060a8=0xc8;var _0xe42d61=null;return db[_0x9dcf('0x95')][_0x9dcf('0x96')]({'isolationLevel':db[_0x9dcf('0x95')][_0x9dcf('0x97')][_0x9dcf('0x98')][_0x9dcf('0x99')]},function(_0x524330){return db[_0x9dcf('0x61')][_0x9dcf('0x70')]({'where':{'id':_0xbb8c8b},'transaction':_0x524330})[_0x9dcf('0x12')](function(_0xdc4a9f){if(_0xdc4a9f){return db[_0x9dcf('0x9a')][_0x9dcf('0x27')]({'where':{'MailAccountId':_0xbb8c8b},'transaction':_0x524330})['then'](function(){var _0x1b8c65=_[_0x9dcf('0x4d')](_0x177298,function(_0x1feb7e){_0x1feb7e[_0x9dcf('0x85')]=_0xbb8c8b;return _0x1feb7e;});return db[_0x9dcf('0x9a')][_0x9dcf('0x9b')](_0x1b8c65,{'transaction':_0x524330});});}else{_0x1060a8=0x194;_0xe42d61=[];}});})[_0x9dcf('0x12')](function(){if(_0x1060a8!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0xbb8c8b},'order':_0x9dcf('0x9c')})[_0x9dcf('0x12')](function(_0x473c7e){_0xe42d61=_0x473c7e;});}})['catch'](function(_0x1c2914){_0x1060a8=0x1f4;logger[_0x9dcf('0x19')](_0x1c2914[_0x9dcf('0x2c')]);if(_0x1c2914[_0x9dcf('0x2d')]){delete _0x1c2914['name'];}_0xe42d61=_0x1c2914;})['finally'](function(){if(_0xe42d61===null){_0x23a099[_0x9dcf('0x1e')](_0x1060a8);}else{if(_0x1060a8===0x1f4){_0x23a099[_0x9dcf('0x1f')](_0x1060a8)['send'](_0xe42d61);}else{_0x23a099[_0x9dcf('0x1f')](_0x1060a8)[_0x9dcf('0x20')](_0xe42d61);}}});};exports[_0x9dcf('0x9d')]=function(_0xab7f5,_0xd0c4db){var _0x17770b={};var _0xe4aca0={};var _0x6e3b66;var _0x150e78;return db[_0x9dcf('0x61')][_0x9dcf('0x70')]({'where':{'id':_0xab7f5['params']['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0xd0c4db,null))[_0x9dcf('0x12')](function(_0x1263ff){if(_0x1263ff){_0x6e3b66=_0x1263ff;_0xe4aca0['model']=_[_0x9dcf('0x53')](db[_0x9dcf('0x9a')][_0x9dcf('0x66')]);_0xe4aca0[_0x9dcf('0x52')]=_['keys'](_0xab7f5[_0x9dcf('0x52')]);_0xe4aca0['filters']=_[_0x9dcf('0x55')](_0xe4aca0[_0x9dcf('0x51')],_0xe4aca0['query']);_0x17770b['attributes']=_[_0x9dcf('0x55')](_0xe4aca0['model'],qs['fields'](_0xab7f5['query'][_0x9dcf('0x57')]));_0x17770b['attributes']=_0x17770b['attributes'][_0x9dcf('0x58')]?_0x17770b[_0x9dcf('0x56')]:_0xe4aca0[_0x9dcf('0x51')];_0x17770b[_0x9dcf('0x71')]=qs[_0x9dcf('0x5a')](_0xab7f5[_0x9dcf('0x52')]['sort']);_0x17770b[_0x9dcf('0x5b')]=qs[_0x9dcf('0x54')](_[_0x9dcf('0x5c')](_0xab7f5[_0x9dcf('0x52')],_0xe4aca0[_0x9dcf('0x54')]));if(_0xab7f5['query'][_0x9dcf('0x5d')]){_0x17770b[_0x9dcf('0x5b')]=_[_0x9dcf('0x5e')](_0x17770b[_0x9dcf('0x5b')],{'$or':_[_0x9dcf('0x4d')](_0x17770b[_0x9dcf('0x56')],function(_0x373efd){var _0xa1967a={};_0xa1967a[_0x373efd]={'$like':'%'+_0xab7f5[_0x9dcf('0x52')][_0x9dcf('0x5d')]+'%'};return _0xa1967a;})});}_0x17770b=_['merge']({},_0x17770b,_0xab7f5[_0x9dcf('0x60')]);return _0x6e3b66['getApplications'](_0x17770b);}})[_0x9dcf('0x12')](function(_0xc66746){if(_0xc66746){_0x150e78=_0xc66746[_0x9dcf('0x58')];if(!_0xab7f5[_0x9dcf('0x52')][_0x9dcf('0x59')]('nolimit')){_0x17770b[_0x9dcf('0x23')]=qs[_0x9dcf('0x23')](_0xab7f5[_0x9dcf('0x52')][_0x9dcf('0x23')]);_0x17770b[_0x9dcf('0x21')]=qs[_0x9dcf('0x21')](_0xab7f5['query'][_0x9dcf('0x21')]);}return _0x6e3b66[_0x9dcf('0x9d')](_0x17770b);}})[_0x9dcf('0x12')](function(_0x2ce6db){if(_0x2ce6db){return _0x2ce6db?{'count':_0x150e78,'rows':_0x2ce6db}:null;}})[_0x9dcf('0x12')](respondWithResult(_0xd0c4db,null))[_0x9dcf('0x1d')](handleError(_0xd0c4db,null));};exports[_0x9dcf('0x9e')]=function(_0x240554,_0x3bce89){var _0x27e298={'raw':!![],'where':{}};var _0x1fab59={};var _0x46b9c1={'count':0x0,'rows':[]};return db[_0x9dcf('0x61')][_0x9dcf('0x70')]({'where':{'id':_0x240554[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x3bce89,null))[_0x9dcf('0x12')](function(_0x394b61){if(_0x394b61){_0x1fab59[_0x9dcf('0x51')]=_[_0x9dcf('0x53')](db[_0x9dcf('0x9f')]['rawAttributes']);_0x1fab59[_0x9dcf('0x52')]=_['keys'](_0x240554[_0x9dcf('0x52')]);_0x1fab59[_0x9dcf('0x54')]=_[_0x9dcf('0x55')](_0x1fab59['model'],_0x1fab59[_0x9dcf('0x52')]);_0x27e298[_0x9dcf('0x56')]=_[_0x9dcf('0x55')](_0x1fab59[_0x9dcf('0x51')],qs[_0x9dcf('0x57')](_0x240554[_0x9dcf('0x52')][_0x9dcf('0x57')]));_0x27e298['attributes']=_0x27e298[_0x9dcf('0x56')][_0x9dcf('0x58')]?_0x27e298[_0x9dcf('0x56')]:_0x1fab59['model'];if(!_0x240554[_0x9dcf('0x52')][_0x9dcf('0x59')](_0x9dcf('0x78'))){_0x27e298[_0x9dcf('0x23')]=qs[_0x9dcf('0x23')](_0x240554[_0x9dcf('0x52')][_0x9dcf('0x23')]);_0x27e298[_0x9dcf('0x21')]=qs[_0x9dcf('0x21')](_0x240554['query'][_0x9dcf('0x21')]);}_0x27e298[_0x9dcf('0x71')]=qs[_0x9dcf('0x5a')](_0x240554[_0x9dcf('0x52')]['sort']);_0x27e298['where']=qs['filters'](_[_0x9dcf('0x5c')](_0x240554[_0x9dcf('0x52')],_0x1fab59[_0x9dcf('0x54')]));_0x27e298[_0x9dcf('0x5b')][_0x9dcf('0x85')]=_0x394b61['id'];if(_0x240554['query']['filter']){_0x27e298['where']=_[_0x9dcf('0x5e')](_0x27e298[_0x9dcf('0x5b')],{'$or':_[_0x9dcf('0x4d')](_0x27e298[_0x9dcf('0x56')],function(_0x500af3){var _0x3af60d={};_0x3af60d[_0x500af3]={'$like':'%'+_0x240554[_0x9dcf('0x52')][_0x9dcf('0x5d')]+'%'};return _0x3af60d;})});}if(_0x240554[_0x9dcf('0x52')]['$gte']){var _0x3d29e7=_0x240554['query'][_0x9dcf('0xa0')][_0x9dcf('0xa1')](',');var _0xbc853={};_0xbc853[_0x3d29e7[0x0]]={'$gte':moment(_0x3d29e7[0x1])[_0x9dcf('0xa2')](_0x9dcf('0xa3'))};_0x27e298[_0x9dcf('0x5b')]=_['merge'](_0x27e298['where'],_0xbc853);}_0x27e298=_['merge']({},_0x27e298,_0x240554['options']);return db[_0x9dcf('0x9f')][_0x9dcf('0x24')]({'where':_0x27e298[_0x9dcf('0x5b')]})[_0x9dcf('0x12')](function(_0x4d5133){_0x46b9c1[_0x9dcf('0x24')]=_0x4d5133;if(_0x240554['query'][_0x9dcf('0x62')]){_0x27e298['include']=[{'all':!![]}];}return db[_0x9dcf('0x9f')]['findAll'](_0x27e298);})['then'](function(_0x85c39){if(_0x240554[_0x9dcf('0x52')][_0x9dcf('0xa4')]==='true'){for(var _0x443563=0x0;_0x443563<_0x85c39[_0x9dcf('0x58')];_0x443563++){_0x85c39[_0x443563][_0x9dcf('0x68')]=juice(_0x85c39[_0x443563][_0x9dcf('0x68')]);}}_0x46b9c1[_0x9dcf('0x64')]=_0x85c39;return _0x46b9c1;});}})[_0x9dcf('0x12')](respondWithFilteredResult(_0x3bce89,_0x27e298))[_0x9dcf('0x1d')](handleError(_0x3bce89,null));};exports[_0x9dcf('0x2e')]=function(_0x2a56f1,_0x3684fb){var _0x234efc,_0x4ded08={},_0x323601;if(_0x2a56f1[_0x9dcf('0x68')]['to']){_0x323601=_0x2a56f1[_0x9dcf('0x68')]['to'][_0x9dcf('0xa1')](',')[0x0];}return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x2a56f1['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x9dcf('0xa5')],'as':_0x9dcf('0xa6'),'where':{'email':_0x323601},'limit':0x1,'order':[[_0x9dcf('0xa7'),_0x9dcf('0xa8')]]}]},{'model':db[_0x9dcf('0x4a')],'as':_0x9dcf('0x46'),'raw':!![],'include':[{'model':db[_0x9dcf('0xa9')],'as':_0x9dcf('0xa9'),'raw':!![]}]}]})[_0x9dcf('0x12')](handleEntityNotFound(_0x3684fb,null))[_0x9dcf('0x12')](function(_0x47d0ae){if(!_0x47d0ae)return;_0x234efc=_0x47d0ae;if(!_0x47d0ae[_0x9dcf('0x46')])throw new Error(_0x9dcf('0xaa'));if(_[_0x9dcf('0x7b')](_0x2a56f1['body'][_0x9dcf('0xab')])){_0x2a56f1['body']['from']=util[_0x9dcf('0xa2')](_0x9dcf('0xac'),_0x47d0ae[_0x9dcf('0x2d')],_0x47d0ae[_0x9dcf('0x7a')]||_0x47d0ae[_0x9dcf('0x46')][_0x9dcf('0x45')]);}if(_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xad')]&&_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xad')][_0x9dcf('0x58')]){for(var _0x27a00d=0x0;_0x27a00d<_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xad')][_0x9dcf('0x58')];_0x27a00d+=0x1){_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xad')][_0x27a00d]={'filename':_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xad')][_0x27a00d][_0x9dcf('0x2d')],'path':path[_0x9dcf('0xae')](config['root'],_0x9dcf('0xaf'),_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xad')][_0x27a00d][_0x9dcf('0xb0')])};}}var _0x37afd4=_0x47d0ae[_0x9dcf('0xb1')]();return respondWithRpcPromise(_0x9dcf('0xb2'),'sendMail',{'account':_0x37afd4,'message':_0x2a56f1[_0x9dcf('0x68')]});})[_0x9dcf('0x12')](function(_0x339dd3){if(!_0x339dd3)return;_0x4ded08=_0x339dd3;if(!_0x234efc[_0x9dcf('0xb3')])throw new Error(_0x9dcf('0xb4'));if(_0x234efc[_0x9dcf('0xb3')][_0x9dcf('0xa6')]['length'])return _0x234efc[_0x9dcf('0xb3')][_0x9dcf('0xa6')][0x0];return db[_0x9dcf('0xa5')][_0x9dcf('0x6f')](_['defaults'](_0x2a56f1[_0x9dcf('0x68')],{'firstName':_0x2a56f1[_0x9dcf('0x68')]['to'],'email':_0x2a56f1['body']['to'],'phone':_0x2a56f1[_0x9dcf('0x68')]['to'],'ListId':_0x234efc['ListId']}));})[_0x9dcf('0x12')](function(_0x588b7d){if(!_0x588b7d)return;var _0x1fe03d={'UserId':_0x2a56f1[_0x9dcf('0x45')]['id'],'ContactId':_0x588b7d['id'],'MailAccountId':_0x234efc['id'],'inReplyTo':_0x4ded08[_0x9dcf('0xb5')],'to':_0x2a56f1[_0x9dcf('0x68')]['from'],'cc':_0x2a56f1['body']['cc'],'subject':_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xb6')],'attach':_0x2a56f1['body'][_0x9dcf('0xb7')],'firstMsgDirection':_0x9dcf('0xb8'),'lastMsgAt':moment()['format'](_0x9dcf('0xa3')),'lastMsgDirection':'out','Messages':[_[_0x9dcf('0x5e')](_0x2a56f1[_0x9dcf('0x68')],{'messageId':_0x4ded08[_0x9dcf('0xb5')],'sentAt':moment()[_0x9dcf('0xa2')](_0x9dcf('0xa3')),'read':!![],'MailAccountId':_0x234efc['id'],'UserId':_0x2a56f1[_0x9dcf('0x45')]['id'],'ContactId':_0x588b7d['id']})]};if(_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xb9')]){_0x1fe03d=_[_0x9dcf('0x5e')](_0x1fe03d,_0x2a56f1['body'][_0x9dcf('0xb9')]);}return db['MailInteraction']['create'](_0x1fe03d,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x9dcf('0x12')](respondWithResult(_0x3684fb,null))[_0x9dcf('0x1d')](handleError(_0x3684fb,null));};exports[_0x9dcf('0xba')]=function(_0x5b5917,_0x37714a){return db['MailAccount'][_0x9dcf('0x67')]({'where':{'id':_0x5b5917[_0x9dcf('0x65')]['id']},'include':[{'model':db[_0x9dcf('0x4a')],'as':_0x9dcf('0x46'),'raw':!![],'include':[{'model':db[_0x9dcf('0xa9')],'as':_0x9dcf('0xa9'),'raw':!![]}]}]})[_0x9dcf('0x12')](handleEntityNotFound(_0x37714a,null))[_0x9dcf('0x12')](function(_0x2b5eba){if(!_0x2b5eba[_0x9dcf('0x46')])return;var _0x309d92=_0x2b5eba[_0x9dcf('0xb1')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x309d92});})['then'](respondWithResult(_0x37714a,null))[_0x9dcf('0x1d')](handleError(_0x37714a,null));};exports[_0x9dcf('0x27')]=function(_0x42a53a,_0x2983df){return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x42a53a[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x2983df,null))[_0x9dcf('0x12')](function(_0x1d38d7){if(_0x1d38d7&&_0x1d38d7[_0x9dcf('0x43')]){throw new db['Sequelize'][(_0x9dcf('0xbb'))](_0x9dcf('0xbc'));}return _0x1d38d7;})['then'](removeEntity(_0x2983df,null))['catch'](handleError(_0x2983df,null));};exports[_0x9dcf('0xbd')]=function(_0x2491e1,_0x1bd716){return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x2491e1[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x1bd716,null))[_0x9dcf('0x12')](function(_0x4bf17a){if(_0x4bf17a){return _0x4bf17a[_0x9dcf('0xbd')](_0x2491e1[_0x9dcf('0x68')][_0x9dcf('0x74')],_[_0x9dcf('0xbe')](_0x2491e1[_0x9dcf('0x68')],[_0x9dcf('0x74'),'id'])||{})[_0x9dcf('0xbf')](function(_0x2802db){for(var _0xc2dec5=0x0;_0xc2dec5<_0x2491e1[_0x9dcf('0x68')]['ids'][_0x9dcf('0x58')];_0xc2dec5+=0x1){socket['emit'](_0x9dcf('0xc0'),{'UserId':Number(_0x2491e1[_0x9dcf('0x68')][_0x9dcf('0x74')][_0xc2dec5]),'MailAccountId':Number(_0x2491e1['params']['id'])});}return _0x2802db;});}})[_0x9dcf('0x12')](respondWithResult(_0x1bd716,null))[_0x9dcf('0x1d')](handleError(_0x1bd716,null));};exports[_0x9dcf('0xc1')]=function(_0x138b2b,_0x1bd6bf){return db['MailAccount'][_0x9dcf('0x67')]({'where':{'id':_0x138b2b[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x1bd6bf,null))['then'](function(_0xe353c9){if(_0xe353c9){return _0xe353c9[_0x9dcf('0xc1')](_0x138b2b[_0x9dcf('0x52')]['ids'])['then'](function(){if(_[_0x9dcf('0xc2')](_0x138b2b['query'][_0x9dcf('0x74')])){for(var _0x281884=0x0;_0x281884<_0x138b2b[_0x9dcf('0x52')][_0x9dcf('0x74')][_0x9dcf('0x58')];_0x281884+=0x1){socket['emit'](_0x9dcf('0xc3'),{'UserId':Number(_0x138b2b[_0x9dcf('0x52')]['ids'][_0x281884]),'MailAccountId':Number(_0x138b2b[_0x9dcf('0x65')]['id'])});}}else{socket[_0x9dcf('0xc4')]('userMailAccount:remove',{'UserId':Number(_0x138b2b[_0x9dcf('0x52')][_0x9dcf('0x74')]),'MailAccountId':Number(_0x138b2b[_0x9dcf('0x65')]['id'])});}});}})[_0x9dcf('0x12')](respondWithStatusCode(_0x1bd6bf,null))[_0x9dcf('0x1d')](handleError(_0x1bd6bf,null));};exports[_0x9dcf('0xc5')]=function(_0x82c22b,_0x487768){var _0x1404ea={};var _0x17e52d={};var _0x6bd583;var _0x2aea01;return db[_0x9dcf('0x61')][_0x9dcf('0x70')]({'where':{'id':_0x82c22b['params']['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x487768,null))[_0x9dcf('0x12')](function(_0x894d8a){if(_0x894d8a){_0x6bd583=_0x894d8a;_0x17e52d['model']=_[_0x9dcf('0x53')](db[_0x9dcf('0xc6')][_0x9dcf('0x66')]);_0x17e52d[_0x9dcf('0x52')]=_[_0x9dcf('0x53')](_0x82c22b[_0x9dcf('0x52')]);_0x17e52d['filters']=_[_0x9dcf('0x55')](_0x17e52d['model'],_0x17e52d[_0x9dcf('0x52')]);_0x1404ea[_0x9dcf('0x56')]=_[_0x9dcf('0x55')](_0x17e52d[_0x9dcf('0x51')],qs['fields'](_0x82c22b[_0x9dcf('0x52')][_0x9dcf('0x57')]));_0x1404ea['attributes']=_0x1404ea['attributes'][_0x9dcf('0x58')]?_0x1404ea['attributes']:_0x17e52d[_0x9dcf('0x51')];_0x1404ea[_0x9dcf('0x71')]=qs[_0x9dcf('0x5a')](_0x82c22b[_0x9dcf('0x52')]['sort']);_0x1404ea[_0x9dcf('0x5b')]=qs['filters'](_['pick'](_0x82c22b[_0x9dcf('0x52')],_0x17e52d['filters']));if(_0x82c22b[_0x9dcf('0x52')][_0x9dcf('0x5d')]){_0x1404ea[_0x9dcf('0x5b')]=_[_0x9dcf('0x5e')](_0x1404ea[_0x9dcf('0x5b')],{'$or':_[_0x9dcf('0x4d')](_0x1404ea['attributes'],function(_0x54d5ba){var _0x46a1a8={};_0x46a1a8[_0x54d5ba]={'$like':'%'+_0x82c22b[_0x9dcf('0x52')][_0x9dcf('0x5d')]+'%'};return _0x46a1a8;})});}_0x1404ea=_[_0x9dcf('0x5e')]({},_0x1404ea,_0x82c22b[_0x9dcf('0x60')]);return _0x6bd583[_0x9dcf('0xc5')](_0x1404ea);}})[_0x9dcf('0x12')](function(_0x5d23b0){if(_0x5d23b0){_0x2aea01=_0x5d23b0[_0x9dcf('0x58')];if(!_0x82c22b[_0x9dcf('0x52')][_0x9dcf('0x59')](_0x9dcf('0x78'))){_0x1404ea[_0x9dcf('0x23')]=qs[_0x9dcf('0x23')](_0x82c22b['query'][_0x9dcf('0x23')]);_0x1404ea[_0x9dcf('0x21')]=qs['offset'](_0x82c22b[_0x9dcf('0x52')]['offset']);}return _0x6bd583['getAgents'](_0x1404ea);}})[_0x9dcf('0x12')](function(_0xbad0a2){if(_0xbad0a2){return _0xbad0a2?{'count':_0x2aea01,'rows':_0xbad0a2}:null;}})[_0x9dcf('0x12')](respondWithResult(_0x487768,null))[_0x9dcf('0x1d')](handleError(_0x487768,null));}; \ No newline at end of file +var _0x40cd=['rows','show','params','keys','rawAttributes','length','find','body','provider','Mail\x20Account\x20not\x20found','update','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','filter','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','custom','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','order','CmContact','Contact','User','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','server/files/attachments','sendMail','List\x20not\x20found','List','Contacts','defaults','messageId','subject','attach','out','Interaction','verifySmtp','VerifySmtp','service','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','isArray','userMailAccount:remove','moment','bluebird','util','juice','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','register','client','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','status','json','offset','undefined','count','set','destroy','get','MailAccounts','UserProfileResource','name','send','gmail','yahoo','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','host','port','secure','authentication','pass','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x56fd29,_0x17790b){var _0x2a0bf7=function(_0x568f20){while(--_0x568f20){_0x56fd29['push'](_0x56fd29['shift']());}};_0x2a0bf7(++_0x17790b);}(_0x40cd,0x64));var _0xd40c=function(_0x2d4747,_0x2a39a7){_0x2d4747=_0x2d4747-0x0;var _0x2f0f63=_0x40cd[_0x2d4747];return _0x2f0f63;};'use strict';var moment=require(_0xd40c('0x0'));var BPromise=require(_0xd40c('0x1'));var util=require(_0xd40c('0x2'));var path=require('path');var _=require('lodash');var juice=require(_0xd40c('0x3'));var Redis=require('ioredis');var qs=require(_0xd40c('0x4'));var logger=require(_0xd40c('0x5'))(_0xd40c('0x6'));var config=require('../../config/environment');var db=require(_0xd40c('0x7'))['db'];config['redis']=_['defaults'](config[_0xd40c('0x8')],{'host':_0xd40c('0x9'),'port':0x18eb});var socket=require(_0xd40c('0xa'))(new Redis(config['redis']));require('./mailAccount.socket')[_0xd40c('0xb')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd40c('0xc')]['http']({'port':0x232b});function respondWithRpcPromise(_0x4e7f98,_0x18536b,_0x201fac,_0x4b4aab){return new BPromise(function(_0x53f685,_0x152235){var _0x38b6e9=_0x4b4aab||client;return _0x38b6e9[_0xd40c('0xd')](_0x4e7f98,_0x201fac)[_0xd40c('0xe')](function(_0x468cbf){logger[_0xd40c('0xf')](_0xd40c('0x10'),_0x18536b,_0xd40c('0x11'));logger[_0xd40c('0x12')](_0xd40c('0x13'),_0x18536b,_0xd40c('0x11'),JSON[_0xd40c('0x14')](_0x468cbf));if(_0x468cbf['error']){if(_0x468cbf[_0xd40c('0x15')][_0xd40c('0x16')]===0x1f4){logger[_0xd40c('0x15')]('MailAccount,\x20%s,\x20%s',_0x18536b,_0x468cbf[_0xd40c('0x15')]['message']);return _0x152235(_0x468cbf[_0xd40c('0x15')]['message']);}logger[_0xd40c('0x15')](_0xd40c('0x10'),_0x18536b,_0x468cbf[_0xd40c('0x15')]['message']);return _0x53f685(_0x468cbf[_0xd40c('0x15')][_0xd40c('0x17')]);}else{logger[_0xd40c('0xf')]('MailAccount,\x20%s,\x20%s',_0x18536b,'request\x20sent');_0x53f685(_0x468cbf[_0xd40c('0x18')][_0xd40c('0x17')]);}})[_0xd40c('0x19')](function(_0x5e4bd6){logger['error'](_0xd40c('0x10'),_0x18536b,_0x5e4bd6);_0x152235(_0x5e4bd6);});});}function respondWithStatusCode(_0x2c510f,_0x10e36f){_0x10e36f=_0x10e36f||0xcc;return function(_0x2d5494){if(_0x2d5494){return _0x2c510f[_0xd40c('0x1a')](_0x10e36f);}return _0x2c510f[_0xd40c('0x1b')](_0x10e36f)['end']();};}function respondWithResult(_0x3c04d8,_0x3fd7f0){_0x3fd7f0=_0x3fd7f0||0xc8;return function(_0x100023){if(_0x100023){return _0x3c04d8[_0xd40c('0x1b')](_0x3fd7f0)[_0xd40c('0x1c')](_0x100023);}};}function respondWithFilteredResult(_0x124982,_0xef1459){return function(_0x4d4f44){if(_0x4d4f44){var _0x60b52d=typeof _0xef1459[_0xd40c('0x1d')]===_0xd40c('0x1e')&&typeof _0xef1459['limit']===_0xd40c('0x1e');var _0x86a30e=_0x4d4f44[_0xd40c('0x1f')];var _0x1c321e=_0x60b52d?0x0:_0xef1459[_0xd40c('0x1d')];var _0x22089f=_0x60b52d?_0x4d4f44[_0xd40c('0x1f')]:_0xef1459['offset']+_0xef1459['limit'];var _0x32f63c;if(_0x22089f>=_0x86a30e){_0x22089f=_0x86a30e;_0x32f63c=0xc8;}else{_0x32f63c=0xce;}_0x124982[_0xd40c('0x1b')](_0x32f63c);return _0x124982[_0xd40c('0x20')]('Content-Range',_0x1c321e+'-'+_0x22089f+'/'+_0x86a30e)['json'](_0x4d4f44);}return null;};}function saveUpdates(_0x5523fc){return function(_0xb24bc8){if(_0xb24bc8){return _0xb24bc8['update'](_0x5523fc)[_0xd40c('0xe')](function(_0x4155c5){return _0x4155c5;});}return null;};}function removeEntity(_0x1e4923){return function(_0x1fd7a9){if(_0x1fd7a9){return _0x1fd7a9[_0xd40c('0x21')]()[_0xd40c('0xe')](function(){var _0x3e0b08=_0x1fd7a9[_0xd40c('0x22')]({'plain':!![]});var _0x21e4a3=_0xd40c('0x23');return db[_0xd40c('0x24')][_0xd40c('0x21')]({'where':{'type':_0x21e4a3,'resourceId':_0x3e0b08['id']}})[_0xd40c('0xe')](function(){return _0x1fd7a9;});})[_0xd40c('0xe')](function(){_0x1e4923['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c3a26){return function(_0x4bd76c){if(!_0x4bd76c){_0x2c3a26['sendStatus'](0x194);}return _0x4bd76c;};}function handleError(_0x5c47b6,_0x3ca1b6){_0x3ca1b6=_0x3ca1b6||0x1f4;return function(_0x3ba64e){logger['error'](_0x3ba64e['stack']);if(_0x3ba64e[_0xd40c('0x25')]){delete _0x3ba64e[_0xd40c('0x25')];}_0x5c47b6[_0xd40c('0x1b')](_0x3ca1b6)[_0xd40c('0x26')](_0x3ba64e);};}function getImapHost(_0x1b3316){switch(_0x1b3316){case _0xd40c('0x27'):return'imap.gmail.com';case _0xd40c('0x28'):return'imap.mail.yahoo.com';case _0xd40c('0x29'):return'imap-mail.outlook.com';case _0xd40c('0x2a'):return _0xd40c('0x2b');}throw new Error(_0xd40c('0x2c'),_0x1b3316);}function getSmtpHost(_0x47d44c){switch(_0x47d44c){case _0xd40c('0x27'):return'smtp.gmail.com';case _0xd40c('0x28'):return _0xd40c('0x2d');case _0xd40c('0x29'):return _0xd40c('0x2e');case'outlook365':return _0xd40c('0x2f');}throw new Error(_0xd40c('0x2c'),_0x47d44c);}function getAuthenticationOptions(_0x296e83,_0x221839){var _0x27dfe8={};var _0x3570c9={};if(_0x296e83){_0x27dfe8[_0xd40c('0x30')]=_0x3570c9[_0xd40c('0x30')]=_0x221839[_0xd40c('0x31')];_0x27dfe8[_0xd40c('0x32')]=_0x3570c9['pass']=_0x221839[_0xd40c('0x32')];if(_0x221839[_0xd40c('0x33')]){_0x27dfe8[_0xd40c('0x33')]=_0x3570c9['modernAuthentication']=!![];_0x27dfe8[_0xd40c('0x34')]=_0x3570c9[_0xd40c('0x34')]=_0x221839['CloudProviderId'];_0x27dfe8['password']=_0x3570c9['pass']=null;}else{_0x27dfe8['CloudProviderId']=_0x3570c9['CloudProviderId']=null;}_0x27dfe8[_0xd40c('0x35')]=getImapHost(_0x296e83);_0x27dfe8[_0xd40c('0x36')]=0x3e1;_0x3570c9[_0xd40c('0x35')]=getSmtpHost(_0x296e83);_0x3570c9[_0xd40c('0x36')]=0x24b;_0x3570c9[_0xd40c('0x37')]=![];_0x27dfe8['service']=_0x3570c9['service']=null;}else{if(_0x221839[_0xd40c('0x38')]){_0x27dfe8[_0xd40c('0x30')]=_0x3570c9[_0xd40c('0x30')]=_0x221839[_0xd40c('0x31')];_0x27dfe8[_0xd40c('0x32')]=_0x3570c9[_0xd40c('0x39')]=_0x221839[_0xd40c('0x32')];}else{_0x27dfe8['authentication']=_0x3570c9['authentication']=![];_0x27dfe8[_0xd40c('0x30')]=_0x3570c9['user']=null;_0x27dfe8['password']=_0x3570c9[_0xd40c('0x39')]=null;}_0x27dfe8[_0xd40c('0x35')]=_0x221839[_0xd40c('0x3a')][_0xd40c('0x35')];_0x27dfe8[_0xd40c('0x36')]=_0x221839[_0xd40c('0x3a')][_0xd40c('0x36')];_0x3570c9['host']=_0x221839['Smtp'][_0xd40c('0x35')];_0x3570c9[_0xd40c('0x36')]=_0x221839[_0xd40c('0x3b')]['port'];}return{'Imap':_0x27dfe8,'Smtp':_0x3570c9};}exports[_0xd40c('0x3c')]=function(_0x5de1e2,_0x33a191){var _0x483606={'include':[{'model':db[_0xd40c('0x3d')],'as':_0xd40c('0x3a')},{'model':db[_0xd40c('0x3e')],'as':'Smtp'},{'model':db[_0xd40c('0x3f')],'as':_0xd40c('0x40')}]},_0x572add={},_0x3fe6f4={'count':0x0,'rows':[]};var _0x4065fd=_[_0xd40c('0x41')](db[_0xd40c('0x42')]['rawAttributes'],function(_0x8df080){return{'name':_0x8df080[_0xd40c('0x43')],'type':_0x8df080[_0xd40c('0x44')][_0xd40c('0x45')]};});_0x572add[_0xd40c('0x46')]=_[_0xd40c('0x41')](_0x4065fd,_0xd40c('0x25'));_0x572add[_0xd40c('0x47')]=_['keys'](_0x5de1e2[_0xd40c('0x47')]);_0x572add[_0xd40c('0x48')]=_[_0xd40c('0x49')](_0x572add[_0xd40c('0x46')],_0x572add[_0xd40c('0x47')]);_0x483606[_0xd40c('0x4a')]=_['intersection'](_0x572add[_0xd40c('0x46')],qs[_0xd40c('0x4b')](_0x5de1e2[_0xd40c('0x47')][_0xd40c('0x4b')]));_0x483606[_0xd40c('0x4a')]=_0x483606[_0xd40c('0x4a')]['length']?_0x483606[_0xd40c('0x4a')]:_0x572add[_0xd40c('0x46')];if(!_0x5de1e2[_0xd40c('0x47')][_0xd40c('0x4c')](_0xd40c('0x4d'))){_0x483606[_0xd40c('0x4e')]=qs[_0xd40c('0x4e')](_0x5de1e2[_0xd40c('0x47')][_0xd40c('0x4e')]);_0x483606['offset']=qs['offset'](_0x5de1e2[_0xd40c('0x47')][_0xd40c('0x1d')]);}_0x483606['order']=qs[_0xd40c('0x4f')](_0x5de1e2['query']['sort']);_0x483606[_0xd40c('0x50')]=qs['filters'](_[_0xd40c('0x51')](_0x5de1e2[_0xd40c('0x47')],_0x572add[_0xd40c('0x48')]),_0x4065fd);if(_0x5de1e2[_0xd40c('0x47')]['filter']){_0x483606[_0xd40c('0x50')]=_[_0xd40c('0x52')](_0x483606[_0xd40c('0x50')],{'$or':_['map'](_0x4065fd,function(_0xd4abe3){if(_0xd4abe3[_0xd40c('0x44')]!==_0xd40c('0x53')){var _0x1a137f={};_0x1a137f[_0xd4abe3['name']]={'$like':'%'+_0x5de1e2[_0xd40c('0x47')]['filter']+'%'};return _0x1a137f;}})});}_0x483606=_['merge']({},_0x483606,_0x5de1e2[_0xd40c('0x54')]);var _0x5845d6={'where':_0x483606[_0xd40c('0x50')]};return db['MailAccount'][_0xd40c('0x1f')](_0x5845d6)[_0xd40c('0xe')](function(_0x316f7d){_0x3fe6f4[_0xd40c('0x1f')]=_0x316f7d;if(_0x5de1e2[_0xd40c('0x47')][_0xd40c('0x55')]){_0x483606[_0xd40c('0x56')]=[{'all':!![]}];}return db[_0xd40c('0x42')][_0xd40c('0x57')](_0x483606);})[_0xd40c('0xe')](function(_0xfff399){_0x3fe6f4[_0xd40c('0x58')]=_0xfff399;return _0x3fe6f4;})[_0xd40c('0xe')](respondWithFilteredResult(_0x33a191,_0x483606))[_0xd40c('0x19')](handleError(_0x33a191,null));};exports[_0xd40c('0x59')]=function(_0x41b6be,_0x2b04e0){var _0x4462b5={'raw':![],'where':{'id':_0x41b6be[_0xd40c('0x5a')]['id']},'include':[{'model':db[_0xd40c('0x3d')],'as':_0xd40c('0x3a')},{'model':db['MailServerOut'],'as':_0xd40c('0x3b')},{'model':db[_0xd40c('0x3f')],'as':_0xd40c('0x40')}]},_0x550838={};_0x550838[_0xd40c('0x46')]=_[_0xd40c('0x5b')](db[_0xd40c('0x42')][_0xd40c('0x5c')]);_0x550838[_0xd40c('0x47')]=_[_0xd40c('0x5b')](_0x41b6be[_0xd40c('0x47')]);_0x550838[_0xd40c('0x48')]=_[_0xd40c('0x49')](_0x550838[_0xd40c('0x46')],_0x550838['query']);_0x4462b5[_0xd40c('0x4a')]=_[_0xd40c('0x49')](_0x550838[_0xd40c('0x46')],qs[_0xd40c('0x4b')](_0x41b6be[_0xd40c('0x47')][_0xd40c('0x4b')]));_0x4462b5[_0xd40c('0x4a')]=_0x4462b5[_0xd40c('0x4a')][_0xd40c('0x5d')]?_0x4462b5[_0xd40c('0x4a')]:_0x550838[_0xd40c('0x46')];if(_0x41b6be[_0xd40c('0x47')]['includeAll']){_0x4462b5['include']=[{'all':!![]}];}_0x4462b5=_[_0xd40c('0x52')]({},_0x4462b5,_0x41b6be[_0xd40c('0x54')]);return db[_0xd40c('0x42')][_0xd40c('0x5e')](_0x4462b5)[_0xd40c('0xe')](handleEntityNotFound(_0x2b04e0,null))[_0xd40c('0xe')](respondWithResult(_0x2b04e0,null))[_0xd40c('0x19')](handleError(_0x2b04e0,null));};exports['update']=function(_0xef2dfb,_0x1f9ed8){if(_0xef2dfb[_0xd40c('0x5f')]['id']){delete _0xef2dfb[_0xd40c('0x5f')]['id'];}var _0x18016a=_0xef2dfb['body'][_0xd40c('0x60')]==='custom'?null:_0xef2dfb[_0xd40c('0x5f')][_0xd40c('0x60')];var _0x190cce=_0xef2dfb[_0xd40c('0x5f')][_0xd40c('0x3a')]||{};var _0x2c8595=_0xef2dfb[_0xd40c('0x5f')][_0xd40c('0x3b')]||{};if(_0x18016a){_0x190cce[_0xd40c('0x35')]=getImapHost(_0x18016a);_0x190cce[_0xd40c('0x36')]=0x3e1;_0x2c8595[_0xd40c('0x35')]=getSmtpHost(_0x18016a);_0x2c8595[_0xd40c('0x36')]=0x24b;_0x2c8595[_0xd40c('0x37')]=![];}if(_0x2c8595[_0xd40c('0x33')]){_0x2c8595[_0xd40c('0x37')]=![];}else{_0x2c8595[_0xd40c('0x34')]=null;}if(!_0x190cce['modernAuthentication'])_0x190cce[_0xd40c('0x34')]=null;_0xef2dfb[_0xd40c('0x5f')]['Imap']=_0x190cce;_0xef2dfb[_0xd40c('0x5f')][_0xd40c('0x3b')]=_0x2c8595;return db[_0xd40c('0x42')]['find']({'where':{'id':_0xef2dfb[_0xd40c('0x5a')]['id']},'include':[{'model':db[_0xd40c('0x3d')],'as':'Imap'},{'model':db[_0xd40c('0x3e')],'as':'Smtp'},{'model':db[_0xd40c('0x3f')],'as':_0xd40c('0x40')}]})['then'](handleEntityNotFound(_0x1f9ed8,null))[_0xd40c('0xe')](function(_0x174025){if(!_0x174025)throw new Error(_0xd40c('0x61'));if(_0x174025['service'])delete _0xef2dfb[_0xd40c('0x5f')][_0xd40c('0x3a')];return _0x174025;})[_0xd40c('0xe')](saveUpdates(_0xef2dfb[_0xd40c('0x5f')],null))[_0xd40c('0xe')](function(_0x1ec9a7){if(!_0xef2dfb[_0xd40c('0x5f')]['Imap'])return _0x1ec9a7;return db[_0xd40c('0x3d')]['update'](_0xef2dfb['body'][_0xd40c('0x3a')],{'where':{'MailAccountId':_0x1ec9a7['id']}})['then'](function(){return _0x1ec9a7;});})[_0xd40c('0xe')](function(_0xdb8039){if(!_0xef2dfb[_0xd40c('0x5f')]['Smtp'])return _0xdb8039;return db[_0xd40c('0x3e')][_0xd40c('0x62')](_0xef2dfb[_0xd40c('0x5f')][_0xd40c('0x3b')],{'where':{'MailAccountId':_0xdb8039['id']}})[_0xd40c('0xe')](function(){return _0xdb8039;});})[_0xd40c('0xe')](respondWithResult(_0x1f9ed8,null))[_0xd40c('0x19')](handleError(_0x1f9ed8,null));};exports['describe']=function(_0x1953da,_0x5c9365){return db[_0xd40c('0x42')][_0xd40c('0x63')]()[_0xd40c('0xe')](respondWithResult(_0x5c9365,null))[_0xd40c('0x19')](handleError(_0x5c9365,null));};exports[_0xd40c('0x64')]=function(_0x19e18a,_0xe925ae){if(_0x19e18a[_0xd40c('0x5f')]['id']){delete _0x19e18a[_0xd40c('0x5f')]['id'];}return db[_0xd40c('0x42')][_0xd40c('0x5e')]({'where':{'id':_0x19e18a[_0xd40c('0x5a')]['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0xe925ae,null))[_0xd40c('0xe')](function(_0x197e46){if(_0x197e46){_0x19e18a[_0xd40c('0x5f')][_0xd40c('0x65')]=_0x197e46['id'];return db[_0xd40c('0x66')][_0xd40c('0x67')](_0x19e18a[_0xd40c('0x5f')]);}})[_0xd40c('0xe')](respondWithResult(_0xe925ae,null))[_0xd40c('0x19')](handleError(_0xe925ae,null));};exports[_0xd40c('0x68')]=function(_0xc88002,_0x4abcd6){var _0x5aa78b={'raw':![],'where':{}};var _0x43dc47={};var _0x89ccda={'count':0x0,'rows':[]};return db[_0xd40c('0x42')][_0xd40c('0x69')]({'where':{'id':_0xc88002[_0xd40c('0x5a')]['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0x4abcd6,null))[_0xd40c('0xe')](function(_0x5e9422){if(_0x5e9422){_0x43dc47[_0xd40c('0x46')]=_[_0xd40c('0x5b')](db[_0xd40c('0x66')]['rawAttributes']);_0x43dc47[_0xd40c('0x47')]=_[_0xd40c('0x5b')](_0xc88002[_0xd40c('0x47')]);_0x43dc47['filters']=_[_0xd40c('0x49')](_0x43dc47[_0xd40c('0x46')],_0x43dc47[_0xd40c('0x47')]);_0x5aa78b[_0xd40c('0x4a')]=_['intersection'](_0x43dc47[_0xd40c('0x46')],qs[_0xd40c('0x4b')](_0xc88002[_0xd40c('0x47')][_0xd40c('0x4b')]));_0x5aa78b['attributes']=_0x5aa78b[_0xd40c('0x4a')][_0xd40c('0x5d')]?_0x5aa78b[_0xd40c('0x4a')]:_0x43dc47[_0xd40c('0x46')];if(!_0xc88002[_0xd40c('0x47')][_0xd40c('0x4c')]('nolimit')){_0x5aa78b[_0xd40c('0x4e')]=qs['limit'](_0xc88002[_0xd40c('0x47')][_0xd40c('0x4e')]);_0x5aa78b[_0xd40c('0x1d')]=qs[_0xd40c('0x1d')](_0xc88002[_0xd40c('0x47')][_0xd40c('0x1d')]);}_0x5aa78b['order']=qs[_0xd40c('0x4f')](_0xc88002[_0xd40c('0x47')][_0xd40c('0x4f')]);_0x5aa78b[_0xd40c('0x50')]=qs[_0xd40c('0x48')](_[_0xd40c('0x51')](_0xc88002[_0xd40c('0x47')],_0x43dc47[_0xd40c('0x48')]));_0x5aa78b['where'][_0xd40c('0x65')]=_0x5e9422['id'];if(_0xc88002[_0xd40c('0x47')]['filter']){_0x5aa78b[_0xd40c('0x50')]=_[_0xd40c('0x52')](_0x5aa78b[_0xd40c('0x50')],{'$or':_[_0xd40c('0x41')](_0x5aa78b[_0xd40c('0x4a')],function(_0x289403){var _0x117c6f={};_0x117c6f[_0x289403]={'$like':'%'+_0xc88002[_0xd40c('0x47')][_0xd40c('0x6a')]+'%'};return _0x117c6f;})});}_0x5aa78b=_[_0xd40c('0x52')]({},_0x5aa78b,_0xc88002[_0xd40c('0x54')]);return db[_0xd40c('0x66')][_0xd40c('0x1f')]({'where':_0x5aa78b[_0xd40c('0x50')]})[_0xd40c('0xe')](function(_0x4aca13){_0x89ccda['count']=_0x4aca13;if(_0xc88002['query']['includeAll']){_0x5aa78b[_0xd40c('0x56')]=[{'all':!![]}];}return db[_0xd40c('0x66')][_0xd40c('0x57')](_0x5aa78b);})[_0xd40c('0xe')](function(_0x5e780b){_0x89ccda[_0xd40c('0x58')]=_0x5e780b;return _0x89ccda;});}})['then'](respondWithFilteredResult(_0x4abcd6,_0x5aa78b))['catch'](handleError(_0x4abcd6,null));};exports[_0xd40c('0x6b')]=function(_0x358e15,_0x2f8023){return db[_0xd40c('0x42')]['find']({'where':{'id':_0x358e15[_0xd40c('0x5a')]['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0x2f8023,null))[_0xd40c('0xe')](function(_0x39e073){if(_0x39e073){return _0x39e073['removeDispositions'](_0x358e15[_0xd40c('0x47')][_0xd40c('0x6c')]);}})[_0xd40c('0xe')](respondWithStatusCode(_0x2f8023,null))[_0xd40c('0x19')](handleError(_0x2f8023,null));};exports[_0xd40c('0x6d')]=function(_0x1741ff,_0x3a10b4){if(_0x1741ff[_0xd40c('0x5f')]['id']){delete _0x1741ff[_0xd40c('0x5f')]['id'];}return db[_0xd40c('0x42')]['find']({'where':{'id':_0x1741ff[_0xd40c('0x5a')]['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0x3a10b4,null))[_0xd40c('0xe')](function(_0x3824f7){if(_0x3824f7){_0x1741ff[_0xd40c('0x5f')][_0xd40c('0x65')]=_0x3824f7['id'];return db['CannedAnswer'][_0xd40c('0x67')](_0x1741ff[_0xd40c('0x5f')]);}})[_0xd40c('0xe')](respondWithResult(_0x3a10b4,null))[_0xd40c('0x19')](handleError(_0x3a10b4,null));};exports[_0xd40c('0x6e')]=function(_0x3db287,_0x31c327){var _0x3b7fcc={'raw':![],'where':{}};var _0x4c43b2={};var _0x3c08ab={'count':0x0,'rows':[]};return db[_0xd40c('0x42')][_0xd40c('0x69')]({'where':{'id':_0x3db287[_0xd40c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x31c327,null))['then'](function(_0xfedca){if(_0xfedca){_0x4c43b2[_0xd40c('0x46')]=_[_0xd40c('0x5b')](db[_0xd40c('0x6f')][_0xd40c('0x5c')]);_0x4c43b2['query']=_[_0xd40c('0x5b')](_0x3db287[_0xd40c('0x47')]);_0x4c43b2['filters']=_[_0xd40c('0x49')](_0x4c43b2['model'],_0x4c43b2[_0xd40c('0x47')]);_0x3b7fcc['attributes']=_[_0xd40c('0x49')](_0x4c43b2['model'],qs['fields'](_0x3db287[_0xd40c('0x47')][_0xd40c('0x4b')]));_0x3b7fcc['attributes']=_0x3b7fcc[_0xd40c('0x4a')][_0xd40c('0x5d')]?_0x3b7fcc[_0xd40c('0x4a')]:_0x4c43b2[_0xd40c('0x46')];if(!_0x3db287[_0xd40c('0x47')][_0xd40c('0x4c')](_0xd40c('0x4d'))){_0x3b7fcc[_0xd40c('0x4e')]=qs[_0xd40c('0x4e')](_0x3db287[_0xd40c('0x47')][_0xd40c('0x4e')]);_0x3b7fcc[_0xd40c('0x1d')]=qs[_0xd40c('0x1d')](_0x3db287['query'][_0xd40c('0x1d')]);}_0x3b7fcc['order']=qs[_0xd40c('0x4f')](_0x3db287[_0xd40c('0x47')][_0xd40c('0x4f')]);_0x3b7fcc[_0xd40c('0x50')]=qs[_0xd40c('0x48')](_[_0xd40c('0x51')](_0x3db287[_0xd40c('0x47')],_0x4c43b2[_0xd40c('0x48')]));_0x3b7fcc[_0xd40c('0x50')]['MailAccountId']=_0xfedca['id'];if(_0x3db287['query'][_0xd40c('0x6a')]){_0x3b7fcc['where']=_[_0xd40c('0x52')](_0x3b7fcc['where'],{'$or':_['map'](_0x3b7fcc[_0xd40c('0x4a')],function(_0x4a1300){var _0x2752b5={};_0x2752b5[_0x4a1300]={'$like':'%'+_0x3db287[_0xd40c('0x47')][_0xd40c('0x6a')]+'%'};return _0x2752b5;})});}_0x3b7fcc=_[_0xd40c('0x52')]({},_0x3b7fcc,_0x3db287[_0xd40c('0x54')]);return db['CannedAnswer'][_0xd40c('0x1f')]({'where':_0x3b7fcc[_0xd40c('0x50')]})[_0xd40c('0xe')](function(_0x2660eb){_0x3c08ab[_0xd40c('0x1f')]=_0x2660eb;if(_0x3db287[_0xd40c('0x47')][_0xd40c('0x55')]){_0x3b7fcc[_0xd40c('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd40c('0x57')](_0x3b7fcc);})['then'](function(_0x2059fd){_0x3c08ab['rows']=_0x2059fd;return _0x3c08ab;});}})['then'](respondWithFilteredResult(_0x31c327,_0x3b7fcc))['catch'](handleError(_0x31c327,null));};exports[_0xd40c('0x70')]=function(_0x10275c,_0x1bc76d){return db[_0xd40c('0x42')][_0xd40c('0x5e')]({'where':{'id':_0x10275c['params']['id']}})['then'](handleEntityNotFound(_0x1bc76d,null))[_0xd40c('0xe')](function(_0x2110e4){if(_0x2110e4){return _0x2110e4[_0xd40c('0x70')](_0x10275c['query']['ids']);}})['then'](respondWithStatusCode(_0x1bc76d,null))['catch'](handleError(_0x1bc76d,null));};exports['create']=function(_0x4a873b,_0x531c12){var _0x2a99ed={'name':_0x4a873b[_0xd40c('0x5f')][_0xd40c('0x25')],'key':_0x4a873b[_0xd40c('0x5f')][_0xd40c('0x45')],'provider':_0x4a873b['body']['provider']===_0xd40c('0x71')?null:_0x4a873b[_0xd40c('0x5f')][_0xd40c('0x60')],'email':_0x4a873b[_0xd40c('0x5f')][_0xd40c('0x72')],'ListId':_0x4a873b['body'][_0xd40c('0x73')],'active':!_[_0xd40c('0x74')](_0x4a873b[_0xd40c('0x5f')]['active'])?_0x4a873b['body'][_0xd40c('0x75')]:!![],'description':_0x4a873b['body'][_0xd40c('0x76')]||null};var _0x2c7009=getAuthenticationOptions(_0x2a99ed['provider'],_0x4a873b[_0xd40c('0x5f')]);_0x2a99ed[_0xd40c('0x3a')]=_0x2c7009[_0xd40c('0x3a')];_0x2a99ed[_0xd40c('0x3b')]=_0x2c7009[_0xd40c('0x3b')];return db['MailAccount'][_0xd40c('0x67')](_0x2a99ed,{'include':[{'model':db['MailServerOut'],'as':_0xd40c('0x3b')},{'model':db[_0xd40c('0x3d')],'as':'Imap'}]})[_0xd40c('0xe')](function(_0x58bb0a){var _0x213723=_0x4a873b[_0xd40c('0x30')]['get']({'plain':!![]});if(!_0x213723)throw new Error(_0xd40c('0x77'));if(_0x213723[_0xd40c('0x78')]===_0xd40c('0x30')){var _0x41df87=_0x58bb0a[_0xd40c('0x22')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xd40c('0x23'),'userProfileId':_0x213723['userProfileId']},'raw':!![]})[_0xd40c('0xe')](function(_0x1c9389){if(_0x1c9389&&_0x1c9389[_0xd40c('0x79')]===0x0){return db[_0xd40c('0x24')][_0xd40c('0x67')]({'name':_0x41df87[_0xd40c('0x25')],'resourceId':_0x41df87['id'],'type':_0x1c9389['name'],'sectionId':_0x1c9389['id']},{})[_0xd40c('0xe')](function(){return _0x58bb0a;});}else{return _0x58bb0a;}})[_0xd40c('0x19')](function(_0x5ed8e3){logger[_0xd40c('0x15')](_0xd40c('0x7a'),_0x5ed8e3);throw _0x5ed8e3;});}return _0x58bb0a;})[_0xd40c('0xe')](respondWithResult(_0x531c12,0xc9))[_0xd40c('0x19')](handleError(_0x531c12,null));};exports[_0xd40c('0x7b')]=function(_0x37dafc,_0xa5d3c2){return db[_0xd40c('0x42')][_0xd40c('0x69')]({'where':{'id':_0x37dafc['params']['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0xa5d3c2,null))['then'](function(_0x59f944){if(_0x59f944){return _0x59f944['getImap']();}return null;})[_0xd40c('0xe')](respondWithResult(_0xa5d3c2,null))[_0xd40c('0x19')](handleError(_0xa5d3c2,null));};exports[_0xd40c('0x7c')]=function(_0x1b55bb,_0x5bbb18){if(_0x1b55bb[_0xd40c('0x5f')]['id']){delete _0x1b55bb[_0xd40c('0x5f')]['id'];}return db[_0xd40c('0x42')]['find']({'where':{'id':_0x1b55bb[_0xd40c('0x5a')]['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0x5bbb18,null))[_0xd40c('0xe')](function(_0x3ab772){if(_0x3ab772){_0x1b55bb[_0xd40c('0x5f')]['MailAccountId']=_0x3ab772['id'];return db['MailServerIn'][_0xd40c('0x67')](_0x1b55bb[_0xd40c('0x5f')]);}})[_0xd40c('0xe')](respondWithResult(_0x5bbb18,null))[_0xd40c('0x19')](handleError(_0x5bbb18,null));};exports['removeImap']=function(_0x1ea1f8,_0x59bb42){return db[_0xd40c('0x42')][_0xd40c('0x69')]({'where':{'id':_0x1ea1f8[_0xd40c('0x5a')]['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0x59bb42,null))[_0xd40c('0xe')](function(_0x1d1d08){if(_0x1d1d08){return _0x1d1d08[_0xd40c('0x7d')](null);}return null;})[_0xd40c('0xe')](respondWithStatusCode(_0x59bb42,null))[_0xd40c('0x19')](handleError(_0x59bb42,null));};exports['getSmtp']=function(_0xc6abd3,_0x2042c6){return db[_0xd40c('0x42')][_0xd40c('0x69')]({'where':{'id':_0xc6abd3[_0xd40c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2042c6,null))[_0xd40c('0xe')](function(_0x544402){if(_0x544402){return _0x544402[_0xd40c('0x7e')]();}return null;})[_0xd40c('0xe')](respondWithResult(_0x2042c6,null))['catch'](handleError(_0x2042c6,null));};exports[_0xd40c('0x7f')]=function(_0x883c60,_0x2e7288){if(_0x883c60['body']['id']){delete _0x883c60[_0xd40c('0x5f')]['id'];}return db[_0xd40c('0x42')][_0xd40c('0x5e')]({'where':{'id':_0x883c60[_0xd40c('0x5a')]['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0x2e7288,null))['then'](function(_0x52810d){if(_0x52810d){_0x883c60[_0xd40c('0x5f')][_0xd40c('0x65')]=_0x52810d['id'];return db[_0xd40c('0x3e')][_0xd40c('0x67')](_0x883c60[_0xd40c('0x5f')]);}})[_0xd40c('0xe')](respondWithResult(_0x2e7288,null))[_0xd40c('0x19')](handleError(_0x2e7288,null));};exports[_0xd40c('0x80')]=function(_0x15ad05,_0x37c351){return db[_0xd40c('0x42')][_0xd40c('0x69')]({'where':{'id':_0x15ad05['params']['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0x37c351,null))[_0xd40c('0xe')](function(_0x5e43cb){if(_0x5e43cb){return _0x5e43cb['setSmtp'](null);}return null;})[_0xd40c('0xe')](respondWithStatusCode(_0x37c351,null))['catch'](handleError(_0x37c351,null));};exports[_0xd40c('0x81')]=function(_0x27cec8,_0xf184e4){return db[_0xd40c('0x82')][_0xd40c('0x5e')]({'where':{'id':_0x27cec8[_0xd40c('0x5a')]['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0xf184e4,null))[_0xd40c('0xe')](function(_0x445528){if(_0x445528){return _0x445528['addInteraction'](_0x27cec8['body'][_0xd40c('0x6c')],_[_0xd40c('0x83')](_0x27cec8[_0xd40c('0x5f')],[_0xd40c('0x6c'),'id'])||{});}})[_0xd40c('0xe')](respondWithResult(_0xf184e4,null))[_0xd40c('0x19')](handleError(_0xf184e4,null));};exports[_0xd40c('0x84')]=function(_0x2c8a49,_0x55b3f0){var _0x35d8dc={'raw':![],'where':{}};var _0x5100d7={};var _0x2f5f3d={'count':0x0,'rows':[]};return db[_0xd40c('0x42')]['findOne']({'where':{'id':_0x2c8a49[_0xd40c('0x5a')]['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0x55b3f0,null))[_0xd40c('0xe')](function(_0x43e99a){if(_0x43e99a){_0x5100d7['model']=_['keys'](db[_0xd40c('0x82')][_0xd40c('0x5c')]);_0x5100d7[_0xd40c('0x47')]=_[_0xd40c('0x5b')](_0x2c8a49['query']);_0x5100d7[_0xd40c('0x48')]=_[_0xd40c('0x49')](_0x5100d7['model'],_0x5100d7[_0xd40c('0x47')]);_0x35d8dc[_0xd40c('0x4a')]=_['intersection'](_0x5100d7[_0xd40c('0x46')],qs[_0xd40c('0x4b')](_0x2c8a49[_0xd40c('0x47')]['fields']));_0x35d8dc[_0xd40c('0x4a')]=_0x35d8dc['attributes'][_0xd40c('0x5d')]?_0x35d8dc['attributes']:_0x5100d7[_0xd40c('0x46')];if(!_0x2c8a49[_0xd40c('0x47')]['hasOwnProperty'](_0xd40c('0x4d'))){_0x35d8dc[_0xd40c('0x4e')]=qs[_0xd40c('0x4e')](_0x2c8a49[_0xd40c('0x47')][_0xd40c('0x4e')]);_0x35d8dc[_0xd40c('0x1d')]=qs[_0xd40c('0x1d')](_0x2c8a49[_0xd40c('0x47')][_0xd40c('0x1d')]);}_0x35d8dc[_0xd40c('0x85')]=qs['sort'](_0x2c8a49[_0xd40c('0x47')]['sort']);_0x35d8dc[_0xd40c('0x50')]=qs[_0xd40c('0x48')](_['pick'](_0x2c8a49[_0xd40c('0x47')],_0x5100d7['filters']));_0x35d8dc['where'][_0xd40c('0x65')]=_0x43e99a['id'];if(_0x2c8a49[_0xd40c('0x47')][_0xd40c('0x6a')]){_0x35d8dc[_0xd40c('0x50')]=_['merge'](_0x35d8dc[_0xd40c('0x50')],{'$or':_[_0xd40c('0x41')](_0x35d8dc['attributes'],function(_0x70e5da){var _0x26db8d={};_0x26db8d[_0x70e5da]={'$like':'%'+_0x2c8a49[_0xd40c('0x47')][_0xd40c('0x6a')]+'%'};return _0x26db8d;})});}_0x35d8dc=_[_0xd40c('0x52')]({},_0x35d8dc,_0x2c8a49[_0xd40c('0x54')]);return db[_0xd40c('0x82')][_0xd40c('0x1f')]({'where':_0x35d8dc[_0xd40c('0x50')]})['then'](function(_0x47744f){_0x2f5f3d['count']=_0x47744f;if(_0x2c8a49['query']['includeAll']){_0x35d8dc[_0xd40c('0x56')]=[{'model':db[_0xd40c('0x86')],'as':_0xd40c('0x87'),'required':![]},{'model':db[_0xd40c('0x88')],'as':'Owner','attributes':[_0xd40c('0x25'),'fullname','internal'],'required':![]},{'model':db[_0xd40c('0x89')],'as':_0xd40c('0x8a'),'attributes':['id',_0xd40c('0x25'),'color'],'where':_0x2c8a49[_0xd40c('0x47')][_0xd40c('0x8b')]?{'id':_0x2c8a49['query']['tag']}:undefined,'required':_0x2c8a49['query']['tag']?!![]:![]}];}return db[_0xd40c('0x82')]['findAll'](_0x35d8dc);})[_0xd40c('0xe')](function(_0x58d525){_0x2f5f3d['rows']=_0x58d525;return _0x2f5f3d;});}})[_0xd40c('0xe')](respondWithFilteredResult(_0x55b3f0,_0x35d8dc))[_0xd40c('0x19')](handleError(_0x55b3f0,null));};exports[_0xd40c('0x8c')]=function addApplications(_0x3cdccb,_0x49fc75){var _0x189188=_0x3cdccb[_0xd40c('0x5a')]['id'];var _0x7bda59=_0x3cdccb[_0xd40c('0x5f')];var _0x176d6a=0xc8;var _0x4407f0=null;return db[_0xd40c('0x8d')][_0xd40c('0x8e')]({'isolationLevel':db[_0xd40c('0x8d')][_0xd40c('0x8f')]['ISOLATION_LEVELS'][_0xd40c('0x90')]},function(_0x1bf106){return db[_0xd40c('0x42')][_0xd40c('0x69')]({'where':{'id':_0x189188},'transaction':_0x1bf106})['then'](function(_0x19a974){if(_0x19a974){return db['MailApplication'][_0xd40c('0x21')]({'where':{'MailAccountId':_0x189188},'transaction':_0x1bf106})[_0xd40c('0xe')](function(){var _0xb27d9=_[_0xd40c('0x41')](_0x7bda59,function(_0x5e8519){_0x5e8519['MailAccountId']=_0x189188;return _0x5e8519;});return db[_0xd40c('0x91')][_0xd40c('0x92')](_0xb27d9,{'transaction':_0x1bf106});});}else{_0x176d6a=0x194;_0x4407f0=[];}});})[_0xd40c('0xe')](function(){if(_0x176d6a!==0x194){return db['MailApplication'][_0xd40c('0x93')]({'where':{'MailAccountId':_0x189188},'order':_0xd40c('0x94')})['then'](function(_0x21971c){_0x4407f0=_0x21971c;});}})['catch'](function(_0xf89fa9){_0x176d6a=0x1f4;logger[_0xd40c('0x15')](_0xf89fa9[_0xd40c('0x95')]);if(_0xf89fa9[_0xd40c('0x25')]){delete _0xf89fa9[_0xd40c('0x25')];}_0x4407f0=_0xf89fa9;})[_0xd40c('0x96')](function(){if(_0x4407f0===null){_0x49fc75[_0xd40c('0x1a')](_0x176d6a);}else{if(_0x176d6a===0x1f4){_0x49fc75[_0xd40c('0x1b')](_0x176d6a)[_0xd40c('0x26')](_0x4407f0);}else{_0x49fc75[_0xd40c('0x1b')](_0x176d6a)[_0xd40c('0x1c')](_0x4407f0);}}});};exports[_0xd40c('0x97')]=function(_0x437b79,_0x1f14e3){var _0x34fb00={};var _0x2dbe24={};var _0x58eac8;var _0x365903;return db[_0xd40c('0x42')][_0xd40c('0x69')]({'where':{'id':_0x437b79['params']['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0x1f14e3,null))[_0xd40c('0xe')](function(_0x469014){if(_0x469014){_0x58eac8=_0x469014;_0x2dbe24[_0xd40c('0x46')]=_[_0xd40c('0x5b')](db[_0xd40c('0x91')]['rawAttributes']);_0x2dbe24[_0xd40c('0x47')]=_[_0xd40c('0x5b')](_0x437b79['query']);_0x2dbe24['filters']=_[_0xd40c('0x49')](_0x2dbe24[_0xd40c('0x46')],_0x2dbe24[_0xd40c('0x47')]);_0x34fb00[_0xd40c('0x4a')]=_['intersection'](_0x2dbe24[_0xd40c('0x46')],qs['fields'](_0x437b79[_0xd40c('0x47')][_0xd40c('0x4b')]));_0x34fb00[_0xd40c('0x4a')]=_0x34fb00['attributes'][_0xd40c('0x5d')]?_0x34fb00[_0xd40c('0x4a')]:_0x2dbe24[_0xd40c('0x46')];_0x34fb00['order']=qs[_0xd40c('0x4f')](_0x437b79[_0xd40c('0x47')][_0xd40c('0x4f')]);_0x34fb00[_0xd40c('0x50')]=qs[_0xd40c('0x48')](_['pick'](_0x437b79[_0xd40c('0x47')],_0x2dbe24[_0xd40c('0x48')]));if(_0x437b79['query']['filter']){_0x34fb00['where']=_[_0xd40c('0x52')](_0x34fb00['where'],{'$or':_[_0xd40c('0x41')](_0x34fb00[_0xd40c('0x4a')],function(_0x4b64d2){var _0x5b1f9a={};_0x5b1f9a[_0x4b64d2]={'$like':'%'+_0x437b79[_0xd40c('0x47')][_0xd40c('0x6a')]+'%'};return _0x5b1f9a;})});}_0x34fb00=_[_0xd40c('0x52')]({},_0x34fb00,_0x437b79[_0xd40c('0x54')]);return _0x58eac8['getApplications'](_0x34fb00);}})['then'](function(_0x23bb59){if(_0x23bb59){_0x365903=_0x23bb59['length'];if(!_0x437b79['query'][_0xd40c('0x4c')](_0xd40c('0x4d'))){_0x34fb00['limit']=qs[_0xd40c('0x4e')](_0x437b79[_0xd40c('0x47')]['limit']);_0x34fb00[_0xd40c('0x1d')]=qs[_0xd40c('0x1d')](_0x437b79[_0xd40c('0x47')][_0xd40c('0x1d')]);}return _0x58eac8[_0xd40c('0x97')](_0x34fb00);}})['then'](function(_0x24a627){if(_0x24a627){return _0x24a627?{'count':_0x365903,'rows':_0x24a627}:null;}})[_0xd40c('0xe')](respondWithResult(_0x1f14e3,null))['catch'](handleError(_0x1f14e3,null));};exports[_0xd40c('0x98')]=function(_0x25cab8,_0x20d296){var _0x3a3543={'raw':!![],'where':{}};var _0x370632={};var _0x55d34b={'count':0x0,'rows':[]};return db[_0xd40c('0x42')][_0xd40c('0x69')]({'where':{'id':_0x25cab8[_0xd40c('0x5a')]['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0x20d296,null))[_0xd40c('0xe')](function(_0x2c14bb){if(_0x2c14bb){_0x370632[_0xd40c('0x46')]=_['keys'](db['MailMessage'][_0xd40c('0x5c')]);_0x370632['query']=_[_0xd40c('0x5b')](_0x25cab8[_0xd40c('0x47')]);_0x370632['filters']=_['intersection'](_0x370632[_0xd40c('0x46')],_0x370632[_0xd40c('0x47')]);_0x3a3543['attributes']=_['intersection'](_0x370632[_0xd40c('0x46')],qs[_0xd40c('0x4b')](_0x25cab8[_0xd40c('0x47')][_0xd40c('0x4b')]));_0x3a3543[_0xd40c('0x4a')]=_0x3a3543[_0xd40c('0x4a')][_0xd40c('0x5d')]?_0x3a3543[_0xd40c('0x4a')]:_0x370632[_0xd40c('0x46')];if(!_0x25cab8[_0xd40c('0x47')]['hasOwnProperty'](_0xd40c('0x4d'))){_0x3a3543[_0xd40c('0x4e')]=qs[_0xd40c('0x4e')](_0x25cab8['query'][_0xd40c('0x4e')]);_0x3a3543[_0xd40c('0x1d')]=qs[_0xd40c('0x1d')](_0x25cab8['query'][_0xd40c('0x1d')]);}_0x3a3543[_0xd40c('0x85')]=qs[_0xd40c('0x4f')](_0x25cab8[_0xd40c('0x47')][_0xd40c('0x4f')]);_0x3a3543[_0xd40c('0x50')]=qs[_0xd40c('0x48')](_['pick'](_0x25cab8['query'],_0x370632['filters']));_0x3a3543[_0xd40c('0x50')][_0xd40c('0x65')]=_0x2c14bb['id'];if(_0x25cab8[_0xd40c('0x47')][_0xd40c('0x6a')]){_0x3a3543['where']=_[_0xd40c('0x52')](_0x3a3543[_0xd40c('0x50')],{'$or':_[_0xd40c('0x41')](_0x3a3543[_0xd40c('0x4a')],function(_0x36005f){var _0x2f40cc={};_0x2f40cc[_0x36005f]={'$like':'%'+_0x25cab8[_0xd40c('0x47')][_0xd40c('0x6a')]+'%'};return _0x2f40cc;})});}if(_0x25cab8[_0xd40c('0x47')]['$gte']){var _0x3bf5ab=_0x25cab8['query'][_0xd40c('0x99')][_0xd40c('0x9a')](',');var _0x5d1da0={};_0x5d1da0[_0x3bf5ab[0x0]]={'$gte':moment(_0x3bf5ab[0x1])[_0xd40c('0x9b')](_0xd40c('0x9c'))};_0x3a3543[_0xd40c('0x50')]=_[_0xd40c('0x52')](_0x3a3543[_0xd40c('0x50')],_0x5d1da0);}_0x3a3543=_['merge']({},_0x3a3543,_0x25cab8['options']);return db[_0xd40c('0x9d')][_0xd40c('0x1f')]({'where':_0x3a3543['where']})[_0xd40c('0xe')](function(_0x46c40d){_0x55d34b['count']=_0x46c40d;if(_0x25cab8[_0xd40c('0x47')][_0xd40c('0x55')]){_0x3a3543['include']=[{'all':!![]}];}return db[_0xd40c('0x9d')][_0xd40c('0x57')](_0x3a3543);})[_0xd40c('0xe')](function(_0x39dc77){if(_0x25cab8[_0xd40c('0x47')][_0xd40c('0x9e')]==='true'){for(var _0x27d131=0x0;_0x27d131<_0x39dc77[_0xd40c('0x5d')];_0x27d131++){_0x39dc77[_0x27d131][_0xd40c('0x5f')]=juice(_0x39dc77[_0x27d131][_0xd40c('0x5f')]);}}_0x55d34b[_0xd40c('0x58')]=_0x39dc77;return _0x55d34b;});}})[_0xd40c('0xe')](respondWithFilteredResult(_0x20d296,_0x3a3543))['catch'](handleError(_0x20d296,null));};exports[_0xd40c('0x26')]=function(_0x513d17,_0x26d331){var _0x2fd1a7,_0x2be64c={},_0x41f2a8;if(_0x513d17[_0xd40c('0x5f')]['to']){_0x41f2a8=_0x513d17['body']['to'][_0xd40c('0x9a')](',')[0x0];}return db[_0xd40c('0x42')]['find']({'where':{'id':_0x513d17[_0xd40c('0x5a')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xd40c('0x86')],'as':'Contacts','where':{'email':_0x41f2a8},'limit':0x1,'order':[['updatedAt',_0xd40c('0x9f')]]}]},{'model':db[_0xd40c('0x3e')],'as':_0xd40c('0x3b'),'raw':!![],'include':[{'model':db[_0xd40c('0xa0')],'as':_0xd40c('0xa0'),'raw':!![]}]}]})[_0xd40c('0xe')](handleEntityNotFound(_0x26d331,null))['then'](function(_0x585a90){if(!_0x585a90)return;_0x2fd1a7=_0x585a90;if(!_0x585a90[_0xd40c('0x3b')])throw new Error(_0xd40c('0xa1'));if(_[_0xd40c('0x74')](_0x513d17[_0xd40c('0x5f')]['from'])){_0x513d17[_0xd40c('0x5f')][_0xd40c('0xa2')]=util[_0xd40c('0x9b')](_0xd40c('0xa3'),_0x585a90['name'],_0x585a90[_0xd40c('0x72')]||_0x585a90['Smtp']['user']);}if(_0x513d17[_0xd40c('0x5f')][_0xd40c('0xa4')]&&_0x513d17[_0xd40c('0x5f')]['attachments'][_0xd40c('0x5d')]){for(var _0xe5cab9=0x0;_0xe5cab9<_0x513d17[_0xd40c('0x5f')][_0xd40c('0xa4')][_0xd40c('0x5d')];_0xe5cab9+=0x1){_0x513d17['body'][_0xd40c('0xa4')][_0xe5cab9]={'filename':_0x513d17[_0xd40c('0x5f')][_0xd40c('0xa4')][_0xe5cab9]['name'],'path':path[_0xd40c('0xa5')](config['root'],_0xd40c('0xa6'),_0x513d17['body'][_0xd40c('0xa4')][_0xe5cab9]['basename'])};}}var _0x322103=_0x585a90['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xd40c('0xa7'),{'account':_0x322103,'message':_0x513d17[_0xd40c('0x5f')]});})[_0xd40c('0xe')](function(_0x2c7e38){if(!_0x2c7e38)return;_0x2be64c=_0x2c7e38;if(!_0x2fd1a7['List'])throw new Error(_0xd40c('0xa8'));if(_0x2fd1a7[_0xd40c('0xa9')][_0xd40c('0xaa')][_0xd40c('0x5d')])return _0x2fd1a7[_0xd40c('0xa9')][_0xd40c('0xaa')][0x0];return db['CmContact']['create'](_[_0xd40c('0xab')](_0x513d17[_0xd40c('0x5f')],{'firstName':_0x513d17['body']['to'],'email':_0x513d17[_0xd40c('0x5f')]['to'],'phone':_0x513d17['body']['to'],'ListId':_0x2fd1a7[_0xd40c('0x73')]}));})[_0xd40c('0xe')](function(_0x128b08){if(!_0x128b08)return;var _0xbe3196={'UserId':_0x513d17[_0xd40c('0x30')]['id'],'ContactId':_0x128b08['id'],'MailAccountId':_0x2fd1a7['id'],'inReplyTo':_0x2be64c[_0xd40c('0xac')],'to':_0x513d17['body'][_0xd40c('0xa2')],'cc':_0x513d17[_0xd40c('0x5f')]['cc'],'subject':_0x513d17[_0xd40c('0x5f')][_0xd40c('0xad')],'attach':_0x513d17[_0xd40c('0x5f')][_0xd40c('0xae')],'firstMsgDirection':_0xd40c('0xaf'),'lastMsgAt':moment()[_0xd40c('0x9b')](_0xd40c('0x9c')),'lastMsgDirection':_0xd40c('0xaf'),'Messages':[_[_0xd40c('0x52')](_0x513d17[_0xd40c('0x5f')],{'messageId':_0x2be64c['messageId'],'sentAt':moment()[_0xd40c('0x9b')](_0xd40c('0x9c')),'read':!![],'MailAccountId':_0x2fd1a7['id'],'UserId':_0x513d17[_0xd40c('0x30')]['id'],'ContactId':_0x128b08['id']})]};if(_0x513d17[_0xd40c('0x5f')][_0xd40c('0xb0')]){_0xbe3196=_['merge'](_0xbe3196,_0x513d17[_0xd40c('0x5f')][_0xd40c('0xb0')]);}return db[_0xd40c('0x82')]['create'](_0xbe3196,{'include':[{'model':db[_0xd40c('0x9d')],'as':'Messages'}]});})[_0xd40c('0xe')](respondWithResult(_0x26d331,null))[_0xd40c('0x19')](handleError(_0x26d331,null));};exports[_0xd40c('0xb1')]=function(_0x410fef,_0x6e1dde){return db['MailAccount']['find']({'where':{'id':_0x410fef[_0xd40c('0x5a')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xd40c('0x3b'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0xd40c('0xe')](handleEntityNotFound(_0x6e1dde,null))[_0xd40c('0xe')](function(_0x46abbb){if(!_0x46abbb[_0xd40c('0x3b')])return;var _0x58c10e=_0x46abbb['getSmtpOptions']();return respondWithRpcPromise(_0xd40c('0xb2'),_0xd40c('0xb1'),{'account':_0x58c10e});})[_0xd40c('0xe')](respondWithResult(_0x6e1dde,null))[_0xd40c('0x19')](handleError(_0x6e1dde,null));};exports[_0xd40c('0x21')]=function(_0x44210a,_0x39f746){return db['MailAccount']['find']({'where':{'id':_0x44210a[_0xd40c('0x5a')]['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0x39f746,null))[_0xd40c('0xe')](function(_0x1fc7ce){if(_0x1fc7ce&&_0x1fc7ce[_0xd40c('0xb3')]){throw new db['Sequelize'][(_0xd40c('0xb4'))](_0xd40c('0xb5'));}return _0x1fc7ce;})['then'](removeEntity(_0x39f746,null))[_0xd40c('0x19')](handleError(_0x39f746,null));};exports[_0xd40c('0xb6')]=function(_0x42445d,_0xc8b532){return db[_0xd40c('0x42')][_0xd40c('0x5e')]({'where':{'id':_0x42445d[_0xd40c('0x5a')]['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0xc8b532,null))[_0xd40c('0xe')](function(_0x2c3ec4){if(_0x2c3ec4){return _0x2c3ec4['addAgents'](_0x42445d['body'][_0xd40c('0x6c')],_[_0xd40c('0x83')](_0x42445d[_0xd40c('0x5f')],['ids','id'])||{})[_0xd40c('0xb7')](function(_0x5100d9){for(var _0x103818=0x0;_0x103818<_0x42445d[_0xd40c('0x5f')][_0xd40c('0x6c')]['length'];_0x103818+=0x1){socket[_0xd40c('0xb8')](_0xd40c('0xb9'),{'UserId':Number(_0x42445d[_0xd40c('0x5f')]['ids'][_0x103818]),'MailAccountId':Number(_0x42445d[_0xd40c('0x5a')]['id'])});}return _0x5100d9;});}})[_0xd40c('0xe')](respondWithResult(_0xc8b532,null))[_0xd40c('0x19')](handleError(_0xc8b532,null));};exports['removeAgents']=function(_0x88c2c2,_0x33bf95){return db[_0xd40c('0x42')]['find']({'where':{'id':_0x88c2c2[_0xd40c('0x5a')]['id']}})[_0xd40c('0xe')](handleEntityNotFound(_0x33bf95,null))['then'](function(_0x1ecb77){if(_0x1ecb77){return _0x1ecb77['removeAgents'](_0x88c2c2[_0xd40c('0x47')][_0xd40c('0x6c')])[_0xd40c('0xe')](function(){if(_[_0xd40c('0xba')](_0x88c2c2[_0xd40c('0x47')][_0xd40c('0x6c')])){for(var _0x243aa5=0x0;_0x243aa5<_0x88c2c2[_0xd40c('0x47')]['ids'][_0xd40c('0x5d')];_0x243aa5+=0x1){socket['emit'](_0xd40c('0xbb'),{'UserId':Number(_0x88c2c2[_0xd40c('0x47')][_0xd40c('0x6c')][_0x243aa5]),'MailAccountId':Number(_0x88c2c2[_0xd40c('0x5a')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x88c2c2[_0xd40c('0x47')][_0xd40c('0x6c')]),'MailAccountId':Number(_0x88c2c2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x33bf95,null))[_0xd40c('0x19')](handleError(_0x33bf95,null));};exports['getAgents']=function(_0x32eb16,_0x20360e){var _0xf1389e={};var _0x3f070b={};var _0x40e8bf;var _0x5b2f95;return db[_0xd40c('0x42')][_0xd40c('0x69')]({'where':{'id':_0x32eb16['params']['id']}})['then'](handleEntityNotFound(_0x20360e,null))['then'](function(_0x5d26ff){if(_0x5d26ff){_0x40e8bf=_0x5d26ff;_0x3f070b[_0xd40c('0x46')]=_[_0xd40c('0x5b')](db[_0xd40c('0x88')][_0xd40c('0x5c')]);_0x3f070b['query']=_[_0xd40c('0x5b')](_0x32eb16[_0xd40c('0x47')]);_0x3f070b[_0xd40c('0x48')]=_[_0xd40c('0x49')](_0x3f070b[_0xd40c('0x46')],_0x3f070b[_0xd40c('0x47')]);_0xf1389e['attributes']=_['intersection'](_0x3f070b[_0xd40c('0x46')],qs['fields'](_0x32eb16['query'][_0xd40c('0x4b')]));_0xf1389e[_0xd40c('0x4a')]=_0xf1389e[_0xd40c('0x4a')][_0xd40c('0x5d')]?_0xf1389e[_0xd40c('0x4a')]:_0x3f070b[_0xd40c('0x46')];_0xf1389e[_0xd40c('0x85')]=qs[_0xd40c('0x4f')](_0x32eb16[_0xd40c('0x47')][_0xd40c('0x4f')]);_0xf1389e[_0xd40c('0x50')]=qs[_0xd40c('0x48')](_[_0xd40c('0x51')](_0x32eb16['query'],_0x3f070b[_0xd40c('0x48')]));if(_0x32eb16['query'][_0xd40c('0x6a')]){_0xf1389e[_0xd40c('0x50')]=_[_0xd40c('0x52')](_0xf1389e[_0xd40c('0x50')],{'$or':_[_0xd40c('0x41')](_0xf1389e[_0xd40c('0x4a')],function(_0x15d40b){var _0x3bb427={};_0x3bb427[_0x15d40b]={'$like':'%'+_0x32eb16['query'][_0xd40c('0x6a')]+'%'};return _0x3bb427;})});}_0xf1389e=_[_0xd40c('0x52')]({},_0xf1389e,_0x32eb16[_0xd40c('0x54')]);return _0x40e8bf['getAgents'](_0xf1389e);}})['then'](function(_0xb445b0){if(_0xb445b0){_0x5b2f95=_0xb445b0[_0xd40c('0x5d')];if(!_0x32eb16['query'][_0xd40c('0x4c')](_0xd40c('0x4d'))){_0xf1389e['limit']=qs['limit'](_0x32eb16[_0xd40c('0x47')][_0xd40c('0x4e')]);_0xf1389e[_0xd40c('0x1d')]=qs[_0xd40c('0x1d')](_0x32eb16[_0xd40c('0x47')][_0xd40c('0x1d')]);}return _0x40e8bf['getAgents'](_0xf1389e);}})[_0xd40c('0xe')](function(_0x44fb68){if(_0x44fb68){return _0x44fb68?{'count':_0x5b2f95,'rows':_0x44fb68}:null;}})[_0xd40c('0xe')](respondWithResult(_0x20360e,null))[_0xd40c('0x19')](handleError(_0x20360e,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index ea3c6dc..45b23ba 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 _0x66fa=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x66fa,0x117));var _0xa66f=function(_0x4c34ef,_0x3b438d){_0x4c34ef=_0x4c34ef-0x0;var _0x377846=_0x66fa[_0x4c34ef];return _0x377846;};'use strict';var EventEmitter=require(_0xa66f('0x0'));var MailAccount=require(_0xa66f('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xa66f('0x2')](0x0);var events={'afterCreate':_0xa66f('0x3'),'afterUpdate':_0xa66f('0x4'),'afterDestroy':_0xa66f('0x5')};function emitEvent(_0x3d0c49){return function(_0x2a2abf,_0x3f4904,_0x5ebea5){MailAccountEvents['emit'](_0x3d0c49+':'+_0x2a2abf['id'],_0x2a2abf);MailAccountEvents[_0xa66f('0x6')](_0x3d0c49,_0x2a2abf);_0x5ebea5(null);};}for(var e in events){if(events[_0xa66f('0x7')](e)){var event=events[e];MailAccount[_0xa66f('0x8')](e,emitEvent(event));}}module[_0xa66f('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x458a=['emit','exports','events','setMaxListeners','save','remove'];(function(_0x5b3725,_0x3803ad){var _0x3f5531=function(_0x6d2e4f){while(--_0x6d2e4f){_0x5b3725['push'](_0x5b3725['shift']());}};_0x3f5531(++_0x3803ad);}(_0x458a,0x110));var _0xa458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x458a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xa458('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xa458('0x1')](0x0);var events={'afterCreate':_0xa458('0x2'),'afterUpdate':'update','afterDestroy':_0xa458('0x3')};function emitEvent(_0x3ae6c1){return function(_0xd8f327,_0x953f51,_0x306a40){MailAccountEvents[_0xa458('0x4')](_0x3ae6c1+':'+_0xd8f327['id'],_0xd8f327);MailAccountEvents['emit'](_0x3ae6c1,_0xd8f327);_0x306a40(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xa458('0x5')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index deb2cea..62b6e25 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 _0x4901=['service','provider','host','Smtp','port','secure','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','user','data5','auth','pass','./mailAccount.attributes','exports','define','mail_accounts','custom'];(function(_0x49c03d,_0x3434d8){var _0x37e8b1=function(_0x341e18){while(--_0x341e18){_0x49c03d['push'](_0x49c03d['shift']());}};_0x37e8b1(++_0x3434d8);}(_0x4901,0xb6));var _0x1490=function(_0x55d50d,_0x5d82d7){_0x55d50d=_0x55d50d-0x0;var _0x315583=_0x4901[_0x55d50d];return _0x315583;};'use strict';var attributes=require(_0x1490('0x0'));module[_0x1490('0x1')]=function(_0x7061bb){return _0x7061bb[_0x1490('0x2')]('MailAccount',attributes,{'tableName':_0x1490('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x194de1=this;var _0x548117={'id':_0x194de1['id'],'tls':{'rejectUnauthorized':![]}};if(_0x194de1['provider']!==_0x1490('0x4')){_0x548117[_0x1490('0x5')]=_0x194de1[_0x1490('0x6')];}else{_0x548117[_0x1490('0x7')]=_0x194de1[_0x1490('0x8')][_0x1490('0x7')];_0x548117[_0x1490('0x9')]=_0x194de1[_0x1490('0x8')][_0x1490('0x9')];_0x548117[_0x1490('0xa')]=_0x194de1['Smtp'][_0x1490('0xa')];}if(_0x194de1[_0x1490('0x8')]['authentication']){if(_0x194de1[_0x1490('0x8')]['modernAuthentication']){if(!_0x194de1['Smtp'][_0x1490('0xb')])throw new Error(_0x1490('0xc'));_0x548117['auth']={'type':'OAuth2','user':_0x194de1['Smtp'][_0x1490('0xd')],'accessToken':_0x194de1['Smtp']['CloudProvider'][_0x1490('0xe')]};}else{_0x548117[_0x1490('0xf')]={'user':_0x194de1[_0x1490('0x8')][_0x1490('0xd')],'pass':_0x194de1[_0x1490('0x8')][_0x1490('0x10')]};}}return _0x548117;}}});}; \ No newline at end of file +var _0x0b3a=['auth','OAuth2','user','data5','exports','MailAccount','mail_accounts','provider','service','Smtp','host','port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found'];(function(_0x4a5e16,_0x4a68a4){var _0xb7817f=function(_0x18c233){while(--_0x18c233){_0x4a5e16['push'](_0x4a5e16['shift']());}};_0xb7817f(++_0x4a68a4);}(_0x0b3a,0x1a4));var _0xa0b3=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x0b3a[_0x75f869];return _0x10af8b;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xa0b3('0x0')]=function(_0x3996be){return _0x3996be['define'](_0xa0b3('0x1'),attributes,{'tableName':_0xa0b3('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x33a15a=this;var _0x49f90a={'id':_0x33a15a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x33a15a[_0xa0b3('0x3')]!=='custom'){_0x49f90a[_0xa0b3('0x4')]=_0x33a15a['provider'];}else{_0x49f90a['host']=_0x33a15a[_0xa0b3('0x5')][_0xa0b3('0x6')];_0x49f90a[_0xa0b3('0x7')]=_0x33a15a['Smtp'][_0xa0b3('0x7')];_0x49f90a[_0xa0b3('0x8')]=_0x33a15a[_0xa0b3('0x5')][_0xa0b3('0x8')];}if(_0x33a15a[_0xa0b3('0x5')]['authentication']){if(_0x33a15a[_0xa0b3('0x5')][_0xa0b3('0x9')]){if(!_0x33a15a[_0xa0b3('0x5')][_0xa0b3('0xa')])throw new Error(_0xa0b3('0xb'));_0x49f90a[_0xa0b3('0xc')]={'type':_0xa0b3('0xd'),'user':_0x33a15a[_0xa0b3('0x5')][_0xa0b3('0xe')],'accessToken':_0x33a15a[_0xa0b3('0x5')][_0xa0b3('0xa')][_0xa0b3('0xf')]};}else{_0x49f90a[_0xa0b3('0xc')]={'user':_0x33a15a['Smtp'][_0xa0b3('0xe')],'pass':_0x33a15a[_0xa0b3('0x5')]['pass']};}}return _0x49f90a;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 698245c..8f8bb47 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 _0x029b=['lodash','moment','randomstring','ioredis','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','attributes','limit','include','map','model','then','stringify','find','where','setDataValue','smtpOptions','getSmtpOptions','ShowMailAccount','body','mail','difference','CmContact','rawAttributes','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','list','applications','orderBy','priority','autoclose','close','*,*,*,*','length','create','List\x20not\x20found','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','interaction','get','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','User','name','unshift','agent','MailQueue','queue','Start','startRouting'];(function(_0x42c3d2,_0x156aa3){var _0x56b0f0=function(_0x163583){while(--_0x163583){_0x42c3d2['push'](_0x42c3d2['shift']());}};_0x56b0f0(++_0x156aa3);}(_0x029b,0x66));var _0xb029=function(_0x2e304c,_0x5aa490){_0x2e304c=_0x2e304c-0x0;var _0x1385b8=_0x029b[_0x2e304c];return _0x1385b8;};'use strict';var _=require(_0xb029('0x0'));var moment=require(_0xb029('0x1'));var BPromise=require('bluebird');var rs=require(_0xb029('0x2'));var Redis=require(_0xb029('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xb029('0x4'))(_0xb029('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb029('0x6')][_0xb029('0x7')]({'port':0x232c});config[_0xb029('0x8')]=_[_0xb029('0x9')](config[_0xb029('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb029('0xa'))(new Redis(config['redis']));require(_0xb029('0xb'))['register'](socket);function respondWithRpcPromise(_0x2c3772,_0x5a8bb7,_0x23fee0){return new BPromise(function(_0x4b3036,_0x2696e3){return client[_0xb029('0xc')](_0x2c3772,_0x23fee0)['then'](function(_0x266df5){logger[_0xb029('0xd')](_0xb029('0xe'),_0x5a8bb7,_0xb029('0xf'));logger[_0xb029('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5a8bb7,_0xb029('0xf'),JSON['stringify'](_0x266df5));if(_0x266df5[_0xb029('0x11')]){if(_0x266df5[_0xb029('0x11')][_0xb029('0x12')]===0x1f4){logger[_0xb029('0x11')]('MailAccount,\x20%s,\x20%s',_0x5a8bb7,_0x266df5[_0xb029('0x11')][_0xb029('0x13')]);return _0x2696e3(_0x266df5[_0xb029('0x11')]['message']);}logger[_0xb029('0x11')](_0xb029('0xe'),_0x5a8bb7,_0x266df5[_0xb029('0x11')][_0xb029('0x13')]);return _0x4b3036(_0x266df5[_0xb029('0x11')][_0xb029('0x13')]);}else{logger[_0xb029('0xd')](_0xb029('0xe'),_0x5a8bb7,_0xb029('0xf'));_0x4b3036(_0x266df5['result']['message']);}})[_0xb029('0x14')](function(_0x5373cd){logger[_0xb029('0x11')](_0xb029('0xe'),_0x5a8bb7,_0x5373cd);_0x2696e3(_0x5373cd);});});}exports[_0xb029('0x15')]=function(_0x497ca0){var _0x5e1741=this;return new Promise(function(_0x13ff77,_0x8d3e35){return db[_0xb029('0x16')][_0xb029('0x17')]({'raw':_0x497ca0[_0xb029('0x18')]?_0x497ca0[_0xb029('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x497ca0['options']?_0x497ca0['options']['where']||null:null,'attributes':_0x497ca0[_0xb029('0x18')]?_0x497ca0[_0xb029('0x18')][_0xb029('0x19')]||null:null,'limit':_0x497ca0[_0xb029('0x18')]?_0x497ca0['options'][_0xb029('0x1a')]||null:null,'include':_0x497ca0[_0xb029('0x18')]?_0x497ca0[_0xb029('0x18')][_0xb029('0x1b')]?_[_0xb029('0x1c')](_0x497ca0[_0xb029('0x18')][_0xb029('0x1b')],function(_0x3eb5ac){return{'model':db[_0x3eb5ac[_0xb029('0x1d')]],'as':_0x3eb5ac['as'],'attributes':_0x3eb5ac[_0xb029('0x19')],'include':_0x3eb5ac[_0xb029('0x1b')]?_[_0xb029('0x1c')](_0x3eb5ac[_0xb029('0x1b')],function(_0x599a14){return{'model':db[_0x599a14[_0xb029('0x1d')]],'as':_0x599a14['as'],'attributes':_0x599a14[_0xb029('0x19')],'include':_0x599a14['include']?_['map'](_0x599a14[_0xb029('0x1b')],function(_0x3b030a){return{'model':db[_0x3b030a[_0xb029('0x1d')]],'as':_0x3b030a['as'],'attributes':_0x3b030a[_0xb029('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb029('0x1e')](function(_0x4af2ad){logger[_0xb029('0xd')]('GetMailAccount',_0x497ca0);logger[_0xb029('0x10')](_0xb029('0x15'),_0x497ca0,JSON[_0xb029('0x1f')](_0x4af2ad));_0x13ff77(_0x4af2ad);})['catch'](function(_0x1aa94b){logger[_0xb029('0x11')]('GetMailAccount',_0x1aa94b[_0xb029('0x13')],_0x497ca0);_0x8d3e35(_0x5e1741['error'](0x1f4,_0x1aa94b[_0xb029('0x13')]));});});};exports['ShowMailAccount']=function(_0x88a69b){var _0x3b0bfe=this;return new Promise(function(_0x392d0f,_0x2324f3){return db[_0xb029('0x16')][_0xb029('0x20')]({'raw':_0x88a69b[_0xb029('0x18')]?_0x88a69b[_0xb029('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x88a69b[_0xb029('0x18')]?_0x88a69b[_0xb029('0x18')][_0xb029('0x21')]||null:null,'attributes':_0x88a69b['options']?_0x88a69b[_0xb029('0x18')][_0xb029('0x19')]||null:null,'include':_0x88a69b['options']?_0x88a69b[_0xb029('0x18')]['include']?_[_0xb029('0x1c')](_0x88a69b['options'][_0xb029('0x1b')],function(_0x42f980){return{'model':db[_0x42f980[_0xb029('0x1d')]],'as':_0x42f980['as'],'attributes':_0x42f980[_0xb029('0x19')],'include':_0x42f980[_0xb029('0x1b')]?_[_0xb029('0x1c')](_0x42f980[_0xb029('0x1b')],function(_0x5a1d11){return{'model':db[_0x5a1d11[_0xb029('0x1d')]],'as':_0x5a1d11['as'],'attributes':_0x5a1d11[_0xb029('0x19')],'include':_0x5a1d11['include']?_[_0xb029('0x1c')](_0x5a1d11[_0xb029('0x1b')],function(_0x35105c){return{'model':db[_0x35105c[_0xb029('0x1d')]],'as':_0x35105c['as'],'attributes':_0x35105c['attributes']};}):[]};}):[]};}):[]:[]})[_0xb029('0x1e')](function(_0x3a2547){if(_0x88a69b[_0xb029('0x18')]['smtp']===!![])_0x3a2547[_0xb029('0x22')](_0xb029('0x23'),_0x3a2547[_0xb029('0x24')]());logger[_0xb029('0xd')](_0xb029('0x25'),_0x88a69b);logger[_0xb029('0x10')](_0xb029('0x25'),_0x88a69b,JSON[_0xb029('0x1f')](_0x3a2547));_0x392d0f(_0x3a2547);})[_0xb029('0x14')](function(_0x1392af){logger['error'](_0xb029('0x25'),_0x1392af[_0xb029('0x13')],_0x88a69b);_0x2324f3(_0x3b0bfe[_0xb029('0x11')](0x1f4,_0x1392af['message']));});});};exports['NotifyMailAccount']=function(_0x521b20){var _0x31477a=this;return new Promise(function(_0x41a857,_0x5c7082){var _0x1a7285={'body':_0x521b20[_0xb029('0x26')],'channel':_0xb029('0x27')};var _0x3bc456=_[_0xb029('0x28')](_['keys'](db[_0xb029('0x29')][_0xb029('0x2a')]),['createdAt',_0xb029('0x2b'),_0xb029('0x2c'),_0xb029('0x2d')]);var _0x56a470=![];if(_0x521b20[_0xb029('0x26')]['id']){delete _0x521b20[_0xb029('0x26')]['id'];}if(_['isNil'](_0x521b20['body'][_0xb029('0x2e')])){return _0x5c7082(_0x31477a[_0xb029('0x11')](0x1f4,_0xb029('0x2f')));}if(_[_0xb029('0x30')](_0x521b20['body']['body'])||_0x521b20[_0xb029('0x26')]['body']===''){return _0x5c7082(_0x31477a[_0xb029('0x11')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xb029('0x30')](_0x521b20[_0xb029('0x26')][_0xb029('0x31')])){return _0x5c7082(_0x31477a[_0xb029('0x11')](0x1f4,_0xb029('0x32')+_0x3bc456));}if(!_[_0xb029('0x33')](_0x3bc456,_0x521b20['body'][_0xb029('0x31')])){return _0x5c7082(_0x31477a['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3bc456));}var _0x2dde2e={};_0x2dde2e[_0x521b20['body'][_0xb029('0x31')]]=_0x521b20['body'][_0xb029('0x2e')];return db[_0xb029('0x16')][_0xb029('0x20')]({'where':{'id':_0x521b20[_0xb029('0x34')]['id']},'include':[{'model':db['CmList'],'as':_0xb029('0x35'),'include':[{'model':db[_0xb029('0x29')],'as':_0xb029('0x36'),'where':_0x2dde2e,'limit':0x1,'order':[[_0xb029('0x2b'),_0xb029('0x37')]]}]},{'model':db[_0xb029('0x38')],'as':_0xb029('0x39')},{'model':db[_0xb029('0x3a')],'as':_0xb029('0x3b'),'include':[{'model':db[_0xb029('0x3c')],'as':'CloudProvider'}]}]})[_0xb029('0x1e')](function(_0x2345cd){if(_0x2345cd&&_0x2345cd[_0xb029('0x35')]){var _0x3172a2=_0x2345cd['get']({'plain':!![]});_0x1a7285[_0xb029('0x34')]=_['omit'](_0x3172a2,[_0xb029('0x39'),_0xb029('0x35')]);_0x1a7285[_0xb029('0x34')][_0xb029('0x23')]=_0x2345cd[_0xb029('0x24')]();_0x1a7285['applications']=_0x3172a2['Applications'];_0x1a7285[_0xb029('0x3d')]=_0x3172a2[_0xb029('0x35')];_0x1a7285[_0xb029('0x3e')]=_[_0xb029('0x3f')](_0x1a7285[_0xb029('0x3e')],[_0xb029('0x40')],['asc']);if(_0x1a7285[_0xb029('0x34')]&&_0x1a7285[_0xb029('0x34')][_0xb029('0x41')]){_0x1a7285['applications']['push']({'id':0x0,'priority':_0x1a7285[_0xb029('0x3e')]['length']+0x1,'app':_0xb029('0x42'),'appdata':_0xb029('0x41'),'interval':_0xb029('0x43')});}if(_0x1a7285['account'][_0xb029('0x39')]){delete _0x1a7285[_0xb029('0x34')]['Applications'];}if(_0x1a7285[_0xb029('0x34')][_0xb029('0x35')]){delete _0x1a7285[_0xb029('0x34')]['List'];}if(_0x3172a2[_0xb029('0x35')][_0xb029('0x36')][_0xb029('0x44')]){return _0x3172a2[_0xb029('0x35')]['Contacts'][0x0];}var _0x3cbbfe=_[_0xb029('0x9')](_0x521b20[_0xb029('0x26')],{'firstName':_0x521b20['body'][_0xb029('0x2e')],'ListId':_0x3172a2['ListId']});_0x3cbbfe[_0x521b20[_0xb029('0x26')][_0xb029('0x31')]]=_0x521b20[_0xb029('0x26')][_0xb029('0x2e')];return db[_0xb029('0x29')][_0xb029('0x45')](_0x3cbbfe);}else{throw new Error(_0xb029('0x46'));}})['then'](function(_0x4f41ad){_0x1a7285['contact']=_0x4f41ad;if(_0x4f41ad){if(!_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x47')]){_0x521b20[_0xb029('0x26')][_0xb029('0x13')]['messageId']=rs[_0xb029('0x48')]()+'\x20'+_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x2e')];}var _0x5b7c6d={'ContactId':_0x4f41ad['id'],'MailAccountId':_0x521b20[_0xb029('0x34')]['id'],'inReplyTo':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x47')],'to':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x2e')],'cc':_0x521b20[_0xb029('0x26')]['message']['cc'],'subject':_0x521b20[_0xb029('0x26')][_0xb029('0x13')]['subject'],'attach':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x49')],'lastMsgAt':moment()[_0xb029('0x4a')](_0xb029('0x4b')),'lastMsgDirection':'in'};return db[_0xb029('0x4c')][_0xb029('0x20')]({'where':{'closed':![],'MailAccountId':_0x521b20[_0xb029('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0xb029('0x4d'),'attributes':['messageId'],'where':{'messageId':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x4e')]}}]})['then'](function(_0xd82930){if(_0xd82930){return[_0xd82930,![]];}return db[_0xb029('0x4c')]['create'](_0x5b7c6d)['then'](function(_0x5792a1){return[_0x5792a1,!![]];});});}else{throw new Error(_0xb029('0x4f'));}})['spread'](function(_0x3d8ff6,_0x5419d5){if(_0x3d8ff6){_0x56a470=_0x5419d5;if(!_0x5419d5){return _0x3d8ff6['update']({'inReplyTo':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x47')],'to':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x2e')],'cc':_0x521b20[_0xb029('0x26')]['message']['cc'],'subject':_0x521b20[_0xb029('0x26')][_0xb029('0x13')]['subject'],'attach':_0x3d8ff6[_0xb029('0x49')]?_0x3d8ff6[_0xb029('0x49')]:_0x521b20[_0xb029('0x26')]['message'][_0xb029('0x49')],'substatus':null,'substatusAt':moment()[_0xb029('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xb029('0x4a')](_0xb029('0x4b')),'lastMsgDirection':'in'});}else{return _0x3d8ff6;}}})['then'](function(_0x227bfd){_0x1a7285[_0xb029('0x50')]=_0x227bfd[_0xb029('0x51')]({'plain':!![]});_0x1a7285[_0xb029('0x50')][_0xb029('0x52')]=_0x56a470;return db['MailMessage'][_0xb029('0x45')]({'body':_0x521b20['body']['body'],'MailAccountId':_0x521b20[_0xb029('0x34')]['id'],'MailInteractionId':_0x227bfd['id'],'direction':'in','ContactId':_0x1a7285[_0xb029('0x53')]['id'],'messageId':_0x521b20[_0xb029('0x26')]['message'][_0xb029('0x47')],'from':_0x521b20[_0xb029('0x26')]['message']['from'],'to':_0x521b20[_0xb029('0x26')]['message']['to'],'cc':_0x521b20[_0xb029('0x26')]['message']['cc'],'subject':_0x521b20['body'][_0xb029('0x13')]['subject'],'attach':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x49')],'Attachments':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x54')],'originTo':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x55')],'originCc':_0x521b20['body'][_0xb029('0x13')][_0xb029('0x56')],'bcc':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x57')],'ChatWebsiteId':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x58')]||null,'originChannel':_0x521b20[_0xb029('0x26')]['message'][_0xb029('0x59')]||_0xb029('0x5a'),'ChatOfflineMessageId':_0x521b20[_0xb029('0x26')]['message'][_0xb029('0x5b')]||null},{'include':[{'model':db[_0xb029('0x5c')],'as':_0xb029('0x5d')}]});})[_0xb029('0x1e')](function(_0x133e8c){_0x1a7285[_0xb029('0x13')]=_0x133e8c;if(!_0x1a7285[_0xb029('0x50')]['UserId']){return;}return db[_0xb029('0x5e')]['find']({'attributes':['id',_0xb029('0x5f')],'where':{'id':_0x1a7285[_0xb029('0x50')]['UserId']}});})[_0xb029('0x1e')](function(_0x493c86){if(_0x493c86){_0x1a7285['applications'][_0xb029('0x60')]({'id':0x0,'priority':0x0,'app':_0xb029('0x61'),'appdata':_0x493c86[_0xb029('0x5f')]+','+(_0x1a7285[_0xb029('0x34')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x1a7285[_0xb029('0x50')]['queueId']){return;}return db[_0xb029('0x62')][_0xb029('0x20')]({'attributes':['id',_0xb029('0x5f')],'where':{'id':_0x1a7285[_0xb029('0x50')]['queueId']}});})[_0xb029('0x1e')](function(_0x5849c9){if(_0x5849c9){_0x1a7285['applications'][_0xb029('0x60')]({'id':0x0,'priority':0x1,'app':_0xb029('0x63'),'appdata':_0x5849c9[_0xb029('0x5f')]+','+(_0x1a7285[_0xb029('0x34')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb029('0x64'),_0xb029('0x65'),_0x1a7285);})[_0xb029('0x1e')](function(_0xc0111b){_0x41a857(_0xc0111b);})[_0xb029('0x14')](function(_0x4969af){_0x5c7082(_0x31477a[_0xb029('0x11')](0x1f4,_0x4969af[_0xb029('0x13')]));});});}; \ No newline at end of file +var _0xbd51=['message','info','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','model','map','catch','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','List','get','omit','account','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','defaults','from','create','List\x20not\x20found','contact','messageId','generate','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inReplyTo','Contact\x20not\x20found','update','subject','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','waitForTheAssignedAgent','queueId','unshift','queue','waitForTheAssignedQueue','Start','lodash','bluebird','randomstring','ioredis','../../mysqldb','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x478873,_0x9f241f){_0x478873=_0x478873-0x0;var _0x263e5e=_0xbd51[_0x478873];return _0x263e5e;};'use strict';var _=require(_0x1bd5('0x0'));var moment=require('moment');var BPromise=require(_0x1bd5('0x1'));var rs=require(_0x1bd5('0x2'));var Redis=require(_0x1bd5('0x3'));var db=require(_0x1bd5('0x4'))['db'];var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1bd5('0x5')][_0x1bd5('0x6')]({'port':0x232c});config[_0x1bd5('0x7')]=_['defaults'](config[_0x1bd5('0x7')],{'host':_0x1bd5('0x8'),'port':0x18eb});var socket=require(_0x1bd5('0x9'))(new Redis(config[_0x1bd5('0x7')]));require(_0x1bd5('0xa'))['register'](socket);function respondWithRpcPromise(_0x36ef1a,_0x5c8e0d,_0x2bd975){return new BPromise(function(_0x28df8e,_0x3b868a){return client[_0x1bd5('0xb')](_0x36ef1a,_0x2bd975)[_0x1bd5('0xc')](function(_0x3e3d06){logger['info'](_0x1bd5('0xd'),_0x5c8e0d,'request\x20sent');logger[_0x1bd5('0xe')](_0x1bd5('0xf'),_0x5c8e0d,_0x1bd5('0x10'),JSON[_0x1bd5('0x11')](_0x3e3d06));if(_0x3e3d06[_0x1bd5('0x12')]){if(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x13')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x5c8e0d,_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);return _0x3b868a(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5c8e0d,_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);return _0x28df8e(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);}else{logger[_0x1bd5('0x15')](_0x1bd5('0xd'),_0x5c8e0d,_0x1bd5('0x10'));_0x28df8e(_0x3e3d06[_0x1bd5('0x16')][_0x1bd5('0x14')]);}})['catch'](function(_0x53ad5e){logger[_0x1bd5('0x12')](_0x1bd5('0xd'),_0x5c8e0d,_0x53ad5e);_0x3b868a(_0x53ad5e);});});}exports[_0x1bd5('0x17')]=function(_0xb95d4e){var _0x459649=this;return new Promise(function(_0x2ff39a,_0x3fbb39){return db[_0x1bd5('0x18')][_0x1bd5('0x19')]({'raw':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1b')]===undefined?!![]:![]:!![],'where':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1c')]||null:null,'attributes':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1d')]||null:null,'limit':_0xb95d4e['options']?_0xb95d4e[_0x1bd5('0x1a')]['limit']||null:null,'include':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1e')]?_['map'](_0xb95d4e[_0x1bd5('0x1a')]['include'],function(_0x2ed551){return{'model':db[_0x2ed551[_0x1bd5('0x1f')]],'as':_0x2ed551['as'],'attributes':_0x2ed551[_0x1bd5('0x1d')],'include':_0x2ed551[_0x1bd5('0x1e')]?_['map'](_0x2ed551[_0x1bd5('0x1e')],function(_0x69bb17){return{'model':db[_0x69bb17[_0x1bd5('0x1f')]],'as':_0x69bb17['as'],'attributes':_0x69bb17[_0x1bd5('0x1d')],'include':_0x69bb17['include']?_[_0x1bd5('0x20')](_0x69bb17[_0x1bd5('0x1e')],function(_0x3595e9){return{'model':db[_0x3595e9[_0x1bd5('0x1f')]],'as':_0x3595e9['as'],'attributes':_0x3595e9[_0x1bd5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1bd5('0xc')](function(_0x4e72b2){logger[_0x1bd5('0x15')](_0x1bd5('0x17'),_0xb95d4e);logger[_0x1bd5('0xe')]('GetMailAccount',_0xb95d4e,JSON[_0x1bd5('0x11')](_0x4e72b2));_0x2ff39a(_0x4e72b2);})[_0x1bd5('0x21')](function(_0x345181){logger[_0x1bd5('0x12')](_0x1bd5('0x17'),_0x345181[_0x1bd5('0x14')],_0xb95d4e);_0x3fbb39(_0x459649['error'](0x1f4,_0x345181['message']));});});};exports[_0x1bd5('0x22')]=function(_0x305126){var _0x5542aa=this;return new Promise(function(_0x36649d,_0x198b88){return db[_0x1bd5('0x18')][_0x1bd5('0x23')]({'raw':_0x305126['options']?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1b')]===undefined?!![]:![]:!![],'where':_0x305126[_0x1bd5('0x1a')]?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1c')]||null:null,'attributes':_0x305126[_0x1bd5('0x1a')]?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1d')]||null:null,'include':_0x305126['options']?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1e')]?_[_0x1bd5('0x20')](_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1e')],function(_0x18a9db){return{'model':db[_0x18a9db[_0x1bd5('0x1f')]],'as':_0x18a9db['as'],'attributes':_0x18a9db['attributes'],'include':_0x18a9db[_0x1bd5('0x1e')]?_[_0x1bd5('0x20')](_0x18a9db[_0x1bd5('0x1e')],function(_0x2f5a48){return{'model':db[_0x2f5a48[_0x1bd5('0x1f')]],'as':_0x2f5a48['as'],'attributes':_0x2f5a48[_0x1bd5('0x1d')],'include':_0x2f5a48[_0x1bd5('0x1e')]?_['map'](_0x2f5a48['include'],function(_0x155e4c){return{'model':db[_0x155e4c[_0x1bd5('0x1f')]],'as':_0x155e4c['as'],'attributes':_0x155e4c[_0x1bd5('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4595a0){if(_0x305126['options'][_0x1bd5('0x24')]===!![])_0x4595a0[_0x1bd5('0x25')](_0x1bd5('0x26'),_0x4595a0[_0x1bd5('0x27')]());logger[_0x1bd5('0x15')](_0x1bd5('0x22'),_0x305126);logger[_0x1bd5('0xe')](_0x1bd5('0x22'),_0x305126,JSON['stringify'](_0x4595a0));_0x36649d(_0x4595a0);})[_0x1bd5('0x21')](function(_0x2978d8){logger['error'](_0x1bd5('0x22'),_0x2978d8[_0x1bd5('0x14')],_0x305126);_0x198b88(_0x5542aa[_0x1bd5('0x12')](0x1f4,_0x2978d8['message']));});});};exports[_0x1bd5('0x28')]=function(_0x53482){var _0x2997a2=this;return new Promise(function(_0x4074f1,_0x4e8ff7){var _0x305720={'body':_0x53482[_0x1bd5('0x29')],'channel':_0x1bd5('0x2a')};var _0x11e996=_['difference'](_['keys'](db[_0x1bd5('0x2b')][_0x1bd5('0x2c')]),[_0x1bd5('0x2d'),'updatedAt',_0x1bd5('0x2e'),_0x1bd5('0x2f')]);var _0x574d95=![];if(_0x53482[_0x1bd5('0x29')]['id']){delete _0x53482['body']['id'];}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')]['from'])){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x31')));}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')])||_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')]===''){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x32')));}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')][_0x1bd5('0x33')])){return _0x4e8ff7(_0x2997a2['error'](0x1f4,_0x1bd5('0x34')+_0x11e996));}if(!_[_0x1bd5('0x35')](_0x11e996,_0x53482[_0x1bd5('0x29')]['mapKey'])){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x36')+_0x11e996));}var _0x5bb8a6={};_0x5bb8a6[_0x53482[_0x1bd5('0x29')]['mapKey']]=_0x53482[_0x1bd5('0x29')]['from'];return db[_0x1bd5('0x18')][_0x1bd5('0x23')]({'where':{'id':_0x53482['account']['id']},'include':[{'model':db[_0x1bd5('0x37')],'as':'List','include':[{'model':db[_0x1bd5('0x2b')],'as':_0x1bd5('0x38'),'where':_0x5bb8a6,'limit':0x1,'order':[[_0x1bd5('0x39'),_0x1bd5('0x3a')]]}]},{'model':db[_0x1bd5('0x3b')],'as':_0x1bd5('0x3c')},{'model':db[_0x1bd5('0x3d')],'as':_0x1bd5('0x3e'),'include':[{'model':db['CloudProvider'],'as':_0x1bd5('0x3f')}]}]})[_0x1bd5('0xc')](function(_0x2a1ece){if(_0x2a1ece&&_0x2a1ece[_0x1bd5('0x40')]){var _0x34452a=_0x2a1ece[_0x1bd5('0x41')]({'plain':!![]});_0x305720['account']=_[_0x1bd5('0x42')](_0x34452a,[_0x1bd5('0x3c'),_0x1bd5('0x40')]);_0x305720[_0x1bd5('0x43')][_0x1bd5('0x26')]=_0x2a1ece[_0x1bd5('0x27')]();_0x305720[_0x1bd5('0x44')]=_0x34452a['Applications'];_0x305720['list']=_0x34452a[_0x1bd5('0x40')];_0x305720[_0x1bd5('0x44')]=_[_0x1bd5('0x45')](_0x305720['applications'],[_0x1bd5('0x46')],[_0x1bd5('0x47')]);if(_0x305720[_0x1bd5('0x43')]&&_0x305720[_0x1bd5('0x43')][_0x1bd5('0x48')]){_0x305720[_0x1bd5('0x44')][_0x1bd5('0x49')]({'id':0x0,'priority':_0x305720['applications'][_0x1bd5('0x4a')]+0x1,'app':_0x1bd5('0x4b'),'appdata':'autoclose','interval':_0x1bd5('0x4c')});}if(_0x305720['account'][_0x1bd5('0x3c')]){delete _0x305720['account'][_0x1bd5('0x3c')];}if(_0x305720[_0x1bd5('0x43')]['List']){delete _0x305720[_0x1bd5('0x43')][_0x1bd5('0x40')];}if(_0x34452a[_0x1bd5('0x40')][_0x1bd5('0x38')][_0x1bd5('0x4a')]){return _0x34452a[_0x1bd5('0x40')][_0x1bd5('0x38')][0x0];}var _0x51aebe=_[_0x1bd5('0x4d')](_0x53482['body'],{'firstName':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x4e')],'ListId':_0x34452a[_0x1bd5('0x2f')]});_0x51aebe[_0x53482['body']['mapKey']]=_0x53482[_0x1bd5('0x29')][_0x1bd5('0x4e')];return db[_0x1bd5('0x2b')][_0x1bd5('0x4f')](_0x51aebe);}else{throw new Error(_0x1bd5('0x50'));}})[_0x1bd5('0xc')](function(_0x46e36c){_0x305720[_0x1bd5('0x51')]=_0x46e36c;if(_0x46e36c){if(!_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['messageId']){_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x52')]=rs[_0x1bd5('0x53')]()+'\x20'+_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x4e')];}var _0x17b3a9={'ContactId':_0x46e36c['id'],'MailAccountId':_0x53482[_0x1bd5('0x43')]['id'],'inReplyTo':_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x52')],'to':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['from'],'cc':_0x53482['body'][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['subject'],'attach':_0x53482['body'][_0x1bd5('0x14')]['attach'],'lastMsgAt':moment()[_0x1bd5('0x54')](_0x1bd5('0x55')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x1bd5('0x23')]({'where':{'closed':![],'MailAccountId':_0x53482['account']['id']},'include':[{'model':db[_0x1bd5('0x56')],'as':'Messages','attributes':[_0x1bd5('0x52')],'where':{'messageId':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x57')]}}]})[_0x1bd5('0xc')](function(_0x47ca3f){if(_0x47ca3f){return[_0x47ca3f,![]];}return db['MailInteraction'][_0x1bd5('0x4f')](_0x17b3a9)[_0x1bd5('0xc')](function(_0x1a9ad2){return[_0x1a9ad2,!![]];});});}else{throw new Error(_0x1bd5('0x58'));}})['spread'](function(_0x551f22,_0x14dd41){if(_0x551f22){_0x574d95=_0x14dd41;if(!_0x14dd41){return _0x551f22[_0x1bd5('0x59')]({'inReplyTo':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x52')],'to':_0x53482[_0x1bd5('0x29')]['message']['from'],'cc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5a')],'attach':_0x551f22['attach']?_0x551f22[_0x1bd5('0x5b')]:_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x5b')],'substatus':null,'substatusAt':moment()[_0x1bd5('0x54')](_0x1bd5('0x55')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x551f22;}}})[_0x1bd5('0xc')](function(_0x36d62e){_0x305720[_0x1bd5('0x5c')]=_0x36d62e[_0x1bd5('0x41')]({'plain':!![]});_0x305720[_0x1bd5('0x5c')][_0x1bd5('0x5d')]=_0x574d95;return db[_0x1bd5('0x56')][_0x1bd5('0x4f')]({'body':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')],'MailAccountId':_0x53482[_0x1bd5('0x43')]['id'],'MailInteractionId':_0x36d62e['id'],'direction':'in','ContactId':_0x305720[_0x1bd5('0x51')]['id'],'messageId':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x52')],'from':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x4e')],'to':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['to'],'cc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['subject'],'attach':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5b')],'Attachments':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5e')],'originTo':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x5f')],'originCc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x60')],'bcc':_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x61')],'ChatWebsiteId':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x62')]||null,'originChannel':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['originChannel']||_0x1bd5('0x63'),'ChatOfflineMessageId':_0x53482['body']['message'][_0x1bd5('0x64')]||null},{'include':[{'model':db['Attachment'],'as':_0x1bd5('0x65')}]});})[_0x1bd5('0xc')](function(_0x560f20){_0x305720[_0x1bd5('0x14')]=_0x560f20;if(!_0x305720[_0x1bd5('0x5c')][_0x1bd5('0x66')]){return;}return db[_0x1bd5('0x67')][_0x1bd5('0x23')]({'attributes':['id',_0x1bd5('0x68')],'where':{'id':_0x305720['interaction'][_0x1bd5('0x66')]}});})[_0x1bd5('0xc')](function(_0xdd5183){if(_0xdd5183){_0x305720[_0x1bd5('0x44')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xdd5183[_0x1bd5('0x68')]+','+(_0x305720[_0x1bd5('0x43')][_0x1bd5('0x69')]||0xa),'interval':_0x1bd5('0x4c')});}if(!_0x305720['interaction'][_0x1bd5('0x6a')]){return;}return db['MailQueue']['find']({'attributes':['id',_0x1bd5('0x68')],'where':{'id':_0x305720['interaction'][_0x1bd5('0x6a')]}});})[_0x1bd5('0xc')](function(_0x231556){if(_0x231556){_0x305720[_0x1bd5('0x44')][_0x1bd5('0x6b')]({'id':0x0,'priority':0x1,'app':_0x1bd5('0x6c'),'appdata':_0x231556[_0x1bd5('0x68')]+','+(_0x305720[_0x1bd5('0x43')][_0x1bd5('0x6d')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x1bd5('0x6e'),'startRouting',_0x305720);})['then'](function(_0x59b491){_0x4074f1(_0x59b491);})[_0x1bd5('0x21')](function(_0x524b86){_0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x524b86[_0x1bd5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 71b06d5..15e2877 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 _0x5d72=['remove','removeListener','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x3e29df,_0x42fdf8){var _0x3e3ba9=function(_0x47ccb0){while(--_0x47ccb0){_0x3e29df['push'](_0x3e29df['shift']());}};_0x3e3ba9(++_0x42fdf8);}(_0x5d72,0x7c));var _0x25d7=function(_0x2649e2,_0x3e73be){_0x2649e2=_0x2649e2-0x0;var _0x4797d4=_0x5d72[_0x2649e2];return _0x4797d4;};'use strict';var MailAccountEvents=require(_0x25d7('0x0'));var events=[_0x25d7('0x1'),_0x25d7('0x2'),'update'];function createListener(_0x2bf814,_0x5e716b){return function(_0x2af5a9){_0x5e716b['emit'](_0x2bf814,_0x2af5a9);};}function removeListener(_0x512ace,_0x52b98b){return function(){MailAccountEvents[_0x25d7('0x3')](_0x512ace,_0x52b98b);};}exports[_0x25d7('0x4')]=function(_0x29619f){for(var _0x1034ab=0x0,_0x14aa9f=events[_0x25d7('0x5')];_0x1034ab<_0x14aa9f;_0x1034ab++){var _0x5e1f69=events[_0x1034ab];var _0x26ae21=createListener(_0x25d7('0x6')+_0x5e1f69,_0x29619f);MailAccountEvents['on'](_0x5e1f69,_0x26ae21);}}; \ No newline at end of file +var _0xe9ee=['length','mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x582592,_0x19204e){var _0x365ce1=function(_0x2a0a73){while(--_0x2a0a73){_0x582592['push'](_0x582592['shift']());}};_0x365ce1(++_0x19204e);}(_0xe9ee,0x1e8));var _0xee9e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9ee[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require(_0xee9e('0x0'));var events=[_0xee9e('0x1'),_0xee9e('0x2'),_0xee9e('0x3')];function createListener(_0x1385ea,_0x530785){return function(_0x530190){_0x530785[_0xee9e('0x4')](_0x1385ea,_0x530190);};}function removeListener(_0xf9edb7,_0x989bd4){return function(){MailAccountEvents[_0xee9e('0x5')](_0xf9edb7,_0x989bd4);};}exports[_0xee9e('0x6')]=function(_0x33fc84){for(var _0x4820c5=0x0,_0x3c6837=events[_0xee9e('0x7')];_0x4820c5<_0x3c6837;_0x4820c5++){var _0x54ac3d=events[_0x4820c5];var _0x2718e9=createListener(_0xee9e('0x8')+_0x54ac3d,_0x33fc84);MailAccountEvents['on'](_0x54ac3d,_0x2718e9);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 1859b9d..bf078c7 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 _0xa248=['../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa248,0x172));var _0x8a24=function(_0x3a25e1,_0x5896c3){_0x3a25e1=_0x3a25e1-0x0;var _0x14a25b=_0xa248[_0x3a25e1];return _0x14a25b;};'use strict';var multer=require(_0x8a24('0x0'));var util=require(_0x8a24('0x1'));var path=require(_0x8a24('0x2'));var timeout=require(_0x8a24('0x3'));var express=require(_0x8a24('0x4'));var router=express[_0x8a24('0x5')]();var fs_extra=require(_0x8a24('0x6'));var auth=require(_0x8a24('0x7'));var interaction=require(_0x8a24('0x8'));var config=require(_0x8a24('0x9'));var controller=require(_0x8a24('0xa'));router['get'](_0x8a24('0xb'),auth[_0x8a24('0xc')](),controller[_0x8a24('0xd')]);router[_0x8a24('0xe')]('/:id',auth[_0x8a24('0xc')](),controller[_0x8a24('0xf')]);router[_0x8a24('0x10')]('/:id',auth[_0x8a24('0xc')](),controller['destroy']);module[_0x8a24('0x11')]=router; \ No newline at end of file +var _0x99b7=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailApplication.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports'];(function(_0x2ff623,_0x37499c){var _0x24efae=function(_0x30532d){while(--_0x30532d){_0x2ff623['push'](_0x2ff623['shift']());}};_0x24efae(++_0x37499c);}(_0x99b7,0x187));var _0x799b=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x99b7[_0x31a371];return _0x2a5bd6;};'use strict';var multer=require(_0x799b('0x0'));var util=require('util');var path=require(_0x799b('0x1'));var timeout=require(_0x799b('0x2'));var express=require(_0x799b('0x3'));var router=express[_0x799b('0x4')]();var fs_extra=require(_0x799b('0x5'));var auth=require(_0x799b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x799b('0x7'));router[_0x799b('0x8')]('/:id',auth[_0x799b('0x9')](),controller[_0x799b('0xa')]);router[_0x799b('0xb')](_0x799b('0xc'),auth[_0x799b('0x9')](),controller[_0x799b('0xd')]);router[_0x799b('0xe')](_0x799b('0xc'),auth[_0x799b('0x9')](),controller[_0x799b('0xf')]);module[_0x799b('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index a3d1809..b03b41a 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 _0x0746=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0x0746,0x173));var _0x6074=function(_0x54883f,_0x3f7c3a){_0x54883f=_0x54883f-0x0;var _0x3dfb29=_0x0746[_0x54883f];return _0x3dfb29;};'use strict';var Sequelize=require('sequelize');module[_0x6074('0x0')]={'priority':{'type':Sequelize[_0x6074('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6074('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6074('0x3')]()},'description':{'type':Sequelize[_0x6074('0x2')]},'interval':{'type':Sequelize[_0x6074('0x2')],'defaultValue':_0x6074('0x4')}}; \ No newline at end of file +var _0x2ffc=['INTEGER','STRING','noop','TEXT','sequelize','exports'];(function(_0x39e9c4,_0x1fcc4a){var _0x2c6ad1=function(_0x2c3b49){while(--_0x2c3b49){_0x39e9c4['push'](_0x39e9c4['shift']());}};_0x2c6ad1(++_0x1fcc4a);}(_0x2ffc,0xa0));var _0xc2ff=function(_0x3873bf,_0x1d1a56){_0x3873bf=_0x3873bf-0x0;var _0x4e66cd=_0x2ffc[_0x3873bf];return _0x4e66cd;};'use strict';var Sequelize=require(_0xc2ff('0x0'));module[_0xc2ff('0x1')]={'priority':{'type':Sequelize[_0xc2ff('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc2ff('0x3')],'allowNull':![],'defaultValue':_0xc2ff('0x4')},'appdata':{'type':Sequelize[_0xc2ff('0x5')]()},'description':{'type':Sequelize[_0xc2ff('0x3')]},'interval':{'type':Sequelize[_0xc2ff('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index fdb18c5..594526e 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x2caae5,_0x23acda){var _0x5e1f96=function(_0x218bbf){while(--_0x218bbf){_0x2caae5['push'](_0x2caae5['shift']());}};_0x5e1f96(++_0x23acda);}(_0x70e0,0x17b));var _0x070e=function(_0x2c20dc,_0x303703){_0x2c20dc=_0x2c20dc-0x0;var _0x1de700=_0x70e0[_0x2c20dc];return _0x1de700;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file +var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x1b5805,_0x1d1f54){var _0x4b0de6=function(_0x40de7b){while(--_0x40de7b){_0x1b5805['push'](_0x1b5805['shift']());}};_0x4b0de6(++_0x1d1f54);}(_0xe706,0xa3));var _0x6e70=function(_0x8eb4eb,_0xa70079){_0x8eb4eb=_0x8eb4eb-0x0;var _0x1ff8e3=_0xe706[_0x8eb4eb];return _0x1ff8e3;};'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 62e7d86..25cbc23 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 _0x4296=['mail_applications','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','rimraf','./mailApplication.attributes','exports','MailApplication'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x4296,0x70));var _0x6429=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x4296[_0x23e7c1];return _0x1add43;};'use strict';var _=require('lodash');var util=require(_0x6429('0x0'));var logger=require('../../config/logger')(_0x6429('0x1'));var moment=require(_0x6429('0x2'));var BPromise=require(_0x6429('0x3'));var rp=require(_0x6429('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6429('0x5'));var config=require('../../config/environment');var attributes=require(_0x6429('0x6'));module[_0x6429('0x7')]=function(_0x397b46,_0x8d2b6b){return _0x397b46['define'](_0x6429('0x8'),attributes,{'tableName':_0x6429('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6429('0xa')});}; \ No newline at end of file +var _0x0c1e=['./mailApplication.attributes','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x32f9ca,_0x2fa8bc){var _0x52e083=function(_0x4fd86a){while(--_0x4fd86a){_0x32f9ca['push'](_0x32f9ca['shift']());}};_0x52e083(++_0x2fa8bc);}(_0x0c1e,0x87));var _0xe0c1=function(_0x3ed830,_0x32c951){_0x3ed830=_0x3ed830-0x0;var _0x91e09f=_0x0c1e[_0x3ed830];return _0x91e09f;};'use strict';var _=require(_0xe0c1('0x0'));var util=require(_0xe0c1('0x1'));var logger=require(_0xe0c1('0x2'))(_0xe0c1('0x3'));var moment=require(_0xe0c1('0x4'));var BPromise=require(_0xe0c1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe0c1('0x6'));var config=require(_0xe0c1('0x7'));var attributes=require(_0xe0c1('0x8'));module['exports']=function(_0x282c29,_0x46b825){return _0x282c29['define'](_0xe0c1('0x9'),attributes,{'tableName':_0xe0c1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe0c1('0xb'),'collate':_0xe0c1('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 49b86fa..31c099e 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 _0xed22=['MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateMailApplication','MailApplication','body','options','where','attributes','limit','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2293da,_0x3a3686){var _0x11c5cd=function(_0x3e43f0){while(--_0x3e43f0){_0x2293da['push'](_0x2293da['shift']());}};_0x11c5cd(++_0x3a3686);}(_0xed22,0x101));var _0x2ed2=function(_0x501078,_0x5bb1e9){_0x501078=_0x501078-0x0;var _0x18eaac=_0xed22[_0x501078];return _0x18eaac;};'use strict';var _=require('lodash');var util=require(_0x2ed2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2ed2('0x1'));var fs=require('fs');var Redis=require(_0x2ed2('0x2'));var db=require(_0x2ed2('0x3'))['db'];var utils=require(_0x2ed2('0x4'));var logger=require(_0x2ed2('0x5'))(_0x2ed2('0x6'));var config=require(_0x2ed2('0x7'));var jayson=require(_0x2ed2('0x8'));var client=jayson[_0x2ed2('0x9')][_0x2ed2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd6db37,_0xd7eb08,_0x2fb359){return new BPromise(function(_0x2becf6,_0x1d0d9a){return client[_0x2ed2('0xb')](_0xd6db37,_0x2fb359)[_0x2ed2('0xc')](function(_0x69125d){logger['info'](_0x2ed2('0xd'),_0xd7eb08,_0x2ed2('0xe'));logger[_0x2ed2('0xf')](_0x2ed2('0x10'),_0xd7eb08,'request\x20sent',JSON[_0x2ed2('0x11')](_0x69125d));if(_0x69125d[_0x2ed2('0x12')]){if(_0x69125d[_0x2ed2('0x12')]['code']===0x1f4){logger[_0x2ed2('0x12')](_0x2ed2('0xd'),_0xd7eb08,_0x69125d[_0x2ed2('0x12')][_0x2ed2('0x13')]);return _0x1d0d9a(_0x69125d[_0x2ed2('0x12')][_0x2ed2('0x13')]);}logger[_0x2ed2('0x12')](_0x2ed2('0xd'),_0xd7eb08,_0x69125d['error'][_0x2ed2('0x13')]);return _0x2becf6(_0x69125d[_0x2ed2('0x12')][_0x2ed2('0x13')]);}else{logger[_0x2ed2('0x14')](_0x2ed2('0xd'),_0xd7eb08,_0x2ed2('0xe'));_0x2becf6(_0x69125d[_0x2ed2('0x15')][_0x2ed2('0x13')]);}})[_0x2ed2('0x16')](function(_0x1b7a9f){logger[_0x2ed2('0x12')](_0x2ed2('0xd'),_0xd7eb08,_0x1b7a9f);_0x1d0d9a(_0x1b7a9f);});});}exports[_0x2ed2('0x17')]=function(_0x1b5456){var _0x446644=this;return new Promise(function(_0x43e81e,_0x1d0471){return db[_0x2ed2('0x18')]['update'](_0x1b5456[_0x2ed2('0x19')],{'raw':_0x1b5456[_0x2ed2('0x1a')]?_0x1b5456['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5456[_0x2ed2('0x1a')]?_0x1b5456[_0x2ed2('0x1a')][_0x2ed2('0x1b')]||null:null,'attributes':_0x1b5456['options']?_0x1b5456[_0x2ed2('0x1a')][_0x2ed2('0x1c')]||null:null,'limit':_0x1b5456[_0x2ed2('0x1a')]?_0x1b5456['options'][_0x2ed2('0x1d')]||null:null})[_0x2ed2('0xc')](function(_0x4c0be7){logger[_0x2ed2('0x14')]('UpdateMailApplication',_0x1b5456);logger[_0x2ed2('0xf')](_0x2ed2('0x17'),_0x1b5456,JSON[_0x2ed2('0x11')](_0x4c0be7));_0x43e81e(_0x4c0be7);})[_0x2ed2('0x16')](function(_0x487978){logger['error'](_0x2ed2('0x17'),_0x487978['message'],_0x1b5456);_0x1d0471(_0x446644[_0x2ed2('0x12')](0x1f4,_0x487978[_0x2ed2('0x13')]));});});}; \ No newline at end of file +var _0xde5d=['info','result','UpdateMailApplication','MailApplication','options','where','attributes','limit','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','MailApplication,\x20%s,\x20%s','message'];(function(_0x3a0b21,_0x2645d5){var _0x555cfe=function(_0x33af4d){while(--_0x33af4d){_0x3a0b21['push'](_0x3a0b21['shift']());}};_0x555cfe(++_0x2645d5);}(_0xde5d,0x1c9));var _0xdde5=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xde5d[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0xdde5('0x0'));var moment=require(_0xdde5('0x1'));var BPromise=require(_0xdde5('0x2'));var rs=require(_0xdde5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdde5('0x4'))['db'];var utils=require(_0xdde5('0x5'));var logger=require('../../config/logger')(_0xdde5('0x6'));var config=require(_0xdde5('0x7'));var jayson=require(_0xdde5('0x8'));var client=jayson[_0xdde5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22a128,_0xc4da3b,_0x22c4cc){return new BPromise(function(_0x3488fd,_0x1e6346){return client[_0xdde5('0xa')](_0x22a128,_0x22c4cc)[_0xdde5('0xb')](function(_0x2e7ea8){logger['info']('MailApplication,\x20%s,\x20%s',_0xc4da3b,_0xdde5('0xc'));logger[_0xdde5('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0xc4da3b,_0xdde5('0xc'),JSON[_0xdde5('0xe')](_0x2e7ea8));if(_0x2e7ea8[_0xdde5('0xf')]){if(_0x2e7ea8[_0xdde5('0xf')][_0xdde5('0x10')]===0x1f4){logger[_0xdde5('0xf')](_0xdde5('0x11'),_0xc4da3b,_0x2e7ea8['error'][_0xdde5('0x12')]);return _0x1e6346(_0x2e7ea8['error'][_0xdde5('0x12')]);}logger[_0xdde5('0xf')](_0xdde5('0x11'),_0xc4da3b,_0x2e7ea8[_0xdde5('0xf')][_0xdde5('0x12')]);return _0x3488fd(_0x2e7ea8[_0xdde5('0xf')][_0xdde5('0x12')]);}else{logger[_0xdde5('0x13')]('MailApplication,\x20%s,\x20%s',_0xc4da3b,_0xdde5('0xc'));_0x3488fd(_0x2e7ea8[_0xdde5('0x14')][_0xdde5('0x12')]);}})['catch'](function(_0x3dfd8b){logger[_0xdde5('0xf')]('MailApplication,\x20%s,\x20%s',_0xc4da3b,_0x3dfd8b);_0x1e6346(_0x3dfd8b);});});}exports[_0xdde5('0x15')]=function(_0x20ee33){var _0x583a71=this;return new Promise(function(_0x441792,_0xece1d3){return db[_0xdde5('0x16')]['update'](_0x20ee33['body'],{'raw':_0x20ee33[_0xdde5('0x17')]?_0x20ee33[_0xdde5('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20ee33['options']?_0x20ee33[_0xdde5('0x17')][_0xdde5('0x18')]||null:null,'attributes':_0x20ee33[_0xdde5('0x17')]?_0x20ee33['options'][_0xdde5('0x19')]||null:null,'limit':_0x20ee33['options']?_0x20ee33[_0xdde5('0x17')][_0xdde5('0x1a')]||null:null})[_0xdde5('0xb')](function(_0xd7e96f){logger['info']('UpdateMailApplication',_0x20ee33);logger[_0xdde5('0xd')](_0xdde5('0x15'),_0x20ee33,JSON[_0xdde5('0xe')](_0xd7e96f));_0x441792(_0xd7e96f);})[_0xdde5('0x1b')](function(_0x4b0753){logger[_0xdde5('0xf')](_0xdde5('0x15'),_0x4b0753[_0xdde5('0x12')],_0x20ee33);_0xece1d3(_0x583a71[_0xdde5('0xf')](0x1f4,_0x4b0753['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 5dce772..6a8d3cb 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 _0x9bbe=['addTags','put','/:id','tracked','mail','update','mailinteraction:destroy','delete','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','mailinteraction:addtags'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x9bbe,0x64));var _0xe9bb=function(_0x341abd,_0x3cf12a){_0x341abd=_0x341abd-0x0;var _0x1db3aa=_0x9bbe[_0x341abd];return _0x1db3aa;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xe9bb('0x0'));var interaction=require(_0xe9bb('0x1'));var controller=require('./mailInteraction.controller');router[_0xe9bb('0x2')]('/',auth[_0xe9bb('0x3')](),controller['index']);router[_0xe9bb('0x2')](_0xe9bb('0x4'),auth[_0xe9bb('0x3')](),controller['describe']);router['get']('/:id',auth[_0xe9bb('0x3')](),controller[_0xe9bb('0x5')]);router[_0xe9bb('0x2')](_0xe9bb('0x6'),auth[_0xe9bb('0x3')](),controller[_0xe9bb('0x7')]);router[_0xe9bb('0x2')](_0xe9bb('0x8'),auth[_0xe9bb('0x3')](),controller[_0xe9bb('0x9')]);router[_0xe9bb('0xa')]('/',auth[_0xe9bb('0x3')](),controller[_0xe9bb('0xb')]);router['post']('/:id/messages',auth[_0xe9bb('0x3')](),controller[_0xe9bb('0xc')]);router[_0xe9bb('0xa')](_0xe9bb('0xd'),auth[_0xe9bb('0x3')](),interaction['tracked']('mail',_0xe9bb('0xe')),controller[_0xe9bb('0xf')]);router[_0xe9bb('0x10')](_0xe9bb('0x11'),auth[_0xe9bb('0x3')](),interaction[_0xe9bb('0x12')](_0xe9bb('0x13'),'mailinteraction:update'),controller[_0xe9bb('0x14')]);router['delete'](_0xe9bb('0x11'),auth['isAuthenticated'](),interaction[_0xe9bb('0x12')](_0xe9bb('0x13'),_0xe9bb('0x15')),controller['destroy']);router[_0xe9bb('0x16')]('/:id/tags',auth[_0xe9bb('0x3')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x7ba4=['delete','mailinteraction:destroy','destroy','removeTags','express','Router','../../components/interaction/service','get','/describe','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','post','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','/:id','mailinteraction:update','update'];(function(_0x4ae159,_0x59610b){var _0x2ceaa1=function(_0x386c48){while(--_0x386c48){_0x4ae159['push'](_0x4ae159['shift']());}};_0x2ceaa1(++_0x59610b);}(_0x7ba4,0xc4));var _0x47ba=function(_0x1b4fa4,_0x2faafb){_0x1b4fa4=_0x1b4fa4-0x0;var _0x2a20d3=_0x7ba4[_0x1b4fa4];return _0x2a20d3;};'use strict';var express=require(_0x47ba('0x0'));var router=express[_0x47ba('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x47ba('0x2'));var controller=require('./mailInteraction.controller');router[_0x47ba('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0x47ba('0x3')](_0x47ba('0x4'),auth[_0x47ba('0x5')](),controller[_0x47ba('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x47ba('0x7')]);router[_0x47ba('0x3')](_0x47ba('0x8'),auth['isAuthenticated'](),controller[_0x47ba('0x9')]);router['get'](_0x47ba('0xa'),auth[_0x47ba('0x5')](),controller['download']);router[_0x47ba('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x47ba('0x8'),auth[_0x47ba('0x5')](),controller['addMessage']);router['post'](_0x47ba('0xc'),auth[_0x47ba('0x5')](),interaction[_0x47ba('0xd')](_0x47ba('0xe'),_0x47ba('0xf')),controller[_0x47ba('0x10')]);router['put'](_0x47ba('0x11'),auth[_0x47ba('0x5')](),interaction['tracked'](_0x47ba('0xe'),_0x47ba('0x12')),controller[_0x47ba('0x13')]);router[_0x47ba('0x14')](_0x47ba('0x11'),auth[_0x47ba('0x5')](),interaction['tracked'](_0x47ba('0xe'),_0x47ba('0x15')),controller[_0x47ba('0x16')]);router[_0x47ba('0x14')](_0x47ba('0xc'),auth['isAuthenticated'](),controller[_0x47ba('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index d81f3ca..8550672 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 _0xc615=['DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN'];(function(_0x3e0a2c,_0x351c1f){var _0x3f13ff=function(_0x246a1d){while(--_0x246a1d){_0x3e0a2c['push'](_0x3e0a2c['shift']());}};_0x3f13ff(++_0x351c1f);}(_0xc615,0x1dc));var _0x5c61=function(_0x4ac24c,_0x2791b9){_0x4ac24c=_0x4ac24c-0x0;var _0x3961b0=_0xc615[_0x4ac24c];return _0x3961b0;};'use strict';var Sequelize=require(_0x5c61('0x0'));var iconv=require(_0x5c61('0x1'));module[_0x5c61('0x2')]={'closed':{'type':Sequelize[_0x5c61('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5c61('0x4')]},'disposition':{'type':Sequelize[_0x5c61('0x5')]},'secondDisposition':{'type':Sequelize[_0x5c61('0x5')]},'thirdDisposition':{'type':Sequelize[_0x5c61('0x5')]},'note':{'type':Sequelize[_0x5c61('0x5')]},'inReplyTo':{'type':Sequelize[_0x5c61('0x5')](0x1fe)},'to':{'type':Sequelize[_0x5c61('0x5')]},'cc':{'type':Sequelize[_0x5c61('0x6')](_0x5c61('0x7'))},'subject':{'type':Sequelize[_0x5c61('0x6')]()},'attach':{'type':Sequelize[_0x5c61('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x5c61('0x4')]},'substatus':{'type':Sequelize[_0x5c61('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x5c61('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x5c61('0x8')]('in',_0x5c61('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5c61('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x4736=['INTEGER','sequelize','iconv','exports','BOOLEAN','STRING','TEXT','long','DATE','ENUM'];(function(_0x4816c4,_0x719dc4){var _0x5cedae=function(_0x1cee9e){while(--_0x1cee9e){_0x4816c4['push'](_0x4816c4['shift']());}};_0x5cedae(++_0x719dc4);}(_0x4736,0x137));var _0x6473=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4736[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6473('0x0'));var iconv=require(_0x6473('0x1'));module[_0x6473('0x2')]={'closed':{'type':Sequelize[_0x6473('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6473('0x4')]},'secondDisposition':{'type':Sequelize[_0x6473('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6473('0x4')]},'note':{'type':Sequelize[_0x6473('0x4')]},'inReplyTo':{'type':Sequelize[_0x6473('0x4')](0x1fe)},'to':{'type':Sequelize[_0x6473('0x4')]},'cc':{'type':Sequelize[_0x6473('0x5')](_0x6473('0x6'))},'subject':{'type':Sequelize[_0x6473('0x5')]()},'attach':{'type':Sequelize[_0x6473('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x6473('0x7')]},'firstMsgDirection':{'type':Sequelize[_0x6473('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6473('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6473('0x9')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 01e502a..fdb413c 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 _0xfbaa=['body','destroy','describe','addMessage','ids','omit','getMessages','findOne','MailMessage','hasOwnProperty','sort','where','pick','MailInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','files','attachments','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','decode','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','util','path','juice','../../components/interaction/service','../../components/parsers/qs','../../config/environment','../../mysqldb','html-entities','defaults','redis','localhost','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','update','then','error','stack','name','send','index','map','MailInteraction','rawAttributes','fieldName','type','getOptions','findAll','mail','query','user','params','keys','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create'];(function(_0x17e05b,_0x66e4e5){var _0x5cc4b6=function(_0x25a799){while(--_0x25a799){_0x17e05b['push'](_0x17e05b['shift']());}};_0x5cc4b6(++_0x66e4e5);}(_0xfbaa,0x18b));var _0xafba=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xfbaa[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0xafba('0x0'));var rimraf=require(_0xafba('0x1'));var zipdir=require(_0xafba('0x2'));var moment=require(_0xafba('0x3'));var BPromise=require('bluebird');var util=require(_0xafba('0x4'));var path=require(_0xafba('0x5'));var fs=require('fs');var _=require('lodash');var juice=require(_0xafba('0x6'));var Redis=require('ioredis');var interaction=require(_0xafba('0x7'));var qs=require(_0xafba('0x8'));var logger=require('../../config/logger')('api');var config=require(_0xafba('0x9'));var db=require(_0xafba('0xa'))['db'];var htmlEntities=require(_0xafba('0xb'));config['redis']=_[_0xafba('0xc')](config[_0xafba('0xd')],{'host':_0xafba('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xafba('0xd')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x159d3b,_0x4ea48e){_0x4ea48e=_0x4ea48e||0xcc;return function(_0x51ed2a){if(_0x51ed2a){return _0x159d3b[_0xafba('0xf')](_0x4ea48e);}return _0x159d3b['status'](_0x4ea48e)[_0xafba('0x10')]();};}function respondWithResult(_0x58434c,_0x3bc9f6){_0x3bc9f6=_0x3bc9f6||0xc8;return function(_0x5e1e9e){if(_0x5e1e9e){return _0x58434c[_0xafba('0x11')](_0x3bc9f6)[_0xafba('0x12')](_0x5e1e9e);}};}function respondWithFilteredResult(_0x3d648d,_0x2ee008){return function(_0x2ccfd1){if(_0x2ccfd1){var _0x59ad8e=typeof _0x2ee008['offset']==='undefined'&&typeof _0x2ee008['limit']===_0xafba('0x13');var _0x525c26=_0x2ccfd1[_0xafba('0x14')];var _0x10540d=_0x59ad8e?0x0:_0x2ee008[_0xafba('0x15')];var _0x372596=_0x59ad8e?_0x2ccfd1[_0xafba('0x14')]:_0x2ee008['offset']+_0x2ee008[_0xafba('0x16')];var _0x1c7b34;if(_0x372596>=_0x525c26){_0x372596=_0x525c26;_0x1c7b34=0xc8;}else{_0x1c7b34=0xce;}_0x3d648d[_0xafba('0x11')](_0x1c7b34);return _0x3d648d[_0xafba('0x17')](_0xafba('0x18'),_0x10540d+'-'+_0x372596+'/'+_0x525c26)[_0xafba('0x12')](_0x2ccfd1);}return null;};}function saveUpdates(_0x4533f3){return function(_0x4964bd){if(_0x4964bd){return _0x4964bd[_0xafba('0x19')](_0x4533f3)[_0xafba('0x1a')](function(_0x590994){return _0x590994;});}return null;};}function removeEntity(_0x50304f){return function(_0x4481e0){if(_0x4481e0){return _0x4481e0['destroy']()[_0xafba('0x1a')](function(){_0x50304f[_0xafba('0x11')](0xcc)[_0xafba('0x10')]();});}};}function handleEntityNotFound(_0x4f7669){return function(_0x494b58){if(!_0x494b58){_0x4f7669[_0xafba('0xf')](0x194);}return _0x494b58;};}function handleError(_0x96c974,_0x3bd1bb){_0x3bd1bb=_0x3bd1bb||0x1f4;return function(_0x11fd1e){logger[_0xafba('0x1b')](_0x11fd1e[_0xafba('0x1c')]);if(_0x11fd1e['name']){delete _0x11fd1e[_0xafba('0x1d')];}_0x96c974[_0xafba('0x11')](_0x3bd1bb)[_0xafba('0x1e')](_0x11fd1e);};}exports[_0xafba('0x1f')]=function(_0x304ab8,_0x12783e){var _0x4d4838={};var _0x24c39c=_[_0xafba('0x20')](db[_0xafba('0x21')][_0xafba('0x22')],function(_0x12a492){return{'name':_0x12a492[_0xafba('0x23')],'type':_0x12a492[_0xafba('0x24')]['key']};});_0x4d4838=qs[_0xafba('0x25')](_0x24c39c,_0x304ab8);return interaction[_0xafba('0x26')](_0xafba('0x27'),_0x304ab8[_0xafba('0x28')],_0x304ab8[_0xafba('0x29')],_0x4d4838,_0x24c39c)[_0xafba('0x1a')](respondWithFilteredResult(_0x12783e,_0x4d4838))['catch'](handleError(_0x12783e,null));};exports['show']=function(_0x19012b,_0x2d7e9d){var _0x406296={'raw':![],'where':{'id':_0x19012b[_0xafba('0x2a')]['id']}},_0xd6fe59={};_0xd6fe59['model']=_[_0xafba('0x2b')](db[_0xafba('0x21')][_0xafba('0x22')]);_0xd6fe59['query']=_[_0xafba('0x2b')](_0x19012b[_0xafba('0x28')]);_0xd6fe59[_0xafba('0x2c')]=_['intersection'](_0xd6fe59[_0xafba('0x2d')],_0xd6fe59[_0xafba('0x28')]);_0x406296[_0xafba('0x2e')]=_[_0xafba('0x2f')](_0xd6fe59[_0xafba('0x2d')],qs['fields'](_0x19012b[_0xafba('0x28')][_0xafba('0x30')]));_0x406296[_0xafba('0x2e')]=_0x406296[_0xafba('0x2e')][_0xafba('0x31')]?_0x406296[_0xafba('0x2e')]:_0xd6fe59[_0xafba('0x2d')];if(_0x19012b[_0xafba('0x28')][_0xafba('0x32')]){_0x406296[_0xafba('0x33')]=[{'all':!![]}];}_0x406296=_[_0xafba('0x34')]({},_0x406296,_0x19012b[_0xafba('0x35')]);return db[_0xafba('0x21')][_0xafba('0x36')](_0x406296)[_0xafba('0x1a')](handleEntityNotFound(_0x2d7e9d,null))[_0xafba('0x1a')](respondWithResult(_0x2d7e9d,null))[_0xafba('0x37')](handleError(_0x2d7e9d,null));};exports['create']=function(_0x31ef5c,_0x3dd757){return db[_0xafba('0x21')][_0xafba('0x38')](_0x31ef5c[_0xafba('0x39')],{})['then'](respondWithResult(_0x3dd757,0xc9))[_0xafba('0x37')](handleError(_0x3dd757,null));};exports['update']=function(_0x52ffac,_0xbb48ba){if(_0x52ffac[_0xafba('0x39')]['id']){delete _0x52ffac[_0xafba('0x39')]['id'];}return db['MailInteraction'][_0xafba('0x36')]({'where':{'id':_0x52ffac[_0xafba('0x2a')]['id']}})[_0xafba('0x1a')](handleEntityNotFound(_0xbb48ba,null))[_0xafba('0x1a')](saveUpdates(_0x52ffac['body'],null))[_0xafba('0x1a')](respondWithResult(_0xbb48ba,null))[_0xafba('0x37')](handleError(_0xbb48ba,null));};exports[_0xafba('0x3a')]=function(_0x1ee5b8,_0x8aff40){return db['MailInteraction'][_0xafba('0x36')]({'where':{'id':_0x1ee5b8['params']['id']}})[_0xafba('0x1a')](handleEntityNotFound(_0x8aff40,null))[_0xafba('0x1a')](removeEntity(_0x8aff40,null))[_0xafba('0x37')](handleError(_0x8aff40,null));};exports[_0xafba('0x3b')]=function(_0x3ab1d7,_0x3dcd6a){return db['MailInteraction'][_0xafba('0x3b')]()[_0xafba('0x1a')](respondWithResult(_0x3dcd6a,null))[_0xafba('0x37')](handleError(_0x3dcd6a,null));};exports['addMessage']=function(_0x595be5,_0x3bb4dc){return db['MailMessage']['find']({'where':{'id':_0x595be5[_0xafba('0x2a')]['id']}})[_0xafba('0x1a')](handleEntityNotFound(_0x3bb4dc,null))['then'](function(_0x58ef95){if(_0x58ef95){return _0x58ef95[_0xafba('0x3c')](_0x595be5[_0xafba('0x39')][_0xafba('0x3d')],_[_0xafba('0x3e')](_0x595be5[_0xafba('0x39')],[_0xafba('0x3d'),'id'])||{});}})[_0xafba('0x1a')](respondWithResult(_0x3bb4dc,null))['catch'](handleError(_0x3bb4dc,null));};exports[_0xafba('0x3f')]=function(_0xf615f2,_0x4fe707){var _0x5777e4={'raw':![],'where':{}};var _0x5e4acf={};var _0x1eeef3={'count':0x0,'rows':[]};return db[_0xafba('0x21')][_0xafba('0x40')]({'where':{'id':_0xf615f2[_0xafba('0x2a')]['id']}})[_0xafba('0x1a')](handleEntityNotFound(_0x4fe707,null))[_0xafba('0x1a')](function(_0x1c4e90){if(_0x1c4e90){_0x5e4acf[_0xafba('0x2d')]=_[_0xafba('0x2b')](db[_0xafba('0x41')][_0xafba('0x22')]);_0x5e4acf['query']=_[_0xafba('0x2b')](_0xf615f2[_0xafba('0x28')]);_0x5e4acf[_0xafba('0x2c')]=_['intersection'](_0x5e4acf[_0xafba('0x2d')],_0x5e4acf[_0xafba('0x28')]);_0x5777e4[_0xafba('0x2e')]=_[_0xafba('0x2f')](_0x5e4acf[_0xafba('0x2d')],qs['fields'](_0xf615f2[_0xafba('0x28')]['fields']));_0x5777e4[_0xafba('0x2e')]=_0x5777e4[_0xafba('0x2e')]['length']?_0x5777e4[_0xafba('0x2e')]:_0x5e4acf['model'];if(!_0xf615f2[_0xafba('0x28')][_0xafba('0x42')]('nolimit')){_0x5777e4[_0xafba('0x16')]=qs['limit'](_0xf615f2['query'][_0xafba('0x16')]);_0x5777e4[_0xafba('0x15')]=qs[_0xafba('0x15')](_0xf615f2['query'][_0xafba('0x15')]);}_0x5777e4['order']=qs[_0xafba('0x43')](_0xf615f2[_0xafba('0x28')][_0xafba('0x43')]);_0x5777e4[_0xafba('0x44')]=qs[_0xafba('0x2c')](_[_0xafba('0x45')](_0xf615f2[_0xafba('0x28')],_0x5e4acf[_0xafba('0x2c')]));_0x5777e4['where'][_0xafba('0x46')]=_0x1c4e90['id'];if(_0xf615f2[_0xafba('0x28')][_0xafba('0x47')]){_0x5777e4[_0xafba('0x44')]=_[_0xafba('0x34')](_0x5777e4['where'],{'$or':_[_0xafba('0x20')](_0x5777e4[_0xafba('0x2e')],function(_0x52cc58){var _0xee790b={};_0xee790b[_0x52cc58]={'$like':'%'+_0xf615f2[_0xafba('0x28')]['filter']+'%'};return _0xee790b;})});}if(_0xf615f2[_0xafba('0x28')][_0xafba('0x48')]){var _0x4adfb8=_0xf615f2[_0xafba('0x28')][_0xafba('0x48')]['split'](',');var _0xf7512d={};_0xf7512d[_0x4adfb8[0x0]]={'$gte':moment(_0x4adfb8[0x1])['format'](_0xafba('0x49'))};_0x5777e4[_0xafba('0x44')]=_[_0xafba('0x34')](_0x5777e4[_0xafba('0x44')],_0xf7512d);}_0x5777e4=_['merge']({},_0x5777e4,_0xf615f2[_0xafba('0x35')]);return db[_0xafba('0x41')][_0xafba('0x14')]({'where':_0x5777e4['where']})[_0xafba('0x1a')](function(_0x47dddc){_0x1eeef3[_0xafba('0x14')]=_0x47dddc;if(_0xf615f2[_0xafba('0x28')]['includeAll']){_0x5777e4[_0xafba('0x33')]=[{'all':!![]}];}return db[_0xafba('0x41')][_0xafba('0x26')](_0x5777e4);})[_0xafba('0x1a')](function(_0x31daab){if(_0xf615f2[_0xafba('0x28')]['inlineCss']==='true'){for(var _0xe33761=0x0;_0xe33761<_0x31daab['length'];_0xe33761++){_0x31daab[_0xe33761][_0xafba('0x39')]=juice(_0x31daab[_0xe33761]['body']);}}_0x1eeef3[_0xafba('0x4a')]=_0x31daab;return _0x1eeef3;});}})['then'](respondWithFilteredResult(_0x4fe707,_0x5777e4))[_0xafba('0x37')](handleError(_0x4fe707,null));};exports[_0xafba('0x4b')]=function(_0x372731,_0x339028){return db[_0xafba('0x21')][_0xafba('0x36')]({'where':{'id':_0x372731[_0xafba('0x2a')]['id']}})['then'](handleEntityNotFound(_0x339028,null))[_0xafba('0x1a')](function(_0x25b13b){if(_0x25b13b){return _0x25b13b[_0xafba('0x4c')](_0x372731['body'][_0xafba('0x3d')],_[_0xafba('0x3e')](_0x372731[_0xafba('0x39')],['ids','id'])||{})[_0xafba('0x4d')](function(){return db[_0xafba('0x4e')][_0xafba('0x26')]({'attributes':['id',_0xafba('0x1d'),_0xafba('0x4f')],'where':{'id':_0x372731[_0xafba('0x39')]['ids']}});})[_0xafba('0x1a')](function(_0x3e2d59){socket[_0xafba('0x50')]('mailInteractionTags:save',{'id':Number(_0x372731[_0xafba('0x2a')]['id']),'tags':_0x3e2d59||[]});return{'id':Number(_0x372731[_0xafba('0x2a')]['id']),'tags':_0x3e2d59||[]};});}})[_0xafba('0x1a')](respondWithResult(_0x339028,null))['catch'](handleError(_0x339028,null));};exports[_0xafba('0x51')]=function(_0x3e228e,_0xe48230){return db[_0xafba('0x21')]['find']({'where':{'id':_0x3e228e[_0xafba('0x2a')]['id']}})[_0xafba('0x1a')](handleEntityNotFound(_0xe48230,null))['then'](function(_0x2a4da4){if(_0x2a4da4){return _0x2a4da4[_0xafba('0x51')](_0x3e228e[_0xafba('0x28')][_0xafba('0x3d')]);}})[_0xafba('0x1a')](respondWithStatusCode(_0xe48230,null))[_0xafba('0x37')](handleError(_0xe48230,null));};exports[_0xafba('0x52')]=function(_0x394736,_0x274f66){var _0x18db10=moment()[_0xafba('0x53')]()[_0xafba('0x54')]();var _0x2a60ae=path[_0xafba('0x55')](config[_0xafba('0x56')],_0xafba('0x57'),'files','tmp');var _0x53c1fe=path['join'](config[_0xafba('0x56')],'server',_0xafba('0x58'),_0xafba('0x59'));var _0x4a7d5b=path['join'](_0x2a60ae,_0x18db10);var _0x5cbf70=util['format']('transcript-%d-%s.zip',_0x394736['params']['id'],_0x18db10);var _0x6b2c15=path['join'](_0x2a60ae,_0x5cbf70);var _0x47f2b3=[];if(_0x394736[_0xafba('0x28')][_0xafba('0x59')]){_0x47f2b3[_0xafba('0x5a')]({'model':db[_0xafba('0x5b')],'as':_0xafba('0x5c'),'raw':!![]});}var _0x28faae=[{'model':db[_0xafba('0x41')],'as':_0xafba('0x5d'),'attributes':['id',_0xafba('0x39'),_0xafba('0x5e'),'to','cc',_0xafba('0x5f'),_0xafba('0x60'),_0xafba('0x61')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x47f2b3}];return db[_0xafba('0x21')][_0xafba('0x36')]({'where':{'id':_0x394736['params']['id']},'include':_0x28faae})[_0xafba('0x1a')](handleEntityNotFound(_0x274f66,null))[_0xafba('0x1a')](function(_0x1d7df4){if(_0x1d7df4&&_0x1d7df4[_0xafba('0x5d')]){var _0x3b0182=_0x1d7df4[_0xafba('0x62')]({'plain':!![]});fs[_0xafba('0x63')](_0x4a7d5b);return BPromise[_0xafba('0x64')](_0x3b0182[_0xafba('0x5d')],function(_0x19c009,_0x4bee00){var _0x559106={'from':_0x19c009[_0xafba('0x5e')],'to':_0x19c009['to']||_0xafba('0x65'),'subject':_0x19c009[_0xafba('0x60')],'html':htmlEntities[_0xafba('0x66')](_0x19c009[_0xafba('0x39')]),'headers':{'Date':moment(_0x19c009[_0xafba('0x61')])[_0xafba('0x67')](_0xafba('0x68'))},'attachments':[]};if(_0x19c009['cc']){_0x559106['headers']['Cc']=_0x19c009['cc'];}if(_0x19c009['bcc']){_0x559106[_0xafba('0x69')][_0xafba('0x6a')]=_0x19c009[_0xafba('0x5f')];}return new BPromise(function(_0x386948,_0x4e6e75){if(_0x19c009['Attachments']){for(var _0x4559b3=0x0;_0x4559b3<_0x19c009[_0xafba('0x5c')]['length'];_0x4559b3++){var _0x485ab4=_0x19c009[_0xafba('0x5c')][_0x4559b3];var _0x5d5a66=path[_0xafba('0x55')](_0x53c1fe,_0x485ab4[_0xafba('0x6b')]);if(fs['existsSync'](_0x5d5a66)){_0x559106[_0xafba('0x59')][_0xafba('0x5a')]({'name':_0x485ab4[_0xafba('0x1d')],'contentType':_0x485ab4['type'],'data':fs[_0xafba('0x6c')](_0x5d5a66)});}}}emlformat[_0xafba('0x6d')](_0x559106,function(_0x1f977d,_0x260e15){if(_0x1f977d)return _0x4e6e75(_0x1f977d);fs[_0xafba('0x6e')](path[_0xafba('0x55')](_0x4a7d5b,util[_0xafba('0x67')](_0xafba('0x6f'),_0x4bee00)),_0x260e15);return _0x386948(_0x260e15);});});})[_0xafba('0x1a')](function(){return new BPromise(function(_0x192f49,_0x4946ff){zipdir(_0x4a7d5b,{'saveTo':_0x6b2c15},function(_0x452e40,_0x524cdb){if(_0x452e40)return _0x4946ff(_0x452e40);return _0x192f49(_0x524cdb);});})[_0xafba('0x1a')](function(){return new BPromise(function(_0x4670ba,_0x22c756){rimraf(_0x4a7d5b,function(_0xbcbd17){if(_0xbcbd17)_0x22c756(_0xbcbd17);return _0x4670ba();});});})[_0xafba('0x1a')](function(){return _0x274f66['download'](_0x6b2c15,_0x5cbf70,function(_0x526802){if(!_0x526802)fs[_0xafba('0x70')](_0x6b2c15);});});});}else{return _0x274f66[_0xafba('0xf')](0xc8);}})[_0xafba('0x37')](handleError(_0x274f66,null));}; \ No newline at end of file +var _0xeac9=['limit','set','Content-Range','then','destroy','error','stack','name','type','key','getOptions','findAll','user','catch','show','params','keys','MailInteraction','rawAttributes','filters','intersection','model','query','attributes','length','include','options','find','create','body','update','describe','addMessage','MailMessage','ids','omit','fields','hasOwnProperty','nolimit','order','sort','pick','where','MailInteractionId','filter','merge','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','includeAll','inlineCss','rows','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','toString','join','root','files','tmp','server','attachments','push','Attachment','Attachments','Messages','from','bcc','subject','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','format','message%d.eml','download','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','juice','../../components/parsers/qs','../../config/logger','api','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','offset'];(function(_0x30cf7e,_0x3c1063){var _0x4d0bd6=function(_0x351c3a){while(--_0x351c3a){_0x30cf7e['push'](_0x30cf7e['shift']());}};_0x4d0bd6(++_0x3c1063);}(_0xeac9,0x1a4));var _0x9eac=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xeac9[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require(_0x9eac('0x0'));var rimraf=require(_0x9eac('0x1'));var zipdir=require(_0x9eac('0x2'));var moment=require(_0x9eac('0x3'));var BPromise=require(_0x9eac('0x4'));var util=require(_0x9eac('0x5'));var path=require(_0x9eac('0x6'));var fs=require('fs');var _=require(_0x9eac('0x7'));var juice=require(_0x9eac('0x8'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x9eac('0x9'));var logger=require(_0x9eac('0xa'))(_0x9eac('0xb'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x9eac('0xc'));config[_0x9eac('0xd')]=_[_0x9eac('0xe')](config[_0x9eac('0xd')],{'host':_0x9eac('0xf'),'port':0x18eb});var socket=require(_0x9eac('0x10'))(new Redis(config[_0x9eac('0xd')]));require(_0x9eac('0x11'))[_0x9eac('0x12')](socket);function respondWithStatusCode(_0x22f22d,_0xd6afbc){_0xd6afbc=_0xd6afbc||0xcc;return function(_0x1d7bce){if(_0x1d7bce){return _0x22f22d[_0x9eac('0x13')](_0xd6afbc);}return _0x22f22d['status'](_0xd6afbc)[_0x9eac('0x14')]();};}function respondWithResult(_0x564490,_0x5d582f){_0x5d582f=_0x5d582f||0xc8;return function(_0x520b7e){if(_0x520b7e){return _0x564490[_0x9eac('0x15')](_0x5d582f)[_0x9eac('0x16')](_0x520b7e);}};}function respondWithFilteredResult(_0x436241,_0x2da860){return function(_0x305733){if(_0x305733){var _0x3d3af5=typeof _0x2da860[_0x9eac('0x17')]==='undefined'&&typeof _0x2da860[_0x9eac('0x18')]==='undefined';var _0x1cec38=_0x305733['count'];var _0x1d7b3a=_0x3d3af5?0x0:_0x2da860[_0x9eac('0x17')];var _0x5952e8=_0x3d3af5?_0x305733['count']:_0x2da860[_0x9eac('0x17')]+_0x2da860['limit'];var _0x3d1386;if(_0x5952e8>=_0x1cec38){_0x5952e8=_0x1cec38;_0x3d1386=0xc8;}else{_0x3d1386=0xce;}_0x436241[_0x9eac('0x15')](_0x3d1386);return _0x436241[_0x9eac('0x19')](_0x9eac('0x1a'),_0x1d7b3a+'-'+_0x5952e8+'/'+_0x1cec38)[_0x9eac('0x16')](_0x305733);}return null;};}function saveUpdates(_0x289da6){return function(_0x4c2ced){if(_0x4c2ced){return _0x4c2ced['update'](_0x289da6)[_0x9eac('0x1b')](function(_0x2c0437){return _0x2c0437;});}return null;};}function removeEntity(_0x413866){return function(_0x29b1aa){if(_0x29b1aa){return _0x29b1aa[_0x9eac('0x1c')]()['then'](function(){_0x413866[_0x9eac('0x15')](0xcc)[_0x9eac('0x14')]();});}};}function handleEntityNotFound(_0x1b21b6){return function(_0x561f27){if(!_0x561f27){_0x1b21b6[_0x9eac('0x13')](0x194);}return _0x561f27;};}function handleError(_0x4d9445,_0x284643){_0x284643=_0x284643||0x1f4;return function(_0x54e688){logger[_0x9eac('0x1d')](_0x54e688[_0x9eac('0x1e')]);if(_0x54e688[_0x9eac('0x1f')]){delete _0x54e688[_0x9eac('0x1f')];}_0x4d9445[_0x9eac('0x15')](_0x284643)['send'](_0x54e688);};}exports['index']=function(_0x3aaecb,_0xe0acc0){var _0x17b816={};var _0x50a932=_['map'](db['MailInteraction']['rawAttributes'],function(_0x4cf7b8){return{'name':_0x4cf7b8['fieldName'],'type':_0x4cf7b8[_0x9eac('0x20')][_0x9eac('0x21')]};});_0x17b816=qs[_0x9eac('0x22')](_0x50a932,_0x3aaecb);return interaction[_0x9eac('0x23')]('mail',_0x3aaecb['query'],_0x3aaecb[_0x9eac('0x24')],_0x17b816,_0x50a932)[_0x9eac('0x1b')](respondWithFilteredResult(_0xe0acc0,_0x17b816))[_0x9eac('0x25')](handleError(_0xe0acc0,null));};exports[_0x9eac('0x26')]=function(_0x1673e8,_0x439945){var _0x53104b={'raw':![],'where':{'id':_0x1673e8[_0x9eac('0x27')]['id']}},_0x84daf2={};_0x84daf2['model']=_[_0x9eac('0x28')](db[_0x9eac('0x29')][_0x9eac('0x2a')]);_0x84daf2['query']=_['keys'](_0x1673e8['query']);_0x84daf2[_0x9eac('0x2b')]=_[_0x9eac('0x2c')](_0x84daf2[_0x9eac('0x2d')],_0x84daf2[_0x9eac('0x2e')]);_0x53104b['attributes']=_[_0x9eac('0x2c')](_0x84daf2[_0x9eac('0x2d')],qs['fields'](_0x1673e8[_0x9eac('0x2e')]['fields']));_0x53104b[_0x9eac('0x2f')]=_0x53104b[_0x9eac('0x2f')][_0x9eac('0x30')]?_0x53104b[_0x9eac('0x2f')]:_0x84daf2['model'];if(_0x1673e8['query']['includeAll']){_0x53104b[_0x9eac('0x31')]=[{'all':!![]}];}_0x53104b=_['merge']({},_0x53104b,_0x1673e8[_0x9eac('0x32')]);return db['MailInteraction'][_0x9eac('0x33')](_0x53104b)[_0x9eac('0x1b')](handleEntityNotFound(_0x439945,null))['then'](respondWithResult(_0x439945,null))[_0x9eac('0x25')](handleError(_0x439945,null));};exports[_0x9eac('0x34')]=function(_0x4beee4,_0x3f63b1){return db[_0x9eac('0x29')][_0x9eac('0x34')](_0x4beee4[_0x9eac('0x35')],{})['then'](respondWithResult(_0x3f63b1,0xc9))[_0x9eac('0x25')](handleError(_0x3f63b1,null));};exports[_0x9eac('0x36')]=function(_0x2aaa67,_0x642943){if(_0x2aaa67[_0x9eac('0x35')]['id']){delete _0x2aaa67[_0x9eac('0x35')]['id'];}return db[_0x9eac('0x29')][_0x9eac('0x33')]({'where':{'id':_0x2aaa67[_0x9eac('0x27')]['id']}})['then'](handleEntityNotFound(_0x642943,null))[_0x9eac('0x1b')](saveUpdates(_0x2aaa67[_0x9eac('0x35')],null))[_0x9eac('0x1b')](respondWithResult(_0x642943,null))[_0x9eac('0x25')](handleError(_0x642943,null));};exports[_0x9eac('0x1c')]=function(_0x545ef9,_0x4a6602){return db['MailInteraction']['find']({'where':{'id':_0x545ef9[_0x9eac('0x27')]['id']}})['then'](handleEntityNotFound(_0x4a6602,null))[_0x9eac('0x1b')](removeEntity(_0x4a6602,null))[_0x9eac('0x25')](handleError(_0x4a6602,null));};exports[_0x9eac('0x37')]=function(_0x297e09,_0x21d634){return db[_0x9eac('0x29')][_0x9eac('0x37')]()[_0x9eac('0x1b')](respondWithResult(_0x21d634,null))['catch'](handleError(_0x21d634,null));};exports[_0x9eac('0x38')]=function(_0x121a21,_0x2dda24){return db[_0x9eac('0x39')]['find']({'where':{'id':_0x121a21[_0x9eac('0x27')]['id']}})[_0x9eac('0x1b')](handleEntityNotFound(_0x2dda24,null))[_0x9eac('0x1b')](function(_0x57a96b){if(_0x57a96b){return _0x57a96b[_0x9eac('0x38')](_0x121a21[_0x9eac('0x35')][_0x9eac('0x3a')],_[_0x9eac('0x3b')](_0x121a21[_0x9eac('0x35')],[_0x9eac('0x3a'),'id'])||{});}})[_0x9eac('0x1b')](respondWithResult(_0x2dda24,null))[_0x9eac('0x25')](handleError(_0x2dda24,null));};exports['getMessages']=function(_0x12c704,_0x87d1b4){var _0x2e4b71={'raw':![],'where':{}};var _0x39e867={};var _0x191552={'count':0x0,'rows':[]};return db[_0x9eac('0x29')]['findOne']({'where':{'id':_0x12c704[_0x9eac('0x27')]['id']}})[_0x9eac('0x1b')](handleEntityNotFound(_0x87d1b4,null))[_0x9eac('0x1b')](function(_0x75523a){if(_0x75523a){_0x39e867[_0x9eac('0x2d')]=_[_0x9eac('0x28')](db['MailMessage'][_0x9eac('0x2a')]);_0x39e867[_0x9eac('0x2e')]=_[_0x9eac('0x28')](_0x12c704[_0x9eac('0x2e')]);_0x39e867[_0x9eac('0x2b')]=_[_0x9eac('0x2c')](_0x39e867[_0x9eac('0x2d')],_0x39e867[_0x9eac('0x2e')]);_0x2e4b71[_0x9eac('0x2f')]=_[_0x9eac('0x2c')](_0x39e867[_0x9eac('0x2d')],qs['fields'](_0x12c704[_0x9eac('0x2e')][_0x9eac('0x3c')]));_0x2e4b71[_0x9eac('0x2f')]=_0x2e4b71[_0x9eac('0x2f')]['length']?_0x2e4b71[_0x9eac('0x2f')]:_0x39e867['model'];if(!_0x12c704[_0x9eac('0x2e')][_0x9eac('0x3d')](_0x9eac('0x3e'))){_0x2e4b71[_0x9eac('0x18')]=qs[_0x9eac('0x18')](_0x12c704[_0x9eac('0x2e')][_0x9eac('0x18')]);_0x2e4b71[_0x9eac('0x17')]=qs['offset'](_0x12c704['query'][_0x9eac('0x17')]);}_0x2e4b71[_0x9eac('0x3f')]=qs[_0x9eac('0x40')](_0x12c704[_0x9eac('0x2e')][_0x9eac('0x40')]);_0x2e4b71['where']=qs[_0x9eac('0x2b')](_[_0x9eac('0x41')](_0x12c704['query'],_0x39e867[_0x9eac('0x2b')]));_0x2e4b71[_0x9eac('0x42')][_0x9eac('0x43')]=_0x75523a['id'];if(_0x12c704['query'][_0x9eac('0x44')]){_0x2e4b71[_0x9eac('0x42')]=_[_0x9eac('0x45')](_0x2e4b71['where'],{'$or':_[_0x9eac('0x46')](_0x2e4b71[_0x9eac('0x2f')],function(_0x13a540){var _0x4ac8d1={};_0x4ac8d1[_0x13a540]={'$like':'%'+_0x12c704['query']['filter']+'%'};return _0x4ac8d1;})});}if(_0x12c704['query'][_0x9eac('0x47')]){var _0x5eb419=_0x12c704[_0x9eac('0x2e')][_0x9eac('0x47')][_0x9eac('0x48')](',');var _0x3e4c41={};_0x3e4c41[_0x5eb419[0x0]]={'$gte':moment(_0x5eb419[0x1])['format'](_0x9eac('0x49'))};_0x2e4b71[_0x9eac('0x42')]=_[_0x9eac('0x45')](_0x2e4b71[_0x9eac('0x42')],_0x3e4c41);}_0x2e4b71=_[_0x9eac('0x45')]({},_0x2e4b71,_0x12c704[_0x9eac('0x32')]);return db[_0x9eac('0x39')][_0x9eac('0x4a')]({'where':_0x2e4b71[_0x9eac('0x42')]})['then'](function(_0x176310){_0x191552[_0x9eac('0x4a')]=_0x176310;if(_0x12c704[_0x9eac('0x2e')][_0x9eac('0x4b')]){_0x2e4b71[_0x9eac('0x31')]=[{'all':!![]}];}return db[_0x9eac('0x39')][_0x9eac('0x23')](_0x2e4b71);})[_0x9eac('0x1b')](function(_0xdce0b7){if(_0x12c704[_0x9eac('0x2e')][_0x9eac('0x4c')]==='true'){for(var _0x17baf6=0x0;_0x17baf6<_0xdce0b7['length'];_0x17baf6++){_0xdce0b7[_0x17baf6][_0x9eac('0x35')]=juice(_0xdce0b7[_0x17baf6]['body']);}}_0x191552[_0x9eac('0x4d')]=_0xdce0b7;return _0x191552;});}})[_0x9eac('0x1b')](respondWithFilteredResult(_0x87d1b4,_0x2e4b71))[_0x9eac('0x25')](handleError(_0x87d1b4,null));};exports[_0x9eac('0x4e')]=function(_0x51c996,_0x2e7123){return db[_0x9eac('0x29')]['find']({'where':{'id':_0x51c996[_0x9eac('0x27')]['id']}})[_0x9eac('0x1b')](handleEntityNotFound(_0x2e7123,null))[_0x9eac('0x1b')](function(_0x54a70f){if(_0x54a70f){return _0x54a70f[_0x9eac('0x4f')](_0x51c996[_0x9eac('0x35')][_0x9eac('0x3a')],_[_0x9eac('0x3b')](_0x51c996[_0x9eac('0x35')],[_0x9eac('0x3a'),'id'])||{})[_0x9eac('0x50')](function(){return db['Tag'][_0x9eac('0x23')]({'attributes':['id',_0x9eac('0x1f'),_0x9eac('0x51')],'where':{'id':_0x51c996['body']['ids']}});})[_0x9eac('0x1b')](function(_0x225cd9){socket[_0x9eac('0x52')](_0x9eac('0x53'),{'id':Number(_0x51c996[_0x9eac('0x27')]['id']),'tags':_0x225cd9||[]});return{'id':Number(_0x51c996[_0x9eac('0x27')]['id']),'tags':_0x225cd9||[]};});}})[_0x9eac('0x1b')](respondWithResult(_0x2e7123,null))[_0x9eac('0x25')](handleError(_0x2e7123,null));};exports[_0x9eac('0x54')]=function(_0x57df18,_0x591d18){return db[_0x9eac('0x29')]['find']({'where':{'id':_0x57df18[_0x9eac('0x27')]['id']}})['then'](handleEntityNotFound(_0x591d18,null))[_0x9eac('0x1b')](function(_0x38a85b){if(_0x38a85b){return _0x38a85b['removeTags'](_0x57df18[_0x9eac('0x2e')][_0x9eac('0x3a')]);}})[_0x9eac('0x1b')](respondWithStatusCode(_0x591d18,null))[_0x9eac('0x25')](handleError(_0x591d18,null));};exports['download']=function(_0xbeaffa,_0x280ebc){var _0x273a72=moment()['unix']()[_0x9eac('0x55')]();var _0xbf0ed6=path[_0x9eac('0x56')](config[_0x9eac('0x57')],'server',_0x9eac('0x58'),_0x9eac('0x59'));var _0x551332=path[_0x9eac('0x56')](config[_0x9eac('0x57')],_0x9eac('0x5a'),_0x9eac('0x58'),_0x9eac('0x5b'));var _0x208216=path[_0x9eac('0x56')](_0xbf0ed6,_0x273a72);var _0x24a595=util['format']('transcript-%d-%s.zip',_0xbeaffa[_0x9eac('0x27')]['id'],_0x273a72);var _0x5392fa=path[_0x9eac('0x56')](_0xbf0ed6,_0x24a595);var _0x76e864=[];if(_0xbeaffa[_0x9eac('0x2e')][_0x9eac('0x5b')]){_0x76e864[_0x9eac('0x5c')]({'model':db[_0x9eac('0x5d')],'as':_0x9eac('0x5e'),'raw':!![]});}var _0x2d4022=[{'model':db[_0x9eac('0x39')],'as':_0x9eac('0x5f'),'attributes':['id',_0x9eac('0x35'),_0x9eac('0x60'),'to','cc',_0x9eac('0x61'),_0x9eac('0x62'),'createdAt'],'where':{'secret':![]},'order':qs[_0x9eac('0x40')]('id'),'include':_0x76e864}];return db[_0x9eac('0x29')][_0x9eac('0x33')]({'where':{'id':_0xbeaffa[_0x9eac('0x27')]['id']},'include':_0x2d4022})[_0x9eac('0x1b')](handleEntityNotFound(_0x280ebc,null))[_0x9eac('0x1b')](function(_0x7c036d){if(_0x7c036d&&_0x7c036d[_0x9eac('0x5f')]){var _0x11b97a=_0x7c036d['get']({'plain':!![]});fs[_0x9eac('0x63')](_0x208216);return BPromise[_0x9eac('0x64')](_0x11b97a[_0x9eac('0x5f')],function(_0x3e5531,_0x3519c6){var _0x393ecf={'from':_0x3e5531[_0x9eac('0x60')],'to':_0x3e5531['to']||'missing.recipient@your.company.com','subject':_0x3e5531['subject'],'html':htmlEntities[_0x9eac('0x65')](_0x3e5531[_0x9eac('0x35')]),'headers':{'Date':moment(_0x3e5531['createdAt'])['format'](_0x9eac('0x66'))},'attachments':[]};if(_0x3e5531['cc']){_0x393ecf['headers']['Cc']=_0x3e5531['cc'];}if(_0x3e5531['bcc']){_0x393ecf[_0x9eac('0x67')][_0x9eac('0x68')]=_0x3e5531[_0x9eac('0x61')];}return new BPromise(function(_0x3adf9e,_0x58278f){if(_0x3e5531[_0x9eac('0x5e')]){for(var _0x1d62b7=0x0;_0x1d62b7<_0x3e5531[_0x9eac('0x5e')]['length'];_0x1d62b7++){var _0x297f5f=_0x3e5531['Attachments'][_0x1d62b7];var _0xf1f7d7=path['join'](_0x551332,_0x297f5f['basename']);if(fs[_0x9eac('0x69')](_0xf1f7d7)){_0x393ecf['attachments']['push']({'name':_0x297f5f[_0x9eac('0x1f')],'contentType':_0x297f5f['type'],'data':fs[_0x9eac('0x6a')](_0xf1f7d7)});}}}emlformat['build'](_0x393ecf,function(_0x514398,_0x403548){if(_0x514398)return _0x58278f(_0x514398);fs['writeFileSync'](path[_0x9eac('0x56')](_0x208216,util[_0x9eac('0x6b')](_0x9eac('0x6c'),_0x3519c6)),_0x403548);return _0x3adf9e(_0x403548);});});})[_0x9eac('0x1b')](function(){return new BPromise(function(_0x53cd1f,_0x2a3330){zipdir(_0x208216,{'saveTo':_0x5392fa},function(_0x32ce97,_0x4527e6){if(_0x32ce97)return _0x2a3330(_0x32ce97);return _0x53cd1f(_0x4527e6);});})[_0x9eac('0x1b')](function(){return new BPromise(function(_0x2a9925,_0x14ae55){rimraf(_0x208216,function(_0x5c7d07){if(_0x5c7d07)_0x14ae55(_0x5c7d07);return _0x2a9925();});});})['then'](function(){return _0x280ebc[_0x9eac('0x6d')](_0x5392fa,_0x24a595,function(_0x10f099){if(!_0x10f099)fs[_0x9eac('0x6e')](_0x5392fa);});});});}else{return _0x280ebc[_0x9eac('0x13')](0xc8);}})[_0x9eac('0x25')](handleError(_0x280ebc,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a596f26..847b8a9 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 _0x3da7=['../../mysqldb','save','update','getUsers','then','setDataValue','Users','map','findAll','emit','hook','exports','events','MailInteraction'];(function(_0xc6302c,_0x1a1513){var _0x472f1b=function(_0x53a574){while(--_0x53a574){_0xc6302c['push'](_0xc6302c['shift']());}};_0x472f1b(++_0x1a1513);}(_0x3da7,0x8a));var _0x73da=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x3da7[_0x1344d6];return _0xf45b24;};'use strict';var EventEmitter=require(_0x73da('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x73da('0x1')];var MailMessage=require(_0x73da('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x73da('0x3'),'afterUpdate':_0x73da('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3ce34a){return function(_0x56e566,_0x208e6e,_0x210b22){_0x56e566[_0x73da('0x5')]({'attributes':['id'],'raw':!![]})[_0x73da('0x6')](function(_0x2866b6){_0x56e566[_0x73da('0x7')](_0x73da('0x8'),_0x2866b6[_0x73da('0x9')](function(_0x21faeb){return{'id':_0x21faeb['id']};}));return MailMessage[_0x73da('0xa')]({'where':{'MailInteractionId':_0x56e566['id'],'direction':'in','read':![]},'raw':!![]});})[_0x73da('0x6')](function(_0x2f64b3){_0x56e566[_0x73da('0x7')]('unreadMessages',_0x2f64b3['length']);MailInteractionEvents[_0x73da('0xb')](_0x3ce34a+':'+_0x56e566['id'],_0x56e566);MailInteractionEvents[_0x73da('0xb')](_0x3ce34a,_0x56e566);_0x210b22(null);})['catch'](_0x210b22(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x73da('0xc')](e,emitEvent(event));}}module[_0x73da('0xd')]=MailInteractionEvents; \ No newline at end of file +var _0xce75=['emit','catch','hasOwnProperty','exports','events','../../mysqldb','MailInteraction','MailMessage','update','then','findAll'];(function(_0x254c09,_0x380e02){var _0x318703=function(_0x4ee91b){while(--_0x4ee91b){_0x254c09['push'](_0x254c09['shift']());}};_0x318703(++_0x380e02);}(_0xce75,0x9e));var _0x5ce7=function(_0x2ff664,_0x36115d){_0x2ff664=_0x2ff664-0x0;var _0x5476b7=_0xce75[_0x2ff664];return _0x5476b7;};'use strict';var EventEmitter=require(_0x5ce7('0x0'));var MailInteraction=require(_0x5ce7('0x1'))['db'][_0x5ce7('0x2')];var MailMessage=require(_0x5ce7('0x1'))['db'][_0x5ce7('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5ce7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x35cb18){return function(_0x30e004,_0x56c486,_0x200aff){_0x30e004['getUsers']({'attributes':['id'],'raw':!![]})[_0x5ce7('0x5')](function(_0x3bdb93){_0x30e004['setDataValue']('Users',_0x3bdb93['map'](function(_0x386d46){return{'id':_0x386d46['id']};}));return MailMessage[_0x5ce7('0x6')]({'where':{'MailInteractionId':_0x30e004['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x344459){_0x30e004['setDataValue']('unreadMessages',_0x344459['length']);MailInteractionEvents[_0x5ce7('0x7')](_0x35cb18+':'+_0x30e004['id'],_0x30e004);MailInteractionEvents['emit'](_0x35cb18,_0x30e004);_0x200aff(null);})[_0x5ce7('0x8')](_0x200aff(null));};}for(var e in events){if(events[_0x5ce7('0x9')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x5ce7('0xa')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index b38caae..f67e5e0 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 _0xbcec=['substatus','models','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','mail_interactions','fti_mail_interactions','FULLTEXT','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xbcec,0x121));var _0xcbce=function(_0xd2af37,_0x417656){_0xd2af37=_0xd2af37-0x0;var _0x3eefcf=_0xbcec[_0xd2af37];return _0x3eefcf;};'use strict';var _=require(_0xcbce('0x0'));var util=require(_0xcbce('0x1'));var logger=require(_0xcbce('0x2'))(_0xcbce('0x3'));var moment=require(_0xcbce('0x4'));var BPromise=require('bluebird');var rp=require(_0xcbce('0x5'));var fs=require('fs');var path=require(_0xcbce('0x6'));var rimraf=require('rimraf');var config=require(_0xcbce('0x7'));var attributes=require(_0xcbce('0x8'));module[_0xcbce('0x9')]=function(_0x2d9276,_0x1cb101){return _0x2d9276['define']('MailInteraction',attributes,{'tableName':_0xcbce('0xa'),'paranoid':![],'indexes':[{'name':_0xcbce('0xb'),'fields':['subject','to'],'type':_0xcbce('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x489c03,_0x40da4d,_0x58ce5c){if(_0x489c03['substatus']){_0x489c03[_0xcbce('0xd')]=moment()[_0xcbce('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x489c03[_0xcbce('0xf')]){_0x489c03[_0xcbce('0x10')]=moment()[_0xcbce('0xe')](_0xcbce('0x11'));}_0x58ce5c(null,_0x40da4d);},'beforeUpdate':function(_0x238abd,_0x3ec05f,_0x40b617){if(_0x238abd[_0xcbce('0x12')](_0xcbce('0x13'))){_0x238abd[_0xcbce('0xd')]=_0x238abd[_0xcbce('0x13')]?moment()[_0xcbce('0xe')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x238abd['changed'](_0xcbce('0xf'))){_0x238abd[_0xcbce('0x10')]=moment()[_0xcbce('0xe')](_0xcbce('0x11'));_0x238abd[_0xcbce('0x13')]=null;_0x238abd[_0xcbce('0xd')]=null;}_0x40b617(null,_0x238abd);},'afterUpdate':function(_0x4b9ef9,_0x442ff1,_0x422a0d){var _0x4c1f2e=_0x2d9276[_0xcbce('0x14')];var _0x34669b=_0x4b9ef9[_0xcbce('0x15')]({'plain':!![]});if(_0x34669b['closed']){return _0x4c1f2e[_0xcbce('0x16')][_0xcbce('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x34669b['id']}})[_0xcbce('0x18')](function(){_0x422a0d();})[_0xcbce('0x19')](function(_0x1e2f48){_0x422a0d(_0x1e2f48);});}else{_0x422a0d();}}},'charset':_0xcbce('0x1a'),'collate':_0xcbce('0x1b')});}; \ No newline at end of file +var _0x4993=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','define','mail_interactions','FULLTEXT','substatus','substatusAt','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','closed','models','get','MailMessage','update','then','utf8mb4_unicode_ci','lodash','util'];(function(_0x51ce3d,_0x4773ef){var _0x3921f0=function(_0x5e86d3){while(--_0x5e86d3){_0x51ce3d['push'](_0x51ce3d['shift']());}};_0x3921f0(++_0x4773ef);}(_0x4993,0x12a));var _0x3499=function(_0x87667f,_0x2fa934){_0x87667f=_0x87667f-0x0;var _0x1c162b=_0x4993[_0x87667f];return _0x1c162b;};'use strict';var _=require(_0x3499('0x0'));var util=require(_0x3499('0x1'));var logger=require(_0x3499('0x2'))(_0x3499('0x3'));var moment=require('moment');var BPromise=require(_0x3499('0x4'));var rp=require(_0x3499('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3499('0x6'));var config=require(_0x3499('0x7'));var attributes=require(_0x3499('0x8'));module['exports']=function(_0x37ac30,_0x204b51){return _0x37ac30[_0x3499('0x9')]('MailInteraction',attributes,{'tableName':_0x3499('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x3499('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xb0223c,_0x58bc23,_0x1ee210){if(_0xb0223c[_0x3499('0xc')]){_0xb0223c[_0x3499('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0xb0223c['closed']){_0xb0223c[_0x3499('0xe')]=moment()[_0x3499('0xf')](_0x3499('0x10'));}_0x1ee210(null,_0x58bc23);},'beforeUpdate':function(_0x210fdf,_0x1abf47,_0x4c1cde){if(_0x210fdf[_0x3499('0x11')](_0x3499('0xc'))){_0x210fdf['substatusAt']=_0x210fdf[_0x3499('0xc')]?moment()['format'](_0x3499('0x10')):null;}if(_0x210fdf[_0x3499('0x11')](_0x3499('0x12'))){_0x210fdf[_0x3499('0xe')]=moment()[_0x3499('0xf')](_0x3499('0x10'));_0x210fdf[_0x3499('0xc')]=null;_0x210fdf[_0x3499('0xd')]=null;}_0x4c1cde(null,_0x210fdf);},'afterUpdate':function(_0x291c03,_0x3f2905,_0x183f32){var _0x279c87=_0x37ac30[_0x3499('0x13')];var _0x3b1621=_0x291c03[_0x3499('0x14')]({'plain':!![]});if(_0x3b1621[_0x3499('0x12')]){return _0x279c87[_0x3499('0x15')][_0x3499('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x3b1621['id']}})[_0x3499('0x17')](function(){_0x183f32();})['catch'](function(_0x9e3ee5){_0x183f32(_0x9e3ee5);});}else{_0x183f32();}}},'charset':'utf8mb4','collate':_0x3499('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 1b98e07..565df5c 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 _0x6a52=['MailInteraction,\x20%s,\x20%s','info','result','catch','UpdateMailInteraction','MailInteraction','options','attributes','AddTagsToMailInteraction','where','body','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6a52,0x189));var _0x26a5=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x6a52[_0x5ce15c];return _0x36e4f5;};'use strict';var _=require(_0x26a5('0x0'));var util=require(_0x26a5('0x1'));var moment=require(_0x26a5('0x2'));var BPromise=require(_0x26a5('0x3'));var rs=require(_0x26a5('0x4'));var fs=require('fs');var Redis=require(_0x26a5('0x5'));var db=require(_0x26a5('0x6'))['db'];var utils=require(_0x26a5('0x7'));var logger=require(_0x26a5('0x8'))(_0x26a5('0x9'));var config=require('../../config/environment');var jayson=require(_0x26a5('0xa'));var client=jayson[_0x26a5('0xb')][_0x26a5('0xc')]({'port':0x232a});config[_0x26a5('0xd')]=_[_0x26a5('0xe')](config['redis'],{'host':_0x26a5('0xf'),'port':0x18eb});var socket=require(_0x26a5('0x10'))(new Redis(config[_0x26a5('0xd')]));require('./mailInteraction.socket')[_0x26a5('0x11')](socket);function respondWithRpcPromise(_0xd52fa9,_0x52cd47,_0x527f51){return new BPromise(function(_0x13f14d,_0x4aab48){return client[_0x26a5('0x12')](_0xd52fa9,_0x527f51)[_0x26a5('0x13')](function(_0x23fcbb){logger['info']('MailInteraction,\x20%s,\x20%s',_0x52cd47,_0x26a5('0x14'));logger[_0x26a5('0x15')](_0x26a5('0x16'),_0x52cd47,_0x26a5('0x14'),JSON[_0x26a5('0x17')](_0x23fcbb));if(_0x23fcbb['error']){if(_0x23fcbb[_0x26a5('0x18')][_0x26a5('0x19')]===0x1f4){logger[_0x26a5('0x18')]('MailInteraction,\x20%s,\x20%s',_0x52cd47,_0x23fcbb['error'][_0x26a5('0x1a')]);return _0x4aab48(_0x23fcbb['error'][_0x26a5('0x1a')]);}logger[_0x26a5('0x18')](_0x26a5('0x1b'),_0x52cd47,_0x23fcbb[_0x26a5('0x18')][_0x26a5('0x1a')]);return _0x13f14d(_0x23fcbb[_0x26a5('0x18')][_0x26a5('0x1a')]);}else{logger[_0x26a5('0x1c')](_0x26a5('0x1b'),_0x52cd47,_0x26a5('0x14'));_0x13f14d(_0x23fcbb[_0x26a5('0x1d')][_0x26a5('0x1a')]);}})[_0x26a5('0x1e')](function(_0x28b9ee){logger['error'](_0x26a5('0x1b'),_0x52cd47,_0x28b9ee);_0x4aab48(_0x28b9ee);});});}exports[_0x26a5('0x1f')]=function(_0x59912f){var _0x160012=this;return new Promise(function(_0x78a972,_0x25b585){return db[_0x26a5('0x20')]['update'](_0x59912f['body'],{'raw':_0x59912f[_0x26a5('0x21')]?_0x59912f[_0x26a5('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59912f['options']?_0x59912f[_0x26a5('0x21')]['where']||null:null,'attributes':_0x59912f[_0x26a5('0x21')]?_0x59912f[_0x26a5('0x21')][_0x26a5('0x22')]||null:null,'limit':_0x59912f[_0x26a5('0x21')]?_0x59912f[_0x26a5('0x21')]['limit']||null:null})[_0x26a5('0x13')](function(_0x5220bd){logger[_0x26a5('0x1c')](_0x26a5('0x1f'),_0x59912f);logger[_0x26a5('0x15')](_0x26a5('0x1f'),_0x59912f,JSON[_0x26a5('0x17')](_0x5220bd));_0x78a972(_0x5220bd);})[_0x26a5('0x1e')](function(_0x1d2a27){logger[_0x26a5('0x18')](_0x26a5('0x1f'),_0x1d2a27['message'],_0x59912f);_0x25b585(_0x160012[_0x26a5('0x18')](0x1f4,_0x1d2a27['message']));});});};exports[_0x26a5('0x23')]=function(_0x490431){return new Promise(function(_0x3d5aaa,_0x165654){return db[_0x26a5('0x20')]['find']({'where':_0x490431['options']?_0x490431[_0x26a5('0x21')][_0x26a5('0x24')]||null:null})[_0x26a5('0x13')](function(_0x1d6dc7){if(_0x1d6dc7){return _0x1d6dc7['addTags'](_0x490431[_0x26a5('0x25')]['ids'],_[_0x26a5('0x26')](_0x490431[_0x26a5('0x25')],[_0x26a5('0x27'),'id'])||{});}})[_0x26a5('0x28')](function(_0x4dab80){logger[_0x26a5('0x1c')]('AddTags',_0x490431);logger[_0x26a5('0x15')](_0x26a5('0x29'),_0x490431,JSON['stringify'](_0x4dab80));_0x3d5aaa(_0x4dab80);})['catch'](function(_0x46f6c7){logger[_0x26a5('0x18')](_0x26a5('0x29'),_0x46f6c7[_0x26a5('0x1a')],_0x490431);_0x165654(_this['error'](0x1f4,_0x46f6c7['message']));});});}; \ No newline at end of file +var _0xa94b=['attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','find','then','addTags','omit','ids','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','./mailInteraction.socket','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','MailInteraction','update','body','options','raw','where'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa94b,0x130));var _0xba94=function(_0x29955b,_0x5044a8){_0x29955b=_0x29955b-0x0;var _0x559d04=_0xa94b[_0x29955b];return _0x559d04;};'use strict';var _=require(_0xba94('0x0'));var util=require(_0xba94('0x1'));var moment=require(_0xba94('0x2'));var BPromise=require(_0xba94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba94('0x4'));var db=require(_0xba94('0x5'))['db'];var utils=require(_0xba94('0x6'));var logger=require(_0xba94('0x7'))(_0xba94('0x8'));var config=require('../../config/environment');var jayson=require(_0xba94('0x9'));var client=jayson[_0xba94('0xa')]['http']({'port':0x232a});config['redis']=_[_0xba94('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba94('0xc')]));require(_0xba94('0xd'))[_0xba94('0xe')](socket);function respondWithRpcPromise(_0x1a8e21,_0x464010,_0x2afe48){return new BPromise(function(_0x15a1f8,_0x10ead6){return client[_0xba94('0xf')](_0x1a8e21,_0x2afe48)['then'](function(_0x2a0f2e){logger['info'](_0xba94('0x10'),_0x464010,_0xba94('0x11'));logger[_0xba94('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x464010,_0xba94('0x11'),JSON[_0xba94('0x13')](_0x2a0f2e));if(_0x2a0f2e[_0xba94('0x14')]){if(_0x2a0f2e['error'][_0xba94('0x15')]===0x1f4){logger[_0xba94('0x14')](_0xba94('0x10'),_0x464010,_0x2a0f2e[_0xba94('0x14')][_0xba94('0x16')]);return _0x10ead6(_0x2a0f2e[_0xba94('0x14')][_0xba94('0x16')]);}logger[_0xba94('0x14')](_0xba94('0x10'),_0x464010,_0x2a0f2e[_0xba94('0x14')][_0xba94('0x16')]);return _0x15a1f8(_0x2a0f2e[_0xba94('0x14')][_0xba94('0x16')]);}else{logger[_0xba94('0x17')](_0xba94('0x10'),_0x464010,_0xba94('0x11'));_0x15a1f8(_0x2a0f2e[_0xba94('0x18')][_0xba94('0x16')]);}})[_0xba94('0x19')](function(_0xafef8d){logger[_0xba94('0x14')]('MailInteraction,\x20%s,\x20%s',_0x464010,_0xafef8d);_0x10ead6(_0xafef8d);});});}exports['UpdateMailInteraction']=function(_0x23aa43){var _0xd51c6d=this;return new Promise(function(_0x3cb2da,_0x3573df){return db[_0xba94('0x1a')][_0xba94('0x1b')](_0x23aa43[_0xba94('0x1c')],{'raw':_0x23aa43['options']?_0x23aa43[_0xba94('0x1d')][_0xba94('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23aa43[_0xba94('0x1d')]?_0x23aa43[_0xba94('0x1d')][_0xba94('0x1f')]||null:null,'attributes':_0x23aa43[_0xba94('0x1d')]?_0x23aa43['options'][_0xba94('0x20')]||null:null,'limit':_0x23aa43[_0xba94('0x1d')]?_0x23aa43['options'][_0xba94('0x21')]||null:null})['then'](function(_0xfd2ab2){logger[_0xba94('0x17')](_0xba94('0x22'),_0x23aa43);logger[_0xba94('0x12')](_0xba94('0x22'),_0x23aa43,JSON['stringify'](_0xfd2ab2));_0x3cb2da(_0xfd2ab2);})[_0xba94('0x19')](function(_0x4eb50f){logger[_0xba94('0x14')](_0xba94('0x22'),_0x4eb50f[_0xba94('0x16')],_0x23aa43);_0x3573df(_0xd51c6d['error'](0x1f4,_0x4eb50f[_0xba94('0x16')]));});});};exports[_0xba94('0x23')]=function(_0x2061fc){return new Promise(function(_0x2d7553,_0xbbd598){return db[_0xba94('0x1a')][_0xba94('0x24')]({'where':_0x2061fc['options']?_0x2061fc[_0xba94('0x1d')]['where']||null:null})[_0xba94('0x25')](function(_0x14c7dc){if(_0x14c7dc){return _0x14c7dc[_0xba94('0x26')](_0x2061fc[_0xba94('0x1c')]['ids'],_[_0xba94('0x27')](_0x2061fc['body'],[_0xba94('0x28'),'id'])||{});}})['spread'](function(_0x551c2b){logger[_0xba94('0x17')](_0xba94('0x29'),_0x2061fc);logger[_0xba94('0x12')](_0xba94('0x29'),_0x2061fc,JSON[_0xba94('0x13')](_0x551c2b));_0x2d7553(_0x551c2b);})['catch'](function(_0x3a0aab){logger[_0xba94('0x14')](_0xba94('0x29'),_0x3a0aab[_0xba94('0x16')],_0x2061fc);_0xbbd598(_this[_0xba94('0x14')](0x1f4,_0x3a0aab[_0xba94('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index f1cc187..05298ae 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 _0x294a=['removeListener','register','length','save','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x294a,0x73));var _0xa294=function(_0x183b21,_0x271b8e){_0x183b21=_0x183b21-0x0;var _0x4dbe1b=_0x294a[_0x183b21];return _0x4dbe1b;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xa294('0x0'),_0xa294('0x1'),_0xa294('0x2')];function createListener(_0x8a1c42,_0x39a131){return function(_0x3799b7){_0x39a131[_0xa294('0x3')](_0x8a1c42,_0x3799b7);};}function removeListener(_0x4e8564,_0x3d1fc4){return function(){MailInteractionEvents[_0xa294('0x4')](_0x4e8564,_0x3d1fc4);};}exports[_0xa294('0x5')]=function(_0xb05650){for(var _0x11a825=0x0,_0x5e9132=events[_0xa294('0x6')];_0x11a825<_0x5e9132;_0x11a825++){var _0x942deb=events[_0x11a825];var _0x32b36b=createListener('mailInteraction:'+_0x942deb,_0xb05650);MailInteractionEvents['on'](_0x942deb,_0x32b36b);}}; \ No newline at end of file +var _0xef0e=['update','removeListener','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x582e57,_0x85fded){var _0xfef0e6=function(_0x4b78be){while(--_0x4b78be){_0x582e57['push'](_0x582e57['shift']());}};_0xfef0e6(++_0x85fded);}(_0xef0e,0x101));var _0xeef0=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xef0e[_0x413feb];return _0x40ee88;};'use strict';var MailInteractionEvents=require(_0xeef0('0x0'));var events=[_0xeef0('0x1'),'remove',_0xeef0('0x2')];function createListener(_0x895b0f,_0x112686){return function(_0x2ef7d0){_0x112686['emit'](_0x895b0f,_0x2ef7d0);};}function removeListener(_0x3a05d4,_0x4a3b7f){return function(){MailInteractionEvents[_0xeef0('0x3')](_0x3a05d4,_0x4a3b7f);};}exports[_0xeef0('0x4')]=function(_0x19669c){for(var _0x1e1927=0x0,_0x42c86b=events[_0xeef0('0x5')];_0x1e1927<_0x42c86b;_0x1e1927++){var _0x2a731b=events[_0x1e1927];var _0x5eb665=createListener(_0xeef0('0x6')+_0x2a731b,_0x19669c);MailInteractionEvents['on'](_0x2a731b,_0x5eb665);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 3a3b0c5..c6d58f3 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 _0x1a83=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','post','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports'];(function(_0x5de505,_0xee5804){var _0x1df98e=function(_0x80f4e5){while(--_0x80f4e5){_0x5de505['push'](_0x5de505['shift']());}};_0x1df98e(++_0xee5804);}(_0x1a83,0x1c0));var _0x31a8=function(_0x4287df,_0x347e1b){_0x4287df=_0x4287df-0x0;var _0x4dd842=_0x1a83[_0x4287df];return _0x4dd842;};'use strict';var multer=require(_0x31a8('0x0'));var util=require(_0x31a8('0x1'));var path=require(_0x31a8('0x2'));var timeout=require('connect-timeout');var express=require(_0x31a8('0x3'));var router=express['Router']();var fs_extra=require(_0x31a8('0x4'));var auth=require(_0x31a8('0x5'));var interaction=require(_0x31a8('0x6'));var config=require(_0x31a8('0x7'));var controller=require('./mailMessage.controller');router['get']('/',auth[_0x31a8('0x8')](),controller[_0x31a8('0x9')]);router[_0x31a8('0xa')](_0x31a8('0xb'),auth[_0x31a8('0x8')](),controller[_0x31a8('0xc')]);router[_0x31a8('0xa')](_0x31a8('0xd'),auth[_0x31a8('0x8')](),controller[_0x31a8('0xe')]);router['get'](_0x31a8('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x31a8('0x10')]('/',auth[_0x31a8('0x8')](),interaction['tracked'](_0x31a8('0x11'),_0x31a8('0x12')),controller[_0x31a8('0x13')]);router[_0x31a8('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x31a8('0x15')]);router['put'](_0x31a8('0x16'),auth['isAuthenticated'](),controller[_0x31a8('0x17')]);router[_0x31a8('0x14')](_0x31a8('0x18'),auth['isAuthenticated'](),controller[_0x31a8('0x19')]);router[_0x31a8('0x1a')]('/:id',auth[_0x31a8('0x8')](),controller['destroy']);module[_0x31a8('0x1b')]=router; \ No newline at end of file +var _0x21c9=['put','update','accept','/:id/reject','reject','exports','multer','util','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','tracked','mail','mailmessage:create','create'];(function(_0xbcac26,_0x1f0df5){var _0xc45acb=function(_0x5f9d3d){while(--_0x5f9d3d){_0xbcac26['push'](_0xbcac26['shift']());}};_0xc45acb(++_0x1f0df5);}(_0x21c9,0x19e));var _0x921c=function(_0x2bb4fb,_0x167c1f){_0x2bb4fb=_0x2bb4fb-0x0;var _0x298adf=_0x21c9[_0x2bb4fb];return _0x298adf;};'use strict';var multer=require(_0x921c('0x0'));var util=require(_0x921c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x921c('0x2'));var auth=require(_0x921c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x921c('0x4'));var controller=require(_0x921c('0x5'));router[_0x921c('0x6')]('/',auth[_0x921c('0x7')](),controller['index']);router[_0x921c('0x6')](_0x921c('0x8'),auth['isAuthenticated'](),controller[_0x921c('0x9')]);router[_0x921c('0x6')](_0x921c('0xa'),auth['isAuthenticated'](),controller[_0x921c('0xb')]);router['get'](_0x921c('0xc'),auth[_0x921c('0x7')](),controller[_0x921c('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x921c('0xe')](_0x921c('0xf'),_0x921c('0x10')),controller[_0x921c('0x11')]);router[_0x921c('0x12')](_0x921c('0xa'),auth[_0x921c('0x7')](),controller[_0x921c('0x13')]);router[_0x921c('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x921c('0x14')]);router[_0x921c('0x12')](_0x921c('0x15'),auth[_0x921c('0x7')](),controller[_0x921c('0x16')]);router['delete'](_0x921c('0xa'),auth[_0x921c('0x7')](),controller['destroy']);module[_0x921c('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 7d8627f..e7156e1 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 _0x6ffa=['medium','BOOLEAN','ENUM','out','STRING','DATE','Email','lodash','exports','TEXT','long'];(function(_0x5bfab9,_0x4701b0){var _0x30e836=function(_0xa55526){while(--_0xa55526){_0x5bfab9['push'](_0x5bfab9['shift']());}};_0x30e836(++_0x4701b0);}(_0x6ffa,0x80));var _0xa6ff=function(_0x5cf6ff,_0x1a9a03){_0x5cf6ff=_0x5cf6ff-0x0;var _0x40a548=_0x6ffa[_0x5cf6ff];return _0x40a548;};'use strict';var Sequelize=require('sequelize');var _=require(_0xa6ff('0x0'));module[_0xa6ff('0x1')]={'body':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x4'))},'read':{'type':Sequelize[_0xa6ff('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa6ff('0x6')]('in',_0xa6ff('0x7')),'defaultValue':_0xa6ff('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa6ff('0x8')](0x1fe)},'from':{'type':Sequelize[_0xa6ff('0x8')]},'to':{'type':Sequelize[_0xa6ff('0x2')]('long')},'cc':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x3'))},'bcc':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x3'))},'subject':{'type':Sequelize[_0xa6ff('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xa6ff('0x9')]},'originTo':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x3'))},'originCc':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x3'))},'originChannel':{'type':Sequelize['ENUM'](_0xa6ff('0xa'),'Chat'),'defaultValue':_0xa6ff('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x4534=['long','medium','BOOLEAN','out','STRING','DATE','ENUM','Email','exports','TEXT'];(function(_0x2a5640,_0x364354){var _0x5d928e=function(_0x497b59){while(--_0x497b59){_0x2a5640['push'](_0x2a5640['shift']());}};_0x5d928e(++_0x364354);}(_0x4534,0x6c));var _0x4453=function(_0x2e54c6,_0x4a7b4a){_0x2e54c6=_0x2e54c6-0x0;var _0x173337=_0x4534[_0x2e54c6];return _0x173337;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x4453('0x0')]={'body':{'type':Sequelize[_0x4453('0x1')](_0x4453('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4453('0x1')](_0x4453('0x3'))},'read':{'type':Sequelize[_0x4453('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4453('0x5')),'defaultValue':_0x4453('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4453('0x6')](0x1fe)},'from':{'type':Sequelize[_0x4453('0x6')]},'to':{'type':Sequelize['TEXT'](_0x4453('0x2'))},'cc':{'type':Sequelize[_0x4453('0x1')]('long')},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x4453('0x1')]},'sentAt':{'type':Sequelize[_0x4453('0x7')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4453('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4453('0x7')]},'originTo':{'type':Sequelize['TEXT'](_0x4453('0x2'))},'originCc':{'type':Sequelize[_0x4453('0x1')](_0x4453('0x2'))},'originChannel':{'type':Sequelize[_0x4453('0x8')](_0x4453('0x9'),'Chat'),'defaultValue':_0x4453('0x9'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 0103475..943367d 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 _0x591b=['end','sendStatus','stack','name','send','index','MailMessage','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','List','CmContact','ListId','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','interface','SIP/%s','channel','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','internal','motionChannel','event','rejectmessage','download','server','tmp','files','message-%s.eml','subject','createdAt','Attachments','decode','headers','bcc','Bcc','basename','push','type','build','writeFileSync','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','../../config/environment','defaults','localhost','socket.io-emitter','redis','html-entities','./mailMessage.socket','register','jayson/promise','http','client','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy'];(function(_0x3f6426,_0x12cbf9){var _0x25d790=function(_0x3c6756){while(--_0x3c6756){_0x3f6426['push'](_0x3f6426['shift']());}};_0x25d790(++_0x12cbf9);}(_0x591b,0x77));var _0xb591=function(_0x1a7352,_0x1b50c2){_0x1a7352=_0x1a7352-0x0;var _0x533af4=_0x591b[_0x1a7352];return _0x533af4;};'use strict';var emlformat=require(_0xb591('0x0'));var moment=require(_0xb591('0x1'));var BPromise=require('bluebird');var util=require(_0xb591('0x2'));var path=require(_0xb591('0x3'));var fs=require('fs');var _=require(_0xb591('0x4'));var Redis=require(_0xb591('0x5'));var htmlToText=require(_0xb591('0x6'));var qs=require(_0xb591('0x7'));var logger=require('../../config/logger')(_0xb591('0x8'));var interaction_log=require(_0xb591('0x9'))('mail-interactions');var config=require(_0xb591('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb591('0xb')](config['redis'],{'host':_0xb591('0xc'),'port':0x18eb});var socket=require(_0xb591('0xd'))(new Redis(config[_0xb591('0xe')]));var htmlEntities=require(_0xb591('0xf'));require(_0xb591('0x10'))[_0xb591('0x11')](socket);var jayson=require(_0xb591('0x12'));var client=jayson['client'][_0xb591('0x13')]({'port':0x232c});var client9003=jayson[_0xb591('0x14')][_0xb591('0x13')]({'port':0x232b});var client9002=jayson[_0xb591('0x14')][_0xb591('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x52b404,_0x41cea2,_0x4b42c9,_0x58b4ed){return new BPromise(function(_0x25d347,_0x3d1f7c){var _0x566cf5=_0x58b4ed||client;return _0x566cf5['request'](_0x52b404,_0x4b42c9)['then'](function(_0x5b6043){logger['info']('MailMessage,\x20%s,\x20%s',_0x41cea2,_0xb591('0x15'));logger['debug'](_0xb591('0x16'),_0x41cea2,_0xb591('0x15'),JSON[_0xb591('0x17')](_0x5b6043));if(_0x5b6043['error']){if(_0x5b6043[_0xb591('0x18')][_0xb591('0x19')]===0x1f4){logger[_0xb591('0x18')](_0xb591('0x1a'),_0x41cea2,_0x5b6043[_0xb591('0x18')][_0xb591('0x1b')]);return _0x3d1f7c(_0x5b6043[_0xb591('0x18')][_0xb591('0x1b')]);}logger[_0xb591('0x18')](_0xb591('0x1a'),_0x41cea2,_0x5b6043[_0xb591('0x18')][_0xb591('0x1b')]);return _0x25d347(_0x5b6043[_0xb591('0x18')][_0xb591('0x1b')]);}else{logger[_0xb591('0x1c')]('MailMessage,\x20%s,\x20%s',_0x41cea2,_0xb591('0x15'));_0x25d347(_0x5b6043[_0xb591('0x1d')]['message']);}})['catch'](function(_0x1e428b){logger[_0xb591('0x18')](_0xb591('0x1a'),_0x41cea2,_0x1e428b);_0x3d1f7c(_0x1e428b);});});}function respondWithResult(_0x10bfff,_0x24d771){_0x24d771=_0x24d771||0xc8;return function(_0x490859){if(_0x490859){return _0x10bfff[_0xb591('0x1e')](_0x24d771)[_0xb591('0x1f')](_0x490859);}};}function respondWithFilteredResult(_0x150de1,_0x295977){return function(_0x11755b){if(_0x11755b){var _0x1d648f=typeof _0x295977[_0xb591('0x20')]==='undefined'&&typeof _0x295977[_0xb591('0x21')]===_0xb591('0x22');var _0x2503dd=_0x11755b[_0xb591('0x23')];var _0x3b29ea=_0x1d648f?0x0:_0x295977[_0xb591('0x20')];var _0x4a3095=_0x1d648f?_0x11755b[_0xb591('0x23')]:_0x295977[_0xb591('0x20')]+_0x295977[_0xb591('0x21')];var _0x216363;if(_0x4a3095>=_0x2503dd){_0x4a3095=_0x2503dd;_0x216363=0xc8;}else{_0x216363=0xce;}_0x150de1[_0xb591('0x1e')](_0x216363);return _0x150de1[_0xb591('0x24')](_0xb591('0x25'),_0x3b29ea+'-'+_0x4a3095+'/'+_0x2503dd)[_0xb591('0x1f')](_0x11755b);}return null;};}function saveUpdates(_0x46439e){return function(_0x58578a){if(_0x58578a){return _0x58578a[_0xb591('0x26')](_0x46439e)[_0xb591('0x27')](function(_0x1e231a){return _0x1e231a;});}return null;};}function removeEntity(_0xeabf70){return function(_0x1f4d3c){if(_0x1f4d3c){return _0x1f4d3c[_0xb591('0x28')]()[_0xb591('0x27')](function(){_0xeabf70['status'](0xcc)[_0xb591('0x29')]();});}};}function handleEntityNotFound(_0x93a158){return function(_0x44688d){if(!_0x44688d){_0x93a158[_0xb591('0x2a')](0x194);}return _0x44688d;};}function handleError(_0x40f356,_0x40b910){_0x40b910=_0x40b910||0x1f4;return function(_0x3e5106){logger[_0xb591('0x18')](_0x3e5106[_0xb591('0x2b')]);if(_0x3e5106[_0xb591('0x2c')]){delete _0x3e5106['name'];}_0x40f356[_0xb591('0x1e')](_0x40b910)[_0xb591('0x2d')](_0x3e5106);};}exports[_0xb591('0x2e')]=function(_0x5eba2c,_0x2b0bdc){var _0x4c41dc={},_0x2b3011={},_0x20a6f2={'count':0x0,'rows':[]};var _0x1b3ff0=_['map'](db[_0xb591('0x2f')]['rawAttributes'],function(_0x313e72){return{'name':_0x313e72[_0xb591('0x30')],'type':_0x313e72['type'][_0xb591('0x31')]};});_0x2b3011['model']=_[_0xb591('0x32')](_0x1b3ff0,_0xb591('0x2c'));_0x2b3011[_0xb591('0x33')]=_[_0xb591('0x34')](_0x5eba2c[_0xb591('0x33')]);_0x2b3011[_0xb591('0x35')]=_[_0xb591('0x36')](_0x2b3011[_0xb591('0x37')],_0x2b3011[_0xb591('0x33')]);_0x4c41dc['attributes']=_[_0xb591('0x36')](_0x2b3011[_0xb591('0x37')],qs[_0xb591('0x38')](_0x5eba2c[_0xb591('0x33')]['fields']));_0x4c41dc[_0xb591('0x39')]=_0x4c41dc[_0xb591('0x39')][_0xb591('0x3a')]?_0x4c41dc['attributes']:_0x2b3011[_0xb591('0x37')];if(!_0x5eba2c[_0xb591('0x33')]['hasOwnProperty']('nolimit')){_0x4c41dc[_0xb591('0x21')]=qs[_0xb591('0x21')](_0x5eba2c[_0xb591('0x33')][_0xb591('0x21')]);_0x4c41dc[_0xb591('0x20')]=qs['offset'](_0x5eba2c[_0xb591('0x33')][_0xb591('0x20')]);}_0x4c41dc[_0xb591('0x3b')]=qs['sort'](_0x5eba2c['query'][_0xb591('0x3c')]);_0x4c41dc[_0xb591('0x3d')]=qs[_0xb591('0x35')](_[_0xb591('0x3e')](_0x5eba2c[_0xb591('0x33')],_0x2b3011[_0xb591('0x35')]),_0x1b3ff0);if(_0x5eba2c['query'][_0xb591('0x3f')]){_0x4c41dc['where']=_[_0xb591('0x40')](_0x4c41dc[_0xb591('0x3d')],{'$or':_[_0xb591('0x32')](_0x1b3ff0,function(_0x1c6225){if(_0x1c6225['type']!==_0xb591('0x41')){var _0x2ff51b={};_0x2ff51b[_0x1c6225[_0xb591('0x2c')]]={'$like':'%'+_0x5eba2c[_0xb591('0x33')][_0xb591('0x3f')]+'%'};return _0x2ff51b;}})});}_0x4c41dc=_[_0xb591('0x40')]({},_0x4c41dc,_0x5eba2c[_0xb591('0x42')]);var _0x362208={'where':_0x4c41dc[_0xb591('0x3d')]};return db[_0xb591('0x2f')][_0xb591('0x23')](_0x362208)[_0xb591('0x27')](function(_0x209711){_0x20a6f2[_0xb591('0x23')]=_0x209711;if(_0x5eba2c[_0xb591('0x33')][_0xb591('0x43')]){_0x4c41dc[_0xb591('0x44')]=[{'all':!![]}];}return db[_0xb591('0x2f')][_0xb591('0x45')](_0x4c41dc);})[_0xb591('0x27')](function(_0x4a37da){_0x20a6f2[_0xb591('0x46')]=_0x4a37da;return _0x20a6f2;})[_0xb591('0x27')](respondWithFilteredResult(_0x2b0bdc,_0x4c41dc))[_0xb591('0x47')](handleError(_0x2b0bdc,null));};exports[_0xb591('0x48')]=function(_0x2736c5,_0xf8d937){var _0x593adc={'raw':!![],'where':{'id':_0x2736c5[_0xb591('0x49')]['id']}},_0x209c1e={};_0x209c1e[_0xb591('0x37')]=_[_0xb591('0x34')](db[_0xb591('0x2f')][_0xb591('0x4a')]);_0x209c1e[_0xb591('0x33')]=_[_0xb591('0x34')](_0x2736c5[_0xb591('0x33')]);_0x209c1e[_0xb591('0x35')]=_[_0xb591('0x36')](_0x209c1e['model'],_0x209c1e['query']);_0x593adc[_0xb591('0x39')]=_[_0xb591('0x36')](_0x209c1e['model'],qs[_0xb591('0x38')](_0x2736c5[_0xb591('0x33')]['fields']));_0x593adc['attributes']=_0x593adc[_0xb591('0x39')]['length']?_0x593adc[_0xb591('0x39')]:_0x209c1e[_0xb591('0x37')];if(_0x2736c5[_0xb591('0x33')][_0xb591('0x43')]){_0x593adc['include']=[{'all':!![]}];}_0x593adc=_[_0xb591('0x40')]({},_0x593adc,_0x2736c5['options']);return db[_0xb591('0x2f')][_0xb591('0x4b')](_0x593adc)['then'](handleEntityNotFound(_0xf8d937,null))[_0xb591('0x27')](respondWithResult(_0xf8d937,null))[_0xb591('0x47')](handleError(_0xf8d937,null));};exports[_0xb591('0x26')]=function(_0x44d637,_0x46dfd0){if(_0x44d637['body']['id']){delete _0x44d637['body']['id'];}return db['MailMessage'][_0xb591('0x4b')]({'where':{'id':_0x44d637[_0xb591('0x49')]['id']}})[_0xb591('0x27')](handleEntityNotFound(_0x46dfd0,null))[_0xb591('0x27')](saveUpdates(_0x44d637[_0xb591('0x4c')],null))[_0xb591('0x27')](respondWithResult(_0x46dfd0,null))[_0xb591('0x47')](handleError(_0x46dfd0,null));};exports[_0xb591('0x28')]=function(_0x3803,_0x5ab046){return db[_0xb591('0x2f')]['find']({'where':{'id':_0x3803[_0xb591('0x49')]['id']}})['then'](handleEntityNotFound(_0x5ab046,null))['then'](removeEntity(_0x5ab046,null))[_0xb591('0x47')](handleError(_0x5ab046,null));};exports[_0xb591('0x4d')]=function(_0x288308,_0x389371){return db[_0xb591('0x2f')][_0xb591('0x4d')]()[_0xb591('0x27')](respondWithResult(_0x389371,null))[_0xb591('0x47')](handleError(_0x389371,null));};exports[_0xb591('0x4e')]=function(_0x5a10b4,_0x446317){return db[_0xb591('0x2f')][_0xb591('0x4e')](_0x5a10b4[_0xb591('0x4c')])['then'](function(_0x3cd14d){if(_0x3cd14d){if(_0x3cd14d[_0xb591('0x4f')]===_0xb591('0x50')&&!_0x3cd14d[_0xb591('0x51')]){var _0x55d45b,_0xe6a12e,_0xaafa81;if(_0x5a10b4[_0xb591('0x4c')]['to']){_0xe6a12e=_0x5a10b4[_0xb591('0x4c')]['to'][_0xb591('0x52')](',')[0x0];}return db[_0xb591('0x53')][_0xb591('0x54')]({'where':{'id':_0x3cd14d[_0xb591('0x55')]},'include':[{'model':db[_0xb591('0x56')],'as':'List','include':[{'model':db['CmContact'],'as':_0xb591('0x57'),'where':{'email':_0xe6a12e},'limit':0x1,'order':[[_0xb591('0x58'),'DESC']]}]},{'model':db[_0xb591('0x59')],'as':_0xb591('0x5a'),'raw':!![],'include':[{'model':db[_0xb591('0x5b')],'as':_0xb591('0x5b'),'raw':!![]}]}]})[_0xb591('0x27')](function(_0x14189a){_0x55d45b=_0x14189a;if(!_0x55d45b||!_0x55d45b[_0xb591('0x5a')])return;var _0x32cb58=_0x55d45b[_0xb591('0x5c')]();if(_0x5a10b4['body'][_0xb591('0x5d')]&&_0x5a10b4[_0xb591('0x4c')][_0xb591('0x5d')]['length']){for(var _0x405eb6=0x0;_0x405eb6<_0x5a10b4[_0xb591('0x4c')][_0xb591('0x5d')][_0xb591('0x3a')];_0x405eb6+=0x1){_0x5a10b4[_0xb591('0x4c')][_0xb591('0x5d')][_0x405eb6]={'filename':_0x5a10b4[_0xb591('0x4c')]['attachments'][_0x405eb6]['name'],'path':path[_0xb591('0x5e')](config[_0xb591('0x5f')],_0xb591('0x60'),_0x5a10b4[_0xb591('0x4c')]['attachments'][_0x405eb6]['basename'])};}}_0xaafa81={'account':_0x32cb58,'message':_0x5a10b4[_0xb591('0x4c')]};return;})['then'](function(){if(_0x55d45b[_0xb591('0x61')]){if(_0x55d45b[_0xb591('0x61')][_0xb591('0x57')][_0xb591('0x3a')]){return _0x55d45b[_0xb591('0x61')][_0xb591('0x57')][0x0];}else{return db[_0xb591('0x62')]['create'](_[_0xb591('0xb')](_0x5a10b4[_0xb591('0x4c')],{'firstName':_0x5a10b4['body']['to'],'email':_0x5a10b4[_0xb591('0x4c')]['to'],'phone':_0x5a10b4[_0xb591('0x4c')]['to'],'ListId':_0x55d45b[_0xb591('0x63')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xb591('0x27')](function(){if(_0xaafa81){return respondWithRpcPromise(_0xb591('0x64'),'sendMail',_0xaafa81,client9003)[_0xb591('0x27')](function(_0x9b3bac){return _0x3cd14d['update']({'read':!![],'messageId':_0x9b3bac[_0xb591('0x65')],'sentAt':moment()[_0xb591('0x66')](_0xb591('0x67'))});})[_0xb591('0x47')](function(_0x5bdee7){logger[_0xb591('0x18')]('%s',JSON[_0xb591('0x17')](_0x5bdee7));return _0x3cd14d;});}return _0x3cd14d;});}return _0x3cd14d;}})[_0xb591('0x27')](respondWithResult(_0x446317,0xc9))['catch'](handleError(_0x446317,null));};exports[_0xb591('0x68')]=function(_0x2157fa,_0x10ab1b){var _0x1c2965={'agent':{},'channel':_0xb591('0x69')};if(_0x2157fa[_0xb591('0x4c')]['id']){delete _0x2157fa[_0xb591('0x4c')]['id'];}_0x2157fa['body'][_0xb591('0x6a')]=!![];_0x2157fa[_0xb591('0x4c')][_0xb591('0x6b')]=moment()['format'](_0xb591('0x67'));_0x2157fa['body'][_0xb591('0x6c')]=_0x2157fa[_0xb591('0x4c')][_0xb591('0x6c')]||_0x2157fa[_0xb591('0x6d')]['id'];_0x1c2965[_0xb591('0x6e')]['id']=_0x2157fa['body']['UserId'];return db[_0xb591('0x2f')][_0xb591('0x4b')]({'where':{'id':_0x2157fa[_0xb591('0x49')]['id'],'UserId':null}})[_0xb591('0x27')](handleEntityNotFound(_0x10ab1b,null))['then'](saveUpdates(_0x2157fa[_0xb591('0x4c')],null))[_0xb591('0x27')](function(_0x2c8d36){if(_0x2c8d36){_0x1c2965[_0xb591('0x1b')]=_0x2c8d36[_0xb591('0x6f')]({'plain':!![]});return db[_0xb591('0x70')]['find']({'where':{'id':_0x2c8d36[_0xb591('0x71')]}});}return null;})[_0xb591('0x27')](handleEntityNotFound(_0x10ab1b,null))['then'](function(_0x44736d){if(_0x44736d){return _0x44736d[_0xb591('0x26')]({'UserId':_0x2157fa[_0xb591('0x4c')][_0xb591('0x6c')],'read1stAt':_['isNil'](_0x44736d[_0xb591('0x72')])?moment()['format'](_0xb591('0x67')):undefined});}return null;})[_0xb591('0x27')](function(_0x362328){if(_0x362328){_0x1c2965[_0xb591('0x73')]=_0x362328['get']({'plain':!![]});interaction_log[_0xb591('0x1c')](_0xb591('0x74'),_0x2157fa['user']['id'],_0x2157fa[_0xb591('0x6d')][_0xb591('0x2c')],_0x2157fa[_0xb591('0x6d')][_0xb591('0x75')],_0x1c2965[_0xb591('0x73')]['id'],_0x2157fa['body']?JSON[_0xb591('0x17')](_0x2157fa['body']):_0xb591('0x76'));return respondWithRpcPromise(_0xb591('0x77'),_0xb591('0x78'),_0x1c2965);}return null;})['then'](function(_0x2f8ba9){var _0x530cc4=_0xb591('0x79')+_0x2f8ba9[_0xb591('0x1b')]['ContactId'];return db[_0xb591('0x7a')][_0xb591('0x33')](_0x530cc4,{'type':db[_0xb591('0x7b')][_0xb591('0x7c')][_0xb591('0x7d')],'raw':!![]})[_0xb591('0x27')](function(_0x52ebc2){return _0x52ebc2;});})[_0xb591('0x27')](function(_0x33d30d){if(_0x33d30d){_0x1c2965[_0xb591('0x1b')][_0xb591('0x7e')]=_0x33d30d[0x0];if(!_0x2157fa[_0xb591('0x4c')][_0xb591('0x6c')])return;return db[_0xb591('0x7f')][_0xb591('0x4b')]({'where':{'id':_0x2157fa['body'][_0xb591('0x6c')],'role':_0xb591('0x6e')},'attributes':['id',_0xb591('0x2c'),'fullname',_0xb591('0x80'),'internal'],'raw':!![]});}return null;})[_0xb591('0x27')](function(_0x56e062){if(!_0x56e062)return null;_0x1c2965['message'][_0xb591('0x6e')]=_0x56e062;return _0x1c2965;})[_0xb591('0x27')](function(_0xb9cfe5){if(_0xb9cfe5){if(_0x2157fa['body']['manual']){_0x1c2965[_0xb591('0x1b')][_0xb591('0x81')]=util[_0xb591('0x66')](_0xb591('0x82'),_0x2157fa['user'][_0xb591('0x2c')]);_0x1c2965[_0xb591('0x1b')][_0xb591('0x83')]=_0x1c2965[_0xb591('0x83')];_0x1c2965[_0xb591('0x1b')]['motionChannel']=_0x1c2965['channel'];_0x1c2965[_0xb591('0x1b')]['event']=_0xb591('0x68');_0x1c2965['message']['body']=htmlToText[_0xb591('0x84')](_0x1c2965[_0xb591('0x1b')][_0xb591('0x4c')]);return respondWithRpcPromise(_0xb591('0x85'),_0xb591('0x85'),{'event':_0xb591('0x86'),'message':_0x1c2965[_0xb591('0x1b')]},client9002)[_0xb591('0x27')](function(){return _0x1c2965;});}return _0x1c2965;}return null;})[_0xb591('0x27')](respondWithResult(_0x10ab1b,null))[_0xb591('0x47')](handleError(_0x10ab1b,null));};exports[_0xb591('0x87')]=function(_0x2c331c,_0x231412){var _0x31219f={'agent':{},'channel':_0xb591('0x69')};if(_0x2c331c[_0xb591('0x4c')]['id']){delete _0x2c331c[_0xb591('0x4c')]['id'];}_0x2c331c[_0xb591('0x4c')][_0xb591('0x6c')]=_0x2c331c[_0xb591('0x4c')][_0xb591('0x6c')]||_0x2c331c[_0xb591('0x6d')]['id'];_0x31219f[_0xb591('0x6e')]['id']=_0x2c331c[_0xb591('0x4c')][_0xb591('0x6c')];return db[_0xb591('0x2f')][_0xb591('0x4b')]({'where':{'id':_0x2c331c[_0xb591('0x49')]['id'],'UserId':null}})[_0xb591('0x27')](handleEntityNotFound(_0x231412,null))[_0xb591('0x27')](function(_0x4bb91b){if(_0x4bb91b){_0x31219f[_0xb591('0x1b')]=_0x4bb91b[_0xb591('0x6f')]({'plain':!![]});return db[_0xb591('0x70')][_0xb591('0x4b')]({'where':{'id':_0x4bb91b[_0xb591('0x71')]}});}return null;})[_0xb591('0x27')](handleEntityNotFound(_0x231412,null))['then'](function(_0x49a07e){if(_0x49a07e){_0x31219f[_0xb591('0x73')]=_0x49a07e['get']({'plain':!![]});interaction_log[_0xb591('0x1c')](_0xb591('0x88'),_0x2c331c[_0xb591('0x6d')]['id'],_0x2c331c['user'][_0xb591('0x2c')],_0x2c331c[_0xb591('0x6d')][_0xb591('0x75')],_0x31219f[_0xb591('0x73')]['id'],_0x2c331c[_0xb591('0x4c')]?JSON[_0xb591('0x17')](_0x2c331c[_0xb591('0x4c')]):'null');return respondWithRpcPromise(_0xb591('0x89'),'rejectMessage',_0x31219f);}return null;})[_0xb591('0x27')](function(_0x335335){var _0x441c9a=_0xb591('0x79')+_0x335335['message']['ContactId'];return db['sequelize']['query'](_0x441c9a,{'type':db[_0xb591('0x7b')][_0xb591('0x7c')][_0xb591('0x7d')],'raw':!![]})[_0xb591('0x27')](function(_0x8387ed){return _0x8387ed;});})[_0xb591('0x27')](function(_0x5d93c4){if(_0x5d93c4){_0x31219f[_0xb591('0x1b')]['contact']=_0x5d93c4[0x0];if(!_0x2c331c['body']['UserId'])return;return db[_0xb591('0x7f')][_0xb591('0x4b')]({'where':{'id':_0x2c331c[_0xb591('0x4c')][_0xb591('0x6c')],'role':_0xb591('0x6e')},'attributes':['id',_0xb591('0x2c'),'fullname',_0xb591('0x80'),_0xb591('0x8a')],'raw':!![]});}return null;})[_0xb591('0x27')](function(_0x3cd071){if(!_0x3cd071)return null;_0x31219f[_0xb591('0x1b')][_0xb591('0x6e')]=_0x3cd071;return _0x31219f;})[_0xb591('0x27')](function(_0x93f9bc){if(_0x93f9bc){_0x93f9bc[_0xb591('0x1b')][_0xb591('0x81')]=util[_0xb591('0x66')](_0xb591('0x82'),_0x2c331c[_0xb591('0x6d')]['name']);_0x93f9bc[_0xb591('0x1b')][_0xb591('0x83')]=_0x31219f[_0xb591('0x83')];_0x93f9bc[_0xb591('0x1b')][_0xb591('0x8b')]=_0x31219f['channel'];_0x93f9bc[_0xb591('0x1b')][_0xb591('0x8c')]=_0xb591('0x87');_0x93f9bc[_0xb591('0x1b')][_0xb591('0x4c')]=htmlToText[_0xb591('0x84')](_0x31219f[_0xb591('0x1b')]['body']);respondWithRpcPromise(_0xb591('0x85'),_0xb591('0x85'),{'event':_0xb591('0x8d'),'message':_0x93f9bc['message']},client9002);return _0x31219f;}return null;})['then'](respondWithResult(_0x231412,null))[_0xb591('0x47')](handleError(_0x231412,null));};exports[_0xb591('0x8e')]=function(_0x54abdc,_0x3f359a){var _0x3baf84=moment()['unix']()['toString']();var _0x4f0ef8=path['join'](config['root'],_0xb591('0x8f'),'files',_0xb591('0x90'));var _0x25023f=path[_0xb591('0x5e')](config[_0xb591('0x5f')],'server',_0xb591('0x91'),_0xb591('0x5d'));var _0x200db0=util[_0xb591('0x66')](_0xb591('0x92'),_0x3baf84);return db[_0xb591('0x2f')][_0xb591('0x4b')]({'where':{'id':_0x54abdc['params']['id']},'attributes':['id',_0xb591('0x4c'),'from','to','cc','bcc',_0xb591('0x93'),_0xb591('0x94')],'include':_0x54abdc[_0xb591('0x33')]['attachments']?[{'model':db['Attachment'],'as':_0xb591('0x95')}]:undefined})['then'](handleEntityNotFound(_0x3f359a,null))[_0xb591('0x27')](function(_0xcd1d58){if(_0xcd1d58){var _0x8e5a44=_0xcd1d58;var _0x5189ac={'from':_0x8e5a44['from'],'to':_0x8e5a44['to'],'subject':_0x8e5a44[_0xb591('0x93')],'html':htmlEntities[_0xb591('0x96')](_0x8e5a44[_0xb591('0x4c')]),'headers':{'Date':moment(_0x8e5a44[_0xb591('0x94')])[_0xb591('0x66')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xcd1d58['cc']){_0x5189ac[_0xb591('0x97')]['Cc']=_0xcd1d58['cc'];}if(_0xcd1d58[_0xb591('0x98')]){_0x5189ac['headers'][_0xb591('0x99')]=_0xcd1d58[_0xb591('0x98')];}return new BPromise(function(_0x344d4d,_0x502b32){if(_0xcd1d58[_0xb591('0x95')]){for(var _0x1f08c8=0x0;_0x1f08c8<_0xcd1d58[_0xb591('0x95')][_0xb591('0x3a')];_0x1f08c8++){var _0x1b2ec0=_0xcd1d58[_0xb591('0x95')][_0x1f08c8];var _0x298fda=path[_0xb591('0x5e')](_0x25023f,_0x1b2ec0[_0xb591('0x9a')]);if(fs['existsSync'](_0x298fda)){_0x5189ac['attachments'][_0xb591('0x9b')]({'name':_0x1b2ec0[_0xb591('0x2c')],'contentType':_0x1b2ec0[_0xb591('0x9c')],'data':fs['readFileSync'](_0x298fda)});}}}emlformat[_0xb591('0x9d')](_0x5189ac,function(_0x333724,_0x294ad4){if(_0x333724)return _0x502b32(_0x333724);fs[_0xb591('0x9e')](path[_0xb591('0x5e')](_0x4f0ef8,_0x200db0),_0x294ad4);return _0x344d4d(_0x294ad4);});});}})[_0xb591('0x27')](function(_0x2f6a53){if(_0x2f6a53){return _0x3f359a[_0xb591('0x8e')](path[_0xb591('0x5e')](_0x4f0ef8,_0x200db0),_0x200db0,function(_0x7101aa){if(!_0x7101aa)fs[_0xb591('0x9f')](path[_0xb591('0x5e')](_0x4f0ef8,_0x200db0));});}})['catch'](handleError(_0x3f359a,null));}; \ No newline at end of file +var _0xe811=['findOne','MailAccountId','CmContact','Contacts','DESC','CloudProvider','attachments','join','root','server/files/attachments','List','ListId','SendMail','sendMail','YYYY-MM-DD\x20HH:mm:ss','stringify','mail','read','readAt','format','UserId','user','agent','get','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','ContactId','QueryTypes','SELECT','contact','User','internal','interface','channel','event','fromString','EventManager','acceptmessage','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','email','SIP/%s','download','server','files','tmp','message-%s.eml','bcc','createdAt','Attachment','Attachments','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','status','json','undefined','count','limit','Content-Range','update','then','destroy','sendStatus','stack','name','send','index','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','offset','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','length','find','body','params','describe','create','out','secret'];(function(_0x803bb6,_0x59debd){var _0x5570fb=function(_0x1aecdc){while(--_0x1aecdc){_0x803bb6['push'](_0x803bb6['shift']());}};_0x5570fb(++_0x59debd);}(_0xe811,0x16d));var _0x1e81=function(_0x24fd0a,_0x3603b2){_0x24fd0a=_0x24fd0a-0x0;var _0x545ec8=_0xe811[_0x24fd0a];return _0x545ec8;};'use strict';var emlformat=require(_0x1e81('0x0'));var moment=require(_0x1e81('0x1'));var BPromise=require(_0x1e81('0x2'));var util=require('util');var path=require(_0x1e81('0x3'));var fs=require('fs');var _=require(_0x1e81('0x4'));var Redis=require(_0x1e81('0x5'));var htmlToText=require('html-to-text');var qs=require(_0x1e81('0x6'));var logger=require(_0x1e81('0x7'))(_0x1e81('0x8'));var interaction_log=require('../../config/logger')(_0x1e81('0x9'));var config=require(_0x1e81('0xa'));var db=require(_0x1e81('0xb'))['db'];config[_0x1e81('0xc')]=_[_0x1e81('0xd')](config[_0x1e81('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1e81('0xe'))(new Redis(config[_0x1e81('0xc')]));var htmlEntities=require('html-entities');require(_0x1e81('0xf'))['register'](socket);var jayson=require(_0x1e81('0x10'));var client=jayson[_0x1e81('0x11')][_0x1e81('0x12')]({'port':0x232c});var client9003=jayson[_0x1e81('0x11')]['http']({'port':0x232b});var client9002=jayson[_0x1e81('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32bd84,_0x21e37d,_0x2e8289,_0x387c01){return new BPromise(function(_0x1fec96,_0x4e4e5f){var _0x2415bb=_0x387c01||client;return _0x2415bb[_0x1e81('0x13')](_0x32bd84,_0x2e8289)['then'](function(_0x2e2dd1){logger[_0x1e81('0x14')]('MailMessage,\x20%s,\x20%s',_0x21e37d,_0x1e81('0x15'));logger[_0x1e81('0x16')](_0x1e81('0x17'),_0x21e37d,_0x1e81('0x15'),JSON['stringify'](_0x2e2dd1));if(_0x2e2dd1[_0x1e81('0x18')]){if(_0x2e2dd1['error'][_0x1e81('0x19')]===0x1f4){logger[_0x1e81('0x18')](_0x1e81('0x1a'),_0x21e37d,_0x2e2dd1['error']['message']);return _0x4e4e5f(_0x2e2dd1['error'][_0x1e81('0x1b')]);}logger['error'](_0x1e81('0x1a'),_0x21e37d,_0x2e2dd1['error']['message']);return _0x1fec96(_0x2e2dd1['error'][_0x1e81('0x1b')]);}else{logger[_0x1e81('0x14')]('MailMessage,\x20%s,\x20%s',_0x21e37d,_0x1e81('0x15'));_0x1fec96(_0x2e2dd1[_0x1e81('0x1c')][_0x1e81('0x1b')]);}})[_0x1e81('0x1d')](function(_0x221631){logger['error']('MailMessage,\x20%s,\x20%s',_0x21e37d,_0x221631);_0x4e4e5f(_0x221631);});});}function respondWithResult(_0x583b24,_0x1129e2){_0x1129e2=_0x1129e2||0xc8;return function(_0xc03975){if(_0xc03975){return _0x583b24[_0x1e81('0x1e')](_0x1129e2)[_0x1e81('0x1f')](_0xc03975);}};}function respondWithFilteredResult(_0x17d082,_0x4d163d){return function(_0x49bc10){if(_0x49bc10){var _0x25b6a9=typeof _0x4d163d['offset']===_0x1e81('0x20')&&typeof _0x4d163d['limit']===_0x1e81('0x20');var _0x3bfac5=_0x49bc10[_0x1e81('0x21')];var _0x28d600=_0x25b6a9?0x0:_0x4d163d['offset'];var _0x59bf47=_0x25b6a9?_0x49bc10[_0x1e81('0x21')]:_0x4d163d['offset']+_0x4d163d[_0x1e81('0x22')];var _0x29743c;if(_0x59bf47>=_0x3bfac5){_0x59bf47=_0x3bfac5;_0x29743c=0xc8;}else{_0x29743c=0xce;}_0x17d082[_0x1e81('0x1e')](_0x29743c);return _0x17d082['set'](_0x1e81('0x23'),_0x28d600+'-'+_0x59bf47+'/'+_0x3bfac5)[_0x1e81('0x1f')](_0x49bc10);}return null;};}function saveUpdates(_0x13ca9a){return function(_0x160fbb){if(_0x160fbb){return _0x160fbb[_0x1e81('0x24')](_0x13ca9a)[_0x1e81('0x25')](function(_0xf784c0){return _0xf784c0;});}return null;};}function removeEntity(_0x592eb1){return function(_0x9bd556){if(_0x9bd556){return _0x9bd556[_0x1e81('0x26')]()[_0x1e81('0x25')](function(){_0x592eb1[_0x1e81('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f66f9){return function(_0x5c2ad1){if(!_0x5c2ad1){_0x2f66f9[_0x1e81('0x27')](0x194);}return _0x5c2ad1;};}function handleError(_0x1e7946,_0x23c275){_0x23c275=_0x23c275||0x1f4;return function(_0x4f79c9){logger[_0x1e81('0x18')](_0x4f79c9[_0x1e81('0x28')]);if(_0x4f79c9[_0x1e81('0x29')]){delete _0x4f79c9['name'];}_0x1e7946[_0x1e81('0x1e')](_0x23c275)[_0x1e81('0x2a')](_0x4f79c9);};}exports[_0x1e81('0x2b')]=function(_0x2a9ba2,_0x5d38b5){var _0x5f5731={},_0x5c540f={},_0x374c11={'count':0x0,'rows':[]};var _0x350832=_['map'](db[_0x1e81('0x2c')][_0x1e81('0x2d')],function(_0x5d08d3){return{'name':_0x5d08d3[_0x1e81('0x2e')],'type':_0x5d08d3[_0x1e81('0x2f')][_0x1e81('0x30')]};});_0x5c540f[_0x1e81('0x31')]=_['map'](_0x350832,_0x1e81('0x29'));_0x5c540f[_0x1e81('0x32')]=_[_0x1e81('0x33')](_0x2a9ba2[_0x1e81('0x32')]);_0x5c540f[_0x1e81('0x34')]=_['intersection'](_0x5c540f['model'],_0x5c540f[_0x1e81('0x32')]);_0x5f5731[_0x1e81('0x35')]=_[_0x1e81('0x36')](_0x5c540f[_0x1e81('0x31')],qs[_0x1e81('0x37')](_0x2a9ba2[_0x1e81('0x32')][_0x1e81('0x37')]));_0x5f5731[_0x1e81('0x35')]=_0x5f5731['attributes']['length']?_0x5f5731[_0x1e81('0x35')]:_0x5c540f[_0x1e81('0x31')];if(!_0x2a9ba2[_0x1e81('0x32')]['hasOwnProperty'](_0x1e81('0x38'))){_0x5f5731['limit']=qs[_0x1e81('0x22')](_0x2a9ba2[_0x1e81('0x32')][_0x1e81('0x22')]);_0x5f5731[_0x1e81('0x39')]=qs[_0x1e81('0x39')](_0x2a9ba2[_0x1e81('0x32')][_0x1e81('0x39')]);}_0x5f5731[_0x1e81('0x3a')]=qs[_0x1e81('0x3b')](_0x2a9ba2['query'][_0x1e81('0x3b')]);_0x5f5731[_0x1e81('0x3c')]=qs['filters'](_[_0x1e81('0x3d')](_0x2a9ba2[_0x1e81('0x32')],_0x5c540f[_0x1e81('0x34')]),_0x350832);if(_0x2a9ba2[_0x1e81('0x32')][_0x1e81('0x3e')]){_0x5f5731[_0x1e81('0x3c')]=_[_0x1e81('0x3f')](_0x5f5731[_0x1e81('0x3c')],{'$or':_[_0x1e81('0x40')](_0x350832,function(_0x4dbf4f){if(_0x4dbf4f[_0x1e81('0x2f')]!==_0x1e81('0x41')){var _0x439b29={};_0x439b29[_0x4dbf4f[_0x1e81('0x29')]]={'$like':'%'+_0x2a9ba2[_0x1e81('0x32')][_0x1e81('0x3e')]+'%'};return _0x439b29;}})});}_0x5f5731=_[_0x1e81('0x3f')]({},_0x5f5731,_0x2a9ba2[_0x1e81('0x42')]);var _0xafee12={'where':_0x5f5731[_0x1e81('0x3c')]};return db[_0x1e81('0x2c')][_0x1e81('0x21')](_0xafee12)[_0x1e81('0x25')](function(_0x8fb8d7){_0x374c11[_0x1e81('0x21')]=_0x8fb8d7;if(_0x2a9ba2[_0x1e81('0x32')][_0x1e81('0x43')]){_0x5f5731[_0x1e81('0x44')]=[{'all':!![]}];}return db['MailMessage'][_0x1e81('0x45')](_0x5f5731);})[_0x1e81('0x25')](function(_0x119953){_0x374c11[_0x1e81('0x46')]=_0x119953;return _0x374c11;})[_0x1e81('0x25')](respondWithFilteredResult(_0x5d38b5,_0x5f5731))[_0x1e81('0x1d')](handleError(_0x5d38b5,null));};exports['show']=function(_0x18bdab,_0x342d7e){var _0x2cc424={'raw':!![],'where':{'id':_0x18bdab['params']['id']}},_0x4ff9a6={};_0x4ff9a6['model']=_[_0x1e81('0x33')](db[_0x1e81('0x2c')][_0x1e81('0x2d')]);_0x4ff9a6[_0x1e81('0x32')]=_[_0x1e81('0x33')](_0x18bdab['query']);_0x4ff9a6[_0x1e81('0x34')]=_[_0x1e81('0x36')](_0x4ff9a6[_0x1e81('0x31')],_0x4ff9a6[_0x1e81('0x32')]);_0x2cc424[_0x1e81('0x35')]=_[_0x1e81('0x36')](_0x4ff9a6[_0x1e81('0x31')],qs[_0x1e81('0x37')](_0x18bdab[_0x1e81('0x32')][_0x1e81('0x37')]));_0x2cc424[_0x1e81('0x35')]=_0x2cc424[_0x1e81('0x35')][_0x1e81('0x47')]?_0x2cc424[_0x1e81('0x35')]:_0x4ff9a6[_0x1e81('0x31')];if(_0x18bdab[_0x1e81('0x32')]['includeAll']){_0x2cc424[_0x1e81('0x44')]=[{'all':!![]}];}_0x2cc424=_['merge']({},_0x2cc424,_0x18bdab[_0x1e81('0x42')]);return db['MailMessage'][_0x1e81('0x48')](_0x2cc424)[_0x1e81('0x25')](handleEntityNotFound(_0x342d7e,null))[_0x1e81('0x25')](respondWithResult(_0x342d7e,null))[_0x1e81('0x1d')](handleError(_0x342d7e,null));};exports[_0x1e81('0x24')]=function(_0x3ea2d9,_0x524c90){if(_0x3ea2d9[_0x1e81('0x49')]['id']){delete _0x3ea2d9[_0x1e81('0x49')]['id'];}return db[_0x1e81('0x2c')][_0x1e81('0x48')]({'where':{'id':_0x3ea2d9[_0x1e81('0x4a')]['id']}})[_0x1e81('0x25')](handleEntityNotFound(_0x524c90,null))['then'](saveUpdates(_0x3ea2d9[_0x1e81('0x49')],null))['then'](respondWithResult(_0x524c90,null))[_0x1e81('0x1d')](handleError(_0x524c90,null));};exports['destroy']=function(_0x475c8e,_0x3e5594){return db[_0x1e81('0x2c')][_0x1e81('0x48')]({'where':{'id':_0x475c8e[_0x1e81('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e5594,null))[_0x1e81('0x25')](removeEntity(_0x3e5594,null))[_0x1e81('0x1d')](handleError(_0x3e5594,null));};exports[_0x1e81('0x4b')]=function(_0x1616bd,_0x4d9bf7){return db[_0x1e81('0x2c')]['describe']()[_0x1e81('0x25')](respondWithResult(_0x4d9bf7,null))[_0x1e81('0x1d')](handleError(_0x4d9bf7,null));};exports['create']=function(_0x10d0af,_0x2b93dc){return db['MailMessage'][_0x1e81('0x4c')](_0x10d0af['body'])['then'](function(_0x2d916d){if(_0x2d916d){if(_0x2d916d['direction']===_0x1e81('0x4d')&&!_0x2d916d[_0x1e81('0x4e')]){var _0x5dffa5,_0x18c152,_0x8c06f7;if(_0x10d0af[_0x1e81('0x49')]['to']){_0x18c152=_0x10d0af[_0x1e81('0x49')]['to']['split'](',')[0x0];}return db['MailAccount'][_0x1e81('0x4f')]({'where':{'id':_0x2d916d[_0x1e81('0x50')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x1e81('0x51')],'as':_0x1e81('0x52'),'where':{'email':_0x18c152},'limit':0x1,'order':[['updatedAt',_0x1e81('0x53')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x1e81('0x54')],'as':_0x1e81('0x54'),'raw':!![]}]}]})[_0x1e81('0x25')](function(_0x25c3d9){_0x5dffa5=_0x25c3d9;if(!_0x5dffa5||!_0x5dffa5['Smtp'])return;var _0x59dc29=_0x5dffa5['getSmtpOptions']();if(_0x10d0af[_0x1e81('0x49')][_0x1e81('0x55')]&&_0x10d0af['body'][_0x1e81('0x55')][_0x1e81('0x47')]){for(var _0x2cee45=0x0;_0x2cee45<_0x10d0af[_0x1e81('0x49')][_0x1e81('0x55')][_0x1e81('0x47')];_0x2cee45+=0x1){_0x10d0af[_0x1e81('0x49')][_0x1e81('0x55')][_0x2cee45]={'filename':_0x10d0af['body'][_0x1e81('0x55')][_0x2cee45]['name'],'path':path[_0x1e81('0x56')](config[_0x1e81('0x57')],_0x1e81('0x58'),_0x10d0af[_0x1e81('0x49')][_0x1e81('0x55')][_0x2cee45]['basename'])};}}_0x8c06f7={'account':_0x59dc29,'message':_0x10d0af['body']};return;})[_0x1e81('0x25')](function(){if(_0x5dffa5[_0x1e81('0x59')]){if(_0x5dffa5[_0x1e81('0x59')][_0x1e81('0x52')]['length']){return _0x5dffa5['List'][_0x1e81('0x52')][0x0];}else{return db[_0x1e81('0x51')][_0x1e81('0x4c')](_[_0x1e81('0xd')](_0x10d0af[_0x1e81('0x49')],{'firstName':_0x10d0af[_0x1e81('0x49')]['to'],'email':_0x10d0af[_0x1e81('0x49')]['to'],'phone':_0x10d0af[_0x1e81('0x49')]['to'],'ListId':_0x5dffa5[_0x1e81('0x5a')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x1e81('0x25')](function(){if(_0x8c06f7){return respondWithRpcPromise(_0x1e81('0x5b'),_0x1e81('0x5c'),_0x8c06f7,client9003)['then'](function(_0x310983){return _0x2d916d[_0x1e81('0x24')]({'read':!![],'messageId':_0x310983['messageId'],'sentAt':moment()['format'](_0x1e81('0x5d'))});})[_0x1e81('0x1d')](function(_0xcb8982){logger[_0x1e81('0x18')]('%s',JSON[_0x1e81('0x5e')](_0xcb8982));return _0x2d916d;});}return _0x2d916d;});}return _0x2d916d;}})[_0x1e81('0x25')](respondWithResult(_0x2b93dc,0xc9))[_0x1e81('0x1d')](handleError(_0x2b93dc,null));};exports['accept']=function(_0x5742d6,_0x381893){var _0x5d6326={'agent':{},'channel':_0x1e81('0x5f')};if(_0x5742d6[_0x1e81('0x49')]['id']){delete _0x5742d6[_0x1e81('0x49')]['id'];}_0x5742d6[_0x1e81('0x49')][_0x1e81('0x60')]=!![];_0x5742d6[_0x1e81('0x49')][_0x1e81('0x61')]=moment()[_0x1e81('0x62')](_0x1e81('0x5d'));_0x5742d6[_0x1e81('0x49')][_0x1e81('0x63')]=_0x5742d6['body'][_0x1e81('0x63')]||_0x5742d6[_0x1e81('0x64')]['id'];_0x5d6326[_0x1e81('0x65')]['id']=_0x5742d6[_0x1e81('0x49')][_0x1e81('0x63')];return db['MailMessage'][_0x1e81('0x48')]({'where':{'id':_0x5742d6[_0x1e81('0x4a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x381893,null))[_0x1e81('0x25')](saveUpdates(_0x5742d6[_0x1e81('0x49')],null))[_0x1e81('0x25')](function(_0x48f30c){if(_0x48f30c){_0x5d6326['message']=_0x48f30c[_0x1e81('0x66')]({'plain':!![]});return db['MailInteraction'][_0x1e81('0x48')]({'where':{'id':_0x48f30c['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x381893,null))[_0x1e81('0x25')](function(_0x4e63df){if(_0x4e63df){return _0x4e63df[_0x1e81('0x24')]({'UserId':_0x5742d6[_0x1e81('0x49')][_0x1e81('0x63')],'read1stAt':_[_0x1e81('0x67')](_0x4e63df['read1stAt'])?moment()['format'](_0x1e81('0x5d')):undefined});}return null;})[_0x1e81('0x25')](function(_0x29d4c4){if(_0x29d4c4){_0x5d6326[_0x1e81('0x68')]=_0x29d4c4[_0x1e81('0x66')]({'plain':!![]});interaction_log[_0x1e81('0x14')](_0x1e81('0x69'),_0x5742d6[_0x1e81('0x64')]['id'],_0x5742d6[_0x1e81('0x64')][_0x1e81('0x29')],_0x5742d6[_0x1e81('0x64')][_0x1e81('0x6a')],_0x5d6326[_0x1e81('0x68')]['id'],_0x5742d6[_0x1e81('0x49')]?JSON[_0x1e81('0x5e')](_0x5742d6[_0x1e81('0x49')]):_0x1e81('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x1e81('0x6c'),_0x5d6326);}return null;})['then'](function(_0x594096){var _0x464e98='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x594096[_0x1e81('0x1b')][_0x1e81('0x6d')];return db['sequelize'][_0x1e81('0x32')](_0x464e98,{'type':db['Sequelize'][_0x1e81('0x6e')][_0x1e81('0x6f')],'raw':!![]})[_0x1e81('0x25')](function(_0x3a6f13){return _0x3a6f13;});})[_0x1e81('0x25')](function(_0x1db5de){if(_0x1db5de){_0x5d6326[_0x1e81('0x1b')][_0x1e81('0x70')]=_0x1db5de[0x0];if(!_0x5742d6[_0x1e81('0x49')][_0x1e81('0x63')])return;return db[_0x1e81('0x71')]['find']({'where':{'id':_0x5742d6['body'][_0x1e81('0x63')],'role':'agent'},'attributes':['id',_0x1e81('0x29'),'fullname','email',_0x1e81('0x72')],'raw':!![]});}return null;})[_0x1e81('0x25')](function(_0x50ee83){if(!_0x50ee83)return null;_0x5d6326['message'][_0x1e81('0x65')]=_0x50ee83;return _0x5d6326;})['then'](function(_0x1dd701){if(_0x1dd701){if(_0x5742d6['body']['manual']){_0x5d6326['message'][_0x1e81('0x73')]=util['format']('SIP/%s',_0x5742d6[_0x1e81('0x64')][_0x1e81('0x29')]);_0x5d6326[_0x1e81('0x1b')][_0x1e81('0x74')]=_0x5d6326[_0x1e81('0x74')];_0x5d6326['message']['motionChannel']=_0x5d6326['channel'];_0x5d6326[_0x1e81('0x1b')][_0x1e81('0x75')]='accept';_0x5d6326['message'][_0x1e81('0x49')]=htmlToText[_0x1e81('0x76')](_0x5d6326[_0x1e81('0x1b')]['body']);return respondWithRpcPromise(_0x1e81('0x77'),_0x1e81('0x77'),{'event':_0x1e81('0x78'),'message':_0x5d6326[_0x1e81('0x1b')]},client9002)[_0x1e81('0x25')](function(){return _0x5d6326;});}return _0x5d6326;}return null;})[_0x1e81('0x25')](respondWithResult(_0x381893,null))['catch'](handleError(_0x381893,null));};exports[_0x1e81('0x79')]=function(_0x33e216,_0x55c654){var _0x1975f9={'agent':{},'channel':'mail'};if(_0x33e216[_0x1e81('0x49')]['id']){delete _0x33e216[_0x1e81('0x49')]['id'];}_0x33e216[_0x1e81('0x49')][_0x1e81('0x63')]=_0x33e216[_0x1e81('0x49')][_0x1e81('0x63')]||_0x33e216['user']['id'];_0x1975f9[_0x1e81('0x65')]['id']=_0x33e216['body'][_0x1e81('0x63')];return db[_0x1e81('0x2c')][_0x1e81('0x48')]({'where':{'id':_0x33e216[_0x1e81('0x4a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x55c654,null))[_0x1e81('0x25')](function(_0x3d6ab4){if(_0x3d6ab4){_0x1975f9[_0x1e81('0x1b')]=_0x3d6ab4[_0x1e81('0x66')]({'plain':!![]});return db[_0x1e81('0x7a')]['find']({'where':{'id':_0x3d6ab4['MailInteractionId']}});}return null;})[_0x1e81('0x25')](handleEntityNotFound(_0x55c654,null))[_0x1e81('0x25')](function(_0x47664b){if(_0x47664b){_0x1975f9[_0x1e81('0x68')]=_0x47664b['get']({'plain':!![]});interaction_log['info'](_0x1e81('0x7b'),_0x33e216[_0x1e81('0x64')]['id'],_0x33e216['user'][_0x1e81('0x29')],_0x33e216['user']['role'],_0x1975f9['interaction']['id'],_0x33e216[_0x1e81('0x49')]?JSON[_0x1e81('0x5e')](_0x33e216[_0x1e81('0x49')]):'null');return respondWithRpcPromise(_0x1e81('0x7c'),'rejectMessage',_0x1975f9);}return null;})['then'](function(_0x262e57){var _0x9a3774=_0x1e81('0x7d')+_0x262e57[_0x1e81('0x1b')][_0x1e81('0x6d')];return db[_0x1e81('0x7e')][_0x1e81('0x32')](_0x9a3774,{'type':db[_0x1e81('0x7f')]['QueryTypes'][_0x1e81('0x6f')],'raw':!![]})[_0x1e81('0x25')](function(_0x5c4ecc){return _0x5c4ecc;});})[_0x1e81('0x25')](function(_0x3d65f5){if(_0x3d65f5){_0x1975f9[_0x1e81('0x1b')][_0x1e81('0x70')]=_0x3d65f5[0x0];if(!_0x33e216[_0x1e81('0x49')][_0x1e81('0x63')])return;return db[_0x1e81('0x71')]['find']({'where':{'id':_0x33e216['body']['UserId'],'role':'agent'},'attributes':['id',_0x1e81('0x29'),'fullname',_0x1e81('0x80'),_0x1e81('0x72')],'raw':!![]});}return null;})['then'](function(_0x47fd36){if(!_0x47fd36)return null;_0x1975f9['message'][_0x1e81('0x65')]=_0x47fd36;return _0x1975f9;})[_0x1e81('0x25')](function(_0x12f135){if(_0x12f135){_0x12f135[_0x1e81('0x1b')][_0x1e81('0x73')]=util[_0x1e81('0x62')](_0x1e81('0x81'),_0x33e216[_0x1e81('0x64')][_0x1e81('0x29')]);_0x12f135[_0x1e81('0x1b')][_0x1e81('0x74')]=_0x1975f9[_0x1e81('0x74')];_0x12f135[_0x1e81('0x1b')]['motionChannel']=_0x1975f9[_0x1e81('0x74')];_0x12f135[_0x1e81('0x1b')][_0x1e81('0x75')]='reject';_0x12f135['message']['body']=htmlToText[_0x1e81('0x76')](_0x1975f9['message'][_0x1e81('0x49')]);respondWithRpcPromise(_0x1e81('0x77'),'EventManager',{'event':'rejectmessage','message':_0x12f135[_0x1e81('0x1b')]},client9002);return _0x1975f9;}return null;})[_0x1e81('0x25')](respondWithResult(_0x55c654,null))['catch'](handleError(_0x55c654,null));};exports[_0x1e81('0x82')]=function(_0x20f35e,_0x4275e7){var _0x41c0d3=moment()['unix']()['toString']();var _0x4e9137=path[_0x1e81('0x56')](config[_0x1e81('0x57')],_0x1e81('0x83'),_0x1e81('0x84'),_0x1e81('0x85'));var _0x5ef2f0=path['join'](config['root'],_0x1e81('0x83'),'files',_0x1e81('0x55'));var _0x48fd11=util['format'](_0x1e81('0x86'),_0x41c0d3);return db[_0x1e81('0x2c')]['find']({'where':{'id':_0x20f35e[_0x1e81('0x4a')]['id']},'attributes':['id','body','from','to','cc',_0x1e81('0x87'),'subject',_0x1e81('0x88')],'include':_0x20f35e['query'][_0x1e81('0x55')]?[{'model':db[_0x1e81('0x89')],'as':_0x1e81('0x8a')}]:undefined})[_0x1e81('0x25')](handleEntityNotFound(_0x4275e7,null))[_0x1e81('0x25')](function(_0x1ac7ba){if(_0x1ac7ba){var _0x3a3d4d=_0x1ac7ba;var _0x433ec4={'from':_0x3a3d4d['from'],'to':_0x3a3d4d['to'],'subject':_0x3a3d4d[_0x1e81('0x8b')],'html':htmlEntities[_0x1e81('0x8c')](_0x3a3d4d['body']),'headers':{'Date':moment(_0x3a3d4d['createdAt'])['format'](_0x1e81('0x8d'))},'attachments':[]};if(_0x1ac7ba['cc']){_0x433ec4[_0x1e81('0x8e')]['Cc']=_0x1ac7ba['cc'];}if(_0x1ac7ba[_0x1e81('0x87')]){_0x433ec4[_0x1e81('0x8e')][_0x1e81('0x8f')]=_0x1ac7ba['bcc'];}return new BPromise(function(_0x2ef115,_0x5b186e){if(_0x1ac7ba['Attachments']){for(var _0x1c043d=0x0;_0x1c043d<_0x1ac7ba[_0x1e81('0x8a')][_0x1e81('0x47')];_0x1c043d++){var _0x24287f=_0x1ac7ba[_0x1e81('0x8a')][_0x1c043d];var _0x4e4432=path['join'](_0x5ef2f0,_0x24287f['basename']);if(fs[_0x1e81('0x90')](_0x4e4432)){_0x433ec4[_0x1e81('0x55')]['push']({'name':_0x24287f[_0x1e81('0x29')],'contentType':_0x24287f[_0x1e81('0x2f')],'data':fs[_0x1e81('0x91')](_0x4e4432)});}}}emlformat['build'](_0x433ec4,function(_0x9c9aa6,_0x7633be){if(_0x9c9aa6)return _0x5b186e(_0x9c9aa6);fs[_0x1e81('0x92')](path[_0x1e81('0x56')](_0x4e9137,_0x48fd11),_0x7633be);return _0x2ef115(_0x7633be);});});}})[_0x1e81('0x25')](function(_0x583844){if(_0x583844){return _0x4275e7['download'](path['join'](_0x4e9137,_0x48fd11),_0x48fd11,function(_0x15bc13){if(!_0x15bc13)fs[_0x1e81('0x93')](path[_0x1e81('0x56')](_0x4e9137,_0x48fd11));});}})[_0x1e81('0x1d')](handleError(_0x4275e7,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 9999a30..6292df0 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 _0x8da7=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0x190b95,_0xfbfcc9){var _0x4d5c92=function(_0x3a00ea){while(--_0x3a00ea){_0x190b95['push'](_0x190b95['shift']());}};_0x4d5c92(++_0xfbfcc9);}(_0x8da7,0xc4));var _0x78da=function(_0x573be2,_0x5e4bd0){_0x573be2=_0x573be2-0x0;var _0x378751=_0x8da7[_0x573be2];return _0x378751;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x78da('0x0'))['db'][_0x78da('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x78da('0x2')](0x0);var events={'afterCreate':_0x78da('0x3'),'afterUpdate':_0x78da('0x4'),'afterDestroy':_0x78da('0x5')};function emitEvent(_0x209ab){return function(_0x29463c,_0x53c76c,_0x21fb32){MailMessageEvents['emit'](_0x209ab+':'+_0x29463c['id'],_0x29463c);MailMessageEvents[_0x78da('0x6')](_0x209ab,_0x29463c);_0x21fb32(null);};}for(var e in events){if(events[_0x78da('0x7')](e)){var event=events[e];MailMessage[_0x78da('0x8')](e,emitEvent(event));}}module[_0x78da('0x9')]=MailMessageEvents; \ No newline at end of file +var _0xb1ed=['exports','events','MailMessage','update','emit','hasOwnProperty','hook'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0xb1ed,0x9b));var _0xdb1e=function(_0x5adb18,_0x222326){_0x5adb18=_0x5adb18-0x0;var _0x420c98=_0xb1ed[_0x5adb18];return _0x420c98;};'use strict';var EventEmitter=require(_0xdb1e('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xdb1e('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xdb1e('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5db50e){return function(_0x399a52,_0x3a0a7f,_0x296fe2){MailMessageEvents[_0xdb1e('0x3')](_0x5db50e+':'+_0x399a52['id'],_0x399a52);MailMessageEvents[_0xdb1e('0x3')](_0x5db50e,_0x399a52);_0x296fe2(null);};}for(var e in events){if(events[_0xdb1e('0x4')](e)){var event=events[e];MailMessage[_0xdb1e('0x5')](e,emitEvent(event));}}module[_0xdb1e('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 22a536b..0e9a462 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 _0xb449=['path','rimraf','../../config/environment','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId','then','error','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','html-to-text'];(function(_0x3f0122,_0x1627ca){var _0x2039d7=function(_0x5631dd){while(--_0x5631dd){_0x3f0122['push'](_0x3f0122['shift']());}};_0x2039d7(++_0x1627ca);}(_0xb449,0x90));var _0x9b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb449[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9b44('0x0'));var util=require(_0x9b44('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9b44('0x2'));var BPromise=require(_0x9b44('0x3'));var rp=require(_0x9b44('0x4'));var htmlToText=require(_0x9b44('0x5'));var fs=require('fs');var path=require(_0x9b44('0x6'));var rimraf=require(_0x9b44('0x7'));var config=require(_0x9b44('0x8'));var attributes=require('./mailMessage.attributes');module[_0x9b44('0x9')]=function(_0x2375c9,_0x1318da){return _0x2375c9[_0x9b44('0xa')](_0x9b44('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x9b44('0xc'),'fields':['messageId']},{'name':_0x9b44('0xd'),'fields':[_0x9b44('0xe'),'subject'],'type':_0x9b44('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x565416,_0x301056,_0x5844d4){if(_0x565416[_0x9b44('0x10')]){_0x565416[_0x9b44('0xe')]=htmlToText[_0x9b44('0x11')](_0x565416[_0x9b44('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5844d4(null,_0x301056);},'afterCreate':function(_0x51fa2f,_0x17dd90,_0x3d0d01){var _0x2bce5c=_0x2375c9['models'];var _0x3b1853=_0x51fa2f[_0x9b44('0x12')]({'plain':!![]});if(_0x3b1853[_0x9b44('0x13')][_0x9b44('0x14')]()==='in'||_0x3b1853['direction'][_0x9b44('0x14')]()===_0x9b44('0x15')&&!_0x3b1853[_0x9b44('0x16')]&&!_[_0x9b44('0x17')](_0x3b1853[_0x9b44('0x18')])){_0x2bce5c[_0x9b44('0x19')]['findOne']({'where':{'id':_0x3b1853[_0x9b44('0x1a')]}})[_0x9b44('0x1b')](function(_0x367e04){if(_0x367e04){_0x367e04['update']({'lastMsgAt':_0x3b1853['createdAt'],'lastMsgDirection':_0x3b1853[_0x9b44('0x13')]['toLowerCase']()});}})['catch'](function(_0x18d32e){console[_0x9b44('0x1c')](_0x18d32e);});}_0x3d0d01();}},'charset':'utf8mb4','collate':_0x9b44('0x1d')});}; \ No newline at end of file +var _0x01ea=['body','fromString','models','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','update','createdAt','catch','error','utf8mb4','lodash','../../config/logger','api','bluebird','path','rimraf','exports','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT'];(function(_0xf63a5d,_0x324c34){var _0x498e99=function(_0x15356c){while(--_0x15356c){_0xf63a5d['push'](_0xf63a5d['shift']());}};_0x498e99(++_0x324c34);}(_0x01ea,0x83));var _0xa01e=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x01ea[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0xa01e('0x0'));var util=require('util');var logger=require(_0xa01e('0x1'))(_0xa01e('0x2'));var moment=require('moment');var BPromise=require(_0xa01e('0x3'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xa01e('0x4'));var rimraf=require(_0xa01e('0x5'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0xa01e('0x6')]=function(_0x58ba25,_0x559373){return _0x58ba25[_0xa01e('0x7')](_0xa01e('0x8'),attributes,{'tableName':_0xa01e('0x9'),'paranoid':![],'indexes':[{'name':_0xa01e('0xa'),'fields':[_0xa01e('0xa')]},{'name':'fti_mail_messages','fields':[_0xa01e('0xb'),_0xa01e('0xc')],'type':_0xa01e('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xf96b9b,_0x3f5ccf,_0x203636){if(_0xf96b9b[_0xa01e('0xe')]){_0xf96b9b[_0xa01e('0xb')]=htmlToText[_0xa01e('0xf')](_0xf96b9b[_0xa01e('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x203636(null,_0x3f5ccf);},'afterCreate':function(_0x186a61,_0x138357,_0x1029bd){var _0x34b8e2=_0x58ba25[_0xa01e('0x10')];var _0x264762=_0x186a61['get']({'plain':!![]});if(_0x264762[_0xa01e('0x11')][_0xa01e('0x12')]()==='in'||_0x264762[_0xa01e('0x11')][_0xa01e('0x12')]()===_0xa01e('0x13')&&!_0x264762[_0xa01e('0x14')]&&!_[_0xa01e('0x15')](_0x264762['UserId'])){_0x34b8e2[_0xa01e('0x16')][_0xa01e('0x17')]({'where':{'id':_0x264762['MailInteractionId']}})['then'](function(_0x1dd866){if(_0x1dd866){_0x1dd866[_0xa01e('0x18')]({'lastMsgAt':_0x264762[_0xa01e('0x19')],'lastMsgDirection':_0x264762[_0xa01e('0x11')][_0xa01e('0x12')]()});}})[_0xa01e('0x1a')](function(_0xdbd554){console[_0xa01e('0x1b')](_0xdbd554);});}_0x1029bd();}},'charset':_0xa01e('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index fa93057..770012d 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 _0x6cb4=['result','catch','CreateMailMessage','MailMessage','create','body','options','raw','info','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6cb4,0xff));var _0x46cb=function(_0x2941d4,_0x995343){_0x2941d4=_0x2941d4-0x0;var _0x27d807=_0x6cb4[_0x2941d4];return _0x27d807;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rs=require(_0x46cb('0x4'));var fs=require('fs');var Redis=require(_0x46cb('0x5'));var db=require(_0x46cb('0x6'))['db'];var utils=require(_0x46cb('0x7'));var logger=require(_0x46cb('0x8'))('rpc');var config=require(_0x46cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46cb('0xa')]['http']({'port':0x232a});config[_0x46cb('0xb')]=_[_0x46cb('0xc')](config[_0x46cb('0xb')],{'host':_0x46cb('0xd'),'port':0x18eb});var socket=require(_0x46cb('0xe'))(new Redis(config[_0x46cb('0xb')]));require('./mailMessage.socket')[_0x46cb('0xf')](socket);function respondWithRpcPromise(_0x34f9e9,_0x48101c,_0x206f10){return new BPromise(function(_0x106a87,_0x4a60b2){return client[_0x46cb('0x10')](_0x34f9e9,_0x206f10)[_0x46cb('0x11')](function(_0x570cfd){logger['info']('MailMessage,\x20%s,\x20%s',_0x48101c,_0x46cb('0x12'));logger[_0x46cb('0x13')](_0x46cb('0x14'),_0x48101c,_0x46cb('0x12'),JSON['stringify'](_0x570cfd));if(_0x570cfd[_0x46cb('0x15')]){if(_0x570cfd[_0x46cb('0x15')][_0x46cb('0x16')]===0x1f4){logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0x570cfd[_0x46cb('0x15')][_0x46cb('0x18')]);return _0x4a60b2(_0x570cfd[_0x46cb('0x15')][_0x46cb('0x18')]);}logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0x570cfd['error'][_0x46cb('0x18')]);return _0x106a87(_0x570cfd['error'][_0x46cb('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x48101c,'request\x20sent');_0x106a87(_0x570cfd[_0x46cb('0x19')][_0x46cb('0x18')]);}})[_0x46cb('0x1a')](function(_0xcc8e2){logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0xcc8e2);_0x4a60b2(_0xcc8e2);});});}exports[_0x46cb('0x1b')]=function(_0x32e9fe){var _0x90cd50=this;return new Promise(function(_0xfc9064,_0x149483){return db[_0x46cb('0x1c')][_0x46cb('0x1d')](_0x32e9fe[_0x46cb('0x1e')],{'raw':_0x32e9fe[_0x46cb('0x1f')]?_0x32e9fe[_0x46cb('0x1f')][_0x46cb('0x20')]===undefined?!![]:![]:!![]})[_0x46cb('0x11')](function(_0x41ecd2){logger[_0x46cb('0x21')](_0x46cb('0x1b'),_0x32e9fe);logger[_0x46cb('0x13')](_0x46cb('0x1b'),_0x32e9fe,JSON[_0x46cb('0x22')](_0x41ecd2));_0xfc9064(_0x41ecd2);})[_0x46cb('0x1a')](function(_0x5a1338){logger['error'](_0x46cb('0x1b'),_0x5a1338[_0x46cb('0x18')],_0x32e9fe);_0x149483(_0x90cd50[_0x46cb('0x15')](0x1f4,_0x5a1338[_0x46cb('0x18')]));});});}; \ No newline at end of file +var _0xeb3b=['rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','body','options','then','CreateMailMessage','stringify','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x5f2a1c,_0x152626){var _0x993fb3=function(_0x1873a6){while(--_0x1873a6){_0x5f2a1c['push'](_0x5f2a1c['shift']());}};_0x993fb3(++_0x152626);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x415260,_0x135fcb){_0x415260=_0x415260-0x0;var _0x490f21=_0xeb3b[_0x415260];return _0x490f21;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));var BPromise=require(_0xbeb3('0x3'));var rs=require(_0xbeb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeb3('0x5'));var logger=require('../../config/logger')(_0xbeb3('0x6'));var config=require('../../config/environment');var jayson=require(_0xbeb3('0x7'));var client=jayson[_0xbeb3('0x8')][_0xbeb3('0x9')]({'port':0x232a});config[_0xbeb3('0xa')]=_[_0xbeb3('0xb')](config[_0xbeb3('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xbeb3('0xc'))(new Redis(config[_0xbeb3('0xa')]));require(_0xbeb3('0xd'))[_0xbeb3('0xe')](socket);function respondWithRpcPromise(_0x443396,_0x550805,_0x10161e){return new BPromise(function(_0x567333,_0x2d1e06){return client[_0xbeb3('0xf')](_0x443396,_0x10161e)['then'](function(_0x1dfff3){logger[_0xbeb3('0x10')](_0xbeb3('0x11'),_0x550805,_0xbeb3('0x12'));logger[_0xbeb3('0x13')](_0xbeb3('0x14'),_0x550805,'request\x20sent',JSON['stringify'](_0x1dfff3));if(_0x1dfff3[_0xbeb3('0x15')]){if(_0x1dfff3[_0xbeb3('0x15')]['code']===0x1f4){logger['error'](_0xbeb3('0x11'),_0x550805,_0x1dfff3[_0xbeb3('0x15')][_0xbeb3('0x16')]);return _0x2d1e06(_0x1dfff3[_0xbeb3('0x15')][_0xbeb3('0x16')]);}logger['error'](_0xbeb3('0x11'),_0x550805,_0x1dfff3['error'][_0xbeb3('0x16')]);return _0x567333(_0x1dfff3['error']['message']);}else{logger['info'](_0xbeb3('0x11'),_0x550805,_0xbeb3('0x12'));_0x567333(_0x1dfff3[_0xbeb3('0x17')][_0xbeb3('0x16')]);}})['catch'](function(_0x233a62){logger[_0xbeb3('0x15')](_0xbeb3('0x11'),_0x550805,_0x233a62);_0x2d1e06(_0x233a62);});});}exports['CreateMailMessage']=function(_0x4af96f){var _0x31c1bf=this;return new Promise(function(_0x57e8b6,_0x1d917b){return db['MailMessage']['create'](_0x4af96f[_0xbeb3('0x18')],{'raw':_0x4af96f[_0xbeb3('0x19')]?_0x4af96f[_0xbeb3('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbeb3('0x1a')](function(_0x18ea0f){logger['info'](_0xbeb3('0x1b'),_0x4af96f);logger[_0xbeb3('0x13')]('CreateMailMessage',_0x4af96f,JSON[_0xbeb3('0x1c')](_0x18ea0f));_0x57e8b6(_0x18ea0f);})[_0xbeb3('0x1d')](function(_0x16b079){logger[_0xbeb3('0x15')](_0xbeb3('0x1b'),_0x16b079[_0xbeb3('0x16')],_0x4af96f);_0x1d917b(_0x31c1bf[_0xbeb3('0x15')](0x1f4,_0x16b079[_0xbeb3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index cdec5dd..18c5c18 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 _0x8176=['update','emit','removeListener','register','length','mailMessage:','./mailMessage.events','remove'];(function(_0x277641,_0x482581){var _0xc434d0=function(_0x5a7ba6){while(--_0x5a7ba6){_0x277641['push'](_0x277641['shift']());}};_0xc434d0(++_0x482581);}(_0x8176,0xfe));var _0x6817=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x8176[_0x55f8b4];return _0x2475f9;};'use strict';var MailMessageEvents=require(_0x6817('0x0'));var events=['save',_0x6817('0x1'),_0x6817('0x2')];function createListener(_0x324280,_0x49675b){return function(_0x334c22){_0x49675b[_0x6817('0x3')](_0x324280,_0x334c22);};}function removeListener(_0x1f89a8,_0x525340){return function(){MailMessageEvents[_0x6817('0x4')](_0x1f89a8,_0x525340);};}exports[_0x6817('0x5')]=function(_0x428519){for(var _0x4a10e8=0x0,_0x236e94=events[_0x6817('0x6')];_0x4a10e8<_0x236e94;_0x4a10e8++){var _0x54279b=events[_0x4a10e8];var _0x401d5d=createListener(_0x6817('0x7')+_0x54279b,_0x428519);MailMessageEvents['on'](_0x54279b,_0x401d5d);}}; \ No newline at end of file +var _0xa553=['./mailMessage.events','save','remove','update','removeListener','register','length','mailMessage:'];(function(_0x152678,_0x11e0ac){var _0x311a9=function(_0x4f5291){while(--_0x4f5291){_0x152678['push'](_0x152678['shift']());}};_0x311a9(++_0x11e0ac);}(_0xa553,0x158));var _0x3a55=function(_0xdca04e,_0x44900c){_0xdca04e=_0xdca04e-0x0;var _0x82c057=_0xa553[_0xdca04e];return _0x82c057;};'use strict';var MailMessageEvents=require(_0x3a55('0x0'));var events=[_0x3a55('0x1'),_0x3a55('0x2'),_0x3a55('0x3')];function createListener(_0x7d0b52,_0x41dd31){return function(_0x1636ba){_0x41dd31['emit'](_0x7d0b52,_0x1636ba);};}function removeListener(_0x287402,_0xfc35ae){return function(){MailMessageEvents[_0x3a55('0x4')](_0x287402,_0xfc35ae);};}exports[_0x3a55('0x5')]=function(_0x285fb3){for(var _0x488937=0x0,_0x4fd97a=events[_0x3a55('0x6')];_0x488937<_0x4fd97a;_0x488937++){var _0x17a451=events[_0x488937];var _0x218ccb=createListener(_0x3a55('0x7')+_0x17a451,_0x285fb3);MailMessageEvents['on'](_0x17a451,_0x218ccb);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 445b70f..4d9f989 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 _0x6b43=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getAgents','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3fbeba,_0x586f51){var _0x2d5677=function(_0x3559a1){while(--_0x3559a1){_0x3fbeba['push'](_0x3fbeba['shift']());}};_0x2d5677(++_0x586f51);}(_0x6b43,0x12e));var _0x36b4=function(_0x559fa0,_0x18562d){_0x559fa0=_0x559fa0-0x0;var _0xa9e414=_0x6b43[_0x559fa0];return _0xa9e414;};'use strict';var multer=require(_0x36b4('0x0'));var util=require(_0x36b4('0x1'));var path=require(_0x36b4('0x2'));var timeout=require(_0x36b4('0x3'));var express=require(_0x36b4('0x4'));var router=express[_0x36b4('0x5')]();var fs_extra=require(_0x36b4('0x6'));var auth=require(_0x36b4('0x7'));var interaction=require(_0x36b4('0x8'));var config=require(_0x36b4('0x9'));var controller=require('./mailQueue.controller');router[_0x36b4('0xa')]('/',auth[_0x36b4('0xb')](),controller[_0x36b4('0xc')]);router[_0x36b4('0xa')](_0x36b4('0xd'),auth['isAuthenticated'](),controller[_0x36b4('0xe')]);router['get'](_0x36b4('0xf'),auth[_0x36b4('0xb')](),controller[_0x36b4('0x10')]);router[_0x36b4('0xa')](_0x36b4('0x11'),auth[_0x36b4('0xb')](),controller['getMembers']);router['get'](_0x36b4('0x12'),auth[_0x36b4('0xb')](),controller['getTeams']);router[_0x36b4('0xa')]('/:id/users',auth[_0x36b4('0xb')](),controller[_0x36b4('0x13')]);router[_0x36b4('0x14')]('/',auth['isAuthenticated'](),controller[_0x36b4('0x15')]);router[_0x36b4('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x36b4('0x16')]);router['post']('/:id/users',auth[_0x36b4('0xb')](),controller[_0x36b4('0x17')]);router['put'](_0x36b4('0xf'),auth[_0x36b4('0xb')](),controller[_0x36b4('0x18')]);router[_0x36b4('0x19')](_0x36b4('0xf'),auth['isAuthenticated'](),controller[_0x36b4('0x1a')]);router[_0x36b4('0x19')](_0x36b4('0x12'),auth[_0x36b4('0xb')](),controller[_0x36b4('0x1b')]);router[_0x36b4('0x19')](_0x36b4('0x1c'),auth[_0x36b4('0xb')](),controller[_0x36b4('0x1d')]);module[_0x36b4('0x1e')]=router; \ No newline at end of file +var _0xdcca=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','util','path','express','Router','fs-extra'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xdcca,0x82));var _0xadcc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdcca[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xadcc('0x0'));var path=require(_0xadcc('0x1'));var timeout=require('connect-timeout');var express=require(_0xadcc('0x2'));var router=express[_0xadcc('0x3')]();var fs_extra=require(_0xadcc('0x4'));var auth=require(_0xadcc('0x5'));var interaction=require(_0xadcc('0x6'));var config=require(_0xadcc('0x7'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0xadcc('0x8')](),controller['index']);router[_0xadcc('0x9')](_0xadcc('0xa'),auth[_0xadcc('0x8')](),controller[_0xadcc('0xb')]);router[_0xadcc('0x9')](_0xadcc('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xadcc('0x9')]('/:id/members',auth[_0xadcc('0x8')](),controller[_0xadcc('0xd')]);router['get'](_0xadcc('0xe'),auth['isAuthenticated'](),controller[_0xadcc('0xf')]);router['get'](_0xadcc('0x10'),auth[_0xadcc('0x8')](),controller['getAgents']);router[_0xadcc('0x11')]('/',auth['isAuthenticated'](),controller[_0xadcc('0x12')]);router[_0xadcc('0x11')](_0xadcc('0xe'),auth['isAuthenticated'](),controller[_0xadcc('0x13')]);router[_0xadcc('0x11')](_0xadcc('0x10'),auth[_0xadcc('0x8')](),controller[_0xadcc('0x14')]);router[_0xadcc('0x15')](_0xadcc('0xc'),auth[_0xadcc('0x8')](),controller[_0xadcc('0x16')]);router[_0xadcc('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xadcc('0x18')]);router[_0xadcc('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0xadcc('0x19')]);router[_0xadcc('0x17')](_0xadcc('0x10'),auth[_0xadcc('0x8')](),controller[_0xadcc('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 064f730..48dd9e0 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 _0xb718=['rrmemory','roundrobin','sequelize','STRING','name'];(function(_0x1e8e7b,_0x590356){var _0x523be6=function(_0x5d33e0){while(--_0x5d33e0){_0x1e8e7b['push'](_0x1e8e7b['shift']());}};_0x523be6(++_0x590356);}(_0xb718,0x179));var _0x8b71=function(_0x38e717,_0x5b8bba){_0x38e717=_0x38e717-0x0;var _0x5bda01=_0xb718[_0x38e717];return _0x5bda01;};'use strict';var Sequelize=require(_0x8b71('0x0'));module['exports']={'name':{'type':Sequelize[_0x8b71('0x1')],'unique':_0x8b71('0x2'),'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'](_0x8b71('0x3'),'beepall',_0x8b71('0x4'))}}; \ No newline at end of file +var _0x951b=['rrmemory','beepall','roundrobin','sequelize','exports','name','STRING','ENUM'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x951b,0x133));var _0xb951=function(_0x4d9061,_0x28583f){_0x4d9061=_0x4d9061-0x0;var _0x54b083=_0x951b[_0x4d9061];return _0x54b083;};'use strict';var Sequelize=require(_0xb951('0x0'));module[_0xb951('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb951('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb951('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb951('0x4')](_0xb951('0x5'),_0xb951('0x6'),_0xb951('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 7e1c256..069750d 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 _0xc957=['pick','hasOwnProperty','addTeams','ids','Agents','online','flatMap','sequelize','transaction','each','emit','userMailQueue:save','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','union','compact','value','removeTeams','isEmpty','forEach','userMailQueue:remove','addAgents','omit','spread','removeAgents','getAgents','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','redis','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','get','MailQueues','UserProfileResource','destroy','sendStatus','error','stack','name','send','map','MailQueue','rawAttributes','fieldName','type','key','where','include','query','rows','catch','show','params','model','keys','filters','intersection','attributes','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','fields','nolimit','order','sort','filter','findAll','User','findAndCountAll','agent','mailPause','createdAt','%s/%s','SIP','getTeams','findOne','Team'];(function(_0x79f5a7,_0x570dfb){var _0x43fb06=function(_0x14d156){while(--_0x14d156){_0x79f5a7['push'](_0x79f5a7['shift']());}};_0x43fb06(++_0x570dfb);}(_0xc957,0x98));var _0x7c95=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xc957[_0x47b58b];return _0x46bebe;};'use strict';var BPromise=require(_0x7c95('0x0'));var util=require('util');var _=require(_0x7c95('0x1'));var squel=require('squel');var Redis=require(_0x7c95('0x2'));var qs=require(_0x7c95('0x3'));var logger=require(_0x7c95('0x4'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7c95('0x5')]=_['defaults'](config['redis'],{'host':_0x7c95('0x6'),'port':0x18eb});var socket=require(_0x7c95('0x7'))(new Redis(config[_0x7c95('0x5')]));require('./mailQueue.socket')[_0x7c95('0x8')](socket);function respondWithStatusCode(_0x1e42eb,_0x473328){_0x473328=_0x473328||0xcc;return function(_0x3af5a5){if(_0x3af5a5){return _0x1e42eb['sendStatus'](_0x473328);}return _0x1e42eb[_0x7c95('0x9')](_0x473328)[_0x7c95('0xa')]();};}function respondWithResult(_0x55e164,_0xb26954){_0xb26954=_0xb26954||0xc8;return function(_0x147e32){if(_0x147e32){return _0x55e164[_0x7c95('0x9')](_0xb26954)[_0x7c95('0xb')](_0x147e32);}};}function respondWithFilteredResult(_0x567b1e,_0x281ff8){return function(_0x1341f8){if(_0x1341f8){var _0x8f5e92=typeof _0x281ff8['offset']===_0x7c95('0xc')&&typeof _0x281ff8[_0x7c95('0xd')]===_0x7c95('0xc');var _0x125561=_0x1341f8[_0x7c95('0xe')];var _0x5c3859=_0x8f5e92?0x0:_0x281ff8[_0x7c95('0xf')];var _0x330f14=_0x8f5e92?_0x1341f8[_0x7c95('0xe')]:_0x281ff8[_0x7c95('0xf')]+_0x281ff8[_0x7c95('0xd')];var _0x1dbfa0;if(_0x330f14>=_0x125561){_0x330f14=_0x125561;_0x1dbfa0=0xc8;}else{_0x1dbfa0=0xce;}_0x567b1e['status'](_0x1dbfa0);return _0x567b1e[_0x7c95('0x10')](_0x7c95('0x11'),_0x5c3859+'-'+_0x330f14+'/'+_0x125561)[_0x7c95('0xb')](_0x1341f8);}return null;};}function saveUpdates(_0x466ea8){return function(_0xde0fb3){if(_0xde0fb3){return _0xde0fb3[_0x7c95('0x12')](_0x466ea8)['then'](function(_0x2909b6){return _0x2909b6;});}return null;};}function removeEntity(_0x24cb18){return function(_0x376942){if(_0x376942){return _0x376942['destroy']()[_0x7c95('0x13')](function(){var _0x26ff06=_0x376942[_0x7c95('0x14')]({'plain':!![]});var _0xcd621d=_0x7c95('0x15');return db[_0x7c95('0x16')][_0x7c95('0x17')]({'where':{'type':_0xcd621d,'resourceId':_0x26ff06['id']}})[_0x7c95('0x13')](function(){return _0x376942;});})[_0x7c95('0x13')](function(){_0x24cb18[_0x7c95('0x9')](0xcc)[_0x7c95('0xa')]();});}};}function handleEntityNotFound(_0x3f9c4b){return function(_0x5e928e){if(!_0x5e928e){_0x3f9c4b[_0x7c95('0x18')](0x194);}return _0x5e928e;};}function handleError(_0x3eae9f,_0x40c60a){_0x40c60a=_0x40c60a||0x1f4;return function(_0x2e23b8){logger[_0x7c95('0x19')](_0x2e23b8[_0x7c95('0x1a')]);if(_0x2e23b8['name']){delete _0x2e23b8[_0x7c95('0x1b')];}_0x3eae9f[_0x7c95('0x9')](_0x40c60a)[_0x7c95('0x1c')](_0x2e23b8);};}exports['index']=function(_0xf2bfb7,_0x471dba){var _0x2bfd58={};var _0x5307c9={'count':0x0,'rows':[]};var _0x177545=_[_0x7c95('0x1d')](db[_0x7c95('0x1e')][_0x7c95('0x1f')],function(_0x4e7a2){return{'name':_0x4e7a2[_0x7c95('0x20')],'type':_0x4e7a2[_0x7c95('0x21')][_0x7c95('0x22')]};});_0x2bfd58=qs['getOptions'](_0x177545,_0xf2bfb7);var _0x4e7f7d={'where':_0x2bfd58[_0x7c95('0x23')]};return db[_0x7c95('0x1e')][_0x7c95('0xe')](_0x4e7f7d)[_0x7c95('0x13')](function(_0x1a8008){_0x5307c9[_0x7c95('0xe')]=_0x1a8008;_0x2bfd58[_0x7c95('0x24')]=qs[_0x7c95('0x24')](_0xf2bfb7[_0x7c95('0x25')]);return db[_0x7c95('0x1e')]['findAll'](_0x2bfd58);})[_0x7c95('0x13')](function(_0x1519f6){_0x5307c9[_0x7c95('0x26')]=_0x1519f6;return _0x5307c9;})[_0x7c95('0x13')](respondWithFilteredResult(_0x471dba,_0x2bfd58))[_0x7c95('0x27')](handleError(_0x471dba,null));};exports[_0x7c95('0x28')]=function(_0x407875,_0x203b7c){var _0x324c3d={'raw':!![],'where':{'id':_0x407875[_0x7c95('0x29')]['id']}},_0x8e26d2={};_0x8e26d2[_0x7c95('0x2a')]=_[_0x7c95('0x2b')](db[_0x7c95('0x1e')]['rawAttributes']);_0x8e26d2['query']=_[_0x7c95('0x2b')](_0x407875['query']);_0x8e26d2[_0x7c95('0x2c')]=_[_0x7c95('0x2d')](_0x8e26d2['model'],_0x8e26d2[_0x7c95('0x25')]);_0x324c3d[_0x7c95('0x2e')]=_['intersection'](_0x8e26d2[_0x7c95('0x2a')],qs['fields'](_0x407875[_0x7c95('0x25')]['fields']));_0x324c3d['attributes']=_0x324c3d[_0x7c95('0x2e')][_0x7c95('0x2f')]?_0x324c3d['attributes']:_0x8e26d2[_0x7c95('0x2a')];if(_0x407875['query'][_0x7c95('0x30')]){_0x324c3d[_0x7c95('0x24')]=[{'all':!![]}];}_0x324c3d=_[_0x7c95('0x31')]({},_0x324c3d,_0x407875[_0x7c95('0x32')]);return db[_0x7c95('0x1e')][_0x7c95('0x33')](_0x324c3d)['then'](handleEntityNotFound(_0x203b7c,null))[_0x7c95('0x13')](respondWithResult(_0x203b7c,null))['catch'](handleError(_0x203b7c,null));};exports[_0x7c95('0x34')]=function(_0x48ca51,_0x180959){return db[_0x7c95('0x1e')]['create'](_0x48ca51[_0x7c95('0x35')],{})['then'](function(_0x5b1876){var _0x9a273a=_0x48ca51[_0x7c95('0x36')]['get']({'plain':!![]});if(!_0x9a273a)throw new Error(_0x7c95('0x37'));if(_0x9a273a[_0x7c95('0x38')]===_0x7c95('0x36')){var _0x5baaba=_0x5b1876[_0x7c95('0x14')]({'plain':!![]});var _0x29af22=_0x7c95('0x15');return db['UserProfileSection'][_0x7c95('0x33')]({'where':{'name':_0x29af22,'userProfileId':_0x9a273a['userProfileId']},'raw':!![]})['then'](function(_0x39252a){if(_0x39252a&&_0x39252a[_0x7c95('0x39')]===0x0){return db[_0x7c95('0x16')][_0x7c95('0x34')]({'name':_0x5baaba[_0x7c95('0x1b')],'resourceId':_0x5baaba['id'],'type':_0x39252a[_0x7c95('0x1b')],'sectionId':_0x39252a['id']},{})['then'](function(){return _0x5b1876;});}else{return _0x5b1876;}})[_0x7c95('0x27')](function(_0x589d58){logger[_0x7c95('0x19')](_0x7c95('0x3a'),_0x589d58);throw _0x589d58;});}return _0x5b1876;})[_0x7c95('0x13')](respondWithResult(_0x180959,0xc9))[_0x7c95('0x27')](handleError(_0x180959,null));};exports['update']=function(_0x432781,_0x42bc0b){if(_0x432781[_0x7c95('0x35')]['id']){delete _0x432781[_0x7c95('0x35')]['id'];}return db[_0x7c95('0x1e')]['find']({'where':{'id':_0x432781[_0x7c95('0x29')]['id']}})[_0x7c95('0x13')](handleEntityNotFound(_0x42bc0b,null))[_0x7c95('0x13')](saveUpdates(_0x432781[_0x7c95('0x35')],null))[_0x7c95('0x13')](respondWithResult(_0x42bc0b,null))['catch'](handleError(_0x42bc0b,null));};exports[_0x7c95('0x17')]=function(_0x37833c,_0x234dd0){return db[_0x7c95('0x1e')][_0x7c95('0x33')]({'where':{'id':_0x37833c[_0x7c95('0x29')]['id']}})[_0x7c95('0x13')](handleEntityNotFound(_0x234dd0,null))['then'](removeEntity(_0x234dd0,null))[_0x7c95('0x27')](handleError(_0x234dd0,null));};exports['describe']=function(_0x59d74e,_0x194392){return db[_0x7c95('0x1e')][_0x7c95('0x3b')]()[_0x7c95('0x13')](respondWithResult(_0x194392,null))[_0x7c95('0x27')](handleError(_0x194392,null));};exports[_0x7c95('0x3c')]=function(_0x328936,_0x34451a){var _0x1f028b={'raw':!![],'where':{}},_0x2260f5={},_0xbd0015;return db[_0x7c95('0x1e')]['findOne']({'where':{'id':_0x328936['params']['id']}})['then'](handleEntityNotFound(_0x34451a,null))[_0x7c95('0x13')](function(_0x2ff330){if(_0x2ff330){_0xbd0015=_0x2ff330['get']({'plain':!![]});_0x2260f5[_0x7c95('0x2a')]=_[_0x7c95('0x2b')](db[_0x7c95('0x3d')]['rawAttributes']);_0x2260f5['query']=_[_0x7c95('0x2b')](_0x328936['query']);_0x2260f5[_0x7c95('0x2c')]=_[_0x7c95('0x2d')](_0x2260f5[_0x7c95('0x2a')],_0x2260f5[_0x7c95('0x25')]);_0x1f028b['attributes']=_[_0x7c95('0x2d')](_0x2260f5[_0x7c95('0x2a')],qs['fields'](_0x328936[_0x7c95('0x25')][_0x7c95('0x3e')]));_0x1f028b[_0x7c95('0x2e')]=_0x1f028b[_0x7c95('0x2e')][_0x7c95('0x2f')]?_0x1f028b[_0x7c95('0x2e')]:_0x2260f5[_0x7c95('0x2a')];if(!_0x328936['query']['hasOwnProperty'](_0x7c95('0x3f'))){_0x1f028b[_0x7c95('0xd')]=qs[_0x7c95('0xd')](_0x328936[_0x7c95('0x25')][_0x7c95('0xd')]);_0x1f028b[_0x7c95('0xf')]=qs[_0x7c95('0xf')](_0x328936[_0x7c95('0x25')]['offset']);}_0x1f028b[_0x7c95('0x40')]=qs[_0x7c95('0x41')](_0x328936[_0x7c95('0x25')][_0x7c95('0x41')]);_0x1f028b['where']=qs[_0x7c95('0x2c')](_['pick'](_0x328936[_0x7c95('0x25')],_0x2260f5[_0x7c95('0x2c')]));_0x1f028b[_0x7c95('0x23')]['MailQueueId']=_0x2ff330['id'];if(_0x328936[_0x7c95('0x25')][_0x7c95('0x42')]){_0x1f028b[_0x7c95('0x23')]=_[_0x7c95('0x31')](_0x1f028b[_0x7c95('0x23')],{'$or':_['map'](_0x1f028b['attributes'],function(_0xa9d05e){var _0x45f1ff={};_0x45f1ff[_0xa9d05e]={'$like':'%'+_0x328936[_0x7c95('0x25')][_0x7c95('0x42')]+'%'};return _0x45f1ff;})});}_0x1f028b=_['merge']({},_0x1f028b,_0x328936[_0x7c95('0x32')]);return db[_0x7c95('0x3d')][_0x7c95('0x43')](_0x1f028b);}})[_0x7c95('0x13')](function(_0x1d272d){if(_0x1d272d){return db[_0x7c95('0x44')][_0x7c95('0x45')]({'where':{'id':_[_0x7c95('0x1d')](_0x1d272d,'UserId'),'role':_0x7c95('0x46')},'attributes':['id','name',_0x7c95('0x47'),'updatedAt',_0x7c95('0x48')]});}})[_0x7c95('0x13')](function(_0x19c173){if(_0x19c173){return{'count':_0x19c173[_0x7c95('0xe')],'rows':_[_0x7c95('0x1d')](_0x19c173[_0x7c95('0x26')],function(_0x4d50e0){return{'membername':_0x4d50e0[_0x7c95('0x1b')],'UserId':_0x4d50e0['id'],'queue_name':_0xbd0015[_0x7c95('0x1b')],'MailQueueId':_0xbd0015['id'],'interface':util['format'](_0x7c95('0x49'),_0x7c95('0x4a'),_0x4d50e0[_0x7c95('0x1b')]),'penalty':0x0,'paused':_0x4d50e0[_0x7c95('0x47')],'createdAt':_0x4d50e0[_0x7c95('0x48')],'updatedAt':_0x4d50e0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7c95('0x13')](respondWithFilteredResult(_0x34451a,_0x1f028b))[_0x7c95('0x27')](handleError(_0x34451a,null));};exports[_0x7c95('0x4b')]=function(_0x5b0e1e,_0x521e39){var _0x193c5f={};var _0x968c9f={};var _0x168a06;var _0x26a849;return db[_0x7c95('0x1e')][_0x7c95('0x4c')]({'where':{'id':_0x5b0e1e[_0x7c95('0x29')]['id']}})[_0x7c95('0x13')](handleEntityNotFound(_0x521e39,null))[_0x7c95('0x13')](function(_0x301502){if(_0x301502){_0x168a06=_0x301502;_0x968c9f['model']=_['keys'](db[_0x7c95('0x4d')][_0x7c95('0x1f')]);_0x968c9f[_0x7c95('0x25')]=_[_0x7c95('0x2b')](_0x5b0e1e[_0x7c95('0x25')]);_0x968c9f['filters']=_[_0x7c95('0x2d')](_0x968c9f[_0x7c95('0x2a')],_0x968c9f[_0x7c95('0x25')]);_0x193c5f[_0x7c95('0x2e')]=_[_0x7c95('0x2d')](_0x968c9f['model'],qs[_0x7c95('0x3e')](_0x5b0e1e[_0x7c95('0x25')][_0x7c95('0x3e')]));_0x193c5f[_0x7c95('0x2e')]=_0x193c5f[_0x7c95('0x2e')]['length']?_0x193c5f[_0x7c95('0x2e')]:_0x968c9f[_0x7c95('0x2a')];_0x193c5f['order']=qs[_0x7c95('0x41')](_0x5b0e1e[_0x7c95('0x25')][_0x7c95('0x41')]);_0x193c5f[_0x7c95('0x23')]=qs[_0x7c95('0x2c')](_[_0x7c95('0x4e')](_0x5b0e1e['query'],_0x968c9f[_0x7c95('0x2c')]));if(_0x5b0e1e[_0x7c95('0x25')][_0x7c95('0x42')]){_0x193c5f[_0x7c95('0x23')]=_[_0x7c95('0x31')](_0x193c5f[_0x7c95('0x23')],{'$or':_['map'](_0x193c5f[_0x7c95('0x2e')],function(_0x2f7c5d){var _0x2185b2={};_0x2185b2[_0x2f7c5d]={'$like':'%'+_0x5b0e1e['query'][_0x7c95('0x42')]+'%'};return _0x2185b2;})});}_0x193c5f=_[_0x7c95('0x31')]({},_0x193c5f,_0x5b0e1e[_0x7c95('0x32')]);return _0x168a06[_0x7c95('0x4b')](_0x193c5f);}})[_0x7c95('0x13')](function(_0x502d26){if(_0x502d26){_0x26a849=_0x502d26[_0x7c95('0x2f')];if(!_0x5b0e1e['query'][_0x7c95('0x4f')](_0x7c95('0x3f'))){_0x193c5f['limit']=qs[_0x7c95('0xd')](_0x5b0e1e[_0x7c95('0x25')][_0x7c95('0xd')]);_0x193c5f[_0x7c95('0xf')]=qs[_0x7c95('0xf')](_0x5b0e1e[_0x7c95('0x25')][_0x7c95('0xf')]);}return _0x168a06[_0x7c95('0x4b')](_0x193c5f);}})['then'](function(_0x599b55){if(_0x599b55){return _0x599b55?{'count':_0x26a849,'rows':_0x599b55}:null;}})[_0x7c95('0x13')](respondWithResult(_0x521e39,null))['catch'](handleError(_0x521e39,null));};exports[_0x7c95('0x50')]=function(_0x348e11,_0x365caf){var _0x31138c=_0x348e11['body'][_0x7c95('0x51')];return db[_0x7c95('0x4d')][_0x7c95('0x43')]({'where':{'id':_0x31138c},'attributes':['id'],'include':[{'model':db[_0x7c95('0x44')],'as':_0x7c95('0x52'),'attributes':['id',_0x7c95('0x1b'),_0x7c95('0x53'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x2f1cb7){if(_0x2f1cb7){var _0x576299=_[_0x7c95('0x54')](_0x2f1cb7,function(_0x3945f6){var _0x5a4ed5=_0x3945f6[_0x7c95('0x14')]({'plain':!![]});return _0x5a4ed5[_0x7c95('0x52')];});return db['MailQueue'][_0x7c95('0x33')]({'where':{'id':_0x348e11[_0x7c95('0x29')]['id']}})['then'](function(_0x332e67){return db[_0x7c95('0x55')][_0x7c95('0x56')](function(_0x483905){return _0x332e67['addTeams'](_0x31138c,{'transaction':_0x483905})[_0x7c95('0x13')](function(){return BPromise[_0x7c95('0x57')](_0x576299,function(_0x4c5ab2){return db[_0x7c95('0x3d')]['findOrCreate']({'where':{'UserId':_0x4c5ab2['id'],'MailQueueId':_0x348e11[_0x7c95('0x29')]['id']},'transaction':_0x483905});});})['then'](function(){_0x576299['forEach'](function(_0xc4acc2){socket[_0x7c95('0x58')](_0x7c95('0x59'),{'UserId':_0xc4acc2['id'],'MailQueueId':_0x332e67['id']});});});});});}})[_0x7c95('0x13')](respondWithStatusCode(_0x365caf,null))[_0x7c95('0x27')](handleError(_0x365caf,null));};exports['removeTeams']=function(_0x396f53,_0x3c0a21){return db[_0x7c95('0x4d')]['findAll']({'where':{'id':_0x396f53[_0x7c95('0x25')][_0x7c95('0x51')]},'attributes':['id'],'include':[{'model':db[_0x7c95('0x44')],'as':_0x7c95('0x52'),'attributes':['id'],'raw':!![]}]})[_0x7c95('0x13')](handleEntityNotFound(_0x3c0a21,null))[_0x7c95('0x13')](function(_0x2615f8){var _0x3143d6=_[_0x7c95('0x1d')](_0x2615f8,'id');var _0x312a52=[];var _0x4f38c8=[];var _0x437cad=squel[_0x7c95('0x5a')]();_0x437cad[_0x7c95('0x5b')](_0x7c95('0x5c'))['from'](_0x7c95('0x5d'),'tq')[_0x7c95('0x5e')](_0x7c95('0x5f'),'ut',_0x7c95('0x60'))['where']('MailQueueId\x20=\x20?',_0x396f53['params']['id']);for(var _0x1e9a72=0x0;_0x1e9a72<_0x2615f8[_0x7c95('0x2f')];_0x1e9a72+=0x1){let _0x35939b=_0x2615f8[_0x1e9a72];for(var _0x281ed6=0x0;_0x281ed6<_0x35939b[_0x7c95('0x52')][_0x7c95('0x2f')];_0x281ed6+=0x1){let _0x42958c=_0x35939b['Agents'][_0x281ed6];var _0x5712ad=_0x437cad[_0x7c95('0x61')]();_0x5712ad[_0x7c95('0x23')](_0x7c95('0x62'),_0x42958c['id']);_0x4f38c8['push'](db[_0x7c95('0x55')][_0x7c95('0x25')](_0x5712ad[_0x7c95('0x63')](),{'type':db[_0x7c95('0x55')]['QueryTypes'][_0x7c95('0x64')]})[_0x7c95('0x13')](function(_0x27cf4b){if(_0x27cf4b[_0x7c95('0x2f')]===0x1){return _0x42958c['id'];}else{var _0x13edac=_['every'](_[_0x7c95('0x1d')](_0x27cf4b,_0x7c95('0x65')),function(_0x30a1c5){return _[_0x7c95('0x66')](_0x3143d6,_0x30a1c5);});if(_0x13edac){return _0x42958c['id'];}}}));}}return BPromise['all'](_0x4f38c8)[_0x7c95('0x13')](function(_0x1509d8){_0x312a52=_(_0x312a52)[_0x7c95('0x67')](_0x1509d8)[_0x7c95('0x68')]()[_0x7c95('0x69')]();return db[_0x7c95('0x1e')][_0x7c95('0x33')]({'where':{'id':_0x396f53[_0x7c95('0x29')]['id']}})[_0x7c95('0x13')](function(_0xe583d9){return db[_0x7c95('0x55')][_0x7c95('0x56')](function(_0x2d9e8e){return _0xe583d9[_0x7c95('0x6a')](_0x396f53[_0x7c95('0x25')][_0x7c95('0x51')],{'transaction':_0x2d9e8e})[_0x7c95('0x13')](function(){if(!_[_0x7c95('0x6b')](_0x312a52)){return _0xe583d9['removeAgents'](_0x312a52,{'transaction':_0x2d9e8e});}})[_0x7c95('0x13')](function(){_0x312a52[_0x7c95('0x6c')](function(_0x505271){socket[_0x7c95('0x58')](_0x7c95('0x6d'),{'UserId':_0x505271,'MailQueueId':_0xe583d9['id']});});});});});});})[_0x7c95('0x13')](respondWithStatusCode(_0x3c0a21,null))[_0x7c95('0x27')](handleError(_0x3c0a21,null));};exports[_0x7c95('0x6e')]=function(_0x7a4a6b,_0x4643e5){return db['MailQueue'][_0x7c95('0x33')]({'where':{'id':_0x7a4a6b[_0x7c95('0x29')]['id']}})['then'](handleEntityNotFound(_0x4643e5,null))[_0x7c95('0x13')](function(_0x57f513){if(_0x57f513){return _0x57f513[_0x7c95('0x6e')](_0x7a4a6b[_0x7c95('0x35')][_0x7c95('0x51')],_[_0x7c95('0x6f')](_0x7a4a6b[_0x7c95('0x35')],[_0x7c95('0x51'),'id'])||{})[_0x7c95('0x70')](function(_0x52af04){for(var _0x2ea4ec=0x0;_0x2ea4ec<_0x7a4a6b[_0x7c95('0x35')][_0x7c95('0x51')]['length'];_0x2ea4ec+=0x1){socket[_0x7c95('0x58')](_0x7c95('0x59'),{'UserId':Number(_0x7a4a6b[_0x7c95('0x35')][_0x7c95('0x51')][_0x2ea4ec]),'MailQueueId':Number(_0x7a4a6b[_0x7c95('0x29')]['id'])});}return _0x52af04;});}})[_0x7c95('0x13')](respondWithResult(_0x4643e5,null))[_0x7c95('0x27')](handleError(_0x4643e5,null));};exports['removeAgents']=function(_0x25e631,_0x3e0639){return db[_0x7c95('0x1e')][_0x7c95('0x33')]({'where':{'id':_0x25e631[_0x7c95('0x29')]['id']}})[_0x7c95('0x13')](handleEntityNotFound(_0x3e0639,null))[_0x7c95('0x13')](function(_0x5efed3){if(_0x5efed3){return _0x5efed3[_0x7c95('0x71')](_0x25e631[_0x7c95('0x25')][_0x7c95('0x51')])[_0x7c95('0x13')](function(){if(_['isArray'](_0x25e631[_0x7c95('0x25')][_0x7c95('0x51')])){for(var _0x55e041=0x0;_0x55e041<_0x25e631[_0x7c95('0x25')][_0x7c95('0x51')][_0x7c95('0x2f')];_0x55e041+=0x1){socket[_0x7c95('0x58')]('userMailQueue:remove',{'UserId':Number(_0x25e631['query'][_0x7c95('0x51')][_0x55e041]),'MailQueueId':Number(_0x25e631[_0x7c95('0x29')]['id'])});}}else{socket[_0x7c95('0x58')](_0x7c95('0x6d'),{'UserId':Number(_0x25e631['query'][_0x7c95('0x51')]),'MailQueueId':Number(_0x25e631[_0x7c95('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x3e0639,null))['catch'](handleError(_0x3e0639,null));};exports[_0x7c95('0x72')]=function(_0x582708,_0x13c892){var _0x89d0e7={};var _0x23e286={};var _0x418956;var _0xe3336c;return db['MailQueue'][_0x7c95('0x4c')]({'where':{'id':_0x582708['params']['id']}})[_0x7c95('0x13')](handleEntityNotFound(_0x13c892,null))[_0x7c95('0x13')](function(_0x586406){if(_0x586406){_0x418956=_0x586406;_0x23e286['model']=_[_0x7c95('0x2b')](db[_0x7c95('0x44')][_0x7c95('0x1f')]);_0x23e286[_0x7c95('0x25')]=_[_0x7c95('0x2b')](_0x582708[_0x7c95('0x25')]);_0x23e286[_0x7c95('0x2c')]=_[_0x7c95('0x2d')](_0x23e286[_0x7c95('0x2a')],_0x23e286[_0x7c95('0x25')]);_0x89d0e7[_0x7c95('0x2e')]=_[_0x7c95('0x2d')](_0x23e286[_0x7c95('0x2a')],qs[_0x7c95('0x3e')](_0x582708[_0x7c95('0x25')][_0x7c95('0x3e')]));_0x89d0e7[_0x7c95('0x2e')]=_0x89d0e7[_0x7c95('0x2e')]['length']?_0x89d0e7['attributes']:_0x23e286[_0x7c95('0x2a')];_0x89d0e7[_0x7c95('0x40')]=qs[_0x7c95('0x41')](_0x582708[_0x7c95('0x25')][_0x7c95('0x41')]);_0x89d0e7[_0x7c95('0x23')]=qs[_0x7c95('0x2c')](_[_0x7c95('0x4e')](_0x582708[_0x7c95('0x25')],_0x23e286[_0x7c95('0x2c')]));if(_0x582708[_0x7c95('0x25')]['filter']){_0x89d0e7[_0x7c95('0x23')]=_[_0x7c95('0x31')](_0x89d0e7[_0x7c95('0x23')],{'$or':_[_0x7c95('0x1d')](_0x89d0e7[_0x7c95('0x2e')],function(_0x234afa){var _0x2a33a9={};_0x2a33a9[_0x234afa]={'$like':'%'+_0x582708[_0x7c95('0x25')][_0x7c95('0x42')]+'%'};return _0x2a33a9;})});}_0x89d0e7=_[_0x7c95('0x31')]({},_0x89d0e7,_0x582708['options']);return _0x418956[_0x7c95('0x72')](_0x89d0e7);}})['then'](function(_0x10f833){if(_0x10f833){_0xe3336c=_0x10f833['length'];if(!_0x582708[_0x7c95('0x25')][_0x7c95('0x4f')]('nolimit')){_0x89d0e7[_0x7c95('0xd')]=qs['limit'](_0x582708[_0x7c95('0x25')][_0x7c95('0xd')]);_0x89d0e7[_0x7c95('0xf')]=qs[_0x7c95('0xf')](_0x582708[_0x7c95('0x25')][_0x7c95('0xf')]);}return _0x418956[_0x7c95('0x72')](_0x89d0e7);}})[_0x7c95('0x13')](function(_0x131e37){if(_0x131e37){return _0x131e37?{'count':_0xe3336c,'rows':_0x131e37}:null;}})[_0x7c95('0x13')](respondWithResult(_0x13c892,null))[_0x7c95('0x27')](handleError(_0x13c892,null));}; \ No newline at end of file +var _0x9e00=['find','catch','create','body','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserMailQueue','length','hasOwnProperty','nolimit','sort','pick','MailQueueId','filter','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','filters','order','addTeams','ids','findAll','Agents','online','voicePause','interface','sequelize','transaction','each','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','where','include','query','rows','model','keys','intersection','attributes','fields','includeAll','merge','options'];(function(_0x4093ce,_0x174e86){var _0xdd7f0=function(_0x174d47){while(--_0x174d47){_0x4093ce['push'](_0x4093ce['shift']());}};_0xdd7f0(++_0x174e86);}(_0x9e00,0x1b2));var _0x09e0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9e00[_0x1facfa];return _0x9ec701;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x09e0('0x0'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0x09e0('0x1'));var logger=require(_0x09e0('0x2'))(_0x09e0('0x3'));var config=require(_0x09e0('0x4'));var db=require(_0x09e0('0x5'))['db'];config[_0x09e0('0x6')]=_[_0x09e0('0x7')](config['redis'],{'host':_0x09e0('0x8'),'port':0x18eb});var socket=require(_0x09e0('0x9'))(new Redis(config[_0x09e0('0x6')]));require('./mailQueue.socket')[_0x09e0('0xa')](socket);function respondWithStatusCode(_0x37084c,_0x58b632){_0x58b632=_0x58b632||0xcc;return function(_0x2d45f8){if(_0x2d45f8){return _0x37084c[_0x09e0('0xb')](_0x58b632);}return _0x37084c[_0x09e0('0xc')](_0x58b632)[_0x09e0('0xd')]();};}function respondWithResult(_0x58e775,_0x2d522d){_0x2d522d=_0x2d522d||0xc8;return function(_0x40950e){if(_0x40950e){return _0x58e775['status'](_0x2d522d)[_0x09e0('0xe')](_0x40950e);}};}function respondWithFilteredResult(_0x17d1f8,_0x37fb6a){return function(_0x4af833){if(_0x4af833){var _0x2e544e=typeof _0x37fb6a[_0x09e0('0xf')]===_0x09e0('0x10')&&typeof _0x37fb6a[_0x09e0('0x11')]==='undefined';var _0x147e2=_0x4af833[_0x09e0('0x12')];var _0x281332=_0x2e544e?0x0:_0x37fb6a[_0x09e0('0xf')];var _0x8e0795=_0x2e544e?_0x4af833[_0x09e0('0x12')]:_0x37fb6a[_0x09e0('0xf')]+_0x37fb6a[_0x09e0('0x11')];var _0x34c9e0;if(_0x8e0795>=_0x147e2){_0x8e0795=_0x147e2;_0x34c9e0=0xc8;}else{_0x34c9e0=0xce;}_0x17d1f8['status'](_0x34c9e0);return _0x17d1f8[_0x09e0('0x13')](_0x09e0('0x14'),_0x281332+'-'+_0x8e0795+'/'+_0x147e2)['json'](_0x4af833);}return null;};}function saveUpdates(_0x5019e2){return function(_0x1c316c){if(_0x1c316c){return _0x1c316c[_0x09e0('0x15')](_0x5019e2)[_0x09e0('0x16')](function(_0x4ff281){return _0x4ff281;});}return null;};}function removeEntity(_0x2839e8){return function(_0x542edb){if(_0x542edb){return _0x542edb[_0x09e0('0x17')]()[_0x09e0('0x16')](function(){var _0x27186b=_0x542edb[_0x09e0('0x18')]({'plain':!![]});var _0x252ef3=_0x09e0('0x19');return db[_0x09e0('0x1a')][_0x09e0('0x17')]({'where':{'type':_0x252ef3,'resourceId':_0x27186b['id']}})['then'](function(){return _0x542edb;});})[_0x09e0('0x16')](function(){_0x2839e8[_0x09e0('0xc')](0xcc)[_0x09e0('0xd')]();});}};}function handleEntityNotFound(_0x41e9b1){return function(_0x31705a){if(!_0x31705a){_0x41e9b1[_0x09e0('0xb')](0x194);}return _0x31705a;};}function handleError(_0x3f50a4,_0x1583a3){_0x1583a3=_0x1583a3||0x1f4;return function(_0x1c6afd){logger[_0x09e0('0x1b')](_0x1c6afd[_0x09e0('0x1c')]);if(_0x1c6afd[_0x09e0('0x1d')]){delete _0x1c6afd[_0x09e0('0x1d')];}_0x3f50a4[_0x09e0('0xc')](_0x1583a3)[_0x09e0('0x1e')](_0x1c6afd);};}exports[_0x09e0('0x1f')]=function(_0x3f31b4,_0x14c2a1){var _0x4db085={};var _0xc5d14b={'count':0x0,'rows':[]};var _0x532fcc=_[_0x09e0('0x20')](db[_0x09e0('0x21')][_0x09e0('0x22')],function(_0x570496){return{'name':_0x570496[_0x09e0('0x23')],'type':_0x570496[_0x09e0('0x24')][_0x09e0('0x25')]};});_0x4db085=qs['getOptions'](_0x532fcc,_0x3f31b4);var _0x1b205a={'where':_0x4db085[_0x09e0('0x26')]};return db[_0x09e0('0x21')]['count'](_0x1b205a)[_0x09e0('0x16')](function(_0x2d2dca){_0xc5d14b[_0x09e0('0x12')]=_0x2d2dca;_0x4db085[_0x09e0('0x27')]=qs[_0x09e0('0x27')](_0x3f31b4[_0x09e0('0x28')]);return db[_0x09e0('0x21')]['findAll'](_0x4db085);})[_0x09e0('0x16')](function(_0x5e2373){_0xc5d14b[_0x09e0('0x29')]=_0x5e2373;return _0xc5d14b;})[_0x09e0('0x16')](respondWithFilteredResult(_0x14c2a1,_0x4db085))['catch'](handleError(_0x14c2a1,null));};exports['show']=function(_0x1fe1ce,_0xe53dfa){var _0x5f00ce={'raw':!![],'where':{'id':_0x1fe1ce['params']['id']}},_0x911a36={};_0x911a36[_0x09e0('0x2a')]=_[_0x09e0('0x2b')](db[_0x09e0('0x21')][_0x09e0('0x22')]);_0x911a36[_0x09e0('0x28')]=_[_0x09e0('0x2b')](_0x1fe1ce[_0x09e0('0x28')]);_0x911a36['filters']=_[_0x09e0('0x2c')](_0x911a36['model'],_0x911a36[_0x09e0('0x28')]);_0x5f00ce[_0x09e0('0x2d')]=_['intersection'](_0x911a36[_0x09e0('0x2a')],qs[_0x09e0('0x2e')](_0x1fe1ce[_0x09e0('0x28')][_0x09e0('0x2e')]));_0x5f00ce['attributes']=_0x5f00ce[_0x09e0('0x2d')]['length']?_0x5f00ce[_0x09e0('0x2d')]:_0x911a36[_0x09e0('0x2a')];if(_0x1fe1ce['query'][_0x09e0('0x2f')]){_0x5f00ce[_0x09e0('0x27')]=[{'all':!![]}];}_0x5f00ce=_[_0x09e0('0x30')]({},_0x5f00ce,_0x1fe1ce[_0x09e0('0x31')]);return db[_0x09e0('0x21')][_0x09e0('0x32')](_0x5f00ce)[_0x09e0('0x16')](handleEntityNotFound(_0xe53dfa,null))['then'](respondWithResult(_0xe53dfa,null))[_0x09e0('0x33')](handleError(_0xe53dfa,null));};exports[_0x09e0('0x34')]=function(_0x5dd2af,_0x5d38a8){return db[_0x09e0('0x21')][_0x09e0('0x34')](_0x5dd2af[_0x09e0('0x35')],{})[_0x09e0('0x16')](function(_0x297662){var _0x41425a=_0x5dd2af[_0x09e0('0x36')][_0x09e0('0x18')]({'plain':!![]});if(!_0x41425a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41425a['role']===_0x09e0('0x36')){var _0x5b00f7=_0x297662['get']({'plain':!![]});var _0x5ae6e7=_0x09e0('0x19');return db[_0x09e0('0x37')][_0x09e0('0x32')]({'where':{'name':_0x5ae6e7,'userProfileId':_0x41425a['userProfileId']},'raw':!![]})['then'](function(_0x5773dc){if(_0x5773dc&&_0x5773dc['autoAssociation']===0x0){return db[_0x09e0('0x1a')][_0x09e0('0x34')]({'name':_0x5b00f7['name'],'resourceId':_0x5b00f7['id'],'type':_0x5773dc[_0x09e0('0x1d')],'sectionId':_0x5773dc['id']},{})[_0x09e0('0x16')](function(){return _0x297662;});}else{return _0x297662;}})[_0x09e0('0x33')](function(_0x62b3){logger['error'](_0x09e0('0x38'),_0x62b3);throw _0x62b3;});}return _0x297662;})['then'](respondWithResult(_0x5d38a8,0xc9))['catch'](handleError(_0x5d38a8,null));};exports['update']=function(_0xc5cce,_0x93dbeb){if(_0xc5cce[_0x09e0('0x35')]['id']){delete _0xc5cce[_0x09e0('0x35')]['id'];}return db[_0x09e0('0x21')][_0x09e0('0x32')]({'where':{'id':_0xc5cce[_0x09e0('0x39')]['id']}})[_0x09e0('0x16')](handleEntityNotFound(_0x93dbeb,null))[_0x09e0('0x16')](saveUpdates(_0xc5cce['body'],null))['then'](respondWithResult(_0x93dbeb,null))[_0x09e0('0x33')](handleError(_0x93dbeb,null));};exports[_0x09e0('0x17')]=function(_0x288ae0,_0x5856bc){return db[_0x09e0('0x21')]['find']({'where':{'id':_0x288ae0[_0x09e0('0x39')]['id']}})[_0x09e0('0x16')](handleEntityNotFound(_0x5856bc,null))[_0x09e0('0x16')](removeEntity(_0x5856bc,null))['catch'](handleError(_0x5856bc,null));};exports['describe']=function(_0x1dd907,_0x1fe910){return db[_0x09e0('0x21')][_0x09e0('0x3a')]()[_0x09e0('0x16')](respondWithResult(_0x1fe910,null))['catch'](handleError(_0x1fe910,null));};exports[_0x09e0('0x3b')]=function(_0x2b9162,_0x41b062){var _0x2c1fee={'raw':!![],'where':{}},_0x2cb975={},_0x564ab4;return db['MailQueue'][_0x09e0('0x3c')]({'where':{'id':_0x2b9162[_0x09e0('0x39')]['id']}})[_0x09e0('0x16')](handleEntityNotFound(_0x41b062,null))[_0x09e0('0x16')](function(_0x2bf7e7){if(_0x2bf7e7){_0x564ab4=_0x2bf7e7['get']({'plain':!![]});_0x2cb975['model']=_[_0x09e0('0x2b')](db[_0x09e0('0x3d')]['rawAttributes']);_0x2cb975[_0x09e0('0x28')]=_[_0x09e0('0x2b')](_0x2b9162[_0x09e0('0x28')]);_0x2cb975['filters']=_['intersection'](_0x2cb975[_0x09e0('0x2a')],_0x2cb975[_0x09e0('0x28')]);_0x2c1fee[_0x09e0('0x2d')]=_['intersection'](_0x2cb975[_0x09e0('0x2a')],qs[_0x09e0('0x2e')](_0x2b9162[_0x09e0('0x28')][_0x09e0('0x2e')]));_0x2c1fee[_0x09e0('0x2d')]=_0x2c1fee[_0x09e0('0x2d')][_0x09e0('0x3e')]?_0x2c1fee['attributes']:_0x2cb975[_0x09e0('0x2a')];if(!_0x2b9162[_0x09e0('0x28')][_0x09e0('0x3f')](_0x09e0('0x40'))){_0x2c1fee['limit']=qs[_0x09e0('0x11')](_0x2b9162[_0x09e0('0x28')][_0x09e0('0x11')]);_0x2c1fee[_0x09e0('0xf')]=qs['offset'](_0x2b9162[_0x09e0('0x28')][_0x09e0('0xf')]);}_0x2c1fee['order']=qs[_0x09e0('0x41')](_0x2b9162[_0x09e0('0x28')][_0x09e0('0x41')]);_0x2c1fee[_0x09e0('0x26')]=qs['filters'](_[_0x09e0('0x42')](_0x2b9162[_0x09e0('0x28')],_0x2cb975['filters']));_0x2c1fee['where'][_0x09e0('0x43')]=_0x2bf7e7['id'];if(_0x2b9162[_0x09e0('0x28')][_0x09e0('0x44')]){_0x2c1fee['where']=_[_0x09e0('0x30')](_0x2c1fee[_0x09e0('0x26')],{'$or':_[_0x09e0('0x20')](_0x2c1fee[_0x09e0('0x2d')],function(_0x4e5ff6){var _0x17fc80={};_0x17fc80[_0x4e5ff6]={'$like':'%'+_0x2b9162[_0x09e0('0x28')][_0x09e0('0x44')]+'%'};return _0x17fc80;})});}_0x2c1fee=_['merge']({},_0x2c1fee,_0x2b9162['options']);return db[_0x09e0('0x3d')]['findAll'](_0x2c1fee);}})[_0x09e0('0x16')](function(_0x5f53b2){if(_0x5f53b2){return db[_0x09e0('0x45')][_0x09e0('0x46')]({'where':{'id':_[_0x09e0('0x20')](_0x5f53b2,_0x09e0('0x47')),'role':_0x09e0('0x48')},'attributes':['id',_0x09e0('0x1d'),_0x09e0('0x49'),_0x09e0('0x4a'),_0x09e0('0x4b')]});}})[_0x09e0('0x16')](function(_0x383060){if(_0x383060){return{'count':_0x383060[_0x09e0('0x12')],'rows':_['map'](_0x383060[_0x09e0('0x29')],function(_0x299960){return{'membername':_0x299960[_0x09e0('0x1d')],'UserId':_0x299960['id'],'queue_name':_0x564ab4[_0x09e0('0x1d')],'MailQueueId':_0x564ab4['id'],'interface':util[_0x09e0('0x4c')](_0x09e0('0x4d'),'SIP',_0x299960[_0x09e0('0x1d')]),'penalty':0x0,'paused':_0x299960['mailPause'],'createdAt':_0x299960['createdAt'],'updatedAt':_0x299960['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x41b062,_0x2c1fee))[_0x09e0('0x33')](handleError(_0x41b062,null));};exports[_0x09e0('0x4e')]=function(_0x1e207c,_0x2f5e23){var _0x1a0c51={};var _0xee37b8={};var _0x54eeee;var _0x5417e2;return db[_0x09e0('0x21')][_0x09e0('0x3c')]({'where':{'id':_0x1e207c[_0x09e0('0x39')]['id']}})[_0x09e0('0x16')](handleEntityNotFound(_0x2f5e23,null))[_0x09e0('0x16')](function(_0x48d10c){if(_0x48d10c){_0x54eeee=_0x48d10c;_0xee37b8[_0x09e0('0x2a')]=_[_0x09e0('0x2b')](db[_0x09e0('0x4f')]['rawAttributes']);_0xee37b8[_0x09e0('0x28')]=_[_0x09e0('0x2b')](_0x1e207c['query']);_0xee37b8[_0x09e0('0x50')]=_[_0x09e0('0x2c')](_0xee37b8[_0x09e0('0x2a')],_0xee37b8[_0x09e0('0x28')]);_0x1a0c51[_0x09e0('0x2d')]=_[_0x09e0('0x2c')](_0xee37b8['model'],qs[_0x09e0('0x2e')](_0x1e207c[_0x09e0('0x28')]['fields']));_0x1a0c51['attributes']=_0x1a0c51['attributes'][_0x09e0('0x3e')]?_0x1a0c51[_0x09e0('0x2d')]:_0xee37b8['model'];_0x1a0c51[_0x09e0('0x51')]=qs['sort'](_0x1e207c['query']['sort']);_0x1a0c51['where']=qs[_0x09e0('0x50')](_[_0x09e0('0x42')](_0x1e207c['query'],_0xee37b8[_0x09e0('0x50')]));if(_0x1e207c['query'][_0x09e0('0x44')]){_0x1a0c51[_0x09e0('0x26')]=_[_0x09e0('0x30')](_0x1a0c51[_0x09e0('0x26')],{'$or':_[_0x09e0('0x20')](_0x1a0c51[_0x09e0('0x2d')],function(_0x559c4e){var _0x433655={};_0x433655[_0x559c4e]={'$like':'%'+_0x1e207c[_0x09e0('0x28')][_0x09e0('0x44')]+'%'};return _0x433655;})});}_0x1a0c51=_[_0x09e0('0x30')]({},_0x1a0c51,_0x1e207c[_0x09e0('0x31')]);return _0x54eeee['getTeams'](_0x1a0c51);}})[_0x09e0('0x16')](function(_0x173b58){if(_0x173b58){_0x5417e2=_0x173b58[_0x09e0('0x3e')];if(!_0x1e207c[_0x09e0('0x28')]['hasOwnProperty'](_0x09e0('0x40'))){_0x1a0c51[_0x09e0('0x11')]=qs[_0x09e0('0x11')](_0x1e207c['query'][_0x09e0('0x11')]);_0x1a0c51['offset']=qs[_0x09e0('0xf')](_0x1e207c[_0x09e0('0x28')]['offset']);}return _0x54eeee['getTeams'](_0x1a0c51);}})[_0x09e0('0x16')](function(_0x28b603){if(_0x28b603){return _0x28b603?{'count':_0x5417e2,'rows':_0x28b603}:null;}})[_0x09e0('0x16')](respondWithResult(_0x2f5e23,null))['catch'](handleError(_0x2f5e23,null));};exports[_0x09e0('0x52')]=function(_0x3092e8,_0x5d7dff){var _0x32f1a4=_0x3092e8[_0x09e0('0x35')][_0x09e0('0x53')];return db[_0x09e0('0x4f')][_0x09e0('0x54')]({'where':{'id':_0x32f1a4},'attributes':['id'],'include':[{'model':db[_0x09e0('0x45')],'as':_0x09e0('0x55'),'attributes':['id',_0x09e0('0x1d'),_0x09e0('0x56'),_0x09e0('0x57'),_0x09e0('0x58')],'raw':!![]}]})[_0x09e0('0x16')](function(_0x334cc5){if(_0x334cc5){var _0x556d36=_['flatMap'](_0x334cc5,function(_0x2def19){var _0x65b617=_0x2def19[_0x09e0('0x18')]({'plain':!![]});return _0x65b617[_0x09e0('0x55')];});return db[_0x09e0('0x21')][_0x09e0('0x32')]({'where':{'id':_0x3092e8[_0x09e0('0x39')]['id']}})['then'](function(_0x2b3bdd){return db[_0x09e0('0x59')][_0x09e0('0x5a')](function(_0x58458d){return _0x2b3bdd[_0x09e0('0x52')](_0x32f1a4,{'transaction':_0x58458d})[_0x09e0('0x16')](function(){return BPromise[_0x09e0('0x5b')](_0x556d36,function(_0x23c6e4){return db[_0x09e0('0x3d')]['findOrCreate']({'where':{'UserId':_0x23c6e4['id'],'MailQueueId':_0x3092e8[_0x09e0('0x39')]['id']},'transaction':_0x58458d});});})[_0x09e0('0x16')](function(){_0x556d36['forEach'](function(_0x39615c){socket[_0x09e0('0x5c')](_0x09e0('0x5d'),{'UserId':_0x39615c['id'],'MailQueueId':_0x2b3bdd['id']});});});});});}})['then'](respondWithStatusCode(_0x5d7dff,null))[_0x09e0('0x33')](handleError(_0x5d7dff,null));};exports[_0x09e0('0x5e')]=function(_0x359610,_0x5856c5){return db[_0x09e0('0x4f')][_0x09e0('0x54')]({'where':{'id':_0x359610[_0x09e0('0x28')][_0x09e0('0x53')]},'attributes':['id'],'include':[{'model':db[_0x09e0('0x45')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x09e0('0x16')](handleEntityNotFound(_0x5856c5,null))[_0x09e0('0x16')](function(_0xe9de1a){var _0x39c7a8=_['map'](_0xe9de1a,'id');var _0x545726=[];var _0x113673=[];var _0x3b6676=squel[_0x09e0('0x5f')]();_0x3b6676[_0x09e0('0x60')](_0x09e0('0x61'))[_0x09e0('0x62')](_0x09e0('0x63'),'tq')['join'](_0x09e0('0x64'),'ut',_0x09e0('0x65'))[_0x09e0('0x26')](_0x09e0('0x66'),_0x359610[_0x09e0('0x39')]['id']);for(var _0x3c1401=0x0;_0x3c1401<_0xe9de1a['length'];_0x3c1401+=0x1){let _0x37d05a=_0xe9de1a[_0x3c1401];for(var _0x778d48=0x0;_0x778d48<_0x37d05a[_0x09e0('0x55')][_0x09e0('0x3e')];_0x778d48+=0x1){let _0x51069f=_0x37d05a['Agents'][_0x778d48];var _0x41d7d7=_0x3b6676[_0x09e0('0x67')]();_0x41d7d7['where'](_0x09e0('0x68'),_0x51069f['id']);_0x113673[_0x09e0('0x69')](db[_0x09e0('0x59')][_0x09e0('0x28')](_0x41d7d7[_0x09e0('0x6a')](),{'type':db[_0x09e0('0x59')][_0x09e0('0x6b')][_0x09e0('0x6c')]})['then'](function(_0x5a30f4){if(_0x5a30f4[_0x09e0('0x3e')]===0x1){return _0x51069f['id'];}else{var _0xd256f7=_[_0x09e0('0x6d')](_['map'](_0x5a30f4,_0x09e0('0x6e')),function(_0x5e1963){return _['includes'](_0x39c7a8,_0x5e1963);});if(_0xd256f7){return _0x51069f['id'];}}}));}}return BPromise[_0x09e0('0x6f')](_0x113673)[_0x09e0('0x16')](function(_0x318828){_0x545726=_(_0x545726)[_0x09e0('0x70')](_0x318828)['compact']()[_0x09e0('0x71')]();return db[_0x09e0('0x21')][_0x09e0('0x32')]({'where':{'id':_0x359610['params']['id']}})['then'](function(_0x49763b){return db[_0x09e0('0x59')]['transaction'](function(_0x24f472){return _0x49763b['removeTeams'](_0x359610[_0x09e0('0x28')][_0x09e0('0x53')],{'transaction':_0x24f472})[_0x09e0('0x16')](function(){if(!_[_0x09e0('0x72')](_0x545726)){return _0x49763b[_0x09e0('0x73')](_0x545726,{'transaction':_0x24f472});}})['then'](function(){_0x545726['forEach'](function(_0x5ecffc){socket[_0x09e0('0x5c')](_0x09e0('0x74'),{'UserId':_0x5ecffc,'MailQueueId':_0x49763b['id']});});});});});});})[_0x09e0('0x16')](respondWithStatusCode(_0x5856c5,null))[_0x09e0('0x33')](handleError(_0x5856c5,null));};exports[_0x09e0('0x75')]=function(_0x5cb367,_0xd94ba0){return db[_0x09e0('0x21')][_0x09e0('0x32')]({'where':{'id':_0x5cb367[_0x09e0('0x39')]['id']}})[_0x09e0('0x16')](handleEntityNotFound(_0xd94ba0,null))[_0x09e0('0x16')](function(_0x471eab){if(_0x471eab){return _0x471eab[_0x09e0('0x75')](_0x5cb367['body'][_0x09e0('0x53')],_['omit'](_0x5cb367[_0x09e0('0x35')],[_0x09e0('0x53'),'id'])||{})[_0x09e0('0x76')](function(_0x540080){for(var _0x42fa01=0x0;_0x42fa01<_0x5cb367['body'][_0x09e0('0x53')][_0x09e0('0x3e')];_0x42fa01+=0x1){socket[_0x09e0('0x5c')]('userMailQueue:save',{'UserId':Number(_0x5cb367['body'][_0x09e0('0x53')][_0x42fa01]),'MailQueueId':Number(_0x5cb367[_0x09e0('0x39')]['id'])});}return _0x540080;});}})['then'](respondWithResult(_0xd94ba0,null))['catch'](handleError(_0xd94ba0,null));};exports['removeAgents']=function(_0x49767b,_0x4c2cf4){return db[_0x09e0('0x21')][_0x09e0('0x32')]({'where':{'id':_0x49767b['params']['id']}})[_0x09e0('0x16')](handleEntityNotFound(_0x4c2cf4,null))[_0x09e0('0x16')](function(_0x243dde){if(_0x243dde){return _0x243dde[_0x09e0('0x73')](_0x49767b[_0x09e0('0x28')][_0x09e0('0x53')])['then'](function(){if(_[_0x09e0('0x77')](_0x49767b['query']['ids'])){for(var _0x201a00=0x0;_0x201a00<_0x49767b[_0x09e0('0x28')]['ids'][_0x09e0('0x3e')];_0x201a00+=0x1){socket[_0x09e0('0x5c')](_0x09e0('0x74'),{'UserId':Number(_0x49767b[_0x09e0('0x28')][_0x09e0('0x53')][_0x201a00]),'MailQueueId':Number(_0x49767b['params']['id'])});}}else{socket[_0x09e0('0x5c')](_0x09e0('0x74'),{'UserId':Number(_0x49767b[_0x09e0('0x28')][_0x09e0('0x53')]),'MailQueueId':Number(_0x49767b[_0x09e0('0x39')]['id'])});}});}})[_0x09e0('0x16')](respondWithStatusCode(_0x4c2cf4,null))['catch'](handleError(_0x4c2cf4,null));};exports['getAgents']=function(_0x2c3fef,_0x1f4a04){var _0x17ccd8={};var _0x159d39={};var _0x195ef0;var _0x19a0c9;return db[_0x09e0('0x21')][_0x09e0('0x3c')]({'where':{'id':_0x2c3fef[_0x09e0('0x39')]['id']}})[_0x09e0('0x16')](handleEntityNotFound(_0x1f4a04,null))[_0x09e0('0x16')](function(_0x406df8){if(_0x406df8){_0x195ef0=_0x406df8;_0x159d39[_0x09e0('0x2a')]=_[_0x09e0('0x2b')](db[_0x09e0('0x45')][_0x09e0('0x22')]);_0x159d39['query']=_[_0x09e0('0x2b')](_0x2c3fef[_0x09e0('0x28')]);_0x159d39['filters']=_[_0x09e0('0x2c')](_0x159d39[_0x09e0('0x2a')],_0x159d39['query']);_0x17ccd8[_0x09e0('0x2d')]=_[_0x09e0('0x2c')](_0x159d39['model'],qs[_0x09e0('0x2e')](_0x2c3fef[_0x09e0('0x28')][_0x09e0('0x2e')]));_0x17ccd8[_0x09e0('0x2d')]=_0x17ccd8[_0x09e0('0x2d')]['length']?_0x17ccd8[_0x09e0('0x2d')]:_0x159d39[_0x09e0('0x2a')];_0x17ccd8[_0x09e0('0x51')]=qs[_0x09e0('0x41')](_0x2c3fef[_0x09e0('0x28')]['sort']);_0x17ccd8['where']=qs[_0x09e0('0x50')](_[_0x09e0('0x42')](_0x2c3fef[_0x09e0('0x28')],_0x159d39['filters']));if(_0x2c3fef['query'][_0x09e0('0x44')]){_0x17ccd8[_0x09e0('0x26')]=_[_0x09e0('0x30')](_0x17ccd8['where'],{'$or':_[_0x09e0('0x20')](_0x17ccd8['attributes'],function(_0x375798){var _0xdb9a91={};_0xdb9a91[_0x375798]={'$like':'%'+_0x2c3fef['query'][_0x09e0('0x44')]+'%'};return _0xdb9a91;})});}_0x17ccd8=_[_0x09e0('0x30')]({},_0x17ccd8,_0x2c3fef[_0x09e0('0x31')]);return _0x195ef0[_0x09e0('0x78')](_0x17ccd8);}})['then'](function(_0x16e93d){if(_0x16e93d){_0x19a0c9=_0x16e93d[_0x09e0('0x3e')];if(!_0x2c3fef[_0x09e0('0x28')][_0x09e0('0x3f')](_0x09e0('0x40'))){_0x17ccd8[_0x09e0('0x11')]=qs['limit'](_0x2c3fef[_0x09e0('0x28')][_0x09e0('0x11')]);_0x17ccd8[_0x09e0('0xf')]=qs[_0x09e0('0xf')](_0x2c3fef[_0x09e0('0x28')][_0x09e0('0xf')]);}return _0x195ef0[_0x09e0('0x78')](_0x17ccd8);}})[_0x09e0('0x16')](function(_0x387a70){if(_0x387a70){return _0x387a70?{'count':_0x19a0c9,'rows':_0x387a70}:null;}})['then'](respondWithResult(_0x1f4a04,null))[_0x09e0('0x33')](handleError(_0x1f4a04,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index e947edc..1fec661 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 _0x70dc=['MailQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x70dc,0x80));var _0xc70d=function(_0xc50fc4,_0x56db19){_0xc50fc4=_0xc50fc4-0x0;var _0x5547c9=_0x70dc[_0xc50fc4];return _0x5547c9;};'use strict';var EventEmitter=require(_0xc70d('0x0'));var MailQueue=require(_0xc70d('0x1'))['db'][_0xc70d('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xc70d('0x3')](0x0);var events={'afterCreate':_0xc70d('0x4'),'afterUpdate':_0xc70d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2bbe24){return function(_0xc368,_0x363a89,_0x55cb9e){MailQueueEvents[_0xc70d('0x6')](_0x2bbe24+':'+_0xc368['id'],_0xc368);MailQueueEvents[_0xc70d('0x6')](_0x2bbe24,_0xc368);_0x55cb9e(null);};}for(var e in events){if(events[_0xc70d('0x7')](e)){var event=events[e];MailQueue[_0xc70d('0x8')](e,emitEvent(event));}}module[_0xc70d('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x0c96=['../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0x0c96,0x1af));var _0x60c9=function(_0x3a6930,_0x3fc846){_0x3a6930=_0x3a6930-0x0;var _0x2238f7=_0x0c96[_0x3a6930];return _0x2238f7;};'use strict';var EventEmitter=require(_0x60c9('0x0'));var MailQueue=require(_0x60c9('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x60c9('0x2')](0x0);var events={'afterCreate':_0x60c9('0x3'),'afterUpdate':_0x60c9('0x4'),'afterDestroy':_0x60c9('0x5')};function emitEvent(_0x5ac19e){return function(_0x19992d,_0x59f3a0,_0x34f0be){MailQueueEvents['emit'](_0x5ac19e+':'+_0x19992d['id'],_0x19992d);MailQueueEvents['emit'](_0x5ac19e,_0x19992d);_0x34f0be(null);};}for(var e in events){if(events[_0x60c9('0x6')](e)){var event=events[e];MailQueue[_0x60c9('0x7')](e,emitEvent(event));}}module[_0x60c9('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 445fb96..175a373 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 _0xc979=['define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./mailQueue.attributes','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc979,0xab));var _0x9c97=function(_0x1b660b,_0x20d60f){_0x1b660b=_0x1b660b-0x0;var _0x41ea4b=_0xc979[_0x1b660b];return _0x41ea4b;};'use strict';var _=require(_0x9c97('0x0'));var util=require(_0x9c97('0x1'));var logger=require(_0x9c97('0x2'))(_0x9c97('0x3'));var moment=require(_0x9c97('0x4'));var BPromise=require(_0x9c97('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9c97('0x6'));var attributes=require(_0x9c97('0x7'));module[_0x9c97('0x8')]=function(_0x933e15,_0x24ebd9){return _0x933e15[_0x9c97('0x9')](_0x9c97('0xa'),attributes,{'tableName':_0x9c97('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05da=['./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x05da,0x1a5));var _0xa05d=function(_0x546be2,_0x108582){_0x546be2=_0x546be2-0x0;var _0x5d1639=_0x05da[_0x546be2];return _0x5d1639;};'use strict';var _=require(_0xa05d('0x0'));var util=require(_0xa05d('0x1'));var logger=require(_0xa05d('0x2'))('api');var moment=require(_0xa05d('0x3'));var BPromise=require(_0xa05d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa05d('0x5'));var rimraf=require(_0xa05d('0x6'));var config=require(_0xa05d('0x7'));var attributes=require(_0xa05d('0x8'));module[_0xa05d('0x9')]=function(_0x408f96,_0x5a357b){return _0x408f96[_0xa05d('0xa')](_0xa05d('0xb'),attributes,{'tableName':_0xa05d('0xc'),'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 c502037..dbd89bb 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 _0x55f4=['model','info','find','ShowMailQueue','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','map','include'];(function(_0x41f272,_0x5351f5){var _0x55cff3=function(_0x275c76){while(--_0x275c76){_0x41f272['push'](_0x41f272['shift']());}};_0x55cff3(++_0x5351f5);}(_0x55f4,0x1f1));var _0x455f=function(_0x3ae9ce,_0x5bed25){_0x3ae9ce=_0x3ae9ce-0x0;var _0x54bad0=_0x55f4[_0x3ae9ce];return _0x54bad0;};'use strict';var _=require(_0x455f('0x0'));var util=require('util');var moment=require(_0x455f('0x1'));var BPromise=require(_0x455f('0x2'));var rs=require(_0x455f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x455f('0x4'))['db'];var utils=require(_0x455f('0x5'));var logger=require(_0x455f('0x6'))(_0x455f('0x7'));var config=require(_0x455f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x455f('0x9')][_0x455f('0xa')]({'port':0x232a});config[_0x455f('0xb')]=_[_0x455f('0xc')](config['redis'],{'host':_0x455f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x455f('0xb')]));require(_0x455f('0xe'))[_0x455f('0xf')](socket);function respondWithRpcPromise(_0xbd97bf,_0x30fd78,_0x3cd760){return new BPromise(function(_0x59e3ae,_0x1e8243){return client[_0x455f('0x10')](_0xbd97bf,_0x3cd760)[_0x455f('0x11')](function(_0x353578){logger['info']('MailQueue,\x20%s,\x20%s',_0x30fd78,_0x455f('0x12'));logger['debug'](_0x455f('0x13'),_0x30fd78,_0x455f('0x12'),JSON[_0x455f('0x14')](_0x353578));if(_0x353578[_0x455f('0x15')]){if(_0x353578[_0x455f('0x15')][_0x455f('0x16')]===0x1f4){logger[_0x455f('0x15')](_0x455f('0x17'),_0x30fd78,_0x353578[_0x455f('0x15')][_0x455f('0x18')]);return _0x1e8243(_0x353578['error'][_0x455f('0x18')]);}logger[_0x455f('0x15')](_0x455f('0x17'),_0x30fd78,_0x353578[_0x455f('0x15')][_0x455f('0x18')]);return _0x59e3ae(_0x353578[_0x455f('0x15')]['message']);}else{logger['info'](_0x455f('0x17'),_0x30fd78,_0x455f('0x12'));_0x59e3ae(_0x353578[_0x455f('0x19')][_0x455f('0x18')]);}})[_0x455f('0x1a')](function(_0x327fd8){logger[_0x455f('0x15')]('MailQueue,\x20%s,\x20%s',_0x30fd78,_0x327fd8);_0x1e8243(_0x327fd8);});});}exports[_0x455f('0x1b')]=function(_0x5be6c8){var _0x4e2eaa=this;return new Promise(function(_0x19cc7c,_0x4a32aa){return db[_0x455f('0x1c')]['findAll']({'raw':_0x5be6c8[_0x455f('0x1d')]?_0x5be6c8[_0x455f('0x1d')][_0x455f('0x1e')]===undefined?!![]:![]:!![],'where':_0x5be6c8[_0x455f('0x1d')]?_0x5be6c8['options'][_0x455f('0x1f')]||null:null,'attributes':_0x5be6c8[_0x455f('0x1d')]?_0x5be6c8[_0x455f('0x1d')][_0x455f('0x20')]||null:null,'limit':_0x5be6c8['options']?_0x5be6c8[_0x455f('0x1d')][_0x455f('0x21')]||null:null,'include':_0x5be6c8[_0x455f('0x1d')]?_0x5be6c8[_0x455f('0x1d')]['include']?_[_0x455f('0x22')](_0x5be6c8[_0x455f('0x1d')][_0x455f('0x23')],function(_0x135d71){return{'model':db[_0x135d71[_0x455f('0x24')]],'as':_0x135d71['as'],'attributes':_0x135d71[_0x455f('0x20')],'include':_0x135d71[_0x455f('0x23')]?_[_0x455f('0x22')](_0x135d71['include'],function(_0x167dd5){return{'model':db[_0x167dd5[_0x455f('0x24')]],'as':_0x167dd5['as'],'attributes':_0x167dd5[_0x455f('0x20')],'include':_0x167dd5[_0x455f('0x23')]?_[_0x455f('0x22')](_0x167dd5[_0x455f('0x23')],function(_0x3edd4c){return{'model':db[_0x3edd4c[_0x455f('0x24')]],'as':_0x3edd4c['as'],'attributes':_0x3edd4c['attributes']};}):[]};}):[]};}):[]:[]})[_0x455f('0x11')](function(_0x3892ac){logger[_0x455f('0x25')](_0x455f('0x1b'),_0x5be6c8);logger['debug']('GetMailQueue',_0x5be6c8,JSON[_0x455f('0x14')](_0x3892ac));_0x19cc7c(_0x3892ac);})[_0x455f('0x1a')](function(_0x745536){logger[_0x455f('0x15')](_0x455f('0x1b'),_0x745536['message'],_0x5be6c8);_0x4a32aa(_0x4e2eaa['error'](0x1f4,_0x745536[_0x455f('0x18')]));});});};exports['ShowMailQueue']=function(_0x20efad){var _0x137c0a=this;return new Promise(function(_0x1750d8,_0x399c40){return db['MailQueue'][_0x455f('0x26')]({'raw':_0x20efad['options']?_0x20efad['options'][_0x455f('0x1e')]===undefined?!![]:![]:!![],'where':_0x20efad['options']?_0x20efad['options'][_0x455f('0x1f')]||null:null,'attributes':_0x20efad[_0x455f('0x1d')]?_0x20efad[_0x455f('0x1d')]['attributes']||null:null,'include':_0x20efad[_0x455f('0x1d')]?_0x20efad[_0x455f('0x1d')][_0x455f('0x23')]?_[_0x455f('0x22')](_0x20efad[_0x455f('0x1d')][_0x455f('0x23')],function(_0x433dab){return{'model':db[_0x433dab['model']],'as':_0x433dab['as'],'attributes':_0x433dab[_0x455f('0x20')],'include':_0x433dab[_0x455f('0x23')]?_[_0x455f('0x22')](_0x433dab[_0x455f('0x23')],function(_0x2ed2b1){return{'model':db[_0x2ed2b1[_0x455f('0x24')]],'as':_0x2ed2b1['as'],'attributes':_0x2ed2b1['attributes'],'include':_0x2ed2b1['include']?_[_0x455f('0x22')](_0x2ed2b1[_0x455f('0x23')],function(_0xe5e28){return{'model':db[_0xe5e28[_0x455f('0x24')]],'as':_0xe5e28['as'],'attributes':_0xe5e28['attributes']};}):[]};}):[]};}):[]:[]})[_0x455f('0x11')](function(_0x249d02){logger[_0x455f('0x25')](_0x455f('0x27'),_0x20efad);logger[_0x455f('0x28')](_0x455f('0x27'),_0x20efad,JSON[_0x455f('0x14')](_0x249d02));_0x1750d8(_0x249d02);})[_0x455f('0x1a')](function(_0xc88eed){logger[_0x455f('0x15')](_0x455f('0x27'),_0xc88eed[_0x455f('0x18')],_0x20efad);_0x399c40(_0x137c0a[_0x455f('0x15')](0x1f4,_0xc88eed[_0x455f('0x18')]));});});}; \ No newline at end of file +var _0x64c0=['../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./mailQueue.socket','request','then','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','MailQueue,\x20%s,\x20%s','message','info','result','catch','MailQueue','findAll','options','raw','attributes','include','map','model','GetMailQueue','ShowMailQueue','find','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0x64c0,0x8d));var _0x064c=function(_0x595c4e,_0x444249){_0x595c4e=_0x595c4e-0x0;var _0x1e224c=_0x64c0[_0x595c4e];return _0x1e224c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x064c('0x0'));var BPromise=require('bluebird');var rs=require(_0x064c('0x1'));var fs=require('fs');var Redis=require(_0x064c('0x2'));var db=require(_0x064c('0x3'))['db'];var utils=require(_0x064c('0x4'));var logger=require(_0x064c('0x5'))(_0x064c('0x6'));var config=require(_0x064c('0x7'));var jayson=require(_0x064c('0x8'));var client=jayson[_0x064c('0x9')][_0x064c('0xa')]({'port':0x232a});config[_0x064c('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x064c('0xc'))(new Redis(config[_0x064c('0xb')]));require(_0x064c('0xd'))['register'](socket);function respondWithRpcPromise(_0x32d425,_0x5e6a2a,_0x1c4fe3){return new BPromise(function(_0x331645,_0x1d203f){return client[_0x064c('0xe')](_0x32d425,_0x1c4fe3)[_0x064c('0xf')](function(_0x44e424){logger['info']('MailQueue,\x20%s,\x20%s',_0x5e6a2a,_0x064c('0x10'));logger[_0x064c('0x11')](_0x064c('0x12'),_0x5e6a2a,'request\x20sent',JSON[_0x064c('0x13')](_0x44e424));if(_0x44e424[_0x064c('0x14')]){if(_0x44e424[_0x064c('0x14')]['code']===0x1f4){logger[_0x064c('0x14')](_0x064c('0x15'),_0x5e6a2a,_0x44e424[_0x064c('0x14')][_0x064c('0x16')]);return _0x1d203f(_0x44e424[_0x064c('0x14')][_0x064c('0x16')]);}logger[_0x064c('0x14')](_0x064c('0x15'),_0x5e6a2a,_0x44e424['error'][_0x064c('0x16')]);return _0x331645(_0x44e424[_0x064c('0x14')]['message']);}else{logger[_0x064c('0x17')](_0x064c('0x15'),_0x5e6a2a,'request\x20sent');_0x331645(_0x44e424[_0x064c('0x18')][_0x064c('0x16')]);}})[_0x064c('0x19')](function(_0x312105){logger[_0x064c('0x14')]('MailQueue,\x20%s,\x20%s',_0x5e6a2a,_0x312105);_0x1d203f(_0x312105);});});}exports['GetMailQueue']=function(_0x42ebb1){var _0x1c6f44=this;return new Promise(function(_0xc1c19b,_0x4790ff){return db[_0x064c('0x1a')][_0x064c('0x1b')]({'raw':_0x42ebb1[_0x064c('0x1c')]?_0x42ebb1['options'][_0x064c('0x1d')]===undefined?!![]:![]:!![],'where':_0x42ebb1[_0x064c('0x1c')]?_0x42ebb1[_0x064c('0x1c')]['where']||null:null,'attributes':_0x42ebb1[_0x064c('0x1c')]?_0x42ebb1[_0x064c('0x1c')][_0x064c('0x1e')]||null:null,'limit':_0x42ebb1[_0x064c('0x1c')]?_0x42ebb1['options']['limit']||null:null,'include':_0x42ebb1['options']?_0x42ebb1[_0x064c('0x1c')][_0x064c('0x1f')]?_[_0x064c('0x20')](_0x42ebb1[_0x064c('0x1c')][_0x064c('0x1f')],function(_0x30e7e2){return{'model':db[_0x30e7e2[_0x064c('0x21')]],'as':_0x30e7e2['as'],'attributes':_0x30e7e2['attributes'],'include':_0x30e7e2[_0x064c('0x1f')]?_[_0x064c('0x20')](_0x30e7e2['include'],function(_0x3f014e){return{'model':db[_0x3f014e['model']],'as':_0x3f014e['as'],'attributes':_0x3f014e[_0x064c('0x1e')],'include':_0x3f014e[_0x064c('0x1f')]?_['map'](_0x3f014e[_0x064c('0x1f')],function(_0x4cd3fa){return{'model':db[_0x4cd3fa[_0x064c('0x21')]],'as':_0x4cd3fa['as'],'attributes':_0x4cd3fa[_0x064c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x064c('0xf')](function(_0x2832f9){logger[_0x064c('0x17')]('GetMailQueue',_0x42ebb1);logger[_0x064c('0x11')](_0x064c('0x22'),_0x42ebb1,JSON[_0x064c('0x13')](_0x2832f9));_0xc1c19b(_0x2832f9);})['catch'](function(_0x37d653){logger[_0x064c('0x14')](_0x064c('0x22'),_0x37d653[_0x064c('0x16')],_0x42ebb1);_0x4790ff(_0x1c6f44['error'](0x1f4,_0x37d653[_0x064c('0x16')]));});});};exports[_0x064c('0x23')]=function(_0x251dca){var _0x2d7663=this;return new Promise(function(_0x43071a,_0x4fef33){return db[_0x064c('0x1a')][_0x064c('0x24')]({'raw':_0x251dca[_0x064c('0x1c')]?_0x251dca[_0x064c('0x1c')][_0x064c('0x1d')]===undefined?!![]:![]:!![],'where':_0x251dca[_0x064c('0x1c')]?_0x251dca['options']['where']||null:null,'attributes':_0x251dca[_0x064c('0x1c')]?_0x251dca[_0x064c('0x1c')][_0x064c('0x1e')]||null:null,'include':_0x251dca['options']?_0x251dca[_0x064c('0x1c')][_0x064c('0x1f')]?_[_0x064c('0x20')](_0x251dca[_0x064c('0x1c')][_0x064c('0x1f')],function(_0x530597){return{'model':db[_0x530597[_0x064c('0x21')]],'as':_0x530597['as'],'attributes':_0x530597[_0x064c('0x1e')],'include':_0x530597['include']?_[_0x064c('0x20')](_0x530597[_0x064c('0x1f')],function(_0x23f27f){return{'model':db[_0x23f27f['model']],'as':_0x23f27f['as'],'attributes':_0x23f27f[_0x064c('0x1e')],'include':_0x23f27f[_0x064c('0x1f')]?_['map'](_0x23f27f['include'],function(_0x3e9df7){return{'model':db[_0x3e9df7['model']],'as':_0x3e9df7['as'],'attributes':_0x3e9df7[_0x064c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1731bc){logger[_0x064c('0x17')](_0x064c('0x23'),_0x251dca);logger['debug'](_0x064c('0x23'),_0x251dca,JSON[_0x064c('0x13')](_0x1731bc));_0x43071a(_0x1731bc);})[_0x064c('0x19')](function(_0x507446){logger[_0x064c('0x14')](_0x064c('0x23'),_0x507446[_0x064c('0x16')],_0x251dca);_0x4fef33(_0x2d7663['error'](0x1f4,_0x507446[_0x064c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index d5d0d9f..46253b7 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 _0xecd7=['remove','update','emit','removeListener','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0xecd7,0x18a));var _0x7ecd=function(_0x3ee662,_0x3d0aa1){_0x3ee662=_0x3ee662-0x0;var _0x363de7=_0xecd7[_0x3ee662];return _0x363de7;};'use strict';var MailQueueEvents=require(_0x7ecd('0x0'));var events=[_0x7ecd('0x1'),_0x7ecd('0x2'),_0x7ecd('0x3')];function createListener(_0x521ab8,_0x55d3f4){return function(_0x56520e){_0x55d3f4[_0x7ecd('0x4')](_0x521ab8,_0x56520e);};}function removeListener(_0x119035,_0x1b25cc){return function(){MailQueueEvents[_0x7ecd('0x5')](_0x119035,_0x1b25cc);};}exports[_0x7ecd('0x6')]=function(_0x2f653c){for(var _0x18ed77=0x0,_0xc60de0=events[_0x7ecd('0x7')];_0x18ed77<_0xc60de0;_0x18ed77++){var _0x5824ae=events[_0x18ed77];var _0x2e30e6=createListener(_0x7ecd('0x8')+_0x5824ae,_0x2f653c);MailQueueEvents['on'](_0x5824ae,_0x2e30e6);}}; \ No newline at end of file +var _0x5e0e=['mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x5d141c,_0x41355b){var _0x40d3f5=function(_0x436934){while(--_0x436934){_0x5d141c['push'](_0x5d141c['shift']());}};_0x40d3f5(++_0x41355b);}(_0x5e0e,0x1c3));var _0xe5e0=function(_0x46b7c4,_0x119ebc){_0x46b7c4=_0x46b7c4-0x0;var _0x7ab83=_0x5e0e[_0x46b7c4];return _0x7ab83;};'use strict';var MailQueueEvents=require(_0xe5e0('0x0'));var events=[_0xe5e0('0x1'),_0xe5e0('0x2'),_0xe5e0('0x3')];function createListener(_0xf1c748,_0x3e4503){return function(_0x3ad278){_0x3e4503[_0xe5e0('0x4')](_0xf1c748,_0x3ad278);};}function removeListener(_0x2c1b20,_0x45d38c){return function(){MailQueueEvents[_0xe5e0('0x5')](_0x2c1b20,_0x45d38c);};}exports[_0xe5e0('0x6')]=function(_0x304c05){for(var _0x4ebe51=0x0,_0x388a0e=events[_0xe5e0('0x7')];_0x4ebe51<_0x388a0e;_0x4ebe51++){var _0x39c8cd=events[_0x4ebe51];var _0x468c70=createListener(_0xe5e0('0x8')+_0x39c8cd,_0x304c05);MailQueueEvents['on'](_0x39c8cd,_0x468c70);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index fe7ce77..5999a38 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 _0x02cd=['put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','post'];(function(_0x1bc147,_0x47acdd){var _0x3fa75f=function(_0x460884){while(--_0x460884){_0x1bc147['push'](_0x1bc147['shift']());}};_0x3fa75f(++_0x47acdd);}(_0x02cd,0x122));var _0xd02c=function(_0x1591d4,_0x4ea3bd){_0x1591d4=_0x1591d4-0x0;var _0x4c46bb=_0x02cd[_0x1591d4];return _0x4c46bb;};'use strict';var multer=require(_0xd02c('0x0'));var util=require('util');var path=require(_0xd02c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd02c('0x2')]();var fs_extra=require(_0xd02c('0x3'));var auth=require(_0xd02c('0x4'));var interaction=require(_0xd02c('0x5'));var config=require(_0xd02c('0x6'));var controller=require(_0xd02c('0x7'));router[_0xd02c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd02c('0x8')](_0xd02c('0x9'),auth[_0xd02c('0xa')](),controller[_0xd02c('0xb')]);router[_0xd02c('0x8')](_0xd02c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd02c('0xd')]('/',auth[_0xd02c('0xa')](),controller['create']);router[_0xd02c('0xe')](_0xd02c('0xc'),auth[_0xd02c('0xa')](),controller[_0xd02c('0xf')]);router[_0xd02c('0x10')](_0xd02c('0xc'),auth[_0xd02c('0xa')](),controller[_0xd02c('0x11')]);module[_0xd02c('0x12')]=router; \ No newline at end of file +var _0x6717=['describe','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe'];(function(_0x2e712f,_0x60d75f){var _0x2fb152=function(_0x577196){while(--_0x577196){_0x2e712f['push'](_0x2e712f['shift']());}};_0x2fb152(++_0x60d75f);}(_0x6717,0xb3));var _0x7671=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6717[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7671('0x0'));var util=require(_0x7671('0x1'));var path=require(_0x7671('0x2'));var timeout=require(_0x7671('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7671('0x4'));var interaction=require(_0x7671('0x5'));var config=require(_0x7671('0x6'));var controller=require('./mailQueueReport.controller');router[_0x7671('0x7')]('/',auth['isAuthenticated'](),controller[_0x7671('0x8')]);router[_0x7671('0x7')](_0x7671('0x9'),auth['isAuthenticated'](),controller[_0x7671('0xa')]);router[_0x7671('0x7')](_0x7671('0xb'),auth['isAuthenticated'](),controller[_0x7671('0xc')]);router[_0x7671('0xd')]('/',auth[_0x7671('0xe')](),controller[_0x7671('0xf')]);router[_0x7671('0x10')](_0x7671('0xb'),auth[_0x7671('0xe')](),controller[_0x7671('0x11')]);router[_0x7671('0x12')](_0x7671('0xb'),auth[_0x7671('0xe')](),controller[_0x7671('0x13')]);module[_0x7671('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 1043849..944bb54 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 _0xd652=['exports','STRING','DATE','sequelize'];(function(_0x5bc786,_0x2139fe){var _0x1d9881=function(_0x3e8c01){while(--_0x3e8c01){_0x5bc786['push'](_0x5bc786['shift']());}};_0x1d9881(++_0x2139fe);}(_0xd652,0xe3));var _0x2d65=function(_0xe6f139,_0x193ac1){_0xe6f139=_0xe6f139-0x0;var _0x3f84c5=_0xd652[_0xe6f139];return _0x3f84c5;};'use strict';var moment=require('moment');var Sequelize=require(_0x2d65('0x0'));module[_0x2d65('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2d65('0x2')]},'joinAt':{'type':Sequelize[_0x2d65('0x3')]},'leaveAt':{'type':Sequelize[_0x2d65('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2d65('0x3')]},'reason':{'type':Sequelize[_0x2d65('0x2')]}}; \ No newline at end of file +var _0x86b9=['sequelize','exports','STRING','DATE','moment'];(function(_0x595a73,_0xd78c12){var _0x25824d=function(_0x37e242){while(--_0x37e242){_0x595a73['push'](_0x595a73['shift']());}};_0x25824d(++_0xd78c12);}(_0x86b9,0x1e4));var _0x986b=function(_0x6fa168,_0x3d13cb){_0x6fa168=_0x6fa168-0x0;var _0x24f9a7=_0x86b9[_0x6fa168];return _0x24f9a7;};'use strict';var moment=require(_0x986b('0x0'));var Sequelize=require(_0x986b('0x1'));module[_0x986b('0x2')]={'uniqueid':{'type':Sequelize[_0x986b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x986b('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x986b('0x4')]},'exitAt':{'type':Sequelize[_0x986b('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 515c70d..297c301 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 _0x0424=['index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','MailQueueReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send'];(function(_0x1d7907,_0x131382){var _0x4656fa=function(_0x440fd6){while(--_0x440fd6){_0x1d7907['push'](_0x1d7907['shift']());}};_0x4656fa(++_0x131382);}(_0x0424,0x159));var _0x4042=function(_0x5d9a85,_0x55221e){_0x5d9a85=_0x5d9a85-0x0;var _0x1ef8aa=_0x0424[_0x5d9a85];return _0x1ef8aa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4042('0x0'));var jsonpatch=require(_0x4042('0x1'));var rp=require(_0x4042('0x2'));var moment=require(_0x4042('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4042('0x4'));var util=require('util');var path=require('path');var sox=require(_0x4042('0x5'));var csv=require(_0x4042('0x6'));var ejs=require(_0x4042('0x7'));var fs=require('fs');var fs_extra=require(_0x4042('0x8'));var _=require(_0x4042('0x9'));var squel=require(_0x4042('0xa'));var crypto=require(_0x4042('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4042('0x6'));var querystring=require(_0x4042('0xc'));var Papa=require(_0x4042('0xd'));var Redis=require('ioredis');var authService=require(_0x4042('0xe'));var qs=require(_0x4042('0xf'));var as=require(_0x4042('0x10'));var hardwareService=require(_0x4042('0x11'));var logger=require(_0x4042('0x12'))(_0x4042('0x13'));var utils=require(_0x4042('0x14'));var config=require(_0x4042('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4042('0x16'))['db'];function respondWithStatusCode(_0x357838,_0x59a068){_0x59a068=_0x59a068||0xcc;return function(_0x25fd0a){if(_0x25fd0a){return _0x357838[_0x4042('0x17')](_0x59a068);}return _0x357838[_0x4042('0x18')](_0x59a068)[_0x4042('0x19')]();};}function respondWithResult(_0x35f82a,_0x1ff3ca){_0x1ff3ca=_0x1ff3ca||0xc8;return function(_0xc115bd){if(_0xc115bd){return _0x35f82a['status'](_0x1ff3ca)[_0x4042('0x1a')](_0xc115bd);}};}function respondWithFilteredResult(_0x291e5c,_0x50206f){return function(_0x28087d){if(_0x28087d){var _0x3f99f8=typeof _0x50206f[_0x4042('0x1b')]===_0x4042('0x1c')&&typeof _0x50206f[_0x4042('0x1d')]===_0x4042('0x1c');var _0x62cb76=_0x28087d[_0x4042('0x1e')];var _0x466077=_0x3f99f8?0x0:_0x50206f['offset'];var _0xe5c1ec=_0x3f99f8?_0x28087d['count']:_0x50206f[_0x4042('0x1b')]+_0x50206f['limit'];var _0xca9ca6;if(_0xe5c1ec>=_0x62cb76){_0xe5c1ec=_0x62cb76;_0xca9ca6=0xc8;}else{_0xca9ca6=0xce;}_0x291e5c[_0x4042('0x18')](_0xca9ca6);return _0x291e5c[_0x4042('0x1f')](_0x4042('0x20'),_0x466077+'-'+_0xe5c1ec+'/'+_0x62cb76)['json'](_0x28087d);}return null;};}function patchUpdates(_0xb72021){return function(_0x4561e3){try{jsonpatch[_0x4042('0x21')](_0x4561e3,_0xb72021,!![]);}catch(_0xd1ddb){return BPromise['reject'](_0xd1ddb);}return _0x4561e3[_0x4042('0x22')]();};}function saveUpdates(_0xf0e0c6,_0xd6fe6c){return function(_0x83ce71){if(_0x83ce71){return _0x83ce71[_0x4042('0x23')](_0xf0e0c6)['then'](function(_0x1f9d4a){return _0x1f9d4a;});}return null;};}function removeEntity(_0x6d12a5,_0x519f2c){return function(_0x1daee8){if(_0x1daee8){return _0x1daee8['destroy']()[_0x4042('0x24')](function(){_0x6d12a5[_0x4042('0x18')](0xcc)[_0x4042('0x19')]();});}};}function handleEntityNotFound(_0x5d5c6d,_0x461c5e){return function(_0x3b9e78){if(!_0x3b9e78){_0x5d5c6d[_0x4042('0x17')](0x194);}return _0x3b9e78;};}function handleError(_0xbdadc8,_0x1c4d9f){_0x1c4d9f=_0x1c4d9f||0x1f4;return function(_0x52e575){logger['error'](_0x52e575[_0x4042('0x25')]);if(_0x52e575[_0x4042('0x26')]){delete _0x52e575[_0x4042('0x26')];}_0xbdadc8[_0x4042('0x18')](_0x1c4d9f)[_0x4042('0x27')](_0x52e575);};}exports[_0x4042('0x28')]=function(_0x5eb84b,_0x33733b){var _0x1e9bd7={},_0x4a6a6e={},_0xae26c2={'count':0x0,'rows':[]};var _0x89e16=_[_0x4042('0x29')](db['MailQueueReport']['rawAttributes'],function(_0x3d1f48){return{'name':_0x3d1f48[_0x4042('0x2a')],'type':_0x3d1f48['type'][_0x4042('0x2b')]};});_0x4a6a6e[_0x4042('0x2c')]=_[_0x4042('0x29')](_0x89e16,_0x4042('0x26'));_0x4a6a6e[_0x4042('0x2d')]=_[_0x4042('0x2e')](_0x5eb84b[_0x4042('0x2d')]);_0x4a6a6e[_0x4042('0x2f')]=_[_0x4042('0x30')](_0x4a6a6e['model'],_0x4a6a6e[_0x4042('0x2d')]);_0x1e9bd7[_0x4042('0x31')]=_['intersection'](_0x4a6a6e[_0x4042('0x2c')],qs[_0x4042('0x32')](_0x5eb84b['query'][_0x4042('0x32')]));_0x1e9bd7[_0x4042('0x31')]=_0x1e9bd7[_0x4042('0x31')][_0x4042('0x33')]?_0x1e9bd7[_0x4042('0x31')]:_0x4a6a6e[_0x4042('0x2c')];if(!_0x5eb84b[_0x4042('0x2d')][_0x4042('0x34')](_0x4042('0x35'))){_0x1e9bd7[_0x4042('0x1d')]=qs[_0x4042('0x1d')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x1d')]);_0x1e9bd7[_0x4042('0x1b')]=qs[_0x4042('0x1b')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x1b')]);}_0x1e9bd7[_0x4042('0x36')]=qs[_0x4042('0x37')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x37')]);_0x1e9bd7['where']=qs[_0x4042('0x2f')](_[_0x4042('0x38')](_0x5eb84b[_0x4042('0x2d')],_0x4a6a6e[_0x4042('0x2f')]),_0x89e16);if(_0x5eb84b['query'][_0x4042('0x39')]){_0x1e9bd7[_0x4042('0x3a')]=_[_0x4042('0x3b')](_0x1e9bd7[_0x4042('0x3a')],{'$or':_[_0x4042('0x29')](_0x89e16,function(_0x13da64){if(_0x13da64[_0x4042('0x3c')]!==_0x4042('0x3d')){var _0x341083={};_0x341083[_0x13da64[_0x4042('0x26')]]={'$like':'%'+_0x5eb84b['query'][_0x4042('0x39')]+'%'};return _0x341083;}})});}_0x1e9bd7=_[_0x4042('0x3b')]({},_0x1e9bd7,_0x5eb84b[_0x4042('0x3e')]);var _0x1eab87={'where':_0x1e9bd7[_0x4042('0x3a')]};return db[_0x4042('0x3f')][_0x4042('0x1e')](_0x1eab87)[_0x4042('0x24')](function(_0x52b1bd){_0xae26c2['count']=_0x52b1bd;if(_0x5eb84b[_0x4042('0x2d')][_0x4042('0x40')]){_0x1e9bd7[_0x4042('0x41')]=[{'all':!![]}];}return db[_0x4042('0x3f')][_0x4042('0x42')](_0x1e9bd7);})[_0x4042('0x24')](function(_0xdfb5cb){_0xae26c2[_0x4042('0x43')]=_0xdfb5cb;return _0xae26c2;})[_0x4042('0x24')](respondWithFilteredResult(_0x33733b,_0x1e9bd7))[_0x4042('0x44')](handleError(_0x33733b,null));};exports[_0x4042('0x45')]=function(_0x35fdc2,_0x5666ed){var _0x5dea57={'raw':!![],'where':{'id':_0x35fdc2[_0x4042('0x46')]['id']}},_0x929884={};_0x929884['model']=_[_0x4042('0x2e')](db['MailQueueReport'][_0x4042('0x47')]);_0x929884[_0x4042('0x2d')]=_[_0x4042('0x2e')](_0x35fdc2['query']);_0x929884[_0x4042('0x2f')]=_[_0x4042('0x30')](_0x929884['model'],_0x929884[_0x4042('0x2d')]);_0x5dea57[_0x4042('0x31')]=_[_0x4042('0x30')](_0x929884[_0x4042('0x2c')],qs[_0x4042('0x32')](_0x35fdc2['query']['fields']));_0x5dea57['attributes']=_0x5dea57[_0x4042('0x31')][_0x4042('0x33')]?_0x5dea57['attributes']:_0x929884['model'];if(_0x35fdc2['query'][_0x4042('0x40')]){_0x5dea57['include']=[{'all':!![]}];}_0x5dea57=_['merge']({},_0x5dea57,_0x35fdc2[_0x4042('0x3e')]);return db[_0x4042('0x3f')][_0x4042('0x48')](_0x5dea57)[_0x4042('0x24')](handleEntityNotFound(_0x5666ed,null))[_0x4042('0x24')](respondWithResult(_0x5666ed,null))[_0x4042('0x44')](handleError(_0x5666ed,null));};exports[_0x4042('0x49')]=function(_0x2abc13,_0x198209){return db['MailQueueReport']['create'](_0x2abc13['body'],{})['then'](respondWithResult(_0x198209,0xc9))[_0x4042('0x44')](handleError(_0x198209,null));};exports[_0x4042('0x23')]=function(_0xd898ea,_0x250434){if(_0xd898ea[_0x4042('0x4a')]['id']){delete _0xd898ea[_0x4042('0x4a')]['id'];}return db[_0x4042('0x3f')][_0x4042('0x48')]({'where':{'id':_0xd898ea['params']['id']}})[_0x4042('0x24')](handleEntityNotFound(_0x250434,null))[_0x4042('0x24')](saveUpdates(_0xd898ea[_0x4042('0x4a')],null))[_0x4042('0x24')](respondWithResult(_0x250434,null))[_0x4042('0x44')](handleError(_0x250434,null));};exports[_0x4042('0x4b')]=function(_0xf5f38a,_0x591a0f){return db['MailQueueReport']['find']({'where':{'id':_0xf5f38a[_0x4042('0x46')]['id']}})[_0x4042('0x24')](handleEntityNotFound(_0x591a0f,null))['then'](removeEntity(_0x591a0f,null))[_0x4042('0x44')](handleError(_0x591a0f,null));};exports[_0x4042('0x4c')]=function(_0x5d42a7,_0x4ec047){return db[_0x4042('0x3f')][_0x4042('0x4c')]()[_0x4042('0x24')](respondWithResult(_0x4ec047,null))[_0x4042('0x44')](handleError(_0x4ec047,null));}; \ No newline at end of file +var _0xed1c=['rows','catch','show','MailQueueReport','create','body','params','find','describe','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0x4b589f,_0x2c9bbb){var _0x4f0a37=function(_0x43017c){while(--_0x43017c){_0x4b589f['push'](_0x4b589f['shift']());}};_0x4f0a37(++_0x2c9bbb);}(_0xed1c,0xe4));var _0xced1=function(_0x25be63,_0x4b335e){_0x25be63=_0x25be63-0x0;var _0x4daaa8=_0xed1c[_0x25be63];return _0x4daaa8;};'use strict';var emlformat=require(_0xced1('0x0'));var rimraf=require(_0xced1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xced1('0x2'));var Mustache=require(_0xced1('0x3'));var util=require(_0xced1('0x4'));var path=require('path');var sox=require(_0xced1('0x5'));var csv=require(_0xced1('0x6'));var ejs=require(_0xced1('0x7'));var fs=require('fs');var fs_extra=require(_0xced1('0x8'));var _=require('lodash');var squel=require(_0xced1('0x9'));var crypto=require(_0xced1('0xa'));var jsforce=require(_0xced1('0xb'));var deskjs=require(_0xced1('0xc'));var toCsv=require(_0xced1('0x6'));var querystring=require(_0xced1('0xd'));var Papa=require(_0xced1('0xe'));var Redis=require(_0xced1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xced1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xced1('0x11'));var logger=require(_0xced1('0x12'))(_0xced1('0x13'));var utils=require(_0xced1('0x14'));var config=require(_0xced1('0x15'));var licenseUtil=require(_0xced1('0x16'));var db=require(_0xced1('0x17'))['db'];function respondWithStatusCode(_0x5e5637,_0x118f69){_0x118f69=_0x118f69||0xcc;return function(_0x2a5cd6){if(_0x2a5cd6){return _0x5e5637[_0xced1('0x18')](_0x118f69);}return _0x5e5637[_0xced1('0x19')](_0x118f69)['end']();};}function respondWithResult(_0xdaaea7,_0x31a32c){_0x31a32c=_0x31a32c||0xc8;return function(_0x54cba9){if(_0x54cba9){return _0xdaaea7[_0xced1('0x19')](_0x31a32c)[_0xced1('0x1a')](_0x54cba9);}};}function respondWithFilteredResult(_0x3708b1,_0x32100b){return function(_0x47baec){if(_0x47baec){var _0x5560af=typeof _0x32100b[_0xced1('0x1b')]===_0xced1('0x1c')&&typeof _0x32100b[_0xced1('0x1d')]===_0xced1('0x1c');var _0x3e53bd=_0x47baec[_0xced1('0x1e')];var _0x5a563a=_0x5560af?0x0:_0x32100b['offset'];var _0x2a92c8=_0x5560af?_0x47baec[_0xced1('0x1e')]:_0x32100b[_0xced1('0x1b')]+_0x32100b['limit'];var _0x1eac14;if(_0x2a92c8>=_0x3e53bd){_0x2a92c8=_0x3e53bd;_0x1eac14=0xc8;}else{_0x1eac14=0xce;}_0x3708b1[_0xced1('0x19')](_0x1eac14);return _0x3708b1[_0xced1('0x1f')]('Content-Range',_0x5a563a+'-'+_0x2a92c8+'/'+_0x3e53bd)[_0xced1('0x1a')](_0x47baec);}return null;};}function patchUpdates(_0x42b146){return function(_0x23ded4){try{jsonpatch['apply'](_0x23ded4,_0x42b146,!![]);}catch(_0x138c8b){return BPromise[_0xced1('0x20')](_0x138c8b);}return _0x23ded4[_0xced1('0x21')]();};}function saveUpdates(_0x5f1474,_0x4dab56){return function(_0x1d3884){if(_0x1d3884){return _0x1d3884[_0xced1('0x22')](_0x5f1474)[_0xced1('0x23')](function(_0x20dcb4){return _0x20dcb4;});}return null;};}function removeEntity(_0x210d7e,_0x49c8b9){return function(_0x14f47e){if(_0x14f47e){return _0x14f47e[_0xced1('0x24')]()['then'](function(){_0x210d7e['status'](0xcc)[_0xced1('0x25')]();});}};}function handleEntityNotFound(_0x258c9a,_0x3af9c0){return function(_0x3912fe){if(!_0x3912fe){_0x258c9a[_0xced1('0x18')](0x194);}return _0x3912fe;};}function handleError(_0x25b6e7,_0x50c543){_0x50c543=_0x50c543||0x1f4;return function(_0x181f6e){logger[_0xced1('0x26')](_0x181f6e[_0xced1('0x27')]);if(_0x181f6e[_0xced1('0x28')]){delete _0x181f6e[_0xced1('0x28')];}_0x25b6e7[_0xced1('0x19')](_0x50c543)[_0xced1('0x29')](_0x181f6e);};}exports['index']=function(_0x15c4f4,_0x4ef64e){var _0x45cb03={},_0x2c2269={},_0x6dc558={'count':0x0,'rows':[]};var _0x176215=_['map'](db['MailQueueReport'][_0xced1('0x2a')],function(_0x15117b){return{'name':_0x15117b[_0xced1('0x2b')],'type':_0x15117b['type']['key']};});_0x2c2269['model']=_[_0xced1('0x2c')](_0x176215,_0xced1('0x28'));_0x2c2269[_0xced1('0x2d')]=_[_0xced1('0x2e')](_0x15c4f4['query']);_0x2c2269[_0xced1('0x2f')]=_[_0xced1('0x30')](_0x2c2269[_0xced1('0x31')],_0x2c2269[_0xced1('0x2d')]);_0x45cb03[_0xced1('0x32')]=_[_0xced1('0x30')](_0x2c2269[_0xced1('0x31')],qs['fields'](_0x15c4f4['query'][_0xced1('0x33')]));_0x45cb03[_0xced1('0x32')]=_0x45cb03[_0xced1('0x32')][_0xced1('0x34')]?_0x45cb03[_0xced1('0x32')]:_0x2c2269[_0xced1('0x31')];if(!_0x15c4f4['query']['hasOwnProperty']('nolimit')){_0x45cb03['limit']=qs[_0xced1('0x1d')](_0x15c4f4[_0xced1('0x2d')][_0xced1('0x1d')]);_0x45cb03[_0xced1('0x1b')]=qs[_0xced1('0x1b')](_0x15c4f4[_0xced1('0x2d')][_0xced1('0x1b')]);}_0x45cb03[_0xced1('0x35')]=qs[_0xced1('0x36')](_0x15c4f4[_0xced1('0x2d')][_0xced1('0x36')]);_0x45cb03[_0xced1('0x37')]=qs[_0xced1('0x2f')](_['pick'](_0x15c4f4[_0xced1('0x2d')],_0x2c2269[_0xced1('0x2f')]),_0x176215);if(_0x15c4f4[_0xced1('0x2d')][_0xced1('0x38')]){_0x45cb03[_0xced1('0x37')]=_[_0xced1('0x39')](_0x45cb03['where'],{'$or':_[_0xced1('0x2c')](_0x176215,function(_0x3f3632){if(_0x3f3632[_0xced1('0x3a')]!==_0xced1('0x3b')){var _0x282361={};_0x282361[_0x3f3632[_0xced1('0x28')]]={'$like':'%'+_0x15c4f4[_0xced1('0x2d')][_0xced1('0x38')]+'%'};return _0x282361;}})});}_0x45cb03=_[_0xced1('0x39')]({},_0x45cb03,_0x15c4f4[_0xced1('0x3c')]);var _0x1e119c={'where':_0x45cb03['where']};return db['MailQueueReport'][_0xced1('0x1e')](_0x1e119c)[_0xced1('0x23')](function(_0x1887a3){_0x6dc558['count']=_0x1887a3;if(_0x15c4f4[_0xced1('0x2d')][_0xced1('0x3d')]){_0x45cb03[_0xced1('0x3e')]=[{'all':!![]}];}return db['MailQueueReport'][_0xced1('0x3f')](_0x45cb03);})[_0xced1('0x23')](function(_0x5a01f6){_0x6dc558[_0xced1('0x40')]=_0x5a01f6;return _0x6dc558;})['then'](respondWithFilteredResult(_0x4ef64e,_0x45cb03))[_0xced1('0x41')](handleError(_0x4ef64e,null));};exports[_0xced1('0x42')]=function(_0x4f99df,_0x1ddaea){var _0x172a7e={'raw':!![],'where':{'id':_0x4f99df['params']['id']}},_0xdb8e8e={};_0xdb8e8e[_0xced1('0x31')]=_[_0xced1('0x2e')](db['MailQueueReport'][_0xced1('0x2a')]);_0xdb8e8e['query']=_['keys'](_0x4f99df[_0xced1('0x2d')]);_0xdb8e8e['filters']=_[_0xced1('0x30')](_0xdb8e8e[_0xced1('0x31')],_0xdb8e8e[_0xced1('0x2d')]);_0x172a7e['attributes']=_[_0xced1('0x30')](_0xdb8e8e['model'],qs[_0xced1('0x33')](_0x4f99df[_0xced1('0x2d')][_0xced1('0x33')]));_0x172a7e[_0xced1('0x32')]=_0x172a7e['attributes'][_0xced1('0x34')]?_0x172a7e[_0xced1('0x32')]:_0xdb8e8e['model'];if(_0x4f99df[_0xced1('0x2d')][_0xced1('0x3d')]){_0x172a7e['include']=[{'all':!![]}];}_0x172a7e=_[_0xced1('0x39')]({},_0x172a7e,_0x4f99df[_0xced1('0x3c')]);return db[_0xced1('0x43')]['find'](_0x172a7e)[_0xced1('0x23')](handleEntityNotFound(_0x1ddaea,null))[_0xced1('0x23')](respondWithResult(_0x1ddaea,null))[_0xced1('0x41')](handleError(_0x1ddaea,null));};exports[_0xced1('0x44')]=function(_0x376619,_0x528cd5){return db[_0xced1('0x43')]['create'](_0x376619[_0xced1('0x45')],{})[_0xced1('0x23')](respondWithResult(_0x528cd5,0xc9))[_0xced1('0x41')](handleError(_0x528cd5,null));};exports[_0xced1('0x22')]=function(_0x412693,_0x38aa3b){if(_0x412693['body']['id']){delete _0x412693[_0xced1('0x45')]['id'];}return db[_0xced1('0x43')]['find']({'where':{'id':_0x412693[_0xced1('0x46')]['id']}})['then'](handleEntityNotFound(_0x38aa3b,null))['then'](saveUpdates(_0x412693[_0xced1('0x45')],null))[_0xced1('0x23')](respondWithResult(_0x38aa3b,null))[_0xced1('0x41')](handleError(_0x38aa3b,null));};exports[_0xced1('0x24')]=function(_0x4f0183,_0x1090bc){return db[_0xced1('0x43')][_0xced1('0x47')]({'where':{'id':_0x4f0183['params']['id']}})['then'](handleEntityNotFound(_0x1090bc,null))[_0xced1('0x23')](removeEntity(_0x1090bc,null))[_0xced1('0x41')](handleError(_0x1090bc,null));};exports[_0xced1('0x48')]=function(_0x226b3e,_0x4b460e){return db['MailQueueReport']['describe']()[_0xced1('0x23')](respondWithResult(_0x4b460e,null))[_0xced1('0x41')](handleError(_0x4b460e,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index fef2d53..ed1c271 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 _0x9285=['exports','define','MailQueueReport','uniqueid','api','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes'];(function(_0x447d7a,_0xbf199){var _0x20f25e=function(_0x54504d){while(--_0x54504d){_0x447d7a['push'](_0x447d7a['shift']());}};_0x20f25e(++_0xbf199);}(_0x9285,0x158));var _0x5928=function(_0x4524ba,_0x467f29){_0x4524ba=_0x4524ba-0x0;var _0x216f93=_0x9285[_0x4524ba];return _0x216f93;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5928('0x0'));var moment=require('moment');var BPromise=require(_0x5928('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5928('0x2'));var rimraf=require(_0x5928('0x3'));var config=require(_0x5928('0x4'));var attributes=require(_0x5928('0x5'));module[_0x5928('0x6')]=function(_0x661f6e,_0x4d7f8a){return _0x661f6e[_0x5928('0x7')](_0x5928('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5928('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x38b8=['MailQueueReport','report_mail_queue','uniqueid','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2c5773,_0x39a96e){var _0x3f81ef=function(_0x5df8ff){while(--_0x5df8ff){_0x2c5773['push'](_0x2c5773['shift']());}};_0x3f81ef(++_0x39a96e);}(_0x38b8,0x7b));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x838b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x838b('0x1'));var BPromise=require(_0x838b('0x2'));var rp=require(_0x838b('0x3'));var fs=require('fs');var path=require(_0x838b('0x4'));var rimraf=require(_0x838b('0x5'));var config=require(_0x838b('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0x838b('0x7')]=function(_0x45a625,_0x5b589c){return _0x45a625[_0x838b('0x8')](_0x838b('0x9'),attributes,{'tableName':_0x838b('0xa'),'paranoid':![],'indexes':[{'name':_0x838b('0xb'),'fields':[_0x838b('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 7e77056..b3e67fe 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3b3e81,_0x34e727){var _0x1c9744=function(_0x35b081){while(--_0x35b081){_0x3b3e81['push'](_0x3b3e81['shift']());}};_0x1c9744(++_0x34e727);}(_0xadb5,0xad));var _0x5adb=function(_0x449161,_0x1ae5a5){_0x449161=_0x449161-0x0;var _0x3dbaed=_0xadb5[_0x449161];return _0x3dbaed;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0x5f2f=['error','code','message','request\x20sent','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','stringify'];(function(_0xf81426,_0x4e5bde){var _0x275c17=function(_0x53bca3){while(--_0x53bca3){_0xf81426['push'](_0xf81426['shift']());}};_0x275c17(++_0x4e5bde);}(_0x5f2f,0x73));var _0xf5f2=function(_0x39f964,_0x328eee){_0x39f964=_0x39f964-0x0;var _0x3c659e=_0x5f2f[_0x39f964];return _0x3c659e;};'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')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47acfc){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger['debug'](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x47acfc));_0x4ff59b(_0x47acfc);})[_0xf5f2('0x16')](function(_0x39c024){logger[_0xf5f2('0x11')]('CreateMailQueueReport',_0x39c024[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x39c024[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x1d')]=function(_0x287ad5){var _0x5bdf4a=this;return new Promise(function(_0x529f07,_0x5f1124){return db[_0xf5f2('0x18')][_0xf5f2('0x1e')](_0x287ad5[_0xf5f2('0x1a')],{'raw':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')]['where']||null:null,'attributes':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null,'limit':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null})['then'](function(_0x53cb96){logger[_0xf5f2('0xd')](_0xf5f2('0x1d'),_0x287ad5);logger[_0xf5f2('0xf')]('UpdateMailQueueReport',_0x287ad5,JSON['stringify'](_0x53cb96));_0x529f07(_0x53cb96);})[_0xf5f2('0x16')](function(_0x50b8a2){logger[_0xf5f2('0x11')](_0xf5f2('0x1d'),_0x50b8a2[_0xf5f2('0x13')],_0x287ad5);_0x5f1124(_0x5bdf4a['error'](0x1f4,_0x50b8a2['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index f6ef1a9..3c2a943 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x290844,_0x366077){var _0x546847=function(_0x4ea65e){while(--_0x4ea65e){_0x290844['push'](_0x290844['shift']());}};_0x546847(++_0x366077);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x29d659,_0x4d5d86){var _0x32db38=function(_0x27d36d){while(--_0x27d36d){_0x29d659['push'](_0x29d659['shift']());}};_0x32db38(++_0x4d5d86);}(_0xedd9,0xfc));var _0x9edd=function(_0x452770,_0x108ecd){_0x452770=_0x452770-0x0;var _0x369927=_0xedd9[_0x452770];return _0x369927;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 9d257f6..e082810 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 _0xc458=['INTEGER','sequelize','exports','STRING','BOOLEAN','INBOX'];(function(_0x2d132d,_0x5a589b){var _0x331b85=function(_0x565b66){while(--_0x565b66){_0x2d132d['push'](_0x2d132d['shift']());}};_0x331b85(++_0x5a589b);}(_0xc458,0x1f3));var _0x8c45=function(_0x17f1bd,_0x5f5005){_0x17f1bd=_0x17f1bd-0x0;var _0x16bfaa=_0xc458[_0x17f1bd];return _0x16bfaa;};'use strict';var Sequelize=require(_0x8c45('0x0'));module[_0x8c45('0x1')]={'description':{'type':Sequelize[_0x8c45('0x2')]},'host':{'type':Sequelize[_0x8c45('0x2')]},'authentication':{'type':Sequelize[_0x8c45('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x8c45('0x2')]},'password':{'type':Sequelize[_0x8c45('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x8c45('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x8c45('0x2')],'defaultValue':_0x8c45('0x4')},'connTimeout':{'type':Sequelize[_0x8c45('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8c45('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x8c45('0x2')]},'modernAuthentication':{'type':Sequelize[_0x8c45('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8b39=['INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8b39,0x1ee));var _0x98b3=function(_0x275560,_0xead495){_0x275560=_0x275560-0x0;var _0x3dcabc=_0x8b39[_0x275560];return _0x3dcabc;};'use strict';var Sequelize=require(_0x98b3('0x0'));module[_0x98b3('0x1')]={'description':{'type':Sequelize[_0x98b3('0x2')]},'host':{'type':Sequelize[_0x98b3('0x2')]},'authentication':{'type':Sequelize[_0x98b3('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x98b3('0x2')]},'port':{'type':Sequelize[_0x98b3('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x98b3('0x2')],'defaultValue':_0x98b3('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x98b3('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x98b3('0x2')]},'modernAuthentication':{'type':Sequelize[_0x98b3('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 2eccf6a..03d0062 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 _0x2fdf=['exports','define','MailServerIn','api','moment','bluebird','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2fdf,0x1aa));var _0xf2fd=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x2fdf[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf2fd('0x0'));var moment=require(_0xf2fd('0x1'));var BPromise=require(_0xf2fd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf2fd('0x3'));var config=require(_0xf2fd('0x4'));var attributes=require(_0xf2fd('0x5'));module[_0xf2fd('0x6')]=function(_0x379574,_0x8c277d){return _0x379574[_0xf2fd('0x7')](_0xf2fd('0x8'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5b6=['define','MailServerIn','util','api','moment','request-promise','path','rimraf','./mailServerIn.attributes','exports'];(function(_0x45f55f,_0x1f0e4d){var _0xcccbe2=function(_0x2f10be){while(--_0x2f10be){_0x45f55f['push'](_0x45f55f['shift']());}};_0xcccbe2(++_0x1f0e4d);}(_0xd5b6,0x160));var _0x6d5b=function(_0xb84e19,_0x557ca7){_0xb84e19=_0xb84e19-0x0;var _0x4b59c8=_0xd5b6[_0xb84e19];return _0x4b59c8;};'use strict';var _=require('lodash');var util=require(_0x6d5b('0x0'));var logger=require('../../config/logger')(_0x6d5b('0x1'));var moment=require(_0x6d5b('0x2'));var BPromise=require('bluebird');var rp=require(_0x6d5b('0x3'));var fs=require('fs');var path=require(_0x6d5b('0x4'));var rimraf=require(_0x6d5b('0x5'));var config=require('../../config/environment');var attributes=require(_0x6d5b('0x6'));module[_0x6d5b('0x7')]=function(_0x3dab49,_0x38e3ad){return _0x3dab49[_0x6d5b('0x8')](_0x6d5b('0x9'),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 6d597a4..7647436 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 _0xf72b=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','catch','lodash','moment','randomstring'];(function(_0x2c9238,_0x42c58d){var _0x1acf94=function(_0x2d5bee){while(--_0x2d5bee){_0x2c9238['push'](_0x2c9238['shift']());}};_0x1acf94(++_0x42c58d);}(_0xf72b,0x1d9));var _0xbf72=function(_0x53e814,_0x44dc81){_0x53e814=_0x53e814-0x0;var _0x50aaea=_0xf72b[_0x53e814];return _0x50aaea;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var moment=require(_0xbf72('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf72('0x2'));var fs=require('fs');var Redis=require(_0xbf72('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf72('0x4'));var logger=require(_0xbf72('0x5'))(_0xbf72('0x6'));var config=require(_0xbf72('0x7'));var jayson=require(_0xbf72('0x8'));var client=jayson[_0xbf72('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41c11d,_0xc0842b,_0x119807){return new BPromise(function(_0xd0402c,_0xdd6177){return client[_0xbf72('0xa')](_0x41c11d,_0x119807)['then'](function(_0x455891){logger['info'](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));logger['debug'](_0xbf72('0xd'),_0xc0842b,_0xbf72('0xc'),JSON[_0xbf72('0xe')](_0x455891));if(_0x455891[_0xbf72('0xf')]){if(_0x455891[_0xbf72('0xf')][_0xbf72('0x10')]===0x1f4){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x455891['error'][_0xbf72('0x11')]);return _0xdd6177(_0x455891[_0xbf72('0xf')][_0xbf72('0x11')]);}logger['error'](_0xbf72('0xb'),_0xc0842b,_0x455891['error']['message']);return _0xd0402c(_0x455891['error'][_0xbf72('0x11')]);}else{logger[_0xbf72('0x12')](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));_0xd0402c(_0x455891[_0xbf72('0x13')][_0xbf72('0x11')]);}})['catch'](function(_0x266ce2){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x266ce2);_0xdd6177(_0x266ce2);});});}exports[_0xbf72('0x14')]=function(_0x27dadc){var _0x5b5fc9=this;return new Promise(function(_0x51d4c9,_0x1b8d73){return db[_0xbf72('0x15')][_0xbf72('0x16')]({'raw':_0x27dadc[_0xbf72('0x17')]?_0x27dadc[_0xbf72('0x17')][_0xbf72('0x18')]===undefined?!![]:![]:!![],'where':_0x27dadc[_0xbf72('0x17')]?_0x27dadc['options'][_0xbf72('0x19')]||null:null,'attributes':_0x27dadc[_0xbf72('0x17')]?_0x27dadc[_0xbf72('0x17')][_0xbf72('0x1a')]||null:null,'limit':_0x27dadc[_0xbf72('0x17')]?_0x27dadc['options'][_0xbf72('0x1b')]||null:null,'include':_0x27dadc[_0xbf72('0x17')]?_0x27dadc['options'][_0xbf72('0x1c')]?_[_0xbf72('0x1d')](_0x27dadc[_0xbf72('0x17')]['include'],function(_0x44f3f9){return{'model':db[_0x44f3f9[_0xbf72('0x1e')]],'as':_0x44f3f9['as'],'attributes':_0x44f3f9[_0xbf72('0x1a')],'include':_0x44f3f9[_0xbf72('0x1c')]?_['map'](_0x44f3f9[_0xbf72('0x1c')],function(_0x392a8c){return{'model':db[_0x392a8c[_0xbf72('0x1e')]],'as':_0x392a8c['as'],'attributes':_0x392a8c['attributes'],'include':_0x392a8c[_0xbf72('0x1c')]?_[_0xbf72('0x1d')](_0x392a8c[_0xbf72('0x1c')],function(_0x1a2f55){return{'model':db[_0x1a2f55[_0xbf72('0x1e')]],'as':_0x1a2f55['as'],'attributes':_0x1a2f55[_0xbf72('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbf72('0x1f')](function(_0x25ecdf){logger[_0xbf72('0x12')](_0xbf72('0x14'),_0x27dadc);logger[_0xbf72('0x20')](_0xbf72('0x14'),_0x27dadc,JSON[_0xbf72('0xe')](_0x25ecdf));_0x51d4c9(_0x25ecdf);})[_0xbf72('0x21')](function(_0x37a233){logger['error'](_0xbf72('0x14'),_0x37a233[_0xbf72('0x11')],_0x27dadc);_0x1b8d73(_0x5b5fc9[_0xbf72('0xf')](0x1f4,_0x37a233[_0xbf72('0x11')]));});});}; \ No newline at end of file +var _0xfe65=['bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','limit','include','map','model','lodash','util','moment'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xfe65,0xb7));var _0x5fe6=function(_0x10df82,_0x3cabd0){_0x10df82=_0x10df82-0x0;var _0x3e74c0=_0xfe65[_0x10df82];return _0x3e74c0;};'use strict';var _=require(_0x5fe6('0x0'));var util=require(_0x5fe6('0x1'));var moment=require(_0x5fe6('0x2'));var BPromise=require(_0x5fe6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fe6('0x4'));var db=require(_0x5fe6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fe6('0x6'))('rpc');var config=require(_0x5fe6('0x7'));var jayson=require(_0x5fe6('0x8'));var client=jayson['client'][_0x5fe6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x119787,_0x5aa599,_0x5da930){return new BPromise(function(_0x59b228,_0x26c946){return client['request'](_0x119787,_0x5da930)[_0x5fe6('0xa')](function(_0x50504a){logger[_0x5fe6('0xb')](_0x5fe6('0xc'),_0x5aa599,'request\x20sent');logger[_0x5fe6('0xd')](_0x5fe6('0xe'),_0x5aa599,_0x5fe6('0xf'),JSON[_0x5fe6('0x10')](_0x50504a));if(_0x50504a[_0x5fe6('0x11')]){if(_0x50504a[_0x5fe6('0x11')]['code']===0x1f4){logger[_0x5fe6('0x11')]('MailServerIn,\x20%s,\x20%s',_0x5aa599,_0x50504a[_0x5fe6('0x11')][_0x5fe6('0x12')]);return _0x26c946(_0x50504a[_0x5fe6('0x11')][_0x5fe6('0x12')]);}logger[_0x5fe6('0x11')]('MailServerIn,\x20%s,\x20%s',_0x5aa599,_0x50504a['error'][_0x5fe6('0x12')]);return _0x59b228(_0x50504a[_0x5fe6('0x11')][_0x5fe6('0x12')]);}else{logger[_0x5fe6('0xb')](_0x5fe6('0xc'),_0x5aa599,'request\x20sent');_0x59b228(_0x50504a[_0x5fe6('0x13')][_0x5fe6('0x12')]);}})[_0x5fe6('0x14')](function(_0x2e225d){logger[_0x5fe6('0x11')](_0x5fe6('0xc'),_0x5aa599,_0x2e225d);_0x26c946(_0x2e225d);});});}exports[_0x5fe6('0x15')]=function(_0x3eb195){var _0x519f2f=this;return new Promise(function(_0x508501,_0x8ccf82){return db[_0x5fe6('0x16')]['findAll']({'raw':_0x3eb195['options']?_0x3eb195[_0x5fe6('0x17')][_0x5fe6('0x18')]===undefined?!![]:![]:!![],'where':_0x3eb195['options']?_0x3eb195[_0x5fe6('0x17')][_0x5fe6('0x19')]||null:null,'attributes':_0x3eb195[_0x5fe6('0x17')]?_0x3eb195[_0x5fe6('0x17')][_0x5fe6('0x1a')]||null:null,'limit':_0x3eb195[_0x5fe6('0x17')]?_0x3eb195[_0x5fe6('0x17')][_0x5fe6('0x1b')]||null:null,'include':_0x3eb195[_0x5fe6('0x17')]?_0x3eb195['options'][_0x5fe6('0x1c')]?_[_0x5fe6('0x1d')](_0x3eb195[_0x5fe6('0x17')]['include'],function(_0x2b7d8a){return{'model':db[_0x2b7d8a[_0x5fe6('0x1e')]],'as':_0x2b7d8a['as'],'attributes':_0x2b7d8a[_0x5fe6('0x1a')],'include':_0x2b7d8a[_0x5fe6('0x1c')]?_['map'](_0x2b7d8a[_0x5fe6('0x1c')],function(_0x19b5e0){return{'model':db[_0x19b5e0[_0x5fe6('0x1e')]],'as':_0x19b5e0['as'],'attributes':_0x19b5e0[_0x5fe6('0x1a')],'include':_0x19b5e0['include']?_[_0x5fe6('0x1d')](_0x19b5e0[_0x5fe6('0x1c')],function(_0x536193){return{'model':db[_0x536193['model']],'as':_0x536193['as'],'attributes':_0x536193[_0x5fe6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5fe6('0xa')](function(_0x37dea1){logger[_0x5fe6('0xb')]('GetMailServerIn',_0x3eb195);logger[_0x5fe6('0xd')](_0x5fe6('0x15'),_0x3eb195,JSON[_0x5fe6('0x10')](_0x37dea1));_0x508501(_0x37dea1);})[_0x5fe6('0x14')](function(_0x222df8){logger[_0x5fe6('0x11')]('GetMailServerIn',_0x222df8[_0x5fe6('0x12')],_0x3eb195);_0x8ccf82(_0x519f2f['error'](0x1f4,_0x222df8[_0x5fe6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 48322f0..c53803c 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x157138,_0x37073d){_0x157138=_0x157138-0x0;var _0x3dbef9=_0x7a54[_0x157138];return _0x3dbef9;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 6408476..eed80de 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 _0x282b=['sequelize','exports','STRING','BOOLEAN'];(function(_0x49e8ea,_0x161f50){var _0x1601e6=function(_0x894444){while(--_0x894444){_0x49e8ea['push'](_0x49e8ea['shift']());}};_0x1601e6(++_0x161f50);}(_0x282b,0xec));var _0xb282=function(_0x21c8d5,_0x16ed7f){_0x21c8d5=_0x21c8d5-0x0;var _0x406421=_0x282b[_0x21c8d5];return _0x406421;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'description':{'type':Sequelize[_0xb282('0x2')]},'host':{'type':Sequelize[_0xb282('0x2')]},'user':{'type':Sequelize[_0xb282('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xb282('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xb282('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xb282('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1d2d=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x14d527,_0x58ede0){var _0x194a18=function(_0x1bf025){while(--_0x1bf025){_0x14d527['push'](_0x14d527['shift']());}};_0x194a18(++_0x58ede0);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x4ed407,_0x7e9190){_0x4ed407=_0x4ed407-0x0;var _0x41550a=_0x1d2d[_0x4ed407];return _0x41550a;};'use strict';var Sequelize=require(_0xd1d2('0x0'));module[_0xd1d2('0x1')]={'description':{'type':Sequelize[_0xd1d2('0x2')]},'host':{'type':Sequelize[_0xd1d2('0x2')]},'user':{'type':Sequelize[_0xd1d2('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd1d2('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xd1d2('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xd1d2('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index b500631..85b2728 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 _0x6896=['show','params','keys','rawAttributes','intersection','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','MailServerOut','fieldName','query','filters','attributes','model','fields','length','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0x6896,0x12c));var _0x6689=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6896[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6689('0x0'));var zipdir=require(_0x6689('0x1'));var jsonpatch=require(_0x6689('0x2'));var rp=require(_0x6689('0x3'));var moment=require(_0x6689('0x4'));var BPromise=require(_0x6689('0x5'));var Mustache=require(_0x6689('0x6'));var util=require(_0x6689('0x7'));var path=require(_0x6689('0x8'));var sox=require('sox');var csv=require(_0x6689('0x9'));var ejs=require(_0x6689('0xa'));var fs=require('fs');var fs_extra=require(_0x6689('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6689('0xc'));var jsforce=require(_0x6689('0xd'));var deskjs=require(_0x6689('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6689('0xf'));var Papa=require(_0x6689('0x10'));var Redis=require(_0x6689('0x11'));var authService=require(_0x6689('0x12'));var qs=require(_0x6689('0x13'));var as=require(_0x6689('0x14'));var hardwareService=require(_0x6689('0x15'));var logger=require(_0x6689('0x16'))(_0x6689('0x17'));var utils=require(_0x6689('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6689('0x19'))['db'];function respondWithStatusCode(_0x578ce5,_0x191ca2){_0x191ca2=_0x191ca2||0xcc;return function(_0x1ac983){if(_0x1ac983){return _0x578ce5[_0x6689('0x1a')](_0x191ca2);}return _0x578ce5[_0x6689('0x1b')](_0x191ca2)[_0x6689('0x1c')]();};}function respondWithResult(_0x591978,_0x3c6ef5){_0x3c6ef5=_0x3c6ef5||0xc8;return function(_0x5464cf){if(_0x5464cf){return _0x591978[_0x6689('0x1b')](_0x3c6ef5)[_0x6689('0x1d')](_0x5464cf);}};}function respondWithFilteredResult(_0x5f2202,_0x5e2772){return function(_0x1e49ee){if(_0x1e49ee){var _0x360fcd=typeof _0x5e2772['offset']===_0x6689('0x1e')&&typeof _0x5e2772[_0x6689('0x1f')]===_0x6689('0x1e');var _0x21c4f6=_0x1e49ee[_0x6689('0x20')];var _0x3975c8=_0x360fcd?0x0:_0x5e2772[_0x6689('0x21')];var _0x325e61=_0x360fcd?_0x1e49ee[_0x6689('0x20')]:_0x5e2772[_0x6689('0x21')]+_0x5e2772[_0x6689('0x1f')];var _0x3d0b0c;if(_0x325e61>=_0x21c4f6){_0x325e61=_0x21c4f6;_0x3d0b0c=0xc8;}else{_0x3d0b0c=0xce;}_0x5f2202[_0x6689('0x1b')](_0x3d0b0c);return _0x5f2202[_0x6689('0x22')](_0x6689('0x23'),_0x3975c8+'-'+_0x325e61+'/'+_0x21c4f6)['json'](_0x1e49ee);}return null;};}function patchUpdates(_0x42fc18){return function(_0x4e0e94){try{jsonpatch[_0x6689('0x24')](_0x4e0e94,_0x42fc18,!![]);}catch(_0x13781f){return BPromise[_0x6689('0x25')](_0x13781f);}return _0x4e0e94['save']();};}function saveUpdates(_0x5cfcf2,_0x15c49a){return function(_0x388d31){if(_0x388d31){return _0x388d31[_0x6689('0x26')](_0x5cfcf2)[_0x6689('0x27')](function(_0x4896fd){return _0x4896fd;});}return null;};}function removeEntity(_0x531d2b,_0x468937){return function(_0x392fc2){if(_0x392fc2){return _0x392fc2[_0x6689('0x28')]()[_0x6689('0x27')](function(){_0x531d2b[_0x6689('0x1b')](0xcc)[_0x6689('0x1c')]();});}};}function handleEntityNotFound(_0x95eb4,_0x311b0e){return function(_0x114045){if(!_0x114045){_0x95eb4[_0x6689('0x1a')](0x194);}return _0x114045;};}function handleError(_0x128ec2,_0xb4edbf){_0xb4edbf=_0xb4edbf||0x1f4;return function(_0xaffca1){logger['error'](_0xaffca1[_0x6689('0x29')]);if(_0xaffca1[_0x6689('0x2a')]){delete _0xaffca1[_0x6689('0x2a')];}_0x128ec2[_0x6689('0x1b')](_0xb4edbf)[_0x6689('0x2b')](_0xaffca1);};}exports[_0x6689('0x2c')]=function(_0x2b929d,_0x477c6e){var _0xe10149={},_0x48533c={},_0x2e65b5={'count':0x0,'rows':[]};var _0x1d53aa=_[_0x6689('0x2d')](db[_0x6689('0x2e')]['rawAttributes'],function(_0x165670){return{'name':_0x165670[_0x6689('0x2f')],'type':_0x165670['type']['key']};});_0x48533c['model']=_[_0x6689('0x2d')](_0x1d53aa,'name');_0x48533c[_0x6689('0x30')]=_['keys'](_0x2b929d[_0x6689('0x30')]);_0x48533c[_0x6689('0x31')]=_['intersection'](_0x48533c['model'],_0x48533c[_0x6689('0x30')]);_0xe10149[_0x6689('0x32')]=_['intersection'](_0x48533c[_0x6689('0x33')],qs[_0x6689('0x34')](_0x2b929d[_0x6689('0x30')][_0x6689('0x34')]));_0xe10149[_0x6689('0x32')]=_0xe10149['attributes'][_0x6689('0x35')]?_0xe10149['attributes']:_0x48533c[_0x6689('0x33')];if(!_0x2b929d['query']['hasOwnProperty'](_0x6689('0x36'))){_0xe10149[_0x6689('0x1f')]=qs['limit'](_0x2b929d[_0x6689('0x30')][_0x6689('0x1f')]);_0xe10149[_0x6689('0x21')]=qs[_0x6689('0x21')](_0x2b929d[_0x6689('0x30')][_0x6689('0x21')]);}_0xe10149['order']=qs[_0x6689('0x37')](_0x2b929d[_0x6689('0x30')][_0x6689('0x37')]);_0xe10149['where']=qs['filters'](_[_0x6689('0x38')](_0x2b929d[_0x6689('0x30')],_0x48533c[_0x6689('0x31')]),_0x1d53aa);if(_0x2b929d[_0x6689('0x30')][_0x6689('0x39')]){_0xe10149[_0x6689('0x3a')]=_[_0x6689('0x3b')](_0xe10149[_0x6689('0x3a')],{'$or':_['map'](_0x1d53aa,function(_0x1600b6){if(_0x1600b6['type']!=='VIRTUAL'){var _0x5b4d4d={};_0x5b4d4d[_0x1600b6['name']]={'$like':'%'+_0x2b929d[_0x6689('0x30')][_0x6689('0x39')]+'%'};return _0x5b4d4d;}})});}_0xe10149=_[_0x6689('0x3b')]({},_0xe10149,_0x2b929d[_0x6689('0x3c')]);var _0x385293={'where':_0xe10149[_0x6689('0x3a')]};return db[_0x6689('0x2e')][_0x6689('0x20')](_0x385293)[_0x6689('0x27')](function(_0x221b02){_0x2e65b5[_0x6689('0x20')]=_0x221b02;if(_0x2b929d[_0x6689('0x30')][_0x6689('0x3d')]){_0xe10149[_0x6689('0x3e')]=[{'all':!![]}];}return db['MailServerOut'][_0x6689('0x3f')](_0xe10149);})['then'](function(_0x42d7de){_0x2e65b5['rows']=_0x42d7de;return _0x2e65b5;})[_0x6689('0x27')](respondWithFilteredResult(_0x477c6e,_0xe10149))[_0x6689('0x40')](handleError(_0x477c6e,null));};exports[_0x6689('0x41')]=function(_0x3b4cf1,_0x4787e3){var _0x5347bc={'raw':!![],'where':{'id':_0x3b4cf1[_0x6689('0x42')]['id']}},_0x515fd9={};_0x515fd9[_0x6689('0x33')]=_[_0x6689('0x43')](db[_0x6689('0x2e')][_0x6689('0x44')]);_0x515fd9[_0x6689('0x30')]=_[_0x6689('0x43')](_0x3b4cf1[_0x6689('0x30')]);_0x515fd9[_0x6689('0x31')]=_[_0x6689('0x45')](_0x515fd9[_0x6689('0x33')],_0x515fd9[_0x6689('0x30')]);_0x5347bc[_0x6689('0x32')]=_[_0x6689('0x45')](_0x515fd9[_0x6689('0x33')],qs['fields'](_0x3b4cf1[_0x6689('0x30')][_0x6689('0x34')]));_0x5347bc[_0x6689('0x32')]=_0x5347bc[_0x6689('0x32')][_0x6689('0x35')]?_0x5347bc[_0x6689('0x32')]:_0x515fd9[_0x6689('0x33')];if(_0x3b4cf1['query']['includeAll']){_0x5347bc[_0x6689('0x3e')]=[{'all':!![]}];}_0x5347bc=_[_0x6689('0x3b')]({},_0x5347bc,_0x3b4cf1['options']);return db[_0x6689('0x2e')]['find'](_0x5347bc)[_0x6689('0x27')](handleEntityNotFound(_0x4787e3,null))[_0x6689('0x27')](respondWithResult(_0x4787e3,null))['catch'](handleError(_0x4787e3,null));};exports[_0x6689('0x46')]=function(_0x593def,_0x5407cc){return db[_0x6689('0x2e')]['create'](_0x593def[_0x6689('0x47')],{})[_0x6689('0x27')](respondWithResult(_0x5407cc,0xc9))[_0x6689('0x40')](handleError(_0x5407cc,null));};exports[_0x6689('0x26')]=function(_0x298a04,_0x16c29c){if(_0x298a04[_0x6689('0x47')]['id']){delete _0x298a04[_0x6689('0x47')]['id'];}return db[_0x6689('0x2e')][_0x6689('0x48')]({'where':{'id':_0x298a04[_0x6689('0x42')]['id']}})['then'](handleEntityNotFound(_0x16c29c,null))[_0x6689('0x27')](saveUpdates(_0x298a04[_0x6689('0x47')],null))[_0x6689('0x27')](respondWithResult(_0x16c29c,null))[_0x6689('0x40')](handleError(_0x16c29c,null));};exports[_0x6689('0x28')]=function(_0x5f4d00,_0x5e3455){return db[_0x6689('0x2e')]['find']({'where':{'id':_0x5f4d00[_0x6689('0x42')]['id']}})[_0x6689('0x27')](handleEntityNotFound(_0x5e3455,null))[_0x6689('0x27')](removeEntity(_0x5e3455,null))[_0x6689('0x40')](handleError(_0x5e3455,null));}; \ No newline at end of file +var _0x83d0=['fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','MailServerOut','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','find','create','body','eml-format','rimraf'];(function(_0x376d33,_0x1ccb15){var _0x360869=function(_0x43980a){while(--_0x43980a){_0x376d33['push'](_0x376d33['shift']());}};_0x360869(++_0x1ccb15);}(_0x83d0,0x166));var _0x083d=function(_0x87f56b,_0x65d47c){_0x87f56b=_0x87f56b-0x0;var _0x51101d=_0x83d0[_0x87f56b];return _0x51101d;};'use strict';var emlformat=require(_0x083d('0x0'));var rimraf=require(_0x083d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x083d('0x2'));var rp=require(_0x083d('0x3'));var moment=require(_0x083d('0x4'));var BPromise=require(_0x083d('0x5'));var Mustache=require('mustache');var util=require(_0x083d('0x6'));var path=require(_0x083d('0x7'));var sox=require(_0x083d('0x8'));var csv=require(_0x083d('0x9'));var ejs=require(_0x083d('0xa'));var fs=require('fs');var fs_extra=require(_0x083d('0xb'));var _=require(_0x083d('0xc'));var squel=require(_0x083d('0xd'));var crypto=require(_0x083d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x083d('0xf'));var toCsv=require(_0x083d('0x9'));var querystring=require(_0x083d('0x10'));var Papa=require('papaparse');var Redis=require(_0x083d('0x11'));var authService=require(_0x083d('0x12'));var qs=require(_0x083d('0x13'));var as=require(_0x083d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x083d('0x15'));var utils=require('../../config/utils');var config=require(_0x083d('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49b50b,_0x4ecf63){_0x4ecf63=_0x4ecf63||0xcc;return function(_0x273a0c){if(_0x273a0c){return _0x49b50b[_0x083d('0x17')](_0x4ecf63);}return _0x49b50b[_0x083d('0x18')](_0x4ecf63)['end']();};}function respondWithResult(_0x4d5816,_0x2eb5ef){_0x2eb5ef=_0x2eb5ef||0xc8;return function(_0x45706f){if(_0x45706f){return _0x4d5816[_0x083d('0x18')](_0x2eb5ef)[_0x083d('0x19')](_0x45706f);}};}function respondWithFilteredResult(_0x57f126,_0x34723a){return function(_0x35c5be){if(_0x35c5be){var _0x39b2ab=typeof _0x34723a['offset']===_0x083d('0x1a')&&typeof _0x34723a[_0x083d('0x1b')]===_0x083d('0x1a');var _0xc152c0=_0x35c5be[_0x083d('0x1c')];var _0x368468=_0x39b2ab?0x0:_0x34723a[_0x083d('0x1d')];var _0x368c52=_0x39b2ab?_0x35c5be[_0x083d('0x1c')]:_0x34723a[_0x083d('0x1d')]+_0x34723a['limit'];var _0x499d4a;if(_0x368c52>=_0xc152c0){_0x368c52=_0xc152c0;_0x499d4a=0xc8;}else{_0x499d4a=0xce;}_0x57f126[_0x083d('0x18')](_0x499d4a);return _0x57f126[_0x083d('0x1e')](_0x083d('0x1f'),_0x368468+'-'+_0x368c52+'/'+_0xc152c0)[_0x083d('0x19')](_0x35c5be);}return null;};}function patchUpdates(_0x17755e){return function(_0x12ef0a){try{jsonpatch['apply'](_0x12ef0a,_0x17755e,!![]);}catch(_0x4ce360){return BPromise[_0x083d('0x20')](_0x4ce360);}return _0x12ef0a[_0x083d('0x21')]();};}function saveUpdates(_0x325def,_0x5c566c){return function(_0x12a71c){if(_0x12a71c){return _0x12a71c[_0x083d('0x22')](_0x325def)[_0x083d('0x23')](function(_0x133a93){return _0x133a93;});}return null;};}function removeEntity(_0x3b5bde,_0xbdc769){return function(_0x1a0185){if(_0x1a0185){return _0x1a0185[_0x083d('0x24')]()[_0x083d('0x23')](function(){_0x3b5bde['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5eb69d,_0x4fb48a){return function(_0x4fe3d1){if(!_0x4fe3d1){_0x5eb69d[_0x083d('0x17')](0x194);}return _0x4fe3d1;};}function handleError(_0x335cc9,_0x499b81){_0x499b81=_0x499b81||0x1f4;return function(_0x3724ee){logger['error'](_0x3724ee[_0x083d('0x25')]);if(_0x3724ee[_0x083d('0x26')]){delete _0x3724ee[_0x083d('0x26')];}_0x335cc9[_0x083d('0x18')](_0x499b81)[_0x083d('0x27')](_0x3724ee);};}exports[_0x083d('0x28')]=function(_0x1ce2d7,_0x3302cd){var _0x21813a={},_0x30b1a2={},_0x413b24={'count':0x0,'rows':[]};var _0x48ae82=_['map'](db[_0x083d('0x29')][_0x083d('0x2a')],function(_0x3c49dd){return{'name':_0x3c49dd['fieldName'],'type':_0x3c49dd[_0x083d('0x2b')][_0x083d('0x2c')]};});_0x30b1a2[_0x083d('0x2d')]=_[_0x083d('0x2e')](_0x48ae82,_0x083d('0x26'));_0x30b1a2[_0x083d('0x2f')]=_['keys'](_0x1ce2d7['query']);_0x30b1a2[_0x083d('0x30')]=_[_0x083d('0x31')](_0x30b1a2[_0x083d('0x2d')],_0x30b1a2[_0x083d('0x2f')]);_0x21813a[_0x083d('0x32')]=_[_0x083d('0x31')](_0x30b1a2[_0x083d('0x2d')],qs[_0x083d('0x33')](_0x1ce2d7[_0x083d('0x2f')][_0x083d('0x33')]));_0x21813a[_0x083d('0x32')]=_0x21813a['attributes']['length']?_0x21813a[_0x083d('0x32')]:_0x30b1a2[_0x083d('0x2d')];if(!_0x1ce2d7['query'][_0x083d('0x34')](_0x083d('0x35'))){_0x21813a[_0x083d('0x1b')]=qs['limit'](_0x1ce2d7[_0x083d('0x2f')][_0x083d('0x1b')]);_0x21813a[_0x083d('0x1d')]=qs[_0x083d('0x1d')](_0x1ce2d7[_0x083d('0x2f')][_0x083d('0x1d')]);}_0x21813a[_0x083d('0x36')]=qs['sort'](_0x1ce2d7[_0x083d('0x2f')][_0x083d('0x37')]);_0x21813a['where']=qs[_0x083d('0x30')](_[_0x083d('0x38')](_0x1ce2d7['query'],_0x30b1a2[_0x083d('0x30')]),_0x48ae82);if(_0x1ce2d7[_0x083d('0x2f')]['filter']){_0x21813a['where']=_[_0x083d('0x39')](_0x21813a[_0x083d('0x3a')],{'$or':_[_0x083d('0x2e')](_0x48ae82,function(_0x28cdbd){if(_0x28cdbd[_0x083d('0x2b')]!==_0x083d('0x3b')){var _0x3580d5={};_0x3580d5[_0x28cdbd['name']]={'$like':'%'+_0x1ce2d7[_0x083d('0x2f')][_0x083d('0x3c')]+'%'};return _0x3580d5;}})});}_0x21813a=_[_0x083d('0x39')]({},_0x21813a,_0x1ce2d7[_0x083d('0x3d')]);var _0x3343e7={'where':_0x21813a[_0x083d('0x3a')]};return db['MailServerOut'][_0x083d('0x1c')](_0x3343e7)[_0x083d('0x23')](function(_0x2d4414){_0x413b24[_0x083d('0x1c')]=_0x2d4414;if(_0x1ce2d7[_0x083d('0x2f')][_0x083d('0x3e')]){_0x21813a[_0x083d('0x3f')]=[{'all':!![]}];}return db[_0x083d('0x29')]['findAll'](_0x21813a);})[_0x083d('0x23')](function(_0x336c35){_0x413b24[_0x083d('0x40')]=_0x336c35;return _0x413b24;})[_0x083d('0x23')](respondWithFilteredResult(_0x3302cd,_0x21813a))[_0x083d('0x41')](handleError(_0x3302cd,null));};exports[_0x083d('0x42')]=function(_0x291812,_0x71f083){var _0x3c8f0={'raw':!![],'where':{'id':_0x291812[_0x083d('0x43')]['id']}},_0x5a1d80={};_0x5a1d80[_0x083d('0x2d')]=_[_0x083d('0x44')](db[_0x083d('0x29')]['rawAttributes']);_0x5a1d80[_0x083d('0x2f')]=_[_0x083d('0x44')](_0x291812[_0x083d('0x2f')]);_0x5a1d80[_0x083d('0x30')]=_[_0x083d('0x31')](_0x5a1d80[_0x083d('0x2d')],_0x5a1d80[_0x083d('0x2f')]);_0x3c8f0[_0x083d('0x32')]=_[_0x083d('0x31')](_0x5a1d80['model'],qs[_0x083d('0x33')](_0x291812[_0x083d('0x2f')][_0x083d('0x33')]));_0x3c8f0['attributes']=_0x3c8f0[_0x083d('0x32')]['length']?_0x3c8f0[_0x083d('0x32')]:_0x5a1d80[_0x083d('0x2d')];if(_0x291812[_0x083d('0x2f')]['includeAll']){_0x3c8f0['include']=[{'all':!![]}];}_0x3c8f0=_['merge']({},_0x3c8f0,_0x291812[_0x083d('0x3d')]);return db[_0x083d('0x29')][_0x083d('0x45')](_0x3c8f0)[_0x083d('0x23')](handleEntityNotFound(_0x71f083,null))[_0x083d('0x23')](respondWithResult(_0x71f083,null))['catch'](handleError(_0x71f083,null));};exports[_0x083d('0x46')]=function(_0x7b4bcf,_0x12b597){return db[_0x083d('0x29')][_0x083d('0x46')](_0x7b4bcf[_0x083d('0x47')],{})[_0x083d('0x23')](respondWithResult(_0x12b597,0xc9))[_0x083d('0x41')](handleError(_0x12b597,null));};exports[_0x083d('0x22')]=function(_0xa39cdb,_0x407b27){if(_0xa39cdb[_0x083d('0x47')]['id']){delete _0xa39cdb['body']['id'];}return db[_0x083d('0x29')][_0x083d('0x45')]({'where':{'id':_0xa39cdb[_0x083d('0x43')]['id']}})[_0x083d('0x23')](handleEntityNotFound(_0x407b27,null))[_0x083d('0x23')](saveUpdates(_0xa39cdb[_0x083d('0x47')],null))['then'](respondWithResult(_0x407b27,null))['catch'](handleError(_0x407b27,null));};exports[_0x083d('0x24')]=function(_0xc28480,_0x67755d){return db['MailServerOut'][_0x083d('0x45')]({'where':{'id':_0xc28480[_0x083d('0x43')]['id']}})['then'](handleEntityNotFound(_0x67755d,null))[_0x083d('0x23')](removeEntity(_0x67755d,null))[_0x083d('0x41')](handleError(_0x67755d,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 7080d2a..6d90f36 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 _0x89dd=['../../config/environment','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment'];(function(_0x1a8aed,_0x5a5a76){var _0x2d3f1e=function(_0x48dcda){while(--_0x48dcda){_0x1a8aed['push'](_0x1a8aed['shift']());}};_0x2d3f1e(++_0x5a5a76);}(_0x89dd,0x69));var _0xd89d=function(_0x31fa27,_0x44189c){_0x31fa27=_0x31fa27-0x0;var _0x189c87=_0x89dd[_0x31fa27];return _0x189c87;};'use strict';var _=require(_0xd89d('0x0'));var util=require(_0xd89d('0x1'));var logger=require(_0xd89d('0x2'))(_0xd89d('0x3'));var moment=require(_0xd89d('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(_0xd89d('0x5'));var attributes=require(_0xd89d('0x6'));module[_0xd89d('0x7')]=function(_0x542103,_0x3ed745){return _0x542103['define'](_0xd89d('0x8'),attributes,{'tableName':_0xd89d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ca0=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','MailServerOut','mail_servers_out'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8ca0,0x16c));var _0x08ca=function(_0x64bd6a,_0x498aba){_0x64bd6a=_0x64bd6a-0x0;var _0x1b55b4=_0x8ca0[_0x64bd6a];return _0x1b55b4;};'use strict';var _=require(_0x08ca('0x0'));var util=require(_0x08ca('0x1'));var logger=require(_0x08ca('0x2'))(_0x08ca('0x3'));var moment=require(_0x08ca('0x4'));var BPromise=require(_0x08ca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x08ca('0x6'));var rimraf=require(_0x08ca('0x7'));var config=require(_0x08ca('0x8'));var attributes=require('./mailServerOut.attributes');module[_0x08ca('0x9')]=function(_0x503752,_0x3e83cd){return _0x503752[_0x08ca('0xa')](_0x08ca('0xb'),attributes,{'tableName':_0x08ca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index ad8d481..823a0f5 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 _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0xa15ff1,_0x48f63d){_0xa15ff1=_0xa15ff1-0x0;var _0x33d8b2=_0x7a54[_0xa15ff1];return _0x33d8b2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x4259ab,_0xb5a6e9){var _0x37cffc=function(_0xe0d9f9){while(--_0xe0d9f9){_0x4259ab['push'](_0x4259ab['shift']());}};_0x37cffc(++_0xb5a6e9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 7153a1c..55afd66 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 _0x150d=['/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x4fd6bb,_0x55886c){var _0x149758=function(_0x1c6f41){while(--_0x1c6f41){_0x4fd6bb['push'](_0x4fd6bb['shift']());}};_0x149758(++_0x55886c);}(_0x150d,0x190));var _0xd150=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0x150d[_0x3fa7d3];return _0x4c51bd;};'use strict';var multer=require('multer');var util=require(_0xd150('0x0'));var path=require(_0xd150('0x1'));var timeout=require(_0xd150('0x2'));var express=require(_0xd150('0x3'));var router=express[_0xd150('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd150('0x5'));var interaction=require(_0xd150('0x6'));var config=require(_0xd150('0x7'));var controller=require(_0xd150('0x8'));router[_0xd150('0x9')]('/',auth['isAuthenticated'](),controller[_0xd150('0xa')]);router[_0xd150('0x9')](_0xd150('0xb'),auth[_0xd150('0xc')](),controller[_0xd150('0xd')]);router[_0xd150('0x9')](_0xd150('0xe'),auth['isAuthenticated'](),controller[_0xd150('0xf')]);router[_0xd150('0x10')]('/',auth[_0xd150('0xc')](),controller[_0xd150('0x11')]);router[_0xd150('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd150('0x13')]);router[_0xd150('0x14')](_0xd150('0xe'),auth[_0xd150('0xc')](),controller[_0xd150('0x15')]);module[_0xd150('0x16')]=router; \ No newline at end of file +var _0xcba0=['post','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x3d6ddf,_0x81e1db){var _0x4b76a7=function(_0x4b0481){while(--_0x4b0481){_0x3d6ddf['push'](_0x3d6ddf['shift']());}};_0x4b76a7(++_0x81e1db);}(_0xcba0,0x1e1));var _0x0cba=function(_0x29eb02,_0x18b4e0){_0x29eb02=_0x29eb02-0x0;var _0x3a09c2=_0xcba0[_0x29eb02];return _0x3a09c2;};'use strict';var multer=require(_0x0cba('0x0'));var util=require('util');var path=require(_0x0cba('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0cba('0x2')]();var fs_extra=require(_0x0cba('0x3'));var auth=require(_0x0cba('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0cba('0x5'));var controller=require(_0x0cba('0x6'));router[_0x0cba('0x7')]('/',auth[_0x0cba('0x8')](),controller[_0x0cba('0x9')]);router[_0x0cba('0x7')](_0x0cba('0xa'),auth[_0x0cba('0x8')](),controller['describe']);router['get'](_0x0cba('0xb'),auth[_0x0cba('0x8')](),controller[_0x0cba('0xc')]);router[_0x0cba('0xd')]('/',auth[_0x0cba('0x8')](),controller['create']);router[_0x0cba('0xe')](_0x0cba('0xb'),auth[_0x0cba('0x8')](),controller[_0x0cba('0xf')]);router[_0x0cba('0x10')](_0x0cba('0xb'),auth[_0x0cba('0x8')](),controller[_0x0cba('0x11')]);module[_0x0cba('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 382679b..bef02f1 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 _0x3c94=['name','sequelize','exports','STRING'];(function(_0x2ebdf5,_0x3a1b0b){var _0x5c0115=function(_0x29f6c8){while(--_0x29f6c8){_0x2ebdf5['push'](_0x2ebdf5['shift']());}};_0x5c0115(++_0x3a1b0b);}(_0x3c94,0xcd));var _0x43c9=function(_0x5079f0,_0x2e0ae4){_0x5079f0=_0x5079f0-0x0;var _0x182bce=_0x3c94[_0x5079f0];return _0x182bce;};'use strict';var Sequelize=require(_0x43c9('0x0'));module[_0x43c9('0x1')]={'name':{'type':Sequelize[_0x43c9('0x2')],'unique':_0x43c9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x43c9('0x2')]}}; \ No newline at end of file +var _0x8375=['sequelize','exports','STRING'];(function(_0x1ae192,_0x865542){var _0x464557=function(_0x48bf7c){while(--_0x48bf7c){_0x1ae192['push'](_0x1ae192['shift']());}};_0x464557(++_0x865542);}(_0x8375,0xa8));var _0x5837=function(_0x68c4b,_0x10f631){_0x68c4b=_0x68c4b-0x0;var _0x520b2c=_0x8375[_0x68c4b];return _0x520b2c;};'use strict';var Sequelize=require(_0x5837('0x0'));module[_0x5837('0x1')]={'name':{'type':Sequelize[_0x5837('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5837('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 3e914d4..15ce467 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 _0x3a69=['moment','bluebird','util','sox','to-csv','ejs','fs-extra','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','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','MailSubstatus','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','offset','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x430de2,_0x1e47f5){var _0x2d9072=function(_0x243403){while(--_0x243403){_0x430de2['push'](_0x430de2['shift']());}};_0x2d9072(++_0x1e47f5);}(_0x3a69,0x9b));var _0x93a6=function(_0x431532,_0x55c467){_0x431532=_0x431532-0x0;var _0x50a52d=_0x3a69[_0x431532];return _0x50a52d;};'use strict';var emlformat=require(_0x93a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x93a6('0x1'));var jsonpatch=require(_0x93a6('0x2'));var rp=require('request-promise');var moment=require(_0x93a6('0x3'));var BPromise=require(_0x93a6('0x4'));var Mustache=require('mustache');var util=require(_0x93a6('0x5'));var path=require('path');var sox=require(_0x93a6('0x6'));var csv=require(_0x93a6('0x7'));var ejs=require(_0x93a6('0x8'));var fs=require('fs');var fs_extra=require(_0x93a6('0x9'));var _=require(_0x93a6('0xa'));var squel=require('squel');var crypto=require(_0x93a6('0xb'));var jsforce=require(_0x93a6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x93a6('0x7'));var querystring=require(_0x93a6('0xd'));var Papa=require(_0x93a6('0xe'));var Redis=require(_0x93a6('0xf'));var authService=require(_0x93a6('0x10'));var qs=require(_0x93a6('0x11'));var as=require(_0x93a6('0x12'));var hardwareService=require(_0x93a6('0x13'));var logger=require(_0x93a6('0x14'))(_0x93a6('0x15'));var utils=require(_0x93a6('0x16'));var config=require(_0x93a6('0x17'));var licenseUtil=require(_0x93a6('0x18'));var db=require(_0x93a6('0x19'))['db'];function respondWithStatusCode(_0x4f2722,_0x451942){_0x451942=_0x451942||0xcc;return function(_0x295ff3){if(_0x295ff3){return _0x4f2722[_0x93a6('0x1a')](_0x451942);}return _0x4f2722['status'](_0x451942)[_0x93a6('0x1b')]();};}function respondWithResult(_0x578ccb,_0xb43dc0){_0xb43dc0=_0xb43dc0||0xc8;return function(_0x3da276){if(_0x3da276){return _0x578ccb[_0x93a6('0x1c')](_0xb43dc0)[_0x93a6('0x1d')](_0x3da276);}};}function respondWithFilteredResult(_0x2f89d9,_0xc9dd82){return function(_0x565aed){if(_0x565aed){var _0x26d8d8=typeof _0xc9dd82['offset']===_0x93a6('0x1e')&&typeof _0xc9dd82[_0x93a6('0x1f')]===_0x93a6('0x1e');var _0x5c6104=_0x565aed[_0x93a6('0x20')];var _0x35bb64=_0x26d8d8?0x0:_0xc9dd82['offset'];var _0x2aacd0=_0x26d8d8?_0x565aed['count']:_0xc9dd82['offset']+_0xc9dd82[_0x93a6('0x1f')];var _0x372fe6;if(_0x2aacd0>=_0x5c6104){_0x2aacd0=_0x5c6104;_0x372fe6=0xc8;}else{_0x372fe6=0xce;}_0x2f89d9['status'](_0x372fe6);return _0x2f89d9[_0x93a6('0x21')](_0x93a6('0x22'),_0x35bb64+'-'+_0x2aacd0+'/'+_0x5c6104)[_0x93a6('0x1d')](_0x565aed);}return null;};}function patchUpdates(_0x2a6a9c){return function(_0x113bdd){try{jsonpatch[_0x93a6('0x23')](_0x113bdd,_0x2a6a9c,!![]);}catch(_0x3a8acf){return BPromise[_0x93a6('0x24')](_0x3a8acf);}return _0x113bdd[_0x93a6('0x25')]();};}function saveUpdates(_0x31eabe,_0x4c46e1){return function(_0x1ff45a){if(_0x1ff45a){return _0x1ff45a[_0x93a6('0x26')](_0x31eabe)[_0x93a6('0x27')](function(_0x4e5890){return _0x4e5890;});}return null;};}function removeEntity(_0x388ab0,_0x451244){return function(_0x21ee05){if(_0x21ee05){return _0x21ee05[_0x93a6('0x28')]()['then'](function(){_0x388ab0[_0x93a6('0x1c')](0xcc)[_0x93a6('0x1b')]();});}};}function handleEntityNotFound(_0x4a8d69,_0x4e158f){return function(_0x49fe75){if(!_0x49fe75){_0x4a8d69[_0x93a6('0x1a')](0x194);}return _0x49fe75;};}function handleError(_0xc823ad,_0x5391a6){_0x5391a6=_0x5391a6||0x1f4;return function(_0x395c1a){logger[_0x93a6('0x29')](_0x395c1a['stack']);if(_0x395c1a[_0x93a6('0x2a')]){delete _0x395c1a[_0x93a6('0x2a')];}_0xc823ad['status'](_0x5391a6)[_0x93a6('0x2b')](_0x395c1a);};}exports[_0x93a6('0x2c')]=function(_0x2eadde,_0x3593f2){var _0x49cb71={},_0x4e60cc={},_0x594447={'count':0x0,'rows':[]};var _0x49bb3f=_[_0x93a6('0x2d')](db[_0x93a6('0x2e')][_0x93a6('0x2f')],function(_0x32ea50){return{'name':_0x32ea50['fieldName'],'type':_0x32ea50[_0x93a6('0x30')][_0x93a6('0x31')]};});_0x4e60cc[_0x93a6('0x32')]=_[_0x93a6('0x2d')](_0x49bb3f,_0x93a6('0x2a'));_0x4e60cc['query']=_[_0x93a6('0x33')](_0x2eadde[_0x93a6('0x34')]);_0x4e60cc['filters']=_[_0x93a6('0x35')](_0x4e60cc[_0x93a6('0x32')],_0x4e60cc[_0x93a6('0x34')]);_0x49cb71['attributes']=_[_0x93a6('0x35')](_0x4e60cc[_0x93a6('0x32')],qs[_0x93a6('0x36')](_0x2eadde['query']['fields']));_0x49cb71['attributes']=_0x49cb71[_0x93a6('0x37')][_0x93a6('0x38')]?_0x49cb71['attributes']:_0x4e60cc[_0x93a6('0x32')];if(!_0x2eadde[_0x93a6('0x34')]['hasOwnProperty'](_0x93a6('0x39'))){_0x49cb71[_0x93a6('0x1f')]=qs[_0x93a6('0x1f')](_0x2eadde['query']['limit']);_0x49cb71['offset']=qs[_0x93a6('0x3a')](_0x2eadde[_0x93a6('0x34')][_0x93a6('0x3a')]);}_0x49cb71[_0x93a6('0x3b')]=qs[_0x93a6('0x3c')](_0x2eadde[_0x93a6('0x34')][_0x93a6('0x3c')]);_0x49cb71[_0x93a6('0x3d')]=qs[_0x93a6('0x3e')](_[_0x93a6('0x3f')](_0x2eadde['query'],_0x4e60cc[_0x93a6('0x3e')]),_0x49bb3f);if(_0x2eadde[_0x93a6('0x34')]['filter']){_0x49cb71[_0x93a6('0x3d')]=_['merge'](_0x49cb71[_0x93a6('0x3d')],{'$or':_[_0x93a6('0x2d')](_0x49bb3f,function(_0x4856ff){if(_0x4856ff[_0x93a6('0x30')]!==_0x93a6('0x40')){var _0x46eb5f={};_0x46eb5f[_0x4856ff[_0x93a6('0x2a')]]={'$like':'%'+_0x2eadde[_0x93a6('0x34')][_0x93a6('0x41')]+'%'};return _0x46eb5f;}})});}_0x49cb71=_[_0x93a6('0x42')]({},_0x49cb71,_0x2eadde[_0x93a6('0x43')]);var _0x20a8e5={'where':_0x49cb71[_0x93a6('0x3d')]};return db[_0x93a6('0x2e')][_0x93a6('0x20')](_0x20a8e5)[_0x93a6('0x27')](function(_0x55d960){_0x594447[_0x93a6('0x20')]=_0x55d960;if(_0x2eadde[_0x93a6('0x34')][_0x93a6('0x44')]){_0x49cb71[_0x93a6('0x45')]=[{'all':!![]}];}return db[_0x93a6('0x2e')][_0x93a6('0x46')](_0x49cb71);})[_0x93a6('0x27')](function(_0x1f57c4){_0x594447[_0x93a6('0x47')]=_0x1f57c4;return _0x594447;})[_0x93a6('0x27')](respondWithFilteredResult(_0x3593f2,_0x49cb71))[_0x93a6('0x48')](handleError(_0x3593f2,null));};exports[_0x93a6('0x49')]=function(_0x2f68b7,_0x15b9d2){var _0x1686de={'raw':!![],'where':{'id':_0x2f68b7[_0x93a6('0x4a')]['id']}},_0x11e36f={};_0x11e36f[_0x93a6('0x32')]=_[_0x93a6('0x33')](db['MailSubstatus'][_0x93a6('0x2f')]);_0x11e36f[_0x93a6('0x34')]=_['keys'](_0x2f68b7['query']);_0x11e36f['filters']=_[_0x93a6('0x35')](_0x11e36f['model'],_0x11e36f[_0x93a6('0x34')]);_0x1686de[_0x93a6('0x37')]=_[_0x93a6('0x35')](_0x11e36f[_0x93a6('0x32')],qs[_0x93a6('0x36')](_0x2f68b7[_0x93a6('0x34')][_0x93a6('0x36')]));_0x1686de['attributes']=_0x1686de['attributes']['length']?_0x1686de['attributes']:_0x11e36f[_0x93a6('0x32')];if(_0x2f68b7[_0x93a6('0x34')][_0x93a6('0x44')]){_0x1686de['include']=[{'all':!![]}];}_0x1686de=_[_0x93a6('0x42')]({},_0x1686de,_0x2f68b7[_0x93a6('0x43')]);return db[_0x93a6('0x2e')][_0x93a6('0x4b')](_0x1686de)['then'](handleEntityNotFound(_0x15b9d2,null))[_0x93a6('0x27')](respondWithResult(_0x15b9d2,null))['catch'](handleError(_0x15b9d2,null));};exports[_0x93a6('0x4c')]=function(_0xd7e799,_0x18b514){return db[_0x93a6('0x2e')][_0x93a6('0x4c')](_0xd7e799[_0x93a6('0x4d')],{})['then'](respondWithResult(_0x18b514,0xc9))['catch'](handleError(_0x18b514,null));};exports[_0x93a6('0x26')]=function(_0x92a413,_0x3555e6){if(_0x92a413[_0x93a6('0x4d')]['id']){delete _0x92a413[_0x93a6('0x4d')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x92a413[_0x93a6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3555e6,null))[_0x93a6('0x27')](saveUpdates(_0x92a413['body'],null))['then'](respondWithResult(_0x3555e6,null))['catch'](handleError(_0x3555e6,null));};exports[_0x93a6('0x28')]=function(_0x3eb2b1,_0x38cf99){return db['MailSubstatus'][_0x93a6('0x4b')]({'where':{'id':_0x3eb2b1[_0x93a6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x38cf99,null))[_0x93a6('0x27')](removeEntity(_0x38cf99,null))[_0x93a6('0x48')](handleError(_0x38cf99,null));};exports['describe']=function(_0x169708,_0x1788ba){return db[_0x93a6('0x2e')][_0x93a6('0x4e')]()[_0x93a6('0x27')](respondWithResult(_0x1788ba,null))['catch'](handleError(_0x1788ba,null));}; \ No newline at end of file +var _0x06ce=['undefined','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','error','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','then','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit'];(function(_0x57f6b6,_0xca5037){var _0x2fb87f=function(_0x117c50){while(--_0x117c50){_0x57f6b6['push'](_0x57f6b6['shift']());}};_0x2fb87f(++_0xca5037);}(_0x06ce,0x173));var _0xe06c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x06ce[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe06c('0x0'));var zipdir=require(_0xe06c('0x1'));var jsonpatch=require(_0xe06c('0x2'));var rp=require(_0xe06c('0x3'));var moment=require(_0xe06c('0x4'));var BPromise=require(_0xe06c('0x5'));var Mustache=require(_0xe06c('0x6'));var util=require(_0xe06c('0x7'));var path=require(_0xe06c('0x8'));var sox=require(_0xe06c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe06c('0xa'));var squel=require('squel');var crypto=require(_0xe06c('0xb'));var jsforce=require(_0xe06c('0xc'));var deskjs=require(_0xe06c('0xd'));var toCsv=require(_0xe06c('0xe'));var querystring=require(_0xe06c('0xf'));var Papa=require('papaparse');var Redis=require(_0xe06c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe06c('0x11'));var hardwareService=require(_0xe06c('0x12'));var logger=require(_0xe06c('0x13'))(_0xe06c('0x14'));var utils=require(_0xe06c('0x15'));var config=require(_0xe06c('0x16'));var licenseUtil=require(_0xe06c('0x17'));var db=require(_0xe06c('0x18'))['db'];function respondWithStatusCode(_0x29055c,_0x2adc68){_0x2adc68=_0x2adc68||0xcc;return function(_0x5c3e2b){if(_0x5c3e2b){return _0x29055c[_0xe06c('0x19')](_0x2adc68);}return _0x29055c[_0xe06c('0x1a')](_0x2adc68)[_0xe06c('0x1b')]();};}function respondWithResult(_0x53e2ad,_0x3530e6){_0x3530e6=_0x3530e6||0xc8;return function(_0x2546ad){if(_0x2546ad){return _0x53e2ad[_0xe06c('0x1a')](_0x3530e6)['json'](_0x2546ad);}};}function respondWithFilteredResult(_0x4ba746,_0x341428){return function(_0x566062){if(_0x566062){var _0x193629=typeof _0x341428['offset']==='undefined'&&typeof _0x341428[_0xe06c('0x1c')]===_0xe06c('0x1d');var _0x541a39=_0x566062[_0xe06c('0x1e')];var _0x3421f6=_0x193629?0x0:_0x341428[_0xe06c('0x1f')];var _0x333dc7=_0x193629?_0x566062[_0xe06c('0x1e')]:_0x341428[_0xe06c('0x1f')]+_0x341428[_0xe06c('0x1c')];var _0x2602b7;if(_0x333dc7>=_0x541a39){_0x333dc7=_0x541a39;_0x2602b7=0xc8;}else{_0x2602b7=0xce;}_0x4ba746['status'](_0x2602b7);return _0x4ba746[_0xe06c('0x20')](_0xe06c('0x21'),_0x3421f6+'-'+_0x333dc7+'/'+_0x541a39)[_0xe06c('0x22')](_0x566062);}return null;};}function patchUpdates(_0xdb9695){return function(_0x1382e7){try{jsonpatch[_0xe06c('0x23')](_0x1382e7,_0xdb9695,!![]);}catch(_0x5661eb){return BPromise[_0xe06c('0x24')](_0x5661eb);}return _0x1382e7[_0xe06c('0x25')]();};}function saveUpdates(_0x472835,_0x3869d9){return function(_0x478a10){if(_0x478a10){return _0x478a10[_0xe06c('0x26')](_0x472835)['then'](function(_0x3158fa){return _0x3158fa;});}return null;};}function removeEntity(_0x1acc46,_0x39efaf){return function(_0x3083dc){if(_0x3083dc){return _0x3083dc[_0xe06c('0x27')]()['then'](function(){_0x1acc46['status'](0xcc)[_0xe06c('0x1b')]();});}};}function handleEntityNotFound(_0x139fcb,_0x4c715d){return function(_0xc24e78){if(!_0xc24e78){_0x139fcb['sendStatus'](0x194);}return _0xc24e78;};}function handleError(_0xb58d70,_0x1a799b){_0x1a799b=_0x1a799b||0x1f4;return function(_0x3a48d6){logger[_0xe06c('0x28')](_0x3a48d6['stack']);if(_0x3a48d6[_0xe06c('0x29')]){delete _0x3a48d6[_0xe06c('0x29')];}_0xb58d70[_0xe06c('0x1a')](_0x1a799b)[_0xe06c('0x2a')](_0x3a48d6);};}exports[_0xe06c('0x2b')]=function(_0x3fecda,_0x20fdb2){var _0x1e1ee9={},_0x3d22d6={},_0x17f2d9={'count':0x0,'rows':[]};var _0xf7b93=_[_0xe06c('0x2c')](db[_0xe06c('0x2d')][_0xe06c('0x2e')],function(_0x99ab86){return{'name':_0x99ab86[_0xe06c('0x2f')],'type':_0x99ab86[_0xe06c('0x30')][_0xe06c('0x31')]};});_0x3d22d6['model']=_[_0xe06c('0x2c')](_0xf7b93,_0xe06c('0x29'));_0x3d22d6[_0xe06c('0x32')]=_[_0xe06c('0x33')](_0x3fecda[_0xe06c('0x32')]);_0x3d22d6['filters']=_['intersection'](_0x3d22d6['model'],_0x3d22d6[_0xe06c('0x32')]);_0x1e1ee9[_0xe06c('0x34')]=_[_0xe06c('0x35')](_0x3d22d6[_0xe06c('0x36')],qs[_0xe06c('0x37')](_0x3fecda['query']['fields']));_0x1e1ee9[_0xe06c('0x34')]=_0x1e1ee9[_0xe06c('0x34')][_0xe06c('0x38')]?_0x1e1ee9[_0xe06c('0x34')]:_0x3d22d6[_0xe06c('0x36')];if(!_0x3fecda[_0xe06c('0x32')][_0xe06c('0x39')](_0xe06c('0x3a'))){_0x1e1ee9[_0xe06c('0x1c')]=qs['limit'](_0x3fecda[_0xe06c('0x32')][_0xe06c('0x1c')]);_0x1e1ee9[_0xe06c('0x1f')]=qs[_0xe06c('0x1f')](_0x3fecda[_0xe06c('0x32')][_0xe06c('0x1f')]);}_0x1e1ee9[_0xe06c('0x3b')]=qs['sort'](_0x3fecda['query'][_0xe06c('0x3c')]);_0x1e1ee9[_0xe06c('0x3d')]=qs[_0xe06c('0x3e')](_[_0xe06c('0x3f')](_0x3fecda[_0xe06c('0x32')],_0x3d22d6['filters']),_0xf7b93);if(_0x3fecda[_0xe06c('0x32')]['filter']){_0x1e1ee9['where']=_[_0xe06c('0x40')](_0x1e1ee9[_0xe06c('0x3d')],{'$or':_[_0xe06c('0x2c')](_0xf7b93,function(_0x4c47ab){if(_0x4c47ab['type']!==_0xe06c('0x41')){var _0x1741c0={};_0x1741c0[_0x4c47ab[_0xe06c('0x29')]]={'$like':'%'+_0x3fecda['query'][_0xe06c('0x42')]+'%'};return _0x1741c0;}})});}_0x1e1ee9=_[_0xe06c('0x40')]({},_0x1e1ee9,_0x3fecda['options']);var _0x4cf699={'where':_0x1e1ee9[_0xe06c('0x3d')]};return db[_0xe06c('0x2d')][_0xe06c('0x1e')](_0x4cf699)[_0xe06c('0x43')](function(_0x457831){_0x17f2d9[_0xe06c('0x1e')]=_0x457831;if(_0x3fecda[_0xe06c('0x32')][_0xe06c('0x44')]){_0x1e1ee9[_0xe06c('0x45')]=[{'all':!![]}];}return db[_0xe06c('0x2d')][_0xe06c('0x46')](_0x1e1ee9);})[_0xe06c('0x43')](function(_0x570587){_0x17f2d9[_0xe06c('0x47')]=_0x570587;return _0x17f2d9;})[_0xe06c('0x43')](respondWithFilteredResult(_0x20fdb2,_0x1e1ee9))[_0xe06c('0x48')](handleError(_0x20fdb2,null));};exports[_0xe06c('0x49')]=function(_0x29349a,_0x20dda2){var _0x151d8d={'raw':!![],'where':{'id':_0x29349a[_0xe06c('0x4a')]['id']}},_0x1a3396={};_0x1a3396[_0xe06c('0x36')]=_[_0xe06c('0x33')](db['MailSubstatus'][_0xe06c('0x2e')]);_0x1a3396['query']=_['keys'](_0x29349a[_0xe06c('0x32')]);_0x1a3396[_0xe06c('0x3e')]=_[_0xe06c('0x35')](_0x1a3396[_0xe06c('0x36')],_0x1a3396[_0xe06c('0x32')]);_0x151d8d[_0xe06c('0x34')]=_['intersection'](_0x1a3396[_0xe06c('0x36')],qs[_0xe06c('0x37')](_0x29349a[_0xe06c('0x32')][_0xe06c('0x37')]));_0x151d8d['attributes']=_0x151d8d[_0xe06c('0x34')][_0xe06c('0x38')]?_0x151d8d[_0xe06c('0x34')]:_0x1a3396['model'];if(_0x29349a[_0xe06c('0x32')][_0xe06c('0x44')]){_0x151d8d[_0xe06c('0x45')]=[{'all':!![]}];}_0x151d8d=_[_0xe06c('0x40')]({},_0x151d8d,_0x29349a[_0xe06c('0x4b')]);return db['MailSubstatus'][_0xe06c('0x4c')](_0x151d8d)[_0xe06c('0x43')](handleEntityNotFound(_0x20dda2,null))[_0xe06c('0x43')](respondWithResult(_0x20dda2,null))['catch'](handleError(_0x20dda2,null));};exports['create']=function(_0x3c4931,_0x5b704f){return db[_0xe06c('0x2d')][_0xe06c('0x4d')](_0x3c4931[_0xe06c('0x4e')],{})[_0xe06c('0x43')](respondWithResult(_0x5b704f,0xc9))[_0xe06c('0x48')](handleError(_0x5b704f,null));};exports[_0xe06c('0x26')]=function(_0x34ce09,_0x526fbd){if(_0x34ce09[_0xe06c('0x4e')]['id']){delete _0x34ce09[_0xe06c('0x4e')]['id'];}return db['MailSubstatus'][_0xe06c('0x4c')]({'where':{'id':_0x34ce09[_0xe06c('0x4a')]['id']}})[_0xe06c('0x43')](handleEntityNotFound(_0x526fbd,null))[_0xe06c('0x43')](saveUpdates(_0x34ce09[_0xe06c('0x4e')],null))[_0xe06c('0x43')](respondWithResult(_0x526fbd,null))[_0xe06c('0x48')](handleError(_0x526fbd,null));};exports['destroy']=function(_0x32915a,_0x2da30e){return db['MailSubstatus'][_0xe06c('0x4c')]({'where':{'id':_0x32915a[_0xe06c('0x4a')]['id']}})[_0xe06c('0x43')](handleEntityNotFound(_0x2da30e,null))['then'](removeEntity(_0x2da30e,null))[_0xe06c('0x48')](handleError(_0x2da30e,null));};exports[_0xe06c('0x4f')]=function(_0x4bd862,_0x5bbed2){return db['MailSubstatus']['describe']()[_0xe06c('0x43')](respondWithResult(_0x5bbed2,null))['catch'](handleError(_0x5bbed2,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 220735b..3da35a4 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 _0xc7b2=['setMaxListeners','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4e0be5,_0x462d7a){var _0x4c96b3=function(_0x49af0e){while(--_0x49af0e){_0x4e0be5['push'](_0x4e0be5['shift']());}};_0x4c96b3(++_0x462d7a);}(_0xc7b2,0x100));var _0x2c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2c7b('0x0'));var MailSubstatus=require(_0x2c7b('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x2c7b('0x2')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x2fcaa9){return function(_0x476dc3,_0x542bc8,_0x2d477e){MailSubstatusEvents[_0x2c7b('0x3')](_0x2fcaa9+':'+_0x476dc3['id'],_0x476dc3);MailSubstatusEvents[_0x2c7b('0x3')](_0x2fcaa9,_0x476dc3);_0x2d477e(null);};}for(var e in events){if(events[_0x2c7b('0x4')](e)){var event=events[e];MailSubstatus[_0x2c7b('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0xb0bd=['events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x549917,_0x4ffe64){var _0x25a6c6=function(_0xb44a74){while(--_0xb44a74){_0x549917['push'](_0x549917['shift']());}};_0x25a6c6(++_0x4ffe64);}(_0xb0bd,0xb6));var _0xdb0b=function(_0x12c5a1,_0x2f813f){_0x12c5a1=_0x12c5a1-0x0;var _0x459852=_0xb0bd[_0x12c5a1];return _0x459852;};'use strict';var EventEmitter=require(_0xdb0b('0x0'));var MailSubstatus=require(_0xdb0b('0x1'))['db'][_0xdb0b('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xdb0b('0x3')](0x0);var events={'afterUpdate':_0xdb0b('0x4')};function emitEvent(_0xa46eb){return function(_0x1ef1d3,_0x55bba2,_0x752e52){MailSubstatusEvents[_0xdb0b('0x5')](_0xa46eb+':'+_0x1ef1d3['id'],_0x1ef1d3);MailSubstatusEvents[_0xdb0b('0x5')](_0xa46eb,_0x1ef1d3);_0x752e52(null);};}for(var e in events){if(events[_0xdb0b('0x6')](e)){var event=events[e];MailSubstatus['hook'](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 b811f6d..d552524 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 _0x3c82=['_previousDataValues','then','catch','models','MailSubstatus','mail_substatuses','name','mailSubstatus'];(function(_0x524515,_0x52d779){var _0x1ce231=function(_0x103cec){while(--_0x103cec){_0x524515['push'](_0x524515['shift']());}};_0x1ce231(++_0x52d779);}(_0x3c82,0x1f3));var _0x23c8=function(_0x5e477e,_0x50aebb){_0x5e477e=_0x5e477e-0x0;var _0x408a61=_0x3c82[_0x5e477e];return _0x408a61;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x5d96af){var _0x5c16a0=_0x5d96af[_0x23c8('0x0')];return _0x5d96af['define'](_0x23c8('0x1'),attributes,{'tableName':_0x23c8('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1e5b3c,_0x13ebe1,_0x5f480b){return _0x5c16a0['Condition']['update']({'value':_0x1e5b3c[_0x23c8('0x3')]},{'where':{'field':_0x23c8('0x4'),'value':_0x1e5b3c[_0x23c8('0x5')][_0x23c8('0x3')]}})[_0x23c8('0x6')](function(){_0x5f480b();})[_0x23c8('0x7')](function(_0x2bcb30){_0x5f480b(_0x2bcb30);});}}});}; \ No newline at end of file +var _0xfdb1=['Condition','update','name','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0xfdb1,0x192));var _0x1fdb=function(_0x47f478,_0x426a1b){_0x47f478=_0x47f478-0x0;var _0x44e8d9=_0xfdb1[_0x47f478];return _0x44e8d9;};'use strict';var attributes=require(_0x1fdb('0x0'));module[_0x1fdb('0x1')]=function(_0x5dfd6b){var _0x449390=_0x5dfd6b[_0x1fdb('0x2')];return _0x5dfd6b[_0x1fdb('0x3')](_0x1fdb('0x4'),attributes,{'tableName':_0x1fdb('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5c9144,_0x2944c1,_0x54ebcd){return _0x449390[_0x1fdb('0x6')][_0x1fdb('0x7')]({'value':_0x5c9144[_0x1fdb('0x8')]},{'where':{'field':_0x1fdb('0x9'),'value':_0x5c9144[_0x1fdb('0xa')][_0x1fdb('0x8')]}})[_0x1fdb('0xb')](function(){_0x54ebcd();})['catch'](function(_0x42dab8){_0x54ebcd(_0x42dab8);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 4951c9e..39f5b56 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 _0x42f1=['info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b8bbb,_0x33fc97){var _0x1b75a5=function(_0x5c84ff){while(--_0x5c84ff){_0x4b8bbb['push'](_0x4b8bbb['shift']());}};_0x1b75a5(++_0x33fc97);}(_0x42f1,0x1e2));var _0x142f=function(_0x2d3903,_0x476d2e){_0x2d3903=_0x2d3903-0x0;var _0x171317=_0x42f1[_0x2d3903];return _0x171317;};'use strict';var _=require(_0x142f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x142f('0x1'));var rs=require(_0x142f('0x2'));var fs=require('fs');var Redis=require(_0x142f('0x3'));var db=require(_0x142f('0x4'))['db'];var utils=require(_0x142f('0x5'));var logger=require(_0x142f('0x6'))(_0x142f('0x7'));var config=require(_0x142f('0x8'));var jayson=require(_0x142f('0x9'));var client=jayson[_0x142f('0xa')][_0x142f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2113fa,_0x39b289,_0x4a196f){return new BPromise(function(_0x4db8f9,_0x44a323){return client[_0x142f('0xc')](_0x2113fa,_0x4a196f)[_0x142f('0xd')](function(_0x2d6c7b){logger['info'](_0x142f('0xe'),_0x39b289,_0x142f('0xf'));logger[_0x142f('0x10')](_0x142f('0x11'),_0x39b289,_0x142f('0xf'),JSON[_0x142f('0x12')](_0x2d6c7b));if(_0x2d6c7b[_0x142f('0x13')]){if(_0x2d6c7b[_0x142f('0x13')][_0x142f('0x14')]===0x1f4){logger[_0x142f('0x13')](_0x142f('0xe'),_0x39b289,_0x2d6c7b[_0x142f('0x13')][_0x142f('0x15')]);return _0x44a323(_0x2d6c7b[_0x142f('0x13')][_0x142f('0x15')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x39b289,_0x2d6c7b[_0x142f('0x13')][_0x142f('0x15')]);return _0x4db8f9(_0x2d6c7b['error'][_0x142f('0x15')]);}else{logger[_0x142f('0x16')]('MailSubstatus,\x20%s,\x20%s',_0x39b289,_0x142f('0xf'));_0x4db8f9(_0x2d6c7b[_0x142f('0x17')]['message']);}})['catch'](function(_0x217391){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x39b289,_0x217391);_0x44a323(_0x217391);});});} \ No newline at end of file +var _0xee95=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment'];(function(_0x133842,_0x193213){var _0x41145e=function(_0x3ab6a5){while(--_0x3ab6a5){_0x133842['push'](_0x133842['shift']());}};_0x41145e(++_0x193213);}(_0xee95,0x129));var _0x5ee9=function(_0x933cd2,_0x451917){_0x933cd2=_0x933cd2-0x0;var _0x5d312b=_0xee95[_0x933cd2];return _0x5d312b;};'use strict';var _=require(_0x5ee9('0x0'));var util=require('util');var moment=require(_0x5ee9('0x1'));var BPromise=require('bluebird');var rs=require(_0x5ee9('0x2'));var fs=require('fs');var Redis=require(_0x5ee9('0x3'));var db=require(_0x5ee9('0x4'))['db'];var utils=require(_0x5ee9('0x5'));var logger=require(_0x5ee9('0x6'))(_0x5ee9('0x7'));var config=require(_0x5ee9('0x8'));var jayson=require(_0x5ee9('0x9'));var client=jayson[_0x5ee9('0xa')][_0x5ee9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ed81a,_0x160908,_0x573046){return new BPromise(function(_0x94104b,_0x4f96f9){return client['request'](_0x3ed81a,_0x573046)[_0x5ee9('0xc')](function(_0x3119aa){logger[_0x5ee9('0xd')](_0x5ee9('0xe'),_0x160908,'request\x20sent');logger[_0x5ee9('0xf')](_0x5ee9('0x10'),_0x160908,_0x5ee9('0x11'),JSON[_0x5ee9('0x12')](_0x3119aa));if(_0x3119aa[_0x5ee9('0x13')]){if(_0x3119aa[_0x5ee9('0x13')]['code']===0x1f4){logger[_0x5ee9('0x13')](_0x5ee9('0xe'),_0x160908,_0x3119aa[_0x5ee9('0x13')]['message']);return _0x4f96f9(_0x3119aa[_0x5ee9('0x13')][_0x5ee9('0x14')]);}logger[_0x5ee9('0x13')](_0x5ee9('0xe'),_0x160908,_0x3119aa[_0x5ee9('0x13')][_0x5ee9('0x14')]);return _0x94104b(_0x3119aa[_0x5ee9('0x13')][_0x5ee9('0x14')]);}else{logger[_0x5ee9('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x160908,_0x5ee9('0x11'));_0x94104b(_0x3119aa[_0x5ee9('0x15')][_0x5ee9('0x14')]);}})[_0x5ee9('0x16')](function(_0x31f4e4){logger['error'](_0x5ee9('0xe'),_0x160908,_0x31f4e4);_0x4f96f9(_0x31f4e4);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index b989753..397d318 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 _0x27be=['describe','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x3de230,_0x5184cc){var _0x16779e=function(_0x26d6e7){while(--_0x26d6e7){_0x3de230['push'](_0x3de230['shift']());}};_0x16779e(++_0x5184cc);}(_0x27be,0x1bc));var _0xe27b=function(_0x4ed481,_0x1aad66){_0x4ed481=_0x4ed481-0x0;var _0x553d22=_0x27be[_0x4ed481];return _0x553d22;};'use strict';var multer=require(_0xe27b('0x0'));var util=require(_0xe27b('0x1'));var path=require(_0xe27b('0x2'));var timeout=require(_0xe27b('0x3'));var express=require(_0xe27b('0x4'));var router=express['Router']();var fs_extra=require(_0xe27b('0x5'));var auth=require(_0xe27b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe27b('0x7'));var controller=require('./mailTransferReport.controller');router[_0xe27b('0x8')]('/',auth[_0xe27b('0x9')](),controller[_0xe27b('0xa')]);router['get'](_0xe27b('0xb'),auth[_0xe27b('0x9')](),controller[_0xe27b('0xc')]);router[_0xe27b('0x8')](_0xe27b('0xd'),auth[_0xe27b('0x9')](),controller[_0xe27b('0xe')]);router['post']('/',auth[_0xe27b('0x9')](),controller['create']);router[_0xe27b('0xf')](_0xe27b('0xd'),auth[_0xe27b('0x9')](),controller[_0xe27b('0x10')]);router[_0xe27b('0x11')](_0xe27b('0xd'),auth[_0xe27b('0x9')](),controller['destroy']);module[_0xe27b('0x12')]=router; \ No newline at end of file +var _0x4d33=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x4cf5d3,_0x599e0c){var _0x228d88=function(_0x545031){while(--_0x545031){_0x4cf5d3['push'](_0x4cf5d3['shift']());}};_0x228d88(++_0x599e0c);}(_0x4d33,0x8e));var _0x34d3=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0x4d33[_0x1b1a3b];return _0x385347;};'use strict';var multer=require(_0x34d3('0x0'));var util=require(_0x34d3('0x1'));var path=require(_0x34d3('0x2'));var timeout=require('connect-timeout');var express=require(_0x34d3('0x3'));var router=express[_0x34d3('0x4')]();var fs_extra=require(_0x34d3('0x5'));var auth=require(_0x34d3('0x6'));var interaction=require(_0x34d3('0x7'));var config=require(_0x34d3('0x8'));var controller=require(_0x34d3('0x9'));router[_0x34d3('0xa')]('/',auth[_0x34d3('0xb')](),controller['index']);router['get']('/describe',auth[_0x34d3('0xb')](),controller[_0x34d3('0xc')]);router[_0x34d3('0xa')](_0x34d3('0xd'),auth[_0x34d3('0xb')](),controller[_0x34d3('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x34d3('0xf')]);router[_0x34d3('0x10')](_0x34d3('0xd'),auth['isAuthenticated'](),controller[_0x34d3('0x11')]);router[_0x34d3('0x12')](_0x34d3('0xd'),auth[_0x34d3('0xb')](),controller[_0x34d3('0x13')]);module[_0x34d3('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index d8cd6ca..b054669 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x3fbc6a,_0x1f1133){var _0x524a7c=function(_0x5d25c8){while(--_0x5d25c8){_0x3fbc6a['push'](_0x3fbc6a['shift']());}};_0x524a7c(++_0x1f1133);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x32382f,_0x1c1528){var _0x191978=function(_0x238054){while(--_0x238054){_0x32382f['push'](_0x32382f['shift']());}};_0x191978(++_0x1c1528);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index c21ca31..5582794 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 _0x2f33=['status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','index','map','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','name','filter','options','MailTransferReport','includeAll','findAll','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end'];(function(_0x54d347,_0x1b8cb6){var _0x2e6636=function(_0x575bdf){while(--_0x575bdf){_0x54d347['push'](_0x54d347['shift']());}};_0x2e6636(++_0x1b8cb6);}(_0x2f33,0x102));var _0x32f3=function(_0x46a25e,_0x4e1822){_0x46a25e=_0x46a25e-0x0;var _0x1547c8=_0x2f33[_0x46a25e];return _0x1547c8;};'use strict';var emlformat=require(_0x32f3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32f3('0x1'));var jsonpatch=require(_0x32f3('0x2'));var rp=require(_0x32f3('0x3'));var moment=require(_0x32f3('0x4'));var BPromise=require(_0x32f3('0x5'));var Mustache=require(_0x32f3('0x6'));var util=require(_0x32f3('0x7'));var path=require(_0x32f3('0x8'));var sox=require('sox');var csv=require(_0x32f3('0x9'));var ejs=require(_0x32f3('0xa'));var fs=require('fs');var fs_extra=require(_0x32f3('0xb'));var _=require(_0x32f3('0xc'));var squel=require('squel');var crypto=require(_0x32f3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x32f3('0xe'));var toCsv=require(_0x32f3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x32f3('0xf'));var authService=require(_0x32f3('0x10'));var qs=require(_0x32f3('0x11'));var as=require(_0x32f3('0x12'));var hardwareService=require(_0x32f3('0x13'));var logger=require(_0x32f3('0x14'))(_0x32f3('0x15'));var utils=require(_0x32f3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32f3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19e02d,_0x55c078){_0x55c078=_0x55c078||0xcc;return function(_0x452740){if(_0x452740){return _0x19e02d[_0x32f3('0x18')](_0x55c078);}return _0x19e02d['status'](_0x55c078)[_0x32f3('0x19')]();};}function respondWithResult(_0x5c2b82,_0x4c0c7e){_0x4c0c7e=_0x4c0c7e||0xc8;return function(_0xa5f26c){if(_0xa5f26c){return _0x5c2b82[_0x32f3('0x1a')](_0x4c0c7e)[_0x32f3('0x1b')](_0xa5f26c);}};}function respondWithFilteredResult(_0x3a4cc9,_0x10f169){return function(_0x2e28cb){if(_0x2e28cb){var _0x1934cf=typeof _0x10f169[_0x32f3('0x1c')]===_0x32f3('0x1d')&&typeof _0x10f169[_0x32f3('0x1e')]===_0x32f3('0x1d');var _0x567fcb=_0x2e28cb[_0x32f3('0x1f')];var _0x498adc=_0x1934cf?0x0:_0x10f169['offset'];var _0x2de5f5=_0x1934cf?_0x2e28cb['count']:_0x10f169['offset']+_0x10f169[_0x32f3('0x1e')];var _0x5eb882;if(_0x2de5f5>=_0x567fcb){_0x2de5f5=_0x567fcb;_0x5eb882=0xc8;}else{_0x5eb882=0xce;}_0x3a4cc9['status'](_0x5eb882);return _0x3a4cc9[_0x32f3('0x20')](_0x32f3('0x21'),_0x498adc+'-'+_0x2de5f5+'/'+_0x567fcb)[_0x32f3('0x1b')](_0x2e28cb);}return null;};}function patchUpdates(_0x176958){return function(_0xa3b2f0){try{jsonpatch['apply'](_0xa3b2f0,_0x176958,!![]);}catch(_0x1318fe){return BPromise['reject'](_0x1318fe);}return _0xa3b2f0[_0x32f3('0x22')]();};}function saveUpdates(_0x27c108,_0x309dda){return function(_0x155f08){if(_0x155f08){return _0x155f08[_0x32f3('0x23')](_0x27c108)[_0x32f3('0x24')](function(_0x1ce001){return _0x1ce001;});}return null;};}function removeEntity(_0x19742d,_0x4e4dcd){return function(_0x528c1e){if(_0x528c1e){return _0x528c1e[_0x32f3('0x25')]()[_0x32f3('0x24')](function(){_0x19742d[_0x32f3('0x1a')](0xcc)[_0x32f3('0x19')]();});}};}function handleEntityNotFound(_0x2babb4,_0x52e361){return function(_0x3ae02f){if(!_0x3ae02f){_0x2babb4[_0x32f3('0x18')](0x194);}return _0x3ae02f;};}function handleError(_0x543db0,_0x5b2e1e){_0x5b2e1e=_0x5b2e1e||0x1f4;return function(_0x480475){logger[_0x32f3('0x26')](_0x480475['stack']);if(_0x480475['name']){delete _0x480475['name'];}_0x543db0['status'](_0x5b2e1e)['send'](_0x480475);};}exports[_0x32f3('0x27')]=function(_0x4cca32,_0x4b3b67){var _0x2a3d47={},_0xdc836d={},_0x452fc0={'count':0x0,'rows':[]};var _0x260bd3=_[_0x32f3('0x28')](db['MailTransferReport']['rawAttributes'],function(_0xfaa764){return{'name':_0xfaa764[_0x32f3('0x29')],'type':_0xfaa764['type'][_0x32f3('0x2a')]};});_0xdc836d['model']=_[_0x32f3('0x28')](_0x260bd3,'name');_0xdc836d[_0x32f3('0x2b')]=_[_0x32f3('0x2c')](_0x4cca32[_0x32f3('0x2b')]);_0xdc836d[_0x32f3('0x2d')]=_[_0x32f3('0x2e')](_0xdc836d['model'],_0xdc836d['query']);_0x2a3d47[_0x32f3('0x2f')]=_[_0x32f3('0x2e')](_0xdc836d[_0x32f3('0x30')],qs['fields'](_0x4cca32['query'][_0x32f3('0x31')]));_0x2a3d47['attributes']=_0x2a3d47['attributes'][_0x32f3('0x32')]?_0x2a3d47[_0x32f3('0x2f')]:_0xdc836d['model'];if(!_0x4cca32[_0x32f3('0x2b')][_0x32f3('0x33')](_0x32f3('0x34'))){_0x2a3d47['limit']=qs[_0x32f3('0x1e')](_0x4cca32[_0x32f3('0x2b')][_0x32f3('0x1e')]);_0x2a3d47[_0x32f3('0x1c')]=qs[_0x32f3('0x1c')](_0x4cca32[_0x32f3('0x2b')][_0x32f3('0x1c')]);}_0x2a3d47[_0x32f3('0x35')]=qs[_0x32f3('0x36')](_0x4cca32[_0x32f3('0x2b')][_0x32f3('0x36')]);_0x2a3d47[_0x32f3('0x37')]=qs[_0x32f3('0x2d')](_[_0x32f3('0x38')](_0x4cca32[_0x32f3('0x2b')],_0xdc836d[_0x32f3('0x2d')]),_0x260bd3);if(_0x4cca32[_0x32f3('0x2b')]['filter']){_0x2a3d47[_0x32f3('0x37')]=_['merge'](_0x2a3d47[_0x32f3('0x37')],{'$or':_[_0x32f3('0x28')](_0x260bd3,function(_0x51a56d){if(_0x51a56d['type']!==_0x32f3('0x39')){var _0x190615={};_0x190615[_0x51a56d[_0x32f3('0x3a')]]={'$like':'%'+_0x4cca32[_0x32f3('0x2b')][_0x32f3('0x3b')]+'%'};return _0x190615;}})});}_0x2a3d47=_['merge']({},_0x2a3d47,_0x4cca32[_0x32f3('0x3c')]);var _0x4ed120={'where':_0x2a3d47[_0x32f3('0x37')]};return db[_0x32f3('0x3d')][_0x32f3('0x1f')](_0x4ed120)[_0x32f3('0x24')](function(_0x3869db){_0x452fc0['count']=_0x3869db;if(_0x4cca32[_0x32f3('0x2b')][_0x32f3('0x3e')]){_0x2a3d47['include']=[{'all':!![]}];}return db[_0x32f3('0x3d')][_0x32f3('0x3f')](_0x2a3d47);})[_0x32f3('0x24')](function(_0x2c5008){_0x452fc0['rows']=_0x2c5008;return _0x452fc0;})[_0x32f3('0x24')](respondWithFilteredResult(_0x4b3b67,_0x2a3d47))[_0x32f3('0x40')](handleError(_0x4b3b67,null));};exports[_0x32f3('0x41')]=function(_0x227ab7,_0x327c49){var _0x277814={'raw':!![],'where':{'id':_0x227ab7[_0x32f3('0x42')]['id']}},_0x170239={};_0x170239['model']=_[_0x32f3('0x2c')](db[_0x32f3('0x3d')]['rawAttributes']);_0x170239[_0x32f3('0x2b')]=_[_0x32f3('0x2c')](_0x227ab7[_0x32f3('0x2b')]);_0x170239[_0x32f3('0x2d')]=_[_0x32f3('0x2e')](_0x170239[_0x32f3('0x30')],_0x170239[_0x32f3('0x2b')]);_0x277814[_0x32f3('0x2f')]=_[_0x32f3('0x2e')](_0x170239[_0x32f3('0x30')],qs[_0x32f3('0x31')](_0x227ab7[_0x32f3('0x2b')][_0x32f3('0x31')]));_0x277814[_0x32f3('0x2f')]=_0x277814[_0x32f3('0x2f')][_0x32f3('0x32')]?_0x277814[_0x32f3('0x2f')]:_0x170239[_0x32f3('0x30')];if(_0x227ab7['query'][_0x32f3('0x3e')]){_0x277814['include']=[{'all':!![]}];}_0x277814=_['merge']({},_0x277814,_0x227ab7[_0x32f3('0x3c')]);return db[_0x32f3('0x3d')][_0x32f3('0x43')](_0x277814)[_0x32f3('0x24')](handleEntityNotFound(_0x327c49,null))[_0x32f3('0x24')](respondWithResult(_0x327c49,null))[_0x32f3('0x40')](handleError(_0x327c49,null));};exports[_0x32f3('0x44')]=function(_0x22fb92,_0x193ed2){return db['MailTransferReport'][_0x32f3('0x44')](_0x22fb92[_0x32f3('0x45')],{})[_0x32f3('0x24')](respondWithResult(_0x193ed2,0xc9))[_0x32f3('0x40')](handleError(_0x193ed2,null));};exports[_0x32f3('0x23')]=function(_0x35203c,_0x47311f){if(_0x35203c[_0x32f3('0x45')]['id']){delete _0x35203c[_0x32f3('0x45')]['id'];}return db[_0x32f3('0x3d')][_0x32f3('0x43')]({'where':{'id':_0x35203c['params']['id']}})[_0x32f3('0x24')](handleEntityNotFound(_0x47311f,null))['then'](saveUpdates(_0x35203c[_0x32f3('0x45')],null))['then'](respondWithResult(_0x47311f,null))[_0x32f3('0x40')](handleError(_0x47311f,null));};exports['destroy']=function(_0xfae4b6,_0x4cd49d){return db[_0x32f3('0x3d')][_0x32f3('0x43')]({'where':{'id':_0xfae4b6['params']['id']}})[_0x32f3('0x24')](handleEntityNotFound(_0x4cd49d,null))[_0x32f3('0x24')](removeEntity(_0x4cd49d,null))[_0x32f3('0x40')](handleError(_0x4cd49d,null));};exports[_0x32f3('0x46')]=function(_0xf6e1e4,_0x265ec7){return db['MailTransferReport'][_0x32f3('0x46')]()[_0x32f3('0x24')](respondWithResult(_0x265ec7,null))[_0x32f3('0x40')](handleError(_0x265ec7,null));}; \ No newline at end of file +var _0xf735=['rows','catch','show','params','keys','create','body','find','destroy','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','merge','where','VIRTUAL','filter','options','MailTransferReport','includeAll','include','findAll'];(function(_0x588edd,_0x293140){var _0x4bc3cc=function(_0x46ec84){while(--_0x46ec84){_0x588edd['push'](_0x588edd['shift']());}};_0x4bc3cc(++_0x293140);}(_0xf735,0x11e));var _0x5f73=function(_0x1444f9,_0x146f98){_0x1444f9=_0x1444f9-0x0;var _0x273b20=_0xf735[_0x1444f9];return _0x273b20;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f73('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5f73('0x1'));var rp=require(_0x5f73('0x2'));var moment=require('moment');var BPromise=require(_0x5f73('0x3'));var Mustache=require(_0x5f73('0x4'));var util=require(_0x5f73('0x5'));var path=require('path');var sox=require(_0x5f73('0x6'));var csv=require(_0x5f73('0x7'));var ejs=require(_0x5f73('0x8'));var fs=require('fs');var fs_extra=require(_0x5f73('0x9'));var _=require('lodash');var squel=require(_0x5f73('0xa'));var crypto=require(_0x5f73('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5f73('0xc'));var toCsv=require(_0x5f73('0x7'));var querystring=require('querystring');var Papa=require(_0x5f73('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5f73('0xe'));var hardwareService=require(_0x5f73('0xf'));var logger=require(_0x5f73('0x10'))(_0x5f73('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5f73('0x12'));var db=require(_0x5f73('0x13'))['db'];function respondWithStatusCode(_0x121d61,_0x2b54d3){_0x2b54d3=_0x2b54d3||0xcc;return function(_0x3062cd){if(_0x3062cd){return _0x121d61[_0x5f73('0x14')](_0x2b54d3);}return _0x121d61[_0x5f73('0x15')](_0x2b54d3)['end']();};}function respondWithResult(_0x513740,_0x14dc0e){_0x14dc0e=_0x14dc0e||0xc8;return function(_0x515bd7){if(_0x515bd7){return _0x513740[_0x5f73('0x15')](_0x14dc0e)['json'](_0x515bd7);}};}function respondWithFilteredResult(_0x49e730,_0x5c3422){return function(_0x289077){if(_0x289077){var _0x258d5d=typeof _0x5c3422[_0x5f73('0x16')]===_0x5f73('0x17')&&typeof _0x5c3422[_0x5f73('0x18')]===_0x5f73('0x17');var _0x4dcdf4=_0x289077[_0x5f73('0x19')];var _0xe94435=_0x258d5d?0x0:_0x5c3422[_0x5f73('0x16')];var _0x333c6b=_0x258d5d?_0x289077['count']:_0x5c3422[_0x5f73('0x16')]+_0x5c3422[_0x5f73('0x18')];var _0x4f172e;if(_0x333c6b>=_0x4dcdf4){_0x333c6b=_0x4dcdf4;_0x4f172e=0xc8;}else{_0x4f172e=0xce;}_0x49e730[_0x5f73('0x15')](_0x4f172e);return _0x49e730['set'](_0x5f73('0x1a'),_0xe94435+'-'+_0x333c6b+'/'+_0x4dcdf4)['json'](_0x289077);}return null;};}function patchUpdates(_0x292f41){return function(_0x15af7c){try{jsonpatch[_0x5f73('0x1b')](_0x15af7c,_0x292f41,!![]);}catch(_0x31200b){return BPromise[_0x5f73('0x1c')](_0x31200b);}return _0x15af7c[_0x5f73('0x1d')]();};}function saveUpdates(_0x57bfc4,_0x13fe28){return function(_0x55827c){if(_0x55827c){return _0x55827c[_0x5f73('0x1e')](_0x57bfc4)[_0x5f73('0x1f')](function(_0x23f70f){return _0x23f70f;});}return null;};}function removeEntity(_0x172113,_0x46ac0f){return function(_0x313316){if(_0x313316){return _0x313316['destroy']()[_0x5f73('0x1f')](function(){_0x172113[_0x5f73('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x296c9a,_0x12b740){return function(_0x3fa95e){if(!_0x3fa95e){_0x296c9a[_0x5f73('0x14')](0x194);}return _0x3fa95e;};}function handleError(_0x54b253,_0x39073a){_0x39073a=_0x39073a||0x1f4;return function(_0x4ba5b9){logger[_0x5f73('0x20')](_0x4ba5b9[_0x5f73('0x21')]);if(_0x4ba5b9[_0x5f73('0x22')]){delete _0x4ba5b9[_0x5f73('0x22')];}_0x54b253[_0x5f73('0x15')](_0x39073a)[_0x5f73('0x23')](_0x4ba5b9);};}exports[_0x5f73('0x24')]=function(_0x1763a4,_0x455e58){var _0x13067b={},_0x1ce806={},_0x4bc17f={'count':0x0,'rows':[]};var _0x1e7eea=_[_0x5f73('0x25')](db['MailTransferReport']['rawAttributes'],function(_0x323b3a){return{'name':_0x323b3a[_0x5f73('0x26')],'type':_0x323b3a[_0x5f73('0x27')][_0x5f73('0x28')]};});_0x1ce806[_0x5f73('0x29')]=_[_0x5f73('0x25')](_0x1e7eea,'name');_0x1ce806[_0x5f73('0x2a')]=_['keys'](_0x1763a4[_0x5f73('0x2a')]);_0x1ce806[_0x5f73('0x2b')]=_[_0x5f73('0x2c')](_0x1ce806[_0x5f73('0x29')],_0x1ce806[_0x5f73('0x2a')]);_0x13067b[_0x5f73('0x2d')]=_['intersection'](_0x1ce806['model'],qs['fields'](_0x1763a4[_0x5f73('0x2a')][_0x5f73('0x2e')]));_0x13067b[_0x5f73('0x2d')]=_0x13067b[_0x5f73('0x2d')][_0x5f73('0x2f')]?_0x13067b['attributes']:_0x1ce806[_0x5f73('0x29')];if(!_0x1763a4['query']['hasOwnProperty'](_0x5f73('0x30'))){_0x13067b[_0x5f73('0x18')]=qs[_0x5f73('0x18')](_0x1763a4['query'][_0x5f73('0x18')]);_0x13067b[_0x5f73('0x16')]=qs[_0x5f73('0x16')](_0x1763a4[_0x5f73('0x2a')]['offset']);}_0x13067b['order']=qs[_0x5f73('0x31')](_0x1763a4[_0x5f73('0x2a')][_0x5f73('0x31')]);_0x13067b['where']=qs['filters'](_['pick'](_0x1763a4[_0x5f73('0x2a')],_0x1ce806['filters']),_0x1e7eea);if(_0x1763a4[_0x5f73('0x2a')]['filter']){_0x13067b['where']=_[_0x5f73('0x32')](_0x13067b[_0x5f73('0x33')],{'$or':_['map'](_0x1e7eea,function(_0x2bc949){if(_0x2bc949[_0x5f73('0x27')]!==_0x5f73('0x34')){var _0x2df857={};_0x2df857[_0x2bc949[_0x5f73('0x22')]]={'$like':'%'+_0x1763a4[_0x5f73('0x2a')][_0x5f73('0x35')]+'%'};return _0x2df857;}})});}_0x13067b=_[_0x5f73('0x32')]({},_0x13067b,_0x1763a4[_0x5f73('0x36')]);var _0x250923={'where':_0x13067b[_0x5f73('0x33')]};return db[_0x5f73('0x37')][_0x5f73('0x19')](_0x250923)[_0x5f73('0x1f')](function(_0xfd5277){_0x4bc17f[_0x5f73('0x19')]=_0xfd5277;if(_0x1763a4['query'][_0x5f73('0x38')]){_0x13067b[_0x5f73('0x39')]=[{'all':!![]}];}return db[_0x5f73('0x37')][_0x5f73('0x3a')](_0x13067b);})[_0x5f73('0x1f')](function(_0x280e57){_0x4bc17f[_0x5f73('0x3b')]=_0x280e57;return _0x4bc17f;})[_0x5f73('0x1f')](respondWithFilteredResult(_0x455e58,_0x13067b))[_0x5f73('0x3c')](handleError(_0x455e58,null));};exports[_0x5f73('0x3d')]=function(_0x2ef800,_0x170cfc){var _0x219f8c={'raw':!![],'where':{'id':_0x2ef800[_0x5f73('0x3e')]['id']}},_0xba2af1={};_0xba2af1[_0x5f73('0x29')]=_[_0x5f73('0x3f')](db[_0x5f73('0x37')]['rawAttributes']);_0xba2af1['query']=_[_0x5f73('0x3f')](_0x2ef800['query']);_0xba2af1['filters']=_[_0x5f73('0x2c')](_0xba2af1[_0x5f73('0x29')],_0xba2af1[_0x5f73('0x2a')]);_0x219f8c['attributes']=_[_0x5f73('0x2c')](_0xba2af1['model'],qs[_0x5f73('0x2e')](_0x2ef800['query'][_0x5f73('0x2e')]));_0x219f8c[_0x5f73('0x2d')]=_0x219f8c[_0x5f73('0x2d')]['length']?_0x219f8c['attributes']:_0xba2af1[_0x5f73('0x29')];if(_0x2ef800[_0x5f73('0x2a')][_0x5f73('0x38')]){_0x219f8c[_0x5f73('0x39')]=[{'all':!![]}];}_0x219f8c=_['merge']({},_0x219f8c,_0x2ef800[_0x5f73('0x36')]);return db[_0x5f73('0x37')]['find'](_0x219f8c)[_0x5f73('0x1f')](handleEntityNotFound(_0x170cfc,null))[_0x5f73('0x1f')](respondWithResult(_0x170cfc,null))[_0x5f73('0x3c')](handleError(_0x170cfc,null));};exports[_0x5f73('0x40')]=function(_0x5051c3,_0x318ce8){return db['MailTransferReport'][_0x5f73('0x40')](_0x5051c3[_0x5f73('0x41')],{})['then'](respondWithResult(_0x318ce8,0xc9))[_0x5f73('0x3c')](handleError(_0x318ce8,null));};exports[_0x5f73('0x1e')]=function(_0x5d5a74,_0x1e39f2){if(_0x5d5a74[_0x5f73('0x41')]['id']){delete _0x5d5a74[_0x5f73('0x41')]['id'];}return db[_0x5f73('0x37')][_0x5f73('0x42')]({'where':{'id':_0x5d5a74['params']['id']}})[_0x5f73('0x1f')](handleEntityNotFound(_0x1e39f2,null))['then'](saveUpdates(_0x5d5a74['body'],null))[_0x5f73('0x1f')](respondWithResult(_0x1e39f2,null))[_0x5f73('0x3c')](handleError(_0x1e39f2,null));};exports[_0x5f73('0x43')]=function(_0xa8ebe1,_0x501a5d){return db[_0x5f73('0x37')][_0x5f73('0x42')]({'where':{'id':_0xa8ebe1[_0x5f73('0x3e')]['id']}})[_0x5f73('0x1f')](handleEntityNotFound(_0x501a5d,null))[_0x5f73('0x1f')](removeEntity(_0x501a5d,null))[_0x5f73('0x3c')](handleError(_0x501a5d,null));};exports[_0x5f73('0x44')]=function(_0x43c243,_0x1f9c76){return db[_0x5f73('0x37')][_0x5f73('0x44')]()[_0x5f73('0x1f')](respondWithResult(_0x1f9c76,null))[_0x5f73('0x3c')](handleError(_0x1f9c76,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 5ae77b2..7c8f9ee 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 _0x4849=['path','rimraf','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x212a37,_0xf35b2e){var _0x5d0bf9=function(_0x51850f){while(--_0x51850f){_0x212a37['push'](_0x212a37['shift']());}};_0x5d0bf9(++_0xf35b2e);}(_0x4849,0x86));var _0x9484=function(_0xbb1868,_0x19ea4a){_0xbb1868=_0xbb1868-0x0;var _0x1d0a70=_0x4849[_0xbb1868];return _0x1d0a70;};'use strict';var _=require(_0x9484('0x0'));var util=require(_0x9484('0x1'));var logger=require('../../config/logger')(_0x9484('0x2'));var moment=require(_0x9484('0x3'));var BPromise=require(_0x9484('0x4'));var rp=require(_0x9484('0x5'));var fs=require('fs');var path=require(_0x9484('0x6'));var rimraf=require(_0x9484('0x7'));var config=require(_0x9484('0x8'));var attributes=require('./mailTransferReport.attributes');module[_0x9484('0x9')]=function(_0x1b6819,_0x4d8ab1){return _0x1b6819[_0x9484('0xa')](_0x9484('0xb'),attributes,{'tableName':_0x9484('0xc'),'paranoid':![],'indexes':[{'name':_0x9484('0xd'),'fields':[_0x9484('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe4d9=['uniqueid','lodash','util','../../config/logger','moment','path','rimraf','./mailTransferReport.attributes','exports','define'];(function(_0x4ca022,_0x31c431){var _0x286898=function(_0x4c88b0){while(--_0x4c88b0){_0x4ca022['push'](_0x4ca022['shift']());}};_0x286898(++_0x31c431);}(_0xe4d9,0x141));var _0x9e4d=function(_0x387d35,_0x427177){_0x387d35=_0x387d35-0x0;var _0x1e1e5b=_0xe4d9[_0x387d35];return _0x1e1e5b;};'use strict';var _=require(_0x9e4d('0x0'));var util=require(_0x9e4d('0x1'));var logger=require(_0x9e4d('0x2'))('api');var moment=require(_0x9e4d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e4d('0x4'));var rimraf=require(_0x9e4d('0x5'));var config=require('../../config/environment');var attributes=require(_0x9e4d('0x6'));module[_0x9e4d('0x7')]=function(_0x5a4881,_0x493fb5){return _0x5a4881[_0x9e4d('0x8')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x9e4d('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index e1489e7..5e9051b 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 _0xf3dd=['rpc','../../config/environment','jayson/promise','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0xf34f78,_0x206922){var _0x5ea8b4=function(_0x2cb254){while(--_0x2cb254){_0xf34f78['push'](_0xf34f78['shift']());}};_0x5ea8b4(++_0x206922);}(_0xf3dd,0x92));var _0xdf3d=function(_0x4d1d3b,_0x358031){_0x4d1d3b=_0x4d1d3b-0x0;var _0x473905=_0xf3dd[_0x4d1d3b];return _0x473905;};'use strict';var _=require(_0xdf3d('0x0'));var util=require(_0xdf3d('0x1'));var moment=require(_0xdf3d('0x2'));var BPromise=require(_0xdf3d('0x3'));var rs=require(_0xdf3d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf3d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdf3d('0x6'));var config=require(_0xdf3d('0x7'));var jayson=require(_0xdf3d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1070ec,_0x5026a0,_0x183192){return new BPromise(function(_0x1fc27b,_0x43cd94){return client[_0xdf3d('0x9')](_0x1070ec,_0x183192)[_0xdf3d('0xa')](function(_0x18d8b3){logger[_0xdf3d('0xb')](_0xdf3d('0xc'),_0x5026a0,_0xdf3d('0xd'));logger['debug'](_0xdf3d('0xe'),_0x5026a0,'request\x20sent',JSON[_0xdf3d('0xf')](_0x18d8b3));if(_0x18d8b3['error']){if(_0x18d8b3[_0xdf3d('0x10')][_0xdf3d('0x11')]===0x1f4){logger[_0xdf3d('0x10')](_0xdf3d('0xc'),_0x5026a0,_0x18d8b3['error']['message']);return _0x43cd94(_0x18d8b3[_0xdf3d('0x10')][_0xdf3d('0x12')]);}logger[_0xdf3d('0x10')](_0xdf3d('0xc'),_0x5026a0,_0x18d8b3[_0xdf3d('0x10')][_0xdf3d('0x12')]);return _0x1fc27b(_0x18d8b3[_0xdf3d('0x10')]['message']);}else{logger[_0xdf3d('0xb')](_0xdf3d('0xc'),_0x5026a0,_0xdf3d('0xd'));_0x1fc27b(_0x18d8b3['result']['message']);}})['catch'](function(_0x2fc0ec){logger[_0xdf3d('0x10')](_0xdf3d('0xc'),_0x5026a0,_0x2fc0ec);_0x43cd94(_0x2fc0ec);});});} \ No newline at end of file +var _0x88ab=['MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4b9f5f,_0xb10fc0){var _0x29380a=function(_0x452c5e){while(--_0x452c5e){_0x4b9f5f['push'](_0x4b9f5f['shift']());}};_0x29380a(++_0xb10fc0);}(_0x88ab,0x194));var _0xb88a=function(_0x22a58b,_0x232830){_0x22a58b=_0x22a58b-0x0;var _0x26b203=_0x88ab[_0x22a58b];return _0x26b203;};'use strict';var _=require(_0xb88a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb88a('0x1'));var fs=require('fs');var Redis=require(_0xb88a('0x2'));var db=require(_0xb88a('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb88a('0x4'));var jayson=require(_0xb88a('0x5'));var client=jayson[_0xb88a('0x6')][_0xb88a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38ad3e,_0x5d39d5,_0x18409e){return new BPromise(function(_0x306b2d,_0x5ac6f8){return client['request'](_0x38ad3e,_0x18409e)[_0xb88a('0x8')](function(_0x365383){logger[_0xb88a('0x9')]('MailTransferReport,\x20%s,\x20%s',_0x5d39d5,'request\x20sent');logger[_0xb88a('0xa')](_0xb88a('0xb'),_0x5d39d5,_0xb88a('0xc'),JSON[_0xb88a('0xd')](_0x365383));if(_0x365383[_0xb88a('0xe')]){if(_0x365383[_0xb88a('0xe')][_0xb88a('0xf')]===0x1f4){logger['error'](_0xb88a('0x10'),_0x5d39d5,_0x365383[_0xb88a('0xe')][_0xb88a('0x11')]);return _0x5ac6f8(_0x365383[_0xb88a('0xe')][_0xb88a('0x11')]);}logger[_0xb88a('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x5d39d5,_0x365383[_0xb88a('0xe')][_0xb88a('0x11')]);return _0x306b2d(_0x365383[_0xb88a('0xe')][_0xb88a('0x11')]);}else{logger[_0xb88a('0x9')](_0xb88a('0x10'),_0x5d39d5,_0xb88a('0xc'));_0x306b2d(_0x365383[_0xb88a('0x12')][_0xb88a('0x11')]);}})[_0xb88a('0x13')](function(_0x4a163b){logger[_0xb88a('0xe')](_0xb88a('0x10'),_0x5d39d5,_0x4a163b);_0x5ac6f8(_0x4a163b);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 3939a9c..be407c5 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 _0x74d5=['/:id','show','post','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','isAuthenticated','index','get','describe'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x74d5,0x8b));var _0x574d=function(_0x1a3c28,_0x4d892e){_0x1a3c28=_0x1a3c28-0x0;var _0x259952=_0x74d5[_0x1a3c28];return _0x259952;};'use strict';var multer=require(_0x574d('0x0'));var util=require(_0x574d('0x1'));var path=require(_0x574d('0x2'));var timeout=require('connect-timeout');var express=require(_0x574d('0x3'));var router=express[_0x574d('0x4')]();var fs_extra=require(_0x574d('0x5'));var auth=require(_0x574d('0x6'));var interaction=require(_0x574d('0x7'));var config=require('../../config/environment');var controller=require(_0x574d('0x8'));router['get']('/',auth[_0x574d('0x9')](),controller[_0x574d('0xa')]);router[_0x574d('0xb')]('/describe',auth[_0x574d('0x9')](),controller[_0x574d('0xc')]);router[_0x574d('0xb')](_0x574d('0xd'),auth[_0x574d('0x9')](),controller[_0x574d('0xe')]);router[_0x574d('0xf')]('/',auth[_0x574d('0x9')](),controller['create']);router['put'](_0x574d('0xd'),auth[_0x574d('0x9')](),controller[_0x574d('0x10')]);router[_0x574d('0x11')](_0x574d('0xd'),auth[_0x574d('0x9')](),controller['destroy']);module[_0x574d('0x12')]=router; \ No newline at end of file +var _0xa4a6=['/describe','isAuthenticated','describe','/:id','create','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x1db4dc,_0x6b7259){var _0x244304=function(_0x5e22a3){while(--_0x5e22a3){_0x1db4dc['push'](_0x1db4dc['shift']());}};_0x244304(++_0x6b7259);}(_0xa4a6,0x8f));var _0x6a4a=function(_0x4084cc,_0x9c102c){_0x4084cc=_0x4084cc-0x0;var _0xd47d94=_0xa4a6[_0x4084cc];return _0xd47d94;};'use strict';var multer=require(_0x6a4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6a4a('0x1'));var express=require(_0x6a4a('0x2'));var router=express[_0x6a4a('0x3')]();var fs_extra=require(_0x6a4a('0x4'));var auth=require(_0x6a4a('0x5'));var interaction=require(_0x6a4a('0x6'));var config=require(_0x6a4a('0x7'));var controller=require('./memberReport.controller');router[_0x6a4a('0x8')]('/',auth['isAuthenticated'](),controller[_0x6a4a('0x9')]);router['get'](_0x6a4a('0xa'),auth[_0x6a4a('0xb')](),controller[_0x6a4a('0xc')]);router[_0x6a4a('0x8')](_0x6a4a('0xd'),auth[_0x6a4a('0xb')](),controller['show']);router['post']('/',auth[_0x6a4a('0xb')](),controller[_0x6a4a('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x6a4a('0xd'),auth['isAuthenticated'](),controller[_0x6a4a('0xf')]);module[_0x6a4a('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index ab38798..619372b 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 _0x714e=['getDataValue','enterAt','diff','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x3219cc,_0x50a602){var _0x480c96=function(_0x3c3bf2){while(--_0x3c3bf2){_0x3219cc['push'](_0x3219cc['shift']());}};_0x480c96(++_0x50a602);}(_0x714e,0xcc));var _0xe714=function(_0x568427,_0x742280){_0x568427=_0x568427-0x0;var _0x3c2f86=_0x714e[_0x568427];return _0x3c2f86;};'use strict';var Sequelize=require(_0xe714('0x0'));var moment=require('moment');module[_0xe714('0x1')]={'channel':{'type':Sequelize[_0xe714('0x2')]},'membername':{'type':Sequelize[_0xe714('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe714('0x2')],'defaultValue':_0xe714('0x3'),'comment':_0xe714('0x4')},'duration':{'type':Sequelize[_0xe714('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x44eeba){var _0x24c5b0=moment(_0x44eeba);var _0x54be19=moment(this[_0xe714('0x6')](_0xe714('0x7')));var _0x564be3=_0x24c5b0[_0xe714('0x8')](_0x54be19,'seconds');this['setDataValue']('exitAt',_0x44eeba);this[_0xe714('0x9')](_0xe714('0xa'),_0x564be3>=0x0?_0x564be3:null);}},'data1':{'type':Sequelize[_0xe714('0x2')],'comment':_0xe714('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0xe714('0xc')},'data3':{'type':Sequelize[_0xe714('0x2')],'comment':_0xe714('0xd')},'data4':{'type':Sequelize[_0xe714('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xe714('0x2')],'comment':_0xe714('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xe714('0x5')]},'uniqueid':{'type':Sequelize[_0xe714('0x2')]}}; \ No newline at end of file +var _0x3722=['seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','diff'];(function(_0x451748,_0x39cdfd){var _0x139cdb=function(_0x1f682f){while(--_0x1f682f){_0x451748['push'](_0x451748['shift']());}};_0x139cdb(++_0x39cdfd);}(_0x3722,0x171));var _0x2372=function(_0x391674,_0x7ed97b){_0x391674=_0x391674-0x0;var _0x306b2a=_0x3722[_0x391674];return _0x306b2a;};'use strict';var Sequelize=require(_0x2372('0x0'));var moment=require(_0x2372('0x1'));module[_0x2372('0x2')]={'channel':{'type':Sequelize[_0x2372('0x3')]},'membername':{'type':Sequelize[_0x2372('0x3')]},'interface':{'type':Sequelize[_0x2372('0x3')]},'type':{'type':Sequelize[_0x2372('0x3')],'defaultValue':_0x2372('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x2372('0x5')]},'enterAt':{'type':Sequelize[_0x2372('0x6')]},'exitAt':{'type':Sequelize[_0x2372('0x6')],'set':function(_0x1a7e9a){var _0x231ebe=moment(_0x1a7e9a);var _0x1b570d=moment(this[_0x2372('0x7')]('enterAt'));var _0x71561b=_0x231ebe[_0x2372('0x8')](_0x1b570d,_0x2372('0x9'));this[_0x2372('0xa')](_0x2372('0xb'),_0x1a7e9a);this['setDataValue'](_0x2372('0xc'),_0x71561b>=0x0?_0x71561b:null);}},'data1':{'type':Sequelize[_0x2372('0x3')],'comment':_0x2372('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0x2372('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0x2372('0xf')},'data4':{'type':Sequelize[_0x2372('0x3')],'comment':_0x2372('0x10')},'data5':{'type':Sequelize['STRING'],'comment':_0x2372('0x11')},'role':{'type':Sequelize[_0x2372('0x3')]},'internal':{'type':Sequelize[_0x2372('0x5')]},'uniqueid':{'type':Sequelize[_0x2372('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 8e57f15..a6ec5f7 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(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x34e8,0x12c));var _0x834e=function(_0x341f00,_0x5658f5){_0x341f00=_0x341f00-0x0;var _0x4b3f3d=_0x34e8[_0x341f00];return _0x4b3f3d;};'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 _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x77d76e,_0x106ed2){var _0x5620c8=function(_0x481b37){while(--_0x481b37){_0x77d76e['push'](_0x77d76e['shift']());}};_0x5620c8(++_0x106ed2);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 8ee7e5c..25c138e 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 _0x04f9=['bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername','interface','util','../../config/logger','api'];(function(_0x5f4488,_0x3e5788){var _0x5141cb=function(_0x4f2a13){while(--_0x4f2a13){_0x5f4488['push'](_0x5f4488['shift']());}};_0x5141cb(++_0x3e5788);}(_0x04f9,0xb3));var _0x904f=function(_0x27a381,_0x4780aa){_0x27a381=_0x27a381-0x0;var _0x42f82c=_0x04f9[_0x27a381];return _0x42f82c;};'use strict';var _=require('lodash');var util=require(_0x904f('0x0'));var logger=require(_0x904f('0x1'))(_0x904f('0x2'));var moment=require('moment');var BPromise=require(_0x904f('0x3'));var rp=require(_0x904f('0x4'));var fs=require('fs');var path=require(_0x904f('0x5'));var rimraf=require(_0x904f('0x6'));var config=require(_0x904f('0x7'));var attributes=require(_0x904f('0x8'));module['exports']=function(_0x4e5a0c,_0x2bcb2a){return _0x4e5a0c[_0x904f('0x9')](_0x904f('0xa'),attributes,{'tableName':_0x904f('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x904f('0xc'),_0x904f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf40e=['membername_interface','membername','api','moment','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member'];(function(_0x133f81,_0x550e62){var _0x2eef30=function(_0x48e9bf){while(--_0x48e9bf){_0x133f81['push'](_0x133f81['shift']());}};_0x2eef30(++_0x550e62);}(_0xf40e,0x1be));var _0xef40=function(_0x44bba3,_0x364cdb){_0x44bba3=_0x44bba3-0x0;var _0x40555e=_0xf40e[_0x44bba3];return _0x40555e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xef40('0x0'));var moment=require(_0xef40('0x1'));var BPromise=require('bluebird');var rp=require(_0xef40('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef40('0x3'));var config=require(_0xef40('0x4'));var attributes=require(_0xef40('0x5'));module[_0xef40('0x6')]=function(_0x183786,_0x5a628a){return _0x183786[_0xef40('0x7')](_0xef40('0x8'),attributes,{'tableName':_0xef40('0x9'),'paranoid':![],'indexes':[{'name':_0xef40('0xa'),'fields':[_0xef40('0xb'),'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 6b472ae..e3b738f 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 _0x6c14=['findAll','raw','where','options','attributes','limit','include','map','model','catch','create','CreateMemberReport','UpdateMemberReport','body','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','GetMemberReport','MemberReport'];(function(_0x302d79,_0x4df472){var _0xa7c5b8=function(_0x753c08){while(--_0x753c08){_0x302d79['push'](_0x302d79['shift']());}};_0xa7c5b8(++_0x4df472);}(_0x6c14,0xd1));var _0x46c1=function(_0x360122,_0x3d1b8c){_0x360122=_0x360122-0x0;var _0x431219=_0x6c14[_0x360122];return _0x431219;};'use strict';var _=require(_0x46c1('0x0'));var util=require(_0x46c1('0x1'));var moment=require(_0x46c1('0x2'));var BPromise=require(_0x46c1('0x3'));var rs=require(_0x46c1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46c1('0x5'))['db'];var utils=require(_0x46c1('0x6'));var logger=require(_0x46c1('0x7'))('rpc');var config=require(_0x46c1('0x8'));var jayson=require(_0x46c1('0x9'));var client=jayson[_0x46c1('0xa')][_0x46c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29b2d8,_0x10b22d,_0xfaf798){return new BPromise(function(_0x1277f7,_0x2997e1){return client['request'](_0x29b2d8,_0xfaf798)[_0x46c1('0xc')](function(_0x5f5b75){logger[_0x46c1('0xd')]('MemberReport,\x20%s,\x20%s',_0x10b22d,_0x46c1('0xe'));logger[_0x46c1('0xf')](_0x46c1('0x10'),_0x10b22d,'request\x20sent',JSON[_0x46c1('0x11')](_0x5f5b75));if(_0x5f5b75[_0x46c1('0x12')]){if(_0x5f5b75[_0x46c1('0x12')][_0x46c1('0x13')]===0x1f4){logger['error'](_0x46c1('0x14'),_0x10b22d,_0x5f5b75[_0x46c1('0x12')]['message']);return _0x2997e1(_0x5f5b75['error'][_0x46c1('0x15')]);}logger[_0x46c1('0x12')](_0x46c1('0x14'),_0x10b22d,_0x5f5b75[_0x46c1('0x12')][_0x46c1('0x15')]);return _0x1277f7(_0x5f5b75['error'][_0x46c1('0x15')]);}else{logger[_0x46c1('0xd')](_0x46c1('0x14'),_0x10b22d,_0x46c1('0xe'));_0x1277f7(_0x5f5b75[_0x46c1('0x16')]['message']);}})['catch'](function(_0x23e912){logger[_0x46c1('0x12')](_0x46c1('0x14'),_0x10b22d,_0x23e912);_0x2997e1(_0x23e912);});});}exports[_0x46c1('0x17')]=function(_0x466899){var _0xae104a=this;return new Promise(function(_0x2ec920,_0x4c42b8){return db[_0x46c1('0x18')][_0x46c1('0x19')]({'raw':_0x466899['options']?_0x466899['options'][_0x46c1('0x1a')]===undefined?!![]:![]:!![],'where':_0x466899['options']?_0x466899['options'][_0x46c1('0x1b')]||null:null,'attributes':_0x466899[_0x46c1('0x1c')]?_0x466899[_0x46c1('0x1c')][_0x46c1('0x1d')]||null:null,'limit':_0x466899[_0x46c1('0x1c')]?_0x466899[_0x46c1('0x1c')][_0x46c1('0x1e')]||null:null,'include':_0x466899[_0x46c1('0x1c')]?_0x466899[_0x46c1('0x1c')][_0x46c1('0x1f')]?_[_0x46c1('0x20')](_0x466899[_0x46c1('0x1c')][_0x46c1('0x1f')],function(_0x712eb8){return{'model':db[_0x712eb8[_0x46c1('0x21')]],'as':_0x712eb8['as'],'attributes':_0x712eb8[_0x46c1('0x1d')],'include':_0x712eb8[_0x46c1('0x1f')]?_[_0x46c1('0x20')](_0x712eb8[_0x46c1('0x1f')],function(_0x361c66){return{'model':db[_0x361c66[_0x46c1('0x21')]],'as':_0x361c66['as'],'attributes':_0x361c66[_0x46c1('0x1d')],'include':_0x361c66[_0x46c1('0x1f')]?_['map'](_0x361c66['include'],function(_0xa8b66e){return{'model':db[_0xa8b66e[_0x46c1('0x21')]],'as':_0xa8b66e['as'],'attributes':_0xa8b66e['attributes']};}):[]};}):[]};}):[]:[]})[_0x46c1('0xc')](function(_0xe710e8){logger[_0x46c1('0xd')](_0x46c1('0x17'),_0x466899);logger[_0x46c1('0xf')](_0x46c1('0x17'),_0x466899,JSON['stringify'](_0xe710e8));_0x2ec920(_0xe710e8);})[_0x46c1('0x22')](function(_0x4475f7){logger[_0x46c1('0x12')](_0x46c1('0x17'),_0x4475f7[_0x46c1('0x15')],_0x466899);_0x4c42b8(_0xae104a[_0x46c1('0x12')](0x1f4,_0x4475f7[_0x46c1('0x15')]));});});};exports['CreateMemberReport']=function(_0xb33e57){var _0x5448f4=this;return new Promise(function(_0x18072d,_0x1a3c5a){return db[_0x46c1('0x18')][_0x46c1('0x23')](_0xb33e57['body'],{'raw':_0xb33e57['options']?_0xb33e57[_0x46c1('0x1c')][_0x46c1('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x666a49){logger[_0x46c1('0xd')](_0x46c1('0x24'),_0xb33e57);logger[_0x46c1('0xf')]('CreateMemberReport',_0xb33e57,JSON[_0x46c1('0x11')](_0x666a49));_0x18072d(_0x666a49);})[_0x46c1('0x22')](function(_0x5d5074){logger[_0x46c1('0x12')]('CreateMemberReport',_0x5d5074[_0x46c1('0x15')],_0xb33e57);_0x1a3c5a(_0x5448f4[_0x46c1('0x12')](0x1f4,_0x5d5074[_0x46c1('0x15')]));});});};exports[_0x46c1('0x25')]=function(_0x2a7212){var _0xccf843=this;return new Promise(function(_0x4e2b14,_0x50e68c){return db[_0x46c1('0x18')]['update'](_0x2a7212[_0x46c1('0x26')],{'raw':_0x2a7212['options']?_0x2a7212['options'][_0x46c1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a7212[_0x46c1('0x1c')]?_0x2a7212[_0x46c1('0x1c')]['where']||null:null,'attributes':_0x2a7212[_0x46c1('0x1c')]?_0x2a7212[_0x46c1('0x1c')][_0x46c1('0x1d')]||null:null,'limit':_0x2a7212['options']?_0x2a7212[_0x46c1('0x1c')][_0x46c1('0x1e')]||null:null})[_0x46c1('0xc')](function(_0x20f23d){logger[_0x46c1('0xd')](_0x46c1('0x25'),_0x2a7212);logger[_0x46c1('0xf')](_0x46c1('0x25'),_0x2a7212,JSON[_0x46c1('0x11')](_0x20f23d));_0x4e2b14(_0x20f23d);})['catch'](function(_0xcb59ca){logger[_0x46c1('0x12')](_0x46c1('0x25'),_0xcb59ca[_0x46c1('0x15')],_0x2a7212);_0x50e68c(_0xccf843[_0x46c1('0x12')](0x1f4,_0xcb59ca[_0x46c1('0x15')]));});});}; \ No newline at end of file +var _0x280b=['create','update','body','where','UpdateMemberReport','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','map','include','model','debug','CreateMemberReport'];(function(_0x485d0a,_0xe5bbc1){var _0x49d784=function(_0x485aa6){while(--_0x485aa6){_0x485d0a['push'](_0x485d0a['shift']());}};_0x49d784(++_0xe5bbc1);}(_0x280b,0xce));var _0xb280=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x280b[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xb280('0x0'));var util=require(_0xb280('0x1'));var moment=require('moment');var BPromise=require(_0xb280('0x2'));var rs=require(_0xb280('0x3'));var fs=require('fs');var Redis=require(_0xb280('0x4'));var db=require(_0xb280('0x5'))['db'];var utils=require(_0xb280('0x6'));var logger=require(_0xb280('0x7'))(_0xb280('0x8'));var config=require(_0xb280('0x9'));var jayson=require(_0xb280('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43e0ee,_0x27474c,_0x5c98b9){return new BPromise(function(_0x12433f,_0xab1fa7){return client[_0xb280('0xb')](_0x43e0ee,_0x5c98b9)[_0xb280('0xc')](function(_0x2322ff){logger[_0xb280('0xd')](_0xb280('0xe'),_0x27474c,'request\x20sent');logger['debug'](_0xb280('0xf'),_0x27474c,_0xb280('0x10'),JSON['stringify'](_0x2322ff));if(_0x2322ff[_0xb280('0x11')]){if(_0x2322ff[_0xb280('0x11')][_0xb280('0x12')]===0x1f4){logger[_0xb280('0x11')](_0xb280('0xe'),_0x27474c,_0x2322ff[_0xb280('0x11')][_0xb280('0x13')]);return _0xab1fa7(_0x2322ff[_0xb280('0x11')][_0xb280('0x13')]);}logger[_0xb280('0x11')](_0xb280('0xe'),_0x27474c,_0x2322ff[_0xb280('0x11')][_0xb280('0x13')]);return _0x12433f(_0x2322ff[_0xb280('0x11')][_0xb280('0x13')]);}else{logger[_0xb280('0xd')](_0xb280('0xe'),_0x27474c,'request\x20sent');_0x12433f(_0x2322ff[_0xb280('0x14')]['message']);}})[_0xb280('0x15')](function(_0x17be3b){logger['error'](_0xb280('0xe'),_0x27474c,_0x17be3b);_0xab1fa7(_0x17be3b);});});}exports[_0xb280('0x16')]=function(_0x110bcb){var _0x38d5d8=this;return new Promise(function(_0x2c5273,_0x43abc7){return db[_0xb280('0x17')][_0xb280('0x18')]({'raw':_0x110bcb[_0xb280('0x19')]?_0x110bcb[_0xb280('0x19')][_0xb280('0x1a')]===undefined?!![]:![]:!![],'where':_0x110bcb['options']?_0x110bcb[_0xb280('0x19')]['where']||null:null,'attributes':_0x110bcb[_0xb280('0x19')]?_0x110bcb[_0xb280('0x19')][_0xb280('0x1b')]||null:null,'limit':_0x110bcb[_0xb280('0x19')]?_0x110bcb[_0xb280('0x19')][_0xb280('0x1c')]||null:null,'include':_0x110bcb[_0xb280('0x19')]?_0x110bcb[_0xb280('0x19')]['include']?_[_0xb280('0x1d')](_0x110bcb[_0xb280('0x19')][_0xb280('0x1e')],function(_0x5a1e08){return{'model':db[_0x5a1e08['model']],'as':_0x5a1e08['as'],'attributes':_0x5a1e08[_0xb280('0x1b')],'include':_0x5a1e08['include']?_['map'](_0x5a1e08['include'],function(_0x1bda8e){return{'model':db[_0x1bda8e[_0xb280('0x1f')]],'as':_0x1bda8e['as'],'attributes':_0x1bda8e[_0xb280('0x1b')],'include':_0x1bda8e[_0xb280('0x1e')]?_[_0xb280('0x1d')](_0x1bda8e['include'],function(_0x3cf460){return{'model':db[_0x3cf460[_0xb280('0x1f')]],'as':_0x3cf460['as'],'attributes':_0x3cf460[_0xb280('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb280('0xc')](function(_0x54ae51){logger['info'](_0xb280('0x16'),_0x110bcb);logger[_0xb280('0x20')](_0xb280('0x16'),_0x110bcb,JSON['stringify'](_0x54ae51));_0x2c5273(_0x54ae51);})[_0xb280('0x15')](function(_0x25c8e9){logger['error'](_0xb280('0x16'),_0x25c8e9[_0xb280('0x13')],_0x110bcb);_0x43abc7(_0x38d5d8[_0xb280('0x11')](0x1f4,_0x25c8e9[_0xb280('0x13')]));});});};exports[_0xb280('0x21')]=function(_0x45b948){var _0x1c6002=this;return new Promise(function(_0x22b658,_0xc077c){return db['MemberReport'][_0xb280('0x22')](_0x45b948['body'],{'raw':_0x45b948['options']?_0x45b948['options'][_0xb280('0x1a')]===undefined?!![]:![]:!![]})[_0xb280('0xc')](function(_0x59344d){logger['info'](_0xb280('0x21'),_0x45b948);logger[_0xb280('0x20')](_0xb280('0x21'),_0x45b948,JSON['stringify'](_0x59344d));_0x22b658(_0x59344d);})['catch'](function(_0x32c14f){logger[_0xb280('0x11')](_0xb280('0x21'),_0x32c14f['message'],_0x45b948);_0xc077c(_0x1c6002[_0xb280('0x11')](0x1f4,_0x32c14f['message']));});});};exports['UpdateMemberReport']=function(_0x25fe44){var _0x553e9a=this;return new Promise(function(_0x131171,_0x28c4f3){return db[_0xb280('0x17')][_0xb280('0x23')](_0x25fe44[_0xb280('0x24')],{'raw':_0x25fe44['options']?_0x25fe44['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25fe44[_0xb280('0x19')]?_0x25fe44['options'][_0xb280('0x25')]||null:null,'attributes':_0x25fe44[_0xb280('0x19')]?_0x25fe44['options']['attributes']||null:null,'limit':_0x25fe44['options']?_0x25fe44[_0xb280('0x19')][_0xb280('0x1c')]||null:null})[_0xb280('0xc')](function(_0x4f1642){logger[_0xb280('0xd')](_0xb280('0x26'),_0x25fe44);logger[_0xb280('0x20')](_0xb280('0x26'),_0x25fe44,JSON[_0xb280('0x27')](_0x4f1642));_0x131171(_0x4f1642);})[_0xb280('0x15')](function(_0x1b6868){logger['error'](_0xb280('0x26'),_0x1b6868['message'],_0x25fe44);_0x28c4f3(_0x553e9a['error'](0x1f4,_0x1b6868['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index b618da2..254971b 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 _0x2202=['index','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./migration.controller'];(function(_0x489f9d,_0x564461){var _0x4a0050=function(_0x4bf35c){while(--_0x4bf35c){_0x489f9d['push'](_0x489f9d['shift']());}};_0x4a0050(++_0x564461);}(_0x2202,0xab));var _0x2220=function(_0x51d32c,_0x18c817){_0x51d32c=_0x51d32c-0x0;var _0x58be79=_0x2202[_0x51d32c];return _0x58be79;};'use strict';var multer=require(_0x2220('0x0'));var util=require(_0x2220('0x1'));var path=require(_0x2220('0x2'));var timeout=require(_0x2220('0x3'));var express=require(_0x2220('0x4'));var router=express[_0x2220('0x5')]();var fs_extra=require(_0x2220('0x6'));var auth=require(_0x2220('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2220('0x8'));router['get']('/',controller[_0x2220('0x9')]);module['exports']=router; \ No newline at end of file +var _0xd619=['index','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./migration.controller','get'];(function(_0x1dc3e1,_0xbf0f2){var _0x200631=function(_0x5378bd){while(--_0x5378bd){_0x1dc3e1['push'](_0x1dc3e1['shift']());}};_0x200631(++_0xbf0f2);}(_0xd619,0x18e));var _0x9d61=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xd619[_0x39e283];return _0x7de89f;};'use strict';var multer=require(_0x9d61('0x0'));var util=require(_0x9d61('0x1'));var path=require(_0x9d61('0x2'));var timeout=require(_0x9d61('0x3'));var express=require(_0x9d61('0x4'));var router=express[_0x9d61('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9d61('0x6'));var interaction=require(_0x9d61('0x7'));var config=require('../../config/environment');var controller=require(_0x9d61('0x8'));router[_0x9d61('0x9')]('/',controller[_0x9d61('0xa')]);module[_0x9d61('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 99afda2..33dbbe4 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 _0x05dc=['version','exports','STRING'];(function(_0x13134f,_0xffe6f2){var _0x160f40=function(_0x5e0b9e){while(--_0x5e0b9e){_0x13134f['push'](_0x13134f['shift']());}};_0x160f40(++_0xffe6f2);}(_0x05dc,0x127));var _0xc05d=function(_0x49a456,_0x76c6d6){_0x49a456=_0x49a456-0x0;var _0x5818aa=_0x05dc[_0x49a456];return _0x5818aa;};'use strict';var Sequelize=require('sequelize');module[_0xc05d('0x0')]={'version':{'type':Sequelize[_0xc05d('0x1')],'unique':_0xc05d('0x2')}}; \ No newline at end of file +var _0x1268=['version','sequelize','STRING'];(function(_0x1f5661,_0x32a642){var _0x34ba03=function(_0x2ae5c7){while(--_0x2ae5c7){_0x1f5661['push'](_0x1f5661['shift']());}};_0x34ba03(++_0x32a642);}(_0x1268,0x151));var _0x8126=function(_0x3a410d,_0x12b97d){_0x3a410d=_0x3a410d-0x0;var _0x2f6097=_0x1268[_0x3a410d];return _0x2f6097;};'use strict';var Sequelize=require(_0x8126('0x0'));module['exports']={'version':{'type':Sequelize[_0x8126('0x1')],'unique':_0x8126('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 6a1084b..88a0a64 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 _0x4f6b=['name','index','map','Migration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','apply','reject','save','update','then','sendStatus','stack'];(function(_0x333d99,_0x87dd42){var _0x41c679=function(_0xae20f){while(--_0xae20f){_0x333d99['push'](_0x333d99['shift']());}};_0x41c679(++_0x87dd42);}(_0x4f6b,0x15a));var _0xb4f6=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x4f6b[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0xb4f6('0x0'));var rimraf=require(_0xb4f6('0x1'));var zipdir=require(_0xb4f6('0x2'));var jsonpatch=require(_0xb4f6('0x3'));var rp=require('request-promise');var moment=require(_0xb4f6('0x4'));var BPromise=require(_0xb4f6('0x5'));var Mustache=require('mustache');var util=require(_0xb4f6('0x6'));var path=require(_0xb4f6('0x7'));var sox=require(_0xb4f6('0x8'));var csv=require(_0xb4f6('0x9'));var ejs=require(_0xb4f6('0xa'));var fs=require('fs');var fs_extra=require(_0xb4f6('0xb'));var _=require(_0xb4f6('0xc'));var squel=require(_0xb4f6('0xd'));var crypto=require(_0xb4f6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb4f6('0xf'));var toCsv=require(_0xb4f6('0x9'));var querystring=require(_0xb4f6('0x10'));var Papa=require(_0xb4f6('0x11'));var Redis=require('ioredis');var authService=require(_0xb4f6('0x12'));var qs=require(_0xb4f6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4f6('0x14'));var logger=require(_0xb4f6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xb4f6('0x16'));var licenseUtil=require(_0xb4f6('0x17'));var db=require(_0xb4f6('0x18'))['db'];function respondWithStatusCode(_0x575ae0,_0x5be2d1){_0x5be2d1=_0x5be2d1||0xcc;return function(_0x44b4c0){if(_0x44b4c0){return _0x575ae0['sendStatus'](_0x5be2d1);}return _0x575ae0['status'](_0x5be2d1)[_0xb4f6('0x19')]();};}function respondWithResult(_0x3c3344,_0x504deb){_0x504deb=_0x504deb||0xc8;return function(_0x3a9f35){if(_0x3a9f35){return _0x3c3344[_0xb4f6('0x1a')](_0x504deb)[_0xb4f6('0x1b')](_0x3a9f35);}};}function respondWithFilteredResult(_0x240597,_0x1c714e){return function(_0x3b9532){if(_0x3b9532){var _0x5e6b8a=typeof _0x1c714e[_0xb4f6('0x1c')]===_0xb4f6('0x1d')&&typeof _0x1c714e[_0xb4f6('0x1e')]===_0xb4f6('0x1d');var _0x462e4f=_0x3b9532['count'];var _0x46293c=_0x5e6b8a?0x0:_0x1c714e[_0xb4f6('0x1c')];var _0x227d5a=_0x5e6b8a?_0x3b9532['count']:_0x1c714e[_0xb4f6('0x1c')]+_0x1c714e['limit'];var _0x3cc659;if(_0x227d5a>=_0x462e4f){_0x227d5a=_0x462e4f;_0x3cc659=0xc8;}else{_0x3cc659=0xce;}_0x240597[_0xb4f6('0x1a')](_0x3cc659);return _0x240597['set']('Content-Range',_0x46293c+'-'+_0x227d5a+'/'+_0x462e4f)[_0xb4f6('0x1b')](_0x3b9532);}return null;};}function patchUpdates(_0x487411){return function(_0x18be56){try{jsonpatch[_0xb4f6('0x1f')](_0x18be56,_0x487411,!![]);}catch(_0x9a9975){return BPromise[_0xb4f6('0x20')](_0x9a9975);}return _0x18be56[_0xb4f6('0x21')]();};}function saveUpdates(_0xc89b81,_0x4b77f7){return function(_0x5ce040){if(_0x5ce040){return _0x5ce040[_0xb4f6('0x22')](_0xc89b81)[_0xb4f6('0x23')](function(_0x487900){return _0x487900;});}return null;};}function removeEntity(_0x3ad119,_0x3db8e7){return function(_0x2b482b){if(_0x2b482b){return _0x2b482b['destroy']()[_0xb4f6('0x23')](function(){_0x3ad119['status'](0xcc)[_0xb4f6('0x19')]();});}};}function handleEntityNotFound(_0x37a15c,_0x264734){return function(_0x55430c){if(!_0x55430c){_0x37a15c[_0xb4f6('0x24')](0x194);}return _0x55430c;};}function handleError(_0x33ffbe,_0x9a32ba){_0x9a32ba=_0x9a32ba||0x1f4;return function(_0x384797){logger['error'](_0x384797[_0xb4f6('0x25')]);if(_0x384797[_0xb4f6('0x26')]){delete _0x384797[_0xb4f6('0x26')];}_0x33ffbe[_0xb4f6('0x1a')](_0x9a32ba)['send'](_0x384797);};}exports[_0xb4f6('0x27')]=function(_0x4ec123,_0x419b27){var _0x4b0e35={},_0x2fc002={},_0x32e872={'count':0x0,'rows':[]};var _0x626db2=_[_0xb4f6('0x28')](db[_0xb4f6('0x29')][_0xb4f6('0x2a')],function(_0x269295){return{'name':_0x269295[_0xb4f6('0x2b')],'type':_0x269295[_0xb4f6('0x2c')][_0xb4f6('0x2d')]};});_0x2fc002[_0xb4f6('0x2e')]=_[_0xb4f6('0x28')](_0x626db2,_0xb4f6('0x26'));_0x2fc002['query']=_[_0xb4f6('0x2f')](_0x4ec123[_0xb4f6('0x30')]);_0x2fc002[_0xb4f6('0x31')]=_[_0xb4f6('0x32')](_0x2fc002[_0xb4f6('0x2e')],_0x2fc002[_0xb4f6('0x30')]);_0x4b0e35[_0xb4f6('0x33')]=_[_0xb4f6('0x32')](_0x2fc002[_0xb4f6('0x2e')],qs[_0xb4f6('0x34')](_0x4ec123[_0xb4f6('0x30')][_0xb4f6('0x34')]));_0x4b0e35[_0xb4f6('0x33')]=_0x4b0e35[_0xb4f6('0x33')][_0xb4f6('0x35')]?_0x4b0e35[_0xb4f6('0x33')]:_0x2fc002[_0xb4f6('0x2e')];if(!_0x4ec123[_0xb4f6('0x30')]['hasOwnProperty']('nolimit')){_0x4b0e35[_0xb4f6('0x1e')]=qs[_0xb4f6('0x1e')](_0x4ec123['query']['limit']);_0x4b0e35[_0xb4f6('0x1c')]=qs[_0xb4f6('0x1c')](_0x4ec123[_0xb4f6('0x30')][_0xb4f6('0x1c')]);}_0x4b0e35['order']=qs[_0xb4f6('0x36')](_0x4ec123[_0xb4f6('0x30')][_0xb4f6('0x36')]);_0x4b0e35[_0xb4f6('0x37')]=qs[_0xb4f6('0x31')](_[_0xb4f6('0x38')](_0x4ec123[_0xb4f6('0x30')],_0x2fc002[_0xb4f6('0x31')]),_0x626db2);if(_0x4ec123[_0xb4f6('0x30')][_0xb4f6('0x39')]){_0x4b0e35[_0xb4f6('0x37')]=_[_0xb4f6('0x3a')](_0x4b0e35['where'],{'$or':_[_0xb4f6('0x28')](_0x626db2,function(_0x1e9ddf){if(_0x1e9ddf[_0xb4f6('0x2c')]!==_0xb4f6('0x3b')){var _0x4de2c3={};_0x4de2c3[_0x1e9ddf['name']]={'$like':'%'+_0x4ec123[_0xb4f6('0x30')][_0xb4f6('0x39')]+'%'};return _0x4de2c3;}})});}_0x4b0e35=_['merge']({},_0x4b0e35,_0x4ec123[_0xb4f6('0x3c')]);var _0x1d3dd0={'where':_0x4b0e35[_0xb4f6('0x37')]};return db[_0xb4f6('0x29')][_0xb4f6('0x3d')](_0x1d3dd0)[_0xb4f6('0x23')](function(_0x3d2c31){_0x32e872[_0xb4f6('0x3d')]=_0x3d2c31;if(_0x4ec123[_0xb4f6('0x30')][_0xb4f6('0x3e')]){_0x4b0e35['include']=[{'all':!![]}];}return db[_0xb4f6('0x29')][_0xb4f6('0x3f')](_0x4b0e35);})[_0xb4f6('0x23')](function(_0x2ab02c){_0x32e872['rows']=_0x2ab02c;return _0x32e872;})['then'](respondWithFilteredResult(_0x419b27,_0x4b0e35))['catch'](handleError(_0x419b27,null));}; \ No newline at end of file +var _0xe680=['name','index','map','Migration','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','type','options','include','catch','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error'];(function(_0x990b1,_0x3142e9){var _0x1245c8=function(_0x5051ee){while(--_0x5051ee){_0x990b1['push'](_0x990b1['shift']());}};_0x1245c8(++_0x3142e9);}(_0xe680,0xcf));var _0x0e68=function(_0x593941,_0x54b080){_0x593941=_0x593941-0x0;var _0x292692=_0xe680[_0x593941];return _0x292692;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e68('0x0'));var zipdir=require(_0x0e68('0x1'));var jsonpatch=require(_0x0e68('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0e68('0x3'));var Mustache=require(_0x0e68('0x4'));var util=require(_0x0e68('0x5'));var path=require(_0x0e68('0x6'));var sox=require(_0x0e68('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e68('0x8'));var _=require(_0x0e68('0x9'));var squel=require(_0x0e68('0xa'));var crypto=require(_0x0e68('0xb'));var jsforce=require(_0x0e68('0xc'));var deskjs=require(_0x0e68('0xd'));var toCsv=require(_0x0e68('0xe'));var querystring=require(_0x0e68('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0e68('0x10'));var qs=require(_0x0e68('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e68('0x12'));var logger=require(_0x0e68('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x0e68('0x14'));var licenseUtil=require(_0x0e68('0x15'));var db=require(_0x0e68('0x16'))['db'];function respondWithStatusCode(_0x44eca6,_0x29a8e6){_0x29a8e6=_0x29a8e6||0xcc;return function(_0xe787ef){if(_0xe787ef){return _0x44eca6['sendStatus'](_0x29a8e6);}return _0x44eca6[_0x0e68('0x17')](_0x29a8e6)[_0x0e68('0x18')]();};}function respondWithResult(_0x59f3c0,_0xe2b7fb){_0xe2b7fb=_0xe2b7fb||0xc8;return function(_0x36044b){if(_0x36044b){return _0x59f3c0['status'](_0xe2b7fb)[_0x0e68('0x19')](_0x36044b);}};}function respondWithFilteredResult(_0x8328ac,_0x19a348){return function(_0x38bc61){if(_0x38bc61){var _0x76c67c=typeof _0x19a348[_0x0e68('0x1a')]===_0x0e68('0x1b')&&typeof _0x19a348[_0x0e68('0x1c')]===_0x0e68('0x1b');var _0x2d8c20=_0x38bc61[_0x0e68('0x1d')];var _0xd9c9ff=_0x76c67c?0x0:_0x19a348[_0x0e68('0x1a')];var _0x2bf614=_0x76c67c?_0x38bc61[_0x0e68('0x1d')]:_0x19a348[_0x0e68('0x1a')]+_0x19a348[_0x0e68('0x1c')];var _0x2425d6;if(_0x2bf614>=_0x2d8c20){_0x2bf614=_0x2d8c20;_0x2425d6=0xc8;}else{_0x2425d6=0xce;}_0x8328ac['status'](_0x2425d6);return _0x8328ac['set'](_0x0e68('0x1e'),_0xd9c9ff+'-'+_0x2bf614+'/'+_0x2d8c20)[_0x0e68('0x19')](_0x38bc61);}return null;};}function patchUpdates(_0x2a8ab1){return function(_0x45e15d){try{jsonpatch[_0x0e68('0x1f')](_0x45e15d,_0x2a8ab1,!![]);}catch(_0x230b8f){return BPromise[_0x0e68('0x20')](_0x230b8f);}return _0x45e15d[_0x0e68('0x21')]();};}function saveUpdates(_0x5156c5,_0x6dc3c){return function(_0xc85e0c){if(_0xc85e0c){return _0xc85e0c['update'](_0x5156c5)[_0x0e68('0x22')](function(_0x212570){return _0x212570;});}return null;};}function removeEntity(_0x526a91,_0x51fcb5){return function(_0x260abf){if(_0x260abf){return _0x260abf[_0x0e68('0x23')]()[_0x0e68('0x22')](function(){_0x526a91[_0x0e68('0x17')](0xcc)[_0x0e68('0x18')]();});}};}function handleEntityNotFound(_0x40ba2a,_0x41553c){return function(_0x3ab319){if(!_0x3ab319){_0x40ba2a['sendStatus'](0x194);}return _0x3ab319;};}function handleError(_0x1209fc,_0x22a7c3){_0x22a7c3=_0x22a7c3||0x1f4;return function(_0x1fd000){logger[_0x0e68('0x24')](_0x1fd000['stack']);if(_0x1fd000[_0x0e68('0x25')]){delete _0x1fd000['name'];}_0x1209fc[_0x0e68('0x17')](_0x22a7c3)['send'](_0x1fd000);};}exports[_0x0e68('0x26')]=function(_0x457e25,_0x359f3a){var _0x5d945c={},_0xff1288={},_0x437fae={'count':0x0,'rows':[]};var _0x5179e1=_[_0x0e68('0x27')](db[_0x0e68('0x28')]['rawAttributes'],function(_0x1d22d4){return{'name':_0x1d22d4[_0x0e68('0x29')],'type':_0x1d22d4['type']['key']};});_0xff1288['model']=_['map'](_0x5179e1,_0x0e68('0x25'));_0xff1288[_0x0e68('0x2a')]=_[_0x0e68('0x2b')](_0x457e25[_0x0e68('0x2a')]);_0xff1288['filters']=_[_0x0e68('0x2c')](_0xff1288[_0x0e68('0x2d')],_0xff1288[_0x0e68('0x2a')]);_0x5d945c[_0x0e68('0x2e')]=_[_0x0e68('0x2c')](_0xff1288[_0x0e68('0x2d')],qs[_0x0e68('0x2f')](_0x457e25['query'][_0x0e68('0x2f')]));_0x5d945c[_0x0e68('0x2e')]=_0x5d945c['attributes'][_0x0e68('0x30')]?_0x5d945c[_0x0e68('0x2e')]:_0xff1288[_0x0e68('0x2d')];if(!_0x457e25[_0x0e68('0x2a')][_0x0e68('0x31')]('nolimit')){_0x5d945c[_0x0e68('0x1c')]=qs[_0x0e68('0x1c')](_0x457e25['query'][_0x0e68('0x1c')]);_0x5d945c[_0x0e68('0x1a')]=qs[_0x0e68('0x1a')](_0x457e25[_0x0e68('0x2a')][_0x0e68('0x1a')]);}_0x5d945c[_0x0e68('0x32')]=qs[_0x0e68('0x33')](_0x457e25['query']['sort']);_0x5d945c['where']=qs[_0x0e68('0x34')](_[_0x0e68('0x35')](_0x457e25['query'],_0xff1288[_0x0e68('0x34')]),_0x5179e1);if(_0x457e25[_0x0e68('0x2a')][_0x0e68('0x36')]){_0x5d945c[_0x0e68('0x37')]=_[_0x0e68('0x38')](_0x5d945c['where'],{'$or':_[_0x0e68('0x27')](_0x5179e1,function(_0x1c96cc){if(_0x1c96cc[_0x0e68('0x39')]!=='VIRTUAL'){var _0xc705e6={};_0xc705e6[_0x1c96cc[_0x0e68('0x25')]]={'$like':'%'+_0x457e25['query'][_0x0e68('0x36')]+'%'};return _0xc705e6;}})});}_0x5d945c=_[_0x0e68('0x38')]({},_0x5d945c,_0x457e25[_0x0e68('0x3a')]);var _0x166d71={'where':_0x5d945c[_0x0e68('0x37')]};return db[_0x0e68('0x28')][_0x0e68('0x1d')](_0x166d71)['then'](function(_0x424e64){_0x437fae[_0x0e68('0x1d')]=_0x424e64;if(_0x457e25['query']['includeAll']){_0x5d945c[_0x0e68('0x3b')]=[{'all':!![]}];}return db[_0x0e68('0x28')]['findAll'](_0x5d945c);})[_0x0e68('0x22')](function(_0x59e57b){_0x437fae['rows']=_0x59e57b;return _0x437fae;})[_0x0e68('0x22')](respondWithFilteredResult(_0x359f3a,_0x5d945c))[_0x0e68('0x3c')](handleError(_0x359f3a,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index a33a5d0..da64598 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 _0x7e3c=['../../config/environment','./migration.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x7e3c,0xb8));var _0xc7e3=function(_0x36b22b,_0x589e80){_0x36b22b=_0x36b22b-0x0;var _0x2ad385=_0x7e3c[_0x36b22b];return _0x2ad385;};'use strict';var _=require(_0xc7e3('0x0'));var util=require(_0xc7e3('0x1'));var logger=require(_0xc7e3('0x2'))(_0xc7e3('0x3'));var moment=require(_0xc7e3('0x4'));var BPromise=require(_0xc7e3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7e3('0x6'));var rimraf=require(_0xc7e3('0x7'));var config=require(_0xc7e3('0x8'));var attributes=require(_0xc7e3('0x9'));module[_0xc7e3('0xa')]=function(_0x540f1c,_0x295317){return _0x540f1c[_0xc7e3('0xb')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f56=['Migration','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5841db,_0xe7b5db){var _0x2c3bda=function(_0x18b8fa){while(--_0x18b8fa){_0x5841db['push'](_0x5841db['shift']());}};_0x2c3bda(++_0xe7b5db);}(_0x1f56,0x169));var _0x61f5=function(_0x5d6b09,_0x33ee25){_0x5d6b09=_0x5d6b09-0x0;var _0x2adcef=_0x1f56[_0x5d6b09];return _0x2adcef;};'use strict';var _=require(_0x61f5('0x0'));var util=require(_0x61f5('0x1'));var logger=require(_0x61f5('0x2'))('api');var moment=require(_0x61f5('0x3'));var BPromise=require(_0x61f5('0x4'));var rp=require(_0x61f5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61f5('0x6'));var config=require(_0x61f5('0x7'));var attributes=require('./migration.attributes');module['exports']=function(_0x399ddb,_0x352591){return _0x399ddb['define'](_0x61f5('0x8'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 787cfd9..5981805 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 _0xbfcc=['Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','info'];(function(_0xb1fa2c,_0x3479af){var _0x3a9890=function(_0x5dc537){while(--_0x5dc537){_0xb1fa2c['push'](_0xb1fa2c['shift']());}};_0x3a9890(++_0x3479af);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xbfcc[_0x2f5a22];return _0x326b70;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbfc('0x1'));var rs=require(_0xcbfc('0x2'));var fs=require('fs');var Redis=require(_0xcbfc('0x3'));var db=require(_0xcbfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcbfc('0x5'));var client=jayson[_0xcbfc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3917,_0x5a2be0,_0x2ea130){return new BPromise(function(_0x1f8b71,_0x1b1377){return client[_0xcbfc('0x7')](_0x1b3917,_0x2ea130)['then'](function(_0x2e7097){logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));logger[_0xcbfc('0xb')](_0xcbfc('0xc'),_0x5a2be0,'request\x20sent',JSON[_0xcbfc('0xd')](_0x2e7097));if(_0x2e7097[_0xcbfc('0xe')]){if(_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0xf')]===0x1f4){logger[_0xcbfc('0xe')]('Migration,\x20%s,\x20%s',_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1b1377(_0x2e7097[_0xcbfc('0xe')]['message']);}logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1f8b71(_0x2e7097[_0xcbfc('0xe')]['message']);}else{logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));_0x1f8b71(_0x2e7097[_0xcbfc('0x11')]['message']);}})['catch'](function(_0x418f18){logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x418f18);_0x1b1377(_0x418f18);});});} \ No newline at end of file +var _0x263f=['client','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x263f,0x182));var _0xf263=function(_0x51a25d,_0x3a6082){_0x51a25d=_0x51a25d-0x0;var _0x17bfb2=_0x263f[_0x51a25d];return _0x17bfb2;};'use strict';var _=require(_0xf263('0x0'));var util=require(_0xf263('0x1'));var moment=require(_0xf263('0x2'));var BPromise=require(_0xf263('0x3'));var rs=require(_0xf263('0x4'));var fs=require('fs');var Redis=require(_0xf263('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf263('0x6'));var logger=require(_0xf263('0x7'))(_0xf263('0x8'));var config=require('../../config/environment');var jayson=require(_0xf263('0x9'));var client=jayson[_0xf263('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fded6,_0xa2b1b0,_0x9644ab){return new BPromise(function(_0xa2e77e,_0x16ff53){return client['request'](_0x4fded6,_0x9644ab)[_0xf263('0xb')](function(_0x26504c){logger[_0xf263('0xc')](_0xf263('0xd'),_0xa2b1b0,_0xf263('0xe'));logger[_0xf263('0xf')](_0xf263('0x10'),_0xa2b1b0,'request\x20sent',JSON[_0xf263('0x11')](_0x26504c));if(_0x26504c['error']){if(_0x26504c[_0xf263('0x12')]['code']===0x1f4){logger['error'](_0xf263('0xd'),_0xa2b1b0,_0x26504c[_0xf263('0x12')][_0xf263('0x13')]);return _0x16ff53(_0x26504c[_0xf263('0x12')][_0xf263('0x13')]);}logger[_0xf263('0x12')](_0xf263('0xd'),_0xa2b1b0,_0x26504c['error'][_0xf263('0x13')]);return _0xa2e77e(_0x26504c['error'][_0xf263('0x13')]);}else{logger[_0xf263('0xc')](_0xf263('0xd'),_0xa2b1b0,_0xf263('0xe'));_0xa2e77e(_0x26504c[_0xf263('0x14')][_0xf263('0x13')]);}})[_0xf263('0x15')](function(_0x57c655){logger['error'](_0xf263('0xd'),_0xa2b1b0,_0x57c655);_0x16ff53(_0x57c655);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 0736b41..edb65d0 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 _0x073d=['show','post','create','put','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index','/:id'];(function(_0x159f91,_0xe8a30f){var _0x26bd65=function(_0x5680d1){while(--_0x5680d1){_0x159f91['push'](_0x159f91['shift']());}};_0x26bd65(++_0xe8a30f);}(_0x073d,0xd2));var _0xd073=function(_0x2a43b9,_0x2aa7ea){_0x2a43b9=_0x2a43b9-0x0;var _0x3b6c90=_0x073d[_0x2a43b9];return _0x3b6c90;};'use strict';var multer=require('multer');var util=require(_0xd073('0x0'));var path=require(_0xd073('0x1'));var timeout=require(_0xd073('0x2'));var express=require('express');var router=express[_0xd073('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd073('0x4'));var interaction=require(_0xd073('0x5'));var config=require('../../config/environment');var controller=require(_0xd073('0x6'));router[_0xd073('0x7')]('/',auth[_0xd073('0x8')](),controller[_0xd073('0x9')]);router[_0xd073('0x7')](_0xd073('0xa'),auth[_0xd073('0x8')](),controller[_0xd073('0xb')]);router[_0xd073('0xc')]('/',auth[_0xd073('0x8')](),controller[_0xd073('0xd')]);router[_0xd073('0xe')](_0xd073('0xa'),auth[_0xd073('0x8')](),controller['update']);router['delete'](_0xd073('0xa'),auth['isAuthenticated'](),controller[_0xd073('0xf')]);module[_0xd073('0x10')]=router; \ No newline at end of file +var _0x6ca3=['post','put','/:id','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ca3,0xba));var _0x36ca=function(_0x1eadfb,_0xc1e08b){_0x1eadfb=_0x1eadfb-0x0;var _0x5500fc=_0x6ca3[_0x1eadfb];return _0x5500fc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x36ca('0x0'));var timeout=require(_0x36ca('0x1'));var express=require('express');var router=express[_0x36ca('0x2')]();var fs_extra=require(_0x36ca('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x36ca('0x4'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0x36ca('0x5')]('/',auth[_0x36ca('0x6')](),controller[_0x36ca('0x7')]);router[_0x36ca('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x36ca('0x8')]);router[_0x36ca('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x36ca('0xa')](_0x36ca('0xb'),auth[_0x36ca('0x6')](),controller[_0x36ca('0xc')]);router['delete'](_0x36ca('0xb'),auth['isAuthenticated'](),controller[_0x36ca('0xd')]);module[_0x36ca('0xe')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 28e34c0..044ebb5 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 _0xfea2=['STRING','sequelize','exports','localnet','externip','stun','turn'];(function(_0x13f9f4,_0x285d05){var _0x1b6af0=function(_0x13afd5){while(--_0x13afd5){_0x13f9f4['push'](_0x13f9f4['shift']());}};_0x1b6af0(++_0x285d05);}(_0xfea2,0x1c1));var _0x2fea=function(_0x35685f,_0x595545){_0x35685f=_0x35685f-0x0;var _0x4fdfa5=_0xfea2[_0x35685f];return _0x4fdfa5;};'use strict';var Sequelize=require(_0x2fea('0x0'));module[_0x2fea('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2fea('0x2'),_0x2fea('0x3'),_0x2fea('0x4'),_0x2fea('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x2fea('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf4a0=['externip','stun','STRING','exports','ENUM','localnet'];(function(_0x445bbd,_0x5b7768){var _0x343a96=function(_0x477acc){while(--_0x477acc){_0x445bbd['push'](_0x445bbd['shift']());}};_0x343a96(++_0x5b7768);}(_0xf4a0,0xff));var _0x0f4a=function(_0x44da1e,_0x19dd10){_0x44da1e=_0x44da1e-0x0;var _0x230b02=_0xf4a0[_0x44da1e];return _0x230b02;};'use strict';var Sequelize=require('sequelize');module[_0x0f4a('0x0')]={'type':{'type':Sequelize[_0x0f4a('0x1')](_0x0f4a('0x2'),_0x0f4a('0x3'),_0x0f4a('0x4'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0f4a('0x5')]},'password':{'type':Sequelize[_0x0f4a('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index d607a37..4319b66 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 _0x5485=['http','request','then','info','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','Network','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','server/files/templates/turn_multiple.ejs','writeFileSync','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','TURN','chan_sip.so','util','path','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0xf310ac,_0x4ea1ef){var _0xed806b=function(_0x2f5aca){while(--_0x2f5aca){_0xf310ac['push'](_0xf310ac['shift']());}};_0xed806b(++_0x4ea1ef);}(_0x5485,0xa0));var _0x5548=function(_0xe08f0e,_0x527e44){_0xe08f0e=_0xe08f0e-0x0;var _0x402cf1=_0x5485[_0xe08f0e];return _0x402cf1;};'use strict';var util=require(_0x5548('0x0'));var path=require(_0x5548('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5548('0x2'));var qs=require(_0x5548('0x3'));var logger=require(_0x5548('0x4'))(_0x5548('0x5'));var config=require(_0x5548('0x6'));var db=require(_0x5548('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x5548('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ec1c2,_0x18f301,_0x1d66a9,_0x10445c){return new Promise(function(_0x29b7d9,_0x158417){var _0x2b6409=_0x10445c||client;return _0x2b6409[_0x5548('0x9')](_0x2ec1c2,_0x1d66a9)[_0x5548('0xa')](function(_0x521625){logger[_0x5548('0xb')]('Network,\x20%s,\x20%s',_0x18f301,_0x5548('0xc'));logger['debug'](_0x5548('0xd'),_0x18f301,_0x5548('0xc'),JSON[_0x5548('0xe')](_0x521625));if(_0x521625[_0x5548('0xf')]){if(_0x521625[_0x5548('0xf')][_0x5548('0x10')]===0x1f4){logger[_0x5548('0xf')](_0x5548('0x11'),_0x18f301,_0x521625[_0x5548('0xf')][_0x5548('0x12')]);return _0x158417(_0x521625['error']['message']);}logger[_0x5548('0xf')](_0x5548('0x11'),_0x18f301,_0x521625[_0x5548('0xf')][_0x5548('0x12')]);return _0x29b7d9(_0x521625[_0x5548('0xf')]['message']);}else{logger['info'](_0x5548('0x11'),_0x18f301,_0x5548('0xc'));_0x29b7d9(_0x521625[_0x5548('0x13')]['message']);}})['catch'](function(_0xbc6c45){logger[_0x5548('0xf')](_0x5548('0x11'),_0x18f301,_0xbc6c45);_0x158417(_0xbc6c45);});});}function respondWithResult(_0x1f01b3,_0x290b4e){_0x290b4e=_0x290b4e||0xc8;return function(_0x48da40){if(_0x48da40){return _0x1f01b3[_0x5548('0x14')](_0x290b4e)[_0x5548('0x15')](_0x48da40);}};}function respondWithFilteredResult(_0x8ebb6e,_0x14ef67){return function(_0x45730b){if(_0x45730b){var _0x17cd25=typeof _0x14ef67[_0x5548('0x16')]===_0x5548('0x17')&&typeof _0x14ef67['limit']===_0x5548('0x17');var _0x4b1791=_0x45730b['count'];var _0x3d115e=_0x17cd25?0x0:_0x14ef67['offset'];var _0x3c05da=_0x17cd25?_0x45730b[_0x5548('0x18')]:_0x14ef67['offset']+_0x14ef67[_0x5548('0x19')];var _0x5f53cd;if(_0x3c05da>=_0x4b1791){_0x3c05da=_0x4b1791;_0x5f53cd=0xc8;}else{_0x5f53cd=0xce;}_0x8ebb6e['status'](_0x5f53cd);return _0x8ebb6e[_0x5548('0x1a')](_0x5548('0x1b'),_0x3d115e+'-'+_0x3c05da+'/'+_0x4b1791)[_0x5548('0x15')](_0x45730b);}return null;};}function saveUpdates(_0x4f27e9){return function(_0xc13a01){if(_0xc13a01){return _0xc13a01[_0x5548('0x1c')](_0x4f27e9)[_0x5548('0xa')](function(_0x48612f){return _0x48612f;});}return null;};}function removeEntity(_0x324134){return function(_0x3b50d4){if(_0x3b50d4){return _0x3b50d4[_0x5548('0x1d')]()[_0x5548('0xa')](function(){_0x324134['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c7227){return function(_0x3139bd){if(!_0x3139bd){_0x5c7227['sendStatus'](0x194);}return _0x3139bd;};}function handleError(_0x464131,_0x3875c6){_0x3875c6=_0x3875c6||0x1f4;return function(_0x59968f){logger['error'](_0x59968f[_0x5548('0x1e')]);if(_0x59968f[_0x5548('0x1f')]){delete _0x59968f[_0x5548('0x1f')];}_0x464131[_0x5548('0x14')](_0x3875c6)[_0x5548('0x20')](_0x59968f);};}exports['index']=function(_0x5d7b66,_0x24fc99){var _0x4d4f7e={},_0x59bc8c={},_0x16382f={'count':0x0,'rows':[]};var _0x1c2bad=_[_0x5548('0x21')](db['Network'][_0x5548('0x22')],function(_0xe143a){return{'name':_0xe143a[_0x5548('0x23')],'type':_0xe143a[_0x5548('0x24')][_0x5548('0x25')]};});_0x59bc8c['model']=_[_0x5548('0x21')](_0x1c2bad,_0x5548('0x1f'));_0x59bc8c[_0x5548('0x26')]=_[_0x5548('0x27')](_0x5d7b66[_0x5548('0x26')]);_0x59bc8c['filters']=_[_0x5548('0x28')](_0x59bc8c[_0x5548('0x29')],_0x59bc8c['query']);_0x4d4f7e[_0x5548('0x2a')]=_['intersection'](_0x59bc8c['model'],qs[_0x5548('0x2b')](_0x5d7b66['query'][_0x5548('0x2b')]));_0x4d4f7e[_0x5548('0x2a')]=_0x4d4f7e[_0x5548('0x2a')][_0x5548('0x2c')]?_0x4d4f7e[_0x5548('0x2a')]:_0x59bc8c[_0x5548('0x29')];if(!_0x5d7b66[_0x5548('0x26')][_0x5548('0x2d')](_0x5548('0x2e'))){_0x4d4f7e['limit']=qs[_0x5548('0x19')](_0x5d7b66[_0x5548('0x26')][_0x5548('0x19')]);_0x4d4f7e[_0x5548('0x16')]=qs[_0x5548('0x16')](_0x5d7b66[_0x5548('0x26')][_0x5548('0x16')]);}_0x4d4f7e[_0x5548('0x2f')]=qs[_0x5548('0x30')](_0x5d7b66['query']['sort']);_0x4d4f7e[_0x5548('0x31')]=qs[_0x5548('0x32')](_[_0x5548('0x33')](_0x5d7b66['query'],_0x59bc8c['filters']),_0x1c2bad);if(_0x5d7b66[_0x5548('0x26')][_0x5548('0x34')]){_0x4d4f7e['where']=_['merge'](_0x4d4f7e[_0x5548('0x31')],{'$or':_['map'](_0x1c2bad,function(_0x33fa1d){if(_0x33fa1d[_0x5548('0x24')]!=='VIRTUAL'){var _0x40c6e2={};_0x40c6e2[_0x33fa1d[_0x5548('0x1f')]]={'$like':'%'+_0x5d7b66[_0x5548('0x26')][_0x5548('0x34')]+'%'};return _0x40c6e2;}})});}_0x4d4f7e=_[_0x5548('0x35')]({},_0x4d4f7e,_0x5d7b66[_0x5548('0x36')]);var _0xe889c={'where':_0x4d4f7e[_0x5548('0x31')]};return db['Network'][_0x5548('0x18')](_0xe889c)['then'](function(_0x1f25b7){_0x16382f['count']=_0x1f25b7;if(_0x5d7b66[_0x5548('0x26')][_0x5548('0x37')]){_0x4d4f7e[_0x5548('0x38')]=[{'all':!![]}];}return db['Network'][_0x5548('0x39')](_0x4d4f7e);})[_0x5548('0xa')](function(_0x32d2a){_0x16382f[_0x5548('0x3a')]=_0x32d2a;return _0x16382f;})[_0x5548('0xa')](respondWithFilteredResult(_0x24fc99,_0x4d4f7e))[_0x5548('0x3b')](handleError(_0x24fc99,null));};exports['show']=function(_0xbdbef5,_0x22a29f){var _0xab736e={'raw':!![],'where':{'id':_0xbdbef5[_0x5548('0x3c')]['id']}},_0x186ddf={};_0x186ddf[_0x5548('0x29')]=_[_0x5548('0x27')](db[_0x5548('0x3d')][_0x5548('0x22')]);_0x186ddf[_0x5548('0x26')]=_[_0x5548('0x27')](_0xbdbef5[_0x5548('0x26')]);_0x186ddf[_0x5548('0x32')]=_[_0x5548('0x28')](_0x186ddf[_0x5548('0x29')],_0x186ddf[_0x5548('0x26')]);_0xab736e[_0x5548('0x2a')]=_['intersection'](_0x186ddf[_0x5548('0x29')],qs[_0x5548('0x2b')](_0xbdbef5[_0x5548('0x26')][_0x5548('0x2b')]));_0xab736e[_0x5548('0x2a')]=_0xab736e['attributes'][_0x5548('0x2c')]?_0xab736e['attributes']:_0x186ddf['model'];if(_0xbdbef5[_0x5548('0x26')][_0x5548('0x37')]){_0xab736e[_0x5548('0x38')]=[{'all':!![]}];}_0xab736e=_[_0x5548('0x35')]({},_0xab736e,_0xbdbef5[_0x5548('0x36')]);return db[_0x5548('0x3d')][_0x5548('0x3e')](_0xab736e)[_0x5548('0xa')](handleEntityNotFound(_0x22a29f,null))[_0x5548('0xa')](respondWithResult(_0x22a29f,null))[_0x5548('0x3b')](handleError(_0x22a29f,null));};exports[_0x5548('0x3f')]=function(_0x2c05e7,_0x2833e6){var _0x5d97b2;return db[_0x5548('0x3d')][_0x5548('0x3f')](_0x2c05e7[_0x5548('0x40')],{'raw':!![]})[_0x5548('0xa')](function(_0x283279){_0x5d97b2=_0x283279;return db[_0x5548('0x3d')][_0x5548('0x39')]({'where':{'type':_0x2c05e7[_0x5548('0x40')][_0x5548('0x24')]},'raw':!![]});})['then'](function(_0x6a8877){if(_0x5d97b2['type'][_0x5548('0x41')]()==_0x5548('0x42')){var _0x31d065=fs[_0x5548('0x43')](path[_0x5548('0x44')](config[_0x5548('0x45')],_0x5548('0x46')),_0x5548('0x47'));var _0x14e98c=ejs[_0x5548('0x48')](_0x31d065,{'networks':_0x6a8877||[]});fs['writeFileSync'](_0x5548('0x49'),_0x14e98c);return respondWithRpcPromise(_0x5548('0x4a'),'create',{'module':'res_stun_monitor.so'});}else if(_0x5d97b2[_0x5548('0x24')][_0x5548('0x41')]()=='TURN'){var _0x2a72b6=fs[_0x5548('0x43')](path[_0x5548('0x44')](config[_0x5548('0x45')],_0x5548('0x4b')),'utf8');var _0x517cce=ejs[_0x5548('0x48')](_0x2a72b6,{'networks':_0x6a8877||[]});fs[_0x5548('0x4c')]('/etc/asterisk/turn_xcally.conf',_0x517cce);return respondWithRpcPromise(_0x5548('0x4a'),_0x5548('0x3f'),{'module':_0x5548('0x4d')});}else{var _0xcf2be7=fs[_0x5548('0x43')](path[_0x5548('0x44')](config[_0x5548('0x45')],_0x5548('0x4e')),_0x5548('0x47'));var _0x3f9138=ejs['render'](_0xcf2be7,{'networks':_0x6a8877||[]});fs[_0x5548('0x4c')](util[_0x5548('0x4f')](_0x5548('0x50'),_0x2c05e7[_0x5548('0x40')][_0x5548('0x24')][_0x5548('0x51')]()),_0x3f9138);return respondWithRpcPromise(_0x5548('0x4a'),_0x5548('0x3f'),{'module':'chan_sip.so'});}})[_0x5548('0xa')](function(){return _0x5d97b2;})[_0x5548('0xa')](respondWithResult(_0x2833e6,0xc9))[_0x5548('0x3b')](handleError(_0x2833e6,null));};exports[_0x5548('0x1c')]=function(_0x2880ae,_0x9d958b){var _0x3c89d8;return db[_0x5548('0x3d')][_0x5548('0x3e')]({'where':{'id':_0x2880ae[_0x5548('0x3c')]['id']}})[_0x5548('0xa')](handleEntityNotFound(_0x9d958b,null))['then'](saveUpdates(_0x2880ae[_0x5548('0x40')],null))['then'](function(_0x596ade){if(_0x596ade){_0x3c89d8=_0x596ade;return db['Network']['findAll']({'where':{'type':_0x3c89d8['type']},'raw':!![]});}return null;})[_0x5548('0xa')](function(_0x490f9a){if(_0x3c89d8[_0x5548('0x24')][_0x5548('0x41')]()==_0x5548('0x42')){var _0x5683cb=fs[_0x5548('0x43')](path['join'](config[_0x5548('0x45')],_0x5548('0x46')),_0x5548('0x47'));var _0x27f136=ejs[_0x5548('0x48')](_0x5683cb,{'networks':_0x490f9a||[]});fs[_0x5548('0x4c')](_0x5548('0x49'),_0x27f136);return respondWithRpcPromise(_0x5548('0x4a'),'update',{'module':_0x5548('0x4d')});}else if(_0x3c89d8[_0x5548('0x24')][_0x5548('0x41')]()==_0x5548('0x52')){var _0x2986c9=fs[_0x5548('0x43')](path['join'](config['root'],_0x5548('0x4b')),_0x5548('0x47'));var _0x7284c8=ejs[_0x5548('0x48')](_0x2986c9,{'networks':_0x490f9a||[]});fs[_0x5548('0x4c')]('/etc/asterisk/turn_xcally.conf',_0x7284c8);return respondWithRpcPromise(_0x5548('0x4a'),_0x5548('0x1c'),{'module':_0x5548('0x4d')});}else{var _0x5c7e8c=fs[_0x5548('0x43')](path[_0x5548('0x44')](config[_0x5548('0x45')],_0x5548('0x4e')),_0x5548('0x47'));var _0xcde047=ejs[_0x5548('0x48')](_0x5c7e8c,{'networks':_0x490f9a||[]});fs[_0x5548('0x4c')](util[_0x5548('0x4f')](_0x5548('0x50'),_0x2880ae[_0x5548('0x40')]['type'][_0x5548('0x51')]()),_0xcde047);return respondWithRpcPromise('Reload',_0x5548('0x1c'),{'module':'chan_sip.so'});}})[_0x5548('0xa')](function(_0x2dc769){if(_0x2dc769){return _0x3c89d8;}return null;})[_0x5548('0xa')](respondWithResult(_0x9d958b,null))[_0x5548('0x3b')](handleError(_0x9d958b,null));};exports['destroy']=function(_0x382622,_0x473096){var _0x2d86a1;return db[_0x5548('0x3d')]['find']({'where':{'id':_0x382622['params']['id']}})[_0x5548('0xa')](function(_0xf4c1b8){_0x2d86a1=_0xf4c1b8;return _0xf4c1b8;})[_0x5548('0xa')](handleEntityNotFound(_0x473096,null))[_0x5548('0xa')](removeEntity(_0x473096,null))[_0x5548('0xa')](function(){if(_0x2d86a1){return db[_0x5548('0x3d')][_0x5548('0x39')]({'where':{'type':_0x2d86a1[_0x5548('0x24')]},'raw':!![]});}})['then'](function(_0x72cc34){if(_0x2d86a1[_0x5548('0x24')][_0x5548('0x41')]()==_0x5548('0x42')){var _0xc760f8=fs[_0x5548('0x43')](path[_0x5548('0x44')](config[_0x5548('0x45')],_0x5548('0x46')),_0x5548('0x47'));var _0x2a28d4=ejs['render'](_0xc760f8,{'networks':_0x72cc34||[]});fs[_0x5548('0x4c')](_0x5548('0x49'),_0x2a28d4);return respondWithRpcPromise(_0x5548('0x4a'),_0x5548('0x1d'),{'module':'res_stun_monitor.so'});}else if(_0x2d86a1[_0x5548('0x24')]['toUpperCase']()==_0x5548('0x52')){var _0x43ee40=fs[_0x5548('0x43')](path[_0x5548('0x44')](config[_0x5548('0x45')],_0x5548('0x4b')),_0x5548('0x47'));var _0x1a706a=ejs[_0x5548('0x48')](_0x43ee40,{'networks':_0x72cc34||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x1a706a);return respondWithRpcPromise(_0x5548('0x4a'),_0x5548('0x1d'),{'module':_0x5548('0x4d')});}else{var _0xbb80f0=fs[_0x5548('0x43')](path['join'](config['root'],_0x5548('0x4e')),_0x5548('0x47'));var _0x5324bd=ejs[_0x5548('0x48')](_0xbb80f0,{'networks':_0x72cc34||[]});fs[_0x5548('0x4c')](util[_0x5548('0x4f')](_0x5548('0x50'),_0x2d86a1[_0x5548('0x24')][_0x5548('0x51')]()),_0x5324bd);return respondWithRpcPromise(_0x5548('0x4a'),'destroy',{'module':_0x5548('0x53')});}})[_0x5548('0x3b')](handleError(_0x473096,null));}; \ No newline at end of file +var _0x80bd=['utf8','render','writeFileSync','Reload','TURN','server/files/templates/turn_multiple.ejs','res_stun_monitor.so','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','find','params','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','format','chan_sip.so','server/files/templates/stun_multiple.ejs','util','ejs','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','index','Network','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','rows','catch','show','options','create','findAll','body','toUpperCase','STUN','readFileSync','join','root'];(function(_0x208311,_0x4cdf34){var _0x28320f=function(_0x47379b){while(--_0x47379b){_0x208311['push'](_0x208311['shift']());}};_0x28320f(++_0x4cdf34);}(_0x80bd,0xbd));var _0xd80b=function(_0x428493,_0x557e2f){_0x428493=_0x428493-0x0;var _0x1f7a7c=_0x80bd[_0x428493];return _0x1f7a7c;};'use strict';var util=require(_0xd80b('0x0'));var path=require('path');var ejs=require(_0xd80b('0x1'));var fs=require('fs');var _=require(_0xd80b('0x2'));var qs=require(_0xd80b('0x3'));var logger=require('../../config/logger')(_0xd80b('0x4'));var config=require(_0xd80b('0x5'));var db=require(_0xd80b('0x6'))['db'];var jayson=require(_0xd80b('0x7'));var client=jayson[_0xd80b('0x8')][_0xd80b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55aae0,_0x5000b8,_0x496f79,_0x1c2ca6){return new Promise(function(_0x5ba746,_0x2be44c){var _0x1352e2=_0x1c2ca6||client;return _0x1352e2[_0xd80b('0xa')](_0x55aae0,_0x496f79)[_0xd80b('0xb')](function(_0x197bf0){logger['info'](_0xd80b('0xc'),_0x5000b8,_0xd80b('0xd'));logger[_0xd80b('0xe')](_0xd80b('0xf'),_0x5000b8,'request\x20sent',JSON[_0xd80b('0x10')](_0x197bf0));if(_0x197bf0[_0xd80b('0x11')]){if(_0x197bf0[_0xd80b('0x11')][_0xd80b('0x12')]===0x1f4){logger[_0xd80b('0x11')](_0xd80b('0xc'),_0x5000b8,_0x197bf0[_0xd80b('0x11')][_0xd80b('0x13')]);return _0x2be44c(_0x197bf0[_0xd80b('0x11')][_0xd80b('0x13')]);}logger[_0xd80b('0x11')](_0xd80b('0xc'),_0x5000b8,_0x197bf0[_0xd80b('0x11')][_0xd80b('0x13')]);return _0x5ba746(_0x197bf0['error']['message']);}else{logger[_0xd80b('0x14')]('Network,\x20%s,\x20%s',_0x5000b8,_0xd80b('0xd'));_0x5ba746(_0x197bf0[_0xd80b('0x15')][_0xd80b('0x13')]);}})['catch'](function(_0x3c0ae7){logger[_0xd80b('0x11')]('Network,\x20%s,\x20%s',_0x5000b8,_0x3c0ae7);_0x2be44c(_0x3c0ae7);});});}function respondWithResult(_0x1ddd93,_0x333111){_0x333111=_0x333111||0xc8;return function(_0x3f8587){if(_0x3f8587){return _0x1ddd93[_0xd80b('0x16')](_0x333111)[_0xd80b('0x17')](_0x3f8587);}};}function respondWithFilteredResult(_0x27def0,_0x1c38df){return function(_0x566bf6){if(_0x566bf6){var _0x4b79b1=typeof _0x1c38df[_0xd80b('0x18')]===_0xd80b('0x19')&&typeof _0x1c38df[_0xd80b('0x1a')]==='undefined';var _0x4213ea=_0x566bf6[_0xd80b('0x1b')];var _0x9c6452=_0x4b79b1?0x0:_0x1c38df['offset'];var _0x2065c1=_0x4b79b1?_0x566bf6[_0xd80b('0x1b')]:_0x1c38df[_0xd80b('0x18')]+_0x1c38df[_0xd80b('0x1a')];var _0x21b47f;if(_0x2065c1>=_0x4213ea){_0x2065c1=_0x4213ea;_0x21b47f=0xc8;}else{_0x21b47f=0xce;}_0x27def0[_0xd80b('0x16')](_0x21b47f);return _0x27def0[_0xd80b('0x1c')](_0xd80b('0x1d'),_0x9c6452+'-'+_0x2065c1+'/'+_0x4213ea)[_0xd80b('0x17')](_0x566bf6);}return null;};}function saveUpdates(_0xaac98d){return function(_0x53f8e4){if(_0x53f8e4){return _0x53f8e4[_0xd80b('0x1e')](_0xaac98d)[_0xd80b('0xb')](function(_0x315e7d){return _0x315e7d;});}return null;};}function removeEntity(_0x3abe70){return function(_0x36b3e0){if(_0x36b3e0){return _0x36b3e0[_0xd80b('0x1f')]()[_0xd80b('0xb')](function(){_0x3abe70['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50176c){return function(_0x532a5d){if(!_0x532a5d){_0x50176c['sendStatus'](0x194);}return _0x532a5d;};}function handleError(_0x250b12,_0x4606f1){_0x4606f1=_0x4606f1||0x1f4;return function(_0x4494ff){logger['error'](_0x4494ff['stack']);if(_0x4494ff['name']){delete _0x4494ff['name'];}_0x250b12[_0xd80b('0x16')](_0x4606f1)['send'](_0x4494ff);};}exports[_0xd80b('0x20')]=function(_0x21a60b,_0x54b73b){var _0x266622={},_0x37530f={},_0x5316c8={'count':0x0,'rows':[]};var _0x3c431f=_['map'](db[_0xd80b('0x21')][_0xd80b('0x22')],function(_0x4da5d7){return{'name':_0x4da5d7[_0xd80b('0x23')],'type':_0x4da5d7[_0xd80b('0x24')]['key']};});_0x37530f[_0xd80b('0x25')]=_['map'](_0x3c431f,_0xd80b('0x26'));_0x37530f[_0xd80b('0x27')]=_[_0xd80b('0x28')](_0x21a60b['query']);_0x37530f[_0xd80b('0x29')]=_['intersection'](_0x37530f[_0xd80b('0x25')],_0x37530f[_0xd80b('0x27')]);_0x266622['attributes']=_[_0xd80b('0x2a')](_0x37530f[_0xd80b('0x25')],qs[_0xd80b('0x2b')](_0x21a60b[_0xd80b('0x27')]['fields']));_0x266622[_0xd80b('0x2c')]=_0x266622[_0xd80b('0x2c')][_0xd80b('0x2d')]?_0x266622[_0xd80b('0x2c')]:_0x37530f[_0xd80b('0x25')];if(!_0x21a60b[_0xd80b('0x27')]['hasOwnProperty'](_0xd80b('0x2e'))){_0x266622[_0xd80b('0x1a')]=qs[_0xd80b('0x1a')](_0x21a60b[_0xd80b('0x27')][_0xd80b('0x1a')]);_0x266622[_0xd80b('0x18')]=qs[_0xd80b('0x18')](_0x21a60b[_0xd80b('0x27')][_0xd80b('0x18')]);}_0x266622[_0xd80b('0x2f')]=qs[_0xd80b('0x30')](_0x21a60b['query'][_0xd80b('0x30')]);_0x266622[_0xd80b('0x31')]=qs[_0xd80b('0x29')](_[_0xd80b('0x32')](_0x21a60b[_0xd80b('0x27')],_0x37530f[_0xd80b('0x29')]),_0x3c431f);if(_0x21a60b[_0xd80b('0x27')][_0xd80b('0x33')]){_0x266622['where']=_[_0xd80b('0x34')](_0x266622[_0xd80b('0x31')],{'$or':_[_0xd80b('0x35')](_0x3c431f,function(_0x46571a){if(_0x46571a['type']!==_0xd80b('0x36')){var _0x8806f7={};_0x8806f7[_0x46571a[_0xd80b('0x26')]]={'$like':'%'+_0x21a60b[_0xd80b('0x27')][_0xd80b('0x33')]+'%'};return _0x8806f7;}})});}_0x266622=_['merge']({},_0x266622,_0x21a60b['options']);var _0x298b36={'where':_0x266622[_0xd80b('0x31')]};return db['Network'][_0xd80b('0x1b')](_0x298b36)[_0xd80b('0xb')](function(_0x3e0536){_0x5316c8[_0xd80b('0x1b')]=_0x3e0536;if(_0x21a60b[_0xd80b('0x27')][_0xd80b('0x37')]){_0x266622[_0xd80b('0x38')]=[{'all':!![]}];}return db[_0xd80b('0x21')]['findAll'](_0x266622);})[_0xd80b('0xb')](function(_0x6c35aa){_0x5316c8[_0xd80b('0x39')]=_0x6c35aa;return _0x5316c8;})[_0xd80b('0xb')](respondWithFilteredResult(_0x54b73b,_0x266622))[_0xd80b('0x3a')](handleError(_0x54b73b,null));};exports[_0xd80b('0x3b')]=function(_0x3dd28a,_0x428821){var _0x5f5df0={'raw':!![],'where':{'id':_0x3dd28a['params']['id']}},_0x1efa03={};_0x1efa03[_0xd80b('0x25')]=_[_0xd80b('0x28')](db[_0xd80b('0x21')][_0xd80b('0x22')]);_0x1efa03[_0xd80b('0x27')]=_[_0xd80b('0x28')](_0x3dd28a['query']);_0x1efa03[_0xd80b('0x29')]=_[_0xd80b('0x2a')](_0x1efa03[_0xd80b('0x25')],_0x1efa03['query']);_0x5f5df0[_0xd80b('0x2c')]=_[_0xd80b('0x2a')](_0x1efa03[_0xd80b('0x25')],qs['fields'](_0x3dd28a['query']['fields']));_0x5f5df0[_0xd80b('0x2c')]=_0x5f5df0['attributes'][_0xd80b('0x2d')]?_0x5f5df0[_0xd80b('0x2c')]:_0x1efa03['model'];if(_0x3dd28a[_0xd80b('0x27')][_0xd80b('0x37')]){_0x5f5df0[_0xd80b('0x38')]=[{'all':!![]}];}_0x5f5df0=_[_0xd80b('0x34')]({},_0x5f5df0,_0x3dd28a[_0xd80b('0x3c')]);return db[_0xd80b('0x21')]['find'](_0x5f5df0)[_0xd80b('0xb')](handleEntityNotFound(_0x428821,null))[_0xd80b('0xb')](respondWithResult(_0x428821,null))['catch'](handleError(_0x428821,null));};exports[_0xd80b('0x3d')]=function(_0x27962a,_0x537ecb){var _0x596e49;return db[_0xd80b('0x21')][_0xd80b('0x3d')](_0x27962a['body'],{'raw':!![]})['then'](function(_0x2b8a5c){_0x596e49=_0x2b8a5c;return db['Network'][_0xd80b('0x3e')]({'where':{'type':_0x27962a[_0xd80b('0x3f')][_0xd80b('0x24')]},'raw':!![]});})[_0xd80b('0xb')](function(_0x517b3b){if(_0x596e49[_0xd80b('0x24')][_0xd80b('0x40')]()==_0xd80b('0x41')){var _0x4b2224=fs[_0xd80b('0x42')](path[_0xd80b('0x43')](config[_0xd80b('0x44')],'server/files/templates/stun_multiple.ejs'),_0xd80b('0x45'));var _0x25061c=ejs[_0xd80b('0x46')](_0x4b2224,{'networks':_0x517b3b||[]});fs[_0xd80b('0x47')]('/etc/asterisk/stun_xcally.conf',_0x25061c);return respondWithRpcPromise(_0xd80b('0x48'),_0xd80b('0x3d'),{'module':'res_stun_monitor.so'});}else if(_0x596e49[_0xd80b('0x24')][_0xd80b('0x40')]()==_0xd80b('0x49')){var _0x2c4310=fs[_0xd80b('0x42')](path[_0xd80b('0x43')](config[_0xd80b('0x44')],_0xd80b('0x4a')),'utf8');var _0x477415=ejs['render'](_0x2c4310,{'networks':_0x517b3b||[]});fs[_0xd80b('0x47')]('/etc/asterisk/turn_xcally.conf',_0x477415);return respondWithRpcPromise(_0xd80b('0x48'),_0xd80b('0x3d'),{'module':_0xd80b('0x4b')});}else{var _0x784a71=fs['readFileSync'](path['join'](config['root'],_0xd80b('0x4c')),_0xd80b('0x45'));var _0x42af27=ejs[_0xd80b('0x46')](_0x784a71,{'networks':_0x517b3b||[]});fs[_0xd80b('0x47')](util['format'](_0xd80b('0x4d'),_0x27962a[_0xd80b('0x3f')][_0xd80b('0x24')][_0xd80b('0x4e')]()),_0x42af27);return respondWithRpcPromise('Reload',_0xd80b('0x3d'),{'module':'chan_sip.so'});}})[_0xd80b('0xb')](function(){return _0x596e49;})[_0xd80b('0xb')](respondWithResult(_0x537ecb,0xc9))[_0xd80b('0x3a')](handleError(_0x537ecb,null));};exports[_0xd80b('0x1e')]=function(_0x386942,_0x27e63a){var _0x37c31d;return db['Network'][_0xd80b('0x4f')]({'where':{'id':_0x386942[_0xd80b('0x50')]['id']}})[_0xd80b('0xb')](handleEntityNotFound(_0x27e63a,null))[_0xd80b('0xb')](saveUpdates(_0x386942[_0xd80b('0x3f')],null))['then'](function(_0x47bd9a){if(_0x47bd9a){_0x37c31d=_0x47bd9a;return db['Network'][_0xd80b('0x3e')]({'where':{'type':_0x37c31d[_0xd80b('0x24')]},'raw':!![]});}return null;})[_0xd80b('0xb')](function(_0x36a866){if(_0x37c31d['type'][_0xd80b('0x40')]()==_0xd80b('0x41')){var _0x41db20=fs['readFileSync'](path[_0xd80b('0x43')](config['root'],'server/files/templates/stun_multiple.ejs'),'utf8');var _0xa636f1=ejs[_0xd80b('0x46')](_0x41db20,{'networks':_0x36a866||[]});fs[_0xd80b('0x47')](_0xd80b('0x51'),_0xa636f1);return respondWithRpcPromise(_0xd80b('0x48'),_0xd80b('0x1e'),{'module':_0xd80b('0x4b')});}else if(_0x37c31d['type']['toUpperCase']()==_0xd80b('0x49')){var _0x2c60fa=fs['readFileSync'](path[_0xd80b('0x43')](config[_0xd80b('0x44')],_0xd80b('0x4a')),'utf8');var _0xa54862=ejs[_0xd80b('0x46')](_0x2c60fa,{'networks':_0x36a866||[]});fs[_0xd80b('0x47')](_0xd80b('0x52'),_0xa54862);return respondWithRpcPromise('Reload',_0xd80b('0x1e'),{'module':_0xd80b('0x4b')});}else{var _0x3a5cea=fs[_0xd80b('0x42')](path[_0xd80b('0x43')](config[_0xd80b('0x44')],_0xd80b('0x4c')),_0xd80b('0x45'));var _0x466526=ejs[_0xd80b('0x46')](_0x3a5cea,{'networks':_0x36a866||[]});fs['writeFileSync'](util[_0xd80b('0x53')]('/etc/asterisk/sip_xcally_%s.conf',_0x386942[_0xd80b('0x3f')][_0xd80b('0x24')][_0xd80b('0x4e')]()),_0x466526);return respondWithRpcPromise('Reload','update',{'module':_0xd80b('0x54')});}})['then'](function(_0x7f498f){if(_0x7f498f){return _0x37c31d;}return null;})[_0xd80b('0xb')](respondWithResult(_0x27e63a,null))[_0xd80b('0x3a')](handleError(_0x27e63a,null));};exports['destroy']=function(_0x402a10,_0x446e89){var _0x1ff644;return db[_0xd80b('0x21')][_0xd80b('0x4f')]({'where':{'id':_0x402a10[_0xd80b('0x50')]['id']}})[_0xd80b('0xb')](function(_0x49d7ec){_0x1ff644=_0x49d7ec;return _0x49d7ec;})[_0xd80b('0xb')](handleEntityNotFound(_0x446e89,null))['then'](removeEntity(_0x446e89,null))['then'](function(){if(_0x1ff644){return db[_0xd80b('0x21')][_0xd80b('0x3e')]({'where':{'type':_0x1ff644[_0xd80b('0x24')]},'raw':!![]});}})[_0xd80b('0xb')](function(_0x26b3f2){if(_0x1ff644[_0xd80b('0x24')]['toUpperCase']()==_0xd80b('0x41')){var _0xbbf3aa=fs[_0xd80b('0x42')](path[_0xd80b('0x43')](config[_0xd80b('0x44')],_0xd80b('0x55')),_0xd80b('0x45'));var _0x2c9f44=ejs[_0xd80b('0x46')](_0xbbf3aa,{'networks':_0x26b3f2||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x2c9f44);return respondWithRpcPromise(_0xd80b('0x48'),'destroy',{'module':_0xd80b('0x4b')});}else if(_0x1ff644['type'][_0xd80b('0x40')]()==_0xd80b('0x49')){var _0x2f2130=fs[_0xd80b('0x42')](path['join'](config[_0xd80b('0x44')],_0xd80b('0x4a')),_0xd80b('0x45'));var _0x5565bd=ejs[_0xd80b('0x46')](_0x2f2130,{'networks':_0x26b3f2||[]});fs['writeFileSync'](_0xd80b('0x52'),_0x5565bd);return respondWithRpcPromise(_0xd80b('0x48'),_0xd80b('0x1f'),{'module':'res_stun_monitor.so'});}else{var _0x29e91b=fs['readFileSync'](path[_0xd80b('0x43')](config[_0xd80b('0x44')],_0xd80b('0x4c')),_0xd80b('0x45'));var _0x4a5974=ejs['render'](_0x29e91b,{'networks':_0x26b3f2||[]});fs[_0xd80b('0x47')](util[_0xd80b('0x53')]('/etc/asterisk/sip_xcally_%s.conf',_0x1ff644[_0xd80b('0x24')][_0xd80b('0x4e')]()),_0x4a5974);return respondWithRpcPromise(_0xd80b('0x48'),'destroy',{'module':_0xd80b('0x54')});}})[_0xd80b('0x3a')](handleError(_0x446e89,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index f026d9c..08e442d 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 _0x702d=['exports','define','Network','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x40f20c,_0x2905c8){var _0xde7e46=function(_0x5af7a4){while(--_0x5af7a4){_0x40f20c['push'](_0x40f20c['shift']());}};_0xde7e46(++_0x2905c8);}(_0x702d,0x147));var _0xd702=function(_0x5de018,_0x31a3b8){_0x5de018=_0x5de018-0x0;var _0x2995ad=_0x702d[_0x5de018];return _0x2995ad;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./network.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4e6=['path','rimraf','./network.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ab01e,_0x46abad){var _0x19fb60=function(_0x4fbfac){while(--_0x4fbfac){_0x3ab01e['push'](_0x3ab01e['shift']());}};_0x19fb60(++_0x46abad);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xb4e6[_0x2fc012];return _0x2891f9;};'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')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 7a40c2b..705c12c 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(_0x904860,_0xd9dd4f){var _0x33e77c=function(_0x1e096f){while(--_0x1e096f){_0x904860['push'](_0x904860['shift']());}};_0x33e77c(++_0xd9dd4f);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3ce9be,_0x3b5e77){var _0x4b7188=function(_0x104198){while(--_0x104198){_0x3ce9be['push'](_0x3ce9be['shift']());}};_0x4b7188(++_0x3b5e77);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 a61a1a0..a1fcbba 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 _0x341c=['addApplications','/:id/users','/:id/send','send','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify'];(function(_0x460264,_0x51ddff){var _0x2d75a1=function(_0x5a02a8){while(--_0x5a02a8){_0x460264['push'](_0x460264['shift']());}};_0x2d75a1(++_0x51ddff);}(_0x341c,0xfb));var _0xc341=function(_0x21bf0d,_0x91bf98){_0x21bf0d=_0x21bf0d-0x0;var _0x561491=_0x341c[_0x21bf0d];return _0x561491;};'use strict';var multer=require(_0xc341('0x0'));var util=require('util');var path=require(_0xc341('0x1'));var timeout=require(_0xc341('0x2'));var express=require(_0xc341('0x3'));var router=express[_0xc341('0x4')]();var fs_extra=require(_0xc341('0x5'));var auth=require(_0xc341('0x6'));var interaction=require(_0xc341('0x7'));var config=require(_0xc341('0x8'));var controller=require(_0xc341('0x9'));router[_0xc341('0xa')]('/',auth[_0xc341('0xb')](),controller[_0xc341('0xc')]);router[_0xc341('0xa')](_0xc341('0xd'),auth[_0xc341('0xb')](),controller['describe']);router['get']('/:id',auth[_0xc341('0xb')](),controller[_0xc341('0xe')]);router[_0xc341('0xa')](_0xc341('0xf'),auth[_0xc341('0xb')](),controller[_0xc341('0x10')]);router[_0xc341('0xa')](_0xc341('0x11'),auth['isAuthenticated'](),controller[_0xc341('0x12')]);router[_0xc341('0xa')](_0xc341('0x13'),auth[_0xc341('0xb')](),controller['getApplications']);router[_0xc341('0xa')](_0xc341('0x14'),auth[_0xc341('0xb')](),controller[_0xc341('0x15')]);router[_0xc341('0xa')]('/:id/users',auth[_0xc341('0xb')](),controller[_0xc341('0x16')]);router[_0xc341('0x17')]('/',auth[_0xc341('0xb')](),controller[_0xc341('0x18')]);router[_0xc341('0x17')](_0xc341('0xf'),auth[_0xc341('0xb')](),controller[_0xc341('0x19')]);router[_0xc341('0x17')](_0xc341('0x11'),auth[_0xc341('0xb')](),controller[_0xc341('0x1a')]);router['post'](_0xc341('0x1b'),controller[_0xc341('0x1c')]);router[_0xc341('0x17')](_0xc341('0x13'),auth[_0xc341('0xb')](),controller[_0xc341('0x1d')]);router['post'](_0xc341('0x1e'),auth[_0xc341('0xb')](),controller['addAgents']);router[_0xc341('0x17')](_0xc341('0x1f'),auth[_0xc341('0xb')](),controller[_0xc341('0x20')]);router['put']('/:id',auth[_0xc341('0xb')](),controller['update']);router[_0xc341('0x21')](_0xc341('0x22'),auth[_0xc341('0xb')](),controller[_0xc341('0x23')]);router['delete'](_0xc341('0xf'),auth['isAuthenticated'](),controller[_0xc341('0x24')]);router[_0xc341('0x21')](_0xc341('0x11'),auth['isAuthenticated'](),controller[_0xc341('0x25')]);router[_0xc341('0x21')](_0xc341('0x1e'),auth[_0xc341('0xb')](),controller[_0xc341('0x26')]);module[_0xc341('0x27')]=router; \ No newline at end of file +var _0xe10e=['../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','create','addDisposition','post','/:id/canned_answers','notify','addApplications','send','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4a9a83,_0x496b55){var _0x3690f6=function(_0x53e797){while(--_0x53e797){_0x4a9a83['push'](_0x4a9a83['shift']());}};_0x3690f6(++_0x496b55);}(_0xe10e,0x12c));var _0xee10=function(_0x5dd703,_0x7fe88c){_0x5dd703=_0x5dd703-0x0;var _0x557f8e=_0xe10e[_0x5dd703];return _0x557f8e;};'use strict';var multer=require(_0xee10('0x0'));var util=require(_0xee10('0x1'));var path=require(_0xee10('0x2'));var timeout=require(_0xee10('0x3'));var express=require(_0xee10('0x4'));var router=express[_0xee10('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xee10('0x6'));var interaction=require(_0xee10('0x7'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0xee10('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xee10('0x9'),auth[_0xee10('0xa')](),controller[_0xee10('0xb')]);router[_0xee10('0x8')](_0xee10('0xc'),auth[_0xee10('0xa')](),controller[_0xee10('0xd')]);router[_0xee10('0x8')](_0xee10('0xe'),auth['isAuthenticated'](),controller[_0xee10('0xf')]);router[_0xee10('0x8')]('/:id/canned_answers',auth[_0xee10('0xa')](),controller[_0xee10('0x10')]);router[_0xee10('0x8')](_0xee10('0x11'),auth[_0xee10('0xa')](),controller[_0xee10('0x12')]);router['get'](_0xee10('0x13'),auth[_0xee10('0xa')](),controller['getInteractions']);router[_0xee10('0x8')](_0xee10('0x14'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xee10('0xa')](),controller[_0xee10('0x15')]);router['post']('/:id/dispositions',auth[_0xee10('0xa')](),controller[_0xee10('0x16')]);router[_0xee10('0x17')](_0xee10('0x18'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xee10('0x17')]('/:id/notify',controller[_0xee10('0x19')]);router[_0xee10('0x17')](_0xee10('0x11'),auth[_0xee10('0xa')](),controller[_0xee10('0x1a')]);router['post'](_0xee10('0x14'),auth[_0xee10('0xa')](),controller['addAgents']);router[_0xee10('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xee10('0x1b')]);router[_0xee10('0x1c')](_0xee10('0xc'),auth[_0xee10('0xa')](),controller[_0xee10('0x1d')]);router[_0xee10('0x1e')]('/:id',auth[_0xee10('0xa')](),controller['destroy']);router[_0xee10('0x1e')](_0xee10('0xe'),auth[_0xee10('0xa')](),controller[_0xee10('0x1f')]);router[_0xee10('0x1e')](_0xee10('0x18'),auth[_0xee10('0xa')](),controller[_0xee10('0x20')]);router[_0xee10('0x1e')](_0xee10('0x14'),auth[_0xee10('0xa')](),controller['removeAgents']);module[_0xee10('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 909cc27..3af6667 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 _0xeb0e=['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','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','generate','TEXT'];(function(_0x1afda3,_0xf74e14){var _0x454b7c=function(_0xf42f9c){while(--_0xf42f9c){_0x1afda3['push'](_0x1afda3['shift']());}};_0x454b7c(++_0xf74e14);}(_0xeb0e,0x16e));var _0xeeb0=function(_0x530b83,_0x39676d){_0x530b83=_0x530b83-0x0;var _0x4af58e=_0xeb0e[_0x530b83];return _0x4af58e;};'use strict';var Sequelize=require(_0xeeb0('0x0'));var rs=require(_0xeeb0('0x1'));module['exports']={'name':{'type':Sequelize[_0xeeb0('0x2')],'unique':_0xeeb0('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xeeb0('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xeeb0('0x4')]();}},'replyUri':{'type':Sequelize[_0xeeb0('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xeeb0('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xeeb0('0x5')],'defaultValue':function(){return _0xeeb0('0x6');}},'notificationSound':{'type':Sequelize[_0xeeb0('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xeeb0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xeeb0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xeeb0('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeeb0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeeb0('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeeb0('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xeeb0('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xeeb0('0x7')],'defaultValue':![],'comment':_0xeeb0('0xa'),'set':function(_0x1570f1){if(!_0x1570f1)this['setDataValue'](_0xeeb0('0xb'),null);this['setDataValue']('mandatoryDisposition',_0x1570f1);}}}; \ No newline at end of file +var _0x17a2=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','BOOLEAN','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','TEXT'];(function(_0x1d598a,_0x927c9f){var _0x33b4e6=function(_0xa5706c){while(--_0xa5706c){_0x1d598a['push'](_0x1d598a['shift']());}};_0x33b4e6(++_0x927c9f);}(_0x17a2,0x1e2));var _0x217a=function(_0x4358ae,_0x197002){_0x4358ae=_0x4358ae-0x0;var _0x2264e0=_0x17a2[_0x4358ae];return _0x2264e0;};'use strict';var Sequelize=require(_0x217a('0x0'));var rs=require(_0x217a('0x1'));module['exports']={'name':{'type':Sequelize[_0x217a('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x217a('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x217a('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x217a('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x217a('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x217a('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x217a('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x217a('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x217a('0x5')},'mandatoryDisposition':{'type':Sequelize[_0x217a('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x58447e){if(!_0x58447e)this['setDataValue'](_0x217a('0x7'),null);this['setDataValue'](_0x217a('0x8'),_0x58447e);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 76a703a..57f3089 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 _0x4629=['order','sort','where','merge','VIRTUAL','filter','options','include','show','params','mandatoryDispositionPause','includeAll','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','Disposition','getDispositions','findOne','length','hasOwnProperty','OpenchannelAccountId','findAll','rows','removeDispositions','ids','CannedAnswer','getAnswers','pick','removeAnswers','notify','openchannel','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','isNil','from','Sequelize','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','asc','contact','firstName','threadId','OpenchannelInteraction','externalUrl','spread','lastName','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','queueId','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','transaction','READ_COMMITTED','bulkCreate','stack','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','Contacts','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','nolimit'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x4629,0x136));var _0x9462=function(_0xa861aa,_0x2895a4){_0xa861aa=_0xa861aa-0x0;var _0x1e34de=_0x4629[_0xa861aa];return _0x1e34de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9462('0x0'));var zipdir=require(_0x9462('0x1'));var jsonpatch=require(_0x9462('0x2'));var rp=require(_0x9462('0x3'));var moment=require(_0x9462('0x4'));var BPromise=require(_0x9462('0x5'));var Mustache=require(_0x9462('0x6'));var util=require(_0x9462('0x7'));var path=require(_0x9462('0x8'));var sox=require(_0x9462('0x9'));var csv=require(_0x9462('0xa'));var ejs=require(_0x9462('0xb'));var fs=require('fs');var fs_extra=require(_0x9462('0xc'));var _=require(_0x9462('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9462('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9462('0xa'));var querystring=require(_0x9462('0xf'));var Papa=require(_0x9462('0x10'));var Redis=require(_0x9462('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9462('0x12'));var as=require(_0x9462('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9462('0x14'))(_0x9462('0x15'));var utils=require(_0x9462('0x16'));var config=require(_0x9462('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9462('0x18'))['db'];config[_0x9462('0x19')]=_[_0x9462('0x1a')](config[_0x9462('0x19')],{'host':_0x9462('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9462('0x19')]));require(_0x9462('0x1c'))[_0x9462('0x1d')](socket);var jayson=require(_0x9462('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13f909,_0x43201b,_0x38df8f,_0x3a0f07){return new BPromise(function(_0x1ab51c,_0x2f2564){var _0x235d07=_0x3a0f07||client;return _0x235d07[_0x9462('0x1f')](_0x13f909,_0x38df8f)[_0x9462('0x20')](function(_0xfaf552){logger[_0x9462('0x21')](_0x9462('0x22'),_0x43201b,_0x9462('0x23'));logger[_0x9462('0x24')](_0x9462('0x25'),_0x43201b,_0x9462('0x23'),JSON[_0x9462('0x26')](_0xfaf552));if(_0xfaf552[_0x9462('0x27')]){if(_0xfaf552[_0x9462('0x27')]['code']===0x1f4){logger[_0x9462('0x27')](_0x9462('0x22'),_0x43201b,_0xfaf552[_0x9462('0x27')][_0x9462('0x28')]);return _0x2f2564(_0xfaf552[_0x9462('0x27')][_0x9462('0x28')]);}logger[_0x9462('0x27')](_0x9462('0x22'),_0x43201b,_0xfaf552[_0x9462('0x27')][_0x9462('0x28')]);return _0x1ab51c(_0xfaf552[_0x9462('0x27')][_0x9462('0x28')]);}else{logger[_0x9462('0x21')](_0x9462('0x22'),_0x43201b,_0x9462('0x23'));_0x1ab51c(_0xfaf552[_0x9462('0x29')][_0x9462('0x28')]);}})[_0x9462('0x2a')](function(_0x497288){logger[_0x9462('0x27')](_0x9462('0x22'),_0x43201b,_0x497288);_0x2f2564(_0x497288);});});}function respondWithStatusCode(_0x268a5f,_0x6d5891){_0x6d5891=_0x6d5891||0xcc;return function(_0x169cb2){if(_0x169cb2){return _0x268a5f[_0x9462('0x2b')](_0x6d5891);}return _0x268a5f[_0x9462('0x2c')](_0x6d5891)[_0x9462('0x2d')]();};}function respondWithResult(_0xd0a648,_0x1812b0){_0x1812b0=_0x1812b0||0xc8;return function(_0x574a11){if(_0x574a11){return _0xd0a648['status'](_0x1812b0)[_0x9462('0x2e')](_0x574a11);}};}function respondWithFilteredResult(_0xaa5a5,_0x162f58){return function(_0x58609e){if(_0x58609e){var _0x515d7b=typeof _0x162f58[_0x9462('0x2f')]==='undefined'&&typeof _0x162f58['limit']===_0x9462('0x30');var _0x1248a5=_0x58609e[_0x9462('0x31')];var _0x2989bc=_0x515d7b?0x0:_0x162f58[_0x9462('0x2f')];var _0xe1bfc1=_0x515d7b?_0x58609e['count']:_0x162f58[_0x9462('0x2f')]+_0x162f58[_0x9462('0x32')];var _0x2e2b74;if(_0xe1bfc1>=_0x1248a5){_0xe1bfc1=_0x1248a5;_0x2e2b74=0xc8;}else{_0x2e2b74=0xce;}_0xaa5a5['status'](_0x2e2b74);return _0xaa5a5[_0x9462('0x33')](_0x9462('0x34'),_0x2989bc+'-'+_0xe1bfc1+'/'+_0x1248a5)[_0x9462('0x2e')](_0x58609e);}return null;};}function patchUpdates(_0x23b2da){return function(_0x4f4953){try{jsonpatch[_0x9462('0x35')](_0x4f4953,_0x23b2da,!![]);}catch(_0xbd3965){return BPromise[_0x9462('0x36')](_0xbd3965);}return _0x4f4953[_0x9462('0x37')]();};}function saveUpdates(_0x476de1,_0x537e77){return function(_0x344b1e){if(_0x344b1e){return _0x344b1e[_0x9462('0x38')](_0x476de1)[_0x9462('0x20')](function(_0x536006){return _0x536006;});}return null;};}function removeEntity(_0x10d703,_0x429ff0){return function(_0x5daffe){if(_0x5daffe){return _0x5daffe[_0x9462('0x39')]()[_0x9462('0x20')](function(){var _0x2ba1d9=_0x5daffe[_0x9462('0x3a')]({'plain':!![]});var _0x46c866=_0x9462('0x3b');return db['UserProfileResource']['destroy']({'where':{'type':_0x46c866,'resourceId':_0x2ba1d9['id']}})['then'](function(){return _0x5daffe;});})[_0x9462('0x20')](function(){_0x10d703[_0x9462('0x2c')](0xcc)[_0x9462('0x2d')]();});}};}function handleEntityNotFound(_0x15656e,_0x14aaf4){return function(_0x3dfa9a){if(!_0x3dfa9a){_0x15656e[_0x9462('0x2b')](0x194);}return _0x3dfa9a;};}function handleError(_0x4f7fef,_0x5dcab0){_0x5dcab0=_0x5dcab0||0x1f4;return function(_0x334403){logger[_0x9462('0x27')](_0x334403['stack']);if(_0x334403[_0x9462('0x3c')]){delete _0x334403[_0x9462('0x3c')];}_0x4f7fef[_0x9462('0x2c')](_0x5dcab0)[_0x9462('0x3d')](_0x334403);};}exports[_0x9462('0x3e')]=function(_0x285137,_0x7b4257){var _0x565162={'include':[{'model':db[_0x9462('0x3f')],'as':'mandatoryDispositionPause'}]},_0x6f6b2a={},_0x968d8b={'count':0x0,'rows':[]};var _0x3da4bf=_[_0x9462('0x40')](db[_0x9462('0x41')][_0x9462('0x42')],function(_0x1b912f){return{'name':_0x1b912f[_0x9462('0x43')],'type':_0x1b912f[_0x9462('0x44')][_0x9462('0x45')]};});_0x6f6b2a['model']=_[_0x9462('0x40')](_0x3da4bf,_0x9462('0x3c'));_0x6f6b2a[_0x9462('0x46')]=_[_0x9462('0x47')](_0x285137['query']);_0x6f6b2a[_0x9462('0x48')]=_[_0x9462('0x49')](_0x6f6b2a['model'],_0x6f6b2a[_0x9462('0x46')]);_0x565162[_0x9462('0x4a')]=_[_0x9462('0x49')](_0x6f6b2a['model'],qs[_0x9462('0x4b')](_0x285137[_0x9462('0x46')][_0x9462('0x4b')]));_0x565162[_0x9462('0x4a')]=_0x565162[_0x9462('0x4a')]['length']?_0x565162[_0x9462('0x4a')]:_0x6f6b2a[_0x9462('0x4c')];if(!_0x285137[_0x9462('0x46')]['hasOwnProperty'](_0x9462('0x4d'))){_0x565162[_0x9462('0x32')]=qs[_0x9462('0x32')](_0x285137[_0x9462('0x46')]['limit']);_0x565162[_0x9462('0x2f')]=qs['offset'](_0x285137['query'][_0x9462('0x2f')]);}_0x565162[_0x9462('0x4e')]=qs[_0x9462('0x4f')](_0x285137['query'][_0x9462('0x4f')]);_0x565162['where']=qs[_0x9462('0x48')](_['pick'](_0x285137[_0x9462('0x46')],_0x6f6b2a[_0x9462('0x48')]),_0x3da4bf);if(_0x285137[_0x9462('0x46')]['filter']){_0x565162[_0x9462('0x50')]=_[_0x9462('0x51')](_0x565162[_0x9462('0x50')],{'$or':_['map'](_0x3da4bf,function(_0x336ff5){if(_0x336ff5[_0x9462('0x44')]!==_0x9462('0x52')){var _0x1a36ee={};_0x1a36ee[_0x336ff5[_0x9462('0x3c')]]={'$like':'%'+_0x285137[_0x9462('0x46')][_0x9462('0x53')]+'%'};return _0x1a36ee;}})});}_0x565162=_[_0x9462('0x51')]({},_0x565162,_0x285137[_0x9462('0x54')]);var _0x193482={'where':_0x565162[_0x9462('0x50')]};return db[_0x9462('0x41')][_0x9462('0x31')](_0x193482)[_0x9462('0x20')](function(_0x2f39cf){_0x968d8b[_0x9462('0x31')]=_0x2f39cf;if(_0x285137[_0x9462('0x46')]['includeAll']){_0x565162[_0x9462('0x55')]=[{'all':!![]}];}return db[_0x9462('0x41')]['findAll'](_0x565162);})[_0x9462('0x20')](function(_0xb39d16){_0x968d8b['rows']=_0xb39d16;return _0x968d8b;})[_0x9462('0x20')](respondWithFilteredResult(_0x7b4257,_0x565162))['catch'](handleError(_0x7b4257,null));};exports[_0x9462('0x56')]=function(_0x4b2212,_0x24a192){var _0x57692b={'raw':![],'where':{'id':_0x4b2212[_0x9462('0x57')]['id']},'include':[{'model':db[_0x9462('0x3f')],'as':_0x9462('0x58')}]},_0x723d19={};_0x723d19[_0x9462('0x4c')]=_[_0x9462('0x47')](db[_0x9462('0x41')]['rawAttributes']);_0x723d19['query']=_[_0x9462('0x47')](_0x4b2212['query']);_0x723d19['filters']=_[_0x9462('0x49')](_0x723d19[_0x9462('0x4c')],_0x723d19[_0x9462('0x46')]);_0x57692b[_0x9462('0x4a')]=_[_0x9462('0x49')](_0x723d19[_0x9462('0x4c')],qs['fields'](_0x4b2212[_0x9462('0x46')]['fields']));_0x57692b['attributes']=_0x57692b[_0x9462('0x4a')]['length']?_0x57692b[_0x9462('0x4a')]:_0x723d19[_0x9462('0x4c')];if(_0x4b2212[_0x9462('0x46')][_0x9462('0x59')]){_0x57692b[_0x9462('0x55')]=[{'all':!![]}];}_0x57692b=_[_0x9462('0x51')]({},_0x57692b,_0x4b2212[_0x9462('0x54')]);return db[_0x9462('0x41')]['find'](_0x57692b)[_0x9462('0x20')](handleEntityNotFound(_0x24a192,null))['then'](respondWithResult(_0x24a192,null))[_0x9462('0x2a')](handleError(_0x24a192,null));};exports[_0x9462('0x5a')]=function(_0x1cdc5d,_0x42e887){return db['OpenchannelAccount']['create'](_0x1cdc5d[_0x9462('0x5b')],{})[_0x9462('0x20')](function(_0x3553b4){var _0x4b0e88=_0x1cdc5d[_0x9462('0x5c')][_0x9462('0x3a')]({'plain':!![]});if(!_0x4b0e88)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b0e88[_0x9462('0x5d')]===_0x9462('0x5c')){var _0x4eca20=_0x3553b4[_0x9462('0x3a')]({'plain':!![]});var _0xcff7c2=_0x9462('0x3b');return db[_0x9462('0x5e')][_0x9462('0x5f')]({'where':{'name':_0xcff7c2,'userProfileId':_0x4b0e88[_0x9462('0x60')]},'raw':!![]})[_0x9462('0x20')](function(_0x4dc8e4){if(_0x4dc8e4&&_0x4dc8e4[_0x9462('0x61')]===0x0){return db[_0x9462('0x62')][_0x9462('0x5a')]({'name':_0x4eca20[_0x9462('0x3c')],'resourceId':_0x4eca20['id'],'type':_0x4dc8e4[_0x9462('0x3c')],'sectionId':_0x4dc8e4['id']},{})[_0x9462('0x20')](function(){return _0x3553b4;});}else{return _0x3553b4;}})[_0x9462('0x2a')](function(_0x42de4a){logger[_0x9462('0x27')](_0x9462('0x63'),_0x42de4a);throw _0x42de4a;});}return _0x3553b4;})[_0x9462('0x20')](respondWithResult(_0x42e887,0xc9))['catch'](handleError(_0x42e887,null));};exports[_0x9462('0x38')]=function(_0x237fd6,_0xdeb888){if(_0x237fd6[_0x9462('0x5b')]['id']){delete _0x237fd6['body']['id'];}return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x237fd6[_0x9462('0x57')]['id']},'include':[{'model':db[_0x9462('0x3f')],'as':_0x9462('0x58')}]})[_0x9462('0x20')](handleEntityNotFound(_0xdeb888,null))[_0x9462('0x20')](saveUpdates(_0x237fd6[_0x9462('0x5b')],null))['then'](respondWithResult(_0xdeb888,null))[_0x9462('0x2a')](handleError(_0xdeb888,null));};exports['destroy']=function(_0x3b2fd9,_0xba10e3){return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x3b2fd9[_0x9462('0x57')]['id']}})[_0x9462('0x20')](handleEntityNotFound(_0xba10e3,null))['then'](removeEntity(_0xba10e3,null))[_0x9462('0x2a')](handleError(_0xba10e3,null));};exports['describe']=function(_0x2d1b34,_0x6641a3){return db[_0x9462('0x41')]['describe']()['then'](respondWithResult(_0x6641a3,null))[_0x9462('0x2a')](handleError(_0x6641a3,null));};exports[_0x9462('0x64')]=function(_0x24f1ef,_0x1eae68,_0x41304d){if(_0x24f1ef[_0x9462('0x5b')]['id']){delete _0x24f1ef[_0x9462('0x5b')]['id'];}return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x24f1ef[_0x9462('0x57')]['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x1eae68,null))[_0x9462('0x20')](function(_0x3f4fdc){if(_0x3f4fdc){_0x24f1ef[_0x9462('0x5b')]['OpenchannelAccountId']=_0x3f4fdc['id'];return db[_0x9462('0x65')][_0x9462('0x5a')](_0x24f1ef['body']);}})[_0x9462('0x20')](respondWithResult(_0x1eae68,null))[_0x9462('0x2a')](handleError(_0x1eae68,null));};exports[_0x9462('0x66')]=function(_0x34058d,_0x145551,_0x54c186){var _0x158a74={'raw':![],'where':{}};var _0x5d27e7={};var _0x2ffcdc={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9462('0x67')]({'where':{'id':_0x34058d[_0x9462('0x57')]['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x145551,null))[_0x9462('0x20')](function(_0x4d40e2){if(_0x4d40e2){_0x5d27e7[_0x9462('0x4c')]=_['keys'](db[_0x9462('0x65')][_0x9462('0x42')]);_0x5d27e7[_0x9462('0x46')]=_[_0x9462('0x47')](_0x34058d['query']);_0x5d27e7[_0x9462('0x48')]=_[_0x9462('0x49')](_0x5d27e7[_0x9462('0x4c')],_0x5d27e7[_0x9462('0x46')]);_0x158a74[_0x9462('0x4a')]=_['intersection'](_0x5d27e7[_0x9462('0x4c')],qs[_0x9462('0x4b')](_0x34058d['query'][_0x9462('0x4b')]));_0x158a74[_0x9462('0x4a')]=_0x158a74[_0x9462('0x4a')][_0x9462('0x68')]?_0x158a74[_0x9462('0x4a')]:_0x5d27e7['model'];if(!_0x34058d[_0x9462('0x46')][_0x9462('0x69')](_0x9462('0x4d'))){_0x158a74['limit']=qs[_0x9462('0x32')](_0x34058d[_0x9462('0x46')][_0x9462('0x32')]);_0x158a74[_0x9462('0x2f')]=qs[_0x9462('0x2f')](_0x34058d[_0x9462('0x46')][_0x9462('0x2f')]);}_0x158a74[_0x9462('0x4e')]=qs[_0x9462('0x4f')](_0x34058d[_0x9462('0x46')][_0x9462('0x4f')]);_0x158a74[_0x9462('0x50')]=qs['filters'](_['pick'](_0x34058d[_0x9462('0x46')],_0x5d27e7[_0x9462('0x48')]));_0x158a74[_0x9462('0x50')][_0x9462('0x6a')]=_0x4d40e2['id'];if(_0x34058d['query'][_0x9462('0x53')]){_0x158a74['where']=_[_0x9462('0x51')](_0x158a74[_0x9462('0x50')],{'$or':_[_0x9462('0x40')](_0x158a74[_0x9462('0x4a')],function(_0x5ed947){var _0x341718={};_0x341718[_0x5ed947]={'$like':'%'+_0x34058d[_0x9462('0x46')]['filter']+'%'};return _0x341718;})});}_0x158a74=_['merge']({},_0x158a74,_0x34058d[_0x9462('0x54')]);return db[_0x9462('0x65')][_0x9462('0x31')]({'where':_0x158a74[_0x9462('0x50')]})[_0x9462('0x20')](function(_0x3c542c){_0x2ffcdc[_0x9462('0x31')]=_0x3c542c;if(_0x34058d[_0x9462('0x46')][_0x9462('0x59')]){_0x158a74[_0x9462('0x55')]=[{'all':!![]}];}return db[_0x9462('0x65')][_0x9462('0x6b')](_0x158a74);})[_0x9462('0x20')](function(_0x359a97){_0x2ffcdc[_0x9462('0x6c')]=_0x359a97;return _0x2ffcdc;});}})['then'](respondWithFilteredResult(_0x145551,_0x158a74))['catch'](handleError(_0x145551,null));};exports[_0x9462('0x6d')]=function(_0x81f981,_0x4ccc80,_0x5db957){return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x81f981['params']['id']}})['then'](handleEntityNotFound(_0x4ccc80,null))[_0x9462('0x20')](function(_0xcc2003){if(_0xcc2003){return _0xcc2003['removeDispositions'](_0x81f981[_0x9462('0x46')][_0x9462('0x6e')]);}})['then'](respondWithStatusCode(_0x4ccc80,null))[_0x9462('0x2a')](handleError(_0x4ccc80,null));};exports['addAnswer']=function(_0x2d27e2,_0x3046aa,_0x2932ba){if(_0x2d27e2[_0x9462('0x5b')]['id']){delete _0x2d27e2['body']['id'];}return db['OpenchannelAccount'][_0x9462('0x5f')]({'where':{'id':_0x2d27e2['params']['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x3046aa,null))[_0x9462('0x20')](function(_0x46a26b){if(_0x46a26b){_0x2d27e2['body'][_0x9462('0x6a')]=_0x46a26b['id'];return db[_0x9462('0x6f')][_0x9462('0x5a')](_0x2d27e2[_0x9462('0x5b')]);}})[_0x9462('0x20')](respondWithResult(_0x3046aa,null))['catch'](handleError(_0x3046aa,null));};exports[_0x9462('0x70')]=function(_0x34efc1,_0x237f63,_0x38a761){var _0x48fbb8={'raw':![],'where':{}};var _0x16ac21={};var _0x1c0305={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9462('0x67')]({'where':{'id':_0x34efc1['params']['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x237f63,null))[_0x9462('0x20')](function(_0x13b76e){if(_0x13b76e){_0x16ac21['model']=_[_0x9462('0x47')](db[_0x9462('0x6f')]['rawAttributes']);_0x16ac21[_0x9462('0x46')]=_[_0x9462('0x47')](_0x34efc1[_0x9462('0x46')]);_0x16ac21[_0x9462('0x48')]=_[_0x9462('0x49')](_0x16ac21[_0x9462('0x4c')],_0x16ac21[_0x9462('0x46')]);_0x48fbb8['attributes']=_['intersection'](_0x16ac21[_0x9462('0x4c')],qs[_0x9462('0x4b')](_0x34efc1['query'][_0x9462('0x4b')]));_0x48fbb8[_0x9462('0x4a')]=_0x48fbb8[_0x9462('0x4a')]['length']?_0x48fbb8['attributes']:_0x16ac21[_0x9462('0x4c')];if(!_0x34efc1[_0x9462('0x46')][_0x9462('0x69')](_0x9462('0x4d'))){_0x48fbb8['limit']=qs[_0x9462('0x32')](_0x34efc1[_0x9462('0x46')]['limit']);_0x48fbb8[_0x9462('0x2f')]=qs[_0x9462('0x2f')](_0x34efc1['query'][_0x9462('0x2f')]);}_0x48fbb8[_0x9462('0x4e')]=qs[_0x9462('0x4f')](_0x34efc1['query'][_0x9462('0x4f')]);_0x48fbb8['where']=qs[_0x9462('0x48')](_[_0x9462('0x71')](_0x34efc1[_0x9462('0x46')],_0x16ac21[_0x9462('0x48')]));_0x48fbb8[_0x9462('0x50')]['OpenchannelAccountId']=_0x13b76e['id'];if(_0x34efc1['query']['filter']){_0x48fbb8[_0x9462('0x50')]=_[_0x9462('0x51')](_0x48fbb8[_0x9462('0x50')],{'$or':_['map'](_0x48fbb8[_0x9462('0x4a')],function(_0x3b414b){var _0x50fc34={};_0x50fc34[_0x3b414b]={'$like':'%'+_0x34efc1[_0x9462('0x46')]['filter']+'%'};return _0x50fc34;})});}_0x48fbb8=_[_0x9462('0x51')]({},_0x48fbb8,_0x34efc1['options']);return db[_0x9462('0x6f')]['count']({'where':_0x48fbb8[_0x9462('0x50')]})[_0x9462('0x20')](function(_0x46c116){_0x1c0305['count']=_0x46c116;if(_0x34efc1[_0x9462('0x46')][_0x9462('0x59')]){_0x48fbb8['include']=[{'all':!![]}];}return db[_0x9462('0x6f')]['findAll'](_0x48fbb8);})['then'](function(_0x2530b9){_0x1c0305[_0x9462('0x6c')]=_0x2530b9;return _0x1c0305;});}})['then'](respondWithFilteredResult(_0x237f63,_0x48fbb8))[_0x9462('0x2a')](handleError(_0x237f63,null));};exports[_0x9462('0x72')]=function(_0x1184b2,_0x26085e,_0x4c182a){return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x1184b2['params']['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x26085e,null))[_0x9462('0x20')](function(_0x14d0ef){if(_0x14d0ef){return _0x14d0ef[_0x9462('0x72')](_0x1184b2[_0x9462('0x46')][_0x9462('0x6e')]);}})[_0x9462('0x20')](respondWithStatusCode(_0x26085e,null))[_0x9462('0x2a')](handleError(_0x26085e,null));};exports[_0x9462('0x73')]=function(_0x12f776,_0x480355,_0x1292b2){var _0x281049={'body':_0x12f776[_0x9462('0x5b')],'channel':_0x9462('0x74')};var _0x73c39=[];var _0x3eaeef=[];var _0x1af529={};var _0x103c6b=![];return db[_0x9462('0x75')][_0x9462('0x76')]()[_0x9462('0x20')](function(_0x3afbe4){if(!_0x3afbe4){throw new db['Sequelize'][(_0x9462('0x77'))](_0x9462('0x78'));}_0x73c39=_[_0x9462('0x79')](_[_0x9462('0x47')](_0x3afbe4),['createdAt',_0x9462('0x7a')]);_0x3eaeef=_[_0x9462('0x79')](_['keys'](_0x3afbe4),[_0x9462('0x7b'),_0x9462('0x7a'),'CompanyId',_0x9462('0x7c')]);if(_0x12f776[_0x9462('0x5b')]['id']){delete _0x12f776['body']['id'];}if(_[_0x9462('0x7d')](_0x12f776[_0x9462('0x5b')][_0x9462('0x7e')])){throw new db[(_0x9462('0x7f'))][(_0x9462('0x77'))]('from\x20is\x20mandatory');}if(_[_0x9462('0x7d')](_0x12f776[_0x9462('0x5b')]['body'])||_0x12f776[_0x9462('0x5b')][_0x9462('0x5b')]===''){throw new db['Sequelize'][(_0x9462('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9462('0x7d')](_0x12f776[_0x9462('0x5b')]['mapKey'])){throw new db[(_0x9462('0x7f'))][(_0x9462('0x77'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3eaeef);}if(!_['includes'](_0x3eaeef,_0x12f776[_0x9462('0x5b')][_0x9462('0x80')])){throw new db[(_0x9462('0x7f'))][(_0x9462('0x77'))](_0x9462('0x81')+_0x3eaeef);}_0x1af529[_0x12f776[_0x9462('0x5b')][_0x9462('0x80')]]=_0x12f776[_0x9462('0x5b')]['from'];})[_0x9462('0x20')](function(){return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x12f776[_0x9462('0x57')]['id']},'include':[{'model':db[_0x9462('0x82')],'as':_0x9462('0x83'),'include':[{'model':db[_0x9462('0x75')],'as':'Contacts','where':_0x1af529,'limit':0x1,'order':[[_0x9462('0x7a'),_0x9462('0x84')]]}]},{'model':db[_0x9462('0x85')],'as':'Applications'}]});})[_0x9462('0x20')](handleEntityNotFound(_0x480355,null))['then'](function(_0x32fef6){if(_0x32fef6&&_0x32fef6[_0x9462('0x83')]){_0x281049[_0x9462('0x86')]=_0x32fef6;_0x281049[_0x9462('0x87')]=_0x32fef6[_0x9462('0x88')];_0x281049[_0x9462('0x89')]=_0x32fef6[_0x9462('0x83')];_0x281049[_0x9462('0x87')]=_[_0x9462('0x8a')](_0x281049['applications'],['priority'],[_0x9462('0x8b')]);if(_0x281049[_0x9462('0x86')][_0x9462('0x88')]){delete _0x281049['account'][_0x9462('0x88')];}if(_0x281049[_0x9462('0x86')]['List']&&_0x281049[_0x9462('0x86')][_0x9462('0x83')]['Contacts'][_0x9462('0x68')]){return _0x281049[_0x9462('0x86')][_0x9462('0x83')]['Contacts'][0x0];}var _0x73318f=_[_0x9462('0x1a')](_0x12f776[_0x9462('0x5b')],{'firstName':_0x12f776[_0x9462('0x5b')]['from'],'ListId':_0x32fef6['ListId']});_0x73318f[_0x12f776[_0x9462('0x5b')][_0x9462('0x80')]]=_0x12f776[_0x9462('0x5b')][_0x9462('0x7e')];return db[_0x9462('0x75')][_0x9462('0x5a')](_0x73318f,{'fields':_0x73c39,'raw':!![]});}})[_0x9462('0x20')](handleEntityNotFound(_0x480355,null))['then'](function(_0x3fe3d7){_0x281049[_0x9462('0x8c')]=_0x3fe3d7;if(_0x3fe3d7){var _0x1f448e={'ContactId':_0x3fe3d7['id'],'OpenchannelAccountId':_0x12f776[_0x9462('0x57')]['id'],'from':(_0x3fe3d7[_0x9462('0x8d')]||'')+'\x20'+(_0x3fe3d7['lastName']||'')};var _0x591e16={'OpenchannelAccountId':_0x12f776[_0x9462('0x57')]['id'],'closed':![]};if(_0x12f776[_0x9462('0x5b')]['threadId']){_0x591e16[_0x9462('0x8e')]=_0x12f776[_0x9462('0x5b')][_0x9462('0x8e')];return db[_0x9462('0x8f')][_0x9462('0x5f')]({'where':_0x591e16})[_0x9462('0x20')](function(_0x1a9f78){if(_0x1a9f78){return[_0x1a9f78,![]];}_0x1f448e['threadId']=_0x12f776[_0x9462('0x5b')][_0x9462('0x8e')];_0x1f448e[_0x9462('0x90')]=_0x12f776['body']['externalUrl'];return db[_0x9462('0x8f')][_0x9462('0x5a')](_0x1f448e)['then'](function(_0x889c2c){return[_0x889c2c,!![]];});});}else{_0x591e16['threadId']=null;}_0x591e16['ContactId']=_0x3fe3d7['id'];return db['OpenchannelInteraction'][_0x9462('0x5f')]({'where':_0x591e16})['then'](function(_0x580cfa){if(_0x580cfa){return[_0x580cfa,![]];}return db[_0x9462('0x8f')][_0x9462('0x5a')](_0x1f448e)[_0x9462('0x20')](function(_0x4934e4){return[_0x4934e4,!![]];});});}})[_0x9462('0x91')](function(_0xd3a214,_0x286488){if(_0xd3a214){_0x103c6b=_0x286488;if(!_0x286488){var _0x545637={'from':(_0x281049[_0x9462('0x8c')][_0x9462('0x8d')]||'')+'\x20'+(_0x281049[_0x9462('0x8c')][_0x9462('0x92')]||'')};if(_0x12f776[_0x9462('0x5b')][_0x9462('0x8e')]&&_0x12f776['body'][_0x9462('0x93')]&&_0x12f776[_0x9462('0x5b')][_0x9462('0x8e')]!=_0x12f776[_0x9462('0x5b')][_0x9462('0x93')]){_0x545637[_0x9462('0x8e')]=_0x12f776['body'][_0x9462('0x93')];}return _0xd3a214[_0x9462('0x38')](_0x545637);}else{return _0xd3a214;}}})[_0x9462('0x20')](function(_0x224dd6){_0x281049['interaction']=_0x224dd6['get']({'plain':!![]});_0x281049[_0x9462('0x94')][_0x9462('0x95')]=_0x103c6b;if(_0x281049[_0x9462('0x94')][_0x9462('0x95')]){if(_0x281049[_0x9462('0x86')][_0x9462('0x96')]){_0x281049['applications'][_0x9462('0x97')]({'id':0x0,'priority':_0x281049['applications'][_0x9462('0x68')]+0x1,'app':_0x9462('0x98'),'appdata':'unmanaged','interval':_0x9462('0x99')});}}return db[_0x9462('0x9a')][_0x9462('0x5a')]({'body':_0x12f776[_0x9462('0x5b')][_0x9462('0x5b')],'OpenchannelAccountId':_0x12f776[_0x9462('0x57')]['id'],'OpenchannelInteractionId':_0x224dd6['id'],'direction':'in','ContactId':_0x281049[_0x9462('0x8c')]['id'],'AttachmentId':_0x12f776[_0x9462('0x5b')][_0x9462('0x9b')]});})[_0x9462('0x20')](function(_0x547c18){_0x281049['message']=_0x547c18;if(!_0x281049['interaction'][_0x9462('0x9c')])return;return db[_0x9462('0x9d')][_0x9462('0x5f')]({'attributes':['id',_0x9462('0x3c')],'where':{'id':_0x281049['interaction'][_0x9462('0x9c')]}});})['then'](function(_0x3eee17){if(_0x3eee17){_0x281049[_0x9462('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9462('0x9e'),'appdata':_0x3eee17[_0x9462('0x3c')]+','+(_0x281049[_0x9462('0x86')][_0x9462('0x9f')]||0xa),'interval':_0x9462('0x99')});}if(!_0x281049[_0x9462('0x94')][_0x9462('0xa0')])return;return db['OpenchannelQueue'][_0x9462('0x5f')]({'attributes':['id',_0x9462('0x3c')],'where':{'id':_0x281049['interaction'][_0x9462('0xa0')]}});})[_0x9462('0x20')](function(_0x50d0b6){if(_0x50d0b6){_0x281049[_0x9462('0x87')][_0x9462('0xa1')]({'id':0x0,'priority':0x1,'app':_0x9462('0xa2'),'appdata':_0x50d0b6[_0x9462('0x3c')]+','+(_0x281049[_0x9462('0x86')][_0x9462('0xa3')]||0x12c),'interval':_0x9462('0x99')});}return respondWithRpcPromise(_0x9462('0xa4'),_0x9462('0xa5'),_0x281049);})['then'](function(_0x57fed2){respondWithRpcPromise('EventManager',_0x9462('0xa6'),{'event':'notify','message':_0x57fed2},client9002);return _0x57fed2;})['then'](respondWithResult(_0x480355,null))[_0x9462('0x2a')](handleError(_0x480355,null));};exports[_0x9462('0xa7')]=function(_0x5110ff,_0x238de7){var _0x4dc84f=_0x5110ff[_0x9462('0x57')]['id'];var _0xf65dc3=_0x5110ff[_0x9462('0x5b')];var _0x43c44c=0xc8;var _0x4e3514=null;return db[_0x9462('0xa8')][_0x9462('0xa9')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x9462('0xaa')]},function(_0x3c5db8){return db[_0x9462('0x41')][_0x9462('0x67')]({'where':{'id':_0x4dc84f},'transaction':_0x3c5db8})['then'](function(_0x2dc116){if(_0x2dc116){return db['OpenchannelApplication'][_0x9462('0x39')]({'where':{'OpenchannelAccountId':_0x4dc84f},'transaction':_0x3c5db8})['then'](function(){var _0x1ae02c=_[_0x9462('0x40')](_0xf65dc3,function(_0x19d0b5){_0x19d0b5[_0x9462('0x6a')]=_0x4dc84f;return _0x19d0b5;});return db[_0x9462('0x85')][_0x9462('0xab')](_0x1ae02c,{'transaction':_0x3c5db8});});}else{_0x43c44c=0x194;_0x4e3514=[];}});})[_0x9462('0x20')](function(){if(_0x43c44c!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x4dc84f},'order':'priority'})[_0x9462('0x20')](function(_0x170ef3){_0x4e3514=_0x170ef3;});}})[_0x9462('0x2a')](function(_0x5b3301){_0x43c44c=0x1f4;logger['error'](_0x5b3301[_0x9462('0xac')]);if(_0x5b3301['name']){delete _0x5b3301['name'];}_0x4e3514=_0x5b3301;})['finally'](function(){if(_0x4e3514===null){_0x238de7['sendStatus'](_0x43c44c);}else{if(_0x43c44c===0x1f4){_0x238de7[_0x9462('0x2c')](_0x43c44c)[_0x9462('0x3d')](_0x4e3514);}else{_0x238de7['status'](_0x43c44c)[_0x9462('0x2e')](_0x4e3514);}}});};exports[_0x9462('0xad')]=function(_0xbf7c27,_0x1231a0,_0x40d752){var _0x48ca3b={};var _0x620d09={};var _0x3c2656;var _0x274bcd;return db['OpenchannelAccount']['findOne']({'where':{'id':_0xbf7c27[_0x9462('0x57')]['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x1231a0,null))[_0x9462('0x20')](function(_0xfccb37){if(_0xfccb37){_0x3c2656=_0xfccb37;_0x620d09[_0x9462('0x4c')]=_[_0x9462('0x47')](db['OpenchannelApplication'][_0x9462('0x42')]);_0x620d09['query']=_[_0x9462('0x47')](_0xbf7c27[_0x9462('0x46')]);_0x620d09[_0x9462('0x48')]=_['intersection'](_0x620d09['model'],_0x620d09['query']);_0x48ca3b[_0x9462('0x4a')]=_[_0x9462('0x49')](_0x620d09[_0x9462('0x4c')],qs['fields'](_0xbf7c27[_0x9462('0x46')][_0x9462('0x4b')]));_0x48ca3b[_0x9462('0x4a')]=_0x48ca3b[_0x9462('0x4a')][_0x9462('0x68')]?_0x48ca3b[_0x9462('0x4a')]:_0x620d09['model'];_0x48ca3b[_0x9462('0x4e')]=qs['sort'](_0xbf7c27[_0x9462('0x46')][_0x9462('0x4f')]);_0x48ca3b[_0x9462('0x50')]=qs[_0x9462('0x48')](_['pick'](_0xbf7c27[_0x9462('0x46')],_0x620d09[_0x9462('0x48')]));if(_0xbf7c27[_0x9462('0x46')][_0x9462('0x53')]){_0x48ca3b[_0x9462('0x50')]=_[_0x9462('0x51')](_0x48ca3b['where'],{'$or':_['map'](_0x48ca3b[_0x9462('0x4a')],function(_0x1b0a3c){var _0x164fd1={};_0x164fd1[_0x1b0a3c]={'$like':'%'+_0xbf7c27['query'][_0x9462('0x53')]+'%'};return _0x164fd1;})});}_0x48ca3b=_['merge']({},_0x48ca3b,_0xbf7c27[_0x9462('0x54')]);return _0x3c2656[_0x9462('0xad')](_0x48ca3b);}})[_0x9462('0x20')](function(_0x4ae2a7){if(_0x4ae2a7){_0x274bcd=_0x4ae2a7[_0x9462('0x68')];if(!_0xbf7c27[_0x9462('0x46')]['hasOwnProperty']('nolimit')){_0x48ca3b[_0x9462('0x32')]=qs['limit'](_0xbf7c27[_0x9462('0x46')][_0x9462('0x32')]);_0x48ca3b[_0x9462('0x2f')]=qs['offset'](_0xbf7c27[_0x9462('0x46')][_0x9462('0x2f')]);}return _0x3c2656[_0x9462('0xad')](_0x48ca3b);}})[_0x9462('0x20')](function(_0x2a2df5){if(_0x2a2df5){return _0x2a2df5?{'count':_0x274bcd,'rows':_0x2a2df5}:null;}})[_0x9462('0x20')](respondWithResult(_0x1231a0,null))[_0x9462('0x2a')](handleError(_0x1231a0,null));};exports[_0x9462('0xae')]=function(_0x3a7a17,_0x12f3c9,_0xfe1adb){var _0x23c24d={'raw':![],'where':{}};var _0x38b048={};var _0xbd40d6={'count':0x0,'rows':[]};return db[_0x9462('0x41')]['findOne']({'where':{'id':_0x3a7a17[_0x9462('0x57')]['id']}})['then'](handleEntityNotFound(_0x12f3c9,null))['then'](function(_0x2adf9f){if(_0x2adf9f){_0x38b048['model']=_[_0x9462('0x47')](db[_0x9462('0x8f')][_0x9462('0x42')]);_0x38b048['query']=_['keys'](_0x3a7a17['query']);_0x38b048['filters']=_[_0x9462('0x49')](_0x38b048[_0x9462('0x4c')],_0x38b048[_0x9462('0x46')]);_0x23c24d[_0x9462('0x4a')]=_['intersection'](_0x38b048[_0x9462('0x4c')],qs[_0x9462('0x4b')](_0x3a7a17[_0x9462('0x46')][_0x9462('0x4b')]));_0x23c24d[_0x9462('0x4a')]=_0x23c24d[_0x9462('0x4a')][_0x9462('0x68')]?_0x23c24d[_0x9462('0x4a')]:_0x38b048[_0x9462('0x4c')];if(!_0x3a7a17[_0x9462('0x46')][_0x9462('0x69')]('nolimit')){_0x23c24d['limit']=qs[_0x9462('0x32')](_0x3a7a17[_0x9462('0x46')][_0x9462('0x32')]);_0x23c24d[_0x9462('0x2f')]=qs[_0x9462('0x2f')](_0x3a7a17[_0x9462('0x46')][_0x9462('0x2f')]);}_0x23c24d[_0x9462('0x4e')]=qs[_0x9462('0x4f')](_0x3a7a17[_0x9462('0x46')][_0x9462('0x4f')]);_0x23c24d[_0x9462('0x50')]=qs[_0x9462('0x48')](_[_0x9462('0x71')](_0x3a7a17[_0x9462('0x46')],_0x38b048[_0x9462('0x48')]));_0x23c24d[_0x9462('0x50')][_0x9462('0x6a')]=_0x2adf9f['id'];if(_0x3a7a17['query']['filter']){_0x23c24d['where']=_[_0x9462('0x51')](_0x23c24d[_0x9462('0x50')],{'$or':_['map'](_0x23c24d[_0x9462('0x4a')],function(_0x2308bb){var _0x2f483f={};_0x2f483f[_0x2308bb]={'$like':'%'+_0x3a7a17[_0x9462('0x46')][_0x9462('0x53')]+'%'};return _0x2f483f;})});}_0x23c24d=_[_0x9462('0x51')]({},_0x23c24d,_0x3a7a17['options']);return db[_0x9462('0x8f')][_0x9462('0x31')]({'where':_0x23c24d['where']})[_0x9462('0x20')](function(_0xe45cc){_0xbd40d6['count']=_0xe45cc;if(_0x3a7a17[_0x9462('0x46')][_0x9462('0x59')]){_0x23c24d[_0x9462('0x55')]=[{'model':db['CmContact'],'as':_0x9462('0xaf'),'required':![]},{'model':db[_0x9462('0x9d')],'as':_0x9462('0xb0'),'attributes':['name',_0x9462('0xb1'),_0x9462('0xb2')],'required':![]},{'model':db[_0x9462('0xb3')],'as':'Tags','attributes':['id',_0x9462('0x3c'),_0x9462('0xb4')],'where':_0x3a7a17[_0x9462('0x46')]['tag']?{'id':_0x3a7a17['query'][_0x9462('0xb5')]}:undefined,'required':_0x3a7a17[_0x9462('0x46')][_0x9462('0xb5')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x9462('0x6b')](_0x23c24d);})[_0x9462('0x20')](function(_0x158186){_0xbd40d6[_0x9462('0x6c')]=_0x158186;return _0xbd40d6;});}})[_0x9462('0x20')](respondWithFilteredResult(_0x12f3c9,_0x23c24d))['catch'](handleError(_0x12f3c9,null));};exports[_0x9462('0xb6')]=function(_0x9e7148,_0x289126,_0x533574){return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x9e7148[_0x9462('0x57')]['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x289126,null))[_0x9462('0x20')](function(_0x17faf5){if(_0x17faf5){return _0x17faf5[_0x9462('0xb6')](_0x9e7148[_0x9462('0x5b')][_0x9462('0x6e')],_['omit'](_0x9e7148[_0x9462('0x5b')],['ids','id'])||{})[_0x9462('0x91')](function(_0x572834){for(var _0x2bd597=0x0;_0x2bd597<_0x9e7148[_0x9462('0x5b')]['ids'][_0x9462('0x68')];_0x2bd597+=0x1){socket[_0x9462('0xb7')](_0x9462('0xb8'),{'UserId':Number(_0x9e7148[_0x9462('0x5b')][_0x9462('0x6e')][_0x2bd597]),'OpenchannelAccountId':Number(_0x9e7148[_0x9462('0x57')]['id'])});}return _0x572834;});}})[_0x9462('0x20')](respondWithResult(_0x289126,null))[_0x9462('0x2a')](handleError(_0x289126,null));};exports[_0x9462('0xb9')]=function(_0x1e3d5b,_0x4c1c39,_0x7a8884){return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x1e3d5b['params']['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x4c1c39,null))[_0x9462('0x20')](function(_0x49627e){if(_0x49627e){return _0x49627e[_0x9462('0xb9')](_0x1e3d5b[_0x9462('0x46')][_0x9462('0x6e')])['then'](function(){if(_[_0x9462('0xba')](_0x1e3d5b[_0x9462('0x46')]['ids'])){for(var _0x1caf7d=0x0;_0x1caf7d<_0x1e3d5b['query'][_0x9462('0x6e')][_0x9462('0x68')];_0x1caf7d+=0x1){socket[_0x9462('0xb7')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1e3d5b[_0x9462('0x46')][_0x9462('0x6e')][_0x1caf7d]),'OpenchannelAccountId':Number(_0x1e3d5b[_0x9462('0x57')]['id'])});}}else{socket[_0x9462('0xb7')](_0x9462('0xbb'),{'UserId':Number(_0x1e3d5b[_0x9462('0x46')][_0x9462('0x6e')]),'OpenchannelAccountId':Number(_0x1e3d5b['params']['id'])});}});}})[_0x9462('0x20')](respondWithStatusCode(_0x4c1c39,null))[_0x9462('0x2a')](handleError(_0x4c1c39,null));};exports[_0x9462('0xbc')]=function(_0x44dc47,_0xc90ec3,_0x4e8b96){var _0x51772e={};var _0x3f97b8={};var _0x2eecca;var _0x22b973;return db[_0x9462('0x41')]['findOne']({'where':{'id':_0x44dc47[_0x9462('0x57')]['id']}})[_0x9462('0x20')](handleEntityNotFound(_0xc90ec3,null))[_0x9462('0x20')](function(_0x5141ce){if(_0x5141ce){_0x2eecca=_0x5141ce;_0x3f97b8[_0x9462('0x4c')]=_['keys'](db[_0x9462('0x9d')][_0x9462('0x42')]);_0x3f97b8[_0x9462('0x46')]=_[_0x9462('0x47')](_0x44dc47[_0x9462('0x46')]);_0x3f97b8[_0x9462('0x48')]=_['intersection'](_0x3f97b8['model'],_0x3f97b8[_0x9462('0x46')]);_0x51772e[_0x9462('0x4a')]=_[_0x9462('0x49')](_0x3f97b8['model'],qs[_0x9462('0x4b')](_0x44dc47[_0x9462('0x46')][_0x9462('0x4b')]));_0x51772e[_0x9462('0x4a')]=_0x51772e[_0x9462('0x4a')][_0x9462('0x68')]?_0x51772e[_0x9462('0x4a')]:_0x3f97b8['model'];_0x51772e[_0x9462('0x4e')]=qs[_0x9462('0x4f')](_0x44dc47[_0x9462('0x46')][_0x9462('0x4f')]);_0x51772e[_0x9462('0x50')]=qs[_0x9462('0x48')](_[_0x9462('0x71')](_0x44dc47['query'],_0x3f97b8[_0x9462('0x48')]));if(_0x44dc47[_0x9462('0x46')][_0x9462('0x53')]){_0x51772e[_0x9462('0x50')]=_[_0x9462('0x51')](_0x51772e[_0x9462('0x50')],{'$or':_['map'](_0x51772e['attributes'],function(_0x252e8a){var _0x3d37ca={};_0x3d37ca[_0x252e8a]={'$like':'%'+_0x44dc47[_0x9462('0x46')][_0x9462('0x53')]+'%'};return _0x3d37ca;})});}_0x51772e=_[_0x9462('0x51')]({},_0x51772e,_0x44dc47[_0x9462('0x54')]);return _0x2eecca[_0x9462('0xbc')](_0x51772e);}})[_0x9462('0x20')](function(_0x5be014){if(_0x5be014){_0x22b973=_0x5be014['length'];if(!_0x44dc47[_0x9462('0x46')][_0x9462('0x69')](_0x9462('0x4d'))){_0x51772e[_0x9462('0x32')]=qs[_0x9462('0x32')](_0x44dc47['query'][_0x9462('0x32')]);_0x51772e['offset']=qs['offset'](_0x44dc47[_0x9462('0x46')][_0x9462('0x2f')]);}return _0x2eecca[_0x9462('0xbc')](_0x51772e);}})[_0x9462('0x20')](function(_0x3682a8){if(_0x3682a8){return _0x3682a8?{'count':_0x22b973,'rows':_0x3682a8}:null;}})['then'](respondWithResult(_0xc90ec3,null))[_0x9462('0x2a')](handleError(_0xc90ec3,null));};exports[_0x9462('0x3d')]=function(_0x11b812,_0x373c1a,_0x3fcc20){var _0x575d56,_0x238b2d,_0x430512;if(_[_0x9462('0x7d')](_0x11b812['body'][_0x9462('0x5b')])||_0x11b812[_0x9462('0x5b')][_0x9462('0x5b')]===''){throw new db['Sequelize'][(_0x9462('0x77'))](_0x9462('0xbd'));}if(_[_0x9462('0x7d')](_0x11b812['body']['to'])){}_0x575d56=_0x11b812['body']['to'];return db[_0x9462('0x41')][_0x9462('0x67')]({'where':{'id':_0x11b812['params']['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x373c1a,null))[_0x9462('0x20')](function(_0x313fbb){if(_0x313fbb){return db['OpenchannelAccount']['find']({'where':{'id':_0x313fbb['id']},'include':[{'model':db[_0x9462('0x82')],'as':_0x9462('0x83'),'include':[{'model':db[_0x9462('0x75')],'as':_0x9462('0xbe'),'where':{[_0x313fbb['mapKey']]:_0x575d56},'limit':0x1,'order':[['updatedAt',_0x9462('0x84')]]}]}]})['then'](handleEntityNotFound(_0x373c1a,null))[_0x9462('0x20')](function(_0x5bb350){if(_0x5bb350&&_0x5bb350['List']){_0x238b2d=_0x5bb350[_0x9462('0x3a')]({'plain':!![]});if(_0x238b2d[_0x9462('0x83')]&&_0x238b2d[_0x9462('0x83')][_0x9462('0xbe')][_0x9462('0x68')]){return _0x238b2d[_0x9462('0x83')][_0x9462('0xbe')][0x0];}return db[_0x9462('0x75')][_0x9462('0x5a')](_[_0x9462('0x1a')](_0x11b812[_0x9462('0x5b')],{'firstName':_0x575d56,[_0x5bb350[_0x9462('0x80')]]:_0x575d56,'phone':_0x575d56,'ListId':_0x238b2d[_0x9462('0x7c')]}));}})['then'](handleEntityNotFound(_0x373c1a,null))[_0x9462('0x20')](function(_0x264343){if(_0x264343){_0x430512=_0x264343;return db[_0x9462('0x8f')]['find']({'where':{'ContactId':_0x430512['id'],'closed':![],'OpenchannelAccountId':_0x238b2d['id']}})[_0x9462('0x20')](function(_0x335225){if(_0x335225){return[_0x335225,![]];}return db[_0x9462('0x8f')][_0x9462('0x5a')]({'UserId':_0x11b812['user']['id'],'ContactId':_0x430512['id'],'OpenchannelAccountId':_0x238b2d['id'],'lastMsgDirection':_0x9462('0xbf'),'firstMsgDirection':_0x9462('0xbf'),'Messages':[_[_0x9462('0x51')](_0x11b812[_0x9462('0x5b')],{'read':![],'body':_0x11b812['body']['body'],'OpenchannelAccountId':_0x238b2d['id'],'UserId':_0x11b812[_0x9462('0x5c')]['id'],'ContactId':_0x430512['id']})]},{'include':[{'model':db[_0x9462('0x9a')],'as':_0x9462('0xc0')}]})[_0x9462('0x20')](function(_0x190e50){return[_0x190e50,!![]];});});}})[_0x9462('0x91')](function(_0x24d1ef,_0xd920ac){if(_0xd920ac){return _0x24d1ef;}return db[_0x9462('0x9a')]['create'](_['merge'](_0x11b812['body'],{'read':![],'body':_0x11b812[_0x9462('0x5b')][_0x9462('0x5b')],'OpenchannelAccountId':_0x238b2d['id'],'OpenchannelInteractionId':_0x24d1ef['id'],'UserId':_0x11b812[_0x9462('0x5c')]['id'],'ContactId':_0x430512['id']}))['then'](function(_0x15367a){_0x24d1ef[_0x9462('0xc1')]['Messages']=[];_0x24d1ef[_0x9462('0xc1')][_0x9462('0xc0')][_0x9462('0x97')](_0x15367a['dataValues']);return _0x24d1ef;});});}})[_0x9462('0x20')](respondWithResult(_0x373c1a,null))[_0x9462('0x2a')](handleError(_0x373c1a,null));}; \ No newline at end of file +var _0xeedb=['count','set','Content-Range','reject','save','update','then','destroy','OpenchannelAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','options','include','findAll','show','params','intersection','merge','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','hasOwnProperty','order','rows','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','DESC','account','applications','Applications','list','priority','asc','Contacts','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','close','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','OpenchannelApplication','bulkCreate','findAndCountAll','stack','getApplications','getInteractions','includeAll','internal','Tag','Tags','color','tag','addAgents','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','dataValues','Messages','push','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x166e2e,_0x1c81cb){var _0x31f15e=function(_0x2c1b01){while(--_0x2c1b01){_0x166e2e['push'](_0x166e2e['shift']());}};_0x31f15e(++_0x1c81cb);}(_0xeedb,0x159));var _0xbeed=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xeedb[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0xbeed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbeed('0x1'));var jsonpatch=require(_0xbeed('0x2'));var rp=require(_0xbeed('0x3'));var moment=require(_0xbeed('0x4'));var BPromise=require(_0xbeed('0x5'));var Mustache=require(_0xbeed('0x6'));var util=require('util');var path=require(_0xbeed('0x7'));var sox=require(_0xbeed('0x8'));var csv=require(_0xbeed('0x9'));var ejs=require(_0xbeed('0xa'));var fs=require('fs');var fs_extra=require(_0xbeed('0xb'));var _=require('lodash');var squel=require(_0xbeed('0xc'));var crypto=require(_0xbeed('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbeed('0x9'));var querystring=require(_0xbeed('0xe'));var Papa=require(_0xbeed('0xf'));var Redis=require('ioredis');var authService=require(_0xbeed('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbeed('0x11'));var hardwareService=require(_0xbeed('0x12'));var logger=require(_0xbeed('0x13'))('api');var utils=require(_0xbeed('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbeed('0x15')]=_[_0xbeed('0x16')](config[_0xbeed('0x15')],{'host':_0xbeed('0x17'),'port':0x18eb});var socket=require(_0xbeed('0x18'))(new Redis(config[_0xbeed('0x15')]));require(_0xbeed('0x19'))[_0xbeed('0x1a')](socket);var jayson=require(_0xbeed('0x1b'));var client=jayson[_0xbeed('0x1c')][_0xbeed('0x1d')]({'port':0x232c});var client9002=jayson[_0xbeed('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a1649,_0x258de0,_0x2bfe3f,_0x578c0d){return new BPromise(function(_0x5d0288,_0x277267){var _0x16c684=_0x578c0d||client;return _0x16c684[_0xbeed('0x1e')](_0x4a1649,_0x2bfe3f)['then'](function(_0x5a4a3b){logger[_0xbeed('0x1f')](_0xbeed('0x20'),_0x258de0,'request\x20sent');logger[_0xbeed('0x21')](_0xbeed('0x22'),_0x258de0,_0xbeed('0x23'),JSON['stringify'](_0x5a4a3b));if(_0x5a4a3b[_0xbeed('0x24')]){if(_0x5a4a3b[_0xbeed('0x24')][_0xbeed('0x25')]===0x1f4){logger[_0xbeed('0x24')](_0xbeed('0x20'),_0x258de0,_0x5a4a3b['error'][_0xbeed('0x26')]);return _0x277267(_0x5a4a3b[_0xbeed('0x24')][_0xbeed('0x26')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x258de0,_0x5a4a3b[_0xbeed('0x24')][_0xbeed('0x26')]);return _0x5d0288(_0x5a4a3b[_0xbeed('0x24')][_0xbeed('0x26')]);}else{logger[_0xbeed('0x1f')](_0xbeed('0x20'),_0x258de0,_0xbeed('0x23'));_0x5d0288(_0x5a4a3b['result'][_0xbeed('0x26')]);}})[_0xbeed('0x27')](function(_0x1fb547){logger[_0xbeed('0x24')](_0xbeed('0x20'),_0x258de0,_0x1fb547);_0x277267(_0x1fb547);});});}function respondWithStatusCode(_0x131782,_0x11a2b1){_0x11a2b1=_0x11a2b1||0xcc;return function(_0x208ed8){if(_0x208ed8){return _0x131782[_0xbeed('0x28')](_0x11a2b1);}return _0x131782[_0xbeed('0x29')](_0x11a2b1)[_0xbeed('0x2a')]();};}function respondWithResult(_0x17870e,_0x1ed181){_0x1ed181=_0x1ed181||0xc8;return function(_0x224234){if(_0x224234){return _0x17870e[_0xbeed('0x29')](_0x1ed181)[_0xbeed('0x2b')](_0x224234);}};}function respondWithFilteredResult(_0x13257f,_0x47f30d){return function(_0x571826){if(_0x571826){var _0x1da436=typeof _0x47f30d[_0xbeed('0x2c')]===_0xbeed('0x2d')&&typeof _0x47f30d[_0xbeed('0x2e')]===_0xbeed('0x2d');var _0x1b0d9b=_0x571826[_0xbeed('0x2f')];var _0x59d36e=_0x1da436?0x0:_0x47f30d[_0xbeed('0x2c')];var _0xa9c1b3=_0x1da436?_0x571826[_0xbeed('0x2f')]:_0x47f30d[_0xbeed('0x2c')]+_0x47f30d['limit'];var _0x3f11b1;if(_0xa9c1b3>=_0x1b0d9b){_0xa9c1b3=_0x1b0d9b;_0x3f11b1=0xc8;}else{_0x3f11b1=0xce;}_0x13257f[_0xbeed('0x29')](_0x3f11b1);return _0x13257f[_0xbeed('0x30')](_0xbeed('0x31'),_0x59d36e+'-'+_0xa9c1b3+'/'+_0x1b0d9b)[_0xbeed('0x2b')](_0x571826);}return null;};}function patchUpdates(_0x2c5291){return function(_0x4ef37b){try{jsonpatch['apply'](_0x4ef37b,_0x2c5291,!![]);}catch(_0x4d6d1d){return BPromise[_0xbeed('0x32')](_0x4d6d1d);}return _0x4ef37b[_0xbeed('0x33')]();};}function saveUpdates(_0x2a769f,_0x5d8ea8){return function(_0x2025f5){if(_0x2025f5){return _0x2025f5[_0xbeed('0x34')](_0x2a769f)[_0xbeed('0x35')](function(_0x302745){return _0x302745;});}return null;};}function removeEntity(_0x111132,_0x58ee99){return function(_0x4cf860){if(_0x4cf860){return _0x4cf860[_0xbeed('0x36')]()[_0xbeed('0x35')](function(){var _0x2fcf1e=_0x4cf860['get']({'plain':!![]});var _0x7d96a7=_0xbeed('0x37');return db[_0xbeed('0x38')]['destroy']({'where':{'type':_0x7d96a7,'resourceId':_0x2fcf1e['id']}})[_0xbeed('0x35')](function(){return _0x4cf860;});})[_0xbeed('0x35')](function(){_0x111132[_0xbeed('0x29')](0xcc)[_0xbeed('0x2a')]();});}};}function handleEntityNotFound(_0x357be0,_0x208737){return function(_0x20524d){if(!_0x20524d){_0x357be0['sendStatus'](0x194);}return _0x20524d;};}function handleError(_0x57ed9e,_0x1137c1){_0x1137c1=_0x1137c1||0x1f4;return function(_0x585d2e){logger['error'](_0x585d2e['stack']);if(_0x585d2e[_0xbeed('0x39')]){delete _0x585d2e[_0xbeed('0x39')];}_0x57ed9e[_0xbeed('0x29')](_0x1137c1)[_0xbeed('0x3a')](_0x585d2e);};}exports[_0xbeed('0x3b')]=function(_0x44a11e,_0xd8e0fc){var _0x212309={'include':[{'model':db[_0xbeed('0x3c')],'as':_0xbeed('0x3d')}]},_0x212ba8={},_0x385ba0={'count':0x0,'rows':[]};var _0x54f5d9=_['map'](db[_0xbeed('0x3e')][_0xbeed('0x3f')],function(_0x4ab05e){return{'name':_0x4ab05e[_0xbeed('0x40')],'type':_0x4ab05e[_0xbeed('0x41')][_0xbeed('0x42')]};});_0x212ba8['model']=_[_0xbeed('0x43')](_0x54f5d9,_0xbeed('0x39'));_0x212ba8[_0xbeed('0x44')]=_[_0xbeed('0x45')](_0x44a11e[_0xbeed('0x44')]);_0x212ba8['filters']=_['intersection'](_0x212ba8[_0xbeed('0x46')],_0x212ba8[_0xbeed('0x44')]);_0x212309['attributes']=_['intersection'](_0x212ba8[_0xbeed('0x46')],qs[_0xbeed('0x47')](_0x44a11e['query']['fields']));_0x212309[_0xbeed('0x48')]=_0x212309[_0xbeed('0x48')][_0xbeed('0x49')]?_0x212309[_0xbeed('0x48')]:_0x212ba8['model'];if(!_0x44a11e[_0xbeed('0x44')]['hasOwnProperty'](_0xbeed('0x4a'))){_0x212309[_0xbeed('0x2e')]=qs[_0xbeed('0x2e')](_0x44a11e[_0xbeed('0x44')]['limit']);_0x212309['offset']=qs[_0xbeed('0x2c')](_0x44a11e[_0xbeed('0x44')]['offset']);}_0x212309['order']=qs[_0xbeed('0x4b')](_0x44a11e[_0xbeed('0x44')]['sort']);_0x212309[_0xbeed('0x4c')]=qs[_0xbeed('0x4d')](_[_0xbeed('0x4e')](_0x44a11e[_0xbeed('0x44')],_0x212ba8[_0xbeed('0x4d')]),_0x54f5d9);if(_0x44a11e[_0xbeed('0x44')][_0xbeed('0x4f')]){_0x212309[_0xbeed('0x4c')]=_['merge'](_0x212309[_0xbeed('0x4c')],{'$or':_['map'](_0x54f5d9,function(_0x38dd91){if(_0x38dd91[_0xbeed('0x41')]!==_0xbeed('0x50')){var _0x55748d={};_0x55748d[_0x38dd91[_0xbeed('0x39')]]={'$like':'%'+_0x44a11e[_0xbeed('0x44')][_0xbeed('0x4f')]+'%'};return _0x55748d;}})});}_0x212309=_['merge']({},_0x212309,_0x44a11e[_0xbeed('0x51')]);var _0x20ab96={'where':_0x212309[_0xbeed('0x4c')]};return db[_0xbeed('0x3e')][_0xbeed('0x2f')](_0x20ab96)[_0xbeed('0x35')](function(_0x549b12){_0x385ba0[_0xbeed('0x2f')]=_0x549b12;if(_0x44a11e[_0xbeed('0x44')]['includeAll']){_0x212309[_0xbeed('0x52')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xbeed('0x53')](_0x212309);})[_0xbeed('0x35')](function(_0x1bffeb){_0x385ba0['rows']=_0x1bffeb;return _0x385ba0;})['then'](respondWithFilteredResult(_0xd8e0fc,_0x212309))['catch'](handleError(_0xd8e0fc,null));};exports[_0xbeed('0x54')]=function(_0x28808e,_0x231e32){var _0x56b73f={'raw':![],'where':{'id':_0x28808e[_0xbeed('0x55')]['id']},'include':[{'model':db[_0xbeed('0x3c')],'as':'mandatoryDispositionPause'}]},_0x183bd6={};_0x183bd6[_0xbeed('0x46')]=_[_0xbeed('0x45')](db[_0xbeed('0x3e')][_0xbeed('0x3f')]);_0x183bd6['query']=_[_0xbeed('0x45')](_0x28808e['query']);_0x183bd6[_0xbeed('0x4d')]=_['intersection'](_0x183bd6[_0xbeed('0x46')],_0x183bd6[_0xbeed('0x44')]);_0x56b73f[_0xbeed('0x48')]=_[_0xbeed('0x56')](_0x183bd6[_0xbeed('0x46')],qs['fields'](_0x28808e[_0xbeed('0x44')][_0xbeed('0x47')]));_0x56b73f[_0xbeed('0x48')]=_0x56b73f['attributes'][_0xbeed('0x49')]?_0x56b73f[_0xbeed('0x48')]:_0x183bd6['model'];if(_0x28808e[_0xbeed('0x44')]['includeAll']){_0x56b73f['include']=[{'all':!![]}];}_0x56b73f=_[_0xbeed('0x57')]({},_0x56b73f,_0x28808e['options']);return db[_0xbeed('0x3e')][_0xbeed('0x58')](_0x56b73f)['then'](handleEntityNotFound(_0x231e32,null))['then'](respondWithResult(_0x231e32,null))[_0xbeed('0x27')](handleError(_0x231e32,null));};exports[_0xbeed('0x59')]=function(_0xb4320e,_0x352d80){return db['OpenchannelAccount']['create'](_0xb4320e['body'],{})[_0xbeed('0x35')](function(_0x52bd20){var _0x4cfda2=_0xb4320e[_0xbeed('0x5a')][_0xbeed('0x5b')]({'plain':!![]});if(!_0x4cfda2)throw new Error(_0xbeed('0x5c'));if(_0x4cfda2[_0xbeed('0x5d')]===_0xbeed('0x5a')){var _0x1fc521=_0x52bd20[_0xbeed('0x5b')]({'plain':!![]});var _0x58dfc3=_0xbeed('0x37');return db[_0xbeed('0x5e')]['find']({'where':{'name':_0x58dfc3,'userProfileId':_0x4cfda2['userProfileId']},'raw':!![]})[_0xbeed('0x35')](function(_0x2963e9){if(_0x2963e9&&_0x2963e9['autoAssociation']===0x0){return db[_0xbeed('0x38')][_0xbeed('0x59')]({'name':_0x1fc521[_0xbeed('0x39')],'resourceId':_0x1fc521['id'],'type':_0x2963e9[_0xbeed('0x39')],'sectionId':_0x2963e9['id']},{})[_0xbeed('0x35')](function(){return _0x52bd20;});}else{return _0x52bd20;}})[_0xbeed('0x27')](function(_0x327d9d){logger[_0xbeed('0x24')](_0xbeed('0x5f'),_0x327d9d);throw _0x327d9d;});}return _0x52bd20;})[_0xbeed('0x35')](respondWithResult(_0x352d80,0xc9))['catch'](handleError(_0x352d80,null));};exports[_0xbeed('0x34')]=function(_0x49ebbc,_0x3add7c){if(_0x49ebbc[_0xbeed('0x60')]['id']){delete _0x49ebbc[_0xbeed('0x60')]['id'];}return db['OpenchannelAccount'][_0xbeed('0x58')]({'where':{'id':_0x49ebbc[_0xbeed('0x55')]['id']},'include':[{'model':db[_0xbeed('0x3c')],'as':_0xbeed('0x3d')}]})[_0xbeed('0x35')](handleEntityNotFound(_0x3add7c,null))['then'](saveUpdates(_0x49ebbc[_0xbeed('0x60')],null))[_0xbeed('0x35')](respondWithResult(_0x3add7c,null))[_0xbeed('0x27')](handleError(_0x3add7c,null));};exports[_0xbeed('0x36')]=function(_0x14dc7a,_0x5c066d){return db[_0xbeed('0x3e')][_0xbeed('0x58')]({'where':{'id':_0x14dc7a[_0xbeed('0x55')]['id']}})[_0xbeed('0x35')](handleEntityNotFound(_0x5c066d,null))[_0xbeed('0x35')](removeEntity(_0x5c066d,null))[_0xbeed('0x27')](handleError(_0x5c066d,null));};exports[_0xbeed('0x61')]=function(_0x241075,_0x4bde8f){return db[_0xbeed('0x3e')][_0xbeed('0x61')]()[_0xbeed('0x35')](respondWithResult(_0x4bde8f,null))[_0xbeed('0x27')](handleError(_0x4bde8f,null));};exports[_0xbeed('0x62')]=function(_0x4fa5da,_0x53853f,_0x61d0ea){if(_0x4fa5da[_0xbeed('0x60')]['id']){delete _0x4fa5da[_0xbeed('0x60')]['id'];}return db[_0xbeed('0x3e')][_0xbeed('0x58')]({'where':{'id':_0x4fa5da[_0xbeed('0x55')]['id']}})[_0xbeed('0x35')](handleEntityNotFound(_0x53853f,null))[_0xbeed('0x35')](function(_0x4f01b5){if(_0x4f01b5){_0x4fa5da[_0xbeed('0x60')][_0xbeed('0x63')]=_0x4f01b5['id'];return db[_0xbeed('0x64')][_0xbeed('0x59')](_0x4fa5da[_0xbeed('0x60')]);}})[_0xbeed('0x35')](respondWithResult(_0x53853f,null))['catch'](handleError(_0x53853f,null));};exports[_0xbeed('0x65')]=function(_0x20322d,_0x5a8413,_0x493631){var _0x55064a={'raw':![],'where':{}};var _0x306d6d={};var _0x2ddfd8={'count':0x0,'rows':[]};return db[_0xbeed('0x3e')]['findOne']({'where':{'id':_0x20322d['params']['id']}})['then'](handleEntityNotFound(_0x5a8413,null))[_0xbeed('0x35')](function(_0x16e039){if(_0x16e039){_0x306d6d['model']=_[_0xbeed('0x45')](db[_0xbeed('0x64')][_0xbeed('0x3f')]);_0x306d6d[_0xbeed('0x44')]=_['keys'](_0x20322d[_0xbeed('0x44')]);_0x306d6d[_0xbeed('0x4d')]=_[_0xbeed('0x56')](_0x306d6d['model'],_0x306d6d['query']);_0x55064a[_0xbeed('0x48')]=_[_0xbeed('0x56')](_0x306d6d[_0xbeed('0x46')],qs[_0xbeed('0x47')](_0x20322d['query']['fields']));_0x55064a[_0xbeed('0x48')]=_0x55064a[_0xbeed('0x48')][_0xbeed('0x49')]?_0x55064a[_0xbeed('0x48')]:_0x306d6d[_0xbeed('0x46')];if(!_0x20322d['query'][_0xbeed('0x66')]('nolimit')){_0x55064a[_0xbeed('0x2e')]=qs[_0xbeed('0x2e')](_0x20322d['query'][_0xbeed('0x2e')]);_0x55064a[_0xbeed('0x2c')]=qs[_0xbeed('0x2c')](_0x20322d['query'][_0xbeed('0x2c')]);}_0x55064a[_0xbeed('0x67')]=qs[_0xbeed('0x4b')](_0x20322d[_0xbeed('0x44')][_0xbeed('0x4b')]);_0x55064a['where']=qs[_0xbeed('0x4d')](_[_0xbeed('0x4e')](_0x20322d[_0xbeed('0x44')],_0x306d6d[_0xbeed('0x4d')]));_0x55064a[_0xbeed('0x4c')][_0xbeed('0x63')]=_0x16e039['id'];if(_0x20322d[_0xbeed('0x44')][_0xbeed('0x4f')]){_0x55064a[_0xbeed('0x4c')]=_[_0xbeed('0x57')](_0x55064a[_0xbeed('0x4c')],{'$or':_[_0xbeed('0x43')](_0x55064a[_0xbeed('0x48')],function(_0x241290){var _0x27796e={};_0x27796e[_0x241290]={'$like':'%'+_0x20322d['query']['filter']+'%'};return _0x27796e;})});}_0x55064a=_[_0xbeed('0x57')]({},_0x55064a,_0x20322d[_0xbeed('0x51')]);return db[_0xbeed('0x64')][_0xbeed('0x2f')]({'where':_0x55064a[_0xbeed('0x4c')]})[_0xbeed('0x35')](function(_0x347b88){_0x2ddfd8[_0xbeed('0x2f')]=_0x347b88;if(_0x20322d['query']['includeAll']){_0x55064a[_0xbeed('0x52')]=[{'all':!![]}];}return db[_0xbeed('0x64')][_0xbeed('0x53')](_0x55064a);})[_0xbeed('0x35')](function(_0x8fc2a8){_0x2ddfd8[_0xbeed('0x68')]=_0x8fc2a8;return _0x2ddfd8;});}})[_0xbeed('0x35')](respondWithFilteredResult(_0x5a8413,_0x55064a))[_0xbeed('0x27')](handleError(_0x5a8413,null));};exports[_0xbeed('0x69')]=function(_0x164b31,_0x5f1dc2,_0x55d734){return db[_0xbeed('0x3e')][_0xbeed('0x58')]({'where':{'id':_0x164b31[_0xbeed('0x55')]['id']}})['then'](handleEntityNotFound(_0x5f1dc2,null))[_0xbeed('0x35')](function(_0x43c4cf){if(_0x43c4cf){return _0x43c4cf[_0xbeed('0x69')](_0x164b31[_0xbeed('0x44')]['ids']);}})[_0xbeed('0x35')](respondWithStatusCode(_0x5f1dc2,null))[_0xbeed('0x27')](handleError(_0x5f1dc2,null));};exports[_0xbeed('0x6a')]=function(_0x29a8d5,_0x21f619,_0x4a5daf){if(_0x29a8d5[_0xbeed('0x60')]['id']){delete _0x29a8d5['body']['id'];}return db['OpenchannelAccount'][_0xbeed('0x58')]({'where':{'id':_0x29a8d5[_0xbeed('0x55')]['id']}})[_0xbeed('0x35')](handleEntityNotFound(_0x21f619,null))[_0xbeed('0x35')](function(_0x26c5a4){if(_0x26c5a4){_0x29a8d5[_0xbeed('0x60')][_0xbeed('0x63')]=_0x26c5a4['id'];return db['CannedAnswer'][_0xbeed('0x59')](_0x29a8d5['body']);}})['then'](respondWithResult(_0x21f619,null))[_0xbeed('0x27')](handleError(_0x21f619,null));};exports[_0xbeed('0x6b')]=function(_0x1e749a,_0x513edd,_0x55862a){var _0x2981bf={'raw':![],'where':{}};var _0x566b00={};var _0x201ace={'count':0x0,'rows':[]};return db[_0xbeed('0x3e')]['findOne']({'where':{'id':_0x1e749a[_0xbeed('0x55')]['id']}})[_0xbeed('0x35')](handleEntityNotFound(_0x513edd,null))['then'](function(_0x152f44){if(_0x152f44){_0x566b00['model']=_['keys'](db[_0xbeed('0x6c')]['rawAttributes']);_0x566b00['query']=_[_0xbeed('0x45')](_0x1e749a[_0xbeed('0x44')]);_0x566b00['filters']=_[_0xbeed('0x56')](_0x566b00['model'],_0x566b00[_0xbeed('0x44')]);_0x2981bf[_0xbeed('0x48')]=_['intersection'](_0x566b00[_0xbeed('0x46')],qs[_0xbeed('0x47')](_0x1e749a['query'][_0xbeed('0x47')]));_0x2981bf[_0xbeed('0x48')]=_0x2981bf[_0xbeed('0x48')][_0xbeed('0x49')]?_0x2981bf[_0xbeed('0x48')]:_0x566b00[_0xbeed('0x46')];if(!_0x1e749a[_0xbeed('0x44')][_0xbeed('0x66')](_0xbeed('0x4a'))){_0x2981bf['limit']=qs[_0xbeed('0x2e')](_0x1e749a['query'][_0xbeed('0x2e')]);_0x2981bf[_0xbeed('0x2c')]=qs[_0xbeed('0x2c')](_0x1e749a[_0xbeed('0x44')][_0xbeed('0x2c')]);}_0x2981bf[_0xbeed('0x67')]=qs['sort'](_0x1e749a[_0xbeed('0x44')][_0xbeed('0x4b')]);_0x2981bf[_0xbeed('0x4c')]=qs[_0xbeed('0x4d')](_[_0xbeed('0x4e')](_0x1e749a[_0xbeed('0x44')],_0x566b00['filters']));_0x2981bf[_0xbeed('0x4c')][_0xbeed('0x63')]=_0x152f44['id'];if(_0x1e749a[_0xbeed('0x44')][_0xbeed('0x4f')]){_0x2981bf[_0xbeed('0x4c')]=_['merge'](_0x2981bf[_0xbeed('0x4c')],{'$or':_[_0xbeed('0x43')](_0x2981bf[_0xbeed('0x48')],function(_0x5492fa){var _0xb82f7={};_0xb82f7[_0x5492fa]={'$like':'%'+_0x1e749a[_0xbeed('0x44')][_0xbeed('0x4f')]+'%'};return _0xb82f7;})});}_0x2981bf=_[_0xbeed('0x57')]({},_0x2981bf,_0x1e749a[_0xbeed('0x51')]);return db[_0xbeed('0x6c')]['count']({'where':_0x2981bf[_0xbeed('0x4c')]})[_0xbeed('0x35')](function(_0x37910a){_0x201ace['count']=_0x37910a;if(_0x1e749a[_0xbeed('0x44')]['includeAll']){_0x2981bf[_0xbeed('0x52')]=[{'all':!![]}];}return db[_0xbeed('0x6c')]['findAll'](_0x2981bf);})['then'](function(_0xf6ad70){_0x201ace[_0xbeed('0x68')]=_0xf6ad70;return _0x201ace;});}})[_0xbeed('0x35')](respondWithFilteredResult(_0x513edd,_0x2981bf))[_0xbeed('0x27')](handleError(_0x513edd,null));};exports[_0xbeed('0x6d')]=function(_0x476426,_0x4ee936,_0x3e01ed){return db['OpenchannelAccount']['find']({'where':{'id':_0x476426[_0xbeed('0x55')]['id']}})['then'](handleEntityNotFound(_0x4ee936,null))[_0xbeed('0x35')](function(_0x17e872){if(_0x17e872){return _0x17e872['removeAnswers'](_0x476426['query'][_0xbeed('0x6e')]);}})[_0xbeed('0x35')](respondWithStatusCode(_0x4ee936,null))[_0xbeed('0x27')](handleError(_0x4ee936,null));};exports[_0xbeed('0x6f')]=function(_0x1616a2,_0x20b1c1,_0x42ca78){var _0x4429a0={'body':_0x1616a2['body'],'channel':_0xbeed('0x70')};var _0x19b638=[];var _0x375201=[];var _0x47a282={};var _0x5a1ee9=![];return db[_0xbeed('0x71')]['describe']()[_0xbeed('0x35')](function(_0x56b80e){if(!_0x56b80e){throw new db[(_0xbeed('0x72'))][(_0xbeed('0x73'))](_0xbeed('0x74'));}_0x19b638=_[_0xbeed('0x75')](_[_0xbeed('0x45')](_0x56b80e),[_0xbeed('0x76'),_0xbeed('0x77')]);_0x375201=_[_0xbeed('0x75')](_['keys'](_0x56b80e),['createdAt','updatedAt',_0xbeed('0x78'),_0xbeed('0x79')]);if(_0x1616a2[_0xbeed('0x60')]['id']){delete _0x1616a2[_0xbeed('0x60')]['id'];}if(_[_0xbeed('0x7a')](_0x1616a2[_0xbeed('0x60')][_0xbeed('0x7b')])){throw new db['Sequelize']['ValidationError'](_0xbeed('0x7c'));}if(_[_0xbeed('0x7a')](_0x1616a2[_0xbeed('0x60')][_0xbeed('0x60')])||_0x1616a2[_0xbeed('0x60')][_0xbeed('0x60')]===''){throw new db[(_0xbeed('0x72'))][(_0xbeed('0x73'))](_0xbeed('0x7d'));}if(_[_0xbeed('0x7a')](_0x1616a2['body'][_0xbeed('0x7e')])){throw new db['Sequelize']['ValidationError'](_0xbeed('0x7f')+_0x375201);}if(!_[_0xbeed('0x80')](_0x375201,_0x1616a2['body'][_0xbeed('0x7e')])){throw new db[(_0xbeed('0x72'))][(_0xbeed('0x73'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x375201);}_0x47a282[_0x1616a2[_0xbeed('0x60')][_0xbeed('0x7e')]]=_0x1616a2[_0xbeed('0x60')]['from'];})[_0xbeed('0x35')](function(){return db[_0xbeed('0x3e')][_0xbeed('0x58')]({'where':{'id':_0x1616a2[_0xbeed('0x55')]['id']},'include':[{'model':db[_0xbeed('0x81')],'as':_0xbeed('0x82'),'include':[{'model':db[_0xbeed('0x71')],'as':'Contacts','where':_0x47a282,'limit':0x1,'order':[[_0xbeed('0x77'),_0xbeed('0x83')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0xbeed('0x35')](handleEntityNotFound(_0x20b1c1,null))[_0xbeed('0x35')](function(_0x38a38e){if(_0x38a38e&&_0x38a38e['List']){_0x4429a0[_0xbeed('0x84')]=_0x38a38e;_0x4429a0[_0xbeed('0x85')]=_0x38a38e[_0xbeed('0x86')];_0x4429a0[_0xbeed('0x87')]=_0x38a38e['List'];_0x4429a0[_0xbeed('0x85')]=_['orderBy'](_0x4429a0['applications'],[_0xbeed('0x88')],[_0xbeed('0x89')]);if(_0x4429a0['account'][_0xbeed('0x86')]){delete _0x4429a0[_0xbeed('0x84')]['Applications'];}if(_0x4429a0[_0xbeed('0x84')]['List']&&_0x4429a0['account'][_0xbeed('0x82')]['Contacts'][_0xbeed('0x49')]){return _0x4429a0[_0xbeed('0x84')][_0xbeed('0x82')][_0xbeed('0x8a')][0x0];}var _0x555db9=_[_0xbeed('0x16')](_0x1616a2['body'],{'firstName':_0x1616a2[_0xbeed('0x60')][_0xbeed('0x7b')],'ListId':_0x38a38e[_0xbeed('0x79')]});_0x555db9[_0x1616a2[_0xbeed('0x60')][_0xbeed('0x7e')]]=_0x1616a2[_0xbeed('0x60')][_0xbeed('0x7b')];return db[_0xbeed('0x71')]['create'](_0x555db9,{'fields':_0x19b638,'raw':!![]});}})[_0xbeed('0x35')](handleEntityNotFound(_0x20b1c1,null))[_0xbeed('0x35')](function(_0x405f92){_0x4429a0[_0xbeed('0x8b')]=_0x405f92;if(_0x405f92){var _0xa105e7={'ContactId':_0x405f92['id'],'OpenchannelAccountId':_0x1616a2[_0xbeed('0x55')]['id'],'from':(_0x405f92[_0xbeed('0x8c')]||'')+'\x20'+(_0x405f92[_0xbeed('0x8d')]||'')};var _0x56bef4={'OpenchannelAccountId':_0x1616a2[_0xbeed('0x55')]['id'],'closed':![]};if(_0x1616a2[_0xbeed('0x60')]['threadId']){_0x56bef4['threadId']=_0x1616a2[_0xbeed('0x60')][_0xbeed('0x8e')];return db[_0xbeed('0x8f')][_0xbeed('0x58')]({'where':_0x56bef4})[_0xbeed('0x35')](function(_0x25ad6d){if(_0x25ad6d){return[_0x25ad6d,![]];}_0xa105e7[_0xbeed('0x8e')]=_0x1616a2[_0xbeed('0x60')][_0xbeed('0x8e')];_0xa105e7[_0xbeed('0x90')]=_0x1616a2[_0xbeed('0x60')][_0xbeed('0x90')];return db['OpenchannelInteraction'][_0xbeed('0x59')](_0xa105e7)[_0xbeed('0x35')](function(_0x37ee7b){return[_0x37ee7b,!![]];});});}else{_0x56bef4[_0xbeed('0x8e')]=null;}_0x56bef4[_0xbeed('0x91')]=_0x405f92['id'];return db[_0xbeed('0x8f')][_0xbeed('0x58')]({'where':_0x56bef4})['then'](function(_0x10f0c0){if(_0x10f0c0){return[_0x10f0c0,![]];}return db[_0xbeed('0x8f')][_0xbeed('0x59')](_0xa105e7)[_0xbeed('0x35')](function(_0x31240c){return[_0x31240c,!![]];});});}})[_0xbeed('0x92')](function(_0x3bd48d,_0x1a4e0a){if(_0x3bd48d){_0x5a1ee9=_0x1a4e0a;if(!_0x1a4e0a){var _0x3317a8={'from':(_0x4429a0[_0xbeed('0x8b')][_0xbeed('0x8c')]||'')+'\x20'+(_0x4429a0[_0xbeed('0x8b')][_0xbeed('0x8d')]||'')};if(_0x1616a2['body'][_0xbeed('0x8e')]&&_0x1616a2[_0xbeed('0x60')]['messageId']&&_0x1616a2[_0xbeed('0x60')]['threadId']!=_0x1616a2[_0xbeed('0x60')][_0xbeed('0x93')]){_0x3317a8['threadId']=_0x1616a2[_0xbeed('0x60')][_0xbeed('0x93')];}return _0x3bd48d['update'](_0x3317a8);}else{return _0x3bd48d;}}})[_0xbeed('0x35')](function(_0x417508){_0x4429a0[_0xbeed('0x94')]=_0x417508['get']({'plain':!![]});_0x4429a0['interaction'][_0xbeed('0x95')]=_0x5a1ee9;if(_0x4429a0[_0xbeed('0x94')][_0xbeed('0x95')]){if(_0x4429a0['account'][_0xbeed('0x96')]){_0x4429a0[_0xbeed('0x85')]['push']({'id':0x0,'priority':_0x4429a0['applications']['length']+0x1,'app':_0xbeed('0x97'),'appdata':'unmanaged','interval':_0xbeed('0x98')});}}return db['OpenchannelMessage']['create']({'body':_0x1616a2[_0xbeed('0x60')]['body'],'OpenchannelAccountId':_0x1616a2[_0xbeed('0x55')]['id'],'OpenchannelInteractionId':_0x417508['id'],'direction':'in','ContactId':_0x4429a0[_0xbeed('0x8b')]['id'],'AttachmentId':_0x1616a2[_0xbeed('0x60')][_0xbeed('0x99')]});})[_0xbeed('0x35')](function(_0x46ffac){_0x4429a0['message']=_0x46ffac;if(!_0x4429a0[_0xbeed('0x94')][_0xbeed('0x9a')])return;return db[_0xbeed('0x9b')][_0xbeed('0x58')]({'attributes':['id',_0xbeed('0x39')],'where':{'id':_0x4429a0[_0xbeed('0x94')][_0xbeed('0x9a')]}});})['then'](function(_0x38e429){if(_0x38e429){_0x4429a0[_0xbeed('0x85')][_0xbeed('0x9c')]({'id':0x0,'priority':0x0,'app':_0xbeed('0x9d'),'appdata':_0x38e429[_0xbeed('0x39')]+','+(_0x4429a0['account'][_0xbeed('0x9e')]||0xa),'interval':_0xbeed('0x98')});}if(!_0x4429a0[_0xbeed('0x94')][_0xbeed('0x9f')])return;return db[_0xbeed('0xa0')][_0xbeed('0x58')]({'attributes':['id','name'],'where':{'id':_0x4429a0[_0xbeed('0x94')]['queueId']}});})[_0xbeed('0x35')](function(_0x431aa5){if(_0x431aa5){_0x4429a0['applications'][_0xbeed('0x9c')]({'id':0x0,'priority':0x1,'app':_0xbeed('0xa1'),'appdata':_0x431aa5['name']+','+(_0x4429a0[_0xbeed('0x84')][_0xbeed('0xa2')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xbeed('0xa3'),_0xbeed('0xa4'),_0x4429a0);})[_0xbeed('0x35')](function(_0x3d8ed5){respondWithRpcPromise('EventManager',_0xbeed('0xa5'),{'event':'notify','message':_0x3d8ed5},client9002);return _0x3d8ed5;})[_0xbeed('0x35')](respondWithResult(_0x20b1c1,null))[_0xbeed('0x27')](handleError(_0x20b1c1,null));};exports[_0xbeed('0xa6')]=function(_0x3fe520,_0x3f9800){var _0x5b34ce=_0x3fe520[_0xbeed('0x55')]['id'];var _0x1ce8e4=_0x3fe520[_0xbeed('0x60')];var _0x195915=0xc8;var _0x5ad957=null;return db[_0xbeed('0xa7')]['transaction']({'isolationLevel':db[_0xbeed('0xa7')][_0xbeed('0xa8')][_0xbeed('0xa9')][_0xbeed('0xaa')]},function(_0xe318da){return db[_0xbeed('0x3e')][_0xbeed('0xab')]({'where':{'id':_0x5b34ce},'transaction':_0xe318da})[_0xbeed('0x35')](function(_0x2c38fb){if(_0x2c38fb){return db[_0xbeed('0xac')][_0xbeed('0x36')]({'where':{'OpenchannelAccountId':_0x5b34ce},'transaction':_0xe318da})[_0xbeed('0x35')](function(){var _0x1dd805=_[_0xbeed('0x43')](_0x1ce8e4,function(_0x2ddbbd){_0x2ddbbd[_0xbeed('0x63')]=_0x5b34ce;return _0x2ddbbd;});return db[_0xbeed('0xac')][_0xbeed('0xad')](_0x1dd805,{'transaction':_0xe318da});});}else{_0x195915=0x194;_0x5ad957=[];}});})['then'](function(){if(_0x195915!==0x194){return db[_0xbeed('0xac')][_0xbeed('0xae')]({'where':{'OpenchannelAccountId':_0x5b34ce},'order':_0xbeed('0x88')})[_0xbeed('0x35')](function(_0x1d3be7){_0x5ad957=_0x1d3be7;});}})['catch'](function(_0xbd3efb){_0x195915=0x1f4;logger[_0xbeed('0x24')](_0xbd3efb[_0xbeed('0xaf')]);if(_0xbd3efb['name']){delete _0xbd3efb[_0xbeed('0x39')];}_0x5ad957=_0xbd3efb;})['finally'](function(){if(_0x5ad957===null){_0x3f9800[_0xbeed('0x28')](_0x195915);}else{if(_0x195915===0x1f4){_0x3f9800['status'](_0x195915)[_0xbeed('0x3a')](_0x5ad957);}else{_0x3f9800[_0xbeed('0x29')](_0x195915)[_0xbeed('0x2b')](_0x5ad957);}}});};exports[_0xbeed('0xb0')]=function(_0x4bc3bd,_0x510468,_0x52d3e5){var _0xdc2f1={};var _0x572a35={};var _0x39b7f6;var _0x55ba29;return db[_0xbeed('0x3e')][_0xbeed('0xab')]({'where':{'id':_0x4bc3bd['params']['id']}})['then'](handleEntityNotFound(_0x510468,null))['then'](function(_0x32e57c){if(_0x32e57c){_0x39b7f6=_0x32e57c;_0x572a35[_0xbeed('0x46')]=_[_0xbeed('0x45')](db[_0xbeed('0xac')]['rawAttributes']);_0x572a35[_0xbeed('0x44')]=_[_0xbeed('0x45')](_0x4bc3bd[_0xbeed('0x44')]);_0x572a35[_0xbeed('0x4d')]=_[_0xbeed('0x56')](_0x572a35[_0xbeed('0x46')],_0x572a35[_0xbeed('0x44')]);_0xdc2f1[_0xbeed('0x48')]=_[_0xbeed('0x56')](_0x572a35[_0xbeed('0x46')],qs[_0xbeed('0x47')](_0x4bc3bd[_0xbeed('0x44')][_0xbeed('0x47')]));_0xdc2f1[_0xbeed('0x48')]=_0xdc2f1[_0xbeed('0x48')][_0xbeed('0x49')]?_0xdc2f1['attributes']:_0x572a35['model'];_0xdc2f1[_0xbeed('0x67')]=qs['sort'](_0x4bc3bd[_0xbeed('0x44')]['sort']);_0xdc2f1[_0xbeed('0x4c')]=qs[_0xbeed('0x4d')](_['pick'](_0x4bc3bd[_0xbeed('0x44')],_0x572a35[_0xbeed('0x4d')]));if(_0x4bc3bd['query'][_0xbeed('0x4f')]){_0xdc2f1[_0xbeed('0x4c')]=_[_0xbeed('0x57')](_0xdc2f1[_0xbeed('0x4c')],{'$or':_['map'](_0xdc2f1['attributes'],function(_0x35973f){var _0x54f95c={};_0x54f95c[_0x35973f]={'$like':'%'+_0x4bc3bd[_0xbeed('0x44')][_0xbeed('0x4f')]+'%'};return _0x54f95c;})});}_0xdc2f1=_[_0xbeed('0x57')]({},_0xdc2f1,_0x4bc3bd[_0xbeed('0x51')]);return _0x39b7f6[_0xbeed('0xb0')](_0xdc2f1);}})[_0xbeed('0x35')](function(_0x8cd38e){if(_0x8cd38e){_0x55ba29=_0x8cd38e[_0xbeed('0x49')];if(!_0x4bc3bd[_0xbeed('0x44')][_0xbeed('0x66')](_0xbeed('0x4a'))){_0xdc2f1['limit']=qs[_0xbeed('0x2e')](_0x4bc3bd[_0xbeed('0x44')][_0xbeed('0x2e')]);_0xdc2f1[_0xbeed('0x2c')]=qs['offset'](_0x4bc3bd[_0xbeed('0x44')]['offset']);}return _0x39b7f6[_0xbeed('0xb0')](_0xdc2f1);}})[_0xbeed('0x35')](function(_0x143c3f){if(_0x143c3f){return _0x143c3f?{'count':_0x55ba29,'rows':_0x143c3f}:null;}})[_0xbeed('0x35')](respondWithResult(_0x510468,null))[_0xbeed('0x27')](handleError(_0x510468,null));};exports[_0xbeed('0xb1')]=function(_0x520155,_0x5cd568,_0x1e3347){var _0x91071d={'raw':![],'where':{}};var _0x16a1f6={};var _0x58d063={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xbeed('0xab')]({'where':{'id':_0x520155[_0xbeed('0x55')]['id']}})[_0xbeed('0x35')](handleEntityNotFound(_0x5cd568,null))[_0xbeed('0x35')](function(_0x3ec5a5){if(_0x3ec5a5){_0x16a1f6[_0xbeed('0x46')]=_['keys'](db[_0xbeed('0x8f')][_0xbeed('0x3f')]);_0x16a1f6[_0xbeed('0x44')]=_[_0xbeed('0x45')](_0x520155[_0xbeed('0x44')]);_0x16a1f6[_0xbeed('0x4d')]=_[_0xbeed('0x56')](_0x16a1f6[_0xbeed('0x46')],_0x16a1f6['query']);_0x91071d['attributes']=_[_0xbeed('0x56')](_0x16a1f6[_0xbeed('0x46')],qs[_0xbeed('0x47')](_0x520155['query'][_0xbeed('0x47')]));_0x91071d[_0xbeed('0x48')]=_0x91071d[_0xbeed('0x48')][_0xbeed('0x49')]?_0x91071d[_0xbeed('0x48')]:_0x16a1f6[_0xbeed('0x46')];if(!_0x520155[_0xbeed('0x44')][_0xbeed('0x66')](_0xbeed('0x4a'))){_0x91071d[_0xbeed('0x2e')]=qs[_0xbeed('0x2e')](_0x520155[_0xbeed('0x44')][_0xbeed('0x2e')]);_0x91071d[_0xbeed('0x2c')]=qs[_0xbeed('0x2c')](_0x520155[_0xbeed('0x44')][_0xbeed('0x2c')]);}_0x91071d[_0xbeed('0x67')]=qs[_0xbeed('0x4b')](_0x520155[_0xbeed('0x44')]['sort']);_0x91071d['where']=qs['filters'](_['pick'](_0x520155['query'],_0x16a1f6[_0xbeed('0x4d')]));_0x91071d['where'][_0xbeed('0x63')]=_0x3ec5a5['id'];if(_0x520155[_0xbeed('0x44')]['filter']){_0x91071d[_0xbeed('0x4c')]=_[_0xbeed('0x57')](_0x91071d[_0xbeed('0x4c')],{'$or':_[_0xbeed('0x43')](_0x91071d[_0xbeed('0x48')],function(_0x42e5af){var _0x2d2ee2={};_0x2d2ee2[_0x42e5af]={'$like':'%'+_0x520155[_0xbeed('0x44')][_0xbeed('0x4f')]+'%'};return _0x2d2ee2;})});}_0x91071d=_[_0xbeed('0x57')]({},_0x91071d,_0x520155[_0xbeed('0x51')]);return db[_0xbeed('0x8f')][_0xbeed('0x2f')]({'where':_0x91071d['where']})['then'](function(_0x47c986){_0x58d063[_0xbeed('0x2f')]=_0x47c986;if(_0x520155[_0xbeed('0x44')][_0xbeed('0xb2')]){_0x91071d[_0xbeed('0x52')]=[{'model':db[_0xbeed('0x71')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xbeed('0x39'),'fullname',_0xbeed('0xb3')],'required':![]},{'model':db[_0xbeed('0xb4')],'as':_0xbeed('0xb5'),'attributes':['id',_0xbeed('0x39'),_0xbeed('0xb6')],'where':_0x520155[_0xbeed('0x44')][_0xbeed('0xb7')]?{'id':_0x520155['query'][_0xbeed('0xb7')]}:undefined,'required':_0x520155['query']['tag']?!![]:![]}];}return db[_0xbeed('0x8f')]['findAll'](_0x91071d);})['then'](function(_0x14b4f5){_0x58d063[_0xbeed('0x68')]=_0x14b4f5;return _0x58d063;});}})['then'](respondWithFilteredResult(_0x5cd568,_0x91071d))['catch'](handleError(_0x5cd568,null));};exports[_0xbeed('0xb8')]=function(_0x47c22f,_0xe1d214,_0x1d588e){return db[_0xbeed('0x3e')][_0xbeed('0x58')]({'where':{'id':_0x47c22f[_0xbeed('0x55')]['id']}})[_0xbeed('0x35')](handleEntityNotFound(_0xe1d214,null))[_0xbeed('0x35')](function(_0xdaa996){if(_0xdaa996){return _0xdaa996[_0xbeed('0xb8')](_0x47c22f[_0xbeed('0x60')][_0xbeed('0x6e')],_['omit'](_0x47c22f['body'],[_0xbeed('0x6e'),'id'])||{})[_0xbeed('0x92')](function(_0x50a19d){for(var _0x21ff86=0x0;_0x21ff86<_0x47c22f[_0xbeed('0x60')][_0xbeed('0x6e')][_0xbeed('0x49')];_0x21ff86+=0x1){socket['emit'](_0xbeed('0xb9'),{'UserId':Number(_0x47c22f[_0xbeed('0x60')]['ids'][_0x21ff86]),'OpenchannelAccountId':Number(_0x47c22f[_0xbeed('0x55')]['id'])});}return _0x50a19d;});}})[_0xbeed('0x35')](respondWithResult(_0xe1d214,null))[_0xbeed('0x27')](handleError(_0xe1d214,null));};exports[_0xbeed('0xba')]=function(_0x14ee7b,_0x2226b1,_0xe876aa){return db[_0xbeed('0x3e')][_0xbeed('0x58')]({'where':{'id':_0x14ee7b['params']['id']}})[_0xbeed('0x35')](handleEntityNotFound(_0x2226b1,null))['then'](function(_0x42a6af){if(_0x42a6af){return _0x42a6af[_0xbeed('0xba')](_0x14ee7b[_0xbeed('0x44')]['ids'])[_0xbeed('0x35')](function(){if(_[_0xbeed('0xbb')](_0x14ee7b[_0xbeed('0x44')]['ids'])){for(var _0x3f3c3b=0x0;_0x3f3c3b<_0x14ee7b[_0xbeed('0x44')][_0xbeed('0x6e')][_0xbeed('0x49')];_0x3f3c3b+=0x1){socket[_0xbeed('0xbc')]('userOpenchannelAccount:remove',{'UserId':Number(_0x14ee7b[_0xbeed('0x44')][_0xbeed('0x6e')][_0x3f3c3b]),'OpenchannelAccountId':Number(_0x14ee7b['params']['id'])});}}else{socket['emit'](_0xbeed('0xbd'),{'UserId':Number(_0x14ee7b[_0xbeed('0x44')][_0xbeed('0x6e')]),'OpenchannelAccountId':Number(_0x14ee7b[_0xbeed('0x55')]['id'])});}});}})[_0xbeed('0x35')](respondWithStatusCode(_0x2226b1,null))[_0xbeed('0x27')](handleError(_0x2226b1,null));};exports[_0xbeed('0xbe')]=function(_0x182c7c,_0x8f6b2e,_0x13e57c){var _0x112386={};var _0x2ebe01={};var _0x19ded1;var _0xe9f134;return db[_0xbeed('0x3e')][_0xbeed('0xab')]({'where':{'id':_0x182c7c[_0xbeed('0x55')]['id']}})[_0xbeed('0x35')](handleEntityNotFound(_0x8f6b2e,null))[_0xbeed('0x35')](function(_0x3bc559){if(_0x3bc559){_0x19ded1=_0x3bc559;_0x2ebe01['model']=_[_0xbeed('0x45')](db['User'][_0xbeed('0x3f')]);_0x2ebe01[_0xbeed('0x44')]=_[_0xbeed('0x45')](_0x182c7c['query']);_0x2ebe01[_0xbeed('0x4d')]=_['intersection'](_0x2ebe01[_0xbeed('0x46')],_0x2ebe01[_0xbeed('0x44')]);_0x112386[_0xbeed('0x48')]=_['intersection'](_0x2ebe01[_0xbeed('0x46')],qs[_0xbeed('0x47')](_0x182c7c['query'][_0xbeed('0x47')]));_0x112386[_0xbeed('0x48')]=_0x112386['attributes'][_0xbeed('0x49')]?_0x112386[_0xbeed('0x48')]:_0x2ebe01[_0xbeed('0x46')];_0x112386[_0xbeed('0x67')]=qs[_0xbeed('0x4b')](_0x182c7c[_0xbeed('0x44')][_0xbeed('0x4b')]);_0x112386[_0xbeed('0x4c')]=qs[_0xbeed('0x4d')](_['pick'](_0x182c7c[_0xbeed('0x44')],_0x2ebe01[_0xbeed('0x4d')]));if(_0x182c7c['query'][_0xbeed('0x4f')]){_0x112386[_0xbeed('0x4c')]=_[_0xbeed('0x57')](_0x112386['where'],{'$or':_[_0xbeed('0x43')](_0x112386['attributes'],function(_0x1fd37d){var _0x506f97={};_0x506f97[_0x1fd37d]={'$like':'%'+_0x182c7c[_0xbeed('0x44')][_0xbeed('0x4f')]+'%'};return _0x506f97;})});}_0x112386=_[_0xbeed('0x57')]({},_0x112386,_0x182c7c[_0xbeed('0x51')]);return _0x19ded1[_0xbeed('0xbe')](_0x112386);}})[_0xbeed('0x35')](function(_0x85b8a){if(_0x85b8a){_0xe9f134=_0x85b8a['length'];if(!_0x182c7c[_0xbeed('0x44')]['hasOwnProperty']('nolimit')){_0x112386[_0xbeed('0x2e')]=qs[_0xbeed('0x2e')](_0x182c7c[_0xbeed('0x44')]['limit']);_0x112386['offset']=qs[_0xbeed('0x2c')](_0x182c7c[_0xbeed('0x44')][_0xbeed('0x2c')]);}return _0x19ded1['getAgents'](_0x112386);}})[_0xbeed('0x35')](function(_0x2fac54){if(_0x2fac54){return _0x2fac54?{'count':_0xe9f134,'rows':_0x2fac54}:null;}})[_0xbeed('0x35')](respondWithResult(_0x8f6b2e,null))[_0xbeed('0x27')](handleError(_0x8f6b2e,null));};exports[_0xbeed('0x3a')]=function(_0x1a0ca9,_0x5ed2a8,_0x33c012){var _0x558c7f,_0x18da6a,_0x34e175;if(_['isNil'](_0x1a0ca9[_0xbeed('0x60')][_0xbeed('0x60')])||_0x1a0ca9[_0xbeed('0x60')][_0xbeed('0x60')]===''){throw new db['Sequelize'][(_0xbeed('0x73'))](_0xbeed('0x7d'));}if(_[_0xbeed('0x7a')](_0x1a0ca9['body']['to'])){}_0x558c7f=_0x1a0ca9[_0xbeed('0x60')]['to'];return db[_0xbeed('0x3e')][_0xbeed('0xab')]({'where':{'id':_0x1a0ca9[_0xbeed('0x55')]['id']}})[_0xbeed('0x35')](handleEntityNotFound(_0x5ed2a8,null))[_0xbeed('0x35')](function(_0xfb370f){if(_0xfb370f){return db[_0xbeed('0x3e')][_0xbeed('0x58')]({'where':{'id':_0xfb370f['id']},'include':[{'model':db[_0xbeed('0x81')],'as':_0xbeed('0x82'),'include':[{'model':db[_0xbeed('0x71')],'as':_0xbeed('0x8a'),'where':{[_0xfb370f[_0xbeed('0x7e')]]:_0x558c7f},'limit':0x1,'order':[[_0xbeed('0x77'),_0xbeed('0x83')]]}]}]})[_0xbeed('0x35')](handleEntityNotFound(_0x5ed2a8,null))['then'](function(_0x5880c0){if(_0x5880c0&&_0x5880c0[_0xbeed('0x82')]){_0x18da6a=_0x5880c0[_0xbeed('0x5b')]({'plain':!![]});if(_0x18da6a['List']&&_0x18da6a[_0xbeed('0x82')]['Contacts'][_0xbeed('0x49')]){return _0x18da6a['List'][_0xbeed('0x8a')][0x0];}return db[_0xbeed('0x71')][_0xbeed('0x59')](_[_0xbeed('0x16')](_0x1a0ca9[_0xbeed('0x60')],{'firstName':_0x558c7f,[_0x5880c0[_0xbeed('0x7e')]]:_0x558c7f,'phone':_0x558c7f,'ListId':_0x18da6a[_0xbeed('0x79')]}));}})[_0xbeed('0x35')](handleEntityNotFound(_0x5ed2a8,null))[_0xbeed('0x35')](function(_0x3f5b55){if(_0x3f5b55){_0x34e175=_0x3f5b55;return db[_0xbeed('0x8f')][_0xbeed('0x58')]({'where':{'ContactId':_0x34e175['id'],'closed':![],'OpenchannelAccountId':_0x18da6a['id']}})[_0xbeed('0x35')](function(_0x1d3679){if(_0x1d3679){return[_0x1d3679,![]];}return db[_0xbeed('0x8f')][_0xbeed('0x59')]({'UserId':_0x1a0ca9[_0xbeed('0x5a')]['id'],'ContactId':_0x34e175['id'],'OpenchannelAccountId':_0x18da6a['id'],'lastMsgDirection':_0xbeed('0xbf'),'firstMsgDirection':_0xbeed('0xbf'),'Messages':[_[_0xbeed('0x57')](_0x1a0ca9[_0xbeed('0x60')],{'read':![],'body':_0x1a0ca9[_0xbeed('0x60')][_0xbeed('0x60')],'OpenchannelAccountId':_0x18da6a['id'],'UserId':_0x1a0ca9[_0xbeed('0x5a')]['id'],'ContactId':_0x34e175['id']})]},{'include':[{'model':db[_0xbeed('0xc0')],'as':'Messages'}]})[_0xbeed('0x35')](function(_0x2cacc7){return[_0x2cacc7,!![]];});});}})[_0xbeed('0x92')](function(_0x280ec7,_0x367654){if(_0x367654){return _0x280ec7;}return db[_0xbeed('0xc0')][_0xbeed('0x59')](_['merge'](_0x1a0ca9[_0xbeed('0x60')],{'read':![],'body':_0x1a0ca9[_0xbeed('0x60')][_0xbeed('0x60')],'OpenchannelAccountId':_0x18da6a['id'],'OpenchannelInteractionId':_0x280ec7['id'],'UserId':_0x1a0ca9[_0xbeed('0x5a')]['id'],'ContactId':_0x34e175['id']}))[_0xbeed('0x35')](function(_0x500de8){_0x280ec7[_0xbeed('0xc1')][_0xbeed('0xc2')]=[];_0x280ec7[_0xbeed('0xc1')][_0xbeed('0xc2')][_0xbeed('0xc3')](_0x500de8[_0xbeed('0xc1')]);return _0x280ec7;});});}})[_0xbeed('0x35')](respondWithResult(_0x5ed2a8,null))[_0xbeed('0x27')](handleError(_0x5ed2a8,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 0cd51a8..a59faee 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 _0xee5b=['remove','emit','hasOwnProperty','hook','events','OpenchannelAccount','setMaxListeners','update'];(function(_0x19f841,_0x10846f){var _0x16595a=function(_0x2413cd){while(--_0x2413cd){_0x19f841['push'](_0x19f841['shift']());}};_0x16595a(++_0x10846f);}(_0xee5b,0x1f4));var _0xbee5=function(_0x480d86,_0x50d7d2){_0x480d86=_0x480d86-0x0;var _0x3f82a8=_0xee5b[_0x480d86];return _0x3f82a8;};'use strict';var EventEmitter=require(_0xbee5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbee5('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbee5('0x3'),'afterDestroy':_0xbee5('0x4')};function emitEvent(_0x2eb857){return function(_0x210159,_0x4bd202,_0x5200b1){OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857+':'+_0x210159['id'],_0x210159);OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857,_0x210159);_0x5200b1(null);};}for(var e in events){if(events[_0xbee5('0x6')](e)){var event=events[e];OpenchannelAccount[_0xbee5('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xe706=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','save','update','remove','emit'];(function(_0x37473a,_0x5563b7){var _0x4c7f4e=function(_0x4d5e9e){while(--_0x4d5e9e){_0x37473a['push'](_0x37473a['shift']());}};_0x4c7f4e(++_0x5563b7);}(_0xe706,0xa3));var _0x6e70=function(_0x130719,_0x2a7018){_0x130719=_0x130719-0x0;var _0x159865=_0xe706[_0x130719];return _0x159865;};'use strict';var EventEmitter=require(_0x6e70('0x0'));var OpenchannelAccount=require(_0x6e70('0x1'))['db'][_0x6e70('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6e70('0x3'),'afterUpdate':_0x6e70('0x4'),'afterDestroy':_0x6e70('0x5')};function emitEvent(_0x7dfbc3){return function(_0x142c27,_0x2164a4,_0x376a8d){OpenchannelAccountEvents[_0x6e70('0x6')](_0x7dfbc3+':'+_0x142c27['id'],_0x142c27);OpenchannelAccountEvents[_0x6e70('0x6')](_0x7dfbc3,_0x142c27);_0x376a8d(null);};}for(var e in events){if(events[_0x6e70('0x7')](e)){var event=events[e];OpenchannelAccount[_0x6e70('0x8')](e,emitEvent(event));}}module[_0x6e70('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 7e1aff3..9cd70e7 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(_0x442a6e,_0x30c482){var _0x2f6e96=function(_0x115406){while(--_0x115406){_0x442a6e['push'](_0x442a6e['shift']());}};_0x2f6e96(++_0x30c482);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x39f747,_0x2c1d1c){var _0x46d486=function(_0xbf1655){while(--_0xbf1655){_0x39f747['push'](_0x39f747['shift']());}};_0x46d486(++_0x2c1d1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 90ac4f4..f38ce69 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 _0x8cc8=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','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','stringify','error'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x8cc8,0x177));var _0x88cc=function(_0x1d6265,_0x5dbaae){_0x1d6265=_0x1d6265-0x0;var _0x3bed33=_0x8cc8[_0x1d6265];return _0x3bed33;};'use strict';var _=require(_0x88cc('0x0'));var util=require(_0x88cc('0x1'));var moment=require(_0x88cc('0x2'));var BPromise=require(_0x88cc('0x3'));var rs=require(_0x88cc('0x4'));var fs=require('fs');var Redis=require(_0x88cc('0x5'));var db=require(_0x88cc('0x6'))['db'];var utils=require(_0x88cc('0x7'));var logger=require(_0x88cc('0x8'))(_0x88cc('0x9'));var config=require(_0x88cc('0xa'));var jayson=require(_0x88cc('0xb'));var client=jayson[_0x88cc('0xc')]['http']({'port':0x232a});config['redis']=_[_0x88cc('0xd')](config[_0x88cc('0xe')],{'host':_0x88cc('0xf'),'port':0x18eb});var socket=require(_0x88cc('0x10'))(new Redis(config['redis']));require(_0x88cc('0x11'))[_0x88cc('0x12')](socket);function respondWithRpcPromise(_0x574946,_0x349991,_0x5586aa){return new BPromise(function(_0x379c2a,_0x23aee8){return client[_0x88cc('0x13')](_0x574946,_0x5586aa)[_0x88cc('0x14')](function(_0x5a70a9){logger[_0x88cc('0x15')](_0x88cc('0x16'),_0x349991,_0x88cc('0x17'));logger[_0x88cc('0x18')](_0x88cc('0x19'),_0x349991,_0x88cc('0x17'),JSON[_0x88cc('0x1a')](_0x5a70a9));if(_0x5a70a9[_0x88cc('0x1b')]){if(_0x5a70a9['error'][_0x88cc('0x1c')]===0x1f4){logger[_0x88cc('0x1b')](_0x88cc('0x16'),_0x349991,_0x5a70a9[_0x88cc('0x1b')][_0x88cc('0x1d')]);return _0x23aee8(_0x5a70a9[_0x88cc('0x1b')]['message']);}logger[_0x88cc('0x1b')](_0x88cc('0x16'),_0x349991,_0x5a70a9[_0x88cc('0x1b')][_0x88cc('0x1d')]);return _0x379c2a(_0x5a70a9[_0x88cc('0x1b')]['message']);}else{logger[_0x88cc('0x15')](_0x88cc('0x16'),_0x349991,_0x88cc('0x17'));_0x379c2a(_0x5a70a9[_0x88cc('0x1e')][_0x88cc('0x1d')]);}})['catch'](function(_0x2a08a4){logger[_0x88cc('0x1b')]('OpenchannelAccount,\x20%s,\x20%s',_0x349991,_0x2a08a4);_0x23aee8(_0x2a08a4);});});} \ No newline at end of file +var _0x7be1=['../../config/logger','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x7be1,0x165));var _0x17be=function(_0x1fd450,_0x42cbf6){_0x1fd450=_0x1fd450-0x0;var _0x4cb0a5=_0x7be1[_0x1fd450];return _0x4cb0a5;};'use strict';var _=require(_0x17be('0x0'));var util=require(_0x17be('0x1'));var moment=require(_0x17be('0x2'));var BPromise=require('bluebird');var rs=require(_0x17be('0x3'));var fs=require('fs');var Redis=require(_0x17be('0x4'));var db=require(_0x17be('0x5'))['db'];var utils=require(_0x17be('0x6'));var logger=require(_0x17be('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x17be('0x8')][_0x17be('0x9')]({'port':0x232a});config['redis']=_[_0x17be('0xa')](config[_0x17be('0xb')],{'host':_0x17be('0xc'),'port':0x18eb});var socket=require(_0x17be('0xd'))(new Redis(config[_0x17be('0xb')]));require(_0x17be('0xe'))['register'](socket);function respondWithRpcPromise(_0x41e383,_0x589cdb,_0x3d23c3){return new BPromise(function(_0x2c276e,_0x520a49){return client[_0x17be('0xf')](_0x41e383,_0x3d23c3)[_0x17be('0x10')](function(_0x1ee322){logger[_0x17be('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x589cdb,_0x17be('0x12'));logger['debug'](_0x17be('0x13'),_0x589cdb,'request\x20sent',JSON[_0x17be('0x14')](_0x1ee322));if(_0x1ee322[_0x17be('0x15')]){if(_0x1ee322[_0x17be('0x15')][_0x17be('0x16')]===0x1f4){logger[_0x17be('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x589cdb,_0x1ee322[_0x17be('0x15')]['message']);return _0x520a49(_0x1ee322['error'][_0x17be('0x17')]);}logger['error'](_0x17be('0x18'),_0x589cdb,_0x1ee322['error'][_0x17be('0x17')]);return _0x2c276e(_0x1ee322[_0x17be('0x15')]['message']);}else{logger[_0x17be('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x589cdb,_0x17be('0x12'));_0x2c276e(_0x1ee322['result'][_0x17be('0x17')]);}})[_0x17be('0x19')](function(_0x416f81){logger[_0x17be('0x15')](_0x17be('0x18'),_0x589cdb,_0x416f81);_0x520a49(_0x416f81);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 3c0edbd..afdbc92 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 _0x03ce=['register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x03ce,0x1a1));var _0xe03c=function(_0x1d7bc3,_0x5dc8bf){_0x1d7bc3=_0x1d7bc3-0x0;var _0x2d99d2=_0x03ce[_0x1d7bc3];return _0x2d99d2;};'use strict';var OpenchannelAccountEvents=require(_0xe03c('0x0'));var events=[_0xe03c('0x1'),_0xe03c('0x2'),_0xe03c('0x3')];function createListener(_0x56ac7a,_0x18e8ab){return function(_0x2e9f29){_0x18e8ab[_0xe03c('0x4')](_0x56ac7a,_0x2e9f29);};}function removeListener(_0x527a32,_0x317708){return function(){OpenchannelAccountEvents[_0xe03c('0x5')](_0x527a32,_0x317708);};}exports[_0xe03c('0x6')]=function(_0x2c0e4b){for(var _0x4340f0=0x0,_0x44c54f=events[_0xe03c('0x7')];_0x4340f0<_0x44c54f;_0x4340f0++){var _0x52dda4=events[_0x4340f0];var _0x53c2b0=createListener(_0xe03c('0x8')+_0x52dda4,_0x2c0e4b);OpenchannelAccountEvents['on'](_0x52dda4,_0x53c2b0);}}; \ No newline at end of file +var _0x4b8a=['openchannelAccount:','save','update','emit','removeListener','register','length'];(function(_0x4cfd91,_0x261fed){var _0x2d9f0f=function(_0x4404c9){while(--_0x4404c9){_0x4cfd91['push'](_0x4cfd91['shift']());}};_0x2d9f0f(++_0x261fed);}(_0x4b8a,0xd3));var _0xa4b8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4b8a[_0x3b380d];return _0x54502b;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xa4b8('0x0'),'remove',_0xa4b8('0x1')];function createListener(_0x3ed3b6,_0x20eea6){return function(_0x34c820){_0x20eea6[_0xa4b8('0x2')](_0x3ed3b6,_0x34c820);};}function removeListener(_0x3a22d1,_0xb147cb){return function(){OpenchannelAccountEvents[_0xa4b8('0x3')](_0x3a22d1,_0xb147cb);};}exports[_0xa4b8('0x4')]=function(_0x719605){for(var _0x2c9e45=0x0,_0x2de84d=events[_0xa4b8('0x5')];_0x2c9e45<_0x2de84d;_0x2c9e45++){var _0x1fea78=events[_0x2c9e45];var _0x517970=createListener(_0xa4b8('0x6')+_0x1fea78,_0x719605);OpenchannelAccountEvents['on'](_0x1fea78,_0x517970);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 7d24db2..8f1cf2e 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 _0xab0f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','/:id','show','post','put','delete','destroy','multer'];(function(_0x466266,_0x39bb43){var _0x1795fa=function(_0x3b61aa){while(--_0x3b61aa){_0x466266['push'](_0x466266['shift']());}};_0x1795fa(++_0x39bb43);}(_0xab0f,0x155));var _0xfab0=function(_0x3c33b4,_0x379e04){_0x3c33b4=_0x3c33b4-0x0;var _0x21ad8d=_0xab0f[_0x3c33b4];return _0x21ad8d;};'use strict';var multer=require(_0xfab0('0x0'));var util=require('util');var path=require(_0xfab0('0x1'));var timeout=require(_0xfab0('0x2'));var express=require(_0xfab0('0x3'));var router=express[_0xfab0('0x4')]();var fs_extra=require(_0xfab0('0x5'));var auth=require(_0xfab0('0x6'));var interaction=require(_0xfab0('0x7'));var config=require(_0xfab0('0x8'));var controller=require(_0xfab0('0x9'));router['get']('/',auth[_0xfab0('0xa')](),controller[_0xfab0('0xb')]);router['get'](_0xfab0('0xc'),auth['isAuthenticated'](),controller[_0xfab0('0xd')]);router[_0xfab0('0xe')]('/',auth[_0xfab0('0xa')](),controller['create']);router[_0xfab0('0xf')](_0xfab0('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xfab0('0x10')](_0xfab0('0xc'),auth['isAuthenticated'](),controller[_0xfab0('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd702=['../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','exports','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x1d6b17,_0x5dae49){var _0x299bd2=function(_0xe0adae){while(--_0xe0adae){_0x1d6b17['push'](_0x1d6b17['shift']());}};_0x299bd2(++_0x5dae49);}(_0xd702,0x94));var _0x2d70=function(_0xbdd9d6,_0x2f7c59){_0xbdd9d6=_0xbdd9d6-0x0;var _0x555614=_0xd702[_0xbdd9d6];return _0x555614;};'use strict';var multer=require('multer');var util=require(_0x2d70('0x0'));var path=require(_0x2d70('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2d70('0x2')]();var fs_extra=require(_0x2d70('0x3'));var auth=require(_0x2d70('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2d70('0x5'));var controller=require(_0x2d70('0x6'));router['get']('/',auth[_0x2d70('0x7')](),controller[_0x2d70('0x8')]);router[_0x2d70('0x9')](_0x2d70('0xa'),auth[_0x2d70('0x7')](),controller[_0x2d70('0xb')]);router[_0x2d70('0xc')]('/',auth[_0x2d70('0x7')](),controller[_0x2d70('0xd')]);router['put'](_0x2d70('0xa'),auth[_0x2d70('0x7')](),controller[_0x2d70('0xe')]);router[_0x2d70('0xf')](_0x2d70('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x2d70('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 9ab411c..f3d6e71 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 _0x96f4=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x527a20,_0x347399){var _0x21f5e0=function(_0x2e01f8){while(--_0x2e01f8){_0x527a20['push'](_0x527a20['shift']());}};_0x21f5e0(++_0x347399);}(_0x96f4,0x1a7));var _0x496f=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x96f4[_0x46efd7];return _0x5637e4;};'use strict';var Sequelize=require(_0x496f('0x0'));module[_0x496f('0x1')]={'priority':{'type':Sequelize[_0x496f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x496f('0x3')},'appdata':{'type':Sequelize[_0x496f('0x4')]()},'description':{'type':Sequelize[_0x496f('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x496f('0x6')}}; \ No newline at end of file +var _0x4503=['TEXT','exports','INTEGER','STRING'];(function(_0x1cde08,_0x2aacc1){var _0x1518c8=function(_0x417f45){while(--_0x417f45){_0x1cde08['push'](_0x1cde08['shift']());}};_0x1518c8(++_0x2aacc1);}(_0x4503,0x111));var _0x3450=function(_0x45743b,_0x5cd28f){_0x45743b=_0x45743b-0x0;var _0x4a1065=_0x4503[_0x45743b];return _0x4a1065;};'use strict';var Sequelize=require('sequelize');module[_0x3450('0x0')]={'priority':{'type':Sequelize[_0x3450('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3450('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3450('0x3')]()},'description':{'type':Sequelize[_0x3450('0x2')]},'interval':{'type':Sequelize[_0x3450('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 480824c..941531f 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 _0x1307=['../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','save','update','then','destroy','stack','name','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelApplication','includeAll','findAll','rows','show','params','include','find','catch','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','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'];(function(_0x5a7ce1,_0xb44041){var _0x1965c2=function(_0x539523){while(--_0x539523){_0x5a7ce1['push'](_0x5a7ce1['shift']());}};_0x1965c2(++_0xb44041);}(_0x1307,0x190));var _0x7130=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x1307[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0x7130('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7130('0x1'));var jsonpatch=require(_0x7130('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7130('0x3'));var Mustache=require(_0x7130('0x4'));var util=require('util');var path=require(_0x7130('0x5'));var sox=require(_0x7130('0x6'));var csv=require(_0x7130('0x7'));var ejs=require(_0x7130('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7130('0x9'));var crypto=require(_0x7130('0xa'));var jsforce=require(_0x7130('0xb'));var deskjs=require(_0x7130('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7130('0xd'));var Papa=require(_0x7130('0xe'));var Redis=require(_0x7130('0xf'));var authService=require(_0x7130('0x10'));var qs=require(_0x7130('0x11'));var as=require(_0x7130('0x12'));var hardwareService=require(_0x7130('0x13'));var logger=require(_0x7130('0x14'))('api');var utils=require(_0x7130('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7130('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ec213,_0x54f797){_0x54f797=_0x54f797||0xcc;return function(_0x23d666){if(_0x23d666){return _0x2ec213[_0x7130('0x17')](_0x54f797);}return _0x2ec213[_0x7130('0x18')](_0x54f797)[_0x7130('0x19')]();};}function respondWithResult(_0x1dbaf3,_0x398391){_0x398391=_0x398391||0xc8;return function(_0x81611){if(_0x81611){return _0x1dbaf3[_0x7130('0x18')](_0x398391)['json'](_0x81611);}};}function respondWithFilteredResult(_0x583ba9,_0x2529f7){return function(_0x434de4){if(_0x434de4){var _0xfe11ba=typeof _0x2529f7[_0x7130('0x1a')]==='undefined'&&typeof _0x2529f7[_0x7130('0x1b')]===_0x7130('0x1c');var _0x44e5b2=_0x434de4[_0x7130('0x1d')];var _0x441743=_0xfe11ba?0x0:_0x2529f7[_0x7130('0x1a')];var _0x421713=_0xfe11ba?_0x434de4[_0x7130('0x1d')]:_0x2529f7[_0x7130('0x1a')]+_0x2529f7[_0x7130('0x1b')];var _0x47ea53;if(_0x421713>=_0x44e5b2){_0x421713=_0x44e5b2;_0x47ea53=0xc8;}else{_0x47ea53=0xce;}_0x583ba9[_0x7130('0x18')](_0x47ea53);return _0x583ba9['set'](_0x7130('0x1e'),_0x441743+'-'+_0x421713+'/'+_0x44e5b2)[_0x7130('0x1f')](_0x434de4);}return null;};}function patchUpdates(_0x32b1f4){return function(_0x62b889){try{jsonpatch['apply'](_0x62b889,_0x32b1f4,!![]);}catch(_0x451855){return BPromise['reject'](_0x451855);}return _0x62b889[_0x7130('0x20')]();};}function saveUpdates(_0x5620af,_0x175071){return function(_0x3c9fee){if(_0x3c9fee){return _0x3c9fee[_0x7130('0x21')](_0x5620af)[_0x7130('0x22')](function(_0x3d6986){return _0x3d6986;});}return null;};}function removeEntity(_0x1a1021,_0x9bcad4){return function(_0x94dda7){if(_0x94dda7){return _0x94dda7[_0x7130('0x23')]()[_0x7130('0x22')](function(){_0x1a1021['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44a5a5,_0x2a92d3){return function(_0x194c57){if(!_0x194c57){_0x44a5a5[_0x7130('0x17')](0x194);}return _0x194c57;};}function handleError(_0x71c231,_0x1c8fef){_0x1c8fef=_0x1c8fef||0x1f4;return function(_0x1d87a0){logger['error'](_0x1d87a0[_0x7130('0x24')]);if(_0x1d87a0[_0x7130('0x25')]){delete _0x1d87a0['name'];}_0x71c231['status'](_0x1c8fef)['send'](_0x1d87a0);};}exports[_0x7130('0x26')]=function(_0x25527d,_0xbff1cb){var _0x36e7e1={},_0x59c2d0={},_0xf644d8={'count':0x0,'rows':[]};var _0x300d89=_[_0x7130('0x27')](db['OpenchannelApplication']['rawAttributes'],function(_0x22bfca){return{'name':_0x22bfca[_0x7130('0x28')],'type':_0x22bfca[_0x7130('0x29')][_0x7130('0x2a')]};});_0x59c2d0['model']=_[_0x7130('0x27')](_0x300d89,'name');_0x59c2d0[_0x7130('0x2b')]=_[_0x7130('0x2c')](_0x25527d[_0x7130('0x2b')]);_0x59c2d0[_0x7130('0x2d')]=_[_0x7130('0x2e')](_0x59c2d0['model'],_0x59c2d0[_0x7130('0x2b')]);_0x36e7e1['attributes']=_[_0x7130('0x2e')](_0x59c2d0[_0x7130('0x2f')],qs[_0x7130('0x30')](_0x25527d['query'][_0x7130('0x30')]));_0x36e7e1[_0x7130('0x31')]=_0x36e7e1['attributes'][_0x7130('0x32')]?_0x36e7e1[_0x7130('0x31')]:_0x59c2d0[_0x7130('0x2f')];if(!_0x25527d[_0x7130('0x2b')]['hasOwnProperty'](_0x7130('0x33'))){_0x36e7e1[_0x7130('0x1b')]=qs[_0x7130('0x1b')](_0x25527d[_0x7130('0x2b')][_0x7130('0x1b')]);_0x36e7e1[_0x7130('0x1a')]=qs['offset'](_0x25527d[_0x7130('0x2b')][_0x7130('0x1a')]);}_0x36e7e1['order']=qs[_0x7130('0x34')](_0x25527d[_0x7130('0x2b')][_0x7130('0x34')]);_0x36e7e1[_0x7130('0x35')]=qs[_0x7130('0x2d')](_[_0x7130('0x36')](_0x25527d[_0x7130('0x2b')],_0x59c2d0[_0x7130('0x2d')]),_0x300d89);if(_0x25527d[_0x7130('0x2b')][_0x7130('0x37')]){_0x36e7e1[_0x7130('0x35')]=_[_0x7130('0x38')](_0x36e7e1[_0x7130('0x35')],{'$or':_[_0x7130('0x27')](_0x300d89,function(_0x2edc3d){if(_0x2edc3d[_0x7130('0x29')]!==_0x7130('0x39')){var _0xcbd247={};_0xcbd247[_0x2edc3d[_0x7130('0x25')]]={'$like':'%'+_0x25527d[_0x7130('0x2b')][_0x7130('0x37')]+'%'};return _0xcbd247;}})});}_0x36e7e1=_['merge']({},_0x36e7e1,_0x25527d[_0x7130('0x3a')]);var _0x504c30={'where':_0x36e7e1[_0x7130('0x35')]};return db[_0x7130('0x3b')][_0x7130('0x1d')](_0x504c30)[_0x7130('0x22')](function(_0x10b33b){_0xf644d8[_0x7130('0x1d')]=_0x10b33b;if(_0x25527d[_0x7130('0x2b')][_0x7130('0x3c')]){_0x36e7e1['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0x7130('0x3d')](_0x36e7e1);})['then'](function(_0x56880a){_0xf644d8[_0x7130('0x3e')]=_0x56880a;return _0xf644d8;})[_0x7130('0x22')](respondWithFilteredResult(_0xbff1cb,_0x36e7e1))['catch'](handleError(_0xbff1cb,null));};exports[_0x7130('0x3f')]=function(_0x5b8022,_0x4f7bd5){var _0x309bf7={'raw':!![],'where':{'id':_0x5b8022[_0x7130('0x40')]['id']}},_0x53055f={};_0x53055f[_0x7130('0x2f')]=_[_0x7130('0x2c')](db[_0x7130('0x3b')]['rawAttributes']);_0x53055f[_0x7130('0x2b')]=_[_0x7130('0x2c')](_0x5b8022['query']);_0x53055f[_0x7130('0x2d')]=_[_0x7130('0x2e')](_0x53055f[_0x7130('0x2f')],_0x53055f['query']);_0x309bf7['attributes']=_['intersection'](_0x53055f[_0x7130('0x2f')],qs[_0x7130('0x30')](_0x5b8022[_0x7130('0x2b')][_0x7130('0x30')]));_0x309bf7[_0x7130('0x31')]=_0x309bf7[_0x7130('0x31')]['length']?_0x309bf7['attributes']:_0x53055f[_0x7130('0x2f')];if(_0x5b8022[_0x7130('0x2b')][_0x7130('0x3c')]){_0x309bf7[_0x7130('0x41')]=[{'all':!![]}];}_0x309bf7=_['merge']({},_0x309bf7,_0x5b8022[_0x7130('0x3a')]);return db['OpenchannelApplication'][_0x7130('0x42')](_0x309bf7)[_0x7130('0x22')](handleEntityNotFound(_0x4f7bd5,null))['then'](respondWithResult(_0x4f7bd5,null))[_0x7130('0x43')](handleError(_0x4f7bd5,null));};exports[_0x7130('0x44')]=function(_0x1fe3b3,_0xe50dc1){return db[_0x7130('0x3b')][_0x7130('0x44')](_0x1fe3b3['body'],{})[_0x7130('0x22')](respondWithResult(_0xe50dc1,0xc9))[_0x7130('0x43')](handleError(_0xe50dc1,null));};exports['update']=function(_0x2c8609,_0x352f34){if(_0x2c8609[_0x7130('0x45')]['id']){delete _0x2c8609[_0x7130('0x45')]['id'];}return db['OpenchannelApplication'][_0x7130('0x42')]({'where':{'id':_0x2c8609[_0x7130('0x40')]['id']}})[_0x7130('0x22')](handleEntityNotFound(_0x352f34,null))['then'](saveUpdates(_0x2c8609[_0x7130('0x45')],null))[_0x7130('0x22')](respondWithResult(_0x352f34,null))['catch'](handleError(_0x352f34,null));};exports[_0x7130('0x23')]=function(_0x1c4dd9,_0x2511d2){return db[_0x7130('0x3b')]['find']({'where':{'id':_0x1c4dd9[_0x7130('0x40')]['id']}})[_0x7130('0x22')](handleEntityNotFound(_0x2511d2,null))[_0x7130('0x22')](removeEntity(_0x2511d2,null))['catch'](handleError(_0x2511d2,null));}; \ No newline at end of file +var _0xb2a8=['OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','count','includeAll','include','catch','show','find','create','body','update','destroy','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','then','stack','name','send','index','map'];(function(_0x8d6445,_0x332fe7){var _0x3f28ec=function(_0x19465b){while(--_0x19465b){_0x8d6445['push'](_0x8d6445['shift']());}};_0x3f28ec(++_0x332fe7);}(_0xb2a8,0x13c));var _0x8b2a=function(_0x119b96,_0x587acd){_0x119b96=_0x119b96-0x0;var _0x516cbf=_0xb2a8[_0x119b96];return _0x516cbf;};'use strict';var emlformat=require(_0x8b2a('0x0'));var rimraf=require(_0x8b2a('0x1'));var zipdir=require(_0x8b2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b2a('0x3'));var moment=require(_0x8b2a('0x4'));var BPromise=require(_0x8b2a('0x5'));var Mustache=require(_0x8b2a('0x6'));var util=require('util');var path=require(_0x8b2a('0x7'));var sox=require(_0x8b2a('0x8'));var csv=require(_0x8b2a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b2a('0xa'));var squel=require(_0x8b2a('0xb'));var crypto=require(_0x8b2a('0xc'));var jsforce=require(_0x8b2a('0xd'));var deskjs=require(_0x8b2a('0xe'));var toCsv=require(_0x8b2a('0x9'));var querystring=require(_0x8b2a('0xf'));var Papa=require(_0x8b2a('0x10'));var Redis=require(_0x8b2a('0x11'));var authService=require(_0x8b2a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8b2a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8b2a('0x14'));var config=require(_0x8b2a('0x15'));var licenseUtil=require(_0x8b2a('0x16'));var db=require(_0x8b2a('0x17'))['db'];function respondWithStatusCode(_0x3db40a,_0x1dce6b){_0x1dce6b=_0x1dce6b||0xcc;return function(_0x5875ab){if(_0x5875ab){return _0x3db40a[_0x8b2a('0x18')](_0x1dce6b);}return _0x3db40a[_0x8b2a('0x19')](_0x1dce6b)[_0x8b2a('0x1a')]();};}function respondWithResult(_0x32001d,_0x1c89fa){_0x1c89fa=_0x1c89fa||0xc8;return function(_0x22c41e){if(_0x22c41e){return _0x32001d[_0x8b2a('0x19')](_0x1c89fa)[_0x8b2a('0x1b')](_0x22c41e);}};}function respondWithFilteredResult(_0x185ec4,_0x5a91d8){return function(_0x392995){if(_0x392995){var _0x299fdb=typeof _0x5a91d8[_0x8b2a('0x1c')]===_0x8b2a('0x1d')&&typeof _0x5a91d8[_0x8b2a('0x1e')]===_0x8b2a('0x1d');var _0xc80bcd=_0x392995['count'];var _0xf8bbf7=_0x299fdb?0x0:_0x5a91d8[_0x8b2a('0x1c')];var _0x5c4da0=_0x299fdb?_0x392995['count']:_0x5a91d8[_0x8b2a('0x1c')]+_0x5a91d8[_0x8b2a('0x1e')];var _0x24f3df;if(_0x5c4da0>=_0xc80bcd){_0x5c4da0=_0xc80bcd;_0x24f3df=0xc8;}else{_0x24f3df=0xce;}_0x185ec4[_0x8b2a('0x19')](_0x24f3df);return _0x185ec4['set'](_0x8b2a('0x1f'),_0xf8bbf7+'-'+_0x5c4da0+'/'+_0xc80bcd)[_0x8b2a('0x1b')](_0x392995);}return null;};}function patchUpdates(_0x481bd6){return function(_0x4a32c0){try{jsonpatch[_0x8b2a('0x20')](_0x4a32c0,_0x481bd6,!![]);}catch(_0x3fcf35){return BPromise['reject'](_0x3fcf35);}return _0x4a32c0['save']();};}function saveUpdates(_0x46de7e,_0x4e5ffa){return function(_0x700cc1){if(_0x700cc1){return _0x700cc1['update'](_0x46de7e)[_0x8b2a('0x21')](function(_0x16ade8){return _0x16ade8;});}return null;};}function removeEntity(_0x17984e,_0x2fa954){return function(_0x3dec5f){if(_0x3dec5f){return _0x3dec5f['destroy']()['then'](function(){_0x17984e['status'](0xcc)[_0x8b2a('0x1a')]();});}};}function handleEntityNotFound(_0x3e0fdb,_0x47cb0f){return function(_0x22591b){if(!_0x22591b){_0x3e0fdb[_0x8b2a('0x18')](0x194);}return _0x22591b;};}function handleError(_0xe892ea,_0x113703){_0x113703=_0x113703||0x1f4;return function(_0x3b1f31){logger['error'](_0x3b1f31[_0x8b2a('0x22')]);if(_0x3b1f31[_0x8b2a('0x23')]){delete _0x3b1f31[_0x8b2a('0x23')];}_0xe892ea['status'](_0x113703)[_0x8b2a('0x24')](_0x3b1f31);};}exports[_0x8b2a('0x25')]=function(_0x5bb8c2,_0x4a0ff2){var _0x405b72={},_0x5cedbb={},_0x3a5e97={'count':0x0,'rows':[]};var _0x1d15da=_[_0x8b2a('0x26')](db[_0x8b2a('0x27')][_0x8b2a('0x28')],function(_0xc3b390){return{'name':_0xc3b390[_0x8b2a('0x29')],'type':_0xc3b390[_0x8b2a('0x2a')][_0x8b2a('0x2b')]};});_0x5cedbb[_0x8b2a('0x2c')]=_['map'](_0x1d15da,_0x8b2a('0x23'));_0x5cedbb[_0x8b2a('0x2d')]=_[_0x8b2a('0x2e')](_0x5bb8c2[_0x8b2a('0x2d')]);_0x5cedbb[_0x8b2a('0x2f')]=_['intersection'](_0x5cedbb[_0x8b2a('0x2c')],_0x5cedbb[_0x8b2a('0x2d')]);_0x405b72[_0x8b2a('0x30')]=_[_0x8b2a('0x31')](_0x5cedbb[_0x8b2a('0x2c')],qs[_0x8b2a('0x32')](_0x5bb8c2[_0x8b2a('0x2d')][_0x8b2a('0x32')]));_0x405b72[_0x8b2a('0x30')]=_0x405b72['attributes'][_0x8b2a('0x33')]?_0x405b72[_0x8b2a('0x30')]:_0x5cedbb[_0x8b2a('0x2c')];if(!_0x5bb8c2[_0x8b2a('0x2d')]['hasOwnProperty'](_0x8b2a('0x34'))){_0x405b72['limit']=qs['limit'](_0x5bb8c2[_0x8b2a('0x2d')][_0x8b2a('0x1e')]);_0x405b72[_0x8b2a('0x1c')]=qs[_0x8b2a('0x1c')](_0x5bb8c2['query'][_0x8b2a('0x1c')]);}_0x405b72[_0x8b2a('0x35')]=qs[_0x8b2a('0x36')](_0x5bb8c2['query'][_0x8b2a('0x36')]);_0x405b72[_0x8b2a('0x37')]=qs['filters'](_[_0x8b2a('0x38')](_0x5bb8c2['query'],_0x5cedbb[_0x8b2a('0x2f')]),_0x1d15da);if(_0x5bb8c2[_0x8b2a('0x2d')]['filter']){_0x405b72[_0x8b2a('0x37')]=_['merge'](_0x405b72[_0x8b2a('0x37')],{'$or':_[_0x8b2a('0x26')](_0x1d15da,function(_0x1dbc80){if(_0x1dbc80[_0x8b2a('0x2a')]!==_0x8b2a('0x39')){var _0x2fbdfa={};_0x2fbdfa[_0x1dbc80[_0x8b2a('0x23')]]={'$like':'%'+_0x5bb8c2[_0x8b2a('0x2d')]['filter']+'%'};return _0x2fbdfa;}})});}_0x405b72=_[_0x8b2a('0x3a')]({},_0x405b72,_0x5bb8c2[_0x8b2a('0x3b')]);var _0x10d404={'where':_0x405b72[_0x8b2a('0x37')]};return db[_0x8b2a('0x27')][_0x8b2a('0x3c')](_0x10d404)['then'](function(_0x27c5a9){_0x3a5e97[_0x8b2a('0x3c')]=_0x27c5a9;if(_0x5bb8c2[_0x8b2a('0x2d')][_0x8b2a('0x3d')]){_0x405b72[_0x8b2a('0x3e')]=[{'all':!![]}];}return db[_0x8b2a('0x27')]['findAll'](_0x405b72);})[_0x8b2a('0x21')](function(_0x472d03){_0x3a5e97['rows']=_0x472d03;return _0x3a5e97;})[_0x8b2a('0x21')](respondWithFilteredResult(_0x4a0ff2,_0x405b72))[_0x8b2a('0x3f')](handleError(_0x4a0ff2,null));};exports[_0x8b2a('0x40')]=function(_0x1e6490,_0x5bf516){var _0x1b98ba={'raw':!![],'where':{'id':_0x1e6490['params']['id']}},_0x311369={};_0x311369[_0x8b2a('0x2c')]=_[_0x8b2a('0x2e')](db[_0x8b2a('0x27')][_0x8b2a('0x28')]);_0x311369['query']=_[_0x8b2a('0x2e')](_0x1e6490[_0x8b2a('0x2d')]);_0x311369['filters']=_[_0x8b2a('0x31')](_0x311369[_0x8b2a('0x2c')],_0x311369['query']);_0x1b98ba[_0x8b2a('0x30')]=_[_0x8b2a('0x31')](_0x311369[_0x8b2a('0x2c')],qs[_0x8b2a('0x32')](_0x1e6490[_0x8b2a('0x2d')][_0x8b2a('0x32')]));_0x1b98ba['attributes']=_0x1b98ba[_0x8b2a('0x30')]['length']?_0x1b98ba[_0x8b2a('0x30')]:_0x311369['model'];if(_0x1e6490['query']['includeAll']){_0x1b98ba[_0x8b2a('0x3e')]=[{'all':!![]}];}_0x1b98ba=_[_0x8b2a('0x3a')]({},_0x1b98ba,_0x1e6490[_0x8b2a('0x3b')]);return db[_0x8b2a('0x27')][_0x8b2a('0x41')](_0x1b98ba)['then'](handleEntityNotFound(_0x5bf516,null))['then'](respondWithResult(_0x5bf516,null))[_0x8b2a('0x3f')](handleError(_0x5bf516,null));};exports['create']=function(_0x5e11c3,_0x379d6a){return db['OpenchannelApplication'][_0x8b2a('0x42')](_0x5e11c3[_0x8b2a('0x43')],{})[_0x8b2a('0x21')](respondWithResult(_0x379d6a,0xc9))[_0x8b2a('0x3f')](handleError(_0x379d6a,null));};exports[_0x8b2a('0x44')]=function(_0x1e4771,_0x2d5b9d){if(_0x1e4771['body']['id']){delete _0x1e4771['body']['id'];}return db[_0x8b2a('0x27')][_0x8b2a('0x41')]({'where':{'id':_0x1e4771['params']['id']}})[_0x8b2a('0x21')](handleEntityNotFound(_0x2d5b9d,null))[_0x8b2a('0x21')](saveUpdates(_0x1e4771['body'],null))['then'](respondWithResult(_0x2d5b9d,null))[_0x8b2a('0x3f')](handleError(_0x2d5b9d,null));};exports[_0x8b2a('0x45')]=function(_0x3304dc,_0x38b6e2){return db[_0x8b2a('0x27')][_0x8b2a('0x41')]({'where':{'id':_0x3304dc[_0x8b2a('0x46')]['id']}})[_0x8b2a('0x21')](handleEntityNotFound(_0x38b6e2,null))[_0x8b2a('0x21')](removeEntity(_0x38b6e2,null))[_0x8b2a('0x3f')](handleError(_0x38b6e2,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index b67bb3a..d9076cc 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 _0x2a50=['OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelApplication.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a50,0xad));var _0x02a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a50[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x02a5('0x0'));var util=require(_0x02a5('0x1'));var logger=require(_0x02a5('0x2'))(_0x02a5('0x3'));var moment=require(_0x02a5('0x4'));var BPromise=require(_0x02a5('0x5'));var rp=require(_0x02a5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x02a5('0x7'));var attributes=require(_0x02a5('0x8'));module['exports']=function(_0x1aa1a6,_0x227391){return _0x1aa1a6['define'](_0x02a5('0x9'),attributes,{'tableName':_0x02a5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x02a5('0xb'),'collate':_0x02a5('0xc')});}; \ No newline at end of file +var _0xc7ae=['../../config/logger','api','bluebird','request-promise','path','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x293951,_0x2f272b){var _0x40d37b=function(_0x46490b){while(--_0x46490b){_0x293951['push'](_0x293951['shift']());}};_0x40d37b(++_0x2f272b);}(_0xc7ae,0x9b));var _0xec7a=function(_0x30a8d3,_0x416a4c){_0x30a8d3=_0x30a8d3-0x0;var _0x2e274e=_0xc7ae[_0x30a8d3];return _0x2e274e;};'use strict';var _=require('lodash');var util=require(_0xec7a('0x0'));var logger=require(_0xec7a('0x1'))(_0xec7a('0x2'));var moment=require('moment');var BPromise=require(_0xec7a('0x3'));var rp=require(_0xec7a('0x4'));var fs=require('fs');var path=require(_0xec7a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xec7a('0x6'));module[_0xec7a('0x7')]=function(_0x3e076d,_0xbf3b5d){return _0x3e076d[_0xec7a('0x8')](_0xec7a('0x9'),attributes,{'tableName':_0xec7a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xec7a('0xb'),'collate':_0xec7a('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 14047c9..d23f08d 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 _0xdbf8=['error','code','message','info','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','raw','options','attributes','limit','lodash','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdbf8,0xa2));var _0x8dbf=function(_0x3f8e71,_0x561727){_0x3f8e71=_0x3f8e71-0x0;var _0x9cfc5=_0xdbf8[_0x3f8e71];return _0x9cfc5;};'use strict';var _=require(_0x8dbf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8dbf('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8dbf('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8dbf('0x3'));var config=require(_0x8dbf('0x4'));var jayson=require(_0x8dbf('0x5'));var client=jayson[_0x8dbf('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d60d8,_0x22f5e9,_0x1dbaab){return new BPromise(function(_0x447043,_0x36ef76){return client['request'](_0x4d60d8,_0x1dbaab)[_0x8dbf('0x7')](function(_0x397f59){logger['info'](_0x8dbf('0x8'),_0x22f5e9,_0x8dbf('0x9'));logger[_0x8dbf('0xa')](_0x8dbf('0xb'),_0x22f5e9,_0x8dbf('0x9'),JSON[_0x8dbf('0xc')](_0x397f59));if(_0x397f59[_0x8dbf('0xd')]){if(_0x397f59['error'][_0x8dbf('0xe')]===0x1f4){logger['error'](_0x8dbf('0x8'),_0x22f5e9,_0x397f59['error'][_0x8dbf('0xf')]);return _0x36ef76(_0x397f59[_0x8dbf('0xd')][_0x8dbf('0xf')]);}logger[_0x8dbf('0xd')](_0x8dbf('0x8'),_0x22f5e9,_0x397f59['error'][_0x8dbf('0xf')]);return _0x447043(_0x397f59[_0x8dbf('0xd')][_0x8dbf('0xf')]);}else{logger[_0x8dbf('0x10')](_0x8dbf('0x8'),_0x22f5e9,_0x8dbf('0x9'));_0x447043(_0x397f59['result']['message']);}})[_0x8dbf('0x11')](function(_0x56471c){logger['error'](_0x8dbf('0x8'),_0x22f5e9,_0x56471c);_0x36ef76(_0x56471c);});});}exports[_0x8dbf('0x12')]=function(_0x5c1161){var _0x349d29=this;return new Promise(function(_0x1ef062,_0x439709){return db[_0x8dbf('0x13')][_0x8dbf('0x14')](_0x5c1161['body'],{'raw':_0x5c1161['options']?_0x5c1161['options'][_0x8dbf('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c1161[_0x8dbf('0x16')]?_0x5c1161['options']['where']||null:null,'attributes':_0x5c1161[_0x8dbf('0x16')]?_0x5c1161[_0x8dbf('0x16')][_0x8dbf('0x17')]||null:null,'limit':_0x5c1161[_0x8dbf('0x16')]?_0x5c1161[_0x8dbf('0x16')][_0x8dbf('0x18')]||null:null})[_0x8dbf('0x7')](function(_0xeee4cf){logger[_0x8dbf('0x10')]('UpdateOpenchannelApplication',_0x5c1161);logger[_0x8dbf('0xa')](_0x8dbf('0x12'),_0x5c1161,JSON['stringify'](_0xeee4cf));_0x1ef062(_0xeee4cf);})[_0x8dbf('0x11')](function(_0x3afbd6){logger['error'](_0x8dbf('0x12'),_0x3afbd6[_0x8dbf('0xf')],_0x5c1161);_0x439709(_0x349d29['error'](0x1f4,_0x3afbd6[_0x8dbf('0xf')]));});});}; \ No newline at end of file +var _0x485b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','where','attributes','limit','then','lodash','util','moment','randomstring'];(function(_0x18aa50,_0x355899){var _0x309bc6=function(_0x15ec45){while(--_0x15ec45){_0x18aa50['push'](_0x18aa50['shift']());}};_0x309bc6(++_0x355899);}(_0x485b,0x128));var _0xb485=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x485b[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0xb485('0x0'));var util=require(_0xb485('0x1'));var moment=require(_0xb485('0x2'));var BPromise=require('bluebird');var rs=require(_0xb485('0x3'));var fs=require('fs');var Redis=require(_0xb485('0x4'));var db=require(_0xb485('0x5'))['db'];var utils=require(_0xb485('0x6'));var logger=require(_0xb485('0x7'))(_0xb485('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb485('0x9')][_0xb485('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb7abc4,_0x4aa028,_0x492806){return new BPromise(function(_0xaafd53,_0x3fe0b0){return client[_0xb485('0xb')](_0xb7abc4,_0x492806)['then'](function(_0x312fc7){logger[_0xb485('0xc')](_0xb485('0xd'),_0x4aa028,_0xb485('0xe'));logger[_0xb485('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x4aa028,_0xb485('0xe'),JSON[_0xb485('0x10')](_0x312fc7));if(_0x312fc7[_0xb485('0x11')]){if(_0x312fc7[_0xb485('0x11')][_0xb485('0x12')]===0x1f4){logger[_0xb485('0x11')](_0xb485('0xd'),_0x4aa028,_0x312fc7[_0xb485('0x11')][_0xb485('0x13')]);return _0x3fe0b0(_0x312fc7[_0xb485('0x11')]['message']);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x4aa028,_0x312fc7[_0xb485('0x11')][_0xb485('0x13')]);return _0xaafd53(_0x312fc7['error'][_0xb485('0x13')]);}else{logger[_0xb485('0xc')](_0xb485('0xd'),_0x4aa028,_0xb485('0xe'));_0xaafd53(_0x312fc7[_0xb485('0x14')][_0xb485('0x13')]);}})[_0xb485('0x15')](function(_0x4b1bfb){logger['error'](_0xb485('0xd'),_0x4aa028,_0x4b1bfb);_0x3fe0b0(_0x4b1bfb);});});}exports[_0xb485('0x16')]=function(_0x42bbc6){var _0x2516fe=this;return new Promise(function(_0x126e87,_0x5754a5){return db[_0xb485('0x17')]['update'](_0x42bbc6[_0xb485('0x18')],{'raw':_0x42bbc6[_0xb485('0x19')]?_0x42bbc6[_0xb485('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42bbc6[_0xb485('0x19')]?_0x42bbc6[_0xb485('0x19')][_0xb485('0x1a')]||null:null,'attributes':_0x42bbc6['options']?_0x42bbc6[_0xb485('0x19')][_0xb485('0x1b')]||null:null,'limit':_0x42bbc6[_0xb485('0x19')]?_0x42bbc6[_0xb485('0x19')][_0xb485('0x1c')]||null:null})[_0xb485('0x1d')](function(_0x430e12){logger[_0xb485('0xc')](_0xb485('0x16'),_0x42bbc6);logger[_0xb485('0xf')](_0xb485('0x16'),_0x42bbc6,JSON['stringify'](_0x430e12));_0x126e87(_0x430e12);})[_0xb485('0x15')](function(_0x5496ea){logger[_0xb485('0x11')](_0xb485('0x16'),_0x5496ea[_0xb485('0x13')],_0x42bbc6);_0x5754a5(_0x2516fe['error'](0x1f4,_0x5496ea['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 5bacea4..e01af85 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 _0x7b7f=['connect-timeout','express','Router','../../components/auth/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','openchannel','put','openchannelinteraction:update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7b7f,0x13d));var _0xf7b7=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0x7b7f[_0x18afca];return _0x11603f;};'use strict';var multer=require(_0xf7b7('0x0'));var util=require(_0xf7b7('0x1'));var path=require(_0xf7b7('0x2'));var timeout=require(_0xf7b7('0x3'));var express=require(_0xf7b7('0x4'));var router=express[_0xf7b7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf7b7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf7b7('0x7'));router[_0xf7b7('0x8')]('/',auth[_0xf7b7('0x9')](),controller[_0xf7b7('0xa')]);router['get'](_0xf7b7('0xb'),auth[_0xf7b7('0x9')](),controller[_0xf7b7('0xc')]);router[_0xf7b7('0x8')](_0xf7b7('0xd'),auth['isAuthenticated'](),controller[_0xf7b7('0xe')]);router['get'](_0xf7b7('0xf'),auth[_0xf7b7('0x9')](),controller[_0xf7b7('0x10')]);router[_0xf7b7('0x8')](_0xf7b7('0x11'),auth[_0xf7b7('0x9')](),controller[_0xf7b7('0x12')]);router['post']('/',auth[_0xf7b7('0x9')](),controller[_0xf7b7('0x13')]);router[_0xf7b7('0x14')](_0xf7b7('0xf'),auth[_0xf7b7('0x9')](),controller[_0xf7b7('0x15')]);router[_0xf7b7('0x14')](_0xf7b7('0x16'),auth['isAuthenticated'](),interaction[_0xf7b7('0x17')](_0xf7b7('0x18'),'openchannelinteraction:addtags'),controller['addTags']);router[_0xf7b7('0x19')](_0xf7b7('0xd'),auth['isAuthenticated'](),interaction[_0xf7b7('0x17')](_0xf7b7('0x18'),_0xf7b7('0x1a')),controller['update']);router['delete']('/:id',auth[_0xf7b7('0x9')](),interaction['tracked'](_0xf7b7('0x18'),_0xf7b7('0x1b')),controller[_0xf7b7('0x1c')]);router[_0xf7b7('0x1d')]('/:id/tags',auth[_0xf7b7('0x9')](),controller[_0xf7b7('0x1e')]);module[_0xf7b7('0x1f')]=router; \ No newline at end of file +var _0xaaac=['put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/download','download','post','/:id/messages','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0xaaac,0x151));var _0xcaaa=function(_0x56b499,_0x4bcc59){_0x56b499=_0x56b499-0x0;var _0x59ca78=_0xaaac[_0x56b499];return _0x59ca78;};'use strict';var multer=require(_0xcaaa('0x0'));var util=require(_0xcaaa('0x1'));var path=require('path');var timeout=require(_0xcaaa('0x2'));var express=require(_0xcaaa('0x3'));var router=express[_0xcaaa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcaaa('0x5'));var interaction=require(_0xcaaa('0x6'));var config=require('../../config/environment');var controller=require(_0xcaaa('0x7'));router['get']('/',auth[_0xcaaa('0x8')](),controller[_0xcaaa('0x9')]);router[_0xcaaa('0xa')](_0xcaaa('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xcaaa('0xa')](_0xcaaa('0xc'),auth[_0xcaaa('0x8')](),controller[_0xcaaa('0xd')]);router[_0xcaaa('0xa')]('/:id/messages',auth[_0xcaaa('0x8')](),controller['getMessages']);router[_0xcaaa('0xa')](_0xcaaa('0xe'),auth['isAuthenticated'](),controller[_0xcaaa('0xf')]);router['post']('/',auth[_0xcaaa('0x8')](),controller['create']);router[_0xcaaa('0x10')](_0xcaaa('0x11'),auth[_0xcaaa('0x8')](),controller['addMessage']);router[_0xcaaa('0x10')](_0xcaaa('0x12'),auth[_0xcaaa('0x8')](),interaction[_0xcaaa('0x13')](_0xcaaa('0x14'),_0xcaaa('0x15')),controller[_0xcaaa('0x16')]);router[_0xcaaa('0x17')](_0xcaaa('0xc'),auth[_0xcaaa('0x8')](),interaction['tracked'](_0xcaaa('0x14'),_0xcaaa('0x18')),controller[_0xcaaa('0x19')]);router[_0xcaaa('0x1a')](_0xcaaa('0xc'),auth[_0xcaaa('0x8')](),interaction['tracked']('openchannel',_0xcaaa('0x1b')),controller['destroy']);router[_0xcaaa('0x1a')]('/:id/tags',auth[_0xcaaa('0x8')](),controller[_0xcaaa('0x1c')]);module[_0xcaaa('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 8591efe..c40d915 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 _0xcc40=['INTEGER','sequelize','DATE','STRING','out','BOOLEAN'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xcc40,0x97));var _0x0cc4=function(_0x26aedb,_0x379d14){_0x26aedb=_0x26aedb-0x0;var _0x4dca33=_0xcc40[_0x26aedb];return _0x4dca33;};'use strict';var Sequelize=require(_0x0cc4('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0cc4('0x1')]},'disposition':{'type':Sequelize[_0x0cc4('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0cc4('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0cc4('0x1')]},'threadId':{'type':Sequelize[_0x0cc4('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x0cc4('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0cc4('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0cc4('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x0cc4('0x4')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0cc4('0x5')]}}; \ No newline at end of file +var _0x9ed4=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x4ffbb0,_0x5b28ea){var _0xd29dd8=function(_0x568154){while(--_0x568154){_0x4ffbb0['push'](_0x4ffbb0['shift']());}};_0xd29dd8(++_0x5b28ea);}(_0x9ed4,0x1a7));var _0x49ed=function(_0x3ada37,_0x131b7d){_0x3ada37=_0x3ada37-0x0;var _0x32ca34=_0x9ed4[_0x3ada37];return _0x32ca34;};'use strict';var Sequelize=require(_0x49ed('0x0'));module[_0x49ed('0x1')]={'closed':{'type':Sequelize[_0x49ed('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x49ed('0x3')]},'disposition':{'type':Sequelize[_0x49ed('0x4')]},'secondDisposition':{'type':Sequelize[_0x49ed('0x4')]},'thirdDisposition':{'type':Sequelize[_0x49ed('0x4')]},'note':{'type':Sequelize[_0x49ed('0x4')]},'read1stAt':{'type':Sequelize[_0x49ed('0x3')]},'threadId':{'type':Sequelize[_0x49ed('0x4')]},'externalUrl':{'type':Sequelize[_0x49ed('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x49ed('0x5')]('in',_0x49ed('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x49ed('0x5')]('in',_0x49ed('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x49ed('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x49ed('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 6a7bcbb..1c992d5 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 _0x1eaa=['OpenchannelInteraction','rawAttributes','key','getOptions','findAll','openchannel','user','catch','query','type','from','params','model','filters','attributes','fields','length','includeAll','merge','create','body','find','describe','addMessage','OpenchannelMessage','omit','ids','keys','intersection','hasOwnProperty','nolimit','order','sort','where','OpenchannelInteractionId','filter','$gte','split','format','options','include','rows','addTags','setTags','spread','color','openchannelInteractionTags:save','removeTags','download','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','Account','Owner','get','mkdirSync','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','threadId','Private','existsSync','createWriteStream','basename','out','System','Contact','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','sendStatus','rimraf','zip-dir','moment','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','status','json','offset','undefined','limit','count','set','update','then','destroy','end','stack','name','index','map'];(function(_0x7f04ce,_0x51d650){var _0x5ee6c7=function(_0x36d23c){while(--_0x36d23c){_0x7f04ce['push'](_0x7f04ce['shift']());}};_0x5ee6c7(++_0x51d650);}(_0x1eaa,0x1e7));var _0xa1ea=function(_0x5c5f88,_0x429bf){_0x5c5f88=_0x5c5f88-0x0;var _0x501d56=_0x1eaa[_0x5c5f88];return _0x501d56;};'use strict';var rimraf=require(_0xa1ea('0x0'));var zipdir=require(_0xa1ea('0x1'));var moment=require(_0xa1ea('0x2'));var util=require(_0xa1ea('0x3'));var path=require(_0xa1ea('0x4'));var ejs=require(_0xa1ea('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xa1ea('0x6'));var interaction=require(_0xa1ea('0x7'));var qs=require(_0xa1ea('0x8'));var pdf=require(_0xa1ea('0x9'));var logger=require(_0xa1ea('0xa'))('api');var config=require(_0xa1ea('0xb'));var db=require(_0xa1ea('0xc'))['db'];config[_0xa1ea('0xd')]=_[_0xa1ea('0xe')](config[_0xa1ea('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa1ea('0xf'))(new Redis(config[_0xa1ea('0xd')]));require(_0xa1ea('0x10'))[_0xa1ea('0x11')](socket);function respondWithStatusCode(_0x318f0f,_0x410e03){_0x410e03=_0x410e03||0xcc;return function(_0x3f7962){if(_0x3f7962){return _0x318f0f['sendStatus'](_0x410e03);}return _0x318f0f['status'](_0x410e03)['end']();};}function respondWithResult(_0x4d300d,_0x57b9e4){_0x57b9e4=_0x57b9e4||0xc8;return function(_0x3896f9){if(_0x3896f9){return _0x4d300d[_0xa1ea('0x12')](_0x57b9e4)[_0xa1ea('0x13')](_0x3896f9);}};}function respondWithFilteredResult(_0x3d4fe5,_0x5c6039){return function(_0x1129b7){if(_0x1129b7){var _0x59aac7=typeof _0x5c6039[_0xa1ea('0x14')]===_0xa1ea('0x15')&&typeof _0x5c6039[_0xa1ea('0x16')]==='undefined';var _0x3ea52d=_0x1129b7[_0xa1ea('0x17')];var _0x33cc68=_0x59aac7?0x0:_0x5c6039[_0xa1ea('0x14')];var _0x113f48=_0x59aac7?_0x1129b7['count']:_0x5c6039[_0xa1ea('0x14')]+_0x5c6039[_0xa1ea('0x16')];var _0x13856e;if(_0x113f48>=_0x3ea52d){_0x113f48=_0x3ea52d;_0x13856e=0xc8;}else{_0x13856e=0xce;}_0x3d4fe5[_0xa1ea('0x12')](_0x13856e);return _0x3d4fe5[_0xa1ea('0x18')]('Content-Range',_0x33cc68+'-'+_0x113f48+'/'+_0x3ea52d)[_0xa1ea('0x13')](_0x1129b7);}return null;};}function saveUpdates(_0x14ab5d){return function(_0x5cda82){if(_0x5cda82){return _0x5cda82[_0xa1ea('0x19')](_0x14ab5d)[_0xa1ea('0x1a')](function(_0x1c1345){return _0x1c1345;});}return null;};}function removeEntity(_0x73a73b){return function(_0x2d1470){if(_0x2d1470){return _0x2d1470[_0xa1ea('0x1b')]()[_0xa1ea('0x1a')](function(){_0x73a73b[_0xa1ea('0x12')](0xcc)[_0xa1ea('0x1c')]();});}};}function handleEntityNotFound(_0x2608e3){return function(_0x11a88f){if(!_0x11a88f){_0x2608e3['sendStatus'](0x194);}return _0x11a88f;};}function handleError(_0x5142c1,_0x370d25){_0x370d25=_0x370d25||0x1f4;return function(_0x420263){logger['error'](_0x420263[_0xa1ea('0x1d')]);if(_0x420263[_0xa1ea('0x1e')]){delete _0x420263[_0xa1ea('0x1e')];}_0x5142c1[_0xa1ea('0x12')](_0x370d25)['send'](_0x420263);};}exports[_0xa1ea('0x1f')]=function(_0x21f16b,_0x59cc90){var _0xf63e2d={};var _0x13a16e=_[_0xa1ea('0x20')](db[_0xa1ea('0x21')][_0xa1ea('0x22')],function(_0x39fc5d){return{'name':_0x39fc5d['fieldName'],'type':_0x39fc5d['type'][_0xa1ea('0x23')]};});_0xf63e2d=qs[_0xa1ea('0x24')](_0x13a16e,_0x21f16b);return interaction[_0xa1ea('0x25')](_0xa1ea('0x26'),_0x21f16b['query'],_0x21f16b[_0xa1ea('0x27')],_0xf63e2d,_0x13a16e)[_0xa1ea('0x1a')](respondWithFilteredResult(_0x59cc90,_0xf63e2d))[_0xa1ea('0x28')](handleError(_0x59cc90,null));};exports['show']=function(_0x4b3774,_0x5dde90){var _0x3e2392={};if(_0x4b3774[_0xa1ea('0x29')]['type']&&_0x4b3774[_0xa1ea('0x29')][_0xa1ea('0x2a')]===_0xa1ea('0x2b')){_0x3e2392[_0xa1ea('0x2b')]=_0x4b3774['params']['id'];}else{_0x3e2392['id']=_0x4b3774[_0xa1ea('0x2c')]['id'];}var _0x37faf1={'raw':![],'where':_0x3e2392},_0x54834b={};_0x54834b[_0xa1ea('0x2d')]=_['keys'](db[_0xa1ea('0x21')]['rawAttributes']);_0x54834b[_0xa1ea('0x29')]=_['keys'](_0x4b3774[_0xa1ea('0x29')]);_0x54834b[_0xa1ea('0x2e')]=_['intersection'](_0x54834b['model'],_0x54834b[_0xa1ea('0x29')]);_0x37faf1[_0xa1ea('0x2f')]=_['intersection'](_0x54834b[_0xa1ea('0x2d')],qs[_0xa1ea('0x30')](_0x4b3774[_0xa1ea('0x29')][_0xa1ea('0x30')]));_0x37faf1[_0xa1ea('0x2f')]=_0x37faf1['attributes'][_0xa1ea('0x31')]?_0x37faf1[_0xa1ea('0x2f')]:_0x54834b[_0xa1ea('0x2d')];if(_0x4b3774[_0xa1ea('0x29')][_0xa1ea('0x32')]){_0x37faf1['include']=[{'all':!![]}];}_0x37faf1=_[_0xa1ea('0x33')]({},_0x37faf1,_0x4b3774['options']);return db[_0xa1ea('0x21')]['find'](_0x37faf1)[_0xa1ea('0x1a')](handleEntityNotFound(_0x5dde90,null))[_0xa1ea('0x1a')](respondWithResult(_0x5dde90,null))[_0xa1ea('0x28')](handleError(_0x5dde90,null));};exports[_0xa1ea('0x34')]=function(_0xf7e92a,_0x236b03){return db['OpenchannelInteraction'][_0xa1ea('0x34')](_0xf7e92a[_0xa1ea('0x35')],{})[_0xa1ea('0x1a')](respondWithResult(_0x236b03,0xc9))['catch'](handleError(_0x236b03,null));};exports[_0xa1ea('0x19')]=function(_0x554d5d,_0x35ed84){if(_0x554d5d[_0xa1ea('0x35')]['id']){delete _0x554d5d[_0xa1ea('0x35')]['id'];}return db[_0xa1ea('0x21')]['find']({'where':{'id':_0x554d5d[_0xa1ea('0x2c')]['id']}})['then'](handleEntityNotFound(_0x35ed84,null))['then'](saveUpdates(_0x554d5d['body'],null))[_0xa1ea('0x1a')](respondWithResult(_0x35ed84,null))[_0xa1ea('0x28')](handleError(_0x35ed84,null));};exports[_0xa1ea('0x1b')]=function(_0x2be5fc,_0x3abde5){return db[_0xa1ea('0x21')][_0xa1ea('0x36')]({'where':{'id':_0x2be5fc[_0xa1ea('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3abde5,null))[_0xa1ea('0x1a')](removeEntity(_0x3abde5,null))['catch'](handleError(_0x3abde5,null));};exports[_0xa1ea('0x37')]=function(_0x20c350,_0x23ff7f){return db[_0xa1ea('0x21')][_0xa1ea('0x37')]()[_0xa1ea('0x1a')](respondWithResult(_0x23ff7f,null))['catch'](handleError(_0x23ff7f,null));};exports[_0xa1ea('0x38')]=function(_0x5763a5,_0x1b2c96){return db[_0xa1ea('0x39')]['find']({'where':{'id':_0x5763a5[_0xa1ea('0x2c')]['id']}})[_0xa1ea('0x1a')](handleEntityNotFound(_0x1b2c96,null))[_0xa1ea('0x1a')](function(_0x313eaf){if(_0x313eaf){return _0x313eaf[_0xa1ea('0x38')](_0x5763a5[_0xa1ea('0x35')]['ids'],_[_0xa1ea('0x3a')](_0x5763a5['body'],[_0xa1ea('0x3b'),'id'])||{});}})[_0xa1ea('0x1a')](respondWithResult(_0x1b2c96,null))['catch'](handleError(_0x1b2c96,null));};exports['getMessages']=function(_0x291533,_0x5b3311){var _0x1c4f02={'raw':![],'where':{}};var _0x1e8167={};var _0xf42054={'count':0x0,'rows':[]};return db[_0xa1ea('0x21')]['findOne']({'where':{'id':_0x291533[_0xa1ea('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5b3311,null))[_0xa1ea('0x1a')](function(_0x413694){if(_0x413694){_0x1e8167[_0xa1ea('0x2d')]=_[_0xa1ea('0x3c')](db['OpenchannelMessage'][_0xa1ea('0x22')]);_0x1e8167['query']=_[_0xa1ea('0x3c')](_0x291533[_0xa1ea('0x29')]);_0x1e8167[_0xa1ea('0x2e')]=_['intersection'](_0x1e8167[_0xa1ea('0x2d')],_0x1e8167[_0xa1ea('0x29')]);_0x1c4f02[_0xa1ea('0x2f')]=_[_0xa1ea('0x3d')](_0x1e8167[_0xa1ea('0x2d')],qs[_0xa1ea('0x30')](_0x291533['query'][_0xa1ea('0x30')]));_0x1c4f02[_0xa1ea('0x2f')]=_0x1c4f02[_0xa1ea('0x2f')][_0xa1ea('0x31')]?_0x1c4f02[_0xa1ea('0x2f')]:_0x1e8167[_0xa1ea('0x2d')];if(!_0x291533[_0xa1ea('0x29')][_0xa1ea('0x3e')](_0xa1ea('0x3f'))){_0x1c4f02[_0xa1ea('0x16')]=qs[_0xa1ea('0x16')](_0x291533['query'][_0xa1ea('0x16')]);_0x1c4f02[_0xa1ea('0x14')]=qs['offset'](_0x291533[_0xa1ea('0x29')][_0xa1ea('0x14')]);}_0x1c4f02[_0xa1ea('0x40')]=qs['sort'](_0x291533[_0xa1ea('0x29')][_0xa1ea('0x41')]);_0x1c4f02['where']=qs[_0xa1ea('0x2e')](_['pick'](_0x291533['query'],_0x1e8167['filters']));_0x1c4f02[_0xa1ea('0x42')][_0xa1ea('0x43')]=_0x413694['id'];if(_0x291533['query'][_0xa1ea('0x44')]){_0x1c4f02[_0xa1ea('0x42')]=_[_0xa1ea('0x33')](_0x1c4f02[_0xa1ea('0x42')],{'$or':_[_0xa1ea('0x20')](_0x1c4f02['attributes'],function(_0x13ac2d){var _0x4c76c4={};_0x4c76c4[_0x13ac2d]={'$like':'%'+_0x291533['query']['filter']+'%'};return _0x4c76c4;})});}if(_0x291533[_0xa1ea('0x29')][_0xa1ea('0x45')]){var _0x47cc44=_0x291533['query'][_0xa1ea('0x45')][_0xa1ea('0x46')](',');var _0x55d87c={};_0x55d87c[_0x47cc44[0x0]]={'$gte':moment(_0x47cc44[0x1])[_0xa1ea('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1c4f02[_0xa1ea('0x42')]=_[_0xa1ea('0x33')](_0x1c4f02[_0xa1ea('0x42')],_0x55d87c);}_0x1c4f02=_['merge']({},_0x1c4f02,_0x291533[_0xa1ea('0x48')]);return db[_0xa1ea('0x39')][_0xa1ea('0x17')]({'where':_0x1c4f02[_0xa1ea('0x42')]})[_0xa1ea('0x1a')](function(_0xebcc98){_0xf42054[_0xa1ea('0x17')]=_0xebcc98;if(_0x291533[_0xa1ea('0x29')]['includeAll']){_0x1c4f02[_0xa1ea('0x49')]=[{'all':!![]}];}return db[_0xa1ea('0x39')][_0xa1ea('0x25')](_0x1c4f02);})[_0xa1ea('0x1a')](function(_0x155c89){_0xf42054[_0xa1ea('0x4a')]=_0x155c89;return _0xf42054;});}})[_0xa1ea('0x1a')](respondWithFilteredResult(_0x5b3311,_0x1c4f02))[_0xa1ea('0x28')](handleError(_0x5b3311,null));};exports[_0xa1ea('0x4b')]=function(_0x48d530,_0x329df3){return db[_0xa1ea('0x21')][_0xa1ea('0x36')]({'where':{'id':_0x48d530[_0xa1ea('0x2c')]['id']}})[_0xa1ea('0x1a')](handleEntityNotFound(_0x329df3,null))[_0xa1ea('0x1a')](function(_0x138326){if(_0x138326){return _0x138326[_0xa1ea('0x4c')](_0x48d530['body'][_0xa1ea('0x3b')],_['omit'](_0x48d530[_0xa1ea('0x35')],[_0xa1ea('0x3b'),'id'])||{})[_0xa1ea('0x4d')](function(){return db['Tag']['findAll']({'attributes':['id',_0xa1ea('0x1e'),_0xa1ea('0x4e')],'where':{'id':_0x48d530['body'][_0xa1ea('0x3b')]}});})[_0xa1ea('0x1a')](function(_0x52758f){socket['emit'](_0xa1ea('0x4f'),{'id':Number(_0x48d530[_0xa1ea('0x2c')]['id']),'tags':_0x52758f||[]});return{'id':Number(_0x48d530[_0xa1ea('0x2c')]['id']),'tags':_0x52758f||[]};});}})[_0xa1ea('0x1a')](respondWithResult(_0x329df3,null))[_0xa1ea('0x28')](handleError(_0x329df3,null));};exports[_0xa1ea('0x50')]=function(_0x5c755b,_0x5e47fa){return db['OpenchannelInteraction'][_0xa1ea('0x36')]({'where':{'id':_0x5c755b[_0xa1ea('0x2c')]['id']}})[_0xa1ea('0x1a')](handleEntityNotFound(_0x5e47fa,null))[_0xa1ea('0x1a')](function(_0x3fd8bf){if(_0x3fd8bf){return _0x3fd8bf[_0xa1ea('0x50')](_0x5c755b[_0xa1ea('0x29')][_0xa1ea('0x3b')]);}})['then'](respondWithStatusCode(_0x5e47fa,null))['catch'](handleError(_0x5e47fa,null));};exports[_0xa1ea('0x51')]=function(_0x2ca439,_0x55bc58){var _0x4fa04f=moment()['unix']()[_0xa1ea('0x52')]();var _0x48b237=path[_0xa1ea('0x53')](config[_0xa1ea('0x54')],_0xa1ea('0x55'),_0xa1ea('0x56'),_0xa1ea('0x57'));var _0x24e1fc=path[_0xa1ea('0x53')](config[_0xa1ea('0x54')],_0xa1ea('0x55'),_0xa1ea('0x56'),_0xa1ea('0x58'));var _0x365b89=path[_0xa1ea('0x53')](_0x48b237,_0x4fa04f);var _0x4a61f6=util[_0xa1ea('0x47')](_0xa1ea('0x59'),_0x2ca439[_0xa1ea('0x2c')]['id'],_0x4fa04f);var _0x30467d=path[_0xa1ea('0x53')](_0x48b237,_0x4a61f6);var _0xc50d15=[];_0xc50d15['push']({'model':db[_0xa1ea('0x5a')],'as':'User','attributes':['id',_0xa1ea('0x5b')],'raw':!![]});_0xc50d15[_0xa1ea('0x5c')]({'model':db[_0xa1ea('0x5d')],'as':'Contact','attributes':['id',_0xa1ea('0x5e'),_0xa1ea('0x5f')],'raw':!![]});if(_0x2ca439[_0xa1ea('0x29')][_0xa1ea('0x58')]){_0xc50d15[_0xa1ea('0x5c')]({'model':db[_0xa1ea('0x60')],'as':_0xa1ea('0x60'),'raw':!![]});}var _0x1a0aed=[{'model':db[_0xa1ea('0x39')],'as':_0xa1ea('0x61'),'attributes':['id','body',_0xa1ea('0x62'),_0xa1ea('0x63'),_0xa1ea('0x64'),_0xa1ea('0x65')],'include':_0xc50d15}];_0x1a0aed[_0xa1ea('0x5c')]({'model':db['OpenchannelAccount'],'as':_0xa1ea('0x66'),'attributes':['id',_0xa1ea('0x1e')]});_0x1a0aed['push']({'model':db['User'],'as':_0xa1ea('0x67'),'attributes':['id',_0xa1ea('0x5b')]});return db[_0xa1ea('0x21')][_0xa1ea('0x36')]({'where':{'id':_0x2ca439['params']['id']},'include':_0x1a0aed})['then'](handleEntityNotFound(_0x55bc58,null))[_0xa1ea('0x1a')](function(_0x20ef71){if(_0x20ef71){var _0x3df605=_0x20ef71[_0xa1ea('0x68')]({'plain':!![]});fs[_0xa1ea('0x69')](_0x365b89);var _0x20c634={'channel':_0xa1ea('0x6a'),'account':_0x3df605[_0xa1ea('0x66')][_0xa1ea('0x1e')],'agent':_0x3df605[_0xa1ea('0x67')]?_0x3df605[_0xa1ea('0x67')][_0xa1ea('0x5b')]:_0xa1ea('0x6b'),'createdAt':moment(_0x3df605['createdAt'])[_0xa1ea('0x47')](_0xa1ea('0x6c'))[_0xa1ea('0x52')](),'closedAt':_0x3df605[_0xa1ea('0x6d')]?moment(_0x3df605[_0xa1ea('0x6e')])[_0xa1ea('0x47')](_0xa1ea('0x6c'))[_0xa1ea('0x52')]():'','disposition':_0x3df605[_0xa1ea('0x6f')],'visibility':_0x3df605[_0xa1ea('0x70')]?'Public':_0xa1ea('0x71'),'messages':_(_0x3df605[_0xa1ea('0x61')])[_0xa1ea('0x44')]({'secret':![]})[_0xa1ea('0x20')](function(_0x55ea64){if(_0x55ea64[_0xa1ea('0x60')]){var _0x2e7b95=path[_0xa1ea('0x53')](_0x24e1fc,_0x55ea64[_0xa1ea('0x60')]['basename']);if(fs[_0xa1ea('0x72')](_0x2e7b95)){fs['createReadStream'](_0x2e7b95)['pipe'](fs[_0xa1ea('0x73')](path[_0xa1ea('0x53')](_0x365b89,_0x55ea64['Attachment'][_0xa1ea('0x74')])));}}return{'date':moment(_0x55ea64['createdAt'])[_0xa1ea('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa1ea('0x52')](),'sender':_0x55ea64[_0xa1ea('0x63')]===_0xa1ea('0x75')?_0x55ea64['User']?_0x55ea64[_0xa1ea('0x5a')][_0xa1ea('0x5b')]:_0xa1ea('0x76'):_0x55ea64['Contact'][_0xa1ea('0x5e')]+(_0x55ea64[_0xa1ea('0x77')][_0xa1ea('0x5f')]?'\x20'+_0x55ea64[_0xa1ea('0x77')][_0xa1ea('0x5f')]:''),'body':_0x55ea64[_0xa1ea('0x60')]?_0x55ea64['Attachment'][_0xa1ea('0x74')]:_0x55ea64[_0xa1ea('0x35')],'direction':_0x55ea64[_0xa1ea('0x63')]===_0xa1ea('0x75')?'A':'C','secret':_0x55ea64[_0xa1ea('0x64')],'read':_0x55ea64['read'],'attachment':_0x55ea64[_0xa1ea('0x60')]};})[_0xa1ea('0x78')]()};return ejs['renderFile'](path['join'](config[_0xa1ea('0x54')],'server',_0xa1ea('0x79'),_0xa1ea('0x7a')),{'interaction':_0x20c634})[_0xa1ea('0x1a')](function(_0x187995){var _0x3f9a48=path[_0xa1ea('0x53')](_0x365b89,_0xa1ea('0x7b')+_0x3df605['id']+'-'+_0x4fa04f+_0xa1ea('0x7c'));var _0x2d43a4={'path':_0x3f9a48,'channel':_0xa1ea('0x6a'),'interactionId':_0x3df605['id']};return pdf[_0xa1ea('0x7d')](_0x187995,_0x2d43a4);})['then'](function(){return new Promise(function(_0x394588,_0xe61f9b){zipdir(_0x365b89,{'saveTo':_0x30467d},function(_0x4b5155,_0xd13023){if(_0x4b5155)return _0xe61f9b(_0x4b5155);return _0x394588(_0xd13023);});})['then'](function(){return new Promise(function(_0x1313bd,_0x3e56a3){rimraf(_0x365b89,function(_0x2badce){if(_0x2badce)_0x3e56a3(_0x2badce);return _0x1313bd();});});})['then'](function(){return _0x55bc58[_0xa1ea('0x51')](_0x30467d,_0x4a61f6,function(_0x1f1eb9){if(_0x1f1eb9){logger[_0xa1ea('0x7e')](_0xa1ea('0x7f'),_0x1f1eb9);}else{fs[_0xa1ea('0x80')](_0x30467d);}});});});}else{return _0x55bc58[_0xa1ea('0x81')](0xc8);}})['catch'](handleError(_0x55bc58,null));}; \ No newline at end of file +var _0x4198=['filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','includeAll','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','join','root','attachments','transcript-%d-%s.zip','User','fullname','push','Contact','firstName','lastName','Attachment','Messages','createdAt','read','OpenchannelAccount','Account','Owner','mkdirSync','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','createReadStream','pipe','direction','out','System','value','renderFile','downloadInteraction.ejs','Openchannel','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','user','catch','show','from','params','model','keys','OpenchannelInteraction','filters','intersection','attributes','fields','include','options','create','body','find','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x53f4a4,_0xb07de7){var _0x2aa5e7=function(_0x3b0350){while(--_0x3b0350){_0x53f4a4['push'](_0x53f4a4['shift']());}};_0x2aa5e7(++_0xb07de7);}(_0x4198,0x146));var _0x8419=function(_0x303c6e,_0x315026){_0x303c6e=_0x303c6e-0x0;var _0x5dbe0f=_0x4198[_0x303c6e];return _0x5dbe0f;};'use strict';var rimraf=require(_0x8419('0x0'));var zipdir=require(_0x8419('0x1'));var moment=require(_0x8419('0x2'));var util=require(_0x8419('0x3'));var path=require(_0x8419('0x4'));var ejs=require(_0x8419('0x5'));var fs=require('fs');var _=require(_0x8419('0x6'));var Redis=require(_0x8419('0x7'));var interaction=require(_0x8419('0x8'));var qs=require(_0x8419('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x8419('0xa'));var config=require(_0x8419('0xb'));var db=require(_0x8419('0xc'))['db'];config['redis']=_['defaults'](config[_0x8419('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x8419('0xe'))(new Redis(config['redis']));require(_0x8419('0xf'))[_0x8419('0x10')](socket);function respondWithStatusCode(_0x4c3bbf,_0x22ff33){_0x22ff33=_0x22ff33||0xcc;return function(_0x377f00){if(_0x377f00){return _0x4c3bbf[_0x8419('0x11')](_0x22ff33);}return _0x4c3bbf['status'](_0x22ff33)[_0x8419('0x12')]();};}function respondWithResult(_0x2b34ec,_0x385b4f){_0x385b4f=_0x385b4f||0xc8;return function(_0x382283){if(_0x382283){return _0x2b34ec[_0x8419('0x13')](_0x385b4f)[_0x8419('0x14')](_0x382283);}};}function respondWithFilteredResult(_0x838fd0,_0x27360c){return function(_0x56a1dc){if(_0x56a1dc){var _0x5ae988=typeof _0x27360c['offset']===_0x8419('0x15')&&typeof _0x27360c[_0x8419('0x16')]===_0x8419('0x15');var _0x3f1cfa=_0x56a1dc['count'];var _0x1c61b7=_0x5ae988?0x0:_0x27360c['offset'];var _0x574d59=_0x5ae988?_0x56a1dc[_0x8419('0x17')]:_0x27360c[_0x8419('0x18')]+_0x27360c[_0x8419('0x16')];var _0xc6815;if(_0x574d59>=_0x3f1cfa){_0x574d59=_0x3f1cfa;_0xc6815=0xc8;}else{_0xc6815=0xce;}_0x838fd0[_0x8419('0x13')](_0xc6815);return _0x838fd0[_0x8419('0x19')](_0x8419('0x1a'),_0x1c61b7+'-'+_0x574d59+'/'+_0x3f1cfa)[_0x8419('0x14')](_0x56a1dc);}return null;};}function saveUpdates(_0x13c88e){return function(_0x4c6372){if(_0x4c6372){return _0x4c6372[_0x8419('0x1b')](_0x13c88e)[_0x8419('0x1c')](function(_0x224df2){return _0x224df2;});}return null;};}function removeEntity(_0x4a052f){return function(_0x16d91b){if(_0x16d91b){return _0x16d91b[_0x8419('0x1d')]()['then'](function(){_0x4a052f[_0x8419('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39c224){return function(_0x5d747c){if(!_0x5d747c){_0x39c224[_0x8419('0x11')](0x194);}return _0x5d747c;};}function handleError(_0x24c963,_0x2a853a){_0x2a853a=_0x2a853a||0x1f4;return function(_0x5168dd){logger['error'](_0x5168dd[_0x8419('0x1e')]);if(_0x5168dd[_0x8419('0x1f')]){delete _0x5168dd[_0x8419('0x1f')];}_0x24c963[_0x8419('0x13')](_0x2a853a)[_0x8419('0x20')](_0x5168dd);};}exports[_0x8419('0x21')]=function(_0x1ea759,_0x90000c){var _0x3006b6={};var _0xea9939=_[_0x8419('0x22')](db['OpenchannelInteraction'][_0x8419('0x23')],function(_0x517682){return{'name':_0x517682[_0x8419('0x24')],'type':_0x517682[_0x8419('0x25')][_0x8419('0x26')]};});_0x3006b6=qs[_0x8419('0x27')](_0xea9939,_0x1ea759);return interaction[_0x8419('0x28')](_0x8419('0x29'),_0x1ea759[_0x8419('0x2a')],_0x1ea759[_0x8419('0x2b')],_0x3006b6,_0xea9939)[_0x8419('0x1c')](respondWithFilteredResult(_0x90000c,_0x3006b6))[_0x8419('0x2c')](handleError(_0x90000c,null));};exports[_0x8419('0x2d')]=function(_0x42fa3,_0x16bd2e){var _0x5d719d={};if(_0x42fa3['query'][_0x8419('0x25')]&&_0x42fa3[_0x8419('0x2a')]['type']===_0x8419('0x2e')){_0x5d719d[_0x8419('0x2e')]=_0x42fa3['params']['id'];}else{_0x5d719d['id']=_0x42fa3[_0x8419('0x2f')]['id'];}var _0x5216f3={'raw':![],'where':_0x5d719d},_0x43fc85={};_0x43fc85[_0x8419('0x30')]=_[_0x8419('0x31')](db[_0x8419('0x32')]['rawAttributes']);_0x43fc85[_0x8419('0x2a')]=_[_0x8419('0x31')](_0x42fa3[_0x8419('0x2a')]);_0x43fc85[_0x8419('0x33')]=_[_0x8419('0x34')](_0x43fc85[_0x8419('0x30')],_0x43fc85[_0x8419('0x2a')]);_0x5216f3[_0x8419('0x35')]=_[_0x8419('0x34')](_0x43fc85[_0x8419('0x30')],qs[_0x8419('0x36')](_0x42fa3['query'][_0x8419('0x36')]));_0x5216f3[_0x8419('0x35')]=_0x5216f3[_0x8419('0x35')]['length']?_0x5216f3[_0x8419('0x35')]:_0x43fc85['model'];if(_0x42fa3[_0x8419('0x2a')]['includeAll']){_0x5216f3[_0x8419('0x37')]=[{'all':!![]}];}_0x5216f3=_['merge']({},_0x5216f3,_0x42fa3[_0x8419('0x38')]);return db['OpenchannelInteraction']['find'](_0x5216f3)[_0x8419('0x1c')](handleEntityNotFound(_0x16bd2e,null))[_0x8419('0x1c')](respondWithResult(_0x16bd2e,null))[_0x8419('0x2c')](handleError(_0x16bd2e,null));};exports[_0x8419('0x39')]=function(_0x2934a9,_0x458e15){return db[_0x8419('0x32')]['create'](_0x2934a9['body'],{})['then'](respondWithResult(_0x458e15,0xc9))[_0x8419('0x2c')](handleError(_0x458e15,null));};exports[_0x8419('0x1b')]=function(_0x5832d5,_0x50766f){if(_0x5832d5['body']['id']){delete _0x5832d5[_0x8419('0x3a')]['id'];}return db[_0x8419('0x32')][_0x8419('0x3b')]({'where':{'id':_0x5832d5['params']['id']}})[_0x8419('0x1c')](handleEntityNotFound(_0x50766f,null))[_0x8419('0x1c')](saveUpdates(_0x5832d5[_0x8419('0x3a')],null))[_0x8419('0x1c')](respondWithResult(_0x50766f,null))['catch'](handleError(_0x50766f,null));};exports['destroy']=function(_0x43614c,_0x21efd1){return db[_0x8419('0x32')]['find']({'where':{'id':_0x43614c['params']['id']}})[_0x8419('0x1c')](handleEntityNotFound(_0x21efd1,null))['then'](removeEntity(_0x21efd1,null))[_0x8419('0x2c')](handleError(_0x21efd1,null));};exports['describe']=function(_0x1c06e2,_0x5c4b77){return db['OpenchannelInteraction'][_0x8419('0x3c')]()['then'](respondWithResult(_0x5c4b77,null))[_0x8419('0x2c')](handleError(_0x5c4b77,null));};exports[_0x8419('0x3d')]=function(_0x329538,_0x295b2f){return db[_0x8419('0x3e')][_0x8419('0x3b')]({'where':{'id':_0x329538[_0x8419('0x2f')]['id']}})[_0x8419('0x1c')](handleEntityNotFound(_0x295b2f,null))[_0x8419('0x1c')](function(_0x5e9ef4){if(_0x5e9ef4){return _0x5e9ef4[_0x8419('0x3d')](_0x329538['body'][_0x8419('0x3f')],_[_0x8419('0x40')](_0x329538[_0x8419('0x3a')],[_0x8419('0x3f'),'id'])||{});}})[_0x8419('0x1c')](respondWithResult(_0x295b2f,null))[_0x8419('0x2c')](handleError(_0x295b2f,null));};exports[_0x8419('0x41')]=function(_0x23ee94,_0x7de269){var _0x320561={'raw':![],'where':{}};var _0x54a9f6={};var _0x1ab905={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x8419('0x42')]({'where':{'id':_0x23ee94['params']['id']}})[_0x8419('0x1c')](handleEntityNotFound(_0x7de269,null))[_0x8419('0x1c')](function(_0x4d20c2){if(_0x4d20c2){_0x54a9f6[_0x8419('0x30')]=_['keys'](db['OpenchannelMessage'][_0x8419('0x23')]);_0x54a9f6[_0x8419('0x2a')]=_[_0x8419('0x31')](_0x23ee94[_0x8419('0x2a')]);_0x54a9f6['filters']=_[_0x8419('0x34')](_0x54a9f6[_0x8419('0x30')],_0x54a9f6[_0x8419('0x2a')]);_0x320561['attributes']=_[_0x8419('0x34')](_0x54a9f6[_0x8419('0x30')],qs[_0x8419('0x36')](_0x23ee94[_0x8419('0x2a')][_0x8419('0x36')]));_0x320561[_0x8419('0x35')]=_0x320561[_0x8419('0x35')][_0x8419('0x43')]?_0x320561[_0x8419('0x35')]:_0x54a9f6[_0x8419('0x30')];if(!_0x23ee94[_0x8419('0x2a')][_0x8419('0x44')](_0x8419('0x45'))){_0x320561[_0x8419('0x16')]=qs[_0x8419('0x16')](_0x23ee94[_0x8419('0x2a')][_0x8419('0x16')]);_0x320561[_0x8419('0x18')]=qs[_0x8419('0x18')](_0x23ee94['query'][_0x8419('0x18')]);}_0x320561[_0x8419('0x46')]=qs[_0x8419('0x47')](_0x23ee94[_0x8419('0x2a')]['sort']);_0x320561[_0x8419('0x48')]=qs[_0x8419('0x33')](_['pick'](_0x23ee94[_0x8419('0x2a')],_0x54a9f6[_0x8419('0x33')]));_0x320561[_0x8419('0x48')]['OpenchannelInteractionId']=_0x4d20c2['id'];if(_0x23ee94[_0x8419('0x2a')][_0x8419('0x49')]){_0x320561[_0x8419('0x48')]=_['merge'](_0x320561[_0x8419('0x48')],{'$or':_[_0x8419('0x22')](_0x320561[_0x8419('0x35')],function(_0x3a8b23){var _0x2754ec={};_0x2754ec[_0x3a8b23]={'$like':'%'+_0x23ee94['query'][_0x8419('0x49')]+'%'};return _0x2754ec;})});}if(_0x23ee94[_0x8419('0x2a')][_0x8419('0x4a')]){var _0x2e7e3d=_0x23ee94[_0x8419('0x2a')][_0x8419('0x4a')][_0x8419('0x4b')](',');var _0x40380c={};_0x40380c[_0x2e7e3d[0x0]]={'$gte':moment(_0x2e7e3d[0x1])[_0x8419('0x4c')](_0x8419('0x4d'))};_0x320561[_0x8419('0x48')]=_[_0x8419('0x4e')](_0x320561[_0x8419('0x48')],_0x40380c);}_0x320561=_[_0x8419('0x4e')]({},_0x320561,_0x23ee94[_0x8419('0x38')]);return db['OpenchannelMessage'][_0x8419('0x17')]({'where':_0x320561[_0x8419('0x48')]})[_0x8419('0x1c')](function(_0x4493bd){_0x1ab905['count']=_0x4493bd;if(_0x23ee94[_0x8419('0x2a')][_0x8419('0x4f')]){_0x320561[_0x8419('0x37')]=[{'all':!![]}];}return db[_0x8419('0x3e')][_0x8419('0x28')](_0x320561);})[_0x8419('0x1c')](function(_0xa5e314){_0x1ab905['rows']=_0xa5e314;return _0x1ab905;});}})[_0x8419('0x1c')](respondWithFilteredResult(_0x7de269,_0x320561))[_0x8419('0x2c')](handleError(_0x7de269,null));};exports[_0x8419('0x50')]=function(_0x1ab84c,_0x104baa){return db['OpenchannelInteraction'][_0x8419('0x3b')]({'where':{'id':_0x1ab84c[_0x8419('0x2f')]['id']}})['then'](handleEntityNotFound(_0x104baa,null))['then'](function(_0x26598b){if(_0x26598b){return _0x26598b[_0x8419('0x51')](_0x1ab84c['body'][_0x8419('0x3f')],_[_0x8419('0x40')](_0x1ab84c[_0x8419('0x3a')],[_0x8419('0x3f'),'id'])||{})[_0x8419('0x52')](function(){return db[_0x8419('0x53')]['findAll']({'attributes':['id',_0x8419('0x1f'),_0x8419('0x54')],'where':{'id':_0x1ab84c[_0x8419('0x3a')][_0x8419('0x3f')]}});})[_0x8419('0x1c')](function(_0x5abee4){socket[_0x8419('0x55')](_0x8419('0x56'),{'id':Number(_0x1ab84c['params']['id']),'tags':_0x5abee4||[]});return{'id':Number(_0x1ab84c[_0x8419('0x2f')]['id']),'tags':_0x5abee4||[]};});}})[_0x8419('0x1c')](respondWithResult(_0x104baa,null))[_0x8419('0x2c')](handleError(_0x104baa,null));};exports[_0x8419('0x57')]=function(_0x5534f6,_0x124945){return db[_0x8419('0x32')][_0x8419('0x3b')]({'where':{'id':_0x5534f6[_0x8419('0x2f')]['id']}})[_0x8419('0x1c')](handleEntityNotFound(_0x124945,null))[_0x8419('0x1c')](function(_0x5264c1){if(_0x5264c1){return _0x5264c1[_0x8419('0x57')](_0x5534f6[_0x8419('0x2a')]['ids']);}})['then'](respondWithStatusCode(_0x124945,null))[_0x8419('0x2c')](handleError(_0x124945,null));};exports[_0x8419('0x58')]=function(_0x36a149,_0xeb266b){var _0x4b8e26=moment()[_0x8419('0x59')]()[_0x8419('0x5a')]();var _0x1eb675=path['join'](config['root'],_0x8419('0x5b'),_0x8419('0x5c'),_0x8419('0x5d'));var _0x2f016a=path[_0x8419('0x5e')](config[_0x8419('0x5f')],_0x8419('0x5b'),_0x8419('0x5c'),_0x8419('0x60'));var _0x4c9044=path['join'](_0x1eb675,_0x4b8e26);var _0x5047e6=util[_0x8419('0x4c')](_0x8419('0x61'),_0x36a149['params']['id'],_0x4b8e26);var _0x2e077c=path[_0x8419('0x5e')](_0x1eb675,_0x5047e6);var _0x494b81=[];_0x494b81['push']({'model':db[_0x8419('0x62')],'as':_0x8419('0x62'),'attributes':['id',_0x8419('0x63')],'raw':!![]});_0x494b81[_0x8419('0x64')]({'model':db['CmContact'],'as':_0x8419('0x65'),'attributes':['id',_0x8419('0x66'),_0x8419('0x67')],'raw':!![]});if(_0x36a149[_0x8419('0x2a')][_0x8419('0x60')]){_0x494b81[_0x8419('0x64')]({'model':db[_0x8419('0x68')],'as':_0x8419('0x68'),'raw':!![]});}var _0x4454c8=[{'model':db[_0x8419('0x3e')],'as':_0x8419('0x69'),'attributes':['id',_0x8419('0x3a'),_0x8419('0x6a'),'direction','secret',_0x8419('0x6b')],'include':_0x494b81}];_0x4454c8[_0x8419('0x64')]({'model':db[_0x8419('0x6c')],'as':_0x8419('0x6d'),'attributes':['id',_0x8419('0x1f')]});_0x4454c8['push']({'model':db[_0x8419('0x62')],'as':_0x8419('0x6e'),'attributes':['id',_0x8419('0x63')]});return db[_0x8419('0x32')][_0x8419('0x3b')]({'where':{'id':_0x36a149[_0x8419('0x2f')]['id']},'include':_0x4454c8})[_0x8419('0x1c')](handleEntityNotFound(_0xeb266b,null))[_0x8419('0x1c')](function(_0x860ceb){if(_0x860ceb){var _0x4391e8=_0x860ceb['get']({'plain':!![]});fs[_0x8419('0x6f')](_0x4c9044);var _0x884155={'channel':'Openchannel','account':_0x4391e8[_0x8419('0x6d')][_0x8419('0x1f')],'agent':_0x4391e8[_0x8419('0x6e')]?_0x4391e8['Owner'][_0x8419('0x63')]:_0x8419('0x70'),'createdAt':moment(_0x4391e8[_0x8419('0x6a')])['format'](_0x8419('0x4d'))[_0x8419('0x5a')](),'closedAt':_0x4391e8[_0x8419('0x71')]?moment(_0x4391e8[_0x8419('0x72')])[_0x8419('0x4c')](_0x8419('0x4d'))[_0x8419('0x5a')]():'','disposition':_0x4391e8[_0x8419('0x73')],'visibility':_0x4391e8[_0x8419('0x74')]?_0x8419('0x75'):_0x8419('0x76'),'messages':_(_0x4391e8['Messages'])['filter']({'secret':![]})[_0x8419('0x22')](function(_0x26d471){if(_0x26d471['Attachment']){var _0x22bdd3=path[_0x8419('0x5e')](_0x2f016a,_0x26d471[_0x8419('0x68')][_0x8419('0x77')]);if(fs['existsSync'](_0x22bdd3)){fs[_0x8419('0x78')](_0x22bdd3)[_0x8419('0x79')](fs['createWriteStream'](path[_0x8419('0x5e')](_0x4c9044,_0x26d471[_0x8419('0x68')][_0x8419('0x77')])));}}return{'date':moment(_0x26d471[_0x8419('0x6a')])[_0x8419('0x4c')](_0x8419('0x4d'))[_0x8419('0x5a')](),'sender':_0x26d471[_0x8419('0x7a')]===_0x8419('0x7b')?_0x26d471[_0x8419('0x62')]?_0x26d471[_0x8419('0x62')][_0x8419('0x63')]:_0x8419('0x7c'):_0x26d471[_0x8419('0x65')][_0x8419('0x66')]+(_0x26d471[_0x8419('0x65')][_0x8419('0x67')]?'\x20'+_0x26d471['Contact']['lastName']:''),'body':_0x26d471[_0x8419('0x68')]?_0x26d471['Attachment'][_0x8419('0x77')]:_0x26d471[_0x8419('0x3a')],'direction':_0x26d471[_0x8419('0x7a')]===_0x8419('0x7b')?'A':'C','secret':_0x26d471['secret'],'read':_0x26d471[_0x8419('0x6b')],'attachment':_0x26d471['Attachment']};})[_0x8419('0x7d')]()};return ejs[_0x8419('0x7e')](path[_0x8419('0x5e')](config[_0x8419('0x5f')],'server','views',_0x8419('0x7f')),{'interaction':_0x884155})[_0x8419('0x1c')](function(_0x575d1b){var _0x57d25c=path[_0x8419('0x5e')](_0x4c9044,'transcript-'+_0x4391e8['id']+'-'+_0x4b8e26+'.pdf');var _0x29686e={'path':_0x57d25c,'channel':_0x8419('0x80'),'interactionId':_0x4391e8['id']};return pdf[_0x8419('0x81')](_0x575d1b,_0x29686e);})[_0x8419('0x1c')](function(){return new Promise(function(_0x2db981,_0x597aab){zipdir(_0x4c9044,{'saveTo':_0x2e077c},function(_0x286212,_0x14c985){if(_0x286212)return _0x597aab(_0x286212);return _0x2db981(_0x14c985);});})[_0x8419('0x1c')](function(){return new Promise(function(_0x21620a,_0x2b1eca){rimraf(_0x4c9044,function(_0x3376ba){if(_0x3376ba)_0x2b1eca(_0x3376ba);return _0x21620a();});});})['then'](function(){return _0xeb266b[_0x8419('0x58')](_0x2e077c,_0x5047e6,function(_0x118fea){if(_0x118fea){logger[_0x8419('0x82')](_0x8419('0x83'),_0x118fea);}else{fs[_0x8419('0x84')](_0x2e077c);}});});});}else{return _0xeb266b[_0x8419('0x11')](0xc8);}})[_0x8419('0x2c')](handleError(_0xeb266b,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 29763ea..cbb7af7 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 _0x3880=['OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction'];(function(_0x32689c,_0x1e5ad2){var _0xce38dd=function(_0x3945d8){while(--_0x3945d8){_0x32689c['push'](_0x32689c['shift']());}};_0xce38dd(++_0x1e5ad2);}(_0x3880,0x140));var _0x0388=function(_0x120f01,_0x18f9d6){_0x120f01=_0x120f01-0x0;var _0x32b851=_0x3880[_0x120f01];return _0x32b851;};'use strict';var EventEmitter=require(_0x0388('0x0'));var OpenchannelInteraction=require(_0x0388('0x1'))['db'][_0x0388('0x2')];var OpenchannelMessage=require(_0x0388('0x1'))['db'][_0x0388('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x0388('0x4')](0x0);var events={'afterCreate':_0x0388('0x5'),'afterUpdate':_0x0388('0x6'),'afterDestroy':_0x0388('0x7')};function emitEvent(_0x2262e9){return function(_0x45d402,_0x4b5ac7,_0x503c10){_0x45d402[_0x0388('0x8')]({'attributes':['id'],'raw':!![]})[_0x0388('0x9')](function(_0x2f32e9){_0x45d402[_0x0388('0xa')]('Users',_0x2f32e9[_0x0388('0xb')](function(_0x67403a){return{'id':_0x67403a['id']};}));return OpenchannelMessage[_0x0388('0xc')]({'where':{'OpenchannelInteractionId':_0x45d402['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0388('0x9')](function(_0x49091c){_0x45d402['setDataValue'](_0x0388('0xd'),_0x49091c[_0x0388('0xe')]);OpenchannelInteractionEvents['emit'](_0x2262e9+':'+_0x45d402['id'],_0x45d402);OpenchannelInteractionEvents[_0x0388('0xf')](_0x2262e9,_0x45d402);_0x503c10(null);})[_0x0388('0x10')](_0x503c10(null));};}for(var e in events){if(events[_0x0388('0x11')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x0388('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x9c67=['OpenchannelInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x544a8f,_0x264129){var _0x672182=function(_0x35be15){while(--_0x35be15){_0x544a8f['push'](_0x544a8f['shift']());}};_0x672182(++_0x264129);}(_0x9c67,0x9f));var _0x79c6=function(_0x28107d,_0x2ec8b3){_0x28107d=_0x28107d-0x0;var _0x2b1cbe=_0x9c67[_0x28107d];return _0x2b1cbe;};'use strict';var EventEmitter=require(_0x79c6('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x79c6('0x1')];var OpenchannelMessage=require(_0x79c6('0x2'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x79c6('0x3')](0x0);var events={'afterCreate':_0x79c6('0x4'),'afterUpdate':_0x79c6('0x5'),'afterDestroy':_0x79c6('0x6')};function emitEvent(_0x31a0de){return function(_0x4898be,_0x2ec2cb,_0xb60fc0){_0x4898be[_0x79c6('0x7')]({'attributes':['id'],'raw':!![]})[_0x79c6('0x8')](function(_0x57abaf){_0x4898be[_0x79c6('0x9')](_0x79c6('0xa'),_0x57abaf[_0x79c6('0xb')](function(_0x11f744){return{'id':_0x11f744['id']};}));return OpenchannelMessage[_0x79c6('0xc')]({'where':{'OpenchannelInteractionId':_0x4898be['id'],'direction':'in','read':![]},'raw':!![]});})[_0x79c6('0x8')](function(_0x3a2fb7){_0x4898be[_0x79c6('0x9')](_0x79c6('0xd'),_0x3a2fb7[_0x79c6('0xe')]);OpenchannelInteractionEvents[_0x79c6('0xf')](_0x31a0de+':'+_0x4898be['id'],_0x4898be);OpenchannelInteractionEvents[_0x79c6('0xf')](_0x31a0de,_0x4898be);_0xb60fc0(null);})[_0x79c6('0x10')](_0xb60fc0(null));};}for(var e in events){if(events[_0x79c6('0x11')](e)){var event=events[e];OpenchannelInteraction[_0x79c6('0x12')](e,emitEvent(event));}}module[_0x79c6('0x13')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index a983264..380ec21 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 _0xf899=['path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','../../config/logger','moment','request-promise'];(function(_0x150903,_0x378aab){var _0x5bbc72=function(_0x17a385){while(--_0x17a385){_0x150903['push'](_0x150903['shift']());}};_0x5bbc72(++_0x378aab);}(_0xf899,0x19d));var _0x9f89=function(_0x2a56e4,_0x3fc413){_0x2a56e4=_0x2a56e4-0x0;var _0x39bc0e=_0xf899[_0x2a56e4];return _0x39bc0e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9f89('0x0'))('api');var moment=require(_0x9f89('0x1'));var BPromise=require('bluebird');var rp=require(_0x9f89('0x2'));var fs=require('fs');var path=require(_0x9f89('0x3'));var rimraf=require(_0x9f89('0x4'));var config=require(_0x9f89('0x5'));var attributes=require(_0x9f89('0x6'));module[_0x9f89('0x7')]=function(_0x56b324,_0x45349f){return _0x56b324[_0x9f89('0x8')](_0x9f89('0x9'),attributes,{'tableName':_0x9f89('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9f89('0xb'),'collate':_0x9f89('0xc'),'hooks':{'beforeUpdate':function(_0x44ba59,_0x1fbd3f,_0x167524){if(_0x44ba59[_0x9f89('0xd')](_0x9f89('0xe'))){_0x44ba59['closedAt']=moment()[_0x9f89('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x167524(null,_0x44ba59);}}});}; \ No newline at end of file +var _0x4818=['exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./openchannelInteraction.attributes'];(function(_0x4f4621,_0x4902ce){var _0x43e2e4=function(_0x49d5db){while(--_0x49d5db){_0x4f4621['push'](_0x4f4621['shift']());}};_0x43e2e4(++_0x4902ce);}(_0x4818,0x158));var _0x8481=function(_0x4f37f7,_0x5de9db){_0x4f37f7=_0x4f37f7-0x0;var _0x459b87=_0x4818[_0x4f37f7];return _0x459b87;};'use strict';var _=require(_0x8481('0x0'));var util=require(_0x8481('0x1'));var logger=require(_0x8481('0x2'))('api');var moment=require(_0x8481('0x3'));var BPromise=require(_0x8481('0x4'));var rp=require(_0x8481('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8481('0x6'));var attributes=require(_0x8481('0x7'));module[_0x8481('0x8')]=function(_0x22ff04,_0x33d4f7){return _0x22ff04['define'](_0x8481('0x9'),attributes,{'tableName':_0x8481('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8481('0xb'),'collate':_0x8481('0xc'),'hooks':{'beforeUpdate':function(_0xd61670,_0x40f32c,_0x541fe5){if(_0xd61670[_0x8481('0xd')](_0x8481('0xe'))){_0xd61670['closedAt']=moment()[_0x8481('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x541fe5(null,_0xd61670);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 0f94c84..ed780eb 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 _0x89ac=['body','options','raw','attributes','limit','debug','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','where','addTags','ids','omit','AddTags','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','UpdateOpenchannelInteraction','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89ac,0x89));var _0xc89a=function(_0x24c733,_0x525907){_0x24c733=_0x24c733-0x0;var _0x21a2d3=_0x89ac[_0x24c733];return _0x21a2d3;};'use strict';var _=require(_0xc89a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc89a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc89a('0x2'));var db=require(_0xc89a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc89a('0x4'))(_0xc89a('0x5'));var config=require(_0xc89a('0x6'));var jayson=require(_0xc89a('0x7'));var client=jayson['client'][_0xc89a('0x8')]({'port':0x232a});config[_0xc89a('0x9')]=_[_0xc89a('0xa')](config[_0xc89a('0x9')],{'host':_0xc89a('0xb'),'port':0x18eb});var socket=require(_0xc89a('0xc'))(new Redis(config[_0xc89a('0x9')]));require('./openchannelInteraction.socket')[_0xc89a('0xd')](socket);function respondWithRpcPromise(_0x3d3cf6,_0x499db2,_0x485efe){return new BPromise(function(_0x487194,_0xe5b8ca){return client[_0xc89a('0xe')](_0x3d3cf6,_0x485efe)[_0xc89a('0xf')](function(_0x1db47e){logger['info'](_0xc89a('0x10'),_0x499db2,'request\x20sent');logger['debug'](_0xc89a('0x11'),_0x499db2,_0xc89a('0x12'),JSON[_0xc89a('0x13')](_0x1db47e));if(_0x1db47e['error']){if(_0x1db47e[_0xc89a('0x14')][_0xc89a('0x15')]===0x1f4){logger[_0xc89a('0x14')](_0xc89a('0x10'),_0x499db2,_0x1db47e[_0xc89a('0x14')]['message']);return _0xe5b8ca(_0x1db47e[_0xc89a('0x14')][_0xc89a('0x16')]);}logger[_0xc89a('0x14')](_0xc89a('0x10'),_0x499db2,_0x1db47e[_0xc89a('0x14')][_0xc89a('0x16')]);return _0x487194(_0x1db47e[_0xc89a('0x14')][_0xc89a('0x16')]);}else{logger[_0xc89a('0x17')](_0xc89a('0x10'),_0x499db2,_0xc89a('0x12'));_0x487194(_0x1db47e['result'][_0xc89a('0x16')]);}})[_0xc89a('0x18')](function(_0x1d32f1){logger[_0xc89a('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x499db2,_0x1d32f1);_0xe5b8ca(_0x1d32f1);});});}exports[_0xc89a('0x19')]=function(_0x32b9ee){var _0x1cd583=this;return new Promise(function(_0xbeefd0,_0x106767){return db['OpenchannelInteraction'][_0xc89a('0x1a')](_0x32b9ee[_0xc89a('0x1b')],{'raw':_0x32b9ee['options']?_0x32b9ee[_0xc89a('0x1c')][_0xc89a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32b9ee['options']?_0x32b9ee[_0xc89a('0x1c')]['where']||null:null,'attributes':_0x32b9ee[_0xc89a('0x1c')]?_0x32b9ee[_0xc89a('0x1c')][_0xc89a('0x1e')]||null:null,'limit':_0x32b9ee[_0xc89a('0x1c')]?_0x32b9ee[_0xc89a('0x1c')][_0xc89a('0x1f')]||null:null})[_0xc89a('0xf')](function(_0x21940e){logger['info'](_0xc89a('0x19'),_0x32b9ee);logger[_0xc89a('0x20')]('UpdateOpenchannelInteraction',_0x32b9ee,JSON[_0xc89a('0x13')](_0x21940e));_0xbeefd0(_0x21940e);})[_0xc89a('0x18')](function(_0x1d9ea5){logger[_0xc89a('0x14')]('UpdateOpenchannelInteraction',_0x1d9ea5[_0xc89a('0x16')],_0x32b9ee);_0x106767(_0x1cd583[_0xc89a('0x14')](0x1f4,_0x1d9ea5[_0xc89a('0x16')]));});});};exports[_0xc89a('0x21')]=function(_0x5a2e26){return new Promise(function(_0x112701,_0x3a02d9){return db[_0xc89a('0x22')][_0xc89a('0x23')]({'where':_0x5a2e26[_0xc89a('0x1c')]?_0x5a2e26[_0xc89a('0x1c')][_0xc89a('0x24')]||null:null})[_0xc89a('0xf')](function(_0x6bd449){if(_0x6bd449){return _0x6bd449[_0xc89a('0x25')](_0x5a2e26[_0xc89a('0x1b')][_0xc89a('0x26')],_[_0xc89a('0x27')](_0x5a2e26[_0xc89a('0x1b')],[_0xc89a('0x26'),'id'])||{});}})['spread'](function(_0x24efd0){logger['info'](_0xc89a('0x28'),_0x5a2e26);logger['debug'](_0xc89a('0x28'),_0x5a2e26,JSON[_0xc89a('0x13')](_0x24efd0));_0x112701(_0x24efd0);})[_0xc89a('0x18')](function(_0x2b0fc1){logger[_0xc89a('0x14')](_0xc89a('0x28'),_0x2b0fc1[_0xc89a('0x16')],_0x5a2e26);_0x3a02d9(_this[_0xc89a('0x14')](0x1f4,_0x2b0fc1[_0xc89a('0x16')]));});});}; \ No newline at end of file +var _0x214f=['defaults','localhost','socket.io-emitter','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','debug','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x214f,0x6f));var _0xf214=function(_0x2a911f,_0x79ee44){_0x2a911f=_0x2a911f-0x0;var _0x4eafde=_0x214f[_0x2a911f];return _0x4eafde;};'use strict';var _=require('lodash');var util=require(_0xf214('0x0'));var moment=require(_0xf214('0x1'));var BPromise=require(_0xf214('0x2'));var rs=require(_0xf214('0x3'));var fs=require('fs');var Redis=require(_0xf214('0x4'));var db=require(_0xf214('0x5'))['db'];var utils=require(_0xf214('0x6'));var logger=require(_0xf214('0x7'))(_0xf214('0x8'));var config=require('../../config/environment');var jayson=require(_0xf214('0x9'));var client=jayson['client'][_0xf214('0xa')]({'port':0x232a});config[_0xf214('0xb')]=_[_0xf214('0xc')](config['redis'],{'host':_0xf214('0xd'),'port':0x18eb});var socket=require(_0xf214('0xe'))(new Redis(config[_0xf214('0xb')]));require('./openchannelInteraction.socket')[_0xf214('0xf')](socket);function respondWithRpcPromise(_0x1a8cbe,_0x129627,_0x5960f2){return new BPromise(function(_0x63f600,_0x4fc071){return client['request'](_0x1a8cbe,_0x5960f2)[_0xf214('0x10')](function(_0x1ce233){logger[_0xf214('0x11')](_0xf214('0x12'),_0x129627,_0xf214('0x13'));logger['debug'](_0xf214('0x14'),_0x129627,_0xf214('0x13'),JSON[_0xf214('0x15')](_0x1ce233));if(_0x1ce233['error']){if(_0x1ce233['error'][_0xf214('0x16')]===0x1f4){logger[_0xf214('0x17')](_0xf214('0x12'),_0x129627,_0x1ce233[_0xf214('0x17')][_0xf214('0x18')]);return _0x4fc071(_0x1ce233[_0xf214('0x17')][_0xf214('0x18')]);}logger[_0xf214('0x17')](_0xf214('0x12'),_0x129627,_0x1ce233['error'][_0xf214('0x18')]);return _0x63f600(_0x1ce233[_0xf214('0x17')][_0xf214('0x18')]);}else{logger[_0xf214('0x11')](_0xf214('0x12'),_0x129627,'request\x20sent');_0x63f600(_0x1ce233[_0xf214('0x19')]['message']);}})[_0xf214('0x1a')](function(_0x5834d4){logger[_0xf214('0x17')](_0xf214('0x12'),_0x129627,_0x5834d4);_0x4fc071(_0x5834d4);});});}exports[_0xf214('0x1b')]=function(_0x193b5d){var _0x56b2f9=this;return new Promise(function(_0x4ce6a1,_0x16a30c){return db[_0xf214('0x1c')]['update'](_0x193b5d[_0xf214('0x1d')],{'raw':_0x193b5d[_0xf214('0x1e')]?_0x193b5d[_0xf214('0x1e')][_0xf214('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x193b5d[_0xf214('0x1e')]?_0x193b5d[_0xf214('0x1e')][_0xf214('0x20')]||null:null,'attributes':_0x193b5d[_0xf214('0x1e')]?_0x193b5d['options']['attributes']||null:null,'limit':_0x193b5d[_0xf214('0x1e')]?_0x193b5d[_0xf214('0x1e')]['limit']||null:null})[_0xf214('0x10')](function(_0x2b476e){logger[_0xf214('0x11')]('UpdateOpenchannelInteraction',_0x193b5d);logger[_0xf214('0x21')](_0xf214('0x1b'),_0x193b5d,JSON[_0xf214('0x15')](_0x2b476e));_0x4ce6a1(_0x2b476e);})[_0xf214('0x1a')](function(_0x31d56c){logger[_0xf214('0x17')]('UpdateOpenchannelInteraction',_0x31d56c[_0xf214('0x18')],_0x193b5d);_0x16a30c(_0x56b2f9[_0xf214('0x17')](0x1f4,_0x31d56c[_0xf214('0x18')]));});});};exports[_0xf214('0x22')]=function(_0x1d4f1f){return new Promise(function(_0x416b2c,_0x2f3c2c){return db[_0xf214('0x1c')][_0xf214('0x23')]({'where':_0x1d4f1f[_0xf214('0x1e')]?_0x1d4f1f['options'][_0xf214('0x20')]||null:null})[_0xf214('0x10')](function(_0x174413){if(_0x174413){return _0x174413[_0xf214('0x24')](_0x1d4f1f[_0xf214('0x1d')][_0xf214('0x25')],_[_0xf214('0x26')](_0x1d4f1f[_0xf214('0x1d')],[_0xf214('0x25'),'id'])||{});}})[_0xf214('0x27')](function(_0x5d0fbd){logger[_0xf214('0x11')](_0xf214('0x28'),_0x1d4f1f);logger[_0xf214('0x21')](_0xf214('0x28'),_0x1d4f1f,JSON['stringify'](_0x5d0fbd));_0x416b2c(_0x5d0fbd);})[_0xf214('0x1a')](function(_0x1e357c){logger[_0xf214('0x17')]('AddTags',_0x1e357c['message'],_0x1d4f1f);_0x2f3c2c(_this['error'](0x1f4,_0x1e357c[_0xf214('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 8c0fcbe..f9b251f 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 _0x6561=['emit','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x520a3f,_0x57eba7){var _0x189b9e=function(_0x43c8c2){while(--_0x43c8c2){_0x520a3f['push'](_0x520a3f['shift']());}};_0x189b9e(++_0x57eba7);}(_0x6561,0x10e));var _0x1656=function(_0x11f249,_0x4ca4a8){_0x11f249=_0x11f249-0x0;var _0x5c3656=_0x6561[_0x11f249];return _0x5c3656;};'use strict';var OpenchannelInteractionEvents=require(_0x1656('0x0'));var events=[_0x1656('0x1'),_0x1656('0x2'),'update'];function createListener(_0x3d2a71,_0x18fd6e){return function(_0x24426f){_0x18fd6e[_0x1656('0x3')](_0x3d2a71,_0x24426f);};}function removeListener(_0x1f3b0b,_0x35c4f0){return function(){OpenchannelInteractionEvents['removeListener'](_0x1f3b0b,_0x35c4f0);};}exports[_0x1656('0x4')]=function(_0x1372d0){for(var _0x449177=0x0,_0x1b8e8e=events[_0x1656('0x5')];_0x449177<_0x1b8e8e;_0x449177++){var _0x4b4512=events[_0x449177];var _0x5f3a5d=createListener(_0x1656('0x6')+_0x4b4512,_0x1372d0);OpenchannelInteractionEvents['on'](_0x4b4512,_0x5f3a5d);}}; \ No newline at end of file +var _0x133a=['remove','emit','removeListener','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x36e08b,_0x5106a2){var _0x1f27cd=function(_0x1d4b5e){while(--_0x1d4b5e){_0x36e08b['push'](_0x36e08b['shift']());}};_0x1f27cd(++_0x5106a2);}(_0x133a,0x124));var _0xa133=function(_0x50f112,_0xd38e53){_0x50f112=_0x50f112-0x0;var _0x4ecf28=_0x133a[_0x50f112];return _0x4ecf28;};'use strict';var OpenchannelInteractionEvents=require(_0xa133('0x0'));var events=[_0xa133('0x1'),_0xa133('0x2'),'update'];function createListener(_0xf4bd3,_0x296775){return function(_0x1abcb1){_0x296775[_0xa133('0x3')](_0xf4bd3,_0x1abcb1);};}function removeListener(_0x52728b,_0x4f299d){return function(){OpenchannelInteractionEvents[_0xa133('0x4')](_0x52728b,_0x4f299d);};}exports['register']=function(_0x3d06c1){for(var _0x31691a=0x0,_0x269d42=events[_0xa133('0x5')];_0x31691a<_0x269d42;_0x31691a++){var _0x3df97c=events[_0x31691a];var _0x15344c=createListener(_0xa133('0x6')+_0x3df97c,_0x3d06c1);OpenchannelInteractionEvents['on'](_0x3df97c,_0x15344c);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index be397c3..6f2f70b 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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x10807e,_0x2bba67){var _0xa69618=function(_0xd0c9e2){while(--_0xd0c9e2){_0x10807e['push'](_0x10807e['shift']());}};_0xa69618(++_0x2bba67);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file +var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 35566f7..e6d16a7 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 _0x4899=['ENUM','out','DATE','STRING','sequelize','TEXT','BOOLEAN'];(function(_0x2f7e06,_0x391dd8){var _0x50c81a=function(_0x4ac464){while(--_0x4ac464){_0x2f7e06['push'](_0x2f7e06['shift']());}};_0x50c81a(++_0x391dd8);}(_0x4899,0x74));var _0x9489=function(_0x3f50e2,_0x59e6ed){_0x3f50e2=_0x3f50e2-0x0;var _0x109a55=_0x4899[_0x3f50e2];return _0x109a55;};'use strict';var Sequelize=require(_0x9489('0x0'));module['exports']={'body':{'type':Sequelize[_0x9489('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9489('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9489('0x3')]('in',_0x9489('0x4')),'defaultValue':_0x9489('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9489('0x5')]},'providerName':{'type':Sequelize[_0x9489('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x56c8=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x2ef779,_0x11045f){var _0x450af9=function(_0x101cac){while(--_0x101cac){_0x2ef779['push'](_0x2ef779['shift']());}};_0x450af9(++_0x11045f);}(_0x56c8,0x12f));var _0x856c=function(_0x228a9a,_0x181707){_0x228a9a=_0x228a9a-0x0;var _0x52075c=_0x56c8[_0x228a9a];return _0x52075c;};'use strict';var Sequelize=require(_0x856c('0x0'));module[_0x856c('0x1')]={'body':{'type':Sequelize[_0x856c('0x2')](_0x856c('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x856c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x856c('0x5')]('in',_0x856c('0x6')),'defaultValue':_0x856c('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x856c('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x856c('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 3aaa732..6124f5b 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 _0xc9aa=['options','includeAll','include','findAll','params','find','create','body','describe','openchannel-interactions','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','internal','manual','interface','channel','event','accept','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT','email','SIP/%s','motionChannel','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\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','save','update','name','map','OpenchannelMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x2f8255,_0x44ff85){var _0x2207f6=function(_0x30c5c2){while(--_0x30c5c2){_0x2f8255['push'](_0x2f8255['shift']());}};_0x2207f6(++_0x44ff85);}(_0xc9aa,0x12c));var _0xac9a=function(_0x813d0a,_0x4fd3d7){_0x813d0a=_0x813d0a-0x0;var _0x241352=_0xc9aa[_0x813d0a];return _0x241352;};'use strict';var emlformat=require(_0xac9a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac9a('0x1'));var jsonpatch=require(_0xac9a('0x2'));var rp=require(_0xac9a('0x3'));var moment=require(_0xac9a('0x4'));var BPromise=require(_0xac9a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xac9a('0x6'));var csv=require(_0xac9a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac9a('0x8'));var _=require(_0xac9a('0x9'));var squel=require(_0xac9a('0xa'));var crypto=require(_0xac9a('0xb'));var jsforce=require(_0xac9a('0xc'));var deskjs=require(_0xac9a('0xd'));var toCsv=require(_0xac9a('0x7'));var querystring=require('querystring');var Papa=require(_0xac9a('0xe'));var Redis=require(_0xac9a('0xf'));var authService=require(_0xac9a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac9a('0x11'));var logger=require(_0xac9a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xac9a('0x13'));var licenseUtil=require(_0xac9a('0x14'));var db=require(_0xac9a('0x15'))['db'];config[_0xac9a('0x16')]=_['defaults'](config[_0xac9a('0x16')],{'host':_0xac9a('0x17'),'port':0x18eb});var socket=require(_0xac9a('0x18'))(new Redis(config['redis']));require(_0xac9a('0x19'))[_0xac9a('0x1a')](socket);var jayson=require(_0xac9a('0x1b'));var client=jayson['client'][_0xac9a('0x1c')]({'port':0x232c});var client9002=jayson[_0xac9a('0x1d')][_0xac9a('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d736d,_0x539fa0,_0x1d849a,_0x4d0961){return new BPromise(function(_0x438530,_0x220665){var _0x31aff2=_0x4d0961||client;return _0x31aff2['request'](_0x5d736d,_0x1d849a)[_0xac9a('0x1e')](function(_0x4f2259){logger['info'](_0xac9a('0x1f'),_0x539fa0,_0xac9a('0x20'));logger[_0xac9a('0x21')](_0xac9a('0x22'),_0x539fa0,_0xac9a('0x20'),JSON[_0xac9a('0x23')](_0x4f2259));if(_0x4f2259['error']){if(_0x4f2259[_0xac9a('0x24')][_0xac9a('0x25')]===0x1f4){logger['error'](_0xac9a('0x1f'),_0x539fa0,_0x4f2259[_0xac9a('0x24')][_0xac9a('0x26')]);return _0x220665(_0x4f2259[_0xac9a('0x24')][_0xac9a('0x26')]);}logger[_0xac9a('0x24')](_0xac9a('0x1f'),_0x539fa0,_0x4f2259[_0xac9a('0x24')]['message']);return _0x438530(_0x4f2259['error']['message']);}else{logger[_0xac9a('0x27')](_0xac9a('0x1f'),_0x539fa0,_0xac9a('0x20'));_0x438530(_0x4f2259[_0xac9a('0x28')]['message']);}})[_0xac9a('0x29')](function(_0x352839){logger[_0xac9a('0x24')](_0xac9a('0x1f'),_0x539fa0,_0x352839);_0x220665(_0x352839);});});}function respondWithStatusCode(_0x4ad8f2,_0xd2dcc4){_0xd2dcc4=_0xd2dcc4||0xcc;return function(_0x4a8ad7){if(_0x4a8ad7){return _0x4ad8f2[_0xac9a('0x2a')](_0xd2dcc4);}return _0x4ad8f2[_0xac9a('0x2b')](_0xd2dcc4)[_0xac9a('0x2c')]();};}function respondWithResult(_0x37daae,_0xbb8c5c){_0xbb8c5c=_0xbb8c5c||0xc8;return function(_0xe791b4){if(_0xe791b4){return _0x37daae[_0xac9a('0x2b')](_0xbb8c5c)[_0xac9a('0x2d')](_0xe791b4);}};}function respondWithFilteredResult(_0x36a0c3,_0x64ff8e){return function(_0x4b3a0c){if(_0x4b3a0c){var _0x49d00b=typeof _0x64ff8e[_0xac9a('0x2e')]===_0xac9a('0x2f')&&typeof _0x64ff8e['limit']==='undefined';var _0x3a6ac=_0x4b3a0c[_0xac9a('0x30')];var _0x158d68=_0x49d00b?0x0:_0x64ff8e[_0xac9a('0x2e')];var _0x46626e=_0x49d00b?_0x4b3a0c['count']:_0x64ff8e[_0xac9a('0x2e')]+_0x64ff8e[_0xac9a('0x31')];var _0x56c8fc;if(_0x46626e>=_0x3a6ac){_0x46626e=_0x3a6ac;_0x56c8fc=0xc8;}else{_0x56c8fc=0xce;}_0x36a0c3[_0xac9a('0x2b')](_0x56c8fc);return _0x36a0c3[_0xac9a('0x32')](_0xac9a('0x33'),_0x158d68+'-'+_0x46626e+'/'+_0x3a6ac)[_0xac9a('0x2d')](_0x4b3a0c);}return null;};}function patchUpdates(_0x4fa8c8){return function(_0x1aed83){try{jsonpatch[_0xac9a('0x34')](_0x1aed83,_0x4fa8c8,!![]);}catch(_0x2f26b2){return BPromise[_0xac9a('0x35')](_0x2f26b2);}return _0x1aed83[_0xac9a('0x36')]();};}function saveUpdates(_0xe01e40,_0x2df00a){return function(_0x1aaddb){if(_0x1aaddb){return _0x1aaddb[_0xac9a('0x37')](_0xe01e40)['then'](function(_0x488ef3){return _0x488ef3;});}return null;};}function removeEntity(_0x54e88d,_0x249685){return function(_0x3bd1ef){if(_0x3bd1ef){return _0x3bd1ef['destroy']()[_0xac9a('0x1e')](function(){_0x54e88d[_0xac9a('0x2b')](0xcc)[_0xac9a('0x2c')]();});}};}function handleEntityNotFound(_0x3172ca,_0x3d3bfd){return function(_0x22da68){if(!_0x22da68){_0x3172ca['sendStatus'](0x194);}return _0x22da68;};}function handleError(_0x5679a0,_0x1e05d4){_0x1e05d4=_0x1e05d4||0x1f4;return function(_0x4818e6){logger[_0xac9a('0x24')](_0x4818e6['stack']);if(_0x4818e6[_0xac9a('0x38')]){delete _0x4818e6[_0xac9a('0x38')];}_0x5679a0[_0xac9a('0x2b')](_0x1e05d4)['send'](_0x4818e6);};}exports['index']=function(_0x33b4b2,_0x48ee89){var _0x5d8518={},_0x189e7c={},_0x2fed0f={'count':0x0,'rows':[]};var _0x4260a2=_[_0xac9a('0x39')](db[_0xac9a('0x3a')][_0xac9a('0x3b')],function(_0x48242c){return{'name':_0x48242c[_0xac9a('0x3c')],'type':_0x48242c['type'][_0xac9a('0x3d')]};});_0x189e7c[_0xac9a('0x3e')]=_[_0xac9a('0x39')](_0x4260a2,_0xac9a('0x38'));_0x189e7c[_0xac9a('0x3f')]=_[_0xac9a('0x40')](_0x33b4b2[_0xac9a('0x3f')]);_0x189e7c[_0xac9a('0x41')]=_['intersection'](_0x189e7c[_0xac9a('0x3e')],_0x189e7c[_0xac9a('0x3f')]);_0x5d8518['attributes']=_[_0xac9a('0x42')](_0x189e7c[_0xac9a('0x3e')],qs[_0xac9a('0x43')](_0x33b4b2[_0xac9a('0x3f')][_0xac9a('0x43')]));_0x5d8518[_0xac9a('0x44')]=_0x5d8518[_0xac9a('0x44')][_0xac9a('0x45')]?_0x5d8518[_0xac9a('0x44')]:_0x189e7c['model'];if(!_0x33b4b2[_0xac9a('0x3f')]['hasOwnProperty'](_0xac9a('0x46'))){_0x5d8518[_0xac9a('0x31')]=qs[_0xac9a('0x31')](_0x33b4b2[_0xac9a('0x3f')][_0xac9a('0x31')]);_0x5d8518[_0xac9a('0x2e')]=qs['offset'](_0x33b4b2['query']['offset']);}_0x5d8518[_0xac9a('0x47')]=qs[_0xac9a('0x48')](_0x33b4b2[_0xac9a('0x3f')][_0xac9a('0x48')]);_0x5d8518[_0xac9a('0x49')]=qs[_0xac9a('0x41')](_[_0xac9a('0x4a')](_0x33b4b2[_0xac9a('0x3f')],_0x189e7c['filters']),_0x4260a2);if(_0x33b4b2[_0xac9a('0x3f')][_0xac9a('0x4b')]){_0x5d8518[_0xac9a('0x49')]=_[_0xac9a('0x4c')](_0x5d8518[_0xac9a('0x49')],{'$or':_['map'](_0x4260a2,function(_0x1246a7){if(_0x1246a7['type']!==_0xac9a('0x4d')){var _0x29f644={};_0x29f644[_0x1246a7[_0xac9a('0x38')]]={'$like':'%'+_0x33b4b2[_0xac9a('0x3f')][_0xac9a('0x4b')]+'%'};return _0x29f644;}})});}_0x5d8518=_[_0xac9a('0x4c')]({},_0x5d8518,_0x33b4b2[_0xac9a('0x4e')]);var _0x8e67af={'where':_0x5d8518['where']};return db[_0xac9a('0x3a')][_0xac9a('0x30')](_0x8e67af)['then'](function(_0x4ced54){_0x2fed0f[_0xac9a('0x30')]=_0x4ced54;if(_0x33b4b2['query'][_0xac9a('0x4f')]){_0x5d8518[_0xac9a('0x50')]=[{'all':!![]}];}return db[_0xac9a('0x3a')][_0xac9a('0x51')](_0x5d8518);})['then'](function(_0x4c3ad9){_0x2fed0f['rows']=_0x4c3ad9;return _0x2fed0f;})['then'](respondWithFilteredResult(_0x48ee89,_0x5d8518))['catch'](handleError(_0x48ee89,null));};exports['show']=function(_0x96bcf,_0x1071b9){var _0x5126f6={'raw':!![],'where':{'id':_0x96bcf[_0xac9a('0x52')]['id']}},_0x1238ac={};_0x1238ac['model']=_[_0xac9a('0x40')](db[_0xac9a('0x3a')][_0xac9a('0x3b')]);_0x1238ac[_0xac9a('0x3f')]=_[_0xac9a('0x40')](_0x96bcf[_0xac9a('0x3f')]);_0x1238ac[_0xac9a('0x41')]=_[_0xac9a('0x42')](_0x1238ac['model'],_0x1238ac[_0xac9a('0x3f')]);_0x5126f6[_0xac9a('0x44')]=_[_0xac9a('0x42')](_0x1238ac[_0xac9a('0x3e')],qs['fields'](_0x96bcf[_0xac9a('0x3f')][_0xac9a('0x43')]));_0x5126f6['attributes']=_0x5126f6['attributes'][_0xac9a('0x45')]?_0x5126f6[_0xac9a('0x44')]:_0x1238ac[_0xac9a('0x3e')];if(_0x96bcf['query'][_0xac9a('0x4f')]){_0x5126f6['include']=[{'all':!![]}];}_0x5126f6=_['merge']({},_0x5126f6,_0x96bcf[_0xac9a('0x4e')]);return db[_0xac9a('0x3a')][_0xac9a('0x53')](_0x5126f6)['then'](handleEntityNotFound(_0x1071b9,null))[_0xac9a('0x1e')](respondWithResult(_0x1071b9,null))[_0xac9a('0x29')](handleError(_0x1071b9,null));};exports[_0xac9a('0x54')]=function(_0x4d89df,_0x62fb8a){return db[_0xac9a('0x3a')][_0xac9a('0x54')](_0x4d89df['body'],{})[_0xac9a('0x1e')](respondWithResult(_0x62fb8a,0xc9))['catch'](handleError(_0x62fb8a,null));};exports[_0xac9a('0x37')]=function(_0x4c9167,_0x1f5c34){if(_0x4c9167[_0xac9a('0x55')]['id']){delete _0x4c9167[_0xac9a('0x55')]['id'];}return db['OpenchannelMessage'][_0xac9a('0x53')]({'where':{'id':_0x4c9167[_0xac9a('0x52')]['id']}})[_0xac9a('0x1e')](handleEntityNotFound(_0x1f5c34,null))[_0xac9a('0x1e')](saveUpdates(_0x4c9167[_0xac9a('0x55')],null))[_0xac9a('0x1e')](respondWithResult(_0x1f5c34,null))['catch'](handleError(_0x1f5c34,null));};exports['destroy']=function(_0x5935df,_0x491ee8){return db[_0xac9a('0x3a')][_0xac9a('0x53')]({'where':{'id':_0x5935df[_0xac9a('0x52')]['id']}})['then'](handleEntityNotFound(_0x491ee8,null))[_0xac9a('0x1e')](removeEntity(_0x491ee8,null))['catch'](handleError(_0x491ee8,null));};exports[_0xac9a('0x56')]=function(_0x5d1bcd,_0xbaa18c){return db[_0xac9a('0x3a')][_0xac9a('0x56')]()['then'](respondWithResult(_0xbaa18c,null))[_0xac9a('0x29')](handleError(_0xbaa18c,null));};var interaction_log=require(_0xac9a('0x12'))(_0xac9a('0x57'));exports['accept']=function(_0x50eb96,_0x55fc82,_0x519a95){var _0x1259c5={'agent':{},'channel':'openchannel'};if(_0x50eb96[_0xac9a('0x55')]['id']){delete _0x50eb96[_0xac9a('0x55')]['id'];}_0x50eb96[_0xac9a('0x55')]['read']=!![];_0x50eb96[_0xac9a('0x55')][_0xac9a('0x58')]=moment()[_0xac9a('0x59')](_0xac9a('0x5a'));_0x50eb96['body'][_0xac9a('0x5b')]=_0x50eb96[_0xac9a('0x55')][_0xac9a('0x5b')]||_0x50eb96[_0xac9a('0x5c')]['id'];_0x1259c5[_0xac9a('0x5d')]['id']=_0x50eb96[_0xac9a('0x55')][_0xac9a('0x5b')];return db['OpenchannelMessage'][_0xac9a('0x53')]({'where':{'id':_0x50eb96['params']['id'],'UserId':null}})[_0xac9a('0x1e')](handleEntityNotFound(_0x55fc82,null))[_0xac9a('0x1e')](saveUpdates(_0x50eb96[_0xac9a('0x55')],null))[_0xac9a('0x1e')](function(_0x33462d){if(_0x33462d){_0x1259c5[_0xac9a('0x26')]=_0x33462d[_0xac9a('0x5e')]({'plain':!![]});return db[_0xac9a('0x5f')][_0xac9a('0x53')]({'where':{'id':_0x33462d[_0xac9a('0x60')]}});}return null;})[_0xac9a('0x1e')](handleEntityNotFound(_0x55fc82,null))[_0xac9a('0x1e')](function(_0x23167d){if(_0x23167d){return _0x23167d[_0xac9a('0x37')]({'UserId':_0x50eb96[_0xac9a('0x55')][_0xac9a('0x5b')],'read1stAt':_[_0xac9a('0x61')](_0x23167d['read1stAt'])?moment()[_0xac9a('0x59')](_0xac9a('0x5a')):undefined});}return null;})[_0xac9a('0x1e')](function(_0x166ec6){if(_0x166ec6){_0x1259c5[_0xac9a('0x62')]=_0x166ec6['get']({'plain':!![]});interaction_log[_0xac9a('0x27')](_0xac9a('0x63'),_0x50eb96['user']['id'],_0x50eb96[_0xac9a('0x5c')]['name'],_0x50eb96[_0xac9a('0x5c')][_0xac9a('0x64')],_0x1259c5[_0xac9a('0x62')]['id'],_0x50eb96['body']?JSON['stringify'](_0x50eb96[_0xac9a('0x55')]):_0xac9a('0x65'));return respondWithRpcPromise(_0xac9a('0x66'),_0xac9a('0x67'),_0x1259c5);}return null;})[_0xac9a('0x1e')](function(_0x5414fb){var _0x135514=_0xac9a('0x68')+_0x5414fb[_0xac9a('0x26')][_0xac9a('0x69')];return db[_0xac9a('0x6a')]['query'](_0x135514,{'type':db[_0xac9a('0x6b')][_0xac9a('0x6c')]['SELECT'],'raw':!![]})[_0xac9a('0x1e')](function(_0x486cc3){return _0x486cc3;});})['then'](function(_0x5b6cc1){if(_0x5b6cc1){_0x1259c5['message'][_0xac9a('0x6d')]=_0x5b6cc1[0x0];if(!_0x50eb96[_0xac9a('0x55')][_0xac9a('0x5b')])return;return db[_0xac9a('0x6e')][_0xac9a('0x53')]({'where':{'id':_0x50eb96['body'][_0xac9a('0x5b')],'role':_0xac9a('0x5d')},'attributes':['id','name',_0xac9a('0x6f'),'email',_0xac9a('0x70')],'raw':!![]});}return null;})[_0xac9a('0x1e')](function(_0x523aa0){if(!_0x523aa0)return null;_0x1259c5['message'][_0xac9a('0x5d')]=_0x523aa0;return _0x1259c5;})['then'](function(_0x4951c2){if(_0x4951c2){if(_0x50eb96['body'][_0xac9a('0x71')]){_0x1259c5[_0xac9a('0x26')][_0xac9a('0x72')]=util[_0xac9a('0x59')]('SIP/%s',_0x50eb96[_0xac9a('0x5c')]['name']);_0x1259c5[_0xac9a('0x26')][_0xac9a('0x73')]=_0x1259c5[_0xac9a('0x73')];_0x1259c5[_0xac9a('0x26')]['motionChannel']=_0x1259c5[_0xac9a('0x73')];_0x1259c5[_0xac9a('0x26')][_0xac9a('0x74')]=_0xac9a('0x75');return respondWithRpcPromise(_0xac9a('0x76'),_0xac9a('0x76'),{'event':'acceptmessage','message':_0x1259c5[_0xac9a('0x26')]},client9002)[_0xac9a('0x1e')](function(){return _0x1259c5;});}return _0x1259c5;}return null;})[_0xac9a('0x1e')](respondWithResult(_0x55fc82,null))[_0xac9a('0x29')](handleError(_0x55fc82,null));};var interaction_log=require(_0xac9a('0x12'))(_0xac9a('0x57'));exports['reject']=function(_0xe09fcb,_0x4631d4,_0x400845){var _0x537ce1={'agent':{},'channel':'openchannel'};if(_0xe09fcb[_0xac9a('0x55')]['id']){delete _0xe09fcb['body']['id'];}_0xe09fcb['body'][_0xac9a('0x5b')]=_0xe09fcb[_0xac9a('0x55')][_0xac9a('0x5b')]||_0xe09fcb[_0xac9a('0x5c')]['id'];_0x537ce1[_0xac9a('0x5d')]['id']=_0xe09fcb['body'][_0xac9a('0x5b')];return db['OpenchannelMessage'][_0xac9a('0x53')]({'where':{'id':_0xe09fcb[_0xac9a('0x52')]['id'],'UserId':null}})[_0xac9a('0x1e')](handleEntityNotFound(_0x4631d4,null))[_0xac9a('0x1e')](function(_0x3dce62){if(_0x3dce62){_0x537ce1[_0xac9a('0x26')]=_0x3dce62[_0xac9a('0x5e')]({'plain':!![]});return db['OpenchannelInteraction'][_0xac9a('0x53')]({'where':{'id':_0x3dce62['OpenchannelInteractionId']}});}return null;})[_0xac9a('0x1e')](handleEntityNotFound(_0x4631d4,null))[_0xac9a('0x1e')](function(_0x24391c){if(_0x24391c){_0x537ce1[_0xac9a('0x62')]=_0x24391c[_0xac9a('0x5e')]({'plain':!![]});interaction_log[_0xac9a('0x27')](_0xac9a('0x77'),_0xe09fcb[_0xac9a('0x5c')]['id'],_0xe09fcb[_0xac9a('0x5c')]['name'],_0xe09fcb[_0xac9a('0x5c')]['role'],_0x537ce1[_0xac9a('0x62')]['id'],_0xe09fcb['body']?JSON['stringify'](_0xe09fcb[_0xac9a('0x55')]):_0xac9a('0x65'));return respondWithRpcPromise('RejectMessage',_0xac9a('0x78'),_0x537ce1);}return null;})[_0xac9a('0x1e')](function(_0x350fa7){var _0x20decf=_0xac9a('0x68')+_0x350fa7[_0xac9a('0x26')][_0xac9a('0x69')];return db[_0xac9a('0x6a')][_0xac9a('0x3f')](_0x20decf,{'type':db[_0xac9a('0x6b')][_0xac9a('0x6c')][_0xac9a('0x79')],'raw':!![]})[_0xac9a('0x1e')](function(_0x49bae2){return _0x49bae2;});})[_0xac9a('0x1e')](function(_0x435d49){if(_0x435d49){_0x537ce1['message'][_0xac9a('0x6d')]=_0x435d49[0x0];if(!_0xe09fcb[_0xac9a('0x55')][_0xac9a('0x5b')])return;return db[_0xac9a('0x6e')][_0xac9a('0x53')]({'where':{'id':_0xe09fcb[_0xac9a('0x55')]['UserId'],'role':_0xac9a('0x5d')},'attributes':['id','name',_0xac9a('0x6f'),_0xac9a('0x7a'),_0xac9a('0x70')],'raw':!![]});}return null;})[_0xac9a('0x1e')](function(_0x1fa92d){if(!_0x1fa92d)return null;_0x537ce1[_0xac9a('0x26')]['agent']=_0x1fa92d;return _0x537ce1;})['then'](function(_0x292028){if(_0x292028){_0x292028[_0xac9a('0x26')][_0xac9a('0x72')]=util[_0xac9a('0x59')](_0xac9a('0x7b'),_0xe09fcb[_0xac9a('0x5c')]['name']);_0x292028['message'][_0xac9a('0x73')]=_0x537ce1[_0xac9a('0x73')];_0x292028[_0xac9a('0x26')][_0xac9a('0x7c')]=_0x537ce1[_0xac9a('0x73')];_0x292028['message'][_0xac9a('0x74')]=_0xac9a('0x35');respondWithRpcPromise('EventManager',_0xac9a('0x76'),{'event':_0xac9a('0x7d'),'message':_0x292028[_0xac9a('0x26')]},client9002);return _0x537ce1;}return null;})[_0xac9a('0x1e')](respondWithResult(_0x4631d4,null))['catch'](handleError(_0x4631d4,null));}; \ No newline at end of file +var _0xe085=['jayson/promise','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','OpenchannelMessage','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','destroy','describe','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','agent','UserId','OpenchannelInteraction','OpenchannelInteractionId','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','openchannel-interactions','get','RejectMessage','rejectMessage','User','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register'];(function(_0x2f160e,_0x2d51c2){var _0x41a1c7=function(_0x336197){while(--_0x336197){_0x2f160e['push'](_0x2f160e['shift']());}};_0x41a1c7(++_0x2d51c2);}(_0xe085,0x16a));var _0x5e08=function(_0x123f55,_0x413c16){_0x123f55=_0x123f55-0x0;var _0x5517d9=_0xe085[_0x123f55];return _0x5517d9;};'use strict';var emlformat=require(_0x5e08('0x0'));var rimraf=require(_0x5e08('0x1'));var zipdir=require(_0x5e08('0x2'));var jsonpatch=require(_0x5e08('0x3'));var rp=require('request-promise');var moment=require(_0x5e08('0x4'));var BPromise=require(_0x5e08('0x5'));var Mustache=require(_0x5e08('0x6'));var util=require(_0x5e08('0x7'));var path=require('path');var sox=require(_0x5e08('0x8'));var csv=require(_0x5e08('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e08('0xa'));var _=require('lodash');var squel=require(_0x5e08('0xb'));var crypto=require(_0x5e08('0xc'));var jsforce=require(_0x5e08('0xd'));var deskjs=require(_0x5e08('0xe'));var toCsv=require(_0x5e08('0x9'));var querystring=require('querystring');var Papa=require(_0x5e08('0xf'));var Redis=require(_0x5e08('0x10'));var authService=require(_0x5e08('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5e08('0x12'));var hardwareService=require(_0x5e08('0x13'));var logger=require(_0x5e08('0x14'))(_0x5e08('0x15'));var utils=require(_0x5e08('0x16'));var config=require(_0x5e08('0x17'));var licenseUtil=require(_0x5e08('0x18'));var db=require('../../mysqldb')['db'];config[_0x5e08('0x19')]=_[_0x5e08('0x1a')](config[_0x5e08('0x19')],{'host':_0x5e08('0x1b'),'port':0x18eb});var socket=require(_0x5e08('0x1c'))(new Redis(config[_0x5e08('0x19')]));require(_0x5e08('0x1d'))[_0x5e08('0x1e')](socket);var jayson=require(_0x5e08('0x1f'));var client=jayson['client'][_0x5e08('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44cc01,_0x461500,_0x1c1b52,_0x3f6c97){return new BPromise(function(_0x479173,_0x252843){var _0x5277ec=_0x3f6c97||client;return _0x5277ec[_0x5e08('0x21')](_0x44cc01,_0x1c1b52)['then'](function(_0x850d47){logger[_0x5e08('0x22')](_0x5e08('0x23'),_0x461500,_0x5e08('0x24'));logger[_0x5e08('0x25')](_0x5e08('0x26'),_0x461500,_0x5e08('0x24'),JSON[_0x5e08('0x27')](_0x850d47));if(_0x850d47[_0x5e08('0x28')]){if(_0x850d47['error'][_0x5e08('0x29')]===0x1f4){logger[_0x5e08('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x461500,_0x850d47['error'][_0x5e08('0x2a')]);return _0x252843(_0x850d47[_0x5e08('0x28')][_0x5e08('0x2a')]);}logger[_0x5e08('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x461500,_0x850d47['error'][_0x5e08('0x2a')]);return _0x479173(_0x850d47[_0x5e08('0x28')][_0x5e08('0x2a')]);}else{logger['info'](_0x5e08('0x23'),_0x461500,'request\x20sent');_0x479173(_0x850d47[_0x5e08('0x2b')][_0x5e08('0x2a')]);}})[_0x5e08('0x2c')](function(_0x2e9b3d){logger[_0x5e08('0x28')](_0x5e08('0x23'),_0x461500,_0x2e9b3d);_0x252843(_0x2e9b3d);});});}function respondWithStatusCode(_0x5c747e,_0x121464){_0x121464=_0x121464||0xcc;return function(_0x369c31){if(_0x369c31){return _0x5c747e['sendStatus'](_0x121464);}return _0x5c747e[_0x5e08('0x2d')](_0x121464)[_0x5e08('0x2e')]();};}function respondWithResult(_0x1c19a6,_0x14a88a){_0x14a88a=_0x14a88a||0xc8;return function(_0x27c44f){if(_0x27c44f){return _0x1c19a6[_0x5e08('0x2d')](_0x14a88a)[_0x5e08('0x2f')](_0x27c44f);}};}function respondWithFilteredResult(_0x4c383a,_0x2aea97){return function(_0x48eab8){if(_0x48eab8){var _0x266715=typeof _0x2aea97[_0x5e08('0x30')]===_0x5e08('0x31')&&typeof _0x2aea97[_0x5e08('0x32')]===_0x5e08('0x31');var _0x1eb7bd=_0x48eab8[_0x5e08('0x33')];var _0x126dc7=_0x266715?0x0:_0x2aea97[_0x5e08('0x30')];var _0x52d82f=_0x266715?_0x48eab8[_0x5e08('0x33')]:_0x2aea97['offset']+_0x2aea97[_0x5e08('0x32')];var _0x2cf4e1;if(_0x52d82f>=_0x1eb7bd){_0x52d82f=_0x1eb7bd;_0x2cf4e1=0xc8;}else{_0x2cf4e1=0xce;}_0x4c383a[_0x5e08('0x2d')](_0x2cf4e1);return _0x4c383a[_0x5e08('0x34')](_0x5e08('0x35'),_0x126dc7+'-'+_0x52d82f+'/'+_0x1eb7bd)[_0x5e08('0x2f')](_0x48eab8);}return null;};}function patchUpdates(_0x44f875){return function(_0x2f29c9){try{jsonpatch[_0x5e08('0x36')](_0x2f29c9,_0x44f875,!![]);}catch(_0x1bd678){return BPromise[_0x5e08('0x37')](_0x1bd678);}return _0x2f29c9[_0x5e08('0x38')]();};}function saveUpdates(_0x321ee9,_0x2e8f00){return function(_0x2f96b9){if(_0x2f96b9){return _0x2f96b9[_0x5e08('0x39')](_0x321ee9)['then'](function(_0x2e3dce){return _0x2e3dce;});}return null;};}function removeEntity(_0x8fca4e,_0x331845){return function(_0x2946a7){if(_0x2946a7){return _0x2946a7['destroy']()[_0x5e08('0x3a')](function(){_0x8fca4e[_0x5e08('0x2d')](0xcc)[_0x5e08('0x2e')]();});}};}function handleEntityNotFound(_0x3d3ca0,_0x173679){return function(_0x2853a8){if(!_0x2853a8){_0x3d3ca0['sendStatus'](0x194);}return _0x2853a8;};}function handleError(_0x5ab9ff,_0x445e1a){_0x445e1a=_0x445e1a||0x1f4;return function(_0x551509){logger['error'](_0x551509[_0x5e08('0x3b')]);if(_0x551509[_0x5e08('0x3c')]){delete _0x551509[_0x5e08('0x3c')];}_0x5ab9ff['status'](_0x445e1a)[_0x5e08('0x3d')](_0x551509);};}exports['index']=function(_0x3e7487,_0x3c3035){var _0x58182d={},_0x2dbf25={},_0x627dc8={'count':0x0,'rows':[]};var _0x3ba67d=_[_0x5e08('0x3e')](db[_0x5e08('0x3f')]['rawAttributes'],function(_0x26f835){return{'name':_0x26f835['fieldName'],'type':_0x26f835[_0x5e08('0x40')][_0x5e08('0x41')]};});_0x2dbf25['model']=_[_0x5e08('0x3e')](_0x3ba67d,_0x5e08('0x3c'));_0x2dbf25['query']=_['keys'](_0x3e7487[_0x5e08('0x42')]);_0x2dbf25['filters']=_[_0x5e08('0x43')](_0x2dbf25['model'],_0x2dbf25['query']);_0x58182d[_0x5e08('0x44')]=_[_0x5e08('0x43')](_0x2dbf25[_0x5e08('0x45')],qs[_0x5e08('0x46')](_0x3e7487[_0x5e08('0x42')][_0x5e08('0x46')]));_0x58182d['attributes']=_0x58182d[_0x5e08('0x44')][_0x5e08('0x47')]?_0x58182d[_0x5e08('0x44')]:_0x2dbf25[_0x5e08('0x45')];if(!_0x3e7487[_0x5e08('0x42')][_0x5e08('0x48')](_0x5e08('0x49'))){_0x58182d[_0x5e08('0x32')]=qs[_0x5e08('0x32')](_0x3e7487[_0x5e08('0x42')][_0x5e08('0x32')]);_0x58182d['offset']=qs['offset'](_0x3e7487['query']['offset']);}_0x58182d[_0x5e08('0x4a')]=qs[_0x5e08('0x4b')](_0x3e7487[_0x5e08('0x42')][_0x5e08('0x4b')]);_0x58182d[_0x5e08('0x4c')]=qs[_0x5e08('0x4d')](_[_0x5e08('0x4e')](_0x3e7487[_0x5e08('0x42')],_0x2dbf25[_0x5e08('0x4d')]),_0x3ba67d);if(_0x3e7487[_0x5e08('0x42')][_0x5e08('0x4f')]){_0x58182d['where']=_[_0x5e08('0x50')](_0x58182d['where'],{'$or':_[_0x5e08('0x3e')](_0x3ba67d,function(_0xd587c8){if(_0xd587c8[_0x5e08('0x40')]!=='VIRTUAL'){var _0x55c9db={};_0x55c9db[_0xd587c8[_0x5e08('0x3c')]]={'$like':'%'+_0x3e7487[_0x5e08('0x42')][_0x5e08('0x4f')]+'%'};return _0x55c9db;}})});}_0x58182d=_['merge']({},_0x58182d,_0x3e7487['options']);var _0x3f76b7={'where':_0x58182d[_0x5e08('0x4c')]};return db[_0x5e08('0x3f')][_0x5e08('0x33')](_0x3f76b7)[_0x5e08('0x3a')](function(_0x130386){_0x627dc8[_0x5e08('0x33')]=_0x130386;if(_0x3e7487['query'][_0x5e08('0x51')]){_0x58182d[_0x5e08('0x52')]=[{'all':!![]}];}return db[_0x5e08('0x3f')][_0x5e08('0x53')](_0x58182d);})[_0x5e08('0x3a')](function(_0x3fa5d1){_0x627dc8[_0x5e08('0x54')]=_0x3fa5d1;return _0x627dc8;})[_0x5e08('0x3a')](respondWithFilteredResult(_0x3c3035,_0x58182d))[_0x5e08('0x2c')](handleError(_0x3c3035,null));};exports[_0x5e08('0x55')]=function(_0x17e424,_0x28333e){var _0xbced42={'raw':!![],'where':{'id':_0x17e424[_0x5e08('0x56')]['id']}},_0x15387e={};_0x15387e[_0x5e08('0x45')]=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x15387e['query']=_[_0x5e08('0x57')](_0x17e424[_0x5e08('0x42')]);_0x15387e[_0x5e08('0x4d')]=_['intersection'](_0x15387e['model'],_0x15387e[_0x5e08('0x42')]);_0xbced42[_0x5e08('0x44')]=_[_0x5e08('0x43')](_0x15387e['model'],qs['fields'](_0x17e424[_0x5e08('0x42')]['fields']));_0xbced42[_0x5e08('0x44')]=_0xbced42['attributes'][_0x5e08('0x47')]?_0xbced42['attributes']:_0x15387e[_0x5e08('0x45')];if(_0x17e424[_0x5e08('0x42')][_0x5e08('0x51')]){_0xbced42['include']=[{'all':!![]}];}_0xbced42=_[_0x5e08('0x50')]({},_0xbced42,_0x17e424[_0x5e08('0x58')]);return db['OpenchannelMessage'][_0x5e08('0x59')](_0xbced42)['then'](handleEntityNotFound(_0x28333e,null))[_0x5e08('0x3a')](respondWithResult(_0x28333e,null))[_0x5e08('0x2c')](handleError(_0x28333e,null));};exports['create']=function(_0x1e53dc,_0x6605eb){return db['OpenchannelMessage'][_0x5e08('0x5a')](_0x1e53dc['body'],{})[_0x5e08('0x3a')](respondWithResult(_0x6605eb,0xc9))[_0x5e08('0x2c')](handleError(_0x6605eb,null));};exports[_0x5e08('0x39')]=function(_0x4a04b8,_0x34e38e){if(_0x4a04b8[_0x5e08('0x5b')]['id']){delete _0x4a04b8[_0x5e08('0x5b')]['id'];}return db['OpenchannelMessage'][_0x5e08('0x59')]({'where':{'id':_0x4a04b8['params']['id']}})[_0x5e08('0x3a')](handleEntityNotFound(_0x34e38e,null))['then'](saveUpdates(_0x4a04b8['body'],null))[_0x5e08('0x3a')](respondWithResult(_0x34e38e,null))[_0x5e08('0x2c')](handleError(_0x34e38e,null));};exports[_0x5e08('0x5c')]=function(_0x4bf009,_0x3558de){return db[_0x5e08('0x3f')][_0x5e08('0x59')]({'where':{'id':_0x4bf009[_0x5e08('0x56')]['id']}})['then'](handleEntityNotFound(_0x3558de,null))[_0x5e08('0x3a')](removeEntity(_0x3558de,null))[_0x5e08('0x2c')](handleError(_0x3558de,null));};exports[_0x5e08('0x5d')]=function(_0x1e3c3c,_0x4efee6){return db[_0x5e08('0x3f')][_0x5e08('0x5d')]()['then'](respondWithResult(_0x4efee6,null))['catch'](handleError(_0x4efee6,null));};var interaction_log=require(_0x5e08('0x14'))('openchannel-interactions');exports['accept']=function(_0x335a29,_0x445eac,_0x4c7beb){var _0x4658de={'agent':{},'channel':_0x5e08('0x5e')};if(_0x335a29[_0x5e08('0x5b')]['id']){delete _0x335a29[_0x5e08('0x5b')]['id'];}_0x335a29[_0x5e08('0x5b')]['read']=!![];_0x335a29[_0x5e08('0x5b')][_0x5e08('0x5f')]=moment()[_0x5e08('0x60')](_0x5e08('0x61'));_0x335a29[_0x5e08('0x5b')]['UserId']=_0x335a29[_0x5e08('0x5b')]['UserId']||_0x335a29['user']['id'];_0x4658de[_0x5e08('0x62')]['id']=_0x335a29[_0x5e08('0x5b')][_0x5e08('0x63')];return db[_0x5e08('0x3f')][_0x5e08('0x59')]({'where':{'id':_0x335a29[_0x5e08('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x445eac,null))[_0x5e08('0x3a')](saveUpdates(_0x335a29[_0x5e08('0x5b')],null))['then'](function(_0x48520d){if(_0x48520d){_0x4658de[_0x5e08('0x2a')]=_0x48520d['get']({'plain':!![]});return db[_0x5e08('0x64')][_0x5e08('0x59')]({'where':{'id':_0x48520d[_0x5e08('0x65')]}});}return null;})[_0x5e08('0x3a')](handleEntityNotFound(_0x445eac,null))['then'](function(_0x1fafb3){if(_0x1fafb3){return _0x1fafb3[_0x5e08('0x39')]({'UserId':_0x335a29['body'][_0x5e08('0x63')],'read1stAt':_['isNil'](_0x1fafb3['read1stAt'])?moment()[_0x5e08('0x60')](_0x5e08('0x61')):undefined});}return null;})[_0x5e08('0x3a')](function(_0xfba299){if(_0xfba299){_0x4658de[_0x5e08('0x66')]=_0xfba299['get']({'plain':!![]});interaction_log[_0x5e08('0x22')](_0x5e08('0x67'),_0x335a29[_0x5e08('0x68')]['id'],_0x335a29['user'][_0x5e08('0x3c')],_0x335a29['user'][_0x5e08('0x69')],_0x4658de[_0x5e08('0x66')]['id'],_0x335a29[_0x5e08('0x5b')]?JSON[_0x5e08('0x27')](_0x335a29[_0x5e08('0x5b')]):_0x5e08('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x5e08('0x6b'),_0x4658de);}return null;})[_0x5e08('0x3a')](function(_0x14ecb8){var _0x3939a9=_0x5e08('0x6c')+_0x14ecb8[_0x5e08('0x2a')][_0x5e08('0x6d')];return db[_0x5e08('0x6e')]['query'](_0x3939a9,{'type':db[_0x5e08('0x6f')][_0x5e08('0x70')][_0x5e08('0x71')],'raw':!![]})['then'](function(_0x44ebe4){return _0x44ebe4;});})['then'](function(_0x33e9fd){if(_0x33e9fd){_0x4658de['message'][_0x5e08('0x72')]=_0x33e9fd[0x0];if(!_0x335a29['body'][_0x5e08('0x63')])return;return db['User'][_0x5e08('0x59')]({'where':{'id':_0x335a29['body'][_0x5e08('0x63')],'role':'agent'},'attributes':['id',_0x5e08('0x3c'),_0x5e08('0x73'),_0x5e08('0x74'),_0x5e08('0x75')],'raw':!![]});}return null;})[_0x5e08('0x3a')](function(_0x4809e1){if(!_0x4809e1)return null;_0x4658de[_0x5e08('0x2a')]['agent']=_0x4809e1;return _0x4658de;})[_0x5e08('0x3a')](function(_0x4e0603){if(_0x4e0603){if(_0x335a29['body'][_0x5e08('0x76')]){_0x4658de[_0x5e08('0x2a')][_0x5e08('0x77')]=util['format'](_0x5e08('0x78'),_0x335a29['user']['name']);_0x4658de[_0x5e08('0x2a')]['channel']=_0x4658de[_0x5e08('0x79')];_0x4658de[_0x5e08('0x2a')][_0x5e08('0x7a')]=_0x4658de[_0x5e08('0x79')];_0x4658de[_0x5e08('0x2a')]['event']='accept';return respondWithRpcPromise('EventManager',_0x5e08('0x7b'),{'event':'acceptmessage','message':_0x4658de[_0x5e08('0x2a')]},client9002)[_0x5e08('0x3a')](function(){return _0x4658de;});}return _0x4658de;}return null;})[_0x5e08('0x3a')](respondWithResult(_0x445eac,null))[_0x5e08('0x2c')](handleError(_0x445eac,null));};var interaction_log=require(_0x5e08('0x14'))(_0x5e08('0x7c'));exports['reject']=function(_0x171120,_0x1279c5,_0x1cfd79){var _0x3a2fd7={'agent':{},'channel':_0x5e08('0x5e')};if(_0x171120['body']['id']){delete _0x171120[_0x5e08('0x5b')]['id'];}_0x171120['body'][_0x5e08('0x63')]=_0x171120['body']['UserId']||_0x171120[_0x5e08('0x68')]['id'];_0x3a2fd7[_0x5e08('0x62')]['id']=_0x171120[_0x5e08('0x5b')][_0x5e08('0x63')];return db[_0x5e08('0x3f')][_0x5e08('0x59')]({'where':{'id':_0x171120['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1279c5,null))[_0x5e08('0x3a')](function(_0x373c20){if(_0x373c20){_0x3a2fd7['message']=_0x373c20['get']({'plain':!![]});return db[_0x5e08('0x64')]['find']({'where':{'id':_0x373c20[_0x5e08('0x65')]}});}return null;})[_0x5e08('0x3a')](handleEntityNotFound(_0x1279c5,null))[_0x5e08('0x3a')](function(_0x1af26a){if(_0x1af26a){_0x3a2fd7[_0x5e08('0x66')]=_0x1af26a[_0x5e08('0x7d')]({'plain':!![]});interaction_log[_0x5e08('0x22')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x171120[_0x5e08('0x68')]['id'],_0x171120['user'][_0x5e08('0x3c')],_0x171120[_0x5e08('0x68')][_0x5e08('0x69')],_0x3a2fd7['interaction']['id'],_0x171120[_0x5e08('0x5b')]?JSON[_0x5e08('0x27')](_0x171120[_0x5e08('0x5b')]):'null');return respondWithRpcPromise(_0x5e08('0x7e'),_0x5e08('0x7f'),_0x3a2fd7);}return null;})[_0x5e08('0x3a')](function(_0x262056){var _0x6d70c6=_0x5e08('0x6c')+_0x262056[_0x5e08('0x2a')][_0x5e08('0x6d')];return db['sequelize'][_0x5e08('0x42')](_0x6d70c6,{'type':db[_0x5e08('0x6f')]['QueryTypes'][_0x5e08('0x71')],'raw':!![]})['then'](function(_0x132b83){return _0x132b83;});})['then'](function(_0x31b66d){if(_0x31b66d){_0x3a2fd7['message'][_0x5e08('0x72')]=_0x31b66d[0x0];if(!_0x171120['body'][_0x5e08('0x63')])return;return db[_0x5e08('0x80')]['find']({'where':{'id':_0x171120[_0x5e08('0x5b')]['UserId'],'role':_0x5e08('0x62')},'attributes':['id',_0x5e08('0x3c'),_0x5e08('0x73'),_0x5e08('0x74'),_0x5e08('0x75')],'raw':!![]});}return null;})[_0x5e08('0x3a')](function(_0x35e57f){if(!_0x35e57f)return null;_0x3a2fd7[_0x5e08('0x2a')]['agent']=_0x35e57f;return _0x3a2fd7;})['then'](function(_0x32e050){if(_0x32e050){_0x32e050['message'][_0x5e08('0x77')]=util[_0x5e08('0x60')](_0x5e08('0x78'),_0x171120[_0x5e08('0x68')][_0x5e08('0x3c')]);_0x32e050[_0x5e08('0x2a')][_0x5e08('0x79')]=_0x3a2fd7['channel'];_0x32e050[_0x5e08('0x2a')][_0x5e08('0x7a')]=_0x3a2fd7['channel'];_0x32e050[_0x5e08('0x2a')][_0x5e08('0x81')]=_0x5e08('0x37');respondWithRpcPromise(_0x5e08('0x7b'),_0x5e08('0x7b'),{'event':_0x5e08('0x82'),'message':_0x32e050[_0x5e08('0x2a')]},client9002);return _0x3a2fd7;}return null;})[_0x5e08('0x3a')](respondWithResult(_0x1279c5,null))[_0x5e08('0x2c')](handleError(_0x1279c5,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 3a2a6d8..232d449 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 _0x0d39=['exports','events','../../mysqldb','OpenchannelMessage','update','emit','hasOwnProperty'];(function(_0x1b9799,_0x23f56a){var _0x335fa1=function(_0x19786e){while(--_0x19786e){_0x1b9799['push'](_0x1b9799['shift']());}};_0x335fa1(++_0x23f56a);}(_0x0d39,0xef));var _0x90d3=function(_0x375b26,_0x3a243d){_0x375b26=_0x375b26-0x0;var _0x348359=_0x0d39[_0x375b26];return _0x348359;};'use strict';var EventEmitter=require(_0x90d3('0x0'));var OpenchannelMessage=require(_0x90d3('0x1'))['db'][_0x90d3('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x90d3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x12636e){return function(_0x14a80b,_0x333400,_0x204312){OpenchannelMessageEvents[_0x90d3('0x4')](_0x12636e+':'+_0x14a80b['id'],_0x14a80b);OpenchannelMessageEvents[_0x90d3('0x4')](_0x12636e,_0x14a80b);_0x204312(null);};}for(var e in events){if(events[_0x90d3('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x90d3('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x6486=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x6486,0x152));var _0x6648=function(_0x38ca2d,_0x32240f){_0x38ca2d=_0x38ca2d-0x0;var _0x3d8356=_0x6486[_0x38ca2d];return _0x3d8356;};'use strict';var EventEmitter=require(_0x6648('0x0'));var OpenchannelMessage=require(_0x6648('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x6648('0x2')](0x0);var events={'afterCreate':_0x6648('0x3'),'afterUpdate':_0x6648('0x4'),'afterDestroy':_0x6648('0x5')};function emitEvent(_0x2672d4){return function(_0xce666b,_0x208739,_0x48e427){OpenchannelMessageEvents[_0x6648('0x6')](_0x2672d4+':'+_0xce666b['id'],_0xce666b);OpenchannelMessageEvents[_0x6648('0x6')](_0x2672d4,_0xce666b);_0x48e427(null);};}for(var e in events){if(events[_0x6648('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x6648('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 082bc77..1112888 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 _0x6de5=['omit','Contact','POST','GET','body','info','format','threadId','Interaction','catch','inspect','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','error','describe','OpenchannelAccount','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri'];(function(_0x398a68,_0x48e6c5){var _0x821fd6=function(_0x2963b8){while(--_0x2963b8){_0x398a68['push'](_0x398a68['shift']());}};_0x821fd6(++_0x48e6c5);}(_0x6de5,0x13e));var _0x56de=function(_0x4b5b19,_0x57f2cd){_0x4b5b19=_0x4b5b19-0x0;var _0x4052ae=_0x6de5[_0x4b5b19];return _0x4052ae;};'use strict';var _=require(_0x56de('0x0'));var util=require(_0x56de('0x1'));var logger=require(_0x56de('0x2'))(_0x56de('0x3'));var moment=require(_0x56de('0x4'));var BPromise=require(_0x56de('0x5'));var rp=require(_0x56de('0x6'));var fs=require('fs');var path=require(_0x56de('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x56de('0x8'));module[_0x56de('0x9')]=function(_0x2ed1f9,_0x307d9e){return _0x2ed1f9[_0x56de('0xa')](_0x56de('0xb'),attributes,{'tableName':_0x56de('0xc'),'paranoid':![],'indexes':[{'name':_0x56de('0xd'),'fields':['body'],'type':_0x56de('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d8b1a,_0x503d1b,_0x24d793){var _0x10f7fa=_0x2ed1f9[_0x56de('0xf')];var _0x5b07=_0x4d8b1a[_0x56de('0x10')]({'plain':!![]});if(_0x5b07[_0x56de('0x11')][_0x56de('0x12')]()==='in'||_0x5b07[_0x56de('0x11')][_0x56de('0x12')]()===_0x56de('0x13')&&!_0x5b07[_0x56de('0x14')]&&!_[_0x56de('0x15')](_0x5b07[_0x56de('0x16')])){_0x10f7fa['OpenchannelInteraction'][_0x56de('0x17')]({'where':{'id':_0x5b07[_0x56de('0x18')]}})[_0x56de('0x19')](function(_0xc6c585){if(_0xc6c585){_0xc6c585[_0x56de('0x1a')]({'lastMsgAt':_0x5b07[_0x56de('0x1b')],'lastMsgDirection':_0x5b07[_0x56de('0x11')]['toLowerCase']()});}})['catch'](function(_0x1a9389){console[_0x56de('0x1c')](_0x1a9389);});}if(_0x5b07[_0x56de('0x11')]===_0x56de('0x13')&&!_0x5b07[_0x56de('0x14')]){var _0xf115c1;_0x10f7fa['CmContact'][_0x56de('0x1d')]()['then'](function(_0x4c3314){return _0x10f7fa[_0x56de('0x1e')]['find']({'where':{'id':_0x5b07[_0x56de('0x1f')]},'include':[{'model':_0x10f7fa[_0x56de('0x20')],'as':_0x56de('0x21'),'where':{'id':_0x5b07[_0x56de('0x18')]},'limit':0x1,'include':[{'model':_0x10f7fa[_0x56de('0x22')],'as':'Contact','attributes':_['keys'](_0x4c3314)}]}]});})[_0x56de('0x19')](function(_0x17b99e){_0xf115c1=_0x17b99e[_0x56de('0x10')]({'plain':!![]});if(_0xf115c1&&_0xf115c1['replyUri']){logger['info'](_0x56de('0x23'),_0x56de('0x24'),util['format'](_0x56de('0x25'),_0x5b07['id'],_0xf115c1[_0x56de('0x26')]));if(_0xf115c1[_0x56de('0x21')]&&_0xf115c1[_0x56de('0x21')]['length']){_0x5b07['Interaction']=_[_0x56de('0x27')](_0xf115c1[_0x56de('0x21')][0x0],_0x56de('0x28'));_0x5b07[_0x56de('0x28')]=_0xf115c1[_0x56de('0x21')][0x0]['Contact'];}var _0x503d1b={'method':_0x56de('0x29'),'uri':encodeURI(_0xf115c1[_0x56de('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x503d1b['method']){case _0x56de('0x2a'):_0x503d1b['qs']=_0x5b07;break;case _0x56de('0x29'):_0x503d1b[_0x56de('0x2b')]=_0x5b07;break;}return rp(_0x503d1b)['then'](function(_0x3f0fc4){logger[_0x56de('0x2c')]('OpenchannelMessage,\x20%s,\x20%s',_0x56de('0x24'),util[_0x56de('0x2d')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x5b07['id'],_0xf115c1[_0x56de('0x26')]));if(_0x3f0fc4['body'][_0x56de('0x2e')]&&_0x3f0fc4[_0x56de('0x2b')][_0x56de('0x2e')]!=_0x5b07[_0x56de('0x2f')][_0x56de('0x2e')]){return _0x10f7fa[_0x56de('0x20')]['update']({'threadId':_0x3f0fc4[_0x56de('0x2b')][_0x56de('0x2e')]},{'where':{'id':_0x5b07['Interaction']['id']}});}else{return;}})['then'](function(){return _0x4d8b1a[_0x56de('0x1a')]({'read':!![]});})[_0x56de('0x30')](function(_0x4cb066){logger[_0x56de('0x1c')](_0x56de('0x23'),_0x56de('0x24'),util[_0x56de('0x31')](_0x4cb066,{'showHidden':![],'depth':null}));_0x24d793();});}else{_0x24d793();}})['finally'](function(){_0x24d793();});}else{_0x24d793();}}},'charset':_0x56de('0x32'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x77cf=['format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interaction','Contact','GET','info','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','toLowerCase','direction','out','isNil','UserId','findOne','OpenchannelInteractionId','then','update','error','secret','CmContact','describe','OpenchannelInteraction','Interactions','keys','get','afterCreate'];(function(_0x4b8920,_0x38e8db){var _0x1665dd=function(_0x4505c2){while(--_0x4505c2){_0x4b8920['push'](_0x4b8920['shift']());}};_0x1665dd(++_0x38e8db);}(_0x77cf,0x65));var _0xf77c=function(_0x4ecaa9,_0x5db383){_0x4ecaa9=_0x4ecaa9-0x0;var _0x19fe6a=_0x77cf[_0x4ecaa9];return _0x19fe6a;};'use strict';var _=require(_0xf77c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf77c('0x1'));var moment=require(_0xf77c('0x2'));var BPromise=require(_0xf77c('0x3'));var rp=require(_0xf77c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf77c('0x5'));var config=require(_0xf77c('0x6'));var attributes=require(_0xf77c('0x7'));module['exports']=function(_0x416949,_0x2df621){return _0x416949['define']('OpenchannelMessage',attributes,{'tableName':_0xf77c('0x8'),'paranoid':![],'indexes':[{'name':_0xf77c('0x9'),'fields':[_0xf77c('0xa')],'type':_0xf77c('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x322886,_0x6bff41,_0x1cd727){var _0x5b335e=_0x416949[_0xf77c('0xc')];var _0x3842c1=_0x322886['get']({'plain':!![]});if(_0x3842c1['direction'][_0xf77c('0xd')]()==='in'||_0x3842c1[_0xf77c('0xe')][_0xf77c('0xd')]()===_0xf77c('0xf')&&!_0x3842c1['secret']&&!_[_0xf77c('0x10')](_0x3842c1[_0xf77c('0x11')])){_0x5b335e['OpenchannelInteraction'][_0xf77c('0x12')]({'where':{'id':_0x3842c1[_0xf77c('0x13')]}})[_0xf77c('0x14')](function(_0x23309d){if(_0x23309d){_0x23309d[_0xf77c('0x15')]({'lastMsgAt':_0x3842c1['createdAt'],'lastMsgDirection':_0x3842c1[_0xf77c('0xe')][_0xf77c('0xd')]()});}})['catch'](function(_0x2cf6f9){console[_0xf77c('0x16')](_0x2cf6f9);});}if(_0x3842c1['direction']===_0xf77c('0xf')&&!_0x3842c1[_0xf77c('0x17')]){var _0x37588d;_0x5b335e[_0xf77c('0x18')][_0xf77c('0x19')]()[_0xf77c('0x14')](function(_0x4eac00){return _0x5b335e['OpenchannelAccount']['find']({'where':{'id':_0x3842c1['OpenchannelAccountId']},'include':[{'model':_0x5b335e[_0xf77c('0x1a')],'as':_0xf77c('0x1b'),'where':{'id':_0x3842c1[_0xf77c('0x13')]},'limit':0x1,'include':[{'model':_0x5b335e['CmContact'],'as':'Contact','attributes':_[_0xf77c('0x1c')](_0x4eac00)}]}]});})[_0xf77c('0x14')](function(_0x599642){_0x37588d=_0x599642[_0xf77c('0x1d')]({'plain':!![]});if(_0x37588d&&_0x37588d['replyUri']){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xf77c('0x1e'),util[_0xf77c('0x1f')](_0xf77c('0x20'),_0x3842c1['id'],_0x37588d[_0xf77c('0x21')]));if(_0x37588d[_0xf77c('0x1b')]&&_0x37588d[_0xf77c('0x1b')]['length']){_0x3842c1[_0xf77c('0x22')]=_['omit'](_0x37588d['Interactions'][0x0],_0xf77c('0x23'));_0x3842c1['Contact']=_0x37588d[_0xf77c('0x1b')][0x0][_0xf77c('0x23')];}var _0x6bff41={'method':'POST','uri':encodeURI(_0x37588d['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x6bff41['method']){case _0xf77c('0x24'):_0x6bff41['qs']=_0x3842c1;break;case'POST':_0x6bff41['body']=_0x3842c1;break;}return rp(_0x6bff41)[_0xf77c('0x14')](function(_0x3ef1ba){logger[_0xf77c('0x25')](_0xf77c('0x26'),'afterCreate',util[_0xf77c('0x1f')](_0xf77c('0x27'),_0x3842c1['id'],_0x37588d[_0xf77c('0x21')]));if(_0x3ef1ba['body']['threadId']&&_0x3ef1ba['body'][_0xf77c('0x28')]!=_0x3842c1[_0xf77c('0x22')]['threadId']){return _0x5b335e['OpenchannelInteraction'][_0xf77c('0x15')]({'threadId':_0x3ef1ba['body']['threadId']},{'where':{'id':_0x3842c1[_0xf77c('0x22')]['id']}});}else{return;}})[_0xf77c('0x14')](function(){return _0x322886[_0xf77c('0x15')]({'read':!![]});})['catch'](function(_0x51f1f8){logger[_0xf77c('0x16')](_0xf77c('0x26'),_0xf77c('0x1e'),util[_0xf77c('0x29')](_0x51f1f8,{'showHidden':![],'depth':null}));_0x1cd727();});}else{_0x1cd727();}})['finally'](function(){_0x1cd727();});}else{_0x1cd727();}}},'charset':_0xf77c('0x2a'),'collate':_0xf77c('0x2b')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index b492ccf..c4b3fa9 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(_0x3fdcf1,_0x382ec5){var _0x484219=function(_0x5d5bae){while(--_0x5d5bae){_0x3fdcf1['push'](_0x3fdcf1['shift']());}};_0x484219(++_0x382ec5);}(_0x7a54,0x106));var _0x47a5=function(_0x5ac3bf,_0x251950){_0x5ac3bf=_0x5ac3bf-0x0;var _0x23839f=_0x7a54[_0x5ac3bf];return _0x23839f;};'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(_0x2b7738,_0x3adac3){var _0xca5840=function(_0x186a8e){while(--_0x186a8e){_0x2b7738['push'](_0x2b7738['shift']());}};_0xca5840(++_0x3adac3);}(_0x7a54,0x106));var _0x47a5=function(_0xc73438,_0x29d81d){_0xc73438=_0xc73438-0x0;var _0x1f4e61=_0x7a54[_0xc73438];return _0x1f4e61;};'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 ed742ab..f47250d 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 _0xdadf=['emit','removeListener','register','length','./openchannelMessage.events','remove','update'];(function(_0x2221da,_0x27bf6d){var _0x29079f=function(_0x362d96){while(--_0x362d96){_0x2221da['push'](_0x2221da['shift']());}};_0x29079f(++_0x27bf6d);}(_0xdadf,0xc8));var _0xfdad=function(_0x14a900,_0xdb3fa9){_0x14a900=_0x14a900-0x0;var _0x3b2cbd=_0xdadf[_0x14a900];return _0x3b2cbd;};'use strict';var OpenchannelMessageEvents=require(_0xfdad('0x0'));var events=['save',_0xfdad('0x1'),_0xfdad('0x2')];function createListener(_0x5043e7,_0x35475f){return function(_0x3df338){_0x35475f[_0xfdad('0x3')](_0x5043e7,_0x3df338);};}function removeListener(_0x235726,_0xfaf253){return function(){OpenchannelMessageEvents[_0xfdad('0x4')](_0x235726,_0xfaf253);};}exports[_0xfdad('0x5')]=function(_0x4dfe82){for(var _0x172b2a=0x0,_0x3eca55=events[_0xfdad('0x6')];_0x172b2a<_0x3eca55;_0x172b2a++){var _0x27deab=events[_0x172b2a];var _0xbfaca2=createListener('openchannelMessage:'+_0x27deab,_0x4dfe82);OpenchannelMessageEvents['on'](_0x27deab,_0xbfaca2);}}; \ No newline at end of file +var _0xe08b=['emit','removeListener','register','length','./openchannelMessage.events','remove','update'];(function(_0x21e0e3,_0x48e744){var _0x120972=function(_0x79e83d){while(--_0x79e83d){_0x21e0e3['push'](_0x21e0e3['shift']());}};_0x120972(++_0x48e744);}(_0xe08b,0x10e));var _0xbe08=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0xe08b[_0x4e4f0e];return _0x1a7219;};'use strict';var OpenchannelMessageEvents=require(_0xbe08('0x0'));var events=['save',_0xbe08('0x1'),_0xbe08('0x2')];function createListener(_0x59be61,_0x621a50){return function(_0x16e599){_0x621a50[_0xbe08('0x3')](_0x59be61,_0x16e599);};}function removeListener(_0x469522,_0x41edfb){return function(){OpenchannelMessageEvents[_0xbe08('0x4')](_0x469522,_0x41edfb);};}exports[_0xbe08('0x5')]=function(_0x1150ef){for(var _0x212ad5=0x0,_0x2f78b1=events[_0xbe08('0x6')];_0x212ad5<_0x2f78b1;_0x212ad5++){var _0x2321c3=events[_0x212ad5];var _0x271f57=createListener('openchannelMessage:'+_0x2321c3,_0x1150ef);OpenchannelMessageEvents['on'](_0x2321c3,_0x271f57);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 026175a..5d9dfe8 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 _0xeed8=['getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','show','/:id/members','getMembers'];(function(_0x4071d4,_0x5372ed){var _0x447c43=function(_0x1d5e55){while(--_0x1d5e55){_0x4071d4['push'](_0x4071d4['shift']());}};_0x447c43(++_0x5372ed);}(_0xeed8,0x16a));var _0x8eed=function(_0x5ea4b9,_0x1a62b6){_0x5ea4b9=_0x5ea4b9-0x0;var _0x3d375f=_0xeed8[_0x5ea4b9];return _0x3d375f;};'use strict';var multer=require(_0x8eed('0x0'));var util=require(_0x8eed('0x1'));var path=require(_0x8eed('0x2'));var timeout=require(_0x8eed('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8eed('0x4'));var interaction=require(_0x8eed('0x5'));var config=require(_0x8eed('0x6'));var controller=require(_0x8eed('0x7'));router[_0x8eed('0x8')]('/',auth[_0x8eed('0x9')](),controller[_0x8eed('0xa')]);router['get']('/describe',auth[_0x8eed('0x9')](),controller[_0x8eed('0xb')]);router[_0x8eed('0x8')]('/:id',auth[_0x8eed('0x9')](),controller[_0x8eed('0xc')]);router[_0x8eed('0x8')](_0x8eed('0xd'),auth[_0x8eed('0x9')](),controller[_0x8eed('0xe')]);router['get']('/:id/teams',auth[_0x8eed('0x9')](),controller[_0x8eed('0xf')]);router[_0x8eed('0x8')](_0x8eed('0x10'),auth[_0x8eed('0x9')](),controller[_0x8eed('0x11')]);router[_0x8eed('0x12')]('/',auth[_0x8eed('0x9')](),controller['create']);router['post'](_0x8eed('0x13'),auth[_0x8eed('0x9')](),controller[_0x8eed('0x14')]);router[_0x8eed('0x12')](_0x8eed('0x10'),auth[_0x8eed('0x9')](),controller[_0x8eed('0x15')]);router[_0x8eed('0x16')](_0x8eed('0x17'),auth[_0x8eed('0x9')](),controller[_0x8eed('0x18')]);router[_0x8eed('0x19')](_0x8eed('0x17'),auth[_0x8eed('0x9')](),controller[_0x8eed('0x1a')]);router['delete'](_0x8eed('0x13'),auth[_0x8eed('0x9')](),controller[_0x8eed('0x1b')]);router[_0x8eed('0x19')](_0x8eed('0x10'),auth[_0x8eed('0x9')](),controller['removeAgents']);module[_0x8eed('0x1c')]=router; \ No newline at end of file +var _0xea75=['destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','/:id/teams','addTeams','update','delete'];(function(_0x4a489f,_0x5402ab){var _0x4a4137=function(_0x4e35f3){while(--_0x4e35f3){_0x4a489f['push'](_0x4a489f['shift']());}};_0x4a4137(++_0x5402ab);}(_0xea75,0x126));var _0x5ea7=function(_0x4ebae2,_0x10d641){_0x4ebae2=_0x4ebae2-0x0;var _0x39f80f=_0xea75[_0x4ebae2];return _0x39f80f;};'use strict';var multer=require(_0x5ea7('0x0'));var util=require(_0x5ea7('0x1'));var path=require(_0x5ea7('0x2'));var timeout=require(_0x5ea7('0x3'));var express=require(_0x5ea7('0x4'));var router=express['Router']();var fs_extra=require(_0x5ea7('0x5'));var auth=require(_0x5ea7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5ea7('0x7'));var controller=require(_0x5ea7('0x8'));router[_0x5ea7('0x9')]('/',auth['isAuthenticated'](),controller[_0x5ea7('0xa')]);router[_0x5ea7('0x9')](_0x5ea7('0xb'),auth[_0x5ea7('0xc')](),controller[_0x5ea7('0xd')]);router[_0x5ea7('0x9')](_0x5ea7('0xe'),auth[_0x5ea7('0xc')](),controller[_0x5ea7('0xf')]);router[_0x5ea7('0x9')](_0x5ea7('0x10'),auth[_0x5ea7('0xc')](),controller[_0x5ea7('0x11')]);router['get']('/:id/teams',auth[_0x5ea7('0xc')](),controller['getTeams']);router[_0x5ea7('0x9')](_0x5ea7('0x12'),auth[_0x5ea7('0xc')](),controller[_0x5ea7('0x13')]);router[_0x5ea7('0x14')]('/',auth[_0x5ea7('0xc')](),controller['create']);router[_0x5ea7('0x14')](_0x5ea7('0x15'),auth['isAuthenticated'](),controller[_0x5ea7('0x16')]);router[_0x5ea7('0x14')](_0x5ea7('0x12'),auth[_0x5ea7('0xc')](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5ea7('0x17')]);router[_0x5ea7('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x5ea7('0x19')]);router['delete'](_0x5ea7('0x15'),auth[_0x5ea7('0xc')](),controller[_0x5ea7('0x1a')]);router[_0x5ea7('0x18')](_0x5ea7('0x12'),auth['isAuthenticated'](),controller[_0x5ea7('0x1b')]);module[_0x5ea7('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 db07989..61faaf6 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 _0x550a=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','name'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x550a,0x1af));var _0xa550=function(_0x2aded5,_0x2bb595){_0x2aded5=_0x2aded5-0x0;var _0x463e98=_0x550a[_0x2aded5];return _0x463e98;};'use strict';var Sequelize=require(_0xa550('0x0'));module[_0xa550('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa550('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa550('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa550('0x4'),_0xa550('0x5'),_0xa550('0x6'))}}; \ No newline at end of file +var _0x9378=['name','STRING','INTEGER','ENUM','rrmemory','beepall','exports'];(function(_0x114bc0,_0x446432){var _0x5ad9f1=function(_0x1472aa){while(--_0x1472aa){_0x114bc0['push'](_0x114bc0['shift']());}};_0x5ad9f1(++_0x446432);}(_0x9378,0x102));var _0x8937=function(_0x5ba0e4,_0x38e1ab){_0x5ba0e4=_0x5ba0e4-0x0;var _0xf065f1=_0x9378[_0x5ba0e4];return _0xf065f1;};'use strict';var Sequelize=require('sequelize');module[_0x8937('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8937('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8937('0x2')]},'timeout':{'type':Sequelize[_0x8937('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8937('0x4')](_0x8937('0x5'),_0x8937('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 1efd4bf..a779321 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 _0xf178=['fields','attributes','length','include','merge','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','UserProfileResource','describe','findOne','keys','UserOpenchannelQueue','hasOwnProperty','nolimit','sort','where','filters','OpenchannelQueueId','filter','findAndCountAll','agent','openchannelPause','format','%s/%s','createdAt','updatedAt','getTeams','Team','order','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','User','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','userOpenchannelQueue:remove','omit','userOpenchannelQueue:save','isArray','getAgents','pick','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','OpenchannelQueues','error','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','query','findAll','rows','catch','params','model','intersection'];(function(_0x49a694,_0x281f2d){var _0x13db1e=function(_0xcc3fdc){while(--_0xcc3fdc){_0x49a694['push'](_0x49a694['shift']());}};_0x13db1e(++_0x281f2d);}(_0xf178,0x1b0));var _0x8f17=function(_0x4b1012,_0x1415eb){_0x4b1012=_0x4b1012-0x0;var _0x23d715=_0xf178[_0x4b1012];return _0x23d715;};'use strict';var BPromise=require(_0x8f17('0x0'));var util=require(_0x8f17('0x1'));var _=require('lodash');var squel=require(_0x8f17('0x2'));var Redis=require(_0x8f17('0x3'));var qs=require(_0x8f17('0x4'));var logger=require(_0x8f17('0x5'))(_0x8f17('0x6'));var config=require(_0x8f17('0x7'));var db=require(_0x8f17('0x8'))['db'];config[_0x8f17('0x9')]=_[_0x8f17('0xa')](config[_0x8f17('0x9')],{'host':_0x8f17('0xb'),'port':0x18eb});var socket=require(_0x8f17('0xc'))(new Redis(config[_0x8f17('0x9')]));require(_0x8f17('0xd'))[_0x8f17('0xe')](socket);function respondWithStatusCode(_0x436378,_0x54929c){_0x54929c=_0x54929c||0xcc;return function(_0x1cb313){if(_0x1cb313){return _0x436378[_0x8f17('0xf')](_0x54929c);}return _0x436378[_0x8f17('0x10')](_0x54929c)[_0x8f17('0x11')]();};}function respondWithResult(_0x27df23,_0x3381fa){_0x3381fa=_0x3381fa||0xc8;return function(_0x3e5a4f){if(_0x3e5a4f){return _0x27df23[_0x8f17('0x10')](_0x3381fa)['json'](_0x3e5a4f);}};}function respondWithFilteredResult(_0x10f908,_0x2ba1f0){return function(_0x1e9ffa){if(_0x1e9ffa){var _0x2d05ea=typeof _0x2ba1f0[_0x8f17('0x12')]===_0x8f17('0x13')&&typeof _0x2ba1f0['limit']==='undefined';var _0x50ba79=_0x1e9ffa[_0x8f17('0x14')];var _0x14fc71=_0x2d05ea?0x0:_0x2ba1f0[_0x8f17('0x12')];var _0x1dc5fe=_0x2d05ea?_0x1e9ffa[_0x8f17('0x14')]:_0x2ba1f0['offset']+_0x2ba1f0[_0x8f17('0x15')];var _0x1ce889;if(_0x1dc5fe>=_0x50ba79){_0x1dc5fe=_0x50ba79;_0x1ce889=0xc8;}else{_0x1ce889=0xce;}_0x10f908['status'](_0x1ce889);return _0x10f908[_0x8f17('0x16')](_0x8f17('0x17'),_0x14fc71+'-'+_0x1dc5fe+'/'+_0x50ba79)[_0x8f17('0x18')](_0x1e9ffa);}return null;};}function saveUpdates(_0x5eb1c0){return function(_0x1446c8){if(_0x1446c8){return _0x1446c8[_0x8f17('0x19')](_0x5eb1c0)[_0x8f17('0x1a')](function(_0x48dd84){return _0x48dd84;});}return null;};}function removeEntity(_0x18b9ff){return function(_0x261c6f){if(_0x261c6f){return _0x261c6f[_0x8f17('0x1b')]()[_0x8f17('0x1a')](function(){var _0x335d69=_0x261c6f['get']({'plain':!![]});var _0x4b88b3=_0x8f17('0x1c');return db['UserProfileResource'][_0x8f17('0x1b')]({'where':{'type':_0x4b88b3,'resourceId':_0x335d69['id']}})[_0x8f17('0x1a')](function(){return _0x261c6f;});})['then'](function(){_0x18b9ff[_0x8f17('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x367f74){return function(_0x40f841){if(!_0x40f841){_0x367f74[_0x8f17('0xf')](0x194);}return _0x40f841;};}function handleError(_0x67ea16,_0x3fa58a){_0x3fa58a=_0x3fa58a||0x1f4;return function(_0x5c2772){logger[_0x8f17('0x1d')](_0x5c2772[_0x8f17('0x1e')]);if(_0x5c2772[_0x8f17('0x1f')]){delete _0x5c2772[_0x8f17('0x1f')];}_0x67ea16[_0x8f17('0x10')](_0x3fa58a)['send'](_0x5c2772);};}exports[_0x8f17('0x20')]=function(_0x5d2bfd,_0x14d417){var _0x402296={};var _0x29e7ab={'count':0x0,'rows':[]};var _0x530e16=_[_0x8f17('0x21')](db[_0x8f17('0x22')][_0x8f17('0x23')],function(_0x1ec63c){return{'name':_0x1ec63c[_0x8f17('0x24')],'type':_0x1ec63c['type']['key']};});_0x402296=qs['getOptions'](_0x530e16,_0x5d2bfd);var _0x5aae25={'where':_0x402296['where']};return db[_0x8f17('0x22')][_0x8f17('0x14')](_0x5aae25)['then'](function(_0xcdce95){_0x29e7ab[_0x8f17('0x14')]=_0xcdce95;_0x402296['include']=qs['include'](_0x5d2bfd[_0x8f17('0x25')]);return db[_0x8f17('0x22')][_0x8f17('0x26')](_0x402296);})[_0x8f17('0x1a')](function(_0x2cf142){_0x29e7ab[_0x8f17('0x27')]=_0x2cf142;return _0x29e7ab;})[_0x8f17('0x1a')](respondWithFilteredResult(_0x14d417,_0x402296))[_0x8f17('0x28')](handleError(_0x14d417,null));};exports['show']=function(_0x36b886,_0x371f6d){var _0x50fd5a={'raw':!![],'where':{'id':_0x36b886[_0x8f17('0x29')]['id']}},_0x3669a8={};_0x3669a8[_0x8f17('0x2a')]=_['keys'](db[_0x8f17('0x22')][_0x8f17('0x23')]);_0x3669a8[_0x8f17('0x25')]=_['keys'](_0x36b886[_0x8f17('0x25')]);_0x3669a8['filters']=_[_0x8f17('0x2b')](_0x3669a8['model'],_0x3669a8[_0x8f17('0x25')]);_0x50fd5a['attributes']=_[_0x8f17('0x2b')](_0x3669a8['model'],qs['fields'](_0x36b886[_0x8f17('0x25')][_0x8f17('0x2c')]));_0x50fd5a['attributes']=_0x50fd5a[_0x8f17('0x2d')][_0x8f17('0x2e')]?_0x50fd5a['attributes']:_0x3669a8['model'];if(_0x36b886[_0x8f17('0x25')]['includeAll']){_0x50fd5a[_0x8f17('0x2f')]=[{'all':!![]}];}_0x50fd5a=_[_0x8f17('0x30')]({},_0x50fd5a,_0x36b886[_0x8f17('0x31')]);return db[_0x8f17('0x22')]['find'](_0x50fd5a)['then'](handleEntityNotFound(_0x371f6d,null))['then'](respondWithResult(_0x371f6d,null))['catch'](handleError(_0x371f6d,null));};exports[_0x8f17('0x32')]=function(_0x5c2007,_0x43ae5c){return db['OpenchannelQueue'][_0x8f17('0x32')](_0x5c2007[_0x8f17('0x33')],{})[_0x8f17('0x1a')](function(_0x1bd662){var _0x1abcca=_0x5c2007[_0x8f17('0x34')][_0x8f17('0x35')]({'plain':!![]});if(!_0x1abcca)throw new Error(_0x8f17('0x36'));if(_0x1abcca[_0x8f17('0x37')]==='user'){var _0xb0688a=_0x1bd662[_0x8f17('0x35')]({'plain':!![]});var _0x239c5f=_0x8f17('0x1c');return db['UserProfileSection'][_0x8f17('0x38')]({'where':{'name':_0x239c5f,'userProfileId':_0x1abcca[_0x8f17('0x39')]},'raw':!![]})[_0x8f17('0x1a')](function(_0x1799ac){if(_0x1799ac&&_0x1799ac['autoAssociation']===0x0){return db[_0x8f17('0x3a')]['create']({'name':_0xb0688a[_0x8f17('0x1f')],'resourceId':_0xb0688a['id'],'type':_0x1799ac['name'],'sectionId':_0x1799ac['id']},{})[_0x8f17('0x1a')](function(){return _0x1bd662;});}else{return _0x1bd662;}})[_0x8f17('0x28')](function(_0x3e2f18){logger[_0x8f17('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e2f18);throw _0x3e2f18;});}return _0x1bd662;})[_0x8f17('0x1a')](respondWithResult(_0x43ae5c,0xc9))[_0x8f17('0x28')](handleError(_0x43ae5c,null));};exports[_0x8f17('0x19')]=function(_0x57f04f,_0x626e3e){if(_0x57f04f[_0x8f17('0x33')]['id']){delete _0x57f04f[_0x8f17('0x33')]['id'];}return db[_0x8f17('0x22')][_0x8f17('0x38')]({'where':{'id':_0x57f04f['params']['id']}})['then'](handleEntityNotFound(_0x626e3e,null))[_0x8f17('0x1a')](saveUpdates(_0x57f04f[_0x8f17('0x33')],null))[_0x8f17('0x1a')](respondWithResult(_0x626e3e,null))[_0x8f17('0x28')](handleError(_0x626e3e,null));};exports[_0x8f17('0x1b')]=function(_0x1b7f91,_0x2e5b22){return db['OpenchannelQueue'][_0x8f17('0x38')]({'where':{'id':_0x1b7f91['params']['id']}})[_0x8f17('0x1a')](handleEntityNotFound(_0x2e5b22,null))[_0x8f17('0x1a')](removeEntity(_0x2e5b22,null))[_0x8f17('0x28')](handleError(_0x2e5b22,null));};exports[_0x8f17('0x3b')]=function(_0x649c5b,_0xdffe03){return db[_0x8f17('0x22')][_0x8f17('0x3b')]()[_0x8f17('0x1a')](respondWithResult(_0xdffe03,null))['catch'](handleError(_0xdffe03,null));};exports['getMembers']=function(_0x2470d9,_0x145c12){var _0x3a5c5e={'raw':!![],'where':{}},_0x4de61b={},_0x1c94c9;return db[_0x8f17('0x22')][_0x8f17('0x3c')]({'where':{'id':_0x2470d9[_0x8f17('0x29')]['id']}})[_0x8f17('0x1a')](handleEntityNotFound(_0x145c12,null))[_0x8f17('0x1a')](function(_0x4cf91e){if(_0x4cf91e){_0x1c94c9=_0x4cf91e[_0x8f17('0x35')]({'plain':!![]});_0x4de61b[_0x8f17('0x2a')]=_[_0x8f17('0x3d')](db[_0x8f17('0x3e')]['rawAttributes']);_0x4de61b['query']=_['keys'](_0x2470d9[_0x8f17('0x25')]);_0x4de61b['filters']=_[_0x8f17('0x2b')](_0x4de61b[_0x8f17('0x2a')],_0x4de61b[_0x8f17('0x25')]);_0x3a5c5e[_0x8f17('0x2d')]=_[_0x8f17('0x2b')](_0x4de61b[_0x8f17('0x2a')],qs[_0x8f17('0x2c')](_0x2470d9[_0x8f17('0x25')][_0x8f17('0x2c')]));_0x3a5c5e[_0x8f17('0x2d')]=_0x3a5c5e[_0x8f17('0x2d')][_0x8f17('0x2e')]?_0x3a5c5e['attributes']:_0x4de61b['model'];if(!_0x2470d9[_0x8f17('0x25')][_0x8f17('0x3f')](_0x8f17('0x40'))){_0x3a5c5e[_0x8f17('0x15')]=qs[_0x8f17('0x15')](_0x2470d9['query'][_0x8f17('0x15')]);_0x3a5c5e[_0x8f17('0x12')]=qs[_0x8f17('0x12')](_0x2470d9[_0x8f17('0x25')][_0x8f17('0x12')]);}_0x3a5c5e['order']=qs[_0x8f17('0x41')](_0x2470d9['query']['sort']);_0x3a5c5e[_0x8f17('0x42')]=qs[_0x8f17('0x43')](_['pick'](_0x2470d9[_0x8f17('0x25')],_0x4de61b['filters']));_0x3a5c5e[_0x8f17('0x42')][_0x8f17('0x44')]=_0x4cf91e['id'];if(_0x2470d9[_0x8f17('0x25')][_0x8f17('0x45')]){_0x3a5c5e[_0x8f17('0x42')]=_[_0x8f17('0x30')](_0x3a5c5e[_0x8f17('0x42')],{'$or':_['map'](_0x3a5c5e[_0x8f17('0x2d')],function(_0xd2522a){var _0x248bb6={};_0x248bb6[_0xd2522a]={'$like':'%'+_0x2470d9[_0x8f17('0x25')][_0x8f17('0x45')]+'%'};return _0x248bb6;})});}_0x3a5c5e=_['merge']({},_0x3a5c5e,_0x2470d9[_0x8f17('0x31')]);return db[_0x8f17('0x3e')][_0x8f17('0x26')](_0x3a5c5e);}})['then'](function(_0x3650a3){if(_0x3650a3){return db['User'][_0x8f17('0x46')]({'where':{'id':_[_0x8f17('0x21')](_0x3650a3,'UserId'),'role':_0x8f17('0x47')},'attributes':['id','name',_0x8f17('0x48'),'updatedAt','createdAt']});}})[_0x8f17('0x1a')](function(_0x5c4546){if(_0x5c4546){return{'count':_0x5c4546['count'],'rows':_[_0x8f17('0x21')](_0x5c4546[_0x8f17('0x27')],function(_0x3e15f0){return{'membername':_0x3e15f0['name'],'UserId':_0x3e15f0['id'],'queue_name':_0x1c94c9[_0x8f17('0x1f')],'OpenchannelQueueId':_0x1c94c9['id'],'interface':util[_0x8f17('0x49')](_0x8f17('0x4a'),'SIP',_0x3e15f0[_0x8f17('0x1f')]),'penalty':0x0,'paused':_0x3e15f0[_0x8f17('0x48')],'createdAt':_0x3e15f0[_0x8f17('0x4b')],'updatedAt':_0x3e15f0[_0x8f17('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x145c12,_0x3a5c5e))[_0x8f17('0x28')](handleError(_0x145c12,null));};exports[_0x8f17('0x4d')]=function(_0x175ed2,_0x50ce33){var _0x4c5f1e={};var _0x4ab467={};var _0x50456d;var _0x54bbc3;return db[_0x8f17('0x22')][_0x8f17('0x3c')]({'where':{'id':_0x175ed2[_0x8f17('0x29')]['id']}})['then'](handleEntityNotFound(_0x50ce33,null))[_0x8f17('0x1a')](function(_0x53f53a){if(_0x53f53a){_0x50456d=_0x53f53a;_0x4ab467[_0x8f17('0x2a')]=_[_0x8f17('0x3d')](db[_0x8f17('0x4e')][_0x8f17('0x23')]);_0x4ab467[_0x8f17('0x25')]=_['keys'](_0x175ed2['query']);_0x4ab467[_0x8f17('0x43')]=_[_0x8f17('0x2b')](_0x4ab467[_0x8f17('0x2a')],_0x4ab467[_0x8f17('0x25')]);_0x4c5f1e[_0x8f17('0x2d')]=_[_0x8f17('0x2b')](_0x4ab467[_0x8f17('0x2a')],qs[_0x8f17('0x2c')](_0x175ed2[_0x8f17('0x25')][_0x8f17('0x2c')]));_0x4c5f1e[_0x8f17('0x2d')]=_0x4c5f1e['attributes'][_0x8f17('0x2e')]?_0x4c5f1e[_0x8f17('0x2d')]:_0x4ab467[_0x8f17('0x2a')];_0x4c5f1e[_0x8f17('0x4f')]=qs[_0x8f17('0x41')](_0x175ed2['query'][_0x8f17('0x41')]);_0x4c5f1e[_0x8f17('0x42')]=qs[_0x8f17('0x43')](_['pick'](_0x175ed2[_0x8f17('0x25')],_0x4ab467[_0x8f17('0x43')]));if(_0x175ed2[_0x8f17('0x25')][_0x8f17('0x45')]){_0x4c5f1e['where']=_[_0x8f17('0x30')](_0x4c5f1e[_0x8f17('0x42')],{'$or':_['map'](_0x4c5f1e[_0x8f17('0x2d')],function(_0x52f858){var _0x5bc97a={};_0x5bc97a[_0x52f858]={'$like':'%'+_0x175ed2['query']['filter']+'%'};return _0x5bc97a;})});}_0x4c5f1e=_['merge']({},_0x4c5f1e,_0x175ed2[_0x8f17('0x31')]);return _0x50456d[_0x8f17('0x4d')](_0x4c5f1e);}})[_0x8f17('0x1a')](function(_0xbe8d5){if(_0xbe8d5){_0x54bbc3=_0xbe8d5['length'];if(!_0x175ed2[_0x8f17('0x25')][_0x8f17('0x3f')]('nolimit')){_0x4c5f1e['limit']=qs[_0x8f17('0x15')](_0x175ed2['query'][_0x8f17('0x15')]);_0x4c5f1e[_0x8f17('0x12')]=qs['offset'](_0x175ed2[_0x8f17('0x25')][_0x8f17('0x12')]);}return _0x50456d[_0x8f17('0x4d')](_0x4c5f1e);}})[_0x8f17('0x1a')](function(_0x56ed76){if(_0x56ed76){return _0x56ed76?{'count':_0x54bbc3,'rows':_0x56ed76}:null;}})[_0x8f17('0x1a')](respondWithResult(_0x50ce33,null))[_0x8f17('0x28')](handleError(_0x50ce33,null));};exports['addTeams']=function(_0x27f995,_0x1d7c53){var _0x559075=_0x27f995[_0x8f17('0x33')][_0x8f17('0x50')];return db[_0x8f17('0x4e')][_0x8f17('0x26')]({'where':{'id':_0x559075},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8f17('0x51'),'attributes':['id',_0x8f17('0x1f'),_0x8f17('0x52'),_0x8f17('0x53'),'interface'],'raw':!![]}]})['then'](function(_0x13bf8){if(_0x13bf8){var _0x4010f5=_[_0x8f17('0x54')](_0x13bf8,function(_0x2f1b14){var _0x3a34b9=_0x2f1b14['get']({'plain':!![]});return _0x3a34b9['Agents'];});return db[_0x8f17('0x22')][_0x8f17('0x38')]({'where':{'id':_0x27f995[_0x8f17('0x29')]['id']}})[_0x8f17('0x1a')](function(_0x42f5dd){return db[_0x8f17('0x55')][_0x8f17('0x56')](function(_0x2867c9){return _0x42f5dd[_0x8f17('0x57')](_0x559075,{'transaction':_0x2867c9})[_0x8f17('0x1a')](function(){return BPromise[_0x8f17('0x58')](_0x4010f5,function(_0x33791a){return db[_0x8f17('0x3e')][_0x8f17('0x59')]({'where':{'UserId':_0x33791a['id'],'OpenchannelQueueId':_0x27f995['params']['id']},'transaction':_0x2867c9});});})[_0x8f17('0x1a')](function(){_0x4010f5[_0x8f17('0x5a')](function(_0x4ab490){socket[_0x8f17('0x5b')]('userOpenchannelQueue:save',{'UserId':_0x4ab490['id'],'OpenchannelQueueId':_0x42f5dd['id']});});});});});}})[_0x8f17('0x1a')](respondWithStatusCode(_0x1d7c53,null))[_0x8f17('0x28')](handleError(_0x1d7c53,null));};exports[_0x8f17('0x5c')]=function(_0x276954,_0x172eab){return db[_0x8f17('0x4e')][_0x8f17('0x26')]({'where':{'id':_0x276954[_0x8f17('0x25')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8f17('0x5d')],'as':_0x8f17('0x51'),'attributes':['id'],'raw':!![]}]})[_0x8f17('0x1a')](handleEntityNotFound(_0x172eab,null))[_0x8f17('0x1a')](function(_0x4480be){var _0x359a11=_[_0x8f17('0x21')](_0x4480be,'id');var _0x125fdd=[];var _0x13d796=[];var _0x465ad6=squel[_0x8f17('0x5e')]();_0x465ad6[_0x8f17('0x5f')](_0x8f17('0x60'))[_0x8f17('0x61')](_0x8f17('0x62'),'tq')['join'](_0x8f17('0x63'),'ut',_0x8f17('0x64'))[_0x8f17('0x42')](_0x8f17('0x65'),_0x276954['params']['id']);for(var _0x533943=0x0;_0x533943<_0x4480be[_0x8f17('0x2e')];_0x533943+=0x1){let _0x41ab89=_0x4480be[_0x533943];for(var _0x504b67=0x0;_0x504b67<_0x41ab89[_0x8f17('0x51')]['length'];_0x504b67+=0x1){let _0x5da659=_0x41ab89[_0x8f17('0x51')][_0x504b67];var _0x29b089=_0x465ad6[_0x8f17('0x66')]();_0x29b089['where'](_0x8f17('0x67'),_0x5da659['id']);_0x13d796[_0x8f17('0x68')](db[_0x8f17('0x55')]['query'](_0x29b089['toString'](),{'type':db[_0x8f17('0x55')][_0x8f17('0x69')][_0x8f17('0x6a')]})[_0x8f17('0x1a')](function(_0x420a4b){if(_0x420a4b[_0x8f17('0x2e')]===0x1){return _0x5da659['id'];}else{var _0x2f3c47=_[_0x8f17('0x6b')](_['map'](_0x420a4b,_0x8f17('0x6c')),function(_0x20098f){return _['includes'](_0x359a11,_0x20098f);});if(_0x2f3c47){return _0x5da659['id'];}}}));}}return BPromise[_0x8f17('0x6d')](_0x13d796)[_0x8f17('0x1a')](function(_0x7e4fb){_0x125fdd=_(_0x125fdd)[_0x8f17('0x6e')](_0x7e4fb)['compact']()['value']();return db['OpenchannelQueue']['find']({'where':{'id':_0x276954[_0x8f17('0x29')]['id']}})[_0x8f17('0x1a')](function(_0x51110a){return db[_0x8f17('0x55')]['transaction'](function(_0x4dfee9){return _0x51110a[_0x8f17('0x5c')](_0x276954['query'][_0x8f17('0x50')],{'transaction':_0x4dfee9})[_0x8f17('0x1a')](function(){if(!_[_0x8f17('0x6f')](_0x125fdd)){return _0x51110a[_0x8f17('0x70')](_0x125fdd,{'transaction':_0x4dfee9});}})['then'](function(){_0x125fdd[_0x8f17('0x5a')](function(_0x1160d7){socket[_0x8f17('0x5b')](_0x8f17('0x71'),{'UserId':_0x1160d7,'OpenchannelQueueId':_0x51110a['id']});});});});});});})[_0x8f17('0x1a')](respondWithStatusCode(_0x172eab,null))[_0x8f17('0x28')](handleError(_0x172eab,null));};exports['addAgents']=function(_0x5ba08e,_0x3d824e){return db['OpenchannelQueue'][_0x8f17('0x38')]({'where':{'id':_0x5ba08e[_0x8f17('0x29')]['id']}})['then'](handleEntityNotFound(_0x3d824e,null))[_0x8f17('0x1a')](function(_0x21a63f){if(_0x21a63f){return _0x21a63f['addAgents'](_0x5ba08e['body']['ids'],_[_0x8f17('0x72')](_0x5ba08e[_0x8f17('0x33')],[_0x8f17('0x50'),'id'])||{})['spread'](function(_0x204f2f){for(var _0x2ef855=0x0;_0x2ef855<_0x5ba08e[_0x8f17('0x33')][_0x8f17('0x50')][_0x8f17('0x2e')];_0x2ef855+=0x1){socket['emit'](_0x8f17('0x73'),{'UserId':Number(_0x5ba08e[_0x8f17('0x33')][_0x8f17('0x50')][_0x2ef855]),'OpenchannelQueueId':Number(_0x5ba08e[_0x8f17('0x29')]['id'])});}return _0x204f2f;});}})[_0x8f17('0x1a')](respondWithResult(_0x3d824e,null))[_0x8f17('0x28')](handleError(_0x3d824e,null));};exports['removeAgents']=function(_0x1818cc,_0x13c18a){return db[_0x8f17('0x22')][_0x8f17('0x38')]({'where':{'id':_0x1818cc[_0x8f17('0x29')]['id']}})[_0x8f17('0x1a')](handleEntityNotFound(_0x13c18a,null))[_0x8f17('0x1a')](function(_0x6c5e65){if(_0x6c5e65){return _0x6c5e65[_0x8f17('0x70')](_0x1818cc[_0x8f17('0x25')][_0x8f17('0x50')])[_0x8f17('0x1a')](function(){if(_[_0x8f17('0x74')](_0x1818cc[_0x8f17('0x25')][_0x8f17('0x50')])){for(var _0x5ca5e1=0x0;_0x5ca5e1<_0x1818cc[_0x8f17('0x25')][_0x8f17('0x50')][_0x8f17('0x2e')];_0x5ca5e1+=0x1){socket['emit'](_0x8f17('0x71'),{'UserId':Number(_0x1818cc['query']['ids'][_0x5ca5e1]),'OpenchannelQueueId':Number(_0x1818cc['params']['id'])});}}else{socket[_0x8f17('0x5b')](_0x8f17('0x71'),{'UserId':Number(_0x1818cc[_0x8f17('0x25')][_0x8f17('0x50')]),'OpenchannelQueueId':Number(_0x1818cc[_0x8f17('0x29')]['id'])});}});}})[_0x8f17('0x1a')](respondWithStatusCode(_0x13c18a,null))['catch'](handleError(_0x13c18a,null));};exports[_0x8f17('0x75')]=function(_0xe5832e,_0x1df4c5){var _0x382cb9={};var _0x33a4fe={};var _0x30cbbc;var _0x28a784;return db['OpenchannelQueue']['findOne']({'where':{'id':_0xe5832e[_0x8f17('0x29')]['id']}})[_0x8f17('0x1a')](handleEntityNotFound(_0x1df4c5,null))[_0x8f17('0x1a')](function(_0x1aa48a){if(_0x1aa48a){_0x30cbbc=_0x1aa48a;_0x33a4fe[_0x8f17('0x2a')]=_[_0x8f17('0x3d')](db[_0x8f17('0x5d')][_0x8f17('0x23')]);_0x33a4fe['query']=_[_0x8f17('0x3d')](_0xe5832e[_0x8f17('0x25')]);_0x33a4fe[_0x8f17('0x43')]=_[_0x8f17('0x2b')](_0x33a4fe[_0x8f17('0x2a')],_0x33a4fe[_0x8f17('0x25')]);_0x382cb9[_0x8f17('0x2d')]=_[_0x8f17('0x2b')](_0x33a4fe[_0x8f17('0x2a')],qs[_0x8f17('0x2c')](_0xe5832e['query']['fields']));_0x382cb9['attributes']=_0x382cb9[_0x8f17('0x2d')][_0x8f17('0x2e')]?_0x382cb9[_0x8f17('0x2d')]:_0x33a4fe[_0x8f17('0x2a')];_0x382cb9[_0x8f17('0x4f')]=qs['sort'](_0xe5832e[_0x8f17('0x25')][_0x8f17('0x41')]);_0x382cb9[_0x8f17('0x42')]=qs[_0x8f17('0x43')](_[_0x8f17('0x76')](_0xe5832e[_0x8f17('0x25')],_0x33a4fe[_0x8f17('0x43')]));if(_0xe5832e[_0x8f17('0x25')]['filter']){_0x382cb9[_0x8f17('0x42')]=_['merge'](_0x382cb9[_0x8f17('0x42')],{'$or':_['map'](_0x382cb9[_0x8f17('0x2d')],function(_0x2121a2){var _0x466bdf={};_0x466bdf[_0x2121a2]={'$like':'%'+_0xe5832e[_0x8f17('0x25')]['filter']+'%'};return _0x466bdf;})});}_0x382cb9=_[_0x8f17('0x30')]({},_0x382cb9,_0xe5832e['options']);return _0x30cbbc['getAgents'](_0x382cb9);}})[_0x8f17('0x1a')](function(_0x4c2331){if(_0x4c2331){_0x28a784=_0x4c2331['length'];if(!_0xe5832e[_0x8f17('0x25')][_0x8f17('0x3f')]('nolimit')){_0x382cb9[_0x8f17('0x15')]=qs[_0x8f17('0x15')](_0xe5832e[_0x8f17('0x25')][_0x8f17('0x15')]);_0x382cb9['offset']=qs[_0x8f17('0x12')](_0xe5832e[_0x8f17('0x25')][_0x8f17('0x12')]);}return _0x30cbbc[_0x8f17('0x75')](_0x382cb9);}})['then'](function(_0x58dcc5){if(_0x58dcc5){return _0x58dcc5?{'count':_0x28a784,'rows':_0x58dcc5}:null;}})[_0x8f17('0x1a')](respondWithResult(_0x1df4c5,null))[_0x8f17('0x28')](handleError(_0x1df4c5,null));}; \ No newline at end of file +var _0x2ff6=['rawAttributes','query','keys','intersection','model','attributes','fields','length','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','order','sort','filters','pick','filter','merge','findAll','User','findAndCountAll','UserId','openchannelPause','%s/%s','SIP','options','getTeams','addTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','includes','all','union','compact','value','isEmpty','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','hasOwnProperty','getAgents','bluebird','util','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','status','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','end','error','stack','name','send','map','OpenchannelQueue','fieldName','type','key','getOptions','where','include','rows','show'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x2ff6,0xcc));var _0x62ff=function(_0x1bc1ce,_0x2191ad){_0x1bc1ce=_0x1bc1ce-0x0;var _0x9c2d3d=_0x2ff6[_0x1bc1ce];return _0x9c2d3d;};'use strict';var BPromise=require(_0x62ff('0x0'));var util=require(_0x62ff('0x1'));var _=require('lodash');var squel=require(_0x62ff('0x2'));var Redis=require('ioredis');var qs=require(_0x62ff('0x3'));var logger=require(_0x62ff('0x4'))(_0x62ff('0x5'));var config=require(_0x62ff('0x6'));var db=require(_0x62ff('0x7'))['db'];config[_0x62ff('0x8')]=_['defaults'](config[_0x62ff('0x8')],{'host':_0x62ff('0x9'),'port':0x18eb});var socket=require(_0x62ff('0xa'))(new Redis(config['redis']));require(_0x62ff('0xb'))['register'](socket);function respondWithStatusCode(_0x36cb59,_0x4acdf1){_0x4acdf1=_0x4acdf1||0xcc;return function(_0x4813a3){if(_0x4813a3){return _0x36cb59['sendStatus'](_0x4acdf1);}return _0x36cb59[_0x62ff('0xc')](_0x4acdf1)['end']();};}function respondWithResult(_0x31561e,_0x46e91d){_0x46e91d=_0x46e91d||0xc8;return function(_0x10575b){if(_0x10575b){return _0x31561e[_0x62ff('0xc')](_0x46e91d)['json'](_0x10575b);}};}function respondWithFilteredResult(_0x82ad40,_0xe3e863){return function(_0x357ea8){if(_0x357ea8){var _0x482ed7=typeof _0xe3e863[_0x62ff('0xd')]===_0x62ff('0xe')&&typeof _0xe3e863['limit']==='undefined';var _0x4fa60c=_0x357ea8[_0x62ff('0xf')];var _0x3bd7c0=_0x482ed7?0x0:_0xe3e863[_0x62ff('0xd')];var _0x51378c=_0x482ed7?_0x357ea8['count']:_0xe3e863[_0x62ff('0xd')]+_0xe3e863[_0x62ff('0x10')];var _0x1429a6;if(_0x51378c>=_0x4fa60c){_0x51378c=_0x4fa60c;_0x1429a6=0xc8;}else{_0x1429a6=0xce;}_0x82ad40['status'](_0x1429a6);return _0x82ad40[_0x62ff('0x11')](_0x62ff('0x12'),_0x3bd7c0+'-'+_0x51378c+'/'+_0x4fa60c)['json'](_0x357ea8);}return null;};}function saveUpdates(_0x4253e0){return function(_0x31b256){if(_0x31b256){return _0x31b256[_0x62ff('0x13')](_0x4253e0)[_0x62ff('0x14')](function(_0x48c061){return _0x48c061;});}return null;};}function removeEntity(_0x3caa83){return function(_0x48e988){if(_0x48e988){return _0x48e988[_0x62ff('0x15')]()[_0x62ff('0x14')](function(){var _0x50771b=_0x48e988[_0x62ff('0x16')]({'plain':!![]});var _0x5b1a2a='OpenchannelQueues';return db['UserProfileResource'][_0x62ff('0x15')]({'where':{'type':_0x5b1a2a,'resourceId':_0x50771b['id']}})[_0x62ff('0x14')](function(){return _0x48e988;});})[_0x62ff('0x14')](function(){_0x3caa83['status'](0xcc)[_0x62ff('0x17')]();});}};}function handleEntityNotFound(_0x3f7e70){return function(_0x3854d5){if(!_0x3854d5){_0x3f7e70['sendStatus'](0x194);}return _0x3854d5;};}function handleError(_0x36bc83,_0x91d69b){_0x91d69b=_0x91d69b||0x1f4;return function(_0xdd4746){logger[_0x62ff('0x18')](_0xdd4746[_0x62ff('0x19')]);if(_0xdd4746['name']){delete _0xdd4746[_0x62ff('0x1a')];}_0x36bc83[_0x62ff('0xc')](_0x91d69b)[_0x62ff('0x1b')](_0xdd4746);};}exports['index']=function(_0x8bc680,_0x4e7a9b){var _0x307344={};var _0x27428f={'count':0x0,'rows':[]};var _0x5a3c7e=_[_0x62ff('0x1c')](db[_0x62ff('0x1d')]['rawAttributes'],function(_0x31553d){return{'name':_0x31553d[_0x62ff('0x1e')],'type':_0x31553d[_0x62ff('0x1f')][_0x62ff('0x20')]};});_0x307344=qs[_0x62ff('0x21')](_0x5a3c7e,_0x8bc680);var _0x45a0bc={'where':_0x307344[_0x62ff('0x22')]};return db[_0x62ff('0x1d')][_0x62ff('0xf')](_0x45a0bc)[_0x62ff('0x14')](function(_0xca57ce){_0x27428f[_0x62ff('0xf')]=_0xca57ce;_0x307344[_0x62ff('0x23')]=qs[_0x62ff('0x23')](_0x8bc680['query']);return db[_0x62ff('0x1d')]['findAll'](_0x307344);})[_0x62ff('0x14')](function(_0x17f3b9){_0x27428f[_0x62ff('0x24')]=_0x17f3b9;return _0x27428f;})['then'](respondWithFilteredResult(_0x4e7a9b,_0x307344))['catch'](handleError(_0x4e7a9b,null));};exports[_0x62ff('0x25')]=function(_0xc6e9c4,_0xe7721){var _0x3b972d={'raw':!![],'where':{'id':_0xc6e9c4['params']['id']}},_0x1981e8={};_0x1981e8['model']=_['keys'](db[_0x62ff('0x1d')][_0x62ff('0x26')]);_0x1981e8[_0x62ff('0x27')]=_[_0x62ff('0x28')](_0xc6e9c4['query']);_0x1981e8['filters']=_[_0x62ff('0x29')](_0x1981e8[_0x62ff('0x2a')],_0x1981e8[_0x62ff('0x27')]);_0x3b972d[_0x62ff('0x2b')]=_[_0x62ff('0x29')](_0x1981e8[_0x62ff('0x2a')],qs[_0x62ff('0x2c')](_0xc6e9c4[_0x62ff('0x27')][_0x62ff('0x2c')]));_0x3b972d[_0x62ff('0x2b')]=_0x3b972d['attributes'][_0x62ff('0x2d')]?_0x3b972d[_0x62ff('0x2b')]:_0x1981e8['model'];if(_0xc6e9c4['query'][_0x62ff('0x2e')]){_0x3b972d[_0x62ff('0x23')]=[{'all':!![]}];}_0x3b972d=_['merge']({},_0x3b972d,_0xc6e9c4['options']);return db[_0x62ff('0x1d')][_0x62ff('0x2f')](_0x3b972d)[_0x62ff('0x14')](handleEntityNotFound(_0xe7721,null))[_0x62ff('0x14')](respondWithResult(_0xe7721,null))[_0x62ff('0x30')](handleError(_0xe7721,null));};exports[_0x62ff('0x31')]=function(_0x4f4418,_0x2fdb1c){return db[_0x62ff('0x1d')][_0x62ff('0x31')](_0x4f4418[_0x62ff('0x32')],{})[_0x62ff('0x14')](function(_0x27af0c){var _0x48d2cc=_0x4f4418['user'][_0x62ff('0x16')]({'plain':!![]});if(!_0x48d2cc)throw new Error(_0x62ff('0x33'));if(_0x48d2cc[_0x62ff('0x34')]==='user'){var _0x586fc0=_0x27af0c[_0x62ff('0x16')]({'plain':!![]});var _0x1f64bb=_0x62ff('0x35');return db[_0x62ff('0x36')]['find']({'where':{'name':_0x1f64bb,'userProfileId':_0x48d2cc[_0x62ff('0x37')]},'raw':!![]})[_0x62ff('0x14')](function(_0x4361ba){if(_0x4361ba&&_0x4361ba[_0x62ff('0x38')]===0x0){return db[_0x62ff('0x39')][_0x62ff('0x31')]({'name':_0x586fc0[_0x62ff('0x1a')],'resourceId':_0x586fc0['id'],'type':_0x4361ba[_0x62ff('0x1a')],'sectionId':_0x4361ba['id']},{})['then'](function(){return _0x27af0c;});}else{return _0x27af0c;}})[_0x62ff('0x30')](function(_0x3f2851){logger[_0x62ff('0x18')](_0x62ff('0x3a'),_0x3f2851);throw _0x3f2851;});}return _0x27af0c;})['then'](respondWithResult(_0x2fdb1c,0xc9))['catch'](handleError(_0x2fdb1c,null));};exports[_0x62ff('0x13')]=function(_0x30dc73,_0x198887){if(_0x30dc73[_0x62ff('0x32')]['id']){delete _0x30dc73[_0x62ff('0x32')]['id'];}return db[_0x62ff('0x1d')]['find']({'where':{'id':_0x30dc73[_0x62ff('0x3b')]['id']}})[_0x62ff('0x14')](handleEntityNotFound(_0x198887,null))[_0x62ff('0x14')](saveUpdates(_0x30dc73[_0x62ff('0x32')],null))[_0x62ff('0x14')](respondWithResult(_0x198887,null))[_0x62ff('0x30')](handleError(_0x198887,null));};exports[_0x62ff('0x15')]=function(_0x434f2a,_0x9dc56f){return db[_0x62ff('0x1d')]['find']({'where':{'id':_0x434f2a['params']['id']}})['then'](handleEntityNotFound(_0x9dc56f,null))['then'](removeEntity(_0x9dc56f,null))[_0x62ff('0x30')](handleError(_0x9dc56f,null));};exports[_0x62ff('0x3c')]=function(_0x4d29c5,_0x1a4ae0){return db['OpenchannelQueue'][_0x62ff('0x3c')]()[_0x62ff('0x14')](respondWithResult(_0x1a4ae0,null))[_0x62ff('0x30')](handleError(_0x1a4ae0,null));};exports[_0x62ff('0x3d')]=function(_0x2312e7,_0x21047a){var _0x6df0ad={'raw':!![],'where':{}},_0x206d37={},_0x40ed84;return db['OpenchannelQueue'][_0x62ff('0x3e')]({'where':{'id':_0x2312e7[_0x62ff('0x3b')]['id']}})[_0x62ff('0x14')](handleEntityNotFound(_0x21047a,null))[_0x62ff('0x14')](function(_0x2560b1){if(_0x2560b1){_0x40ed84=_0x2560b1[_0x62ff('0x16')]({'plain':!![]});_0x206d37['model']=_[_0x62ff('0x28')](db[_0x62ff('0x3f')][_0x62ff('0x26')]);_0x206d37['query']=_[_0x62ff('0x28')](_0x2312e7[_0x62ff('0x27')]);_0x206d37['filters']=_[_0x62ff('0x29')](_0x206d37['model'],_0x206d37[_0x62ff('0x27')]);_0x6df0ad[_0x62ff('0x2b')]=_['intersection'](_0x206d37['model'],qs[_0x62ff('0x2c')](_0x2312e7['query'][_0x62ff('0x2c')]));_0x6df0ad['attributes']=_0x6df0ad[_0x62ff('0x2b')][_0x62ff('0x2d')]?_0x6df0ad[_0x62ff('0x2b')]:_0x206d37[_0x62ff('0x2a')];if(!_0x2312e7[_0x62ff('0x27')]['hasOwnProperty'](_0x62ff('0x40'))){_0x6df0ad[_0x62ff('0x10')]=qs[_0x62ff('0x10')](_0x2312e7[_0x62ff('0x27')][_0x62ff('0x10')]);_0x6df0ad[_0x62ff('0xd')]=qs[_0x62ff('0xd')](_0x2312e7[_0x62ff('0x27')]['offset']);}_0x6df0ad[_0x62ff('0x41')]=qs['sort'](_0x2312e7[_0x62ff('0x27')][_0x62ff('0x42')]);_0x6df0ad[_0x62ff('0x22')]=qs[_0x62ff('0x43')](_[_0x62ff('0x44')](_0x2312e7['query'],_0x206d37['filters']));_0x6df0ad['where']['OpenchannelQueueId']=_0x2560b1['id'];if(_0x2312e7[_0x62ff('0x27')][_0x62ff('0x45')]){_0x6df0ad[_0x62ff('0x22')]=_[_0x62ff('0x46')](_0x6df0ad[_0x62ff('0x22')],{'$or':_[_0x62ff('0x1c')](_0x6df0ad[_0x62ff('0x2b')],function(_0x2d07ad){var _0x30c58a={};_0x30c58a[_0x2d07ad]={'$like':'%'+_0x2312e7['query']['filter']+'%'};return _0x30c58a;})});}_0x6df0ad=_[_0x62ff('0x46')]({},_0x6df0ad,_0x2312e7['options']);return db['UserOpenchannelQueue'][_0x62ff('0x47')](_0x6df0ad);}})['then'](function(_0x16e711){if(_0x16e711){return db[_0x62ff('0x48')][_0x62ff('0x49')]({'where':{'id':_['map'](_0x16e711,_0x62ff('0x4a')),'role':'agent'},'attributes':['id',_0x62ff('0x1a'),_0x62ff('0x4b'),'updatedAt','createdAt']});}})['then'](function(_0x2f5c5e){if(_0x2f5c5e){return{'count':_0x2f5c5e['count'],'rows':_[_0x62ff('0x1c')](_0x2f5c5e['rows'],function(_0xc42279){return{'membername':_0xc42279['name'],'UserId':_0xc42279['id'],'queue_name':_0x40ed84[_0x62ff('0x1a')],'OpenchannelQueueId':_0x40ed84['id'],'interface':util['format'](_0x62ff('0x4c'),_0x62ff('0x4d'),_0xc42279[_0x62ff('0x1a')]),'penalty':0x0,'paused':_0xc42279[_0x62ff('0x4b')],'createdAt':_0xc42279['createdAt'],'updatedAt':_0xc42279['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x21047a,_0x6df0ad))[_0x62ff('0x30')](handleError(_0x21047a,null));};exports['getTeams']=function(_0x38088d,_0x32fccb){var _0x390787={};var _0x37c271={};var _0x3ce78e;var _0x656b6;return db[_0x62ff('0x1d')][_0x62ff('0x3e')]({'where':{'id':_0x38088d[_0x62ff('0x3b')]['id']}})['then'](handleEntityNotFound(_0x32fccb,null))[_0x62ff('0x14')](function(_0x407ed5){if(_0x407ed5){_0x3ce78e=_0x407ed5;_0x37c271[_0x62ff('0x2a')]=_[_0x62ff('0x28')](db['Team'][_0x62ff('0x26')]);_0x37c271[_0x62ff('0x27')]=_[_0x62ff('0x28')](_0x38088d[_0x62ff('0x27')]);_0x37c271[_0x62ff('0x43')]=_[_0x62ff('0x29')](_0x37c271[_0x62ff('0x2a')],_0x37c271[_0x62ff('0x27')]);_0x390787[_0x62ff('0x2b')]=_[_0x62ff('0x29')](_0x37c271[_0x62ff('0x2a')],qs[_0x62ff('0x2c')](_0x38088d['query'][_0x62ff('0x2c')]));_0x390787[_0x62ff('0x2b')]=_0x390787[_0x62ff('0x2b')]['length']?_0x390787['attributes']:_0x37c271['model'];_0x390787['order']=qs[_0x62ff('0x42')](_0x38088d[_0x62ff('0x27')][_0x62ff('0x42')]);_0x390787[_0x62ff('0x22')]=qs[_0x62ff('0x43')](_[_0x62ff('0x44')](_0x38088d[_0x62ff('0x27')],_0x37c271['filters']));if(_0x38088d[_0x62ff('0x27')][_0x62ff('0x45')]){_0x390787[_0x62ff('0x22')]=_['merge'](_0x390787[_0x62ff('0x22')],{'$or':_[_0x62ff('0x1c')](_0x390787[_0x62ff('0x2b')],function(_0x112630){var _0x447361={};_0x447361[_0x112630]={'$like':'%'+_0x38088d[_0x62ff('0x27')]['filter']+'%'};return _0x447361;})});}_0x390787=_[_0x62ff('0x46')]({},_0x390787,_0x38088d[_0x62ff('0x4e')]);return _0x3ce78e[_0x62ff('0x4f')](_0x390787);}})[_0x62ff('0x14')](function(_0x3c2eb1){if(_0x3c2eb1){_0x656b6=_0x3c2eb1[_0x62ff('0x2d')];if(!_0x38088d[_0x62ff('0x27')]['hasOwnProperty']('nolimit')){_0x390787['limit']=qs[_0x62ff('0x10')](_0x38088d[_0x62ff('0x27')]['limit']);_0x390787[_0x62ff('0xd')]=qs[_0x62ff('0xd')](_0x38088d['query'][_0x62ff('0xd')]);}return _0x3ce78e['getTeams'](_0x390787);}})[_0x62ff('0x14')](function(_0x2146d9){if(_0x2146d9){return _0x2146d9?{'count':_0x656b6,'rows':_0x2146d9}:null;}})[_0x62ff('0x14')](respondWithResult(_0x32fccb,null))[_0x62ff('0x30')](handleError(_0x32fccb,null));};exports[_0x62ff('0x50')]=function(_0x34e84b,_0x23efce){var _0x5472e7=_0x34e84b[_0x62ff('0x32')]['ids'];return db[_0x62ff('0x51')][_0x62ff('0x47')]({'where':{'id':_0x5472e7},'attributes':['id'],'include':[{'model':db[_0x62ff('0x48')],'as':_0x62ff('0x52'),'attributes':['id',_0x62ff('0x1a'),_0x62ff('0x53'),_0x62ff('0x54'),_0x62ff('0x55')],'raw':!![]}]})[_0x62ff('0x14')](function(_0x3baf81){if(_0x3baf81){var _0x3789f7=_[_0x62ff('0x56')](_0x3baf81,function(_0x50b4d8){var _0x3819ad=_0x50b4d8[_0x62ff('0x16')]({'plain':!![]});return _0x3819ad[_0x62ff('0x52')];});return db[_0x62ff('0x1d')][_0x62ff('0x2f')]({'where':{'id':_0x34e84b['params']['id']}})['then'](function(_0xe4d867){return db[_0x62ff('0x57')][_0x62ff('0x58')](function(_0x2011d7){return _0xe4d867[_0x62ff('0x50')](_0x5472e7,{'transaction':_0x2011d7})['then'](function(){return BPromise[_0x62ff('0x59')](_0x3789f7,function(_0x4bdf15){return db[_0x62ff('0x3f')][_0x62ff('0x5a')]({'where':{'UserId':_0x4bdf15['id'],'OpenchannelQueueId':_0x34e84b['params']['id']},'transaction':_0x2011d7});});})[_0x62ff('0x14')](function(){_0x3789f7['forEach'](function(_0x283b32){socket[_0x62ff('0x5b')](_0x62ff('0x5c'),{'UserId':_0x283b32['id'],'OpenchannelQueueId':_0xe4d867['id']});});});});});}})[_0x62ff('0x14')](respondWithStatusCode(_0x23efce,null))[_0x62ff('0x30')](handleError(_0x23efce,null));};exports[_0x62ff('0x5d')]=function(_0xdda64b,_0x25a55d){return db[_0x62ff('0x51')][_0x62ff('0x47')]({'where':{'id':_0xdda64b[_0x62ff('0x27')][_0x62ff('0x5e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x62ff('0x52'),'attributes':['id'],'raw':!![]}]})[_0x62ff('0x14')](handleEntityNotFound(_0x25a55d,null))['then'](function(_0x422c65){var _0x2e065b=_['map'](_0x422c65,'id');var _0x58bff7=[];var _0x1406a8=[];var _0x5b14dd=squel['select']();_0x5b14dd[_0x62ff('0x5f')](_0x62ff('0x60'))[_0x62ff('0x61')](_0x62ff('0x62'),'tq')[_0x62ff('0x63')](_0x62ff('0x64'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x62ff('0x22')](_0x62ff('0x65'),_0xdda64b[_0x62ff('0x3b')]['id']);for(var _0x51c523=0x0;_0x51c523<_0x422c65['length'];_0x51c523+=0x1){let _0x30df4a=_0x422c65[_0x51c523];for(var _0x265352=0x0;_0x265352<_0x30df4a[_0x62ff('0x52')][_0x62ff('0x2d')];_0x265352+=0x1){let _0x41d5e1=_0x30df4a[_0x62ff('0x52')][_0x265352];var _0x4a69a2=_0x5b14dd[_0x62ff('0x66')]();_0x4a69a2[_0x62ff('0x22')](_0x62ff('0x67'),_0x41d5e1['id']);_0x1406a8[_0x62ff('0x68')](db[_0x62ff('0x57')]['query'](_0x4a69a2[_0x62ff('0x69')](),{'type':db['sequelize']['QueryTypes'][_0x62ff('0x6a')]})[_0x62ff('0x14')](function(_0x59fea0){if(_0x59fea0[_0x62ff('0x2d')]===0x1){return _0x41d5e1['id'];}else{var _0x48af0d=_['every'](_['map'](_0x59fea0,'TeamId'),function(_0x11d59e){return _[_0x62ff('0x6b')](_0x2e065b,_0x11d59e);});if(_0x48af0d){return _0x41d5e1['id'];}}}));}}return BPromise[_0x62ff('0x6c')](_0x1406a8)[_0x62ff('0x14')](function(_0x448d28){_0x58bff7=_(_0x58bff7)[_0x62ff('0x6d')](_0x448d28)[_0x62ff('0x6e')]()[_0x62ff('0x6f')]();return db['OpenchannelQueue'][_0x62ff('0x2f')]({'where':{'id':_0xdda64b['params']['id']}})['then'](function(_0x313b15){return db[_0x62ff('0x57')][_0x62ff('0x58')](function(_0x1a6d68){return _0x313b15[_0x62ff('0x5d')](_0xdda64b['query'][_0x62ff('0x5e')],{'transaction':_0x1a6d68})[_0x62ff('0x14')](function(){if(!_[_0x62ff('0x70')](_0x58bff7)){return _0x313b15['removeAgents'](_0x58bff7,{'transaction':_0x1a6d68});}})['then'](function(){_0x58bff7[_0x62ff('0x71')](function(_0x3f909d){socket['emit'](_0x62ff('0x72'),{'UserId':_0x3f909d,'OpenchannelQueueId':_0x313b15['id']});});});});});});})[_0x62ff('0x14')](respondWithStatusCode(_0x25a55d,null))[_0x62ff('0x30')](handleError(_0x25a55d,null));};exports[_0x62ff('0x73')]=function(_0x24d8ae,_0x290480){return db[_0x62ff('0x1d')][_0x62ff('0x2f')]({'where':{'id':_0x24d8ae[_0x62ff('0x3b')]['id']}})['then'](handleEntityNotFound(_0x290480,null))[_0x62ff('0x14')](function(_0x5f8835){if(_0x5f8835){return _0x5f8835['addAgents'](_0x24d8ae['body']['ids'],_[_0x62ff('0x74')](_0x24d8ae['body'],[_0x62ff('0x5e'),'id'])||{})[_0x62ff('0x75')](function(_0xd14330){for(var _0x5b3004=0x0;_0x5b3004<_0x24d8ae['body'][_0x62ff('0x5e')][_0x62ff('0x2d')];_0x5b3004+=0x1){socket[_0x62ff('0x5b')](_0x62ff('0x5c'),{'UserId':Number(_0x24d8ae['body'][_0x62ff('0x5e')][_0x5b3004]),'OpenchannelQueueId':Number(_0x24d8ae[_0x62ff('0x3b')]['id'])});}return _0xd14330;});}})[_0x62ff('0x14')](respondWithResult(_0x290480,null))[_0x62ff('0x30')](handleError(_0x290480,null));};exports[_0x62ff('0x76')]=function(_0x5efc26,_0x2ecf4b){return db[_0x62ff('0x1d')][_0x62ff('0x2f')]({'where':{'id':_0x5efc26['params']['id']}})[_0x62ff('0x14')](handleEntityNotFound(_0x2ecf4b,null))['then'](function(_0xf7ea77){if(_0xf7ea77){return _0xf7ea77[_0x62ff('0x76')](_0x5efc26[_0x62ff('0x27')][_0x62ff('0x5e')])[_0x62ff('0x14')](function(){if(_['isArray'](_0x5efc26[_0x62ff('0x27')][_0x62ff('0x5e')])){for(var _0x4eca92=0x0;_0x4eca92<_0x5efc26[_0x62ff('0x27')]['ids'][_0x62ff('0x2d')];_0x4eca92+=0x1){socket[_0x62ff('0x5b')](_0x62ff('0x72'),{'UserId':Number(_0x5efc26[_0x62ff('0x27')][_0x62ff('0x5e')][_0x4eca92]),'OpenchannelQueueId':Number(_0x5efc26[_0x62ff('0x3b')]['id'])});}}else{socket['emit'](_0x62ff('0x72'),{'UserId':Number(_0x5efc26[_0x62ff('0x27')][_0x62ff('0x5e')]),'OpenchannelQueueId':Number(_0x5efc26[_0x62ff('0x3b')]['id'])});}});}})[_0x62ff('0x14')](respondWithStatusCode(_0x2ecf4b,null))['catch'](handleError(_0x2ecf4b,null));};exports['getAgents']=function(_0x2c07ac,_0x3de0bb){var _0x383b54={};var _0x3a44a6={};var _0x2d71cf;var _0x4d0c77;return db[_0x62ff('0x1d')]['findOne']({'where':{'id':_0x2c07ac[_0x62ff('0x3b')]['id']}})[_0x62ff('0x14')](handleEntityNotFound(_0x3de0bb,null))[_0x62ff('0x14')](function(_0x62101e){if(_0x62101e){_0x2d71cf=_0x62101e;_0x3a44a6[_0x62ff('0x2a')]=_[_0x62ff('0x28')](db['User'][_0x62ff('0x26')]);_0x3a44a6[_0x62ff('0x27')]=_['keys'](_0x2c07ac[_0x62ff('0x27')]);_0x3a44a6['filters']=_[_0x62ff('0x29')](_0x3a44a6[_0x62ff('0x2a')],_0x3a44a6[_0x62ff('0x27')]);_0x383b54[_0x62ff('0x2b')]=_[_0x62ff('0x29')](_0x3a44a6[_0x62ff('0x2a')],qs[_0x62ff('0x2c')](_0x2c07ac['query'][_0x62ff('0x2c')]));_0x383b54[_0x62ff('0x2b')]=_0x383b54[_0x62ff('0x2b')][_0x62ff('0x2d')]?_0x383b54[_0x62ff('0x2b')]:_0x3a44a6[_0x62ff('0x2a')];_0x383b54['order']=qs['sort'](_0x2c07ac[_0x62ff('0x27')][_0x62ff('0x42')]);_0x383b54['where']=qs[_0x62ff('0x43')](_[_0x62ff('0x44')](_0x2c07ac[_0x62ff('0x27')],_0x3a44a6[_0x62ff('0x43')]));if(_0x2c07ac[_0x62ff('0x27')][_0x62ff('0x45')]){_0x383b54['where']=_[_0x62ff('0x46')](_0x383b54['where'],{'$or':_[_0x62ff('0x1c')](_0x383b54[_0x62ff('0x2b')],function(_0x224c3a){var _0x1329cd={};_0x1329cd[_0x224c3a]={'$like':'%'+_0x2c07ac[_0x62ff('0x27')]['filter']+'%'};return _0x1329cd;})});}_0x383b54=_['merge']({},_0x383b54,_0x2c07ac['options']);return _0x2d71cf['getAgents'](_0x383b54);}})['then'](function(_0x165b47){if(_0x165b47){_0x4d0c77=_0x165b47['length'];if(!_0x2c07ac['query'][_0x62ff('0x77')](_0x62ff('0x40'))){_0x383b54[_0x62ff('0x10')]=qs['limit'](_0x2c07ac[_0x62ff('0x27')][_0x62ff('0x10')]);_0x383b54[_0x62ff('0xd')]=qs['offset'](_0x2c07ac[_0x62ff('0x27')][_0x62ff('0xd')]);}return _0x2d71cf[_0x62ff('0x78')](_0x383b54);}})['then'](function(_0x5c3c15){if(_0x5c3c15){return _0x5c3c15?{'count':_0x4d0c77,'rows':_0x5c3c15}:null;}})[_0x62ff('0x14')](respondWithResult(_0x3de0bb,null))[_0x62ff('0x30')](handleError(_0x3de0bb,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 09f585e..1200e02 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 _0x1ea5=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x2d9e68,_0x2fcad4){var _0x34d5b5=function(_0x5095a7){while(--_0x5095a7){_0x2d9e68['push'](_0x2d9e68['shift']());}};_0x34d5b5(++_0x2fcad4);}(_0x1ea5,0x190));var _0x51ea=function(_0x5df61d,_0x158640){_0x5df61d=_0x5df61d-0x0;var _0x24cc4c=_0x1ea5[_0x5df61d];return _0x24cc4c;};'use strict';var EventEmitter=require(_0x51ea('0x0'));var OpenchannelQueue=require(_0x51ea('0x1'))['db'][_0x51ea('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x51ea('0x3')](0x0);var events={'afterCreate':_0x51ea('0x4'),'afterUpdate':_0x51ea('0x5'),'afterDestroy':_0x51ea('0x6')};function emitEvent(_0x14bbc1){return function(_0x2badee,_0xc15793,_0x57d8c4){OpenchannelQueueEvents['emit'](_0x14bbc1+':'+_0x2badee['id'],_0x2badee);OpenchannelQueueEvents[_0x51ea('0x7')](_0x14bbc1,_0x2badee);_0x57d8c4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x51ea('0x8')](e,emitEvent(event));}}module[_0x51ea('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xf733=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x5bffa2,_0x26092c){var _0x5b3503=function(_0x5563c0){while(--_0x5563c0){_0x5bffa2['push'](_0x5bffa2['shift']());}};_0x5b3503(++_0x26092c);}(_0xf733,0x13c));var _0x3f73=function(_0x1ccd8a,_0x5bf417){_0x1ccd8a=_0x1ccd8a-0x0;var _0x5a69d8=_0xf733[_0x1ccd8a];return _0x5a69d8;};'use strict';var EventEmitter=require(_0x3f73('0x0'));var OpenchannelQueue=require(_0x3f73('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x3f73('0x2')](0x0);var events={'afterCreate':_0x3f73('0x3'),'afterUpdate':_0x3f73('0x4'),'afterDestroy':_0x3f73('0x5')};function emitEvent(_0x5d3c51){return function(_0x40e63e,_0x41cd63,_0xf5373a){OpenchannelQueueEvents[_0x3f73('0x6')](_0x5d3c51+':'+_0x40e63e['id'],_0x40e63e);OpenchannelQueueEvents['emit'](_0x5d3c51,_0x40e63e);_0xf5373a(null);};}for(var e in events){if(events[_0x3f73('0x7')](e)){var event=events[e];OpenchannelQueue[_0x3f73('0x8')](e,emitEvent(event));}}module[_0x3f73('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 7bae071..9364a87 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 _0x66f3=['define','OpenchannelQueue','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x1c7ac2,_0x295452){var _0xa6128f=function(_0xf5eee4){while(--_0xf5eee4){_0x1c7ac2['push'](_0x1c7ac2['shift']());}};_0xa6128f(++_0x295452);}(_0x66f3,0x1b0));var _0x366f=function(_0x95ac8b,_0x3706f5){_0x95ac8b=_0x95ac8b-0x0;var _0x5b0792=_0x66f3[_0x95ac8b];return _0x5b0792;};'use strict';var _=require(_0x366f('0x0'));var util=require('util');var logger=require(_0x366f('0x1'))(_0x366f('0x2'));var moment=require('moment');var BPromise=require(_0x366f('0x3'));var rp=require(_0x366f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x366f('0x5'));var config=require(_0x366f('0x6'));var attributes=require('./openchannelQueue.attributes');module[_0x366f('0x7')]=function(_0x598ab6,_0x20a16f){return _0x598ab6[_0x366f('0x8')](_0x366f('0x9'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d35=['openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x2179f1,_0x21c653){var _0x176ec9=function(_0x4c4a4c){while(--_0x4c4a4c){_0x2179f1['push'](_0x2179f1['shift']());}};_0x176ec9(++_0x21c653);}(_0x9d35,0x1c1));var _0x59d3=function(_0x1ae78f,_0x122ed2){_0x1ae78f=_0x1ae78f-0x0;var _0x5baf80=_0x9d35[_0x1ae78f];return _0x5baf80;};'use strict';var _=require(_0x59d3('0x0'));var util=require(_0x59d3('0x1'));var logger=require(_0x59d3('0x2'))(_0x59d3('0x3'));var moment=require(_0x59d3('0x4'));var BPromise=require(_0x59d3('0x5'));var rp=require(_0x59d3('0x6'));var fs=require('fs');var path=require(_0x59d3('0x7'));var rimraf=require('rimraf');var config=require(_0x59d3('0x8'));var attributes=require(_0x59d3('0x9'));module[_0x59d3('0xa')]=function(_0x2ed256,_0x530bde){return _0x2ed256[_0x59d3('0xb')](_0x59d3('0xc'),attributes,{'tableName':_0x59d3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 9be82a4..69c5f9c 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 _0x297d=['info','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowOpenchannelQueue','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0x297d,0x1bc));var _0xd297=function(_0x256bba,_0x1e9329){_0x256bba=_0x256bba-0x0;var _0x3cafcd=_0x297d[_0x256bba];return _0x3cafcd;};'use strict';var _=require('lodash');var util=require(_0xd297('0x0'));var moment=require(_0xd297('0x1'));var BPromise=require('bluebird');var rs=require(_0xd297('0x2'));var fs=require('fs');var Redis=require(_0xd297('0x3'));var db=require(_0xd297('0x4'))['db'];var utils=require(_0xd297('0x5'));var logger=require(_0xd297('0x6'))('rpc');var config=require(_0xd297('0x7'));var jayson=require(_0xd297('0x8'));var client=jayson[_0xd297('0x9')][_0xd297('0xa')]({'port':0x232a});config[_0xd297('0xb')]=_[_0xd297('0xc')](config[_0xd297('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd297('0xd'))(new Redis(config[_0xd297('0xb')]));require(_0xd297('0xe'))['register'](socket);function respondWithRpcPromise(_0x1cf9d0,_0x35d465,_0x51e59a){return new BPromise(function(_0x15cf38,_0x1741b2){return client['request'](_0x1cf9d0,_0x51e59a)[_0xd297('0xf')](function(_0x5471c7){logger['info'](_0xd297('0x10'),_0x35d465,_0xd297('0x11'));logger[_0xd297('0x12')](_0xd297('0x13'),_0x35d465,'request\x20sent',JSON[_0xd297('0x14')](_0x5471c7));if(_0x5471c7[_0xd297('0x15')]){if(_0x5471c7['error'][_0xd297('0x16')]===0x1f4){logger[_0xd297('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x35d465,_0x5471c7['error'][_0xd297('0x17')]);return _0x1741b2(_0x5471c7[_0xd297('0x15')][_0xd297('0x17')]);}logger['error'](_0xd297('0x10'),_0x35d465,_0x5471c7[_0xd297('0x15')][_0xd297('0x17')]);return _0x15cf38(_0x5471c7['error']['message']);}else{logger[_0xd297('0x18')](_0xd297('0x10'),_0x35d465,_0xd297('0x11'));_0x15cf38(_0x5471c7[_0xd297('0x19')][_0xd297('0x17')]);}})[_0xd297('0x1a')](function(_0x524cad){logger[_0xd297('0x15')](_0xd297('0x10'),_0x35d465,_0x524cad);_0x1741b2(_0x524cad);});});}exports[_0xd297('0x1b')]=function(_0xe99c9a){var _0x2754cf=this;return new Promise(function(_0x1ea975,_0x469f78){return db[_0xd297('0x1c')][_0xd297('0x1d')]({'raw':_0xe99c9a['options']?_0xe99c9a[_0xd297('0x1e')][_0xd297('0x1f')]===undefined?!![]:![]:!![],'where':_0xe99c9a[_0xd297('0x1e')]?_0xe99c9a[_0xd297('0x1e')][_0xd297('0x20')]||null:null,'attributes':_0xe99c9a[_0xd297('0x1e')]?_0xe99c9a[_0xd297('0x1e')]['attributes']||null:null,'limit':_0xe99c9a[_0xd297('0x1e')]?_0xe99c9a[_0xd297('0x1e')][_0xd297('0x21')]||null:null,'include':_0xe99c9a[_0xd297('0x1e')]?_0xe99c9a[_0xd297('0x1e')][_0xd297('0x22')]?_[_0xd297('0x23')](_0xe99c9a[_0xd297('0x1e')]['include'],function(_0x7d8e26){return{'model':db[_0x7d8e26[_0xd297('0x24')]],'as':_0x7d8e26['as'],'attributes':_0x7d8e26[_0xd297('0x25')],'include':_0x7d8e26[_0xd297('0x22')]?_['map'](_0x7d8e26['include'],function(_0x54c4bf){return{'model':db[_0x54c4bf[_0xd297('0x24')]],'as':_0x54c4bf['as'],'attributes':_0x54c4bf[_0xd297('0x25')],'include':_0x54c4bf[_0xd297('0x22')]?_[_0xd297('0x23')](_0x54c4bf[_0xd297('0x22')],function(_0x48db45){return{'model':db[_0x48db45[_0xd297('0x24')]],'as':_0x48db45['as'],'attributes':_0x48db45[_0xd297('0x25')]};}):[]};}):[]};}):[]:[]})[_0xd297('0xf')](function(_0x573dff){logger[_0xd297('0x18')](_0xd297('0x1b'),_0xe99c9a);logger[_0xd297('0x12')](_0xd297('0x1b'),_0xe99c9a,JSON[_0xd297('0x14')](_0x573dff));_0x1ea975(_0x573dff);})[_0xd297('0x1a')](function(_0x1f6a42){logger[_0xd297('0x15')]('GetOpenchannelQueue',_0x1f6a42['message'],_0xe99c9a);_0x469f78(_0x2754cf[_0xd297('0x15')](0x1f4,_0x1f6a42[_0xd297('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x1503fc){var _0x4969b0=this;return new Promise(function(_0x213fe1,_0x1e9ce8){return db[_0xd297('0x1c')]['find']({'raw':_0x1503fc[_0xd297('0x1e')]?_0x1503fc[_0xd297('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1503fc['options']?_0x1503fc[_0xd297('0x1e')][_0xd297('0x20')]||null:null,'attributes':_0x1503fc[_0xd297('0x1e')]?_0x1503fc[_0xd297('0x1e')]['attributes']||null:null,'include':_0x1503fc[_0xd297('0x1e')]?_0x1503fc[_0xd297('0x1e')][_0xd297('0x22')]?_[_0xd297('0x23')](_0x1503fc[_0xd297('0x1e')][_0xd297('0x22')],function(_0xd3df14){return{'model':db[_0xd3df14[_0xd297('0x24')]],'as':_0xd3df14['as'],'attributes':_0xd3df14[_0xd297('0x25')],'include':_0xd3df14[_0xd297('0x22')]?_[_0xd297('0x23')](_0xd3df14[_0xd297('0x22')],function(_0x5b04c1){return{'model':db[_0x5b04c1[_0xd297('0x24')]],'as':_0x5b04c1['as'],'attributes':_0x5b04c1[_0xd297('0x25')],'include':_0x5b04c1['include']?_[_0xd297('0x23')](_0x5b04c1[_0xd297('0x22')],function(_0x4b5442){return{'model':db[_0x4b5442['model']],'as':_0x4b5442['as'],'attributes':_0x4b5442[_0xd297('0x25')]};}):[]};}):[]};}):[]:[]})[_0xd297('0xf')](function(_0x354491){logger[_0xd297('0x18')](_0xd297('0x26'),_0x1503fc);logger['debug'](_0xd297('0x26'),_0x1503fc,JSON['stringify'](_0x354491));_0x213fe1(_0x354491);})['catch'](function(_0x17afa6){logger[_0xd297('0x15')]('ShowOpenchannelQueue',_0x17afa6[_0xd297('0x17')],_0x1503fc);_0x1e9ce8(_0x4969b0[_0xd297('0x15')](0x1f4,_0x17afa6[_0xd297('0x17')]));});});}; \ No newline at end of file +var _0x6cd2=['./openchannelQueue.socket','request','then','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueue,\x20%s,\x20%s','message','info','request\x20sent','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','include','map','model','attributes','stringify','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x21abb8,_0x5aa081){var _0xc4bc19=function(_0x26b1ae){while(--_0x26b1ae){_0x21abb8['push'](_0x21abb8['shift']());}};_0xc4bc19(++_0x5aa081);}(_0x6cd2,0x1e8));var _0x26cd=function(_0x3b717f,_0x2f7f66){_0x3b717f=_0x3b717f-0x0;var _0xbd14e5=_0x6cd2[_0x3b717f];return _0xbd14e5;};'use strict';var _=require(_0x26cd('0x0'));var util=require(_0x26cd('0x1'));var moment=require(_0x26cd('0x2'));var BPromise=require(_0x26cd('0x3'));var rs=require(_0x26cd('0x4'));var fs=require('fs');var Redis=require(_0x26cd('0x5'));var db=require(_0x26cd('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x26cd('0x7'))(_0x26cd('0x8'));var config=require(_0x26cd('0x9'));var jayson=require(_0x26cd('0xa'));var client=jayson[_0x26cd('0xb')][_0x26cd('0xc')]({'port':0x232a});config[_0x26cd('0xd')]=_['defaults'](config[_0x26cd('0xd')],{'host':_0x26cd('0xe'),'port':0x18eb});var socket=require(_0x26cd('0xf'))(new Redis(config[_0x26cd('0xd')]));require(_0x26cd('0x10'))['register'](socket);function respondWithRpcPromise(_0x506b63,_0x4d6c71,_0x5159c7){return new BPromise(function(_0x4fb561,_0x112aec){return client[_0x26cd('0x11')](_0x506b63,_0x5159c7)[_0x26cd('0x12')](function(_0x3cbc8e){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x4d6c71,'request\x20sent');logger[_0x26cd('0x13')](_0x26cd('0x14'),_0x4d6c71,'request\x20sent',JSON['stringify'](_0x3cbc8e));if(_0x3cbc8e[_0x26cd('0x15')]){if(_0x3cbc8e[_0x26cd('0x15')][_0x26cd('0x16')]===0x1f4){logger['error'](_0x26cd('0x17'),_0x4d6c71,_0x3cbc8e['error'][_0x26cd('0x18')]);return _0x112aec(_0x3cbc8e[_0x26cd('0x15')]['message']);}logger['error'](_0x26cd('0x17'),_0x4d6c71,_0x3cbc8e['error'][_0x26cd('0x18')]);return _0x4fb561(_0x3cbc8e[_0x26cd('0x15')][_0x26cd('0x18')]);}else{logger[_0x26cd('0x19')](_0x26cd('0x17'),_0x4d6c71,_0x26cd('0x1a'));_0x4fb561(_0x3cbc8e[_0x26cd('0x1b')][_0x26cd('0x18')]);}})[_0x26cd('0x1c')](function(_0x3def04){logger[_0x26cd('0x15')](_0x26cd('0x17'),_0x4d6c71,_0x3def04);_0x112aec(_0x3def04);});});}exports[_0x26cd('0x1d')]=function(_0x2f28a6){var _0x2d2cf3=this;return new Promise(function(_0x58af2f,_0x54a510){return db[_0x26cd('0x1e')][_0x26cd('0x1f')]({'raw':_0x2f28a6[_0x26cd('0x20')]?_0x2f28a6[_0x26cd('0x20')][_0x26cd('0x21')]===undefined?!![]:![]:!![],'where':_0x2f28a6['options']?_0x2f28a6[_0x26cd('0x20')][_0x26cd('0x22')]||null:null,'attributes':_0x2f28a6['options']?_0x2f28a6['options']['attributes']||null:null,'limit':_0x2f28a6[_0x26cd('0x20')]?_0x2f28a6[_0x26cd('0x20')]['limit']||null:null,'include':_0x2f28a6[_0x26cd('0x20')]?_0x2f28a6['options'][_0x26cd('0x23')]?_[_0x26cd('0x24')](_0x2f28a6['options'][_0x26cd('0x23')],function(_0x3db9f2){return{'model':db[_0x3db9f2[_0x26cd('0x25')]],'as':_0x3db9f2['as'],'attributes':_0x3db9f2[_0x26cd('0x26')],'include':_0x3db9f2[_0x26cd('0x23')]?_[_0x26cd('0x24')](_0x3db9f2[_0x26cd('0x23')],function(_0x1a2525){return{'model':db[_0x1a2525[_0x26cd('0x25')]],'as':_0x1a2525['as'],'attributes':_0x1a2525[_0x26cd('0x26')],'include':_0x1a2525[_0x26cd('0x23')]?_[_0x26cd('0x24')](_0x1a2525[_0x26cd('0x23')],function(_0x48f958){return{'model':db[_0x48f958[_0x26cd('0x25')]],'as':_0x48f958['as'],'attributes':_0x48f958[_0x26cd('0x26')]};}):[]};}):[]};}):[]:[]})[_0x26cd('0x12')](function(_0xd3d3e5){logger['info']('GetOpenchannelQueue',_0x2f28a6);logger[_0x26cd('0x13')](_0x26cd('0x1d'),_0x2f28a6,JSON[_0x26cd('0x27')](_0xd3d3e5));_0x58af2f(_0xd3d3e5);})[_0x26cd('0x1c')](function(_0x18263b){logger[_0x26cd('0x15')](_0x26cd('0x1d'),_0x18263b[_0x26cd('0x18')],_0x2f28a6);_0x54a510(_0x2d2cf3[_0x26cd('0x15')](0x1f4,_0x18263b['message']));});});};exports[_0x26cd('0x28')]=function(_0xc49fff){var _0x279b4a=this;return new Promise(function(_0x4662d4,_0x5043e1){return db[_0x26cd('0x1e')][_0x26cd('0x29')]({'raw':_0xc49fff[_0x26cd('0x20')]?_0xc49fff['options']['raw']===undefined?!![]:![]:!![],'where':_0xc49fff[_0x26cd('0x20')]?_0xc49fff['options']['where']||null:null,'attributes':_0xc49fff[_0x26cd('0x20')]?_0xc49fff[_0x26cd('0x20')][_0x26cd('0x26')]||null:null,'include':_0xc49fff[_0x26cd('0x20')]?_0xc49fff[_0x26cd('0x20')][_0x26cd('0x23')]?_[_0x26cd('0x24')](_0xc49fff[_0x26cd('0x20')][_0x26cd('0x23')],function(_0x8bbf3){return{'model':db[_0x8bbf3[_0x26cd('0x25')]],'as':_0x8bbf3['as'],'attributes':_0x8bbf3['attributes'],'include':_0x8bbf3[_0x26cd('0x23')]?_[_0x26cd('0x24')](_0x8bbf3[_0x26cd('0x23')],function(_0x10ea19){return{'model':db[_0x10ea19['model']],'as':_0x10ea19['as'],'attributes':_0x10ea19[_0x26cd('0x26')],'include':_0x10ea19[_0x26cd('0x23')]?_[_0x26cd('0x24')](_0x10ea19[_0x26cd('0x23')],function(_0x450702){return{'model':db[_0x450702[_0x26cd('0x25')]],'as':_0x450702['as'],'attributes':_0x450702[_0x26cd('0x26')]};}):[]};}):[]};}):[]:[]})[_0x26cd('0x12')](function(_0x115b4a){logger[_0x26cd('0x19')]('ShowOpenchannelQueue',_0xc49fff);logger[_0x26cd('0x13')]('ShowOpenchannelQueue',_0xc49fff,JSON[_0x26cd('0x27')](_0x115b4a));_0x4662d4(_0x115b4a);})['catch'](function(_0x508ba5){logger[_0x26cd('0x15')](_0x26cd('0x28'),_0x508ba5[_0x26cd('0x18')],_0xc49fff);_0x5043e1(_0x279b4a[_0x26cd('0x15')](0x1f4,_0x508ba5['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index b5d176f..d919378 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 _0x4b31=['length','openchannelQueue:','save','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b31,0x1e5));var _0x14b3=function(_0x119f6a,_0x594d77){_0x119f6a=_0x119f6a-0x0;var _0x4c00a3=_0x4b31[_0x119f6a];return _0x4c00a3;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x14b3('0x0'),'remove',_0x14b3('0x1')];function createListener(_0x399723,_0x210b46){return function(_0x1e0bfa){_0x210b46[_0x14b3('0x2')](_0x399723,_0x1e0bfa);};}function removeListener(_0x264af7,_0x172457){return function(){OpenchannelQueueEvents[_0x14b3('0x3')](_0x264af7,_0x172457);};}exports[_0x14b3('0x4')]=function(_0x9f9585){for(var _0x14188d=0x0,_0x4c31cf=events[_0x14b3('0x5')];_0x14188d<_0x4c31cf;_0x14188d++){var _0x39aa6e=events[_0x14188d];var _0x2ad301=createListener(_0x14b3('0x6')+_0x39aa6e,_0x9f9585);OpenchannelQueueEvents['on'](_0x39aa6e,_0x2ad301);}}; \ No newline at end of file +var _0xd567=['register','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x59c326,_0x32ad05){var _0x569205=function(_0x4272a3){while(--_0x4272a3){_0x59c326['push'](_0x59c326['shift']());}};_0x569205(++_0x32ad05);}(_0xd567,0x9a));var _0x7d56=function(_0x4263b2,_0x37397b){_0x4263b2=_0x4263b2-0x0;var _0x5496cf=_0xd567[_0x4263b2];return _0x5496cf;};'use strict';var OpenchannelQueueEvents=require(_0x7d56('0x0'));var events=[_0x7d56('0x1'),_0x7d56('0x2'),_0x7d56('0x3')];function createListener(_0x99f4a3,_0x21cb43){return function(_0x24b712){_0x21cb43[_0x7d56('0x4')](_0x99f4a3,_0x24b712);};}function removeListener(_0x25fb55,_0x3c4144){return function(){OpenchannelQueueEvents[_0x7d56('0x5')](_0x25fb55,_0x3c4144);};}exports[_0x7d56('0x6')]=function(_0xf493a1){for(var _0x320bee=0x0,_0x17a851=events['length'];_0x320bee<_0x17a851;_0x320bee++){var _0x1385b2=events[_0x320bee];var _0x1d6d82=createListener(_0x7d56('0x7')+_0x1385b2,_0xf493a1);OpenchannelQueueEvents['on'](_0x1385b2,_0x1d6d82);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index a89e7d2..b7b769d 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 _0x5f0f=['../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','delete','destroy','exports','util','express','Router','../../components/auth/service'];(function(_0xa5cc56,_0x482df1){var _0x52b569=function(_0x34be4c){while(--_0x34be4c){_0xa5cc56['push'](_0xa5cc56['shift']());}};_0x52b569(++_0x482df1);}(_0x5f0f,0xe6));var _0xf5f0=function(_0x866e1c,_0x549974){_0x866e1c=_0x866e1c-0x0;var _0x59697e=_0x5f0f[_0x866e1c];return _0x59697e;};'use strict';var multer=require('multer');var util=require(_0xf5f0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf5f0('0x1'));var router=express[_0xf5f0('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf5f0('0x3'));var interaction=require(_0xf5f0('0x4'));var config=require(_0xf5f0('0x5'));var controller=require(_0xf5f0('0x6'));router[_0xf5f0('0x7')]('/',auth[_0xf5f0('0x8')](),controller[_0xf5f0('0x9')]);router[_0xf5f0('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xf5f0('0xa')]);router[_0xf5f0('0x7')](_0xf5f0('0xb'),auth[_0xf5f0('0x8')](),controller['show']);router[_0xf5f0('0xc')]('/',auth[_0xf5f0('0x8')](),controller[_0xf5f0('0xd')]);router[_0xf5f0('0xe')](_0xf5f0('0xb'),auth[_0xf5f0('0x8')](),controller['update']);router[_0xf5f0('0xf')](_0xf5f0('0xb'),auth[_0xf5f0('0x8')](),controller[_0xf5f0('0x10')]);module[_0xf5f0('0x11')]=router; \ No newline at end of file +var _0xbd81=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','describe','/:id','create','put','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1405f0,_0xb29c8d){var _0xeefa91=function(_0x14db58){while(--_0x14db58){_0x1405f0['push'](_0x1405f0['shift']());}};_0xeefa91(++_0xb29c8d);}(_0xbd81,0x12a));var _0x1bd8=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xbd81[_0x279d37];return _0x530173;};'use strict';var multer=require(_0x1bd8('0x0'));var util=require(_0x1bd8('0x1'));var path=require(_0x1bd8('0x2'));var timeout=require(_0x1bd8('0x3'));var express=require(_0x1bd8('0x4'));var router=express[_0x1bd8('0x5')]();var fs_extra=require(_0x1bd8('0x6'));var auth=require(_0x1bd8('0x7'));var interaction=require(_0x1bd8('0x8'));var config=require(_0x1bd8('0x9'));var controller=require(_0x1bd8('0xa'));router[_0x1bd8('0xb')]('/',auth[_0x1bd8('0xc')](),controller['index']);router[_0x1bd8('0xb')]('/describe',auth[_0x1bd8('0xc')](),controller[_0x1bd8('0xd')]);router[_0x1bd8('0xb')](_0x1bd8('0xe'),auth[_0x1bd8('0xc')](),controller['show']);router['post']('/',auth[_0x1bd8('0xc')](),controller[_0x1bd8('0xf')]);router[_0x1bd8('0x10')](_0x1bd8('0xe'),auth['isAuthenticated'](),controller[_0x1bd8('0x11')]);router['delete'](_0x1bd8('0xe'),auth[_0x1bd8('0xc')](),controller['destroy']);module[_0x1bd8('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index e51ecee..8f51030 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 _0xb7ff=['STRING','DATE','moment','exports'];(function(_0x545386,_0x23ea8e){var _0x310535=function(_0x479dd1){while(--_0x479dd1){_0x545386['push'](_0x545386['shift']());}};_0x310535(++_0x23ea8e);}(_0xb7ff,0x6e));var _0xfb7f=function(_0x40ae17,_0x423978){_0x40ae17=_0x40ae17-0x0;var _0x5b0efe=_0xb7ff[_0x40ae17];return _0x5b0efe;};'use strict';var moment=require(_0xfb7f('0x0'));var Sequelize=require('sequelize');module[_0xfb7f('0x1')]={'uniqueid':{'type':Sequelize[_0xfb7f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xfb7f('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfb7f('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfb7f('0x3')]},'reason':{'type':Sequelize[_0xfb7f('0x2')]}}; \ No newline at end of file +var _0x1ed0=['STRING','DATE','exports'];(function(_0x4dfc7,_0x29b28a){var _0x169c2d=function(_0x4ebdbf){while(--_0x4ebdbf){_0x4dfc7['push'](_0x4dfc7['shift']());}};_0x169c2d(++_0x29b28a);}(_0x1ed0,0x1d6));var _0x01ed=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x1ed0[_0x15b399];return _0x199f2d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x01ed('0x0')]={'uniqueid':{'type':Sequelize[_0x01ed('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x01ed('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x01ed('0x2')]},'acceptAt':{'type':Sequelize[_0x01ed('0x2')]},'exitAt':{'type':Sequelize[_0x01ed('0x2')]},'reason':{'type':Sequelize[_0x01ed('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 1df263e..7ddccbb 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 _0x8e02=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','sendStatus','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','filters','intersection','attributes','query','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','then','include','rows','catch','show','keys','fields','create','body','find','params','describe','eml-format'];(function(_0x4614fc,_0x379a38){var _0x103023=function(_0x4b27ca){while(--_0x4b27ca){_0x4614fc['push'](_0x4614fc['shift']());}};_0x103023(++_0x379a38);}(_0x8e02,0x176));var _0x28e0=function(_0x47ffcb,_0x11a91f){_0x47ffcb=_0x47ffcb-0x0;var _0x290416=_0x8e02[_0x47ffcb];return _0x290416;};'use strict';var emlformat=require(_0x28e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x28e0('0x1'));var jsonpatch=require(_0x28e0('0x2'));var rp=require(_0x28e0('0x3'));var moment=require(_0x28e0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x28e0('0x5'));var util=require(_0x28e0('0x6'));var path=require(_0x28e0('0x7'));var sox=require(_0x28e0('0x8'));var csv=require(_0x28e0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28e0('0xa'));var _=require(_0x28e0('0xb'));var squel=require(_0x28e0('0xc'));var crypto=require(_0x28e0('0xd'));var jsforce=require(_0x28e0('0xe'));var deskjs=require(_0x28e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x28e0('0x10'));var Papa=require(_0x28e0('0x11'));var Redis=require(_0x28e0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x28e0('0x13'));var as=require(_0x28e0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28e0('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x28e0('0x16'));var db=require(_0x28e0('0x17'))['db'];function respondWithStatusCode(_0x35fe27,_0x114081){_0x114081=_0x114081||0xcc;return function(_0x210ec6){if(_0x210ec6){return _0x35fe27['sendStatus'](_0x114081);}return _0x35fe27[_0x28e0('0x18')](_0x114081)[_0x28e0('0x19')]();};}function respondWithResult(_0x3c2507,_0x3f326c){_0x3f326c=_0x3f326c||0xc8;return function(_0x5edeac){if(_0x5edeac){return _0x3c2507[_0x28e0('0x18')](_0x3f326c)[_0x28e0('0x1a')](_0x5edeac);}};}function respondWithFilteredResult(_0x30f18f,_0x450364){return function(_0x19b633){if(_0x19b633){var _0x3b48c5=typeof _0x450364[_0x28e0('0x1b')]===_0x28e0('0x1c')&&typeof _0x450364['limit']==='undefined';var _0xf8a98f=_0x19b633[_0x28e0('0x1d')];var _0x270cae=_0x3b48c5?0x0:_0x450364['offset'];var _0x5c3ddf=_0x3b48c5?_0x19b633[_0x28e0('0x1d')]:_0x450364[_0x28e0('0x1b')]+_0x450364['limit'];var _0x279048;if(_0x5c3ddf>=_0xf8a98f){_0x5c3ddf=_0xf8a98f;_0x279048=0xc8;}else{_0x279048=0xce;}_0x30f18f[_0x28e0('0x18')](_0x279048);return _0x30f18f[_0x28e0('0x1e')](_0x28e0('0x1f'),_0x270cae+'-'+_0x5c3ddf+'/'+_0xf8a98f)[_0x28e0('0x1a')](_0x19b633);}return null;};}function patchUpdates(_0x1edcd9){return function(_0x4652c9){try{jsonpatch[_0x28e0('0x20')](_0x4652c9,_0x1edcd9,!![]);}catch(_0x5abd5b){return BPromise[_0x28e0('0x21')](_0x5abd5b);}return _0x4652c9[_0x28e0('0x22')]();};}function saveUpdates(_0x18ce7d,_0x5a5daa){return function(_0x210dbf){if(_0x210dbf){return _0x210dbf['update'](_0x18ce7d)['then'](function(_0x24c4a2){return _0x24c4a2;});}return null;};}function removeEntity(_0x283aed,_0x68ec08){return function(_0x45b8f3){if(_0x45b8f3){return _0x45b8f3[_0x28e0('0x23')]()['then'](function(){_0x283aed[_0x28e0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2df361,_0xac9057){return function(_0x3bffc2){if(!_0x3bffc2){_0x2df361[_0x28e0('0x24')](0x194);}return _0x3bffc2;};}function handleError(_0x5cc3b7,_0x13c8ed){_0x13c8ed=_0x13c8ed||0x1f4;return function(_0x25eed1){logger[_0x28e0('0x25')](_0x25eed1[_0x28e0('0x26')]);if(_0x25eed1[_0x28e0('0x27')]){delete _0x25eed1[_0x28e0('0x27')];}_0x5cc3b7[_0x28e0('0x18')](_0x13c8ed)['send'](_0x25eed1);};}exports[_0x28e0('0x28')]=function(_0x2ef604,_0x255f69){var _0x5a9358={},_0x5cbcac={},_0x9eaf2a={'count':0x0,'rows':[]};var _0x3cc3bf=_[_0x28e0('0x29')](db[_0x28e0('0x2a')][_0x28e0('0x2b')],function(_0xc048dd){return{'name':_0xc048dd[_0x28e0('0x2c')],'type':_0xc048dd[_0x28e0('0x2d')][_0x28e0('0x2e')]};});_0x5cbcac[_0x28e0('0x2f')]=_[_0x28e0('0x29')](_0x3cc3bf,_0x28e0('0x27'));_0x5cbcac['query']=_['keys'](_0x2ef604['query']);_0x5cbcac[_0x28e0('0x30')]=_[_0x28e0('0x31')](_0x5cbcac[_0x28e0('0x2f')],_0x5cbcac['query']);_0x5a9358[_0x28e0('0x32')]=_[_0x28e0('0x31')](_0x5cbcac[_0x28e0('0x2f')],qs['fields'](_0x2ef604[_0x28e0('0x33')]['fields']));_0x5a9358[_0x28e0('0x32')]=_0x5a9358[_0x28e0('0x32')][_0x28e0('0x34')]?_0x5a9358['attributes']:_0x5cbcac[_0x28e0('0x2f')];if(!_0x2ef604[_0x28e0('0x33')][_0x28e0('0x35')](_0x28e0('0x36'))){_0x5a9358[_0x28e0('0x37')]=qs[_0x28e0('0x37')](_0x2ef604[_0x28e0('0x33')]['limit']);_0x5a9358[_0x28e0('0x1b')]=qs['offset'](_0x2ef604[_0x28e0('0x33')][_0x28e0('0x1b')]);}_0x5a9358[_0x28e0('0x38')]=qs[_0x28e0('0x39')](_0x2ef604[_0x28e0('0x33')]['sort']);_0x5a9358[_0x28e0('0x3a')]=qs[_0x28e0('0x30')](_['pick'](_0x2ef604[_0x28e0('0x33')],_0x5cbcac[_0x28e0('0x30')]),_0x3cc3bf);if(_0x2ef604[_0x28e0('0x33')][_0x28e0('0x3b')]){_0x5a9358['where']=_[_0x28e0('0x3c')](_0x5a9358['where'],{'$or':_['map'](_0x3cc3bf,function(_0x119f19){if(_0x119f19[_0x28e0('0x2d')]!==_0x28e0('0x3d')){var _0x2fb32a={};_0x2fb32a[_0x119f19['name']]={'$like':'%'+_0x2ef604[_0x28e0('0x33')]['filter']+'%'};return _0x2fb32a;}})});}_0x5a9358=_['merge']({},_0x5a9358,_0x2ef604[_0x28e0('0x3e')]);var _0x551dd3={'where':_0x5a9358['where']};return db[_0x28e0('0x2a')][_0x28e0('0x1d')](_0x551dd3)[_0x28e0('0x3f')](function(_0x4db9bc){_0x9eaf2a[_0x28e0('0x1d')]=_0x4db9bc;if(_0x2ef604['query']['includeAll']){_0x5a9358[_0x28e0('0x40')]=[{'all':!![]}];}return db[_0x28e0('0x2a')]['findAll'](_0x5a9358);})['then'](function(_0x1ee111){_0x9eaf2a[_0x28e0('0x41')]=_0x1ee111;return _0x9eaf2a;})[_0x28e0('0x3f')](respondWithFilteredResult(_0x255f69,_0x5a9358))[_0x28e0('0x42')](handleError(_0x255f69,null));};exports[_0x28e0('0x43')]=function(_0x38cb9e,_0x5f0f80){var _0x4aec3e={'raw':!![],'where':{'id':_0x38cb9e['params']['id']}},_0x54dbf4={};_0x54dbf4[_0x28e0('0x2f')]=_[_0x28e0('0x44')](db[_0x28e0('0x2a')][_0x28e0('0x2b')]);_0x54dbf4[_0x28e0('0x33')]=_[_0x28e0('0x44')](_0x38cb9e[_0x28e0('0x33')]);_0x54dbf4[_0x28e0('0x30')]=_[_0x28e0('0x31')](_0x54dbf4[_0x28e0('0x2f')],_0x54dbf4[_0x28e0('0x33')]);_0x4aec3e['attributes']=_['intersection'](_0x54dbf4['model'],qs['fields'](_0x38cb9e['query'][_0x28e0('0x45')]));_0x4aec3e[_0x28e0('0x32')]=_0x4aec3e[_0x28e0('0x32')][_0x28e0('0x34')]?_0x4aec3e[_0x28e0('0x32')]:_0x54dbf4['model'];if(_0x38cb9e[_0x28e0('0x33')]['includeAll']){_0x4aec3e[_0x28e0('0x40')]=[{'all':!![]}];}_0x4aec3e=_[_0x28e0('0x3c')]({},_0x4aec3e,_0x38cb9e[_0x28e0('0x3e')]);return db[_0x28e0('0x2a')]['find'](_0x4aec3e)[_0x28e0('0x3f')](handleEntityNotFound(_0x5f0f80,null))[_0x28e0('0x3f')](respondWithResult(_0x5f0f80,null))[_0x28e0('0x42')](handleError(_0x5f0f80,null));};exports[_0x28e0('0x46')]=function(_0x3b495c,_0x4141ca){return db['OpenchannelQueueReport'][_0x28e0('0x46')](_0x3b495c[_0x28e0('0x47')],{})[_0x28e0('0x3f')](respondWithResult(_0x4141ca,0xc9))[_0x28e0('0x42')](handleError(_0x4141ca,null));};exports['update']=function(_0x3a00ac,_0x1e0013){if(_0x3a00ac[_0x28e0('0x47')]['id']){delete _0x3a00ac[_0x28e0('0x47')]['id'];}return db[_0x28e0('0x2a')][_0x28e0('0x48')]({'where':{'id':_0x3a00ac[_0x28e0('0x49')]['id']}})[_0x28e0('0x3f')](handleEntityNotFound(_0x1e0013,null))['then'](saveUpdates(_0x3a00ac[_0x28e0('0x47')],null))[_0x28e0('0x3f')](respondWithResult(_0x1e0013,null))['catch'](handleError(_0x1e0013,null));};exports['destroy']=function(_0x176e49,_0x4f9b0e){return db['OpenchannelQueueReport'][_0x28e0('0x48')]({'where':{'id':_0x176e49['params']['id']}})[_0x28e0('0x3f')](handleEntityNotFound(_0x4f9b0e,null))[_0x28e0('0x3f')](removeEntity(_0x4f9b0e,null))[_0x28e0('0x42')](handleError(_0x4f9b0e,null));};exports[_0x28e0('0x4a')]=function(_0x322c34,_0x1028db){return db[_0x28e0('0x2a')][_0x28e0('0x4a')]()['then'](respondWithResult(_0x1028db,null))[_0x28e0('0x42')](handleError(_0x1028db,null));}; \ No newline at end of file +var _0x1aee=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','OpenchannelQueueReport','fieldName','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1aee,0x10e));var _0xe1ae=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0x1aee[_0x289e64];return _0x30246c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe1ae('0x0'));var zipdir=require(_0xe1ae('0x1'));var jsonpatch=require(_0xe1ae('0x2'));var rp=require('request-promise');var moment=require(_0xe1ae('0x3'));var BPromise=require(_0xe1ae('0x4'));var Mustache=require(_0xe1ae('0x5'));var util=require(_0xe1ae('0x6'));var path=require(_0xe1ae('0x7'));var sox=require('sox');var csv=require(_0xe1ae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe1ae('0x9'));var _=require('lodash');var squel=require(_0xe1ae('0xa'));var crypto=require('crypto');var jsforce=require(_0xe1ae('0xb'));var deskjs=require(_0xe1ae('0xc'));var toCsv=require(_0xe1ae('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe1ae('0xd'));var authService=require(_0xe1ae('0xe'));var qs=require(_0xe1ae('0xf'));var as=require(_0xe1ae('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe1ae('0x11'));var utils=require(_0xe1ae('0x12'));var config=require(_0xe1ae('0x13'));var licenseUtil=require(_0xe1ae('0x14'));var db=require(_0xe1ae('0x15'))['db'];function respondWithStatusCode(_0x4ed88b,_0xfe1d3){_0xfe1d3=_0xfe1d3||0xcc;return function(_0x2c4002){if(_0x2c4002){return _0x4ed88b[_0xe1ae('0x16')](_0xfe1d3);}return _0x4ed88b[_0xe1ae('0x17')](_0xfe1d3)[_0xe1ae('0x18')]();};}function respondWithResult(_0xcf93ea,_0xec4a3d){_0xec4a3d=_0xec4a3d||0xc8;return function(_0x45b425){if(_0x45b425){return _0xcf93ea['status'](_0xec4a3d)[_0xe1ae('0x19')](_0x45b425);}};}function respondWithFilteredResult(_0x2bff3d,_0x5f2ae3){return function(_0x24485a){if(_0x24485a){var _0x252b2c=typeof _0x5f2ae3['offset']===_0xe1ae('0x1a')&&typeof _0x5f2ae3[_0xe1ae('0x1b')]===_0xe1ae('0x1a');var _0x1da14a=_0x24485a[_0xe1ae('0x1c')];var _0x33d89f=_0x252b2c?0x0:_0x5f2ae3[_0xe1ae('0x1d')];var _0x591ab2=_0x252b2c?_0x24485a[_0xe1ae('0x1c')]:_0x5f2ae3[_0xe1ae('0x1d')]+_0x5f2ae3[_0xe1ae('0x1b')];var _0x584052;if(_0x591ab2>=_0x1da14a){_0x591ab2=_0x1da14a;_0x584052=0xc8;}else{_0x584052=0xce;}_0x2bff3d[_0xe1ae('0x17')](_0x584052);return _0x2bff3d[_0xe1ae('0x1e')](_0xe1ae('0x1f'),_0x33d89f+'-'+_0x591ab2+'/'+_0x1da14a)['json'](_0x24485a);}return null;};}function patchUpdates(_0x36d8d7){return function(_0x235867){try{jsonpatch[_0xe1ae('0x20')](_0x235867,_0x36d8d7,!![]);}catch(_0x1dcead){return BPromise[_0xe1ae('0x21')](_0x1dcead);}return _0x235867[_0xe1ae('0x22')]();};}function saveUpdates(_0x9ebdf9,_0x1edfe0){return function(_0x49e820){if(_0x49e820){return _0x49e820[_0xe1ae('0x23')](_0x9ebdf9)[_0xe1ae('0x24')](function(_0x24cba){return _0x24cba;});}return null;};}function removeEntity(_0x2e0654,_0x25c8f3){return function(_0x55037f){if(_0x55037f){return _0x55037f[_0xe1ae('0x25')]()['then'](function(){_0x2e0654[_0xe1ae('0x17')](0xcc)[_0xe1ae('0x18')]();});}};}function handleEntityNotFound(_0xf2a10f,_0x2fb9a1){return function(_0x5414bf){if(!_0x5414bf){_0xf2a10f[_0xe1ae('0x16')](0x194);}return _0x5414bf;};}function handleError(_0x36a76f,_0x568600){_0x568600=_0x568600||0x1f4;return function(_0x60a9f1){logger[_0xe1ae('0x26')](_0x60a9f1['stack']);if(_0x60a9f1['name']){delete _0x60a9f1[_0xe1ae('0x27')];}_0x36a76f[_0xe1ae('0x17')](_0x568600)['send'](_0x60a9f1);};}exports[_0xe1ae('0x28')]=function(_0x683fa0,_0x343224){var _0x4b93eb={},_0x485a50={},_0x40cb1c={'count':0x0,'rows':[]};var _0x191d50=_['map'](db[_0xe1ae('0x29')]['rawAttributes'],function(_0x660a71){return{'name':_0x660a71[_0xe1ae('0x2a')],'type':_0x660a71[_0xe1ae('0x2b')]['key']};});_0x485a50['model']=_[_0xe1ae('0x2c')](_0x191d50,_0xe1ae('0x27'));_0x485a50[_0xe1ae('0x2d')]=_[_0xe1ae('0x2e')](_0x683fa0[_0xe1ae('0x2d')]);_0x485a50[_0xe1ae('0x2f')]=_[_0xe1ae('0x30')](_0x485a50[_0xe1ae('0x31')],_0x485a50['query']);_0x4b93eb['attributes']=_[_0xe1ae('0x30')](_0x485a50['model'],qs[_0xe1ae('0x32')](_0x683fa0[_0xe1ae('0x2d')][_0xe1ae('0x32')]));_0x4b93eb['attributes']=_0x4b93eb[_0xe1ae('0x33')][_0xe1ae('0x34')]?_0x4b93eb[_0xe1ae('0x33')]:_0x485a50[_0xe1ae('0x31')];if(!_0x683fa0[_0xe1ae('0x2d')][_0xe1ae('0x35')](_0xe1ae('0x36'))){_0x4b93eb[_0xe1ae('0x1b')]=qs['limit'](_0x683fa0['query']['limit']);_0x4b93eb[_0xe1ae('0x1d')]=qs[_0xe1ae('0x1d')](_0x683fa0['query'][_0xe1ae('0x1d')]);}_0x4b93eb[_0xe1ae('0x37')]=qs['sort'](_0x683fa0['query']['sort']);_0x4b93eb['where']=qs[_0xe1ae('0x2f')](_['pick'](_0x683fa0['query'],_0x485a50[_0xe1ae('0x2f')]),_0x191d50);if(_0x683fa0[_0xe1ae('0x2d')][_0xe1ae('0x38')]){_0x4b93eb[_0xe1ae('0x39')]=_[_0xe1ae('0x3a')](_0x4b93eb[_0xe1ae('0x39')],{'$or':_[_0xe1ae('0x2c')](_0x191d50,function(_0xd193fe){if(_0xd193fe['type']!==_0xe1ae('0x3b')){var _0x371c3c={};_0x371c3c[_0xd193fe[_0xe1ae('0x27')]]={'$like':'%'+_0x683fa0[_0xe1ae('0x2d')]['filter']+'%'};return _0x371c3c;}})});}_0x4b93eb=_['merge']({},_0x4b93eb,_0x683fa0[_0xe1ae('0x3c')]);var _0x26ea87={'where':_0x4b93eb['where']};return db[_0xe1ae('0x29')][_0xe1ae('0x1c')](_0x26ea87)['then'](function(_0x32f84d){_0x40cb1c['count']=_0x32f84d;if(_0x683fa0['query'][_0xe1ae('0x3d')]){_0x4b93eb[_0xe1ae('0x3e')]=[{'all':!![]}];}return db[_0xe1ae('0x29')][_0xe1ae('0x3f')](_0x4b93eb);})[_0xe1ae('0x24')](function(_0x32fa7a){_0x40cb1c[_0xe1ae('0x40')]=_0x32fa7a;return _0x40cb1c;})[_0xe1ae('0x24')](respondWithFilteredResult(_0x343224,_0x4b93eb))[_0xe1ae('0x41')](handleError(_0x343224,null));};exports[_0xe1ae('0x42')]=function(_0x2e5b2e,_0x552dd3){var _0x36ce0b={'raw':!![],'where':{'id':_0x2e5b2e[_0xe1ae('0x43')]['id']}},_0x25a731={};_0x25a731[_0xe1ae('0x31')]=_[_0xe1ae('0x2e')](db[_0xe1ae('0x29')][_0xe1ae('0x44')]);_0x25a731[_0xe1ae('0x2d')]=_[_0xe1ae('0x2e')](_0x2e5b2e[_0xe1ae('0x2d')]);_0x25a731['filters']=_[_0xe1ae('0x30')](_0x25a731[_0xe1ae('0x31')],_0x25a731[_0xe1ae('0x2d')]);_0x36ce0b[_0xe1ae('0x33')]=_[_0xe1ae('0x30')](_0x25a731['model'],qs['fields'](_0x2e5b2e[_0xe1ae('0x2d')][_0xe1ae('0x32')]));_0x36ce0b[_0xe1ae('0x33')]=_0x36ce0b[_0xe1ae('0x33')]['length']?_0x36ce0b[_0xe1ae('0x33')]:_0x25a731[_0xe1ae('0x31')];if(_0x2e5b2e['query'][_0xe1ae('0x3d')]){_0x36ce0b[_0xe1ae('0x3e')]=[{'all':!![]}];}_0x36ce0b=_['merge']({},_0x36ce0b,_0x2e5b2e[_0xe1ae('0x3c')]);return db[_0xe1ae('0x29')][_0xe1ae('0x45')](_0x36ce0b)[_0xe1ae('0x24')](handleEntityNotFound(_0x552dd3,null))[_0xe1ae('0x24')](respondWithResult(_0x552dd3,null))['catch'](handleError(_0x552dd3,null));};exports['create']=function(_0x203757,_0x4e2088){return db[_0xe1ae('0x29')]['create'](_0x203757[_0xe1ae('0x46')],{})['then'](respondWithResult(_0x4e2088,0xc9))[_0xe1ae('0x41')](handleError(_0x4e2088,null));};exports[_0xe1ae('0x23')]=function(_0x4a8d4c,_0x4381e6){if(_0x4a8d4c[_0xe1ae('0x46')]['id']){delete _0x4a8d4c[_0xe1ae('0x46')]['id'];}return db[_0xe1ae('0x29')][_0xe1ae('0x45')]({'where':{'id':_0x4a8d4c[_0xe1ae('0x43')]['id']}})['then'](handleEntityNotFound(_0x4381e6,null))[_0xe1ae('0x24')](saveUpdates(_0x4a8d4c[_0xe1ae('0x46')],null))[_0xe1ae('0x24')](respondWithResult(_0x4381e6,null))[_0xe1ae('0x41')](handleError(_0x4381e6,null));};exports[_0xe1ae('0x25')]=function(_0x59a5cb,_0x3747cf){return db[_0xe1ae('0x29')][_0xe1ae('0x45')]({'where':{'id':_0x59a5cb[_0xe1ae('0x43')]['id']}})['then'](handleEntityNotFound(_0x3747cf,null))['then'](removeEntity(_0x3747cf,null))[_0xe1ae('0x41')](handleError(_0x3747cf,null));};exports['describe']=function(_0x519314,_0x52c75a){return db[_0xe1ae('0x29')][_0xe1ae('0x47')]()[_0xe1ae('0x24')](respondWithResult(_0x52c75a,null))[_0xe1ae('0x41')](handleError(_0x52c75a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 2e0c79b..956b51f 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 _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x268da9,_0x38e619){var _0x3670c4=function(_0x186b01){while(--_0x186b01){_0x268da9['push'](_0x268da9['shift']());}};_0x3670c4(++_0x38e619);}(_0x1261,0x144));var _0x1126=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x1261[_0x1e05c1];return _0x15f1ca;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x246500,_0x5e0e19){var _0x4ef559=function(_0x16b020){while(--_0x16b020){_0x246500['push'](_0x246500['shift']());}};_0x4ef559(++_0x5e0e19);}(_0xe14b,0x93));var _0xbe14=function(_0x42343b,_0x1e716a){_0x42343b=_0x42343b-0x0;var _0x5387e9=_0xe14b[_0x42343b];return _0x5387e9;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index f78e8b5..78e5f52 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 _0xa32b=['OpenchannelQueueReport','create','body','CreateOpenchannelQueueReport','stringify','options','raw','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x10b26f,_0x29dfe8){var _0x4acf85=function(_0x184d40){while(--_0x184d40){_0x10b26f['push'](_0x10b26f['shift']());}};_0x4acf85(++_0x29dfe8);}(_0xa32b,0x68));var _0xba32=function(_0x544b3f,_0x4d8b66){_0x544b3f=_0x544b3f-0x0;var _0x15787f=_0xa32b[_0x544b3f];return _0x15787f;};'use strict';var _=require(_0xba32('0x0'));var util=require('util');var moment=require(_0xba32('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba32('0x2'));var db=require(_0xba32('0x3'))['db'];var utils=require(_0xba32('0x4'));var logger=require('../../config/logger')(_0xba32('0x5'));var config=require(_0xba32('0x6'));var jayson=require(_0xba32('0x7'));var client=jayson[_0xba32('0x8')][_0xba32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c5a59,_0x1b1332,_0x4edbc6){return new BPromise(function(_0xcdcc5b,_0x13395b){return client[_0xba32('0xa')](_0x5c5a59,_0x4edbc6)[_0xba32('0xb')](function(_0x5d8f64){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b1332,'request\x20sent');logger[_0xba32('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x1b1332,_0xba32('0xd'),JSON['stringify'](_0x5d8f64));if(_0x5d8f64[_0xba32('0xe')]){if(_0x5d8f64['error']['code']===0x1f4){logger[_0xba32('0xe')](_0xba32('0xf'),_0x1b1332,_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);return _0x13395b(_0x5d8f64[_0xba32('0xe')]['message']);}logger[_0xba32('0xe')](_0xba32('0xf'),_0x1b1332,_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);return _0xcdcc5b(_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);}else{logger[_0xba32('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b1332,_0xba32('0xd'));_0xcdcc5b(_0x5d8f64[_0xba32('0x12')][_0xba32('0x10')]);}})[_0xba32('0x13')](function(_0x310dee){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b1332,_0x310dee);_0x13395b(_0x310dee);});});}exports['CreateOpenchannelQueueReport']=function(_0x5c3fe6){var _0x234db9=this;return new Promise(function(_0x1ae3ea,_0x42803d){return db[_0xba32('0x14')][_0xba32('0x15')](_0x5c3fe6[_0xba32('0x16')],{'raw':_0x5c3fe6['options']?_0x5c3fe6['options']['raw']===undefined?!![]:![]:!![]})[_0xba32('0xb')](function(_0x51c43a){logger[_0xba32('0x11')](_0xba32('0x17'),_0x5c3fe6);logger[_0xba32('0xc')](_0xba32('0x17'),_0x5c3fe6,JSON[_0xba32('0x18')](_0x51c43a));_0x1ae3ea(_0x51c43a);})[_0xba32('0x13')](function(_0xdfa807){logger['error'](_0xba32('0x17'),_0xdfa807[_0xba32('0x10')],_0x5c3fe6);_0x42803d(_0x234db9[_0xba32('0xe')](0x1f4,_0xdfa807[_0xba32('0x10')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x4b03a5){var _0x2f3318=this;return new Promise(function(_0x3a8f30,_0x4cfd59){return db[_0xba32('0x14')]['update'](_0x4b03a5[_0xba32('0x16')],{'raw':_0x4b03a5[_0xba32('0x19')]?_0x4b03a5[_0xba32('0x19')][_0xba32('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b03a5[_0xba32('0x19')]?_0x4b03a5[_0xba32('0x19')][_0xba32('0x1b')]||null:null,'attributes':_0x4b03a5['options']?_0x4b03a5[_0xba32('0x19')][_0xba32('0x1c')]||null:null,'limit':_0x4b03a5[_0xba32('0x19')]?_0x4b03a5[_0xba32('0x19')][_0xba32('0x1d')]||null:null})[_0xba32('0xb')](function(_0x27bc6f){logger[_0xba32('0x11')](_0xba32('0x1e'),_0x4b03a5);logger['debug'](_0xba32('0x1e'),_0x4b03a5,JSON[_0xba32('0x18')](_0x27bc6f));_0x3a8f30(_0x27bc6f);})[_0xba32('0x13')](function(_0x2a466e){logger[_0xba32('0xe')]('UpdateOpenchannelQueueReport',_0x2a466e[_0xba32('0x10')],_0x4b03a5);_0x4cfd59(_0x2f3318['error'](0x1f4,_0x2a466e[_0xba32('0x10')]));});});}; \ No newline at end of file +var _0xd5fc=['rpc','jayson/promise','http','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','create','body','options','CreateOpenchannelQueueReport','OpenchannelQueueReport','update','raw','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd5fc,0xae));var _0xcd5f=function(_0x52a9ae,_0x24f032){_0x52a9ae=_0x52a9ae-0x0;var _0x13896c=_0xd5fc[_0x52a9ae];return _0x13896c;};'use strict';var _=require(_0xcd5f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd5f('0x1'));var fs=require('fs');var Redis=require(_0xcd5f('0x2'));var db=require(_0xcd5f('0x3'))['db'];var utils=require(_0xcd5f('0x4'));var logger=require(_0xcd5f('0x5'))(_0xcd5f('0x6'));var config=require('../../config/environment');var jayson=require(_0xcd5f('0x7'));var client=jayson['client'][_0xcd5f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x159b3f,_0x5af696,_0x58d65d){return new BPromise(function(_0x4e668e,_0x102ce9){return client['request'](_0x159b3f,_0x58d65d)[_0xcd5f('0x9')](function(_0x3e63d4){logger['info'](_0xcd5f('0xa'),_0x5af696,'request\x20sent');logger[_0xcd5f('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x5af696,_0xcd5f('0xc'),JSON[_0xcd5f('0xd')](_0x3e63d4));if(_0x3e63d4[_0xcd5f('0xe')]){if(_0x3e63d4[_0xcd5f('0xe')]['code']===0x1f4){logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x3e63d4['error'][_0xcd5f('0xf')]);return _0x102ce9(_0x3e63d4[_0xcd5f('0xe')][_0xcd5f('0xf')]);}logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x3e63d4['error'][_0xcd5f('0xf')]);return _0x4e668e(_0x3e63d4[_0xcd5f('0xe')][_0xcd5f('0xf')]);}else{logger[_0xcd5f('0x10')](_0xcd5f('0xa'),_0x5af696,_0xcd5f('0xc'));_0x4e668e(_0x3e63d4[_0xcd5f('0x11')]['message']);}})[_0xcd5f('0x12')](function(_0x33ab1a){logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x33ab1a);_0x102ce9(_0x33ab1a);});});}exports['CreateOpenchannelQueueReport']=function(_0x1a4cb6){var _0x56a874=this;return new Promise(function(_0xb23761,_0x36c60c){return db['OpenchannelQueueReport'][_0xcd5f('0x13')](_0x1a4cb6[_0xcd5f('0x14')],{'raw':_0x1a4cb6['options']?_0x1a4cb6[_0xcd5f('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xcd5f('0x9')](function(_0x5c3c9f){logger['info'](_0xcd5f('0x16'),_0x1a4cb6);logger['debug']('CreateOpenchannelQueueReport',_0x1a4cb6,JSON['stringify'](_0x5c3c9f));_0xb23761(_0x5c3c9f);})[_0xcd5f('0x12')](function(_0x5c03b9){logger[_0xcd5f('0xe')](_0xcd5f('0x16'),_0x5c03b9[_0xcd5f('0xf')],_0x1a4cb6);_0x36c60c(_0x56a874[_0xcd5f('0xe')](0x1f4,_0x5c03b9[_0xcd5f('0xf')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x388290){var _0x41015c=this;return new Promise(function(_0x4dc7ab,_0xba8e2e){return db[_0xcd5f('0x17')][_0xcd5f('0x18')](_0x388290[_0xcd5f('0x14')],{'raw':_0x388290[_0xcd5f('0x15')]?_0x388290[_0xcd5f('0x15')][_0xcd5f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x388290[_0xcd5f('0x15')]?_0x388290[_0xcd5f('0x15')][_0xcd5f('0x1a')]||null:null,'attributes':_0x388290[_0xcd5f('0x15')]?_0x388290[_0xcd5f('0x15')][_0xcd5f('0x1b')]||null:null,'limit':_0x388290[_0xcd5f('0x15')]?_0x388290['options'][_0xcd5f('0x1c')]||null:null})[_0xcd5f('0x9')](function(_0x561414){logger[_0xcd5f('0x10')]('UpdateOpenchannelQueueReport',_0x388290);logger[_0xcd5f('0xb')](_0xcd5f('0x1d'),_0x388290,JSON[_0xcd5f('0xd')](_0x561414));_0x4dc7ab(_0x561414);})[_0xcd5f('0x12')](function(_0xb56143){logger[_0xcd5f('0xe')]('UpdateOpenchannelQueueReport',_0xb56143['message'],_0x388290);_0xba8e2e(_0x41015c[_0xcd5f('0xe')](0x1f4,_0xb56143[_0xcd5f('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 876aa85..fc5747a 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 _0xc26e=['update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc26e,0x154));var _0xec26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xec26('0x0'));var util=require('util');var path=require(_0xec26('0x1'));var timeout=require(_0xec26('0x2'));var express=require(_0xec26('0x3'));var router=express['Router']();var fs_extra=require(_0xec26('0x4'));var auth=require(_0xec26('0x5'));var interaction=require(_0xec26('0x6'));var config=require(_0xec26('0x7'));var controller=require(_0xec26('0x8'));router['get']('/',auth[_0xec26('0x9')](),controller[_0xec26('0xa')]);router[_0xec26('0xb')]('/describe',auth[_0xec26('0x9')](),controller[_0xec26('0xc')]);router[_0xec26('0xb')](_0xec26('0xd'),auth[_0xec26('0x9')](),controller[_0xec26('0xe')]);router['post']('/',auth[_0xec26('0x9')](),controller[_0xec26('0xf')]);router[_0xec26('0x10')]('/:id',auth[_0xec26('0x9')](),controller[_0xec26('0x11')]);router[_0xec26('0x12')](_0xec26('0xd'),auth['isAuthenticated'](),controller[_0xec26('0x13')]);module[_0xec26('0x14')]=router; \ No newline at end of file +var _0xd198=['show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','get','/describe'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xd198,0xf9));var _0x8d19=function(_0x355f95,_0x369c0b){_0x355f95=_0x355f95-0x0;var _0x5e5db5=_0xd198[_0x355f95];return _0x5e5db5;};'use strict';var multer=require(_0x8d19('0x0'));var util=require(_0x8d19('0x1'));var path=require(_0x8d19('0x2'));var timeout=require(_0x8d19('0x3'));var express=require(_0x8d19('0x4'));var router=express[_0x8d19('0x5')]();var fs_extra=require(_0x8d19('0x6'));var auth=require(_0x8d19('0x7'));var interaction=require(_0x8d19('0x8'));var config=require(_0x8d19('0x9'));var controller=require(_0x8d19('0xa'));router['get']('/',auth[_0x8d19('0xb')](),controller[_0x8d19('0xc')]);router[_0x8d19('0xd')](_0x8d19('0xe'),auth[_0x8d19('0xb')](),controller['describe']);router['get']('/:id',auth[_0x8d19('0xb')](),controller[_0x8d19('0xf')]);router[_0x8d19('0x10')]('/',auth[_0x8d19('0xb')](),controller[_0x8d19('0x11')]);router[_0x8d19('0x12')](_0x8d19('0x13'),auth[_0x8d19('0xb')](),controller[_0x8d19('0x14')]);router['delete']('/:id',auth[_0x8d19('0xb')](),controller['destroy']);module[_0x8d19('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 03225bb..ad38ec6 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2d4a07,_0x2e1f4d){var _0x43f637=function(_0x2992cf){while(--_0x2992cf){_0x2d4a07['push'](_0x2d4a07['shift']());}};_0x43f637(++_0x2e1f4d);}(_0x34e8,0x12c));var _0x834e=function(_0x2aff7d,_0x456060){_0x2aff7d=_0x2aff7d-0x0;var _0x38c992=_0x34e8[_0x2aff7d];return _0x38c992;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x410488,_0x32b300){var _0x32ffc9=function(_0x369d22){while(--_0x369d22){_0x410488['push'](_0x410488['shift']());}};_0x32ffc9(++_0x32b300);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2a453b,_0x479c50){_0x2a453b=_0x2a453b-0x0;var _0x132f79=_0xf3cd[_0x2a453b];return _0x132f79;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index c0336db..32f8c68 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 _0x0e1a=['count','limit','Content-Range','apply','update','destroy','then','end','stack','name','send','index','map','OpenchannelTransferReport','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','options','includeAll','findAll','show','keys','rawAttributes','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x579674,_0x5a143d){var _0x17f68a=function(_0x5c9204){while(--_0x5c9204){_0x579674['push'](_0x579674['shift']());}};_0x17f68a(++_0x5a143d);}(_0x0e1a,0x1e1));var _0xa0e1=function(_0x91ec86,_0x3010f0){_0x91ec86=_0x91ec86-0x0;var _0x2ea58d=_0x0e1a[_0x91ec86];return _0x2ea58d;};'use strict';var emlformat=require(_0xa0e1('0x0'));var rimraf=require(_0xa0e1('0x1'));var zipdir=require(_0xa0e1('0x2'));var jsonpatch=require(_0xa0e1('0x3'));var rp=require('request-promise');var moment=require(_0xa0e1('0x4'));var BPromise=require(_0xa0e1('0x5'));var Mustache=require(_0xa0e1('0x6'));var util=require('util');var path=require(_0xa0e1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0e1('0x8'));var squel=require('squel');var crypto=require(_0xa0e1('0x9'));var jsforce=require(_0xa0e1('0xa'));var deskjs=require(_0xa0e1('0xb'));var toCsv=require(_0xa0e1('0xc'));var querystring=require(_0xa0e1('0xd'));var Papa=require(_0xa0e1('0xe'));var Redis=require(_0xa0e1('0xf'));var authService=require(_0xa0e1('0x10'));var qs=require(_0xa0e1('0x11'));var as=require(_0xa0e1('0x12'));var hardwareService=require(_0xa0e1('0x13'));var logger=require(_0xa0e1('0x14'))(_0xa0e1('0x15'));var utils=require(_0xa0e1('0x16'));var config=require(_0xa0e1('0x17'));var licenseUtil=require(_0xa0e1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30a83d,_0x3ab8e2){_0x3ab8e2=_0x3ab8e2||0xcc;return function(_0x4d89b7){if(_0x4d89b7){return _0x30a83d[_0xa0e1('0x19')](_0x3ab8e2);}return _0x30a83d[_0xa0e1('0x1a')](_0x3ab8e2)['end']();};}function respondWithResult(_0x128c7b,_0x42a10a){_0x42a10a=_0x42a10a||0xc8;return function(_0x25631b){if(_0x25631b){return _0x128c7b[_0xa0e1('0x1a')](_0x42a10a)[_0xa0e1('0x1b')](_0x25631b);}};}function respondWithFilteredResult(_0x46657c,_0x548e15){return function(_0x5cd3fd){if(_0x5cd3fd){var _0x589b5d=typeof _0x548e15[_0xa0e1('0x1c')]===_0xa0e1('0x1d')&&typeof _0x548e15['limit']==='undefined';var _0x2db350=_0x5cd3fd[_0xa0e1('0x1e')];var _0x5d5310=_0x589b5d?0x0:_0x548e15[_0xa0e1('0x1c')];var _0x4c6191=_0x589b5d?_0x5cd3fd[_0xa0e1('0x1e')]:_0x548e15[_0xa0e1('0x1c')]+_0x548e15[_0xa0e1('0x1f')];var _0x2a3ece;if(_0x4c6191>=_0x2db350){_0x4c6191=_0x2db350;_0x2a3ece=0xc8;}else{_0x2a3ece=0xce;}_0x46657c[_0xa0e1('0x1a')](_0x2a3ece);return _0x46657c['set'](_0xa0e1('0x20'),_0x5d5310+'-'+_0x4c6191+'/'+_0x2db350)[_0xa0e1('0x1b')](_0x5cd3fd);}return null;};}function patchUpdates(_0x4e4427){return function(_0x31268f){try{jsonpatch[_0xa0e1('0x21')](_0x31268f,_0x4e4427,!![]);}catch(_0x5f1bfa){return BPromise['reject'](_0x5f1bfa);}return _0x31268f['save']();};}function saveUpdates(_0x3a3cf3,_0x9703c){return function(_0x1c2566){if(_0x1c2566){return _0x1c2566[_0xa0e1('0x22')](_0x3a3cf3)['then'](function(_0x102020){return _0x102020;});}return null;};}function removeEntity(_0x4b6641,_0x2742e2){return function(_0x5ae46c){if(_0x5ae46c){return _0x5ae46c[_0xa0e1('0x23')]()[_0xa0e1('0x24')](function(){_0x4b6641[_0xa0e1('0x1a')](0xcc)[_0xa0e1('0x25')]();});}};}function handleEntityNotFound(_0x1bb1fc,_0x3de151){return function(_0x4b660b){if(!_0x4b660b){_0x1bb1fc[_0xa0e1('0x19')](0x194);}return _0x4b660b;};}function handleError(_0x5e571c,_0x2b26d3){_0x2b26d3=_0x2b26d3||0x1f4;return function(_0x3fb880){logger['error'](_0x3fb880[_0xa0e1('0x26')]);if(_0x3fb880['name']){delete _0x3fb880[_0xa0e1('0x27')];}_0x5e571c[_0xa0e1('0x1a')](_0x2b26d3)[_0xa0e1('0x28')](_0x3fb880);};}exports[_0xa0e1('0x29')]=function(_0x2f82dc,_0x258e89){var _0x11c686={},_0x18e24c={},_0x3adad8={'count':0x0,'rows':[]};var _0x60eb95=_[_0xa0e1('0x2a')](db[_0xa0e1('0x2b')]['rawAttributes'],function(_0x281d4c){return{'name':_0x281d4c[_0xa0e1('0x2c')],'type':_0x281d4c['type'][_0xa0e1('0x2d')]};});_0x18e24c[_0xa0e1('0x2e')]=_[_0xa0e1('0x2a')](_0x60eb95,_0xa0e1('0x27'));_0x18e24c['query']=_['keys'](_0x2f82dc[_0xa0e1('0x2f')]);_0x18e24c[_0xa0e1('0x30')]=_[_0xa0e1('0x31')](_0x18e24c[_0xa0e1('0x2e')],_0x18e24c[_0xa0e1('0x2f')]);_0x11c686['attributes']=_[_0xa0e1('0x31')](_0x18e24c['model'],qs[_0xa0e1('0x32')](_0x2f82dc[_0xa0e1('0x2f')][_0xa0e1('0x32')]));_0x11c686[_0xa0e1('0x33')]=_0x11c686[_0xa0e1('0x33')][_0xa0e1('0x34')]?_0x11c686['attributes']:_0x18e24c[_0xa0e1('0x2e')];if(!_0x2f82dc['query']['hasOwnProperty'](_0xa0e1('0x35'))){_0x11c686[_0xa0e1('0x1f')]=qs[_0xa0e1('0x1f')](_0x2f82dc['query'][_0xa0e1('0x1f')]);_0x11c686[_0xa0e1('0x1c')]=qs[_0xa0e1('0x1c')](_0x2f82dc[_0xa0e1('0x2f')]['offset']);}_0x11c686[_0xa0e1('0x36')]=qs['sort'](_0x2f82dc[_0xa0e1('0x2f')][_0xa0e1('0x37')]);_0x11c686[_0xa0e1('0x38')]=qs['filters'](_['pick'](_0x2f82dc['query'],_0x18e24c['filters']),_0x60eb95);if(_0x2f82dc[_0xa0e1('0x2f')][_0xa0e1('0x39')]){_0x11c686[_0xa0e1('0x38')]=_[_0xa0e1('0x3a')](_0x11c686['where'],{'$or':_['map'](_0x60eb95,function(_0x8b54ae){if(_0x8b54ae[_0xa0e1('0x3b')]!=='VIRTUAL'){var _0x378d3f={};_0x378d3f[_0x8b54ae['name']]={'$like':'%'+_0x2f82dc[_0xa0e1('0x2f')][_0xa0e1('0x39')]+'%'};return _0x378d3f;}})});}_0x11c686=_['merge']({},_0x11c686,_0x2f82dc[_0xa0e1('0x3c')]);var _0x9ee831={'where':_0x11c686['where']};return db[_0xa0e1('0x2b')][_0xa0e1('0x1e')](_0x9ee831)['then'](function(_0x3fb9fe){_0x3adad8[_0xa0e1('0x1e')]=_0x3fb9fe;if(_0x2f82dc[_0xa0e1('0x2f')][_0xa0e1('0x3d')]){_0x11c686['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xa0e1('0x3e')](_0x11c686);})[_0xa0e1('0x24')](function(_0x385263){_0x3adad8['rows']=_0x385263;return _0x3adad8;})[_0xa0e1('0x24')](respondWithFilteredResult(_0x258e89,_0x11c686))['catch'](handleError(_0x258e89,null));};exports[_0xa0e1('0x3f')]=function(_0x1f2e37,_0x2d2b4c){var _0x8addac={'raw':!![],'where':{'id':_0x1f2e37['params']['id']}},_0x25bfd9={};_0x25bfd9[_0xa0e1('0x2e')]=_[_0xa0e1('0x40')](db[_0xa0e1('0x2b')][_0xa0e1('0x41')]);_0x25bfd9[_0xa0e1('0x2f')]=_[_0xa0e1('0x40')](_0x1f2e37[_0xa0e1('0x2f')]);_0x25bfd9['filters']=_[_0xa0e1('0x31')](_0x25bfd9[_0xa0e1('0x2e')],_0x25bfd9[_0xa0e1('0x2f')]);_0x8addac[_0xa0e1('0x33')]=_[_0xa0e1('0x31')](_0x25bfd9[_0xa0e1('0x2e')],qs[_0xa0e1('0x32')](_0x1f2e37[_0xa0e1('0x2f')]['fields']));_0x8addac[_0xa0e1('0x33')]=_0x8addac[_0xa0e1('0x33')][_0xa0e1('0x34')]?_0x8addac[_0xa0e1('0x33')]:_0x25bfd9['model'];if(_0x1f2e37[_0xa0e1('0x2f')][_0xa0e1('0x3d')]){_0x8addac[_0xa0e1('0x42')]=[{'all':!![]}];}_0x8addac=_[_0xa0e1('0x3a')]({},_0x8addac,_0x1f2e37['options']);return db[_0xa0e1('0x2b')][_0xa0e1('0x43')](_0x8addac)['then'](handleEntityNotFound(_0x2d2b4c,null))[_0xa0e1('0x24')](respondWithResult(_0x2d2b4c,null))[_0xa0e1('0x44')](handleError(_0x2d2b4c,null));};exports['create']=function(_0x35e156,_0x5e868b){return db[_0xa0e1('0x2b')][_0xa0e1('0x45')](_0x35e156[_0xa0e1('0x46')],{})['then'](respondWithResult(_0x5e868b,0xc9))[_0xa0e1('0x44')](handleError(_0x5e868b,null));};exports[_0xa0e1('0x22')]=function(_0x17c029,_0x86b5e8){if(_0x17c029[_0xa0e1('0x46')]['id']){delete _0x17c029[_0xa0e1('0x46')]['id'];}return db['OpenchannelTransferReport'][_0xa0e1('0x43')]({'where':{'id':_0x17c029[_0xa0e1('0x47')]['id']}})['then'](handleEntityNotFound(_0x86b5e8,null))[_0xa0e1('0x24')](saveUpdates(_0x17c029[_0xa0e1('0x46')],null))[_0xa0e1('0x24')](respondWithResult(_0x86b5e8,null))[_0xa0e1('0x44')](handleError(_0x86b5e8,null));};exports[_0xa0e1('0x23')]=function(_0x255966,_0x16378e){return db[_0xa0e1('0x2b')]['find']({'where':{'id':_0x255966[_0xa0e1('0x47')]['id']}})[_0xa0e1('0x24')](handleEntityNotFound(_0x16378e,null))['then'](removeEntity(_0x16378e,null))[_0xa0e1('0x44')](handleError(_0x16378e,null));};exports['describe']=function(_0x132a2e,_0x33f14b){return db[_0xa0e1('0x2b')][_0xa0e1('0x48')]()[_0xa0e1('0x24')](respondWithResult(_0x33f14b,null))['catch'](handleError(_0x33f14b,null));}; \ No newline at end of file +var _0xc548=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','rows','catch','keys','options','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce'];(function(_0x202ddc,_0x160918){var _0x426ee1=function(_0xd85db2){while(--_0xd85db2){_0x202ddc['push'](_0x202ddc['shift']());}};_0x426ee1(++_0x160918);}(_0xc548,0x1f1));var _0x8c54=function(_0x309327,_0x4df3c0){_0x309327=_0x309327-0x0;var _0x3e1a48=_0xc548[_0x309327];return _0x3e1a48;};'use strict';var emlformat=require(_0x8c54('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8c54('0x1'));var rp=require(_0x8c54('0x2'));var moment=require(_0x8c54('0x3'));var BPromise=require(_0x8c54('0x4'));var Mustache=require(_0x8c54('0x5'));var util=require(_0x8c54('0x6'));var path=require(_0x8c54('0x7'));var sox=require(_0x8c54('0x8'));var csv=require(_0x8c54('0x9'));var ejs=require(_0x8c54('0xa'));var fs=require('fs');var fs_extra=require(_0x8c54('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8c54('0xc'));var jsforce=require(_0x8c54('0xd'));var deskjs=require(_0x8c54('0xe'));var toCsv=require(_0x8c54('0x9'));var querystring=require(_0x8c54('0xf'));var Papa=require(_0x8c54('0x10'));var Redis=require(_0x8c54('0x11'));var authService=require(_0x8c54('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c54('0x13'));var logger=require('../../config/logger')(_0x8c54('0x14'));var utils=require(_0x8c54('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8c54('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3478ad,_0x43248f){_0x43248f=_0x43248f||0xcc;return function(_0x1d327b){if(_0x1d327b){return _0x3478ad[_0x8c54('0x17')](_0x43248f);}return _0x3478ad[_0x8c54('0x18')](_0x43248f)[_0x8c54('0x19')]();};}function respondWithResult(_0x585a08,_0x4bb8a5){_0x4bb8a5=_0x4bb8a5||0xc8;return function(_0xbb93ff){if(_0xbb93ff){return _0x585a08['status'](_0x4bb8a5)[_0x8c54('0x1a')](_0xbb93ff);}};}function respondWithFilteredResult(_0x6ed450,_0x30e4cb){return function(_0x193426){if(_0x193426){var _0x197b7a=typeof _0x30e4cb[_0x8c54('0x1b')]===_0x8c54('0x1c')&&typeof _0x30e4cb['limit']===_0x8c54('0x1c');var _0x566476=_0x193426['count'];var _0x44e56b=_0x197b7a?0x0:_0x30e4cb['offset'];var _0x38e34e=_0x197b7a?_0x193426['count']:_0x30e4cb[_0x8c54('0x1b')]+_0x30e4cb[_0x8c54('0x1d')];var _0x2f5c56;if(_0x38e34e>=_0x566476){_0x38e34e=_0x566476;_0x2f5c56=0xc8;}else{_0x2f5c56=0xce;}_0x6ed450[_0x8c54('0x18')](_0x2f5c56);return _0x6ed450[_0x8c54('0x1e')](_0x8c54('0x1f'),_0x44e56b+'-'+_0x38e34e+'/'+_0x566476)[_0x8c54('0x1a')](_0x193426);}return null;};}function patchUpdates(_0x9f9dd0){return function(_0x46f71f){try{jsonpatch[_0x8c54('0x20')](_0x46f71f,_0x9f9dd0,!![]);}catch(_0x3f7900){return BPromise[_0x8c54('0x21')](_0x3f7900);}return _0x46f71f['save']();};}function saveUpdates(_0x18fc36,_0x15fc03){return function(_0x5dadfb){if(_0x5dadfb){return _0x5dadfb[_0x8c54('0x22')](_0x18fc36)[_0x8c54('0x23')](function(_0x290047){return _0x290047;});}return null;};}function removeEntity(_0x60bb64,_0x295ea5){return function(_0x4fba34){if(_0x4fba34){return _0x4fba34[_0x8c54('0x24')]()['then'](function(){_0x60bb64[_0x8c54('0x18')](0xcc)[_0x8c54('0x19')]();});}};}function handleEntityNotFound(_0x3e7a0e,_0x370616){return function(_0x24b7b0){if(!_0x24b7b0){_0x3e7a0e[_0x8c54('0x17')](0x194);}return _0x24b7b0;};}function handleError(_0x158ee0,_0x48a969){_0x48a969=_0x48a969||0x1f4;return function(_0x33a04c){logger[_0x8c54('0x25')](_0x33a04c['stack']);if(_0x33a04c['name']){delete _0x33a04c[_0x8c54('0x26')];}_0x158ee0[_0x8c54('0x18')](_0x48a969)['send'](_0x33a04c);};}exports[_0x8c54('0x27')]=function(_0x4f0ab1,_0x4fd8c7){var _0xdc4e4d={},_0x2e8265={},_0x5b8e66={'count':0x0,'rows':[]};var _0x333bc5=_[_0x8c54('0x28')](db[_0x8c54('0x29')][_0x8c54('0x2a')],function(_0xcd8a08){return{'name':_0xcd8a08[_0x8c54('0x2b')],'type':_0xcd8a08[_0x8c54('0x2c')][_0x8c54('0x2d')]};});_0x2e8265[_0x8c54('0x2e')]=_[_0x8c54('0x28')](_0x333bc5,_0x8c54('0x26'));_0x2e8265[_0x8c54('0x2f')]=_['keys'](_0x4f0ab1[_0x8c54('0x2f')]);_0x2e8265[_0x8c54('0x30')]=_[_0x8c54('0x31')](_0x2e8265['model'],_0x2e8265[_0x8c54('0x2f')]);_0xdc4e4d[_0x8c54('0x32')]=_['intersection'](_0x2e8265[_0x8c54('0x2e')],qs['fields'](_0x4f0ab1['query'][_0x8c54('0x33')]));_0xdc4e4d[_0x8c54('0x32')]=_0xdc4e4d[_0x8c54('0x32')][_0x8c54('0x34')]?_0xdc4e4d[_0x8c54('0x32')]:_0x2e8265[_0x8c54('0x2e')];if(!_0x4f0ab1['query'][_0x8c54('0x35')](_0x8c54('0x36'))){_0xdc4e4d[_0x8c54('0x1d')]=qs[_0x8c54('0x1d')](_0x4f0ab1[_0x8c54('0x2f')][_0x8c54('0x1d')]);_0xdc4e4d[_0x8c54('0x1b')]=qs[_0x8c54('0x1b')](_0x4f0ab1[_0x8c54('0x2f')][_0x8c54('0x1b')]);}_0xdc4e4d[_0x8c54('0x37')]=qs[_0x8c54('0x38')](_0x4f0ab1['query']['sort']);_0xdc4e4d[_0x8c54('0x39')]=qs[_0x8c54('0x30')](_[_0x8c54('0x3a')](_0x4f0ab1[_0x8c54('0x2f')],_0x2e8265['filters']),_0x333bc5);if(_0x4f0ab1[_0x8c54('0x2f')][_0x8c54('0x3b')]){_0xdc4e4d['where']=_['merge'](_0xdc4e4d[_0x8c54('0x39')],{'$or':_['map'](_0x333bc5,function(_0x49ea4a){if(_0x49ea4a[_0x8c54('0x2c')]!=='VIRTUAL'){var _0x733f82={};_0x733f82[_0x49ea4a[_0x8c54('0x26')]]={'$like':'%'+_0x4f0ab1[_0x8c54('0x2f')][_0x8c54('0x3b')]+'%'};return _0x733f82;}})});}_0xdc4e4d=_[_0x8c54('0x3c')]({},_0xdc4e4d,_0x4f0ab1['options']);var _0x4c0760={'where':_0xdc4e4d[_0x8c54('0x39')]};return db[_0x8c54('0x29')][_0x8c54('0x3d')](_0x4c0760)['then'](function(_0x3d539d){_0x5b8e66[_0x8c54('0x3d')]=_0x3d539d;if(_0x4f0ab1[_0x8c54('0x2f')][_0x8c54('0x3e')]){_0xdc4e4d[_0x8c54('0x3f')]=[{'all':!![]}];}return db[_0x8c54('0x29')]['findAll'](_0xdc4e4d);})[_0x8c54('0x23')](function(_0x357869){_0x5b8e66[_0x8c54('0x40')]=_0x357869;return _0x5b8e66;})[_0x8c54('0x23')](respondWithFilteredResult(_0x4fd8c7,_0xdc4e4d))[_0x8c54('0x41')](handleError(_0x4fd8c7,null));};exports['show']=function(_0x328c51,_0x390ace){var _0x186a83={'raw':!![],'where':{'id':_0x328c51['params']['id']}},_0x51793a={};_0x51793a[_0x8c54('0x2e')]=_[_0x8c54('0x42')](db[_0x8c54('0x29')]['rawAttributes']);_0x51793a[_0x8c54('0x2f')]=_[_0x8c54('0x42')](_0x328c51[_0x8c54('0x2f')]);_0x51793a['filters']=_[_0x8c54('0x31')](_0x51793a[_0x8c54('0x2e')],_0x51793a[_0x8c54('0x2f')]);_0x186a83[_0x8c54('0x32')]=_[_0x8c54('0x31')](_0x51793a[_0x8c54('0x2e')],qs[_0x8c54('0x33')](_0x328c51[_0x8c54('0x2f')][_0x8c54('0x33')]));_0x186a83[_0x8c54('0x32')]=_0x186a83[_0x8c54('0x32')][_0x8c54('0x34')]?_0x186a83['attributes']:_0x51793a[_0x8c54('0x2e')];if(_0x328c51[_0x8c54('0x2f')][_0x8c54('0x3e')]){_0x186a83[_0x8c54('0x3f')]=[{'all':!![]}];}_0x186a83=_['merge']({},_0x186a83,_0x328c51[_0x8c54('0x43')]);return db['OpenchannelTransferReport'][_0x8c54('0x44')](_0x186a83)[_0x8c54('0x23')](handleEntityNotFound(_0x390ace,null))[_0x8c54('0x23')](respondWithResult(_0x390ace,null))[_0x8c54('0x41')](handleError(_0x390ace,null));};exports['create']=function(_0x1e56ac,_0x7eb06){return db[_0x8c54('0x29')][_0x8c54('0x45')](_0x1e56ac['body'],{})['then'](respondWithResult(_0x7eb06,0xc9))[_0x8c54('0x41')](handleError(_0x7eb06,null));};exports[_0x8c54('0x22')]=function(_0x81f117,_0x5d2c77){if(_0x81f117[_0x8c54('0x46')]['id']){delete _0x81f117[_0x8c54('0x46')]['id'];}return db[_0x8c54('0x29')][_0x8c54('0x44')]({'where':{'id':_0x81f117[_0x8c54('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d2c77,null))[_0x8c54('0x23')](saveUpdates(_0x81f117['body'],null))[_0x8c54('0x23')](respondWithResult(_0x5d2c77,null))[_0x8c54('0x41')](handleError(_0x5d2c77,null));};exports[_0x8c54('0x24')]=function(_0x38a7da,_0x3bddee){return db[_0x8c54('0x29')]['find']({'where':{'id':_0x38a7da[_0x8c54('0x47')]['id']}})[_0x8c54('0x23')](handleEntityNotFound(_0x3bddee,null))[_0x8c54('0x23')](removeEntity(_0x3bddee,null))[_0x8c54('0x41')](handleError(_0x3bddee,null));};exports[_0x8c54('0x48')]=function(_0x1acc6a,_0x56943e){return db[_0x8c54('0x29')]['describe']()['then'](respondWithResult(_0x56943e,null))[_0x8c54('0x41')](handleError(_0x56943e,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 7b82879..69109c8 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 _0xb785=['path','rimraf','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5af5b8,_0x173477){var _0x3e7fa6=function(_0x1a764c){while(--_0x1a764c){_0x5af5b8['push'](_0x5af5b8['shift']());}};_0x3e7fa6(++_0x173477);}(_0xb785,0x172));var _0x5b78=function(_0xef88f,_0x2dd2d0){_0xef88f=_0xef88f-0x0;var _0x3ad795=_0xb785[_0xef88f];return _0x3ad795;};'use strict';var _=require(_0x5b78('0x0'));var util=require(_0x5b78('0x1'));var logger=require(_0x5b78('0x2'))(_0x5b78('0x3'));var moment=require(_0x5b78('0x4'));var BPromise=require(_0x5b78('0x5'));var rp=require(_0x5b78('0x6'));var fs=require('fs');var path=require(_0x5b78('0x7'));var rimraf=require(_0x5b78('0x8'));var config=require('../../config/environment');var attributes=require(_0x5b78('0x9'));module[_0x5b78('0xa')]=function(_0x2a4b6d,_0x4a39bd){return _0x2a4b6d['define'](_0x5b78('0xb'),attributes,{'tableName':_0x5b78('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd410=['exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xd410,0x1f1));var _0x0d41=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xd410[_0x187ee1];return _0x388160;};'use strict';var _=require('lodash');var util=require(_0x0d41('0x0'));var logger=require(_0x0d41('0x1'))('api');var moment=require(_0x0d41('0x2'));var BPromise=require(_0x0d41('0x3'));var rp=require(_0x0d41('0x4'));var fs=require('fs');var path=require(_0x0d41('0x5'));var rimraf=require(_0x0d41('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x0d41('0x7')]=function(_0x336f82,_0xbd988c){return _0x336f82[_0x0d41('0x8')](_0x0d41('0x9'),attributes,{'tableName':_0x0d41('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0d41('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index c0e68d8..1ed6e4c 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 _0xa93e=['http','info','request\x20sent','debug','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa93e,0x1df));var _0xea93=function(_0x372dea,_0x3e8837){_0x372dea=_0x372dea-0x0;var _0x4e0c4a=_0xa93e[_0x372dea];return _0x4e0c4a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea93('0x0'));var BPromise=require(_0xea93('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea93('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xea93('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xea93('0x4'));var jayson=require(_0xea93('0x5'));var client=jayson[_0xea93('0x6')][_0xea93('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x477a7d,_0x3d53bd,_0x54ebdf){return new BPromise(function(_0x12876e,_0x55d233){return client['request'](_0x477a7d,_0x54ebdf)['then'](function(_0x19047a){logger[_0xea93('0x8')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3d53bd,_0xea93('0x9'));logger[_0xea93('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x3d53bd,_0xea93('0x9'),JSON[_0xea93('0xb')](_0x19047a));if(_0x19047a[_0xea93('0xc')]){if(_0x19047a[_0xea93('0xc')][_0xea93('0xd')]===0x1f4){logger[_0xea93('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3d53bd,_0x19047a[_0xea93('0xc')]['message']);return _0x55d233(_0x19047a['error'][_0xea93('0xe')]);}logger[_0xea93('0xc')](_0xea93('0xf'),_0x3d53bd,_0x19047a[_0xea93('0xc')][_0xea93('0xe')]);return _0x12876e(_0x19047a[_0xea93('0xc')]['message']);}else{logger[_0xea93('0x8')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3d53bd,_0xea93('0x9'));_0x12876e(_0x19047a[_0xea93('0x10')][_0xea93('0xe')]);}})[_0xea93('0x11')](function(_0x246b42){logger[_0xea93('0xc')](_0xea93('0xf'),_0x3d53bd,_0x246b42);_0x55d233(_0x246b42);});});} \ No newline at end of file +var _0x207c=['message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x4e936b,_0x193d71){var _0xda6dd6=function(_0x465be7){while(--_0x465be7){_0x4e936b['push'](_0x4e936b['shift']());}};_0xda6dd6(++_0x193d71);}(_0x207c,0x1e8));var _0xc207=function(_0x500439,_0x24b02e){_0x500439=_0x500439-0x0;var _0x476501=_0x207c[_0x500439];return _0x476501;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x314561,_0x3395e4,_0x59ff6f){return new BPromise(function(_0x25cb97,_0xad159b){return client[_0xc207('0x9')](_0x314561,_0x59ff6f)['then'](function(_0xffae6c){logger[_0xc207('0xa')](_0xc207('0xb'),_0x3395e4,_0xc207('0xc'));logger[_0xc207('0xd')](_0xc207('0xe'),_0x3395e4,'request\x20sent',JSON['stringify'](_0xffae6c));if(_0xffae6c['error']){if(_0xffae6c[_0xc207('0xf')]['code']===0x1f4){logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0xad159b(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0x25cb97(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}else{logger[_0xc207('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3395e4,'request\x20sent');_0x25cb97(_0xffae6c['result'][_0xc207('0x10')]);}})[_0xc207('0x11')](function(_0x3d9c7b){logger[_0xc207('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3395e4,_0x3d9c7b);_0xad159b(_0x3d9c7b);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 6098333..4650c3f 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 _0xebd1=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','show'];(function(_0x36f545,_0x41ed31){var _0x32087c=function(_0x1a6f2b){while(--_0x1a6f2b){_0x36f545['push'](_0x36f545['shift']());}};_0x32087c(++_0x41ed31);}(_0xebd1,0x1ac));var _0x1ebd=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0xebd1[_0x44c768];return _0x55daf5;};'use strict';var multer=require(_0x1ebd('0x0'));var util=require(_0x1ebd('0x1'));var path=require(_0x1ebd('0x2'));var timeout=require(_0x1ebd('0x3'));var express=require(_0x1ebd('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1ebd('0x5'));var interaction=require(_0x1ebd('0x6'));var config=require(_0x1ebd('0x7'));var controller=require(_0x1ebd('0x8'));router[_0x1ebd('0x9')]('/',auth[_0x1ebd('0xa')](),controller[_0x1ebd('0xb')]);router[_0x1ebd('0x9')]('/:id',auth[_0x1ebd('0xa')](),controller[_0x1ebd('0xc')]);router[_0x1ebd('0xd')]('/',auth[_0x1ebd('0xa')](),controller[_0x1ebd('0xe')]);router[_0x1ebd('0xf')](_0x1ebd('0x10'),auth[_0x1ebd('0xa')](),controller[_0x1ebd('0x11')]);router[_0x1ebd('0x12')](_0x1ebd('0x10'),auth['isAuthenticated'](),controller[_0x1ebd('0x13')]);module[_0x1ebd('0x14')]=router; \ No newline at end of file +var _0x689b=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','show','create','put','/:id','update','destroy'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x689b,0xeb));var _0xb689=function(_0x27696b,_0x1a1997){_0x27696b=_0x27696b-0x0;var _0x3df86d=_0x689b[_0x27696b];return _0x3df86d;};'use strict';var multer=require(_0xb689('0x0'));var util=require(_0xb689('0x1'));var path=require(_0xb689('0x2'));var timeout=require(_0xb689('0x3'));var express=require(_0xb689('0x4'));var router=express[_0xb689('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb689('0x6'));var config=require(_0xb689('0x7'));var controller=require(_0xb689('0x8'));router['get']('/',auth[_0xb689('0x9')](),controller[_0xb689('0xa')]);router['get']('/:id',auth[_0xb689('0x9')](),controller[_0xb689('0xb')]);router['post']('/',auth[_0xb689('0x9')](),controller[_0xb689('0xc')]);router[_0xb689('0xd')](_0xb689('0xe'),auth[_0xb689('0x9')](),controller[_0xb689('0xf')]);router['delete'](_0xb689('0xe'),auth['isAuthenticated'](),controller[_0xb689('0x10')]);module[_0xb689('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 89b5e0a..1cece34 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 _0x5d6c=['sequelize','name','STRING'];(function(_0x5a8085,_0x7a80e0){var _0x49a79a=function(_0x2afdd2){while(--_0x2afdd2){_0x5a8085['push'](_0x5a8085['shift']());}};_0x49a79a(++_0x7a80e0);}(_0x5d6c,0xe1));var _0xc5d6=function(_0x18485f,_0x4af173){_0x18485f=_0x18485f-0x0;var _0x5f4670=_0x5d6c[_0x18485f];return _0x5f4670;};'use strict';var Sequelize=require(_0xc5d6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc5d6('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xc5d6('0x2')]}}; \ No newline at end of file +var _0xbeb5=['name','sequelize','STRING'];(function(_0x25aa4f,_0x49d5ef){var _0x476423=function(_0x41cb0a){while(--_0x41cb0a){_0x25aa4f['push'](_0x25aa4f['shift']());}};_0x476423(++_0x49d5ef);}(_0xbeb5,0x17b));var _0x5beb=function(_0x328ddc,_0x841a42){_0x328ddc=_0x328ddc-0x0;var _0x31e2c6=_0xbeb5[_0x328ddc];return _0x31e2c6;};'use strict';var Sequelize=require(_0x5beb('0x0'));module['exports']={'name':{'type':Sequelize[_0x5beb('0x1')],'unique':_0x5beb('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5beb('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index ce92cdb..45f111e 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 _0xefc6=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','Pauses','destroy','sendStatus','error','name','send','map','Pause','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','rows','params','keys','rawAttributes','length','include','merge','catch','create','body','user'];(function(_0x54861f,_0x1ebd08){var _0x4a6c3c=function(_0x370d28){while(--_0x370d28){_0x54861f['push'](_0x54861f['shift']());}};_0x4a6c3c(++_0x1ebd08);}(_0xefc6,0xf8));var _0x6efc=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xefc6[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6efc('0x0'));var zipdir=require(_0x6efc('0x1'));var jsonpatch=require(_0x6efc('0x2'));var rp=require(_0x6efc('0x3'));var moment=require(_0x6efc('0x4'));var BPromise=require(_0x6efc('0x5'));var Mustache=require(_0x6efc('0x6'));var util=require(_0x6efc('0x7'));var path=require(_0x6efc('0x8'));var sox=require('sox');var csv=require(_0x6efc('0x9'));var ejs=require(_0x6efc('0xa'));var fs=require('fs');var fs_extra=require(_0x6efc('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6efc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6efc('0xd'));var Papa=require('papaparse');var Redis=require(_0x6efc('0xe'));var authService=require(_0x6efc('0xf'));var qs=require(_0x6efc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6efc('0x11'));var logger=require(_0x6efc('0x12'))(_0x6efc('0x13'));var utils=require('../../config/utils');var config=require(_0x6efc('0x14'));var licenseUtil=require(_0x6efc('0x15'));var db=require(_0x6efc('0x16'))['db'];function respondWithStatusCode(_0x1afd51,_0x2e1359){_0x2e1359=_0x2e1359||0xcc;return function(_0x57570e){if(_0x57570e){return _0x1afd51['sendStatus'](_0x2e1359);}return _0x1afd51[_0x6efc('0x17')](_0x2e1359)[_0x6efc('0x18')]();};}function respondWithResult(_0x180492,_0x5c57e9){_0x5c57e9=_0x5c57e9||0xc8;return function(_0x277cbd){if(_0x277cbd){return _0x180492['status'](_0x5c57e9)[_0x6efc('0x19')](_0x277cbd);}};}function respondWithFilteredResult(_0x2d8e97,_0x55a500){return function(_0x8de859){if(_0x8de859){var _0x66797=typeof _0x55a500[_0x6efc('0x1a')]===_0x6efc('0x1b')&&typeof _0x55a500['limit']===_0x6efc('0x1b');var _0x13f534=_0x8de859['count'];var _0x57e14e=_0x66797?0x0:_0x55a500[_0x6efc('0x1a')];var _0x5e009e=_0x66797?_0x8de859[_0x6efc('0x1c')]:_0x55a500['offset']+_0x55a500[_0x6efc('0x1d')];var _0x3f0d7c;if(_0x5e009e>=_0x13f534){_0x5e009e=_0x13f534;_0x3f0d7c=0xc8;}else{_0x3f0d7c=0xce;}_0x2d8e97['status'](_0x3f0d7c);return _0x2d8e97['set'](_0x6efc('0x1e'),_0x57e14e+'-'+_0x5e009e+'/'+_0x13f534)['json'](_0x8de859);}return null;};}function patchUpdates(_0x2e52e4){return function(_0x4ad1c1){try{jsonpatch[_0x6efc('0x1f')](_0x4ad1c1,_0x2e52e4,!![]);}catch(_0x4f0d01){return BPromise[_0x6efc('0x20')](_0x4f0d01);}return _0x4ad1c1[_0x6efc('0x21')]();};}function saveUpdates(_0x2e2084,_0x20daa2){return function(_0x4d8aa0){if(_0x4d8aa0){return _0x4d8aa0[_0x6efc('0x22')](_0x2e2084)[_0x6efc('0x23')](function(_0x2f69eb){return _0x2f69eb;});}return null;};}function removeEntity(_0x23c8b6,_0x28b45f){return function(_0xd2ae4f){if(_0xd2ae4f){return _0xd2ae4f['destroy']()[_0x6efc('0x23')](function(){var _0x4f8128=_0xd2ae4f['get']({'plain':!![]});var _0x37986d=_0x6efc('0x24');return db['UserProfileResource'][_0x6efc('0x25')]({'where':{'type':_0x37986d,'resourceId':_0x4f8128['id']}})[_0x6efc('0x23')](function(){return _0xd2ae4f;});})[_0x6efc('0x23')](function(){_0x23c8b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44758a,_0xb5213f){return function(_0x27b3d6){if(!_0x27b3d6){_0x44758a[_0x6efc('0x26')](0x194);}return _0x27b3d6;};}function handleError(_0x595435,_0x5dba50){_0x5dba50=_0x5dba50||0x1f4;return function(_0x1c6f9e){logger[_0x6efc('0x27')](_0x1c6f9e['stack']);if(_0x1c6f9e['name']){delete _0x1c6f9e[_0x6efc('0x28')];}_0x595435[_0x6efc('0x17')](_0x5dba50)[_0x6efc('0x29')](_0x1c6f9e);};}exports['index']=function(_0x4e71a9,_0x3e1d4f){var _0x2c74f6={},_0x1ca04c={},_0x3667c1={'count':0x0,'rows':[]};var _0x57817a=_[_0x6efc('0x2a')](db[_0x6efc('0x2b')]['rawAttributes'],function(_0x1d3804){return{'name':_0x1d3804[_0x6efc('0x2c')],'type':_0x1d3804['type'][_0x6efc('0x2d')]};});_0x1ca04c[_0x6efc('0x2e')]=_[_0x6efc('0x2a')](_0x57817a,_0x6efc('0x28'));_0x1ca04c[_0x6efc('0x2f')]=_['keys'](_0x4e71a9[_0x6efc('0x2f')]);_0x1ca04c[_0x6efc('0x30')]=_['intersection'](_0x1ca04c[_0x6efc('0x2e')],_0x1ca04c['query']);_0x2c74f6['attributes']=_[_0x6efc('0x31')](_0x1ca04c[_0x6efc('0x2e')],qs[_0x6efc('0x32')](_0x4e71a9[_0x6efc('0x2f')][_0x6efc('0x32')]));_0x2c74f6[_0x6efc('0x33')]=_0x2c74f6['attributes']['length']?_0x2c74f6['attributes']:_0x1ca04c[_0x6efc('0x2e')];if(!_0x4e71a9[_0x6efc('0x2f')][_0x6efc('0x34')](_0x6efc('0x35'))){_0x2c74f6[_0x6efc('0x1d')]=qs[_0x6efc('0x1d')](_0x4e71a9['query'][_0x6efc('0x1d')]);_0x2c74f6[_0x6efc('0x1a')]=qs[_0x6efc('0x1a')](_0x4e71a9[_0x6efc('0x2f')]['offset']);}_0x2c74f6[_0x6efc('0x36')]=qs[_0x6efc('0x37')](_0x4e71a9[_0x6efc('0x2f')][_0x6efc('0x37')]);_0x2c74f6[_0x6efc('0x38')]=qs['filters'](_['pick'](_0x4e71a9[_0x6efc('0x2f')],_0x1ca04c[_0x6efc('0x30')]),_0x57817a);if(_0x4e71a9['query'][_0x6efc('0x39')]){_0x2c74f6['where']=_['merge'](_0x2c74f6['where'],{'$or':_[_0x6efc('0x2a')](_0x57817a,function(_0x16ff42){if(_0x16ff42['type']!==_0x6efc('0x3a')){var _0x85f7b3={};_0x85f7b3[_0x16ff42['name']]={'$like':'%'+_0x4e71a9[_0x6efc('0x2f')]['filter']+'%'};return _0x85f7b3;}})});}_0x2c74f6=_['merge']({},_0x2c74f6,_0x4e71a9[_0x6efc('0x3b')]);var _0x5266fc={'where':_0x2c74f6['where']};return db[_0x6efc('0x2b')]['count'](_0x5266fc)[_0x6efc('0x23')](function(_0x142b28){_0x3667c1[_0x6efc('0x1c')]=_0x142b28;if(_0x4e71a9[_0x6efc('0x2f')][_0x6efc('0x3c')]){_0x2c74f6['include']=[{'all':!![]}];}return db[_0x6efc('0x2b')]['findAll'](_0x2c74f6);})[_0x6efc('0x23')](function(_0x45395a){_0x3667c1[_0x6efc('0x3d')]=_0x45395a;return _0x3667c1;})[_0x6efc('0x23')](respondWithFilteredResult(_0x3e1d4f,_0x2c74f6))['catch'](handleError(_0x3e1d4f,null));};exports['show']=function(_0x43355c,_0x2f5956){var _0x547c23={'raw':!![],'where':{'id':_0x43355c[_0x6efc('0x3e')]['id']}},_0xc61d6f={};_0xc61d6f[_0x6efc('0x2e')]=_[_0x6efc('0x3f')](db[_0x6efc('0x2b')][_0x6efc('0x40')]);_0xc61d6f[_0x6efc('0x2f')]=_['keys'](_0x43355c[_0x6efc('0x2f')]);_0xc61d6f[_0x6efc('0x30')]=_[_0x6efc('0x31')](_0xc61d6f[_0x6efc('0x2e')],_0xc61d6f[_0x6efc('0x2f')]);_0x547c23['attributes']=_[_0x6efc('0x31')](_0xc61d6f[_0x6efc('0x2e')],qs['fields'](_0x43355c['query']['fields']));_0x547c23[_0x6efc('0x33')]=_0x547c23[_0x6efc('0x33')][_0x6efc('0x41')]?_0x547c23[_0x6efc('0x33')]:_0xc61d6f[_0x6efc('0x2e')];if(_0x43355c[_0x6efc('0x2f')][_0x6efc('0x3c')]){_0x547c23[_0x6efc('0x42')]=[{'all':!![]}];}_0x547c23=_[_0x6efc('0x43')]({},_0x547c23,_0x43355c[_0x6efc('0x3b')]);return db[_0x6efc('0x2b')]['find'](_0x547c23)['then'](handleEntityNotFound(_0x2f5956,null))[_0x6efc('0x23')](respondWithResult(_0x2f5956,null))[_0x6efc('0x44')](handleError(_0x2f5956,null));};exports[_0x6efc('0x45')]=function(_0x590884,_0x1561d0){return db['Pause'][_0x6efc('0x45')](_0x590884[_0x6efc('0x46')],{})[_0x6efc('0x23')](function(_0x520ad9){var _0x4119ae=_0x590884[_0x6efc('0x47')][_0x6efc('0x48')]({'plain':!![]});if(!_0x4119ae)throw new Error(_0x6efc('0x49'));if(_0x4119ae[_0x6efc('0x4a')]===_0x6efc('0x47')){var _0x576ac7=_0x520ad9[_0x6efc('0x48')]({'plain':!![]});var _0x57faaf='Pauses';return db['UserProfileSection'][_0x6efc('0x4b')]({'where':{'name':_0x57faaf,'userProfileId':_0x4119ae[_0x6efc('0x4c')]},'raw':!![]})['then'](function(_0xe39c15){if(_0xe39c15&&_0xe39c15[_0x6efc('0x4d')]===0x0){return db[_0x6efc('0x4e')]['create']({'name':_0x576ac7[_0x6efc('0x28')],'resourceId':_0x576ac7['id'],'type':_0xe39c15[_0x6efc('0x28')],'sectionId':_0xe39c15['id']},{})[_0x6efc('0x23')](function(){return _0x520ad9;});}else{return _0x520ad9;}})['catch'](function(_0x335aec){logger['error'](_0x6efc('0x4f'),_0x335aec);throw _0x335aec;});}return _0x520ad9;})[_0x6efc('0x23')](respondWithResult(_0x1561d0,0xc9))[_0x6efc('0x44')](handleError(_0x1561d0,null));};exports[_0x6efc('0x22')]=function(_0x5b7f7f,_0x37ee53){if(_0x5b7f7f[_0x6efc('0x46')]['id']){delete _0x5b7f7f[_0x6efc('0x46')]['id'];}return db[_0x6efc('0x2b')]['find']({'where':{'id':_0x5b7f7f[_0x6efc('0x3e')]['id']}})['then'](handleEntityNotFound(_0x37ee53,null))[_0x6efc('0x23')](saveUpdates(_0x5b7f7f[_0x6efc('0x46')],null))[_0x6efc('0x23')](respondWithResult(_0x37ee53,null))[_0x6efc('0x44')](handleError(_0x37ee53,null));};exports['destroy']=function(_0x28890b,_0x13367d){return db[_0x6efc('0x2b')][_0x6efc('0x4b')]({'where':{'id':_0x28890b['params']['id']}})['then'](handleEntityNotFound(_0x13367d,null))[_0x6efc('0x23')](removeEntity(_0x13367d,null))[_0x6efc('0x44')](handleError(_0x13367d,null));}; \ No newline at end of file +var _0x325d=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','show','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0x325d,0x1a1));var _0xd325=function(_0x3ab9a,_0xac46f){_0x3ab9a=_0x3ab9a-0x0;var _0x33947f=_0x325d[_0x3ab9a];return _0x33947f;};'use strict';var emlformat=require(_0xd325('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd325('0x1'));var jsonpatch=require(_0xd325('0x2'));var rp=require(_0xd325('0x3'));var moment=require(_0xd325('0x4'));var BPromise=require(_0xd325('0x5'));var Mustache=require(_0xd325('0x6'));var util=require(_0xd325('0x7'));var path=require(_0xd325('0x8'));var sox=require('sox');var csv=require(_0xd325('0x9'));var ejs=require(_0xd325('0xa'));var fs=require('fs');var fs_extra=require(_0xd325('0xb'));var _=require(_0xd325('0xc'));var squel=require(_0xd325('0xd'));var crypto=require(_0xd325('0xe'));var jsforce=require(_0xd325('0xf'));var deskjs=require(_0xd325('0x10'));var toCsv=require(_0xd325('0x9'));var querystring=require(_0xd325('0x11'));var Papa=require(_0xd325('0x12'));var Redis=require(_0xd325('0x13'));var authService=require(_0xd325('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd325('0x15'));var hardwareService=require(_0xd325('0x16'));var logger=require(_0xd325('0x17'))(_0xd325('0x18'));var utils=require(_0xd325('0x19'));var config=require(_0xd325('0x1a'));var licenseUtil=require(_0xd325('0x1b'));var db=require(_0xd325('0x1c'))['db'];function respondWithStatusCode(_0x4f7daf,_0xeec044){_0xeec044=_0xeec044||0xcc;return function(_0x5cbada){if(_0x5cbada){return _0x4f7daf[_0xd325('0x1d')](_0xeec044);}return _0x4f7daf[_0xd325('0x1e')](_0xeec044)[_0xd325('0x1f')]();};}function respondWithResult(_0xcbb74d,_0x492446){_0x492446=_0x492446||0xc8;return function(_0x2722dc){if(_0x2722dc){return _0xcbb74d[_0xd325('0x1e')](_0x492446)[_0xd325('0x20')](_0x2722dc);}};}function respondWithFilteredResult(_0xb3cdc4,_0x2e5273){return function(_0x446d60){if(_0x446d60){var _0x111b20=typeof _0x2e5273[_0xd325('0x21')]==='undefined'&&typeof _0x2e5273[_0xd325('0x22')]===_0xd325('0x23');var _0x2bb5a3=_0x446d60[_0xd325('0x24')];var _0x4fde96=_0x111b20?0x0:_0x2e5273[_0xd325('0x21')];var _0x2c81db=_0x111b20?_0x446d60[_0xd325('0x24')]:_0x2e5273[_0xd325('0x21')]+_0x2e5273[_0xd325('0x22')];var _0x403b4f;if(_0x2c81db>=_0x2bb5a3){_0x2c81db=_0x2bb5a3;_0x403b4f=0xc8;}else{_0x403b4f=0xce;}_0xb3cdc4['status'](_0x403b4f);return _0xb3cdc4['set'](_0xd325('0x25'),_0x4fde96+'-'+_0x2c81db+'/'+_0x2bb5a3)[_0xd325('0x20')](_0x446d60);}return null;};}function patchUpdates(_0x58ae8c){return function(_0x3fc3c2){try{jsonpatch[_0xd325('0x26')](_0x3fc3c2,_0x58ae8c,!![]);}catch(_0x2e29bb){return BPromise[_0xd325('0x27')](_0x2e29bb);}return _0x3fc3c2[_0xd325('0x28')]();};}function saveUpdates(_0x53c1dd,_0xf32d0){return function(_0x306d29){if(_0x306d29){return _0x306d29[_0xd325('0x29')](_0x53c1dd)[_0xd325('0x2a')](function(_0x52948e){return _0x52948e;});}return null;};}function removeEntity(_0x2799d1,_0x143048){return function(_0x24b9c4){if(_0x24b9c4){return _0x24b9c4[_0xd325('0x2b')]()[_0xd325('0x2a')](function(){var _0x7261d9=_0x24b9c4[_0xd325('0x2c')]({'plain':!![]});var _0x365a19=_0xd325('0x2d');return db[_0xd325('0x2e')][_0xd325('0x2b')]({'where':{'type':_0x365a19,'resourceId':_0x7261d9['id']}})['then'](function(){return _0x24b9c4;});})[_0xd325('0x2a')](function(){_0x2799d1[_0xd325('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c42d7,_0x5b8201){return function(_0x499d1d){if(!_0x499d1d){_0x4c42d7[_0xd325('0x1d')](0x194);}return _0x499d1d;};}function handleError(_0x28dc79,_0x25dd6b){_0x25dd6b=_0x25dd6b||0x1f4;return function(_0x3b828d){logger[_0xd325('0x2f')](_0x3b828d[_0xd325('0x30')]);if(_0x3b828d[_0xd325('0x31')]){delete _0x3b828d[_0xd325('0x31')];}_0x28dc79['status'](_0x25dd6b)[_0xd325('0x32')](_0x3b828d);};}exports[_0xd325('0x33')]=function(_0x4ace9d,_0x539115){var _0x500d4f={},_0x1fb25d={},_0x47174a={'count':0x0,'rows':[]};var _0x56de36=_[_0xd325('0x34')](db[_0xd325('0x35')][_0xd325('0x36')],function(_0x2cc4be){return{'name':_0x2cc4be['fieldName'],'type':_0x2cc4be[_0xd325('0x37')][_0xd325('0x38')]};});_0x1fb25d[_0xd325('0x39')]=_['map'](_0x56de36,'name');_0x1fb25d[_0xd325('0x3a')]=_[_0xd325('0x3b')](_0x4ace9d[_0xd325('0x3a')]);_0x1fb25d[_0xd325('0x3c')]=_[_0xd325('0x3d')](_0x1fb25d['model'],_0x1fb25d[_0xd325('0x3a')]);_0x500d4f[_0xd325('0x3e')]=_[_0xd325('0x3d')](_0x1fb25d[_0xd325('0x39')],qs['fields'](_0x4ace9d[_0xd325('0x3a')][_0xd325('0x3f')]));_0x500d4f['attributes']=_0x500d4f['attributes']['length']?_0x500d4f['attributes']:_0x1fb25d[_0xd325('0x39')];if(!_0x4ace9d[_0xd325('0x3a')][_0xd325('0x40')](_0xd325('0x41'))){_0x500d4f[_0xd325('0x22')]=qs[_0xd325('0x22')](_0x4ace9d[_0xd325('0x3a')][_0xd325('0x22')]);_0x500d4f[_0xd325('0x21')]=qs[_0xd325('0x21')](_0x4ace9d[_0xd325('0x3a')][_0xd325('0x21')]);}_0x500d4f['order']=qs['sort'](_0x4ace9d[_0xd325('0x3a')][_0xd325('0x42')]);_0x500d4f[_0xd325('0x43')]=qs[_0xd325('0x3c')](_[_0xd325('0x44')](_0x4ace9d[_0xd325('0x3a')],_0x1fb25d[_0xd325('0x3c')]),_0x56de36);if(_0x4ace9d[_0xd325('0x3a')]['filter']){_0x500d4f[_0xd325('0x43')]=_[_0xd325('0x45')](_0x500d4f[_0xd325('0x43')],{'$or':_[_0xd325('0x34')](_0x56de36,function(_0x1ee704){if(_0x1ee704['type']!==_0xd325('0x46')){var _0xb295a={};_0xb295a[_0x1ee704[_0xd325('0x31')]]={'$like':'%'+_0x4ace9d[_0xd325('0x3a')]['filter']+'%'};return _0xb295a;}})});}_0x500d4f=_[_0xd325('0x45')]({},_0x500d4f,_0x4ace9d['options']);var _0x4743b3={'where':_0x500d4f[_0xd325('0x43')]};return db[_0xd325('0x35')][_0xd325('0x24')](_0x4743b3)[_0xd325('0x2a')](function(_0x4b3f56){_0x47174a['count']=_0x4b3f56;if(_0x4ace9d[_0xd325('0x3a')][_0xd325('0x47')]){_0x500d4f[_0xd325('0x48')]=[{'all':!![]}];}return db[_0xd325('0x35')][_0xd325('0x49')](_0x500d4f);})[_0xd325('0x2a')](function(_0x241703){_0x47174a[_0xd325('0x4a')]=_0x241703;return _0x47174a;})[_0xd325('0x2a')](respondWithFilteredResult(_0x539115,_0x500d4f))['catch'](handleError(_0x539115,null));};exports[_0xd325('0x4b')]=function(_0x54a9a8,_0xefbc61){var _0x48ab1b={'raw':!![],'where':{'id':_0x54a9a8['params']['id']}},_0x1cf4e4={};_0x1cf4e4[_0xd325('0x39')]=_[_0xd325('0x3b')](db[_0xd325('0x35')]['rawAttributes']);_0x1cf4e4['query']=_[_0xd325('0x3b')](_0x54a9a8[_0xd325('0x3a')]);_0x1cf4e4['filters']=_[_0xd325('0x3d')](_0x1cf4e4[_0xd325('0x39')],_0x1cf4e4['query']);_0x48ab1b[_0xd325('0x3e')]=_[_0xd325('0x3d')](_0x1cf4e4[_0xd325('0x39')],qs[_0xd325('0x3f')](_0x54a9a8[_0xd325('0x3a')]['fields']));_0x48ab1b[_0xd325('0x3e')]=_0x48ab1b[_0xd325('0x3e')]['length']?_0x48ab1b[_0xd325('0x3e')]:_0x1cf4e4['model'];if(_0x54a9a8[_0xd325('0x3a')][_0xd325('0x47')]){_0x48ab1b[_0xd325('0x48')]=[{'all':!![]}];}_0x48ab1b=_[_0xd325('0x45')]({},_0x48ab1b,_0x54a9a8[_0xd325('0x4c')]);return db[_0xd325('0x35')][_0xd325('0x4d')](_0x48ab1b)['then'](handleEntityNotFound(_0xefbc61,null))[_0xd325('0x2a')](respondWithResult(_0xefbc61,null))[_0xd325('0x4e')](handleError(_0xefbc61,null));};exports['create']=function(_0x23bd23,_0x563ac3){return db[_0xd325('0x35')][_0xd325('0x4f')](_0x23bd23[_0xd325('0x50')],{})['then'](function(_0x8c53a2){var _0x2e575a=_0x23bd23['user'][_0xd325('0x2c')]({'plain':!![]});if(!_0x2e575a)throw new Error(_0xd325('0x51'));if(_0x2e575a[_0xd325('0x52')]==='user'){var _0x1e5e96=_0x8c53a2[_0xd325('0x2c')]({'plain':!![]});var _0x2cae12='Pauses';return db[_0xd325('0x53')][_0xd325('0x4d')]({'where':{'name':_0x2cae12,'userProfileId':_0x2e575a[_0xd325('0x54')]},'raw':!![]})[_0xd325('0x2a')](function(_0x19d6f5){if(_0x19d6f5&&_0x19d6f5[_0xd325('0x55')]===0x0){return db['UserProfileResource'][_0xd325('0x4f')]({'name':_0x1e5e96[_0xd325('0x31')],'resourceId':_0x1e5e96['id'],'type':_0x19d6f5[_0xd325('0x31')],'sectionId':_0x19d6f5['id']},{})[_0xd325('0x2a')](function(){return _0x8c53a2;});}else{return _0x8c53a2;}})[_0xd325('0x4e')](function(_0x246760){logger[_0xd325('0x2f')](_0xd325('0x56'),_0x246760);throw _0x246760;});}return _0x8c53a2;})['then'](respondWithResult(_0x563ac3,0xc9))[_0xd325('0x4e')](handleError(_0x563ac3,null));};exports[_0xd325('0x29')]=function(_0x41de87,_0x1c0bf4){if(_0x41de87[_0xd325('0x50')]['id']){delete _0x41de87['body']['id'];}return db[_0xd325('0x35')][_0xd325('0x4d')]({'where':{'id':_0x41de87[_0xd325('0x57')]['id']}})[_0xd325('0x2a')](handleEntityNotFound(_0x1c0bf4,null))[_0xd325('0x2a')](saveUpdates(_0x41de87['body'],null))[_0xd325('0x2a')](respondWithResult(_0x1c0bf4,null))[_0xd325('0x4e')](handleError(_0x1c0bf4,null));};exports[_0xd325('0x2b')]=function(_0x1aa2fc,_0x564378){return db[_0xd325('0x35')][_0xd325('0x4d')]({'where':{'id':_0x1aa2fc['params']['id']}})[_0xd325('0x2a')](handleEntityNotFound(_0x564378,null))['then'](removeEntity(_0x564378,null))[_0xd325('0x4e')](handleError(_0x564378,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index c99510d..03b6330 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 _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x21262e,_0x2c20fd){var _0x3b1223=function(_0x52d163){while(--_0x52d163){_0x21262e['push'](_0x21262e['shift']());}};_0x3b1223(++_0x2c20fd);}(_0x53ec,0x192));var _0xc53e=function(_0x13fb4f,_0x42f6af){_0x13fb4f=_0x13fb4f-0x0;var _0x298a4e=_0x53ec[_0x13fb4f];return _0x298a4e;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x55f561,_0x321b41){var _0x2bc1dd=function(_0x5c763c){while(--_0x5c763c){_0x55f561['push'](_0x55f561['shift']());}};_0x2bc1dd(++_0x321b41);}(_0x814b,0x1a2));var _0xb814=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x814b[_0x817d9b];return _0x2752e1;};'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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 4f7fc7f..bddc8f2 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x334489,_0x12af94){var _0x2c0556=function(_0x9973b8){while(--_0x9973b8){_0x334489['push'](_0x334489['shift']());}};_0x2c0556(++_0x12af94);}(_0x7a54,0x106));var _0x47a5=function(_0x3f3280,_0xb66fc1){_0x3f3280=_0x3f3280-0x0;var _0x451f27=_0x7a54[_0x3f3280];return _0x451f27;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x3ffa89,_0x3304db){var _0x72f747=function(_0x30debb){while(--_0x30debb){_0x3ffa89['push'](_0x3ffa89['shift']());}};_0x72f747(++_0x3304db);}(_0x7a54,0x106));var _0x47a5=function(_0x5733ef,_0x1b8050){_0x5733ef=_0x5733ef-0x0;var _0x5ceba0=_0x7a54[_0x5733ef];return _0x5ceba0;};'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 4ae7bee..dd813e6 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 _0x524a=['show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','format','basename','now','extname','post','single','file','/webhook','webhookPost','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./plugin.controller','get','isAuthenticated','webhookGet'];(function(_0x363d6a,_0x5e0228){var _0xaab1d9=function(_0x477821){while(--_0x477821){_0x363d6a['push'](_0x363d6a['shift']());}};_0xaab1d9(++_0x5e0228);}(_0x524a,0xf5));var _0xa524=function(_0x1fb362,_0x9860d4){_0x1fb362=_0x1fb362-0x0;var _0x3bca96=_0x524a[_0x1fb362];return _0x3bca96;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require('express');var router=express[_0xa524('0x4')]();var fs_extra=require(_0xa524('0x5'));var auth=require(_0xa524('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa524('0x7'));router[_0xa524('0x8')]('/',auth[_0xa524('0x9')](),controller['index']);router[_0xa524('0x8')]('/webhook',controller[_0xa524('0xa')]);router[_0xa524('0x8')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0xb')]);router[_0xa524('0x8')](_0xa524('0xc'),auth[_0xa524('0x9')](),controller['download']);var upload=multer({'storage':multer[_0xa524('0xd')]({'destination':function(_0x2ebea2,_0x59660a,_0x565fab){_0x565fab(null,path[_0xa524('0xe')](config[_0xa524('0xf')],_0xa524('0x10')));},'filename':function(_0x4936fa,_0x55117f,_0x14a0d6){_0x55117f['originalname']=_0x55117f[_0xa524('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x14a0d6(null,util[_0xa524('0x12')]('%s-%s%s',path[_0xa524('0x13')](_0x55117f[_0xa524('0x11')],path['extname'](_0x55117f[_0xa524('0x11')])),Date[_0xa524('0x14')](),path[_0xa524('0x15')](_0x55117f[_0xa524('0x11')])));}})});router[_0xa524('0x16')]('/',upload[_0xa524('0x17')](_0xa524('0x18')),controller['upload']);router[_0xa524('0x16')](_0xa524('0x19'),controller[_0xa524('0x1a')]);router[_0xa524('0x1b')](_0xa524('0x1c'),auth[_0xa524('0x9')](),controller[_0xa524('0x1d')]);router[_0xa524('0x1e')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0x1e')]);module[_0xa524('0x1f')]=router; \ No newline at end of file +var _0xf021=['server/files/plugins','originalname','basename','extname','now','post','file','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/webhook','webhookGet','/:id','show','download','diskStorage','root'];(function(_0x4aeb5a,_0x56ef9e){var _0x2ec1a2=function(_0x4bfaad){while(--_0x4bfaad){_0x4aeb5a['push'](_0x4aeb5a['shift']());}};_0x2ec1a2(++_0x56ef9e);}(_0xf021,0x18f));var _0x1f02=function(_0x1f0f2a,_0x14f11a){_0x1f0f2a=_0x1f0f2a-0x0;var _0x145cd9=_0xf021[_0x1f0f2a];return _0x145cd9;};'use strict';var multer=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var path=require(_0x1f02('0x2'));var timeout=require(_0x1f02('0x3'));var express=require(_0x1f02('0x4'));var router=express['Router']();var fs_extra=require(_0x1f02('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1f02('0x6'));var config=require(_0x1f02('0x7'));var controller=require('./plugin.controller');router['get']('/',auth[_0x1f02('0x8')](),controller['index']);router[_0x1f02('0x9')](_0x1f02('0xa'),controller[_0x1f02('0xb')]);router[_0x1f02('0x9')](_0x1f02('0xc'),auth['isAuthenticated'](),controller[_0x1f02('0xd')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x1f02('0xe')]);var upload=multer({'storage':multer[_0x1f02('0xf')]({'destination':function(_0x1a93ec,_0x19ee35,_0x3c2b15){_0x3c2b15(null,path['join'](config[_0x1f02('0x10')],_0x1f02('0x11')));},'filename':function(_0x204e17,_0x56a2c2,_0x24e9b8){_0x56a2c2[_0x1f02('0x12')]=_0x56a2c2[_0x1f02('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x24e9b8(null,util['format']('%s-%s%s',path[_0x1f02('0x13')](_0x56a2c2[_0x1f02('0x12')],path[_0x1f02('0x14')](_0x56a2c2[_0x1f02('0x12')])),Date[_0x1f02('0x15')](),path[_0x1f02('0x14')](_0x56a2c2[_0x1f02('0x12')])));}})});router[_0x1f02('0x16')]('/',upload['single'](_0x1f02('0x17')),controller['upload']);router['post']('/webhook',controller['webhookPost']);router[_0x1f02('0x18')](_0x1f02('0xc'),auth[_0x1f02('0x8')](),controller['update']);router[_0x1f02('0x19')](_0x1f02('0xc'),auth[_0x1f02('0x8')](),controller[_0x1f02('0x19')]);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 1b65954..67053a8 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 _0x6749=['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','always','never','STRING'];(function(_0x1090d6,_0x947d13){var _0x210d4d=function(_0x4ede2a){while(--_0x4ede2a){_0x1090d6['push'](_0x1090d6['shift']());}};_0x210d4d(++_0x947d13);}(_0x6749,0x1af));var _0x9674=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6749[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9674('0x0')]},'type':{'type':Sequelize[_0x9674('0x1')](_0x9674('0x2'),_0x9674('0x3'))},'description':{'type':Sequelize[_0x9674('0x4')]},'version':{'type':Sequelize[_0x9674('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0x9674('0x5')},'active':{'type':Sequelize[_0x9674('0x6')],'defaultValue':0x0,'comment':_0x9674('0x7')},'sidebar':{'type':Sequelize[_0x9674('0x1')](_0x9674('0x8'),_0x9674('0x9'),_0x9674('0xa'),_0x9674('0xb')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x9674('0x0')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x9674('0x0')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x9674('0x0')]}}; \ No newline at end of file +var _0xce2b=['script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html'];(function(_0x3f8743,_0x33973f){var _0x1f844c=function(_0x568841){while(--_0x568841){_0x3f8743['push'](_0x3f8743['shift']());}};_0x1f844c(++_0x33973f);}(_0xce2b,0x11a));var _0xbce2=function(_0x478754,_0x1ceb87){_0x478754=_0x478754-0x0;var _0x30b765=_0xce2b[_0x478754];return _0x30b765;};'use strict';var Sequelize=require(_0xbce2('0x0'));module[_0xbce2('0x1')]={'name':{'type':Sequelize[_0xbce2('0x2')]},'type':{'type':Sequelize['ENUM'](_0xbce2('0x3'),_0xbce2('0x4'))},'description':{'type':Sequelize[_0xbce2('0x5')]},'version':{'type':Sequelize[_0xbce2('0x5')]},'path':{'type':Sequelize[_0xbce2('0x2')],'comment':_0xbce2('0x6')},'active':{'type':Sequelize[_0xbce2('0x7')],'defaultValue':0x0,'comment':_0xbce2('0x8')},'sidebar':{'type':Sequelize[_0xbce2('0x9')]('adminOnly',_0xbce2('0xa'),_0xbce2('0xb'),'never'),'defaultValue':_0xbce2('0xb'),'comment':_0xbce2('0xc')},'icon':{'type':Sequelize[_0xbce2('0x2')]},'adminUrl':{'type':Sequelize[_0xbce2('0x2')]},'agentUrl':{'type':Sequelize[_0xbce2('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index e53553a..e160cb7 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 _0xc8a9=['Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','resolve','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','then','get','destroy','sendStatus','error','send','map','Plugin','fieldName','type','name','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','catch','download','path','root','server/files/plugins','format','zip','warning','code','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','%s.zip','Error','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','file','filename','extname','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:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','admin','script','scriptName'];(function(_0x39d481,_0x23c1a2){var _0x3b22d0=function(_0xea81e6){while(--_0xea81e6){_0x39d481['push'](_0x39d481['shift']());}};_0x3b22d0(++_0x23c1a2);}(_0xc8a9,0xd8));var _0x9c8a=function(_0x1dbb78,_0x363527){_0x1dbb78=_0x1dbb78-0x0;var _0x97030a=_0xc8a9[_0x1dbb78];return _0x97030a;};'use strict';var emlformat=require(_0x9c8a('0x0'));var rimraf=require(_0x9c8a('0x1'));var zipdir=require(_0x9c8a('0x2'));var jsonpatch=require(_0x9c8a('0x3'));var rp=require(_0x9c8a('0x4'));var moment=require(_0x9c8a('0x5'));var BPromise=require(_0x9c8a('0x6'));var Mustache=require(_0x9c8a('0x7'));var util=require(_0x9c8a('0x8'));var path=require('path');var sox=require(_0x9c8a('0x9'));var csv=require(_0x9c8a('0xa'));var ejs=require(_0x9c8a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9c8a('0xc'));var crypto=require(_0x9c8a('0xd'));var jsforce=require(_0x9c8a('0xe'));var deskjs=require(_0x9c8a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9c8a('0x10'));var Papa=require(_0x9c8a('0x11'));var extract=require(_0x9c8a('0x12'));var rimraf=require(_0x9c8a('0x1'));var archiver=require(_0x9c8a('0x13'));var Redis=require(_0x9c8a('0x14'));var authService=require(_0x9c8a('0x15'));var qs=require(_0x9c8a('0x16'));var as=require(_0x9c8a('0x17'));var hardwareService=require(_0x9c8a('0x18'));var logger=require(_0x9c8a('0x19'))(_0x9c8a('0x1a'));var utils=require(_0x9c8a('0x1b'));var config=require(_0x9c8a('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c8a('0x1d'))['db'];config['redis']=_[_0x9c8a('0x1e')](config[_0x9c8a('0x1f')],{'host':_0x9c8a('0x20'),'port':0x18eb});var socket=require(_0x9c8a('0x21'))(new Redis(config['redis']));require(_0x9c8a('0x22'))['register'](socket);function respondWithStatusCode(_0x497f58,_0x421690){_0x421690=_0x421690||0xcc;return function(_0x4b730f){if(_0x4b730f){return _0x497f58['sendStatus'](_0x421690);}return _0x497f58[_0x9c8a('0x23')](_0x421690)[_0x9c8a('0x24')]();};}function respondWithResult(_0x4d7b8c,_0x47fe1){_0x47fe1=_0x47fe1||0xc8;return function(_0x1c2334){if(_0x1c2334){return _0x4d7b8c[_0x9c8a('0x23')](_0x47fe1)[_0x9c8a('0x25')](_0x1c2334);}};}function respondWithFilteredResult(_0x48185e,_0x7c89bb){return function(_0x25abe9){if(_0x25abe9){var _0x430698=typeof _0x7c89bb['offset']===_0x9c8a('0x26')&&typeof _0x7c89bb['limit']==='undefined';var _0x3e7456=_0x25abe9[_0x9c8a('0x27')];var _0x53b273=_0x430698?0x0:_0x7c89bb[_0x9c8a('0x28')];var _0x2c1450=_0x430698?_0x25abe9['count']:_0x7c89bb[_0x9c8a('0x28')]+_0x7c89bb[_0x9c8a('0x29')];var _0x1ee284;if(_0x2c1450>=_0x3e7456){_0x2c1450=_0x3e7456;_0x1ee284=0xc8;}else{_0x1ee284=0xce;}_0x48185e[_0x9c8a('0x23')](_0x1ee284);return _0x48185e['set'](_0x9c8a('0x2a'),_0x53b273+'-'+_0x2c1450+'/'+_0x3e7456)['json'](_0x25abe9);}return null;};}function patchUpdates(_0x552f3a){return function(_0x5cd2f0){try{jsonpatch[_0x9c8a('0x2b')](_0x5cd2f0,_0x552f3a,!![]);}catch(_0x2d6b4e){return BPromise[_0x9c8a('0x2c')](_0x2d6b4e);}return _0x5cd2f0[_0x9c8a('0x2d')]();};}function saveUpdates(_0x1b493c,_0xb8aca2){return function(_0x220ad6){if(_0x220ad6){return _0x220ad6['update'](_0x1b493c)[_0x9c8a('0x2e')](function(_0x46b567){return _0x46b567;});}return null;};}function removeEntity(_0x1cfd04,_0x509dd0){return function(_0x478aac){if(_0x478aac){return _0x478aac['destroy']()[_0x9c8a('0x2e')](function(){var _0x46d2cd=_0x478aac[_0x9c8a('0x2f')]({'plain':!![]});var _0x453377='Plugins';return db['UserProfileResource'][_0x9c8a('0x30')]({'where':{'type':_0x453377,'resourceId':_0x46d2cd['id']}})[_0x9c8a('0x2e')](function(){return _0x478aac;});})['then'](function(){_0x1cfd04[_0x9c8a('0x23')](0xcc)[_0x9c8a('0x24')]();});}};}function handleEntityNotFound(_0x4c61ba,_0x215f8e){return function(_0x5b348e){if(!_0x5b348e){_0x4c61ba[_0x9c8a('0x31')](0x194);}return _0x5b348e;};}function handleError(_0x3763c4,_0x2e864b){_0x2e864b=_0x2e864b||0x1f4;return function(_0x4f28f1){logger[_0x9c8a('0x32')](_0x4f28f1['stack']);if(_0x4f28f1['name']){delete _0x4f28f1['name'];}_0x3763c4[_0x9c8a('0x23')](_0x2e864b)[_0x9c8a('0x33')](_0x4f28f1);};}exports['index']=function(_0x321866,_0x3663dd){var _0x11d063={},_0x31b70d={},_0x4d2b4f={'count':0x0,'rows':[]};var _0xc62998=_[_0x9c8a('0x34')](db[_0x9c8a('0x35')]['rawAttributes'],function(_0x586ffe){return{'name':_0x586ffe[_0x9c8a('0x36')],'type':_0x586ffe[_0x9c8a('0x37')]['key']};});_0x31b70d['model']=_[_0x9c8a('0x34')](_0xc62998,_0x9c8a('0x38'));_0x31b70d[_0x9c8a('0x39')]=_['keys'](_0x321866['query']);_0x31b70d[_0x9c8a('0x3a')]=_['intersection'](_0x31b70d[_0x9c8a('0x3b')],_0x31b70d[_0x9c8a('0x39')]);_0x11d063['attributes']=_[_0x9c8a('0x3c')](_0x31b70d[_0x9c8a('0x3b')],qs[_0x9c8a('0x3d')](_0x321866['query'][_0x9c8a('0x3d')]));_0x11d063[_0x9c8a('0x3e')]=_0x11d063[_0x9c8a('0x3e')][_0x9c8a('0x3f')]?_0x11d063['attributes']:_0x31b70d[_0x9c8a('0x3b')];if(!_0x321866['query'][_0x9c8a('0x40')](_0x9c8a('0x41'))){_0x11d063[_0x9c8a('0x29')]=qs['limit'](_0x321866[_0x9c8a('0x39')][_0x9c8a('0x29')]);_0x11d063[_0x9c8a('0x28')]=qs['offset'](_0x321866['query']['offset']);}_0x11d063['order']=qs['sort'](_0x321866[_0x9c8a('0x39')][_0x9c8a('0x42')]);_0x11d063[_0x9c8a('0x43')]=qs[_0x9c8a('0x3a')](_[_0x9c8a('0x44')](_0x321866['query'],_0x31b70d[_0x9c8a('0x3a')]),_0xc62998);if(_0x321866[_0x9c8a('0x39')][_0x9c8a('0x45')]){_0x11d063[_0x9c8a('0x43')]=_[_0x9c8a('0x46')](_0x11d063[_0x9c8a('0x43')],{'$or':_['map'](_0xc62998,function(_0x48cdb6){if(_0x48cdb6[_0x9c8a('0x37')]!=='VIRTUAL'){var _0x2069c8={};_0x2069c8[_0x48cdb6[_0x9c8a('0x38')]]={'$like':'%'+_0x321866[_0x9c8a('0x39')][_0x9c8a('0x45')]+'%'};return _0x2069c8;}})});}_0x11d063=_['merge']({},_0x11d063,_0x321866['options']);var _0x418fab={'where':_0x11d063['where']};return db['Plugin']['count'](_0x418fab)[_0x9c8a('0x2e')](function(_0x3fbf96){_0x4d2b4f[_0x9c8a('0x27')]=_0x3fbf96;if(_0x321866[_0x9c8a('0x39')]['includeAll']){_0x11d063[_0x9c8a('0x47')]=[{'all':!![]}];}return db[_0x9c8a('0x35')][_0x9c8a('0x48')](_0x11d063);})[_0x9c8a('0x2e')](function(_0x59eec4){_0x4d2b4f[_0x9c8a('0x49')]=_0x59eec4;return _0x4d2b4f;})[_0x9c8a('0x2e')](respondWithFilteredResult(_0x3663dd,_0x11d063))['catch'](handleError(_0x3663dd,null));};exports[_0x9c8a('0x4a')]=function(_0x1993cc,_0x2e5029){var _0x3352fb={'raw':!![],'where':{'id':_0x1993cc[_0x9c8a('0x4b')]['id']}},_0x28d2b1={};_0x28d2b1[_0x9c8a('0x3b')]=_[_0x9c8a('0x4c')](db[_0x9c8a('0x35')][_0x9c8a('0x4d')]);_0x28d2b1['query']=_['keys'](_0x1993cc[_0x9c8a('0x39')]);_0x28d2b1[_0x9c8a('0x3a')]=_[_0x9c8a('0x3c')](_0x28d2b1[_0x9c8a('0x3b')],_0x28d2b1[_0x9c8a('0x39')]);_0x3352fb[_0x9c8a('0x3e')]=_['intersection'](_0x28d2b1['model'],qs[_0x9c8a('0x3d')](_0x1993cc[_0x9c8a('0x39')][_0x9c8a('0x3d')]));_0x3352fb[_0x9c8a('0x3e')]=_0x3352fb[_0x9c8a('0x3e')][_0x9c8a('0x3f')]?_0x3352fb['attributes']:_0x28d2b1[_0x9c8a('0x3b')];if(_0x1993cc[_0x9c8a('0x39')][_0x9c8a('0x4e')]){_0x3352fb['include']=[{'all':!![]}];}_0x3352fb=_[_0x9c8a('0x46')]({},_0x3352fb,_0x1993cc['options']);return db[_0x9c8a('0x35')][_0x9c8a('0x4f')](_0x3352fb)['then'](handleEntityNotFound(_0x2e5029,null))[_0x9c8a('0x2e')](respondWithResult(_0x2e5029,null))[_0x9c8a('0x50')](handleError(_0x2e5029,null));};exports[_0x9c8a('0x51')]=function(_0x179c96,_0x397083,_0x28039b){return db['Plugin'][_0x9c8a('0x4f')]({'where':{'id':_0x179c96[_0x9c8a('0x4b')]['id']},'attributes':[_0x9c8a('0x38'),_0x9c8a('0x52')],'raw':!![]})[_0x9c8a('0x2e')](handleEntityNotFound(_0x397083,null))[_0x9c8a('0x2e')](function(_0x1f9234){if(_0x1f9234){var _0x4b7b87=path['join'](config[_0x9c8a('0x53')],_0x9c8a('0x54'),util[_0x9c8a('0x55')]('%s.zip',path['basename'](_0x1f9234[_0x9c8a('0x52')])));var _0xce55d5=fs['createWriteStream'](_0x4b7b87);var _0x34d40c=archiver(_0x9c8a('0x56'),{'zlib':{'level':0x9}});_0x34d40c['on'](_0x9c8a('0x57'),function(_0x24d860){if(_0x24d860[_0x9c8a('0x58')]==='ENOENT'){logger[_0x9c8a('0x32')](_0x24d860);}else{throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x34d40c['on'](_0x9c8a('0x32'),function(_0x5b37b8){throw new db[(_0x9c8a('0x59'))]['Error'](_0x9c8a('0x5a'));});_0x34d40c['pipe'](_0xce55d5);_0x34d40c[_0x9c8a('0x5b')](_0x9c8a('0x5c'),{'cwd':path[_0x9c8a('0x5d')](config[_0x9c8a('0x53')],_0x9c8a('0x54'),path[_0x9c8a('0x5e')](_0x1f9234['path'])),'ignore':[path[_0x9c8a('0x5d')](path[_0x9c8a('0x5f')](_0x1f9234[_0x9c8a('0x52')]),_0x9c8a('0x60')),path['join'](path[_0x9c8a('0x5f')](_0x1f9234[_0x9c8a('0x52')]),_0x9c8a('0x61'))],'nodir':!![]})[_0x9c8a('0x62')]();_0xce55d5['on'](_0x9c8a('0x63'),function(){if(!fs[_0x9c8a('0x64')](_0x4b7b87)){throw new db[(_0x9c8a('0x59'))]['Error'](_0x9c8a('0x65'));}return _0x397083[_0x9c8a('0x51')](_0x4b7b87,util[_0x9c8a('0x55')](_0x9c8a('0x66'),path['basename'](_0x1f9234[_0x9c8a('0x52')])),function(_0x5c4d2e){if(_0x5c4d2e){throw new db[(_0x9c8a('0x59'))][(_0x9c8a('0x67'))](_0x9c8a('0x68'));}fs[_0x9c8a('0x69')](_0x4b7b87);logger[_0x9c8a('0x6a')](_0x9c8a('0x6b'));logger[_0x9c8a('0x6a')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x397083,null));};exports[_0x9c8a('0x6c')]=function(_0x5a534b,_0x42fa7e,_0x203536){var _0x16c44c=path[_0x9c8a('0x5f')](_0x5a534b[_0x9c8a('0x6d')][_0x9c8a('0x6e')],path[_0x9c8a('0x6f')](_0x5a534b[_0x9c8a('0x6d')][_0x9c8a('0x6e')]));var _0xdea4ba=path[_0x9c8a('0x5d')](config[_0x9c8a('0x53')],'server/files/plugins',_0x5a534b[_0x9c8a('0x6d')][_0x9c8a('0x6e')]);var _0x42210a=path[_0x9c8a('0x5d')](config['root'],'server/files/plugins',_0x16c44c);logger[_0x9c8a('0x6a')](_0x9c8a('0x70'),_0xdea4ba);logger[_0x9c8a('0x6a')](_0x9c8a('0x71'),_0x42210a);try{fs['chmodSync'](_0xdea4ba,parseInt(_0x9c8a('0x72'),0x8));extract(_0xdea4ba,{'dir':_0x42210a},function(_0x1045bc){if(_0x1045bc){logger[_0x9c8a('0x32')](_0x1045bc);handleError(_0x1045bc,!![]);};var _0xa0b6f3=fs[_0x9c8a('0x73')](_0x42210a);if(_0xa0b6f3[_0x9c8a('0x3f')]>0x1){removeReferences(_0xdea4ba,_0x42210a);logger['error']('Invalid\x20plugin\x20structure');return _0x203536(new Error(_0x9c8a('0x74')));}var _0x3f0614=fs[_0x9c8a('0x75')](path[_0x9c8a('0x5d')](_0x42210a,_0xa0b6f3[0x0]));if(_0x3f0614[_0x9c8a('0x76')]()){removeReferences(_0xdea4ba,_0x42210a);logger[_0x9c8a('0x32')](_0x9c8a('0x74'));return _0x203536(new Error('Invalid\x20plugin\x20structure'));}if(_0x3f0614[_0x9c8a('0x77')]()){var _0x120ed6=fs[_0x9c8a('0x73')](path[_0x9c8a('0x5d')](_0x42210a,_0xa0b6f3[0x0]));if(_0x120ed6[_0x9c8a('0x3f')]===0x0){removeReferences(_0xdea4ba,_0x42210a);logger[_0x9c8a('0x32')](_0x9c8a('0x74'));return _0x203536(new Error(_0x9c8a('0x74')));}var _0x384c13=_0x120ed6[_0x9c8a('0x78')](function(_0x210da0){return _0x210da0===_0x9c8a('0x79');});if(!_0x384c13){return _0x203536(new Error(_0x9c8a('0x7a')));}var _0x6b22bc=fs[_0x9c8a('0x7b')](path['join'](_0x42210a,_0xa0b6f3[0x0],_0x9c8a('0x79')));var _0x3e519a=JSON[_0x9c8a('0x7c')](_0x6b22bc);if(_0x9c8a('0x26')==typeof _0x3e519a['name']){return _0x203536(new Error(_0x9c8a('0x7d')));}if(_0x9c8a('0x26')==typeof _0x3e519a[_0x9c8a('0x37')]){return _0x203536(new Error(_0x9c8a('0x7e')));}if(_0x9c8a('0x26')==typeof _0x3e519a[_0x9c8a('0x7f')]){return _0x203536(new Error(_0x9c8a('0x80')));}if(_0x9c8a('0x26')==typeof _0x3e519a['parameters']){return _0x203536(new Error(_0x9c8a('0x81')));}if(_0x3e519a[_0x9c8a('0x37')]===_0x9c8a('0x82')){if(_0x9c8a('0x26')==typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')]){return _0x203536(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x9c8a('0x26')==typeof _0x3e519a['parameters'][_0x9c8a('0x84')][_0x9c8a('0x85')]&&_0x9c8a('0x26')==typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')]['agent']){return _0x203536(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x3e519a[_0x9c8a('0x37')]===_0x9c8a('0x86')){if(_0x9c8a('0x26')==typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x87')]){return _0x203536(new Error(_0x9c8a('0x88')));}if(_0x9c8a('0x26')==typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x89')]){return _0x203536(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x203536(new Error(_0x9c8a('0x8a')));}var _0x3884e6=_0x3e519a[_0x9c8a('0x38')];var _0x53fe1a=_0x3e519a[_0x9c8a('0x8b')];var _0x3a1316=_0x3e519a[_0x9c8a('0x37')];var _0x3c1e77=_0x3e519a[_0x9c8a('0x8c')]?_0x3e519a['sidebar']:'always';var _0x1744ac=_0x3e519a[_0x9c8a('0x8d')]?_0x3e519a[_0x9c8a('0x8d')]:'icon-apps';var _0x9230fd='';var _0x506e37='';var _0x3f52ae='';var _0x14c9a8='';var _0x15554e=_0x3e519a[_0x9c8a('0x7f')];if(_0x3a1316===_0x9c8a('0x82')){if(_0x9c8a('0x26')!=typeof _0x3e519a['parameters'][_0x9c8a('0x84')][_0x9c8a('0x85')]){var _0x4912ae=_0x3e519a[_0x9c8a('0x83')]['views'][_0x9c8a('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x9c8a('0x8e')](_0x4912ae)){_0x9230fd=path[_0x9c8a('0x5d')]('plugins',_0x16c44c,_0xa0b6f3[0x0],_0x4912ae);}else{_0x9230fd=_0x4912ae;}}else{logger[_0x9c8a('0x6a')](_0x9c8a('0x8f'));}if('undefined'!=typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')]['agent']){var _0x2a61ff=_0x3e519a[_0x9c8a('0x83')]['views'][_0x9c8a('0x90')];if(!/^(f|ht)tps?:\/\//i[_0x9c8a('0x8e')](_0x2a61ff)){_0x506e37=path[_0x9c8a('0x5d')](_0x9c8a('0x91'),_0x16c44c,_0xa0b6f3[0x0],_0x2a61ff);}else{_0x506e37=_0x2a61ff;}}else{logger[_0x9c8a('0x6a')](_0x9c8a('0x92'));}}else if(_0x3a1316==='script'){_0x3f52ae=_0x3e519a[_0x9c8a('0x83')]['scriptName'];_0x14c9a8=_0x3e519a['parameters']['scriptPath'];if('undefined'!=typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')]){if(_0x9c8a('0x26')!=typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')][_0x9c8a('0x85')]){var _0x4912ae=_0x3e519a[_0x9c8a('0x83')]['views'][_0x9c8a('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x9c8a('0x8e')](_0x4912ae)){_0x9230fd=path[_0x9c8a('0x5d')]('plugins',_0x16c44c,_0xa0b6f3[0x0],_0x4912ae);}else{_0x9230fd=_0x4912ae;}}if(_0x9c8a('0x26')!=typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')]['agent']){var _0x2a61ff=_0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x9c8a('0x8e')](_0x2a61ff)){_0x506e37=path[_0x9c8a('0x5d')](_0x9c8a('0x91'),_0x16c44c,_0xa0b6f3[0x0],_0x2a61ff);}else{_0x506e37=_0x2a61ff;}}}}var _0x58890d={'name':_0x3884e6,'description':_0x53fe1a,'path':path['join'](_0x16c44c,_0xa0b6f3[0x0]),'type':_0x3a1316,'sidebar':_0x3c1e77,'icon':_0x1744ac,'adminUrl':_0x9230fd,'agentUrl':_0x506e37,'scriptName':_0x3f52ae,'scriptPath':_0x14c9a8,'version':_0x15554e};removeReferences(_0xdea4ba,null);return db[_0x9c8a('0x35')]['create'](_0x58890d)[_0x9c8a('0x2e')](function(_0x47def6){var _0x1ea2cb={'role':_0x5a534b[_0x9c8a('0x93')][_0x9c8a('0x94')],'userProfileId':_0x5a534b[_0x9c8a('0x93')][_0x9c8a('0x95')]};if(!_0x1ea2cb)throw new Error(_0x9c8a('0x96'));if(_0x1ea2cb['role']===_0x9c8a('0x97')){var _0x3e34b6=_0x47def6[_0x9c8a('0x2f')]({'plain':!![]});return db[_0x9c8a('0x98')][_0x9c8a('0x4f')]({'where':{'name':'Plugins','userProfileId':_0x1ea2cb['userProfileId']},'raw':!![]})['then'](function(_0x841c2f){if(_0x841c2f&&_0x841c2f[_0x9c8a('0x99')]===0x0){return db[_0x9c8a('0x9a')][_0x9c8a('0x9b')]({'name':_0x3e34b6['name'],'resourceId':_0x3e34b6['id'],'type':_0x841c2f['name'],'sectionId':_0x841c2f['id']},{})[_0x9c8a('0x2e')](function(){return _0x47def6;});}else{return _0x47def6;}})[_0x9c8a('0x50')](function(_0x427cb2){logger[_0x9c8a('0x32')](_0x9c8a('0x9c'),_0x427cb2);throw _0x427cb2;});}return _0x47def6;})['then'](respondWithResult(_0x42fa7e,null))['catch'](handleError(_0x42fa7e,null));}});}catch(_0x80e33){_0x42fa7e[_0x9c8a('0x23')](0x1f4)[_0x9c8a('0x33')](_0x80e33);}};function removeReferences(_0x4880af,_0x2acda7){try{if(_0x4880af){fs[_0x9c8a('0x69')](_0x4880af);logger['info'](_0x9c8a('0x9d'));}if(_0x2acda7){rimraf(_0x2acda7,function(){});logger[_0x9c8a('0x6a')](_0x9c8a('0x9e'));}}catch(_0x51fbe9){logger[_0x9c8a('0x32')](_0x51fbe9);}}exports[_0x9c8a('0x9f')]=function(_0x9e4120,_0x4f2388,_0x22e8c9){return db[_0x9c8a('0x35')]['find']({'where':{'id':_0x9e4120[_0x9c8a('0x4b')]['id']}})[_0x9c8a('0x2e')](handleEntityNotFound(_0x4f2388,null))[_0x9c8a('0x2e')](saveUpdates(_0x9e4120[_0x9c8a('0x93')],null))['then'](respondWithResult(_0x4f2388,null))[_0x9c8a('0x50')](handleError(_0x4f2388,null));};exports['delete']=function(_0x256e4c,_0x2d362e,_0x2f4a27){return db[_0x9c8a('0x35')][_0x9c8a('0x4f')]({'where':{'id':_0x256e4c['params']['id']}})[_0x9c8a('0x2e')](function(_0x7444bb){if(_0x7444bb){return _0x7444bb[_0x9c8a('0x30')]();}})['then'](function(_0x2ecd70){rimraf(path[_0x9c8a('0x5d')](config[_0x9c8a('0x53')],'server/files/plugins',path[_0x9c8a('0x5e')](_0x2ecd70[_0x9c8a('0x52')])),function(){});return _0x2ecd70;})[_0x9c8a('0x2e')](handleEntityNotFound(_0x2d362e,null))[_0x9c8a('0x2e')](respondWithStatusCode(_0x2d362e,null))[_0x9c8a('0x50')](handleError(_0x2d362e,null));};exports[_0x9c8a('0xa0')]=function(_0x971bc2,_0x212ab7,_0x47bb8c){return BPromise['resolve']()[_0x9c8a('0x2e')](function(){if(!_0x971bc2['query'][_0x9c8a('0x52')]){throw new Error(_0x9c8a('0xa1'));}if(!_0x971bc2[_0x9c8a('0x39')][_0x9c8a('0xa2')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x197d04=_0x971bc2[_0x9c8a('0x39')]['hostname']?_0x971bc2[_0x9c8a('0x39')][_0x9c8a('0xa3')]+':'+_0x971bc2[_0x9c8a('0x39')]['port']:_0x9c8a('0xa4')+_0x971bc2[_0x9c8a('0x39')]['port'];var _0x48f65d=_0x971bc2[_0x9c8a('0x39')]['json']?_0x971bc2[_0x9c8a('0x39')]['json']:!![];var _0x27a33e=_0x971bc2['query'][_0x9c8a('0xa5')]?_0x971bc2[_0x9c8a('0x39')][_0x9c8a('0xa5')]:null;var _0x4c0f26={'method':_0x971bc2[_0x9c8a('0xa6')],'uri':util[_0x9c8a('0x55')](_0x9c8a('0xa7'),_0x197d04,_0x971bc2[_0x9c8a('0x39')][_0x9c8a('0x52')]),'json':_0x48f65d,'resolveWithFullResponse':!![],'encoding':_0x27a33e,'qs':_0x971bc2[_0x9c8a('0x39')]};if(_0x971bc2[_0x9c8a('0xa8')]){_0x4c0f26[_0x9c8a('0xa8')]=_0x971bc2[_0x9c8a('0xa8')];if(_0x4c0f26['headers'][_0x9c8a('0xa9')]){delete _0x4c0f26[_0x9c8a('0xa8')][_0x9c8a('0xa9')];}}if(_0x4c0f26[_0x9c8a('0xa8')][_0x9c8a('0xaa')]){delete _0x4c0f26[_0x9c8a('0xa8')][_0x9c8a('0xaa')];}return rp(_0x4c0f26);})[_0x9c8a('0x2e')](function(_0x395906){if(_0x395906){_0x212ab7[_0x9c8a('0xab')](_0x395906[_0x9c8a('0xa8')]);logger['info'](_0x395906['body']);if(_[_0x9c8a('0xac')](_0x971bc2[_0x9c8a('0x39')][_0x9c8a('0x52')],'download')&&_0x395906['statusCode']==0x1f4){return _0x212ab7[_0x9c8a('0x31')](_0x395906[_0x9c8a('0xad')]);}else{return _0x212ab7['status'](_0x395906[_0x9c8a('0xad')])['send'](_0x395906[_0x9c8a('0x93')]);}}else{return _0x212ab7[_0x9c8a('0x31')](0xc8);}})[_0x9c8a('0x50')](handleError(_0x212ab7,null));};exports[_0x9c8a('0xae')]=function(_0x5a3c6f,_0x3a4e76,_0x1b4aa0){return BPromise[_0x9c8a('0xaf')]()[_0x9c8a('0x2e')](function(){if(!_0x5a3c6f['query'][_0x9c8a('0x52')]){throw new Error(_0x9c8a('0xa1'));}if(!_0x5a3c6f[_0x9c8a('0x39')][_0x9c8a('0xa2')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x51fd16=_0x5a3c6f[_0x9c8a('0x39')]['hostname']?_0x5a3c6f[_0x9c8a('0x39')][_0x9c8a('0xa3')]+':'+_0x5a3c6f[_0x9c8a('0x39')][_0x9c8a('0xa2')]:_0x9c8a('0xa4')+_0x5a3c6f[_0x9c8a('0x39')][_0x9c8a('0xa2')];var _0x3a2b78=_0x5a3c6f['query'][_0x9c8a('0x25')]?_0x5a3c6f[_0x9c8a('0x39')][_0x9c8a('0x25')]:!![];var _0x30473e=_0x5a3c6f['query']['encoding']?_0x5a3c6f[_0x9c8a('0x39')][_0x9c8a('0xa5')]:null;var _0x554676={'method':_0x5a3c6f[_0x9c8a('0xa6')],'uri':util[_0x9c8a('0x55')](_0x9c8a('0xa7'),_0x51fd16,_0x5a3c6f['query'][_0x9c8a('0x52')]),'json':_0x3a2b78,'resolveWithFullResponse':!![],'encoding':_0x30473e,'body':_0x5a3c6f[_0x9c8a('0x93')]};if(_0x5a3c6f['headers']){_0x554676[_0x9c8a('0xa8')]=_0x5a3c6f[_0x9c8a('0xa8')];if(_0x554676[_0x9c8a('0xa8')][_0x9c8a('0xa9')]){delete _0x554676['headers'][_0x9c8a('0xa9')];}}if(_0x554676[_0x9c8a('0xa8')][_0x9c8a('0xaa')]){delete _0x554676[_0x9c8a('0xa8')][_0x9c8a('0xaa')];}return rp(_0x554676);})['then'](function(_0x565d3c){if(_0x565d3c){_0x3a4e76[_0x9c8a('0xab')](_0x565d3c[_0x9c8a('0xa8')]);logger[_0x9c8a('0x6a')](_0x565d3c[_0x9c8a('0x93')]);return _0x3a4e76['status'](_0x565d3c[_0x9c8a('0xad')])['send'](_0x565d3c[_0x9c8a('0x93')]);}else{return _0x3a4e76[_0x9c8a('0x31')](0xc8);}})['catch'](handleError(_0x3a4e76,null));}; \ No newline at end of file +var _0x5c51=['method','%s%s','headers','content-length','content-type','statusCode','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','archiver','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','get','Plugins','UserProfileResource','then','end','error','stack','name','Plugin','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','include','findAll','catch','show','keys','includeAll','download','find','params','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','**/*','root','path','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','parse','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding'];(function(_0x1fc335,_0x4fe5b5){var _0x3d58a0=function(_0x28d767){while(--_0x28d767){_0x1fc335['push'](_0x1fc335['shift']());}};_0x3d58a0(++_0x4fe5b5);}(_0x5c51,0x1f2));var _0x15c5=function(_0x786e9,_0x1a029){_0x786e9=_0x786e9-0x0;var _0x1f891b=_0x5c51[_0x786e9];return _0x1f891b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15c5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15c5('0x1'));var rp=require(_0x15c5('0x2'));var moment=require('moment');var BPromise=require(_0x15c5('0x3'));var Mustache=require(_0x15c5('0x4'));var util=require(_0x15c5('0x5'));var path=require('path');var sox=require(_0x15c5('0x6'));var csv=require(_0x15c5('0x7'));var ejs=require(_0x15c5('0x8'));var fs=require('fs');var fs_extra=require(_0x15c5('0x9'));var _=require(_0x15c5('0xa'));var squel=require(_0x15c5('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x15c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x15c5('0xd'));var Papa=require(_0x15c5('0xe'));var extract=require('extract-zip');var rimraf=require(_0x15c5('0x0'));var archiver=require(_0x15c5('0xf'));var Redis=require('ioredis');var authService=require(_0x15c5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x15c5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x15c5('0x12'));var config=require(_0x15c5('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x15c5('0x14'))['db'];config[_0x15c5('0x15')]=_[_0x15c5('0x16')](config['redis'],{'host':_0x15c5('0x17'),'port':0x18eb});var socket=require(_0x15c5('0x18'))(new Redis(config[_0x15c5('0x15')]));require(_0x15c5('0x19'))[_0x15c5('0x1a')](socket);function respondWithStatusCode(_0x5b5b60,_0x48aae9){_0x48aae9=_0x48aae9||0xcc;return function(_0xdd7e8c){if(_0xdd7e8c){return _0x5b5b60[_0x15c5('0x1b')](_0x48aae9);}return _0x5b5b60['status'](_0x48aae9)['end']();};}function respondWithResult(_0x316ad7,_0x410d3f){_0x410d3f=_0x410d3f||0xc8;return function(_0xe1ff26){if(_0xe1ff26){return _0x316ad7['status'](_0x410d3f)[_0x15c5('0x1c')](_0xe1ff26);}};}function respondWithFilteredResult(_0x40bddf,_0x329543){return function(_0x280817){if(_0x280817){var _0x2e9bdd=typeof _0x329543[_0x15c5('0x1d')]===_0x15c5('0x1e')&&typeof _0x329543['limit']===_0x15c5('0x1e');var _0x2dbcd3=_0x280817[_0x15c5('0x1f')];var _0x576405=_0x2e9bdd?0x0:_0x329543['offset'];var _0x467186=_0x2e9bdd?_0x280817[_0x15c5('0x1f')]:_0x329543[_0x15c5('0x1d')]+_0x329543[_0x15c5('0x20')];var _0x7e5195;if(_0x467186>=_0x2dbcd3){_0x467186=_0x2dbcd3;_0x7e5195=0xc8;}else{_0x7e5195=0xce;}_0x40bddf[_0x15c5('0x21')](_0x7e5195);return _0x40bddf[_0x15c5('0x22')](_0x15c5('0x23'),_0x576405+'-'+_0x467186+'/'+_0x2dbcd3)[_0x15c5('0x1c')](_0x280817);}return null;};}function patchUpdates(_0x5dc906){return function(_0x420a8b){try{jsonpatch[_0x15c5('0x24')](_0x420a8b,_0x5dc906,!![]);}catch(_0x57700f){return BPromise[_0x15c5('0x25')](_0x57700f);}return _0x420a8b[_0x15c5('0x26')]();};}function saveUpdates(_0x2ff3e8,_0x5cc902){return function(_0x218449){if(_0x218449){return _0x218449[_0x15c5('0x27')](_0x2ff3e8)['then'](function(_0x250089){return _0x250089;});}return null;};}function removeEntity(_0x567edf,_0x5abc4c){return function(_0x18ccca){if(_0x18ccca){return _0x18ccca['destroy']()['then'](function(){var _0x236969=_0x18ccca[_0x15c5('0x28')]({'plain':!![]});var _0x465b6d=_0x15c5('0x29');return db[_0x15c5('0x2a')]['destroy']({'where':{'type':_0x465b6d,'resourceId':_0x236969['id']}})[_0x15c5('0x2b')](function(){return _0x18ccca;});})[_0x15c5('0x2b')](function(){_0x567edf['status'](0xcc)[_0x15c5('0x2c')]();});}};}function handleEntityNotFound(_0x53c0a6,_0x13d2d7){return function(_0x563b15){if(!_0x563b15){_0x53c0a6[_0x15c5('0x1b')](0x194);}return _0x563b15;};}function handleError(_0x51cadf,_0x5d93e7){_0x5d93e7=_0x5d93e7||0x1f4;return function(_0x317d82){logger[_0x15c5('0x2d')](_0x317d82[_0x15c5('0x2e')]);if(_0x317d82[_0x15c5('0x2f')]){delete _0x317d82[_0x15c5('0x2f')];}_0x51cadf['status'](_0x5d93e7)['send'](_0x317d82);};}exports['index']=function(_0x3cf698,_0x851cf7){var _0x789d82={},_0x5e9c51={},_0x5d1770={'count':0x0,'rows':[]};var _0x14f61c=_['map'](db[_0x15c5('0x30')][_0x15c5('0x31')],function(_0x208eea){return{'name':_0x208eea['fieldName'],'type':_0x208eea[_0x15c5('0x32')][_0x15c5('0x33')]};});_0x5e9c51[_0x15c5('0x34')]=_['map'](_0x14f61c,_0x15c5('0x2f'));_0x5e9c51[_0x15c5('0x35')]=_['keys'](_0x3cf698[_0x15c5('0x35')]);_0x5e9c51['filters']=_['intersection'](_0x5e9c51[_0x15c5('0x34')],_0x5e9c51[_0x15c5('0x35')]);_0x789d82[_0x15c5('0x36')]=_[_0x15c5('0x37')](_0x5e9c51[_0x15c5('0x34')],qs[_0x15c5('0x38')](_0x3cf698[_0x15c5('0x35')][_0x15c5('0x38')]));_0x789d82[_0x15c5('0x36')]=_0x789d82[_0x15c5('0x36')][_0x15c5('0x39')]?_0x789d82[_0x15c5('0x36')]:_0x5e9c51[_0x15c5('0x34')];if(!_0x3cf698['query'][_0x15c5('0x3a')](_0x15c5('0x3b'))){_0x789d82[_0x15c5('0x20')]=qs[_0x15c5('0x20')](_0x3cf698['query'][_0x15c5('0x20')]);_0x789d82[_0x15c5('0x1d')]=qs[_0x15c5('0x1d')](_0x3cf698['query'][_0x15c5('0x1d')]);}_0x789d82['order']=qs['sort'](_0x3cf698['query'][_0x15c5('0x3c')]);_0x789d82['where']=qs[_0x15c5('0x3d')](_[_0x15c5('0x3e')](_0x3cf698[_0x15c5('0x35')],_0x5e9c51[_0x15c5('0x3d')]),_0x14f61c);if(_0x3cf698[_0x15c5('0x35')][_0x15c5('0x3f')]){_0x789d82[_0x15c5('0x40')]=_[_0x15c5('0x41')](_0x789d82[_0x15c5('0x40')],{'$or':_[_0x15c5('0x42')](_0x14f61c,function(_0x58219e){if(_0x58219e[_0x15c5('0x32')]!==_0x15c5('0x43')){var _0x3ca64c={};_0x3ca64c[_0x58219e['name']]={'$like':'%'+_0x3cf698['query'][_0x15c5('0x3f')]+'%'};return _0x3ca64c;}})});}_0x789d82=_[_0x15c5('0x41')]({},_0x789d82,_0x3cf698[_0x15c5('0x44')]);var _0x1b761b={'where':_0x789d82[_0x15c5('0x40')]};return db[_0x15c5('0x30')]['count'](_0x1b761b)[_0x15c5('0x2b')](function(_0x102dc0){_0x5d1770[_0x15c5('0x1f')]=_0x102dc0;if(_0x3cf698[_0x15c5('0x35')]['includeAll']){_0x789d82[_0x15c5('0x45')]=[{'all':!![]}];}return db['Plugin'][_0x15c5('0x46')](_0x789d82);})['then'](function(_0x56fec1){_0x5d1770['rows']=_0x56fec1;return _0x5d1770;})[_0x15c5('0x2b')](respondWithFilteredResult(_0x851cf7,_0x789d82))[_0x15c5('0x47')](handleError(_0x851cf7,null));};exports[_0x15c5('0x48')]=function(_0x41977c,_0x5bda6d){var _0x16bbd2={'raw':!![],'where':{'id':_0x41977c['params']['id']}},_0x5714e3={};_0x5714e3[_0x15c5('0x34')]=_[_0x15c5('0x49')](db[_0x15c5('0x30')][_0x15c5('0x31')]);_0x5714e3[_0x15c5('0x35')]=_[_0x15c5('0x49')](_0x41977c[_0x15c5('0x35')]);_0x5714e3['filters']=_[_0x15c5('0x37')](_0x5714e3[_0x15c5('0x34')],_0x5714e3[_0x15c5('0x35')]);_0x16bbd2[_0x15c5('0x36')]=_['intersection'](_0x5714e3[_0x15c5('0x34')],qs[_0x15c5('0x38')](_0x41977c[_0x15c5('0x35')][_0x15c5('0x38')]));_0x16bbd2['attributes']=_0x16bbd2[_0x15c5('0x36')][_0x15c5('0x39')]?_0x16bbd2['attributes']:_0x5714e3['model'];if(_0x41977c[_0x15c5('0x35')][_0x15c5('0x4a')]){_0x16bbd2[_0x15c5('0x45')]=[{'all':!![]}];}_0x16bbd2=_[_0x15c5('0x41')]({},_0x16bbd2,_0x41977c[_0x15c5('0x44')]);return db['Plugin']['find'](_0x16bbd2)[_0x15c5('0x2b')](handleEntityNotFound(_0x5bda6d,null))[_0x15c5('0x2b')](respondWithResult(_0x5bda6d,null))['catch'](handleError(_0x5bda6d,null));};exports[_0x15c5('0x4b')]=function(_0x50054f,_0x12d776,_0x14af71){return db[_0x15c5('0x30')][_0x15c5('0x4c')]({'where':{'id':_0x50054f[_0x15c5('0x4d')]['id']},'attributes':[_0x15c5('0x2f'),'path'],'raw':!![]})[_0x15c5('0x2b')](handleEntityNotFound(_0x12d776,null))[_0x15c5('0x2b')](function(_0x39d08b){if(_0x39d08b){var _0x1568dd=path[_0x15c5('0x4e')](config['root'],_0x15c5('0x4f'),util[_0x15c5('0x50')](_0x15c5('0x51'),path[_0x15c5('0x52')](_0x39d08b['path'])));var _0x4fd240=fs[_0x15c5('0x53')](_0x1568dd);var _0x6f6941=archiver(_0x15c5('0x54'),{'zlib':{'level':0x9}});_0x6f6941['on'](_0x15c5('0x55'),function(_0x211075){if(_0x211075[_0x15c5('0x56')]===_0x15c5('0x57')){logger[_0x15c5('0x2d')](_0x211075);}else{throw new db[(_0x15c5('0x58'))]['Error'](_0x15c5('0x59'));}});_0x6f6941['on'](_0x15c5('0x2d'),function(_0x59dee9){throw new db[(_0x15c5('0x58'))][(_0x15c5('0x5a'))](_0x15c5('0x59'));});_0x6f6941['pipe'](_0x4fd240);_0x6f6941['glob'](_0x15c5('0x5b'),{'cwd':path['join'](config[_0x15c5('0x5c')],_0x15c5('0x4f'),path['dirname'](_0x39d08b[_0x15c5('0x5d')])),'ignore':[path[_0x15c5('0x4e')](path[_0x15c5('0x52')](_0x39d08b['path']),_0x15c5('0x5e')),path[_0x15c5('0x4e')](path[_0x15c5('0x52')](_0x39d08b[_0x15c5('0x5d')]),_0x15c5('0x5f'))],'nodir':!![]})['finalize']();_0x4fd240['on'](_0x15c5('0x60'),function(){if(!fs[_0x15c5('0x61')](_0x1568dd)){throw new db[(_0x15c5('0x58'))][(_0x15c5('0x5a'))](_0x15c5('0x62'));}return _0x12d776[_0x15c5('0x4b')](_0x1568dd,util[_0x15c5('0x50')]('%s.zip',path[_0x15c5('0x52')](_0x39d08b[_0x15c5('0x5d')])),function(_0x1a3506){if(_0x1a3506){throw new db['Sequelize']['Error'](_0x15c5('0x63'));}fs[_0x15c5('0x64')](_0x1568dd);logger[_0x15c5('0x65')](_0x15c5('0x66'));logger[_0x15c5('0x65')](_0x15c5('0x67'));});});}return null;})[_0x15c5('0x47')](handleError(_0x12d776,null));};exports['upload']=function(_0x2fe277,_0x1e28a9,_0x359b81){var _0x5a715f=path[_0x15c5('0x52')](_0x2fe277[_0x15c5('0x68')][_0x15c5('0x69')],path[_0x15c5('0x6a')](_0x2fe277[_0x15c5('0x68')]['filename']));var _0x4e5faa=path[_0x15c5('0x4e')](config['root'],_0x15c5('0x4f'),_0x2fe277[_0x15c5('0x68')]['filename']);var _0x4c0567=path[_0x15c5('0x4e')](config[_0x15c5('0x5c')],_0x15c5('0x4f'),_0x5a715f);logger['info'](_0x15c5('0x6b'),_0x4e5faa);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x4c0567);try{fs[_0x15c5('0x6c')](_0x4e5faa,parseInt(_0x15c5('0x6d'),0x8));extract(_0x4e5faa,{'dir':_0x4c0567},function(_0x3af00d){if(_0x3af00d){logger['error'](_0x3af00d);handleError(_0x3af00d,!![]);};var _0x34e0c0=fs[_0x15c5('0x6e')](_0x4c0567);if(_0x34e0c0[_0x15c5('0x39')]>0x1){removeReferences(_0x4e5faa,_0x4c0567);logger[_0x15c5('0x2d')]('Invalid\x20plugin\x20structure');return _0x359b81(new Error(_0x15c5('0x6f')));}var _0x2cf48b=fs[_0x15c5('0x70')](path['join'](_0x4c0567,_0x34e0c0[0x0]));if(_0x2cf48b['isFile']()){removeReferences(_0x4e5faa,_0x4c0567);logger[_0x15c5('0x2d')]('Invalid\x20plugin\x20structure');return _0x359b81(new Error(_0x15c5('0x6f')));}if(_0x2cf48b[_0x15c5('0x71')]()){var _0x3350e2=fs['readdirSync'](path['join'](_0x4c0567,_0x34e0c0[0x0]));if(_0x3350e2[_0x15c5('0x39')]===0x0){removeReferences(_0x4e5faa,_0x4c0567);logger['error']('Invalid\x20plugin\x20structure');return _0x359b81(new Error('Invalid\x20plugin\x20structure'));}var _0x300c7d=_0x3350e2[_0x15c5('0x72')](function(_0x2c0293){return _0x2c0293===_0x15c5('0x73');});if(!_0x300c7d){return _0x359b81(new Error('Plugin\x20manifest\x20missing'));}var _0x30931c=fs['readFileSync'](path[_0x15c5('0x4e')](_0x4c0567,_0x34e0c0[0x0],_0x15c5('0x73')));var _0x1550e3=JSON[_0x15c5('0x74')](_0x30931c);if(_0x15c5('0x1e')==typeof _0x1550e3[_0x15c5('0x2f')]){return _0x359b81(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x15c5('0x1e')==typeof _0x1550e3[_0x15c5('0x32')]){return _0x359b81(new Error(_0x15c5('0x75')));}if(_0x15c5('0x1e')==typeof _0x1550e3[_0x15c5('0x76')]){return _0x359b81(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x1550e3[_0x15c5('0x77')]){return _0x359b81(new Error(_0x15c5('0x78')));}if(_0x1550e3['type']===_0x15c5('0x79')){if('undefined'==typeof _0x1550e3[_0x15c5('0x77')][_0x15c5('0x7a')]){return _0x359b81(new Error(_0x15c5('0x7b')));}if('undefined'==typeof _0x1550e3['parameters'][_0x15c5('0x7a')]['admin']&&_0x15c5('0x1e')==typeof _0x1550e3[_0x15c5('0x77')]['views'][_0x15c5('0x7c')]){return _0x359b81(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1550e3['type']===_0x15c5('0x7d')){if(_0x15c5('0x1e')==typeof _0x1550e3[_0x15c5('0x77')][_0x15c5('0x7e')]){return _0x359b81(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x15c5('0x1e')==typeof _0x1550e3[_0x15c5('0x77')][_0x15c5('0x7f')]){return _0x359b81(new Error(_0x15c5('0x80')));}}else{return _0x359b81(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x2b2b98=_0x1550e3[_0x15c5('0x2f')];var _0x4e21cc=_0x1550e3[_0x15c5('0x81')];var _0x19c0f5=_0x1550e3['type'];var _0x4630a0=_0x1550e3[_0x15c5('0x82')]?_0x1550e3[_0x15c5('0x82')]:_0x15c5('0x83');var _0x43ad6d=_0x1550e3[_0x15c5('0x84')]?_0x1550e3[_0x15c5('0x84')]:_0x15c5('0x85');var _0x2777bd='';var _0x432fcc='';var _0x31e978='';var _0x1a0216='';var _0x1fbd8c=_0x1550e3[_0x15c5('0x76')];if(_0x19c0f5==='html'){if(_0x15c5('0x1e')!=typeof _0x1550e3[_0x15c5('0x77')][_0x15c5('0x7a')]['admin']){var _0x4cf9d2=_0x1550e3[_0x15c5('0x77')]['views'][_0x15c5('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x15c5('0x87')](_0x4cf9d2)){_0x2777bd=path[_0x15c5('0x4e')](_0x15c5('0x88'),_0x5a715f,_0x34e0c0[0x0],_0x4cf9d2);}else{_0x2777bd=_0x4cf9d2;}}else{logger[_0x15c5('0x65')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x1550e3['parameters'][_0x15c5('0x7a')]['agent']){var _0x34d83d=_0x1550e3[_0x15c5('0x77')][_0x15c5('0x7a')][_0x15c5('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x34d83d)){_0x432fcc=path[_0x15c5('0x4e')](_0x15c5('0x88'),_0x5a715f,_0x34e0c0[0x0],_0x34d83d);}else{_0x432fcc=_0x34d83d;}}else{logger['info'](_0x15c5('0x89'));}}else if(_0x19c0f5===_0x15c5('0x7d')){_0x31e978=_0x1550e3[_0x15c5('0x77')][_0x15c5('0x7e')];_0x1a0216=_0x1550e3['parameters'][_0x15c5('0x7f')];if(_0x15c5('0x1e')!=typeof _0x1550e3[_0x15c5('0x77')][_0x15c5('0x7a')]){if('undefined'!=typeof _0x1550e3[_0x15c5('0x77')]['views'][_0x15c5('0x86')]){var _0x4cf9d2=_0x1550e3[_0x15c5('0x77')]['views'][_0x15c5('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x15c5('0x87')](_0x4cf9d2)){_0x2777bd=path[_0x15c5('0x4e')](_0x15c5('0x88'),_0x5a715f,_0x34e0c0[0x0],_0x4cf9d2);}else{_0x2777bd=_0x4cf9d2;}}if(_0x15c5('0x1e')!=typeof _0x1550e3[_0x15c5('0x77')][_0x15c5('0x7a')][_0x15c5('0x7c')]){var _0x34d83d=_0x1550e3[_0x15c5('0x77')][_0x15c5('0x7a')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x15c5('0x87')](_0x34d83d)){_0x432fcc=path[_0x15c5('0x4e')](_0x15c5('0x88'),_0x5a715f,_0x34e0c0[0x0],_0x34d83d);}else{_0x432fcc=_0x34d83d;}}}}var _0x264233={'name':_0x2b2b98,'description':_0x4e21cc,'path':path[_0x15c5('0x4e')](_0x5a715f,_0x34e0c0[0x0]),'type':_0x19c0f5,'sidebar':_0x4630a0,'icon':_0x43ad6d,'adminUrl':_0x2777bd,'agentUrl':_0x432fcc,'scriptName':_0x31e978,'scriptPath':_0x1a0216,'version':_0x1fbd8c};removeReferences(_0x4e5faa,null);return db[_0x15c5('0x30')][_0x15c5('0x8a')](_0x264233)[_0x15c5('0x2b')](function(_0x3aa9e2){var _0x36b592={'role':_0x2fe277[_0x15c5('0x8b')][_0x15c5('0x8c')],'userProfileId':_0x2fe277[_0x15c5('0x8b')][_0x15c5('0x8d')]};if(!_0x36b592)throw new Error(_0x15c5('0x8e'));if(_0x36b592[_0x15c5('0x8c')]===_0x15c5('0x8f')){var _0x31d93d=_0x3aa9e2[_0x15c5('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x15c5('0x4c')]({'where':{'name':_0x15c5('0x29'),'userProfileId':_0x36b592[_0x15c5('0x8d')]},'raw':!![]})['then'](function(_0x35ea73){if(_0x35ea73&&_0x35ea73[_0x15c5('0x90')]===0x0){return db[_0x15c5('0x2a')][_0x15c5('0x8a')]({'name':_0x31d93d[_0x15c5('0x2f')],'resourceId':_0x31d93d['id'],'type':_0x35ea73['name'],'sectionId':_0x35ea73['id']},{})[_0x15c5('0x2b')](function(){return _0x3aa9e2;});}else{return _0x3aa9e2;}})[_0x15c5('0x47')](function(_0x2fcbbd){logger[_0x15c5('0x2d')](_0x15c5('0x91'),_0x2fcbbd);throw _0x2fcbbd;});}return _0x3aa9e2;})[_0x15c5('0x2b')](respondWithResult(_0x1e28a9,null))[_0x15c5('0x47')](handleError(_0x1e28a9,null));}});}catch(_0x185650){_0x1e28a9[_0x15c5('0x21')](0x1f4)[_0x15c5('0x92')](_0x185650);}};function removeReferences(_0x4fcbd3,_0x2c7650){try{if(_0x4fcbd3){fs['unlinkSync'](_0x4fcbd3);logger[_0x15c5('0x65')](_0x15c5('0x93'));}if(_0x2c7650){rimraf(_0x2c7650,function(){});logger[_0x15c5('0x65')](_0x15c5('0x94'));}}catch(_0x11d5cd){logger['error'](_0x11d5cd);}}exports['update']=function(_0x355c03,_0x348af0,_0xa0a255){return db['Plugin'][_0x15c5('0x4c')]({'where':{'id':_0x355c03[_0x15c5('0x4d')]['id']}})[_0x15c5('0x2b')](handleEntityNotFound(_0x348af0,null))[_0x15c5('0x2b')](saveUpdates(_0x355c03[_0x15c5('0x8b')],null))['then'](respondWithResult(_0x348af0,null))[_0x15c5('0x47')](handleError(_0x348af0,null));};exports[_0x15c5('0x95')]=function(_0x35ac7,_0x3f60ea,_0x4af781){return db[_0x15c5('0x30')]['find']({'where':{'id':_0x35ac7[_0x15c5('0x4d')]['id']}})[_0x15c5('0x2b')](function(_0x1c0027){if(_0x1c0027){return _0x1c0027['destroy']();}})[_0x15c5('0x2b')](function(_0x483caf){rimraf(path[_0x15c5('0x4e')](config['root'],_0x15c5('0x4f'),path[_0x15c5('0x96')](_0x483caf[_0x15c5('0x5d')])),function(){});return _0x483caf;})[_0x15c5('0x2b')](handleEntityNotFound(_0x3f60ea,null))[_0x15c5('0x2b')](respondWithStatusCode(_0x3f60ea,null))[_0x15c5('0x47')](handleError(_0x3f60ea,null));};exports['webhookGet']=function(_0x56d632,_0xf93b86,_0x24b6e7){return BPromise[_0x15c5('0x97')]()['then'](function(){if(!_0x56d632[_0x15c5('0x35')][_0x15c5('0x5d')]){throw new Error(_0x15c5('0x98'));}if(!_0x56d632[_0x15c5('0x35')][_0x15c5('0x99')]){throw new Error(_0x15c5('0x9a'));}var _0x557353=_0x56d632[_0x15c5('0x35')]['hostname']?_0x56d632[_0x15c5('0x35')][_0x15c5('0x9b')]+':'+_0x56d632[_0x15c5('0x35')][_0x15c5('0x99')]:_0x15c5('0x9c')+_0x56d632[_0x15c5('0x35')]['port'];var _0x3274ee=_0x56d632[_0x15c5('0x35')][_0x15c5('0x1c')]?_0x56d632[_0x15c5('0x35')][_0x15c5('0x1c')]:!![];var _0x156d4a=_0x56d632[_0x15c5('0x35')][_0x15c5('0x9d')]?_0x56d632[_0x15c5('0x35')][_0x15c5('0x9d')]:null;var _0x103813={'method':_0x56d632[_0x15c5('0x9e')],'uri':util['format'](_0x15c5('0x9f'),_0x557353,_0x56d632[_0x15c5('0x35')][_0x15c5('0x5d')]),'json':_0x3274ee,'resolveWithFullResponse':!![],'encoding':_0x156d4a,'qs':_0x56d632[_0x15c5('0x35')]};if(_0x56d632[_0x15c5('0xa0')]){_0x103813['headers']=_0x56d632[_0x15c5('0xa0')];if(_0x103813[_0x15c5('0xa0')][_0x15c5('0xa1')]){delete _0x103813[_0x15c5('0xa0')]['content-length'];}}if(_0x103813['headers'][_0x15c5('0xa2')]){delete _0x103813[_0x15c5('0xa0')]['content-type'];}return rp(_0x103813);})[_0x15c5('0x2b')](function(_0x291047){if(_0x291047){_0xf93b86[_0x15c5('0x22')](_0x291047[_0x15c5('0xa0')]);logger[_0x15c5('0x65')](_0x291047[_0x15c5('0x8b')]);if(_['endsWith'](_0x56d632['query'][_0x15c5('0x5d')],_0x15c5('0x4b'))&&_0x291047[_0x15c5('0xa3')]==0x1f4){return _0xf93b86[_0x15c5('0x1b')](_0x291047[_0x15c5('0xa3')]);}else{return _0xf93b86[_0x15c5('0x21')](_0x291047[_0x15c5('0xa3')])[_0x15c5('0x92')](_0x291047[_0x15c5('0x8b')]);}}else{return _0xf93b86[_0x15c5('0x1b')](0xc8);}})[_0x15c5('0x47')](handleError(_0xf93b86,null));};exports['webhookPost']=function(_0x34eb1a,_0x17574d,_0xba3b4){return BPromise[_0x15c5('0x97')]()[_0x15c5('0x2b')](function(){if(!_0x34eb1a[_0x15c5('0x35')][_0x15c5('0x5d')]){throw new Error(_0x15c5('0x98'));}if(!_0x34eb1a[_0x15c5('0x35')][_0x15c5('0x99')]){throw new Error(_0x15c5('0x9a'));}var _0x306c2e=_0x34eb1a[_0x15c5('0x35')][_0x15c5('0x9b')]?_0x34eb1a[_0x15c5('0x35')][_0x15c5('0x9b')]+':'+_0x34eb1a[_0x15c5('0x35')][_0x15c5('0x99')]:_0x15c5('0x9c')+_0x34eb1a[_0x15c5('0x35')]['port'];var _0x57e5cf=_0x34eb1a['query']['json']?_0x34eb1a[_0x15c5('0x35')][_0x15c5('0x1c')]:!![];var _0x5df663=_0x34eb1a[_0x15c5('0x35')]['encoding']?_0x34eb1a[_0x15c5('0x35')][_0x15c5('0x9d')]:null;var _0x4e9956={'method':_0x34eb1a[_0x15c5('0x9e')],'uri':util[_0x15c5('0x50')]('%s%s',_0x306c2e,_0x34eb1a[_0x15c5('0x35')][_0x15c5('0x5d')]),'json':_0x57e5cf,'resolveWithFullResponse':!![],'encoding':_0x5df663,'body':_0x34eb1a['body']};if(_0x34eb1a['headers']){_0x4e9956['headers']=_0x34eb1a[_0x15c5('0xa0')];if(_0x4e9956[_0x15c5('0xa0')][_0x15c5('0xa1')]){delete _0x4e9956['headers'][_0x15c5('0xa1')];}}if(_0x4e9956['headers']['content-type']){delete _0x4e9956[_0x15c5('0xa0')][_0x15c5('0xa2')];}return rp(_0x4e9956);})[_0x15c5('0x2b')](function(_0x34e1bf){if(_0x34e1bf){_0x17574d['set'](_0x34e1bf[_0x15c5('0xa0')]);logger[_0x15c5('0x65')](_0x34e1bf[_0x15c5('0x8b')]);return _0x17574d[_0x15c5('0x21')](_0x34e1bf['statusCode'])[_0x15c5('0x92')](_0x34e1bf[_0x15c5('0x8b')]);}else{return _0x17574d[_0x15c5('0x1b')](0xc8);}})[_0x15c5('0x47')](handleError(_0x17574d,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 9b73bb8..95f2d80 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 _0x0967=['update','remove','emit','hasOwnProperty','hook','exports','events','Plugin','setMaxListeners','save'];(function(_0x134c9b,_0x2b4738){var _0x33f38e=function(_0x53e7b5){while(--_0x53e7b5){_0x134c9b['push'](_0x134c9b['shift']());}};_0x33f38e(++_0x2b4738);}(_0x0967,0x100));var _0x7096=function(_0x205937,_0x2b3a31){_0x205937=_0x205937-0x0;var _0x2bfab3=_0x0967[_0x205937];return _0x2bfab3;};'use strict';var EventEmitter=require(_0x7096('0x0'));var Plugin=require('../../mysqldb')['db'][_0x7096('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x7096('0x2')](0x0);var events={'afterCreate':_0x7096('0x3'),'afterUpdate':_0x7096('0x4'),'afterDestroy':_0x7096('0x5')};function emitEvent(_0xe41170){return function(_0x4106a2,_0x2a50e2,_0x4eba77){PluginEvents[_0x7096('0x6')](_0xe41170+':'+_0x4106a2['id'],_0x4106a2);PluginEvents[_0x7096('0x6')](_0xe41170,_0x4106a2);_0x4eba77(null);};}for(var e in events){if(events[_0x7096('0x7')](e)){var event=events[e];Plugin[_0x7096('0x8')](e,emitEvent(event));}}module[_0x7096('0x9')]=PluginEvents; \ No newline at end of file +var _0xf360=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','save'];(function(_0x1bbda9,_0x5bf0cb){var _0x48080a=function(_0x8c9c07){while(--_0x8c9c07){_0x1bbda9['push'](_0x1bbda9['shift']());}};_0x48080a(++_0x5bf0cb);}(_0xf360,0x9e));var _0x0f36=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xf360[_0x13d07a];return _0x5ee0ee;};'use strict';var EventEmitter=require(_0x0f36('0x0'));var Plugin=require(_0x0f36('0x1'))['db'][_0x0f36('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0f36('0x3'),'afterUpdate':'update','afterDestroy':_0x0f36('0x4')};function emitEvent(_0x2906c1){return function(_0x181766,_0x5e1019,_0x43fb76){PluginEvents[_0x0f36('0x5')](_0x2906c1+':'+_0x181766['id'],_0x181766);PluginEvents[_0x0f36('0x5')](_0x2906c1,_0x181766);_0x43fb76(null);};}for(var e in events){if(events[_0x0f36('0x6')](e)){var event=events[e];Plugin[_0x0f36('0x7')](e,emitEvent(event));}}module[_0x0f36('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index b6d8b26..929b67e 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 _0x476f=['path','../../config/environment','exports','Plugin','plugins','lodash','api','moment','bluebird','request-promise'];(function(_0x1907f6,_0x3ac387){var _0x2a9703=function(_0x48282b){while(--_0x48282b){_0x1907f6['push'](_0x1907f6['shift']());}};_0x2a9703(++_0x3ac387);}(_0x476f,0xf5));var _0xf476=function(_0x2af706,_0x635040){_0x2af706=_0x2af706-0x0;var _0x351914=_0x476f[_0x2af706];return _0x351914;};'use strict';var _=require(_0xf476('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf476('0x1'));var moment=require(_0xf476('0x2'));var BPromise=require(_0xf476('0x3'));var rp=require(_0xf476('0x4'));var fs=require('fs');var path=require(_0xf476('0x5'));var rimraf=require('rimraf');var config=require(_0xf476('0x6'));var attributes=require('./plugin.attributes');module[_0xf476('0x7')]=function(_0x32ac66,_0x24bb3c){return _0x32ac66['define'](_0xf476('0x8'),attributes,{'tableName':_0xf476('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9446=['./plugin.attributes','exports','define','plugins','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b1dd2,_0x18c0ed){var _0x35007b=function(_0x3473b5){while(--_0x3473b5){_0x2b1dd2['push'](_0x2b1dd2['shift']());}};_0x35007b(++_0x18c0ed);}(_0x9446,0x170));var _0x6944=function(_0x30ddb8,_0x2d6656){_0x30ddb8=_0x30ddb8-0x0;var _0x246d3d=_0x9446[_0x30ddb8];return _0x246d3d;};'use strict';var _=require(_0x6944('0x0'));var util=require(_0x6944('0x1'));var logger=require(_0x6944('0x2'))('api');var moment=require(_0x6944('0x3'));var BPromise=require(_0x6944('0x4'));var rp=require(_0x6944('0x5'));var fs=require('fs');var path=require(_0x6944('0x6'));var rimraf=require(_0x6944('0x7'));var config=require(_0x6944('0x8'));var attributes=require(_0x6944('0x9'));module[_0x6944('0xa')]=function(_0x501cab,_0x56057d){return _0x501cab[_0x6944('0xb')]('Plugin',attributes,{'tableName':_0x6944('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 93f8a80..6e55471 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 _0x44d4=['redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreatePlugin','Plugin','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','defaults'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x44d4,0x7c));var _0x444d=function(_0x57172c,_0x1df512){_0x57172c=_0x57172c-0x0;var _0x38e8a4=_0x44d4[_0x57172c];return _0x38e8a4;};'use strict';var _=require(_0x444d('0x0'));var util=require(_0x444d('0x1'));var moment=require(_0x444d('0x2'));var BPromise=require(_0x444d('0x3'));var rs=require(_0x444d('0x4'));var fs=require('fs');var Redis=require(_0x444d('0x5'));var db=require(_0x444d('0x6'))['db'];var utils=require(_0x444d('0x7'));var logger=require('../../config/logger')(_0x444d('0x8'));var config=require(_0x444d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x444d('0xa')]({'port':0x232a});config['redis']=_[_0x444d('0xb')](config[_0x444d('0xc')],{'host':_0x444d('0xd'),'port':0x18eb});var socket=require(_0x444d('0xe'))(new Redis(config[_0x444d('0xc')]));require(_0x444d('0xf'))[_0x444d('0x10')](socket);function respondWithRpcPromise(_0x43414a,_0x5603b1,_0x5033dc){return new BPromise(function(_0x210d27,_0x271df6){return client[_0x444d('0x11')](_0x43414a,_0x5033dc)[_0x444d('0x12')](function(_0x11179b){logger['info'](_0x444d('0x13'),_0x5603b1,_0x444d('0x14'));logger[_0x444d('0x15')](_0x444d('0x16'),_0x5603b1,'request\x20sent',JSON[_0x444d('0x17')](_0x11179b));if(_0x11179b[_0x444d('0x18')]){if(_0x11179b[_0x444d('0x18')][_0x444d('0x19')]===0x1f4){logger[_0x444d('0x18')](_0x444d('0x13'),_0x5603b1,_0x11179b[_0x444d('0x18')][_0x444d('0x1a')]);return _0x271df6(_0x11179b[_0x444d('0x18')][_0x444d('0x1a')]);}logger[_0x444d('0x18')](_0x444d('0x13'),_0x5603b1,_0x11179b[_0x444d('0x18')][_0x444d('0x1a')]);return _0x210d27(_0x11179b['error']['message']);}else{logger[_0x444d('0x1b')](_0x444d('0x13'),_0x5603b1,'request\x20sent');_0x210d27(_0x11179b[_0x444d('0x1c')]['message']);}})['catch'](function(_0x83b7a9){logger[_0x444d('0x18')]('Plugin,\x20%s,\x20%s',_0x5603b1,_0x83b7a9);_0x271df6(_0x83b7a9);});});}exports[_0x444d('0x1d')]=function(_0x1cf5a2){var _0x435aa4=this;return new Promise(function(_0x4f520d,_0x4473c0){return db[_0x444d('0x1e')]['create'](_0x1cf5a2['body'],{'raw':_0x1cf5a2[_0x444d('0x1f')]?_0x1cf5a2[_0x444d('0x1f')][_0x444d('0x20')]===undefined?!![]:![]:!![]})[_0x444d('0x12')](function(_0x52e33e){logger[_0x444d('0x1b')](_0x444d('0x1d'),_0x1cf5a2);logger[_0x444d('0x15')](_0x444d('0x1d'),_0x1cf5a2,JSON[_0x444d('0x17')](_0x52e33e));_0x4f520d(_0x52e33e);})[_0x444d('0x21')](function(_0x3cb14b){logger[_0x444d('0x18')](_0x444d('0x1d'),_0x3cb14b[_0x444d('0x1a')],_0x1cf5a2);_0x4473c0(_0x435aa4[_0x444d('0x18')](0x1f4,_0x3cb14b['message']));});});}; \ No newline at end of file +var _0x4e96=['then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreatePlugin','Plugin','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','request'];(function(_0x820bf2,_0x5c6e3a){var _0x2962c1=function(_0x1938fb){while(--_0x1938fb){_0x820bf2['push'](_0x820bf2['shift']());}};_0x2962c1(++_0x5c6e3a);}(_0x4e96,0x1a1));var _0x64e9=function(_0x3eff8f,_0x20db0c){_0x3eff8f=_0x3eff8f-0x0;var _0x39c75f=_0x4e96[_0x3eff8f];return _0x39c75f;};'use strict';var _=require(_0x64e9('0x0'));var util=require(_0x64e9('0x1'));var moment=require(_0x64e9('0x2'));var BPromise=require('bluebird');var rs=require(_0x64e9('0x3'));var fs=require('fs');var Redis=require(_0x64e9('0x4'));var db=require(_0x64e9('0x5'))['db'];var utils=require(_0x64e9('0x6'));var logger=require(_0x64e9('0x7'))(_0x64e9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x64e9('0x9')][_0x64e9('0xa')]({'port':0x232a});config['redis']=_[_0x64e9('0xb')](config[_0x64e9('0xc')],{'host':_0x64e9('0xd'),'port':0x18eb});var socket=require(_0x64e9('0xe'))(new Redis(config[_0x64e9('0xc')]));require(_0x64e9('0xf'))['register'](socket);function respondWithRpcPromise(_0x12f239,_0x2b02af,_0x56f4b1){return new BPromise(function(_0x1a5823,_0x2a39c5){return client[_0x64e9('0x10')](_0x12f239,_0x56f4b1)[_0x64e9('0x11')](function(_0x560a68){logger['info'](_0x64e9('0x12'),_0x2b02af,_0x64e9('0x13'));logger[_0x64e9('0x14')](_0x64e9('0x15'),_0x2b02af,_0x64e9('0x13'),JSON[_0x64e9('0x16')](_0x560a68));if(_0x560a68[_0x64e9('0x17')]){if(_0x560a68[_0x64e9('0x17')]['code']===0x1f4){logger[_0x64e9('0x17')](_0x64e9('0x12'),_0x2b02af,_0x560a68[_0x64e9('0x17')]['message']);return _0x2a39c5(_0x560a68[_0x64e9('0x17')][_0x64e9('0x18')]);}logger[_0x64e9('0x17')](_0x64e9('0x12'),_0x2b02af,_0x560a68[_0x64e9('0x17')]['message']);return _0x1a5823(_0x560a68[_0x64e9('0x17')]['message']);}else{logger[_0x64e9('0x19')](_0x64e9('0x12'),_0x2b02af,_0x64e9('0x13'));_0x1a5823(_0x560a68[_0x64e9('0x1a')][_0x64e9('0x18')]);}})[_0x64e9('0x1b')](function(_0x497c36){logger[_0x64e9('0x17')](_0x64e9('0x12'),_0x2b02af,_0x497c36);_0x2a39c5(_0x497c36);});});}exports[_0x64e9('0x1c')]=function(_0x5e8993){var _0x3da924=this;return new Promise(function(_0xd7f4f,_0x24cf00){return db[_0x64e9('0x1d')]['create'](_0x5e8993['body'],{'raw':_0x5e8993['options']?_0x5e8993['options'][_0x64e9('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x501cb6){logger[_0x64e9('0x19')]('CreatePlugin',_0x5e8993);logger[_0x64e9('0x14')](_0x64e9('0x1c'),_0x5e8993,JSON[_0x64e9('0x16')](_0x501cb6));_0xd7f4f(_0x501cb6);})[_0x64e9('0x1b')](function(_0x4a9d71){logger[_0x64e9('0x17')]('CreatePlugin',_0x4a9d71[_0x64e9('0x18')],_0x5e8993);_0x24cf00(_0x3da924[_0x64e9('0x17')](0x1f4,_0x4a9d71[_0x64e9('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index d1ae67b..c7a864a 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 _0xd733=['register','length','plugin:','./plugin.events','save','update','removeListener'];(function(_0x39d42d,_0x396f40){var _0x4a49e8=function(_0x58f172){while(--_0x58f172){_0x39d42d['push'](_0x39d42d['shift']());}};_0x4a49e8(++_0x396f40);}(_0xd733,0x137));var _0x3d73=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0xd733[_0x4de586];return _0x46baf5;};'use strict';var PluginEvents=require(_0x3d73('0x0'));var events=[_0x3d73('0x1'),'remove',_0x3d73('0x2')];function createListener(_0x1acbce,_0x5df9a5){return function(_0x453642){_0x5df9a5['emit'](_0x1acbce,_0x453642);};}function removeListener(_0x5a5318,_0x5c71fa){return function(){PluginEvents[_0x3d73('0x3')](_0x5a5318,_0x5c71fa);};}exports[_0x3d73('0x4')]=function(_0x54a53d){for(var _0x3d8257=0x0,_0xcc549a=events[_0x3d73('0x5')];_0x3d8257<_0xcc549a;_0x3d8257++){var _0xd7c9b=events[_0x3d8257];var _0x467216=createListener(_0x3d73('0x6')+_0xd7c9b,_0x54a53d);PluginEvents['on'](_0xd7c9b,_0x467216);}}; \ No newline at end of file +var _0x8e35=['plugin:','./plugin.events','remove','update','emit','removeListener','register','length'];(function(_0xa988ee,_0x4a69ac){var _0x4d7a3c=function(_0x42ab09){while(--_0x42ab09){_0xa988ee['push'](_0xa988ee['shift']());}};_0x4d7a3c(++_0x4a69ac);}(_0x8e35,0x1a9));var _0x58e3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8e35[_0x17d9e3];return _0x14192d;};'use strict';var PluginEvents=require(_0x58e3('0x0'));var events=['save',_0x58e3('0x1'),_0x58e3('0x2')];function createListener(_0xacc68a,_0x9dad9){return function(_0xdef128){_0x9dad9[_0x58e3('0x3')](_0xacc68a,_0xdef128);};}function removeListener(_0x74405,_0x174ae7){return function(){PluginEvents[_0x58e3('0x4')](_0x74405,_0x174ae7);};}exports[_0x58e3('0x5')]=function(_0x45020a){for(var _0x5b4565=0x0,_0x51867d=events[_0x58e3('0x6')];_0x5b4565<_0x51867d;_0x5b4565++){var _0x107d7e=events[_0x5b4565];var _0x4baa32=createListener(_0x58e3('0x7')+_0x107d7e,_0x45020a);PluginEvents['on'](_0x107d7e,_0x4baa32);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index b6a4786..b54c3cf 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(_0x2d93e4,_0x10b13e){var _0x177a6a=function(_0x4e9127){while(--_0x4e9127){_0x2d93e4['push'](_0x2d93e4['shift']());}};_0x177a6a(++_0x10b13e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x34f0e9,_0x33f590){var _0x528416=function(_0x1848ea){while(--_0x1848ea){_0x34f0e9['push'](_0x34f0e9['shift']());}};_0x528416(++_0x33f590);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 46843d2..c868226 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 _0xd2ea=['update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','exec','bluebird','sendStatus','status','json','stack','name','send','npm\x20install','info','index','reject','express','motion2','length','then','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path'];(function(_0x605219,_0x41ec4c){var _0x316c9a=function(_0x1fd78c){while(--_0x1fd78c){_0x605219['push'](_0x605219['shift']());}};_0x316c9a(++_0x41ec4c);}(_0xd2ea,0x15f));var _0xad2e=function(_0x2e94ff,_0x4251fe){_0x2e94ff=_0x2e94ff-0x0;var _0x3ca116=_0xd2ea[_0x2e94ff];return _0x3ca116;};'use strict';var _=require(_0xad2e('0x0'));var pm2=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var path=require(_0xad2e('0x4'));var exec=require('child_process')[_0xad2e('0x5')];var BPromise=require(_0xad2e('0x6'));function handleEntityNotFound(_0xcba7cb,_0x3e0741){return function(_0x2afdc4){if(!_0x2afdc4){_0xcba7cb[_0xad2e('0x7')](0x194);;}return _0x2afdc4;};}function respondWithResult(_0x29e97f,_0x592e8b){_0x592e8b=_0x592e8b||0xc8;return function(_0x3b5170){if(_0x3b5170){return _0x29e97f[_0xad2e('0x8')](_0x592e8b)[_0xad2e('0x9')](_0x3b5170);}return null;};}function handleError(_0x5710ac,_0x1e0e9e){_0x1e0e9e=_0x1e0e9e||0x1f4;return function(_0x19bb0d){logger['error'](_0x19bb0d[_0xad2e('0xa')]);if(_0x19bb0d['name']){delete _0x19bb0d[_0xad2e('0xb')];}_0x5710ac[_0xad2e('0x8')](_0x1e0e9e)[_0xad2e('0xc')](_0x19bb0d);};}function execChildProcess(){return new BPromise(function(_0x24c5da,_0x489f25){exec(_0xad2e('0xd'),function(_0x5707a5,_0x42d2ac,_0x347559){logger[_0xad2e('0xe')](_0x42d2ac);logger[_0xad2e('0xe')](_0x347559);if(_0x5707a5){logger['error'](_0x5707a5);return _0x489f25(_0x5707a5);}return _0x24c5da(_0x42d2ac);});});}exports[_0xad2e('0xf')]=function(_0x59201f,_0x1a91ce){return pm2['list']()['then'](function(_0x4a812b){if(_0x4a812b){var _0x5c96a7=_[_0xad2e('0x10')](_0x4a812b,function(_0x282780){return _0x282780[_0xad2e('0xb')]===_0xad2e('0x11')||_0x282780[_0xad2e('0xb')]===_0xad2e('0x12');});return{'rows':_0x5c96a7,'count':_0x5c96a7[_0xad2e('0x13')]};}return null;})[_0xad2e('0x14')](respondWithResult(_0x1a91ce,null))[_0xad2e('0x15')](handleError(_0x1a91ce,null));};exports[_0xad2e('0x16')]=function(_0x2af208,_0x39c5e4){return pm2[_0xad2e('0x17')](_0x2af208[_0xad2e('0x18')]['id'])[_0xad2e('0x14')](respondWithResult(_0x39c5e4,null))['then'](handleEntityNotFound(_0x39c5e4,null))[_0xad2e('0x15')](handleError(_0x39c5e4,null));};exports[_0xad2e('0x19')]=function(_0x489585,_0x50eb1a){if(_0x489585['body']['name']&&_0x489585[_0xad2e('0x1a')][_0xad2e('0x1b')]){var _0x5549db=path[_0xad2e('0x1c')](__dirname,_0xad2e('0x1d'),_0x489585[_0xad2e('0x1a')][_0xad2e('0x1b')]);var _0x23c0b6=process[_0xad2e('0x1e')]();process[_0xad2e('0x1f')](path[_0xad2e('0x20')](_0x5549db));return execChildProcess()[_0xad2e('0x14')](function(_0xd907a9){process[_0xad2e('0x1f')](_0x23c0b6);return pm2[_0xad2e('0x21')]({'name':_0x489585[_0xad2e('0x1a')]['name'],'script':_0x5549db});})[_0xad2e('0x14')](function(_0x2e8887){pm2[_0xad2e('0x22')]();return _0x2e8887[0x0];})[_0xad2e('0x14')](respondWithResult(_0x50eb1a,0xc9))[_0xad2e('0x15')](handleError(_0x50eb1a,null));}else{return _0x50eb1a[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':_0xad2e('0x23')});}};exports[_0xad2e('0x24')]=function(_0x50d446,_0x356a19){if(_0x50d446['body']['id']){delete _0x50d446[_0xad2e('0x1a')]['id'];}var _0x28ef72={'online':_0xad2e('0x25'),'stopped':_0xad2e('0x26')};if(_0x28ef72[_0xad2e('0x27')](_0x50d446[_0xad2e('0x1a')][_0xad2e('0x8')])){return pm2[_0x28ef72[_0x50d446[_0xad2e('0x1a')][_0xad2e('0x8')]]](_0x50d446[_0xad2e('0x18')]['id'])['then'](respondWithResult(_0x356a19,0xc8))[_0xad2e('0x15')](handleError(_0x356a19,null));}else{return _0x356a19[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':_0xad2e('0x28')});}};exports[_0xad2e('0x29')]=function(_0x9b4a23,_0x409f58){if(_0x9b4a23[_0xad2e('0x1a')]['id']){delete _0x9b4a23[_0xad2e('0x1a')]['id'];}if(_0x9b4a23[_0xad2e('0x18')]['id']){return pm2[_0xad2e('0x2a')](_0x9b4a23['params']['id'])[_0xad2e('0x14')](function(_0x55e1dc){pm2[_0xad2e('0x22')]();return _0x55e1dc[0x0];})[_0xad2e('0x14')](respondWithResult(_0x409f58,null))[_0xad2e('0x15')](handleError(_0x409f58,null));}else{return _0x409f58[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x2bc6=['json','error','stack','name','send','npm\x20install','info','then','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','bluebird','status'];(function(_0x5a2d3f,_0x27b04e){var _0x5c65d8=function(_0x2d1965){while(--_0x2d1965){_0x5a2d3f['push'](_0x5a2d3f['shift']());}};_0x5c65d8(++_0x27b04e);}(_0x2bc6,0x163));var _0x62bc=function(_0x52544a,_0x41e302){_0x52544a=_0x52544a-0x0;var _0x501ecf=_0x2bc6[_0x52544a];return _0x501ecf;};'use strict';var _=require(_0x62bc('0x0'));var pm2=require(_0x62bc('0x1'));var logger=require(_0x62bc('0x2'))('api');var path=require('path');var exec=require('child_process')['exec'];var BPromise=require(_0x62bc('0x3'));function handleEntityNotFound(_0x576608,_0x2a1959){return function(_0x2b12de){if(!_0x2b12de){_0x576608['sendStatus'](0x194);;}return _0x2b12de;};}function respondWithResult(_0x3cce26,_0x450cb6){_0x450cb6=_0x450cb6||0xc8;return function(_0x40af10){if(_0x40af10){return _0x3cce26[_0x62bc('0x4')](_0x450cb6)[_0x62bc('0x5')](_0x40af10);}return null;};}function handleError(_0x3f625c,_0x5bedeb){_0x5bedeb=_0x5bedeb||0x1f4;return function(_0x441722){logger[_0x62bc('0x6')](_0x441722[_0x62bc('0x7')]);if(_0x441722[_0x62bc('0x8')]){delete _0x441722['name'];}_0x3f625c[_0x62bc('0x4')](_0x5bedeb)[_0x62bc('0x9')](_0x441722);};}function execChildProcess(){return new BPromise(function(_0x1e3a57,_0x546acc){exec(_0x62bc('0xa'),function(_0x22e6c8,_0x256784,_0x444910){logger[_0x62bc('0xb')](_0x256784);logger[_0x62bc('0xb')](_0x444910);if(_0x22e6c8){logger[_0x62bc('0x6')](_0x22e6c8);return _0x546acc(_0x22e6c8);}return _0x1e3a57(_0x256784);});});}exports['index']=function(_0x2a96ae,_0x28390b){return pm2['list']()[_0x62bc('0xc')](function(_0x10230f){if(_0x10230f){var _0xc14ac9=_['reject'](_0x10230f,function(_0x263424){return _0x263424[_0x62bc('0x8')]==='express'||_0x263424['name']===_0x62bc('0xd');});return{'rows':_0xc14ac9,'count':_0xc14ac9[_0x62bc('0xe')]};}return null;})['then'](respondWithResult(_0x28390b,null))[_0x62bc('0xf')](handleError(_0x28390b,null));};exports[_0x62bc('0x10')]=function(_0xc1211c,_0x1e2405){return pm2[_0x62bc('0x11')](_0xc1211c[_0x62bc('0x12')]['id'])[_0x62bc('0xc')](respondWithResult(_0x1e2405,null))[_0x62bc('0xc')](handleEntityNotFound(_0x1e2405,null))[_0x62bc('0xf')](handleError(_0x1e2405,null));};exports['create']=function(_0x5dd6f0,_0x2b2e5f){if(_0x5dd6f0[_0x62bc('0x13')][_0x62bc('0x8')]&&_0x5dd6f0['body'][_0x62bc('0x14')]){var _0x495f99=path[_0x62bc('0x15')](__dirname,_0x62bc('0x16'),_0x5dd6f0[_0x62bc('0x13')]['script']);var _0x3b8644=process[_0x62bc('0x17')]();process[_0x62bc('0x18')](path[_0x62bc('0x19')](_0x495f99));return execChildProcess()[_0x62bc('0xc')](function(_0x3b2eb0){process['chdir'](_0x3b8644);return pm2[_0x62bc('0x1a')]({'name':_0x5dd6f0[_0x62bc('0x13')][_0x62bc('0x8')],'script':_0x495f99});})[_0x62bc('0xc')](function(_0x117ebc){pm2['dump']();return _0x117ebc[0x0];})['then'](respondWithResult(_0x2b2e5f,0xc9))[_0x62bc('0xf')](handleError(_0x2b2e5f,null));}else{return _0x2b2e5f['status'](0x1f4)[_0x62bc('0x9')]({'message':_0x62bc('0x1b')});}};exports[_0x62bc('0x1c')]=function(_0x4a72d6,_0x3d55df){if(_0x4a72d6[_0x62bc('0x13')]['id']){delete _0x4a72d6[_0x62bc('0x13')]['id'];}var _0x5c03ac={'online':'restart','stopped':_0x62bc('0x1d')};if(_0x5c03ac[_0x62bc('0x1e')](_0x4a72d6[_0x62bc('0x13')]['status'])){return pm2[_0x5c03ac[_0x4a72d6[_0x62bc('0x13')][_0x62bc('0x4')]]](_0x4a72d6[_0x62bc('0x12')]['id'])[_0x62bc('0xc')](respondWithResult(_0x3d55df,0xc8))['catch'](handleError(_0x3d55df,null));}else{return _0x3d55df[_0x62bc('0x4')](0x1f4)['send']({'message':_0x62bc('0x1f')});}};exports[_0x62bc('0x20')]=function(_0x32048f,_0x2dd7fd){if(_0x32048f[_0x62bc('0x13')]['id']){delete _0x32048f[_0x62bc('0x13')]['id'];}if(_0x32048f[_0x62bc('0x12')]['id']){return pm2[_0x62bc('0x21')](_0x32048f[_0x62bc('0x12')]['id'])[_0x62bc('0xc')](function(_0x156f95){pm2[_0x62bc('0x22')]();return _0x156f95[0x0];})[_0x62bc('0xc')](respondWithResult(_0x2dd7fd,null))[_0x62bc('0xf')](handleError(_0x2dd7fd,null));}else{return _0x2dd7fd[_0x62bc('0x4')](0x1f4)[_0x62bc('0x9')]({'message':_0x62bc('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 2c347ec..26cb218 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 _0x0716=['exports','express','../../components/auth/service','/agents','getAgents','get','isAuthenticated','getQueues'];(function(_0x3da647,_0xa1a501){var _0x2e91a2=function(_0x34a811){while(--_0x34a811){_0x3da647['push'](_0x3da647['shift']());}};_0x2e91a2(++_0xa1a501);}(_0x0716,0x91));var _0x6071=function(_0x5d5979,_0x3b4921){_0x5d5979=_0x5d5979-0x0;var _0x237182=_0x0716[_0x5d5979];return _0x237182;};'use strict';var express=require(_0x6071('0x0'));var router=express['Router']();var auth=require(_0x6071('0x1'));var controller=require('./realtime.controller');router['get'](_0x6071('0x2'),auth['isAuthenticated'](),controller[_0x6071('0x3')]);router[_0x6071('0x4')]('/queues',auth[_0x6071('0x5')](),controller[_0x6071('0x6')]);module[_0x6071('0x7')]=router; \ No newline at end of file +var _0x4a1e=['Router','../../components/auth/service','get','/agents','isAuthenticated','getAgents','/queues','getQueues','exports','express'];(function(_0x30c7ee,_0x17d19f){var _0x4961e3=function(_0x11e033){while(--_0x11e033){_0x30c7ee['push'](_0x30c7ee['shift']());}};_0x4961e3(++_0x17d19f);}(_0x4a1e,0x153));var _0xe4a1=function(_0x1e3c02,_0x5c07a2){_0x1e3c02=_0x1e3c02-0x0;var _0x4d26d7=_0x4a1e[_0x1e3c02];return _0x4d26d7;};'use strict';var express=require(_0xe4a1('0x0'));var router=express[_0xe4a1('0x1')]();var auth=require(_0xe4a1('0x2'));var controller=require('./realtime.controller');router[_0xe4a1('0x3')](_0xe4a1('0x4'),auth[_0xe4a1('0x5')](),controller[_0xe4a1('0x6')]);router['get'](_0xe4a1('0x7'),auth[_0xe4a1('0x5')](),controller[_0xe4a1('0x8')]);module[_0xe4a1('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 4661b01..06d9206 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 _0xecca=['isValidChannel','toLowerCase','startCase','Queue','name','outbound','dialActive','dialMethod','Queues','filter','getResources','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','offset','undefined','count','limit','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','validateSortParameter','getUpdatedSortOptions','fields','join','then','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','length','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','literal','FIELD(id,','order','forEach','push','Pause','where','merge','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','findAndCountAll','map','find','filterAgentAttributes','globalStatus','includes','pause','voice','voiceStatus','talking','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','getQueues'];(function(_0x17e07e,_0x52cf24){var _0x155d9d=function(_0x1e6802){while(--_0x1e6802){_0x17e07e['push'](_0x17e07e['shift']());}};_0x155d9d(++_0x52cf24);}(_0xecca,0xbd));var _0xaecc=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xecca[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0xaecc('0x0'));var util=require(_0xaecc('0x1'));var rta=require(_0xaecc('0x2'));var rtq=require(_0xaecc('0x3'));var qs=require(_0xaecc('0x4'));var utils=require(_0xaecc('0x5'));var db=require(_0xaecc('0x6'))['db'];var APIBadRequestError=require(_0xaecc('0x7'))[_0xaecc('0x8')];var APIHandleError=require(_0xaecc('0x7'))['handleError'];function respondWithFilteredResult(_0x4c2ea4,_0x813a32){return function(_0x3484e4){if(_0x3484e4){var _0xa272a0=typeof _0x813a32[_0xaecc('0x9')]===_0xaecc('0xa')&&typeof _0x813a32['limit']===_0xaecc('0xa');var _0x4e56c4=_0x3484e4['count'];var _0x12a8e9=_0xa272a0?0x0:_0x813a32[_0xaecc('0x9')];var _0x4cd2cb=_0xa272a0?_0x3484e4[_0xaecc('0xb')]:_0x813a32[_0xaecc('0x9')]+_0x813a32[_0xaecc('0xc')];var _0x2ec45d;if(_0x4cd2cb>=_0x4e56c4){_0x4cd2cb=_0x4e56c4;_0x2ec45d=0xc8;}else{_0x2ec45d=0xce;}_0x4c2ea4[_0xaecc('0xd')](_0x2ec45d);return _0x4c2ea4[_0xaecc('0xe')](_0xaecc('0xf'),_0x12a8e9+'-'+_0x4cd2cb+'/'+_0x4e56c4)[_0xaecc('0x10')](_0x3484e4);}return null;};}exports[_0xaecc('0x11')]=function(_0x24153d,_0x132573){var _0x44f8ea={'count':0x0,'rows':[]};var _0x3e2e72={};var _0x1f09b4;var _0x4053a7=utils[_0xaecc('0x12')]();var _0x17bc48;var _0x3032f4;var _0x2a8264=_0x24153d[_0xaecc('0x13')][_0xaecc('0x14')];var _0x26e1cb=_0x24153d[_0xaecc('0x13')][_0xaecc('0x15')];var _0x3e71fc=_0x24153d['query'][_0xaecc('0x16')];var _0x45c34e=_0x26e1cb==='pause'||_0x26e1cb===_0xaecc('0x17')?!![]:![];var _0x3373dc=[];var _0xde1b27;var _0x2edeb6;Promise['resolve']()['then'](function(){if(_0x24153d[_0xaecc('0x13')][_0xaecc('0x18')]){if(!utils['isValidChannel'](_0x24153d[_0xaecc('0x13')][_0xaecc('0x18')])){throw new APIBadRequestError(util[_0xaecc('0x19')](_0xaecc('0x1a'),_0x24153d[_0xaecc('0x13')][_0xaecc('0x18')]));}_0x1f09b4=_0x24153d[_0xaecc('0x13')]['channel']['toLowerCase']();}if(!_0x24153d[_0xaecc('0x13')][_0xaecc('0x1b')]||!_0x24153d[_0xaecc('0x13')][_0xaecc('0x1b')]['includes']('globalStatus')){_0x24153d[_0xaecc('0x13')]['sort']=rta[_0xaecc('0x1c')](_0x24153d['query'][_0xaecc('0x1b')]);return;}var _0x47c1da=rta[_0xaecc('0x1d')](_0x24153d[_0xaecc('0x13')][_0xaecc('0x1b')]);_0x24153d['query']['sort']=_0x47c1da[_0xaecc('0x1e')][_0xaecc('0x1f')](',');_0xde1b27=_0x47c1da['order'];})[_0xaecc('0x20')](function(){if(!_0x2a8264){return[];}return rta[_0xaecc('0x21')](_0x2a8264,_0x1f09b4);})[_0xaecc('0x20')](function(_0x5e0025){_0x3373dc=_0x5e0025;return rta['getRealtimeAgents']();})[_0xaecc('0x20')](function(_0x262421){_0x3032f4=_0x262421[_0xaecc('0x22')];if((!_0x26e1cb||_0x45c34e)&&!_0xde1b27){return _0x3373dc;}if(_0xde1b27&&!_0x26e1cb){return rta[_0xaecc('0x23')](_0x3032f4,_0x3373dc,_0xde1b27);}else{return rta['getAgentIdsByStatus'](_0x3032f4,_0x3373dc,_0x26e1cb);}})[_0xaecc('0x20')](function(_0x29ad2a){_0x3373dc=_0x29ad2a;var _0x101f8e=![];if(_0x3373dc[_0xaecc('0x24')]===0x0){if(_0x2a8264||_0x26e1cb){_0x101f8e=!![];}if(_0x45c34e){_0x101f8e=![];}}if(_0x101f8e){return _0x44f8ea;}var _0x1d2981=_['map'](db[_0xaecc('0x25')][_0xaecc('0x26')],function(_0x41c969){return{'name':_0x41c969[_0xaecc('0x27')],'type':_0x41c969[_0xaecc('0x28')][_0xaecc('0x29')]};});_0x24153d[_0xaecc('0x13')][_0xaecc('0x2a')]=_0xaecc('0x2b');_0x3e2e72=qs[_0xaecc('0x2c')](_0x1d2981,_0x24153d);_0x3e2e72[_0xaecc('0x2d')]=!![];var _0x3ae8f8=[];if(_0x3373dc[_0xaecc('0x24')]>0x0){_0x3ae8f8['push']({'id':{'$in':_0x3373dc}});if(_0xde1b27&&!_0x26e1cb){_0x2edeb6=[db['sequelize'][_0xaecc('0x2e')](_0xaecc('0x2f')+_0x3373dc+')')];_0x3e2e72[_0xaecc('0x30')]=_0x2edeb6;}}if(_0x45c34e){_0x4053a7[_0xaecc('0x31')](function(_0x5864d0){var _0x127833=!![];if(_0x26e1cb===_0xaecc('0x17')&&_0x1f09b4!==_0x5864d0){_0x127833=![];}_0x3ae8f8[_0xaecc('0x32')]({[_0x5864d0+_0xaecc('0x33')]:_0x127833});});if(_0x3e71fc){_0x3ae8f8[_0xaecc('0x32')]({'pauseType':_0x3e71fc});}}else if(_0x26e1cb){_0x4053a7[_0xaecc('0x31')](function(_0x1b46ce){_0x3ae8f8[_0xaecc('0x32')]({[_0x1b46ce+_0xaecc('0x33')]:![]});});}_0x3e2e72[_0xaecc('0x34')]=_[_0xaecc('0x35')](_0x3e2e72[_0xaecc('0x34')],{'$and':_0x3ae8f8});if(_0x24153d[_0xaecc('0x36')][_0xaecc('0x2a')]===_0xaecc('0x36')){var _0x321805={'params':{'id':_0x24153d[_0xaecc('0x36')][_0xaecc('0x37')]},'query':{'section':_0xaecc('0x38'),'role':'agent','raw':!![],'ids':_0x3373dc,'customSorting':_0x2edeb6}};if(_0x24153d[_0xaecc('0x13')]['online']){_0x321805[_0xaecc('0x13')]['online']=!![];}if(_0x45c34e){_0x321805['query'][_0xaecc('0x39')]=_0x3ae8f8;}_0x321805[_0xaecc('0x13')]=Object[_0xaecc('0x3a')](_0x321805[_0xaecc('0x13')],_0x24153d[_0xaecc('0x13')]);return db[_0xaecc('0x3b')]['getResources'](_0x321805);}return db[_0xaecc('0x25')][_0xaecc('0x3c')](_0x3e2e72);})[_0xaecc('0x20')](function(_0x29a373){_0x44f8ea[_0xaecc('0xb')]=_0x29a373[_0xaecc('0xb')];_0x17bc48=_0x29a373[_0xaecc('0x22')];return _0x17bc48[_0xaecc('0x3d')](function(_0x1fc9f7){var _0x452e30=_[_0xaecc('0x3e')](_0x3032f4,['id',_0x1fc9f7['id']]);if(_0x452e30){var _0x4dad47=rta[_0xaecc('0x3f')](_0x452e30);_[_0xaecc('0x35')](_0x1fc9f7,_0x4dad47);}_0x1fc9f7[_0xaecc('0x40')]=rta['getAgentStatus'](_0x1fc9f7);if(_0x1fc9f7[_0xaecc('0x40')][_0xaecc('0x41')](_0xaecc('0x42'))){_0x4053a7[_0xaecc('0x31')](function(_0x290013){if(_0x1fc9f7[_0x290013+'Pause']){if(_0x290013===_0xaecc('0x43')){if(_0x1fc9f7[_0xaecc('0x44')]!==_0xaecc('0x45')){_0x1fc9f7[_0xaecc('0x44')]='pause';}}else{_0x1fc9f7[_0x290013+'Status']=_0xaecc('0x42');}}});}return _0x1fc9f7;});})['then'](function(_0x51ad53){if(!_0xde1b27||_0x2edeb6){return _0x51ad53;}return rta[_0xaecc('0x46')](_0x51ad53,_0xde1b27);})[_0xaecc('0x20')](function(_0x13db5b){var _0x92ffb8=rta[_0xaecc('0x47')]();_0x44f8ea[_0xaecc('0x22')]=_0x13db5b[_0xaecc('0x3d')](function(_0x1b529d){return _[_0xaecc('0x48')](_0x1b529d,_0x92ffb8);});return _0x44f8ea;})[_0xaecc('0x20')](respondWithFilteredResult(_0x132573,_0x3e2e72))[_0xaecc('0x49')](APIHandleError(_0x132573));};exports[_0xaecc('0x4a')]=function(_0x270bd8,_0x20e5d1){var _0x3adef1={'count':0x0,'rows':[]};var _0x4b552e={};var _0x4a8fce;var _0x13b25a;var _0x126b88;Promise['resolve']()['then'](function(){if(_0x270bd8[_0xaecc('0x13')]['channel']){if(!utils[_0xaecc('0x4b')](_0x270bd8[_0xaecc('0x13')][_0xaecc('0x18')])){throw new APIBadRequestError(util[_0xaecc('0x19')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x270bd8[_0xaecc('0x13')]['channel']));}_0x4a8fce=_0x270bd8[_0xaecc('0x13')]['channel'][_0xaecc('0x4c')]();}var _0x93852=_[_0xaecc('0x4d')](_0x4a8fce)+_0xaecc('0x4e');var _0x3e5bc3=_['map'](db[_0x93852][_0xaecc('0x26')],function(_0x49373d){return{'name':_0x49373d['fieldName'],'type':_0x49373d[_0xaecc('0x28')][_0xaecc('0x29')]};});if(!_0x270bd8[_0xaecc('0x13')][_0xaecc('0x1e')]){var _0x75e86=['id',_0xaecc('0x4f')];if(_0x4a8fce==='voice'){_0x75e86['push'](_0xaecc('0x28'));if(_0x270bd8[_0xaecc('0x13')][_0xaecc('0x28')]===_0xaecc('0x50')){_0x75e86[_0xaecc('0x32')]([_0xaecc('0x51'),_0xaecc('0x52')]);}}_0x270bd8['query'][_0xaecc('0x1e')]=_0x75e86['join'](',');}_0x4b552e=qs[_0xaecc('0x2c')](_0x3e5bc3,_0x270bd8);if(_0x270bd8[_0xaecc('0x36')]['role']===_0xaecc('0x36')){var _0x3a3905={'params':{'id':_0x270bd8[_0xaecc('0x36')][_0xaecc('0x37')]},'query':{'section':_0x4a8fce===_0xaecc('0x43')&&_0x270bd8[_0xaecc('0x13')]['type']===_0xaecc('0x50')?'QueueCampaigns':_[_0xaecc('0x4d')](_0x4a8fce)+_0xaecc('0x53'),'type':_0x270bd8[_0xaecc('0x13')][_0xaecc('0x28')],'nolimit':!![],'sort':_0xaecc('0x4f'),'filter':_0x270bd8[_0xaecc('0x13')][_0xaecc('0x54')]}};_0x3a3905[_0xaecc('0x13')]=Object[_0xaecc('0x3a')](_0x3a3905[_0xaecc('0x13')],_0x270bd8[_0xaecc('0x13')]);delete _0x3a3905[_0xaecc('0x13')]['id'];return db[_0xaecc('0x3b')][_0xaecc('0x55')](_0x3a3905);}return db[_0x93852]['findAndCountAll'](_0x4b552e);})['then'](function(_0x1aa2f5){_0x3adef1[_0xaecc('0xb')]=_0x1aa2f5[_0xaecc('0xb')];_0x13b25a=_0x1aa2f5[_0xaecc('0x22')];return rtq[_0xaecc('0x56')](_0x270bd8,_0x4a8fce);})[_0xaecc('0x20')](function(_0x2f8ddc){_0x126b88=_0x2f8ddc[_0xaecc('0x22')];return rtq[_0xaecc('0x57')](_0x13b25a,_0x126b88,_0x4a8fce,_0x270bd8[_0xaecc('0x13')]['type']);})['then'](function(_0x53a1da){_0x3adef1['rows']=_0x53a1da;return _0x3adef1;})[_0xaecc('0x20')](respondWithFilteredResult(_0x20e5d1,_0x4b552e))[_0xaecc('0x49')](APIHandleError(_0x20e5d1));}; \ No newline at end of file +var _0x57da=['sequelize','literal','FIELD(id,','forEach','Pause','push','where','merge','user','userProfileId','Agents','assign','UserProfile','getResources','findAndCountAll','find','voice','voiceStatus','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','catch','getQueues','Channel\x20parameter\x20%s\x20is\x20invalid','startCase','type','name','outbound','dialActive','dialMethod','fields','join','QueueCampaigns','Queues','filter','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','offset','undefined','limit','count','set','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pause','*pause','resolve','then','channel','isValidChannel','format','toLowerCase','sort','includes','globalStatus','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','key','role','agent','raw'];(function(_0x14c414,_0xf3ecb9){var _0x39fe47=function(_0x56fdcb){while(--_0x56fdcb){_0x14c414['push'](_0x14c414['shift']());}};_0x39fe47(++_0xf3ecb9);}(_0x57da,0x1b5));var _0xa57d=function(_0x23d117,_0x1ce266){_0x23d117=_0x23d117-0x0;var _0x400434=_0x57da[_0x23d117];return _0x400434;};'use strict';var _=require(_0xa57d('0x0'));var util=require(_0xa57d('0x1'));var rta=require(_0xa57d('0x2'));var rtq=require(_0xa57d('0x3'));var qs=require(_0xa57d('0x4'));var utils=require(_0xa57d('0x5'));var db=require(_0xa57d('0x6'))['db'];var APIBadRequestError=require('../../errors/api')[_0xa57d('0x7')];var APIHandleError=require('../../errors/api')['handleError'];function respondWithFilteredResult(_0x453f94,_0x3e9b0d){return function(_0x421877){if(_0x421877){var _0x51d4f4=typeof _0x3e9b0d[_0xa57d('0x8')]===_0xa57d('0x9')&&typeof _0x3e9b0d[_0xa57d('0xa')]==='undefined';var _0x2da027=_0x421877[_0xa57d('0xb')];var _0x4b469f=_0x51d4f4?0x0:_0x3e9b0d[_0xa57d('0x8')];var _0x5839b9=_0x51d4f4?_0x421877['count']:_0x3e9b0d['offset']+_0x3e9b0d['limit'];var _0x54efac;if(_0x5839b9>=_0x2da027){_0x5839b9=_0x2da027;_0x54efac=0xc8;}else{_0x54efac=0xce;}_0x453f94['status'](_0x54efac);return _0x453f94[_0xa57d('0xc')]('Content-Range',_0x4b469f+'-'+_0x5839b9+'/'+_0x2da027)[_0xa57d('0xd')](_0x421877);}return null;};}exports[_0xa57d('0xe')]=function(_0x39b8bb,_0x1c8bee){var _0x4d7395={'count':0x0,'rows':[]};var _0x434ffc={};var _0x2e676d;var _0x576040=utils[_0xa57d('0xf')]();var _0x5333b4;var _0x4b797e;var _0x29822a=_0x39b8bb[_0xa57d('0x10')][_0xa57d('0x11')];var _0x270c5c=_0x39b8bb[_0xa57d('0x10')][_0xa57d('0x12')];var _0x3264aa=_0x39b8bb[_0xa57d('0x10')]['pauseTypeFilter'];var _0x5e3dbd=_0x270c5c===_0xa57d('0x13')||_0x270c5c===_0xa57d('0x14')?!![]:![];var _0x8e55ae=[];var _0x4a3203;var _0x1dd5d6;Promise[_0xa57d('0x15')]()[_0xa57d('0x16')](function(){if(_0x39b8bb['query'][_0xa57d('0x17')]){if(!utils[_0xa57d('0x18')](_0x39b8bb['query']['channel'])){throw new APIBadRequestError(util[_0xa57d('0x19')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x39b8bb[_0xa57d('0x10')][_0xa57d('0x17')]));}_0x2e676d=_0x39b8bb['query']['channel'][_0xa57d('0x1a')]();}if(!_0x39b8bb[_0xa57d('0x10')][_0xa57d('0x1b')]||!_0x39b8bb['query'][_0xa57d('0x1b')][_0xa57d('0x1c')](_0xa57d('0x1d'))){_0x39b8bb[_0xa57d('0x10')]['sort']=rta['validateSortParameter'](_0x39b8bb[_0xa57d('0x10')][_0xa57d('0x1b')]);return;}var _0x5aade4=rta['getUpdatedSortOptions'](_0x39b8bb[_0xa57d('0x10')][_0xa57d('0x1b')]);_0x39b8bb[_0xa57d('0x10')][_0xa57d('0x1b')]=_0x5aade4['fields']['join'](',');_0x4a3203=_0x5aade4[_0xa57d('0x1e')];})[_0xa57d('0x16')](function(){if(!_0x29822a){return[];}return rta[_0xa57d('0x1f')](_0x29822a,_0x2e676d);})[_0xa57d('0x16')](function(_0x38a907){_0x8e55ae=_0x38a907;return rta[_0xa57d('0x20')]();})[_0xa57d('0x16')](function(_0x2eed01){_0x4b797e=_0x2eed01[_0xa57d('0x21')];if((!_0x270c5c||_0x5e3dbd)&&!_0x4a3203){return _0x8e55ae;}if(_0x4a3203&&!_0x270c5c){return rta[_0xa57d('0x22')](_0x4b797e,_0x8e55ae,_0x4a3203);}else{return rta['getAgentIdsByStatus'](_0x4b797e,_0x8e55ae,_0x270c5c);}})[_0xa57d('0x16')](function(_0x198044){_0x8e55ae=_0x198044;var _0x3ef38b=![];if(_0x8e55ae[_0xa57d('0x23')]===0x0){if(_0x29822a||_0x270c5c){_0x3ef38b=!![];}if(_0x5e3dbd){_0x3ef38b=![];}}if(_0x3ef38b){return _0x4d7395;}var _0x191615=_[_0xa57d('0x24')](db[_0xa57d('0x25')][_0xa57d('0x26')],function(_0x366df4){return{'name':_0x366df4['fieldName'],'type':_0x366df4['type'][_0xa57d('0x27')]};});_0x39b8bb[_0xa57d('0x10')][_0xa57d('0x28')]=_0xa57d('0x29');_0x434ffc=qs['getOptions'](_0x191615,_0x39b8bb);_0x434ffc[_0xa57d('0x2a')]=!![];var _0x2482f0=[];if(_0x8e55ae['length']>0x0){_0x2482f0['push']({'id':{'$in':_0x8e55ae}});if(_0x4a3203&&!_0x270c5c){_0x1dd5d6=[db[_0xa57d('0x2b')][_0xa57d('0x2c')](_0xa57d('0x2d')+_0x8e55ae+')')];_0x434ffc[_0xa57d('0x1e')]=_0x1dd5d6;}}if(_0x5e3dbd){_0x576040[_0xa57d('0x2e')](function(_0x2602ff){var _0x1ed74f=!![];if(_0x270c5c===_0xa57d('0x14')&&_0x2e676d!==_0x2602ff){_0x1ed74f=![];}_0x2482f0['push']({[_0x2602ff+_0xa57d('0x2f')]:_0x1ed74f});});if(_0x3264aa){_0x2482f0[_0xa57d('0x30')]({'pauseType':_0x3264aa});}}else if(_0x270c5c){_0x576040[_0xa57d('0x2e')](function(_0x412065){_0x2482f0['push']({[_0x412065+_0xa57d('0x2f')]:![]});});}_0x434ffc[_0xa57d('0x31')]=_[_0xa57d('0x32')](_0x434ffc['where'],{'$and':_0x2482f0});if(_0x39b8bb[_0xa57d('0x33')][_0xa57d('0x28')]===_0xa57d('0x33')){var _0x3eeaef={'params':{'id':_0x39b8bb['user'][_0xa57d('0x34')]},'query':{'section':_0xa57d('0x35'),'role':'agent','raw':!![],'ids':_0x8e55ae,'customSorting':_0x1dd5d6}};if(_0x39b8bb['query']['online']){_0x3eeaef[_0xa57d('0x10')]['online']=!![];}if(_0x5e3dbd){_0x3eeaef[_0xa57d('0x10')]['extraQueryConditions']=_0x2482f0;}_0x3eeaef[_0xa57d('0x10')]=Object[_0xa57d('0x36')](_0x3eeaef[_0xa57d('0x10')],_0x39b8bb[_0xa57d('0x10')]);return db[_0xa57d('0x37')][_0xa57d('0x38')](_0x3eeaef);}return db[_0xa57d('0x25')][_0xa57d('0x39')](_0x434ffc);})[_0xa57d('0x16')](function(_0x4b3b82){_0x4d7395[_0xa57d('0xb')]=_0x4b3b82[_0xa57d('0xb')];_0x5333b4=_0x4b3b82[_0xa57d('0x21')];return _0x5333b4['map'](function(_0x459441){var _0x1936b8=_[_0xa57d('0x3a')](_0x4b797e,['id',_0x459441['id']]);if(_0x1936b8){var _0x1f3c4c=rta['filterAgentAttributes'](_0x1936b8);_['merge'](_0x459441,_0x1f3c4c);}_0x459441['globalStatus']=rta['getAgentStatus'](_0x459441);if(_0x459441[_0xa57d('0x1d')][_0xa57d('0x1c')](_0xa57d('0x13'))){_0x576040['forEach'](function(_0x50f8b3){if(_0x459441[_0x50f8b3+_0xa57d('0x2f')]){if(_0x50f8b3===_0xa57d('0x3b')){if(_0x459441[_0xa57d('0x3c')]!=='talking'){_0x459441[_0xa57d('0x3c')]=_0xa57d('0x13');}}else{_0x459441[_0x50f8b3+_0xa57d('0x3d')]=_0xa57d('0x13');}}});}return _0x459441;});})[_0xa57d('0x16')](function(_0x13ca79){if(!_0x4a3203||_0x1dd5d6){return _0x13ca79;}return rta[_0xa57d('0x3e')](_0x13ca79,_0x4a3203);})[_0xa57d('0x16')](function(_0x4d77dc){var _0x5c0414=rta[_0xa57d('0x3f')]();_0x4d7395['rows']=_0x4d77dc['map'](function(_0x472465){return _['pick'](_0x472465,_0x5c0414);});return _0x4d7395;})[_0xa57d('0x16')](respondWithFilteredResult(_0x1c8bee,_0x434ffc))[_0xa57d('0x40')](APIHandleError(_0x1c8bee));};exports[_0xa57d('0x41')]=function(_0x51a8bc,_0x38c985){var _0x7f14fe={'count':0x0,'rows':[]};var _0x51c7a5={};var _0x18e7f0;var _0x33042e;var _0x49619d;Promise['resolve']()[_0xa57d('0x16')](function(){if(_0x51a8bc[_0xa57d('0x10')]['channel']){if(!utils[_0xa57d('0x18')](_0x51a8bc[_0xa57d('0x10')][_0xa57d('0x17')])){throw new APIBadRequestError(util[_0xa57d('0x19')](_0xa57d('0x42'),_0x51a8bc[_0xa57d('0x10')][_0xa57d('0x17')]));}_0x18e7f0=_0x51a8bc[_0xa57d('0x10')]['channel'][_0xa57d('0x1a')]();}var _0x13a543=_[_0xa57d('0x43')](_0x18e7f0)+'Queue';var _0x2afe30=_['map'](db[_0x13a543][_0xa57d('0x26')],function(_0x1fb9d2){return{'name':_0x1fb9d2['fieldName'],'type':_0x1fb9d2[_0xa57d('0x44')]['key']};});if(!_0x51a8bc[_0xa57d('0x10')]['fields']){var _0xc8c321=['id',_0xa57d('0x45')];if(_0x18e7f0===_0xa57d('0x3b')){_0xc8c321[_0xa57d('0x30')]('type');if(_0x51a8bc[_0xa57d('0x10')][_0xa57d('0x44')]===_0xa57d('0x46')){_0xc8c321[_0xa57d('0x30')]([_0xa57d('0x47'),_0xa57d('0x48')]);}}_0x51a8bc[_0xa57d('0x10')][_0xa57d('0x49')]=_0xc8c321[_0xa57d('0x4a')](',');}_0x51c7a5=qs['getOptions'](_0x2afe30,_0x51a8bc);if(_0x51a8bc[_0xa57d('0x33')]['role']===_0xa57d('0x33')){var _0x238a3d={'params':{'id':_0x51a8bc[_0xa57d('0x33')][_0xa57d('0x34')]},'query':{'section':_0x18e7f0===_0xa57d('0x3b')&&_0x51a8bc[_0xa57d('0x10')][_0xa57d('0x44')]==='outbound'?_0xa57d('0x4b'):_[_0xa57d('0x43')](_0x18e7f0)+_0xa57d('0x4c'),'type':_0x51a8bc[_0xa57d('0x10')][_0xa57d('0x44')],'nolimit':!![],'sort':'name','filter':_0x51a8bc[_0xa57d('0x10')][_0xa57d('0x4d')]}};_0x238a3d[_0xa57d('0x10')]=Object['assign'](_0x238a3d[_0xa57d('0x10')],_0x51a8bc[_0xa57d('0x10')]);delete _0x238a3d[_0xa57d('0x10')]['id'];return db[_0xa57d('0x37')]['getResources'](_0x238a3d);}return db[_0x13a543][_0xa57d('0x39')](_0x51c7a5);})['then'](function(_0x1c2de2){_0x7f14fe[_0xa57d('0xb')]=_0x1c2de2[_0xa57d('0xb')];_0x33042e=_0x1c2de2['rows'];return rtq[_0xa57d('0x4e')](_0x51a8bc,_0x18e7f0);})[_0xa57d('0x16')](function(_0x58de24){_0x49619d=_0x58de24[_0xa57d('0x21')];return rtq[_0xa57d('0x4f')](_0x33042e,_0x49619d,_0x18e7f0,_0x51a8bc[_0xa57d('0x10')][_0xa57d('0x44')]);})[_0xa57d('0x16')](function(_0x2543e1){_0x7f14fe['rows']=_0x2543e1;return _0x7f14fe;})[_0xa57d('0x16')](respondWithFilteredResult(_0x38c985,_0x51c7a5))['catch'](APIHandleError(_0x38c985));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 357f4f9..80342ea 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x148107,_0x55755a){var _0x4008fc=function(_0x494ab9){while(--_0x494ab9){_0x148107['push'](_0x148107['shift']());}};_0x4008fc(++_0x55755a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x27bd02,_0x2f0b62){var _0x4a8704=function(_0x42a173){while(--_0x42a173){_0x27bd02['push'](_0x27bd02['shift']());}};_0x4a8704(++_0x2f0b62);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x14477e,_0x44d4da){_0x14477e=_0x14477e-0x0;var _0x5d4a05=_0xcb91[_0x14477e];return _0x5d4a05;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 56872dd..5b1f6b1 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 _0x7fbe=['INTEGER','STRING','DATE'];(function(_0x3da508,_0x2d3629){var _0xcdc748=function(_0x39e407){while(--_0x39e407){_0x3da508['push'](_0x3da508['shift']());}};_0xcdc748(++_0x2d3629);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x16acb7,_0x23f034){_0x16acb7=_0x16acb7-0x0;var _0x39bf39=_0x7fbe[_0x16acb7];return _0x39bf39;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xe7fb('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xe7fb('0x1')]},'scheduledat':{'type':Sequelize[_0xe7fb('0x2')]},'uniqueid':{'type':Sequelize[_0xe7fb('0x1')]},'starttime':{'type':Sequelize[_0xe7fb('0x2')]},'responsetime':{'type':Sequelize[_0xe7fb('0x2')]},'ringtime':{'type':Sequelize[_0xe7fb('0x0')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe7fb('0x1')]},'campaigntype':{'type':Sequelize[_0xe7fb('0x1')]},'membername':{'type':Sequelize[_0xe7fb('0x1')]}}; \ No newline at end of file +var _0x91c6=['sequelize','STRING','DATE'];(function(_0x4f3a52,_0x325b29){var _0x24afdb=function(_0xe53004){while(--_0xe53004){_0x4f3a52['push'](_0x4f3a52['shift']());}};_0x24afdb(++_0x325b29);}(_0x91c6,0xf9));var _0x691c=function(_0x512db7,_0x15b80e){_0x512db7=_0x512db7-0x0;var _0x7c204=_0x91c6[_0x512db7];return _0x7c204;};'use strict';var Sequelize=require(_0x691c('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x691c('0x1')]},'scheduledat':{'type':Sequelize[_0x691c('0x2')]},'uniqueid':{'type':Sequelize[_0x691c('0x1')]},'starttime':{'type':Sequelize[_0x691c('0x2')]},'responsetime':{'type':Sequelize[_0x691c('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x691c('0x1')]},'campaigntype':{'type':Sequelize[_0x691c('0x1')]},'membername':{'type':Sequelize[_0x691c('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 2d79a6b..c960df4 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 _0x3689=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1972d3,_0x515867){var _0x52cc9b=function(_0x1c31f0){while(--_0x1c31f0){_0x1972d3['push'](_0x1972d3['shift']());}};_0x52cc9b(++_0x515867);}(_0x3689,0x1da));var _0x9368=function(_0x4f4296,_0x112d5f){_0x4f4296=_0x4f4296-0x0;var _0x3f9ad2=_0x3689[_0x4f4296];return _0x3f9ad2;};'use strict';var _=require(_0x9368('0x0'));var util=require(_0x9368('0x1'));var logger=require(_0x9368('0x2'))(_0x9368('0x3'));var moment=require(_0x9368('0x4'));var BPromise=require(_0x9368('0x5'));var rp=require(_0x9368('0x6'));var fs=require('fs');var path=require(_0x9368('0x7'));var rimraf=require(_0x9368('0x8'));var config=require(_0x9368('0x9'));var attributes=require(_0x9368('0xa'));module[_0x9368('0xb')]=function(_0xc34ee2,_0x141fd5){return _0xc34ee2[_0x9368('0xc')](_0x9368('0xd'),attributes,{'tableName':_0x9368('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x870d=['moment','bluebird','request-promise','rimraf','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x148879,_0x5b4c11){var _0x4f7027=function(_0xad056b){while(--_0xad056b){_0x148879['push'](_0x148879['shift']());}};_0x4f7027(++_0x5b4c11);}(_0x870d,0x126));var _0xd870=function(_0x206e54,_0x53855c){_0x206e54=_0x206e54-0x0;var _0x5740b9=_0x870d[_0x206e54];return _0x5740b9;};'use strict';var _=require(_0xd870('0x0'));var util=require(_0xd870('0x1'));var logger=require(_0xd870('0x2'))('api');var moment=require(_0xd870('0x3'));var BPromise=require(_0xd870('0x4'));var rp=require(_0xd870('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd870('0x6'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0xd870('0x7')]=function(_0x235339,_0x2c5ad1){return _0x235339[_0xd870('0x8')](_0xd870('0x9'),attributes,{'tableName':_0xd870('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 bf0c398..d415591 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 _0x063a=['result','catch','CreateReportAgentPreview','options','raw','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x173593,_0x43bab3){var _0x1c0eda=function(_0x196dd5){while(--_0x196dd5){_0x173593['push'](_0x173593['shift']());}};_0x1c0eda(++_0x43bab3);}(_0x063a,0x1e0));var _0xa063=function(_0x39200c,_0x40d877){_0x39200c=_0x39200c-0x0;var _0x3f47e9=_0x063a[_0x39200c];return _0x3f47e9;};'use strict';var _=require(_0xa063('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa063('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa063('0x2'));var db=require(_0xa063('0x3'))['db'];var utils=require(_0xa063('0x4'));var logger=require(_0xa063('0x5'))(_0xa063('0x6'));var config=require('../../config/environment');var jayson=require(_0xa063('0x7'));var client=jayson[_0xa063('0x8')][_0xa063('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48d75c,_0xded8a0,_0xc15936){return new BPromise(function(_0x29604a,_0x20cffa){return client[_0xa063('0xa')](_0x48d75c,_0xc15936)[_0xa063('0xb')](function(_0x119bbb){logger[_0xa063('0xc')](_0xa063('0xd'),_0xded8a0,'request\x20sent');logger[_0xa063('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0xded8a0,_0xa063('0xf'),JSON[_0xa063('0x10')](_0x119bbb));if(_0x119bbb[_0xa063('0x11')]){if(_0x119bbb[_0xa063('0x11')][_0xa063('0x12')]===0x1f4){logger[_0xa063('0x11')](_0xa063('0xd'),_0xded8a0,_0x119bbb['error'][_0xa063('0x13')]);return _0x20cffa(_0x119bbb[_0xa063('0x11')][_0xa063('0x13')]);}logger['error'](_0xa063('0xd'),_0xded8a0,_0x119bbb[_0xa063('0x11')]['message']);return _0x29604a(_0x119bbb[_0xa063('0x11')][_0xa063('0x13')]);}else{logger['info'](_0xa063('0xd'),_0xded8a0,'request\x20sent');_0x29604a(_0x119bbb[_0xa063('0x14')][_0xa063('0x13')]);}})[_0xa063('0x15')](function(_0x3adc90){logger[_0xa063('0x11')](_0xa063('0xd'),_0xded8a0,_0x3adc90);_0x20cffa(_0x3adc90);});});}exports[_0xa063('0x16')]=function(_0x4aabc8){var _0x1fa2ef=this;return new Promise(function(_0xc5b2ed,_0x259e94){return db['ReportAgentPreview']['create'](_0x4aabc8['body'],{'raw':_0x4aabc8[_0xa063('0x17')]?_0x4aabc8[_0xa063('0x17')][_0xa063('0x18')]===undefined?!![]:![]:!![]})[_0xa063('0xb')](function(_0x4aba7d){logger['info']('CreateReportAgentPreview',_0x4aabc8);logger[_0xa063('0xe')](_0xa063('0x16'),_0x4aabc8,JSON[_0xa063('0x10')](_0x4aba7d));_0xc5b2ed(_0x4aba7d);})[_0xa063('0x15')](function(_0x4484bd){logger[_0xa063('0x11')](_0xa063('0x16'),_0x4484bd[_0xa063('0x13')],_0x4aabc8);_0x259e94(_0x1fa2ef[_0xa063('0x11')](0x1f4,_0x4484bd[_0xa063('0x13')]));});});}; \ No newline at end of file +var _0x1dda=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ReportAgentPreview','create','options','raw','debug','CreateReportAgentPreview','lodash','util'];(function(_0x7d18a0,_0x4a1a38){var _0x12da6d=function(_0x31e75a){while(--_0x31e75a){_0x7d18a0['push'](_0x7d18a0['shift']());}};_0x12da6d(++_0x4a1a38);}(_0x1dda,0x1c0));var _0xa1dd=function(_0x46f3f8,_0x12c74b){_0x46f3f8=_0x46f3f8-0x0;var _0xbc57cd=_0x1dda[_0x46f3f8];return _0xbc57cd;};'use strict';var _=require(_0xa1dd('0x0'));var util=require(_0xa1dd('0x1'));var moment=require(_0xa1dd('0x2'));var BPromise=require('bluebird');var rs=require(_0xa1dd('0x3'));var fs=require('fs');var Redis=require(_0xa1dd('0x4'));var db=require(_0xa1dd('0x5'))['db'];var utils=require(_0xa1dd('0x6'));var logger=require(_0xa1dd('0x7'))(_0xa1dd('0x8'));var config=require(_0xa1dd('0x9'));var jayson=require(_0xa1dd('0xa'));var client=jayson[_0xa1dd('0xb')][_0xa1dd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1aa24b,_0x5e01c2,_0x451da2){return new BPromise(function(_0x62cd59,_0x23955b){return client['request'](_0x1aa24b,_0x451da2)[_0xa1dd('0xd')](function(_0x2fee8b){logger['info'](_0xa1dd('0xe'),_0x5e01c2,_0xa1dd('0xf'));logger['debug'](_0xa1dd('0x10'),_0x5e01c2,_0xa1dd('0xf'),JSON[_0xa1dd('0x11')](_0x2fee8b));if(_0x2fee8b[_0xa1dd('0x12')]){if(_0x2fee8b[_0xa1dd('0x12')][_0xa1dd('0x13')]===0x1f4){logger[_0xa1dd('0x12')](_0xa1dd('0xe'),_0x5e01c2,_0x2fee8b['error']['message']);return _0x23955b(_0x2fee8b[_0xa1dd('0x12')]['message']);}logger[_0xa1dd('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x5e01c2,_0x2fee8b[_0xa1dd('0x12')][_0xa1dd('0x14')]);return _0x62cd59(_0x2fee8b[_0xa1dd('0x12')]['message']);}else{logger[_0xa1dd('0x15')]('ReportAgentPreview,\x20%s,\x20%s',_0x5e01c2,_0xa1dd('0xf'));_0x62cd59(_0x2fee8b[_0xa1dd('0x16')][_0xa1dd('0x14')]);}})[_0xa1dd('0x17')](function(_0x168875){logger[_0xa1dd('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x5e01c2,_0x168875);_0x23955b(_0x168875);});});}exports['CreateReportAgentPreview']=function(_0x24cfab){var _0x220c40=this;return new Promise(function(_0x5011f7,_0x55bd81){return db[_0xa1dd('0x18')][_0xa1dd('0x19')](_0x24cfab['body'],{'raw':_0x24cfab[_0xa1dd('0x1a')]?_0x24cfab[_0xa1dd('0x1a')][_0xa1dd('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3ac68c){logger['info']('CreateReportAgentPreview',_0x24cfab);logger[_0xa1dd('0x1c')](_0xa1dd('0x1d'),_0x24cfab,JSON[_0xa1dd('0x11')](_0x3ac68c));_0x5011f7(_0x3ac68c);})[_0xa1dd('0x17')](function(_0x33e509){logger['error'](_0xa1dd('0x1d'),_0x33e509[_0xa1dd('0x14')],_0x24cfab);_0x55bd81(_0x220c40[_0xa1dd('0x12')](0x1f4,_0x33e509['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 4b2e403..31eaf21 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 _0xb435=['faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','post','queueNotify','mail','showMailQueues','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','exports','multer','util','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound/channels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts'];(function(_0x1a32fe,_0xdab6ac){var _0x1abca6=function(_0x280920){while(--_0x280920){_0x1a32fe['push'](_0x1a32fe['shift']());}};_0x1abca6(++_0xdab6ac);}(_0xb435,0x10d));var _0x5b43=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb435[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x5b43('0x0'));var util=require(_0x5b43('0x1'));var path=require(_0x5b43('0x2'));var express=require(_0x5b43('0x3'));var router=express[_0x5b43('0x4')]();var auth=require(_0x5b43('0x5'));var controller=require('./rpc.controller');router[_0x5b43('0x6')](_0x5b43('0x7'),auth[_0x5b43('0x8')](),controller['voiceChannels']);router['get'](_0x5b43('0x9'),auth[_0x5b43('0x8')](),controller[_0x5b43('0xa')]);router[_0x5b43('0x6')](_0x5b43('0xb'),auth['isAuthenticated'](),controller[_0x5b43('0xc')]);router[_0x5b43('0x6')](_0x5b43('0xd'),auth[_0x5b43('0x8')](),controller['voiceQueues']);router[_0x5b43('0x6')](_0x5b43('0xe'),auth[_0x5b43('0x8')](),controller[_0x5b43('0xf')]);router['get'](_0x5b43('0x10'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x11')]);router[_0x5b43('0x6')](_0x5b43('0x12'),auth['isAuthenticated'](),controller[_0x5b43('0x13')]);router[_0x5b43('0x6')](_0x5b43('0x14'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x15')]);router[_0x5b43('0x6')](_0x5b43('0x16'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x17')]);router[_0x5b43('0x6')](_0x5b43('0x18'),auth['isAuthenticated'](),controller['whatsappQueues']);router['get'](_0x5b43('0x19'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x1a')]);router[_0x5b43('0x6')](_0x5b43('0x1b'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x1c')]);router[_0x5b43('0x6')](_0x5b43('0x1d'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x1e')]);router[_0x5b43('0x6')]('/voice/queues/channels/:uniqueid',auth[_0x5b43('0x8')](),controller[_0x5b43('0x1f')]);router[_0x5b43('0x6')](_0x5b43('0x20'),auth[_0x5b43('0x8')](),controller['voiceQueuesChannelHangup']);router[_0x5b43('0x6')](_0x5b43('0x21'),auth['isAuthenticated'](),controller[_0x5b43('0x22')]);router[_0x5b43('0x6')](_0x5b43('0x23'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x24')]);router['put'](_0x5b43('0x23'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x25')]);router[_0x5b43('0x6')]('/outbound',auth[_0x5b43('0x8')](),controller['outbound']);router['get'](_0x5b43('0x26'),auth[_0x5b43('0x8')](),controller['outboundChannels']);router[_0x5b43('0x6')](_0x5b43('0x27'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x28')]);router[_0x5b43('0x29')](_0x5b43('0x2a'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x2b')]);router[_0x5b43('0x6')](_0x5b43('0x2c'),auth['isAuthenticated'](),controller[_0x5b43('0x2d')]);router['get'](_0x5b43('0x2e'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x2f')]);router[_0x5b43('0x6')](_0x5b43('0x30'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x31')]);router['get'](_0x5b43('0x32'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x33')]);router[_0x5b43('0x6')](_0x5b43('0x34'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x5b43('0x6')](_0x5b43('0x35'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x36')]);router[_0x5b43('0x6')](_0x5b43('0x37'),auth['isAuthenticated'](),controller[_0x5b43('0x38')]);router['get'](_0x5b43('0x39'),auth[_0x5b43('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x5b43('0x6')](_0x5b43('0x3a'),auth['isAuthenticated'](),controller[_0x5b43('0x3b')]);router[_0x5b43('0x6')]('/whatsapp/queues/waitinginteractions',auth[_0x5b43('0x8')](),controller[_0x5b43('0x3c')]);router['get']('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x5b43('0x3d')]('/mail/queues/:id/notify',auth[_0x5b43('0x8')](),controller[_0x5b43('0x3e')](_0x5b43('0x3f')));router[_0x5b43('0x6')]('/mail/queues/:id',auth[_0x5b43('0x8')](),controller[_0x5b43('0x40')]);router[_0x5b43('0x3d')]('/chat/queues/:id/notify',auth[_0x5b43('0x8')](),controller[_0x5b43('0x3e')](_0x5b43('0x41')));router['get'](_0x5b43('0x42'),auth['isAuthenticated'](),controller[_0x5b43('0x43')]);router[_0x5b43('0x3d')](_0x5b43('0x44'),auth['isAuthenticated'](),controller[_0x5b43('0x3e')](_0x5b43('0x45')));router[_0x5b43('0x6')](_0x5b43('0x46'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x47')]);router[_0x5b43('0x3d')]('/openchannel/queues/:id/notify',auth[_0x5b43('0x8')](),controller[_0x5b43('0x3e')](_0x5b43('0x48')));router['get'](_0x5b43('0x49'),auth[_0x5b43('0x8')](),controller['showOpenchannelQueues']);router[_0x5b43('0x3d')](_0x5b43('0x4a'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x3e')]('sms'));router[_0x5b43('0x3d')]('/whatsapp/queues/:id/notify',auth[_0x5b43('0x8')](),controller[_0x5b43('0x3e')](_0x5b43('0x4b')));router[_0x5b43('0x6')](_0x5b43('0x4c'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x4d')]);router['get']('/whatsapp/queues/:id',auth[_0x5b43('0x8')](),controller[_0x5b43('0x4e')]);router[_0x5b43('0x3d')]('/agents/:id/notify',auth[_0x5b43('0x8')](),controller['agentNotify']);module[_0x5b43('0x4f')]=router; \ No newline at end of file +var _0xab83=['trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','../../components/auth/service','./rpc.controller','voiceChannels','get','isAuthenticated','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','mailQueues','/openchannel/queues','openchannelQueues','smsQueues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/:id','put','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks'];(function(_0x1a2d9b,_0x440147){var _0x576210=function(_0x1d20da){while(--_0x1d20da){_0x1a2d9b['push'](_0x1a2d9b['shift']());}};_0x576210(++_0x440147);}(_0xab83,0x71));var _0x3ab8=function(_0x3747ae,_0x408e61){_0x3747ae=_0x3747ae-0x0;var _0x339035=_0xab83[_0x3747ae];return _0x339035;};'use strict';var multer=require(_0x3ab8('0x0'));var util=require(_0x3ab8('0x1'));var path=require(_0x3ab8('0x2'));var express=require(_0x3ab8('0x3'));var router=express['Router']();var auth=require(_0x3ab8('0x4'));var controller=require(_0x3ab8('0x5'));router['get']('/voice/channels',auth['isAuthenticated'](),controller[_0x3ab8('0x6')]);router[_0x3ab8('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x3ab8('0x8')](),controller['voiceChannelMixMonitor']);router[_0x3ab8('0x7')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x9')]);router[_0x3ab8('0x7')]('/voice/queues',auth['isAuthenticated'](),controller[_0x3ab8('0xa')]);router[_0x3ab8('0x7')](_0x3ab8('0xb'),auth[_0x3ab8('0x8')](),controller['chatQueues']);router['get']('/mail/queues',auth[_0x3ab8('0x8')](),controller[_0x3ab8('0xc')]);router[_0x3ab8('0x7')]('/mail/accounts',auth[_0x3ab8('0x8')](),controller['mailAccounts']);router[_0x3ab8('0x7')](_0x3ab8('0xd'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0xe')]);router[_0x3ab8('0x7')]('/sms/queues',auth[_0x3ab8('0x8')](),controller[_0x3ab8('0xf')]);router['get']('/whatsapp/queues',auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x10')]);router[_0x3ab8('0x7')](_0x3ab8('0x11'),auth[_0x3ab8('0x8')](),controller['faxQueues']);router[_0x3ab8('0x7')](_0x3ab8('0x12'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x13')]);router[_0x3ab8('0x7')](_0x3ab8('0x14'),auth['isAuthenticated'](),controller[_0x3ab8('0x15')]);router[_0x3ab8('0x7')](_0x3ab8('0x16'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x17')]);router[_0x3ab8('0x7')](_0x3ab8('0x18'),auth['isAuthenticated'](),controller[_0x3ab8('0x19')]);router[_0x3ab8('0x7')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x3ab8('0x8')](),controller['voiceQueuesChannelRedirect']);router['get'](_0x3ab8('0x1a'),auth[_0x3ab8('0x8')](),controller['showVoiceQueues']);router[_0x3ab8('0x1b')]('/voice/queues/:id',auth['isAuthenticated'](),controller['updateVoiceQueue']);router['get'](_0x3ab8('0x1c'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x1d')]);router[_0x3ab8('0x7')](_0x3ab8('0x1e'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x1f')]);router[_0x3ab8('0x7')](_0x3ab8('0x20'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x21')]);router[_0x3ab8('0x1b')](_0x3ab8('0x22'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x23')]);router[_0x3ab8('0x7')](_0x3ab8('0x24'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x25')]);router[_0x3ab8('0x7')](_0x3ab8('0x26'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x27')]);router[_0x3ab8('0x7')](_0x3ab8('0x28'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x29')]);router[_0x3ab8('0x7')](_0x3ab8('0x2a'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0x3ab8('0x7')](_0x3ab8('0x2b'),auth[_0x3ab8('0x8')](),controller['chatQueuesWaitingInteractions']);router['get']('/mail/queues/waitinginteractions',auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x2c')]);router[_0x3ab8('0x7')](_0x3ab8('0x2d'),auth[_0x3ab8('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0x3ab8('0x7')](_0x3ab8('0x2e'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x2f')]);router[_0x3ab8('0x7')](_0x3ab8('0x30'),auth['isAuthenticated'](),controller[_0x3ab8('0x31')]);router[_0x3ab8('0x7')]('/whatsapp/queues/waitinginteractions',auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x32')]);router[_0x3ab8('0x7')]('/fax/queues/waitinginteractions',auth[_0x3ab8('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0x3ab8('0x33')](_0x3ab8('0x34'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x35')](_0x3ab8('0x36')));router['get'](_0x3ab8('0x37'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x38')]);router['post'](_0x3ab8('0x39'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x35')](_0x3ab8('0x3a')));router[_0x3ab8('0x7')](_0x3ab8('0x3b'),auth[_0x3ab8('0x8')](),controller['showChatQueues']);router[_0x3ab8('0x33')](_0x3ab8('0x3c'),auth['isAuthenticated'](),controller[_0x3ab8('0x35')](_0x3ab8('0x3d')));router[_0x3ab8('0x7')](_0x3ab8('0x3e'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x3f')]);router[_0x3ab8('0x33')](_0x3ab8('0x40'),auth['isAuthenticated'](),controller[_0x3ab8('0x35')](_0x3ab8('0x41')));router[_0x3ab8('0x7')](_0x3ab8('0x42'),auth[_0x3ab8('0x8')](),controller['showOpenchannelQueues']);router[_0x3ab8('0x33')]('/sms/queues/:id/notify',auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x35')](_0x3ab8('0x43')));router['post'](_0x3ab8('0x44'),auth['isAuthenticated'](),controller[_0x3ab8('0x35')](_0x3ab8('0x45')));router[_0x3ab8('0x7')](_0x3ab8('0x46'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x47')]);router[_0x3ab8('0x7')](_0x3ab8('0x48'),auth[_0x3ab8('0x8')](),controller['showWhatsappQueues']);router['post'](_0x3ab8('0x49'),auth[_0x3ab8('0x8')](),controller[_0x3ab8('0x4a')]);module[_0x3ab8('0x4b')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 25bbee6..014f2d3 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x1a8613,_0x363f1f){var _0x175671=function(_0x995e5e){while(--_0x995e5e){_0x1a8613['push'](_0x1a8613['shift']());}};_0x175671(++_0x363f1f);}(_0xe706,0xa3));var _0x6e70=function(_0x205328,_0x12c15a){_0x205328=_0x205328-0x0;var _0x4a30eb=_0xe706[_0x205328];return _0x4a30eb;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file +var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x3487a9,_0x3074eb){var _0x3ca6d4=function(_0xaabac){while(--_0xaabac){_0x3487a9['push'](_0x3487a9['shift']());}};_0x3ca6d4(++_0x3074eb);}(_0xe706,0xa3));var _0x6e70=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0xe706[_0x355ce8];return _0x1db8b8;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 283a00b..cf1024b 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 _0x4f9a=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','show','run','create','put','/:id','update','delete','destroy','multer'];(function(_0x404d48,_0x217da3){var _0x36c2cf=function(_0x5b7381){while(--_0x5b7381){_0x404d48['push'](_0x404d48['shift']());}};_0x36c2cf(++_0x217da3);}(_0x4f9a,0x125));var _0xa4f9=function(_0xea82a4,_0x56f3ab){_0xea82a4=_0xea82a4-0x0;var _0x55134f=_0x4f9a[_0xea82a4];return _0x55134f;};'use strict';var multer=require(_0xa4f9('0x0'));var util=require(_0xa4f9('0x1'));var path=require(_0xa4f9('0x2'));var timeout=require(_0xa4f9('0x3'));var express=require('express');var router=express[_0xa4f9('0x4')]();var fs_extra=require(_0xa4f9('0x5'));var auth=require(_0xa4f9('0x6'));var interaction=require(_0xa4f9('0x7'));var config=require(_0xa4f9('0x8'));var controller=require(_0xa4f9('0x9'));router[_0xa4f9('0xa')]('/',auth[_0xa4f9('0xb')](),controller[_0xa4f9('0xc')]);router[_0xa4f9('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xa4f9('0xd')]);router[_0xa4f9('0xa')]('/:id/run',auth['isAuthenticated'](),controller[_0xa4f9('0xe')]);router['post']('/',auth[_0xa4f9('0xb')](),controller[_0xa4f9('0xf')]);router[_0xa4f9('0x10')](_0xa4f9('0x11'),auth[_0xa4f9('0xb')](),controller[_0xa4f9('0x12')]);router[_0xa4f9('0x13')](_0xa4f9('0x11'),auth[_0xa4f9('0xb')](),controller[_0xa4f9('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd721=['delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','put','update'];(function(_0x5f56bb,_0x1c65ec){var _0x3a44e5=function(_0x460d5c){while(--_0x460d5c){_0x5f56bb['push'](_0x5f56bb['shift']());}};_0x3a44e5(++_0x1c65ec);}(_0xd721,0x75));var _0x1d72=function(_0x461dc0,_0x279393){_0x461dc0=_0x461dc0-0x0;var _0x2dc250=_0xd721[_0x461dc0];return _0x2dc250;};'use strict';var multer=require(_0x1d72('0x0'));var util=require(_0x1d72('0x1'));var path=require(_0x1d72('0x2'));var timeout=require(_0x1d72('0x3'));var express=require('express');var router=express[_0x1d72('0x4')]();var fs_extra=require(_0x1d72('0x5'));var auth=require(_0x1d72('0x6'));var interaction=require(_0x1d72('0x7'));var config=require(_0x1d72('0x8'));var controller=require(_0x1d72('0x9'));router[_0x1d72('0xa')]('/',auth[_0x1d72('0xb')](),controller[_0x1d72('0xc')]);router[_0x1d72('0xa')](_0x1d72('0xd'),auth[_0x1d72('0xb')](),controller[_0x1d72('0xe')]);router['get'](_0x1d72('0xf'),auth[_0x1d72('0xb')](),controller[_0x1d72('0x10')]);router[_0x1d72('0x11')]('/',auth['isAuthenticated'](),controller[_0x1d72('0x12')]);router[_0x1d72('0x13')](_0x1d72('0xd'),auth[_0x1d72('0xb')](),controller[_0x1d72('0x14')]);router[_0x1d72('0x15')](_0x1d72('0xd'),auth['isAuthenticated'](),controller[_0x1d72('0x16')]);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 652db5e..2a258cd 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 _0x9a89=['weeks','days','minutes','ENUM','pdf','xlsx','csv','custom','default','TEXT','STRING','BOOLEAN','DATE','INTEGER','years','quarters'];(function(_0x486e8b,_0x4d3b79){var _0x3b76a9=function(_0x41b7ef){while(--_0x41b7ef){_0x486e8b['push'](_0x486e8b['shift']());}};_0x3b76a9(++_0x4d3b79);}(_0x9a89,0xda));var _0x99a8=function(_0x1a81b4,_0xe6ee3e){_0x1a81b4=_0x1a81b4-0x0;var _0xfcc341=_0x9a89[_0x1a81b4];return _0xfcc341;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x99a8('0x0')]},'active':{'type':Sequelize[_0x99a8('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x99a8('0x0')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x99a8('0x2')],'allowNull':![]},'endAt':{'type':Sequelize[_0x99a8('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x99a8('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x99a8('0x4'),_0x99a8('0x5'),'months',_0x99a8('0x6'),_0x99a8('0x7'),'hours',_0x99a8('0x8')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x99a8('0x9')]('csv',_0x99a8('0xa'),_0x99a8('0xb')),'allowNull':![],'defaultValue':_0x99a8('0xc')},'type':{'type':Sequelize[_0x99a8('0x9')](_0x99a8('0xd'),_0x99a8('0xe')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x99a8('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x99a8('0x0')]},'cc':{'type':Sequelize[_0x99a8('0xf')]},'bcc':{'type':Sequelize[_0x99a8('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x99a8('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa280=['hours','ENUM','pdf','xlsx','csv','custom','default','TEXT','BOOLEAN','sequelize','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','months','weeks','days'];(function(_0x4d30ad,_0x207204){var _0x52e687=function(_0x2c409f){while(--_0x2c409f){_0x4d30ad['push'](_0x4d30ad['shift']());}};_0x52e687(++_0x207204);}(_0xa280,0x195));var _0x0a28=function(_0x5abb9c,_0x32f2eb){_0x5abb9c=_0x5abb9c-0x0;var _0x33916e=_0xa280[_0x5abb9c];return _0x33916e;};'use strict';var Sequelize=require(_0x0a28('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0a28('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x0a28('0x1')],'allowNull':![],'defaultValue':_0x0a28('0x2')},'startAt':{'type':Sequelize[_0x0a28('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x0a28('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x0a28('0x5'),'quarters',_0x0a28('0x6'),_0x0a28('0x7'),_0x0a28('0x8'),_0x0a28('0x9'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x0a28('0xa')]('csv',_0x0a28('0xb'),_0x0a28('0xc')),'allowNull':![],'defaultValue':_0x0a28('0xd')},'type':{'type':Sequelize[_0x0a28('0xa')](_0x0a28('0xe'),_0x0a28('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x0a28('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x0a28('0x11')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 8a39117..3cdc3ff 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 _0x958b=['keys','filters','intersection','attributes','fields','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','index','Schedule','rawAttributes','fieldName','type','key','model','query'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0x958b,0x11b));var _0xb958=function(_0x8dee8d,_0x2a17fb){_0x8dee8d=_0x8dee8d-0x0;var _0x40d498=_0x958b[_0x8dee8d];return _0x40d498;};'use strict';var emlformat=require(_0xb958('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb958('0x1'));var rp=require(_0xb958('0x2'));var moment=require(_0xb958('0x3'));var BPromise=require(_0xb958('0x4'));var Mustache=require(_0xb958('0x5'));var util=require(_0xb958('0x6'));var path=require(_0xb958('0x7'));var sox=require(_0xb958('0x8'));var csv=require(_0xb958('0x9'));var ejs=require(_0xb958('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb958('0xb'));var squel=require(_0xb958('0xc'));var crypto=require('crypto');var jsforce=require(_0xb958('0xd'));var deskjs=require(_0xb958('0xe'));var toCsv=require(_0xb958('0x9'));var querystring=require(_0xb958('0xf'));var Papa=require(_0xb958('0x10'));var Redis=require(_0xb958('0x11'));var authService=require(_0xb958('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb958('0x13'));var hardwareService=require(_0xb958('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb958('0x15'));var config=require(_0xb958('0x16'));var licenseUtil=require(_0xb958('0x17'));var db=require(_0xb958('0x18'))['db'];function respondWithStatusCode(_0x2bfee2,_0x4597c5){_0x4597c5=_0x4597c5||0xcc;return function(_0x3f0486){if(_0x3f0486){return _0x2bfee2['sendStatus'](_0x4597c5);}return _0x2bfee2[_0xb958('0x19')](_0x4597c5)[_0xb958('0x1a')]();};}function respondWithResult(_0x58e337,_0x56db3f){_0x56db3f=_0x56db3f||0xc8;return function(_0x27909e){if(_0x27909e){return _0x58e337[_0xb958('0x19')](_0x56db3f)[_0xb958('0x1b')](_0x27909e);}};}function respondWithFilteredResult(_0x4d39ce,_0x2bfe25){return function(_0x2498a9){if(_0x2498a9){var _0x58c248=typeof _0x2bfe25[_0xb958('0x1c')]===_0xb958('0x1d')&&typeof _0x2bfe25[_0xb958('0x1e')]===_0xb958('0x1d');var _0x42a69a=_0x2498a9[_0xb958('0x1f')];var _0x176b51=_0x58c248?0x0:_0x2bfe25[_0xb958('0x1c')];var _0xff51e4=_0x58c248?_0x2498a9[_0xb958('0x1f')]:_0x2bfe25['offset']+_0x2bfe25['limit'];var _0x5e5375;if(_0xff51e4>=_0x42a69a){_0xff51e4=_0x42a69a;_0x5e5375=0xc8;}else{_0x5e5375=0xce;}_0x4d39ce['status'](_0x5e5375);return _0x4d39ce['set'](_0xb958('0x20'),_0x176b51+'-'+_0xff51e4+'/'+_0x42a69a)['json'](_0x2498a9);}return null;};}function patchUpdates(_0x451f6d){return function(_0x5dd3a9){try{jsonpatch['apply'](_0x5dd3a9,_0x451f6d,!![]);}catch(_0x460f73){return BPromise[_0xb958('0x21')](_0x460f73);}return _0x5dd3a9['save']();};}function saveUpdates(_0x18432f,_0x59578f){return function(_0x478c4b){if(_0x478c4b){return _0x478c4b['update'](_0x18432f)[_0xb958('0x22')](function(_0x29d399){return _0x29d399;});}return null;};}function removeEntity(_0x1c32cb,_0x445582){return function(_0x4396dd){if(_0x4396dd){return _0x4396dd[_0xb958('0x23')]()[_0xb958('0x22')](function(){var _0x4997e1=_0x4396dd['get']({'plain':!![]});var _0xa7852c='Scheduler';return db['UserProfileResource'][_0xb958('0x23')]({'where':{'type':_0xa7852c,'resourceId':_0x4997e1['id']}})['then'](function(){return _0x4396dd;});})[_0xb958('0x22')](function(){_0x1c32cb[_0xb958('0x19')](0xcc)[_0xb958('0x1a')]();});}};}function handleEntityNotFound(_0x39a6e8,_0x569579){return function(_0x1c393e){if(!_0x1c393e){_0x39a6e8[_0xb958('0x24')](0x194);}return _0x1c393e;};}function handleError(_0xa86662,_0x45d86b){_0x45d86b=_0x45d86b||0x1f4;return function(_0x14d7b7){logger[_0xb958('0x25')](_0x14d7b7[_0xb958('0x26')]);if(_0x14d7b7[_0xb958('0x27')]){delete _0x14d7b7[_0xb958('0x27')];}_0xa86662['status'](_0x45d86b)[_0xb958('0x28')](_0x14d7b7);};}exports[_0xb958('0x29')]=function(_0x2d6244,_0x5ef0e8){var _0x5899d1={},_0x325d31={},_0x544d6e={'count':0x0,'rows':[]};var _0x17f859=_['map'](db[_0xb958('0x2a')][_0xb958('0x2b')],function(_0x1ffaf2){return{'name':_0x1ffaf2[_0xb958('0x2c')],'type':_0x1ffaf2[_0xb958('0x2d')][_0xb958('0x2e')]};});_0x325d31[_0xb958('0x2f')]=_['map'](_0x17f859,_0xb958('0x27'));_0x325d31[_0xb958('0x30')]=_[_0xb958('0x31')](_0x2d6244[_0xb958('0x30')]);_0x325d31[_0xb958('0x32')]=_[_0xb958('0x33')](_0x325d31[_0xb958('0x2f')],_0x325d31['query']);_0x5899d1[_0xb958('0x34')]=_[_0xb958('0x33')](_0x325d31[_0xb958('0x2f')],qs[_0xb958('0x35')](_0x2d6244[_0xb958('0x30')]['fields']));_0x5899d1['attributes']=_0x5899d1[_0xb958('0x34')]['length']?_0x5899d1[_0xb958('0x34')]:_0x325d31[_0xb958('0x2f')];if(!_0x2d6244[_0xb958('0x30')]['hasOwnProperty']('nolimit')){_0x5899d1['limit']=qs['limit'](_0x2d6244[_0xb958('0x30')][_0xb958('0x1e')]);_0x5899d1['offset']=qs[_0xb958('0x1c')](_0x2d6244[_0xb958('0x30')]['offset']);}_0x5899d1['order']=qs[_0xb958('0x36')](_0x2d6244[_0xb958('0x30')]['sort']);_0x5899d1['where']=qs[_0xb958('0x32')](_[_0xb958('0x37')](_0x2d6244[_0xb958('0x30')],_0x325d31[_0xb958('0x32')]),_0x17f859);if(_0x2d6244[_0xb958('0x30')]['filter']){_0x5899d1[_0xb958('0x38')]=_[_0xb958('0x39')](_0x5899d1['where'],{'$or':_[_0xb958('0x3a')](_0x17f859,function(_0xe8777a){if(_0xe8777a[_0xb958('0x2d')]!==_0xb958('0x3b')){var _0x228081={};_0x228081[_0xe8777a[_0xb958('0x27')]]={'$like':'%'+_0x2d6244[_0xb958('0x30')][_0xb958('0x3c')]+'%'};return _0x228081;}})});}_0x5899d1=_[_0xb958('0x39')]({},_0x5899d1,_0x2d6244[_0xb958('0x3d')]);var _0x69bcb0={'where':_0x5899d1['where']};return db[_0xb958('0x2a')]['count'](_0x69bcb0)[_0xb958('0x22')](function(_0x1d6ab2){_0x544d6e[_0xb958('0x1f')]=_0x1d6ab2;if(_0x2d6244[_0xb958('0x30')][_0xb958('0x3e')]){_0x5899d1['include']=[{'all':!![]}];}return db['Schedule'][_0xb958('0x3f')](_0x5899d1);})['then'](function(_0x5cea34){_0x544d6e[_0xb958('0x40')]=_0x5cea34;return _0x544d6e;})[_0xb958('0x22')](respondWithFilteredResult(_0x5ef0e8,_0x5899d1))[_0xb958('0x41')](handleError(_0x5ef0e8,null));};exports[_0xb958('0x42')]=function(_0x39af28,_0x38b0b7){var _0x43986f={'raw':![],'where':{'id':_0x39af28[_0xb958('0x43')]['id']}},_0x5dfa79={};_0x5dfa79[_0xb958('0x2f')]=_[_0xb958('0x31')](db['Schedule'][_0xb958('0x2b')]);_0x5dfa79['query']=_[_0xb958('0x31')](_0x39af28[_0xb958('0x30')]);_0x5dfa79[_0xb958('0x32')]=_[_0xb958('0x33')](_0x5dfa79[_0xb958('0x2f')],_0x5dfa79[_0xb958('0x30')]);_0x43986f[_0xb958('0x34')]=_[_0xb958('0x33')](_0x5dfa79[_0xb958('0x2f')],qs[_0xb958('0x35')](_0x39af28[_0xb958('0x30')]['fields']));_0x43986f[_0xb958('0x34')]=_0x43986f[_0xb958('0x34')][_0xb958('0x44')]?_0x43986f['attributes']:_0x5dfa79['model'];if(_0x39af28[_0xb958('0x30')][_0xb958('0x3e')]){_0x43986f[_0xb958('0x45')]=[{'all':!![]}];}_0x43986f=_[_0xb958('0x39')]({},_0x43986f,_0x39af28['options']);return db['Schedule']['find'](_0x43986f)[_0xb958('0x22')](handleEntityNotFound(_0x38b0b7,null))['then'](respondWithResult(_0x38b0b7,null))[_0xb958('0x41')](handleError(_0x38b0b7,null));};exports['create']=function(_0xd83bae,_0x18060f){return db[_0xb958('0x2a')][_0xb958('0x46')](_0xd83bae[_0xb958('0x47')],{})[_0xb958('0x22')](function(_0x216a45){var _0x2e0858=_0xd83bae[_0xb958('0x48')]['get']({'plain':!![]});if(!_0x2e0858)throw new Error(_0xb958('0x49'));if(_0x2e0858[_0xb958('0x4a')]===_0xb958('0x48')){var _0x2f9996=_0x216a45[_0xb958('0x4b')]({'plain':!![]});var _0x46cbe6='Scheduler';return db['UserProfileSection'][_0xb958('0x4c')]({'where':{'name':_0x46cbe6,'userProfileId':_0x2e0858[_0xb958('0x4d')]},'raw':!![]})[_0xb958('0x22')](function(_0x192376){if(_0x192376&&_0x192376[_0xb958('0x4e')]===0x0){return db['UserProfileResource'][_0xb958('0x46')]({'name':_0x2f9996[_0xb958('0x27')],'resourceId':_0x2f9996['id'],'type':_0x192376[_0xb958('0x27')],'sectionId':_0x192376['id']},{})[_0xb958('0x22')](function(){return _0x216a45;});}else{return _0x216a45;}})['catch'](function(_0x4b07de){logger[_0xb958('0x25')](_0xb958('0x4f'),_0x4b07de);throw _0x4b07de;});}return _0x216a45;})['then'](respondWithResult(_0x18060f,0xc9))['catch'](handleError(_0x18060f,null));};exports[_0xb958('0x50')]=function(_0x116c20,_0x919540){if(_0x116c20[_0xb958('0x47')]['id']){delete _0x116c20[_0xb958('0x47')]['id'];}return db['Schedule'][_0xb958('0x4c')]({'where':{'id':_0x116c20[_0xb958('0x43')]['id']}})[_0xb958('0x22')](handleEntityNotFound(_0x919540,null))[_0xb958('0x22')](saveUpdates(_0x116c20[_0xb958('0x47')],null))[_0xb958('0x22')](respondWithResult(_0x919540,null))['catch'](handleError(_0x919540,null));};exports[_0xb958('0x23')]=function(_0x34f597,_0x21acc1){return db[_0xb958('0x2a')]['find']({'where':{'id':_0x34f597[_0xb958('0x43')]['id']}})[_0xb958('0x22')](handleEntityNotFound(_0x21acc1,null))[_0xb958('0x22')](removeEntity(_0x21acc1,null))['catch'](handleError(_0x21acc1,null));};exports[_0xb958('0x51')]=function(_0x366bae,_0x48ea30,_0x592b27){var _0x9844b6=require(_0xb958('0x52'));return db['Schedule'][_0xb958('0x4c')]({'where':{'id':_0x366bae['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x48ea30,null))['then'](function(){_0x9844b6[_0xb958('0x51')](_0x366bae[_0xb958('0x43')]['id']);})[_0xb958('0x22')](respondWithStatusCode(_0x48ea30,null))[_0xb958('0x41')](handleError(_0x48ea30,null));}; \ No newline at end of file +var _0x8942=['userProfileId','autoAssociation','create','destroy','run','../../config/schedule','zip-dir','request-promise','moment','bluebird','mustache','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Scheduler','UserProfileResource','error','name','send','Schedule','fieldName','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','keys','length','merge','find','body','user','UserProfileSection'];(function(_0x410c62,_0x5bd8ca){var _0x5a210a=function(_0x2d8136){while(--_0x2d8136){_0x410c62['push'](_0x410c62['shift']());}};_0x5a210a(++_0x5bd8ca);}(_0x8942,0x136));var _0x2894=function(_0x87a706,_0x116dd0){_0x87a706=_0x87a706-0x0;var _0x52a464=_0x8942[_0x87a706];return _0x52a464;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2894('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2894('0x1'));var moment=require(_0x2894('0x2'));var BPromise=require(_0x2894('0x3'));var Mustache=require(_0x2894('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2894('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2894('0x6'));var squel=require(_0x2894('0x7'));var crypto=require(_0x2894('0x8'));var jsforce=require(_0x2894('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x2894('0x5'));var querystring=require('querystring');var Papa=require(_0x2894('0xa'));var Redis=require(_0x2894('0xb'));var authService=require(_0x2894('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x2894('0xd'));var hardwareService=require(_0x2894('0xe'));var logger=require(_0x2894('0xf'))(_0x2894('0x10'));var utils=require(_0x2894('0x11'));var config=require(_0x2894('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x2894('0x13'))['db'];function respondWithStatusCode(_0x54dcd2,_0x17fff5){_0x17fff5=_0x17fff5||0xcc;return function(_0x43a09f){if(_0x43a09f){return _0x54dcd2[_0x2894('0x14')](_0x17fff5);}return _0x54dcd2[_0x2894('0x15')](_0x17fff5)[_0x2894('0x16')]();};}function respondWithResult(_0x502a9b,_0x18a9da){_0x18a9da=_0x18a9da||0xc8;return function(_0x5462e1){if(_0x5462e1){return _0x502a9b[_0x2894('0x15')](_0x18a9da)[_0x2894('0x17')](_0x5462e1);}};}function respondWithFilteredResult(_0xc887b2,_0x4ba404){return function(_0x2fa646){if(_0x2fa646){var _0xf6d5bc=typeof _0x4ba404[_0x2894('0x18')]===_0x2894('0x19')&&typeof _0x4ba404[_0x2894('0x1a')]===_0x2894('0x19');var _0x2d4d8d=_0x2fa646[_0x2894('0x1b')];var _0x29f829=_0xf6d5bc?0x0:_0x4ba404['offset'];var _0x2e068d=_0xf6d5bc?_0x2fa646['count']:_0x4ba404[_0x2894('0x18')]+_0x4ba404['limit'];var _0x13155c;if(_0x2e068d>=_0x2d4d8d){_0x2e068d=_0x2d4d8d;_0x13155c=0xc8;}else{_0x13155c=0xce;}_0xc887b2['status'](_0x13155c);return _0xc887b2[_0x2894('0x1c')](_0x2894('0x1d'),_0x29f829+'-'+_0x2e068d+'/'+_0x2d4d8d)[_0x2894('0x17')](_0x2fa646);}return null;};}function patchUpdates(_0x39a207){return function(_0x3ef922){try{jsonpatch[_0x2894('0x1e')](_0x3ef922,_0x39a207,!![]);}catch(_0x3a9620){return BPromise[_0x2894('0x1f')](_0x3a9620);}return _0x3ef922[_0x2894('0x20')]();};}function saveUpdates(_0x38b9ab,_0x5d9560){return function(_0x3c01b3){if(_0x3c01b3){return _0x3c01b3[_0x2894('0x21')](_0x38b9ab)[_0x2894('0x22')](function(_0x199a0f){return _0x199a0f;});}return null;};}function removeEntity(_0xd6346e,_0x177be7){return function(_0x234085){if(_0x234085){return _0x234085['destroy']()[_0x2894('0x22')](function(){var _0x5b5a16=_0x234085[_0x2894('0x23')]({'plain':!![]});var _0x1c1efe=_0x2894('0x24');return db[_0x2894('0x25')]['destroy']({'where':{'type':_0x1c1efe,'resourceId':_0x5b5a16['id']}})[_0x2894('0x22')](function(){return _0x234085;});})[_0x2894('0x22')](function(){_0xd6346e['status'](0xcc)[_0x2894('0x16')]();});}};}function handleEntityNotFound(_0x42f8fa,_0xf9f691){return function(_0x3d0536){if(!_0x3d0536){_0x42f8fa[_0x2894('0x14')](0x194);}return _0x3d0536;};}function handleError(_0x5efdae,_0x46ef48){_0x46ef48=_0x46ef48||0x1f4;return function(_0x3760ea){logger[_0x2894('0x26')](_0x3760ea['stack']);if(_0x3760ea[_0x2894('0x27')]){delete _0x3760ea[_0x2894('0x27')];}_0x5efdae[_0x2894('0x15')](_0x46ef48)[_0x2894('0x28')](_0x3760ea);};}exports['index']=function(_0xb1ea1a,_0x39146c){var _0x5bacf8={},_0x6cf43c={},_0x4c2ae1={'count':0x0,'rows':[]};var _0x5d73cf=_['map'](db[_0x2894('0x29')]['rawAttributes'],function(_0x4835e6){return{'name':_0x4835e6[_0x2894('0x2a')],'type':_0x4835e6['type']['key']};});_0x6cf43c[_0x2894('0x2b')]=_[_0x2894('0x2c')](_0x5d73cf,_0x2894('0x27'));_0x6cf43c[_0x2894('0x2d')]=_['keys'](_0xb1ea1a[_0x2894('0x2d')]);_0x6cf43c[_0x2894('0x2e')]=_['intersection'](_0x6cf43c['model'],_0x6cf43c[_0x2894('0x2d')]);_0x5bacf8[_0x2894('0x2f')]=_[_0x2894('0x30')](_0x6cf43c['model'],qs[_0x2894('0x31')](_0xb1ea1a[_0x2894('0x2d')][_0x2894('0x31')]));_0x5bacf8[_0x2894('0x2f')]=_0x5bacf8['attributes']['length']?_0x5bacf8[_0x2894('0x2f')]:_0x6cf43c[_0x2894('0x2b')];if(!_0xb1ea1a[_0x2894('0x2d')][_0x2894('0x32')]('nolimit')){_0x5bacf8[_0x2894('0x1a')]=qs[_0x2894('0x1a')](_0xb1ea1a['query'][_0x2894('0x1a')]);_0x5bacf8['offset']=qs['offset'](_0xb1ea1a[_0x2894('0x2d')]['offset']);}_0x5bacf8['order']=qs['sort'](_0xb1ea1a['query'][_0x2894('0x33')]);_0x5bacf8[_0x2894('0x34')]=qs[_0x2894('0x2e')](_[_0x2894('0x35')](_0xb1ea1a['query'],_0x6cf43c[_0x2894('0x2e')]),_0x5d73cf);if(_0xb1ea1a[_0x2894('0x2d')][_0x2894('0x36')]){_0x5bacf8[_0x2894('0x34')]=_['merge'](_0x5bacf8[_0x2894('0x34')],{'$or':_[_0x2894('0x2c')](_0x5d73cf,function(_0x5c8abf){if(_0x5c8abf[_0x2894('0x37')]!==_0x2894('0x38')){var _0x4ca8f0={};_0x4ca8f0[_0x5c8abf[_0x2894('0x27')]]={'$like':'%'+_0xb1ea1a[_0x2894('0x2d')][_0x2894('0x36')]+'%'};return _0x4ca8f0;}})});}_0x5bacf8=_['merge']({},_0x5bacf8,_0xb1ea1a['options']);var _0x5eb36f={'where':_0x5bacf8[_0x2894('0x34')]};return db[_0x2894('0x29')]['count'](_0x5eb36f)[_0x2894('0x22')](function(_0x20ec83){_0x4c2ae1[_0x2894('0x1b')]=_0x20ec83;if(_0xb1ea1a[_0x2894('0x2d')][_0x2894('0x39')]){_0x5bacf8[_0x2894('0x3a')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x5bacf8);})[_0x2894('0x22')](function(_0x42cbf5){_0x4c2ae1['rows']=_0x42cbf5;return _0x4c2ae1;})[_0x2894('0x22')](respondWithFilteredResult(_0x39146c,_0x5bacf8))[_0x2894('0x3b')](handleError(_0x39146c,null));};exports[_0x2894('0x3c')]=function(_0x1e6f7c,_0x3b39b7){var _0x57f746={'raw':![],'where':{'id':_0x1e6f7c[_0x2894('0x3d')]['id']}},_0x964f9={};_0x964f9[_0x2894('0x2b')]=_['keys'](db[_0x2894('0x29')][_0x2894('0x3e')]);_0x964f9[_0x2894('0x2d')]=_[_0x2894('0x3f')](_0x1e6f7c[_0x2894('0x2d')]);_0x964f9['filters']=_[_0x2894('0x30')](_0x964f9[_0x2894('0x2b')],_0x964f9[_0x2894('0x2d')]);_0x57f746[_0x2894('0x2f')]=_[_0x2894('0x30')](_0x964f9[_0x2894('0x2b')],qs[_0x2894('0x31')](_0x1e6f7c[_0x2894('0x2d')][_0x2894('0x31')]));_0x57f746[_0x2894('0x2f')]=_0x57f746['attributes'][_0x2894('0x40')]?_0x57f746['attributes']:_0x964f9['model'];if(_0x1e6f7c[_0x2894('0x2d')]['includeAll']){_0x57f746[_0x2894('0x3a')]=[{'all':!![]}];}_0x57f746=_[_0x2894('0x41')]({},_0x57f746,_0x1e6f7c['options']);return db[_0x2894('0x29')][_0x2894('0x42')](_0x57f746)['then'](handleEntityNotFound(_0x3b39b7,null))[_0x2894('0x22')](respondWithResult(_0x3b39b7,null))[_0x2894('0x3b')](handleError(_0x3b39b7,null));};exports['create']=function(_0x33ebda,_0x15c4b4){return db['Schedule']['create'](_0x33ebda[_0x2894('0x43')],{})[_0x2894('0x22')](function(_0x1537ba){var _0x4b864d=_0x33ebda[_0x2894('0x44')][_0x2894('0x23')]({'plain':!![]});if(!_0x4b864d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b864d['role']==='user'){var _0x582839=_0x1537ba[_0x2894('0x23')]({'plain':!![]});var _0x4363b1=_0x2894('0x24');return db[_0x2894('0x45')][_0x2894('0x42')]({'where':{'name':_0x4363b1,'userProfileId':_0x4b864d[_0x2894('0x46')]},'raw':!![]})[_0x2894('0x22')](function(_0x592073){if(_0x592073&&_0x592073[_0x2894('0x47')]===0x0){return db[_0x2894('0x25')][_0x2894('0x48')]({'name':_0x582839[_0x2894('0x27')],'resourceId':_0x582839['id'],'type':_0x592073[_0x2894('0x27')],'sectionId':_0x592073['id']},{})[_0x2894('0x22')](function(){return _0x1537ba;});}else{return _0x1537ba;}})['catch'](function(_0x38f57a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38f57a);throw _0x38f57a;});}return _0x1537ba;})[_0x2894('0x22')](respondWithResult(_0x15c4b4,0xc9))[_0x2894('0x3b')](handleError(_0x15c4b4,null));};exports[_0x2894('0x21')]=function(_0x3bd834,_0x43c21b){if(_0x3bd834[_0x2894('0x43')]['id']){delete _0x3bd834[_0x2894('0x43')]['id'];}return db[_0x2894('0x29')]['find']({'where':{'id':_0x3bd834[_0x2894('0x3d')]['id']}})[_0x2894('0x22')](handleEntityNotFound(_0x43c21b,null))[_0x2894('0x22')](saveUpdates(_0x3bd834['body'],null))[_0x2894('0x22')](respondWithResult(_0x43c21b,null))['catch'](handleError(_0x43c21b,null));};exports[_0x2894('0x49')]=function(_0xefea7c,_0x115e88){return db['Schedule']['find']({'where':{'id':_0xefea7c[_0x2894('0x3d')]['id']}})[_0x2894('0x22')](handleEntityNotFound(_0x115e88,null))[_0x2894('0x22')](removeEntity(_0x115e88,null))[_0x2894('0x3b')](handleError(_0x115e88,null));};exports[_0x2894('0x4a')]=function(_0x50ed79,_0x129c07,_0x42a20e){var _0x27b896=require(_0x2894('0x4b'));return db[_0x2894('0x29')][_0x2894('0x42')]({'where':{'id':_0x50ed79[_0x2894('0x3d')]['id']},'raw':!![]})[_0x2894('0x22')](handleEntityNotFound(_0x129c07,null))['then'](function(){_0x27b896[_0x2894('0x4a')](_0x50ed79[_0x2894('0x3d')]['id']);})[_0x2894('0x22')](respondWithStatusCode(_0x129c07,null))[_0x2894('0x3b')](handleError(_0x129c07,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index c0c490f..db06ad6 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 _0x544c=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Schedule','tools_schedules','util','../../config/logger'];(function(_0x3cd4f8,_0x116c1a){var _0x487b82=function(_0x3e42a8){while(--_0x3e42a8){_0x3cd4f8['push'](_0x3cd4f8['shift']());}};_0x487b82(++_0x116c1a);}(_0x544c,0x106));var _0xc544=function(_0x5b7606,_0x3367ef){_0x5b7606=_0x5b7606-0x0;var _0x186584=_0x544c[_0x5b7606];return _0x186584;};'use strict';var _=require('lodash');var util=require(_0xc544('0x0'));var logger=require(_0xc544('0x1'))(_0xc544('0x2'));var moment=require(_0xc544('0x3'));var BPromise=require(_0xc544('0x4'));var rp=require(_0xc544('0x5'));var fs=require('fs');var path=require(_0xc544('0x6'));var rimraf=require('rimraf');var config=require(_0xc544('0x7'));var attributes=require('./schedule.attributes');module[_0xc544('0x8')]=function(_0x30d5d3,_0x17a2ed){return _0x30d5d3[_0xc544('0x9')](_0xc544('0xa'),attributes,{'tableName':_0xc544('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa173=['bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules','lodash','util','../../config/logger','api'];(function(_0x2b7604,_0x52042a){var _0x3f8da1=function(_0x1b20b7){while(--_0x1b20b7){_0x2b7604['push'](_0x2b7604['shift']());}};_0x3f8da1(++_0x52042a);}(_0xa173,0x18f));var _0x3a17=function(_0x4ca8b2,_0x1f9c80){_0x4ca8b2=_0x4ca8b2-0x0;var _0x20a7be=_0xa173[_0x4ca8b2];return _0x20a7be;};'use strict';var _=require(_0x3a17('0x0'));var util=require(_0x3a17('0x1'));var logger=require(_0x3a17('0x2'))(_0x3a17('0x3'));var moment=require('moment');var BPromise=require(_0x3a17('0x4'));var rp=require(_0x3a17('0x5'));var fs=require('fs');var path=require(_0x3a17('0x6'));var rimraf=require(_0x3a17('0x7'));var config=require(_0x3a17('0x8'));var attributes=require(_0x3a17('0x9'));module['exports']=function(_0x2ba7af,_0xfc43c4){return _0x2ba7af[_0x3a17('0xa')](_0x3a17('0xb'),attributes,{'tableName':_0x3a17('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 f5d2def..1373f9f 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 _0x76f7=['Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','Schedule,\x20%s,\x20%s','debug'];(function(_0x18de2e,_0x412972){var _0x197a79=function(_0x3cc580){while(--_0x3cc580){_0x18de2e['push'](_0x18de2e['shift']());}};_0x197a79(++_0x412972);}(_0x76f7,0x1e7));var _0x776f=function(_0x290c3b,_0x13cb2a){_0x290c3b=_0x290c3b-0x0;var _0x235c79=_0x76f7[_0x290c3b];return _0x235c79;};'use strict';var _=require(_0x776f('0x0'));var util=require(_0x776f('0x1'));var moment=require(_0x776f('0x2'));var BPromise=require('bluebird');var rs=require(_0x776f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x776f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x776f('0x5'))('rpc');var config=require(_0x776f('0x6'));var jayson=require(_0x776f('0x7'));var client=jayson[_0x776f('0x8')][_0x776f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x430e79,_0x533b60,_0x394ca2){return new BPromise(function(_0x52c8e2,_0x49b90a){return client['request'](_0x430e79,_0x394ca2)[_0x776f('0xa')](function(_0x174faf){logger['info'](_0x776f('0xb'),_0x533b60,'request\x20sent');logger[_0x776f('0xc')](_0x776f('0xd'),_0x533b60,_0x776f('0xe'),JSON[_0x776f('0xf')](_0x174faf));if(_0x174faf[_0x776f('0x10')]){if(_0x174faf['error'][_0x776f('0x11')]===0x1f4){logger[_0x776f('0x10')](_0x776f('0xb'),_0x533b60,_0x174faf['error'][_0x776f('0x12')]);return _0x49b90a(_0x174faf[_0x776f('0x10')][_0x776f('0x12')]);}logger[_0x776f('0x10')](_0x776f('0xb'),_0x533b60,_0x174faf[_0x776f('0x10')][_0x776f('0x12')]);return _0x52c8e2(_0x174faf[_0x776f('0x10')][_0x776f('0x12')]);}else{logger['info'](_0x776f('0xb'),_0x533b60,'request\x20sent');_0x52c8e2(_0x174faf['result']['message']);}})[_0x776f('0x13')](function(_0x4a727e){logger[_0x776f('0x10')](_0x776f('0xb'),_0x533b60,_0x4a727e);_0x49b90a(_0x4a727e);});});} \ No newline at end of file +var _0x837b=['debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x5a187b,_0x1f64fe){var _0x14d601=function(_0x45fd29){while(--_0x45fd29){_0x5a187b['push'](_0x5a187b['shift']());}};_0x14d601(++_0x1f64fe);}(_0x837b,0x120));var _0xb837=function(_0xe6aba1,_0x4ff2b4){_0xe6aba1=_0xe6aba1-0x0;var _0x56482c=_0x837b[_0xe6aba1];return _0x56482c;};'use strict';var _=require(_0xb837('0x0'));var util=require(_0xb837('0x1'));var moment=require(_0xb837('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb837('0x3'));var logger=require(_0xb837('0x4'))(_0xb837('0x5'));var config=require(_0xb837('0x6'));var jayson=require(_0xb837('0x7'));var client=jayson[_0xb837('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1da18d,_0x4d0c5d,_0x47aa9d){return new BPromise(function(_0x5b152f,_0x2357cd){return client['request'](_0x1da18d,_0x47aa9d)[_0xb837('0x9')](function(_0x5706c2){logger['info'](_0xb837('0xa'),_0x4d0c5d,_0xb837('0xb'));logger[_0xb837('0xc')](_0xb837('0xd'),_0x4d0c5d,'request\x20sent',JSON[_0xb837('0xe')](_0x5706c2));if(_0x5706c2['error']){if(_0x5706c2[_0xb837('0xf')]['code']===0x1f4){logger[_0xb837('0xf')]('Schedule,\x20%s,\x20%s',_0x4d0c5d,_0x5706c2[_0xb837('0xf')][_0xb837('0x10')]);return _0x2357cd(_0x5706c2[_0xb837('0xf')][_0xb837('0x10')]);}logger[_0xb837('0xf')](_0xb837('0xa'),_0x4d0c5d,_0x5706c2[_0xb837('0xf')][_0xb837('0x10')]);return _0x5b152f(_0x5706c2[_0xb837('0xf')][_0xb837('0x10')]);}else{logger[_0xb837('0x11')]('Schedule,\x20%s,\x20%s',_0x4d0c5d,_0xb837('0xb'));_0x5b152f(_0x5706c2[_0xb837('0x12')][_0xb837('0x10')]);}})[_0xb837('0x13')](function(_0x55cb41){logger[_0xb837('0xf')]('Schedule,\x20%s,\x20%s',_0x4d0c5d,_0x55cb41);_0x2357cd(_0x55cb41);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 514973a..1c30fba 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 _0xb1e8=['get','/describe','isAuthenticated','describe','show','/:id/download','download','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','index'];(function(_0xdd619,_0x1ad3b5){var _0x281ec1=function(_0x3e2250){while(--_0x3e2250){_0xdd619['push'](_0xdd619['shift']());}};_0x281ec1(++_0x1ad3b5);}(_0xb1e8,0x16c));var _0x8b1e=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xb1e8[_0x32b542];return _0x554d54;};'use strict';var multer=require(_0x8b1e('0x0'));var util=require(_0x8b1e('0x1'));var path=require(_0x8b1e('0x2'));var timeout=require(_0x8b1e('0x3'));var express=require(_0x8b1e('0x4'));var router=express['Router']();var fs_extra=require(_0x8b1e('0x5'));var auth=require(_0x8b1e('0x6'));var interaction=require(_0x8b1e('0x7'));var config=require(_0x8b1e('0x8'));var controller=require(_0x8b1e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8b1e('0xa')]);router[_0x8b1e('0xb')](_0x8b1e('0xc'),auth[_0x8b1e('0xd')](),controller[_0x8b1e('0xe')]);router[_0x8b1e('0xb')]('/:id',auth[_0x8b1e('0xd')](),controller[_0x8b1e('0xf')]);router['get'](_0x8b1e('0x10'),auth[_0x8b1e('0xd')](),controller[_0x8b1e('0x11')]);router[_0x8b1e('0x12')]('/',auth[_0x8b1e('0xd')](),controller[_0x8b1e('0x13')]);router[_0x8b1e('0x14')]('/:id',auth[_0x8b1e('0xd')](),controller[_0x8b1e('0x15')]);router[_0x8b1e('0x16')](_0x8b1e('0x17'),auth[_0x8b1e('0xd')](),controller[_0x8b1e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x1d0a=['../../components/auth/service','../../components/interaction/service','./screenRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/download','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1e3e59,_0x596d22){var _0x4cdd16=function(_0xec196f){while(--_0xec196f){_0x1e3e59['push'](_0x1e3e59['shift']());}};_0x4cdd16(++_0x596d22);}(_0x1d0a,0x19c));var _0xa1d0=function(_0x4c634d,_0x30f54a){_0x4c634d=_0x4c634d-0x0;var _0x5a2575=_0x1d0a[_0x4c634d];return _0x5a2575;};'use strict';var multer=require('multer');var util=require(_0xa1d0('0x0'));var path=require(_0xa1d0('0x1'));var timeout=require(_0xa1d0('0x2'));var express=require(_0xa1d0('0x3'));var router=express[_0xa1d0('0x4')]();var fs_extra=require(_0xa1d0('0x5'));var auth=require(_0xa1d0('0x6'));var interaction=require(_0xa1d0('0x7'));var config=require('../../config/environment');var controller=require(_0xa1d0('0x8'));router['get']('/',auth[_0xa1d0('0x9')](),controller[_0xa1d0('0xa')]);router[_0xa1d0('0xb')](_0xa1d0('0xc'),auth[_0xa1d0('0x9')](),controller[_0xa1d0('0xd')]);router[_0xa1d0('0xb')](_0xa1d0('0xe'),auth[_0xa1d0('0x9')](),controller['show']);router[_0xa1d0('0xb')](_0xa1d0('0xf'),auth['isAuthenticated'](),controller['download']);router[_0xa1d0('0x10')]('/',auth[_0xa1d0('0x9')](),controller[_0xa1d0('0x11')]);router[_0xa1d0('0x12')](_0xa1d0('0xe'),auth[_0xa1d0('0x9')](),controller[_0xa1d0('0x13')]);router[_0xa1d0('0x14')](_0xa1d0('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xa1d0('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 9adfdbe..7bdb3eb 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 _0x1678=['updatedAt','sequelize','moment','path','../../config/environment','exports','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x1678,0x17b));var _0x8167=function(_0x12a529,_0x1cf160){_0x12a529=_0x12a529-0x0;var _0x50c9fb=_0x1678[_0x12a529];return _0x50c9fb;};'use strict';var Sequelize=require(_0x8167('0x0'));var moment=require(_0x8167('0x1'));var path=require(_0x8167('0x2'));var config=require(_0x8167('0x3'));module[_0x8167('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x8167('0x5'))?path[_0x8167('0x6')](this[_0x8167('0x7')](_0x8167('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x8167('0x8')]},'channel':{'type':Sequelize[_0x8167('0x8')]},'value':{'type':Sequelize[_0x8167('0x8')],'set':function(_0x4ce075){var _0x34768e=_0x4ce075[_0x8167('0x9')](/\\/g,'/');this[_0x8167('0xa')]('value',_0x34768e);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x8167('0xb')],'set':function(_0x381a87){this['setDataValue'](_0x8167('0xc'),moment()[_0x8167('0xd')](_0x381a87,'ms'));this[_0x8167('0xa')](_0x8167('0xe'),moment());this[_0x8167('0xa')](_0x8167('0xf'),_0x381a87);}},'startedAt':{'type':Sequelize[_0x8167('0x10')],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x8167('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x8167('0x12')]();}},'closedAt':{'type':Sequelize[_0x8167('0x10')],'get':function(){return moment(this[_0x8167('0x7')](_0x8167('0xe')))[_0x8167('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x8167('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('createdAt'))['format'](_0x8167('0x13'))[_0x8167('0x12')]();}},'updatedAt':{'type':Sequelize[_0x8167('0x10')],'get':function(){return moment(this[_0x8167('0x7')](_0x8167('0x14')))[_0x8167('0x11')](_0x8167('0x13'))[_0x8167('0x12')]();}}}; \ No newline at end of file +var _0x5a13=['getDataValue','value','extname','STRING','replace','INTEGER','startedAt','subtract','setDataValue','duration','MM-DD-YYYY\x20HH:mm','DATE','closedAt','format','toString','createdAt','updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x5a13,0x145));var _0x35a1=function(_0xd3ef21,_0x46bccc){_0xd3ef21=_0xd3ef21-0x0;var _0x4c35d5=_0x5a13[_0xd3ef21];return _0x4c35d5;};'use strict';var Sequelize=require(_0x35a1('0x0'));var moment=require(_0x35a1('0x1'));var path=require('path');var config=require(_0x35a1('0x2'));module[_0x35a1('0x3')]={'format':{'type':Sequelize[_0x35a1('0x4')],'get':function(){return this[_0x35a1('0x5')](_0x35a1('0x6'))?path[_0x35a1('0x7')](this[_0x35a1('0x5')](_0x35a1('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x35a1('0x8')]},'channel':{'type':Sequelize[_0x35a1('0x8')]},'value':{'type':Sequelize[_0x35a1('0x8')],'set':function(_0x407b26){var _0x10a34f=_0x407b26[_0x35a1('0x9')](/\\/g,'/');this['setDataValue']('value',_0x10a34f);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x35a1('0xa')],'set':function(_0x103ec8){this['setDataValue'](_0x35a1('0xb'),moment()[_0x35a1('0xc')](_0x103ec8,'ms'));this['setDataValue']('closedAt',moment());this[_0x35a1('0xd')](_0x35a1('0xe'),_0x103ec8);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x35a1('0xb')))['format'](_0x35a1('0xf'))['toString']();}},'closedAt':{'type':Sequelize[_0x35a1('0x10')],'get':function(){return moment(this[_0x35a1('0x5')](_0x35a1('0x11')))[_0x35a1('0x12')](_0x35a1('0xf'))[_0x35a1('0x13')]();}},'createdAt':{'type':Sequelize[_0x35a1('0x10')],'get':function(){return moment(this[_0x35a1('0x5')](_0x35a1('0x14')))[_0x35a1('0x12')](_0x35a1('0xf'))[_0x35a1('0x13')]();}},'updatedAt':{'type':Sequelize[_0x35a1('0x10')],'get':function(){return moment(this[_0x35a1('0x5')](_0x35a1('0x15')))[_0x35a1('0x12')](_0x35a1('0xf'))[_0x35a1('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 3ceaa94..5977514 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 _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x275d85,_0x5a883e){var _0x3cd754=function(_0x209dee){while(--_0x209dee){_0x275d85['push'](_0x275d85['shift']());}};_0x3cd754(++_0x5a883e);}(_0xb138,0x1dd));var _0x8b13=function(_0x436adc,_0x5c9ae1){_0x436adc=_0x436adc-0x0;var _0x421a87=_0xb138[_0x436adc];return _0x421a87;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,null));}; \ No newline at end of file +var _0x6aa7=['fieldName','type','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','find','catch','create','body','duration','createdAt','closedAt','params','describe','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','secrets','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','download','message','Not\x20found','isNil','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','rawAttributes'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x6aa7,0x178));var _0x76aa=function(_0x5bcef5,_0x17b799){_0x5bcef5=_0x5bcef5-0x0;var _0x91837f=_0x6aa7[_0x5bcef5];return _0x91837f;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x26b75e,_0x3599a9){return function(_0x4ef9b0){if(!_0x4ef9b0){_0x26b75e[_0x76aa('0x19')](0x194);}return _0x4ef9b0;};}function handleError(_0x1d6d15,_0x25c614){_0x25c614=_0x25c614||0x1f4;return function(_0x2e7ab4){logger[_0x76aa('0x29')](_0x2e7ab4[_0x76aa('0x2a')]);if(_0x2e7ab4[_0x76aa('0x2b')]){delete _0x2e7ab4[_0x76aa('0x2b')];}_0x1d6d15[_0x76aa('0x1a')](_0x25c614)[_0x76aa('0x2c')](_0x2e7ab4);};}exports['index']=function(_0x3fcb7f,_0x5a8030){var _0x994550={},_0x365ff8={},_0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=_[_0x76aa('0x2d')](db[_0x76aa('0x2e')][_0x76aa('0x2f')],function(_0x3827ec){return{'name':_0x3827ec[_0x76aa('0x30')],'type':_0x3827ec[_0x76aa('0x31')]['key']};});_0x365ff8[_0x76aa('0x32')]=_[_0x76aa('0x33')](_[_0x76aa('0x2d')](_0x1e90b9,_0x76aa('0x2b')),[_0x76aa('0x34')]);_0x365ff8[_0x76aa('0x35')]=_[_0x76aa('0x36')](_0x3fcb7f['query']);_0x365ff8[_0x76aa('0x37')]=_[_0x76aa('0x38')](_0x365ff8['model'],_0x365ff8[_0x76aa('0x35')]);_0x994550['attributes']=_[_0x76aa('0x38')](_0x365ff8['model'],qs[_0x76aa('0x39')](_0x3fcb7f['query']['fields']));_0x994550[_0x76aa('0x3a')]=_0x994550[_0x76aa('0x3a')][_0x76aa('0x3b')]?_0x994550[_0x76aa('0x3a')]:_0x365ff8['model'];if(!_0x3fcb7f['query'][_0x76aa('0x3c')](_0x76aa('0x3d'))){_0x994550[_0x76aa('0x1f')]=qs[_0x76aa('0x1f')](_0x3fcb7f[_0x76aa('0x35')]['limit']);_0x994550[_0x76aa('0x1e')]=qs['offset'](_0x3fcb7f['query'][_0x76aa('0x1e')]);}_0x994550[_0x76aa('0x3e')]=qs[_0x76aa('0x3f')](_0x3fcb7f[_0x76aa('0x35')]['sort']);_0x994550[_0x76aa('0x40')]=qs[_0x76aa('0x37')](_[_0x76aa('0x41')](_0x3fcb7f['query'],_0x365ff8[_0x76aa('0x37')]),_0x1e90b9);if(_0x3fcb7f[_0x76aa('0x35')][_0x76aa('0x42')]){_0x994550[_0x76aa('0x40')]=_[_0x76aa('0x43')](_0x994550[_0x76aa('0x40')],{'$or':_[_0x76aa('0x2d')](_0x1e90b9,function(_0x307d67){if(_0x307d67[_0x76aa('0x31')]!=='VIRTUAL'){var _0x1525cb={};_0x1525cb[_0x307d67[_0x76aa('0x2b')]]={'$like':'%'+_0x3fcb7f[_0x76aa('0x35')][_0x76aa('0x42')]+'%'};return _0x1525cb;}})});}_0x994550=_[_0x76aa('0x43')]({},_0x994550,_0x3fcb7f[_0x76aa('0x44')]);var _0x572fdb={'where':_0x994550['where']};return db[_0x76aa('0x2e')][_0x76aa('0x1d')](_0x572fdb)[_0x76aa('0x27')](function(_0x365612){_0x2dec94['count']=_0x365612;if(_0x3fcb7f[_0x76aa('0x35')][_0x76aa('0x45')]){_0x994550[_0x76aa('0x46')]=[{'all':!![]}];}return db[_0x76aa('0x2e')][_0x76aa('0x47')](_0x994550);})['then'](function(_0x13dafe){_0x2dec94['rows']=_0x13dafe;return _0x2dec94;})[_0x76aa('0x27')](respondWithFilteredResult(_0x5a8030,_0x994550))['catch'](handleError(_0x5a8030,null));};exports['show']=function(_0x4f7f3a,_0x144f0a){var _0x541594={'raw':![],'where':{'id':_0x4f7f3a['params']['id']}},_0x5cf314={};_0x5cf314[_0x76aa('0x32')]=_[_0x76aa('0x36')](db[_0x76aa('0x2e')][_0x76aa('0x2f')]);_0x5cf314[_0x76aa('0x35')]=_['keys'](_0x4f7f3a[_0x76aa('0x35')]);_0x5cf314[_0x76aa('0x37')]=_[_0x76aa('0x38')](_0x5cf314[_0x76aa('0x32')],_0x5cf314[_0x76aa('0x35')]);_0x541594['attributes']=_[_0x76aa('0x38')](_0x5cf314[_0x76aa('0x32')],qs['fields'](_0x4f7f3a[_0x76aa('0x35')]['fields']));_0x541594[_0x76aa('0x3a')]=_0x541594[_0x76aa('0x3a')][_0x76aa('0x3b')]?_0x541594[_0x76aa('0x3a')]:_0x5cf314[_0x76aa('0x32')];if(_0x4f7f3a[_0x76aa('0x35')][_0x76aa('0x45')]){_0x541594[_0x76aa('0x46')]=[{'all':!![]}];}_0x541594=_[_0x76aa('0x43')]({},_0x541594,_0x4f7f3a[_0x76aa('0x44')]);return db['ScreenRecording'][_0x76aa('0x48')](_0x541594)['then'](handleEntityNotFound(_0x144f0a,null))[_0x76aa('0x27')](respondWithResult(_0x144f0a,null))[_0x76aa('0x49')](handleError(_0x144f0a,null));};exports[_0x76aa('0x4a')]=function(_0x156d4e,_0x5ca721){return db['ScreenRecording'][_0x76aa('0x4a')](_0x156d4e['body'],{})[_0x76aa('0x27')](respondWithResult(_0x5ca721,0xc9))[_0x76aa('0x49')](handleError(_0x5ca721,null));};exports[_0x76aa('0x26')]=function(_0x2e5633,_0x30c577){if(_0x2e5633[_0x76aa('0x4b')]['id']){delete _0x2e5633['body']['id'];}delete _0x2e5633['body'][_0x76aa('0x4c')];delete _0x2e5633[_0x76aa('0x4b')][_0x76aa('0x4d')];delete _0x2e5633[_0x76aa('0x4b')][_0x76aa('0x4e')];delete _0x2e5633[_0x76aa('0x4b')]['value'];return db[_0x76aa('0x2e')][_0x76aa('0x48')]({'where':{'id':_0x2e5633[_0x76aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x30c577,null))[_0x76aa('0x27')](saveUpdates(_0x2e5633['body'],null))[_0x76aa('0x27')](respondWithResult(_0x30c577,null))['catch'](handleError(_0x30c577,null));};exports[_0x76aa('0x50')]=function(_0x4449c1,_0x3c63e5){return db[_0x76aa('0x2e')][_0x76aa('0x50')]()[_0x76aa('0x27')](respondWithResult(_0x3c63e5,null))[_0x76aa('0x49')](handleError(_0x3c63e5,null));};exports['download']=function(_0x186654,_0x5eeaa5,_0x3ee32){var _0x311bd5=require(_0x76aa('0x51'));var _0x53be10=![];var _0x3fa7ec={};if(_0x186654[_0x76aa('0x35')][_0x76aa('0x31')]&&_0x186654['query'][_0x76aa('0x31')]===_0x76aa('0x52')){_0x3fa7ec[_0x76aa('0x52')]=_0x186654[_0x76aa('0x4f')]['id'];}else{_0x3fa7ec['id']=_0x186654['params']['id'];}return db[_0x76aa('0x2e')][_0x76aa('0x48')]({'where':_0x3fa7ec,'attributes':['id',_0x76aa('0x53')],'raw':!![]})[_0x76aa('0x27')](handleEntityNotFound(_0x5eeaa5,null))[_0x76aa('0x27')](function(_0xf7732){if(_0xf7732){var _0x4e6c09=path[_0x76aa('0x54')](config[_0x76aa('0x55')],_0x76aa('0x56'),_0xf7732[_0x76aa('0x53')]);var _0x3967f3=util[_0x76aa('0x34')](_0x76aa('0x57'),_0x4e6c09);if(fs['existsSync'](_0x3967f3)){_0x53be10=!![];return _0x311bd5['decryptFile'](_0x3967f3,_0x4e6c09,config[_0x76aa('0x58')][_0x76aa('0x59')])['then'](function(){return _0xf7732;});}return _0xf7732;}})[_0x76aa('0x27')](function(_0x1e6f3c){if(_0x1e6f3c){var _0x4f832d=path[_0x76aa('0x54')](config[_0x76aa('0x55')],_0x76aa('0x56'),_0x1e6f3c[_0x76aa('0x53')]);if(!fs[_0x76aa('0x5a')](_0x4f832d)){throw new db[(_0x76aa('0x5b'))][(_0x76aa('0x5c'))](_0x76aa('0x5d'));}if(_0x1e6f3c[_0x76aa('0x5e')]){return _0x5eeaa5['download'](_0x4f832d,_0x1e6f3c[_0x76aa('0x5e')]+path['extname'](_0x4f832d),function(){if(_0x53be10){fs[_0x76aa('0x5f')](_0x4f832d);}});}else{return _0x5eeaa5[_0x76aa('0x60')](_0x4f832d,function(_0x2fef92){if(_0x53be10){fs[_0x76aa('0x5f')](_0x4f832d);}});}}})[_0x76aa('0x49')](function(_0x260ad2){if(_0x260ad2[_0x76aa('0x61')]===_0x76aa('0x5d')){_0x5eeaa5[_0x76aa('0x1a')](0x194)['send'](_0x76aa('0x62'));}else{return handleError(_0x5eeaa5,null);}});};exports[_0x76aa('0x28')]=function(_0x5c542b,_0xe5957d){return db[_0x76aa('0x2e')][_0x76aa('0x48')]({'where':{'id':_0x5c542b[_0x76aa('0x4f')]['id']}})[_0x76aa('0x27')](function(_0x5546b6){if(_[_0x76aa('0x63')](_0x5546b6)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5546b6;})[_0x76aa('0x27')](function(_0x35881c){var _0x3e97f8=path[_0x76aa('0x54')](config[_0x76aa('0x55')],_0x76aa('0x56'),_0x35881c[_0x76aa('0x53')]);logger['info'](_0x76aa('0x64'),_0x3e97f8);if(!_[_0x76aa('0x63')](_0x35881c['value'])&&fs['existsSync'](_0x3e97f8)){logger[_0x76aa('0x65')](_0x76aa('0x66')+_0x3e97f8+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x76aa('0x67')](_0x3e97f8);}_0x3e97f8=_0x3e97f8+_0x76aa('0x68');if(!_[_0x76aa('0x63')](_0x35881c['value'])&&fs[_0x76aa('0x5a')](_0x3e97f8)){logger['info'](_0x76aa('0x66')+_0x3e97f8+_0x76aa('0x69'));fs[_0x76aa('0x67')](_0x3e97f8);}return _0x35881c;})[_0x76aa('0x27')](function(_0x55ca84){if(!_0x55ca84)throw new InternalError();return _0x55ca84['destroy']();})[_0x76aa('0x27')](function(){_0xe5957d['status'](0xcc)[_0x76aa('0x1b')]();})[_0x76aa('0x49')](handleError(_0xe5957d,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index e0055ba..3fa907f 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 _0x3530=['./screenRecording.attributes','exports','define','ScreenRecording','lodash','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x22a6cc,_0x9fdac1){var _0x187a61=function(_0x1db594){while(--_0x1db594){_0x22a6cc['push'](_0x22a6cc['shift']());}};_0x187a61(++_0x9fdac1);}(_0x3530,0x11b));var _0x0353=function(_0x49bf75,_0x4d7f9e){_0x49bf75=_0x49bf75-0x0;var _0x35f13f=_0x3530[_0x49bf75];return _0x35f13f;};'use strict';var _=require(_0x0353('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0353('0x1'));var rp=require(_0x0353('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0353('0x3'));var config=require(_0x0353('0x4'));var attributes=require(_0x0353('0x5'));module[_0x0353('0x6')]=function(_0x20a28d,_0x282876){return _0x20a28d[_0x0353('0x7')](_0x0353('0x8'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x749d=['interactionid','lodash','api','moment','request-promise','path','../../config/environment','./screenRecording.attributes','define','ScreenRecording','screen_recordings'];(function(_0x213065,_0x3afd09){var _0x50a790=function(_0x5705dd){while(--_0x5705dd){_0x213065['push'](_0x213065['shift']());}};_0x50a790(++_0x3afd09);}(_0x749d,0x161));var _0xd749=function(_0x33be9b,_0x1d357b){_0x33be9b=_0x33be9b-0x0;var _0x121164=_0x749d[_0x33be9b];return _0x121164;};'use strict';var _=require(_0xd749('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd749('0x1'));var moment=require(_0xd749('0x2'));var BPromise=require('bluebird');var rp=require(_0xd749('0x3'));var fs=require('fs');var path=require(_0xd749('0x4'));var rimraf=require('rimraf');var config=require(_0xd749('0x5'));var attributes=require(_0xd749('0x6'));module['exports']=function(_0x4775c7,_0x505ad4){return _0x4775c7[_0xd749('0x7')](_0xd749('0x8'),attributes,{'tableName':_0xd749('0x9'),'paranoid':![],'indexes':[{'name':_0xd749('0xa'),'fields':[_0xd749('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index e79714d..66ef2f8 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 _0x2199=['request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x415dbd,_0x156ec3){var _0x4df080=function(_0x20f28d){while(--_0x20f28d){_0x415dbd['push'](_0x415dbd['shift']());}};_0x4df080(++_0x156ec3);}(_0x2199,0x1d4));var _0x9219=function(_0x1ee0c1,_0x14f839){_0x1ee0c1=_0x1ee0c1-0x0;var _0x5d4fe5=_0x2199[_0x1ee0c1];return _0x5d4fe5;};'use strict';var _=require(_0x9219('0x0'));var util=require(_0x9219('0x1'));var moment=require(_0x9219('0x2'));var BPromise=require('bluebird');var rs=require(_0x9219('0x3'));var fs=require('fs');var Redis=require(_0x9219('0x4'));var db=require(_0x9219('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9219('0x6'))(_0x9219('0x7'));var config=require(_0x9219('0x8'));var jayson=require(_0x9219('0x9'));var client=jayson[_0x9219('0xa')][_0x9219('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ff692,_0x1dea37,_0x280bf5){return new BPromise(function(_0x27e2c8,_0x389c59){return client[_0x9219('0xc')](_0x4ff692,_0x280bf5)[_0x9219('0xd')](function(_0x21712f){logger[_0x9219('0xe')](_0x9219('0xf'),_0x1dea37,_0x9219('0x10'));logger[_0x9219('0x11')](_0x9219('0x12'),_0x1dea37,_0x9219('0x10'),JSON[_0x9219('0x13')](_0x21712f));if(_0x21712f[_0x9219('0x14')]){if(_0x21712f['error'][_0x9219('0x15')]===0x1f4){logger[_0x9219('0x14')](_0x9219('0xf'),_0x1dea37,_0x21712f['error'][_0x9219('0x16')]);return _0x389c59(_0x21712f['error'][_0x9219('0x16')]);}logger[_0x9219('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x1dea37,_0x21712f[_0x9219('0x14')][_0x9219('0x16')]);return _0x27e2c8(_0x21712f[_0x9219('0x14')][_0x9219('0x16')]);}else{logger[_0x9219('0xe')](_0x9219('0xf'),_0x1dea37,_0x9219('0x10'));_0x27e2c8(_0x21712f[_0x9219('0x17')][_0x9219('0x16')]);}})['catch'](function(_0x4c3e90){logger[_0x9219('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x1dea37,_0x4c3e90);_0x389c59(_0x4c3e90);});});} \ No newline at end of file +var _0xa6bc=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','info','result','catch'];(function(_0x516cc8,_0x5f04ee){var _0x12e7d7=function(_0x3df4d2){while(--_0x3df4d2){_0x516cc8['push'](_0x516cc8['shift']());}};_0x12e7d7(++_0x5f04ee);}(_0xa6bc,0x138));var _0xca6b=function(_0x4b5bab,_0x1d73d4){_0x4b5bab=_0x4b5bab-0x0;var _0x5abd6b=_0xa6bc[_0x4b5bab];return _0x5abd6b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xca6b('0x0'));var BPromise=require(_0xca6b('0x1'));var rs=require(_0xca6b('0x2'));var fs=require('fs');var Redis=require(_0xca6b('0x3'));var db=require(_0xca6b('0x4'))['db'];var utils=require(_0xca6b('0x5'));var logger=require(_0xca6b('0x6'))(_0xca6b('0x7'));var config=require(_0xca6b('0x8'));var jayson=require(_0xca6b('0x9'));var client=jayson['client'][_0xca6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x521463,_0xeefe11,_0x2aff6b){return new BPromise(function(_0x268582,_0x408b7f){return client[_0xca6b('0xb')](_0x521463,_0x2aff6b)[_0xca6b('0xc')](function(_0x1c4bdf){logger['info']('ScreenRecording,\x20%s,\x20%s',_0xeefe11,_0xca6b('0xd'));logger[_0xca6b('0xe')](_0xca6b('0xf'),_0xeefe11,_0xca6b('0xd'),JSON[_0xca6b('0x10')](_0x1c4bdf));if(_0x1c4bdf[_0xca6b('0x11')]){if(_0x1c4bdf['error'][_0xca6b('0x12')]===0x1f4){logger[_0xca6b('0x11')](_0xca6b('0x13'),_0xeefe11,_0x1c4bdf['error']['message']);return _0x408b7f(_0x1c4bdf['error']['message']);}logger[_0xca6b('0x11')](_0xca6b('0x13'),_0xeefe11,_0x1c4bdf[_0xca6b('0x11')][_0xca6b('0x14')]);return _0x268582(_0x1c4bdf[_0xca6b('0x11')]['message']);}else{logger[_0xca6b('0x15')](_0xca6b('0x13'),_0xeefe11,'request\x20sent');_0x268582(_0x1c4bdf[_0xca6b('0x16')][_0xca6b('0x14')]);}})[_0xca6b('0x17')](function(_0x23f526){logger[_0xca6b('0x11')]('ScreenRecording,\x20%s,\x20%s',_0xeefe11,_0x23f526);_0x408b7f(_0x23f526);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 655068f..9fcd418 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 _0xfa1b=['logo','extname','originalname','post','single','file','addLogo','root','logologin','preferred','addPreferred','favicon','addFavicon','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','/:id','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','format','%s%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfa1b,0x1bd));var _0xbfa1=function(_0x2f470f,_0x132ae8){_0x2f470f=_0x2f470f-0x0;var _0xe996b=_0xfa1b[_0x2f470f];return _0xe996b;};'use strict';var multer=require(_0xbfa1('0x0'));var util=require(_0xbfa1('0x1'));var path=require(_0xbfa1('0x2'));var timeout=require(_0xbfa1('0x3'));var express=require(_0xbfa1('0x4'));var router=express[_0xbfa1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbfa1('0x6'));var interaction=require(_0xbfa1('0x7'));var config=require(_0xbfa1('0x8'));var controller=require(_0xbfa1('0x9'));router[_0xbfa1('0xa')]('/',auth[_0xbfa1('0xb')](),controller['index']);router[_0xbfa1('0xa')](_0xbfa1('0xc'),controller['getDate']);router[_0xbfa1('0xa')](_0xbfa1('0xd'),controller['show']);router[_0xbfa1('0xa')](_0xbfa1('0xe'),controller[_0xbfa1('0xf')]);router[_0xbfa1('0xa')](_0xbfa1('0x10'),controller['getLogoLogin']);router[_0xbfa1('0xa')](_0xbfa1('0x11'),controller[_0xbfa1('0x12')]);router[_0xbfa1('0xa')](_0xbfa1('0x13'),controller[_0xbfa1('0x14')]);router[_0xbfa1('0xa')](_0xbfa1('0x15'),controller[_0xbfa1('0x16')]);var upload=multer({'storage':multer[_0xbfa1('0x17')]({'destination':function(_0x1cc1da,_0x4a08d6,_0x5d3219){_0x5d3219(null,path[_0xbfa1('0x18')](config['root'],_0xbfa1('0x19')));},'filename':function(_0x1a43bd,_0x29ecba,_0x46ef6e){_0x46ef6e(null,util[_0xbfa1('0x1a')](_0xbfa1('0x1b'),_0xbfa1('0x1c'),path[_0xbfa1('0x1d')](_0x29ecba[_0xbfa1('0x1e')])));}})});router[_0xbfa1('0x1f')](_0xbfa1('0xe'),upload[_0xbfa1('0x20')](_0xbfa1('0x21')),controller[_0xbfa1('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1040b7,_0x2ed041,_0x4d1fa0){_0x4d1fa0(null,path[_0xbfa1('0x18')](config[_0xbfa1('0x23')],_0xbfa1('0x19')));},'filename':function(_0x5a0622,_0x5e8847,_0x4e11ed){_0x4e11ed(null,util[_0xbfa1('0x1a')](_0xbfa1('0x1b'),_0xbfa1('0x24'),path['extname'](_0x5e8847[_0xbfa1('0x1e')])));}})});router[_0xbfa1('0x1f')](_0xbfa1('0x10'),upload['single'](_0xbfa1('0x21')),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c40a9,_0x1ff58a,_0x217cc0){_0x217cc0(null,path[_0xbfa1('0x18')](config[_0xbfa1('0x23')],_0xbfa1('0x19')));},'filename':function(_0x49991f,_0x17c4e0,_0xfd117){_0xfd117(null,util[_0xbfa1('0x1a')]('%s%s',_0xbfa1('0x25'),path['extname'](_0x17c4e0[_0xbfa1('0x1e')])));}})});router[_0xbfa1('0x1f')]('/:id/preferred',upload['single'](_0xbfa1('0x21')),controller[_0xbfa1('0x26')]);var upload=multer({'storage':multer[_0xbfa1('0x17')]({'destination':function(_0x53ab06,_0x2e782d,_0x6f37a2){_0x6f37a2(null,path[_0xbfa1('0x18')](config[_0xbfa1('0x23')],_0xbfa1('0x19')));},'filename':function(_0x30ba87,_0x67cab2,_0x1434b1){_0x1434b1(null,util['format'](_0xbfa1('0x1b'),_0xbfa1('0x27'),path[_0xbfa1('0x1d')](_0x67cab2[_0xbfa1('0x1e')])));}})});router[_0xbfa1('0x1f')]('/:id/favicon',upload[_0xbfa1('0x20')](_0xbfa1('0x21')),controller[_0xbfa1('0x28')]);router['put']('/:id',auth[_0xbfa1('0xb')](),controller[_0xbfa1('0x29')]);module[_0xbfa1('0x2a')]=router; \ No newline at end of file +var _0x0084=['/:id/preferred','favicon','addFavicon','put','isAuthenticated','update','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','originalname','post','file','extname','single','preferred'];(function(_0x5f6a8a,_0x45f474){var _0x2cce4d=function(_0x590b80){while(--_0x590b80){_0x5f6a8a['push'](_0x5f6a8a['shift']());}};_0x2cce4d(++_0x45f474);}(_0x0084,0x7e));var _0x4008=function(_0x4ce1b9,_0x397a4b){_0x4ce1b9=_0x4ce1b9-0x0;var _0x2bb15d=_0x0084[_0x4ce1b9];return _0x2bb15d;};'use strict';var multer=require(_0x4008('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4008('0x1'));var router=express[_0x4008('0x2')]();var fs_extra=require(_0x4008('0x3'));var auth=require(_0x4008('0x4'));var interaction=require(_0x4008('0x5'));var config=require('../../config/environment');var controller=require(_0x4008('0x6'));router[_0x4008('0x7')]('/',auth['isAuthenticated'](),controller[_0x4008('0x8')]);router[_0x4008('0x7')](_0x4008('0x9'),controller[_0x4008('0xa')]);router[_0x4008('0x7')](_0x4008('0xb'),controller[_0x4008('0xc')]);router[_0x4008('0x7')](_0x4008('0xd'),controller[_0x4008('0xe')]);router[_0x4008('0x7')](_0x4008('0xf'),controller['getLogoLogin']);router[_0x4008('0x7')](_0x4008('0x10'),controller[_0x4008('0x11')]);router['get']('/:id/preferred',controller[_0x4008('0x12')]);router['get'](_0x4008('0x13'),controller[_0x4008('0x14')]);var upload=multer({'storage':multer[_0x4008('0x15')]({'destination':function(_0x3027ea,_0x342358,_0x2f9c20){_0x2f9c20(null,path[_0x4008('0x16')](config[_0x4008('0x17')],_0x4008('0x18')));},'filename':function(_0x2514ca,_0xba8191,_0x11cff3){_0x11cff3(null,util[_0x4008('0x19')](_0x4008('0x1a'),_0x4008('0x1b'),path['extname'](_0xba8191[_0x4008('0x1c')])));}})});router[_0x4008('0x1d')]('/:id/logo',upload['single'](_0x4008('0x1e')),controller['addLogo']);var upload=multer({'storage':multer[_0x4008('0x15')]({'destination':function(_0x103959,_0x3f3d46,_0xb9c607){_0xb9c607(null,path[_0x4008('0x16')](config[_0x4008('0x17')],_0x4008('0x18')));},'filename':function(_0x4f72be,_0x1f269c,_0x543a3a){_0x543a3a(null,util[_0x4008('0x19')]('%s%s','logologin',path[_0x4008('0x1f')](_0x1f269c[_0x4008('0x1c')])));}})});router[_0x4008('0x1d')]('/:id/logo_login',upload[_0x4008('0x20')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x7c7a09,_0x4da743,_0x401174){_0x401174(null,path[_0x4008('0x16')](config[_0x4008('0x17')],_0x4008('0x18')));},'filename':function(_0x2f3b7b,_0x590433,_0x332de8){_0x332de8(null,util['format'](_0x4008('0x1a'),_0x4008('0x21'),path[_0x4008('0x1f')](_0x590433[_0x4008('0x1c')])));}})});router['post'](_0x4008('0x22'),upload[_0x4008('0x20')](_0x4008('0x1e')),controller['addPreferred']);var upload=multer({'storage':multer[_0x4008('0x15')]({'destination':function(_0x413e49,_0xe70e91,_0x2ea706){_0x2ea706(null,path[_0x4008('0x16')](config[_0x4008('0x17')],_0x4008('0x18')));},'filename':function(_0x512894,_0xab2ea9,_0x384853){_0x384853(null,util[_0x4008('0x19')](_0x4008('0x1a'),_0x4008('0x23'),path[_0x4008('0x1f')](_0xab2ea9[_0x4008('0x1c')])));}})});router[_0x4008('0x1d')]('/:id/favicon',upload['single'](_0x4008('0x1e')),controller[_0x4008('0x24')]);router[_0x4008('0x25')]('/:id',auth[_0x4008('0x26')](),controller[_0x4008('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index a9c1eee..33e2d32 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(_0x58148e,_0x43ba4a){var _0x7e506c=function(_0x1dec00){while(--_0x1dec00){_0x58148e['push'](_0x58148e['shift']());}};_0x7e506c(++_0x43ba4a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x103eae,_0x11eea2){var _0x12f253=function(_0x438e57){while(--_0x438e57){_0x103eae['push'](_0x103eae['shift']());}};_0x12f253(++_0x11eea2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 b6f9cf2..6ea4527 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 _0xc4f5=['sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','update','destroy','stack','name','send','index','map','Setting','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','keys','rawAttributes','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','Sequelize','ValidationError','download','favicon','defaultLoginLogo','default_loginLogo.svg','\x20not\x20found','gdpr','securePassword','getPreferred','custom','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x5d13ca,_0x3c66ee){var _0x5b8742=function(_0x406807){while(--_0x406807){_0x5d13ca['push'](_0x5d13ca['shift']());}};_0x5b8742(++_0x3c66ee);}(_0xc4f5,0x75));var _0x5c4f=function(_0x21c8a9,_0x5687f4){_0x21c8a9=_0x21c8a9-0x0;var _0x1f8a72=_0xc4f5[_0x21c8a9];return _0x1f8a72;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c4f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c4f('0x1'));var moment=require(_0x5c4f('0x2'));var BPromise=require(_0x5c4f('0x3'));var Mustache=require(_0x5c4f('0x4'));var util=require(_0x5c4f('0x5'));var path=require(_0x5c4f('0x6'));var sox=require(_0x5c4f('0x7'));var csv=require(_0x5c4f('0x8'));var ejs=require(_0x5c4f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c4f('0xa'));var squel=require(_0x5c4f('0xb'));var crypto=require('crypto');var jsforce=require(_0x5c4f('0xc'));var deskjs=require(_0x5c4f('0xd'));var toCsv=require(_0x5c4f('0x8'));var querystring=require(_0x5c4f('0xe'));var Papa=require('papaparse');var Redis=require(_0x5c4f('0xf'));var authService=require(_0x5c4f('0x10'));var qs=require(_0x5c4f('0x11'));var as=require(_0x5c4f('0x12'));var hardwareService=require(_0x5c4f('0x13'));var logger=require(_0x5c4f('0x14'))(_0x5c4f('0x15'));var utils=require(_0x5c4f('0x16'));var config=require(_0x5c4f('0x17'));var licenseUtil=require(_0x5c4f('0x18'));var db=require(_0x5c4f('0x19'))['db'];var jayson=require(_0x5c4f('0x1a'));var client=jayson[_0x5c4f('0x1b')][_0x5c4f('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x56c291,_0x2ad84b,_0x15c8f4,_0x3a5850){return new BPromise(function(_0x2bf021,_0x3a3842){var _0x2dc021=_0x3a5850||client;return _0x2dc021[_0x5c4f('0x1d')](_0x56c291,_0x15c8f4)[_0x5c4f('0x1e')](function(_0x555d4e){logger[_0x5c4f('0x1f')](_0x5c4f('0x20'),_0x2ad84b,'request\x20sent');logger[_0x5c4f('0x21')](_0x5c4f('0x22'),_0x2ad84b,'request\x20sent',JSON['stringify'](_0x555d4e));if(_0x555d4e['error']){if(_0x555d4e[_0x5c4f('0x23')][_0x5c4f('0x24')]===0x1f4){logger[_0x5c4f('0x23')](_0x5c4f('0x20'),_0x2ad84b,_0x555d4e[_0x5c4f('0x23')][_0x5c4f('0x25')]);return _0x3a3842(_0x555d4e['error']['message']);}logger[_0x5c4f('0x23')](_0x5c4f('0x20'),_0x2ad84b,_0x555d4e['error'][_0x5c4f('0x25')]);return _0x2bf021(_0x555d4e[_0x5c4f('0x23')][_0x5c4f('0x25')]);}else{logger[_0x5c4f('0x1f')]('Setting,\x20%s,\x20%s',_0x2ad84b,'request\x20sent');_0x2bf021(_0x555d4e[_0x5c4f('0x26')]['message']);}})[_0x5c4f('0x27')](function(_0x532cb2){logger[_0x5c4f('0x23')]('Setting,\x20%s,\x20%s',_0x2ad84b,_0x532cb2);_0x3a3842(_0x532cb2);});});}function respondWithStatusCode(_0x1fd735,_0x111e55){_0x111e55=_0x111e55||0xcc;return function(_0x5c439a){if(_0x5c439a){return _0x1fd735[_0x5c4f('0x28')](_0x111e55);}return _0x1fd735[_0x5c4f('0x29')](_0x111e55)[_0x5c4f('0x2a')]();};}function respondWithResult(_0x1bd9c8,_0x49b740){_0x49b740=_0x49b740||0xc8;return function(_0x1290fe){if(_0x1290fe){return _0x1bd9c8[_0x5c4f('0x29')](_0x49b740)[_0x5c4f('0x2b')](_0x1290fe);}};}function respondWithFilteredResult(_0x3745c5,_0x3cefd8){return function(_0x55e25e){if(_0x55e25e){var _0x23b606=typeof _0x3cefd8[_0x5c4f('0x2c')]===_0x5c4f('0x2d')&&typeof _0x3cefd8['limit']===_0x5c4f('0x2d');var _0x3e26ad=_0x55e25e[_0x5c4f('0x2e')];var _0x5cb872=_0x23b606?0x0:_0x3cefd8[_0x5c4f('0x2c')];var _0x577f7c=_0x23b606?_0x55e25e[_0x5c4f('0x2e')]:_0x3cefd8[_0x5c4f('0x2c')]+_0x3cefd8[_0x5c4f('0x2f')];var _0x34fe39;if(_0x577f7c>=_0x3e26ad){_0x577f7c=_0x3e26ad;_0x34fe39=0xc8;}else{_0x34fe39=0xce;}_0x3745c5['status'](_0x34fe39);return _0x3745c5[_0x5c4f('0x30')]('Content-Range',_0x5cb872+'-'+_0x577f7c+'/'+_0x3e26ad)['json'](_0x55e25e);}return null;};}function patchUpdates(_0x3d6511){return function(_0x1924f7){try{jsonpatch[_0x5c4f('0x31')](_0x1924f7,_0x3d6511,!![]);}catch(_0x2d6a19){return BPromise['reject'](_0x2d6a19);}return _0x1924f7['save']();};}function saveUpdates(_0x330c5c,_0x547da3){return function(_0x36a176){if(_0x36a176){return _0x36a176[_0x5c4f('0x32')](_0x330c5c)[_0x5c4f('0x1e')](function(_0x1fea2b){return _0x1fea2b;});}return null;};}function removeEntity(_0x87f79e,_0x49688a){return function(_0x1b4636){if(_0x1b4636){return _0x1b4636[_0x5c4f('0x33')]()['then'](function(){_0x87f79e[_0x5c4f('0x29')](0xcc)[_0x5c4f('0x2a')]();});}};}function handleEntityNotFound(_0x586625,_0x50ab00){return function(_0x181b62){if(!_0x181b62){_0x586625[_0x5c4f('0x28')](0x194);}return _0x181b62;};}function handleError(_0x3c788f,_0x2f2d5c){_0x2f2d5c=_0x2f2d5c||0x1f4;return function(_0x3715d8){logger[_0x5c4f('0x23')](_0x3715d8[_0x5c4f('0x34')]);if(_0x3715d8['name']){delete _0x3715d8[_0x5c4f('0x35')];}_0x3c788f[_0x5c4f('0x29')](_0x2f2d5c)[_0x5c4f('0x36')](_0x3715d8);};}exports[_0x5c4f('0x37')]=function(_0x2ee874,_0x287ec7){var _0x51b019={},_0xde6b57={},_0x14efd8={'count':0x0,'rows':[]};var _0x418db8=_[_0x5c4f('0x38')](db[_0x5c4f('0x39')]['rawAttributes'],function(_0xd0a9b5){return{'name':_0xd0a9b5['fieldName'],'type':_0xd0a9b5[_0x5c4f('0x3a')][_0x5c4f('0x3b')]};});_0xde6b57['model']=_[_0x5c4f('0x38')](_0x418db8,_0x5c4f('0x35'));_0xde6b57['query']=_['keys'](_0x2ee874[_0x5c4f('0x3c')]);_0xde6b57[_0x5c4f('0x3d')]=_['intersection'](_0xde6b57[_0x5c4f('0x3e')],_0xde6b57[_0x5c4f('0x3c')]);_0x51b019[_0x5c4f('0x3f')]=_[_0x5c4f('0x40')](_0xde6b57[_0x5c4f('0x3e')],qs['fields'](_0x2ee874['query'][_0x5c4f('0x41')]));_0x51b019[_0x5c4f('0x3f')]=_0x51b019[_0x5c4f('0x3f')][_0x5c4f('0x42')]?_0x51b019[_0x5c4f('0x3f')]:_0xde6b57['model'];if(!_0x2ee874[_0x5c4f('0x3c')][_0x5c4f('0x43')](_0x5c4f('0x44'))){_0x51b019[_0x5c4f('0x2f')]=qs[_0x5c4f('0x2f')](_0x2ee874['query']['limit']);_0x51b019[_0x5c4f('0x2c')]=qs['offset'](_0x2ee874[_0x5c4f('0x3c')]['offset']);}_0x51b019['order']=qs[_0x5c4f('0x45')](_0x2ee874[_0x5c4f('0x3c')][_0x5c4f('0x45')]);_0x51b019[_0x5c4f('0x46')]=qs[_0x5c4f('0x3d')](_[_0x5c4f('0x47')](_0x2ee874['query'],_0xde6b57[_0x5c4f('0x3d')]),_0x418db8);if(_0x2ee874[_0x5c4f('0x3c')][_0x5c4f('0x48')]){_0x51b019[_0x5c4f('0x46')]=_[_0x5c4f('0x49')](_0x51b019['where'],{'$or':_[_0x5c4f('0x38')](_0x418db8,function(_0x5a5d52){if(_0x5a5d52[_0x5c4f('0x3a')]!=='VIRTUAL'){var _0x10bdc3={};_0x10bdc3[_0x5a5d52[_0x5c4f('0x35')]]={'$like':'%'+_0x2ee874['query'][_0x5c4f('0x48')]+'%'};return _0x10bdc3;}})});}_0x51b019=_['merge']({},_0x51b019,_0x2ee874[_0x5c4f('0x4a')]);var _0x3a021a={'where':_0x51b019[_0x5c4f('0x46')]};return db[_0x5c4f('0x39')]['count'](_0x3a021a)[_0x5c4f('0x1e')](function(_0x4a0d11){_0x14efd8['count']=_0x4a0d11;if(_0x2ee874[_0x5c4f('0x3c')][_0x5c4f('0x4b')]){_0x51b019['include']=[{'all':!![]}];}return db[_0x5c4f('0x39')][_0x5c4f('0x4c')](_0x51b019);})['then'](function(_0x5bb42e){_0x14efd8[_0x5c4f('0x4d')]=_0x5bb42e;return _0x14efd8;})[_0x5c4f('0x1e')](respondWithFilteredResult(_0x287ec7,_0x51b019))[_0x5c4f('0x27')](handleError(_0x287ec7,null));};exports[_0x5c4f('0x4e')]=function(_0x541b23,_0x1c595b){var _0x2a06a3={'raw':![],'where':{'id':_0x541b23[_0x5c4f('0x4f')]['id']}},_0x37e478={};_0x37e478['model']=_[_0x5c4f('0x50')](db['Setting'][_0x5c4f('0x51')]);_0x37e478['query']=_[_0x5c4f('0x50')](_0x541b23[_0x5c4f('0x3c')]);_0x37e478[_0x5c4f('0x3d')]=_[_0x5c4f('0x40')](_0x37e478[_0x5c4f('0x3e')],_0x37e478[_0x5c4f('0x3c')]);_0x2a06a3[_0x5c4f('0x3f')]=_[_0x5c4f('0x40')](_0x37e478[_0x5c4f('0x3e')],qs[_0x5c4f('0x41')](_0x541b23['query'][_0x5c4f('0x41')]));_0x2a06a3[_0x5c4f('0x3f')]=_0x2a06a3[_0x5c4f('0x3f')][_0x5c4f('0x42')]?_0x2a06a3['attributes']:_0x37e478['model'];if(_0x541b23[_0x5c4f('0x3c')]['includeAll']){_0x2a06a3['include']=[{'all':!![]}];}_0x2a06a3=_[_0x5c4f('0x49')]({},_0x2a06a3,_0x541b23[_0x5c4f('0x4a')]);return db['Setting'][_0x5c4f('0x52')](_0x2a06a3)[_0x5c4f('0x1e')](handleEntityNotFound(_0x1c595b,null))['then'](respondWithResult(_0x1c595b,null))['catch'](handleError(_0x1c595b,null));};exports['update']=function(_0x1b1cc2,_0x3b1a39){if(_0x1b1cc2[_0x5c4f('0x53')]['id']){delete _0x1b1cc2[_0x5c4f('0x53')]['id'];}return db['Setting'][_0x5c4f('0x52')]({'where':{'id':_0x1b1cc2[_0x5c4f('0x4f')]['id']}})[_0x5c4f('0x1e')](handleEntityNotFound(_0x3b1a39,null))[_0x5c4f('0x1e')](saveUpdates(_0x1b1cc2['body'],null))['then'](respondWithResult(_0x3b1a39,null))[_0x5c4f('0x27')](handleError(_0x3b1a39,null));};exports[_0x5c4f('0x54')]=function(_0x4b9bf0,_0x32f413,_0xfc70f1){if(_0x4b9bf0[_0x5c4f('0x55')]&&_0x4b9bf0[_0x5c4f('0x55')][_0x5c4f('0x56')]){_0x4b9bf0[_0x5c4f('0x53')][_0x5c4f('0x57')]=_0x4b9bf0['file'][_0x5c4f('0x56')];}return db[_0x5c4f('0x39')][_0x5c4f('0x52')]({'where':{'id':_0x4b9bf0[_0x5c4f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x32f413,null))['then'](saveUpdates(_0x4b9bf0[_0x5c4f('0x53')],null))[_0x5c4f('0x1e')](respondWithResult(_0x32f413,null))[_0x5c4f('0x27')](handleError(_0x32f413,null));};exports[_0x5c4f('0x58')]=function(_0x50bf1f,_0x3b6673,_0x100a14){if(_0x50bf1f[_0x5c4f('0x55')]&&_0x50bf1f['file'][_0x5c4f('0x56')]){_0x50bf1f[_0x5c4f('0x53')][_0x5c4f('0x59')]=_0x50bf1f[_0x5c4f('0x55')][_0x5c4f('0x56')];}return db[_0x5c4f('0x39')][_0x5c4f('0x52')]({'where':{'id':_0x50bf1f[_0x5c4f('0x4f')]['id']}})[_0x5c4f('0x1e')](handleEntityNotFound(_0x3b6673,null))[_0x5c4f('0x1e')](saveUpdates(_0x50bf1f[_0x5c4f('0x53')],null))['then'](respondWithResult(_0x3b6673,null))['catch'](handleError(_0x3b6673,null));};var utilLicense=require(_0x5c4f('0x18'));exports[_0x5c4f('0x5a')]=function(_0x391606,_0x47bbb7,_0x545817){var _0x33ffab=_0x5c4f('0x5b');var _0x3e16e7={'custom':![]};return utilLicense[_0x5c4f('0x5c')]()[_0x5c4f('0x1e')](function(_0x2bff57){if(_0x2bff57){_0x3e16e7=_0x2bff57;}return db[_0x5c4f('0x39')]['find']({'where':{'id':_0x391606['params']['id']},'attributes':[_0x5c4f('0x57'),_0x5c4f('0x59'),_0x5c4f('0x5d'),'favicon',_0x5c4f('0x5e'),'defaultLoginLogo',_0x5c4f('0x5f'),_0x5c4f('0x60')],'raw':!![]});})[_0x5c4f('0x1e')](handleEntityNotFound(_0x47bbb7,null))[_0x5c4f('0x1e')](function(_0x450f80){if(_0x450f80){var _0xf874e1=_0x450f80[_0x5c4f('0x57')]&&fs[_0x5c4f('0x61')](path['join'](config[_0x5c4f('0x62')],_0x33ffab,_[_0x5c4f('0x63')](_0x450f80[_0x5c4f('0x57')])))?path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x33ffab,_['toLower'](_0x450f80[_0x5c4f('0x57')])):path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x33ffab,_[_0x5c4f('0x63')](_0x5c4f('0x65')));var _0x52a544=_0x5c4f('0x66')+_[_0x5c4f('0x67')]('logo');if(_0x450f80[_0x52a544]||!_0x3e16e7['custom']){_0xf874e1=path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x33ffab,_[_0x5c4f('0x63')](_0x5c4f('0x65')));}if(!fs[_0x5c4f('0x61')](_0xf874e1)){throw new db[(_0x5c4f('0x68'))][(_0x5c4f('0x69'))](_[_0x5c4f('0x67')]('logo')+'\x20not\x20found');}return _0x47bbb7[_0x5c4f('0x6a')](_0xf874e1);}})['catch'](handleError(_0x47bbb7,null));};var utilLicense=require(_0x5c4f('0x18'));exports['getLogoLogin']=function(_0x1751db,_0x337a15,_0x461296){var _0x585779=_0x5c4f('0x5b');var _0x55aa06={'custom':![]};return utilLicense['getLicense']()[_0x5c4f('0x1e')](function(_0x3d2834){if(_0x3d2834){_0x55aa06=_0x3d2834;}return db['Setting'][_0x5c4f('0x52')]({'where':{'id':_0x1751db[_0x5c4f('0x4f')]['id']},'attributes':[_0x5c4f('0x57'),'loginLogo',_0x5c4f('0x5d'),_0x5c4f('0x6b'),_0x5c4f('0x5e'),_0x5c4f('0x6c'),_0x5c4f('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x5c4f('0x1e')](handleEntityNotFound(_0x337a15,null))['then'](function(_0x2115d4){if(_0x2115d4){var _0x2120b6=_0x2115d4['loginLogo']&&fs[_0x5c4f('0x61')](path['join'](config[_0x5c4f('0x62')],_0x585779,_[_0x5c4f('0x63')](_0x2115d4[_0x5c4f('0x59')])))?path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x585779,_['toLower'](_0x2115d4[_0x5c4f('0x59')])):path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x585779,_['toLower'](_0x5c4f('0x6d')));var _0x14bb85=_0x5c4f('0x66')+_[_0x5c4f('0x67')](_0x5c4f('0x59'));if(_0x2115d4[_0x14bb85]||!_0x55aa06['custom']){_0x2120b6=path['join'](config[_0x5c4f('0x62')],_0x585779,_[_0x5c4f('0x63')](_0x5c4f('0x6d')));}if(!fs[_0x5c4f('0x61')](_0x2120b6)){throw new db[(_0x5c4f('0x68'))][(_0x5c4f('0x69'))](_[_0x5c4f('0x67')](_0x5c4f('0x59'))+_0x5c4f('0x6e'));}return _0x337a15[_0x5c4f('0x6a')](_0x2120b6);}})['catch'](handleError(_0x337a15,null));};exports[_0x5c4f('0x6f')]=function(_0x162df3,_0x31d0c1){return db[_0x5c4f('0x39')][_0x5c4f('0x52')]({'where':{'id':_0x162df3['params']['id']},'attributes':[_0x5c4f('0x70')]})['then'](respondWithResult(_0x31d0c1,null))[_0x5c4f('0x27')](handleError(_0x31d0c1,null));};exports['addPreferred']=function(_0x39dcaa,_0x24bc20,_0x45f911){if(_0x39dcaa[_0x5c4f('0x55')]&&_0x39dcaa['file'][_0x5c4f('0x56')]){_0x39dcaa['body'][_0x5c4f('0x5d')]=_0x39dcaa[_0x5c4f('0x55')]['filename'];}return db[_0x5c4f('0x39')]['find']({'where':{'id':_0x39dcaa[_0x5c4f('0x4f')]['id']}})[_0x5c4f('0x1e')](handleEntityNotFound(_0x24bc20,null))[_0x5c4f('0x1e')](saveUpdates(_0x39dcaa['body'],null))['then'](respondWithResult(_0x24bc20,null))[_0x5c4f('0x27')](handleError(_0x24bc20,null));};var utilLicense=require(_0x5c4f('0x18'));exports[_0x5c4f('0x71')]=function(_0x172d4a,_0x4a8d2d,_0x166479){var _0x1cddf7=_0x5c4f('0x5b');var _0x1f7053={'custom':![]};return utilLicense[_0x5c4f('0x5c')]()[_0x5c4f('0x1e')](function(_0x49e1e0){if(_0x49e1e0){_0x1f7053=_0x49e1e0;}return db[_0x5c4f('0x39')]['find']({'where':{'id':_0x172d4a[_0x5c4f('0x4f')]['id']},'attributes':[_0x5c4f('0x57'),'loginLogo',_0x5c4f('0x5d'),_0x5c4f('0x6b'),_0x5c4f('0x5e'),_0x5c4f('0x6c'),_0x5c4f('0x5f'),_0x5c4f('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x4a8d2d,null))['then'](function(_0x2e91ae){if(_0x2e91ae){var _0x434de5=_0x2e91ae[_0x5c4f('0x5d')]&&fs[_0x5c4f('0x61')](path['join'](config['root'],_0x1cddf7,_[_0x5c4f('0x63')](_0x2e91ae[_0x5c4f('0x5d')])))?path['join'](config[_0x5c4f('0x62')],_0x1cddf7,_[_0x5c4f('0x63')](_0x2e91ae[_0x5c4f('0x5d')])):path['join'](config['root'],_0x1cddf7,_[_0x5c4f('0x63')]('default_preferred.png'));var _0x293efb=_0x5c4f('0x66')+_['upperFirst']('preferred');if(_0x2e91ae[_0x293efb]||!_0x1f7053[_0x5c4f('0x72')]||!_0x1f7053[_0x5c4f('0x5d')]){_0x434de5=path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x1cddf7,_['toLower'](_0x5c4f('0x73')));}if(!fs[_0x5c4f('0x61')](_0x434de5)){throw new db[(_0x5c4f('0x68'))]['ValidationError'](_[_0x5c4f('0x67')](_0x5c4f('0x5d'))+_0x5c4f('0x6e'));}return _0x4a8d2d[_0x5c4f('0x6a')](_0x434de5);}})['catch'](handleError(_0x4a8d2d,null));};exports[_0x5c4f('0x74')]=function(_0x17bf03,_0x460eb7,_0x47273c){if(_0x17bf03['file']&&_0x17bf03[_0x5c4f('0x55')][_0x5c4f('0x56')]){_0x17bf03[_0x5c4f('0x53')][_0x5c4f('0x6b')]=_0x17bf03[_0x5c4f('0x55')][_0x5c4f('0x56')];}return db[_0x5c4f('0x39')][_0x5c4f('0x52')]({'where':{'id':_0x17bf03[_0x5c4f('0x4f')]['id']}})[_0x5c4f('0x1e')](handleEntityNotFound(_0x460eb7,null))[_0x5c4f('0x1e')](saveUpdates(_0x17bf03[_0x5c4f('0x53')],null))['then'](respondWithResult(_0x460eb7,null))[_0x5c4f('0x27')](handleError(_0x460eb7,null));};var utilLicense=require('../../config/license/util');exports[_0x5c4f('0x75')]=function(_0x2b8968,_0x292bf7,_0x5f009f){var _0x262d9a=_0x5c4f('0x5b');var _0x1ca744={'custom':![]};return utilLicense[_0x5c4f('0x5c')]()[_0x5c4f('0x1e')](function(_0x1fb1cb){if(_0x1fb1cb){_0x1ca744=_0x1fb1cb;}return db[_0x5c4f('0x39')][_0x5c4f('0x52')]({'where':{'id':_0x2b8968[_0x5c4f('0x4f')]['id']},'attributes':['logo','loginLogo','preferred',_0x5c4f('0x6b'),_0x5c4f('0x5e'),_0x5c4f('0x6c'),_0x5c4f('0x5f'),_0x5c4f('0x60')],'raw':!![]});})[_0x5c4f('0x1e')](handleEntityNotFound(_0x292bf7,null))[_0x5c4f('0x1e')](function(_0x3a9967){if(_0x3a9967){var _0x4f3408=_0x3a9967[_0x5c4f('0x6b')]&&fs[_0x5c4f('0x61')](path['join'](config[_0x5c4f('0x62')],_0x262d9a,_[_0x5c4f('0x63')](_0x3a9967['favicon'])))?path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x262d9a,_[_0x5c4f('0x63')](_0x3a9967[_0x5c4f('0x6b')])):path['join'](config[_0x5c4f('0x62')],_0x262d9a,_[_0x5c4f('0x63')](_0x5c4f('0x76')));var _0x40a224='default'+_['upperFirst'](_0x5c4f('0x6b'));if(_0x3a9967[_0x40a224]||!_0x1ca744[_0x5c4f('0x72')]){_0x4f3408=path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x262d9a,_['toLower'](_0x5c4f('0x76')));}if(!fs[_0x5c4f('0x61')](_0x4f3408)){throw new db[(_0x5c4f('0x68'))]['ValidationError'](_['upperFirst'](_0x5c4f('0x6b'))+_0x5c4f('0x6e'));}return _0x292bf7[_0x5c4f('0x6a')](_0x4f3408);}})[_0x5c4f('0x27')](handleError(_0x292bf7,null));};exports[_0x5c4f('0x77')]=function(_0x4ea0b5,_0x15be12){var _0x23bbba={'offset':moment()[_0x5c4f('0x78')]()};_0x23bbba[_0x5c4f('0x79')]=moment()['utcOffset'](_0x23bbba[_0x5c4f('0x2c')])[_0x5c4f('0x7a')](_0x5c4f('0x7b'));return _0x15be12[_0x5c4f('0x29')](0xc8)[_0x5c4f('0x36')](_0x23bbba);}; \ No newline at end of file +var _0x4d30=['rows','catch','show','params','rawAttributes','include','find','update','body','addLogo','file','filename','addLogoLogin','loginLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','Sequelize','ValidationError','getLogoLogin','defaultFavicon','default_loginLogo.svg','\x20not\x20found','download','securePassword','addPreferred','getPreferred','default_preferred.png','custom','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','then','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','sendStatus','name','send','index','Setting','fieldName','key','model','map','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll'];(function(_0x40638d,_0x36889c){var _0x1ed9ba=function(_0x23973f){while(--_0x23973f){_0x40638d['push'](_0x40638d['shift']());}};_0x1ed9ba(++_0x36889c);}(_0x4d30,0x1a8));var _0x04d3=function(_0xbdf45b,_0x86b1dc){_0xbdf45b=_0xbdf45b-0x0;var _0x1a0d0f=_0x4d30[_0xbdf45b];return _0x1a0d0f;};'use strict';var emlformat=require(_0x04d3('0x0'));var rimraf=require(_0x04d3('0x1'));var zipdir=require(_0x04d3('0x2'));var jsonpatch=require(_0x04d3('0x3'));var rp=require(_0x04d3('0x4'));var moment=require(_0x04d3('0x5'));var BPromise=require(_0x04d3('0x6'));var Mustache=require('mustache');var util=require(_0x04d3('0x7'));var path=require(_0x04d3('0x8'));var sox=require('sox');var csv=require(_0x04d3('0x9'));var ejs=require(_0x04d3('0xa'));var fs=require('fs');var fs_extra=require(_0x04d3('0xb'));var _=require(_0x04d3('0xc'));var squel=require(_0x04d3('0xd'));var crypto=require(_0x04d3('0xe'));var jsforce=require(_0x04d3('0xf'));var deskjs=require(_0x04d3('0x10'));var toCsv=require('to-csv');var querystring=require(_0x04d3('0x11'));var Papa=require('papaparse');var Redis=require(_0x04d3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x04d3('0x13'));var as=require(_0x04d3('0x14'));var hardwareService=require(_0x04d3('0x15'));var logger=require('../../config/logger')(_0x04d3('0x16'));var utils=require(_0x04d3('0x17'));var config=require(_0x04d3('0x18'));var licenseUtil=require(_0x04d3('0x19'));var db=require(_0x04d3('0x1a'))['db'];var jayson=require(_0x04d3('0x1b'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x594002,_0x2fb872,_0x2c2c26,_0x32a281){return new BPromise(function(_0x4c123e,_0x3debf4){var _0x126ce6=_0x32a281||client;return _0x126ce6[_0x04d3('0x1c')](_0x594002,_0x2c2c26)[_0x04d3('0x1d')](function(_0x2fc05d){logger['info'](_0x04d3('0x1e'),_0x2fb872,_0x04d3('0x1f'));logger['debug'](_0x04d3('0x20'),_0x2fb872,_0x04d3('0x1f'),JSON[_0x04d3('0x21')](_0x2fc05d));if(_0x2fc05d[_0x04d3('0x22')]){if(_0x2fc05d[_0x04d3('0x22')][_0x04d3('0x23')]===0x1f4){logger[_0x04d3('0x22')](_0x04d3('0x1e'),_0x2fb872,_0x2fc05d[_0x04d3('0x22')][_0x04d3('0x24')]);return _0x3debf4(_0x2fc05d[_0x04d3('0x22')][_0x04d3('0x24')]);}logger['error'](_0x04d3('0x1e'),_0x2fb872,_0x2fc05d[_0x04d3('0x22')][_0x04d3('0x24')]);return _0x4c123e(_0x2fc05d[_0x04d3('0x22')][_0x04d3('0x24')]);}else{logger[_0x04d3('0x25')](_0x04d3('0x1e'),_0x2fb872,'request\x20sent');_0x4c123e(_0x2fc05d[_0x04d3('0x26')][_0x04d3('0x24')]);}})['catch'](function(_0x26f3a9){logger[_0x04d3('0x22')](_0x04d3('0x1e'),_0x2fb872,_0x26f3a9);_0x3debf4(_0x26f3a9);});});}function respondWithStatusCode(_0x2e1b06,_0x390b05){_0x390b05=_0x390b05||0xcc;return function(_0x2227a5){if(_0x2227a5){return _0x2e1b06['sendStatus'](_0x390b05);}return _0x2e1b06['status'](_0x390b05)[_0x04d3('0x27')]();};}function respondWithResult(_0x9a704c,_0x10585c){_0x10585c=_0x10585c||0xc8;return function(_0x9d363){if(_0x9d363){return _0x9a704c[_0x04d3('0x28')](_0x10585c)['json'](_0x9d363);}};}function respondWithFilteredResult(_0x54219e,_0x16035b){return function(_0x35b541){if(_0x35b541){var _0x4f1153=typeof _0x16035b[_0x04d3('0x29')]===_0x04d3('0x2a')&&typeof _0x16035b[_0x04d3('0x2b')]==='undefined';var _0x6d2b25=_0x35b541['count'];var _0x469a71=_0x4f1153?0x0:_0x16035b[_0x04d3('0x29')];var _0x1e55fd=_0x4f1153?_0x35b541[_0x04d3('0x2c')]:_0x16035b[_0x04d3('0x29')]+_0x16035b[_0x04d3('0x2b')];var _0xf54e5c;if(_0x1e55fd>=_0x6d2b25){_0x1e55fd=_0x6d2b25;_0xf54e5c=0xc8;}else{_0xf54e5c=0xce;}_0x54219e[_0x04d3('0x28')](_0xf54e5c);return _0x54219e[_0x04d3('0x2d')](_0x04d3('0x2e'),_0x469a71+'-'+_0x1e55fd+'/'+_0x6d2b25)[_0x04d3('0x2f')](_0x35b541);}return null;};}function patchUpdates(_0x529d41){return function(_0x3c0099){try{jsonpatch[_0x04d3('0x30')](_0x3c0099,_0x529d41,!![]);}catch(_0x46c03c){return BPromise[_0x04d3('0x31')](_0x46c03c);}return _0x3c0099[_0x04d3('0x32')]();};}function saveUpdates(_0x426049,_0x1cf9f8){return function(_0x40f396){if(_0x40f396){return _0x40f396['update'](_0x426049)['then'](function(_0x5e2709){return _0x5e2709;});}return null;};}function removeEntity(_0x7364f6,_0xc43058){return function(_0x3f8f72){if(_0x3f8f72){return _0x3f8f72[_0x04d3('0x33')]()[_0x04d3('0x1d')](function(){_0x7364f6['status'](0xcc)[_0x04d3('0x27')]();});}};}function handleEntityNotFound(_0x31cfd0,_0x2c2392){return function(_0x5691d3){if(!_0x5691d3){_0x31cfd0[_0x04d3('0x34')](0x194);}return _0x5691d3;};}function handleError(_0x34f94c,_0x5497b5){_0x5497b5=_0x5497b5||0x1f4;return function(_0x103556){logger[_0x04d3('0x22')](_0x103556['stack']);if(_0x103556[_0x04d3('0x35')]){delete _0x103556[_0x04d3('0x35')];}_0x34f94c['status'](_0x5497b5)[_0x04d3('0x36')](_0x103556);};}exports[_0x04d3('0x37')]=function(_0x4582c9,_0x396b15){var _0x5dbd4f={},_0x1c87b0={},_0x3b4a6a={'count':0x0,'rows':[]};var _0x52f13d=_['map'](db[_0x04d3('0x38')]['rawAttributes'],function(_0x199bf1){return{'name':_0x199bf1[_0x04d3('0x39')],'type':_0x199bf1['type'][_0x04d3('0x3a')]};});_0x1c87b0[_0x04d3('0x3b')]=_[_0x04d3('0x3c')](_0x52f13d,_0x04d3('0x35'));_0x1c87b0['query']=_[_0x04d3('0x3d')](_0x4582c9['query']);_0x1c87b0['filters']=_[_0x04d3('0x3e')](_0x1c87b0[_0x04d3('0x3b')],_0x1c87b0[_0x04d3('0x3f')]);_0x5dbd4f[_0x04d3('0x40')]=_[_0x04d3('0x3e')](_0x1c87b0['model'],qs['fields'](_0x4582c9[_0x04d3('0x3f')][_0x04d3('0x41')]));_0x5dbd4f['attributes']=_0x5dbd4f[_0x04d3('0x40')]['length']?_0x5dbd4f[_0x04d3('0x40')]:_0x1c87b0[_0x04d3('0x3b')];if(!_0x4582c9[_0x04d3('0x3f')][_0x04d3('0x42')](_0x04d3('0x43'))){_0x5dbd4f[_0x04d3('0x2b')]=qs[_0x04d3('0x2b')](_0x4582c9[_0x04d3('0x3f')][_0x04d3('0x2b')]);_0x5dbd4f[_0x04d3('0x29')]=qs[_0x04d3('0x29')](_0x4582c9[_0x04d3('0x3f')][_0x04d3('0x29')]);}_0x5dbd4f[_0x04d3('0x44')]=qs[_0x04d3('0x45')](_0x4582c9[_0x04d3('0x3f')]['sort']);_0x5dbd4f['where']=qs[_0x04d3('0x46')](_[_0x04d3('0x47')](_0x4582c9[_0x04d3('0x3f')],_0x1c87b0[_0x04d3('0x46')]),_0x52f13d);if(_0x4582c9[_0x04d3('0x3f')][_0x04d3('0x48')]){_0x5dbd4f[_0x04d3('0x49')]=_[_0x04d3('0x4a')](_0x5dbd4f['where'],{'$or':_[_0x04d3('0x3c')](_0x52f13d,function(_0x3f692e){if(_0x3f692e[_0x04d3('0x4b')]!==_0x04d3('0x4c')){var _0x110bb1={};_0x110bb1[_0x3f692e[_0x04d3('0x35')]]={'$like':'%'+_0x4582c9[_0x04d3('0x3f')][_0x04d3('0x48')]+'%'};return _0x110bb1;}})});}_0x5dbd4f=_[_0x04d3('0x4a')]({},_0x5dbd4f,_0x4582c9[_0x04d3('0x4d')]);var _0x4151c2={'where':_0x5dbd4f[_0x04d3('0x49')]};return db['Setting']['count'](_0x4151c2)[_0x04d3('0x1d')](function(_0x1dcba7){_0x3b4a6a['count']=_0x1dcba7;if(_0x4582c9[_0x04d3('0x3f')][_0x04d3('0x4e')]){_0x5dbd4f['include']=[{'all':!![]}];}return db[_0x04d3('0x38')][_0x04d3('0x4f')](_0x5dbd4f);})[_0x04d3('0x1d')](function(_0x55fd92){_0x3b4a6a[_0x04d3('0x50')]=_0x55fd92;return _0x3b4a6a;})[_0x04d3('0x1d')](respondWithFilteredResult(_0x396b15,_0x5dbd4f))[_0x04d3('0x51')](handleError(_0x396b15,null));};exports[_0x04d3('0x52')]=function(_0x4313ab,_0x33aba6){var _0x328b74={'raw':![],'where':{'id':_0x4313ab[_0x04d3('0x53')]['id']}},_0x3ea496={};_0x3ea496[_0x04d3('0x3b')]=_[_0x04d3('0x3d')](db[_0x04d3('0x38')][_0x04d3('0x54')]);_0x3ea496[_0x04d3('0x3f')]=_[_0x04d3('0x3d')](_0x4313ab[_0x04d3('0x3f')]);_0x3ea496[_0x04d3('0x46')]=_[_0x04d3('0x3e')](_0x3ea496['model'],_0x3ea496[_0x04d3('0x3f')]);_0x328b74[_0x04d3('0x40')]=_['intersection'](_0x3ea496[_0x04d3('0x3b')],qs['fields'](_0x4313ab[_0x04d3('0x3f')][_0x04d3('0x41')]));_0x328b74[_0x04d3('0x40')]=_0x328b74[_0x04d3('0x40')]['length']?_0x328b74[_0x04d3('0x40')]:_0x3ea496[_0x04d3('0x3b')];if(_0x4313ab['query'][_0x04d3('0x4e')]){_0x328b74[_0x04d3('0x55')]=[{'all':!![]}];}_0x328b74=_[_0x04d3('0x4a')]({},_0x328b74,_0x4313ab[_0x04d3('0x4d')]);return db[_0x04d3('0x38')][_0x04d3('0x56')](_0x328b74)[_0x04d3('0x1d')](handleEntityNotFound(_0x33aba6,null))['then'](respondWithResult(_0x33aba6,null))[_0x04d3('0x51')](handleError(_0x33aba6,null));};exports[_0x04d3('0x57')]=function(_0x5b6bad,_0x5c4090){if(_0x5b6bad[_0x04d3('0x58')]['id']){delete _0x5b6bad[_0x04d3('0x58')]['id'];}return db[_0x04d3('0x38')][_0x04d3('0x56')]({'where':{'id':_0x5b6bad['params']['id']}})[_0x04d3('0x1d')](handleEntityNotFound(_0x5c4090,null))[_0x04d3('0x1d')](saveUpdates(_0x5b6bad[_0x04d3('0x58')],null))[_0x04d3('0x1d')](respondWithResult(_0x5c4090,null))[_0x04d3('0x51')](handleError(_0x5c4090,null));};exports[_0x04d3('0x59')]=function(_0x5c55f7,_0x21347c,_0x23c982){if(_0x5c55f7['file']&&_0x5c55f7['file']['filename']){_0x5c55f7[_0x04d3('0x58')]['logo']=_0x5c55f7[_0x04d3('0x5a')][_0x04d3('0x5b')];}return db['Setting'][_0x04d3('0x56')]({'where':{'id':_0x5c55f7[_0x04d3('0x53')]['id']}})[_0x04d3('0x1d')](handleEntityNotFound(_0x21347c,null))[_0x04d3('0x1d')](saveUpdates(_0x5c55f7['body'],null))['then'](respondWithResult(_0x21347c,null))[_0x04d3('0x51')](handleError(_0x21347c,null));};exports[_0x04d3('0x5c')]=function(_0x47a69e,_0x4fc08b,_0x553c64){if(_0x47a69e['file']&&_0x47a69e[_0x04d3('0x5a')]['filename']){_0x47a69e['body'][_0x04d3('0x5d')]=_0x47a69e[_0x04d3('0x5a')]['filename'];}return db[_0x04d3('0x38')]['find']({'where':{'id':_0x47a69e[_0x04d3('0x53')]['id']}})[_0x04d3('0x1d')](handleEntityNotFound(_0x4fc08b,null))[_0x04d3('0x1d')](saveUpdates(_0x47a69e[_0x04d3('0x58')],null))[_0x04d3('0x1d')](respondWithResult(_0x4fc08b,null))[_0x04d3('0x51')](handleError(_0x4fc08b,null));};var utilLicense=require(_0x04d3('0x19'));exports['getLogo']=function(_0x2a128f,_0x1f1084,_0x415865){var _0x668a66=_0x04d3('0x5e');var _0x45868c={'custom':![]};return utilLicense[_0x04d3('0x5f')]()[_0x04d3('0x1d')](function(_0x90d084){if(_0x90d084){_0x45868c=_0x90d084;}return db['Setting'][_0x04d3('0x56')]({'where':{'id':_0x2a128f[_0x04d3('0x53')]['id']},'attributes':[_0x04d3('0x60'),'loginLogo',_0x04d3('0x61'),_0x04d3('0x62'),_0x04d3('0x63'),_0x04d3('0x64'),_0x04d3('0x65'),'defaultFavicon'],'raw':!![]});})[_0x04d3('0x1d')](handleEntityNotFound(_0x1f1084,null))[_0x04d3('0x1d')](function(_0x5f498f){if(_0x5f498f){var _0x4950ff=_0x5f498f[_0x04d3('0x60')]&&fs[_0x04d3('0x66')](path['join'](config[_0x04d3('0x67')],_0x668a66,_[_0x04d3('0x68')](_0x5f498f[_0x04d3('0x60')])))?path[_0x04d3('0x69')](config[_0x04d3('0x67')],_0x668a66,_[_0x04d3('0x68')](_0x5f498f['logo'])):path['join'](config[_0x04d3('0x67')],_0x668a66,_[_0x04d3('0x68')](_0x04d3('0x6a')));var _0x2ad861=_0x04d3('0x6b')+_[_0x04d3('0x6c')](_0x04d3('0x60'));if(_0x5f498f[_0x2ad861]||!_0x45868c['custom']){_0x4950ff=path[_0x04d3('0x69')](config[_0x04d3('0x67')],_0x668a66,_[_0x04d3('0x68')](_0x04d3('0x6a')));}if(!fs['existsSync'](_0x4950ff)){throw new db[(_0x04d3('0x6d'))][(_0x04d3('0x6e'))](_['upperFirst'](_0x04d3('0x60'))+'\x20not\x20found');}return _0x1f1084['download'](_0x4950ff);}})[_0x04d3('0x51')](handleError(_0x1f1084,null));};var utilLicense=require('../../config/license/util');exports[_0x04d3('0x6f')]=function(_0x3fc128,_0x151718,_0x2e788b){var _0x83ecf0=_0x04d3('0x5e');var _0x2c4e5c={'custom':![]};return utilLicense['getLicense']()[_0x04d3('0x1d')](function(_0x81e1d4){if(_0x81e1d4){_0x2c4e5c=_0x81e1d4;}return db['Setting'][_0x04d3('0x56')]({'where':{'id':_0x3fc128[_0x04d3('0x53')]['id']},'attributes':[_0x04d3('0x60'),_0x04d3('0x5d'),'preferred','favicon',_0x04d3('0x63'),_0x04d3('0x64'),_0x04d3('0x65'),_0x04d3('0x70')],'raw':!![]});})[_0x04d3('0x1d')](handleEntityNotFound(_0x151718,null))[_0x04d3('0x1d')](function(_0x2d5479){if(_0x2d5479){var _0x1b8112=_0x2d5479[_0x04d3('0x5d')]&&fs[_0x04d3('0x66')](path[_0x04d3('0x69')](config[_0x04d3('0x67')],_0x83ecf0,_[_0x04d3('0x68')](_0x2d5479[_0x04d3('0x5d')])))?path['join'](config['root'],_0x83ecf0,_[_0x04d3('0x68')](_0x2d5479[_0x04d3('0x5d')])):path[_0x04d3('0x69')](config[_0x04d3('0x67')],_0x83ecf0,_['toLower'](_0x04d3('0x71')));var _0x5787dc=_0x04d3('0x6b')+_[_0x04d3('0x6c')](_0x04d3('0x5d'));if(_0x2d5479[_0x5787dc]||!_0x2c4e5c['custom']){_0x1b8112=path[_0x04d3('0x69')](config[_0x04d3('0x67')],_0x83ecf0,_['toLower'](_0x04d3('0x71')));}if(!fs[_0x04d3('0x66')](_0x1b8112)){throw new db[(_0x04d3('0x6d'))][(_0x04d3('0x6e'))](_[_0x04d3('0x6c')](_0x04d3('0x5d'))+_0x04d3('0x72'));}return _0x151718[_0x04d3('0x73')](_0x1b8112);}})[_0x04d3('0x51')](handleError(_0x151718,null));};exports['gdpr']=function(_0xb70291,_0x8166f7){return db[_0x04d3('0x38')][_0x04d3('0x56')]({'where':{'id':_0xb70291['params']['id']},'attributes':[_0x04d3('0x74')]})['then'](respondWithResult(_0x8166f7,null))[_0x04d3('0x51')](handleError(_0x8166f7,null));};exports[_0x04d3('0x75')]=function(_0x291922,_0x2c5a93,_0x398969){if(_0x291922[_0x04d3('0x5a')]&&_0x291922[_0x04d3('0x5a')][_0x04d3('0x5b')]){_0x291922[_0x04d3('0x58')]['preferred']=_0x291922[_0x04d3('0x5a')][_0x04d3('0x5b')];}return db[_0x04d3('0x38')][_0x04d3('0x56')]({'where':{'id':_0x291922['params']['id']}})[_0x04d3('0x1d')](handleEntityNotFound(_0x2c5a93,null))[_0x04d3('0x1d')](saveUpdates(_0x291922[_0x04d3('0x58')],null))[_0x04d3('0x1d')](respondWithResult(_0x2c5a93,null))['catch'](handleError(_0x2c5a93,null));};var utilLicense=require(_0x04d3('0x19'));exports[_0x04d3('0x76')]=function(_0x4de629,_0x2fcd43,_0x302778){var _0x436ae9=_0x04d3('0x5e');var _0x6c2d01={'custom':![]};return utilLicense[_0x04d3('0x5f')]()[_0x04d3('0x1d')](function(_0x54ad6f){if(_0x54ad6f){_0x6c2d01=_0x54ad6f;}return db[_0x04d3('0x38')]['find']({'where':{'id':_0x4de629[_0x04d3('0x53')]['id']},'attributes':[_0x04d3('0x60'),'loginLogo',_0x04d3('0x61'),_0x04d3('0x62'),_0x04d3('0x63'),_0x04d3('0x64'),_0x04d3('0x65'),_0x04d3('0x70')],'raw':!![]});})[_0x04d3('0x1d')](handleEntityNotFound(_0x2fcd43,null))[_0x04d3('0x1d')](function(_0x9ae283){if(_0x9ae283){var _0x3ae078=_0x9ae283[_0x04d3('0x61')]&&fs[_0x04d3('0x66')](path[_0x04d3('0x69')](config['root'],_0x436ae9,_['toLower'](_0x9ae283[_0x04d3('0x61')])))?path[_0x04d3('0x69')](config[_0x04d3('0x67')],_0x436ae9,_[_0x04d3('0x68')](_0x9ae283[_0x04d3('0x61')])):path[_0x04d3('0x69')](config[_0x04d3('0x67')],_0x436ae9,_[_0x04d3('0x68')](_0x04d3('0x77')));var _0x26f52f=_0x04d3('0x6b')+_[_0x04d3('0x6c')](_0x04d3('0x61'));if(_0x9ae283[_0x26f52f]||!_0x6c2d01[_0x04d3('0x78')]||!_0x6c2d01['preferred']){_0x3ae078=path[_0x04d3('0x69')](config[_0x04d3('0x67')],_0x436ae9,_[_0x04d3('0x68')]('default_preferred.png'));}if(!fs['existsSync'](_0x3ae078)){throw new db[(_0x04d3('0x6d'))]['ValidationError'](_[_0x04d3('0x6c')](_0x04d3('0x61'))+_0x04d3('0x72'));}return _0x2fcd43[_0x04d3('0x73')](_0x3ae078);}})['catch'](handleError(_0x2fcd43,null));};exports['addFavicon']=function(_0x520e3f,_0x2b9a07,_0x1bc41b){if(_0x520e3f[_0x04d3('0x5a')]&&_0x520e3f[_0x04d3('0x5a')][_0x04d3('0x5b')]){_0x520e3f['body']['favicon']=_0x520e3f[_0x04d3('0x5a')][_0x04d3('0x5b')];}return db[_0x04d3('0x38')][_0x04d3('0x56')]({'where':{'id':_0x520e3f['params']['id']}})[_0x04d3('0x1d')](handleEntityNotFound(_0x2b9a07,null))[_0x04d3('0x1d')](saveUpdates(_0x520e3f[_0x04d3('0x58')],null))[_0x04d3('0x1d')](respondWithResult(_0x2b9a07,null))[_0x04d3('0x51')](handleError(_0x2b9a07,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x29ddcf,_0x255ea0,_0x32ca45){var _0x53ad2b=_0x04d3('0x5e');var _0x4ab828={'custom':![]};return utilLicense[_0x04d3('0x5f')]()[_0x04d3('0x1d')](function(_0x8c2da5){if(_0x8c2da5){_0x4ab828=_0x8c2da5;}return db[_0x04d3('0x38')]['find']({'where':{'id':_0x29ddcf[_0x04d3('0x53')]['id']},'attributes':[_0x04d3('0x60'),_0x04d3('0x5d'),_0x04d3('0x61'),_0x04d3('0x62'),'defaultLogo',_0x04d3('0x64'),_0x04d3('0x65'),_0x04d3('0x70')],'raw':!![]});})[_0x04d3('0x1d')](handleEntityNotFound(_0x255ea0,null))[_0x04d3('0x1d')](function(_0x26ee7e){if(_0x26ee7e){var _0x15e984=_0x26ee7e[_0x04d3('0x62')]&&fs['existsSync'](path['join'](config['root'],_0x53ad2b,_['toLower'](_0x26ee7e['favicon'])))?path[_0x04d3('0x69')](config[_0x04d3('0x67')],_0x53ad2b,_[_0x04d3('0x68')](_0x26ee7e[_0x04d3('0x62')])):path['join'](config[_0x04d3('0x67')],_0x53ad2b,_['toLower'](_0x04d3('0x79')));var _0x38726a=_0x04d3('0x6b')+_[_0x04d3('0x6c')](_0x04d3('0x62'));if(_0x26ee7e[_0x38726a]||!_0x4ab828['custom']){_0x15e984=path['join'](config[_0x04d3('0x67')],_0x53ad2b,_['toLower'](_0x04d3('0x79')));}if(!fs[_0x04d3('0x66')](_0x15e984)){throw new db[(_0x04d3('0x6d'))][(_0x04d3('0x6e'))](_[_0x04d3('0x6c')](_0x04d3('0x62'))+_0x04d3('0x72'));}return _0x255ea0[_0x04d3('0x73')](_0x15e984);}})['catch'](handleError(_0x255ea0,null));};exports[_0x04d3('0x7a')]=function(_0x2d25d2,_0x152db4){var _0x42d10c={'offset':moment()[_0x04d3('0x7b')]()};_0x42d10c['now']=moment()[_0x04d3('0x7b')](_0x42d10c[_0x04d3('0x29')])[_0x04d3('0x7c')](_0x04d3('0x7d'));return _0x152db4[_0x04d3('0x28')](0xc8)[_0x04d3('0x36')](_0x42d10c);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index a1d5f8f..a3450f5 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 _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x14be3c,_0x224363){var _0x50b92a=function(_0x1456c8){while(--_0x1456c8){_0x14be3c['push'](_0x14be3c['shift']());}};_0x50b92a(++_0x224363);}(_0x34e8,0x12c));var _0x834e=function(_0x4f1146,_0xd03293){_0x4f1146=_0x4f1146-0x0;var _0x4203eb=_0x34e8[_0x4f1146];return _0x4203eb;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0x55ca,0x126));var _0xa55c=function(_0xbced40,_0x2fa5f0){_0xbced40=_0xbced40-0x0;var _0x230f2e=_0x55ca[_0xbced40];return _0x230f2e;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('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 b57d33a..1eb6726 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 _0xd540=['info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','Setting','find','raw','options','where','include','map','attributes','model','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x2c7ce1,_0x3cdd46){var _0x99a890=function(_0x3abc7e){while(--_0x3abc7e){_0x2c7ce1['push'](_0x2c7ce1['shift']());}};_0x99a890(++_0x3cdd46);}(_0xd540,0x155));var _0x0d54=function(_0xd1e6e7,_0x39531c){_0xd1e6e7=_0xd1e6e7-0x0;var _0x425e07=_0xd540[_0xd1e6e7];return _0x425e07;};'use strict';var _=require('lodash');var util=require(_0x0d54('0x0'));var moment=require('moment');var BPromise=require(_0x0d54('0x1'));var rs=require(_0x0d54('0x2'));var fs=require('fs');var Redis=require(_0x0d54('0x3'));var db=require(_0x0d54('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d54('0x5'))(_0x0d54('0x6'));var config=require('../../config/environment');var jayson=require(_0x0d54('0x7'));var client=jayson[_0x0d54('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x915057,_0x143e7e,_0x524cf3){return new BPromise(function(_0x2cb675,_0x3eeacb){return client[_0x0d54('0x9')](_0x915057,_0x524cf3)[_0x0d54('0xa')](function(_0x2106af){logger[_0x0d54('0xb')](_0x0d54('0xc'),_0x143e7e,_0x0d54('0xd'));logger[_0x0d54('0xe')](_0x0d54('0xf'),_0x143e7e,_0x0d54('0xd'),JSON[_0x0d54('0x10')](_0x2106af));if(_0x2106af[_0x0d54('0x11')]){if(_0x2106af['error'][_0x0d54('0x12')]===0x1f4){logger[_0x0d54('0x11')]('Setting,\x20%s,\x20%s',_0x143e7e,_0x2106af[_0x0d54('0x11')][_0x0d54('0x13')]);return _0x3eeacb(_0x2106af[_0x0d54('0x11')][_0x0d54('0x13')]);}logger[_0x0d54('0x11')](_0x0d54('0xc'),_0x143e7e,_0x2106af[_0x0d54('0x11')][_0x0d54('0x13')]);return _0x2cb675(_0x2106af[_0x0d54('0x11')][_0x0d54('0x13')]);}else{logger[_0x0d54('0xb')](_0x0d54('0xc'),_0x143e7e,_0x0d54('0xd'));_0x2cb675(_0x2106af[_0x0d54('0x14')][_0x0d54('0x13')]);}})[_0x0d54('0x15')](function(_0x11b971){logger[_0x0d54('0x11')](_0x0d54('0xc'),_0x143e7e,_0x11b971);_0x3eeacb(_0x11b971);});});}exports[_0x0d54('0x16')]=function(_0x44a17e){var _0x3d99a1=this;return new Promise(function(_0x246639,_0x5c026e){return db[_0x0d54('0x17')][_0x0d54('0x18')]({'raw':_0x44a17e['options']?_0x44a17e['options'][_0x0d54('0x19')]===undefined?!![]:![]:!![],'where':_0x44a17e[_0x0d54('0x1a')]?_0x44a17e[_0x0d54('0x1a')][_0x0d54('0x1b')]||null:null,'attributes':_0x44a17e[_0x0d54('0x1a')]?_0x44a17e[_0x0d54('0x1a')]['attributes']||null:null,'include':_0x44a17e[_0x0d54('0x1a')]?_0x44a17e[_0x0d54('0x1a')][_0x0d54('0x1c')]?_[_0x0d54('0x1d')](_0x44a17e[_0x0d54('0x1a')][_0x0d54('0x1c')],function(_0x3766ff){return{'model':db[_0x3766ff['model']],'as':_0x3766ff['as'],'attributes':_0x3766ff[_0x0d54('0x1e')],'include':_0x3766ff[_0x0d54('0x1c')]?_[_0x0d54('0x1d')](_0x3766ff[_0x0d54('0x1c')],function(_0x59d18f){return{'model':db[_0x59d18f[_0x0d54('0x1f')]],'as':_0x59d18f['as'],'attributes':_0x59d18f[_0x0d54('0x1e')],'include':_0x59d18f[_0x0d54('0x1c')]?_[_0x0d54('0x1d')](_0x59d18f[_0x0d54('0x1c')],function(_0x442f49){return{'model':db[_0x442f49[_0x0d54('0x1f')]],'as':_0x442f49['as'],'attributes':_0x442f49[_0x0d54('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4faa19){logger[_0x0d54('0xb')](_0x0d54('0x16'),_0x44a17e);logger[_0x0d54('0xe')](_0x0d54('0x16'),_0x44a17e,JSON[_0x0d54('0x10')](_0x4faa19));_0x246639(_0x4faa19);})[_0x0d54('0x15')](function(_0x5c4dea){logger[_0x0d54('0x11')](_0x0d54('0x16'),_0x5c4dea[_0x0d54('0x13')],_0x44a17e);_0x5c026e(_0x3d99a1[_0x0d54('0x11')](0x1f4,_0x5c4dea['message']));});});}; \ No newline at end of file +var _0x971d=['message','result','catch','ShowSetting','Setting','find','options','raw','attributes','map','model','include','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','info','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','Setting,\x20%s,\x20%s','error'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x971d,0x140));var _0xd971=function(_0x56c4da,_0x25cd95){_0x56c4da=_0x56c4da-0x0;var _0x202427=_0x971d[_0x56c4da];return _0x202427;};'use strict';var _=require(_0xd971('0x0'));var util=require('util');var moment=require(_0xd971('0x1'));var BPromise=require('bluebird');var rs=require(_0xd971('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd971('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd971('0x4'))(_0xd971('0x5'));var config=require(_0xd971('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd971('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x134562,_0x527713,_0x11b8ee){return new BPromise(function(_0x268734,_0x1f306b){return client['request'](_0x134562,_0x11b8ee)['then'](function(_0x2a13ac){logger[_0xd971('0x8')]('Setting,\x20%s,\x20%s',_0x527713,'request\x20sent');logger[_0xd971('0x9')](_0xd971('0xa'),_0x527713,_0xd971('0xb'),JSON[_0xd971('0xc')](_0x2a13ac));if(_0x2a13ac['error']){if(_0x2a13ac['error'][_0xd971('0xd')]===0x1f4){logger['error'](_0xd971('0xe'),_0x527713,_0x2a13ac[_0xd971('0xf')][_0xd971('0x10')]);return _0x1f306b(_0x2a13ac[_0xd971('0xf')]['message']);}logger[_0xd971('0xf')](_0xd971('0xe'),_0x527713,_0x2a13ac[_0xd971('0xf')][_0xd971('0x10')]);return _0x268734(_0x2a13ac[_0xd971('0xf')][_0xd971('0x10')]);}else{logger[_0xd971('0x8')](_0xd971('0xe'),_0x527713,'request\x20sent');_0x268734(_0x2a13ac[_0xd971('0x11')][_0xd971('0x10')]);}})[_0xd971('0x12')](function(_0x37ab71){logger['error']('Setting,\x20%s,\x20%s',_0x527713,_0x37ab71);_0x1f306b(_0x37ab71);});});}exports[_0xd971('0x13')]=function(_0x4fe602){var _0x16733b=this;return new Promise(function(_0x5d804a,_0x47f47f){return db[_0xd971('0x14')][_0xd971('0x15')]({'raw':_0x4fe602[_0xd971('0x16')]?_0x4fe602[_0xd971('0x16')][_0xd971('0x17')]===undefined?!![]:![]:!![],'where':_0x4fe602[_0xd971('0x16')]?_0x4fe602[_0xd971('0x16')]['where']||null:null,'attributes':_0x4fe602[_0xd971('0x16')]?_0x4fe602[_0xd971('0x16')][_0xd971('0x18')]||null:null,'include':_0x4fe602[_0xd971('0x16')]?_0x4fe602[_0xd971('0x16')]['include']?_[_0xd971('0x19')](_0x4fe602[_0xd971('0x16')]['include'],function(_0xfe4878){return{'model':db[_0xfe4878[_0xd971('0x1a')]],'as':_0xfe4878['as'],'attributes':_0xfe4878['attributes'],'include':_0xfe4878[_0xd971('0x1b')]?_[_0xd971('0x19')](_0xfe4878[_0xd971('0x1b')],function(_0x5a6e04){return{'model':db[_0x5a6e04[_0xd971('0x1a')]],'as':_0x5a6e04['as'],'attributes':_0x5a6e04['attributes'],'include':_0x5a6e04[_0xd971('0x1b')]?_['map'](_0x5a6e04[_0xd971('0x1b')],function(_0x3eaa9e){return{'model':db[_0x3eaa9e[_0xd971('0x1a')]],'as':_0x3eaa9e['as'],'attributes':_0x3eaa9e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f8ab7){logger['info']('ShowSetting',_0x4fe602);logger[_0xd971('0x9')]('ShowSetting',_0x4fe602,JSON[_0xd971('0xc')](_0x3f8ab7));_0x5d804a(_0x3f8ab7);})['catch'](function(_0x9704d7){logger[_0xd971('0xf')](_0xd971('0x13'),_0x9704d7[_0xd971('0x10')],_0x4fe602);_0x47f47f(_0x16733b[_0xd971('0xf')](0x1f4,_0x9704d7[_0xd971('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 28938f3..1fd6068 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x263106,_0x55dae4){var _0x562b8a=function(_0x3eb79b){while(--_0x3eb79b){_0x263106['push'](_0x263106['shift']());}};_0x562b8a(++_0x55dae4);}(_0x7a54,0x106));var _0x47a5=function(_0x4a6e87,_0x5cb305){_0x4a6e87=_0x4a6e87-0x0;var _0x5cbe52=_0x7a54[_0x4a6e87];return _0x5cbe52;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x447c68,_0x3a84b8){var _0x25fff8=function(_0x285ec3){while(--_0x285ec3){_0x447c68['push'](_0x447c68['shift']());}};_0x25fff8(++_0x3a84b8);}(_0x7a54,0x106));var _0x47a5=function(_0x46463f,_0x11a979){_0x46463f=_0x46463f-0x0;var _0x50cf5b=_0x7a54[_0x46463f];return _0x50cf5b;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 052b8a7..2df9694 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 _0x88d6=['ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','csc','intelepeer','BOOLEAN','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','mandatoryDisposition','sequelize','randomstring','STRING'];(function(_0x448774,_0x45ddc7){var _0x46b2f6=function(_0x1dee94){while(--_0x1dee94){_0x448774['push'](_0x448774['shift']());}};_0x46b2f6(++_0x45ddc7);}(_0x88d6,0xb1));var _0x688d=function(_0x177c53,_0x338988){_0x177c53=_0x177c53-0x0;var _0x124d65=_0x88d6[_0x177c53];return _0x124d65;};'use strict';var Sequelize=require(_0x688d('0x0'));var rs=require(_0x688d('0x1'));module['exports']={'name':{'type':Sequelize[_0x688d('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x688d('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x688d('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x688d('0x3')](_0x688d('0x4'),_0x688d('0x5'),_0x688d('0x6'),_0x688d('0x7'),_0x688d('0x8'),_0x688d('0x9'),'bandwidth',_0x688d('0xa'),'infobip',_0x688d('0xb'))},'accountSid':{'type':Sequelize[_0x688d('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x688d('0x2')]},'smsMethod':{'type':Sequelize[_0x688d('0x3')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x688d('0x2')]},'apiKey':{'type':Sequelize[_0x688d('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x688d('0x2')]},'senderString':{'type':Sequelize[_0x688d('0x2')]},'deliveryReport':{'type':Sequelize[_0x688d('0xc')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x688d('0xd');}},'notificationSound':{'type':Sequelize[_0x688d('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x688d('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x688d('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x688d('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x688d('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x688d('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x688d('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x688d('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x688d('0xe')],'comment':_0x688d('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x688d('0xc')],'defaultValue':![],'comment':_0x688d('0x10'),'set':function(_0x4e44a6){if(!_0x4e44a6)this[_0x688d('0x11')](_0x688d('0x12'),null);this[_0x688d('0x11')](_0x688d('0x13'),_0x4e44a6);}}}; \ No newline at end of file +var _0xad42=['setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','connectel','clicksend','plivo','clickatell','bandwidth','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0xac5e76,_0x2684c5){var _0x5c8bba=function(_0x125a6a){while(--_0x125a6a){_0xac5e76['push'](_0xac5e76['shift']());}};_0x5c8bba(++_0x2684c5);}(_0xad42,0x178));var _0x2ad4=function(_0x50e2e4,_0x5e2d1c){_0x50e2e4=_0x50e2e4-0x0;var _0x4864cd=_0xad42[_0x50e2e4];return _0x4864cd;};'use strict';var Sequelize=require(_0x2ad4('0x0'));var rs=require(_0x2ad4('0x1'));module[_0x2ad4('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x2ad4('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x2ad4('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x2ad4('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2ad4('0x6')](_0x2ad4('0x7'),'skebby',_0x2ad4('0x8'),_0x2ad4('0x9'),_0x2ad4('0xa'),_0x2ad4('0xb'),_0x2ad4('0xc'),'csc',_0x2ad4('0xd'),_0x2ad4('0xe'))},'accountSid':{'type':Sequelize[_0x2ad4('0x4')]},'authId':{'type':Sequelize[_0x2ad4('0x4')]},'authToken':{'type':Sequelize[_0x2ad4('0x4')]},'smsMethod':{'type':Sequelize[_0x2ad4('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2ad4('0x4')]},'apiKey':{'type':Sequelize[_0x2ad4('0x4')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x2ad4('0x4')]},'senderString':{'type':Sequelize[_0x2ad4('0x4')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x2ad4('0x4')]},'notificationTemplate':{'type':Sequelize[_0x2ad4('0xf')],'defaultValue':function(){return _0x2ad4('0x10');}},'notificationSound':{'type':Sequelize[_0x2ad4('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2ad4('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2ad4('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2ad4('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2ad4('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2ad4('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x2ad4('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2ad4('0x11')],'defaultValue':![],'comment':_0x2ad4('0x13'),'set':function(_0xbb5b6c){if(!_0xbb5b6c)this[_0x2ad4('0x14')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x2ad4('0x15'),_0xbb5b6c);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index aba07dd..d383e42 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 _0x6984=['Content-Range','apply','save','destroy','get','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','hasOwnProperty','nolimit','order','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','SmsApplication','Applications','account','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','ListId','twilio','from','From','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','list','omit','SmsInteraction','interaction','created','autoclose','applications','close','unmanaged','SmsMessage','ContactId','UserId','User','unshift','agent','*,*,*,*','queueId','SmsQueue','waitForTheAssignedQueue','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','priority','finally','getApplications','Contact','Owner','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','Messages','spread','dataValues','push','inspect','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','redif','update','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','limit','count','set'];(function(_0xd347b0,_0x300564){var _0xc75d7=function(_0xa3d982){while(--_0xa3d982){_0xd347b0['push'](_0xd347b0['shift']());}};_0xc75d7(++_0x300564);}(_0x6984,0x19a));var _0x4698=function(_0x1225af,_0x397de5){_0x1225af=_0x1225af-0x0;var _0x282b81=_0x6984[_0x1225af];return _0x282b81;};'use strict';var emlformat=require(_0x4698('0x0'));var rimraf=require(_0x4698('0x1'));var zipdir=require(_0x4698('0x2'));var jsonpatch=require(_0x4698('0x3'));var rp=require(_0x4698('0x4'));var moment=require('moment');var BPromise=require(_0x4698('0x5'));var Mustache=require(_0x4698('0x6'));var util=require('util');var path=require(_0x4698('0x7'));var sox=require(_0x4698('0x8'));var csv=require(_0x4698('0x9'));var ejs=require(_0x4698('0xa'));var fs=require('fs');var fs_extra=require(_0x4698('0xb'));var _=require(_0x4698('0xc'));var squel=require(_0x4698('0xd'));var crypto=require('crypto');var jsforce=require(_0x4698('0xe'));var deskjs=require(_0x4698('0xf'));var toCsv=require(_0x4698('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4698('0x10'));var authService=require(_0x4698('0x11'));var qs=require(_0x4698('0x12'));var as=require(_0x4698('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4698('0x14'))(_0x4698('0x15'));var utils=require(_0x4698('0x16'));var config=require(_0x4698('0x17'));var licenseUtil=require(_0x4698('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4698('0x19')](config[_0x4698('0x1a')],{'host':_0x4698('0x1b'),'port':0x18eb});var socket=require(_0x4698('0x1c'))(new Redis(config['redis']));require(_0x4698('0x1d'))['register'](socket);var jayson=require(_0x4698('0x1e'));var client=jayson[_0x4698('0x1f')][_0x4698('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x15ba72,_0x34eba9,_0x23462a,_0x18b8b3){return new BPromise(function(_0x1ee3fa,_0x44e5fb){var _0xf96c31=_0x18b8b3||client;return _0xf96c31[_0x4698('0x21')](_0x15ba72,_0x23462a)[_0x4698('0x22')](function(_0x2de691){logger[_0x4698('0x23')](_0x4698('0x24'),_0x34eba9,_0x4698('0x25'));logger[_0x4698('0x26')](_0x4698('0x27'),_0x34eba9,_0x4698('0x25'),JSON['stringify'](_0x2de691));if(_0x2de691[_0x4698('0x28')]){if(_0x2de691[_0x4698('0x28')]['code']===0x1f4){logger['error'](_0x4698('0x24'),_0x34eba9,_0x2de691[_0x4698('0x28')][_0x4698('0x29')]);return _0x44e5fb(_0x2de691[_0x4698('0x28')]['message']);}logger[_0x4698('0x28')]('SmsAccount,\x20%s,\x20%s',_0x34eba9,_0x2de691[_0x4698('0x28')][_0x4698('0x29')]);return _0x1ee3fa(_0x2de691[_0x4698('0x28')][_0x4698('0x29')]);}else{logger[_0x4698('0x23')]('SmsAccount,\x20%s,\x20%s',_0x34eba9,_0x4698('0x25'));_0x1ee3fa(_0x2de691[_0x4698('0x2a')][_0x4698('0x29')]);}})[_0x4698('0x2b')](function(_0x3a097a){logger[_0x4698('0x28')](_0x4698('0x24'),_0x34eba9,_0x3a097a);_0x44e5fb(_0x3a097a);});});}function respondWithStatusCode(_0xb061ba,_0x1feda0){_0x1feda0=_0x1feda0||0xcc;return function(_0x30e5ca){if(_0x30e5ca){return _0xb061ba[_0x4698('0x2c')](_0x1feda0);}return _0xb061ba[_0x4698('0x2d')](_0x1feda0)[_0x4698('0x2e')]();};}function respondWithResult(_0x555f48,_0x13ee1c){_0x13ee1c=_0x13ee1c||0xc8;return function(_0x5c7009){if(_0x5c7009){return _0x555f48[_0x4698('0x2d')](_0x13ee1c)[_0x4698('0x2f')](_0x5c7009);}};}function respondWithFilteredResult(_0x50a1b9,_0x20016a){return function(_0xcf0005){if(_0xcf0005){var _0x26c523=typeof _0x20016a[_0x4698('0x30')]==='undefined'&&typeof _0x20016a[_0x4698('0x31')]==='undefined';var _0x26ab8a=_0xcf0005[_0x4698('0x32')];var _0x9739e2=_0x26c523?0x0:_0x20016a[_0x4698('0x30')];var _0x47ede1=_0x26c523?_0xcf0005[_0x4698('0x32')]:_0x20016a[_0x4698('0x30')]+_0x20016a['limit'];var _0x3561d4;if(_0x47ede1>=_0x26ab8a){_0x47ede1=_0x26ab8a;_0x3561d4=0xc8;}else{_0x3561d4=0xce;}_0x50a1b9[_0x4698('0x2d')](_0x3561d4);return _0x50a1b9[_0x4698('0x33')](_0x4698('0x34'),_0x9739e2+'-'+_0x47ede1+'/'+_0x26ab8a)['json'](_0xcf0005);}return null;};}function patchUpdates(_0x1e5a50){return function(_0x1bbc5e){try{jsonpatch[_0x4698('0x35')](_0x1bbc5e,_0x1e5a50,!![]);}catch(_0x12000b){return BPromise['reject'](_0x12000b);}return _0x1bbc5e[_0x4698('0x36')]();};}function saveUpdates(_0x42f371,_0x55173f){return function(_0x2fa456){if(_0x2fa456){return _0x2fa456['update'](_0x42f371)[_0x4698('0x22')](function(_0x384552){return _0x384552;});}return null;};}function removeEntity(_0x15c406,_0x458d91){return function(_0x2f0aba){if(_0x2f0aba){return _0x2f0aba[_0x4698('0x37')]()[_0x4698('0x22')](function(){var _0x48d3bf=_0x2f0aba[_0x4698('0x38')]({'plain':!![]});var _0x34ec77=_0x4698('0x39');return db['UserProfileResource'][_0x4698('0x37')]({'where':{'type':_0x34ec77,'resourceId':_0x48d3bf['id']}})[_0x4698('0x22')](function(){return _0x2f0aba;});})[_0x4698('0x22')](function(){_0x15c406[_0x4698('0x2d')](0xcc)[_0x4698('0x2e')]();});}};}function handleEntityNotFound(_0x13435a,_0x17282c){return function(_0x12eee9){if(!_0x12eee9){_0x13435a[_0x4698('0x2c')](0x194);}return _0x12eee9;};}function handleError(_0x3898cc,_0x5167d8){_0x5167d8=_0x5167d8||0x1f4;return function(_0x46d1e3){logger[_0x4698('0x28')](_0x46d1e3[_0x4698('0x3a')]);if(_0x46d1e3[_0x4698('0x3b')]){delete _0x46d1e3[_0x4698('0x3b')];}_0x3898cc[_0x4698('0x2d')](_0x5167d8)[_0x4698('0x3c')](_0x46d1e3);};}exports[_0x4698('0x3d')]=function(_0xcaaac,_0x35032f){var _0x4770c3={'include':[{'model':db[_0x4698('0x3e')],'as':_0x4698('0x3f')}]},_0x5060df={},_0x4765eb={'count':0x0,'rows':[]};var _0x16f03c=_[_0x4698('0x40')](db[_0x4698('0x41')][_0x4698('0x42')],function(_0x2e9bbc){return{'name':_0x2e9bbc[_0x4698('0x43')],'type':_0x2e9bbc[_0x4698('0x44')][_0x4698('0x45')]};});_0x5060df[_0x4698('0x46')]=_[_0x4698('0x40')](_0x16f03c,_0x4698('0x3b'));_0x5060df[_0x4698('0x47')]=_[_0x4698('0x48')](_0xcaaac[_0x4698('0x47')]);_0x5060df[_0x4698('0x49')]=_[_0x4698('0x4a')](_0x5060df['model'],_0x5060df[_0x4698('0x47')]);_0x4770c3[_0x4698('0x4b')]=_[_0x4698('0x4a')](_0x5060df[_0x4698('0x46')],qs['fields'](_0xcaaac[_0x4698('0x47')]['fields']));_0x4770c3[_0x4698('0x4b')]=_0x4770c3[_0x4698('0x4b')][_0x4698('0x4c')]?_0x4770c3['attributes']:_0x5060df[_0x4698('0x46')];if(!_0xcaaac[_0x4698('0x47')]['hasOwnProperty']('nolimit')){_0x4770c3['limit']=qs[_0x4698('0x31')](_0xcaaac['query'][_0x4698('0x31')]);_0x4770c3[_0x4698('0x30')]=qs['offset'](_0xcaaac[_0x4698('0x47')][_0x4698('0x30')]);}_0x4770c3['order']=qs[_0x4698('0x4d')](_0xcaaac[_0x4698('0x47')][_0x4698('0x4d')]);_0x4770c3['where']=qs[_0x4698('0x49')](_[_0x4698('0x4e')](_0xcaaac[_0x4698('0x47')],_0x5060df[_0x4698('0x49')]),_0x16f03c);if(_0xcaaac[_0x4698('0x47')][_0x4698('0x4f')]){_0x4770c3[_0x4698('0x50')]=_[_0x4698('0x51')](_0x4770c3[_0x4698('0x50')],{'$or':_[_0x4698('0x40')](_0x16f03c,function(_0x4a70bc){if(_0x4a70bc['type']!==_0x4698('0x52')){var _0x3da7bb={};_0x3da7bb[_0x4a70bc[_0x4698('0x3b')]]={'$like':'%'+_0xcaaac[_0x4698('0x47')][_0x4698('0x4f')]+'%'};return _0x3da7bb;}})});}_0x4770c3=_['merge']({},_0x4770c3,_0xcaaac['options']);var _0x9f3929={'where':_0x4770c3[_0x4698('0x50')]};return db[_0x4698('0x41')][_0x4698('0x32')](_0x9f3929)['then'](function(_0x1eb1ec){_0x4765eb[_0x4698('0x32')]=_0x1eb1ec;if(_0xcaaac[_0x4698('0x47')][_0x4698('0x53')]){_0x4770c3[_0x4698('0x54')]=[{'all':!![]}];}return db[_0x4698('0x41')][_0x4698('0x55')](_0x4770c3);})[_0x4698('0x22')](function(_0x57e9da){_0x4765eb[_0x4698('0x56')]=_0x57e9da;return _0x4765eb;})['then'](respondWithFilteredResult(_0x35032f,_0x4770c3))['catch'](handleError(_0x35032f,null));};exports['show']=function(_0x28c2a4,_0x3a0f16){var _0x11fdb3={'raw':![],'where':{'id':_0x28c2a4['params']['id']},'include':[{'model':db[_0x4698('0x3e')],'as':'mandatoryDispositionPause'}]},_0x57a9ff={};_0x57a9ff[_0x4698('0x46')]=_[_0x4698('0x48')](db[_0x4698('0x41')][_0x4698('0x42')]);_0x57a9ff[_0x4698('0x47')]=_[_0x4698('0x48')](_0x28c2a4[_0x4698('0x47')]);_0x57a9ff[_0x4698('0x49')]=_[_0x4698('0x4a')](_0x57a9ff[_0x4698('0x46')],_0x57a9ff['query']);_0x11fdb3[_0x4698('0x4b')]=_[_0x4698('0x4a')](_0x57a9ff[_0x4698('0x46')],qs[_0x4698('0x57')](_0x28c2a4['query'][_0x4698('0x57')]));_0x11fdb3[_0x4698('0x4b')]=_0x11fdb3[_0x4698('0x4b')][_0x4698('0x4c')]?_0x11fdb3[_0x4698('0x4b')]:_0x57a9ff[_0x4698('0x46')];if(_0x28c2a4[_0x4698('0x47')][_0x4698('0x53')]){_0x11fdb3[_0x4698('0x54')]=[{'all':!![]}];}_0x11fdb3=_[_0x4698('0x51')]({},_0x11fdb3,_0x28c2a4[_0x4698('0x58')]);return db[_0x4698('0x41')][_0x4698('0x59')](_0x11fdb3)['then'](handleEntityNotFound(_0x3a0f16,null))['then'](respondWithResult(_0x3a0f16,null))[_0x4698('0x2b')](handleError(_0x3a0f16,null));};exports[_0x4698('0x5a')]=function(_0x451131,_0x562c70){return db[_0x4698('0x41')][_0x4698('0x5a')](_0x451131[_0x4698('0x5b')],{})[_0x4698('0x22')](function(_0x4bfaa0){var _0x3f4f9e=_0x451131[_0x4698('0x5c')][_0x4698('0x38')]({'plain':!![]});if(!_0x3f4f9e)throw new Error(_0x4698('0x5d'));if(_0x3f4f9e['role']==='user'){var _0x5f0bac=_0x4bfaa0[_0x4698('0x38')]({'plain':!![]});var _0x44dba1=_0x4698('0x39');return db['UserProfileSection'][_0x4698('0x59')]({'where':{'name':_0x44dba1,'userProfileId':_0x3f4f9e[_0x4698('0x5e')]},'raw':!![]})[_0x4698('0x22')](function(_0x2e1a16){if(_0x2e1a16&&_0x2e1a16[_0x4698('0x5f')]===0x0){return db[_0x4698('0x60')][_0x4698('0x5a')]({'name':_0x5f0bac[_0x4698('0x3b')],'resourceId':_0x5f0bac['id'],'type':_0x2e1a16[_0x4698('0x3b')],'sectionId':_0x2e1a16['id']},{})[_0x4698('0x22')](function(){return _0x4bfaa0;});}else{return _0x4bfaa0;}})['catch'](function(_0x285432){logger[_0x4698('0x28')](_0x4698('0x61'),_0x285432);throw _0x285432;});}return _0x4bfaa0;})[_0x4698('0x22')](respondWithResult(_0x562c70,0xc9))[_0x4698('0x2b')](handleError(_0x562c70,null));};exports['update']=function(_0x1ebddf,_0x1d33e6){if(_0x1ebddf[_0x4698('0x5b')]['id']){delete _0x1ebddf[_0x4698('0x5b')]['id'];}return db[_0x4698('0x41')][_0x4698('0x59')]({'where':{'id':_0x1ebddf[_0x4698('0x62')]['id']},'include':[{'model':db[_0x4698('0x3e')],'as':_0x4698('0x3f')}]})[_0x4698('0x22')](handleEntityNotFound(_0x1d33e6,null))[_0x4698('0x22')](saveUpdates(_0x1ebddf[_0x4698('0x5b')],null))[_0x4698('0x22')](respondWithResult(_0x1d33e6,null))['catch'](handleError(_0x1d33e6,null));};exports[_0x4698('0x37')]=function(_0x2f5479,_0x317367){return db[_0x4698('0x41')][_0x4698('0x59')]({'where':{'id':_0x2f5479[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x317367,null))[_0x4698('0x22')](removeEntity(_0x317367,null))[_0x4698('0x2b')](handleError(_0x317367,null));};exports[_0x4698('0x63')]=function(_0x4d4965,_0x24519d){return db[_0x4698('0x41')][_0x4698('0x63')]()[_0x4698('0x22')](respondWithResult(_0x24519d,null))[_0x4698('0x2b')](handleError(_0x24519d,null));};exports[_0x4698('0x64')]=function(_0xbb025e,_0x261571,_0x1b4ca4){if(_0xbb025e['body']['id']){delete _0xbb025e[_0x4698('0x5b')]['id'];}return db[_0x4698('0x41')]['find']({'where':{'id':_0xbb025e[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x261571,null))[_0x4698('0x22')](function(_0x1e928b){if(_0x1e928b){_0xbb025e[_0x4698('0x5b')][_0x4698('0x65')]=_0x1e928b['id'];return db[_0x4698('0x66')][_0x4698('0x5a')](_0xbb025e[_0x4698('0x5b')]);}})[_0x4698('0x22')](respondWithResult(_0x261571,null))[_0x4698('0x2b')](handleError(_0x261571,null));};exports[_0x4698('0x67')]=function(_0x44aea8,_0x3f23ee,_0x2726f1){var _0x2b1962={'raw':![],'where':{}};var _0x465752={};var _0x56a86b={'count':0x0,'rows':[]};return db[_0x4698('0x41')]['findOne']({'where':{'id':_0x44aea8[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x3f23ee,null))[_0x4698('0x22')](function(_0x36845c){if(_0x36845c){_0x465752['model']=_['keys'](db[_0x4698('0x66')]['rawAttributes']);_0x465752[_0x4698('0x47')]=_[_0x4698('0x48')](_0x44aea8['query']);_0x465752[_0x4698('0x49')]=_[_0x4698('0x4a')](_0x465752[_0x4698('0x46')],_0x465752['query']);_0x2b1962[_0x4698('0x4b')]=_[_0x4698('0x4a')](_0x465752['model'],qs['fields'](_0x44aea8['query']['fields']));_0x2b1962[_0x4698('0x4b')]=_0x2b1962[_0x4698('0x4b')][_0x4698('0x4c')]?_0x2b1962[_0x4698('0x4b')]:_0x465752[_0x4698('0x46')];if(!_0x44aea8['query'][_0x4698('0x68')](_0x4698('0x69'))){_0x2b1962[_0x4698('0x31')]=qs[_0x4698('0x31')](_0x44aea8[_0x4698('0x47')][_0x4698('0x31')]);_0x2b1962[_0x4698('0x30')]=qs[_0x4698('0x30')](_0x44aea8[_0x4698('0x47')][_0x4698('0x30')]);}_0x2b1962[_0x4698('0x6a')]=qs[_0x4698('0x4d')](_0x44aea8[_0x4698('0x47')][_0x4698('0x4d')]);_0x2b1962[_0x4698('0x50')]=qs[_0x4698('0x49')](_['pick'](_0x44aea8[_0x4698('0x47')],_0x465752[_0x4698('0x49')]));_0x2b1962['where'][_0x4698('0x65')]=_0x36845c['id'];if(_0x44aea8[_0x4698('0x47')][_0x4698('0x4f')]){_0x2b1962[_0x4698('0x50')]=_[_0x4698('0x51')](_0x2b1962[_0x4698('0x50')],{'$or':_[_0x4698('0x40')](_0x2b1962['attributes'],function(_0x477a0a){var _0x3ac78c={};_0x3ac78c[_0x477a0a]={'$like':'%'+_0x44aea8['query'][_0x4698('0x4f')]+'%'};return _0x3ac78c;})});}_0x2b1962=_[_0x4698('0x51')]({},_0x2b1962,_0x44aea8[_0x4698('0x58')]);return db[_0x4698('0x66')][_0x4698('0x32')]({'where':_0x2b1962[_0x4698('0x50')]})[_0x4698('0x22')](function(_0x5b842d){_0x56a86b[_0x4698('0x32')]=_0x5b842d;if(_0x44aea8[_0x4698('0x47')][_0x4698('0x53')]){_0x2b1962[_0x4698('0x54')]=[{'all':!![]}];}return db[_0x4698('0x66')][_0x4698('0x55')](_0x2b1962);})[_0x4698('0x22')](function(_0x2b587e){_0x56a86b[_0x4698('0x56')]=_0x2b587e;return _0x56a86b;});}})[_0x4698('0x22')](respondWithFilteredResult(_0x3f23ee,_0x2b1962))[_0x4698('0x2b')](handleError(_0x3f23ee,null));};exports['removeDispositions']=function(_0x36be47,_0x4fd19c,_0x1f4e1c){return db['SmsAccount'][_0x4698('0x59')]({'where':{'id':_0x36be47[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x4fd19c,null))['then'](function(_0x1e644c){if(_0x1e644c){return _0x1e644c['removeDispositions'](_0x36be47['query'][_0x4698('0x6b')]);}})[_0x4698('0x22')](respondWithStatusCode(_0x4fd19c,null))['catch'](handleError(_0x4fd19c,null));};exports[_0x4698('0x6c')]=function(_0x1c9182,_0x4934fa,_0x36adff){if(_0x1c9182[_0x4698('0x5b')]['id']){delete _0x1c9182[_0x4698('0x5b')]['id'];}return db[_0x4698('0x41')][_0x4698('0x59')]({'where':{'id':_0x1c9182[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x4934fa,null))[_0x4698('0x22')](function(_0x55d4a7){if(_0x55d4a7){_0x1c9182[_0x4698('0x5b')][_0x4698('0x65')]=_0x55d4a7['id'];return db[_0x4698('0x6d')]['create'](_0x1c9182[_0x4698('0x5b')]);}})[_0x4698('0x22')](respondWithResult(_0x4934fa,null))[_0x4698('0x2b')](handleError(_0x4934fa,null));};exports[_0x4698('0x6e')]=function(_0x31015b,_0x215c47,_0x353320){var _0x3d7e42={'raw':![],'where':{}};var _0x21503e={};var _0x1d98f4={'count':0x0,'rows':[]};return db[_0x4698('0x41')][_0x4698('0x6f')]({'where':{'id':_0x31015b[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x215c47,null))[_0x4698('0x22')](function(_0x51af73){if(_0x51af73){_0x21503e[_0x4698('0x46')]=_[_0x4698('0x48')](db[_0x4698('0x6d')][_0x4698('0x42')]);_0x21503e['query']=_[_0x4698('0x48')](_0x31015b[_0x4698('0x47')]);_0x21503e[_0x4698('0x49')]=_[_0x4698('0x4a')](_0x21503e[_0x4698('0x46')],_0x21503e[_0x4698('0x47')]);_0x3d7e42[_0x4698('0x4b')]=_[_0x4698('0x4a')](_0x21503e[_0x4698('0x46')],qs[_0x4698('0x57')](_0x31015b['query'][_0x4698('0x57')]));_0x3d7e42['attributes']=_0x3d7e42[_0x4698('0x4b')][_0x4698('0x4c')]?_0x3d7e42['attributes']:_0x21503e[_0x4698('0x46')];if(!_0x31015b[_0x4698('0x47')][_0x4698('0x68')](_0x4698('0x69'))){_0x3d7e42[_0x4698('0x31')]=qs[_0x4698('0x31')](_0x31015b['query']['limit']);_0x3d7e42[_0x4698('0x30')]=qs[_0x4698('0x30')](_0x31015b[_0x4698('0x47')][_0x4698('0x30')]);}_0x3d7e42['order']=qs[_0x4698('0x4d')](_0x31015b['query'][_0x4698('0x4d')]);_0x3d7e42[_0x4698('0x50')]=qs[_0x4698('0x49')](_[_0x4698('0x4e')](_0x31015b[_0x4698('0x47')],_0x21503e[_0x4698('0x49')]));_0x3d7e42[_0x4698('0x50')][_0x4698('0x65')]=_0x51af73['id'];if(_0x31015b['query']['filter']){_0x3d7e42[_0x4698('0x50')]=_['merge'](_0x3d7e42['where'],{'$or':_['map'](_0x3d7e42[_0x4698('0x4b')],function(_0x2ce624){var _0xa4675b={};_0xa4675b[_0x2ce624]={'$like':'%'+_0x31015b[_0x4698('0x47')]['filter']+'%'};return _0xa4675b;})});}_0x3d7e42=_[_0x4698('0x51')]({},_0x3d7e42,_0x31015b[_0x4698('0x58')]);return db[_0x4698('0x6d')][_0x4698('0x32')]({'where':_0x3d7e42['where']})[_0x4698('0x22')](function(_0x2d9bab){_0x1d98f4[_0x4698('0x32')]=_0x2d9bab;if(_0x31015b[_0x4698('0x47')][_0x4698('0x53')]){_0x3d7e42[_0x4698('0x54')]=[{'all':!![]}];}return db[_0x4698('0x6d')][_0x4698('0x55')](_0x3d7e42);})[_0x4698('0x22')](function(_0x27a176){_0x1d98f4[_0x4698('0x56')]=_0x27a176;return _0x1d98f4;});}})[_0x4698('0x22')](respondWithFilteredResult(_0x215c47,_0x3d7e42))[_0x4698('0x2b')](handleError(_0x215c47,null));};exports[_0x4698('0x70')]=function(_0x298071,_0x2d7cf3,_0x27239b){return db[_0x4698('0x41')]['find']({'where':{'id':_0x298071[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x2d7cf3,null))[_0x4698('0x22')](function(_0x428d03){if(_0x428d03){return _0x428d03[_0x4698('0x70')](_0x298071['query'][_0x4698('0x6b')]);}})['then'](respondWithStatusCode(_0x2d7cf3,null))[_0x4698('0x2b')](handleError(_0x2d7cf3,null));};exports[_0x4698('0x71')]=function(_0x1400c1,_0x3cfb21,_0x2d4428){var _0xa7ee29={'channel':'sms'};var _0x20a717=[];var _0x1bd65f=[];var _0x5be254={};return db['SmsAccount'][_0x4698('0x59')]({'where':{'id':_0x1400c1[_0x4698('0x62')]['id']},'include':[{'model':db[_0x4698('0x72')],'as':_0x4698('0x73')}]})[_0x4698('0x22')](handleEntityNotFound(_0x3cfb21,null))[_0x4698('0x22')](function(_0x775705){_0xa7ee29[_0x4698('0x74')]=_0x775705;_0xa7ee29['applications']=_[_0x4698('0x75')](_0x775705[_0x4698('0x73')],['priority'],[_0x4698('0x76')]);if(_0xa7ee29[_0x4698('0x74')]['Applications']){delete _0xa7ee29[_0x4698('0x74')][_0x4698('0x73')];}return db[_0x4698('0x77')][_0x4698('0x63')]();})[_0x4698('0x22')](function(_0xb9fd79){if(!_0xb9fd79){throw new db[(_0x4698('0x78'))][(_0x4698('0x79'))](_0x4698('0x7a'));}_0x20a717=_[_0x4698('0x7b')](_['keys'](_0xb9fd79),['createdAt','updatedAt']);_0x1bd65f=_[_0x4698('0x7b')](_[_0x4698('0x48')](_0xb9fd79),[_0x4698('0x7c'),'updatedAt','CompanyId',_0x4698('0x7d')]);_0xa7ee29['body']={'mapKey':'mobile'};if(_0xa7ee29[_0x4698('0x74')][_0x4698('0x44')]){switch(_0xa7ee29[_0x4698('0x74')][_0x4698('0x44')]){case _0x4698('0x7e'):_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x80')];_0xa7ee29['body']['body']=_0x1400c1['body']['Body'];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x81')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x82')];break;case _0x4698('0x83'):_0xa7ee29[_0x4698('0x5b')]['from']='+'+_0x1400c1[_0x4698('0x5b')][_0x4698('0x84')];_0xa7ee29[_0x4698('0x5b')]['body']=_0x1400c1[_0x4698('0x5b')][_0x4698('0x85')];break;case _0x4698('0x86'):_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')]=_0x1400c1[_0x4698('0x5b')]['from'];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x29')];break;case _0x4698('0x87'):_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')]=_0x1400c1[_0x4698('0x5b')]['from'];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x5b')];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x81')]=_0x1400c1['body'][_0x4698('0x88')];break;case _0x4698('0x89'):_0xa7ee29['body'][_0x4698('0x7f')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x80')];_0xa7ee29['body'][_0x4698('0x5b')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x8a')];_0xa7ee29[_0x4698('0x5b')]['messageId']=_0x1400c1[_0x4698('0x5b')][_0x4698('0x8b')];break;case'infobip':_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')]='+'+_0x1400c1[_0x4698('0x5b')][_0x4698('0x8c')][0x0][_0x4698('0x7f')];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')]=_0x1400c1['body'][_0x4698('0x8c')][0x0][_0x4698('0x85')];_0xa7ee29[_0x4698('0x5b')]['messageId']=_0x1400c1[_0x4698('0x5b')][_0x4698('0x8c')][0x0][_0x4698('0x81')];break;case _0x4698('0x8d'):_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x8e')];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x8f')][_0x4698('0x29')];break;case _0x4698('0x90'):_0xa7ee29['body'][_0x4698('0x7f')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x91')];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x85')];_0xa7ee29['body'][_0x4698('0x81')]=_0x1400c1['body']['replyMessageId'];break;case _0x4698('0x92'):_0xa7ee29[_0x4698('0x5b')][_0x4698('0x81')]=_0x1400c1[_0x4698('0x5b')][0x0]['message']['id'];_0xa7ee29[_0x4698('0x5b')]['from']=_0x1400c1['body'][0x0]['message'][_0x4698('0x7f')];_0xa7ee29[_0x4698('0x5b')]['body']=_0x1400c1['body'][0x0]['message']['text'];break;case _0x4698('0x93'):_0xa7ee29['body'][_0x4698('0x7f')]=_0x1400c1['body'][_0x4698('0x7f')];_0xa7ee29['body'][_0x4698('0x5b')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x29')];_0xa7ee29[_0x4698('0x5b')]['messageId']=_0x1400c1[_0x4698('0x5b')][_0x4698('0x94')];break;}}if(_0xa7ee29[_0x4698('0x5b')]['id']){delete _0xa7ee29[_0x4698('0x5b')]['id'];}if(_[_0x4698('0x95')](_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')])){throw new db[(_0x4698('0x78'))]['ValidationError'](_0x4698('0x96'));}if(_[_0x4698('0x95')](_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')])||_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')]===''){throw new db[(_0x4698('0x78'))][(_0x4698('0x79'))](_0x4698('0x97'));}if(_[_0x4698('0x95')](_0xa7ee29[_0x4698('0x5b')][_0x4698('0x98')])){throw new db['Sequelize'][(_0x4698('0x79'))](_0x4698('0x99')+_0x1bd65f);}if(!_[_0x4698('0x9a')](_0x1bd65f,_0xa7ee29[_0x4698('0x5b')][_0x4698('0x98')])){throw new db[(_0x4698('0x78'))][(_0x4698('0x79'))](_0x4698('0x9b')+_0x1bd65f);}_0x5be254[_0xa7ee29[_0x4698('0x5b')][_0x4698('0x98')]]=_0xa7ee29[_0x4698('0x5b')]['from'];return db[_0x4698('0x9c')][_0x4698('0x59')]({'where':{'id':_0xa7ee29[_0x4698('0x74')][_0x4698('0x7d')]},'include':[{'model':db[_0x4698('0x77')],'as':_0x4698('0x9d'),'where':_0x5be254,'limit':0x1,'order':[[_0x4698('0x9e'),_0x4698('0x9f')]]}]});})[_0x4698('0x22')](handleEntityNotFound(_0x3cfb21,null))[_0x4698('0x22')](function(_0x427c4c){if(_0x427c4c){_0xa7ee29[_0x4698('0xa0')]=_[_0x4698('0xa1')](_0x427c4c,[_0x4698('0x9d')]);if(_0x427c4c[_0x4698('0x9d')][_0x4698('0x4c')]){return _0x427c4c[_0x4698('0x9d')][0x0];}var _0x47284f=_[_0x4698('0x19')](_0xa7ee29[_0x4698('0x5b')],{'firstName':_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')],'ListId':_0x427c4c['id']});_0x47284f[_0xa7ee29['body'][_0x4698('0x98')]]=_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')];return db['CmContact'][_0x4698('0x5a')](_0x47284f,{'fields':_0x20a717,'raw':!![]});}})[_0x4698('0x22')](handleEntityNotFound(_0x3cfb21,null))[_0x4698('0x22')](function(_0xd1089c){if(_0xd1089c){_0xa7ee29['contact']=_0xd1089c;var _0x2b54cb={'ContactId':_0xd1089c['id'],'phone':_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')],'SmsAccountId':_0x1400c1[_0x4698('0x62')]['id']};var _0x130842={'ContactId':_0xd1089c['id'],'SmsAccountId':_0x1400c1[_0x4698('0x62')]['id'],'closed':![]};return db[_0x4698('0xa2')][_0x4698('0x59')]({'where':_0x130842})['then'](function(_0x4513b8){if(_0x4513b8){return[_0x4513b8,![]];}return db[_0x4698('0xa2')]['create'](_0x2b54cb)[_0x4698('0x22')](function(_0x20d733){return[_0x20d733,!![]];});});}})['spread'](function(_0xa1c1c3,_0x116f8e){_0xa7ee29[_0x4698('0xa3')]=_0xa1c1c3[_0x4698('0x38')]({'plain':!![]});_0xa7ee29[_0x4698('0xa3')][_0x4698('0xa4')]=![];if(_0x116f8e){if(_0xa7ee29[_0x4698('0x74')][_0x4698('0xa5')]){_0xa7ee29[_0x4698('0xa6')]['push']({'id':0x0,'priority':_0xa7ee29['applications']['length']+0x1,'app':_0x4698('0xa7'),'appdata':_0x4698('0xa8'),'interval':'*,*,*,*'});}_0xa7ee29[_0x4698('0xa3')][_0x4698('0xa4')]=!![];}return db[_0x4698('0xa9')][_0x4698('0x5a')]({'phone':_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')],'messageId':_0xa7ee29[_0x4698('0x5b')][_0x4698('0x81')],'body':_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')],'SmsAccountId':_0x1400c1[_0x4698('0x62')]['id'],'SmsInteractionId':_0xa1c1c3['id'],'direction':'in','ContactId':_0xa1c1c3[_0x4698('0xaa')],'AttachmentId':_0xa7ee29[_0x4698('0x5b')]['AttachmentId']});})['then'](function(_0x48ee7d){_0xa7ee29[_0x4698('0x29')]=_0x48ee7d;if(!_0xa7ee29['interaction'][_0x4698('0xab')])return;return db[_0x4698('0xac')]['find']({'attributes':['id',_0x4698('0x3b')],'where':{'id':_0xa7ee29[_0x4698('0xa3')][_0x4698('0xab')]}});})[_0x4698('0x22')](function(_0x4be5d6){if(_0x4be5d6){_0xa7ee29[_0x4698('0xa6')][_0x4698('0xad')]({'id':0x0,'priority':0x0,'app':_0x4698('0xae'),'appdata':_0x4be5d6[_0x4698('0x3b')]+','+(_0xa7ee29[_0x4698('0x74')]['waitForTheAssignedAgent']||0xa),'interval':_0x4698('0xaf')});}if(!_0xa7ee29[_0x4698('0xa3')][_0x4698('0xb0')])return;return db[_0x4698('0xb1')][_0x4698('0x59')]({'attributes':['id',_0x4698('0x3b')],'where':{'id':_0xa7ee29[_0x4698('0xa3')][_0x4698('0xb0')]}});})[_0x4698('0x22')](function(_0x541ebd){if(_0x541ebd){_0xa7ee29[_0x4698('0xa6')][_0x4698('0xad')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x541ebd[_0x4698('0x3b')]+','+(_0xa7ee29[_0x4698('0x74')][_0x4698('0xb2')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4698('0xb3'),_0x4698('0xb4'),_0xa7ee29);})[_0x4698('0x22')](function(_0x2ca819){if(_0x2ca819){var _0x27fccb=0xc8;var _0x263a19='receiveMessage';logger['info'](_0x4698('0x27'),_0x263a19,_0x27fccb,_0x4698('0xb5'));logger[_0x4698('0x26')](_0x4698('0xb6'),_0x263a19,_0x27fccb,_0x4698('0xb5'),JSON['stringify'](_0x2ca819));if(_0xa7ee29[_0x4698('0x74')][_0x4698('0x44')]===_0x4698('0x7e')){return _0x3cfb21[_0x4698('0x2d')](_0x27fccb)[_0x4698('0x33')](_0x4698('0xb7'),_0x4698('0xb8'))[_0x4698('0x3c')](_0x4698('0xb9'));}else{return _0x3cfb21[_0x4698('0x2d')](_0x27fccb)[_0x4698('0x2f')](_0x2ca819);}}})[_0x4698('0x2b')](handleError(_0x3cfb21,null));};exports['addApplications']=function(_0x3b76c3,_0x3e2954){var _0x59d634=_0x3b76c3['params']['id'];var _0x46571c=_0x3b76c3['body'];var _0x5c612b=0xc8;var _0x209d20=null;return db[_0x4698('0xba')][_0x4698('0xbb')]({'isolationLevel':db[_0x4698('0xba')]['Transaction'][_0x4698('0xbc')][_0x4698('0xbd')]},function(_0x29f5f3){return db[_0x4698('0x41')][_0x4698('0x6f')]({'where':{'id':_0x59d634},'transaction':_0x29f5f3})[_0x4698('0x22')](function(_0x1e88ab){if(_0x1e88ab){return db[_0x4698('0x72')][_0x4698('0x37')]({'where':{'SmsAccountId':_0x59d634},'transaction':_0x29f5f3})['then'](function(){var _0x59a424=_[_0x4698('0x40')](_0x46571c,function(_0xfa43d1){_0xfa43d1['SmsAccountId']=_0x59d634;return _0xfa43d1;});return db[_0x4698('0x72')][_0x4698('0xbe')](_0x59a424,{'transaction':_0x29f5f3});});}else{_0x5c612b=0x194;_0x209d20=[];}});})['then'](function(){if(_0x5c612b!==0x194){return db[_0x4698('0x72')]['findAndCountAll']({'where':{'SmsAccountId':_0x59d634},'order':_0x4698('0xbf')})[_0x4698('0x22')](function(_0x3852dc){_0x209d20=_0x3852dc;});}})['catch'](function(_0x2b333c){_0x5c612b=0x1f4;logger[_0x4698('0x28')](_0x2b333c['stack']);if(_0x2b333c[_0x4698('0x3b')]){delete _0x2b333c[_0x4698('0x3b')];}_0x209d20=_0x2b333c;})[_0x4698('0xc0')](function(){if(_0x209d20===null){_0x3e2954[_0x4698('0x2c')](_0x5c612b);}else{if(_0x5c612b===0x1f4){_0x3e2954[_0x4698('0x2d')](_0x5c612b)['send'](_0x209d20);}else{_0x3e2954[_0x4698('0x2d')](_0x5c612b)['json'](_0x209d20);}}});};exports[_0x4698('0xc1')]=function(_0x4993b5,_0x51f39b,_0x5e561e){var _0x13fb35={};var _0x21273a={};var _0xc66f49;var _0x7d0095;return db[_0x4698('0x41')][_0x4698('0x6f')]({'where':{'id':_0x4993b5[_0x4698('0x62')]['id']}})['then'](handleEntityNotFound(_0x51f39b,null))[_0x4698('0x22')](function(_0x2bf1bd){if(_0x2bf1bd){_0xc66f49=_0x2bf1bd;_0x21273a[_0x4698('0x46')]=_[_0x4698('0x48')](db[_0x4698('0x72')]['rawAttributes']);_0x21273a['query']=_[_0x4698('0x48')](_0x4993b5[_0x4698('0x47')]);_0x21273a[_0x4698('0x49')]=_[_0x4698('0x4a')](_0x21273a[_0x4698('0x46')],_0x21273a[_0x4698('0x47')]);_0x13fb35['attributes']=_[_0x4698('0x4a')](_0x21273a[_0x4698('0x46')],qs['fields'](_0x4993b5['query'][_0x4698('0x57')]));_0x13fb35[_0x4698('0x4b')]=_0x13fb35[_0x4698('0x4b')]['length']?_0x13fb35['attributes']:_0x21273a['model'];_0x13fb35[_0x4698('0x6a')]=qs[_0x4698('0x4d')](_0x4993b5[_0x4698('0x47')]['sort']);_0x13fb35[_0x4698('0x50')]=qs[_0x4698('0x49')](_[_0x4698('0x4e')](_0x4993b5[_0x4698('0x47')],_0x21273a[_0x4698('0x49')]));if(_0x4993b5[_0x4698('0x47')][_0x4698('0x4f')]){_0x13fb35[_0x4698('0x50')]=_[_0x4698('0x51')](_0x13fb35[_0x4698('0x50')],{'$or':_['map'](_0x13fb35[_0x4698('0x4b')],function(_0x4014a7){var _0x2b4d4f={};_0x2b4d4f[_0x4014a7]={'$like':'%'+_0x4993b5[_0x4698('0x47')]['filter']+'%'};return _0x2b4d4f;})});}_0x13fb35=_[_0x4698('0x51')]({},_0x13fb35,_0x4993b5[_0x4698('0x58')]);return _0xc66f49['getApplications'](_0x13fb35);}})[_0x4698('0x22')](function(_0x8ae9a8){if(_0x8ae9a8){_0x7d0095=_0x8ae9a8[_0x4698('0x4c')];if(!_0x4993b5[_0x4698('0x47')]['hasOwnProperty'](_0x4698('0x69'))){_0x13fb35[_0x4698('0x31')]=qs['limit'](_0x4993b5['query'][_0x4698('0x31')]);_0x13fb35[_0x4698('0x30')]=qs['offset'](_0x4993b5['query']['offset']);}return _0xc66f49['getApplications'](_0x13fb35);}})[_0x4698('0x22')](function(_0x9db3d0){if(_0x9db3d0){return _0x9db3d0?{'count':_0x7d0095,'rows':_0x9db3d0}:null;}})[_0x4698('0x22')](respondWithResult(_0x51f39b,null))[_0x4698('0x2b')](handleError(_0x51f39b,null));};exports['getInteractions']=function(_0x1c20ec,_0x4f0967,_0x22c321){var _0x165bf7={'raw':![],'where':{}};var _0x267f7b={};var _0x4a9fbc={'count':0x0,'rows':[]};return db[_0x4698('0x41')]['findOne']({'where':{'id':_0x1c20ec[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x4f0967,null))[_0x4698('0x22')](function(_0x3b00fd){if(_0x3b00fd){_0x267f7b[_0x4698('0x46')]=_[_0x4698('0x48')](db[_0x4698('0xa2')][_0x4698('0x42')]);_0x267f7b[_0x4698('0x47')]=_[_0x4698('0x48')](_0x1c20ec[_0x4698('0x47')]);_0x267f7b[_0x4698('0x49')]=_[_0x4698('0x4a')](_0x267f7b['model'],_0x267f7b[_0x4698('0x47')]);_0x165bf7['attributes']=_['intersection'](_0x267f7b[_0x4698('0x46')],qs[_0x4698('0x57')](_0x1c20ec[_0x4698('0x47')][_0x4698('0x57')]));_0x165bf7[_0x4698('0x4b')]=_0x165bf7['attributes'][_0x4698('0x4c')]?_0x165bf7['attributes']:_0x267f7b[_0x4698('0x46')];if(!_0x1c20ec['query']['hasOwnProperty']('nolimit')){_0x165bf7[_0x4698('0x31')]=qs[_0x4698('0x31')](_0x1c20ec['query'][_0x4698('0x31')]);_0x165bf7[_0x4698('0x30')]=qs[_0x4698('0x30')](_0x1c20ec['query'][_0x4698('0x30')]);}_0x165bf7['order']=qs[_0x4698('0x4d')](_0x1c20ec[_0x4698('0x47')][_0x4698('0x4d')]);_0x165bf7['where']=qs[_0x4698('0x49')](_[_0x4698('0x4e')](_0x1c20ec['query'],_0x267f7b['filters']));_0x165bf7['where'][_0x4698('0x65')]=_0x3b00fd['id'];if(_0x1c20ec[_0x4698('0x47')]['filter']){_0x165bf7['where']=_['merge'](_0x165bf7[_0x4698('0x50')],{'$or':_['map'](_0x165bf7['attributes'],function(_0x38d962){var _0xf41e08={};_0xf41e08[_0x38d962]={'$like':'%'+_0x1c20ec[_0x4698('0x47')][_0x4698('0x4f')]+'%'};return _0xf41e08;})});}_0x165bf7=_[_0x4698('0x51')]({},_0x165bf7,_0x1c20ec[_0x4698('0x58')]);return db['SmsInteraction'][_0x4698('0x32')]({'where':_0x165bf7[_0x4698('0x50')]})[_0x4698('0x22')](function(_0x1b20a1){_0x4a9fbc[_0x4698('0x32')]=_0x1b20a1;if(_0x1c20ec['query'][_0x4698('0x53')]){_0x165bf7[_0x4698('0x54')]=[{'model':db[_0x4698('0x77')],'as':_0x4698('0xc2'),'required':![]},{'model':db[_0x4698('0xac')],'as':_0x4698('0xc3'),'attributes':[_0x4698('0x3b'),_0x4698('0xc4'),_0x4698('0xc5')],'required':![]},{'model':db['Tag'],'as':_0x4698('0xc6'),'attributes':['id',_0x4698('0x3b'),_0x4698('0xc7')],'where':_0x1c20ec[_0x4698('0x47')][_0x4698('0xc8')]?{'id':_0x1c20ec['query'][_0x4698('0xc8')]}:undefined,'required':_0x1c20ec[_0x4698('0x47')]['tag']?!![]:![]}];}return db[_0x4698('0xa2')][_0x4698('0x55')](_0x165bf7);})[_0x4698('0x22')](function(_0x2e82a9){_0x4a9fbc[_0x4698('0x56')]=_0x2e82a9;return _0x4a9fbc;});}})[_0x4698('0x22')](respondWithFilteredResult(_0x4f0967,_0x165bf7))['catch'](handleError(_0x4f0967,null));};exports[_0x4698('0x3c')]=function(_0x4c3085,_0x41cdf4,_0x1e08e2){var _0x4f762d,_0x428381,_0x293b8;if(_[_0x4698('0x95')](_0x4c3085[_0x4698('0x5b')]['body'])||_0x4c3085[_0x4698('0x5b')]['body']===''){throw new db[(_0x4698('0x78'))][(_0x4698('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4698('0x95')](_0x4c3085['body']['to'])){throw new db[(_0x4698('0x78'))][(_0x4698('0x79'))](_0x4698('0xc9'));}_0x4f762d=_0x4c3085['body']['to'];return db['SmsAccount']['find']({'where':{'id':_0x4c3085[_0x4698('0x62')]['id']},'include':[{'model':db[_0x4698('0x9c')],'as':_0x4698('0xca'),'include':[{'model':db['CmContact'],'as':_0x4698('0x9d'),'where':{'mobile':_0x4f762d},'limit':0x1,'order':[['updatedAt',_0x4698('0x9f')]]}]}]})['then'](handleEntityNotFound(_0x41cdf4,null))[_0x4698('0x22')](function(_0x64d0d2){if(_0x64d0d2&&_0x64d0d2[_0x4698('0xca')]){_0x428381=_0x64d0d2[_0x4698('0x38')]({'plain':!![]});if(_0x428381['List']&&_0x428381[_0x4698('0xca')]['Contacts'][_0x4698('0x4c')]){return _0x428381[_0x4698('0xca')][_0x4698('0x9d')][0x0];}return db[_0x4698('0x77')][_0x4698('0x5a')](_['defaults'](_0x4c3085[_0x4698('0x5b')],{'firstName':_0x4f762d,'mobile':_0x4f762d,'phone':_0x4f762d,'ListId':_0x428381[_0x4698('0x7d')]}));}})[_0x4698('0x22')](handleEntityNotFound(_0x41cdf4,null))[_0x4698('0x22')](function(_0x5152cd){if(_0x5152cd){_0x293b8=_0x5152cd;return db[_0x4698('0xa2')][_0x4698('0x59')]({'where':{'ContactId':_0x293b8['id'],'closed':![],'SmsAccountId':_0x428381['id']}})['then'](function(_0xd1ce2e){if(_0xd1ce2e){return[_0xd1ce2e,![]];}return db[_0x4698('0xa2')][_0x4698('0x5a')]({'UserId':_0x4c3085['user']['id'],'ContactId':_0x293b8['id'],'SmsAccountId':_0x428381['id'],'phone':_0x4f762d,'firstMsgDirection':'out','Messages':[_['merge'](_0x4c3085[_0x4698('0x5b')],{'read':![],'body':_0x4c3085['body']['body'],'phone':_0x4f762d,'SmsAccountId':_0x428381['id'],'UserId':_0x4c3085[_0x4698('0x5c')]['id'],'ContactId':_0x293b8['id']})]},{'include':[{'model':db[_0x4698('0xa9')],'as':_0x4698('0xcb')}]})[_0x4698('0x22')](function(_0x209ac2){return[_0x209ac2,!![]];});});}})[_0x4698('0xcc')](function(_0x12adbc,_0x4108d8){if(_0x4108d8){return _0x12adbc;}return db['SmsMessage'][_0x4698('0x5a')](_[_0x4698('0x51')](_0x4c3085[_0x4698('0x5b')],{'read':![],'body':_0x4c3085[_0x4698('0x5b')]['body'],'phone':_0x4f762d,'SmsAccountId':_0x428381['id'],'SmsInteractionId':_0x12adbc['id'],'UserId':_0x4c3085[_0x4698('0x5c')]['id'],'ContactId':_0x293b8['id']}))['then'](function(_0x184934){_0x12adbc[_0x4698('0xcd')][_0x4698('0xcb')]=[];_0x12adbc[_0x4698('0xcd')]['Messages'][_0x4698('0xce')](_0x184934['dataValues']);return _0x12adbc;});})[_0x4698('0x22')](respondWithResult(_0x41cdf4,null))[_0x4698('0x2b')](handleError(_0x41cdf4,null));};exports[_0x4698('0x2d')]=function(_0x47ae2d,_0x309851,_0x5364d4){if(_0x47ae2d[_0x4698('0x5b')]['id']){delete _0x47ae2d[_0x4698('0x5b')]['id'];}var _0x3ce5d2,_0x5243c2,_0x31dd97;return db[_0x4698('0x41')][_0x4698('0x59')]({'where':{'id':_0x47ae2d[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x309851,null))[_0x4698('0x22')](function(_0x34de5a){if(_0x34de5a){_0x31dd97=_0x34de5a;logger[_0x4698('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4698('0x2d'),'received\x20delivery\x20report\x20from',_0x34de5a['type'],util[_0x4698('0xcf')](_0x47ae2d[_0x4698('0x5b')],{'showHidden':![],'depth':null}));switch(_0x34de5a['type']){case _0x4698('0x83'):if(_0x47ae2d[_0x4698('0x5b')][_0x4698('0xd0')]&&_0x47ae2d[_0x4698('0x5b')]['status']){_0x5243c2=_0x47ae2d['body'][_0x4698('0x2d')];return db[_0x4698('0xa9')]['find']({'where':{'messageId':_0x47ae2d['body'][_0x4698('0xd0')]}});}break;case _0x4698('0x86'):if(_0x47ae2d[_0x4698('0x5b')][_0x4698('0xd1')]&&_0x47ae2d['body'][_0x4698('0xd2')]){_0x5243c2=_0x47ae2d[_0x4698('0x5b')][_0x4698('0xd2')];return db[_0x4698('0xa9')][_0x4698('0x59')]({'where':{'messageId':_0x47ae2d[_0x4698('0x5b')]['requestid']}});}break;case _0x4698('0x87'):if(_0x47ae2d['body'][_0x4698('0x88')]&&_0x47ae2d[_0x4698('0x5b')][_0x4698('0xd3')]){_0x5243c2=_0x47ae2d['body'][_0x4698('0xd3')];return db[_0x4698('0xa9')][_0x4698('0x59')]({'where':{'messageId':_0x47ae2d['body'][_0x4698('0x88')]}});}break;case _0x4698('0xd4'):var _0x23e87e=_0x47ae2d[_0x4698('0x5b')][_0x4698('0x8c')][0x0];if(_0x23e87e['messageId']&&_0x23e87e[_0x4698('0x2d')][_0x4698('0xd5')]===_0x4698('0xd6')){_0x5243c2=_0x23e87e[_0x4698('0x2d')][_0x4698('0xd5')];return db[_0x4698('0xa9')]['find']({'where':{'messageId':_0x23e87e[_0x4698('0x81')]}});}break;case'clickatell':if(_0x47ae2d[_0x4698('0x5b')][_0x4698('0x81')]&&_0x47ae2d['body'][_0x4698('0x2d')]){_0x5243c2=_0x47ae2d[_0x4698('0x5b')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x47ae2d[_0x4698('0x5b')][_0x4698('0x81')]}});}break;case _0x4698('0x92'):if(_0x47ae2d[_0x4698('0x5b')][0x0][_0x4698('0x29')]['id']){_0x5243c2=_0x47ae2d[_0x4698('0x5b')][0x0]['type'];return db[_0x4698('0xa9')][_0x4698('0x59')]({'where':{'messageId':_0x47ae2d[_0x4698('0x5b')][0x0][_0x4698('0x29')]['id']}});}break;case'intelepeer':if(_0x47ae2d['body'][_0x4698('0xd7')]&&_0x47ae2d['body'][_0x4698('0x2d')]){_0x5243c2=_0x47ae2d[_0x4698('0x5b')]['status'];return db[_0x4698('0xa9')][_0x4698('0x59')]({'where':{'messageId':_0x47ae2d[_0x4698('0x5b')][_0x4698('0xd7')]}});}break;}}})[_0x4698('0x22')](handleEntityNotFound(_0x309851,null))[_0x4698('0x22')](function(_0x273ae1){if(_0x273ae1){_0x3ce5d2=_0x273ae1;switch(_0x31dd97[_0x4698('0x44')]){case _0x4698('0x83'):if(_0x5243c2==='DELIVERED'){return _0x3ce5d2[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')](_0x4698('0x27'),_0x4698('0x2d'),_0x4698('0x83'),util[_0x4698('0xcf')](_0x47ae2d[_0x4698('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4698('0x86'):if(_0x5243c2==='1'){return _0x3ce5d2[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')](_0x4698('0x27'),_0x4698('0x2d'),_0x4698('0x83'),util[_0x4698('0xcf')](_0x47ae2d['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x47ae2d['body']['error_code']&&_0x5243c2>=0xc8&&_0x5243c2<=0xce){return _0x3ce5d2[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')](_0x4698('0x27'),_0x4698('0x2d'),_0x4698('0x87'),util[_0x4698('0xcf')](_0x47ae2d[_0x4698('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4698('0xd4'):var _0x2d046f=_0x47ae2d[_0x4698('0x5b')][_0x4698('0x8c')][0x0];if(_0x2d046f[_0x4698('0x2d')][_0x4698('0xd5')]===_0x4698('0xd6')){return _0x3ce5d2[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4698('0x2d'),_0x4698('0xd4'),util[_0x4698('0xcf')](_0x47ae2d['body'],{'showHidden':![],'depth':null}));}break;case _0x4698('0x90'):if(_0x5243c2==_0x4698('0xd9')||_0x5243c2==_0x4698('0xda')){return _0x3ce5d2['update']({'read':!![]});}else{logger[_0x4698('0x28')](_0x4698('0x27'),_0x4698('0x2d'),_0x4698('0x90'),util[_0x4698('0xcf')](_0x47ae2d['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x5243c2=='message-delivered'){return _0x3ce5d2[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4698('0x2d'),_0x4698('0x92'),util[_0x4698('0xcf')](_0x47ae2d[_0x4698('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4698('0x93'):if(_0x5243c2===_0x4698('0xdb')||_0x5243c2==='ACCEPTD'){return _0x3ce5d2[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')](_0x4698('0x27'),_0x4698('0x2d'),_0x4698('0x93'),util[_0x4698('0xcf')](_0x47ae2d[_0x4698('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x3ce5d2;}})[_0x4698('0x22')](respondWithResult(_0x309851,null))[_0x4698('0x2b')](handleError(_0x309851,null));};exports[_0x4698('0xdc')]=function(_0x4f61df,_0x302d59,_0x5c0a18){var _0x50bc9b,_0x22e24e,_0x509397;return db['SmsAccount'][_0x4698('0x59')]({'where':{'id':_0x4f61df[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x302d59,null))[_0x4698('0x22')](function(_0x385a5a){if(_0x385a5a){_0x509397=_0x385a5a;logger[_0x4698('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4698('0x2d'),_0x4698('0xdd'),_0x385a5a[_0x4698('0x44')],util[_0x4698('0xcf')](_0x4f61df['query'],{'showHidden':![],'depth':null}));switch(_0x385a5a['type']){case'csc':if(_0x4f61df[_0x4698('0x47')][_0x4698('0xde')]&&_0x4f61df[_0x4698('0x47')][_0x4698('0xdf')]){_0x22e24e=_0x4f61df[_0x4698('0x47')]['state'];return db[_0x4698('0xa9')][_0x4698('0x59')]({'where':{'messageId':_0x4f61df[_0x4698('0x47')]['message-id']}});}break;}}})[_0x4698('0x22')](handleEntityNotFound(_0x302d59,null))[_0x4698('0x22')](function(_0x19d3ee){if(_0x19d3ee){_0x50bc9b=_0x19d3ee;switch(_0x509397[_0x4698('0x44')]){case _0x4698('0x8d'):if(_0x22e24e==='2'||_0x22e24e==='6'){return _0x50bc9b[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')](_0x4698('0x27'),_0x4698('0x2d'),_0x4698('0x8d'),util['inspect'](_0x4f61df[_0x4698('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x50bc9b;}})[_0x4698('0x22')](respondWithResult(_0x302d59,null))[_0x4698('0x2b')](handleError(_0x302d59,null));};exports[_0x4698('0xe0')]=function(_0x59790f,_0xc0a3ce,_0x1183d1){return db['SmsAccount'][_0x4698('0x59')]({'where':{'id':_0x59790f[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0xc0a3ce,null))[_0x4698('0x22')](function(_0x681ca6){if(_0x681ca6){return _0x681ca6[_0x4698('0xe0')](_0x59790f[_0x4698('0x5b')][_0x4698('0x6b')],_[_0x4698('0xa1')](_0x59790f[_0x4698('0x5b')],[_0x4698('0x6b'),'id'])||{})[_0x4698('0xcc')](function(_0x40d00e){for(var _0x4ffbf0=0x0;_0x4ffbf0<_0x59790f[_0x4698('0x5b')][_0x4698('0x6b')][_0x4698('0x4c')];_0x4ffbf0+=0x1){socket[_0x4698('0xe1')](_0x4698('0xe2'),{'UserId':Number(_0x59790f[_0x4698('0x5b')][_0x4698('0x6b')][_0x4ffbf0]),'SmsAccountId':Number(_0x59790f[_0x4698('0x62')]['id'])});}return _0x40d00e;});}})['then'](respondWithResult(_0xc0a3ce,null))[_0x4698('0x2b')](handleError(_0xc0a3ce,null));};exports['removeAgents']=function(_0x4057bc,_0x43b4bc,_0xbc6674){return db['SmsAccount']['find']({'where':{'id':_0x4057bc[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x43b4bc,null))['then'](function(_0x2caf7c){if(_0x2caf7c){return _0x2caf7c[_0x4698('0xe3')](_0x4057bc['query']['ids'])[_0x4698('0x22')](function(){if(_[_0x4698('0xe4')](_0x4057bc[_0x4698('0x47')]['ids'])){for(var _0x36b9f1=0x0;_0x36b9f1<_0x4057bc[_0x4698('0x47')]['ids']['length'];_0x36b9f1+=0x1){socket['emit'](_0x4698('0xe5'),{'UserId':Number(_0x4057bc['query'][_0x4698('0x6b')][_0x36b9f1]),'SmsAccountId':Number(_0x4057bc[_0x4698('0x62')]['id'])});}}else{socket[_0x4698('0xe1')]('userSmsAccount:remove',{'UserId':Number(_0x4057bc[_0x4698('0x47')][_0x4698('0x6b')]),'SmsAccountId':Number(_0x4057bc['params']['id'])});}});}})[_0x4698('0x22')](respondWithStatusCode(_0x43b4bc,null))[_0x4698('0x2b')](handleError(_0x43b4bc,null));};exports['getAgents']=function(_0x3c1d25,_0x2e1096,_0x586a16){var _0x1c0197={};var _0x1ab18c={};var _0x4c838f;var _0x124631;return db[_0x4698('0x41')][_0x4698('0x6f')]({'where':{'id':_0x3c1d25[_0x4698('0x62')]['id']}})['then'](handleEntityNotFound(_0x2e1096,null))[_0x4698('0x22')](function(_0x10b943){if(_0x10b943){_0x4c838f=_0x10b943;_0x1ab18c[_0x4698('0x46')]=_['keys'](db[_0x4698('0xac')][_0x4698('0x42')]);_0x1ab18c[_0x4698('0x47')]=_[_0x4698('0x48')](_0x3c1d25[_0x4698('0x47')]);_0x1ab18c[_0x4698('0x49')]=_['intersection'](_0x1ab18c[_0x4698('0x46')],_0x1ab18c['query']);_0x1c0197[_0x4698('0x4b')]=_[_0x4698('0x4a')](_0x1ab18c[_0x4698('0x46')],qs['fields'](_0x3c1d25['query'][_0x4698('0x57')]));_0x1c0197[_0x4698('0x4b')]=_0x1c0197[_0x4698('0x4b')][_0x4698('0x4c')]?_0x1c0197[_0x4698('0x4b')]:_0x1ab18c['model'];_0x1c0197[_0x4698('0x6a')]=qs[_0x4698('0x4d')](_0x3c1d25[_0x4698('0x47')]['sort']);_0x1c0197['where']=qs['filters'](_[_0x4698('0x4e')](_0x3c1d25[_0x4698('0x47')],_0x1ab18c['filters']));if(_0x3c1d25[_0x4698('0x47')][_0x4698('0x4f')]){_0x1c0197[_0x4698('0x50')]=_[_0x4698('0x51')](_0x1c0197[_0x4698('0x50')],{'$or':_[_0x4698('0x40')](_0x1c0197[_0x4698('0x4b')],function(_0x1a6817){var _0x2e1d7c={};_0x2e1d7c[_0x1a6817]={'$like':'%'+_0x3c1d25[_0x4698('0x47')][_0x4698('0x4f')]+'%'};return _0x2e1d7c;})});}_0x1c0197=_['merge']({},_0x1c0197,_0x3c1d25[_0x4698('0x58')]);return _0x4c838f[_0x4698('0xe6')](_0x1c0197);}})[_0x4698('0x22')](function(_0x362e6f){if(_0x362e6f){_0x124631=_0x362e6f[_0x4698('0x4c')];if(!_0x3c1d25[_0x4698('0x47')][_0x4698('0x68')](_0x4698('0x69'))){_0x1c0197['limit']=qs[_0x4698('0x31')](_0x3c1d25[_0x4698('0x47')][_0x4698('0x31')]);_0x1c0197[_0x4698('0x30')]=qs[_0x4698('0x30')](_0x3c1d25[_0x4698('0x47')][_0x4698('0x30')]);}return _0x4c838f[_0x4698('0xe6')](_0x1c0197);}})[_0x4698('0x22')](function(_0x18b88f){if(_0x18b88f){return _0x18b88f?{'count':_0x124631,'rows':_0x18b88f}:null;}})[_0x4698('0x22')](respondWithResult(_0x2e1096,null))['catch'](handleError(_0x2e1096,null));}; \ No newline at end of file +var _0xbd7b=['reject','save','update','destroy','get','stack','name','send','index','mandatoryDispositionPause','map','SmsAccount','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','Pause','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getDispositions','findOne','Disposition','pick','SmsAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','SmsApplication','Applications','account','applications','orderBy','priority','asc','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','Body','messageId','MessageSid','from','sender','text','clicksend','plivo','From','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','omit','defaults','contact','SmsInteraction','spread','interaction','autoclose','push','close','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','User','Owner','fullname','Tag','Tags','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','inspect','skebby','skebby_dispatch_id','connectel','statusInt','requestid','message_id','status_code','DELIVERED','groupName','redif','infobip','clickatell','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','sendStatus','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x55958f,_0x59842f){var _0x57745a=function(_0x40f40c){while(--_0x40f40c){_0x55958f['push'](_0x55958f['shift']());}};_0x57745a(++_0x59842f);}(_0xbd7b,0x1b2));var _0xbbd7=function(_0x36eb7f,_0x57dca4){_0x36eb7f=_0x36eb7f-0x0;var _0x50023b=_0xbd7b[_0x36eb7f];return _0x50023b;};'use strict';var emlformat=require(_0xbbd7('0x0'));var rimraf=require(_0xbbd7('0x1'));var zipdir=require(_0xbbd7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbd7('0x3'));var moment=require(_0xbbd7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbbd7('0x5'));var util=require(_0xbbd7('0x6'));var path=require(_0xbbd7('0x7'));var sox=require(_0xbbd7('0x8'));var csv=require(_0xbbd7('0x9'));var ejs=require(_0xbbd7('0xa'));var fs=require('fs');var fs_extra=require(_0xbbd7('0xb'));var _=require(_0xbbd7('0xc'));var squel=require(_0xbbd7('0xd'));var crypto=require(_0xbbd7('0xe'));var jsforce=require(_0xbbd7('0xf'));var deskjs=require(_0xbbd7('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbbd7('0x11'));var Papa=require(_0xbbd7('0x12'));var Redis=require(_0xbbd7('0x13'));var authService=require(_0xbbd7('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbbd7('0x15'))(_0xbbd7('0x16'));var utils=require(_0xbbd7('0x17'));var config=require(_0xbbd7('0x18'));var licenseUtil=require(_0xbbd7('0x19'));var db=require(_0xbbd7('0x1a'))['db'];config[_0xbbd7('0x1b')]=_['defaults'](config['redis'],{'host':_0xbbd7('0x1c'),'port':0x18eb});var socket=require(_0xbbd7('0x1d'))(new Redis(config['redis']));require(_0xbbd7('0x1e'))[_0xbbd7('0x1f')](socket);var jayson=require(_0xbbd7('0x20'));var client=jayson[_0xbbd7('0x21')][_0xbbd7('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x11cb48,_0x4f43f6,_0x58dd36,_0x542559){return new BPromise(function(_0x244194,_0x16d16a){var _0x565f33=_0x542559||client;return _0x565f33[_0xbbd7('0x23')](_0x11cb48,_0x58dd36)[_0xbbd7('0x24')](function(_0x5a0cf3){logger[_0xbbd7('0x25')](_0xbbd7('0x26'),_0x4f43f6,_0xbbd7('0x27'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4f43f6,'request\x20sent',JSON[_0xbbd7('0x28')](_0x5a0cf3));if(_0x5a0cf3['error']){if(_0x5a0cf3['error'][_0xbbd7('0x29')]===0x1f4){logger[_0xbbd7('0x2a')]('SmsAccount,\x20%s,\x20%s',_0x4f43f6,_0x5a0cf3['error'][_0xbbd7('0x2b')]);return _0x16d16a(_0x5a0cf3[_0xbbd7('0x2a')][_0xbbd7('0x2b')]);}logger[_0xbbd7('0x2a')](_0xbbd7('0x26'),_0x4f43f6,_0x5a0cf3[_0xbbd7('0x2a')]['message']);return _0x244194(_0x5a0cf3[_0xbbd7('0x2a')]['message']);}else{logger['info'](_0xbbd7('0x26'),_0x4f43f6,_0xbbd7('0x27'));_0x244194(_0x5a0cf3['result']['message']);}})['catch'](function(_0x4b5f7d){logger['error'](_0xbbd7('0x26'),_0x4f43f6,_0x4b5f7d);_0x16d16a(_0x4b5f7d);});});}function respondWithStatusCode(_0x3bad6a,_0x4dfba6){_0x4dfba6=_0x4dfba6||0xcc;return function(_0x204007){if(_0x204007){return _0x3bad6a[_0xbbd7('0x2c')](_0x4dfba6);}return _0x3bad6a[_0xbbd7('0x2d')](_0x4dfba6)[_0xbbd7('0x2e')]();};}function respondWithResult(_0x5b2bb1,_0x2e6884){_0x2e6884=_0x2e6884||0xc8;return function(_0x51e8ce){if(_0x51e8ce){return _0x5b2bb1[_0xbbd7('0x2d')](_0x2e6884)[_0xbbd7('0x2f')](_0x51e8ce);}};}function respondWithFilteredResult(_0x5de8b7,_0x4132ca){return function(_0x56f329){if(_0x56f329){var _0x15ab21=typeof _0x4132ca[_0xbbd7('0x30')]===_0xbbd7('0x31')&&typeof _0x4132ca[_0xbbd7('0x32')]===_0xbbd7('0x31');var _0x11b131=_0x56f329['count'];var _0x4d9f5e=_0x15ab21?0x0:_0x4132ca['offset'];var _0x340b17=_0x15ab21?_0x56f329[_0xbbd7('0x33')]:_0x4132ca[_0xbbd7('0x30')]+_0x4132ca['limit'];var _0x3def01;if(_0x340b17>=_0x11b131){_0x340b17=_0x11b131;_0x3def01=0xc8;}else{_0x3def01=0xce;}_0x5de8b7[_0xbbd7('0x2d')](_0x3def01);return _0x5de8b7[_0xbbd7('0x34')]('Content-Range',_0x4d9f5e+'-'+_0x340b17+'/'+_0x11b131)['json'](_0x56f329);}return null;};}function patchUpdates(_0x241eb9){return function(_0xce6ad4){try{jsonpatch[_0xbbd7('0x35')](_0xce6ad4,_0x241eb9,!![]);}catch(_0x111b97){return BPromise[_0xbbd7('0x36')](_0x111b97);}return _0xce6ad4[_0xbbd7('0x37')]();};}function saveUpdates(_0x348b3a,_0x123117){return function(_0x3b113d){if(_0x3b113d){return _0x3b113d[_0xbbd7('0x38')](_0x348b3a)[_0xbbd7('0x24')](function(_0x42dd83){return _0x42dd83;});}return null;};}function removeEntity(_0x367dd8,_0x2fe98a){return function(_0x1296ba){if(_0x1296ba){return _0x1296ba[_0xbbd7('0x39')]()['then'](function(){var _0x756b1b=_0x1296ba[_0xbbd7('0x3a')]({'plain':!![]});var _0x54a5d0='SmsAccounts';return db['UserProfileResource'][_0xbbd7('0x39')]({'where':{'type':_0x54a5d0,'resourceId':_0x756b1b['id']}})['then'](function(){return _0x1296ba;});})['then'](function(){_0x367dd8[_0xbbd7('0x2d')](0xcc)[_0xbbd7('0x2e')]();});}};}function handleEntityNotFound(_0x1ffd03,_0x2a7b03){return function(_0x67a816){if(!_0x67a816){_0x1ffd03[_0xbbd7('0x2c')](0x194);}return _0x67a816;};}function handleError(_0x2a7d36,_0x49fe1b){_0x49fe1b=_0x49fe1b||0x1f4;return function(_0x2a7c90){logger[_0xbbd7('0x2a')](_0x2a7c90[_0xbbd7('0x3b')]);if(_0x2a7c90[_0xbbd7('0x3c')]){delete _0x2a7c90['name'];}_0x2a7d36[_0xbbd7('0x2d')](_0x49fe1b)[_0xbbd7('0x3d')](_0x2a7c90);};}exports[_0xbbd7('0x3e')]=function(_0x438ecc,_0x15710c){var _0x5319df={'include':[{'model':db['Pause'],'as':_0xbbd7('0x3f')}]},_0x4ab28e={},_0x1b9dca={'count':0x0,'rows':[]};var _0x1cc481=_[_0xbbd7('0x40')](db[_0xbbd7('0x41')]['rawAttributes'],function(_0x18e00b){return{'name':_0x18e00b[_0xbbd7('0x42')],'type':_0x18e00b['type'][_0xbbd7('0x43')]};});_0x4ab28e['model']=_['map'](_0x1cc481,'name');_0x4ab28e[_0xbbd7('0x44')]=_[_0xbbd7('0x45')](_0x438ecc['query']);_0x4ab28e['filters']=_[_0xbbd7('0x46')](_0x4ab28e[_0xbbd7('0x47')],_0x4ab28e[_0xbbd7('0x44')]);_0x5319df[_0xbbd7('0x48')]=_[_0xbbd7('0x46')](_0x4ab28e[_0xbbd7('0x47')],qs[_0xbbd7('0x49')](_0x438ecc[_0xbbd7('0x44')][_0xbbd7('0x49')]));_0x5319df['attributes']=_0x5319df[_0xbbd7('0x48')][_0xbbd7('0x4a')]?_0x5319df[_0xbbd7('0x48')]:_0x4ab28e[_0xbbd7('0x47')];if(!_0x438ecc['query'][_0xbbd7('0x4b')](_0xbbd7('0x4c'))){_0x5319df[_0xbbd7('0x32')]=qs[_0xbbd7('0x32')](_0x438ecc['query']['limit']);_0x5319df[_0xbbd7('0x30')]=qs[_0xbbd7('0x30')](_0x438ecc[_0xbbd7('0x44')]['offset']);}_0x5319df[_0xbbd7('0x4d')]=qs['sort'](_0x438ecc[_0xbbd7('0x44')][_0xbbd7('0x4e')]);_0x5319df['where']=qs[_0xbbd7('0x4f')](_['pick'](_0x438ecc[_0xbbd7('0x44')],_0x4ab28e[_0xbbd7('0x4f')]),_0x1cc481);if(_0x438ecc[_0xbbd7('0x44')][_0xbbd7('0x50')]){_0x5319df[_0xbbd7('0x51')]=_['merge'](_0x5319df[_0xbbd7('0x51')],{'$or':_[_0xbbd7('0x40')](_0x1cc481,function(_0x5a0761){if(_0x5a0761[_0xbbd7('0x52')]!==_0xbbd7('0x53')){var _0x52a6a8={};_0x52a6a8[_0x5a0761[_0xbbd7('0x3c')]]={'$like':'%'+_0x438ecc[_0xbbd7('0x44')][_0xbbd7('0x50')]+'%'};return _0x52a6a8;}})});}_0x5319df=_[_0xbbd7('0x54')]({},_0x5319df,_0x438ecc[_0xbbd7('0x55')]);var _0x22ca28={'where':_0x5319df[_0xbbd7('0x51')]};return db[_0xbbd7('0x41')]['count'](_0x22ca28)[_0xbbd7('0x24')](function(_0x55df81){_0x1b9dca[_0xbbd7('0x33')]=_0x55df81;if(_0x438ecc[_0xbbd7('0x44')][_0xbbd7('0x56')]){_0x5319df[_0xbbd7('0x57')]=[{'all':!![]}];}return db['SmsAccount'][_0xbbd7('0x58')](_0x5319df);})[_0xbbd7('0x24')](function(_0x35caef){_0x1b9dca['rows']=_0x35caef;return _0x1b9dca;})[_0xbbd7('0x24')](respondWithFilteredResult(_0x15710c,_0x5319df))[_0xbbd7('0x59')](handleError(_0x15710c,null));};exports[_0xbbd7('0x5a')]=function(_0x4891a0,_0xdaa757){var _0x42903d={'raw':![],'where':{'id':_0x4891a0['params']['id']},'include':[{'model':db[_0xbbd7('0x5b')],'as':_0xbbd7('0x3f')}]},_0x14fdc6={};_0x14fdc6[_0xbbd7('0x47')]=_[_0xbbd7('0x45')](db[_0xbbd7('0x41')][_0xbbd7('0x5c')]);_0x14fdc6[_0xbbd7('0x44')]=_['keys'](_0x4891a0['query']);_0x14fdc6[_0xbbd7('0x4f')]=_[_0xbbd7('0x46')](_0x14fdc6[_0xbbd7('0x47')],_0x14fdc6['query']);_0x42903d[_0xbbd7('0x48')]=_[_0xbbd7('0x46')](_0x14fdc6[_0xbbd7('0x47')],qs[_0xbbd7('0x49')](_0x4891a0[_0xbbd7('0x44')][_0xbbd7('0x49')]));_0x42903d[_0xbbd7('0x48')]=_0x42903d[_0xbbd7('0x48')]['length']?_0x42903d[_0xbbd7('0x48')]:_0x14fdc6[_0xbbd7('0x47')];if(_0x4891a0[_0xbbd7('0x44')][_0xbbd7('0x56')]){_0x42903d['include']=[{'all':!![]}];}_0x42903d=_[_0xbbd7('0x54')]({},_0x42903d,_0x4891a0[_0xbbd7('0x55')]);return db[_0xbbd7('0x41')][_0xbbd7('0x5d')](_0x42903d)[_0xbbd7('0x24')](handleEntityNotFound(_0xdaa757,null))[_0xbbd7('0x24')](respondWithResult(_0xdaa757,null))[_0xbbd7('0x59')](handleError(_0xdaa757,null));};exports[_0xbbd7('0x5e')]=function(_0x5b0d7d,_0xb368ca){return db[_0xbbd7('0x41')][_0xbbd7('0x5e')](_0x5b0d7d[_0xbbd7('0x5f')],{})[_0xbbd7('0x24')](function(_0x3957c4){var _0x4e2f90=_0x5b0d7d[_0xbbd7('0x60')]['get']({'plain':!![]});if(!_0x4e2f90)throw new Error(_0xbbd7('0x61'));if(_0x4e2f90['role']===_0xbbd7('0x60')){var _0x4c7182=_0x3957c4['get']({'plain':!![]});var _0xf29075='SmsAccounts';return db[_0xbbd7('0x62')]['find']({'where':{'name':_0xf29075,'userProfileId':_0x4e2f90['userProfileId']},'raw':!![]})[_0xbbd7('0x24')](function(_0x3f6427){if(_0x3f6427&&_0x3f6427[_0xbbd7('0x63')]===0x0){return db[_0xbbd7('0x64')][_0xbbd7('0x5e')]({'name':_0x4c7182[_0xbbd7('0x3c')],'resourceId':_0x4c7182['id'],'type':_0x3f6427[_0xbbd7('0x3c')],'sectionId':_0x3f6427['id']},{})['then'](function(){return _0x3957c4;});}else{return _0x3957c4;}})[_0xbbd7('0x59')](function(_0x185ee4){logger[_0xbbd7('0x2a')](_0xbbd7('0x65'),_0x185ee4);throw _0x185ee4;});}return _0x3957c4;})[_0xbbd7('0x24')](respondWithResult(_0xb368ca,0xc9))[_0xbbd7('0x59')](handleError(_0xb368ca,null));};exports['update']=function(_0x355e70,_0x1ec2e5){if(_0x355e70['body']['id']){delete _0x355e70[_0xbbd7('0x5f')]['id'];}return db[_0xbbd7('0x41')][_0xbbd7('0x5d')]({'where':{'id':_0x355e70[_0xbbd7('0x66')]['id']},'include':[{'model':db[_0xbbd7('0x5b')],'as':_0xbbd7('0x3f')}]})[_0xbbd7('0x24')](handleEntityNotFound(_0x1ec2e5,null))['then'](saveUpdates(_0x355e70['body'],null))[_0xbbd7('0x24')](respondWithResult(_0x1ec2e5,null))[_0xbbd7('0x59')](handleError(_0x1ec2e5,null));};exports[_0xbbd7('0x39')]=function(_0xaae1ff,_0x2cf1cd){return db[_0xbbd7('0x41')][_0xbbd7('0x5d')]({'where':{'id':_0xaae1ff['params']['id']}})[_0xbbd7('0x24')](handleEntityNotFound(_0x2cf1cd,null))[_0xbbd7('0x24')](removeEntity(_0x2cf1cd,null))[_0xbbd7('0x59')](handleError(_0x2cf1cd,null));};exports[_0xbbd7('0x67')]=function(_0x2813a5,_0x35ed0f){return db[_0xbbd7('0x41')]['describe']()[_0xbbd7('0x24')](respondWithResult(_0x35ed0f,null))[_0xbbd7('0x59')](handleError(_0x35ed0f,null));};exports['addDisposition']=function(_0x4b0d54,_0x7ec318,_0x1ced19){if(_0x4b0d54['body']['id']){delete _0x4b0d54['body']['id'];}return db[_0xbbd7('0x41')]['find']({'where':{'id':_0x4b0d54[_0xbbd7('0x66')]['id']}})['then'](handleEntityNotFound(_0x7ec318,null))[_0xbbd7('0x24')](function(_0x1037b4){if(_0x1037b4){_0x4b0d54[_0xbbd7('0x5f')]['SmsAccountId']=_0x1037b4['id'];return db['Disposition'][_0xbbd7('0x5e')](_0x4b0d54[_0xbbd7('0x5f')]);}})['then'](respondWithResult(_0x7ec318,null))[_0xbbd7('0x59')](handleError(_0x7ec318,null));};exports[_0xbbd7('0x68')]=function(_0x2ab4c0,_0x4b9a94,_0x26bdf7){var _0x5dc3bd={'raw':![],'where':{}};var _0x454f14={};var _0x54dbef={'count':0x0,'rows':[]};return db['SmsAccount'][_0xbbd7('0x69')]({'where':{'id':_0x2ab4c0[_0xbbd7('0x66')]['id']}})[_0xbbd7('0x24')](handleEntityNotFound(_0x4b9a94,null))['then'](function(_0x122cca){if(_0x122cca){_0x454f14[_0xbbd7('0x47')]=_[_0xbbd7('0x45')](db[_0xbbd7('0x6a')][_0xbbd7('0x5c')]);_0x454f14[_0xbbd7('0x44')]=_[_0xbbd7('0x45')](_0x2ab4c0[_0xbbd7('0x44')]);_0x454f14[_0xbbd7('0x4f')]=_['intersection'](_0x454f14[_0xbbd7('0x47')],_0x454f14[_0xbbd7('0x44')]);_0x5dc3bd['attributes']=_['intersection'](_0x454f14['model'],qs[_0xbbd7('0x49')](_0x2ab4c0[_0xbbd7('0x44')][_0xbbd7('0x49')]));_0x5dc3bd[_0xbbd7('0x48')]=_0x5dc3bd[_0xbbd7('0x48')][_0xbbd7('0x4a')]?_0x5dc3bd[_0xbbd7('0x48')]:_0x454f14['model'];if(!_0x2ab4c0[_0xbbd7('0x44')][_0xbbd7('0x4b')]('nolimit')){_0x5dc3bd[_0xbbd7('0x32')]=qs['limit'](_0x2ab4c0[_0xbbd7('0x44')][_0xbbd7('0x32')]);_0x5dc3bd[_0xbbd7('0x30')]=qs[_0xbbd7('0x30')](_0x2ab4c0[_0xbbd7('0x44')][_0xbbd7('0x30')]);}_0x5dc3bd['order']=qs[_0xbbd7('0x4e')](_0x2ab4c0[_0xbbd7('0x44')]['sort']);_0x5dc3bd['where']=qs['filters'](_[_0xbbd7('0x6b')](_0x2ab4c0[_0xbbd7('0x44')],_0x454f14[_0xbbd7('0x4f')]));_0x5dc3bd[_0xbbd7('0x51')][_0xbbd7('0x6c')]=_0x122cca['id'];if(_0x2ab4c0[_0xbbd7('0x44')][_0xbbd7('0x50')]){_0x5dc3bd[_0xbbd7('0x51')]=_[_0xbbd7('0x54')](_0x5dc3bd['where'],{'$or':_[_0xbbd7('0x40')](_0x5dc3bd[_0xbbd7('0x48')],function(_0x4968ff){var _0xf469f5={};_0xf469f5[_0x4968ff]={'$like':'%'+_0x2ab4c0[_0xbbd7('0x44')][_0xbbd7('0x50')]+'%'};return _0xf469f5;})});}_0x5dc3bd=_['merge']({},_0x5dc3bd,_0x2ab4c0[_0xbbd7('0x55')]);return db[_0xbbd7('0x6a')]['count']({'where':_0x5dc3bd[_0xbbd7('0x51')]})[_0xbbd7('0x24')](function(_0x131b69){_0x54dbef[_0xbbd7('0x33')]=_0x131b69;if(_0x2ab4c0['query'][_0xbbd7('0x56')]){_0x5dc3bd[_0xbbd7('0x57')]=[{'all':!![]}];}return db[_0xbbd7('0x6a')][_0xbbd7('0x58')](_0x5dc3bd);})[_0xbbd7('0x24')](function(_0x126dd1){_0x54dbef[_0xbbd7('0x6d')]=_0x126dd1;return _0x54dbef;});}})[_0xbbd7('0x24')](respondWithFilteredResult(_0x4b9a94,_0x5dc3bd))[_0xbbd7('0x59')](handleError(_0x4b9a94,null));};exports[_0xbbd7('0x6e')]=function(_0x44d441,_0x208003,_0x3a17ba){return db[_0xbbd7('0x41')]['find']({'where':{'id':_0x44d441[_0xbbd7('0x66')]['id']}})[_0xbbd7('0x24')](handleEntityNotFound(_0x208003,null))[_0xbbd7('0x24')](function(_0x51aaf8){if(_0x51aaf8){return _0x51aaf8['removeDispositions'](_0x44d441[_0xbbd7('0x44')][_0xbbd7('0x6f')]);}})['then'](respondWithStatusCode(_0x208003,null))[_0xbbd7('0x59')](handleError(_0x208003,null));};exports[_0xbbd7('0x70')]=function(_0x516c71,_0x15489b,_0x5e788e){if(_0x516c71[_0xbbd7('0x5f')]['id']){delete _0x516c71[_0xbbd7('0x5f')]['id'];}return db['SmsAccount'][_0xbbd7('0x5d')]({'where':{'id':_0x516c71[_0xbbd7('0x66')]['id']}})[_0xbbd7('0x24')](handleEntityNotFound(_0x15489b,null))[_0xbbd7('0x24')](function(_0x1e367e){if(_0x1e367e){_0x516c71[_0xbbd7('0x5f')][_0xbbd7('0x6c')]=_0x1e367e['id'];return db[_0xbbd7('0x71')][_0xbbd7('0x5e')](_0x516c71[_0xbbd7('0x5f')]);}})[_0xbbd7('0x24')](respondWithResult(_0x15489b,null))['catch'](handleError(_0x15489b,null));};exports[_0xbbd7('0x72')]=function(_0x4892ab,_0x8ee9fc,_0xeaeff0){var _0x3615f1={'raw':![],'where':{}};var _0x1e6aea={};var _0x4e9d4a={'count':0x0,'rows':[]};return db['SmsAccount'][_0xbbd7('0x69')]({'where':{'id':_0x4892ab[_0xbbd7('0x66')]['id']}})[_0xbbd7('0x24')](handleEntityNotFound(_0x8ee9fc,null))[_0xbbd7('0x24')](function(_0x720799){if(_0x720799){_0x1e6aea['model']=_[_0xbbd7('0x45')](db[_0xbbd7('0x71')][_0xbbd7('0x5c')]);_0x1e6aea['query']=_[_0xbbd7('0x45')](_0x4892ab['query']);_0x1e6aea['filters']=_['intersection'](_0x1e6aea[_0xbbd7('0x47')],_0x1e6aea[_0xbbd7('0x44')]);_0x3615f1['attributes']=_['intersection'](_0x1e6aea[_0xbbd7('0x47')],qs[_0xbbd7('0x49')](_0x4892ab[_0xbbd7('0x44')][_0xbbd7('0x49')]));_0x3615f1[_0xbbd7('0x48')]=_0x3615f1[_0xbbd7('0x48')][_0xbbd7('0x4a')]?_0x3615f1[_0xbbd7('0x48')]:_0x1e6aea[_0xbbd7('0x47')];if(!_0x4892ab['query']['hasOwnProperty'](_0xbbd7('0x4c'))){_0x3615f1['limit']=qs[_0xbbd7('0x32')](_0x4892ab['query'][_0xbbd7('0x32')]);_0x3615f1[_0xbbd7('0x30')]=qs[_0xbbd7('0x30')](_0x4892ab[_0xbbd7('0x44')]['offset']);}_0x3615f1[_0xbbd7('0x4d')]=qs[_0xbbd7('0x4e')](_0x4892ab[_0xbbd7('0x44')]['sort']);_0x3615f1['where']=qs[_0xbbd7('0x4f')](_[_0xbbd7('0x6b')](_0x4892ab[_0xbbd7('0x44')],_0x1e6aea[_0xbbd7('0x4f')]));_0x3615f1['where']['SmsAccountId']=_0x720799['id'];if(_0x4892ab[_0xbbd7('0x44')][_0xbbd7('0x50')]){_0x3615f1[_0xbbd7('0x51')]=_[_0xbbd7('0x54')](_0x3615f1[_0xbbd7('0x51')],{'$or':_[_0xbbd7('0x40')](_0x3615f1[_0xbbd7('0x48')],function(_0x3d5dc4){var _0x2ba11c={};_0x2ba11c[_0x3d5dc4]={'$like':'%'+_0x4892ab[_0xbbd7('0x44')][_0xbbd7('0x50')]+'%'};return _0x2ba11c;})});}_0x3615f1=_[_0xbbd7('0x54')]({},_0x3615f1,_0x4892ab[_0xbbd7('0x55')]);return db[_0xbbd7('0x71')][_0xbbd7('0x33')]({'where':_0x3615f1[_0xbbd7('0x51')]})[_0xbbd7('0x24')](function(_0x31a567){_0x4e9d4a[_0xbbd7('0x33')]=_0x31a567;if(_0x4892ab[_0xbbd7('0x44')]['includeAll']){_0x3615f1['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xbbd7('0x58')](_0x3615f1);})[_0xbbd7('0x24')](function(_0x4396ac){_0x4e9d4a[_0xbbd7('0x6d')]=_0x4396ac;return _0x4e9d4a;});}})[_0xbbd7('0x24')](respondWithFilteredResult(_0x8ee9fc,_0x3615f1))['catch'](handleError(_0x8ee9fc,null));};exports[_0xbbd7('0x73')]=function(_0x3c5e55,_0x4e06cc,_0x3efb90){return db[_0xbbd7('0x41')][_0xbbd7('0x5d')]({'where':{'id':_0x3c5e55['params']['id']}})[_0xbbd7('0x24')](handleEntityNotFound(_0x4e06cc,null))[_0xbbd7('0x24')](function(_0x41256a){if(_0x41256a){return _0x41256a[_0xbbd7('0x73')](_0x3c5e55['query'][_0xbbd7('0x6f')]);}})[_0xbbd7('0x24')](respondWithStatusCode(_0x4e06cc,null))[_0xbbd7('0x59')](handleError(_0x4e06cc,null));};exports['notify']=function(_0x13e0a4,_0x41641a,_0x394256){var _0x11ec9d={'channel':'sms'};var _0x47462e=[];var _0xe3dc94=[];var _0x196361={};return db[_0xbbd7('0x41')][_0xbbd7('0x5d')]({'where':{'id':_0x13e0a4[_0xbbd7('0x66')]['id']},'include':[{'model':db[_0xbbd7('0x74')],'as':_0xbbd7('0x75')}]})['then'](handleEntityNotFound(_0x41641a,null))[_0xbbd7('0x24')](function(_0x30f30c){_0x11ec9d[_0xbbd7('0x76')]=_0x30f30c;_0x11ec9d[_0xbbd7('0x77')]=_[_0xbbd7('0x78')](_0x30f30c['Applications'],[_0xbbd7('0x79')],[_0xbbd7('0x7a')]);if(_0x11ec9d['account']['Applications']){delete _0x11ec9d[_0xbbd7('0x76')]['Applications'];}return db['CmContact'][_0xbbd7('0x67')]();})[_0xbbd7('0x24')](function(_0x3793e9){if(!_0x3793e9){throw new db['Sequelize'][(_0xbbd7('0x7b'))](_0xbbd7('0x7c'));}_0x47462e=_['difference'](_['keys'](_0x3793e9),[_0xbbd7('0x7d'),_0xbbd7('0x7e')]);_0xe3dc94=_[_0xbbd7('0x7f')](_[_0xbbd7('0x45')](_0x3793e9),[_0xbbd7('0x7d'),'updatedAt',_0xbbd7('0x80'),_0xbbd7('0x81')]);_0x11ec9d[_0xbbd7('0x5f')]={'mapKey':_0xbbd7('0x82')};if(_0x11ec9d[_0xbbd7('0x76')][_0xbbd7('0x52')]){switch(_0x11ec9d[_0xbbd7('0x76')][_0xbbd7('0x52')]){case _0xbbd7('0x83'):_0x11ec9d[_0xbbd7('0x5f')]['from']=_0x13e0a4[_0xbbd7('0x5f')]['From'];_0x11ec9d[_0xbbd7('0x5f')]['body']=_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x84')];_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x85')]=_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x86')];break;case'skebby':_0x11ec9d['body'][_0xbbd7('0x87')]='+'+_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x88')];_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x5f')]=_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x89')];break;case'connectel':_0x11ec9d[_0xbbd7('0x5f')]['from']=_0x13e0a4[_0xbbd7('0x5f')]['from'];_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x5f')]=_0x13e0a4['body'][_0xbbd7('0x2b')];break;case _0xbbd7('0x8a'):_0x11ec9d['body'][_0xbbd7('0x87')]=_0x13e0a4['body'][_0xbbd7('0x87')];_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x5f')]=_0x13e0a4[_0xbbd7('0x5f')]['body'];_0x11ec9d['body'][_0xbbd7('0x85')]=_0x13e0a4['body']['message_id'];break;case _0xbbd7('0x8b'):_0x11ec9d['body'][_0xbbd7('0x87')]=_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x8c')];_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x5f')]=_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x8d')];_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x85')]=_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x8e')];break;case'infobip':_0x11ec9d[_0xbbd7('0x5f')]['from']='+'+_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x8f')][0x0]['from'];_0x11ec9d['body']['body']=_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x8f')][0x0][_0xbbd7('0x89')];_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x85')]=_0x13e0a4['body'][_0xbbd7('0x8f')][0x0]['messageId'];break;case _0xbbd7('0x90'):_0x11ec9d['body'][_0xbbd7('0x87')]=_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x91')];_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x5f')]=_0x13e0a4['body'][_0xbbd7('0x92')][_0xbbd7('0x2b')];break;case'clickatell':_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x87')]=_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x93')];_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x5f')]=_0x13e0a4[_0xbbd7('0x5f')]['text'];_0x11ec9d[_0xbbd7('0x5f')]['messageId']=_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x94')];break;case _0xbbd7('0x95'):_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x85')]=_0x13e0a4[_0xbbd7('0x5f')][0x0][_0xbbd7('0x2b')]['id'];_0x11ec9d['body'][_0xbbd7('0x87')]=_0x13e0a4[_0xbbd7('0x5f')][0x0][_0xbbd7('0x2b')]['from'];_0x11ec9d['body']['body']=_0x13e0a4['body'][0x0][_0xbbd7('0x2b')][_0xbbd7('0x89')];break;case _0xbbd7('0x96'):_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x87')]=_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x87')];_0x11ec9d['body']['body']=_0x13e0a4[_0xbbd7('0x5f')]['message'];_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x85')]=_0x13e0a4[_0xbbd7('0x5f')][_0xbbd7('0x97')];break;}}if(_0x11ec9d[_0xbbd7('0x5f')]['id']){delete _0x11ec9d[_0xbbd7('0x5f')]['id'];}if(_[_0xbbd7('0x98')](_0x11ec9d[_0xbbd7('0x5f')]['from'])){throw new db['Sequelize'][(_0xbbd7('0x7b'))](_0xbbd7('0x99'));}if(_[_0xbbd7('0x98')](_0x11ec9d['body'][_0xbbd7('0x5f')])||_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x5f')]===''){throw new db[(_0xbbd7('0x9a'))][(_0xbbd7('0x7b'))](_0xbbd7('0x9b'));}if(_[_0xbbd7('0x98')](_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x9c')])){throw new db['Sequelize'][(_0xbbd7('0x7b'))](_0xbbd7('0x9d')+_0xe3dc94);}if(!_[_0xbbd7('0x9e')](_0xe3dc94,_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x9c')])){throw new db[(_0xbbd7('0x9a'))]['ValidationError'](_0xbbd7('0x9f')+_0xe3dc94);}_0x196361[_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x9c')]]=_0x11ec9d['body'][_0xbbd7('0x87')];return db[_0xbbd7('0xa0')][_0xbbd7('0x5d')]({'where':{'id':_0x11ec9d['account'][_0xbbd7('0x81')]},'include':[{'model':db[_0xbbd7('0xa1')],'as':_0xbbd7('0xa2'),'where':_0x196361,'limit':0x1,'order':[[_0xbbd7('0x7e'),_0xbbd7('0xa3')]]}]});})[_0xbbd7('0x24')](handleEntityNotFound(_0x41641a,null))[_0xbbd7('0x24')](function(_0xdc1316){if(_0xdc1316){_0x11ec9d[_0xbbd7('0xa4')]=_[_0xbbd7('0xa5')](_0xdc1316,[_0xbbd7('0xa2')]);if(_0xdc1316[_0xbbd7('0xa2')][_0xbbd7('0x4a')]){return _0xdc1316[_0xbbd7('0xa2')][0x0];}var _0xaf10bc=_[_0xbbd7('0xa6')](_0x11ec9d[_0xbbd7('0x5f')],{'firstName':_0x11ec9d[_0xbbd7('0x5f')]['from'],'ListId':_0xdc1316['id']});_0xaf10bc[_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x9c')]]=_0x11ec9d['body'][_0xbbd7('0x87')];return db[_0xbbd7('0xa1')]['create'](_0xaf10bc,{'fields':_0x47462e,'raw':!![]});}})[_0xbbd7('0x24')](handleEntityNotFound(_0x41641a,null))[_0xbbd7('0x24')](function(_0x5c9651){if(_0x5c9651){_0x11ec9d[_0xbbd7('0xa7')]=_0x5c9651;var _0x1f172f={'ContactId':_0x5c9651['id'],'phone':_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0x87')],'SmsAccountId':_0x13e0a4[_0xbbd7('0x66')]['id']};var _0x13ae33={'ContactId':_0x5c9651['id'],'SmsAccountId':_0x13e0a4[_0xbbd7('0x66')]['id'],'closed':![]};return db[_0xbbd7('0xa8')]['find']({'where':_0x13ae33})['then'](function(_0xf9cdc5){if(_0xf9cdc5){return[_0xf9cdc5,![]];}return db['SmsInteraction']['create'](_0x1f172f)[_0xbbd7('0x24')](function(_0x44e9ca){return[_0x44e9ca,!![]];});});}})[_0xbbd7('0xa9')](function(_0x196591,_0x10f6ac){_0x11ec9d[_0xbbd7('0xaa')]=_0x196591[_0xbbd7('0x3a')]({'plain':!![]});_0x11ec9d['interaction']['created']=![];if(_0x10f6ac){if(_0x11ec9d[_0xbbd7('0x76')][_0xbbd7('0xab')]){_0x11ec9d['applications'][_0xbbd7('0xac')]({'id':0x0,'priority':_0x11ec9d[_0xbbd7('0x77')][_0xbbd7('0x4a')]+0x1,'app':_0xbbd7('0xad'),'appdata':'unmanaged','interval':_0xbbd7('0xae')});}_0x11ec9d['interaction'][_0xbbd7('0xaf')]=!![];}return db[_0xbbd7('0xb0')][_0xbbd7('0x5e')]({'phone':_0x11ec9d['body'][_0xbbd7('0x87')],'messageId':_0x11ec9d['body'][_0xbbd7('0x85')],'body':_0x11ec9d['body']['body'],'SmsAccountId':_0x13e0a4['params']['id'],'SmsInteractionId':_0x196591['id'],'direction':'in','ContactId':_0x196591[_0xbbd7('0xb1')],'AttachmentId':_0x11ec9d[_0xbbd7('0x5f')][_0xbbd7('0xb2')]});})[_0xbbd7('0x24')](function(_0x307b86){_0x11ec9d[_0xbbd7('0x2b')]=_0x307b86;if(!_0x11ec9d['interaction'][_0xbbd7('0xb3')])return;return db['User'][_0xbbd7('0x5d')]({'attributes':['id',_0xbbd7('0x3c')],'where':{'id':_0x11ec9d[_0xbbd7('0xaa')][_0xbbd7('0xb3')]}});})[_0xbbd7('0x24')](function(_0x2e9a1a){if(_0x2e9a1a){_0x11ec9d[_0xbbd7('0x77')][_0xbbd7('0xb4')]({'id':0x0,'priority':0x0,'app':_0xbbd7('0xb5'),'appdata':_0x2e9a1a['name']+','+(_0x11ec9d['account']['waitForTheAssignedAgent']||0xa),'interval':_0xbbd7('0xae')});}if(!_0x11ec9d[_0xbbd7('0xaa')][_0xbbd7('0xb6')])return;return db[_0xbbd7('0xb7')][_0xbbd7('0x5d')]({'attributes':['id',_0xbbd7('0x3c')],'where':{'id':_0x11ec9d[_0xbbd7('0xaa')]['queueId']}});})[_0xbbd7('0x24')](function(_0x1f8a6e){if(_0x1f8a6e){_0x11ec9d[_0xbbd7('0x77')][_0xbbd7('0xb4')]({'id':0x0,'priority':0x1,'app':_0xbbd7('0xb8'),'appdata':_0x1f8a6e[_0xbbd7('0x3c')]+','+(_0x11ec9d[_0xbbd7('0x76')][_0xbbd7('0xb9')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xbbd7('0xba'),_0xbbd7('0xbb'),_0x11ec9d);})[_0xbbd7('0x24')](function(_0x420d62){if(_0x420d62){var _0x8775d4=0xc8;var _0x30abc3='receiveMessage';logger[_0xbbd7('0x25')](_0xbbd7('0xbc'),_0x30abc3,_0x8775d4,_0xbbd7('0xbd'));logger[_0xbbd7('0xbe')](_0xbbd7('0xbf'),_0x30abc3,_0x8775d4,_0xbbd7('0xbd'),JSON[_0xbbd7('0x28')](_0x420d62));if(_0x11ec9d[_0xbbd7('0x76')]['type']==='twilio'){return _0x41641a['status'](_0x8775d4)[_0xbbd7('0x34')](_0xbbd7('0xc0'),_0xbbd7('0xc1'))['send'](_0xbbd7('0xc2'));}else{return _0x41641a['status'](_0x8775d4)[_0xbbd7('0x2f')](_0x420d62);}}})['catch'](handleError(_0x41641a,null));};exports[_0xbbd7('0xc3')]=function(_0x15666a,_0xee02c0){var _0x37a47f=_0x15666a[_0xbbd7('0x66')]['id'];var _0x4ff605=_0x15666a[_0xbbd7('0x5f')];var _0xdedd4b=0xc8;var _0x4aa49d=null;return db[_0xbbd7('0xc4')][_0xbbd7('0xc5')]({'isolationLevel':db[_0xbbd7('0xc4')][_0xbbd7('0xc6')][_0xbbd7('0xc7')][_0xbbd7('0xc8')]},function(_0xe2b146){return db[_0xbbd7('0x41')][_0xbbd7('0x69')]({'where':{'id':_0x37a47f},'transaction':_0xe2b146})[_0xbbd7('0x24')](function(_0x3fe1e5){if(_0x3fe1e5){return db[_0xbbd7('0x74')][_0xbbd7('0x39')]({'where':{'SmsAccountId':_0x37a47f},'transaction':_0xe2b146})[_0xbbd7('0x24')](function(){var _0x5b2710=_[_0xbbd7('0x40')](_0x4ff605,function(_0x37e208){_0x37e208[_0xbbd7('0x6c')]=_0x37a47f;return _0x37e208;});return db[_0xbbd7('0x74')][_0xbbd7('0xc9')](_0x5b2710,{'transaction':_0xe2b146});});}else{_0xdedd4b=0x194;_0x4aa49d=[];}});})['then'](function(){if(_0xdedd4b!==0x194){return db['SmsApplication'][_0xbbd7('0xca')]({'where':{'SmsAccountId':_0x37a47f},'order':_0xbbd7('0x79')})[_0xbbd7('0x24')](function(_0x331b49){_0x4aa49d=_0x331b49;});}})[_0xbbd7('0x59')](function(_0x171b05){_0xdedd4b=0x1f4;logger[_0xbbd7('0x2a')](_0x171b05[_0xbbd7('0x3b')]);if(_0x171b05[_0xbbd7('0x3c')]){delete _0x171b05['name'];}_0x4aa49d=_0x171b05;})[_0xbbd7('0xcb')](function(){if(_0x4aa49d===null){_0xee02c0[_0xbbd7('0x2c')](_0xdedd4b);}else{if(_0xdedd4b===0x1f4){_0xee02c0[_0xbbd7('0x2d')](_0xdedd4b)[_0xbbd7('0x3d')](_0x4aa49d);}else{_0xee02c0[_0xbbd7('0x2d')](_0xdedd4b)[_0xbbd7('0x2f')](_0x4aa49d);}}});};exports[_0xbbd7('0xcc')]=function(_0x2cf899,_0x5e3539,_0x233944){var _0x4eb52f={};var _0x390810={};var _0xd9aacc;var _0x166688;return db[_0xbbd7('0x41')]['findOne']({'where':{'id':_0x2cf899[_0xbbd7('0x66')]['id']}})[_0xbbd7('0x24')](handleEntityNotFound(_0x5e3539,null))[_0xbbd7('0x24')](function(_0xdbf62a){if(_0xdbf62a){_0xd9aacc=_0xdbf62a;_0x390810['model']=_[_0xbbd7('0x45')](db[_0xbbd7('0x74')]['rawAttributes']);_0x390810[_0xbbd7('0x44')]=_[_0xbbd7('0x45')](_0x2cf899['query']);_0x390810[_0xbbd7('0x4f')]=_['intersection'](_0x390810['model'],_0x390810[_0xbbd7('0x44')]);_0x4eb52f['attributes']=_['intersection'](_0x390810[_0xbbd7('0x47')],qs[_0xbbd7('0x49')](_0x2cf899[_0xbbd7('0x44')][_0xbbd7('0x49')]));_0x4eb52f['attributes']=_0x4eb52f[_0xbbd7('0x48')]['length']?_0x4eb52f[_0xbbd7('0x48')]:_0x390810['model'];_0x4eb52f[_0xbbd7('0x4d')]=qs[_0xbbd7('0x4e')](_0x2cf899[_0xbbd7('0x44')][_0xbbd7('0x4e')]);_0x4eb52f[_0xbbd7('0x51')]=qs[_0xbbd7('0x4f')](_[_0xbbd7('0x6b')](_0x2cf899[_0xbbd7('0x44')],_0x390810[_0xbbd7('0x4f')]));if(_0x2cf899['query'][_0xbbd7('0x50')]){_0x4eb52f[_0xbbd7('0x51')]=_[_0xbbd7('0x54')](_0x4eb52f[_0xbbd7('0x51')],{'$or':_[_0xbbd7('0x40')](_0x4eb52f[_0xbbd7('0x48')],function(_0x4ea95f){var _0x577e8b={};_0x577e8b[_0x4ea95f]={'$like':'%'+_0x2cf899[_0xbbd7('0x44')][_0xbbd7('0x50')]+'%'};return _0x577e8b;})});}_0x4eb52f=_['merge']({},_0x4eb52f,_0x2cf899[_0xbbd7('0x55')]);return _0xd9aacc[_0xbbd7('0xcc')](_0x4eb52f);}})[_0xbbd7('0x24')](function(_0x3c1f96){if(_0x3c1f96){_0x166688=_0x3c1f96[_0xbbd7('0x4a')];if(!_0x2cf899[_0xbbd7('0x44')][_0xbbd7('0x4b')]('nolimit')){_0x4eb52f['limit']=qs[_0xbbd7('0x32')](_0x2cf899[_0xbbd7('0x44')][_0xbbd7('0x32')]);_0x4eb52f['offset']=qs[_0xbbd7('0x30')](_0x2cf899['query']['offset']);}return _0xd9aacc[_0xbbd7('0xcc')](_0x4eb52f);}})[_0xbbd7('0x24')](function(_0x3f4bf6){if(_0x3f4bf6){return _0x3f4bf6?{'count':_0x166688,'rows':_0x3f4bf6}:null;}})['then'](respondWithResult(_0x5e3539,null))[_0xbbd7('0x59')](handleError(_0x5e3539,null));};exports[_0xbbd7('0xcd')]=function(_0x5a2b17,_0x2beb4b,_0x2b2200){var _0x9d9668={'raw':![],'where':{}};var _0x5e9cad={};var _0x459558={'count':0x0,'rows':[]};return db[_0xbbd7('0x41')][_0xbbd7('0x69')]({'where':{'id':_0x5a2b17[_0xbbd7('0x66')]['id']}})['then'](handleEntityNotFound(_0x2beb4b,null))[_0xbbd7('0x24')](function(_0x234624){if(_0x234624){_0x5e9cad['model']=_[_0xbbd7('0x45')](db['SmsInteraction']['rawAttributes']);_0x5e9cad[_0xbbd7('0x44')]=_[_0xbbd7('0x45')](_0x5a2b17[_0xbbd7('0x44')]);_0x5e9cad['filters']=_[_0xbbd7('0x46')](_0x5e9cad[_0xbbd7('0x47')],_0x5e9cad[_0xbbd7('0x44')]);_0x9d9668[_0xbbd7('0x48')]=_['intersection'](_0x5e9cad['model'],qs[_0xbbd7('0x49')](_0x5a2b17[_0xbbd7('0x44')][_0xbbd7('0x49')]));_0x9d9668[_0xbbd7('0x48')]=_0x9d9668[_0xbbd7('0x48')][_0xbbd7('0x4a')]?_0x9d9668['attributes']:_0x5e9cad['model'];if(!_0x5a2b17['query']['hasOwnProperty'](_0xbbd7('0x4c'))){_0x9d9668[_0xbbd7('0x32')]=qs[_0xbbd7('0x32')](_0x5a2b17[_0xbbd7('0x44')][_0xbbd7('0x32')]);_0x9d9668[_0xbbd7('0x30')]=qs['offset'](_0x5a2b17['query'][_0xbbd7('0x30')]);}_0x9d9668['order']=qs[_0xbbd7('0x4e')](_0x5a2b17[_0xbbd7('0x44')]['sort']);_0x9d9668[_0xbbd7('0x51')]=qs[_0xbbd7('0x4f')](_[_0xbbd7('0x6b')](_0x5a2b17[_0xbbd7('0x44')],_0x5e9cad[_0xbbd7('0x4f')]));_0x9d9668[_0xbbd7('0x51')][_0xbbd7('0x6c')]=_0x234624['id'];if(_0x5a2b17[_0xbbd7('0x44')]['filter']){_0x9d9668[_0xbbd7('0x51')]=_['merge'](_0x9d9668[_0xbbd7('0x51')],{'$or':_['map'](_0x9d9668[_0xbbd7('0x48')],function(_0x578984){var _0x4d8b09={};_0x4d8b09[_0x578984]={'$like':'%'+_0x5a2b17[_0xbbd7('0x44')][_0xbbd7('0x50')]+'%'};return _0x4d8b09;})});}_0x9d9668=_[_0xbbd7('0x54')]({},_0x9d9668,_0x5a2b17['options']);return db['SmsInteraction'][_0xbbd7('0x33')]({'where':_0x9d9668[_0xbbd7('0x51')]})[_0xbbd7('0x24')](function(_0x544484){_0x459558[_0xbbd7('0x33')]=_0x544484;if(_0x5a2b17['query'][_0xbbd7('0x56')]){_0x9d9668[_0xbbd7('0x57')]=[{'model':db['CmContact'],'as':_0xbbd7('0xce'),'required':![]},{'model':db[_0xbbd7('0xcf')],'as':_0xbbd7('0xd0'),'attributes':[_0xbbd7('0x3c'),_0xbbd7('0xd1'),'internal'],'required':![]},{'model':db[_0xbbd7('0xd2')],'as':_0xbbd7('0xd3'),'attributes':['id',_0xbbd7('0x3c'),'color'],'where':_0x5a2b17[_0xbbd7('0x44')][_0xbbd7('0xd4')]?{'id':_0x5a2b17[_0xbbd7('0x44')][_0xbbd7('0xd4')]}:undefined,'required':_0x5a2b17[_0xbbd7('0x44')][_0xbbd7('0xd4')]?!![]:![]}];}return db['SmsInteraction'][_0xbbd7('0x58')](_0x9d9668);})[_0xbbd7('0x24')](function(_0x4efb33){_0x459558['rows']=_0x4efb33;return _0x459558;});}})[_0xbbd7('0x24')](respondWithFilteredResult(_0x2beb4b,_0x9d9668))[_0xbbd7('0x59')](handleError(_0x2beb4b,null));};exports[_0xbbd7('0x3d')]=function(_0x117c17,_0x83fc6e,_0x21b752){var _0x19992b,_0x40d0b9,_0x68c78e;if(_[_0xbbd7('0x98')](_0x117c17[_0xbbd7('0x5f')][_0xbbd7('0x5f')])||_0x117c17[_0xbbd7('0x5f')][_0xbbd7('0x5f')]===''){throw new db[(_0xbbd7('0x9a'))][(_0xbbd7('0x7b'))](_0xbbd7('0x9b'));}if(_[_0xbbd7('0x98')](_0x117c17['body']['to'])){throw new db[(_0xbbd7('0x9a'))][(_0xbbd7('0x7b'))](_0xbbd7('0xd5'));}_0x19992b=_0x117c17['body']['to'];return db[_0xbbd7('0x41')][_0xbbd7('0x5d')]({'where':{'id':_0x117c17[_0xbbd7('0x66')]['id']},'include':[{'model':db['CmList'],'as':_0xbbd7('0xd6'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x19992b},'limit':0x1,'order':[[_0xbbd7('0x7e'),'DESC']]}]}]})[_0xbbd7('0x24')](handleEntityNotFound(_0x83fc6e,null))[_0xbbd7('0x24')](function(_0x1fb5c0){if(_0x1fb5c0&&_0x1fb5c0[_0xbbd7('0xd6')]){_0x40d0b9=_0x1fb5c0[_0xbbd7('0x3a')]({'plain':!![]});if(_0x40d0b9[_0xbbd7('0xd6')]&&_0x40d0b9[_0xbbd7('0xd6')][_0xbbd7('0xa2')]['length']){return _0x40d0b9[_0xbbd7('0xd6')]['Contacts'][0x0];}return db[_0xbbd7('0xa1')][_0xbbd7('0x5e')](_['defaults'](_0x117c17[_0xbbd7('0x5f')],{'firstName':_0x19992b,'mobile':_0x19992b,'phone':_0x19992b,'ListId':_0x40d0b9['ListId']}));}})['then'](handleEntityNotFound(_0x83fc6e,null))['then'](function(_0x5acb09){if(_0x5acb09){_0x68c78e=_0x5acb09;return db[_0xbbd7('0xa8')]['find']({'where':{'ContactId':_0x68c78e['id'],'closed':![],'SmsAccountId':_0x40d0b9['id']}})['then'](function(_0xff89fc){if(_0xff89fc){return[_0xff89fc,![]];}return db[_0xbbd7('0xa8')][_0xbbd7('0x5e')]({'UserId':_0x117c17['user']['id'],'ContactId':_0x68c78e['id'],'SmsAccountId':_0x40d0b9['id'],'phone':_0x19992b,'firstMsgDirection':_0xbbd7('0xd7'),'Messages':[_[_0xbbd7('0x54')](_0x117c17[_0xbbd7('0x5f')],{'read':![],'body':_0x117c17['body'][_0xbbd7('0x5f')],'phone':_0x19992b,'SmsAccountId':_0x40d0b9['id'],'UserId':_0x117c17['user']['id'],'ContactId':_0x68c78e['id']})]},{'include':[{'model':db[_0xbbd7('0xb0')],'as':_0xbbd7('0xd8')}]})[_0xbbd7('0x24')](function(_0x34b4a1){return[_0x34b4a1,!![]];});});}})[_0xbbd7('0xa9')](function(_0x29e2d7,_0x3a8bee){if(_0x3a8bee){return _0x29e2d7;}return db[_0xbbd7('0xb0')][_0xbbd7('0x5e')](_['merge'](_0x117c17[_0xbbd7('0x5f')],{'read':![],'body':_0x117c17[_0xbbd7('0x5f')][_0xbbd7('0x5f')],'phone':_0x19992b,'SmsAccountId':_0x40d0b9['id'],'SmsInteractionId':_0x29e2d7['id'],'UserId':_0x117c17['user']['id'],'ContactId':_0x68c78e['id']}))[_0xbbd7('0x24')](function(_0x18fa22){_0x29e2d7['dataValues']['Messages']=[];_0x29e2d7[_0xbbd7('0xd9')]['Messages'][_0xbbd7('0xac')](_0x18fa22['dataValues']);return _0x29e2d7;});})[_0xbbd7('0x24')](respondWithResult(_0x83fc6e,null))[_0xbbd7('0x59')](handleError(_0x83fc6e,null));};exports['status']=function(_0x11cfe7,_0x57f17f,_0x3e58c6){if(_0x11cfe7[_0xbbd7('0x5f')]['id']){delete _0x11cfe7[_0xbbd7('0x5f')]['id'];}var _0x14dfc8,_0x19249d,_0x1f4de3;return db[_0xbbd7('0x41')][_0xbbd7('0x5d')]({'where':{'id':_0x11cfe7[_0xbbd7('0x66')]['id']}})['then'](handleEntityNotFound(_0x57f17f,null))['then'](function(_0x42a4c3){if(_0x42a4c3){_0x1f4de3=_0x42a4c3;logger[_0xbbd7('0xbe')](_0xbbd7('0xbc'),_0xbbd7('0x2d'),'received\x20delivery\x20report\x20from',_0x42a4c3[_0xbbd7('0x52')],util[_0xbbd7('0xda')](_0x11cfe7[_0xbbd7('0x5f')],{'showHidden':![],'depth':null}));switch(_0x42a4c3[_0xbbd7('0x52')]){case _0xbbd7('0xdb'):if(_0x11cfe7[_0xbbd7('0x5f')]['skebby_dispatch_id']&&_0x11cfe7['body'][_0xbbd7('0x2d')]){_0x19249d=_0x11cfe7['body'][_0xbbd7('0x2d')];return db['SmsMessage']['find']({'where':{'messageId':_0x11cfe7[_0xbbd7('0x5f')][_0xbbd7('0xdc')]}});}break;case _0xbbd7('0xdd'):if(_0x11cfe7[_0xbbd7('0x5f')]['requestid']&&_0x11cfe7[_0xbbd7('0x5f')][_0xbbd7('0xde')]){_0x19249d=_0x11cfe7['body'][_0xbbd7('0xde')];return db[_0xbbd7('0xb0')][_0xbbd7('0x5d')]({'where':{'messageId':_0x11cfe7['body'][_0xbbd7('0xdf')]}});}break;case _0xbbd7('0x8a'):if(_0x11cfe7[_0xbbd7('0x5f')][_0xbbd7('0xe0')]&&_0x11cfe7[_0xbbd7('0x5f')][_0xbbd7('0xe1')]){_0x19249d=_0x11cfe7[_0xbbd7('0x5f')][_0xbbd7('0xe1')];return db['SmsMessage'][_0xbbd7('0x5d')]({'where':{'messageId':_0x11cfe7[_0xbbd7('0x5f')][_0xbbd7('0xe0')]}});}break;case'infobip':var _0x4c9cc4=_0x11cfe7[_0xbbd7('0x5f')]['results'][0x0];if(_0x4c9cc4[_0xbbd7('0x85')]&&_0x4c9cc4[_0xbbd7('0x2d')]['groupName']===_0xbbd7('0xe2')){_0x19249d=_0x4c9cc4[_0xbbd7('0x2d')][_0xbbd7('0xe3')];return db[_0xbbd7('0xb0')][_0xbbd7('0x5d')]({'where':{'messageId':_0x4c9cc4[_0xbbd7('0x85')]}});}break;case'clickatell':if(_0x11cfe7[_0xbbd7('0x5f')][_0xbbd7('0x85')]&&_0x11cfe7[_0xbbd7('0x5f')][_0xbbd7('0x2d')]){_0x19249d=_0x11cfe7[_0xbbd7('0x5f')][_0xbbd7('0x2d')];return db[_0xbbd7('0xb0')][_0xbbd7('0x5d')]({'where':{'messageId':_0x11cfe7[_0xbbd7('0x5f')]['messageId']}});}break;case'bandwidth':if(_0x11cfe7[_0xbbd7('0x5f')][0x0][_0xbbd7('0x2b')]['id']){_0x19249d=_0x11cfe7['body'][0x0]['type'];return db['SmsMessage'][_0xbbd7('0x5d')]({'where':{'messageId':_0x11cfe7['body'][0x0][_0xbbd7('0x2b')]['id']}});}break;case'intelepeer':if(_0x11cfe7['body']['redif']&&_0x11cfe7[_0xbbd7('0x5f')][_0xbbd7('0x2d')]){_0x19249d=_0x11cfe7[_0xbbd7('0x5f')][_0xbbd7('0x2d')];return db[_0xbbd7('0xb0')][_0xbbd7('0x5d')]({'where':{'messageId':_0x11cfe7[_0xbbd7('0x5f')][_0xbbd7('0xe4')]}});}break;}}})['then'](handleEntityNotFound(_0x57f17f,null))[_0xbbd7('0x24')](function(_0x5ee853){if(_0x5ee853){_0x14dfc8=_0x5ee853;switch(_0x1f4de3[_0xbbd7('0x52')]){case _0xbbd7('0xdb'):if(_0x19249d===_0xbbd7('0xe2')){return _0x14dfc8[_0xbbd7('0x38')]({'read':!![]});}else{logger[_0xbbd7('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbbd7('0x2d'),_0xbbd7('0xdb'),util['inspect'](_0x11cfe7['body'],{'showHidden':![],'depth':null}));}break;case _0xbbd7('0xdd'):if(_0x19249d==='1'){return _0x14dfc8['update']({'read':!![]});}else{logger[_0xbbd7('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbbd7('0x2d'),_0xbbd7('0xdb'),util[_0xbbd7('0xda')](_0x11cfe7[_0xbbd7('0x5f')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x11cfe7[_0xbbd7('0x5f')]['error_code']&&_0x19249d>=0xc8&&_0x19249d<=0xce){return _0x14dfc8['update']({'read':!![]});}else{logger[_0xbbd7('0x2a')](_0xbbd7('0xbc'),_0xbbd7('0x2d'),_0xbbd7('0x8a'),util['inspect'](_0x11cfe7[_0xbbd7('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xbbd7('0xe5'):var _0x207c14=_0x11cfe7[_0xbbd7('0x5f')][_0xbbd7('0x8f')][0x0];if(_0x207c14[_0xbbd7('0x2d')][_0xbbd7('0xe3')]===_0xbbd7('0xe2')){return _0x14dfc8[_0xbbd7('0x38')]({'read':!![]});}else{logger[_0xbbd7('0x2a')](_0xbbd7('0xbc'),_0xbbd7('0x2d'),'infobip',util[_0xbbd7('0xda')](_0x11cfe7[_0xbbd7('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xbbd7('0xe6'):if(_0x19249d==_0xbbd7('0xe7')||_0x19249d==_0xbbd7('0xe8')){return _0x14dfc8[_0xbbd7('0x38')]({'read':!![]});}else{logger[_0xbbd7('0x2a')](_0xbbd7('0xbc'),_0xbbd7('0x2d'),_0xbbd7('0xe6'),util[_0xbbd7('0xda')](_0x11cfe7[_0xbbd7('0x5f')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x19249d==_0xbbd7('0xe9')){return _0x14dfc8['update']({'read':!![]});}else{logger[_0xbbd7('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbbd7('0x2d'),_0xbbd7('0x95'),util[_0xbbd7('0xda')](_0x11cfe7[_0xbbd7('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xbbd7('0x96'):if(_0x19249d===_0xbbd7('0xea')||_0x19249d==='ACCEPTD'){return _0x14dfc8['update']({'read':!![]});}else{logger[_0xbbd7('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbbd7('0x2d'),_0xbbd7('0x96'),util['inspect'](_0x11cfe7['body'],{'showHidden':![],'depth':null}));}break;}return _0x14dfc8;}})[_0xbbd7('0x24')](respondWithResult(_0x57f17f,null))['catch'](handleError(_0x57f17f,null));};exports['statusGet']=function(_0x59788b,_0x4a9d18,_0x57f92f){var _0x17623f,_0x19dd05,_0x3ae4d1;return db[_0xbbd7('0x41')]['find']({'where':{'id':_0x59788b[_0xbbd7('0x66')]['id']}})[_0xbbd7('0x24')](handleEntityNotFound(_0x4a9d18,null))[_0xbbd7('0x24')](function(_0x4988c2){if(_0x4988c2){_0x3ae4d1=_0x4988c2;logger[_0xbbd7('0xbe')](_0xbbd7('0xbc'),'status','received\x20delivery\x20report\x20from',_0x4988c2['type'],util[_0xbbd7('0xda')](_0x59788b[_0xbbd7('0x44')],{'showHidden':![],'depth':null}));switch(_0x4988c2[_0xbbd7('0x52')]){case'csc':if(_0x59788b['query'][_0xbbd7('0xeb')]&&_0x59788b['query'][_0xbbd7('0xec')]){_0x19dd05=_0x59788b[_0xbbd7('0x44')][_0xbbd7('0xec')];return db[_0xbbd7('0xb0')][_0xbbd7('0x5d')]({'where':{'messageId':_0x59788b[_0xbbd7('0x44')][_0xbbd7('0xeb')]}});}break;}}})[_0xbbd7('0x24')](handleEntityNotFound(_0x4a9d18,null))['then'](function(_0x3eb12c){if(_0x3eb12c){_0x17623f=_0x3eb12c;switch(_0x3ae4d1[_0xbbd7('0x52')]){case _0xbbd7('0x90'):if(_0x19dd05==='2'||_0x19dd05==='6'){return _0x17623f[_0xbbd7('0x38')]({'read':!![]});}else{logger['error'](_0xbbd7('0xbc'),'status',_0xbbd7('0x90'),util[_0xbbd7('0xda')](_0x59788b['query'],{'showHidden':![],'depth':null}));};break;}return _0x17623f;}})[_0xbbd7('0x24')](respondWithResult(_0x4a9d18,null))[_0xbbd7('0x59')](handleError(_0x4a9d18,null));};exports[_0xbbd7('0xed')]=function(_0x44cff6,_0x4f6ee6,_0xb13721){return db[_0xbbd7('0x41')][_0xbbd7('0x5d')]({'where':{'id':_0x44cff6['params']['id']}})[_0xbbd7('0x24')](handleEntityNotFound(_0x4f6ee6,null))[_0xbbd7('0x24')](function(_0x360b03){if(_0x360b03){return _0x360b03[_0xbbd7('0xed')](_0x44cff6['body']['ids'],_[_0xbbd7('0xa5')](_0x44cff6['body'],[_0xbbd7('0x6f'),'id'])||{})[_0xbbd7('0xa9')](function(_0xbb147c){for(var _0x2ae9e2=0x0;_0x2ae9e2<_0x44cff6[_0xbbd7('0x5f')]['ids']['length'];_0x2ae9e2+=0x1){socket[_0xbbd7('0xee')](_0xbbd7('0xef'),{'UserId':Number(_0x44cff6['body'][_0xbbd7('0x6f')][_0x2ae9e2]),'SmsAccountId':Number(_0x44cff6[_0xbbd7('0x66')]['id'])});}return _0xbb147c;});}})[_0xbbd7('0x24')](respondWithResult(_0x4f6ee6,null))[_0xbbd7('0x59')](handleError(_0x4f6ee6,null));};exports[_0xbbd7('0xf0')]=function(_0x154d66,_0x55ce50,_0x5b4b9f){return db['SmsAccount'][_0xbbd7('0x5d')]({'where':{'id':_0x154d66[_0xbbd7('0x66')]['id']}})[_0xbbd7('0x24')](handleEntityNotFound(_0x55ce50,null))['then'](function(_0x45d2b7){if(_0x45d2b7){return _0x45d2b7['removeAgents'](_0x154d66[_0xbbd7('0x44')]['ids'])['then'](function(){if(_[_0xbbd7('0xf1')](_0x154d66[_0xbbd7('0x44')][_0xbbd7('0x6f')])){for(var _0x2f0332=0x0;_0x2f0332<_0x154d66['query']['ids'][_0xbbd7('0x4a')];_0x2f0332+=0x1){socket[_0xbbd7('0xee')]('userSmsAccount:remove',{'UserId':Number(_0x154d66[_0xbbd7('0x44')]['ids'][_0x2f0332]),'SmsAccountId':Number(_0x154d66[_0xbbd7('0x66')]['id'])});}}else{socket[_0xbbd7('0xee')](_0xbbd7('0xf2'),{'UserId':Number(_0x154d66[_0xbbd7('0x44')][_0xbbd7('0x6f')]),'SmsAccountId':Number(_0x154d66['params']['id'])});}});}})[_0xbbd7('0x24')](respondWithStatusCode(_0x55ce50,null))[_0xbbd7('0x59')](handleError(_0x55ce50,null));};exports[_0xbbd7('0xf3')]=function(_0xd95894,_0x1d4e29,_0x3e3f60){var _0x28b5a7={};var _0x5522ae={};var _0xd457ed;var _0x2a4add;return db[_0xbbd7('0x41')][_0xbbd7('0x69')]({'where':{'id':_0xd95894[_0xbbd7('0x66')]['id']}})[_0xbbd7('0x24')](handleEntityNotFound(_0x1d4e29,null))[_0xbbd7('0x24')](function(_0x24fcf4){if(_0x24fcf4){_0xd457ed=_0x24fcf4;_0x5522ae[_0xbbd7('0x47')]=_[_0xbbd7('0x45')](db[_0xbbd7('0xcf')]['rawAttributes']);_0x5522ae[_0xbbd7('0x44')]=_['keys'](_0xd95894['query']);_0x5522ae[_0xbbd7('0x4f')]=_[_0xbbd7('0x46')](_0x5522ae[_0xbbd7('0x47')],_0x5522ae[_0xbbd7('0x44')]);_0x28b5a7[_0xbbd7('0x48')]=_[_0xbbd7('0x46')](_0x5522ae[_0xbbd7('0x47')],qs['fields'](_0xd95894[_0xbbd7('0x44')]['fields']));_0x28b5a7[_0xbbd7('0x48')]=_0x28b5a7[_0xbbd7('0x48')][_0xbbd7('0x4a')]?_0x28b5a7[_0xbbd7('0x48')]:_0x5522ae[_0xbbd7('0x47')];_0x28b5a7['order']=qs[_0xbbd7('0x4e')](_0xd95894[_0xbbd7('0x44')][_0xbbd7('0x4e')]);_0x28b5a7[_0xbbd7('0x51')]=qs[_0xbbd7('0x4f')](_[_0xbbd7('0x6b')](_0xd95894[_0xbbd7('0x44')],_0x5522ae['filters']));if(_0xd95894[_0xbbd7('0x44')][_0xbbd7('0x50')]){_0x28b5a7[_0xbbd7('0x51')]=_['merge'](_0x28b5a7['where'],{'$or':_[_0xbbd7('0x40')](_0x28b5a7[_0xbbd7('0x48')],function(_0x18fe99){var _0x1de00a={};_0x1de00a[_0x18fe99]={'$like':'%'+_0xd95894[_0xbbd7('0x44')][_0xbbd7('0x50')]+'%'};return _0x1de00a;})});}_0x28b5a7=_[_0xbbd7('0x54')]({},_0x28b5a7,_0xd95894[_0xbbd7('0x55')]);return _0xd457ed[_0xbbd7('0xf3')](_0x28b5a7);}})['then'](function(_0x19358c){if(_0x19358c){_0x2a4add=_0x19358c[_0xbbd7('0x4a')];if(!_0xd95894[_0xbbd7('0x44')][_0xbbd7('0x4b')](_0xbbd7('0x4c'))){_0x28b5a7[_0xbbd7('0x32')]=qs[_0xbbd7('0x32')](_0xd95894[_0xbbd7('0x44')]['limit']);_0x28b5a7[_0xbbd7('0x30')]=qs[_0xbbd7('0x30')](_0xd95894[_0xbbd7('0x44')]['offset']);}return _0xd457ed[_0xbbd7('0xf3')](_0x28b5a7);}})[_0xbbd7('0x24')](function(_0x8d75a5){if(_0x8d75a5){return _0x8d75a5?{'count':_0x2a4add,'rows':_0x8d75a5}:null;}})[_0xbbd7('0x24')](respondWithResult(_0x1d4e29,null))[_0xbbd7('0x59')](handleError(_0x1d4e29,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 21df436..c04d20d 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 _0x7b84=['hasOwnProperty','hook','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x33a974,_0x3becaa){var _0x1f85b9=function(_0x2afaf4){while(--_0x2afaf4){_0x33a974['push'](_0x33a974['shift']());}};_0x1f85b9(++_0x3becaa);}(_0x7b84,0x17e));var _0x47b8=function(_0x5cf8d5,_0x156e1a){_0x5cf8d5=_0x5cf8d5-0x0;var _0x31063e=_0x7b84[_0x5cf8d5];return _0x31063e;};'use strict';var EventEmitter=require(_0x47b8('0x0'));var SmsAccount=require(_0x47b8('0x1'))['db'][_0x47b8('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x47b8('0x3')](0x0);var events={'afterCreate':_0x47b8('0x4'),'afterUpdate':_0x47b8('0x5'),'afterDestroy':_0x47b8('0x6')};function emitEvent(_0x51fbce){return function(_0x7db06f,_0x561ed1,_0x17a250){SmsAccountEvents[_0x47b8('0x7')](_0x51fbce+':'+_0x7db06f['id'],_0x7db06f);SmsAccountEvents[_0x47b8('0x7')](_0x51fbce,_0x7db06f);_0x17a250(null);};}for(var e in events){if(events[_0x47b8('0x8')](e)){var event=events[e];SmsAccount[_0x47b8('0x9')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xd865=['exports','../../mysqldb','SmsAccount','save','update','hasOwnProperty','hook'];(function(_0x597630,_0x336fea){var _0x471aa8=function(_0x26740c){while(--_0x26740c){_0x597630['push'](_0x597630['shift']());}};_0x471aa8(++_0x336fea);}(_0xd865,0xef));var _0x5d86=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd865[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x5d86('0x0'))['db'][_0x5d86('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5d86('0x2'),'afterUpdate':_0x5d86('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5615a5){return function(_0x5f1d74,_0x50c144,_0x533137){SmsAccountEvents['emit'](_0x5615a5+':'+_0x5f1d74['id'],_0x5f1d74);SmsAccountEvents['emit'](_0x5615a5,_0x5f1d74);_0x533137(null);};}for(var e in events){if(events[_0x5d86('0x4')](e)){var event=events[e];SmsAccount[_0x5d86('0x5')](e,emitEvent(event));}}module[_0x5d86('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 6830d02..22a2b53 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 _0x4d89=['./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1a80f2,_0x358d14){var _0x119a65=function(_0x5cc00b){while(--_0x5cc00b){_0x1a80f2['push'](_0x1a80f2['shift']());}};_0x119a65(++_0x358d14);}(_0x4d89,0xdd));var _0x94d8=function(_0x48bfeb,_0x4e3f39){_0x48bfeb=_0x48bfeb-0x0;var _0x316058=_0x4d89[_0x48bfeb];return _0x316058;};'use strict';var _=require(_0x94d8('0x0'));var util=require(_0x94d8('0x1'));var logger=require(_0x94d8('0x2'))(_0x94d8('0x3'));var moment=require(_0x94d8('0x4'));var BPromise=require(_0x94d8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94d8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x94d8('0x7'));module[_0x94d8('0x8')]=function(_0x17e444,_0x262b60){return _0x17e444[_0x94d8('0x9')](_0x94d8('0xa'),attributes,{'tableName':_0x94d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x168b=['lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount'];(function(_0x5b54fd,_0x1a8bf1){var _0x4b14e4=function(_0x6b736b){while(--_0x6b736b){_0x5b54fd['push'](_0x5b54fd['shift']());}};_0x4b14e4(++_0x1a8bf1);}(_0x168b,0x1e0));var _0xb168=function(_0x44e4e8,_0x254701){_0x44e4e8=_0x44e4e8-0x0;var _0x574ad3=_0x168b[_0x44e4e8];return _0x574ad3;};'use strict';var _=require(_0xb168('0x0'));var util=require('util');var logger=require(_0xb168('0x1'))(_0xb168('0x2'));var moment=require(_0xb168('0x3'));var BPromise=require(_0xb168('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb168('0x5'));var config=require(_0xb168('0x6'));var attributes=require(_0xb168('0x7'));module['exports']=function(_0x2d7e3a,_0x591dc6){return _0x2d7e3a[_0xb168('0x8')](_0xb168('0x9'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index e0a777c..4bd0013 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 _0x6ff4=['include','map','model','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowSmsAccount','SmsAccount','options','where'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6ff4,0x94));var _0x46ff=function(_0x2c1dd3,_0xe5f383){_0x2c1dd3=_0x2c1dd3-0x0;var _0x3ac491=_0x6ff4[_0x2c1dd3];return _0x3ac491;};'use strict';var _=require(_0x46ff('0x0'));var util=require(_0x46ff('0x1'));var moment=require(_0x46ff('0x2'));var BPromise=require(_0x46ff('0x3'));var rs=require(_0x46ff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46ff('0x5'))['db'];var utils=require(_0x46ff('0x6'));var logger=require('../../config/logger')(_0x46ff('0x7'));var config=require(_0x46ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46ff('0x9')][_0x46ff('0xa')]({'port':0x232a});config['redis']=_[_0x46ff('0xb')](config[_0x46ff('0xc')],{'host':_0x46ff('0xd'),'port':0x18eb});var socket=require(_0x46ff('0xe'))(new Redis(config[_0x46ff('0xc')]));require(_0x46ff('0xf'))[_0x46ff('0x10')](socket);function respondWithRpcPromise(_0x476545,_0x100b4a,_0x34151f){return new BPromise(function(_0x58f8d7,_0x3681dd){return client[_0x46ff('0x11')](_0x476545,_0x34151f)['then'](function(_0x559c92){logger['info'](_0x46ff('0x12'),_0x100b4a,_0x46ff('0x13'));logger[_0x46ff('0x14')](_0x46ff('0x15'),_0x100b4a,_0x46ff('0x13'),JSON[_0x46ff('0x16')](_0x559c92));if(_0x559c92[_0x46ff('0x17')]){if(_0x559c92['error'][_0x46ff('0x18')]===0x1f4){logger[_0x46ff('0x17')](_0x46ff('0x12'),_0x100b4a,_0x559c92[_0x46ff('0x17')][_0x46ff('0x19')]);return _0x3681dd(_0x559c92['error'][_0x46ff('0x19')]);}logger[_0x46ff('0x17')](_0x46ff('0x12'),_0x100b4a,_0x559c92['error'][_0x46ff('0x19')]);return _0x58f8d7(_0x559c92[_0x46ff('0x17')][_0x46ff('0x19')]);}else{logger[_0x46ff('0x1a')](_0x46ff('0x12'),_0x100b4a,_0x46ff('0x13'));_0x58f8d7(_0x559c92['result'][_0x46ff('0x19')]);}})[_0x46ff('0x1b')](function(_0x5cd902){logger[_0x46ff('0x17')](_0x46ff('0x12'),_0x100b4a,_0x5cd902);_0x3681dd(_0x5cd902);});});}exports[_0x46ff('0x1c')]=function(_0x25224c){var _0x419d74=this;return new Promise(function(_0x21b3e6,_0x39489e){return db[_0x46ff('0x1d')]['find']({'raw':_0x25224c[_0x46ff('0x1e')]?_0x25224c[_0x46ff('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x25224c[_0x46ff('0x1e')]?_0x25224c[_0x46ff('0x1e')][_0x46ff('0x1f')]||null:null,'attributes':_0x25224c[_0x46ff('0x1e')]?_0x25224c[_0x46ff('0x1e')]['attributes']||null:null,'include':_0x25224c['options']?_0x25224c[_0x46ff('0x1e')][_0x46ff('0x20')]?_[_0x46ff('0x21')](_0x25224c[_0x46ff('0x1e')][_0x46ff('0x20')],function(_0x493e00){return{'model':db[_0x493e00[_0x46ff('0x22')]],'as':_0x493e00['as'],'attributes':_0x493e00[_0x46ff('0x23')],'include':_0x493e00['include']?_['map'](_0x493e00[_0x46ff('0x20')],function(_0x253b0e){return{'model':db[_0x253b0e[_0x46ff('0x22')]],'as':_0x253b0e['as'],'attributes':_0x253b0e['attributes'],'include':_0x253b0e[_0x46ff('0x20')]?_[_0x46ff('0x21')](_0x253b0e[_0x46ff('0x20')],function(_0x56b16c){return{'model':db[_0x56b16c['model']],'as':_0x56b16c['as'],'attributes':_0x56b16c[_0x46ff('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x502128){logger[_0x46ff('0x1a')]('ShowSmsAccount',_0x25224c);logger[_0x46ff('0x14')](_0x46ff('0x1c'),_0x25224c,JSON[_0x46ff('0x16')](_0x502128));_0x21b3e6(_0x502128);})['catch'](function(_0x4e5599){logger[_0x46ff('0x17')](_0x46ff('0x1c'),_0x4e5599[_0x46ff('0x19')],_0x25224c);_0x39489e(_0x419d74[_0x46ff('0x17')](0x1f4,_0x4e5599['message']));});});}; \ No newline at end of file +var _0xe2f9=['request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register'];(function(_0x109a85,_0x42a369){var _0x5b8370=function(_0x2df52f){while(--_0x2df52f){_0x109a85['push'](_0x109a85['shift']());}};_0x5b8370(++_0x42a369);}(_0xe2f9,0x100));var _0x9e2f=function(_0x5a21a4,_0xc836c4){_0x5a21a4=_0x5a21a4-0x0;var _0x3dc8d7=_0xe2f9[_0x5a21a4];return _0x3dc8d7;};'use strict';var _=require(_0x9e2f('0x0'));var util=require(_0x9e2f('0x1'));var moment=require(_0x9e2f('0x2'));var BPromise=require(_0x9e2f('0x3'));var rs=require(_0x9e2f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e2f('0x5'))['db'];var utils=require(_0x9e2f('0x6'));var logger=require(_0x9e2f('0x7'))(_0x9e2f('0x8'));var config=require(_0x9e2f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9e2f('0xa')]['http']({'port':0x232a});config[_0x9e2f('0xb')]=_[_0x9e2f('0xc')](config[_0x9e2f('0xb')],{'host':_0x9e2f('0xd'),'port':0x18eb});var socket=require(_0x9e2f('0xe'))(new Redis(config['redis']));require(_0x9e2f('0xf'))[_0x9e2f('0x10')](socket);function respondWithRpcPromise(_0x12ef24,_0x38a6c5,_0x554922){return new BPromise(function(_0x382e92,_0x3d374a){return client[_0x9e2f('0x11')](_0x12ef24,_0x554922)[_0x9e2f('0x12')](function(_0x5b2bd8){logger[_0x9e2f('0x13')]('SmsAccount,\x20%s,\x20%s',_0x38a6c5,_0x9e2f('0x14'));logger[_0x9e2f('0x15')](_0x9e2f('0x16'),_0x38a6c5,_0x9e2f('0x14'),JSON[_0x9e2f('0x17')](_0x5b2bd8));if(_0x5b2bd8['error']){if(_0x5b2bd8[_0x9e2f('0x18')][_0x9e2f('0x19')]===0x1f4){logger[_0x9e2f('0x18')]('SmsAccount,\x20%s,\x20%s',_0x38a6c5,_0x5b2bd8[_0x9e2f('0x18')][_0x9e2f('0x1a')]);return _0x3d374a(_0x5b2bd8[_0x9e2f('0x18')][_0x9e2f('0x1a')]);}logger[_0x9e2f('0x18')]('SmsAccount,\x20%s,\x20%s',_0x38a6c5,_0x5b2bd8[_0x9e2f('0x18')]['message']);return _0x382e92(_0x5b2bd8[_0x9e2f('0x18')]['message']);}else{logger[_0x9e2f('0x13')](_0x9e2f('0x1b'),_0x38a6c5,'request\x20sent');_0x382e92(_0x5b2bd8['result']['message']);}})[_0x9e2f('0x1c')](function(_0x25dbda){logger[_0x9e2f('0x18')](_0x9e2f('0x1b'),_0x38a6c5,_0x25dbda);_0x3d374a(_0x25dbda);});});}exports[_0x9e2f('0x1d')]=function(_0x231fc6){var _0x4974e8=this;return new Promise(function(_0x5c7727,_0x3467af){return db[_0x9e2f('0x1e')][_0x9e2f('0x1f')]({'raw':_0x231fc6[_0x9e2f('0x20')]?_0x231fc6[_0x9e2f('0x20')][_0x9e2f('0x21')]===undefined?!![]:![]:!![],'where':_0x231fc6[_0x9e2f('0x20')]?_0x231fc6[_0x9e2f('0x20')][_0x9e2f('0x22')]||null:null,'attributes':_0x231fc6[_0x9e2f('0x20')]?_0x231fc6[_0x9e2f('0x20')][_0x9e2f('0x23')]||null:null,'include':_0x231fc6[_0x9e2f('0x20')]?_0x231fc6[_0x9e2f('0x20')][_0x9e2f('0x24')]?_[_0x9e2f('0x25')](_0x231fc6[_0x9e2f('0x20')][_0x9e2f('0x24')],function(_0x1f88ba){return{'model':db[_0x1f88ba[_0x9e2f('0x26')]],'as':_0x1f88ba['as'],'attributes':_0x1f88ba['attributes'],'include':_0x1f88ba['include']?_[_0x9e2f('0x25')](_0x1f88ba[_0x9e2f('0x24')],function(_0x35ae8b){return{'model':db[_0x35ae8b['model']],'as':_0x35ae8b['as'],'attributes':_0x35ae8b[_0x9e2f('0x23')],'include':_0x35ae8b[_0x9e2f('0x24')]?_[_0x9e2f('0x25')](_0x35ae8b['include'],function(_0x35b9b9){return{'model':db[_0x35b9b9[_0x9e2f('0x26')]],'as':_0x35b9b9['as'],'attributes':_0x35b9b9['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e2f('0x12')](function(_0x1bf8b1){logger[_0x9e2f('0x13')](_0x9e2f('0x1d'),_0x231fc6);logger[_0x9e2f('0x15')](_0x9e2f('0x1d'),_0x231fc6,JSON[_0x9e2f('0x17')](_0x1bf8b1));_0x5c7727(_0x1bf8b1);})[_0x9e2f('0x1c')](function(_0x1901ef){logger[_0x9e2f('0x18')](_0x9e2f('0x1d'),_0x1901ef[_0x9e2f('0x1a')],_0x231fc6);_0x3467af(_0x4974e8[_0x9e2f('0x18')](0x1f4,_0x1901ef[_0x9e2f('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 2bbc6af..435eac1 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 d05a657..187f35c 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 _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x577c27,_0xb2403c){var _0xeaaf80=function(_0x352b18){while(--_0x352b18){_0x577c27['push'](_0x577c27['shift']());}};_0xeaaf80(++_0xb2403c);}(_0x7217,0x19e));var _0x7721=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x7217[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 42e76b6..766d246 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 _0x6868=['sequelize','exports','INTEGER','STRING','noop'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0x6868,0x131));var _0x8686=function(_0x2d40ba,_0x245636){_0x2d40ba=_0x2d40ba-0x0;var _0x24c864=_0x6868[_0x2d40ba];return _0x24c864;};'use strict';var Sequelize=require(_0x8686('0x0'));module[_0x8686('0x1')]={'priority':{'type':Sequelize[_0x8686('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8686('0x3')],'allowNull':![],'defaultValue':_0x8686('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x8686('0x3')]},'interval':{'type':Sequelize[_0x8686('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xba2b=['TEXT','STRING','sequelize','exports','INTEGER'];(function(_0x1658ac,_0x120fc4){var _0x41ea42=function(_0xccf5ea){while(--_0xccf5ea){_0x1658ac['push'](_0x1658ac['shift']());}};_0x41ea42(++_0x120fc4);}(_0xba2b,0x70));var _0xbba2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba2b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbba2('0x0'));module[_0xbba2('0x1')]={'priority':{'type':Sequelize[_0xbba2('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbba2('0x3')]()},'description':{'type':Sequelize[_0xbba2('0x4')]},'interval':{'type':Sequelize[_0xbba2('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 1509777..1eec764 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 _0x0998=['end','error','stack','name','send','index','SmsApplication','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','options','include','rows','params','rawAttributes','includeAll','find','create','body','catch','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','set','json','apply','reject','save','then','destroy'];(function(_0x1a7ca9,_0x1d026b){var _0x1a9241=function(_0x51da72){while(--_0x51da72){_0x1a7ca9['push'](_0x1a7ca9['shift']());}};_0x1a9241(++_0x1d026b);}(_0x0998,0x14a));var _0x8099=function(_0x2316dd,_0x568eaf){_0x2316dd=_0x2316dd-0x0;var _0x4a0dfe=_0x0998[_0x2316dd];return _0x4a0dfe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8099('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8099('0x1'));var rp=require('request-promise');var moment=require(_0x8099('0x2'));var BPromise=require(_0x8099('0x3'));var Mustache=require(_0x8099('0x4'));var util=require(_0x8099('0x5'));var path=require('path');var sox=require(_0x8099('0x6'));var csv=require(_0x8099('0x7'));var ejs=require(_0x8099('0x8'));var fs=require('fs');var fs_extra=require(_0x8099('0x9'));var _=require(_0x8099('0xa'));var squel=require(_0x8099('0xb'));var crypto=require(_0x8099('0xc'));var jsforce=require(_0x8099('0xd'));var deskjs=require(_0x8099('0xe'));var toCsv=require(_0x8099('0x7'));var querystring=require('querystring');var Papa=require(_0x8099('0xf'));var Redis=require(_0x8099('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8099('0x11'));var hardwareService=require(_0x8099('0x12'));var logger=require(_0x8099('0x13'))('api');var utils=require(_0x8099('0x14'));var config=require(_0x8099('0x15'));var licenseUtil=require(_0x8099('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1744ad,_0x6a4303){_0x6a4303=_0x6a4303||0xcc;return function(_0xbf8ecb){if(_0xbf8ecb){return _0x1744ad[_0x8099('0x17')](_0x6a4303);}return _0x1744ad[_0x8099('0x18')](_0x6a4303)['end']();};}function respondWithResult(_0x52fa4d,_0x4645ba){_0x4645ba=_0x4645ba||0xc8;return function(_0x16031b){if(_0x16031b){return _0x52fa4d[_0x8099('0x18')](_0x4645ba)['json'](_0x16031b);}};}function respondWithFilteredResult(_0x1449b9,_0x12707d){return function(_0x74224c){if(_0x74224c){var _0xe50b13=typeof _0x12707d[_0x8099('0x19')]==='undefined'&&typeof _0x12707d['limit']===_0x8099('0x1a');var _0x19374b=_0x74224c[_0x8099('0x1b')];var _0x163cc0=_0xe50b13?0x0:_0x12707d[_0x8099('0x19')];var _0x54aec6=_0xe50b13?_0x74224c[_0x8099('0x1b')]:_0x12707d['offset']+_0x12707d['limit'];var _0x12712d;if(_0x54aec6>=_0x19374b){_0x54aec6=_0x19374b;_0x12712d=0xc8;}else{_0x12712d=0xce;}_0x1449b9[_0x8099('0x18')](_0x12712d);return _0x1449b9[_0x8099('0x1c')]('Content-Range',_0x163cc0+'-'+_0x54aec6+'/'+_0x19374b)[_0x8099('0x1d')](_0x74224c);}return null;};}function patchUpdates(_0x227e1f){return function(_0x22c4e0){try{jsonpatch[_0x8099('0x1e')](_0x22c4e0,_0x227e1f,!![]);}catch(_0x48bbd7){return BPromise[_0x8099('0x1f')](_0x48bbd7);}return _0x22c4e0[_0x8099('0x20')]();};}function saveUpdates(_0x3f1dc4,_0x5837ab){return function(_0x3abc87){if(_0x3abc87){return _0x3abc87['update'](_0x3f1dc4)[_0x8099('0x21')](function(_0x272408){return _0x272408;});}return null;};}function removeEntity(_0x17a31f,_0x350734){return function(_0x392c02){if(_0x392c02){return _0x392c02[_0x8099('0x22')]()[_0x8099('0x21')](function(){_0x17a31f['status'](0xcc)[_0x8099('0x23')]();});}};}function handleEntityNotFound(_0x3c83de,_0x313fa7){return function(_0x7084ae){if(!_0x7084ae){_0x3c83de['sendStatus'](0x194);}return _0x7084ae;};}function handleError(_0x5d5a3b,_0x4caaac){_0x4caaac=_0x4caaac||0x1f4;return function(_0x86078c){logger[_0x8099('0x24')](_0x86078c[_0x8099('0x25')]);if(_0x86078c[_0x8099('0x26')]){delete _0x86078c[_0x8099('0x26')];}_0x5d5a3b[_0x8099('0x18')](_0x4caaac)[_0x8099('0x27')](_0x86078c);};}exports[_0x8099('0x28')]=function(_0x37c948,_0x13bcb0){var _0x378543={},_0x2e8d1b={},_0x4b89db={'count':0x0,'rows':[]};var _0x1b052f=_['map'](db[_0x8099('0x29')]['rawAttributes'],function(_0x36865f){return{'name':_0x36865f[_0x8099('0x2a')],'type':_0x36865f[_0x8099('0x2b')][_0x8099('0x2c')]};});_0x2e8d1b[_0x8099('0x2d')]=_[_0x8099('0x2e')](_0x1b052f,'name');_0x2e8d1b[_0x8099('0x2f')]=_[_0x8099('0x30')](_0x37c948[_0x8099('0x2f')]);_0x2e8d1b['filters']=_[_0x8099('0x31')](_0x2e8d1b[_0x8099('0x2d')],_0x2e8d1b[_0x8099('0x2f')]);_0x378543[_0x8099('0x32')]=_['intersection'](_0x2e8d1b[_0x8099('0x2d')],qs[_0x8099('0x33')](_0x37c948['query']['fields']));_0x378543[_0x8099('0x32')]=_0x378543['attributes'][_0x8099('0x34')]?_0x378543[_0x8099('0x32')]:_0x2e8d1b[_0x8099('0x2d')];if(!_0x37c948[_0x8099('0x2f')][_0x8099('0x35')](_0x8099('0x36'))){_0x378543['limit']=qs[_0x8099('0x37')](_0x37c948[_0x8099('0x2f')]['limit']);_0x378543[_0x8099('0x19')]=qs['offset'](_0x37c948['query']['offset']);}_0x378543[_0x8099('0x38')]=qs[_0x8099('0x39')](_0x37c948[_0x8099('0x2f')][_0x8099('0x39')]);_0x378543[_0x8099('0x3a')]=qs[_0x8099('0x3b')](_[_0x8099('0x3c')](_0x37c948[_0x8099('0x2f')],_0x2e8d1b[_0x8099('0x3b')]),_0x1b052f);if(_0x37c948['query']['filter']){_0x378543[_0x8099('0x3a')]=_[_0x8099('0x3d')](_0x378543[_0x8099('0x3a')],{'$or':_['map'](_0x1b052f,function(_0x12170f){if(_0x12170f[_0x8099('0x2b')]!==_0x8099('0x3e')){var _0x4277ad={};_0x4277ad[_0x12170f[_0x8099('0x26')]]={'$like':'%'+_0x37c948[_0x8099('0x2f')]['filter']+'%'};return _0x4277ad;}})});}_0x378543=_['merge']({},_0x378543,_0x37c948[_0x8099('0x3f')]);var _0x5a019a={'where':_0x378543[_0x8099('0x3a')]};return db[_0x8099('0x29')][_0x8099('0x1b')](_0x5a019a)['then'](function(_0x255287){_0x4b89db[_0x8099('0x1b')]=_0x255287;if(_0x37c948[_0x8099('0x2f')]['includeAll']){_0x378543[_0x8099('0x40')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x378543);})['then'](function(_0x25c6b8){_0x4b89db[_0x8099('0x41')]=_0x25c6b8;return _0x4b89db;})['then'](respondWithFilteredResult(_0x13bcb0,_0x378543))['catch'](handleError(_0x13bcb0,null));};exports['show']=function(_0x59bf9d,_0x580154){var _0x394a57={'raw':!![],'where':{'id':_0x59bf9d[_0x8099('0x42')]['id']}},_0x52c67d={};_0x52c67d[_0x8099('0x2d')]=_[_0x8099('0x30')](db[_0x8099('0x29')][_0x8099('0x43')]);_0x52c67d[_0x8099('0x2f')]=_[_0x8099('0x30')](_0x59bf9d[_0x8099('0x2f')]);_0x52c67d[_0x8099('0x3b')]=_[_0x8099('0x31')](_0x52c67d[_0x8099('0x2d')],_0x52c67d['query']);_0x394a57[_0x8099('0x32')]=_[_0x8099('0x31')](_0x52c67d[_0x8099('0x2d')],qs[_0x8099('0x33')](_0x59bf9d[_0x8099('0x2f')][_0x8099('0x33')]));_0x394a57[_0x8099('0x32')]=_0x394a57[_0x8099('0x32')][_0x8099('0x34')]?_0x394a57[_0x8099('0x32')]:_0x52c67d[_0x8099('0x2d')];if(_0x59bf9d[_0x8099('0x2f')][_0x8099('0x44')]){_0x394a57[_0x8099('0x40')]=[{'all':!![]}];}_0x394a57=_['merge']({},_0x394a57,_0x59bf9d[_0x8099('0x3f')]);return db[_0x8099('0x29')][_0x8099('0x45')](_0x394a57)['then'](handleEntityNotFound(_0x580154,null))[_0x8099('0x21')](respondWithResult(_0x580154,null))['catch'](handleError(_0x580154,null));};exports[_0x8099('0x46')]=function(_0x13b79f,_0x324991){return db[_0x8099('0x29')][_0x8099('0x46')](_0x13b79f[_0x8099('0x47')],{})[_0x8099('0x21')](respondWithResult(_0x324991,0xc9))['catch'](handleError(_0x324991,null));};exports['update']=function(_0x29ff3b,_0x3f6048){if(_0x29ff3b[_0x8099('0x47')]['id']){delete _0x29ff3b[_0x8099('0x47')]['id'];}return db[_0x8099('0x29')][_0x8099('0x45')]({'where':{'id':_0x29ff3b['params']['id']}})[_0x8099('0x21')](handleEntityNotFound(_0x3f6048,null))['then'](saveUpdates(_0x29ff3b[_0x8099('0x47')],null))['then'](respondWithResult(_0x3f6048,null))['catch'](handleError(_0x3f6048,null));};exports[_0x8099('0x22')]=function(_0x4c5138,_0x257b51){return db[_0x8099('0x29')]['find']({'where':{'id':_0x4c5138[_0x8099('0x42')]['id']}})[_0x8099('0x21')](handleEntityNotFound(_0x257b51,null))[_0x8099('0x21')](removeEntity(_0x257b51,null))[_0x8099('0x48')](handleError(_0x257b51,null));}; \ No newline at end of file +var _0xe7ae=['params','keys','options','find','catch','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../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','update','then','end','error','stack','name','index','map','SmsApplication','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','includeAll','include','rows','show'];(function(_0x5e8115,_0x291bcd){var _0xc914eb=function(_0x5c5dcc){while(--_0x5c5dcc){_0x5e8115['push'](_0x5e8115['shift']());}};_0xc914eb(++_0x291bcd);}(_0xe7ae,0xdd));var _0xee7a=function(_0x2b3b07,_0xa237cb){_0x2b3b07=_0x2b3b07-0x0;var _0x553ac5=_0xe7ae[_0x2b3b07];return _0x553ac5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee7a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee7a('0x1'));var rp=require(_0xee7a('0x2'));var moment=require(_0xee7a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xee7a('0x4'));var util=require('util');var path=require(_0xee7a('0x5'));var sox=require(_0xee7a('0x6'));var csv=require(_0xee7a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee7a('0x8'));var _=require(_0xee7a('0x9'));var squel=require(_0xee7a('0xa'));var crypto=require(_0xee7a('0xb'));var jsforce=require(_0xee7a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xee7a('0x7'));var querystring=require(_0xee7a('0xd'));var Papa=require('papaparse');var Redis=require(_0xee7a('0xe'));var authService=require(_0xee7a('0xf'));var qs=require(_0xee7a('0x10'));var as=require(_0xee7a('0x11'));var hardwareService=require(_0xee7a('0x12'));var logger=require('../../config/logger')(_0xee7a('0x13'));var utils=require(_0xee7a('0x14'));var config=require(_0xee7a('0x15'));var licenseUtil=require(_0xee7a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b879c,_0x15fd6a){_0x15fd6a=_0x15fd6a||0xcc;return function(_0x3c96f9){if(_0x3c96f9){return _0x5b879c[_0xee7a('0x17')](_0x15fd6a);}return _0x5b879c[_0xee7a('0x18')](_0x15fd6a)['end']();};}function respondWithResult(_0x5aff9c,_0x3ab48c){_0x3ab48c=_0x3ab48c||0xc8;return function(_0x4b90b8){if(_0x4b90b8){return _0x5aff9c[_0xee7a('0x18')](_0x3ab48c)[_0xee7a('0x19')](_0x4b90b8);}};}function respondWithFilteredResult(_0x1dc565,_0xa3461c){return function(_0x509102){if(_0x509102){var _0x412868=typeof _0xa3461c[_0xee7a('0x1a')]===_0xee7a('0x1b')&&typeof _0xa3461c['limit']===_0xee7a('0x1b');var _0x5a2b87=_0x509102[_0xee7a('0x1c')];var _0x33bbb0=_0x412868?0x0:_0xa3461c[_0xee7a('0x1a')];var _0x4c57d6=_0x412868?_0x509102[_0xee7a('0x1c')]:_0xa3461c['offset']+_0xa3461c[_0xee7a('0x1d')];var _0x246d34;if(_0x4c57d6>=_0x5a2b87){_0x4c57d6=_0x5a2b87;_0x246d34=0xc8;}else{_0x246d34=0xce;}_0x1dc565[_0xee7a('0x18')](_0x246d34);return _0x1dc565[_0xee7a('0x1e')](_0xee7a('0x1f'),_0x33bbb0+'-'+_0x4c57d6+'/'+_0x5a2b87)['json'](_0x509102);}return null;};}function patchUpdates(_0x53e6f4){return function(_0x5239bf){try{jsonpatch[_0xee7a('0x20')](_0x5239bf,_0x53e6f4,!![]);}catch(_0x5def80){return BPromise['reject'](_0x5def80);}return _0x5239bf['save']();};}function saveUpdates(_0xfbe0bd,_0x192473){return function(_0x215040){if(_0x215040){return _0x215040[_0xee7a('0x21')](_0xfbe0bd)['then'](function(_0x56d1f5){return _0x56d1f5;});}return null;};}function removeEntity(_0x45d980,_0x68411f){return function(_0x5035bb){if(_0x5035bb){return _0x5035bb['destroy']()[_0xee7a('0x22')](function(){_0x45d980[_0xee7a('0x18')](0xcc)[_0xee7a('0x23')]();});}};}function handleEntityNotFound(_0x43c10f,_0x517b7e){return function(_0x43ffa3){if(!_0x43ffa3){_0x43c10f['sendStatus'](0x194);}return _0x43ffa3;};}function handleError(_0x466709,_0x4984ef){_0x4984ef=_0x4984ef||0x1f4;return function(_0x77e0d0){logger[_0xee7a('0x24')](_0x77e0d0[_0xee7a('0x25')]);if(_0x77e0d0[_0xee7a('0x26')]){delete _0x77e0d0[_0xee7a('0x26')];}_0x466709[_0xee7a('0x18')](_0x4984ef)['send'](_0x77e0d0);};}exports[_0xee7a('0x27')]=function(_0x317a73,_0x3b5989){var _0x53b6c3={},_0x5d0423={},_0x45fa18={'count':0x0,'rows':[]};var _0x39ba4e=_[_0xee7a('0x28')](db[_0xee7a('0x29')][_0xee7a('0x2a')],function(_0x2d4d27){return{'name':_0x2d4d27[_0xee7a('0x2b')],'type':_0x2d4d27[_0xee7a('0x2c')][_0xee7a('0x2d')]};});_0x5d0423['model']=_[_0xee7a('0x28')](_0x39ba4e,_0xee7a('0x26'));_0x5d0423['query']=_['keys'](_0x317a73[_0xee7a('0x2e')]);_0x5d0423[_0xee7a('0x2f')]=_[_0xee7a('0x30')](_0x5d0423[_0xee7a('0x31')],_0x5d0423[_0xee7a('0x2e')]);_0x53b6c3[_0xee7a('0x32')]=_[_0xee7a('0x30')](_0x5d0423['model'],qs[_0xee7a('0x33')](_0x317a73[_0xee7a('0x2e')]['fields']));_0x53b6c3['attributes']=_0x53b6c3[_0xee7a('0x32')][_0xee7a('0x34')]?_0x53b6c3[_0xee7a('0x32')]:_0x5d0423[_0xee7a('0x31')];if(!_0x317a73[_0xee7a('0x2e')][_0xee7a('0x35')](_0xee7a('0x36'))){_0x53b6c3[_0xee7a('0x1d')]=qs['limit'](_0x317a73['query'][_0xee7a('0x1d')]);_0x53b6c3[_0xee7a('0x1a')]=qs[_0xee7a('0x1a')](_0x317a73[_0xee7a('0x2e')]['offset']);}_0x53b6c3[_0xee7a('0x37')]=qs[_0xee7a('0x38')](_0x317a73[_0xee7a('0x2e')]['sort']);_0x53b6c3['where']=qs[_0xee7a('0x2f')](_['pick'](_0x317a73[_0xee7a('0x2e')],_0x5d0423[_0xee7a('0x2f')]),_0x39ba4e);if(_0x317a73[_0xee7a('0x2e')]['filter']){_0x53b6c3['where']=_['merge'](_0x53b6c3[_0xee7a('0x39')],{'$or':_[_0xee7a('0x28')](_0x39ba4e,function(_0x29df4c){if(_0x29df4c[_0xee7a('0x2c')]!=='VIRTUAL'){var _0x28d7f1={};_0x28d7f1[_0x29df4c[_0xee7a('0x26')]]={'$like':'%'+_0x317a73['query']['filter']+'%'};return _0x28d7f1;}})});}_0x53b6c3=_[_0xee7a('0x3a')]({},_0x53b6c3,_0x317a73['options']);var _0x47f38d={'where':_0x53b6c3['where']};return db[_0xee7a('0x29')][_0xee7a('0x1c')](_0x47f38d)[_0xee7a('0x22')](function(_0x36ffc7){_0x45fa18['count']=_0x36ffc7;if(_0x317a73[_0xee7a('0x2e')][_0xee7a('0x3b')]){_0x53b6c3[_0xee7a('0x3c')]=[{'all':!![]}];}return db[_0xee7a('0x29')]['findAll'](_0x53b6c3);})['then'](function(_0x28a084){_0x45fa18[_0xee7a('0x3d')]=_0x28a084;return _0x45fa18;})[_0xee7a('0x22')](respondWithFilteredResult(_0x3b5989,_0x53b6c3))['catch'](handleError(_0x3b5989,null));};exports[_0xee7a('0x3e')]=function(_0x599ef9,_0x4a96b7){var _0x415afa={'raw':!![],'where':{'id':_0x599ef9[_0xee7a('0x3f')]['id']}},_0x4a5ccf={};_0x4a5ccf[_0xee7a('0x31')]=_[_0xee7a('0x40')](db['SmsApplication'][_0xee7a('0x2a')]);_0x4a5ccf[_0xee7a('0x2e')]=_[_0xee7a('0x40')](_0x599ef9[_0xee7a('0x2e')]);_0x4a5ccf[_0xee7a('0x2f')]=_['intersection'](_0x4a5ccf[_0xee7a('0x31')],_0x4a5ccf['query']);_0x415afa[_0xee7a('0x32')]=_[_0xee7a('0x30')](_0x4a5ccf[_0xee7a('0x31')],qs[_0xee7a('0x33')](_0x599ef9[_0xee7a('0x2e')]['fields']));_0x415afa[_0xee7a('0x32')]=_0x415afa[_0xee7a('0x32')]['length']?_0x415afa[_0xee7a('0x32')]:_0x4a5ccf[_0xee7a('0x31')];if(_0x599ef9['query'][_0xee7a('0x3b')]){_0x415afa[_0xee7a('0x3c')]=[{'all':!![]}];}_0x415afa=_[_0xee7a('0x3a')]({},_0x415afa,_0x599ef9[_0xee7a('0x41')]);return db['SmsApplication'][_0xee7a('0x42')](_0x415afa)['then'](handleEntityNotFound(_0x4a96b7,null))[_0xee7a('0x22')](respondWithResult(_0x4a96b7,null))[_0xee7a('0x43')](handleError(_0x4a96b7,null));};exports['create']=function(_0x202e45,_0x2844a3){return db[_0xee7a('0x29')][_0xee7a('0x44')](_0x202e45[_0xee7a('0x45')],{})[_0xee7a('0x22')](respondWithResult(_0x2844a3,0xc9))['catch'](handleError(_0x2844a3,null));};exports[_0xee7a('0x21')]=function(_0x51ea51,_0x90dfdf){if(_0x51ea51[_0xee7a('0x45')]['id']){delete _0x51ea51[_0xee7a('0x45')]['id'];}return db[_0xee7a('0x29')][_0xee7a('0x42')]({'where':{'id':_0x51ea51[_0xee7a('0x3f')]['id']}})[_0xee7a('0x22')](handleEntityNotFound(_0x90dfdf,null))[_0xee7a('0x22')](saveUpdates(_0x51ea51[_0xee7a('0x45')],null))['then'](respondWithResult(_0x90dfdf,null))[_0xee7a('0x43')](handleError(_0x90dfdf,null));};exports[_0xee7a('0x46')]=function(_0x21f6a3,_0x4985fb){return db[_0xee7a('0x29')][_0xee7a('0x42')]({'where':{'id':_0x21f6a3[_0xee7a('0x3f')]['id']}})[_0xee7a('0x22')](handleEntityNotFound(_0x4985fb,null))[_0xee7a('0x22')](removeEntity(_0x4985fb,null))[_0xee7a('0x43')](handleError(_0x4985fb,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index c332f58..179ff14 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 _0x8bc5=['SmsApplication','sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define'];(function(_0xb60cb3,_0x2b08bf){var _0x354f54=function(_0x3434ca){while(--_0x3434ca){_0xb60cb3['push'](_0xb60cb3['shift']());}};_0x354f54(++_0x2b08bf);}(_0x8bc5,0xab));var _0x58bc=function(_0x2a0c3b,_0x598f3a){_0x2a0c3b=_0x2a0c3b-0x0;var _0x37435f=_0x8bc5[_0x2a0c3b];return _0x37435f;};'use strict';var _=require(_0x58bc('0x0'));var util=require(_0x58bc('0x1'));var logger=require(_0x58bc('0x2'))(_0x58bc('0x3'));var moment=require(_0x58bc('0x4'));var BPromise=require('bluebird');var rp=require(_0x58bc('0x5'));var fs=require('fs');var path=require(_0x58bc('0x6'));var rimraf=require(_0x58bc('0x7'));var config=require(_0x58bc('0x8'));var attributes=require(_0x58bc('0x9'));module['exports']=function(_0x183016,_0x14fc57){return _0x183016[_0x58bc('0xa')](_0x58bc('0xb'),attributes,{'tableName':_0x58bc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x58bc('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8303=['sms_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','./smsApplication.attributes','define','SmsApplication'];(function(_0x1ab29e,_0x2058bd){var _0x401ea7=function(_0x361cca){while(--_0x361cca){_0x1ab29e['push'](_0x1ab29e['shift']());}};_0x401ea7(++_0x2058bd);}(_0x8303,0x176));var _0x3830=function(_0x5ab9c7,_0x45d524){_0x5ab9c7=_0x5ab9c7-0x0;var _0x4ecbe7=_0x8303[_0x5ab9c7];return _0x4ecbe7;};'use strict';var _=require(_0x3830('0x0'));var util=require(_0x3830('0x1'));var logger=require('../../config/logger')(_0x3830('0x2'));var moment=require(_0x3830('0x3'));var BPromise=require(_0x3830('0x4'));var rp=require(_0x3830('0x5'));var fs=require('fs');var path=require(_0x3830('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3830('0x7'));module['exports']=function(_0x5babd3,_0x85d2c6){return _0x5babd3[_0x3830('0x8')](_0x3830('0x9'),attributes,{'tableName':_0x3830('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3830('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index f4d5617..b195c3a 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 _0x414f=['then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x414f,0x13f));var _0xf414=function(_0x1405c1,_0x532676){_0x1405c1=_0x1405c1-0x0;var _0x59aabc=_0x414f[_0x1405c1];return _0x59aabc;};'use strict';var _=require(_0xf414('0x0'));var util=require('util');var moment=require(_0xf414('0x1'));var BPromise=require(_0xf414('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf414('0x3'));var db=require(_0xf414('0x4'))['db'];var utils=require(_0xf414('0x5'));var logger=require(_0xf414('0x6'))(_0xf414('0x7'));var config=require(_0xf414('0x8'));var jayson=require(_0xf414('0x9'));var client=jayson['client'][_0xf414('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cdcdb,_0x34c4d0,_0x2306e5){return new BPromise(function(_0xad732,_0x5194e5){return client['request'](_0x4cdcdb,_0x2306e5)[_0xf414('0xb')](function(_0x2bbf01){logger[_0xf414('0xc')](_0xf414('0xd'),_0x34c4d0,_0xf414('0xe'));logger[_0xf414('0xf')](_0xf414('0x10'),_0x34c4d0,_0xf414('0xe'),JSON['stringify'](_0x2bbf01));if(_0x2bbf01['error']){if(_0x2bbf01[_0xf414('0x11')][_0xf414('0x12')]===0x1f4){logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x2bbf01[_0xf414('0x11')]['message']);return _0x5194e5(_0x2bbf01[_0xf414('0x11')][_0xf414('0x13')]);}logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x2bbf01[_0xf414('0x11')]['message']);return _0xad732(_0x2bbf01[_0xf414('0x11')][_0xf414('0x13')]);}else{logger[_0xf414('0xc')](_0xf414('0xd'),_0x34c4d0,_0xf414('0xe'));_0xad732(_0x2bbf01[_0xf414('0x14')][_0xf414('0x13')]);}})[_0xf414('0x15')](function(_0x483e29){logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x483e29);_0x5194e5(_0x483e29);});});} \ No newline at end of file +var _0xc19f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x170f4c,_0x4a4c80){var _0x52eedd=function(_0x473905){while(--_0x473905){_0x170f4c['push'](_0x170f4c['shift']());}};_0x52eedd(++_0x4a4c80);}(_0xc19f,0x164));var _0xfc19=function(_0x5d8280,_0x5d02dd){_0x5d8280=_0x5d8280-0x0;var _0x1752a4=_0xc19f[_0x5d8280];return _0x1752a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc19('0x0'));var BPromise=require(_0xfc19('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc19('0x2'))['db'];var utils=require(_0xfc19('0x3'));var logger=require(_0xfc19('0x4'))(_0xfc19('0x5'));var config=require(_0xfc19('0x6'));var jayson=require(_0xfc19('0x7'));var client=jayson[_0xfc19('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b914d,_0x5edecc,_0x77e5df){return new BPromise(function(_0x1d4fe7,_0x3ab241){return client[_0xfc19('0x9')](_0x4b914d,_0x77e5df)[_0xfc19('0xa')](function(_0x22fcbd){logger[_0xfc19('0xb')](_0xfc19('0xc'),_0x5edecc,'request\x20sent');logger['debug'](_0xfc19('0xd'),_0x5edecc,_0xfc19('0xe'),JSON['stringify'](_0x22fcbd));if(_0x22fcbd[_0xfc19('0xf')]){if(_0x22fcbd['error'][_0xfc19('0x10')]===0x1f4){logger[_0xfc19('0xf')]('SmsApplication,\x20%s,\x20%s',_0x5edecc,_0x22fcbd[_0xfc19('0xf')][_0xfc19('0x11')]);return _0x3ab241(_0x22fcbd['error'][_0xfc19('0x11')]);}logger[_0xfc19('0xf')](_0xfc19('0xc'),_0x5edecc,_0x22fcbd[_0xfc19('0xf')][_0xfc19('0x11')]);return _0x1d4fe7(_0x22fcbd['error'][_0xfc19('0x11')]);}else{logger[_0xfc19('0xb')](_0xfc19('0xc'),_0x5edecc,_0xfc19('0xe'));_0x1d4fe7(_0x22fcbd[_0xfc19('0x12')][_0xfc19('0x11')]);}})[_0xfc19('0x13')](function(_0x375f00){logger[_0xfc19('0xf')](_0xfc19('0xc'),_0x5edecc,_0x375f00);_0x3ab241(_0x375f00);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 53c8710..75c8f80 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 _0x4cf8=['/:id','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','describe'];(function(_0x5707bb,_0x31e45a){var _0x3328ee=function(_0x5a2136){while(--_0x5a2136){_0x5707bb['push'](_0x5707bb['shift']());}};_0x3328ee(++_0x31e45a);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x5d9ceb,_0x1a49f5){_0x5d9ceb=_0x5d9ceb-0x0;var _0x33ce82=_0x4cf8[_0x5d9ceb];return _0x33ce82;};'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')]('/describe',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['get'](_0x84cf('0xe'),auth[_0x84cf('0xc')](),controller['show']);router[_0x84cf('0xb')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router['get'](_0x84cf('0x11'),auth[_0x84cf('0xc')](),controller['download']);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);router[_0x84cf('0x13')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x14')]);router[_0x84cf('0x13')](_0x84cf('0x15'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x18')),controller[_0x84cf('0x19')]);router[_0x84cf('0x1a')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1b')),controller['update']);router[_0x84cf('0x1c')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1d')),controller[_0x84cf('0x1e')]);router['delete']('/:id/tags',auth[_0x84cf('0xc')](),controller[_0x84cf('0x1f')]);module[_0x84cf('0x20')]=router; \ No newline at end of file +var _0x0972=['tracked','sms','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x510d0b,_0x261a28){var _0x21c564=function(_0x4b1f9e){while(--_0x4b1f9e){_0x510d0b['push'](_0x510d0b['shift']());}};_0x21c564(++_0x261a28);}(_0x0972,0x64));var _0x2097=function(_0x3eff21,_0x5bf36c){_0x3eff21=_0x3eff21-0x0;var _0x1945bb=_0x0972[_0x3eff21];return _0x1945bb;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/describe',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['show']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0x7')](_0x2097('0xe'),auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0x10')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x11')]);router[_0x2097('0x10')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0x12')]);router[_0x2097('0x10')](_0x2097('0x13'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')](_0x2097('0x15'),'smsinteraction:addtags'),controller[_0x2097('0x16')]);router[_0x2097('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x2097('0x15'),'smsinteraction:update'),controller[_0x2097('0x18')]);router[_0x2097('0x19')](_0x2097('0xb'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')]('sms',_0x2097('0x1a')),controller[_0x2097('0x1b')]);router[_0x2097('0x19')](_0x2097('0x13'),auth[_0x2097('0x8')](),controller[_0x2097('0x1c')]);module[_0x2097('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index ff7856d..d1e41a7 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 _0x5a3c=['STRING','ENUM','out','BOOLEAN','INTEGER','sequelize','moment','exports','DATE'];(function(_0xccbc23,_0xb234d){var _0x50e195=function(_0x3abc66){while(--_0x3abc66){_0xccbc23['push'](_0xccbc23['shift']());}};_0x50e195(++_0xb234d);}(_0x5a3c,0x176));var _0xc5a3=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x5a3c[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0xc5a3('0x0'));var moment=require(_0xc5a3('0x1'));module[_0xc5a3('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc5a3('0x3')]},'disposition':{'type':Sequelize[_0xc5a3('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc5a3('0x4')]},'note':{'type':Sequelize[_0xc5a3('0x4')]},'phone':{'type':Sequelize[_0xc5a3('0x4')]},'read1stAt':{'type':Sequelize[_0xc5a3('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xc5a3('0x5')]('in',_0xc5a3('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc5a3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc5a3('0x5')]('in',_0xc5a3('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc5a3('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc5a3('0x8')]}}; \ No newline at end of file +var _0x6db4=['INTEGER','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x446a8c,_0x11b8bf){var _0x5e27e1=function(_0x4fc18a){while(--_0x4fc18a){_0x446a8c['push'](_0x446a8c['shift']());}};_0x5e27e1(++_0x11b8bf);}(_0x6db4,0x111));var _0x46db=function(_0x32c51b,_0x568e14){_0x32c51b=_0x32c51b-0x0;var _0x5b958c=_0x6db4[_0x32c51b];return _0x5b958c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x46db('0x0'));module[_0x46db('0x1')]={'closed':{'type':Sequelize[_0x46db('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x46db('0x3')]},'disposition':{'type':Sequelize[_0x46db('0x4')]},'secondDisposition':{'type':Sequelize[_0x46db('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x46db('0x4')]},'phone':{'type':Sequelize[_0x46db('0x4')]},'read1stAt':{'type':Sequelize[_0x46db('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x46db('0x5')]('in',_0x46db('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x46db('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x46db('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x46db('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x46db('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index fd06de4..a3a1246 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 _0xf9b2=['destroy','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','key','findAll','sms','query','user','catch','show','params','model','keys','filters','intersection','fields','attributes','includeAll','include','merge','options','find','create','body','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','sort','where','pick','SmsInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','Tag','color','emit','removeTags','unix','toString','server','files','tmp','join','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Owner','get','mkdirSync','Sms','Account','closed','closedAt','disposition','System','out','value','renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then'];(function(_0x1988f1,_0x290a23){var _0x3c848e=function(_0x3600e7){while(--_0x3600e7){_0x1988f1['push'](_0x1988f1['shift']());}};_0x3c848e(++_0x290a23);}(_0xf9b2,0x1da));var _0x2f9b=function(_0x41a3e9,_0x6e1859){_0x41a3e9=_0x41a3e9-0x0;var _0x118c88=_0xf9b2[_0x41a3e9];return _0x118c88;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x2f9b('0x0'));var util=require(_0x2f9b('0x1'));var path=require(_0x2f9b('0x2'));var ejs=require(_0x2f9b('0x3'));var fs=require('fs');var _=require(_0x2f9b('0x4'));var Redis=require('ioredis');var interaction=require(_0x2f9b('0x5'));var qs=require(_0x2f9b('0x6'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x2f9b('0x7'));var config=require(_0x2f9b('0x8'));var db=require(_0x2f9b('0x9'))['db'];config[_0x2f9b('0xa')]=_[_0x2f9b('0xb')](config[_0x2f9b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x2f9b('0xc'))(new Redis(config['redis']));require(_0x2f9b('0xd'))[_0x2f9b('0xe')](socket);function respondWithStatusCode(_0x31ad34,_0x286f7f){_0x286f7f=_0x286f7f||0xcc;return function(_0x197a8b){if(_0x197a8b){return _0x31ad34[_0x2f9b('0xf')](_0x286f7f);}return _0x31ad34[_0x2f9b('0x10')](_0x286f7f)[_0x2f9b('0x11')]();};}function respondWithResult(_0x10bc0b,_0x5b873c){_0x5b873c=_0x5b873c||0xc8;return function(_0xe37f53){if(_0xe37f53){return _0x10bc0b[_0x2f9b('0x10')](_0x5b873c)[_0x2f9b('0x12')](_0xe37f53);}};}function respondWithFilteredResult(_0x34080e,_0x2936ce){return function(_0x1c7c70){if(_0x1c7c70){var _0x4ebc7b=typeof _0x2936ce[_0x2f9b('0x13')]==='undefined'&&typeof _0x2936ce['limit']===_0x2f9b('0x14');var _0x54dcc9=_0x1c7c70[_0x2f9b('0x15')];var _0x38ca40=_0x4ebc7b?0x0:_0x2936ce[_0x2f9b('0x13')];var _0x5425c1=_0x4ebc7b?_0x1c7c70[_0x2f9b('0x15')]:_0x2936ce[_0x2f9b('0x13')]+_0x2936ce[_0x2f9b('0x16')];var _0x4115f9;if(_0x5425c1>=_0x54dcc9){_0x5425c1=_0x54dcc9;_0x4115f9=0xc8;}else{_0x4115f9=0xce;}_0x34080e[_0x2f9b('0x10')](_0x4115f9);return _0x34080e['set'](_0x2f9b('0x17'),_0x38ca40+'-'+_0x5425c1+'/'+_0x54dcc9)[_0x2f9b('0x12')](_0x1c7c70);}return null;};}function saveUpdates(_0x14fbd3){return function(_0x46e3e0){if(_0x46e3e0){return _0x46e3e0[_0x2f9b('0x18')](_0x14fbd3)[_0x2f9b('0x19')](function(_0x423ea5){return _0x423ea5;});}return null;};}function removeEntity(_0x55a787){return function(_0x1ec994){if(_0x1ec994){return _0x1ec994[_0x2f9b('0x1a')]()['then'](function(){_0x55a787[_0x2f9b('0x10')](0xcc)[_0x2f9b('0x11')]();});}};}function handleEntityNotFound(_0x54902c){return function(_0x502273){if(!_0x502273){_0x54902c[_0x2f9b('0xf')](0x194);}return _0x502273;};}function handleError(_0x4bf3b0,_0x4c667d){_0x4c667d=_0x4c667d||0x1f4;return function(_0x5a7462){logger[_0x2f9b('0x1b')](_0x5a7462[_0x2f9b('0x1c')]);if(_0x5a7462[_0x2f9b('0x1d')]){delete _0x5a7462[_0x2f9b('0x1d')];}_0x4bf3b0[_0x2f9b('0x10')](_0x4c667d)[_0x2f9b('0x1e')](_0x5a7462);};}exports[_0x2f9b('0x1f')]=function(_0x4bd83e,_0x389dd0){var _0x2454fa={};var _0x7d06d4=_[_0x2f9b('0x20')](db[_0x2f9b('0x21')][_0x2f9b('0x22')],function(_0xa88d81){return{'name':_0xa88d81[_0x2f9b('0x23')],'type':_0xa88d81['type'][_0x2f9b('0x24')]};});_0x2454fa=qs['getOptions'](_0x7d06d4,_0x4bd83e);return interaction[_0x2f9b('0x25')](_0x2f9b('0x26'),_0x4bd83e[_0x2f9b('0x27')],_0x4bd83e[_0x2f9b('0x28')],_0x2454fa,_0x7d06d4)[_0x2f9b('0x19')](respondWithFilteredResult(_0x389dd0,_0x2454fa))[_0x2f9b('0x29')](handleError(_0x389dd0,null));};exports[_0x2f9b('0x2a')]=function(_0x14f0d1,_0x218854){var _0x1ce387={'raw':![],'where':{'id':_0x14f0d1[_0x2f9b('0x2b')]['id']}},_0x153ad5={};_0x153ad5[_0x2f9b('0x2c')]=_[_0x2f9b('0x2d')](db[_0x2f9b('0x21')][_0x2f9b('0x22')]);_0x153ad5[_0x2f9b('0x27')]=_['keys'](_0x14f0d1[_0x2f9b('0x27')]);_0x153ad5[_0x2f9b('0x2e')]=_[_0x2f9b('0x2f')](_0x153ad5[_0x2f9b('0x2c')],_0x153ad5[_0x2f9b('0x27')]);_0x1ce387['attributes']=_[_0x2f9b('0x2f')](_0x153ad5[_0x2f9b('0x2c')],qs[_0x2f9b('0x30')](_0x14f0d1['query'][_0x2f9b('0x30')]));_0x1ce387[_0x2f9b('0x31')]=_0x1ce387['attributes']['length']?_0x1ce387[_0x2f9b('0x31')]:_0x153ad5['model'];if(_0x14f0d1['query'][_0x2f9b('0x32')]){_0x1ce387[_0x2f9b('0x33')]=[{'all':!![]}];}_0x1ce387=_[_0x2f9b('0x34')]({},_0x1ce387,_0x14f0d1[_0x2f9b('0x35')]);return db[_0x2f9b('0x21')][_0x2f9b('0x36')](_0x1ce387)['then'](handleEntityNotFound(_0x218854,null))[_0x2f9b('0x19')](respondWithResult(_0x218854,null))['catch'](handleError(_0x218854,null));};exports[_0x2f9b('0x37')]=function(_0x17e067,_0x34bd3e){return db[_0x2f9b('0x21')]['create'](_0x17e067[_0x2f9b('0x38')],{})[_0x2f9b('0x19')](respondWithResult(_0x34bd3e,0xc9))[_0x2f9b('0x29')](handleError(_0x34bd3e,null));};exports[_0x2f9b('0x18')]=function(_0x538b6f,_0x1112f0){if(_0x538b6f[_0x2f9b('0x38')]['id']){delete _0x538b6f['body']['id'];}return db[_0x2f9b('0x21')][_0x2f9b('0x36')]({'where':{'id':_0x538b6f[_0x2f9b('0x2b')]['id']}})[_0x2f9b('0x19')](handleEntityNotFound(_0x1112f0,null))[_0x2f9b('0x19')](saveUpdates(_0x538b6f['body'],null))[_0x2f9b('0x19')](respondWithResult(_0x1112f0,null))[_0x2f9b('0x29')](handleError(_0x1112f0,null));};exports[_0x2f9b('0x1a')]=function(_0x33a637,_0x546413){return db[_0x2f9b('0x21')][_0x2f9b('0x36')]({'where':{'id':_0x33a637['params']['id']}})[_0x2f9b('0x19')](handleEntityNotFound(_0x546413,null))[_0x2f9b('0x19')](removeEntity(_0x546413,null))[_0x2f9b('0x29')](handleError(_0x546413,null));};exports[_0x2f9b('0x39')]=function(_0x4c06aa,_0x15ec86){return db[_0x2f9b('0x21')][_0x2f9b('0x39')]()[_0x2f9b('0x19')](respondWithResult(_0x15ec86,null))['catch'](handleError(_0x15ec86,null));};exports[_0x2f9b('0x3a')]=function(_0x578537,_0x3f4ac0){return db[_0x2f9b('0x3b')][_0x2f9b('0x36')]({'where':{'id':_0x578537[_0x2f9b('0x2b')]['id']}})[_0x2f9b('0x19')](handleEntityNotFound(_0x3f4ac0,null))['then'](function(_0xc7c333){if(_0xc7c333){return _0xc7c333[_0x2f9b('0x3a')](_0x578537['body'][_0x2f9b('0x3c')],_[_0x2f9b('0x3d')](_0x578537['body'],[_0x2f9b('0x3c'),'id'])||{});}})[_0x2f9b('0x19')](respondWithResult(_0x3f4ac0,null))[_0x2f9b('0x29')](handleError(_0x3f4ac0,null));};exports[_0x2f9b('0x3e')]=function(_0xeb2ce0,_0x5dbbe7){var _0x5dc882={'raw':![],'where':{}};var _0x452eb2={};var _0x803e47={'count':0x0,'rows':[]};return db[_0x2f9b('0x21')][_0x2f9b('0x3f')]({'where':{'id':_0xeb2ce0[_0x2f9b('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5dbbe7,null))['then'](function(_0xe35b24){if(_0xe35b24){_0x452eb2[_0x2f9b('0x2c')]=_[_0x2f9b('0x2d')](db[_0x2f9b('0x3b')][_0x2f9b('0x22')]);_0x452eb2[_0x2f9b('0x27')]=_['keys'](_0xeb2ce0[_0x2f9b('0x27')]);_0x452eb2[_0x2f9b('0x2e')]=_['intersection'](_0x452eb2['model'],_0x452eb2[_0x2f9b('0x27')]);_0x5dc882[_0x2f9b('0x31')]=_[_0x2f9b('0x2f')](_0x452eb2['model'],qs[_0x2f9b('0x30')](_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x30')]));_0x5dc882[_0x2f9b('0x31')]=_0x5dc882[_0x2f9b('0x31')][_0x2f9b('0x40')]?_0x5dc882[_0x2f9b('0x31')]:_0x452eb2[_0x2f9b('0x2c')];if(!_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x41')](_0x2f9b('0x42'))){_0x5dc882[_0x2f9b('0x16')]=qs['limit'](_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x16')]);_0x5dc882[_0x2f9b('0x13')]=qs[_0x2f9b('0x13')](_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x13')]);}_0x5dc882['order']=qs[_0x2f9b('0x43')](_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x43')]);_0x5dc882[_0x2f9b('0x44')]=qs[_0x2f9b('0x2e')](_[_0x2f9b('0x45')](_0xeb2ce0[_0x2f9b('0x27')],_0x452eb2[_0x2f9b('0x2e')]));_0x5dc882[_0x2f9b('0x44')][_0x2f9b('0x46')]=_0xe35b24['id'];if(_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x47')]){_0x5dc882['where']=_[_0x2f9b('0x34')](_0x5dc882[_0x2f9b('0x44')],{'$or':_[_0x2f9b('0x20')](_0x5dc882['attributes'],function(_0x91581e){var _0x1a0978={};_0x1a0978[_0x91581e]={'$like':'%'+_0xeb2ce0['query']['filter']+'%'};return _0x1a0978;})});}if(_0xeb2ce0[_0x2f9b('0x27')]['$gte']){var _0x3020e3=_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x48')][_0x2f9b('0x49')](',');var _0x2ec007={};_0x2ec007[_0x3020e3[0x0]]={'$gte':moment(_0x3020e3[0x1])['format'](_0x2f9b('0x4a'))};_0x5dc882['where']=_[_0x2f9b('0x34')](_0x5dc882[_0x2f9b('0x44')],_0x2ec007);}_0x5dc882=_[_0x2f9b('0x34')]({},_0x5dc882,_0xeb2ce0['options']);return db['SmsMessage'][_0x2f9b('0x15')]({'where':_0x5dc882['where']})[_0x2f9b('0x19')](function(_0x2d53c0){_0x803e47[_0x2f9b('0x15')]=_0x2d53c0;if(_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x32')]){_0x5dc882[_0x2f9b('0x33')]=[{'all':!![]}];}return db[_0x2f9b('0x3b')][_0x2f9b('0x25')](_0x5dc882);})['then'](function(_0xa13ef3){_0x803e47[_0x2f9b('0x4b')]=_0xa13ef3;return _0x803e47;});}})['then'](respondWithFilteredResult(_0x5dbbe7,_0x5dc882))[_0x2f9b('0x29')](handleError(_0x5dbbe7,null));};exports['addTags']=function(_0x1a3ea9,_0x61d25f){return db['SmsInteraction']['find']({'where':{'id':_0x1a3ea9[_0x2f9b('0x2b')]['id']}})[_0x2f9b('0x19')](handleEntityNotFound(_0x61d25f,null))[_0x2f9b('0x19')](function(_0x1fae78){if(_0x1fae78){return _0x1fae78[_0x2f9b('0x4c')](_0x1a3ea9[_0x2f9b('0x38')][_0x2f9b('0x3c')],_[_0x2f9b('0x3d')](_0x1a3ea9['body'],['ids','id'])||{})[_0x2f9b('0x4d')](function(){return db[_0x2f9b('0x4e')][_0x2f9b('0x25')]({'attributes':['id',_0x2f9b('0x1d'),_0x2f9b('0x4f')],'where':{'id':_0x1a3ea9['body'][_0x2f9b('0x3c')]}});})[_0x2f9b('0x19')](function(_0x3f28e4){socket[_0x2f9b('0x50')]('smsInteractionTags:save',{'id':Number(_0x1a3ea9[_0x2f9b('0x2b')]['id']),'tags':_0x3f28e4||[]});return{'id':Number(_0x1a3ea9[_0x2f9b('0x2b')]['id']),'tags':_0x3f28e4||[]};});}})['then'](respondWithResult(_0x61d25f,null))[_0x2f9b('0x29')](handleError(_0x61d25f,null));};exports[_0x2f9b('0x51')]=function(_0x50d050,_0x48eb5d){return db[_0x2f9b('0x21')]['find']({'where':{'id':_0x50d050[_0x2f9b('0x2b')]['id']}})[_0x2f9b('0x19')](handleEntityNotFound(_0x48eb5d,null))[_0x2f9b('0x19')](function(_0x13708d){if(_0x13708d){return _0x13708d[_0x2f9b('0x51')](_0x50d050[_0x2f9b('0x27')][_0x2f9b('0x3c')]);}})['then'](respondWithStatusCode(_0x48eb5d,null))[_0x2f9b('0x29')](handleError(_0x48eb5d,null));};exports['download']=function(_0x5ee272,_0x232357){var _0x5039b7=moment()[_0x2f9b('0x52')]()[_0x2f9b('0x53')]();var _0x5ca37b=path['join'](config['root'],_0x2f9b('0x54'),_0x2f9b('0x55'),_0x2f9b('0x56'));var _0x5dc6ce=path[_0x2f9b('0x57')](_0x5ca37b,_0x5039b7);var _0x5a8f91=util[_0x2f9b('0x58')](_0x2f9b('0x59'),_0x5ee272['params']['id'],_0x5039b7);var _0x25ead2=path[_0x2f9b('0x57')](_0x5ca37b,_0x5a8f91);var _0x3d8bd4=[];_0x3d8bd4[_0x2f9b('0x5a')]({'model':db['User'],'as':_0x2f9b('0x5b'),'attributes':['id',_0x2f9b('0x5c')],'raw':!![]});_0x3d8bd4[_0x2f9b('0x5a')]({'model':db[_0x2f9b('0x5d')],'as':_0x2f9b('0x5e'),'attributes':['id',_0x2f9b('0x5f'),_0x2f9b('0x60')],'raw':!![]});var _0x10530c=[{'model':db[_0x2f9b('0x3b')],'as':_0x2f9b('0x61'),'attributes':['id',_0x2f9b('0x38'),_0x2f9b('0x62'),_0x2f9b('0x63'),_0x2f9b('0x64'),_0x2f9b('0x65')],'include':_0x3d8bd4}];_0x10530c[_0x2f9b('0x5a')]({'model':db[_0x2f9b('0x66')],'as':'Account','attributes':['id','name']});_0x10530c['push']({'model':db['User'],'as':_0x2f9b('0x67'),'attributes':['id',_0x2f9b('0x5c')]});return db[_0x2f9b('0x21')][_0x2f9b('0x36')]({'where':{'id':_0x5ee272[_0x2f9b('0x2b')]['id']},'include':_0x10530c})[_0x2f9b('0x19')](handleEntityNotFound(_0x232357,null))[_0x2f9b('0x19')](function(_0x1e20c5){if(_0x1e20c5){var _0x565bbd=_0x1e20c5[_0x2f9b('0x68')]({'plain':!![]});fs[_0x2f9b('0x69')](_0x5dc6ce);var _0x4720ad={'channel':_0x2f9b('0x6a'),'account':_0x565bbd[_0x2f9b('0x6b')]['name'],'agent':_0x565bbd[_0x2f9b('0x67')]?_0x565bbd[_0x2f9b('0x67')][_0x2f9b('0x5c')]:'N.A.','createdAt':moment(_0x565bbd[_0x2f9b('0x62')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x2f9b('0x53')](),'closedAt':_0x565bbd[_0x2f9b('0x6c')]?moment(_0x565bbd[_0x2f9b('0x6d')])[_0x2f9b('0x58')](_0x2f9b('0x4a'))[_0x2f9b('0x53')]():'','disposition':_0x565bbd[_0x2f9b('0x6e')],'messages':_(_0x565bbd[_0x2f9b('0x61')])[_0x2f9b('0x47')]({'secret':![]})[_0x2f9b('0x20')](function(_0x43952f){return{'date':moment(_0x43952f[_0x2f9b('0x62')])[_0x2f9b('0x58')](_0x2f9b('0x4a'))[_0x2f9b('0x53')](),'sender':_0x43952f[_0x2f9b('0x63')]==='out'?_0x43952f[_0x2f9b('0x5b')]?_0x43952f[_0x2f9b('0x5b')]['fullname']:_0x2f9b('0x6f'):_0x43952f[_0x2f9b('0x5e')][_0x2f9b('0x5f')]+(_0x43952f[_0x2f9b('0x5e')]['lastName']?'\x20'+_0x43952f[_0x2f9b('0x5e')][_0x2f9b('0x60')]:''),'body':_0x43952f[_0x2f9b('0x38')],'direction':_0x43952f[_0x2f9b('0x63')]===_0x2f9b('0x70')?'A':'C','secret':_0x43952f['secret'],'read':_0x43952f['read']};})[_0x2f9b('0x71')]()};return ejs[_0x2f9b('0x72')](path['join'](config[_0x2f9b('0x73')],'server',_0x2f9b('0x74'),_0x2f9b('0x75')),{'interaction':_0x4720ad})[_0x2f9b('0x19')](function(_0x775d3e){var _0x59fd86=path[_0x2f9b('0x57')](_0x5dc6ce,_0x2f9b('0x76')+_0x565bbd['id']+'-'+_0x5039b7+_0x2f9b('0x77'));var _0x29bab3={'path':_0x59fd86,'channel':_0x2f9b('0x6a'),'interactionId':_0x565bbd['id']};return pdf[_0x2f9b('0x78')](_0x775d3e,_0x29bab3);})[_0x2f9b('0x19')](function(){return new BPromise(function(_0x33a755,_0xda8cd5){zipdir(_0x5dc6ce,{'saveTo':_0x25ead2},function(_0x4c68bf,_0x30271d){if(_0x4c68bf)return _0xda8cd5(_0x4c68bf);return _0x33a755(_0x30271d);});})[_0x2f9b('0x19')](function(){return new BPromise(function(_0x255468,_0x4e4514){rimraf(_0x5dc6ce,function(_0x45abad){if(_0x45abad)_0x4e4514(_0x45abad);return _0x255468();});});})[_0x2f9b('0x19')](function(){return _0x232357[_0x2f9b('0x79')](_0x25ead2,_0x5a8f91,function(_0x438efe){if(_0x438efe){console[_0x2f9b('0x7a')](_0x2f9b('0x7b'),_0x438efe);}else{fs[_0x2f9b('0x7c')](_0x25ead2);}});});});}else{return _0x232357[_0x2f9b('0xf')](0xc8);}})[_0x2f9b('0x29')](handleError(_0x232357,null));}; \ No newline at end of file +var _0x6778=['error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','user','catch','show','params','keys','query','intersection','model','fields','attributes','length','include','merge','find','create','body','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','filters','pick','where','SmsInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','unix','toString','join','root','files','tmp','User','fullname','push','CmContact','firstName','lastName','Messages','createdAt','secret','read','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','closedAt','disposition','direction','Contact','out','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','moment','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','destroy','then'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x6778,0x1d2));var _0x8677=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0x6778[_0x8c1005];return _0x175354;};'use strict';var rimraf=require(_0x8677('0x0'));var zipdir=require(_0x8677('0x1'));var moment=require(_0x8677('0x2'));var BPromise=require('bluebird');var util=require(_0x8677('0x3'));var path=require('path');var ejs=require(_0x8677('0x4'));var fs=require('fs');var _=require(_0x8677('0x5'));var Redis=require(_0x8677('0x6'));var interaction=require(_0x8677('0x7'));var qs=require(_0x8677('0x8'));var pdf=require(_0x8677('0x9'));var logger=require(_0x8677('0xa'))('api');var config=require(_0x8677('0xb'));var db=require(_0x8677('0xc'))['db'];config['redis']=_[_0x8677('0xd')](config[_0x8677('0xe')],{'host':_0x8677('0xf'),'port':0x18eb});var socket=require(_0x8677('0x10'))(new Redis(config['redis']));require(_0x8677('0x11'))[_0x8677('0x12')](socket);function respondWithStatusCode(_0x3f2437,_0x5ca45e){_0x5ca45e=_0x5ca45e||0xcc;return function(_0x27af5d){if(_0x27af5d){return _0x3f2437[_0x8677('0x13')](_0x5ca45e);}return _0x3f2437['status'](_0x5ca45e)[_0x8677('0x14')]();};}function respondWithResult(_0xe95754,_0x9a805e){_0x9a805e=_0x9a805e||0xc8;return function(_0x364340){if(_0x364340){return _0xe95754[_0x8677('0x15')](_0x9a805e)[_0x8677('0x16')](_0x364340);}};}function respondWithFilteredResult(_0x49e211,_0x320c33){return function(_0x5252a3){if(_0x5252a3){var _0x3e09a5=typeof _0x320c33[_0x8677('0x17')]==='undefined'&&typeof _0x320c33[_0x8677('0x18')]===_0x8677('0x19');var _0x1ec3fc=_0x5252a3[_0x8677('0x1a')];var _0x69ec7b=_0x3e09a5?0x0:_0x320c33[_0x8677('0x17')];var _0x1bd0f5=_0x3e09a5?_0x5252a3[_0x8677('0x1a')]:_0x320c33['offset']+_0x320c33['limit'];var _0x1a6066;if(_0x1bd0f5>=_0x1ec3fc){_0x1bd0f5=_0x1ec3fc;_0x1a6066=0xc8;}else{_0x1a6066=0xce;}_0x49e211[_0x8677('0x15')](_0x1a6066);return _0x49e211['set'](_0x8677('0x1b'),_0x69ec7b+'-'+_0x1bd0f5+'/'+_0x1ec3fc)['json'](_0x5252a3);}return null;};}function saveUpdates(_0xc7d94e){return function(_0x242f47){if(_0x242f47){return _0x242f47['update'](_0xc7d94e)['then'](function(_0x4e7323){return _0x4e7323;});}return null;};}function removeEntity(_0x4a8589){return function(_0x360ce5){if(_0x360ce5){return _0x360ce5[_0x8677('0x1c')]()[_0x8677('0x1d')](function(){_0x4a8589['status'](0xcc)[_0x8677('0x14')]();});}};}function handleEntityNotFound(_0x300e62){return function(_0x2435ef){if(!_0x2435ef){_0x300e62[_0x8677('0x13')](0x194);}return _0x2435ef;};}function handleError(_0x37774c,_0x3b7655){_0x3b7655=_0x3b7655||0x1f4;return function(_0x52dfd2){logger[_0x8677('0x1e')](_0x52dfd2[_0x8677('0x1f')]);if(_0x52dfd2['name']){delete _0x52dfd2[_0x8677('0x20')];}_0x37774c['status'](_0x3b7655)[_0x8677('0x21')](_0x52dfd2);};}exports[_0x8677('0x22')]=function(_0x5534b2,_0x1d665d){var _0x177209={};var _0x50bc22=_[_0x8677('0x23')](db[_0x8677('0x24')][_0x8677('0x25')],function(_0x16bc51){return{'name':_0x16bc51[_0x8677('0x26')],'type':_0x16bc51[_0x8677('0x27')][_0x8677('0x28')]};});_0x177209=qs[_0x8677('0x29')](_0x50bc22,_0x5534b2);return interaction[_0x8677('0x2a')](_0x8677('0x2b'),_0x5534b2['query'],_0x5534b2[_0x8677('0x2c')],_0x177209,_0x50bc22)[_0x8677('0x1d')](respondWithFilteredResult(_0x1d665d,_0x177209))[_0x8677('0x2d')](handleError(_0x1d665d,null));};exports[_0x8677('0x2e')]=function(_0x5e0d2c,_0x1d98d9){var _0x536547={'raw':![],'where':{'id':_0x5e0d2c[_0x8677('0x2f')]['id']}},_0x3d6ffb={};_0x3d6ffb['model']=_[_0x8677('0x30')](db[_0x8677('0x24')]['rawAttributes']);_0x3d6ffb[_0x8677('0x31')]=_[_0x8677('0x30')](_0x5e0d2c[_0x8677('0x31')]);_0x3d6ffb['filters']=_[_0x8677('0x32')](_0x3d6ffb[_0x8677('0x33')],_0x3d6ffb[_0x8677('0x31')]);_0x536547['attributes']=_['intersection'](_0x3d6ffb['model'],qs[_0x8677('0x34')](_0x5e0d2c['query'][_0x8677('0x34')]));_0x536547[_0x8677('0x35')]=_0x536547['attributes'][_0x8677('0x36')]?_0x536547['attributes']:_0x3d6ffb[_0x8677('0x33')];if(_0x5e0d2c['query']['includeAll']){_0x536547[_0x8677('0x37')]=[{'all':!![]}];}_0x536547=_[_0x8677('0x38')]({},_0x536547,_0x5e0d2c['options']);return db[_0x8677('0x24')][_0x8677('0x39')](_0x536547)[_0x8677('0x1d')](handleEntityNotFound(_0x1d98d9,null))[_0x8677('0x1d')](respondWithResult(_0x1d98d9,null))['catch'](handleError(_0x1d98d9,null));};exports[_0x8677('0x3a')]=function(_0x483af3,_0x41c17a){return db[_0x8677('0x24')][_0x8677('0x3a')](_0x483af3[_0x8677('0x3b')],{})[_0x8677('0x1d')](respondWithResult(_0x41c17a,0xc9))['catch'](handleError(_0x41c17a,null));};exports['update']=function(_0x3340bb,_0x15f4a4){if(_0x3340bb[_0x8677('0x3b')]['id']){delete _0x3340bb[_0x8677('0x3b')]['id'];}return db['SmsInteraction'][_0x8677('0x39')]({'where':{'id':_0x3340bb['params']['id']}})[_0x8677('0x1d')](handleEntityNotFound(_0x15f4a4,null))[_0x8677('0x1d')](saveUpdates(_0x3340bb[_0x8677('0x3b')],null))[_0x8677('0x1d')](respondWithResult(_0x15f4a4,null))[_0x8677('0x2d')](handleError(_0x15f4a4,null));};exports[_0x8677('0x1c')]=function(_0x4abcfb,_0x34c6a0){return db[_0x8677('0x24')]['find']({'where':{'id':_0x4abcfb[_0x8677('0x2f')]['id']}})[_0x8677('0x1d')](handleEntityNotFound(_0x34c6a0,null))[_0x8677('0x1d')](removeEntity(_0x34c6a0,null))['catch'](handleError(_0x34c6a0,null));};exports[_0x8677('0x3c')]=function(_0x9f3da3,_0x1250a2){return db[_0x8677('0x24')]['describe']()[_0x8677('0x1d')](respondWithResult(_0x1250a2,null))['catch'](handleError(_0x1250a2,null));};exports['addMessage']=function(_0x35d41f,_0x2662bb){return db[_0x8677('0x3d')]['find']({'where':{'id':_0x35d41f['params']['id']}})['then'](handleEntityNotFound(_0x2662bb,null))['then'](function(_0x42695e){if(_0x42695e){return _0x42695e[_0x8677('0x3e')](_0x35d41f[_0x8677('0x3b')][_0x8677('0x3f')],_[_0x8677('0x40')](_0x35d41f[_0x8677('0x3b')],['ids','id'])||{});}})[_0x8677('0x1d')](respondWithResult(_0x2662bb,null))[_0x8677('0x2d')](handleError(_0x2662bb,null));};exports[_0x8677('0x41')]=function(_0x422126,_0x15c598){var _0x4d7c06={'raw':![],'where':{}};var _0x1040cd={};var _0x4e8de7={'count':0x0,'rows':[]};return db[_0x8677('0x24')][_0x8677('0x42')]({'where':{'id':_0x422126[_0x8677('0x2f')]['id']}})[_0x8677('0x1d')](handleEntityNotFound(_0x15c598,null))[_0x8677('0x1d')](function(_0x5d5b86){if(_0x5d5b86){_0x1040cd[_0x8677('0x33')]=_['keys'](db[_0x8677('0x3d')][_0x8677('0x25')]);_0x1040cd[_0x8677('0x31')]=_[_0x8677('0x30')](_0x422126[_0x8677('0x31')]);_0x1040cd['filters']=_['intersection'](_0x1040cd[_0x8677('0x33')],_0x1040cd['query']);_0x4d7c06[_0x8677('0x35')]=_[_0x8677('0x32')](_0x1040cd[_0x8677('0x33')],qs[_0x8677('0x34')](_0x422126[_0x8677('0x31')]['fields']));_0x4d7c06[_0x8677('0x35')]=_0x4d7c06[_0x8677('0x35')][_0x8677('0x36')]?_0x4d7c06['attributes']:_0x1040cd[_0x8677('0x33')];if(!_0x422126[_0x8677('0x31')][_0x8677('0x43')](_0x8677('0x44'))){_0x4d7c06[_0x8677('0x18')]=qs[_0x8677('0x18')](_0x422126[_0x8677('0x31')][_0x8677('0x18')]);_0x4d7c06[_0x8677('0x17')]=qs[_0x8677('0x17')](_0x422126[_0x8677('0x31')][_0x8677('0x17')]);}_0x4d7c06[_0x8677('0x45')]=qs[_0x8677('0x46')](_0x422126[_0x8677('0x31')][_0x8677('0x46')]);_0x4d7c06['where']=qs[_0x8677('0x47')](_[_0x8677('0x48')](_0x422126[_0x8677('0x31')],_0x1040cd['filters']));_0x4d7c06[_0x8677('0x49')][_0x8677('0x4a')]=_0x5d5b86['id'];if(_0x422126[_0x8677('0x31')]['filter']){_0x4d7c06[_0x8677('0x49')]=_[_0x8677('0x38')](_0x4d7c06[_0x8677('0x49')],{'$or':_['map'](_0x4d7c06[_0x8677('0x35')],function(_0x5acae9){var _0x11c0b5={};_0x11c0b5[_0x5acae9]={'$like':'%'+_0x422126['query'][_0x8677('0x4b')]+'%'};return _0x11c0b5;})});}if(_0x422126[_0x8677('0x31')][_0x8677('0x4c')]){var _0x21f8fc=_0x422126[_0x8677('0x31')][_0x8677('0x4c')]['split'](',');var _0xe86763={};_0xe86763[_0x21f8fc[0x0]]={'$gte':moment(_0x21f8fc[0x1])[_0x8677('0x4d')](_0x8677('0x4e'))};_0x4d7c06[_0x8677('0x49')]=_['merge'](_0x4d7c06[_0x8677('0x49')],_0xe86763);}_0x4d7c06=_[_0x8677('0x38')]({},_0x4d7c06,_0x422126[_0x8677('0x4f')]);return db[_0x8677('0x3d')][_0x8677('0x1a')]({'where':_0x4d7c06[_0x8677('0x49')]})[_0x8677('0x1d')](function(_0x5bbe7e){_0x4e8de7[_0x8677('0x1a')]=_0x5bbe7e;if(_0x422126[_0x8677('0x31')][_0x8677('0x50')]){_0x4d7c06[_0x8677('0x37')]=[{'all':!![]}];}return db['SmsMessage'][_0x8677('0x2a')](_0x4d7c06);})[_0x8677('0x1d')](function(_0x3f2d91){_0x4e8de7['rows']=_0x3f2d91;return _0x4e8de7;});}})[_0x8677('0x1d')](respondWithFilteredResult(_0x15c598,_0x4d7c06))[_0x8677('0x2d')](handleError(_0x15c598,null));};exports['addTags']=function(_0x32d1fd,_0x6266e9){return db[_0x8677('0x24')][_0x8677('0x39')]({'where':{'id':_0x32d1fd[_0x8677('0x2f')]['id']}})['then'](handleEntityNotFound(_0x6266e9,null))[_0x8677('0x1d')](function(_0x19756e){if(_0x19756e){return _0x19756e[_0x8677('0x51')](_0x32d1fd['body']['ids'],_['omit'](_0x32d1fd[_0x8677('0x3b')],['ids','id'])||{})[_0x8677('0x52')](function(){return db[_0x8677('0x53')][_0x8677('0x2a')]({'attributes':['id','name',_0x8677('0x54')],'where':{'id':_0x32d1fd[_0x8677('0x3b')]['ids']}});})[_0x8677('0x1d')](function(_0x5981c1){socket[_0x8677('0x55')](_0x8677('0x56'),{'id':Number(_0x32d1fd[_0x8677('0x2f')]['id']),'tags':_0x5981c1||[]});return{'id':Number(_0x32d1fd[_0x8677('0x2f')]['id']),'tags':_0x5981c1||[]};});}})[_0x8677('0x1d')](respondWithResult(_0x6266e9,null))[_0x8677('0x2d')](handleError(_0x6266e9,null));};exports['removeTags']=function(_0x30c7d3,_0x63373b){return db[_0x8677('0x24')][_0x8677('0x39')]({'where':{'id':_0x30c7d3[_0x8677('0x2f')]['id']}})['then'](handleEntityNotFound(_0x63373b,null))[_0x8677('0x1d')](function(_0x5d92c2){if(_0x5d92c2){return _0x5d92c2[_0x8677('0x57')](_0x30c7d3[_0x8677('0x31')][_0x8677('0x3f')]);}})[_0x8677('0x1d')](respondWithStatusCode(_0x63373b,null))['catch'](handleError(_0x63373b,null));};exports['download']=function(_0x17248f,_0x557909){var _0x5f1f54=moment()[_0x8677('0x58')]()[_0x8677('0x59')]();var _0x1a3bee=path[_0x8677('0x5a')](config[_0x8677('0x5b')],'server',_0x8677('0x5c'),_0x8677('0x5d'));var _0x354755=path[_0x8677('0x5a')](_0x1a3bee,_0x5f1f54);var _0x5b945c=util[_0x8677('0x4d')]('transcript-%d-%s.zip',_0x17248f[_0x8677('0x2f')]['id'],_0x5f1f54);var _0x330224=path[_0x8677('0x5a')](_0x1a3bee,_0x5b945c);var _0x2100e9=[];_0x2100e9['push']({'model':db['User'],'as':_0x8677('0x5e'),'attributes':['id',_0x8677('0x5f')],'raw':!![]});_0x2100e9[_0x8677('0x60')]({'model':db[_0x8677('0x61')],'as':'Contact','attributes':['id',_0x8677('0x62'),_0x8677('0x63')],'raw':!![]});var _0xf1168c=[{'model':db[_0x8677('0x3d')],'as':_0x8677('0x64'),'attributes':['id',_0x8677('0x3b'),_0x8677('0x65'),'direction',_0x8677('0x66'),_0x8677('0x67')],'include':_0x2100e9}];_0xf1168c['push']({'model':db[_0x8677('0x68')],'as':_0x8677('0x69'),'attributes':['id','name']});_0xf1168c[_0x8677('0x60')]({'model':db[_0x8677('0x5e')],'as':_0x8677('0x6a'),'attributes':['id',_0x8677('0x5f')]});return db[_0x8677('0x24')][_0x8677('0x39')]({'where':{'id':_0x17248f[_0x8677('0x2f')]['id']},'include':_0xf1168c})[_0x8677('0x1d')](handleEntityNotFound(_0x557909,null))[_0x8677('0x1d')](function(_0x264ff1){if(_0x264ff1){var _0x9fb3de=_0x264ff1[_0x8677('0x6b')]({'plain':!![]});fs[_0x8677('0x6c')](_0x354755);var _0x407035={'channel':_0x8677('0x6d'),'account':_0x9fb3de['Account'][_0x8677('0x20')],'agent':_0x9fb3de[_0x8677('0x6a')]?_0x9fb3de[_0x8677('0x6a')]['fullname']:_0x8677('0x6e'),'createdAt':moment(_0x9fb3de[_0x8677('0x65')])['format'](_0x8677('0x4e'))[_0x8677('0x59')](),'closedAt':_0x9fb3de['closed']?moment(_0x9fb3de[_0x8677('0x6f')])[_0x8677('0x4d')](_0x8677('0x4e'))[_0x8677('0x59')]():'','disposition':_0x9fb3de[_0x8677('0x70')],'messages':_(_0x9fb3de['Messages'])[_0x8677('0x4b')]({'secret':![]})[_0x8677('0x23')](function(_0x5e7f80){return{'date':moment(_0x5e7f80['createdAt'])['format'](_0x8677('0x4e'))[_0x8677('0x59')](),'sender':_0x5e7f80[_0x8677('0x71')]==='out'?_0x5e7f80['User']?_0x5e7f80['User'][_0x8677('0x5f')]:'System':_0x5e7f80[_0x8677('0x72')][_0x8677('0x62')]+(_0x5e7f80['Contact'][_0x8677('0x63')]?'\x20'+_0x5e7f80[_0x8677('0x72')]['lastName']:''),'body':_0x5e7f80[_0x8677('0x3b')],'direction':_0x5e7f80['direction']===_0x8677('0x73')?'A':'C','secret':_0x5e7f80['secret'],'read':_0x5e7f80['read']};})['value']()};return ejs[_0x8677('0x74')](path[_0x8677('0x5a')](config[_0x8677('0x5b')],'server',_0x8677('0x75'),_0x8677('0x76')),{'interaction':_0x407035})[_0x8677('0x1d')](function(_0x199abe){var _0x55e85f=path[_0x8677('0x5a')](_0x354755,'transcript-'+_0x9fb3de['id']+'-'+_0x5f1f54+'.pdf');var _0x32d03f={'path':_0x55e85f,'channel':_0x8677('0x6d'),'interactionId':_0x9fb3de['id']};return pdf[_0x8677('0x77')](_0x199abe,_0x32d03f);})['then'](function(){return new BPromise(function(_0x4a5266,_0x4c1933){zipdir(_0x354755,{'saveTo':_0x330224},function(_0x50ea60,_0x3bbae3){if(_0x50ea60)return _0x4c1933(_0x50ea60);return _0x4a5266(_0x3bbae3);});})[_0x8677('0x1d')](function(){return new BPromise(function(_0x37915b,_0x792894){rimraf(_0x354755,function(_0x54fe1e){if(_0x54fe1e)_0x792894(_0x54fe1e);return _0x37915b();});});})['then'](function(){return _0x557909[_0x8677('0x78')](_0x330224,_0x5b945c,function(_0x5c1478){if(_0x5c1478){console[_0x8677('0x79')](_0x8677('0x7a'),_0x5c1478);}else{fs[_0x8677('0x7b')](_0x330224);}});});});}else{return _0x557909[_0x8677('0x13')](0xc8);}})['catch'](handleError(_0x557909,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 05b1c5e..dc0eeee 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 _0xeb3b=['then','setDataValue','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','update','getUsers'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x3dda0f,_0x5b9902){_0x3dda0f=_0x3dda0f-0x0;var _0x1b0488=_0xeb3b[_0x3dda0f];return _0x1b0488;};'use strict';var EventEmitter=require(_0xbeb3('0x0'));var SmsInteraction=require(_0xbeb3('0x1'))['db'][_0xbeb3('0x2')];var SmsMessage=require(_0xbeb3('0x1'))['db'][_0xbeb3('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbeb3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e8ce3){return function(_0x4852ca,_0x2e8a69,_0x5ae6f9){_0x4852ca[_0xbeb3('0x5')]({'attributes':['id'],'raw':!![]})[_0xbeb3('0x6')](function(_0x406927){_0x4852ca[_0xbeb3('0x7')]('Users',_0x406927[_0xbeb3('0x8')](function(_0x26e0f3){return{'id':_0x26e0f3['id']};}));return SmsMessage[_0xbeb3('0x9')]({'where':{'SmsInteractionId':_0x4852ca['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbeb3('0x6')](function(_0x443396){_0x4852ca[_0xbeb3('0x7')](_0xbeb3('0xa'),_0x443396['length']);SmsInteractionEvents[_0xbeb3('0xb')](_0x2e8ce3+':'+_0x4852ca['id'],_0x4852ca);SmsInteractionEvents[_0xbeb3('0xb')](_0x2e8ce3,_0x4852ca);_0x5ae6f9(null);})['catch'](_0x5ae6f9(null));};}for(var e in events){if(events[_0xbeb3('0xc')](e)){var event=events[e];SmsInteraction[_0xbeb3('0xd')](e,emitEvent(event));}}module[_0xbeb3('0xe')]=SmsInteractionEvents; \ No newline at end of file +var _0x4213=['getUsers','setDataValue','Users','map','then','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove'];(function(_0x232715,_0x4bd63e){var _0x1e6090=function(_0x1baae7){while(--_0x1baae7){_0x232715['push'](_0x232715['shift']());}};_0x1e6090(++_0x4bd63e);}(_0x4213,0x77));var _0x3421=function(_0x118168,_0x1bac1e){_0x118168=_0x118168-0x0;var _0x19540f=_0x4213[_0x118168];return _0x19540f;};'use strict';var EventEmitter=require(_0x3421('0x0'));var SmsInteraction=require(_0x3421('0x1'))['db'][_0x3421('0x2')];var SmsMessage=require(_0x3421('0x1'))['db'][_0x3421('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x3421('0x4')](0x0);var events={'afterCreate':_0x3421('0x5'),'afterUpdate':'update','afterDestroy':_0x3421('0x6')};function emitEvent(_0x5c3719){return function(_0x459c5e,_0xfe969c,_0x2155f8){_0x459c5e[_0x3421('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x50e464){_0x459c5e[_0x3421('0x8')](_0x3421('0x9'),_0x50e464[_0x3421('0xa')](function(_0x13b0dd){return{'id':_0x13b0dd['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x459c5e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3421('0xb')](function(_0x58d511){_0x459c5e['setDataValue'](_0x3421('0xc'),_0x58d511['length']);SmsInteractionEvents[_0x3421('0xd')](_0x5c3719+':'+_0x459c5e['id'],_0x459c5e);SmsInteractionEvents[_0x3421('0xd')](_0x5c3719,_0x459c5e);_0x2155f8(null);})[_0x3421('0xe')](_0x2155f8(null));};}for(var e in events){if(events[_0x3421('0xf')](e)){var event=events[e];SmsInteraction[_0x3421('0x10')](e,emitEvent(event));}}module[_0x3421('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 0ad1b05..b6f0890 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 _0xfd46=['bluebird','request-promise','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api'];(function(_0x60290f,_0x1da37a){var _0x38eaa0=function(_0x596744){while(--_0x596744){_0x60290f['push'](_0x60290f['shift']());}};_0x38eaa0(++_0x1da37a);}(_0xfd46,0x14d));var _0x6fd4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xfd46[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x6fd4('0x0'));var util=require('util');var logger=require(_0x6fd4('0x1'))(_0x6fd4('0x2'));var moment=require('moment');var BPromise=require(_0x6fd4('0x3'));var rp=require(_0x6fd4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6fd4('0x5'));var config=require('../../config/environment');var attributes=require(_0x6fd4('0x6'));module[_0x6fd4('0x7')]=function(_0x190c82,_0x5a1433){return _0x190c82[_0x6fd4('0x8')](_0x6fd4('0x9'),attributes,{'tableName':_0x6fd4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38d51c,_0x27a935,_0xe959e3){if(_0x38d51c['changed']('closed')){_0x38d51c['closedAt']=moment()['format'](_0x6fd4('0xb'));}_0xe959e3(null,_0x38d51c);}}});}; \ No newline at end of file +var _0x3bf8=['request-promise','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','lodash','api','bluebird'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0x3bf8,0x89));var _0x83bf=function(_0x3ff555,_0x42feb6){_0x3ff555=_0x3ff555-0x0;var _0x20351d=_0x3bf8[_0x3ff555];return _0x20351d;};'use strict';var _=require(_0x83bf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x83bf('0x1'));var moment=require('moment');var BPromise=require(_0x83bf('0x2'));var rp=require(_0x83bf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x83bf('0x4'));var config=require(_0x83bf('0x5'));var attributes=require(_0x83bf('0x6'));module[_0x83bf('0x7')]=function(_0x5515a2,_0x536289){return _0x5515a2[_0x83bf('0x8')](_0x83bf('0x9'),attributes,{'tableName':_0x83bf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4128ed,_0x368e2e,_0x4bb88a){if(_0x4128ed[_0x83bf('0xb')](_0x83bf('0xc'))){_0x4128ed[_0x83bf('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4bb88a(null,_0x4128ed);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 385d849..2f7916d 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 _0x18c4=['options','raw','where','UpdateSmsInteraction','catch','AddTagsToSmsInteraction','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','SmsInteraction','body'];(function(_0x1e67a9,_0x156a74){var _0x13c375=function(_0x7f2bd8){while(--_0x7f2bd8){_0x1e67a9['push'](_0x1e67a9['shift']());}};_0x13c375(++_0x156a74);}(_0x18c4,0xd2));var _0x418c=function(_0x3cbe28,_0x2f6465){_0x3cbe28=_0x3cbe28-0x0;var _0x23cdf9=_0x18c4[_0x3cbe28];return _0x23cdf9;};'use strict';var _=require(_0x418c('0x0'));var util=require(_0x418c('0x1'));var moment=require('moment');var BPromise=require(_0x418c('0x2'));var rs=require(_0x418c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x418c('0x4'))['db'];var utils=require(_0x418c('0x5'));var logger=require('../../config/logger')(_0x418c('0x6'));var config=require(_0x418c('0x7'));var jayson=require(_0x418c('0x8'));var client=jayson[_0x418c('0x9')]['http']({'port':0x232a});config['redis']=_[_0x418c('0xa')](config['redis'],{'host':_0x418c('0xb'),'port':0x18eb});var socket=require(_0x418c('0xc'))(new Redis(config[_0x418c('0xd')]));require(_0x418c('0xe'))[_0x418c('0xf')](socket);function respondWithRpcPromise(_0x338efd,_0x3d4c96,_0x3bf3cf){return new BPromise(function(_0x256afd,_0x5ba2dc){return client[_0x418c('0x10')](_0x338efd,_0x3bf3cf)[_0x418c('0x11')](function(_0x5b0ac2){logger['info'](_0x418c('0x12'),_0x3d4c96,_0x418c('0x13'));logger[_0x418c('0x14')](_0x418c('0x15'),_0x3d4c96,_0x418c('0x13'),JSON[_0x418c('0x16')](_0x5b0ac2));if(_0x5b0ac2[_0x418c('0x17')]){if(_0x5b0ac2[_0x418c('0x17')][_0x418c('0x18')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x3d4c96,_0x5b0ac2[_0x418c('0x17')][_0x418c('0x19')]);return _0x5ba2dc(_0x5b0ac2[_0x418c('0x17')][_0x418c('0x19')]);}logger[_0x418c('0x17')](_0x418c('0x12'),_0x3d4c96,_0x5b0ac2['error'][_0x418c('0x19')]);return _0x256afd(_0x5b0ac2[_0x418c('0x17')][_0x418c('0x19')]);}else{logger[_0x418c('0x1a')](_0x418c('0x12'),_0x3d4c96,_0x418c('0x13'));_0x256afd(_0x5b0ac2[_0x418c('0x1b')]['message']);}})['catch'](function(_0x24e9bc){logger[_0x418c('0x17')](_0x418c('0x12'),_0x3d4c96,_0x24e9bc);_0x5ba2dc(_0x24e9bc);});});}exports['UpdateSmsInteraction']=function(_0x54c2c9){var _0x3fbf93=this;return new Promise(function(_0x2b2c4b,_0x51d6a8){return db[_0x418c('0x1c')]['update'](_0x54c2c9[_0x418c('0x1d')],{'raw':_0x54c2c9[_0x418c('0x1e')]?_0x54c2c9[_0x418c('0x1e')][_0x418c('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54c2c9[_0x418c('0x1e')]?_0x54c2c9[_0x418c('0x1e')][_0x418c('0x20')]||null:null,'attributes':_0x54c2c9[_0x418c('0x1e')]?_0x54c2c9['options']['attributes']||null:null,'limit':_0x54c2c9[_0x418c('0x1e')]?_0x54c2c9[_0x418c('0x1e')]['limit']||null:null})[_0x418c('0x11')](function(_0x19c92c){logger['info'](_0x418c('0x21'),_0x54c2c9);logger[_0x418c('0x14')](_0x418c('0x21'),_0x54c2c9,JSON['stringify'](_0x19c92c));_0x2b2c4b(_0x19c92c);})[_0x418c('0x22')](function(_0x485d9b){logger[_0x418c('0x17')](_0x418c('0x21'),_0x485d9b[_0x418c('0x19')],_0x54c2c9);_0x51d6a8(_0x3fbf93['error'](0x1f4,_0x485d9b[_0x418c('0x19')]));});});};exports[_0x418c('0x23')]=function(_0x322ed6){return new Promise(function(_0x198a44,_0x30b294){return db[_0x418c('0x1c')]['find']({'where':_0x322ed6[_0x418c('0x1e')]?_0x322ed6[_0x418c('0x1e')][_0x418c('0x20')]||null:null})[_0x418c('0x11')](function(_0x4b472e){if(_0x4b472e){return _0x4b472e['addTags'](_0x322ed6[_0x418c('0x1d')][_0x418c('0x24')],_[_0x418c('0x25')](_0x322ed6[_0x418c('0x1d')],[_0x418c('0x24'),'id'])||{});}})[_0x418c('0x26')](function(_0x58acc9){logger[_0x418c('0x1a')](_0x418c('0x27'),_0x322ed6);logger[_0x418c('0x14')](_0x418c('0x27'),_0x322ed6,JSON[_0x418c('0x16')](_0x58acc9));_0x198a44(_0x58acc9);})[_0x418c('0x22')](function(_0x3875dc){logger[_0x418c('0x17')](_0x418c('0x27'),_0x3875dc[_0x418c('0x19')],_0x322ed6);_0x30b294(_this[_0x418c('0x17')](0x1f4,_0x3875dc[_0x418c('0x19')]));});});}; \ No newline at end of file +var _0xd6f3=['AddTagsToSmsInteraction','find','addTags','body','omit','ids','spread','AddTags','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','update','options','raw','where','attributes','limit','UpdateSmsInteraction','catch'];(function(_0x33925b,_0x95cfc6){var _0x375e21=function(_0x57c759){while(--_0x57c759){_0x33925b['push'](_0x33925b['shift']());}};_0x375e21(++_0x95cfc6);}(_0xd6f3,0x1e8));var _0x3d6f=function(_0x1b22c7,_0x1d9356){_0x1b22c7=_0x1b22c7-0x0;var _0x4d1bee=_0xd6f3[_0x1b22c7];return _0x4d1bee;};'use strict';var _=require(_0x3d6f('0x0'));var util=require('util');var moment=require(_0x3d6f('0x1'));var BPromise=require('bluebird');var rs=require(_0x3d6f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d6f('0x3'));var logger=require(_0x3d6f('0x4'))(_0x3d6f('0x5'));var config=require('../../config/environment');var jayson=require(_0x3d6f('0x6'));var client=jayson['client'][_0x3d6f('0x7')]({'port':0x232a});config[_0x3d6f('0x8')]=_[_0x3d6f('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3d6f('0xa'))(new Redis(config[_0x3d6f('0x8')]));require(_0x3d6f('0xb'))[_0x3d6f('0xc')](socket);function respondWithRpcPromise(_0x5e414f,_0x246a95,_0x3c73ee){return new BPromise(function(_0x542407,_0x3f7c8c){return client['request'](_0x5e414f,_0x3c73ee)[_0x3d6f('0xd')](function(_0x56ecde){logger[_0x3d6f('0xe')](_0x3d6f('0xf'),_0x246a95,_0x3d6f('0x10'));logger[_0x3d6f('0x11')](_0x3d6f('0x12'),_0x246a95,_0x3d6f('0x10'),JSON[_0x3d6f('0x13')](_0x56ecde));if(_0x56ecde['error']){if(_0x56ecde[_0x3d6f('0x14')][_0x3d6f('0x15')]===0x1f4){logger[_0x3d6f('0x14')](_0x3d6f('0xf'),_0x246a95,_0x56ecde[_0x3d6f('0x14')]['message']);return _0x3f7c8c(_0x56ecde[_0x3d6f('0x14')][_0x3d6f('0x16')]);}logger[_0x3d6f('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x246a95,_0x56ecde[_0x3d6f('0x14')][_0x3d6f('0x16')]);return _0x542407(_0x56ecde[_0x3d6f('0x14')][_0x3d6f('0x16')]);}else{logger[_0x3d6f('0xe')]('SmsInteraction,\x20%s,\x20%s',_0x246a95,_0x3d6f('0x10'));_0x542407(_0x56ecde[_0x3d6f('0x17')][_0x3d6f('0x16')]);}})['catch'](function(_0x599271){logger[_0x3d6f('0x14')](_0x3d6f('0xf'),_0x246a95,_0x599271);_0x3f7c8c(_0x599271);});});}exports['UpdateSmsInteraction']=function(_0x39890e){var _0x526ed2=this;return new Promise(function(_0x42e9f4,_0x2ae502){return db['SmsInteraction'][_0x3d6f('0x18')](_0x39890e['body'],{'raw':_0x39890e[_0x3d6f('0x19')]?_0x39890e[_0x3d6f('0x19')][_0x3d6f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39890e['options']?_0x39890e[_0x3d6f('0x19')][_0x3d6f('0x1b')]||null:null,'attributes':_0x39890e[_0x3d6f('0x19')]?_0x39890e[_0x3d6f('0x19')][_0x3d6f('0x1c')]||null:null,'limit':_0x39890e[_0x3d6f('0x19')]?_0x39890e[_0x3d6f('0x19')][_0x3d6f('0x1d')]||null:null})[_0x3d6f('0xd')](function(_0x1fbe58){logger[_0x3d6f('0xe')]('UpdateSmsInteraction',_0x39890e);logger[_0x3d6f('0x11')](_0x3d6f('0x1e'),_0x39890e,JSON[_0x3d6f('0x13')](_0x1fbe58));_0x42e9f4(_0x1fbe58);})[_0x3d6f('0x1f')](function(_0x5d59bd){logger[_0x3d6f('0x14')]('UpdateSmsInteraction',_0x5d59bd[_0x3d6f('0x16')],_0x39890e);_0x2ae502(_0x526ed2[_0x3d6f('0x14')](0x1f4,_0x5d59bd[_0x3d6f('0x16')]));});});};exports[_0x3d6f('0x20')]=function(_0x435c5e){return new Promise(function(_0x622ed9,_0x2b5d50){return db['SmsInteraction'][_0x3d6f('0x21')]({'where':_0x435c5e['options']?_0x435c5e['options']['where']||null:null})[_0x3d6f('0xd')](function(_0x3c5c05){if(_0x3c5c05){return _0x3c5c05[_0x3d6f('0x22')](_0x435c5e[_0x3d6f('0x23')]['ids'],_[_0x3d6f('0x24')](_0x435c5e['body'],[_0x3d6f('0x25'),'id'])||{});}})[_0x3d6f('0x26')](function(_0xa9c62f){logger['info']('AddTags',_0x435c5e);logger[_0x3d6f('0x11')](_0x3d6f('0x27'),_0x435c5e,JSON[_0x3d6f('0x13')](_0xa9c62f));_0x622ed9(_0xa9c62f);})[_0x3d6f('0x1f')](function(_0x5a6f48){logger[_0x3d6f('0x14')](_0x3d6f('0x27'),_0x5a6f48[_0x3d6f('0x16')],_0x435c5e);_0x2b5d50(_this[_0x3d6f('0x14')](0x1f4,_0x5a6f48['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index b6130ae..060155f 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 _0x234b=['removeListener','register','length','remove','emit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x234b,0x116));var _0xb234=function(_0x50c8a1,_0x38baa6){_0x50c8a1=_0x50c8a1-0x0;var _0x35b0c2=_0x234b[_0x50c8a1];return _0x35b0c2;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0xb234('0x0'),'update'];function createListener(_0x2bb4e1,_0x278305){return function(_0x3e73e0){_0x278305[_0xb234('0x1')](_0x2bb4e1,_0x3e73e0);};}function removeListener(_0x306ddb,_0x13bc6b){return function(){SmsInteractionEvents[_0xb234('0x2')](_0x306ddb,_0x13bc6b);};}exports[_0xb234('0x3')]=function(_0xc3d130){for(var _0x1602f0=0x0,_0x4d407a=events[_0xb234('0x4')];_0x1602f0<_0x4d407a;_0x1602f0++){var _0x4e792e=events[_0x1602f0];var _0x3bb482=createListener('smsInteraction:'+_0x4e792e,_0xc3d130);SmsInteractionEvents['on'](_0x4e792e,_0x3bb482);}}; \ No newline at end of file +var _0xcb24=['removeListener','register','length','./smsInteraction.events','update','emit'];(function(_0x3905b1,_0x2bddb9){var _0xd4525f=function(_0x3a7bf2){while(--_0x3a7bf2){_0x3905b1['push'](_0x3905b1['shift']());}};_0xd4525f(++_0x2bddb9);}(_0xcb24,0x1e9));var _0x4cb2=function(_0x343b26,_0x168fe7){_0x343b26=_0x343b26-0x0;var _0xfa9c7a=_0xcb24[_0x343b26];return _0xfa9c7a;};'use strict';var SmsInteractionEvents=require(_0x4cb2('0x0'));var events=['save','remove',_0x4cb2('0x1')];function createListener(_0x1e3e23,_0x2751ad){return function(_0x2fa051){_0x2751ad[_0x4cb2('0x2')](_0x1e3e23,_0x2fa051);};}function removeListener(_0x15472d,_0x2d0101){return function(){SmsInteractionEvents[_0x4cb2('0x3')](_0x15472d,_0x2d0101);};}exports[_0x4cb2('0x4')]=function(_0x166c0b){for(var _0x591b88=0x0,_0x46ae2d=events[_0x4cb2('0x5')];_0x591b88<_0x46ae2d;_0x591b88++){var _0x249f9a=events[_0x591b88];var _0x2a2d0b=createListener('smsInteraction:'+_0x249f9a,_0x166c0b);SmsInteractionEvents['on'](_0x249f9a,_0x2a2d0b);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index c14e2f4..eee8bba 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 _0x4eab=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','describe','/:id','show','post','smsmessage:create','create','status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x4eab,0x194));var _0xb4ea=function(_0x32a7ec,_0x3ae584){_0x32a7ec=_0x32a7ec-0x0;var _0x3a4f7e=_0x4eab[_0x32a7ec];return _0x3a4f7e;};'use strict';var multer=require(_0xb4ea('0x0'));var util=require(_0xb4ea('0x1'));var path=require(_0xb4ea('0x2'));var timeout=require(_0xb4ea('0x3'));var express=require(_0xb4ea('0x4'));var router=express[_0xb4ea('0x5')]();var fs_extra=require(_0xb4ea('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb4ea('0x7'));var config=require(_0xb4ea('0x8'));var controller=require(_0xb4ea('0x9'));router[_0xb4ea('0xa')]('/',auth[_0xb4ea('0xb')](),controller['index']);router[_0xb4ea('0xa')]('/describe',auth[_0xb4ea('0xb')](),controller[_0xb4ea('0xc')]);router[_0xb4ea('0xa')](_0xb4ea('0xd'),auth[_0xb4ea('0xb')](),controller[_0xb4ea('0xe')]);router[_0xb4ea('0xf')]('/',auth[_0xb4ea('0xb')](),interaction['tracked']('sms',_0xb4ea('0x10')),controller[_0xb4ea('0x11')]);router[_0xb4ea('0xf')]('/:id/status',controller[_0xb4ea('0x12')]);router[_0xb4ea('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xb4ea('0x14')]);router[_0xb4ea('0x13')](_0xb4ea('0x15'),auth[_0xb4ea('0xb')](),controller[_0xb4ea('0x16')]);router[_0xb4ea('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0xb4ea('0x17')]);router[_0xb4ea('0x18')](_0xb4ea('0xd'),auth[_0xb4ea('0xb')](),controller[_0xb4ea('0x19')]);module[_0xb4ea('0x1a')]=router; \ No newline at end of file +var _0x793b=['describe','/:id','show','post','sms','smsmessage:create','/:id/status','status','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./smsMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x5853a4,_0x34eba5){var _0x489c93=function(_0x1ccd9d){while(--_0x1ccd9d){_0x5853a4['push'](_0x5853a4['shift']());}};_0x489c93(++_0x34eba5);}(_0x793b,0x189));var _0xb793=function(_0x4d30d0,_0x2ecd9f){_0x4d30d0=_0x4d30d0-0x0;var _0x5efe72=_0x793b[_0x4d30d0];return _0x5efe72;};'use strict';var multer=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var path=require(_0xb793('0x2'));var timeout=require(_0xb793('0x3'));var express=require(_0xb793('0x4'));var router=express['Router']();var fs_extra=require(_0xb793('0x5'));var auth=require(_0xb793('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb793('0x7'));router[_0xb793('0x8')]('/',auth[_0xb793('0x9')](),controller[_0xb793('0xa')]);router[_0xb793('0x8')](_0xb793('0xb'),auth[_0xb793('0x9')](),controller[_0xb793('0xc')]);router[_0xb793('0x8')](_0xb793('0xd'),auth[_0xb793('0x9')](),controller[_0xb793('0xe')]);router[_0xb793('0xf')]('/',auth[_0xb793('0x9')](),interaction['tracked'](_0xb793('0x10'),_0xb793('0x11')),controller['create']);router['post'](_0xb793('0x12'),controller[_0xb793('0x13')]);router['put'](_0xb793('0xd'),auth[_0xb793('0x9')](),controller['update']);router[_0xb793('0x14')](_0xb793('0x15'),auth[_0xb793('0x9')](),controller[_0xb793('0x16')]);router[_0xb793('0x14')](_0xb793('0x17'),auth[_0xb793('0x9')](),controller['reject']);router[_0xb793('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xb793('0x19')]);module[_0xb793('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 47ded8b..0e9e36b 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 _0xff3c=['exports','medium','BOOLEAN','out','STRING','DATE','sequelize'];(function(_0x5e57e1,_0x192481){var _0x3269e5=function(_0x201888){while(--_0x201888){_0x5e57e1['push'](_0x5e57e1['shift']());}};_0x3269e5(++_0x192481);}(_0xff3c,0x179));var _0xcff3=function(_0xf3e375,_0x5dc1c9){_0xf3e375=_0xf3e375-0x0;var _0x27027b=_0xff3c[_0xf3e375];return _0x27027b;};'use strict';var Sequelize=require(_0xcff3('0x0'));module[_0xcff3('0x1')]={'body':{'type':Sequelize['TEXT'](_0xcff3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcff3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xcff3('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xcff3('0x5')](0xbe)},'phone':{'type':Sequelize[_0xcff3('0x5')]},'readAt':{'type':Sequelize[_0xcff3('0x6')]},'secret':{'type':Sequelize[_0xcff3('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcff3('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2d8d=['medium','BOOLEAN','ENUM','STRING','sequelize','exports','TEXT'];(function(_0x8049e5,_0x1f0c19){var _0x2a0b78=function(_0x4b1b55){while(--_0x4b1b55){_0x8049e5['push'](_0x8049e5['shift']());}};_0x2a0b78(++_0x1f0c19);}(_0x2d8d,0x154));var _0xd2d8=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0x2d8d[_0x5a19fc];return _0x34b413;};'use strict';var Sequelize=require(_0xd2d8('0x0'));module[_0xd2d8('0x1')]={'body':{'type':Sequelize[_0xd2d8('0x2')](_0xd2d8('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd2d8('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd2d8('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd2d8('0x6')](0xbe)},'phone':{'type':Sequelize[_0xd2d8('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xd2d8('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xd2d8('0x6')]},'providerResponse':{'type':Sequelize[_0xd2d8('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 5de011f..6ff0474 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 _0x32c3=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','offset','limit','count','apply','save','update','sendStatus','stack','name','send','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','findAll','rows','show','params','keys','length','includeAll','include','find','create','body','destroy','describe','sms-interactions','sms','read','readAt','UserId','agent','SmsInteraction','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','fullname','email','internal','channel','motionChannel','event','accept','SmsInteractionId','interaction','get','role','RejectMessage','rejectMessage','QueryTypes','User','interface','reject','EventManager','rejectmessage','SmsAccount','SmsAccountId','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','delivered','plivio','results','groupName','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x25a281,_0x22ae3b){var _0x12d134=function(_0x3f9cda){while(--_0x3f9cda){_0x25a281['push'](_0x25a281['shift']());}};_0x12d134(++_0x22ae3b);}(_0x32c3,0x1a8));var _0x332c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x32c3[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x332c('0x0'));var rimraf=require(_0x332c('0x1'));var zipdir=require(_0x332c('0x2'));var jsonpatch=require(_0x332c('0x3'));var rp=require(_0x332c('0x4'));var moment=require(_0x332c('0x5'));var BPromise=require(_0x332c('0x6'));var Mustache=require(_0x332c('0x7'));var util=require(_0x332c('0x8'));var path=require(_0x332c('0x9'));var sox=require(_0x332c('0xa'));var csv=require(_0x332c('0xb'));var ejs=require(_0x332c('0xc'));var fs=require('fs');var fs_extra=require(_0x332c('0xd'));var _=require(_0x332c('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x332c('0xf'));var deskjs=require(_0x332c('0x10'));var toCsv=require(_0x332c('0xb'));var querystring=require(_0x332c('0x11'));var Papa=require(_0x332c('0x12'));var Redis=require(_0x332c('0x13'));var authService=require(_0x332c('0x14'));var qs=require(_0x332c('0x15'));var as=require(_0x332c('0x16'));var hardwareService=require(_0x332c('0x17'));var logger=require(_0x332c('0x18'))('api');var utils=require(_0x332c('0x19'));var config=require(_0x332c('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x332c('0x1b'))['db'];config[_0x332c('0x1c')]=_[_0x332c('0x1d')](config[_0x332c('0x1c')],{'host':_0x332c('0x1e'),'port':0x18eb});var socket=require(_0x332c('0x1f'))(new Redis(config[_0x332c('0x1c')]));require('./smsMessage.socket')[_0x332c('0x20')](socket);var jayson=require(_0x332c('0x21'));var client=jayson[_0x332c('0x22')][_0x332c('0x23')]({'port':0x232c});var client9002=jayson[_0x332c('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x389f96,_0x2678c4,_0x37370d,_0x4f75b8){return new BPromise(function(_0x556b54,_0x2b91de){var _0xc5385e=_0x4f75b8||client;return _0xc5385e[_0x332c('0x24')](_0x389f96,_0x37370d)[_0x332c('0x25')](function(_0x293817){logger[_0x332c('0x26')](_0x332c('0x27'),_0x2678c4,'request\x20sent');logger[_0x332c('0x28')](_0x332c('0x29'),_0x2678c4,_0x332c('0x2a'),JSON[_0x332c('0x2b')](_0x293817));if(_0x293817['error']){if(_0x293817[_0x332c('0x2c')][_0x332c('0x2d')]===0x1f4){logger[_0x332c('0x2c')](_0x332c('0x27'),_0x2678c4,_0x293817['error'][_0x332c('0x2e')]);return _0x2b91de(_0x293817[_0x332c('0x2c')][_0x332c('0x2e')]);}logger[_0x332c('0x2c')](_0x332c('0x27'),_0x2678c4,_0x293817[_0x332c('0x2c')][_0x332c('0x2e')]);return _0x556b54(_0x293817[_0x332c('0x2c')][_0x332c('0x2e')]);}else{logger[_0x332c('0x26')]('SmsMessage,\x20%s,\x20%s',_0x2678c4,_0x332c('0x2a'));_0x556b54(_0x293817['result'][_0x332c('0x2e')]);}})[_0x332c('0x2f')](function(_0x3ba358){logger[_0x332c('0x2c')]('SmsMessage,\x20%s,\x20%s',_0x2678c4,_0x3ba358);_0x2b91de(_0x3ba358);});});}function respondWithStatusCode(_0x5bcfc0,_0x30ba43){_0x30ba43=_0x30ba43||0xcc;return function(_0x36af75){if(_0x36af75){return _0x5bcfc0['sendStatus'](_0x30ba43);}return _0x5bcfc0[_0x332c('0x30')](_0x30ba43)[_0x332c('0x31')]();};}function respondWithResult(_0x112433,_0x5863c6){_0x5863c6=_0x5863c6||0xc8;return function(_0x43f47d){if(_0x43f47d){return _0x112433['status'](_0x5863c6)[_0x332c('0x32')](_0x43f47d);}};}function respondWithFilteredResult(_0x272484,_0x49007b){return function(_0x309286){if(_0x309286){var _0x2af30b=typeof _0x49007b[_0x332c('0x33')]==='undefined'&&typeof _0x49007b[_0x332c('0x34')]==='undefined';var _0x16ec20=_0x309286['count'];var _0x1200d8=_0x2af30b?0x0:_0x49007b['offset'];var _0xd79623=_0x2af30b?_0x309286[_0x332c('0x35')]:_0x49007b[_0x332c('0x33')]+_0x49007b[_0x332c('0x34')];var _0x5624a8;if(_0xd79623>=_0x16ec20){_0xd79623=_0x16ec20;_0x5624a8=0xc8;}else{_0x5624a8=0xce;}_0x272484[_0x332c('0x30')](_0x5624a8);return _0x272484['set']('Content-Range',_0x1200d8+'-'+_0xd79623+'/'+_0x16ec20)['json'](_0x309286);}return null;};}function patchUpdates(_0x5043d6){return function(_0x29385e){try{jsonpatch[_0x332c('0x36')](_0x29385e,_0x5043d6,!![]);}catch(_0x252a2c){return BPromise['reject'](_0x252a2c);}return _0x29385e[_0x332c('0x37')]();};}function saveUpdates(_0xa06702,_0xac2295){return function(_0x331145){if(_0x331145){return _0x331145[_0x332c('0x38')](_0xa06702)[_0x332c('0x25')](function(_0x4978de){return _0x4978de;});}return null;};}function removeEntity(_0x234b60,_0x6727a8){return function(_0x4a5e10){if(_0x4a5e10){return _0x4a5e10['destroy']()[_0x332c('0x25')](function(){_0x234b60[_0x332c('0x30')](0xcc)[_0x332c('0x31')]();});}};}function handleEntityNotFound(_0x520e98,_0x2993d4){return function(_0x21746a){if(!_0x21746a){_0x520e98[_0x332c('0x39')](0x194);}return _0x21746a;};}function handleError(_0x2482fb,_0xcf98a8){_0xcf98a8=_0xcf98a8||0x1f4;return function(_0x392ea5){logger[_0x332c('0x2c')](_0x392ea5[_0x332c('0x3a')]);if(_0x392ea5[_0x332c('0x3b')]){delete _0x392ea5['name'];}_0x2482fb[_0x332c('0x30')](_0xcf98a8)[_0x332c('0x3c')](_0x392ea5);};}exports['index']=function(_0x5686b6,_0x546df8){var _0x7779aa={},_0x5a8576={},_0x590f4b={'count':0x0,'rows':[]};var _0x4c7f71=_[_0x332c('0x3d')](db[_0x332c('0x3e')][_0x332c('0x3f')],function(_0x90b2ec){return{'name':_0x90b2ec[_0x332c('0x40')],'type':_0x90b2ec[_0x332c('0x41')][_0x332c('0x42')]};});_0x5a8576[_0x332c('0x43')]=_[_0x332c('0x3d')](_0x4c7f71,_0x332c('0x3b'));_0x5a8576[_0x332c('0x44')]=_['keys'](_0x5686b6['query']);_0x5a8576[_0x332c('0x45')]=_[_0x332c('0x46')](_0x5a8576[_0x332c('0x43')],_0x5a8576[_0x332c('0x44')]);_0x7779aa[_0x332c('0x47')]=_[_0x332c('0x46')](_0x5a8576[_0x332c('0x43')],qs[_0x332c('0x48')](_0x5686b6['query']['fields']));_0x7779aa[_0x332c('0x47')]=_0x7779aa['attributes']['length']?_0x7779aa[_0x332c('0x47')]:_0x5a8576[_0x332c('0x43')];if(!_0x5686b6[_0x332c('0x44')][_0x332c('0x49')]('nolimit')){_0x7779aa[_0x332c('0x34')]=qs[_0x332c('0x34')](_0x5686b6[_0x332c('0x44')][_0x332c('0x34')]);_0x7779aa['offset']=qs[_0x332c('0x33')](_0x5686b6[_0x332c('0x44')]['offset']);}_0x7779aa[_0x332c('0x4a')]=qs[_0x332c('0x4b')](_0x5686b6[_0x332c('0x44')]['sort']);_0x7779aa[_0x332c('0x4c')]=qs['filters'](_['pick'](_0x5686b6[_0x332c('0x44')],_0x5a8576['filters']),_0x4c7f71);if(_0x5686b6[_0x332c('0x44')][_0x332c('0x4d')]){_0x7779aa['where']=_['merge'](_0x7779aa[_0x332c('0x4c')],{'$or':_['map'](_0x4c7f71,function(_0x350c74){if(_0x350c74['type']!==_0x332c('0x4e')){var _0x2319e1={};_0x2319e1[_0x350c74[_0x332c('0x3b')]]={'$like':'%'+_0x5686b6[_0x332c('0x44')]['filter']+'%'};return _0x2319e1;}})});}_0x7779aa=_[_0x332c('0x4f')]({},_0x7779aa,_0x5686b6[_0x332c('0x50')]);var _0x174951={'where':_0x7779aa[_0x332c('0x4c')]};return db[_0x332c('0x3e')][_0x332c('0x35')](_0x174951)[_0x332c('0x25')](function(_0x59df95){_0x590f4b[_0x332c('0x35')]=_0x59df95;if(_0x5686b6[_0x332c('0x44')]['includeAll']){_0x7779aa['include']=[{'all':!![]}];}return db['SmsMessage'][_0x332c('0x51')](_0x7779aa);})[_0x332c('0x25')](function(_0x40d08d){_0x590f4b[_0x332c('0x52')]=_0x40d08d;return _0x590f4b;})[_0x332c('0x25')](respondWithFilteredResult(_0x546df8,_0x7779aa))[_0x332c('0x2f')](handleError(_0x546df8,null));};exports[_0x332c('0x53')]=function(_0x4c8259,_0x252ef7){var _0x47f069={'raw':!![],'where':{'id':_0x4c8259[_0x332c('0x54')]['id']}},_0x5a551b={};_0x5a551b[_0x332c('0x43')]=_['keys'](db[_0x332c('0x3e')][_0x332c('0x3f')]);_0x5a551b[_0x332c('0x44')]=_[_0x332c('0x55')](_0x4c8259['query']);_0x5a551b['filters']=_[_0x332c('0x46')](_0x5a551b[_0x332c('0x43')],_0x5a551b[_0x332c('0x44')]);_0x47f069[_0x332c('0x47')]=_[_0x332c('0x46')](_0x5a551b[_0x332c('0x43')],qs[_0x332c('0x48')](_0x4c8259[_0x332c('0x44')][_0x332c('0x48')]));_0x47f069[_0x332c('0x47')]=_0x47f069[_0x332c('0x47')][_0x332c('0x56')]?_0x47f069['attributes']:_0x5a551b[_0x332c('0x43')];if(_0x4c8259[_0x332c('0x44')][_0x332c('0x57')]){_0x47f069[_0x332c('0x58')]=[{'all':!![]}];}_0x47f069=_['merge']({},_0x47f069,_0x4c8259[_0x332c('0x50')]);return db['SmsMessage'][_0x332c('0x59')](_0x47f069)['then'](handleEntityNotFound(_0x252ef7,null))[_0x332c('0x25')](respondWithResult(_0x252ef7,null))[_0x332c('0x2f')](handleError(_0x252ef7,null));};exports[_0x332c('0x5a')]=function(_0xf99d06,_0x174954){return db[_0x332c('0x3e')]['create'](_0xf99d06[_0x332c('0x5b')],{})[_0x332c('0x25')](respondWithResult(_0x174954,0xc9))[_0x332c('0x2f')](handleError(_0x174954,null));};exports['update']=function(_0x40c6b6,_0x40b7a5){if(_0x40c6b6[_0x332c('0x5b')]['id']){delete _0x40c6b6[_0x332c('0x5b')]['id'];}return db[_0x332c('0x3e')][_0x332c('0x59')]({'where':{'id':_0x40c6b6[_0x332c('0x54')]['id']}})[_0x332c('0x25')](handleEntityNotFound(_0x40b7a5,null))[_0x332c('0x25')](saveUpdates(_0x40c6b6['body'],null))[_0x332c('0x25')](respondWithResult(_0x40b7a5,null))['catch'](handleError(_0x40b7a5,null));};exports[_0x332c('0x5c')]=function(_0x33ec64,_0x5a1a04){return db[_0x332c('0x3e')][_0x332c('0x59')]({'where':{'id':_0x33ec64[_0x332c('0x54')]['id']}})[_0x332c('0x25')](handleEntityNotFound(_0x5a1a04,null))['then'](removeEntity(_0x5a1a04,null))['catch'](handleError(_0x5a1a04,null));};exports[_0x332c('0x5d')]=function(_0x1bfb0a,_0x3789a3){return db[_0x332c('0x3e')][_0x332c('0x5d')]()[_0x332c('0x25')](respondWithResult(_0x3789a3,null))['catch'](handleError(_0x3789a3,null));};var interaction_log=require(_0x332c('0x18'))(_0x332c('0x5e'));exports['accept']=function(_0xd4ba6a,_0x3142f6,_0x26e269){var _0x49273a={'agent':{},'channel':_0x332c('0x5f')};if(_0xd4ba6a['body']['id']){delete _0xd4ba6a[_0x332c('0x5b')]['id'];}_0xd4ba6a[_0x332c('0x5b')][_0x332c('0x60')]=!![];_0xd4ba6a['body'][_0x332c('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xd4ba6a['body'][_0x332c('0x62')]=_0xd4ba6a[_0x332c('0x5b')]['UserId']||_0xd4ba6a['user']['id'];_0x49273a[_0x332c('0x63')]['id']=_0xd4ba6a[_0x332c('0x5b')]['UserId'];return db[_0x332c('0x3e')][_0x332c('0x59')]({'where':{'id':_0xd4ba6a[_0x332c('0x54')]['id'],'UserId':null}})[_0x332c('0x25')](handleEntityNotFound(_0x3142f6,null))[_0x332c('0x25')](saveUpdates(_0xd4ba6a[_0x332c('0x5b')],null))[_0x332c('0x25')](function(_0x168d62){if(_0x168d62){_0x49273a[_0x332c('0x2e')]=_0x168d62['get']({'plain':!![]});return db[_0x332c('0x64')][_0x332c('0x59')]({'where':{'id':_0x168d62['SmsInteractionId']}});}return null;})[_0x332c('0x25')](handleEntityNotFound(_0x3142f6,null))[_0x332c('0x25')](function(_0x204c60){if(_0x204c60){return _0x204c60['update']({'UserId':_0xd4ba6a[_0x332c('0x5b')][_0x332c('0x62')],'read1stAt':_[_0x332c('0x65')](_0x204c60[_0x332c('0x66')])?moment()[_0x332c('0x67')](_0x332c('0x68')):undefined});}return null;})['then'](function(_0xef4811){if(_0xef4811){_0x49273a['interaction']=_0xef4811['get']({'plain':!![]});interaction_log['info'](_0x332c('0x69'),_0xd4ba6a['user']['id'],_0xd4ba6a[_0x332c('0x6a')][_0x332c('0x3b')],_0xd4ba6a[_0x332c('0x6a')]['role'],_0x49273a['interaction']['id'],_0xd4ba6a[_0x332c('0x5b')]?JSON['stringify'](_0xd4ba6a[_0x332c('0x5b')]):_0x332c('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x49273a);}return null;})[_0x332c('0x25')](function(_0x161a48){var _0x1f7412=_0x332c('0x6c')+_0x161a48[_0x332c('0x2e')][_0x332c('0x6d')];return db[_0x332c('0x6e')][_0x332c('0x44')](_0x1f7412,{'type':db[_0x332c('0x6f')]['QueryTypes'][_0x332c('0x70')],'raw':!![]})[_0x332c('0x25')](function(_0xb7ffae){return _0xb7ffae;});})[_0x332c('0x25')](function(_0x539ee7){if(_0x539ee7){_0x49273a[_0x332c('0x2e')][_0x332c('0x71')]=_0x539ee7[0x0];if(!_0xd4ba6a[_0x332c('0x5b')][_0x332c('0x62')])return;return db['User'][_0x332c('0x59')]({'where':{'id':_0xd4ba6a[_0x332c('0x5b')][_0x332c('0x62')],'role':_0x332c('0x63')},'attributes':['id','name',_0x332c('0x72'),_0x332c('0x73'),_0x332c('0x74')],'raw':!![]});}return null;})[_0x332c('0x25')](function(_0x231492){if(!_0x231492)return null;_0x49273a['message'][_0x332c('0x63')]=_0x231492;return _0x49273a;})[_0x332c('0x25')](function(_0x279962){if(_0x279962){if(_0xd4ba6a[_0x332c('0x5b')]['manual']){_0x49273a['message']['interface']=util[_0x332c('0x67')]('SIP/%s',_0xd4ba6a[_0x332c('0x6a')][_0x332c('0x3b')]);_0x49273a[_0x332c('0x2e')][_0x332c('0x75')]=_0x49273a[_0x332c('0x75')];_0x49273a['message'][_0x332c('0x76')]=_0x49273a[_0x332c('0x75')];_0x49273a[_0x332c('0x2e')][_0x332c('0x77')]=_0x332c('0x78');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x49273a[_0x332c('0x2e')]},client9002)['then'](function(){return _0x49273a;});}return _0x49273a;}return null;})[_0x332c('0x25')](respondWithResult(_0x3142f6,null))[_0x332c('0x2f')](handleError(_0x3142f6,null));};var interaction_log=require(_0x332c('0x18'))(_0x332c('0x5e'));exports['reject']=function(_0x2b0eba,_0xac8b72,_0x23a158){var _0x368920={'agent':{},'channel':_0x332c('0x5f')};if(_0x2b0eba[_0x332c('0x5b')]['id']){delete _0x2b0eba[_0x332c('0x5b')]['id'];}_0x2b0eba[_0x332c('0x5b')][_0x332c('0x62')]=_0x2b0eba[_0x332c('0x5b')][_0x332c('0x62')]||_0x2b0eba[_0x332c('0x6a')]['id'];_0x368920['agent']['id']=_0x2b0eba['body'][_0x332c('0x62')];return db['SmsMessage']['find']({'where':{'id':_0x2b0eba[_0x332c('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xac8b72,null))[_0x332c('0x25')](function(_0x1c471c){if(_0x1c471c){_0x368920[_0x332c('0x2e')]=_0x1c471c['get']({'plain':!![]});return db[_0x332c('0x64')][_0x332c('0x59')]({'where':{'id':_0x1c471c[_0x332c('0x79')]}});}return null;})[_0x332c('0x25')](handleEntityNotFound(_0xac8b72,null))['then'](function(_0x5a1b06){if(_0x5a1b06){_0x368920[_0x332c('0x7a')]=_0x5a1b06[_0x332c('0x7b')]({'plain':!![]});interaction_log[_0x332c('0x26')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2b0eba[_0x332c('0x6a')]['id'],_0x2b0eba['user'][_0x332c('0x3b')],_0x2b0eba[_0x332c('0x6a')][_0x332c('0x7c')],_0x368920[_0x332c('0x7a')]['id'],_0x2b0eba[_0x332c('0x5b')]?JSON['stringify'](_0x2b0eba[_0x332c('0x5b')]):_0x332c('0x6b'));return respondWithRpcPromise(_0x332c('0x7d'),_0x332c('0x7e'),_0x368920);}return null;})[_0x332c('0x25')](function(_0x280631){var _0x4a0327='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x280631[_0x332c('0x2e')][_0x332c('0x6d')];return db['sequelize']['query'](_0x4a0327,{'type':db[_0x332c('0x6f')][_0x332c('0x7f')]['SELECT'],'raw':!![]})[_0x332c('0x25')](function(_0x584652){return _0x584652;});})['then'](function(_0x287b55){if(_0x287b55){_0x368920[_0x332c('0x2e')][_0x332c('0x71')]=_0x287b55[0x0];if(!_0x2b0eba[_0x332c('0x5b')][_0x332c('0x62')])return;return db[_0x332c('0x80')][_0x332c('0x59')]({'where':{'id':_0x2b0eba[_0x332c('0x5b')][_0x332c('0x62')],'role':_0x332c('0x63')},'attributes':['id','name',_0x332c('0x72'),_0x332c('0x73'),_0x332c('0x74')],'raw':!![]});}return null;})[_0x332c('0x25')](function(_0x57a126){if(!_0x57a126)return null;_0x368920[_0x332c('0x2e')][_0x332c('0x63')]=_0x57a126;return _0x368920;})[_0x332c('0x25')](function(_0x305e02){if(_0x305e02){_0x305e02[_0x332c('0x2e')][_0x332c('0x81')]=util[_0x332c('0x67')]('SIP/%s',_0x2b0eba[_0x332c('0x6a')][_0x332c('0x3b')]);_0x305e02[_0x332c('0x2e')]['channel']=_0x368920[_0x332c('0x75')];_0x305e02[_0x332c('0x2e')][_0x332c('0x76')]=_0x368920[_0x332c('0x75')];_0x305e02['message'][_0x332c('0x77')]=_0x332c('0x82');respondWithRpcPromise(_0x332c('0x83'),_0x332c('0x83'),{'event':_0x332c('0x84'),'message':_0x305e02[_0x332c('0x2e')]},client9002);return _0x368920;}return null;})[_0x332c('0x25')](respondWithResult(_0xac8b72,null))[_0x332c('0x2f')](handleError(_0xac8b72,null));};exports[_0x332c('0x30')]=function(_0x323369,_0x5ca8a5,_0x31572b){if(_0x323369['body']['id']){delete _0x323369['body']['id'];}var _0x55fd0e;return db[_0x332c('0x3e')]['find']({'where':{'id':_0x323369[_0x332c('0x54')]['id']}})[_0x332c('0x25')](handleEntityNotFound(_0x5ca8a5,null))['then'](function(_0x360290){if(_0x360290){_0x55fd0e=_0x360290;return db[_0x332c('0x85')][_0x332c('0x59')]({'where':{'id':_0x360290[_0x332c('0x86')]}});}})[_0x332c('0x25')](handleEntityNotFound(_0x5ca8a5,null))[_0x332c('0x25')](function(_0x56bbe1){if(_0x56bbe1){logger[_0x332c('0x28')](_0x332c('0x29'),_0x332c('0x30'),'received\x20delivery\x20report\x20from',_0x56bbe1['type'],util[_0x332c('0x87')](_0x323369[_0x332c('0x5b')],{'showHidden':![],'depth':null}));switch(_0x56bbe1[_0x332c('0x41')]){case'twilio':if(_0x323369[_0x332c('0x5b')]['MessageSid']&&_0x323369['body'][_0x332c('0x88')]===_0x55fd0e[_0x332c('0x89')]){return _0x55fd0e['update']({'read':!![]});}else{logger['error'](_0x332c('0x8a'),'status',_0x332c('0x8b'),util[_0x332c('0x87')](_0x323369[_0x332c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x332c('0x8c'):if(_0x323369[_0x332c('0x5b')][_0x332c('0x8d')]&&_0x323369[_0x332c('0x5b')]['MessageUUID']===_0x55fd0e[_0x332c('0x89')]&&_[_0x332c('0x8e')]([_0x332c('0x8f'),_0x332c('0x90')],_0x323369[_0x332c('0x5b')]['Status'])>=0x0){return _0x55fd0e['update']({'read':!![]});}else{logger[_0x332c('0x2c')](_0x332c('0x8a'),_0x332c('0x30'),_0x332c('0x91'),util[_0x332c('0x87')](_0x323369['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x38f0c3=_0x323369[_0x332c('0x5b')][_0x332c('0x92')][0x0];if(_0x38f0c3[_0x332c('0x30')][_0x332c('0x93')]==='DELIVERED'){return _0x55fd0e[_0x332c('0x38')]({'read':!![]});}else{logger[_0x332c('0x2c')](_0x332c('0x8a'),_0x332c('0x30'),_0x332c('0x94'),util[_0x332c('0x87')](_0x323369[_0x332c('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x55fd0e;}})[_0x332c('0x25')](respondWithResult(_0x5ca8a5,null))[_0x332c('0x2f')](handleError(_0x5ca8a5,null));}; \ No newline at end of file +var _0x2905=['../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','destroy','stack','name','send','index','map','SmsMessage','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','rawAttributes','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','UserId','user','agent','SmsInteraction','SmsInteractionId','update','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','role','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','Sequelize','contact','fullname','email','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','delivered','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x93c7ff,_0x56aee2){var _0x5a2190=function(_0x3432cf){while(--_0x3432cf){_0x93c7ff['push'](_0x93c7ff['shift']());}};_0x5a2190(++_0x56aee2);}(_0x2905,0x19c));var _0x5290=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2905[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x5290('0x0'));var rimraf=require(_0x5290('0x1'));var zipdir=require(_0x5290('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5290('0x3'));var moment=require(_0x5290('0x4'));var BPromise=require(_0x5290('0x5'));var Mustache=require(_0x5290('0x6'));var util=require(_0x5290('0x7'));var path=require('path');var sox=require(_0x5290('0x8'));var csv=require(_0x5290('0x9'));var ejs=require(_0x5290('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5290('0xb'));var crypto=require(_0x5290('0xc'));var jsforce=require(_0x5290('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5290('0xe'));var Papa=require(_0x5290('0xf'));var Redis=require(_0x5290('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5290('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5290('0x12'))('api');var utils=require(_0x5290('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5290('0x14'));var db=require(_0x5290('0x15'))['db'];config[_0x5290('0x16')]=_[_0x5290('0x17')](config[_0x5290('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x5290('0x18'))(new Redis(config['redis']));require(_0x5290('0x19'))[_0x5290('0x1a')](socket);var jayson=require(_0x5290('0x1b'));var client=jayson[_0x5290('0x1c')][_0x5290('0x1d')]({'port':0x232c});var client9002=jayson[_0x5290('0x1c')][_0x5290('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xf12e41,_0xbdc67e,_0x51fb0b,_0x10da07){return new BPromise(function(_0x178a3b,_0x540588){var _0x1d6ac3=_0x10da07||client;return _0x1d6ac3[_0x5290('0x1e')](_0xf12e41,_0x51fb0b)[_0x5290('0x1f')](function(_0x1aae31){logger[_0x5290('0x20')](_0x5290('0x21'),_0xbdc67e,_0x5290('0x22'));logger[_0x5290('0x23')](_0x5290('0x24'),_0xbdc67e,_0x5290('0x22'),JSON['stringify'](_0x1aae31));if(_0x1aae31[_0x5290('0x25')]){if(_0x1aae31[_0x5290('0x25')]['code']===0x1f4){logger[_0x5290('0x25')](_0x5290('0x21'),_0xbdc67e,_0x1aae31['error'][_0x5290('0x26')]);return _0x540588(_0x1aae31[_0x5290('0x25')][_0x5290('0x26')]);}logger[_0x5290('0x25')](_0x5290('0x21'),_0xbdc67e,_0x1aae31['error']['message']);return _0x178a3b(_0x1aae31[_0x5290('0x25')]['message']);}else{logger[_0x5290('0x20')](_0x5290('0x21'),_0xbdc67e,_0x5290('0x22'));_0x178a3b(_0x1aae31['result'][_0x5290('0x26')]);}})[_0x5290('0x27')](function(_0x88ca7d){logger[_0x5290('0x25')](_0x5290('0x21'),_0xbdc67e,_0x88ca7d);_0x540588(_0x88ca7d);});});}function respondWithStatusCode(_0x22207c,_0x1380b5){_0x1380b5=_0x1380b5||0xcc;return function(_0x4c9132){if(_0x4c9132){return _0x22207c[_0x5290('0x28')](_0x1380b5);}return _0x22207c[_0x5290('0x29')](_0x1380b5)[_0x5290('0x2a')]();};}function respondWithResult(_0x2f2f4b,_0x5050c1){_0x5050c1=_0x5050c1||0xc8;return function(_0x2eb24e){if(_0x2eb24e){return _0x2f2f4b[_0x5290('0x29')](_0x5050c1)[_0x5290('0x2b')](_0x2eb24e);}};}function respondWithFilteredResult(_0x38f68b,_0x6df670){return function(_0x572b12){if(_0x572b12){var _0x3f50cd=typeof _0x6df670['offset']===_0x5290('0x2c')&&typeof _0x6df670['limit']===_0x5290('0x2c');var _0x30bbdf=_0x572b12[_0x5290('0x2d')];var _0xd5c4db=_0x3f50cd?0x0:_0x6df670[_0x5290('0x2e')];var _0x18d165=_0x3f50cd?_0x572b12['count']:_0x6df670[_0x5290('0x2e')]+_0x6df670[_0x5290('0x2f')];var _0x5aa032;if(_0x18d165>=_0x30bbdf){_0x18d165=_0x30bbdf;_0x5aa032=0xc8;}else{_0x5aa032=0xce;}_0x38f68b['status'](_0x5aa032);return _0x38f68b[_0x5290('0x30')](_0x5290('0x31'),_0xd5c4db+'-'+_0x18d165+'/'+_0x30bbdf)[_0x5290('0x2b')](_0x572b12);}return null;};}function patchUpdates(_0x50d248){return function(_0x464b2e){try{jsonpatch[_0x5290('0x32')](_0x464b2e,_0x50d248,!![]);}catch(_0x2edf56){return BPromise[_0x5290('0x33')](_0x2edf56);}return _0x464b2e['save']();};}function saveUpdates(_0x1861f9,_0x250e76){return function(_0x9fbab1){if(_0x9fbab1){return _0x9fbab1['update'](_0x1861f9)[_0x5290('0x1f')](function(_0x13a128){return _0x13a128;});}return null;};}function removeEntity(_0x4a9587,_0x4db081){return function(_0x1c4a16){if(_0x1c4a16){return _0x1c4a16[_0x5290('0x34')]()[_0x5290('0x1f')](function(){_0x4a9587[_0x5290('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x101196,_0x574abf){return function(_0x4d5fb9){if(!_0x4d5fb9){_0x101196[_0x5290('0x28')](0x194);}return _0x4d5fb9;};}function handleError(_0x3effed,_0xc4cbe6){_0xc4cbe6=_0xc4cbe6||0x1f4;return function(_0x3023e2){logger['error'](_0x3023e2[_0x5290('0x35')]);if(_0x3023e2['name']){delete _0x3023e2[_0x5290('0x36')];}_0x3effed['status'](_0xc4cbe6)[_0x5290('0x37')](_0x3023e2);};}exports[_0x5290('0x38')]=function(_0x473eee,_0x17e049){var _0x23a6ed={},_0xccebde={},_0x1d88df={'count':0x0,'rows':[]};var _0x2857ff=_[_0x5290('0x39')](db[_0x5290('0x3a')]['rawAttributes'],function(_0x32fb5a){return{'name':_0x32fb5a[_0x5290('0x3b')],'type':_0x32fb5a[_0x5290('0x3c')]['key']};});_0xccebde[_0x5290('0x3d')]=_[_0x5290('0x39')](_0x2857ff,_0x5290('0x36'));_0xccebde[_0x5290('0x3e')]=_[_0x5290('0x3f')](_0x473eee[_0x5290('0x3e')]);_0xccebde[_0x5290('0x40')]=_[_0x5290('0x41')](_0xccebde[_0x5290('0x3d')],_0xccebde[_0x5290('0x3e')]);_0x23a6ed[_0x5290('0x42')]=_['intersection'](_0xccebde[_0x5290('0x3d')],qs[_0x5290('0x43')](_0x473eee[_0x5290('0x3e')][_0x5290('0x43')]));_0x23a6ed[_0x5290('0x42')]=_0x23a6ed[_0x5290('0x42')][_0x5290('0x44')]?_0x23a6ed[_0x5290('0x42')]:_0xccebde[_0x5290('0x3d')];if(!_0x473eee[_0x5290('0x3e')][_0x5290('0x45')]('nolimit')){_0x23a6ed[_0x5290('0x2f')]=qs[_0x5290('0x2f')](_0x473eee[_0x5290('0x3e')]['limit']);_0x23a6ed[_0x5290('0x2e')]=qs['offset'](_0x473eee[_0x5290('0x3e')][_0x5290('0x2e')]);}_0x23a6ed[_0x5290('0x46')]=qs[_0x5290('0x47')](_0x473eee[_0x5290('0x3e')][_0x5290('0x47')]);_0x23a6ed[_0x5290('0x48')]=qs['filters'](_[_0x5290('0x49')](_0x473eee['query'],_0xccebde[_0x5290('0x40')]),_0x2857ff);if(_0x473eee['query']['filter']){_0x23a6ed[_0x5290('0x48')]=_[_0x5290('0x4a')](_0x23a6ed[_0x5290('0x48')],{'$or':_[_0x5290('0x39')](_0x2857ff,function(_0x43b6b7){if(_0x43b6b7[_0x5290('0x3c')]!==_0x5290('0x4b')){var _0x460452={};_0x460452[_0x43b6b7[_0x5290('0x36')]]={'$like':'%'+_0x473eee['query'][_0x5290('0x4c')]+'%'};return _0x460452;}})});}_0x23a6ed=_[_0x5290('0x4a')]({},_0x23a6ed,_0x473eee[_0x5290('0x4d')]);var _0x584381={'where':_0x23a6ed[_0x5290('0x48')]};return db[_0x5290('0x3a')][_0x5290('0x2d')](_0x584381)[_0x5290('0x1f')](function(_0x27d99d){_0x1d88df[_0x5290('0x2d')]=_0x27d99d;if(_0x473eee[_0x5290('0x3e')][_0x5290('0x4e')]){_0x23a6ed[_0x5290('0x4f')]=[{'all':!![]}];}return db[_0x5290('0x3a')][_0x5290('0x50')](_0x23a6ed);})['then'](function(_0x25fdfb){_0x1d88df['rows']=_0x25fdfb;return _0x1d88df;})[_0x5290('0x1f')](respondWithFilteredResult(_0x17e049,_0x23a6ed))[_0x5290('0x27')](handleError(_0x17e049,null));};exports[_0x5290('0x51')]=function(_0x517b6c,_0x4a5e81){var _0x5d7916={'raw':!![],'where':{'id':_0x517b6c[_0x5290('0x52')]['id']}},_0x4bc660={};_0x4bc660[_0x5290('0x3d')]=_[_0x5290('0x3f')](db['SmsMessage'][_0x5290('0x53')]);_0x4bc660['query']=_[_0x5290('0x3f')](_0x517b6c[_0x5290('0x3e')]);_0x4bc660['filters']=_[_0x5290('0x41')](_0x4bc660[_0x5290('0x3d')],_0x4bc660[_0x5290('0x3e')]);_0x5d7916['attributes']=_[_0x5290('0x41')](_0x4bc660[_0x5290('0x3d')],qs[_0x5290('0x43')](_0x517b6c[_0x5290('0x3e')][_0x5290('0x43')]));_0x5d7916[_0x5290('0x42')]=_0x5d7916[_0x5290('0x42')][_0x5290('0x44')]?_0x5d7916[_0x5290('0x42')]:_0x4bc660['model'];if(_0x517b6c[_0x5290('0x3e')]['includeAll']){_0x5d7916[_0x5290('0x4f')]=[{'all':!![]}];}_0x5d7916=_[_0x5290('0x4a')]({},_0x5d7916,_0x517b6c[_0x5290('0x4d')]);return db[_0x5290('0x3a')][_0x5290('0x54')](_0x5d7916)[_0x5290('0x1f')](handleEntityNotFound(_0x4a5e81,null))[_0x5290('0x1f')](respondWithResult(_0x4a5e81,null))[_0x5290('0x27')](handleError(_0x4a5e81,null));};exports[_0x5290('0x55')]=function(_0x2e1347,_0x219e52){return db['SmsMessage'][_0x5290('0x55')](_0x2e1347[_0x5290('0x56')],{})[_0x5290('0x1f')](respondWithResult(_0x219e52,0xc9))[_0x5290('0x27')](handleError(_0x219e52,null));};exports['update']=function(_0x2f0020,_0x40b18f){if(_0x2f0020[_0x5290('0x56')]['id']){delete _0x2f0020['body']['id'];}return db[_0x5290('0x3a')][_0x5290('0x54')]({'where':{'id':_0x2f0020[_0x5290('0x52')]['id']}})[_0x5290('0x1f')](handleEntityNotFound(_0x40b18f,null))[_0x5290('0x1f')](saveUpdates(_0x2f0020['body'],null))[_0x5290('0x1f')](respondWithResult(_0x40b18f,null))[_0x5290('0x27')](handleError(_0x40b18f,null));};exports['destroy']=function(_0x2f0351,_0x2b79a3){return db[_0x5290('0x3a')][_0x5290('0x54')]({'where':{'id':_0x2f0351[_0x5290('0x52')]['id']}})[_0x5290('0x1f')](handleEntityNotFound(_0x2b79a3,null))[_0x5290('0x1f')](removeEntity(_0x2b79a3,null))[_0x5290('0x27')](handleError(_0x2b79a3,null));};exports[_0x5290('0x57')]=function(_0x1c204c,_0x310930){return db[_0x5290('0x3a')][_0x5290('0x57')]()[_0x5290('0x1f')](respondWithResult(_0x310930,null))[_0x5290('0x27')](handleError(_0x310930,null));};var interaction_log=require(_0x5290('0x12'))(_0x5290('0x58'));exports[_0x5290('0x59')]=function(_0x4ab758,_0xa0483b,_0x1ae783){var _0x326771={'agent':{},'channel':_0x5290('0x5a')};if(_0x4ab758[_0x5290('0x56')]['id']){delete _0x4ab758[_0x5290('0x56')]['id'];}_0x4ab758[_0x5290('0x56')][_0x5290('0x5b')]=!![];_0x4ab758[_0x5290('0x56')][_0x5290('0x5c')]=moment()[_0x5290('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x4ab758['body'][_0x5290('0x5e')]=_0x4ab758[_0x5290('0x56')][_0x5290('0x5e')]||_0x4ab758[_0x5290('0x5f')]['id'];_0x326771[_0x5290('0x60')]['id']=_0x4ab758[_0x5290('0x56')][_0x5290('0x5e')];return db['SmsMessage']['find']({'where':{'id':_0x4ab758[_0x5290('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xa0483b,null))[_0x5290('0x1f')](saveUpdates(_0x4ab758[_0x5290('0x56')],null))[_0x5290('0x1f')](function(_0x3e9bc3){if(_0x3e9bc3){_0x326771['message']=_0x3e9bc3['get']({'plain':!![]});return db[_0x5290('0x61')][_0x5290('0x54')]({'where':{'id':_0x3e9bc3[_0x5290('0x62')]}});}return null;})[_0x5290('0x1f')](handleEntityNotFound(_0xa0483b,null))['then'](function(_0x1a70f3){if(_0x1a70f3){return _0x1a70f3[_0x5290('0x63')]({'UserId':_0x4ab758['body']['UserId'],'read1stAt':_[_0x5290('0x64')](_0x1a70f3['read1stAt'])?moment()[_0x5290('0x5d')](_0x5290('0x65')):undefined});}return null;})['then'](function(_0x3abeb6){if(_0x3abeb6){_0x326771[_0x5290('0x66')]=_0x3abeb6[_0x5290('0x67')]({'plain':!![]});interaction_log[_0x5290('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ab758[_0x5290('0x5f')]['id'],_0x4ab758[_0x5290('0x5f')][_0x5290('0x36')],_0x4ab758[_0x5290('0x5f')][_0x5290('0x68')],_0x326771[_0x5290('0x66')]['id'],_0x4ab758[_0x5290('0x56')]?JSON[_0x5290('0x69')](_0x4ab758[_0x5290('0x56')]):_0x5290('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x5290('0x6b'),_0x326771);}return null;})['then'](function(_0x5e13d7){var _0x1bf9ea=_0x5290('0x6c')+_0x5e13d7['message'][_0x5290('0x6d')];return db[_0x5290('0x6e')][_0x5290('0x3e')](_0x1bf9ea,{'type':db['Sequelize'][_0x5290('0x6f')][_0x5290('0x70')],'raw':!![]})[_0x5290('0x1f')](function(_0x3ec17e){return _0x3ec17e;});})[_0x5290('0x1f')](function(_0x9e2d37){if(_0x9e2d37){_0x326771['message']['contact']=_0x9e2d37[0x0];if(!_0x4ab758[_0x5290('0x56')][_0x5290('0x5e')])return;return db[_0x5290('0x71')][_0x5290('0x54')]({'where':{'id':_0x4ab758[_0x5290('0x56')][_0x5290('0x5e')],'role':_0x5290('0x60')},'attributes':['id',_0x5290('0x36'),'fullname','email',_0x5290('0x72')],'raw':!![]});}return null;})[_0x5290('0x1f')](function(_0x1d02d9){if(!_0x1d02d9)return null;_0x326771[_0x5290('0x26')][_0x5290('0x60')]=_0x1d02d9;return _0x326771;})['then'](function(_0x3c2991){if(_0x3c2991){if(_0x4ab758[_0x5290('0x56')][_0x5290('0x73')]){_0x326771[_0x5290('0x26')][_0x5290('0x74')]=util[_0x5290('0x5d')](_0x5290('0x75'),_0x4ab758[_0x5290('0x5f')][_0x5290('0x36')]);_0x326771[_0x5290('0x26')]['channel']=_0x326771[_0x5290('0x76')];_0x326771['message'][_0x5290('0x77')]=_0x326771['channel'];_0x326771[_0x5290('0x26')][_0x5290('0x78')]=_0x5290('0x59');return respondWithRpcPromise(_0x5290('0x79'),'EventManager',{'event':_0x5290('0x7a'),'message':_0x326771[_0x5290('0x26')]},client9002)[_0x5290('0x1f')](function(){return _0x326771;});}return _0x326771;}return null;})['then'](respondWithResult(_0xa0483b,null))[_0x5290('0x27')](handleError(_0xa0483b,null));};var interaction_log=require(_0x5290('0x12'))(_0x5290('0x58'));exports[_0x5290('0x33')]=function(_0x56ad79,_0x136fe9,_0x23254e){var _0x5a5ea7={'agent':{},'channel':_0x5290('0x5a')};if(_0x56ad79['body']['id']){delete _0x56ad79[_0x5290('0x56')]['id'];}_0x56ad79[_0x5290('0x56')][_0x5290('0x5e')]=_0x56ad79[_0x5290('0x56')][_0x5290('0x5e')]||_0x56ad79['user']['id'];_0x5a5ea7[_0x5290('0x60')]['id']=_0x56ad79['body'][_0x5290('0x5e')];return db[_0x5290('0x3a')][_0x5290('0x54')]({'where':{'id':_0x56ad79[_0x5290('0x52')]['id'],'UserId':null}})[_0x5290('0x1f')](handleEntityNotFound(_0x136fe9,null))[_0x5290('0x1f')](function(_0x5cd2fd){if(_0x5cd2fd){_0x5a5ea7[_0x5290('0x26')]=_0x5cd2fd[_0x5290('0x67')]({'plain':!![]});return db['SmsInteraction'][_0x5290('0x54')]({'where':{'id':_0x5cd2fd[_0x5290('0x62')]}});}return null;})[_0x5290('0x1f')](handleEntityNotFound(_0x136fe9,null))[_0x5290('0x1f')](function(_0x2c2be7){if(_0x2c2be7){_0x5a5ea7[_0x5290('0x66')]=_0x2c2be7[_0x5290('0x67')]({'plain':!![]});interaction_log[_0x5290('0x20')](_0x5290('0x7b'),_0x56ad79[_0x5290('0x5f')]['id'],_0x56ad79['user'][_0x5290('0x36')],_0x56ad79['user'][_0x5290('0x68')],_0x5a5ea7['interaction']['id'],_0x56ad79[_0x5290('0x56')]?JSON[_0x5290('0x69')](_0x56ad79[_0x5290('0x56')]):_0x5290('0x6a'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5a5ea7);}return null;})['then'](function(_0x4f31ea){var _0x4b45ce=_0x5290('0x6c')+_0x4f31ea[_0x5290('0x26')][_0x5290('0x6d')];return db[_0x5290('0x6e')][_0x5290('0x3e')](_0x4b45ce,{'type':db[_0x5290('0x7c')]['QueryTypes'][_0x5290('0x70')],'raw':!![]})['then'](function(_0xd4d37a){return _0xd4d37a;});})[_0x5290('0x1f')](function(_0x3d1236){if(_0x3d1236){_0x5a5ea7[_0x5290('0x26')][_0x5290('0x7d')]=_0x3d1236[0x0];if(!_0x56ad79[_0x5290('0x56')][_0x5290('0x5e')])return;return db[_0x5290('0x71')]['find']({'where':{'id':_0x56ad79[_0x5290('0x56')]['UserId'],'role':_0x5290('0x60')},'attributes':['id','name',_0x5290('0x7e'),_0x5290('0x7f'),_0x5290('0x72')],'raw':!![]});}return null;})[_0x5290('0x1f')](function(_0x2ed40b){if(!_0x2ed40b)return null;_0x5a5ea7[_0x5290('0x26')][_0x5290('0x60')]=_0x2ed40b;return _0x5a5ea7;})['then'](function(_0x563431){if(_0x563431){_0x563431[_0x5290('0x26')]['interface']=util['format']('SIP/%s',_0x56ad79['user']['name']);_0x563431['message'][_0x5290('0x76')]=_0x5a5ea7[_0x5290('0x76')];_0x563431[_0x5290('0x26')][_0x5290('0x77')]=_0x5a5ea7[_0x5290('0x76')];_0x563431[_0x5290('0x26')][_0x5290('0x78')]=_0x5290('0x33');respondWithRpcPromise(_0x5290('0x79'),_0x5290('0x79'),{'event':_0x5290('0x80'),'message':_0x563431[_0x5290('0x26')]},client9002);return _0x5a5ea7;}return null;})['then'](respondWithResult(_0x136fe9,null))[_0x5290('0x27')](handleError(_0x136fe9,null));};exports[_0x5290('0x29')]=function(_0x15b9a8,_0x614bce,_0x4c690f){if(_0x15b9a8['body']['id']){delete _0x15b9a8[_0x5290('0x56')]['id'];}var _0xf5330c;return db['SmsMessage']['find']({'where':{'id':_0x15b9a8[_0x5290('0x52')]['id']}})[_0x5290('0x1f')](handleEntityNotFound(_0x614bce,null))[_0x5290('0x1f')](function(_0x2a1fbd){if(_0x2a1fbd){_0xf5330c=_0x2a1fbd;return db[_0x5290('0x81')]['find']({'where':{'id':_0x2a1fbd[_0x5290('0x82')]}});}})[_0x5290('0x1f')](handleEntityNotFound(_0x614bce,null))[_0x5290('0x1f')](function(_0x4faca4){if(_0x4faca4){logger[_0x5290('0x23')](_0x5290('0x24'),_0x5290('0x29'),_0x5290('0x83'),_0x4faca4['type'],util[_0x5290('0x84')](_0x15b9a8[_0x5290('0x56')],{'showHidden':![],'depth':null}));switch(_0x4faca4[_0x5290('0x3c')]){case _0x5290('0x85'):if(_0x15b9a8['body'][_0x5290('0x86')]&&_0x15b9a8[_0x5290('0x56')][_0x5290('0x86')]===_0xf5330c[_0x5290('0x87')]){return _0xf5330c['update']({'read':!![]});}else{logger[_0x5290('0x25')](_0x5290('0x88'),_0x5290('0x29'),_0x5290('0x85'),util[_0x5290('0x84')](_0x15b9a8[_0x5290('0x56')],{'showHidden':![],'depth':null}));}break;case _0x5290('0x89'):if(_0x15b9a8[_0x5290('0x56')]['MessageUUID']&&_0x15b9a8[_0x5290('0x56')][_0x5290('0x8a')]===_0xf5330c[_0x5290('0x87')]&&_['indexOf'](['sent',_0x5290('0x8b')],_0x15b9a8[_0x5290('0x56')]['Status'])>=0x0){return _0xf5330c[_0x5290('0x63')]({'read':!![]});}else{logger[_0x5290('0x25')](_0x5290('0x88'),'status','plivio',util[_0x5290('0x84')](_0x15b9a8[_0x5290('0x56')],{'showHidden':![],'depth':null}));}break;case _0x5290('0x8c'):var _0xd926e0=_0x15b9a8[_0x5290('0x56')][_0x5290('0x8d')][0x0];if(_0xd926e0[_0x5290('0x29')]['groupName']===_0x5290('0x8e')){return _0xf5330c[_0x5290('0x63')]({'read':!![]});}else{logger[_0x5290('0x25')](_0x5290('0x88'),_0x5290('0x29'),_0x5290('0x8c'),util[_0x5290('0x84')](_0x15b9a8[_0x5290('0x56')],{'showHidden':![],'depth':null}));}break;}return _0xf5330c;}})['then'](respondWithResult(_0x614bce,null))[_0x5290('0x27')](handleError(_0x614bce,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 526a1c9..77dcd2a 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 _0x043b=['hook','exports','../../mysqldb','setMaxListeners','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x043b,0xb0));var _0xb043=function(_0x246e35,_0x586dff){_0x246e35=_0x246e35-0x0;var _0x4895ef=_0x043b[_0x246e35];return _0x4895ef;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xb043('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xb043('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb043('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3abf2f){return function(_0x58efa1,_0x582302,_0x237b58){SmsMessageEvents['emit'](_0x3abf2f+':'+_0x58efa1['id'],_0x58efa1);SmsMessageEvents[_0xb043('0x3')](_0x3abf2f,_0x58efa1);_0x237b58(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xb043('0x4')](e,emitEvent(event));}}module[_0xb043('0x5')]=SmsMessageEvents; \ No newline at end of file +var _0xba37=['save','remove','emit','exports','events'];(function(_0x4a05ec,_0x719db){var _0x1b2d1e=function(_0xaf5d72){while(--_0xaf5d72){_0x4a05ec['push'](_0x4a05ec['shift']());}};_0x1b2d1e(++_0x719db);}(_0xba37,0x158));var _0x7ba3=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xba37[_0x1b6186];return _0x186121;};'use strict';var EventEmitter=require(_0x7ba3('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7ba3('0x1'),'afterUpdate':'update','afterDestroy':_0x7ba3('0x2')};function emitEvent(_0x420aa3){return function(_0x1927b1,_0x1c1ddc,_0x340014){SmsMessageEvents[_0x7ba3('0x3')](_0x420aa3+':'+_0x1927b1['id'],_0x1927b1);SmsMessageEvents[_0x7ba3('0x3')](_0x420aa3,_0x1927b1);_0x340014(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x7ba3('0x4')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 328eefe..5369885 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 _0x7c62=['applicationId','Basic\x20%s','bandwidth','intelepeer','Bearer\x20','code','message','refid','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','api','moment','request-promise','../../config/environment','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','update','createdAt','catch','SmsAccount','SmsAccountId','then','type','twilio','accountSid','phone','authToken','create','remote','/status?token=','token','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','toString','base64','http_code','data','messages','message_id','clickSend','plivo','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','keys','sort','length','md5','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages'];(function(_0x39c12e,_0x265488){var _0x2f0a8c=function(_0x29e3cb){while(--_0x29e3cb){_0x39c12e['push'](_0x39c12e['shift']());}};_0x2f0a8c(++_0x265488);}(_0x7c62,0xf5));var _0x27c6=function(_0x20f23d,_0x52e944){_0x20f23d=_0x20f23d-0x0;var _0x3415c4=_0x7c62[_0x20f23d];return _0x3415c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x27c6('0x0'));var moment=require(_0x27c6('0x1'));var BPromise=require('bluebird');var rp=require(_0x27c6('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x27c6('0x3'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x350b02,_0x7d4a4){return _0x350b02['define'](_0x27c6('0x4'),attributes,{'tableName':_0x27c6('0x5'),'paranoid':![],'indexes':[{'name':_0x27c6('0x6'),'fields':[_0x27c6('0x6')]},{'name':'fti_sms_messages','fields':[_0x27c6('0x7')],'type':_0x27c6('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39e543,_0x12b275,_0x372679){var _0x2106bb=_0x350b02[_0x27c6('0x9')];var _0x382df6=_0x39e543['get']({'plain':!![]});if(_0x382df6[_0x27c6('0xa')][_0x27c6('0xb')]()==='in'||_0x382df6[_0x27c6('0xa')][_0x27c6('0xb')]()===_0x27c6('0xc')&&!_0x382df6[_0x27c6('0xd')]&&!_[_0x27c6('0xe')](_0x382df6[_0x27c6('0xf')])&&!_[_0x27c6('0xe')](_0x382df6[_0x27c6('0x10')])){_0x2106bb[_0x27c6('0x11')]['findOne']({'where':{'id':_0x382df6['SmsInteractionId']}})['then'](function(_0xeb2e43){if(_0xeb2e43){_0xeb2e43[_0x27c6('0x12')]({'lastMsgAt':_0x382df6[_0x27c6('0x13')],'lastMsgDirection':_0x382df6['direction'][_0x27c6('0xb')]()});}})[_0x27c6('0x14')](function(_0x3b9ebc){console['error'](_0x3b9ebc);});}if(_0x382df6[_0x27c6('0xa')]===_0x27c6('0xc')&&!_0x382df6[_0x27c6('0xd')]){var _0x53fba;_0x2106bb[_0x27c6('0x15')]['find']({'where':{'id':_0x382df6[_0x27c6('0x16')]},'raw':!![]})[_0x27c6('0x17')](function(_0x17dc70){_0x53fba=_0x17dc70;if(_0x53fba&&_0x53fba['type']){switch(_0x53fba[_0x27c6('0x18')]){case _0x27c6('0x19'):var _0x4dd299=require(_0x27c6('0x19'));if(_0x53fba[_0x27c6('0x1a')]&&_0x53fba['authToken']&&_0x53fba[_0x27c6('0x1b')]){var _0x14b26e=new _0x4dd299(_0x53fba[_0x27c6('0x1a')],_0x53fba[_0x27c6('0x1c')]);_0x14b26e['messages'][_0x27c6('0x1d')]({'body':_0x382df6['body'],'to':_0x382df6[_0x27c6('0x1b')],'from':_0x53fba[_0x27c6('0x1b')],'statusCallback':_0x53fba[_0x27c6('0x1e')]+'/api/sms/messages/'+_0x382df6['id']+_0x27c6('0x1f')+_0x53fba[_0x27c6('0x20')]})[_0x27c6('0x17')](function(_0x3ac9f1){if(_0x3ac9f1['sid']){return _0x39e543[_0x27c6('0x12')]({'messageId':_0x3ac9f1['sid']});}})[_0x27c6('0x14')](function(_0x3fcae1){logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x19'),util[_0x27c6('0x24')](_0x3fcae1,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27c6('0x23'),'twilio',_0x27c6('0x25'));}break;case _0x27c6('0x26'):var _0x120220=_0x27c6('0x27');if(_0x53fba[_0x27c6('0x28')]&&_0x53fba[_0x27c6('0x29')]){var _0xcba358={'recipient':[_0x382df6['phone']],'message':_0x382df6[_0x27c6('0x7')],'message_type':_0x53fba[_0x27c6('0x2a')]};if(_0x53fba[_0x27c6('0x2a')]&&_0x53fba[_0x27c6('0x2a')]!=='SI'){_0xcba358[_0x27c6('0x2b')]=_0x53fba['phone'];}var _0x3062ff={'url':_0x120220+_0x27c6('0x2c')+_0x53fba[_0x27c6('0x28')]+_0x27c6('0x2d')+_0x53fba[_0x27c6('0x29')],'method':'GET'};rp(_0x3062ff)[_0x27c6('0x17')](function(_0xa4deea){var _0x4e1e0c=_0xa4deea[_0x27c6('0x2e')](';');var _0x2567ce={'user_key':_0x4e1e0c[0x0],'session_key':_0x4e1e0c[0x1]};_0x3062ff={'url':_0x120220+_0x27c6('0x2f'),'method':_0x27c6('0x30'),'headers':{'user_key':_0x2567ce[_0x27c6('0x31')],'Session_key':_0x2567ce[_0x27c6('0x32')]},'json':!![],'body':_0xcba358};return rp(_0x3062ff);})[_0x27c6('0x17')](function(_0xb1ef77){if(_0xb1ef77[_0x27c6('0x33')]>=0x1){var _0x5413ad={'messageId':_0xb1ef77[_0x27c6('0x34')]};if(_0x53fba['smsMethod']!=='GP'||!_0x53fba[_0x27c6('0x35')]){_0x5413ad[_0x27c6('0x36')]=!![];}return _0x39e543[_0x27c6('0x12')](_0x5413ad);}else{return logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),'skebby',util[_0x27c6('0x24')](_0xb1ef77,{'showHidden':![],'depth':null}));}})[_0x27c6('0x14')](function(_0x23e964){return logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate',_0x27c6('0x26'),util[_0x27c6('0x24')](_0x23e964,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x27c6('0x22'),'afterCreate',_0x27c6('0x26'),_0x27c6('0x37'));}break;case _0x27c6('0x38'):if(_0x53fba[_0x27c6('0x1c')]){var _0x12d9cb={'recipient':_0x382df6['phone'],'message':_0x382df6['body'],'sender':_0x53fba['senderString']||_0x53fba[_0x27c6('0x1b')],'authorization':_0x53fba['authToken']};var _0x12b275={'method':_0x27c6('0x30'),'uri':_0x27c6('0x39'),'body':_0x12d9cb,'json':!![]};rp(_0x12b275)[_0x27c6('0x17')](function(_0x515bd9){var _0x162775={'messageId':_0x515bd9[_0x27c6('0x3a')]};if(!_0x53fba[_0x27c6('0x35')]){_0x162775['read']=!![];}return _0x39e543[_0x27c6('0x12')](_0x162775);})[_0x27c6('0x14')](function(_0x56867d){logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x38'),util[_0x27c6('0x24')](_0x56867d,{'showHidden':![],'depth':null}));});}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x38'),_0x27c6('0x3b'));}break;case _0x27c6('0x3c'):if(_0x53fba[_0x27c6('0x28')]&&_0x53fba['password']){var _0x12d9cb={'messages':[{'source':_0x27c6('0x3d'),'to':_0x382df6[_0x27c6('0x1b')],'body':_0x382df6[_0x27c6('0x7')],'from':_0x53fba[_0x27c6('0x3e')]||_0x53fba[_0x27c6('0x1b')]}]};var _0x185642=util[_0x27c6('0x3f')](_0x27c6('0x40'),_0x53fba[_0x27c6('0x28')],_0x53fba['password']);var _0x12b275={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x12d9cb,'headers':{'Authorization':util[_0x27c6('0x3f')]('Basic\x20%s',new Buffer(_0x185642)[_0x27c6('0x41')](_0x27c6('0x42')))},'json':!![]};rp(_0x12b275)['then'](function(_0x2a6d02){if(_0x2a6d02['http_code']>=0xc8&&_0x2a6d02[_0x27c6('0x43')]<=0xce){if(_0x2a6d02[_0x27c6('0x44')]&&_0x2a6d02[_0x27c6('0x44')]['queued_count']>0x0){var _0x1dae9d=_['head'](_0x2a6d02[_0x27c6('0x44')][_0x27c6('0x45')]);var _0x7a9c22={'messageId':_0x1dae9d[_0x27c6('0x46')]};if(!_0x53fba[_0x27c6('0x35')]){_0x7a9c22[_0x27c6('0x36')]=!![];}return _0x39e543[_0x27c6('0x12')](_0x7a9c22);}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x47'),util[_0x27c6('0x24')](_0x2a6d02,{'showHidden':![],'depth':null}));}}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x47'),util[_0x27c6('0x24')](_0x2a6d02,{'showHidden':![],'depth':null}));}})[_0x27c6('0x14')](function(_0x370a1e){logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x47'),util[_0x27c6('0x24')](_0x370a1e,{'showHidden':![],'depth':null}));});}else{logger[_0x27c6('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27c6('0x23'),_0x27c6('0x47'),_0x27c6('0x37'));}break;case _0x27c6('0x48'):if(_0x53fba[_0x27c6('0x49')]&&_0x53fba[_0x27c6('0x1c')]){var _0x12d9cb={'dst':_0x382df6['phone'],'text':_0x382df6['body'],'src':_0x53fba['senderString']||_0x53fba[_0x27c6('0x1b')],'url':_0x53fba[_0x27c6('0x1e')]+_0x27c6('0x4a')+_0x382df6['id']+_0x27c6('0x1f')+_0x53fba[_0x27c6('0x20')]};var _0x185642=util[_0x27c6('0x3f')](_0x27c6('0x40'),_0x53fba[_0x27c6('0x49')],_0x53fba[_0x27c6('0x1c')]);var _0x12b275={'method':_0x27c6('0x30'),'uri':util['format'](_0x27c6('0x4b'),_0x53fba[_0x27c6('0x49')]),'body':_0x12d9cb,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x185642)['toString'](_0x27c6('0x42')))},'json':!![]};rp(_0x12b275)['then'](function(_0xc11cec){var _0x473ea9={'messageId':_0xc11cec[_0x27c6('0x4c')][0x0]};return _0x39e543[_0x27c6('0x12')](_0x473ea9);})[_0x27c6('0x14')](function(_0x5c007d){logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate','plivo',util[_0x27c6('0x24')](_0x5c007d,{'showHidden':![],'depth':null}));});}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate','plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x27c6('0x4d'):if(_0x53fba[_0x27c6('0x28')]&&_0x53fba[_0x27c6('0x29')]){if(_0x53fba['baseUrl']){var _0x5d4e61={'method':_0x27c6('0x30'),'uri':_0x53fba[_0x27c6('0x4e')]+_0x27c6('0x4f'),'body':{'username':_0x53fba[_0x27c6('0x28')],'password':_0x53fba[_0x27c6('0x29')]},'json':!![]};return rp(_0x5d4e61)['then'](function(_0x238bf7){var _0x3c39b1={'method':_0x27c6('0x30'),'uri':_0x53fba['baseUrl']+_0x27c6('0x50'),'body':{'messages':[{'from':_0x53fba[_0x27c6('0x1b')],'destinations':[{'to':_0x382df6[_0x27c6('0x1b')]}],'text':_0x382df6['body'],'notifyUrl':_0x53fba[_0x27c6('0x1e')]+'/api/sms/messages/'+_0x382df6['id']+'/status?token='+_0x53fba['token'],'notifyContentType':_0x27c6('0x51'),'callbackData':_0x53fba['phone']+';'+_0x382df6[_0x27c6('0x7')]}]},'headers':{'Authorization':_0x27c6('0x52')+_0x238bf7[_0x27c6('0x20')]},'json':!![]};return rp(_0x3c39b1)[_0x27c6('0x17')](function(_0x4b4649){if(_0x4b4649[_0x27c6('0x45')]){var _0x50d7f3={'messageId':_0x4b4649['messages'][0x0][_0x27c6('0x6')]};if(!_0x53fba['deliveryReport']){_0x50d7f3[_0x27c6('0x36')]=!![];}return _0x39e543[_0x27c6('0x12')](_0x50d7f3);}else{return logger['error'](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x4d'),util[_0x27c6('0x24')](_0x4b4649,{'showHidden':![],'depth':null}));}});})[_0x27c6('0x14')](function(_0x2e3b79){return logger['error'](_0x27c6('0x22'),'afterCreate',_0x27c6('0x4d'),util[_0x27c6('0x24')](_0x2e3b79,{'showHidden':![],'depth':null}));});}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate','infobip',_0x27c6('0x53'));}}else{logger[_0x27c6('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27c6('0x23'),_0x27c6('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x27c6('0x54'):var _0x33511d=require(_0x27c6('0x55'));if(_0x53fba[_0x27c6('0x56')]){var _0x1e5fd4={};_0x1e5fd4['login']=_0x53fba[_0x27c6('0x28')];_0x1e5fd4[_0x27c6('0x1b')]=_0x382df6[_0x27c6('0x1b')];_0x1e5fd4[_0x27c6('0x2b')]=_0x53fba['phone'];_0x1e5fd4[_0x27c6('0x57')]=_0x382df6[_0x27c6('0x7')];_0x1e5fd4[_0x27c6('0x58')]=+new Date();var _0x1323bf='';var _0x53dd87='';var _0x24b93c=Object[_0x27c6('0x59')](_0x1e5fd4);_0x24b93c[_0x27c6('0x5a')]();for(var _0x46b633=0x0;_0x46b633<_0x24b93c[_0x27c6('0x5b')];_0x46b633++){if(_0x1323bf!=''){_0x1323bf+='&';}_0x1323bf+=_0x24b93c[_0x46b633]+'='+encodeURIComponent(_0x1e5fd4[_0x24b93c[_0x46b633]]);_0x53dd87+=_0x1e5fd4[_0x24b93c[_0x46b633]];}_0x53dd87+=_0x53fba[_0x27c6('0x56')];_0x53dd87=_0x33511d['createHash'](_0x27c6('0x5c'))['update'](_0x53dd87)['digest'](_0x27c6('0x5d'));if(_0x1323bf!==''){_0x1323bf+='&';}_0x1323bf+=_0x27c6('0x5e')+_0x53dd87;var _0x3062ff={'method':_0x27c6('0x5f'),'uri':_0x53fba[_0x27c6('0x4e')]+_0x27c6('0x60')+_0x1323bf,'json':!![]};return rp(_0x3062ff)[_0x27c6('0x17')](function(_0x265e01){var _0x3b419f=Object[_0x27c6('0x59')](_0x265e01);if(_0x265e01[_0x3b419f[0x0]][_0x27c6('0x21')]&&parseInt(_0x265e01[_0x3b419f[0x0]][_0x27c6('0x21')])===0x0){var _0x4185df={'messageId':_0x265e01[_0x3b419f[0x0]][_0x27c6('0x61')]};if(!_0x53fba[_0x27c6('0x35')]){_0x4185df[_0x27c6('0x36')]=!![];}return _0x39e543[_0x27c6('0x12')](_0x4185df);}else{return logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate',_0x27c6('0x54'),util['inspect'](_0x265e01['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x41abe4){return logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate',_0x27c6('0x54'),util[_0x27c6('0x24')](_0x41abe4,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27c6('0x23'),_0x27c6('0x54'),_0x27c6('0x62'));}break;case _0x27c6('0x63'):if(_0x53fba['apiKey']){var _0x317d41={'method':'POST','uri':_0x27c6('0x64'),'headers':{'Authorization':_0x53fba['apiKey']},'body':{'content':_0x382df6[_0x27c6('0x7')],'to':[_0x382df6['phone']],'from':_0x53fba[_0x27c6('0x1b')],'binary':![],'clientMessageId':'uuid','charset':_0x27c6('0x65')},'json':!![]};rp(_0x317d41)[_0x27c6('0x17')](function(_0x5834f3){if(!_0x5834f3['error']){var _0x2095f5={'messageId':_0x5834f3[_0x27c6('0x45')][0x0][_0x27c6('0x66')]};if(!_0x53fba[_0x27c6('0x35')]){_0x2095f5['read']=!![];}return _0x39e543['update'](_0x2095f5);}else{return logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate',_0x27c6('0x63'),util['inspect'](_0x5834f3[_0x27c6('0x21')],{'showHidden':![],'depth':null}));}})[_0x27c6('0x14')](function(_0x26b7ed){return logger[_0x27c6('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27c6('0x23'),'clickatell',util[_0x27c6('0x24')](_0x26b7ed,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x63'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x53fba[_0x27c6('0x28')]&&_0x53fba[_0x27c6('0x29')]){var _0x185642=util[_0x27c6('0x3f')](_0x27c6('0x40'),_0x53fba['username'],_0x53fba[_0x27c6('0x29')]);var _0x12b275={'method':_0x27c6('0x30'),'uri':_0x27c6('0x67')+_0x53fba[_0x27c6('0x68')]+_0x27c6('0x69'),'body':{'to':[_0x382df6[_0x27c6('0x1b')]],'text':_0x382df6[_0x27c6('0x7')],'from':_0x53fba[_0x27c6('0x1b')],'applicationId':_0x53fba[_0x27c6('0x6a')]},'headers':{'Authorization':util['format'](_0x27c6('0x6b'),new Buffer(_0x185642)[_0x27c6('0x41')](_0x27c6('0x42')))},'json':!![]};rp(_0x12b275)[_0x27c6('0x17')](function(_0xb395d4){if(_0xb395d4['id']){var _0x5f6ae4={'messageId':_0xb395d4['id']};return _0x39e543[_0x27c6('0x12')](_0x5f6ae4);}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x6c'),util['inspect'](_0xb395d4,{'showHidden':![],'depth':null}));}})[_0x27c6('0x14')](function(_0xffd4bb){logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate',_0x27c6('0x6c'),util[_0x27c6('0x24')](_0xffd4bb,{'showHidden':![],'depth':null}));});}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x6c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x27c6('0x6d'):if(_0x53fba[_0x27c6('0x56')]){var _0x248d43={};var _0x3062ff={'method':_0x27c6('0x30'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x27c6('0x6e')+_0x53fba[_0x27c6('0x56')],'Content-Type':_0x27c6('0x51')},'body':{'from':_0x53fba['phone'],'to':_0x382df6['phone'],'text':_0x382df6[_0x27c6('0x7')]},'json':!![]};return rp(_0x3062ff)['then'](function(_0x45c263){if(_0x45c263[_0x27c6('0x6f')]==0xca){_0x248d43[_0x27c6('0x70')]=_0x45c263;var _0x7f7afa={'method':_0x27c6('0x30'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x27c6('0x6e')+_0x53fba[_0x27c6('0x56')],'Content-Type':_0x27c6('0x51')},'body':{'refid':_0x248d43[_0x27c6('0x70')][_0x27c6('0x71')]},'json':!![]};return rp(_0x7f7afa)[_0x27c6('0x17')](function(_0x270801){_0x248d43['status']=_0x270801;var _0x5e7bae={'messageId':_0x248d43[_0x27c6('0x70')][_0x27c6('0x71')],'read':!![]};return _0x39e543[_0x27c6('0x12')](_0x5e7bae);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x27c6('0x6d'),util[_0x27c6('0x24')](_0x45c263,{'showHidden':![],'depth':null}));}})['catch'](function(_0x50f345){return logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate',_0x27c6('0x6d'),util[_0x27c6('0x24')](_0x50f345,{'showHidden':![],'depth':null}));});}else{return logger[_0x27c6('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27c6('0x23'),_0x27c6('0x6d'),_0x27c6('0x72'));}break;}}})['finally'](function(){_0x372679();});}else{_0x372679();}}},'charset':_0x27c6('0x73'),'collate':_0x27c6('0x74')});}; \ No newline at end of file +var _0xa60f=['/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','intelepeer','Token\x20not\x20received','utf8mb4_unicode_ci','util','api','request-promise','path','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','isNil','SmsInteractionId','SmsInteraction','findOne','then','createdAt','catch','find','SmsAccountId','type','twilio','accountSid','phone','messages','create','remote','/status?token=','token','sid','update','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','smsMethod','login?username=','username','&password=','password','GET','split','session_key','total_sent','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','authToken','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','deliveryReport','clickSend','plivo','authId','message_uuid','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','sender','text','timestamp','keys','sort','md5','digest','hex'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa60f,0x177));var _0xfa60=function(_0x562c54,_0x1e478f){_0x562c54=_0x562c54-0x0;var _0x279191=_0xa60f[_0x562c54];return _0x279191;};'use strict';var _=require('lodash');var util=require(_0xfa60('0x0'));var logger=require('../../config/logger')(_0xfa60('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfa60('0x2'));var fs=require('fs');var path=require(_0xfa60('0x3'));var rimraf=require('rimraf');var config=require(_0xfa60('0x4'));var attributes=require(_0xfa60('0x5'));module['exports']=function(_0x3c90bc,_0x3eecb7){return _0x3c90bc[_0xfa60('0x6')](_0xfa60('0x7'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xfa60('0x8'),'fields':[_0xfa60('0x8')]},{'name':'fti_sms_messages','fields':[_0xfa60('0x9')],'type':_0xfa60('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x43c940,_0x1c9f79,_0x3f35f3){var _0x532d00=_0x3c90bc[_0xfa60('0xb')];var _0x8405c=_0x43c940[_0xfa60('0xc')]({'plain':!![]});if(_0x8405c[_0xfa60('0xd')][_0xfa60('0xe')]()==='in'||_0x8405c[_0xfa60('0xd')]['toLowerCase']()===_0xfa60('0xf')&&!_0x8405c[_0xfa60('0x10')]&&!_['isNil'](_0x8405c[_0xfa60('0x11')])&&!_[_0xfa60('0x12')](_0x8405c[_0xfa60('0x13')])){_0x532d00[_0xfa60('0x14')][_0xfa60('0x15')]({'where':{'id':_0x8405c[_0xfa60('0x13')]}})[_0xfa60('0x16')](function(_0x427824){if(_0x427824){_0x427824['update']({'lastMsgAt':_0x8405c[_0xfa60('0x17')],'lastMsgDirection':_0x8405c[_0xfa60('0xd')][_0xfa60('0xe')]()});}})[_0xfa60('0x18')](function(_0x429fba){console['error'](_0x429fba);});}if(_0x8405c[_0xfa60('0xd')]===_0xfa60('0xf')&&!_0x8405c[_0xfa60('0x10')]){var _0x25bc1a;_0x532d00['SmsAccount'][_0xfa60('0x19')]({'where':{'id':_0x8405c[_0xfa60('0x1a')]},'raw':!![]})['then'](function(_0x2f04a1){_0x25bc1a=_0x2f04a1;if(_0x25bc1a&&_0x25bc1a[_0xfa60('0x1b')]){switch(_0x25bc1a[_0xfa60('0x1b')]){case _0xfa60('0x1c'):var _0x4552d2=require('twilio');if(_0x25bc1a[_0xfa60('0x1d')]&&_0x25bc1a['authToken']&&_0x25bc1a[_0xfa60('0x1e')]){var _0x1cf903=new _0x4552d2(_0x25bc1a[_0xfa60('0x1d')],_0x25bc1a['authToken']);_0x1cf903[_0xfa60('0x1f')][_0xfa60('0x20')]({'body':_0x8405c['body'],'to':_0x8405c[_0xfa60('0x1e')],'from':_0x25bc1a['phone'],'statusCallback':_0x25bc1a[_0xfa60('0x21')]+'/api/sms/messages/'+_0x8405c['id']+_0xfa60('0x22')+_0x25bc1a[_0xfa60('0x23')]})[_0xfa60('0x16')](function(_0x1f8c43){if(_0x1f8c43[_0xfa60('0x24')]){return _0x43c940[_0xfa60('0x25')]({'messageId':_0x1f8c43[_0xfa60('0x24')]});}})[_0xfa60('0x18')](function(_0x5685b6){logger[_0xfa60('0x26')](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x1c'),util[_0xfa60('0x29')](_0x5685b6,{'showHidden':![],'depth':null}));});}else{logger[_0xfa60('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfa60('0x28'),_0xfa60('0x1c'),_0xfa60('0x2a'));}break;case'skebby':var _0x337874=_0xfa60('0x2b');if(_0x25bc1a['username']&&_0x25bc1a['password']){var _0x193bbb={'recipient':[_0x8405c['phone']],'message':_0x8405c[_0xfa60('0x9')],'message_type':_0x25bc1a[_0xfa60('0x2c')]};if(_0x25bc1a[_0xfa60('0x2c')]&&_0x25bc1a['smsMethod']!=='SI'){_0x193bbb['sender']=_0x25bc1a[_0xfa60('0x1e')];}var _0x2ce16d={'url':_0x337874+_0xfa60('0x2d')+_0x25bc1a[_0xfa60('0x2e')]+_0xfa60('0x2f')+_0x25bc1a[_0xfa60('0x30')],'method':_0xfa60('0x31')};rp(_0x2ce16d)[_0xfa60('0x16')](function(_0x137cb9){var _0x412795=_0x137cb9[_0xfa60('0x32')](';');var _0x37bedf={'user_key':_0x412795[0x0],'session_key':_0x412795[0x1]};_0x2ce16d={'url':_0x337874+'sms','method':'POST','headers':{'user_key':_0x37bedf['user_key'],'Session_key':_0x37bedf[_0xfa60('0x33')]},'json':!![],'body':_0x193bbb};return rp(_0x2ce16d);})[_0xfa60('0x16')](function(_0x40dfb8){if(_0x40dfb8[_0xfa60('0x34')]>=0x1){var _0x4f8ffb={'messageId':_0x40dfb8['internal_order_id']};if(_0x25bc1a[_0xfa60('0x2c')]!=='GP'||!_0x25bc1a['deliveryReport']){_0x4f8ffb[_0xfa60('0x35')]=!![];}return _0x43c940[_0xfa60('0x25')](_0x4f8ffb);}else{return logger[_0xfa60('0x26')](_0xfa60('0x27'),'afterCreate',_0xfa60('0x36'),util[_0xfa60('0x29')](_0x40dfb8,{'showHidden':![],'depth':null}));}})[_0xfa60('0x18')](function(_0x5b899a){return logger[_0xfa60('0x26')](_0xfa60('0x27'),'afterCreate',_0xfa60('0x36'),util[_0xfa60('0x29')](_0x5b899a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfa60('0x27'),'afterCreate','skebby',_0xfa60('0x37'));}break;case _0xfa60('0x38'):if(_0x25bc1a['authToken']){var _0x27a9d2={'recipient':_0x8405c[_0xfa60('0x1e')],'message':_0x8405c[_0xfa60('0x9')],'sender':_0x25bc1a[_0xfa60('0x39')]||_0x25bc1a['phone'],'authorization':_0x25bc1a[_0xfa60('0x3a')]};var _0x1c9f79={'method':_0xfa60('0x3b'),'uri':_0xfa60('0x3c'),'body':_0x27a9d2,'json':!![]};rp(_0x1c9f79)[_0xfa60('0x16')](function(_0xf2f089){var _0x8e5b7b={'messageId':_0xf2f089[_0xfa60('0x3d')]};if(!_0x25bc1a['deliveryReport']){_0x8e5b7b['read']=!![];}return _0x43c940[_0xfa60('0x25')](_0x8e5b7b);})[_0xfa60('0x18')](function(_0x46a77e){logger[_0xfa60('0x26')](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x38'),util[_0xfa60('0x29')](_0x46a77e,{'showHidden':![],'depth':null}));});}else{logger[_0xfa60('0x26')](_0xfa60('0x27'),'afterCreate',_0xfa60('0x38'),_0xfa60('0x3e'));}break;case _0xfa60('0x3f'):if(_0x25bc1a[_0xfa60('0x2e')]&&_0x25bc1a[_0xfa60('0x30')]){var _0x27a9d2={'messages':[{'source':_0xfa60('0x40'),'to':_0x8405c[_0xfa60('0x1e')],'body':_0x8405c[_0xfa60('0x9')],'from':_0x25bc1a['senderString']||_0x25bc1a[_0xfa60('0x1e')]}]};var _0x222379=util[_0xfa60('0x41')](_0xfa60('0x42'),_0x25bc1a[_0xfa60('0x2e')],_0x25bc1a['password']);var _0x1c9f79={'method':_0xfa60('0x3b'),'uri':_0xfa60('0x43'),'body':_0x27a9d2,'headers':{'Authorization':util[_0xfa60('0x41')](_0xfa60('0x44'),new Buffer(_0x222379)[_0xfa60('0x45')](_0xfa60('0x46')))},'json':!![]};rp(_0x1c9f79)[_0xfa60('0x16')](function(_0x13a477){if(_0x13a477[_0xfa60('0x47')]>=0xc8&&_0x13a477[_0xfa60('0x47')]<=0xce){if(_0x13a477[_0xfa60('0x48')]&&_0x13a477[_0xfa60('0x48')][_0xfa60('0x49')]>0x0){var _0x4d5088=_['head'](_0x13a477['data'][_0xfa60('0x1f')]);var _0x2aa1e1={'messageId':_0x4d5088[_0xfa60('0x4a')]};if(!_0x25bc1a[_0xfa60('0x4b')]){_0x2aa1e1[_0xfa60('0x35')]=!![];}return _0x43c940[_0xfa60('0x25')](_0x2aa1e1);}else{logger[_0xfa60('0x26')](_0xfa60('0x27'),'afterCreate',_0xfa60('0x4c'),util[_0xfa60('0x29')](_0x13a477,{'showHidden':![],'depth':null}));}}else{logger[_0xfa60('0x26')](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x4c'),util[_0xfa60('0x29')](_0x13a477,{'showHidden':![],'depth':null}));}})[_0xfa60('0x18')](function(_0x1d47e3){logger['error'](_0xfa60('0x27'),'afterCreate',_0xfa60('0x4c'),util['inspect'](_0x1d47e3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x4c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xfa60('0x4d'):if(_0x25bc1a['authId']&&_0x25bc1a[_0xfa60('0x3a')]){var _0x27a9d2={'dst':_0x8405c[_0xfa60('0x1e')],'text':_0x8405c[_0xfa60('0x9')],'src':_0x25bc1a['senderString']||_0x25bc1a[_0xfa60('0x1e')],'url':_0x25bc1a[_0xfa60('0x21')]+'/api/sms/messages/'+_0x8405c['id']+_0xfa60('0x22')+_0x25bc1a[_0xfa60('0x23')]};var _0x222379=util[_0xfa60('0x41')](_0xfa60('0x42'),_0x25bc1a['authId'],_0x25bc1a[_0xfa60('0x3a')]);var _0x1c9f79={'method':_0xfa60('0x3b'),'uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x25bc1a[_0xfa60('0x4e')]),'body':_0x27a9d2,'headers':{'Authorization':util[_0xfa60('0x41')](_0xfa60('0x44'),new Buffer(_0x222379)[_0xfa60('0x45')]('base64'))},'json':!![]};rp(_0x1c9f79)[_0xfa60('0x16')](function(_0x556784){var _0x2f0d4b={'messageId':_0x556784[_0xfa60('0x4f')][0x0]};return _0x43c940[_0xfa60('0x25')](_0x2f0d4b);})[_0xfa60('0x18')](function(_0x1e842f){logger[_0xfa60('0x26')](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x4d'),util[_0xfa60('0x29')](_0x1e842f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x4d'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xfa60('0x50'):if(_0x25bc1a[_0xfa60('0x2e')]&&_0x25bc1a[_0xfa60('0x30')]){if(_0x25bc1a['baseUrl']){var _0x183c4e={'method':'POST','uri':_0x25bc1a[_0xfa60('0x51')]+_0xfa60('0x52'),'body':{'username':_0x25bc1a[_0xfa60('0x2e')],'password':_0x25bc1a[_0xfa60('0x30')]},'json':!![]};return rp(_0x183c4e)[_0xfa60('0x16')](function(_0x189c46){var _0x5cc341={'method':_0xfa60('0x3b'),'uri':_0x25bc1a[_0xfa60('0x51')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x25bc1a[_0xfa60('0x1e')],'destinations':[{'to':_0x8405c[_0xfa60('0x1e')]}],'text':_0x8405c[_0xfa60('0x9')],'notifyUrl':_0x25bc1a[_0xfa60('0x21')]+'/api/sms/messages/'+_0x8405c['id']+_0xfa60('0x22')+_0x25bc1a[_0xfa60('0x23')],'notifyContentType':_0xfa60('0x53'),'callbackData':_0x25bc1a[_0xfa60('0x1e')]+';'+_0x8405c['body']}]},'headers':{'Authorization':_0xfa60('0x54')+_0x189c46['token']},'json':!![]};return rp(_0x5cc341)[_0xfa60('0x16')](function(_0x1ccf1d){if(_0x1ccf1d[_0xfa60('0x1f')]){var _0x419fb5={'messageId':_0x1ccf1d['messages'][0x0]['messageId']};if(!_0x25bc1a['deliveryReport']){_0x419fb5['read']=!![];}return _0x43c940['update'](_0x419fb5);}else{return logger[_0xfa60('0x26')](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x50'),util[_0xfa60('0x29')](_0x1ccf1d,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2edfb7){return logger[_0xfa60('0x26')](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x50'),util[_0xfa60('0x29')](_0x2edfb7,{'showHidden':![],'depth':null}));});}else{logger[_0xfa60('0x26')](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x50'),_0xfa60('0x55'));}}else{logger[_0xfa60('0x26')](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x50'),_0xfa60('0x37'));}break;case'csc':var _0x29f679=require(_0xfa60('0x56'));if(_0x25bc1a[_0xfa60('0x57')]){var _0x22f4f4={};_0x22f4f4[_0xfa60('0x58')]=_0x25bc1a[_0xfa60('0x2e')];_0x22f4f4[_0xfa60('0x1e')]=_0x8405c[_0xfa60('0x1e')];_0x22f4f4[_0xfa60('0x59')]=_0x25bc1a['phone'];_0x22f4f4[_0xfa60('0x5a')]=_0x8405c['body'];_0x22f4f4[_0xfa60('0x5b')]=+new Date();var _0x41d604='';var _0x301d1c='';var _0x205a7a=Object[_0xfa60('0x5c')](_0x22f4f4);_0x205a7a[_0xfa60('0x5d')]();for(var _0x394ec8=0x0;_0x394ec8<_0x205a7a['length'];_0x394ec8++){if(_0x41d604!=''){_0x41d604+='&';}_0x41d604+=_0x205a7a[_0x394ec8]+'='+encodeURIComponent(_0x22f4f4[_0x205a7a[_0x394ec8]]);_0x301d1c+=_0x22f4f4[_0x205a7a[_0x394ec8]];}_0x301d1c+=_0x25bc1a[_0xfa60('0x57')];_0x301d1c=_0x29f679['createHash'](_0xfa60('0x5e'))['update'](_0x301d1c)[_0xfa60('0x5f')](_0xfa60('0x60'));if(_0x41d604!==''){_0x41d604+='&';}_0x41d604+='signature='+_0x301d1c;var _0x2ce16d={'method':'GET','uri':_0x25bc1a[_0xfa60('0x51')]+_0xfa60('0x61')+_0x41d604,'json':!![]};return rp(_0x2ce16d)[_0xfa60('0x16')](function(_0x459088){var _0x1df06e=Object['keys'](_0x459088);if(_0x459088[_0x1df06e[0x0]][_0xfa60('0x26')]&&parseInt(_0x459088[_0x1df06e[0x0]]['error'])===0x0){var _0x4440f3={'messageId':_0x459088[_0x1df06e[0x0]][_0xfa60('0x62')]};if(!_0x25bc1a[_0xfa60('0x4b')]){_0x4440f3[_0xfa60('0x35')]=!![];}return _0x43c940[_0xfa60('0x25')](_0x4440f3);}else{return logger[_0xfa60('0x26')](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x63'),util[_0xfa60('0x29')](_0x459088[_0xfa60('0x26')],{'showHidden':![],'depth':null}));}})[_0xfa60('0x18')](function(_0x476cbc){return logger[_0xfa60('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0xfa60('0x29')](_0x476cbc,{'showHidden':![],'depth':null}));});}else{logger[_0xfa60('0x26')](_0xfa60('0x27'),'afterCreate',_0xfa60('0x63'),_0xfa60('0x64'));}break;case _0xfa60('0x65'):if(_0x25bc1a[_0xfa60('0x57')]){var _0x2d4a8f={'method':_0xfa60('0x3b'),'uri':_0xfa60('0x66'),'headers':{'Authorization':_0x25bc1a[_0xfa60('0x57')]},'body':{'content':_0x8405c['body'],'to':[_0x8405c[_0xfa60('0x1e')]],'from':_0x25bc1a[_0xfa60('0x1e')],'binary':![],'clientMessageId':_0xfa60('0x67'),'charset':_0xfa60('0x68')},'json':!![]};rp(_0x2d4a8f)['then'](function(_0x2630e0){if(!_0x2630e0['error']){var _0x272f15={'messageId':_0x2630e0['messages'][0x0][_0xfa60('0x69')]};if(!_0x25bc1a['deliveryReport']){_0x272f15[_0xfa60('0x35')]=!![];}return _0x43c940[_0xfa60('0x25')](_0x272f15);}else{return logger['error'](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x65'),util[_0xfa60('0x29')](_0x2630e0[_0xfa60('0x26')],{'showHidden':![],'depth':null}));}})[_0xfa60('0x18')](function(_0x1925e1){return logger[_0xfa60('0x26')](_0xfa60('0x27'),'afterCreate',_0xfa60('0x65'),util[_0xfa60('0x29')](_0x1925e1,{'showHidden':![],'depth':null}));});}else{logger[_0xfa60('0x26')](_0xfa60('0x27'),'afterCreate',_0xfa60('0x65'),_0xfa60('0x64'));}break;case'bandwidth':if(_0x25bc1a['username']&&_0x25bc1a[_0xfa60('0x30')]){var _0x222379=util[_0xfa60('0x41')](_0xfa60('0x42'),_0x25bc1a[_0xfa60('0x2e')],_0x25bc1a['password']);var _0x1c9f79={'method':_0xfa60('0x3b'),'uri':_0xfa60('0x6a')+_0x25bc1a[_0xfa60('0x6b')]+_0xfa60('0x6c'),'body':{'to':[_0x8405c['phone']],'text':_0x8405c[_0xfa60('0x9')],'from':_0x25bc1a[_0xfa60('0x1e')],'applicationId':_0x25bc1a['applicationId']},'headers':{'Authorization':util['format'](_0xfa60('0x44'),new Buffer(_0x222379)[_0xfa60('0x45')](_0xfa60('0x46')))},'json':!![]};rp(_0x1c9f79)[_0xfa60('0x16')](function(_0x144894){if(_0x144894['id']){var _0x43d11b={'messageId':_0x144894['id']};return _0x43c940[_0xfa60('0x25')](_0x43d11b);}else{logger['error'](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x6d'),util[_0xfa60('0x29')](_0x144894,{'showHidden':![],'depth':null}));}})[_0xfa60('0x18')](function(_0x1c02ba){logger['error'](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x6d'),util[_0xfa60('0x29')](_0x1c02ba,{'showHidden':![],'depth':null}));});}else{logger[_0xfa60('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfa60('0x28'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x25bc1a[_0xfa60('0x57')]){var _0x43231e={};var _0x2ce16d={'method':_0xfa60('0x3b'),'uri':_0xfa60('0x6e'),'headers':{'Authorization':_0xfa60('0x6f')+_0x25bc1a[_0xfa60('0x57')],'Content-Type':_0xfa60('0x53')},'body':{'from':_0x25bc1a[_0xfa60('0x1e')],'to':_0x8405c[_0xfa60('0x1e')],'text':_0x8405c[_0xfa60('0x9')]},'json':!![]};return rp(_0x2ce16d)['then'](function(_0x348a83){if(_0x348a83['code']==0xca){_0x43231e[_0xfa60('0x70')]=_0x348a83;var _0x14f3ed={'method':_0xfa60('0x3b'),'uri':_0xfa60('0x71'),'headers':{'Authorization':_0xfa60('0x6f')+_0x25bc1a[_0xfa60('0x57')],'Content-Type':_0xfa60('0x53')},'body':{'refid':_0x43231e[_0xfa60('0x70')][_0xfa60('0x72')]},'json':!![]};return rp(_0x14f3ed)[_0xfa60('0x16')](function(_0x125fd1){_0x43231e['status']=_0x125fd1;var _0x82e088={'messageId':_0x43231e['message'][_0xfa60('0x72')],'read':!![]};return _0x43c940['update'](_0x82e088);});}else{return logger[_0xfa60('0x26')](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x73'),util[_0xfa60('0x29')](_0x348a83,{'showHidden':![],'depth':null}));}})[_0xfa60('0x18')](function(_0x5a9541){return logger['error'](_0xfa60('0x27'),_0xfa60('0x28'),_0xfa60('0x73'),util[_0xfa60('0x29')](_0x5a9541,{'showHidden':![],'depth':null}));});}else{return logger[_0xfa60('0x26')](_0xfa60('0x27'),_0xfa60('0x28'),'intelepeer',_0xfa60('0x74'));}break;}}})['finally'](function(){_0x3f35f3();});}else{_0x3f35f3();}}},'charset':'utf8mb4','collate':_0xfa60('0x75')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 47ff966..b4d3179 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 _0xdd10=['then','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./smsMessage.socket','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSmsMessage','SmsMessage','body','raw'];(function(_0x260038,_0x584f45){var _0x991a1e=function(_0x357c74){while(--_0x357c74){_0x260038['push'](_0x260038['shift']());}};_0x991a1e(++_0x584f45);}(_0xdd10,0x163));var _0x0dd1=function(_0x5e88db,_0x588bdd){_0x5e88db=_0x5e88db-0x0;var _0x414cda=_0xdd10[_0x5e88db];return _0x414cda;};'use strict';var _=require(_0x0dd1('0x0'));var util=require(_0x0dd1('0x1'));var moment=require('moment');var BPromise=require(_0x0dd1('0x2'));var rs=require(_0x0dd1('0x3'));var fs=require('fs');var Redis=require(_0x0dd1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0dd1('0x5'));var logger=require(_0x0dd1('0x6'))(_0x0dd1('0x7'));var config=require(_0x0dd1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0dd1('0x9')][_0x0dd1('0xa')]({'port':0x232a});config[_0x0dd1('0xb')]=_[_0x0dd1('0xc')](config[_0x0dd1('0xb')],{'host':_0x0dd1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0dd1('0xb')]));require(_0x0dd1('0xe'))['register'](socket);function respondWithRpcPromise(_0x5d2536,_0x105fc6,_0x53c052){return new BPromise(function(_0x171d33,_0x2357fa){return client[_0x0dd1('0xf')](_0x5d2536,_0x53c052)['then'](function(_0x4880fe){logger[_0x0dd1('0x10')](_0x0dd1('0x11'),_0x105fc6,_0x0dd1('0x12'));logger[_0x0dd1('0x13')](_0x0dd1('0x14'),_0x105fc6,_0x0dd1('0x12'),JSON['stringify'](_0x4880fe));if(_0x4880fe[_0x0dd1('0x15')]){if(_0x4880fe[_0x0dd1('0x15')][_0x0dd1('0x16')]===0x1f4){logger[_0x0dd1('0x15')](_0x0dd1('0x11'),_0x105fc6,_0x4880fe[_0x0dd1('0x15')][_0x0dd1('0x17')]);return _0x2357fa(_0x4880fe['error'][_0x0dd1('0x17')]);}logger[_0x0dd1('0x15')](_0x0dd1('0x11'),_0x105fc6,_0x4880fe[_0x0dd1('0x15')]['message']);return _0x171d33(_0x4880fe[_0x0dd1('0x15')][_0x0dd1('0x17')]);}else{logger[_0x0dd1('0x10')](_0x0dd1('0x11'),_0x105fc6,_0x0dd1('0x12'));_0x171d33(_0x4880fe[_0x0dd1('0x18')][_0x0dd1('0x17')]);}})['catch'](function(_0x2275ae){logger[_0x0dd1('0x15')](_0x0dd1('0x11'),_0x105fc6,_0x2275ae);_0x2357fa(_0x2275ae);});});}exports[_0x0dd1('0x19')]=function(_0x35c177){var _0x1f6914=this;return new Promise(function(_0x3bd736,_0xfb855e){return db[_0x0dd1('0x1a')]['create'](_0x35c177[_0x0dd1('0x1b')],{'raw':_0x35c177['options']?_0x35c177['options'][_0x0dd1('0x1c')]===undefined?!![]:![]:!![]})[_0x0dd1('0x1d')](function(_0x41920e){logger[_0x0dd1('0x10')](_0x0dd1('0x19'),_0x35c177);logger[_0x0dd1('0x13')](_0x0dd1('0x19'),_0x35c177,JSON[_0x0dd1('0x1e')](_0x41920e));_0x3bd736(_0x41920e);})[_0x0dd1('0x1f')](function(_0x5ce71b){logger[_0x0dd1('0x15')]('CreateSmsMessage',_0x5ce71b['message'],_0x35c177);_0xfb855e(_0x1f6914['error'](0x1f4,_0x5ce71b[_0x0dd1('0x17')]));});});}; \ No newline at end of file +var _0x6cf2=['redis','defaults','./smsMessage.socket','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateSmsMessage','SmsMessage','create','options','raw','then','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x455b64,_0x466b95){var _0x44848b=function(_0x153380){while(--_0x153380){_0x455b64['push'](_0x455b64['shift']());}};_0x44848b(++_0x466b95);}(_0x6cf2,0x163));var _0x26cf=function(_0x48933a,_0x2ef86d){_0x48933a=_0x48933a-0x0;var _0x5cca0a=_0x6cf2[_0x48933a];return _0x5cca0a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x26cf('0x0'));var BPromise=require(_0x26cf('0x1'));var rs=require(_0x26cf('0x2'));var fs=require('fs');var Redis=require(_0x26cf('0x3'));var db=require(_0x26cf('0x4'))['db'];var utils=require(_0x26cf('0x5'));var logger=require('../../config/logger')(_0x26cf('0x6'));var config=require('../../config/environment');var jayson=require(_0x26cf('0x7'));var client=jayson[_0x26cf('0x8')]['http']({'port':0x232a});config[_0x26cf('0x9')]=_[_0x26cf('0xa')](config[_0x26cf('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x26cf('0xb'))['register'](socket);function respondWithRpcPromise(_0x3d320d,_0x2c7690,_0xee848){return new BPromise(function(_0x78380e,_0x2cf5a4){return client['request'](_0x3d320d,_0xee848)['then'](function(_0x474fcd){logger[_0x26cf('0xc')](_0x26cf('0xd'),_0x2c7690,'request\x20sent');logger[_0x26cf('0xe')](_0x26cf('0xf'),_0x2c7690,_0x26cf('0x10'),JSON[_0x26cf('0x11')](_0x474fcd));if(_0x474fcd[_0x26cf('0x12')]){if(_0x474fcd[_0x26cf('0x12')]['code']===0x1f4){logger[_0x26cf('0x12')](_0x26cf('0xd'),_0x2c7690,_0x474fcd[_0x26cf('0x12')][_0x26cf('0x13')]);return _0x2cf5a4(_0x474fcd[_0x26cf('0x12')]['message']);}logger[_0x26cf('0x12')]('SmsMessage,\x20%s,\x20%s',_0x2c7690,_0x474fcd[_0x26cf('0x12')]['message']);return _0x78380e(_0x474fcd['error'][_0x26cf('0x13')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x2c7690,_0x26cf('0x10'));_0x78380e(_0x474fcd[_0x26cf('0x14')][_0x26cf('0x13')]);}})['catch'](function(_0x333291){logger[_0x26cf('0x12')](_0x26cf('0xd'),_0x2c7690,_0x333291);_0x2cf5a4(_0x333291);});});}exports[_0x26cf('0x15')]=function(_0x51b5ed){var _0x4e20f0=this;return new Promise(function(_0x15b3c4,_0x3ec80d){return db[_0x26cf('0x16')][_0x26cf('0x17')](_0x51b5ed['body'],{'raw':_0x51b5ed[_0x26cf('0x18')]?_0x51b5ed[_0x26cf('0x18')][_0x26cf('0x19')]===undefined?!![]:![]:!![]})[_0x26cf('0x1a')](function(_0x367e81){logger[_0x26cf('0xc')](_0x26cf('0x15'),_0x51b5ed);logger[_0x26cf('0xe')](_0x26cf('0x15'),_0x51b5ed,JSON['stringify'](_0x367e81));_0x15b3c4(_0x367e81);})[_0x26cf('0x1b')](function(_0x137a65){logger[_0x26cf('0x12')]('CreateSmsMessage',_0x137a65[_0x26cf('0x13')],_0x51b5ed);_0x3ec80d(_0x4e20f0['error'](0x1f4,_0x137a65[_0x26cf('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 59f90f9..1a53603 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 _0x22c2=['save','remove','update','emit','length','smsMessage:'];(function(_0x23fdbc,_0x167c8b){var _0x1f50ad=function(_0x481372){while(--_0x481372){_0x23fdbc['push'](_0x23fdbc['shift']());}};_0x1f50ad(++_0x167c8b);}(_0x22c2,0x1c8));var _0x222c=function(_0x4488a9,_0x8b6501){_0x4488a9=_0x4488a9-0x0;var _0xef61c5=_0x22c2[_0x4488a9];return _0xef61c5;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x222c('0x0'),_0x222c('0x1'),_0x222c('0x2')];function createListener(_0x1c965b,_0x424260){return function(_0x3dad71){_0x424260[_0x222c('0x3')](_0x1c965b,_0x3dad71);};}function removeListener(_0x22e7e8,_0x34db02){return function(){SmsMessageEvents['removeListener'](_0x22e7e8,_0x34db02);};}exports['register']=function(_0x229b48){for(var _0x1821ca=0x0,_0x4dcaab=events[_0x222c('0x4')];_0x1821ca<_0x4dcaab;_0x1821ca++){var _0x3ce9f0=events[_0x1821ca];var _0x169dbc=createListener(_0x222c('0x5')+_0x3ce9f0,_0x229b48);SmsMessageEvents['on'](_0x3ce9f0,_0x169dbc);}}; \ No newline at end of file +var _0xfd71=['smsMessage:','./smsMessage.events','save','remove','update','register','length'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xfd71,0x158));var _0x1fd7=function(_0x56bb63,_0x3e165b){_0x56bb63=_0x56bb63-0x0;var _0x56a7ec=_0xfd71[_0x56bb63];return _0x56a7ec;};'use strict';var SmsMessageEvents=require(_0x1fd7('0x0'));var events=[_0x1fd7('0x1'),_0x1fd7('0x2'),_0x1fd7('0x3')];function createListener(_0x24b5d3,_0x2a71d5){return function(_0x31a9b5){_0x2a71d5['emit'](_0x24b5d3,_0x31a9b5);};}function removeListener(_0x2bffdd,_0x2d99c8){return function(){SmsMessageEvents['removeListener'](_0x2bffdd,_0x2d99c8);};}exports[_0x1fd7('0x4')]=function(_0x495132){for(var _0x14d7b0=0x0,_0x1348b6=events[_0x1fd7('0x5')];_0x14d7b0<_0x1348b6;_0x14d7b0++){var _0x1fc750=events[_0x14d7b0];var _0x22c822=createListener(_0x1fd7('0x6')+_0x1fc750,_0x495132);SmsMessageEvents['on'](_0x1fc750,_0x22c822);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index bcdeaa5..064092d 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 _0x12ff=['/:id/teams','getTeams','/:id/users','post','create','addTeams','put','/:id','update','delete','removeTeams','removeAgents','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','isAuthenticated','get','/describe','/:id/members'];(function(_0x4f9d23,_0x3282c4){var _0x5b15ea=function(_0x4fe3c1){while(--_0x4fe3c1){_0x4f9d23['push'](_0x4f9d23['shift']());}};_0x5b15ea(++_0x3282c4);}(_0x12ff,0x165));var _0xf12f=function(_0x3c9520,_0x187f3c){_0x3c9520=_0x3c9520-0x0;var _0xbe7616=_0x12ff[_0x3c9520];return _0xbe7616;};'use strict';var multer=require('multer');var util=require(_0xf12f('0x0'));var path=require('path');var timeout=require(_0xf12f('0x1'));var express=require(_0xf12f('0x2'));var router=express['Router']();var fs_extra=require(_0xf12f('0x3'));var auth=require(_0xf12f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf12f('0x5'));var controller=require(_0xf12f('0x6'));router['get']('/',auth[_0xf12f('0x7')](),controller['index']);router[_0xf12f('0x8')](_0xf12f('0x9'),auth[_0xf12f('0x7')](),controller['describe']);router[_0xf12f('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf12f('0x8')](_0xf12f('0xa'),auth[_0xf12f('0x7')](),controller['getMembers']);router[_0xf12f('0x8')](_0xf12f('0xb'),auth['isAuthenticated'](),controller[_0xf12f('0xc')]);router[_0xf12f('0x8')](_0xf12f('0xd'),auth[_0xf12f('0x7')](),controller['getAgents']);router[_0xf12f('0xe')]('/',auth['isAuthenticated'](),controller[_0xf12f('0xf')]);router['post'](_0xf12f('0xb'),auth['isAuthenticated'](),controller[_0xf12f('0x10')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xf12f('0x11')](_0xf12f('0x12'),auth[_0xf12f('0x7')](),controller[_0xf12f('0x13')]);router[_0xf12f('0x14')](_0xf12f('0x12'),auth['isAuthenticated'](),controller['destroy']);router[_0xf12f('0x14')](_0xf12f('0xb'),auth[_0xf12f('0x7')](),controller[_0xf12f('0x15')]);router[_0xf12f('0x14')](_0xf12f('0xd'),auth[_0xf12f('0x7')](),controller[_0xf12f('0x16')]);module['exports']=router; \ No newline at end of file +var _0xfbf5=['isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get'];(function(_0x35505,_0x45f224){var _0x1cee0a=function(_0x45ad41){while(--_0x45ad41){_0x35505['push'](_0x35505['shift']());}};_0x1cee0a(++_0x45f224);}(_0xfbf5,0x10d));var _0x5fbf=function(_0x1eaef9,_0x1f7062){_0x1eaef9=_0x1eaef9-0x0;var _0x57302d=_0xfbf5[_0x1eaef9];return _0x57302d;};'use strict';var multer=require(_0x5fbf('0x0'));var util=require(_0x5fbf('0x1'));var path=require(_0x5fbf('0x2'));var timeout=require('connect-timeout');var express=require(_0x5fbf('0x3'));var router=express[_0x5fbf('0x4')]();var fs_extra=require(_0x5fbf('0x5'));var auth=require(_0x5fbf('0x6'));var interaction=require(_0x5fbf('0x7'));var config=require('../../config/environment');var controller=require(_0x5fbf('0x8'));router[_0x5fbf('0x9')]('/',auth[_0x5fbf('0xa')](),controller[_0x5fbf('0xb')]);router[_0x5fbf('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x5fbf('0xc')]);router[_0x5fbf('0x9')](_0x5fbf('0xd'),auth[_0x5fbf('0xa')](),controller[_0x5fbf('0xe')]);router['get'](_0x5fbf('0xf'),auth['isAuthenticated'](),controller[_0x5fbf('0x10')]);router[_0x5fbf('0x9')](_0x5fbf('0x11'),auth['isAuthenticated'](),controller[_0x5fbf('0x12')]);router[_0x5fbf('0x9')](_0x5fbf('0x13'),auth[_0x5fbf('0xa')](),controller[_0x5fbf('0x14')]);router[_0x5fbf('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5fbf('0x15')](_0x5fbf('0x11'),auth['isAuthenticated'](),controller[_0x5fbf('0x16')]);router[_0x5fbf('0x15')](_0x5fbf('0x13'),auth['isAuthenticated'](),controller[_0x5fbf('0x17')]);router[_0x5fbf('0x18')]('/:id',auth[_0x5fbf('0xa')](),controller[_0x5fbf('0x19')]);router[_0x5fbf('0x1a')](_0x5fbf('0xd'),auth[_0x5fbf('0xa')](),controller[_0x5fbf('0x1b')]);router[_0x5fbf('0x1a')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5fbf('0x1c')]);router[_0x5fbf('0x1a')](_0x5fbf('0x13'),auth[_0x5fbf('0xa')](),controller[_0x5fbf('0x1d')]);module[_0x5fbf('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 464906f..e3fd11b 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 _0x0f9c=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x1dab30,_0xcb603e){var _0x564782=function(_0x2b9a23){while(--_0x2b9a23){_0x1dab30['push'](_0x1dab30['shift']());}};_0x564782(++_0xcb603e);}(_0x0f9c,0xd3));var _0xc0f9=function(_0x408f00,_0x2f6546){_0x408f00=_0x408f00-0x0;var _0x4ff564=_0x0f9c[_0x408f00];return _0x4ff564;};'use strict';var Sequelize=require('sequelize');module[_0xc0f9('0x0')]={'name':{'type':Sequelize[_0xc0f9('0x1')],'unique':_0xc0f9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc0f9('0x1')]},'timeout':{'type':Sequelize[_0xc0f9('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc0f9('0x4')](_0xc0f9('0x5'),_0xc0f9('0x6'),_0xc0f9('0x7'))}}; \ No newline at end of file +var _0x0705=['STRING','name','INTEGER','roundrobin','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0705,0x130));var _0x5070=function(_0x5a64eb,_0x286782){_0x5a64eb=_0x5a64eb-0x0;var _0x3ad930=_0x0705[_0x5a64eb];return _0x3ad930;};'use strict';var Sequelize=require('sequelize');module[_0x5070('0x0')]={'name':{'type':Sequelize[_0x5070('0x1')],'unique':_0x5070('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5070('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x5070('0x4'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 5124850..7fc0fd5 100644 --- a/server/api/smsQueue/smsQueue.controller.js +++ b/server/api/smsQueue/smsQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['%s/%s','pick','filter','getTeams','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','find','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','SmsQueue','rawAttributes','type','key','getOptions','where','count','include','query','rows','catch','show','model','keys','filters','fields','attributes','length','includeAll','options','create','user','get','role','autoAssociation','body','params','describe','getMembers','findOne','intersection','hasOwnProperty','nolimit','order','sort','SmsQueueId','merge','UserSmsQueue','User','findAndCountAll','map','UserId','agent','smsPause','updatedAt','createdAt','format'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0xadb5,0xad));var _0x5adb=function(_0x1b3e9e,_0x299251){_0x1b3e9e=_0x1b3e9e-0x0;var _0x588359=_0xadb5[_0x1b3e9e];return _0x588359;};'use strict';var BPromise=require('bluebird');var util=require(_0x5adb('0x0'));var _=require('lodash');var squel=require(_0x5adb('0x1'));var Redis=require(_0x5adb('0x2'));var qs=require(_0x5adb('0x3'));var logger=require('../../config/logger')(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var db=require(_0x5adb('0x6'))['db'];config['redis']=_[_0x5adb('0x7')](config[_0x5adb('0x8')],{'host':_0x5adb('0x9'),'port':0x18eb});var socket=require(_0x5adb('0xa'))(new Redis(config[_0x5adb('0x8')]));require(_0x5adb('0xb'))[_0x5adb('0xc')](socket);function respondWithStatusCode(_0x6d1b45,_0x41261c){_0x41261c=_0x41261c||0xcc;return function(_0x7293ab){if(_0x7293ab){return _0x6d1b45[_0x5adb('0xd')](_0x41261c);}return _0x6d1b45[_0x5adb('0xe')](_0x41261c)[_0x5adb('0xf')]();};}function respondWithResult(_0x275428,_0x563d86){_0x563d86=_0x563d86||0xc8;return function(_0x4c268d){if(_0x4c268d){return _0x275428[_0x5adb('0xe')](_0x563d86)[_0x5adb('0x10')](_0x4c268d);}};}function respondWithFilteredResult(_0x82e67e,_0x53b772){return function(_0x29f0d5){if(_0x29f0d5){var _0x56012f=typeof _0x53b772[_0x5adb('0x11')]==='undefined'&&typeof _0x53b772[_0x5adb('0x12')]===_0x5adb('0x13');var _0x44abe3=_0x29f0d5['count'];var _0x2a545b=_0x56012f?0x0:_0x53b772[_0x5adb('0x11')];var _0xf82f72=_0x56012f?_0x29f0d5['count']:_0x53b772[_0x5adb('0x11')]+_0x53b772['limit'];var _0x367d82;if(_0xf82f72>=_0x44abe3){_0xf82f72=_0x44abe3;_0x367d82=0xc8;}else{_0x367d82=0xce;}_0x82e67e[_0x5adb('0xe')](_0x367d82);return _0x82e67e[_0x5adb('0x14')](_0x5adb('0x15'),_0x2a545b+'-'+_0xf82f72+'/'+_0x44abe3)[_0x5adb('0x10')](_0x29f0d5);}return null;};}function saveUpdates(_0x39d24d){return function(_0xa29dc){if(_0xa29dc){return _0xa29dc[_0x5adb('0x16')](_0x39d24d)[_0x5adb('0x17')](function(_0x529b65){return _0x529b65;});}return null;};}function removeEntity(_0x3fff62){return function(_0x5de028){if(_0x5de028){return _0x5de028[_0x5adb('0x18')]()['then'](function(){var _0x3ef465=_0x5de028['get']({'plain':!![]});var _0x5e218c=_0x5adb('0x19');return db[_0x5adb('0x1a')][_0x5adb('0x18')]({'where':{'type':_0x5e218c,'resourceId':_0x3ef465['id']}})[_0x5adb('0x17')](function(){return _0x5de028;});})[_0x5adb('0x17')](function(){_0x3fff62['status'](0xcc)[_0x5adb('0xf')]();});}};}function handleEntityNotFound(_0x5c296e){return function(_0x4e9f16){if(!_0x4e9f16){_0x5c296e[_0x5adb('0xd')](0x194);}return _0x4e9f16;};}function handleError(_0x379b33,_0x1a38d3){_0x1a38d3=_0x1a38d3||0x1f4;return function(_0x1a8014){logger[_0x5adb('0x1b')](_0x1a8014[_0x5adb('0x1c')]);if(_0x1a8014[_0x5adb('0x1d')]){delete _0x1a8014['name'];}_0x379b33[_0x5adb('0xe')](_0x1a38d3)[_0x5adb('0x1e')](_0x1a8014);};}exports[_0x5adb('0x1f')]=function(_0x3839fb,_0xeb556c){var _0x49f203={};var _0x2fee18={'count':0x0,'rows':[]};var _0x2e1e63=_['map'](db[_0x5adb('0x20')][_0x5adb('0x21')],function(_0x1a0acd){return{'name':_0x1a0acd['fieldName'],'type':_0x1a0acd[_0x5adb('0x22')][_0x5adb('0x23')]};});_0x49f203=qs[_0x5adb('0x24')](_0x2e1e63,_0x3839fb);var _0x2c64a3={'where':_0x49f203[_0x5adb('0x25')]};return db[_0x5adb('0x20')]['count'](_0x2c64a3)['then'](function(_0x5d457e){_0x2fee18[_0x5adb('0x26')]=_0x5d457e;_0x49f203[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x3839fb[_0x5adb('0x28')]);return db[_0x5adb('0x20')]['findAll'](_0x49f203);})[_0x5adb('0x17')](function(_0x34b793){_0x2fee18[_0x5adb('0x29')]=_0x34b793;return _0x2fee18;})[_0x5adb('0x17')](respondWithFilteredResult(_0xeb556c,_0x49f203))[_0x5adb('0x2a')](handleError(_0xeb556c,null));};exports[_0x5adb('0x2b')]=function(_0x28190d,_0x28bf1f){var _0x138bf6={'raw':!![],'where':{'id':_0x28190d['params']['id']}},_0x260295={};_0x260295[_0x5adb('0x2c')]=_['keys'](db[_0x5adb('0x20')][_0x5adb('0x21')]);_0x260295['query']=_[_0x5adb('0x2d')](_0x28190d[_0x5adb('0x28')]);_0x260295[_0x5adb('0x2e')]=_['intersection'](_0x260295[_0x5adb('0x2c')],_0x260295[_0x5adb('0x28')]);_0x138bf6['attributes']=_['intersection'](_0x260295[_0x5adb('0x2c')],qs['fields'](_0x28190d[_0x5adb('0x28')][_0x5adb('0x2f')]));_0x138bf6[_0x5adb('0x30')]=_0x138bf6[_0x5adb('0x30')][_0x5adb('0x31')]?_0x138bf6['attributes']:_0x260295[_0x5adb('0x2c')];if(_0x28190d[_0x5adb('0x28')][_0x5adb('0x32')]){_0x138bf6['include']=[{'all':!![]}];}_0x138bf6=_['merge']({},_0x138bf6,_0x28190d[_0x5adb('0x33')]);return db[_0x5adb('0x20')]['find'](_0x138bf6)[_0x5adb('0x17')](handleEntityNotFound(_0x28bf1f,null))['then'](respondWithResult(_0x28bf1f,null))[_0x5adb('0x2a')](handleError(_0x28bf1f,null));};exports['create']=function(_0x11cb37,_0x4d052f){return db[_0x5adb('0x20')][_0x5adb('0x34')](_0x11cb37['body'],{})[_0x5adb('0x17')](function(_0x5a6a79){var _0xadbe37=_0x11cb37[_0x5adb('0x35')][_0x5adb('0x36')]({'plain':!![]});if(!_0xadbe37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xadbe37[_0x5adb('0x37')]===_0x5adb('0x35')){var _0xcdaf8e=_0x5a6a79[_0x5adb('0x36')]({'plain':!![]});var _0x22aa95='SmsQueues';return db['UserProfileSection']['find']({'where':{'name':_0x22aa95,'userProfileId':_0xadbe37['userProfileId']},'raw':!![]})[_0x5adb('0x17')](function(_0x2fbe14){if(_0x2fbe14&&_0x2fbe14[_0x5adb('0x38')]===0x0){return db[_0x5adb('0x1a')][_0x5adb('0x34')]({'name':_0xcdaf8e[_0x5adb('0x1d')],'resourceId':_0xcdaf8e['id'],'type':_0x2fbe14[_0x5adb('0x1d')],'sectionId':_0x2fbe14['id']},{})[_0x5adb('0x17')](function(){return _0x5a6a79;});}else{return _0x5a6a79;}})['catch'](function(_0x53f2c6){logger[_0x5adb('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53f2c6);throw _0x53f2c6;});}return _0x5a6a79;})[_0x5adb('0x17')](respondWithResult(_0x4d052f,0xc9))[_0x5adb('0x2a')](handleError(_0x4d052f,null));};exports[_0x5adb('0x16')]=function(_0x121714,_0xdfecfd){if(_0x121714['body']['id']){delete _0x121714[_0x5adb('0x39')]['id'];}return db[_0x5adb('0x20')]['find']({'where':{'id':_0x121714[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0xdfecfd,null))['then'](saveUpdates(_0x121714[_0x5adb('0x39')],null))[_0x5adb('0x17')](respondWithResult(_0xdfecfd,null))[_0x5adb('0x2a')](handleError(_0xdfecfd,null));};exports[_0x5adb('0x18')]=function(_0xea3307,_0x4362ec){return db[_0x5adb('0x20')]['find']({'where':{'id':_0xea3307['params']['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x4362ec,null))[_0x5adb('0x17')](removeEntity(_0x4362ec,null))[_0x5adb('0x2a')](handleError(_0x4362ec,null));};exports[_0x5adb('0x3b')]=function(_0x57b8af,_0x507e48){return db[_0x5adb('0x20')][_0x5adb('0x3b')]()[_0x5adb('0x17')](respondWithResult(_0x507e48,null))[_0x5adb('0x2a')](handleError(_0x507e48,null));};exports[_0x5adb('0x3c')]=function(_0x5358c0,_0x182cbc){var _0x437f52={'raw':!![],'where':{}},_0x5b574c={},_0x7786c4;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0x5358c0[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x182cbc,null))[_0x5adb('0x17')](function(_0x39840e){if(_0x39840e){_0x7786c4=_0x39840e[_0x5adb('0x36')]({'plain':!![]});_0x5b574c['model']=_[_0x5adb('0x2d')](db['UserSmsQueue']['rawAttributes']);_0x5b574c['query']=_[_0x5adb('0x2d')](_0x5358c0[_0x5adb('0x28')]);_0x5b574c[_0x5adb('0x2e')]=_['intersection'](_0x5b574c[_0x5adb('0x2c')],_0x5b574c['query']);_0x437f52[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x5b574c[_0x5adb('0x2c')],qs['fields'](_0x5358c0[_0x5adb('0x28')]['fields']));_0x437f52[_0x5adb('0x30')]=_0x437f52[_0x5adb('0x30')]['length']?_0x437f52[_0x5adb('0x30')]:_0x5b574c[_0x5adb('0x2c')];if(!_0x5358c0[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x437f52['limit']=qs[_0x5adb('0x12')](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x12')]);_0x437f52[_0x5adb('0x11')]=qs['offset'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x11')]);}_0x437f52[_0x5adb('0x41')]=qs['sort'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x42')]);_0x437f52[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_['pick'](_0x5358c0[_0x5adb('0x28')],_0x5b574c[_0x5adb('0x2e')]));_0x437f52[_0x5adb('0x25')][_0x5adb('0x43')]=_0x39840e['id'];if(_0x5358c0[_0x5adb('0x28')]['filter']){_0x437f52[_0x5adb('0x25')]=_['merge'](_0x437f52[_0x5adb('0x25')],{'$or':_['map'](_0x437f52[_0x5adb('0x30')],function(_0x35df22){var _0x1a9358={};_0x1a9358[_0x35df22]={'$like':'%'+_0x5358c0[_0x5adb('0x28')]['filter']+'%'};return _0x1a9358;})});}_0x437f52=_[_0x5adb('0x44')]({},_0x437f52,_0x5358c0[_0x5adb('0x33')]);return db[_0x5adb('0x45')]['findAll'](_0x437f52);}})['then'](function(_0x4ddfdf){if(_0x4ddfdf){return db[_0x5adb('0x46')][_0x5adb('0x47')]({'where':{'id':_[_0x5adb('0x48')](_0x4ddfdf,_0x5adb('0x49')),'role':_0x5adb('0x4a')},'attributes':['id',_0x5adb('0x1d'),_0x5adb('0x4b'),_0x5adb('0x4c'),_0x5adb('0x4d')]});}})[_0x5adb('0x17')](function(_0x452767){if(_0x452767){return{'count':_0x452767[_0x5adb('0x26')],'rows':_[_0x5adb('0x48')](_0x452767['rows'],function(_0x49f4c8){return{'membername':_0x49f4c8[_0x5adb('0x1d')],'UserId':_0x49f4c8['id'],'queue_name':_0x7786c4[_0x5adb('0x1d')],'SmsQueueId':_0x7786c4['id'],'interface':util[_0x5adb('0x4e')](_0x5adb('0x4f'),'SIP',_0x49f4c8[_0x5adb('0x1d')]),'penalty':0x0,'paused':_0x49f4c8[_0x5adb('0x4b')],'createdAt':_0x49f4c8['createdAt'],'updatedAt':_0x49f4c8[_0x5adb('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5adb('0x17')](respondWithFilteredResult(_0x182cbc,_0x437f52))[_0x5adb('0x2a')](handleError(_0x182cbc,null));};exports['getTeams']=function(_0x30d185,_0x409357){var _0x19df2f={};var _0x30c92c={};var _0x330290;var _0x428019;return db['SmsQueue'][_0x5adb('0x3d')]({'where':{'id':_0x30d185[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x409357,null))['then'](function(_0xcd71d2){if(_0xcd71d2){_0x330290=_0xcd71d2;_0x30c92c[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](db['Team'][_0x5adb('0x21')]);_0x30c92c['query']=_[_0x5adb('0x2d')](_0x30d185[_0x5adb('0x28')]);_0x30c92c[_0x5adb('0x2e')]=_['intersection'](_0x30c92c[_0x5adb('0x2c')],_0x30c92c[_0x5adb('0x28')]);_0x19df2f['attributes']=_[_0x5adb('0x3e')](_0x30c92c[_0x5adb('0x2c')],qs[_0x5adb('0x2f')](_0x30d185[_0x5adb('0x28')]['fields']));_0x19df2f[_0x5adb('0x30')]=_0x19df2f[_0x5adb('0x30')][_0x5adb('0x31')]?_0x19df2f[_0x5adb('0x30')]:_0x30c92c['model'];_0x19df2f['order']=qs[_0x5adb('0x42')](_0x30d185['query']['sort']);_0x19df2f['where']=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0x30d185['query'],_0x30c92c[_0x5adb('0x2e')]));if(_0x30d185[_0x5adb('0x28')][_0x5adb('0x51')]){_0x19df2f[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x19df2f[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x19df2f[_0x5adb('0x30')],function(_0x5240c1){var _0x4b9e80={};_0x4b9e80[_0x5240c1]={'$like':'%'+_0x30d185['query'][_0x5adb('0x51')]+'%'};return _0x4b9e80;})});}_0x19df2f=_[_0x5adb('0x44')]({},_0x19df2f,_0x30d185[_0x5adb('0x33')]);return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x2f6ef7){if(_0x2f6ef7){_0x428019=_0x2f6ef7[_0x5adb('0x31')];if(!_0x30d185[_0x5adb('0x28')]['hasOwnProperty']('nolimit')){_0x19df2f[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x12')]);_0x19df2f[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x484f3d){if(_0x484f3d){return _0x484f3d?{'count':_0x428019,'rows':_0x484f3d}:null;}})[_0x5adb('0x17')](respondWithResult(_0x409357,null))[_0x5adb('0x2a')](handleError(_0x409357,null));};exports[_0x5adb('0x53')]=function(_0x5d3aa4,_0x31f041){var _0xa1bd33=_0x5d3aa4['body'][_0x5adb('0x54')];return db['Team'][_0x5adb('0x55')]({'where':{'id':_0xa1bd33},'attributes':['id'],'include':[{'model':db[_0x5adb('0x46')],'as':'Agents','attributes':['id',_0x5adb('0x1d'),_0x5adb('0x56'),_0x5adb('0x57'),_0x5adb('0x58')],'raw':!![]}]})[_0x5adb('0x17')](function(_0x10f54a){if(_0x10f54a){var _0x3cee6c=_[_0x5adb('0x59')](_0x10f54a,function(_0x49a8a6){var _0x3786b4=_0x49a8a6[_0x5adb('0x36')]({'plain':!![]});return _0x3786b4[_0x5adb('0x5a')];});return db['SmsQueue']['find']({'where':{'id':_0x5d3aa4[_0x5adb('0x3a')]['id']}})['then'](function(_0x27d3d8){return db[_0x5adb('0x5b')][_0x5adb('0x5c')](function(_0x50600f){return _0x27d3d8[_0x5adb('0x53')](_0xa1bd33,{'transaction':_0x50600f})[_0x5adb('0x17')](function(){return BPromise[_0x5adb('0x5d')](_0x3cee6c,function(_0x3ecc56){return db[_0x5adb('0x45')]['findOrCreate']({'where':{'UserId':_0x3ecc56['id'],'SmsQueueId':_0x5d3aa4[_0x5adb('0x3a')]['id']},'transaction':_0x50600f});});})[_0x5adb('0x17')](function(){_0x3cee6c[_0x5adb('0x5e')](function(_0xe3d12d){socket['emit'](_0x5adb('0x5f'),{'UserId':_0xe3d12d['id'],'SmsQueueId':_0x27d3d8['id']});});});});});}})[_0x5adb('0x17')](respondWithStatusCode(_0x31f041,null))[_0x5adb('0x2a')](handleError(_0x31f041,null));};exports[_0x5adb('0x60')]=function(_0x15d4f1,_0x20faf6){return db[_0x5adb('0x61')]['findAll']({'where':{'id':_0x15d4f1[_0x5adb('0x28')][_0x5adb('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5adb('0x5a'),'attributes':['id'],'raw':!![]}]})[_0x5adb('0x17')](handleEntityNotFound(_0x20faf6,null))['then'](function(_0x462fa0){var _0x50f8ed=_[_0x5adb('0x48')](_0x462fa0,'id');var _0x268df2=[];var _0x4a2ebc=[];var _0x167432=squel['select']();_0x167432[_0x5adb('0x62')](_0x5adb('0x63'))[_0x5adb('0x64')](_0x5adb('0x65'),'tq')[_0x5adb('0x66')]('user_has_teams','ut',_0x5adb('0x67'))[_0x5adb('0x25')](_0x5adb('0x68'),_0x15d4f1[_0x5adb('0x3a')]['id']);for(var _0x47c631=0x0;_0x47c631<_0x462fa0['length'];_0x47c631+=0x1){let _0x3f3db9=_0x462fa0[_0x47c631];for(var _0x461a07=0x0;_0x461a07<_0x3f3db9[_0x5adb('0x5a')][_0x5adb('0x31')];_0x461a07+=0x1){let _0x277668=_0x3f3db9[_0x5adb('0x5a')][_0x461a07];var _0x31f5b2=_0x167432['clone']();_0x31f5b2[_0x5adb('0x25')](_0x5adb('0x69'),_0x277668['id']);_0x4a2ebc[_0x5adb('0x6a')](db[_0x5adb('0x5b')]['query'](_0x31f5b2[_0x5adb('0x6b')](),{'type':db[_0x5adb('0x5b')][_0x5adb('0x6c')][_0x5adb('0x6d')]})[_0x5adb('0x17')](function(_0x188cbd){if(_0x188cbd[_0x5adb('0x31')]===0x1){return _0x277668['id'];}else{var _0x2d1b65=_[_0x5adb('0x6e')](_['map'](_0x188cbd,_0x5adb('0x6f')),function(_0x456799){return _['includes'](_0x50f8ed,_0x456799);});if(_0x2d1b65){return _0x277668['id'];}}}));}}return BPromise[_0x5adb('0x70')](_0x4a2ebc)[_0x5adb('0x17')](function(_0x2b8915){_0x268df2=_(_0x268df2)[_0x5adb('0x71')](_0x2b8915)[_0x5adb('0x72')]()[_0x5adb('0x73')]();return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x15d4f1['params']['id']}})[_0x5adb('0x17')](function(_0x2386c0){return db['sequelize'][_0x5adb('0x5c')](function(_0x58a26f){return _0x2386c0[_0x5adb('0x60')](_0x15d4f1['query']['ids'],{'transaction':_0x58a26f})[_0x5adb('0x17')](function(){if(!_[_0x5adb('0x75')](_0x268df2)){return _0x2386c0[_0x5adb('0x76')](_0x268df2,{'transaction':_0x58a26f});}})['then'](function(){_0x268df2[_0x5adb('0x5e')](function(_0x321c3a){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':_0x321c3a,'SmsQueueId':_0x2386c0['id']});});});});});});})[_0x5adb('0x17')](respondWithStatusCode(_0x20faf6,null))[_0x5adb('0x2a')](handleError(_0x20faf6,null));};exports[_0x5adb('0x79')]=function(_0x463e84,_0x28bd33){return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x463e84[_0x5adb('0x3a')]['id']}})['then'](handleEntityNotFound(_0x28bd33,null))['then'](function(_0x312463){if(_0x312463){return _0x312463[_0x5adb('0x79')](_0x463e84['body'][_0x5adb('0x54')],_[_0x5adb('0x7a')](_0x463e84[_0x5adb('0x39')],[_0x5adb('0x54'),'id'])||{})[_0x5adb('0x7b')](function(_0x24cd3b){for(var _0x15626b=0x0;_0x15626b<_0x463e84[_0x5adb('0x39')][_0x5adb('0x54')]['length'];_0x15626b+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x5f'),{'UserId':Number(_0x463e84[_0x5adb('0x39')]['ids'][_0x15626b]),'SmsQueueId':Number(_0x463e84[_0x5adb('0x3a')]['id'])});}return _0x24cd3b;});}})[_0x5adb('0x17')](respondWithResult(_0x28bd33,null))[_0x5adb('0x2a')](handleError(_0x28bd33,null));};exports[_0x5adb('0x76')]=function(_0x64475f,_0x2a78f9){return db['SmsQueue'][_0x5adb('0x74')]({'where':{'id':_0x64475f[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x2a78f9,null))[_0x5adb('0x17')](function(_0x2c3af8){if(_0x2c3af8){return _0x2c3af8[_0x5adb('0x76')](_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')])[_0x5adb('0x17')](function(){if(_[_0x5adb('0x7c')](_0x64475f['query'][_0x5adb('0x54')])){for(var _0x5b9565=0x0;_0x5b9565<_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')][_0x5adb('0x31')];_0x5b9565+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f['query']['ids'][_0x5b9565]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}}else{socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a78f9,null))['catch'](handleError(_0x2a78f9,null));};exports[_0x5adb('0x7d')]=function(_0xd5b95d,_0x9d80fd){var _0x4f5721={};var _0x542626={};var _0x227c17;var _0x5982a5;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0xd5b95d['params']['id']}})['then'](handleEntityNotFound(_0x9d80fd,null))[_0x5adb('0x17')](function(_0x4bb198){if(_0x4bb198){_0x227c17=_0x4bb198;_0x542626['model']=_[_0x5adb('0x2d')](db[_0x5adb('0x46')][_0x5adb('0x21')]);_0x542626[_0x5adb('0x28')]=_[_0x5adb('0x2d')](_0xd5b95d[_0x5adb('0x28')]);_0x542626[_0x5adb('0x2e')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],_0x542626[_0x5adb('0x28')]);_0x4f5721[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],qs['fields'](_0xd5b95d[_0x5adb('0x28')]['fields']));_0x4f5721[_0x5adb('0x30')]=_0x4f5721[_0x5adb('0x30')][_0x5adb('0x31')]?_0x4f5721[_0x5adb('0x30')]:_0x542626[_0x5adb('0x2c')];_0x4f5721[_0x5adb('0x41')]=qs[_0x5adb('0x42')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x42')]);_0x4f5721[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0xd5b95d['query'],_0x542626[_0x5adb('0x2e')]));if(_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]){_0x4f5721[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x4f5721[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x4f5721[_0x5adb('0x30')],function(_0x57c160){var _0xe7ddc4={};_0xe7ddc4[_0x57c160]={'$like':'%'+_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]+'%'};return _0xe7ddc4;})});}_0x4f5721=_['merge']({},_0x4f5721,_0xd5b95d[_0x5adb('0x33')]);return _0x227c17['getAgents'](_0x4f5721);}})[_0x5adb('0x17')](function(_0x50c3a3){if(_0x50c3a3){_0x5982a5=_0x50c3a3['length'];if(!_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x4f5721[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x12')]);_0x4f5721[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x227c17[_0x5adb('0x7d')](_0x4f5721);}})['then'](function(_0x364da7){if(_0x364da7){return _0x364da7?{'count':_0x5982a5,'rows':_0x364da7}:null;}})['then'](respondWithResult(_0x9d80fd,null))[_0x5adb('0x2a')](handleError(_0x9d80fd,null));}; \ No newline at end of file +var _0x2ef3=['intersection','attributes','model','fields','length','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','update','describe','getMembers','findOne','UserSmsQueue','filters','hasOwnProperty','order','sort','pick','SmsQueueId','filter','User','findAndCountAll','agent','updatedAt','createdAt','SIP','getTeams','Team','nolimit','addTeams','ids','online','voicePause','flatMap','each','findOrCreate','removeTeams','Agents','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','QueryTypes','TeamId','union','compact','value','transaction','isEmpty','emit','addAgents','spread','userSmsQueue:save','removeAgents','isArray','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','then','destroy','get','SmsQueues','UserProfileResource','name','map','SmsQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys'];(function(_0x2f3a38,_0x34a991){var _0x5c0b66=function(_0x492fe4){while(--_0x492fe4){_0x2f3a38['push'](_0x2f3a38['shift']());}};_0x5c0b66(++_0x34a991);}(_0x2ef3,0xba));var _0x32ef=function(_0x274160,_0x36c19e){_0x274160=_0x274160-0x0;var _0x4383c0=_0x2ef3[_0x274160];return _0x4383c0;};'use strict';var BPromise=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));var squel=require(_0x32ef('0x3'));var Redis=require(_0x32ef('0x4'));var qs=require(_0x32ef('0x5'));var logger=require('../../config/logger')(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var db=require('../../mysqldb')['db'];config[_0x32ef('0x8')]=_[_0x32ef('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x32ef('0xa'))(new Redis(config[_0x32ef('0x8')]));require(_0x32ef('0xb'))[_0x32ef('0xc')](socket);function respondWithStatusCode(_0x234863,_0x298066){_0x298066=_0x298066||0xcc;return function(_0x2484a0){if(_0x2484a0){return _0x234863[_0x32ef('0xd')](_0x298066);}return _0x234863[_0x32ef('0xe')](_0x298066)[_0x32ef('0xf')]();};}function respondWithResult(_0x56eb42,_0x5780e9){_0x5780e9=_0x5780e9||0xc8;return function(_0x401d0b){if(_0x401d0b){return _0x56eb42[_0x32ef('0xe')](_0x5780e9)[_0x32ef('0x10')](_0x401d0b);}};}function respondWithFilteredResult(_0x1499c2,_0x5af651){return function(_0x193714){if(_0x193714){var _0x5afcc2=typeof _0x5af651[_0x32ef('0x11')]==='undefined'&&typeof _0x5af651[_0x32ef('0x12')]===_0x32ef('0x13');var _0x5c3eb9=_0x193714['count'];var _0x19ce1=_0x5afcc2?0x0:_0x5af651['offset'];var _0x326fce=_0x5afcc2?_0x193714[_0x32ef('0x14')]:_0x5af651[_0x32ef('0x11')]+_0x5af651[_0x32ef('0x12')];var _0x57aff1;if(_0x326fce>=_0x5c3eb9){_0x326fce=_0x5c3eb9;_0x57aff1=0xc8;}else{_0x57aff1=0xce;}_0x1499c2['status'](_0x57aff1);return _0x1499c2['set'](_0x32ef('0x15'),_0x19ce1+'-'+_0x326fce+'/'+_0x5c3eb9)[_0x32ef('0x10')](_0x193714);}return null;};}function saveUpdates(_0xb5aed2){return function(_0x53a5ca){if(_0x53a5ca){return _0x53a5ca['update'](_0xb5aed2)[_0x32ef('0x16')](function(_0x1a9476){return _0x1a9476;});}return null;};}function removeEntity(_0x286bfb){return function(_0x57863c){if(_0x57863c){return _0x57863c[_0x32ef('0x17')]()[_0x32ef('0x16')](function(){var _0x4f4c98=_0x57863c[_0x32ef('0x18')]({'plain':!![]});var _0x314ef1=_0x32ef('0x19');return db[_0x32ef('0x1a')][_0x32ef('0x17')]({'where':{'type':_0x314ef1,'resourceId':_0x4f4c98['id']}})[_0x32ef('0x16')](function(){return _0x57863c;});})['then'](function(){_0x286bfb[_0x32ef('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309866){return function(_0x3a20ca){if(!_0x3a20ca){_0x309866['sendStatus'](0x194);}return _0x3a20ca;};}function handleError(_0x1af371,_0x97780){_0x97780=_0x97780||0x1f4;return function(_0x5e8898){logger['error'](_0x5e8898['stack']);if(_0x5e8898[_0x32ef('0x1b')]){delete _0x5e8898[_0x32ef('0x1b')];}_0x1af371[_0x32ef('0xe')](_0x97780)['send'](_0x5e8898);};}exports['index']=function(_0x19ea6,_0x4d584b){var _0x51a412={};var _0x278495={'count':0x0,'rows':[]};var _0x14d4b3=_[_0x32ef('0x1c')](db[_0x32ef('0x1d')][_0x32ef('0x1e')],function(_0x234175){return{'name':_0x234175[_0x32ef('0x1f')],'type':_0x234175[_0x32ef('0x20')][_0x32ef('0x21')]};});_0x51a412=qs[_0x32ef('0x22')](_0x14d4b3,_0x19ea6);var _0x1335e2={'where':_0x51a412[_0x32ef('0x23')]};return db['SmsQueue'][_0x32ef('0x14')](_0x1335e2)[_0x32ef('0x16')](function(_0x5a04cd){_0x278495[_0x32ef('0x14')]=_0x5a04cd;_0x51a412[_0x32ef('0x24')]=qs[_0x32ef('0x24')](_0x19ea6[_0x32ef('0x25')]);return db['SmsQueue'][_0x32ef('0x26')](_0x51a412);})[_0x32ef('0x16')](function(_0x31dbc3){_0x278495[_0x32ef('0x27')]=_0x31dbc3;return _0x278495;})[_0x32ef('0x16')](respondWithFilteredResult(_0x4d584b,_0x51a412))[_0x32ef('0x28')](handleError(_0x4d584b,null));};exports[_0x32ef('0x29')]=function(_0x575f3e,_0x36ac37){var _0x537214={'raw':!![],'where':{'id':_0x575f3e[_0x32ef('0x2a')]['id']}},_0x38bf73={};_0x38bf73['model']=_[_0x32ef('0x2b')](db[_0x32ef('0x1d')][_0x32ef('0x1e')]);_0x38bf73[_0x32ef('0x25')]=_[_0x32ef('0x2b')](_0x575f3e['query']);_0x38bf73['filters']=_[_0x32ef('0x2c')](_0x38bf73['model'],_0x38bf73[_0x32ef('0x25')]);_0x537214[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x38bf73[_0x32ef('0x2e')],qs[_0x32ef('0x2f')](_0x575f3e[_0x32ef('0x25')]['fields']));_0x537214['attributes']=_0x537214['attributes'][_0x32ef('0x30')]?_0x537214[_0x32ef('0x2d')]:_0x38bf73[_0x32ef('0x2e')];if(_0x575f3e['query']['includeAll']){_0x537214[_0x32ef('0x24')]=[{'all':!![]}];}_0x537214=_[_0x32ef('0x31')]({},_0x537214,_0x575f3e[_0x32ef('0x32')]);return db['SmsQueue']['find'](_0x537214)[_0x32ef('0x16')](handleEntityNotFound(_0x36ac37,null))[_0x32ef('0x16')](respondWithResult(_0x36ac37,null))[_0x32ef('0x28')](handleError(_0x36ac37,null));};exports[_0x32ef('0x33')]=function(_0x3a7c49,_0x211c79){return db[_0x32ef('0x1d')][_0x32ef('0x33')](_0x3a7c49[_0x32ef('0x34')],{})['then'](function(_0x3a4a99){var _0x36e374=_0x3a7c49[_0x32ef('0x35')]['get']({'plain':!![]});if(!_0x36e374)throw new Error(_0x32ef('0x36'));if(_0x36e374[_0x32ef('0x37')]===_0x32ef('0x35')){var _0x393a89=_0x3a4a99[_0x32ef('0x18')]({'plain':!![]});var _0x33a0fb=_0x32ef('0x19');return db[_0x32ef('0x38')][_0x32ef('0x39')]({'where':{'name':_0x33a0fb,'userProfileId':_0x36e374[_0x32ef('0x3a')]},'raw':!![]})[_0x32ef('0x16')](function(_0x4615b4){if(_0x4615b4&&_0x4615b4['autoAssociation']===0x0){return db[_0x32ef('0x1a')][_0x32ef('0x33')]({'name':_0x393a89[_0x32ef('0x1b')],'resourceId':_0x393a89['id'],'type':_0x4615b4[_0x32ef('0x1b')],'sectionId':_0x4615b4['id']},{})[_0x32ef('0x16')](function(){return _0x3a4a99;});}else{return _0x3a4a99;}})[_0x32ef('0x28')](function(_0x3c0e44){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c0e44);throw _0x3c0e44;});}return _0x3a4a99;})[_0x32ef('0x16')](respondWithResult(_0x211c79,0xc9))[_0x32ef('0x28')](handleError(_0x211c79,null));};exports[_0x32ef('0x3b')]=function(_0x765c63,_0x5dca14){if(_0x765c63[_0x32ef('0x34')]['id']){delete _0x765c63[_0x32ef('0x34')]['id'];}return db['SmsQueue'][_0x32ef('0x39')]({'where':{'id':_0x765c63['params']['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x5dca14,null))[_0x32ef('0x16')](saveUpdates(_0x765c63[_0x32ef('0x34')],null))[_0x32ef('0x16')](respondWithResult(_0x5dca14,null))[_0x32ef('0x28')](handleError(_0x5dca14,null));};exports[_0x32ef('0x17')]=function(_0x321ef7,_0x3d35a1){return db[_0x32ef('0x1d')][_0x32ef('0x39')]({'where':{'id':_0x321ef7['params']['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x3d35a1,null))['then'](removeEntity(_0x3d35a1,null))[_0x32ef('0x28')](handleError(_0x3d35a1,null));};exports[_0x32ef('0x3c')]=function(_0x2dd94f,_0x4d8393){return db[_0x32ef('0x1d')][_0x32ef('0x3c')]()[_0x32ef('0x16')](respondWithResult(_0x4d8393,null))[_0x32ef('0x28')](handleError(_0x4d8393,null));};exports[_0x32ef('0x3d')]=function(_0x40bf12,_0x12c9e6){var _0x47dbe1={'raw':!![],'where':{}},_0x5cb6fc={},_0x36252c;return db[_0x32ef('0x1d')][_0x32ef('0x3e')]({'where':{'id':_0x40bf12[_0x32ef('0x2a')]['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x12c9e6,null))[_0x32ef('0x16')](function(_0x44ad11){if(_0x44ad11){_0x36252c=_0x44ad11[_0x32ef('0x18')]({'plain':!![]});_0x5cb6fc[_0x32ef('0x2e')]=_[_0x32ef('0x2b')](db[_0x32ef('0x3f')][_0x32ef('0x1e')]);_0x5cb6fc[_0x32ef('0x25')]=_['keys'](_0x40bf12[_0x32ef('0x25')]);_0x5cb6fc[_0x32ef('0x40')]=_[_0x32ef('0x2c')](_0x5cb6fc[_0x32ef('0x2e')],_0x5cb6fc[_0x32ef('0x25')]);_0x47dbe1[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x5cb6fc[_0x32ef('0x2e')],qs[_0x32ef('0x2f')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x2f')]));_0x47dbe1[_0x32ef('0x2d')]=_0x47dbe1[_0x32ef('0x2d')][_0x32ef('0x30')]?_0x47dbe1[_0x32ef('0x2d')]:_0x5cb6fc[_0x32ef('0x2e')];if(!_0x40bf12[_0x32ef('0x25')][_0x32ef('0x41')]('nolimit')){_0x47dbe1['limit']=qs[_0x32ef('0x12')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x12')]);_0x47dbe1[_0x32ef('0x11')]=qs[_0x32ef('0x11')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x11')]);}_0x47dbe1[_0x32ef('0x42')]=qs[_0x32ef('0x43')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x43')]);_0x47dbe1['where']=qs[_0x32ef('0x40')](_[_0x32ef('0x44')](_0x40bf12[_0x32ef('0x25')],_0x5cb6fc[_0x32ef('0x40')]));_0x47dbe1[_0x32ef('0x23')][_0x32ef('0x45')]=_0x44ad11['id'];if(_0x40bf12['query'][_0x32ef('0x46')]){_0x47dbe1[_0x32ef('0x23')]=_[_0x32ef('0x31')](_0x47dbe1['where'],{'$or':_[_0x32ef('0x1c')](_0x47dbe1['attributes'],function(_0x2ee3dd){var _0xbe35b={};_0xbe35b[_0x2ee3dd]={'$like':'%'+_0x40bf12['query'][_0x32ef('0x46')]+'%'};return _0xbe35b;})});}_0x47dbe1=_['merge']({},_0x47dbe1,_0x40bf12[_0x32ef('0x32')]);return db[_0x32ef('0x3f')][_0x32ef('0x26')](_0x47dbe1);}})[_0x32ef('0x16')](function(_0x2c7bee){if(_0x2c7bee){return db[_0x32ef('0x47')][_0x32ef('0x48')]({'where':{'id':_['map'](_0x2c7bee,'UserId'),'role':_0x32ef('0x49')},'attributes':['id','name','smsPause',_0x32ef('0x4a'),_0x32ef('0x4b')]});}})[_0x32ef('0x16')](function(_0x6aae59){if(_0x6aae59){return{'count':_0x6aae59[_0x32ef('0x14')],'rows':_[_0x32ef('0x1c')](_0x6aae59[_0x32ef('0x27')],function(_0x4249c3){return{'membername':_0x4249c3[_0x32ef('0x1b')],'UserId':_0x4249c3['id'],'queue_name':_0x36252c[_0x32ef('0x1b')],'SmsQueueId':_0x36252c['id'],'interface':util['format']('%s/%s',_0x32ef('0x4c'),_0x4249c3[_0x32ef('0x1b')]),'penalty':0x0,'paused':_0x4249c3['smsPause'],'createdAt':_0x4249c3[_0x32ef('0x4b')],'updatedAt':_0x4249c3[_0x32ef('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x32ef('0x16')](respondWithFilteredResult(_0x12c9e6,_0x47dbe1))['catch'](handleError(_0x12c9e6,null));};exports[_0x32ef('0x4d')]=function(_0x3c31d0,_0x20dcc5){var _0x52dfe0={};var _0x5e6030={};var _0x13ea1a;var _0x47d8bf;return db[_0x32ef('0x1d')]['findOne']({'where':{'id':_0x3c31d0['params']['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x20dcc5,null))[_0x32ef('0x16')](function(_0x10cb37){if(_0x10cb37){_0x13ea1a=_0x10cb37;_0x5e6030['model']=_[_0x32ef('0x2b')](db[_0x32ef('0x4e')][_0x32ef('0x1e')]);_0x5e6030['query']=_[_0x32ef('0x2b')](_0x3c31d0[_0x32ef('0x25')]);_0x5e6030['filters']=_['intersection'](_0x5e6030[_0x32ef('0x2e')],_0x5e6030[_0x32ef('0x25')]);_0x52dfe0[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x5e6030[_0x32ef('0x2e')],qs[_0x32ef('0x2f')](_0x3c31d0['query'][_0x32ef('0x2f')]));_0x52dfe0[_0x32ef('0x2d')]=_0x52dfe0[_0x32ef('0x2d')][_0x32ef('0x30')]?_0x52dfe0[_0x32ef('0x2d')]:_0x5e6030[_0x32ef('0x2e')];_0x52dfe0[_0x32ef('0x42')]=qs[_0x32ef('0x43')](_0x3c31d0[_0x32ef('0x25')]['sort']);_0x52dfe0[_0x32ef('0x23')]=qs[_0x32ef('0x40')](_[_0x32ef('0x44')](_0x3c31d0[_0x32ef('0x25')],_0x5e6030[_0x32ef('0x40')]));if(_0x3c31d0['query']['filter']){_0x52dfe0[_0x32ef('0x23')]=_[_0x32ef('0x31')](_0x52dfe0[_0x32ef('0x23')],{'$or':_[_0x32ef('0x1c')](_0x52dfe0[_0x32ef('0x2d')],function(_0x526fb1){var _0x3372d9={};_0x3372d9[_0x526fb1]={'$like':'%'+_0x3c31d0['query'][_0x32ef('0x46')]+'%'};return _0x3372d9;})});}_0x52dfe0=_[_0x32ef('0x31')]({},_0x52dfe0,_0x3c31d0['options']);return _0x13ea1a['getTeams'](_0x52dfe0);}})[_0x32ef('0x16')](function(_0x1538d0){if(_0x1538d0){_0x47d8bf=_0x1538d0[_0x32ef('0x30')];if(!_0x3c31d0['query']['hasOwnProperty'](_0x32ef('0x4f'))){_0x52dfe0[_0x32ef('0x12')]=qs[_0x32ef('0x12')](_0x3c31d0[_0x32ef('0x25')]['limit']);_0x52dfe0[_0x32ef('0x11')]=qs[_0x32ef('0x11')](_0x3c31d0[_0x32ef('0x25')][_0x32ef('0x11')]);}return _0x13ea1a[_0x32ef('0x4d')](_0x52dfe0);}})[_0x32ef('0x16')](function(_0x43b176){if(_0x43b176){return _0x43b176?{'count':_0x47d8bf,'rows':_0x43b176}:null;}})[_0x32ef('0x16')](respondWithResult(_0x20dcc5,null))[_0x32ef('0x28')](handleError(_0x20dcc5,null));};exports[_0x32ef('0x50')]=function(_0x132d9f,_0x3978cb){var _0x52b32f=_0x132d9f['body'][_0x32ef('0x51')];return db[_0x32ef('0x4e')]['findAll']({'where':{'id':_0x52b32f},'attributes':['id'],'include':[{'model':db[_0x32ef('0x47')],'as':'Agents','attributes':['id',_0x32ef('0x1b'),_0x32ef('0x52'),_0x32ef('0x53'),'interface'],'raw':!![]}]})[_0x32ef('0x16')](function(_0x4978a6){if(_0x4978a6){var _0x141fec=_[_0x32ef('0x54')](_0x4978a6,function(_0x47e3cc){var _0x4c70e0=_0x47e3cc[_0x32ef('0x18')]({'plain':!![]});return _0x4c70e0['Agents'];});return db[_0x32ef('0x1d')]['find']({'where':{'id':_0x132d9f[_0x32ef('0x2a')]['id']}})[_0x32ef('0x16')](function(_0x1adcb8){return db['sequelize']['transaction'](function(_0x4f1b94){return _0x1adcb8[_0x32ef('0x50')](_0x52b32f,{'transaction':_0x4f1b94})['then'](function(){return BPromise[_0x32ef('0x55')](_0x141fec,function(_0x13a374){return db[_0x32ef('0x3f')][_0x32ef('0x56')]({'where':{'UserId':_0x13a374['id'],'SmsQueueId':_0x132d9f[_0x32ef('0x2a')]['id']},'transaction':_0x4f1b94});});})[_0x32ef('0x16')](function(){_0x141fec['forEach'](function(_0x3d9245){socket['emit']('userSmsQueue:save',{'UserId':_0x3d9245['id'],'SmsQueueId':_0x1adcb8['id']});});});});});}})[_0x32ef('0x16')](respondWithStatusCode(_0x3978cb,null))['catch'](handleError(_0x3978cb,null));};exports[_0x32ef('0x57')]=function(_0x313798,_0x4d64ec){return db[_0x32ef('0x4e')][_0x32ef('0x26')]({'where':{'id':_0x313798[_0x32ef('0x25')][_0x32ef('0x51')]},'attributes':['id'],'include':[{'model':db[_0x32ef('0x47')],'as':_0x32ef('0x58'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4d64ec,null))['then'](function(_0x35b10d){var _0x5e0b55=_[_0x32ef('0x1c')](_0x35b10d,'id');var _0x266688=[];var _0x114d8e=[];var _0x1782a5=squel[_0x32ef('0x59')]();_0x1782a5[_0x32ef('0x5a')]('tq.TeamId')[_0x32ef('0x5b')](_0x32ef('0x5c'),'tq')[_0x32ef('0x5d')](_0x32ef('0x5e'),'ut',_0x32ef('0x5f'))['where']('SmsQueueId\x20=\x20?',_0x313798[_0x32ef('0x2a')]['id']);for(var _0x904a4f=0x0;_0x904a4f<_0x35b10d['length'];_0x904a4f+=0x1){let _0x211fb1=_0x35b10d[_0x904a4f];for(var _0x2e333d=0x0;_0x2e333d<_0x211fb1[_0x32ef('0x58')][_0x32ef('0x30')];_0x2e333d+=0x1){let _0xc3664d=_0x211fb1[_0x32ef('0x58')][_0x2e333d];var _0xfb4845=_0x1782a5[_0x32ef('0x60')]();_0xfb4845[_0x32ef('0x23')]('ut.UserId\x20=\x20?',_0xc3664d['id']);_0x114d8e[_0x32ef('0x61')](db[_0x32ef('0x62')]['query'](_0xfb4845[_0x32ef('0x63')](),{'type':db['sequelize'][_0x32ef('0x64')]['SELECT']})[_0x32ef('0x16')](function(_0x39300f){if(_0x39300f[_0x32ef('0x30')]===0x1){return _0xc3664d['id'];}else{var _0x3e000c=_['every'](_[_0x32ef('0x1c')](_0x39300f,_0x32ef('0x65')),function(_0x31f99f){return _['includes'](_0x5e0b55,_0x31f99f);});if(_0x3e000c){return _0xc3664d['id'];}}}));}}return BPromise['all'](_0x114d8e)['then'](function(_0x1aff33){_0x266688=_(_0x266688)[_0x32ef('0x66')](_0x1aff33)[_0x32ef('0x67')]()[_0x32ef('0x68')]();return db[_0x32ef('0x1d')]['find']({'where':{'id':_0x313798[_0x32ef('0x2a')]['id']}})['then'](function(_0x471de6){return db[_0x32ef('0x62')][_0x32ef('0x69')](function(_0x4baa7a){return _0x471de6[_0x32ef('0x57')](_0x313798[_0x32ef('0x25')][_0x32ef('0x51')],{'transaction':_0x4baa7a})[_0x32ef('0x16')](function(){if(!_[_0x32ef('0x6a')](_0x266688)){return _0x471de6['removeAgents'](_0x266688,{'transaction':_0x4baa7a});}})[_0x32ef('0x16')](function(){_0x266688['forEach'](function(_0x4f0433){socket[_0x32ef('0x6b')]('userSmsQueue:remove',{'UserId':_0x4f0433,'SmsQueueId':_0x471de6['id']});});});});});});})['then'](respondWithStatusCode(_0x4d64ec,null))[_0x32ef('0x28')](handleError(_0x4d64ec,null));};exports[_0x32ef('0x6c')]=function(_0xf6bc02,_0x3b9896){return db['SmsQueue'][_0x32ef('0x39')]({'where':{'id':_0xf6bc02['params']['id']}})['then'](handleEntityNotFound(_0x3b9896,null))[_0x32ef('0x16')](function(_0x56aede){if(_0x56aede){return _0x56aede[_0x32ef('0x6c')](_0xf6bc02[_0x32ef('0x34')][_0x32ef('0x51')],_['omit'](_0xf6bc02['body'],[_0x32ef('0x51'),'id'])||{})[_0x32ef('0x6d')](function(_0x2c4a3c){for(var _0x3741f8=0x0;_0x3741f8<_0xf6bc02[_0x32ef('0x34')][_0x32ef('0x51')][_0x32ef('0x30')];_0x3741f8+=0x1){socket['emit'](_0x32ef('0x6e'),{'UserId':Number(_0xf6bc02[_0x32ef('0x34')][_0x32ef('0x51')][_0x3741f8]),'SmsQueueId':Number(_0xf6bc02[_0x32ef('0x2a')]['id'])});}return _0x2c4a3c;});}})['then'](respondWithResult(_0x3b9896,null))['catch'](handleError(_0x3b9896,null));};exports[_0x32ef('0x6f')]=function(_0x5eb320,_0x116951){return db[_0x32ef('0x1d')]['find']({'where':{'id':_0x5eb320['params']['id']}})['then'](handleEntityNotFound(_0x116951,null))[_0x32ef('0x16')](function(_0x33f6c3){if(_0x33f6c3){return _0x33f6c3[_0x32ef('0x6f')](_0x5eb320[_0x32ef('0x25')]['ids'])[_0x32ef('0x16')](function(){if(_[_0x32ef('0x70')](_0x5eb320[_0x32ef('0x25')]['ids'])){for(var _0x2895ad=0x0;_0x2895ad<_0x5eb320['query'][_0x32ef('0x51')][_0x32ef('0x30')];_0x2895ad+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x5eb320[_0x32ef('0x25')][_0x32ef('0x51')][_0x2895ad]),'SmsQueueId':Number(_0x5eb320[_0x32ef('0x2a')]['id'])});}}else{socket[_0x32ef('0x6b')](_0x32ef('0x71'),{'UserId':Number(_0x5eb320[_0x32ef('0x25')][_0x32ef('0x51')]),'SmsQueueId':Number(_0x5eb320[_0x32ef('0x2a')]['id'])});}});}})[_0x32ef('0x16')](respondWithStatusCode(_0x116951,null))['catch'](handleError(_0x116951,null));};exports[_0x32ef('0x72')]=function(_0x583290,_0x22d657){var _0x7e47b9={};var _0x1d9d57={};var _0x18cf5d;var _0x102f2f;return db['SmsQueue'][_0x32ef('0x3e')]({'where':{'id':_0x583290[_0x32ef('0x2a')]['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x22d657,null))[_0x32ef('0x16')](function(_0x1db74d){if(_0x1db74d){_0x18cf5d=_0x1db74d;_0x1d9d57[_0x32ef('0x2e')]=_[_0x32ef('0x2b')](db[_0x32ef('0x47')][_0x32ef('0x1e')]);_0x1d9d57['query']=_['keys'](_0x583290['query']);_0x1d9d57[_0x32ef('0x40')]=_[_0x32ef('0x2c')](_0x1d9d57['model'],_0x1d9d57[_0x32ef('0x25')]);_0x7e47b9['attributes']=_[_0x32ef('0x2c')](_0x1d9d57['model'],qs['fields'](_0x583290[_0x32ef('0x25')][_0x32ef('0x2f')]));_0x7e47b9[_0x32ef('0x2d')]=_0x7e47b9[_0x32ef('0x2d')][_0x32ef('0x30')]?_0x7e47b9['attributes']:_0x1d9d57[_0x32ef('0x2e')];_0x7e47b9['order']=qs[_0x32ef('0x43')](_0x583290['query']['sort']);_0x7e47b9['where']=qs['filters'](_['pick'](_0x583290[_0x32ef('0x25')],_0x1d9d57[_0x32ef('0x40')]));if(_0x583290['query'][_0x32ef('0x46')]){_0x7e47b9[_0x32ef('0x23')]=_[_0x32ef('0x31')](_0x7e47b9[_0x32ef('0x23')],{'$or':_[_0x32ef('0x1c')](_0x7e47b9[_0x32ef('0x2d')],function(_0x59f0aa){var _0x2ac861={};_0x2ac861[_0x59f0aa]={'$like':'%'+_0x583290['query'][_0x32ef('0x46')]+'%'};return _0x2ac861;})});}_0x7e47b9=_[_0x32ef('0x31')]({},_0x7e47b9,_0x583290['options']);return _0x18cf5d[_0x32ef('0x72')](_0x7e47b9);}})['then'](function(_0x4557b0){if(_0x4557b0){_0x102f2f=_0x4557b0[_0x32ef('0x30')];if(!_0x583290[_0x32ef('0x25')][_0x32ef('0x41')]('nolimit')){_0x7e47b9[_0x32ef('0x12')]=qs[_0x32ef('0x12')](_0x583290[_0x32ef('0x25')][_0x32ef('0x12')]);_0x7e47b9['offset']=qs[_0x32ef('0x11')](_0x583290['query'][_0x32ef('0x11')]);}return _0x18cf5d[_0x32ef('0x72')](_0x7e47b9);}})[_0x32ef('0x16')](function(_0x28ef17){if(_0x28ef17){return _0x28ef17?{'count':_0x102f2f,'rows':_0x28ef17}:null;}})[_0x32ef('0x16')](respondWithResult(_0x22d657,null))[_0x32ef('0x28')](handleError(_0x22d657,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index f29e325..793b0b5 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 _0xbed1=['exports','events','SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbed1,0xac));var _0x1bed=function(_0x219d87,_0x1cb6f7){_0x219d87=_0x219d87-0x0;var _0x22823d=_0xbed1[_0x219d87];return _0x22823d;};'use strict';var EventEmitter=require(_0x1bed('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x1bed('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1bed('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1bed('0x3'),'afterDestroy':_0x1bed('0x4')};function emitEvent(_0x2767ae){return function(_0x2f287c,_0x35d123,_0x3a344d){SmsQueueEvents[_0x1bed('0x5')](_0x2767ae+':'+_0x2f287c['id'],_0x2f287c);SmsQueueEvents[_0x1bed('0x5')](_0x2767ae,_0x2f287c);_0x3a344d(null);};}for(var e in events){if(events[_0x1bed('0x6')](e)){var event=events[e];SmsQueue[_0x1bed('0x7')](e,emitEvent(event));}}module[_0x1bed('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x85b1=['exports','../../mysqldb','SmsQueue','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x51920f,_0x4755ee){var _0x1b777e=function(_0x37ee9c){while(--_0x37ee9c){_0x51920f['push'](_0x51920f['shift']());}};_0x1b777e(++_0x4755ee);}(_0x85b1,0x1d6));var _0x185b=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x85b1[_0x39e283];return _0x7de89f;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x185b('0x0'))['db'][_0x185b('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x185b('0x2')](0x0);var events={'afterCreate':_0x185b('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x25b9f9){return function(_0x3f4b4f,_0x5c97d2,_0x18715a){SmsQueueEvents[_0x185b('0x4')](_0x25b9f9+':'+_0x3f4b4f['id'],_0x3f4b4f);SmsQueueEvents[_0x185b('0x4')](_0x25b9f9,_0x3f4b4f);_0x18715a(null);};}for(var e in events){if(events[_0x185b('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x185b('0x6')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index c170dad..f9e617b 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 _0x6857=['api','moment','bluebird','rimraf','exports','lodash','util'];(function(_0x27aee9,_0x4df7a2){var _0x46fde5=function(_0x8501c6){while(--_0x8501c6){_0x27aee9['push'](_0x27aee9['shift']());}};_0x46fde5(++_0x4df7a2);}(_0x6857,0x116));var _0x7685=function(_0x5d6db4,_0x5e45fe){_0x5d6db4=_0x5d6db4-0x0;var _0x43d493=_0x6857[_0x5d6db4];return _0x43d493;};'use strict';var _=require(_0x7685('0x0'));var util=require(_0x7685('0x1'));var logger=require('../../config/logger')(_0x7685('0x2'));var moment=require(_0x7685('0x3'));var BPromise=require(_0x7685('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7685('0x5'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x7685('0x6')]=function(_0x2ee48e,_0x4e6c1f){return _0x2ee48e['define']('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x806b=['sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue'];(function(_0x5b0fbe,_0x51bb42){var _0x13f83c=function(_0x502bfb){while(--_0x502bfb){_0x5b0fbe['push'](_0x5b0fbe['shift']());}};_0x13f83c(++_0x51bb42);}(_0x806b,0x90));var _0xb806=function(_0x270ec3,_0x1a6ae2){_0x270ec3=_0x270ec3-0x0;var _0x1cfe2c=_0x806b[_0x270ec3];return _0x1cfe2c;};'use strict';var _=require('lodash');var util=require(_0xb806('0x0'));var logger=require(_0xb806('0x1'))(_0xb806('0x2'));var moment=require(_0xb806('0x3'));var BPromise=require(_0xb806('0x4'));var rp=require(_0xb806('0x5'));var fs=require('fs');var path=require(_0xb806('0x6'));var rimraf=require(_0xb806('0x7'));var config=require(_0xb806('0x8'));var attributes=require(_0xb806('0x9'));module[_0xb806('0xa')]=function(_0x5a07e1,_0x117c96){return _0x5a07e1['define'](_0xb806('0xb'),attributes,{'tableName':_0xb806('0xc'),'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 a778a9d..4d089dd 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 _0xdded=['where','include','map','model','attributes','ShowSmsQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw'];(function(_0x483d1c,_0x3d3094){var _0x28cd6f=function(_0x4a2bff){while(--_0x4a2bff){_0x483d1c['push'](_0x483d1c['shift']());}};_0x28cd6f(++_0x3d3094);}(_0xdded,0x7f));var _0xddde=function(_0x592629,_0x3cd2bb){_0x592629=_0x592629-0x0;var _0x5ccd30=_0xdded[_0x592629];return _0x5ccd30;};'use strict';var _=require(_0xddde('0x0'));var util=require('util');var moment=require(_0xddde('0x1'));var BPromise=require(_0xddde('0x2'));var rs=require(_0xddde('0x3'));var fs=require('fs');var Redis=require(_0xddde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xddde('0x5'));var logger=require('../../config/logger')(_0xddde('0x6'));var config=require(_0xddde('0x7'));var jayson=require(_0xddde('0x8'));var client=jayson[_0xddde('0x9')][_0xddde('0xa')]({'port':0x232a});config[_0xddde('0xb')]=_[_0xddde('0xc')](config[_0xddde('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xddde('0xd'))(new Redis(config[_0xddde('0xb')]));require(_0xddde('0xe'))[_0xddde('0xf')](socket);function respondWithRpcPromise(_0x6bc680,_0x3ec861,_0x309831){return new BPromise(function(_0x24d2f8,_0x35e697){return client[_0xddde('0x10')](_0x6bc680,_0x309831)[_0xddde('0x11')](function(_0x55c83d){logger[_0xddde('0x12')]('SmsQueue,\x20%s,\x20%s',_0x3ec861,'request\x20sent');logger[_0xddde('0x13')](_0xddde('0x14'),_0x3ec861,_0xddde('0x15'),JSON[_0xddde('0x16')](_0x55c83d));if(_0x55c83d[_0xddde('0x17')]){if(_0x55c83d[_0xddde('0x17')][_0xddde('0x18')]===0x1f4){logger[_0xddde('0x17')](_0xddde('0x19'),_0x3ec861,_0x55c83d[_0xddde('0x17')][_0xddde('0x1a')]);return _0x35e697(_0x55c83d[_0xddde('0x17')][_0xddde('0x1a')]);}logger['error'](_0xddde('0x19'),_0x3ec861,_0x55c83d[_0xddde('0x17')][_0xddde('0x1a')]);return _0x24d2f8(_0x55c83d[_0xddde('0x17')][_0xddde('0x1a')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x3ec861,_0xddde('0x15'));_0x24d2f8(_0x55c83d['result']['message']);}})[_0xddde('0x1b')](function(_0x38bcb5){logger['error'](_0xddde('0x19'),_0x3ec861,_0x38bcb5);_0x35e697(_0x38bcb5);});});}exports[_0xddde('0x1c')]=function(_0x262ee1){var _0x4e07e6=this;return new Promise(function(_0x4f4a4f,_0x35a441){return db[_0xddde('0x1d')][_0xddde('0x1e')]({'raw':_0x262ee1[_0xddde('0x1f')]?_0x262ee1[_0xddde('0x1f')][_0xddde('0x20')]===undefined?!![]:![]:!![],'where':_0x262ee1[_0xddde('0x1f')]?_0x262ee1[_0xddde('0x1f')][_0xddde('0x21')]||null:null,'attributes':_0x262ee1['options']?_0x262ee1[_0xddde('0x1f')]['attributes']||null:null,'limit':_0x262ee1[_0xddde('0x1f')]?_0x262ee1[_0xddde('0x1f')]['limit']||null:null,'include':_0x262ee1[_0xddde('0x1f')]?_0x262ee1[_0xddde('0x1f')][_0xddde('0x22')]?_[_0xddde('0x23')](_0x262ee1[_0xddde('0x1f')]['include'],function(_0x215fad){return{'model':db[_0x215fad[_0xddde('0x24')]],'as':_0x215fad['as'],'attributes':_0x215fad['attributes'],'include':_0x215fad[_0xddde('0x22')]?_[_0xddde('0x23')](_0x215fad['include'],function(_0x43e567){return{'model':db[_0x43e567[_0xddde('0x24')]],'as':_0x43e567['as'],'attributes':_0x43e567[_0xddde('0x25')],'include':_0x43e567[_0xddde('0x22')]?_['map'](_0x43e567[_0xddde('0x22')],function(_0x2f5832){return{'model':db[_0x2f5832[_0xddde('0x24')]],'as':_0x2f5832['as'],'attributes':_0x2f5832['attributes']};}):[]};}):[]};}):[]:[]})[_0xddde('0x11')](function(_0x308638){logger[_0xddde('0x12')]('GetSmsQueue',_0x262ee1);logger[_0xddde('0x13')]('GetSmsQueue',_0x262ee1,JSON['stringify'](_0x308638));_0x4f4a4f(_0x308638);})[_0xddde('0x1b')](function(_0x3f7f32){logger[_0xddde('0x17')](_0xddde('0x1c'),_0x3f7f32[_0xddde('0x1a')],_0x262ee1);_0x35a441(_0x4e07e6['error'](0x1f4,_0x3f7f32[_0xddde('0x1a')]));});});};exports[_0xddde('0x26')]=function(_0x511652){var _0x53df4a=this;return new Promise(function(_0x5b17b4,_0x2aabf7){return db[_0xddde('0x1d')][_0xddde('0x27')]({'raw':_0x511652[_0xddde('0x1f')]?_0x511652[_0xddde('0x1f')][_0xddde('0x20')]===undefined?!![]:![]:!![],'where':_0x511652[_0xddde('0x1f')]?_0x511652['options'][_0xddde('0x21')]||null:null,'attributes':_0x511652[_0xddde('0x1f')]?_0x511652[_0xddde('0x1f')]['attributes']||null:null,'include':_0x511652[_0xddde('0x1f')]?_0x511652[_0xddde('0x1f')][_0xddde('0x22')]?_[_0xddde('0x23')](_0x511652[_0xddde('0x1f')]['include'],function(_0x5b3ae9){return{'model':db[_0x5b3ae9[_0xddde('0x24')]],'as':_0x5b3ae9['as'],'attributes':_0x5b3ae9[_0xddde('0x25')],'include':_0x5b3ae9['include']?_[_0xddde('0x23')](_0x5b3ae9['include'],function(_0x59e924){return{'model':db[_0x59e924[_0xddde('0x24')]],'as':_0x59e924['as'],'attributes':_0x59e924[_0xddde('0x25')],'include':_0x59e924[_0xddde('0x22')]?_['map'](_0x59e924[_0xddde('0x22')],function(_0x4858aa){return{'model':db[_0x4858aa['model']],'as':_0x4858aa['as'],'attributes':_0x4858aa[_0xddde('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x98e3d3){logger[_0xddde('0x12')]('ShowSmsQueue',_0x511652);logger['debug'](_0xddde('0x26'),_0x511652,JSON['stringify'](_0x98e3d3));_0x5b17b4(_0x98e3d3);})[_0xddde('0x1b')](function(_0x1d1684){logger[_0xddde('0x17')](_0xddde('0x26'),_0x1d1684[_0xddde('0x1a')],_0x511652);_0x2aabf7(_0x53df4a[_0xddde('0x17')](0x1f4,_0x1d1684['message']));});});}; \ No newline at end of file +var _0x0c48=['../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','attributes','limit','include','map','model','ShowSmsQueue','find','where','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1e6f9a,_0x37c6d8){var _0x2b65b0=function(_0xfc8c6){while(--_0xfc8c6){_0x1e6f9a['push'](_0x1e6f9a['shift']());}};_0x2b65b0(++_0x37c6d8);}(_0x0c48,0xc3));var _0x80c4=function(_0x120da6,_0x15f450){_0x120da6=_0x120da6-0x0;var _0x3d6c07=_0x0c48[_0x120da6];return _0x3d6c07;};'use strict';var _=require(_0x80c4('0x0'));var util=require('util');var moment=require(_0x80c4('0x1'));var BPromise=require('bluebird');var rs=require(_0x80c4('0x2'));var fs=require('fs');var Redis=require(_0x80c4('0x3'));var db=require(_0x80c4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x80c4('0x5'))('rpc');var config=require(_0x80c4('0x6'));var jayson=require(_0x80c4('0x7'));var client=jayson[_0x80c4('0x8')][_0x80c4('0x9')]({'port':0x232a});config['redis']=_[_0x80c4('0xa')](config['redis'],{'host':_0x80c4('0xb'),'port':0x18eb});var socket=require(_0x80c4('0xc'))(new Redis(config['redis']));require(_0x80c4('0xd'))[_0x80c4('0xe')](socket);function respondWithRpcPromise(_0x461b0c,_0x51e417,_0x4616d8){return new BPromise(function(_0x5dd489,_0x5875bd){return client[_0x80c4('0xf')](_0x461b0c,_0x4616d8)[_0x80c4('0x10')](function(_0x522296){logger[_0x80c4('0x11')](_0x80c4('0x12'),_0x51e417,_0x80c4('0x13'));logger[_0x80c4('0x14')](_0x80c4('0x15'),_0x51e417,_0x80c4('0x13'),JSON[_0x80c4('0x16')](_0x522296));if(_0x522296[_0x80c4('0x17')]){if(_0x522296['error']['code']===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x51e417,_0x522296[_0x80c4('0x17')]['message']);return _0x5875bd(_0x522296[_0x80c4('0x17')][_0x80c4('0x18')]);}logger[_0x80c4('0x17')](_0x80c4('0x12'),_0x51e417,_0x522296[_0x80c4('0x17')]['message']);return _0x5dd489(_0x522296[_0x80c4('0x17')][_0x80c4('0x18')]);}else{logger[_0x80c4('0x11')](_0x80c4('0x12'),_0x51e417,_0x80c4('0x13'));_0x5dd489(_0x522296[_0x80c4('0x19')]['message']);}})[_0x80c4('0x1a')](function(_0x4eed54){logger[_0x80c4('0x17')](_0x80c4('0x12'),_0x51e417,_0x4eed54);_0x5875bd(_0x4eed54);});});}exports[_0x80c4('0x1b')]=function(_0x29e005){var _0x2b3afc=this;return new Promise(function(_0x270992,_0x3e2f6d){return db[_0x80c4('0x1c')][_0x80c4('0x1d')]({'raw':_0x29e005[_0x80c4('0x1e')]?_0x29e005[_0x80c4('0x1e')][_0x80c4('0x1f')]===undefined?!![]:![]:!![],'where':_0x29e005[_0x80c4('0x1e')]?_0x29e005[_0x80c4('0x1e')]['where']||null:null,'attributes':_0x29e005[_0x80c4('0x1e')]?_0x29e005[_0x80c4('0x1e')][_0x80c4('0x20')]||null:null,'limit':_0x29e005['options']?_0x29e005[_0x80c4('0x1e')][_0x80c4('0x21')]||null:null,'include':_0x29e005[_0x80c4('0x1e')]?_0x29e005['options'][_0x80c4('0x22')]?_[_0x80c4('0x23')](_0x29e005[_0x80c4('0x1e')][_0x80c4('0x22')],function(_0x5e2183){return{'model':db[_0x5e2183['model']],'as':_0x5e2183['as'],'attributes':_0x5e2183[_0x80c4('0x20')],'include':_0x5e2183[_0x80c4('0x22')]?_[_0x80c4('0x23')](_0x5e2183[_0x80c4('0x22')],function(_0x4613ef){return{'model':db[_0x4613ef[_0x80c4('0x24')]],'as':_0x4613ef['as'],'attributes':_0x4613ef[_0x80c4('0x20')],'include':_0x4613ef[_0x80c4('0x22')]?_['map'](_0x4613ef['include'],function(_0x449596){return{'model':db[_0x449596[_0x80c4('0x24')]],'as':_0x449596['as'],'attributes':_0x449596[_0x80c4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x80c4('0x10')](function(_0x4a8383){logger[_0x80c4('0x11')](_0x80c4('0x1b'),_0x29e005);logger['debug'](_0x80c4('0x1b'),_0x29e005,JSON[_0x80c4('0x16')](_0x4a8383));_0x270992(_0x4a8383);})[_0x80c4('0x1a')](function(_0x2f4680){logger[_0x80c4('0x17')](_0x80c4('0x1b'),_0x2f4680[_0x80c4('0x18')],_0x29e005);_0x3e2f6d(_0x2b3afc['error'](0x1f4,_0x2f4680[_0x80c4('0x18')]));});});};exports[_0x80c4('0x25')]=function(_0x4fd609){var _0x58dcad=this;return new Promise(function(_0x5f3913,_0x242292){return db['SmsQueue'][_0x80c4('0x26')]({'raw':_0x4fd609[_0x80c4('0x1e')]?_0x4fd609['options'][_0x80c4('0x1f')]===undefined?!![]:![]:!![],'where':_0x4fd609[_0x80c4('0x1e')]?_0x4fd609['options'][_0x80c4('0x27')]||null:null,'attributes':_0x4fd609[_0x80c4('0x1e')]?_0x4fd609[_0x80c4('0x1e')][_0x80c4('0x20')]||null:null,'include':_0x4fd609[_0x80c4('0x1e')]?_0x4fd609[_0x80c4('0x1e')][_0x80c4('0x22')]?_['map'](_0x4fd609[_0x80c4('0x1e')][_0x80c4('0x22')],function(_0x53d0b6){return{'model':db[_0x53d0b6['model']],'as':_0x53d0b6['as'],'attributes':_0x53d0b6[_0x80c4('0x20')],'include':_0x53d0b6[_0x80c4('0x22')]?_[_0x80c4('0x23')](_0x53d0b6[_0x80c4('0x22')],function(_0x12b808){return{'model':db[_0x12b808[_0x80c4('0x24')]],'as':_0x12b808['as'],'attributes':_0x12b808['attributes'],'include':_0x12b808[_0x80c4('0x22')]?_[_0x80c4('0x23')](_0x12b808[_0x80c4('0x22')],function(_0x1f6669){return{'model':db[_0x1f6669[_0x80c4('0x24')]],'as':_0x1f6669['as'],'attributes':_0x1f6669['attributes']};}):[]};}):[]};}):[]:[]})[_0x80c4('0x10')](function(_0x351765){logger['info'](_0x80c4('0x25'),_0x4fd609);logger[_0x80c4('0x14')](_0x80c4('0x25'),_0x4fd609,JSON[_0x80c4('0x16')](_0x351765));_0x5f3913(_0x351765);})[_0x80c4('0x1a')](function(_0x249bbc){logger[_0x80c4('0x17')](_0x80c4('0x25'),_0x249bbc['message'],_0x4fd609);_0x242292(_0x58dcad['error'](0x1f4,_0x249bbc[_0x80c4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 050816d..d0af9b6 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 _0xe3fd=['emit','register','length','smsQueue:','save','remove','update'];(function(_0x356fc0,_0x147f5f){var _0x21e6f7=function(_0x1f4786){while(--_0x1f4786){_0x356fc0['push'](_0x356fc0['shift']());}};_0x21e6f7(++_0x147f5f);}(_0xe3fd,0xc1));var _0xde3f=function(_0x572957,_0xdaa125){_0x572957=_0x572957-0x0;var _0x11d00f=_0xe3fd[_0x572957];return _0x11d00f;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xde3f('0x0'),_0xde3f('0x1'),_0xde3f('0x2')];function createListener(_0x560904,_0x836e01){return function(_0x251196){_0x836e01[_0xde3f('0x3')](_0x560904,_0x251196);};}function removeListener(_0x56dbae,_0x563de1){return function(){SmsQueueEvents['removeListener'](_0x56dbae,_0x563de1);};}exports[_0xde3f('0x4')]=function(_0x375643){for(var _0xcadfd9=0x0,_0x44ffb4=events[_0xde3f('0x5')];_0xcadfd9<_0x44ffb4;_0xcadfd9++){var _0x3cfab8=events[_0xcadfd9];var _0x45451e=createListener(_0xde3f('0x6')+_0x3cfab8,_0x375643);SmsQueueEvents['on'](_0x3cfab8,_0x45451e);}}; \ No newline at end of file +var _0xc0fc=['save','remove','update','emit','removeListener','register','length','./smsQueue.events'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xc0fc,0x13f));var _0xcc0f=function(_0x5336bb,_0xd2c388){_0x5336bb=_0x5336bb-0x0;var _0x472f25=_0xc0fc[_0x5336bb];return _0x472f25;};'use strict';var SmsQueueEvents=require(_0xcc0f('0x0'));var events=[_0xcc0f('0x1'),_0xcc0f('0x2'),_0xcc0f('0x3')];function createListener(_0x220d5a,_0x62b852){return function(_0x156816){_0x62b852[_0xcc0f('0x4')](_0x220d5a,_0x156816);};}function removeListener(_0x16b72c,_0x2377e7){return function(){SmsQueueEvents[_0xcc0f('0x5')](_0x16b72c,_0x2377e7);};}exports[_0xcc0f('0x6')]=function(_0x465a62){for(var _0x34d28d=0x0,_0x3c0614=events[_0xcc0f('0x7')];_0x34d28d<_0x3c0614;_0x34d28d++){var _0x2763ca=events[_0x34d28d];var _0x58ac1c=createListener('smsQueue:'+_0x2763ca,_0x465a62);SmsQueueEvents['on'](_0x2763ca,_0x58ac1c);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 5303b59..8a412df 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 _0x368c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','express','Router','fs-extra'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x368c,0x1b4));var _0xc368=function(_0x557f92,_0x4ac37c){_0x557f92=_0x557f92-0x0;var _0x41aa4b=_0x368c[_0x557f92];return _0x41aa4b;};'use strict';var multer=require(_0xc368('0x0'));var util=require(_0xc368('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc368('0x2'));var router=express[_0xc368('0x3')]();var fs_extra=require(_0xc368('0x4'));var auth=require(_0xc368('0x5'));var interaction=require(_0xc368('0x6'));var config=require(_0xc368('0x7'));var controller=require(_0xc368('0x8'));router[_0xc368('0x9')]('/',auth[_0xc368('0xa')](),controller['index']);router[_0xc368('0x9')](_0xc368('0xb'),auth[_0xc368('0xa')](),controller[_0xc368('0xc')]);router[_0xc368('0x9')](_0xc368('0xd'),auth['isAuthenticated'](),controller[_0xc368('0xe')]);router[_0xc368('0xf')]('/',auth[_0xc368('0xa')](),controller[_0xc368('0x10')]);router['put']('/:id',auth[_0xc368('0xa')](),controller[_0xc368('0x11')]);router[_0xc368('0x12')]('/:id',auth[_0xc368('0xa')](),controller[_0xc368('0x13')]);module[_0xc368('0x14')]=router; \ No newline at end of file +var _0x993f=['put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x25b459,_0x347064){var _0x4da043=function(_0x408140){while(--_0x408140){_0x25b459['push'](_0x25b459['shift']());}};_0x4da043(++_0x347064);}(_0x993f,0x129));var _0xf993=function(_0x1ca79d,_0x567710){_0x1ca79d=_0x1ca79d-0x0;var _0x14e374=_0x993f[_0x1ca79d];return _0x14e374;};'use strict';var multer=require(_0xf993('0x0'));var util=require(_0xf993('0x1'));var path=require(_0xf993('0x2'));var timeout=require(_0xf993('0x3'));var express=require('express');var router=express[_0xf993('0x4')]();var fs_extra=require(_0xf993('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf993('0x6'));var config=require(_0xf993('0x7'));var controller=require(_0xf993('0x8'));router[_0xf993('0x9')]('/',auth[_0xf993('0xa')](),controller[_0xf993('0xb')]);router[_0xf993('0x9')](_0xf993('0xc'),auth[_0xf993('0xa')](),controller[_0xf993('0xd')]);router[_0xf993('0x9')](_0xf993('0xe'),auth['isAuthenticated'](),controller[_0xf993('0xf')]);router[_0xf993('0x10')]('/',auth['isAuthenticated'](),controller[_0xf993('0x11')]);router[_0xf993('0x12')](_0xf993('0xe'),auth[_0xf993('0xa')](),controller['update']);router[_0xf993('0x13')]('/:id',auth[_0xf993('0xa')](),controller[_0xf993('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 89d6131..281e07e 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 _0xf920=['exports','STRING','DATE','sequelize'];(function(_0x196b9d,_0x409e0){var _0x2aab2b=function(_0x49378c){while(--_0x49378c){_0x196b9d['push'](_0x196b9d['shift']());}};_0x2aab2b(++_0x409e0);}(_0xf920,0x1a7));var _0x0f92=function(_0x1b6ae1,_0x7265ae){_0x1b6ae1=_0x1b6ae1-0x0;var _0x5843a2=_0xf920[_0x1b6ae1];return _0x5843a2;};'use strict';var moment=require('moment');var Sequelize=require(_0x0f92('0x0'));module[_0x0f92('0x1')]={'uniqueid':{'type':Sequelize[_0x0f92('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0f92('0x2')]},'joinAt':{'type':Sequelize[_0x0f92('0x3')]},'leaveAt':{'type':Sequelize[_0x0f92('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0f92('0x3')]},'reason':{'type':Sequelize[_0x0f92('0x2')]}}; \ No newline at end of file +var _0x01c9=['exports','STRING','DATE','sequelize'];(function(_0x24764b,_0x205ba2){var _0x5b4014=function(_0x10b46c){while(--_0x10b46c){_0x24764b['push'](_0x24764b['shift']());}};_0x5b4014(++_0x205ba2);}(_0x01c9,0x1a3));var _0x901c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x01c9[_0x14add3];return _0x4a174f;};'use strict';var moment=require('moment');var Sequelize=require(_0x901c('0x0'));module[_0x901c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x901c('0x2')]},'joinAt':{'type':Sequelize[_0x901c('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x901c('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x901c('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 9f1f362..a37aa07 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 _0x4e0f=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','SmsQueueReport','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1cd7f1,_0x44236f){var _0x5adfde=function(_0x409537){while(--_0x409537){_0x1cd7f1['push'](_0x1cd7f1['shift']());}};_0x5adfde(++_0x44236f);}(_0x4e0f,0x18f));var _0xf4e0=function(_0x4216ba,_0x5739c5){_0x4216ba=_0x4216ba-0x0;var _0x2592ca=_0x4e0f[_0x4216ba];return _0x2592ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf4e0('0x0'));var zipdir=require(_0xf4e0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4e0('0x2'));var moment=require(_0xf4e0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf4e0('0x4'));var sox=require(_0xf4e0('0x5'));var csv=require(_0xf4e0('0x6'));var ejs=require(_0xf4e0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf4e0('0x8'));var crypto=require(_0xf4e0('0x9'));var jsforce=require(_0xf4e0('0xa'));var deskjs=require(_0xf4e0('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf4e0('0xc'));var Papa=require('papaparse');var Redis=require(_0xf4e0('0xd'));var authService=require(_0xf4e0('0xe'));var qs=require(_0xf4e0('0xf'));var as=require(_0xf4e0('0x10'));var hardwareService=require(_0xf4e0('0x11'));var logger=require(_0xf4e0('0x12'))(_0xf4e0('0x13'));var utils=require(_0xf4e0('0x14'));var config=require(_0xf4e0('0x15'));var licenseUtil=require(_0xf4e0('0x16'));var db=require(_0xf4e0('0x17'))['db'];function respondWithStatusCode(_0x239a2f,_0x3c2bed){_0x3c2bed=_0x3c2bed||0xcc;return function(_0x47b246){if(_0x47b246){return _0x239a2f[_0xf4e0('0x18')](_0x3c2bed);}return _0x239a2f[_0xf4e0('0x19')](_0x3c2bed)[_0xf4e0('0x1a')]();};}function respondWithResult(_0x1f7753,_0x555b52){_0x555b52=_0x555b52||0xc8;return function(_0x45cc0f){if(_0x45cc0f){return _0x1f7753['status'](_0x555b52)[_0xf4e0('0x1b')](_0x45cc0f);}};}function respondWithFilteredResult(_0x5bf334,_0x2ce5d9){return function(_0x46943b){if(_0x46943b){var _0x21c6c6=typeof _0x2ce5d9[_0xf4e0('0x1c')]===_0xf4e0('0x1d')&&typeof _0x2ce5d9[_0xf4e0('0x1e')]===_0xf4e0('0x1d');var _0x11c686=_0x46943b[_0xf4e0('0x1f')];var _0x3f64fb=_0x21c6c6?0x0:_0x2ce5d9[_0xf4e0('0x1c')];var _0x2ad307=_0x21c6c6?_0x46943b[_0xf4e0('0x1f')]:_0x2ce5d9[_0xf4e0('0x1c')]+_0x2ce5d9[_0xf4e0('0x1e')];var _0x109f16;if(_0x2ad307>=_0x11c686){_0x2ad307=_0x11c686;_0x109f16=0xc8;}else{_0x109f16=0xce;}_0x5bf334[_0xf4e0('0x19')](_0x109f16);return _0x5bf334[_0xf4e0('0x20')](_0xf4e0('0x21'),_0x3f64fb+'-'+_0x2ad307+'/'+_0x11c686)[_0xf4e0('0x1b')](_0x46943b);}return null;};}function patchUpdates(_0x16ebb2){return function(_0x44ea21){try{jsonpatch[_0xf4e0('0x22')](_0x44ea21,_0x16ebb2,!![]);}catch(_0x22eb5a){return BPromise['reject'](_0x22eb5a);}return _0x44ea21[_0xf4e0('0x23')]();};}function saveUpdates(_0x4ac0c0,_0x43d940){return function(_0x357a55){if(_0x357a55){return _0x357a55[_0xf4e0('0x24')](_0x4ac0c0)['then'](function(_0x1dc505){return _0x1dc505;});}return null;};}function removeEntity(_0x25605a,_0x295072){return function(_0x226141){if(_0x226141){return _0x226141[_0xf4e0('0x25')]()[_0xf4e0('0x26')](function(){_0x25605a[_0xf4e0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fb6f8,_0x4c0c9b){return function(_0x29051b){if(!_0x29051b){_0x1fb6f8['sendStatus'](0x194);}return _0x29051b;};}function handleError(_0x50c1dd,_0x14625e){_0x14625e=_0x14625e||0x1f4;return function(_0x2c58fe){logger['error'](_0x2c58fe[_0xf4e0('0x27')]);if(_0x2c58fe[_0xf4e0('0x28')]){delete _0x2c58fe[_0xf4e0('0x28')];}_0x50c1dd[_0xf4e0('0x19')](_0x14625e)[_0xf4e0('0x29')](_0x2c58fe);};}exports[_0xf4e0('0x2a')]=function(_0x265c79,_0x42a073){var _0x42ac1c={},_0x3306a6={},_0x2c7aa1={'count':0x0,'rows':[]};var _0x1613f5=_[_0xf4e0('0x2b')](db[_0xf4e0('0x2c')]['rawAttributes'],function(_0x68fb05){return{'name':_0x68fb05[_0xf4e0('0x2d')],'type':_0x68fb05['type']['key']};});_0x3306a6[_0xf4e0('0x2e')]=_[_0xf4e0('0x2b')](_0x1613f5,_0xf4e0('0x28'));_0x3306a6['query']=_[_0xf4e0('0x2f')](_0x265c79[_0xf4e0('0x30')]);_0x3306a6[_0xf4e0('0x31')]=_[_0xf4e0('0x32')](_0x3306a6[_0xf4e0('0x2e')],_0x3306a6[_0xf4e0('0x30')]);_0x42ac1c[_0xf4e0('0x33')]=_[_0xf4e0('0x32')](_0x3306a6[_0xf4e0('0x2e')],qs[_0xf4e0('0x34')](_0x265c79[_0xf4e0('0x30')][_0xf4e0('0x34')]));_0x42ac1c[_0xf4e0('0x33')]=_0x42ac1c[_0xf4e0('0x33')]['length']?_0x42ac1c[_0xf4e0('0x33')]:_0x3306a6[_0xf4e0('0x2e')];if(!_0x265c79[_0xf4e0('0x30')][_0xf4e0('0x35')](_0xf4e0('0x36'))){_0x42ac1c[_0xf4e0('0x1e')]=qs['limit'](_0x265c79[_0xf4e0('0x30')]['limit']);_0x42ac1c[_0xf4e0('0x1c')]=qs[_0xf4e0('0x1c')](_0x265c79[_0xf4e0('0x30')]['offset']);}_0x42ac1c['order']=qs[_0xf4e0('0x37')](_0x265c79[_0xf4e0('0x30')][_0xf4e0('0x37')]);_0x42ac1c[_0xf4e0('0x38')]=qs[_0xf4e0('0x31')](_['pick'](_0x265c79[_0xf4e0('0x30')],_0x3306a6[_0xf4e0('0x31')]),_0x1613f5);if(_0x265c79['query'][_0xf4e0('0x39')]){_0x42ac1c[_0xf4e0('0x38')]=_['merge'](_0x42ac1c[_0xf4e0('0x38')],{'$or':_['map'](_0x1613f5,function(_0x5a664e){if(_0x5a664e[_0xf4e0('0x3a')]!==_0xf4e0('0x3b')){var _0x512de5={};_0x512de5[_0x5a664e[_0xf4e0('0x28')]]={'$like':'%'+_0x265c79[_0xf4e0('0x30')][_0xf4e0('0x39')]+'%'};return _0x512de5;}})});}_0x42ac1c=_[_0xf4e0('0x3c')]({},_0x42ac1c,_0x265c79[_0xf4e0('0x3d')]);var _0x5d0fed={'where':_0x42ac1c[_0xf4e0('0x38')]};return db[_0xf4e0('0x2c')][_0xf4e0('0x1f')](_0x5d0fed)[_0xf4e0('0x26')](function(_0x637c3b){_0x2c7aa1['count']=_0x637c3b;if(_0x265c79['query'][_0xf4e0('0x3e')]){_0x42ac1c[_0xf4e0('0x3f')]=[{'all':!![]}];}return db[_0xf4e0('0x2c')][_0xf4e0('0x40')](_0x42ac1c);})['then'](function(_0x24a0b5){_0x2c7aa1['rows']=_0x24a0b5;return _0x2c7aa1;})[_0xf4e0('0x26')](respondWithFilteredResult(_0x42a073,_0x42ac1c))[_0xf4e0('0x41')](handleError(_0x42a073,null));};exports['show']=function(_0x3525ed,_0x5793f8){var _0x5c5364={'raw':!![],'where':{'id':_0x3525ed[_0xf4e0('0x42')]['id']}},_0x3a81f7={};_0x3a81f7[_0xf4e0('0x2e')]=_['keys'](db[_0xf4e0('0x2c')]['rawAttributes']);_0x3a81f7[_0xf4e0('0x30')]=_['keys'](_0x3525ed['query']);_0x3a81f7[_0xf4e0('0x31')]=_['intersection'](_0x3a81f7[_0xf4e0('0x2e')],_0x3a81f7[_0xf4e0('0x30')]);_0x5c5364[_0xf4e0('0x33')]=_[_0xf4e0('0x32')](_0x3a81f7[_0xf4e0('0x2e')],qs[_0xf4e0('0x34')](_0x3525ed[_0xf4e0('0x30')][_0xf4e0('0x34')]));_0x5c5364[_0xf4e0('0x33')]=_0x5c5364[_0xf4e0('0x33')]['length']?_0x5c5364[_0xf4e0('0x33')]:_0x3a81f7[_0xf4e0('0x2e')];if(_0x3525ed['query'][_0xf4e0('0x3e')]){_0x5c5364[_0xf4e0('0x3f')]=[{'all':!![]}];}_0x5c5364=_['merge']({},_0x5c5364,_0x3525ed[_0xf4e0('0x3d')]);return db[_0xf4e0('0x2c')][_0xf4e0('0x43')](_0x5c5364)[_0xf4e0('0x26')](handleEntityNotFound(_0x5793f8,null))[_0xf4e0('0x26')](respondWithResult(_0x5793f8,null))['catch'](handleError(_0x5793f8,null));};exports[_0xf4e0('0x44')]=function(_0x5659e9,_0xe3fabe){return db[_0xf4e0('0x2c')][_0xf4e0('0x44')](_0x5659e9[_0xf4e0('0x45')],{})[_0xf4e0('0x26')](respondWithResult(_0xe3fabe,0xc9))['catch'](handleError(_0xe3fabe,null));};exports[_0xf4e0('0x24')]=function(_0x50eaf6,_0x3db5a2){if(_0x50eaf6['body']['id']){delete _0x50eaf6['body']['id'];}return db[_0xf4e0('0x2c')][_0xf4e0('0x43')]({'where':{'id':_0x50eaf6[_0xf4e0('0x42')]['id']}})[_0xf4e0('0x26')](handleEntityNotFound(_0x3db5a2,null))[_0xf4e0('0x26')](saveUpdates(_0x50eaf6[_0xf4e0('0x45')],null))[_0xf4e0('0x26')](respondWithResult(_0x3db5a2,null))[_0xf4e0('0x41')](handleError(_0x3db5a2,null));};exports['destroy']=function(_0x2c45a,_0x4e4020){return db['SmsQueueReport'][_0xf4e0('0x43')]({'where':{'id':_0x2c45a[_0xf4e0('0x42')]['id']}})[_0xf4e0('0x26')](handleEntityNotFound(_0x4e4020,null))[_0xf4e0('0x26')](removeEntity(_0x4e4020,null))[_0xf4e0('0x41')](handleError(_0x4e4020,null));};exports['describe']=function(_0x35c518,_0xc0215a){return db[_0xf4e0('0x2c')]['describe']()[_0xf4e0('0x26')](respondWithResult(_0xc0215a,null))[_0xf4e0('0x41')](handleError(_0xc0215a,null));}; \ No newline at end of file +var _0xd411=['end','status','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','describe','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb'];(function(_0x385895,_0xf937a){var _0xc01ec5=function(_0x198f87){while(--_0x198f87){_0x385895['push'](_0x385895['shift']());}};_0xc01ec5(++_0xf937a);}(_0xd411,0x1d6));var _0x1d41=function(_0xaf86ea,_0x2e3b57){_0xaf86ea=_0xaf86ea-0x0;var _0x43211f=_0xd411[_0xaf86ea];return _0x43211f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1d41('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d41('0x1'));var moment=require(_0x1d41('0x2'));var BPromise=require(_0x1d41('0x3'));var Mustache=require(_0x1d41('0x4'));var util=require(_0x1d41('0x5'));var path=require('path');var sox=require(_0x1d41('0x6'));var csv=require('to-csv');var ejs=require(_0x1d41('0x7'));var fs=require('fs');var fs_extra=require(_0x1d41('0x8'));var _=require('lodash');var squel=require(_0x1d41('0x9'));var crypto=require(_0x1d41('0xa'));var jsforce=require(_0x1d41('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1d41('0xc'));var querystring=require(_0x1d41('0xd'));var Papa=require('papaparse');var Redis=require(_0x1d41('0xe'));var authService=require(_0x1d41('0xf'));var qs=require(_0x1d41('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1d41('0x11'));var utils=require('../../config/utils');var config=require(_0x1d41('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d41('0x13'))['db'];function respondWithStatusCode(_0x12176b,_0x54eff2){_0x54eff2=_0x54eff2||0xcc;return function(_0x23fa61){if(_0x23fa61){return _0x12176b['sendStatus'](_0x54eff2);}return _0x12176b['status'](_0x54eff2)[_0x1d41('0x14')]();};}function respondWithResult(_0x566810,_0x343358){_0x343358=_0x343358||0xc8;return function(_0x3b70de){if(_0x3b70de){return _0x566810[_0x1d41('0x15')](_0x343358)['json'](_0x3b70de);}};}function respondWithFilteredResult(_0x2ff0b6,_0x13f72b){return function(_0x241876){if(_0x241876){var _0x5990fc=typeof _0x13f72b[_0x1d41('0x16')]===_0x1d41('0x17')&&typeof _0x13f72b[_0x1d41('0x18')]===_0x1d41('0x17');var _0x18d5de=_0x241876['count'];var _0x2dc6c3=_0x5990fc?0x0:_0x13f72b[_0x1d41('0x16')];var _0x50d627=_0x5990fc?_0x241876[_0x1d41('0x19')]:_0x13f72b[_0x1d41('0x16')]+_0x13f72b['limit'];var _0xd050ae;if(_0x50d627>=_0x18d5de){_0x50d627=_0x18d5de;_0xd050ae=0xc8;}else{_0xd050ae=0xce;}_0x2ff0b6[_0x1d41('0x15')](_0xd050ae);return _0x2ff0b6['set'](_0x1d41('0x1a'),_0x2dc6c3+'-'+_0x50d627+'/'+_0x18d5de)['json'](_0x241876);}return null;};}function patchUpdates(_0x431cae){return function(_0x44e242){try{jsonpatch[_0x1d41('0x1b')](_0x44e242,_0x431cae,!![]);}catch(_0x29e226){return BPromise[_0x1d41('0x1c')](_0x29e226);}return _0x44e242['save']();};}function saveUpdates(_0x3ac119,_0x16f542){return function(_0x121654){if(_0x121654){return _0x121654[_0x1d41('0x1d')](_0x3ac119)['then'](function(_0x210da4){return _0x210da4;});}return null;};}function removeEntity(_0x282bc6,_0xd47bc2){return function(_0x9a8be7){if(_0x9a8be7){return _0x9a8be7[_0x1d41('0x1e')]()[_0x1d41('0x1f')](function(){_0x282bc6[_0x1d41('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d72b5,_0x1b907e){return function(_0x694a12){if(!_0x694a12){_0x2d72b5['sendStatus'](0x194);}return _0x694a12;};}function handleError(_0x314a10,_0x48f47b){_0x48f47b=_0x48f47b||0x1f4;return function(_0x296d5a){logger[_0x1d41('0x20')](_0x296d5a[_0x1d41('0x21')]);if(_0x296d5a[_0x1d41('0x22')]){delete _0x296d5a[_0x1d41('0x22')];}_0x314a10[_0x1d41('0x15')](_0x48f47b)[_0x1d41('0x23')](_0x296d5a);};}exports[_0x1d41('0x24')]=function(_0x5af115,_0x994b34){var _0x439276={},_0x21accb={},_0x2e500c={'count':0x0,'rows':[]};var _0x2a503f=_[_0x1d41('0x25')](db[_0x1d41('0x26')][_0x1d41('0x27')],function(_0x3e8804){return{'name':_0x3e8804[_0x1d41('0x28')],'type':_0x3e8804[_0x1d41('0x29')][_0x1d41('0x2a')]};});_0x21accb[_0x1d41('0x2b')]=_['map'](_0x2a503f,_0x1d41('0x22'));_0x21accb[_0x1d41('0x2c')]=_[_0x1d41('0x2d')](_0x5af115[_0x1d41('0x2c')]);_0x21accb['filters']=_['intersection'](_0x21accb[_0x1d41('0x2b')],_0x21accb[_0x1d41('0x2c')]);_0x439276['attributes']=_[_0x1d41('0x2e')](_0x21accb[_0x1d41('0x2b')],qs[_0x1d41('0x2f')](_0x5af115[_0x1d41('0x2c')]['fields']));_0x439276['attributes']=_0x439276[_0x1d41('0x30')][_0x1d41('0x31')]?_0x439276[_0x1d41('0x30')]:_0x21accb[_0x1d41('0x2b')];if(!_0x5af115[_0x1d41('0x2c')][_0x1d41('0x32')](_0x1d41('0x33'))){_0x439276[_0x1d41('0x18')]=qs[_0x1d41('0x18')](_0x5af115[_0x1d41('0x2c')][_0x1d41('0x18')]);_0x439276[_0x1d41('0x16')]=qs['offset'](_0x5af115[_0x1d41('0x2c')]['offset']);}_0x439276[_0x1d41('0x34')]=qs[_0x1d41('0x35')](_0x5af115[_0x1d41('0x2c')][_0x1d41('0x35')]);_0x439276[_0x1d41('0x36')]=qs[_0x1d41('0x37')](_[_0x1d41('0x38')](_0x5af115[_0x1d41('0x2c')],_0x21accb['filters']),_0x2a503f);if(_0x5af115[_0x1d41('0x2c')][_0x1d41('0x39')]){_0x439276['where']=_[_0x1d41('0x3a')](_0x439276[_0x1d41('0x36')],{'$or':_[_0x1d41('0x25')](_0x2a503f,function(_0x8dc158){if(_0x8dc158['type']!=='VIRTUAL'){var _0x346036={};_0x346036[_0x8dc158[_0x1d41('0x22')]]={'$like':'%'+_0x5af115[_0x1d41('0x2c')][_0x1d41('0x39')]+'%'};return _0x346036;}})});}_0x439276=_['merge']({},_0x439276,_0x5af115[_0x1d41('0x3b')]);var _0x6141cc={'where':_0x439276[_0x1d41('0x36')]};return db['SmsQueueReport'][_0x1d41('0x19')](_0x6141cc)[_0x1d41('0x1f')](function(_0x167a9f){_0x2e500c[_0x1d41('0x19')]=_0x167a9f;if(_0x5af115['query'][_0x1d41('0x3c')]){_0x439276['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0x1d41('0x3d')](_0x439276);})[_0x1d41('0x1f')](function(_0x37b603){_0x2e500c[_0x1d41('0x3e')]=_0x37b603;return _0x2e500c;})[_0x1d41('0x1f')](respondWithFilteredResult(_0x994b34,_0x439276))[_0x1d41('0x3f')](handleError(_0x994b34,null));};exports[_0x1d41('0x40')]=function(_0x3e4ddc,_0x15a6d8){var _0x48831f={'raw':!![],'where':{'id':_0x3e4ddc[_0x1d41('0x41')]['id']}},_0x2ec4d5={};_0x2ec4d5[_0x1d41('0x2b')]=_[_0x1d41('0x2d')](db['SmsQueueReport'][_0x1d41('0x27')]);_0x2ec4d5[_0x1d41('0x2c')]=_['keys'](_0x3e4ddc[_0x1d41('0x2c')]);_0x2ec4d5[_0x1d41('0x37')]=_[_0x1d41('0x2e')](_0x2ec4d5['model'],_0x2ec4d5[_0x1d41('0x2c')]);_0x48831f[_0x1d41('0x30')]=_['intersection'](_0x2ec4d5['model'],qs[_0x1d41('0x2f')](_0x3e4ddc[_0x1d41('0x2c')][_0x1d41('0x2f')]));_0x48831f[_0x1d41('0x30')]=_0x48831f[_0x1d41('0x30')]['length']?_0x48831f['attributes']:_0x2ec4d5[_0x1d41('0x2b')];if(_0x3e4ddc[_0x1d41('0x2c')][_0x1d41('0x3c')]){_0x48831f[_0x1d41('0x42')]=[{'all':!![]}];}_0x48831f=_[_0x1d41('0x3a')]({},_0x48831f,_0x3e4ddc[_0x1d41('0x3b')]);return db[_0x1d41('0x26')][_0x1d41('0x43')](_0x48831f)['then'](handleEntityNotFound(_0x15a6d8,null))['then'](respondWithResult(_0x15a6d8,null))[_0x1d41('0x3f')](handleError(_0x15a6d8,null));};exports['create']=function(_0x1a7d1f,_0x5871eb){return db[_0x1d41('0x26')]['create'](_0x1a7d1f[_0x1d41('0x44')],{})['then'](respondWithResult(_0x5871eb,0xc9))[_0x1d41('0x3f')](handleError(_0x5871eb,null));};exports[_0x1d41('0x1d')]=function(_0x2866d7,_0x24a8a6){if(_0x2866d7[_0x1d41('0x44')]['id']){delete _0x2866d7[_0x1d41('0x44')]['id'];}return db[_0x1d41('0x26')][_0x1d41('0x43')]({'where':{'id':_0x2866d7['params']['id']}})[_0x1d41('0x1f')](handleEntityNotFound(_0x24a8a6,null))['then'](saveUpdates(_0x2866d7[_0x1d41('0x44')],null))[_0x1d41('0x1f')](respondWithResult(_0x24a8a6,null))[_0x1d41('0x3f')](handleError(_0x24a8a6,null));};exports[_0x1d41('0x1e')]=function(_0x49b419,_0xd7bf9e){return db[_0x1d41('0x26')][_0x1d41('0x43')]({'where':{'id':_0x49b419[_0x1d41('0x41')]['id']}})[_0x1d41('0x1f')](handleEntityNotFound(_0xd7bf9e,null))[_0x1d41('0x1f')](removeEntity(_0xd7bf9e,null))[_0x1d41('0x3f')](handleError(_0xd7bf9e,null));};exports[_0x1d41('0x45')]=function(_0x4ac2c1,_0x5d9fe0){return db['SmsQueueReport'][_0x1d41('0x45')]()['then'](respondWithResult(_0x5d9fe0,null))[_0x1d41('0x3f')](handleError(_0x5d9fe0,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 0ec4985..e47e5fd 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x4157fc,_0x3e62e4){var _0xdec6f2=function(_0x2673ff){while(--_0x2673ff){_0x4157fc['push'](_0x4157fc['shift']());}};_0xdec6f2(++_0x3e62e4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 9584db2..503daf7 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 _0x4841=['../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsQueueReport','create','body','options','raw','catch','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x38cb12,_0x16b5ed){var _0x16a400=function(_0x55ab30){while(--_0x55ab30){_0x38cb12['push'](_0x38cb12['shift']());}};_0x16a400(++_0x16b5ed);}(_0x4841,0x178));var _0x1484=function(_0x4c63c5,_0x17ccc3){_0x4c63c5=_0x4c63c5-0x0;var _0xfd612c=_0x4841[_0x4c63c5];return _0xfd612c;};'use strict';var _=require(_0x1484('0x0'));var util=require(_0x1484('0x1'));var moment=require(_0x1484('0x2'));var BPromise=require(_0x1484('0x3'));var rs=require(_0x1484('0x4'));var fs=require('fs');var Redis=require(_0x1484('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1484('0x6'));var logger=require(_0x1484('0x7'))(_0x1484('0x8'));var config=require(_0x1484('0x9'));var jayson=require(_0x1484('0xa'));var client=jayson[_0x1484('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a9923,_0x4c5f86,_0x3bf450){return new BPromise(function(_0x214d3b,_0x2103cb){return client[_0x1484('0xc')](_0x2a9923,_0x3bf450)[_0x1484('0xd')](function(_0x3670d0){logger[_0x1484('0xe')](_0x1484('0xf'),_0x4c5f86,_0x1484('0x10'));logger[_0x1484('0x11')](_0x1484('0x12'),_0x4c5f86,_0x1484('0x10'),JSON[_0x1484('0x13')](_0x3670d0));if(_0x3670d0[_0x1484('0x14')]){if(_0x3670d0[_0x1484('0x14')][_0x1484('0x15')]===0x1f4){logger[_0x1484('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x4c5f86,_0x3670d0[_0x1484('0x14')][_0x1484('0x16')]);return _0x2103cb(_0x3670d0['error'][_0x1484('0x16')]);}logger['error'](_0x1484('0xf'),_0x4c5f86,_0x3670d0[_0x1484('0x14')][_0x1484('0x16')]);return _0x214d3b(_0x3670d0[_0x1484('0x14')][_0x1484('0x16')]);}else{logger[_0x1484('0xe')](_0x1484('0xf'),_0x4c5f86,_0x1484('0x10'));_0x214d3b(_0x3670d0[_0x1484('0x17')][_0x1484('0x16')]);}})['catch'](function(_0x19da2d){logger[_0x1484('0x14')](_0x1484('0xf'),_0x4c5f86,_0x19da2d);_0x2103cb(_0x19da2d);});});}exports[_0x1484('0x18')]=function(_0x3c8f37){var _0x246f2a=this;return new Promise(function(_0x448f43,_0x440e9a){return db['SmsQueueReport'][_0x1484('0x19')](_0x3c8f37[_0x1484('0x1a')],{'raw':_0x3c8f37[_0x1484('0x1b')]?_0x3c8f37['options'][_0x1484('0x1c')]===undefined?!![]:![]:!![]})[_0x1484('0xd')](function(_0x43a24a){logger[_0x1484('0xe')]('CreateSmsQueueReport',_0x3c8f37);logger[_0x1484('0x11')](_0x1484('0x18'),_0x3c8f37,JSON[_0x1484('0x13')](_0x43a24a));_0x448f43(_0x43a24a);})[_0x1484('0x1d')](function(_0x30db11){logger[_0x1484('0x14')](_0x1484('0x18'),_0x30db11['message'],_0x3c8f37);_0x440e9a(_0x246f2a[_0x1484('0x14')](0x1f4,_0x30db11['message']));});});};exports[_0x1484('0x1e')]=function(_0x28e76f){var _0x3cf8b9=this;return new Promise(function(_0x460f2c,_0x540bb7){return db[_0x1484('0x1f')][_0x1484('0x20')](_0x28e76f[_0x1484('0x1a')],{'raw':_0x28e76f[_0x1484('0x1b')]?_0x28e76f[_0x1484('0x1b')][_0x1484('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28e76f['options']?_0x28e76f[_0x1484('0x1b')][_0x1484('0x21')]||null:null,'attributes':_0x28e76f['options']?_0x28e76f[_0x1484('0x1b')][_0x1484('0x22')]||null:null,'limit':_0x28e76f[_0x1484('0x1b')]?_0x28e76f['options']['limit']||null:null})[_0x1484('0xd')](function(_0x42717c){logger[_0x1484('0xe')](_0x1484('0x1e'),_0x28e76f);logger['debug'](_0x1484('0x1e'),_0x28e76f,JSON[_0x1484('0x13')](_0x42717c));_0x460f2c(_0x42717c);})[_0x1484('0x1d')](function(_0x334dc7){logger['error'](_0x1484('0x1e'),_0x334dc7['message'],_0x28e76f);_0x540bb7(_0x3cf8b9[_0x1484('0x14')](0x1f4,_0x334dc7[_0x1484('0x16')]));});});}; \ No newline at end of file +var _0xd897=['error','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','info','UpdateSmsQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','client','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3a9331,_0x1b4a79){var _0x5edc50=function(_0x467803){while(--_0x467803){_0x3a9331['push'](_0x3a9331['shift']());}};_0x5edc50(++_0x1b4a79);}(_0xd897,0x1c1));var _0x7d89=function(_0x124518,_0x4485fe){_0x124518=_0x124518-0x0;var _0x55f7a9=_0xd897[_0x124518];return _0x55f7a9;};'use strict';var _=require(_0x7d89('0x0'));var util=require(_0x7d89('0x1'));var moment=require(_0x7d89('0x2'));var BPromise=require(_0x7d89('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d89('0x4'))['db'];var utils=require(_0x7d89('0x5'));var logger=require('../../config/logger')(_0x7d89('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7d89('0x7')][_0x7d89('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38f488,_0x187fce,_0x44b5e7){return new BPromise(function(_0x596f5f,_0x53520f){return client[_0x7d89('0x9')](_0x38f488,_0x44b5e7)[_0x7d89('0xa')](function(_0x35ab41){logger['info'](_0x7d89('0xb'),_0x187fce,_0x7d89('0xc'));logger[_0x7d89('0xd')](_0x7d89('0xe'),_0x187fce,'request\x20sent',JSON[_0x7d89('0xf')](_0x35ab41));if(_0x35ab41[_0x7d89('0x10')]){if(_0x35ab41['error']['code']===0x1f4){logger[_0x7d89('0x10')](_0x7d89('0xb'),_0x187fce,_0x35ab41[_0x7d89('0x10')]['message']);return _0x53520f(_0x35ab41['error'][_0x7d89('0x11')]);}logger[_0x7d89('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x187fce,_0x35ab41[_0x7d89('0x10')]['message']);return _0x596f5f(_0x35ab41[_0x7d89('0x10')]['message']);}else{logger['info'](_0x7d89('0xb'),_0x187fce,'request\x20sent');_0x596f5f(_0x35ab41['result'][_0x7d89('0x11')]);}})[_0x7d89('0x12')](function(_0x38145d){logger[_0x7d89('0x10')](_0x7d89('0xb'),_0x187fce,_0x38145d);_0x53520f(_0x38145d);});});}exports[_0x7d89('0x13')]=function(_0x303b09){var _0x3beb2c=this;return new Promise(function(_0x49108f,_0x5330ff){return db[_0x7d89('0x14')][_0x7d89('0x15')](_0x303b09[_0x7d89('0x16')],{'raw':_0x303b09[_0x7d89('0x17')]?_0x303b09[_0x7d89('0x17')][_0x7d89('0x18')]===undefined?!![]:![]:!![]})[_0x7d89('0xa')](function(_0x31a005){logger[_0x7d89('0x19')]('CreateSmsQueueReport',_0x303b09);logger[_0x7d89('0xd')]('CreateSmsQueueReport',_0x303b09,JSON[_0x7d89('0xf')](_0x31a005));_0x49108f(_0x31a005);})['catch'](function(_0x3fe878){logger[_0x7d89('0x10')](_0x7d89('0x13'),_0x3fe878[_0x7d89('0x11')],_0x303b09);_0x5330ff(_0x3beb2c[_0x7d89('0x10')](0x1f4,_0x3fe878[_0x7d89('0x11')]));});});};exports[_0x7d89('0x1a')]=function(_0x2c47bb){var _0x3b671b=this;return new Promise(function(_0x215194,_0x293c23){return db['SmsQueueReport'][_0x7d89('0x1b')](_0x2c47bb['body'],{'raw':_0x2c47bb[_0x7d89('0x17')]?_0x2c47bb[_0x7d89('0x17')][_0x7d89('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c47bb[_0x7d89('0x17')]?_0x2c47bb[_0x7d89('0x17')][_0x7d89('0x1c')]||null:null,'attributes':_0x2c47bb['options']?_0x2c47bb['options'][_0x7d89('0x1d')]||null:null,'limit':_0x2c47bb[_0x7d89('0x17')]?_0x2c47bb[_0x7d89('0x17')][_0x7d89('0x1e')]||null:null})['then'](function(_0x49371f){logger[_0x7d89('0x19')](_0x7d89('0x1a'),_0x2c47bb);logger[_0x7d89('0xd')]('UpdateSmsQueueReport',_0x2c47bb,JSON[_0x7d89('0xf')](_0x49371f));_0x215194(_0x49371f);})[_0x7d89('0x12')](function(_0x45592c){logger[_0x7d89('0x10')]('UpdateSmsQueueReport',_0x45592c[_0x7d89('0x11')],_0x2c47bb);_0x293c23(_0x3b671b[_0x7d89('0x10')](0x1f4,_0x45592c[_0x7d89('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index bb5127a..e927f58 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 _0xcca7=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x5f584a,_0x47f064){var _0x3788d9=function(_0x29c10b){while(--_0x29c10b){_0x5f584a['push'](_0x5f584a['shift']());}};_0x3788d9(++_0x47f064);}(_0xcca7,0x1aa));var _0x7cca=function(_0xa3781,_0x5d5603){_0xa3781=_0xa3781-0x0;var _0x4ca266=_0xcca7[_0xa3781];return _0x4ca266;};'use strict';var multer=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var path=require(_0x7cca('0x2'));var timeout=require(_0x7cca('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7cca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var controller=require(_0x7cca('0x7'));router[_0x7cca('0x8')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xa')]);router['get']('/describe',auth[_0x7cca('0x9')](),controller[_0x7cca('0xb')]);router[_0x7cca('0x8')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller[_0x7cca('0xd')]);router[_0x7cca('0xe')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xf')]);router[_0x7cca('0x10')]('/:id',auth[_0x7cca('0x9')](),controller[_0x7cca('0x11')]);router[_0x7cca('0x12')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller['destroy']);module[_0x7cca('0x13')]=router; \ No newline at end of file +var _0x6aa7=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','post','create','put','update','delete','exports','multer','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6aa7,0x178));var _0x76aa=function(_0x17155a,_0x11738d){_0x17155a=_0x17155a-0x0;var _0x25cd26=_0x6aa7[_0x17155a];return _0x25cd26;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0xc')]('/',auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0xe')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x10')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['destroy']);module[_0x76aa('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index aa085c8..a337d03 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x495054,_0x304104){var _0x146d2e=function(_0x350426){while(--_0x350426){_0x495054['push'](_0x495054['shift']());}};_0x146d2e(++_0x304104);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x2d6197,_0x82ebfb){var _0x4d0e75=function(_0x577e7a){while(--_0x577e7a){_0x2d6197['push'](_0x2d6197['shift']());}};_0x4d0e75(++_0x82ebfb);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4d6215,_0x4aa279){_0x4d6215=_0x4d6215-0x0;var _0x537133=_0xb43b[_0x4d6215];return _0x537133;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 5117ca4..a8dc776 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 _0xd544=['map','query','intersection','attributes','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','update','describe','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','type'];(function(_0x266de2,_0x480cb5){var _0xe93032=function(_0x34ca82){while(--_0x34ca82){_0x266de2['push'](_0x266de2['shift']());}};_0xe93032(++_0x480cb5);}(_0xd544,0x14d));var _0x4d54=function(_0x203515,_0x1e86f6){_0x203515=_0x203515-0x0;var _0x221dc0=_0xd544[_0x203515];return _0x221dc0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4d54('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4d54('0x1'));var moment=require(_0x4d54('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4d54('0x3'));var path=require(_0x4d54('0x4'));var sox=require('sox');var csv=require(_0x4d54('0x5'));var ejs=require(_0x4d54('0x6'));var fs=require('fs');var fs_extra=require(_0x4d54('0x7'));var _=require(_0x4d54('0x8'));var squel=require(_0x4d54('0x9'));var crypto=require('crypto');var jsforce=require(_0x4d54('0xa'));var deskjs=require(_0x4d54('0xb'));var toCsv=require(_0x4d54('0x5'));var querystring=require('querystring');var Papa=require(_0x4d54('0xc'));var Redis=require(_0x4d54('0xd'));var authService=require(_0x4d54('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4d54('0xf'));var hardwareService=require(_0x4d54('0x10'));var logger=require(_0x4d54('0x11'))(_0x4d54('0x12'));var utils=require(_0x4d54('0x13'));var config=require(_0x4d54('0x14'));var licenseUtil=require(_0x4d54('0x15'));var db=require(_0x4d54('0x16'))['db'];function respondWithStatusCode(_0x14175b,_0x6ace4e){_0x6ace4e=_0x6ace4e||0xcc;return function(_0x1f509a){if(_0x1f509a){return _0x14175b[_0x4d54('0x17')](_0x6ace4e);}return _0x14175b[_0x4d54('0x18')](_0x6ace4e)['end']();};}function respondWithResult(_0x3bfdad,_0x42115c){_0x42115c=_0x42115c||0xc8;return function(_0x180678){if(_0x180678){return _0x3bfdad[_0x4d54('0x18')](_0x42115c)[_0x4d54('0x19')](_0x180678);}};}function respondWithFilteredResult(_0x55137f,_0x48ac36){return function(_0x3311b4){if(_0x3311b4){var _0x763eac=typeof _0x48ac36['offset']===_0x4d54('0x1a')&&typeof _0x48ac36[_0x4d54('0x1b')]==='undefined';var _0x150049=_0x3311b4['count'];var _0x3d6ae5=_0x763eac?0x0:_0x48ac36['offset'];var _0x2f799f=_0x763eac?_0x3311b4[_0x4d54('0x1c')]:_0x48ac36[_0x4d54('0x1d')]+_0x48ac36['limit'];var _0x513c4c;if(_0x2f799f>=_0x150049){_0x2f799f=_0x150049;_0x513c4c=0xc8;}else{_0x513c4c=0xce;}_0x55137f['status'](_0x513c4c);return _0x55137f[_0x4d54('0x1e')](_0x4d54('0x1f'),_0x3d6ae5+'-'+_0x2f799f+'/'+_0x150049)[_0x4d54('0x19')](_0x3311b4);}return null;};}function patchUpdates(_0x54621a){return function(_0x5f1128){try{jsonpatch[_0x4d54('0x20')](_0x5f1128,_0x54621a,!![]);}catch(_0x5e17c3){return BPromise[_0x4d54('0x21')](_0x5e17c3);}return _0x5f1128[_0x4d54('0x22')]();};}function saveUpdates(_0x4dc2f0,_0x5ab0e1){return function(_0x2884b2){if(_0x2884b2){return _0x2884b2['update'](_0x4dc2f0)[_0x4d54('0x23')](function(_0xabb7db){return _0xabb7db;});}return null;};}function removeEntity(_0x5e009d,_0xfe574e){return function(_0x2b7d94){if(_0x2b7d94){return _0x2b7d94[_0x4d54('0x24')]()[_0x4d54('0x23')](function(){_0x5e009d[_0x4d54('0x18')](0xcc)[_0x4d54('0x25')]();});}};}function handleEntityNotFound(_0x5a6f8a,_0x739ea7){return function(_0x27e94d){if(!_0x27e94d){_0x5a6f8a[_0x4d54('0x17')](0x194);}return _0x27e94d;};}function handleError(_0x279922,_0x309e75){_0x309e75=_0x309e75||0x1f4;return function(_0x766957){logger[_0x4d54('0x26')](_0x766957[_0x4d54('0x27')]);if(_0x766957['name']){delete _0x766957[_0x4d54('0x28')];}_0x279922[_0x4d54('0x18')](_0x309e75)[_0x4d54('0x29')](_0x766957);};}exports[_0x4d54('0x2a')]=function(_0x246842,_0x16289e){var _0x281874={},_0x5904f9={},_0x494cdd={'count':0x0,'rows':[]};var _0x48f13e=_['map'](db[_0x4d54('0x2b')][_0x4d54('0x2c')],function(_0x529b49){return{'name':_0x529b49[_0x4d54('0x2d')],'type':_0x529b49[_0x4d54('0x2e')]['key']};});_0x5904f9['model']=_[_0x4d54('0x2f')](_0x48f13e,_0x4d54('0x28'));_0x5904f9['query']=_['keys'](_0x246842[_0x4d54('0x30')]);_0x5904f9['filters']=_[_0x4d54('0x31')](_0x5904f9['model'],_0x5904f9['query']);_0x281874[_0x4d54('0x32')]=_['intersection'](_0x5904f9['model'],qs['fields'](_0x246842[_0x4d54('0x30')]['fields']));_0x281874[_0x4d54('0x32')]=_0x281874['attributes']['length']?_0x281874['attributes']:_0x5904f9[_0x4d54('0x33')];if(!_0x246842[_0x4d54('0x30')][_0x4d54('0x34')](_0x4d54('0x35'))){_0x281874[_0x4d54('0x1b')]=qs[_0x4d54('0x1b')](_0x246842['query'][_0x4d54('0x1b')]);_0x281874[_0x4d54('0x1d')]=qs['offset'](_0x246842[_0x4d54('0x30')][_0x4d54('0x1d')]);}_0x281874[_0x4d54('0x36')]=qs[_0x4d54('0x37')](_0x246842[_0x4d54('0x30')][_0x4d54('0x37')]);_0x281874[_0x4d54('0x38')]=qs[_0x4d54('0x39')](_[_0x4d54('0x3a')](_0x246842['query'],_0x5904f9['filters']),_0x48f13e);if(_0x246842[_0x4d54('0x30')][_0x4d54('0x3b')]){_0x281874['where']=_[_0x4d54('0x3c')](_0x281874[_0x4d54('0x38')],{'$or':_[_0x4d54('0x2f')](_0x48f13e,function(_0x81d09){if(_0x81d09[_0x4d54('0x2e')]!=='VIRTUAL'){var _0x22b355={};_0x22b355[_0x81d09[_0x4d54('0x28')]]={'$like':'%'+_0x246842[_0x4d54('0x30')][_0x4d54('0x3b')]+'%'};return _0x22b355;}})});}_0x281874=_['merge']({},_0x281874,_0x246842[_0x4d54('0x3d')]);var _0x222238={'where':_0x281874[_0x4d54('0x38')]};return db[_0x4d54('0x2b')][_0x4d54('0x1c')](_0x222238)[_0x4d54('0x23')](function(_0x148633){_0x494cdd['count']=_0x148633;if(_0x246842[_0x4d54('0x30')][_0x4d54('0x3e')]){_0x281874[_0x4d54('0x3f')]=[{'all':!![]}];}return db[_0x4d54('0x2b')][_0x4d54('0x40')](_0x281874);})[_0x4d54('0x23')](function(_0x546404){_0x494cdd[_0x4d54('0x41')]=_0x546404;return _0x494cdd;})[_0x4d54('0x23')](respondWithFilteredResult(_0x16289e,_0x281874))[_0x4d54('0x42')](handleError(_0x16289e,null));};exports[_0x4d54('0x43')]=function(_0x42d079,_0x47da1d){var _0x35b628={'raw':!![],'where':{'id':_0x42d079[_0x4d54('0x44')]['id']}},_0x2b8060={};_0x2b8060['model']=_[_0x4d54('0x45')](db[_0x4d54('0x2b')][_0x4d54('0x2c')]);_0x2b8060[_0x4d54('0x30')]=_[_0x4d54('0x45')](_0x42d079[_0x4d54('0x30')]);_0x2b8060['filters']=_[_0x4d54('0x31')](_0x2b8060[_0x4d54('0x33')],_0x2b8060['query']);_0x35b628[_0x4d54('0x32')]=_[_0x4d54('0x31')](_0x2b8060['model'],qs[_0x4d54('0x46')](_0x42d079[_0x4d54('0x30')][_0x4d54('0x46')]));_0x35b628[_0x4d54('0x32')]=_0x35b628[_0x4d54('0x32')]['length']?_0x35b628[_0x4d54('0x32')]:_0x2b8060[_0x4d54('0x33')];if(_0x42d079['query'][_0x4d54('0x3e')]){_0x35b628[_0x4d54('0x3f')]=[{'all':!![]}];}_0x35b628=_[_0x4d54('0x3c')]({},_0x35b628,_0x42d079[_0x4d54('0x3d')]);return db[_0x4d54('0x2b')][_0x4d54('0x47')](_0x35b628)[_0x4d54('0x23')](handleEntityNotFound(_0x47da1d,null))[_0x4d54('0x23')](respondWithResult(_0x47da1d,null))[_0x4d54('0x42')](handleError(_0x47da1d,null));};exports[_0x4d54('0x48')]=function(_0x51806f,_0x39d3be){return db[_0x4d54('0x2b')]['create'](_0x51806f[_0x4d54('0x49')],{})[_0x4d54('0x23')](respondWithResult(_0x39d3be,0xc9))[_0x4d54('0x42')](handleError(_0x39d3be,null));};exports[_0x4d54('0x4a')]=function(_0x4ce304,_0x4681ba){if(_0x4ce304[_0x4d54('0x49')]['id']){delete _0x4ce304['body']['id'];}return db[_0x4d54('0x2b')]['find']({'where':{'id':_0x4ce304[_0x4d54('0x44')]['id']}})[_0x4d54('0x23')](handleEntityNotFound(_0x4681ba,null))['then'](saveUpdates(_0x4ce304[_0x4d54('0x49')],null))['then'](respondWithResult(_0x4681ba,null))[_0x4d54('0x42')](handleError(_0x4681ba,null));};exports[_0x4d54('0x24')]=function(_0x3d71c4,_0x4f46c8){return db[_0x4d54('0x2b')][_0x4d54('0x47')]({'where':{'id':_0x3d71c4[_0x4d54('0x44')]['id']}})[_0x4d54('0x23')](handleEntityNotFound(_0x4f46c8,null))['then'](removeEntity(_0x4f46c8,null))[_0x4d54('0x42')](handleError(_0x4f46c8,null));};exports[_0x4d54('0x4b')]=function(_0x24fcea,_0x212c4e){return db['SmsTransferReport'][_0x4d54('0x4b')]()['then'](respondWithResult(_0x212c4e,null))['catch'](handleError(_0x212c4e,null));}; \ No newline at end of file +var _0x94c2=['undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','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','end','json'];(function(_0x599694,_0x1523bc){var _0x1b5f39=function(_0x3c81f9){while(--_0x3c81f9){_0x599694['push'](_0x599694['shift']());}};_0x1b5f39(++_0x1523bc);}(_0x94c2,0x169));var _0x294c=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x94c2[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0x294c('0x0'));var rimraf=require(_0x294c('0x1'));var zipdir=require(_0x294c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x294c('0x3'));var BPromise=require(_0x294c('0x4'));var Mustache=require(_0x294c('0x5'));var util=require(_0x294c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x294c('0x7'));var ejs=require(_0x294c('0x8'));var fs=require('fs');var fs_extra=require(_0x294c('0x9'));var _=require(_0x294c('0xa'));var squel=require('squel');var crypto=require(_0x294c('0xb'));var jsforce=require(_0x294c('0xc'));var deskjs=require(_0x294c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x294c('0xe'));var Papa=require(_0x294c('0xf'));var Redis=require(_0x294c('0x10'));var authService=require(_0x294c('0x11'));var qs=require(_0x294c('0x12'));var as=require(_0x294c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x294c('0x14'))(_0x294c('0x15'));var utils=require(_0x294c('0x16'));var config=require(_0x294c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x294c('0x18'))['db'];function respondWithStatusCode(_0x352e75,_0x984c8){_0x984c8=_0x984c8||0xcc;return function(_0x14573a){if(_0x14573a){return _0x352e75[_0x294c('0x19')](_0x984c8);}return _0x352e75[_0x294c('0x1a')](_0x984c8)[_0x294c('0x1b')]();};}function respondWithResult(_0x2a4e1f,_0x8e8b44){_0x8e8b44=_0x8e8b44||0xc8;return function(_0xe5df39){if(_0xe5df39){return _0x2a4e1f[_0x294c('0x1a')](_0x8e8b44)[_0x294c('0x1c')](_0xe5df39);}};}function respondWithFilteredResult(_0x2720cb,_0x15e642){return function(_0x45c601){if(_0x45c601){var _0x8d188d=typeof _0x15e642['offset']===_0x294c('0x1d')&&typeof _0x15e642[_0x294c('0x1e')]===_0x294c('0x1d');var _0x4a8a6d=_0x45c601['count'];var _0x43c3e2=_0x8d188d?0x0:_0x15e642['offset'];var _0x2309ef=_0x8d188d?_0x45c601['count']:_0x15e642['offset']+_0x15e642['limit'];var _0x28cc21;if(_0x2309ef>=_0x4a8a6d){_0x2309ef=_0x4a8a6d;_0x28cc21=0xc8;}else{_0x28cc21=0xce;}_0x2720cb['status'](_0x28cc21);return _0x2720cb[_0x294c('0x1f')](_0x294c('0x20'),_0x43c3e2+'-'+_0x2309ef+'/'+_0x4a8a6d)[_0x294c('0x1c')](_0x45c601);}return null;};}function patchUpdates(_0x369729){return function(_0x598ada){try{jsonpatch[_0x294c('0x21')](_0x598ada,_0x369729,!![]);}catch(_0xb034be){return BPromise[_0x294c('0x22')](_0xb034be);}return _0x598ada[_0x294c('0x23')]();};}function saveUpdates(_0xda2e8e,_0x52de11){return function(_0x538ad1){if(_0x538ad1){return _0x538ad1[_0x294c('0x24')](_0xda2e8e)[_0x294c('0x25')](function(_0xf0ae8){return _0xf0ae8;});}return null;};}function removeEntity(_0x58ccd,_0x16e5a8){return function(_0x1919c4){if(_0x1919c4){return _0x1919c4[_0x294c('0x26')]()['then'](function(){_0x58ccd[_0x294c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25439e,_0x4c6ff6){return function(_0x2461f4){if(!_0x2461f4){_0x25439e[_0x294c('0x19')](0x194);}return _0x2461f4;};}function handleError(_0x2a9afe,_0x4a286f){_0x4a286f=_0x4a286f||0x1f4;return function(_0xd849c6){logger[_0x294c('0x27')](_0xd849c6['stack']);if(_0xd849c6['name']){delete _0xd849c6['name'];}_0x2a9afe['status'](_0x4a286f)[_0x294c('0x28')](_0xd849c6);};}exports[_0x294c('0x29')]=function(_0x133d2d,_0x1ee265){var _0x5a7912={},_0x2a3a4c={},_0x132a44={'count':0x0,'rows':[]};var _0xe3cbf4=_[_0x294c('0x2a')](db[_0x294c('0x2b')][_0x294c('0x2c')],function(_0x5269bb){return{'name':_0x5269bb[_0x294c('0x2d')],'type':_0x5269bb[_0x294c('0x2e')][_0x294c('0x2f')]};});_0x2a3a4c['model']=_[_0x294c('0x2a')](_0xe3cbf4,_0x294c('0x30'));_0x2a3a4c['query']=_[_0x294c('0x31')](_0x133d2d[_0x294c('0x32')]);_0x2a3a4c[_0x294c('0x33')]=_[_0x294c('0x34')](_0x2a3a4c[_0x294c('0x35')],_0x2a3a4c['query']);_0x5a7912[_0x294c('0x36')]=_['intersection'](_0x2a3a4c['model'],qs[_0x294c('0x37')](_0x133d2d[_0x294c('0x32')][_0x294c('0x37')]));_0x5a7912['attributes']=_0x5a7912['attributes'][_0x294c('0x38')]?_0x5a7912[_0x294c('0x36')]:_0x2a3a4c[_0x294c('0x35')];if(!_0x133d2d[_0x294c('0x32')][_0x294c('0x39')](_0x294c('0x3a'))){_0x5a7912[_0x294c('0x1e')]=qs[_0x294c('0x1e')](_0x133d2d[_0x294c('0x32')]['limit']);_0x5a7912[_0x294c('0x3b')]=qs[_0x294c('0x3b')](_0x133d2d[_0x294c('0x32')][_0x294c('0x3b')]);}_0x5a7912['order']=qs['sort'](_0x133d2d[_0x294c('0x32')]['sort']);_0x5a7912[_0x294c('0x3c')]=qs['filters'](_[_0x294c('0x3d')](_0x133d2d[_0x294c('0x32')],_0x2a3a4c[_0x294c('0x33')]),_0xe3cbf4);if(_0x133d2d[_0x294c('0x32')][_0x294c('0x3e')]){_0x5a7912['where']=_[_0x294c('0x3f')](_0x5a7912[_0x294c('0x3c')],{'$or':_[_0x294c('0x2a')](_0xe3cbf4,function(_0x464936){if(_0x464936[_0x294c('0x2e')]!==_0x294c('0x40')){var _0x38a5d0={};_0x38a5d0[_0x464936[_0x294c('0x30')]]={'$like':'%'+_0x133d2d['query'][_0x294c('0x3e')]+'%'};return _0x38a5d0;}})});}_0x5a7912=_[_0x294c('0x3f')]({},_0x5a7912,_0x133d2d[_0x294c('0x41')]);var _0xe91800={'where':_0x5a7912[_0x294c('0x3c')]};return db[_0x294c('0x2b')][_0x294c('0x42')](_0xe91800)['then'](function(_0x4ca3c0){_0x132a44[_0x294c('0x42')]=_0x4ca3c0;if(_0x133d2d[_0x294c('0x32')][_0x294c('0x43')]){_0x5a7912[_0x294c('0x44')]=[{'all':!![]}];}return db[_0x294c('0x2b')][_0x294c('0x45')](_0x5a7912);})[_0x294c('0x25')](function(_0x22cfdb){_0x132a44[_0x294c('0x46')]=_0x22cfdb;return _0x132a44;})['then'](respondWithFilteredResult(_0x1ee265,_0x5a7912))['catch'](handleError(_0x1ee265,null));};exports[_0x294c('0x47')]=function(_0x5b8dd5,_0xdbdfde){var _0x15e84e={'raw':!![],'where':{'id':_0x5b8dd5[_0x294c('0x48')]['id']}},_0x47b298={};_0x47b298['model']=_[_0x294c('0x31')](db[_0x294c('0x2b')][_0x294c('0x2c')]);_0x47b298[_0x294c('0x32')]=_['keys'](_0x5b8dd5['query']);_0x47b298['filters']=_[_0x294c('0x34')](_0x47b298[_0x294c('0x35')],_0x47b298[_0x294c('0x32')]);_0x15e84e[_0x294c('0x36')]=_[_0x294c('0x34')](_0x47b298[_0x294c('0x35')],qs[_0x294c('0x37')](_0x5b8dd5[_0x294c('0x32')][_0x294c('0x37')]));_0x15e84e['attributes']=_0x15e84e[_0x294c('0x36')][_0x294c('0x38')]?_0x15e84e[_0x294c('0x36')]:_0x47b298[_0x294c('0x35')];if(_0x5b8dd5[_0x294c('0x32')]['includeAll']){_0x15e84e['include']=[{'all':!![]}];}_0x15e84e=_[_0x294c('0x3f')]({},_0x15e84e,_0x5b8dd5[_0x294c('0x41')]);return db[_0x294c('0x2b')][_0x294c('0x49')](_0x15e84e)[_0x294c('0x25')](handleEntityNotFound(_0xdbdfde,null))['then'](respondWithResult(_0xdbdfde,null))['catch'](handleError(_0xdbdfde,null));};exports[_0x294c('0x4a')]=function(_0x48598f,_0x1ab58f){return db[_0x294c('0x2b')][_0x294c('0x4a')](_0x48598f[_0x294c('0x4b')],{})[_0x294c('0x25')](respondWithResult(_0x1ab58f,0xc9))[_0x294c('0x4c')](handleError(_0x1ab58f,null));};exports[_0x294c('0x24')]=function(_0x30903e,_0x148900){if(_0x30903e[_0x294c('0x4b')]['id']){delete _0x30903e[_0x294c('0x4b')]['id'];}return db[_0x294c('0x2b')][_0x294c('0x49')]({'where':{'id':_0x30903e[_0x294c('0x48')]['id']}})[_0x294c('0x25')](handleEntityNotFound(_0x148900,null))['then'](saveUpdates(_0x30903e[_0x294c('0x4b')],null))[_0x294c('0x25')](respondWithResult(_0x148900,null))[_0x294c('0x4c')](handleError(_0x148900,null));};exports[_0x294c('0x26')]=function(_0x4f1a86,_0x18194f){return db[_0x294c('0x2b')]['find']({'where':{'id':_0x4f1a86[_0x294c('0x48')]['id']}})[_0x294c('0x25')](handleEntityNotFound(_0x18194f,null))[_0x294c('0x25')](removeEntity(_0x18194f,null))[_0x294c('0x4c')](handleError(_0x18194f,null));};exports[_0x294c('0x4d')]=function(_0x567c06,_0x3b0a16){return db[_0x294c('0x2b')]['describe']()[_0x294c('0x25')](respondWithResult(_0x3b0a16,null))[_0x294c('0x4c')](handleError(_0x3b0a16,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 2625c2d..4f236e6 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 _0x2d07=['api','bluebird','request-promise','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x1d0cba,_0x2731b1){var _0xdc3278=function(_0x3b20f5){while(--_0x3b20f5){_0x1d0cba['push'](_0x1d0cba['shift']());}};_0xdc3278(++_0x2731b1);}(_0x2d07,0x176));var _0x72d0=function(_0x4dcecc,_0x3865b9){_0x4dcecc=_0x4dcecc-0x0;var _0x2aa658=_0x2d07[_0x4dcecc];return _0x2aa658;};'use strict';var _=require(_0x72d0('0x0'));var util=require(_0x72d0('0x1'));var logger=require(_0x72d0('0x2'))(_0x72d0('0x3'));var moment=require('moment');var BPromise=require(_0x72d0('0x4'));var rp=require(_0x72d0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x72d0('0x6'));var attributes=require(_0x72d0('0x7'));module[_0x72d0('0x8')]=function(_0xc96d0f,_0x3712b5){return _0xc96d0f[_0x72d0('0x9')](_0x72d0('0xa'),attributes,{'tableName':_0x72d0('0xb'),'paranoid':![],'indexes':[{'name':_0x72d0('0xc'),'fields':[_0x72d0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb81=['util','api','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','lodash'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xcb81,0x154));var _0x1cb8=function(_0x2ecc65,_0xd75c48){_0x2ecc65=_0x2ecc65-0x0;var _0x103cc3=_0xcb81[_0x2ecc65];return _0x103cc3;};'use strict';var _=require(_0x1cb8('0x0'));var util=require(_0x1cb8('0x1'));var logger=require('../../config/logger')(_0x1cb8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb8('0x3'));var rimraf=require(_0x1cb8('0x4'));var config=require(_0x1cb8('0x5'));var attributes=require(_0x1cb8('0x6'));module[_0x1cb8('0x7')]=function(_0x4e5c19,_0x98d682){return _0x4e5c19[_0x1cb8('0x8')]('SmsTransferReport',attributes,{'tableName':_0x1cb8('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb8('0xa'),'fields':[_0x1cb8('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index fe743e2..c3e0c6d 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 _0xa41a=['rpc','../../config/environment','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x59d73b,_0xd8e780){var _0x3ae655=function(_0x157a57){while(--_0x157a57){_0x59d73b['push'](_0x59d73b['shift']());}};_0x3ae655(++_0xd8e780);}(_0xa41a,0x6b));var _0xaa41=function(_0x4f2121,_0x155ef2){_0x4f2121=_0x4f2121-0x0;var _0x2a7c41=_0xa41a[_0x4f2121];return _0x2a7c41;};'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);});});} \ No newline at end of file +var _0x3ca4=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x51ece4,_0x39165c){var _0x2b7e27=function(_0x88b36e){while(--_0x88b36e){_0x51ece4['push'](_0x51ece4['shift']());}};_0x2b7e27(++_0x39165c);}(_0x3ca4,0x17d));var _0x43ca=function(_0x549b70,_0x4d4811){_0x549b70=_0x549b70-0x0;var _0x3e8ab7=_0x3ca4[_0x549b70];return _0x3e8ab7;};'use strict';var _=require(_0x43ca('0x0'));var util=require(_0x43ca('0x1'));var moment=require(_0x43ca('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43ca('0x3'));var db=require(_0x43ca('0x4'))['db'];var utils=require(_0x43ca('0x5'));var logger=require(_0x43ca('0x6'))(_0x43ca('0x7'));var config=require(_0x43ca('0x8'));var jayson=require(_0x43ca('0x9'));var client=jayson['client'][_0x43ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ba987,_0x2e6edf,_0x609e75){return new BPromise(function(_0x3147b3,_0x4669f5){return client[_0x43ca('0xb')](_0x1ba987,_0x609e75)[_0x43ca('0xc')](function(_0x4cd9b6){logger['info'](_0x43ca('0xd'),_0x2e6edf,_0x43ca('0xe'));logger[_0x43ca('0xf')](_0x43ca('0x10'),_0x2e6edf,'request\x20sent',JSON[_0x43ca('0x11')](_0x4cd9b6));if(_0x4cd9b6[_0x43ca('0x12')]){if(_0x4cd9b6[_0x43ca('0x12')][_0x43ca('0x13')]===0x1f4){logger[_0x43ca('0x12')](_0x43ca('0xd'),_0x2e6edf,_0x4cd9b6[_0x43ca('0x12')][_0x43ca('0x14')]);return _0x4669f5(_0x4cd9b6[_0x43ca('0x12')]['message']);}logger[_0x43ca('0x12')](_0x43ca('0xd'),_0x2e6edf,_0x4cd9b6['error'][_0x43ca('0x14')]);return _0x3147b3(_0x4cd9b6['error'][_0x43ca('0x14')]);}else{logger['info'](_0x43ca('0xd'),_0x2e6edf,_0x43ca('0xe'));_0x3147b3(_0x4cd9b6['result'][_0x43ca('0x14')]);}})[_0x43ca('0x15')](function(_0x14f9af){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x2e6edf,_0x14f9af);_0x4669f5(_0x14f9af);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 7d9b841..e27b4b9 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 _0xe67f=['../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','root','originalname','replace','format','%s-%s%s','now','extname','post','file','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2f1880,_0x3997df){var _0x5374b1=function(_0x4daf28){while(--_0x4daf28){_0x2f1880['push'](_0x2f1880['shift']());}};_0x5374b1(++_0x3997df);}(_0xe67f,0x1de));var _0xfe67=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe67f[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xfe67('0x0'));var util=require(_0xfe67('0x1'));var path=require(_0xfe67('0x2'));var timeout=require('connect-timeout');var express=require(_0xfe67('0x3'));var router=express[_0xfe67('0x4')]();var fs_extra=require(_0xfe67('0x5'));var auth=require(_0xfe67('0x6'));var interaction=require(_0xfe67('0x7'));var config=require(_0xfe67('0x8'));var controller=require(_0xfe67('0x9'));router[_0xfe67('0xa')]('/',auth[_0xfe67('0xb')](),controller['index']);router[_0xfe67('0xa')](_0xfe67('0xc'),auth[_0xfe67('0xb')](),controller[_0xfe67('0xd')]);router['get'](_0xfe67('0xe'),auth[_0xfe67('0xb')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x93e461,_0x52cc38,_0x5b4ba3){_0x5b4ba3(null,path['join'](config[_0xfe67('0xf')],'server/files/sounds/original/'));},'filename':function(_0x2eb325,_0x3ca085,_0x3b79c0){_0x3ca085[_0xfe67('0x10')]=_0x3ca085[_0xfe67('0x10')][_0xfe67('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3b79c0(null,util[_0xfe67('0x12')](_0xfe67('0x13'),path['basename'](_0x3ca085[_0xfe67('0x10')],path['extname'](_0x3ca085[_0xfe67('0x10')])),Date[_0xfe67('0x14')](),path[_0xfe67('0x15')](_0x3ca085[_0xfe67('0x10')])));}})});router[_0xfe67('0x16')]('/',upload['single'](_0xfe67('0x17')),controller['create']);router[_0xfe67('0x18')](_0xfe67('0xc'),auth[_0xfe67('0xb')](),controller[_0xfe67('0x19')]);router[_0xfe67('0x1a')](_0xfe67('0xc'),auth[_0xfe67('0xb')](),controller[_0xfe67('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x7a24=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','/:id','show','download','root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','single','file','create','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x25e10c,_0x49596a){var _0x5dfd94=function(_0x2f4bfb){while(--_0x2f4bfb){_0x25e10c['push'](_0x25e10c['shift']());}};_0x5dfd94(++_0x49596a);}(_0x7a24,0xaa));var _0x47a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a24[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x47a2('0x0'));var util=require(_0x47a2('0x1'));var path=require('path');var timeout=require(_0x47a2('0x2'));var express=require(_0x47a2('0x3'));var router=express[_0x47a2('0x4')]();var fs_extra=require(_0x47a2('0x5'));var auth=require(_0x47a2('0x6'));var interaction=require(_0x47a2('0x7'));var config=require('../../config/environment');var controller=require(_0x47a2('0x8'));router[_0x47a2('0x9')]('/',auth[_0x47a2('0xa')](),controller[_0x47a2('0xb')]);router[_0x47a2('0x9')](_0x47a2('0xc'),auth['isAuthenticated'](),controller[_0x47a2('0xd')]);router[_0x47a2('0x9')]('/:id/download',auth[_0x47a2('0xa')](),controller[_0x47a2('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4a87a7,_0x22ce34,_0x337658){_0x337658(null,path['join'](config[_0x47a2('0xf')],_0x47a2('0x10')));},'filename':function(_0x5e5ea6,_0xf4d422,_0x1b4a9c){_0xf4d422[_0x47a2('0x11')]=_0xf4d422[_0x47a2('0x11')][_0x47a2('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1b4a9c(null,util[_0x47a2('0x13')]('%s-%s%s',path[_0x47a2('0x14')](_0xf4d422[_0x47a2('0x11')],path[_0x47a2('0x15')](_0xf4d422[_0x47a2('0x11')])),Date[_0x47a2('0x16')](),path[_0x47a2('0x15')](_0xf4d422[_0x47a2('0x11')])));}})});router['post']('/',upload[_0x47a2('0x17')](_0x47a2('0x18')),controller[_0x47a2('0x19')]);router['put']('/:id',auth[_0x47a2('0xa')](),controller[_0x47a2('0x1a')]);router['delete']('/:id',auth[_0x47a2('0xa')](),controller[_0x47a2('0x1b')]);module[_0x47a2('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 7d2a904..8831b27 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 _0x2f46=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x24c67d,_0x5c8eba){var _0x1c1d49=function(_0x16857f){while(--_0x16857f){_0x24c67d['push'](_0x24c67d['shift']());}};_0x1c1d49(++_0x5c8eba);}(_0x2f46,0xdd));var _0x62f4=function(_0x340a57,_0xa7d50f){_0x340a57=_0x340a57-0x0;var _0xbc5cb=_0x2f46[_0x340a57];return _0xbc5cb;};'use strict';var Sequelize=require(_0x62f4('0x0'));module['exports']={'name':{'type':Sequelize[_0x62f4('0x1')],'unique':_0x62f4('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x62f4('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x62f4('0x1')]},'original_format':{'type':Sequelize[_0x62f4('0x1')]},'original_duration':{'type':Sequelize[_0x62f4('0x3')]},'original_sampleCount':{'type':Sequelize[_0x62f4('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x62f4('0x4')]},'original_sampleRate':{'type':Sequelize[_0x62f4('0x5')]},'converted_format':{'type':Sequelize[_0x62f4('0x1')]},'converted_duration':{'type':Sequelize[_0x62f4('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x62f4('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x373c=['sequelize','exports','name','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x38fb8b,_0x70dd0a){var _0x1ec681=function(_0x58f130){while(--_0x58f130){_0x38fb8b['push'](_0x38fb8b['shift']());}};_0x1ec681(++_0x70dd0a);}(_0x373c,0xa8));var _0xc373=function(_0x3cba93,_0x5c2fd8){_0x3cba93=_0x3cba93-0x0;var _0x4a2991=_0x373c[_0x3cba93];return _0x4a2991;};'use strict';var Sequelize=require(_0xc373('0x0'));module[_0xc373('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc373('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xc373('0x3')]},'display_name':{'type':Sequelize[_0xc373('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0xc373('0x3')]},'original_format':{'type':Sequelize[_0xc373('0x3')]},'original_duration':{'type':Sequelize[_0xc373('0x4')]},'original_sampleCount':{'type':Sequelize[_0xc373('0x5')]},'original_channelCount':{'type':Sequelize[_0xc373('0x6')]},'original_bitRate':{'type':Sequelize[_0xc373('0x5')]},'original_sampleRate':{'type':Sequelize[_0xc373('0x6')]},'converted_format':{'type':Sequelize[_0xc373('0x3')]},'converted_duration':{'type':Sequelize[_0xc373('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xc373('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xc373('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xc373('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 4539f63..fd011c2 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 _0x7cf8=['end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','get','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','Sound','findAll','rows','catch','show','params','keys','includeAll','include','download','save_name','converted_format','join','server/files/sounds/converted','Sequelize','root','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','converted_sampleCount','converted_bitRate','converted_sampleRate','sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','Sounds','autoAssociation','UserProfileResource','start','update','description','delete','original_format','rimraf','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x3c0c1,_0x1f6c00){var _0x2f9d3c=function(_0x4a8f8b){while(--_0x4a8f8b){_0x3c0c1['push'](_0x3c0c1['shift']());}};_0x2f9d3c(++_0x1f6c00);}(_0x7cf8,0xde));var _0x87cf=function(_0x46a8d2,_0x5c151c){_0x46a8d2=_0x46a8d2-0x0;var _0x5447ac=_0x7cf8[_0x46a8d2];return _0x5447ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87cf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x87cf('0x1'));var util=require(_0x87cf('0x2'));var path=require(_0x87cf('0x3'));var sox=require(_0x87cf('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x87cf('0x5'));var _=require(_0x87cf('0x6'));var squel=require('squel');var crypto=require(_0x87cf('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x87cf('0x8'));var toCsv=require(_0x87cf('0x9'));var querystring=require(_0x87cf('0xa'));var Papa=require(_0x87cf('0xb'));var Redis=require(_0x87cf('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x87cf('0xd'));var as=require(_0x87cf('0xe'));var hardwareService=require(_0x87cf('0xf'));var logger=require(_0x87cf('0x10'))(_0x87cf('0x11'));var utils=require(_0x87cf('0x12'));var config=require(_0x87cf('0x13'));var licenseUtil=require(_0x87cf('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e3b72,_0xd60be6){_0xd60be6=_0xd60be6||0xcc;return function(_0x195d95){if(_0x195d95){return _0x3e3b72[_0x87cf('0x15')](_0xd60be6);}return _0x3e3b72['status'](_0xd60be6)[_0x87cf('0x16')]();};}function respondWithResult(_0x544a95,_0x39815d){_0x39815d=_0x39815d||0xc8;return function(_0x8c69c5){if(_0x8c69c5){return _0x544a95[_0x87cf('0x17')](_0x39815d)[_0x87cf('0x18')](_0x8c69c5);}};}function respondWithFilteredResult(_0x4f639b,_0x2fe6a3){return function(_0x1a960e){if(_0x1a960e){var _0x226831=typeof _0x2fe6a3[_0x87cf('0x19')]===_0x87cf('0x1a')&&typeof _0x2fe6a3[_0x87cf('0x1b')]==='undefined';var _0x31e7ef=_0x1a960e[_0x87cf('0x1c')];var _0x172267=_0x226831?0x0:_0x2fe6a3['offset'];var _0x440f1f=_0x226831?_0x1a960e[_0x87cf('0x1c')]:_0x2fe6a3[_0x87cf('0x19')]+_0x2fe6a3['limit'];var _0x12c09a;if(_0x440f1f>=_0x31e7ef){_0x440f1f=_0x31e7ef;_0x12c09a=0xc8;}else{_0x12c09a=0xce;}_0x4f639b[_0x87cf('0x17')](_0x12c09a);return _0x4f639b[_0x87cf('0x1d')](_0x87cf('0x1e'),_0x172267+'-'+_0x440f1f+'/'+_0x31e7ef)[_0x87cf('0x18')](_0x1a960e);}return null;};}function patchUpdates(_0xc324c6){return function(_0x8fecff){try{jsonpatch['apply'](_0x8fecff,_0xc324c6,!![]);}catch(_0x523390){return BPromise[_0x87cf('0x1f')](_0x523390);}return _0x8fecff[_0x87cf('0x20')]();};}function saveUpdates(_0x2ab371,_0x54d44d){return function(_0x4836f5){if(_0x4836f5){return _0x4836f5['update'](_0x2ab371)['then'](function(_0x4aeab4){return _0x4aeab4;});}return null;};}function removeEntity(_0x1d9cf3,_0x120600){return function(_0x1aa290){if(_0x1aa290){return _0x1aa290[_0x87cf('0x21')]()['then'](function(){var _0x14f2f9=_0x1aa290[_0x87cf('0x22')]({'plain':!![]});var _0x41f4f5='Sounds';return db['UserProfileResource']['destroy']({'where':{'type':_0x41f4f5,'resourceId':_0x14f2f9['id']}})[_0x87cf('0x23')](function(){return _0x1aa290;});})['then'](function(){_0x1d9cf3[_0x87cf('0x17')](0xcc)[_0x87cf('0x16')]();});}};}function handleEntityNotFound(_0x109069,_0x225023){return function(_0x10aec2){if(!_0x10aec2){_0x109069[_0x87cf('0x15')](0x194);}return _0x10aec2;};}function handleError(_0x570190,_0x5e5147){_0x5e5147=_0x5e5147||0x1f4;return function(_0x1a75eb){logger[_0x87cf('0x24')](_0x1a75eb[_0x87cf('0x25')]);if(_0x1a75eb[_0x87cf('0x26')]){delete _0x1a75eb['name'];}_0x570190[_0x87cf('0x17')](_0x5e5147)[_0x87cf('0x27')](_0x1a75eb);};}exports[_0x87cf('0x28')]=function(_0x37fa5a,_0x37bbf6){var _0x38abdc={},_0x34dfd5={},_0x3de636={'count':0x0,'rows':[]};var _0x180620=_[_0x87cf('0x29')](db['Sound'][_0x87cf('0x2a')],function(_0x1c2bf7){return{'name':_0x1c2bf7['fieldName'],'type':_0x1c2bf7[_0x87cf('0x2b')][_0x87cf('0x2c')]};});_0x34dfd5[_0x87cf('0x2d')]=_[_0x87cf('0x29')](_0x180620,_0x87cf('0x26'));_0x34dfd5[_0x87cf('0x2e')]=_['keys'](_0x37fa5a['query']);_0x34dfd5[_0x87cf('0x2f')]=_[_0x87cf('0x30')](_0x34dfd5[_0x87cf('0x2d')],_0x34dfd5[_0x87cf('0x2e')]);_0x38abdc[_0x87cf('0x31')]=_['intersection'](_0x34dfd5[_0x87cf('0x2d')],qs[_0x87cf('0x32')](_0x37fa5a[_0x87cf('0x2e')]['fields']));_0x38abdc[_0x87cf('0x31')]=_0x38abdc[_0x87cf('0x31')][_0x87cf('0x33')]?_0x38abdc[_0x87cf('0x31')]:_0x34dfd5[_0x87cf('0x2d')];if(!_0x37fa5a[_0x87cf('0x2e')][_0x87cf('0x34')](_0x87cf('0x35'))){_0x38abdc['limit']=qs[_0x87cf('0x1b')](_0x37fa5a['query'][_0x87cf('0x1b')]);_0x38abdc[_0x87cf('0x19')]=qs[_0x87cf('0x19')](_0x37fa5a[_0x87cf('0x2e')][_0x87cf('0x19')]);}_0x38abdc[_0x87cf('0x36')]=qs[_0x87cf('0x37')](_0x37fa5a['query'][_0x87cf('0x37')]);_0x38abdc[_0x87cf('0x38')]=qs[_0x87cf('0x2f')](_[_0x87cf('0x39')](_0x37fa5a['query'],_0x34dfd5['filters']),_0x180620);if(_0x37fa5a[_0x87cf('0x2e')]['filter']){_0x38abdc[_0x87cf('0x38')]=_[_0x87cf('0x3a')](_0x38abdc['where'],{'$or':_['map'](_0x180620,function(_0x3a5e33){if(_0x3a5e33[_0x87cf('0x2b')]!==_0x87cf('0x3b')){var _0x17b263={};_0x17b263[_0x3a5e33[_0x87cf('0x26')]]={'$like':'%'+_0x37fa5a[_0x87cf('0x2e')]['filter']+'%'};return _0x17b263;}})});}_0x38abdc=_[_0x87cf('0x3a')]({},_0x38abdc,_0x37fa5a[_0x87cf('0x3c')]);var _0x145ec9={'where':_0x38abdc['where']};return db['Sound'][_0x87cf('0x1c')](_0x145ec9)['then'](function(_0x3ed71f){_0x3de636['count']=_0x3ed71f;if(_0x37fa5a[_0x87cf('0x2e')]['includeAll']){_0x38abdc['include']=[{'all':!![]}];}return db[_0x87cf('0x3d')][_0x87cf('0x3e')](_0x38abdc);})[_0x87cf('0x23')](function(_0x3d2c7c){_0x3de636[_0x87cf('0x3f')]=_0x3d2c7c;return _0x3de636;})['then'](respondWithFilteredResult(_0x37bbf6,_0x38abdc))[_0x87cf('0x40')](handleError(_0x37bbf6,null));};exports[_0x87cf('0x41')]=function(_0x3ba239,_0x14aabd){var _0x124c34={'raw':!![],'where':{'id':_0x3ba239[_0x87cf('0x42')]['id']}},_0x48cff9={};_0x48cff9[_0x87cf('0x2d')]=_[_0x87cf('0x43')](db[_0x87cf('0x3d')][_0x87cf('0x2a')]);_0x48cff9[_0x87cf('0x2e')]=_[_0x87cf('0x43')](_0x3ba239[_0x87cf('0x2e')]);_0x48cff9[_0x87cf('0x2f')]=_[_0x87cf('0x30')](_0x48cff9[_0x87cf('0x2d')],_0x48cff9[_0x87cf('0x2e')]);_0x124c34[_0x87cf('0x31')]=_[_0x87cf('0x30')](_0x48cff9[_0x87cf('0x2d')],qs[_0x87cf('0x32')](_0x3ba239[_0x87cf('0x2e')][_0x87cf('0x32')]));_0x124c34['attributes']=_0x124c34[_0x87cf('0x31')][_0x87cf('0x33')]?_0x124c34[_0x87cf('0x31')]:_0x48cff9['model'];if(_0x3ba239['query'][_0x87cf('0x44')]){_0x124c34[_0x87cf('0x45')]=[{'all':!![]}];}_0x124c34=_[_0x87cf('0x3a')]({},_0x124c34,_0x3ba239[_0x87cf('0x3c')]);return db['Sound']['find'](_0x124c34)[_0x87cf('0x23')](handleEntityNotFound(_0x14aabd,null))[_0x87cf('0x23')](respondWithResult(_0x14aabd,null))['catch'](handleError(_0x14aabd,null));};exports[_0x87cf('0x46')]=function(_0x2977cb,_0x29f48b,_0x21407b){return db[_0x87cf('0x3d')]['find']({'where':{'id':_0x2977cb[_0x87cf('0x42')]['id']},'attributes':[_0x87cf('0x26'),_0x87cf('0x47'),_0x87cf('0x48')],'raw':!![]})[_0x87cf('0x23')](handleEntityNotFound(_0x29f48b,null))[_0x87cf('0x23')](function(_0x4f5f32){if(_0x4f5f32){if(!fs['existsSync'](path[_0x87cf('0x49')](config['root'],_0x87cf('0x4a'),_0x4f5f32[_0x87cf('0x47')]+'.'+_0x4f5f32[_0x87cf('0x48')]))){throw new db[(_0x87cf('0x4b'))]['ValidationError']('Sound\x20not\x20found');}return _0x29f48b[_0x87cf('0x46')](path[_0x87cf('0x49')](config[_0x87cf('0x4c')],_0x87cf('0x4a'),util[_0x87cf('0x4d')](_0x87cf('0x4e'),_0x4f5f32[_0x87cf('0x47')],_0x4f5f32['converted_format'])),util[_0x87cf('0x4d')](_0x87cf('0x4e'),_0x4f5f32[_0x87cf('0x26')],_0x4f5f32[_0x87cf('0x48')]));}return null;})['catch'](handleError(_0x29f48b,null));};exports[_0x87cf('0x4f')]=function(_0x1f0a94,_0x56c802,_0x5adb9e){var _0x207122={'name':path[_0x87cf('0x50')](_0x1f0a94[_0x87cf('0x51')][_0x87cf('0x52')],path[_0x87cf('0x53')](_0x1f0a94['file'][_0x87cf('0x52')])),'save_name':path[_0x87cf('0x50')](_0x1f0a94[_0x87cf('0x51')][_0x87cf('0x54')],path[_0x87cf('0x53')](_0x1f0a94['file'][_0x87cf('0x54')])),'original_format':path[_0x87cf('0x53')](_0x1f0a94[_0x87cf('0x51')][_0x87cf('0x52')])[_0x87cf('0x55')](0x1),'converted_format':_0x87cf('0x56')};var _0xd738f9=path[_0x87cf('0x49')](config[_0x87cf('0x4c')],_0x87cf('0x57'),_0x1f0a94[_0x87cf('0x51')]['filename']);var _0x4a5aac=path[_0x87cf('0x49')](config[_0x87cf('0x4c')],'server/files/sounds/converted',util[_0x87cf('0x4d')](_0x87cf('0x4e'),path['basename'](_0x1f0a94[_0x87cf('0x51')][_0x87cf('0x54')],path[_0x87cf('0x53')](_0x1f0a94[_0x87cf('0x51')][_0x87cf('0x54')])),_0x207122[_0x87cf('0x48')]));logger[_0x87cf('0x58')](_0x87cf('0x59'),_0xd738f9);logger[_0x87cf('0x58')]('Sound\x20upload\x20destination:\x20%s',_0x4a5aac);try{fs[_0x87cf('0x5a')](_0xd738f9,parseInt(_0x87cf('0x5b'),0x8));var _0xdb0842=sox[_0x87cf('0x5c')](_0xd738f9,_0x4a5aac,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xdb0842['on'](_0x87cf('0x24'),function(_0x5ae01e){fs[_0x87cf('0x5d')](_0xd738f9);_0x56c802[_0x87cf('0x17')](0x1f4)[_0x87cf('0x27')](_0x5ae01e);});_0xdb0842['on'](_0x87cf('0x5e'),function(_0x355f1c){_0x207122[_0x87cf('0x5f')]=isNaN(_0x355f1c[_0x87cf('0x60')])?null:_0x355f1c[_0x87cf('0x60')]*0x3e8;_0x207122[_0x87cf('0x61')]=isNaN(_0x355f1c['sampleCount'])?null:_0x355f1c[_0x87cf('0x62')];_0x207122[_0x87cf('0x63')]=isNaN(_0x355f1c['channelCount'])?null:_0x355f1c[_0x87cf('0x64')];_0x207122[_0x87cf('0x65')]=isNaN(_0x355f1c[_0x87cf('0x66')])?null:_0x355f1c[_0x87cf('0x66')];_0x207122[_0x87cf('0x67')]=isNaN(_0x355f1c['sampleRate'])?null:_0x355f1c['sampleRate'];});_0xdb0842['on']('dest',function(_0x4e7756){_0x207122['converted_duration']=isNaN(_0x4e7756[_0x87cf('0x60')])?null:_0x4e7756[_0x87cf('0x60')]*0x3e8;_0x207122[_0x87cf('0x68')]=isNaN(_0x4e7756[_0x87cf('0x62')])?null:_0x4e7756[_0x87cf('0x62')];_0x207122['converted_channelCount']=isNaN(_0x4e7756[_0x87cf('0x64')])?null:_0x4e7756[_0x87cf('0x64')];_0x207122[_0x87cf('0x69')]=isNaN(_0x4e7756[_0x87cf('0x66')])?null:_0x4e7756[_0x87cf('0x66')];_0x207122[_0x87cf('0x6a')]=isNaN(_0x4e7756[_0x87cf('0x6b')])?null:_0x4e7756[_0x87cf('0x6b')];});_0xdb0842['on'](_0x87cf('0x16'),function(){fs['chmodSync'](_0x4a5aac,parseInt('0777',0x8));return db[_0x87cf('0x3d')][_0x87cf('0x4f')](_0x207122)[_0x87cf('0x23')](function(_0x4d1062){var _0x54614f={'role':_0x1f0a94[_0x87cf('0x6c')][_0x87cf('0x6d')],'userProfileId':_0x1f0a94[_0x87cf('0x6c')][_0x87cf('0x6e')]};if(!_0x54614f)throw new Error(_0x87cf('0x6f'));if(_0x54614f[_0x87cf('0x6d')]==='user'){var _0x3690f2=_0x4d1062[_0x87cf('0x22')]({'plain':!![]});return db[_0x87cf('0x70')][_0x87cf('0x71')]({'where':{'name':_0x87cf('0x72'),'userProfileId':_0x54614f[_0x87cf('0x6e')]},'raw':!![]})[_0x87cf('0x23')](function(_0x44f28e){if(_0x44f28e&&_0x44f28e[_0x87cf('0x73')]===0x0){return db[_0x87cf('0x74')][_0x87cf('0x4f')]({'name':_0x3690f2[_0x87cf('0x26')],'resourceId':_0x3690f2['id'],'type':_0x44f28e[_0x87cf('0x26')],'sectionId':_0x44f28e['id']},{})[_0x87cf('0x23')](function(){return _0x4d1062;});}else{return _0x4d1062;}})[_0x87cf('0x40')](function(_0x248d61){logger[_0x87cf('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x248d61);throw _0x248d61;});}return _0x4d1062;})['then'](respondWithResult(_0x56c802,null))[_0x87cf('0x40')](handleError(_0x56c802,null));});_0xdb0842[_0x87cf('0x75')]();}catch(_0xb858c2){_0x56c802[_0x87cf('0x17')](0x1f4)[_0x87cf('0x27')](_0xb858c2);}};exports[_0x87cf('0x76')]=function(_0x15d15d,_0x598c1c,_0x1af3ff){return db[_0x87cf('0x3d')][_0x87cf('0x71')]({'where':{'id':_0x15d15d[_0x87cf('0x42')]['id']}})[_0x87cf('0x23')](handleEntityNotFound(_0x598c1c,null))['then'](saveUpdates(_[_0x87cf('0x39')](_0x15d15d[_0x87cf('0x6c')],[_0x87cf('0x26'),_0x87cf('0x77')]),null))[_0x87cf('0x23')](respondWithResult(_0x598c1c,null))[_0x87cf('0x40')](handleError(_0x598c1c,null));};exports[_0x87cf('0x78')]=function(_0x5119f7,_0x4dbd4b,_0x4e6d19){return db[_0x87cf('0x3d')]['find']({'where':{'id':_0x5119f7[_0x87cf('0x42')]['id']}})[_0x87cf('0x23')](function(_0x1a3d64){if(_0x1a3d64){return _0x1a3d64[_0x87cf('0x21')]();}})[_0x87cf('0x23')](function(_0x323041){var _0x287655=path[_0x87cf('0x49')](config[_0x87cf('0x4c')],'server/files/sounds/original',util[_0x87cf('0x4d')]('%s.%s',_0x323041['save_name'],_0x323041[_0x87cf('0x79')]));var _0x4b7ef7=path[_0x87cf('0x49')](config[_0x87cf('0x4c')],_0x87cf('0x4a'),util[_0x87cf('0x4d')]('%s.%s',_0x323041['save_name'],_0x323041[_0x87cf('0x48')]));fs['unlinkSync'](_0x287655);fs[_0x87cf('0x5d')](_0x4b7ef7);return _0x323041;})[_0x87cf('0x23')](function(_0x5a61c4){if(_0x5a61c4){return _0x4dbd4b[_0x87cf('0x17')](0xcc)[_0x87cf('0x16')]();}})[_0x87cf('0x23')](handleEntityNotFound(_0x4dbd4b,null))['catch'](handleError(_0x4dbd4b,null));}; \ No newline at end of file +var _0xb132=['query','attributes','fields','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','rows','catch','params','keys','intersection','includeAll','download','save_name','converted_format','existsSync','join','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','root','format','%s.%s','create','basename','originalname','extname','file','substring','filename','Sound\x20upload\x20filepath:\x20%s','0777','wav','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','body','userProfileId','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','find','destroy','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','save','update','then','get','Sounds','end','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xb132,0x13b));var _0x2b13=function(_0x548d7d,_0x2d41fc){_0x548d7d=_0x548d7d-0x0;var _0xb1c878=_0xb132[_0x548d7d];return _0xb1c878;};'use strict';var emlformat=require(_0x2b13('0x0'));var rimraf=require(_0x2b13('0x1'));var zipdir=require(_0x2b13('0x2'));var jsonpatch=require(_0x2b13('0x3'));var rp=require(_0x2b13('0x4'));var moment=require(_0x2b13('0x5'));var BPromise=require(_0x2b13('0x6'));var Mustache=require(_0x2b13('0x7'));var util=require(_0x2b13('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x2b13('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b13('0xa'));var _=require(_0x2b13('0xb'));var squel=require(_0x2b13('0xc'));var crypto=require(_0x2b13('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2b13('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2b13('0xf'));var Papa=require('papaparse');var Redis=require(_0x2b13('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2b13('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b13('0x12'))(_0x2b13('0x13'));var utils=require(_0x2b13('0x14'));var config=require(_0x2b13('0x15'));var licenseUtil=require(_0x2b13('0x16'));var db=require(_0x2b13('0x17'))['db'];function respondWithStatusCode(_0x3c8280,_0x3d3b72){_0x3d3b72=_0x3d3b72||0xcc;return function(_0x333599){if(_0x333599){return _0x3c8280[_0x2b13('0x18')](_0x3d3b72);}return _0x3c8280[_0x2b13('0x19')](_0x3d3b72)['end']();};}function respondWithResult(_0x49eacd,_0x232eef){_0x232eef=_0x232eef||0xc8;return function(_0x2624ca){if(_0x2624ca){return _0x49eacd['status'](_0x232eef)['json'](_0x2624ca);}};}function respondWithFilteredResult(_0x280ea4,_0xf84d8c){return function(_0x461012){if(_0x461012){var _0x39d6ba=typeof _0xf84d8c[_0x2b13('0x1a')]===_0x2b13('0x1b')&&typeof _0xf84d8c[_0x2b13('0x1c')]==='undefined';var _0x524fdd=_0x461012[_0x2b13('0x1d')];var _0x5686ee=_0x39d6ba?0x0:_0xf84d8c[_0x2b13('0x1a')];var _0x3bf903=_0x39d6ba?_0x461012['count']:_0xf84d8c[_0x2b13('0x1a')]+_0xf84d8c[_0x2b13('0x1c')];var _0x232a39;if(_0x3bf903>=_0x524fdd){_0x3bf903=_0x524fdd;_0x232a39=0xc8;}else{_0x232a39=0xce;}_0x280ea4[_0x2b13('0x19')](_0x232a39);return _0x280ea4[_0x2b13('0x1e')]('Content-Range',_0x5686ee+'-'+_0x3bf903+'/'+_0x524fdd)[_0x2b13('0x1f')](_0x461012);}return null;};}function patchUpdates(_0x318767){return function(_0x2f7f75){try{jsonpatch[_0x2b13('0x20')](_0x2f7f75,_0x318767,!![]);}catch(_0x2522e4){return BPromise['reject'](_0x2522e4);}return _0x2f7f75[_0x2b13('0x21')]();};}function saveUpdates(_0x1e06dd,_0x56ae71){return function(_0x1a2f3d){if(_0x1a2f3d){return _0x1a2f3d[_0x2b13('0x22')](_0x1e06dd)['then'](function(_0x2253e0){return _0x2253e0;});}return null;};}function removeEntity(_0x44f19b,_0x22d0ce){return function(_0x2db891){if(_0x2db891){return _0x2db891['destroy']()[_0x2b13('0x23')](function(){var _0x112de1=_0x2db891[_0x2b13('0x24')]({'plain':!![]});var _0x1dc0e1=_0x2b13('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x1dc0e1,'resourceId':_0x112de1['id']}})[_0x2b13('0x23')](function(){return _0x2db891;});})['then'](function(){_0x44f19b[_0x2b13('0x19')](0xcc)[_0x2b13('0x26')]();});}};}function handleEntityNotFound(_0x1b7db0,_0x26ae32){return function(_0x54d870){if(!_0x54d870){_0x1b7db0[_0x2b13('0x18')](0x194);}return _0x54d870;};}function handleError(_0x469a66,_0x1133d3){_0x1133d3=_0x1133d3||0x1f4;return function(_0x2007f9){logger[_0x2b13('0x27')](_0x2007f9[_0x2b13('0x28')]);if(_0x2007f9['name']){delete _0x2007f9[_0x2b13('0x29')];}_0x469a66[_0x2b13('0x19')](_0x1133d3)[_0x2b13('0x2a')](_0x2007f9);};}exports[_0x2b13('0x2b')]=function(_0x238d08,_0x118534){var _0x83a6ac={},_0x263e28={},_0x18f07e={'count':0x0,'rows':[]};var _0xcd7b35=_[_0x2b13('0x2c')](db[_0x2b13('0x2d')][_0x2b13('0x2e')],function(_0x30ea36){return{'name':_0x30ea36[_0x2b13('0x2f')],'type':_0x30ea36[_0x2b13('0x30')][_0x2b13('0x31')]};});_0x263e28[_0x2b13('0x32')]=_[_0x2b13('0x2c')](_0xcd7b35,_0x2b13('0x29'));_0x263e28[_0x2b13('0x33')]=_['keys'](_0x238d08[_0x2b13('0x33')]);_0x263e28['filters']=_['intersection'](_0x263e28[_0x2b13('0x32')],_0x263e28[_0x2b13('0x33')]);_0x83a6ac[_0x2b13('0x34')]=_['intersection'](_0x263e28['model'],qs[_0x2b13('0x35')](_0x238d08[_0x2b13('0x33')][_0x2b13('0x35')]));_0x83a6ac[_0x2b13('0x34')]=_0x83a6ac[_0x2b13('0x34')][_0x2b13('0x36')]?_0x83a6ac[_0x2b13('0x34')]:_0x263e28[_0x2b13('0x32')];if(!_0x238d08[_0x2b13('0x33')]['hasOwnProperty']('nolimit')){_0x83a6ac[_0x2b13('0x1c')]=qs[_0x2b13('0x1c')](_0x238d08[_0x2b13('0x33')][_0x2b13('0x1c')]);_0x83a6ac['offset']=qs[_0x2b13('0x1a')](_0x238d08[_0x2b13('0x33')]['offset']);}_0x83a6ac[_0x2b13('0x37')]=qs[_0x2b13('0x38')](_0x238d08['query'][_0x2b13('0x38')]);_0x83a6ac[_0x2b13('0x39')]=qs[_0x2b13('0x3a')](_[_0x2b13('0x3b')](_0x238d08[_0x2b13('0x33')],_0x263e28['filters']),_0xcd7b35);if(_0x238d08[_0x2b13('0x33')]['filter']){_0x83a6ac[_0x2b13('0x39')]=_[_0x2b13('0x3c')](_0x83a6ac[_0x2b13('0x39')],{'$or':_[_0x2b13('0x2c')](_0xcd7b35,function(_0x21115d){if(_0x21115d[_0x2b13('0x30')]!==_0x2b13('0x3d')){var _0x2a903a={};_0x2a903a[_0x21115d['name']]={'$like':'%'+_0x238d08[_0x2b13('0x33')][_0x2b13('0x3e')]+'%'};return _0x2a903a;}})});}_0x83a6ac=_[_0x2b13('0x3c')]({},_0x83a6ac,_0x238d08[_0x2b13('0x3f')]);var _0x18ccd7={'where':_0x83a6ac['where']};return db[_0x2b13('0x2d')][_0x2b13('0x1d')](_0x18ccd7)['then'](function(_0xfcca67){_0x18f07e[_0x2b13('0x1d')]=_0xfcca67;if(_0x238d08[_0x2b13('0x33')]['includeAll']){_0x83a6ac[_0x2b13('0x40')]=[{'all':!![]}];}return db[_0x2b13('0x2d')]['findAll'](_0x83a6ac);})[_0x2b13('0x23')](function(_0x80d130){_0x18f07e[_0x2b13('0x41')]=_0x80d130;return _0x18f07e;})['then'](respondWithFilteredResult(_0x118534,_0x83a6ac))[_0x2b13('0x42')](handleError(_0x118534,null));};exports['show']=function(_0x5e802f,_0x5141f6){var _0x3345ac={'raw':!![],'where':{'id':_0x5e802f[_0x2b13('0x43')]['id']}},_0x4d55b6={};_0x4d55b6[_0x2b13('0x32')]=_[_0x2b13('0x44')](db[_0x2b13('0x2d')][_0x2b13('0x2e')]);_0x4d55b6[_0x2b13('0x33')]=_[_0x2b13('0x44')](_0x5e802f[_0x2b13('0x33')]);_0x4d55b6['filters']=_['intersection'](_0x4d55b6['model'],_0x4d55b6[_0x2b13('0x33')]);_0x3345ac['attributes']=_[_0x2b13('0x45')](_0x4d55b6[_0x2b13('0x32')],qs[_0x2b13('0x35')](_0x5e802f[_0x2b13('0x33')][_0x2b13('0x35')]));_0x3345ac[_0x2b13('0x34')]=_0x3345ac[_0x2b13('0x34')][_0x2b13('0x36')]?_0x3345ac[_0x2b13('0x34')]:_0x4d55b6[_0x2b13('0x32')];if(_0x5e802f['query'][_0x2b13('0x46')]){_0x3345ac['include']=[{'all':!![]}];}_0x3345ac=_['merge']({},_0x3345ac,_0x5e802f[_0x2b13('0x3f')]);return db[_0x2b13('0x2d')]['find'](_0x3345ac)[_0x2b13('0x23')](handleEntityNotFound(_0x5141f6,null))[_0x2b13('0x23')](respondWithResult(_0x5141f6,null))[_0x2b13('0x42')](handleError(_0x5141f6,null));};exports[_0x2b13('0x47')]=function(_0x1d6bea,_0x44b8c1,_0xfaec40){return db[_0x2b13('0x2d')]['find']({'where':{'id':_0x1d6bea['params']['id']},'attributes':[_0x2b13('0x29'),_0x2b13('0x48'),_0x2b13('0x49')],'raw':!![]})[_0x2b13('0x23')](handleEntityNotFound(_0x44b8c1,null))[_0x2b13('0x23')](function(_0x12bb2d){if(_0x12bb2d){if(!fs[_0x2b13('0x4a')](path[_0x2b13('0x4b')](config['root'],_0x2b13('0x4c'),_0x12bb2d[_0x2b13('0x48')]+'.'+_0x12bb2d['converted_format']))){throw new db['Sequelize'][(_0x2b13('0x4d'))](_0x2b13('0x4e'));}return _0x44b8c1[_0x2b13('0x47')](path[_0x2b13('0x4b')](config[_0x2b13('0x4f')],_0x2b13('0x4c'),util[_0x2b13('0x50')](_0x2b13('0x51'),_0x12bb2d[_0x2b13('0x48')],_0x12bb2d[_0x2b13('0x49')])),util[_0x2b13('0x50')](_0x2b13('0x51'),_0x12bb2d[_0x2b13('0x29')],_0x12bb2d[_0x2b13('0x49')]));}return null;})[_0x2b13('0x42')](handleError(_0x44b8c1,null));};exports[_0x2b13('0x52')]=function(_0x3faaa5,_0x4e7f00,_0x18812a){var _0x3de088={'name':path[_0x2b13('0x53')](_0x3faaa5['file'][_0x2b13('0x54')],path[_0x2b13('0x55')](_0x3faaa5['file'][_0x2b13('0x54')])),'save_name':path['basename'](_0x3faaa5[_0x2b13('0x56')]['filename'],path[_0x2b13('0x55')](_0x3faaa5[_0x2b13('0x56')]['filename'])),'original_format':path['extname'](_0x3faaa5['file'][_0x2b13('0x54')])[_0x2b13('0x57')](0x1),'converted_format':'wav'};var _0x1fd9ea=path[_0x2b13('0x4b')](config['root'],'server/files/sounds/original',_0x3faaa5['file'][_0x2b13('0x58')]);var _0x44e56b=path[_0x2b13('0x4b')](config[_0x2b13('0x4f')],_0x2b13('0x4c'),util[_0x2b13('0x50')](_0x2b13('0x51'),path[_0x2b13('0x53')](_0x3faaa5[_0x2b13('0x56')][_0x2b13('0x58')],path[_0x2b13('0x55')](_0x3faaa5[_0x2b13('0x56')][_0x2b13('0x58')])),_0x3de088[_0x2b13('0x49')]));logger['info'](_0x2b13('0x59'),_0x1fd9ea);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x44e56b);try{fs['chmodSync'](_0x1fd9ea,parseInt(_0x2b13('0x5a'),0x8));var _0x1452c9=sox['transcode'](_0x1fd9ea,_0x44e56b,{'sampleRate':0x1f40,'format':_0x2b13('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1452c9['on']('error',function(_0x623faa){fs[_0x2b13('0x5c')](_0x1fd9ea);_0x4e7f00[_0x2b13('0x19')](0x1f4)[_0x2b13('0x2a')](_0x623faa);});_0x1452c9['on'](_0x2b13('0x5d'),function(_0x4b60d9){_0x3de088['original_duration']=isNaN(_0x4b60d9[_0x2b13('0x5e')])?null:_0x4b60d9[_0x2b13('0x5e')]*0x3e8;_0x3de088[_0x2b13('0x5f')]=isNaN(_0x4b60d9['sampleCount'])?null:_0x4b60d9[_0x2b13('0x60')];_0x3de088[_0x2b13('0x61')]=isNaN(_0x4b60d9[_0x2b13('0x62')])?null:_0x4b60d9[_0x2b13('0x62')];_0x3de088[_0x2b13('0x63')]=isNaN(_0x4b60d9[_0x2b13('0x64')])?null:_0x4b60d9[_0x2b13('0x64')];_0x3de088[_0x2b13('0x65')]=isNaN(_0x4b60d9[_0x2b13('0x66')])?null:_0x4b60d9[_0x2b13('0x66')];});_0x1452c9['on'](_0x2b13('0x67'),function(_0x41aa36){_0x3de088[_0x2b13('0x68')]=isNaN(_0x41aa36['duration'])?null:_0x41aa36[_0x2b13('0x5e')]*0x3e8;_0x3de088['converted_sampleCount']=isNaN(_0x41aa36[_0x2b13('0x60')])?null:_0x41aa36[_0x2b13('0x60')];_0x3de088[_0x2b13('0x69')]=isNaN(_0x41aa36[_0x2b13('0x62')])?null:_0x41aa36['channelCount'];_0x3de088[_0x2b13('0x6a')]=isNaN(_0x41aa36[_0x2b13('0x64')])?null:_0x41aa36[_0x2b13('0x64')];_0x3de088[_0x2b13('0x6b')]=isNaN(_0x41aa36[_0x2b13('0x66')])?null:_0x41aa36[_0x2b13('0x66')];});_0x1452c9['on'](_0x2b13('0x26'),function(){fs[_0x2b13('0x6c')](_0x44e56b,parseInt(_0x2b13('0x5a'),0x8));return db[_0x2b13('0x2d')][_0x2b13('0x52')](_0x3de088)[_0x2b13('0x23')](function(_0x3ac574){var _0x3e7309={'role':_0x3faaa5['body']['role'],'userProfileId':_0x3faaa5[_0x2b13('0x6d')][_0x2b13('0x6e')]};if(!_0x3e7309)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e7309['role']==='user'){var _0x441780=_0x3ac574[_0x2b13('0x24')]({'plain':!![]});return db[_0x2b13('0x6f')]['find']({'where':{'name':_0x2b13('0x25'),'userProfileId':_0x3e7309[_0x2b13('0x6e')]},'raw':!![]})[_0x2b13('0x23')](function(_0x1bea5b){if(_0x1bea5b&&_0x1bea5b[_0x2b13('0x70')]===0x0){return db[_0x2b13('0x71')][_0x2b13('0x52')]({'name':_0x441780[_0x2b13('0x29')],'resourceId':_0x441780['id'],'type':_0x1bea5b[_0x2b13('0x29')],'sectionId':_0x1bea5b['id']},{})[_0x2b13('0x23')](function(){return _0x3ac574;});}else{return _0x3ac574;}})[_0x2b13('0x42')](function(_0x3228ea){logger['error'](_0x2b13('0x72'),_0x3228ea);throw _0x3228ea;});}return _0x3ac574;})['then'](respondWithResult(_0x4e7f00,null))['catch'](handleError(_0x4e7f00,null));});_0x1452c9[_0x2b13('0x73')]();}catch(_0x42641b){_0x4e7f00['status'](0x1f4)[_0x2b13('0x2a')](_0x42641b);}};exports[_0x2b13('0x22')]=function(_0x54ba0a,_0x18230a,_0x3f5ce9){return db[_0x2b13('0x2d')]['find']({'where':{'id':_0x54ba0a[_0x2b13('0x43')]['id']}})[_0x2b13('0x23')](handleEntityNotFound(_0x18230a,null))[_0x2b13('0x23')](saveUpdates(_[_0x2b13('0x3b')](_0x54ba0a['body'],[_0x2b13('0x29'),_0x2b13('0x74')]),null))['then'](respondWithResult(_0x18230a,null))[_0x2b13('0x42')](handleError(_0x18230a,null));};exports[_0x2b13('0x75')]=function(_0x2f18cf,_0x50d7ba,_0x1c0996){return db['Sound'][_0x2b13('0x76')]({'where':{'id':_0x2f18cf['params']['id']}})[_0x2b13('0x23')](function(_0x46d4e8){if(_0x46d4e8){return _0x46d4e8[_0x2b13('0x77')]();}})[_0x2b13('0x23')](function(_0x4b24a8){var _0x52a479=path[_0x2b13('0x4b')](config[_0x2b13('0x4f')],_0x2b13('0x78'),util['format'](_0x2b13('0x51'),_0x4b24a8[_0x2b13('0x48')],_0x4b24a8[_0x2b13('0x79')]));var _0x265be8=path[_0x2b13('0x4b')](config[_0x2b13('0x4f')],'server/files/sounds/converted',util[_0x2b13('0x50')]('%s.%s',_0x4b24a8['save_name'],_0x4b24a8[_0x2b13('0x49')]));fs[_0x2b13('0x5c')](_0x52a479);fs[_0x2b13('0x5c')](_0x265be8);return _0x4b24a8;})[_0x2b13('0x23')](function(_0x1e4b58){if(_0x1e4b58){return _0x50d7ba['status'](0xcc)['end']();}})[_0x2b13('0x23')](handleEntityNotFound(_0x50d7ba,null))[_0x2b13('0x42')](handleError(_0x50d7ba,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index c2ec4c8..2f789c2 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 _0xe2d0=['moment','bluebird','request-promise','path','rimraf','./sound.attributes','exports','define','tools_sounds','lodash','util','../../config/logger','api'];(function(_0x2652ef,_0x234230){var _0x2db578=function(_0x56b137){while(--_0x56b137){_0x2652ef['push'](_0x2652ef['shift']());}};_0x2db578(++_0x234230);}(_0xe2d0,0x1d0));var _0x0e2d=function(_0x422a93,_0xcaa914){_0x422a93=_0x422a93-0x0;var _0xae0bdd=_0xe2d0[_0x422a93];return _0xae0bdd;};'use strict';var _=require(_0x0e2d('0x0'));var util=require(_0x0e2d('0x1'));var logger=require(_0x0e2d('0x2'))(_0x0e2d('0x3'));var moment=require(_0x0e2d('0x4'));var BPromise=require(_0x0e2d('0x5'));var rp=require(_0x0e2d('0x6'));var fs=require('fs');var path=require(_0x0e2d('0x7'));var rimraf=require(_0x0e2d('0x8'));var config=require('../../config/environment');var attributes=require(_0x0e2d('0x9'));module[_0x0e2d('0xa')]=function(_0x35c146,_0x420ab6){return _0x35c146[_0x0e2d('0xb')]('Sound',attributes,{'tableName':_0x0e2d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9698=['tools_sounds','bluebird','../../config/environment','./sound.attributes','define','Sound'];(function(_0x82140,_0x3a9d87){var _0x2b15a6=function(_0x2b565e){while(--_0x2b565e){_0x82140['push'](_0x82140['shift']());}};_0x2b15a6(++_0x3a9d87);}(_0x9698,0x16f));var _0x8969=function(_0x3955bf,_0x2085ef){_0x3955bf=_0x3955bf-0x0;var _0x176c3b=_0x9698[_0x3955bf];return _0x176c3b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8969('0x0'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8969('0x1'));var attributes=require(_0x8969('0x2'));module['exports']=function(_0xd5a50c,_0x3f7507){return _0xd5a50c[_0x8969('0x3')](_0x8969('0x4'),attributes,{'tableName':_0x8969('0x5'),'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 089d124..61bd000 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 _0x3de5=['info','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Sound,\x20%s,\x20%s','message','result','ShowSound','find','options','raw','where','map','include','attributes','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then'];(function(_0xf6bb7d,_0x8af4f5){var _0x132764=function(_0x4f6309){while(--_0x4f6309){_0xf6bb7d['push'](_0xf6bb7d['shift']());}};_0x132764(++_0x8af4f5);}(_0x3de5,0x102));var _0x53de=function(_0x221f37,_0x17904c){_0x221f37=_0x221f37-0x0;var _0x237985=_0x3de5[_0x221f37];return _0x237985;};'use strict';var _=require(_0x53de('0x0'));var util=require('util');var moment=require(_0x53de('0x1'));var BPromise=require(_0x53de('0x2'));var rs=require(_0x53de('0x3'));var fs=require('fs');var Redis=require(_0x53de('0x4'));var db=require(_0x53de('0x5'))['db'];var utils=require(_0x53de('0x6'));var logger=require(_0x53de('0x7'))(_0x53de('0x8'));var config=require('../../config/environment');var jayson=require(_0x53de('0x9'));var client=jayson['client'][_0x53de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e3e9f,_0x1dbf1c,_0x5928dc){return new BPromise(function(_0x4e015c,_0xd5b1fc){return client['request'](_0x3e3e9f,_0x5928dc)[_0x53de('0xb')](function(_0x409c79){logger[_0x53de('0xc')]('Sound,\x20%s,\x20%s',_0x1dbf1c,'request\x20sent');logger['debug'](_0x53de('0xd'),_0x1dbf1c,_0x53de('0xe'),JSON[_0x53de('0xf')](_0x409c79));if(_0x409c79['error']){if(_0x409c79[_0x53de('0x10')][_0x53de('0x11')]===0x1f4){logger[_0x53de('0x10')](_0x53de('0x12'),_0x1dbf1c,_0x409c79[_0x53de('0x10')][_0x53de('0x13')]);return _0xd5b1fc(_0x409c79[_0x53de('0x10')][_0x53de('0x13')]);}logger[_0x53de('0x10')]('Sound,\x20%s,\x20%s',_0x1dbf1c,_0x409c79[_0x53de('0x10')][_0x53de('0x13')]);return _0x4e015c(_0x409c79[_0x53de('0x10')][_0x53de('0x13')]);}else{logger[_0x53de('0xc')]('Sound,\x20%s,\x20%s',_0x1dbf1c,_0x53de('0xe'));_0x4e015c(_0x409c79[_0x53de('0x14')][_0x53de('0x13')]);}})['catch'](function(_0x57a681){logger['error'](_0x53de('0x12'),_0x1dbf1c,_0x57a681);_0xd5b1fc(_0x57a681);});});}exports[_0x53de('0x15')]=function(_0x11b552){var _0x2738e9=this;return new Promise(function(_0x73246,_0x80a900){return db['Sound'][_0x53de('0x16')]({'raw':_0x11b552[_0x53de('0x17')]?_0x11b552[_0x53de('0x17')][_0x53de('0x18')]===undefined?!![]:![]:!![],'where':_0x11b552[_0x53de('0x17')]?_0x11b552[_0x53de('0x17')][_0x53de('0x19')]||null:null,'attributes':_0x11b552[_0x53de('0x17')]?_0x11b552['options']['attributes']||null:null,'include':_0x11b552['options']?_0x11b552['options']['include']?_[_0x53de('0x1a')](_0x11b552[_0x53de('0x17')]['include'],function(_0x455fd9){return{'model':db[_0x455fd9['model']],'as':_0x455fd9['as'],'attributes':_0x455fd9['attributes'],'include':_0x455fd9['include']?_[_0x53de('0x1a')](_0x455fd9[_0x53de('0x1b')],function(_0x24b38e){return{'model':db[_0x24b38e['model']],'as':_0x24b38e['as'],'attributes':_0x24b38e['attributes'],'include':_0x24b38e[_0x53de('0x1b')]?_[_0x53de('0x1a')](_0x24b38e[_0x53de('0x1b')],function(_0x2c9e19){return{'model':db[_0x2c9e19['model']],'as':_0x2c9e19['as'],'attributes':_0x2c9e19[_0x53de('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x53de('0xb')](function(_0x4b4fc7){logger[_0x53de('0xc')](_0x53de('0x15'),_0x11b552);logger['debug'](_0x53de('0x15'),_0x11b552,JSON[_0x53de('0xf')](_0x4b4fc7));_0x73246(_0x4b4fc7);})[_0x53de('0x1d')](function(_0x5ae57b){logger[_0x53de('0x10')]('ShowSound',_0x5ae57b['message'],_0x11b552);_0x80a900(_0x2738e9[_0x53de('0x10')](0x1f4,_0x5ae57b['message']));});});}; \ No newline at end of file +var _0x194a=['http','request','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','options','raw','where','attributes','include','map','model','then','ShowSound','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3020fc,_0x242d93){var _0x304235=function(_0x284dd1){while(--_0x284dd1){_0x3020fc['push'](_0x3020fc['shift']());}};_0x304235(++_0x242d93);}(_0x194a,0xaa));var _0xa194=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0x194a[_0x5a2285];return _0x48f6ed;};'use strict';var _=require(_0xa194('0x0'));var util=require(_0xa194('0x1'));var moment=require(_0xa194('0x2'));var BPromise=require(_0xa194('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa194('0x4'))['db'];var utils=require(_0xa194('0x5'));var logger=require(_0xa194('0x6'))(_0xa194('0x7'));var config=require(_0xa194('0x8'));var jayson=require(_0xa194('0x9'));var client=jayson['client'][_0xa194('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a5d78,_0x1298e,_0x1509c0){return new BPromise(function(_0x1f17c8,_0x42347d){return client[_0xa194('0xb')](_0x2a5d78,_0x1509c0)['then'](function(_0x19b1c8){logger[_0xa194('0xc')](_0xa194('0xd'),_0x1298e,'request\x20sent');logger[_0xa194('0xe')](_0xa194('0xf'),_0x1298e,_0xa194('0x10'),JSON['stringify'](_0x19b1c8));if(_0x19b1c8[_0xa194('0x11')]){if(_0x19b1c8[_0xa194('0x11')]['code']===0x1f4){logger['error'](_0xa194('0xd'),_0x1298e,_0x19b1c8[_0xa194('0x11')][_0xa194('0x12')]);return _0x42347d(_0x19b1c8[_0xa194('0x11')][_0xa194('0x12')]);}logger['error'](_0xa194('0xd'),_0x1298e,_0x19b1c8['error'][_0xa194('0x12')]);return _0x1f17c8(_0x19b1c8[_0xa194('0x11')][_0xa194('0x12')]);}else{logger[_0xa194('0xc')](_0xa194('0xd'),_0x1298e,'request\x20sent');_0x1f17c8(_0x19b1c8['result'][_0xa194('0x12')]);}})[_0xa194('0x13')](function(_0x5cc726){logger[_0xa194('0x11')](_0xa194('0xd'),_0x1298e,_0x5cc726);_0x42347d(_0x5cc726);});});}exports['ShowSound']=function(_0x52c534){var _0x261386=this;return new Promise(function(_0x2f0a13,_0x4d76ee){return db['Sound']['find']({'raw':_0x52c534['options']?_0x52c534[_0xa194('0x14')][_0xa194('0x15')]===undefined?!![]:![]:!![],'where':_0x52c534[_0xa194('0x14')]?_0x52c534[_0xa194('0x14')][_0xa194('0x16')]||null:null,'attributes':_0x52c534[_0xa194('0x14')]?_0x52c534[_0xa194('0x14')][_0xa194('0x17')]||null:null,'include':_0x52c534[_0xa194('0x14')]?_0x52c534[_0xa194('0x14')][_0xa194('0x18')]?_[_0xa194('0x19')](_0x52c534[_0xa194('0x14')]['include'],function(_0x1c583b){return{'model':db[_0x1c583b[_0xa194('0x1a')]],'as':_0x1c583b['as'],'attributes':_0x1c583b[_0xa194('0x17')],'include':_0x1c583b['include']?_[_0xa194('0x19')](_0x1c583b[_0xa194('0x18')],function(_0x3522ab){return{'model':db[_0x3522ab[_0xa194('0x1a')]],'as':_0x3522ab['as'],'attributes':_0x3522ab['attributes'],'include':_0x3522ab[_0xa194('0x18')]?_[_0xa194('0x19')](_0x3522ab[_0xa194('0x18')],function(_0x4efde5){return{'model':db[_0x4efde5[_0xa194('0x1a')]],'as':_0x4efde5['as'],'attributes':_0x4efde5['attributes']};}):[]};}):[]};}):[]:[]})[_0xa194('0x1b')](function(_0x379e1c){logger[_0xa194('0xc')](_0xa194('0x1c'),_0x52c534);logger[_0xa194('0xe')](_0xa194('0x1c'),_0x52c534,JSON[_0xa194('0x1d')](_0x379e1c));_0x2f0a13(_0x379e1c);})[_0xa194('0x13')](function(_0x4140bc){logger[_0xa194('0x11')]('ShowSound',_0x4140bc[_0xa194('0x12')],_0x52c534);_0x4d76ee(_0x261386[_0xa194('0x11')](0x1f4,_0x4140bc[_0xa194('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 31d05e5..f009dfb 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 _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x2674cf,_0x852a1){var _0x54a8b8=function(_0x57be6d){while(--_0x57be6d){_0x2674cf['push'](_0x2674cf['shift']());}};_0x54a8b8(++_0x852a1);}(_0x757a,0xde));var _0xa757=function(_0x502c23,_0x503750){_0x502c23=_0x502c23-0x0;var _0x548c94=_0x757a[_0x502c23];return _0x548c94;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=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(_0x48a77,_0x1a1b28){var _0x223bdc=function(_0x250db7){while(--_0x250db7){_0x48a77['push'](_0x48a77['shift']());}};_0x223bdc(++_0x1a1b28);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xb7e7[_0x2aec52];return _0x3b8835;};'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 941d164..607aa5b 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 _0xbbf9=['ENUM','out','sequelize','exports','STRING','TEXT','medium'];(function(_0x497613,_0x2ded69){var _0xd0efe=function(_0xc0fbd1){while(--_0xc0fbd1){_0x497613['push'](_0x497613['shift']());}};_0xd0efe(++_0x2ded69);}(_0xbbf9,0x191));var _0x9bbf=function(_0x10dac7,_0x3ed996){_0x10dac7=_0x10dac7-0x0;var _0x1bffb6=_0xbbf9[_0x10dac7];return _0x1bffb6;};'use strict';var Sequelize=require(_0x9bbf('0x0'));module[_0x9bbf('0x1')]={'uniqueid':{'type':Sequelize[_0x9bbf('0x2')]},'body':{'type':Sequelize[_0x9bbf('0x3')](_0x9bbf('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x9bbf('0x5')]('in',_0x9bbf('0x6')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x9bbf('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb6c8=['medium','out','TEXT','sequelize','exports','STRING'];(function(_0x40644d,_0x4ed061){var _0x5630aa=function(_0x22fcaf){while(--_0x22fcaf){_0x40644d['push'](_0x40644d['shift']());}};_0x5630aa(++_0x4ed061);}(_0xb6c8,0x14d));var _0x8b6c=function(_0x113ff6,_0x58cede){_0x113ff6=_0x113ff6-0x0;var _0x4b33cb=_0xb6c8[_0x113ff6];return _0x4b33cb;};'use strict';var Sequelize=require(_0x8b6c('0x0'));module[_0x8b6c('0x1')]={'uniqueid':{'type':Sequelize[_0x8b6c('0x2')]},'body':{'type':Sequelize['TEXT'](_0x8b6c('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8b6c('0x4')),'defaultValue':_0x8b6c('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x8b6c('0x2')]},'providerResponse':{'type':Sequelize[_0x8b6c('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index bbe6f95..84854ff 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 _0xc2c7=['nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc2c7,0x134));var _0x7c2c=function(_0x12e428,_0x3ad891){_0x12e428=_0x12e428-0x0;var _0x564df9=_0xc2c7[_0x12e428];return _0x564df9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['SquareMessage'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['SquareMessage'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));}; \ No newline at end of file +var _0x3266=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','set','Content-Range','save','update','then','destroy','end','stack','name','send','index','map','SquareMessage','rawAttributes','type'];(function(_0x291f07,_0x1db9f5){var _0x385c40=function(_0x5f2e30){while(--_0x5f2e30){_0x291f07['push'](_0x291f07['shift']());}};_0x385c40(++_0x1db9f5);}(_0x3266,0x6a));var _0x6326=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0x3266[_0x12ca5f];return _0xfc3ae9;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];function respondWithStatusCode(_0x379358,_0x5c07e1){_0x5c07e1=_0x5c07e1||0xcc;return function(_0x5381d0){if(_0x5381d0){return _0x379358[_0x6326('0x1c')](_0x5c07e1);}return _0x379358[_0x6326('0x1d')](_0x5c07e1)['end']();};}function respondWithResult(_0x425878,_0x4caef3){_0x4caef3=_0x4caef3||0xc8;return function(_0x2d2d9b){if(_0x2d2d9b){return _0x425878[_0x6326('0x1d')](_0x4caef3)[_0x6326('0x1e')](_0x2d2d9b);}};}function respondWithFilteredResult(_0x41c352,_0x1ed3a3){return function(_0x2c1879){if(_0x2c1879){var _0x55923a=typeof _0x1ed3a3[_0x6326('0x1f')]==='undefined'&&typeof _0x1ed3a3['limit']==='undefined';var _0x51e7b9=_0x2c1879['count'];var _0x58e960=_0x55923a?0x0:_0x1ed3a3[_0x6326('0x1f')];var _0x1f4c11=_0x55923a?_0x2c1879[_0x6326('0x20')]:_0x1ed3a3['offset']+_0x1ed3a3['limit'];var _0x954ed5;if(_0x1f4c11>=_0x51e7b9){_0x1f4c11=_0x51e7b9;_0x954ed5=0xc8;}else{_0x954ed5=0xce;}_0x41c352[_0x6326('0x1d')](_0x954ed5);return _0x41c352[_0x6326('0x21')](_0x6326('0x22'),_0x58e960+'-'+_0x1f4c11+'/'+_0x51e7b9)[_0x6326('0x1e')](_0x2c1879);}return null;};}function patchUpdates(_0x25957a){return function(_0x21ee7d){try{jsonpatch['apply'](_0x21ee7d,_0x25957a,!![]);}catch(_0x22307f){return BPromise['reject'](_0x22307f);}return _0x21ee7d[_0x6326('0x23')]();};}function saveUpdates(_0x3c6cfa,_0x2482ef){return function(_0x24fb78){if(_0x24fb78){return _0x24fb78[_0x6326('0x24')](_0x3c6cfa)[_0x6326('0x25')](function(_0x225555){return _0x225555;});}return null;};}function removeEntity(_0x429bb0,_0x4781cc){return function(_0x2d0d00){if(_0x2d0d00){return _0x2d0d00[_0x6326('0x26')]()['then'](function(){_0x429bb0[_0x6326('0x1d')](0xcc)[_0x6326('0x27')]();});}};}function handleEntityNotFound(_0x575701,_0x4e272b){return function(_0x4d28fd){if(!_0x4d28fd){_0x575701[_0x6326('0x1c')](0x194);}return _0x4d28fd;};}function handleError(_0x4dae28,_0x33c466){_0x33c466=_0x33c466||0x1f4;return function(_0x1a48da){logger['error'](_0x1a48da[_0x6326('0x28')]);if(_0x1a48da[_0x6326('0x29')]){delete _0x1a48da[_0x6326('0x29')];}_0x4dae28[_0x6326('0x1d')](_0x33c466)[_0x6326('0x2a')](_0x1a48da);};}exports[_0x6326('0x2b')]=function(_0x40e036,_0x27802c){var _0x461e0f={},_0x127744={},_0x4980f6={'count':0x0,'rows':[]};var _0x2a8873=_[_0x6326('0x2c')](db[_0x6326('0x2d')][_0x6326('0x2e')],function(_0x20c5ab){return{'name':_0x20c5ab['fieldName'],'type':_0x20c5ab[_0x6326('0x2f')][_0x6326('0x30')]};});_0x127744[_0x6326('0x31')]=_['map'](_0x2a8873,_0x6326('0x29'));_0x127744['query']=_['keys'](_0x40e036[_0x6326('0x32')]);_0x127744[_0x6326('0x33')]=_[_0x6326('0x34')](_0x127744[_0x6326('0x31')],_0x127744[_0x6326('0x32')]);_0x461e0f[_0x6326('0x35')]=_[_0x6326('0x34')](_0x127744[_0x6326('0x31')],qs[_0x6326('0x36')](_0x40e036[_0x6326('0x32')][_0x6326('0x36')]));_0x461e0f[_0x6326('0x35')]=_0x461e0f['attributes'][_0x6326('0x37')]?_0x461e0f[_0x6326('0x35')]:_0x127744['model'];if(!_0x40e036[_0x6326('0x32')][_0x6326('0x38')](_0x6326('0x39'))){_0x461e0f['limit']=qs[_0x6326('0x3a')](_0x40e036['query']['limit']);_0x461e0f[_0x6326('0x1f')]=qs[_0x6326('0x1f')](_0x40e036[_0x6326('0x32')]['offset']);}_0x461e0f[_0x6326('0x3b')]=qs['sort'](_0x40e036[_0x6326('0x32')]['sort']);_0x461e0f[_0x6326('0x3c')]=qs[_0x6326('0x33')](_[_0x6326('0x3d')](_0x40e036[_0x6326('0x32')],_0x127744[_0x6326('0x33')]),_0x2a8873);if(_0x40e036[_0x6326('0x32')]['filter']){_0x461e0f[_0x6326('0x3c')]=_[_0x6326('0x3e')](_0x461e0f['where'],{'$or':_[_0x6326('0x2c')](_0x2a8873,function(_0x5ae140){if(_0x5ae140['type']!==_0x6326('0x3f')){var _0x1f8dcf={};_0x1f8dcf[_0x5ae140[_0x6326('0x29')]]={'$like':'%'+_0x40e036[_0x6326('0x32')][_0x6326('0x40')]+'%'};return _0x1f8dcf;}})});}_0x461e0f=_[_0x6326('0x3e')]({},_0x461e0f,_0x40e036['options']);var _0x485bed={'where':_0x461e0f[_0x6326('0x3c')]};return db['SquareMessage'][_0x6326('0x20')](_0x485bed)['then'](function(_0x282f33){_0x4980f6[_0x6326('0x20')]=_0x282f33;if(_0x40e036[_0x6326('0x32')][_0x6326('0x41')]){_0x461e0f[_0x6326('0x42')]=[{'all':!![]}];}return db[_0x6326('0x2d')][_0x6326('0x43')](_0x461e0f);})[_0x6326('0x25')](function(_0x3b089b){_0x4980f6[_0x6326('0x44')]=_0x3b089b;return _0x4980f6;})[_0x6326('0x25')](respondWithFilteredResult(_0x27802c,_0x461e0f))['catch'](handleError(_0x27802c,null));};exports[_0x6326('0x45')]=function(_0x5ce03a,_0x29f2fd){var _0x1d9d4c={'raw':!![],'where':{'id':_0x5ce03a[_0x6326('0x46')]['id']}},_0x16fc33={};_0x16fc33['model']=_[_0x6326('0x47')](db[_0x6326('0x2d')]['rawAttributes']);_0x16fc33[_0x6326('0x32')]=_[_0x6326('0x47')](_0x5ce03a[_0x6326('0x32')]);_0x16fc33[_0x6326('0x33')]=_['intersection'](_0x16fc33[_0x6326('0x31')],_0x16fc33[_0x6326('0x32')]);_0x1d9d4c[_0x6326('0x35')]=_[_0x6326('0x34')](_0x16fc33[_0x6326('0x31')],qs[_0x6326('0x36')](_0x5ce03a[_0x6326('0x32')]['fields']));_0x1d9d4c[_0x6326('0x35')]=_0x1d9d4c[_0x6326('0x35')][_0x6326('0x37')]?_0x1d9d4c[_0x6326('0x35')]:_0x16fc33['model'];if(_0x5ce03a[_0x6326('0x32')]['includeAll']){_0x1d9d4c[_0x6326('0x42')]=[{'all':!![]}];}_0x1d9d4c=_[_0x6326('0x3e')]({},_0x1d9d4c,_0x5ce03a[_0x6326('0x48')]);return db[_0x6326('0x2d')][_0x6326('0x49')](_0x1d9d4c)['then'](handleEntityNotFound(_0x29f2fd,null))[_0x6326('0x25')](respondWithResult(_0x29f2fd,null))['catch'](handleError(_0x29f2fd,null));};exports['create']=function(_0x2bca12,_0x44cf9d){return db['SquareMessage'][_0x6326('0x4a')](_0x2bca12[_0x6326('0x4b')],{})[_0x6326('0x25')](respondWithResult(_0x44cf9d,0xc9))[_0x6326('0x4c')](handleError(_0x44cf9d,null));};exports[_0x6326('0x24')]=function(_0x4f8dc0,_0x4af0ee){if(_0x4f8dc0[_0x6326('0x4b')]['id']){delete _0x4f8dc0[_0x6326('0x4b')]['id'];}return db[_0x6326('0x2d')][_0x6326('0x49')]({'where':{'id':_0x4f8dc0[_0x6326('0x46')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x4af0ee,null))[_0x6326('0x25')](saveUpdates(_0x4f8dc0['body'],null))[_0x6326('0x25')](respondWithResult(_0x4af0ee,null))[_0x6326('0x4c')](handleError(_0x4af0ee,null));};exports[_0x6326('0x26')]=function(_0x3e7674,_0x1b5e9a){return db['SquareMessage'][_0x6326('0x49')]({'where':{'id':_0x3e7674['params']['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x1b5e9a,null))[_0x6326('0x25')](removeEntity(_0x1b5e9a,null))['catch'](handleError(_0x1b5e9a,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 4017fcc..b15b08f 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 _0x42d4=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','square_messages','lodash','util'];(function(_0x2dd2a0,_0x5d3cec){var _0x28aa5c=function(_0x38fc21){while(--_0x38fc21){_0x2dd2a0['push'](_0x2dd2a0['shift']());}};_0x28aa5c(++_0x5d3cec);}(_0x42d4,0x10c));var _0x442d=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x42d4[_0x460150];return _0x340677;};'use strict';var _=require(_0x442d('0x0'));var util=require(_0x442d('0x1'));var logger=require(_0x442d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x442d('0x3'));var rp=require(_0x442d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x442d('0x5'));var config=require(_0x442d('0x6'));var attributes=require(_0x442d('0x7'));module['exports']=function(_0x4f2217,_0x5015d5){return _0x4f2217['define']('SquareMessage',attributes,{'tableName':_0x442d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5abc=['define','square_messages','lodash','util','../../config/logger','request-promise','../../config/environment'];(function(_0x3ec4fd,_0x2665a5){var _0x1b091a=function(_0x4d4826){while(--_0x4d4826){_0x3ec4fd['push'](_0x3ec4fd['shift']());}};_0x1b091a(++_0x2665a5);}(_0x5abc,0x1bb));var _0xc5ab=function(_0x4156cd,_0xf3a6f6){_0x4156cd=_0x4156cd-0x0;var _0x5d829d=_0x5abc[_0x4156cd];return _0x5d829d;};'use strict';var _=require(_0xc5ab('0x0'));var util=require(_0xc5ab('0x1'));var logger=require(_0xc5ab('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc5ab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc5ab('0x4'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x4b6ef,_0x3684d7){return _0x4b6ef[_0xc5ab('0x5')]('SquareMessage',attributes,{'tableName':_0xc5ab('0x6'),'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 9b05fc9..979c2c4 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 _0x94a0=['message','result','catch','create','body','options','CreateSquareMessage','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x94a0,0x1c7));var _0x094a=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x94a0[_0x46efd7];return _0x5637e4;};'use strict';var _=require(_0x094a('0x0'));var util=require('util');var moment=require(_0x094a('0x1'));var BPromise=require(_0x094a('0x2'));var rs=require(_0x094a('0x3'));var fs=require('fs');var Redis=require(_0x094a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x094a('0x5'));var logger=require(_0x094a('0x6'))(_0x094a('0x7'));var config=require(_0x094a('0x8'));var jayson=require(_0x094a('0x9'));var client=jayson[_0x094a('0xa')][_0x094a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x426300,_0xd6393d,_0x7a0cbf){return new BPromise(function(_0x197f72,_0x35f758){return client[_0x094a('0xc')](_0x426300,_0x7a0cbf)[_0x094a('0xd')](function(_0x4c7443){logger[_0x094a('0xe')](_0x094a('0xf'),_0xd6393d,_0x094a('0x10'));logger[_0x094a('0x11')](_0x094a('0x12'),_0xd6393d,_0x094a('0x10'),JSON[_0x094a('0x13')](_0x4c7443));if(_0x4c7443[_0x094a('0x14')]){if(_0x4c7443[_0x094a('0x14')]['code']===0x1f4){logger[_0x094a('0x14')]('SquareMessage,\x20%s,\x20%s',_0xd6393d,_0x4c7443['error'][_0x094a('0x15')]);return _0x35f758(_0x4c7443[_0x094a('0x14')][_0x094a('0x15')]);}logger[_0x094a('0x14')]('SquareMessage,\x20%s,\x20%s',_0xd6393d,_0x4c7443[_0x094a('0x14')][_0x094a('0x15')]);return _0x197f72(_0x4c7443['error'][_0x094a('0x15')]);}else{logger[_0x094a('0xe')]('SquareMessage,\x20%s,\x20%s',_0xd6393d,_0x094a('0x10'));_0x197f72(_0x4c7443[_0x094a('0x16')][_0x094a('0x15')]);}})[_0x094a('0x17')](function(_0x28b8c8){logger[_0x094a('0x14')](_0x094a('0xf'),_0xd6393d,_0x28b8c8);_0x35f758(_0x28b8c8);});});}exports['CreateSquareMessage']=function(_0x54a040){var _0x38126f=this;return new Promise(function(_0x188074,_0x544f07){return db['SquareMessage'][_0x094a('0x18')](_0x54a040[_0x094a('0x19')],{'raw':_0x54a040[_0x094a('0x1a')]?_0x54a040[_0x094a('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x094a('0xd')](function(_0x27e378){logger['info'](_0x094a('0x1b'),_0x54a040);logger[_0x094a('0x11')](_0x094a('0x1b'),_0x54a040,JSON[_0x094a('0x13')](_0x27e378));_0x188074(_0x27e378);})[_0x094a('0x17')](function(_0x509d61){logger['error']('CreateSquareMessage',_0x509d61[_0x094a('0x15')],_0x54a040);_0x544f07(_0x38126f[_0x094a('0x14')](0x1f4,_0x509d61[_0x094a('0x15')]));});});}; \ No newline at end of file +var _0x0f32=['request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareMessage','body','options','raw','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0xfdf0d6,_0x1a4a90){var _0x4e62ae=function(_0x16d2f2){while(--_0x16d2f2){_0xfdf0d6['push'](_0xfdf0d6['shift']());}};_0x4e62ae(++_0x1a4a90);}(_0x0f32,0x65));var _0x20f3=function(_0x36472e,_0x76ab32){_0x36472e=_0x36472e-0x0;var _0x472122=_0x0f32[_0x36472e];return _0x472122;};'use strict';var _=require(_0x20f3('0x0'));var util=require(_0x20f3('0x1'));var moment=require('moment');var BPromise=require(_0x20f3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20f3('0x3'));var db=require(_0x20f3('0x4'))['db'];var utils=require(_0x20f3('0x5'));var logger=require(_0x20f3('0x6'))(_0x20f3('0x7'));var config=require(_0x20f3('0x8'));var jayson=require(_0x20f3('0x9'));var client=jayson['client'][_0x20f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f74ff,_0x2f90f0,_0x1ea707){return new BPromise(function(_0x34b68a,_0x2f7549){return client[_0x20f3('0xb')](_0x1f74ff,_0x1ea707)[_0x20f3('0xc')](function(_0x3674db){logger['info'](_0x20f3('0xd'),_0x2f90f0,_0x20f3('0xe'));logger[_0x20f3('0xf')](_0x20f3('0x10'),_0x2f90f0,_0x20f3('0xe'),JSON[_0x20f3('0x11')](_0x3674db));if(_0x3674db[_0x20f3('0x12')]){if(_0x3674db[_0x20f3('0x12')][_0x20f3('0x13')]===0x1f4){logger[_0x20f3('0x12')](_0x20f3('0xd'),_0x2f90f0,_0x3674db[_0x20f3('0x12')][_0x20f3('0x14')]);return _0x2f7549(_0x3674db[_0x20f3('0x12')][_0x20f3('0x14')]);}logger['error'](_0x20f3('0xd'),_0x2f90f0,_0x3674db[_0x20f3('0x12')][_0x20f3('0x14')]);return _0x34b68a(_0x3674db[_0x20f3('0x12')]['message']);}else{logger[_0x20f3('0x15')]('SquareMessage,\x20%s,\x20%s',_0x2f90f0,'request\x20sent');_0x34b68a(_0x3674db[_0x20f3('0x16')]['message']);}})['catch'](function(_0x608901){logger[_0x20f3('0x12')]('SquareMessage,\x20%s,\x20%s',_0x2f90f0,_0x608901);_0x2f7549(_0x608901);});});}exports[_0x20f3('0x17')]=function(_0x21e07b){var _0x3104eb=this;return new Promise(function(_0x140735,_0x266611){return db['SquareMessage']['create'](_0x21e07b[_0x20f3('0x18')],{'raw':_0x21e07b[_0x20f3('0x19')]?_0x21e07b['options'][_0x20f3('0x1a')]===undefined?!![]:![]:!![]})[_0x20f3('0xc')](function(_0x3719db){logger[_0x20f3('0x15')](_0x20f3('0x17'),_0x21e07b);logger[_0x20f3('0xf')](_0x20f3('0x17'),_0x21e07b,JSON[_0x20f3('0x11')](_0x3719db));_0x140735(_0x3719db);})[_0x20f3('0x1b')](function(_0x4934cd){logger[_0x20f3('0x12')](_0x20f3('0x17'),_0x4934cd[_0x20f3('0x14')],_0x21e07b);_0x266611(_0x3104eb['error'](0x1f4,_0x4934cd[_0x20f3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index d317b54..d6122d2 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 _0x8082=['exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','test','post','create','put','update','delete'];(function(_0x30abc0,_0x397817){var _0x2b34b1=function(_0x4d433a){while(--_0x4d433a){_0x30abc0['push'](_0x30abc0['shift']());}};_0x2b34b1(++_0x397817);}(_0x8082,0x65));var _0x2808=function(_0x4f9a2b,_0x3081a8){_0x4f9a2b=_0x4f9a2b-0x0;var _0x52f18f=_0x8082[_0x4f9a2b];return _0x52f18f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2808('0x0'));var timeout=require(_0x2808('0x1'));var express=require(_0x2808('0x2'));var router=express['Router']();var fs_extra=require(_0x2808('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2808('0x4'));var config=require(_0x2808('0x5'));var controller=require(_0x2808('0x6'));router[_0x2808('0x7')]('/',auth[_0x2808('0x8')](),controller[_0x2808('0x9')]);router[_0x2808('0x7')](_0x2808('0xa'),auth[_0x2808('0x8')](),controller[_0x2808('0xb')]);router[_0x2808('0x7')](_0x2808('0xc'),auth[_0x2808('0x8')](),timeout('15s'),controller[_0x2808('0xd')]);router[_0x2808('0xe')]('/',auth[_0x2808('0x8')](),controller[_0x2808('0xf')]);router[_0x2808('0x10')]('/:id',auth[_0x2808('0x8')](),controller[_0x2808('0x11')]);router[_0x2808('0x12')](_0x2808('0xa'),auth[_0x2808('0x8')](),controller['destroy']);module[_0x2808('0x13')]=router; \ No newline at end of file +var _0xd9d6=['./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','create','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x200f42,_0x4e7f51){var _0x10a65c=function(_0x1f9dfb){while(--_0x1f9dfb){_0x200f42['push'](_0x200f42['shift']());}};_0x10a65c(++_0x4e7f51);}(_0xd9d6,0x117));var _0x6d9d=function(_0x15f455,_0x1ec373){_0x15f455=_0x15f455-0x0;var _0x45f542=_0xd9d6[_0x15f455];return _0x45f542;};'use strict';var multer=require('multer');var util=require(_0x6d9d('0x0'));var path=require(_0x6d9d('0x1'));var timeout=require(_0x6d9d('0x2'));var express=require(_0x6d9d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6d9d('0x4'));var interaction=require(_0x6d9d('0x5'));var config=require('../../config/environment');var controller=require(_0x6d9d('0x6'));router[_0x6d9d('0x7')]('/',auth[_0x6d9d('0x8')](),controller[_0x6d9d('0x9')]);router[_0x6d9d('0x7')](_0x6d9d('0xa'),auth['isAuthenticated'](),controller[_0x6d9d('0xb')]);router[_0x6d9d('0x7')](_0x6d9d('0xc'),auth[_0x6d9d('0x8')](),timeout(_0x6d9d('0xd')),controller['test']);router['post']('/',auth['isAuthenticated'](),controller[_0x6d9d('0xe')]);router['put'](_0x6d9d('0xa'),auth[_0x6d9d('0x8')](),controller[_0x6d9d('0xf')]);router[_0x6d9d('0x10')](_0x6d9d('0xa'),auth[_0x6d9d('0x8')](),controller[_0x6d9d('0x11')]);module[_0x6d9d('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 707be09..3379c99 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 _0xc347=['STRING','name','sequelize','exports'];(function(_0x36519a,_0x264ce2){var _0x43a91e=function(_0x320b05){while(--_0x320b05){_0x36519a['push'](_0x36519a['shift']());}};_0x43a91e(++_0x264ce2);}(_0xc347,0xce));var _0x7c34=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xc347[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x7c34('0x0'));module[_0x7c34('0x1')]={'name':{'type':Sequelize[_0x7c34('0x2')],'unique':_0x7c34('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7c34('0x2')]},'description':{'type':Sequelize[_0x7c34('0x2')]}}; \ No newline at end of file +var _0xcac8=['STRING','sequelize','exports','name'];(function(_0x4e3b7f,_0x171f91){var _0x19a094=function(_0xac549){while(--_0xac549){_0x4e3b7f['push'](_0x4e3b7f['shift']());}};_0x19a094(++_0x171f91);}(_0xcac8,0xfd));var _0x8cac=function(_0x22bcdc,_0x5e01fa){_0x22bcdc=_0x22bcdc-0x0;var _0x439547=_0xcac8[_0x22bcdc];return _0x439547;};'use strict';var Sequelize=require(_0x8cac('0x0'));module[_0x8cac('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8cac('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8cac('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index cd1b973..cfb7f6d 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 _0xdd0e=['stack','name','send','map','SquareOdbc','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','get','ODBC','UserProfileResource','destroy','error'];(function(_0x172dfd,_0x869e62){var _0x248c26=function(_0x11c307){while(--_0x11c307){_0x172dfd['push'](_0x172dfd['shift']());}};_0x248c26(++_0x869e62);}(_0xdd0e,0x1d0));var _0xedd0=function(_0x59cba9,_0x1e8f27){_0x59cba9=_0x59cba9-0x0;var _0xae4206=_0xdd0e[_0x59cba9];return _0xae4206;};'use strict';var emlformat=require(_0xedd0('0x0'));var rimraf=require(_0xedd0('0x1'));var zipdir=require(_0xedd0('0x2'));var jsonpatch=require(_0xedd0('0x3'));var rp=require(_0xedd0('0x4'));var moment=require(_0xedd0('0x5'));var BPromise=require(_0xedd0('0x6'));var Mustache=require(_0xedd0('0x7'));var util=require(_0xedd0('0x8'));var path=require('path');var sox=require(_0xedd0('0x9'));var csv=require(_0xedd0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xedd0('0xb'));var squel=require(_0xedd0('0xc'));var crypto=require(_0xedd0('0xd'));var jsforce=require(_0xedd0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xedd0('0xa'));var querystring=require(_0xedd0('0xf'));var Papa=require(_0xedd0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xedd0('0x11'));var hardwareService=require(_0xedd0('0x12'));var logger=require('../../config/logger')(_0xedd0('0x13'));var utils=require(_0xedd0('0x14'));var config=require(_0xedd0('0x15'));var licenseUtil=require(_0xedd0('0x16'));var db=require(_0xedd0('0x17'))['db'];function respondWithStatusCode(_0x20a293,_0x452ed4){_0x452ed4=_0x452ed4||0xcc;return function(_0x4e559d){if(_0x4e559d){return _0x20a293['sendStatus'](_0x452ed4);}return _0x20a293[_0xedd0('0x18')](_0x452ed4)[_0xedd0('0x19')]();};}function respondWithResult(_0x1ff09d,_0x4373bf){_0x4373bf=_0x4373bf||0xc8;return function(_0x951af8){if(_0x951af8){return _0x1ff09d[_0xedd0('0x18')](_0x4373bf)[_0xedd0('0x1a')](_0x951af8);}};}function respondWithFilteredResult(_0x2d240b,_0x3b3c94){return function(_0x52246d){if(_0x52246d){var _0x267eec=typeof _0x3b3c94[_0xedd0('0x1b')]===_0xedd0('0x1c')&&typeof _0x3b3c94[_0xedd0('0x1d')]==='undefined';var _0x24c878=_0x52246d[_0xedd0('0x1e')];var _0x41dc66=_0x267eec?0x0:_0x3b3c94[_0xedd0('0x1b')];var _0x4155b2=_0x267eec?_0x52246d['count']:_0x3b3c94[_0xedd0('0x1b')]+_0x3b3c94[_0xedd0('0x1d')];var _0x410344;if(_0x4155b2>=_0x24c878){_0x4155b2=_0x24c878;_0x410344=0xc8;}else{_0x410344=0xce;}_0x2d240b[_0xedd0('0x18')](_0x410344);return _0x2d240b[_0xedd0('0x1f')](_0xedd0('0x20'),_0x41dc66+'-'+_0x4155b2+'/'+_0x24c878)[_0xedd0('0x1a')](_0x52246d);}return null;};}function patchUpdates(_0x42df9a){return function(_0x3c2117){try{jsonpatch['apply'](_0x3c2117,_0x42df9a,!![]);}catch(_0x31a9c3){return BPromise[_0xedd0('0x21')](_0x31a9c3);}return _0x3c2117['save']();};}function saveUpdates(_0x581127,_0x55d6c9){return function(_0x159a93){if(_0x159a93){return _0x159a93['update'](_0x581127)[_0xedd0('0x22')](function(_0x53eb37){return _0x53eb37;});}return null;};}function removeEntity(_0x3d8768,_0x37dfdd){return function(_0x213f54){if(_0x213f54){return _0x213f54['destroy']()[_0xedd0('0x22')](function(){var _0x51111c=_0x213f54[_0xedd0('0x23')]({'plain':!![]});var _0x5768a5=_0xedd0('0x24');return db[_0xedd0('0x25')][_0xedd0('0x26')]({'where':{'type':_0x5768a5,'resourceId':_0x51111c['id']}})[_0xedd0('0x22')](function(){return _0x213f54;});})[_0xedd0('0x22')](function(){_0x3d8768['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x133351,_0x35a02b){return function(_0x4f2147){if(!_0x4f2147){_0x133351['sendStatus'](0x194);}return _0x4f2147;};}function handleError(_0x2e84c1,_0x1fca97){_0x1fca97=_0x1fca97||0x1f4;return function(_0x15a284){logger[_0xedd0('0x27')](_0x15a284[_0xedd0('0x28')]);if(_0x15a284['name']){delete _0x15a284[_0xedd0('0x29')];}_0x2e84c1[_0xedd0('0x18')](_0x1fca97)[_0xedd0('0x2a')](_0x15a284);};}exports['index']=function(_0xc33d61,_0x3a389f){var _0x3c362d={},_0x2926d3={},_0x2185f2={'count':0x0,'rows':[]};var _0x560c27=_[_0xedd0('0x2b')](db[_0xedd0('0x2c')]['rawAttributes'],function(_0x3eda58){return{'name':_0x3eda58[_0xedd0('0x2d')],'type':_0x3eda58[_0xedd0('0x2e')]['key']};});_0x2926d3[_0xedd0('0x2f')]=_[_0xedd0('0x2b')](_0x560c27,_0xedd0('0x29'));_0x2926d3[_0xedd0('0x30')]=_[_0xedd0('0x31')](_0xc33d61[_0xedd0('0x30')]);_0x2926d3[_0xedd0('0x32')]=_[_0xedd0('0x33')](_0x2926d3[_0xedd0('0x2f')],_0x2926d3[_0xedd0('0x30')]);_0x3c362d[_0xedd0('0x34')]=_['intersection'](_0x2926d3[_0xedd0('0x2f')],qs[_0xedd0('0x35')](_0xc33d61[_0xedd0('0x30')][_0xedd0('0x35')]));_0x3c362d['attributes']=_0x3c362d[_0xedd0('0x34')][_0xedd0('0x36')]?_0x3c362d['attributes']:_0x2926d3[_0xedd0('0x2f')];if(!_0xc33d61['query'][_0xedd0('0x37')](_0xedd0('0x38'))){_0x3c362d[_0xedd0('0x1d')]=qs[_0xedd0('0x1d')](_0xc33d61[_0xedd0('0x30')][_0xedd0('0x1d')]);_0x3c362d[_0xedd0('0x1b')]=qs[_0xedd0('0x1b')](_0xc33d61[_0xedd0('0x30')][_0xedd0('0x1b')]);}_0x3c362d['order']=qs['sort'](_0xc33d61[_0xedd0('0x30')][_0xedd0('0x39')]);_0x3c362d[_0xedd0('0x3a')]=qs[_0xedd0('0x32')](_[_0xedd0('0x3b')](_0xc33d61[_0xedd0('0x30')],_0x2926d3[_0xedd0('0x32')]),_0x560c27);if(_0xc33d61[_0xedd0('0x30')]['filter']){_0x3c362d[_0xedd0('0x3a')]=_[_0xedd0('0x3c')](_0x3c362d[_0xedd0('0x3a')],{'$or':_['map'](_0x560c27,function(_0x3bc3a3){if(_0x3bc3a3[_0xedd0('0x2e')]!==_0xedd0('0x3d')){var _0x36d058={};_0x36d058[_0x3bc3a3['name']]={'$like':'%'+_0xc33d61['query']['filter']+'%'};return _0x36d058;}})});}_0x3c362d=_['merge']({},_0x3c362d,_0xc33d61[_0xedd0('0x3e')]);var _0x11262d={'where':_0x3c362d[_0xedd0('0x3a')]};return db[_0xedd0('0x2c')][_0xedd0('0x1e')](_0x11262d)[_0xedd0('0x22')](function(_0x2f5777){_0x2185f2[_0xedd0('0x1e')]=_0x2f5777;if(_0xc33d61['query'][_0xedd0('0x3f')]){_0x3c362d[_0xedd0('0x40')]=[{'all':!![]}];}return db[_0xedd0('0x2c')][_0xedd0('0x41')](_0x3c362d);})[_0xedd0('0x22')](function(_0x4d5764){_0x2185f2[_0xedd0('0x42')]=_0x4d5764;return _0x2185f2;})['then'](respondWithFilteredResult(_0x3a389f,_0x3c362d))[_0xedd0('0x43')](handleError(_0x3a389f,null));};exports['show']=function(_0x47b400,_0x2c6a25){var _0x56b408={'raw':!![],'where':{'id':_0x47b400[_0xedd0('0x44')]['id']}},_0x1a7d41={};_0x1a7d41['model']=_[_0xedd0('0x31')](db['SquareOdbc'][_0xedd0('0x45')]);_0x1a7d41[_0xedd0('0x30')]=_[_0xedd0('0x31')](_0x47b400[_0xedd0('0x30')]);_0x1a7d41[_0xedd0('0x32')]=_['intersection'](_0x1a7d41[_0xedd0('0x2f')],_0x1a7d41[_0xedd0('0x30')]);_0x56b408[_0xedd0('0x34')]=_[_0xedd0('0x33')](_0x1a7d41[_0xedd0('0x2f')],qs[_0xedd0('0x35')](_0x47b400['query']['fields']));_0x56b408[_0xedd0('0x34')]=_0x56b408[_0xedd0('0x34')][_0xedd0('0x36')]?_0x56b408[_0xedd0('0x34')]:_0x1a7d41[_0xedd0('0x2f')];if(_0x47b400['query']['includeAll']){_0x56b408[_0xedd0('0x40')]=[{'all':!![]}];}_0x56b408=_['merge']({},_0x56b408,_0x47b400[_0xedd0('0x3e')]);return db[_0xedd0('0x2c')][_0xedd0('0x46')](_0x56b408)[_0xedd0('0x22')](handleEntityNotFound(_0x2c6a25,null))['then'](respondWithResult(_0x2c6a25,null))[_0xedd0('0x43')](handleError(_0x2c6a25,null));};exports[_0xedd0('0x47')]=function(_0x4ad2e1,_0xcec4b6){return db[_0xedd0('0x2c')][_0xedd0('0x47')](_0x4ad2e1[_0xedd0('0x48')],{})[_0xedd0('0x22')](function(_0x3fc4aa){var _0x227083=_0x4ad2e1['user'][_0xedd0('0x23')]({'plain':!![]});if(!_0x227083)throw new Error(_0xedd0('0x49'));if(_0x227083[_0xedd0('0x4a')]==='user'){var _0x48b8cb=_0x3fc4aa[_0xedd0('0x23')]({'plain':!![]});var _0x315943=_0xedd0('0x24');return db[_0xedd0('0x4b')][_0xedd0('0x46')]({'where':{'name':_0x315943,'userProfileId':_0x227083[_0xedd0('0x4c')]},'raw':!![]})[_0xedd0('0x22')](function(_0x507ee8){if(_0x507ee8&&_0x507ee8[_0xedd0('0x4d')]===0x0){return db[_0xedd0('0x25')][_0xedd0('0x47')]({'name':_0x48b8cb[_0xedd0('0x29')],'resourceId':_0x48b8cb['id'],'type':_0x507ee8[_0xedd0('0x29')],'sectionId':_0x507ee8['id']},{})[_0xedd0('0x22')](function(){return _0x3fc4aa;});}else{return _0x3fc4aa;}})[_0xedd0('0x43')](function(_0x38a526){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38a526);throw _0x38a526;});}return _0x3fc4aa;})[_0xedd0('0x22')](respondWithResult(_0xcec4b6,0xc9))[_0xedd0('0x43')](handleError(_0xcec4b6,null));};exports[_0xedd0('0x4e')]=function(_0x1e5321,_0x4b3330){if(_0x1e5321[_0xedd0('0x48')]['id']){delete _0x1e5321['body']['id'];}return db[_0xedd0('0x2c')]['find']({'where':{'id':_0x1e5321[_0xedd0('0x44')]['id']}})[_0xedd0('0x22')](handleEntityNotFound(_0x4b3330,null))[_0xedd0('0x22')](saveUpdates(_0x1e5321[_0xedd0('0x48')],null))[_0xedd0('0x22')](respondWithResult(_0x4b3330,null))[_0xedd0('0x43')](handleError(_0x4b3330,null));};exports['destroy']=function(_0x2ec0c3,_0x3e0407){return db['SquareOdbc'][_0xedd0('0x46')]({'where':{'id':_0x2ec0c3[_0xedd0('0x44')]['id']}})[_0xedd0('0x22')](handleEntityNotFound(_0x3e0407,null))['then'](removeEntity(_0x3e0407,null))['catch'](handleError(_0x3e0407,null));};exports[_0xedd0('0x4f')]=function(_0x1fdfdc,_0x437b65,_0x4f6f97){var _0x4543f8;return db[_0xedd0('0x2c')][_0xedd0('0x46')]({'where':{'id':_0x1fdfdc[_0xedd0('0x44')]['id']},'attributes':['id',_0xedd0('0x50')]})['then'](handleEntityNotFound(_0x437b65,null))[_0xedd0('0x22')](function(_0x14028a){if(_0x14028a){var _0x2c8b75=require(_0xedd0('0x51'))();_0x2c8b75[_0xedd0('0x52')](_0x14028a['dsn']);_0x2c8b75[_0xedd0('0x53')]();return _0x14028a;}})[_0xedd0('0x22')](respondWithResult(_0x437b65,null))[_0xedd0('0x43')](handleError(_0x437b65,null));}; \ No newline at end of file +var _0xe4d5=['options','includeAll','include','findAll','params','keys','rawAttributes','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','test','dsn','openSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','SquareOdbc','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe4d5,0x1ca));var _0x5e4d=function(_0x163f94,_0x1d0c28){_0x163f94=_0x163f94-0x0;var _0x3a7506=_0xe4d5[_0x163f94];return _0x3a7506;};'use strict';var emlformat=require(_0x5e4d('0x0'));var rimraf=require(_0x5e4d('0x1'));var zipdir=require(_0x5e4d('0x2'));var jsonpatch=require(_0x5e4d('0x3'));var rp=require(_0x5e4d('0x4'));var moment=require(_0x5e4d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5e4d('0x6'));var util=require(_0x5e4d('0x7'));var path=require(_0x5e4d('0x8'));var sox=require(_0x5e4d('0x9'));var csv=require(_0x5e4d('0xa'));var ejs=require(_0x5e4d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5e4d('0xc'));var squel=require('squel');var crypto=require(_0x5e4d('0xd'));var jsforce=require(_0x5e4d('0xe'));var deskjs=require(_0x5e4d('0xf'));var toCsv=require(_0x5e4d('0xa'));var querystring=require(_0x5e4d('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5e4d('0x11'));var qs=require(_0x5e4d('0x12'));var as=require(_0x5e4d('0x13'));var hardwareService=require(_0x5e4d('0x14'));var logger=require(_0x5e4d('0x15'))(_0x5e4d('0x16'));var utils=require(_0x5e4d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5e4d('0x18'));var db=require(_0x5e4d('0x19'))['db'];function respondWithStatusCode(_0x52b2fa,_0x1dda32){_0x1dda32=_0x1dda32||0xcc;return function(_0x51a031){if(_0x51a031){return _0x52b2fa[_0x5e4d('0x1a')](_0x1dda32);}return _0x52b2fa[_0x5e4d('0x1b')](_0x1dda32)[_0x5e4d('0x1c')]();};}function respondWithResult(_0x15d03c,_0x2b9a49){_0x2b9a49=_0x2b9a49||0xc8;return function(_0x398aac){if(_0x398aac){return _0x15d03c[_0x5e4d('0x1b')](_0x2b9a49)[_0x5e4d('0x1d')](_0x398aac);}};}function respondWithFilteredResult(_0x5a52e4,_0x411f3b){return function(_0x25aa41){if(_0x25aa41){var _0x3d00a3=typeof _0x411f3b[_0x5e4d('0x1e')]===_0x5e4d('0x1f')&&typeof _0x411f3b['limit']==='undefined';var _0x2b2098=_0x25aa41['count'];var _0x517af7=_0x3d00a3?0x0:_0x411f3b[_0x5e4d('0x1e')];var _0x46eafb=_0x3d00a3?_0x25aa41[_0x5e4d('0x20')]:_0x411f3b[_0x5e4d('0x1e')]+_0x411f3b[_0x5e4d('0x21')];var _0x213e37;if(_0x46eafb>=_0x2b2098){_0x46eafb=_0x2b2098;_0x213e37=0xc8;}else{_0x213e37=0xce;}_0x5a52e4[_0x5e4d('0x1b')](_0x213e37);return _0x5a52e4[_0x5e4d('0x22')](_0x5e4d('0x23'),_0x517af7+'-'+_0x46eafb+'/'+_0x2b2098)[_0x5e4d('0x1d')](_0x25aa41);}return null;};}function patchUpdates(_0x256300){return function(_0x20fe13){try{jsonpatch[_0x5e4d('0x24')](_0x20fe13,_0x256300,!![]);}catch(_0x12a2e8){return BPromise[_0x5e4d('0x25')](_0x12a2e8);}return _0x20fe13['save']();};}function saveUpdates(_0x46a6fd,_0x29b429){return function(_0x17039f){if(_0x17039f){return _0x17039f[_0x5e4d('0x26')](_0x46a6fd)[_0x5e4d('0x27')](function(_0x427cc1){return _0x427cc1;});}return null;};}function removeEntity(_0x2cae63,_0x3fc975){return function(_0x287318){if(_0x287318){return _0x287318[_0x5e4d('0x28')]()[_0x5e4d('0x27')](function(){var _0x15f84c=_0x287318[_0x5e4d('0x29')]({'plain':!![]});var _0x17e9de=_0x5e4d('0x2a');return db[_0x5e4d('0x2b')][_0x5e4d('0x28')]({'where':{'type':_0x17e9de,'resourceId':_0x15f84c['id']}})[_0x5e4d('0x27')](function(){return _0x287318;});})[_0x5e4d('0x27')](function(){_0x2cae63['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f95bb,_0x382e19){return function(_0x506dd9){if(!_0x506dd9){_0x4f95bb[_0x5e4d('0x1a')](0x194);}return _0x506dd9;};}function handleError(_0xb9dc2c,_0x1c7b5e){_0x1c7b5e=_0x1c7b5e||0x1f4;return function(_0x113478){logger[_0x5e4d('0x2c')](_0x113478[_0x5e4d('0x2d')]);if(_0x113478[_0x5e4d('0x2e')]){delete _0x113478[_0x5e4d('0x2e')];}_0xb9dc2c[_0x5e4d('0x1b')](_0x1c7b5e)[_0x5e4d('0x2f')](_0x113478);};}exports[_0x5e4d('0x30')]=function(_0x3cd311,_0x2def82){var _0x48262d={},_0x3684ba={},_0x7019c8={'count':0x0,'rows':[]};var _0x5182b5=_['map'](db[_0x5e4d('0x31')]['rawAttributes'],function(_0x1b0654){return{'name':_0x1b0654[_0x5e4d('0x32')],'type':_0x1b0654[_0x5e4d('0x33')][_0x5e4d('0x34')]};});_0x3684ba[_0x5e4d('0x35')]=_[_0x5e4d('0x36')](_0x5182b5,_0x5e4d('0x2e'));_0x3684ba[_0x5e4d('0x37')]=_['keys'](_0x3cd311[_0x5e4d('0x37')]);_0x3684ba[_0x5e4d('0x38')]=_[_0x5e4d('0x39')](_0x3684ba[_0x5e4d('0x35')],_0x3684ba[_0x5e4d('0x37')]);_0x48262d[_0x5e4d('0x3a')]=_[_0x5e4d('0x39')](_0x3684ba['model'],qs[_0x5e4d('0x3b')](_0x3cd311[_0x5e4d('0x37')]['fields']));_0x48262d['attributes']=_0x48262d[_0x5e4d('0x3a')][_0x5e4d('0x3c')]?_0x48262d[_0x5e4d('0x3a')]:_0x3684ba[_0x5e4d('0x35')];if(!_0x3cd311[_0x5e4d('0x37')][_0x5e4d('0x3d')](_0x5e4d('0x3e'))){_0x48262d[_0x5e4d('0x21')]=qs[_0x5e4d('0x21')](_0x3cd311[_0x5e4d('0x37')]['limit']);_0x48262d['offset']=qs['offset'](_0x3cd311[_0x5e4d('0x37')][_0x5e4d('0x1e')]);}_0x48262d[_0x5e4d('0x3f')]=qs[_0x5e4d('0x40')](_0x3cd311[_0x5e4d('0x37')][_0x5e4d('0x40')]);_0x48262d[_0x5e4d('0x41')]=qs[_0x5e4d('0x38')](_[_0x5e4d('0x42')](_0x3cd311[_0x5e4d('0x37')],_0x3684ba[_0x5e4d('0x38')]),_0x5182b5);if(_0x3cd311[_0x5e4d('0x37')][_0x5e4d('0x43')]){_0x48262d['where']=_[_0x5e4d('0x44')](_0x48262d[_0x5e4d('0x41')],{'$or':_[_0x5e4d('0x36')](_0x5182b5,function(_0x30ac83){if(_0x30ac83['type']!==_0x5e4d('0x45')){var _0x3e1930={};_0x3e1930[_0x30ac83[_0x5e4d('0x2e')]]={'$like':'%'+_0x3cd311[_0x5e4d('0x37')][_0x5e4d('0x43')]+'%'};return _0x3e1930;}})});}_0x48262d=_[_0x5e4d('0x44')]({},_0x48262d,_0x3cd311[_0x5e4d('0x46')]);var _0x512187={'where':_0x48262d[_0x5e4d('0x41')]};return db[_0x5e4d('0x31')][_0x5e4d('0x20')](_0x512187)['then'](function(_0x134272){_0x7019c8[_0x5e4d('0x20')]=_0x134272;if(_0x3cd311[_0x5e4d('0x37')][_0x5e4d('0x47')]){_0x48262d[_0x5e4d('0x48')]=[{'all':!![]}];}return db['SquareOdbc'][_0x5e4d('0x49')](_0x48262d);})[_0x5e4d('0x27')](function(_0x518918){_0x7019c8['rows']=_0x518918;return _0x7019c8;})[_0x5e4d('0x27')](respondWithFilteredResult(_0x2def82,_0x48262d))['catch'](handleError(_0x2def82,null));};exports['show']=function(_0x120efb,_0x5e507f){var _0x127bbf={'raw':!![],'where':{'id':_0x120efb[_0x5e4d('0x4a')]['id']}},_0x262097={};_0x262097[_0x5e4d('0x35')]=_[_0x5e4d('0x4b')](db[_0x5e4d('0x31')][_0x5e4d('0x4c')]);_0x262097[_0x5e4d('0x37')]=_[_0x5e4d('0x4b')](_0x120efb[_0x5e4d('0x37')]);_0x262097[_0x5e4d('0x38')]=_[_0x5e4d('0x39')](_0x262097[_0x5e4d('0x35')],_0x262097[_0x5e4d('0x37')]);_0x127bbf[_0x5e4d('0x3a')]=_[_0x5e4d('0x39')](_0x262097['model'],qs[_0x5e4d('0x3b')](_0x120efb[_0x5e4d('0x37')][_0x5e4d('0x3b')]));_0x127bbf[_0x5e4d('0x3a')]=_0x127bbf[_0x5e4d('0x3a')][_0x5e4d('0x3c')]?_0x127bbf['attributes']:_0x262097[_0x5e4d('0x35')];if(_0x120efb[_0x5e4d('0x37')]['includeAll']){_0x127bbf[_0x5e4d('0x48')]=[{'all':!![]}];}_0x127bbf=_[_0x5e4d('0x44')]({},_0x127bbf,_0x120efb[_0x5e4d('0x46')]);return db['SquareOdbc'][_0x5e4d('0x4d')](_0x127bbf)[_0x5e4d('0x27')](handleEntityNotFound(_0x5e507f,null))[_0x5e4d('0x27')](respondWithResult(_0x5e507f,null))[_0x5e4d('0x4e')](handleError(_0x5e507f,null));};exports[_0x5e4d('0x4f')]=function(_0x44ceb5,_0x4687c3){return db['SquareOdbc'][_0x5e4d('0x4f')](_0x44ceb5[_0x5e4d('0x50')],{})[_0x5e4d('0x27')](function(_0x3177eb){var _0xd999f7=_0x44ceb5[_0x5e4d('0x51')][_0x5e4d('0x29')]({'plain':!![]});if(!_0xd999f7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd999f7['role']==='user'){var _0x264815=_0x3177eb['get']({'plain':!![]});var _0x1e8c10=_0x5e4d('0x2a');return db[_0x5e4d('0x52')][_0x5e4d('0x4d')]({'where':{'name':_0x1e8c10,'userProfileId':_0xd999f7[_0x5e4d('0x53')]},'raw':!![]})[_0x5e4d('0x27')](function(_0x1b1abe){if(_0x1b1abe&&_0x1b1abe[_0x5e4d('0x54')]===0x0){return db[_0x5e4d('0x2b')][_0x5e4d('0x4f')]({'name':_0x264815[_0x5e4d('0x2e')],'resourceId':_0x264815['id'],'type':_0x1b1abe[_0x5e4d('0x2e')],'sectionId':_0x1b1abe['id']},{})[_0x5e4d('0x27')](function(){return _0x3177eb;});}else{return _0x3177eb;}})[_0x5e4d('0x4e')](function(_0x10d947){logger[_0x5e4d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10d947);throw _0x10d947;});}return _0x3177eb;})[_0x5e4d('0x27')](respondWithResult(_0x4687c3,0xc9))[_0x5e4d('0x4e')](handleError(_0x4687c3,null));};exports[_0x5e4d('0x26')]=function(_0x5f4b98,_0x1b86c3){if(_0x5f4b98[_0x5e4d('0x50')]['id']){delete _0x5f4b98[_0x5e4d('0x50')]['id'];}return db[_0x5e4d('0x31')][_0x5e4d('0x4d')]({'where':{'id':_0x5f4b98['params']['id']}})[_0x5e4d('0x27')](handleEntityNotFound(_0x1b86c3,null))['then'](saveUpdates(_0x5f4b98[_0x5e4d('0x50')],null))['then'](respondWithResult(_0x1b86c3,null))['catch'](handleError(_0x1b86c3,null));};exports['destroy']=function(_0x196243,_0x377bd8){return db[_0x5e4d('0x31')][_0x5e4d('0x4d')]({'where':{'id':_0x196243['params']['id']}})[_0x5e4d('0x27')](handleEntityNotFound(_0x377bd8,null))[_0x5e4d('0x27')](removeEntity(_0x377bd8,null))[_0x5e4d('0x4e')](handleError(_0x377bd8,null));};exports[_0x5e4d('0x55')]=function(_0x4b8ce1,_0x9ccf40,_0xec0a0){var _0x150210;return db[_0x5e4d('0x31')][_0x5e4d('0x4d')]({'where':{'id':_0x4b8ce1[_0x5e4d('0x4a')]['id']},'attributes':['id',_0x5e4d('0x56')]})['then'](handleEntityNotFound(_0x9ccf40,null))[_0x5e4d('0x27')](function(_0xee9cca){if(_0xee9cca){var _0x459d35=require('odbc')();_0x459d35[_0x5e4d('0x57')](_0xee9cca[_0x5e4d('0x56')]);_0x459d35['closeSync']();return _0xee9cca;}})[_0x5e4d('0x27')](respondWithResult(_0x9ccf40,null))[_0x5e4d('0x4e')](handleError(_0x9ccf40,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 9af6f26..9dfc287 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 _0xdc66=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash'];(function(_0x1f27df,_0x4f1a64){var _0x286ee2=function(_0x255ea7){while(--_0x255ea7){_0x1f27df['push'](_0x1f27df['shift']());}};_0x286ee2(++_0x4f1a64);}(_0xdc66,0xcf));var _0x6dc6=function(_0x3e04c4,_0x48101b){_0x3e04c4=_0x3e04c4-0x0;var _0x543e0f=_0xdc66[_0x3e04c4];return _0x543e0f;};'use strict';var _=require(_0x6dc6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6dc6('0x1'));var moment=require(_0x6dc6('0x2'));var BPromise=require(_0x6dc6('0x3'));var rp=require(_0x6dc6('0x4'));var fs=require('fs');var path=require(_0x6dc6('0x5'));var rimraf=require(_0x6dc6('0x6'));var config=require(_0x6dc6('0x7'));var attributes=require(_0x6dc6('0x8'));module[_0x6dc6('0x9')]=function(_0x8b019e,_0x100f69){return _0x8b019e[_0x6dc6('0xa')](_0x6dc6('0xb'),attributes,{'tableName':_0x6dc6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1348=['path','rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2b9120,_0x4cba82){var _0x459db0=function(_0x5753b5){while(--_0x5753b5){_0x2b9120['push'](_0x2b9120['shift']());}};_0x459db0(++_0x4cba82);}(_0x1348,0x9f));var _0x8134=function(_0x17a7dd,_0x14eab9){_0x17a7dd=_0x17a7dd-0x0;var _0x2f02b2=_0x1348[_0x17a7dd];return _0x2f02b2;};'use strict';var _=require(_0x8134('0x0'));var util=require(_0x8134('0x1'));var logger=require('../../config/logger')(_0x8134('0x2'));var moment=require(_0x8134('0x3'));var BPromise=require(_0x8134('0x4'));var rp=require(_0x8134('0x5'));var fs=require('fs');var path=require(_0x8134('0x6'));var rimraf=require(_0x8134('0x7'));var config=require(_0x8134('0x8'));var attributes=require(_0x8134('0x9'));module['exports']=function(_0x2c6d77,_0x35479e){return _0x2c6d77['define'](_0x8134('0xa'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index b5c0b00..9dc5616 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 _0xc9d2=['code','message','SquareOdbc,\x20%s,\x20%s','result','catch','ShowSquareOdbc','find','options','raw','where','include','map','attributes','model','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x406cdb,_0xbb5ecb){var _0x3965a0=function(_0x503797){while(--_0x503797){_0x406cdb['push'](_0x406cdb['shift']());}};_0x3965a0(++_0xbb5ecb);}(_0xc9d2,0x1af));var _0x2c9d=function(_0xf77944,_0x3c31d2){_0xf77944=_0xf77944-0x0;var _0x386d6c=_0xc9d2[_0xf77944];return _0x386d6c;};'use strict';var _=require(_0x2c9d('0x0'));var util=require(_0x2c9d('0x1'));var moment=require(_0x2c9d('0x2'));var BPromise=require(_0x2c9d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c9d('0x4'));var db=require(_0x2c9d('0x5'))['db'];var utils=require(_0x2c9d('0x6'));var logger=require(_0x2c9d('0x7'))(_0x2c9d('0x8'));var config=require('../../config/environment');var jayson=require(_0x2c9d('0x9'));var client=jayson[_0x2c9d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f1864,_0x6f8fe1,_0x56be60){return new BPromise(function(_0x4fb204,_0x140bad){return client[_0x2c9d('0xb')](_0x5f1864,_0x56be60)['then'](function(_0x5befd0){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x6f8fe1,_0x2c9d('0xc'));logger[_0x2c9d('0xd')](_0x2c9d('0xe'),_0x6f8fe1,_0x2c9d('0xc'),JSON[_0x2c9d('0xf')](_0x5befd0));if(_0x5befd0[_0x2c9d('0x10')]){if(_0x5befd0[_0x2c9d('0x10')][_0x2c9d('0x11')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x6f8fe1,_0x5befd0['error'][_0x2c9d('0x12')]);return _0x140bad(_0x5befd0[_0x2c9d('0x10')]['message']);}logger[_0x2c9d('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x6f8fe1,_0x5befd0[_0x2c9d('0x10')]['message']);return _0x4fb204(_0x5befd0[_0x2c9d('0x10')]['message']);}else{logger['info'](_0x2c9d('0x13'),_0x6f8fe1,'request\x20sent');_0x4fb204(_0x5befd0[_0x2c9d('0x14')][_0x2c9d('0x12')]);}})[_0x2c9d('0x15')](function(_0x150e4e){logger[_0x2c9d('0x10')](_0x2c9d('0x13'),_0x6f8fe1,_0x150e4e);_0x140bad(_0x150e4e);});});}exports[_0x2c9d('0x16')]=function(_0x4d25dc){var _0x486cbb=this;return new Promise(function(_0x1c78b0,_0x3f5627){return db['SquareOdbc'][_0x2c9d('0x17')]({'raw':_0x4d25dc['options']?_0x4d25dc[_0x2c9d('0x18')][_0x2c9d('0x19')]===undefined?!![]:![]:!![],'where':_0x4d25dc['options']?_0x4d25dc['options'][_0x2c9d('0x1a')]||null:null,'attributes':_0x4d25dc[_0x2c9d('0x18')]?_0x4d25dc['options']['attributes']||null:null,'include':_0x4d25dc['options']?_0x4d25dc['options'][_0x2c9d('0x1b')]?_[_0x2c9d('0x1c')](_0x4d25dc['options'][_0x2c9d('0x1b')],function(_0x25c0e4){return{'model':db[_0x25c0e4['model']],'as':_0x25c0e4['as'],'attributes':_0x25c0e4[_0x2c9d('0x1d')],'include':_0x25c0e4['include']?_[_0x2c9d('0x1c')](_0x25c0e4[_0x2c9d('0x1b')],function(_0x4df7dc){return{'model':db[_0x4df7dc[_0x2c9d('0x1e')]],'as':_0x4df7dc['as'],'attributes':_0x4df7dc['attributes'],'include':_0x4df7dc[_0x2c9d('0x1b')]?_[_0x2c9d('0x1c')](_0x4df7dc['include'],function(_0x28a781){return{'model':db[_0x28a781[_0x2c9d('0x1e')]],'as':_0x28a781['as'],'attributes':_0x28a781[_0x2c9d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd801df){logger[_0x2c9d('0x1f')](_0x2c9d('0x16'),_0x4d25dc);logger['debug'](_0x2c9d('0x16'),_0x4d25dc,JSON[_0x2c9d('0xf')](_0xd801df));_0x1c78b0(_0xd801df);})[_0x2c9d('0x15')](function(_0x71bae6){logger['error'](_0x2c9d('0x16'),_0x71bae6[_0x2c9d('0x12')],_0x4d25dc);_0x3f5627(_0x486cbb[_0x2c9d('0x10')](0x1f4,_0x71bae6['message']));});});}; \ No newline at end of file +var _0xed99=['jayson/promise','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','options','where','include','attributes','map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1bc445,_0x2d6fe0){var _0x589e6b=function(_0xcdd664){while(--_0xcdd664){_0x1bc445['push'](_0x1bc445['shift']());}};_0x589e6b(++_0x2d6fe0);}(_0xed99,0xf6));var _0x9ed9=function(_0x512171,_0x30f118){_0x512171=_0x512171-0x0;var _0x347b48=_0xed99[_0x512171];return _0x347b48;};'use strict';var _=require(_0x9ed9('0x0'));var util=require(_0x9ed9('0x1'));var moment=require(_0x9ed9('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ed9('0x3'));var fs=require('fs');var Redis=require(_0x9ed9('0x4'));var db=require(_0x9ed9('0x5'))['db'];var utils=require(_0x9ed9('0x6'));var logger=require(_0x9ed9('0x7'))(_0x9ed9('0x8'));var config=require(_0x9ed9('0x9'));var jayson=require(_0x9ed9('0xa'));var client=jayson['client'][_0x9ed9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4185c8,_0x517969,_0x456b8b){return new BPromise(function(_0xd1ca86,_0x41e66f){return client['request'](_0x4185c8,_0x456b8b)[_0x9ed9('0xc')](function(_0x3b54ac){logger[_0x9ed9('0xd')](_0x9ed9('0xe'),_0x517969,_0x9ed9('0xf'));logger[_0x9ed9('0x10')](_0x9ed9('0x11'),_0x517969,_0x9ed9('0xf'),JSON[_0x9ed9('0x12')](_0x3b54ac));if(_0x3b54ac[_0x9ed9('0x13')]){if(_0x3b54ac['error'][_0x9ed9('0x14')]===0x1f4){logger[_0x9ed9('0x13')](_0x9ed9('0xe'),_0x517969,_0x3b54ac[_0x9ed9('0x13')][_0x9ed9('0x15')]);return _0x41e66f(_0x3b54ac[_0x9ed9('0x13')][_0x9ed9('0x15')]);}logger[_0x9ed9('0x13')](_0x9ed9('0xe'),_0x517969,_0x3b54ac[_0x9ed9('0x13')]['message']);return _0xd1ca86(_0x3b54ac[_0x9ed9('0x13')][_0x9ed9('0x15')]);}else{logger[_0x9ed9('0xd')](_0x9ed9('0xe'),_0x517969,_0x9ed9('0xf'));_0xd1ca86(_0x3b54ac[_0x9ed9('0x16')]['message']);}})[_0x9ed9('0x17')](function(_0x3e51b6){logger[_0x9ed9('0x13')](_0x9ed9('0xe'),_0x517969,_0x3e51b6);_0x41e66f(_0x3e51b6);});});}exports[_0x9ed9('0x18')]=function(_0x44da00){var _0x1b9849=this;return new Promise(function(_0x450ebd,_0x47c28d){return db[_0x9ed9('0x19')]['find']({'raw':_0x44da00[_0x9ed9('0x1a')]?_0x44da00[_0x9ed9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x44da00[_0x9ed9('0x1a')]?_0x44da00['options'][_0x9ed9('0x1b')]||null:null,'attributes':_0x44da00[_0x9ed9('0x1a')]?_0x44da00[_0x9ed9('0x1a')]['attributes']||null:null,'include':_0x44da00[_0x9ed9('0x1a')]?_0x44da00[_0x9ed9('0x1a')]['include']?_['map'](_0x44da00[_0x9ed9('0x1a')][_0x9ed9('0x1c')],function(_0x400e17){return{'model':db[_0x400e17['model']],'as':_0x400e17['as'],'attributes':_0x400e17[_0x9ed9('0x1d')],'include':_0x400e17['include']?_[_0x9ed9('0x1e')](_0x400e17['include'],function(_0x2437d9){return{'model':db[_0x2437d9[_0x9ed9('0x1f')]],'as':_0x2437d9['as'],'attributes':_0x2437d9[_0x9ed9('0x1d')],'include':_0x2437d9[_0x9ed9('0x1c')]?_[_0x9ed9('0x1e')](_0x2437d9[_0x9ed9('0x1c')],function(_0x514a0e){return{'model':db[_0x514a0e['model']],'as':_0x514a0e['as'],'attributes':_0x514a0e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a65db){logger[_0x9ed9('0xd')](_0x9ed9('0x18'),_0x44da00);logger[_0x9ed9('0x10')](_0x9ed9('0x18'),_0x44da00,JSON['stringify'](_0x5a65db));_0x450ebd(_0x5a65db);})[_0x9ed9('0x17')](function(_0x4ac4c1){logger['error'](_0x9ed9('0x18'),_0x4ac4c1[_0x9ed9('0x15')],_0x44da00);_0x47c28d(_0x1b9849[_0x9ed9('0x13')](0x1f4,_0x4ac4c1[_0x9ed9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 258f158..6c0c451 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 _0x168d=['/:id','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','index','post','create','put'];(function(_0x5280f4,_0x3c36d0){var _0xba93e7=function(_0x14d63a){while(--_0x14d63a){_0x5280f4['push'](_0x5280f4['shift']());}};_0xba93e7(++_0x3c36d0);}(_0x168d,0x82));var _0xd168=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x168d[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require(_0xd168('0x0'));var path=require(_0xd168('0x1'));var timeout=require('connect-timeout');var express=require(_0xd168('0x2'));var router=express[_0xd168('0x3')]();var fs_extra=require(_0xd168('0x4'));var auth=require(_0xd168('0x5'));var interaction=require(_0xd168('0x6'));var config=require('../../config/environment');var controller=require(_0xd168('0x7'));router[_0xd168('0x8')]('/',auth[_0xd168('0x9')](),controller[_0xd168('0xa')]);router[_0xd168('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd168('0xb')]('/',auth[_0xd168('0x9')](),controller[_0xd168('0xc')]);router[_0xd168('0xd')](_0xd168('0xe'),auth[_0xd168('0x9')](),controller[_0xd168('0xf')]);router[_0xd168('0x10')]('/:id',auth[_0xd168('0x9')](),controller[_0xd168('0x11')]);module['exports']=router; \ No newline at end of file +var _0x73e5=['get','/:id','isAuthenticated','show','post','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x9ac38c,_0x280f26){var _0xeb1244=function(_0x555217){while(--_0x555217){_0x9ac38c['push'](_0x9ac38c['shift']());}};_0xeb1244(++_0x280f26);}(_0x73e5,0xad));var _0x573e=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0x73e5[_0x9b3efc];return _0x200f05;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x573e('0x0'));var timeout=require(_0x573e('0x1'));var express=require(_0x573e('0x2'));var router=express[_0x573e('0x3')]();var fs_extra=require(_0x573e('0x4'));var auth=require(_0x573e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x573e('0x6'));var controller=require('./squareProject.controller');router[_0x573e('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x573e('0x7')](_0x573e('0x8'),auth[_0x573e('0x9')](),controller[_0x573e('0xa')]);router[_0x573e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x573e('0x8'),auth['isAuthenticated'](),controller[_0x573e('0xc')]);router[_0x573e('0xd')]('/:id',auth[_0x573e('0x9')](),controller[_0x573e('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 8f7a0d0..43bff88 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 _0xaf55=['exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xaf55,0x1e0));var _0x5af5=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xaf55[_0x5a79e2];return _0x266c45;};'use strict';var Sequelize=require(_0x5af5('0x0'));module[_0x5af5('0x1')]={'name':{'type':Sequelize[_0x5af5('0x2')],'unique':_0x5af5('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5af5('0x2')]},'notes':{'type':Sequelize[_0x5af5('0x4')]},'preproduction':{'type':Sequelize[_0x5af5('0x5')](_0x5af5('0x6')),'get':function(){if(this[_0x5af5('0x7')](_0x5af5('0x8'))){return this[_0x5af5('0x7')](_0x5af5('0x8'))[_0x5af5('0x9')](_0x5af5('0xa'));}}},'production':{'type':Sequelize[_0x5af5('0x5')](_0x5af5('0x6')),'get':function(){if(this[_0x5af5('0x7')](_0x5af5('0xb'))){return this[_0x5af5('0x7')](_0x5af5('0xb'))['toString'](_0x5af5('0xa'));}}},'savedAt':{'type':Sequelize[_0x5af5('0xc')]},'publishedAt':{'type':Sequelize[_0x5af5('0xc')]}}; \ No newline at end of file +var _0xfead=['STRING','BLOB','long','getDataValue','toString','utf8','production','DATE','sequelize','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xfead,0x152));var _0xdfea=function(_0x1c4292,_0x1e4bf8){_0x1c4292=_0x1c4292-0x0;var _0x1fcb67=_0xfead[_0x1c4292];return _0x1fcb67;};'use strict';var Sequelize=require(_0xdfea('0x0'));module[_0xdfea('0x1')]={'name':{'type':Sequelize[_0xdfea('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xdfea('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xdfea('0x3')](_0xdfea('0x4')),'get':function(){if(this[_0xdfea('0x5')]('preproduction')){return this[_0xdfea('0x5')]('preproduction')[_0xdfea('0x6')](_0xdfea('0x7'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xdfea('0x5')]('production')){return this[_0xdfea('0x5')](_0xdfea('0x8'))[_0xdfea('0x6')]('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xdfea('0x9')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ca6bb94..74a1a2f 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 _0xaa2e=['SquareProject','includeAll','include','findAll','params','find','catch','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','pick','production','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','then','SquareProjects','destroy','publish','agi','end','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xaa2e,0x128));var _0xeaa2=function(_0x102ad7,_0x5cbdc7){_0x102ad7=_0x102ad7-0x0;var _0x5746e8=_0xaa2e[_0x102ad7];return _0x5746e8;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xeaa2('0x0'));var logger=require(_0xeaa2('0x1'))(_0xeaa2('0x2'));var config=require(_0xeaa2('0x3'));var db=require(_0xeaa2('0x4'))['db'];config['redis']=_['defaults'](config[_0xeaa2('0x5')],{'host':_0xeaa2('0x6'),'port':0x18eb});var socket=require(_0xeaa2('0x7'))(new Redis(config[_0xeaa2('0x5')]));require(_0xeaa2('0x8'))[_0xeaa2('0x9')](socket);function respondWithResult(_0x5d8487,_0x4296f0){_0x4296f0=_0x4296f0||0xc8;return function(_0x3e5334){if(_0x3e5334){return _0x5d8487[_0xeaa2('0xa')](_0x4296f0)[_0xeaa2('0xb')](_0x3e5334);}};}function respondWithFilteredResult(_0x288c09,_0x26017f){return function(_0x29e873){if(_0x29e873){var _0x485d15=typeof _0x26017f[_0xeaa2('0xc')]===_0xeaa2('0xd')&&typeof _0x26017f[_0xeaa2('0xe')]===_0xeaa2('0xd');var _0xc20d40=_0x29e873[_0xeaa2('0xf')];var _0x48f5be=_0x485d15?0x0:_0x26017f[_0xeaa2('0xc')];var _0x3183ee=_0x485d15?_0x29e873['count']:_0x26017f[_0xeaa2('0xc')]+_0x26017f[_0xeaa2('0xe')];var _0x1ff4d5;if(_0x3183ee>=_0xc20d40){_0x3183ee=_0xc20d40;_0x1ff4d5=0xc8;}else{_0x1ff4d5=0xce;}_0x288c09[_0xeaa2('0xa')](_0x1ff4d5);return _0x288c09['set'](_0xeaa2('0x10'),_0x48f5be+'-'+_0x3183ee+'/'+_0xc20d40)[_0xeaa2('0xb')](_0x29e873);}return null;};}function saveUpdates(_0xf0b205){return function(_0x14fa3e){if(_0x14fa3e){return _0x14fa3e[_0xeaa2('0x11')](_0xf0b205)[_0xeaa2('0x12')](function(_0x461b55){return _0x461b55;});}return null;};}function removeEntity(_0x40d8ad){return function(_0xb4daef){if(_0xb4daef){return _0xb4daef['destroy']()[_0xeaa2('0x12')](function(){var _0x1afb1e=_0xb4daef['get']({'plain':!![]});var _0x4413fe=_0xeaa2('0x13');return db['UserProfileResource'][_0xeaa2('0x14')]({'where':{'type':_0x4413fe,'resourceId':_0x1afb1e['id']}})['then'](function(){return _0xb4daef;});})[_0xeaa2('0x12')](function(){var _0xec536=new Redis(config['redis']);_0xec536[_0xeaa2('0x15')](_0xeaa2('0x16'),JSON['stringify']({'id':_0xb4daef['id'],'deleted':!![]}));})[_0xeaa2('0x12')](function(){_0x40d8ad['status'](0xcc)[_0xeaa2('0x17')]();});}};}function handleEntityNotFound(_0x51c416){return function(_0x4e1b45){if(!_0x4e1b45){_0x51c416['sendStatus'](0x194);}return _0x4e1b45;};}function handleError(_0x1e2830,_0x1313ae){_0x1313ae=_0x1313ae||0x1f4;return function(_0x1eb4a5){logger[_0xeaa2('0x18')](_0x1eb4a5[_0xeaa2('0x19')]);if(_0x1eb4a5[_0xeaa2('0x1a')]){delete _0x1eb4a5[_0xeaa2('0x1a')];}_0x1e2830[_0xeaa2('0xa')](_0x1313ae)[_0xeaa2('0x1b')](_0x1eb4a5);};}exports[_0xeaa2('0x1c')]=function(_0x49e262,_0x4f6ac0){var _0x2afbf5={},_0xff51c={},_0x5ee75b={'count':0x0,'rows':[]};var _0x18964a=_[_0xeaa2('0x1d')](db['SquareProject'][_0xeaa2('0x1e')],function(_0x31729a){return{'name':_0x31729a[_0xeaa2('0x1f')],'type':_0x31729a['type']['key']};});_0xff51c[_0xeaa2('0x20')]=_['map'](_0x18964a,_0xeaa2('0x1a'));_0xff51c[_0xeaa2('0x21')]=_['keys'](_0x49e262[_0xeaa2('0x21')]);_0xff51c['filters']=_[_0xeaa2('0x22')](_0xff51c['model'],_0xff51c['query']);_0x2afbf5[_0xeaa2('0x23')]=_[_0xeaa2('0x22')](_0xff51c[_0xeaa2('0x20')],qs['fields'](_0x49e262['query'][_0xeaa2('0x24')]));_0x2afbf5[_0xeaa2('0x23')]=_0x2afbf5[_0xeaa2('0x23')][_0xeaa2('0x25')]?_0x2afbf5[_0xeaa2('0x23')]:_0xff51c[_0xeaa2('0x20')];if(!_0x49e262['query'][_0xeaa2('0x26')](_0xeaa2('0x27'))){_0x2afbf5[_0xeaa2('0xe')]=qs[_0xeaa2('0xe')](_0x49e262[_0xeaa2('0x21')]['limit']);_0x2afbf5[_0xeaa2('0xc')]=qs[_0xeaa2('0xc')](_0x49e262[_0xeaa2('0x21')][_0xeaa2('0xc')]);}_0x2afbf5[_0xeaa2('0x28')]=qs[_0xeaa2('0x29')](_0x49e262[_0xeaa2('0x21')][_0xeaa2('0x29')]);_0x2afbf5[_0xeaa2('0x2a')]=qs['filters'](_['pick'](_0x49e262['query'],_0xff51c[_0xeaa2('0x2b')]),_0x18964a);if(_0x49e262['query'][_0xeaa2('0x2c')]){_0x2afbf5[_0xeaa2('0x2a')]=_[_0xeaa2('0x2d')](_0x2afbf5[_0xeaa2('0x2a')],{'$or':_['map'](_0x18964a,function(_0x264ace){if(_0x264ace[_0xeaa2('0x2e')]!==_0xeaa2('0x2f')){var _0x14f1dd={};_0x14f1dd[_0x264ace[_0xeaa2('0x1a')]]={'$like':'%'+_0x49e262[_0xeaa2('0x21')][_0xeaa2('0x2c')]+'%'};return _0x14f1dd;}})});}_0x2afbf5=_['merge']({},_0x2afbf5,_0x49e262[_0xeaa2('0x30')]);var _0x521650={'where':_0x2afbf5['where']};return db[_0xeaa2('0x31')][_0xeaa2('0xf')](_0x521650)[_0xeaa2('0x12')](function(_0x3f1136){_0x5ee75b['count']=_0x3f1136;if(_0x49e262[_0xeaa2('0x21')][_0xeaa2('0x32')]){_0x2afbf5[_0xeaa2('0x33')]=[{'all':!![]}];}return db[_0xeaa2('0x31')][_0xeaa2('0x34')](_0x2afbf5);})[_0xeaa2('0x12')](function(_0x302537){_0x5ee75b['rows']=_0x302537;return _0x5ee75b;})['then'](respondWithFilteredResult(_0x4f6ac0,_0x2afbf5))['catch'](handleError(_0x4f6ac0,null));};exports['show']=function(_0x4f741c,_0x3623d9){var _0x59b74b={'raw':![],'where':{'id':_0x4f741c[_0xeaa2('0x35')]['id']}},_0x250520={};_0x250520[_0xeaa2('0x20')]=_['keys'](db['SquareProject']['rawAttributes']);_0x250520[_0xeaa2('0x21')]=_['keys'](_0x4f741c[_0xeaa2('0x21')]);_0x250520['filters']=_['intersection'](_0x250520['model'],_0x250520[_0xeaa2('0x21')]);_0x59b74b['attributes']=_[_0xeaa2('0x22')](_0x250520[_0xeaa2('0x20')],qs[_0xeaa2('0x24')](_0x4f741c[_0xeaa2('0x21')]['fields']));_0x59b74b[_0xeaa2('0x23')]=_0x59b74b['attributes'][_0xeaa2('0x25')]?_0x59b74b[_0xeaa2('0x23')]:_0x250520['model'];if(_0x4f741c[_0xeaa2('0x21')][_0xeaa2('0x32')]){_0x59b74b[_0xeaa2('0x33')]=[{'all':!![]}];}_0x59b74b=_[_0xeaa2('0x2d')]({},_0x59b74b,_0x4f741c[_0xeaa2('0x30')]);return db[_0xeaa2('0x31')][_0xeaa2('0x36')](_0x59b74b)['then'](handleEntityNotFound(_0x3623d9,null))[_0xeaa2('0x12')](respondWithResult(_0x3623d9,null))[_0xeaa2('0x37')](handleError(_0x3623d9,null));};exports['create']=function(_0x454e84,_0x58f07d){return db[_0xeaa2('0x31')]['create'](_0x454e84['body'],{})[_0xeaa2('0x12')](function(_0x5c2596){var _0x9cbe06=_0x454e84[_0xeaa2('0x38')][_0xeaa2('0x39')]({'plain':!![]});if(!_0x9cbe06)throw new Error(_0xeaa2('0x3a'));if(_0x9cbe06[_0xeaa2('0x3b')]===_0xeaa2('0x38')){var _0x216a7c=_0x5c2596[_0xeaa2('0x39')]({'plain':!![]});var _0x47c45a=_0xeaa2('0x13');return db[_0xeaa2('0x3c')][_0xeaa2('0x36')]({'where':{'name':_0x47c45a,'userProfileId':_0x9cbe06[_0xeaa2('0x3d')]},'raw':!![]})[_0xeaa2('0x12')](function(_0x14246e){if(_0x14246e&&_0x14246e[_0xeaa2('0x3e')]===0x0){return db[_0xeaa2('0x3f')][_0xeaa2('0x40')]({'name':_0x216a7c['name'],'resourceId':_0x216a7c['id'],'type':_0x14246e['name'],'sectionId':_0x14246e['id']},{})[_0xeaa2('0x12')](function(){return _0x5c2596;});}else{return _0x5c2596;}})['catch'](function(_0x31e2fd){logger['error'](_0xeaa2('0x41'),_0x31e2fd);throw _0x31e2fd;});}return _0x5c2596;})[_0xeaa2('0x12')](respondWithResult(_0x58f07d,0xc9))['catch'](handleError(_0x58f07d,null));};exports['update']=function(_0x1e46f2,_0x1875dc){if(_0x1e46f2[_0xeaa2('0x42')]['id']){delete _0x1e46f2[_0xeaa2('0x42')]['id'];}return db['SquareProject'][_0xeaa2('0x36')]({'where':{'id':_0x1e46f2['params']['id']}})['then'](handleEntityNotFound(_0x1875dc,null))['then'](saveUpdates(_0x1e46f2[_0xeaa2('0x42')],null))[_0xeaa2('0x12')](function(_0x5c71a4){if(!_0x5c71a4)return;var _0x203ef1=_0x5c71a4[_0xeaa2('0x39')]({'plain':!![]});return _0x203ef1;})[_0xeaa2('0x12')](function(_0x4b20bf){var _0x4f6eea=new Redis(config['redis']);_0x4f6eea[_0xeaa2('0x15')](_0xeaa2('0x16'),JSON['stringify'](_[_0xeaa2('0x43')](_0x4b20bf,['id',_0xeaa2('0x1a'),_0xeaa2('0x44')])));return _0x4b20bf;})['then'](respondWithResult(_0x1875dc,null))[_0xeaa2('0x37')](handleError(_0x1875dc,null));};exports[_0xeaa2('0x14')]=function(_0xd66fb8,_0x2aeb81){return db[_0xeaa2('0x31')][_0xeaa2('0x36')]({'where':{'id':_0xd66fb8[_0xeaa2('0x35')]['id']}})['then'](handleEntityNotFound(_0x2aeb81,null))[_0xeaa2('0x12')](removeEntity(_0x2aeb81,null))['catch'](handleError(_0x2aeb81,null));}; \ No newline at end of file +var _0x6887=['merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','stringify','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','end','sendStatus','error','stack','name','send','map','SquareProject','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL'];(function(_0x18b439,_0x3b8e65){var _0x40f6d7=function(_0xbf2d94){while(--_0xbf2d94){_0x18b439['push'](_0x18b439['shift']());}};_0x40f6d7(++_0x3b8e65);}(_0x6887,0x12f));var _0x7688=function(_0x196995,_0x2575dd){_0x196995=_0x196995-0x0;var _0x1ff73a=_0x6887[_0x196995];return _0x1ff73a;};'use strict';var _=require(_0x7688('0x0'));var Redis=require('ioredis');var qs=require(_0x7688('0x1'));var logger=require(_0x7688('0x2'))(_0x7688('0x3'));var config=require('../../config/environment');var db=require(_0x7688('0x4'))['db'];config[_0x7688('0x5')]=_[_0x7688('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7688('0x7'))(new Redis(config['redis']));require(_0x7688('0x8'))[_0x7688('0x9')](socket);function respondWithResult(_0x981702,_0x3c27b8){_0x3c27b8=_0x3c27b8||0xc8;return function(_0x387f7b){if(_0x387f7b){return _0x981702[_0x7688('0xa')](_0x3c27b8)['json'](_0x387f7b);}};}function respondWithFilteredResult(_0x3bb088,_0x30ad94){return function(_0xcab856){if(_0xcab856){var _0x87ab28=typeof _0x30ad94[_0x7688('0xb')]===_0x7688('0xc')&&typeof _0x30ad94[_0x7688('0xd')]===_0x7688('0xc');var _0x5d5f26=_0xcab856[_0x7688('0xe')];var _0x1804f3=_0x87ab28?0x0:_0x30ad94['offset'];var _0x19c3db=_0x87ab28?_0xcab856[_0x7688('0xe')]:_0x30ad94[_0x7688('0xb')]+_0x30ad94[_0x7688('0xd')];var _0x89527c;if(_0x19c3db>=_0x5d5f26){_0x19c3db=_0x5d5f26;_0x89527c=0xc8;}else{_0x89527c=0xce;}_0x3bb088[_0x7688('0xa')](_0x89527c);return _0x3bb088[_0x7688('0xf')](_0x7688('0x10'),_0x1804f3+'-'+_0x19c3db+'/'+_0x5d5f26)[_0x7688('0x11')](_0xcab856);}return null;};}function saveUpdates(_0x38adc5){return function(_0x292482){if(_0x292482){return _0x292482[_0x7688('0x12')](_0x38adc5)[_0x7688('0x13')](function(_0x35e3d7){return _0x35e3d7;});}return null;};}function removeEntity(_0x48c348){return function(_0x406109){if(_0x406109){return _0x406109[_0x7688('0x14')]()[_0x7688('0x13')](function(){var _0x4b8bc5=_0x406109[_0x7688('0x15')]({'plain':!![]});var _0x297c5f=_0x7688('0x16');return db[_0x7688('0x17')][_0x7688('0x14')]({'where':{'type':_0x297c5f,'resourceId':_0x4b8bc5['id']}})['then'](function(){return _0x406109;});})[_0x7688('0x13')](function(){var _0x1c9b95=new Redis(config[_0x7688('0x5')]);_0x1c9b95[_0x7688('0x18')](_0x7688('0x19'),JSON['stringify']({'id':_0x406109['id'],'deleted':!![]}));})[_0x7688('0x13')](function(){_0x48c348['status'](0xcc)[_0x7688('0x1a')]();});}};}function handleEntityNotFound(_0x206789){return function(_0x2bad62){if(!_0x2bad62){_0x206789[_0x7688('0x1b')](0x194);}return _0x2bad62;};}function handleError(_0x8ecbfe,_0x4efa8f){_0x4efa8f=_0x4efa8f||0x1f4;return function(_0x3cd35b){logger[_0x7688('0x1c')](_0x3cd35b[_0x7688('0x1d')]);if(_0x3cd35b[_0x7688('0x1e')]){delete _0x3cd35b[_0x7688('0x1e')];}_0x8ecbfe['status'](_0x4efa8f)[_0x7688('0x1f')](_0x3cd35b);};}exports['index']=function(_0x482cc0,_0x29af3b){var _0x2af670={},_0x4df297={},_0x390625={'count':0x0,'rows':[]};var _0xe680dc=_[_0x7688('0x20')](db[_0x7688('0x21')][_0x7688('0x22')],function(_0x5ee9ef){return{'name':_0x5ee9ef['fieldName'],'type':_0x5ee9ef[_0x7688('0x23')]['key']};});_0x4df297[_0x7688('0x24')]=_[_0x7688('0x20')](_0xe680dc,_0x7688('0x1e'));_0x4df297[_0x7688('0x25')]=_[_0x7688('0x26')](_0x482cc0['query']);_0x4df297[_0x7688('0x27')]=_[_0x7688('0x28')](_0x4df297[_0x7688('0x24')],_0x4df297[_0x7688('0x25')]);_0x2af670['attributes']=_[_0x7688('0x28')](_0x4df297[_0x7688('0x24')],qs[_0x7688('0x29')](_0x482cc0['query'][_0x7688('0x29')]));_0x2af670[_0x7688('0x2a')]=_0x2af670['attributes'][_0x7688('0x2b')]?_0x2af670[_0x7688('0x2a')]:_0x4df297[_0x7688('0x24')];if(!_0x482cc0[_0x7688('0x25')][_0x7688('0x2c')](_0x7688('0x2d'))){_0x2af670[_0x7688('0xd')]=qs[_0x7688('0xd')](_0x482cc0[_0x7688('0x25')][_0x7688('0xd')]);_0x2af670[_0x7688('0xb')]=qs['offset'](_0x482cc0[_0x7688('0x25')]['offset']);}_0x2af670[_0x7688('0x2e')]=qs['sort'](_0x482cc0[_0x7688('0x25')][_0x7688('0x2f')]);_0x2af670[_0x7688('0x30')]=qs[_0x7688('0x27')](_[_0x7688('0x31')](_0x482cc0['query'],_0x4df297[_0x7688('0x27')]),_0xe680dc);if(_0x482cc0[_0x7688('0x25')][_0x7688('0x32')]){_0x2af670[_0x7688('0x30')]=_['merge'](_0x2af670[_0x7688('0x30')],{'$or':_[_0x7688('0x20')](_0xe680dc,function(_0x80874a){if(_0x80874a[_0x7688('0x23')]!==_0x7688('0x33')){var _0x24f898={};_0x24f898[_0x80874a[_0x7688('0x1e')]]={'$like':'%'+_0x482cc0[_0x7688('0x25')][_0x7688('0x32')]+'%'};return _0x24f898;}})});}_0x2af670=_[_0x7688('0x34')]({},_0x2af670,_0x482cc0[_0x7688('0x35')]);var _0x5d7ce4={'where':_0x2af670[_0x7688('0x30')]};return db[_0x7688('0x21')][_0x7688('0xe')](_0x5d7ce4)[_0x7688('0x13')](function(_0x529636){_0x390625[_0x7688('0xe')]=_0x529636;if(_0x482cc0[_0x7688('0x25')]['includeAll']){_0x2af670[_0x7688('0x36')]=[{'all':!![]}];}return db[_0x7688('0x21')][_0x7688('0x37')](_0x2af670);})['then'](function(_0x245a02){_0x390625[_0x7688('0x38')]=_0x245a02;return _0x390625;})['then'](respondWithFilteredResult(_0x29af3b,_0x2af670))[_0x7688('0x39')](handleError(_0x29af3b,null));};exports[_0x7688('0x3a')]=function(_0x1943d2,_0x3c4556){var _0x2db74c={'raw':![],'where':{'id':_0x1943d2[_0x7688('0x3b')]['id']}},_0x45a63f={};_0x45a63f['model']=_[_0x7688('0x26')](db[_0x7688('0x21')]['rawAttributes']);_0x45a63f[_0x7688('0x25')]=_[_0x7688('0x26')](_0x1943d2[_0x7688('0x25')]);_0x45a63f[_0x7688('0x27')]=_[_0x7688('0x28')](_0x45a63f[_0x7688('0x24')],_0x45a63f['query']);_0x2db74c[_0x7688('0x2a')]=_[_0x7688('0x28')](_0x45a63f[_0x7688('0x24')],qs[_0x7688('0x29')](_0x1943d2['query'][_0x7688('0x29')]));_0x2db74c['attributes']=_0x2db74c['attributes']['length']?_0x2db74c[_0x7688('0x2a')]:_0x45a63f[_0x7688('0x24')];if(_0x1943d2['query'][_0x7688('0x3c')]){_0x2db74c[_0x7688('0x36')]=[{'all':!![]}];}_0x2db74c=_[_0x7688('0x34')]({},_0x2db74c,_0x1943d2[_0x7688('0x35')]);return db[_0x7688('0x21')][_0x7688('0x3d')](_0x2db74c)[_0x7688('0x13')](handleEntityNotFound(_0x3c4556,null))[_0x7688('0x13')](respondWithResult(_0x3c4556,null))[_0x7688('0x39')](handleError(_0x3c4556,null));};exports['create']=function(_0x11e72f,_0x1a26c5){return db[_0x7688('0x21')][_0x7688('0x3e')](_0x11e72f[_0x7688('0x3f')],{})[_0x7688('0x13')](function(_0x173bef){var _0x51e2ce=_0x11e72f[_0x7688('0x40')][_0x7688('0x15')]({'plain':!![]});if(!_0x51e2ce)throw new Error(_0x7688('0x41'));if(_0x51e2ce[_0x7688('0x42')]===_0x7688('0x40')){var _0x2f7b34=_0x173bef['get']({'plain':!![]});var _0x3de7c0=_0x7688('0x16');return db[_0x7688('0x43')][_0x7688('0x3d')]({'where':{'name':_0x3de7c0,'userProfileId':_0x51e2ce[_0x7688('0x44')]},'raw':!![]})[_0x7688('0x13')](function(_0x155775){if(_0x155775&&_0x155775['autoAssociation']===0x0){return db[_0x7688('0x17')][_0x7688('0x3e')]({'name':_0x2f7b34[_0x7688('0x1e')],'resourceId':_0x2f7b34['id'],'type':_0x155775[_0x7688('0x1e')],'sectionId':_0x155775['id']},{})[_0x7688('0x13')](function(){return _0x173bef;});}else{return _0x173bef;}})[_0x7688('0x39')](function(_0x4d4d8f){logger[_0x7688('0x1c')](_0x7688('0x45'),_0x4d4d8f);throw _0x4d4d8f;});}return _0x173bef;})['then'](respondWithResult(_0x1a26c5,0xc9))[_0x7688('0x39')](handleError(_0x1a26c5,null));};exports[_0x7688('0x12')]=function(_0x559667,_0x42746e){if(_0x559667[_0x7688('0x3f')]['id']){delete _0x559667[_0x7688('0x3f')]['id'];}return db[_0x7688('0x21')][_0x7688('0x3d')]({'where':{'id':_0x559667[_0x7688('0x3b')]['id']}})[_0x7688('0x13')](handleEntityNotFound(_0x42746e,null))[_0x7688('0x13')](saveUpdates(_0x559667[_0x7688('0x3f')],null))['then'](function(_0x56c9cb){if(!_0x56c9cb)return;var _0x3bd74f=_0x56c9cb[_0x7688('0x15')]({'plain':!![]});return _0x3bd74f;})[_0x7688('0x13')](function(_0x2d8cf0){var _0x1b6b27=new Redis(config['redis']);_0x1b6b27['publish'](_0x7688('0x19'),JSON[_0x7688('0x46')](_[_0x7688('0x31')](_0x2d8cf0,['id',_0x7688('0x1e'),'production'])));return _0x2d8cf0;})[_0x7688('0x13')](respondWithResult(_0x42746e,null))[_0x7688('0x39')](handleError(_0x42746e,null));};exports['destroy']=function(_0x6c6b43,_0x3e8653){return db['SquareProject']['find']({'where':{'id':_0x6c6b43[_0x7688('0x3b')]['id']}})[_0x7688('0x13')](handleEntityNotFound(_0x3e8653,null))['then'](removeEntity(_0x3e8653,null))[_0x7688('0x39')](handleError(_0x3e8653,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index a8363f3..3a5ec9c 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 _0x1130=['SquareProject','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x13b6fc,_0x539ca2){var _0x5079aa=function(_0x45158f){while(--_0x45158f){_0x13b6fc['push'](_0x13b6fc['shift']());}};_0x5079aa(++_0x539ca2);}(_0x1130,0xe7));var _0x0113=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x1130[_0x484e36];return _0xafc85d;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0x0113('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0113('0x1'),'afterUpdate':_0x0113('0x2'),'afterDestroy':'remove'};function emitEvent(_0x214dac){return function(_0x325d03,_0xcdf63a,_0x35d677){SquareProjectEvents[_0x0113('0x3')](_0x214dac+':'+_0x325d03['id'],_0x325d03);SquareProjectEvents[_0x0113('0x3')](_0x214dac,_0x325d03);_0x35d677(null);};}for(var e in events){if(events[_0x0113('0x4')](e)){var event=events[e];SquareProject[_0x0113('0x5')](e,emitEvent(event));}}module[_0x0113('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x9e81=['SquareProject','setMaxListeners','save','update','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e81,0x8e));var _0x19e8=function(_0x505b9d,_0x14bcf4){_0x505b9d=_0x505b9d-0x0;var _0x491990=_0x9e81[_0x505b9d];return _0x491990;};'use strict';var EventEmitter=require(_0x19e8('0x0'));var SquareProject=require(_0x19e8('0x1'))['db'][_0x19e8('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x19e8('0x3')](0x0);var events={'afterCreate':_0x19e8('0x4'),'afterUpdate':_0x19e8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4775ab){return function(_0x593d35,_0x1bb8df,_0x17ea98){SquareProjectEvents['emit'](_0x4775ab+':'+_0x593d35['id'],_0x593d35);SquareProjectEvents['emit'](_0x4775ab,_0x593d35);_0x17ea98(null);};}for(var e in events){if(events[_0x19e8('0x6')](e)){var event=events[e];SquareProject[_0x19e8('0x7')](e,emitEvent(event));}}module[_0x19e8('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 937e38c..f341871 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 _0x25e2=['../../config/environment','./squareProject.attributes','exports','preproduction','savedAt','changed','production','publishedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1126f2,_0x2cb7c3){var _0x8a9650=function(_0x1e05e5){while(--_0x1e05e5){_0x1126f2['push'](_0x1126f2['shift']());}};_0x8a9650(++_0x2cb7c3);}(_0x25e2,0x88));var _0x225e=function(_0x25c196,_0x365afc){_0x25c196=_0x25c196-0x0;var _0x5ac8ea=_0x25e2[_0x25c196];return _0x5ac8ea;};'use strict';var _=require(_0x225e('0x0'));var util=require(_0x225e('0x1'));var logger=require(_0x225e('0x2'))(_0x225e('0x3'));var moment=require(_0x225e('0x4'));var BPromise=require(_0x225e('0x5'));var rp=require(_0x225e('0x6'));var fs=require('fs');var path=require(_0x225e('0x7'));var rimraf=require('rimraf');var config=require(_0x225e('0x8'));var attributes=require(_0x225e('0x9'));module[_0x225e('0xa')]=function(_0x131c2c,_0x376e92){return _0x131c2c['define']('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x118511,_0x10722d,_0x54b59f){if(_0x118511['changed'](_0x225e('0xb'))){_0x118511[_0x225e('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x118511[_0x225e('0xd')](_0x225e('0xe'))){_0x118511[_0x225e('0xf')]=moment()[_0x225e('0x10')](_0x225e('0x11'));}_0x54b59f(null,_0x118511);}}});}; \ No newline at end of file +var _0xcefe=['changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api','moment','request-promise','path','rimraf','./squareProject.attributes','define','SquareProject','square_projects'];(function(_0x1ee6ca,_0xaad46c){var _0x3d6b5f=function(_0x31eb24){while(--_0x31eb24){_0x1ee6ca['push'](_0x1ee6ca['shift']());}};_0x3d6b5f(++_0xaad46c);}(_0xcefe,0xd2));var _0xecef=function(_0xfc8990,_0x514dc4){_0xfc8990=_0xfc8990-0x0;var _0x1f3382=_0xcefe[_0xfc8990];return _0x1f3382;};'use strict';var _=require(_0xecef('0x0'));var util=require(_0xecef('0x1'));var logger=require('../../config/logger')(_0xecef('0x2'));var moment=require(_0xecef('0x3'));var BPromise=require('bluebird');var rp=require(_0xecef('0x4'));var fs=require('fs');var path=require(_0xecef('0x5'));var rimraf=require(_0xecef('0x6'));var config=require('../../config/environment');var attributes=require(_0xecef('0x7'));module['exports']=function(_0x128c73,_0x528281){return _0x128c73[_0xecef('0x8')](_0xecef('0x9'),attributes,{'tableName':_0xecef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x312ded,_0x37288d,_0x570421){if(_0x312ded[_0xecef('0xb')](_0xecef('0xc'))){_0x312ded['savedAt']=moment()[_0xecef('0xd')](_0xecef('0xe'));}if(_0x312ded['changed'](_0xecef('0xf'))){_0x312ded[_0xecef('0x10')]=moment()[_0xecef('0xd')](_0xecef('0xe'));}_0x570421(null,_0x312ded);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index b67f945..241df24 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 _0x42e8=['model','attributes','then','debug','catch','error','message','find','info','ShowSquareProject','stringify','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','localhost','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','include','map'];(function(_0x3d5ebc,_0x354479){var _0x1a9911=function(_0x1da1ea){while(--_0x1da1ea){_0x3d5ebc['push'](_0x3d5ebc['shift']());}};_0x1a9911(++_0x354479);}(_0x42e8,0xf3));var _0x842e=function(_0x5d0eca,_0x4b7289){_0x5d0eca=_0x5d0eca-0x0;var _0x435c80=_0x42e8[_0x5d0eca];return _0x435c80;};'use strict';var _=require(_0x842e('0x0'));var Redis=require(_0x842e('0x1'));var db=require(_0x842e('0x2'))['db'];var logger=require(_0x842e('0x3'))(_0x842e('0x4'));var config=require(_0x842e('0x5'));config[_0x842e('0x6')]=_['defaults'](config[_0x842e('0x6')],{'host':_0x842e('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x842e('0x6')]));require(_0x842e('0x8'))[_0x842e('0x9')](socket);exports[_0x842e('0xa')]=function(_0x5abb4c){var _0x408b26=this;return new Promise(function(_0x1fb9b4,_0x3d9d99){return db[_0x842e('0xb')][_0x842e('0xc')]({'raw':_0x5abb4c[_0x842e('0xd')]?_0x5abb4c['options'][_0x842e('0xe')]===undefined?!![]:![]:!![],'where':_0x5abb4c[_0x842e('0xd')]?_0x5abb4c[_0x842e('0xd')][_0x842e('0xf')]||null:null,'attributes':_0x5abb4c[_0x842e('0xd')]?_0x5abb4c[_0x842e('0xd')]['attributes']||null:null,'limit':_0x5abb4c[_0x842e('0xd')]?_0x5abb4c[_0x842e('0xd')]['limit']||null:null,'include':_0x5abb4c[_0x842e('0xd')]?_0x5abb4c['options'][_0x842e('0x10')]?_[_0x842e('0x11')](_0x5abb4c['options'][_0x842e('0x10')],function(_0x37e82d){return{'model':db[_0x37e82d[_0x842e('0x12')]],'as':_0x37e82d['as'],'attributes':_0x37e82d[_0x842e('0x13')],'include':_0x37e82d[_0x842e('0x10')]?_['map'](_0x37e82d[_0x842e('0x10')],function(_0x2d4e80){return{'model':db[_0x2d4e80['model']],'as':_0x2d4e80['as'],'attributes':_0x2d4e80[_0x842e('0x13')],'include':_0x2d4e80[_0x842e('0x10')]?_[_0x842e('0x11')](_0x2d4e80['include'],function(_0x21288e){return{'model':db[_0x21288e[_0x842e('0x12')]],'as':_0x21288e['as'],'attributes':_0x21288e['attributes']};}):[]};}):[]};}):[]:[]})[_0x842e('0x14')](function(_0xf4d3e9){logger['info'](_0x842e('0xa'),_0x5abb4c);logger[_0x842e('0x15')](_0x842e('0xa'),_0x5abb4c,JSON['stringify'](_0xf4d3e9));_0x1fb9b4(_0xf4d3e9);})[_0x842e('0x16')](function(_0x5eceda){logger[_0x842e('0x17')](_0x842e('0xa'),_0x5eceda[_0x842e('0x18')],_0x5abb4c);_0x3d9d99(_0x408b26[_0x842e('0x17')](0x1f4,_0x5eceda[_0x842e('0x18')]));});});};exports['ShowSquareProject']=function(_0x36ffbc){var _0x47fd15=this;return new Promise(function(_0x2957c5,_0x348953){return db[_0x842e('0xb')][_0x842e('0x19')]({'raw':_0x36ffbc[_0x842e('0xd')]?_0x36ffbc['options'][_0x842e('0xe')]===undefined?!![]:![]:!![],'where':_0x36ffbc[_0x842e('0xd')]?_0x36ffbc[_0x842e('0xd')]['where']||null:null,'attributes':_0x36ffbc[_0x842e('0xd')]?_0x36ffbc[_0x842e('0xd')][_0x842e('0x13')]||null:null,'include':_0x36ffbc[_0x842e('0xd')]?_0x36ffbc['options'][_0x842e('0x10')]?_[_0x842e('0x11')](_0x36ffbc[_0x842e('0xd')][_0x842e('0x10')],function(_0x5723cd){return{'model':db[_0x5723cd[_0x842e('0x12')]],'as':_0x5723cd['as'],'attributes':_0x5723cd[_0x842e('0x13')],'include':_0x5723cd[_0x842e('0x10')]?_[_0x842e('0x11')](_0x5723cd[_0x842e('0x10')],function(_0x488578){return{'model':db[_0x488578[_0x842e('0x12')]],'as':_0x488578['as'],'attributes':_0x488578[_0x842e('0x13')],'include':_0x488578[_0x842e('0x10')]?_['map'](_0x488578[_0x842e('0x10')],function(_0x359e88){return{'model':db[_0x359e88[_0x842e('0x12')]],'as':_0x359e88['as'],'attributes':_0x359e88['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22212e){logger[_0x842e('0x1a')](_0x842e('0x1b'),_0x36ffbc);logger[_0x842e('0x15')](_0x842e('0x1b'),_0x36ffbc,JSON[_0x842e('0x1c')](_0x22212e));_0x2957c5(_0x22212e);})[_0x842e('0x16')](function(_0x264814){logger[_0x842e('0x17')](_0x842e('0x1b'),_0x264814[_0x842e('0x18')],_0x36ffbc);_0x348953(_0x47fd15['error'](0x1f4,_0x264814[_0x842e('0x18')]));});});}; \ No newline at end of file +var _0x9e03=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','GetSquareProjects','SquareProject','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','ShowSquareProject','find'];(function(_0x1e9832,_0x46709e){var _0x3e3400=function(_0x58a401){while(--_0x58a401){_0x1e9832['push'](_0x1e9832['shift']());}};_0x3e3400(++_0x46709e);}(_0x9e03,0x105));var _0x39e0=function(_0x74ee7,_0x2855f7){_0x74ee7=_0x74ee7-0x0;var _0xd4aa4d=_0x9e03[_0x74ee7];return _0xd4aa4d;};'use strict';var _=require('lodash');var Redis=require(_0x39e0('0x0'));var db=require(_0x39e0('0x1'))['db'];var logger=require(_0x39e0('0x2'))(_0x39e0('0x3'));var config=require(_0x39e0('0x4'));config[_0x39e0('0x5')]=_[_0x39e0('0x6')](config[_0x39e0('0x5')],{'host':_0x39e0('0x7'),'port':0x18eb});var socket=require(_0x39e0('0x8'))(new Redis(config[_0x39e0('0x5')]));require('./squareProject.socket')[_0x39e0('0x9')](socket);exports[_0x39e0('0xa')]=function(_0xfa5292){var _0x4e44d0=this;return new Promise(function(_0x5e83c4,_0x8ff4e7){return db[_0x39e0('0xb')]['findAll']({'raw':_0xfa5292[_0x39e0('0xc')]?_0xfa5292[_0x39e0('0xc')][_0x39e0('0xd')]===undefined?!![]:![]:!![],'where':_0xfa5292[_0x39e0('0xc')]?_0xfa5292[_0x39e0('0xc')][_0x39e0('0xe')]||null:null,'attributes':_0xfa5292[_0x39e0('0xc')]?_0xfa5292['options'][_0x39e0('0xf')]||null:null,'limit':_0xfa5292['options']?_0xfa5292[_0x39e0('0xc')][_0x39e0('0x10')]||null:null,'include':_0xfa5292[_0x39e0('0xc')]?_0xfa5292[_0x39e0('0xc')][_0x39e0('0x11')]?_[_0x39e0('0x12')](_0xfa5292['options']['include'],function(_0x5341d2){return{'model':db[_0x5341d2['model']],'as':_0x5341d2['as'],'attributes':_0x5341d2[_0x39e0('0xf')],'include':_0x5341d2[_0x39e0('0x11')]?_[_0x39e0('0x12')](_0x5341d2[_0x39e0('0x11')],function(_0x12dfa6){return{'model':db[_0x12dfa6[_0x39e0('0x13')]],'as':_0x12dfa6['as'],'attributes':_0x12dfa6[_0x39e0('0xf')],'include':_0x12dfa6['include']?_[_0x39e0('0x12')](_0x12dfa6['include'],function(_0x232057){return{'model':db[_0x232057[_0x39e0('0x13')]],'as':_0x232057['as'],'attributes':_0x232057[_0x39e0('0xf')]};}):[]};}):[]};}):[]:[]})[_0x39e0('0x14')](function(_0x3369c5){logger[_0x39e0('0x15')]('GetSquareProjects',_0xfa5292);logger[_0x39e0('0x16')]('GetSquareProjects',_0xfa5292,JSON[_0x39e0('0x17')](_0x3369c5));_0x5e83c4(_0x3369c5);})[_0x39e0('0x18')](function(_0x1093e2){logger[_0x39e0('0x19')](_0x39e0('0xa'),_0x1093e2[_0x39e0('0x1a')],_0xfa5292);_0x8ff4e7(_0x4e44d0[_0x39e0('0x19')](0x1f4,_0x1093e2[_0x39e0('0x1a')]));});});};exports[_0x39e0('0x1b')]=function(_0x59b980){var _0x337b29=this;return new Promise(function(_0x15b6f8,_0x4bc0ae){return db[_0x39e0('0xb')][_0x39e0('0x1c')]({'raw':_0x59b980[_0x39e0('0xc')]?_0x59b980[_0x39e0('0xc')][_0x39e0('0xd')]===undefined?!![]:![]:!![],'where':_0x59b980[_0x39e0('0xc')]?_0x59b980[_0x39e0('0xc')][_0x39e0('0xe')]||null:null,'attributes':_0x59b980['options']?_0x59b980[_0x39e0('0xc')][_0x39e0('0xf')]||null:null,'include':_0x59b980[_0x39e0('0xc')]?_0x59b980[_0x39e0('0xc')][_0x39e0('0x11')]?_[_0x39e0('0x12')](_0x59b980[_0x39e0('0xc')][_0x39e0('0x11')],function(_0x1328d4){return{'model':db[_0x1328d4[_0x39e0('0x13')]],'as':_0x1328d4['as'],'attributes':_0x1328d4[_0x39e0('0xf')],'include':_0x1328d4[_0x39e0('0x11')]?_[_0x39e0('0x12')](_0x1328d4[_0x39e0('0x11')],function(_0xd3a23d){return{'model':db[_0xd3a23d[_0x39e0('0x13')]],'as':_0xd3a23d['as'],'attributes':_0xd3a23d[_0x39e0('0xf')],'include':_0xd3a23d[_0x39e0('0x11')]?_[_0x39e0('0x12')](_0xd3a23d[_0x39e0('0x11')],function(_0x104b7d){return{'model':db[_0x104b7d[_0x39e0('0x13')]],'as':_0x104b7d['as'],'attributes':_0x104b7d[_0x39e0('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7d10e2){logger['info'](_0x39e0('0x1b'),_0x59b980);logger[_0x39e0('0x16')](_0x39e0('0x1b'),_0x59b980,JSON['stringify'](_0x7d10e2));_0x15b6f8(_0x7d10e2);})[_0x39e0('0x18')](function(_0x32c68f){logger[_0x39e0('0x19')](_0x39e0('0x1b'),_0x32c68f[_0x39e0('0x1a')],_0x59b980);_0x4bc0ae(_0x337b29[_0x39e0('0x19')](0x1f4,_0x32c68f[_0x39e0('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 38423cd..ccefa14 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 _0x67d0=['register','update','emit','removeListener'];(function(_0x28e28e,_0x304436){var _0x23a4ee=function(_0x4f9d5c){while(--_0x4f9d5c){_0x28e28e['push'](_0x28e28e['shift']());}};_0x23a4ee(++_0x304436);}(_0x67d0,0x191));var _0x067d=function(_0x3979e1,_0x55f307){_0x3979e1=_0x3979e1-0x0;var _0x282bc6=_0x67d0[_0x3979e1];return _0x282bc6;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0x067d('0x0')];function createListener(_0x50201e,_0x3efe2f){return function(_0x3ef9a7){_0x3efe2f[_0x067d('0x1')](_0x50201e,_0x3ef9a7);};}function removeListener(_0x32e2d3,_0x262eae){return function(){SquareProjectEvents[_0x067d('0x2')](_0x32e2d3,_0x262eae);};}exports[_0x067d('0x3')]=function(_0x206301){for(var _0x1bc59e=0x0,_0x17a867=events['length'];_0x1bc59e<_0x17a867;_0x1bc59e++){var _0x151e22=events[_0x1bc59e];var _0x4f0448=createListener('squareProject:'+_0x151e22,_0x206301);SquareProjectEvents['on'](_0x151e22,_0x4f0448);}}; \ No newline at end of file +var _0x4941=['length','squareProject:','./squareProject.events','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4941,0x19f));var _0x1494=function(_0x54eab6,_0x5e262f){_0x54eab6=_0x54eab6-0x0;var _0x1e7435=_0x4941[_0x54eab6];return _0x1e7435;};'use strict';var SquareProjectEvents=require(_0x1494('0x0'));var events=['save','remove',_0x1494('0x1')];function createListener(_0x31acbd,_0x386c28){return function(_0x7f5824){_0x386c28[_0x1494('0x2')](_0x31acbd,_0x7f5824);};}function removeListener(_0x1f8646,_0x3bc0b0){return function(){SquareProjectEvents[_0x1494('0x3')](_0x1f8646,_0x3bc0b0);};}exports[_0x1494('0x4')]=function(_0x3b0f7c){for(var _0x5a81ca=0x0,_0x2a3e5c=events[_0x1494('0x5')];_0x5a81ca<_0x2a3e5c;_0x5a81ca++){var _0x47edfe=events[_0x5a81ca];var _0x5752d0=createListener(_0x1494('0x6')+_0x47edfe,_0x3b0f7c);SquareProjectEvents['on'](_0x47edfe,_0x5752d0);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 5e076c6..1926c32 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 _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2f3c0c,_0x2e8488){var _0x1947b7=function(_0x1c8da1){while(--_0x1c8da1){_0x2f3c0c['push'](_0x2f3c0c['shift']());}};_0x1947b7(++_0x2e8488);}(_0x4975,0x86));var _0x5497=function(_0x181b6f,_0x5005db){_0x181b6f=_0x181b6f-0x0;var _0x1c3f61=_0x4975[_0x181b6f];return _0x1c3f61;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x5cc891,_0x262592){var _0x5f125e=function(_0x355f02){while(--_0x355f02){_0x5cc891['push'](_0x5cc891['shift']());}};_0x5f125e(++_0x262592);}(_0x1261,0x144));var _0x1126=function(_0x543c51,_0xff0084){_0x543c51=_0x543c51-0x0;var _0x360555=_0x1261[_0x543c51];return _0x360555;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 49b059a..cf52c77 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 _0x5075=['savePath','sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x37d4ac,_0x4e47d6){var _0x5e727a=function(_0x5adbff){while(--_0x5adbff){_0x37d4ac['push'](_0x37d4ac['shift']());}};_0x5e727a(++_0x4e47d6);}(_0x5075,0x73));var _0x5507=function(_0x40570e,_0x53df30){_0x40570e=_0x40570e-0x0;var _0x16336a=_0x5075[_0x40570e];return _0x16336a;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'uniqueid':{'type':Sequelize[_0x5507('0x2')]},'callerid':{'type':Sequelize[_0x5507('0x2')]},'calleridname':{'type':Sequelize[_0x5507('0x2')]},'context':{'type':Sequelize[_0x5507('0x2')]},'extension':{'type':Sequelize[_0x5507('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5507('0x2')]},'dnid':{'type':Sequelize[_0x5507('0x2')]},'projectName':{'type':Sequelize[_0x5507('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x5507('0x2')]},'format':{'type':Sequelize[_0x5507('0x3')],'get':function(){var _0x4c2d6d='';var _0x42c232=this[_0x5507('0x4')](_0x5507('0x5'));if(_0x42c232){_0x4c2d6d=_0x42c232['substring'](_0x42c232['lastIndexOf']('.'));}return _0x4c2d6d;}}}; \ No newline at end of file +var _0x3e74=['getDataValue','savePath','substring','sequelize','STRING'];(function(_0x2e28a5,_0x5957c9){var _0x5188aa=function(_0x3fffa5){while(--_0x3fffa5){_0x2e28a5['push'](_0x2e28a5['shift']());}};_0x5188aa(++_0x5957c9);}(_0x3e74,0x175));var _0x43e7=function(_0x350e49,_0x23689e){_0x350e49=_0x350e49-0x0;var _0x87ca85=_0x3e74[_0x350e49];return _0x87ca85;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'callerid':{'type':Sequelize[_0x43e7('0x1')]},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x43e7('0x1')]},'projectName':{'type':Sequelize[_0x43e7('0x1')]},'saveName':{'type':Sequelize[_0x43e7('0x1')]},'filename':{'type':Sequelize[_0x43e7('0x1')]},'savePath':{'type':Sequelize[_0x43e7('0x1')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x45a0d1='';var _0x3491d6=this[_0x43e7('0x2')](_0x43e7('0x3'));if(_0x3491d6){_0x45a0d1=_0x3491d6[_0x43e7('0x4')](_0x3491d6['lastIndexOf']('.'));}return _0x45a0d1;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index aef88e2..7ee8dcf 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 _0x335c=['format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','extname','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','VIRTUAL','merge','options','SquareRecording','include','findAll','rows','catch','show','params','length','find','create','update','body','download','../../components/encryptor','uniqueid','savePath','filename'];(function(_0x26fad8,_0x1d1bb0){var _0x5aecf7=function(_0x1a9021){while(--_0x1a9021){_0x26fad8['push'](_0x26fad8['shift']());}};_0x5aecf7(++_0x1d1bb0);}(_0x335c,0x129));var _0xc335=function(_0x2fe368,_0x5266a6){_0x2fe368=_0x2fe368-0x0;var _0x416ff3=_0x335c[_0x2fe368];return _0x416ff3;};'use strict';var emlformat=require(_0xc335('0x0'));var rimraf=require(_0xc335('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc335('0x2'));var rp=require(_0xc335('0x3'));var moment=require(_0xc335('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc335('0x5'));var util=require(_0xc335('0x6'));var path=require(_0xc335('0x7'));var sox=require(_0xc335('0x8'));var csv=require(_0xc335('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc335('0xa'));var _=require(_0xc335('0xb'));var squel=require(_0xc335('0xc'));var crypto=require(_0xc335('0xd'));var jsforce=require(_0xc335('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc335('0x9'));var querystring=require(_0xc335('0xf'));var Papa=require(_0xc335('0x10'));var Redis=require(_0xc335('0x11'));var authService=require(_0xc335('0x12'));var qs=require(_0xc335('0x13'));var as=require(_0xc335('0x14'));var hardwareService=require(_0xc335('0x15'));var logger=require(_0xc335('0x16'))('api');var utils=require(_0xc335('0x17'));var config=require(_0xc335('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6c0ded,_0xac5ee2){_0xac5ee2=_0xac5ee2||0xcc;return function(_0x15a5b8){if(_0x15a5b8){return _0x6c0ded[_0xc335('0x19')](_0xac5ee2);}return _0x6c0ded[_0xc335('0x1a')](_0xac5ee2)[_0xc335('0x1b')]();};}function respondWithResult(_0x472747,_0x36f5f4){_0x36f5f4=_0x36f5f4||0xc8;return function(_0x40c785){if(_0x40c785){return _0x472747[_0xc335('0x1a')](_0x36f5f4)[_0xc335('0x1c')](_0x40c785);}};}function respondWithFilteredResult(_0x50038e,_0x2c73f6){return function(_0x3845e8){if(_0x3845e8){var _0x418030=typeof _0x2c73f6['offset']==='undefined'&&typeof _0x2c73f6['limit']==='undefined';var _0x53a747=_0x3845e8[_0xc335('0x1d')];var _0x6f5965=_0x418030?0x0:_0x2c73f6[_0xc335('0x1e')];var _0x3ae4bd=_0x418030?_0x3845e8[_0xc335('0x1d')]:_0x2c73f6['offset']+_0x2c73f6[_0xc335('0x1f')];var _0x49798a;if(_0x3ae4bd>=_0x53a747){_0x3ae4bd=_0x53a747;_0x49798a=0xc8;}else{_0x49798a=0xce;}_0x50038e[_0xc335('0x1a')](_0x49798a);return _0x50038e[_0xc335('0x20')]('Content-Range',_0x6f5965+'-'+_0x3ae4bd+'/'+_0x53a747)[_0xc335('0x1c')](_0x3845e8);}return null;};}function patchUpdates(_0x16791e){return function(_0x4285a2){try{jsonpatch[_0xc335('0x21')](_0x4285a2,_0x16791e,!![]);}catch(_0x573f98){return BPromise['reject'](_0x573f98);}return _0x4285a2['save']();};}function saveUpdates(_0x2b3c6b,_0x47817f){return function(_0xc5b868){if(_0xc5b868){return _0xc5b868['update'](_0x2b3c6b)['then'](function(_0x1c4922){return _0x1c4922;});}return null;};}function removeEntity(_0x1f09d4,_0x3fbc70){return function(_0x3568c7){if(_0x3568c7){return _0x3568c7[_0xc335('0x22')]()[_0xc335('0x23')](function(){_0x1f09d4[_0xc335('0x1a')](0xcc)[_0xc335('0x1b')]();});}};}function handleEntityNotFound(_0x113288,_0x2f3ee2){return function(_0x4a09b3){if(!_0x4a09b3){_0x113288['sendStatus'](0x194);}return _0x4a09b3;};}function handleError(_0x26cc94,_0x49a5b6){_0x49a5b6=_0x49a5b6||0x1f4;return function(_0x2ef4bd){logger[_0xc335('0x24')](_0x2ef4bd[_0xc335('0x25')]);if(_0x2ef4bd[_0xc335('0x26')]){delete _0x2ef4bd['name'];}_0x26cc94[_0xc335('0x1a')](_0x49a5b6)[_0xc335('0x27')](_0x2ef4bd);};}exports['index']=function(_0x2ce8cc,_0x1d9d88){var _0x23f413={},_0x50b4de={},_0x515f68={'count':0x0,'rows':[]};var _0x231f15=_[_0xc335('0x28')](db['SquareRecording'][_0xc335('0x29')],function(_0x183a70){return{'name':_0x183a70[_0xc335('0x2a')],'type':_0x183a70[_0xc335('0x2b')]['key']};});_0x50b4de[_0xc335('0x2c')]=_[_0xc335('0x28')](_0x231f15,'name');_0x50b4de[_0xc335('0x2d')]=_[_0xc335('0x2e')](_0x2ce8cc[_0xc335('0x2d')]);_0x50b4de[_0xc335('0x2f')]=_[_0xc335('0x30')](_0x50b4de[_0xc335('0x2c')],_0x50b4de[_0xc335('0x2d')]);_0x23f413[_0xc335('0x31')]=_[_0xc335('0x30')](_0x50b4de[_0xc335('0x2c')],qs[_0xc335('0x32')](_0x2ce8cc['query'][_0xc335('0x32')]));_0x23f413['attributes']=_0x23f413[_0xc335('0x31')]['length']?_0x23f413[_0xc335('0x31')]:_0x50b4de[_0xc335('0x2c')];if(!_0x2ce8cc[_0xc335('0x2d')]['hasOwnProperty']('nolimit')){_0x23f413['limit']=qs[_0xc335('0x1f')](_0x2ce8cc[_0xc335('0x2d')][_0xc335('0x1f')]);_0x23f413['offset']=qs[_0xc335('0x1e')](_0x2ce8cc['query'][_0xc335('0x1e')]);}_0x23f413[_0xc335('0x33')]=qs[_0xc335('0x34')](_0x2ce8cc[_0xc335('0x2d')]['sort']);_0x23f413[_0xc335('0x35')]=qs[_0xc335('0x2f')](_['pick'](_0x2ce8cc[_0xc335('0x2d')],_0x50b4de['filters']),_0x231f15);if(_0x2ce8cc['query'][_0xc335('0x36')]){_0x23f413['where']=_['merge'](_0x23f413[_0xc335('0x35')],{'$or':_[_0xc335('0x28')](_0x231f15,function(_0x57472f){if(_0x57472f[_0xc335('0x2b')]!==_0xc335('0x37')){var _0x53c1cb={};_0x53c1cb[_0x57472f[_0xc335('0x26')]]={'$like':'%'+_0x2ce8cc['query'][_0xc335('0x36')]+'%'};return _0x53c1cb;}})});}_0x23f413=_[_0xc335('0x38')]({},_0x23f413,_0x2ce8cc[_0xc335('0x39')]);var _0x164d4e={'where':_0x23f413['where']};return db[_0xc335('0x3a')][_0xc335('0x1d')](_0x164d4e)[_0xc335('0x23')](function(_0x459e1b){_0x515f68[_0xc335('0x1d')]=_0x459e1b;if(_0x2ce8cc[_0xc335('0x2d')]['includeAll']){_0x23f413[_0xc335('0x3b')]=[{'all':!![]}];}return db[_0xc335('0x3a')][_0xc335('0x3c')](_0x23f413);})[_0xc335('0x23')](function(_0x123a4d){_0x515f68[_0xc335('0x3d')]=_0x123a4d;return _0x515f68;})[_0xc335('0x23')](respondWithFilteredResult(_0x1d9d88,_0x23f413))[_0xc335('0x3e')](handleError(_0x1d9d88,null));};exports[_0xc335('0x3f')]=function(_0x1cdfcd,_0x11e0c3){var _0x5402af={'raw':!![],'where':{'id':_0x1cdfcd[_0xc335('0x40')]['id']}},_0xda5c9a={};_0xda5c9a['model']=_[_0xc335('0x2e')](db[_0xc335('0x3a')][_0xc335('0x29')]);_0xda5c9a['query']=_[_0xc335('0x2e')](_0x1cdfcd['query']);_0xda5c9a[_0xc335('0x2f')]=_[_0xc335('0x30')](_0xda5c9a[_0xc335('0x2c')],_0xda5c9a['query']);_0x5402af['attributes']=_[_0xc335('0x30')](_0xda5c9a[_0xc335('0x2c')],qs[_0xc335('0x32')](_0x1cdfcd['query'][_0xc335('0x32')]));_0x5402af[_0xc335('0x31')]=_0x5402af[_0xc335('0x31')][_0xc335('0x41')]?_0x5402af['attributes']:_0xda5c9a['model'];if(_0x1cdfcd[_0xc335('0x2d')]['includeAll']){_0x5402af['include']=[{'all':!![]}];}_0x5402af=_[_0xc335('0x38')]({},_0x5402af,_0x1cdfcd[_0xc335('0x39')]);return db['SquareRecording'][_0xc335('0x42')](_0x5402af)[_0xc335('0x23')](handleEntityNotFound(_0x11e0c3,null))[_0xc335('0x23')](respondWithResult(_0x11e0c3,null))[_0xc335('0x3e')](handleError(_0x11e0c3,null));};exports[_0xc335('0x43')]=function(_0x3e9857,_0x4b3d1f){return db[_0xc335('0x3a')][_0xc335('0x43')](_0x3e9857['body'],{})[_0xc335('0x23')](respondWithResult(_0x4b3d1f,0xc9))[_0xc335('0x3e')](handleError(_0x4b3d1f,null));};exports[_0xc335('0x44')]=function(_0x13fd66,_0x21a599){if(_0x13fd66[_0xc335('0x45')]['id']){delete _0x13fd66[_0xc335('0x45')]['id'];}return db[_0xc335('0x3a')][_0xc335('0x42')]({'where':{'id':_0x13fd66[_0xc335('0x40')]['id']}})['then'](handleEntityNotFound(_0x21a599,null))[_0xc335('0x23')](saveUpdates(_0x13fd66['body'],null))['then'](respondWithResult(_0x21a599,null))[_0xc335('0x3e')](handleError(_0x21a599,null));};exports[_0xc335('0x46')]=function(_0x29d672,_0x15fb92,_0x4c18cc){var _0x1da661=require(_0xc335('0x47'));var _0x54f437=![];var _0x38df47={};if(_0x29d672[_0xc335('0x2d')][_0xc335('0x2b')]&&_0x29d672[_0xc335('0x2d')][_0xc335('0x2b')]===_0xc335('0x48')){_0x38df47[_0xc335('0x48')]=_0x29d672[_0xc335('0x40')]['id'];}else{_0x38df47['id']=_0x29d672[_0xc335('0x40')]['id'];}return db[_0xc335('0x3a')][_0xc335('0x42')]({'where':_0x38df47,'attributes':['id',_0xc335('0x49'),_0xc335('0x4a')],'raw':!![]})[_0xc335('0x23')](handleEntityNotFound(_0x15fb92,null))[_0xc335('0x23')](function(_0xd878a){if(_0xd878a){var _0x3aaf00=_0xd878a[_0xc335('0x49')];var _0x39832c=util[_0xc335('0x4b')](_0xc335('0x4c'),_0x3aaf00);if(fs[_0xc335('0x4d')](_0x39832c)){_0x54f437=!![];return _0x1da661[_0xc335('0x4e')](_0x39832c,_0x3aaf00,config[_0xc335('0x4f')][_0xc335('0x50')])[_0xc335('0x23')](function(){return _0xd878a;});}return _0xd878a;}})[_0xc335('0x23')](function(_0x507aa5){if(_0x507aa5){var _0x31dcfc=_0x507aa5[_0xc335('0x49')];if(!fs[_0xc335('0x4d')](_0x31dcfc)){throw new db[(_0xc335('0x51'))][(_0xc335('0x52'))]('SquareRecording\x20not\x20found');}if(_0x507aa5[_0xc335('0x4a')]){return _0x15fb92['download'](_0x31dcfc,_0x507aa5[_0xc335('0x4a')]+path[_0xc335('0x53')](_0x31dcfc),function(){if(_0x54f437){fs['unlink'](_0x31dcfc);}});}else{return _0x15fb92['download'](_0x31dcfc,function(_0x1324bc){if(_0x54f437){fs[_0xc335('0x54')](_0x31dcfc);}});}}})[_0xc335('0x3e')](function(_0x5d424f){if(_0x5d424f['message']==='SquareRecording\x20not\x20found'){_0x15fb92[_0xc335('0x1a')](0x194)['send'](_0xc335('0x55'));}else{return handleError(_0x15fb92,null);}});};exports[_0xc335('0x22')]=function(_0x158112,_0x1dff8f){return db[_0xc335('0x3a')][_0xc335('0x42')]({'where':{'id':_0x158112[_0xc335('0x40')]['id']}})[_0xc335('0x23')](function(_0x4393e1){if(_[_0xc335('0x56')](_0x4393e1)){throw new ReferenceError(_0xc335('0x57'));}return _0x4393e1;})[_0xc335('0x23')](function(_0x211fbf){var _0x16fe80=_0x211fbf[_0xc335('0x49')];logger[_0xc335('0x58')](_0xc335('0x59'),_0x16fe80);if(!_[_0xc335('0x56')](_0x211fbf[_0xc335('0x49')])&&fs[_0xc335('0x4d')](_0x16fe80)){logger[_0xc335('0x58')](_0xc335('0x5a')+_0x16fe80+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc335('0x5b')](_0x16fe80);}_0x16fe80=_0x16fe80+'.cypher';if(!_[_0xc335('0x56')](_0x211fbf[_0xc335('0x49')])&&fs['existsSync'](_0x16fe80)){logger[_0xc335('0x58')]('File:\x20\x22'+_0x16fe80+_0xc335('0x5c'));fs[_0xc335('0x5b')](_0x16fe80);}return _0x211fbf;})['then'](function(_0x2c50e8){if(!_0x2c50e8)throw new InternalError();return _0x2c50e8['destroy']();})['then'](function(){_0x1dff8f[_0xc335('0x1a')](0xcc)[_0xc335('0x1b')]();})[_0xc335('0x3e')](handleError(_0x1dff8f,null));}; \ No newline at end of file +var _0xe03f=['then','error','stack','name','send','index','map','SquareRecording','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','find','create','body','catch','params','../../components/encryptor','uniqueid','format','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','download','extname','unlink','destroy','isNil','savePath','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update'];(function(_0xb874a8,_0x41e19d){var _0x291320=function(_0x485c01){while(--_0x485c01){_0xb874a8['push'](_0xb874a8['shift']());}};_0x291320(++_0x41e19d);}(_0xe03f,0xfe));var _0xfe03=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe03f[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xfe03('0x0'));var rimraf=require(_0xfe03('0x1'));var zipdir=require(_0xfe03('0x2'));var jsonpatch=require(_0xfe03('0x3'));var rp=require(_0xfe03('0x4'));var moment=require(_0xfe03('0x5'));var BPromise=require(_0xfe03('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xfe03('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe03('0x8'));var _=require(_0xfe03('0x9'));var squel=require(_0xfe03('0xa'));var crypto=require(_0xfe03('0xb'));var jsforce=require(_0xfe03('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfe03('0xd'));var Redis=require(_0xfe03('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfe03('0xf'));var hardwareService=require(_0xfe03('0x10'));var logger=require(_0xfe03('0x11'))('api');var utils=require(_0xfe03('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xfe03('0x13'));var db=require(_0xfe03('0x14'))['db'];function respondWithStatusCode(_0x36ae84,_0x900e2c){_0x900e2c=_0x900e2c||0xcc;return function(_0x47b109){if(_0x47b109){return _0x36ae84[_0xfe03('0x15')](_0x900e2c);}return _0x36ae84[_0xfe03('0x16')](_0x900e2c)[_0xfe03('0x17')]();};}function respondWithResult(_0x305c0a,_0xb3e52c){_0xb3e52c=_0xb3e52c||0xc8;return function(_0x278e5c){if(_0x278e5c){return _0x305c0a[_0xfe03('0x16')](_0xb3e52c)[_0xfe03('0x18')](_0x278e5c);}};}function respondWithFilteredResult(_0x4777f8,_0x642593){return function(_0x45088b){if(_0x45088b){var _0x4c24a6=typeof _0x642593['offset']===_0xfe03('0x19')&&typeof _0x642593['limit']===_0xfe03('0x19');var _0x332505=_0x45088b[_0xfe03('0x1a')];var _0x3666de=_0x4c24a6?0x0:_0x642593[_0xfe03('0x1b')];var _0x54919d=_0x4c24a6?_0x45088b[_0xfe03('0x1a')]:_0x642593[_0xfe03('0x1b')]+_0x642593[_0xfe03('0x1c')];var _0x5b0b03;if(_0x54919d>=_0x332505){_0x54919d=_0x332505;_0x5b0b03=0xc8;}else{_0x5b0b03=0xce;}_0x4777f8[_0xfe03('0x16')](_0x5b0b03);return _0x4777f8['set'](_0xfe03('0x1d'),_0x3666de+'-'+_0x54919d+'/'+_0x332505)['json'](_0x45088b);}return null;};}function patchUpdates(_0x167fa1){return function(_0x17a282){try{jsonpatch[_0xfe03('0x1e')](_0x17a282,_0x167fa1,!![]);}catch(_0x45c7bb){return BPromise[_0xfe03('0x1f')](_0x45c7bb);}return _0x17a282[_0xfe03('0x20')]();};}function saveUpdates(_0x599318,_0x21b2c7){return function(_0xf27a93){if(_0xf27a93){return _0xf27a93[_0xfe03('0x21')](_0x599318)[_0xfe03('0x22')](function(_0x22bbaa){return _0x22bbaa;});}return null;};}function removeEntity(_0x3c4321,_0x109858){return function(_0x3ac221){if(_0x3ac221){return _0x3ac221['destroy']()[_0xfe03('0x22')](function(){_0x3c4321[_0xfe03('0x16')](0xcc)[_0xfe03('0x17')]();});}};}function handleEntityNotFound(_0x4beaa9,_0x5a7678){return function(_0x2b24ba){if(!_0x2b24ba){_0x4beaa9[_0xfe03('0x15')](0x194);}return _0x2b24ba;};}function handleError(_0x1f2053,_0x4b10ce){_0x4b10ce=_0x4b10ce||0x1f4;return function(_0x4d855d){logger[_0xfe03('0x23')](_0x4d855d[_0xfe03('0x24')]);if(_0x4d855d[_0xfe03('0x25')]){delete _0x4d855d[_0xfe03('0x25')];}_0x1f2053['status'](_0x4b10ce)[_0xfe03('0x26')](_0x4d855d);};}exports[_0xfe03('0x27')]=function(_0x1a405e,_0x5c4e22){var _0x594098={},_0x4574c6={},_0x28928f={'count':0x0,'rows':[]};var _0x3ce2e6=_[_0xfe03('0x28')](db[_0xfe03('0x29')]['rawAttributes'],function(_0x104923){return{'name':_0x104923[_0xfe03('0x2a')],'type':_0x104923[_0xfe03('0x2b')][_0xfe03('0x2c')]};});_0x4574c6[_0xfe03('0x2d')]=_[_0xfe03('0x28')](_0x3ce2e6,'name');_0x4574c6[_0xfe03('0x2e')]=_[_0xfe03('0x2f')](_0x1a405e[_0xfe03('0x2e')]);_0x4574c6[_0xfe03('0x30')]=_[_0xfe03('0x31')](_0x4574c6[_0xfe03('0x2d')],_0x4574c6['query']);_0x594098[_0xfe03('0x32')]=_[_0xfe03('0x31')](_0x4574c6[_0xfe03('0x2d')],qs[_0xfe03('0x33')](_0x1a405e['query'][_0xfe03('0x33')]));_0x594098[_0xfe03('0x32')]=_0x594098[_0xfe03('0x32')][_0xfe03('0x34')]?_0x594098['attributes']:_0x4574c6['model'];if(!_0x1a405e['query'][_0xfe03('0x35')](_0xfe03('0x36'))){_0x594098[_0xfe03('0x1c')]=qs[_0xfe03('0x1c')](_0x1a405e[_0xfe03('0x2e')][_0xfe03('0x1c')]);_0x594098[_0xfe03('0x1b')]=qs['offset'](_0x1a405e[_0xfe03('0x2e')][_0xfe03('0x1b')]);}_0x594098[_0xfe03('0x37')]=qs[_0xfe03('0x38')](_0x1a405e[_0xfe03('0x2e')][_0xfe03('0x38')]);_0x594098[_0xfe03('0x39')]=qs['filters'](_[_0xfe03('0x3a')](_0x1a405e[_0xfe03('0x2e')],_0x4574c6[_0xfe03('0x30')]),_0x3ce2e6);if(_0x1a405e['query'][_0xfe03('0x3b')]){_0x594098[_0xfe03('0x39')]=_[_0xfe03('0x3c')](_0x594098[_0xfe03('0x39')],{'$or':_[_0xfe03('0x28')](_0x3ce2e6,function(_0x65fe89){if(_0x65fe89['type']!==_0xfe03('0x3d')){var _0x1e885f={};_0x1e885f[_0x65fe89[_0xfe03('0x25')]]={'$like':'%'+_0x1a405e[_0xfe03('0x2e')][_0xfe03('0x3b')]+'%'};return _0x1e885f;}})});}_0x594098=_['merge']({},_0x594098,_0x1a405e[_0xfe03('0x3e')]);var _0x44ca23={'where':_0x594098[_0xfe03('0x39')]};return db[_0xfe03('0x29')]['count'](_0x44ca23)['then'](function(_0x3e45e4){_0x28928f['count']=_0x3e45e4;if(_0x1a405e[_0xfe03('0x2e')][_0xfe03('0x3f')]){_0x594098[_0xfe03('0x40')]=[{'all':!![]}];}return db[_0xfe03('0x29')][_0xfe03('0x41')](_0x594098);})[_0xfe03('0x22')](function(_0x27a270){_0x28928f[_0xfe03('0x42')]=_0x27a270;return _0x28928f;})['then'](respondWithFilteredResult(_0x5c4e22,_0x594098))['catch'](handleError(_0x5c4e22,null));};exports['show']=function(_0x27bdb4,_0x4fe265){var _0x14c79d={'raw':!![],'where':{'id':_0x27bdb4['params']['id']}},_0x4bf88a={};_0x4bf88a['model']=_[_0xfe03('0x2f')](db[_0xfe03('0x29')][_0xfe03('0x43')]);_0x4bf88a[_0xfe03('0x2e')]=_[_0xfe03('0x2f')](_0x27bdb4[_0xfe03('0x2e')]);_0x4bf88a['filters']=_[_0xfe03('0x31')](_0x4bf88a[_0xfe03('0x2d')],_0x4bf88a[_0xfe03('0x2e')]);_0x14c79d[_0xfe03('0x32')]=_[_0xfe03('0x31')](_0x4bf88a['model'],qs['fields'](_0x27bdb4[_0xfe03('0x2e')][_0xfe03('0x33')]));_0x14c79d[_0xfe03('0x32')]=_0x14c79d[_0xfe03('0x32')]['length']?_0x14c79d[_0xfe03('0x32')]:_0x4bf88a[_0xfe03('0x2d')];if(_0x27bdb4['query'][_0xfe03('0x3f')]){_0x14c79d[_0xfe03('0x40')]=[{'all':!![]}];}_0x14c79d=_[_0xfe03('0x3c')]({},_0x14c79d,_0x27bdb4[_0xfe03('0x3e')]);return db['SquareRecording'][_0xfe03('0x44')](_0x14c79d)[_0xfe03('0x22')](handleEntityNotFound(_0x4fe265,null))[_0xfe03('0x22')](respondWithResult(_0x4fe265,null))['catch'](handleError(_0x4fe265,null));};exports[_0xfe03('0x45')]=function(_0x197cea,_0x133741){return db[_0xfe03('0x29')][_0xfe03('0x45')](_0x197cea[_0xfe03('0x46')],{})[_0xfe03('0x22')](respondWithResult(_0x133741,0xc9))[_0xfe03('0x47')](handleError(_0x133741,null));};exports[_0xfe03('0x21')]=function(_0x548212,_0x2d73a4){if(_0x548212[_0xfe03('0x46')]['id']){delete _0x548212[_0xfe03('0x46')]['id'];}return db['SquareRecording'][_0xfe03('0x44')]({'where':{'id':_0x548212[_0xfe03('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d73a4,null))['then'](saveUpdates(_0x548212['body'],null))[_0xfe03('0x22')](respondWithResult(_0x2d73a4,null))['catch'](handleError(_0x2d73a4,null));};exports['download']=function(_0xb94f3b,_0x72df43,_0x2c0d5b){var _0x32b2ce=require(_0xfe03('0x49'));var _0x476d43=![];var _0x485788={};if(_0xb94f3b[_0xfe03('0x2e')][_0xfe03('0x2b')]&&_0xb94f3b[_0xfe03('0x2e')][_0xfe03('0x2b')]===_0xfe03('0x4a')){_0x485788[_0xfe03('0x4a')]=_0xb94f3b[_0xfe03('0x48')]['id'];}else{_0x485788['id']=_0xb94f3b[_0xfe03('0x48')]['id'];}return db[_0xfe03('0x29')][_0xfe03('0x44')]({'where':_0x485788,'attributes':['id','savePath','filename'],'raw':!![]})['then'](handleEntityNotFound(_0x72df43,null))['then'](function(_0x55888){if(_0x55888){var _0x5b3751=_0x55888['savePath'];var _0x4fc85d=util[_0xfe03('0x4b')](_0xfe03('0x4c'),_0x5b3751);if(fs['existsSync'](_0x4fc85d)){_0x476d43=!![];return _0x32b2ce[_0xfe03('0x4d')](_0x4fc85d,_0x5b3751,config[_0xfe03('0x4e')]['recording'])['then'](function(){return _0x55888;});}return _0x55888;}})[_0xfe03('0x22')](function(_0xbafb5f){if(_0xbafb5f){var _0x3e0c2c=_0xbafb5f['savePath'];if(!fs[_0xfe03('0x4f')](_0x3e0c2c)){throw new db[(_0xfe03('0x50'))][(_0xfe03('0x51'))](_0xfe03('0x52'));}if(_0xbafb5f[_0xfe03('0x53')]){return _0x72df43[_0xfe03('0x54')](_0x3e0c2c,_0xbafb5f[_0xfe03('0x53')]+path[_0xfe03('0x55')](_0x3e0c2c),function(){if(_0x476d43){fs[_0xfe03('0x56')](_0x3e0c2c);}});}else{return _0x72df43[_0xfe03('0x54')](_0x3e0c2c,function(_0x336a7b){if(_0x476d43){fs['unlink'](_0x3e0c2c);}});}}})[_0xfe03('0x47')](function(_0x53abfc){if(_0x53abfc['message']===_0xfe03('0x52')){_0x72df43['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x72df43,null);}});};exports[_0xfe03('0x57')]=function(_0x41f69c,_0x344928){return db[_0xfe03('0x29')]['find']({'where':{'id':_0x41f69c[_0xfe03('0x48')]['id']}})[_0xfe03('0x22')](function(_0xfcb218){if(_[_0xfe03('0x58')](_0xfcb218)){throw new ReferenceError('Entity\x20not\x20found');}return _0xfcb218;})['then'](function(_0x38eab6){var _0x5d2492=_0x38eab6[_0xfe03('0x59')];logger[_0xfe03('0x5a')](_0xfe03('0x5b'),_0x5d2492);if(!_[_0xfe03('0x58')](_0x38eab6[_0xfe03('0x59')])&&fs[_0xfe03('0x4f')](_0x5d2492)){logger[_0xfe03('0x5a')](_0xfe03('0x5c')+_0x5d2492+_0xfe03('0x5d'));fs[_0xfe03('0x5e')](_0x5d2492);}_0x5d2492=_0x5d2492+_0xfe03('0x5f');if(!_['isNil'](_0x38eab6[_0xfe03('0x59')])&&fs[_0xfe03('0x4f')](_0x5d2492)){logger[_0xfe03('0x5a')]('File:\x20\x22'+_0x5d2492+_0xfe03('0x5d'));fs[_0xfe03('0x5e')](_0x5d2492);}return _0x38eab6;})[_0xfe03('0x22')](function(_0x2b0258){if(!_0x2b0258)throw new InternalError();return _0x2b0258[_0xfe03('0x57')]();})['then'](function(){_0x344928[_0xfe03('0x16')](0xcc)[_0xfe03('0x17')]();})[_0xfe03('0x47')](handleError(_0x344928,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 160bcd2..bb703d6 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 _0x419f=['api','moment','bluebird','path','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x419f,0x176));var _0xf419=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x419f[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xf419('0x0'));var util=require(_0xf419('0x1'));var logger=require(_0xf419('0x2'))(_0xf419('0x3'));var moment=require(_0xf419('0x4'));var BPromise=require(_0xf419('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf419('0x6'));var rimraf=require('rimraf');var config=require(_0xf419('0x7'));var attributes=require(_0xf419('0x8'));module[_0xf419('0x9')]=function(_0x38f2fa,_0x2d8430){return _0x38f2fa[_0xf419('0xa')](_0xf419('0xb'),attributes,{'tableName':_0xf419('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ff9=['api','moment','path','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','util'];(function(_0xa66481,_0x263db1){var _0x2134bb=function(_0x894441){while(--_0x894441){_0xa66481['push'](_0xa66481['shift']());}};_0x2134bb(++_0x263db1);}(_0x5ff9,0xa0));var _0x95ff=function(_0x324788,_0x3c6ce5){_0x324788=_0x324788-0x0;var _0x2b10d7=_0x5ff9[_0x324788];return _0x2b10d7;};'use strict';var _=require(_0x95ff('0x0'));var util=require(_0x95ff('0x1'));var logger=require('../../config/logger')(_0x95ff('0x2'));var moment=require(_0x95ff('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x95ff('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x95ff('0x5'));module[_0x95ff('0x6')]=function(_0x4d37f2,_0x1d9d79){return _0x4d37f2['define'](_0x95ff('0x7'),attributes,{'tableName':_0x95ff('0x8'),'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 143e9e1..0db12e1 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 _0x7773=['ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','options','CreateSquareRecording','lodash','util','moment','bluebird'];(function(_0x3225cb,_0x178465){var _0xdb318=function(_0x3ae7b1){while(--_0x3ae7b1){_0x3225cb['push'](_0x3225cb['shift']());}};_0xdb318(++_0x178465);}(_0x7773,0x74));var _0x3777=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7773[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x3777('0x0'));var util=require(_0x3777('0x1'));var moment=require(_0x3777('0x2'));var BPromise=require(_0x3777('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3777('0x4'));var db=require(_0x3777('0x5'))['db'];var utils=require(_0x3777('0x6'));var logger=require('../../config/logger')(_0x3777('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3777('0x8')][_0x3777('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1612de,_0x5e2fa4,_0x2dac02){return new BPromise(function(_0x5c19df,_0x3b6fc7){return client[_0x3777('0xa')](_0x1612de,_0x2dac02)[_0x3777('0xb')](function(_0x28e2ad){logger['info'](_0x3777('0xc'),_0x5e2fa4,_0x3777('0xd'));logger[_0x3777('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x5e2fa4,_0x3777('0xd'),JSON[_0x3777('0xf')](_0x28e2ad));if(_0x28e2ad[_0x3777('0x10')]){if(_0x28e2ad[_0x3777('0x10')][_0x3777('0x11')]===0x1f4){logger['error'](_0x3777('0xc'),_0x5e2fa4,_0x28e2ad[_0x3777('0x10')][_0x3777('0x12')]);return _0x3b6fc7(_0x28e2ad[_0x3777('0x10')]['message']);}logger['error'](_0x3777('0xc'),_0x5e2fa4,_0x28e2ad[_0x3777('0x10')][_0x3777('0x12')]);return _0x5c19df(_0x28e2ad[_0x3777('0x10')][_0x3777('0x12')]);}else{logger[_0x3777('0x13')](_0x3777('0xc'),_0x5e2fa4,_0x3777('0xd'));_0x5c19df(_0x28e2ad[_0x3777('0x14')][_0x3777('0x12')]);}})[_0x3777('0x15')](function(_0x2ebfcc){logger[_0x3777('0x10')](_0x3777('0xc'),_0x5e2fa4,_0x2ebfcc);_0x3b6fc7(_0x2ebfcc);});});}exports['CreateSquareRecording']=function(_0x3c8166){var _0xf1f328=this;return new Promise(function(_0x37c3d4,_0x5898e1){return db['SquareRecording']['create'](_0x3c8166['body'],{'raw':_0x3c8166[_0x3777('0x16')]?_0x3c8166[_0x3777('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1227ed){logger[_0x3777('0x13')]('CreateSquareRecording',_0x3c8166);logger[_0x3777('0xe')](_0x3777('0x17'),_0x3c8166,JSON[_0x3777('0xf')](_0x1227ed));_0x37c3d4(_0x1227ed);})[_0x3777('0x15')](function(_0x32e4f3){logger[_0x3777('0x10')](_0x3777('0x17'),_0x32e4f3['message'],_0x3c8166);_0x5898e1(_0xf1f328[_0x3777('0x10')](0x1f4,_0x32e4f3['message']));});});}; \ No newline at end of file +var _0x0466=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','result','CreateSquareRecording','SquareRecording','body','options','raw','catch','lodash','util','moment','bluebird'];(function(_0x435253,_0x2e45b4){var _0x4e6431=function(_0x5ad8fa){while(--_0x5ad8fa){_0x435253['push'](_0x435253['shift']());}};_0x4e6431(++_0x2e45b4);}(_0x0466,0x1af));var _0x6046=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0466[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x6046('0x0'));var util=require(_0x6046('0x1'));var moment=require(_0x6046('0x2'));var BPromise=require(_0x6046('0x3'));var rs=require(_0x6046('0x4'));var fs=require('fs');var Redis=require(_0x6046('0x5'));var db=require(_0x6046('0x6'))['db'];var utils=require(_0x6046('0x7'));var logger=require(_0x6046('0x8'))(_0x6046('0x9'));var config=require('../../config/environment');var jayson=require(_0x6046('0xa'));var client=jayson[_0x6046('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x103a0e,_0x345d77,_0x5c21b5){return new BPromise(function(_0x51897a,_0x580efc){return client['request'](_0x103a0e,_0x5c21b5)[_0x6046('0xc')](function(_0x1d477c){logger[_0x6046('0xd')]('SquareRecording,\x20%s,\x20%s',_0x345d77,_0x6046('0xe'));logger[_0x6046('0xf')](_0x6046('0x10'),_0x345d77,_0x6046('0xe'),JSON[_0x6046('0x11')](_0x1d477c));if(_0x1d477c[_0x6046('0x12')]){if(_0x1d477c[_0x6046('0x12')][_0x6046('0x13')]===0x1f4){logger['error'](_0x6046('0x14'),_0x345d77,_0x1d477c['error'][_0x6046('0x15')]);return _0x580efc(_0x1d477c[_0x6046('0x12')][_0x6046('0x15')]);}logger['error'](_0x6046('0x14'),_0x345d77,_0x1d477c[_0x6046('0x12')][_0x6046('0x15')]);return _0x51897a(_0x1d477c['error'][_0x6046('0x15')]);}else{logger[_0x6046('0xd')](_0x6046('0x14'),_0x345d77,_0x6046('0xe'));_0x51897a(_0x1d477c[_0x6046('0x16')][_0x6046('0x15')]);}})['catch'](function(_0x4b24e9){logger[_0x6046('0x12')](_0x6046('0x14'),_0x345d77,_0x4b24e9);_0x580efc(_0x4b24e9);});});}exports[_0x6046('0x17')]=function(_0x2398f9){var _0x36c1aa=this;return new Promise(function(_0x4d7ab4,_0x449515){return db[_0x6046('0x18')]['create'](_0x2398f9[_0x6046('0x19')],{'raw':_0x2398f9[_0x6046('0x1a')]?_0x2398f9[_0x6046('0x1a')][_0x6046('0x1b')]===undefined?!![]:![]:!![]})[_0x6046('0xc')](function(_0x4fec65){logger[_0x6046('0xd')](_0x6046('0x17'),_0x2398f9);logger[_0x6046('0xf')](_0x6046('0x17'),_0x2398f9,JSON[_0x6046('0x11')](_0x4fec65));_0x4d7ab4(_0x4fec65);})[_0x6046('0x1c')](function(_0x4c21eb){logger['error'](_0x6046('0x17'),_0x4c21eb['message'],_0x2398f9);_0x449515(_0x36c1aa[_0x6046('0x12')](0x1f4,_0x4c21eb[_0x6046('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 1a6e1ed..bc5761e 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(_0x426ab0,_0x13c67d){var _0x3bdb3d=function(_0x14f669){while(--_0x14f669){_0x426ab0['push'](_0x426ab0['shift']());}};_0x3bdb3d(++_0x13c67d);}(_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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x25c473,_0xefdb61){var _0x1854f7=function(_0x180416){while(--_0x180416){_0x25c473['push'](_0x25c473['shift']());}};_0x1854f7(++_0xefdb61);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index aff9c19..ffe80df 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 _0xcaab=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0xac6c59,_0x2f440b){var _0x197629=function(_0x66a5e5){while(--_0x66a5e5){_0xac6c59['push'](_0xac6c59['shift']());}};_0x197629(++_0x2f440b);}(_0xcaab,0x115));var _0xbcaa=function(_0x504ee1,_0x16f27f){_0x504ee1=_0x504ee1-0x0;var _0x5e230f=_0xcaab[_0x504ee1];return _0x5e230f;};'use strict';var Sequelize=require(_0xbcaa('0x0'));module[_0xbcaa('0x1')]={'network':{'type':Sequelize[_0xbcaa('0x2')]},'network_script':{'type':Sequelize[_0xbcaa('0x2')]},'request':{'type':Sequelize[_0xbcaa('0x2')]},'channel':{'type':Sequelize[_0xbcaa('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbcaa('0x2')]},'uniqueid':{'type':Sequelize[_0xbcaa('0x2')]},'version':{'type':Sequelize[_0xbcaa('0x2')]},'callerid':{'type':Sequelize[_0xbcaa('0x2')]},'calleridname':{'type':Sequelize[_0xbcaa('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xbcaa('0x2')]},'callington':{'type':Sequelize[_0xbcaa('0x2')]},'callingtns':{'type':Sequelize[_0xbcaa('0x2')]},'dnid':{'type':Sequelize[_0xbcaa('0x2')]},'rdnis':{'type':Sequelize[_0xbcaa('0x2')]},'context':{'type':Sequelize[_0xbcaa('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbcaa('0x2')]},'enhanced':{'type':Sequelize[_0xbcaa('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xbcaa('0x2')]},'project_name':{'type':Sequelize[_0xbcaa('0x2')]},'joinAt':{'type':Sequelize[_0xbcaa('0x3')]},'leaveAt':{'type':Sequelize[_0xbcaa('0x3')]},'bot':{'type':Sequelize[_0xbcaa('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x6ede=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x50e2b2,_0x151d7d){var _0x3410cd=function(_0x153d05){while(--_0x153d05){_0x50e2b2['push'](_0x50e2b2['shift']());}};_0x3410cd(++_0x151d7d);}(_0x6ede,0xac));var _0xe6ed=function(_0x12c34e,_0x39287a){_0x12c34e=_0x12c34e-0x0;var _0x244e88=_0x6ede[_0x12c34e];return _0x244e88;};'use strict';var Sequelize=require(_0xe6ed('0x0'));module[_0xe6ed('0x1')]={'network':{'type':Sequelize[_0xe6ed('0x2')]},'network_script':{'type':Sequelize[_0xe6ed('0x2')]},'request':{'type':Sequelize[_0xe6ed('0x2')]},'channel':{'type':Sequelize[_0xe6ed('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe6ed('0x2')]},'uniqueid':{'type':Sequelize[_0xe6ed('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe6ed('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xe6ed('0x2')]},'dnid':{'type':Sequelize[_0xe6ed('0x2')]},'rdnis':{'type':Sequelize[_0xe6ed('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe6ed('0x2')]},'enhanced':{'type':Sequelize[_0xe6ed('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xe6ed('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe6ed('0x3')]},'leaveAt':{'type':Sequelize[_0xe6ed('0x3')]},'bot':{'type':Sequelize[_0xe6ed('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 c2217ca..67f6043 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 _0x41ba=['merge','VIRTUAL','options','includeAll','rows','catch','show','include','create','body','params','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','SquareReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0xae9e83,_0x1b6a05){var _0x3ea8ff=function(_0x31016a){while(--_0x31016a){_0xae9e83['push'](_0xae9e83['shift']());}};_0x3ea8ff(++_0x1b6a05);}(_0x41ba,0x1db));var _0xa41b=function(_0x451508,_0x1c1d59){_0x451508=_0x451508-0x0;var _0x35db65=_0x41ba[_0x451508];return _0x35db65;};'use strict';var emlformat=require(_0xa41b('0x0'));var rimraf=require(_0xa41b('0x1'));var zipdir=require(_0xa41b('0x2'));var jsonpatch=require(_0xa41b('0x3'));var rp=require('request-promise');var moment=require(_0xa41b('0x4'));var BPromise=require(_0xa41b('0x5'));var Mustache=require('mustache');var util=require(_0xa41b('0x6'));var path=require('path');var sox=require(_0xa41b('0x7'));var csv=require('to-csv');var ejs=require(_0xa41b('0x8'));var fs=require('fs');var fs_extra=require(_0xa41b('0x9'));var _=require(_0xa41b('0xa'));var squel=require(_0xa41b('0xb'));var crypto=require('crypto');var jsforce=require(_0xa41b('0xc'));var deskjs=require(_0xa41b('0xd'));var toCsv=require(_0xa41b('0xe'));var querystring=require(_0xa41b('0xf'));var Papa=require(_0xa41b('0x10'));var Redis=require(_0xa41b('0x11'));var authService=require(_0xa41b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa41b('0x13'));var hardwareService=require(_0xa41b('0x14'));var logger=require('../../config/logger')(_0xa41b('0x15'));var utils=require(_0xa41b('0x16'));var config=require(_0xa41b('0x17'));var licenseUtil=require(_0xa41b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf0c91c,_0x40b14b){_0x40b14b=_0x40b14b||0xcc;return function(_0x105c8d){if(_0x105c8d){return _0xf0c91c[_0xa41b('0x19')](_0x40b14b);}return _0xf0c91c[_0xa41b('0x1a')](_0x40b14b)[_0xa41b('0x1b')]();};}function respondWithResult(_0x3373b4,_0x2f18c9){_0x2f18c9=_0x2f18c9||0xc8;return function(_0x455166){if(_0x455166){return _0x3373b4[_0xa41b('0x1a')](_0x2f18c9)[_0xa41b('0x1c')](_0x455166);}};}function respondWithFilteredResult(_0x38689c,_0x56c075){return function(_0x5ef13c){if(_0x5ef13c){var _0x57402f=typeof _0x56c075['offset']==='undefined'&&typeof _0x56c075[_0xa41b('0x1d')]===_0xa41b('0x1e');var _0x401607=_0x5ef13c[_0xa41b('0x1f')];var _0x2a9826=_0x57402f?0x0:_0x56c075[_0xa41b('0x20')];var _0x4fd8eb=_0x57402f?_0x5ef13c[_0xa41b('0x1f')]:_0x56c075[_0xa41b('0x20')]+_0x56c075[_0xa41b('0x1d')];var _0xce004f;if(_0x4fd8eb>=_0x401607){_0x4fd8eb=_0x401607;_0xce004f=0xc8;}else{_0xce004f=0xce;}_0x38689c[_0xa41b('0x1a')](_0xce004f);return _0x38689c[_0xa41b('0x21')](_0xa41b('0x22'),_0x2a9826+'-'+_0x4fd8eb+'/'+_0x401607)[_0xa41b('0x1c')](_0x5ef13c);}return null;};}function patchUpdates(_0x169266){return function(_0x602a4e){try{jsonpatch[_0xa41b('0x23')](_0x602a4e,_0x169266,!![]);}catch(_0x1decc8){return BPromise[_0xa41b('0x24')](_0x1decc8);}return _0x602a4e[_0xa41b('0x25')]();};}function saveUpdates(_0x5be0b1,_0x178723){return function(_0x3b3019){if(_0x3b3019){return _0x3b3019[_0xa41b('0x26')](_0x5be0b1)[_0xa41b('0x27')](function(_0x44f287){return _0x44f287;});}return null;};}function removeEntity(_0x1d955d,_0x9036d2){return function(_0x2c8bc0){if(_0x2c8bc0){return _0x2c8bc0[_0xa41b('0x28')]()[_0xa41b('0x27')](function(){_0x1d955d['status'](0xcc)[_0xa41b('0x1b')]();});}};}function handleEntityNotFound(_0x2b7590,_0x4dbd27){return function(_0x2d8aae){if(!_0x2d8aae){_0x2b7590[_0xa41b('0x19')](0x194);}return _0x2d8aae;};}function handleError(_0x3cf211,_0x22c9a7){_0x22c9a7=_0x22c9a7||0x1f4;return function(_0x2d76d3){logger[_0xa41b('0x29')](_0x2d76d3[_0xa41b('0x2a')]);if(_0x2d76d3[_0xa41b('0x2b')]){delete _0x2d76d3['name'];}_0x3cf211[_0xa41b('0x1a')](_0x22c9a7)['send'](_0x2d76d3);};}exports[_0xa41b('0x2c')]=function(_0x5d2d59,_0x39a551){var _0x3cdeec={},_0xb55c67={},_0x55557a={'count':0x0,'rows':[]};var _0x4e874b=_['map'](db[_0xa41b('0x2d')][_0xa41b('0x2e')],function(_0x1cb97d){return{'name':_0x1cb97d[_0xa41b('0x2f')],'type':_0x1cb97d[_0xa41b('0x30')]['key']};});_0xb55c67[_0xa41b('0x31')]=_[_0xa41b('0x32')](_0x4e874b,_0xa41b('0x2b'));_0xb55c67[_0xa41b('0x33')]=_[_0xa41b('0x34')](_0x5d2d59[_0xa41b('0x33')]);_0xb55c67[_0xa41b('0x35')]=_[_0xa41b('0x36')](_0xb55c67[_0xa41b('0x31')],_0xb55c67['query']);_0x3cdeec[_0xa41b('0x37')]=_[_0xa41b('0x36')](_0xb55c67[_0xa41b('0x31')],qs['fields'](_0x5d2d59[_0xa41b('0x33')][_0xa41b('0x38')]));_0x3cdeec['attributes']=_0x3cdeec[_0xa41b('0x37')][_0xa41b('0x39')]?_0x3cdeec[_0xa41b('0x37')]:_0xb55c67['model'];if(!_0x5d2d59['query'][_0xa41b('0x3a')](_0xa41b('0x3b'))){_0x3cdeec[_0xa41b('0x1d')]=qs['limit'](_0x5d2d59[_0xa41b('0x33')][_0xa41b('0x1d')]);_0x3cdeec[_0xa41b('0x20')]=qs[_0xa41b('0x20')](_0x5d2d59['query'][_0xa41b('0x20')]);}_0x3cdeec[_0xa41b('0x3c')]=qs['sort'](_0x5d2d59[_0xa41b('0x33')][_0xa41b('0x3d')]);_0x3cdeec[_0xa41b('0x3e')]=qs[_0xa41b('0x35')](_['pick'](_0x5d2d59[_0xa41b('0x33')],_0xb55c67['filters']),_0x4e874b);if(_0x5d2d59[_0xa41b('0x33')][_0xa41b('0x3f')]){_0x3cdeec[_0xa41b('0x3e')]=_[_0xa41b('0x40')](_0x3cdeec[_0xa41b('0x3e')],{'$or':_['map'](_0x4e874b,function(_0x538d85){if(_0x538d85[_0xa41b('0x30')]!==_0xa41b('0x41')){var _0x1a2b35={};_0x1a2b35[_0x538d85['name']]={'$like':'%'+_0x5d2d59[_0xa41b('0x33')]['filter']+'%'};return _0x1a2b35;}})});}_0x3cdeec=_[_0xa41b('0x40')]({},_0x3cdeec,_0x5d2d59[_0xa41b('0x42')]);var _0x520390={'where':_0x3cdeec[_0xa41b('0x3e')]};return db[_0xa41b('0x2d')][_0xa41b('0x1f')](_0x520390)[_0xa41b('0x27')](function(_0xcb720e){_0x55557a[_0xa41b('0x1f')]=_0xcb720e;if(_0x5d2d59['query'][_0xa41b('0x43')]){_0x3cdeec['include']=[{'all':!![]}];}return db[_0xa41b('0x2d')]['findAll'](_0x3cdeec);})['then'](function(_0x439c39){_0x55557a[_0xa41b('0x44')]=_0x439c39;return _0x55557a;})[_0xa41b('0x27')](respondWithFilteredResult(_0x39a551,_0x3cdeec))[_0xa41b('0x45')](handleError(_0x39a551,null));};exports[_0xa41b('0x46')]=function(_0x5be644,_0x58e4ce){var _0x549d52={'raw':!![],'where':{'id':_0x5be644['params']['id']}},_0x4615a9={};_0x4615a9[_0xa41b('0x31')]=_[_0xa41b('0x34')](db[_0xa41b('0x2d')][_0xa41b('0x2e')]);_0x4615a9['query']=_[_0xa41b('0x34')](_0x5be644[_0xa41b('0x33')]);_0x4615a9['filters']=_[_0xa41b('0x36')](_0x4615a9[_0xa41b('0x31')],_0x4615a9[_0xa41b('0x33')]);_0x549d52['attributes']=_[_0xa41b('0x36')](_0x4615a9[_0xa41b('0x31')],qs['fields'](_0x5be644[_0xa41b('0x33')]['fields']));_0x549d52[_0xa41b('0x37')]=_0x549d52[_0xa41b('0x37')][_0xa41b('0x39')]?_0x549d52[_0xa41b('0x37')]:_0x4615a9[_0xa41b('0x31')];if(_0x5be644['query']['includeAll']){_0x549d52[_0xa41b('0x47')]=[{'all':!![]}];}_0x549d52=_[_0xa41b('0x40')]({},_0x549d52,_0x5be644[_0xa41b('0x42')]);return db[_0xa41b('0x2d')]['find'](_0x549d52)[_0xa41b('0x27')](handleEntityNotFound(_0x58e4ce,null))['then'](respondWithResult(_0x58e4ce,null))[_0xa41b('0x45')](handleError(_0x58e4ce,null));};exports['create']=function(_0x24f465,_0x142f3e){return db[_0xa41b('0x2d')][_0xa41b('0x48')](_0x24f465['body'],{})[_0xa41b('0x27')](respondWithResult(_0x142f3e,0xc9))[_0xa41b('0x45')](handleError(_0x142f3e,null));};exports['update']=function(_0x354c44,_0x406f98){if(_0x354c44[_0xa41b('0x49')]['id']){delete _0x354c44[_0xa41b('0x49')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x354c44[_0xa41b('0x4a')]['id']}})[_0xa41b('0x27')](handleEntityNotFound(_0x406f98,null))['then'](saveUpdates(_0x354c44[_0xa41b('0x49')],null))[_0xa41b('0x27')](respondWithResult(_0x406f98,null))[_0xa41b('0x45')](handleError(_0x406f98,null));};exports[_0xa41b('0x28')]=function(_0x201adf,_0x2f23a0){return db[_0xa41b('0x2d')][_0xa41b('0x4b')]({'where':{'id':_0x201adf[_0xa41b('0x4a')]['id']}})[_0xa41b('0x27')](handleEntityNotFound(_0x2f23a0,null))['then'](removeEntity(_0x2f23a0,null))['catch'](handleError(_0x2f23a0,null));};exports['describe']=function(_0x5d20aa,_0x232077){return db['SquareReport'][_0xa41b('0x4c')]()[_0xa41b('0x27')](respondWithResult(_0x232077,null))['catch'](handleError(_0x232077,null));}; \ No newline at end of file +var _0x5c73=['stack','name','send','index','map','SquareReport','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','intersection','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','set','apply','save','update','then','destroy','sendStatus','error'];(function(_0x121b92,_0x2e60eb){var _0x36cf76=function(_0x130da1){while(--_0x130da1){_0x121b92['push'](_0x121b92['shift']());}};_0x36cf76(++_0x2e60eb);}(_0x5c73,0x1d3));var _0x35c7=function(_0x35bb68,_0x336915){_0x35bb68=_0x35bb68-0x0;var _0xe54a6e=_0x5c73[_0x35bb68];return _0xe54a6e;};'use strict';var emlformat=require(_0x35c7('0x0'));var rimraf=require(_0x35c7('0x1'));var zipdir=require(_0x35c7('0x2'));var jsonpatch=require(_0x35c7('0x3'));var rp=require(_0x35c7('0x4'));var moment=require(_0x35c7('0x5'));var BPromise=require(_0x35c7('0x6'));var Mustache=require(_0x35c7('0x7'));var util=require(_0x35c7('0x8'));var path=require(_0x35c7('0x9'));var sox=require(_0x35c7('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x35c7('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x35c7('0xc'));var jsforce=require(_0x35c7('0xd'));var deskjs=require(_0x35c7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x35c7('0xf'));var Redis=require(_0x35c7('0x10'));var authService=require(_0x35c7('0x11'));var qs=require(_0x35c7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x35c7('0x13'))(_0x35c7('0x14'));var utils=require('../../config/utils');var config=require(_0x35c7('0x15'));var licenseUtil=require(_0x35c7('0x16'));var db=require(_0x35c7('0x17'))['db'];function respondWithStatusCode(_0x1fa476,_0x449c18){_0x449c18=_0x449c18||0xcc;return function(_0x1adfcd){if(_0x1adfcd){return _0x1fa476['sendStatus'](_0x449c18);}return _0x1fa476[_0x35c7('0x18')](_0x449c18)[_0x35c7('0x19')]();};}function respondWithResult(_0x54465e,_0x215641){_0x215641=_0x215641||0xc8;return function(_0x521613){if(_0x521613){return _0x54465e[_0x35c7('0x18')](_0x215641)[_0x35c7('0x1a')](_0x521613);}};}function respondWithFilteredResult(_0x4d1f51,_0x1c3866){return function(_0x9749fe){if(_0x9749fe){var _0x20be7b=typeof _0x1c3866[_0x35c7('0x1b')]==='undefined'&&typeof _0x1c3866['limit']===_0x35c7('0x1c');var _0x35282c=_0x9749fe['count'];var _0x1fa340=_0x20be7b?0x0:_0x1c3866[_0x35c7('0x1b')];var _0x3de2bb=_0x20be7b?_0x9749fe['count']:_0x1c3866[_0x35c7('0x1b')]+_0x1c3866['limit'];var _0x2cfaf2;if(_0x3de2bb>=_0x35282c){_0x3de2bb=_0x35282c;_0x2cfaf2=0xc8;}else{_0x2cfaf2=0xce;}_0x4d1f51[_0x35c7('0x18')](_0x2cfaf2);return _0x4d1f51[_0x35c7('0x1d')]('Content-Range',_0x1fa340+'-'+_0x3de2bb+'/'+_0x35282c)[_0x35c7('0x1a')](_0x9749fe);}return null;};}function patchUpdates(_0x1e63d6){return function(_0x4e57ed){try{jsonpatch[_0x35c7('0x1e')](_0x4e57ed,_0x1e63d6,!![]);}catch(_0x1f0a35){return BPromise['reject'](_0x1f0a35);}return _0x4e57ed[_0x35c7('0x1f')]();};}function saveUpdates(_0xf4e5a4,_0x1b7758){return function(_0x420c80){if(_0x420c80){return _0x420c80[_0x35c7('0x20')](_0xf4e5a4)[_0x35c7('0x21')](function(_0x317bb2){return _0x317bb2;});}return null;};}function removeEntity(_0x3f0d12,_0x1ca2f4){return function(_0x49b1ff){if(_0x49b1ff){return _0x49b1ff[_0x35c7('0x22')]()[_0x35c7('0x21')](function(){_0x3f0d12[_0x35c7('0x18')](0xcc)[_0x35c7('0x19')]();});}};}function handleEntityNotFound(_0x43906a,_0x1a69f1){return function(_0x364c98){if(!_0x364c98){_0x43906a[_0x35c7('0x23')](0x194);}return _0x364c98;};}function handleError(_0x1bda9c,_0x1dad30){_0x1dad30=_0x1dad30||0x1f4;return function(_0x2d01e3){logger[_0x35c7('0x24')](_0x2d01e3[_0x35c7('0x25')]);if(_0x2d01e3[_0x35c7('0x26')]){delete _0x2d01e3[_0x35c7('0x26')];}_0x1bda9c[_0x35c7('0x18')](_0x1dad30)[_0x35c7('0x27')](_0x2d01e3);};}exports[_0x35c7('0x28')]=function(_0x5c3c0b,_0x5be9b6){var _0x23c59d={},_0x731377={},_0x9af01a={'count':0x0,'rows':[]};var _0x404915=_[_0x35c7('0x29')](db[_0x35c7('0x2a')]['rawAttributes'],function(_0x2af9b9){return{'name':_0x2af9b9[_0x35c7('0x2b')],'type':_0x2af9b9[_0x35c7('0x2c')][_0x35c7('0x2d')]};});_0x731377[_0x35c7('0x2e')]=_[_0x35c7('0x29')](_0x404915,'name');_0x731377[_0x35c7('0x2f')]=_[_0x35c7('0x30')](_0x5c3c0b[_0x35c7('0x2f')]);_0x731377[_0x35c7('0x31')]=_['intersection'](_0x731377['model'],_0x731377[_0x35c7('0x2f')]);_0x23c59d[_0x35c7('0x32')]=_['intersection'](_0x731377[_0x35c7('0x2e')],qs['fields'](_0x5c3c0b[_0x35c7('0x2f')][_0x35c7('0x33')]));_0x23c59d[_0x35c7('0x32')]=_0x23c59d[_0x35c7('0x32')][_0x35c7('0x34')]?_0x23c59d[_0x35c7('0x32')]:_0x731377[_0x35c7('0x2e')];if(!_0x5c3c0b[_0x35c7('0x2f')][_0x35c7('0x35')]('nolimit')){_0x23c59d['limit']=qs[_0x35c7('0x36')](_0x5c3c0b[_0x35c7('0x2f')]['limit']);_0x23c59d['offset']=qs[_0x35c7('0x1b')](_0x5c3c0b[_0x35c7('0x2f')][_0x35c7('0x1b')]);}_0x23c59d[_0x35c7('0x37')]=qs[_0x35c7('0x38')](_0x5c3c0b['query'][_0x35c7('0x38')]);_0x23c59d[_0x35c7('0x39')]=qs['filters'](_['pick'](_0x5c3c0b[_0x35c7('0x2f')],_0x731377[_0x35c7('0x31')]),_0x404915);if(_0x5c3c0b[_0x35c7('0x2f')][_0x35c7('0x3a')]){_0x23c59d['where']=_[_0x35c7('0x3b')](_0x23c59d['where'],{'$or':_['map'](_0x404915,function(_0x33d315){if(_0x33d315[_0x35c7('0x2c')]!==_0x35c7('0x3c')){var _0x414f96={};_0x414f96[_0x33d315[_0x35c7('0x26')]]={'$like':'%'+_0x5c3c0b[_0x35c7('0x2f')]['filter']+'%'};return _0x414f96;}})});}_0x23c59d=_[_0x35c7('0x3b')]({},_0x23c59d,_0x5c3c0b[_0x35c7('0x3d')]);var _0x893314={'where':_0x23c59d[_0x35c7('0x39')]};return db[_0x35c7('0x2a')][_0x35c7('0x3e')](_0x893314)[_0x35c7('0x21')](function(_0x456bd7){_0x9af01a[_0x35c7('0x3e')]=_0x456bd7;if(_0x5c3c0b[_0x35c7('0x2f')][_0x35c7('0x3f')]){_0x23c59d[_0x35c7('0x40')]=[{'all':!![]}];}return db[_0x35c7('0x2a')][_0x35c7('0x41')](_0x23c59d);})['then'](function(_0x38bc99){_0x9af01a['rows']=_0x38bc99;return _0x9af01a;})[_0x35c7('0x21')](respondWithFilteredResult(_0x5be9b6,_0x23c59d))[_0x35c7('0x42')](handleError(_0x5be9b6,null));};exports[_0x35c7('0x43')]=function(_0x43e914,_0x5101fa){var _0x1504bd={'raw':!![],'where':{'id':_0x43e914['params']['id']}},_0x253c6d={};_0x253c6d[_0x35c7('0x2e')]=_[_0x35c7('0x30')](db[_0x35c7('0x2a')]['rawAttributes']);_0x253c6d[_0x35c7('0x2f')]=_['keys'](_0x43e914[_0x35c7('0x2f')]);_0x253c6d[_0x35c7('0x31')]=_['intersection'](_0x253c6d[_0x35c7('0x2e')],_0x253c6d[_0x35c7('0x2f')]);_0x1504bd[_0x35c7('0x32')]=_[_0x35c7('0x44')](_0x253c6d['model'],qs[_0x35c7('0x33')](_0x43e914[_0x35c7('0x2f')][_0x35c7('0x33')]));_0x1504bd[_0x35c7('0x32')]=_0x1504bd['attributes'][_0x35c7('0x34')]?_0x1504bd[_0x35c7('0x32')]:_0x253c6d[_0x35c7('0x2e')];if(_0x43e914[_0x35c7('0x2f')][_0x35c7('0x3f')]){_0x1504bd[_0x35c7('0x40')]=[{'all':!![]}];}_0x1504bd=_[_0x35c7('0x3b')]({},_0x1504bd,_0x43e914[_0x35c7('0x3d')]);return db[_0x35c7('0x2a')][_0x35c7('0x45')](_0x1504bd)[_0x35c7('0x21')](handleEntityNotFound(_0x5101fa,null))[_0x35c7('0x21')](respondWithResult(_0x5101fa,null))[_0x35c7('0x42')](handleError(_0x5101fa,null));};exports['create']=function(_0x251a67,_0x3c0e8c){return db[_0x35c7('0x2a')]['create'](_0x251a67[_0x35c7('0x46')],{})['then'](respondWithResult(_0x3c0e8c,0xc9))[_0x35c7('0x42')](handleError(_0x3c0e8c,null));};exports[_0x35c7('0x20')]=function(_0x215df0,_0x258931){if(_0x215df0[_0x35c7('0x46')]['id']){delete _0x215df0[_0x35c7('0x46')]['id'];}return db[_0x35c7('0x2a')][_0x35c7('0x45')]({'where':{'id':_0x215df0['params']['id']}})[_0x35c7('0x21')](handleEntityNotFound(_0x258931,null))[_0x35c7('0x21')](saveUpdates(_0x215df0[_0x35c7('0x46')],null))[_0x35c7('0x21')](respondWithResult(_0x258931,null))['catch'](handleError(_0x258931,null));};exports[_0x35c7('0x22')]=function(_0x544af5,_0x3ddec9){return db[_0x35c7('0x2a')][_0x35c7('0x45')]({'where':{'id':_0x544af5['params']['id']}})[_0x35c7('0x21')](handleEntityNotFound(_0x3ddec9,null))[_0x35c7('0x21')](removeEntity(_0x3ddec9,null))['catch'](handleError(_0x3ddec9,null));};exports['describe']=function(_0x25322f,_0x2e52f2){return db[_0x35c7('0x2a')][_0x35c7('0x47')]()[_0x35c7('0x21')](respondWithResult(_0x2e52f2,null))[_0x35c7('0x42')](handleError(_0x2e52f2,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index bda7361..da7b3a7 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 _0x07ad=['moment','bluebird','request-promise','rimraf','exports','define','SquareReport','uid_pname','project_name','leaveAt','lodash','util','api'];(function(_0x174f70,_0x43d859){var _0xea3963=function(_0x958360){while(--_0x958360){_0x174f70['push'](_0x174f70['shift']());}};_0xea3963(++_0x43d859);}(_0x07ad,0x1eb));var _0xd07a=function(_0x53a970,_0x1acd0e){_0x53a970=_0x53a970-0x0;var _0x3214f9=_0x07ad[_0x53a970];return _0x3214f9;};'use strict';var _=require(_0xd07a('0x0'));var util=require(_0xd07a('0x1'));var logger=require('../../config/logger')(_0xd07a('0x2'));var moment=require(_0xd07a('0x3'));var BPromise=require(_0xd07a('0x4'));var rp=require(_0xd07a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd07a('0x6'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0xd07a('0x7')]=function(_0x21b7e5,_0xbfe430){return _0x21b7e5[_0xd07a('0x8')](_0xd07a('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xd07a('0xa'),'fields':['uniqueid',_0xd07a('0xb')]},{'name':'leaveAt','fields':[_0xd07a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb49c=['lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','uid_pname','uniqueid','project_name','leaveAt'];(function(_0x54165a,_0x5eae66){var _0x2b91db=function(_0x414200){while(--_0x414200){_0x54165a['push'](_0x54165a['shift']());}};_0x2b91db(++_0x5eae66);}(_0xb49c,0x1dc));var _0xcb49=function(_0x1164c6,_0x976699){_0x1164c6=_0x1164c6-0x0;var _0xc6f12b=_0xb49c[_0x1164c6];return _0xc6f12b;};'use strict';var _=require(_0xcb49('0x0'));var util=require('util');var logger=require(_0xcb49('0x1'))('api');var moment=require(_0xcb49('0x2'));var BPromise=require(_0xcb49('0x3'));var rp=require(_0xcb49('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb49('0x5'));var config=require(_0xcb49('0x6'));var attributes=require(_0xcb49('0x7'));module[_0xcb49('0x8')]=function(_0x3c87f2,_0x242452){return _0x3c87f2['define'](_0xcb49('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xcb49('0xa'),'fields':[_0xcb49('0xb'),_0xcb49('0xc')]},{'name':'leaveAt','fields':[_0xcb49('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 35ae78e..07590d7 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 _0x423d=['code','message','result','catch','CreateSquareReport','SquareReport','UpdateSquareReport','update','body','options','raw','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x423d,0xf5));var _0xd423=function(_0x13fea8,_0x117fe6){_0x13fea8=_0x13fea8-0x0;var _0x3fd0e2=_0x423d[_0x13fea8];return _0x3fd0e2;};'use strict';var _=require(_0xd423('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd423('0x1'));var rs=require(_0xd423('0x2'));var fs=require('fs');var Redis=require(_0xd423('0x3'));var db=require(_0xd423('0x4'))['db'];var utils=require(_0xd423('0x5'));var logger=require('../../config/logger')(_0xd423('0x6'));var config=require(_0xd423('0x7'));var jayson=require(_0xd423('0x8'));var client=jayson[_0xd423('0x9')][_0xd423('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34a371,_0x4260fd,_0x91df28){return new BPromise(function(_0x2bd453,_0x17c029){return client[_0xd423('0xb')](_0x34a371,_0x91df28)[_0xd423('0xc')](function(_0x12195f){logger[_0xd423('0xd')](_0xd423('0xe'),_0x4260fd,_0xd423('0xf'));logger[_0xd423('0x10')](_0xd423('0x11'),_0x4260fd,_0xd423('0xf'),JSON['stringify'](_0x12195f));if(_0x12195f[_0xd423('0x12')]){if(_0x12195f[_0xd423('0x12')][_0xd423('0x13')]===0x1f4){logger['error'](_0xd423('0xe'),_0x4260fd,_0x12195f[_0xd423('0x12')][_0xd423('0x14')]);return _0x17c029(_0x12195f[_0xd423('0x12')]['message']);}logger[_0xd423('0x12')](_0xd423('0xe'),_0x4260fd,_0x12195f[_0xd423('0x12')][_0xd423('0x14')]);return _0x2bd453(_0x12195f[_0xd423('0x12')][_0xd423('0x14')]);}else{logger['info'](_0xd423('0xe'),_0x4260fd,_0xd423('0xf'));_0x2bd453(_0x12195f[_0xd423('0x15')][_0xd423('0x14')]);}})[_0xd423('0x16')](function(_0x1256cc){logger[_0xd423('0x12')](_0xd423('0xe'),_0x4260fd,_0x1256cc);_0x17c029(_0x1256cc);});});}exports[_0xd423('0x17')]=function(_0x2754cf){var _0x571be8=this;return new Promise(function(_0x171dfc,_0x23eddf){return db[_0xd423('0x18')]['create'](_0x2754cf['body'],{'raw':_0x2754cf['options']?_0x2754cf['options']['raw']===undefined?!![]:![]:!![]})[_0xd423('0xc')](function(_0x528c9f){logger[_0xd423('0xd')](_0xd423('0x17'),_0x2754cf);logger[_0xd423('0x10')](_0xd423('0x17'),_0x2754cf,JSON['stringify'](_0x528c9f));_0x171dfc(_0x528c9f);})['catch'](function(_0x2ec991){logger[_0xd423('0x12')](_0xd423('0x17'),_0x2ec991[_0xd423('0x14')],_0x2754cf);_0x23eddf(_0x571be8[_0xd423('0x12')](0x1f4,_0x2ec991[_0xd423('0x14')]));});});};exports[_0xd423('0x19')]=function(_0x2cc804){var _0x1483cc=this;return new Promise(function(_0x583e02,_0x1dc5a6){return db[_0xd423('0x18')][_0xd423('0x1a')](_0x2cc804[_0xd423('0x1b')],{'raw':_0x2cc804[_0xd423('0x1c')]?_0x2cc804[_0xd423('0x1c')][_0xd423('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cc804['options']?_0x2cc804[_0xd423('0x1c')][_0xd423('0x1e')]||null:null,'attributes':_0x2cc804['options']?_0x2cc804[_0xd423('0x1c')][_0xd423('0x1f')]||null:null,'limit':_0x2cc804[_0xd423('0x1c')]?_0x2cc804[_0xd423('0x1c')][_0xd423('0x20')]||null:null})['then'](function(_0x510bf9){logger[_0xd423('0xd')]('UpdateSquareReport',_0x2cc804);logger[_0xd423('0x10')](_0xd423('0x19'),_0x2cc804,JSON['stringify'](_0x510bf9));_0x583e02(_0x510bf9);})[_0xd423('0x16')](function(_0x17870e){logger[_0xd423('0x12')]('UpdateSquareReport',_0x17870e[_0xd423('0x14')],_0x2cc804);_0x1dc5a6(_0x1483cc[_0xd423('0x12')](0x1f4,_0x17870e[_0xd423('0x14')]));});});}; \ No newline at end of file +var _0x6c85=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSquareReport','create','options','raw','stringify','catch','UpdateSquareReport','SquareReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','ioredis'];(function(_0x4bd8a3,_0x452c5c){var _0x4eaf3c=function(_0x206ff7){while(--_0x206ff7){_0x4bd8a3['push'](_0x4bd8a3['shift']());}};_0x4eaf3c(++_0x452c5c);}(_0x6c85,0x1b5));var _0x56c8=function(_0x2d920f,_0x3283fc){_0x2d920f=_0x2d920f-0x0;var _0x3494ff=_0x6c85[_0x2d920f];return _0x3494ff;};'use strict';var _=require(_0x56c8('0x0'));var util=require(_0x56c8('0x1'));var moment=require(_0x56c8('0x2'));var BPromise=require(_0x56c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56c8('0x4'));var db=require(_0x56c8('0x5'))['db'];var utils=require(_0x56c8('0x6'));var logger=require('../../config/logger')(_0x56c8('0x7'));var config=require(_0x56c8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x56c8('0x9')][_0x56c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2db9f3,_0x1c4293,_0x367c08){return new BPromise(function(_0x86a4e9,_0x3f4154){return client['request'](_0x2db9f3,_0x367c08)[_0x56c8('0xb')](function(_0xbbe611){logger[_0x56c8('0xc')](_0x56c8('0xd'),_0x1c4293,_0x56c8('0xe'));logger[_0x56c8('0xf')](_0x56c8('0x10'),_0x1c4293,'request\x20sent',JSON['stringify'](_0xbbe611));if(_0xbbe611[_0x56c8('0x11')]){if(_0xbbe611[_0x56c8('0x11')][_0x56c8('0x12')]===0x1f4){logger[_0x56c8('0x11')](_0x56c8('0xd'),_0x1c4293,_0xbbe611[_0x56c8('0x11')][_0x56c8('0x13')]);return _0x3f4154(_0xbbe611[_0x56c8('0x11')]['message']);}logger['error'](_0x56c8('0xd'),_0x1c4293,_0xbbe611[_0x56c8('0x11')]['message']);return _0x86a4e9(_0xbbe611[_0x56c8('0x11')][_0x56c8('0x13')]);}else{logger[_0x56c8('0xc')](_0x56c8('0xd'),_0x1c4293,_0x56c8('0xe'));_0x86a4e9(_0xbbe611[_0x56c8('0x14')][_0x56c8('0x13')]);}})['catch'](function(_0x84c614){logger[_0x56c8('0x11')](_0x56c8('0xd'),_0x1c4293,_0x84c614);_0x3f4154(_0x84c614);});});}exports[_0x56c8('0x15')]=function(_0x5b8a43){var _0x43dd4b=this;return new Promise(function(_0x590de0,_0x1fd3af){return db['SquareReport'][_0x56c8('0x16')](_0x5b8a43['body'],{'raw':_0x5b8a43[_0x56c8('0x17')]?_0x5b8a43[_0x56c8('0x17')][_0x56c8('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x2fb9ec){logger['info'](_0x56c8('0x15'),_0x5b8a43);logger[_0x56c8('0xf')](_0x56c8('0x15'),_0x5b8a43,JSON[_0x56c8('0x19')](_0x2fb9ec));_0x590de0(_0x2fb9ec);})[_0x56c8('0x1a')](function(_0x4abc73){logger[_0x56c8('0x11')]('CreateSquareReport',_0x4abc73['message'],_0x5b8a43);_0x1fd3af(_0x43dd4b['error'](0x1f4,_0x4abc73[_0x56c8('0x13')]));});});};exports[_0x56c8('0x1b')]=function(_0x329665){var _0x43d8a7=this;return new Promise(function(_0x7b00bc,_0x1dbf80){return db[_0x56c8('0x1c')][_0x56c8('0x1d')](_0x329665[_0x56c8('0x1e')],{'raw':_0x329665[_0x56c8('0x17')]?_0x329665['options'][_0x56c8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x329665[_0x56c8('0x17')]?_0x329665[_0x56c8('0x17')][_0x56c8('0x1f')]||null:null,'attributes':_0x329665[_0x56c8('0x17')]?_0x329665[_0x56c8('0x17')][_0x56c8('0x20')]||null:null,'limit':_0x329665[_0x56c8('0x17')]?_0x329665[_0x56c8('0x17')][_0x56c8('0x21')]||null:null})['then'](function(_0xe61c52){logger['info'](_0x56c8('0x1b'),_0x329665);logger[_0x56c8('0xf')]('UpdateSquareReport',_0x329665,JSON[_0x56c8('0x19')](_0xe61c52));_0x7b00bc(_0xe61c52);})['catch'](function(_0x70df01){logger[_0x56c8('0x11')](_0x56c8('0x1b'),_0x70df01[_0x56c8('0x13')],_0x329665);_0x1dbf80(_0x43d8a7[_0x56c8('0x11')](0x1f4,_0x70df01['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 4885295..8adc521 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 _0x5730=['express','fs-extra','../../components/interaction/service','./squareReportDetail.controller','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x39a226,_0x3c1ef3){var _0x4c7fef=function(_0x24469c){while(--_0x24469c){_0x39a226['push'](_0x39a226['shift']());}};_0x4c7fef(++_0x3c1ef3);}(_0x5730,0x1bd));var _0x0573=function(_0x476216,_0x113819){_0x476216=_0x476216-0x0;var _0x5785d4=_0x5730[_0x476216];return _0x5785d4;};'use strict';var multer=require(_0x0573('0x0'));var util=require(_0x0573('0x1'));var path=require(_0x0573('0x2'));var timeout=require('connect-timeout');var express=require(_0x0573('0x3'));var router=express['Router']();var fs_extra=require(_0x0573('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0573('0x5'));var config=require('../../config/environment');var controller=require(_0x0573('0x6'));router['get']('/',auth[_0x0573('0x7')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x0573('0x8'),auth[_0x0573('0x7')](),controller[_0x0573('0x9')]);router['post']('/',auth[_0x0573('0x7')](),controller[_0x0573('0xa')]);router[_0x0573('0xb')](_0x0573('0x8'),auth[_0x0573('0x7')](),controller[_0x0573('0xc')]);router[_0x0573('0xd')](_0x0573('0x8'),auth[_0x0573('0x7')](),controller[_0x0573('0xe')]);module[_0x0573('0xf')]=router; \ No newline at end of file +var _0x8054=['index','/describe','/:id','show','post','create','put','update','delete','multer','express','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x4f61b8,_0x2d9b2d){var _0x2b1121=function(_0x568991){while(--_0x568991){_0x4f61b8['push'](_0x4f61b8['shift']());}};_0x2b1121(++_0x2d9b2d);}(_0x8054,0x72));var _0x4805=function(_0x22cf13,_0x4166df){_0x22cf13=_0x22cf13-0x0;var _0x563ed2=_0x8054[_0x22cf13];return _0x563ed2;};'use strict';var multer=require(_0x4805('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4805('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4805('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x4805('0x3'));var controller=require('./squareReportDetail.controller');router[_0x4805('0x4')]('/',auth[_0x4805('0x5')](),controller[_0x4805('0x6')]);router[_0x4805('0x4')](_0x4805('0x7'),auth[_0x4805('0x5')](),controller['describe']);router[_0x4805('0x4')](_0x4805('0x8'),auth[_0x4805('0x5')](),controller[_0x4805('0x9')]);router[_0x4805('0xa')]('/',auth[_0x4805('0x5')](),controller[_0x4805('0xb')]);router[_0x4805('0xc')](_0x4805('0x8'),auth[_0x4805('0x5')](),controller[_0x4805('0xd')]);router[_0x4805('0xe')](_0x4805('0x8'),auth[_0x4805('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 6f5001c..6c48daa 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 _0x6186=['sequelize','exports','STRING','TEXT'];(function(_0x4c3070,_0xc2fb4c){var _0x536a44=function(_0x1412a5){while(--_0x1412a5){_0x4c3070['push'](_0x4c3070['shift']());}};_0x536a44(++_0xc2fb4c);}(_0x6186,0x1d0));var _0x6618=function(_0x23cd34,_0xe7e8f7){_0x23cd34=_0x23cd34-0x0;var _0x1e1e48=_0x6186[_0x23cd34];return _0x1e1e48;};'use strict';var Sequelize=require(_0x6618('0x0'));module[_0x6618('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x6618('0x2')]},'application':{'type':Sequelize[_0x6618('0x2')]},'data':{'type':Sequelize[_0x6618('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x6618('0x2')]}}; \ No newline at end of file +var _0xc28e=['TEXT','exports','STRING'];(function(_0x528926,_0x2ee9ad){var _0x1f4f80=function(_0x16ac65){while(--_0x16ac65){_0x528926['push'](_0x528926['shift']());}};_0x1f4f80(++_0x2ee9ad);}(_0xc28e,0xa3));var _0xec28=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xc28e[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require('sequelize');module[_0xec28('0x0')]={'uniqueid':{'type':Sequelize[_0xec28('0x1')]},'node':{'type':Sequelize[_0xec28('0x1')]},'application':{'type':Sequelize[_0xec28('0x1')]},'data':{'type':Sequelize[_0xec28('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xec28('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 6dd5659..541e7cb 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 _0xbfee=['sox','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xbfee,0x120));var _0xebfe=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xbfee[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0xebfe('0x0'));var rimraf=require(_0xebfe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebfe('0x2'));var rp=require(_0xebfe('0x3'));var moment=require('moment');var BPromise=require(_0xebfe('0x4'));var Mustache=require(_0xebfe('0x5'));var util=require(_0xebfe('0x6'));var path=require(_0xebfe('0x7'));var sox=require(_0xebfe('0x8'));var csv=require('to-csv');var ejs=require(_0xebfe('0x9'));var fs=require('fs');var fs_extra=require(_0xebfe('0xa'));var _=require('lodash');var squel=require(_0xebfe('0xb'));var crypto=require(_0xebfe('0xc'));var jsforce=require(_0xebfe('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xebfe('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xebfe('0xf'));var qs=require(_0xebfe('0x10'));var as=require(_0xebfe('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebfe('0x12'))(_0xebfe('0x13'));var utils=require(_0xebfe('0x14'));var config=require(_0xebfe('0x15'));var licenseUtil=require(_0xebfe('0x16'));var db=require(_0xebfe('0x17'))['db'];function respondWithStatusCode(_0x4baf14,_0x3bc656){_0x3bc656=_0x3bc656||0xcc;return function(_0x3d64b6){if(_0x3d64b6){return _0x4baf14[_0xebfe('0x18')](_0x3bc656);}return _0x4baf14[_0xebfe('0x19')](_0x3bc656)[_0xebfe('0x1a')]();};}function respondWithResult(_0x55ca18,_0x3acb62){_0x3acb62=_0x3acb62||0xc8;return function(_0x5133f6){if(_0x5133f6){return _0x55ca18[_0xebfe('0x19')](_0x3acb62)[_0xebfe('0x1b')](_0x5133f6);}};}function respondWithFilteredResult(_0x45bad6,_0x5b4ab0){return function(_0xdbf29f){if(_0xdbf29f){var _0xa1107a=typeof _0x5b4ab0[_0xebfe('0x1c')]===_0xebfe('0x1d')&&typeof _0x5b4ab0['limit']===_0xebfe('0x1d');var _0x5cf98c=_0xdbf29f['count'];var _0x109940=_0xa1107a?0x0:_0x5b4ab0[_0xebfe('0x1c')];var _0x14a222=_0xa1107a?_0xdbf29f['count']:_0x5b4ab0[_0xebfe('0x1c')]+_0x5b4ab0[_0xebfe('0x1e')];var _0x111c6c;if(_0x14a222>=_0x5cf98c){_0x14a222=_0x5cf98c;_0x111c6c=0xc8;}else{_0x111c6c=0xce;}_0x45bad6[_0xebfe('0x19')](_0x111c6c);return _0x45bad6[_0xebfe('0x1f')]('Content-Range',_0x109940+'-'+_0x14a222+'/'+_0x5cf98c)[_0xebfe('0x1b')](_0xdbf29f);}return null;};}function patchUpdates(_0x37b48f){return function(_0x39ff67){try{jsonpatch[_0xebfe('0x20')](_0x39ff67,_0x37b48f,!![]);}catch(_0x207a1c){return BPromise[_0xebfe('0x21')](_0x207a1c);}return _0x39ff67['save']();};}function saveUpdates(_0x27ac34,_0x240c0b){return function(_0x5b7c6d){if(_0x5b7c6d){return _0x5b7c6d[_0xebfe('0x22')](_0x27ac34)[_0xebfe('0x23')](function(_0x1ea617){return _0x1ea617;});}return null;};}function removeEntity(_0x11e55d,_0x427031){return function(_0x5b48f9){if(_0x5b48f9){return _0x5b48f9[_0xebfe('0x24')]()[_0xebfe('0x23')](function(){_0x11e55d[_0xebfe('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x411220,_0x163263){return function(_0x172029){if(!_0x172029){_0x411220[_0xebfe('0x18')](0x194);}return _0x172029;};}function handleError(_0x317c4f,_0x1a663f){_0x1a663f=_0x1a663f||0x1f4;return function(_0x221e95){logger['error'](_0x221e95[_0xebfe('0x25')]);if(_0x221e95[_0xebfe('0x26')]){delete _0x221e95[_0xebfe('0x26')];}_0x317c4f[_0xebfe('0x19')](_0x1a663f)[_0xebfe('0x27')](_0x221e95);};}exports[_0xebfe('0x28')]=function(_0x1db298,_0x44d4cf){var _0x76a0b7={},_0x374e10={},_0x37da70={'count':0x0,'rows':[]};var _0x10d28e=_[_0xebfe('0x29')](db['SquareDetailsReport'][_0xebfe('0x2a')],function(_0x36c09d){return{'name':_0x36c09d[_0xebfe('0x2b')],'type':_0x36c09d[_0xebfe('0x2c')][_0xebfe('0x2d')]};});_0x374e10[_0xebfe('0x2e')]=_[_0xebfe('0x29')](_0x10d28e,'name');_0x374e10[_0xebfe('0x2f')]=_[_0xebfe('0x30')](_0x1db298[_0xebfe('0x2f')]);_0x374e10['filters']=_[_0xebfe('0x31')](_0x374e10[_0xebfe('0x2e')],_0x374e10[_0xebfe('0x2f')]);_0x76a0b7[_0xebfe('0x32')]=_[_0xebfe('0x31')](_0x374e10[_0xebfe('0x2e')],qs[_0xebfe('0x33')](_0x1db298[_0xebfe('0x2f')][_0xebfe('0x33')]));_0x76a0b7[_0xebfe('0x32')]=_0x76a0b7[_0xebfe('0x32')][_0xebfe('0x34')]?_0x76a0b7[_0xebfe('0x32')]:_0x374e10[_0xebfe('0x2e')];if(!_0x1db298['query'][_0xebfe('0x35')](_0xebfe('0x36'))){_0x76a0b7[_0xebfe('0x1e')]=qs[_0xebfe('0x1e')](_0x1db298['query'][_0xebfe('0x1e')]);_0x76a0b7[_0xebfe('0x1c')]=qs[_0xebfe('0x1c')](_0x1db298[_0xebfe('0x2f')][_0xebfe('0x1c')]);}_0x76a0b7['order']=qs[_0xebfe('0x37')](_0x1db298[_0xebfe('0x2f')][_0xebfe('0x37')]);_0x76a0b7[_0xebfe('0x38')]=qs[_0xebfe('0x39')](_[_0xebfe('0x3a')](_0x1db298[_0xebfe('0x2f')],_0x374e10[_0xebfe('0x39')]),_0x10d28e);if(_0x1db298[_0xebfe('0x2f')][_0xebfe('0x3b')]){_0x76a0b7[_0xebfe('0x38')]=_[_0xebfe('0x3c')](_0x76a0b7[_0xebfe('0x38')],{'$or':_[_0xebfe('0x29')](_0x10d28e,function(_0x1824ef){if(_0x1824ef['type']!==_0xebfe('0x3d')){var _0x39c57c={};_0x39c57c[_0x1824ef[_0xebfe('0x26')]]={'$like':'%'+_0x1db298[_0xebfe('0x2f')]['filter']+'%'};return _0x39c57c;}})});}_0x76a0b7=_[_0xebfe('0x3c')]({},_0x76a0b7,_0x1db298[_0xebfe('0x3e')]);var _0x430486={'where':_0x76a0b7[_0xebfe('0x38')]};return db[_0xebfe('0x3f')]['count'](_0x430486)[_0xebfe('0x23')](function(_0x4092d2){_0x37da70['count']=_0x4092d2;if(_0x1db298[_0xebfe('0x2f')]['includeAll']){_0x76a0b7['include']=[{'all':!![]}];}return db[_0xebfe('0x3f')][_0xebfe('0x40')](_0x76a0b7);})[_0xebfe('0x23')](function(_0x515661){_0x37da70[_0xebfe('0x41')]=_0x515661;return _0x37da70;})[_0xebfe('0x23')](respondWithFilteredResult(_0x44d4cf,_0x76a0b7))[_0xebfe('0x42')](handleError(_0x44d4cf,null));};exports[_0xebfe('0x43')]=function(_0x159c76,_0x5161bc){var _0x306940={'raw':!![],'where':{'id':_0x159c76[_0xebfe('0x44')]['id']}},_0x141e50={};_0x141e50[_0xebfe('0x2e')]=_[_0xebfe('0x30')](db[_0xebfe('0x3f')][_0xebfe('0x2a')]);_0x141e50[_0xebfe('0x2f')]=_[_0xebfe('0x30')](_0x159c76[_0xebfe('0x2f')]);_0x141e50[_0xebfe('0x39')]=_[_0xebfe('0x31')](_0x141e50[_0xebfe('0x2e')],_0x141e50[_0xebfe('0x2f')]);_0x306940[_0xebfe('0x32')]=_[_0xebfe('0x31')](_0x141e50['model'],qs[_0xebfe('0x33')](_0x159c76['query'][_0xebfe('0x33')]));_0x306940['attributes']=_0x306940[_0xebfe('0x32')][_0xebfe('0x34')]?_0x306940[_0xebfe('0x32')]:_0x141e50['model'];if(_0x159c76[_0xebfe('0x2f')]['includeAll']){_0x306940[_0xebfe('0x45')]=[{'all':!![]}];}_0x306940=_['merge']({},_0x306940,_0x159c76[_0xebfe('0x3e')]);return db[_0xebfe('0x3f')][_0xebfe('0x46')](_0x306940)['then'](handleEntityNotFound(_0x5161bc,null))['then'](respondWithResult(_0x5161bc,null))[_0xebfe('0x42')](handleError(_0x5161bc,null));};exports[_0xebfe('0x47')]=function(_0x422668,_0x362f88){return db[_0xebfe('0x3f')][_0xebfe('0x47')](_0x422668['body'],{})[_0xebfe('0x23')](respondWithResult(_0x362f88,0xc9))[_0xebfe('0x42')](handleError(_0x362f88,null));};exports[_0xebfe('0x22')]=function(_0xdc68cb,_0x70f570){if(_0xdc68cb[_0xebfe('0x48')]['id']){delete _0xdc68cb['body']['id'];}return db[_0xebfe('0x3f')][_0xebfe('0x46')]({'where':{'id':_0xdc68cb[_0xebfe('0x44')]['id']}})['then'](handleEntityNotFound(_0x70f570,null))[_0xebfe('0x23')](saveUpdates(_0xdc68cb['body'],null))[_0xebfe('0x23')](respondWithResult(_0x70f570,null))['catch'](handleError(_0x70f570,null));};exports[_0xebfe('0x24')]=function(_0x1b5468,_0x399a31){return db[_0xebfe('0x3f')][_0xebfe('0x46')]({'where':{'id':_0x1b5468[_0xebfe('0x44')]['id']}})['then'](handleEntityNotFound(_0x399a31,null))[_0xebfe('0x23')](removeEntity(_0x399a31,null))[_0xebfe('0x42')](handleError(_0x399a31,null));};exports[_0xebfe('0x49')]=function(_0x44f850,_0x42838d){return db['SquareDetailsReport'][_0xebfe('0x49')]()[_0xebfe('0x23')](respondWithResult(_0x42838d,null))[_0xebfe('0x42')](handleError(_0x42838d,null));}; \ No newline at end of file +var _0xebfe=['../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name','send','SquareDetailsReport','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xebfe,0x11a));var _0xeebf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xebfe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xeebf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeebf('0x1'));var jsonpatch=require(_0xeebf('0x2'));var rp=require(_0xeebf('0x3'));var moment=require('moment');var BPromise=require(_0xeebf('0x4'));var Mustache=require(_0xeebf('0x5'));var util=require(_0xeebf('0x6'));var path=require(_0xeebf('0x7'));var sox=require(_0xeebf('0x8'));var csv=require('to-csv');var ejs=require(_0xeebf('0x9'));var fs=require('fs');var fs_extra=require(_0xeebf('0xa'));var _=require(_0xeebf('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeebf('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeebf('0xd'));var Papa=require(_0xeebf('0xe'));var Redis=require(_0xeebf('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xeebf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeebf('0x11'));var logger=require(_0xeebf('0x12'))(_0xeebf('0x13'));var utils=require(_0xeebf('0x14'));var config=require(_0xeebf('0x15'));var licenseUtil=require(_0xeebf('0x16'));var db=require(_0xeebf('0x17'))['db'];function respondWithStatusCode(_0x1f9943,_0x2a7929){_0x2a7929=_0x2a7929||0xcc;return function(_0x43fcb3){if(_0x43fcb3){return _0x1f9943[_0xeebf('0x18')](_0x2a7929);}return _0x1f9943[_0xeebf('0x19')](_0x2a7929)['end']();};}function respondWithResult(_0x4a1ab6,_0x3a0ec7){_0x3a0ec7=_0x3a0ec7||0xc8;return function(_0xf4d086){if(_0xf4d086){return _0x4a1ab6[_0xeebf('0x19')](_0x3a0ec7)[_0xeebf('0x1a')](_0xf4d086);}};}function respondWithFilteredResult(_0x414236,_0x541aeb){return function(_0x18173c){if(_0x18173c){var _0x1bf78e=typeof _0x541aeb['offset']===_0xeebf('0x1b')&&typeof _0x541aeb['limit']==='undefined';var _0x5cfaad=_0x18173c['count'];var _0x196f1c=_0x1bf78e?0x0:_0x541aeb[_0xeebf('0x1c')];var _0x22ae2f=_0x1bf78e?_0x18173c[_0xeebf('0x1d')]:_0x541aeb[_0xeebf('0x1c')]+_0x541aeb[_0xeebf('0x1e')];var _0x2b6b0f;if(_0x22ae2f>=_0x5cfaad){_0x22ae2f=_0x5cfaad;_0x2b6b0f=0xc8;}else{_0x2b6b0f=0xce;}_0x414236[_0xeebf('0x19')](_0x2b6b0f);return _0x414236[_0xeebf('0x1f')](_0xeebf('0x20'),_0x196f1c+'-'+_0x22ae2f+'/'+_0x5cfaad)[_0xeebf('0x1a')](_0x18173c);}return null;};}function patchUpdates(_0x4d782e){return function(_0x10e7c1){try{jsonpatch[_0xeebf('0x21')](_0x10e7c1,_0x4d782e,!![]);}catch(_0x11b6b4){return BPromise['reject'](_0x11b6b4);}return _0x10e7c1[_0xeebf('0x22')]();};}function saveUpdates(_0x445f75,_0x3df57e){return function(_0x1e25cb){if(_0x1e25cb){return _0x1e25cb[_0xeebf('0x23')](_0x445f75)['then'](function(_0x27296c){return _0x27296c;});}return null;};}function removeEntity(_0x444543,_0x452179){return function(_0x2f59d4){if(_0x2f59d4){return _0x2f59d4[_0xeebf('0x24')]()[_0xeebf('0x25')](function(){_0x444543[_0xeebf('0x19')](0xcc)[_0xeebf('0x26')]();});}};}function handleEntityNotFound(_0x2c94f8,_0x3e3bd4){return function(_0x48b67b){if(!_0x48b67b){_0x2c94f8[_0xeebf('0x18')](0x194);}return _0x48b67b;};}function handleError(_0x526ffe,_0x1bad6b){_0x1bad6b=_0x1bad6b||0x1f4;return function(_0x4a1974){logger[_0xeebf('0x27')](_0x4a1974[_0xeebf('0x28')]);if(_0x4a1974['name']){delete _0x4a1974[_0xeebf('0x29')];}_0x526ffe[_0xeebf('0x19')](_0x1bad6b)[_0xeebf('0x2a')](_0x4a1974);};}exports['index']=function(_0x376a83,_0x3ec093){var _0x2265cf={},_0x11f814={},_0x25c390={'count':0x0,'rows':[]};var _0x3b1028=_['map'](db[_0xeebf('0x2b')]['rawAttributes'],function(_0x3fa5fc){return{'name':_0x3fa5fc[_0xeebf('0x2c')],'type':_0x3fa5fc[_0xeebf('0x2d')][_0xeebf('0x2e')]};});_0x11f814[_0xeebf('0x2f')]=_[_0xeebf('0x30')](_0x3b1028,_0xeebf('0x29'));_0x11f814['query']=_['keys'](_0x376a83[_0xeebf('0x31')]);_0x11f814[_0xeebf('0x32')]=_[_0xeebf('0x33')](_0x11f814[_0xeebf('0x2f')],_0x11f814[_0xeebf('0x31')]);_0x2265cf[_0xeebf('0x34')]=_['intersection'](_0x11f814[_0xeebf('0x2f')],qs[_0xeebf('0x35')](_0x376a83[_0xeebf('0x31')]['fields']));_0x2265cf[_0xeebf('0x34')]=_0x2265cf[_0xeebf('0x34')][_0xeebf('0x36')]?_0x2265cf[_0xeebf('0x34')]:_0x11f814['model'];if(!_0x376a83[_0xeebf('0x31')][_0xeebf('0x37')](_0xeebf('0x38'))){_0x2265cf['limit']=qs[_0xeebf('0x1e')](_0x376a83[_0xeebf('0x31')][_0xeebf('0x1e')]);_0x2265cf[_0xeebf('0x1c')]=qs[_0xeebf('0x1c')](_0x376a83['query'][_0xeebf('0x1c')]);}_0x2265cf[_0xeebf('0x39')]=qs[_0xeebf('0x3a')](_0x376a83[_0xeebf('0x31')][_0xeebf('0x3a')]);_0x2265cf[_0xeebf('0x3b')]=qs[_0xeebf('0x32')](_[_0xeebf('0x3c')](_0x376a83['query'],_0x11f814[_0xeebf('0x32')]),_0x3b1028);if(_0x376a83[_0xeebf('0x31')][_0xeebf('0x3d')]){_0x2265cf[_0xeebf('0x3b')]=_[_0xeebf('0x3e')](_0x2265cf[_0xeebf('0x3b')],{'$or':_[_0xeebf('0x30')](_0x3b1028,function(_0x48aa4b){if(_0x48aa4b[_0xeebf('0x2d')]!==_0xeebf('0x3f')){var _0x3d35b5={};_0x3d35b5[_0x48aa4b[_0xeebf('0x29')]]={'$like':'%'+_0x376a83['query']['filter']+'%'};return _0x3d35b5;}})});}_0x2265cf=_[_0xeebf('0x3e')]({},_0x2265cf,_0x376a83[_0xeebf('0x40')]);var _0x5a9bab={'where':_0x2265cf[_0xeebf('0x3b')]};return db[_0xeebf('0x2b')][_0xeebf('0x1d')](_0x5a9bab)[_0xeebf('0x25')](function(_0x508c45){_0x25c390[_0xeebf('0x1d')]=_0x508c45;if(_0x376a83[_0xeebf('0x31')][_0xeebf('0x41')]){_0x2265cf['include']=[{'all':!![]}];}return db[_0xeebf('0x2b')]['findAll'](_0x2265cf);})[_0xeebf('0x25')](function(_0x469ec1){_0x25c390[_0xeebf('0x42')]=_0x469ec1;return _0x25c390;})[_0xeebf('0x25')](respondWithFilteredResult(_0x3ec093,_0x2265cf))[_0xeebf('0x43')](handleError(_0x3ec093,null));};exports[_0xeebf('0x44')]=function(_0x5db4a1,_0x41b2c0){var _0x4739a2={'raw':!![],'where':{'id':_0x5db4a1[_0xeebf('0x45')]['id']}},_0x1d85db={};_0x1d85db[_0xeebf('0x2f')]=_[_0xeebf('0x46')](db[_0xeebf('0x2b')][_0xeebf('0x47')]);_0x1d85db['query']=_[_0xeebf('0x46')](_0x5db4a1[_0xeebf('0x31')]);_0x1d85db['filters']=_[_0xeebf('0x33')](_0x1d85db[_0xeebf('0x2f')],_0x1d85db[_0xeebf('0x31')]);_0x4739a2[_0xeebf('0x34')]=_[_0xeebf('0x33')](_0x1d85db['model'],qs['fields'](_0x5db4a1[_0xeebf('0x31')][_0xeebf('0x35')]));_0x4739a2[_0xeebf('0x34')]=_0x4739a2['attributes'][_0xeebf('0x36')]?_0x4739a2[_0xeebf('0x34')]:_0x1d85db[_0xeebf('0x2f')];if(_0x5db4a1[_0xeebf('0x31')][_0xeebf('0x41')]){_0x4739a2['include']=[{'all':!![]}];}_0x4739a2=_['merge']({},_0x4739a2,_0x5db4a1[_0xeebf('0x40')]);return db[_0xeebf('0x2b')][_0xeebf('0x48')](_0x4739a2)[_0xeebf('0x25')](handleEntityNotFound(_0x41b2c0,null))['then'](respondWithResult(_0x41b2c0,null))[_0xeebf('0x43')](handleError(_0x41b2c0,null));};exports[_0xeebf('0x49')]=function(_0xc507e1,_0x28afd9){return db['SquareDetailsReport'][_0xeebf('0x49')](_0xc507e1[_0xeebf('0x4a')],{})[_0xeebf('0x25')](respondWithResult(_0x28afd9,0xc9))[_0xeebf('0x43')](handleError(_0x28afd9,null));};exports[_0xeebf('0x23')]=function(_0x5b8edf,_0x1eae11){if(_0x5b8edf[_0xeebf('0x4a')]['id']){delete _0x5b8edf[_0xeebf('0x4a')]['id'];}return db[_0xeebf('0x2b')][_0xeebf('0x48')]({'where':{'id':_0x5b8edf[_0xeebf('0x45')]['id']}})[_0xeebf('0x25')](handleEntityNotFound(_0x1eae11,null))[_0xeebf('0x25')](saveUpdates(_0x5b8edf[_0xeebf('0x4a')],null))[_0xeebf('0x25')](respondWithResult(_0x1eae11,null))['catch'](handleError(_0x1eae11,null));};exports[_0xeebf('0x24')]=function(_0x3ac5d0,_0x441a46){return db[_0xeebf('0x2b')]['find']({'where':{'id':_0x3ac5d0[_0xeebf('0x45')]['id']}})[_0xeebf('0x25')](handleEntityNotFound(_0x441a46,null))[_0xeebf('0x25')](removeEntity(_0x441a46,null))['catch'](handleError(_0x441a46,null));};exports[_0xeebf('0x4b')]=function(_0x52ceb6,_0x506584){return db['SquareDetailsReport']['describe']()[_0xeebf('0x25')](respondWithResult(_0x506584,null))[_0xeebf('0x43')](handleError(_0x506584,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index c54405e..7401a0b 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 _0x1a09=['report_square_details','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport'];(function(_0x8a1b38,_0x8d53e2){var _0x97ac16=function(_0x1e55b9){while(--_0x1e55b9){_0x8a1b38['push'](_0x8a1b38['shift']());}};_0x97ac16(++_0x8d53e2);}(_0x1a09,0x12a));var _0x91a0=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x1a09[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x91a0('0x0'))(_0x91a0('0x1'));var moment=require(_0x91a0('0x2'));var BPromise=require(_0x91a0('0x3'));var rp=require(_0x91a0('0x4'));var fs=require('fs');var path=require(_0x91a0('0x5'));var rimraf=require('rimraf');var config=require(_0x91a0('0x6'));var attributes=require(_0x91a0('0x7'));module[_0x91a0('0x8')]=function(_0x599f8a,_0x1d6ad8){return _0x599f8a['define'](_0x91a0('0x9'),attributes,{'tableName':_0x91a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc97f=['../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2416b6,_0x539944){var _0x4f7b43=function(_0x1a66fa){while(--_0x1a66fa){_0x2416b6['push'](_0x2416b6['shift']());}};_0x4f7b43(++_0x539944);}(_0xc97f,0x102));var _0xfc97=function(_0x5cc318,_0xd5bb90){_0x5cc318=_0x5cc318-0x0;var _0x537f19=_0xc97f[_0x5cc318];return _0x537f19;};'use strict';var _=require(_0xfc97('0x0'));var util=require('util');var logger=require(_0xfc97('0x1'))(_0xfc97('0x2'));var moment=require(_0xfc97('0x3'));var BPromise=require(_0xfc97('0x4'));var rp=require(_0xfc97('0x5'));var fs=require('fs');var path=require(_0xfc97('0x6'));var rimraf=require(_0xfc97('0x7'));var config=require(_0xfc97('0x8'));var attributes=require(_0xfc97('0x9'));module[_0xfc97('0xa')]=function(_0x10c0db,_0x44704f){return _0x10c0db[_0xfc97('0xb')](_0xfc97('0xc'),attributes,{'tableName':_0xfc97('0xd'),'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 27863f4..c857a5e 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 _0x8952=['jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','raw','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3307bd,_0x256dbf){var _0x2561be=function(_0x3ebf){while(--_0x3ebf){_0x3307bd['push'](_0x3307bd['shift']());}};_0x2561be(++_0x256dbf);}(_0x8952,0x17e));var _0x2895=function(_0x1f45aa,_0xdec47b){_0x1f45aa=_0x1f45aa-0x0;var _0x991025=_0x8952[_0x1f45aa];return _0x991025;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});}exports[_0x2895('0x15')]=function(_0xbf8b63){var _0x2cb505=this;return new Promise(function(_0x155124,_0x184d11){return db[_0x2895('0x16')][_0x2895('0x17')](_0xbf8b63['body'],{'raw':_0xbf8b63['options']?_0xbf8b63['options'][_0x2895('0x18')]===undefined?!![]:![]:!![]})[_0x2895('0xc')](function(_0x3ec4da){logger['info'](_0x2895('0x15'),_0xbf8b63);logger[_0x2895('0x19')](_0x2895('0x15'),_0xbf8b63,JSON[_0x2895('0xf')](_0x3ec4da));_0x155124(_0x3ec4da);})[_0x2895('0x14')](function(_0x5dbbfe){logger[_0x2895('0x10')](_0x2895('0x15'),_0x5dbbfe['message'],_0xbf8b63);_0x184d11(_0x2cb505[_0x2895('0x10')](0x1f4,_0x5dbbfe[_0x2895('0x12')]));});});}; \ No newline at end of file +var _0x2032=['stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','then'];(function(_0x14b39b,_0x1abee2){var _0x2a9839=function(_0x4e4a30){while(--_0x4e4a30){_0x14b39b['push'](_0x14b39b['shift']());}};_0x2a9839(++_0x1abee2);}(_0x2032,0xd9));var _0x2203=function(_0x4cbbb1,_0x19b142){_0x4cbbb1=_0x4cbbb1-0x0;var _0x36c8cc=_0x2032[_0x4cbbb1];return _0x36c8cc;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2203('0x3'));var db=require(_0x2203('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var config=require(_0x2203('0x7'));var jayson=require(_0x2203('0x8'));var client=jayson[_0x2203('0x9')][_0x2203('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e0f63,_0x2676aa,_0x18c4d6){return new BPromise(function(_0x2049ff,_0x2999ed){return client['request'](_0x2e0f63,_0x18c4d6)['then'](function(_0x10f055){logger['info'](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));logger[_0x2203('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x2676aa,_0x2203('0xc'),JSON['stringify'](_0x10f055));if(_0x10f055[_0x2203('0xe')]){if(_0x10f055['error'][_0x2203('0xf')]===0x1f4){logger[_0x2203('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x2676aa,_0x10f055['error'][_0x2203('0x10')]);return _0x2049ff(_0x10f055[_0x2203('0xe')][_0x2203('0x10')]);}else{logger[_0x2203('0x11')](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));_0x2049ff(_0x10f055[_0x2203('0x12')][_0x2203('0x10')]);}})[_0x2203('0x13')](function(_0x3053f3){logger['error'](_0x2203('0xb'),_0x2676aa,_0x3053f3);_0x2999ed(_0x3053f3);});});}exports[_0x2203('0x14')]=function(_0x4893ff){var _0x3f9ef6=this;return new Promise(function(_0x8906e1,_0x4aeb9f){return db[_0x2203('0x15')]['create'](_0x4893ff[_0x2203('0x16')],{'raw':_0x4893ff[_0x2203('0x17')]?_0x4893ff[_0x2203('0x17')][_0x2203('0x18')]===undefined?!![]:![]:!![]})[_0x2203('0x19')](function(_0x449039){logger['info'](_0x2203('0x14'),_0x4893ff);logger['debug']('CreateSquareDetailsReport',_0x4893ff,JSON[_0x2203('0x1a')](_0x449039));_0x8906e1(_0x449039);})['catch'](function(_0x3b8ef9){logger[_0x2203('0xe')]('CreateSquareDetailsReport',_0x3b8ef9[_0x2203('0x10')],_0x4893ff);_0x4aeb9f(_0x3f9ef6['error'](0x1f4,_0x3b8ef9['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index a7be072..2b60fef 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 _0x0b3c=['/process/:pid/kill','isAuthenticated','killProcess','exports','get','index'];(function(_0x443efe,_0x48d8df){var _0x16abe8=function(_0x23c6a9){while(--_0x23c6a9){_0x443efe['push'](_0x443efe['shift']());}};_0x16abe8(++_0x48d8df);}(_0x0b3c,0x1cc));var _0xc0b3=function(_0xbf7f20,_0x3f856e){_0xbf7f20=_0xbf7f20-0x0;var _0x5dc25d=_0x0b3c[_0xbf7f20];return _0x5dc25d;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0xc0b3('0x0')]('/',auth['isAuthenticated'](),controller[_0xc0b3('0x1')]);router[_0xc0b3('0x0')](_0xc0b3('0x2'),auth[_0xc0b3('0x3')](),controller[_0xc0b3('0x4')]);module[_0xc0b3('0x5')]=router; \ No newline at end of file +var _0xfa4d=['exports','express','Router','../../components/auth/service','get','isAuthenticated','index'];(function(_0x4a9b83,_0x5115d7){var _0x47d3d3=function(_0x1b82b1){while(--_0x1b82b1){_0x4a9b83['push'](_0x4a9b83['shift']());}};_0x47d3d3(++_0x5115d7);}(_0xfa4d,0x17b));var _0xdfa4=function(_0x155bf8,_0x461a02){_0x155bf8=_0x155bf8-0x0;var _0x57f879=_0xfa4d[_0x155bf8];return _0x57f879;};'use strict';var express=require(_0xdfa4('0x0'));var router=express[_0xdfa4('0x1')]();var auth=require(_0xdfa4('0x2'));var controller=require('./system.controller');router[_0xdfa4('0x3')]('/',auth[_0xdfa4('0x4')](),controller[_0xdfa4('0x5')]);router[_0xdfa4('0x3')]('/process/:pid/kill',auth[_0xdfa4('0x4')](),controller['killProcess']);module[_0xdfa4('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 777e0b7..2a66398 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 _0x9512=['split','length','indexOf','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then'];(function(_0x143759,_0x249c49){var _0x4582be=function(_0x5b9462){while(--_0x5b9462){_0x143759['push'](_0x143759['shift']());}};_0x4582be(++_0x249c49);}(_0x9512,0x75));var _0x2951=function(_0x4a0f62,_0x19f781){_0x4a0f62=_0x4a0f62-0x0;var _0x3ffcc1=_0x9512[_0x4a0f62];return _0x3ffcc1;};'use strict';var info=require(_0x2951('0x0'));var exec=require(_0x2951('0x1'))[_0x2951('0x2')];var logger=require(_0x2951('0x3'))(_0x2951('0x4'));var util=require(_0x2951('0x5'));var BPromise=require(_0x2951('0x6'));var _=require('lodash');function handleError(_0x216aee,_0x330cb4,_0x1931b8){_0x330cb4=_0x330cb4||0x1f4;return function(_0x26a247){logger[_0x2951('0x7')](_0x2951('0x8'),_0x1931b8,_0x330cb4,util[_0x2951('0x9')](_0x26a247,{'showHidden':![],'depth':null}));delete _0x26a247['name'];_0x216aee[_0x2951('0xa')](_0x330cb4)[_0x2951('0xb')](_0x26a247);};}exports[_0x2951('0xc')]=function(_0x181d83,_0x279d79){return info[_0x2951('0xd')]()['then'](function(_0x3e6f58){return _0x279d79[_0x2951('0xa')](0xc8)[_0x2951('0xe')](_0x3e6f58);})[_0x2951('0xf')](function(_0x540819){return _0x279d79[_0x2951('0xa')](0x1f4)[_0x2951('0xe')](_0x540819);});};exports[_0x2951('0x10')]=function(_0x13d9ea,_0x13f23b){var _0x48a757=[_0x2951('0x11')];return new BPromise(function(_0x2dc786,_0x24dece){return exec(util[_0x2951('0x12')](_0x2951('0x13'),_0x13d9ea[_0x2951('0x14')][_0x2951('0x15')]),function(_0x25d7fc,_0x4f238e,_0x454d02){if(_0x25d7fc){return _0x24dece(_0x25d7fc);}return _0x2dc786(_0x4f238e);});})[_0x2951('0x16')](function(_0x402072){var _0x3ea695=![];var _0x5750e9=_0x402072[_0x2951('0x17')](/\n/);for(var _0x26ebbc=0x0,_0x18e89d=_0x48a757[_0x2951('0x18')];_0x26ebbc<_0x18e89d,_0x3ea695===![];_0x26ebbc+=0x1){if(_0x402072[_0x2951('0x19')](_0x48a757[_0x26ebbc])>=0x0){_0x3ea695=!![];}}if(!_0x3ea695){throw new Error(util[_0x2951('0x12')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x13d9ea[_0x2951('0x14')][_0x2951('0x15')]));}process[_0x2951('0x1a')](_0x13d9ea[_0x2951('0x14')][_0x2951('0x15')],'SIGINT');return _0x13f23b['status'](0xc8)[_0x2951('0xe')]({'message':util[_0x2951('0x12')](_0x2951('0x1b'),_0x13d9ea[_0x2951('0x14')]['pid'])});})['catch'](handleError(_0x13f23b,null,_0x2951('0x10')));}; \ No newline at end of file +var _0x0546=['api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger'];(function(_0x4f8030,_0x58abe6){var _0xe3c712=function(_0x527f2a){while(--_0x527f2a){_0x4f8030['push'](_0x4f8030['shift']());}};_0xe3c712(++_0x58abe6);}(_0x0546,0x6d));var _0x6054=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x0546[_0x4c12ec];return _0x3ae42c;};'use strict';var info=require(_0x6054('0x0'));var exec=require('child_process')[_0x6054('0x1')];var logger=require(_0x6054('0x2'))(_0x6054('0x3'));var util=require(_0x6054('0x4'));var BPromise=require(_0x6054('0x5'));var _=require(_0x6054('0x6'));function handleError(_0x33bd0e,_0x4ba884,_0x59d165){_0x4ba884=_0x4ba884||0x1f4;return function(_0xbff595){logger[_0x6054('0x7')](_0x6054('0x8'),_0x59d165,_0x4ba884,util[_0x6054('0x9')](_0xbff595,{'showHidden':![],'depth':null}));delete _0xbff595[_0x6054('0xa')];_0x33bd0e[_0x6054('0xb')](_0x4ba884)['send'](_0xbff595);};}exports[_0x6054('0xc')]=function(_0x364288,_0x29e5f9){return info[_0x6054('0xd')]()[_0x6054('0xe')](function(_0x477f54){return _0x29e5f9[_0x6054('0xb')](0xc8)[_0x6054('0xf')](_0x477f54);})[_0x6054('0x10')](function(_0x18c2db){return _0x29e5f9[_0x6054('0xb')](0x1f4)[_0x6054('0xf')](_0x18c2db);});};exports[_0x6054('0x11')]=function(_0x4a5d1e,_0x3b9e66){var _0x2580bc=[_0x6054('0x12')];return new BPromise(function(_0x5f3362,_0xb666d4){return exec(util['format'](_0x6054('0x13'),_0x4a5d1e[_0x6054('0x14')][_0x6054('0x15')]),function(_0xcbfa0f,_0x462652,_0x375470){if(_0xcbfa0f){return _0xb666d4(_0xcbfa0f);}return _0x5f3362(_0x462652);});})[_0x6054('0xe')](function(_0x5a080c){var _0x276dc2=![];var _0x10c4b2=_0x5a080c[_0x6054('0x16')](/\n/);for(var _0x2c9130=0x0,_0x259e5d=_0x2580bc['length'];_0x2c9130<_0x259e5d,_0x276dc2===![];_0x2c9130+=0x1){if(_0x5a080c['indexOf'](_0x2580bc[_0x2c9130])>=0x0){_0x276dc2=!![];}}if(!_0x276dc2){throw new Error(util[_0x6054('0x17')](_0x6054('0x18'),_0x4a5d1e[_0x6054('0x14')][_0x6054('0x15')]));}process[_0x6054('0x19')](_0x4a5d1e[_0x6054('0x14')]['pid'],_0x6054('0x1a'));return _0x3b9e66[_0x6054('0xb')](0xc8)['json']({'message':util[_0x6054('0x17')](_0x6054('0x1b'),_0x4a5d1e['params'][_0x6054('0x15')])});})[_0x6054('0x10')](handleError(_0x3b9e66,null,_0x6054('0x11')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 4b9da65..f57a63f 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 _0x18cc=['post','create','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x2583a5,_0x210710){var _0x1f856a=function(_0x25baa2){while(--_0x25baa2){_0x2583a5['push'](_0x2583a5['shift']());}};_0x1f856a(++_0x210710);}(_0x18cc,0x116));var _0xc18c=function(_0x2b0e01,_0x1b7eb7){_0x2b0e01=_0x2b0e01-0x0;var _0x14ce57=_0x18cc[_0x2b0e01];return _0x14ce57;};'use strict';var multer=require(_0xc18c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc18c('0x1'));var express=require('express');var router=express[_0xc18c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xc18c('0x3'));var interaction=require(_0xc18c('0x4'));var config=require(_0xc18c('0x5'));var controller=require('./tag.controller');router[_0xc18c('0x6')]('/',auth[_0xc18c('0x7')](),controller[_0xc18c('0x8')]);router['get'](_0xc18c('0x9'),auth[_0xc18c('0x7')](),controller[_0xc18c('0xa')]);router[_0xc18c('0xb')]('/',auth[_0xc18c('0x7')](),controller[_0xc18c('0xc')]);router['put'](_0xc18c('0x9'),auth['isAuthenticated'](),controller[_0xc18c('0xd')]);router[_0xc18c('0xe')](_0xc18c('0x9'),auth[_0xc18c('0x7')](),controller[_0xc18c('0xf')]);module[_0xc18c('0x10')]=router; \ No newline at end of file +var _0xe5c6=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer'];(function(_0x4a8227,_0x27ab19){var _0x403b2c=function(_0x6e793d){while(--_0x6e793d){_0x4a8227['push'](_0x4a8227['shift']());}};_0x403b2c(++_0x27ab19);}(_0xe5c6,0xf6));var _0x6e5c=function(_0x3aa499,_0x5a2cf8){_0x3aa499=_0x3aa499-0x0;var _0x40ca96=_0xe5c6[_0x3aa499];return _0x40ca96;};'use strict';var multer=require(_0x6e5c('0x0'));var util=require(_0x6e5c('0x1'));var path=require('path');var timeout=require(_0x6e5c('0x2'));var express=require(_0x6e5c('0x3'));var router=express[_0x6e5c('0x4')]();var fs_extra=require(_0x6e5c('0x5'));var auth=require(_0x6e5c('0x6'));var interaction=require(_0x6e5c('0x7'));var config=require(_0x6e5c('0x8'));var controller=require(_0x6e5c('0x9'));router['get']('/',auth[_0x6e5c('0xa')](),controller[_0x6e5c('0xb')]);router['get'](_0x6e5c('0xc'),auth[_0x6e5c('0xa')](),controller['show']);router[_0x6e5c('0xd')]('/',auth['isAuthenticated'](),controller[_0x6e5c('0xe')]);router[_0x6e5c('0xf')](_0x6e5c('0xc'),auth[_0x6e5c('0xa')](),controller[_0x6e5c('0x10')]);router[_0x6e5c('0x11')]('/:id',auth[_0x6e5c('0xa')](),controller['destroy']);module[_0x6e5c('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 4d44d79..7b85bdf 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 _0x4123=['sequelize','exports','STRING','name','#0091EA'];(function(_0x3b6891,_0x29b552){var _0x14019a=function(_0x49c677){while(--_0x49c677){_0x3b6891['push'](_0x3b6891['shift']());}};_0x14019a(++_0x29b552);}(_0x4123,0x87));var _0x3412=function(_0x168e24,_0x347c8a){_0x168e24=_0x168e24-0x0;var _0x2f90de=_0x4123[_0x168e24];return _0x2f90de;};'use strict';var Sequelize=require(_0x3412('0x0'));module[_0x3412('0x1')]={'name':{'type':Sequelize[_0x3412('0x2')],'unique':_0x3412('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3412('0x2')],'defaultValue':_0x3412('0x4')},'description':{'type':Sequelize[_0x3412('0x2')]}}; \ No newline at end of file +var _0x112a=['name','#0091EA','sequelize','exports','STRING'];(function(_0x469aab,_0xf4ef88){var _0x2bd851=function(_0x2e8858){while(--_0x2e8858){_0x469aab['push'](_0x469aab['shift']());}};_0x2bd851(++_0xf4ef88);}(_0x112a,0x115));var _0xa112=function(_0x49fb69,_0x44c9d4){_0x49fb69=_0x49fb69-0x0;var _0x4d4614=_0x112a[_0x49fb69];return _0x4d4614;};'use strict';var Sequelize=require(_0xa112('0x0'));module[_0xa112('0x1')]={'name':{'type':Sequelize[_0xa112('0x2')],'unique':_0xa112('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa112('0x2')],'defaultValue':_0xa112('0x4')},'description':{'type':Sequelize[_0xa112('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 4e082a0..71019bc 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 _0x04b8=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','Tags','error','stack','name','send','index','map','Tag','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get'];(function(_0x3d781d,_0x4847c7){var _0x1ce302=function(_0x3d6a46){while(--_0x3d6a46){_0x3d781d['push'](_0x3d781d['shift']());}};_0x1ce302(++_0x4847c7);}(_0x04b8,0x159));var _0x804b=function(_0x20c46d,_0x4da3b3){_0x20c46d=_0x20c46d-0x0;var _0x55ba19=_0x04b8[_0x20c46d];return _0x55ba19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15a4eb,_0x5303cc){_0x5303cc=_0x5303cc||0xcc;return function(_0x23ee57){if(_0x23ee57){return _0x15a4eb[_0x804b('0x18')](_0x5303cc);}return _0x15a4eb[_0x804b('0x19')](_0x5303cc)[_0x804b('0x1a')]();};}function respondWithResult(_0x581fbf,_0x215825){_0x215825=_0x215825||0xc8;return function(_0x1b01a7){if(_0x1b01a7){return _0x581fbf[_0x804b('0x19')](_0x215825)[_0x804b('0x1b')](_0x1b01a7);}};}function respondWithFilteredResult(_0x4ff1be,_0x2fd593){return function(_0x8ccbe0){if(_0x8ccbe0){var _0x5e1cfe=typeof _0x2fd593[_0x804b('0x1c')]==='undefined'&&typeof _0x2fd593[_0x804b('0x1d')]===_0x804b('0x1e');var _0x13662e=_0x8ccbe0[_0x804b('0x1f')];var _0x3a05c0=_0x5e1cfe?0x0:_0x2fd593['offset'];var _0x871d6c=_0x5e1cfe?_0x8ccbe0['count']:_0x2fd593[_0x804b('0x1c')]+_0x2fd593[_0x804b('0x1d')];var _0x42cceb;if(_0x871d6c>=_0x13662e){_0x871d6c=_0x13662e;_0x42cceb=0xc8;}else{_0x42cceb=0xce;}_0x4ff1be[_0x804b('0x19')](_0x42cceb);return _0x4ff1be['set'](_0x804b('0x20'),_0x3a05c0+'-'+_0x871d6c+'/'+_0x13662e)[_0x804b('0x1b')](_0x8ccbe0);}return null;};}function patchUpdates(_0x427166){return function(_0x11eaf6){try{jsonpatch[_0x804b('0x21')](_0x11eaf6,_0x427166,!![]);}catch(_0x267878){return BPromise[_0x804b('0x22')](_0x267878);}return _0x11eaf6[_0x804b('0x23')]();};}function saveUpdates(_0xaa9521,_0x2b7271){return function(_0x1acc48){if(_0x1acc48){return _0x1acc48['update'](_0xaa9521)[_0x804b('0x24')](function(_0x5a77e0){return _0x5a77e0;});}return null;};}function removeEntity(_0x5585f8,_0x44a921){return function(_0x367024){if(_0x367024){return _0x367024[_0x804b('0x25')]()[_0x804b('0x24')](function(){var _0x9080c2=_0x367024['get']({'plain':!![]});var _0x2de812=_0x804b('0x26');return db['UserProfileResource'][_0x804b('0x25')]({'where':{'type':_0x2de812,'resourceId':_0x9080c2['id']}})[_0x804b('0x24')](function(){return _0x367024;});})[_0x804b('0x24')](function(){_0x5585f8[_0x804b('0x19')](0xcc)[_0x804b('0x1a')]();});}};}function handleEntityNotFound(_0x5cc1dd,_0x456580){return function(_0x22f822){if(!_0x22f822){_0x5cc1dd[_0x804b('0x18')](0x194);}return _0x22f822;};}function handleError(_0xe145e,_0x3d1ecc){_0x3d1ecc=_0x3d1ecc||0x1f4;return function(_0x4a6079){logger[_0x804b('0x27')](_0x4a6079[_0x804b('0x28')]);if(_0x4a6079[_0x804b('0x29')]){delete _0x4a6079['name'];}_0xe145e[_0x804b('0x19')](_0x3d1ecc)[_0x804b('0x2a')](_0x4a6079);};}exports[_0x804b('0x2b')]=function(_0x57b8da,_0x408857){var _0x471c04={},_0x5e8f85={},_0x391376={'count':0x0,'rows':[]};var _0x37dd3e=_[_0x804b('0x2c')](db[_0x804b('0x2d')][_0x804b('0x2e')],function(_0x241c96){return{'name':_0x241c96['fieldName'],'type':_0x241c96[_0x804b('0x2f')][_0x804b('0x30')]};});_0x5e8f85[_0x804b('0x31')]=_[_0x804b('0x2c')](_0x37dd3e,_0x804b('0x29'));_0x5e8f85[_0x804b('0x32')]=_[_0x804b('0x33')](_0x57b8da[_0x804b('0x32')]);_0x5e8f85[_0x804b('0x34')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],_0x5e8f85[_0x804b('0x32')]);_0x471c04[_0x804b('0x36')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],qs[_0x804b('0x37')](_0x57b8da[_0x804b('0x32')][_0x804b('0x37')]));_0x471c04[_0x804b('0x36')]=_0x471c04[_0x804b('0x36')][_0x804b('0x38')]?_0x471c04[_0x804b('0x36')]:_0x5e8f85[_0x804b('0x31')];if(!_0x57b8da[_0x804b('0x32')][_0x804b('0x39')]('nolimit')){_0x471c04['limit']=qs['limit'](_0x57b8da[_0x804b('0x32')][_0x804b('0x1d')]);_0x471c04[_0x804b('0x1c')]=qs['offset'](_0x57b8da['query']['offset']);}_0x471c04[_0x804b('0x3a')]=qs[_0x804b('0x3b')](_0x57b8da[_0x804b('0x32')][_0x804b('0x3b')]);_0x471c04[_0x804b('0x3c')]=qs[_0x804b('0x34')](_[_0x804b('0x3d')](_0x57b8da[_0x804b('0x32')],_0x5e8f85[_0x804b('0x34')]),_0x37dd3e);if(_0x57b8da[_0x804b('0x32')][_0x804b('0x3e')]){_0x471c04[_0x804b('0x3c')]=_[_0x804b('0x3f')](_0x471c04['where'],{'$or':_[_0x804b('0x2c')](_0x37dd3e,function(_0x4654f4){if(_0x4654f4[_0x804b('0x2f')]!==_0x804b('0x40')){var _0x62cfee={};_0x62cfee[_0x4654f4['name']]={'$like':'%'+_0x57b8da['query'][_0x804b('0x3e')]+'%'};return _0x62cfee;}})});}_0x471c04=_[_0x804b('0x3f')]({},_0x471c04,_0x57b8da[_0x804b('0x41')]);var _0x5206f9={'where':_0x471c04[_0x804b('0x3c')]};return db['Tag'][_0x804b('0x1f')](_0x5206f9)[_0x804b('0x24')](function(_0x20ccc7){_0x391376[_0x804b('0x1f')]=_0x20ccc7;if(_0x57b8da[_0x804b('0x32')][_0x804b('0x42')]){_0x471c04[_0x804b('0x43')]=[{'all':!![]}];}return db['Tag'][_0x804b('0x44')](_0x471c04);})[_0x804b('0x24')](function(_0x1dcec8){_0x391376[_0x804b('0x45')]=_0x1dcec8;return _0x391376;})['then'](respondWithFilteredResult(_0x408857,_0x471c04))[_0x804b('0x46')](handleError(_0x408857,null));};exports[_0x804b('0x47')]=function(_0x1df519,_0x1c3d93){var _0x320aeb={'raw':!![],'where':{'id':_0x1df519[_0x804b('0x48')]['id']}},_0xbca498={};_0xbca498[_0x804b('0x31')]=_['keys'](db[_0x804b('0x2d')]['rawAttributes']);_0xbca498['query']=_['keys'](_0x1df519[_0x804b('0x32')]);_0xbca498['filters']=_[_0x804b('0x35')](_0xbca498[_0x804b('0x31')],_0xbca498[_0x804b('0x32')]);_0x320aeb[_0x804b('0x36')]=_['intersection'](_0xbca498[_0x804b('0x31')],qs[_0x804b('0x37')](_0x1df519[_0x804b('0x32')]['fields']));_0x320aeb[_0x804b('0x36')]=_0x320aeb[_0x804b('0x36')][_0x804b('0x38')]?_0x320aeb['attributes']:_0xbca498[_0x804b('0x31')];if(_0x1df519[_0x804b('0x32')][_0x804b('0x42')]){_0x320aeb[_0x804b('0x43')]=[{'all':!![]}];}_0x320aeb=_[_0x804b('0x3f')]({},_0x320aeb,_0x1df519[_0x804b('0x41')]);return db[_0x804b('0x2d')][_0x804b('0x49')](_0x320aeb)[_0x804b('0x24')](handleEntityNotFound(_0x1c3d93,null))[_0x804b('0x24')](respondWithResult(_0x1c3d93,null))[_0x804b('0x46')](handleError(_0x1c3d93,null));};exports[_0x804b('0x4a')]=function(_0x20862f,_0x2c1796){return db['Tag']['create'](_0x20862f[_0x804b('0x4b')],{})[_0x804b('0x24')](function(_0x82fc71){var _0x53124f=_0x20862f[_0x804b('0x4c')]['get']({'plain':!![]});if(!_0x53124f)throw new Error(_0x804b('0x4d'));if(_0x53124f[_0x804b('0x4e')]===_0x804b('0x4c')){var _0x3ca9ff=_0x82fc71[_0x804b('0x4f')]({'plain':!![]});var _0x111e3f='Tags';return db['UserProfileSection'][_0x804b('0x49')]({'where':{'name':_0x111e3f,'userProfileId':_0x53124f[_0x804b('0x50')]},'raw':!![]})['then'](function(_0x5103b7){if(_0x5103b7&&_0x5103b7[_0x804b('0x51')]===0x0){return db[_0x804b('0x52')][_0x804b('0x4a')]({'name':_0x3ca9ff['name'],'resourceId':_0x3ca9ff['id'],'type':_0x5103b7[_0x804b('0x29')],'sectionId':_0x5103b7['id']},{})[_0x804b('0x24')](function(){return _0x82fc71;});}else{return _0x82fc71;}})['catch'](function(_0x2756de){logger['error'](_0x804b('0x53'),_0x2756de);throw _0x2756de;});}return _0x82fc71;})['then'](respondWithResult(_0x2c1796,0xc9))[_0x804b('0x46')](handleError(_0x2c1796,null));};exports[_0x804b('0x54')]=function(_0x47c835,_0x2f9360){if(_0x47c835['body']['id']){delete _0x47c835[_0x804b('0x4b')]['id'];}return db[_0x804b('0x2d')][_0x804b('0x49')]({'where':{'id':_0x47c835[_0x804b('0x48')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x2f9360,null))[_0x804b('0x24')](saveUpdates(_0x47c835[_0x804b('0x4b')],null))[_0x804b('0x24')](respondWithResult(_0x2f9360,null))[_0x804b('0x46')](handleError(_0x2f9360,null));};exports[_0x804b('0x25')]=function(_0x5d53f9,_0x53b91d){return db[_0x804b('0x2d')]['find']({'where':{'id':_0x5d53f9['params']['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x53b91d,null))[_0x804b('0x24')](removeEntity(_0x53b91d,null))[_0x804b('0x46')](handleError(_0x53b91d,null));}; \ No newline at end of file +var _0xbec5=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','name','send','index','map','Tag','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','sort','pick','filter','where','options','includeAll','include','catch','show','merge','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','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0x1eb841,_0x255fa5){var _0x3297ed=function(_0xbd61e9){while(--_0xbd61e9){_0x1eb841['push'](_0x1eb841['shift']());}};_0x3297ed(++_0x255fa5);}(_0xbec5,0xe5));var _0x5bec=function(_0x318256,_0xa773f3){_0x318256=_0x318256-0x0;var _0xb1e352=_0xbec5[_0x318256];return _0xb1e352;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];function respondWithStatusCode(_0x1c888f,_0x589d14){_0x589d14=_0x589d14||0xcc;return function(_0x2d2ba2){if(_0x2d2ba2){return _0x1c888f[_0x5bec('0x19')](_0x589d14);}return _0x1c888f[_0x5bec('0x1a')](_0x589d14)[_0x5bec('0x1b')]();};}function respondWithResult(_0x3198e0,_0xcd6d90){_0xcd6d90=_0xcd6d90||0xc8;return function(_0x24dcd6){if(_0x24dcd6){return _0x3198e0[_0x5bec('0x1a')](_0xcd6d90)[_0x5bec('0x1c')](_0x24dcd6);}};}function respondWithFilteredResult(_0x3ebc41,_0x31b9e4){return function(_0x325daf){if(_0x325daf){var _0x11fb8e=typeof _0x31b9e4['offset']==='undefined'&&typeof _0x31b9e4[_0x5bec('0x1d')]===_0x5bec('0x1e');var _0x31ad9c=_0x325daf[_0x5bec('0x1f')];var _0x5cd7ae=_0x11fb8e?0x0:_0x31b9e4['offset'];var _0x3cd354=_0x11fb8e?_0x325daf[_0x5bec('0x1f')]:_0x31b9e4['offset']+_0x31b9e4[_0x5bec('0x1d')];var _0xa7e223;if(_0x3cd354>=_0x31ad9c){_0x3cd354=_0x31ad9c;_0xa7e223=0xc8;}else{_0xa7e223=0xce;}_0x3ebc41[_0x5bec('0x1a')](_0xa7e223);return _0x3ebc41[_0x5bec('0x20')]('Content-Range',_0x5cd7ae+'-'+_0x3cd354+'/'+_0x31ad9c)[_0x5bec('0x1c')](_0x325daf);}return null;};}function patchUpdates(_0x5be91c){return function(_0x191c0f){try{jsonpatch[_0x5bec('0x21')](_0x191c0f,_0x5be91c,!![]);}catch(_0x3e1896){return BPromise[_0x5bec('0x22')](_0x3e1896);}return _0x191c0f[_0x5bec('0x23')]();};}function saveUpdates(_0x5e154e,_0x232584){return function(_0x4cfcb8){if(_0x4cfcb8){return _0x4cfcb8[_0x5bec('0x24')](_0x5e154e)[_0x5bec('0x25')](function(_0x5b2636){return _0x5b2636;});}return null;};}function removeEntity(_0xa414f8,_0xbef70b){return function(_0x4e0ca2){if(_0x4e0ca2){return _0x4e0ca2[_0x5bec('0x26')]()[_0x5bec('0x25')](function(){var _0x43d460=_0x4e0ca2[_0x5bec('0x27')]({'plain':!![]});var _0x226d55=_0x5bec('0x28');return db[_0x5bec('0x29')]['destroy']({'where':{'type':_0x226d55,'resourceId':_0x43d460['id']}})['then'](function(){return _0x4e0ca2;});})['then'](function(){_0xa414f8[_0x5bec('0x1a')](0xcc)[_0x5bec('0x1b')]();});}};}function handleEntityNotFound(_0x338c25,_0x4939a5){return function(_0x2b3b2c){if(!_0x2b3b2c){_0x338c25[_0x5bec('0x19')](0x194);}return _0x2b3b2c;};}function handleError(_0x57331b,_0x29e358){_0x29e358=_0x29e358||0x1f4;return function(_0x63ac8){logger['error'](_0x63ac8['stack']);if(_0x63ac8[_0x5bec('0x2a')]){delete _0x63ac8[_0x5bec('0x2a')];}_0x57331b[_0x5bec('0x1a')](_0x29e358)[_0x5bec('0x2b')](_0x63ac8);};}exports[_0x5bec('0x2c')]=function(_0x3f224c,_0x5d6621){var _0x2987ca={},_0x59b5b6={},_0x45863b={'count':0x0,'rows':[]};var _0xafbd94=_[_0x5bec('0x2d')](db[_0x5bec('0x2e')]['rawAttributes'],function(_0x2b42c8){return{'name':_0x2b42c8[_0x5bec('0x2f')],'type':_0x2b42c8[_0x5bec('0x30')]['key']};});_0x59b5b6[_0x5bec('0x31')]=_['map'](_0xafbd94,_0x5bec('0x2a'));_0x59b5b6[_0x5bec('0x32')]=_[_0x5bec('0x33')](_0x3f224c['query']);_0x59b5b6[_0x5bec('0x34')]=_[_0x5bec('0x35')](_0x59b5b6['model'],_0x59b5b6[_0x5bec('0x32')]);_0x2987ca[_0x5bec('0x36')]=_[_0x5bec('0x35')](_0x59b5b6[_0x5bec('0x31')],qs[_0x5bec('0x37')](_0x3f224c['query'][_0x5bec('0x37')]));_0x2987ca['attributes']=_0x2987ca[_0x5bec('0x36')][_0x5bec('0x38')]?_0x2987ca[_0x5bec('0x36')]:_0x59b5b6[_0x5bec('0x31')];if(!_0x3f224c[_0x5bec('0x32')][_0x5bec('0x39')]('nolimit')){_0x2987ca[_0x5bec('0x1d')]=qs[_0x5bec('0x1d')](_0x3f224c[_0x5bec('0x32')]['limit']);_0x2987ca[_0x5bec('0x3a')]=qs[_0x5bec('0x3a')](_0x3f224c['query'][_0x5bec('0x3a')]);}_0x2987ca['order']=qs[_0x5bec('0x3b')](_0x3f224c[_0x5bec('0x32')][_0x5bec('0x3b')]);_0x2987ca['where']=qs[_0x5bec('0x34')](_[_0x5bec('0x3c')](_0x3f224c[_0x5bec('0x32')],_0x59b5b6[_0x5bec('0x34')]),_0xafbd94);if(_0x3f224c[_0x5bec('0x32')][_0x5bec('0x3d')]){_0x2987ca[_0x5bec('0x3e')]=_['merge'](_0x2987ca[_0x5bec('0x3e')],{'$or':_[_0x5bec('0x2d')](_0xafbd94,function(_0x323812){if(_0x323812[_0x5bec('0x30')]!=='VIRTUAL'){var _0x27863b={};_0x27863b[_0x323812[_0x5bec('0x2a')]]={'$like':'%'+_0x3f224c[_0x5bec('0x32')]['filter']+'%'};return _0x27863b;}})});}_0x2987ca=_['merge']({},_0x2987ca,_0x3f224c[_0x5bec('0x3f')]);var _0x153d02={'where':_0x2987ca[_0x5bec('0x3e')]};return db[_0x5bec('0x2e')][_0x5bec('0x1f')](_0x153d02)['then'](function(_0x4fee8a){_0x45863b[_0x5bec('0x1f')]=_0x4fee8a;if(_0x3f224c['query'][_0x5bec('0x40')]){_0x2987ca[_0x5bec('0x41')]=[{'all':!![]}];}return db[_0x5bec('0x2e')]['findAll'](_0x2987ca);})[_0x5bec('0x25')](function(_0x26a4a5){_0x45863b['rows']=_0x26a4a5;return _0x45863b;})[_0x5bec('0x25')](respondWithFilteredResult(_0x5d6621,_0x2987ca))[_0x5bec('0x42')](handleError(_0x5d6621,null));};exports[_0x5bec('0x43')]=function(_0x2b51f7,_0x3b5631){var _0x2724cf={'raw':!![],'where':{'id':_0x2b51f7['params']['id']}},_0x3a795c={};_0x3a795c['model']=_[_0x5bec('0x33')](db['Tag']['rawAttributes']);_0x3a795c[_0x5bec('0x32')]=_['keys'](_0x2b51f7['query']);_0x3a795c['filters']=_[_0x5bec('0x35')](_0x3a795c[_0x5bec('0x31')],_0x3a795c[_0x5bec('0x32')]);_0x2724cf[_0x5bec('0x36')]=_['intersection'](_0x3a795c[_0x5bec('0x31')],qs[_0x5bec('0x37')](_0x2b51f7[_0x5bec('0x32')][_0x5bec('0x37')]));_0x2724cf['attributes']=_0x2724cf[_0x5bec('0x36')][_0x5bec('0x38')]?_0x2724cf[_0x5bec('0x36')]:_0x3a795c['model'];if(_0x2b51f7[_0x5bec('0x32')]['includeAll']){_0x2724cf[_0x5bec('0x41')]=[{'all':!![]}];}_0x2724cf=_[_0x5bec('0x44')]({},_0x2724cf,_0x2b51f7[_0x5bec('0x3f')]);return db[_0x5bec('0x2e')]['find'](_0x2724cf)[_0x5bec('0x25')](handleEntityNotFound(_0x3b5631,null))[_0x5bec('0x25')](respondWithResult(_0x3b5631,null))[_0x5bec('0x42')](handleError(_0x3b5631,null));};exports[_0x5bec('0x45')]=function(_0x35b250,_0x123758){return db[_0x5bec('0x2e')]['create'](_0x35b250[_0x5bec('0x46')],{})[_0x5bec('0x25')](function(_0x5775ca){var _0x273e09=_0x35b250[_0x5bec('0x47')][_0x5bec('0x27')]({'plain':!![]});if(!_0x273e09)throw new Error(_0x5bec('0x48'));if(_0x273e09[_0x5bec('0x49')]===_0x5bec('0x47')){var _0x3545a5=_0x5775ca['get']({'plain':!![]});var _0x101dcb='Tags';return db[_0x5bec('0x4a')][_0x5bec('0x4b')]({'where':{'name':_0x101dcb,'userProfileId':_0x273e09[_0x5bec('0x4c')]},'raw':!![]})[_0x5bec('0x25')](function(_0x158e8e){if(_0x158e8e&&_0x158e8e[_0x5bec('0x4d')]===0x0){return db[_0x5bec('0x29')][_0x5bec('0x45')]({'name':_0x3545a5[_0x5bec('0x2a')],'resourceId':_0x3545a5['id'],'type':_0x158e8e[_0x5bec('0x2a')],'sectionId':_0x158e8e['id']},{})['then'](function(){return _0x5775ca;});}else{return _0x5775ca;}})[_0x5bec('0x42')](function(_0x51af88){logger['error'](_0x5bec('0x4e'),_0x51af88);throw _0x51af88;});}return _0x5775ca;})['then'](respondWithResult(_0x123758,0xc9))['catch'](handleError(_0x123758,null));};exports[_0x5bec('0x24')]=function(_0x2114e5,_0x416058){if(_0x2114e5['body']['id']){delete _0x2114e5[_0x5bec('0x46')]['id'];}return db[_0x5bec('0x2e')][_0x5bec('0x4b')]({'where':{'id':_0x2114e5[_0x5bec('0x4f')]['id']}})['then'](handleEntityNotFound(_0x416058,null))[_0x5bec('0x25')](saveUpdates(_0x2114e5[_0x5bec('0x46')],null))[_0x5bec('0x25')](respondWithResult(_0x416058,null))[_0x5bec('0x42')](handleError(_0x416058,null));};exports[_0x5bec('0x26')]=function(_0x3ddf28,_0x33b924){return db['Tag']['find']({'where':{'id':_0x3ddf28[_0x5bec('0x4f')]['id']}})['then'](handleEntityNotFound(_0x33b924,null))[_0x5bec('0x25')](removeEntity(_0x33b924,null))[_0x5bec('0x42')](handleError(_0x33b924,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 5e1d4ba..edc0b1f 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 _0x2035=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./tag.attributes','exports','Tag','lodash','util'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x2035,0x98));var _0x5203=function(_0x295106,_0x571d51){_0x295106=_0x295106-0x0;var _0x1c1320=_0x2035[_0x295106];return _0x1c1320;};'use strict';var _=require(_0x5203('0x0'));var util=require(_0x5203('0x1'));var logger=require('../../config/logger')(_0x5203('0x2'));var moment=require(_0x5203('0x3'));var BPromise=require(_0x5203('0x4'));var rp=require(_0x5203('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5203('0x6'));var config=require(_0x5203('0x7'));var attributes=require(_0x5203('0x8'));module[_0x5203('0x9')]=function(_0x36dd7d,_0x3ef2f3){return _0x36dd7d['define'](_0x5203('0xa'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd25=['moment','bluebird','request-promise','path','rimraf','./tag.attributes','exports','define','tools_tags','lodash','api'];(function(_0xcd3806,_0x3182ad){var _0x5e3594=function(_0x12874d){while(--_0x12874d){_0xcd3806['push'](_0xcd3806['shift']());}};_0x5e3594(++_0x3182ad);}(_0xfd25,0x169));var _0x5fd2=function(_0x36e0f7,_0x84f7b4){_0x36e0f7=_0x36e0f7-0x0;var _0x1ecb4d=_0xfd25[_0x36e0f7];return _0x1ecb4d;};'use strict';var _=require(_0x5fd2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5fd2('0x1'));var moment=require(_0x5fd2('0x2'));var BPromise=require(_0x5fd2('0x3'));var rp=require(_0x5fd2('0x4'));var fs=require('fs');var path=require(_0x5fd2('0x5'));var rimraf=require(_0x5fd2('0x6'));var config=require('../../config/environment');var attributes=require(_0x5fd2('0x7'));module[_0x5fd2('0x8')]=function(_0x31ddb3,_0xbee3e){return _0x31ddb3[_0x5fd2('0x9')]('Tag',attributes,{'tableName':_0x5fd2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 7f52669..cdfebde 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 _0x50a6=['../../config/environment','http','then','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ee563,_0x190bd3){var _0x3f1c70=function(_0x1e24bf){while(--_0x1e24bf){_0x3ee563['push'](_0x3ee563['shift']());}};_0x3f1c70(++_0x190bd3);}(_0x50a6,0xa4));var _0x650a=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0x50a6[_0x1ebd10];return _0x1004d3;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x650a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x650a('0x3'))['db'];var utils=require(_0x650a('0x4'));var logger=require(_0x650a('0x5'))('rpc');var config=require(_0x650a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x650a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d1bb4,_0x2c22b9,_0x61618a){return new BPromise(function(_0x56d38f,_0x25366e){return client['request'](_0x2d1bb4,_0x61618a)[_0x650a('0x8')](function(_0x1e4796){logger['info'](_0x650a('0x9'),_0x2c22b9,_0x650a('0xa'));logger['debug'](_0x650a('0xb'),_0x2c22b9,'request\x20sent',JSON[_0x650a('0xc')](_0x1e4796));if(_0x1e4796['error']){if(_0x1e4796[_0x650a('0xd')]['code']===0x1f4){logger[_0x650a('0xd')]('Tag,\x20%s,\x20%s',_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x25366e(_0x1e4796[_0x650a('0xd')]['message']);}logger[_0x650a('0xd')](_0x650a('0x9'),_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x56d38f(_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);}else{logger['info'](_0x650a('0x9'),_0x2c22b9,'request\x20sent');_0x56d38f(_0x1e4796[_0x650a('0xf')][_0x650a('0xe')]);}})[_0x650a('0x10')](function(_0x5d9c92){logger['error']('Tag,\x20%s,\x20%s',_0x2c22b9,_0x5d9c92);_0x25366e(_0x5d9c92);});});} \ No newline at end of file +var _0x7f42=['message','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e937a,_0x332c6b){var _0x55c2e9=function(_0xb13833){while(--_0xb13833){_0x1e937a['push'](_0x1e937a['shift']());}};_0x55c2e9(++_0x332c6b);}(_0x7f42,0x1dd));var _0x27f4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7f42[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x27f4('0x0'));var util=require('util');var moment=require(_0x27f4('0x1'));var BPromise=require(_0x27f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27f4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x27f4('0x4'));var logger=require('../../config/logger')(_0x27f4('0x5'));var config=require('../../config/environment');var jayson=require(_0x27f4('0x6'));var client=jayson['client'][_0x27f4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a85f2,_0xd283e2,_0x3010e3){return new BPromise(function(_0x2a4b6f,_0x9bc56e){return client[_0x27f4('0x8')](_0x1a85f2,_0x3010e3)[_0x27f4('0x9')](function(_0xe67021){logger[_0x27f4('0xa')](_0x27f4('0xb'),_0xd283e2,_0x27f4('0xc'));logger[_0x27f4('0xd')](_0x27f4('0xe'),_0xd283e2,_0x27f4('0xc'),JSON[_0x27f4('0xf')](_0xe67021));if(_0xe67021[_0x27f4('0x10')]){if(_0xe67021[_0x27f4('0x10')]['code']===0x1f4){logger['error'](_0x27f4('0xb'),_0xd283e2,_0xe67021[_0x27f4('0x10')][_0x27f4('0x11')]);return _0x9bc56e(_0xe67021[_0x27f4('0x10')][_0x27f4('0x11')]);}logger[_0x27f4('0x10')](_0x27f4('0xb'),_0xd283e2,_0xe67021[_0x27f4('0x10')]['message']);return _0x2a4b6f(_0xe67021['error'][_0x27f4('0x11')]);}else{logger[_0x27f4('0xa')](_0x27f4('0xb'),_0xd283e2,_0x27f4('0xc'));_0x2a4b6f(_0xe67021['result'][_0x27f4('0x11')]);}})[_0x27f4('0x12')](function(_0x321821){logger['error'](_0x27f4('0xb'),_0xd283e2,_0x321821);_0x9bc56e(_0x321821);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 968ad3f..561084e 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(_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('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 0057854..5784180 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 _0xbaf0=['name','exports','STRING'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_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 _0x757a=['exports','STRING'];(function(_0x4b1f2d,_0x1a9828){var _0x3bb740=function(_0x21c2b8){while(--_0x21c2b8){_0x4b1f2d['push'](_0x4b1f2d['shift']());}};_0x3bb740(++_0x1a9828);}(_0x757a,0xde));var _0xa757=function(_0x8d12bd,_0x5d6847){_0x8d12bd=_0x8d12bd-0x0;var _0xc4feee=_0x757a[_0x8d12bd];return _0xc4feee;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 8a54ae7..a156860 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 _0xb317=['../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','filter','options','include','findAll','rows','show','params','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','sequelize','transaction','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','destroy','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','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','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','channel','add','Queues','ids','removeQueues','remove','Voice','Mail','Sms','Openchannel','Whatsapp','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','all','addAgents','spread','removeAgents','Chat','Fax','user','getAgents','findOne','hasOwnProperty','eml-format','rimraf','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/advancedSearch'];(function(_0x5a4413,_0xa74e04){var _0x41c8c1=function(_0x19c4b6){while(--_0x19c4b6){_0x5a4413['push'](_0x5a4413['shift']());}};_0x41c8c1(++_0xa74e04);}(_0xb317,0x1c0));var _0x7b31=function(_0x53e1e4,_0x26e697){_0x53e1e4=_0x53e1e4-0x0;var _0x758d0e=_0xb317[_0x53e1e4];return _0x758d0e;};'use strict';var emlformat=require(_0x7b31('0x0'));var rimraf=require(_0x7b31('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7b31('0x2'));var moment=require(_0x7b31('0x3'));var BPromise=require(_0x7b31('0x4'));var Mustache=require(_0x7b31('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7b31('0x6'));var csv=require(_0x7b31('0x7'));var ejs=require(_0x7b31('0x8'));var fs=require('fs');var fs_extra=require(_0x7b31('0x9'));var _=require(_0x7b31('0xa'));var squel=require(_0x7b31('0xb'));var crypto=require(_0x7b31('0xc'));var jsforce=require(_0x7b31('0xd'));var deskjs=require(_0x7b31('0xe'));var toCsv=require(_0x7b31('0x7'));var querystring=require(_0x7b31('0xf'));var Papa=require(_0x7b31('0x10'));var Redis=require(_0x7b31('0x11'));var authService=require(_0x7b31('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7b31('0x13'));var hardwareService=require(_0x7b31('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7b31('0x15'));var licenseUtil=require(_0x7b31('0x16'));var db=require(_0x7b31('0x17'))['db'];config['redis']=_[_0x7b31('0x18')](config[_0x7b31('0x19')],{'host':_0x7b31('0x1a'),'port':0x18eb});var socket=require(_0x7b31('0x1b'))(new Redis(config[_0x7b31('0x19')]));require(_0x7b31('0x1c'))[_0x7b31('0x1d')](socket);function respondWithStatusCode(_0x397655,_0x2d38c3){_0x2d38c3=_0x2d38c3||0xcc;return function(_0x22b254){if(_0x22b254){return _0x397655[_0x7b31('0x1e')](_0x2d38c3);}return _0x397655['status'](_0x2d38c3)[_0x7b31('0x1f')]();};}function respondWithResult(_0x370b8c,_0x532d40){_0x532d40=_0x532d40||0xc8;return function(_0xdfa663){if(_0xdfa663){return _0x370b8c[_0x7b31('0x20')](_0x532d40)[_0x7b31('0x21')](_0xdfa663);}};}function respondWithFilteredResult(_0x144e51,_0x316303){return function(_0x4b47ca){if(_0x4b47ca){var _0x830c2=typeof _0x316303['offset']===_0x7b31('0x22')&&typeof _0x316303[_0x7b31('0x23')]===_0x7b31('0x22');var _0x176dc1=_0x4b47ca['count'];var _0xb50f88=_0x830c2?0x0:_0x316303[_0x7b31('0x24')];var _0x43f651=_0x830c2?_0x4b47ca['count']:_0x316303[_0x7b31('0x24')]+_0x316303[_0x7b31('0x23')];var _0x5d2fce;if(_0x43f651>=_0x176dc1){_0x43f651=_0x176dc1;_0x5d2fce=0xc8;}else{_0x5d2fce=0xce;}_0x144e51[_0x7b31('0x20')](_0x5d2fce);return _0x144e51[_0x7b31('0x25')](_0x7b31('0x26'),_0xb50f88+'-'+_0x43f651+'/'+_0x176dc1)[_0x7b31('0x21')](_0x4b47ca);}return null;};}function patchUpdates(_0x550ef6){return function(_0x479cf7){try{jsonpatch[_0x7b31('0x27')](_0x479cf7,_0x550ef6,!![]);}catch(_0x53a80a){return BPromise[_0x7b31('0x28')](_0x53a80a);}return _0x479cf7[_0x7b31('0x29')]();};}function saveUpdates(_0x384be8,_0x3fb0f2){return function(_0x138251){if(_0x138251){return _0x138251[_0x7b31('0x2a')](_0x384be8)[_0x7b31('0x2b')](function(_0x5f4af3){return _0x5f4af3;});}return null;};}function handleEntityNotFound(_0x1d25ce,_0x190e5f){return function(_0x3d4e22){if(!_0x3d4e22){_0x1d25ce['sendStatus'](0x194);}return _0x3d4e22;};}function handleError(_0x206699,_0x892be){_0x892be=_0x892be||0x1f4;return function(_0xb857f2){logger[_0x7b31('0x2c')](_0xb857f2[_0x7b31('0x2d')]);if(_0xb857f2['name']){delete _0xb857f2[_0x7b31('0x2e')];}_0x206699[_0x7b31('0x20')](_0x892be)[_0x7b31('0x2f')](_0xb857f2);};}exports[_0x7b31('0x30')]=function(_0x3fb82b,_0x55e122){var _0x5974c7={},_0x33c255={},_0x54c346={'count':0x0,'rows':[]};var _0x52388b=_[_0x7b31('0x31')](db[_0x7b31('0x32')][_0x7b31('0x33')],function(_0x289167){return{'name':_0x289167[_0x7b31('0x34')],'type':_0x289167['type'][_0x7b31('0x35')]};});_0x33c255[_0x7b31('0x36')]=_['map'](_0x52388b,_0x7b31('0x2e'));_0x33c255[_0x7b31('0x37')]=_[_0x7b31('0x38')](_0x3fb82b[_0x7b31('0x37')]);_0x33c255[_0x7b31('0x39')]=_[_0x7b31('0x3a')](_0x33c255['model'],_0x33c255[_0x7b31('0x37')]);_0x5974c7[_0x7b31('0x3b')]=_[_0x7b31('0x3a')](_0x33c255[_0x7b31('0x36')],qs[_0x7b31('0x3c')](_0x3fb82b[_0x7b31('0x37')]['fields']));_0x5974c7['attributes']=_0x5974c7['attributes'][_0x7b31('0x3d')]?_0x5974c7[_0x7b31('0x3b')]:_0x33c255['model'];if(!_0x3fb82b[_0x7b31('0x37')]['hasOwnProperty'](_0x7b31('0x3e'))){_0x5974c7[_0x7b31('0x23')]=qs[_0x7b31('0x23')](_0x3fb82b[_0x7b31('0x37')][_0x7b31('0x23')]);_0x5974c7[_0x7b31('0x24')]=qs[_0x7b31('0x24')](_0x3fb82b['query']['offset']);}_0x5974c7[_0x7b31('0x3f')]=qs['sort'](_0x3fb82b[_0x7b31('0x37')][_0x7b31('0x40')]);_0x5974c7[_0x7b31('0x41')]=qs[_0x7b31('0x39')](_[_0x7b31('0x42')](_0x3fb82b['query'],_0x33c255[_0x7b31('0x39')]),_0x52388b);if(_0x3fb82b[_0x7b31('0x37')]['filter']){_0x5974c7[_0x7b31('0x41')]=_[_0x7b31('0x43')](_0x5974c7[_0x7b31('0x41')],{'$or':_[_0x7b31('0x31')](_0x52388b,function(_0x4a052a){if(_0x4a052a[_0x7b31('0x44')]!=='VIRTUAL'){var _0x42eeac={};_0x42eeac[_0x4a052a[_0x7b31('0x2e')]]={'$like':'%'+_0x3fb82b[_0x7b31('0x37')][_0x7b31('0x45')]+'%'};return _0x42eeac;}})});}_0x5974c7=_['merge']({},_0x5974c7,_0x3fb82b[_0x7b31('0x46')]);var _0x20d373={'where':_0x5974c7[_0x7b31('0x41')]};return db[_0x7b31('0x32')]['count'](_0x20d373)[_0x7b31('0x2b')](function(_0x12b2b0){_0x54c346['count']=_0x12b2b0;if(_0x3fb82b[_0x7b31('0x37')]['includeAll']){_0x5974c7[_0x7b31('0x47')]=[{'all':!![]}];}return db[_0x7b31('0x32')][_0x7b31('0x48')](_0x5974c7);})[_0x7b31('0x2b')](function(_0x3ad8d5){_0x54c346[_0x7b31('0x49')]=_0x3ad8d5;return _0x54c346;})[_0x7b31('0x2b')](respondWithFilteredResult(_0x55e122,_0x5974c7))['catch'](handleError(_0x55e122,null));};exports[_0x7b31('0x4a')]=function(_0x51959c,_0x3243bc){var _0x3116fa={'raw':![],'where':{'id':_0x51959c[_0x7b31('0x4b')]['id']}},_0xb89f3a={};_0xb89f3a[_0x7b31('0x36')]=_[_0x7b31('0x38')](db[_0x7b31('0x32')][_0x7b31('0x33')]);_0xb89f3a[_0x7b31('0x37')]=_[_0x7b31('0x38')](_0x51959c['query']);_0xb89f3a[_0x7b31('0x39')]=_[_0x7b31('0x3a')](_0xb89f3a['model'],_0xb89f3a['query']);_0x3116fa[_0x7b31('0x3b')]=_['intersection'](_0xb89f3a['model'],qs['fields'](_0x51959c[_0x7b31('0x37')][_0x7b31('0x3c')]));_0x3116fa['attributes']=_0x3116fa[_0x7b31('0x3b')][_0x7b31('0x3d')]?_0x3116fa[_0x7b31('0x3b')]:_0xb89f3a['model'];if(_0x51959c[_0x7b31('0x37')]['includeAll']){_0x3116fa[_0x7b31('0x47')]=[{'all':!![]}];}_0x3116fa=_[_0x7b31('0x43')]({},_0x3116fa,_0x51959c[_0x7b31('0x46')]);return db[_0x7b31('0x32')]['find'](_0x3116fa)['then'](handleEntityNotFound(_0x3243bc,null))[_0x7b31('0x2b')](respondWithResult(_0x3243bc,null))[_0x7b31('0x4c')](handleError(_0x3243bc,null));};exports[_0x7b31('0x4d')]=function(_0x112657,_0x243372){return db[_0x7b31('0x32')][_0x7b31('0x4d')](_0x112657[_0x7b31('0x4e')],{})[_0x7b31('0x2b')](function(_0x7110c4){var _0x5de551=_0x112657['user'][_0x7b31('0x4f')]({'plain':!![]});if(!_0x5de551)throw new Error(_0x7b31('0x50'));if(_0x5de551[_0x7b31('0x51')]==='user'){var _0x2aeafd=_0x7110c4[_0x7b31('0x4f')]({'plain':!![]});var _0x4fa289=_0x7b31('0x52');return db[_0x7b31('0x53')]['find']({'where':{'name':_0x4fa289,'userProfileId':_0x5de551[_0x7b31('0x54')]},'raw':!![]})[_0x7b31('0x2b')](function(_0x5dea4c){if(_0x5dea4c&&_0x5dea4c[_0x7b31('0x55')]===0x0){return db[_0x7b31('0x56')]['create']({'name':_0x2aeafd['name'],'resourceId':_0x2aeafd['id'],'type':_0x5dea4c[_0x7b31('0x2e')],'sectionId':_0x5dea4c['id']},{})[_0x7b31('0x2b')](function(){return _0x7110c4;});}else{return _0x7110c4;}})['catch'](function(_0x2a241b){logger['error'](_0x7b31('0x57'),_0x2a241b);throw _0x2a241b;});}return _0x7110c4;})[_0x7b31('0x2b')](respondWithResult(_0x243372,0xc9))[_0x7b31('0x4c')](handleError(_0x243372,null));};exports[_0x7b31('0x2a')]=function(_0x394aa5,_0x430523){if(_0x394aa5[_0x7b31('0x4e')]['id']){delete _0x394aa5[_0x7b31('0x4e')]['id'];}return db['Team'][_0x7b31('0x58')]({'where':{'id':_0x394aa5['params']['id']}})[_0x7b31('0x2b')](handleEntityNotFound(_0x430523,null))['then'](saveUpdates(_0x394aa5[_0x7b31('0x4e')],null))['then'](respondWithResult(_0x430523,null))[_0x7b31('0x4c')](handleError(_0x430523,null));};exports['destroy']=function(_0x5b339f,_0x34b755){var _0x31a8e8=_0x5b339f[_0x7b31('0x4b')]['id'];var _0x30d4c4=[];return db[_0x7b31('0x59')][_0x7b31('0x5a')](function(_0xad382d){var _0x1ec454='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x31a8e8;return db[_0x7b31('0x59')]['query'](_0x1ec454,{'type':db[_0x7b31('0x5b')][_0x7b31('0x5c')][_0x7b31('0x5d')],'raw':!![],'transaction':_0xad382d})['then'](function(_0x2e9c92){_0x30d4c4=_['map'](_0x2e9c92,function(_0x442b93){return Number(_0x442b93[_0x7b31('0x5e')]);});})[_0x7b31('0x2b')](function(){var _0x85ecbb=_0x7b31('0x5f')+_0x31a8e8;return db[_0x7b31('0x59')]['query'](_0x85ecbb,{'type':db[_0x7b31('0x5b')][_0x7b31('0x5c')][_0x7b31('0x5d')],'raw':!![],'transaction':_0xad382d});})[_0x7b31('0x2b')](function(_0x32c483){var _0x5f199f=_['map'](_0x32c483,function(_0x585416){return Number(_0x585416['VoiceQueueId']);});return db[_0x7b31('0x60')][_0x7b31('0x61')]({'where':{'UserId':{'$in':_0x30d4c4},'VoiceQueueId':{'$in':_0x5f199f}},'transaction':_0xad382d});})[_0x7b31('0x2b')](function(){var _0xadc8c4='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x31a8e8;return db[_0x7b31('0x59')]['query'](_0xadc8c4,{'type':db[_0x7b31('0x5b')][_0x7b31('0x5c')]['SELECT'],'raw':!![],'transaction':_0xad382d});})[_0x7b31('0x2b')](function(_0x16deb5){var _0x5c54a9=_[_0x7b31('0x31')](_0x16deb5,function(_0xe20f2d){return Number(_0xe20f2d[_0x7b31('0x62')]);});return db[_0x7b31('0x63')]['destroy']({'where':{'UserId':{'$in':_0x30d4c4},'MailQueueId':{'$in':_0x5c54a9}},'transaction':_0xad382d});})['then'](function(){var _0x54c0d6=_0x7b31('0x64')+_0x31a8e8;return db[_0x7b31('0x59')][_0x7b31('0x37')](_0x54c0d6,{'type':db[_0x7b31('0x5b')][_0x7b31('0x5c')]['SELECT'],'raw':!![],'transaction':_0xad382d});})[_0x7b31('0x2b')](function(_0x1bc030){var _0x2a532e=_[_0x7b31('0x31')](_0x1bc030,function(_0x1f550b){return Number(_0x1f550b[_0x7b31('0x65')]);});return db[_0x7b31('0x66')]['destroy']({'where':{'UserId':{'$in':_0x30d4c4},'SmsQueueId':{'$in':_0x2a532e}},'transaction':_0xad382d});})[_0x7b31('0x2b')](function(){var _0x9d7d37=_0x7b31('0x67')+_0x31a8e8;return db[_0x7b31('0x59')][_0x7b31('0x37')](_0x9d7d37,{'type':db['Sequelize'][_0x7b31('0x5c')]['SELECT'],'raw':!![],'transaction':_0xad382d});})['then'](function(_0x1c4133){var _0x17616a=_['map'](_0x1c4133,function(_0x1ddca9){return Number(_0x1ddca9['ChatQueueId']);});return db['UserChatQueue'][_0x7b31('0x61')]({'where':{'UserId':{'$in':_0x30d4c4},'ChatQueueId':{'$in':_0x17616a}},'transaction':_0xad382d});})[_0x7b31('0x2b')](function(){var _0x1f9b4c=_0x7b31('0x68')+_0x31a8e8;return db[_0x7b31('0x59')]['query'](_0x1f9b4c,{'type':db[_0x7b31('0x5b')][_0x7b31('0x5c')][_0x7b31('0x5d')],'raw':!![],'transaction':_0xad382d});})['then'](function(_0x58194c){var _0x4085ec=_[_0x7b31('0x31')](_0x58194c,function(_0x1adfdb){return Number(_0x1adfdb['FaxQueueId']);});return db[_0x7b31('0x69')][_0x7b31('0x61')]({'where':{'UserId':{'$in':_0x30d4c4},'FaxQueueId':{'$in':_0x4085ec}},'transaction':_0xad382d});})[_0x7b31('0x2b')](function(){var _0x4d8ef6=_0x7b31('0x6a')+_0x31a8e8;return db[_0x7b31('0x59')][_0x7b31('0x37')](_0x4d8ef6,{'type':db[_0x7b31('0x5b')][_0x7b31('0x5c')][_0x7b31('0x5d')],'raw':!![],'transaction':_0xad382d});})[_0x7b31('0x2b')](function(_0x1af20b){var _0x5c5b22=_['map'](_0x1af20b,function(_0x5cced8){return Number(_0x5cced8[_0x7b31('0x6b')]);});return db[_0x7b31('0x6c')][_0x7b31('0x61')]({'where':{'UserId':{'$in':_0x30d4c4},'OpenchannelQueueId':{'$in':_0x5c5b22}},'transaction':_0xad382d});})['then'](function(){var _0x553a05=_0x7b31('0x6d')+_0x31a8e8;return db[_0x7b31('0x59')][_0x7b31('0x37')](_0x553a05,{'type':db[_0x7b31('0x5b')]['QueryTypes'][_0x7b31('0x5d')],'raw':!![],'transaction':_0xad382d});})[_0x7b31('0x2b')](function(_0x25c26d){var _0x2b8eda=_['map'](_0x25c26d,function(_0x4966fe){return Number(_0x4966fe[_0x7b31('0x6e')]);});return db[_0x7b31('0x6f')][_0x7b31('0x61')]({'where':{'UserId':{'$in':_0x30d4c4},'WhatsappQueueId':{'$in':_0x2b8eda}},'transaction':_0xad382d});})[_0x7b31('0x2b')](function(){return db[_0x7b31('0x70')][_0x7b31('0x58')]({'where':{'TeamId':_0x31a8e8}});})[_0x7b31('0x2b')](function(_0x301ac4){if(_0x301ac4===null){return;}return db[_0x7b31('0x71')]['destroy']({'where':{'UserId':{'$in':_0x30d4c4},'VoicePrefixId':_0x301ac4[_0x7b31('0x72')]},'transaction':_0xad382d});})['then'](function(){return db[_0x7b31('0x32')]['destroy']({'where':{'id':_0x31a8e8},'cascade':!![],'transaction':_0xad382d});})[_0x7b31('0x2b')](function(_0x308fa2){if(_0x308fa2===0x0){_0x34b755['sendStatus'](0x194);}else{return db[_0x7b31('0x56')]['destroy']({'where':{'type':_0x7b31('0x52'),'resourceId':_0x31a8e8},'cascade':!![],'transaction':_0xad382d})[_0x7b31('0x2b')](function(){_0x34b755['status'](0xcc)['end']();});}})[_0x7b31('0x4c')](function(_0x1f5041){_0x34b755[_0x7b31('0x20')](0x1f4)['send'](_0x1f5041);});});};exports['getQueues']=function(_0x17e4ef,_0x134a5d,_0x245f86){return db[_0x7b31('0x32')]['findOne']({'where':{'id':_0x17e4ef[_0x7b31('0x4b')]['id']}})[_0x7b31('0x2b')](handleEntityNotFound(_0x134a5d,null))[_0x7b31('0x2b')](function(_0x5d7ebc){if(!_0x17e4ef['query']['channel']||!utils[_0x7b31('0x73')](_0x17e4ef[_0x7b31('0x37')]['channel'])){throw new db['Sequelize'][(_0x7b31('0x74'))](_0x7b31('0x75'));}var _0x20204e={};var _0x141921={};_0x141921[_0x7b31('0x36')]=_[_0x7b31('0x38')](db[_[_0x7b31('0x76')](_0x17e4ef['query']['channel'][_0x7b31('0x77')]())+'Queue'][_0x7b31('0x33')]);_0x141921[_0x7b31('0x37')]=_[_0x7b31('0x38')](_0x17e4ef[_0x7b31('0x37')]);_0x141921[_0x7b31('0x39')]=_['intersection'](_0x141921['model'],_0x141921[_0x7b31('0x37')]);_0x20204e[_0x7b31('0x3b')]=_[_0x7b31('0x3a')](_0x141921[_0x7b31('0x36')],qs[_0x7b31('0x3c')](_0x17e4ef['query'][_0x7b31('0x3c')]));_0x20204e[_0x7b31('0x3b')]=_0x20204e[_0x7b31('0x3b')][_0x7b31('0x3d')]?_0x20204e['attributes']:_0x141921[_0x7b31('0x36')];_0x20204e['limit']=qs[_0x7b31('0x23')](_0x17e4ef[_0x7b31('0x37')][_0x7b31('0x23')]);_0x20204e[_0x7b31('0x24')]=qs['offset'](_0x17e4ef[_0x7b31('0x37')][_0x7b31('0x24')]);_0x20204e['order']=qs['sort'](_0x17e4ef['query']['sort']);_0x20204e[_0x7b31('0x41')]=qs[_0x7b31('0x39')](_[_0x7b31('0x42')](_0x17e4ef['query'],_0x141921[_0x7b31('0x39')]));_0x20204e=_[_0x7b31('0x43')]({},_0x20204e,_0x17e4ef[_0x7b31('0x46')]);return _0x5d7ebc[_0x7b31('0x4f')+_[_0x7b31('0x76')](_0x17e4ef[_0x7b31('0x37')]['channel'][_0x7b31('0x77')]())+'Queues'](_0x20204e);})[_0x7b31('0x2b')](respondWithResult(_0x134a5d,null))[_0x7b31('0x4c')](handleError(_0x134a5d,null));};exports['addQueues']=function(_0xfc1f75,_0x238d73,_0x3c08c0){return db[_0x7b31('0x32')]['findOne']({'where':{'id':_0xfc1f75[_0x7b31('0x4b')]['id']}})['then'](function(_0x139323){if(_0x139323){if(!_0xfc1f75[_0x7b31('0x4e')][_0x7b31('0x78')]||!utils[_0x7b31('0x73')](_0xfc1f75['body'][_0x7b31('0x78')])){throw new db[(_0x7b31('0x5b'))][(_0x7b31('0x74'))](_0x7b31('0x75'));}return _0x139323[_0x7b31('0x79')+_[_0x7b31('0x76')](_0xfc1f75[_0x7b31('0x4e')][_0x7b31('0x78')][_0x7b31('0x77')]())+_0x7b31('0x7a')](_0xfc1f75[_0x7b31('0x4e')][_0x7b31('0x7b')]);}return null;})[_0x7b31('0x2b')](handleEntityNotFound(_0x238d73,null))[_0x7b31('0x2b')](respondWithStatusCode(_0x238d73,null))[_0x7b31('0x4c')](handleError(_0x238d73,null));};exports[_0x7b31('0x7c')]=function(_0x312308,_0x1dd04a,_0x336bf0){return db[_0x7b31('0x32')]['findOne']({'where':{'id':_0x312308[_0x7b31('0x4b')]['id']}})[_0x7b31('0x2b')](function(_0x4a8f30){if(_0x4a8f30){if(!_0x312308['query']['channel']||!utils[_0x7b31('0x73')](_0x312308['query'][_0x7b31('0x78')])){throw new db['Sequelize'][(_0x7b31('0x74'))]('Unknown\x20channel');}return _0x4a8f30[_0x7b31('0x7d')+_['capitalize'](_0x312308['query'][_0x7b31('0x78')][_0x7b31('0x77')]())+_0x7b31('0x7a')](_0x312308[_0x7b31('0x37')]['ids']);}return null;})['then'](handleEntityNotFound(_0x1dd04a,null))[_0x7b31('0x2b')](respondWithStatusCode(_0x1dd04a,null))[_0x7b31('0x4c')](handleError(_0x1dd04a,null));};exports['addAgents']=function(_0x3edb72,_0x528e52){var _0x2e28e9=_['isArray'](_0x3edb72[_0x7b31('0x4e')]['ids'])?_0x3edb72[_0x7b31('0x4e')][_0x7b31('0x7b')]:[_0x3edb72['body']['ids']];var _0x99d056=_0x3edb72['params']['id'];return db[_0x7b31('0x32')][_0x7b31('0x58')]({'where':{'id':_0x99d056}})[_0x7b31('0x2b')](handleEntityNotFound(_0x528e52,null))[_0x7b31('0x2b')](function(_0x31bf53){if(_0x31bf53){var _0x2eaa16=[_0x7b31('0x7e'),'Chat',_0x7b31('0x7f'),_0x7b31('0x80'),'Fax',_0x7b31('0x81'),_0x7b31('0x82')];return db[_0x7b31('0x59')][_0x7b31('0x5a')](function(_0x5dc348){var _0x267d50=_[_0x7b31('0x31')](_0x2eaa16,function(_0x79e1e3){var _0x5bfb8b={'attributes':['id',_0x7b31('0x2e')]};if(_0x79e1e3===_0x7b31('0x7e')){_0x5bfb8b[_0x7b31('0x83')]={'attributes':['penalty']};}return _0x31bf53[_0x7b31('0x4f')+_0x79e1e3+_0x7b31('0x7a')](_0x5bfb8b)[_0x7b31('0x2b')](function(_0x3c6f12){var _0x2177c2=_['map'](_0x3c6f12,function(_0x51bd70){var _0x6b9647=_[_0x7b31('0x31')](_0x2e28e9,function(_0x1ca482){var _0x540cdb={'where':{'UserId':_0x1ca482,[_0x79e1e3+_0x7b31('0x84')]:_0x51bd70['id']},'transaction':_0x5dc348};if(_0x79e1e3==='Voice'){_0x540cdb['defaults']={'penalty':_0x51bd70[_0x7b31('0x85')][_0x7b31('0x86')]};}return db[_0x7b31('0x87')+_0x79e1e3+'Queue'][_0x7b31('0x88')](_0x540cdb)['then'](function(){socket[_0x7b31('0x89')]('user'+_0x79e1e3+_0x7b31('0x8a'),{'UserId':_0x1ca482,[_0x79e1e3+'QueueId']:_0x51bd70['id']});if(_0x79e1e3!==_0x7b31('0x7e')){return;}return db['User'][_0x7b31('0x48')]({'where':{'id':_0x2e28e9,'online':0x1},'attributes':['id',_0x7b31('0x2e'),_0x7b31('0x8b'),_0x7b31('0x8c'),_0x7b31('0x8d')],'raw':!![]})['then'](function(_0xc5fcde){var _0x4796f6=_[_0x7b31('0x31')](_0xc5fcde,function(_0x456a46){return db[_0x7b31('0x8e')][_0x7b31('0x8f')]({'membername':_0x456a46[_0x7b31('0x2e')],'UserId':_0x456a46['id'],'queue_name':_0x51bd70['name'],'VoiceQueueId':_0x51bd70['id'],'interface':_[_0x7b31('0x90')](_0x456a46['interface'])?util['format'](_0x7b31('0x91'),_0x456a46['name']):_0x456a46[_0x7b31('0x8d')],'paused':_0x456a46[_0x7b31('0x8c')]||![],'penalty':_0x51bd70[_0x7b31('0x85')][_0x7b31('0x86')]},{'transaction':_0x5dc348});});return Promise[_0x7b31('0x92')](_0x4796f6);});});});return Promise[_0x7b31('0x92')](_0x6b9647);});return Promise[_0x7b31('0x92')](_0x2177c2);})['then'](function(){return db[_0x7b31('0x70')]['findOne']({'where':{'teamId':_0x99d056}})[_0x7b31('0x2b')](function(_0x59ae0f){if(_0x59ae0f){var _0x2a9971=_['map'](_0x2e28e9,function(_0x524956){db[_0x7b31('0x71')][_0x7b31('0x8f')]({'UserId':_0x524956,'VoicePrefixId':_0x59ae0f[_0x7b31('0x72')]});});return Promise[_0x7b31('0x92')](_0x2a9971);}});});});return Promise['all'](_0x267d50)['then'](function(){return _0x31bf53[_0x7b31('0x93')](_0x2e28e9,{'transaction':_0x5dc348})[_0x7b31('0x94')](function(_0x4806bc){return _0x4806bc;});});});}})[_0x7b31('0x2b')](respondWithResult(_0x528e52,null))[_0x7b31('0x4c')](handleError(_0x528e52,null));};exports[_0x7b31('0x95')]=function(_0x31e197,_0x2c917b){var _0x539d51=_['isArray'](_0x31e197[_0x7b31('0x37')]['ids'])?_0x31e197[_0x7b31('0x37')][_0x7b31('0x7b')]:[_0x31e197[_0x7b31('0x37')]['ids']];var _0x13b402=_0x31e197[_0x7b31('0x4b')]['id'];return db[_0x7b31('0x32')]['find']({'where':{'id':_0x13b402}})[_0x7b31('0x2b')](handleEntityNotFound(_0x2c917b,null))[_0x7b31('0x2b')](function(_0x19943f){if(_0x19943f){var _0x432fa6=[_0x7b31('0x7e'),_0x7b31('0x96'),_0x7b31('0x7f'),_0x7b31('0x80'),_0x7b31('0x97'),_0x7b31('0x81'),'Whatsapp'];return db[_0x7b31('0x59')][_0x7b31('0x5a')](function(_0x166a4e){var _0x245f41=_[_0x7b31('0x31')](_0x432fa6,function(_0x7564f){var _0x5284d4={'attributes':['id',_0x7b31('0x2e')]};return _0x19943f[_0x7b31('0x4f')+_0x7564f+_0x7b31('0x7a')](_0x5284d4)['then'](function(_0x2991a6){var _0x5e64f4=_[_0x7b31('0x31')](_0x2991a6,function(_0x52ac17){return _0x52ac17[_0x7b31('0x95')](_0x539d51,{'transaction':_0x166a4e})[_0x7b31('0x2b')](function(){var _0x4cc219=_[_0x7b31('0x31')](_0x539d51,function(_0x245cef){socket[_0x7b31('0x89')](_0x7b31('0x98')+_0x7564f+'Queue:remove',{'UserId':Number(_0x245cef),[_0x7564f+'QueueId']:_0x52ac17['id']});if(_0x7564f!==_0x7b31('0x7e')){return;}return db[_0x7b31('0x8e')][_0x7b31('0x61')]({'where':{'VoiceQueueId':_0x52ac17['id'],'UserId':_0x245cef},'transaction':_0x166a4e});});return Promise[_0x7b31('0x92')](_0x4cc219);});});return Promise[_0x7b31('0x92')](_0x5e64f4);});});return Promise[_0x7b31('0x92')](_0x245f41)[_0x7b31('0x2b')](function(){return _0x19943f['removeAgents'](_0x539d51,{'transaction':_0x166a4e});})[_0x7b31('0x2b')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x13b402}})['then'](function(_0x1e7dee){if(_0x1e7dee){var _0x6942c8=_[_0x7b31('0x31')](_0x539d51,function(_0x3e3600){db[_0x7b31('0x71')][_0x7b31('0x61')]({'where':{'UserId':_0x3e3600,'VoicePrefixId':_0x1e7dee[_0x7b31('0x72')]}});});return Promise[_0x7b31('0x92')](_0x6942c8);}});});});}})['then'](respondWithStatusCode(_0x2c917b,null))[_0x7b31('0x4c')](handleError(_0x2c917b,null));};exports[_0x7b31('0x99')]=function(_0x35edf5,_0x610cca,_0x6d04e0){var _0x21560c={};var _0x4de048={};var _0x57b867;var _0x2f05ea;return db[_0x7b31('0x32')][_0x7b31('0x9a')]({'where':{'id':_0x35edf5[_0x7b31('0x4b')]['id']}})[_0x7b31('0x2b')](handleEntityNotFound(_0x610cca,null))[_0x7b31('0x2b')](function(_0x5e5c79){if(_0x5e5c79){_0x57b867=_0x5e5c79;_0x4de048[_0x7b31('0x36')]=_[_0x7b31('0x38')](db['User'][_0x7b31('0x33')]);_0x4de048[_0x7b31('0x37')]=_[_0x7b31('0x38')](_0x35edf5['query']);_0x4de048[_0x7b31('0x39')]=_[_0x7b31('0x3a')](_0x4de048[_0x7b31('0x36')],_0x4de048[_0x7b31('0x37')]);_0x21560c[_0x7b31('0x3b')]=_['intersection'](_0x4de048['model'],qs['fields'](_0x35edf5[_0x7b31('0x37')]['fields']));_0x21560c[_0x7b31('0x3b')]=_0x21560c[_0x7b31('0x3b')][_0x7b31('0x3d')]?_0x21560c[_0x7b31('0x3b')]:_0x4de048['model'];_0x21560c['order']=qs['sort'](_0x35edf5['query'][_0x7b31('0x40')]);_0x21560c[_0x7b31('0x41')]=qs[_0x7b31('0x39')](_[_0x7b31('0x42')](_0x35edf5[_0x7b31('0x37')],_0x4de048[_0x7b31('0x39')]));if(_0x35edf5[_0x7b31('0x37')][_0x7b31('0x45')]){_0x21560c[_0x7b31('0x41')]=_[_0x7b31('0x43')](_0x21560c[_0x7b31('0x41')],{'$or':_[_0x7b31('0x31')](_0x21560c[_0x7b31('0x3b')],function(_0x57070a){var _0x431dc4={};_0x431dc4[_0x57070a]={'$like':'%'+_0x35edf5['query']['filter']+'%'};return _0x431dc4;})});}_0x21560c=_[_0x7b31('0x43')]({},_0x21560c,_0x35edf5[_0x7b31('0x46')]);return _0x57b867[_0x7b31('0x99')](_0x21560c);}})['then'](function(_0x3583c0){if(_0x3583c0){_0x2f05ea=_0x3583c0[_0x7b31('0x3d')];if(!_0x35edf5['query'][_0x7b31('0x9b')](_0x7b31('0x3e'))){_0x21560c[_0x7b31('0x23')]=qs[_0x7b31('0x23')](_0x35edf5[_0x7b31('0x37')]['limit']);_0x21560c[_0x7b31('0x24')]=qs['offset'](_0x35edf5[_0x7b31('0x37')][_0x7b31('0x24')]);}return _0x57b867['getAgents'](_0x21560c);}})['then'](function(_0x340003){if(_0x340003){return _0x340003?{'count':_0x2f05ea,'rows':_0x340003}:null;}})[_0x7b31('0x2b')](respondWithResult(_0x610cca,null))[_0x7b31('0x4c')](handleError(_0x610cca,null));}; \ No newline at end of file +var _0xab67=['limit','count','set','Content-Range','apply','save','error','stack','name','send','index','Team','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','destroy','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','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','UserProfileResource','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queue','order','addQueues','Unknown\x20channel','add','Queues','ids','remove','addAgents','isArray','find','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','emit','Queue:save','upsert','isNil','interface','format','SIP/%s','voicePause','all','removeAgents','Mail','Queue:remove','VoicePrefixId','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','json','offset','undefined'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xab67,0x109));var _0x7ab6=function(_0x2a8860,_0x2da926){_0x2a8860=_0x2a8860-0x0;var _0x2f47a4=_0xab67[_0x2a8860];return _0x2f47a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ab6('0x0'));var zipdir=require(_0x7ab6('0x1'));var jsonpatch=require(_0x7ab6('0x2'));var rp=require(_0x7ab6('0x3'));var moment=require('moment');var BPromise=require(_0x7ab6('0x4'));var Mustache=require(_0x7ab6('0x5'));var util=require(_0x7ab6('0x6'));var path=require('path');var sox=require(_0x7ab6('0x7'));var csv=require(_0x7ab6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ab6('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ab6('0xa'));var deskjs=require(_0x7ab6('0xb'));var toCsv=require(_0x7ab6('0x8'));var querystring=require(_0x7ab6('0xc'));var Papa=require(_0x7ab6('0xd'));var Redis=require(_0x7ab6('0xe'));var authService=require(_0x7ab6('0xf'));var qs=require(_0x7ab6('0x10'));var as=require(_0x7ab6('0x11'));var hardwareService=require(_0x7ab6('0x12'));var logger=require(_0x7ab6('0x13'))(_0x7ab6('0x14'));var utils=require('../../config/utils');var config=require(_0x7ab6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7ab6('0x16')]=_[_0x7ab6('0x17')](config['redis'],{'host':_0x7ab6('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7ab6('0x16')]));require(_0x7ab6('0x19'))[_0x7ab6('0x1a')](socket);function respondWithStatusCode(_0x23f9e3,_0x578f5e){_0x578f5e=_0x578f5e||0xcc;return function(_0x4b1b38){if(_0x4b1b38){return _0x23f9e3[_0x7ab6('0x1b')](_0x578f5e);}return _0x23f9e3[_0x7ab6('0x1c')](_0x578f5e)[_0x7ab6('0x1d')]();};}function respondWithResult(_0x586ef1,_0x1174ad){_0x1174ad=_0x1174ad||0xc8;return function(_0x57f5a9){if(_0x57f5a9){return _0x586ef1[_0x7ab6('0x1c')](_0x1174ad)[_0x7ab6('0x1e')](_0x57f5a9);}};}function respondWithFilteredResult(_0xef6f8d,_0xa54680){return function(_0x3a1260){if(_0x3a1260){var _0x58f66d=typeof _0xa54680[_0x7ab6('0x1f')]===_0x7ab6('0x20')&&typeof _0xa54680[_0x7ab6('0x21')]===_0x7ab6('0x20');var _0x1a023f=_0x3a1260['count'];var _0x4cf672=_0x58f66d?0x0:_0xa54680[_0x7ab6('0x1f')];var _0x1a2f3b=_0x58f66d?_0x3a1260[_0x7ab6('0x22')]:_0xa54680[_0x7ab6('0x1f')]+_0xa54680[_0x7ab6('0x21')];var _0x52a9bc;if(_0x1a2f3b>=_0x1a023f){_0x1a2f3b=_0x1a023f;_0x52a9bc=0xc8;}else{_0x52a9bc=0xce;}_0xef6f8d[_0x7ab6('0x1c')](_0x52a9bc);return _0xef6f8d[_0x7ab6('0x23')](_0x7ab6('0x24'),_0x4cf672+'-'+_0x1a2f3b+'/'+_0x1a023f)['json'](_0x3a1260);}return null;};}function patchUpdates(_0x54b522){return function(_0x14c993){try{jsonpatch[_0x7ab6('0x25')](_0x14c993,_0x54b522,!![]);}catch(_0xfc80b3){return BPromise['reject'](_0xfc80b3);}return _0x14c993[_0x7ab6('0x26')]();};}function saveUpdates(_0x50777f,_0x336bdf){return function(_0x2c2f2f){if(_0x2c2f2f){return _0x2c2f2f['update'](_0x50777f)['then'](function(_0x1aef87){return _0x1aef87;});}return null;};}function handleEntityNotFound(_0x522757,_0x215129){return function(_0x36d371){if(!_0x36d371){_0x522757[_0x7ab6('0x1b')](0x194);}return _0x36d371;};}function handleError(_0x4436d4,_0x355313){_0x355313=_0x355313||0x1f4;return function(_0x1d6496){logger[_0x7ab6('0x27')](_0x1d6496[_0x7ab6('0x28')]);if(_0x1d6496[_0x7ab6('0x29')]){delete _0x1d6496[_0x7ab6('0x29')];}_0x4436d4[_0x7ab6('0x1c')](_0x355313)[_0x7ab6('0x2a')](_0x1d6496);};}exports[_0x7ab6('0x2b')]=function(_0x413889,_0x55b07b){var _0x39cd8e={},_0x5f4087={},_0x11e29a={'count':0x0,'rows':[]};var _0x45d33e=_['map'](db[_0x7ab6('0x2c')][_0x7ab6('0x2d')],function(_0x591428){return{'name':_0x591428[_0x7ab6('0x2e')],'type':_0x591428[_0x7ab6('0x2f')][_0x7ab6('0x30')]};});_0x5f4087[_0x7ab6('0x31')]=_[_0x7ab6('0x32')](_0x45d33e,_0x7ab6('0x29'));_0x5f4087['query']=_[_0x7ab6('0x33')](_0x413889[_0x7ab6('0x34')]);_0x5f4087[_0x7ab6('0x35')]=_[_0x7ab6('0x36')](_0x5f4087['model'],_0x5f4087[_0x7ab6('0x34')]);_0x39cd8e[_0x7ab6('0x37')]=_['intersection'](_0x5f4087[_0x7ab6('0x31')],qs['fields'](_0x413889[_0x7ab6('0x34')][_0x7ab6('0x38')]));_0x39cd8e['attributes']=_0x39cd8e['attributes'][_0x7ab6('0x39')]?_0x39cd8e['attributes']:_0x5f4087['model'];if(!_0x413889[_0x7ab6('0x34')][_0x7ab6('0x3a')](_0x7ab6('0x3b'))){_0x39cd8e[_0x7ab6('0x21')]=qs[_0x7ab6('0x21')](_0x413889[_0x7ab6('0x34')]['limit']);_0x39cd8e[_0x7ab6('0x1f')]=qs[_0x7ab6('0x1f')](_0x413889[_0x7ab6('0x34')][_0x7ab6('0x1f')]);}_0x39cd8e['order']=qs[_0x7ab6('0x3c')](_0x413889['query'][_0x7ab6('0x3c')]);_0x39cd8e['where']=qs['filters'](_[_0x7ab6('0x3d')](_0x413889[_0x7ab6('0x34')],_0x5f4087[_0x7ab6('0x35')]),_0x45d33e);if(_0x413889['query'][_0x7ab6('0x3e')]){_0x39cd8e[_0x7ab6('0x3f')]=_[_0x7ab6('0x40')](_0x39cd8e[_0x7ab6('0x3f')],{'$or':_[_0x7ab6('0x32')](_0x45d33e,function(_0x2c7552){if(_0x2c7552[_0x7ab6('0x2f')]!==_0x7ab6('0x41')){var _0x5a775c={};_0x5a775c[_0x2c7552[_0x7ab6('0x29')]]={'$like':'%'+_0x413889[_0x7ab6('0x34')][_0x7ab6('0x3e')]+'%'};return _0x5a775c;}})});}_0x39cd8e=_['merge']({},_0x39cd8e,_0x413889[_0x7ab6('0x42')]);var _0x422672={'where':_0x39cd8e[_0x7ab6('0x3f')]};return db[_0x7ab6('0x2c')][_0x7ab6('0x22')](_0x422672)[_0x7ab6('0x43')](function(_0x1dedbc){_0x11e29a[_0x7ab6('0x22')]=_0x1dedbc;if(_0x413889[_0x7ab6('0x34')][_0x7ab6('0x44')]){_0x39cd8e[_0x7ab6('0x45')]=[{'all':!![]}];}return db['Team'][_0x7ab6('0x46')](_0x39cd8e);})[_0x7ab6('0x43')](function(_0x1cef89){_0x11e29a[_0x7ab6('0x47')]=_0x1cef89;return _0x11e29a;})[_0x7ab6('0x43')](respondWithFilteredResult(_0x55b07b,_0x39cd8e))[_0x7ab6('0x48')](handleError(_0x55b07b,null));};exports[_0x7ab6('0x49')]=function(_0x44aba8,_0x26d45d){var _0x4de9c3={'raw':![],'where':{'id':_0x44aba8[_0x7ab6('0x4a')]['id']}},_0x44b5fe={};_0x44b5fe[_0x7ab6('0x31')]=_[_0x7ab6('0x33')](db[_0x7ab6('0x2c')][_0x7ab6('0x2d')]);_0x44b5fe['query']=_[_0x7ab6('0x33')](_0x44aba8[_0x7ab6('0x34')]);_0x44b5fe[_0x7ab6('0x35')]=_[_0x7ab6('0x36')](_0x44b5fe[_0x7ab6('0x31')],_0x44b5fe[_0x7ab6('0x34')]);_0x4de9c3[_0x7ab6('0x37')]=_['intersection'](_0x44b5fe['model'],qs[_0x7ab6('0x38')](_0x44aba8['query']['fields']));_0x4de9c3[_0x7ab6('0x37')]=_0x4de9c3[_0x7ab6('0x37')]['length']?_0x4de9c3[_0x7ab6('0x37')]:_0x44b5fe[_0x7ab6('0x31')];if(_0x44aba8[_0x7ab6('0x34')][_0x7ab6('0x44')]){_0x4de9c3['include']=[{'all':!![]}];}_0x4de9c3=_['merge']({},_0x4de9c3,_0x44aba8[_0x7ab6('0x42')]);return db[_0x7ab6('0x2c')]['find'](_0x4de9c3)['then'](handleEntityNotFound(_0x26d45d,null))[_0x7ab6('0x43')](respondWithResult(_0x26d45d,null))[_0x7ab6('0x48')](handleError(_0x26d45d,null));};exports[_0x7ab6('0x4b')]=function(_0x77f98c,_0x4bf980){return db[_0x7ab6('0x2c')]['create'](_0x77f98c[_0x7ab6('0x4c')],{})['then'](function(_0x4fc689){var _0x4671bd=_0x77f98c[_0x7ab6('0x4d')][_0x7ab6('0x4e')]({'plain':!![]});if(!_0x4671bd)throw new Error(_0x7ab6('0x4f'));if(_0x4671bd['role']==='user'){var _0x37145a=_0x4fc689['get']({'plain':!![]});var _0x1d1458='Teams';return db[_0x7ab6('0x50')]['find']({'where':{'name':_0x1d1458,'userProfileId':_0x4671bd[_0x7ab6('0x51')]},'raw':!![]})[_0x7ab6('0x43')](function(_0x100bc3){if(_0x100bc3&&_0x100bc3[_0x7ab6('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x37145a['name'],'resourceId':_0x37145a['id'],'type':_0x100bc3[_0x7ab6('0x29')],'sectionId':_0x100bc3['id']},{})[_0x7ab6('0x43')](function(){return _0x4fc689;});}else{return _0x4fc689;}})[_0x7ab6('0x48')](function(_0x48671c){logger[_0x7ab6('0x27')](_0x7ab6('0x53'),_0x48671c);throw _0x48671c;});}return _0x4fc689;})[_0x7ab6('0x43')](respondWithResult(_0x4bf980,0xc9))[_0x7ab6('0x48')](handleError(_0x4bf980,null));};exports[_0x7ab6('0x54')]=function(_0x30131a,_0x2ecd3c){if(_0x30131a[_0x7ab6('0x4c')]['id']){delete _0x30131a[_0x7ab6('0x4c')]['id'];}return db[_0x7ab6('0x2c')]['find']({'where':{'id':_0x30131a['params']['id']}})[_0x7ab6('0x43')](handleEntityNotFound(_0x2ecd3c,null))['then'](saveUpdates(_0x30131a['body'],null))[_0x7ab6('0x43')](respondWithResult(_0x2ecd3c,null))[_0x7ab6('0x48')](handleError(_0x2ecd3c,null));};exports['destroy']=function(_0x8150b1,_0x1a0eb7){var _0x1d608a=_0x8150b1[_0x7ab6('0x4a')]['id'];var _0x4fd2cf=[];return db[_0x7ab6('0x55')][_0x7ab6('0x56')](function(_0x525419){var _0x226985=_0x7ab6('0x57')+_0x1d608a;return db[_0x7ab6('0x55')][_0x7ab6('0x34')](_0x226985,{'type':db[_0x7ab6('0x58')][_0x7ab6('0x59')][_0x7ab6('0x5a')],'raw':!![],'transaction':_0x525419})[_0x7ab6('0x43')](function(_0x5dfe03){_0x4fd2cf=_['map'](_0x5dfe03,function(_0x448499){return Number(_0x448499['UserId']);});})['then'](function(){var _0x51a7a3=_0x7ab6('0x5b')+_0x1d608a;return db[_0x7ab6('0x55')][_0x7ab6('0x34')](_0x51a7a3,{'type':db[_0x7ab6('0x58')]['QueryTypes'][_0x7ab6('0x5a')],'raw':!![],'transaction':_0x525419});})[_0x7ab6('0x43')](function(_0x4b87f3){var _0x28f09d=_[_0x7ab6('0x32')](_0x4b87f3,function(_0x28ce04){return Number(_0x28ce04[_0x7ab6('0x5c')]);});return db['UserVoiceQueue'][_0x7ab6('0x5d')]({'where':{'UserId':{'$in':_0x4fd2cf},'VoiceQueueId':{'$in':_0x28f09d}},'transaction':_0x525419});})[_0x7ab6('0x43')](function(){var _0x1e67a7='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1d608a;return db[_0x7ab6('0x55')][_0x7ab6('0x34')](_0x1e67a7,{'type':db['Sequelize'][_0x7ab6('0x59')][_0x7ab6('0x5a')],'raw':!![],'transaction':_0x525419});})[_0x7ab6('0x43')](function(_0x536461){var _0x3885b6=_[_0x7ab6('0x32')](_0x536461,function(_0x51db66){return Number(_0x51db66['MailQueueId']);});return db[_0x7ab6('0x5e')][_0x7ab6('0x5d')]({'where':{'UserId':{'$in':_0x4fd2cf},'MailQueueId':{'$in':_0x3885b6}},'transaction':_0x525419});})['then'](function(){var _0x56e325=_0x7ab6('0x5f')+_0x1d608a;return db[_0x7ab6('0x55')][_0x7ab6('0x34')](_0x56e325,{'type':db[_0x7ab6('0x58')][_0x7ab6('0x59')][_0x7ab6('0x5a')],'raw':!![],'transaction':_0x525419});})[_0x7ab6('0x43')](function(_0x39ee8c){var _0x33311e=_[_0x7ab6('0x32')](_0x39ee8c,function(_0x156a47){return Number(_0x156a47['SmsQueueId']);});return db[_0x7ab6('0x60')][_0x7ab6('0x5d')]({'where':{'UserId':{'$in':_0x4fd2cf},'SmsQueueId':{'$in':_0x33311e}},'transaction':_0x525419});})['then'](function(){var _0x16eb50=_0x7ab6('0x61')+_0x1d608a;return db['sequelize']['query'](_0x16eb50,{'type':db[_0x7ab6('0x58')][_0x7ab6('0x59')][_0x7ab6('0x5a')],'raw':!![],'transaction':_0x525419});})[_0x7ab6('0x43')](function(_0xbdad0e){var _0x3987f2=_[_0x7ab6('0x32')](_0xbdad0e,function(_0x455baf){return Number(_0x455baf[_0x7ab6('0x62')]);});return db['UserChatQueue'][_0x7ab6('0x5d')]({'where':{'UserId':{'$in':_0x4fd2cf},'ChatQueueId':{'$in':_0x3987f2}},'transaction':_0x525419});})[_0x7ab6('0x43')](function(){var _0x32d1c8='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1d608a;return db['sequelize']['query'](_0x32d1c8,{'type':db[_0x7ab6('0x58')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x525419});})['then'](function(_0x1864fa){var _0x3deaed=_[_0x7ab6('0x32')](_0x1864fa,function(_0x258cef){return Number(_0x258cef[_0x7ab6('0x63')]);});return db['UserFaxQueue'][_0x7ab6('0x5d')]({'where':{'UserId':{'$in':_0x4fd2cf},'FaxQueueId':{'$in':_0x3deaed}},'transaction':_0x525419});})['then'](function(){var _0xd096e9=_0x7ab6('0x64')+_0x1d608a;return db[_0x7ab6('0x55')][_0x7ab6('0x34')](_0xd096e9,{'type':db['Sequelize'][_0x7ab6('0x59')][_0x7ab6('0x5a')],'raw':!![],'transaction':_0x525419});})[_0x7ab6('0x43')](function(_0x53aeb6){var _0x30ac87=_[_0x7ab6('0x32')](_0x53aeb6,function(_0xcea99f){return Number(_0xcea99f['OpenchannelQueueId']);});return db[_0x7ab6('0x65')][_0x7ab6('0x5d')]({'where':{'UserId':{'$in':_0x4fd2cf},'OpenchannelQueueId':{'$in':_0x30ac87}},'transaction':_0x525419});})[_0x7ab6('0x43')](function(){var _0x3fabd3=_0x7ab6('0x66')+_0x1d608a;return db[_0x7ab6('0x55')][_0x7ab6('0x34')](_0x3fabd3,{'type':db[_0x7ab6('0x58')][_0x7ab6('0x59')]['SELECT'],'raw':!![],'transaction':_0x525419});})[_0x7ab6('0x43')](function(_0x5cc694){var _0xee3b68=_[_0x7ab6('0x32')](_0x5cc694,function(_0x53759c){return Number(_0x53759c[_0x7ab6('0x67')]);});return db['UserWhatsappQueue'][_0x7ab6('0x5d')]({'where':{'UserId':{'$in':_0x4fd2cf},'WhatsappQueueId':{'$in':_0xee3b68}},'transaction':_0x525419});})['then'](function(){return db[_0x7ab6('0x68')]['find']({'where':{'TeamId':_0x1d608a}});})[_0x7ab6('0x43')](function(_0x10a7b0){if(_0x10a7b0===null){return;}return db[_0x7ab6('0x69')][_0x7ab6('0x5d')]({'where':{'UserId':{'$in':_0x4fd2cf},'VoicePrefixId':_0x10a7b0['VoicePrefixId']},'transaction':_0x525419});})[_0x7ab6('0x43')](function(){return db[_0x7ab6('0x2c')][_0x7ab6('0x5d')]({'where':{'id':_0x1d608a},'cascade':!![],'transaction':_0x525419});})['then'](function(_0x542fbf){if(_0x542fbf===0x0){_0x1a0eb7[_0x7ab6('0x1b')](0x194);}else{return db[_0x7ab6('0x6a')][_0x7ab6('0x5d')]({'where':{'type':'Teams','resourceId':_0x1d608a},'cascade':!![],'transaction':_0x525419})[_0x7ab6('0x43')](function(){_0x1a0eb7[_0x7ab6('0x1c')](0xcc)[_0x7ab6('0x1d')]();});}})['catch'](function(_0x565ecb){_0x1a0eb7[_0x7ab6('0x1c')](0x1f4)['send'](_0x565ecb);});});};exports['getQueues']=function(_0x1c352e,_0x422243,_0x426d33){return db[_0x7ab6('0x2c')][_0x7ab6('0x6b')]({'where':{'id':_0x1c352e[_0x7ab6('0x4a')]['id']}})[_0x7ab6('0x43')](handleEntityNotFound(_0x422243,null))[_0x7ab6('0x43')](function(_0x551e0d){if(!_0x1c352e[_0x7ab6('0x34')][_0x7ab6('0x6c')]||!utils[_0x7ab6('0x6d')](_0x1c352e[_0x7ab6('0x34')][_0x7ab6('0x6c')])){throw new db[(_0x7ab6('0x58'))][(_0x7ab6('0x6e'))]('Unknown\x20channel');}var _0xe32ae3={};var _0x4533da={};_0x4533da[_0x7ab6('0x31')]=_[_0x7ab6('0x33')](db[_[_0x7ab6('0x6f')](_0x1c352e[_0x7ab6('0x34')][_0x7ab6('0x6c')][_0x7ab6('0x70')]())+_0x7ab6('0x71')][_0x7ab6('0x2d')]);_0x4533da['query']=_[_0x7ab6('0x33')](_0x1c352e[_0x7ab6('0x34')]);_0x4533da[_0x7ab6('0x35')]=_[_0x7ab6('0x36')](_0x4533da['model'],_0x4533da[_0x7ab6('0x34')]);_0xe32ae3[_0x7ab6('0x37')]=_[_0x7ab6('0x36')](_0x4533da[_0x7ab6('0x31')],qs[_0x7ab6('0x38')](_0x1c352e['query']['fields']));_0xe32ae3['attributes']=_0xe32ae3[_0x7ab6('0x37')][_0x7ab6('0x39')]?_0xe32ae3[_0x7ab6('0x37')]:_0x4533da['model'];_0xe32ae3['limit']=qs[_0x7ab6('0x21')](_0x1c352e['query']['limit']);_0xe32ae3[_0x7ab6('0x1f')]=qs[_0x7ab6('0x1f')](_0x1c352e[_0x7ab6('0x34')][_0x7ab6('0x1f')]);_0xe32ae3[_0x7ab6('0x72')]=qs[_0x7ab6('0x3c')](_0x1c352e[_0x7ab6('0x34')][_0x7ab6('0x3c')]);_0xe32ae3[_0x7ab6('0x3f')]=qs[_0x7ab6('0x35')](_[_0x7ab6('0x3d')](_0x1c352e[_0x7ab6('0x34')],_0x4533da['filters']));_0xe32ae3=_[_0x7ab6('0x40')]({},_0xe32ae3,_0x1c352e[_0x7ab6('0x42')]);return _0x551e0d['get'+_[_0x7ab6('0x6f')](_0x1c352e[_0x7ab6('0x34')][_0x7ab6('0x6c')][_0x7ab6('0x70')]())+'Queues'](_0xe32ae3);})[_0x7ab6('0x43')](respondWithResult(_0x422243,null))['catch'](handleError(_0x422243,null));};exports[_0x7ab6('0x73')]=function(_0x3313ca,_0x339de8,_0x48a5e1){return db[_0x7ab6('0x2c')][_0x7ab6('0x6b')]({'where':{'id':_0x3313ca[_0x7ab6('0x4a')]['id']}})['then'](function(_0x45118c){if(_0x45118c){if(!_0x3313ca[_0x7ab6('0x4c')]['channel']||!utils['isValidChannel'](_0x3313ca[_0x7ab6('0x4c')][_0x7ab6('0x6c')])){throw new db[(_0x7ab6('0x58'))][(_0x7ab6('0x6e'))](_0x7ab6('0x74'));}return _0x45118c[_0x7ab6('0x75')+_[_0x7ab6('0x6f')](_0x3313ca[_0x7ab6('0x4c')][_0x7ab6('0x6c')]['toLowerCase']())+_0x7ab6('0x76')](_0x3313ca[_0x7ab6('0x4c')][_0x7ab6('0x77')]);}return null;})[_0x7ab6('0x43')](handleEntityNotFound(_0x339de8,null))[_0x7ab6('0x43')](respondWithStatusCode(_0x339de8,null))[_0x7ab6('0x48')](handleError(_0x339de8,null));};exports['removeQueues']=function(_0x247f8c,_0x3de7d5,_0x2aa213){return db[_0x7ab6('0x2c')][_0x7ab6('0x6b')]({'where':{'id':_0x247f8c['params']['id']}})[_0x7ab6('0x43')](function(_0x359fe8){if(_0x359fe8){if(!_0x247f8c[_0x7ab6('0x34')]['channel']||!utils[_0x7ab6('0x6d')](_0x247f8c[_0x7ab6('0x34')][_0x7ab6('0x6c')])){throw new db[(_0x7ab6('0x58'))][(_0x7ab6('0x6e'))]('Unknown\x20channel');}return _0x359fe8[_0x7ab6('0x78')+_[_0x7ab6('0x6f')](_0x247f8c[_0x7ab6('0x34')]['channel'][_0x7ab6('0x70')]())+_0x7ab6('0x76')](_0x247f8c[_0x7ab6('0x34')][_0x7ab6('0x77')]);}return null;})[_0x7ab6('0x43')](handleEntityNotFound(_0x3de7d5,null))['then'](respondWithStatusCode(_0x3de7d5,null))[_0x7ab6('0x48')](handleError(_0x3de7d5,null));};exports[_0x7ab6('0x79')]=function(_0x44e63f,_0x2a4a7e){var _0x159bcc=_[_0x7ab6('0x7a')](_0x44e63f['body']['ids'])?_0x44e63f[_0x7ab6('0x4c')][_0x7ab6('0x77')]:[_0x44e63f[_0x7ab6('0x4c')][_0x7ab6('0x77')]];var _0x5d9d4c=_0x44e63f[_0x7ab6('0x4a')]['id'];return db[_0x7ab6('0x2c')][_0x7ab6('0x7b')]({'where':{'id':_0x5d9d4c}})['then'](handleEntityNotFound(_0x2a4a7e,null))[_0x7ab6('0x43')](function(_0x1c7dcb){if(_0x1c7dcb){var _0x3974a0=[_0x7ab6('0x7c'),_0x7ab6('0x7d'),'Mail',_0x7ab6('0x7e'),_0x7ab6('0x7f'),_0x7ab6('0x80'),_0x7ab6('0x81')];return db[_0x7ab6('0x55')][_0x7ab6('0x56')](function(_0xa87161){var _0x54014c=_[_0x7ab6('0x32')](_0x3974a0,function(_0x319927){var _0x22e730={'attributes':['id','name']};if(_0x319927===_0x7ab6('0x7c')){_0x22e730[_0x7ab6('0x82')]={'attributes':[_0x7ab6('0x83')]};}return _0x1c7dcb[_0x7ab6('0x4e')+_0x319927+_0x7ab6('0x76')](_0x22e730)[_0x7ab6('0x43')](function(_0x142152){var _0xda7cd0=_['map'](_0x142152,function(_0x287ae8){var _0x445162=_[_0x7ab6('0x32')](_0x159bcc,function(_0x4a27fe){var _0x523cdc={'where':{'UserId':_0x4a27fe,[_0x319927+_0x7ab6('0x84')]:_0x287ae8['id']},'transaction':_0xa87161};if(_0x319927===_0x7ab6('0x7c')){_0x523cdc[_0x7ab6('0x17')]={'penalty':_0x287ae8[_0x7ab6('0x85')][_0x7ab6('0x83')]};}return db[_0x7ab6('0x86')+_0x319927+'Queue']['findOrCreate'](_0x523cdc)[_0x7ab6('0x43')](function(){socket[_0x7ab6('0x87')](_0x7ab6('0x4d')+_0x319927+_0x7ab6('0x88'),{'UserId':_0x4a27fe,[_0x319927+'QueueId']:_0x287ae8['id']});if(_0x319927!==_0x7ab6('0x7c')){return;}return db[_0x7ab6('0x86')][_0x7ab6('0x46')]({'where':{'id':_0x159bcc,'online':0x1},'attributes':['id',_0x7ab6('0x29'),'online','voicePause','interface'],'raw':!![]})[_0x7ab6('0x43')](function(_0x2b745d){var _0x5c7770=_['map'](_0x2b745d,function(_0x4528d8){return db['UserVoiceQueueRt'][_0x7ab6('0x89')]({'membername':_0x4528d8[_0x7ab6('0x29')],'UserId':_0x4528d8['id'],'queue_name':_0x287ae8[_0x7ab6('0x29')],'VoiceQueueId':_0x287ae8['id'],'interface':_[_0x7ab6('0x8a')](_0x4528d8[_0x7ab6('0x8b')])?util[_0x7ab6('0x8c')](_0x7ab6('0x8d'),_0x4528d8[_0x7ab6('0x29')]):_0x4528d8['interface'],'paused':_0x4528d8[_0x7ab6('0x8e')]||![],'penalty':_0x287ae8[_0x7ab6('0x85')]['penalty']},{'transaction':_0xa87161});});return Promise['all'](_0x5c7770);});});});return Promise['all'](_0x445162);});return Promise[_0x7ab6('0x8f')](_0xda7cd0);})['then'](function(){return db[_0x7ab6('0x68')][_0x7ab6('0x6b')]({'where':{'teamId':_0x5d9d4c}})[_0x7ab6('0x43')](function(_0x224b7f){if(_0x224b7f){var _0x1e5056=_['map'](_0x159bcc,function(_0x5e2703){db[_0x7ab6('0x69')][_0x7ab6('0x89')]({'UserId':_0x5e2703,'VoicePrefixId':_0x224b7f['VoicePrefixId']});});return Promise[_0x7ab6('0x8f')](_0x1e5056);}});});});return Promise[_0x7ab6('0x8f')](_0x54014c)[_0x7ab6('0x43')](function(){return _0x1c7dcb['addAgents'](_0x159bcc,{'transaction':_0xa87161})['spread'](function(_0x33f9a6){return _0x33f9a6;});});});}})['then'](respondWithResult(_0x2a4a7e,null))[_0x7ab6('0x48')](handleError(_0x2a4a7e,null));};exports[_0x7ab6('0x90')]=function(_0x2aa7fc,_0x29380e){var _0x4f5dbd=_['isArray'](_0x2aa7fc[_0x7ab6('0x34')][_0x7ab6('0x77')])?_0x2aa7fc[_0x7ab6('0x34')][_0x7ab6('0x77')]:[_0x2aa7fc['query'][_0x7ab6('0x77')]];var _0x15aa65=_0x2aa7fc['params']['id'];return db['Team'][_0x7ab6('0x7b')]({'where':{'id':_0x15aa65}})[_0x7ab6('0x43')](handleEntityNotFound(_0x29380e,null))['then'](function(_0x15247c){if(_0x15247c){var _0x9dfa27=['Voice',_0x7ab6('0x7d'),_0x7ab6('0x91'),_0x7ab6('0x7e'),_0x7ab6('0x7f'),_0x7ab6('0x80'),'Whatsapp'];return db[_0x7ab6('0x55')]['transaction'](function(_0x5ce201){var _0x7b6f98=_[_0x7ab6('0x32')](_0x9dfa27,function(_0x373388){var _0x284de4={'attributes':['id',_0x7ab6('0x29')]};return _0x15247c['get'+_0x373388+_0x7ab6('0x76')](_0x284de4)[_0x7ab6('0x43')](function(_0x3bbfea){var _0x522eaf=_[_0x7ab6('0x32')](_0x3bbfea,function(_0x4bb9ee){return _0x4bb9ee[_0x7ab6('0x90')](_0x4f5dbd,{'transaction':_0x5ce201})[_0x7ab6('0x43')](function(){var _0x46838b=_[_0x7ab6('0x32')](_0x4f5dbd,function(_0x45b001){socket[_0x7ab6('0x87')](_0x7ab6('0x4d')+_0x373388+_0x7ab6('0x92'),{'UserId':Number(_0x45b001),[_0x373388+_0x7ab6('0x84')]:_0x4bb9ee['id']});if(_0x373388!==_0x7ab6('0x7c')){return;}return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x4bb9ee['id'],'UserId':_0x45b001},'transaction':_0x5ce201});});return Promise[_0x7ab6('0x8f')](_0x46838b);});});return Promise[_0x7ab6('0x8f')](_0x522eaf);});});return Promise[_0x7ab6('0x8f')](_0x7b6f98)[_0x7ab6('0x43')](function(){return _0x15247c[_0x7ab6('0x90')](_0x4f5dbd,{'transaction':_0x5ce201});})[_0x7ab6('0x43')](function(){return db[_0x7ab6('0x68')][_0x7ab6('0x6b')]({'where':{'teamId':_0x15aa65}})[_0x7ab6('0x43')](function(_0xa5fbdb){if(_0xa5fbdb){var _0xa21718=_[_0x7ab6('0x32')](_0x4f5dbd,function(_0x5b56bb){db['UserVoicePrefix'][_0x7ab6('0x5d')]({'where':{'UserId':_0x5b56bb,'VoicePrefixId':_0xa5fbdb[_0x7ab6('0x93')]}});});return Promise[_0x7ab6('0x8f')](_0xa21718);}});});});}})[_0x7ab6('0x43')](respondWithStatusCode(_0x29380e,null))[_0x7ab6('0x48')](handleError(_0x29380e,null));};exports['getAgents']=function(_0x2523ae,_0x46cde6,_0xec1aec){var _0x200285={};var _0x2bb2af={};var _0x583266;var _0x42db23;return db[_0x7ab6('0x2c')][_0x7ab6('0x6b')]({'where':{'id':_0x2523ae[_0x7ab6('0x4a')]['id']}})[_0x7ab6('0x43')](handleEntityNotFound(_0x46cde6,null))['then'](function(_0x4a4e86){if(_0x4a4e86){_0x583266=_0x4a4e86;_0x2bb2af[_0x7ab6('0x31')]=_['keys'](db[_0x7ab6('0x86')][_0x7ab6('0x2d')]);_0x2bb2af['query']=_[_0x7ab6('0x33')](_0x2523ae[_0x7ab6('0x34')]);_0x2bb2af[_0x7ab6('0x35')]=_['intersection'](_0x2bb2af['model'],_0x2bb2af[_0x7ab6('0x34')]);_0x200285[_0x7ab6('0x37')]=_[_0x7ab6('0x36')](_0x2bb2af[_0x7ab6('0x31')],qs[_0x7ab6('0x38')](_0x2523ae[_0x7ab6('0x34')][_0x7ab6('0x38')]));_0x200285['attributes']=_0x200285['attributes'][_0x7ab6('0x39')]?_0x200285[_0x7ab6('0x37')]:_0x2bb2af[_0x7ab6('0x31')];_0x200285[_0x7ab6('0x72')]=qs[_0x7ab6('0x3c')](_0x2523ae[_0x7ab6('0x34')][_0x7ab6('0x3c')]);_0x200285[_0x7ab6('0x3f')]=qs[_0x7ab6('0x35')](_[_0x7ab6('0x3d')](_0x2523ae[_0x7ab6('0x34')],_0x2bb2af['filters']));if(_0x2523ae['query'][_0x7ab6('0x3e')]){_0x200285[_0x7ab6('0x3f')]=_['merge'](_0x200285[_0x7ab6('0x3f')],{'$or':_[_0x7ab6('0x32')](_0x200285['attributes'],function(_0x21cd30){var _0x54ef68={};_0x54ef68[_0x21cd30]={'$like':'%'+_0x2523ae[_0x7ab6('0x34')][_0x7ab6('0x3e')]+'%'};return _0x54ef68;})});}_0x200285=_[_0x7ab6('0x40')]({},_0x200285,_0x2523ae[_0x7ab6('0x42')]);return _0x583266[_0x7ab6('0x94')](_0x200285);}})[_0x7ab6('0x43')](function(_0x45481b){if(_0x45481b){_0x42db23=_0x45481b['length'];if(!_0x2523ae['query'][_0x7ab6('0x3a')]('nolimit')){_0x200285[_0x7ab6('0x21')]=qs[_0x7ab6('0x21')](_0x2523ae[_0x7ab6('0x34')][_0x7ab6('0x21')]);_0x200285[_0x7ab6('0x1f')]=qs['offset'](_0x2523ae[_0x7ab6('0x34')][_0x7ab6('0x1f')]);}return _0x583266['getAgents'](_0x200285);}})[_0x7ab6('0x43')](function(_0x10e7b2){if(_0x10e7b2){return _0x10e7b2?{'count':_0x42db23,'rows':_0x10e7b2}:null;}})[_0x7ab6('0x43')](respondWithResult(_0x46cde6,null))[_0x7ab6('0x48')](handleError(_0x46cde6,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 8ff4649..9b24599 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 _0x3c6d=['emit','hasOwnProperty','hook','events','Team','setMaxListeners','update','remove'];(function(_0x5920c9,_0x562f1e){var _0x1781de=function(_0x33cc8b){while(--_0x33cc8b){_0x5920c9['push'](_0x5920c9['shift']());}};_0x1781de(++_0x562f1e);}(_0x3c6d,0x1b3));var _0xd3c6=function(_0x4f4d1a,_0x278e33){_0x4f4d1a=_0x4f4d1a-0x0;var _0xfca475=_0x3c6d[_0x4f4d1a];return _0xfca475;};'use strict';var EventEmitter=require(_0xd3c6('0x0'));var Team=require('../../mysqldb')['db'][_0xd3c6('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xd3c6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd3c6('0x3'),'afterDestroy':_0xd3c6('0x4')};function emitEvent(_0x435a28){return function(_0x25b761,_0x1096c3,_0x323798){TeamEvents[_0xd3c6('0x5')](_0x435a28+':'+_0x25b761['id'],_0x25b761);TeamEvents['emit'](_0x435a28,_0x25b761);_0x323798(null);};}for(var e in events){if(events[_0xd3c6('0x6')](e)){var event=events[e];Team[_0xd3c6('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x2f76=['update','remove','emit','hook','events','../../mysqldb','Team','setMaxListeners','save'];(function(_0x962ff4,_0x3d6e33){var _0x22544a=function(_0x2bfeb1){while(--_0x2bfeb1){_0x962ff4['push'](_0x962ff4['shift']());}};_0x22544a(++_0x3d6e33);}(_0x2f76,0x70));var _0x62f7=function(_0x136c66,_0x38ada7){_0x136c66=_0x136c66-0x0;var _0x31893c=_0x2f76[_0x136c66];return _0x31893c;};'use strict';var EventEmitter=require(_0x62f7('0x0'));var Team=require(_0x62f7('0x1'))['db'][_0x62f7('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x62f7('0x3')](0x0);var events={'afterCreate':_0x62f7('0x4'),'afterUpdate':_0x62f7('0x5'),'afterDestroy':_0x62f7('0x6')};function emitEvent(_0x3d7ed0){return function(_0x48f3fb,_0x5d9528,_0x5f1826){TeamEvents[_0x62f7('0x7')](_0x3d7ed0+':'+_0x48f3fb['id'],_0x48f3fb);TeamEvents['emit'](_0x3d7ed0,_0x48f3fb);_0x5f1826(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x62f7('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 583c59b..628c1be 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 _0x0122=['catch','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','resolve','then','all','lodash','./team.attributes','get','Queues','map','channel'];(function(_0x5c739f,_0x1b2ed5){var _0x5ea129=function(_0x22dda4){while(--_0x22dda4){_0x5c739f['push'](_0x5c739f['shift']());}};_0x5ea129(++_0x1b2ed5);}(_0x0122,0x1ce));var _0x2012=function(_0x8dc1a7,_0x3c2a39){_0x8dc1a7=_0x8dc1a7-0x0;var _0x4e36b9=_0x0122[_0x8dc1a7];return _0x4e36b9;};'use strict';var _=require(_0x2012('0x0'));var attributes=require(_0x2012('0x1'));function getQueuesByChannel(_0x22bf6e,_0x330454){var _0x5ab22a=_0x2012('0x2')+_0x330454+_0x2012('0x3');return _0x22bf6e[_0x5ab22a]()['then'](function(_0x16ce0e){return _[_0x2012('0x4')](_0x16ce0e,function(_0x269fe5){_0x269fe5['setDataValue'](_0x2012('0x5'),_0x330454);return _0x269fe5;});})[_0x2012('0x6')](function(_0x156975){throw _0x156975;});}module[_0x2012('0x7')]=function(_0x216f05){return _0x216f05[_0x2012('0x8')](_0x2012('0x9'),attributes,{'tableName':_0x2012('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x13ecc9=this;var _0x19e205=[_0x2012('0xb'),_0x2012('0xc'),_0x2012('0xd'),_0x2012('0xe'),'Sms','Voice','Whatsapp'];return Promise[_0x2012('0xf')]()[_0x2012('0x10')](function(){var _0x344d2c=_[_0x2012('0x4')](_0x19e205,function(_0x3eeab6){return getQueuesByChannel(_0x13ecc9,_0x3eeab6);});return Promise[_0x2012('0x11')](_0x344d2c);})['catch'](function(_0x11c3d5){throw _0x11c3d5;});}}});}; \ No newline at end of file +var _0x9685=['Team','teams','Chat','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','lodash','./team.attributes','Queues','then','map','setDataValue','channel','catch','exports','define'];(function(_0x242514,_0x562b9a){var _0x292c28=function(_0x36f8e4){while(--_0x36f8e4){_0x242514['push'](_0x242514['shift']());}};_0x292c28(++_0x562b9a);}(_0x9685,0x172));var _0x5968=function(_0x1c0018,_0x4926a7){_0x1c0018=_0x1c0018-0x0;var _0x4a8d3e=_0x9685[_0x1c0018];return _0x4a8d3e;};'use strict';var _=require(_0x5968('0x0'));var attributes=require(_0x5968('0x1'));function getQueuesByChannel(_0x5928ab,_0x4db2ee){var _0x27d8a9='get'+_0x4db2ee+_0x5968('0x2');return _0x5928ab[_0x27d8a9]()[_0x5968('0x3')](function(_0x11105c){return _[_0x5968('0x4')](_0x11105c,function(_0x48bc5c){_0x48bc5c[_0x5968('0x5')](_0x5968('0x6'),_0x4db2ee);return _0x48bc5c;});})[_0x5968('0x7')](function(_0x3fb890){throw _0x3fb890;});}module[_0x5968('0x8')]=function(_0x5aa366){return _0x5aa366[_0x5968('0x9')](_0x5968('0xa'),attributes,{'tableName':_0x5968('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1ef811=this;var _0x2090cc=[_0x5968('0xc'),'Fax',_0x5968('0xd'),_0x5968('0xe'),_0x5968('0xf'),_0x5968('0x10'),_0x5968('0x11')];return Promise[_0x5968('0x12')]()['then'](function(){var _0x1323e6=_['map'](_0x2090cc,function(_0x5ead04){return getQueuesByChannel(_0x1ef811,_0x5ead04);});return Promise['all'](_0x1323e6);})['catch'](function(_0x107650){throw _0x107650;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 9cdb1de..23fd4ef 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 _0x1d25=['Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','register','request'];(function(_0x34da94,_0x178b79){var _0x7ae05e=function(_0xa083ee){while(--_0xa083ee){_0x34da94['push'](_0x34da94['shift']());}};_0x7ae05e(++_0x178b79);}(_0x1d25,0x171));var _0x51d2=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x1d25[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x51d2('0x0'));var util=require(_0x51d2('0x1'));var moment=require(_0x51d2('0x2'));var BPromise=require(_0x51d2('0x3'));var rs=require(_0x51d2('0x4'));var fs=require('fs');var Redis=require(_0x51d2('0x5'));var db=require(_0x51d2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x51d2('0x7'))('rpc');var config=require(_0x51d2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x51d2('0x9')][_0x51d2('0xa')]({'port':0x232a});config[_0x51d2('0xb')]=_[_0x51d2('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51d2('0xb')]));require('./team.socket')[_0x51d2('0xd')](socket);function respondWithRpcPromise(_0x3f7949,_0x20ed65,_0x3ddb26){return new BPromise(function(_0x7a21a4,_0xb598f9){return client[_0x51d2('0xe')](_0x3f7949,_0x3ddb26)['then'](function(_0x525d58){logger['info'](_0x51d2('0xf'),_0x20ed65,_0x51d2('0x10'));logger['debug'](_0x51d2('0x11'),_0x20ed65,_0x51d2('0x10'),JSON[_0x51d2('0x12')](_0x525d58));if(_0x525d58[_0x51d2('0x13')]){if(_0x525d58[_0x51d2('0x13')][_0x51d2('0x14')]===0x1f4){logger[_0x51d2('0x13')](_0x51d2('0xf'),_0x20ed65,_0x525d58[_0x51d2('0x13')][_0x51d2('0x15')]);return _0xb598f9(_0x525d58[_0x51d2('0x13')][_0x51d2('0x15')]);}logger[_0x51d2('0x13')](_0x51d2('0xf'),_0x20ed65,_0x525d58[_0x51d2('0x13')][_0x51d2('0x15')]);return _0x7a21a4(_0x525d58[_0x51d2('0x13')][_0x51d2('0x15')]);}else{logger['info'](_0x51d2('0xf'),_0x20ed65,_0x51d2('0x10'));_0x7a21a4(_0x525d58[_0x51d2('0x16')]['message']);}})[_0x51d2('0x17')](function(_0x3b9b8c){logger['error'](_0x51d2('0xf'),_0x20ed65,_0x3b9b8c);_0xb598f9(_0x3b9b8c);});});} \ No newline at end of file +var _0x85c7=['redis','defaults','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x5b1370,_0x5beac4){var _0xf5075d=function(_0x26aeab){while(--_0x26aeab){_0x5b1370['push'](_0x5b1370['shift']());}};_0xf5075d(++_0x5beac4);}(_0x85c7,0x1d3));var _0x785c=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x85c7[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0x785c('0x0'));var util=require(_0x785c('0x1'));var moment=require(_0x785c('0x2'));var BPromise=require(_0x785c('0x3'));var rs=require(_0x785c('0x4'));var fs=require('fs');var Redis=require(_0x785c('0x5'));var db=require(_0x785c('0x6'))['db'];var utils=require(_0x785c('0x7'));var logger=require(_0x785c('0x8'))(_0x785c('0x9'));var config=require('../../config/environment');var jayson=require(_0x785c('0xa'));var client=jayson[_0x785c('0xb')][_0x785c('0xc')]({'port':0x232a});config[_0x785c('0xd')]=_[_0x785c('0xe')](config[_0x785c('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x785c('0xf'))(new Redis(config[_0x785c('0xd')]));require(_0x785c('0x10'))[_0x785c('0x11')](socket);function respondWithRpcPromise(_0x11ec3,_0x361ce8,_0x426491){return new BPromise(function(_0xb3cfe1,_0x45252c){return client[_0x785c('0x12')](_0x11ec3,_0x426491)[_0x785c('0x13')](function(_0x25b4d6){logger['info'](_0x785c('0x14'),_0x361ce8,_0x785c('0x15'));logger[_0x785c('0x16')]('Team,\x20%s,\x20%s,\x20%s',_0x361ce8,_0x785c('0x15'),JSON[_0x785c('0x17')](_0x25b4d6));if(_0x25b4d6['error']){if(_0x25b4d6[_0x785c('0x18')][_0x785c('0x19')]===0x1f4){logger[_0x785c('0x18')]('Team,\x20%s,\x20%s',_0x361ce8,_0x25b4d6[_0x785c('0x18')][_0x785c('0x1a')]);return _0x45252c(_0x25b4d6[_0x785c('0x18')][_0x785c('0x1a')]);}logger['error'](_0x785c('0x14'),_0x361ce8,_0x25b4d6[_0x785c('0x18')][_0x785c('0x1a')]);return _0xb3cfe1(_0x25b4d6[_0x785c('0x18')][_0x785c('0x1a')]);}else{logger[_0x785c('0x1b')]('Team,\x20%s,\x20%s',_0x361ce8,_0x785c('0x15'));_0xb3cfe1(_0x25b4d6[_0x785c('0x1c')][_0x785c('0x1a')]);}})[_0x785c('0x1d')](function(_0x5cc395){logger[_0x785c('0x18')]('Team,\x20%s,\x20%s',_0x361ce8,_0x5cc395);_0x45252c(_0x5cc395);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index b40c171..6497cf2 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 _0xe9ff=['length','team:','update','emit','removeListener','register'];(function(_0x2dd3fa,_0x347ce6){var _0x129a26=function(_0x1ff53){while(--_0x1ff53){_0x2dd3fa['push'](_0x2dd3fa['shift']());}};_0x129a26(++_0x347ce6);}(_0xe9ff,0x17c));var _0xfe9f=function(_0x25f534,_0xf9a7f3){_0x25f534=_0x25f534-0x0;var _0x10841a=_0xe9ff[_0x25f534];return _0x10841a;};'use strict';var TeamEvents=require('./team.events');var events=['save','remove',_0xfe9f('0x0')];function createListener(_0x5d9f8c,_0x3bd6ea){return function(_0xfb3bf3){_0x3bd6ea[_0xfe9f('0x1')](_0x5d9f8c,_0xfb3bf3);};}function removeListener(_0x15cd60,_0x4226ce){return function(){TeamEvents[_0xfe9f('0x2')](_0x15cd60,_0x4226ce);};}exports[_0xfe9f('0x3')]=function(_0x5f9833){for(var _0xe96c92=0x0,_0x53767c=events[_0xfe9f('0x4')];_0xe96c92<_0x53767c;_0xe96c92++){var _0x4e4857=events[_0xe96c92];var _0x4a837d=createListener(_0xfe9f('0x5')+_0x4e4857,_0x5f9833);TeamEvents['on'](_0x4e4857,_0x4a837d);}}; \ No newline at end of file +var _0x528c=['update','emit','register','length','team:','./team.events','save','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x528c,0x65));var _0xc528=function(_0x4381fb,_0x465ed9){_0x4381fb=_0x4381fb-0x0;var _0x2ccf63=_0x528c[_0x4381fb];return _0x2ccf63;};'use strict';var TeamEvents=require(_0xc528('0x0'));var events=[_0xc528('0x1'),_0xc528('0x2'),_0xc528('0x3')];function createListener(_0x178709,_0x3927e2){return function(_0x123694){_0x3927e2[_0xc528('0x4')](_0x178709,_0x123694);};}function removeListener(_0x205352,_0xa95fcd){return function(){TeamEvents['removeListener'](_0x205352,_0xa95fcd);};}exports[_0xc528('0x5')]=function(_0x49c1a6){for(var _0xa267b4=0x0,_0xb7f20a=events[_0xc528('0x6')];_0xa267b4<_0xb7f20a;_0xa267b4++){var _0x579b27=events[_0xa267b4];var _0x562e67=createListener(_0xc528('0x7')+_0x579b27,_0x49c1a6);TeamEvents['on'](_0x579b27,_0x562e67);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 0213404..200ad2c 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 _0x4deb=['sequelize','exports','INTEGER'];(function(_0x1fd886,_0x41155d){var _0x419f90=function(_0x5394a8){while(--_0x5394a8){_0x1fd886['push'](_0x1fd886['shift']());}};_0x419f90(++_0x41155d);}(_0x4deb,0x17a));var _0xb4de=function(_0x251170,_0x32fb45){_0x251170=_0x251170-0x0;var _0x32583d=_0x4deb[_0x251170];return _0x32583d;};'use strict';var Sequelize=require(_0xb4de('0x0'));module[_0xb4de('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xb4de('0x2')]}}; \ No newline at end of file +var _0x887e=['sequelize','exports','INTEGER'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x887e,0x14d));var _0xe887=function(_0x770900,_0x11ab73){_0x770900=_0x770900-0x0;var _0x378a40=_0x887e[_0x770900];return _0x378a40;};'use strict';var Sequelize=require(_0xe887('0x0'));module[_0xe887('0x1')]={'TeamId':{'type':Sequelize[_0xe887('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xe887('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index fbfcb0d..23b364e 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 _0xcf2f=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x5ba4cf,_0x3d2919){var _0x5109e8=function(_0x4220a1){while(--_0x4220a1){_0x5ba4cf['push'](_0x5ba4cf['shift']());}};_0x5109e8(++_0x3d2919);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x1c90b3,_0x42e708){_0x1c90b3=_0x1c90b3-0x0;var _0x413867=_0xcf2f[_0x1c90b3];return _0x413867;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var logger=require(_0xfcf2('0x2'))(_0xfcf2('0x3'));var moment=require(_0xfcf2('0x4'));var BPromise=require('bluebird');var rp=require(_0xfcf2('0x5'));var fs=require('fs');var path=require(_0xfcf2('0x6'));var rimraf=require(_0xfcf2('0x7'));var config=require(_0xfcf2('0x8'));var attributes=require(_0xfcf2('0x9'));module[_0xfcf2('0xa')]=function(_0x1e6d99,_0x3a4950){return _0x1e6d99[_0xfcf2('0xb')](_0xfcf2('0xc'),attributes,{'tableName':_0xfcf2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e6b=['path','rimraf','../../config/environment','exports','TeamVoicePrefix','lodash','util','api','request-promise'];(function(_0x5d225a,_0x2debe9){var _0x1e7761=function(_0x491dc2){while(--_0x491dc2){_0x5d225a['push'](_0x5d225a['shift']());}};_0x1e7761(++_0x2debe9);}(_0x9e6b,0x11c));var _0xb9e6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9e6b[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xb9e6('0x0'));var util=require(_0xb9e6('0x1'));var logger=require('../../config/logger')(_0xb9e6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb9e6('0x3'));var fs=require('fs');var path=require(_0xb9e6('0x4'));var rimraf=require(_0xb9e6('0x5'));var config=require(_0xb9e6('0x6'));var attributes=require('./teamVoicePrefix.attributes');module[_0xb9e6('0x7')]=function(_0x1a6a4f,_0x1b9eed){return _0x1a6a4f['define'](_0xb9e6('0x8'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 90ce447..b259bfd 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x466b8c,_0x492ed0){var _0x3f461d=function(_0x1bb52c){while(--_0x1bb52c){_0x466b8c['push'](_0x466b8c['shift']());}};_0x3f461d(++_0x492ed0);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x941282,_0x3f91fe){var _0x37968f=function(_0x447043){while(--_0x447043){_0x941282['push'](_0x941282['shift']());}};_0x37968f(++_0x3f91fe);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xcb91[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 88d28a8..ffc446f 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 _0xae7c=['exports','INTEGER','sequelize'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0xae7c,0x104));var _0xcae7=function(_0x15a61f,_0x80526a){_0x15a61f=_0x15a61f-0x0;var _0x3d5af3=_0xae7c[_0x15a61f];return _0x3d5af3;};'use strict';var Sequelize=require(_0xcae7('0x0'));module[_0xcae7('0x1')]={'penalty':{'type':Sequelize[_0xcae7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe95b=['sequelize'];(function(_0x86527a,_0x2787c6){var _0x2f14b6=function(_0x4f1613){while(--_0x4f1613){_0x86527a['push'](_0x86527a['shift']());}};_0x2f14b6(++_0x2787c6);}(_0xe95b,0x107));var _0xbe95=function(_0x5c4f74,_0x35238a){_0x5c4f74=_0x5c4f74-0x0;var _0x156fa0=_0xe95b[_0x5c4f74];return _0x156fa0;};'use strict';var Sequelize=require(_0xbe95('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'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 934649d..079a370 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 _0x61a1=['moment','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0x310f74,_0x5254f7){var _0x32aca9=function(_0x388bb7){while(--_0x388bb7){_0x310f74['push'](_0x310f74['shift']());}};_0x32aca9(++_0x5254f7);}(_0x61a1,0x127));var _0x161a=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x61a1[_0x836465];return _0x2150ea;};'use strict';var _=require(_0x161a('0x0'));var util=require(_0x161a('0x1'));var logger=require(_0x161a('0x2'))(_0x161a('0x3'));var moment=require(_0x161a('0x4'));var BPromise=require('bluebird');var rp=require(_0x161a('0x5'));var fs=require('fs');var path=require(_0x161a('0x6'));var rimraf=require('rimraf');var config=require(_0x161a('0x7'));var attributes=require(_0x161a('0x8'));module[_0x161a('0x9')]=function(_0x1442cf,_0x1bb0ac){return _0x1442cf[_0x161a('0xa')](_0x161a('0xb'),attributes,{'tableName':_0x161a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4be6=['team_has_voice_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define'];(function(_0x2a64f4,_0x50edfb){var _0x57dc03=function(_0x475d14){while(--_0x475d14){_0x2a64f4['push'](_0x2a64f4['shift']());}};_0x57dc03(++_0x50edfb);}(_0x4be6,0xb5));var _0x64be=function(_0x7d1b89,_0x58faa5){_0x7d1b89=_0x7d1b89-0x0;var _0x435a5b=_0x4be6[_0x7d1b89];return _0x435a5b;};'use strict';var _=require('lodash');var util=require(_0x64be('0x0'));var logger=require(_0x64be('0x1'))(_0x64be('0x2'));var moment=require(_0x64be('0x3'));var BPromise=require(_0x64be('0x4'));var rp=require(_0x64be('0x5'));var fs=require('fs');var path=require(_0x64be('0x6'));var rimraf=require(_0x64be('0x7'));var config=require(_0x64be('0x8'));var attributes=require(_0x64be('0x9'));module['exports']=function(_0x131822,_0x2430e2){return _0x131822[_0x64be('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0x64be('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 5a6f5e2..c9cf382 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 _0x3351=['error','code','message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x3351,0x175));var _0x1335=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x3351[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x1335('0x0'));var util=require(_0x1335('0x1'));var moment=require(_0x1335('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1335('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1335('0x4'))(_0x1335('0x5'));var config=require(_0x1335('0x6'));var jayson=require(_0x1335('0x7'));var client=jayson[_0x1335('0x8')][_0x1335('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x387e44,_0x4033f0,_0x1793e6){return new BPromise(function(_0x19c13e,_0x53a9a2){return client[_0x1335('0xa')](_0x387e44,_0x1793e6)[_0x1335('0xb')](function(_0x4ef3a7){logger[_0x1335('0xc')](_0x1335('0xd'),_0x4033f0,'request\x20sent');logger[_0x1335('0xe')](_0x1335('0xf'),_0x4033f0,_0x1335('0x10'),JSON[_0x1335('0x11')](_0x4ef3a7));if(_0x4ef3a7[_0x1335('0x12')]){if(_0x4ef3a7[_0x1335('0x12')][_0x1335('0x13')]===0x1f4){logger[_0x1335('0x12')](_0x1335('0xd'),_0x4033f0,_0x4ef3a7[_0x1335('0x12')][_0x1335('0x14')]);return _0x53a9a2(_0x4ef3a7[_0x1335('0x12')][_0x1335('0x14')]);}logger[_0x1335('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4033f0,_0x4ef3a7[_0x1335('0x12')][_0x1335('0x14')]);return _0x19c13e(_0x4ef3a7[_0x1335('0x12')]['message']);}else{logger[_0x1335('0xc')](_0x1335('0xd'),_0x4033f0,_0x1335('0x10'));_0x19c13e(_0x4ef3a7[_0x1335('0x15')][_0x1335('0x14')]);}})[_0x1335('0x16')](function(_0x2c9a69){logger[_0x1335('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4033f0,_0x2c9a69);_0x53a9a2(_0x2c9a69);});});} \ No newline at end of file +var _0x8600=['stringify','error','message','info','result','catch','util','randomstring','ioredis','../../mysqldb','rpc','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x53c540,_0xaa78b2){var _0x29e07b=function(_0x438cdb){while(--_0x438cdb){_0x53c540['push'](_0x53c540['shift']());}};_0x29e07b(++_0xaa78b2);}(_0x8600,0xd7));var _0x0860=function(_0x150599,_0x3bdfb0){_0x150599=_0x150599-0x0;var _0x12c65f=_0x8600[_0x150599];return _0x12c65f;};'use strict';var _=require('lodash');var util=require(_0x0860('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0860('0x1'));var fs=require('fs');var Redis=require(_0x0860('0x2'));var db=require(_0x0860('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0860('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0860('0x5')][_0x0860('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x314fb6,_0x29dbf9,_0x395f09){return new BPromise(function(_0x324865,_0x548004){return client[_0x0860('0x7')](_0x314fb6,_0x395f09)[_0x0860('0x8')](function(_0x1ffa7b){logger['info'](_0x0860('0x9'),_0x29dbf9,'request\x20sent');logger[_0x0860('0xa')](_0x0860('0xb'),_0x29dbf9,_0x0860('0xc'),JSON[_0x0860('0xd')](_0x1ffa7b));if(_0x1ffa7b[_0x0860('0xe')]){if(_0x1ffa7b[_0x0860('0xe')]['code']===0x1f4){logger[_0x0860('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x29dbf9,_0x1ffa7b[_0x0860('0xe')][_0x0860('0xf')]);return _0x548004(_0x1ffa7b[_0x0860('0xe')][_0x0860('0xf')]);}logger['error'](_0x0860('0x9'),_0x29dbf9,_0x1ffa7b[_0x0860('0xe')][_0x0860('0xf')]);return _0x324865(_0x1ffa7b[_0x0860('0xe')][_0x0860('0xf')]);}else{logger[_0x0860('0x10')](_0x0860('0x9'),_0x29dbf9,'request\x20sent');_0x324865(_0x1ffa7b[_0x0860('0x11')]['message']);}})[_0x0860('0x12')](function(_0x428643){logger['error'](_0x0860('0x9'),_0x29dbf9,_0x428643);_0x548004(_0x428643);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 25b7a66..20b95cc 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 _0x19e1=['../../components/auth/service','../../config/environment','./template.controller','isAuthenticated','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x47cd7b,_0x5630af){var _0x3e6dbf=function(_0x2c28e1){while(--_0x2c28e1){_0x47cd7b['push'](_0x47cd7b['shift']());}};_0x3e6dbf(++_0x5630af);}(_0x19e1,0x163));var _0x119e=function(_0x4404ff,_0x13d7a9){_0x4404ff=_0x4404ff-0x0;var _0x5e7b19=_0x19e1[_0x4404ff];return _0x5e7b19;};'use strict';var multer=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var path=require(_0x119e('0x2'));var timeout=require(_0x119e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x119e('0x4'));var auth=require(_0x119e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x119e('0x6'));var controller=require(_0x119e('0x7'));router['get']('/',auth[_0x119e('0x8')](),controller['index']);router[_0x119e('0x9')](_0x119e('0xa'),auth[_0x119e('0x8')](),controller[_0x119e('0xb')]);router['post']('/',auth[_0x119e('0x8')](),controller[_0x119e('0xc')]);router[_0x119e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x119e('0xe')]);router[_0x119e('0xf')](_0x119e('0xa'),auth[_0x119e('0x8')](),controller[_0x119e('0x10')]);module[_0x119e('0x11')]=router; \ No newline at end of file +var _0x0c2b=['Router','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x2dd6d9,_0x62ae06){var _0x4d8f41=function(_0x29f460){while(--_0x29f460){_0x2dd6d9['push'](_0x2dd6d9['shift']());}};_0x4d8f41(++_0x62ae06);}(_0x0c2b,0x194));var _0xb0c2=function(_0x3da862,_0x731725){_0x3da862=_0x3da862-0x0;var _0x6dd924=_0x0c2b[_0x3da862];return _0x6dd924;};'use strict';var multer=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var path=require('path');var timeout=require(_0xb0c2('0x2'));var express=require(_0xb0c2('0x3'));var router=express[_0xb0c2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb0c2('0x5'));var config=require(_0xb0c2('0x6'));var controller=require(_0xb0c2('0x7'));router[_0xb0c2('0x8')]('/',auth[_0xb0c2('0x9')](),controller['index']);router[_0xb0c2('0x8')](_0xb0c2('0xa'),auth[_0xb0c2('0x9')](),controller['show']);router[_0xb0c2('0xb')]('/',auth[_0xb0c2('0x9')](),controller[_0xb0c2('0xc')]);router[_0xb0c2('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xb0c2('0xe')]);router[_0xb0c2('0xf')](_0xb0c2('0xa'),auth[_0xb0c2('0x9')](),controller['destroy']);module[_0xb0c2('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 2694afe..7df5975 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 _0xf78d=['sequelize','exports','STRING','TEXT'];(function(_0x240af6,_0x2d7cb1){var _0x3f4584=function(_0x56b20f){while(--_0x56b20f){_0x240af6['push'](_0x240af6['shift']());}};_0x3f4584(++_0x2d7cb1);}(_0xf78d,0xf8));var _0xdf78=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf78d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xdf78('0x0'));module[_0xdf78('0x1')]={'name':{'type':Sequelize[_0xdf78('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xdf78('0x3')]}}; \ No newline at end of file +var _0x9523=['STRING','sequelize','exports'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x9523,0x14b));var _0x3952=function(_0x15c158,_0x3993ca){_0x15c158=_0x15c158-0x0;var _0x3bdeb5=_0x9523[_0x15c158];return _0x3bdeb5;};'use strict';var Sequelize=require(_0x3952('0x0'));module[_0x3952('0x1')]={'name':{'type':Sequelize[_0x3952('0x2')]},'description':{'type':Sequelize[_0x3952('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 3b0c1a2..37a477c 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 _0x05f1=['moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','update','then','destroy','get','Templates','stack','name','send','index','Template','fieldName','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','options','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2ceedb,_0x3d4af3){var _0x1eef5c=function(_0xee38c1){while(--_0xee38c1){_0x2ceedb['push'](_0x2ceedb['shift']());}};_0x1eef5c(++_0x3d4af3);}(_0x05f1,0x1ee));var _0x105f=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x05f1[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x105f('0x0'));var rimraf=require(_0x105f('0x1'));var zipdir=require(_0x105f('0x2'));var jsonpatch=require(_0x105f('0x3'));var rp=require('request-promise');var moment=require(_0x105f('0x4'));var BPromise=require(_0x105f('0x5'));var Mustache=require('mustache');var util=require(_0x105f('0x6'));var path=require(_0x105f('0x7'));var sox=require(_0x105f('0x8'));var csv=require(_0x105f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x105f('0xa'));var _=require('lodash');var squel=require(_0x105f('0xb'));var crypto=require(_0x105f('0xc'));var jsforce=require(_0x105f('0xd'));var deskjs=require(_0x105f('0xe'));var toCsv=require(_0x105f('0x9'));var querystring=require('querystring');var Papa=require(_0x105f('0xf'));var Redis=require(_0x105f('0x10'));var authService=require(_0x105f('0x11'));var qs=require(_0x105f('0x12'));var as=require(_0x105f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x105f('0x14'))(_0x105f('0x15'));var utils=require(_0x105f('0x16'));var config=require(_0x105f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x105f('0x18'))['db'];function respondWithStatusCode(_0x42a5fb,_0x3bd98a){_0x3bd98a=_0x3bd98a||0xcc;return function(_0x423168){if(_0x423168){return _0x42a5fb[_0x105f('0x19')](_0x3bd98a);}return _0x42a5fb['status'](_0x3bd98a)[_0x105f('0x1a')]();};}function respondWithResult(_0x30d7eb,_0x2505bd){_0x2505bd=_0x2505bd||0xc8;return function(_0x23a4d8){if(_0x23a4d8){return _0x30d7eb['status'](_0x2505bd)[_0x105f('0x1b')](_0x23a4d8);}};}function respondWithFilteredResult(_0x79891e,_0x30549c){return function(_0x269ce1){if(_0x269ce1){var _0x148c0c=typeof _0x30549c[_0x105f('0x1c')]===_0x105f('0x1d')&&typeof _0x30549c['limit']===_0x105f('0x1d');var _0x66881f=_0x269ce1[_0x105f('0x1e')];var _0x4c8304=_0x148c0c?0x0:_0x30549c[_0x105f('0x1c')];var _0x45c7ed=_0x148c0c?_0x269ce1[_0x105f('0x1e')]:_0x30549c[_0x105f('0x1c')]+_0x30549c[_0x105f('0x1f')];var _0x46adb6;if(_0x45c7ed>=_0x66881f){_0x45c7ed=_0x66881f;_0x46adb6=0xc8;}else{_0x46adb6=0xce;}_0x79891e[_0x105f('0x20')](_0x46adb6);return _0x79891e[_0x105f('0x21')]('Content-Range',_0x4c8304+'-'+_0x45c7ed+'/'+_0x66881f)[_0x105f('0x1b')](_0x269ce1);}return null;};}function patchUpdates(_0x187bc7){return function(_0x36a955){try{jsonpatch[_0x105f('0x22')](_0x36a955,_0x187bc7,!![]);}catch(_0x124934){return BPromise[_0x105f('0x23')](_0x124934);}return _0x36a955['save']();};}function saveUpdates(_0x1f6972,_0x251aa0){return function(_0x59ce89){if(_0x59ce89){return _0x59ce89[_0x105f('0x24')](_0x1f6972)[_0x105f('0x25')](function(_0x12d7c0){return _0x12d7c0;});}return null;};}function removeEntity(_0x2d2964,_0x2073b6){return function(_0x591f4){if(_0x591f4){return _0x591f4[_0x105f('0x26')]()[_0x105f('0x25')](function(){var _0x48fb0d=_0x591f4[_0x105f('0x27')]({'plain':!![]});var _0x90d199=_0x105f('0x28');return db['UserProfileResource'][_0x105f('0x26')]({'where':{'type':_0x90d199,'resourceId':_0x48fb0d['id']}})[_0x105f('0x25')](function(){return _0x591f4;});})[_0x105f('0x25')](function(){_0x2d2964[_0x105f('0x20')](0xcc)[_0x105f('0x1a')]();});}};}function handleEntityNotFound(_0x28561f,_0x1b867f){return function(_0x4ad1eb){if(!_0x4ad1eb){_0x28561f[_0x105f('0x19')](0x194);}return _0x4ad1eb;};}function handleError(_0x4686f6,_0x35280f){_0x35280f=_0x35280f||0x1f4;return function(_0x3a8a7e){logger['error'](_0x3a8a7e[_0x105f('0x29')]);if(_0x3a8a7e[_0x105f('0x2a')]){delete _0x3a8a7e[_0x105f('0x2a')];}_0x4686f6[_0x105f('0x20')](_0x35280f)[_0x105f('0x2b')](_0x3a8a7e);};}exports[_0x105f('0x2c')]=function(_0x5827b2,_0x58f0c1){var _0x32e5b9={},_0x4c19b9={},_0x57c53b={'count':0x0,'rows':[]};var _0x54d539=_['map'](db[_0x105f('0x2d')]['rawAttributes'],function(_0x2d396a){return{'name':_0x2d396a[_0x105f('0x2e')],'type':_0x2d396a['type']['key']};});_0x4c19b9['model']=_['map'](_0x54d539,'name');_0x4c19b9[_0x105f('0x2f')]=_[_0x105f('0x30')](_0x5827b2[_0x105f('0x2f')]);_0x4c19b9['filters']=_['intersection'](_0x4c19b9['model'],_0x4c19b9[_0x105f('0x2f')]);_0x32e5b9['attributes']=_[_0x105f('0x31')](_0x4c19b9[_0x105f('0x32')],qs[_0x105f('0x33')](_0x5827b2[_0x105f('0x2f')]['fields']));_0x32e5b9[_0x105f('0x34')]=_0x32e5b9['attributes'][_0x105f('0x35')]?_0x32e5b9[_0x105f('0x34')]:_0x4c19b9[_0x105f('0x32')];if(!_0x5827b2[_0x105f('0x2f')][_0x105f('0x36')]('nolimit')){_0x32e5b9[_0x105f('0x1f')]=qs[_0x105f('0x1f')](_0x5827b2[_0x105f('0x2f')][_0x105f('0x1f')]);_0x32e5b9['offset']=qs[_0x105f('0x1c')](_0x5827b2[_0x105f('0x2f')][_0x105f('0x1c')]);}_0x32e5b9[_0x105f('0x37')]=qs[_0x105f('0x38')](_0x5827b2[_0x105f('0x2f')][_0x105f('0x38')]);_0x32e5b9[_0x105f('0x39')]=qs[_0x105f('0x3a')](_[_0x105f('0x3b')](_0x5827b2[_0x105f('0x2f')],_0x4c19b9[_0x105f('0x3a')]),_0x54d539);if(_0x5827b2[_0x105f('0x2f')]['filter']){_0x32e5b9[_0x105f('0x39')]=_[_0x105f('0x3c')](_0x32e5b9[_0x105f('0x39')],{'$or':_[_0x105f('0x3d')](_0x54d539,function(_0x3ad896){if(_0x3ad896[_0x105f('0x3e')]!==_0x105f('0x3f')){var _0x3923aa={};_0x3923aa[_0x3ad896[_0x105f('0x2a')]]={'$like':'%'+_0x5827b2[_0x105f('0x2f')]['filter']+'%'};return _0x3923aa;}})});}_0x32e5b9=_[_0x105f('0x3c')]({},_0x32e5b9,_0x5827b2['options']);var _0x194e75={'where':_0x32e5b9[_0x105f('0x39')]};return db[_0x105f('0x2d')][_0x105f('0x1e')](_0x194e75)[_0x105f('0x25')](function(_0x504795){_0x57c53b[_0x105f('0x1e')]=_0x504795;if(_0x5827b2['query'][_0x105f('0x40')]){_0x32e5b9[_0x105f('0x41')]=[{'all':!![]}];}return db['Template'][_0x105f('0x42')](_0x32e5b9);})[_0x105f('0x25')](function(_0x17b3a8){_0x57c53b[_0x105f('0x43')]=_0x17b3a8;return _0x57c53b;})[_0x105f('0x25')](respondWithFilteredResult(_0x58f0c1,_0x32e5b9))['catch'](handleError(_0x58f0c1,null));};exports[_0x105f('0x44')]=function(_0x563bb6,_0x3fdb6e){var _0x246e7f={'raw':!![],'where':{'id':_0x563bb6['params']['id']}},_0x2b1a73={};_0x2b1a73[_0x105f('0x32')]=_[_0x105f('0x30')](db[_0x105f('0x2d')][_0x105f('0x45')]);_0x2b1a73[_0x105f('0x2f')]=_[_0x105f('0x30')](_0x563bb6[_0x105f('0x2f')]);_0x2b1a73[_0x105f('0x3a')]=_[_0x105f('0x31')](_0x2b1a73['model'],_0x2b1a73[_0x105f('0x2f')]);_0x246e7f[_0x105f('0x34')]=_[_0x105f('0x31')](_0x2b1a73[_0x105f('0x32')],qs[_0x105f('0x33')](_0x563bb6[_0x105f('0x2f')][_0x105f('0x33')]));_0x246e7f[_0x105f('0x34')]=_0x246e7f['attributes'][_0x105f('0x35')]?_0x246e7f[_0x105f('0x34')]:_0x2b1a73['model'];if(_0x563bb6['query'][_0x105f('0x40')]){_0x246e7f[_0x105f('0x41')]=[{'all':!![]}];}_0x246e7f=_[_0x105f('0x3c')]({},_0x246e7f,_0x563bb6[_0x105f('0x46')]);return db[_0x105f('0x2d')][_0x105f('0x47')](_0x246e7f)['then'](handleEntityNotFound(_0x3fdb6e,null))[_0x105f('0x25')](respondWithResult(_0x3fdb6e,null))['catch'](handleError(_0x3fdb6e,null));};exports[_0x105f('0x48')]=function(_0x5ae00a,_0x59dc2e){return db[_0x105f('0x2d')][_0x105f('0x48')](_0x5ae00a[_0x105f('0x49')],{})[_0x105f('0x25')](function(_0x5e81ff){var _0x5ee792=_0x5ae00a['user'][_0x105f('0x27')]({'plain':!![]});if(!_0x5ee792)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ee792[_0x105f('0x4a')]===_0x105f('0x4b')){var _0x32c536=_0x5e81ff[_0x105f('0x27')]({'plain':!![]});var _0x403b89=_0x105f('0x28');return db[_0x105f('0x4c')]['find']({'where':{'name':_0x403b89,'userProfileId':_0x5ee792[_0x105f('0x4d')]},'raw':!![]})[_0x105f('0x25')](function(_0x56524c){if(_0x56524c&&_0x56524c[_0x105f('0x4e')]===0x0){return db[_0x105f('0x4f')][_0x105f('0x48')]({'name':_0x32c536[_0x105f('0x2a')],'resourceId':_0x32c536['id'],'type':_0x56524c[_0x105f('0x2a')],'sectionId':_0x56524c['id']},{})[_0x105f('0x25')](function(){return _0x5e81ff;});}else{return _0x5e81ff;}})[_0x105f('0x50')](function(_0x1a663b){logger['error'](_0x105f('0x51'),_0x1a663b);throw _0x1a663b;});}return _0x5e81ff;})['then'](respondWithResult(_0x59dc2e,0xc9))[_0x105f('0x50')](handleError(_0x59dc2e,null));};exports[_0x105f('0x24')]=function(_0x4deb21,_0x131a63){if(_0x4deb21[_0x105f('0x49')]['id']){delete _0x4deb21[_0x105f('0x49')]['id'];}return db[_0x105f('0x2d')][_0x105f('0x47')]({'where':{'id':_0x4deb21['params']['id']}})[_0x105f('0x25')](handleEntityNotFound(_0x131a63,null))[_0x105f('0x25')](saveUpdates(_0x4deb21['body'],null))[_0x105f('0x25')](respondWithResult(_0x131a63,null))[_0x105f('0x50')](handleError(_0x131a63,null));};exports[_0x105f('0x26')]=function(_0x5cd249,_0x4b343c){return db[_0x105f('0x2d')][_0x105f('0x47')]({'where':{'id':_0x5cd249[_0x105f('0x52')]['id']}})[_0x105f('0x25')](handleEntityNotFound(_0x4b343c,null))['then'](removeEntity(_0x4b343c,null))[_0x105f('0x50')](handleError(_0x4b343c,null));}; \ No newline at end of file +var _0xe976=['Template','includeAll','findAll','rows','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','get','Templates','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0xe976,0x10e));var _0x6e97=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0xe976[_0x3ad7ad];return _0x225a60;};'use strict';var emlformat=require(_0x6e97('0x0'));var rimraf=require(_0x6e97('0x1'));var zipdir=require(_0x6e97('0x2'));var jsonpatch=require(_0x6e97('0x3'));var rp=require(_0x6e97('0x4'));var moment=require('moment');var BPromise=require(_0x6e97('0x5'));var Mustache=require('mustache');var util=require(_0x6e97('0x6'));var path=require(_0x6e97('0x7'));var sox=require(_0x6e97('0x8'));var csv=require(_0x6e97('0x9'));var ejs=require(_0x6e97('0xa'));var fs=require('fs');var fs_extra=require(_0x6e97('0xb'));var _=require(_0x6e97('0xc'));var squel=require('squel');var crypto=require(_0x6e97('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6e97('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6e97('0xf'));var Papa=require('papaparse');var Redis=require(_0x6e97('0x10'));var authService=require(_0x6e97('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e97('0x12'));var logger=require(_0x6e97('0x13'))('api');var utils=require(_0x6e97('0x14'));var config=require(_0x6e97('0x15'));var licenseUtil=require(_0x6e97('0x16'));var db=require(_0x6e97('0x17'))['db'];function respondWithStatusCode(_0x39cb45,_0x473657){_0x473657=_0x473657||0xcc;return function(_0x270613){if(_0x270613){return _0x39cb45[_0x6e97('0x18')](_0x473657);}return _0x39cb45[_0x6e97('0x19')](_0x473657)[_0x6e97('0x1a')]();};}function respondWithResult(_0x1045b5,_0x3fb1f9){_0x3fb1f9=_0x3fb1f9||0xc8;return function(_0x34ea6b){if(_0x34ea6b){return _0x1045b5['status'](_0x3fb1f9)[_0x6e97('0x1b')](_0x34ea6b);}};}function respondWithFilteredResult(_0x3e57de,_0x23796a){return function(_0x47202b){if(_0x47202b){var _0x44912d=typeof _0x23796a[_0x6e97('0x1c')]==='undefined'&&typeof _0x23796a['limit']===_0x6e97('0x1d');var _0x57d120=_0x47202b[_0x6e97('0x1e')];var _0x1f0b0d=_0x44912d?0x0:_0x23796a['offset'];var _0x23fe74=_0x44912d?_0x47202b[_0x6e97('0x1e')]:_0x23796a[_0x6e97('0x1c')]+_0x23796a[_0x6e97('0x1f')];var _0x50da1a;if(_0x23fe74>=_0x57d120){_0x23fe74=_0x57d120;_0x50da1a=0xc8;}else{_0x50da1a=0xce;}_0x3e57de[_0x6e97('0x19')](_0x50da1a);return _0x3e57de[_0x6e97('0x20')](_0x6e97('0x21'),_0x1f0b0d+'-'+_0x23fe74+'/'+_0x57d120)['json'](_0x47202b);}return null;};}function patchUpdates(_0x227ac3){return function(_0x1f94ce){try{jsonpatch[_0x6e97('0x22')](_0x1f94ce,_0x227ac3,!![]);}catch(_0x37918e){return BPromise[_0x6e97('0x23')](_0x37918e);}return _0x1f94ce[_0x6e97('0x24')]();};}function saveUpdates(_0x1b7364,_0x102412){return function(_0x3217d1){if(_0x3217d1){return _0x3217d1['update'](_0x1b7364)[_0x6e97('0x25')](function(_0x2623c0){return _0x2623c0;});}return null;};}function removeEntity(_0x425d50,_0x5e6896){return function(_0xe770af){if(_0xe770af){return _0xe770af['destroy']()[_0x6e97('0x25')](function(){var _0x5e6ab3=_0xe770af[_0x6e97('0x26')]({'plain':!![]});var _0x33706d=_0x6e97('0x27');return db[_0x6e97('0x28')][_0x6e97('0x29')]({'where':{'type':_0x33706d,'resourceId':_0x5e6ab3['id']}})['then'](function(){return _0xe770af;});})[_0x6e97('0x25')](function(){_0x425d50[_0x6e97('0x19')](0xcc)[_0x6e97('0x1a')]();});}};}function handleEntityNotFound(_0x386ee7,_0x47a155){return function(_0x19c68b){if(!_0x19c68b){_0x386ee7[_0x6e97('0x18')](0x194);}return _0x19c68b;};}function handleError(_0x2d3571,_0x1b9f10){_0x1b9f10=_0x1b9f10||0x1f4;return function(_0x3b9ec1){logger[_0x6e97('0x2a')](_0x3b9ec1['stack']);if(_0x3b9ec1[_0x6e97('0x2b')]){delete _0x3b9ec1[_0x6e97('0x2b')];}_0x2d3571[_0x6e97('0x19')](_0x1b9f10)[_0x6e97('0x2c')](_0x3b9ec1);};}exports[_0x6e97('0x2d')]=function(_0x59f126,_0x287bbd){var _0x550dc4={},_0x5cf569={},_0x163811={'count':0x0,'rows':[]};var _0x3de56d=_[_0x6e97('0x2e')](db['Template'][_0x6e97('0x2f')],function(_0x245c8c){return{'name':_0x245c8c[_0x6e97('0x30')],'type':_0x245c8c[_0x6e97('0x31')][_0x6e97('0x32')]};});_0x5cf569['model']=_[_0x6e97('0x2e')](_0x3de56d,_0x6e97('0x2b'));_0x5cf569[_0x6e97('0x33')]=_[_0x6e97('0x34')](_0x59f126[_0x6e97('0x33')]);_0x5cf569['filters']=_[_0x6e97('0x35')](_0x5cf569['model'],_0x5cf569[_0x6e97('0x33')]);_0x550dc4[_0x6e97('0x36')]=_[_0x6e97('0x35')](_0x5cf569[_0x6e97('0x37')],qs[_0x6e97('0x38')](_0x59f126['query']['fields']));_0x550dc4[_0x6e97('0x36')]=_0x550dc4[_0x6e97('0x36')]['length']?_0x550dc4['attributes']:_0x5cf569[_0x6e97('0x37')];if(!_0x59f126[_0x6e97('0x33')]['hasOwnProperty'](_0x6e97('0x39'))){_0x550dc4['limit']=qs['limit'](_0x59f126[_0x6e97('0x33')]['limit']);_0x550dc4[_0x6e97('0x1c')]=qs[_0x6e97('0x1c')](_0x59f126[_0x6e97('0x33')]['offset']);}_0x550dc4[_0x6e97('0x3a')]=qs[_0x6e97('0x3b')](_0x59f126[_0x6e97('0x33')]['sort']);_0x550dc4['where']=qs[_0x6e97('0x3c')](_[_0x6e97('0x3d')](_0x59f126['query'],_0x5cf569[_0x6e97('0x3c')]),_0x3de56d);if(_0x59f126[_0x6e97('0x33')][_0x6e97('0x3e')]){_0x550dc4[_0x6e97('0x3f')]=_[_0x6e97('0x40')](_0x550dc4[_0x6e97('0x3f')],{'$or':_[_0x6e97('0x2e')](_0x3de56d,function(_0x2e689b){if(_0x2e689b[_0x6e97('0x31')]!==_0x6e97('0x41')){var _0x16a037={};_0x16a037[_0x2e689b[_0x6e97('0x2b')]]={'$like':'%'+_0x59f126['query']['filter']+'%'};return _0x16a037;}})});}_0x550dc4=_[_0x6e97('0x40')]({},_0x550dc4,_0x59f126['options']);var _0xe6067a={'where':_0x550dc4[_0x6e97('0x3f')]};return db[_0x6e97('0x42')][_0x6e97('0x1e')](_0xe6067a)['then'](function(_0x488f8d){_0x163811[_0x6e97('0x1e')]=_0x488f8d;if(_0x59f126[_0x6e97('0x33')][_0x6e97('0x43')]){_0x550dc4['include']=[{'all':!![]}];}return db[_0x6e97('0x42')][_0x6e97('0x44')](_0x550dc4);})[_0x6e97('0x25')](function(_0x5e6bf4){_0x163811[_0x6e97('0x45')]=_0x5e6bf4;return _0x163811;})[_0x6e97('0x25')](respondWithFilteredResult(_0x287bbd,_0x550dc4))[_0x6e97('0x46')](handleError(_0x287bbd,null));};exports[_0x6e97('0x47')]=function(_0x47c0c3,_0x3921fb){var _0x1b4619={'raw':!![],'where':{'id':_0x47c0c3[_0x6e97('0x48')]['id']}},_0x6d60d7={};_0x6d60d7['model']=_[_0x6e97('0x34')](db[_0x6e97('0x42')][_0x6e97('0x2f')]);_0x6d60d7[_0x6e97('0x33')]=_['keys'](_0x47c0c3[_0x6e97('0x33')]);_0x6d60d7[_0x6e97('0x3c')]=_[_0x6e97('0x35')](_0x6d60d7[_0x6e97('0x37')],_0x6d60d7[_0x6e97('0x33')]);_0x1b4619[_0x6e97('0x36')]=_[_0x6e97('0x35')](_0x6d60d7['model'],qs[_0x6e97('0x38')](_0x47c0c3[_0x6e97('0x33')][_0x6e97('0x38')]));_0x1b4619[_0x6e97('0x36')]=_0x1b4619['attributes']['length']?_0x1b4619['attributes']:_0x6d60d7[_0x6e97('0x37')];if(_0x47c0c3[_0x6e97('0x33')][_0x6e97('0x43')]){_0x1b4619['include']=[{'all':!![]}];}_0x1b4619=_[_0x6e97('0x40')]({},_0x1b4619,_0x47c0c3[_0x6e97('0x49')]);return db[_0x6e97('0x42')][_0x6e97('0x4a')](_0x1b4619)['then'](handleEntityNotFound(_0x3921fb,null))[_0x6e97('0x25')](respondWithResult(_0x3921fb,null))['catch'](handleError(_0x3921fb,null));};exports[_0x6e97('0x4b')]=function(_0x338701,_0x1921d8){return db[_0x6e97('0x42')][_0x6e97('0x4b')](_0x338701['body'],{})[_0x6e97('0x25')](function(_0x452a2a){var _0x44b101=_0x338701[_0x6e97('0x4c')][_0x6e97('0x26')]({'plain':!![]});if(!_0x44b101)throw new Error(_0x6e97('0x4d'));if(_0x44b101[_0x6e97('0x4e')]===_0x6e97('0x4c')){var _0x426c43=_0x452a2a[_0x6e97('0x26')]({'plain':!![]});var _0x2f4300=_0x6e97('0x27');return db[_0x6e97('0x4f')]['find']({'where':{'name':_0x2f4300,'userProfileId':_0x44b101['userProfileId']},'raw':!![]})[_0x6e97('0x25')](function(_0xcc8b84){if(_0xcc8b84&&_0xcc8b84[_0x6e97('0x50')]===0x0){return db[_0x6e97('0x28')]['create']({'name':_0x426c43[_0x6e97('0x2b')],'resourceId':_0x426c43['id'],'type':_0xcc8b84[_0x6e97('0x2b')],'sectionId':_0xcc8b84['id']},{})[_0x6e97('0x25')](function(){return _0x452a2a;});}else{return _0x452a2a;}})[_0x6e97('0x46')](function(_0x34c2a0){logger['error'](_0x6e97('0x51'),_0x34c2a0);throw _0x34c2a0;});}return _0x452a2a;})['then'](respondWithResult(_0x1921d8,0xc9))[_0x6e97('0x46')](handleError(_0x1921d8,null));};exports[_0x6e97('0x52')]=function(_0x20a6a8,_0x3f7283){if(_0x20a6a8[_0x6e97('0x53')]['id']){delete _0x20a6a8[_0x6e97('0x53')]['id'];}return db[_0x6e97('0x42')][_0x6e97('0x4a')]({'where':{'id':_0x20a6a8[_0x6e97('0x48')]['id']}})['then'](handleEntityNotFound(_0x3f7283,null))[_0x6e97('0x25')](saveUpdates(_0x20a6a8['body'],null))[_0x6e97('0x25')](respondWithResult(_0x3f7283,null))[_0x6e97('0x46')](handleError(_0x3f7283,null));};exports[_0x6e97('0x29')]=function(_0x1deecd,_0x48b513){return db[_0x6e97('0x42')]['find']({'where':{'id':_0x1deecd[_0x6e97('0x48')]['id']}})[_0x6e97('0x25')](handleEntityNotFound(_0x48b513,null))[_0x6e97('0x25')](removeEntity(_0x48b513,null))[_0x6e97('0x46')](handleError(_0x48b513,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index de576c6..4b39091 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 _0x22f1=['exports','define','tools_templates','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./template.attributes'];(function(_0x17bbb2,_0x5eb2f8){var _0x2a3cea=function(_0x4ec29b){while(--_0x4ec29b){_0x17bbb2['push'](_0x17bbb2['shift']());}};_0x2a3cea(++_0x5eb2f8);}(_0x22f1,0x147));var _0x122f=function(_0x3b9772,_0x5286d6){_0x3b9772=_0x3b9772-0x0;var _0x4b1a6d=_0x22f1[_0x3b9772];return _0x4b1a6d;};'use strict';var _=require(_0x122f('0x0'));var util=require('util');var logger=require(_0x122f('0x1'))(_0x122f('0x2'));var moment=require(_0x122f('0x3'));var BPromise=require('bluebird');var rp=require(_0x122f('0x4'));var fs=require('fs');var path=require(_0x122f('0x5'));var rimraf=require(_0x122f('0x6'));var config=require(_0x122f('0x7'));var attributes=require(_0x122f('0x8'));module[_0x122f('0x9')]=function(_0x3b4502,_0x4aa0ea){return _0x3b4502[_0x122f('0xa')]('Template',attributes,{'tableName':_0x122f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46cc=['path','rimraf','./template.attributes','exports','define','Template','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x44dbb9,_0x55b599){var _0x4d1167=function(_0x269279){while(--_0x269279){_0x44dbb9['push'](_0x44dbb9['shift']());}};_0x4d1167(++_0x55b599);}(_0x46cc,0x1aa));var _0xc46c=function(_0x59fb70,_0x56af62){_0x59fb70=_0x59fb70-0x0;var _0x31e982=_0x46cc[_0x59fb70];return _0x31e982;};'use strict';var _=require(_0xc46c('0x0'));var util=require(_0xc46c('0x1'));var logger=require(_0xc46c('0x2'))(_0xc46c('0x3'));var moment=require('moment');var BPromise=require(_0xc46c('0x4'));var rp=require(_0xc46c('0x5'));var fs=require('fs');var path=require(_0xc46c('0x6'));var rimraf=require(_0xc46c('0x7'));var config=require('../../config/environment');var attributes=require(_0xc46c('0x8'));module[_0xc46c('0x9')]=function(_0x144294,_0xb45cd7){return _0x144294[_0xc46c('0xa')](_0xc46c('0xb'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index a03c51f..970b34f 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 _0xc107=['stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','map','include','model'];(function(_0x49abc4,_0x3a9ea2){var _0x59c694=function(_0x448780){while(--_0x448780){_0x49abc4['push'](_0x49abc4['shift']());}};_0x59c694(++_0x3a9ea2);}(_0xc107,0x13c));var _0x7c10=function(_0x2d5da1,_0x1a0315){_0x2d5da1=_0x2d5da1-0x0;var _0x40b7b1=_0xc107[_0x2d5da1];return _0x40b7b1;};'use strict';var _=require(_0x7c10('0x0'));var util=require(_0x7c10('0x1'));var moment=require('moment');var BPromise=require(_0x7c10('0x2'));var rs=require(_0x7c10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c10('0x4'))['db'];var utils=require(_0x7c10('0x5'));var logger=require(_0x7c10('0x6'))(_0x7c10('0x7'));var config=require(_0x7c10('0x8'));var jayson=require(_0x7c10('0x9'));var client=jayson[_0x7c10('0xa')][_0x7c10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcfd492,_0x563051,_0x16206a){return new BPromise(function(_0x1b0c7b,_0x2ceaaa){return client[_0x7c10('0xc')](_0xcfd492,_0x16206a)[_0x7c10('0xd')](function(_0x4ec00c){logger[_0x7c10('0xe')](_0x7c10('0xf'),_0x563051,_0x7c10('0x10'));logger['debug'](_0x7c10('0x11'),_0x563051,_0x7c10('0x10'),JSON['stringify'](_0x4ec00c));if(_0x4ec00c[_0x7c10('0x12')]){if(_0x4ec00c[_0x7c10('0x12')][_0x7c10('0x13')]===0x1f4){logger[_0x7c10('0x12')](_0x7c10('0xf'),_0x563051,_0x4ec00c['error'][_0x7c10('0x14')]);return _0x2ceaaa(_0x4ec00c[_0x7c10('0x12')][_0x7c10('0x14')]);}logger['error']('Template,\x20%s,\x20%s',_0x563051,_0x4ec00c[_0x7c10('0x12')][_0x7c10('0x14')]);return _0x1b0c7b(_0x4ec00c[_0x7c10('0x12')][_0x7c10('0x14')]);}else{logger[_0x7c10('0xe')](_0x7c10('0xf'),_0x563051,_0x7c10('0x10'));_0x1b0c7b(_0x4ec00c[_0x7c10('0x15')]['message']);}})[_0x7c10('0x16')](function(_0x17deac){logger[_0x7c10('0x12')](_0x7c10('0xf'),_0x563051,_0x17deac);_0x2ceaaa(_0x17deac);});});}exports[_0x7c10('0x17')]=function(_0x4e2a6c){var _0x9ced4c=this;return new Promise(function(_0x3b7235,_0x5cfcd8){return db[_0x7c10('0x18')][_0x7c10('0x19')]({'raw':_0x4e2a6c[_0x7c10('0x1a')]?_0x4e2a6c['options'][_0x7c10('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e2a6c['options']?_0x4e2a6c['options'][_0x7c10('0x1c')]||null:null,'attributes':_0x4e2a6c['options']?_0x4e2a6c[_0x7c10('0x1a')][_0x7c10('0x1d')]||null:null,'limit':_0x4e2a6c[_0x7c10('0x1a')]?_0x4e2a6c['options'][_0x7c10('0x1e')]||null:null,'include':_0x4e2a6c[_0x7c10('0x1a')]?_0x4e2a6c[_0x7c10('0x1a')]['include']?_[_0x7c10('0x1f')](_0x4e2a6c[_0x7c10('0x1a')][_0x7c10('0x20')],function(_0x5cea21){return{'model':db[_0x5cea21['model']],'as':_0x5cea21['as'],'attributes':_0x5cea21[_0x7c10('0x1d')],'include':_0x5cea21[_0x7c10('0x20')]?_[_0x7c10('0x1f')](_0x5cea21[_0x7c10('0x20')],function(_0x46a4f8){return{'model':db[_0x46a4f8['model']],'as':_0x46a4f8['as'],'attributes':_0x46a4f8[_0x7c10('0x1d')],'include':_0x46a4f8[_0x7c10('0x20')]?_[_0x7c10('0x1f')](_0x46a4f8['include'],function(_0x4a880c){return{'model':db[_0x4a880c[_0x7c10('0x21')]],'as':_0x4a880c['as'],'attributes':_0x4a880c[_0x7c10('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7c10('0xd')](function(_0x247cba){logger[_0x7c10('0xe')](_0x7c10('0x17'),_0x4e2a6c);logger['debug'](_0x7c10('0x17'),_0x4e2a6c,JSON[_0x7c10('0x22')](_0x247cba));_0x3b7235(_0x247cba);})[_0x7c10('0x16')](function(_0x3c76dc){logger[_0x7c10('0x12')]('GetTemplate',_0x3c76dc[_0x7c10('0x14')],_0x4e2a6c);_0x5cfcd8(_0x9ced4c['error'](0x1f4,_0x3c76dc['message']));});});}; \ No newline at end of file +var _0x0fe9=['request\x20sent','error','code','message','result','catch','GetTemplate','Template','findAll','options','where','attributes','limit','include','model','map','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0x0fe9,0xd0));var _0x90fe=function(_0xf56370,_0x5daded){_0xf56370=_0xf56370-0x0;var _0x4d5366=_0x0fe9[_0xf56370];return _0x4d5366;};'use strict';var _=require(_0x90fe('0x0'));var util=require(_0x90fe('0x1'));var moment=require(_0x90fe('0x2'));var BPromise=require(_0x90fe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90fe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x90fe('0x5'));var logger=require(_0x90fe('0x6'))(_0x90fe('0x7'));var config=require(_0x90fe('0x8'));var jayson=require(_0x90fe('0x9'));var client=jayson['client'][_0x90fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19c38d,_0x1a59b8,_0x291e70){return new BPromise(function(_0x12b187,_0x28f179){return client[_0x90fe('0xb')](_0x19c38d,_0x291e70)[_0x90fe('0xc')](function(_0x51c2c5){logger['info'](_0x90fe('0xd'),_0x1a59b8,'request\x20sent');logger[_0x90fe('0xe')](_0x90fe('0xf'),_0x1a59b8,_0x90fe('0x10'),JSON['stringify'](_0x51c2c5));if(_0x51c2c5[_0x90fe('0x11')]){if(_0x51c2c5[_0x90fe('0x11')][_0x90fe('0x12')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x1a59b8,_0x51c2c5[_0x90fe('0x11')]['message']);return _0x28f179(_0x51c2c5[_0x90fe('0x11')][_0x90fe('0x13')]);}logger[_0x90fe('0x11')](_0x90fe('0xd'),_0x1a59b8,_0x51c2c5[_0x90fe('0x11')]['message']);return _0x12b187(_0x51c2c5['error'][_0x90fe('0x13')]);}else{logger['info'](_0x90fe('0xd'),_0x1a59b8,_0x90fe('0x10'));_0x12b187(_0x51c2c5[_0x90fe('0x14')][_0x90fe('0x13')]);}})[_0x90fe('0x15')](function(_0x43c91c){logger['error']('Template,\x20%s,\x20%s',_0x1a59b8,_0x43c91c);_0x28f179(_0x43c91c);});});}exports[_0x90fe('0x16')]=function(_0x4fea34){var _0x389648=this;return new Promise(function(_0x1d2dba,_0x3f2bfb){return db[_0x90fe('0x17')][_0x90fe('0x18')]({'raw':_0x4fea34[_0x90fe('0x19')]?_0x4fea34['options']['raw']===undefined?!![]:![]:!![],'where':_0x4fea34['options']?_0x4fea34['options'][_0x90fe('0x1a')]||null:null,'attributes':_0x4fea34[_0x90fe('0x19')]?_0x4fea34[_0x90fe('0x19')][_0x90fe('0x1b')]||null:null,'limit':_0x4fea34[_0x90fe('0x19')]?_0x4fea34[_0x90fe('0x19')][_0x90fe('0x1c')]||null:null,'include':_0x4fea34[_0x90fe('0x19')]?_0x4fea34[_0x90fe('0x19')][_0x90fe('0x1d')]?_['map'](_0x4fea34['options'][_0x90fe('0x1d')],function(_0xd6504){return{'model':db[_0xd6504[_0x90fe('0x1e')]],'as':_0xd6504['as'],'attributes':_0xd6504[_0x90fe('0x1b')],'include':_0xd6504[_0x90fe('0x1d')]?_['map'](_0xd6504[_0x90fe('0x1d')],function(_0x5c27ea){return{'model':db[_0x5c27ea['model']],'as':_0x5c27ea['as'],'attributes':_0x5c27ea[_0x90fe('0x1b')],'include':_0x5c27ea[_0x90fe('0x1d')]?_[_0x90fe('0x1f')](_0x5c27ea[_0x90fe('0x1d')],function(_0x34311f){return{'model':db[_0x34311f[_0x90fe('0x1e')]],'as':_0x34311f['as'],'attributes':_0x34311f[_0x90fe('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x90fe('0xc')](function(_0x5e5519){logger['info'](_0x90fe('0x16'),_0x4fea34);logger[_0x90fe('0xe')](_0x90fe('0x16'),_0x4fea34,JSON['stringify'](_0x5e5519));_0x1d2dba(_0x5e5519);})[_0x90fe('0x15')](function(_0x109dd0){logger[_0x90fe('0x11')](_0x90fe('0x16'),_0x109dd0[_0x90fe('0x13')],_0x4fea34);_0x3f2bfb(_0x389648[_0x90fe('0x11')](0x1f4,_0x109dd0[_0x90fe('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index e37299a..1614585 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 _0x4a56=['index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get'];(function(_0x1a45e3,_0x385589){var _0x3615f8=function(_0x40ce0a){while(--_0x40ce0a){_0x1a45e3['push'](_0x1a45e3['shift']());}};_0x3615f8(++_0x385589);}(_0x4a56,0x17c));var _0x64a5=function(_0x159791,_0x5d957e){_0x159791=_0x159791-0x0;var _0x7fa5c1=_0x4a56[_0x159791];return _0x7fa5c1;};'use strict';var multer=require(_0x64a5('0x0'));var util=require(_0x64a5('0x1'));var path=require('path');var timeout=require(_0x64a5('0x2'));var express=require(_0x64a5('0x3'));var router=express[_0x64a5('0x4')]();var fs_extra=require(_0x64a5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x64a5('0x6'));var config=require(_0x64a5('0x7'));var controller=require(_0x64a5('0x8'));router[_0x64a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x64a5('0xa')]);router['get'](_0x64a5('0xb'),auth[_0x64a5('0xc')](),controller[_0x64a5('0xd')]);router['get'](_0x64a5('0xe'),auth[_0x64a5('0xc')](),controller[_0x64a5('0xf')]);router[_0x64a5('0x9')](_0x64a5('0x10'),auth[_0x64a5('0xc')](),controller[_0x64a5('0x11')]);router['get'](_0x64a5('0x12'),auth[_0x64a5('0xc')](),controller[_0x64a5('0x13')]);router['post']('/',auth[_0x64a5('0xc')](),controller['create']);router[_0x64a5('0x14')](_0x64a5('0xe'),auth[_0x64a5('0xc')](),controller[_0x64a5('0x15')]);router[_0x64a5('0x14')]('/:id/any_conditions',auth[_0x64a5('0xc')](),controller[_0x64a5('0x16')]);router['post'](_0x64a5('0x12'),auth[_0x64a5('0xc')](),controller['addAction']);router[_0x64a5('0x17')](_0x64a5('0xb'),auth[_0x64a5('0xc')](),controller['update']);router[_0x64a5('0x18')]('/:id',auth[_0x64a5('0xc')](),controller[_0x64a5('0x19')]);module['exports']=router; \ No newline at end of file +var _0x6a27=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','/:id/all_conditions','/:id/any_conditions','/:id/actions','getActions','post','addAnyCondition','addAction','put','update','delete','destroy'];(function(_0x5441ca,_0x5b9c25){var _0x239933=function(_0x462c94){while(--_0x462c94){_0x5441ca['push'](_0x5441ca['shift']());}};_0x239933(++_0x5b9c25);}(_0x6a27,0x97));var _0x76a2=function(_0x1e6737,_0x3a00b9){_0x1e6737=_0x1e6737-0x0;var _0x13209b=_0x6a27[_0x1e6737];return _0x13209b;};'use strict';var multer=require(_0x76a2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x76a2('0x1'));var express=require(_0x76a2('0x2'));var router=express[_0x76a2('0x3')]();var fs_extra=require(_0x76a2('0x4'));var auth=require(_0x76a2('0x5'));var interaction=require(_0x76a2('0x6'));var config=require(_0x76a2('0x7'));var controller=require(_0x76a2('0x8'));router[_0x76a2('0x9')]('/',auth[_0x76a2('0xa')](),controller[_0x76a2('0xb')]);router[_0x76a2('0x9')](_0x76a2('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x76a2('0xd'),auth[_0x76a2('0xa')](),controller['getAllConditions']);router[_0x76a2('0x9')](_0x76a2('0xe'),auth[_0x76a2('0xa')](),controller['getAnyConditions']);router[_0x76a2('0x9')](_0x76a2('0xf'),auth[_0x76a2('0xa')](),controller[_0x76a2('0x10')]);router[_0x76a2('0x11')]('/',auth[_0x76a2('0xa')](),controller['create']);router[_0x76a2('0x11')](_0x76a2('0xd'),auth[_0x76a2('0xa')](),controller['addAllCondition']);router[_0x76a2('0x11')](_0x76a2('0xe'),auth[_0x76a2('0xa')](),controller[_0x76a2('0x12')]);router[_0x76a2('0x11')]('/:id/actions',auth['isAuthenticated'](),controller[_0x76a2('0x13')]);router[_0x76a2('0x14')](_0x76a2('0xc'),auth['isAuthenticated'](),controller[_0x76a2('0x15')]);router[_0x76a2('0x16')](_0x76a2('0xc'),auth[_0x76a2('0xa')](),controller[_0x76a2('0x17')]);module[_0x76a2('0x18')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 9b2dce4..d423709 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 _0xb190=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4fa5b7,_0x42a92d){var _0x578649=function(_0x2c38b1){while(--_0x2c38b1){_0x4fa5b7['push'](_0x4fa5b7['shift']());}};_0x578649(++_0x42a92d);}(_0xb190,0xce));var _0x0b19=function(_0x3d31ec,_0x4d7752){_0x3d31ec=_0x3d31ec-0x0;var _0x395d72=_0xb190[_0x3d31ec];return _0x395d72;};'use strict';var Sequelize=require(_0x0b19('0x0'));module[_0x0b19('0x1')]={'name':{'type':Sequelize[_0x0b19('0x2')]},'channel':{'type':Sequelize[_0x0b19('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x0b19('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x83a6=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2bd1ec,_0x3fe65f){var _0x2f7577=function(_0x5234fb){while(--_0x5234fb){_0x2bd1ec['push'](_0x2bd1ec['shift']());}};_0x2f7577(++_0x3fe65f);}(_0x83a6,0x162));var _0x683a=function(_0x1020f8,_0x139ab0){_0x1020f8=_0x1020f8-0x0;var _0x3613cd=_0x83a6[_0x1020f8];return _0x3613cd;};'use strict';var Sequelize=require(_0x683a('0x0'));module[_0x683a('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x683a('0x2')]},'status':{'type':Sequelize[_0x683a('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 0d7c5ed..ca53999 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 _0x251a=['includeAll','include','findAll','rows','catch','params','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAnyId','getAllConditions','findOne','Condition','hasOwnProperty','getAnyConditions','addAction','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','end','error','stack','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trigger'];(function(_0x1829c6,_0x4d98fd){var _0x19a7a0=function(_0x1292d5){while(--_0x1292d5){_0x1829c6['push'](_0x1829c6['shift']());}};_0x19a7a0(++_0x4d98fd);}(_0x251a,0x188));var _0xa251=function(_0x3a7e42,_0x58e47d){_0x3a7e42=_0x3a7e42-0x0;var _0x7122b7=_0x251a[_0x3a7e42];return _0x7122b7;};'use strict';var emlformat=require(_0xa251('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa251('0x1'));var jsonpatch=require(_0xa251('0x2'));var rp=require(_0xa251('0x3'));var moment=require(_0xa251('0x4'));var BPromise=require(_0xa251('0x5'));var Mustache=require(_0xa251('0x6'));var util=require(_0xa251('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa251('0x8'));var fs=require('fs');var fs_extra=require(_0xa251('0x9'));var _=require(_0xa251('0xa'));var squel=require(_0xa251('0xb'));var crypto=require('crypto');var jsforce=require(_0xa251('0xc'));var deskjs=require(_0xa251('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa251('0xe'));var Redis=require(_0xa251('0xf'));var authService=require(_0xa251('0x10'));var qs=require(_0xa251('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa251('0x12'));var logger=require(_0xa251('0x13'))('api');var utils=require(_0xa251('0x14'));var config=require(_0xa251('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa251('0x16'))['db'];function respondWithStatusCode(_0x4a20ff,_0x2d8982){_0x2d8982=_0x2d8982||0xcc;return function(_0x5eb904){if(_0x5eb904){return _0x4a20ff[_0xa251('0x17')](_0x2d8982);}return _0x4a20ff[_0xa251('0x18')](_0x2d8982)['end']();};}function respondWithResult(_0x4e8e0d,_0x3c2b90){_0x3c2b90=_0x3c2b90||0xc8;return function(_0x34b5ef){if(_0x34b5ef){return _0x4e8e0d[_0xa251('0x18')](_0x3c2b90)[_0xa251('0x19')](_0x34b5ef);}};}function respondWithFilteredResult(_0x162348,_0x1a980c){return function(_0x2fe74a){if(_0x2fe74a){var _0x2413d1=typeof _0x1a980c['offset']===_0xa251('0x1a')&&typeof _0x1a980c[_0xa251('0x1b')]===_0xa251('0x1a');var _0x2eba52=_0x2fe74a['count'];var _0x44f6a4=_0x2413d1?0x0:_0x1a980c[_0xa251('0x1c')];var _0xbfa87a=_0x2413d1?_0x2fe74a[_0xa251('0x1d')]:_0x1a980c[_0xa251('0x1c')]+_0x1a980c[_0xa251('0x1b')];var _0x25185e;if(_0xbfa87a>=_0x2eba52){_0xbfa87a=_0x2eba52;_0x25185e=0xc8;}else{_0x25185e=0xce;}_0x162348[_0xa251('0x18')](_0x25185e);return _0x162348[_0xa251('0x1e')](_0xa251('0x1f'),_0x44f6a4+'-'+_0xbfa87a+'/'+_0x2eba52)[_0xa251('0x19')](_0x2fe74a);}return null;};}function patchUpdates(_0x313b04){return function(_0x13107e){try{jsonpatch[_0xa251('0x20')](_0x13107e,_0x313b04,!![]);}catch(_0x5059ce){return BPromise[_0xa251('0x21')](_0x5059ce);}return _0x13107e[_0xa251('0x22')]();};}function saveUpdates(_0x5f2f75,_0x38c764){return function(_0xf96b43){if(_0xf96b43){return _0xf96b43[_0xa251('0x23')](_0x5f2f75)[_0xa251('0x24')](function(_0x2838d9){return _0x2838d9;});}return null;};}function removeEntity(_0x3466f8,_0x24148c){return function(_0x5239a2){if(_0x5239a2){return _0x5239a2[_0xa251('0x25')]()[_0xa251('0x24')](function(){var _0x43d6fc=_0x5239a2[_0xa251('0x26')]({'plain':!![]});var _0x45cc5a=_0xa251('0x27');return db['UserProfileResource'][_0xa251('0x25')]({'where':{'type':_0x45cc5a,'resourceId':_0x43d6fc['id']}})[_0xa251('0x24')](function(){return _0x5239a2;});})[_0xa251('0x24')](function(){_0x3466f8[_0xa251('0x18')](0xcc)[_0xa251('0x28')]();});}};}function handleEntityNotFound(_0xaf879,_0x3fa5b1){return function(_0x245d08){if(!_0x245d08){_0xaf879['sendStatus'](0x194);}return _0x245d08;};}function handleError(_0x578c1f,_0x4a0f7c){_0x4a0f7c=_0x4a0f7c||0x1f4;return function(_0x83f1fb){logger[_0xa251('0x29')](_0x83f1fb[_0xa251('0x2a')]);if(_0x83f1fb[_0xa251('0x2b')]){delete _0x83f1fb[_0xa251('0x2b')];}_0x578c1f[_0xa251('0x18')](_0x4a0f7c)[_0xa251('0x2c')](_0x83f1fb);};}exports[_0xa251('0x2d')]=function(_0x1dc5dc,_0x2fa03b){var _0x14b011={},_0x5826d4={},_0x57832d={'count':0x0,'rows':[]};var _0x3dc48b=_[_0xa251('0x2e')](db['Trigger'][_0xa251('0x2f')],function(_0x187091){return{'name':_0x187091['fieldName'],'type':_0x187091['type'][_0xa251('0x30')]};});_0x5826d4[_0xa251('0x31')]=_['map'](_0x3dc48b,_0xa251('0x2b'));_0x5826d4['query']=_[_0xa251('0x32')](_0x1dc5dc['query']);_0x5826d4[_0xa251('0x33')]=_[_0xa251('0x34')](_0x5826d4['model'],_0x5826d4[_0xa251('0x35')]);_0x14b011[_0xa251('0x36')]=_[_0xa251('0x34')](_0x5826d4['model'],qs[_0xa251('0x37')](_0x1dc5dc[_0xa251('0x35')][_0xa251('0x37')]));_0x14b011[_0xa251('0x36')]=_0x14b011[_0xa251('0x36')][_0xa251('0x38')]?_0x14b011[_0xa251('0x36')]:_0x5826d4[_0xa251('0x31')];if(!_0x1dc5dc[_0xa251('0x35')]['hasOwnProperty'](_0xa251('0x39'))){_0x14b011['limit']=qs[_0xa251('0x1b')](_0x1dc5dc['query'][_0xa251('0x1b')]);_0x14b011[_0xa251('0x1c')]=qs[_0xa251('0x1c')](_0x1dc5dc[_0xa251('0x35')][_0xa251('0x1c')]);}_0x14b011[_0xa251('0x3a')]=qs[_0xa251('0x3b')](_0x1dc5dc[_0xa251('0x35')][_0xa251('0x3b')]);_0x14b011[_0xa251('0x3c')]=qs['filters'](_[_0xa251('0x3d')](_0x1dc5dc[_0xa251('0x35')],_0x5826d4[_0xa251('0x33')]),_0x3dc48b);if(_0x1dc5dc['query'][_0xa251('0x3e')]){_0x14b011[_0xa251('0x3c')]=_[_0xa251('0x3f')](_0x14b011[_0xa251('0x3c')],{'$or':_[_0xa251('0x2e')](_0x3dc48b,function(_0x5826cc){if(_0x5826cc[_0xa251('0x40')]!==_0xa251('0x41')){var _0x4a61ce={};_0x4a61ce[_0x5826cc[_0xa251('0x2b')]]={'$like':'%'+_0x1dc5dc[_0xa251('0x35')][_0xa251('0x3e')]+'%'};return _0x4a61ce;}})});}_0x14b011=_[_0xa251('0x3f')]({},_0x14b011,_0x1dc5dc[_0xa251('0x42')]);var _0x2bd0ae={'where':_0x14b011[_0xa251('0x3c')]};return db[_0xa251('0x43')]['count'](_0x2bd0ae)[_0xa251('0x24')](function(_0x4ee614){_0x57832d['count']=_0x4ee614;if(_0x1dc5dc['query'][_0xa251('0x44')]){_0x14b011[_0xa251('0x45')]=[{'all':!![]}];}return db['Trigger'][_0xa251('0x46')](_0x14b011);})['then'](function(_0x2c2a36){_0x57832d[_0xa251('0x47')]=_0x2c2a36;return _0x57832d;})[_0xa251('0x24')](respondWithFilteredResult(_0x2fa03b,_0x14b011))[_0xa251('0x48')](handleError(_0x2fa03b,null));};exports['show']=function(_0x228c04,_0x90c202){var _0xc000a4={'raw':![],'where':{'id':_0x228c04[_0xa251('0x49')]['id']}},_0x5729ba={};_0x5729ba['model']=_[_0xa251('0x32')](db[_0xa251('0x43')][_0xa251('0x2f')]);_0x5729ba['query']=_[_0xa251('0x32')](_0x228c04[_0xa251('0x35')]);_0x5729ba['filters']=_[_0xa251('0x34')](_0x5729ba['model'],_0x5729ba[_0xa251('0x35')]);_0xc000a4['attributes']=_[_0xa251('0x34')](_0x5729ba[_0xa251('0x31')],qs[_0xa251('0x37')](_0x228c04[_0xa251('0x35')]['fields']));_0xc000a4[_0xa251('0x36')]=_0xc000a4[_0xa251('0x36')][_0xa251('0x38')]?_0xc000a4['attributes']:_0x5729ba[_0xa251('0x31')];if(_0x228c04[_0xa251('0x35')][_0xa251('0x44')]){_0xc000a4['include']=[{'all':!![]}];}_0xc000a4=_[_0xa251('0x3f')]({},_0xc000a4,_0x228c04[_0xa251('0x42')]);return db[_0xa251('0x43')]['find'](_0xc000a4)[_0xa251('0x24')](handleEntityNotFound(_0x90c202,null))[_0xa251('0x24')](respondWithResult(_0x90c202,null))[_0xa251('0x48')](handleError(_0x90c202,null));};exports[_0xa251('0x4a')]=function(_0x408b24,_0x4b2036){return db[_0xa251('0x43')][_0xa251('0x4a')](_0x408b24[_0xa251('0x4b')],{})[_0xa251('0x24')](function(_0x4ee7b8){var _0x3e4861=_0x408b24[_0xa251('0x4c')][_0xa251('0x26')]({'plain':!![]});if(!_0x3e4861)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e4861[_0xa251('0x4d')]===_0xa251('0x4c')){var _0xd5736f=_0x4ee7b8[_0xa251('0x26')]({'plain':!![]});var _0xecb024='Triggers';return db[_0xa251('0x4e')][_0xa251('0x4f')]({'where':{'name':_0xecb024,'userProfileId':_0x3e4861[_0xa251('0x50')]},'raw':!![]})[_0xa251('0x24')](function(_0x3de489){if(_0x3de489&&_0x3de489[_0xa251('0x51')]===0x0){return db[_0xa251('0x52')]['create']({'name':_0xd5736f[_0xa251('0x2b')],'resourceId':_0xd5736f['id'],'type':_0x3de489[_0xa251('0x2b')],'sectionId':_0x3de489['id']},{})['then'](function(){return _0x4ee7b8;});}else{return _0x4ee7b8;}})[_0xa251('0x48')](function(_0x2bf1cf){logger['error'](_0xa251('0x53'),_0x2bf1cf);throw _0x2bf1cf;});}return _0x4ee7b8;})['then'](respondWithResult(_0x4b2036,0xc9))[_0xa251('0x48')](handleError(_0x4b2036,null));};exports[_0xa251('0x23')]=function(_0x27b677,_0x568de7){if(_0x27b677[_0xa251('0x4b')]['id']){delete _0x27b677[_0xa251('0x4b')]['id'];}return db[_0xa251('0x43')][_0xa251('0x4f')]({'where':{'id':_0x27b677[_0xa251('0x49')]['id']}})[_0xa251('0x24')](handleEntityNotFound(_0x568de7,null))[_0xa251('0x24')](saveUpdates(_0x27b677[_0xa251('0x4b')],null))[_0xa251('0x24')](respondWithResult(_0x568de7,null))[_0xa251('0x48')](handleError(_0x568de7,null));};exports[_0xa251('0x25')]=function(_0x1373f7,_0x510376){return db[_0xa251('0x43')][_0xa251('0x4f')]({'where':{'id':_0x1373f7[_0xa251('0x49')]['id']}})[_0xa251('0x24')](handleEntityNotFound(_0x510376,null))[_0xa251('0x24')](removeEntity(_0x510376,null))[_0xa251('0x48')](handleError(_0x510376,null));};exports['addAllCondition']=function(_0x331880,_0x39474e,_0x1fa777){if(_0x331880[_0xa251('0x4b')]['id']){delete _0x331880['body']['id'];}return db[_0xa251('0x43')][_0xa251('0x4f')]({'where':{'id':_0x331880[_0xa251('0x49')]['id']}})[_0xa251('0x24')](handleEntityNotFound(_0x39474e,null))[_0xa251('0x24')](function(_0x150a76){if(_0x150a76){_0x331880[_0xa251('0x4b')]['TriggerAllId']=_0x150a76['id'];return db['Condition'][_0xa251('0x4a')](_0x331880['body']);}})[_0xa251('0x24')](respondWithResult(_0x39474e,null))[_0xa251('0x48')](handleError(_0x39474e,null));};exports['addAnyCondition']=function(_0xcd5923,_0xa9f067,_0x499e8b){if(_0xcd5923[_0xa251('0x4b')]['id']){delete _0xcd5923['body']['id'];}return db['Trigger']['find']({'where':{'id':_0xcd5923[_0xa251('0x49')]['id']}})['then'](handleEntityNotFound(_0xa9f067,null))[_0xa251('0x24')](function(_0x495841){if(_0x495841){_0xcd5923[_0xa251('0x4b')][_0xa251('0x54')]=_0x495841['id'];return db['Condition']['create'](_0xcd5923[_0xa251('0x4b')]);}})[_0xa251('0x24')](respondWithResult(_0xa9f067,null))[_0xa251('0x48')](handleError(_0xa9f067,null));};exports[_0xa251('0x55')]=function(_0x5ae67c,_0x45f824,_0x56482f){var _0x47f7fb={};var _0x2558e6={};var _0x5a6c3b;var _0x98ca3e;return db[_0xa251('0x43')][_0xa251('0x56')]({'where':{'id':_0x5ae67c[_0xa251('0x49')]['id']}})['then'](handleEntityNotFound(_0x45f824,null))[_0xa251('0x24')](function(_0x368364){if(_0x368364){_0x5a6c3b=_0x368364;_0x2558e6['model']=_[_0xa251('0x32')](db[_0xa251('0x57')][_0xa251('0x2f')]);_0x2558e6['query']=_['keys'](_0x5ae67c['query']);_0x2558e6[_0xa251('0x33')]=_['intersection'](_0x2558e6[_0xa251('0x31')],_0x2558e6['query']);_0x47f7fb['attributes']=_[_0xa251('0x34')](_0x2558e6[_0xa251('0x31')],qs[_0xa251('0x37')](_0x5ae67c[_0xa251('0x35')][_0xa251('0x37')]));_0x47f7fb[_0xa251('0x36')]=_0x47f7fb[_0xa251('0x36')][_0xa251('0x38')]?_0x47f7fb[_0xa251('0x36')]:_0x2558e6[_0xa251('0x31')];_0x47f7fb[_0xa251('0x3a')]=qs[_0xa251('0x3b')](_0x5ae67c['query'][_0xa251('0x3b')]);_0x47f7fb[_0xa251('0x3c')]=qs[_0xa251('0x33')](_['pick'](_0x5ae67c[_0xa251('0x35')],_0x2558e6[_0xa251('0x33')]));if(_0x5ae67c['query'][_0xa251('0x3e')]){_0x47f7fb['where']=_[_0xa251('0x3f')](_0x47f7fb[_0xa251('0x3c')],{'$or':_[_0xa251('0x2e')](_0x47f7fb['attributes'],function(_0x1d03bf){var _0x3d098a={};_0x3d098a[_0x1d03bf]={'$like':'%'+_0x5ae67c[_0xa251('0x35')][_0xa251('0x3e')]+'%'};return _0x3d098a;})});}_0x47f7fb=_[_0xa251('0x3f')]({},_0x47f7fb,_0x5ae67c['options']);return _0x5a6c3b['getAllConditions'](_0x47f7fb);}})['then'](function(_0x2ba8c8){if(_0x2ba8c8){_0x98ca3e=_0x2ba8c8[_0xa251('0x38')];if(!_0x5ae67c[_0xa251('0x35')][_0xa251('0x58')](_0xa251('0x39'))){_0x47f7fb[_0xa251('0x1b')]=qs[_0xa251('0x1b')](_0x5ae67c[_0xa251('0x35')][_0xa251('0x1b')]);_0x47f7fb[_0xa251('0x1c')]=qs['offset'](_0x5ae67c[_0xa251('0x35')][_0xa251('0x1c')]);}return _0x5a6c3b[_0xa251('0x55')](_0x47f7fb);}})[_0xa251('0x24')](function(_0x30b2af){if(_0x30b2af){return _0x30b2af?{'count':_0x98ca3e,'rows':_0x30b2af}:null;}})['then'](respondWithResult(_0x45f824,null))[_0xa251('0x48')](handleError(_0x45f824,null));};exports[_0xa251('0x59')]=function(_0x4fa580,_0x29a6ef,_0x1ed114){var _0x464d26={};var _0x4e4a20={};var _0x42fc9f;var _0x29d801;return db[_0xa251('0x43')][_0xa251('0x56')]({'where':{'id':_0x4fa580['params']['id']}})[_0xa251('0x24')](handleEntityNotFound(_0x29a6ef,null))[_0xa251('0x24')](function(_0xca84b){if(_0xca84b){_0x42fc9f=_0xca84b;_0x4e4a20['model']=_[_0xa251('0x32')](db[_0xa251('0x57')][_0xa251('0x2f')]);_0x4e4a20[_0xa251('0x35')]=_[_0xa251('0x32')](_0x4fa580['query']);_0x4e4a20[_0xa251('0x33')]=_[_0xa251('0x34')](_0x4e4a20['model'],_0x4e4a20['query']);_0x464d26[_0xa251('0x36')]=_['intersection'](_0x4e4a20['model'],qs[_0xa251('0x37')](_0x4fa580['query'][_0xa251('0x37')]));_0x464d26[_0xa251('0x36')]=_0x464d26[_0xa251('0x36')]['length']?_0x464d26[_0xa251('0x36')]:_0x4e4a20[_0xa251('0x31')];_0x464d26[_0xa251('0x3a')]=qs['sort'](_0x4fa580['query'][_0xa251('0x3b')]);_0x464d26[_0xa251('0x3c')]=qs[_0xa251('0x33')](_[_0xa251('0x3d')](_0x4fa580[_0xa251('0x35')],_0x4e4a20[_0xa251('0x33')]));if(_0x4fa580[_0xa251('0x35')][_0xa251('0x3e')]){_0x464d26['where']=_[_0xa251('0x3f')](_0x464d26[_0xa251('0x3c')],{'$or':_[_0xa251('0x2e')](_0x464d26[_0xa251('0x36')],function(_0x590591){var _0x353192={};_0x353192[_0x590591]={'$like':'%'+_0x4fa580[_0xa251('0x35')][_0xa251('0x3e')]+'%'};return _0x353192;})});}_0x464d26=_['merge']({},_0x464d26,_0x4fa580[_0xa251('0x42')]);return _0x42fc9f[_0xa251('0x59')](_0x464d26);}})[_0xa251('0x24')](function(_0x506851){if(_0x506851){_0x29d801=_0x506851['length'];if(!_0x4fa580[_0xa251('0x35')][_0xa251('0x58')]('nolimit')){_0x464d26['limit']=qs[_0xa251('0x1b')](_0x4fa580[_0xa251('0x35')][_0xa251('0x1b')]);_0x464d26[_0xa251('0x1c')]=qs['offset'](_0x4fa580[_0xa251('0x35')][_0xa251('0x1c')]);}return _0x42fc9f[_0xa251('0x59')](_0x464d26);}})['then'](function(_0xf9f99){if(_0xf9f99){return _0xf9f99?{'count':_0x29d801,'rows':_0xf9f99}:null;}})[_0xa251('0x24')](respondWithResult(_0x29a6ef,null))[_0xa251('0x48')](handleError(_0x29a6ef,null));};exports[_0xa251('0x5a')]=function(_0x10cd88,_0x16ad7d,_0x401d78){if(_0x10cd88[_0xa251('0x4b')]['id']){delete _0x10cd88['body']['id'];}return db[_0xa251('0x43')][_0xa251('0x4f')]({'where':{'id':_0x10cd88[_0xa251('0x49')]['id']}})[_0xa251('0x24')](handleEntityNotFound(_0x16ad7d,null))[_0xa251('0x24')](function(_0x9486dd){if(_0x9486dd){_0x10cd88[_0xa251('0x4b')]['TriggerId']=_0x9486dd['id'];return db['Action'][_0xa251('0x4a')](_0x10cd88[_0xa251('0x4b')]);}})[_0xa251('0x24')](respondWithResult(_0x16ad7d,null))[_0xa251('0x48')](handleError(_0x16ad7d,null));};exports['getActions']=function(_0x57a523,_0x505195,_0x24780d){var _0x3f576a={};var _0x14e9d5={};var _0x328848;var _0x427501;return db[_0xa251('0x43')][_0xa251('0x56')]({'where':{'id':_0x57a523['params']['id']}})[_0xa251('0x24')](handleEntityNotFound(_0x505195,null))[_0xa251('0x24')](function(_0x4c2835){if(_0x4c2835){_0x328848=_0x4c2835;_0x14e9d5[_0xa251('0x31')]=_[_0xa251('0x32')](db['Action'][_0xa251('0x2f')]);_0x14e9d5[_0xa251('0x35')]=_[_0xa251('0x32')](_0x57a523[_0xa251('0x35')]);_0x14e9d5['filters']=_[_0xa251('0x34')](_0x14e9d5[_0xa251('0x31')],_0x14e9d5[_0xa251('0x35')]);_0x3f576a[_0xa251('0x36')]=_[_0xa251('0x34')](_0x14e9d5[_0xa251('0x31')],qs[_0xa251('0x37')](_0x57a523[_0xa251('0x35')][_0xa251('0x37')]));_0x3f576a[_0xa251('0x36')]=_0x3f576a[_0xa251('0x36')][_0xa251('0x38')]?_0x3f576a[_0xa251('0x36')]:_0x14e9d5['model'];_0x3f576a['order']=qs[_0xa251('0x3b')](_0x57a523['query']['sort']);_0x3f576a[_0xa251('0x3c')]=qs[_0xa251('0x33')](_[_0xa251('0x3d')](_0x57a523['query'],_0x14e9d5['filters']));if(_0x57a523[_0xa251('0x35')][_0xa251('0x3e')]){_0x3f576a[_0xa251('0x3c')]=_[_0xa251('0x3f')](_0x3f576a[_0xa251('0x3c')],{'$or':_[_0xa251('0x2e')](_0x3f576a[_0xa251('0x36')],function(_0xe64b78){var _0x54fd1c={};_0x54fd1c[_0xe64b78]={'$like':'%'+_0x57a523[_0xa251('0x35')]['filter']+'%'};return _0x54fd1c;})});}_0x3f576a=_[_0xa251('0x3f')]({},_0x3f576a,_0x57a523['options']);return _0x328848[_0xa251('0x5b')](_0x3f576a);}})[_0xa251('0x24')](function(_0x4666bc){if(_0x4666bc){_0x427501=_0x4666bc[_0xa251('0x38')];if(!_0x57a523[_0xa251('0x35')][_0xa251('0x58')]('nolimit')){_0x3f576a[_0xa251('0x1b')]=qs['limit'](_0x57a523[_0xa251('0x35')][_0xa251('0x1b')]);_0x3f576a[_0xa251('0x1c')]=qs['offset'](_0x57a523[_0xa251('0x35')][_0xa251('0x1c')]);}return _0x328848[_0xa251('0x5b')](_0x3f576a);}})['then'](function(_0x529c4f){if(_0x529c4f){return _0x529c4f?{'count':_0x427501,'rows':_0x529c4f}:null;}})['then'](respondWithResult(_0x505195,null))[_0xa251('0x48')](handleError(_0x505195,null));}; \ No newline at end of file +var _0x90de=['includeAll','findAll','rows','catch','show','include','find','create','body','get','user','autoAssociation','error','update','params','destroy','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','order','nolimit','getAnyConditions','addAction','TriggerId','getActions','Action','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','Triggers','UserProfileResource','stack','name','send','index','map','Trigger','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0xeb2d61,_0x2837f7){var _0x38d3d0=function(_0x58b02c){while(--_0x58b02c){_0xeb2d61['push'](_0xeb2d61['shift']());}};_0x38d3d0(++_0x2837f7);}(_0x90de,0x192));var _0xe90d=function(_0x60fa35,_0x12abc6){_0x60fa35=_0x60fa35-0x0;var _0x2d9933=_0x90de[_0x60fa35];return _0x2d9933;};'use strict';var emlformat=require(_0xe90d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe90d('0x1'));var rp=require(_0xe90d('0x2'));var moment=require(_0xe90d('0x3'));var BPromise=require(_0xe90d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe90d('0x5'));var sox=require(_0xe90d('0x6'));var csv=require(_0xe90d('0x7'));var ejs=require(_0xe90d('0x8'));var fs=require('fs');var fs_extra=require(_0xe90d('0x9'));var _=require(_0xe90d('0xa'));var squel=require(_0xe90d('0xb'));var crypto=require(_0xe90d('0xc'));var jsforce=require(_0xe90d('0xd'));var deskjs=require(_0xe90d('0xe'));var toCsv=require(_0xe90d('0x7'));var querystring=require(_0xe90d('0xf'));var Papa=require(_0xe90d('0x10'));var Redis=require(_0xe90d('0x11'));var authService=require(_0xe90d('0x12'));var qs=require(_0xe90d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe90d('0x14'))(_0xe90d('0x15'));var utils=require(_0xe90d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe90d('0x17'));var db=require(_0xe90d('0x18'))['db'];function respondWithStatusCode(_0x12756b,_0x57dd2c){_0x57dd2c=_0x57dd2c||0xcc;return function(_0x1a870e){if(_0x1a870e){return _0x12756b[_0xe90d('0x19')](_0x57dd2c);}return _0x12756b[_0xe90d('0x1a')](_0x57dd2c)[_0xe90d('0x1b')]();};}function respondWithResult(_0x186005,_0x23cc04){_0x23cc04=_0x23cc04||0xc8;return function(_0x7104d5){if(_0x7104d5){return _0x186005[_0xe90d('0x1a')](_0x23cc04)['json'](_0x7104d5);}};}function respondWithFilteredResult(_0x564d25,_0x10dcb2){return function(_0x30ec78){if(_0x30ec78){var _0x27176c=typeof _0x10dcb2[_0xe90d('0x1c')]===_0xe90d('0x1d')&&typeof _0x10dcb2[_0xe90d('0x1e')]===_0xe90d('0x1d');var _0x342aef=_0x30ec78[_0xe90d('0x1f')];var _0x8e740c=_0x27176c?0x0:_0x10dcb2[_0xe90d('0x1c')];var _0x5ce8a8=_0x27176c?_0x30ec78['count']:_0x10dcb2[_0xe90d('0x1c')]+_0x10dcb2[_0xe90d('0x1e')];var _0x536a73;if(_0x5ce8a8>=_0x342aef){_0x5ce8a8=_0x342aef;_0x536a73=0xc8;}else{_0x536a73=0xce;}_0x564d25[_0xe90d('0x1a')](_0x536a73);return _0x564d25[_0xe90d('0x20')](_0xe90d('0x21'),_0x8e740c+'-'+_0x5ce8a8+'/'+_0x342aef)[_0xe90d('0x22')](_0x30ec78);}return null;};}function patchUpdates(_0xf3a823){return function(_0x1c42c1){try{jsonpatch[_0xe90d('0x23')](_0x1c42c1,_0xf3a823,!![]);}catch(_0x3a4f65){return BPromise[_0xe90d('0x24')](_0x3a4f65);}return _0x1c42c1['save']();};}function saveUpdates(_0x21f35a,_0x3483e7){return function(_0x5c4f10){if(_0x5c4f10){return _0x5c4f10['update'](_0x21f35a)[_0xe90d('0x25')](function(_0xb76f66){return _0xb76f66;});}return null;};}function removeEntity(_0x4c9741,_0xd1e298){return function(_0x4d2001){if(_0x4d2001){return _0x4d2001['destroy']()[_0xe90d('0x25')](function(){var _0x333ff7=_0x4d2001['get']({'plain':!![]});var _0x5ddf5d=_0xe90d('0x26');return db[_0xe90d('0x27')]['destroy']({'where':{'type':_0x5ddf5d,'resourceId':_0x333ff7['id']}})[_0xe90d('0x25')](function(){return _0x4d2001;});})[_0xe90d('0x25')](function(){_0x4c9741[_0xe90d('0x1a')](0xcc)[_0xe90d('0x1b')]();});}};}function handleEntityNotFound(_0x1cb9fe,_0x5c5273){return function(_0x325246){if(!_0x325246){_0x1cb9fe[_0xe90d('0x19')](0x194);}return _0x325246;};}function handleError(_0xcfe6be,_0x4e996f){_0x4e996f=_0x4e996f||0x1f4;return function(_0x62cfc0){logger['error'](_0x62cfc0[_0xe90d('0x28')]);if(_0x62cfc0[_0xe90d('0x29')]){delete _0x62cfc0[_0xe90d('0x29')];}_0xcfe6be[_0xe90d('0x1a')](_0x4e996f)[_0xe90d('0x2a')](_0x62cfc0);};}exports[_0xe90d('0x2b')]=function(_0x3a1ae5,_0x508314){var _0x2e6b11={},_0x54e21e={},_0x52ae61={'count':0x0,'rows':[]};var _0x287806=_[_0xe90d('0x2c')](db[_0xe90d('0x2d')][_0xe90d('0x2e')],function(_0x1c5151){return{'name':_0x1c5151['fieldName'],'type':_0x1c5151['type']['key']};});_0x54e21e[_0xe90d('0x2f')]=_[_0xe90d('0x2c')](_0x287806,_0xe90d('0x29'));_0x54e21e[_0xe90d('0x30')]=_[_0xe90d('0x31')](_0x3a1ae5[_0xe90d('0x30')]);_0x54e21e[_0xe90d('0x32')]=_[_0xe90d('0x33')](_0x54e21e['model'],_0x54e21e[_0xe90d('0x30')]);_0x2e6b11['attributes']=_['intersection'](_0x54e21e['model'],qs[_0xe90d('0x34')](_0x3a1ae5[_0xe90d('0x30')][_0xe90d('0x34')]));_0x2e6b11[_0xe90d('0x35')]=_0x2e6b11[_0xe90d('0x35')][_0xe90d('0x36')]?_0x2e6b11[_0xe90d('0x35')]:_0x54e21e[_0xe90d('0x2f')];if(!_0x3a1ae5[_0xe90d('0x30')][_0xe90d('0x37')]('nolimit')){_0x2e6b11[_0xe90d('0x1e')]=qs['limit'](_0x3a1ae5['query'][_0xe90d('0x1e')]);_0x2e6b11['offset']=qs[_0xe90d('0x1c')](_0x3a1ae5[_0xe90d('0x30')]['offset']);}_0x2e6b11['order']=qs[_0xe90d('0x38')](_0x3a1ae5[_0xe90d('0x30')][_0xe90d('0x38')]);_0x2e6b11[_0xe90d('0x39')]=qs['filters'](_[_0xe90d('0x3a')](_0x3a1ae5['query'],_0x54e21e[_0xe90d('0x32')]),_0x287806);if(_0x3a1ae5['query'][_0xe90d('0x3b')]){_0x2e6b11[_0xe90d('0x39')]=_[_0xe90d('0x3c')](_0x2e6b11[_0xe90d('0x39')],{'$or':_[_0xe90d('0x2c')](_0x287806,function(_0x1e786e){if(_0x1e786e['type']!==_0xe90d('0x3d')){var _0x478e10={};_0x478e10[_0x1e786e['name']]={'$like':'%'+_0x3a1ae5[_0xe90d('0x30')][_0xe90d('0x3b')]+'%'};return _0x478e10;}})});}_0x2e6b11=_[_0xe90d('0x3c')]({},_0x2e6b11,_0x3a1ae5[_0xe90d('0x3e')]);var _0x271cfe={'where':_0x2e6b11[_0xe90d('0x39')]};return db[_0xe90d('0x2d')][_0xe90d('0x1f')](_0x271cfe)[_0xe90d('0x25')](function(_0x4b4317){_0x52ae61[_0xe90d('0x1f')]=_0x4b4317;if(_0x3a1ae5[_0xe90d('0x30')][_0xe90d('0x3f')]){_0x2e6b11['include']=[{'all':!![]}];}return db['Trigger'][_0xe90d('0x40')](_0x2e6b11);})[_0xe90d('0x25')](function(_0x431bc8){_0x52ae61[_0xe90d('0x41')]=_0x431bc8;return _0x52ae61;})[_0xe90d('0x25')](respondWithFilteredResult(_0x508314,_0x2e6b11))[_0xe90d('0x42')](handleError(_0x508314,null));};exports[_0xe90d('0x43')]=function(_0x40e654,_0x3ebb31){var _0x222d2f={'raw':![],'where':{'id':_0x40e654['params']['id']}},_0x1fa7f5={};_0x1fa7f5[_0xe90d('0x2f')]=_[_0xe90d('0x31')](db[_0xe90d('0x2d')]['rawAttributes']);_0x1fa7f5[_0xe90d('0x30')]=_[_0xe90d('0x31')](_0x40e654['query']);_0x1fa7f5['filters']=_[_0xe90d('0x33')](_0x1fa7f5[_0xe90d('0x2f')],_0x1fa7f5[_0xe90d('0x30')]);_0x222d2f[_0xe90d('0x35')]=_['intersection'](_0x1fa7f5[_0xe90d('0x2f')],qs[_0xe90d('0x34')](_0x40e654[_0xe90d('0x30')]['fields']));_0x222d2f[_0xe90d('0x35')]=_0x222d2f[_0xe90d('0x35')][_0xe90d('0x36')]?_0x222d2f[_0xe90d('0x35')]:_0x1fa7f5[_0xe90d('0x2f')];if(_0x40e654[_0xe90d('0x30')][_0xe90d('0x3f')]){_0x222d2f[_0xe90d('0x44')]=[{'all':!![]}];}_0x222d2f=_['merge']({},_0x222d2f,_0x40e654[_0xe90d('0x3e')]);return db[_0xe90d('0x2d')][_0xe90d('0x45')](_0x222d2f)[_0xe90d('0x25')](handleEntityNotFound(_0x3ebb31,null))[_0xe90d('0x25')](respondWithResult(_0x3ebb31,null))[_0xe90d('0x42')](handleError(_0x3ebb31,null));};exports[_0xe90d('0x46')]=function(_0x25b4ed,_0x2afdbe){return db[_0xe90d('0x2d')][_0xe90d('0x46')](_0x25b4ed[_0xe90d('0x47')],{})['then'](function(_0x9c1ad2){var _0x12446d=_0x25b4ed['user'][_0xe90d('0x48')]({'plain':!![]});if(!_0x12446d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12446d['role']===_0xe90d('0x49')){var _0xf463f=_0x9c1ad2[_0xe90d('0x48')]({'plain':!![]});var _0x307515='Triggers';return db['UserProfileSection'][_0xe90d('0x45')]({'where':{'name':_0x307515,'userProfileId':_0x12446d['userProfileId']},'raw':!![]})[_0xe90d('0x25')](function(_0x414148){if(_0x414148&&_0x414148[_0xe90d('0x4a')]===0x0){return db[_0xe90d('0x27')][_0xe90d('0x46')]({'name':_0xf463f[_0xe90d('0x29')],'resourceId':_0xf463f['id'],'type':_0x414148[_0xe90d('0x29')],'sectionId':_0x414148['id']},{})[_0xe90d('0x25')](function(){return _0x9c1ad2;});}else{return _0x9c1ad2;}})[_0xe90d('0x42')](function(_0xf89a4){logger[_0xe90d('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf89a4);throw _0xf89a4;});}return _0x9c1ad2;})[_0xe90d('0x25')](respondWithResult(_0x2afdbe,0xc9))[_0xe90d('0x42')](handleError(_0x2afdbe,null));};exports[_0xe90d('0x4c')]=function(_0x1b8738,_0x58f8b2){if(_0x1b8738[_0xe90d('0x47')]['id']){delete _0x1b8738['body']['id'];}return db[_0xe90d('0x2d')][_0xe90d('0x45')]({'where':{'id':_0x1b8738[_0xe90d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x58f8b2,null))['then'](saveUpdates(_0x1b8738[_0xe90d('0x47')],null))[_0xe90d('0x25')](respondWithResult(_0x58f8b2,null))[_0xe90d('0x42')](handleError(_0x58f8b2,null));};exports[_0xe90d('0x4e')]=function(_0x286186,_0x21c2de){return db[_0xe90d('0x2d')][_0xe90d('0x45')]({'where':{'id':_0x286186[_0xe90d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x21c2de,null))[_0xe90d('0x25')](removeEntity(_0x21c2de,null))[_0xe90d('0x42')](handleError(_0x21c2de,null));};exports[_0xe90d('0x4f')]=function(_0x3e7426,_0x4af82c,_0x34b8bf){if(_0x3e7426[_0xe90d('0x47')]['id']){delete _0x3e7426['body']['id'];}return db[_0xe90d('0x2d')]['find']({'where':{'id':_0x3e7426['params']['id']}})['then'](handleEntityNotFound(_0x4af82c,null))[_0xe90d('0x25')](function(_0x7fcbb5){if(_0x7fcbb5){_0x3e7426[_0xe90d('0x47')][_0xe90d('0x50')]=_0x7fcbb5['id'];return db[_0xe90d('0x51')][_0xe90d('0x46')](_0x3e7426[_0xe90d('0x47')]);}})[_0xe90d('0x25')](respondWithResult(_0x4af82c,null))[_0xe90d('0x42')](handleError(_0x4af82c,null));};exports[_0xe90d('0x52')]=function(_0x480ba9,_0x4f5755,_0x18252f){if(_0x480ba9['body']['id']){delete _0x480ba9['body']['id'];}return db[_0xe90d('0x2d')][_0xe90d('0x45')]({'where':{'id':_0x480ba9[_0xe90d('0x4d')]['id']}})[_0xe90d('0x25')](handleEntityNotFound(_0x4f5755,null))[_0xe90d('0x25')](function(_0x513181){if(_0x513181){_0x480ba9['body'][_0xe90d('0x53')]=_0x513181['id'];return db['Condition']['create'](_0x480ba9[_0xe90d('0x47')]);}})[_0xe90d('0x25')](respondWithResult(_0x4f5755,null))[_0xe90d('0x42')](handleError(_0x4f5755,null));};exports[_0xe90d('0x54')]=function(_0x17c0ea,_0x539ebe,_0xa6f5c){var _0x577920={};var _0x50d962={};var _0x385211;var _0x2312e1;return db[_0xe90d('0x2d')][_0xe90d('0x55')]({'where':{'id':_0x17c0ea[_0xe90d('0x4d')]['id']}})[_0xe90d('0x25')](handleEntityNotFound(_0x539ebe,null))[_0xe90d('0x25')](function(_0x4b84be){if(_0x4b84be){_0x385211=_0x4b84be;_0x50d962[_0xe90d('0x2f')]=_['keys'](db['Condition'][_0xe90d('0x2e')]);_0x50d962[_0xe90d('0x30')]=_['keys'](_0x17c0ea['query']);_0x50d962[_0xe90d('0x32')]=_['intersection'](_0x50d962[_0xe90d('0x2f')],_0x50d962[_0xe90d('0x30')]);_0x577920[_0xe90d('0x35')]=_['intersection'](_0x50d962[_0xe90d('0x2f')],qs[_0xe90d('0x34')](_0x17c0ea[_0xe90d('0x30')][_0xe90d('0x34')]));_0x577920['attributes']=_0x577920['attributes'][_0xe90d('0x36')]?_0x577920['attributes']:_0x50d962[_0xe90d('0x2f')];_0x577920[_0xe90d('0x56')]=qs['sort'](_0x17c0ea['query'][_0xe90d('0x38')]);_0x577920[_0xe90d('0x39')]=qs[_0xe90d('0x32')](_[_0xe90d('0x3a')](_0x17c0ea[_0xe90d('0x30')],_0x50d962['filters']));if(_0x17c0ea[_0xe90d('0x30')]['filter']){_0x577920[_0xe90d('0x39')]=_[_0xe90d('0x3c')](_0x577920[_0xe90d('0x39')],{'$or':_[_0xe90d('0x2c')](_0x577920['attributes'],function(_0x4c1055){var _0x453526={};_0x453526[_0x4c1055]={'$like':'%'+_0x17c0ea[_0xe90d('0x30')]['filter']+'%'};return _0x453526;})});}_0x577920=_[_0xe90d('0x3c')]({},_0x577920,_0x17c0ea[_0xe90d('0x3e')]);return _0x385211['getAllConditions'](_0x577920);}})[_0xe90d('0x25')](function(_0x4223e9){if(_0x4223e9){_0x2312e1=_0x4223e9[_0xe90d('0x36')];if(!_0x17c0ea[_0xe90d('0x30')][_0xe90d('0x37')](_0xe90d('0x57'))){_0x577920[_0xe90d('0x1e')]=qs[_0xe90d('0x1e')](_0x17c0ea[_0xe90d('0x30')][_0xe90d('0x1e')]);_0x577920['offset']=qs['offset'](_0x17c0ea[_0xe90d('0x30')][_0xe90d('0x1c')]);}return _0x385211['getAllConditions'](_0x577920);}})[_0xe90d('0x25')](function(_0x25ba8a){if(_0x25ba8a){return _0x25ba8a?{'count':_0x2312e1,'rows':_0x25ba8a}:null;}})[_0xe90d('0x25')](respondWithResult(_0x539ebe,null))['catch'](handleError(_0x539ebe,null));};exports[_0xe90d('0x58')]=function(_0x24ddf4,_0x34323e,_0x10997d){var _0x4f49a9={};var _0x314ba3={};var _0x56a265;var _0x1a041b;return db['Trigger'][_0xe90d('0x55')]({'where':{'id':_0x24ddf4[_0xe90d('0x4d')]['id']}})[_0xe90d('0x25')](handleEntityNotFound(_0x34323e,null))[_0xe90d('0x25')](function(_0x4f9e74){if(_0x4f9e74){_0x56a265=_0x4f9e74;_0x314ba3['model']=_['keys'](db[_0xe90d('0x51')][_0xe90d('0x2e')]);_0x314ba3[_0xe90d('0x30')]=_['keys'](_0x24ddf4['query']);_0x314ba3['filters']=_['intersection'](_0x314ba3['model'],_0x314ba3[_0xe90d('0x30')]);_0x4f49a9[_0xe90d('0x35')]=_[_0xe90d('0x33')](_0x314ba3[_0xe90d('0x2f')],qs['fields'](_0x24ddf4[_0xe90d('0x30')][_0xe90d('0x34')]));_0x4f49a9['attributes']=_0x4f49a9[_0xe90d('0x35')][_0xe90d('0x36')]?_0x4f49a9[_0xe90d('0x35')]:_0x314ba3[_0xe90d('0x2f')];_0x4f49a9[_0xe90d('0x56')]=qs['sort'](_0x24ddf4[_0xe90d('0x30')][_0xe90d('0x38')]);_0x4f49a9['where']=qs['filters'](_['pick'](_0x24ddf4[_0xe90d('0x30')],_0x314ba3[_0xe90d('0x32')]));if(_0x24ddf4[_0xe90d('0x30')][_0xe90d('0x3b')]){_0x4f49a9[_0xe90d('0x39')]=_['merge'](_0x4f49a9[_0xe90d('0x39')],{'$or':_[_0xe90d('0x2c')](_0x4f49a9[_0xe90d('0x35')],function(_0x30f20f){var _0x429d66={};_0x429d66[_0x30f20f]={'$like':'%'+_0x24ddf4[_0xe90d('0x30')][_0xe90d('0x3b')]+'%'};return _0x429d66;})});}_0x4f49a9=_['merge']({},_0x4f49a9,_0x24ddf4[_0xe90d('0x3e')]);return _0x56a265[_0xe90d('0x58')](_0x4f49a9);}})['then'](function(_0x429dba){if(_0x429dba){_0x1a041b=_0x429dba[_0xe90d('0x36')];if(!_0x24ddf4[_0xe90d('0x30')][_0xe90d('0x37')](_0xe90d('0x57'))){_0x4f49a9[_0xe90d('0x1e')]=qs[_0xe90d('0x1e')](_0x24ddf4[_0xe90d('0x30')][_0xe90d('0x1e')]);_0x4f49a9[_0xe90d('0x1c')]=qs[_0xe90d('0x1c')](_0x24ddf4[_0xe90d('0x30')][_0xe90d('0x1c')]);}return _0x56a265[_0xe90d('0x58')](_0x4f49a9);}})['then'](function(_0x526828){if(_0x526828){return _0x526828?{'count':_0x1a041b,'rows':_0x526828}:null;}})[_0xe90d('0x25')](respondWithResult(_0x34323e,null))[_0xe90d('0x42')](handleError(_0x34323e,null));};exports[_0xe90d('0x59')]=function(_0x38c3d1,_0xd3179b,_0x16f489){if(_0x38c3d1[_0xe90d('0x47')]['id']){delete _0x38c3d1[_0xe90d('0x47')]['id'];}return db['Trigger'][_0xe90d('0x45')]({'where':{'id':_0x38c3d1[_0xe90d('0x4d')]['id']}})[_0xe90d('0x25')](handleEntityNotFound(_0xd3179b,null))['then'](function(_0x1fe124){if(_0x1fe124){_0x38c3d1['body'][_0xe90d('0x5a')]=_0x1fe124['id'];return db['Action'][_0xe90d('0x46')](_0x38c3d1[_0xe90d('0x47')]);}})[_0xe90d('0x25')](respondWithResult(_0xd3179b,null))['catch'](handleError(_0xd3179b,null));};exports[_0xe90d('0x5b')]=function(_0x87a053,_0x4302d1,_0x120524){var _0x567cda={};var _0x3ab780={};var _0x5a1ab0;var _0x375dd7;return db[_0xe90d('0x2d')][_0xe90d('0x55')]({'where':{'id':_0x87a053[_0xe90d('0x4d')]['id']}})[_0xe90d('0x25')](handleEntityNotFound(_0x4302d1,null))['then'](function(_0x21997f){if(_0x21997f){_0x5a1ab0=_0x21997f;_0x3ab780[_0xe90d('0x2f')]=_[_0xe90d('0x31')](db[_0xe90d('0x5c')]['rawAttributes']);_0x3ab780[_0xe90d('0x30')]=_[_0xe90d('0x31')](_0x87a053['query']);_0x3ab780[_0xe90d('0x32')]=_[_0xe90d('0x33')](_0x3ab780[_0xe90d('0x2f')],_0x3ab780[_0xe90d('0x30')]);_0x567cda[_0xe90d('0x35')]=_[_0xe90d('0x33')](_0x3ab780[_0xe90d('0x2f')],qs['fields'](_0x87a053['query']['fields']));_0x567cda[_0xe90d('0x35')]=_0x567cda['attributes'][_0xe90d('0x36')]?_0x567cda[_0xe90d('0x35')]:_0x3ab780[_0xe90d('0x2f')];_0x567cda[_0xe90d('0x56')]=qs[_0xe90d('0x38')](_0x87a053['query'][_0xe90d('0x38')]);_0x567cda['where']=qs[_0xe90d('0x32')](_['pick'](_0x87a053[_0xe90d('0x30')],_0x3ab780[_0xe90d('0x32')]));if(_0x87a053['query']['filter']){_0x567cda[_0xe90d('0x39')]=_[_0xe90d('0x3c')](_0x567cda[_0xe90d('0x39')],{'$or':_[_0xe90d('0x2c')](_0x567cda[_0xe90d('0x35')],function(_0x32b1bb){var _0xd37602={};_0xd37602[_0x32b1bb]={'$like':'%'+_0x87a053[_0xe90d('0x30')][_0xe90d('0x3b')]+'%'};return _0xd37602;})});}_0x567cda=_[_0xe90d('0x3c')]({},_0x567cda,_0x87a053[_0xe90d('0x3e')]);return _0x5a1ab0['getActions'](_0x567cda);}})[_0xe90d('0x25')](function(_0x1a2dbb){if(_0x1a2dbb){_0x375dd7=_0x1a2dbb[_0xe90d('0x36')];if(!_0x87a053['query'][_0xe90d('0x37')](_0xe90d('0x57'))){_0x567cda[_0xe90d('0x1e')]=qs[_0xe90d('0x1e')](_0x87a053[_0xe90d('0x30')]['limit']);_0x567cda[_0xe90d('0x1c')]=qs[_0xe90d('0x1c')](_0x87a053[_0xe90d('0x30')][_0xe90d('0x1c')]);}return _0x5a1ab0[_0xe90d('0x5b')](_0x567cda);}})['then'](function(_0x4be606){if(_0x4be606){return _0x4be606?{'count':_0x375dd7,'rows':_0x4be606}:null;}})[_0xe90d('0x25')](respondWithResult(_0x4302d1,null))[_0xe90d('0x42')](handleError(_0x4302d1,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 96f6f8f..86e35af 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 _0x1e69=['tools_triggers','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger'];(function(_0x32e264,_0x41cee8){var _0x1d7175=function(_0x5913d9){while(--_0x5913d9){_0x32e264['push'](_0x32e264['shift']());}};_0x1d7175(++_0x41cee8);}(_0x1e69,0x85));var _0x91e6=function(_0x349ffc,_0x5c270d){_0x349ffc=_0x349ffc-0x0;var _0x17baa8=_0x1e69[_0x349ffc];return _0x17baa8;};'use strict';var _=require('lodash');var util=require(_0x91e6('0x0'));var logger=require(_0x91e6('0x1'))(_0x91e6('0x2'));var moment=require(_0x91e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x91e6('0x4'));var rimraf=require(_0x91e6('0x5'));var config=require(_0x91e6('0x6'));var attributes=require(_0x91e6('0x7'));module[_0x91e6('0x8')]=function(_0x42fe90,_0x4091b8){return _0x42fe90[_0x91e6('0x9')](_0x91e6('0xa'),attributes,{'tableName':_0x91e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x383d=['Trigger','tools_triggers','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define'];(function(_0x512aa7,_0x2be0d9){var _0x952539=function(_0x2d63d4){while(--_0x2d63d4){_0x512aa7['push'](_0x512aa7['shift']());}};_0x952539(++_0x2be0d9);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd383('0x0'))(_0xd383('0x1'));var moment=require(_0xd383('0x2'));var BPromise=require('bluebird');var rp=require(_0xd383('0x3'));var fs=require('fs');var path=require(_0xd383('0x4'));var rimraf=require(_0xd383('0x5'));var config=require(_0xd383('0x6'));var attributes=require(_0xd383('0x7'));module[_0xd383('0x8')]=function(_0x5a0b1d,_0xc64e9b){return _0x5a0b1d[_0xd383('0x9')](_0xd383('0xa'),attributes,{'tableName':_0xd383('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 364b38d..14b36f3 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 _0x196b=['limit','include','model','map','debug','GetTrigger','ShowTrigger','find','where','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','result','catch','findAll','options','raw','attributes'];(function(_0x374f25,_0x55a0d3){var _0x25d3cc=function(_0x547311){while(--_0x547311){_0x374f25['push'](_0x374f25['shift']());}};_0x25d3cc(++_0x55a0d3);}(_0x196b,0x154));var _0xb196=function(_0x45fc52,_0x5d7015){_0x45fc52=_0x45fc52-0x0;var _0x4a2d8f=_0x196b[_0x45fc52];return _0x4a2d8f;};'use strict';var _=require(_0xb196('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb196('0x1'));var rs=require(_0xb196('0x2'));var fs=require('fs');var Redis=require(_0xb196('0x3'));var db=require(_0xb196('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb196('0x5'));var config=require(_0xb196('0x6'));var jayson=require(_0xb196('0x7'));var client=jayson[_0xb196('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49ef62,_0x5444c4,_0x446522){return new BPromise(function(_0x4b81ce,_0x2641c1){return client[_0xb196('0x9')](_0x49ef62,_0x446522)['then'](function(_0x4f67e7){logger[_0xb196('0xa')]('Trigger,\x20%s,\x20%s',_0x5444c4,_0xb196('0xb'));logger['debug'](_0xb196('0xc'),_0x5444c4,_0xb196('0xb'),JSON[_0xb196('0xd')](_0x4f67e7));if(_0x4f67e7[_0xb196('0xe')]){if(_0x4f67e7[_0xb196('0xe')]['code']===0x1f4){logger[_0xb196('0xe')](_0xb196('0xf'),_0x5444c4,_0x4f67e7['error'][_0xb196('0x10')]);return _0x2641c1(_0x4f67e7[_0xb196('0xe')][_0xb196('0x10')]);}logger[_0xb196('0xe')](_0xb196('0xf'),_0x5444c4,_0x4f67e7[_0xb196('0xe')][_0xb196('0x10')]);return _0x4b81ce(_0x4f67e7[_0xb196('0xe')]['message']);}else{logger['info'](_0xb196('0xf'),_0x5444c4,_0xb196('0xb'));_0x4b81ce(_0x4f67e7[_0xb196('0x11')][_0xb196('0x10')]);}})[_0xb196('0x12')](function(_0x4aa83d){logger['error'](_0xb196('0xf'),_0x5444c4,_0x4aa83d);_0x2641c1(_0x4aa83d);});});}exports['GetTrigger']=function(_0x52e18f){var _0x5cbf34=this;return new Promise(function(_0x5f2bc1,_0x2e43c7){return db['Trigger'][_0xb196('0x13')]({'raw':_0x52e18f[_0xb196('0x14')]?_0x52e18f['options'][_0xb196('0x15')]===undefined?!![]:![]:!![],'where':_0x52e18f[_0xb196('0x14')]?_0x52e18f[_0xb196('0x14')]['where']||null:null,'attributes':_0x52e18f['options']?_0x52e18f[_0xb196('0x14')][_0xb196('0x16')]||null:null,'limit':_0x52e18f[_0xb196('0x14')]?_0x52e18f[_0xb196('0x14')][_0xb196('0x17')]||null:null,'include':_0x52e18f[_0xb196('0x14')]?_0x52e18f['options']['include']?_['map'](_0x52e18f['options'][_0xb196('0x18')],function(_0x406aca){return{'model':db[_0x406aca[_0xb196('0x19')]],'as':_0x406aca['as'],'attributes':_0x406aca[_0xb196('0x16')],'include':_0x406aca[_0xb196('0x18')]?_['map'](_0x406aca[_0xb196('0x18')],function(_0x2fa9be){return{'model':db[_0x2fa9be['model']],'as':_0x2fa9be['as'],'attributes':_0x2fa9be[_0xb196('0x16')],'include':_0x2fa9be[_0xb196('0x18')]?_[_0xb196('0x1a')](_0x2fa9be[_0xb196('0x18')],function(_0x514d69){return{'model':db[_0x514d69[_0xb196('0x19')]],'as':_0x514d69['as'],'attributes':_0x514d69[_0xb196('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c58b3){logger[_0xb196('0xa')]('GetTrigger',_0x52e18f);logger[_0xb196('0x1b')](_0xb196('0x1c'),_0x52e18f,JSON[_0xb196('0xd')](_0x1c58b3));_0x5f2bc1(_0x1c58b3);})[_0xb196('0x12')](function(_0x5f0ba2){logger[_0xb196('0xe')]('GetTrigger',_0x5f0ba2[_0xb196('0x10')],_0x52e18f);_0x2e43c7(_0x5cbf34[_0xb196('0xe')](0x1f4,_0x5f0ba2[_0xb196('0x10')]));});});};exports[_0xb196('0x1d')]=function(_0x47fd84){var _0x5e63f0=this;return new Promise(function(_0x1c08c9,_0x1c89ae){return db['Trigger'][_0xb196('0x1e')]({'raw':_0x47fd84['options']?_0x47fd84['options'][_0xb196('0x15')]===undefined?!![]:![]:!![],'where':_0x47fd84[_0xb196('0x14')]?_0x47fd84[_0xb196('0x14')][_0xb196('0x1f')]||null:null,'attributes':_0x47fd84['options']?_0x47fd84[_0xb196('0x14')][_0xb196('0x16')]||null:null,'include':_0x47fd84[_0xb196('0x14')]?_0x47fd84[_0xb196('0x14')][_0xb196('0x18')]?_[_0xb196('0x1a')](_0x47fd84[_0xb196('0x14')][_0xb196('0x18')],function(_0x5dd7a6){return{'model':db[_0x5dd7a6['model']],'as':_0x5dd7a6['as'],'attributes':_0x5dd7a6[_0xb196('0x16')],'include':_0x5dd7a6[_0xb196('0x18')]?_[_0xb196('0x1a')](_0x5dd7a6['include'],function(_0x42caa9){return{'model':db[_0x42caa9[_0xb196('0x19')]],'as':_0x42caa9['as'],'attributes':_0x42caa9[_0xb196('0x16')],'include':_0x42caa9['include']?_[_0xb196('0x1a')](_0x42caa9['include'],function(_0x28b27e){return{'model':db[_0x28b27e['model']],'as':_0x28b27e['as'],'attributes':_0x28b27e[_0xb196('0x16')]};}):[]};}):[]};}):[]:[]})[_0xb196('0x20')](function(_0x35c7a2){logger[_0xb196('0xa')]('ShowTrigger',_0x47fd84);logger[_0xb196('0x1b')](_0xb196('0x1d'),_0x47fd84,JSON['stringify'](_0x35c7a2));_0x1c08c9(_0x35c7a2);})[_0xb196('0x12')](function(_0x5eeddd){logger[_0xb196('0xe')](_0xb196('0x1d'),_0x5eeddd[_0xb196('0x10')],_0x47fd84);_0x1c89ae(_0x5e63f0[_0xb196('0xe')](0x1f4,_0x5eeddd[_0xb196('0x10')]));});});}; \ No newline at end of file +var _0x0dd1=['Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','Trigger','findAll','raw','options','where','attributes','limit','map','include','model','GetTrigger','ShowTrigger','find','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','request','then'];(function(_0x4eb380,_0x129d77){var _0x301c65=function(_0x3b9011){while(--_0x3b9011){_0x4eb380['push'](_0x4eb380['shift']());}};_0x301c65(++_0x129d77);}(_0x0dd1,0x16b));var _0x10dd=function(_0x2d909d,_0x2e2072){_0x2d909d=_0x2d909d-0x0;var _0x40cc8d=_0x0dd1[_0x2d909d];return _0x40cc8d;};'use strict';var _=require(_0x10dd('0x0'));var util=require(_0x10dd('0x1'));var moment=require('moment');var BPromise=require(_0x10dd('0x2'));var rs=require(_0x10dd('0x3'));var fs=require('fs');var Redis=require(_0x10dd('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x10dd('0x5'));var config=require(_0x10dd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x10dd('0x7')][_0x10dd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x437fb1,_0x1ea058,_0x5eacee){return new BPromise(function(_0x5758c7,_0x59117e){return client[_0x10dd('0x9')](_0x437fb1,_0x5eacee)[_0x10dd('0xa')](function(_0x298452){logger['info'](_0x10dd('0xb'),_0x1ea058,_0x10dd('0xc'));logger[_0x10dd('0xd')](_0x10dd('0xe'),_0x1ea058,_0x10dd('0xc'),JSON[_0x10dd('0xf')](_0x298452));if(_0x298452[_0x10dd('0x10')]){if(_0x298452[_0x10dd('0x10')]['code']===0x1f4){logger['error'](_0x10dd('0xb'),_0x1ea058,_0x298452[_0x10dd('0x10')][_0x10dd('0x11')]);return _0x59117e(_0x298452[_0x10dd('0x10')][_0x10dd('0x11')]);}logger[_0x10dd('0x10')](_0x10dd('0xb'),_0x1ea058,_0x298452[_0x10dd('0x10')][_0x10dd('0x11')]);return _0x5758c7(_0x298452[_0x10dd('0x10')][_0x10dd('0x11')]);}else{logger[_0x10dd('0x12')]('Trigger,\x20%s,\x20%s',_0x1ea058,'request\x20sent');_0x5758c7(_0x298452[_0x10dd('0x13')]['message']);}})[_0x10dd('0x14')](function(_0x798d5d){logger[_0x10dd('0x10')](_0x10dd('0xb'),_0x1ea058,_0x798d5d);_0x59117e(_0x798d5d);});});}exports['GetTrigger']=function(_0x3ab5bf){var _0x1e077a=this;return new Promise(function(_0x59fc8c,_0x7c29ca){return db[_0x10dd('0x15')][_0x10dd('0x16')]({'raw':_0x3ab5bf['options']?_0x3ab5bf['options'][_0x10dd('0x17')]===undefined?!![]:![]:!![],'where':_0x3ab5bf[_0x10dd('0x18')]?_0x3ab5bf[_0x10dd('0x18')][_0x10dd('0x19')]||null:null,'attributes':_0x3ab5bf[_0x10dd('0x18')]?_0x3ab5bf['options'][_0x10dd('0x1a')]||null:null,'limit':_0x3ab5bf['options']?_0x3ab5bf[_0x10dd('0x18')][_0x10dd('0x1b')]||null:null,'include':_0x3ab5bf[_0x10dd('0x18')]?_0x3ab5bf['options']['include']?_[_0x10dd('0x1c')](_0x3ab5bf[_0x10dd('0x18')][_0x10dd('0x1d')],function(_0x140e40){return{'model':db[_0x140e40[_0x10dd('0x1e')]],'as':_0x140e40['as'],'attributes':_0x140e40[_0x10dd('0x1a')],'include':_0x140e40[_0x10dd('0x1d')]?_[_0x10dd('0x1c')](_0x140e40[_0x10dd('0x1d')],function(_0x8bfc8){return{'model':db[_0x8bfc8[_0x10dd('0x1e')]],'as':_0x8bfc8['as'],'attributes':_0x8bfc8[_0x10dd('0x1a')],'include':_0x8bfc8[_0x10dd('0x1d')]?_[_0x10dd('0x1c')](_0x8bfc8[_0x10dd('0x1d')],function(_0x4de749){return{'model':db[_0x4de749[_0x10dd('0x1e')]],'as':_0x4de749['as'],'attributes':_0x4de749['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x211106){logger[_0x10dd('0x12')](_0x10dd('0x1f'),_0x3ab5bf);logger[_0x10dd('0xd')](_0x10dd('0x1f'),_0x3ab5bf,JSON[_0x10dd('0xf')](_0x211106));_0x59fc8c(_0x211106);})[_0x10dd('0x14')](function(_0x20bc15){logger['error'](_0x10dd('0x1f'),_0x20bc15[_0x10dd('0x11')],_0x3ab5bf);_0x7c29ca(_0x1e077a[_0x10dd('0x10')](0x1f4,_0x20bc15[_0x10dd('0x11')]));});});};exports[_0x10dd('0x20')]=function(_0x3a6935){var _0xe018c8=this;return new Promise(function(_0x3bccab,_0xb2da9){return db[_0x10dd('0x15')][_0x10dd('0x21')]({'raw':_0x3a6935[_0x10dd('0x18')]?_0x3a6935[_0x10dd('0x18')][_0x10dd('0x17')]===undefined?!![]:![]:!![],'where':_0x3a6935[_0x10dd('0x18')]?_0x3a6935['options']['where']||null:null,'attributes':_0x3a6935[_0x10dd('0x18')]?_0x3a6935[_0x10dd('0x18')][_0x10dd('0x1a')]||null:null,'include':_0x3a6935[_0x10dd('0x18')]?_0x3a6935[_0x10dd('0x18')]['include']?_['map'](_0x3a6935[_0x10dd('0x18')][_0x10dd('0x1d')],function(_0x47e52a){return{'model':db[_0x47e52a['model']],'as':_0x47e52a['as'],'attributes':_0x47e52a[_0x10dd('0x1a')],'include':_0x47e52a[_0x10dd('0x1d')]?_['map'](_0x47e52a['include'],function(_0x3d8b53){return{'model':db[_0x3d8b53['model']],'as':_0x3d8b53['as'],'attributes':_0x3d8b53[_0x10dd('0x1a')],'include':_0x3d8b53['include']?_[_0x10dd('0x1c')](_0x3d8b53[_0x10dd('0x1d')],function(_0x67c773){return{'model':db[_0x67c773[_0x10dd('0x1e')]],'as':_0x67c773['as'],'attributes':_0x67c773[_0x10dd('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x10dd('0xa')](function(_0x31dcdd){logger[_0x10dd('0x12')](_0x10dd('0x20'),_0x3a6935);logger[_0x10dd('0xd')](_0x10dd('0x20'),_0x3a6935,JSON[_0x10dd('0xf')](_0x31dcdd));_0x3bccab(_0x31dcdd);})[_0x10dd('0x14')](function(_0x6d2e9){logger[_0x10dd('0x10')](_0x10dd('0x20'),_0x6d2e9[_0x10dd('0x11')],_0x3a6935);_0xb2da9(_0xe018c8[_0x10dd('0x10')](0x1f4,_0x6d2e9[_0x10dd('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 171e76f..3e46fac 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 _0xafac=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','post','/:id/clone','clone','create','/:id','update','delete','multer','util','path','connect-timeout'];(function(_0x661318,_0x2b5cb3){var _0x31b5ba=function(_0x2e366d){while(--_0x2e366d){_0x661318['push'](_0x661318['shift']());}};_0x31b5ba(++_0x2b5cb3);}(_0xafac,0x1d7));var _0xcafa=function(_0x3414fa,_0x30f564){_0x3414fa=_0x3414fa-0x0;var _0x2bd392=_0xafac[_0x3414fa];return _0x2bd392;};'use strict';var multer=require(_0xcafa('0x0'));var util=require(_0xcafa('0x1'));var path=require(_0xcafa('0x2'));var timeout=require(_0xcafa('0x3'));var express=require('express');var router=express[_0xcafa('0x4')]();var fs_extra=require(_0xcafa('0x5'));var auth=require(_0xcafa('0x6'));var interaction=require(_0xcafa('0x7'));var config=require(_0xcafa('0x8'));var controller=require(_0xcafa('0x9'));router[_0xcafa('0xa')]('/',auth[_0xcafa('0xb')](),controller['index']);router[_0xcafa('0xa')]('/:id',auth[_0xcafa('0xb')](),controller['show']);router[_0xcafa('0xc')](_0xcafa('0xd'),auth[_0xcafa('0xb')](),controller[_0xcafa('0xe')]);router[_0xcafa('0xc')]('/',auth[_0xcafa('0xb')](),controller[_0xcafa('0xf')]);router['put'](_0xcafa('0x10'),auth[_0xcafa('0xb')](),controller[_0xcafa('0x11')]);router[_0xcafa('0x12')]('/:id',auth[_0xcafa('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x18e3=['index','get','show','/:id/clone','create','put','/:id','update','delete','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated'];(function(_0x462e4b,_0x4bb283){var _0x2ac5a9=function(_0x5b7a0c){while(--_0x5b7a0c){_0x462e4b['push'](_0x462e4b['shift']());}};_0x2ac5a9(++_0x4bb283);}(_0x18e3,0x12a));var _0x318e=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0x18e3[_0xbc2974];return _0x3a5b4f;};'use strict';var multer=require('multer');var util=require(_0x318e('0x0'));var path=require('path');var timeout=require(_0x318e('0x1'));var express=require('express');var router=express[_0x318e('0x2')]();var fs_extra=require(_0x318e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x318e('0x4'));var config=require(_0x318e('0x5'));var controller=require(_0x318e('0x6'));router['get']('/',auth[_0x318e('0x7')](),controller[_0x318e('0x8')]);router[_0x318e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x318e('0xa')]);router['post'](_0x318e('0xb'),auth[_0x318e('0x7')](),controller['clone']);router['post']('/',auth[_0x318e('0x7')](),controller[_0x318e('0xc')]);router[_0x318e('0xd')](_0x318e('0xe'),auth[_0x318e('0x7')](),controller[_0x318e('0xf')]);router[_0x318e('0x10')](_0x318e('0xe'),auth[_0x318e('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 3dd98fb..f6a28f1 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 _0x6933=['rfc2833','yes','nonat','update','force_rport,comedia','setDataValue','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','accept','uac','uas','pai','fingerprint','passive','dynamic','update,nonat','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','getDataValue','split','info','shortinfo','inband','auto'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x6933,0x12c));var _0x3693=function(_0x50f9e5,_0x4f90d6){_0x50f9e5=_0x50f9e5-0x0;var _0x548d6b=_0x6933[_0x50f9e5];return _0x548d6b;};'use strict';var Sequelize=require(_0x3693('0x0'));module[_0x3693('0x1')]={'name':{'type':Sequelize[_0x3693('0x2')],'allowNull':![],'unique':_0x3693('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x5'),_0x3693('0x6'),_0x3693('0x7')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x3693('0x2')],'allowNull':![],'defaultValue':_0x3693('0x8')},'callingpres':{'type':Sequelize[_0x3693('0x4')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x3693('0x9'),_0x3693('0xa'),_0x3693('0xb'),_0x3693('0xc'),_0x3693('0xd'),_0x3693('0xe'))},'deny':{'type':Sequelize[_0x3693('0x2')]},'permit':{'type':Sequelize[_0x3693('0x2')]},'secret':{'type':Sequelize[_0x3693('0x2')]},'md5secret':{'type':Sequelize[_0x3693('0x2')]},'remotesecret':{'type':Sequelize[_0x3693('0x2')]},'transport':{'type':Sequelize[_0x3693('0x2')],'defaultValue':'udp','set':function(_0xb27b87){this['setDataValue'](_0x3693('0xf'),_0xb27b87?_0xb27b87['join'](','):null);},'get':function(){return this['getDataValue'](_0x3693('0xf'))?this[_0x3693('0x10')]('transport')[_0x3693('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x3693('0x4')]('rfc2833',_0x3693('0x12'),_0x3693('0x13'),_0x3693('0x14'),_0x3693('0x15')),'defaultValue':_0x3693('0x16')},'directmedia':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no',_0x3693('0x18'),_0x3693('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x3693('0x1a'),'set':function(_0xc0fd3a){this[_0x3693('0x1b')]('nat',_0xc0fd3a?_0xc0fd3a[_0x3693('0x1c')](','):null);},'get':function(){return this[_0x3693('0x10')](_0x3693('0x1d'))?this[_0x3693('0x10')](_0x3693('0x1d'))['split'](','):null;},'comment':_0x3693('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x3693('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3693('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3693('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x3693('0x2')],'allowNull':![],'defaultValue':_0x3693('0x1f'),'set':function(_0x1f7019){this[_0x3693('0x1b')](_0x3693('0x20'),_0x1f7019?_0x1f7019[_0x3693('0x1c')](';'):_0x3693('0x1f'));},'get':function(){return this[_0x3693('0x10')](_0x3693('0x20'))?this['getDataValue'](_0x3693('0x20'))[_0x3693('0x11')](';'):null;},'comment':_0x3693('0x21')},'autoframing':{'type':Sequelize[_0x3693('0x4')]('yes','no')},'insecure':{'type':Sequelize[_0x3693('0x2')],'defaultValue':'port,invite','set':function(_0x52ce08){this['setDataValue'](_0x3693('0x22'),_0x52ce08?_0x52ce08['join'](','):null);},'get':function(){return this[_0x3693('0x10')](_0x3693('0x22'))?this[_0x3693('0x10')](_0x3693('0x22'))[_0x3693('0x11')](','):null;},'comment':_0x3693('0x23')},'trustrpid':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no',_0x3693('0x24'))},'promiscredir':{'type':Sequelize[_0x3693('0x4')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x3693('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x3693('0x2')]},'callerid':{'type':Sequelize[_0x3693('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x3693('0x2')]},'callcounter':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':_0x3693('0x17')},'busylevel':{'type':Sequelize[_0x3693('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x3693('0x2')]},'videosupport':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3693('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3693('0x4')]('yes','no')},'mailbox':{'type':Sequelize[_0x3693('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x3693('0x26'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x3693('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x3693('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x27'),_0x3693('0x28')),'defaultValue':_0x3693('0x28')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x3693('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3693('0x25')](0x5)},'qualify':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x3693('0x2')]},'defaultuser':{'type':Sequelize[_0x3693('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x3693('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x3693('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x3693('0x4')]('yes','no',_0x3693('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x3693('0x2')]},'timert1':{'type':Sequelize[_0x3693('0x25')](0xb)},'timerb':{'type':Sequelize[_0x3693('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x3693('0x25')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x3693('0x2')]},'contactacl':{'type':Sequelize[_0x3693('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x3693('0x2')]},'use_q850_reason':{'type':Sequelize[_0x3693('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'force_avp':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'icesupport':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x3693('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no',_0x3693('0x2a'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x3693('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x3693('0x2')]},'dtlscipher':{'type':Sequelize[_0x3693('0x2')]},'dtlscafile':{'type':Sequelize[_0x3693('0x2')]},'dtlscapath':{'type':Sequelize[_0x3693('0x2')]},'dtlssetup':{'type':Sequelize[_0x3693('0x4')]('active',_0x3693('0x2b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3693('0x2')]},'usereqphone':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x3693('0x2')]},'call_limit':{'type':Sequelize[_0x3693('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x3693('0x17'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x3693('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x3693('0x2')]},'parkinglot':{'type':Sequelize[_0x3693('0x2')]},'description':{'type':Sequelize[_0x3693('0x2')]},'host':{'type':Sequelize[_0x3693('0x2')],'defaultValue':_0x3693('0x2c')},'canreinvite':{'type':Sequelize[_0x3693('0x4')]('yes','no',_0x3693('0x18'),_0x3693('0x19'),_0x3693('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3693('0x2')]},'otherFields':{'type':Sequelize[_0x3693('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x21d2=['transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','actpass','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x21d2,0x1ee));var _0x221d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x21d2[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x221d('0x0'));module[_0x221d('0x1')]={'name':{'type':Sequelize[_0x221d('0x2')],'allowNull':![],'unique':_0x221d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x5'),_0x221d('0x6'),_0x221d('0x7')),'allowNull':![],'defaultValue':_0x221d('0x5')},'context':{'type':Sequelize[_0x221d('0x2')],'allowNull':![],'defaultValue':_0x221d('0x8')},'callingpres':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x9'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x221d('0xa'),_0x221d('0xb'),_0x221d('0xc'),_0x221d('0xd'),_0x221d('0xe'))},'deny':{'type':Sequelize[_0x221d('0x2')]},'permit':{'type':Sequelize[_0x221d('0x2')]},'secret':{'type':Sequelize[_0x221d('0x2')]},'md5secret':{'type':Sequelize[_0x221d('0x2')]},'remotesecret':{'type':Sequelize[_0x221d('0x2')]},'transport':{'type':Sequelize[_0x221d('0x2')],'defaultValue':_0x221d('0xf'),'set':function(_0x4e94f3){this['setDataValue']('transport',_0x4e94f3?_0x4e94f3['join'](','):null);},'get':function(){return this['getDataValue'](_0x221d('0x10'))?this[_0x221d('0x11')](_0x221d('0x10'))[_0x221d('0x12')](','):null;},'comment':_0x221d('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0x221d('0x14'),_0x221d('0x15'),_0x221d('0x16'),'inband','auto'),'defaultValue':_0x221d('0x14')},'directmedia':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x17'),'no',_0x221d('0x18'),_0x221d('0x19'),_0x221d('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x221d('0x2')]},'directmediadeny':{'type':Sequelize[_0x221d('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x221d('0x1b'),'set':function(_0xb336ee){this[_0x221d('0x1c')](_0x221d('0x1d'),_0xb336ee?_0xb336ee[_0x221d('0x1e')](','):null);},'get':function(){return this[_0x221d('0x11')]('nat')?this[_0x221d('0x11')](_0x221d('0x1d'))[_0x221d('0x12')](','):null;},'comment':_0x221d('0x1f')},'callgroup':{'type':Sequelize[_0x221d('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x221d('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x221d('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x221d('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x221d('0x20'),'set':function(_0x44a19b){this[_0x221d('0x1c')]('allow',_0x44a19b?_0x44a19b['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x221d('0x11')](_0x221d('0x21'))?this[_0x221d('0x11')]('allow')[_0x221d('0x12')](';'):null;},'comment':_0x221d('0x22')},'autoframing':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x17'),'no')},'insecure':{'type':Sequelize[_0x221d('0x2')],'defaultValue':'port,invite','set':function(_0x452d46){this[_0x221d('0x1c')](_0x221d('0x23'),_0x452d46?_0x452d46['join'](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x221d('0x11')](_0x221d('0x23'))[_0x221d('0x12')](','):null;},'comment':_0x221d('0x24')},'trustrpid':{'type':Sequelize['ENUM'](_0x221d('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x17'),'no',_0x221d('0x25'))},'promiscredir':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x17'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x221d('0x17'),'no')},'accountcode':{'type':Sequelize[_0x221d('0x26')](0xb)},'setvar':{'type':Sequelize[_0x221d('0x2')]},'callerid':{'type':Sequelize[_0x221d('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x221d('0x2')]},'callcounter':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x17'),'no'),'defaultValue':_0x221d('0x17')},'busylevel':{'type':Sequelize[_0x221d('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x221d('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x221d('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x221d('0x2')]},'videosupport':{'type':Sequelize[_0x221d('0x4')]('yes','no',_0x221d('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x221d('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x221d('0x4')]('yes','no')},'mailbox':{'type':Sequelize[_0x221d('0x2')]},'session_timers':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x28'),_0x221d('0x29'),_0x221d('0x2a'))},'session_expires':{'type':Sequelize[_0x221d('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x221d('0x26')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x221d('0x2b'),_0x221d('0x2c')),'defaultValue':_0x221d('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x221d('0x2')]},'regexten':{'type':Sequelize[_0x221d('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x17'),'no'),'defaultValue':_0x221d('0x17')},'keepalive':{'type':Sequelize[_0x221d('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x221d('0x2')]},'defaultuser':{'type':Sequelize[_0x221d('0x2')]},'rtptimeout':{'type':Sequelize[_0x221d('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x221d('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x221d('0x17'),'no',_0x221d('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x221d('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x221d('0x26')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x221d('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x221d('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x221d('0x2')]},'use_q850_reason':{'type':Sequelize[_0x221d('0x2')]},'maxforwards':{'type':Sequelize[_0x221d('0x26')](0xb)},'encryption':{'type':Sequelize[_0x221d('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x221d('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x221d('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x221d('0x4')]('yes','no',_0x221d('0x2e'),_0x221d('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x221d('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0x221d('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x221d('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x221d('0x2')]},'dtlscapath':{'type':Sequelize[_0x221d('0x2')]},'dtlssetup':{'type':Sequelize[_0x221d('0x4')]('active','passive',_0x221d('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x221d('0x2')]},'usereqphone':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x221d('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x221d('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x221d('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x221d('0x17'),'no')},'vmexten':{'type':Sequelize[_0x221d('0x2')]},'mohinterpret':{'type':Sequelize[_0x221d('0x2')]},'mohsuggest':{'type':Sequelize[_0x221d('0x2')]},'parkinglot':{'type':Sequelize[_0x221d('0x2')]},'description':{'type':Sequelize[_0x221d('0x2')]},'host':{'type':Sequelize[_0x221d('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x221d('0x4')](_0x221d('0x17'),'no',_0x221d('0x18'),_0x221d('0x19'),_0x221d('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x221d('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x221d('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x221d('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index bb8cce8..d4db7fa 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 _0x9c44=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','clone','find','omit','createdAt','body','updatedAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','params','/etc/asterisk/sip_xcally_registers.conf','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','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','get','Trunks','destroy','stack','name','send','index','Trunk','rawAttributes','fieldName','type'];(function(_0x35c506,_0x18351c){var _0x4d025c=function(_0x4f8b02){while(--_0x4f8b02){_0x35c506['push'](_0x35c506['shift']());}};_0x4d025c(++_0x18351c);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'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'];var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x16')][_0x49c4('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5f2fd9,_0x1909fe,_0x280996,_0x21f15a){return new BPromise(function(_0x2decee,_0x12777c){var _0x18211c=_0x21f15a||client;return _0x18211c[_0x49c4('0x18')](_0x5f2fd9,_0x280996)[_0x49c4('0x19')](function(_0x58d177){logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));logger[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x1909fe,'request\x20sent',JSON[_0x49c4('0x1f')](_0x58d177));if(_0x58d177[_0x49c4('0x20')]){if(_0x58d177['error']['code']===0x1f4){logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')]['message']);return _0x12777c(_0x58d177[_0x49c4('0x20')]['message']);}logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);return _0x2decee(_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);}else{logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));_0x2decee(_0x58d177['result']['message']);}})['catch'](function(_0x1c99b1){logger['error']('Trunk,\x20%s,\x20%s',_0x1909fe,_0x1c99b1);_0x12777c(_0x1c99b1);});});}function respondWithStatusCode(_0x2263ae,_0x15581b){_0x15581b=_0x15581b||0xcc;return function(_0x26c640){if(_0x26c640){return _0x2263ae[_0x49c4('0x22')](_0x15581b);}return _0x2263ae['status'](_0x15581b)['end']();};}function respondWithResult(_0x180276,_0x9cb797){_0x9cb797=_0x9cb797||0xc8;return function(_0x565423){if(_0x565423){return _0x180276[_0x49c4('0x23')](_0x9cb797)[_0x49c4('0x24')](_0x565423);}};}function respondWithFilteredResult(_0x210159,_0xa7a826){return function(_0x531d92){if(_0x531d92){var _0x543ea2=typeof _0xa7a826[_0x49c4('0x25')]==='undefined'&&typeof _0xa7a826[_0x49c4('0x26')]===_0x49c4('0x27');var _0x3f1708=_0x531d92[_0x49c4('0x28')];var _0x5987ae=_0x543ea2?0x0:_0xa7a826[_0x49c4('0x25')];var _0x2b2793=_0x543ea2?_0x531d92[_0x49c4('0x28')]:_0xa7a826[_0x49c4('0x25')]+_0xa7a826[_0x49c4('0x26')];var _0x29f835;if(_0x2b2793>=_0x3f1708){_0x2b2793=_0x3f1708;_0x29f835=0xc8;}else{_0x29f835=0xce;}_0x210159[_0x49c4('0x23')](_0x29f835);return _0x210159[_0x49c4('0x29')](_0x49c4('0x2a'),_0x5987ae+'-'+_0x2b2793+'/'+_0x3f1708)[_0x49c4('0x24')](_0x531d92);}return null;};}function patchUpdates(_0x46f7ea){return function(_0x4ea6ea){try{jsonpatch['apply'](_0x4ea6ea,_0x46f7ea,!![]);}catch(_0x59eb84){return BPromise[_0x49c4('0x2b')](_0x59eb84);}return _0x4ea6ea[_0x49c4('0x2c')]();};}function saveUpdates(_0x1eb035,_0x27e467){return function(_0x28eb47){if(_0x28eb47){return _0x28eb47['update'](_0x1eb035)[_0x49c4('0x19')](function(_0x116eb4){return _0x116eb4;});}return null;};}function removeEntity(_0x2e7a69,_0x24bba9){return function(_0x58e252){if(_0x58e252){return _0x58e252['destroy']()[_0x49c4('0x19')](function(){var _0x9a1bed=_0x58e252[_0x49c4('0x2d')]({'plain':!![]});var _0x13b3b4=_0x49c4('0x2e');return db['UserProfileResource'][_0x49c4('0x2f')]({'where':{'type':_0x13b3b4,'resourceId':_0x9a1bed['id']}})[_0x49c4('0x19')](function(){return _0x58e252;});})[_0x49c4('0x19')](function(){_0x2e7a69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x85dce2,_0x1991e9){return function(_0x3bec0a){if(!_0x3bec0a){_0x85dce2[_0x49c4('0x22')](0x194);}return _0x3bec0a;};}function handleError(_0x2b45a1,_0x2cf897){_0x2cf897=_0x2cf897||0x1f4;return function(_0x1d1557){logger[_0x49c4('0x20')](_0x1d1557[_0x49c4('0x30')]);if(_0x1d1557['name']){delete _0x1d1557[_0x49c4('0x31')];}_0x2b45a1['status'](_0x2cf897)[_0x49c4('0x32')](_0x1d1557);};}exports[_0x49c4('0x33')]=function(_0x2625a6,_0x1c2830){var _0x4ed4f8={},_0x335f0c={},_0x31f3ff={'count':0x0,'rows':[]};var _0x1c910a=_['map'](db[_0x49c4('0x34')][_0x49c4('0x35')],function(_0x178987){return{'name':_0x178987[_0x49c4('0x36')],'type':_0x178987[_0x49c4('0x37')][_0x49c4('0x38')]};});_0x335f0c[_0x49c4('0x39')]=_[_0x49c4('0x3a')](_0x1c910a,_0x49c4('0x31'));_0x335f0c[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2625a6['query']);_0x335f0c[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],_0x335f0c[_0x49c4('0x3b')]);_0x4ed4f8[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x4ed4f8[_0x49c4('0x3f')]=_0x4ed4f8[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x4ed4f8['attributes']:_0x335f0c[_0x49c4('0x39')];if(!_0x2625a6['query'][_0x49c4('0x42')](_0x49c4('0x43'))){_0x4ed4f8[_0x49c4('0x26')]=qs[_0x49c4('0x26')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x26')]);_0x4ed4f8['offset']=qs['offset'](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x25')]);}_0x4ed4f8[_0x49c4('0x44')]=qs[_0x49c4('0x45')](_0x2625a6['query'][_0x49c4('0x45')]);_0x4ed4f8[_0x49c4('0x46')]=qs[_0x49c4('0x3d')](_[_0x49c4('0x47')](_0x2625a6[_0x49c4('0x3b')],_0x335f0c[_0x49c4('0x3d')]),_0x1c910a);if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x48')]){_0x4ed4f8[_0x49c4('0x46')]=_['merge'](_0x4ed4f8[_0x49c4('0x46')],{'$or':_['map'](_0x1c910a,function(_0x33696e){if(_0x33696e[_0x49c4('0x37')]!==_0x49c4('0x49')){var _0x258abe={};_0x258abe[_0x33696e[_0x49c4('0x31')]]={'$like':'%'+_0x2625a6['query'][_0x49c4('0x48')]+'%'};return _0x258abe;}})});}_0x4ed4f8=_[_0x49c4('0x4a')]({},_0x4ed4f8,_0x2625a6[_0x49c4('0x4b')]);var _0x254d07={'where':_0x4ed4f8[_0x49c4('0x46')]};return db[_0x49c4('0x34')][_0x49c4('0x28')](_0x254d07)['then'](function(_0x3bac1b){_0x31f3ff['count']=_0x3bac1b;if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x4c')]){_0x4ed4f8[_0x49c4('0x4d')]=[{'all':!![]}];}return db[_0x49c4('0x34')][_0x49c4('0x4e')](_0x4ed4f8);})[_0x49c4('0x19')](function(_0x2c6be1){_0x31f3ff['rows']=_0x2c6be1;return _0x31f3ff;})[_0x49c4('0x19')](respondWithFilteredResult(_0x1c2830,_0x4ed4f8))[_0x49c4('0x4f')](handleError(_0x1c2830,null));};exports['show']=function(_0x1e1ac4,_0xaece5f){var _0xfbe179={'raw':![],'where':{'id':_0x1e1ac4['params']['id']}},_0x242afc={};_0x242afc['model']=_[_0x49c4('0x3c')](db['Trunk'][_0x49c4('0x35')]);_0x242afc[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x1e1ac4[_0x49c4('0x3b')]);_0x242afc[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],_0x242afc['query']);_0xfbe179[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x1e1ac4[_0x49c4('0x3b')][_0x49c4('0x40')]));_0xfbe179[_0x49c4('0x3f')]=_0xfbe179[_0x49c4('0x3f')][_0x49c4('0x41')]?_0xfbe179[_0x49c4('0x3f')]:_0x242afc['model'];if(_0x1e1ac4['query'][_0x49c4('0x4c')]){_0xfbe179[_0x49c4('0x4d')]=[{'all':!![]}];}_0xfbe179=_['merge']({},_0xfbe179,_0x1e1ac4['options']);return db[_0x49c4('0x34')]['find'](_0xfbe179)['then'](handleEntityNotFound(_0xaece5f,null))[_0x49c4('0x19')](respondWithResult(_0xaece5f,null))[_0x49c4('0x4f')](handleError(_0xaece5f,null));};exports[_0x49c4('0x50')]=function(_0x38c480,_0x2884ca){var _0x16949a={'where':{'id':_0x38c480['params']['id']}},_0x35724e={};_0x35724e[_0x49c4('0x39')]=_[_0x49c4('0x3c')](db[_0x49c4('0x34')][_0x49c4('0x35')]);_0x16949a[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x35724e['model'],qs['fields'](_0x38c480[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x16949a[_0x49c4('0x3f')]=_0x16949a[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x16949a[_0x49c4('0x3f')]:_0x35724e[_0x49c4('0x39')];if(_0x38c480['query'][_0x49c4('0x4c')]){_0x16949a[_0x49c4('0x4d')]=[{'all':!![]}];}_0x16949a=_['merge']({},_0x16949a,_0x38c480[_0x49c4('0x4b')]);return db['Trunk'][_0x49c4('0x51')](_0x16949a)[_0x49c4('0x19')](handleEntityNotFound(_0x2884ca,null))[_0x49c4('0x19')](function(_0x2fe89a){if(_0x2fe89a){var _0x845f7e=_0x2fe89a[_0x49c4('0x2d')]({'plain':!![]});_0x845f7e=qs[_0x49c4('0x52')](_0x845f7e,['id',_0x49c4('0x53'),'updatedAt']);_0x38c480[_0x49c4('0x54')]=_[_0x49c4('0x52')](_0x38c480['body'],['id',_0x49c4('0x53'),_0x49c4('0x55')]);return db['Trunk'][_0x49c4('0x56')](_[_0x49c4('0x4a')](_0x845f7e,_0x38c480['body']),{'include':_0x38c480['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xc43386){var _0x54947d=_0x38c480[_0x49c4('0x57')][_0x49c4('0x2d')]({'plain':!![]});if(!_0x54947d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54947d[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x5ac9f0=_0xc43386[_0x49c4('0x2d')]({'plain':!![]});var _0x3dcf4c=_0x49c4('0x2e');return db[_0x49c4('0x59')]['find']({'where':{'name':_0x3dcf4c,'userProfileId':_0x54947d[_0x49c4('0x5a')]},'raw':!![]})[_0x49c4('0x19')](function(_0x3cc604){if(_0x3cc604&&_0x3cc604[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x5ac9f0['name'],'resourceId':_0x5ac9f0['id'],'type':_0x3cc604['name'],'sectionId':_0x3cc604['id']},{})['then'](function(){return _0xc43386;});}else{return _0xc43386;}})['catch'](function(_0x302251){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x302251);throw _0x302251;});}return _0xc43386;});}})[_0x49c4('0x19')](respondWithResult(_0x2884ca,0xc9))['catch'](handleError(_0x2884ca,null));};exports['create']=function(_0x340523,_0x109b81,_0x342326){var _0x295ad0;return db[_0x49c4('0x34')][_0x49c4('0x56')](_0x340523[_0x49c4('0x54')],{'raw':!![]})[_0x49c4('0x19')](function(_0x4d49e0){_0x295ad0=_0x4d49e0;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x264902){var _0x1a5d4c=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x13d951=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x2d5f63=ejs[_0x49c4('0x63')](_0x1a5d4c,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x2d5f63);if(_0x295ad0['registry']){var _0x5ec201=ejs[_0x49c4('0x63')](_0x13d951,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x5ec201);}})[_0x49c4('0x19')](function(){return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x56'),{'module':_0x49c4('0x67')});})['then'](function(){var _0x5a14a5=_0x340523['user'][_0x49c4('0x2d')]({'plain':!![]});if(!_0x5a14a5)throw new Error(_0x49c4('0x68'));if(_0x5a14a5[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x118fc4=_0x295ad0[_0x49c4('0x2d')]({'plain':!![]});return db[_0x49c4('0x59')][_0x49c4('0x51')]({'where':{'name':_0x49c4('0x2e'),'userProfileId':_0x5a14a5['userProfileId']},'raw':!![]})[_0x49c4('0x19')](function(_0x10fb84){if(_0x10fb84&&_0x10fb84[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x118fc4[_0x49c4('0x31')],'resourceId':_0x118fc4['id'],'type':_0x10fb84[_0x49c4('0x31')],'sectionId':_0x10fb84['id']},{})[_0x49c4('0x19')](function(){return _0x295ad0;});}else{return _0x295ad0;}})[_0x49c4('0x4f')](function(_0x2fd749){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x2fd749);throw _0x2fd749;});}return _0x295ad0;})['then'](respondWithResult(_0x109b81,0xc9))[_0x49c4('0x4f')](handleError(_0x109b81,null));};exports[_0x49c4('0x69')]=function(_0x85540f,_0x18e82b,_0x1e948a){var _0x4a204d;return db['Trunk'][_0x49c4('0x51')]({'where':{'id':_0x85540f['params']['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x18e82b,null))['then'](saveUpdates(_0x85540f[_0x49c4('0x54')],null))[_0x49c4('0x19')](function(_0x3b03dd){if(_0x3b03dd){_0x4a204d=_0x3b03dd;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});}})[_0x49c4('0x19')](function(_0x38d7d3){if(_0x38d7d3){var _0x2ceada=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x46477f=fs[_0x49c4('0x5d')](path['join'](config[_0x49c4('0x5f')],_0x49c4('0x62')),'utf8');var _0x15bee0=ejs['render'](_0x2ceada,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x15bee0);var _0x1f14a6=ejs[_0x49c4('0x63')](_0x46477f,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x1f14a6);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x69'),{'module':'chan_sip.so'});}return null;})[_0x49c4('0x19')](function(_0x167e41){if(_0x167e41){return _0x4a204d;}})['then'](respondWithResult(_0x18e82b,null))[_0x49c4('0x4f')](handleError(_0x18e82b,null));};exports[_0x49c4('0x2f')]=function(_0x57b137,_0x37fef1,_0x993d00){var _0x25989a;return db[_0x49c4('0x34')]['find']({'where':{'id':_0x57b137[_0x49c4('0x6a')]['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x37fef1,null))['then'](removeEntity(_0x37fef1,null))[_0x49c4('0x19')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x507078){var _0x50fd24=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config['root'],_0x49c4('0x60')),'utf8');var _0x578f4b=fs['readFileSync'](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x4a5f0b=ejs['render'](_0x50fd24,{'trunks':_0x507078});var _0x348693=ejs['render'](_0x578f4b,{'trunks':_0x507078});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a5f0b);fs[_0x49c4('0x64')](_0x49c4('0x6b'),_0x348693);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x2f'),{'module':_0x49c4('0x67')});})[_0x49c4('0x4f')](handleError(_0x37fef1,null));}; \ No newline at end of file +var _0xe14d=['options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','omit','createdAt','updatedAt','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','UserProfileSection','autoAssociation','readFileSync','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','Trunks','UserProfileResource','destroy','stack','name','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0x226d3e,_0x59faaf){var _0x1a7fca=function(_0x54c792){while(--_0x54c792){_0x226d3e['push'](_0x226d3e['shift']());}};_0x1a7fca(++_0x59faaf);}(_0xe14d,0x1ee));var _0xde14=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xe14d[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require(_0xde14('0x0'));var rimraf=require(_0xde14('0x1'));var zipdir=require(_0xde14('0x2'));var jsonpatch=require(_0xde14('0x3'));var rp=require('request-promise');var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var Mustache=require('mustache');var util=require(_0xde14('0x6'));var path=require(_0xde14('0x7'));var sox=require(_0xde14('0x8'));var csv=require(_0xde14('0x9'));var ejs=require(_0xde14('0xa'));var fs=require('fs');var fs_extra=require(_0xde14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0x9'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var licenseUtil=require(_0xde14('0x19'));var db=require(_0xde14('0x1a'))['db'];var jayson=require(_0xde14('0x1b'));var client=jayson[_0xde14('0x1c')][_0xde14('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x464624,_0x3521d4,_0x281c54,_0x1489e9){return new BPromise(function(_0x54c58b,_0x584959){var _0x23c878=_0x1489e9||client;return _0x23c878[_0xde14('0x1e')](_0x464624,_0x281c54)[_0xde14('0x1f')](function(_0x4c86ff){logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));logger[_0xde14('0x23')](_0xde14('0x24'),_0x3521d4,_0xde14('0x22'),JSON[_0xde14('0x25')](_0x4c86ff));if(_0x4c86ff[_0xde14('0x26')]){if(_0x4c86ff[_0xde14('0x26')][_0xde14('0x27')]===0x1f4){logger['error'](_0xde14('0x21'),_0x3521d4,_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);return _0x584959(_0x4c86ff[_0xde14('0x26')]['message']);}logger[_0xde14('0x26')]('Trunk,\x20%s,\x20%s',_0x3521d4,_0x4c86ff[_0xde14('0x26')]['message']);return _0x54c58b(_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);}else{logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));_0x54c58b(_0x4c86ff[_0xde14('0x29')][_0xde14('0x28')]);}})[_0xde14('0x2a')](function(_0xdd8d59){logger[_0xde14('0x26')](_0xde14('0x21'),_0x3521d4,_0xdd8d59);_0x584959(_0xdd8d59);});});}function respondWithStatusCode(_0xbaa078,_0x8f8033){_0x8f8033=_0x8f8033||0xcc;return function(_0x5ae4c1){if(_0x5ae4c1){return _0xbaa078[_0xde14('0x2b')](_0x8f8033);}return _0xbaa078[_0xde14('0x2c')](_0x8f8033)[_0xde14('0x2d')]();};}function respondWithResult(_0xbd05d6,_0x1bb7be){_0x1bb7be=_0x1bb7be||0xc8;return function(_0x21ef15){if(_0x21ef15){return _0xbd05d6[_0xde14('0x2c')](_0x1bb7be)[_0xde14('0x2e')](_0x21ef15);}};}function respondWithFilteredResult(_0x1618e1,_0x350a78){return function(_0x4eff65){if(_0x4eff65){var _0x309922=typeof _0x350a78[_0xde14('0x2f')]===_0xde14('0x30')&&typeof _0x350a78[_0xde14('0x31')]==='undefined';var _0x3fc2a4=_0x4eff65[_0xde14('0x32')];var _0x30c4a8=_0x309922?0x0:_0x350a78['offset'];var _0x4655fb=_0x309922?_0x4eff65['count']:_0x350a78[_0xde14('0x2f')]+_0x350a78[_0xde14('0x31')];var _0x3bb1da;if(_0x4655fb>=_0x3fc2a4){_0x4655fb=_0x3fc2a4;_0x3bb1da=0xc8;}else{_0x3bb1da=0xce;}_0x1618e1[_0xde14('0x2c')](_0x3bb1da);return _0x1618e1[_0xde14('0x33')](_0xde14('0x34'),_0x30c4a8+'-'+_0x4655fb+'/'+_0x3fc2a4)[_0xde14('0x2e')](_0x4eff65);}return null;};}function patchUpdates(_0x464666){return function(_0x4e7c5b){try{jsonpatch[_0xde14('0x35')](_0x4e7c5b,_0x464666,!![]);}catch(_0xbf49ac){return BPromise['reject'](_0xbf49ac);}return _0x4e7c5b[_0xde14('0x36')]();};}function saveUpdates(_0x4c9b15,_0x2e40ad){return function(_0x44e88a){if(_0x44e88a){return _0x44e88a[_0xde14('0x37')](_0x4c9b15)[_0xde14('0x1f')](function(_0x13c164){return _0x13c164;});}return null;};}function removeEntity(_0x57fc47,_0x26dfa9){return function(_0x57b98b){if(_0x57b98b){return _0x57b98b['destroy']()[_0xde14('0x1f')](function(){var _0x3c943b=_0x57b98b[_0xde14('0x38')]({'plain':!![]});var _0x319136=_0xde14('0x39');return db[_0xde14('0x3a')][_0xde14('0x3b')]({'where':{'type':_0x319136,'resourceId':_0x3c943b['id']}})[_0xde14('0x1f')](function(){return _0x57b98b;});})[_0xde14('0x1f')](function(){_0x57fc47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7136,_0x403007){return function(_0x20913d){if(!_0x20913d){_0x1c7136[_0xde14('0x2b')](0x194);}return _0x20913d;};}function handleError(_0x31cad4,_0x23813f){_0x23813f=_0x23813f||0x1f4;return function(_0x1f42ab){logger[_0xde14('0x26')](_0x1f42ab[_0xde14('0x3c')]);if(_0x1f42ab['name']){delete _0x1f42ab[_0xde14('0x3d')];}_0x31cad4['status'](_0x23813f)['send'](_0x1f42ab);};}exports['index']=function(_0xb0eba6,_0x258759){var _0x398f63={},_0x152dab={},_0x1228d8={'count':0x0,'rows':[]};var _0x8b5bb4=_[_0xde14('0x3e')](db[_0xde14('0x3f')]['rawAttributes'],function(_0xc2a39d){return{'name':_0xc2a39d[_0xde14('0x40')],'type':_0xc2a39d[_0xde14('0x41')][_0xde14('0x42')]};});_0x152dab[_0xde14('0x43')]=_[_0xde14('0x3e')](_0x8b5bb4,_0xde14('0x3d'));_0x152dab[_0xde14('0x44')]=_['keys'](_0xb0eba6[_0xde14('0x44')]);_0x152dab[_0xde14('0x45')]=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],_0x152dab['query']);_0x398f63['attributes']=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],qs[_0xde14('0x47')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x47')]));_0x398f63['attributes']=_0x398f63[_0xde14('0x48')][_0xde14('0x49')]?_0x398f63[_0xde14('0x48')]:_0x152dab['model'];if(!_0xb0eba6[_0xde14('0x44')]['hasOwnProperty'](_0xde14('0x4a'))){_0x398f63['limit']=qs[_0xde14('0x31')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x31')]);_0x398f63[_0xde14('0x2f')]=qs[_0xde14('0x2f')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x2f')]);}_0x398f63[_0xde14('0x4b')]=qs['sort'](_0xb0eba6[_0xde14('0x44')]['sort']);_0x398f63[_0xde14('0x4c')]=qs['filters'](_[_0xde14('0x4d')](_0xb0eba6[_0xde14('0x44')],_0x152dab[_0xde14('0x45')]),_0x8b5bb4);if(_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]){_0x398f63[_0xde14('0x4c')]=_[_0xde14('0x4f')](_0x398f63[_0xde14('0x4c')],{'$or':_['map'](_0x8b5bb4,function(_0x15859c){if(_0x15859c[_0xde14('0x41')]!==_0xde14('0x50')){var _0x4b1ef7={};_0x4b1ef7[_0x15859c['name']]={'$like':'%'+_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]+'%'};return _0x4b1ef7;}})});}_0x398f63=_[_0xde14('0x4f')]({},_0x398f63,_0xb0eba6[_0xde14('0x51')]);var _0x39572b={'where':_0x398f63[_0xde14('0x4c')]};return db['Trunk'][_0xde14('0x32')](_0x39572b)['then'](function(_0xa408ec){_0x1228d8[_0xde14('0x32')]=_0xa408ec;if(_0xb0eba6['query'][_0xde14('0x52')]){_0x398f63[_0xde14('0x53')]=[{'all':!![]}];}return db[_0xde14('0x3f')][_0xde14('0x54')](_0x398f63);})[_0xde14('0x1f')](function(_0x1c87e1){_0x1228d8[_0xde14('0x55')]=_0x1c87e1;return _0x1228d8;})['then'](respondWithFilteredResult(_0x258759,_0x398f63))[_0xde14('0x2a')](handleError(_0x258759,null));};exports['show']=function(_0xfa80c8,_0x6aa9ab){var _0x237be4={'raw':![],'where':{'id':_0xfa80c8[_0xde14('0x56')]['id']}},_0x235202={};_0x235202[_0xde14('0x43')]=_[_0xde14('0x57')](db[_0xde14('0x3f')][_0xde14('0x58')]);_0x235202[_0xde14('0x44')]=_['keys'](_0xfa80c8[_0xde14('0x44')]);_0x235202[_0xde14('0x45')]=_[_0xde14('0x46')](_0x235202[_0xde14('0x43')],_0x235202[_0xde14('0x44')]);_0x237be4['attributes']=_[_0xde14('0x46')](_0x235202['model'],qs[_0xde14('0x47')](_0xfa80c8[_0xde14('0x44')][_0xde14('0x47')]));_0x237be4[_0xde14('0x48')]=_0x237be4[_0xde14('0x48')]['length']?_0x237be4['attributes']:_0x235202[_0xde14('0x43')];if(_0xfa80c8['query'][_0xde14('0x52')]){_0x237be4[_0xde14('0x53')]=[{'all':!![]}];}_0x237be4=_[_0xde14('0x4f')]({},_0x237be4,_0xfa80c8[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x237be4)[_0xde14('0x1f')](handleEntityNotFound(_0x6aa9ab,null))[_0xde14('0x1f')](respondWithResult(_0x6aa9ab,null))[_0xde14('0x2a')](handleError(_0x6aa9ab,null));};exports['clone']=function(_0x205a94,_0x2c972b){var _0x1ea6d2={'where':{'id':_0x205a94[_0xde14('0x56')]['id']}},_0x21d226={};_0x21d226['model']=_[_0xde14('0x57')](db['Trunk'][_0xde14('0x58')]);_0x1ea6d2[_0xde14('0x48')]=_[_0xde14('0x46')](_0x21d226[_0xde14('0x43')],qs[_0xde14('0x47')](_0x205a94[_0xde14('0x44')][_0xde14('0x47')]));_0x1ea6d2[_0xde14('0x48')]=_0x1ea6d2['attributes']['length']?_0x1ea6d2['attributes']:_0x21d226[_0xde14('0x43')];if(_0x205a94['query']['includeAll']){_0x1ea6d2[_0xde14('0x53')]=[{'all':!![]}];}_0x1ea6d2=_[_0xde14('0x4f')]({},_0x1ea6d2,_0x205a94[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x1ea6d2)[_0xde14('0x1f')](handleEntityNotFound(_0x2c972b,null))[_0xde14('0x1f')](function(_0x13f698){if(_0x13f698){var _0x2dd108=_0x13f698['get']({'plain':!![]});_0x2dd108=qs[_0xde14('0x5a')](_0x2dd108,['id',_0xde14('0x5b'),_0xde14('0x5c')]);_0x205a94['body']=_[_0xde14('0x5a')](_0x205a94['body'],['id',_0xde14('0x5b'),_0xde14('0x5c')]);return db[_0xde14('0x3f')][_0xde14('0x5d')](_[_0xde14('0x4f')](_0x2dd108,_0x205a94[_0xde14('0x5e')]),{'include':_0x205a94[_0xde14('0x44')]['includeAll']?[{'all':!![]}]:undefined})[_0xde14('0x1f')](function(_0x25ba7e){var _0x1a0bb1=_0x205a94[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x1a0bb1)throw new Error(_0xde14('0x60'));if(_0x1a0bb1[_0xde14('0x61')]==='user'){var _0x4a9e85=_0x25ba7e[_0xde14('0x38')]({'plain':!![]});var _0x19a162=_0xde14('0x39');return db['UserProfileSection'][_0xde14('0x59')]({'where':{'name':_0x19a162,'userProfileId':_0x1a0bb1[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x32e075){if(_0x32e075&&_0x32e075['autoAssociation']===0x0){return db['UserProfileResource'][_0xde14('0x5d')]({'name':_0x4a9e85[_0xde14('0x3d')],'resourceId':_0x4a9e85['id'],'type':_0x32e075[_0xde14('0x3d')],'sectionId':_0x32e075['id']},{})[_0xde14('0x1f')](function(){return _0x25ba7e;});}else{return _0x25ba7e;}})[_0xde14('0x2a')](function(_0x120284){logger[_0xde14('0x26')](_0xde14('0x63'),_0x120284);throw _0x120284;});}return _0x25ba7e;});}})[_0xde14('0x1f')](respondWithResult(_0x2c972b,0xc9))[_0xde14('0x2a')](handleError(_0x2c972b,null));};exports[_0xde14('0x5d')]=function(_0x299b69,_0x1ff577,_0x42329a){var _0x6a641f;return db[_0xde14('0x3f')][_0xde14('0x5d')](_0x299b69[_0xde14('0x5e')],{'raw':!![]})[_0xde14('0x1f')](function(_0x1b5d70){_0x6a641f=_0x1b5d70;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})[_0xde14('0x1f')](function(_0x4809fa){var _0x1084fb=fs['readFileSync'](path[_0xde14('0x64')](config['root'],_0xde14('0x65')),_0xde14('0x66'));var _0x3aaba2=fs['readFileSync'](path['join'](config[_0xde14('0x67')],_0xde14('0x68')),_0xde14('0x66'));var _0x430bdb=ejs['render'](_0x1084fb,{'trunks':_0x4809fa||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x430bdb);if(_0x6a641f[_0xde14('0x6b')]){var _0x500344=ejs['render'](_0x3aaba2,{'trunks':_0x4809fa||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x500344);}})[_0xde14('0x1f')](function(){return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x5d'),{'module':'chan_sip.so'});})[_0xde14('0x1f')](function(){var _0x37f7c3=_0x299b69[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x37f7c3)throw new Error(_0xde14('0x60'));if(_0x37f7c3[_0xde14('0x61')]==='user'){var _0x579a6c=_0x6a641f[_0xde14('0x38')]({'plain':!![]});return db[_0xde14('0x6d')]['find']({'where':{'name':_0xde14('0x39'),'userProfileId':_0x37f7c3[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x367ede){if(_0x367ede&&_0x367ede[_0xde14('0x6e')]===0x0){return db[_0xde14('0x3a')][_0xde14('0x5d')]({'name':_0x579a6c['name'],'resourceId':_0x579a6c['id'],'type':_0x367ede['name'],'sectionId':_0x367ede['id']},{})['then'](function(){return _0x6a641f;});}else{return _0x6a641f;}})['catch'](function(_0x3dbda9){logger[_0xde14('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dbda9);throw _0x3dbda9;});}return _0x6a641f;})['then'](respondWithResult(_0x1ff577,0xc9))[_0xde14('0x2a')](handleError(_0x1ff577,null));};exports[_0xde14('0x37')]=function(_0xe2b9f5,_0x5805ec,_0x1aa75d){var _0x2b1e2e;return db['Trunk'][_0xde14('0x59')]({'where':{'id':_0xe2b9f5[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5805ec,null))[_0xde14('0x1f')](saveUpdates(_0xe2b9f5['body'],null))[_0xde14('0x1f')](function(_0x5a5b25){if(_0x5a5b25){_0x2b1e2e=_0x5a5b25;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});}})[_0xde14('0x1f')](function(_0x5f49d1){if(_0x5f49d1){var _0x283eb8=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],_0xde14('0x65')),'utf8');var _0x53433d=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),_0xde14('0x66'));var _0x1a12b5=ejs[_0xde14('0x70')](_0x283eb8,{'trunks':_0x5f49d1||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x1a12b5);var _0x2cc5b7=ejs[_0xde14('0x70')](_0x53433d,{'trunks':_0x5f49d1||[]});fs['writeFileSync'](_0xde14('0x71'),_0x2cc5b7);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x37'),{'module':_0xde14('0x72')});}return null;})[_0xde14('0x1f')](function(_0x1732d0){if(_0x1732d0){return _0x2b1e2e;}})[_0xde14('0x1f')](respondWithResult(_0x5805ec,null))['catch'](handleError(_0x5805ec,null));};exports[_0xde14('0x3b')]=function(_0x1bdeae,_0x5f4b92,_0x4543f1){var _0x4a0108;return db[_0xde14('0x3f')]['find']({'where':{'id':_0x1bdeae[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5f4b92,null))[_0xde14('0x1f')](removeEntity(_0x5f4b92,null))[_0xde14('0x1f')](function(){return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})['then'](function(_0x43a155){var _0x58cf06=fs[_0xde14('0x6f')](path['join'](config[_0xde14('0x67')],_0xde14('0x65')),_0xde14('0x66'));var _0x4a1114=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x495741=ejs['render'](_0x58cf06,{'trunks':_0x43a155});var _0x381d6d=ejs[_0xde14('0x70')](_0x4a1114,{'trunks':_0x43a155});fs['writeFileSync'](_0xde14('0x6a'),_0x495741);fs[_0xde14('0x69')](_0xde14('0x71'),_0x381d6d);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x3b'),{'module':'chan_sip.so'});})[_0xde14('0x2a')](handleError(_0x5f4b92,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 1d413d7..e215265 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 _0x8b30=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','Trunk','tools_trunks'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8b30,0x108));var _0x08b3=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x8b30[_0x369151];return _0x4292d5;};'use strict';var _=require(_0x08b3('0x0'));var util=require(_0x08b3('0x1'));var logger=require(_0x08b3('0x2'))(_0x08b3('0x3'));var moment=require(_0x08b3('0x4'));var BPromise=require(_0x08b3('0x5'));var rp=require(_0x08b3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x08b3('0x7'));var attributes=require('./trunk.attributes');module[_0x08b3('0x8')]=function(_0x3824b8,_0x436280){return _0x3824b8[_0x08b3('0x9')](_0x08b3('0xa'),attributes,{'tableName':_0x08b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffe6=['define','Trunk','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./trunk.attributes','exports'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xffe6,0x17e));var _0x6ffe=function(_0x1a3103,_0x2d9a72){_0x1a3103=_0x1a3103-0x0;var _0x4c5d1d=_0xffe6[_0x1a3103];return _0x4c5d1d;};'use strict';var _=require(_0x6ffe('0x0'));var util=require('util');var logger=require(_0x6ffe('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6ffe('0x2'));var rp=require(_0x6ffe('0x3'));var fs=require('fs');var path=require(_0x6ffe('0x4'));var rimraf=require('rimraf');var config=require(_0x6ffe('0x5'));var attributes=require(_0x6ffe('0x6'));module[_0x6ffe('0x7')]=function(_0x2f8d8a,_0x30fb74){return _0x2f8d8a[_0x6ffe('0x8')](_0x6ffe('0x9'),attributes,{'tableName':'tools_trunks','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 2122263..83eb088 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 _0x6d22=['model','GetTrunk','catch','ShowTrunk','find','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','findAll','options','raw','attributes','limit','include','map'];(function(_0x1a8192,_0x3453f2){var _0x131de2=function(_0x50ab1c){while(--_0x50ab1c){_0x1a8192['push'](_0x1a8192['shift']());}};_0x131de2(++_0x3453f2);}(_0x6d22,0x11c));var _0x26d2=function(_0x3a577a,_0x592a16){_0x3a577a=_0x3a577a-0x0;var _0x493322=_0x6d22[_0x3a577a];return _0x493322;};'use strict';var _=require('lodash');var util=require(_0x26d2('0x0'));var moment=require(_0x26d2('0x1'));var BPromise=require('bluebird');var rs=require(_0x26d2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26d2('0x3'))['db'];var utils=require(_0x26d2('0x4'));var logger=require(_0x26d2('0x5'))(_0x26d2('0x6'));var config=require('../../config/environment');var jayson=require(_0x26d2('0x7'));var client=jayson['client'][_0x26d2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53d5f0,_0x5b8bf7,_0x4639a0){return new BPromise(function(_0x3db02a,_0x539b66){return client[_0x26d2('0x9')](_0x53d5f0,_0x4639a0)[_0x26d2('0xa')](function(_0x1a53fb){logger[_0x26d2('0xb')](_0x26d2('0xc'),_0x5b8bf7,'request\x20sent');logger[_0x26d2('0xd')](_0x26d2('0xe'),_0x5b8bf7,_0x26d2('0xf'),JSON[_0x26d2('0x10')](_0x1a53fb));if(_0x1a53fb['error']){if(_0x1a53fb[_0x26d2('0x11')]['code']===0x1f4){logger[_0x26d2('0x11')](_0x26d2('0xc'),_0x5b8bf7,_0x1a53fb[_0x26d2('0x11')][_0x26d2('0x12')]);return _0x539b66(_0x1a53fb[_0x26d2('0x11')][_0x26d2('0x12')]);}logger[_0x26d2('0x11')](_0x26d2('0xc'),_0x5b8bf7,_0x1a53fb[_0x26d2('0x11')][_0x26d2('0x12')]);return _0x3db02a(_0x1a53fb[_0x26d2('0x11')][_0x26d2('0x12')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x5b8bf7,_0x26d2('0xf'));_0x3db02a(_0x1a53fb['result'][_0x26d2('0x12')]);}})['catch'](function(_0x49d4bf){logger[_0x26d2('0x11')]('Trunk,\x20%s,\x20%s',_0x5b8bf7,_0x49d4bf);_0x539b66(_0x49d4bf);});});}exports['GetTrunk']=function(_0x3c1f98){var _0x556771=this;return new Promise(function(_0x4102bf,_0x1d1e41){return db['Trunk'][_0x26d2('0x13')]({'raw':_0x3c1f98['options']?_0x3c1f98[_0x26d2('0x14')][_0x26d2('0x15')]===undefined?!![]:![]:!![],'where':_0x3c1f98[_0x26d2('0x14')]?_0x3c1f98[_0x26d2('0x14')]['where']||null:null,'attributes':_0x3c1f98[_0x26d2('0x14')]?_0x3c1f98[_0x26d2('0x14')][_0x26d2('0x16')]||null:null,'limit':_0x3c1f98[_0x26d2('0x14')]?_0x3c1f98[_0x26d2('0x14')][_0x26d2('0x17')]||null:null,'include':_0x3c1f98[_0x26d2('0x14')]?_0x3c1f98[_0x26d2('0x14')][_0x26d2('0x18')]?_[_0x26d2('0x19')](_0x3c1f98[_0x26d2('0x14')]['include'],function(_0x424746){return{'model':db[_0x424746['model']],'as':_0x424746['as'],'attributes':_0x424746[_0x26d2('0x16')],'include':_0x424746[_0x26d2('0x18')]?_['map'](_0x424746[_0x26d2('0x18')],function(_0x5b8fe1){return{'model':db[_0x5b8fe1['model']],'as':_0x5b8fe1['as'],'attributes':_0x5b8fe1[_0x26d2('0x16')],'include':_0x5b8fe1['include']?_['map'](_0x5b8fe1[_0x26d2('0x18')],function(_0x385778){return{'model':db[_0x385778[_0x26d2('0x1a')]],'as':_0x385778['as'],'attributes':_0x385778[_0x26d2('0x16')]};}):[]};}):[]};}):[]:[]})[_0x26d2('0xa')](function(_0x1b5444){logger[_0x26d2('0xb')](_0x26d2('0x1b'),_0x3c1f98);logger[_0x26d2('0xd')](_0x26d2('0x1b'),_0x3c1f98,JSON[_0x26d2('0x10')](_0x1b5444));_0x4102bf(_0x1b5444);})[_0x26d2('0x1c')](function(_0x13504e){logger[_0x26d2('0x11')](_0x26d2('0x1b'),_0x13504e[_0x26d2('0x12')],_0x3c1f98);_0x1d1e41(_0x556771[_0x26d2('0x11')](0x1f4,_0x13504e[_0x26d2('0x12')]));});});};exports[_0x26d2('0x1d')]=function(_0x3a8b63){var _0x2e594e=this;return new Promise(function(_0x53a971,_0x205aaf){return db['Trunk'][_0x26d2('0x1e')]({'raw':_0x3a8b63['options']?_0x3a8b63[_0x26d2('0x14')][_0x26d2('0x15')]===undefined?!![]:![]:!![],'where':_0x3a8b63[_0x26d2('0x14')]?_0x3a8b63[_0x26d2('0x14')]['where']||null:null,'attributes':_0x3a8b63['options']?_0x3a8b63[_0x26d2('0x14')][_0x26d2('0x16')]||null:null,'include':_0x3a8b63[_0x26d2('0x14')]?_0x3a8b63['options'][_0x26d2('0x18')]?_['map'](_0x3a8b63['options']['include'],function(_0x51718e){return{'model':db[_0x51718e[_0x26d2('0x1a')]],'as':_0x51718e['as'],'attributes':_0x51718e[_0x26d2('0x16')],'include':_0x51718e['include']?_[_0x26d2('0x19')](_0x51718e['include'],function(_0x5e9382){return{'model':db[_0x5e9382[_0x26d2('0x1a')]],'as':_0x5e9382['as'],'attributes':_0x5e9382['attributes'],'include':_0x5e9382[_0x26d2('0x18')]?_[_0x26d2('0x19')](_0x5e9382[_0x26d2('0x18')],function(_0x3ae599){return{'model':db[_0x3ae599[_0x26d2('0x1a')]],'as':_0x3ae599['as'],'attributes':_0x3ae599[_0x26d2('0x16')]};}):[]};}):[]};}):[]:[]})[_0x26d2('0xa')](function(_0x598fde){logger[_0x26d2('0xb')](_0x26d2('0x1d'),_0x3a8b63);logger[_0x26d2('0xd')](_0x26d2('0x1d'),_0x3a8b63,JSON[_0x26d2('0x10')](_0x598fde));_0x53a971(_0x598fde);})[_0x26d2('0x1c')](function(_0x179288){logger[_0x26d2('0x11')]('ShowTrunk',_0x179288[_0x26d2('0x12')],_0x3a8b63);_0x205aaf(_0x2e594e[_0x26d2('0x11')](0x1f4,_0x179288[_0x26d2('0x12')]));});});}; \ No newline at end of file +var _0xac52=['stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','map','model','debug','ShowTrunk','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac52,0x122));var _0x2ac5=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0xac52[_0x1ca9e9];return _0x309f3c;};'use strict';var _=require('lodash');var util=require(_0x2ac5('0x0'));var moment=require(_0x2ac5('0x1'));var BPromise=require(_0x2ac5('0x2'));var rs=require(_0x2ac5('0x3'));var fs=require('fs');var Redis=require(_0x2ac5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ac5('0x5'));var logger=require(_0x2ac5('0x6'))('rpc');var config=require(_0x2ac5('0x7'));var jayson=require(_0x2ac5('0x8'));var client=jayson[_0x2ac5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54a8ed,_0x433d88,_0x197aed){return new BPromise(function(_0x1ff724,_0x3fc8b5){return client[_0x2ac5('0xa')](_0x54a8ed,_0x197aed)[_0x2ac5('0xb')](function(_0x22f28b){logger[_0x2ac5('0xc')](_0x2ac5('0xd'),_0x433d88,_0x2ac5('0xe'));logger['debug'](_0x2ac5('0xf'),_0x433d88,_0x2ac5('0xe'),JSON[_0x2ac5('0x10')](_0x22f28b));if(_0x22f28b[_0x2ac5('0x11')]){if(_0x22f28b['error']['code']===0x1f4){logger['error'](_0x2ac5('0xd'),_0x433d88,_0x22f28b[_0x2ac5('0x11')][_0x2ac5('0x12')]);return _0x3fc8b5(_0x22f28b[_0x2ac5('0x11')][_0x2ac5('0x12')]);}logger['error'](_0x2ac5('0xd'),_0x433d88,_0x22f28b['error'][_0x2ac5('0x12')]);return _0x1ff724(_0x22f28b[_0x2ac5('0x11')][_0x2ac5('0x12')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x433d88,_0x2ac5('0xe'));_0x1ff724(_0x22f28b[_0x2ac5('0x13')][_0x2ac5('0x12')]);}})[_0x2ac5('0x14')](function(_0x1741ce){logger[_0x2ac5('0x11')](_0x2ac5('0xd'),_0x433d88,_0x1741ce);_0x3fc8b5(_0x1741ce);});});}exports[_0x2ac5('0x15')]=function(_0x101a68){var _0x1011ff=this;return new Promise(function(_0x4ba2b5,_0x32a806){return db[_0x2ac5('0x16')][_0x2ac5('0x17')]({'raw':_0x101a68['options']?_0x101a68[_0x2ac5('0x18')][_0x2ac5('0x19')]===undefined?!![]:![]:!![],'where':_0x101a68['options']?_0x101a68[_0x2ac5('0x18')][_0x2ac5('0x1a')]||null:null,'attributes':_0x101a68[_0x2ac5('0x18')]?_0x101a68[_0x2ac5('0x18')][_0x2ac5('0x1b')]||null:null,'limit':_0x101a68[_0x2ac5('0x18')]?_0x101a68[_0x2ac5('0x18')]['limit']||null:null,'include':_0x101a68[_0x2ac5('0x18')]?_0x101a68[_0x2ac5('0x18')][_0x2ac5('0x1c')]?_['map'](_0x101a68[_0x2ac5('0x18')][_0x2ac5('0x1c')],function(_0x409b63){return{'model':db[_0x409b63['model']],'as':_0x409b63['as'],'attributes':_0x409b63[_0x2ac5('0x1b')],'include':_0x409b63[_0x2ac5('0x1c')]?_[_0x2ac5('0x1d')](_0x409b63[_0x2ac5('0x1c')],function(_0x388ace){return{'model':db[_0x388ace[_0x2ac5('0x1e')]],'as':_0x388ace['as'],'attributes':_0x388ace['attributes'],'include':_0x388ace[_0x2ac5('0x1c')]?_[_0x2ac5('0x1d')](_0x388ace[_0x2ac5('0x1c')],function(_0x1a103e){return{'model':db[_0x1a103e[_0x2ac5('0x1e')]],'as':_0x1a103e['as'],'attributes':_0x1a103e[_0x2ac5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2ac5('0xb')](function(_0x31780f){logger['info'](_0x2ac5('0x15'),_0x101a68);logger[_0x2ac5('0x1f')](_0x2ac5('0x15'),_0x101a68,JSON[_0x2ac5('0x10')](_0x31780f));_0x4ba2b5(_0x31780f);})[_0x2ac5('0x14')](function(_0x2b7eb6){logger['error'](_0x2ac5('0x15'),_0x2b7eb6[_0x2ac5('0x12')],_0x101a68);_0x32a806(_0x1011ff['error'](0x1f4,_0x2b7eb6[_0x2ac5('0x12')]));});});};exports[_0x2ac5('0x20')]=function(_0x27c7c6){var _0x547442=this;return new Promise(function(_0x47e259,_0x3db568){return db[_0x2ac5('0x16')][_0x2ac5('0x21')]({'raw':_0x27c7c6[_0x2ac5('0x18')]?_0x27c7c6[_0x2ac5('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x27c7c6[_0x2ac5('0x18')]?_0x27c7c6[_0x2ac5('0x18')]['where']||null:null,'attributes':_0x27c7c6[_0x2ac5('0x18')]?_0x27c7c6[_0x2ac5('0x18')]['attributes']||null:null,'include':_0x27c7c6[_0x2ac5('0x18')]?_0x27c7c6[_0x2ac5('0x18')][_0x2ac5('0x1c')]?_['map'](_0x27c7c6[_0x2ac5('0x18')][_0x2ac5('0x1c')],function(_0x28e7b7){return{'model':db[_0x28e7b7['model']],'as':_0x28e7b7['as'],'attributes':_0x28e7b7['attributes'],'include':_0x28e7b7[_0x2ac5('0x1c')]?_['map'](_0x28e7b7[_0x2ac5('0x1c')],function(_0x4912eb){return{'model':db[_0x4912eb[_0x2ac5('0x1e')]],'as':_0x4912eb['as'],'attributes':_0x4912eb[_0x2ac5('0x1b')],'include':_0x4912eb['include']?_[_0x2ac5('0x1d')](_0x4912eb[_0x2ac5('0x1c')],function(_0x18d443){return{'model':db[_0x18d443[_0x2ac5('0x1e')]],'as':_0x18d443['as'],'attributes':_0x18d443[_0x2ac5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2ac5('0xb')](function(_0x269c86){logger[_0x2ac5('0xc')](_0x2ac5('0x20'),_0x27c7c6);logger[_0x2ac5('0x1f')](_0x2ac5('0x20'),_0x27c7c6,JSON[_0x2ac5('0x10')](_0x269c86));_0x47e259(_0x269c86);})['catch'](function(_0x591ac0){logger[_0x2ac5('0x11')](_0x2ac5('0x20'),_0x591ac0[_0x2ac5('0x12')],_0x27c7c6);_0x3db568(_0x547442[_0x2ac5('0x11')](0x1f4,_0x591ac0[_0x2ac5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 9c211e5..1f49a9b 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 _0x078c=['put','isAuthenticated','update','exports','Router','../../components/auth/service','./user-setting.controller'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x078c,0xa5));var _0xc078=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0x078c[_0x4df6f9];return _0x4b1a73;};'use strict';var express=require('express');var router=express[_0xc078('0x0')]();var auth=require(_0xc078('0x1'));var controller=require(_0xc078('0x2'));router[_0xc078('0x3')]('/:id',auth[_0xc078('0x4')](),controller[_0xc078('0x5')]);module[_0xc078('0x6')]=router; \ No newline at end of file +var _0x81b4=['../../components/auth/service','./user-setting.controller','put','isAuthenticated','update','express'];(function(_0x2c1407,_0x3a1371){var _0x368aa4=function(_0x423f81){while(--_0x423f81){_0x2c1407['push'](_0x2c1407['shift']());}};_0x368aa4(++_0x3a1371);}(_0x81b4,0x1c1));var _0x481b=function(_0x164ecd,_0x46ae5e){_0x164ecd=_0x164ecd-0x0;var _0x14a915=_0x81b4[_0x164ecd];return _0x14a915;};'use strict';var express=require(_0x481b('0x0'));var router=express['Router']();var auth=require(_0x481b('0x1'));var controller=require(_0x481b('0x2'));router[_0x481b('0x3')]('/:id',auth[_0x481b('0x4')](),controller[_0x481b('0x5')]);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 29079c4..2b958aa 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 _0x32cd=['BOOLEAN','DATE','UserId','sequelize','error','warning','info','debug','exports','ENUM'];(function(_0x5d68ba,_0x33be44){var _0x17cee3=function(_0x14e9ed){while(--_0x14e9ed){_0x5d68ba['push'](_0x5d68ba['shift']());}};_0x17cee3(++_0x33be44);}(_0x32cd,0x193));var _0xd32c=function(_0x266a3b,_0x2ec7d9){_0x266a3b=_0x266a3b-0x0;var _0x3db3ed=_0x32cd[_0x266a3b];return _0x3db3ed;};'use strict';var Sequelize=require(_0xd32c('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xd32c('0x1'),_0xd32c('0x2'),_0xd32c('0x3'),_0xd32c('0x4')];module[_0xd32c('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0xd32c('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xd32c('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd32c('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd32c('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0xd32c('0x9')}}; \ No newline at end of file +var _0x3dbd=['ENUM','error','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','warning','debug'];(function(_0x13e4d6,_0x4d647f){var _0x395c06=function(_0x55ce7f){while(--_0x55ce7f){_0x13e4d6['push'](_0x13e4d6['shift']());}};_0x395c06(++_0x4d647f);}(_0x3dbd,0x151));var _0xd3db=function(_0x36a469,_0x59d84c){_0x36a469=_0x36a469-0x0;var _0x3347fc=_0x3dbd[_0x36a469];return _0x3347fc;};'use strict';var Sequelize=require(_0xd3db('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0xd3db('0x1'),'info',_0xd3db('0x2')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xd3db('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xd3db('0x4'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd3db('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xd3db('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd3db('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xd3db('0x8')],'unique':_0xd3db('0x9')}}; \ 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 edecbd6..82a9259 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 _0x37a4=['error','stack','name','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','register','redis','defaults','status','json','update','then','sendStatus'];(function(_0x42c18a,_0x2c2713){var _0x37b1a0=function(_0xf2af58){while(--_0xf2af58){_0x42c18a['push'](_0x42c18a['shift']());}};_0x37b1a0(++_0x2c2713);}(_0x37a4,0xcb));var _0x437a=function(_0x22ef70,_0x442377){_0x22ef70=_0x22ef70-0x0;var _0x43da47=_0x37a4[_0x22ef70];return _0x43da47;};'use strict';var _=require(_0x437a('0x0'));var Redis=require('ioredis');var logger=require(_0x437a('0x1'))('api');var config=require(_0x437a('0x2'));var db=require(_0x437a('0x3'))['db'];var socket=require(_0x437a('0x4'))(new Redis(config['redis']));require('./user-setting.socket')[_0x437a('0x5')](socket);config[_0x437a('0x6')]=_[_0x437a('0x7')](config[_0x437a('0x6')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x1c567f,_0x3a4961){_0x3a4961=_0x3a4961||0xc8;return function(_0x5017ce){if(_0x5017ce){return _0x1c567f[_0x437a('0x8')](_0x3a4961)[_0x437a('0x9')](_0x5017ce);}};}function saveUpdates(_0x2fe1a5){return function(_0x24a2f4){if(_0x24a2f4){return _0x24a2f4[_0x437a('0xa')](_0x2fe1a5)[_0x437a('0xb')](function(_0x294d71){return _0x294d71;});}return null;};}function handleEntityNotFound(_0x38b90e){return function(_0x26832b){if(!_0x26832b){_0x38b90e[_0x437a('0xc')](0x194);}return _0x26832b;};}function handleError(_0xfdcfdc,_0x581d9a){_0x581d9a=_0x581d9a||0x1f4;return function(_0x23f321){logger[_0x437a('0xd')](_0x23f321[_0x437a('0xe')]);if(_0x23f321[_0x437a('0xf')]){delete _0x23f321[_0x437a('0xf')];}_0xfdcfdc['status'](_0x581d9a)[_0x437a('0x10')](_0x23f321);};}exports['update']=function(_0x9e115f,_0x1e902a){if(_0x9e115f[_0x437a('0x11')][_0x437a('0x12')]!==_0x437a('0x13'))throw new Error(_0x437a('0x14'));if(isNaN(Number(_0x9e115f[_0x437a('0x15')]['id'])))throw new Error(_0x437a('0x16'));return db[_0x437a('0x17')][_0x437a('0x18')]({'where':{'id':_0x9e115f[_0x437a('0x15')]['id']}})[_0x437a('0xb')](handleEntityNotFound(_0x1e902a,null))['then'](saveUpdates(_0x9e115f[_0x437a('0x19')],null))['then'](respondWithResult(_0x1e902a,null))[_0x437a('0x1a')](handleError(_0x1e902a,null));}; \ No newline at end of file +var _0x8d53=['status','json','then','sendStatus','stack','name','update','user','role','admin','params','UserSetting','catch','lodash','ioredis','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','localhost'];(function(_0x219cd3,_0x2bc436){var _0x1dd688=function(_0x53c132){while(--_0x53c132){_0x219cd3['push'](_0x219cd3['shift']());}};_0x1dd688(++_0x2bc436);}(_0x8d53,0x1c2));var _0x38d5=function(_0x17ca2b,_0x505718){_0x17ca2b=_0x17ca2b-0x0;var _0x410423=_0x8d53[_0x17ca2b];return _0x410423;};'use strict';var _=require(_0x38d5('0x0'));var Redis=require(_0x38d5('0x1'));var logger=require('../../config/logger')(_0x38d5('0x2'));var config=require(_0x38d5('0x3'));var db=require(_0x38d5('0x4'))['db'];var socket=require(_0x38d5('0x5'))(new Redis(config[_0x38d5('0x6')]));require(_0x38d5('0x7'))[_0x38d5('0x8')](socket);config[_0x38d5('0x6')]=_['defaults'](config[_0x38d5('0x6')],{'host':_0x38d5('0x9'),'port':0x18eb});function respondWithResult(_0xeb7913,_0x5aa1ca){_0x5aa1ca=_0x5aa1ca||0xc8;return function(_0x5ebf9a){if(_0x5ebf9a){return _0xeb7913[_0x38d5('0xa')](_0x5aa1ca)[_0x38d5('0xb')](_0x5ebf9a);}};}function saveUpdates(_0x2e8c98){return function(_0x2b1c73){if(_0x2b1c73){return _0x2b1c73['update'](_0x2e8c98)[_0x38d5('0xc')](function(_0x347b2f){return _0x347b2f;});}return null;};}function handleEntityNotFound(_0x49fa2b){return function(_0x22a846){if(!_0x22a846){_0x49fa2b[_0x38d5('0xd')](0x194);}return _0x22a846;};}function handleError(_0xb4b4b4,_0x3cc94f){_0x3cc94f=_0x3cc94f||0x1f4;return function(_0x505f9c){logger['error'](_0x505f9c[_0x38d5('0xe')]);if(_0x505f9c[_0x38d5('0xf')]){delete _0x505f9c['name'];}_0xb4b4b4[_0x38d5('0xa')](_0x3cc94f)['send'](_0x505f9c);};}exports[_0x38d5('0x10')]=function(_0x472134,_0x13e5b6){if(_0x472134[_0x38d5('0x11')][_0x38d5('0x12')]!==_0x38d5('0x13'))throw new Error('Unauthorized');if(isNaN(Number(_0x472134[_0x38d5('0x14')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x38d5('0x15')]['find']({'where':{'id':_0x472134[_0x38d5('0x14')]['id']}})[_0x38d5('0xc')](handleEntityNotFound(_0x13e5b6,null))[_0x38d5('0xc')](saveUpdates(_0x472134['body'],null))[_0x38d5('0xc')](respondWithResult(_0x13e5b6,null))[_0x38d5('0x16')](handleError(_0x13e5b6,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 7ae6dcd..367a0ca 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 _0x18db=['emit','hasOwnProperty','hook','events','../../mysqldb','UserSetting','setMaxListeners','update','remove'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x18db,0x16b));var _0xb18d=function(_0x489d1a,_0xe91bdd){_0x489d1a=_0x489d1a-0x0;var _0x2a9d76=_0x18db[_0x489d1a];return _0x2a9d76;};'use strict';var EventEmitter=require(_0xb18d('0x0'));var UserSetting=require(_0xb18d('0x1'))['db'][_0xb18d('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xb18d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb18d('0x4'),'afterDestroy':_0xb18d('0x5')};function emitEvent(_0x55496e){return function(_0x418ca6,_0xb3e58a,_0x13e6b4){UserSettingEvents[_0xb18d('0x6')](_0x55496e+':'+_0x418ca6['id'],_0x418ca6);UserSettingEvents[_0xb18d('0x6')](_0x55496e,_0x418ca6);_0x13e6b4(null);};}for(var e in events){if(events[_0xb18d('0x7')](e)){var event=events[e];UserSetting[_0xb18d('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0xd25d=['events','UserSetting','setMaxListeners','remove','hasOwnProperty'];(function(_0x2b26cc,_0xa807f8){var _0x1c2e98=function(_0x4724c1){while(--_0x4724c1){_0x2b26cc['push'](_0x2b26cc['shift']());}};_0x1c2e98(++_0xa807f8);}(_0xd25d,0x13b));var _0xdd25=function(_0x50a905,_0x3b16da){_0x50a905=_0x50a905-0x0;var _0x36ea13=_0xd25d[_0x50a905];return _0x36ea13;};'use strict';var EventEmitter=require(_0xdd25('0x0'));var UserSetting=require('../../mysqldb')['db'][_0xdd25('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xdd25('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdd25('0x3')};function emitEvent(_0x458ea0){return function(_0x52bbe2,_0x53cb2b,_0x3da41f){UserSettingEvents['emit'](_0x458ea0+':'+_0x52bbe2['id'],_0x52bbe2);UserSettingEvents['emit'](_0x458ea0,_0x52bbe2);_0x3da41f(null);};}for(var e in events){if(events[_0xdd25('0x4')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=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 cd61694..34decfc 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 _0x9e5e=['exports','define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x2fc8d8,_0x4807c6){var _0x4f35da=function(_0x13464c){while(--_0x13464c){_0x2fc8d8['push'](_0x2fc8d8['shift']());}};_0x4f35da(++_0x4807c6);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x9e5e[_0x556927];return _0x5f1235;};'use strict';var attributes=require(_0xe9e5('0x0'));module[_0xe9e5('0x1')]=function(_0x5a229a){return _0x5a229a[_0xe9e5('0x2')](_0xe9e5('0x3'),attributes,{'tableName':_0xe9e5('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c9784){if(!_0x4c9784[_0xe9e5('0x5')])_0x4c9784['clientSideLoggingEnabledSince']=null;else if(_0x4c9784[_0xe9e5('0x6')]===null)_0x4c9784[_0xe9e5('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x407f=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','define'];(function(_0xe74ab3,_0x3c339f){var _0xf9d75a=function(_0x2eb551){while(--_0x2eb551){_0xe74ab3['push'](_0xe74ab3['shift']());}};_0xf9d75a(++_0x3c339f);}(_0x407f,0xc2));var _0xf407=function(_0x2690a9,_0x49ec81){_0x2690a9=_0x2690a9-0x0;var _0xff234e=_0x407f[_0x2690a9];return _0xff234e;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x5e211d){return _0x5e211d[_0xf407('0x0')](_0xf407('0x1'),attributes,{'tableName':_0xf407('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ec297){if(!_0x1ec297[_0xf407('0x3')])_0x1ec297[_0xf407('0x4')]=null;else if(_0x1ec297[_0xf407('0x4')]===null)_0x1ec297[_0xf407('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index bb23fee..4af6e01 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 _0xb11e=['length','user-setting:','./user-setting.events','update','emit','user-setting:update:user-','UserId','register'];(function(_0x424648,_0xc47652){var _0x7f1d38=function(_0x171f18){while(--_0x171f18){_0x424648['push'](_0x424648['shift']());}};_0x7f1d38(++_0xc47652);}(_0xb11e,0x122));var _0xeb11=function(_0x235c81,_0x11a928){_0x235c81=_0x235c81-0x0;var _0x19cc3b=_0xb11e[_0x235c81];return _0x19cc3b;};'use strict';var UserSettingEvents=require(_0xeb11('0x0'));var events=['save','remove',_0xeb11('0x1')];function createListener(_0x32b619,_0x2d1c47){return function(_0x1cf078){_0x2d1c47[_0xeb11('0x2')](_0x32b619,_0x1cf078);if(_0x32b619==='user-setting:update'){_0x2d1c47[_0xeb11('0x2')](_0xeb11('0x3')+_0x1cf078[_0xeb11('0x4')],_0x1cf078);}};}exports[_0xeb11('0x5')]=function(_0x1f6ad1){for(var _0x237cbc=0x0,_0x4e481f=events[_0xeb11('0x6')];_0x237cbc<_0x4e481f;_0x237cbc++){var _0x461394=events[_0x237cbc];var _0x41f087=createListener(_0xeb11('0x7')+_0x461394,_0x1f6ad1);UserSettingEvents['on'](_0x461394,_0x41f087);}}; \ No newline at end of file +var _0x1d64=['UserId','length','user-setting:','./user-setting.events','save','update','emit','user-setting:update:user-'];(function(_0x4b02f4,_0x2e20a5){var _0x1ff724=function(_0xd99837){while(--_0xd99837){_0x4b02f4['push'](_0x4b02f4['shift']());}};_0x1ff724(++_0x2e20a5);}(_0x1d64,0x143));var _0x41d6=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0x1d64[_0x2cef86];return _0x46dfd6;};'use strict';var UserSettingEvents=require(_0x41d6('0x0'));var events=[_0x41d6('0x1'),'remove',_0x41d6('0x2')];function createListener(_0x2020b7,_0x62f51d){return function(_0x591966){_0x62f51d[_0x41d6('0x3')](_0x2020b7,_0x591966);if(_0x2020b7==='user-setting:update'){_0x62f51d[_0x41d6('0x3')](_0x41d6('0x4')+_0x591966[_0x41d6('0x5')],_0x591966);}};}exports['register']=function(_0x312cfe){for(var _0x5d2076=0x0,_0x165a61=events[_0x41d6('0x6')];_0x5d2076<_0x165a61;_0x5d2076++){var _0x284863=events[_0x5d2076];var _0x2a27e8=createListener(_0x41d6('0x7')+_0x284863,_0x312cfe);UserSettingEvents['on'](_0x284863,_0x2a27e8);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 20f618a..ac48dcc 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 _0x1e70=['/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','now','originalname','single','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeChatWebsites','removeApiKey','/:id/messengerSoundNotification','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','/whoami','whoami','getPresence','/:id','show','/:id/avatar','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x1e70,0x183));var _0x01e7=function(_0x413e19,_0x88b88f){_0x413e19=_0x413e19-0x0;var _0x4fa6e8=_0x1e70[_0x413e19];return _0x4fa6e8;};'use strict';var multer=require(_0x01e7('0x0'));var util=require(_0x01e7('0x1'));var path=require(_0x01e7('0x2'));var timeout=require(_0x01e7('0x3'));var express=require(_0x01e7('0x4'));var router=express[_0x01e7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x01e7('0x6'));var controller=require('./user.controller');router[_0x01e7('0x7')]('/',auth[_0x01e7('0x8')](),controller[_0x01e7('0x9')]);router[_0x01e7('0x7')](_0x01e7('0xa'),auth[_0x01e7('0x8')](),controller[_0x01e7('0xb')]);router[_0x01e7('0x7')](_0x01e7('0xc'),auth[_0x01e7('0x8')](),controller[_0x01e7('0xd')]);router[_0x01e7('0x7')]('/presence',auth['isAuthenticated'](),controller[_0x01e7('0xe')]);router[_0x01e7('0x7')](_0x01e7('0xf'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x10')]);router[_0x01e7('0x7')](_0x01e7('0x11'),controller['getAvatar']);router[_0x01e7('0x7')]('/:id/open_tabs',auth[_0x01e7('0x8')](),controller[_0x01e7('0x12')]);router['get'](_0x01e7('0x13'),auth[_0x01e7('0x8')](),controller['getContacts']);router[_0x01e7('0x7')](_0x01e7('0x14'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x15')]);router['get'](_0x01e7('0x16'),auth['isAuthenticated'](),controller[_0x01e7('0x17')]);router['get']('/:id/groups',auth['isAuthenticated'](),controller['getGroups']);router[_0x01e7('0x7')](_0x01e7('0x18'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x19')]);router['get'](_0x01e7('0x1a'),auth['isAuthenticated'](),controller[_0x01e7('0x1b')]);router[_0x01e7('0x7')](_0x01e7('0x1c'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x1d')]);router[_0x01e7('0x7')](_0x01e7('0x1e'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0x01e7('0x7')](_0x01e7('0x1f'),auth['isAuthenticated'](),controller[_0x01e7('0x20')]);router[_0x01e7('0x7')](_0x01e7('0x21'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x22')]);router[_0x01e7('0x7')]('/:id/fax/interactions',auth[_0x01e7('0x8')](),controller[_0x01e7('0x23')]);router['get'](_0x01e7('0x24'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x25')]);router['get']('/:id/teams',auth[_0x01e7('0x8')](),controller[_0x01e7('0x26')]);router[_0x01e7('0x7')]('/:id/lists',auth[_0x01e7('0x8')](),controller['getLists']);router[_0x01e7('0x7')](_0x01e7('0x27'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x28')]);router[_0x01e7('0x7')](_0x01e7('0x29'),auth['isAuthenticated'](),controller[_0x01e7('0x2a')]);router[_0x01e7('0x7')]('/:id/fax_accounts',auth[_0x01e7('0x8')](),controller[_0x01e7('0x2b')]);router['get'](_0x01e7('0x2c'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x2d')]);router['get'](_0x01e7('0x2e'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x2f')]);router[_0x01e7('0x7')](_0x01e7('0x30'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0x01e7('0x7')](_0x01e7('0x31'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x32')]);router[_0x01e7('0x7')](_0x01e7('0x33'),auth[_0x01e7('0x8')](),controller['getWhatsappAccounts']);router['get'](_0x01e7('0x34'),auth[_0x01e7('0x8')](),controller['getScheduledCalls']);router[_0x01e7('0x7')](_0x01e7('0x35'),auth['isAuthenticated'](),controller[_0x01e7('0x36')]);router[_0x01e7('0x37')](_0x01e7('0x13'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x38')]);router[_0x01e7('0x37')]('/',auth[_0x01e7('0x8')](),controller['create']);router[_0x01e7('0x37')]('/create_many',auth[_0x01e7('0x8')](),controller[_0x01e7('0x39')]);router[_0x01e7('0x37')](_0x01e7('0x14'),auth['isAuthenticated'](),controller[_0x01e7('0x3a')]);var upload=multer({'storage':multer[_0x01e7('0x3b')]({'destination':function(_0x56f5be,_0x514d3a,_0x5c594b){_0x5c594b(null,path[_0x01e7('0x3c')](config[_0x01e7('0x3d')],_0x01e7('0x3e')));},'filename':function(_0x524a87,_0x14300a,_0x5a3e2b){_0x5a3e2b(null,util['format']('%s-%s',Date[_0x01e7('0x3f')](),_0x14300a[_0x01e7('0x40')]));}})});router['post'](_0x01e7('0x11'),upload[_0x01e7('0x41')](_0x01e7('0x42')),controller['addAvatar']);router[_0x01e7('0x37')](_0x01e7('0x43'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x44')]);router[_0x01e7('0x37')](_0x01e7('0x45'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x46')]);router[_0x01e7('0x37')](_0x01e7('0x47'),auth['isAuthenticated'](),controller[_0x01e7('0x48')]);router[_0x01e7('0x37')](_0x01e7('0x49'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x4a')]);router[_0x01e7('0x37')](_0x01e7('0x4b'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x4c')]);router[_0x01e7('0x37')](_0x01e7('0x4d'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x4e')]);router[_0x01e7('0x37')](_0x01e7('0x4f'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x50')]);router[_0x01e7('0x37')](_0x01e7('0x51'),auth[_0x01e7('0x8')](),controller['addFaxInteractions']);router[_0x01e7('0x37')](_0x01e7('0x52'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x53')]);router[_0x01e7('0x37')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x01e7('0x54')]);router[_0x01e7('0x37')](_0x01e7('0x55'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x56')]);router[_0x01e7('0x37')](_0x01e7('0x57'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x58')]);router[_0x01e7('0x37')]('/:id/mail_accounts',auth[_0x01e7('0x8')](),controller[_0x01e7('0x59')]);router[_0x01e7('0x37')](_0x01e7('0x2e'),auth['isAuthenticated'](),controller[_0x01e7('0x5a')]);router[_0x01e7('0x37')](_0x01e7('0x30'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x5b')]);router[_0x01e7('0x37')](_0x01e7('0x31'),auth[_0x01e7('0x8')](),controller['addChatWebsites']);router['post'](_0x01e7('0x33'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x5c')]);router[_0x01e7('0x37')](_0x01e7('0x35'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x5d')]);router[_0x01e7('0x5e')](_0x01e7('0xf'),auth['isAuthenticated'](),controller[_0x01e7('0x5f')]);router[_0x01e7('0x5e')](_0x01e7('0x60'),auth[_0x01e7('0x8')](),controller['changePassword']);router[_0x01e7('0x61')](_0x01e7('0x14'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x62')]);router[_0x01e7('0x61')](_0x01e7('0x4b'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x63')]);router[_0x01e7('0x61')](_0x01e7('0xf'),auth['isAuthenticated'](),controller[_0x01e7('0x64')]);router[_0x01e7('0x61')](_0x01e7('0x4d'),auth['isAuthenticated'](),controller[_0x01e7('0x65')]);router[_0x01e7('0x61')](_0x01e7('0x4f'),auth[_0x01e7('0x8')](),controller['removeMailInteractions']);router['delete'](_0x01e7('0x51'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0x01e7('0x61')](_0x01e7('0x52'),auth[_0x01e7('0x8')](),controller['removeSmsInteractions']);router['delete'](_0x01e7('0x66'),auth[_0x01e7('0x8')](),controller['removeOpenchannelInteractions']);router[_0x01e7('0x61')](_0x01e7('0x55'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x67')]);router['delete'](_0x01e7('0x57'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x68')]);router[_0x01e7('0x61')]('/:id/mail_accounts',auth['isAuthenticated'](),controller['removeMailAccounts']);router['delete']('/:id/openchannel_accounts',auth[_0x01e7('0x8')](),controller['removeOpenchannelAccounts']);router[_0x01e7('0x61')](_0x01e7('0x30'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router['delete'](_0x01e7('0x31'),auth['isAuthenticated'](),controller[_0x01e7('0x69')]);router[_0x01e7('0x61')]('/:id/whatsapp_accounts',auth[_0x01e7('0x8')](),controller['removeWhatsappAccounts']);router[_0x01e7('0x61')]('/:id/api_key',auth[_0x01e7('0x8')](),controller[_0x01e7('0x6a')]);router[_0x01e7('0x37')](_0x01e7('0x6b'),auth[_0x01e7('0x8')](),controller['messengerSoundNotification']);module[_0x01e7('0x6c')]=router; \ No newline at end of file +var _0x96f2=['getApiKey','addContacts','post','create','bulkCreate','addQueues','diskStorage','join','server/files/images/','format','%s-%s','now','originalname','single','addAvatar','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeTeams','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','/:id/whatsapp_accounts','removeWhatsappAccounts','/:id/api_key','removeApiKey','/:id/messengerSoundNotification','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','/describe','isAuthenticated','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','getScheduledCalls'];(function(_0x173959,_0x1bd48b){var _0x3a80f4=function(_0x3b18c6){while(--_0x3b18c6){_0x173959['push'](_0x173959['shift']());}};_0x3a80f4(++_0x1bd48b);}(_0x96f2,0xb0));var _0x296f=function(_0x3386f5,_0x2c9cf8){_0x3386f5=_0x3386f5-0x0;var _0x1613a0=_0x96f2[_0x3386f5];return _0x1613a0;};'use strict';var multer=require(_0x296f('0x0'));var util=require('util');var path=require(_0x296f('0x1'));var timeout=require(_0x296f('0x2'));var express=require(_0x296f('0x3'));var router=express['Router']();var fs_extra=require(_0x296f('0x4'));var auth=require(_0x296f('0x5'));var interaction=require(_0x296f('0x6'));var config=require('../../config/environment');var controller=require(_0x296f('0x7'));router[_0x296f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x296f('0x8')](_0x296f('0x9'),auth[_0x296f('0xa')](),controller[_0x296f('0xb')]);router[_0x296f('0x8')](_0x296f('0xc'),auth[_0x296f('0xa')](),controller[_0x296f('0xd')]);router[_0x296f('0x8')](_0x296f('0xe'),auth['isAuthenticated'](),controller[_0x296f('0xf')]);router[_0x296f('0x8')](_0x296f('0x10'),auth['isAuthenticated'](),controller[_0x296f('0x11')]);router[_0x296f('0x8')](_0x296f('0x12'),controller[_0x296f('0x13')]);router['get']('/:id/open_tabs',auth['isAuthenticated'](),controller[_0x296f('0x14')]);router[_0x296f('0x8')](_0x296f('0x15'),auth[_0x296f('0xa')](),controller['getContacts']);router[_0x296f('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x296f('0x16')]);router[_0x296f('0x8')](_0x296f('0x17'),auth[_0x296f('0xa')](),controller['getVoiceQueuesRt']);router['get'](_0x296f('0x18'),auth['isAuthenticated'](),controller[_0x296f('0x19')]);router[_0x296f('0x8')](_0x296f('0x1a'),auth['isAuthenticated'](),controller[_0x296f('0x1b')]);router[_0x296f('0x8')]('/:id/screen_recordings',auth[_0x296f('0xa')](),controller[_0x296f('0x1c')]);router[_0x296f('0x8')](_0x296f('0x1d'),auth['isAuthenticated'](),controller[_0x296f('0x1e')]);router[_0x296f('0x8')](_0x296f('0x1f'),auth['isAuthenticated'](),controller[_0x296f('0x20')]);router[_0x296f('0x8')](_0x296f('0x21'),auth['isAuthenticated'](),controller[_0x296f('0x22')]);router[_0x296f('0x8')](_0x296f('0x23'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x296f('0x8')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x296f('0x24')]);router['get']('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0x296f('0x25')]);router[_0x296f('0x8')](_0x296f('0x26'),auth[_0x296f('0xa')](),controller[_0x296f('0x27')]);router[_0x296f('0x8')]('/:id/lists',auth['isAuthenticated'](),controller[_0x296f('0x28')]);router['get'](_0x296f('0x29'),auth[_0x296f('0xa')](),controller[_0x296f('0x2a')]);router[_0x296f('0x8')](_0x296f('0x2b'),auth[_0x296f('0xa')](),controller['getVoicePrefixes']);router[_0x296f('0x8')]('/:id/fax_accounts',auth[_0x296f('0xa')](),controller[_0x296f('0x2c')]);router[_0x296f('0x8')](_0x296f('0x2d'),auth[_0x296f('0xa')](),controller[_0x296f('0x2e')]);router[_0x296f('0x8')](_0x296f('0x2f'),auth[_0x296f('0xa')](),controller[_0x296f('0x30')]);router[_0x296f('0x8')](_0x296f('0x31'),auth[_0x296f('0xa')](),controller['getSmsAccounts']);router[_0x296f('0x8')](_0x296f('0x32'),auth[_0x296f('0xa')](),controller[_0x296f('0x33')]);router['get']('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x296f('0x34')]);router[_0x296f('0x8')]('/:id/scheduled_calls',auth[_0x296f('0xa')](),controller[_0x296f('0x35')]);router['get']('/:id/api_key',auth[_0x296f('0xa')](),controller[_0x296f('0x36')]);router['post'](_0x296f('0x15'),auth[_0x296f('0xa')](),controller[_0x296f('0x37')]);router[_0x296f('0x38')]('/',auth[_0x296f('0xa')](),controller[_0x296f('0x39')]);router['post']('/create_many',auth['isAuthenticated'](),controller[_0x296f('0x3a')]);router['post']('/:id/queues',auth[_0x296f('0xa')](),controller[_0x296f('0x3b')]);var upload=multer({'storage':multer[_0x296f('0x3c')]({'destination':function(_0x10a5c5,_0x29b943,_0x3e381d){_0x3e381d(null,path[_0x296f('0x3d')](config['root'],_0x296f('0x3e')));},'filename':function(_0x12dad2,_0x2ee591,_0x299943){_0x299943(null,util[_0x296f('0x3f')](_0x296f('0x40'),Date[_0x296f('0x41')](),_0x2ee591[_0x296f('0x42')]));}})});router['post'](_0x296f('0x12'),upload[_0x296f('0x43')]('file'),controller[_0x296f('0x44')]);router[_0x296f('0x38')]('/:id/login',auth['isAuthenticated'](),controller[_0x296f('0x45')]);router[_0x296f('0x38')](_0x296f('0x46'),auth[_0x296f('0xa')](),controller[_0x296f('0x47')]);router[_0x296f('0x38')](_0x296f('0x48'),auth[_0x296f('0xa')](),controller[_0x296f('0x49')]);router['post'](_0x296f('0x4a'),auth['isAuthenticated'](),controller[_0x296f('0x4b')]);router[_0x296f('0x38')](_0x296f('0x26'),auth[_0x296f('0xa')](),controller['addTeams']);router[_0x296f('0x38')]('/:id/chat_interactions',auth[_0x296f('0xa')](),controller['addChatInteractions']);router['post']('/:id/mail_interactions',auth[_0x296f('0xa')](),controller[_0x296f('0x4c')]);router[_0x296f('0x38')](_0x296f('0x4d'),auth[_0x296f('0xa')](),controller[_0x296f('0x4e')]);router[_0x296f('0x38')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x296f('0x4f')]);router['post'](_0x296f('0x50'),auth[_0x296f('0xa')](),controller[_0x296f('0x51')]);router[_0x296f('0x38')](_0x296f('0x52'),auth[_0x296f('0xa')](),controller[_0x296f('0x53')]);router[_0x296f('0x38')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x296f('0x54')]);router[_0x296f('0x38')](_0x296f('0x2d'),auth[_0x296f('0xa')](),controller[_0x296f('0x55')]);router[_0x296f('0x38')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x296f('0x56')]);router[_0x296f('0x38')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x296f('0x57')]);router[_0x296f('0x38')]('/:id/chat_websites',auth[_0x296f('0xa')](),controller['addChatWebsites']);router['post']('/:id/whatsapp_accounts',auth[_0x296f('0xa')](),controller[_0x296f('0x58')]);router[_0x296f('0x38')]('/:id/api_key',auth[_0x296f('0xa')](),controller[_0x296f('0x59')]);router[_0x296f('0x5a')]('/:id',auth[_0x296f('0xa')](),controller[_0x296f('0x5b')]);router['put'](_0x296f('0x5c'),auth[_0x296f('0xa')](),controller['changePassword']);router[_0x296f('0x5d')]('/:id/queues',auth['isAuthenticated'](),controller['removeQueues']);router[_0x296f('0x5d')](_0x296f('0x26'),auth['isAuthenticated'](),controller[_0x296f('0x5e')]);router[_0x296f('0x5d')](_0x296f('0x10'),auth[_0x296f('0xa')](),controller['destroy']);router['delete'](_0x296f('0x5f'),auth['isAuthenticated'](),controller[_0x296f('0x60')]);router[_0x296f('0x5d')]('/:id/mail_interactions',auth[_0x296f('0xa')](),controller[_0x296f('0x61')]);router[_0x296f('0x5d')]('/:id/fax_interactions',auth[_0x296f('0xa')](),controller[_0x296f('0x62')]);router[_0x296f('0x5d')](_0x296f('0x63'),auth[_0x296f('0xa')](),controller[_0x296f('0x64')]);router['delete'](_0x296f('0x50'),auth['isAuthenticated'](),controller[_0x296f('0x65')]);router[_0x296f('0x5d')](_0x296f('0x52'),auth[_0x296f('0xa')](),controller[_0x296f('0x66')]);router[_0x296f('0x5d')](_0x296f('0x67'),auth['isAuthenticated'](),controller[_0x296f('0x68')]);router[_0x296f('0x5d')]('/:id/mail_accounts',auth[_0x296f('0xa')](),controller[_0x296f('0x69')]);router['delete'](_0x296f('0x2f'),auth[_0x296f('0xa')](),controller[_0x296f('0x6a')]);router['delete'](_0x296f('0x31'),auth[_0x296f('0xa')](),controller[_0x296f('0x6b')]);router[_0x296f('0x5d')]('/:id/chat_websites',auth[_0x296f('0xa')](),controller[_0x296f('0x6c')]);router['delete'](_0x296f('0x6d'),auth[_0x296f('0xa')](),controller[_0x296f('0x6e')]);router[_0x296f('0x5d')](_0x296f('0x6f'),auth[_0x296f('0xa')](),controller[_0x296f('0x70')]);router[_0x296f('0x38')](_0x296f('0x71'),auth[_0x296f('0xa')](),controller['messengerSoundNotification']);module[_0x296f('0x72')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 4d7dd8c..3a75356 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 _0x8602=['The\x20name\x20of\x20the\x20user','fullname','format','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','DATE','BOOLEAN','DEFAULT\x20PAUSE','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','split','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','accept','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','get','encryption','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','icesupport','/etc/pki/tls/certs/motion.crt','permissions','phoneBarEnableScreenRecordingByAgent','string','screenrecording','blocked','blockedAt','loginAttempts','moment','lodash','exports','STRING','name','setDataValue'];(function(_0x1a7697,_0x469f4e){var _0x4d2dc8=function(_0x1f6849){while(--_0x1f6849){_0x1a7697['push'](_0x1a7697['shift']());}};_0x4d2dc8(++_0x469f4e);}(_0x8602,0x1a8));var _0x2860=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x8602[_0x585d81];return _0x1aca0d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2860('0x0'));var util=require('util');var _=require(_0x2860('0x1'));module[_0x2860('0x2')]={'name':{'type':Sequelize[_0x2860('0x3')],'allowNull':![],'unique':_0x2860('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x53e95a){this[_0x2860('0x5')](_0x2860('0x4'),_0x53e95a);this[_0x2860('0x5')]('defaultuser',_0x53e95a);},'comment':_0x2860('0x6')},'fullname':{'type':Sequelize[_0x2860('0x3')],'allowNull':![],'set':function(_0x14fad0){this[_0x2860('0x5')](_0x2860('0x7'),_0x14fad0);this[_0x2860('0x5')]('callerid',util[_0x2860('0x8')]('\x22%s\x22\x20<%s>',_0x14fad0,this['getDataValue'](_0x2860('0x9'))));}},'alias':{'type':Sequelize[_0x2860('0x3')]},'email':{'type':Sequelize[_0x2860('0x3')],'allowNull':![],'unique':_0x2860('0xa'),'validate':{'isEmail':!![]},'set':function(_0x122c8d){if(_0x122c8d){this[_0x2860('0x5')](_0x2860('0xa'),_0x122c8d[_0x2860('0xb')]());}}},'role':{'type':Sequelize[_0x2860('0xc')](_0x2860('0xd'),_0x2860('0xe'),_0x2860('0xf'),_0x2860('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x2860('0x11')},'internal':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':![],'unique':_0x2860('0x9'),'set':function(_0x3487a6){this[_0x2860('0x5')](_0x2860('0x9'),_0x3487a6);this[_0x2860('0x5')](_0x2860('0x13'),_0x3487a6);this[_0x2860('0x5')]('callerid',util[_0x2860('0x8')](_0x2860('0x14'),this[_0x2860('0x15')]('fullname'),_0x3487a6));}},'salt':{'type':Sequelize[_0x2860('0x3')]},'phone':{'type':Sequelize[_0x2860('0x3')]},'mobile':{'type':Sequelize[_0x2860('0x3')]},'address':{'type':Sequelize[_0x2860('0x3')]},'zipcode':{'type':Sequelize[_0x2860('0x3')]},'userpic':{'type':Sequelize[_0x2860('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x2860('0x16')]},'voicePause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x2860('0x3')],'defaultValue':_0x2860('0x18')},'lastPauseAt':{'type':Sequelize[_0x2860('0x16')]},'chatCapacity':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x2860('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x2860('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x2860('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x19'),_0x2860('0xe'),_0x2860('0x1a')),'allowNull':!![],'defaultValue':_0x2860('0x19')},'context':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![],'defaultValue':_0x2860('0x1b')},'callingpres':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x1c'),_0x2860('0x1d'),_0x2860('0x1e'),_0x2860('0x1f'),_0x2860('0x20'),_0x2860('0x21'),_0x2860('0x22'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![],'defaultValue':_0x2860('0x23'),'set':function(_0x132f86){this[_0x2860('0x5')]('transport',_0x132f86?_0x132f86[_0x2860('0x24')](','):null);},'get':function(){return this['getDataValue'](_0x2860('0x25'))?this[_0x2860('0x15')]('transport')['split'](','):null;},'comment':_0x2860('0x26')},'dtmfmode':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x27'),_0x2860('0x28'),_0x2860('0x29'),'inband','auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no',_0x2860('0x2b'),_0x2860('0x2c'),_0x2860('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![],'defaultValue':_0x2860('0x2e'),'set':function(_0x1eaa30){this[_0x2860('0x5')](_0x2860('0x2f'),_0x1eaa30?_0x1eaa30['join'](','):null);},'get':function(){return this[_0x2860('0x15')]('nat')?this[_0x2860('0x15')]('nat')['split'](','):null;},'comment':_0x2860('0x30')},'callgroup':{'type':Sequelize[_0x2860('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x2860('0x3')]},'language':{'type':Sequelize[_0x2860('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2860('0x3')]},'disallow':{'type':Sequelize[_0x2860('0x3')],'allowNull':![],'defaultValue':_0x2860('0x31')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x21a98e){this['setDataValue'](_0x2860('0x32'),_0x21a98e?_0x21a98e[_0x2860('0x24')](';'):_0x2860('0x33'));},'get':function(){return this['getDataValue'](_0x2860('0x32'))?this['getDataValue']('allow')[_0x2860('0x34')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x2860('0xc')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![],'set':function(_0x2cfe8c){this[_0x2860('0x5')](_0x2860('0x35'),_0x2cfe8c?_0x2cfe8c['join'](','):null);},'get':function(){return this[_0x2860('0x15')](_0x2860('0x35'))?this['getDataValue']('insecure')[_0x2860('0x34')](','):null;},'comment':_0x2860('0x36')},'trustrpid':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no',_0x2860('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x2860('0xc')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x2860('0x38'),'refuse',_0x2860('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x2860('0x3a'),_0x2860('0x3b')),'allowNull':!![],'defaultValue':_0x2860('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x2860('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no',_0x2860('0x3c'),_0x2860('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x3e'),_0x2860('0x3f'),_0x2860('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no',_0x2860('0x2b'),_0x2860('0x2c'),_0x2860('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x2860('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x2860('0x42')]},'showWebBar':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0,'set':function(_0x2b03fc){this[_0x2860('0x5')]('showWebBar',_0x2b03fc);var _0x3a510c=this[_0x2860('0x43')]({'plain':!![]});switch(_0x2b03fc){case 0x0:case 0x1:var _0x1da545=_0x3a510c[_0x2860('0x25')]?_['isArray'](_0x3a510c[_0x2860('0x25')])?_0x3a510c[_0x2860('0x25')]['join']():_0x3a510c['transport']:_0x2860('0x23');if(_0x1da545==='wss'){_0x1da545='udp';}this[_0x2860('0x5')]('transport',_0x1da545);this[_0x2860('0x5')](_0x2860('0x44'),'no');this[_0x2860('0x5')]('avpf',null);this[_0x2860('0x5')](_0x2860('0x45'),null);this['setDataValue']('icesupport',null);this[_0x2860('0x5')](_0x2860('0x46'),null);this['setDataValue'](_0x2860('0x47'),null);this[_0x2860('0x5')](_0x2860('0x48'),null);this['setDataValue'](_0x2860('0x49'),null);this[_0x2860('0x5')](_0x2860('0x4a'),null);this['setDataValue'](_0x2860('0x4b'),'no');break;case 0x2:this[_0x2860('0x5')]('transport',_0x2860('0x4c'));this[_0x2860('0x5')](_0x2860('0x44'),_0x2860('0x2a'));this[_0x2860('0x5')]('avpf',_0x2860('0x2a'));this[_0x2860('0x5')](_0x2860('0x45'),_0x2860('0x2a'));this[_0x2860('0x5')](_0x2860('0x4d'),'yes');this[_0x2860('0x5')](_0x2860('0x46'),_0x2860('0x2a'));this[_0x2860('0x5')](_0x2860('0x47'),'no');this[_0x2860('0x5')](_0x2860('0x48'),_0x2860('0x40'));this['setDataValue'](_0x2860('0x49'),_0x3a510c[_0x2860('0x49')]||_0x2860('0x4e'));this[_0x2860('0x5')](_0x2860('0x4a'),_0x3a510c[_0x2860('0x4a')]||'/etc/pki/tls/private/motion.key');this[_0x2860('0x5')]('rtcp_mux',_0x2860('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x2860('0x42')],'set':function(_0x3ff830){this[_0x2860('0x5')](_0x2860('0x4f'),_0x3ff830?_0x3ff830[_0x2860('0x24')](','):[]);},'get':function(){return this[_0x2860('0x15')](_0x2860('0x4f'))?_['map'](this[_0x2860('0x15')]('permissions')['split'](','),function(_0xa68e07){return parseInt(_0xa68e07,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x2860('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x2860('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x2860('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x2860('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x2860('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x2860('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x2860('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x2860('0x15')](_0x2860('0x50'))?this[_0x2860('0x15')](_0x2860('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x2860('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![],'set':function(_0x532547){if(typeof _0x532547===_0x2860('0x51')){var _0x31432d=_0x532547==='1'?!![]:_0x532547==='0'?![]:_0x532547==='true'?!![]:_0x532547==='false'?![]:![];this[_0x2860('0x5')](_0x2860('0x52'),_0x31432d);}else{this['setDataValue'](_0x2860('0x52'),_0x532547);}}},'blocked':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![],'set':function(_0x3b7d5b){this[_0x2860('0x5')](_0x2860('0x53'),_0x3b7d5b);if(_0x3b7d5b===!![]){this[_0x2860('0x5')](_0x2860('0x54'),moment());this[_0x2860('0x5')](_0x2860('0x55'),0x0);}else{this[_0x2860('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x2860('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x2860('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x2860('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2860('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]}}; \ No newline at end of file +var _0x2581=['telephone','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','dynamic','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint','certificate','active','passive','update,nonat','showWebBar','get','isArray','wss','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','lodash','exports','STRING','setDataValue','fullname','callerid','format','getDataValue','internal','email','toLowerCase','ENUM'];(function(_0x16c4d6,_0x32836b){var _0x5d377a=function(_0x12daf3){while(--_0x12daf3){_0x16c4d6['push'](_0x16c4d6['shift']());}};_0x5d377a(++_0x32836b);}(_0x2581,0x163));var _0x1258=function(_0x3443d3,_0xf1bb82){_0x3443d3=_0x3443d3-0x0;var _0x3de675=_0x2581[_0x3443d3];return _0x3de675;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1258('0x0'));var util=require('util');var _=require(_0x1258('0x1'));module[_0x1258('0x2')]={'name':{'type':Sequelize[_0x1258('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2422a8){this[_0x1258('0x4')]('name',_0x2422a8);this[_0x1258('0x4')]('defaultuser',_0x2422a8);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1258('0x3')],'allowNull':![],'set':function(_0x501eb4){this['setDataValue'](_0x1258('0x5'),_0x501eb4);this[_0x1258('0x4')](_0x1258('0x6'),util[_0x1258('0x7')]('\x22%s\x22\x20<%s>',_0x501eb4,this[_0x1258('0x8')](_0x1258('0x9'))));}},'alias':{'type':Sequelize[_0x1258('0x3')]},'email':{'type':Sequelize[_0x1258('0x3')],'allowNull':![],'unique':_0x1258('0xa'),'validate':{'isEmail':!![]},'set':function(_0xcdf417){if(_0xcdf417){this[_0x1258('0x4')](_0x1258('0xa'),_0xcdf417[_0x1258('0xb')]());}}},'role':{'type':Sequelize[_0x1258('0xc')]('admin','user','agent',_0x1258('0xd')),'allowNull':![]},'password':{'type':Sequelize[_0x1258('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x1258('0xe')},'internal':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':![],'unique':_0x1258('0x9'),'set':function(_0xf1df20){this['setDataValue'](_0x1258('0x9'),_0xf1df20);this[_0x1258('0x4')](_0x1258('0x10'),_0xf1df20);this[_0x1258('0x4')](_0x1258('0x6'),util[_0x1258('0x7')](_0x1258('0x11'),this['getDataValue'](_0x1258('0x5')),_0xf1df20));}},'salt':{'type':Sequelize[_0x1258('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x1258('0x3')]},'address':{'type':Sequelize[_0x1258('0x3')]},'zipcode':{'type':Sequelize[_0x1258('0x3')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1258('0x3')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1258('0x13')]},'voicePause':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1258('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x1258('0x13')]},'chatCapacity':{'type':Sequelize[_0x1258('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1258('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1258('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1258('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x1258('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x1258('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1258('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1258('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![],'defaultValue':_0x1258('0x14')},'ipaddr':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x1258('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1258('0xc')]('friend','user','peer'),'allowNull':!![],'defaultValue':_0x1258('0x15')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x16'),_0x1258('0x17'),_0x1258('0x18'),_0x1258('0x19'),_0x1258('0x1a'),_0x1258('0x1b'),_0x1258('0x1c'),_0x1258('0x1d')),'allowNull':!![]},'deny':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![],'defaultValue':_0x1258('0x1e'),'set':function(_0xd37d17){this[_0x1258('0x4')](_0x1258('0x1f'),_0xd37d17?_0xd37d17[_0x1258('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x1258('0x1f'))?this[_0x1258('0x8')](_0x1258('0x1f'))[_0x1258('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x1258('0xc')]('rfc2833',_0x1258('0x22'),_0x1258('0x23'),_0x1258('0x24'),_0x1258('0x25')),'allowNull':!![],'defaultValue':_0x1258('0x26')},'directmedia':{'type':Sequelize['ENUM'](_0x1258('0x27'),'no',_0x1258('0x28'),_0x1258('0x29'),_0x1258('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x1258('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1258('0x2b'),'set':function(_0xbc6c69){this[_0x1258('0x4')](_0x1258('0x2c'),_0xbc6c69?_0xbc6c69[_0x1258('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x1258('0x2c'))?this[_0x1258('0x8')](_0x1258('0x2c'))['split'](','):null;},'comment':_0x1258('0x2d')},'callgroup':{'type':Sequelize[_0x1258('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x1258('0x3')]},'language':{'type':Sequelize[_0x1258('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1258('0x3')]},'disallow':{'type':Sequelize[_0x1258('0x3')],'allowNull':![],'defaultValue':_0x1258('0x2e')},'allow':{'type':Sequelize[_0x1258('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x242604){this[_0x1258('0x4')]('allow',_0x242604?_0x242604[_0x1258('0x20')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x1258('0x8')]('allow')?this[_0x1258('0x8')](_0x1258('0x2f'))[_0x1258('0x21')](';'):null;},'comment':_0x1258('0x30')},'autoframing':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x1c98ec){this[_0x1258('0x4')]('insecure',_0x1c98ec?_0x1c98ec[_0x1258('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x1258('0x31'))?this[_0x1258('0x8')](_0x1258('0x31'))['split'](','):null;},'comment':_0x1258('0x32')},'trustrpid':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1258('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no',_0x1258('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x1258('0x27'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![],'defaultValue':_0x1258('0x34')},'amaflags':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![],'defaultValue':_0x1258('0x27')},'busylevel':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1258('0xc')]('yes','no',_0x1258('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1258('0xc')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x1258('0xc')]('accept',_0x1258('0x36'),_0x1258('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x38'),_0x1258('0x39')),'allowNull':!![],'defaultValue':_0x1258('0x39')},'t38pt_usertpsource':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x1258('0x27'),'no'),'allowNull':!![],'defaultValue':_0x1258('0x27')},'keepalive':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1258('0xc')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x1258('0x27'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no',_0x1258('0x3a'),_0x1258('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x3c'),_0x1258('0x3d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1258('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1258('0xc')]('yes','no',_0x1258('0x28'),_0x1258('0x29'),_0x1258('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1258('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1258('0x13')]},'passwordResetAt':{'type':Sequelize[_0x1258('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x1258('0xf')],'defaultValue':0x0,'set':function(_0x43bc9b){this[_0x1258('0x4')](_0x1258('0x3f'),_0x43bc9b);var _0xd62adf=this[_0x1258('0x40')]({'plain':!![]});switch(_0x43bc9b){case 0x0:case 0x1:var _0x588e96=_0xd62adf[_0x1258('0x1f')]?_[_0x1258('0x41')](_0xd62adf[_0x1258('0x1f')])?_0xd62adf['transport'][_0x1258('0x20')]():_0xd62adf[_0x1258('0x1f')]:_0x1258('0x1e');if(_0x588e96===_0x1258('0x42')){_0x588e96='udp';}this[_0x1258('0x4')](_0x1258('0x1f'),_0x588e96);this[_0x1258('0x4')]('encryption','no');this['setDataValue'](_0x1258('0x43'),null);this[_0x1258('0x4')](_0x1258('0x44'),null);this[_0x1258('0x4')](_0x1258('0x45'),null);this['setDataValue'](_0x1258('0x46'),null);this['setDataValue'](_0x1258('0x47'),null);this[_0x1258('0x4')]('dtlssetup',null);this[_0x1258('0x4')](_0x1258('0x48'),null);this[_0x1258('0x4')](_0x1258('0x49'),null);this['setDataValue'](_0x1258('0x4a'),'no');break;case 0x2:this[_0x1258('0x4')](_0x1258('0x1f'),_0x1258('0x42'));this[_0x1258('0x4')](_0x1258('0x4b'),'yes');this[_0x1258('0x4')](_0x1258('0x43'),'yes');this['setDataValue']('force_avp',_0x1258('0x27'));this[_0x1258('0x4')](_0x1258('0x45'),_0x1258('0x27'));this[_0x1258('0x4')](_0x1258('0x46'),_0x1258('0x27'));this[_0x1258('0x4')](_0x1258('0x47'),'no');this['setDataValue'](_0x1258('0x4c'),_0x1258('0x4d'));this['setDataValue'](_0x1258('0x48'),_0xd62adf[_0x1258('0x48')]||_0x1258('0x4e'));this['setDataValue'](_0x1258('0x49'),_0xd62adf['dtlsprivatekey']||_0x1258('0x4f'));this[_0x1258('0x4')](_0x1258('0x4a'),_0x1258('0x27'));break;default:}}},'permissions':{'type':Sequelize[_0x1258('0x50')],'set':function(_0x44cbde){this[_0x1258('0x4')](_0x1258('0x51'),_0x44cbde?_0x44cbde['join'](','):[]);},'get':function(){return this[_0x1258('0x8')](_0x1258('0x51'))?_[_0x1258('0x52')](this['getDataValue']('permissions')['split'](','),function(_0x4e5ed3){return parseInt(_0x4e5ed3,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1258('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1258('0x3')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1258('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1258('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1258('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x1258('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1258('0xc')](_0x1258('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x1258('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1258('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0x1258('0x8')](_0x1258('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x1258('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1258('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![],'set':function(_0x41c2e9){if(typeof _0x41c2e9===_0x1258('0x54')){var _0x2af599=_0x41c2e9==='1'?!![]:_0x41c2e9==='0'?![]:_0x41c2e9===_0x1258('0x55')?!![]:_0x41c2e9===_0x1258('0x56')?![]:![];this['setDataValue']('screenrecording',_0x2af599);}else{this['setDataValue'](_0x1258('0x57'),_0x41c2e9);}}},'blocked':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![],'set':function(_0xf685a9){this[_0x1258('0x4')](_0x1258('0x58'),_0xf685a9);if(_0xf685a9===!![]){this[_0x1258('0x4')](_0x1258('0x59'),moment());this[_0x1258('0x4')](_0x1258('0x5a'),0x0);}else{this[_0x1258('0x4')](_0x1258('0x59'),null);}}},'blockedAt':{'type':Sequelize[_0x1258('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x1258('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x1258('0x12')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1258('0xf')](0x5)[_0x1258('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1258('0x12')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1258('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x1258('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1258('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x1258('0xf')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x1258('0x12')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 9b84960..9634eae 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 _0x893d=['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','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','firstName','lastName','CmContact','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','removeApiKey','apiKeyIat','whoami','getUserSetting','getPresence','idle','unknown','ringing','teams','inbound','flatten','toString','desc','asc','substring','uniqBy','orderBy','getRealtimeAgents','voiceStatus','unavailable','slice','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','moment','util','path','lodash','squel','ioredis','../../components/auth/service','../../components/contacts','../../components/parsers/qs','../../components/realtime/agents','../../config/logger','api','../../config/utils','APIBadRequestError','APINotFoundError','../../errors/api','../../mysqldb','./user.socket','register','redis','defaults','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','agent','emit','userNotification:recalc:','destroy','get','admin','user','filter','ignore','map','value','includes','find','role','name','stack','send','User','rawAttributes','fieldName','key','password','salt','previousPasswords','resetPasswordToken','md5secret','index','query','include','true','UserSetting','userSetting','attributes','push','findAll','openTabs','rows','chat','sms','dataValues','fax','mail','whatsapp','all','catch','show','params','getOptions','includeAll','merge','options','openchannel','body','describe','addContacts','omit','internal','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','QueryTypes','SELECT','length','from','voicemail','mailbox','VoiceMail','email','permissions','101','103','110','104','106','107','108','109','100','114','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Agents','Telephones','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','telephone','isEmpty','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','updatePasswordsHistory','channel','loginInPause','voicePause','interface','isValidChannel','capitalize','toLowerCase','penalty','spread','ids','QueueId','voice','VoiceQueue','online','format','upsert','removeQueues','remove','Queues','isArray','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','concat','getContacts','findOne','hasOwnProperty','CmList','List','color','tag','Unknown\x20channel','model','keys','Queue','filters','intersection','fields','order','sort','where','pick','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','pause','SIP/%s','type','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','transaction','flattenDeep','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','removeAgent','getDataValue','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions'];(function(_0x3c6125,_0x3b2a9c){var _0x2f47b8=function(_0x214650){while(--_0x214650){_0x3c6125['push'](_0x3c6125['shift']());}};_0x2f47b8(++_0x3b2a9c);}(_0x893d,0x67));var _0xd893=function(_0x22aa69,_0x469edf){_0x22aa69=_0x22aa69-0x0;var _0x54adc7=_0x893d[_0x22aa69];return _0x54adc7;};'use strict';var moment=require(_0xd893('0x0'));var util=require(_0xd893('0x1'));var path=require(_0xd893('0x2'));var fs=require('fs');var _=require(_0xd893('0x3'));var squel=require(_0xd893('0x4'));var Redis=require(_0xd893('0x5'));var authService=require(_0xd893('0x6'));var contacts=require(_0xd893('0x7'));var qs=require(_0xd893('0x8'));var rta=require(_0xd893('0x9'));var logger=require(_0xd893('0xa'))(_0xd893('0xb'));var utils=require(_0xd893('0xc'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var APIBadRequestError=require('../../errors/api')[_0xd893('0xd')];var APINotFoundError=require('../../errors/api')[_0xd893('0xe')];var APIHandleError=require(_0xd893('0xf'))['handleError'];var db=require(_0xd893('0x10'))['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd893('0x11'))[_0xd893('0x12')](socket);config[_0xd893('0x13')]=_[_0xd893('0x14')](config[_0xd893('0x13')],{'host':'localhost','port':0x18eb});var values;function respondWithStatusCode(_0x27f2ea,_0x3c1185){_0x3c1185=_0x3c1185||0xcc;return function(_0x5107a1){if(_0x5107a1){return _0x27f2ea[_0xd893('0x15')](_0x3c1185);}return _0x27f2ea['status'](_0x3c1185)[_0xd893('0x16')]();};}function respondWithResult(_0x23c40f,_0x25b8dd){_0x25b8dd=_0x25b8dd||0xc8;return function(_0x252ca7){if(_0x252ca7){return _0x23c40f[_0xd893('0x17')](_0x25b8dd)[_0xd893('0x18')](_0x252ca7);}};}function respondWithFilteredResult(_0x218c45,_0x544d4a){return function(_0x53d270){if(_0x53d270){var _0x49472f=typeof _0x544d4a[_0xd893('0x19')]===_0xd893('0x1a')&&typeof _0x544d4a['limit']===_0xd893('0x1a');var _0x1079e9=_0x53d270[_0xd893('0x1b')];var _0x42458a=_0x49472f?0x0:_0x544d4a[_0xd893('0x19')];var _0xd2f312=_0x49472f?_0x53d270[_0xd893('0x1b')]:_0x544d4a[_0xd893('0x19')]+_0x544d4a[_0xd893('0x1c')];var _0x1a52af;if(_0xd2f312>=_0x1079e9){_0xd2f312=_0x1079e9;_0x1a52af=0xc8;}else{_0x1a52af=0xce;}_0x218c45['status'](_0x1a52af);return _0x218c45[_0xd893('0x1d')](_0xd893('0x1e'),_0x42458a+'-'+_0xd2f312+'/'+_0x1079e9)[_0xd893('0x18')](_0x53d270);}return null;};}function saveUpdates(_0x203e13){return function(_0x5f1c03){if(_0x5f1c03){return _0x5f1c03[_0xd893('0x1f')](_0x203e13)[_0xd893('0x20')](function(_0x556579){if(_0x556579['role']===_0xd893('0x21')){socket[_0xd893('0x22')](_0xd893('0x23')+_0x556579['id'],_0x556579);}return _0x556579;});}return null;};}function removeEntity(_0x1c6df9){return function(_0x5b81f8){if(_0x5b81f8){return _0x5b81f8[_0xd893('0x24')]()[_0xd893('0x20')](function(){var _0x5dc36e=_0x5b81f8[_0xd893('0x25')]({'plain':!![]});if(_0x5dc36e['role']===_0xd893('0x26'))return;var _0x45295a=[{'name':'Users','value':_0xd893('0x27'),'ignore':!![]},{'name':'Agents','value':_0xd893('0x21'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x61e883=_(_0x45295a)[_0xd893('0x28')](_0xd893('0x29'))[_0xd893('0x2a')](_0xd893('0x2b'))['value']();if(_[_0xd893('0x2c')](_0x61e883,_0x5dc36e['role'])){return;}var _0x271368=_[_0xd893('0x2d')](_0x45295a,['value',_0x5dc36e[_0xd893('0x2e')]])[_0xd893('0x2f')];return db['UserProfileResource'][_0xd893('0x24')]({'where':{'type':_0x271368,'resourceId':_0x5dc36e['id']}})['then'](function(){return _0x5b81f8;});})[_0xd893('0x20')](function(){_0x1c6df9[_0xd893('0x17')](0xcc)[_0xd893('0x16')]();});}};}function handleEntityNotFound(_0x56997c){return function(_0x229d58){if(!_0x229d58){_0x56997c[_0xd893('0x15')](0x194);}return _0x229d58;};}function handleError(_0x5be3a5,_0x2c18d4){_0x2c18d4=_0x2c18d4||0x1f4;return function(_0xb8bd4a){logger['error'](_0xb8bd4a[_0xd893('0x30')]);if(_0xb8bd4a[_0xd893('0x2f')]){delete _0xb8bd4a[_0xd893('0x2f')];}_0x5be3a5[_0xd893('0x17')](_0x2c18d4)[_0xd893('0x31')](_0xb8bd4a);};}function getUserAttributes(){return _(db[_0xd893('0x32')][_0xd893('0x33')])[_0xd893('0x2a')](function(_0xa42dc3){return{'name':_0xa42dc3[_0xd893('0x34')],'type':_0xa42dc3['type'][_0xd893('0x35')]};})[_0xd893('0x28')](function(_0x56eeb1){return![_0xd893('0x36'),_0xd893('0x37'),_0xd893('0x38'),_0xd893('0x39'),'resetPasswordExpires',_0xd893('0x3a')][_0xd893('0x2c')](_0x56eeb1[_0xd893('0x2f')]);})[_0xd893('0x2b')]();}exports[_0xd893('0x3b')]=function(_0x420fce,_0x140a76){var _0x51a90e={},_0x28be51={'count':0x0,'rows':[]};var _0x5000cb=getUserAttributes();_0x51a90e=qs['getOptions'](_0x5000cb,_0x420fce);var _0x577955={'where':_0x51a90e['where']};return db[_0xd893('0x32')][_0xd893('0x1b')](_0x577955)[_0xd893('0x20')](function(_0x2f79ce){_0x28be51[_0xd893('0x1b')]=_0x2f79ce;if(_0x420fce[_0xd893('0x3c')]['includeAll']){_0x51a90e[_0xd893('0x3d')]=[{'all':!![]}];}if(_0x420fce['query']['userSetting']===_0xd893('0x3e')){_0x51a90e[_0xd893('0x3d')]=[{'model':db[_0xd893('0x3f')],'as':_0xd893('0x40')}];}if(!_['includes'](_0x51a90e[_0xd893('0x41')],'id')){_0x51a90e['attributes'][_0xd893('0x42')]('id');}return db[_0xd893('0x32')][_0xd893('0x43')](_0x51a90e);})[_0xd893('0x20')](function(_0x41ea64){_0x28be51['rows']=_0x41ea64;if(_0x420fce[_0xd893('0x3c')][_0xd893('0x44')]===_0xd893('0x3e')){var _0x5a9e1c=[];for(var _0x410093=0x0;_0x410093<_0x28be51[_0xd893('0x45')]['length'];_0x410093++){_0x5a9e1c['push'](get_open_tabs(_0xd893('0x46'),_0x28be51[_0xd893('0x45')][_0x410093]['dataValues']));_0x5a9e1c['push'](get_open_tabs(_0xd893('0x47'),_0x28be51[_0xd893('0x45')][_0x410093][_0xd893('0x48')]));_0x5a9e1c[_0xd893('0x42')](get_open_tabs(_0xd893('0x49'),_0x28be51[_0xd893('0x45')][_0x410093][_0xd893('0x48')]));_0x5a9e1c[_0xd893('0x42')](get_open_tabs(_0xd893('0x4a'),_0x28be51[_0xd893('0x45')][_0x410093]['dataValues']));_0x5a9e1c['push'](get_open_tabs('openchannel',_0x28be51['rows'][_0x410093][_0xd893('0x48')]));_0x5a9e1c['push'](get_open_tabs(_0xd893('0x4b'),_0x28be51[_0xd893('0x45')][_0x410093][_0xd893('0x48')]));}return Promise[_0xd893('0x4c')](_0x5a9e1c)[_0xd893('0x20')](function(){return _0x28be51;});}else{return _0x28be51;}})['then'](respondWithFilteredResult(_0x140a76,_0x51a90e))[_0xd893('0x4d')](handleError(_0x140a76,null));};exports[_0xd893('0x4e')]=function(_0x5c7c12,_0xf782e8){var _0x1562c6=getUserAttributes();_0x5c7c12[_0xd893('0x3c')]['id']=_0x5c7c12[_0xd893('0x4f')]['id'];var _0x227847=qs[_0xd893('0x50')](_0x1562c6,_0x5c7c12);if(_0x5c7c12[_0xd893('0x3c')][_0xd893('0x51')]){_0x227847[_0xd893('0x3d')]=[{'all':!![]}];}if(_0x5c7c12[_0xd893('0x3c')][_0xd893('0x40')]===_0xd893('0x3e')){_0x227847[_0xd893('0x3d')]=[{'model':db[_0xd893('0x3f')],'as':_0xd893('0x40')}];}_0x227847=_[_0xd893('0x52')]({},_0x227847,_0x5c7c12[_0xd893('0x53')]);if(!_[_0xd893('0x2c')](_0x227847[_0xd893('0x41')],'id')){_0x227847[_0xd893('0x41')][_0xd893('0x42')]('id');}return db[_0xd893('0x32')]['find'](_0x227847)['then'](handleEntityNotFound(_0xf782e8,null))[_0xd893('0x20')](function(_0x123450){var _0x27a827=[];values=_0x123450;if(_0x5c7c12[_0xd893('0x3c')][_0xd893('0x44')]===_0xd893('0x3e')){_0x27a827[_0xd893('0x42')](get_open_tabs('chat',_0x123450[_0xd893('0x48')]));_0x27a827[_0xd893('0x42')](get_open_tabs(_0xd893('0x47'),_0x123450[_0xd893('0x48')]));_0x27a827[_0xd893('0x42')](get_open_tabs(_0xd893('0x54'),_0x123450['dataValues']));_0x27a827[_0xd893('0x42')](get_open_tabs(_0xd893('0x4b'),_0x123450[_0xd893('0x48')]));_0x27a827[_0xd893('0x42')](get_open_tabs(_0xd893('0x49'),_0x123450[_0xd893('0x48')]));_0x27a827[_0xd893('0x42')](get_open_tabs(_0xd893('0x4a'),_0x123450[_0xd893('0x48')]));return Promise[_0xd893('0x4c')](_0x27a827);}else{return values;}})[_0xd893('0x20')](function(){return values;})[_0xd893('0x20')](respondWithResult(_0xf782e8,null))['catch'](handleError(_0xf782e8,null));};exports[_0xd893('0x1f')]=function(_0x5bee59,_0x15e9ab){if(_0x5bee59[_0xd893('0x55')]['id']){delete _0x5bee59[_0xd893('0x55')]['id'];}delete _0x5bee59[_0xd893('0x55')]['role'];return db['User'][_0xd893('0x2d')]({'where':{'id':_0x5bee59[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x15e9ab,null))[_0xd893('0x20')](saveUpdates(_0x5bee59[_0xd893('0x55')],null))[_0xd893('0x20')](respondWithResult(_0x15e9ab,null))['catch'](handleError(_0x15e9ab,null));};exports[_0xd893('0x56')]=function(_0x4dfe19,_0xa8213a){return db[_0xd893('0x32')][_0xd893('0x56')]()[_0xd893('0x20')](respondWithResult(_0xa8213a,null))[_0xd893('0x4d')](handleError(_0xa8213a,null));};exports[_0xd893('0x57')]=function(_0x1b7f32,_0x519ca5){return db['User'][_0xd893('0x2d')]({'where':{'id':_0x1b7f32['params']['id']}})['then'](handleEntityNotFound(_0x519ca5,null))[_0xd893('0x20')](function(_0x541e6e){if(_0x541e6e){return _0x541e6e[_0xd893('0x57')](_0x1b7f32[_0xd893('0x55')]['ids'],_[_0xd893('0x58')](_0x1b7f32[_0xd893('0x55')],['ids','id'])||{});}})[_0xd893('0x20')](respondWithResult(_0x519ca5,null))['catch'](handleError(_0x519ca5,null));};function validateUser(_0x184741){return new Promise(function(_0x159655,_0x12ef53){if(_0x184741[_0xd893('0x59')])return _0x159655(_0x184741);return db['Setting'][_0xd893('0x5a')](0x1)[_0xd893('0x20')](function(_0x59d3f9){if(_0x59d3f9[_0xd893('0x5b')])authService[_0xd893('0x5c')](_0x184741[_0xd893('0x36')]);db[_0xd893('0x32')][_0xd893('0x5d')](_0xd893('0x59'))[_0xd893('0x20')](function(_0x338e5e){if(_[_0xd893('0x5e')](_0x338e5e)){_0x184741[_0xd893('0x59')]=_0x59d3f9[_0xd893('0x5f')]||0x1;return;}if(_[_0xd893('0x5e')](_0x59d3f9[_0xd893('0x5f')])||_0x59d3f9['min_internal']===_0x338e5e){_0x184741[_0xd893('0x59')]=_0x338e5e+0x1;return;}if(_0x59d3f9[_0xd893('0x5f')]>_0x338e5e){_0x184741[_0xd893('0x59')]=_0x59d3f9[_0xd893('0x5f')];return;}return db[_0xd893('0x60')][_0xd893('0x3c')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xd893('0x60')][_0xd893('0x61')][_0xd893('0x62')]})['then'](function(_0x2c81c1){if(_0x2c81c1&&_0x2c81c1[_0xd893('0x63')]){for(var _0x3adfd5=0x0,_0x11f036=_0x2c81c1[_0xd893('0x63')];_0x3adfd5<_0x11f036&&_[_0xd893('0x5e')](_0x184741['internal']);_0x3adfd5++){if(_0x59d3f9[_0xd893('0x5f')]<=_0x2c81c1[_0x3adfd5][_0xd893('0x64')]){_0x184741[_0xd893('0x59')]=_0x2c81c1[_0x3adfd5]['from'];}else if(_0x59d3f9['min_internal']>_0x2c81c1[_0x3adfd5]['from']&&_0x59d3f9[_0xd893('0x5f')]<=_0x2c81c1[_0x3adfd5]['to']){_0x184741[_0xd893('0x59')]=_0x59d3f9[_0xd893('0x5f')];}}}if(_['isNil'](_0x184741[_0xd893('0x59')])){_0x184741[_0xd893('0x59')]=_0x338e5e+0x1;}return _0x159655(_0x184741);});});})['catch'](function(_0x5d9613){_0x12ef53(_0x5d9613);});});}function updateUser(_0x43d031){return new Promise(function(_0x3908ad,_0x57e5ae){try{if(_0x43d031[_0xd893('0x65')]){_0x43d031[_0xd893('0x66')]=_0x43d031[_0xd893('0x59')];_0x43d031[_0xd893('0x67')]={'mailbox':_0x43d031['internal'],'password':_0x43d031[_0xd893('0x36')],'fullname':_0x43d031['fullname'],'email':_0x43d031[_0xd893('0x68')]};}if(_0x43d031[_0xd893('0x2e')]===_0xd893('0x21')){if(!_0x43d031[_0xd893('0x69')])_0x43d031['permissions']=[_0xd893('0x6a'),'102',_0xd893('0x6b'),'113',_0xd893('0x6c'),_0xd893('0x6d'),'105',_0xd893('0x6e'),_0xd893('0x6f'),_0xd893('0x70'),_0xd893('0x71'),_0xd893('0x72'),'111',_0xd893('0x73'),'115'];}_0x3908ad(_0x43d031);}catch(_0x38a2b3){_0x57e5ae(_0x38a2b3);}});}exports[_0xd893('0x74')]=function(_0x392bef,_0x1d6e9a){if(_0x392bef[_0xd893('0x27')]['role']==='agent')throw new Error(_0xd893('0x75'));if(_0x392bef['body'][_0xd893('0x2e')]===_0xd893('0x27')&&_0x392bef[_0xd893('0x27')][_0xd893('0x2e')]!==_0xd893('0x26')){throw new Error(_0xd893('0x76'));}if(_0x392bef['body']['role']==='admin'&&_0x392bef['user'][_0xd893('0x2e')]!=='admin'){throw new Error(_0xd893('0x77'));}return licenseUtil[_0xd893('0x78')]([_0x392bef['body']])[_0xd893('0x20')](function(){return validateUser(_0x392bef[_0xd893('0x55')]);})['then'](function(_0xe1c5ef){return updateUser(_0xe1c5ef)[_0xd893('0x20')](function(_0x42521e){if(_0x42521e[_0xd893('0x2e')]==='admin'){_0x42521e[_0xd893('0x79')]=_0x392bef[_0xd893('0x27')][_0xd893('0x79')];delete _0x42521e[_0xd893('0x7a')];}return _0x42521e;});})['then'](function(_0x4dc24d){return db[_0xd893('0x32')][_0xd893('0x74')](_0x4dc24d,{'include':[{'model':db[_0xd893('0x67')],'as':_0xd893('0x67')}]});})[_0xd893('0x20')](function(_0x3b93cf){if(_0x392bef[_0xd893('0x55')][_0xd893('0x2e')]===_0xd893('0x27'))return _0x3b93cf;if(_0x392bef[_0xd893('0x27')]['role']!==_0xd893('0x27'))return _0x3b93cf;return db[_0xd893('0x7b')][_0xd893('0x2d')]({'where':{'name':_0x3b93cf[_0xd893('0x2e')]===_0xd893('0x21')?_0xd893('0x7c'):_0xd893('0x7d'),'userProfileId':_0x392bef['user']['userProfileId']},'raw':!![]})[_0xd893('0x20')](function(_0x751a0c){if(!_0x751a0c||_0x751a0c[_0xd893('0x7e')]!=0x0)return _0x3b93cf;return db[_0xd893('0x7f')]['create']({'name':_0x3b93cf[_0xd893('0x2f')],'resourceId':_0x3b93cf['id'],'type':_0x751a0c['name'],'sectionId':_0x751a0c['id']},{})['then'](function(){return _0x3b93cf;});})['catch'](function(_0x517d26){logger['error'](_0xd893('0x80'),_0x517d26);throw _0x517d26;});})[_0xd893('0x20')](respondWithResult(_0x1d6e9a,0xc9))[_0xd893('0x4d')](handleError(_0x1d6e9a,null));};exports[_0xd893('0x81')]=function(_0x2da5f3,_0x3f9ad9){var _0x1e8f89=_0x2da5f3[_0xd893('0x55')];var _0x11f933=[];if(_0x2da5f3[_0xd893('0x27')][_0xd893('0x2e')]===_0xd893('0x21'))throw new Error(_0xd893('0x75'));if(_[_0xd893('0x82')](_0x1e8f89,[_0xd893('0x2e'),_0xd893('0x27')])&&_0x2da5f3[_0xd893('0x27')]['role']!==_0xd893('0x26')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xd893('0x82')](_0x1e8f89,['role','admin'])&&_0x2da5f3[_0xd893('0x27')]['role']!==_0xd893('0x26')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xd893('0x78')](_0x1e8f89)[_0xd893('0x20')](function(){return validateUser(_0x1e8f89[0x0]);})[_0xd893('0x20')](function(){for(var _0x478f8f=0x1;_0x478f8f<_0x1e8f89['length'];_0x478f8f++){var _0x310899=_0x1e8f89[_0x478f8f-0x1][_0xd893('0x59')];if(!_0x1e8f89[_0x478f8f][_0xd893('0x59')])_0x1e8f89[_0x478f8f][_0xd893('0x59')]=_0x310899+0x1;_0x11f933[_0xd893('0x42')](validateUser(_0x1e8f89[_0x478f8f]));}return Promise[_0xd893('0x4c')](_0x11f933);})[_0xd893('0x20')](function(){_0x11f933=[];for(var _0x456a70=0x0;_0x456a70<_0x1e8f89[_0xd893('0x63')];_0x456a70++){_0x11f933[_0xd893('0x42')](updateUser(_0x1e8f89[_0x456a70]));}return Promise[_0xd893('0x4c')](_0x11f933);})[_0xd893('0x20')](function(){_0x11f933=_0x1e8f89['map'](function(_0x16a7d6){return db['User'][_0xd893('0x74')](_0x16a7d6,{'include':[{'model':db[_0xd893('0x67')],'as':_0xd893('0x67')}]})[_0xd893('0x20')](function(_0x578fe6){_0x16a7d6['id']=_0x578fe6['id'];return _0x16a7d6;});});return Promise['all'](_0x11f933);})[_0xd893('0x20')](function(_0x408a2f){if(_0x2da5f3[_0xd893('0x55')]['role']===_0xd893('0x27'))return _0x408a2f;if(_0x2da5f3['user']['role']!==_0xd893('0x27'))return _0x408a2f;var _0x2602c5=_[_0xd893('0x82')](_0x408a2f,function(_0x28cf09){return _0x28cf09[_0xd893('0x2e')]===_0xd893('0x21')||_0x28cf09[_0xd893('0x2e')]===_0xd893('0x83');});if(!_0x2602c5)return _0x408a2f;return db['UserProfileSection'][_0xd893('0x43')]({'where':{'name':{'$or':['Agents',_0xd893('0x7d')]},'userProfileId':_0x2da5f3[_0xd893('0x27')][_0xd893('0x7a')]},'raw':!![]})[_0xd893('0x20')](function(_0xaea3b2){if(_[_0xd893('0x84')](_0xaea3b2)||!_[_0xd893('0x82')](_0xaea3b2,[_0xd893('0x7e'),0x0]))return _0x408a2f;_0x11f933=[];var _0x51957d=_(_0xaea3b2)[_0xd893('0x2a')](function(_0x837c8a){if(_0x837c8a['autoAssociation']===0x1)return;return _0x837c8a[_0xd893('0x2f')]===_0xd893('0x7c')?_0xd893('0x21'):_0xd893('0x83');})['compact']()[_0xd893('0x2b')]();for(var _0x26e22e=0x0;_0x26e22e<_0x408a2f[_0xd893('0x63')];_0x26e22e++){if(!_['includes'](_0x51957d,_0x408a2f[_0x26e22e][_0xd893('0x2e')]))return;var _0x3d4118=_0x408a2f[_0x26e22e][_0xd893('0x2e')]==='agent'?'Agents':_0xd893('0x7d');_0x11f933[_0xd893('0x42')](db['UserProfileResource']['create']({'name':_0x408a2f[_0x26e22e][_0xd893('0x2f')],'resourceId':_0x408a2f[_0x26e22e]['id'],'type':_0x3d4118,'sectionId':_[_0xd893('0x2d')](_0xaea3b2,[_0xd893('0x2f'),_0x3d4118])['id']},{}));}return Promise['all'](_0x11f933);});})['then'](respondWithResult(_0x3f9ad9,0xc9))['catch'](handleError(_0x3f9ad9,null));};exports['changePassword']=function(_0x52f7d2,_0x1bba39){if(_0x52f7d2[_0xd893('0x55')]['id']){delete _0x52f7d2['body']['id'];}return db['User'][_0xd893('0x2d')]({'where':{'id':_0x52f7d2[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](function(_0x2064b6){if(!_0x2064b6)return null;if(_0x2064b6['id']===_0x52f7d2[_0xd893('0x27')]['id']){if(!_0x52f7d2[_0xd893('0x55')][_0xd893('0x85')]||!_0x52f7d2[_0xd893('0x55')][_0xd893('0x86')]){throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))](_0xd893('0x89'));}if(!_0x2064b6['authenticate'](_0x52f7d2['body'][_0xd893('0x85')])){throw new db['Sequelize'][(_0xd893('0x88'))](_0xd893('0x8a'));}if(_0x52f7d2[_0xd893('0x55')][_0xd893('0x85')]===_0x52f7d2[_0xd893('0x55')][_0xd893('0x86')]){throw new db[(_0xd893('0x87'))]['ValidationError'](_0xd893('0x8b'));}}else if(_0x52f7d2['user'][_0xd893('0x2e')]===_0xd893('0x26')){if(!_0x52f7d2[_0xd893('0x55')][_0xd893('0x86')]){throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x52f7d2[_0xd893('0x27')][_0xd893('0x2e')]===_0xd893('0x27')){if(!_0x52f7d2[_0xd893('0x55')][_0xd893('0x86')]){throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))](_0xd893('0x8c'));}if(_0x2064b6['role']!==_0xd893('0x21')){throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))]('Unauthorized');}}else{throw new db[(_0xd893('0x87'))]['ValidationError']('Unauthorized');}return _0x2064b6;})[_0xd893('0x20')](handleEntityNotFound(_0x1bba39,null))[_0xd893('0x20')](function(_0x250b83){return db[_0xd893('0x8d')]['findOne']({'attributes':['id',_0xd893('0x5b'),_0xd893('0x8e'),_0xd893('0x8f')]})['then'](function(_0xf810c1){if(_0xf810c1['securePassword'])authService[_0xd893('0x5c')](_0x52f7d2[_0xd893('0x55')]['newPassword']);if(!_0xf810c1[_0xd893('0x8e')]||!_0x250b83[_0xd893('0x38')])return _0x250b83;authService[_0xd893('0x90')](_0x52f7d2[_0xd893('0x55')]['newPassword'],_0x250b83[_0xd893('0x38')],_0xf810c1[_0xd893('0x8f')]);return _0x250b83;})[_0xd893('0x20')](saveUpdates({'password':_0x52f7d2[_0xd893('0x55')][_0xd893('0x86')],'passwordResetAt':_0x52f7d2['user']['id']==_0x52f7d2[_0xd893('0x4f')]['id']?moment():null,'previousPasswords':authService[_0xd893('0x91')](_0x52f7d2['body'][_0xd893('0x86')],_0x250b83[_0xd893('0x38')])},null));})['then'](respondWithResult(_0x1bba39,null))[_0xd893('0x4d')](handleError(_0x1bba39,null));};exports['addQueues']=function(_0x32ae12,_0x10c4b1){var _0x462def=_0x32ae12[_0xd893('0x55')][_0xd893('0x92')];return db[_0xd893('0x32')][_0xd893('0x2d')]({'where':{'id':_0x32ae12[_0xd893('0x4f')]['id']},'attributes':['id','name',_0xd893('0x2e'),'online',_0xd893('0x93'),_0xd893('0x94'),_0xd893('0x95')]})[_0xd893('0x20')](handleEntityNotFound(_0x10c4b1,null))[_0xd893('0x20')](function(_0xc77a33){if(_0xc77a33){if(!utils[_0xd893('0x96')](_0x462def)){throw new db[(_0xd893('0x87'))]['ValidationError']('Unknown\x20channel');}return _0xc77a33['add'+_[_0xd893('0x97')](_0x462def[_0xd893('0x98')]())+'Queues'](_0x32ae12[_0xd893('0x55')]['ids'],{'penalty':_0x32ae12[_0xd893('0x55')][_0xd893('0x99')]||0x0})[_0xd893('0x9a')](function(_0x5800ea){for(var _0x2cdee0=0x0;_0x2cdee0<_0x32ae12['body'][_0xd893('0x9b')][_0xd893('0x63')];_0x2cdee0+=0x1){var _0x5dc884={'UserId':Number(_0x32ae12[_0xd893('0x4f')]['id'])};_0x5dc884[_[_0xd893('0x97')](_0x462def[_0xd893('0x98')]())+_0xd893('0x9c')]=Number(_0x32ae12['body']['ids'][_0x2cdee0]);socket['emit'](_0xd893('0x27')+_['capitalize'](_0x462def[_0xd893('0x98')]())+'Queue:save',_0x5dc884);}return _0x5800ea;})[_0xd893('0x20')](function(){if(_0x462def===_0xd893('0x9d')){return db[_0xd893('0x9e')][_0xd893('0x43')]({'where':{'id':_0x32ae12['body']['ids']||[]},'raw':!![],'attributes':['id',_0xd893('0x2f')]});}})[_0xd893('0x20')](function(_0x4bf2a0){var _0x373953=_0xc77a33['get']({'plain':!![]});var _0x1e3f77=[];if(_0x462def===_0xd893('0x9d')&&_0x373953[_0xd893('0x2e')]===_0xd893('0x21')&&_0x373953[_0xd893('0x9f')]){for(let _0x475a97=0x0;_0x475a97<_0x4bf2a0[_0xd893('0x63')];_0x475a97+=0x1){_0x1e3f77[_0xd893('0x42')]({'membername':_0x373953[_0xd893('0x2f')],'UserId':_0x373953['id'],'queue_name':_0x4bf2a0[_0x475a97]['name'],'VoiceQueueId':_0x4bf2a0[_0x475a97]['id'],'interface':_['isNil'](_0x373953[_0xd893('0x95')])?util[_0xd893('0xa0')]('SIP/%s',_0x373953[_0xd893('0x2f')]):_0x373953[_0xd893('0x95')],'paused':_0x373953[_0xd893('0x94')]||![],'penalty':_0x32ae12[_0xd893('0x55')][_0xd893('0x99')]||0x0});}return Promise[_0xd893('0x4c')](_0x1e3f77[_0xd893('0x2a')](function(_0xc43f72){return db['UserVoiceQueueRt'][_0xd893('0xa1')](_0xc43f72);}));}return _0xc77a33;});}})[_0xd893('0x20')](respondWithStatusCode(_0x10c4b1,null))['catch'](handleError(_0x10c4b1,null));};exports[_0xd893('0xa2')]=function(_0x25379c,_0x53e81d){var _0x2227f1,_0xc2bcd8;return db[_0xd893('0x32')]['find']({'where':{'id':_0x25379c[_0xd893('0x4f')]['id']},'attributes':['id',_0xd893('0x2f'),_0xd893('0x2e')]})['then'](handleEntityNotFound(_0x53e81d,null))[_0xd893('0x20')](function(_0x30d591){if(_0x30d591){_0x2227f1=_0x30d591;if(!_0x25379c[_0xd893('0x3c')]['channel']||!utils['isValidChannel'](_0x25379c[_0xd893('0x3c')]['channel'])){throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))]('Unknown\x20channel');}return _0x30d591[_0xd893('0xa3')+_[_0xd893('0x97')](_0x25379c[_0xd893('0x3c')][_0xd893('0x92')][_0xd893('0x98')]())+_0xd893('0xa4')](_0x25379c['query']['ids']);}})[_0xd893('0x20')](function(_0xbd7e02){if(_[_0xd893('0xa5')](_0x25379c[_0xd893('0x3c')]['ids'])){for(var _0x1e630c=0x0;_0x1e630c<_0x25379c[_0xd893('0x3c')]['ids'][_0xd893('0x63')];_0x1e630c+=0x1){_0xc2bcd8={'UserId':Number(_0x25379c[_0xd893('0x4f')]['id'])};_0xc2bcd8[_['capitalize'](_0x25379c[_0xd893('0x3c')][_0xd893('0x92')][_0xd893('0x98')]())+_0xd893('0x9c')]=Number(_0x25379c[_0xd893('0x3c')][_0xd893('0x9b')][_0x1e630c]);socket['emit'](_0xd893('0x27')+_[_0xd893('0x97')](_0x25379c[_0xd893('0x3c')][_0xd893('0x92')][_0xd893('0x98')]())+_0xd893('0xa6'),_0xc2bcd8);}}else{_0xc2bcd8={'UserId':Number(_0x25379c[_0xd893('0x4f')]['id'])};_0xc2bcd8[_[_0xd893('0x97')](_0x25379c[_0xd893('0x3c')][_0xd893('0x92')]['toLowerCase']())+_0xd893('0x9c')]=Number(_0x25379c[_0xd893('0x3c')][_0xd893('0x9b')]);socket[_0xd893('0x22')]('user'+_[_0xd893('0x97')](_0x25379c[_0xd893('0x3c')][_0xd893('0x92')][_0xd893('0x98')]())+_0xd893('0xa6'),_0xc2bcd8);}return _0xbd7e02;})['then'](function(){if(_0x25379c[_0xd893('0x3c')][_0xd893('0x92')]===_0xd893('0x9d')){return db[_0xd893('0xa7')][_0xd893('0x24')]({'where':{'UserId':_0x25379c['params']['id'],'VoiceQueueId':_0x25379c[_0xd893('0x3c')]['ids']},'individualHooks':!![]})[_0xd893('0x20')](function(){return _0x2227f1;});}return _0x2227f1;})['then'](respondWithStatusCode(_0x53e81d,null))[_0xd893('0x4d')](handleError(_0x53e81d,null));};exports[_0xd893('0xa8')]=function(_0x57a47f,_0x549f49){_0x57a47f[_0xd893('0x55')][_0xd893('0xa9')]=_0x57a47f['file'][_0xd893('0xaa')];return db[_0xd893('0x32')][_0xd893('0x2d')]({'where':{'id':_0x57a47f['params']['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x549f49,null))[_0xd893('0x20')](saveUpdates(_0x57a47f[_0xd893('0x55')],null))[_0xd893('0x20')](respondWithResult(_0x549f49,null))[_0xd893('0x4d')](handleError(_0x549f49,null));};exports[_0xd893('0xab')]=function(_0x2bf27a,_0x498c53){var _0x2cc17d=path[_0xd893('0xac')](config[_0xd893('0xad')],_0xd893('0xae'));return db[_0xd893('0x32')][_0xd893('0x2d')]({'where':{'id':_0x2bf27a[_0xd893('0x4f')]['id']},'attributes':['id',_0xd893('0xa9')],'raw':!![]})['then'](handleEntityNotFound(_0x498c53,null))['then'](function(_0x22e62e){if(_0x22e62e){if(_[_0xd893('0x5e')](_0x22e62e[_0xd893('0xa9')])){return _0x498c53[_0xd893('0xaf')](_0x2cc17d);}else{if(!fs['existsSync'](path['join'](config[_0xd893('0xad')],_0xd893('0xb0'),_0x22e62e[_0xd893('0xa9')]))){return _0x498c53[_0xd893('0xaf')](_0x2cc17d);}return _0x498c53['download'](path[_0xd893('0xac')](config[_0xd893('0xad')],_0xd893('0xb0'),_0x22e62e[_0xd893('0xa9')]));}}})[_0xd893('0x4d')](handleError(_0x498c53,null));};exports[_0xd893('0xb1')]=function(_0x749d4e,_0x295b67){return db['User'][_0xd893('0x2d')]({'where':{'id':_0x749d4e['params']['id']},'attributes':['id']})[_0xd893('0x20')](handleEntityNotFound(_0x295b67,null))['then'](function(_0x982b74){var _0x37d188=[];values=_0x982b74[_0xd893('0x48')];_0x37d188[_0xd893('0x42')](get_open_tabs(_0xd893('0x46'),_0x982b74[_0xd893('0x48')]));_0x37d188[_0xd893('0x42')](get_open_tabs('sms',_0x982b74['dataValues']));_0x37d188[_0xd893('0x42')](get_open_tabs(_0xd893('0x54'),_0x982b74[_0xd893('0x48')]));_0x37d188[_0xd893('0x42')](get_open_tabs(_0xd893('0x4b'),_0x982b74[_0xd893('0x48')]));_0x37d188[_0xd893('0x42')](get_open_tabs('fax',_0x982b74['dataValues']));_0x37d188['push'](get_open_tabs('mail',_0x982b74[_0xd893('0x48')]));return Promise[_0xd893('0x4c')](_0x37d188);})[_0xd893('0x20')](function(_0x49717a){if(_0x49717a){var _0x51c2d0=_[_0xd893('0x2a')](values[_0xd893('0xb2')],function(_0x3157f0){return{'channel':_0xd893('0xb3'),'id':_0x3157f0['id'],'createdAt':_0x3157f0[_0xd893('0xb4')]};});var _0x4eef72=_[_0xd893('0x2a')](values[_0xd893('0xb5')],function(_0x540829){return{'channel':_0xd893('0xb6'),'id':_0x540829['id'],'createdAt':_0x540829['createdAt']};});var _0x364627=_['map'](values[_0xd893('0xb7')],function(_0x49148b){return{'channel':_0xd893('0xb8'),'id':_0x49148b['id'],'createdAt':_0x49148b['createdAt']};});var _0x3c94d0=_[_0xd893('0x2a')](values[_0xd893('0xb9')],function(_0x3b8abd){return{'channel':_0xd893('0xba'),'id':_0x3b8abd['id'],'createdAt':_0x3b8abd['createdAt']};});var _0x470e9d=_[_0xd893('0x2a')](values[_0xd893('0xbb')],function(_0x24d689){return{'channel':'SMS','id':_0x24d689['id'],'createdAt':_0x24d689[_0xd893('0xb4')]};});var _0x4c30cd=_['map'](values[_0xd893('0xbc')],function(_0x56ef72){return{'channel':_0xd893('0xbd'),'id':_0x56ef72['id'],'createdAt':_0x56ef72[_0xd893('0xb4')]};});var _0x430635=_[_0xd893('0xbe')](_0x51c2d0,_0x4eef72,_0x364627,_0x3c94d0,_0x470e9d,_0x4c30cd);var _0x3f61a7={'count':_0x430635[_0xd893('0x63')],'rows':_0x430635};return _0x3f61a7;}else return null;})[_0xd893('0x20')](respondWithResult(_0x295b67,null))[_0xd893('0x4d')](handleError(_0x295b67,null));};exports[_0xd893('0xbf')]=function(_0x27960c,_0x37a4da){var _0x2a98f8={};return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x27960c[_0xd893('0x4f')]['id']}})['then'](function(_0x580f3a){if(!_0x580f3a){throw new APINotFoundError(util[_0xd893('0xa0')]('User\x20with\x20id\x20%s\x20not\x20found',_0x27960c['params']['id']));}return contacts[_0xd893('0x56')]();})[_0xd893('0x20')](function(_0x4dfe13){_0x27960c[_0xd893('0x3c')][_0xd893('0x32')]=_0x27960c[_0xd893('0x4f')]['id'];_0x2a98f8=qs[_0xd893('0x50')](_0x4dfe13,_0x27960c);if(_0x27960c[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0x51'))){_0x2a98f8['include']=[{'model':db[_0xd893('0xc2')],'as':_0xd893('0xc3'),'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xd893('0x2f'),_0xd893('0xc4')],'where':_0x27960c[_0xd893('0x3c')][_0xd893('0xc5')]?{'id':_0x27960c[_0xd893('0x3c')][_0xd893('0xc5')]}:undefined,'required':_0x27960c[_0xd893('0x3c')]['tag']?!![]:![]}];}return contacts[_0xd893('0x43')](_0x27960c[_0xd893('0x3c')],_0x27960c[_0xd893('0x27')],_0x2a98f8,_0x4dfe13);})[_0xd893('0x20')](respondWithFilteredResult(_0x37a4da,_0x2a98f8))[_0xd893('0x4d')](APIHandleError(_0x37a4da));};exports['getQueues']=function(_0x19eaf2,_0x14ab4f){var _0x27f346;var _0x29ed90={};var _0x41b96e;return db['User']['findOne']({'where':{'id':_0x19eaf2['params']['id']},'attributes':['id',_0xd893('0x2f'),'role']})[_0xd893('0x20')](handleEntityNotFound(_0x14ab4f,null))[_0xd893('0x20')](function(_0x23987e){if(!utils[_0xd893('0x96')](_0x19eaf2[_0xd893('0x3c')][_0xd893('0x92')])){throw new db['Sequelize'][(_0xd893('0x88'))](_0xd893('0xc6'));}_0x27f346=_0x23987e;var _0x25a498={};_0x25a498[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_[_0xd893('0x97')](_0x19eaf2[_0xd893('0x3c')][_0xd893('0x92')])+_0xd893('0xc9')][_0xd893('0x33')]);_0x25a498[_0xd893('0x3c')]=_[_0xd893('0xc8')](_0x19eaf2['query']);_0x25a498[_0xd893('0xca')]=_['intersection'](_0x25a498[_0xd893('0xc7')],_0x25a498[_0xd893('0x3c')]);_0x29ed90[_0xd893('0x41')]=_[_0xd893('0xcb')](_0x25a498['model'],qs[_0xd893('0xcc')](_0x19eaf2[_0xd893('0x3c')][_0xd893('0xcc')]));_0x29ed90[_0xd893('0x41')]=_0x29ed90[_0xd893('0x41')][_0xd893('0x63')]?_0x29ed90[_0xd893('0x41')]:_0x25a498[_0xd893('0xc7')];_0x29ed90[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x19eaf2[_0xd893('0x3c')]['sort']);_0x29ed90[_0xd893('0xcf')]=qs[_0xd893('0xca')](_[_0xd893('0xd0')](_0x19eaf2['query'],_0x25a498[_0xd893('0xca')]));if(_0x19eaf2[_0xd893('0x3c')]['filter']){_0x29ed90[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x29ed90[_0xd893('0xcf')],{'$or':_['map'](_0x29ed90[_0xd893('0x41')],function(_0x22436f){var _0x3f3616={};_0x3f3616[_0x22436f]={'$like':'%'+_0x19eaf2[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x3f3616;})});}_0x29ed90=_['merge']({},_0x29ed90,_0x19eaf2[_0xd893('0x53')]);switch(_0x27f346[_0xd893('0x2e')]){case _0xd893('0x26'):return db[_['capitalize'](_0x19eaf2[_0xd893('0x3c')][_0xd893('0x92')])+_0xd893('0xc9')][_0xd893('0x43')](_0x29ed90);case'user':case'agent':return _0x27f346[_0xd893('0x25')+_[_0xd893('0x97')](_0x19eaf2['query'][_0xd893('0x92')])+_0xd893('0xa4')](_0x29ed90);default:throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))](_0xd893('0xd1'));}})[_0xd893('0x20')](function(_0xed8c06){_0x41b96e=_0xed8c06[_0xd893('0x63')];if(!_0x19eaf2[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0xd2'))){_0x29ed90['limit']=qs[_0xd893('0x1c')](_0x19eaf2[_0xd893('0x3c')][_0xd893('0x1c')]);_0x29ed90[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x19eaf2['query'][_0xd893('0x19')]);}switch(_0x27f346['role']){case _0xd893('0x26'):return db[_['capitalize'](_0x19eaf2[_0xd893('0x3c')]['channel'])+_0xd893('0xc9')][_0xd893('0x43')](_0x29ed90);case _0xd893('0x27'):case _0xd893('0x21'):return _0x27f346['get'+_['capitalize'](_0x19eaf2['query'][_0xd893('0x92')])+'Queues'](_0x29ed90);}})[_0xd893('0x20')](function(_0x285355){return{'count':_0x41b96e,'rows':_0x285355};})[_0xd893('0x20')](respondWithResult(_0x14ab4f,null))[_0xd893('0x4d')](handleError(_0x14ab4f,null));};exports[_0xd893('0xd3')]=function(_0x4c84ba,_0xaf8b11){var _0x16a146={};var _0x1eced9={};var _0x50e2c8;var _0x20cae5;return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x4c84ba[_0xd893('0x4f')]['id']}})['then'](handleEntityNotFound(_0xaf8b11,null))[_0xd893('0x20')](function(_0x9252dd){if(_0x9252dd){_0x50e2c8=_0x9252dd;_0x1eced9[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0xa7')][_0xd893('0x33')]);_0x1eced9[_0xd893('0x3c')]=_[_0xd893('0xc8')](_0x4c84ba[_0xd893('0x3c')]);_0x1eced9[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x1eced9['model'],_0x1eced9[_0xd893('0x3c')]);_0x16a146['attributes']=_[_0xd893('0xcb')](_0x1eced9['model'],qs[_0xd893('0xcc')](_0x4c84ba['query'][_0xd893('0xcc')]));_0x16a146[_0xd893('0x41')]=_0x16a146[_0xd893('0x41')]['length']?_0x16a146[_0xd893('0x41')]:_0x1eced9[_0xd893('0xc7')];_0x16a146[_0xd893('0xcd')]=qs['sort'](_0x4c84ba[_0xd893('0x3c')][_0xd893('0xce')]);_0x16a146[_0xd893('0xcf')]=qs['filters'](_[_0xd893('0xd0')](_0x4c84ba[_0xd893('0x3c')],_0x1eced9[_0xd893('0xca')]));if(_0x4c84ba[_0xd893('0x3c')][_0xd893('0x28')]){_0x16a146[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x16a146[_0xd893('0xcf')],{'$or':_[_0xd893('0x2a')](_0x16a146[_0xd893('0x41')],function(_0x452dc0){var _0x226ca9={};_0x226ca9[_0x452dc0]={'$like':'%'+_0x4c84ba[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x226ca9;})});}_0x16a146=_[_0xd893('0x52')]({},_0x16a146,_0x4c84ba[_0xd893('0x53')]);return _0x50e2c8[_0xd893('0xd3')](_0x16a146);}})['then'](function(_0x4f80b8){if(_0x4f80b8){_0x20cae5=_0x4f80b8[_0xd893('0x63')];if(!_0x4c84ba[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0xd2'))){_0x16a146[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x4c84ba['query']['limit']);_0x16a146[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x4c84ba[_0xd893('0x3c')][_0xd893('0x19')]);}return _0x50e2c8[_0xd893('0xd3')](_0x16a146);}})['then'](function(_0x4c96d5){if(_0x4c96d5){return _0x4c96d5?{'count':_0x20cae5,'rows':_0x4c96d5}:null;}})[_0xd893('0x20')](respondWithResult(_0xaf8b11,null))[_0xd893('0x4d')](handleError(_0xaf8b11,null));};exports[_0xd893('0xd4')]=function(_0x4a3724,_0x827af0){var _0x32c573={};var _0x1f94fb={};var _0x10a918;var _0x11c4da;return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x4a3724[_0xd893('0x4f')]['id']}})['then'](handleEntityNotFound(_0x827af0,null))['then'](function(_0x18f016){if(_0x18f016){_0x10a918=_0x18f016;_0x1f94fb[_0xd893('0xc7')]=_[_0xd893('0xc8')](db['ChatGroup'][_0xd893('0x33')]);_0x1f94fb['query']=_[_0xd893('0xc8')](_0x4a3724[_0xd893('0x3c')]);_0x1f94fb[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x1f94fb[_0xd893('0xc7')],_0x1f94fb[_0xd893('0x3c')]);_0x32c573['attributes']=_[_0xd893('0xcb')](_0x1f94fb['model'],qs['fields'](_0x4a3724[_0xd893('0x3c')][_0xd893('0xcc')]));_0x32c573[_0xd893('0x41')]=_0x32c573[_0xd893('0x41')]['length']?_0x32c573[_0xd893('0x41')]:_0x1f94fb[_0xd893('0xc7')];_0x32c573[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x4a3724[_0xd893('0x3c')][_0xd893('0xce')]);_0x32c573[_0xd893('0xcf')]=qs['filters'](_[_0xd893('0xd0')](_0x4a3724['query'],_0x1f94fb[_0xd893('0xca')]));if(_0x4a3724[_0xd893('0x3c')]['filter']){_0x32c573[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x32c573['where'],{'$or':_['map'](_0x32c573[_0xd893('0x41')],function(_0x300d19){var _0x10610b={};_0x10610b[_0x300d19]={'$like':'%'+_0x4a3724['query'][_0xd893('0x28')]+'%'};return _0x10610b;})});}_0x32c573=_[_0xd893('0x52')]({},_0x32c573,_0x4a3724[_0xd893('0x53')]);return _0x10a918[_0xd893('0xd4')](_0x32c573);}})[_0xd893('0x20')](function(_0x433ac1){if(_0x433ac1){_0x11c4da=_0x433ac1['length'];if(!_0x4a3724[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0xd2'))){_0x32c573['limit']=qs[_0xd893('0x1c')](_0x4a3724[_0xd893('0x3c')]['limit']);_0x32c573['offset']=qs[_0xd893('0x19')](_0x4a3724[_0xd893('0x3c')][_0xd893('0x19')]);}return _0x10a918[_0xd893('0xd4')](_0x32c573);}})['then'](function(_0x46b974){if(_0x46b974){return _0x46b974?{'count':_0x11c4da,'rows':_0x46b974}:null;}})[_0xd893('0x20')](respondWithResult(_0x827af0,null))[_0xd893('0x4d')](handleError(_0x827af0,null));};exports[_0xd893('0xd5')]=function(_0x17d011,_0x39d61b){var _0x229c9b={'raw':!![],'where':{}};var _0x2b1c42={};var _0x3bc379={'count':0x0,'rows':[]};return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x17d011[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x39d61b,null))['then'](function(_0x3ec659){if(_0x3ec659){_0x2b1c42[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0xd6')][_0xd893('0x33')]);_0x2b1c42['query']=_['keys'](_0x17d011[_0xd893('0x3c')]);_0x2b1c42[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x2b1c42[_0xd893('0xc7')],_0x2b1c42[_0xd893('0x3c')]);_0x229c9b[_0xd893('0x41')]=_['intersection'](_0x2b1c42[_0xd893('0xc7')],qs['fields'](_0x17d011[_0xd893('0x3c')]['fields']));_0x229c9b[_0xd893('0x41')]=_0x229c9b['attributes'][_0xd893('0x63')]?_0x229c9b['attributes']:_0x2b1c42[_0xd893('0xc7')];if(!_0x17d011[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0xd2'))){_0x229c9b['limit']=qs[_0xd893('0x1c')](_0x17d011[_0xd893('0x3c')][_0xd893('0x1c')]);_0x229c9b['offset']=qs[_0xd893('0x19')](_0x17d011[_0xd893('0x3c')][_0xd893('0x19')]);}_0x229c9b[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x17d011[_0xd893('0x3c')][_0xd893('0xce')]);_0x229c9b['where']=qs[_0xd893('0xca')](_[_0xd893('0xd0')](_0x17d011[_0xd893('0x3c')],_0x2b1c42['filters']));_0x229c9b[_0xd893('0xcf')][_0xd893('0xd7')]=_0x3ec659['id'];if(_0x17d011[_0xd893('0x3c')][_0xd893('0x28')]){_0x229c9b['where']=_[_0xd893('0x52')](_0x229c9b[_0xd893('0xcf')],{'$or':_['map'](_0x229c9b[_0xd893('0x41')],function(_0x437ead){var _0x44cc8f={};_0x44cc8f[_0x437ead]={'$like':'%'+_0x17d011[_0xd893('0x3c')]['filter']+'%'};return _0x44cc8f;})});}_0x229c9b=_['merge']({},_0x229c9b,_0x17d011[_0xd893('0x53')]);return db[_0xd893('0xd6')][_0xd893('0x1b')]({'where':_0x229c9b['where']})[_0xd893('0x20')](function(_0x11c387){_0x3bc379[_0xd893('0x1b')]=_0x11c387;if(_0x17d011[_0xd893('0x3c')][_0xd893('0x51')]){_0x229c9b[_0xd893('0x3d')]=[{'all':!![]}];}return db['VoiceRecording'][_0xd893('0x43')](_0x229c9b);})[_0xd893('0x20')](function(_0x476bcf){_0x3bc379[_0xd893('0x45')]=_0x476bcf;return _0x3bc379;});}})[_0xd893('0x20')](respondWithFilteredResult(_0x39d61b,_0x229c9b))['catch'](handleError(_0x39d61b,null));};exports['getScreenRecordings']=function(_0x3723d6,_0x19325e){var _0x5cf92={'raw':!![],'where':{}};var _0x4093b7={};var _0x5d8239={'count':0x0,'rows':[]};return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x3723d6[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x19325e,null))['then'](function(_0x3d9896){if(_0x3d9896){_0x4093b7[_0xd893('0xc7')]=_['keys'](db[_0xd893('0xd8')][_0xd893('0x33')]);_0x4093b7[_0xd893('0x3c')]=_[_0xd893('0xc8')](_0x3723d6['query']);_0x4093b7[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x4093b7['model'],_0x4093b7[_0xd893('0x3c')]);_0x5cf92[_0xd893('0x41')]=_[_0xd893('0xcb')](_0x4093b7[_0xd893('0xc7')],qs['fields'](_0x3723d6[_0xd893('0x3c')][_0xd893('0xcc')]));_0x5cf92[_0xd893('0x41')]=_0x5cf92[_0xd893('0x41')][_0xd893('0x63')]?_0x5cf92[_0xd893('0x41')]:_0x4093b7[_0xd893('0xc7')];if(!_0x3723d6['query'][_0xd893('0xc1')](_0xd893('0xd2'))){_0x5cf92['limit']=qs['limit'](_0x3723d6[_0xd893('0x3c')][_0xd893('0x1c')]);_0x5cf92[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x3723d6[_0xd893('0x3c')][_0xd893('0x19')]);}_0x5cf92['order']=qs[_0xd893('0xce')](_0x3723d6['query'][_0xd893('0xce')]);_0x5cf92[_0xd893('0xcf')]=qs['filters'](_[_0xd893('0xd0')](_0x3723d6['query'],_0x4093b7[_0xd893('0xca')]));_0x5cf92['where'][_0xd893('0xd7')]=_0x3d9896['id'];if(_0x3723d6[_0xd893('0x3c')]['filter']){_0x5cf92[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x5cf92['where'],{'$or':_['map'](_0x5cf92['attributes'],function(_0x4bbdf8){var _0x26174c={};_0x26174c[_0x4bbdf8]={'$like':'%'+_0x3723d6[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x26174c;})});}_0x5cf92=_[_0xd893('0x52')]({},_0x5cf92,_0x3723d6[_0xd893('0x53')]);return db[_0xd893('0xd8')][_0xd893('0x1b')]({'where':_0x5cf92[_0xd893('0xcf')]})[_0xd893('0x20')](function(_0x264216){_0x5d8239[_0xd893('0x1b')]=_0x264216;if(_0x3723d6[_0xd893('0x3c')][_0xd893('0x51')]){_0x5cf92[_0xd893('0x3d')]=[{'all':!![]}];}return db[_0xd893('0xd8')][_0xd893('0x43')](_0x5cf92);})[_0xd893('0x20')](function(_0x4a26db){_0x5d8239[_0xd893('0x45')]=_0x4a26db;return _0x5d8239;});}})[_0xd893('0x20')](respondWithFilteredResult(_0x19325e,_0x5cf92))['catch'](handleError(_0x19325e,null));};exports[_0xd893('0xd9')]=function(_0x590212,_0x292dac){var _0x2ecdf9={};var _0x30a496={};var _0x6ade1b;var _0x1bc5d9;return db['User'][_0xd893('0xc0')]({'where':{'id':_0x590212['params']['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x292dac,null))['then'](function(_0x20103f){if(_0x20103f){_0x6ade1b=_0x20103f;_0x30a496[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0xda')][_0xd893('0x33')]);_0x30a496['query']=_[_0xd893('0xc8')](_0x590212[_0xd893('0x3c')]);_0x30a496[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x30a496[_0xd893('0xc7')],_0x30a496[_0xd893('0x3c')]);_0x2ecdf9['attributes']=_[_0xd893('0xcb')](_0x30a496[_0xd893('0xc7')],qs[_0xd893('0xcc')](_0x590212['query'][_0xd893('0xcc')]));_0x2ecdf9['attributes']=_0x2ecdf9[_0xd893('0x41')][_0xd893('0x63')]?_0x2ecdf9[_0xd893('0x41')]:_0x30a496['model'];_0x2ecdf9[_0xd893('0xcd')]=qs['sort'](_0x590212['query'][_0xd893('0xce')]);_0x2ecdf9[_0xd893('0xcf')]=qs[_0xd893('0xca')](_['pick'](_0x590212[_0xd893('0x3c')],_0x30a496[_0xd893('0xca')]));if(_0x590212[_0xd893('0x3c')]['filter']){_0x2ecdf9[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x2ecdf9['where'],{'$or':_[_0xd893('0x2a')](_0x2ecdf9[_0xd893('0x41')],function(_0x7e1ba5){var _0x124c8c={};_0x124c8c[_0x7e1ba5]={'$like':'%'+_0x590212[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x124c8c;})});}_0x2ecdf9=_[_0xd893('0x52')]({},_0x2ecdf9,_0x590212[_0xd893('0x53')]);return _0x6ade1b[_0xd893('0xd9')](_0x2ecdf9);}})[_0xd893('0x20')](function(_0x3c4c65){if(_0x3c4c65){_0x1bc5d9=_0x3c4c65[_0xd893('0x63')];if(!_0x590212['query'][_0xd893('0xc1')](_0xd893('0xd2'))){_0x2ecdf9[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x590212[_0xd893('0x3c')][_0xd893('0x1c')]);_0x2ecdf9[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x590212[_0xd893('0x3c')][_0xd893('0x19')]);}return _0x6ade1b['getChatInteractions'](_0x2ecdf9);}})[_0xd893('0x20')](function(_0x426544){if(_0x426544){return _0x426544?{'count':_0x1bc5d9,'rows':_0x426544}:null;}})[_0xd893('0x20')](respondWithResult(_0x292dac,null))['catch'](handleError(_0x292dac,null));};exports['getOpenchannelInteractions']=function(_0x5d1f50,_0xd42a3b){var _0x32be9c={};var _0xb58e05={};var _0x151c8d;var _0x43d894;return db[_0xd893('0x32')]['findOne']({'where':{'id':_0x5d1f50[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0xd42a3b,null))[_0xd893('0x20')](function(_0x355cc2){if(_0x355cc2){_0x151c8d=_0x355cc2;_0xb58e05[_0xd893('0xc7')]=_['keys'](db[_0xd893('0xdb')][_0xd893('0x33')]);_0xb58e05[_0xd893('0x3c')]=_[_0xd893('0xc8')](_0x5d1f50[_0xd893('0x3c')]);_0xb58e05['filters']=_['intersection'](_0xb58e05[_0xd893('0xc7')],_0xb58e05['query']);_0x32be9c[_0xd893('0x41')]=_[_0xd893('0xcb')](_0xb58e05[_0xd893('0xc7')],qs['fields'](_0x5d1f50['query']['fields']));_0x32be9c[_0xd893('0x41')]=_0x32be9c[_0xd893('0x41')][_0xd893('0x63')]?_0x32be9c[_0xd893('0x41')]:_0xb58e05[_0xd893('0xc7')];_0x32be9c[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x5d1f50[_0xd893('0x3c')][_0xd893('0xce')]);_0x32be9c[_0xd893('0xcf')]=qs[_0xd893('0xca')](_[_0xd893('0xd0')](_0x5d1f50[_0xd893('0x3c')],_0xb58e05[_0xd893('0xca')]));if(_0x5d1f50['query']['filter']){_0x32be9c[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x32be9c['where'],{'$or':_[_0xd893('0x2a')](_0x32be9c['attributes'],function(_0x114cb7){var _0x492710={};_0x492710[_0x114cb7]={'$like':'%'+_0x5d1f50['query']['filter']+'%'};return _0x492710;})});}_0x32be9c=_[_0xd893('0x52')]({},_0x32be9c,_0x5d1f50[_0xd893('0x53')]);return _0x151c8d[_0xd893('0xdc')](_0x32be9c);}})[_0xd893('0x20')](function(_0x131c05){if(_0x131c05){_0x43d894=_0x131c05[_0xd893('0x63')];if(!_0x5d1f50[_0xd893('0x3c')][_0xd893('0xc1')]('nolimit')){_0x32be9c[_0xd893('0x1c')]=qs['limit'](_0x5d1f50[_0xd893('0x3c')][_0xd893('0x1c')]);_0x32be9c[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x5d1f50[_0xd893('0x3c')][_0xd893('0x19')]);}return _0x151c8d[_0xd893('0xdc')](_0x32be9c);}})[_0xd893('0x20')](function(_0x442f66){if(_0x442f66){return _0x442f66?{'count':_0x43d894,'rows':_0x442f66}:null;}})[_0xd893('0x20')](respondWithResult(_0xd42a3b,null))[_0xd893('0x4d')](handleError(_0xd42a3b,null));};exports['getMailInteractions']=function(_0x3bb3f7,_0x212f61){var _0x149485={'raw':!![],'where':{}};var _0x3238f2={};var _0x19f625={'count':0x0,'rows':[]};return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x3bb3f7[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x212f61,null))[_0xd893('0x20')](function(_0x47cf84){if(_0x47cf84){_0x3238f2[_0xd893('0xc7')]=_['keys'](db[_0xd893('0xdd')][_0xd893('0x33')]);_0x3238f2['query']=_[_0xd893('0xc8')](_0x3bb3f7[_0xd893('0x3c')]);_0x3238f2[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x3238f2['model'],_0x3238f2[_0xd893('0x3c')]);_0x149485[_0xd893('0x41')]=_[_0xd893('0xcb')](_0x3238f2['model'],qs['fields'](_0x3bb3f7[_0xd893('0x3c')][_0xd893('0xcc')]));_0x149485[_0xd893('0x41')]=_0x149485[_0xd893('0x41')]['length']?_0x149485[_0xd893('0x41')]:_0x3238f2[_0xd893('0xc7')];if(!_0x3bb3f7[_0xd893('0x3c')]['hasOwnProperty']('nolimit')){_0x149485[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x3bb3f7[_0xd893('0x3c')][_0xd893('0x1c')]);_0x149485[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x3bb3f7[_0xd893('0x3c')][_0xd893('0x19')]);}_0x149485[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x3bb3f7[_0xd893('0x3c')][_0xd893('0xce')]);_0x149485[_0xd893('0xcf')]=qs[_0xd893('0xca')](_[_0xd893('0xd0')](_0x3bb3f7[_0xd893('0x3c')],_0x3238f2[_0xd893('0xca')]));_0x149485[_0xd893('0xcf')][_0xd893('0xd7')]=_0x47cf84['id'];if(_0x3bb3f7[_0xd893('0x3c')][_0xd893('0x28')]){_0x149485[_0xd893('0xcf')]=_['merge'](_0x149485[_0xd893('0xcf')],{'$or':_[_0xd893('0x2a')](_0x149485[_0xd893('0x41')],function(_0x5d0022){var _0x5522d8={};_0x5522d8[_0x5d0022]={'$like':'%'+_0x3bb3f7[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x5522d8;})});}_0x149485=_[_0xd893('0x52')]({},_0x149485,_0x3bb3f7[_0xd893('0x53')]);return db[_0xd893('0xdd')][_0xd893('0x1b')]({'where':_0x149485[_0xd893('0xcf')]})[_0xd893('0x20')](function(_0x161d87){_0x19f625[_0xd893('0x1b')]=_0x161d87;if(_0x3bb3f7[_0xd893('0x3c')][_0xd893('0x51')]){_0x149485[_0xd893('0x3d')]=[{'all':!![]}];}return db[_0xd893('0xdd')][_0xd893('0x43')](_0x149485);})[_0xd893('0x20')](function(_0x5044ff){_0x19f625['rows']=_0x5044ff;return _0x19f625;});}})[_0xd893('0x20')](respondWithFilteredResult(_0x212f61,_0x149485))[_0xd893('0x4d')](handleError(_0x212f61,null));};exports[_0xd893('0xde')]=function(_0x390a88,_0x3cbc5c){var _0x31dff0={};var _0x54c710={};var _0x475102;var _0x21a6d8;return db['User'][_0xd893('0xc0')]({'where':{'id':_0x390a88[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x3cbc5c,null))['then'](function(_0x2185d1){if(_0x2185d1){_0x475102=_0x2185d1;_0x54c710[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0xdf')][_0xd893('0x33')]);_0x54c710['query']=_[_0xd893('0xc8')](_0x390a88[_0xd893('0x3c')]);_0x54c710['filters']=_[_0xd893('0xcb')](_0x54c710[_0xd893('0xc7')],_0x54c710[_0xd893('0x3c')]);_0x31dff0[_0xd893('0x41')]=_[_0xd893('0xcb')](_0x54c710[_0xd893('0xc7')],qs[_0xd893('0xcc')](_0x390a88[_0xd893('0x3c')]['fields']));_0x31dff0[_0xd893('0x41')]=_0x31dff0['attributes'][_0xd893('0x63')]?_0x31dff0['attributes']:_0x54c710[_0xd893('0xc7')];_0x31dff0[_0xd893('0xcd')]=qs['sort'](_0x390a88[_0xd893('0x3c')][_0xd893('0xce')]);_0x31dff0['where']=qs['filters'](_['pick'](_0x390a88[_0xd893('0x3c')],_0x54c710[_0xd893('0xca')]));if(_0x390a88[_0xd893('0x3c')][_0xd893('0x28')]){_0x31dff0[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x31dff0[_0xd893('0xcf')],{'$or':_[_0xd893('0x2a')](_0x31dff0[_0xd893('0x41')],function(_0x5eb46b){var _0x7e1ef8={};_0x7e1ef8[_0x5eb46b]={'$like':'%'+_0x390a88[_0xd893('0x3c')]['filter']+'%'};return _0x7e1ef8;})});}_0x31dff0=_[_0xd893('0x52')]({},_0x31dff0,_0x390a88[_0xd893('0x53')]);return _0x475102[_0xd893('0xde')](_0x31dff0);}})['then'](function(_0x5c0845){if(_0x5c0845){_0x21a6d8=_0x5c0845[_0xd893('0x63')];if(!_0x390a88[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0xd2'))){_0x31dff0['limit']=qs[_0xd893('0x1c')](_0x390a88[_0xd893('0x3c')]['limit']);_0x31dff0[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x390a88['query'][_0xd893('0x19')]);}return _0x475102[_0xd893('0xde')](_0x31dff0);}})[_0xd893('0x20')](function(_0x53646f){if(_0x53646f){return _0x53646f?{'count':_0x21a6d8,'rows':_0x53646f}:null;}})[_0xd893('0x20')](respondWithResult(_0x3cbc5c,null))[_0xd893('0x4d')](handleError(_0x3cbc5c,null));};exports[_0xd893('0xe0')]=function(_0x227dbd,_0x4b0910){var _0xfb277c={};var _0x4f8ac9={};var _0x2503cf;var _0x4908a3;return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x227dbd[_0xd893('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4b0910,null))['then'](function(_0xbdd3cd){if(_0xbdd3cd){_0x2503cf=_0xbdd3cd;_0x4f8ac9[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0xe1')][_0xd893('0x33')]);_0x4f8ac9[_0xd893('0x3c')]=_['keys'](_0x227dbd['query']);_0x4f8ac9[_0xd893('0xca')]=_['intersection'](_0x4f8ac9[_0xd893('0xc7')],_0x4f8ac9[_0xd893('0x3c')]);_0xfb277c[_0xd893('0x41')]=_[_0xd893('0xcb')](_0x4f8ac9[_0xd893('0xc7')],qs[_0xd893('0xcc')](_0x227dbd[_0xd893('0x3c')][_0xd893('0xcc')]));_0xfb277c[_0xd893('0x41')]=_0xfb277c['attributes'][_0xd893('0x63')]?_0xfb277c[_0xd893('0x41')]:_0x4f8ac9[_0xd893('0xc7')];_0xfb277c[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x227dbd[_0xd893('0x3c')][_0xd893('0xce')]);_0xfb277c[_0xd893('0xcf')]=qs[_0xd893('0xca')](_['pick'](_0x227dbd[_0xd893('0x3c')],_0x4f8ac9[_0xd893('0xca')]));if(_0x227dbd[_0xd893('0x3c')][_0xd893('0x28')]){_0xfb277c['where']=_[_0xd893('0x52')](_0xfb277c['where'],{'$or':_[_0xd893('0x2a')](_0xfb277c[_0xd893('0x41')],function(_0x395485){var _0x131d7a={};_0x131d7a[_0x395485]={'$like':'%'+_0x227dbd[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x131d7a;})});}_0xfb277c=_[_0xd893('0x52')]({},_0xfb277c,_0x227dbd[_0xd893('0x53')]);return _0x2503cf[_0xd893('0xe0')](_0xfb277c);}})[_0xd893('0x20')](function(_0x507d80){if(_0x507d80){_0x4908a3=_0x507d80[_0xd893('0x63')];if(!_0x227dbd[_0xd893('0x3c')][_0xd893('0xc1')]('nolimit')){_0xfb277c[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x227dbd[_0xd893('0x3c')]['limit']);_0xfb277c[_0xd893('0x19')]=qs['offset'](_0x227dbd[_0xd893('0x3c')]['offset']);}return _0x2503cf[_0xd893('0xe0')](_0xfb277c);}})[_0xd893('0x20')](function(_0x1a53aa){if(_0x1a53aa){return _0x1a53aa?{'count':_0x4908a3,'rows':_0x1a53aa}:null;}})[_0xd893('0x20')](respondWithResult(_0x4b0910,null))[_0xd893('0x4d')](handleError(_0x4b0910,null));};exports[_0xd893('0xe2')]=function(_0x570ded,_0x2503ed){var _0x374739={};var _0x3322d7={};var _0xe2615a;var _0x1cad5f;return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x570ded[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x2503ed,null))[_0xd893('0x20')](function(_0x3011e8){if(_0x3011e8){_0xe2615a=_0x3011e8;_0x3322d7[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0xe3')][_0xd893('0x33')]);_0x3322d7[_0xd893('0x3c')]=_[_0xd893('0xc8')](_0x570ded[_0xd893('0x3c')]);_0x3322d7[_0xd893('0xca')]=_['intersection'](_0x3322d7[_0xd893('0xc7')],_0x3322d7[_0xd893('0x3c')]);_0x374739[_0xd893('0x41')]=_['intersection'](_0x3322d7[_0xd893('0xc7')],qs['fields'](_0x570ded['query']['fields']));_0x374739[_0xd893('0x41')]=_0x374739[_0xd893('0x41')][_0xd893('0x63')]?_0x374739[_0xd893('0x41')]:_0x3322d7[_0xd893('0xc7')];_0x374739[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x570ded[_0xd893('0x3c')][_0xd893('0xce')]);_0x374739['where']=qs[_0xd893('0xca')](_[_0xd893('0xd0')](_0x570ded[_0xd893('0x3c')],_0x3322d7[_0xd893('0xca')]));if(_0x570ded[_0xd893('0x3c')][_0xd893('0x28')]){_0x374739[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x374739[_0xd893('0xcf')],{'$or':_[_0xd893('0x2a')](_0x374739[_0xd893('0x41')],function(_0xa02819){var _0x1c2dd9={};_0x1c2dd9[_0xa02819]={'$like':'%'+_0x570ded[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x1c2dd9;})});}_0x374739=_[_0xd893('0x52')]({},_0x374739,_0x570ded[_0xd893('0x53')]);return _0xe2615a['getWhatsappInteractions'](_0x374739);}})['then'](function(_0x4e45fd){if(_0x4e45fd){_0x1cad5f=_0x4e45fd['length'];if(!_0x570ded[_0xd893('0x3c')][_0xd893('0xc1')]('nolimit')){_0x374739[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x570ded[_0xd893('0x3c')]['limit']);_0x374739[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x570ded['query'][_0xd893('0x19')]);}return _0xe2615a['getWhatsappInteractions'](_0x374739);}})[_0xd893('0x20')](function(_0x5839d9){if(_0x5839d9){return _0x5839d9?{'count':_0x1cad5f,'rows':_0x5839d9}:null;}})[_0xd893('0x20')](respondWithResult(_0x2503ed,null))['catch'](handleError(_0x2503ed,null));};exports['login']=function(_0x5423f9,_0x3a6070,_0x2718ec){var _0x4f9fa7;var _0x497fd3;var _0x459263;var _0x1e1a7b=!_[_0xd893('0x5e')](_0x5423f9[_0xd893('0x4f')]['id'])?_0x5423f9[_0xd893('0x4f')]['id']:!_[_0xd893('0x5e')](_0x5423f9[_0xd893('0x27')]['id'])?_0x5423f9[_0xd893('0x27')]['id']:null;return db['User'][_0xd893('0x2d')]({'where':{'id':_0x1e1a7b,'role':{'$or':[_0xd893('0x26'),_0xd893('0x27'),_0xd893('0x21')]}},'attributes':['id',_0xd893('0x2f'),_0xd893('0xe4'),_0xd893('0xe5'),_0xd893('0x2e'),_0xd893('0x59'),_0xd893('0x93')]})[_0xd893('0x20')](function(_0x59b4f5){if(_0x59b4f5){if(_0x59b4f5[_0xd893('0x2e')]===_0xd893('0x21')){_0x4f9fa7=_0x59b4f5;if(_0x5423f9['body'][_0xd893('0x95')]){_0x459263=util[_0xd893('0xa0')](_0xd893('0xe6'),_0x4f9fa7[_0x5423f9['body'][_0xd893('0x95')]]);}else if(_0x5423f9['body'][_0xd893('0xe7')]){_0x459263=util[_0xd893('0xa0')]('SIP/%s',_0x5423f9[_0xd893('0x55')][_0xd893('0xe7')]);}else{_0x459263=util[_0xd893('0xa0')]('SIP/%s',_0x4f9fa7[_0xd893('0x2f')]);}socket['to'](util[_0xd893('0xa0')]('user:%s',_0x4f9fa7[_0xd893('0x2f')]))['emit'](_0xd893('0xe8'),{'user':{'id':_0x4f9fa7['id'],'name':_0x4f9fa7[_0xd893('0x2f')]},'ip':_0x5423f9[_0xd893('0xe9')]['x-forwarded-for']||_0x5423f9[_0xd893('0xea')]['remoteAddress']||_0x5423f9[_0xd893('0xeb')][_0xd893('0xec')]||_0x5423f9['connection'][_0xd893('0xeb')][_0xd893('0xec')]});return db['UserVoiceQueueRt'][_0xd893('0x24')]({'where':{'membername':_0x4f9fa7[_0xd893('0x2f')]},'individualHooks':!![]});}}else{throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))](_0xd893('0xed'));}})['then'](function(){if(_0x4f9fa7){return _0x4f9fa7[_0xd893('0xee')]({'raw':!![]});}})['then'](function(_0x19c08c){if(_0x4f9fa7){if(_0x19c08c){_0x497fd3=_0x19c08c;if(_0x497fd3[_0xd893('0x63')]){var _0x29f642=_0x497fd3[_0xd893('0x2a')](function(_0x584c6b){var _0x37cfd5={'membername':_0x4f9fa7[_0xd893('0x2f')],'UserId':_0x4f9fa7['id'],'queue_name':_0x584c6b['name'],'VoiceQueueId':_0x584c6b['id'],'interface':_0x459263,'paused':_0x4f9fa7[_0xd893('0x93')]||![],'penalty':_0x584c6b['UserVoiceQueue.penalty']||0x0};return db['UserVoiceQueueRt'][_0xd893('0xa1')](_0x37cfd5);});return Promise['all'](_0x29f642);}}}})['then'](function(){if(_0x4f9fa7){return db[_0xd893('0xef')][_0xd893('0x43')]({'where':{'membername':_0x4f9fa7[_0xd893('0x2f')],'exitAt':null}});}})[_0xd893('0x20')](function(_0x373524){if(_0x4f9fa7){var _0x45d460=[];_0x373524[_0xd893('0xf0')](function(_0x446081){_0x45d460[_0xd893('0x42')](_0x446081['update']({'exitAt':moment()[_0xd893('0xa0')](_0xd893('0xf1'))}));});return Promise[_0xd893('0x4c')](_0x45d460);}})[_0xd893('0x20')](function(){if(_0x4f9fa7){var _0x51c45a=[];var _0x51a66e=[];var _0x30ca12=utils[_0xd893('0xf2')]();var _0x3c89d9={'membername':_0x4f9fa7[_0xd893('0x2f')],'interface':_0x459263,'enterAt':moment()[_0xd893('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4f9fa7[_0xd893('0x2e')],'internal':_0x4f9fa7[_0xd893('0x59')]};_0x30ca12['forEach'](function(_0x1af7f2){_0x51c45a[_0xd893('0x42')](_['merge']({'channel':_0x1af7f2,'type':'LOGIN','data1':_0x5423f9['body'][_0xd893('0xf3')],'data2':_0x459263},_0x3c89d9));if(_0x4f9fa7[_0xd893('0x93')]){_0x51a66e[_0xd893('0x42')](_[_0xd893('0x52')]({'channel':_0x1af7f2,'type':_0xd893('0xf4'),'data1':'LOGININPAUSE'},_0x3c89d9));}});return db['MemberReport'][_0xd893('0x81')](_0x51c45a[_0xd893('0xbe')](_0x51a66e),{'individualHooks':!![]});}})[_0xd893('0x20')](function(){if(_0x4f9fa7){return _0x4f9fa7[_0xd893('0x1f')]({'online':!![],'lastLoginAt':moment()[_0xd893('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4f9fa7[_0xd893('0x93')]||![],'mailPause':_0x4f9fa7[_0xd893('0x93')]||![],'chatPause':_0x4f9fa7[_0xd893('0x93')]||![],'faxPause':_0x4f9fa7[_0xd893('0x93')]||![],'smsPause':_0x4f9fa7[_0xd893('0x93')]||![],'openchannelPause':_0x4f9fa7['loginInPause']||![],'whatsappPause':_0x4f9fa7[_0xd893('0x93')]||![],'pauseType':_0x4f9fa7[_0xd893('0x93')]?_0xd893('0xf5'):null,'interface':_0x459263,'lastPauseAt':moment()['format'](_0xd893('0xf1'))});}})['then'](function(_0xc0ba62){if(_0x5423f9[_0xd893('0xf6')]){return _0x2718ec();}else{return Promise[_0xd893('0xf7')](_0xc0ba62)[_0xd893('0x20')](respondWithResult(_0x3a6070,null));}})['catch'](handleError(_0x3a6070,null));};exports[_0xd893('0xf8')]=function(_0x3d81c1,_0x1dc22c){var _0x314c42;return db[_0xd893('0x32')]['find']({'where':{'id':_0x3d81c1[_0xd893('0x4f')]['id'],'role':_0xd893('0x21')},'attributes':['id',_0xd893('0x2f'),_0xd893('0x2e')]})[_0xd893('0x20')](handleEntityNotFound(_0x1dc22c,null))[_0xd893('0x20')](function(_0x54e561){if(_0x54e561){_0x314c42=_0x54e561;return db[_0xd893('0xa7')][_0xd893('0x24')]({'where':{'membername':_0x314c42[_0xd893('0x2f')]},'individualHooks':!![]});}})[_0xd893('0x20')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x314c42['name'],'exitAt':null}});})[_0xd893('0x20')](function(_0x2d562f){var _0x590d31=[];_0x2d562f['forEach'](function(_0x1dc46d){_0x590d31[_0xd893('0x42')](_0x1dc46d[_0xd893('0x1f')]({'exitAt':moment()[_0xd893('0xa0')](_0xd893('0xf1'))}));});return Promise[_0xd893('0x4c')](_0x590d31);})['then'](function(){return _0x314c42[_0xd893('0x1f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xd893('0x20')](respondWithResult(_0x1dc22c,null))[_0xd893('0x4d')](handleError(_0x1dc22c,null));};exports[_0xd893('0xf9')]=function(_0x5d9fe9,_0x3f17cb){var _0x386167;return db[_0xd893('0xa7')][_0xd893('0x1f')]({'paused':0x1},{'where':{'UserId':_0x5d9fe9[_0xd893('0x4f')]['id']},'individualHooks':!![]})[_0xd893('0x20')](function(){return db[_0xd893('0x32')][_0xd893('0x2d')]({'where':{'id':_0x5d9fe9['params']['id'],'role':_0xd893('0x21')},'attributes':['id',_0xd893('0x2f'),_0xd893('0x2e'),_0xd893('0x59'),_0xd893('0x95'),_0xd893('0x9f')]});})[_0xd893('0x20')](handleEntityNotFound(_0x3f17cb,null))['then'](function(_0xf554d9){if(_0xf554d9){_0x386167=_0xf554d9;return db[_0xd893('0xef')][_0xd893('0x43')]({'where':{'membername':_0x386167[_0xd893('0x2f')],'type':'PAUSE','exitAt':null}});}})[_0xd893('0x20')](function(_0x5779a9){if(_0x5779a9[_0xd893('0x63')]){var _0x3d119d=moment()[_0xd893('0xa0')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x1aaa31=0x0,_0x77dc08=_0x5779a9[_0xd893('0x63')];_0x1aaa31<_0x77dc08;_0x1aaa31++){_0x5779a9[_0x1aaa31]['updateAttributes']({'exitAt':_0x3d119d});}}})[_0xd893('0x20')](function(){var _0x5fd67c=[];var _0x33ea59=utils[_0xd893('0xf2')]();_0x33ea59[_0xd893('0xf0')](function(_0x3c385c){_0x5fd67c[_0xd893('0x42')]({'channel':_0x3c385c,'membername':_0x386167[_0xd893('0x2f')],'interface':_['isNil'](_0x386167[_0xd893('0x95')])?util[_0xd893('0xa0')](_0xd893('0xfa'),_0x386167['name']):_0x386167[_0xd893('0x95')],'type':_0xd893('0xf4'),'enterAt':moment()[_0xd893('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x5d9fe9[_0xd893('0x55')][_0xd893('0xfb')]||_0xd893('0xfc'),'role':_0x386167[_0xd893('0x2e')],'internal':_0x386167[_0xd893('0x59')]});});return db[_0xd893('0xef')][_0xd893('0x81')](_0x5fd67c,{'individualHooks':!![]});})[_0xd893('0x20')](function(){return _0x386167[_0xd893('0x1f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5d9fe9[_0xd893('0x55')][_0xd893('0xfb')]||_0xd893('0xfc'),'lastPauseAt':moment()[_0xd893('0xa0')](_0xd893('0xf1'))});})[_0xd893('0x20')](respondWithResult(_0x3f17cb,null))[_0xd893('0x4d')](handleError(_0x3f17cb,null));};exports[_0xd893('0xfd')]=function(_0x2cb652,_0x87916c){if(_0x2cb652[_0xd893('0x55')][_0xd893('0x92')]&&!utils['isValidChannel'](_0x2cb652[_0xd893('0x55')]['channel'])){throw new APIBadRequestError(util[_0xd893('0xa0')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x2cb652[_0xd893('0x55')][_0xd893('0x92')]));}return db[_0xd893('0x32')][_0xd893('0x2d')]({'where':{'id':_0x2cb652[_0xd893('0x4f')]['id']},'attributes':['id',_0xd893('0x2f'),'role',_0xd893('0x59'),_0xd893('0x95'),_0xd893('0x9f'),_0xd893('0x94'),_0xd893('0xfe'),'chatPause',_0xd893('0xff'),_0xd893('0x100'),'smsPause',_0xd893('0x101'),_0xd893('0x102'),_0xd893('0x103')]})[_0xd893('0x20')](function(_0x2b9589){if(!_0x2b9589){throw new APINotFoundError(util[_0xd893('0xa0')](_0xd893('0x104'),_0x2cb652[_0xd893('0x4f')]['id']));}return _0x2b9589[_0xd893('0xfd')](_0x2cb652[_0xd893('0x55')]['channel']);})['then'](respondWithResult(_0x87916c,null))[_0xd893('0x4d')](APIHandleError(_0x87916c));};exports[_0xd893('0x105')]=function(_0x13f295,_0x18084e){var _0x2f60f8={};var _0x3d1f8c={};var _0x2b8c6b;var _0x444a66;return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x13f295[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x18084e,null))[_0xd893('0x20')](function(_0x20f765){if(_0x20f765){_0x2b8c6b=_0x20f765;_0x3d1f8c[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0x106')][_0xd893('0x33')]);_0x3d1f8c[_0xd893('0x3c')]=_['keys'](_0x13f295['query']);_0x3d1f8c[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x3d1f8c[_0xd893('0xc7')],_0x3d1f8c['query']);_0x2f60f8[_0xd893('0x41')]=_[_0xd893('0xcb')](_0x3d1f8c[_0xd893('0xc7')],qs[_0xd893('0xcc')](_0x13f295[_0xd893('0x3c')]['fields']));_0x2f60f8[_0xd893('0x41')]=_0x2f60f8[_0xd893('0x41')]['length']?_0x2f60f8[_0xd893('0x41')]:_0x3d1f8c[_0xd893('0xc7')];_0x2f60f8[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x13f295[_0xd893('0x3c')]['sort']);_0x2f60f8[_0xd893('0xcf')]=qs['filters'](_[_0xd893('0xd0')](_0x13f295['query'],_0x3d1f8c[_0xd893('0xca')]));if(_0x13f295[_0xd893('0x3c')][_0xd893('0x28')]){_0x2f60f8[_0xd893('0xcf')]=_['merge'](_0x2f60f8[_0xd893('0xcf')],{'$or':_['map'](_0x2f60f8[_0xd893('0x41')],function(_0x53d4a2){var _0x5855f8={};_0x5855f8[_0x53d4a2]={'$like':'%'+_0x13f295[_0xd893('0x3c')]['filter']+'%'};return _0x5855f8;})});}_0x2f60f8=_[_0xd893('0x52')]({},_0x2f60f8,_0x13f295[_0xd893('0x53')]);return _0x2b8c6b[_0xd893('0x105')](_0x2f60f8);}})[_0xd893('0x20')](function(_0x4aaf1b){if(_0x4aaf1b){_0x444a66=_0x4aaf1b[_0xd893('0x63')];if(!_0x13f295[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0xd2'))){_0x2f60f8[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x13f295[_0xd893('0x3c')]['limit']);_0x2f60f8['offset']=qs['offset'](_0x13f295[_0xd893('0x3c')][_0xd893('0x19')]);}return _0x2b8c6b[_0xd893('0x105')](_0x2f60f8);}})['then'](function(_0xc786e3){if(_0xc786e3){return _0xc786e3?{'count':_0x444a66,'rows':_0xc786e3}:null;}})[_0xd893('0x20')](respondWithResult(_0x18084e,null))[_0xd893('0x4d')](handleError(_0x18084e,null));};exports[_0xd893('0x107')]=function(_0x16ffe3,_0xaad984){var _0x500350=_0x16ffe3['params']['id'];var _0x19a4ad=_0x16ffe3[_0xd893('0x55')]?_0x16ffe3[_0xd893('0x55')][_0xd893('0x9b')]:null;var _0x41a734=[];return Promise[_0xd893('0xf7')]()[_0xd893('0x20')](function(){if(!_0x19a4ad)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x500350}});})[_0xd893('0x20')](function(_0x8310e0){if(!_0x8310e0)throw new APINotFoundError(util['format'](_0xd893('0x104'),_0x16ffe3[_0xd893('0x4f')]['id']));return db[_0xd893('0x60')][_0xd893('0x108')](function(_0x7f8697){return _0x8310e0[_0xd893('0x107')](_0x19a4ad,{'transaction':_0x7f8697})[_0xd893('0x20')](function(){return db[_0xd893('0x106')][_0xd893('0x43')]({'where':{'id':{'$in':_0x19a4ad}}});})[_0xd893('0x20')](function(_0x494e6e){var _0x160f28=_[_0xd893('0x2a')](_0x494e6e,function(_0xa34262){return _0xa34262['getAssociatedQueues']();});return Promise[_0xd893('0x4c')](_0x160f28);})[_0xd893('0x20')](function(_0x2e9649){_0x41a734=_[_0xd893('0x109')](_0x2e9649);var _0x2b2d83=_[_0xd893('0x2a')](_0x41a734,function(_0x3a4cca){return _0x3a4cca['addAgent'](_0x8310e0['id'],{'transaction':_0x7f8697});});return Promise[_0xd893('0x4c')](_0x2b2d83);})[_0xd893('0x20')](function(){if(!_0x8310e0[_0xd893('0x9f')])return;var _0x1650de=_['filter'](_0x41a734,function(_0x259b0a){return _0x259b0a['getDataValue'](_0xd893('0x92'))==='Voice';});var _0x1e3ee3=_[_0xd893('0x2a')](_0x1650de,function(_0x35fdde){return db[_0xd893('0xa7')][_0xd893('0xa1')]({'membername':_0x8310e0[_0xd893('0x2f')],'UserId':_0x8310e0['id'],'queue_name':_0x35fdde[_0xd893('0x2f')],'VoiceQueueId':_0x35fdde['id'],'interface':_[_0xd893('0x5e')](_0x8310e0[_0xd893('0x95')])?util[_0xd893('0xa0')](_0xd893('0xfa'),_0x8310e0[_0xd893('0x2f')]):_0x8310e0[_0xd893('0x95')],'paused':_0x8310e0['voicePause']||![],'penalty':_0x8310e0[_0xd893('0x99')]},{'transaction':_0x7f8697});});return Promise[_0xd893('0x4c')](_0x1e3ee3);})[_0xd893('0x20')](function(){return db[_0xd893('0x10a')][_0xd893('0x43')]({'where':{'teamId':{'$in':_0x19a4ad}}});})[_0xd893('0x20')](function(_0xe82801){var _0xf77f15=_[_0xd893('0x2a')](_0xe82801,function(_0x432c8f){return db[_0xd893('0x10b')][_0xd893('0x74')]({'UserId':_0x8310e0['id'],'VoicePrefixId':_0x432c8f[_0xd893('0x10c')]},{'transaction':_0x7f8697});});return Promise['all'](_0xf77f15);});});})[_0xd893('0x20')](function(){for(var _0x52a67c=0x0;_0x52a67c<_0x41a734[_0xd893('0x63')];_0x52a67c++){var _0xa41039=_0x41a734[_0x52a67c]['getDataValue']('channel');var _0x576b37=_0xa41039+_0xd893('0x9c');socket[_0xd893('0x22')]('user'+_0xa41039+'Queue:save',{'UserId':_0x500350,['queueField']:_0x41a734[_0x52a67c]['id']});}})[_0xd893('0x20')](respondWithStatusCode(_0xaad984,null))[_0xd893('0x4d')](APIHandleError(_0xaad984));};exports[_0xd893('0x10d')]=function(_0x4173cc,_0x1c5b6e){var _0x54499a=_0x4173cc['params']['id'];var _0x35299b=null;if(_0x4173cc[_0xd893('0x3c')][_0xd893('0x9b')]){_0x35299b=_['isArray'](_0x4173cc[_0xd893('0x3c')]['ids'])?_0x4173cc[_0xd893('0x3c')][_0xd893('0x9b')]:[_0x4173cc[_0xd893('0x3c')][_0xd893('0x9b')]];}var _0x22a4e6=[];return Promise[_0xd893('0xf7')]()[_0xd893('0x20')](function(){if(!_0x35299b)throw new APIBadRequestError(_0xd893('0x10e'));})[_0xd893('0x20')](function(){return db['User'][_0xd893('0xc0')]({'where':{'id':_0x54499a}});})[_0xd893('0x20')](function(_0x16eece){if(!_0x16eece)throw new APINotFoundError(util['format'](_0xd893('0x104'),_0x4173cc['params']['id']));return db['sequelize'][_0xd893('0x108')](function(_0x42ae64){return _0x16eece[_0xd893('0x10d')](_0x35299b,{'transaction':_0x42ae64})[_0xd893('0x20')](function(){return db['Team'][_0xd893('0x43')]({'where':{'id':{'$in':_0x35299b}}});})[_0xd893('0x20')](function(_0x36538b){var _0x5515e9=_[_0xd893('0x2a')](_0x36538b,function(_0x302fa4){return _0x302fa4[_0xd893('0x10f')]();});return Promise[_0xd893('0x4c')](_0x5515e9);})[_0xd893('0x20')](function(_0x472776){_0x22a4e6=_['flattenDeep'](_0x472776);var _0x3d52f4=_[_0xd893('0x2a')](_0x22a4e6,function(_0xc16fdf){return _0xc16fdf[_0xd893('0x110')](_0x16eece['id'],{'transaction':_0x42ae64});});return Promise['all'](_0x3d52f4);})[_0xd893('0x20')](function(){if(!_0x16eece[_0xd893('0x9f')])return;var _0x31f081=_[_0xd893('0x28')](_0x22a4e6,function(_0x353cce){return _0x353cce[_0xd893('0x111')](_0xd893('0x92'))==='Voice';});var _0x405bb2=_[_0xd893('0x2a')](_0x31f081,function(_0x2f9196){return db[_0xd893('0xa7')][_0xd893('0x24')]({'where':{'VoiceQueueId':_0x2f9196['id'],'UserId':_0x16eece['id']},'transaction':_0x42ae64});});return Promise['all'](_0x405bb2);})['then'](function(){return db[_0xd893('0x10a')][_0xd893('0x43')]({'where':{'teamId':{'$in':_0x35299b}}});})['then'](function(_0x58685c){var _0x3a54b0=_[_0xd893('0x2a')](_0x58685c,function(_0x14adb8){return db[_0xd893('0x10b')]['destroy']({'where':{'UserId':_0x16eece['id'],'VoicePrefixId':_0x14adb8[_0xd893('0x10c')]}},{'transaction':_0x42ae64});});return Promise[_0xd893('0x4c')](_0x3a54b0);});});})[_0xd893('0x20')](function(){for(var _0x53c151=0x0;_0x53c151<_0x22a4e6[_0xd893('0x63')];_0x53c151++){var _0x283689=_0x22a4e6[_0x53c151][_0xd893('0x111')]('channel');var _0xf7571a=_0x283689+_0xd893('0x9c');socket[_0xd893('0x22')]('user'+_0x283689+_0xd893('0xa6'),{'UserId':_0x54499a,['queueField']:_0x22a4e6[_0x53c151]['id']});}})[_0xd893('0x20')](respondWithStatusCode(_0x1c5b6e,null))[_0xd893('0x4d')](APIHandleError(_0x1c5b6e));};exports[_0xd893('0x112')]=function(_0x13a8cd,_0x3491e4){var _0x15ace5={};var _0x2e0182={};var _0x3f0dbb;var _0x2e88d4;return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x13a8cd[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x3491e4,null))[_0xd893('0x20')](function(_0x1ff035){if(_0x1ff035){_0x3f0dbb=_0x1ff035;_0x2e0182['model']=_[_0xd893('0xc8')](db[_0xd893('0xc2')]['rawAttributes']);_0x2e0182[_0xd893('0x3c')]=_[_0xd893('0xc8')](_0x13a8cd[_0xd893('0x3c')]);_0x2e0182[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x2e0182['model'],_0x2e0182[_0xd893('0x3c')]);_0x15ace5[_0xd893('0x41')]=_['intersection'](_0x2e0182['model'],qs[_0xd893('0xcc')](_0x13a8cd[_0xd893('0x3c')]['fields']));_0x15ace5['attributes']=_0x15ace5[_0xd893('0x41')][_0xd893('0x63')]?_0x15ace5[_0xd893('0x41')]:_0x2e0182[_0xd893('0xc7')];_0x15ace5[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x13a8cd[_0xd893('0x3c')][_0xd893('0xce')]);_0x15ace5[_0xd893('0xcf')]=qs['filters'](_['pick'](_0x13a8cd[_0xd893('0x3c')],_0x2e0182[_0xd893('0xca')]));if(_0x13a8cd['query']['filter']){_0x15ace5[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x15ace5[_0xd893('0xcf')],{'$or':_[_0xd893('0x2a')](_0x15ace5['attributes'],function(_0x32c754){var _0x2a3dbb={};_0x2a3dbb[_0x32c754]={'$like':'%'+_0x13a8cd[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x2a3dbb;})});}_0x15ace5=_[_0xd893('0x52')]({},_0x15ace5,_0x13a8cd[_0xd893('0x53')]);return _0x3f0dbb[_0xd893('0x112')](_0x15ace5);}})[_0xd893('0x20')](function(_0x29c39f){if(_0x29c39f){_0x2e88d4=_0x29c39f['length'];if(!_0x13a8cd['query'][_0xd893('0xc1')](_0xd893('0xd2'))){_0x15ace5[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x13a8cd['query'][_0xd893('0x1c')]);_0x15ace5[_0xd893('0x19')]=qs['offset'](_0x13a8cd[_0xd893('0x3c')][_0xd893('0x19')]);}return _0x3f0dbb[_0xd893('0x112')](_0x15ace5);}})[_0xd893('0x20')](function(_0x2e95c0){if(_0x2e95c0){return _0x2e95c0?{'count':_0x2e88d4,'rows':_0x2e95c0}:null;}})[_0xd893('0x20')](respondWithResult(_0x3491e4,null))[_0xd893('0x4d')](handleError(_0x3491e4,null));};exports[_0xd893('0x113')]=function(_0x41f5c0,_0x594d89){var _0x39d4cd={};var _0x1a63f5={};var _0xe481f0;return db[_0xd893('0x32')]['findOne']({'where':{'id':_0x41f5c0[_0xd893('0x4f')]['id']}})['then'](handleEntityNotFound(_0x594d89,null))[_0xd893('0x20')](function(_0x470337){if(_0x470337){_0xe481f0=_0x470337;_0x1a63f5[_0xd893('0xc7')]=_['keys'](db[_0xd893('0x32')][_0xd893('0x33')]);_0x1a63f5[_0xd893('0x3c')]=_['keys'](_0x41f5c0[_0xd893('0x3c')]);_0x1a63f5['filters']=_[_0xd893('0xcb')](_0x1a63f5[_0xd893('0xc7')],_0x1a63f5[_0xd893('0x3c')]);_0x39d4cd['attributes']=_['intersection'](_0x1a63f5['model'],qs[_0xd893('0xcc')](_0x41f5c0[_0xd893('0x3c')][_0xd893('0xcc')]));_0x39d4cd[_0xd893('0x41')]=_0x39d4cd[_0xd893('0x41')]['length']?_0x39d4cd[_0xd893('0x41')]:_0x1a63f5[_0xd893('0xc7')];_0x39d4cd[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x41f5c0[_0xd893('0x3c')][_0xd893('0xce')]);_0x39d4cd[_0xd893('0xcf')]=qs[_0xd893('0xca')](_[_0xd893('0xd0')](_0x41f5c0[_0xd893('0x3c')],_0x1a63f5[_0xd893('0xca')]));if(_0x41f5c0['query'][_0xd893('0x28')]){_0x39d4cd[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x39d4cd['where'],{'$or':_[_0xd893('0x2a')](_0x39d4cd['attributes'],function(_0x17301a){var _0x4f535c={};_0x4f535c[_0x17301a]={'$like':'%'+_0x41f5c0[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x4f535c;})});}_0x39d4cd[_0xd893('0xc7')]=db['User'];_0x39d4cd['as']=_0xd893('0x7c');_0x39d4cd=_[_0xd893('0x52')]({},_0x39d4cd,_0x41f5c0[_0xd893('0x53')]);return _0xe481f0[_0xd893('0xee')]({'include':[_0x39d4cd]});}})['then'](function(_0xaf2990){if(_0xaf2990){var _0x10c6ea={},_0x32f5d2=[];for(var _0x1f20fc=0x0;_0x1f20fc<_0xaf2990[_0xd893('0x63')];_0x1f20fc+=0x1){for(var _0x5cb2c1=0x0,_0xaf0cd4;_0x5cb2c1<_0xaf2990[_0x1f20fc][_0xd893('0x7c')][_0xd893('0x63')];_0x5cb2c1+=0x1){_0xaf0cd4=_0xaf2990[_0x1f20fc][_0xd893('0x7c')][_0x5cb2c1]['get']({'plain':!![]});_0x10c6ea[_0xaf0cd4['id']]=_0xaf0cd4;}}_0x10c6ea=_[_0xd893('0x114')](_0x10c6ea);for(var _0x537f89=qs[_0xd893('0x19')](_0x41f5c0[_0xd893('0x3c')][_0xd893('0x19')]);_0x537f89<_0x10c6ea[_0xd893('0x63')]&&_0x32f5d2['length']=_0x4fd7fb){_0x4da179=_0x4fd7fb;_0x5c2a86=0xc8;}else{_0x5c2a86=0xce;}_0x334651[_0xeb78('0x18')](_0x5c2a86);return _0x334651[_0xeb78('0x1f')](_0xeb78('0x20'),_0x4916d3+'-'+_0x4da179+'/'+_0x4fd7fb)[_0xeb78('0x1a')](_0x5bcd9a);}return null;};}function saveUpdates(_0x297c86){return function(_0x5ef18e){if(_0x5ef18e){return _0x5ef18e[_0xeb78('0x21')](_0x297c86)['then'](function(_0x1c8446){if(_0x1c8446[_0xeb78('0x22')]===_0xeb78('0x23')){socket[_0xeb78('0x24')]('userNotification:recalc:'+_0x1c8446['id'],_0x1c8446);}return _0x1c8446;});}return null;};}function removeEntity(_0x26138e){return function(_0x33f24b){if(_0x33f24b){return _0x33f24b['destroy']()[_0xeb78('0x25')](function(){var _0x28b77d=_0x33f24b[_0xeb78('0x26')]({'plain':!![]});if(_0x28b77d[_0xeb78('0x22')]===_0xeb78('0x27'))return;var _0x5dfa24=[{'name':_0xeb78('0x28'),'value':_0xeb78('0x29'),'ignore':!![]},{'name':_0xeb78('0x2a'),'value':_0xeb78('0x23'),'ignore':![]},{'name':_0xeb78('0x2b'),'value':'telephone','ignore':![]}];var _0x15fae0=_(_0x5dfa24)[_0xeb78('0x2c')](_0xeb78('0x2d'))[_0xeb78('0x2e')](_0xeb78('0x2f'))[_0xeb78('0x2f')]();if(_[_0xeb78('0x30')](_0x15fae0,_0x28b77d['role'])){return;}var _0x38b009=_[_0xeb78('0x31')](_0x5dfa24,['value',_0x28b77d[_0xeb78('0x22')]])[_0xeb78('0x32')];return db[_0xeb78('0x33')][_0xeb78('0x34')]({'where':{'type':_0x38b009,'resourceId':_0x28b77d['id']}})['then'](function(){return _0x33f24b;});})[_0xeb78('0x25')](function(){_0x26138e[_0xeb78('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dc138){return function(_0x43b4d3){if(!_0x43b4d3){_0x1dc138[_0xeb78('0x35')](0x194);}return _0x43b4d3;};}function handleError(_0x17f7e7,_0x177942){_0x177942=_0x177942||0x1f4;return function(_0x4d2362){logger[_0xeb78('0x36')](_0x4d2362['stack']);if(_0x4d2362[_0xeb78('0x32')]){delete _0x4d2362[_0xeb78('0x32')];}_0x17f7e7[_0xeb78('0x18')](_0x177942)[_0xeb78('0x37')](_0x4d2362);};}function getUserAttributes(){return _(db[_0xeb78('0x38')][_0xeb78('0x39')])[_0xeb78('0x2e')](function(_0x4c6651){return{'name':_0x4c6651[_0xeb78('0x3a')],'type':_0x4c6651[_0xeb78('0x3b')]['key']};})[_0xeb78('0x2c')](function(_0x26621e){return!['password',_0xeb78('0x3c'),'previousPasswords',_0xeb78('0x3d'),_0xeb78('0x3e'),'md5secret'][_0xeb78('0x30')](_0x26621e[_0xeb78('0x32')]);})['value']();}exports[_0xeb78('0x3f')]=function(_0xc4fcd8,_0x2f89da){var _0x5d3098={},_0x2376e7={'count':0x0,'rows':[]};var _0x5bb806=getUserAttributes();_0x5d3098=qs['getOptions'](_0x5bb806,_0xc4fcd8);var _0x5d8974={'where':_0x5d3098['where']};return db['User'][_0xeb78('0x1e')](_0x5d8974)[_0xeb78('0x25')](function(_0xa75b23){_0x2376e7[_0xeb78('0x1e')]=_0xa75b23;if(_0xc4fcd8[_0xeb78('0x40')][_0xeb78('0x41')]){_0x5d3098[_0xeb78('0x42')]=[{'all':!![]}];}if(_0xc4fcd8[_0xeb78('0x40')][_0xeb78('0x43')]===_0xeb78('0x44')){_0x5d3098['include']=[{'model':db[_0xeb78('0x45')],'as':'userSetting'}];}if(!_[_0xeb78('0x30')](_0x5d3098[_0xeb78('0x46')],'id')){_0x5d3098['attributes']['push']('id');}return db[_0xeb78('0x38')][_0xeb78('0x47')](_0x5d3098);})['then'](function(_0x5a58a3){_0x2376e7[_0xeb78('0x48')]=_0x5a58a3;if(_0xc4fcd8[_0xeb78('0x40')][_0xeb78('0x49')]===_0xeb78('0x44')){var _0x280ea2=[];for(var _0x50d3f9=0x0;_0x50d3f9<_0x2376e7[_0xeb78('0x48')]['length'];_0x50d3f9++){_0x280ea2[_0xeb78('0x4a')](get_open_tabs(_0xeb78('0x4b'),_0x2376e7[_0xeb78('0x48')][_0x50d3f9][_0xeb78('0x4c')]));_0x280ea2['push'](get_open_tabs('sms',_0x2376e7[_0xeb78('0x48')][_0x50d3f9]['dataValues']));_0x280ea2[_0xeb78('0x4a')](get_open_tabs(_0xeb78('0x4d'),_0x2376e7['rows'][_0x50d3f9][_0xeb78('0x4c')]));_0x280ea2[_0xeb78('0x4a')](get_open_tabs(_0xeb78('0x4e'),_0x2376e7[_0xeb78('0x48')][_0x50d3f9]['dataValues']));_0x280ea2['push'](get_open_tabs(_0xeb78('0x4f'),_0x2376e7[_0xeb78('0x48')][_0x50d3f9]['dataValues']));_0x280ea2[_0xeb78('0x4a')](get_open_tabs(_0xeb78('0x50'),_0x2376e7['rows'][_0x50d3f9][_0xeb78('0x4c')]));}return Promise[_0xeb78('0x51')](_0x280ea2)[_0xeb78('0x25')](function(){return _0x2376e7;});}else{return _0x2376e7;}})[_0xeb78('0x25')](respondWithFilteredResult(_0x2f89da,_0x5d3098))[_0xeb78('0x52')](handleError(_0x2f89da,null));};exports[_0xeb78('0x53')]=function(_0x15fc63,_0x488ac4){var _0x4bb4b8=getUserAttributes();_0x15fc63[_0xeb78('0x40')]['id']=_0x15fc63['params']['id'];var _0x284332=qs[_0xeb78('0x54')](_0x4bb4b8,_0x15fc63);if(_0x15fc63[_0xeb78('0x40')][_0xeb78('0x41')]){_0x284332['include']=[{'all':!![]}];}if(_0x15fc63[_0xeb78('0x40')]['userSetting']===_0xeb78('0x44')){_0x284332['include']=[{'model':db[_0xeb78('0x45')],'as':_0xeb78('0x43')}];}_0x284332=_[_0xeb78('0x55')]({},_0x284332,_0x15fc63[_0xeb78('0x56')]);if(!_['includes'](_0x284332['attributes'],'id')){_0x284332[_0xeb78('0x46')][_0xeb78('0x4a')]('id');}return db[_0xeb78('0x38')][_0xeb78('0x31')](_0x284332)['then'](handleEntityNotFound(_0x488ac4,null))[_0xeb78('0x25')](function(_0x2507a1){var _0x189b6f=[];values=_0x2507a1;if(_0x15fc63[_0xeb78('0x40')][_0xeb78('0x49')]===_0xeb78('0x44')){_0x189b6f[_0xeb78('0x4a')](get_open_tabs(_0xeb78('0x4b'),_0x2507a1['dataValues']));_0x189b6f[_0xeb78('0x4a')](get_open_tabs('sms',_0x2507a1[_0xeb78('0x4c')]));_0x189b6f[_0xeb78('0x4a')](get_open_tabs(_0xeb78('0x4f'),_0x2507a1['dataValues']));_0x189b6f[_0xeb78('0x4a')](get_open_tabs(_0xeb78('0x50'),_0x2507a1[_0xeb78('0x4c')]));_0x189b6f[_0xeb78('0x4a')](get_open_tabs(_0xeb78('0x4d'),_0x2507a1[_0xeb78('0x4c')]));_0x189b6f[_0xeb78('0x4a')](get_open_tabs(_0xeb78('0x4e'),_0x2507a1[_0xeb78('0x4c')]));return Promise[_0xeb78('0x51')](_0x189b6f);}else{return values;}})[_0xeb78('0x25')](function(){return values;})[_0xeb78('0x25')](respondWithResult(_0x488ac4,null))['catch'](handleError(_0x488ac4,null));};exports[_0xeb78('0x21')]=function(_0x1b4bfa,_0x36d6d7){if(_0x1b4bfa[_0xeb78('0x57')]['id']){delete _0x1b4bfa[_0xeb78('0x57')]['id'];}delete _0x1b4bfa[_0xeb78('0x57')][_0xeb78('0x22')];return db[_0xeb78('0x38')]['find']({'where':{'id':_0x1b4bfa['params']['id']}})[_0xeb78('0x25')](handleEntityNotFound(_0x36d6d7,null))[_0xeb78('0x25')](saveUpdates(_0x1b4bfa[_0xeb78('0x57')],null))[_0xeb78('0x25')](respondWithResult(_0x36d6d7,null))['catch'](handleError(_0x36d6d7,null));};exports[_0xeb78('0x58')]=function(_0x4e4556,_0x1a5ef2){return db['User'][_0xeb78('0x58')]()['then'](respondWithResult(_0x1a5ef2,null))[_0xeb78('0x52')](handleError(_0x1a5ef2,null));};exports['addContacts']=function(_0x27b4ec,_0x2e499c){return db[_0xeb78('0x38')][_0xeb78('0x31')]({'where':{'id':_0x27b4ec[_0xeb78('0x59')]['id']}})[_0xeb78('0x25')](handleEntityNotFound(_0x2e499c,null))[_0xeb78('0x25')](function(_0x2cf382){if(_0x2cf382){return _0x2cf382['addContacts'](_0x27b4ec[_0xeb78('0x57')]['ids'],_[_0xeb78('0x5a')](_0x27b4ec[_0xeb78('0x57')],[_0xeb78('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x2e499c,null))['catch'](handleError(_0x2e499c,null));};function validateUser(_0x4f1c1c){return new Promise(function(_0x5b7c7f,_0x1bd047){if(_0x4f1c1c[_0xeb78('0x5c')])return _0x5b7c7f(_0x4f1c1c);return db[_0xeb78('0x5d')]['findById'](0x1)[_0xeb78('0x25')](function(_0x1ca7d9){if(_0x1ca7d9['securePassword'])authService[_0xeb78('0x5e')](_0x4f1c1c[_0xeb78('0x5f')]);db['User'][_0xeb78('0x60')](_0xeb78('0x5c'))['then'](function(_0x15ea54){if(_['isNil'](_0x15ea54)){_0x4f1c1c[_0xeb78('0x5c')]=_0x1ca7d9[_0xeb78('0x61')]||0x1;return;}if(_[_0xeb78('0x62')](_0x1ca7d9[_0xeb78('0x61')])||_0x1ca7d9['min_internal']===_0x15ea54){_0x4f1c1c[_0xeb78('0x5c')]=_0x15ea54+0x1;return;}if(_0x1ca7d9[_0xeb78('0x61')]>_0x15ea54){_0x4f1c1c[_0xeb78('0x5c')]=_0x1ca7d9[_0xeb78('0x61')];return;}return db[_0xeb78('0x63')][_0xeb78('0x40')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xeb78('0x63')][_0xeb78('0x64')][_0xeb78('0x65')]})[_0xeb78('0x25')](function(_0xaea9b9){if(_0xaea9b9&&_0xaea9b9[_0xeb78('0x66')]){for(var _0x2ad283=0x0,_0xb883ab=_0xaea9b9[_0xeb78('0x66')];_0x2ad283<_0xb883ab&&_['isNil'](_0x4f1c1c['internal']);_0x2ad283++){if(_0x1ca7d9['min_internal']<=_0xaea9b9[_0x2ad283][_0xeb78('0x67')]){_0x4f1c1c[_0xeb78('0x5c')]=_0xaea9b9[_0x2ad283]['from'];}else if(_0x1ca7d9['min_internal']>_0xaea9b9[_0x2ad283][_0xeb78('0x67')]&&_0x1ca7d9[_0xeb78('0x61')]<=_0xaea9b9[_0x2ad283]['to']){_0x4f1c1c[_0xeb78('0x5c')]=_0x1ca7d9[_0xeb78('0x61')];}}}if(_[_0xeb78('0x62')](_0x4f1c1c['internal'])){_0x4f1c1c[_0xeb78('0x5c')]=_0x15ea54+0x1;}return _0x5b7c7f(_0x4f1c1c);});});})['catch'](function(_0x2baf33){_0x1bd047(_0x2baf33);});});}function updateUser(_0x588d98){return new Promise(function(_0x30965d,_0x6a2103){try{if(_0x588d98[_0xeb78('0x68')]){_0x588d98[_0xeb78('0x69')]=_0x588d98[_0xeb78('0x5c')];_0x588d98[_0xeb78('0x6a')]={'mailbox':_0x588d98['internal'],'password':_0x588d98[_0xeb78('0x5f')],'fullname':_0x588d98[_0xeb78('0x6b')],'email':_0x588d98['email']};}if(_0x588d98[_0xeb78('0x22')]===_0xeb78('0x23')){if(!_0x588d98['permissions'])_0x588d98[_0xeb78('0x6c')]=[_0xeb78('0x6d'),_0xeb78('0x6e'),_0xeb78('0x6f'),_0xeb78('0x70'),_0xeb78('0x71'),_0xeb78('0x72'),_0xeb78('0x73'),_0xeb78('0x74'),'107',_0xeb78('0x75'),_0xeb78('0x76'),'100',_0xeb78('0x77'),_0xeb78('0x78'),_0xeb78('0x79')];}_0x30965d(_0x588d98);}catch(_0x404f75){_0x6a2103(_0x404f75);}});}exports[_0xeb78('0x7a')]=function(_0x542d88,_0x2ff170){if(_0x542d88['user']['role']===_0xeb78('0x23'))throw new Error('Unauthorized');if(_0x542d88[_0xeb78('0x57')]['role']===_0xeb78('0x29')&&_0x542d88[_0xeb78('0x29')][_0xeb78('0x22')]!==_0xeb78('0x27')){throw new Error(_0xeb78('0x7b'));}if(_0x542d88['body']['role']===_0xeb78('0x27')&&_0x542d88[_0xeb78('0x29')][_0xeb78('0x22')]!==_0xeb78('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xeb78('0x7c')]([_0x542d88['body']])['then'](function(){return validateUser(_0x542d88[_0xeb78('0x57')]);})['then'](function(_0x46064d){return updateUser(_0x46064d)['then'](function(_0x2d9c08){if(_0x2d9c08[_0xeb78('0x22')]===_0xeb78('0x27')){_0x2d9c08[_0xeb78('0x7d')]=_0x542d88[_0xeb78('0x29')][_0xeb78('0x7d')];delete _0x2d9c08[_0xeb78('0x7e')];}return _0x2d9c08;});})['then'](function(_0x52e825){return db[_0xeb78('0x38')]['create'](_0x52e825,{'include':[{'model':db[_0xeb78('0x6a')],'as':'VoiceMail'}]});})[_0xeb78('0x25')](function(_0x470fb7){if(_0x542d88['body']['role']===_0xeb78('0x29'))return _0x470fb7;if(_0x542d88['user'][_0xeb78('0x22')]!=='user')return _0x470fb7;return db[_0xeb78('0x7f')][_0xeb78('0x31')]({'where':{'name':_0x470fb7[_0xeb78('0x22')]===_0xeb78('0x23')?_0xeb78('0x2a'):_0xeb78('0x2b'),'userProfileId':_0x542d88[_0xeb78('0x29')][_0xeb78('0x7e')]},'raw':!![]})['then'](function(_0x2c48a1){if(!_0x2c48a1||_0x2c48a1[_0xeb78('0x80')]!=0x0)return _0x470fb7;return db['UserProfileResource'][_0xeb78('0x7a')]({'name':_0x470fb7['name'],'resourceId':_0x470fb7['id'],'type':_0x2c48a1[_0xeb78('0x32')],'sectionId':_0x2c48a1['id']},{})['then'](function(){return _0x470fb7;});})['catch'](function(_0x23edee){logger[_0xeb78('0x36')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23edee);throw _0x23edee;});})['then'](respondWithResult(_0x2ff170,0xc9))['catch'](handleError(_0x2ff170,null));};exports[_0xeb78('0x81')]=function(_0x1b1376,_0x403131){var _0x47988b=_0x1b1376['body'];var _0x2a6c21=[];if(_0x1b1376[_0xeb78('0x29')]['role']===_0xeb78('0x23'))throw new Error(_0xeb78('0x82'));if(_[_0xeb78('0x83')](_0x47988b,[_0xeb78('0x22'),_0xeb78('0x29')])&&_0x1b1376[_0xeb78('0x29')][_0xeb78('0x22')]!==_0xeb78('0x27')){throw new Error(_0xeb78('0x7b'));}if(_['some'](_0x47988b,[_0xeb78('0x22'),_0xeb78('0x27')])&&_0x1b1376[_0xeb78('0x29')][_0xeb78('0x22')]!==_0xeb78('0x27')){throw new Error(_0xeb78('0x84'));}return licenseUtil[_0xeb78('0x7c')](_0x47988b)[_0xeb78('0x25')](function(){return validateUser(_0x47988b[0x0]);})['then'](function(){for(var _0x436e48=0x1;_0x436e48<_0x47988b[_0xeb78('0x66')];_0x436e48++){var _0x1ac1d7=_0x47988b[_0x436e48-0x1]['internal'];if(!_0x47988b[_0x436e48][_0xeb78('0x5c')])_0x47988b[_0x436e48][_0xeb78('0x5c')]=_0x1ac1d7+0x1;_0x2a6c21[_0xeb78('0x4a')](validateUser(_0x47988b[_0x436e48]));}return Promise[_0xeb78('0x51')](_0x2a6c21);})[_0xeb78('0x25')](function(){_0x2a6c21=[];for(var _0x50f8b1=0x0;_0x50f8b1<_0x47988b[_0xeb78('0x66')];_0x50f8b1++){_0x2a6c21[_0xeb78('0x4a')](updateUser(_0x47988b[_0x50f8b1]));}return Promise[_0xeb78('0x51')](_0x2a6c21);})[_0xeb78('0x25')](function(){_0x2a6c21=_0x47988b['map'](function(_0x42da04){return db[_0xeb78('0x38')][_0xeb78('0x7a')](_0x42da04,{'include':[{'model':db['VoiceMail'],'as':_0xeb78('0x6a')}]})[_0xeb78('0x25')](function(_0x3bbcf4){_0x42da04['id']=_0x3bbcf4['id'];return _0x42da04;});});return Promise[_0xeb78('0x51')](_0x2a6c21);})[_0xeb78('0x25')](function(_0x13503e){if(_0x1b1376[_0xeb78('0x57')][_0xeb78('0x22')]===_0xeb78('0x29'))return _0x13503e;if(_0x1b1376['user'][_0xeb78('0x22')]!==_0xeb78('0x29'))return _0x13503e;var _0x1c4bfa=_[_0xeb78('0x83')](_0x13503e,function(_0x30a474){return _0x30a474[_0xeb78('0x22')]===_0xeb78('0x23')||_0x30a474[_0xeb78('0x22')]===_0xeb78('0x85');});if(!_0x1c4bfa)return _0x13503e;return db[_0xeb78('0x7f')]['findAll']({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x1b1376[_0xeb78('0x29')][_0xeb78('0x7e')]},'raw':!![]})['then'](function(_0x4b146a){if(_[_0xeb78('0x86')](_0x4b146a)||!_[_0xeb78('0x83')](_0x4b146a,['autoAssociation',0x0]))return _0x13503e;_0x2a6c21=[];var _0x4acee7=_(_0x4b146a)[_0xeb78('0x2e')](function(_0x438145){if(_0x438145[_0xeb78('0x80')]===0x1)return;return _0x438145[_0xeb78('0x32')]===_0xeb78('0x2a')?_0xeb78('0x23'):_0xeb78('0x85');})[_0xeb78('0x87')]()[_0xeb78('0x2f')]();for(var _0x1ea621=0x0;_0x1ea621<_0x13503e[_0xeb78('0x66')];_0x1ea621++){if(!_[_0xeb78('0x30')](_0x4acee7,_0x13503e[_0x1ea621]['role']))return;var _0x3b4b70=_0x13503e[_0x1ea621][_0xeb78('0x22')]==='agent'?_0xeb78('0x2a'):_0xeb78('0x2b');_0x2a6c21[_0xeb78('0x4a')](db[_0xeb78('0x33')][_0xeb78('0x7a')]({'name':_0x13503e[_0x1ea621][_0xeb78('0x32')],'resourceId':_0x13503e[_0x1ea621]['id'],'type':_0x3b4b70,'sectionId':_[_0xeb78('0x31')](_0x4b146a,[_0xeb78('0x32'),_0x3b4b70])['id']},{}));}return Promise['all'](_0x2a6c21);});})[_0xeb78('0x25')](respondWithResult(_0x403131,0xc9))['catch'](handleError(_0x403131,null));};exports[_0xeb78('0x88')]=function(_0x45850e,_0x14ea03){if(_0x45850e['body']['id']){delete _0x45850e[_0xeb78('0x57')]['id'];}return db['User'][_0xeb78('0x31')]({'where':{'id':_0x45850e[_0xeb78('0x59')]['id']}})[_0xeb78('0x25')](function(_0x4a62fa){if(!_0x4a62fa)return null;if(_0x4a62fa['id']===_0x45850e[_0xeb78('0x29')]['id']){if(!_0x45850e[_0xeb78('0x57')][_0xeb78('0x89')]||!_0x45850e[_0xeb78('0x57')][_0xeb78('0x8a')]){throw new db[(_0xeb78('0x8b'))][(_0xeb78('0x8c'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x4a62fa[_0xeb78('0x8d')](_0x45850e[_0xeb78('0x57')][_0xeb78('0x89')])){throw new db[(_0xeb78('0x8b'))][(_0xeb78('0x8c'))](_0xeb78('0x8e'));}if(_0x45850e[_0xeb78('0x57')][_0xeb78('0x89')]===_0x45850e[_0xeb78('0x57')][_0xeb78('0x8a')]){throw new db[(_0xeb78('0x8b'))][(_0xeb78('0x8c'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x45850e[_0xeb78('0x29')][_0xeb78('0x22')]===_0xeb78('0x27')){if(!_0x45850e['body'][_0xeb78('0x8a')]){throw new db[(_0xeb78('0x8b'))][(_0xeb78('0x8c'))](_0xeb78('0x8f'));}}else if(_0x45850e[_0xeb78('0x29')][_0xeb78('0x22')]===_0xeb78('0x29')){if(!_0x45850e[_0xeb78('0x57')][_0xeb78('0x8a')]){throw new db['Sequelize'][(_0xeb78('0x8c'))](_0xeb78('0x8f'));}if(_0x4a62fa[_0xeb78('0x22')]!==_0xeb78('0x23')){throw new db[(_0xeb78('0x8b'))][(_0xeb78('0x8c'))](_0xeb78('0x82'));}}else{throw new db[(_0xeb78('0x8b'))]['ValidationError'](_0xeb78('0x82'));}return _0x4a62fa;})[_0xeb78('0x25')](handleEntityNotFound(_0x14ea03,null))[_0xeb78('0x25')](function(_0x31b842){return db[_0xeb78('0x5d')]['findOne']({'attributes':['id',_0xeb78('0x90'),_0xeb78('0x91'),'passwordHistoryLimit']})[_0xeb78('0x25')](function(_0x5e64b7){if(_0x5e64b7[_0xeb78('0x90')])authService[_0xeb78('0x5e')](_0x45850e[_0xeb78('0x57')][_0xeb78('0x8a')]);if(!_0x5e64b7[_0xeb78('0x91')]||!_0x31b842[_0xeb78('0x92')])return _0x31b842;authService[_0xeb78('0x93')](_0x45850e['body'][_0xeb78('0x8a')],_0x31b842['previousPasswords'],_0x5e64b7[_0xeb78('0x94')]);return _0x31b842;})[_0xeb78('0x25')](saveUpdates({'password':_0x45850e['body'][_0xeb78('0x8a')],'passwordResetAt':_0x45850e['user']['id']==_0x45850e['params']['id']?moment():null,'previousPasswords':authService[_0xeb78('0x95')](_0x45850e[_0xeb78('0x57')]['newPassword'],_0x31b842[_0xeb78('0x92')])},null));})[_0xeb78('0x25')](respondWithResult(_0x14ea03,null))['catch'](handleError(_0x14ea03,null));};exports['addQueues']=function(_0x318cfd,_0x11bc3f){var _0xcdb615=_0x318cfd['body'][_0xeb78('0x96')];return db['User']['find']({'where':{'id':_0x318cfd[_0xeb78('0x59')]['id']},'attributes':['id',_0xeb78('0x32'),'role','online',_0xeb78('0x97'),_0xeb78('0x98'),_0xeb78('0x99')]})['then'](handleEntityNotFound(_0x11bc3f,null))[_0xeb78('0x25')](function(_0x37ecbb){if(_0x37ecbb){if(!utils[_0xeb78('0x9a')](_0xcdb615)){throw new db[(_0xeb78('0x8b'))][(_0xeb78('0x8c'))]('Unknown\x20channel');}return _0x37ecbb[_0xeb78('0x9b')+_[_0xeb78('0x9c')](_0xcdb615['toLowerCase']())+_0xeb78('0x9d')](_0x318cfd[_0xeb78('0x57')][_0xeb78('0x5b')],{'penalty':_0x318cfd[_0xeb78('0x57')][_0xeb78('0x9e')]||0x0})[_0xeb78('0x9f')](function(_0x4f2ce2){for(var _0x5009d0=0x0;_0x5009d0<_0x318cfd[_0xeb78('0x57')][_0xeb78('0x5b')]['length'];_0x5009d0+=0x1){var _0x6896ac={'UserId':Number(_0x318cfd[_0xeb78('0x59')]['id'])};_0x6896ac[_[_0xeb78('0x9c')](_0xcdb615[_0xeb78('0xa0')]())+'QueueId']=Number(_0x318cfd[_0xeb78('0x57')][_0xeb78('0x5b')][_0x5009d0]);socket[_0xeb78('0x24')]('user'+_[_0xeb78('0x9c')](_0xcdb615[_0xeb78('0xa0')]())+_0xeb78('0xa1'),_0x6896ac);}return _0x4f2ce2;})[_0xeb78('0x25')](function(){if(_0xcdb615===_0xeb78('0xa2')){return db[_0xeb78('0xa3')][_0xeb78('0x47')]({'where':{'id':_0x318cfd[_0xeb78('0x57')][_0xeb78('0x5b')]||[]},'raw':!![],'attributes':['id',_0xeb78('0x32')]});}})['then'](function(_0x48d607){var _0x365aeb=_0x37ecbb[_0xeb78('0x26')]({'plain':!![]});var _0x2a986a=[];if(_0xcdb615===_0xeb78('0xa2')&&_0x365aeb[_0xeb78('0x22')]===_0xeb78('0x23')&&_0x365aeb['online']){for(let _0x7af83a=0x0;_0x7af83a<_0x48d607[_0xeb78('0x66')];_0x7af83a+=0x1){_0x2a986a[_0xeb78('0x4a')]({'membername':_0x365aeb[_0xeb78('0x32')],'UserId':_0x365aeb['id'],'queue_name':_0x48d607[_0x7af83a]['name'],'VoiceQueueId':_0x48d607[_0x7af83a]['id'],'interface':_[_0xeb78('0x62')](_0x365aeb[_0xeb78('0x99')])?util[_0xeb78('0xa4')](_0xeb78('0xa5'),_0x365aeb[_0xeb78('0x32')]):_0x365aeb[_0xeb78('0x99')],'paused':_0x365aeb['voicePause']||![],'penalty':_0x318cfd[_0xeb78('0x57')]['penalty']||0x0});}return Promise[_0xeb78('0x51')](_0x2a986a['map'](function(_0x12dc65){return db[_0xeb78('0xa6')][_0xeb78('0xa7')](_0x12dc65);}));}return _0x37ecbb;});}})[_0xeb78('0x25')](respondWithStatusCode(_0x11bc3f,null))[_0xeb78('0x52')](handleError(_0x11bc3f,null));};exports[_0xeb78('0xa8')]=function(_0x43a63c,_0x4f738f){var _0x1f7a09,_0x1bbe61;return db[_0xeb78('0x38')][_0xeb78('0x31')]({'where':{'id':_0x43a63c[_0xeb78('0x59')]['id']},'attributes':['id',_0xeb78('0x32'),_0xeb78('0x22')]})[_0xeb78('0x25')](handleEntityNotFound(_0x4f738f,null))[_0xeb78('0x25')](function(_0x275785){if(_0x275785){_0x1f7a09=_0x275785;if(!_0x43a63c[_0xeb78('0x40')]['channel']||!utils[_0xeb78('0x9a')](_0x43a63c[_0xeb78('0x40')][_0xeb78('0x96')])){throw new db[(_0xeb78('0x8b'))]['ValidationError'](_0xeb78('0xa9'));}return _0x275785['remove'+_[_0xeb78('0x9c')](_0x43a63c[_0xeb78('0x40')][_0xeb78('0x96')][_0xeb78('0xa0')]())+'Queues'](_0x43a63c['query'][_0xeb78('0x5b')]);}})[_0xeb78('0x25')](function(_0x1b74b9){if(_[_0xeb78('0xaa')](_0x43a63c[_0xeb78('0x40')]['ids'])){for(var _0x48b2d3=0x0;_0x48b2d3<_0x43a63c['query']['ids']['length'];_0x48b2d3+=0x1){_0x1bbe61={'UserId':Number(_0x43a63c[_0xeb78('0x59')]['id'])};_0x1bbe61[_[_0xeb78('0x9c')](_0x43a63c[_0xeb78('0x40')][_0xeb78('0x96')]['toLowerCase']())+'QueueId']=Number(_0x43a63c[_0xeb78('0x40')]['ids'][_0x48b2d3]);socket[_0xeb78('0x24')]('user'+_[_0xeb78('0x9c')](_0x43a63c[_0xeb78('0x40')][_0xeb78('0x96')][_0xeb78('0xa0')]())+_0xeb78('0xab'),_0x1bbe61);}}else{_0x1bbe61={'UserId':Number(_0x43a63c[_0xeb78('0x59')]['id'])};_0x1bbe61[_[_0xeb78('0x9c')](_0x43a63c[_0xeb78('0x40')][_0xeb78('0x96')][_0xeb78('0xa0')]())+_0xeb78('0xac')]=Number(_0x43a63c['query'][_0xeb78('0x5b')]);socket[_0xeb78('0x24')](_0xeb78('0x29')+_['capitalize'](_0x43a63c[_0xeb78('0x40')][_0xeb78('0x96')][_0xeb78('0xa0')]())+'Queue:remove',_0x1bbe61);}return _0x1b74b9;})[_0xeb78('0x25')](function(){if(_0x43a63c[_0xeb78('0x40')][_0xeb78('0x96')]===_0xeb78('0xa2')){return db[_0xeb78('0xa6')][_0xeb78('0x34')]({'where':{'UserId':_0x43a63c[_0xeb78('0x59')]['id'],'VoiceQueueId':_0x43a63c[_0xeb78('0x40')][_0xeb78('0x5b')]},'individualHooks':!![]})[_0xeb78('0x25')](function(){return _0x1f7a09;});}return _0x1f7a09;})[_0xeb78('0x25')](respondWithStatusCode(_0x4f738f,null))[_0xeb78('0x52')](handleError(_0x4f738f,null));};exports[_0xeb78('0xad')]=function(_0x8d1936,_0x45044c){_0x8d1936[_0xeb78('0x57')][_0xeb78('0xae')]=_0x8d1936[_0xeb78('0xaf')]['filename'];return db[_0xeb78('0x38')][_0xeb78('0x31')]({'where':{'id':_0x8d1936[_0xeb78('0x59')]['id']}})[_0xeb78('0x25')](handleEntityNotFound(_0x45044c,null))[_0xeb78('0x25')](saveUpdates(_0x8d1936['body'],null))['then'](respondWithResult(_0x45044c,null))[_0xeb78('0x52')](handleError(_0x45044c,null));};exports['getAvatar']=function(_0x212a28,_0xfd8f62){var _0x493e69=path[_0xeb78('0xb0')](config['root'],_0xeb78('0xb1'));return db[_0xeb78('0x38')][_0xeb78('0x31')]({'where':{'id':_0x212a28['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0xeb78('0x25')](handleEntityNotFound(_0xfd8f62,null))[_0xeb78('0x25')](function(_0x45253c){if(_0x45253c){if(_[_0xeb78('0x62')](_0x45253c[_0xeb78('0xae')])){return _0xfd8f62['download'](_0x493e69);}else{if(!fs[_0xeb78('0xb2')](path[_0xeb78('0xb0')](config[_0xeb78('0xb3')],_0xeb78('0xb4'),_0x45253c['userpic']))){return _0xfd8f62[_0xeb78('0xb5')](_0x493e69);}return _0xfd8f62['download'](path['join'](config[_0xeb78('0xb3')],_0xeb78('0xb4'),_0x45253c[_0xeb78('0xae')]));}}})['catch'](handleError(_0xfd8f62,null));};exports['getOpenTabs']=function(_0x1a553c,_0xf448d4){return db[_0xeb78('0x38')]['find']({'where':{'id':_0x1a553c[_0xeb78('0x59')]['id']},'attributes':['id']})[_0xeb78('0x25')](handleEntityNotFound(_0xf448d4,null))[_0xeb78('0x25')](function(_0x1e4a49){var _0x1a62b8=[];values=_0x1e4a49['dataValues'];_0x1a62b8['push'](get_open_tabs(_0xeb78('0x4b'),_0x1e4a49[_0xeb78('0x4c')]));_0x1a62b8['push'](get_open_tabs(_0xeb78('0xb6'),_0x1e4a49[_0xeb78('0x4c')]));_0x1a62b8[_0xeb78('0x4a')](get_open_tabs(_0xeb78('0x4f'),_0x1e4a49[_0xeb78('0x4c')]));_0x1a62b8['push'](get_open_tabs('whatsapp',_0x1e4a49[_0xeb78('0x4c')]));_0x1a62b8['push'](get_open_tabs('fax',_0x1e4a49[_0xeb78('0x4c')]));_0x1a62b8[_0xeb78('0x4a')](get_open_tabs('mail',_0x1e4a49['dataValues']));return Promise[_0xeb78('0x51')](_0x1a62b8);})[_0xeb78('0x25')](function(_0x17fd98){if(_0x17fd98){var _0x2209ec=_[_0xeb78('0x2e')](values[_0xeb78('0xb7')],function(_0x32ea41){return{'channel':'CHAT','id':_0x32ea41['id'],'createdAt':_0x32ea41[_0xeb78('0xb8')]};});var _0x1a801b=_[_0xeb78('0x2e')](values[_0xeb78('0xb9')],function(_0x421575){return{'channel':_0xeb78('0xba'),'id':_0x421575['id'],'createdAt':_0x421575['createdAt']};});var _0x3911dd=_[_0xeb78('0x2e')](values[_0xeb78('0xbb')],function(_0x29d271){return{'channel':_0xeb78('0xbc'),'id':_0x29d271['id'],'createdAt':_0x29d271['createdAt']};});var _0x25867e=_['map'](values[_0xeb78('0xbd')],function(_0x55e0b0){return{'channel':'MAIL','id':_0x55e0b0['id'],'createdAt':_0x55e0b0[_0xeb78('0xb8')]};});var _0x62a8cf=_[_0xeb78('0x2e')](values['SmsOpenTabs'],function(_0x5bee5e){return{'channel':'SMS','id':_0x5bee5e['id'],'createdAt':_0x5bee5e[_0xeb78('0xb8')]};});var _0x403f8b=_['map'](values[_0xeb78('0xbe')],function(_0x5b4d23){return{'channel':_0xeb78('0xbf'),'id':_0x5b4d23['id'],'createdAt':_0x5b4d23[_0xeb78('0xb8')]};});var _0x20e777=_[_0xeb78('0xc0')](_0x2209ec,_0x1a801b,_0x3911dd,_0x25867e,_0x62a8cf,_0x403f8b);var _0x2a13b8={'count':_0x20e777[_0xeb78('0x66')],'rows':_0x20e777};return _0x2a13b8;}else return null;})[_0xeb78('0x25')](respondWithResult(_0xf448d4,null))[_0xeb78('0x52')](handleError(_0xf448d4,null));};exports[_0xeb78('0xc1')]=function(_0x3bc146,_0x4d215a){var _0x5b479b={};return db[_0xeb78('0x38')][_0xeb78('0xc2')]({'where':{'id':_0x3bc146[_0xeb78('0x59')]['id']}})[_0xeb78('0x25')](function(_0x4244fd){if(!_0x4244fd){throw new APINotFoundError(util[_0xeb78('0xa4')](_0xeb78('0xc3'),_0x3bc146[_0xeb78('0x59')]['id']));}return contacts[_0xeb78('0x58')]();})[_0xeb78('0x25')](function(_0x58e27d){_0x3bc146[_0xeb78('0x40')][_0xeb78('0x38')]=_0x3bc146[_0xeb78('0x59')]['id'];_0x5b479b=qs['getOptions'](_0x58e27d,_0x3bc146);if(_0x3bc146[_0xeb78('0x40')]['hasOwnProperty']('includeAll')){_0x5b479b[_0xeb78('0x42')]=[{'model':db[_0xeb78('0xc4')],'as':'List','required':![]},{'model':db[_0xeb78('0xc5')],'as':'Tags','attributes':['id',_0xeb78('0x32'),'color'],'where':_0x3bc146[_0xeb78('0x40')]['tag']?{'id':_0x3bc146[_0xeb78('0x40')]['tag']}:undefined,'required':_0x3bc146['query'][_0xeb78('0xc6')]?!![]:![]}];}return contacts[_0xeb78('0x47')](_0x3bc146[_0xeb78('0x40')],_0x3bc146[_0xeb78('0x29')],_0x5b479b,_0x58e27d);})[_0xeb78('0x25')](respondWithFilteredResult(_0x4d215a,_0x5b479b))[_0xeb78('0x52')](APIHandleError(_0x4d215a));};exports[_0xeb78('0xc7')]=function(_0x15cb7c,_0x3cb6d7){var _0x2a357c;var _0x2fbc7f={};var _0x359307;return db['User'][_0xeb78('0xc2')]({'where':{'id':_0x15cb7c[_0xeb78('0x59')]['id']},'attributes':['id',_0xeb78('0x32'),_0xeb78('0x22')]})['then'](handleEntityNotFound(_0x3cb6d7,null))[_0xeb78('0x25')](function(_0x242878){if(!utils[_0xeb78('0x9a')](_0x15cb7c[_0xeb78('0x40')]['channel'])){throw new db['Sequelize'][(_0xeb78('0x8c'))](_0xeb78('0xa9'));}_0x2a357c=_0x242878;var _0xa22e97={};_0xa22e97['model']=_[_0xeb78('0xc8')](db[_[_0xeb78('0x9c')](_0x15cb7c[_0xeb78('0x40')][_0xeb78('0x96')])+_0xeb78('0xc9')]['rawAttributes']);_0xa22e97['query']=_[_0xeb78('0xc8')](_0x15cb7c[_0xeb78('0x40')]);_0xa22e97[_0xeb78('0xca')]=_[_0xeb78('0xcb')](_0xa22e97[_0xeb78('0xcc')],_0xa22e97[_0xeb78('0x40')]);_0x2fbc7f['attributes']=_[_0xeb78('0xcb')](_0xa22e97[_0xeb78('0xcc')],qs['fields'](_0x15cb7c[_0xeb78('0x40')][_0xeb78('0xcd')]));_0x2fbc7f[_0xeb78('0x46')]=_0x2fbc7f['attributes'][_0xeb78('0x66')]?_0x2fbc7f[_0xeb78('0x46')]:_0xa22e97[_0xeb78('0xcc')];_0x2fbc7f[_0xeb78('0xce')]=qs['sort'](_0x15cb7c['query'][_0xeb78('0xcf')]);_0x2fbc7f[_0xeb78('0xd0')]=qs[_0xeb78('0xca')](_['pick'](_0x15cb7c[_0xeb78('0x40')],_0xa22e97[_0xeb78('0xca')]));if(_0x15cb7c[_0xeb78('0x40')][_0xeb78('0x2c')]){_0x2fbc7f['where']=_[_0xeb78('0x55')](_0x2fbc7f[_0xeb78('0xd0')],{'$or':_[_0xeb78('0x2e')](_0x2fbc7f[_0xeb78('0x46')],function(_0x2a413e){var _0x441004={};_0x441004[_0x2a413e]={'$like':'%'+_0x15cb7c[_0xeb78('0x40')][_0xeb78('0x2c')]+'%'};return _0x441004;})});}_0x2fbc7f=_['merge']({},_0x2fbc7f,_0x15cb7c[_0xeb78('0x56')]);switch(_0x2a357c[_0xeb78('0x22')]){case _0xeb78('0x27'):return db[_['capitalize'](_0x15cb7c[_0xeb78('0x40')][_0xeb78('0x96')])+_0xeb78('0xc9')]['findAll'](_0x2fbc7f);case'user':case _0xeb78('0x23'):return _0x2a357c['get'+_[_0xeb78('0x9c')](_0x15cb7c['query'][_0xeb78('0x96')])+_0xeb78('0x9d')](_0x2fbc7f);default:throw new db[(_0xeb78('0x8b'))]['ValidationError'](_0xeb78('0xd1'));}})[_0xeb78('0x25')](function(_0x6b9a31){_0x359307=_0x6b9a31[_0xeb78('0x66')];if(!_0x15cb7c[_0xeb78('0x40')][_0xeb78('0xd2')](_0xeb78('0xd3'))){_0x2fbc7f[_0xeb78('0x1d')]=qs[_0xeb78('0x1d')](_0x15cb7c[_0xeb78('0x40')][_0xeb78('0x1d')]);_0x2fbc7f[_0xeb78('0x1b')]=qs['offset'](_0x15cb7c['query'][_0xeb78('0x1b')]);}switch(_0x2a357c['role']){case _0xeb78('0x27'):return db[_[_0xeb78('0x9c')](_0x15cb7c['query'][_0xeb78('0x96')])+_0xeb78('0xc9')][_0xeb78('0x47')](_0x2fbc7f);case _0xeb78('0x29'):case _0xeb78('0x23'):return _0x2a357c[_0xeb78('0x26')+_['capitalize'](_0x15cb7c[_0xeb78('0x40')][_0xeb78('0x96')])+_0xeb78('0x9d')](_0x2fbc7f);}})[_0xeb78('0x25')](function(_0x1126ef){return{'count':_0x359307,'rows':_0x1126ef};})[_0xeb78('0x25')](respondWithResult(_0x3cb6d7,null))[_0xeb78('0x52')](handleError(_0x3cb6d7,null));};exports[_0xeb78('0xd4')]=function(_0x57cfe3,_0x1f1c08){var _0x63c816={};var _0x473fc9={};var _0x5e9b66;var _0x474c22;return db[_0xeb78('0x38')][_0xeb78('0xc2')]({'where':{'id':_0x57cfe3[_0xeb78('0x59')]['id']}})[_0xeb78('0x25')](handleEntityNotFound(_0x1f1c08,null))['then'](function(_0x5da0c0){if(_0x5da0c0){_0x5e9b66=_0x5da0c0;_0x473fc9[_0xeb78('0xcc')]=_['keys'](db[_0xeb78('0xa6')][_0xeb78('0x39')]);_0x473fc9[_0xeb78('0x40')]=_[_0xeb78('0xc8')](_0x57cfe3[_0xeb78('0x40')]);_0x473fc9['filters']=_['intersection'](_0x473fc9[_0xeb78('0xcc')],_0x473fc9['query']);_0x63c816[_0xeb78('0x46')]=_[_0xeb78('0xcb')](_0x473fc9[_0xeb78('0xcc')],qs['fields'](_0x57cfe3[_0xeb78('0x40')][_0xeb78('0xcd')]));_0x63c816[_0xeb78('0x46')]=_0x63c816['attributes'][_0xeb78('0x66')]?_0x63c816[_0xeb78('0x46')]:_0x473fc9['model'];_0x63c816[_0xeb78('0xce')]=qs[_0xeb78('0xcf')](_0x57cfe3[_0xeb78('0x40')]['sort']);_0x63c816[_0xeb78('0xd0')]=qs[_0xeb78('0xca')](_['pick'](_0x57cfe3[_0xeb78('0x40')],_0x473fc9[_0xeb78('0xca')]));if(_0x57cfe3[_0xeb78('0x40')]['filter']){_0x63c816['where']=_[_0xeb78('0x55')](_0x63c816[_0xeb78('0xd0')],{'$or':_[_0xeb78('0x2e')](_0x63c816[_0xeb78('0x46')],function(_0xdcb360){var _0x57f6bf={};_0x57f6bf[_0xdcb360]={'$like':'%'+_0x57cfe3['query'][_0xeb78('0x2c')]+'%'};return _0x57f6bf;})});}_0x63c816=_[_0xeb78('0x55')]({},_0x63c816,_0x57cfe3['options']);return _0x5e9b66[_0xeb78('0xd4')](_0x63c816);}})[_0xeb78('0x25')](function(_0x4b4e1d){if(_0x4b4e1d){_0x474c22=_0x4b4e1d[_0xeb78('0x66')];if(!_0x57cfe3[_0xeb78('0x40')]['hasOwnProperty'](_0xeb78('0xd3'))){_0x63c816[_0xeb78('0x1d')]=qs['limit'](_0x57cfe3['query'][_0xeb78('0x1d')]);_0x63c816[_0xeb78('0x1b')]=qs[_0xeb78('0x1b')](_0x57cfe3['query'][_0xeb78('0x1b')]);}return _0x5e9b66['getVoiceQueuesRt'](_0x63c816);}})[_0xeb78('0x25')](function(_0x3336c5){if(_0x3336c5){return _0x3336c5?{'count':_0x474c22,'rows':_0x3336c5}:null;}})[_0xeb78('0x25')](respondWithResult(_0x1f1c08,null))[_0xeb78('0x52')](handleError(_0x1f1c08,null));};exports[_0xeb78('0xd5')]=function(_0x48d5d8,_0xda0823){var _0x3d23b9={};var _0x42d0b6={};var _0x704d78;var _0x19dcd8;return db[_0xeb78('0x38')][_0xeb78('0xc2')]({'where':{'id':_0x48d5d8[_0xeb78('0x59')]['id']}})[_0xeb78('0x25')](handleEntityNotFound(_0xda0823,null))[_0xeb78('0x25')](function(_0x5c532a){if(_0x5c532a){_0x704d78=_0x5c532a;_0x42d0b6[_0xeb78('0xcc')]=_[_0xeb78('0xc8')](db[_0xeb78('0xd6')]['rawAttributes']);_0x42d0b6[_0xeb78('0x40')]=_[_0xeb78('0xc8')](_0x48d5d8['query']);_0x42d0b6[_0xeb78('0xca')]=_[_0xeb78('0xcb')](_0x42d0b6[_0xeb78('0xcc')],_0x42d0b6[_0xeb78('0x40')]);_0x3d23b9[_0xeb78('0x46')]=_[_0xeb78('0xcb')](_0x42d0b6['model'],qs[_0xeb78('0xcd')](_0x48d5d8[_0xeb78('0x40')]['fields']));_0x3d23b9[_0xeb78('0x46')]=_0x3d23b9[_0xeb78('0x46')]['length']?_0x3d23b9[_0xeb78('0x46')]:_0x42d0b6[_0xeb78('0xcc')];_0x3d23b9[_0xeb78('0xce')]=qs[_0xeb78('0xcf')](_0x48d5d8[_0xeb78('0x40')]['sort']);_0x3d23b9[_0xeb78('0xd0')]=qs['filters'](_[_0xeb78('0xd7')](_0x48d5d8[_0xeb78('0x40')],_0x42d0b6[_0xeb78('0xca')]));if(_0x48d5d8[_0xeb78('0x40')][_0xeb78('0x2c')]){_0x3d23b9['where']=_[_0xeb78('0x55')](_0x3d23b9[_0xeb78('0xd0')],{'$or':_['map'](_0x3d23b9[_0xeb78('0x46')],function(_0x4679bf){var _0x1a99aa={};_0x1a99aa[_0x4679bf]={'$like':'%'+_0x48d5d8['query']['filter']+'%'};return _0x1a99aa;})});}_0x3d23b9=_[_0xeb78('0x55')]({},_0x3d23b9,_0x48d5d8[_0xeb78('0x56')]);return _0x704d78[_0xeb78('0xd5')](_0x3d23b9);}})[_0xeb78('0x25')](function(_0x5bfd56){if(_0x5bfd56){_0x19dcd8=_0x5bfd56[_0xeb78('0x66')];if(!_0x48d5d8[_0xeb78('0x40')][_0xeb78('0xd2')]('nolimit')){_0x3d23b9['limit']=qs[_0xeb78('0x1d')](_0x48d5d8['query'][_0xeb78('0x1d')]);_0x3d23b9[_0xeb78('0x1b')]=qs['offset'](_0x48d5d8[_0xeb78('0x40')][_0xeb78('0x1b')]);}return _0x704d78['getGroups'](_0x3d23b9);}})[_0xeb78('0x25')](function(_0x43a072){if(_0x43a072){return _0x43a072?{'count':_0x19dcd8,'rows':_0x43a072}:null;}})[_0xeb78('0x25')](respondWithResult(_0xda0823,null))[_0xeb78('0x52')](handleError(_0xda0823,null));};exports[_0xeb78('0xd8')]=function(_0x5528a9,_0x527550){var _0x11f922={'raw':!![],'where':{}};var _0x27ee83={};var _0x4f9ed1={'count':0x0,'rows':[]};return db[_0xeb78('0x38')]['findOne']({'where':{'id':_0x5528a9[_0xeb78('0x59')]['id']}})[_0xeb78('0x25')](handleEntityNotFound(_0x527550,null))['then'](function(_0x2b3d5b){if(_0x2b3d5b){_0x27ee83[_0xeb78('0xcc')]=_['keys'](db[_0xeb78('0xd9')]['rawAttributes']);_0x27ee83['query']=_[_0xeb78('0xc8')](_0x5528a9[_0xeb78('0x40')]);_0x27ee83[_0xeb78('0xca')]=_[_0xeb78('0xcb')](_0x27ee83[_0xeb78('0xcc')],_0x27ee83[_0xeb78('0x40')]);_0x11f922['attributes']=_[_0xeb78('0xcb')](_0x27ee83[_0xeb78('0xcc')],qs[_0xeb78('0xcd')](_0x5528a9[_0xeb78('0x40')][_0xeb78('0xcd')]));_0x11f922[_0xeb78('0x46')]=_0x11f922[_0xeb78('0x46')][_0xeb78('0x66')]?_0x11f922[_0xeb78('0x46')]:_0x27ee83[_0xeb78('0xcc')];if(!_0x5528a9[_0xeb78('0x40')]['hasOwnProperty'](_0xeb78('0xd3'))){_0x11f922[_0xeb78('0x1d')]=qs[_0xeb78('0x1d')](_0x5528a9['query'][_0xeb78('0x1d')]);_0x11f922[_0xeb78('0x1b')]=qs['offset'](_0x5528a9['query'][_0xeb78('0x1b')]);}_0x11f922['order']=qs[_0xeb78('0xcf')](_0x5528a9[_0xeb78('0x40')]['sort']);_0x11f922['where']=qs[_0xeb78('0xca')](_[_0xeb78('0xd7')](_0x5528a9[_0xeb78('0x40')],_0x27ee83['filters']));_0x11f922[_0xeb78('0xd0')][_0xeb78('0xda')]=_0x2b3d5b['id'];if(_0x5528a9[_0xeb78('0x40')]['filter']){_0x11f922['where']=_[_0xeb78('0x55')](_0x11f922[_0xeb78('0xd0')],{'$or':_[_0xeb78('0x2e')](_0x11f922['attributes'],function(_0x315205){var _0x1739d4={};_0x1739d4[_0x315205]={'$like':'%'+_0x5528a9[_0xeb78('0x40')][_0xeb78('0x2c')]+'%'};return _0x1739d4;})});}_0x11f922=_['merge']({},_0x11f922,_0x5528a9[_0xeb78('0x56')]);return db['VoiceRecording']['count']({'where':_0x11f922[_0xeb78('0xd0')]})[_0xeb78('0x25')](function(_0x4a8fa2){_0x4f9ed1[_0xeb78('0x1e')]=_0x4a8fa2;if(_0x5528a9['query']['includeAll']){_0x11f922['include']=[{'all':!![]}];}return db[_0xeb78('0xd9')][_0xeb78('0x47')](_0x11f922);})[_0xeb78('0x25')](function(_0xd9d7c4){_0x4f9ed1[_0xeb78('0x48')]=_0xd9d7c4;return _0x4f9ed1;});}})[_0xeb78('0x25')](respondWithFilteredResult(_0x527550,_0x11f922))[_0xeb78('0x52')](handleError(_0x527550,null));};exports[_0xeb78('0xdb')]=function(_0x36a6f4,_0xea2612){var _0x2342e0={'raw':!![],'where':{}};var _0x2af459={};var _0x3bc284={'count':0x0,'rows':[]};return db[_0xeb78('0x38')][_0xeb78('0xc2')]({'where':{'id':_0x36a6f4['params']['id']}})['then'](handleEntityNotFound(_0xea2612,null))[_0xeb78('0x25')](function(_0x208b86){if(_0x208b86){_0x2af459[_0xeb78('0xcc')]=_['keys'](db[_0xeb78('0xdc')]['rawAttributes']);_0x2af459[_0xeb78('0x40')]=_['keys'](_0x36a6f4[_0xeb78('0x40')]);_0x2af459[_0xeb78('0xca')]=_[_0xeb78('0xcb')](_0x2af459[_0xeb78('0xcc')],_0x2af459['query']);_0x2342e0[_0xeb78('0x46')]=_['intersection'](_0x2af459[_0xeb78('0xcc')],qs[_0xeb78('0xcd')](_0x36a6f4[_0xeb78('0x40')][_0xeb78('0xcd')]));_0x2342e0['attributes']=_0x2342e0[_0xeb78('0x46')][_0xeb78('0x66')]?_0x2342e0[_0xeb78('0x46')]:_0x2af459['model'];if(!_0x36a6f4['query'][_0xeb78('0xd2')](_0xeb78('0xd3'))){_0x2342e0[_0xeb78('0x1d')]=qs[_0xeb78('0x1d')](_0x36a6f4[_0xeb78('0x40')]['limit']);_0x2342e0[_0xeb78('0x1b')]=qs[_0xeb78('0x1b')](_0x36a6f4[_0xeb78('0x40')][_0xeb78('0x1b')]);}_0x2342e0['order']=qs['sort'](_0x36a6f4[_0xeb78('0x40')][_0xeb78('0xcf')]);_0x2342e0[_0xeb78('0xd0')]=qs[_0xeb78('0xca')](_[_0xeb78('0xd7')](_0x36a6f4[_0xeb78('0x40')],_0x2af459[_0xeb78('0xca')]));_0x2342e0['where'][_0xeb78('0xda')]=_0x208b86['id'];if(_0x36a6f4['query']['filter']){_0x2342e0[_0xeb78('0xd0')]=_[_0xeb78('0x55')](_0x2342e0['where'],{'$or':_[_0xeb78('0x2e')](_0x2342e0[_0xeb78('0x46')],function(_0x560f1c){var _0x18cacf={};_0x18cacf[_0x560f1c]={'$like':'%'+_0x36a6f4['query'][_0xeb78('0x2c')]+'%'};return _0x18cacf;})});}_0x2342e0=_[_0xeb78('0x55')]({},_0x2342e0,_0x36a6f4[_0xeb78('0x56')]);return db[_0xeb78('0xdc')]['count']({'where':_0x2342e0['where']})[_0xeb78('0x25')](function(_0x3b29a5){_0x3bc284['count']=_0x3b29a5;if(_0x36a6f4[_0xeb78('0x40')][_0xeb78('0x41')]){_0x2342e0[_0xeb78('0x42')]=[{'all':!![]}];}return db['ScreenRecording'][_0xeb78('0x47')](_0x2342e0);})[_0xeb78('0x25')](function(_0x430be0){_0x3bc284['rows']=_0x430be0;return _0x3bc284;});}})[_0xeb78('0x25')](respondWithFilteredResult(_0xea2612,_0x2342e0))[_0xeb78('0x52')](handleError(_0xea2612,null));};exports[_0xeb78('0xdd')]=function(_0x4786d3,_0x258c8c){var _0x3c4b80={};var _0x388d87={};var _0x440bbf;var _0x5e6207;return db[_0xeb78('0x38')][_0xeb78('0xc2')]({'where':{'id':_0x4786d3['params']['id']}})[_0xeb78('0x25')](handleEntityNotFound(_0x258c8c,null))['then'](function(_0x5f2dba){if(_0x5f2dba){_0x440bbf=_0x5f2dba;_0x388d87[_0xeb78('0xcc')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x388d87['query']=_[_0xeb78('0xc8')](_0x4786d3[_0xeb78('0x40')]);_0x388d87['filters']=_[_0xeb78('0xcb')](_0x388d87[_0xeb78('0xcc')],_0x388d87[_0xeb78('0x40')]);_0x3c4b80[_0xeb78('0x46')]=_[_0xeb78('0xcb')](_0x388d87[_0xeb78('0xcc')],qs[_0xeb78('0xcd')](_0x4786d3['query'][_0xeb78('0xcd')]));_0x3c4b80[_0xeb78('0x46')]=_0x3c4b80[_0xeb78('0x46')][_0xeb78('0x66')]?_0x3c4b80[_0xeb78('0x46')]:_0x388d87['model'];_0x3c4b80[_0xeb78('0xce')]=qs[_0xeb78('0xcf')](_0x4786d3[_0xeb78('0x40')][_0xeb78('0xcf')]);_0x3c4b80['where']=qs['filters'](_[_0xeb78('0xd7')](_0x4786d3[_0xeb78('0x40')],_0x388d87['filters']));if(_0x4786d3[_0xeb78('0x40')][_0xeb78('0x2c')]){_0x3c4b80[_0xeb78('0xd0')]=_['merge'](_0x3c4b80[_0xeb78('0xd0')],{'$or':_[_0xeb78('0x2e')](_0x3c4b80[_0xeb78('0x46')],function(_0x4bd4d5){var _0x5c5fbd={};_0x5c5fbd[_0x4bd4d5]={'$like':'%'+_0x4786d3['query']['filter']+'%'};return _0x5c5fbd;})});}_0x3c4b80=_['merge']({},_0x3c4b80,_0x4786d3['options']);return _0x440bbf['getChatInteractions'](_0x3c4b80);}})['then'](function(_0x575ae9){if(_0x575ae9){_0x5e6207=_0x575ae9[_0xeb78('0x66')];if(!_0x4786d3[_0xeb78('0x40')][_0xeb78('0xd2')]('nolimit')){_0x3c4b80[_0xeb78('0x1d')]=qs[_0xeb78('0x1d')](_0x4786d3[_0xeb78('0x40')]['limit']);_0x3c4b80['offset']=qs['offset'](_0x4786d3['query'][_0xeb78('0x1b')]);}return _0x440bbf[_0xeb78('0xdd')](_0x3c4b80);}})[_0xeb78('0x25')](function(_0x3c9382){if(_0x3c9382){return _0x3c9382?{'count':_0x5e6207,'rows':_0x3c9382}:null;}})[_0xeb78('0x25')](respondWithResult(_0x258c8c,null))[_0xeb78('0x52')](handleError(_0x258c8c,null));};exports['getOpenchannelInteractions']=function(_0x717edd,_0x293d9e){var _0x26ce88={};var _0x2dcb0d={};var _0x1718a0;var _0x59108f;return db[_0xeb78('0x38')][_0xeb78('0xc2')]({'where':{'id':_0x717edd[_0xeb78('0x59')]['id']}})['then'](handleEntityNotFound(_0x293d9e,null))[_0xeb78('0x25')](function(_0x3f6514){if(_0x3f6514){_0x1718a0=_0x3f6514;_0x2dcb0d[_0xeb78('0xcc')]=_[_0xeb78('0xc8')](db[_0xeb78('0xde')][_0xeb78('0x39')]);_0x2dcb0d[_0xeb78('0x40')]=_[_0xeb78('0xc8')](_0x717edd[_0xeb78('0x40')]);_0x2dcb0d[_0xeb78('0xca')]=_[_0xeb78('0xcb')](_0x2dcb0d[_0xeb78('0xcc')],_0x2dcb0d[_0xeb78('0x40')]);_0x26ce88['attributes']=_['intersection'](_0x2dcb0d[_0xeb78('0xcc')],qs[_0xeb78('0xcd')](_0x717edd[_0xeb78('0x40')][_0xeb78('0xcd')]));_0x26ce88['attributes']=_0x26ce88[_0xeb78('0x46')]['length']?_0x26ce88[_0xeb78('0x46')]:_0x2dcb0d['model'];_0x26ce88[_0xeb78('0xce')]=qs[_0xeb78('0xcf')](_0x717edd[_0xeb78('0x40')][_0xeb78('0xcf')]);_0x26ce88[_0xeb78('0xd0')]=qs[_0xeb78('0xca')](_[_0xeb78('0xd7')](_0x717edd[_0xeb78('0x40')],_0x2dcb0d[_0xeb78('0xca')]));if(_0x717edd[_0xeb78('0x40')][_0xeb78('0x2c')]){_0x26ce88[_0xeb78('0xd0')]=_['merge'](_0x26ce88[_0xeb78('0xd0')],{'$or':_[_0xeb78('0x2e')](_0x26ce88[_0xeb78('0x46')],function(_0x11dbdf){var _0x1a3bfe={};_0x1a3bfe[_0x11dbdf]={'$like':'%'+_0x717edd[_0xeb78('0x40')][_0xeb78('0x2c')]+'%'};return _0x1a3bfe;})});}_0x26ce88=_['merge']({},_0x26ce88,_0x717edd[_0xeb78('0x56')]);return _0x1718a0[_0xeb78('0xdf')](_0x26ce88);}})[_0xeb78('0x25')](function(_0x24ac68){if(_0x24ac68){_0x59108f=_0x24ac68[_0xeb78('0x66')];if(!_0x717edd[_0xeb78('0x40')]['hasOwnProperty']('nolimit')){_0x26ce88[_0xeb78('0x1d')]=qs[_0xeb78('0x1d')](_0x717edd[_0xeb78('0x40')][_0xeb78('0x1d')]);_0x26ce88[_0xeb78('0x1b')]=qs['offset'](_0x717edd['query'][_0xeb78('0x1b')]);}return _0x1718a0[_0xeb78('0xdf')](_0x26ce88);}})[_0xeb78('0x25')](function(_0x367591){if(_0x367591){return _0x367591?{'count':_0x59108f,'rows':_0x367591}:null;}})[_0xeb78('0x25')](respondWithResult(_0x293d9e,null))['catch'](handleError(_0x293d9e,null));};exports[_0xeb78('0xe0')]=function(_0xb96f74,_0xdbcdcf){var _0x171c80={'raw':!![],'where':{}};var _0x47a747={};var _0x3b2133={'count':0x0,'rows':[]};return db['User'][_0xeb78('0xc2')]({'where':{'id':_0xb96f74[_0xeb78('0x59')]['id']}})['then'](handleEntityNotFound(_0xdbcdcf,null))[_0xeb78('0x25')](function(_0x396dec){if(_0x396dec){_0x47a747[_0xeb78('0xcc')]=_[_0xeb78('0xc8')](db[_0xeb78('0xe1')][_0xeb78('0x39')]);_0x47a747['query']=_[_0xeb78('0xc8')](_0xb96f74[_0xeb78('0x40')]);_0x47a747['filters']=_[_0xeb78('0xcb')](_0x47a747[_0xeb78('0xcc')],_0x47a747[_0xeb78('0x40')]);_0x171c80[_0xeb78('0x46')]=_[_0xeb78('0xcb')](_0x47a747['model'],qs['fields'](_0xb96f74['query'][_0xeb78('0xcd')]));_0x171c80[_0xeb78('0x46')]=_0x171c80[_0xeb78('0x46')][_0xeb78('0x66')]?_0x171c80[_0xeb78('0x46')]:_0x47a747['model'];if(!_0xb96f74['query']['hasOwnProperty'](_0xeb78('0xd3'))){_0x171c80[_0xeb78('0x1d')]=qs[_0xeb78('0x1d')](_0xb96f74[_0xeb78('0x40')]['limit']);_0x171c80['offset']=qs[_0xeb78('0x1b')](_0xb96f74['query'][_0xeb78('0x1b')]);}_0x171c80[_0xeb78('0xce')]=qs[_0xeb78('0xcf')](_0xb96f74[_0xeb78('0x40')][_0xeb78('0xcf')]);_0x171c80[_0xeb78('0xd0')]=qs[_0xeb78('0xca')](_[_0xeb78('0xd7')](_0xb96f74[_0xeb78('0x40')],_0x47a747['filters']));_0x171c80[_0xeb78('0xd0')][_0xeb78('0xda')]=_0x396dec['id'];if(_0xb96f74[_0xeb78('0x40')][_0xeb78('0x2c')]){_0x171c80[_0xeb78('0xd0')]=_['merge'](_0x171c80[_0xeb78('0xd0')],{'$or':_[_0xeb78('0x2e')](_0x171c80[_0xeb78('0x46')],function(_0x4da7b3){var _0x65902a={};_0x65902a[_0x4da7b3]={'$like':'%'+_0xb96f74[_0xeb78('0x40')][_0xeb78('0x2c')]+'%'};return _0x65902a;})});}_0x171c80=_[_0xeb78('0x55')]({},_0x171c80,_0xb96f74[_0xeb78('0x56')]);return db['MailInteraction'][_0xeb78('0x1e')]({'where':_0x171c80['where']})[_0xeb78('0x25')](function(_0x2f99){_0x3b2133['count']=_0x2f99;if(_0xb96f74['query'][_0xeb78('0x41')]){_0x171c80[_0xeb78('0x42')]=[{'all':!![]}];}return db[_0xeb78('0xe1')]['findAll'](_0x171c80);})['then'](function(_0x14c30c){_0x3b2133[_0xeb78('0x48')]=_0x14c30c;return _0x3b2133;});}})['then'](respondWithFilteredResult(_0xdbcdcf,_0x171c80))['catch'](handleError(_0xdbcdcf,null));};exports[_0xeb78('0xe2')]=function(_0x34402d,_0x147cdc){var _0x3b721b={};var _0x1dbb43={};var _0xa05855;var _0x214c41;return db[_0xeb78('0x38')][_0xeb78('0xc2')]({'where':{'id':_0x34402d[_0xeb78('0x59')]['id']}})[_0xeb78('0x25')](handleEntityNotFound(_0x147cdc,null))[_0xeb78('0x25')](function(_0x6a849){if(_0x6a849){_0xa05855=_0x6a849;_0x1dbb43[_0xeb78('0xcc')]=_[_0xeb78('0xc8')](db[_0xeb78('0xe3')][_0xeb78('0x39')]);_0x1dbb43[_0xeb78('0x40')]=_[_0xeb78('0xc8')](_0x34402d[_0xeb78('0x40')]);_0x1dbb43[_0xeb78('0xca')]=_[_0xeb78('0xcb')](_0x1dbb43[_0xeb78('0xcc')],_0x1dbb43[_0xeb78('0x40')]);_0x3b721b['attributes']=_['intersection'](_0x1dbb43[_0xeb78('0xcc')],qs[_0xeb78('0xcd')](_0x34402d['query'][_0xeb78('0xcd')]));_0x3b721b[_0xeb78('0x46')]=_0x3b721b[_0xeb78('0x46')][_0xeb78('0x66')]?_0x3b721b[_0xeb78('0x46')]:_0x1dbb43[_0xeb78('0xcc')];_0x3b721b[_0xeb78('0xce')]=qs['sort'](_0x34402d[_0xeb78('0x40')][_0xeb78('0xcf')]);_0x3b721b['where']=qs[_0xeb78('0xca')](_[_0xeb78('0xd7')](_0x34402d[_0xeb78('0x40')],_0x1dbb43[_0xeb78('0xca')]));if(_0x34402d[_0xeb78('0x40')][_0xeb78('0x2c')]){_0x3b721b[_0xeb78('0xd0')]=_[_0xeb78('0x55')](_0x3b721b[_0xeb78('0xd0')],{'$or':_[_0xeb78('0x2e')](_0x3b721b[_0xeb78('0x46')],function(_0x208207){var _0xb97421={};_0xb97421[_0x208207]={'$like':'%'+_0x34402d[_0xeb78('0x40')]['filter']+'%'};return _0xb97421;})});}_0x3b721b=_[_0xeb78('0x55')]({},_0x3b721b,_0x34402d['options']);return _0xa05855[_0xeb78('0xe2')](_0x3b721b);}})[_0xeb78('0x25')](function(_0x249f2e){if(_0x249f2e){_0x214c41=_0x249f2e[_0xeb78('0x66')];if(!_0x34402d[_0xeb78('0x40')]['hasOwnProperty'](_0xeb78('0xd3'))){_0x3b721b[_0xeb78('0x1d')]=qs[_0xeb78('0x1d')](_0x34402d['query']['limit']);_0x3b721b[_0xeb78('0x1b')]=qs['offset'](_0x34402d[_0xeb78('0x40')][_0xeb78('0x1b')]);}return _0xa05855[_0xeb78('0xe2')](_0x3b721b);}})['then'](function(_0x4b36f7){if(_0x4b36f7){return _0x4b36f7?{'count':_0x214c41,'rows':_0x4b36f7}:null;}})[_0xeb78('0x25')](respondWithResult(_0x147cdc,null))[_0xeb78('0x52')](handleError(_0x147cdc,null));};exports['getFaxInteractions']=function(_0x5db912,_0x1b2e4e){var _0x30f8ef={};var _0xf384f2={};var _0x68c99b;var _0x4347b1;return db['User'][_0xeb78('0xc2')]({'where':{'id':_0x5db912['params']['id']}})[_0xeb78('0x25')](handleEntityNotFound(_0x1b2e4e,null))[_0xeb78('0x25')](function(_0x47dd02){if(_0x47dd02){_0x68c99b=_0x47dd02;_0xf384f2[_0xeb78('0xcc')]=_[_0xeb78('0xc8')](db[_0xeb78('0xe4')][_0xeb78('0x39')]);_0xf384f2['query']=_[_0xeb78('0xc8')](_0x5db912['query']);_0xf384f2['filters']=_[_0xeb78('0xcb')](_0xf384f2[_0xeb78('0xcc')],_0xf384f2[_0xeb78('0x40')]);_0x30f8ef[_0xeb78('0x46')]=_['intersection'](_0xf384f2[_0xeb78('0xcc')],qs['fields'](_0x5db912[_0xeb78('0x40')][_0xeb78('0xcd')]));_0x30f8ef[_0xeb78('0x46')]=_0x30f8ef['attributes'][_0xeb78('0x66')]?_0x30f8ef[_0xeb78('0x46')]:_0xf384f2[_0xeb78('0xcc')];_0x30f8ef['order']=qs[_0xeb78('0xcf')](_0x5db912[_0xeb78('0x40')][_0xeb78('0xcf')]);_0x30f8ef[_0xeb78('0xd0')]=qs['filters'](_[_0xeb78('0xd7')](_0x5db912['query'],_0xf384f2['filters']));if(_0x5db912[_0xeb78('0x40')][_0xeb78('0x2c')]){_0x30f8ef['where']=_[_0xeb78('0x55')](_0x30f8ef[_0xeb78('0xd0')],{'$or':_[_0xeb78('0x2e')](_0x30f8ef[_0xeb78('0x46')],function(_0x5dc006){var _0x1c478c={};_0x1c478c[_0x5dc006]={'$like':'%'+_0x5db912['query'][_0xeb78('0x2c')]+'%'};return _0x1c478c;})});}_0x30f8ef=_[_0xeb78('0x55')]({},_0x30f8ef,_0x5db912[_0xeb78('0x56')]);return _0x68c99b[_0xeb78('0xe5')](_0x30f8ef);}})[_0xeb78('0x25')](function(_0x144a1d){if(_0x144a1d){_0x4347b1=_0x144a1d[_0xeb78('0x66')];if(!_0x5db912['query'][_0xeb78('0xd2')](_0xeb78('0xd3'))){_0x30f8ef[_0xeb78('0x1d')]=qs[_0xeb78('0x1d')](_0x5db912[_0xeb78('0x40')][_0xeb78('0x1d')]);_0x30f8ef[_0xeb78('0x1b')]=qs[_0xeb78('0x1b')](_0x5db912[_0xeb78('0x40')][_0xeb78('0x1b')]);}return _0x68c99b['getFaxInteractions'](_0x30f8ef);}})['then'](function(_0x59e880){if(_0x59e880){return _0x59e880?{'count':_0x4347b1,'rows':_0x59e880}:null;}})[_0xeb78('0x25')](respondWithResult(_0x1b2e4e,null))['catch'](handleError(_0x1b2e4e,null));};exports['getWhatsappInteractions']=function(_0x59f0ad,_0x4cdd71){var _0x40778f={};var _0x31ebf1={};var _0xa5830c;var _0x3d94af;return db[_0xeb78('0x38')][_0xeb78('0xc2')]({'where':{'id':_0x59f0ad[_0xeb78('0x59')]['id']}})['then'](handleEntityNotFound(_0x4cdd71,null))[_0xeb78('0x25')](function(_0x6ca95e){if(_0x6ca95e){_0xa5830c=_0x6ca95e;_0x31ebf1[_0xeb78('0xcc')]=_['keys'](db[_0xeb78('0xe6')][_0xeb78('0x39')]);_0x31ebf1['query']=_[_0xeb78('0xc8')](_0x59f0ad[_0xeb78('0x40')]);_0x31ebf1['filters']=_[_0xeb78('0xcb')](_0x31ebf1[_0xeb78('0xcc')],_0x31ebf1[_0xeb78('0x40')]);_0x40778f[_0xeb78('0x46')]=_[_0xeb78('0xcb')](_0x31ebf1[_0xeb78('0xcc')],qs[_0xeb78('0xcd')](_0x59f0ad[_0xeb78('0x40')][_0xeb78('0xcd')]));_0x40778f[_0xeb78('0x46')]=_0x40778f[_0xeb78('0x46')][_0xeb78('0x66')]?_0x40778f['attributes']:_0x31ebf1[_0xeb78('0xcc')];_0x40778f[_0xeb78('0xce')]=qs[_0xeb78('0xcf')](_0x59f0ad[_0xeb78('0x40')]['sort']);_0x40778f[_0xeb78('0xd0')]=qs[_0xeb78('0xca')](_[_0xeb78('0xd7')](_0x59f0ad['query'],_0x31ebf1[_0xeb78('0xca')]));if(_0x59f0ad['query'][_0xeb78('0x2c')]){_0x40778f[_0xeb78('0xd0')]=_[_0xeb78('0x55')](_0x40778f[_0xeb78('0xd0')],{'$or':_['map'](_0x40778f[_0xeb78('0x46')],function(_0x48891c){var _0xe02496={};_0xe02496[_0x48891c]={'$like':'%'+_0x59f0ad[_0xeb78('0x40')][_0xeb78('0x2c')]+'%'};return _0xe02496;})});}_0x40778f=_['merge']({},_0x40778f,_0x59f0ad[_0xeb78('0x56')]);return _0xa5830c['getWhatsappInteractions'](_0x40778f);}})[_0xeb78('0x25')](function(_0x5af7b9){if(_0x5af7b9){_0x3d94af=_0x5af7b9['length'];if(!_0x59f0ad[_0xeb78('0x40')][_0xeb78('0xd2')](_0xeb78('0xd3'))){_0x40778f['limit']=qs[_0xeb78('0x1d')](_0x59f0ad[_0xeb78('0x40')][_0xeb78('0x1d')]);_0x40778f[_0xeb78('0x1b')]=qs['offset'](_0x59f0ad[_0xeb78('0x40')][_0xeb78('0x1b')]);}return _0xa5830c[_0xeb78('0xe7')](_0x40778f);}})['then'](function(_0x215462){if(_0x215462){return _0x215462?{'count':_0x3d94af,'rows':_0x215462}:null;}})[_0xeb78('0x25')](respondWithResult(_0x4cdd71,null))[_0xeb78('0x52')](handleError(_0x4cdd71,null));};exports['login']=function(_0x430cb7,_0x17108f,_0x5e3989){var _0x5e825c;var _0xdb95ab;var _0x5d10da;var _0x31a692=!_['isNil'](_0x430cb7[_0xeb78('0x59')]['id'])?_0x430cb7[_0xeb78('0x59')]['id']:!_[_0xeb78('0x62')](_0x430cb7['user']['id'])?_0x430cb7[_0xeb78('0x29')]['id']:null;return db['User'][_0xeb78('0x31')]({'where':{'id':_0x31a692,'role':{'$or':[_0xeb78('0x27'),_0xeb78('0x29'),_0xeb78('0x23')]}},'attributes':['id',_0xeb78('0x32'),_0xeb78('0xe8'),_0xeb78('0xe9'),_0xeb78('0x22'),'internal','loginInPause']})['then'](function(_0x408dfc){if(_0x408dfc){if(_0x408dfc['role']===_0xeb78('0x23')){_0x5e825c=_0x408dfc;if(_0x430cb7[_0xeb78('0x57')][_0xeb78('0x99')]){_0x5d10da=util[_0xeb78('0xa4')](_0xeb78('0xea'),_0x5e825c[_0x430cb7['body'][_0xeb78('0x99')]]);}else if(_0x430cb7['body']['intrf']){_0x5d10da=util[_0xeb78('0xa4')](_0xeb78('0xa5'),_0x430cb7[_0xeb78('0x57')][_0xeb78('0xeb')]);}else{_0x5d10da=util[_0xeb78('0xa4')](_0xeb78('0xa5'),_0x5e825c[_0xeb78('0x32')]);}socket['to'](util[_0xeb78('0xa4')](_0xeb78('0xec'),_0x5e825c['name']))['emit']('user:forcelogout',{'user':{'id':_0x5e825c['id'],'name':_0x5e825c[_0xeb78('0x32')]},'ip':_0x430cb7[_0xeb78('0xed')][_0xeb78('0xee')]||_0x430cb7[_0xeb78('0xef')][_0xeb78('0xf0')]||_0x430cb7[_0xeb78('0xf1')][_0xeb78('0xf0')]||_0x430cb7['connection'][_0xeb78('0xf1')][_0xeb78('0xf0')]});return db[_0xeb78('0xa6')]['destroy']({'where':{'membername':_0x5e825c['name']},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0xeb78('0x8c'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0x5e825c){return _0x5e825c[_0xeb78('0xf2')]({'raw':!![]});}})[_0xeb78('0x25')](function(_0x17d997){if(_0x5e825c){if(_0x17d997){_0xdb95ab=_0x17d997;if(_0xdb95ab[_0xeb78('0x66')]){var _0x5a1d66=_0xdb95ab[_0xeb78('0x2e')](function(_0x5d09d2){var _0x4bae01={'membername':_0x5e825c[_0xeb78('0x32')],'UserId':_0x5e825c['id'],'queue_name':_0x5d09d2[_0xeb78('0x32')],'VoiceQueueId':_0x5d09d2['id'],'interface':_0x5d10da,'paused':_0x5e825c[_0xeb78('0x97')]||![],'penalty':_0x5d09d2[_0xeb78('0xf3')]||0x0};return db['UserVoiceQueueRt'][_0xeb78('0xa7')](_0x4bae01);});return Promise[_0xeb78('0x51')](_0x5a1d66);}}}})[_0xeb78('0x25')](function(){if(_0x5e825c){return db[_0xeb78('0xf4')][_0xeb78('0x47')]({'where':{'membername':_0x5e825c[_0xeb78('0x32')],'exitAt':null}});}})[_0xeb78('0x25')](function(_0x255d63){if(_0x5e825c){var _0x3379a0=[];_0x255d63[_0xeb78('0xf5')](function(_0x617942){_0x3379a0['push'](_0x617942[_0xeb78('0x21')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x3379a0);}})[_0xeb78('0x25')](function(){if(_0x5e825c){var _0x585d00=[];var _0x4ae0b3=[];var _0x482f25=utils[_0xeb78('0xf6')]();var _0x4983f9={'membername':_0x5e825c[_0xeb78('0x32')],'interface':_0x5d10da,'enterAt':moment()[_0xeb78('0xa4')](_0xeb78('0xf7')),'role':_0x5e825c['role'],'internal':_0x5e825c[_0xeb78('0x5c')]};_0x482f25[_0xeb78('0xf5')](function(_0x40a1de){_0x585d00[_0xeb78('0x4a')](_[_0xeb78('0x55')]({'channel':_0x40a1de,'type':_0xeb78('0xf8'),'data1':_0x430cb7[_0xeb78('0x57')]['device'],'data2':_0x5d10da},_0x4983f9));if(_0x5e825c[_0xeb78('0x97')]){_0x4ae0b3[_0xeb78('0x4a')](_[_0xeb78('0x55')]({'channel':_0x40a1de,'type':_0xeb78('0xf9'),'data1':_0xeb78('0xfa')},_0x4983f9));}});return db[_0xeb78('0xf4')][_0xeb78('0x81')](_0x585d00[_0xeb78('0xc0')](_0x4ae0b3),{'individualHooks':!![]});}})['then'](function(){if(_0x5e825c){return _0x5e825c[_0xeb78('0x21')]({'online':!![],'lastLoginAt':moment()[_0xeb78('0xa4')](_0xeb78('0xf7')),'voicePause':_0x5e825c['loginInPause']||![],'mailPause':_0x5e825c[_0xeb78('0x97')]||![],'chatPause':_0x5e825c[_0xeb78('0x97')]||![],'faxPause':_0x5e825c[_0xeb78('0x97')]||![],'smsPause':_0x5e825c[_0xeb78('0x97')]||![],'openchannelPause':_0x5e825c['loginInPause']||![],'whatsappPause':_0x5e825c[_0xeb78('0x97')]||![],'pauseType':_0x5e825c[_0xeb78('0x97')]?_0xeb78('0xfa'):null,'interface':_0x5d10da,'lastPauseAt':moment()[_0xeb78('0xa4')](_0xeb78('0xf7'))});}})[_0xeb78('0x25')](function(_0x4d8d7d){if(_0x430cb7['isMiddleware']){return _0x5e3989();}else{return Promise[_0xeb78('0xfb')](_0x4d8d7d)[_0xeb78('0x25')](respondWithResult(_0x17108f,null));}})[_0xeb78('0x52')](handleError(_0x17108f,null));};exports['logout']=function(_0x2d195e,_0x12f381){var _0x313176;return db[_0xeb78('0x38')]['find']({'where':{'id':_0x2d195e[_0xeb78('0x59')]['id'],'role':'agent'},'attributes':['id',_0xeb78('0x32'),'role']})['then'](handleEntityNotFound(_0x12f381,null))['then'](function(_0x5ad407){if(_0x5ad407){_0x313176=_0x5ad407;return db[_0xeb78('0xa6')][_0xeb78('0x34')]({'where':{'membername':_0x313176[_0xeb78('0x32')]},'individualHooks':!![]});}})[_0xeb78('0x25')](function(){return db[_0xeb78('0xf4')]['findAll']({'where':{'membername':_0x313176[_0xeb78('0x32')],'exitAt':null}});})[_0xeb78('0x25')](function(_0x327727){var _0x4aed0e=[];_0x327727[_0xeb78('0xf5')](function(_0x2d4f9d){_0x4aed0e[_0xeb78('0x4a')](_0x2d4f9d[_0xeb78('0x21')]({'exitAt':moment()[_0xeb78('0xa4')](_0xeb78('0xf7'))}));});return Promise[_0xeb78('0x51')](_0x4aed0e);})['then'](function(){return _0x313176[_0xeb78('0x21')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xeb78('0x25')](respondWithResult(_0x12f381,null))[_0xeb78('0x52')](handleError(_0x12f381,null));};exports[_0xeb78('0xfc')]=function(_0x4d3de8,_0x3af3f2){var _0x548ab9;return db[_0xeb78('0xa6')][_0xeb78('0x21')]({'paused':0x1},{'where':{'UserId':_0x4d3de8[_0xeb78('0x59')]['id']},'individualHooks':!![]})[_0xeb78('0x25')](function(){return db[_0xeb78('0x38')][_0xeb78('0x31')]({'where':{'id':_0x4d3de8[_0xeb78('0x59')]['id'],'role':_0xeb78('0x23')},'attributes':['id',_0xeb78('0x32'),'role',_0xeb78('0x5c'),'interface','online']});})['then'](handleEntityNotFound(_0x3af3f2,null))[_0xeb78('0x25')](function(_0x26bd47){if(_0x26bd47){_0x548ab9=_0x26bd47;return db['MemberReport'][_0xeb78('0x47')]({'where':{'membername':_0x548ab9[_0xeb78('0x32')],'type':_0xeb78('0xf9'),'exitAt':null}});}})[_0xeb78('0x25')](function(_0x1bd4ff){if(_0x1bd4ff[_0xeb78('0x66')]){var _0x5a9259=moment()[_0xeb78('0xa4')](_0xeb78('0xf7'));for(var _0x2bc8fa=0x0,_0x9d83e2=_0x1bd4ff[_0xeb78('0x66')];_0x2bc8fa<_0x9d83e2;_0x2bc8fa++){_0x1bd4ff[_0x2bc8fa][_0xeb78('0xfd')]({'exitAt':_0x5a9259});}}})[_0xeb78('0x25')](function(){var _0x10bc23=[];var _0x1d5e0b=utils[_0xeb78('0xf6')]();_0x1d5e0b[_0xeb78('0xf5')](function(_0x55d7cb){_0x10bc23[_0xeb78('0x4a')]({'channel':_0x55d7cb,'membername':_0x548ab9['name'],'interface':_[_0xeb78('0x62')](_0x548ab9[_0xeb78('0x99')])?util[_0xeb78('0xa4')](_0xeb78('0xa5'),_0x548ab9[_0xeb78('0x32')]):_0x548ab9['interface'],'type':'PAUSE','enterAt':moment()[_0xeb78('0xa4')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4d3de8['body'][_0xeb78('0x3b')]||'DEFAULT\x20PAUSE','role':_0x548ab9[_0xeb78('0x22')],'internal':_0x548ab9[_0xeb78('0x5c')]});});return db['MemberReport']['bulkCreate'](_0x10bc23,{'individualHooks':!![]});})[_0xeb78('0x25')](function(){return _0x548ab9['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4d3de8[_0xeb78('0x57')]['type']||_0xeb78('0xfe'),'lastPauseAt':moment()[_0xeb78('0xa4')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xeb78('0x25')](respondWithResult(_0x3af3f2,null))[_0xeb78('0x52')](handleError(_0x3af3f2,null));};exports[_0xeb78('0xff')]=function(_0x8a61f7,_0x54a08f){if(_0x8a61f7[_0xeb78('0x57')][_0xeb78('0x96')]&&!utils[_0xeb78('0x9a')](_0x8a61f7[_0xeb78('0x57')][_0xeb78('0x96')])){throw new APIBadRequestError(util[_0xeb78('0xa4')](_0xeb78('0x100'),_0x8a61f7[_0xeb78('0x57')][_0xeb78('0x96')]));}return db['User'][_0xeb78('0x31')]({'where':{'id':_0x8a61f7['params']['id']},'attributes':['id',_0xeb78('0x32'),'role','internal','interface',_0xeb78('0x101'),'voicePause',_0xeb78('0x102'),_0xeb78('0x103'),_0xeb78('0x104'),_0xeb78('0x105'),'smsPause',_0xeb78('0x106'),'pauseType',_0xeb78('0x107')]})[_0xeb78('0x25')](function(_0xce126e){if(!_0xce126e){throw new APINotFoundError(util[_0xeb78('0xa4')]('User\x20with\x20id\x20%s\x20not\x20found',_0x8a61f7[_0xeb78('0x59')]['id']));}return _0xce126e[_0xeb78('0xff')](_0x8a61f7[_0xeb78('0x57')][_0xeb78('0x96')]);})['then'](respondWithResult(_0x54a08f,null))[_0xeb78('0x52')](APIHandleError(_0x54a08f));};exports['getTeams']=function(_0x33b046,_0x1053ed){var _0x42095d={};var _0x5d8c53={};var _0x5f52c4;var _0x220a6f;return db['User'][_0xeb78('0xc2')]({'where':{'id':_0x33b046[_0xeb78('0x59')]['id']}})['then'](handleEntityNotFound(_0x1053ed,null))[_0xeb78('0x25')](function(_0x4231ea){if(_0x4231ea){_0x5f52c4=_0x4231ea;_0x5d8c53[_0xeb78('0xcc')]=_['keys'](db['Team'][_0xeb78('0x39')]);_0x5d8c53[_0xeb78('0x40')]=_['keys'](_0x33b046[_0xeb78('0x40')]);_0x5d8c53[_0xeb78('0xca')]=_[_0xeb78('0xcb')](_0x5d8c53['model'],_0x5d8c53[_0xeb78('0x40')]);_0x42095d[_0xeb78('0x46')]=_[_0xeb78('0xcb')](_0x5d8c53[_0xeb78('0xcc')],qs[_0xeb78('0xcd')](_0x33b046[_0xeb78('0x40')]['fields']));_0x42095d['attributes']=_0x42095d[_0xeb78('0x46')]['length']?_0x42095d[_0xeb78('0x46')]:_0x5d8c53[_0xeb78('0xcc')];_0x42095d[_0xeb78('0xce')]=qs[_0xeb78('0xcf')](_0x33b046[_0xeb78('0x40')][_0xeb78('0xcf')]);_0x42095d[_0xeb78('0xd0')]=qs[_0xeb78('0xca')](_['pick'](_0x33b046[_0xeb78('0x40')],_0x5d8c53[_0xeb78('0xca')]));if(_0x33b046['query'][_0xeb78('0x2c')]){_0x42095d[_0xeb78('0xd0')]=_[_0xeb78('0x55')](_0x42095d[_0xeb78('0xd0')],{'$or':_[_0xeb78('0x2e')](_0x42095d[_0xeb78('0x46')],function(_0x49b19f){var _0x1fab40={};_0x1fab40[_0x49b19f]={'$like':'%'+_0x33b046[_0xeb78('0x40')]['filter']+'%'};return _0x1fab40;})});}_0x42095d=_['merge']({},_0x42095d,_0x33b046['options']);return _0x5f52c4['getTeams'](_0x42095d);}})[_0xeb78('0x25')](function(_0x46c80a){if(_0x46c80a){_0x220a6f=_0x46c80a[_0xeb78('0x66')];if(!_0x33b046[_0xeb78('0x40')]['hasOwnProperty'](_0xeb78('0xd3'))){_0x42095d[_0xeb78('0x1d')]=qs[_0xeb78('0x1d')](_0x33b046[_0xeb78('0x40')][_0xeb78('0x1d')]);_0x42095d[_0xeb78('0x1b')]=qs[_0xeb78('0x1b')](_0x33b046[_0xeb78('0x40')][_0xeb78('0x1b')]);}return _0x5f52c4[_0xeb78('0x108')](_0x42095d);}})[_0xeb78('0x25')](function(_0x2e880c){if(_0x2e880c){return _0x2e880c?{'count':_0x220a6f,'rows':_0x2e880c}:null;}})[_0xeb78('0x25')](respondWithResult(_0x1053ed,null))[_0xeb78('0x52')](handleError(_0x1053ed,null));};exports['addTeams']=function(_0xfff3,_0x887f10){var _0x76854e=_0xfff3[_0xeb78('0x59')]['id'];var _0x40a030=_0xfff3[_0xeb78('0x57')]?_0xfff3['body'][_0xeb78('0x5b')]:null;var _0x8fbec6=[];return Promise['resolve']()[_0xeb78('0x25')](function(){if(!_0x40a030)throw new APIBadRequestError(_0xeb78('0x109'));})[_0xeb78('0x25')](function(){return db['User']['findOne']({'where':{'id':_0x76854e}});})[_0xeb78('0x25')](function(_0x5b779d){if(!_0x5b779d)throw new APINotFoundError(util[_0xeb78('0xa4')]('User\x20with\x20id\x20%s\x20not\x20found',_0xfff3['params']['id']));return db[_0xeb78('0x63')][_0xeb78('0x10a')](function(_0x5b4f9f){return _0x5b779d[_0xeb78('0x10b')](_0x40a030,{'transaction':_0x5b4f9f})[_0xeb78('0x25')](function(){return db[_0xeb78('0x10c')][_0xeb78('0x47')]({'where':{'id':{'$in':_0x40a030}}});})[_0xeb78('0x25')](function(_0x3dd144){var _0x6137ea=_[_0xeb78('0x2e')](_0x3dd144,function(_0x342b52){return _0x342b52[_0xeb78('0x10d')]();});return Promise[_0xeb78('0x51')](_0x6137ea);})[_0xeb78('0x25')](function(_0x31be02){_0x8fbec6=_['flattenDeep'](_0x31be02);var _0x679452=_[_0xeb78('0x2e')](_0x8fbec6,function(_0x1f3aa5){return _0x1f3aa5[_0xeb78('0x10e')](_0x5b779d['id'],{'transaction':_0x5b4f9f});});return Promise['all'](_0x679452);})['then'](function(){if(!_0x5b779d['online'])return;var _0x3c30e5=_[_0xeb78('0x2c')](_0x8fbec6,function(_0x15536a){return _0x15536a[_0xeb78('0x10f')]('channel')===_0xeb78('0x110');});var _0x3910fd=_[_0xeb78('0x2e')](_0x3c30e5,function(_0x5e4ac6){return db['UserVoiceQueueRt'][_0xeb78('0xa7')]({'membername':_0x5b779d['name'],'UserId':_0x5b779d['id'],'queue_name':_0x5e4ac6['name'],'VoiceQueueId':_0x5e4ac6['id'],'interface':_[_0xeb78('0x62')](_0x5b779d[_0xeb78('0x99')])?util[_0xeb78('0xa4')]('SIP/%s',_0x5b779d[_0xeb78('0x32')]):_0x5b779d[_0xeb78('0x99')],'paused':_0x5b779d['voicePause']||![],'penalty':_0x5b779d[_0xeb78('0x9e')]},{'transaction':_0x5b4f9f});});return Promise[_0xeb78('0x51')](_0x3910fd);})[_0xeb78('0x25')](function(){return db[_0xeb78('0x111')][_0xeb78('0x47')]({'where':{'teamId':{'$in':_0x40a030}}});})[_0xeb78('0x25')](function(_0x46cb74){var _0x3b3c92=_[_0xeb78('0x2e')](_0x46cb74,function(_0xa69c54){return db[_0xeb78('0x112')][_0xeb78('0x7a')]({'UserId':_0x5b779d['id'],'VoicePrefixId':_0xa69c54[_0xeb78('0x113')]},{'transaction':_0x5b4f9f});});return Promise['all'](_0x3b3c92);});});})[_0xeb78('0x25')](function(){for(var _0x188ffc=0x0;_0x188ffc<_0x8fbec6['length'];_0x188ffc++){var _0x2a10dd=_0x8fbec6[_0x188ffc][_0xeb78('0x10f')](_0xeb78('0x96'));var _0x182131=_0x2a10dd+_0xeb78('0xac');socket[_0xeb78('0x24')](_0xeb78('0x29')+_0x2a10dd+_0xeb78('0xa1'),{'UserId':_0x76854e,['queueField']:_0x8fbec6[_0x188ffc]['id']});}})[_0xeb78('0x25')](respondWithStatusCode(_0x887f10,null))[_0xeb78('0x52')](APIHandleError(_0x887f10));};exports[_0xeb78('0x114')]=function(_0x2eb426,_0x373ed0){var _0x39882a=_0x2eb426['params']['id'];var _0x2e3934=null;if(_0x2eb426[_0xeb78('0x40')][_0xeb78('0x5b')]){_0x2e3934=_[_0xeb78('0xaa')](_0x2eb426[_0xeb78('0x40')]['ids'])?_0x2eb426[_0xeb78('0x40')]['ids']:[_0x2eb426['query'][_0xeb78('0x5b')]];}var _0x5d4ae4=[];return Promise[_0xeb78('0xfb')]()[_0xeb78('0x25')](function(){if(!_0x2e3934)throw new APIBadRequestError(_0xeb78('0x115'));})[_0xeb78('0x25')](function(){return db[_0xeb78('0x38')][_0xeb78('0xc2')]({'where':{'id':_0x39882a}});})[_0xeb78('0x25')](function(_0x3e998b){if(!_0x3e998b)throw new APINotFoundError(util[_0xeb78('0xa4')](_0xeb78('0xc3'),_0x2eb426[_0xeb78('0x59')]['id']));return db[_0xeb78('0x63')][_0xeb78('0x10a')](function(_0xe5210c){return _0x3e998b['removeTeams'](_0x2e3934,{'transaction':_0xe5210c})[_0xeb78('0x25')](function(){return db[_0xeb78('0x10c')][_0xeb78('0x47')]({'where':{'id':{'$in':_0x2e3934}}});})[_0xeb78('0x25')](function(_0x5883fc){var _0x3b921d=_['map'](_0x5883fc,function(_0x522e0d){return _0x522e0d[_0xeb78('0x10d')]();});return Promise['all'](_0x3b921d);})['then'](function(_0x1e81d2){_0x5d4ae4=_[_0xeb78('0x116')](_0x1e81d2);var _0x3af306=_[_0xeb78('0x2e')](_0x5d4ae4,function(_0xe3f423){return _0xe3f423[_0xeb78('0x117')](_0x3e998b['id'],{'transaction':_0xe5210c});});return Promise[_0xeb78('0x51')](_0x3af306);})[_0xeb78('0x25')](function(){if(!_0x3e998b['online'])return;var _0x43b169=_[_0xeb78('0x2c')](_0x5d4ae4,function(_0x206daa){return _0x206daa[_0xeb78('0x10f')](_0xeb78('0x96'))==='Voice';});var _0x23eb09=_[_0xeb78('0x2e')](_0x43b169,function(_0x3b86ca){return db[_0xeb78('0xa6')][_0xeb78('0x34')]({'where':{'VoiceQueueId':_0x3b86ca['id'],'UserId':_0x3e998b['id']},'transaction':_0xe5210c});});return Promise[_0xeb78('0x51')](_0x23eb09);})['then'](function(){return db['TeamVoicePrefix'][_0xeb78('0x47')]({'where':{'teamId':{'$in':_0x2e3934}}});})[_0xeb78('0x25')](function(_0x1a9074){var _0x4c5407=_[_0xeb78('0x2e')](_0x1a9074,function(_0x2236df){return db[_0xeb78('0x112')][_0xeb78('0x34')]({'where':{'UserId':_0x3e998b['id'],'VoicePrefixId':_0x2236df[_0xeb78('0x113')]}},{'transaction':_0xe5210c});});return Promise[_0xeb78('0x51')](_0x4c5407);});});})[_0xeb78('0x25')](function(){for(var _0x2b8c0d=0x0;_0x2b8c0d<_0x5d4ae4[_0xeb78('0x66')];_0x2b8c0d++){var _0x91f0fb=_0x5d4ae4[_0x2b8c0d]['getDataValue'](_0xeb78('0x96'));var _0x22d787=_0x91f0fb+_0xeb78('0xac');socket[_0xeb78('0x24')]('user'+_0x91f0fb+_0xeb78('0xab'),{'UserId':_0x39882a,['queueField']:_0x5d4ae4[_0x2b8c0d]['id']});}})[_0xeb78('0x25')](respondWithStatusCode(_0x373ed0,null))[_0xeb78('0x52')](APIHandleError(_0x373ed0));};exports[_0xeb78('0x118')]=function(_0x129cdd,_0x228cea){var _0x489728={};var _0x3a9de1={};var _0x488d3f;var _0x218fdd;return db['User']['findOne']({'where':{'id':_0x129cdd['params']['id']}})[_0xeb78('0x25')](handleEntityNotFound(_0x228cea,null))['then'](function(_0x391aac){if(_0x391aac){_0x488d3f=_0x391aac;_0x3a9de1['model']=_[_0xeb78('0xc8')](db['CmList'][_0xeb78('0x39')]);_0x3a9de1[_0xeb78('0x40')]=_['keys'](_0x129cdd[_0xeb78('0x40')]);_0x3a9de1[_0xeb78('0xca')]=_[_0xeb78('0xcb')](_0x3a9de1['model'],_0x3a9de1[_0xeb78('0x40')]);_0x489728[_0xeb78('0x46')]=_[_0xeb78('0xcb')](_0x3a9de1[_0xeb78('0xcc')],qs[_0xeb78('0xcd')](_0x129cdd['query'][_0xeb78('0xcd')]));_0x489728[_0xeb78('0x46')]=_0x489728[_0xeb78('0x46')][_0xeb78('0x66')]?_0x489728[_0xeb78('0x46')]:_0x3a9de1[_0xeb78('0xcc')];_0x489728['order']=qs[_0xeb78('0xcf')](_0x129cdd[_0xeb78('0x40')][_0xeb78('0xcf')]);_0x489728['where']=qs[_0xeb78('0xca')](_[_0xeb78('0xd7')](_0x129cdd['query'],_0x3a9de1[_0xeb78('0xca')]));if(_0x129cdd[_0xeb78('0x40')][_0xeb78('0x2c')]){_0x489728[_0xeb78('0xd0')]=_['merge'](_0x489728['where'],{'$or':_['map'](_0x489728['attributes'],function(_0x38581c){var _0x3f8661={};_0x3f8661[_0x38581c]={'$like':'%'+_0x129cdd['query'][_0xeb78('0x2c')]+'%'};return _0x3f8661;})});}_0x489728=_[_0xeb78('0x55')]({},_0x489728,_0x129cdd['options']);return _0x488d3f['getLists'](_0x489728);}})[_0xeb78('0x25')](function(_0x1d3b30){if(_0x1d3b30){_0x218fdd=_0x1d3b30[_0xeb78('0x66')];if(!_0x129cdd[_0xeb78('0x40')]['hasOwnProperty'](_0xeb78('0xd3'))){_0x489728[_0xeb78('0x1d')]=qs[_0xeb78('0x1d')](_0x129cdd[_0xeb78('0x40')][_0xeb78('0x1d')]);_0x489728[_0xeb78('0x1b')]=qs[_0xeb78('0x1b')](_0x129cdd['query'][_0xeb78('0x1b')]);}return _0x488d3f[_0xeb78('0x118')](_0x489728);}})[_0xeb78('0x25')](function(_0x420663){if(_0x420663){return _0x420663?{'count':_0x218fdd,'rows':_0x420663}:null;}})['then'](respondWithResult(_0x228cea,null))[_0xeb78('0x52')](handleError(_0x228cea,null));};exports[_0xeb78('0x119')]=function(_0x12f7d9,_0x10376b){var _0x1dce2d={};var _0xac430a={};var _0x2e8a7f;return db['User']['findOne']({'where':{'id':_0x12f7d9[_0xeb78('0x59')]['id']}})[_0xeb78('0x25')](handleEntityNotFound(_0x10376b,null))[_0xeb78('0x25')](function(_0x410441){if(_0x410441){_0x2e8a7f=_0x410441;_0xac430a[_0xeb78('0xcc')]=_[_0xeb78('0xc8')](db['User']['rawAttributes']);_0xac430a['query']=_[_0xeb78('0xc8')](_0x12f7d9['query']);_0xac430a[_0xeb78('0xca')]=_[_0xeb78('0xcb')](_0xac430a['model'],_0xac430a[_0xeb78('0x40')]);_0x1dce2d[_0xeb78('0x46')]=_['intersection'](_0xac430a['model'],qs['fields'](_0x12f7d9[_0xeb78('0x40')][_0xeb78('0xcd')]));_0x1dce2d[_0xeb78('0x46')]=_0x1dce2d[_0xeb78('0x46')][_0xeb78('0x66')]?_0x1dce2d[_0xeb78('0x46')]:_0xac430a[_0xeb78('0xcc')];_0x1dce2d['order']=qs[_0xeb78('0xcf')](_0x12f7d9[_0xeb78('0x40')][_0xeb78('0xcf')]);_0x1dce2d['where']=qs[_0xeb78('0xca')](_[_0xeb78('0xd7')](_0x12f7d9[_0xeb78('0x40')],_0xac430a['filters']));if(_0x12f7d9[_0xeb78('0x40')][_0xeb78('0x2c')]){_0x1dce2d['where']=_[_0xeb78('0x55')](_0x1dce2d[_0xeb78('0xd0')],{'$or':_[_0xeb78('0x2e')](_0x1dce2d[_0xeb78('0x46')],function(_0x5583fa){var _0x2e0469={};_0x2e0469[_0x5583fa]={'$like':'%'+_0x12f7d9[_0xeb78('0x40')][_0xeb78('0x2c')]+'%'};return _0x2e0469;})});}_0x1dce2d['model']=db[_0xeb78('0x38')];_0x1dce2d['as']=_0xeb78('0x2a');_0x1dce2d=_[_0xeb78('0x55')]({},_0x1dce2d,_0x12f7d9['options']);return _0x2e8a7f[_0xeb78('0xf2')]({'include':[_0x1dce2d]});}})[_0xeb78('0x25')](function(_0x53ac95){if(_0x53ac95){var _0xe939bd={},_0x36b293=[];for(var _0x360550=0x0;_0x360550<_0x53ac95[_0xeb78('0x66')];_0x360550+=0x1){for(var _0xb71900=0x0,_0x5eda58;_0xb71900<_0x53ac95[_0x360550][_0xeb78('0x2a')]['length'];_0xb71900+=0x1){_0x5eda58=_0x53ac95[_0x360550][_0xeb78('0x2a')][_0xb71900][_0xeb78('0x26')]({'plain':!![]});_0xe939bd[_0x5eda58['id']]=_0x5eda58;}}_0xe939bd=_[_0xeb78('0x11a')](_0xe939bd);for(var _0x3add5c=qs[_0xeb78('0x1b')](_0x12f7d9[_0xeb78('0x40')][_0xeb78('0x1b')]);_0x3add5c<_0xe939bd[_0xeb78('0x66')]&&_0x36b293[_0xeb78('0x66')]=_0x1ffc1d[_0x4fa9('0x4f')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x4fa9('0x17')](function(){if(_0x38bed9){return db[_0x4fa9('0x27')][_0x4fa9('0x44')]({'where':{'membername':_0x38bed9[_0x4fa9('0x2a')]},'individualHooks':!![]});}})[_0x4fa9('0x17')](function(){if(_0x38bed9){return _0x38bed9[_0x4fa9('0x50')]({'raw':!![]});}})[_0x4fa9('0x17')](function(_0x515a2e){if(_0x38bed9){if(_0x515a2e){var _0x4252c1=[];_0x59fceb=_0x515a2e;if(_0x59fceb[_0x4fa9('0x45')]){for(var _0x12d395=0x0;_0x12d395<_0x59fceb[_0x4fa9('0x45')];_0x12d395++){_0x4252c1[_0x4fa9('0x2e')](db[_0x4fa9('0x27')][_0x4fa9('0x51')]({'membername':_0x38bed9[_0x4fa9('0x2a')],'UserId':_0x38bed9['id'],'queue_name':_0x59fceb[_0x12d395][_0x4fa9('0x2a')],'VoiceQueueId':_0x59fceb[_0x12d395]['id'],'interface':_0x56fc63,'paused':_0x38bed9['loginInPause']||![],'penalty':_0x59fceb[_0x12d395][_0x4fa9('0x52')]||0x0}));}return BPromise[_0x4fa9('0x46')](_0x4252c1);}}}})['then'](function(){if(_0x38bed9){return db[_0x4fa9('0x29')][_0x4fa9('0xe')]({'where':{'membername':_0x38bed9[_0x4fa9('0x2a')],'exitAt':null}});}})[_0x4fa9('0x17')](function(_0xa2cdd1){if(_0x38bed9){if(_0xa2cdd1&&_0xa2cdd1['length']){var _0x4f1a99=[];_0xa2cdd1[_0x4fa9('0x2d')](function(_0x58cc20){_0x4f1a99[_0x4fa9('0x2e')](_0x58cc20[_0x4fa9('0x28')]({'exitAt':moment()['format'](_0x4fa9('0x31'))}));});return BPromise['all'](_0x4f1a99);}}})[_0x4fa9('0x17')](function(){if(_0x38bed9){var _0x5c06ef=[];var _0x795a69=[];var _0x141b42=utils[_0x4fa9('0x2c')]();var _0x2ece2f={'membername':_0x38bed9['name'],'interface':_0x56fc63,'enterAt':moment()['format'](_0x4fa9('0x31')),'role':_0x38bed9[_0x4fa9('0x22')],'internal':_0x38bed9[_0x4fa9('0x23')]};_0x141b42['forEach'](function(_0x3a1edc){_0x5c06ef['push'](_[_0x4fa9('0x53')]({'channel':_0x3a1edc,'type':_0x4fa9('0x54'),'data1':_0x4fa9('0x55'),'data2':_0x56fc63},_0x2ece2f));if(_0x38bed9['loginInPause']){_0x795a69[_0x4fa9('0x2e')](_[_0x4fa9('0x53')]({'channel':_0x3a1edc,'type':'PAUSE','data1':'LOGININPAUSE'},_0x2ece2f));}});return db['MemberReport']['bulkCreate'](_0x5c06ef[_0x4fa9('0x56')](_0x795a69),{'individualHooks':!![]});}})[_0x4fa9('0x17')](function(){if(_0x38bed9){return _0x38bed9[_0x4fa9('0x28')]({'online':!![],'lastLoginAt':moment()[_0x4fa9('0x25')](_0x4fa9('0x31')),'voicePause':_0x38bed9[_0x4fa9('0x49')]||![],'mailPause':_0x38bed9[_0x4fa9('0x49')]||![],'chatPause':_0x38bed9[_0x4fa9('0x49')]||![],'faxPause':_0x38bed9[_0x4fa9('0x49')]||![],'smsPause':_0x38bed9['loginInPause']||![],'openchannelPause':_0x38bed9['loginInPause']||![],'pauseType':_0x38bed9[_0x4fa9('0x49')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x4fa9('0x25')](_0x4fa9('0x31')),'interface':_0x56fc63});}})['then'](function(_0x829d03){_0x186056(_0x829d03);})[_0x4fa9('0x20')](function(_0x3d2cba){_0x5644df(_0x1b676d[_0x4fa9('0x1b')](0x1f4,_0x3d2cba[_0x4fa9('0x1c')]));});});}; \ No newline at end of file +var _0x1aff=['getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','role','internal','uniqueid','MemberReport','bulkCreate','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','chatPause','openchannelPause','whatsappPause','pauseType','lastPauseAt','system','LogoutUser','destroy','findAll','all','update','mobile','phone','agent','../../config/license/util','getLicense','agents','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','merge','LOGIN','LOGININPAUSE','concat','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','GetUser','User','options','raw','where','attributes','limit','include','model','map','info','stringify','catch','error','message','ShowUser','then','debug','PauseUser','find','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','name','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes'];(function(_0x58822c,_0xcb64fc){var _0x3f2966=function(_0x229d33){while(--_0x229d33){_0x58822c['push'](_0x58822c['shift']());}};_0x3f2966(++_0xcb64fc);}(_0x1aff,0x136));var _0xf1af=function(_0x5f97b4,_0x1e52bb){_0x5f97b4=_0x5f97b4-0x0;var _0x201e39=_0x1aff[_0x5f97b4];return _0x201e39;};'use strict';var _=require('lodash');var util=require(_0xf1af('0x0'));var moment=require(_0xf1af('0x1'));var BPromise=require(_0xf1af('0x2'));var Redis=require(_0xf1af('0x3'));var db=require(_0xf1af('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf1af('0x5'));var config=require(_0xf1af('0x6'));config[_0xf1af('0x7')]=_[_0xf1af('0x8')](config[_0xf1af('0x7')],{'host':_0xf1af('0x9'),'port':0x18eb});var socket=require(_0xf1af('0xa'))(new Redis(config[_0xf1af('0x7')]));require('./user.socket')[_0xf1af('0xb')](socket);exports[_0xf1af('0xc')]=function(_0x3685da){var _0x38fd7e=this;return new Promise(function(_0xc6844a,_0x527d32){return db[_0xf1af('0xd')]['findAll']({'raw':_0x3685da[_0xf1af('0xe')]?_0x3685da['options'][_0xf1af('0xf')]===undefined?!![]:![]:!![],'where':_0x3685da[_0xf1af('0xe')]?_0x3685da[_0xf1af('0xe')][_0xf1af('0x10')]||null:null,'attributes':_0x3685da[_0xf1af('0xe')]?_0x3685da['options'][_0xf1af('0x11')]||null:null,'limit':_0x3685da[_0xf1af('0xe')]?_0x3685da[_0xf1af('0xe')][_0xf1af('0x12')]||null:null,'include':_0x3685da[_0xf1af('0xe')]?_0x3685da[_0xf1af('0xe')][_0xf1af('0x13')]?_['map'](_0x3685da[_0xf1af('0xe')][_0xf1af('0x13')],function(_0x589864){return{'model':db[_0x589864[_0xf1af('0x14')]],'as':_0x589864['as'],'attributes':_0x589864[_0xf1af('0x11')],'include':_0x589864['include']?_[_0xf1af('0x15')](_0x589864[_0xf1af('0x13')],function(_0x285227){return{'model':db[_0x285227[_0xf1af('0x14')]],'as':_0x285227['as'],'attributes':_0x285227[_0xf1af('0x11')],'include':_0x285227[_0xf1af('0x13')]?_[_0xf1af('0x15')](_0x285227[_0xf1af('0x13')],function(_0x340716){return{'model':db[_0x340716[_0xf1af('0x14')]],'as':_0x340716['as'],'attributes':_0x340716['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3eb753){logger[_0xf1af('0x16')]('GetUser',_0x3685da);logger['debug'](_0xf1af('0xc'),_0x3685da,JSON[_0xf1af('0x17')](_0x3eb753));_0xc6844a(_0x3eb753);})[_0xf1af('0x18')](function(_0x246e30){logger[_0xf1af('0x19')](_0xf1af('0xc'),_0x246e30[_0xf1af('0x1a')],_0x3685da);_0x527d32(_0x38fd7e[_0xf1af('0x19')](0x1f4,_0x246e30[_0xf1af('0x1a')]));});});};exports[_0xf1af('0x1b')]=function(_0x516166){var _0x3370d1=this;return new Promise(function(_0x524cde,_0xbe42aa){return db['User']['find']({'raw':_0x516166[_0xf1af('0xe')]?_0x516166['options']['raw']===undefined?!![]:![]:!![],'where':_0x516166[_0xf1af('0xe')]?_0x516166[_0xf1af('0xe')]['where']||null:null,'attributes':_0x516166['options']?_0x516166['options'][_0xf1af('0x11')]||null:null,'include':_0x516166[_0xf1af('0xe')]?_0x516166[_0xf1af('0xe')][_0xf1af('0x13')]?_[_0xf1af('0x15')](_0x516166[_0xf1af('0xe')][_0xf1af('0x13')],function(_0x42dfc3){return{'model':db[_0x42dfc3['model']],'as':_0x42dfc3['as'],'attributes':_0x42dfc3[_0xf1af('0x11')],'include':_0x42dfc3[_0xf1af('0x13')]?_['map'](_0x42dfc3[_0xf1af('0x13')],function(_0x28be2b){return{'model':db[_0x28be2b[_0xf1af('0x14')]],'as':_0x28be2b['as'],'attributes':_0x28be2b[_0xf1af('0x11')],'include':_0x28be2b['include']?_['map'](_0x28be2b[_0xf1af('0x13')],function(_0x5afc08){return{'model':db[_0x5afc08[_0xf1af('0x14')]],'as':_0x5afc08['as'],'attributes':_0x5afc08[_0xf1af('0x11')]};}):[]};}):[]};}):[]:[]})[_0xf1af('0x1c')](function(_0x4eb132){logger[_0xf1af('0x16')](_0xf1af('0x1b'),_0x516166);logger[_0xf1af('0x1d')](_0xf1af('0x1b'),_0x516166,JSON[_0xf1af('0x17')](_0x4eb132));_0x524cde(_0x4eb132);})['catch'](function(_0x5aee63){logger[_0xf1af('0x19')]('ShowUser',_0x5aee63[_0xf1af('0x1a')],_0x516166);_0xbe42aa(_0x3370d1[_0xf1af('0x19')](0x1f4,_0x5aee63[_0xf1af('0x1a')]));});});};exports[_0xf1af('0x1e')]=function(_0x40b760){var _0x3115d2;return db[_0xf1af('0xd')][_0xf1af('0x1f')]({'where':_0x40b760[_0xf1af('0xe')][_0xf1af('0x10')]||{},'attributes':['id','name','role','internal',_0xf1af('0x20')]})[_0xf1af('0x1c')](function(_0x552338){if(!_0x552338){throw new Error(util[_0xf1af('0x21')](_0xf1af('0x22'),_0x40b760[_0xf1af('0x23')]['id']));}_0x3115d2=_0x552338;return db[_0xf1af('0x24')]['update']({'paused':0x1},{'where':{'UserId':_0x3115d2['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x3115d2[_0xf1af('0x25')],'type':_0xf1af('0x26'),'exitAt':null}});})[_0xf1af('0x1c')](function(_0xc1e4b6){if(_0xc1e4b6&&_0xc1e4b6[_0xf1af('0x27')]){var _0x373b48=moment()[_0xf1af('0x21')](_0xf1af('0x28'));for(var _0x591bec=0x0,_0x42a527=_0xc1e4b6['length'];_0x591bec<_0x42a527;_0x591bec++){_0xc1e4b6[_0x591bec][_0xf1af('0x29')]({'exitAt':_0x373b48});}}})['then'](function(){var _0xab2d96=[];var _0x1840e2=utils[_0xf1af('0x2a')]();_0x1840e2[_0xf1af('0x2b')](function(_0x11b71a){_0xab2d96[_0xf1af('0x2c')]({'channel':_0x11b71a,'membername':_0x3115d2[_0xf1af('0x25')],'interface':_[_0xf1af('0x2d')](_0x3115d2['interface'])?util[_0xf1af('0x21')](_0xf1af('0x2e'),_0x3115d2['name']):_0x3115d2[_0xf1af('0x20')],'type':_0xf1af('0x26'),'enterAt':moment()[_0xf1af('0x21')](_0xf1af('0x28')),'data1':_0x40b760[_0xf1af('0x2f')][_0xf1af('0x30')]||_0xf1af('0x31'),'role':_0x3115d2[_0xf1af('0x32')],'internal':_0x3115d2[_0xf1af('0x33')],'uniqueid':_0x40b760[_0xf1af('0x2f')][_0xf1af('0x34')]||null});});return db[_0xf1af('0x35')][_0xf1af('0x36')](_0xab2d96,{'individualHooks':!![]});})[_0xf1af('0x1c')](function(){return _0x3115d2['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x40b760[_0xf1af('0x2f')][_0xf1af('0x30')]||_0xf1af('0x31'),'lastPauseAt':moment()[_0xf1af('0x21')](_0xf1af('0x28'))});})['catch'](function(_0x24a023){throw _0x24a023;});};exports[_0xf1af('0x37')]=function(_0x5be9c1){return Promise[_0xf1af('0x38')]()[_0xf1af('0x1c')](function(){if(_0x5be9c1[_0xf1af('0x2f')][_0xf1af('0x39')]&&!utils[_0xf1af('0x3a')](_0x5be9c1[_0xf1af('0x2f')]['channel'])){throw new Error(util[_0xf1af('0x21')](_0xf1af('0x3b'),_0x5be9c1[_0xf1af('0x2f')][_0xf1af('0x39')]));}return db[_0xf1af('0xd')][_0xf1af('0x3c')]({'where':_0x5be9c1[_0xf1af('0xe')][_0xf1af('0x10')]||{},'attributes':['id',_0xf1af('0x25'),_0xf1af('0x32'),'internal',_0xf1af('0x20'),_0xf1af('0x3d'),_0xf1af('0x3e'),_0xf1af('0x3f'),_0xf1af('0x40'),'faxPause',_0xf1af('0x41'),'smsPause',_0xf1af('0x42'),_0xf1af('0x43'),_0xf1af('0x44')]});})['then'](function(_0x3e6425){if(!_0x3e6425){throw new Error(util[_0xf1af('0x21')](_0xf1af('0x22'),_0x5be9c1[_0xf1af('0x23')]['id']));}return _0x3e6425['unpause'](_0x5be9c1[_0xf1af('0x2f')][_0xf1af('0x39')],_0xf1af('0x45'));})[_0xf1af('0x18')](function(_0x3e3d56){throw _0x3e3d56;});};exports[_0xf1af('0x46')]=function(_0x4d42a2){var _0x2b1abe=this;return new Promise(function(_0x1db1ae,_0x3b8c7b){var _0x15baec;return db[_0xf1af('0xd')]['findOne']({'where':_0x4d42a2[_0xf1af('0xe')][_0xf1af('0x10')]||{},'attributes':['id','name']})[_0xf1af('0x1c')](function(_0x7b0a46){if(_0x7b0a46){_0x15baec=_0x7b0a46;return db['UserVoiceQueueRt'][_0xf1af('0x47')]({'where':{'membername':_0x15baec[_0xf1af('0x25')]},'individualHooks':!![]});}})['then'](function(){if(_0x15baec){return db[_0xf1af('0x35')][_0xf1af('0x48')]({'where':{'membername':_0x15baec[_0xf1af('0x25')],'exitAt':null}});}})[_0xf1af('0x1c')](function(_0x297259){if(_0x15baec){if(_0x297259&&_0x297259[_0xf1af('0x27')]){var _0x41a1d9=[];_0x297259[_0xf1af('0x2b')](function(_0x118b3e){_0x41a1d9[_0xf1af('0x2c')](_0x118b3e['update']({'exitAt':moment()['format'](_0xf1af('0x28'))}));});return BPromise[_0xf1af('0x49')](_0x41a1d9);}}})[_0xf1af('0x1c')](function(){if(_0x15baec){return _0x15baec[_0xf1af('0x4a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xf1af('0x1c')](function(_0x5a5e5f){_0x1db1ae(_0x5a5e5f);})[_0xf1af('0x18')](function(_0x2c9af9){_0x3b8c7b(_0x2b1abe[_0xf1af('0x19')](0x1f4,_0x2c9af9['message']));});});};exports['LoginUser']=function(_0x278733){var _0x31d769=this;return new Promise(function(_0x3475f4,_0x50a694){var _0x51a1bd;var _0x54998f;var _0x3d768c;var _0x55e41c;return db[_0xf1af('0xd')]['findOne']({'where':_0x278733['options']['where']||{},'attributes':['id',_0xf1af('0x25'),_0xf1af('0x32'),_0xf1af('0x4b'),_0xf1af('0x4c'),_0xf1af('0x33'),'loginInPause',_0xf1af('0x20')]})[_0xf1af('0x1c')](function(_0x17b077){if(_0x17b077){_0x51a1bd=_0x17b077;_0x55e41c=_0x278733[_0xf1af('0x2f')]['interface']?_0x278733[_0xf1af('0x2f')][_0xf1af('0x20')]:util[_0xf1af('0x21')](_0xf1af('0x2e'),_0x51a1bd[_0xf1af('0x25')]);return db[_0xf1af('0xd')]['count']({'where':{'role':_0xf1af('0x4d'),'online':!![],'id':{'$ne':_0x51a1bd['id']}}});}})[_0xf1af('0x1c')](function(_0x5d3f06){if(_0x5d3f06){_0x3d768c=_0x5d3f06;return require(_0xf1af('0x4e'))[_0xf1af('0x4f')]();}})[_0xf1af('0x1c')](function(_0x383e6d){if(_0x383e6d&&_0x383e6d[_0xf1af('0x50')]&&_0x3d768c>=_0x383e6d[_0xf1af('0x50')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xf1af('0x1c')](function(){if(_0x51a1bd){return db[_0xf1af('0x24')][_0xf1af('0x47')]({'where':{'membername':_0x51a1bd[_0xf1af('0x25')]},'individualHooks':!![]});}})['then'](function(){if(_0x51a1bd){return _0x51a1bd[_0xf1af('0x51')]({'raw':!![]});}})[_0xf1af('0x1c')](function(_0x524601){if(_0x51a1bd){if(_0x524601){var _0x3487f8=[];_0x54998f=_0x524601;if(_0x54998f[_0xf1af('0x27')]){for(var _0x6e6219=0x0;_0x6e6219<_0x54998f['length'];_0x6e6219++){_0x3487f8['push'](db[_0xf1af('0x24')]['upsert']({'membername':_0x51a1bd[_0xf1af('0x25')],'UserId':_0x51a1bd['id'],'queue_name':_0x54998f[_0x6e6219]['name'],'VoiceQueueId':_0x54998f[_0x6e6219]['id'],'interface':_0x55e41c,'paused':_0x51a1bd[_0xf1af('0x52')]||![],'penalty':_0x54998f[_0x6e6219][_0xf1af('0x53')]||0x0}));}return BPromise[_0xf1af('0x49')](_0x3487f8);}}}})[_0xf1af('0x1c')](function(){if(_0x51a1bd){return db[_0xf1af('0x35')][_0xf1af('0x48')]({'where':{'membername':_0x51a1bd[_0xf1af('0x25')],'exitAt':null}});}})[_0xf1af('0x1c')](function(_0x143014){if(_0x51a1bd){if(_0x143014&&_0x143014[_0xf1af('0x27')]){var _0x1acfca=[];_0x143014[_0xf1af('0x2b')](function(_0x5827ab){_0x1acfca[_0xf1af('0x2c')](_0x5827ab[_0xf1af('0x4a')]({'exitAt':moment()[_0xf1af('0x21')](_0xf1af('0x28'))}));});return BPromise[_0xf1af('0x49')](_0x1acfca);}}})[_0xf1af('0x1c')](function(){if(_0x51a1bd){var _0x34f3eb=[];var _0x129e87=[];var _0x34eb04=utils[_0xf1af('0x2a')]();var _0x571797={'membername':_0x51a1bd[_0xf1af('0x25')],'interface':_0x55e41c,'enterAt':moment()[_0xf1af('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x51a1bd['role'],'internal':_0x51a1bd[_0xf1af('0x33')]};_0x34eb04[_0xf1af('0x2b')](function(_0x47494a){_0x34f3eb[_0xf1af('0x2c')](_[_0xf1af('0x54')]({'channel':_0x47494a,'type':_0xf1af('0x55'),'data1':'callysquare','data2':_0x55e41c},_0x571797));if(_0x51a1bd['loginInPause']){_0x129e87[_0xf1af('0x2c')](_[_0xf1af('0x54')]({'channel':_0x47494a,'type':'PAUSE','data1':_0xf1af('0x56')},_0x571797));}});return db[_0xf1af('0x35')][_0xf1af('0x36')](_0x34f3eb[_0xf1af('0x57')](_0x129e87),{'individualHooks':!![]});}})['then'](function(){if(_0x51a1bd){return _0x51a1bd[_0xf1af('0x4a')]({'online':!![],'lastLoginAt':moment()['format'](_0xf1af('0x28')),'voicePause':_0x51a1bd['loginInPause']||![],'mailPause':_0x51a1bd[_0xf1af('0x52')]||![],'chatPause':_0x51a1bd['loginInPause']||![],'faxPause':_0x51a1bd[_0xf1af('0x52')]||![],'smsPause':_0x51a1bd[_0xf1af('0x52')]||![],'openchannelPause':_0x51a1bd[_0xf1af('0x52')]||![],'pauseType':_0x51a1bd['loginInPause']?_0xf1af('0x56'):null,'lastPauseAt':moment()[_0xf1af('0x21')](_0xf1af('0x28')),'interface':_0x55e41c});}})[_0xf1af('0x1c')](function(_0x2b81e5){_0x3475f4(_0x2b81e5);})[_0xf1af('0x18')](function(_0x1e98a7){_0x50a694(_0x31d769[_0xf1af('0x19')](0x1f4,_0x1e98a7[_0xf1af('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 95fe51d..dd64226 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 _0x3b52=['emit','removeListener','register','length','user:','./user.events','save','update'];(function(_0x1602fb,_0x20b6b3){var _0x461831=function(_0x4a19f1){while(--_0x4a19f1){_0x1602fb['push'](_0x1602fb['shift']());}};_0x461831(++_0x20b6b3);}(_0x3b52,0x1ed));var _0x23b5=function(_0xb0799e,_0x398076){_0xb0799e=_0xb0799e-0x0;var _0x3ddc9c=_0x3b52[_0xb0799e];return _0x3ddc9c;};'use strict';var UserEvents=require(_0x23b5('0x0'));var events=[_0x23b5('0x1'),'remove',_0x23b5('0x2')];function createListener(_0x2af166,_0xbc55ae){return function(_0xa6b32f){_0xbc55ae[_0x23b5('0x3')](_0x2af166,_0xa6b32f);};}function removeListener(_0x45b61f,_0x336503){return function(){UserEvents[_0x23b5('0x4')](_0x45b61f,_0x336503);};}exports[_0x23b5('0x5')]=function(_0xe3b853){for(var _0x371361=0x0,_0x433ab8=events[_0x23b5('0x6')];_0x371361<_0x433ab8;_0x371361++){var _0x319dd6=events[_0x371361];var _0x119f1f=createListener(_0x23b5('0x7')+_0x319dd6,_0xe3b853);UserEvents['on'](_0x319dd6,_0x119f1f);}}; \ No newline at end of file +var _0xead6=['removeListener','user:','./user.events','save','remove','update','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xead6,0xd4));var _0x6ead=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xead6[_0xfae23b];return _0x200640;};'use strict';var UserEvents=require(_0x6ead('0x0'));var events=[_0x6ead('0x1'),_0x6ead('0x2'),_0x6ead('0x3')];function createListener(_0x1b0622,_0x372216){return function(_0x436034){_0x372216[_0x6ead('0x4')](_0x1b0622,_0x436034);};}function removeListener(_0x65d850,_0x164e0a){return function(){UserEvents[_0x6ead('0x5')](_0x65d850,_0x164e0a);};}exports['register']=function(_0x290a9d){for(var _0x3354c3=0x0,_0x4072a6=events['length'];_0x3354c3<_0x4072a6;_0x3354c3++){var _0x4e24a2=events[_0x3354c3];var _0x23667a=createListener(_0x6ead('0x6')+_0x4e24a2,_0x290a9d);UserEvents['on'](_0x4e24a2,_0x23667a);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index c8c1da8..0ce963f 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1528b3,_0x411db6){var _0x5c0ffc=function(_0x487d7a){while(--_0x487d7a){_0x1528b3['push'](_0x1528b3['shift']());}};_0x5c0ffc(++_0x411db6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x827220,_0x3bc6da){var _0x386ba0=function(_0x5cef1e){while(--_0x5cef1e){_0x827220['push'](_0x827220['shift']());}};_0x386ba0(++_0x3bc6da);}(_0xe706,0xa3));var _0x6e70=function(_0x3f59b1,_0x25cdbe){_0x3f59b1=_0x3f59b1-0x0;var _0x11d2e8=_0xe706[_0x3f59b1];return _0x11d2e8;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index ddab4fa..9e4f3fb 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 _0x9520=['INTEGER','sequelize','exports'];(function(_0x51d129,_0x175d7d){var _0x44c377=function(_0x5ee454){while(--_0x5ee454){_0x51d129['push'](_0x51d129['shift']());}};_0x44c377(++_0x175d7d);}(_0x9520,0xfd));var _0x0952=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x9520[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0x0952('0x0'));module[_0x0952('0x1')]={'penalty':{'type':Sequelize[_0x0952('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x30ea=['INTEGER'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x30ea,0x13a));var _0xa30e=function(_0xd75eec,_0xf6aa2c){_0xd75eec=_0xd75eec-0x0;var _0x548dc3=_0x30ea[_0xd75eec];return _0x548dc3;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xa30e('0x0')],'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 4146b74..f5f2cf1 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 _0x4a86=['./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x5839cd,_0x2f2a8f){var _0x368336=function(_0x584467){while(--_0x584467){_0x5839cd['push'](_0x5839cd['shift']());}};_0x368336(++_0x2f2a8f);}(_0x4a86,0x1b2));var _0x64a8=function(_0x317bb2,_0x3212a0){_0x317bb2=_0x317bb2-0x0;var _0x29b6ec=_0x4a86[_0x317bb2];return _0x29b6ec;};'use strict';var _=require(_0x64a8('0x0'));var util=require(_0x64a8('0x1'));var logger=require(_0x64a8('0x2'))(_0x64a8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x64a8('0x4'));var fs=require('fs');var path=require(_0x64a8('0x5'));var rimraf=require(_0x64a8('0x6'));var config=require(_0x64a8('0x7'));var attributes=require(_0x64a8('0x8'));module[_0x64a8('0x9')]=function(_0x39453b,_0x4a51d3){return _0x39453b[_0x64a8('0xa')](_0x64a8('0xb'),attributes,{'tableName':_0x64a8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7efb=['define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','moment','bluebird','rimraf','./userChatQueue.attributes'];(function(_0x47450b,_0x5b87e4){var _0x2aa458=function(_0x206158){while(--_0x206158){_0x47450b['push'](_0x47450b['shift']());}};_0x2aa458(++_0x5b87e4);}(_0x7efb,0x1cf));var _0xb7ef=function(_0x7e5a5c,_0x1531cb){_0x7e5a5c=_0x7e5a5c-0x0;var _0x3a73cd=_0x7efb[_0x7e5a5c];return _0x3a73cd;};'use strict';var _=require(_0xb7ef('0x0'));var util=require(_0xb7ef('0x1'));var logger=require(_0xb7ef('0x2'))('api');var moment=require(_0xb7ef('0x3'));var BPromise=require(_0xb7ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb7ef('0x5'));var config=require('../../config/environment');var attributes=require(_0xb7ef('0x6'));module['exports']=function(_0x1a38aa,_0x543a71){return _0x1a38aa[_0xb7ef('0x7')](_0xb7ef('0x8'),attributes,{'tableName':_0xb7ef('0x9'),'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 8922f75..a3c8df1 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 _0xcf11=['UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x547524,_0x32b16b){var _0x49e72b=function(_0xa8ec0f){while(--_0xa8ec0f){_0x547524['push'](_0x547524['shift']());}};_0x49e72b(++_0x32b16b);}(_0xcf11,0x141));var _0x1cf1=function(_0x2a99e2,_0x1803e4){_0x2a99e2=_0x2a99e2-0x0;var _0x23fb5f=_0xcf11[_0x2a99e2];return _0x23fb5f;};'use strict';var _=require(_0x1cf1('0x0'));var util=require(_0x1cf1('0x1'));var moment=require('moment');var BPromise=require(_0x1cf1('0x2'));var rs=require(_0x1cf1('0x3'));var fs=require('fs');var Redis=require(_0x1cf1('0x4'));var db=require(_0x1cf1('0x5'))['db'];var utils=require(_0x1cf1('0x6'));var logger=require(_0x1cf1('0x7'))(_0x1cf1('0x8'));var config=require(_0x1cf1('0x9'));var jayson=require(_0x1cf1('0xa'));var client=jayson[_0x1cf1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x409e94,_0x326c16,_0xb28060){return new BPromise(function(_0x559408,_0x3e259a){return client[_0x1cf1('0xc')](_0x409e94,_0xb28060)[_0x1cf1('0xd')](function(_0x52d075){logger[_0x1cf1('0xe')](_0x1cf1('0xf'),_0x326c16,'request\x20sent');logger[_0x1cf1('0x10')](_0x1cf1('0x11'),_0x326c16,_0x1cf1('0x12'),JSON['stringify'](_0x52d075));if(_0x52d075['error']){if(_0x52d075[_0x1cf1('0x13')][_0x1cf1('0x14')]===0x1f4){logger[_0x1cf1('0x13')](_0x1cf1('0xf'),_0x326c16,_0x52d075[_0x1cf1('0x13')][_0x1cf1('0x15')]);return _0x3e259a(_0x52d075[_0x1cf1('0x13')]['message']);}logger[_0x1cf1('0x13')](_0x1cf1('0xf'),_0x326c16,_0x52d075[_0x1cf1('0x13')][_0x1cf1('0x15')]);return _0x559408(_0x52d075[_0x1cf1('0x13')]['message']);}else{logger[_0x1cf1('0xe')](_0x1cf1('0xf'),_0x326c16,'request\x20sent');_0x559408(_0x52d075[_0x1cf1('0x16')][_0x1cf1('0x15')]);}})[_0x1cf1('0x17')](function(_0xe7b651){logger[_0x1cf1('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x326c16,_0xe7b651);_0x3e259a(_0xe7b651);});});} \ No newline at end of file +var _0xe1a5=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe1a5,0x6e));var _0x5e1a=function(_0x113718,_0x399057){_0x113718=_0x113718-0x0;var _0x470973=_0xe1a5[_0x113718];return _0x470973;};'use strict';var _=require(_0x5e1a('0x0'));var util=require(_0x5e1a('0x1'));var moment=require(_0x5e1a('0x2'));var BPromise=require(_0x5e1a('0x3'));var rs=require(_0x5e1a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e1a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e1a('0x6'))(_0x5e1a('0x7'));var config=require(_0x5e1a('0x8'));var jayson=require(_0x5e1a('0x9'));var client=jayson['client'][_0x5e1a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26107b,_0x2c2d6e,_0x4b1269){return new BPromise(function(_0x20b756,_0x2428b3){return client[_0x5e1a('0xb')](_0x26107b,_0x4b1269)['then'](function(_0x5de095){logger[_0x5e1a('0xc')](_0x5e1a('0xd'),_0x2c2d6e,_0x5e1a('0xe'));logger[_0x5e1a('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x2c2d6e,_0x5e1a('0xe'),JSON['stringify'](_0x5de095));if(_0x5de095[_0x5e1a('0x10')]){if(_0x5de095[_0x5e1a('0x10')][_0x5e1a('0x11')]===0x1f4){logger[_0x5e1a('0x10')](_0x5e1a('0xd'),_0x2c2d6e,_0x5de095['error'][_0x5e1a('0x12')]);return _0x2428b3(_0x5de095[_0x5e1a('0x10')]['message']);}logger['error'](_0x5e1a('0xd'),_0x2c2d6e,_0x5de095[_0x5e1a('0x10')]['message']);return _0x20b756(_0x5de095[_0x5e1a('0x10')][_0x5e1a('0x12')]);}else{logger[_0x5e1a('0xc')](_0x5e1a('0xd'),_0x2c2d6e,_0x5e1a('0xe'));_0x20b756(_0x5de095[_0x5e1a('0x13')][_0x5e1a('0x12')]);}})[_0x5e1a('0x14')](function(_0x39461e){logger[_0x5e1a('0x10')](_0x5e1a('0xd'),_0x2c2d6e,_0x39461e);_0x2428b3(_0x39461e);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index d71a338..3a4017b 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x26acd8,_0x20c2c4){var _0x478ade=function(_0x3a5b5c){while(--_0x3a5b5c){_0x26acd8['push'](_0x26acd8['shift']());}};_0x478ade(++_0x20c2c4);}(_0x70e0,0x17b));var _0x070e=function(_0x28df04,_0xd9259){_0x28df04=_0x28df04-0x0;var _0x385cc6=_0x70e0[_0x28df04];return _0x385cc6;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x15b1ec,_0x15ee62){var _0x33320c=function(_0x26e74d){while(--_0x26e74d){_0x15b1ec['push'](_0x15b1ec['shift']());}};_0x33320c(++_0x15ee62);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index b9554a5..c54f705 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 _0x84a1=['sequelize','exports','INTEGER'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x84a1,0x138));var _0x184a=function(_0x21b496,_0x33a847){_0x21b496=_0x21b496-0x0;var _0xe585d9=_0x84a1[_0x21b496];return _0xe585d9;};'use strict';var Sequelize=require(_0x184a('0x0'));module[_0x184a('0x1')]={'penalty':{'type':Sequelize[_0x184a('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x184a('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1103=['STRING','exports','INTEGER'];(function(_0xda07da,_0x34fa3a){var _0x5ce92a=function(_0x15decd){while(--_0x15decd){_0xda07da['push'](_0xda07da['shift']());}};_0x5ce92a(++_0x34fa3a);}(_0x1103,0x10f));var _0x3110=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1103[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0x3110('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3110('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x3110('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index a5930af..a1ca216 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 _0xf166=['rimraf','../../config/environment','./userFaxQueue.attributes','define','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x6e10e7,_0x3ab3f5){var _0x3308f9=function(_0x36662d){while(--_0x36662d){_0x6e10e7['push'](_0x6e10e7['shift']());}};_0x3308f9(++_0x3ab3f5);}(_0xf166,0xae));var _0x6f16=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf166[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x6f16('0x0'));var util=require(_0x6f16('0x1'));var logger=require(_0x6f16('0x2'))('api');var moment=require(_0x6f16('0x3'));var BPromise=require(_0x6f16('0x4'));var rp=require(_0x6f16('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f16('0x6'));var config=require(_0x6f16('0x7'));var attributes=require(_0x6f16('0x8'));module['exports']=function(_0x2adf90,_0x587f7c){return _0x2adf90[_0x6f16('0x9')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75d5=['exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x5a18e3,_0x5bdc42){var _0x5c5f3e=function(_0x122ade){while(--_0x122ade){_0x5a18e3['push'](_0x5a18e3['shift']());}};_0x5c5f3e(++_0x5bdc42);}(_0x75d5,0x162));var _0x575d=function(_0xb86b38,_0x29b500){_0xb86b38=_0xb86b38-0x0;var _0x393410=_0x75d5[_0xb86b38];return _0x393410;};'use strict';var _=require(_0x575d('0x0'));var util=require(_0x575d('0x1'));var logger=require('../../config/logger')(_0x575d('0x2'));var moment=require(_0x575d('0x3'));var BPromise=require(_0x575d('0x4'));var rp=require(_0x575d('0x5'));var fs=require('fs');var path=require(_0x575d('0x6'));var rimraf=require(_0x575d('0x7'));var config=require(_0x575d('0x8'));var attributes=require(_0x575d('0x9'));module[_0x575d('0xa')]=function(_0x39a6de,_0x19c3bd){return _0x39a6de[_0x575d('0xb')](_0x575d('0xc'),attributes,{'tableName':_0x575d('0xd'),'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 c320673..222c604 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 _0xf8e1=['debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x46b1c9,_0x169f87){var _0x17569c=function(_0x4b7c45){while(--_0x4b7c45){_0x46b1c9['push'](_0x46b1c9['shift']());}};_0x17569c(++_0x169f87);}(_0xf8e1,0x15c));var _0x1f8e=function(_0x1dd524,_0x22ce03){_0x1dd524=_0x1dd524-0x0;var _0x2ad2a7=_0xf8e1[_0x1dd524];return _0x2ad2a7;};'use strict';var _=require(_0x1f8e('0x0'));var util=require(_0x1f8e('0x1'));var moment=require('moment');var BPromise=require(_0x1f8e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f8e('0x3'));var db=require(_0x1f8e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1f8e('0x5'));var config=require(_0x1f8e('0x6'));var jayson=require(_0x1f8e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bfbb3,_0x3c1185,_0x51bbcd){return new BPromise(function(_0x514a06,_0x89d62f){return client[_0x1f8e('0x8')](_0x2bfbb3,_0x51bbcd)[_0x1f8e('0x9')](function(_0x3580e8){logger[_0x1f8e('0xa')](_0x1f8e('0xb'),_0x3c1185,_0x1f8e('0xc'));logger[_0x1f8e('0xd')](_0x1f8e('0xe'),_0x3c1185,_0x1f8e('0xc'),JSON[_0x1f8e('0xf')](_0x3580e8));if(_0x3580e8[_0x1f8e('0x10')]){if(_0x3580e8['error']['code']===0x1f4){logger[_0x1f8e('0x10')](_0x1f8e('0xb'),_0x3c1185,_0x3580e8[_0x1f8e('0x10')][_0x1f8e('0x11')]);return _0x89d62f(_0x3580e8[_0x1f8e('0x10')][_0x1f8e('0x11')]);}logger[_0x1f8e('0x10')](_0x1f8e('0xb'),_0x3c1185,_0x3580e8[_0x1f8e('0x10')][_0x1f8e('0x11')]);return _0x514a06(_0x3580e8[_0x1f8e('0x10')][_0x1f8e('0x11')]);}else{logger[_0x1f8e('0xa')](_0x1f8e('0xb'),_0x3c1185,_0x1f8e('0xc'));_0x514a06(_0x3580e8['result'][_0x1f8e('0x11')]);}})[_0x1f8e('0x12')](function(_0x20a372){logger[_0x1f8e('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x3c1185,_0x20a372);_0x89d62f(_0x20a372);});});} \ No newline at end of file +var _0xe21e=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x133dc7,_0x15cfef){var _0x583ef6=function(_0xd4c175){while(--_0xd4c175){_0x133dc7['push'](_0x133dc7['shift']());}};_0x583ef6(++_0x15cfef);}(_0xe21e,0x13b));var _0xee21=function(_0x537f9c,_0x256676){_0x537f9c=_0x537f9c-0x0;var _0x5276bb=_0xe21e[_0x537f9c];return _0x5276bb;};'use strict';var _=require(_0xee21('0x0'));var util=require(_0xee21('0x1'));var moment=require('moment');var BPromise=require(_0xee21('0x2'));var rs=require(_0xee21('0x3'));var fs=require('fs');var Redis=require(_0xee21('0x4'));var db=require(_0xee21('0x5'))['db'];var utils=require(_0xee21('0x6'));var logger=require(_0xee21('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xee21('0x8'));var client=jayson[_0xee21('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e0687,_0xcd273b,_0x5acae6){return new BPromise(function(_0xd075f9,_0x5ba4ef){return client[_0xee21('0xa')](_0x3e0687,_0x5acae6)[_0xee21('0xb')](function(_0x1cb702){logger['info'](_0xee21('0xc'),_0xcd273b,'request\x20sent');logger[_0xee21('0xd')](_0xee21('0xe'),_0xcd273b,'request\x20sent',JSON[_0xee21('0xf')](_0x1cb702));if(_0x1cb702[_0xee21('0x10')]){if(_0x1cb702[_0xee21('0x10')][_0xee21('0x11')]===0x1f4){logger[_0xee21('0x10')](_0xee21('0xc'),_0xcd273b,_0x1cb702[_0xee21('0x10')]['message']);return _0x5ba4ef(_0x1cb702[_0xee21('0x10')][_0xee21('0x12')]);}logger[_0xee21('0x10')](_0xee21('0xc'),_0xcd273b,_0x1cb702[_0xee21('0x10')]['message']);return _0xd075f9(_0x1cb702['error'][_0xee21('0x12')]);}else{logger['info'](_0xee21('0xc'),_0xcd273b,'request\x20sent');_0xd075f9(_0x1cb702[_0xee21('0x13')][_0xee21('0x12')]);}})['catch'](function(_0x54a82f){logger[_0xee21('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0xcd273b,_0x54a82f);_0x5ba4ef(_0x54a82f);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 3955a8c..07f5b21 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x31a610,_0x490ec7){var _0x2e15b4=function(_0x2c8280){while(--_0x2c8280){_0x31a610['push'](_0x31a610['shift']());}};_0x2e15b4(++_0x490ec7);}(_0x70e0,0x17b));var _0x070e=function(_0x5731de,_0x1de2eb){_0x5731de=_0x5731de-0x0;var _0x21a8b4=_0x70e0[_0x5731de];return _0x21a8b4;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x12b13b,_0x3394c7){var _0x13f72b=function(_0x278331){while(--_0x278331){_0x12b13b['push'](_0x12b13b['shift']());}};_0x13f72b(++_0x3394c7);}(_0x70e0,0x17b));var _0x070e=function(_0xcaa4f7,_0x1f2fdf){_0xcaa4f7=_0xcaa4f7-0x0;var _0x2503e9=_0x70e0[_0xcaa4f7];return _0x2503e9;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 3dd54d0..9ec2281 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 _0xe8f7=['INTEGER','sequelize','exports'];(function(_0x40d659,_0x1352a5){var _0x1de7f5=function(_0x526e87){while(--_0x526e87){_0x40d659['push'](_0x40d659['shift']());}};_0x1de7f5(++_0x1352a5);}(_0xe8f7,0x112));var _0x7e8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe8f7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7e8f('0x0'));module[_0x7e8f('0x1')]={'penalty':{'type':Sequelize[_0x7e8f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa084=['exports','INTEGER','sequelize'];(function(_0x2c9592,_0x2ba0a7){var _0x1d7983=function(_0x23f278){while(--_0x23f278){_0x2c9592['push'](_0x2c9592['shift']());}};_0x1d7983(++_0x2ba0a7);}(_0xa084,0x7a));var _0x4a08=function(_0x1ab43d,_0x381825){_0x1ab43d=_0x1ab43d-0x0;var _0x56f236=_0xa084[_0x1ab43d];return _0x56f236;};'use strict';var Sequelize=require(_0x4a08('0x0'));module[_0x4a08('0x1')]={'penalty':{'type':Sequelize[_0x4a08('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 9847341..62e7c55 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 _0x8dc2=['../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2f1d17,_0x5076aa){var _0x4b1270=function(_0x55125c){while(--_0x55125c){_0x2f1d17['push'](_0x2f1d17['shift']());}};_0x4b1270(++_0x5076aa);}(_0x8dc2,0xbb));var _0x28dc=function(_0x5f1c59,_0x3fff4c){_0x5f1c59=_0x5f1c59-0x0;var _0xbfb242=_0x8dc2[_0x5f1c59];return _0xbfb242;};'use strict';var _=require(_0x28dc('0x0'));var util=require(_0x28dc('0x1'));var logger=require(_0x28dc('0x2'))(_0x28dc('0x3'));var moment=require(_0x28dc('0x4'));var BPromise=require(_0x28dc('0x5'));var rp=require(_0x28dc('0x6'));var fs=require('fs');var path=require(_0x28dc('0x7'));var rimraf=require('rimraf');var config=require(_0x28dc('0x8'));var attributes=require(_0x28dc('0x9'));module[_0x28dc('0xa')]=function(_0x5f38eb,_0x3753ec){return _0x5f38eb[_0x28dc('0xb')]('UserMailQueue',attributes,{'tableName':_0x28dc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf432=['util','api','moment','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x1da5f4,_0x44bca7){var _0x58e944=function(_0x3393ae){while(--_0x3393ae){_0x1da5f4['push'](_0x1da5f4['shift']());}};_0x58e944(++_0x44bca7);}(_0xf432,0x1bb));var _0x2f43=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0xf432[_0x39bc44];return _0x2916d8;};'use strict';var _=require(_0x2f43('0x0'));var util=require(_0x2f43('0x1'));var logger=require('../../config/logger')(_0x2f43('0x2'));var moment=require(_0x2f43('0x3'));var BPromise=require(_0x2f43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2f43('0x5'));var rimraf=require(_0x2f43('0x6'));var config=require(_0x2f43('0x7'));var attributes=require(_0x2f43('0x8'));module['exports']=function(_0x2c1ef1,_0x45909d){return _0x2c1ef1[_0x2f43('0x9')](_0x2f43('0xa'),attributes,{'tableName':_0x2f43('0xb'),'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 fb2c269..1a42bf9 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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x135cae,_0x53f356){var _0x210b22=function(_0x42e408){while(--_0x42e408){_0x135cae['push'](_0x135cae['shift']());}};_0x210b22(++_0x53f356);}(_0x3e74,0x175));var _0x43e7=function(_0x5d7623,_0xc97772){_0x5d7623=_0x5d7623-0x0;var _0x2be24a=_0x3e74[_0x5d7623];return _0x2be24a;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ 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','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x1cb9,0x14e));var _0x91cb=function(_0x16affe,_0x3b8b62){_0x16affe=_0x16affe-0x0;var _0x49c93c=_0x1cb9[_0x16affe];return _0x49c93c;};'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')]('UserMailQueue,\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/userNotification/index.js b/server/api/userNotification/index.js index a86920d..a0139fa 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 _0x51a0=['util','path','express','Router','fs-extra','../../components/auth/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x46d613,_0xf6aa29){var _0x3494e1=function(_0x2b2c06){while(--_0x2b2c06){_0x46d613['push'](_0x46d613['shift']());}};_0x3494e1(++_0xf6aa29);}(_0x51a0,0x1d3));var _0x051a=function(_0x479131,_0x2828f4){_0x479131=_0x479131-0x0;var _0x28e996=_0x51a0[_0x479131];return _0x28e996;};'use strict';var multer=require(_0x051a('0x0'));var util=require(_0x051a('0x1'));var path=require(_0x051a('0x2'));var timeout=require('connect-timeout');var express=require(_0x051a('0x3'));var router=express[_0x051a('0x4')]();var fs_extra=require(_0x051a('0x5'));var auth=require(_0x051a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x051a('0x7'));router[_0x051a('0x8')]('/',auth[_0x051a('0x9')](),controller[_0x051a('0xa')]);module[_0x051a('0xb')]=router; \ No newline at end of file +var _0x24ad=['./userNotification.controller','isAuthenticated','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xa7984c,_0x3b130c){var _0x3c6957=function(_0x2bd603){while(--_0x2bd603){_0xa7984c['push'](_0xa7984c['shift']());}};_0x3c6957(++_0x3b130c);}(_0x24ad,0x100));var _0xd24a=function(_0x9909d8,_0x56bf56){_0x9909d8=_0x9909d8-0x0;var _0xb7176e=_0x24ad[_0x9909d8];return _0xb7176e;};'use strict';var multer=require(_0xd24a('0x0'));var util=require(_0xd24a('0x1'));var path=require(_0xd24a('0x2'));var timeout=require('connect-timeout');var express=require(_0xd24a('0x3'));var router=express[_0xd24a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd24a('0x5'));var interaction=require(_0xd24a('0x6'));var config=require(_0xd24a('0x7'));var controller=require(_0xd24a('0x8'));router['post']('/',auth[_0xd24a('0x9')](),controller['sendUserNotification']);module[_0xd24a('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 5c60b29..e22e197 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 _0x9b92=['TEXT','BOOLEAN','sequelize','exports','STRING'];(function(_0x33f184,_0x305868){var _0x50d2ae=function(_0x493ec0){while(--_0x493ec0){_0x33f184['push'](_0x33f184['shift']());}};_0x50d2ae(++_0x305868);}(_0x9b92,0xc5));var _0x29b9=function(_0x367c07,_0x1fe766){_0x367c07=_0x367c07-0x0;var _0x12aab2=_0x9b92[_0x367c07];return _0x12aab2;};'use strict';var Sequelize=require(_0x29b9('0x0'));module[_0x29b9('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x29b9('0x2')]},'recipientsId':{'type':Sequelize[_0x29b9('0x3')]},'recipientsDescription':{'type':Sequelize[_0x29b9('0x2')]},'beep':{'type':Sequelize[_0x29b9('0x4')]}}; \ No newline at end of file +var _0xadaf=['BOOLEAN','exports','TEXT','STRING'];(function(_0x1a84fc,_0x32fb6f){var _0x178d3a=function(_0x50cadc){while(--_0x50cadc){_0x1a84fc['push'](_0x1a84fc['shift']());}};_0x178d3a(++_0x32fb6f);}(_0xadaf,0x71));var _0xfada=function(_0x5805b5,_0x3f43c3){_0x5805b5=_0x5805b5-0x0;var _0x1f4cd0=_0xadaf[_0x5805b5];return _0x1f4cd0;};'use strict';var Sequelize=require('sequelize');module[_0xfada('0x0')]={'body':{'type':Sequelize[_0xfada('0x1')]},'senderName':{'type':Sequelize[_0xfada('0x2')]},'recipientsId':{'type':Sequelize[_0xfada('0x1')]},'recipientsDescription':{'type':Sequelize[_0xfada('0x2')]},'beep':{'type':Sequelize[_0xfada('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 7f788c5..8764624 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 _0x0166=['forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','User','union','ids','queue','replace','Queue','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','destroy','then','error','send','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','join','sequelize','transaction','UserNotification','create'];(function(_0x29e397,_0x1ec646){var _0x52426a=function(_0xd547e8){while(--_0xd547e8){_0x29e397['push'](_0x29e397['shift']());}};_0x52426a(++_0x1ec646);}(_0x0166,0x1a8));var _0x6016=function(_0x25f1d7,_0x4939ab){_0x25f1d7=_0x25f1d7-0x0;var _0xe466c6=_0x0166[_0x25f1d7];return _0xe466c6;};'use strict';var emlformat=require(_0x6016('0x0'));var rimraf=require(_0x6016('0x1'));var zipdir=require(_0x6016('0x2'));var jsonpatch=require(_0x6016('0x3'));var rp=require(_0x6016('0x4'));var moment=require(_0x6016('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6016('0x6'));var util=require(_0x6016('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6016('0x8'));var ejs=require(_0x6016('0x9'));var fs=require('fs');var fs_extra=require(_0x6016('0xa'));var _=require('lodash');var squel=require(_0x6016('0xb'));var crypto=require(_0x6016('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6016('0xd'));var toCsv=require(_0x6016('0x8'));var querystring=require('querystring');var Papa=require(_0x6016('0xe'));var Redis=require(_0x6016('0xf'));var authService=require(_0x6016('0x10'));var qs=require(_0x6016('0x11'));var as=require(_0x6016('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6016('0x13'));var utils=require(_0x6016('0x14'));var config=require(_0x6016('0x15'));var licenseUtil=require(_0x6016('0x16'));var db=require(_0x6016('0x17'))['db'];config['redis']=_[_0x6016('0x18')](config[_0x6016('0x19')],{'host':_0x6016('0x1a'),'port':0x18eb});var socket=require(_0x6016('0x1b'))(new Redis(config[_0x6016('0x19')]));require(_0x6016('0x1c'))[_0x6016('0x1d')](socket);function respondWithStatusCode(_0x33b5b2,_0x3086b3){_0x3086b3=_0x3086b3||0xcc;return function(_0x346351){if(_0x346351){return _0x33b5b2[_0x6016('0x1e')](_0x3086b3);}return _0x33b5b2[_0x6016('0x1f')](_0x3086b3)[_0x6016('0x20')]();};}function respondWithResult(_0x37f84e,_0x617a16){_0x617a16=_0x617a16||0xc8;return function(_0x5e148e){if(_0x5e148e){return _0x37f84e[_0x6016('0x1f')](_0x617a16)[_0x6016('0x21')](_0x5e148e);}};}function respondWithFilteredResult(_0x345967,_0x6808b3){return function(_0x2ed909){if(_0x2ed909){var _0x2064b0=typeof _0x6808b3[_0x6016('0x22')]===_0x6016('0x23')&&typeof _0x6808b3[_0x6016('0x24')]===_0x6016('0x23');var _0x4dbfdd=_0x2ed909['count'];var _0x5d14a4=_0x2064b0?0x0:_0x6808b3[_0x6016('0x22')];var _0x2af82d=_0x2064b0?_0x2ed909['count']:_0x6808b3['offset']+_0x6808b3['limit'];var _0x50bd15;if(_0x2af82d>=_0x4dbfdd){_0x2af82d=_0x4dbfdd;_0x50bd15=0xc8;}else{_0x50bd15=0xce;}_0x345967[_0x6016('0x1f')](_0x50bd15);return _0x345967[_0x6016('0x25')](_0x6016('0x26'),_0x5d14a4+'-'+_0x2af82d+'/'+_0x4dbfdd)[_0x6016('0x21')](_0x2ed909);}return null;};}function patchUpdates(_0x2eea02){return function(_0x2d3761){try{jsonpatch[_0x6016('0x27')](_0x2d3761,_0x2eea02,!![]);}catch(_0x2f30fd){return BPromise[_0x6016('0x28')](_0x2f30fd);}return _0x2d3761['save']();};}function saveUpdates(_0xe77056,_0x5284bf){return function(_0x137875){if(_0x137875){return _0x137875[_0x6016('0x29')](_0xe77056)['then'](function(_0x4e6815){return _0x4e6815;});}return null;};}function removeEntity(_0x5ce79f,_0x3beb2b){return function(_0x1df845){if(_0x1df845){return _0x1df845[_0x6016('0x2a')]()[_0x6016('0x2b')](function(){_0x5ce79f[_0x6016('0x1f')](0xcc)[_0x6016('0x20')]();});}};}function handleEntityNotFound(_0x52a324,_0x3eecb9){return function(_0x3cd915){if(!_0x3cd915){_0x52a324[_0x6016('0x1e')](0x194);}return _0x3cd915;};}function handleError(_0x9acf01,_0x527b32){_0x527b32=_0x527b32||0x1f4;return function(_0x547d5a){logger[_0x6016('0x2c')](_0x547d5a['stack']);if(_0x547d5a['name']){delete _0x547d5a['name'];}_0x9acf01['status'](_0x527b32)[_0x6016('0x2d')](_0x547d5a);};}exports[_0x6016('0x2e')]=function(_0x1961f7,_0x25b719,_0x528d30){if(!_0x1961f7[_0x6016('0x2f')][_0x6016('0x30')](_0x6016('0x31'))&&!_0x1961f7['body'][_0x6016('0x30')]('TemplateId')){throw new db[(_0x6016('0x32'))][(_0x6016('0x33'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x1961f7[_0x6016('0x2f')][_0x6016('0x30')](_0x6016('0x34'))&&!_0x1961f7[_0x6016('0x2f')][_0x6016('0x30')](_0x6016('0x35'))){throw new db['Sequelize'][(_0x6016('0x33'))](_0x6016('0x36'));}if(!_0x1961f7[_0x6016('0x2f')][_0x6016('0x30')](_0x6016('0x37'))){throw new db[(_0x6016('0x32'))][(_0x6016('0x33'))](_0x6016('0x38'));}else{try{var _0x545d38=JSON['parse'](_0x1961f7[_0x6016('0x2f')][_0x6016('0x37')]);}catch(_0x2303eb){logger[_0x6016('0x2c')](_0x2303eb);throw new db[(_0x6016('0x32'))][(_0x6016('0x33'))](_0x6016('0x39'));}var _0x5d187d=[_0x6016('0x3a'),'faxqueue',_0x6016('0x3b'),_0x6016('0x3c'),_0x6016('0x3d'),_0x6016('0x3e'),'whatsappqueue',_0x6016('0x3f'),_0x6016('0x40')];if(_[_0x6016('0x41')](_0x545d38,function(_0x1f8107){return!_[_0x6016('0x42')](_0x5d187d,_0x1f8107[_0x6016('0x43')][_0x6016('0x44')]());})){throw new db[(_0x6016('0x32'))][(_0x6016('0x33'))](_0x6016('0x45'));}}}var _0x30615b={};_0x30615b[_0x6016('0x46')]=_0x1961f7[_0x6016('0x2f')][_0x6016('0x30')](_0x6016('0x46'))?_0x1961f7[_0x6016('0x2f')]['senderName']:_0x1961f7[_0x6016('0x40')][_0x6016('0x47')];_0x30615b[_0x6016('0x48')]=_[_0x6016('0x49')](_0x1961f7[_0x6016('0x2f')][_0x6016('0x48')])?null:_0x1961f7[_0x6016('0x2f')]['recipientsDescription'];_0x30615b['beep']=_0x1961f7['body'][_0x6016('0x4a')]||![];_0x30615b[_0x6016('0x4b')]=_0x1961f7[_0x6016('0x40')]['id'];return getContent(_0x1961f7[_0x6016('0x2f')])[_0x6016('0x2b')](function(_0xf122fb){_0x30615b[_0x6016('0x2f')]=_0xf122fb;return getRecipients(_0x545d38);})['then'](function(_0x47e9ba){_0x30615b['recipientsId']=_['sortBy'](_0x47e9ba)[_0x6016('0x4c')](',');return db[_0x6016('0x4d')][_0x6016('0x4e')](function(_0x46d25b){return db[_0x6016('0x4f')][_0x6016('0x50')](_0x30615b,{'raw':!![],'transaction':_0x46d25b})['then'](function(_0xe9d98c){var _0x16c367={'sender':_0x30615b[_0x6016('0x46')],'description':_0x30615b[_0x6016('0x48')],'content':_0x30615b[_0x6016('0x2f')],'beep':_0x30615b[_0x6016('0x4a')]};_0x47e9ba[_0x6016('0x51')](function(_0x594de4){_0x16c367[_0x6016('0x52')]=_0x594de4;socket[_0x6016('0x53')](_0x6016('0x54'),_0x16c367);});return _0xe9d98c;});});})[_0x6016('0x2b')](respondWithResult(_0x25b719,0xc9))[_0x6016('0x55')](handleError(_0x25b719,null));};function getContent(_0x3ba159){return new BPromise(function(_0x8504b4,_0x162fd0){if(_0x3ba159[_0x6016('0x31')]){_0x8504b4(_0x3ba159['text']);return;}return db[_0x6016('0x56')][_0x6016('0x57')]({'attributes':[_0x6016('0x58')],'where':{'id':_0x3ba159[_0x6016('0x34')]},'raw':!![]})[_0x6016('0x2b')](function(_0x4ce34b){if(!_0x4ce34b)throw new db[(_0x6016('0x32'))][(_0x6016('0x33'))](_0x6016('0x59'));var _0x205402=Mustache[_0x6016('0x5a')](_0x4ce34b[_0x6016('0x58')],_0x3ba159['view']);_0x8504b4(_0x205402);})['catch'](function(_0x236fe6){_0x162fd0(_0x236fe6);});});}function getRecipients(_0x1337d2){return new BPromise(function(_0x276aff,_0x49fc60){var _0x33d4c9=[];var _0x421b1c=[];_0x1337d2[_0x6016('0x51')](function(_0x279065){var _0xd95d66=_['startCase'](_0x279065[_0x6016('0x43')][_0x6016('0x44')]());if(_0xd95d66===_0x6016('0x5b')){_0x33d4c9=_[_0x6016('0x5c')](_0x33d4c9,_0x279065[_0x6016('0x5d')]);}else{if(_[_0x6016('0x42')](_0xd95d66,_0x6016('0x5e')))_0xd95d66=_0xd95d66[_0x6016('0x5f')]('queue',_0x6016('0x60'));_0x279065[_0x6016('0x5d')][_0x6016('0x51')](function(_0x38324c){_0x421b1c['push'](getAgents(_0xd95d66,_0x38324c));});}});return BPromise[_0x6016('0x61')](_0x421b1c)['then'](function(_0x6256d6){_0x33d4c9=_['union'](_0x33d4c9,_[_0x6016('0x62')](_0x6256d6));_0x276aff(_0x33d4c9);})[_0x6016('0x55')](function(_0x5bdd25){_0x49fc60(_0x5bdd25);});});}function getAgents(_0x58d1f,_0x245772){return new BPromise(function(_0x587742,_0x275b03){return db[_0x58d1f][_0x6016('0x57')]({'where':{'id':_0x245772}})['then'](function(_0x3dfdf8){return _0x3dfdf8[_0x6016('0x63')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5c3e64){var _0x449a9a=_[_0x6016('0x64')](_0x5c3e64,'id');_0x587742(_0x449a9a);});})[_0x6016('0x55')](function(_0x285e6f){_0x275b03(_0x285e6f);});});} \ No newline at end of file +var _0xb27d=['hasOwnProperty','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','smsqueue','voicequeue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','recipientsDescription','isEmpty','beep','recipientsId','sortBy','sequelize','transaction','create','forEach','recipient','emit','catch','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','User','union','ids','queue','replace','Queue','push','all','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','stack','name','send','sendUserNotification','body'];(function(_0x27a94a,_0x5c58c3){var _0x1233d7=function(_0x407ddc){while(--_0x407ddc){_0x27a94a['push'](_0x27a94a['shift']());}};_0x1233d7(++_0x5c58c3);}(_0xb27d,0x8c));var _0xdb27=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xb27d[_0x376b45];return _0x2341b3;};'use strict';var emlformat=require(_0xdb27('0x0'));var rimraf=require(_0xdb27('0x1'));var zipdir=require(_0xdb27('0x2'));var jsonpatch=require(_0xdb27('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdb27('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdb27('0x5'));var sox=require(_0xdb27('0x6'));var csv=require(_0xdb27('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb27('0x8'));var squel=require('squel');var crypto=require(_0xdb27('0x9'));var jsforce=require(_0xdb27('0xa'));var deskjs=require(_0xdb27('0xb'));var toCsv=require('to-csv');var querystring=require(_0xdb27('0xc'));var Papa=require(_0xdb27('0xd'));var Redis=require(_0xdb27('0xe'));var authService=require(_0xdb27('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xdb27('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb27('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xdb27('0x12'));var licenseUtil=require(_0xdb27('0x13'));var db=require(_0xdb27('0x14'))['db'];config[_0xdb27('0x15')]=_[_0xdb27('0x16')](config['redis'],{'host':_0xdb27('0x17'),'port':0x18eb});var socket=require(_0xdb27('0x18'))(new Redis(config[_0xdb27('0x15')]));require(_0xdb27('0x19'))[_0xdb27('0x1a')](socket);function respondWithStatusCode(_0x268275,_0x5517e4){_0x5517e4=_0x5517e4||0xcc;return function(_0x2e3bee){if(_0x2e3bee){return _0x268275[_0xdb27('0x1b')](_0x5517e4);}return _0x268275[_0xdb27('0x1c')](_0x5517e4)[_0xdb27('0x1d')]();};}function respondWithResult(_0x47c3bb,_0x94de83){_0x94de83=_0x94de83||0xc8;return function(_0x5e4489){if(_0x5e4489){return _0x47c3bb[_0xdb27('0x1c')](_0x94de83)[_0xdb27('0x1e')](_0x5e4489);}};}function respondWithFilteredResult(_0x49f9fe,_0x1c3d3d){return function(_0x15da3c){if(_0x15da3c){var _0x33cfe9=typeof _0x1c3d3d[_0xdb27('0x1f')]===_0xdb27('0x20')&&typeof _0x1c3d3d['limit']===_0xdb27('0x20');var _0xa362e1=_0x15da3c['count'];var _0xf2dff9=_0x33cfe9?0x0:_0x1c3d3d['offset'];var _0x22fffc=_0x33cfe9?_0x15da3c[_0xdb27('0x21')]:_0x1c3d3d[_0xdb27('0x1f')]+_0x1c3d3d[_0xdb27('0x22')];var _0x5cfad5;if(_0x22fffc>=_0xa362e1){_0x22fffc=_0xa362e1;_0x5cfad5=0xc8;}else{_0x5cfad5=0xce;}_0x49f9fe[_0xdb27('0x1c')](_0x5cfad5);return _0x49f9fe[_0xdb27('0x23')](_0xdb27('0x24'),_0xf2dff9+'-'+_0x22fffc+'/'+_0xa362e1)['json'](_0x15da3c);}return null;};}function patchUpdates(_0x2086b6){return function(_0x461e90){try{jsonpatch['apply'](_0x461e90,_0x2086b6,!![]);}catch(_0xa6aac1){return BPromise[_0xdb27('0x25')](_0xa6aac1);}return _0x461e90[_0xdb27('0x26')]();};}function saveUpdates(_0x1ea560,_0x131abb){return function(_0x4bf876){if(_0x4bf876){return _0x4bf876['update'](_0x1ea560)[_0xdb27('0x27')](function(_0x2f29b0){return _0x2f29b0;});}return null;};}function removeEntity(_0x476424,_0x424961){return function(_0x32633b){if(_0x32633b){return _0x32633b[_0xdb27('0x28')]()[_0xdb27('0x27')](function(){_0x476424['status'](0xcc)[_0xdb27('0x1d')]();});}};}function handleEntityNotFound(_0x3e4cd2,_0xd78cb5){return function(_0x108e92){if(!_0x108e92){_0x3e4cd2[_0xdb27('0x1b')](0x194);}return _0x108e92;};}function handleError(_0x4a03a1,_0x1fc031){_0x1fc031=_0x1fc031||0x1f4;return function(_0x5a7d4b){logger['error'](_0x5a7d4b[_0xdb27('0x29')]);if(_0x5a7d4b[_0xdb27('0x2a')]){delete _0x5a7d4b['name'];}_0x4a03a1['status'](_0x1fc031)[_0xdb27('0x2b')](_0x5a7d4b);};}exports[_0xdb27('0x2c')]=function(_0x496d3a,_0x22c204,_0x5ce161){if(!_0x496d3a[_0xdb27('0x2d')][_0xdb27('0x2e')]('text')&&!_0x496d3a[_0xdb27('0x2d')]['hasOwnProperty']('TemplateId')){throw new db[(_0xdb27('0x2f'))][(_0xdb27('0x30'))](_0xdb27('0x31'));}else{if(_0x496d3a['body'][_0xdb27('0x2e')](_0xdb27('0x32'))&&!_0x496d3a['body'][_0xdb27('0x2e')](_0xdb27('0x33'))){throw new db[(_0xdb27('0x2f'))][(_0xdb27('0x30'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x496d3a['body'][_0xdb27('0x2e')]('recipients')){throw new db[(_0xdb27('0x2f'))][(_0xdb27('0x30'))](_0xdb27('0x34'));}else{try{var _0x586304=JSON[_0xdb27('0x35')](_0x496d3a[_0xdb27('0x2d')]['recipients']);}catch(_0x201d7a){logger[_0xdb27('0x36')](_0x201d7a);throw new db[(_0xdb27('0x2f'))]['ValidationError'](_0xdb27('0x37'));}var _0x392c2c=[_0xdb27('0x38'),'faxqueue',_0xdb27('0x39'),'openchannelqueue',_0xdb27('0x3a'),_0xdb27('0x3b'),'whatsappqueue',_0xdb27('0x3c'),'user'];if(_[_0xdb27('0x3d')](_0x586304,function(_0x47dc86){return!_[_0xdb27('0x3e')](_0x392c2c,_0x47dc86[_0xdb27('0x3f')][_0xdb27('0x40')]());})){throw new db[(_0xdb27('0x2f'))][(_0xdb27('0x30'))](_0xdb27('0x41'));}}}var _0x10ac9a={};_0x10ac9a[_0xdb27('0x42')]=_0x496d3a[_0xdb27('0x2d')][_0xdb27('0x2e')]('senderName')?_0x496d3a[_0xdb27('0x2d')]['senderName']:_0x496d3a[_0xdb27('0x43')]['fullname'];_0x10ac9a[_0xdb27('0x44')]=_[_0xdb27('0x45')](_0x496d3a['body'][_0xdb27('0x44')])?null:_0x496d3a[_0xdb27('0x2d')][_0xdb27('0x44')];_0x10ac9a[_0xdb27('0x46')]=_0x496d3a['body'][_0xdb27('0x46')]||![];_0x10ac9a['SenderId']=_0x496d3a[_0xdb27('0x43')]['id'];return getContent(_0x496d3a[_0xdb27('0x2d')])[_0xdb27('0x27')](function(_0xcc306d){_0x10ac9a[_0xdb27('0x2d')]=_0xcc306d;return getRecipients(_0x586304);})['then'](function(_0x3280fc){_0x10ac9a[_0xdb27('0x47')]=_[_0xdb27('0x48')](_0x3280fc)['join'](',');return db[_0xdb27('0x49')][_0xdb27('0x4a')](function(_0x547b44){return db['UserNotification'][_0xdb27('0x4b')](_0x10ac9a,{'raw':!![],'transaction':_0x547b44})[_0xdb27('0x27')](function(_0x2143cb){var _0x584acc={'sender':_0x10ac9a[_0xdb27('0x42')],'description':_0x10ac9a[_0xdb27('0x44')],'content':_0x10ac9a[_0xdb27('0x2d')],'beep':_0x10ac9a[_0xdb27('0x46')]};_0x3280fc[_0xdb27('0x4c')](function(_0x58354e){_0x584acc[_0xdb27('0x4d')]=_0x58354e;socket[_0xdb27('0x4e')]('userNotification:send',_0x584acc);});return _0x2143cb;});});})['then'](respondWithResult(_0x22c204,0xc9))[_0xdb27('0x4f')](handleError(_0x22c204,null));};function getContent(_0x11b1eb){return new BPromise(function(_0x59c2ea,_0x295b3c){if(_0x11b1eb[_0xdb27('0x50')]){_0x59c2ea(_0x11b1eb[_0xdb27('0x50')]);return;}return db[_0xdb27('0x51')]['findOne']({'attributes':[_0xdb27('0x52')],'where':{'id':_0x11b1eb[_0xdb27('0x32')]},'raw':!![]})[_0xdb27('0x27')](function(_0x1496bb){if(!_0x1496bb)throw new db['Sequelize']['ValidationError'](_0xdb27('0x53'));var _0x20bf42=Mustache['render'](_0x1496bb[_0xdb27('0x52')],_0x11b1eb['view']);_0x59c2ea(_0x20bf42);})[_0xdb27('0x4f')](function(_0x157a6e){_0x295b3c(_0x157a6e);});});}function getRecipients(_0x53c166){return new BPromise(function(_0x254bc9,_0x4bde47){var _0x4b6490=[];var _0x104c1c=[];_0x53c166['forEach'](function(_0x577ccb){var _0x570831=_[_0xdb27('0x54')](_0x577ccb['model'][_0xdb27('0x40')]());if(_0x570831===_0xdb27('0x55')){_0x4b6490=_[_0xdb27('0x56')](_0x4b6490,_0x577ccb[_0xdb27('0x57')]);}else{if(_['includes'](_0x570831,_0xdb27('0x58')))_0x570831=_0x570831[_0xdb27('0x59')]('queue',_0xdb27('0x5a'));_0x577ccb[_0xdb27('0x57')][_0xdb27('0x4c')](function(_0x2092ae){_0x104c1c[_0xdb27('0x5b')](getAgents(_0x570831,_0x2092ae));});}});return BPromise[_0xdb27('0x5c')](_0x104c1c)['then'](function(_0x23c440){_0x4b6490=_[_0xdb27('0x56')](_0x4b6490,_['flatten'](_0x23c440));_0x254bc9(_0x4b6490);})[_0xdb27('0x4f')](function(_0x354550){_0x4bde47(_0x354550);});});}function getAgents(_0xf2545a,_0xfa0270){return new BPromise(function(_0x27d535,_0x5ee23d){return db[_0xf2545a]['findOne']({'where':{'id':_0xfa0270}})[_0xdb27('0x27')](function(_0x19c04e){return _0x19c04e['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x534bae){var _0x321e12=_['map'](_0x534bae,'id');_0x27d535(_0x321e12);});})[_0xdb27('0x4f')](function(_0x390da7){_0x5ee23d(_0x390da7);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 4c24c6c..3018546 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 _0x01c9=['hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x285106,_0x5ba789){var _0x1e34e3=function(_0x1b5c16){while(--_0x1b5c16){_0x285106['push'](_0x285106['shift']());}};_0x1e34e3(++_0x5ba789);}(_0x01c9,0x15a));var _0x901c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01c9[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x901c('0x0'));var UserNotification=require(_0x901c('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x901c('0x2'),'afterUpdate':_0x901c('0x3'),'afterDestroy':_0x901c('0x4')};function emitEvent(_0x9244a9){return function(_0x963f42,_0x429312,_0xf5229d){UserNotificationEvents[_0x901c('0x5')](_0x9244a9+':'+_0x963f42['id'],_0x963f42);UserNotificationEvents[_0x901c('0x5')](_0x9244a9,_0x963f42);_0xf5229d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x901c('0x6')](e,emitEvent(event));}}module[_0x901c('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0x0359=['hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0xe44195,_0x627747){var _0x299906=function(_0x160278){while(--_0x160278){_0xe44195['push'](_0xe44195['shift']());}};_0x299906(++_0x627747);}(_0x0359,0x98));var _0x9035=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x0359[_0x4ae6ef];return _0x3cbb4e;};'use strict';var EventEmitter=require(_0x9035('0x0'));var UserNotification=require(_0x9035('0x1'))['db'][_0x9035('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9035('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9035('0x4'),'afterDestroy':_0x9035('0x5')};function emitEvent(_0x47b123){return function(_0x44e92e,_0x52a72e,_0x418b9b){UserNotificationEvents[_0x9035('0x6')](_0x47b123+':'+_0x44e92e['id'],_0x44e92e);UserNotificationEvents[_0x9035('0x6')](_0x47b123,_0x44e92e);_0x418b9b(null);};}for(var e in events){if(events[_0x9035('0x7')](e)){var event=events[e];UserNotification[_0x9035('0x8')](e,emitEvent(event));}}module[_0x9035('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index b8cdf46..3f8e7ea 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 _0x8dad=['../../config/logger','api','rimraf','../../config/environment','exports','UserNotification','util'];(function(_0x4b2cc6,_0x29ef43){var _0x3e0b08=function(_0x3b4131){while(--_0x3b4131){_0x4b2cc6['push'](_0x4b2cc6['shift']());}};_0x3e0b08(++_0x29ef43);}(_0x8dad,0xa7));var _0xd8da=function(_0x14c098,_0x316311){_0x14c098=_0x14c098-0x0;var _0x315cae=_0x8dad[_0x14c098];return _0x315cae;};'use strict';var _=require('lodash');var util=require(_0xd8da('0x0'));var logger=require(_0xd8da('0x1'))(_0xd8da('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(_0xd8da('0x3'));var config=require(_0xd8da('0x4'));var attributes=require('./userNotification.attributes');module[_0xd8da('0x5')]=function(_0xbbba8a,_0x3bca92){return _0xbbba8a['define'](_0xd8da('0x6'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5a93=['./userNotification.attributes','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x4ec7c9,_0x17d6fd){var _0x7b3e6a=function(_0x4cf2a0){while(--_0x4cf2a0){_0x4ec7c9['push'](_0x4ec7c9['shift']());}};_0x7b3e6a(++_0x17d6fd);}(_0x5a93,0x149));var _0x35a9=function(_0x430f35,_0x509f96){_0x430f35=_0x430f35-0x0;var _0xae3a81=_0x5a93[_0x430f35];return _0xae3a81;};'use strict';var _=require(_0x35a9('0x0'));var util=require(_0x35a9('0x1'));var logger=require(_0x35a9('0x2'))('api');var moment=require(_0x35a9('0x3'));var BPromise=require(_0x35a9('0x4'));var rp=require(_0x35a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x35a9('0x6'));var config=require('../../config/environment');var attributes=require(_0x35a9('0x7'));module['exports']=function(_0xb9c65f,_0x1c6096){return _0xb9c65f[_0x35a9('0x8')](_0x35a9('0x9'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x35a9('0xa'),'collate':_0x35a9('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 882987e..ed06ddd 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 _0xe9c4=['./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis'];(function(_0x4bdf64,_0x3022b2){var _0x9a1a19=function(_0x4e551b){while(--_0x4e551b){_0x4bdf64['push'](_0x4bdf64['shift']());}};_0x9a1a19(++_0x3022b2);}(_0xe9c4,0x1cd));var _0x4e9c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe9c4[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x4e9c('0x0'));var util=require('util');var moment=require(_0x4e9c('0x1'));var BPromise=require(_0x4e9c('0x2'));var rs=require(_0x4e9c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4e9c('0x4'));var logger=require(_0x4e9c('0x5'))(_0x4e9c('0x6'));var config=require(_0x4e9c('0x7'));var jayson=require(_0x4e9c('0x8'));var client=jayson[_0x4e9c('0x9')][_0x4e9c('0xa')]({'port':0x232a});config['redis']=_[_0x4e9c('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4e9c('0xc'))(new Redis(config[_0x4e9c('0xd')]));require(_0x4e9c('0xe'))[_0x4e9c('0xf')](socket);function respondWithRpcPromise(_0x1bce22,_0x25b12d,_0x54364e){return new BPromise(function(_0x43906c,_0x253eb1){return client[_0x4e9c('0x10')](_0x1bce22,_0x54364e)[_0x4e9c('0x11')](function(_0x1696fd){logger['info'](_0x4e9c('0x12'),_0x25b12d,_0x4e9c('0x13'));logger['debug'](_0x4e9c('0x14'),_0x25b12d,_0x4e9c('0x13'),JSON[_0x4e9c('0x15')](_0x1696fd));if(_0x1696fd[_0x4e9c('0x16')]){if(_0x1696fd[_0x4e9c('0x16')]['code']===0x1f4){logger[_0x4e9c('0x16')]('UserNotification,\x20%s,\x20%s',_0x25b12d,_0x1696fd['error'][_0x4e9c('0x17')]);return _0x253eb1(_0x1696fd[_0x4e9c('0x16')][_0x4e9c('0x17')]);}logger[_0x4e9c('0x16')]('UserNotification,\x20%s,\x20%s',_0x25b12d,_0x1696fd[_0x4e9c('0x16')][_0x4e9c('0x17')]);return _0x43906c(_0x1696fd['error'][_0x4e9c('0x17')]);}else{logger['info'](_0x4e9c('0x12'),_0x25b12d,_0x4e9c('0x13'));_0x43906c(_0x1696fd[_0x4e9c('0x18')][_0x4e9c('0x17')]);}})['catch'](function(_0xa69d7c){logger[_0x4e9c('0x16')](_0x4e9c('0x12'),_0x25b12d,_0xa69d7c);_0x253eb1(_0xa69d7c);});});} \ No newline at end of file +var _0x3dc5=['stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','localhost','./userNotification.socket','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s'];(function(_0x55b095,_0x5a116f){var _0x388689=function(_0x37bb0c){while(--_0x37bb0c){_0x55b095['push'](_0x55b095['shift']());}};_0x388689(++_0x5a116f);}(_0x3dc5,0xa5));var _0x53dc=function(_0x25fe42,_0x56b581){_0x25fe42=_0x25fe42-0x0;var _0x3b5270=_0x3dc5[_0x25fe42];return _0x3b5270;};'use strict';var _=require(_0x53dc('0x0'));var util=require('util');var moment=require(_0x53dc('0x1'));var BPromise=require(_0x53dc('0x2'));var rs=require(_0x53dc('0x3'));var fs=require('fs');var Redis=require(_0x53dc('0x4'));var db=require(_0x53dc('0x5'))['db'];var utils=require(_0x53dc('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x53dc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x53dc('0x8')][_0x53dc('0x9')]({'port':0x232a});config[_0x53dc('0xa')]=_['defaults'](config[_0x53dc('0xa')],{'host':_0x53dc('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x53dc('0xa')]));require(_0x53dc('0xc'))[_0x53dc('0xd')](socket);function respondWithRpcPromise(_0xc1be8e,_0x79f849,_0x444db2){return new BPromise(function(_0x3413b0,_0x4ecb74){return client['request'](_0xc1be8e,_0x444db2)[_0x53dc('0xe')](function(_0x299ec0){logger[_0x53dc('0xf')](_0x53dc('0x10'),_0x79f849,_0x53dc('0x11'));logger['debug'](_0x53dc('0x12'),_0x79f849,_0x53dc('0x11'),JSON[_0x53dc('0x13')](_0x299ec0));if(_0x299ec0[_0x53dc('0x14')]){if(_0x299ec0[_0x53dc('0x14')]['code']===0x1f4){logger[_0x53dc('0x14')](_0x53dc('0x10'),_0x79f849,_0x299ec0['error'][_0x53dc('0x15')]);return _0x4ecb74(_0x299ec0[_0x53dc('0x14')]['message']);}logger[_0x53dc('0x14')](_0x53dc('0x10'),_0x79f849,_0x299ec0[_0x53dc('0x14')][_0x53dc('0x15')]);return _0x3413b0(_0x299ec0[_0x53dc('0x14')][_0x53dc('0x15')]);}else{logger[_0x53dc('0xf')](_0x53dc('0x10'),_0x79f849,_0x53dc('0x11'));_0x3413b0(_0x299ec0[_0x53dc('0x16')][_0x53dc('0x15')]);}})['catch'](function(_0x3aa507){logger['error'](_0x53dc('0x10'),_0x79f849,_0x3aa507);_0x4ecb74(_0x3aa507);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 58ad20f..6704734 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 _0xb2e0=['emit','removeListener','register','length','./userNotification.events','save','remove','update'];(function(_0x473f1d,_0x304c77){var _0x249482=function(_0x55c607){while(--_0x55c607){_0x473f1d['push'](_0x473f1d['shift']());}};_0x249482(++_0x304c77);}(_0xb2e0,0x1ac));var _0x0b2e=function(_0x1dbdc5,_0xe577fa){_0x1dbdc5=_0x1dbdc5-0x0;var _0x12dc3c=_0xb2e0[_0x1dbdc5];return _0x12dc3c;};'use strict';var UserNotificationEvents=require(_0x0b2e('0x0'));var events=[_0x0b2e('0x1'),_0x0b2e('0x2'),_0x0b2e('0x3')];function createListener(_0x128ac7,_0xc7b732){return function(_0x4f6426){_0xc7b732[_0x0b2e('0x4')](_0x128ac7,_0x4f6426);};}function removeListener(_0x447371,_0x25676e){return function(){UserNotificationEvents[_0x0b2e('0x5')](_0x447371,_0x25676e);};}exports[_0x0b2e('0x6')]=function(_0x27151e){for(var _0x4db7ee=0x0,_0x255b59=events[_0x0b2e('0x7')];_0x4db7ee<_0x255b59;_0x4db7ee++){var _0xfdbefc=events[_0x4db7ee];var _0x3b3b5e=createListener('userNotification:'+_0xfdbefc,_0x27151e);UserNotificationEvents['on'](_0xfdbefc,_0x3b3b5e);}}; \ No newline at end of file +var _0xa221=['register','userNotification:','./userNotification.events','save','remove','update','emit','removeListener'];(function(_0x48c1bc,_0xb8641f){var _0x26dfa8=function(_0x174e1e){while(--_0x174e1e){_0x48c1bc['push'](_0x48c1bc['shift']());}};_0x26dfa8(++_0xb8641f);}(_0xa221,0x192));var _0x1a22=function(_0x2699ce,_0x15fe5f){_0x2699ce=_0x2699ce-0x0;var _0x528144=_0xa221[_0x2699ce];return _0x528144;};'use strict';var UserNotificationEvents=require(_0x1a22('0x0'));var events=[_0x1a22('0x1'),_0x1a22('0x2'),_0x1a22('0x3')];function createListener(_0x180759,_0x822a91){return function(_0x371e78){_0x822a91[_0x1a22('0x4')](_0x180759,_0x371e78);};}function removeListener(_0x578fae,_0x2b97a4){return function(){UserNotificationEvents[_0x1a22('0x5')](_0x578fae,_0x2b97a4);};}exports[_0x1a22('0x6')]=function(_0x5e6489){for(var _0x245527=0x0,_0x323f7e=events['length'];_0x245527<_0x323f7e;_0x245527++){var _0x63a198=events[_0x245527];var _0x331818=createListener(_0x1a22('0x7')+_0x63a198,_0x5e6489);UserNotificationEvents['on'](_0x63a198,_0x331818);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index fb042e8..1be3007 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x38b634,_0x4948a4){var _0x3b43dc=function(_0x2cce56){while(--_0x2cce56){_0x38b634['push'](_0x38b634['shift']());}};_0x3b43dc(++_0x4948a4);}(_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 +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x553adc,_0x18276f){var _0x41bbe4=function(_0x215051){while(--_0x215051){_0x553adc['push'](_0x553adc['shift']());}};_0x41bbe4(++_0x18276f);}(_0xe706,0xa3));var _0x6e70=function(_0x300d13,_0x412659){_0x300d13=_0x300d13-0x0;var _0x39541d=_0xe706[_0x300d13];return _0x39541d;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index d896008..9006424 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa329=['sequelize'];(function(_0x2895f1,_0x526e76){var _0x338c7e=function(_0x44e900){while(--_0x44e900){_0x2895f1['push'](_0x2895f1['shift']());}};_0x338c7e(++_0x526e76);}(_0xa329,0x174));var _0x9a32=function(_0x587a1e,_0x2efd41){_0x587a1e=_0x587a1e-0x0;var _0x60b3e3=_0xa329[_0x587a1e];return _0x60b3e3;};'use strict';var Sequelize=require(_0x9a32('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 68e0213..5182400 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 _0x301d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x301d,0x1a4));var _0xd301=function(_0x4c5c15,_0x1af5fa){_0x4c5c15=_0x4c5c15-0x0;var _0x5e7c14=_0x301d[_0x4c5c15];return _0x5e7c14;};'use strict';var _=require(_0xd301('0x0'));var util=require(_0xd301('0x1'));var logger=require(_0xd301('0x2'))(_0xd301('0x3'));var moment=require(_0xd301('0x4'));var BPromise=require(_0xd301('0x5'));var rp=require(_0xd301('0x6'));var fs=require('fs');var path=require(_0xd301('0x7'));var rimraf=require(_0xd301('0x8'));var config=require(_0xd301('0x9'));var attributes=require(_0xd301('0xa'));module[_0xd301('0xb')]=function(_0x275d27,_0xae712b){return _0x275d27[_0xd301('0xc')](_0xd301('0xd'),attributes,{'tableName':_0xd301('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x286b=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x34b1b8,_0x54c9bf){var _0x542dd8=function(_0xff3f89){while(--_0xff3f89){_0x34b1b8['push'](_0x34b1b8['shift']());}};_0x542dd8(++_0x54c9bf);}(_0x286b,0xab));var _0xb286=function(_0x19fd6a,_0x350bb6){_0x19fd6a=_0x19fd6a-0x0;var _0x1a4620=_0x286b[_0x19fd6a];return _0x1a4620;};'use strict';var _=require(_0xb286('0x0'));var util=require(_0xb286('0x1'));var logger=require(_0xb286('0x2'))(_0xb286('0x3'));var moment=require(_0xb286('0x4'));var BPromise=require(_0xb286('0x5'));var rp=require(_0xb286('0x6'));var fs=require('fs');var path=require(_0xb286('0x7'));var rimraf=require(_0xb286('0x8'));var config=require(_0xb286('0x9'));var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x133ee7,_0x23be3c){return _0x133ee7[_0xb286('0xa')](_0xb286('0xb'),attributes,{'tableName':_0xb286('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 fcdfe1e..ee2dd89 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 _0xb850=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','stringify','error','code','message','catch','moment','bluebird'];(function(_0x8c5b9f,_0xb1296b){var _0x42dcf2=function(_0x502540){while(--_0x502540){_0x8c5b9f['push'](_0x8c5b9f['shift']());}};_0x42dcf2(++_0xb1296b);}(_0xb850,0x9e));var _0x0b85=function(_0x2644dd,_0x39d79e){_0x2644dd=_0x2644dd-0x0;var _0x4dad81=_0xb850[_0x2644dd];return _0x4dad81;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b85('0x0'));var BPromise=require(_0x0b85('0x1'));var rs=require(_0x0b85('0x2'));var fs=require('fs');var Redis=require(_0x0b85('0x3'));var db=require(_0x0b85('0x4'))['db'];var utils=require(_0x0b85('0x5'));var logger=require('../../config/logger')(_0x0b85('0x6'));var config=require('../../config/environment');var jayson=require(_0x0b85('0x7'));var client=jayson[_0x0b85('0x8')][_0x0b85('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47a428,_0x2fba0e,_0x3665a7){return new BPromise(function(_0xb68be5,_0x357612){return client[_0x0b85('0xa')](_0x47a428,_0x3665a7)[_0x0b85('0xb')](function(_0x11bb88){logger[_0x0b85('0xc')](_0x0b85('0xd'),_0x2fba0e,'request\x20sent');logger[_0x0b85('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2fba0e,'request\x20sent',JSON[_0x0b85('0xf')](_0x11bb88));if(_0x11bb88[_0x0b85('0x10')]){if(_0x11bb88['error'][_0x0b85('0x11')]===0x1f4){logger[_0x0b85('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2fba0e,_0x11bb88[_0x0b85('0x10')][_0x0b85('0x12')]);return _0x357612(_0x11bb88['error'][_0x0b85('0x12')]);}logger[_0x0b85('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2fba0e,_0x11bb88[_0x0b85('0x10')][_0x0b85('0x12')]);return _0xb68be5(_0x11bb88[_0x0b85('0x10')][_0x0b85('0x12')]);}else{logger[_0x0b85('0xc')](_0x0b85('0xd'),_0x2fba0e,'request\x20sent');_0xb68be5(_0x11bb88['result'][_0x0b85('0x12')]);}})[_0x0b85('0x13')](function(_0x1c7835){logger['error'](_0x0b85('0xd'),_0x2fba0e,_0x1c7835);_0x357612(_0x1c7835);});});} \ No newline at end of file +var _0xfac8=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x38dea7,_0x4627c6){var _0x5c26fc=function(_0x1132c0){while(--_0x1132c0){_0x38dea7['push'](_0x38dea7['shift']());}};_0x5c26fc(++_0x4627c6);}(_0xfac8,0xc6));var _0x8fac=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0xfac8[_0x3dc538];return _0x72c2fd;};'use strict';var _=require(_0x8fac('0x0'));var util=require(_0x8fac('0x1'));var moment=require(_0x8fac('0x2'));var BPromise=require(_0x8fac('0x3'));var rs=require(_0x8fac('0x4'));var fs=require('fs');var Redis=require(_0x8fac('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8fac('0x6'));var logger=require(_0x8fac('0x7'))(_0x8fac('0x8'));var config=require(_0x8fac('0x9'));var jayson=require(_0x8fac('0xa'));var client=jayson[_0x8fac('0xb')][_0x8fac('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c4c10,_0x4872dc,_0x358874){return new BPromise(function(_0x41f968,_0x4f8f49){return client[_0x8fac('0xd')](_0x1c4c10,_0x358874)[_0x8fac('0xe')](function(_0x1a5f58){logger[_0x8fac('0xf')](_0x8fac('0x10'),_0x4872dc,_0x8fac('0x11'));logger[_0x8fac('0x12')](_0x8fac('0x13'),_0x4872dc,_0x8fac('0x11'),JSON[_0x8fac('0x14')](_0x1a5f58));if(_0x1a5f58[_0x8fac('0x15')]){if(_0x1a5f58[_0x8fac('0x15')][_0x8fac('0x16')]===0x1f4){logger[_0x8fac('0x15')](_0x8fac('0x10'),_0x4872dc,_0x1a5f58[_0x8fac('0x15')][_0x8fac('0x17')]);return _0x4f8f49(_0x1a5f58['error'][_0x8fac('0x17')]);}logger[_0x8fac('0x15')](_0x8fac('0x10'),_0x4872dc,_0x1a5f58[_0x8fac('0x15')][_0x8fac('0x17')]);return _0x41f968(_0x1a5f58[_0x8fac('0x15')][_0x8fac('0x17')]);}else{logger[_0x8fac('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4872dc,_0x8fac('0x11'));_0x41f968(_0x1a5f58['result'][_0x8fac('0x17')]);}})['catch'](function(_0x74a299){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x4872dc,_0x74a299);_0x4f8f49(_0x74a299);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 59c092b..5d1f520 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 _0x4a78=['../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','clone','addSections','addResources','put','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x10fe7f,_0x2aa210){var _0x33f6cf=function(_0x470a4b){while(--_0x470a4b){_0x10fe7f['push'](_0x10fe7f['shift']());}};_0x33f6cf(++_0x2aa210);}(_0x4a78,0x18c));var _0x84a7=function(_0x5ab6a1,_0x4ecd56){_0x5ab6a1=_0x5ab6a1-0x0;var _0x1e9992=_0x4a78[_0x5ab6a1];return _0x1e9992;};'use strict';var multer=require(_0x84a7('0x0'));var util=require(_0x84a7('0x1'));var path=require(_0x84a7('0x2'));var timeout=require(_0x84a7('0x3'));var express=require(_0x84a7('0x4'));var router=express[_0x84a7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x84a7('0x6'));var interaction=require(_0x84a7('0x7'));var config=require(_0x84a7('0x8'));var controller=require(_0x84a7('0x9'));router[_0x84a7('0xa')]('/',auth[_0x84a7('0xb')](),controller[_0x84a7('0xc')]);router[_0x84a7('0xa')](_0x84a7('0xd'),auth[_0x84a7('0xb')](),controller[_0x84a7('0xe')]);router['get'](_0x84a7('0xf'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x10')]);router['get'](_0x84a7('0x11'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x12')]);router['get'](_0x84a7('0x13'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x14')]);router[_0x84a7('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x84a7('0x15')]('/:id/clone',auth[_0x84a7('0xb')](),controller[_0x84a7('0x16')]);router[_0x84a7('0x15')](_0x84a7('0x11'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x17')]);router[_0x84a7('0x15')](_0x84a7('0x13'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x18')]);router[_0x84a7('0x19')](_0x84a7('0xf'),auth[_0x84a7('0xb')](),controller['update']);router[_0x84a7('0x1a')](_0x84a7('0xf'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x1b')]);router[_0x84a7('0x1a')](_0x84a7('0x11'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x1c')]);router[_0x84a7('0x1a')](_0x84a7('0x13'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x1d')]);module[_0x84a7('0x1e')]=router; \ No newline at end of file +var _0xb575=['/:id','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','describe'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xb575,0x1c4));var _0x5b57=function(_0x3aeb04,_0x76729a){_0x3aeb04=_0x3aeb04-0x0;var _0x18928d=_0xb575[_0x3aeb04];return _0x18928d;};'use strict';var multer=require('multer');var util=require(_0x5b57('0x0'));var path=require(_0x5b57('0x1'));var timeout=require(_0x5b57('0x2'));var express=require('express');var router=express[_0x5b57('0x3')]();var fs_extra=require(_0x5b57('0x4'));var auth=require(_0x5b57('0x5'));var interaction=require(_0x5b57('0x6'));var config=require(_0x5b57('0x7'));var controller=require(_0x5b57('0x8'));router[_0x5b57('0x9')]('/',auth[_0x5b57('0xa')](),controller[_0x5b57('0xb')]);router[_0x5b57('0x9')]('/describe',auth[_0x5b57('0xa')](),controller[_0x5b57('0xc')]);router[_0x5b57('0x9')](_0x5b57('0xd'),auth[_0x5b57('0xa')](),controller['show']);router[_0x5b57('0x9')](_0x5b57('0xe'),auth[_0x5b57('0xa')](),controller[_0x5b57('0xf')]);router[_0x5b57('0x9')](_0x5b57('0x10'),auth[_0x5b57('0xa')](),controller[_0x5b57('0x11')]);router[_0x5b57('0x12')]('/',auth[_0x5b57('0xa')](),controller[_0x5b57('0x13')]);router[_0x5b57('0x12')](_0x5b57('0x14'),auth['isAuthenticated'](),controller[_0x5b57('0x15')]);router['post'](_0x5b57('0xe'),auth['isAuthenticated'](),controller[_0x5b57('0x16')]);router[_0x5b57('0x12')](_0x5b57('0x10'),auth[_0x5b57('0xa')](),controller[_0x5b57('0x17')]);router[_0x5b57('0x18')]('/:id',auth[_0x5b57('0xa')](),controller[_0x5b57('0x19')]);router[_0x5b57('0x1a')](_0x5b57('0xd'),auth['isAuthenticated'](),controller[_0x5b57('0x1b')]);router[_0x5b57('0x1a')](_0x5b57('0xe'),auth[_0x5b57('0xa')](),controller[_0x5b57('0x1c')]);router[_0x5b57('0x1a')]('/:id/resources',auth[_0x5b57('0xa')](),controller[_0x5b57('0x1d')]);module[_0x5b57('0x1e')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 4a582d0..e541ba0 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 _0x63a8=['name','setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize','STRING'];(function(_0x1c5b34,_0x4c97dc){var _0x3510fd=function(_0x3bc604){while(--_0x3bc604){_0x1c5b34['push'](_0x1c5b34['shift']());}};_0x3510fd(++_0x4c97dc);}(_0x63a8,0x1a6));var _0x863a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x63a8[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x863a('0x0'));module['exports']={'name':{'type':Sequelize[_0x863a('0x1')],'allowNull':![],'unique':_0x863a('0x2')},'crudPermissions':{'type':Sequelize[_0x863a('0x1')],'set':function(_0x53daac){this[_0x863a('0x3')](_0x863a('0x4'),_0x53daac?_0x53daac['join'](''):[]);},'get':function(){return this['getDataValue'](_0x863a('0x4'))?this[_0x863a('0x5')]('crudPermissions')[_0x863a('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x863a('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x863a('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x863a('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x863a('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x968b=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','join','getDataValue'];(function(_0x596b4f,_0x4de500){var _0x47760=function(_0x142c81){while(--_0x142c81){_0x596b4f['push'](_0x596b4f['shift']());}};_0x47760(++_0x4de500);}(_0x968b,0x151));var _0xb968=function(_0x191b54,_0x1dc69a){_0x191b54=_0x191b54-0x0;var _0x2270d1=_0x968b[_0x191b54];return _0x2270d1;};'use strict';var Sequelize=require(_0xb968('0x0'));module[_0xb968('0x1')]={'name':{'type':Sequelize[_0xb968('0x2')],'allowNull':![],'unique':_0xb968('0x3')},'crudPermissions':{'type':Sequelize[_0xb968('0x2')],'set':function(_0x4b5c7c){this[_0xb968('0x4')]('crudPermissions',_0x4b5c7c?_0x4b5c7c[_0xb968('0x5')](''):[]);},'get':function(){return this[_0xb968('0x6')]('crudPermissions')?this['getDataValue']('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xb968('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xb968('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xb968('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xb968('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xb968('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xb968('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xb968('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index baaab6f..59121c9 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 _0x9bb7=['bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','UserProfile','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','findAll','rows','catch','rawAttributes','include','find','create','body','params','fields','get','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','omit','userProfileId','Resources','update','describe','push','ids','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','addResources'];(function(_0x10aafa,_0x4663e9){var _0x2e0cc6=function(_0x4f39c7){while(--_0x4f39c7){_0x10aafa['push'](_0x10aafa['shift']());}};_0x2e0cc6(++_0x4663e9);}(_0x9bb7,0x70));var _0x79bb=function(_0x4b13f0,_0x1273df){_0x4b13f0=_0x4b13f0-0x0;var _0x2a1955=_0x9bb7[_0x4b13f0];return _0x2a1955;};'use strict';var emlformat=require(_0x79bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x79bb('0x1'));var jsonpatch=require(_0x79bb('0x2'));var rp=require(_0x79bb('0x3'));var moment=require(_0x79bb('0x4'));var BPromise=require(_0x79bb('0x5'));var Mustache=require('mustache');var util=require(_0x79bb('0x6'));var path=require(_0x79bb('0x7'));var sox=require(_0x79bb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x79bb('0x9'));var _=require(_0x79bb('0xa'));var squel=require(_0x79bb('0xb'));var crypto=require('crypto');var jsforce=require(_0x79bb('0xc'));var deskjs=require(_0x79bb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x79bb('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x79bb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x79bb('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x79bb('0x11'));var utils=require('../../config/utils');var config=require(_0x79bb('0x12'));var licenseUtil=require(_0x79bb('0x13'));var db=require(_0x79bb('0x14'))['db'];config[_0x79bb('0x15')]=_['defaults'](config['redis'],{'host':_0x79bb('0x16'),'port':0x18eb});var socket=require(_0x79bb('0x17'))(new Redis(config['redis']));require(_0x79bb('0x18'))[_0x79bb('0x19')](socket);function respondWithStatusCode(_0x270286,_0x35e2aa){_0x35e2aa=_0x35e2aa||0xcc;return function(_0x28a6cc){if(_0x28a6cc){return _0x270286[_0x79bb('0x1a')](_0x35e2aa);}return _0x270286[_0x79bb('0x1b')](_0x35e2aa)[_0x79bb('0x1c')]();};}function respondWithResult(_0x366597,_0x38a535){_0x38a535=_0x38a535||0xc8;return function(_0x5c7926){if(_0x5c7926){return _0x366597['status'](_0x38a535)['json'](_0x5c7926);}};}function respondWithFilteredResult(_0xdbf398,_0x16500e){return function(_0x3e89c0){if(_0x3e89c0){var _0x21b56f=typeof _0x16500e[_0x79bb('0x1d')]===_0x79bb('0x1e')&&typeof _0x16500e[_0x79bb('0x1f')]==='undefined';var _0x231404=_0x3e89c0[_0x79bb('0x20')];var _0xf72bd4=_0x21b56f?0x0:_0x16500e[_0x79bb('0x1d')];var _0x42dd15=_0x21b56f?_0x3e89c0[_0x79bb('0x20')]:_0x16500e['offset']+_0x16500e[_0x79bb('0x1f')];var _0x4e5ce1;if(_0x42dd15>=_0x231404){_0x42dd15=_0x231404;_0x4e5ce1=0xc8;}else{_0x4e5ce1=0xce;}_0xdbf398['status'](_0x4e5ce1);return _0xdbf398[_0x79bb('0x21')](_0x79bb('0x22'),_0xf72bd4+'-'+_0x42dd15+'/'+_0x231404)['json'](_0x3e89c0);}return null;};}function patchUpdates(_0x136e37){return function(_0x96f24c){try{jsonpatch[_0x79bb('0x23')](_0x96f24c,_0x136e37,!![]);}catch(_0x56fe2b){return BPromise[_0x79bb('0x24')](_0x56fe2b);}return _0x96f24c['save']();};}function saveUpdates(_0x2e287b,_0x3fc3fc){return function(_0x84ed4b){if(_0x84ed4b){return _0x84ed4b['update'](_0x2e287b)[_0x79bb('0x25')](function(_0x2f7d17){return _0x2f7d17;});}return null;};}function removeEntity(_0x47af95,_0xe6ea0c){return function(_0x5923e2){if(_0x5923e2){return _0x5923e2[_0x79bb('0x26')]()[_0x79bb('0x25')](function(){_0x47af95['status'](0xcc)[_0x79bb('0x1c')]();});}};}function handleEntityNotFound(_0x339bf6,_0x13f4a4){return function(_0x2c204b){if(!_0x2c204b){_0x339bf6['sendStatus'](0x194);}return _0x2c204b;};}function handleError(_0x5d8b8a,_0x26ec76){_0x26ec76=_0x26ec76||0x1f4;return function(_0x16c3a4){logger[_0x79bb('0x27')](_0x16c3a4[_0x79bb('0x28')]);if(_0x16c3a4[_0x79bb('0x29')]){delete _0x16c3a4[_0x79bb('0x29')];}_0x5d8b8a[_0x79bb('0x1b')](_0x26ec76)[_0x79bb('0x2a')](_0x16c3a4);};}exports[_0x79bb('0x2b')]=function(_0x2f5610,_0x4577c6){var _0xe2a411={},_0x4be1a0={},_0x5e0910={'count':0x0,'rows':[]};var _0x137cfd=_[_0x79bb('0x2c')](db[_0x79bb('0x2d')]['rawAttributes'],function(_0x1a4aa7){return{'name':_0x1a4aa7[_0x79bb('0x2e')],'type':_0x1a4aa7[_0x79bb('0x2f')][_0x79bb('0x30')]};});_0x4be1a0[_0x79bb('0x31')]=_[_0x79bb('0x2c')](_0x137cfd,'name');_0x4be1a0[_0x79bb('0x32')]=_[_0x79bb('0x33')](_0x2f5610[_0x79bb('0x32')]);_0x4be1a0[_0x79bb('0x34')]=_['intersection'](_0x4be1a0[_0x79bb('0x31')],_0x4be1a0[_0x79bb('0x32')]);_0xe2a411[_0x79bb('0x35')]=_[_0x79bb('0x36')](_0x4be1a0['model'],qs['fields'](_0x2f5610[_0x79bb('0x32')]['fields']));_0xe2a411['attributes']=_0xe2a411['attributes'][_0x79bb('0x37')]?_0xe2a411[_0x79bb('0x35')]:_0x4be1a0[_0x79bb('0x31')];if(!_0x2f5610[_0x79bb('0x32')][_0x79bb('0x38')](_0x79bb('0x39'))){_0xe2a411['limit']=qs[_0x79bb('0x1f')](_0x2f5610[_0x79bb('0x32')][_0x79bb('0x1f')]);_0xe2a411['offset']=qs['offset'](_0x2f5610[_0x79bb('0x32')]['offset']);}_0xe2a411[_0x79bb('0x3a')]=qs[_0x79bb('0x3b')](_0x2f5610['query'][_0x79bb('0x3b')]);_0xe2a411['where']=qs[_0x79bb('0x34')](_[_0x79bb('0x3c')](_0x2f5610[_0x79bb('0x32')],_0x4be1a0['filters']),_0x137cfd);if(_0x2f5610[_0x79bb('0x32')][_0x79bb('0x3d')]){_0xe2a411['where']=_[_0x79bb('0x3e')](_0xe2a411[_0x79bb('0x3f')],{'$or':_[_0x79bb('0x2c')](_0x137cfd,function(_0x388663){if(_0x388663[_0x79bb('0x2f')]!=='VIRTUAL'){var _0x4a3aa7={};_0x4a3aa7[_0x388663[_0x79bb('0x29')]]={'$like':'%'+_0x2f5610[_0x79bb('0x32')][_0x79bb('0x3d')]+'%'};return _0x4a3aa7;}})});}_0xe2a411=_[_0x79bb('0x3e')]({},_0xe2a411,_0x2f5610[_0x79bb('0x40')]);var _0xd167bd={'where':_0xe2a411['where']};return db[_0x79bb('0x2d')][_0x79bb('0x20')](_0xd167bd)['then'](function(_0x3f48d0){_0x5e0910[_0x79bb('0x20')]=_0x3f48d0;if(_0x2f5610['query'][_0x79bb('0x41')]){_0xe2a411['include']=[{'all':!![]}];}return db[_0x79bb('0x2d')][_0x79bb('0x42')](_0xe2a411);})[_0x79bb('0x25')](function(_0x451d06){_0x5e0910[_0x79bb('0x43')]=_0x451d06;return _0x5e0910;})[_0x79bb('0x25')](respondWithFilteredResult(_0x4577c6,_0xe2a411))[_0x79bb('0x44')](handleError(_0x4577c6,null));};exports['show']=function(_0x4936db,_0x2084ed){var _0x41f2df={'raw':![],'where':{'id':_0x4936db['params']['id']}},_0x292365={};_0x292365[_0x79bb('0x31')]=_[_0x79bb('0x33')](db[_0x79bb('0x2d')][_0x79bb('0x45')]);_0x292365[_0x79bb('0x32')]=_[_0x79bb('0x33')](_0x4936db[_0x79bb('0x32')]);_0x292365[_0x79bb('0x34')]=_[_0x79bb('0x36')](_0x292365[_0x79bb('0x31')],_0x292365[_0x79bb('0x32')]);_0x41f2df['attributes']=_['intersection'](_0x292365[_0x79bb('0x31')],qs['fields'](_0x4936db['query']['fields']));_0x41f2df[_0x79bb('0x35')]=_0x41f2df[_0x79bb('0x35')][_0x79bb('0x37')]?_0x41f2df[_0x79bb('0x35')]:_0x292365['model'];if(_0x4936db['query']['includeAll']){_0x41f2df[_0x79bb('0x46')]=[{'all':!![]}];}_0x41f2df=_[_0x79bb('0x3e')]({},_0x41f2df,_0x4936db[_0x79bb('0x40')]);return db[_0x79bb('0x2d')][_0x79bb('0x47')](_0x41f2df)[_0x79bb('0x25')](handleEntityNotFound(_0x2084ed,null))[_0x79bb('0x25')](respondWithResult(_0x2084ed,null))[_0x79bb('0x44')](handleError(_0x2084ed,null));};exports[_0x79bb('0x48')]=function(_0x54a2ca,_0x572016){return db[_0x79bb('0x2d')]['create'](_0x54a2ca[_0x79bb('0x49')],{})[_0x79bb('0x25')](respondWithResult(_0x572016,0xc9))[_0x79bb('0x44')](handleError(_0x572016,null));};exports['clone']=function(_0x4efd90,_0x14b6fe){var _0x12b75e={'where':{'id':_0x4efd90[_0x79bb('0x4a')]['id']}},_0x5b3c0a={};_0x5b3c0a[_0x79bb('0x31')]=_[_0x79bb('0x33')](db[_0x79bb('0x2d')][_0x79bb('0x45')]);_0x12b75e['attributes']=_[_0x79bb('0x36')](_0x5b3c0a[_0x79bb('0x31')],qs[_0x79bb('0x4b')](_0x4efd90[_0x79bb('0x32')]['fields']));_0x12b75e[_0x79bb('0x35')]=_0x12b75e['attributes'][_0x79bb('0x37')]?_0x12b75e[_0x79bb('0x35')]:_0x5b3c0a[_0x79bb('0x31')];if(_0x4efd90['query'][_0x79bb('0x41')]){_0x12b75e['include']=[{'all':!![]}];}_0x12b75e=_['merge']({},_0x12b75e,_0x4efd90[_0x79bb('0x40')]);return db[_0x79bb('0x2d')][_0x79bb('0x47')](_0x12b75e)[_0x79bb('0x25')](handleEntityNotFound(_0x14b6fe,null))[_0x79bb('0x25')](function(_0x1fd7d6){if(_0x1fd7d6){var _0x254c20=_0x1fd7d6[_0x79bb('0x4c')]({'plain':!![]});_0x254c20=qs['omit'](_0x254c20,['id',_0x79bb('0x4d'),_0x79bb('0x4e'),_0x79bb('0x4f')]);_0x4efd90[_0x79bb('0x49')]=_['omit'](_0x4efd90[_0x79bb('0x49')],['id',_0x79bb('0x4d'),'updatedAt']);return db[_0x79bb('0x50')][_0x79bb('0x51')](function(_0x139f24){return db[_0x79bb('0x2d')][_0x79bb('0x48')](_[_0x79bb('0x3e')](_0x254c20,_0x4efd90[_0x79bb('0x49')]),{'include':_0x4efd90[_0x79bb('0x32')][_0x79bb('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x139f24})[_0x79bb('0x25')](function(_0x1c8419){var _0x5346f7=_0x1c8419['get']({'plain':!![]});return db[_0x79bb('0x52')]['findAll']({'where':{'userProfileId':_0x4efd90[_0x79bb('0x4a')]['id']},'raw':!![]})['then'](function(_0x3cbfa3){if(_0x3cbfa3){return BPromise[_0x79bb('0x53')](_0x3cbfa3,function(_0x5ca7ab){return new BPromise(function(_0x305b0c,_0x25fa11){if(_0x5ca7ab['autoAssociation']===null||_0x5ca7ab[_0x79bb('0x54')]===0x1)_0x305b0c(null);return db[_0x79bb('0x55')][_0x79bb('0x42')]({'where':{'sectionId':_0x5ca7ab['id']},'raw':!![]})[_0x79bb('0x25')](function(_0x12c4a1){var _0x67a73=_[_0x79bb('0x2c')](_0x12c4a1,function(_0x5af10f){return qs['omit'](_0x5af10f,['id','createdAt','updatedAt',_0x79bb('0x56')]);});_0x305b0c(_0x67a73);})['catch'](function(_0x643183){_0x25fa11(_0x643183);});})[_0x79bb('0x25')](function(_0x12c0e1){var _0x4c2792=qs[_0x79bb('0x57')](_0x5ca7ab,['id',_0x79bb('0x4d'),_0x79bb('0x4e')]);_0x4c2792[_0x79bb('0x58')]=_0x5346f7['id'];if(_0x12c0e1)_0x4c2792['Resources']=_0x12c0e1;return _0x4c2792;})[_0x79bb('0x25')](function(_0xca7959){return db['UserProfileSection'][_0x79bb('0x48')](_0xca7959,{'include':[{'model':db['UserProfileResource'],'as':_0x79bb('0x59')}],'raw':!![],'transaction':_0x139f24});});})[_0x79bb('0x25')](function(){return _0x5346f7;});}});});});}})[_0x79bb('0x25')](respondWithResult(_0x14b6fe,0xc9))[_0x79bb('0x44')](handleError(_0x14b6fe,null));};exports[_0x79bb('0x5a')]=function(_0x10b52a,_0x242d37){if(_0x10b52a[_0x79bb('0x49')]['id']){delete _0x10b52a[_0x79bb('0x49')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x10b52a[_0x79bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x242d37,null))[_0x79bb('0x25')](saveUpdates(_0x10b52a[_0x79bb('0x49')],null))[_0x79bb('0x25')](respondWithResult(_0x242d37,null))[_0x79bb('0x44')](handleError(_0x242d37,null));};exports['destroy']=function(_0x20cbbf,_0x5d7441){return db[_0x79bb('0x2d')]['find']({'where':{'id':_0x20cbbf[_0x79bb('0x4a')]['id']}})[_0x79bb('0x25')](handleEntityNotFound(_0x5d7441,null))['then'](removeEntity(_0x5d7441,null))[_0x79bb('0x44')](handleError(_0x5d7441,null));};exports[_0x79bb('0x5b')]=function(_0x54768a,_0x4ef8d3){return db[_0x79bb('0x2d')]['describe']()['then'](respondWithResult(_0x4ef8d3,null))[_0x79bb('0x44')](handleError(_0x4ef8d3,null));};exports['addSections']=function(_0x13e33d,_0xc4ef4b){var _0x5a454d=_0x13e33d[_0x79bb('0x49')];return db[_0x79bb('0x2d')][_0x79bb('0x47')]({'where':{'id':_0x13e33d['params']['id']}})[_0x79bb('0x25')](handleEntityNotFound(_0xc4ef4b,null))[_0x79bb('0x25')](function(_0x2303c9){if(_0x2303c9){return db[_0x79bb('0x50')][_0x79bb('0x51')](function(_0x850c71){return db[_0x79bb('0x52')]['destroy']({'where':{'userProfileId':_0x13e33d[_0x79bb('0x4a')]['id'],'sectionId':_['map'](_0x5a454d,function(_0x58a755){return _0x58a755[_0x79bb('0x56')];})},'transaction':_0x850c71})['then'](function(){var _0x230a94=_[_0x79bb('0x2c')](_0x5a454d,function(_0x11e789){_0x11e789['userProfileId']=_0x13e33d[_0x79bb('0x4a')]['id'];return _0x11e789;});var _0x148a35=[];return BPromise[_0x79bb('0x53')](_0x230a94,function(_0xf2f89c){return db[_0x79bb('0x52')][_0x79bb('0x48')](_0xf2f89c,{'include':[{'model':db[_0x79bb('0x55')],'as':'Resources'}],'raw':!![],'transaction':_0x850c71})[_0x79bb('0x25')](function(_0x3e03ce){_0x148a35[_0x79bb('0x5c')](_0x3e03ce[_0x79bb('0x4c')]({'plain':!![]}));});})[_0x79bb('0x25')](function(){return _0x148a35;});});});}})['then'](function(_0xc8c6cd){return _0xc8c6cd;})[_0x79bb('0x25')](respondWithResult(_0xc4ef4b,null))['catch'](handleError(_0xc4ef4b,null));};exports['removeSections']=function(_0x15035d,_0x1f94e0){var _0xbe2351;return db['UserProfile'][_0x79bb('0x47')]({'where':{'id':_0x15035d[_0x79bb('0x4a')]['id']},'attributes':['id','name']})[_0x79bb('0x25')](handleEntityNotFound(_0x1f94e0,null))[_0x79bb('0x25')](function(_0x39a513){if(_0x39a513){_0xbe2351=_0x39a513;return db[_0x79bb('0x52')][_0x79bb('0x26')]({'where':{'userProfileId':_0x15035d['params']['id'],'sectionId':_0x15035d[_0x79bb('0x32')][_0x79bb('0x5d')]}});}})[_0x79bb('0x25')](function(){return _0xbe2351;})[_0x79bb('0x25')](respondWithStatusCode(_0x1f94e0,null))[_0x79bb('0x44')](handleError(_0x1f94e0,null));};exports['getSections']=function(_0x148770,_0x2964a8){var _0x577c2a=[];var _0x2b4b6c=[];return db[_0x79bb('0x52')]['findAll']({'where':{'userProfileId':_0x148770[_0x79bb('0x4a')]['id']},'raw':!![]})['then'](function(_0x801666){_0x577c2a=_[_0x79bb('0x3d')](_0x801666,function(_0x184e07){return _0x184e07[_0x79bb('0x5e')]===0x1||_['includes']([0x3eb,0x709],_0x184e07[_0x79bb('0x56')]);});if(!_['isEmpty'](_0x577c2a)){return _[_0x79bb('0x2c')](_0x577c2a,function(_0x53a822){return _0x53a822[_0x79bb('0x56')];});}else{return;}})[_0x79bb('0x25')](function(_0x18601b){if(_0x18601b)_0x2b4b6c=_0x18601b;if(_[_0x79bb('0x5f')](_0x2b4b6c,0x64)){var _0x3eeda3=_[_0x79bb('0x47')](_0x577c2a,{'sectionId':0x64});return hasDefaultDashboard(_0x3eeda3)[_0x79bb('0x25')](function(_0x29ec7e){return _[_0x79bb('0x2c')](_0x577c2a,function(_0x21b8c3){if(_0x21b8c3[_0x79bb('0x56')]===0x64){_0x21b8c3[_0x79bb('0x60')]=_0x29ec7e;}return _0x21b8c3;});});}else{return;}})[_0x79bb('0x25')](function(_0x5a3e84){if(_0x5a3e84)_0x577c2a=_0x5a3e84;if(_[_0x79bb('0x5f')](_0x2b4b6c,0x3eb)){var _0x132ee1=_[_0x79bb('0x47')](_0x577c2a,{'sectionId':0x3eb});return getCustomDashboards(_0x132ee1)['then'](function(_0x322c22){return _[_0x79bb('0x2c')](_0x577c2a,function(_0x4e88f){if(_0x132ee1[_0x79bb('0x5e')]){if(_0x4e88f[_0x79bb('0x56')]===0x3eb){_0x4e88f['subsections']=_0x322c22;}}else{if(_0x4e88f[_0x79bb('0x56')]===0x64){if(!_0x4e88f[_0x79bb('0x60')]){_0x4e88f[_0x79bb('0x60')]=[];}_0x4e88f[_0x79bb('0x60')]=_0x4e88f[_0x79bb('0x60')]['concat'](_0x322c22);}}return _0x4e88f;});});}else{return;}})['then'](function(_0x30b04d){if(_0x30b04d)_0x577c2a=_0x30b04d;if(_['includes'](_0x2b4b6c,0x709)){var _0x1dd7ae=_['find'](_0x577c2a,{'sectionId':0x709});return getPlugins(_0x1dd7ae)[_0x79bb('0x25')](function(_0x4e16eb){if(_0x1dd7ae['enabled']){return _[_0x79bb('0x2c')](_0x577c2a,function(_0x4ab968){if(_0x4ab968[_0x79bb('0x56')]===0x709){_0x4ab968[_0x79bb('0x60')]=_0x4e16eb;}return _0x4ab968;});}else{var _0x401c9e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4e16eb};var _0x545e32=_['map'](_0x577c2a);_0x545e32[_0x79bb('0x5c')](_0x401c9e);return _0x545e32;}});}else{return;}})[_0x79bb('0x25')](function(_0x34a50f){if(_0x34a50f)_0x577c2a=_0x34a50f;return _[_0x79bb('0x3d')](_0x577c2a,[_0x79bb('0x5e'),0x1]);})['then'](respondWithResult(_0x2964a8,null))['catch'](handleError(_0x2964a8,null));};function hasDefaultDashboard(_0x539d49){var _0xb74728=[0x65];return new BPromise(function(_0x299521,_0x1e1fd9){try{if(_0x539d49['autoAssociation']){_0x299521(_0xb74728);}else{return db[_0x79bb('0x55')][_0x79bb('0x61')]({'where':{'sectionId':_0x539d49['id']},'raw':!![]})['then'](function(_0x2104f0){_0x2104f0?_0x299521(_0xb74728):_0x299521();});}}catch(_0x59fc96){_0x1e1fd9(_0x59fc96);}});}function getCustomDashboards(_0xd8683a){var _0x1a72dc=[];return new BPromise(function(_0x5614df,_0x396515){try{if(_0xd8683a[_0x79bb('0x54')]){return db[_0x79bb('0x62')][_0x79bb('0x42')]({'raw':!![]})[_0x79bb('0x25')](function(_0x8c80f3){_0x8c80f3[_0x79bb('0x63')](function(_0x393abe){_0x1a72dc[_0x79bb('0x5c')](_0x393abe['id']+0x1869f);});_0x5614df(_0x1a72dc);});}else{return db[_0x79bb('0x55')]['findAll']({'where':{'sectionId':_0xd8683a['id']},'raw':!![]})[_0x79bb('0x25')](function(_0x3640b8){_0x3640b8['forEach'](function(_0x3bdbc2){_0x1a72dc[_0x79bb('0x5c')](_0x3bdbc2[_0x79bb('0x64')]+0x1869f);});_0x5614df(_0x1a72dc);});}}catch(_0x3d0802){_0x396515(_0x3d0802);}});}function getPlugins(_0x47059b){var _0x5099f1=[];return new BPromise(function(_0x2ab54f,_0x3e9406){try{if(_0x47059b['autoAssociation']){return db['Plugin'][_0x79bb('0x42')]({'raw':!![]})[_0x79bb('0x25')](function(_0x3fbb58){_0x3fbb58[_0x79bb('0x63')](function(_0x9cbabf){_0x5099f1[_0x79bb('0x5c')](_0x9cbabf['id']+0x15b38);});_0x2ab54f(_0x5099f1);});}else{return db['UserProfileResource'][_0x79bb('0x42')]({'where':{'sectionId':_0x47059b['id']},'raw':!![]})[_0x79bb('0x25')](function(_0x973baa){_0x973baa[_0x79bb('0x63')](function(_0x1cdeb1){_0x5099f1['push'](_0x1cdeb1['resourceId']+0x15b38);});_0x2ab54f(_0x5099f1);});}}catch(_0x4717d9){_0x3e9406(_0x4717d9);}});}exports[_0x79bb('0x65')]=function(_0x4b009a,_0xbeea18){return db[_0x79bb('0x2d')][_0x79bb('0x47')]({'where':{'id':_0x4b009a[_0x79bb('0x4a')]['id']}})[_0x79bb('0x25')](handleEntityNotFound(_0xbeea18,null))[_0x79bb('0x25')](function(_0x179145){if(_0x179145){return db[_0x79bb('0x50')][_0x79bb('0x51')](function(_0x3c2290){return db[_0x79bb('0x52')][_0x79bb('0x42')]({'where':{'userProfileId':_0x4b009a[_0x79bb('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x79bb('0x25')](function(_0x5a22ed){if(_0x5a22ed){return db[_0x79bb('0x52')][_0x79bb('0x26')]({'where':{'userProfileId':_0x4b009a[_0x79bb('0x4a')]['id'],'id':_['map'](_0x5a22ed,function(_0x1860e4){return _0x1860e4['id'];})},'transaction':_0x3c2290});}})[_0x79bb('0x25')](function(_0x3b8ccd){var _0xb0e3c3=_['map'](_0x4b009a[_0x79bb('0x49')],function(_0xd673d2){_0xd673d2[_0x79bb('0x58')]=_0x4b009a[_0x79bb('0x4a')]['id'];return _0xd673d2;});return db[_0x79bb('0x52')]['bulkCreate'](_0xb0e3c3,{'raw':!![],'transaction':_0x3c2290});})[_0x79bb('0x25')](function(_0x41c1ad){var _0x4dad81=_[_0x79bb('0x3d')](_[_0x79bb('0x2c')](_0x41c1ad,function(_0x56e1a5){return _0x56e1a5['get']({'plain':!![]});}),{'includeAll':![]});if(_0x4dad81){return db[_0x79bb('0x52')][_0x79bb('0x42')]({'where':{'userProfileId':_0x4b009a['params']['id'],'sectionId':_['map'](_0x4dad81,function(_0x2b448b){return _0x2b448b[_0x79bb('0x56')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x79bb('0x25')](function(_0x5bba1f){var _0x46cc53=_['map'](_0x4b009a[_0x79bb('0x49')],function(_0x40dc52){_0x40dc52[_0x79bb('0x58')]=_0x4b009a[_0x79bb('0x4a')]['id'];return _0x40dc52;});return db[_0x79bb('0x55')][_0x79bb('0x66')](_0x46cc53,{'raw':!![],'transaction':_0x3c2290});});}})[_0x79bb('0x44')](handleError(_0xbeea18,null));});}})[_0x79bb('0x25')](function(_0x5d5042){var _0x5007e4=_[_0x79bb('0x2c')](_0x5d5042,function(_0x544bc6){return _0x544bc6[_0x79bb('0x4c')]({'plain':!![]});});})[_0x79bb('0x25')](respondWithResult(_0xbeea18,null))['catch'](handleError(_0xbeea18,null));};exports[_0x79bb('0x67')]=function(_0x3c14ce,_0x9ecfec,_0x34f6be){return db['UserProfile'][_0x79bb('0x47')]({'where':{'id':_0x3c14ce[_0x79bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x9ecfec,null))[_0x79bb('0x25')](function(_0x296d1b){if(_0x296d1b){return _0x296d1b[_0x79bb('0x67')](_0x3c14ce[_0x79bb('0x32')]['ids']);}})[_0x79bb('0x25')](respondWithStatusCode(_0x9ecfec,null))[_0x79bb('0x44')](handleError(_0x9ecfec,null));};exports[_0x79bb('0x68')]=function(_0x467f49,_0x56a616){var _0x465417={};if(!_0x467f49[_0x79bb('0x32')][_0x79bb('0x69')])throw new Error('Missing\x20section\x20parameter');if(!_0x467f49['query']['hasOwnProperty'](_0x79bb('0x39'))){_0x465417[_0x79bb('0x1f')]=qs['limit'](_0x467f49[_0x79bb('0x32')]['limit']);_0x465417[_0x79bb('0x1d')]=qs[_0x79bb('0x1d')](_0x467f49[_0x79bb('0x32')][_0x79bb('0x1d')]);}return db['UserProfile'][_0x79bb('0x47')]({'where':{'id':_0x467f49[_0x79bb('0x4a')]['id']}})[_0x79bb('0x25')](function(_0x3b7123){if(!_0x3b7123)throw new Error(_0x79bb('0x6a')+_0x467f49[_0x79bb('0x4a')]['id']);return db['UserProfile'][_0x79bb('0x68')](_0x467f49);})['then'](respondWithFilteredResult(_0x56a616,_0x465417))[_0x79bb('0x44')](handleError(_0x56a616,null));}; \ No newline at end of file +var _0xe7eb=['merge','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','clone','params','omit','createdAt','updatedAt','crudPermissions','sequelize','get','UserProfileSection','UserProfileResource','Resources','describe','addSections','transaction','sectionId','userProfileId','each','push','removeSections','getSections','includes','isEmpty','subsections','enabled','concat','autoAssociation','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','status','offset','undefined','limit','count','json','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','UserProfile','rawAttributes','fieldName','type','key','map','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x15fab0,_0x416c7d){var _0x1b41a8=function(_0x30d165){while(--_0x30d165){_0x15fab0['push'](_0x15fab0['shift']());}};_0x1b41a8(++_0x416c7d);}(_0xe7eb,0x121));var _0xbe7e=function(_0x35184e,_0x2cd6de){_0x35184e=_0x35184e-0x0;var _0x5c78e3=_0xe7eb[_0x35184e];return _0x5c78e3;};'use strict';var emlformat=require(_0xbe7e('0x0'));var rimraf=require(_0xbe7e('0x1'));var zipdir=require(_0xbe7e('0x2'));var jsonpatch=require(_0xbe7e('0x3'));var rp=require(_0xbe7e('0x4'));var moment=require(_0xbe7e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbe7e('0x6'));var util=require(_0xbe7e('0x7'));var path=require(_0xbe7e('0x8'));var sox=require(_0xbe7e('0x9'));var csv=require(_0xbe7e('0xa'));var ejs=require(_0xbe7e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbe7e('0xc'));var squel=require(_0xbe7e('0xd'));var crypto=require(_0xbe7e('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbe7e('0xa'));var querystring=require(_0xbe7e('0xf'));var Papa=require(_0xbe7e('0x10'));var Redis=require(_0xbe7e('0x11'));var authService=require(_0xbe7e('0x12'));var qs=require(_0xbe7e('0x13'));var as=require(_0xbe7e('0x14'));var hardwareService=require(_0xbe7e('0x15'));var logger=require(_0xbe7e('0x16'))(_0xbe7e('0x17'));var utils=require(_0xbe7e('0x18'));var config=require(_0xbe7e('0x19'));var licenseUtil=require(_0xbe7e('0x1a'));var db=require(_0xbe7e('0x1b'))['db'];config['redis']=_[_0xbe7e('0x1c')](config[_0xbe7e('0x1d')],{'host':_0xbe7e('0x1e'),'port':0x18eb});var socket=require(_0xbe7e('0x1f'))(new Redis(config[_0xbe7e('0x1d')]));require(_0xbe7e('0x20'))[_0xbe7e('0x21')](socket);function respondWithStatusCode(_0x8e73fb,_0x52d190){_0x52d190=_0x52d190||0xcc;return function(_0x601d5f){if(_0x601d5f){return _0x8e73fb['sendStatus'](_0x52d190);}return _0x8e73fb[_0xbe7e('0x22')](_0x52d190)['end']();};}function respondWithResult(_0x4d6f6b,_0x157bd6){_0x157bd6=_0x157bd6||0xc8;return function(_0x5999ca){if(_0x5999ca){return _0x4d6f6b['status'](_0x157bd6)['json'](_0x5999ca);}};}function respondWithFilteredResult(_0x5b63ad,_0x4447e6){return function(_0x2d3ad1){if(_0x2d3ad1){var _0x3c881d=typeof _0x4447e6[_0xbe7e('0x23')]===_0xbe7e('0x24')&&typeof _0x4447e6[_0xbe7e('0x25')]===_0xbe7e('0x24');var _0x3db84b=_0x2d3ad1[_0xbe7e('0x26')];var _0x1e26b2=_0x3c881d?0x0:_0x4447e6['offset'];var _0x54a2e7=_0x3c881d?_0x2d3ad1[_0xbe7e('0x26')]:_0x4447e6[_0xbe7e('0x23')]+_0x4447e6['limit'];var _0x34372b;if(_0x54a2e7>=_0x3db84b){_0x54a2e7=_0x3db84b;_0x34372b=0xc8;}else{_0x34372b=0xce;}_0x5b63ad[_0xbe7e('0x22')](_0x34372b);return _0x5b63ad['set']('Content-Range',_0x1e26b2+'-'+_0x54a2e7+'/'+_0x3db84b)[_0xbe7e('0x27')](_0x2d3ad1);}return null;};}function patchUpdates(_0x15bbb6){return function(_0xa1666){try{jsonpatch['apply'](_0xa1666,_0x15bbb6,!![]);}catch(_0x290eb1){return BPromise[_0xbe7e('0x28')](_0x290eb1);}return _0xa1666[_0xbe7e('0x29')]();};}function saveUpdates(_0x4095b4,_0x212230){return function(_0x2993b3){if(_0x2993b3){return _0x2993b3[_0xbe7e('0x2a')](_0x4095b4)[_0xbe7e('0x2b')](function(_0x2ee668){return _0x2ee668;});}return null;};}function removeEntity(_0x41c9d0,_0x151154){return function(_0x211fd7){if(_0x211fd7){return _0x211fd7[_0xbe7e('0x2c')]()[_0xbe7e('0x2b')](function(){_0x41c9d0[_0xbe7e('0x22')](0xcc)[_0xbe7e('0x2d')]();});}};}function handleEntityNotFound(_0x3de71d,_0x5a35b0){return function(_0x37797a){if(!_0x37797a){_0x3de71d[_0xbe7e('0x2e')](0x194);}return _0x37797a;};}function handleError(_0x17e4a,_0xfe2cca){_0xfe2cca=_0xfe2cca||0x1f4;return function(_0x35fecb){logger[_0xbe7e('0x2f')](_0x35fecb[_0xbe7e('0x30')]);if(_0x35fecb[_0xbe7e('0x31')]){delete _0x35fecb[_0xbe7e('0x31')];}_0x17e4a['status'](_0xfe2cca)[_0xbe7e('0x32')](_0x35fecb);};}exports[_0xbe7e('0x33')]=function(_0x32fa3a,_0x239769){var _0x1735b9={},_0x38a01e={},_0x4c6f84={'count':0x0,'rows':[]};var _0x2668df=_['map'](db[_0xbe7e('0x34')][_0xbe7e('0x35')],function(_0x5218e1){return{'name':_0x5218e1[_0xbe7e('0x36')],'type':_0x5218e1[_0xbe7e('0x37')][_0xbe7e('0x38')]};});_0x38a01e['model']=_[_0xbe7e('0x39')](_0x2668df,_0xbe7e('0x31'));_0x38a01e['query']=_[_0xbe7e('0x3a')](_0x32fa3a['query']);_0x38a01e[_0xbe7e('0x3b')]=_[_0xbe7e('0x3c')](_0x38a01e[_0xbe7e('0x3d')],_0x38a01e['query']);_0x1735b9[_0xbe7e('0x3e')]=_[_0xbe7e('0x3c')](_0x38a01e[_0xbe7e('0x3d')],qs[_0xbe7e('0x3f')](_0x32fa3a[_0xbe7e('0x40')][_0xbe7e('0x3f')]));_0x1735b9[_0xbe7e('0x3e')]=_0x1735b9['attributes'][_0xbe7e('0x41')]?_0x1735b9[_0xbe7e('0x3e')]:_0x38a01e[_0xbe7e('0x3d')];if(!_0x32fa3a[_0xbe7e('0x40')][_0xbe7e('0x42')](_0xbe7e('0x43'))){_0x1735b9[_0xbe7e('0x25')]=qs['limit'](_0x32fa3a['query']['limit']);_0x1735b9[_0xbe7e('0x23')]=qs[_0xbe7e('0x23')](_0x32fa3a[_0xbe7e('0x40')][_0xbe7e('0x23')]);}_0x1735b9['order']=qs[_0xbe7e('0x44')](_0x32fa3a[_0xbe7e('0x40')][_0xbe7e('0x44')]);_0x1735b9[_0xbe7e('0x45')]=qs[_0xbe7e('0x3b')](_[_0xbe7e('0x46')](_0x32fa3a['query'],_0x38a01e[_0xbe7e('0x3b')]),_0x2668df);if(_0x32fa3a[_0xbe7e('0x40')]['filter']){_0x1735b9['where']=_[_0xbe7e('0x47')](_0x1735b9['where'],{'$or':_[_0xbe7e('0x39')](_0x2668df,function(_0x1d214c){if(_0x1d214c[_0xbe7e('0x37')]!=='VIRTUAL'){var _0x48799a={};_0x48799a[_0x1d214c['name']]={'$like':'%'+_0x32fa3a[_0xbe7e('0x40')][_0xbe7e('0x48')]+'%'};return _0x48799a;}})});}_0x1735b9=_['merge']({},_0x1735b9,_0x32fa3a[_0xbe7e('0x49')]);var _0x2e8268={'where':_0x1735b9[_0xbe7e('0x45')]};return db['UserProfile'][_0xbe7e('0x26')](_0x2e8268)['then'](function(_0x34aac4){_0x4c6f84[_0xbe7e('0x26')]=_0x34aac4;if(_0x32fa3a[_0xbe7e('0x40')][_0xbe7e('0x4a')]){_0x1735b9[_0xbe7e('0x4b')]=[{'all':!![]}];}return db['UserProfile'][_0xbe7e('0x4c')](_0x1735b9);})[_0xbe7e('0x2b')](function(_0x623b13){_0x4c6f84[_0xbe7e('0x4d')]=_0x623b13;return _0x4c6f84;})['then'](respondWithFilteredResult(_0x239769,_0x1735b9))[_0xbe7e('0x4e')](handleError(_0x239769,null));};exports[_0xbe7e('0x4f')]=function(_0x46540c,_0x5a9401){var _0x2dedb5={'raw':![],'where':{'id':_0x46540c['params']['id']}},_0x15ed8d={};_0x15ed8d[_0xbe7e('0x3d')]=_[_0xbe7e('0x3a')](db[_0xbe7e('0x34')][_0xbe7e('0x35')]);_0x15ed8d[_0xbe7e('0x40')]=_[_0xbe7e('0x3a')](_0x46540c[_0xbe7e('0x40')]);_0x15ed8d[_0xbe7e('0x3b')]=_[_0xbe7e('0x3c')](_0x15ed8d[_0xbe7e('0x3d')],_0x15ed8d[_0xbe7e('0x40')]);_0x2dedb5['attributes']=_[_0xbe7e('0x3c')](_0x15ed8d['model'],qs[_0xbe7e('0x3f')](_0x46540c[_0xbe7e('0x40')]['fields']));_0x2dedb5[_0xbe7e('0x3e')]=_0x2dedb5[_0xbe7e('0x3e')]['length']?_0x2dedb5[_0xbe7e('0x3e')]:_0x15ed8d[_0xbe7e('0x3d')];if(_0x46540c[_0xbe7e('0x40')][_0xbe7e('0x4a')]){_0x2dedb5[_0xbe7e('0x4b')]=[{'all':!![]}];}_0x2dedb5=_[_0xbe7e('0x47')]({},_0x2dedb5,_0x46540c['options']);return db[_0xbe7e('0x34')][_0xbe7e('0x50')](_0x2dedb5)[_0xbe7e('0x2b')](handleEntityNotFound(_0x5a9401,null))[_0xbe7e('0x2b')](respondWithResult(_0x5a9401,null))[_0xbe7e('0x4e')](handleError(_0x5a9401,null));};exports[_0xbe7e('0x51')]=function(_0x11457b,_0x249954){return db['UserProfile']['create'](_0x11457b[_0xbe7e('0x52')],{})[_0xbe7e('0x2b')](respondWithResult(_0x249954,0xc9))[_0xbe7e('0x4e')](handleError(_0x249954,null));};exports[_0xbe7e('0x53')]=function(_0x24ddf0,_0x5a633c){var _0x74676c={'where':{'id':_0x24ddf0[_0xbe7e('0x54')]['id']}},_0x3ed19b={};_0x3ed19b['model']=_[_0xbe7e('0x3a')](db[_0xbe7e('0x34')][_0xbe7e('0x35')]);_0x74676c[_0xbe7e('0x3e')]=_['intersection'](_0x3ed19b[_0xbe7e('0x3d')],qs[_0xbe7e('0x3f')](_0x24ddf0[_0xbe7e('0x40')][_0xbe7e('0x3f')]));_0x74676c[_0xbe7e('0x3e')]=_0x74676c[_0xbe7e('0x3e')]['length']?_0x74676c[_0xbe7e('0x3e')]:_0x3ed19b['model'];if(_0x24ddf0[_0xbe7e('0x40')][_0xbe7e('0x4a')]){_0x74676c['include']=[{'all':!![]}];}_0x74676c=_[_0xbe7e('0x47')]({},_0x74676c,_0x24ddf0[_0xbe7e('0x49')]);return db[_0xbe7e('0x34')][_0xbe7e('0x50')](_0x74676c)[_0xbe7e('0x2b')](handleEntityNotFound(_0x5a633c,null))[_0xbe7e('0x2b')](function(_0x2ea645){if(_0x2ea645){var _0xb7ec29=_0x2ea645['get']({'plain':!![]});_0xb7ec29=qs[_0xbe7e('0x55')](_0xb7ec29,['id',_0xbe7e('0x56'),_0xbe7e('0x57'),_0xbe7e('0x58')]);_0x24ddf0[_0xbe7e('0x52')]=_['omit'](_0x24ddf0[_0xbe7e('0x52')],['id',_0xbe7e('0x56'),_0xbe7e('0x57')]);return db[_0xbe7e('0x59')]['transaction'](function(_0x1225eb){return db[_0xbe7e('0x34')][_0xbe7e('0x51')](_[_0xbe7e('0x47')](_0xb7ec29,_0x24ddf0[_0xbe7e('0x52')]),{'include':_0x24ddf0['query'][_0xbe7e('0x4a')]?[{'all':!![]}]:undefined,'transaction':_0x1225eb})[_0xbe7e('0x2b')](function(_0x12579d){var _0x3fd596=_0x12579d[_0xbe7e('0x5a')]({'plain':!![]});return db[_0xbe7e('0x5b')][_0xbe7e('0x4c')]({'where':{'userProfileId':_0x24ddf0[_0xbe7e('0x54')]['id']},'raw':!![]})[_0xbe7e('0x2b')](function(_0x494ffe){if(_0x494ffe){return BPromise['each'](_0x494ffe,function(_0x1c0308){return new BPromise(function(_0x25fa6e,_0x535daa){if(_0x1c0308['autoAssociation']===null||_0x1c0308['autoAssociation']===0x1)_0x25fa6e(null);return db[_0xbe7e('0x5c')][_0xbe7e('0x4c')]({'where':{'sectionId':_0x1c0308['id']},'raw':!![]})[_0xbe7e('0x2b')](function(_0x2b7e89){var _0x1786b9=_[_0xbe7e('0x39')](_0x2b7e89,function(_0x58a377){return qs[_0xbe7e('0x55')](_0x58a377,['id',_0xbe7e('0x56'),'updatedAt','sectionId']);});_0x25fa6e(_0x1786b9);})['catch'](function(_0x3159fb){_0x535daa(_0x3159fb);});})[_0xbe7e('0x2b')](function(_0x4038dd){var _0x15c3ec=qs[_0xbe7e('0x55')](_0x1c0308,['id',_0xbe7e('0x56'),'updatedAt']);_0x15c3ec['userProfileId']=_0x3fd596['id'];if(_0x4038dd)_0x15c3ec['Resources']=_0x4038dd;return _0x15c3ec;})['then'](function(_0x4957c7){return db[_0xbe7e('0x5b')][_0xbe7e('0x51')](_0x4957c7,{'include':[{'model':db[_0xbe7e('0x5c')],'as':_0xbe7e('0x5d')}],'raw':!![],'transaction':_0x1225eb});});})[_0xbe7e('0x2b')](function(){return _0x3fd596;});}});});});}})['then'](respondWithResult(_0x5a633c,0xc9))[_0xbe7e('0x4e')](handleError(_0x5a633c,null));};exports[_0xbe7e('0x2a')]=function(_0x1b1ed4,_0x4ff472){if(_0x1b1ed4['body']['id']){delete _0x1b1ed4[_0xbe7e('0x52')]['id'];}return db[_0xbe7e('0x34')][_0xbe7e('0x50')]({'where':{'id':_0x1b1ed4[_0xbe7e('0x54')]['id']}})[_0xbe7e('0x2b')](handleEntityNotFound(_0x4ff472,null))[_0xbe7e('0x2b')](saveUpdates(_0x1b1ed4[_0xbe7e('0x52')],null))[_0xbe7e('0x2b')](respondWithResult(_0x4ff472,null))['catch'](handleError(_0x4ff472,null));};exports[_0xbe7e('0x2c')]=function(_0x191736,_0x1ecdaf){return db[_0xbe7e('0x34')][_0xbe7e('0x50')]({'where':{'id':_0x191736[_0xbe7e('0x54')]['id']}})[_0xbe7e('0x2b')](handleEntityNotFound(_0x1ecdaf,null))['then'](removeEntity(_0x1ecdaf,null))[_0xbe7e('0x4e')](handleError(_0x1ecdaf,null));};exports['describe']=function(_0x56c2d1,_0x58370b){return db[_0xbe7e('0x34')][_0xbe7e('0x5e')]()[_0xbe7e('0x2b')](respondWithResult(_0x58370b,null))[_0xbe7e('0x4e')](handleError(_0x58370b,null));};exports[_0xbe7e('0x5f')]=function(_0x47385d,_0x40c94b){var _0x510426=_0x47385d[_0xbe7e('0x52')];return db[_0xbe7e('0x34')]['find']({'where':{'id':_0x47385d['params']['id']}})[_0xbe7e('0x2b')](handleEntityNotFound(_0x40c94b,null))['then'](function(_0x50758a){if(_0x50758a){return db[_0xbe7e('0x59')][_0xbe7e('0x60')](function(_0x59d7c9){return db[_0xbe7e('0x5b')][_0xbe7e('0x2c')]({'where':{'userProfileId':_0x47385d[_0xbe7e('0x54')]['id'],'sectionId':_[_0xbe7e('0x39')](_0x510426,function(_0x553e4e){return _0x553e4e[_0xbe7e('0x61')];})},'transaction':_0x59d7c9})[_0xbe7e('0x2b')](function(){var _0x494cdb=_[_0xbe7e('0x39')](_0x510426,function(_0x109ae3){_0x109ae3[_0xbe7e('0x62')]=_0x47385d[_0xbe7e('0x54')]['id'];return _0x109ae3;});var _0x20df5f=[];return BPromise[_0xbe7e('0x63')](_0x494cdb,function(_0x2af2cd){return db[_0xbe7e('0x5b')]['create'](_0x2af2cd,{'include':[{'model':db[_0xbe7e('0x5c')],'as':_0xbe7e('0x5d')}],'raw':!![],'transaction':_0x59d7c9})[_0xbe7e('0x2b')](function(_0x1e0883){_0x20df5f[_0xbe7e('0x64')](_0x1e0883[_0xbe7e('0x5a')]({'plain':!![]}));});})['then'](function(){return _0x20df5f;});});});}})[_0xbe7e('0x2b')](function(_0x53a0d2){return _0x53a0d2;})[_0xbe7e('0x2b')](respondWithResult(_0x40c94b,null))['catch'](handleError(_0x40c94b,null));};exports[_0xbe7e('0x65')]=function(_0x328d65,_0x545a68){var _0x282467;return db[_0xbe7e('0x34')][_0xbe7e('0x50')]({'where':{'id':_0x328d65[_0xbe7e('0x54')]['id']},'attributes':['id',_0xbe7e('0x31')]})['then'](handleEntityNotFound(_0x545a68,null))[_0xbe7e('0x2b')](function(_0x534602){if(_0x534602){_0x282467=_0x534602;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x328d65['params']['id'],'sectionId':_0x328d65[_0xbe7e('0x40')]['ids']}});}})[_0xbe7e('0x2b')](function(){return _0x282467;})[_0xbe7e('0x2b')](respondWithStatusCode(_0x545a68,null))[_0xbe7e('0x4e')](handleError(_0x545a68,null));};exports[_0xbe7e('0x66')]=function(_0x2805c6,_0x3366e2){var _0x39d00a=[];var _0x48ba95=[];return db['UserProfileSection'][_0xbe7e('0x4c')]({'where':{'userProfileId':_0x2805c6[_0xbe7e('0x54')]['id']},'raw':!![]})['then'](function(_0x163544){_0x39d00a=_['filter'](_0x163544,function(_0x501058){return _0x501058['enabled']===0x1||_[_0xbe7e('0x67')]([0x3eb,0x709],_0x501058['sectionId']);});if(!_[_0xbe7e('0x68')](_0x39d00a)){return _['map'](_0x39d00a,function(_0x1bd5bb){return _0x1bd5bb[_0xbe7e('0x61')];});}else{return;}})[_0xbe7e('0x2b')](function(_0x5537a8){if(_0x5537a8)_0x48ba95=_0x5537a8;if(_[_0xbe7e('0x67')](_0x48ba95,0x64)){var _0x1d9a28=_[_0xbe7e('0x50')](_0x39d00a,{'sectionId':0x64});return hasDefaultDashboard(_0x1d9a28)[_0xbe7e('0x2b')](function(_0x19fcef){return _[_0xbe7e('0x39')](_0x39d00a,function(_0x221a12){if(_0x221a12[_0xbe7e('0x61')]===0x64){_0x221a12[_0xbe7e('0x69')]=_0x19fcef;}return _0x221a12;});});}else{return;}})[_0xbe7e('0x2b')](function(_0x1ead20){if(_0x1ead20)_0x39d00a=_0x1ead20;if(_[_0xbe7e('0x67')](_0x48ba95,0x3eb)){var _0x934e77=_['find'](_0x39d00a,{'sectionId':0x3eb});return getCustomDashboards(_0x934e77)[_0xbe7e('0x2b')](function(_0x311c0d){return _['map'](_0x39d00a,function(_0xc5ec18){if(_0x934e77[_0xbe7e('0x6a')]){if(_0xc5ec18[_0xbe7e('0x61')]===0x3eb){_0xc5ec18[_0xbe7e('0x69')]=_0x311c0d;}}else{if(_0xc5ec18[_0xbe7e('0x61')]===0x64){if(!_0xc5ec18[_0xbe7e('0x69')]){_0xc5ec18[_0xbe7e('0x69')]=[];}_0xc5ec18[_0xbe7e('0x69')]=_0xc5ec18[_0xbe7e('0x69')][_0xbe7e('0x6b')](_0x311c0d);}}return _0xc5ec18;});});}else{return;}})[_0xbe7e('0x2b')](function(_0x397cda){if(_0x397cda)_0x39d00a=_0x397cda;if(_['includes'](_0x48ba95,0x709)){var _0x584a6f=_['find'](_0x39d00a,{'sectionId':0x709});return getPlugins(_0x584a6f)['then'](function(_0xc2d7f4){if(_0x584a6f[_0xbe7e('0x6a')]){return _[_0xbe7e('0x39')](_0x39d00a,function(_0x18687d){if(_0x18687d[_0xbe7e('0x61')]===0x709){_0x18687d[_0xbe7e('0x69')]=_0xc2d7f4;}return _0x18687d;});}else{var _0x1f0152={'sectionId':0x76c,'enabled':0x1,'subsections':_0xc2d7f4};var _0x3f494a=_[_0xbe7e('0x39')](_0x39d00a);_0x3f494a[_0xbe7e('0x64')](_0x1f0152);return _0x3f494a;}});}else{return;}})[_0xbe7e('0x2b')](function(_0x5b0b4e){if(_0x5b0b4e)_0x39d00a=_0x5b0b4e;return _[_0xbe7e('0x48')](_0x39d00a,['enabled',0x1]);})['then'](respondWithResult(_0x3366e2,null))[_0xbe7e('0x4e')](handleError(_0x3366e2,null));};function hasDefaultDashboard(_0x2987e5){var _0x557923=[0x65];return new BPromise(function(_0x335fc4,_0x1af59b){try{if(_0x2987e5['autoAssociation']){_0x335fc4(_0x557923);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x2987e5['id']},'raw':!![]})[_0xbe7e('0x2b')](function(_0x291788){_0x291788?_0x335fc4(_0x557923):_0x335fc4();});}}catch(_0xf8c6b9){_0x1af59b(_0xf8c6b9);}});}function getCustomDashboards(_0x21b4d6){var _0x24c780=[];return new BPromise(function(_0x54f48d,_0x3bda28){try{if(_0x21b4d6[_0xbe7e('0x6c')]){return db['Dashboard']['findAll']({'raw':!![]})[_0xbe7e('0x2b')](function(_0x55e567){_0x55e567[_0xbe7e('0x6d')](function(_0x40b201){_0x24c780[_0xbe7e('0x64')](_0x40b201['id']+0x1869f);});_0x54f48d(_0x24c780);});}else{return db[_0xbe7e('0x5c')][_0xbe7e('0x4c')]({'where':{'sectionId':_0x21b4d6['id']},'raw':!![]})['then'](function(_0x5d3396){_0x5d3396[_0xbe7e('0x6d')](function(_0x221090){_0x24c780[_0xbe7e('0x64')](_0x221090[_0xbe7e('0x6e')]+0x1869f);});_0x54f48d(_0x24c780);});}}catch(_0x299464){_0x3bda28(_0x299464);}});}function getPlugins(_0x453d01){var _0xa3897a=[];return new BPromise(function(_0x394c83,_0x1e472b){try{if(_0x453d01[_0xbe7e('0x6c')]){return db[_0xbe7e('0x6f')][_0xbe7e('0x4c')]({'raw':!![]})[_0xbe7e('0x2b')](function(_0x4b37dd){_0x4b37dd[_0xbe7e('0x6d')](function(_0x18d2d5){_0xa3897a[_0xbe7e('0x64')](_0x18d2d5['id']+0x15b38);});_0x394c83(_0xa3897a);});}else{return db[_0xbe7e('0x5c')][_0xbe7e('0x4c')]({'where':{'sectionId':_0x453d01['id']},'raw':!![]})[_0xbe7e('0x2b')](function(_0x4d350e){_0x4d350e['forEach'](function(_0x891e2d){_0xa3897a['push'](_0x891e2d[_0xbe7e('0x6e')]+0x15b38);});_0x394c83(_0xa3897a);});}}catch(_0x6e0753){_0x1e472b(_0x6e0753);}});}exports[_0xbe7e('0x70')]=function(_0x118c8a,_0x39902b){return db[_0xbe7e('0x34')]['find']({'where':{'id':_0x118c8a[_0xbe7e('0x54')]['id']}})['then'](handleEntityNotFound(_0x39902b,null))['then'](function(_0x5ae46e){if(_0x5ae46e){return db[_0xbe7e('0x59')]['transaction'](function(_0x4662d2){return db[_0xbe7e('0x5b')]['findAll']({'where':{'userProfileId':_0x118c8a[_0xbe7e('0x54')]['id']},'attributes':['id'],'raw':!![]})[_0xbe7e('0x2b')](function(_0x471c15){if(_0x471c15){return db[_0xbe7e('0x5b')][_0xbe7e('0x2c')]({'where':{'userProfileId':_0x118c8a['params']['id'],'id':_['map'](_0x471c15,function(_0x552a82){return _0x552a82['id'];})},'transaction':_0x4662d2});}})[_0xbe7e('0x2b')](function(_0x272680){var _0x1bf171=_['map'](_0x118c8a[_0xbe7e('0x52')],function(_0x2b3fa7){_0x2b3fa7[_0xbe7e('0x62')]=_0x118c8a['params']['id'];return _0x2b3fa7;});return db[_0xbe7e('0x5b')]['bulkCreate'](_0x1bf171,{'raw':!![],'transaction':_0x4662d2});})[_0xbe7e('0x2b')](function(_0x53c2d9){var _0x4416ae=_[_0xbe7e('0x48')](_[_0xbe7e('0x39')](_0x53c2d9,function(_0x69475a){return _0x69475a[_0xbe7e('0x5a')]({'plain':!![]});}),{'includeAll':![]});if(_0x4416ae){return db['UserProfileSection'][_0xbe7e('0x4c')]({'where':{'userProfileId':_0x118c8a[_0xbe7e('0x54')]['id'],'sectionId':_['map'](_0x4416ae,function(_0x4ddb96){return _0x4ddb96['sectionId'];})},'attributes':['id',_0xbe7e('0x61')],'raw':!![]})[_0xbe7e('0x2b')](function(_0xd1ba75){var _0xd444b2=_[_0xbe7e('0x39')](_0x118c8a[_0xbe7e('0x52')],function(_0x4d45ff){_0x4d45ff[_0xbe7e('0x62')]=_0x118c8a['params']['id'];return _0x4d45ff;});return db['UserProfileResource'][_0xbe7e('0x71')](_0xd444b2,{'raw':!![],'transaction':_0x4662d2});});}})[_0xbe7e('0x4e')](handleError(_0x39902b,null));});}})['then'](function(_0x5919d1){var _0x9d5680=_[_0xbe7e('0x39')](_0x5919d1,function(_0x55c759){return _0x55c759[_0xbe7e('0x5a')]({'plain':!![]});});})[_0xbe7e('0x2b')](respondWithResult(_0x39902b,null))[_0xbe7e('0x4e')](handleError(_0x39902b,null));};exports[_0xbe7e('0x72')]=function(_0x36589f,_0x5df5c3,_0xa15462){return db[_0xbe7e('0x34')][_0xbe7e('0x50')]({'where':{'id':_0x36589f[_0xbe7e('0x54')]['id']}})[_0xbe7e('0x2b')](handleEntityNotFound(_0x5df5c3,null))[_0xbe7e('0x2b')](function(_0x434adc){if(_0x434adc){return _0x434adc[_0xbe7e('0x72')](_0x36589f['query'][_0xbe7e('0x73')]);}})[_0xbe7e('0x2b')](respondWithStatusCode(_0x5df5c3,null))[_0xbe7e('0x4e')](handleError(_0x5df5c3,null));};exports[_0xbe7e('0x74')]=function(_0x17f451,_0x293fa3){var _0x381701={};if(!_0x17f451[_0xbe7e('0x40')][_0xbe7e('0x75')])throw new Error(_0xbe7e('0x76'));if(!_0x17f451['query']['hasOwnProperty'](_0xbe7e('0x43'))){_0x381701[_0xbe7e('0x25')]=qs[_0xbe7e('0x25')](_0x17f451[_0xbe7e('0x40')]['limit']);_0x381701[_0xbe7e('0x23')]=qs['offset'](_0x17f451[_0xbe7e('0x40')][_0xbe7e('0x23')]);}return db[_0xbe7e('0x34')][_0xbe7e('0x50')]({'where':{'id':_0x17f451[_0xbe7e('0x54')]['id']}})[_0xbe7e('0x2b')](function(_0x395529){if(!_0x395529)throw new Error(_0xbe7e('0x77')+_0x17f451['params']['id']);return db[_0xbe7e('0x34')][_0xbe7e('0x74')](_0x17f451);})[_0xbe7e('0x2b')](respondWithFilteredResult(_0x293fa3,_0x381701))[_0xbe7e('0x4e')](handleError(_0x293fa3,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index d58bad2..a2a5e87 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 _0x5d58=['hook','update','remove','emit','hasOwnProperty'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x5d58,0x187));var _0x85d5=function(_0x5eaa2f,_0x125e1e){_0x5eaa2f=_0x5eaa2f-0x0;var _0x460d1b=_0x5d58[_0x5eaa2f];return _0x460d1b;};'use strict';var EventEmitter=require('events');var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x85d5('0x0'),'afterDestroy':_0x85d5('0x1')};function emitEvent(_0x53ca58){return function(_0x1469fc,_0x30bfe8,_0x54207b){UserProfileEvents[_0x85d5('0x2')](_0x53ca58+':'+_0x1469fc['id'],_0x1469fc);UserProfileEvents[_0x85d5('0x2')](_0x53ca58,_0x1469fc);_0x54207b(null);};}for(var e in events){if(events[_0x85d5('0x3')](e)){var event=events[e];UserProfile[_0x85d5('0x4')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x4975=['UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0x4975,0x86));var _0x5497=function(_0x31e8e2,_0x437197){_0x31e8e2=_0x31e8e2-0x0;var _0x18b743=_0x4975[_0x31e8e2];return _0x18b743;};'use strict';var EventEmitter=require(_0x5497('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x5497('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5497('0x2')](0x0);var events={'afterCreate':_0x5497('0x3'),'afterUpdate':_0x5497('0x4'),'afterDestroy':_0x5497('0x5')};function emitEvent(_0x235986){return function(_0x14cecb,_0xeb31af,_0xbb1888){UserProfileEvents[_0x5497('0x6')](_0x235986+':'+_0x14cecb['id'],_0x14cecb);UserProfileEvents['emit'](_0x235986,_0x14cecb);_0xbb1888(null);};}for(var e in events){if(events[_0x5497('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x5497('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 6a985f1..1d4329d 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 _0xbc0a=['forEach','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','count','color','tag','include','openTabs','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','models','field','filter','value','findAll','then','associatedResources','map','model','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','catch','childModel','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','projects','contacts','CmContact','Lists','lists','CmList','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','tags','Tag','templates','Template','Trunk','variables','Variable','plugins','Plugin','extractedreports','reportId','AnalyticMetric','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','foreignKey','options','autoAssociation','includeAll'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xbc0a,0xd4));var _0xabc0=function(_0x5a9d13,_0x174908){_0x5a9d13=_0x5a9d13-0x0;var _0x2b971d=_0xbc0a[_0x5a9d13];return _0x2b971d;};'use strict';var _=require(_0xabc0('0x0'));var attributes=require(_0xabc0('0x1'));var squel=require('squel');module['exports']=function(_0xe5e0f){var _0x4d1cf0=_0xe5e0f[_0xabc0('0x2')];function _0x53cd28(_0x3d6332,_0x61f577){return new Promise(function(_0x2230d6,_0x200aaf){if(!_0x61f577)return _0x2230d6(null);var _0x81c60b=_0x61f577['filter']?{[_0x61f577['filter'][_0xabc0('0x3')]]:_0x61f577[_0xabc0('0x4')][_0xabc0('0x5')]}:undefined;return _0x4d1cf0[_0x3d6332][_0xabc0('0x6')]({'where':_0x81c60b,'raw':!![]})[_0xabc0('0x7')](function(_0xbc095c){_0x61f577[_0xabc0('0x8')]=_[_0xabc0('0x9')](_0xbc095c,'id');_0x2230d6(_0x61f577);})['catch'](function(_0x3c0f60){_0x200aaf(_0x3c0f60);});});}function _0x3016a8(_0x17fb56,_0x3e41b1){return new Promise(function(_0x2addcf,_0x17ca49){var _0x262784=_0x17fb56['filter']?{[_0x17fb56[_0xabc0('0x4')][_0xabc0('0x3')]]:_0x17fb56[_0xabc0('0x4')][_0xabc0('0x5')]}:undefined;return _0x4d1cf0[_0x17fb56[_0xabc0('0xa')]][_0xabc0('0x6')]({'where':_0x262784,'raw':!![]})[_0xabc0('0x7')](function(_0x4f3791){_0x3e41b1['associatedResources']=_[_0xabc0('0x9')](_0x4f3791,function(_0x4a3560){return _0x4a3560[_0xabc0('0xb')];});_0x2addcf(_0x3e41b1);})['catch'](function(_0x553d9d){_0x17ca49(_0x553d9d);});});}function _0x3d9343(_0xe4e9a0,_0x387821,_0x19147c){if(!_0x387821)return Promise[_0xabc0('0xc')](null);return new Promise(function(_0x4b5739,_0x2ecb06){return _0x4d1cf0[_0xabc0('0xd')][_0xabc0('0x6')]({'where':{'sectionId':_0x387821['id']},'raw':!![]})[_0xabc0('0x7')](function(_0x38d029){if(_0xe4e9a0['field']&&_0xe4e9a0[_0xabc0('0x3')]!=='id'){_0x387821[_0xabc0('0x8')]=_['map'](_0x38d029,function(_0x3e4ea1){return _0x3e4ea1[_0xe4e9a0['field']];});}else{if(_0x19147c===_0xabc0('0xe')){_0x387821[_0xabc0('0x8')]=_[_0xabc0('0x9')](_0x38d029,function(_0x2aadeb){return{'id':_0x2aadeb[_0xabc0('0xf')],'type':_0x2aadeb['type']};});}else{_0x387821[_0xabc0('0x8')]=_[_0xabc0('0x9')](_0x38d029,function(_0xc1cff1){return _0xc1cff1[_0xabc0('0xf')];});}}_0x4b5739(_0x387821);})[_0xabc0('0x10')](function(_0x4cc152){_0x2ecb06(_0x4cc152);});});}function _0x38df1d(_0x2318b4,_0x929c71){var _0x55812e={'parentSections':[]};switch(_0x2318b4['toLowerCase']()){case'squareprojects':_0x55812e[_0xabc0('0x11')]='SquareProject';break;case _0xabc0('0x12'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x13');break;case _0xabc0('0x14'):_0x55812e[_0xabc0('0x11')]='SquareRecording';_0x55812e[_0xabc0('0x15')]=[{'name':_0xabc0('0x16'),'field':_0xabc0('0xb'),'foreignKey':_0xabc0('0x17')}];break;case _0xabc0('0x18'):_0x55812e['childModel']='JscriptyProject';break;case _0xabc0('0x19'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x1a');_0x55812e[_0xabc0('0x15')]=[{'name':_0xabc0('0x1b'),'field':'id','foreignKey':'ListId'}];break;case _0xabc0('0x1c'):_0x55812e['childModel']=_0xabc0('0x1d');break;case'companies':_0x55812e[_0xabc0('0x11')]='CmCompany';break;case _0xabc0('0x1e'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x1f');break;case _0xabc0('0x20'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x21');break;case _0xabc0('0x22'):_0x55812e[_0xabc0('0x11')]='ChatWebsite';break;case'faxqueues':_0x55812e[_0xabc0('0x11')]=_0xabc0('0x23');break;case _0xabc0('0x24'):_0x55812e[_0xabc0('0x11')]='FaxAccount';break;case _0xabc0('0x25'):case _0xabc0('0x26'):case _0xabc0('0x27'):_0x55812e['childModel']=_0xabc0('0x28');break;case _0xabc0('0x29'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x2a');break;case _0xabc0('0x2b'):_0x55812e[_0xabc0('0x11')]='VoiceMail';break;case _0xabc0('0x2c'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x2d');_0x55812e['parentSections']=[{'name':_0xabc0('0x2e'),'field':'name','foreignKey':_0xabc0('0x2f'),'model':_0xabc0('0x30'),'filter':{'field':_0xabc0('0x31'),'value':['agent']}},{'name':'Telephones','field':_0xabc0('0xb'),'foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0xabc0('0x32')]}},{'name':_0xabc0('0x33'),'field':_0xabc0('0xb'),'foreignKey':_0xabc0('0x34'),'model':_0xabc0('0x35'),'filter':{'field':_0xabc0('0x36'),'value':[_0xabc0('0x37')]}},{'name':_0xabc0('0x38'),'field':_0xabc0('0xb'),'foreignKey':_0xabc0('0x34'),'model':_0xabc0('0x35'),'filter':{'field':_0xabc0('0x36'),'value':[_0xabc0('0x39')]}}];break;case _0xabc0('0x3a'):_0x55812e[_0xabc0('0x11')]='VoiceMusicOnHold';break;case _0xabc0('0x3b'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x3c');break;case'voiceprefixes':_0x55812e[_0xabc0('0x11')]=_0xabc0('0x3d');break;case'ivrcampaigns':_0x55812e['childModel']=_0xabc0('0x3e');break;case _0xabc0('0x3f'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x40');break;case _0xabc0('0x41'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x42');break;case _0xabc0('0x43'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x44');break;case _0xabc0('0x45'):_0x55812e[_0xabc0('0x11')]='OpenchannelQueue';break;case _0xabc0('0x46'):_0x55812e['childModel']=_0xabc0('0x47');break;case _0xabc0('0x48'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x49');break;case _0xabc0('0x4a'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x4b');break;case'whatsappqueues':_0x55812e[_0xabc0('0x11')]=_0xabc0('0x4c');break;case _0xabc0('0x4d'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x4e');break;case _0xabc0('0x4f'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x50');break;case _0xabc0('0x51'):case _0xabc0('0x52'):_0x55812e['childModel']=_0xabc0('0x35');if(_0x929c71){_0x55812e[_0xabc0('0x15')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0xabc0('0x53'):case _0xabc0('0x54'):case _0xabc0('0x55'):_0x55812e['childModel']=_0xabc0('0x30');if(_0x929c71){_0x55812e[_0xabc0('0x15')]=[{'name':_0xabc0('0x56'),'filter':{'field':_0xabc0('0x31'),'value':[_0xabc0('0x57'),_0xabc0('0x58')]},'ignore':!![]},{'name':_0xabc0('0x2e')},{'name':'Telephones'}];}break;case _0xabc0('0x59'):_0x55812e['childModel']='ZendeskAccount';break;case'salesforceaccounts':_0x55812e['childModel']=_0xabc0('0x5a');break;case _0xabc0('0x5b'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x5c');break;case'sugarcrmaccounts':_0x55812e[_0xabc0('0x11')]=_0xabc0('0x5d');break;case _0xabc0('0x5e'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x5f');break;case _0xabc0('0x60'):_0x55812e['childModel']=_0xabc0('0x61');break;case _0xabc0('0x62'):_0x55812e['childModel']=_0xabc0('0x30');break;case _0xabc0('0x63'):_0x55812e[_0xabc0('0x11')]='CannedAnswer';break;case _0xabc0('0x64'):_0x55812e[_0xabc0('0x11')]='Disposition';break;case _0xabc0('0x65'):_0x55812e['childModel']=_0xabc0('0x66');break;case _0xabc0('0x67'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x68');break;case'pauses':_0x55812e[_0xabc0('0x11')]=_0xabc0('0x69');break;case _0xabc0('0x6a'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x6b');break;case _0xabc0('0x6c'):_0x55812e[_0xabc0('0x11')]='Sound';break;case _0xabc0('0x6d'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x6e');break;case _0xabc0('0x6f'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x70');break;case'triggers':_0x55812e['childModel']='Trigger';break;case'trunks':_0x55812e[_0xabc0('0x11')]=_0xabc0('0x71');break;case _0xabc0('0x72'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x73');break;case _0xabc0('0x74'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x75');break;case _0xabc0('0x76'):_0x55812e['childModel']=_0xabc0('0xe');_0x55812e[_0xabc0('0x15')]=[{'name':'Reports','field':'id','foreignKey':_0xabc0('0x77')}];break;case'metrics':_0x55812e['childModel']=_0xabc0('0x78');break;}return _0x55812e;}function _0x2ec5cd(_0x58fa77,_0x27b045){var _0x45a2f0=_0x58fa77['charAt'](0x0)['toUpperCase']()+_0x58fa77['slice'](0x1);var _0x482345={'type':_0x4d1cf0[_0xabc0('0x79')][_0xabc0('0x7a')]['SELECT'],'raw':!![]};return new Promise(function(_0x1252be,_0x335729){var _0x5b848f=squel[_0xabc0('0x7b')]()[_0xabc0('0x3')](_0xabc0('0x7c')+_0x45a2f0+_0xabc0('0x7d'),'id')[_0xabc0('0x3')](_0xabc0('0x7e'))[_0xabc0('0x7f')]('user_has_'+_0x58fa77+'_interactions','ui')[_0xabc0('0x80')](_0xabc0('0x81'),_0x27b045['id']);return _0x4d1cf0[_0xabc0('0x82')][_0xabc0('0x83')](_0x5b848f[_0xabc0('0x84')](),_0x482345)['then'](function(_0x4347a5){_0x27b045[_0x45a2f0+_0xabc0('0x85')]=_0x4347a5;_0x1252be(_0x4347a5);})['catch'](function(_0x14afc6){_0x335729(_0x14afc6);});});}return _0xe5e0f[_0xabc0('0x86')](_0xabc0('0x87'),attributes,{'tableName':_0xabc0('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x45c5a4){var _0xa6863c=require(_0xabc0('0x89'));var _0x583c20={'raw':_0x45c5a4[_0xabc0('0x83')][_0xabc0('0x8a')],'where':{}};var _0x532777={};var _0x4391b0={'count':0x0,'rows':[]};var _0x5de4f3=_0x45c5a4[_0xabc0('0x83')][_0xabc0('0x8b')];var _0x4745ce=_0x45c5a4[_0xabc0('0x83')][_0xabc0('0x8c')]||![];var _0x2ffc2a=_0x38df1d(_0x5de4f3,_0x4745ce);if(!_0x2ffc2a[_0xabc0('0x11')])throw new Error(_0xabc0('0x8d')+_0x5de4f3+'\x27');var _0x111857=[{'name':_0x5de4f3}];if(!_[_0xabc0('0x8e')](_0x2ffc2a['parentSections']))_0x111857=_0x2ffc2a['parentSections'];var _0x4953ad=[];for(var _0xfdb9aa=0x0;_0xfdb9aa<_0x111857[_0xabc0('0x8f')];_0xfdb9aa++){_0x4953ad[_0xabc0('0x90')](_0x4d1cf0[_0xabc0('0x91')][_0xabc0('0x92')]({'where':{'userProfileId':_0x45c5a4[_0xabc0('0x93')]['id'],'name':_0x111857[_0xfdb9aa][_0xabc0('0xb')]},'raw':!![]}));}return Promise[_0xabc0('0x94')](_0x4953ad)[_0xabc0('0x7')](function(_0x2a19e0){var _0x2efbb0=_[_0xabc0('0x4')](_0x2a19e0,function(_0x3843e2){return _0x3843e2?_0x3843e2:undefined;});var _0x36caf2=_[_0xabc0('0x4')](_0x111857,[_0xabc0('0x95'),!![]]);var _0x229cf1=_[_0xabc0('0x8e')](_0x2efbb0)&&_[_0xabc0('0x8e')](_0x36caf2)?null:_[_0xabc0('0x96')](_0x36caf2,_0x2efbb0);if(!_0x229cf1)return null;var _0x261412=[];for(var _0x121228=0x0;_0x121228<_0x229cf1[_0xabc0('0x8f')];_0x121228++){var _0x52be55=_['find'](_0x111857,function(_0x182dec){return _0x229cf1[_0x121228]?_0x182dec[_0xabc0('0xb')]===_0x229cf1[_0x121228][_0xabc0('0xb')]:null;});if(_0x52be55){if(_0x229cf1[_0x121228][_0xabc0('0x95')]){_0x261412['push'](_0x53cd28(_0x2ffc2a['childModel'],_0x229cf1[_0x121228]));}else{if(!_0x229cf1[_0x121228]['autoAssociation']){_0x261412[_0xabc0('0x90')](_0x3d9343(_0x52be55,_0x229cf1[_0x121228],_0x2ffc2a[_0xabc0('0x11')]));}else{if(_0x52be55['model']){_0x261412[_0xabc0('0x90')](_0x3016a8(_0x52be55,_0x229cf1[_0x121228]));}}}}}return Promise[_0xabc0('0x94')](_0x261412);})['then'](function(_0x2ca6d4){var _0x3cc544=_0x2ca6d4;var _0xcf6a4d=null;if(_0x3cc544){_0xcf6a4d=_0x3cc544['length']===0x1?_0x3cc544[0x0]:null;}if(!_0xcf6a4d&&!_0x3cc544)return _0x4391b0;var _0x32d696=_0x4d1cf0[_0x2ffc2a['childModel']][_0xabc0('0x97')];_0x532777[_0xabc0('0xa')]=_['keys'](_0x32d696);_0x532777['query']=_[_0xabc0('0x98')](_0x45c5a4[_0xabc0('0x83')]);_0x532777[_0xabc0('0x99')]=_[_0xabc0('0x9a')](_0x532777['model'],_0x532777[_0xabc0('0x83')]);_0x583c20['attributes']=_['intersection'](_0x532777['model'],_0xa6863c['fields'](_0x45c5a4['query'][_0xabc0('0x9b')]));_0x583c20[_0xabc0('0x9c')]=_0x583c20[_0xabc0('0x9c')][_0xabc0('0x8f')]?_0x583c20[_0xabc0('0x9c')]:_0x532777[_0xabc0('0xa')];if(!_0x45c5a4[_0xabc0('0x83')][_0xabc0('0x9d')](_0xabc0('0x9e'))){_0x583c20['limit']=_0xa6863c['limit'](_0x45c5a4[_0xabc0('0x83')][_0xabc0('0x9f')]);_0x583c20['offset']=_0xa6863c[_0xabc0('0xa0')](_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xa0')]);}_0x583c20[_0xabc0('0xa1')]=_0xa6863c[_0xabc0('0xa2')](_0x45c5a4['query']['sort']);_0x583c20[_0xabc0('0x80')]=_0xa6863c[_0xabc0('0x99')](_[_0xabc0('0xa3')](_0x45c5a4[_0xabc0('0x83')],_0x532777[_0xabc0('0x99')]));if(_0x45c5a4['query'][_0xabc0('0x4')]){_0x583c20['where']=_[_0xabc0('0xa4')](_0x583c20[_0xabc0('0x80')],{'$or':_[_0xabc0('0x9')](_0x32d696,function(_0x242720){if(_0x242720[_0xabc0('0x36')][_0xabc0('0xa5')]!=='VIRTUAL'){var _0x4d70c4={};_0x4d70c4[_0x242720[_0xabc0('0x3')]]={'$like':'%'+_0x45c5a4[_0xabc0('0x83')][_0xabc0('0x4')]+'%'};return _0x4d70c4;}})});}var _0x47c3ef=[];var _0x5735af=null;var _0x9e7665={};if(_0xcf6a4d){_0x5735af=_['find'](_0x111857,[_0xabc0('0xb'),_0xcf6a4d[_0xabc0('0xb')]]);if(_0x5735af[_0xabc0('0x3')]){_0x9e7665={};if(_0x2ffc2a[_0xabc0('0x11')]===_0xabc0('0xe')){_0x9e7665[_0x5735af[_0xabc0('0xa6')]]=_[_0xabc0('0x9')](_0xcf6a4d[_0xabc0('0x8')],'id');}else{_0x9e7665[_0x5735af['foreignKey']]=_0xcf6a4d[_0xabc0('0x8')];}_0x47c3ef[_0xabc0('0x90')](_0x9e7665);}else{_0x583c20['where']['id']=_0xcf6a4d[_0xabc0('0x8')];}}else{for(var _0x66c53d=0x0;_0x66c53d<_0x3cc544[_0xabc0('0x8f')];_0x66c53d++){_0x5735af=_[_0xabc0('0x92')](_0x111857,[_0xabc0('0xb'),_0x3cc544[_0x66c53d]['name']]);if(_0x5735af[_0xabc0('0x3')]){_0x9e7665={};_0x9e7665[_0x5735af[_0xabc0('0xa6')]]=_0x3cc544[_0x66c53d]['associatedResources'];_0x47c3ef['push'](_0x9e7665);}else{if(!_0x583c20['where']['id'])_0x583c20[_0xabc0('0x80')]['id']=[];_0x3cc544[_0x66c53d][_0xabc0('0x8')]['forEach'](function(_0x2c647b){_0x583c20['where']['id']['push'](_0x2c647b);});}}}if(!_[_0xabc0('0x8e')](_0x47c3ef)){_0x583c20[_0xabc0('0x80')]=_['merge'](_0x583c20['where'],{'$and':{'$or':_0x47c3ef}});}_0x583c20=_[_0xabc0('0xa4')]({},_0x583c20,_0x45c5a4[_0xabc0('0xa7')]);if(_0xcf6a4d&&!_0xcf6a4d[_0xabc0('0xa8')]&&_0x2ffc2a['childModel']===_0xabc0('0xe')){if(_0x45c5a4['query'][_0xabc0('0xa9')]){_0x583c20['include']=[{'all':!![]}];}return _0x4d1cf0[_0x2ffc2a['childModel']]['findAll'](_0x583c20)[_0xabc0('0x7')](function(_0xe5b937){var _0x546721=[];_0xe5b937[_0xabc0('0xaa')](function(_0x1160c6){var _0x597cdc;switch(_0x1160c6['reportType']){case _0xabc0('0xab'):_0x597cdc=_['find'](_0xcf6a4d[_0xabc0('0x8')],function(_0x2ac5dd){return _0x2ac5dd['id']===_0x1160c6[_0xabc0('0x77')]&&_0x2ac5dd[_0xabc0('0x36')]===_0xabc0('0xac');});break;case _0xabc0('0xad'):_0x597cdc=_[_0xabc0('0x92')](_0xcf6a4d['associatedResources'],function(_0x37f42b){return _0x37f42b['id']===_0x1160c6['reportId']&&_0x37f42b[_0xabc0('0x36')]===_0xabc0('0xae');});break;}if(_0x597cdc)_0x546721[_0xabc0('0x90')](_0x1160c6);});_0x4391b0['count']=_0x546721[_0xabc0('0x8f')];_0x4391b0[_0xabc0('0xaf')]=_0x546721;return _0x4391b0;});}else{if(!_[_0xabc0('0x8e')](_0x45c5a4['query']['ids'])){_0x583c20[_0xabc0('0x80')]['id']=_0x583c20[_0xabc0('0x80')]['id']?_[_0xabc0('0x9a')](_0x583c20[_0xabc0('0x80')]['id'],_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb0')]):_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb0')];if(_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb1')]){_0x583c20[_0xabc0('0xa1')]=_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb1')];}}if(_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb2')]){_0x583c20[_0xabc0('0x80')]=_['merge'](_0x583c20[_0xabc0('0x80')],{'$and':_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb2')]});}return _0x4d1cf0[_0x2ffc2a['childModel']][_0xabc0('0xb3')]({'where':_0x583c20['where']})[_0xabc0('0x7')](function(_0x3cb430){_0x4391b0[_0xabc0('0xb3')]=_0x3cb430;if(_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xa9')]){if(_0x2ffc2a['childModel']===_0xabc0('0x1a')){_0x583c20['include']=[{'model':_0x4d1cf0['Tag'],'as':'Tags','attributes':['id','name',_0xabc0('0xb4')],'required':_0x45c5a4[_0xabc0('0x83')]['tag']?!![]:![]},{'model':_0x4d1cf0[_0xabc0('0x6e')],'as':'ThroughTags','attributes':['id','name',_0xabc0('0xb4')],'through':_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb5')]?{'attributes':[],'where':{'TagId':_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb5')]||undefined}}:{},'required':_0x45c5a4[_0xabc0('0x83')]['tag']?!![]:![]}];}else{_0x583c20[_0xabc0('0xb6')]=[{'all':!![]}];}}return _0x4d1cf0[_0x2ffc2a[_0xabc0('0x11')]][_0xabc0('0x6')](_0x583c20);})['then'](function(_0x419086){_0x4391b0[_0xabc0('0xaf')]=_0x419086;if(_0x5de4f3===_0xabc0('0x2e')&&_0x45c5a4['query'][_0xabc0('0xb7')]==='true'){var _0x25adad=[];for(var _0x16530a=0x0;_0x16530a<_0x4391b0['rows'][_0xabc0('0x8f')];_0x16530a++){_0x25adad[_0xabc0('0x90')](_0x2ec5cd(_0xabc0('0xb8'),_0x4391b0['rows'][_0x16530a][_0xabc0('0xb9')]));_0x25adad[_0xabc0('0x90')](_0x2ec5cd(_0xabc0('0xba'),_0x4391b0[_0xabc0('0xaf')][_0x16530a][_0xabc0('0xb9')]));_0x25adad['push'](_0x2ec5cd(_0xabc0('0xbb'),_0x4391b0[_0xabc0('0xaf')][_0x16530a][_0xabc0('0xb9')]));_0x25adad[_0xabc0('0x90')](_0x2ec5cd(_0xabc0('0xbc'),_0x4391b0[_0xabc0('0xaf')][_0x16530a][_0xabc0('0xb9')]));_0x25adad[_0xabc0('0x90')](_0x2ec5cd(_0xabc0('0xbd'),_0x4391b0['rows'][_0x16530a][_0xabc0('0xb9')]));_0x25adad['push'](_0x2ec5cd(_0xabc0('0xbe'),_0x4391b0[_0xabc0('0xaf')][_0x16530a][_0xabc0('0xb9')]));}return Promise[_0xabc0('0x94')](_0x25adad)['then'](function(){return _0x4391b0;});}return _0x4391b0;});}});}}});}; \ No newline at end of file +var _0x5613=['push','UserProfileSection','find','all','ignore','isEmpty','union','autoAssociation','rawAttributes','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','offset','sort','pick','key','VIRTUAL','foreignKey','merge','includeAll','include','forEach','reportType','default','reportId','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','order','extraQueryConditions','CmContact','color','tag','ThroughTags','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','exports','models','filter','field','findAll','then','map','value','model','associatedResources','name','catch','UserProfileResource','AnalyticExtractedReport','resourceId','type','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','CmCustomField','chatqueues','chatwebsites','faxqueues','faxaccounts','FaxAccount','inboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','mailqueues','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','Tag','templates','Template','triggers','Trigger','trunks','variables','Variable','plugins','Reports','metrics','AnalyticMetric','toUpperCase','slice','QueryTypes','SELECT','select','InteractionId','ui.createdAt','_interactions','where','ui.UserId\x20=\x20?','sequelize','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','raw','query','section','mergeResources','length'];(function(_0x12cab3,_0x5ea0b2){var _0x58b835=function(_0x489199){while(--_0x489199){_0x12cab3['push'](_0x12cab3['shift']());}};_0x58b835(++_0x5ea0b2);}(_0x5613,0xf2));var _0x3561=function(_0x39bbe7,_0x133823){_0x39bbe7=_0x39bbe7-0x0;var _0x1605ec=_0x5613[_0x39bbe7];return _0x1605ec;};'use strict';var _=require(_0x3561('0x0'));var attributes=require(_0x3561('0x1'));var squel=require('squel');module[_0x3561('0x2')]=function(_0x5e1605){var _0x399162=_0x5e1605[_0x3561('0x3')];function _0x99ffb(_0x3d4078,_0x218031){return new Promise(function(_0x3b4b48,_0x5f062e){if(!_0x218031)return _0x3b4b48(null);var _0x23f228=_0x218031[_0x3561('0x4')]?{[_0x218031[_0x3561('0x4')][_0x3561('0x5')]]:_0x218031[_0x3561('0x4')]['value']}:undefined;return _0x399162[_0x3d4078][_0x3561('0x6')]({'where':_0x23f228,'raw':!![]})[_0x3561('0x7')](function(_0x202724){_0x218031['associatedResources']=_[_0x3561('0x8')](_0x202724,'id');_0x3b4b48(_0x218031);})['catch'](function(_0x3f0a44){_0x5f062e(_0x3f0a44);});});}function _0x128b26(_0x40a519,_0x35dce7){return new Promise(function(_0x4b5324,_0x28847b){var _0x2cf2ea=_0x40a519['filter']?{[_0x40a519[_0x3561('0x4')][_0x3561('0x5')]]:_0x40a519[_0x3561('0x4')][_0x3561('0x9')]}:undefined;return _0x399162[_0x40a519[_0x3561('0xa')]]['findAll']({'where':_0x2cf2ea,'raw':!![]})[_0x3561('0x7')](function(_0x30ff08){_0x35dce7[_0x3561('0xb')]=_[_0x3561('0x8')](_0x30ff08,function(_0x4d6e78){return _0x4d6e78[_0x3561('0xc')];});_0x4b5324(_0x35dce7);})[_0x3561('0xd')](function(_0x4f53ff){_0x28847b(_0x4f53ff);});});}function _0xc96559(_0x7dbc9c,_0x3baf90,_0x528ad8){if(!_0x3baf90)return Promise['resolve'](null);return new Promise(function(_0x571cab,_0x84353b){return _0x399162[_0x3561('0xe')][_0x3561('0x6')]({'where':{'sectionId':_0x3baf90['id']},'raw':!![]})[_0x3561('0x7')](function(_0x4f6735){if(_0x7dbc9c[_0x3561('0x5')]&&_0x7dbc9c['field']!=='id'){_0x3baf90[_0x3561('0xb')]=_[_0x3561('0x8')](_0x4f6735,function(_0x4f5502){return _0x4f5502[_0x7dbc9c[_0x3561('0x5')]];});}else{if(_0x528ad8===_0x3561('0xf')){_0x3baf90[_0x3561('0xb')]=_[_0x3561('0x8')](_0x4f6735,function(_0x28c028){return{'id':_0x28c028[_0x3561('0x10')],'type':_0x28c028[_0x3561('0x11')]};});}else{_0x3baf90['associatedResources']=_[_0x3561('0x8')](_0x4f6735,function(_0x47de66){return _0x47de66['resourceId'];});}}_0x571cab(_0x3baf90);})['catch'](function(_0x4f9d5e){_0x84353b(_0x4f9d5e);});});}function _0x112ac0(_0x5eba2d,_0x4fc52d){var _0x18ad11={'parentSections':[]};switch(_0x5eba2d['toLowerCase']()){case'squareprojects':_0x18ad11[_0x3561('0x12')]=_0x3561('0x13');break;case _0x3561('0x14'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x15');break;case _0x3561('0x16'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x17');_0x18ad11[_0x3561('0x18')]=[{'name':_0x3561('0x19'),'field':_0x3561('0xc'),'foreignKey':_0x3561('0x1a')}];break;case _0x3561('0x1b'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x1c');break;case _0x3561('0x1d'):_0x18ad11['childModel']='CmContact';_0x18ad11[_0x3561('0x18')]=[{'name':_0x3561('0x1e'),'field':'id','foreignKey':_0x3561('0x1f')}];break;case _0x3561('0x20'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x21');break;case _0x3561('0x22'):_0x18ad11[_0x3561('0x12')]='CmCompany';break;case'globalcustomfields':_0x18ad11[_0x3561('0x12')]=_0x3561('0x23');break;case _0x3561('0x24'):_0x18ad11[_0x3561('0x12')]='ChatQueue';break;case _0x3561('0x25'):_0x18ad11['childModel']='ChatWebsite';break;case _0x3561('0x26'):_0x18ad11[_0x3561('0x12')]='FaxQueue';break;case _0x3561('0x27'):_0x18ad11['childModel']=_0x3561('0x28');break;case _0x3561('0x29'):case'internalroutes':case'outboundroutes':_0x18ad11[_0x3561('0x12')]=_0x3561('0x2a');break;case _0x3561('0x2b'):_0x18ad11['childModel']=_0x3561('0x2c');break;case _0x3561('0x2d'):_0x18ad11[_0x3561('0x12')]='VoiceMail';break;case _0x3561('0x2e'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x2f');_0x18ad11['parentSections']=[{'name':_0x3561('0x30'),'field':'name','foreignKey':_0x3561('0x31'),'model':_0x3561('0x32'),'filter':{'field':_0x3561('0x33'),'value':[_0x3561('0x34')]}},{'name':_0x3561('0x35'),'field':_0x3561('0xc'),'foreignKey':_0x3561('0x31'),'model':_0x3561('0x32'),'filter':{'field':_0x3561('0x33'),'value':['telephone']}},{'name':_0x3561('0x36'),'field':_0x3561('0xc'),'foreignKey':'queue','model':_0x3561('0x37'),'filter':{'field':_0x3561('0x11'),'value':[_0x3561('0x38')]}},{'name':_0x3561('0x39'),'field':'name','foreignKey':'queue','model':_0x3561('0x37'),'filter':{'field':_0x3561('0x11'),'value':[_0x3561('0x3a')]}}];break;case _0x3561('0x3b'):_0x18ad11['childModel']=_0x3561('0x3c');break;case _0x3561('0x3d'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x3e');break;case _0x3561('0x3f'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x40');break;case'ivrcampaigns':_0x18ad11['childModel']='Campaign';break;case _0x3561('0x41'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x42');break;case'mailaccounts':_0x18ad11[_0x3561('0x12')]=_0x3561('0x43');break;case _0x3561('0x44'):_0x18ad11[_0x3561('0x12')]='MailSubstatus';break;case _0x3561('0x45'):_0x18ad11['childModel']=_0x3561('0x46');break;case _0x3561('0x47'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x48');break;case _0x3561('0x49'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x4a');break;case _0x3561('0x4b'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x4c');break;case'whatsappqueues':_0x18ad11['childModel']=_0x3561('0x4d');break;case _0x3561('0x4e'):_0x18ad11[_0x3561('0x12')]='WhatsappAccount';break;case _0x3561('0x4f'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x50');break;case _0x3561('0x51'):case _0x3561('0x52'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x37');if(_0x4fc52d){_0x18ad11[_0x3561('0x18')]=[{'name':_0x3561('0x36')},{'name':_0x3561('0x39')}];}break;case _0x3561('0x53'):case _0x3561('0x54'):case _0x3561('0x55'):_0x18ad11['childModel']=_0x3561('0x32');if(_0x4fc52d){_0x18ad11[_0x3561('0x18')]=[{'name':_0x3561('0x56'),'filter':{'field':_0x3561('0x33'),'value':[_0x3561('0x57'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x3561('0x35')}];}break;case _0x3561('0x58'):_0x18ad11[_0x3561('0x12')]='ZendeskAccount';break;case'salesforceaccounts':_0x18ad11[_0x3561('0x12')]=_0x3561('0x59');break;case _0x3561('0x5a'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x5b');break;case _0x3561('0x5c'):_0x18ad11[_0x3561('0x12')]='SugarcrmAccount';break;case _0x3561('0x5d'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x5e');break;case'zohoaccounts':_0x18ad11[_0x3561('0x12')]=_0x3561('0x5f');break;case _0x3561('0x60'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x32');break;case _0x3561('0x61'):_0x18ad11[_0x3561('0x12')]='CannedAnswer';break;case _0x3561('0x62'):_0x18ad11['childModel']=_0x3561('0x63');break;case _0x3561('0x64'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x65');break;case _0x3561('0x66'):_0x18ad11['childModel']=_0x3561('0x67');break;case _0x3561('0x68'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x69');break;case'scheduler':_0x18ad11[_0x3561('0x12')]=_0x3561('0x6a');break;case _0x3561('0x6b'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x6c');break;case'tags':_0x18ad11['childModel']=_0x3561('0x6d');break;case _0x3561('0x6e'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x6f');break;case _0x3561('0x70'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x71');break;case _0x3561('0x72'):_0x18ad11[_0x3561('0x12')]='Trunk';break;case _0x3561('0x73'):_0x18ad11['childModel']=_0x3561('0x74');break;case _0x3561('0x75'):_0x18ad11[_0x3561('0x12')]='Plugin';break;case'extractedreports':_0x18ad11[_0x3561('0x12')]=_0x3561('0xf');_0x18ad11[_0x3561('0x18')]=[{'name':_0x3561('0x76'),'field':'id','foreignKey':'reportId'}];break;case _0x3561('0x77'):_0x18ad11[_0x3561('0x12')]=_0x3561('0x78');break;}return _0x18ad11;}function _0x16672b(_0x114130,_0x2c9a8e){var _0x17a06d=_0x114130['charAt'](0x0)[_0x3561('0x79')]()+_0x114130[_0x3561('0x7a')](0x1);var _0x3aa8ce={'type':_0x399162['Sequelize'][_0x3561('0x7b')][_0x3561('0x7c')],'raw':!![]};return new Promise(function(_0x3a09f3,_0x2de93b){var _0x90980d=squel[_0x3561('0x7d')]()[_0x3561('0x5')]('ui.'+_0x17a06d+_0x3561('0x7e'),'id')[_0x3561('0x5')](_0x3561('0x7f'))['from']('user_has_'+_0x114130+_0x3561('0x80'),'ui')[_0x3561('0x81')](_0x3561('0x82'),_0x2c9a8e['id']);return _0x399162[_0x3561('0x83')]['query'](_0x90980d['toString'](),_0x3aa8ce)['then'](function(_0x3e8ca2){_0x2c9a8e[_0x17a06d+_0x3561('0x84')]=_0x3e8ca2;_0x3a09f3(_0x3e8ca2);})[_0x3561('0xd')](function(_0x1b811a){_0x2de93b(_0x1b811a);});});}return _0x5e1605[_0x3561('0x85')](_0x3561('0x86'),attributes,{'tableName':_0x3561('0x87'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x57d02b){var _0x2e7f0c=require(_0x3561('0x88'));var _0x165a02={'raw':_0x57d02b['query'][_0x3561('0x89')],'where':{}};var _0x308eb8={};var _0x63073b={'count':0x0,'rows':[]};var _0x1d4151=_0x57d02b[_0x3561('0x8a')][_0x3561('0x8b')];var _0x55e720=_0x57d02b[_0x3561('0x8a')][_0x3561('0x8c')]||![];var _0x293b39=_0x112ac0(_0x1d4151,_0x55e720);if(!_0x293b39[_0x3561('0x12')])throw new Error('Invalid\x20section\x20\x27'+_0x1d4151+'\x27');var _0x5ded42=[{'name':_0x1d4151}];if(!_['isEmpty'](_0x293b39[_0x3561('0x18')]))_0x5ded42=_0x293b39[_0x3561('0x18')];var _0x18625e=[];for(var _0x3ad03a=0x0;_0x3ad03a<_0x5ded42[_0x3561('0x8d')];_0x3ad03a++){_0x18625e[_0x3561('0x8e')](_0x399162[_0x3561('0x8f')][_0x3561('0x90')]({'where':{'userProfileId':_0x57d02b['params']['id'],'name':_0x5ded42[_0x3ad03a][_0x3561('0xc')]},'raw':!![]}));}return Promise[_0x3561('0x91')](_0x18625e)[_0x3561('0x7')](function(_0x110e00){var _0x1c729b=_[_0x3561('0x4')](_0x110e00,function(_0x3b6cc3){return _0x3b6cc3?_0x3b6cc3:undefined;});var _0x1ffb8f=_['filter'](_0x5ded42,[_0x3561('0x92'),!![]]);var _0x53799b=_[_0x3561('0x93')](_0x1c729b)&&_[_0x3561('0x93')](_0x1ffb8f)?null:_[_0x3561('0x94')](_0x1ffb8f,_0x1c729b);if(!_0x53799b)return null;var _0x4d4672=[];for(var _0x2edf1f=0x0;_0x2edf1f<_0x53799b['length'];_0x2edf1f++){var _0x2cceec=_[_0x3561('0x90')](_0x5ded42,function(_0x2b2300){return _0x53799b[_0x2edf1f]?_0x2b2300[_0x3561('0xc')]===_0x53799b[_0x2edf1f]['name']:null;});if(_0x2cceec){if(_0x53799b[_0x2edf1f][_0x3561('0x92')]){_0x4d4672[_0x3561('0x8e')](_0x99ffb(_0x293b39[_0x3561('0x12')],_0x53799b[_0x2edf1f]));}else{if(!_0x53799b[_0x2edf1f][_0x3561('0x95')]){_0x4d4672['push'](_0xc96559(_0x2cceec,_0x53799b[_0x2edf1f],_0x293b39[_0x3561('0x12')]));}else{if(_0x2cceec['model']){_0x4d4672[_0x3561('0x8e')](_0x128b26(_0x2cceec,_0x53799b[_0x2edf1f]));}}}}}return Promise['all'](_0x4d4672);})[_0x3561('0x7')](function(_0x48c40d){var _0xaf6daf=_0x48c40d;var _0x55794c=null;if(_0xaf6daf){_0x55794c=_0xaf6daf[_0x3561('0x8d')]===0x1?_0xaf6daf[0x0]:null;}if(!_0x55794c&&!_0xaf6daf)return _0x63073b;var _0x1f4eaf=_0x399162[_0x293b39[_0x3561('0x12')]][_0x3561('0x96')];_0x308eb8[_0x3561('0xa')]=_[_0x3561('0x97')](_0x1f4eaf);_0x308eb8[_0x3561('0x8a')]=_[_0x3561('0x97')](_0x57d02b[_0x3561('0x8a')]);_0x308eb8[_0x3561('0x98')]=_[_0x3561('0x99')](_0x308eb8[_0x3561('0xa')],_0x308eb8['query']);_0x165a02[_0x3561('0x9a')]=_[_0x3561('0x99')](_0x308eb8[_0x3561('0xa')],_0x2e7f0c['fields'](_0x57d02b[_0x3561('0x8a')]['fields']));_0x165a02[_0x3561('0x9a')]=_0x165a02[_0x3561('0x9a')][_0x3561('0x8d')]?_0x165a02[_0x3561('0x9a')]:_0x308eb8[_0x3561('0xa')];if(!_0x57d02b[_0x3561('0x8a')][_0x3561('0x9b')](_0x3561('0x9c'))){_0x165a02[_0x3561('0x9d')]=_0x2e7f0c[_0x3561('0x9d')](_0x57d02b[_0x3561('0x8a')][_0x3561('0x9d')]);_0x165a02[_0x3561('0x9e')]=_0x2e7f0c['offset'](_0x57d02b['query'][_0x3561('0x9e')]);}_0x165a02['order']=_0x2e7f0c[_0x3561('0x9f')](_0x57d02b['query'][_0x3561('0x9f')]);_0x165a02[_0x3561('0x81')]=_0x2e7f0c[_0x3561('0x98')](_[_0x3561('0xa0')](_0x57d02b['query'],_0x308eb8['filters']));if(_0x57d02b[_0x3561('0x8a')][_0x3561('0x4')]){_0x165a02[_0x3561('0x81')]=_['merge'](_0x165a02[_0x3561('0x81')],{'$or':_['map'](_0x1f4eaf,function(_0x35db41){if(_0x35db41[_0x3561('0x11')][_0x3561('0xa1')]!==_0x3561('0xa2')){var _0xf1f10b={};_0xf1f10b[_0x35db41['field']]={'$like':'%'+_0x57d02b['query'][_0x3561('0x4')]+'%'};return _0xf1f10b;}})});}var _0x43d1fa=[];var _0xda678=null;var _0x15d5bb={};if(_0x55794c){_0xda678=_[_0x3561('0x90')](_0x5ded42,[_0x3561('0xc'),_0x55794c[_0x3561('0xc')]]);if(_0xda678['field']){_0x15d5bb={};if(_0x293b39[_0x3561('0x12')]===_0x3561('0xf')){_0x15d5bb[_0xda678[_0x3561('0xa3')]]=_[_0x3561('0x8')](_0x55794c[_0x3561('0xb')],'id');}else{_0x15d5bb[_0xda678[_0x3561('0xa3')]]=_0x55794c[_0x3561('0xb')];}_0x43d1fa[_0x3561('0x8e')](_0x15d5bb);}else{_0x165a02[_0x3561('0x81')]['id']=_0x55794c[_0x3561('0xb')];}}else{for(var _0x517c37=0x0;_0x517c37<_0xaf6daf[_0x3561('0x8d')];_0x517c37++){_0xda678=_['find'](_0x5ded42,[_0x3561('0xc'),_0xaf6daf[_0x517c37][_0x3561('0xc')]]);if(_0xda678['field']){_0x15d5bb={};_0x15d5bb[_0xda678['foreignKey']]=_0xaf6daf[_0x517c37]['associatedResources'];_0x43d1fa[_0x3561('0x8e')](_0x15d5bb);}else{if(!_0x165a02[_0x3561('0x81')]['id'])_0x165a02[_0x3561('0x81')]['id']=[];_0xaf6daf[_0x517c37][_0x3561('0xb')]['forEach'](function(_0x21e08b){_0x165a02[_0x3561('0x81')]['id'][_0x3561('0x8e')](_0x21e08b);});}}}if(!_['isEmpty'](_0x43d1fa)){_0x165a02['where']=_[_0x3561('0xa4')](_0x165a02[_0x3561('0x81')],{'$and':{'$or':_0x43d1fa}});}_0x165a02=_[_0x3561('0xa4')]({},_0x165a02,_0x57d02b['options']);if(_0x55794c&&!_0x55794c[_0x3561('0x95')]&&_0x293b39['childModel']===_0x3561('0xf')){if(_0x57d02b[_0x3561('0x8a')][_0x3561('0xa5')]){_0x165a02[_0x3561('0xa6')]=[{'all':!![]}];}return _0x399162[_0x293b39['childModel']]['findAll'](_0x165a02)[_0x3561('0x7')](function(_0x2ee4f8){var _0x441976=[];_0x2ee4f8[_0x3561('0xa7')](function(_0x4ad894){var _0x291a73;switch(_0x4ad894[_0x3561('0xa8')]){case _0x3561('0xa9'):_0x291a73=_[_0x3561('0x90')](_0x55794c['associatedResources'],function(_0x44a70e){return _0x44a70e['id']===_0x4ad894[_0x3561('0xaa')]&&_0x44a70e[_0x3561('0x11')]===_0x3561('0xab');});break;case _0x3561('0xac'):_0x291a73=_['find'](_0x55794c[_0x3561('0xb')],function(_0x350da7){return _0x350da7['id']===_0x4ad894['reportId']&&_0x350da7['type']===_0x3561('0xad');});break;}if(_0x291a73)_0x441976[_0x3561('0x8e')](_0x4ad894);});_0x63073b[_0x3561('0xae')]=_0x441976['length'];_0x63073b[_0x3561('0xaf')]=_0x441976;return _0x63073b;});}else{if(!_['isEmpty'](_0x57d02b['query']['ids'])){_0x165a02[_0x3561('0x81')]['id']=_0x165a02['where']['id']?_[_0x3561('0x99')](_0x165a02[_0x3561('0x81')]['id'],_0x57d02b['query'][_0x3561('0xb0')]):_0x57d02b[_0x3561('0x8a')][_0x3561('0xb0')];if(_0x57d02b[_0x3561('0x8a')][_0x3561('0xb1')]){_0x165a02[_0x3561('0xb2')]=_0x57d02b[_0x3561('0x8a')][_0x3561('0xb1')];}}if(_0x57d02b['query']['extraQueryConditions']){_0x165a02[_0x3561('0x81')]=_['merge'](_0x165a02['where'],{'$and':_0x57d02b['query'][_0x3561('0xb3')]});}return _0x399162[_0x293b39[_0x3561('0x12')]][_0x3561('0xae')]({'where':_0x165a02[_0x3561('0x81')]})[_0x3561('0x7')](function(_0x530d02){_0x63073b[_0x3561('0xae')]=_0x530d02;if(_0x57d02b[_0x3561('0x8a')][_0x3561('0xa5')]){if(_0x293b39[_0x3561('0x12')]===_0x3561('0xb4')){_0x165a02[_0x3561('0xa6')]=[{'model':_0x399162[_0x3561('0x6d')],'as':'Tags','attributes':['id','name',_0x3561('0xb5')],'required':_0x57d02b[_0x3561('0x8a')][_0x3561('0xb6')]?!![]:![]},{'model':_0x399162[_0x3561('0x6d')],'as':_0x3561('0xb7'),'attributes':['id',_0x3561('0xc'),_0x3561('0xb5')],'through':_0x57d02b[_0x3561('0x8a')][_0x3561('0xb6')]?{'attributes':[],'where':{'TagId':_0x57d02b[_0x3561('0x8a')][_0x3561('0xb6')]||undefined}}:{},'required':_0x57d02b[_0x3561('0x8a')][_0x3561('0xb6')]?!![]:![]}];}else{_0x165a02['include']=[{'all':!![]}];}}return _0x399162[_0x293b39['childModel']][_0x3561('0x6')](_0x165a02);})['then'](function(_0x56fb9c){_0x63073b[_0x3561('0xaf')]=_0x56fb9c;if(_0x1d4151==='Agents'&&_0x57d02b[_0x3561('0x8a')]['openTabs']===_0x3561('0xb8')){var _0x411072=[];for(var _0x3d9072=0x0;_0x3d9072<_0x63073b[_0x3561('0xaf')][_0x3561('0x8d')];_0x3d9072++){_0x411072['push'](_0x16672b(_0x3561('0xb9'),_0x63073b[_0x3561('0xaf')][_0x3d9072][_0x3561('0xba')]));_0x411072[_0x3561('0x8e')](_0x16672b(_0x3561('0xbb'),_0x63073b[_0x3561('0xaf')][_0x3d9072][_0x3561('0xba')]));_0x411072[_0x3561('0x8e')](_0x16672b(_0x3561('0xbc'),_0x63073b[_0x3561('0xaf')][_0x3d9072][_0x3561('0xba')]));_0x411072[_0x3561('0x8e')](_0x16672b(_0x3561('0xbd'),_0x63073b[_0x3561('0xaf')][_0x3d9072]['dataValues']));_0x411072['push'](_0x16672b(_0x3561('0xbe'),_0x63073b[_0x3561('0xaf')][_0x3d9072]['dataValues']));_0x411072[_0x3561('0x8e')](_0x16672b(_0x3561('0xbf'),_0x63073b[_0x3561('0xaf')][_0x3d9072][_0x3561('0xba')]));}return Promise[_0x3561('0x91')](_0x411072)[_0x3561('0x7')](function(){return _0x63073b;});}return _0x63073b;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 81e3252..f80cae4 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 _0xc9c3=['socket.io-emitter','./userProfile.socket','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost'];(function(_0x58dfe4,_0x42f5dd){var _0x2012a8=function(_0x234e52){while(--_0x234e52){_0x58dfe4['push'](_0x58dfe4['shift']());}};_0x2012a8(++_0x42f5dd);}(_0xc9c3,0x96));var _0x3c9c=function(_0x407b6e,_0x3992c5){_0x407b6e=_0x407b6e-0x0;var _0x4d3f84=_0xc9c3[_0x407b6e];return _0x4d3f84;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c9c('0x0'));var BPromise=require('bluebird');var rs=require(_0x3c9c('0x1'));var fs=require('fs');var Redis=require(_0x3c9c('0x2'));var db=require(_0x3c9c('0x3'))['db'];var utils=require(_0x3c9c('0x4'));var logger=require(_0x3c9c('0x5'))(_0x3c9c('0x6'));var config=require(_0x3c9c('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x3c9c('0x8')]=_[_0x3c9c('0x9')](config[_0x3c9c('0x8')],{'host':_0x3c9c('0xa'),'port':0x18eb});var socket=require(_0x3c9c('0xb'))(new Redis(config[_0x3c9c('0x8')]));require(_0x3c9c('0xc'))[_0x3c9c('0xd')](socket);function respondWithRpcPromise(_0x2be851,_0x28a59f,_0x50bdd1){return new BPromise(function(_0x20ed5c,_0xc45f8b){return client['request'](_0x2be851,_0x50bdd1)[_0x3c9c('0xe')](function(_0x4c6969){logger[_0x3c9c('0xf')](_0x3c9c('0x10'),_0x28a59f,_0x3c9c('0x11'));logger[_0x3c9c('0x12')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x28a59f,'request\x20sent',JSON['stringify'](_0x4c6969));if(_0x4c6969[_0x3c9c('0x13')]){if(_0x4c6969['error']['code']===0x1f4){logger['error'](_0x3c9c('0x10'),_0x28a59f,_0x4c6969['error'][_0x3c9c('0x14')]);return _0xc45f8b(_0x4c6969[_0x3c9c('0x13')][_0x3c9c('0x14')]);}logger[_0x3c9c('0x13')]('UserProfile,\x20%s,\x20%s',_0x28a59f,_0x4c6969[_0x3c9c('0x13')]['message']);return _0x20ed5c(_0x4c6969['error']['message']);}else{logger[_0x3c9c('0xf')](_0x3c9c('0x10'),_0x28a59f,_0x3c9c('0x11'));_0x20ed5c(_0x4c6969[_0x3c9c('0x15')][_0x3c9c('0x14')]);}})[_0x3c9c('0x16')](function(_0x319f19){logger['error'](_0x3c9c('0x10'),_0x28a59f,_0x319f19);_0xc45f8b(_0x319f19);});});} \ No newline at end of file +var _0x7d37=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','defaults','redis','./userProfile.socket','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0xac4080,_0x1e5b3f){var _0x1fb88b=function(_0x29105e){while(--_0x29105e){_0xac4080['push'](_0xac4080['shift']());}};_0x1fb88b(++_0x1e5b3f);}(_0x7d37,0x1db));var _0x77d3=function(_0x266726,_0x12aca9){_0x266726=_0x266726-0x0;var _0x4dc10b=_0x7d37[_0x266726];return _0x4dc10b;};'use strict';var _=require(_0x77d3('0x0'));var util=require(_0x77d3('0x1'));var moment=require(_0x77d3('0x2'));var BPromise=require('bluebird');var rs=require(_0x77d3('0x3'));var fs=require('fs');var Redis=require(_0x77d3('0x4'));var db=require(_0x77d3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77d3('0x6'))(_0x77d3('0x7'));var config=require('../../config/environment');var jayson=require(_0x77d3('0x8'));var client=jayson['client'][_0x77d3('0x9')]({'port':0x232a});config['redis']=_[_0x77d3('0xa')](config[_0x77d3('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x77d3('0xb')]));require(_0x77d3('0xc'))['register'](socket);function respondWithRpcPromise(_0x238791,_0x5e8c4d,_0x10f92e){return new BPromise(function(_0x57c75c,_0x1afabc){return client['request'](_0x238791,_0x10f92e)[_0x77d3('0xd')](function(_0x295d24){logger[_0x77d3('0xe')](_0x77d3('0xf'),_0x5e8c4d,_0x77d3('0x10'));logger[_0x77d3('0x11')](_0x77d3('0x12'),_0x5e8c4d,_0x77d3('0x10'),JSON[_0x77d3('0x13')](_0x295d24));if(_0x295d24['error']){if(_0x295d24[_0x77d3('0x14')]['code']===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x5e8c4d,_0x295d24[_0x77d3('0x14')][_0x77d3('0x15')]);return _0x1afabc(_0x295d24[_0x77d3('0x14')][_0x77d3('0x15')]);}logger[_0x77d3('0x14')]('UserProfile,\x20%s,\x20%s',_0x5e8c4d,_0x295d24[_0x77d3('0x14')][_0x77d3('0x15')]);return _0x57c75c(_0x295d24['error']['message']);}else{logger[_0x77d3('0xe')](_0x77d3('0xf'),_0x5e8c4d,_0x77d3('0x10'));_0x57c75c(_0x295d24[_0x77d3('0x16')][_0x77d3('0x15')]);}})[_0x77d3('0x17')](function(_0x12fb05){logger[_0x77d3('0x14')](_0x77d3('0xf'),_0x5e8c4d,_0x12fb05);_0x1afabc(_0x12fb05);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index ead9ae3..5a0e98e 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 _0x34e9=['./userProfile.events','save','remove','length','userProfile:'];(function(_0x360739,_0x2ec1b2){var _0x3e23a1=function(_0x105b37){while(--_0x105b37){_0x360739['push'](_0x360739['shift']());}};_0x3e23a1(++_0x2ec1b2);}(_0x34e9,0x1c7));var _0x934e=function(_0x1e2e85,_0x2a7d81){_0x1e2e85=_0x1e2e85-0x0;var _0x213858=_0x34e9[_0x1e2e85];return _0x213858;};'use strict';var UserProfileEvents=require(_0x934e('0x0'));var events=[_0x934e('0x1'),_0x934e('0x2'),'update'];function createListener(_0x874af9,_0x2abbce){return function(_0x3c46aa){_0x2abbce['emit'](_0x874af9,_0x3c46aa);};}function removeListener(_0x365ab5,_0x2b7235){return function(){UserProfileEvents['removeListener'](_0x365ab5,_0x2b7235);};}exports['register']=function(_0x2ea6ad){for(var _0x5cedd2=0x0,_0x47b981=events[_0x934e('0x3')];_0x5cedd2<_0x47b981;_0x5cedd2++){var _0x3afb0c=events[_0x5cedd2];var _0x2cdb2d=createListener(_0x934e('0x4')+_0x3afb0c,_0x2ea6ad);UserProfileEvents['on'](_0x3afb0c,_0x2cdb2d);}}; \ No newline at end of file +var _0x8a16=['update','emit','removeListener','register','length','userProfile:','./userProfile.events','save','remove'];(function(_0xaa7589,_0x53c6bb){var _0x1a6706=function(_0x4b6c86){while(--_0x4b6c86){_0xaa7589['push'](_0xaa7589['shift']());}};_0x1a6706(++_0x53c6bb);}(_0x8a16,0x1ad));var _0x68a1=function(_0x5eb5a9,_0x185d03){_0x5eb5a9=_0x5eb5a9-0x0;var _0x1e66c2=_0x8a16[_0x5eb5a9];return _0x1e66c2;};'use strict';var UserProfileEvents=require(_0x68a1('0x0'));var events=[_0x68a1('0x1'),_0x68a1('0x2'),_0x68a1('0x3')];function createListener(_0x5d416d,_0x3888a8){return function(_0x5de795){_0x3888a8[_0x68a1('0x4')](_0x5d416d,_0x5de795);};}function removeListener(_0x37fd3c,_0x517083){return function(){UserProfileEvents[_0x68a1('0x5')](_0x37fd3c,_0x517083);};}exports[_0x68a1('0x6')]=function(_0xc4453e){for(var _0x522e5e=0x0,_0x30cc47=events[_0x68a1('0x7')];_0x522e5e<_0x30cc47;_0x522e5e++){var _0x14f2fb=events[_0x522e5e];var _0x4badfa=createListener(_0x68a1('0x8')+_0x14f2fb,_0xc4453e);UserProfileEvents['on'](_0x14f2fb,_0x4badfa);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 77f323f..2f55fc3 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 _0xdc52=['fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','index','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','Router'];(function(_0x5499ce,_0x3908fe){var _0xb9a0c2=function(_0x261d0b){while(--_0x261d0b){_0x5499ce['push'](_0x5499ce['shift']());}};_0xb9a0c2(++_0x3908fe);}(_0xdc52,0x13f));var _0x2dc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc52[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2dc5('0x0'));var util=require(_0x2dc5('0x1'));var path=require('path');var timeout=require(_0x2dc5('0x2'));var express=require('express');var router=express[_0x2dc5('0x3')]();var fs_extra=require(_0x2dc5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2dc5('0x5'));var config=require(_0x2dc5('0x6'));var controller=require(_0x2dc5('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2dc5('0x8')]);router['get']('/describe',auth[_0x2dc5('0x9')](),controller[_0x2dc5('0xa')]);router[_0x2dc5('0xb')](_0x2dc5('0xc'),auth['isAuthenticated'](),controller[_0x2dc5('0xd')]);router[_0x2dc5('0xe')]('/',auth[_0x2dc5('0x9')](),controller[_0x2dc5('0xf')]);router[_0x2dc5('0x10')]('/:id',auth[_0x2dc5('0x9')](),controller[_0x2dc5('0x11')]);router[_0x2dc5('0x12')](_0x2dc5('0xc'),auth[_0x2dc5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xabd8=['./userProfileResource.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xabd8,0x1c0));var _0x8abd=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0xabd8[_0x8ae98b];return _0xc30bd4;};'use strict';var multer=require(_0x8abd('0x0'));var util=require(_0x8abd('0x1'));var path=require(_0x8abd('0x2'));var timeout=require(_0x8abd('0x3'));var express=require(_0x8abd('0x4'));var router=express['Router']();var fs_extra=require(_0x8abd('0x5'));var auth=require(_0x8abd('0x6'));var interaction=require(_0x8abd('0x7'));var config=require('../../config/environment');var controller=require(_0x8abd('0x8'));router[_0x8abd('0x9')]('/',auth[_0x8abd('0xa')](),controller[_0x8abd('0xb')]);router[_0x8abd('0x9')](_0x8abd('0xc'),auth[_0x8abd('0xa')](),controller['describe']);router[_0x8abd('0x9')](_0x8abd('0xd'),auth[_0x8abd('0xa')](),controller[_0x8abd('0xe')]);router[_0x8abd('0xf')]('/',auth['isAuthenticated'](),controller[_0x8abd('0x10')]);router['put'](_0x8abd('0xd'),auth[_0x8abd('0xa')](),controller[_0x8abd('0x11')]);router['delete'](_0x8abd('0xd'),auth[_0x8abd('0xa')](),controller['destroy']);module[_0x8abd('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index b89c31c..d5ae246 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 _0x258f=['INTEGER','STRING','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x258f,0x1aa));var _0xf258=function(_0x3018f0,_0x3c0ef1){_0x3018f0=_0x3018f0-0x0;var _0x2c77b0=_0x258f[_0x3018f0];return _0x2c77b0;};'use strict';var Sequelize=require(_0xf258('0x0'));module[_0xf258('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xf258('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf258('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x64a5=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64a5,0x16c));var _0x564a=function(_0xaff59,_0x34b15f){_0xaff59=_0xaff59-0x0;var _0x512721=_0x64a5[_0xaff59];return _0x512721;};'use strict';var Sequelize=require(_0x564a('0x0'));module[_0x564a('0x1')]={'name':{'type':Sequelize[_0x564a('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x564a('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 4a09802..9e31c15 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 _0x6d38=['findAll','rows','show','keys','filters','intersection','create','catch','body','find','params','describe','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','UserProfileResource','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0x6d38,0x1ef));var _0x86d3=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6d38[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['UserProfileResource'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')](_0x412d0e['body'],{})[_0x86d3('0x20')](respondWithResult(_0xd20863,0xc9))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x14fa58,_0x369b75){if(_0x14fa58[_0x86d3('0x41')]['id']){delete _0x14fa58[_0x86d3('0x41')]['id'];}return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x14fa58[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x369b75,null))[_0x86d3('0x20')](saveUpdates(_0x14fa58['body'],null))[_0x86d3('0x20')](respondWithResult(_0x369b75,null))[_0x86d3('0x40')](handleError(_0x369b75,null));};exports['destroy']=function(_0x43290d,_0x23a6ee){return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x43290d[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x23a6ee,null))['then'](removeEntity(_0x23a6ee,null))['catch'](handleError(_0x23a6ee,null));};exports['describe']=function(_0x5bedc6,_0x159253){return db[_0x86d3('0x26')][_0x86d3('0x44')]()[_0x86d3('0x20')](respondWithResult(_0x159253,null))[_0x86d3('0x40')](handleError(_0x159253,null));}; \ No newline at end of file +var _0x1883=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileResource','includeAll','include','findAll','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x45bbd7,_0x585eb4){var _0x464f29=function(_0x336b9e){while(--_0x336b9e){_0x45bbd7['push'](_0x45bbd7['shift']());}};_0x464f29(++_0x585eb4);}(_0x1883,0xab));var _0x3188=function(_0x2bac8f,_0x3b47bd){_0x2bac8f=_0x2bac8f-0x0;var _0x5e22eb=_0x1883[_0x2bac8f];return _0x5e22eb;};'use strict';var emlformat=require(_0x3188('0x0'));var rimraf=require(_0x3188('0x1'));var zipdir=require(_0x3188('0x2'));var jsonpatch=require(_0x3188('0x3'));var rp=require(_0x3188('0x4'));var moment=require(_0x3188('0x5'));var BPromise=require(_0x3188('0x6'));var Mustache=require(_0x3188('0x7'));var util=require(_0x3188('0x8'));var path=require(_0x3188('0x9'));var sox=require(_0x3188('0xa'));var csv=require(_0x3188('0xb'));var ejs=require(_0x3188('0xc'));var fs=require('fs');var fs_extra=require(_0x3188('0xd'));var _=require(_0x3188('0xe'));var squel=require(_0x3188('0xf'));var crypto=require(_0x3188('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x3188('0x11'));var toCsv=require(_0x3188('0xb'));var querystring=require('querystring');var Papa=require(_0x3188('0x12'));var Redis=require('ioredis');var authService=require(_0x3188('0x13'));var qs=require(_0x3188('0x14'));var as=require(_0x3188('0x15'));var hardwareService=require(_0x3188('0x16'));var logger=require('../../config/logger')(_0x3188('0x17'));var utils=require(_0x3188('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3188('0x19'))['db'];function respondWithStatusCode(_0x45e94e,_0x20fef6){_0x20fef6=_0x20fef6||0xcc;return function(_0x3ae228){if(_0x3ae228){return _0x45e94e[_0x3188('0x1a')](_0x20fef6);}return _0x45e94e[_0x3188('0x1b')](_0x20fef6)['end']();};}function respondWithResult(_0x276d69,_0x5e0044){_0x5e0044=_0x5e0044||0xc8;return function(_0x4a2f36){if(_0x4a2f36){return _0x276d69[_0x3188('0x1b')](_0x5e0044)['json'](_0x4a2f36);}};}function respondWithFilteredResult(_0x54a87f,_0x32c239){return function(_0x1beead){if(_0x1beead){var _0xa2269=typeof _0x32c239[_0x3188('0x1c')]===_0x3188('0x1d')&&typeof _0x32c239[_0x3188('0x1e')]==='undefined';var _0x19cc72=_0x1beead[_0x3188('0x1f')];var _0x3f5b35=_0xa2269?0x0:_0x32c239[_0x3188('0x1c')];var _0x18a71a=_0xa2269?_0x1beead[_0x3188('0x1f')]:_0x32c239[_0x3188('0x1c')]+_0x32c239[_0x3188('0x1e')];var _0x5bcbba;if(_0x18a71a>=_0x19cc72){_0x18a71a=_0x19cc72;_0x5bcbba=0xc8;}else{_0x5bcbba=0xce;}_0x54a87f[_0x3188('0x1b')](_0x5bcbba);return _0x54a87f[_0x3188('0x20')]('Content-Range',_0x3f5b35+'-'+_0x18a71a+'/'+_0x19cc72)['json'](_0x1beead);}return null;};}function patchUpdates(_0x5d8d62){return function(_0x46a318){try{jsonpatch[_0x3188('0x21')](_0x46a318,_0x5d8d62,!![]);}catch(_0xd292b5){return BPromise['reject'](_0xd292b5);}return _0x46a318['save']();};}function saveUpdates(_0x266260,_0x461286){return function(_0x375077){if(_0x375077){return _0x375077[_0x3188('0x22')](_0x266260)[_0x3188('0x23')](function(_0x4bd5ee){return _0x4bd5ee;});}return null;};}function removeEntity(_0x30cf2c,_0x33f882){return function(_0x5a2e67){if(_0x5a2e67){return _0x5a2e67[_0x3188('0x24')]()['then'](function(){_0x30cf2c['status'](0xcc)[_0x3188('0x25')]();});}};}function handleEntityNotFound(_0x129bd7,_0x87d5a3){return function(_0x1aeaba){if(!_0x1aeaba){_0x129bd7[_0x3188('0x1a')](0x194);}return _0x1aeaba;};}function handleError(_0x2cd060,_0xe57f73){_0xe57f73=_0xe57f73||0x1f4;return function(_0x11021c){logger['error'](_0x11021c[_0x3188('0x26')]);if(_0x11021c[_0x3188('0x27')]){delete _0x11021c['name'];}_0x2cd060[_0x3188('0x1b')](_0xe57f73)[_0x3188('0x28')](_0x11021c);};}exports[_0x3188('0x29')]=function(_0x44db9a,_0x20e6aa){var _0x1f1c6f={},_0x8f810f={},_0x472926={'count':0x0,'rows':[]};var _0x57c21c=_[_0x3188('0x2a')](db['UserProfileResource'][_0x3188('0x2b')],function(_0x5623f1){return{'name':_0x5623f1[_0x3188('0x2c')],'type':_0x5623f1[_0x3188('0x2d')][_0x3188('0x2e')]};});_0x8f810f[_0x3188('0x2f')]=_[_0x3188('0x2a')](_0x57c21c,_0x3188('0x27'));_0x8f810f[_0x3188('0x30')]=_[_0x3188('0x31')](_0x44db9a[_0x3188('0x30')]);_0x8f810f[_0x3188('0x32')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],_0x8f810f[_0x3188('0x30')]);_0x1f1c6f[_0x3188('0x34')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],qs[_0x3188('0x35')](_0x44db9a[_0x3188('0x30')]['fields']));_0x1f1c6f[_0x3188('0x34')]=_0x1f1c6f['attributes'][_0x3188('0x36')]?_0x1f1c6f[_0x3188('0x34')]:_0x8f810f['model'];if(!_0x44db9a[_0x3188('0x30')][_0x3188('0x37')](_0x3188('0x38'))){_0x1f1c6f[_0x3188('0x1e')]=qs[_0x3188('0x1e')](_0x44db9a[_0x3188('0x30')][_0x3188('0x1e')]);_0x1f1c6f['offset']=qs['offset'](_0x44db9a[_0x3188('0x30')][_0x3188('0x1c')]);}_0x1f1c6f[_0x3188('0x39')]=qs[_0x3188('0x3a')](_0x44db9a['query'][_0x3188('0x3a')]);_0x1f1c6f[_0x3188('0x3b')]=qs[_0x3188('0x32')](_[_0x3188('0x3c')](_0x44db9a['query'],_0x8f810f[_0x3188('0x32')]),_0x57c21c);if(_0x44db9a['query'][_0x3188('0x3d')]){_0x1f1c6f['where']=_[_0x3188('0x3e')](_0x1f1c6f[_0x3188('0x3b')],{'$or':_[_0x3188('0x2a')](_0x57c21c,function(_0x2990c4){if(_0x2990c4[_0x3188('0x2d')]!==_0x3188('0x3f')){var _0x4666b2={};_0x4666b2[_0x2990c4[_0x3188('0x27')]]={'$like':'%'+_0x44db9a[_0x3188('0x30')][_0x3188('0x3d')]+'%'};return _0x4666b2;}})});}_0x1f1c6f=_['merge']({},_0x1f1c6f,_0x44db9a[_0x3188('0x40')]);var _0x2bad0f={'where':_0x1f1c6f[_0x3188('0x3b')]};return db[_0x3188('0x41')][_0x3188('0x1f')](_0x2bad0f)[_0x3188('0x23')](function(_0x5a815d){_0x472926[_0x3188('0x1f')]=_0x5a815d;if(_0x44db9a['query'][_0x3188('0x42')]){_0x1f1c6f[_0x3188('0x43')]=[{'all':!![]}];}return db[_0x3188('0x41')][_0x3188('0x44')](_0x1f1c6f);})[_0x3188('0x23')](function(_0x549ab2){_0x472926['rows']=_0x549ab2;return _0x472926;})['then'](respondWithFilteredResult(_0x20e6aa,_0x1f1c6f))['catch'](handleError(_0x20e6aa,null));};exports['show']=function(_0x763943,_0x28c224){var _0x3e5f90={'raw':![],'where':{'id':_0x763943[_0x3188('0x45')]['id']}},_0x1b40b1={};_0x1b40b1['model']=_[_0x3188('0x31')](db['UserProfileResource'][_0x3188('0x2b')]);_0x1b40b1[_0x3188('0x30')]=_[_0x3188('0x31')](_0x763943[_0x3188('0x30')]);_0x1b40b1['filters']=_[_0x3188('0x33')](_0x1b40b1[_0x3188('0x2f')],_0x1b40b1[_0x3188('0x30')]);_0x3e5f90[_0x3188('0x34')]=_[_0x3188('0x33')](_0x1b40b1['model'],qs['fields'](_0x763943[_0x3188('0x30')][_0x3188('0x35')]));_0x3e5f90['attributes']=_0x3e5f90[_0x3188('0x34')][_0x3188('0x36')]?_0x3e5f90['attributes']:_0x1b40b1[_0x3188('0x2f')];if(_0x763943[_0x3188('0x30')][_0x3188('0x42')]){_0x3e5f90[_0x3188('0x43')]=[{'all':!![]}];}_0x3e5f90=_[_0x3188('0x3e')]({},_0x3e5f90,_0x763943['options']);return db[_0x3188('0x41')]['find'](_0x3e5f90)[_0x3188('0x23')](handleEntityNotFound(_0x28c224,null))[_0x3188('0x23')](respondWithResult(_0x28c224,null))[_0x3188('0x46')](handleError(_0x28c224,null));};exports[_0x3188('0x47')]=function(_0xe4cbb0,_0x315524){return db[_0x3188('0x41')][_0x3188('0x47')](_0xe4cbb0[_0x3188('0x48')],{})[_0x3188('0x23')](respondWithResult(_0x315524,0xc9))[_0x3188('0x46')](handleError(_0x315524,null));};exports['update']=function(_0x50fd56,_0x1b012d){if(_0x50fd56['body']['id']){delete _0x50fd56[_0x3188('0x48')]['id'];}return db[_0x3188('0x41')]['find']({'where':{'id':_0x50fd56[_0x3188('0x45')]['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x1b012d,null))[_0x3188('0x23')](saveUpdates(_0x50fd56[_0x3188('0x48')],null))[_0x3188('0x23')](respondWithResult(_0x1b012d,null))[_0x3188('0x46')](handleError(_0x1b012d,null));};exports[_0x3188('0x24')]=function(_0x1e3592,_0x59a177){return db[_0x3188('0x41')][_0x3188('0x49')]({'where':{'id':_0x1e3592['params']['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x59a177,null))['then'](removeEntity(_0x59a177,null))[_0x3188('0x46')](handleError(_0x59a177,null));};exports[_0x3188('0x4a')]=function(_0x4f8852,_0x559264){return db['UserProfileResource']['describe']()['then'](respondWithResult(_0x559264,null))['catch'](handleError(_0x559264,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index f51e1dd..fc0b054 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 _0x5bef=['../../config/logger','api','bluebird','request-promise','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util'];(function(_0x278883,_0x18bfdb){var _0x271154=function(_0x28cbe){while(--_0x28cbe){_0x278883['push'](_0x278883['shift']());}};_0x271154(++_0x18bfdb);}(_0x5bef,0xa6));var _0xf5be=function(_0x3b9983,_0x3207d7){_0x3b9983=_0x3b9983-0x0;var _0x127661=_0x5bef[_0x3b9983];return _0x127661;};'use strict';var _=require(_0xf5be('0x0'));var util=require(_0xf5be('0x1'));var logger=require(_0xf5be('0x2'))(_0xf5be('0x3'));var moment=require('moment');var BPromise=require(_0xf5be('0x4'));var rp=require(_0xf5be('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5be('0x6'));var config=require('../../config/environment');var attributes=require(_0xf5be('0x7'));module[_0xf5be('0x8')]=function(_0x3a0dd3,_0x2478d7){return _0x3a0dd3[_0xf5be('0x9')](_0xf5be('0xa'),attributes,{'tableName':_0xf5be('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xf5be('0xc'),_0xf5be('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b91=['sectionId','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId'];(function(_0x135d5c,_0x4ce30b){var _0x56efaf=function(_0x43d225){while(--_0x43d225){_0x135d5c['push'](_0x135d5c['shift']());}};_0x56efaf(++_0x4ce30b);}(_0x5b91,0x1a5));var _0x15b9=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x5b91[_0x26d6d9];return _0x1b4875;};'use strict';var _=require('lodash');var util=require(_0x15b9('0x0'));var logger=require(_0x15b9('0x1'))('api');var moment=require(_0x15b9('0x2'));var BPromise=require(_0x15b9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15b9('0x4'));var rimraf=require(_0x15b9('0x5'));var config=require(_0x15b9('0x6'));var attributes=require('./userProfileResource.attributes');module[_0x15b9('0x7')]=function(_0x5a694b,_0x1ee164){return _0x5a694b[_0x15b9('0x8')](_0x15b9('0x9'),attributes,{'tableName':_0x15b9('0xa'),'paranoid':![],'indexes':[{'name':_0x15b9('0xb'),'fields':[_0x15b9('0xc'),_0x15b9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 938d993..b38ffcd 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 _0xc1f2=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x1e01e9,_0x27e242){var _0x3b9ccc=function(_0x2fb6db){while(--_0x2fb6db){_0x1e01e9['push'](_0x1e01e9['shift']());}};_0x3b9ccc(++_0x27e242);}(_0xc1f2,0x151));var _0x2c1f=function(_0x146c70,_0x35ead0){_0x146c70=_0x146c70-0x0;var _0xf38687=_0xc1f2[_0x146c70];return _0xf38687;};'use strict';var _=require(_0x2c1f('0x0'));var util=require(_0x2c1f('0x1'));var moment=require(_0x2c1f('0x2'));var BPromise=require(_0x2c1f('0x3'));var rs=require(_0x2c1f('0x4'));var fs=require('fs');var Redis=require(_0x2c1f('0x5'));var db=require(_0x2c1f('0x6'))['db'];var utils=require(_0x2c1f('0x7'));var logger=require(_0x2c1f('0x8'))('rpc');var config=require(_0x2c1f('0x9'));var jayson=require(_0x2c1f('0xa'));var client=jayson['client'][_0x2c1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e6c1d,_0x28d933,_0x13a419){return new BPromise(function(_0x4d669d,_0x18eb9d){return client[_0x2c1f('0xc')](_0x5e6c1d,_0x13a419)[_0x2c1f('0xd')](function(_0x2b608e){logger[_0x2c1f('0xe')](_0x2c1f('0xf'),_0x28d933,_0x2c1f('0x10'));logger[_0x2c1f('0x11')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x28d933,'request\x20sent',JSON['stringify'](_0x2b608e));if(_0x2b608e[_0x2c1f('0x12')]){if(_0x2b608e[_0x2c1f('0x12')][_0x2c1f('0x13')]===0x1f4){logger[_0x2c1f('0x12')](_0x2c1f('0xf'),_0x28d933,_0x2b608e[_0x2c1f('0x12')][_0x2c1f('0x14')]);return _0x18eb9d(_0x2b608e[_0x2c1f('0x12')]['message']);}logger[_0x2c1f('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x28d933,_0x2b608e[_0x2c1f('0x12')][_0x2c1f('0x14')]);return _0x4d669d(_0x2b608e[_0x2c1f('0x12')]['message']);}else{logger[_0x2c1f('0xe')](_0x2c1f('0xf'),_0x28d933,'request\x20sent');_0x4d669d(_0x2b608e['result'][_0x2c1f('0x14')]);}})['catch'](function(_0x104ed4){logger[_0x2c1f('0x12')](_0x2c1f('0xf'),_0x28d933,_0x104ed4);_0x18eb9d(_0x104ed4);});});} \ No newline at end of file +var _0x6046=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x4a804b,_0x2b316c){var _0x5d77c7=function(_0xe04f93){while(--_0xe04f93){_0x4a804b['push'](_0x4a804b['shift']());}};_0x5d77c7(++_0x2b316c);}(_0x6046,0x1b0));var _0x6604=function(_0x2eec59,_0x5d2b7d){_0x2eec59=_0x2eec59-0x0;var _0x3687e2=_0x6046[_0x2eec59];return _0x3687e2;};'use strict';var _=require(_0x6604('0x0'));var util=require(_0x6604('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6604('0x2'));var fs=require('fs');var Redis=require(_0x6604('0x3'));var db=require(_0x6604('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6604('0x5'));var jayson=require(_0x6604('0x6'));var client=jayson['client'][_0x6604('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c7a3b,_0xf23e03,_0x38ba58){return new BPromise(function(_0x2466b6,_0x36bc65){return client[_0x6604('0x8')](_0x1c7a3b,_0x38ba58)[_0x6604('0x9')](function(_0x1ddc9c){logger[_0x6604('0xa')](_0x6604('0xb'),_0xf23e03,_0x6604('0xc'));logger['debug'](_0x6604('0xd'),_0xf23e03,'request\x20sent',JSON['stringify'](_0x1ddc9c));if(_0x1ddc9c[_0x6604('0xe')]){if(_0x1ddc9c['error'][_0x6604('0xf')]===0x1f4){logger[_0x6604('0xe')](_0x6604('0xb'),_0xf23e03,_0x1ddc9c[_0x6604('0xe')][_0x6604('0x10')]);return _0x36bc65(_0x1ddc9c[_0x6604('0xe')]['message']);}logger[_0x6604('0xe')]('UserProfileResource,\x20%s,\x20%s',_0xf23e03,_0x1ddc9c[_0x6604('0xe')]['message']);return _0x2466b6(_0x1ddc9c[_0x6604('0xe')][_0x6604('0x10')]);}else{logger['info'](_0x6604('0xb'),_0xf23e03,'request\x20sent');_0x2466b6(_0x1ddc9c[_0x6604('0x11')][_0x6604('0x10')]);}})['catch'](function(_0x2ca285){logger[_0x6604('0xe')]('UserProfileResource,\x20%s,\x20%s',_0xf23e03,_0x2ca285);_0x36bc65(_0x2ca285);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 1570af9..2df22f2 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 _0x2205=['post','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','show'];(function(_0x3e1599,_0x128519){var _0x3a079b=function(_0x123f85){while(--_0x123f85){_0x3e1599['push'](_0x3e1599['shift']());}};_0x3a079b(++_0x128519);}(_0x2205,0x193));var _0x5220=function(_0x5e4cae,_0x232c74){_0x5e4cae=_0x5e4cae-0x0;var _0x364835=_0x2205[_0x5e4cae];return _0x364835;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5220('0x0'));var timeout=require(_0x5220('0x1'));var express=require(_0x5220('0x2'));var router=express[_0x5220('0x3')]();var fs_extra=require(_0x5220('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5220('0x5'));var config=require(_0x5220('0x6'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x5220('0x7')](),controller[_0x5220('0x8')]);router['get']('/describe',auth[_0x5220('0x7')](),controller[_0x5220('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5220('0xa')]);router[_0x5220('0xb')]('/',auth[_0x5220('0x7')](),controller['create']);router[_0x5220('0xc')](_0x5220('0xd'),auth[_0x5220('0x7')](),controller[_0x5220('0xe')]);router[_0x5220('0xf')](_0x5220('0xd'),auth['isAuthenticated'](),controller[_0x5220('0x10')]);module[_0x5220('0x11')]=router; \ No newline at end of file +var _0x721d=['isAuthenticated','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x721d,0x197));var _0xd721=function(_0x3a05cc,_0x2ea1f1){_0x3a05cc=_0x3a05cc-0x0;var _0x3d63a1=_0x721d[_0x3a05cc];return _0x3d63a1;};'use strict';var multer=require(_0xd721('0x0'));var util=require(_0xd721('0x1'));var path=require(_0xd721('0x2'));var timeout=require(_0xd721('0x3'));var express=require(_0xd721('0x4'));var router=express[_0xd721('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd721('0x6'));var interaction=require(_0xd721('0x7'));var config=require(_0xd721('0x8'));var controller=require(_0xd721('0x9'));router[_0xd721('0xa')]('/',auth[_0xd721('0xb')](),controller['index']);router[_0xd721('0xa')]('/describe',auth[_0xd721('0xb')](),controller['describe']);router[_0xd721('0xa')](_0xd721('0xc'),auth['isAuthenticated'](),controller[_0xd721('0xd')]);router[_0xd721('0xe')]('/',auth['isAuthenticated'](),controller[_0xd721('0xf')]);router['put']('/:id',auth[_0xd721('0xb')](),controller[_0xd721('0x10')]);router[_0xd721('0x11')](_0xd721('0xc'),auth['isAuthenticated'](),controller[_0xd721('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 5ce9ac0..8c8f843 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 _0x351d=['sequelize','STRING','INTEGER','BOOLEAN','setDataValue','join','getDataValue','crudPermissions','split'];(function(_0x153a54,_0x30a7cd){var _0x564261=function(_0x1b2ec1){while(--_0x1b2ec1){_0x153a54['push'](_0x153a54['shift']());}};_0x564261(++_0x30a7cd);}(_0x351d,0x90));var _0xd351=function(_0x59562b,_0x417d03){_0x59562b=_0x59562b-0x0;var _0x29427b=_0x351d[_0x59562b];return _0x29427b;};'use strict';var Sequelize=require(_0xd351('0x0'));module['exports']={'name':{'type':Sequelize[_0xd351('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xd351('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd351('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xd351('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x41d16d){this[_0xd351('0x4')]('crudPermissions',_0x41d16d?_0x41d16d[_0xd351('0x5')](''):[]);},'get':function(){return this[_0xd351('0x6')](_0xd351('0x7'))?this['getDataValue'](_0xd351('0x7'))[_0xd351('0x8')](''):[];}}}; \ No newline at end of file +var _0xb574=['BOOLEAN','setDataValue','crudPermissions','sequelize','exports','STRING','INTEGER'];(function(_0x2e489c,_0x36fcbd){var _0x518ce2=function(_0x2af6a0){while(--_0x2af6a0){_0x2e489c['push'](_0x2e489c['shift']());}};_0x518ce2(++_0x36fcbd);}(_0xb574,0x106));var _0x4b57=function(_0x135d35,_0x32fff3){_0x135d35=_0x135d35-0x0;var _0x49707d=_0xb574[_0x135d35];return _0x49707d;};'use strict';var Sequelize=require(_0x4b57('0x0'));module[_0x4b57('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4b57('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4b57('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4b57('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4b57('0x2')],'set':function(_0x168524){this[_0x4b57('0x5')](_0x4b57('0x6'),_0x168524?_0x168524['join'](''):[]);},'get':function(){return this['getDataValue'](_0x4b57('0x6'))?this['getDataValue']('crudPermissions')['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index ef271dc..6177d2b 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 _0x2c6a=['ejs','fs-extra','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','apply','reject','save','update','then','destroy','error','name','send','UserProfileSection','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv'];(function(_0x3485f8,_0x1b66cf){var _0x1fbba7=function(_0x135b73){while(--_0x135b73){_0x3485f8['push'](_0x3485f8['shift']());}};_0x1fbba7(++_0x1b66cf);}(_0x2c6a,0x19d));var _0xa2c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c6a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2c6('0x0'));var rp=require(_0xa2c6('0x1'));var moment=require(_0xa2c6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa2c6('0x3'));var util=require('util');var path=require(_0xa2c6('0x4'));var sox=require(_0xa2c6('0x5'));var csv=require(_0xa2c6('0x6'));var ejs=require(_0xa2c6('0x7'));var fs=require('fs');var fs_extra=require(_0xa2c6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2c6('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xa2c6('0xa'));var toCsv=require(_0xa2c6('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa2c6('0xb'));var authService=require(_0xa2c6('0xc'));var qs=require(_0xa2c6('0xd'));var as=require(_0xa2c6('0xe'));var hardwareService=require(_0xa2c6('0xf'));var logger=require(_0xa2c6('0x10'))(_0xa2c6('0x11'));var utils=require(_0xa2c6('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa2c6('0x13'));var db=require(_0xa2c6('0x14'))['db'];function respondWithStatusCode(_0x15b22b,_0x53bcdf){_0x53bcdf=_0x53bcdf||0xcc;return function(_0x568650){if(_0x568650){return _0x15b22b[_0xa2c6('0x15')](_0x53bcdf);}return _0x15b22b[_0xa2c6('0x16')](_0x53bcdf)[_0xa2c6('0x17')]();};}function respondWithResult(_0x537669,_0x2bcbbc){_0x2bcbbc=_0x2bcbbc||0xc8;return function(_0x6f0194){if(_0x6f0194){return _0x537669[_0xa2c6('0x16')](_0x2bcbbc)['json'](_0x6f0194);}};}function respondWithFilteredResult(_0x2a57ba,_0x980819){return function(_0x250247){if(_0x250247){var _0x21977d=typeof _0x980819[_0xa2c6('0x18')]==='undefined'&&typeof _0x980819[_0xa2c6('0x19')]===_0xa2c6('0x1a');var _0x4bf326=_0x250247[_0xa2c6('0x1b')];var _0x38aa52=_0x21977d?0x0:_0x980819['offset'];var _0x36a31f=_0x21977d?_0x250247[_0xa2c6('0x1b')]:_0x980819['offset']+_0x980819['limit'];var _0x5d24f0;if(_0x36a31f>=_0x4bf326){_0x36a31f=_0x4bf326;_0x5d24f0=0xc8;}else{_0x5d24f0=0xce;}_0x2a57ba['status'](_0x5d24f0);return _0x2a57ba['set']('Content-Range',_0x38aa52+'-'+_0x36a31f+'/'+_0x4bf326)['json'](_0x250247);}return null;};}function patchUpdates(_0x4f40a4){return function(_0x422e3e){try{jsonpatch[_0xa2c6('0x1c')](_0x422e3e,_0x4f40a4,!![]);}catch(_0x4e8572){return BPromise[_0xa2c6('0x1d')](_0x4e8572);}return _0x422e3e[_0xa2c6('0x1e')]();};}function saveUpdates(_0x840a9d,_0x32115d){return function(_0x2eb185){if(_0x2eb185){return _0x2eb185[_0xa2c6('0x1f')](_0x840a9d)[_0xa2c6('0x20')](function(_0x14f511){return _0x14f511;});}return null;};}function removeEntity(_0x30a90e,_0x3dc44b){return function(_0x6b8281){if(_0x6b8281){return _0x6b8281[_0xa2c6('0x21')]()[_0xa2c6('0x20')](function(){_0x30a90e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fe2c4,_0x3eb4c7){return function(_0x4ea0b7){if(!_0x4ea0b7){_0x4fe2c4[_0xa2c6('0x15')](0x194);}return _0x4ea0b7;};}function handleError(_0x51cc74,_0x2c89cd){_0x2c89cd=_0x2c89cd||0x1f4;return function(_0x92ddde){logger[_0xa2c6('0x22')](_0x92ddde['stack']);if(_0x92ddde[_0xa2c6('0x23')]){delete _0x92ddde[_0xa2c6('0x23')];}_0x51cc74[_0xa2c6('0x16')](_0x2c89cd)[_0xa2c6('0x24')](_0x92ddde);};}exports['index']=function(_0x358e83,_0x5a59fe){var _0x38ca2a={},_0x5388f7={},_0x216c27={'count':0x0,'rows':[]};var _0x5b3301=_['map'](db[_0xa2c6('0x25')][_0xa2c6('0x26')],function(_0xb2e2c8){return{'name':_0xb2e2c8[_0xa2c6('0x27')],'type':_0xb2e2c8['type'][_0xa2c6('0x28')]};});_0x5388f7[_0xa2c6('0x29')]=_[_0xa2c6('0x2a')](_0x5b3301,_0xa2c6('0x23'));_0x5388f7[_0xa2c6('0x2b')]=_[_0xa2c6('0x2c')](_0x358e83['query']);_0x5388f7['filters']=_[_0xa2c6('0x2d')](_0x5388f7[_0xa2c6('0x29')],_0x5388f7[_0xa2c6('0x2b')]);_0x38ca2a['attributes']=_['intersection'](_0x5388f7[_0xa2c6('0x29')],qs[_0xa2c6('0x2e')](_0x358e83[_0xa2c6('0x2b')][_0xa2c6('0x2e')]));_0x38ca2a[_0xa2c6('0x2f')]=_0x38ca2a['attributes'][_0xa2c6('0x30')]?_0x38ca2a[_0xa2c6('0x2f')]:_0x5388f7[_0xa2c6('0x29')];if(!_0x358e83['query'][_0xa2c6('0x31')]('nolimit')){_0x38ca2a[_0xa2c6('0x19')]=qs['limit'](_0x358e83['query'][_0xa2c6('0x19')]);_0x38ca2a['offset']=qs[_0xa2c6('0x18')](_0x358e83[_0xa2c6('0x2b')][_0xa2c6('0x18')]);}_0x38ca2a[_0xa2c6('0x32')]=qs[_0xa2c6('0x33')](_0x358e83[_0xa2c6('0x2b')][_0xa2c6('0x33')]);_0x38ca2a[_0xa2c6('0x34')]=qs[_0xa2c6('0x35')](_[_0xa2c6('0x36')](_0x358e83[_0xa2c6('0x2b')],_0x5388f7[_0xa2c6('0x35')]),_0x5b3301);if(_0x358e83[_0xa2c6('0x2b')][_0xa2c6('0x37')]){_0x38ca2a['where']=_['merge'](_0x38ca2a[_0xa2c6('0x34')],{'$or':_[_0xa2c6('0x2a')](_0x5b3301,function(_0x3d4e8c){if(_0x3d4e8c[_0xa2c6('0x38')]!==_0xa2c6('0x39')){var _0x302b7f={};_0x302b7f[_0x3d4e8c[_0xa2c6('0x23')]]={'$like':'%'+_0x358e83[_0xa2c6('0x2b')][_0xa2c6('0x37')]+'%'};return _0x302b7f;}})});}_0x38ca2a=_[_0xa2c6('0x3a')]({},_0x38ca2a,_0x358e83['options']);var _0x158688={'where':_0x38ca2a[_0xa2c6('0x34')]};return db['UserProfileSection'][_0xa2c6('0x1b')](_0x158688)['then'](function(_0x2d9c7a){_0x216c27[_0xa2c6('0x1b')]=_0x2d9c7a;if(_0x358e83[_0xa2c6('0x2b')][_0xa2c6('0x3b')]){_0x38ca2a[_0xa2c6('0x3c')]=[{'all':!![]}];}return db[_0xa2c6('0x25')][_0xa2c6('0x3d')](_0x38ca2a);})['then'](function(_0x536b54){_0x216c27[_0xa2c6('0x3e')]=_0x536b54;return _0x216c27;})['then'](respondWithFilteredResult(_0x5a59fe,_0x38ca2a))[_0xa2c6('0x3f')](handleError(_0x5a59fe,null));};exports[_0xa2c6('0x40')]=function(_0x4427a9,_0x2d53ad){var _0x85ba54={'raw':![],'where':{'id':_0x4427a9[_0xa2c6('0x41')]['id']}},_0x2f88ac={};_0x2f88ac[_0xa2c6('0x29')]=_['keys'](db[_0xa2c6('0x25')][_0xa2c6('0x26')]);_0x2f88ac[_0xa2c6('0x2b')]=_['keys'](_0x4427a9[_0xa2c6('0x2b')]);_0x2f88ac[_0xa2c6('0x35')]=_['intersection'](_0x2f88ac[_0xa2c6('0x29')],_0x2f88ac[_0xa2c6('0x2b')]);_0x85ba54[_0xa2c6('0x2f')]=_[_0xa2c6('0x2d')](_0x2f88ac[_0xa2c6('0x29')],qs[_0xa2c6('0x2e')](_0x4427a9[_0xa2c6('0x2b')][_0xa2c6('0x2e')]));_0x85ba54[_0xa2c6('0x2f')]=_0x85ba54[_0xa2c6('0x2f')][_0xa2c6('0x30')]?_0x85ba54[_0xa2c6('0x2f')]:_0x2f88ac[_0xa2c6('0x29')];if(_0x4427a9[_0xa2c6('0x2b')][_0xa2c6('0x3b')]){_0x85ba54[_0xa2c6('0x3c')]=[{'all':!![]}];}_0x85ba54=_[_0xa2c6('0x3a')]({},_0x85ba54,_0x4427a9['options']);return db['UserProfileSection']['find'](_0x85ba54)[_0xa2c6('0x20')](handleEntityNotFound(_0x2d53ad,null))['then'](respondWithResult(_0x2d53ad,null))[_0xa2c6('0x3f')](handleError(_0x2d53ad,null));};exports[_0xa2c6('0x42')]=function(_0x42dcbe,_0x4280e3){return db[_0xa2c6('0x25')][_0xa2c6('0x42')](_0x42dcbe[_0xa2c6('0x43')],{})[_0xa2c6('0x20')](respondWithResult(_0x4280e3,0xc9))[_0xa2c6('0x3f')](handleError(_0x4280e3,null));};exports['update']=function(_0x283dd9,_0xcb8377){if(_0x283dd9[_0xa2c6('0x43')]['id']){delete _0x283dd9[_0xa2c6('0x43')]['id'];}return db[_0xa2c6('0x25')][_0xa2c6('0x44')]({'where':{'id':_0x283dd9[_0xa2c6('0x41')]['id']}})[_0xa2c6('0x20')](handleEntityNotFound(_0xcb8377,null))['then'](saveUpdates(_0x283dd9[_0xa2c6('0x43')],null))[_0xa2c6('0x20')](respondWithResult(_0xcb8377,null))[_0xa2c6('0x3f')](handleError(_0xcb8377,null));};exports[_0xa2c6('0x21')]=function(_0x208bef,_0x1a39c7){return db[_0xa2c6('0x25')][_0xa2c6('0x44')]({'where':{'id':_0x208bef[_0xa2c6('0x41')]['id']}})[_0xa2c6('0x20')](handleEntityNotFound(_0x1a39c7,null))[_0xa2c6('0x20')](removeEntity(_0x1a39c7,null))['catch'](handleError(_0x1a39c7,null));};exports[_0xa2c6('0x45')]=function(_0x5dbb57,_0x2bfda6){return db[_0xa2c6('0x25')][_0xa2c6('0x45')]()['then'](respondWithResult(_0x2bfda6,null))[_0xa2c6('0x3f')](handleError(_0x2bfda6,null));}; \ No newline at end of file +var _0x4dbc=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','UserProfileSection','findAll','rows','catch','show','params','rawAttributes','intersection','find','body','describe','rimraf','fast-json-patch','moment','mustache','util'];(function(_0x151973,_0x5e1898){var _0xa8d689=function(_0x617a4){while(--_0x617a4){_0x151973['push'](_0x151973['shift']());}};_0xa8d689(++_0x5e1898);}(_0x4dbc,0xdf));var _0xc4db=function(_0x5f207b,_0x2bd4f2){_0x5f207b=_0x5f207b-0x0;var _0x4a1825=_0x4dbc[_0x5f207b];return _0x4a1825;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc4db('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc4db('0x1'));var rp=require('request-promise');var moment=require(_0xc4db('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc4db('0x3'));var util=require(_0xc4db('0x4'));var path=require(_0xc4db('0x5'));var sox=require('sox');var csv=require(_0xc4db('0x6'));var ejs=require(_0xc4db('0x7'));var fs=require('fs');var fs_extra=require(_0xc4db('0x8'));var _=require(_0xc4db('0x9'));var squel=require(_0xc4db('0xa'));var crypto=require(_0xc4db('0xb'));var jsforce=require(_0xc4db('0xc'));var deskjs=require(_0xc4db('0xd'));var toCsv=require(_0xc4db('0x6'));var querystring=require('querystring');var Papa=require(_0xc4db('0xe'));var Redis=require(_0xc4db('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc4db('0x10'));var as=require(_0xc4db('0x11'));var hardwareService=require(_0xc4db('0x12'));var logger=require('../../config/logger')(_0xc4db('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc4db('0x14'));var db=require(_0xc4db('0x15'))['db'];function respondWithStatusCode(_0x51e3a9,_0xb8411){_0xb8411=_0xb8411||0xcc;return function(_0x536cf4){if(_0x536cf4){return _0x51e3a9[_0xc4db('0x16')](_0xb8411);}return _0x51e3a9[_0xc4db('0x17')](_0xb8411)['end']();};}function respondWithResult(_0x426cf1,_0x23d1ba){_0x23d1ba=_0x23d1ba||0xc8;return function(_0x77760f){if(_0x77760f){return _0x426cf1[_0xc4db('0x17')](_0x23d1ba)[_0xc4db('0x18')](_0x77760f);}};}function respondWithFilteredResult(_0x429202,_0x5f4d5f){return function(_0xa1b647){if(_0xa1b647){var _0x4cb707=typeof _0x5f4d5f[_0xc4db('0x19')]===_0xc4db('0x1a')&&typeof _0x5f4d5f[_0xc4db('0x1b')]==='undefined';var _0x155d0a=_0xa1b647[_0xc4db('0x1c')];var _0x5d6c54=_0x4cb707?0x0:_0x5f4d5f[_0xc4db('0x19')];var _0x55debe=_0x4cb707?_0xa1b647['count']:_0x5f4d5f[_0xc4db('0x19')]+_0x5f4d5f['limit'];var _0x36eec5;if(_0x55debe>=_0x155d0a){_0x55debe=_0x155d0a;_0x36eec5=0xc8;}else{_0x36eec5=0xce;}_0x429202[_0xc4db('0x17')](_0x36eec5);return _0x429202[_0xc4db('0x1d')](_0xc4db('0x1e'),_0x5d6c54+'-'+_0x55debe+'/'+_0x155d0a)[_0xc4db('0x18')](_0xa1b647);}return null;};}function patchUpdates(_0x3a5338){return function(_0x557598){try{jsonpatch[_0xc4db('0x1f')](_0x557598,_0x3a5338,!![]);}catch(_0x18082f){return BPromise[_0xc4db('0x20')](_0x18082f);}return _0x557598['save']();};}function saveUpdates(_0x374751,_0x436552){return function(_0x321699){if(_0x321699){return _0x321699[_0xc4db('0x21')](_0x374751)['then'](function(_0x384ac9){return _0x384ac9;});}return null;};}function removeEntity(_0x532654,_0x51f49c){return function(_0xc72442){if(_0xc72442){return _0xc72442[_0xc4db('0x22')]()['then'](function(){_0x532654[_0xc4db('0x17')](0xcc)[_0xc4db('0x23')]();});}};}function handleEntityNotFound(_0x319deb,_0x57021e){return function(_0x14891f){if(!_0x14891f){_0x319deb[_0xc4db('0x16')](0x194);}return _0x14891f;};}function handleError(_0xd8f9d2,_0x46921f){_0x46921f=_0x46921f||0x1f4;return function(_0x2c86d3){logger[_0xc4db('0x24')](_0x2c86d3[_0xc4db('0x25')]);if(_0x2c86d3[_0xc4db('0x26')]){delete _0x2c86d3[_0xc4db('0x26')];}_0xd8f9d2[_0xc4db('0x17')](_0x46921f)[_0xc4db('0x27')](_0x2c86d3);};}exports[_0xc4db('0x28')]=function(_0x2911e6,_0x20eccb){var _0x5c511c={},_0x28caca={},_0x1c508a={'count':0x0,'rows':[]};var _0x532e0a=_[_0xc4db('0x29')](db['UserProfileSection']['rawAttributes'],function(_0x56a7e0){return{'name':_0x56a7e0[_0xc4db('0x2a')],'type':_0x56a7e0[_0xc4db('0x2b')][_0xc4db('0x2c')]};});_0x28caca[_0xc4db('0x2d')]=_[_0xc4db('0x29')](_0x532e0a,_0xc4db('0x26'));_0x28caca[_0xc4db('0x2e')]=_[_0xc4db('0x2f')](_0x2911e6[_0xc4db('0x2e')]);_0x28caca[_0xc4db('0x30')]=_['intersection'](_0x28caca[_0xc4db('0x2d')],_0x28caca[_0xc4db('0x2e')]);_0x5c511c[_0xc4db('0x31')]=_['intersection'](_0x28caca[_0xc4db('0x2d')],qs['fields'](_0x2911e6[_0xc4db('0x2e')][_0xc4db('0x32')]));_0x5c511c[_0xc4db('0x31')]=_0x5c511c[_0xc4db('0x31')][_0xc4db('0x33')]?_0x5c511c[_0xc4db('0x31')]:_0x28caca[_0xc4db('0x2d')];if(!_0x2911e6['query'][_0xc4db('0x34')](_0xc4db('0x35'))){_0x5c511c[_0xc4db('0x1b')]=qs[_0xc4db('0x1b')](_0x2911e6[_0xc4db('0x2e')][_0xc4db('0x1b')]);_0x5c511c[_0xc4db('0x19')]=qs['offset'](_0x2911e6[_0xc4db('0x2e')][_0xc4db('0x19')]);}_0x5c511c[_0xc4db('0x36')]=qs[_0xc4db('0x37')](_0x2911e6[_0xc4db('0x2e')][_0xc4db('0x37')]);_0x5c511c[_0xc4db('0x38')]=qs[_0xc4db('0x30')](_[_0xc4db('0x39')](_0x2911e6[_0xc4db('0x2e')],_0x28caca[_0xc4db('0x30')]),_0x532e0a);if(_0x2911e6[_0xc4db('0x2e')][_0xc4db('0x3a')]){_0x5c511c[_0xc4db('0x38')]=_[_0xc4db('0x3b')](_0x5c511c[_0xc4db('0x38')],{'$or':_['map'](_0x532e0a,function(_0x3e847e){if(_0x3e847e['type']!==_0xc4db('0x3c')){var _0x3bfb5e={};_0x3bfb5e[_0x3e847e[_0xc4db('0x26')]]={'$like':'%'+_0x2911e6[_0xc4db('0x2e')][_0xc4db('0x3a')]+'%'};return _0x3bfb5e;}})});}_0x5c511c=_[_0xc4db('0x3b')]({},_0x5c511c,_0x2911e6[_0xc4db('0x3d')]);var _0x2e07c2={'where':_0x5c511c['where']};return db['UserProfileSection'][_0xc4db('0x1c')](_0x2e07c2)[_0xc4db('0x3e')](function(_0x19ef6d){_0x1c508a[_0xc4db('0x1c')]=_0x19ef6d;if(_0x2911e6[_0xc4db('0x2e')][_0xc4db('0x3f')]){_0x5c511c[_0xc4db('0x40')]=[{'all':!![]}];}return db[_0xc4db('0x41')][_0xc4db('0x42')](_0x5c511c);})['then'](function(_0x29b37e){_0x1c508a[_0xc4db('0x43')]=_0x29b37e;return _0x1c508a;})[_0xc4db('0x3e')](respondWithFilteredResult(_0x20eccb,_0x5c511c))[_0xc4db('0x44')](handleError(_0x20eccb,null));};exports[_0xc4db('0x45')]=function(_0x37e666,_0x4f2792){var _0x458443={'raw':![],'where':{'id':_0x37e666[_0xc4db('0x46')]['id']}},_0x5f5a0c={};_0x5f5a0c[_0xc4db('0x2d')]=_[_0xc4db('0x2f')](db[_0xc4db('0x41')][_0xc4db('0x47')]);_0x5f5a0c[_0xc4db('0x2e')]=_[_0xc4db('0x2f')](_0x37e666[_0xc4db('0x2e')]);_0x5f5a0c[_0xc4db('0x30')]=_[_0xc4db('0x48')](_0x5f5a0c['model'],_0x5f5a0c[_0xc4db('0x2e')]);_0x458443[_0xc4db('0x31')]=_[_0xc4db('0x48')](_0x5f5a0c[_0xc4db('0x2d')],qs[_0xc4db('0x32')](_0x37e666[_0xc4db('0x2e')][_0xc4db('0x32')]));_0x458443[_0xc4db('0x31')]=_0x458443[_0xc4db('0x31')][_0xc4db('0x33')]?_0x458443[_0xc4db('0x31')]:_0x5f5a0c[_0xc4db('0x2d')];if(_0x37e666['query'][_0xc4db('0x3f')]){_0x458443[_0xc4db('0x40')]=[{'all':!![]}];}_0x458443=_[_0xc4db('0x3b')]({},_0x458443,_0x37e666[_0xc4db('0x3d')]);return db[_0xc4db('0x41')][_0xc4db('0x49')](_0x458443)[_0xc4db('0x3e')](handleEntityNotFound(_0x4f2792,null))['then'](respondWithResult(_0x4f2792,null))['catch'](handleError(_0x4f2792,null));};exports['create']=function(_0x161896,_0xc0810c){return db[_0xc4db('0x41')]['create'](_0x161896[_0xc4db('0x4a')],{})['then'](respondWithResult(_0xc0810c,0xc9))[_0xc4db('0x44')](handleError(_0xc0810c,null));};exports[_0xc4db('0x21')]=function(_0xda726b,_0x53be89){if(_0xda726b['body']['id']){delete _0xda726b['body']['id'];}return db['UserProfileSection']['find']({'where':{'id':_0xda726b[_0xc4db('0x46')]['id']}})[_0xc4db('0x3e')](handleEntityNotFound(_0x53be89,null))[_0xc4db('0x3e')](saveUpdates(_0xda726b['body'],null))['then'](respondWithResult(_0x53be89,null))[_0xc4db('0x44')](handleError(_0x53be89,null));};exports[_0xc4db('0x22')]=function(_0x11d9d4,_0x481e2f){return db[_0xc4db('0x41')]['find']({'where':{'id':_0x11d9d4[_0xc4db('0x46')]['id']}})[_0xc4db('0x3e')](handleEntityNotFound(_0x481e2f,null))['then'](removeEntity(_0x481e2f,null))[_0xc4db('0x44')](handleError(_0x481e2f,null));};exports[_0xc4db('0x4b')]=function(_0x4859be,_0x1d6293){return db['UserProfileSection'][_0xc4db('0x4b')]()[_0xc4db('0x3e')](respondWithResult(_0x1d6293,null))[_0xc4db('0x44')](handleError(_0x1d6293,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 5a424ce..558c882 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 _0xe2d7=['UserProfileSection','user_profile_has_sections','sectionId','lodash','util','api','moment','bluebird','path','rimraf','exports','define'];(function(_0xe8273e,_0x2c4b77){var _0x2e6a8b=function(_0x1db8dc){while(--_0x1db8dc){_0xe8273e['push'](_0xe8273e['shift']());}};_0x2e6a8b(++_0x2c4b77);}(_0xe2d7,0x7b));var _0x7e2d=function(_0x4fda8b,_0x234433){_0x4fda8b=_0x4fda8b-0x0;var _0x52cd9d=_0xe2d7[_0x4fda8b];return _0x52cd9d;};'use strict';var _=require(_0x7e2d('0x0'));var util=require(_0x7e2d('0x1'));var logger=require('../../config/logger')(_0x7e2d('0x2'));var moment=require(_0x7e2d('0x3'));var BPromise=require(_0x7e2d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e2d('0x5'));var rimraf=require(_0x7e2d('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0x7e2d('0x7')]=function(_0x2798ed,_0x34306f){return _0x2798ed[_0x7e2d('0x8')](_0x7e2d('0x9'),attributes,{'tableName':_0x7e2d('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x7e2d('0xb'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd1c7=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId'];(function(_0x4398bc,_0x1e825b){var _0x128e55=function(_0x140b5e){while(--_0x140b5e){_0x4398bc['push'](_0x4398bc['shift']());}};_0x128e55(++_0x1e825b);}(_0xd1c7,0x14a));var _0x7d1c=function(_0x55f122,_0x56edaf){_0x55f122=_0x55f122-0x0;var _0x1a28d6=_0xd1c7[_0x55f122];return _0x1a28d6;};'use strict';var _=require(_0x7d1c('0x0'));var util=require(_0x7d1c('0x1'));var logger=require('../../config/logger')(_0x7d1c('0x2'));var moment=require(_0x7d1c('0x3'));var BPromise=require(_0x7d1c('0x4'));var rp=require(_0x7d1c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d1c('0x6'));var config=require(_0x7d1c('0x7'));var attributes=require(_0x7d1c('0x8'));module[_0x7d1c('0x9')]=function(_0x34bd99,_0x4e72b1){return _0x34bd99[_0x7d1c('0xa')](_0x7d1c('0xb'),attributes,{'tableName':_0x7d1c('0xc'),'paranoid':![],'indexes':[{'name':_0x7d1c('0xd'),'fields':['sectionId',_0x7d1c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 97a31b4..f74c91c 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 _0x08c3=['http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x08c3,0x11f));var _0x308c=function(_0x49a4e3,_0x1cc52e){_0x49a4e3=_0x49a4e3-0x0;var _0x1e96be=_0x08c3[_0x49a4e3];return _0x1e96be;};'use strict';var _=require(_0x308c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x308c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x308c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x308c('0x3'));var logger=require(_0x308c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x308c('0x5'));var client=jayson[_0x308c('0x6')][_0x308c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4a2c40,_0x20961a,_0x4b1955){return new BPromise(function(_0x4f9899,_0x6927ed){return client[_0x308c('0x8')](_0x4a2c40,_0x4b1955)[_0x308c('0x9')](function(_0x587848){logger[_0x308c('0xa')](_0x308c('0xb'),_0x20961a,'request\x20sent');logger[_0x308c('0xc')](_0x308c('0xd'),_0x20961a,_0x308c('0xe'),JSON[_0x308c('0xf')](_0x587848));if(_0x587848[_0x308c('0x10')]){if(_0x587848[_0x308c('0x10')][_0x308c('0x11')]===0x1f4){logger[_0x308c('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x20961a,_0x587848[_0x308c('0x10')][_0x308c('0x12')]);return _0x6927ed(_0x587848[_0x308c('0x10')]['message']);}logger['error'](_0x308c('0xb'),_0x20961a,_0x587848[_0x308c('0x10')]['message']);return _0x4f9899(_0x587848[_0x308c('0x10')][_0x308c('0x12')]);}else{logger[_0x308c('0xa')](_0x308c('0xb'),_0x20961a,_0x308c('0xe'));_0x4f9899(_0x587848[_0x308c('0x13')][_0x308c('0x12')]);}})[_0x308c('0x14')](function(_0x10daac){logger[_0x308c('0x10')](_0x308c('0xb'),_0x20961a,_0x10daac);_0x6927ed(_0x10daac);});});} \ No newline at end of file +var _0x3eaa=['stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x423c77,_0x468893){var _0x709302=function(_0x5972fc){while(--_0x5972fc){_0x423c77['push'](_0x423c77['shift']());}};_0x709302(++_0x468893);}(_0x3eaa,0xe2));var _0xa3ea=function(_0xf309c1,_0x2a7755){_0xf309c1=_0xf309c1-0x0;var _0x28d122=_0x3eaa[_0xf309c1];return _0x28d122;};'use strict';var _=require(_0xa3ea('0x0'));var util=require(_0xa3ea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa3ea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa3ea('0x3'))['db'];var utils=require(_0xa3ea('0x4'));var logger=require('../../config/logger')(_0xa3ea('0x5'));var config=require(_0xa3ea('0x6'));var jayson=require(_0xa3ea('0x7'));var client=jayson['client'][_0xa3ea('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40b32e,_0x2124e4,_0x4e7a73){return new BPromise(function(_0x383bed,_0x37b2cb){return client[_0xa3ea('0x9')](_0x40b32e,_0x4e7a73)[_0xa3ea('0xa')](function(_0x545b2f){logger[_0xa3ea('0xb')](_0xa3ea('0xc'),_0x2124e4,_0xa3ea('0xd'));logger[_0xa3ea('0xe')](_0xa3ea('0xf'),_0x2124e4,_0xa3ea('0xd'),JSON[_0xa3ea('0x10')](_0x545b2f));if(_0x545b2f[_0xa3ea('0x11')]){if(_0x545b2f[_0xa3ea('0x11')][_0xa3ea('0x12')]===0x1f4){logger[_0xa3ea('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x2124e4,_0x545b2f[_0xa3ea('0x11')][_0xa3ea('0x13')]);return _0x37b2cb(_0x545b2f['error'][_0xa3ea('0x13')]);}logger[_0xa3ea('0x11')](_0xa3ea('0xc'),_0x2124e4,_0x545b2f[_0xa3ea('0x11')][_0xa3ea('0x13')]);return _0x383bed(_0x545b2f[_0xa3ea('0x11')][_0xa3ea('0x13')]);}else{logger[_0xa3ea('0xb')](_0xa3ea('0xc'),_0x2124e4,_0xa3ea('0xd'));_0x383bed(_0x545b2f[_0xa3ea('0x14')][_0xa3ea('0x13')]);}})[_0xa3ea('0x15')](function(_0x50956a){logger[_0xa3ea('0x11')](_0xa3ea('0xc'),_0x2124e4,_0x50956a);_0x37b2cb(_0x50956a);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index a495f74..f663b60 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xb3b35b,_0x29e645){var _0x5279be=function(_0xb1b37b){while(--_0xb1b37b){_0xb3b35b['push'](_0xb3b35b['shift']());}};_0x5279be(++_0x29e645);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x40ca62,_0x455f20){var _0x4a0e77=function(_0x5b461e){while(--_0x5b461e){_0x40ca62['push'](_0x40ca62['shift']());}};_0x4a0e77(++_0x455f20);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x40911a,_0x55ec99){_0x40911a=_0x40911a-0x0;var _0x27e8e3=_0xcb91[_0x40911a];return _0x27e8e3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 23ffbf6..1b67b22 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 _0xd114=['sequelize','exports'];(function(_0x3da001,_0x256e26){var _0x2947e9=function(_0x4afdc0){while(--_0x4afdc0){_0x3da001['push'](_0x3da001['shift']());}};_0x2947e9(++_0x256e26);}(_0xd114,0x10c));var _0x4d11=function(_0x48d1ba,_0x41d36c){_0x48d1ba=_0x48d1ba-0x0;var _0x1e205a=_0xd114[_0x48d1ba];return _0x1e205a;};'use strict';var Sequelize=require(_0x4d11('0x0'));module[_0x4d11('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x666b=['sequelize','exports','INTEGER'];(function(_0x786e9,_0x1a029){var _0x1f891b=function(_0x31ad7c){while(--_0x31ad7c){_0x786e9['push'](_0x786e9['shift']());}};_0x1f891b(++_0x1a029);}(_0x666b,0x1b9));var _0xb666=function(_0x5a6d51,_0x548357){_0x5a6d51=_0x5a6d51-0x0;var _0x2584fb=_0x666b[_0x5a6d51];return _0x2584fb;};'use strict';var Sequelize=require(_0xb666('0x0'));module[_0xb666('0x1')]={'penalty':{'type':Sequelize[_0xb666('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 27c4223..aecaeac 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 _0xffd6=['path','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xffd6,0x97));var _0x6ffd=function(_0x15fc3c,_0x35665b){_0x15fc3c=_0x15fc3c-0x0;var _0x94c5c8=_0xffd6[_0x15fc3c];return _0x94c5c8;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var logger=require(_0x6ffd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6ffd('0x3'));var rp=require(_0x6ffd('0x4'));var fs=require('fs');var path=require(_0x6ffd('0x5'));var rimraf=require('rimraf');var config=require(_0x6ffd('0x6'));var attributes=require(_0x6ffd('0x7'));module[_0x6ffd('0x8')]=function(_0x2949a4,_0x561055){return _0x2949a4[_0x6ffd('0x9')](_0x6ffd('0xa'),attributes,{'tableName':_0x6ffd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['exports','define','UserSmsQueue','user_has_sms_queues','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes'];(function(_0x10e945,_0x1c5c84){var _0x1068d6=function(_0xf936d9){while(--_0xf936d9){_0x10e945['push'](_0x10e945['shift']());}};_0x1068d6(++_0x1c5c84);}(_0x71ab,0x64));var _0xb71a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x71ab[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index b95d4a4..1ae3cc4 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 _0xeeb4=['../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x50d02a,_0x39e491){var _0x1953ce=function(_0x20671c){while(--_0x20671c){_0x50d02a['push'](_0x50d02a['shift']());}};_0x1953ce(++_0x39e491);}(_0xeeb4,0x1f1));var _0x4eeb=function(_0x4ede8b,_0x25b7a7){_0x4ede8b=_0x4ede8b-0x0;var _0x2c1011=_0xeeb4[_0x4ede8b];return _0x2c1011;};'use strict';var _=require(_0x4eeb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4eeb('0x1'));var rs=require(_0x4eeb('0x2'));var fs=require('fs');var Redis=require(_0x4eeb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4eeb('0x4'));var logger=require(_0x4eeb('0x5'))(_0x4eeb('0x6'));var config=require(_0x4eeb('0x7'));var jayson=require(_0x4eeb('0x8'));var client=jayson[_0x4eeb('0x9')][_0x4eeb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5be0fe,_0x326f94,_0x365b58){return new BPromise(function(_0x37ee5,_0x41a7a4){return client[_0x4eeb('0xb')](_0x5be0fe,_0x365b58)[_0x4eeb('0xc')](function(_0x18ea05){logger[_0x4eeb('0xd')](_0x4eeb('0xe'),_0x326f94,_0x4eeb('0xf'));logger[_0x4eeb('0x10')](_0x4eeb('0x11'),_0x326f94,_0x4eeb('0xf'),JSON[_0x4eeb('0x12')](_0x18ea05));if(_0x18ea05['error']){if(_0x18ea05[_0x4eeb('0x13')][_0x4eeb('0x14')]===0x1f4){logger[_0x4eeb('0x13')](_0x4eeb('0xe'),_0x326f94,_0x18ea05['error'][_0x4eeb('0x15')]);return _0x41a7a4(_0x18ea05[_0x4eeb('0x13')][_0x4eeb('0x15')]);}logger[_0x4eeb('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x326f94,_0x18ea05['error'][_0x4eeb('0x15')]);return _0x37ee5(_0x18ea05[_0x4eeb('0x13')][_0x4eeb('0x15')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x326f94,_0x4eeb('0xf'));_0x37ee5(_0x18ea05[_0x4eeb('0x16')][_0x4eeb('0x15')]);}})[_0x4eeb('0x17')](function(_0x2159fb){logger[_0x4eeb('0x13')](_0x4eeb('0xe'),_0x326f94,_0x2159fb);_0x41a7a4(_0x2159fb);});});} \ No newline at end of file +var _0xf6b7=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0xf6b7,0x1f4));var _0x7f6b=function(_0x2bd1ec,_0x3fe65f){_0x2bd1ec=_0x2bd1ec-0x0;var _0x2f7577=_0xf6b7[_0x2bd1ec];return _0x2f7577;};'use strict';var _=require(_0x7f6b('0x0'));var util=require(_0x7f6b('0x1'));var moment=require(_0x7f6b('0x2'));var BPromise=require(_0x7f6b('0x3'));var rs=require(_0x7f6b('0x4'));var fs=require('fs');var Redis=require(_0x7f6b('0x5'));var db=require(_0x7f6b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f6b('0x7'))('rpc');var config=require(_0x7f6b('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23ce3,_0x2506e9,_0x2cf46f){return new BPromise(function(_0x4e6215,_0xd862c){return client[_0x7f6b('0x9')](_0x23ce3,_0x2cf46f)[_0x7f6b('0xa')](function(_0x3a8804){logger[_0x7f6b('0xb')](_0x7f6b('0xc'),_0x2506e9,_0x7f6b('0xd'));logger['debug'](_0x7f6b('0xe'),_0x2506e9,_0x7f6b('0xd'),JSON['stringify'](_0x3a8804));if(_0x3a8804[_0x7f6b('0xf')]){if(_0x3a8804[_0x7f6b('0xf')][_0x7f6b('0x10')]===0x1f4){logger[_0x7f6b('0xf')](_0x7f6b('0xc'),_0x2506e9,_0x3a8804[_0x7f6b('0xf')][_0x7f6b('0x11')]);return _0xd862c(_0x3a8804['error'][_0x7f6b('0x11')]);}logger[_0x7f6b('0xf')](_0x7f6b('0xc'),_0x2506e9,_0x3a8804['error']['message']);return _0x4e6215(_0x3a8804[_0x7f6b('0xf')][_0x7f6b('0x11')]);}else{logger[_0x7f6b('0xb')](_0x7f6b('0xc'),_0x2506e9,_0x7f6b('0xd'));_0x4e6215(_0x3a8804[_0x7f6b('0x12')]['message']);}})[_0x7f6b('0x13')](function(_0x241119){logger[_0x7f6b('0xf')](_0x7f6b('0xc'),_0x2506e9,_0x241119);_0xd862c(_0x241119);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index f4b6028..41dc55e 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 _0xe1c3=['sequelize','INTEGER'];(function(_0x2e21f9,_0x5efe33){var _0x30597d=function(_0x2f72aa){while(--_0x2f72aa){_0x2e21f9['push'](_0x2e21f9['shift']());}};_0x30597d(++_0x5efe33);}(_0xe1c3,0xf0));var _0x3e1c=function(_0xaeedca,_0x170237){_0xaeedca=_0xaeedca-0x0;var _0x562b76=_0xe1c3[_0xaeedca];return _0x562b76;};'use strict';var Sequelize=require(_0x3e1c('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x3e1c('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x3e1c('0x1')]}}; \ No newline at end of file +var _0x21ea=['sequelize','INTEGER'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x21ea,0x164));var _0xa21e=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x21ea[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0xa21e('0x0'));module['exports']={'UserId':{'type':Sequelize[_0xa21e('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xa21e('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 329ce91..9b2fa49 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(_0x214111,_0x461bd9){var _0x4df7c8=function(_0x2bb4f2){while(--_0x2bb4f2){_0x214111['push'](_0x214111['shift']());}};_0x4df7c8(++_0x461bd9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x47a3a5,_0x2ce0d3){var _0x4a2133=function(_0x406fd7){while(--_0x406fd7){_0x47a3a5['push'](_0x47a3a5['shift']());}};_0x4a2133(++_0x2ce0d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 4a16ef6..93d5b8b 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x18b8c4,_0x16c16a){var _0x552000=function(_0x378da5){while(--_0x378da5){_0x18b8c4['push'](_0x18b8c4['shift']());}};_0x552000(++_0x16c16a);}(_0xedd9,0xfc));var _0x9edd=function(_0x35430b,_0x6d611b){_0x35430b=_0x35430b-0x0;var _0x53fe3a=_0xedd9[_0x35430b];return _0x53fe3a;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x14c240,_0x1d23fc){var _0x518d01=function(_0x4256b0){while(--_0x4256b0){_0x14c240['push'](_0x14c240['shift']());}};_0x518d01(++_0x1d23fc);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index d8084d6..0a73d22 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 _0x75b4=['exports','INTEGER'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x75b4,0xc2));var _0x475b=function(_0x5da61a,_0x5745cc){_0x5da61a=_0x5da61a-0x0;var _0x1ceaa5=_0x75b4[_0x5da61a];return _0x1ceaa5;};'use strict';var Sequelize=require('sequelize');module[_0x475b('0x0')]={'penalty':{'type':Sequelize[_0x475b('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbf9c=['sequelize','INTEGER'];(function(_0x48f440,_0x205b56){var _0xcc60f=function(_0x320c20){while(--_0x320c20){_0x48f440['push'](_0x48f440['shift']());}};_0xcc60f(++_0x205b56);}(_0xbf9c,0xf8));var _0xcbf9=function(_0x328be2,_0x39d084){_0x328be2=_0x328be2-0x0;var _0x2aa803=_0xbf9c[_0x328be2];return _0x2aa803;};'use strict';var Sequelize=require(_0xcbf9('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xcbf9('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 4d23a99..50e4247 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 _0x78b3=['user_has_voice_queues','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue'];(function(_0x20c893,_0xbef2b4){var _0xc705e8=function(_0x449739){while(--_0x449739){_0x20c893['push'](_0x20c893['shift']());}};_0xc705e8(++_0xbef2b4);}(_0x78b3,0x18d));var _0x378b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x78b3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x378b('0x0'));var util=require(_0x378b('0x1'));var logger=require(_0x378b('0x2'))(_0x378b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x378b('0x4'));var rimraf=require(_0x378b('0x5'));var config=require(_0x378b('0x6'));var attributes=require(_0x378b('0x7'));module[_0x378b('0x8')]=function(_0x300005,_0x37de13){return _0x300005['define'](_0x378b('0x9'),attributes,{'tableName':_0x378b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc889=['moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util','../../config/logger'];(function(_0x20a234,_0x209a9a){var _0x57cae4=function(_0x155ff2){while(--_0x155ff2){_0x20a234['push'](_0x20a234['shift']());}};_0x57cae4(++_0x209a9a);}(_0xc889,0x1c5));var _0x9c88=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xc889[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0x9c88('0x0'));var util=require(_0x9c88('0x1'));var logger=require(_0x9c88('0x2'))('api');var moment=require(_0x9c88('0x3'));var BPromise=require(_0x9c88('0x4'));var rp=require(_0x9c88('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c88('0x6'));var config=require(_0x9c88('0x7'));var attributes=require(_0x9c88('0x8'));module[_0x9c88('0x9')]=function(_0x2cf24e,_0x2a880b){return _0x2cf24e[_0x9c88('0xa')](_0x9c88('0xb'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index f6144c7..d871567 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 _0x8aca=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3dc5c1,_0x503e9c){var _0x57fdc5=function(_0x40f2db){while(--_0x40f2db){_0x3dc5c1['push'](_0x3dc5c1['shift']());}};_0x57fdc5(++_0x503e9c);}(_0x8aca,0x13a));var _0xa8ac=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x8aca[_0x58db4e];return _0x40139a;};'use strict';var _=require(_0xa8ac('0x0'));var util=require(_0xa8ac('0x1'));var moment=require('moment');var BPromise=require(_0xa8ac('0x2'));var rs=require(_0xa8ac('0x3'));var fs=require('fs');var Redis=require(_0xa8ac('0x4'));var db=require(_0xa8ac('0x5'))['db'];var utils=require(_0xa8ac('0x6'));var logger=require('../../config/logger')(_0xa8ac('0x7'));var config=require(_0xa8ac('0x8'));var jayson=require(_0xa8ac('0x9'));var client=jayson[_0xa8ac('0xa')][_0xa8ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31eaed,_0x38a9e1,_0x51245b){return new BPromise(function(_0x2b6c71,_0x507244){return client[_0xa8ac('0xc')](_0x31eaed,_0x51245b)['then'](function(_0x5406c1){logger[_0xa8ac('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x38a9e1,_0xa8ac('0xe'));logger[_0xa8ac('0xf')](_0xa8ac('0x10'),_0x38a9e1,_0xa8ac('0xe'),JSON['stringify'](_0x5406c1));if(_0x5406c1[_0xa8ac('0x11')]){if(_0x5406c1[_0xa8ac('0x11')][_0xa8ac('0x12')]===0x1f4){logger[_0xa8ac('0x11')](_0xa8ac('0x13'),_0x38a9e1,_0x5406c1[_0xa8ac('0x11')][_0xa8ac('0x14')]);return _0x507244(_0x5406c1[_0xa8ac('0x11')]['message']);}logger[_0xa8ac('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x38a9e1,_0x5406c1[_0xa8ac('0x11')][_0xa8ac('0x14')]);return _0x2b6c71(_0x5406c1[_0xa8ac('0x11')][_0xa8ac('0x14')]);}else{logger[_0xa8ac('0xd')](_0xa8ac('0x13'),_0x38a9e1,_0xa8ac('0xe'));_0x2b6c71(_0x5406c1[_0xa8ac('0x15')][_0xa8ac('0x14')]);}})[_0xa8ac('0x16')](function(_0x147ab2){logger[_0xa8ac('0x11')](_0xa8ac('0x13'),_0x38a9e1,_0x147ab2);_0x507244(_0x147ab2);});});} \ No newline at end of file +var _0x4750=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x54a9e0,_0x15c846){var _0x1ebb54=function(_0x5162f9){while(--_0x5162f9){_0x54a9e0['push'](_0x54a9e0['shift']());}};_0x1ebb54(++_0x15c846);}(_0x4750,0xdf));var _0x0475=function(_0x3b3bc1,_0x167704){_0x3b3bc1=_0x3b3bc1-0x0;var _0x28a6af=_0x4750[_0x3b3bc1];return _0x28a6af;};'use strict';var _=require(_0x0475('0x0'));var util=require(_0x0475('0x1'));var moment=require(_0x0475('0x2'));var BPromise=require(_0x0475('0x3'));var rs=require(_0x0475('0x4'));var fs=require('fs');var Redis=require(_0x0475('0x5'));var db=require(_0x0475('0x6'))['db'];var utils=require(_0x0475('0x7'));var logger=require(_0x0475('0x8'))(_0x0475('0x9'));var config=require('../../config/environment');var jayson=require(_0x0475('0xa'));var client=jayson[_0x0475('0xb')][_0x0475('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x447167,_0x4fdc4d,_0x52ffc6){return new BPromise(function(_0x9a9f1b,_0x5909a2){return client[_0x0475('0xd')](_0x447167,_0x52ffc6)[_0x0475('0xe')](function(_0x254408){logger[_0x0475('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x4fdc4d,_0x0475('0x10'));logger[_0x0475('0x11')](_0x0475('0x12'),_0x4fdc4d,'request\x20sent',JSON[_0x0475('0x13')](_0x254408));if(_0x254408[_0x0475('0x14')]){if(_0x254408[_0x0475('0x14')][_0x0475('0x15')]===0x1f4){logger[_0x0475('0x14')](_0x0475('0x16'),_0x4fdc4d,_0x254408[_0x0475('0x14')][_0x0475('0x17')]);return _0x5909a2(_0x254408[_0x0475('0x14')][_0x0475('0x17')]);}logger[_0x0475('0x14')](_0x0475('0x16'),_0x4fdc4d,_0x254408[_0x0475('0x14')][_0x0475('0x17')]);return _0x9a9f1b(_0x254408[_0x0475('0x14')]['message']);}else{logger[_0x0475('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x4fdc4d,_0x0475('0x10'));_0x9a9f1b(_0x254408['result'][_0x0475('0x17')]);}})[_0x0475('0x18')](function(_0x580612){logger[_0x0475('0x14')](_0x0475('0x16'),_0x4fdc4d,_0x580612);_0x5909a2(_0x580612);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 9d42b7b..521f831 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x44cd97,_0x12a1c9){var _0x59694b=function(_0x3742e2){while(--_0x3742e2){_0x44cd97['push'](_0x44cd97['shift']());}};_0x59694b(++_0x12a1c9);}(_0xe706,0xa3));var _0x6e70=function(_0x749c48,_0x336468){_0x749c48=_0x749c48-0x0;var _0x2f419c=_0xe706[_0x749c48];return _0x2f419c;};'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(_0x1c1fcc,_0x32dd8e){var _0x1c3fb0=function(_0x465e17){while(--_0x465e17){_0x1c1fcc['push'](_0x1c1fcc['shift']());}};_0x1c3fb0(++_0x32dd8e);}(_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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index df3b457..0640849 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 _0xc89f=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x57172c,_0x1df512){var _0x38e8a4=function(_0x1bc9a5){while(--_0x1bc9a5){_0x57172c['push'](_0x57172c['shift']());}};_0x38e8a4(++_0x1df512);}(_0xc89f,0x1c2));var _0xfc89=function(_0x42f58d,_0x44a5a3){_0x42f58d=_0x42f58d-0x0;var _0x3207f5=_0xc89f[_0x42f58d];return _0x3207f5;};'use strict';var Sequelize=require(_0xfc89('0x0'));module[_0xfc89('0x1')]={'uniqueid':{'type':Sequelize[_0xfc89('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xfc89('0x3')},'membername':{'type':Sequelize[_0xfc89('0x4')],'allowNull':![],'comment':_0xfc89('0x3')},'UserId':{'type':Sequelize[_0xfc89('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xfc89('0x4')],'allowNull':![],'unique':_0xfc89('0x5'),'comment':_0xfc89('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xfc89('0x4')],'allowNull':![],'unique':_0xfc89('0x5'),'comment':_0xfc89('0x3')},'penalty':{'type':Sequelize[_0xfc89('0x2')](0xb),'defaultValue':0x0,'comment':_0xfc89('0x3')},'paused':{'type':Sequelize[_0xfc89('0x2')](0xb),'defaultValue':0x0,'comment':_0xfc89('0x3')}}; \ No newline at end of file +var _0x430d=['INTEGER','queue_interface','sequelize','Required\x20by\x20Asterisk','STRING'];(function(_0xed8585,_0x44eeff){var _0x924067=function(_0x3e5898){while(--_0x3e5898){_0xed8585['push'](_0xed8585['shift']());}};_0x924067(++_0x44eeff);}(_0x430d,0x18d));var _0xd430=function(_0x4ba229,_0x295b78){_0x4ba229=_0x4ba229-0x0;var _0x180b81=_0x430d[_0x4ba229];return _0x180b81;};'use strict';var Sequelize=require(_0xd430('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xd430('0x1')},'membername':{'type':Sequelize[_0xd430('0x2')],'allowNull':![],'comment':_0xd430('0x1')},'UserId':{'type':Sequelize[_0xd430('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd430('0x4'),'comment':_0xd430('0x1')},'VoiceQueueId':{'type':Sequelize[_0xd430('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0xd430('0x2')],'allowNull':![],'unique':_0xd430('0x4'),'comment':_0xd430('0x1')},'penalty':{'type':Sequelize[_0xd430('0x3')](0xb),'defaultValue':0x0,'comment':_0xd430('0x1')},'paused':{'type':Sequelize[_0xd430('0x3')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 2643128..80cd47c 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 _0x0e35=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x509195,_0x100287){var _0x195357=function(_0x33b2a8){while(--_0x33b2a8){_0x509195['push'](_0x509195['shift']());}};_0x195357(++_0x100287);}(_0x0e35,0x1e8));var _0x50e3=function(_0x2cc0a5,_0x10a20e){_0x2cc0a5=_0x2cc0a5-0x0;var _0x5aca1e=_0x0e35[_0x2cc0a5];return _0x5aca1e;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x50e3('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x50e3('0x1'),'afterUpdate':_0x50e3('0x2'),'afterDestroy':_0x50e3('0x3')};function emitEvent(_0xe8feac){return function(_0x2e99cf,_0x4ac2ad,_0x5ad0c3){UserVoiceQueueRtEvents[_0x50e3('0x4')](_0xe8feac+':'+_0x2e99cf['id'],_0x2e99cf);UserVoiceQueueRtEvents[_0x50e3('0x4')](_0xe8feac,_0x2e99cf);_0x5ad0c3(null);};}for(var e in events){if(events[_0x50e3('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x50e3('0x6')](e,emitEvent(event));}}module[_0x50e3('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x09cb=['hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','remove','emit'];(function(_0x48dbcf,_0x737191){var _0x5a4184=function(_0x131774){while(--_0x131774){_0x48dbcf['push'](_0x48dbcf['shift']());}};_0x5a4184(++_0x737191);}(_0x09cb,0x162));var _0xb09c=function(_0x532e92,_0x408a68){_0x532e92=_0x532e92-0x0;var _0x3ac2ce=_0x09cb[_0x532e92];return _0x3ac2ce;};'use strict';var EventEmitter=require(_0xb09c('0x0'));var UserVoiceQueueRt=require(_0xb09c('0x1'))['db'][_0xb09c('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb09c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb09c('0x4')};function emitEvent(_0x4ac6e5){return function(_0xe3bc78,_0x5e4f56,_0x206bc5){UserVoiceQueueRtEvents[_0xb09c('0x5')](_0x4ac6e5+':'+_0xe3bc78['id'],_0xe3bc78);UserVoiceQueueRtEvents[_0xb09c('0x5')](_0x4ac6e5,_0xe3bc78);_0x206bc5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xb09c('0x6')](e,emitEvent(event));}}module[_0xb09c('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 5bd103f..de016f6 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 _0x076d=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','util'];(function(_0x461264,_0x8daed2){var _0x547105=function(_0x385785){while(--_0x385785){_0x461264['push'](_0x461264['shift']());}};_0x547105(++_0x8daed2);}(_0x076d,0x1c6));var _0xd076=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x076d[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xd076('0x0'));var util=require(_0xd076('0x1'));var logger=require(_0xd076('0x2'))('api');var moment=require(_0xd076('0x3'));var BPromise=require('bluebird');var rp=require(_0xd076('0x4'));var fs=require('fs');var path=require(_0xd076('0x5'));var rimraf=require(_0xd076('0x6'));var config=require(_0xd076('0x7'));var attributes=require(_0xd076('0x8'));module[_0xd076('0x9')]=function(_0x5333f0,_0x2c2732){return _0x5333f0[_0xd076('0xa')]('UserVoiceQueueRt',attributes,{'tableName':_0xd076('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fd6=['define','UserVoiceQueueRt','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x28757f,_0x2bf06e){var _0x4411bb=function(_0x185354){while(--_0x185354){_0x28757f['push'](_0x28757f['shift']());}};_0x4411bb(++_0x2bf06e);}(_0x3fd6,0xd1));var _0x63fd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3fd6[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x63fd('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x63fd('0x1'));var BPromise=require(_0x63fd('0x2'));var rp=require(_0x63fd('0x3'));var fs=require('fs');var path=require(_0x63fd('0x4'));var rimraf=require(_0x63fd('0x5'));var config=require(_0x63fd('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x4dbd98,_0x100b3a){return _0x4dbd98[_0x63fd('0x7')](_0x63fd('0x8'),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 9b2f014..3e8c28b 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 _0x5c46=['debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','outboundQueuePauses','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent'];(function(_0x2ffab6,_0x4fa24a){var _0x3ed205=function(_0x13a320){while(--_0x13a320){_0x2ffab6['push'](_0x2ffab6['shift']());}};_0x3ed205(++_0x4fa24a);}(_0x5c46,0x166));var _0x65c4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5c46[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x65c4('0x0'));var util=require(_0x65c4('0x1'));var moment=require(_0x65c4('0x2'));var BPromise=require('bluebird');var rs=require(_0x65c4('0x3'));var fs=require('fs');var Redis=require(_0x65c4('0x4'));var db=require(_0x65c4('0x5'))['db'];var utils=require(_0x65c4('0x6'));var logger=require(_0x65c4('0x7'))(_0x65c4('0x8'));var config=require(_0x65c4('0x9'));var jayson=require(_0x65c4('0xa'));var client=jayson['client'][_0x65c4('0xb')]({'port':0x232a});config[_0x65c4('0xc')]=_[_0x65c4('0xd')](config[_0x65c4('0xc')],{'host':_0x65c4('0xe'),'port':0x18eb});var socket=require(_0x65c4('0xf'))(new Redis(config[_0x65c4('0xc')]));require(_0x65c4('0x10'))['register'](socket);function respondWithRpcPromise(_0x3e7025,_0x57f69d,_0x4b73ef){return new BPromise(function(_0x18c4ac,_0x287a83){return client[_0x65c4('0x11')](_0x3e7025,_0x4b73ef)[_0x65c4('0x12')](function(_0x43f055){logger[_0x65c4('0x13')](_0x65c4('0x14'),_0x57f69d,_0x65c4('0x15'));logger[_0x65c4('0x16')](_0x65c4('0x17'),_0x57f69d,_0x65c4('0x15'),JSON['stringify'](_0x43f055));if(_0x43f055[_0x65c4('0x18')]){if(_0x43f055['error'][_0x65c4('0x19')]===0x1f4){logger[_0x65c4('0x18')](_0x65c4('0x14'),_0x57f69d,_0x43f055[_0x65c4('0x18')][_0x65c4('0x1a')]);return _0x287a83(_0x43f055[_0x65c4('0x18')][_0x65c4('0x1a')]);}logger[_0x65c4('0x18')](_0x65c4('0x14'),_0x57f69d,_0x43f055[_0x65c4('0x18')][_0x65c4('0x1a')]);return _0x18c4ac(_0x43f055['error'][_0x65c4('0x1a')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x57f69d,_0x65c4('0x15'));_0x18c4ac(_0x43f055[_0x65c4('0x1b')]['message']);}})[_0x65c4('0x1c')](function(_0x37abe3){logger[_0x65c4('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x57f69d,_0x37abe3);_0x287a83(_0x37abe3);});});}exports[_0x65c4('0x1d')]=function(_0xdc86ac){var _0x309702=this;return new Promise(function(_0x4e2723,_0x25125e){return db[_0x65c4('0x1e')][_0x65c4('0x1f')]({'raw':_0xdc86ac['options']?_0xdc86ac[_0x65c4('0x20')][_0x65c4('0x21')]===undefined?!![]:![]:!![],'where':_0xdc86ac[_0x65c4('0x20')]?_0xdc86ac['options'][_0x65c4('0x22')]||null:null,'attributes':[[db[_0x65c4('0x23')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x65c4('0x24')]('`paused`\x20=\x201,\x201,\x20null'))),_0x65c4('0x25')]]})[_0x65c4('0x12')](function(_0x304e9e){logger[_0x65c4('0x13')](_0x65c4('0x1d'),_0xdc86ac);logger['debug'](_0x65c4('0x1d'),_0xdc86ac,JSON['stringify'](_0x304e9e));_0x4e2723(_0x304e9e);})[_0x65c4('0x1c')](function(_0x361007){logger[_0x65c4('0x18')](_0x65c4('0x1d'),_0x361007['message'],_0xdc86ac);_0x25125e(_0x309702[_0x65c4('0x18')](0x1f4,_0x361007[_0x65c4('0x1a')]));});});}; \ No newline at end of file +var _0x2f41=['COUNT','literal','`paused`\x20=\x201,\x201,\x20null','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','sequelize'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2f41,0x1e0));var _0x12f4=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0x2f41[_0x1af05b];return _0x5be7cc;};'use strict';var _=require(_0x12f4('0x0'));var util=require(_0x12f4('0x1'));var moment=require('moment');var BPromise=require(_0x12f4('0x2'));var rs=require(_0x12f4('0x3'));var fs=require('fs');var Redis=require(_0x12f4('0x4'));var db=require(_0x12f4('0x5'))['db'];var utils=require(_0x12f4('0x6'));var logger=require(_0x12f4('0x7'))('rpc');var config=require(_0x12f4('0x8'));var jayson=require(_0x12f4('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x12f4('0xa')]=_['defaults'](config[_0x12f4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x12f4('0xb'))(new Redis(config[_0x12f4('0xa')]));require(_0x12f4('0xc'))['register'](socket);function respondWithRpcPromise(_0x500e46,_0x1fa317,_0x27c4e6){return new BPromise(function(_0x4fb814,_0x25c89f){return client[_0x12f4('0xd')](_0x500e46,_0x27c4e6)[_0x12f4('0xe')](function(_0x382fcc){logger[_0x12f4('0xf')](_0x12f4('0x10'),_0x1fa317,_0x12f4('0x11'));logger['debug'](_0x12f4('0x12'),_0x1fa317,'request\x20sent',JSON[_0x12f4('0x13')](_0x382fcc));if(_0x382fcc[_0x12f4('0x14')]){if(_0x382fcc['error'][_0x12f4('0x15')]===0x1f4){logger[_0x12f4('0x14')](_0x12f4('0x10'),_0x1fa317,_0x382fcc[_0x12f4('0x14')]['message']);return _0x25c89f(_0x382fcc['error']['message']);}logger[_0x12f4('0x14')](_0x12f4('0x10'),_0x1fa317,_0x382fcc[_0x12f4('0x14')][_0x12f4('0x16')]);return _0x4fb814(_0x382fcc[_0x12f4('0x14')][_0x12f4('0x16')]);}else{logger['info'](_0x12f4('0x10'),_0x1fa317,'request\x20sent');_0x4fb814(_0x382fcc[_0x12f4('0x17')][_0x12f4('0x16')]);}})[_0x12f4('0x18')](function(_0x3dd0fd){logger[_0x12f4('0x14')](_0x12f4('0x10'),_0x1fa317,_0x3dd0fd);_0x25c89f(_0x3dd0fd);});});}exports[_0x12f4('0x19')]=function(_0x672a8f){var _0x3c38a5=this;return new Promise(function(_0x423314,_0x585088){return db['UserVoiceQueueRt'][_0x12f4('0x1a')]({'raw':_0x672a8f[_0x12f4('0x1b')]?_0x672a8f['options'][_0x12f4('0x1c')]===undefined?!![]:![]:!![],'where':_0x672a8f[_0x12f4('0x1b')]?_0x672a8f['options']['where']||null:null,'attributes':[[db[_0x12f4('0x1d')]['fn'](_0x12f4('0x1e'),db[_0x12f4('0x1d')]['fn']('IF',db[_0x12f4('0x1d')][_0x12f4('0x1f')](_0x12f4('0x20')))),'outboundQueuePauses']]})[_0x12f4('0xe')](function(_0x124667){logger[_0x12f4('0xf')](_0x12f4('0x19'),_0x672a8f);logger[_0x12f4('0x21')](_0x12f4('0x19'),_0x672a8f,JSON[_0x12f4('0x13')](_0x124667));_0x423314(_0x124667);})['catch'](function(_0x4708f5){logger[_0x12f4('0x14')](_0x12f4('0x19'),_0x4708f5[_0x12f4('0x16')],_0x672a8f);_0x585088(_0x3c38a5[_0x12f4('0x14')](0x1f4,_0x4708f5[_0x12f4('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index c7c5c48..8c81222 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 _0xbb67=['removeListener','register','userVoiceQueueRt:','save','remove','update','emit'];(function(_0x309d31,_0x6a4e9c){var _0x55a4bf=function(_0x5cb736){while(--_0x5cb736){_0x309d31['push'](_0x309d31['shift']());}};_0x55a4bf(++_0x6a4e9c);}(_0xbb67,0x161));var _0x7bb6=function(_0x427582,_0x266a66){_0x427582=_0x427582-0x0;var _0x32ebe3=_0xbb67[_0x427582];return _0x32ebe3;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x7bb6('0x0'),_0x7bb6('0x1'),_0x7bb6('0x2')];function createListener(_0x35c9ba,_0x2a1dcb){return function(_0x5b8771){_0x2a1dcb[_0x7bb6('0x3')](_0x35c9ba,_0x5b8771);};}function removeListener(_0x2c1ddb,_0x1f527c){return function(){UserVoiceQueueRtEvents[_0x7bb6('0x4')](_0x2c1ddb,_0x1f527c);};}exports[_0x7bb6('0x5')]=function(_0x139b0e){for(var _0x4b5232=0x0,_0x2a059b=events['length'];_0x4b5232<_0x2a059b;_0x4b5232++){var _0x45441a=events[_0x4b5232];var _0x15fb32=createListener(_0x7bb6('0x6')+_0x45441a,_0x139b0e);UserVoiceQueueRtEvents['on'](_0x45441a,_0x15fb32);}}; \ No newline at end of file +var _0x9c48=['save','remove','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9c48,0xa1));var _0x89c4=function(_0x50d69e,_0x735db8){_0x50d69e=_0x50d69e-0x0;var _0x416bba=_0x9c48[_0x50d69e];return _0x416bba;};'use strict';var UserVoiceQueueRtEvents=require(_0x89c4('0x0'));var events=[_0x89c4('0x1'),_0x89c4('0x2'),'update'];function createListener(_0x1f19e7,_0x203bbb){return function(_0xa13da){_0x203bbb['emit'](_0x1f19e7,_0xa13da);};}function removeListener(_0x4f56bd,_0x3da4d5){return function(){UserVoiceQueueRtEvents[_0x89c4('0x3')](_0x4f56bd,_0x3da4d5);};}exports['register']=function(_0x8ada63){for(var _0x3585d7=0x0,_0x1d0303=events[_0x89c4('0x4')];_0x3585d7<_0x1d0303;_0x3585d7++){var _0x30cdf1=events[_0x3585d7];var _0x7faf5=createListener(_0x89c4('0x5')+_0x30cdf1,_0x8ada63);UserVoiceQueueRtEvents['on'](_0x30cdf1,_0x7faf5);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index b721a67..6ed407b 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x33ea96,_0x31c832){var _0x25eab5=function(_0x10cb40){while(--_0x10cb40){_0x33ea96['push'](_0x33ea96['shift']());}};_0x25eab5(++_0x31c832);}(_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(_0xbe3a1c,_0x5d5061){var _0x199764=function(_0x4afdf8){while(--_0x4afdf8){_0xbe3a1c['push'](_0xbe3a1c['shift']());}};_0x199764(++_0x5d5061);}(_0x70e0,0x17b));var _0x070e=function(_0x47edba,_0x49e31c){_0x47edba=_0x47edba-0x0;var _0x3846bb=_0x70e0[_0x47edba];return _0x3846bb;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 42fab83..02d736c 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 _0x7f22=['INTEGER','sequelize'];(function(_0xa4e518,_0x17186f){var _0x10f521=function(_0x28c4ef){while(--_0x28c4ef){_0xa4e518['push'](_0xa4e518['shift']());}};_0x10f521(++_0x17186f);}(_0x7f22,0x1e5));var _0x27f2=function(_0x558e01,_0x120170){_0x558e01=_0x558e01-0x0;var _0x566d27=_0x7f22[_0x558e01];return _0x566d27;};'use strict';var Sequelize=require(_0x27f2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x27f2('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xabe0=['exports','INTEGER','sequelize'];(function(_0x38135c,_0x1da3d7){var _0x3f59f1=function(_0x404587){while(--_0x404587){_0x38135c['push'](_0x38135c['shift']());}};_0x3f59f1(++_0x1da3d7);}(_0xabe0,0x182));var _0x0abe=function(_0x5eeffb,_0x9cc37d){_0x5eeffb=_0x5eeffb-0x0;var _0x2b1010=_0xabe0[_0x5eeffb];return _0x2b1010;};'use strict';var Sequelize=require(_0x0abe('0x0'));module[_0x0abe('0x1')]={'penalty':{'type':Sequelize[_0x0abe('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 18d52fd..5046e3e 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 _0x6f8a=['user_has_whatsapp_queues','lodash','../../config/logger','api','moment','path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue'];(function(_0x106ae5,_0x42fe77){var _0x3c68d8=function(_0x1e91ae){while(--_0x1e91ae){_0x106ae5['push'](_0x106ae5['shift']());}};_0x3c68d8(++_0x42fe77);}(_0x6f8a,0x109));var _0xa6f8=function(_0x40afbd,_0x37f47a){_0x40afbd=_0x40afbd-0x0;var _0x21b2ed=_0x6f8a[_0x40afbd];return _0x21b2ed;};'use strict';var _=require(_0xa6f8('0x0'));var util=require('util');var logger=require(_0xa6f8('0x1'))(_0xa6f8('0x2'));var moment=require(_0xa6f8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6f8('0x4'));var rimraf=require(_0xa6f8('0x5'));var config=require('../../config/environment');var attributes=require(_0xa6f8('0x6'));module[_0xa6f8('0x7')]=function(_0x4fe464,_0x53a23d){return _0x4fe464[_0xa6f8('0x8')](_0xa6f8('0x9'),attributes,{'tableName':_0xa6f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90c0=['UserWhatsappQueue','user_has_whatsapp_queues','util','api','moment','bluebird','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define'];(function(_0x4dea9a,_0x3b3005){var _0x17478e=function(_0xc69f5d){while(--_0xc69f5d){_0x4dea9a['push'](_0x4dea9a['shift']());}};_0x17478e(++_0x3b3005);}(_0x90c0,0x1d6));var _0x090c=function(_0x1b2422,_0x1e98d4){_0x1b2422=_0x1b2422-0x0;var _0x376573=_0x90c0[_0x1b2422];return _0x376573;};'use strict';var _=require('lodash');var util=require(_0x090c('0x0'));var logger=require('../../config/logger')(_0x090c('0x1'));var moment=require(_0x090c('0x2'));var BPromise=require(_0x090c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x090c('0x4'));var rimraf=require(_0x090c('0x5'));var config=require(_0x090c('0x6'));var attributes=require(_0x090c('0x7'));module[_0x090c('0x8')]=function(_0x2dba88,_0x3a6727){return _0x2dba88[_0x090c('0x9')](_0x090c('0xa'),attributes,{'tableName':_0x090c('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 7a12260..70361da 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 _0x9189=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x2d93d4,_0x149172){var _0x44df30=function(_0x22e8d8){while(--_0x22e8d8){_0x2d93d4['push'](_0x2d93d4['shift']());}};_0x44df30(++_0x149172);}(_0x9189,0x141));var _0x9918=function(_0x19a33d,_0x11905d){_0x19a33d=_0x19a33d-0x0;var _0x4ab832=_0x9189[_0x19a33d];return _0x4ab832;};'use strict';var _=require(_0x9918('0x0'));var util=require(_0x9918('0x1'));var moment=require('moment');var BPromise=require(_0x9918('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9918('0x3'));var db=require(_0x9918('0x4'))['db'];var utils=require(_0x9918('0x5'));var logger=require(_0x9918('0x6'))(_0x9918('0x7'));var config=require(_0x9918('0x8'));var jayson=require(_0x9918('0x9'));var client=jayson[_0x9918('0xa')][_0x9918('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16f8c8,_0x1af793,_0x32957d){return new BPromise(function(_0x2d92ec,_0x371e8d){return client[_0x9918('0xc')](_0x16f8c8,_0x32957d)[_0x9918('0xd')](function(_0x247446){logger[_0x9918('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1af793,_0x9918('0xf'));logger['debug'](_0x9918('0x10'),_0x1af793,_0x9918('0xf'),JSON[_0x9918('0x11')](_0x247446));if(_0x247446[_0x9918('0x12')]){if(_0x247446[_0x9918('0x12')]['code']===0x1f4){logger[_0x9918('0x12')](_0x9918('0x13'),_0x1af793,_0x247446[_0x9918('0x12')][_0x9918('0x14')]);return _0x371e8d(_0x247446[_0x9918('0x12')][_0x9918('0x14')]);}logger[_0x9918('0x12')](_0x9918('0x13'),_0x1af793,_0x247446['error']['message']);return _0x2d92ec(_0x247446[_0x9918('0x12')][_0x9918('0x14')]);}else{logger[_0x9918('0xe')](_0x9918('0x13'),_0x1af793,_0x9918('0xf'));_0x2d92ec(_0x247446[_0x9918('0x15')][_0x9918('0x14')]);}})[_0x9918('0x16')](function(_0x3f3984){logger[_0x9918('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1af793,_0x3f3984);_0x371e8d(_0x3f3984);});});} \ No newline at end of file +var _0xcaca=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xcaca,0x15e));var _0xacac=function(_0x12a901,_0x3ed30d){_0x12a901=_0x12a901-0x0;var _0x3be201=_0xcaca[_0x12a901];return _0x3be201;};'use strict';var _=require(_0xacac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xacac('0x1'));var rs=require(_0xacac('0x2'));var fs=require('fs');var Redis=require(_0xacac('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xacac('0x4'));var logger=require(_0xacac('0x5'))('rpc');var config=require(_0xacac('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xacac('0x7')][_0xacac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48b8cf,_0x506bbc,_0x264cff){return new BPromise(function(_0x545423,_0x1a1d86){return client[_0xacac('0x9')](_0x48b8cf,_0x264cff)[_0xacac('0xa')](function(_0x4bb04a){logger[_0xacac('0xb')](_0xacac('0xc'),_0x506bbc,_0xacac('0xd'));logger[_0xacac('0xe')](_0xacac('0xf'),_0x506bbc,_0xacac('0xd'),JSON[_0xacac('0x10')](_0x4bb04a));if(_0x4bb04a[_0xacac('0x11')]){if(_0x4bb04a[_0xacac('0x11')][_0xacac('0x12')]===0x1f4){logger[_0xacac('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x506bbc,_0x4bb04a[_0xacac('0x11')]['message']);return _0x1a1d86(_0x4bb04a[_0xacac('0x11')]['message']);}logger['error'](_0xacac('0xc'),_0x506bbc,_0x4bb04a[_0xacac('0x11')][_0xacac('0x13')]);return _0x545423(_0x4bb04a[_0xacac('0x11')][_0xacac('0x13')]);}else{logger[_0xacac('0xb')](_0xacac('0xc'),_0x506bbc,'request\x20sent');_0x545423(_0x4bb04a[_0xacac('0x14')]['message']);}})[_0xacac('0x15')](function(_0x48d8f8){logger[_0xacac('0x11')](_0xacac('0xc'),_0x506bbc,_0x48d8f8);_0x1a1d86(_0x48d8f8);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 9e64f2f..651faa2 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 _0x3308=['../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','post','create','put','delete','/:id','destroy','connect-timeout','express','Router','fs-extra'];(function(_0x32a35e,_0x719f5f){var _0x2a2e31=function(_0x188c7a){while(--_0x188c7a){_0x32a35e['push'](_0x32a35e['shift']());}};_0x2a2e31(++_0x719f5f);}(_0x3308,0x12e));var _0x8330=function(_0x5cdcb7,_0x405fe6){_0x5cdcb7=_0x5cdcb7-0x0;var _0x17e730=_0x3308[_0x5cdcb7];return _0x17e730;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8330('0x0'));var express=require(_0x8330('0x1'));var router=express[_0x8330('0x2')]();var fs_extra=require(_0x8330('0x3'));var auth=require(_0x8330('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8330('0x5'));var controller=require(_0x8330('0x6'));router[_0x8330('0x7')]('/',auth[_0x8330('0x8')](),controller[_0x8330('0x9')]);router[_0x8330('0x7')]('/:id',auth[_0x8330('0x8')](),controller[_0x8330('0xa')]);router[_0x8330('0xb')]('/',auth['isAuthenticated'](),controller[_0x8330('0xc')]);router[_0x8330('0xd')]('/:id',auth[_0x8330('0x8')](),controller['update']);router[_0x8330('0xe')](_0x8330('0xf'),auth['isAuthenticated'](),controller[_0x8330('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4f99=['update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','post','create','/:id'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x4f99,0x157));var _0x94f9=function(_0x7147f3,_0x20ea82){_0x7147f3=_0x7147f3-0x0;var _0x3e9ace=_0x4f99[_0x7147f3];return _0x3e9ace;};'use strict';var multer=require(_0x94f9('0x0'));var util=require(_0x94f9('0x1'));var path=require('path');var timeout=require(_0x94f9('0x2'));var express=require(_0x94f9('0x3'));var router=express[_0x94f9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x94f9('0x5'));var interaction=require(_0x94f9('0x6'));var config=require('../../config/environment');var controller=require(_0x94f9('0x7'));router[_0x94f9('0x8')]('/',auth[_0x94f9('0x9')](),controller[_0x94f9('0xa')]);router[_0x94f9('0x8')]('/:id',auth[_0x94f9('0x9')](),controller['show']);router[_0x94f9('0xb')]('/',auth['isAuthenticated'](),controller[_0x94f9('0xc')]);router['put'](_0x94f9('0xd'),auth[_0x94f9('0x9')](),controller[_0x94f9('0xe')]);router[_0x94f9('0xf')](_0x94f9('0xd'),auth[_0x94f9('0x9')](),controller[_0x94f9('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 90e4024..f2dcda1 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 _0x15f8=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15f8,0x149));var _0x815f=function(_0x49b3f7,_0x2c77be){_0x49b3f7=_0x49b3f7-0x0;var _0x376642=_0x15f8[_0x49b3f7];return _0x376642;};'use strict';var Sequelize=require(_0x815f('0x0'));module['exports']={'name':{'type':Sequelize[_0x815f('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x815f('0x1')]}}; \ No newline at end of file +var _0x0725=['name','STRING','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0725,0x167));var _0x5072=function(_0x3d9d1d,_0x4f7ac3){_0x3d9d1d=_0x3d9d1d-0x0;var _0x109f25=_0x0725[_0x3d9d1d];return _0x109f25;};'use strict';var Sequelize=require('sequelize');module[_0x5072('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x5072('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5072('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index eb51560..36cb6e1 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 _0x2257=['fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','name','options','Variable','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Variables','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','end','error','stack','send','index','rawAttributes'];(function(_0x3950a8,_0x9a9ea8){var _0x41ebd0=function(_0x3eaeda){while(--_0x3eaeda){_0x3950a8['push'](_0x3950a8['shift']());}};_0x41ebd0(++_0x9a9ea8);}(_0x2257,0xc8));var _0x7225=function(_0x202cf5,_0x5c6374){_0x202cf5=_0x202cf5-0x0;var _0x36eea5=_0x2257[_0x202cf5];return _0x36eea5;};'use strict';var emlformat=require(_0x7225('0x0'));var rimraf=require(_0x7225('0x1'));var zipdir=require(_0x7225('0x2'));var jsonpatch=require(_0x7225('0x3'));var rp=require(_0x7225('0x4'));var moment=require(_0x7225('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7225('0x6'));var util=require(_0x7225('0x7'));var path=require(_0x7225('0x8'));var sox=require(_0x7225('0x9'));var csv=require(_0x7225('0xa'));var ejs=require(_0x7225('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7225('0xc'));var squel=require(_0x7225('0xd'));var crypto=require(_0x7225('0xe'));var jsforce=require(_0x7225('0xf'));var deskjs=require(_0x7225('0x10'));var toCsv=require(_0x7225('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7225('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7225('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7225('0x13'))(_0x7225('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7225('0x15'));var db=require(_0x7225('0x16'))['db'];function respondWithStatusCode(_0x2965a5,_0xf09fba){_0xf09fba=_0xf09fba||0xcc;return function(_0x2c42f8){if(_0x2c42f8){return _0x2965a5['sendStatus'](_0xf09fba);}return _0x2965a5[_0x7225('0x17')](_0xf09fba)['end']();};}function respondWithResult(_0x3b765b,_0x3b338a){_0x3b338a=_0x3b338a||0xc8;return function(_0x3add31){if(_0x3add31){return _0x3b765b['status'](_0x3b338a)[_0x7225('0x18')](_0x3add31);}};}function respondWithFilteredResult(_0x2f46c4,_0x12fe87){return function(_0x23d64f){if(_0x23d64f){var _0x341b0f=typeof _0x12fe87[_0x7225('0x19')]===_0x7225('0x1a')&&typeof _0x12fe87[_0x7225('0x1b')]===_0x7225('0x1a');var _0x35abad=_0x23d64f[_0x7225('0x1c')];var _0x3ba7ac=_0x341b0f?0x0:_0x12fe87[_0x7225('0x19')];var _0x3ff049=_0x341b0f?_0x23d64f[_0x7225('0x1c')]:_0x12fe87[_0x7225('0x19')]+_0x12fe87[_0x7225('0x1b')];var _0x2ec14e;if(_0x3ff049>=_0x35abad){_0x3ff049=_0x35abad;_0x2ec14e=0xc8;}else{_0x2ec14e=0xce;}_0x2f46c4[_0x7225('0x17')](_0x2ec14e);return _0x2f46c4[_0x7225('0x1d')](_0x7225('0x1e'),_0x3ba7ac+'-'+_0x3ff049+'/'+_0x35abad)['json'](_0x23d64f);}return null;};}function patchUpdates(_0x50cf12){return function(_0x5607a9){try{jsonpatch['apply'](_0x5607a9,_0x50cf12,!![]);}catch(_0x5d9dc4){return BPromise[_0x7225('0x1f')](_0x5d9dc4);}return _0x5607a9[_0x7225('0x20')]();};}function saveUpdates(_0x11e1e7,_0x2526c8){return function(_0x35e555){if(_0x35e555){return _0x35e555[_0x7225('0x21')](_0x11e1e7)[_0x7225('0x22')](function(_0x248596){return _0x248596;});}return null;};}function removeEntity(_0x2d899c,_0x2d79d8){return function(_0x564c31){if(_0x564c31){return _0x564c31[_0x7225('0x23')]()['then'](function(){var _0x18b82b=_0x564c31[_0x7225('0x24')]({'plain':!![]});var _0x259049='Variables';return db['UserProfileResource']['destroy']({'where':{'type':_0x259049,'resourceId':_0x18b82b['id']}})[_0x7225('0x22')](function(){return _0x564c31;});})['then'](function(){_0x2d899c[_0x7225('0x17')](0xcc)[_0x7225('0x25')]();});}};}function handleEntityNotFound(_0x353a18,_0x2a7dbe){return function(_0x3c494a){if(!_0x3c494a){_0x353a18['sendStatus'](0x194);}return _0x3c494a;};}function handleError(_0x42d72f,_0x1e7533){_0x1e7533=_0x1e7533||0x1f4;return function(_0x154dfd){logger[_0x7225('0x26')](_0x154dfd[_0x7225('0x27')]);if(_0x154dfd['name']){delete _0x154dfd['name'];}_0x42d72f[_0x7225('0x17')](_0x1e7533)[_0x7225('0x28')](_0x154dfd);};}exports[_0x7225('0x29')]=function(_0x3f92c5,_0x346950){var _0x22b8c1={},_0x311436={},_0x37b2a9={'count':0x0,'rows':[]};var _0x3c9d63=_['map'](db['Variable'][_0x7225('0x2a')],function(_0x4ae216){return{'name':_0x4ae216[_0x7225('0x2b')],'type':_0x4ae216[_0x7225('0x2c')]['key']};});_0x311436[_0x7225('0x2d')]=_[_0x7225('0x2e')](_0x3c9d63,'name');_0x311436[_0x7225('0x2f')]=_[_0x7225('0x30')](_0x3f92c5[_0x7225('0x2f')]);_0x311436[_0x7225('0x31')]=_['intersection'](_0x311436[_0x7225('0x2d')],_0x311436[_0x7225('0x2f')]);_0x22b8c1[_0x7225('0x32')]=_[_0x7225('0x33')](_0x311436[_0x7225('0x2d')],qs[_0x7225('0x34')](_0x3f92c5[_0x7225('0x2f')][_0x7225('0x34')]));_0x22b8c1['attributes']=_0x22b8c1[_0x7225('0x32')][_0x7225('0x35')]?_0x22b8c1[_0x7225('0x32')]:_0x311436[_0x7225('0x2d')];if(!_0x3f92c5[_0x7225('0x2f')][_0x7225('0x36')](_0x7225('0x37'))){_0x22b8c1[_0x7225('0x1b')]=qs[_0x7225('0x1b')](_0x3f92c5[_0x7225('0x2f')][_0x7225('0x1b')]);_0x22b8c1[_0x7225('0x19')]=qs[_0x7225('0x19')](_0x3f92c5['query']['offset']);}_0x22b8c1[_0x7225('0x38')]=qs['sort'](_0x3f92c5[_0x7225('0x2f')]['sort']);_0x22b8c1['where']=qs[_0x7225('0x31')](_[_0x7225('0x39')](_0x3f92c5['query'],_0x311436['filters']),_0x3c9d63);if(_0x3f92c5[_0x7225('0x2f')][_0x7225('0x3a')]){_0x22b8c1[_0x7225('0x3b')]=_[_0x7225('0x3c')](_0x22b8c1[_0x7225('0x3b')],{'$or':_[_0x7225('0x2e')](_0x3c9d63,function(_0x42b4f8){if(_0x42b4f8[_0x7225('0x2c')]!==_0x7225('0x3d')){var _0x29bcf0={};_0x29bcf0[_0x42b4f8[_0x7225('0x3e')]]={'$like':'%'+_0x3f92c5['query'][_0x7225('0x3a')]+'%'};return _0x29bcf0;}})});}_0x22b8c1=_[_0x7225('0x3c')]({},_0x22b8c1,_0x3f92c5[_0x7225('0x3f')]);var _0x34cdd4={'where':_0x22b8c1['where']};return db[_0x7225('0x40')][_0x7225('0x1c')](_0x34cdd4)['then'](function(_0x3bbadb){_0x37b2a9[_0x7225('0x1c')]=_0x3bbadb;if(_0x3f92c5[_0x7225('0x2f')]['includeAll']){_0x22b8c1[_0x7225('0x41')]=[{'all':!![]}];}return db[_0x7225('0x40')][_0x7225('0x42')](_0x22b8c1);})[_0x7225('0x22')](function(_0x300b5f){_0x37b2a9[_0x7225('0x43')]=_0x300b5f;return _0x37b2a9;})[_0x7225('0x22')](respondWithFilteredResult(_0x346950,_0x22b8c1))[_0x7225('0x44')](handleError(_0x346950,null));};exports[_0x7225('0x45')]=function(_0x2bd624,_0x3ccea1){var _0x43aa30={'raw':!![],'where':{'id':_0x2bd624[_0x7225('0x46')]['id']}},_0x187e25={};_0x187e25['model']=_['keys'](db[_0x7225('0x40')][_0x7225('0x2a')]);_0x187e25[_0x7225('0x2f')]=_['keys'](_0x2bd624[_0x7225('0x2f')]);_0x187e25[_0x7225('0x31')]=_[_0x7225('0x33')](_0x187e25[_0x7225('0x2d')],_0x187e25['query']);_0x43aa30[_0x7225('0x32')]=_['intersection'](_0x187e25[_0x7225('0x2d')],qs[_0x7225('0x34')](_0x2bd624[_0x7225('0x2f')]['fields']));_0x43aa30[_0x7225('0x32')]=_0x43aa30[_0x7225('0x32')][_0x7225('0x35')]?_0x43aa30[_0x7225('0x32')]:_0x187e25['model'];if(_0x2bd624[_0x7225('0x2f')]['includeAll']){_0x43aa30[_0x7225('0x41')]=[{'all':!![]}];}_0x43aa30=_['merge']({},_0x43aa30,_0x2bd624[_0x7225('0x3f')]);return db[_0x7225('0x40')][_0x7225('0x47')](_0x43aa30)['then'](handleEntityNotFound(_0x3ccea1,null))['then'](respondWithResult(_0x3ccea1,null))[_0x7225('0x44')](handleError(_0x3ccea1,null));};exports[_0x7225('0x48')]=function(_0x1b58f1,_0x177306){return db[_0x7225('0x40')][_0x7225('0x48')](_0x1b58f1['body'],{})[_0x7225('0x22')](function(_0x98958d){var _0xb3f8dd=_0x1b58f1[_0x7225('0x49')]['get']({'plain':!![]});if(!_0xb3f8dd)throw new Error(_0x7225('0x4a'));if(_0xb3f8dd['role']===_0x7225('0x49')){var _0x4c4938=_0x98958d[_0x7225('0x24')]({'plain':!![]});var _0x284a24=_0x7225('0x4b');return db[_0x7225('0x4c')][_0x7225('0x47')]({'where':{'name':_0x284a24,'userProfileId':_0xb3f8dd[_0x7225('0x4d')]},'raw':!![]})['then'](function(_0x55aa66){if(_0x55aa66&&_0x55aa66[_0x7225('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c4938['name'],'resourceId':_0x4c4938['id'],'type':_0x55aa66[_0x7225('0x3e')],'sectionId':_0x55aa66['id']},{})[_0x7225('0x22')](function(){return _0x98958d;});}else{return _0x98958d;}})['catch'](function(_0x4dfb08){logger[_0x7225('0x26')](_0x7225('0x4f'),_0x4dfb08);throw _0x4dfb08;});}return _0x98958d;})[_0x7225('0x22')](respondWithResult(_0x177306,0xc9))[_0x7225('0x44')](handleError(_0x177306,null));};exports[_0x7225('0x21')]=function(_0x24893a,_0x2cb967){if(_0x24893a[_0x7225('0x50')]['id']){delete _0x24893a[_0x7225('0x50')]['id'];}return db['Variable'][_0x7225('0x47')]({'where':{'id':_0x24893a[_0x7225('0x46')]['id']}})[_0x7225('0x22')](handleEntityNotFound(_0x2cb967,null))['then'](saveUpdates(_0x24893a[_0x7225('0x50')],null))[_0x7225('0x22')](respondWithResult(_0x2cb967,null))[_0x7225('0x44')](handleError(_0x2cb967,null));};exports[_0x7225('0x23')]=function(_0xd587d4,_0x505d3b){return db['Variable']['find']({'where':{'id':_0xd587d4[_0x7225('0x46')]['id']}})[_0x7225('0x22')](handleEntityNotFound(_0x505d3b,null))[_0x7225('0x22')](removeEntity(_0x505d3b,null))[_0x7225('0x44')](handleError(_0x505d3b,null));}; \ No newline at end of file +var _0xaab8=['params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','fast-json-patch','request-promise','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','get','Variables','error','stack','send','index','map','Variable','rawAttributes','fieldName','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x58ea70,_0x4d8943){var _0x312ca1=function(_0x428e04){while(--_0x428e04){_0x58ea70['push'](_0x58ea70['shift']());}};_0x312ca1(++_0x4d8943);}(_0xaab8,0x1c9));var _0x8aab=function(_0x22447b,_0x975c4a){_0x22447b=_0x22447b-0x0;var _0x262aa5=_0xaab8[_0x22447b];return _0x262aa5;};'use strict';var emlformat=require(_0x8aab('0x0'));var rimraf=require(_0x8aab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8aab('0x2'));var rp=require(_0x8aab('0x3'));var moment=require(_0x8aab('0x4'));var BPromise=require(_0x8aab('0x5'));var Mustache=require(_0x8aab('0x6'));var util=require('util');var path=require(_0x8aab('0x7'));var sox=require(_0x8aab('0x8'));var csv=require(_0x8aab('0x9'));var ejs=require(_0x8aab('0xa'));var fs=require('fs');var fs_extra=require(_0x8aab('0xb'));var _=require(_0x8aab('0xc'));var squel=require(_0x8aab('0xd'));var crypto=require(_0x8aab('0xe'));var jsforce=require(_0x8aab('0xf'));var deskjs=require(_0x8aab('0x10'));var toCsv=require(_0x8aab('0x9'));var querystring=require(_0x8aab('0x11'));var Papa=require('papaparse');var Redis=require(_0x8aab('0x12'));var authService=require(_0x8aab('0x13'));var qs=require(_0x8aab('0x14'));var as=require(_0x8aab('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8aab('0x16'))(_0x8aab('0x17'));var utils=require(_0x8aab('0x18'));var config=require(_0x8aab('0x19'));var licenseUtil=require(_0x8aab('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x427da8,_0x5be831){_0x5be831=_0x5be831||0xcc;return function(_0x1f92df){if(_0x1f92df){return _0x427da8[_0x8aab('0x1b')](_0x5be831);}return _0x427da8[_0x8aab('0x1c')](_0x5be831)[_0x8aab('0x1d')]();};}function respondWithResult(_0x3c3565,_0x53765b){_0x53765b=_0x53765b||0xc8;return function(_0x2962fe){if(_0x2962fe){return _0x3c3565[_0x8aab('0x1c')](_0x53765b)[_0x8aab('0x1e')](_0x2962fe);}};}function respondWithFilteredResult(_0x1db8d9,_0x17e5c1){return function(_0x26f409){if(_0x26f409){var _0x32d1d4=typeof _0x17e5c1[_0x8aab('0x1f')]==='undefined'&&typeof _0x17e5c1[_0x8aab('0x20')]==='undefined';var _0x48c071=_0x26f409[_0x8aab('0x21')];var _0x1a5619=_0x32d1d4?0x0:_0x17e5c1[_0x8aab('0x1f')];var _0x5f4315=_0x32d1d4?_0x26f409[_0x8aab('0x21')]:_0x17e5c1[_0x8aab('0x1f')]+_0x17e5c1[_0x8aab('0x20')];var _0x294793;if(_0x5f4315>=_0x48c071){_0x5f4315=_0x48c071;_0x294793=0xc8;}else{_0x294793=0xce;}_0x1db8d9['status'](_0x294793);return _0x1db8d9[_0x8aab('0x22')](_0x8aab('0x23'),_0x1a5619+'-'+_0x5f4315+'/'+_0x48c071)[_0x8aab('0x1e')](_0x26f409);}return null;};}function patchUpdates(_0x2d272f){return function(_0x279cbe){try{jsonpatch[_0x8aab('0x24')](_0x279cbe,_0x2d272f,!![]);}catch(_0x33ce86){return BPromise[_0x8aab('0x25')](_0x33ce86);}return _0x279cbe['save']();};}function saveUpdates(_0x28ba72,_0xf8c921){return function(_0xe2ea1f){if(_0xe2ea1f){return _0xe2ea1f[_0x8aab('0x26')](_0x28ba72)[_0x8aab('0x27')](function(_0x5a0017){return _0x5a0017;});}return null;};}function removeEntity(_0x38b357,_0xe2035f){return function(_0x588725){if(_0x588725){return _0x588725['destroy']()[_0x8aab('0x27')](function(){var _0x32796c=_0x588725[_0x8aab('0x28')]({'plain':!![]});var _0x4e0d80=_0x8aab('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x4e0d80,'resourceId':_0x32796c['id']}})['then'](function(){return _0x588725;});})['then'](function(){_0x38b357[_0x8aab('0x1c')](0xcc)[_0x8aab('0x1d')]();});}};}function handleEntityNotFound(_0x26cb76,_0x253bae){return function(_0x124e2f){if(!_0x124e2f){_0x26cb76[_0x8aab('0x1b')](0x194);}return _0x124e2f;};}function handleError(_0x32796f,_0x3899d8){_0x3899d8=_0x3899d8||0x1f4;return function(_0xf742f4){logger[_0x8aab('0x2a')](_0xf742f4[_0x8aab('0x2b')]);if(_0xf742f4['name']){delete _0xf742f4['name'];}_0x32796f[_0x8aab('0x1c')](_0x3899d8)[_0x8aab('0x2c')](_0xf742f4);};}exports[_0x8aab('0x2d')]=function(_0xabe73a,_0x55b16b){var _0x20e40f={},_0x40b05a={},_0x3b1134={'count':0x0,'rows':[]};var _0x15c984=_[_0x8aab('0x2e')](db[_0x8aab('0x2f')][_0x8aab('0x30')],function(_0x517eb3){return{'name':_0x517eb3[_0x8aab('0x31')],'type':_0x517eb3['type'][_0x8aab('0x32')]};});_0x40b05a[_0x8aab('0x33')]=_[_0x8aab('0x2e')](_0x15c984,_0x8aab('0x34'));_0x40b05a[_0x8aab('0x35')]=_[_0x8aab('0x36')](_0xabe73a[_0x8aab('0x35')]);_0x40b05a[_0x8aab('0x37')]=_['intersection'](_0x40b05a[_0x8aab('0x33')],_0x40b05a[_0x8aab('0x35')]);_0x20e40f[_0x8aab('0x38')]=_[_0x8aab('0x39')](_0x40b05a[_0x8aab('0x33')],qs[_0x8aab('0x3a')](_0xabe73a[_0x8aab('0x35')][_0x8aab('0x3a')]));_0x20e40f[_0x8aab('0x38')]=_0x20e40f[_0x8aab('0x38')][_0x8aab('0x3b')]?_0x20e40f[_0x8aab('0x38')]:_0x40b05a['model'];if(!_0xabe73a[_0x8aab('0x35')][_0x8aab('0x3c')](_0x8aab('0x3d'))){_0x20e40f[_0x8aab('0x20')]=qs[_0x8aab('0x20')](_0xabe73a[_0x8aab('0x35')]['limit']);_0x20e40f[_0x8aab('0x1f')]=qs[_0x8aab('0x1f')](_0xabe73a[_0x8aab('0x35')]['offset']);}_0x20e40f[_0x8aab('0x3e')]=qs[_0x8aab('0x3f')](_0xabe73a[_0x8aab('0x35')][_0x8aab('0x3f')]);_0x20e40f[_0x8aab('0x40')]=qs[_0x8aab('0x37')](_[_0x8aab('0x41')](_0xabe73a[_0x8aab('0x35')],_0x40b05a[_0x8aab('0x37')]),_0x15c984);if(_0xabe73a[_0x8aab('0x35')][_0x8aab('0x42')]){_0x20e40f[_0x8aab('0x40')]=_[_0x8aab('0x43')](_0x20e40f['where'],{'$or':_['map'](_0x15c984,function(_0x593ef8){if(_0x593ef8[_0x8aab('0x44')]!==_0x8aab('0x45')){var _0x12db12={};_0x12db12[_0x593ef8['name']]={'$like':'%'+_0xabe73a[_0x8aab('0x35')][_0x8aab('0x42')]+'%'};return _0x12db12;}})});}_0x20e40f=_[_0x8aab('0x43')]({},_0x20e40f,_0xabe73a[_0x8aab('0x46')]);var _0x1dc63b={'where':_0x20e40f['where']};return db['Variable'][_0x8aab('0x21')](_0x1dc63b)['then'](function(_0x42de54){_0x3b1134[_0x8aab('0x21')]=_0x42de54;if(_0xabe73a[_0x8aab('0x35')][_0x8aab('0x47')]){_0x20e40f[_0x8aab('0x48')]=[{'all':!![]}];}return db[_0x8aab('0x2f')][_0x8aab('0x49')](_0x20e40f);})[_0x8aab('0x27')](function(_0x30ac3a){_0x3b1134[_0x8aab('0x4a')]=_0x30ac3a;return _0x3b1134;})['then'](respondWithFilteredResult(_0x55b16b,_0x20e40f))[_0x8aab('0x4b')](handleError(_0x55b16b,null));};exports[_0x8aab('0x4c')]=function(_0x18f668,_0x303395){var _0x27343a={'raw':!![],'where':{'id':_0x18f668[_0x8aab('0x4d')]['id']}},_0x2326e2={};_0x2326e2[_0x8aab('0x33')]=_[_0x8aab('0x36')](db[_0x8aab('0x2f')][_0x8aab('0x30')]);_0x2326e2[_0x8aab('0x35')]=_['keys'](_0x18f668[_0x8aab('0x35')]);_0x2326e2[_0x8aab('0x37')]=_[_0x8aab('0x39')](_0x2326e2['model'],_0x2326e2['query']);_0x27343a[_0x8aab('0x38')]=_[_0x8aab('0x39')](_0x2326e2['model'],qs[_0x8aab('0x3a')](_0x18f668[_0x8aab('0x35')][_0x8aab('0x3a')]));_0x27343a[_0x8aab('0x38')]=_0x27343a[_0x8aab('0x38')][_0x8aab('0x3b')]?_0x27343a[_0x8aab('0x38')]:_0x2326e2[_0x8aab('0x33')];if(_0x18f668['query'][_0x8aab('0x47')]){_0x27343a[_0x8aab('0x48')]=[{'all':!![]}];}_0x27343a=_['merge']({},_0x27343a,_0x18f668[_0x8aab('0x46')]);return db[_0x8aab('0x2f')][_0x8aab('0x4e')](_0x27343a)[_0x8aab('0x27')](handleEntityNotFound(_0x303395,null))[_0x8aab('0x27')](respondWithResult(_0x303395,null))[_0x8aab('0x4b')](handleError(_0x303395,null));};exports['create']=function(_0xbb91,_0x3b456e){return db['Variable'][_0x8aab('0x4f')](_0xbb91[_0x8aab('0x50')],{})['then'](function(_0x37e5cf){var _0x199baa=_0xbb91[_0x8aab('0x51')]['get']({'plain':!![]});if(!_0x199baa)throw new Error(_0x8aab('0x52'));if(_0x199baa[_0x8aab('0x53')]==='user'){var _0x549224=_0x37e5cf[_0x8aab('0x28')]({'plain':!![]});var _0xb2b2bd=_0x8aab('0x29');return db[_0x8aab('0x54')]['find']({'where':{'name':_0xb2b2bd,'userProfileId':_0x199baa['userProfileId']},'raw':!![]})[_0x8aab('0x27')](function(_0x160a23){if(_0x160a23&&_0x160a23[_0x8aab('0x55')]===0x0){return db[_0x8aab('0x56')][_0x8aab('0x4f')]({'name':_0x549224[_0x8aab('0x34')],'resourceId':_0x549224['id'],'type':_0x160a23[_0x8aab('0x34')],'sectionId':_0x160a23['id']},{})[_0x8aab('0x27')](function(){return _0x37e5cf;});}else{return _0x37e5cf;}})['catch'](function(_0x559136){logger[_0x8aab('0x2a')](_0x8aab('0x57'),_0x559136);throw _0x559136;});}return _0x37e5cf;})['then'](respondWithResult(_0x3b456e,0xc9))[_0x8aab('0x4b')](handleError(_0x3b456e,null));};exports[_0x8aab('0x26')]=function(_0x5ad0b1,_0x32cd40){if(_0x5ad0b1[_0x8aab('0x50')]['id']){delete _0x5ad0b1[_0x8aab('0x50')]['id'];}return db['Variable'][_0x8aab('0x4e')]({'where':{'id':_0x5ad0b1[_0x8aab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x32cd40,null))[_0x8aab('0x27')](saveUpdates(_0x5ad0b1[_0x8aab('0x50')],null))[_0x8aab('0x27')](respondWithResult(_0x32cd40,null))[_0x8aab('0x4b')](handleError(_0x32cd40,null));};exports[_0x8aab('0x58')]=function(_0x1c3e19,_0x377e1c){return db[_0x8aab('0x2f')][_0x8aab('0x4e')]({'where':{'id':_0x1c3e19[_0x8aab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x377e1c,null))[_0x8aab('0x27')](removeEntity(_0x377e1c,null))[_0x8aab('0x4b')](handleError(_0x377e1c,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 6d1b733..9a13f33 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 _0xa94b=['lodash','../../config/logger','moment','request-promise','../../config/environment','./variable.attributes','exports','define','tools_variables'];(function(_0x11caab,_0x5c9ae7){var _0x17cdde=function(_0x423ff4){while(--_0x423ff4){_0x11caab['push'](_0x11caab['shift']());}};_0x17cdde(++_0x5c9ae7);}(_0xa94b,0x90));var _0xba94=function(_0x18e9a5,_0x2f941b){_0x18e9a5=_0x18e9a5-0x0;var _0x279bd8=_0xa94b[_0x18e9a5];return _0x279bd8;};'use strict';var _=require(_0xba94('0x0'));var util=require('util');var logger=require(_0xba94('0x1'))('api');var moment=require(_0xba94('0x2'));var BPromise=require('bluebird');var rp=require(_0xba94('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xba94('0x4'));var attributes=require(_0xba94('0x5'));module[_0xba94('0x6')]=function(_0x19c6dd,_0x2c308e){return _0x19c6dd[_0xba94('0x7')]('Variable',attributes,{'tableName':_0xba94('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe88d=['./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x40583f,_0x97213b){var _0xead80b=function(_0x258943){while(--_0x258943){_0x40583f['push'](_0x40583f['shift']());}};_0xead80b(++_0x97213b);}(_0xe88d,0x71));var _0xde88=function(_0xf10840,_0xad3916){_0xf10840=_0xf10840-0x0;var _0x1fdf7e=_0xe88d[_0xf10840];return _0x1fdf7e;};'use strict';var _=require(_0xde88('0x0'));var util=require('util');var logger=require(_0xde88('0x1'))('api');var moment=require('moment');var BPromise=require(_0xde88('0x2'));var rp=require(_0xde88('0x3'));var fs=require('fs');var path=require(_0xde88('0x4'));var rimraf=require(_0xde88('0x5'));var config=require(_0xde88('0x6'));var attributes=require(_0xde88('0x7'));module[_0xde88('0x8')]=function(_0x52c2bb,_0x123f7d){return _0x52c2bb[_0xde88('0x9')](_0xde88('0xa'),attributes,{'tableName':_0xde88('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 0493742..7bdd1d2 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x186b0e,_0x57b796){var _0x1f69b1=function(_0x184936){while(--_0x184936){_0x186b0e['push'](_0x186b0e['shift']());}};_0x1f69b1(++_0x57b796);}(_0xe14b,0x93));var _0xbe14=function(_0x8a48b4,_0x542906){_0x8a48b4=_0x8a48b4-0x0;var _0x5e95ac=_0xe14b[_0x8a48b4];return _0x5e95ac;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file +var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x2cdbbb,_0x570b6e){var _0x237bc1=function(_0x3fd851){while(--_0x3fd851){_0x2cdbbb['push'](_0x2cdbbb['shift']());}};_0x237bc1(++_0x570b6e);}(_0x6aa7,0x178));var _0x76aa=function(_0x16e940,_0x469bc8){_0x16e940=_0x16e940-0x0;var _0x26f3ef=_0x6aa7[_0x16e940];return _0x26f3ef;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 8060edf..a14a9d7 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 _0xc0c9=['reset','/pull','/restart','restart','/migrations','migrations','express','Router','./version.controller','index','get','/fetch','isAuthenticated','fetch','/reset','canUpdate'];(function(_0x1e191a,_0x547422){var _0xdd2950=function(_0x15731a){while(--_0x15731a){_0x1e191a['push'](_0x1e191a['shift']());}};_0xdd2950(++_0x547422);}(_0xc0c9,0x66));var _0x9c0c=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xc0c9[_0x297fd3];return _0x2af381;};'use strict';var express=require(_0x9c0c('0x0'));var router=express[_0x9c0c('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x9c0c('0x2'));router['get']('/',controller[_0x9c0c('0x3')]);router[_0x9c0c('0x4')](_0x9c0c('0x5'),auth[_0x9c0c('0x6')](),auth['canUpdate'](),controller[_0x9c0c('0x7')]);router['get'](_0x9c0c('0x8'),auth[_0x9c0c('0x6')](),auth[_0x9c0c('0x9')](),controller[_0x9c0c('0xa')]);router['get'](_0x9c0c('0xb'),auth[_0x9c0c('0x6')](),auth[_0x9c0c('0x9')](),controller['pull']);router[_0x9c0c('0x4')](_0x9c0c('0xc'),auth['isAuthenticated'](),controller[_0x9c0c('0xd')]);router[_0x9c0c('0x4')](_0x9c0c('0xe'),controller[_0x9c0c('0xf')]);module['exports']=router; \ No newline at end of file +var _0x5e6b=['Router','../../components/auth/service','./version.controller','get','index','canUpdate','fetch','/reset','reset','/pull','isAuthenticated','pull','/restart','restart','migrations','exports','express'];(function(_0x166a17,_0x2472a9){var _0x383643=function(_0x1b3666){while(--_0x1b3666){_0x166a17['push'](_0x166a17['shift']());}};_0x383643(++_0x2472a9);}(_0x5e6b,0x1ca));var _0xb5e6=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0x5e6b[_0x34ad72];return _0x5c9aa8;};'use strict';var express=require(_0xb5e6('0x0'));var router=express[_0xb5e6('0x1')]();var auth=require(_0xb5e6('0x2'));var controller=require(_0xb5e6('0x3'));router[_0xb5e6('0x4')]('/',controller[_0xb5e6('0x5')]);router[_0xb5e6('0x4')]('/fetch',auth['isAuthenticated'](),auth[_0xb5e6('0x6')](),controller[_0xb5e6('0x7')]);router[_0xb5e6('0x4')](_0xb5e6('0x8'),auth['isAuthenticated'](),auth[_0xb5e6('0x6')](),controller[_0xb5e6('0x9')]);router[_0xb5e6('0x4')](_0xb5e6('0xa'),auth[_0xb5e6('0xb')](),auth['canUpdate'](),controller[_0xb5e6('0xc')]);router['get'](_0xb5e6('0xd'),auth[_0xb5e6('0xb')](),controller[_0xb5e6('0xe')]);router[_0xb5e6('0x4')]('/migrations',controller[_0xb5e6('0xf')]);module[_0xb5e6('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 6dbc4a6..13e1e45 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 _0xf539=['error','json','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','catch','migrations','readdirSync','join','server','length','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','origin','master'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf539,0x19a));var _0x9f53=function(_0x53cd26,_0x2da83d){_0x53cd26=_0x53cd26-0x0;var _0x1069cb=_0xf539[_0x53cd26];return _0x1069cb;};'use strict';var Umzug=require(_0x9f53('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x9f53('0x1'));var pkginfo=require(_0x9f53('0x2'))(module,_0x9f53('0x3'));var compareVersions=require(_0x9f53('0x4'));var exec=require(_0x9f53('0x5'))[_0x9f53('0x6')];var db=require('../../mysqldb')['db'];var config=require(_0x9f53('0x7'));var pm2=require('../../config/pm2');var logger=require(_0x9f53('0x8'))(_0x9f53('0x9'));var git=require(_0x9f53('0xa'))(config[_0x9f53('0xb')]);exports[_0x9f53('0xc')]=function(_0x21f959,_0x59c4d0){var _0x1ce952={'current':module[_0x9f53('0xd')][_0x9f53('0x3')],'phonebar':0x2};if(_0x21f959[_0x9f53('0xe')]&&_0x21f959[_0x9f53('0xe')][_0x9f53('0xf')]){return git[_0x9f53('0x10')]()[_0x9f53('0x11')](function(_0x3017f9,_0x263918){_0x1ce952[_0x9f53('0xf')]=(_0x3017f9?module['exports'][_0x9f53('0x3')]:_0x263918[_0x9f53('0xf')])||_0x9f53('0x12');return _0x59c4d0[_0x9f53('0x13')](0xc8)['json'](_0x1ce952);});}else{return _0x59c4d0[_0x9f53('0x13')](0xc8)['json'](_0x1ce952);}};exports[_0x9f53('0x10')]=function(_0x86819f,_0x30aa5d){return git[_0x9f53('0x10')]([_0x9f53('0x14'),_0x9f53('0x15')],function(_0x5010b9){if(_0x5010b9){logger[_0x9f53('0x16')](_0x5010b9);return _0x30aa5d[_0x9f53('0x13')](0x1f4)[_0x9f53('0x17')](_0x5010b9);}logger[_0x9f53('0x18')](_0x9f53('0x19'));return _0x30aa5d[_0x9f53('0x13')](0xc8)[_0x9f53('0x17')]({'output':_0x9f53('0x1a')});});};exports['reset']=function(_0x5325a1,_0x1dd23a){return git[_0x9f53('0x1b')]([_0x9f53('0x1c'),_0x9f53('0x1d')],function(_0x340bd2){if(_0x340bd2){logger[_0x9f53('0x16')](_0x340bd2);return _0x1dd23a['status'](0x1f4)[_0x9f53('0x17')](_0x340bd2);}logger[_0x9f53('0x18')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x1dd23a[_0x9f53('0x13')](0xc8)[_0x9f53('0x17')]({'output':_0x9f53('0x1e')});});};exports[_0x9f53('0x1f')]=function(_0x80b107,_0x31787f){exec(_0x9f53('0x20'),function(_0x1b64ad,_0x1bd5e8,_0x2fb6ab){logger[_0x9f53('0x18')](_0x1bd5e8);logger[_0x9f53('0x18')](_0x2fb6ab);if(_0x1b64ad){logger['error'](_0x1b64ad);return _0x31787f[_0x9f53('0x13')](0x1f4)[_0x9f53('0x17')](_0x1b64ad);}return _0x31787f['status'](0xc8)['json']({'output':_0x1bd5e8});});};exports[_0x9f53('0x21')]=function(_0x5ba388,_0x4cff03){return pm2[_0x9f53('0x21')](_0x9f53('0x22'))[_0x9f53('0x23')](function(_0x3bc65e){logger[_0x9f53('0x18')]('pm2\x20restart\x20motion\x20%s',_0x3bc65e);return _0x4cff03[_0x9f53('0x13')](0xc8)[_0x9f53('0x17')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x9f53('0x24')](function(_0x3c24f1){logger[_0x9f53('0x16')](_0x3c24f1);return _0x4cff03[_0x9f53('0x13')](0x1f4)[_0x9f53('0x17')](_0x3c24f1);});};exports[_0x9f53('0x25')]=function(_0x5d8da9,_0x54e2a7){var _0x33446f=fs[_0x9f53('0x26')](path[_0x9f53('0x27')](config['root'],_0x9f53('0x28'),_0x9f53('0x25')));var _0x4486ff=[];for(var _0x34ee08=0x0;_0x34ee08<_0x33446f[_0x9f53('0x29')];_0x34ee08++){var _0x49661c=_0x33446f[_0x34ee08]['replace']('.js','');if(compareVersions(module['exports'][_0x9f53('0x3')],_0x49661c)===-0x1){_0x4486ff['push'](_0x49661c);}}if(_0x4486ff[_0x9f53('0x29')]){var _0x2d647c=_0x4486ff['sort'](compareVersions);var _0x56e594=new Umzug({'storage':_0x9f53('0x2a'),'storageOptions':{'model':db[_0x9f53('0x2b')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0x9f53('0x2a')][_0x9f53('0x2c')](),db[_0x9f53('0x2a')][_0x9f53('0x2d')],function(){throw new Error(_0x9f53('0x2e'));}],'path':path[_0x9f53('0x27')](config['root'],_0x9f53('0x28'),_0x9f53('0x25')),'pattern':/\.js$/}});_0x56e594['up']({'migrations':_[_0x9f53('0x2f')](_0x2d647c,function(_0x4ac718){return _0x4ac718+_0x9f53('0x30');})})[_0x9f53('0x23')](function(){return _0x54e2a7[_0x9f53('0x13')](0xc8)[_0x9f53('0x17')]({'output':_0x9f53('0x31')+module[_0x9f53('0xd')][_0x9f53('0x3')]+_0x9f53('0x32')+_[_0x9f53('0x33')](_0x2d647c),'migrations':_[_0x9f53('0x27')](_0x2d647c)});})[_0x9f53('0x24')](function(_0x1dd8a9){if(_0x1dd8a9 instanceof db[_0x9f53('0x2a')][_0x9f53('0x34')]){return _0x54e2a7['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x54e2a7['status'](0x1f4)[_0x9f53('0x17')](_0x1dd8a9);}});}else{return _0x54e2a7[_0x9f53('0x13')](0xc8)[_0x9f53('0x17')]({'output':_0x9f53('0x35')});}}; \ No newline at end of file +var _0xa7ae=['migrations','replace','.js','push','sort','sequelize','getQueryInterface','constructor','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','index','exports','query','latest','fetch','tags','2.0.0','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','root'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa7ae,0x1a6));var _0xea7a=function(_0x297f40,_0x558dc2){_0x297f40=_0x297f40-0x0;var _0x4cd082=_0xa7ae[_0x297f40];return _0x4cd082;};'use strict';var Umzug=require(_0xea7a('0x0'));var path=require(_0xea7a('0x1'));var fs=require('fs');var _=require(_0xea7a('0x2'));var pkginfo=require('pkginfo')(module,_0xea7a('0x3'));var compareVersions=require(_0xea7a('0x4'));var exec=require(_0xea7a('0x5'))[_0xea7a('0x6')];var db=require(_0xea7a('0x7'))['db'];var config=require(_0xea7a('0x8'));var pm2=require(_0xea7a('0x9'));var logger=require(_0xea7a('0xa'))('update');var git=require(_0xea7a('0xb'))(config['root']);exports[_0xea7a('0xc')]=function(_0x3b0182,_0x2c5f24){var _0x28997e={'current':module[_0xea7a('0xd')][_0xea7a('0x3')],'phonebar':0x2};if(_0x3b0182[_0xea7a('0xe')]&&_0x3b0182[_0xea7a('0xe')][_0xea7a('0xf')]){return git[_0xea7a('0x10')]()[_0xea7a('0x11')](function(_0x20c8d0,_0x7e4264){_0x28997e[_0xea7a('0xf')]=(_0x20c8d0?module[_0xea7a('0xd')][_0xea7a('0x3')]:_0x7e4264['latest'])||_0xea7a('0x12');return _0x2c5f24[_0xea7a('0x13')](0xc8)['json'](_0x28997e);});}else{return _0x2c5f24[_0xea7a('0x13')](0xc8)[_0xea7a('0x14')](_0x28997e);}};exports[_0xea7a('0x10')]=function(_0x32e350,_0x29cf76){return git[_0xea7a('0x10')](['origin',_0xea7a('0x15')],function(_0x3dde7b){if(_0x3dde7b){logger[_0xea7a('0x16')](_0x3dde7b);return _0x29cf76[_0xea7a('0x13')](0x1f4)['json'](_0x3dde7b);}logger[_0xea7a('0x17')](_0xea7a('0x18'));return _0x29cf76[_0xea7a('0x13')](0xc8)[_0xea7a('0x14')]({'output':_0xea7a('0x19')});});};exports[_0xea7a('0x1a')]=function(_0xf92525,_0x49c8cc){return git[_0xea7a('0x1a')]([_0xea7a('0x1b'),_0xea7a('0x1c')],function(_0x1cc8fb){if(_0x1cc8fb){logger[_0xea7a('0x16')](_0x1cc8fb);return _0x49c8cc[_0xea7a('0x13')](0x1f4)[_0xea7a('0x14')](_0x1cc8fb);}logger[_0xea7a('0x17')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x49c8cc[_0xea7a('0x13')](0xc8)[_0xea7a('0x14')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x32f79d,_0x1e60d5){exec(_0xea7a('0x1d'),function(_0xb15a78,_0x530efb,_0x160efd){logger[_0xea7a('0x17')](_0x530efb);logger['info'](_0x160efd);if(_0xb15a78){logger[_0xea7a('0x16')](_0xb15a78);return _0x1e60d5['status'](0x1f4)['json'](_0xb15a78);}return _0x1e60d5['status'](0xc8)[_0xea7a('0x14')]({'output':_0x530efb});});};exports['restart']=function(_0xfe0284,_0x4d8125){return pm2['restart'](_0xea7a('0x1e'))[_0xea7a('0x1f')](function(_0xb927ed){logger[_0xea7a('0x17')](_0xea7a('0x20'),_0xb927ed);return _0x4d8125['status'](0xc8)[_0xea7a('0x14')]({'output':_0xea7a('0x21')});})[_0xea7a('0x22')](function(_0x2e0bb2){logger[_0xea7a('0x16')](_0x2e0bb2);return _0x4d8125['status'](0x1f4)[_0xea7a('0x14')](_0x2e0bb2);});};exports['migrations']=function(_0x55df18,_0x5f3009){var _0xdae9a7=fs[_0xea7a('0x23')](path['join'](config[_0xea7a('0x24')],'server',_0xea7a('0x25')));var _0x467aa6=[];for(var _0xc9923=0x0;_0xc9923<_0xdae9a7['length'];_0xc9923++){var _0x5db6a1=_0xdae9a7[_0xc9923][_0xea7a('0x26')](_0xea7a('0x27'),'');if(compareVersions(module[_0xea7a('0xd')]['version'],_0x5db6a1)===-0x1){_0x467aa6[_0xea7a('0x28')](_0x5db6a1);}}if(_0x467aa6['length']){var _0x1b317d=_0x467aa6[_0xea7a('0x29')](compareVersions);var _0x3b7976=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0xea7a('0x3')},'migrations':{'params':[db[_0xea7a('0x2a')][_0xea7a('0x2b')](),db[_0xea7a('0x2a')][_0xea7a('0x2c')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xea7a('0x2d')](config[_0xea7a('0x24')],'server',_0xea7a('0x25')),'pattern':/\.js$/}});_0x3b7976['up']({'migrations':_[_0xea7a('0x2e')](_0x1b317d,function(_0x4afea5){return _0x4afea5+_0xea7a('0x27');})})['then'](function(){return _0x5f3009['status'](0xc8)[_0xea7a('0x14')]({'output':_0xea7a('0x2f')+module['exports'][_0xea7a('0x3')]+_0xea7a('0x30')+_[_0xea7a('0x31')](_0x1b317d),'migrations':_[_0xea7a('0x2d')](_0x1b317d)});})['catch'](function(_0x53283f){if(_0x53283f instanceof db[_0xea7a('0x2a')]['UniqueConstraintError']){return _0x5f3009[_0xea7a('0x13')](0xc8)[_0xea7a('0x14')]({'output':_0xea7a('0x32')});}else{return _0x5f3009[_0xea7a('0x13')](0x1f4)['json'](_0x53283f);}});}else{return _0x5f3009[_0xea7a('0x13')](0xc8)[_0xea7a('0x14')]({'output':_0xea7a('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 3025bf9..3be12fd 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 _0x1f43=['update','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','isAuthenticated','show','post','create','put','/:id'];(function(_0x2c69a1,_0x201903){var _0x24bb91=function(_0x3131ac){while(--_0x3131ac){_0x2c69a1['push'](_0x2c69a1['shift']());}};_0x24bb91(++_0x201903);}(_0x1f43,0x9a));var _0x31f4=function(_0x2b304b,_0x586e14){_0x2b304b=_0x2b304b-0x0;var _0x11e542=_0x1f43[_0x2b304b];return _0x11e542;};'use strict';var multer=require(_0x31f4('0x0'));var util=require('util');var path=require(_0x31f4('0x1'));var timeout=require(_0x31f4('0x2'));var express=require(_0x31f4('0x3'));var router=express['Router']();var fs_extra=require(_0x31f4('0x4'));var auth=require(_0x31f4('0x5'));var interaction=require(_0x31f4('0x6'));var config=require(_0x31f4('0x7'));var controller=require(_0x31f4('0x8'));router[_0x31f4('0x9')]('/',auth['isAuthenticated'](),controller[_0x31f4('0xa')]);router['get']('/describe',auth[_0x31f4('0xb')](),controller['describe']);router[_0x31f4('0x9')]('/:id',auth[_0x31f4('0xb')](),controller[_0x31f4('0xc')]);router[_0x31f4('0xd')]('/',auth[_0x31f4('0xb')](),controller[_0x31f4('0xe')]);router[_0x31f4('0xf')](_0x31f4('0x10'),auth['isAuthenticated'](),controller[_0x31f4('0x11')]);router[_0x31f4('0x12')]('/:id',auth[_0x31f4('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4713=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','show','put'];(function(_0x5235dd,_0x3f91cf){var _0x13059d=function(_0x355a98){while(--_0x355a98){_0x5235dd['push'](_0x5235dd['shift']());}};_0x13059d(++_0x3f91cf);}(_0x4713,0x1b9));var _0x3471=function(_0x1e5db8,_0x44ef41){_0x1e5db8=_0x1e5db8-0x0;var _0x219a51=_0x4713[_0x1e5db8];return _0x219a51;};'use strict';var multer=require(_0x3471('0x0'));var util=require(_0x3471('0x1'));var path=require(_0x3471('0x2'));var timeout=require(_0x3471('0x3'));var express=require(_0x3471('0x4'));var router=express[_0x3471('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3471('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3471('0x7'));router[_0x3471('0x8')]('/',auth[_0x3471('0x9')](),controller[_0x3471('0xa')]);router['get'](_0x3471('0xb'),auth[_0x3471('0x9')](),controller['describe']);router[_0x3471('0x8')](_0x3471('0xc'),auth[_0x3471('0x9')](),controller[_0x3471('0xd')]);router['post']('/',auth[_0x3471('0x9')](),controller['create']);router[_0x3471('0xe')](_0x3471('0xc'),auth[_0x3471('0x9')](),controller[_0x3471('0xf')]);router[_0x3471('0x10')](_0x3471('0xc'),auth[_0x3471('0x9')](),controller[_0x3471('0x11')]);module[_0x3471('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 9a7f649..77d132c 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 _0x0570=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING'];(function(_0x42a6,_0x560591){var _0x20f00d=function(_0x4232a3){while(--_0x4232a3){_0x42a6['push'](_0x42a6['shift']());}};_0x20f00d(++_0x560591);}(_0x0570,0x172));var _0x0057=function(_0x55da2d,_0x202953){_0x55da2d=_0x55da2d-0x0;var _0x15282a=_0x0570[_0x55da2d];return _0x15282a;};'use strict';var Sequelize=require('sequelize');module[_0x0057('0x0')]={'type':{'type':Sequelize[_0x0057('0x1')]},'uniqueid':{'type':Sequelize[_0x0057('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0057('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x0057('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x0057('0x2')]},'agentconnectAt':{'type':Sequelize[_0x0057('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x0057('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x0057('0x2')]},'agentdumpAt':{'type':Sequelize[_0x0057('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x0057('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x0057('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x0057('0x4')]},'agentacw':{'type':Sequelize[_0x0057('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x0057('0x4')]},'reason':{'type':Sequelize[_0x0057('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0057('0x1')]},'channelstate':{'type':Sequelize[_0x0057('0x4')]},'channelstatedesc':{'type':Sequelize[_0x0057('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x0057('0x1')]},'language':{'type':Sequelize[_0x0057('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x0057('0x1')]},'priority':{'type':Sequelize[_0x0057('0x1')]},'destchannel':{'type':Sequelize[_0x0057('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x0057('0x1')]},'destcalleridnum':{'type':Sequelize[_0x0057('0x1')]},'destcalleridname':{'type':Sequelize[_0x0057('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x0057('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x0057('0x1')]},'destaccountcode':{'type':Sequelize[_0x0057('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x0057('0x1')]},'destpriority':{'type':Sequelize[_0x0057('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x0057('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x0057('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x0057('0x5')},'transferexten':{'type':Sequelize[_0x0057('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4bde=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x449b82,_0x8b786b){var _0x320bf2=function(_0x25baa8){while(--_0x25baa8){_0x449b82['push'](_0x449b82['shift']());}};_0x320bf2(++_0x8b786b);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x4f9551,_0x5354e4){_0x4f9551=_0x4f9551-0x0;var _0x12cda5=_0x4bde[_0x4f9551];return _0x12cda5;};'use strict';var Sequelize=require(_0xe4bd('0x0'));module[_0xe4bd('0x1')]={'type':{'type':Sequelize[_0xe4bd('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe4bd('0x2')]},'calleridname':{'type':Sequelize[_0xe4bd('0x2')]},'queue':{'type':Sequelize[_0xe4bd('0x2')]},'interface':{'type':Sequelize[_0xe4bd('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xe4bd('0x3')]},'agentconnectAt':{'type':Sequelize[_0xe4bd('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xe4bd('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xe4bd('0x3')]},'agentdumpAt':{'type':Sequelize[_0xe4bd('0x3')]},'holdtime':{'type':Sequelize[_0xe4bd('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe4bd('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe4bd('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe4bd('0x4')]},'agentacw':{'type':Sequelize[_0xe4bd('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe4bd('0x4')]},'reason':{'type':Sequelize[_0xe4bd('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe4bd('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe4bd('0x2')]},'connectedlinename':{'type':Sequelize[_0xe4bd('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe4bd('0x2')]},'context':{'type':Sequelize[_0xe4bd('0x2')]},'exten':{'type':Sequelize[_0xe4bd('0x2')]},'priority':{'type':Sequelize[_0xe4bd('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe4bd('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xe4bd('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe4bd('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe4bd('0x2')]},'destlanguage':{'type':Sequelize[_0xe4bd('0x2')]},'destaccountcode':{'type':Sequelize[_0xe4bd('0x2')]},'destcontext':{'type':Sequelize[_0xe4bd('0x2')]},'destexten':{'type':Sequelize[_0xe4bd('0x2')]},'destpriority':{'type':Sequelize[_0xe4bd('0x2')]},'destuniqueid':{'type':Sequelize[_0xe4bd('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe4bd('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xe4bd('0x2')]},'transfer':{'type':Sequelize[_0xe4bd('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe4bd('0x2')],'comment':_0xe4bd('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xe4bd('0x2')]},'agententerreason':{'type':Sequelize[_0xe4bd('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 c1efa6b..1519cec 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(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 ca8fe03..df163b7 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 _0x7676=['define','VoiceAgentReport','uniqueid','destuniqueid','lodash','util','../../config/logger','moment','path','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x3027b0,_0x5dd103){var _0x14bac4=function(_0x6c5ad1){while(--_0x6c5ad1){_0x3027b0['push'](_0x3027b0['shift']());}};_0x14bac4(++_0x5dd103);}(_0x7676,0xb8));var _0x6767=function(_0x49874a,_0x495e1a){_0x49874a=_0x49874a-0x0;var _0x226400=_0x7676[_0x49874a];return _0x226400;};'use strict';var _=require(_0x6767('0x0'));var util=require(_0x6767('0x1'));var logger=require(_0x6767('0x2'))('api');var moment=require(_0x6767('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6767('0x4'));var rimraf=require('rimraf');var config=require(_0x6767('0x5'));var attributes=require(_0x6767('0x6'));module[_0x6767('0x7')]=function(_0x4d0c08,_0x24d747){return _0x4d0c08[_0x6767('0x8')](_0x6767('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x6767('0xa'),_0x6767('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf006=['./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','../../config/logger','api','bluebird','path'];(function(_0x12d95d,_0x9bf780){var _0x33b0c0=function(_0x46a658){while(--_0x46a658){_0x12d95d['push'](_0x12d95d['shift']());}};_0x33b0c0(++_0x9bf780);}(_0xf006,0x146));var _0x6f00=function(_0x129024,_0xa0d05e){_0x129024=_0x129024-0x0;var _0x54651a=_0xf006[_0x129024];return _0x54651a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f00('0x0'))(_0x6f00('0x1'));var moment=require('moment');var BPromise=require(_0x6f00('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f00('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f00('0x4'));module[_0x6f00('0x5')]=function(_0x141e71,_0x52c9a2){return _0x141e71[_0x6f00('0x6')]('VoiceAgentReport',attributes,{'tableName':_0x6f00('0x7'),'paranoid':![],'indexes':[{'fields':[_0x6f00('0x8'),_0x6f00('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 17c1605..4060783 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 _0xd57f=['create','options','CreateVoiceAgentReport','UpdateVoiceAgentReport','raw','where','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceAgentReport'];(function(_0x511dfa,_0x3311e9){var _0x3d31d4=function(_0x4a6cd8){while(--_0x4a6cd8){_0x511dfa['push'](_0x511dfa['shift']());}};_0x3d31d4(++_0x3311e9);}(_0xd57f,0x108));var _0xfd57=function(_0x2cf415,_0x403b51){_0x2cf415=_0x2cf415-0x0;var _0x4f05df=_0xd57f[_0x2cf415];return _0x4f05df;};'use strict';var _=require('lodash');var util=require(_0xfd57('0x0'));var moment=require(_0xfd57('0x1'));var BPromise=require(_0xfd57('0x2'));var rs=require(_0xfd57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd57('0x4'))['db'];var utils=require(_0xfd57('0x5'));var logger=require(_0xfd57('0x6'))(_0xfd57('0x7'));var config=require('../../config/environment');var jayson=require(_0xfd57('0x8'));var client=jayson[_0xfd57('0x9')][_0xfd57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa52798,_0xac883b,_0x192286){return new BPromise(function(_0x1f8f73,_0x318163){return client['request'](_0xa52798,_0x192286)[_0xfd57('0xb')](function(_0x4c23fb){logger[_0xfd57('0xc')](_0xfd57('0xd'),_0xac883b,'request\x20sent');logger[_0xfd57('0xe')](_0xfd57('0xf'),_0xac883b,_0xfd57('0x10'),JSON[_0xfd57('0x11')](_0x4c23fb));if(_0x4c23fb[_0xfd57('0x12')]){if(_0x4c23fb['error'][_0xfd57('0x13')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0xac883b,_0x4c23fb['error']['message']);return _0x318163(_0x4c23fb[_0xfd57('0x12')][_0xfd57('0x14')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0xac883b,_0x4c23fb[_0xfd57('0x12')][_0xfd57('0x14')]);return _0x1f8f73(_0x4c23fb[_0xfd57('0x12')]['message']);}else{logger[_0xfd57('0xc')](_0xfd57('0xd'),_0xac883b,_0xfd57('0x10'));_0x1f8f73(_0x4c23fb[_0xfd57('0x15')][_0xfd57('0x14')]);}})[_0xfd57('0x16')](function(_0x20f5ab){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0xac883b,_0x20f5ab);_0x318163(_0x20f5ab);});});}exports['CreateVoiceAgentReport']=function(_0x3d169c){var _0x5cff99=this;return new Promise(function(_0x128430,_0x447016){return db[_0xfd57('0x17')][_0xfd57('0x18')](_0x3d169c['body'],{'raw':_0x3d169c[_0xfd57('0x19')]?_0x3d169c['options']['raw']===undefined?!![]:![]:!![]})[_0xfd57('0xb')](function(_0x266e7e){logger[_0xfd57('0xc')](_0xfd57('0x1a'),_0x3d169c);logger[_0xfd57('0xe')](_0xfd57('0x1a'),_0x3d169c,JSON[_0xfd57('0x11')](_0x266e7e));_0x128430(_0x266e7e);})[_0xfd57('0x16')](function(_0x2aeddd){logger[_0xfd57('0x12')]('CreateVoiceAgentReport',_0x2aeddd['message'],_0x3d169c);_0x447016(_0x5cff99['error'](0x1f4,_0x2aeddd[_0xfd57('0x14')]));});});};exports[_0xfd57('0x1b')]=function(_0x12e05f){var _0x5e0424=this;return new Promise(function(_0x2614e9,_0xcf39e9){return db[_0xfd57('0x17')]['update'](_0x12e05f['body'],{'raw':_0x12e05f[_0xfd57('0x19')]?_0x12e05f[_0xfd57('0x19')][_0xfd57('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12e05f['options']?_0x12e05f[_0xfd57('0x19')][_0xfd57('0x1d')]||null:null,'attributes':_0x12e05f[_0xfd57('0x19')]?_0x12e05f[_0xfd57('0x19')][_0xfd57('0x1e')]||null:null,'limit':_0x12e05f['options']?_0x12e05f['options'][_0xfd57('0x1f')]||null:null})['then'](function(_0x3a2070){logger['info'](_0xfd57('0x1b'),_0x12e05f);logger[_0xfd57('0xe')](_0xfd57('0x1b'),_0x12e05f,JSON['stringify'](_0x3a2070));_0x2614e9(_0x3a2070);})['catch'](function(_0x191da4){logger[_0xfd57('0x12')]('UpdateVoiceAgentReport',_0x191da4[_0xfd57('0x14')],_0x12e05f);_0xcf39e9(_0x5e0424[_0xfd57('0x12')](0x1f4,_0x191da4[_0xfd57('0x14')]));});});}; \ No newline at end of file +var _0x11d6=['http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3933b3,_0x3d6b90){var _0x241a71=function(_0x33bda0){while(--_0x33bda0){_0x3933b3['push'](_0x3933b3['shift']());}};_0x241a71(++_0x3d6b90);}(_0x11d6,0x7b));var _0x611d=function(_0x45872e,_0x2f47e8){_0x45872e=_0x45872e-0x0;var _0x25fab1=_0x11d6[_0x45872e];return _0x25fab1;};'use strict';var _=require(_0x611d('0x0'));var util=require(_0x611d('0x1'));var moment=require(_0x611d('0x2'));var BPromise=require(_0x611d('0x3'));var rs=require(_0x611d('0x4'));var fs=require('fs');var Redis=require(_0x611d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x611d('0x6'));var logger=require(_0x611d('0x7'))('rpc');var config=require(_0x611d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x611d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x510f42,_0x1341c6,_0x2370b1){return new BPromise(function(_0x128fd1,_0x49d648){return client[_0x611d('0xa')](_0x510f42,_0x2370b1)[_0x611d('0xb')](function(_0x360416){logger[_0x611d('0xc')](_0x611d('0xd'),_0x1341c6,_0x611d('0xe'));logger['debug'](_0x611d('0xf'),_0x1341c6,_0x611d('0xe'),JSON[_0x611d('0x10')](_0x360416));if(_0x360416['error']){if(_0x360416['error'][_0x611d('0x11')]===0x1f4){logger[_0x611d('0x12')](_0x611d('0xd'),_0x1341c6,_0x360416[_0x611d('0x12')]['message']);return _0x49d648(_0x360416[_0x611d('0x12')][_0x611d('0x13')]);}logger[_0x611d('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x1341c6,_0x360416[_0x611d('0x12')][_0x611d('0x13')]);return _0x128fd1(_0x360416[_0x611d('0x12')][_0x611d('0x13')]);}else{logger[_0x611d('0xc')](_0x611d('0xd'),_0x1341c6,'request\x20sent');_0x128fd1(_0x360416[_0x611d('0x14')][_0x611d('0x13')]);}})[_0x611d('0x15')](function(_0x64a99a){logger[_0x611d('0x12')](_0x611d('0xd'),_0x1341c6,_0x64a99a);_0x49d648(_0x64a99a);});});}exports['CreateVoiceAgentReport']=function(_0x25962d){var _0x49c9df=this;return new Promise(function(_0x1a858e,_0x291803){return db[_0x611d('0x16')][_0x611d('0x17')](_0x25962d[_0x611d('0x18')],{'raw':_0x25962d['options']?_0x25962d[_0x611d('0x19')][_0x611d('0x1a')]===undefined?!![]:![]:!![]})[_0x611d('0xb')](function(_0x4a4f5c){logger['info']('CreateVoiceAgentReport',_0x25962d);logger['debug'](_0x611d('0x1b'),_0x25962d,JSON[_0x611d('0x10')](_0x4a4f5c));_0x1a858e(_0x4a4f5c);})[_0x611d('0x15')](function(_0xab16d5){logger[_0x611d('0x12')](_0x611d('0x1b'),_0xab16d5[_0x611d('0x13')],_0x25962d);_0x291803(_0x49c9df[_0x611d('0x12')](0x1f4,_0xab16d5[_0x611d('0x13')]));});});};exports[_0x611d('0x1c')]=function(_0x1376be){var _0xbb8489=this;return new Promise(function(_0x326c38,_0x584715){return db[_0x611d('0x16')][_0x611d('0x1d')](_0x1376be[_0x611d('0x18')],{'raw':_0x1376be[_0x611d('0x19')]?_0x1376be[_0x611d('0x19')][_0x611d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1376be[_0x611d('0x19')]?_0x1376be[_0x611d('0x19')][_0x611d('0x1e')]||null:null,'attributes':_0x1376be[_0x611d('0x19')]?_0x1376be[_0x611d('0x19')][_0x611d('0x1f')]||null:null,'limit':_0x1376be['options']?_0x1376be[_0x611d('0x19')]['limit']||null:null})[_0x611d('0xb')](function(_0x2503a6){logger[_0x611d('0xc')](_0x611d('0x1c'),_0x1376be);logger[_0x611d('0x20')]('UpdateVoiceAgentReport',_0x1376be,JSON[_0x611d('0x10')](_0x2503a6));_0x326c38(_0x2503a6);})[_0x611d('0x15')](function(_0x5ed737){logger['error']('UpdateVoiceAgentReport',_0x5ed737['message'],_0x1376be);_0x584715(_0xbb8489[_0x611d('0x12')](0x1f4,_0x5ed737[_0x611d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index d667ca3..60e222b 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 _0x4c4e=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','delete','destroy','multer','path','connect-timeout','express'];(function(_0x185180,_0x145d70){var _0x2d9d42=function(_0xc2be06){while(--_0xc2be06){_0x185180['push'](_0x185180['shift']());}};_0x2d9d42(++_0x145d70);}(_0x4c4e,0x152));var _0xe4c4=function(_0x821411,_0x127409){_0x821411=_0x821411-0x0;var _0x4856aa=_0x4c4e[_0x821411];return _0x4856aa;};'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'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe4c4('0xe')]('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);router[_0xe4c4('0x10')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller['update']);router[_0xe4c4('0x11')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x12')]);module['exports']=router; \ No newline at end of file +var _0xed1f=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update'];(function(_0x5c7e53,_0x174ce5){var _0x1c9af9=function(_0x38895d){while(--_0x38895d){_0x5c7e53['push'](_0x5c7e53['shift']());}};_0x1c9af9(++_0x174ce5);}(_0xed1f,0x6a));var _0xfed1=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xed1f[_0x17406a];return _0x1501ff;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')]('/',auth[_0xfed1('0xc')](),controller[_0xfed1('0xd')]);router[_0xfed1('0xb')](_0xfed1('0xe'),auth[_0xfed1('0xc')](),controller[_0xfed1('0xf')]);router['get'](_0xfed1('0x10'),auth[_0xfed1('0xc')](),controller['show']);router[_0xfed1('0x11')]('/',auth[_0xfed1('0xc')](),controller['create']);router[_0xfed1('0x12')]('/:id',auth[_0xfed1('0xc')](),controller[_0xfed1('0x13')]);router['delete']('/:id',auth[_0xfed1('0xc')](),controller[_0xfed1('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 79425fa..903eeaf 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 _0x3df4=['DATE','INTEGER','sequelize','STRING','ENUM','inbound','outbound','outbound-fax','dialer'];(function(_0x3076f9,_0x379308){var _0x552d12=function(_0x58627e){while(--_0x58627e){_0x3076f9['push'](_0x3076f9['shift']());}};_0x552d12(++_0x379308);}(_0x3df4,0x12b));var _0x43df=function(_0x5d9be4,_0x5df4b6){_0x5d9be4=_0x5d9be4-0x0;var _0x44650b=_0x3df4[_0x5d9be4];return _0x44650b;};'use strict';var Sequelize=require(_0x43df('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x43df('0x1')]},'type':{'type':Sequelize[_0x43df('0x2')](_0x43df('0x3'),'internal',_0x43df('0x4'),'inbound-fax',_0x43df('0x5'),_0x43df('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x43df('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x43df('0x1')]},'channel':{'type':Sequelize[_0x43df('0x1')]},'destinationchannel':{'type':Sequelize[_0x43df('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x43df('0x7')]},'systemanswertime':{'type':Sequelize[_0x43df('0x7')]},'answertime':{'type':Sequelize[_0x43df('0x7')]},'endtime':{'type':Sequelize[_0x43df('0x7')]},'duration':{'type':Sequelize[_0x43df('0x8')]},'billableseconds':{'type':Sequelize[_0x43df('0x8')]},'mohtime':{'type':Sequelize[_0x43df('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x43df('0x1')]},'userfield':{'type':Sequelize[_0x43df('0x1')]},'userDisposition':{'type':Sequelize[_0x43df('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x43df('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x43df('0x1')]},'routeid':{'type':Sequelize[_0x43df('0x8')]},'sipcallid':{'type':Sequelize[_0x43df('0x1')]}}; \ No newline at end of file +var _0x0901=['DATE','INTEGER','sequelize','STRING','ENUM','outbound','inbound-fax','outbound-fax','dialer','TEXT'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x0901,0xb6));var _0x1090=function(_0x362ae8,_0x407a73){_0x362ae8=_0x362ae8-0x0;var _0x20b6d7=_0x0901[_0x362ae8];return _0x20b6d7;};'use strict';var Sequelize=require(_0x1090('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1090('0x1')]},'type':{'type':Sequelize[_0x1090('0x2')]('inbound','internal',_0x1090('0x3'),_0x1090('0x4'),_0x1090('0x5'),_0x1090('0x6'))},'tag':{'type':Sequelize[_0x1090('0x1')]},'accountcode':{'type':Sequelize[_0x1090('0x1')]},'source':{'type':Sequelize[_0x1090('0x1')]},'destination':{'type':Sequelize[_0x1090('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x1090('0x1')]},'channel':{'type':Sequelize[_0x1090('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x1090('0x1')]},'lastdata':{'type':Sequelize[_0x1090('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x1090('0x8')]},'endtime':{'type':Sequelize[_0x1090('0x8')]},'duration':{'type':Sequelize[_0x1090('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x1090('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1090('0x1')]},'amaflags':{'type':Sequelize[_0x1090('0x1')]},'userfield':{'type':Sequelize[_0x1090('0x1')]},'userDisposition':{'type':Sequelize[_0x1090('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x1090('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x1090('0x1')]},'note':{'type':Sequelize[_0x1090('0x1')]},'prefix':{'type':Sequelize[_0x1090('0x1')]},'routeid':{'type':Sequelize[_0x1090('0x9')]},'sipcallid':{'type':Sequelize[_0x1090('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 1336bf0..0a23030 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 _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x2ef3,0xba));var _0x32ef=function(_0x4d8da4,_0x4e2662){_0x4d8da4=_0x4d8da4-0x0;var _0x2a5f97=_0x2ef3[_0x4d8da4];return _0x2a5f97;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x21ff10,_0x2c0341){_0x21ff10=_0x21ff10-0x0;var _0x42a6dd=_0x5f2f[_0x21ff10];return _0x42a6dd;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 68dd5e9..bab6f88 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 _0x4ccc=['bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','report_call','../../config/logger'];(function(_0x15b3fa,_0x5d12fe){var _0x406232=function(_0x20676a){while(--_0x20676a){_0x15b3fa['push'](_0x15b3fa['shift']());}};_0x406232(++_0x5d12fe);}(_0x4ccc,0x137));var _0xc4cc=function(_0x37ffc6,_0x251b7f){_0x37ffc6=_0x37ffc6-0x0;var _0x47faac=_0x4ccc[_0x37ffc6];return _0x47faac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc4cc('0x0'))('api');var moment=require('moment');var BPromise=require(_0xc4cc('0x1'));var rp=require(_0xc4cc('0x2'));var fs=require('fs');var path=require(_0xc4cc('0x3'));var rimraf=require('rimraf');var config=require(_0xc4cc('0x4'));var attributes=require(_0xc4cc('0x5'));module[_0xc4cc('0x6')]=function(_0x492e3c,_0x3cd283){return _0x492e3c['define']('VoiceCallReport',attributes,{'tableName':_0xc4cc('0x7'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc665=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','report_call','uniqueid','lodash','util','../../config/logger','api'];(function(_0x24c733,_0x525907){var _0x21a2d3=function(_0x2bbf39){while(--_0x2bbf39){_0x24c733['push'](_0x24c733['shift']());}};_0x21a2d3(++_0x525907);}(_0xc665,0x191));var _0x5c66=function(_0x37cf72,_0x551f51){_0x37cf72=_0x37cf72-0x0;var _0x766510=_0xc665[_0x37cf72];return _0x766510;};'use strict';var _=require(_0x5c66('0x0'));var util=require(_0x5c66('0x1'));var logger=require(_0x5c66('0x2'))(_0x5c66('0x3'));var moment=require(_0x5c66('0x4'));var BPromise=require(_0x5c66('0x5'));var rp=require(_0x5c66('0x6'));var fs=require('fs');var path=require(_0x5c66('0x7'));var rimraf=require(_0x5c66('0x8'));var config=require(_0x5c66('0x9'));var attributes=require(_0x5c66('0xa'));module[_0x5c66('0xb')]=function(_0x4e9b1d,_0x1cdba4){return _0x4e9b1d[_0x5c66('0xc')]('VoiceCallReport',attributes,{'tableName':_0x5c66('0xd'),'paranoid':![],'indexes':[{'fields':[_0x5c66('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 9ce50cb..ae91c75 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 _0x7169=['client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VoiceCallReport','options','attributes','limit','include','map','GetVoiceCallReport','stringify','CreateVoiceCallReport','create','body','debug','UpdateVoiceCallReport','update','raw','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4f4081,_0x550e6d){var _0x5649b6=function(_0x5b19cf){while(--_0x5b19cf){_0x4f4081['push'](_0x4f4081['shift']());}};_0x5649b6(++_0x550e6d);}(_0x7169,0x100));var _0x9716=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x7169[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x9716('0x0'));var util=require(_0x9716('0x1'));var moment=require(_0x9716('0x2'));var BPromise=require('bluebird');var rs=require(_0x9716('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9716('0x4'))['db'];var utils=require(_0x9716('0x5'));var logger=require(_0x9716('0x6'))(_0x9716('0x7'));var config=require(_0x9716('0x8'));var jayson=require(_0x9716('0x9'));var client=jayson[_0x9716('0xa')][_0x9716('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c5041,_0x50c026,_0x1f8e77){return new BPromise(function(_0x20a137,_0x244a3f){return client['request'](_0x3c5041,_0x1f8e77)[_0x9716('0xc')](function(_0x569ea1){logger[_0x9716('0xd')](_0x9716('0xe'),_0x50c026,_0x9716('0xf'));logger['debug'](_0x9716('0x10'),_0x50c026,_0x9716('0xf'),JSON['stringify'](_0x569ea1));if(_0x569ea1[_0x9716('0x11')]){if(_0x569ea1[_0x9716('0x11')][_0x9716('0x12')]===0x1f4){logger[_0x9716('0x11')](_0x9716('0xe'),_0x50c026,_0x569ea1[_0x9716('0x11')][_0x9716('0x13')]);return _0x244a3f(_0x569ea1[_0x9716('0x11')][_0x9716('0x13')]);}logger[_0x9716('0x11')](_0x9716('0xe'),_0x50c026,_0x569ea1[_0x9716('0x11')][_0x9716('0x13')]);return _0x20a137(_0x569ea1[_0x9716('0x11')]['message']);}else{logger['info'](_0x9716('0xe'),_0x50c026,_0x9716('0xf'));_0x20a137(_0x569ea1[_0x9716('0x14')][_0x9716('0x13')]);}})[_0x9716('0x15')](function(_0x2a7f79){logger[_0x9716('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x50c026,_0x2a7f79);_0x244a3f(_0x2a7f79);});});}exports['GetVoiceCallReport']=function(_0x1f0346){var _0x43ae94=this;return new Promise(function(_0x7d5804,_0x325301){return db[_0x9716('0x16')]['findAll']({'raw':_0x1f0346[_0x9716('0x17')]?_0x1f0346[_0x9716('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1f0346[_0x9716('0x17')]?_0x1f0346[_0x9716('0x17')]['where']||null:null,'attributes':_0x1f0346[_0x9716('0x17')]?_0x1f0346[_0x9716('0x17')][_0x9716('0x18')]||null:null,'limit':_0x1f0346[_0x9716('0x17')]?_0x1f0346[_0x9716('0x17')][_0x9716('0x19')]||null:null,'include':_0x1f0346[_0x9716('0x17')]?_0x1f0346[_0x9716('0x17')][_0x9716('0x1a')]?_[_0x9716('0x1b')](_0x1f0346[_0x9716('0x17')][_0x9716('0x1a')],function(_0x210563){return{'model':db[_0x210563['model']],'as':_0x210563['as'],'attributes':_0x210563[_0x9716('0x18')],'include':_0x210563[_0x9716('0x1a')]?_[_0x9716('0x1b')](_0x210563['include'],function(_0x698872){return{'model':db[_0x698872['model']],'as':_0x698872['as'],'attributes':_0x698872[_0x9716('0x18')],'include':_0x698872[_0x9716('0x1a')]?_[_0x9716('0x1b')](_0x698872[_0x9716('0x1a')],function(_0x1264ce){return{'model':db[_0x1264ce['model']],'as':_0x1264ce['as'],'attributes':_0x1264ce[_0x9716('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9716('0xc')](function(_0x39145f){logger[_0x9716('0xd')]('GetVoiceCallReport',_0x1f0346);logger['debug'](_0x9716('0x1c'),_0x1f0346,JSON[_0x9716('0x1d')](_0x39145f));_0x7d5804(_0x39145f);})[_0x9716('0x15')](function(_0x1a5279){logger[_0x9716('0x11')](_0x9716('0x1c'),_0x1a5279[_0x9716('0x13')],_0x1f0346);_0x325301(_0x43ae94[_0x9716('0x11')](0x1f4,_0x1a5279[_0x9716('0x13')]));});});};exports[_0x9716('0x1e')]=function(_0x57e1fe){var _0x3dbc37=this;return new Promise(function(_0x15e119,_0x18df91){return db[_0x9716('0x16')][_0x9716('0x1f')](_0x57e1fe[_0x9716('0x20')],{'raw':_0x57e1fe[_0x9716('0x17')]?_0x57e1fe[_0x9716('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x9716('0xc')](function(_0x2ff1f7){logger['info'](_0x9716('0x1e'),_0x57e1fe);logger[_0x9716('0x21')](_0x9716('0x1e'),_0x57e1fe,JSON[_0x9716('0x1d')](_0x2ff1f7));_0x15e119(_0x2ff1f7);})['catch'](function(_0x1dc441){logger[_0x9716('0x11')]('CreateVoiceCallReport',_0x1dc441[_0x9716('0x13')],_0x57e1fe);_0x18df91(_0x3dbc37[_0x9716('0x11')](0x1f4,_0x1dc441[_0x9716('0x13')]));});});};exports[_0x9716('0x22')]=function(_0x152495){var _0x40ee4f=this;return new Promise(function(_0x28ae07,_0x16f1be){return db[_0x9716('0x16')][_0x9716('0x23')](_0x152495[_0x9716('0x20')],{'raw':_0x152495[_0x9716('0x17')]?_0x152495[_0x9716('0x17')][_0x9716('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x152495[_0x9716('0x17')]?_0x152495['options'][_0x9716('0x25')]||null:null,'attributes':_0x152495[_0x9716('0x17')]?_0x152495['options']['attributes']||null:null,'limit':_0x152495[_0x9716('0x17')]?_0x152495[_0x9716('0x17')][_0x9716('0x19')]||null:null})['then'](function(_0x5f1947){logger[_0x9716('0xd')](_0x9716('0x22'),_0x152495);logger['debug']('UpdateVoiceCallReport',_0x152495,JSON[_0x9716('0x1d')](_0x5f1947));_0x28ae07(_0x5f1947);})['catch'](function(_0x539dae){logger['error'](_0x9716('0x22'),_0x539dae[_0x9716('0x13')],_0x152495);_0x16f1be(_0x40ee4f[_0x9716('0x11')](0x1f4,_0x539dae['message']));});});}; \ No newline at end of file +var _0xd273=['VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include','model','map','then','stringify','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x59bd3b,_0x53eff9){var _0x586c53=function(_0xee0b0b){while(--_0xee0b0b){_0x59bd3b['push'](_0x59bd3b['shift']());}};_0x586c53(++_0x53eff9);}(_0xd273,0xe2));var _0x3d27=function(_0x3f4360,_0x2f15be){_0x3f4360=_0x3f4360-0x0;var _0x3916df=_0xd273[_0x3f4360];return _0x3916df;};'use strict';var _=require(_0x3d27('0x0'));var util=require(_0x3d27('0x1'));var moment=require(_0x3d27('0x2'));var BPromise=require(_0x3d27('0x3'));var rs=require(_0x3d27('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d27('0x5'))['db'];var utils=require(_0x3d27('0x6'));var logger=require(_0x3d27('0x7'))(_0x3d27('0x8'));var config=require(_0x3d27('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3d27('0xa')][_0x3d27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b32ce,_0x18ffa0,_0x388213){return new BPromise(function(_0x591747,_0x4becf8){return client[_0x3d27('0xc')](_0x5b32ce,_0x388213)['then'](function(_0x226a9f){logger[_0x3d27('0xd')](_0x3d27('0xe'),_0x18ffa0,_0x3d27('0xf'));logger[_0x3d27('0x10')](_0x3d27('0x11'),_0x18ffa0,_0x3d27('0xf'),JSON['stringify'](_0x226a9f));if(_0x226a9f[_0x3d27('0x12')]){if(_0x226a9f[_0x3d27('0x12')][_0x3d27('0x13')]===0x1f4){logger[_0x3d27('0x12')](_0x3d27('0xe'),_0x18ffa0,_0x226a9f[_0x3d27('0x12')][_0x3d27('0x14')]);return _0x4becf8(_0x226a9f[_0x3d27('0x12')][_0x3d27('0x14')]);}logger[_0x3d27('0x12')](_0x3d27('0xe'),_0x18ffa0,_0x226a9f['error'][_0x3d27('0x14')]);return _0x591747(_0x226a9f['error'][_0x3d27('0x14')]);}else{logger[_0x3d27('0xd')](_0x3d27('0xe'),_0x18ffa0,_0x3d27('0xf'));_0x591747(_0x226a9f[_0x3d27('0x15')][_0x3d27('0x14')]);}})[_0x3d27('0x16')](function(_0x41ea3a){logger[_0x3d27('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x18ffa0,_0x41ea3a);_0x4becf8(_0x41ea3a);});});}exports[_0x3d27('0x17')]=function(_0x582f3e){var _0x51dffe=this;return new Promise(function(_0x5da442,_0xb62bc5){return db[_0x3d27('0x18')][_0x3d27('0x19')]({'raw':_0x582f3e[_0x3d27('0x1a')]?_0x582f3e['options'][_0x3d27('0x1b')]===undefined?!![]:![]:!![],'where':_0x582f3e[_0x3d27('0x1a')]?_0x582f3e[_0x3d27('0x1a')][_0x3d27('0x1c')]||null:null,'attributes':_0x582f3e[_0x3d27('0x1a')]?_0x582f3e[_0x3d27('0x1a')][_0x3d27('0x1d')]||null:null,'limit':_0x582f3e[_0x3d27('0x1a')]?_0x582f3e['options']['limit']||null:null,'include':_0x582f3e[_0x3d27('0x1a')]?_0x582f3e[_0x3d27('0x1a')][_0x3d27('0x1e')]?_['map'](_0x582f3e[_0x3d27('0x1a')][_0x3d27('0x1e')],function(_0x5972c9){return{'model':db[_0x5972c9[_0x3d27('0x1f')]],'as':_0x5972c9['as'],'attributes':_0x5972c9['attributes'],'include':_0x5972c9[_0x3d27('0x1e')]?_[_0x3d27('0x20')](_0x5972c9[_0x3d27('0x1e')],function(_0x16e221){return{'model':db[_0x16e221[_0x3d27('0x1f')]],'as':_0x16e221['as'],'attributes':_0x16e221['attributes'],'include':_0x16e221[_0x3d27('0x1e')]?_['map'](_0x16e221['include'],function(_0x58be72){return{'model':db[_0x58be72[_0x3d27('0x1f')]],'as':_0x58be72['as'],'attributes':_0x58be72['attributes']};}):[]};}):[]};}):[]:[]})[_0x3d27('0x21')](function(_0x1f6467){logger[_0x3d27('0xd')]('GetVoiceCallReport',_0x582f3e);logger[_0x3d27('0x10')](_0x3d27('0x17'),_0x582f3e,JSON[_0x3d27('0x22')](_0x1f6467));_0x5da442(_0x1f6467);})[_0x3d27('0x16')](function(_0x222fd0){logger[_0x3d27('0x12')]('GetVoiceCallReport',_0x222fd0[_0x3d27('0x14')],_0x582f3e);_0xb62bc5(_0x51dffe['error'](0x1f4,_0x222fd0[_0x3d27('0x14')]));});});};exports[_0x3d27('0x23')]=function(_0x2b2e86){var _0x1eaa71=this;return new Promise(function(_0x529e29,_0x3bf8d6){return db[_0x3d27('0x18')][_0x3d27('0x24')](_0x2b2e86[_0x3d27('0x25')],{'raw':_0x2b2e86['options']?_0x2b2e86['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x40fde3){logger[_0x3d27('0xd')](_0x3d27('0x23'),_0x2b2e86);logger[_0x3d27('0x10')](_0x3d27('0x23'),_0x2b2e86,JSON['stringify'](_0x40fde3));_0x529e29(_0x40fde3);})['catch'](function(_0x51adf1){logger[_0x3d27('0x12')](_0x3d27('0x23'),_0x51adf1[_0x3d27('0x14')],_0x2b2e86);_0x3bf8d6(_0x1eaa71[_0x3d27('0x12')](0x1f4,_0x51adf1[_0x3d27('0x14')]));});});};exports[_0x3d27('0x26')]=function(_0x517c2c){var _0x3790bb=this;return new Promise(function(_0x48f655,_0xa1a0d7){return db[_0x3d27('0x18')][_0x3d27('0x27')](_0x517c2c[_0x3d27('0x25')],{'raw':_0x517c2c[_0x3d27('0x1a')]?_0x517c2c[_0x3d27('0x1a')][_0x3d27('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x517c2c[_0x3d27('0x1a')]?_0x517c2c[_0x3d27('0x1a')][_0x3d27('0x1c')]||null:null,'attributes':_0x517c2c[_0x3d27('0x1a')]?_0x517c2c[_0x3d27('0x1a')][_0x3d27('0x1d')]||null:null,'limit':_0x517c2c[_0x3d27('0x1a')]?_0x517c2c[_0x3d27('0x1a')]['limit']||null:null})[_0x3d27('0x21')](function(_0xaba603){logger[_0x3d27('0xd')]('UpdateVoiceCallReport',_0x517c2c);logger['debug'](_0x3d27('0x26'),_0x517c2c,JSON[_0x3d27('0x22')](_0xaba603));_0x48f655(_0xaba603);})[_0x3d27('0x16')](function(_0x156d58){logger['error']('UpdateVoiceCallReport',_0x156d58['message'],_0x517c2c);_0xa1a0d7(_0x3790bb['error'](0x1f4,_0x156d58[_0x3d27('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 1393bad..e61cad9 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 _0x4cac=['update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x52a2be,_0x4bd252){var _0x246f1d=function(_0x410395){while(--_0x410395){_0x52a2be['push'](_0x52a2be['shift']());}};_0x246f1d(++_0x4bd252);}(_0x4cac,0x89));var _0xc4ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4cac[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc4ca('0x0'));var util=require('util');var path=require(_0xc4ca('0x1'));var timeout=require(_0xc4ca('0x2'));var express=require(_0xc4ca('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc4ca('0x4'));var config=require(_0xc4ca('0x5'));var controller=require(_0xc4ca('0x6'));router[_0xc4ca('0x7')]('/',auth[_0xc4ca('0x8')](),controller[_0xc4ca('0x9')]);router[_0xc4ca('0x7')](_0xc4ca('0xa'),auth['isAuthenticated'](),controller[_0xc4ca('0xb')]);router[_0xc4ca('0xc')]('/',auth[_0xc4ca('0x8')](),controller[_0xc4ca('0xd')]);router[_0xc4ca('0xe')](_0xc4ca('0xa'),auth['isAuthenticated'](),controller[_0xc4ca('0xf')]);router[_0xc4ca('0x10')](_0xc4ca('0xa'),auth[_0xc4ca('0x8')](),controller[_0xc4ca('0x11')]);module[_0xc4ca('0x12')]=router; \ No newline at end of file +var _0x635a=['post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show'];(function(_0x53708d,_0x4d4138){var _0x5b19e7=function(_0x54c0f1){while(--_0x54c0f1){_0x53708d['push'](_0x53708d['shift']());}};_0x5b19e7(++_0x4d4138);}(_0x635a,0x110));var _0xa635=function(_0x2a911c,_0x3ef981){_0x2a911c=_0x2a911c-0x0;var _0x5a45ed=_0x635a[_0x2a911c];return _0x5a45ed;};'use strict';var multer=require(_0xa635('0x0'));var util=require(_0xa635('0x1'));var path=require('path');var timeout=require(_0xa635('0x2'));var express=require(_0xa635('0x3'));var router=express[_0xa635('0x4')]();var fs_extra=require(_0xa635('0x5'));var auth=require(_0xa635('0x6'));var interaction=require(_0xa635('0x7'));var config=require(_0xa635('0x8'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0xa635('0x9')](),controller[_0xa635('0xa')]);router['get'](_0xa635('0xb'),auth[_0xa635('0x9')](),controller[_0xa635('0xc')]);router[_0xa635('0xd')]('/',auth[_0xa635('0x9')](),controller[_0xa635('0xe')]);router[_0xa635('0xf')](_0xa635('0xb'),auth[_0xa635('0x9')](),controller[_0xa635('0x10')]);router[_0xa635('0x11')](_0xa635('0xb'),auth[_0xa635('0x9')](),controller['destroy']);module[_0xa635('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 82df51f..b86af2a 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 _0x835c=['BOOLEAN','sequelize','STRING','name','setDataValue','getDataValue','options'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x835c,0x182));var _0xc835=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x835c[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xc835('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xc835('0x1')],'unique':_0xc835('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xc835('0x1')],'set':function(_0x44f51b){this[_0xc835('0x3')]('options',_0x44f51b?_0x44f51b['join'](''):[]);},'get':function(){return this[_0xc835('0x4')](_0xc835('0x5'))?this['getDataValue'](_0xc835('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0xc835('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0xc835('0x1')]},'record':{'type':Sequelize[_0xc835('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc835('0x1')]}}; \ No newline at end of file +var _0x559f=['getDataValue','options','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join'];(function(_0x215393,_0x4c406d){var _0x595198=function(_0x5d641f){while(--_0x5d641f){_0x215393['push'](_0x215393['shift']());}};_0x595198(++_0x4c406d);}(_0x559f,0x162));var _0xf559=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x559f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf559('0x0'));module[_0xf559('0x1')]={'name':{'type':Sequelize[_0xf559('0x2')]},'prefix':{'type':Sequelize[_0xf559('0x2')],'unique':_0xf559('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xf559('0x2')],'set':function(_0x27299b){this[_0xf559('0x4')]('options',_0x27299b?_0x27299b[_0xf559('0x5')](''):[]);},'get':function(){return this[_0xf559('0x6')](_0xf559('0x7'))?this[_0xf559('0x6')](_0xf559('0x7'))[_0xf559('0x8')](''):[];}},'auth':{'type':Sequelize[_0xf559('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0xf559('0x2')]},'record':{'type':Sequelize[_0xf559('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xf559('0x2')]},'description':{'type':Sequelize[_0xf559('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 8c7dce9..38ced99 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 _0x05b0=['body','params','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','VoiceChanSpy','fieldName','type','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','model','keys','rawAttributes','create','user','role','ChanSpies','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x34abc5,_0x364e73){var _0x44ac0c=function(_0x1c9004){while(--_0x1c9004){_0x34abc5['push'](_0x34abc5['shift']());}};_0x44ac0c(++_0x364e73);}(_0x05b0,0x188));var _0x005b=function(_0x320783,_0x4efca3){_0x320783=_0x320783-0x0;var _0x415c0e=_0x05b0[_0x320783];return _0x415c0e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x005b('0x0'));var jsonpatch=require(_0x005b('0x1'));var rp=require('request-promise');var moment=require(_0x005b('0x2'));var BPromise=require(_0x005b('0x3'));var Mustache=require('mustache');var util=require(_0x005b('0x4'));var path=require(_0x005b('0x5'));var sox=require('sox');var csv=require(_0x005b('0x6'));var ejs=require(_0x005b('0x7'));var fs=require('fs');var fs_extra=require(_0x005b('0x8'));var _=require(_0x005b('0x9'));var squel=require(_0x005b('0xa'));var crypto=require(_0x005b('0xb'));var jsforce=require(_0x005b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x005b('0x6'));var querystring=require(_0x005b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x005b('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x005b('0xf'))(_0x005b('0x10'));var utils=require('../../config/utils');var config=require(_0x005b('0x11'));var licenseUtil=require(_0x005b('0x12'));var db=require(_0x005b('0x13'))['db'];function respondWithStatusCode(_0x10f9bb,_0xce7212){_0xce7212=_0xce7212||0xcc;return function(_0xe2674e){if(_0xe2674e){return _0x10f9bb[_0x005b('0x14')](_0xce7212);}return _0x10f9bb['status'](_0xce7212)['end']();};}function respondWithResult(_0x52ad9c,_0x309c8f){_0x309c8f=_0x309c8f||0xc8;return function(_0x50b7ce){if(_0x50b7ce){return _0x52ad9c[_0x005b('0x15')](_0x309c8f)['json'](_0x50b7ce);}};}function respondWithFilteredResult(_0x1c8eed,_0x1f7743){return function(_0x2ce01e){if(_0x2ce01e){var _0x1991e8=typeof _0x1f7743[_0x005b('0x16')]==='undefined'&&typeof _0x1f7743[_0x005b('0x17')]===_0x005b('0x18');var _0xf3cf84=_0x2ce01e['count'];var _0x206c0a=_0x1991e8?0x0:_0x1f7743[_0x005b('0x16')];var _0x50a6eb=_0x1991e8?_0x2ce01e[_0x005b('0x19')]:_0x1f7743[_0x005b('0x16')]+_0x1f7743[_0x005b('0x17')];var _0x434874;if(_0x50a6eb>=_0xf3cf84){_0x50a6eb=_0xf3cf84;_0x434874=0xc8;}else{_0x434874=0xce;}_0x1c8eed[_0x005b('0x15')](_0x434874);return _0x1c8eed['set'](_0x005b('0x1a'),_0x206c0a+'-'+_0x50a6eb+'/'+_0xf3cf84)[_0x005b('0x1b')](_0x2ce01e);}return null;};}function patchUpdates(_0x4ae164){return function(_0x24637d){try{jsonpatch[_0x005b('0x1c')](_0x24637d,_0x4ae164,!![]);}catch(_0xd97375){return BPromise['reject'](_0xd97375);}return _0x24637d[_0x005b('0x1d')]();};}function saveUpdates(_0x145c36,_0x319981){return function(_0x3521c9){if(_0x3521c9){return _0x3521c9[_0x005b('0x1e')](_0x145c36)[_0x005b('0x1f')](function(_0x4f632f){return _0x4f632f;});}return null;};}function removeEntity(_0x322229,_0x169428){return function(_0x1fef26){if(_0x1fef26){return _0x1fef26['destroy']()[_0x005b('0x1f')](function(){var _0x516a95=_0x1fef26[_0x005b('0x20')]({'plain':!![]});var _0x527294='ChanSpies';return db[_0x005b('0x21')][_0x005b('0x22')]({'where':{'type':_0x527294,'resourceId':_0x516a95['id']}})[_0x005b('0x1f')](function(){return _0x1fef26;});})[_0x005b('0x1f')](function(){_0x322229[_0x005b('0x15')](0xcc)[_0x005b('0x23')]();});}};}function handleEntityNotFound(_0x3d4a1c,_0x2a7266){return function(_0x4e9072){if(!_0x4e9072){_0x3d4a1c[_0x005b('0x14')](0x194);}return _0x4e9072;};}function handleError(_0x288733,_0x185889){_0x185889=_0x185889||0x1f4;return function(_0x13e834){logger[_0x005b('0x24')](_0x13e834[_0x005b('0x25')]);if(_0x13e834[_0x005b('0x26')]){delete _0x13e834['name'];}_0x288733[_0x005b('0x15')](_0x185889)[_0x005b('0x27')](_0x13e834);};}exports[_0x005b('0x28')]=function(_0x3b7524,_0x545a2b){var _0x4ee224={},_0x3699b6={},_0x1c580f={'count':0x0,'rows':[]};var _0x59be70=_['map'](db[_0x005b('0x29')]['rawAttributes'],function(_0x1e5a5c){return{'name':_0x1e5a5c[_0x005b('0x2a')],'type':_0x1e5a5c[_0x005b('0x2b')]['key']};});_0x3699b6['model']=_[_0x005b('0x2c')](_0x59be70,_0x005b('0x26'));_0x3699b6[_0x005b('0x2d')]=_['keys'](_0x3b7524['query']);_0x3699b6[_0x005b('0x2e')]=_[_0x005b('0x2f')](_0x3699b6['model'],_0x3699b6[_0x005b('0x2d')]);_0x4ee224['attributes']=_[_0x005b('0x2f')](_0x3699b6['model'],qs['fields'](_0x3b7524[_0x005b('0x2d')][_0x005b('0x30')]));_0x4ee224[_0x005b('0x31')]=_0x4ee224[_0x005b('0x31')][_0x005b('0x32')]?_0x4ee224['attributes']:_0x3699b6['model'];if(!_0x3b7524[_0x005b('0x2d')][_0x005b('0x33')](_0x005b('0x34'))){_0x4ee224[_0x005b('0x17')]=qs[_0x005b('0x17')](_0x3b7524[_0x005b('0x2d')]['limit']);_0x4ee224[_0x005b('0x16')]=qs[_0x005b('0x16')](_0x3b7524[_0x005b('0x2d')]['offset']);}_0x4ee224[_0x005b('0x35')]=qs[_0x005b('0x36')](_0x3b7524[_0x005b('0x2d')][_0x005b('0x36')]);_0x4ee224[_0x005b('0x37')]=qs[_0x005b('0x2e')](_[_0x005b('0x38')](_0x3b7524[_0x005b('0x2d')],_0x3699b6[_0x005b('0x2e')]),_0x59be70);if(_0x3b7524[_0x005b('0x2d')]['filter']){_0x4ee224[_0x005b('0x37')]=_[_0x005b('0x39')](_0x4ee224['where'],{'$or':_[_0x005b('0x2c')](_0x59be70,function(_0x3dca3a){if(_0x3dca3a[_0x005b('0x2b')]!==_0x005b('0x3a')){var _0x4ec11c={};_0x4ec11c[_0x3dca3a[_0x005b('0x26')]]={'$like':'%'+_0x3b7524[_0x005b('0x2d')]['filter']+'%'};return _0x4ec11c;}})});}_0x4ee224=_[_0x005b('0x39')]({},_0x4ee224,_0x3b7524[_0x005b('0x3b')]);var _0x1ea2fe={'where':_0x4ee224[_0x005b('0x37')]};return db[_0x005b('0x29')]['count'](_0x1ea2fe)['then'](function(_0x1dfe28){_0x1c580f[_0x005b('0x19')]=_0x1dfe28;if(_0x3b7524[_0x005b('0x2d')][_0x005b('0x3c')]){_0x4ee224[_0x005b('0x3d')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x005b('0x3e')](_0x4ee224);})[_0x005b('0x1f')](function(_0x2bbb8a){_0x1c580f[_0x005b('0x3f')]=_0x2bbb8a;return _0x1c580f;})[_0x005b('0x1f')](respondWithFilteredResult(_0x545a2b,_0x4ee224))[_0x005b('0x40')](handleError(_0x545a2b,null));};exports['show']=function(_0x319b3b,_0x5f5b71){var _0x32d6fd={'raw':![],'where':{'id':_0x319b3b['params']['id']}},_0x26375b={};_0x26375b[_0x005b('0x41')]=_[_0x005b('0x42')](db[_0x005b('0x29')][_0x005b('0x43')]);_0x26375b['query']=_[_0x005b('0x42')](_0x319b3b[_0x005b('0x2d')]);_0x26375b[_0x005b('0x2e')]=_[_0x005b('0x2f')](_0x26375b[_0x005b('0x41')],_0x26375b[_0x005b('0x2d')]);_0x32d6fd[_0x005b('0x31')]=_[_0x005b('0x2f')](_0x26375b[_0x005b('0x41')],qs['fields'](_0x319b3b[_0x005b('0x2d')][_0x005b('0x30')]));_0x32d6fd[_0x005b('0x31')]=_0x32d6fd[_0x005b('0x31')][_0x005b('0x32')]?_0x32d6fd['attributes']:_0x26375b[_0x005b('0x41')];if(_0x319b3b[_0x005b('0x2d')][_0x005b('0x3c')]){_0x32d6fd['include']=[{'all':!![]}];}_0x32d6fd=_[_0x005b('0x39')]({},_0x32d6fd,_0x319b3b['options']);return db['VoiceChanSpy']['find'](_0x32d6fd)['then'](handleEntityNotFound(_0x5f5b71,null))[_0x005b('0x1f')](respondWithResult(_0x5f5b71,null))[_0x005b('0x40')](handleError(_0x5f5b71,null));};exports[_0x005b('0x44')]=function(_0xb1898,_0x4e19cd){return db[_0x005b('0x29')][_0x005b('0x44')](_0xb1898['body'],{})[_0x005b('0x1f')](function(_0x223c9c){var _0x15c675=_0xb1898[_0x005b('0x45')][_0x005b('0x20')]({'plain':!![]});if(!_0x15c675)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15c675[_0x005b('0x46')]===_0x005b('0x45')){var _0x2aebe9=_0x223c9c[_0x005b('0x20')]({'plain':!![]});var _0x19ca85=_0x005b('0x47');return db['UserProfileSection'][_0x005b('0x48')]({'where':{'name':_0x19ca85,'userProfileId':_0x15c675[_0x005b('0x49')]},'raw':!![]})[_0x005b('0x1f')](function(_0x3fe1cd){if(_0x3fe1cd&&_0x3fe1cd[_0x005b('0x4a')]===0x0){return db[_0x005b('0x21')]['create']({'name':_0x2aebe9[_0x005b('0x26')],'resourceId':_0x2aebe9['id'],'type':_0x3fe1cd[_0x005b('0x26')],'sectionId':_0x3fe1cd['id']},{})['then'](function(){return _0x223c9c;});}else{return _0x223c9c;}})['catch'](function(_0x22bf46){logger[_0x005b('0x24')](_0x005b('0x4b'),_0x22bf46);throw _0x22bf46;});}return _0x223c9c;})[_0x005b('0x1f')](respondWithResult(_0x4e19cd,0xc9))[_0x005b('0x40')](handleError(_0x4e19cd,null));};exports[_0x005b('0x1e')]=function(_0x91c265,_0x4ffd69){if(_0x91c265[_0x005b('0x4c')]['id']){delete _0x91c265['body']['id'];}return db['VoiceChanSpy'][_0x005b('0x48')]({'where':{'id':_0x91c265[_0x005b('0x4d')]['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x4ffd69,null))['then'](saveUpdates(_0x91c265[_0x005b('0x4c')],null))[_0x005b('0x1f')](respondWithResult(_0x4ffd69,null))[_0x005b('0x40')](handleError(_0x4ffd69,null));};exports['destroy']=function(_0x17018b,_0x4f4130){return db[_0x005b('0x29')][_0x005b('0x48')]({'where':{'id':_0x17018b['params']['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x4f4130,null))[_0x005b('0x1f')](removeEntity(_0x4f4130,null))[_0x005b('0x40')](handleError(_0x4f4130,null));}; \ No newline at end of file +var _0x028d=['util','path','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/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','index','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filter','merge','where','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','filters','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x54fd2c,_0x443bbd){var _0x5299c3=function(_0x43ce01){while(--_0x43ce01){_0x54fd2c['push'](_0x54fd2c['shift']());}};_0x5299c3(++_0x443bbd);}(_0x028d,0xff));var _0xd028=function(_0x3fafca,_0x195c8c){_0x3fafca=_0x3fafca-0x0;var _0x1096a5=_0x028d[_0x3fafca];return _0x1096a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd028('0x0'));var zipdir=require(_0xd028('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd028('0x2'));var moment=require(_0xd028('0x3'));var BPromise=require(_0xd028('0x4'));var Mustache=require(_0xd028('0x5'));var util=require(_0xd028('0x6'));var path=require(_0xd028('0x7'));var sox=require('sox');var csv=require(_0xd028('0x8'));var ejs=require(_0xd028('0x9'));var fs=require('fs');var fs_extra=require(_0xd028('0xa'));var _=require(_0xd028('0xb'));var squel=require(_0xd028('0xc'));var crypto=require(_0xd028('0xd'));var jsforce=require(_0xd028('0xe'));var deskjs=require(_0xd028('0xf'));var toCsv=require(_0xd028('0x8'));var querystring=require(_0xd028('0x10'));var Papa=require(_0xd028('0x11'));var Redis=require(_0xd028('0x12'));var authService=require(_0xd028('0x13'));var qs=require(_0xd028('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd028('0x15'));var logger=require(_0xd028('0x16'))(_0xd028('0x17'));var utils=require(_0xd028('0x18'));var config=require(_0xd028('0x19'));var licenseUtil=require(_0xd028('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34b5fa,_0x144696){_0x144696=_0x144696||0xcc;return function(_0x4817a4){if(_0x4817a4){return _0x34b5fa[_0xd028('0x1b')](_0x144696);}return _0x34b5fa[_0xd028('0x1c')](_0x144696)[_0xd028('0x1d')]();};}function respondWithResult(_0x17b112,_0x1667bf){_0x1667bf=_0x1667bf||0xc8;return function(_0x5ec067){if(_0x5ec067){return _0x17b112[_0xd028('0x1c')](_0x1667bf)[_0xd028('0x1e')](_0x5ec067);}};}function respondWithFilteredResult(_0x3937b4,_0x3bac54){return function(_0x12450d){if(_0x12450d){var _0x463d38=typeof _0x3bac54['offset']===_0xd028('0x1f')&&typeof _0x3bac54['limit']===_0xd028('0x1f');var _0x2f4af6=_0x12450d[_0xd028('0x20')];var _0x4df54f=_0x463d38?0x0:_0x3bac54[_0xd028('0x21')];var _0x5a47a6=_0x463d38?_0x12450d[_0xd028('0x20')]:_0x3bac54['offset']+_0x3bac54[_0xd028('0x22')];var _0x415d6c;if(_0x5a47a6>=_0x2f4af6){_0x5a47a6=_0x2f4af6;_0x415d6c=0xc8;}else{_0x415d6c=0xce;}_0x3937b4[_0xd028('0x1c')](_0x415d6c);return _0x3937b4['set'](_0xd028('0x23'),_0x4df54f+'-'+_0x5a47a6+'/'+_0x2f4af6)[_0xd028('0x1e')](_0x12450d);}return null;};}function patchUpdates(_0x1a2767){return function(_0x1648a7){try{jsonpatch[_0xd028('0x24')](_0x1648a7,_0x1a2767,!![]);}catch(_0x4830a4){return BPromise[_0xd028('0x25')](_0x4830a4);}return _0x1648a7[_0xd028('0x26')]();};}function saveUpdates(_0x8a964d,_0x75657f){return function(_0x3203f9){if(_0x3203f9){return _0x3203f9[_0xd028('0x27')](_0x8a964d)[_0xd028('0x28')](function(_0x54beee){return _0x54beee;});}return null;};}function removeEntity(_0x115fef,_0x10d629){return function(_0x13e5f4){if(_0x13e5f4){return _0x13e5f4[_0xd028('0x29')]()['then'](function(){var _0x2ad8ee=_0x13e5f4[_0xd028('0x2a')]({'plain':!![]});var _0x26eb4e=_0xd028('0x2b');return db[_0xd028('0x2c')][_0xd028('0x29')]({'where':{'type':_0x26eb4e,'resourceId':_0x2ad8ee['id']}})[_0xd028('0x28')](function(){return _0x13e5f4;});})[_0xd028('0x28')](function(){_0x115fef[_0xd028('0x1c')](0xcc)[_0xd028('0x1d')]();});}};}function handleEntityNotFound(_0x38a294,_0x2db5c1){return function(_0x20d7ff){if(!_0x20d7ff){_0x38a294[_0xd028('0x1b')](0x194);}return _0x20d7ff;};}function handleError(_0x39a8dd,_0x3294fe){_0x3294fe=_0x3294fe||0x1f4;return function(_0x3112e8){logger[_0xd028('0x2d')](_0x3112e8[_0xd028('0x2e')]);if(_0x3112e8[_0xd028('0x2f')]){delete _0x3112e8[_0xd028('0x2f')];}_0x39a8dd['status'](_0x3294fe)['send'](_0x3112e8);};}exports[_0xd028('0x30')]=function(_0x928570,_0x2caf5d){var _0x26c44c={},_0x53d887={},_0x44f940={'count':0x0,'rows':[]};var _0x4ae1fb=_['map'](db[_0xd028('0x31')][_0xd028('0x32')],function(_0xcaffce){return{'name':_0xcaffce[_0xd028('0x33')],'type':_0xcaffce[_0xd028('0x34')][_0xd028('0x35')]};});_0x53d887[_0xd028('0x36')]=_['map'](_0x4ae1fb,'name');_0x53d887[_0xd028('0x37')]=_[_0xd028('0x38')](_0x928570['query']);_0x53d887['filters']=_[_0xd028('0x39')](_0x53d887[_0xd028('0x36')],_0x53d887[_0xd028('0x37')]);_0x26c44c[_0xd028('0x3a')]=_[_0xd028('0x39')](_0x53d887[_0xd028('0x36')],qs[_0xd028('0x3b')](_0x928570[_0xd028('0x37')][_0xd028('0x3b')]));_0x26c44c[_0xd028('0x3a')]=_0x26c44c[_0xd028('0x3a')]['length']?_0x26c44c['attributes']:_0x53d887['model'];if(!_0x928570['query']['hasOwnProperty'](_0xd028('0x3c'))){_0x26c44c['limit']=qs['limit'](_0x928570['query'][_0xd028('0x22')]);_0x26c44c['offset']=qs[_0xd028('0x21')](_0x928570['query']['offset']);}_0x26c44c[_0xd028('0x3d')]=qs[_0xd028('0x3e')](_0x928570['query'][_0xd028('0x3e')]);_0x26c44c['where']=qs['filters'](_['pick'](_0x928570['query'],_0x53d887['filters']),_0x4ae1fb);if(_0x928570[_0xd028('0x37')][_0xd028('0x3f')]){_0x26c44c['where']=_[_0xd028('0x40')](_0x26c44c[_0xd028('0x41')],{'$or':_[_0xd028('0x42')](_0x4ae1fb,function(_0x42a6a3){if(_0x42a6a3[_0xd028('0x34')]!==_0xd028('0x43')){var _0x4dd213={};_0x4dd213[_0x42a6a3[_0xd028('0x2f')]]={'$like':'%'+_0x928570[_0xd028('0x37')][_0xd028('0x3f')]+'%'};return _0x4dd213;}})});}_0x26c44c=_['merge']({},_0x26c44c,_0x928570[_0xd028('0x44')]);var _0x301d05={'where':_0x26c44c[_0xd028('0x41')]};return db['VoiceChanSpy'][_0xd028('0x20')](_0x301d05)['then'](function(_0x26e51c){_0x44f940[_0xd028('0x20')]=_0x26e51c;if(_0x928570[_0xd028('0x37')][_0xd028('0x45')]){_0x26c44c[_0xd028('0x46')]=[{'all':!![]}];}return db[_0xd028('0x31')][_0xd028('0x47')](_0x26c44c);})[_0xd028('0x28')](function(_0x3065f2){_0x44f940['rows']=_0x3065f2;return _0x44f940;})[_0xd028('0x28')](respondWithFilteredResult(_0x2caf5d,_0x26c44c))[_0xd028('0x48')](handleError(_0x2caf5d,null));};exports[_0xd028('0x49')]=function(_0xd560b3,_0x519d79){var _0x15c071={'raw':![],'where':{'id':_0xd560b3[_0xd028('0x4a')]['id']}},_0x8fb589={};_0x8fb589['model']=_[_0xd028('0x38')](db[_0xd028('0x31')]['rawAttributes']);_0x8fb589[_0xd028('0x37')]=_[_0xd028('0x38')](_0xd560b3[_0xd028('0x37')]);_0x8fb589[_0xd028('0x4b')]=_[_0xd028('0x39')](_0x8fb589[_0xd028('0x36')],_0x8fb589[_0xd028('0x37')]);_0x15c071[_0xd028('0x3a')]=_[_0xd028('0x39')](_0x8fb589[_0xd028('0x36')],qs['fields'](_0xd560b3[_0xd028('0x37')][_0xd028('0x3b')]));_0x15c071[_0xd028('0x3a')]=_0x15c071[_0xd028('0x3a')][_0xd028('0x4c')]?_0x15c071[_0xd028('0x3a')]:_0x8fb589['model'];if(_0xd560b3[_0xd028('0x37')][_0xd028('0x45')]){_0x15c071[_0xd028('0x46')]=[{'all':!![]}];}_0x15c071=_[_0xd028('0x40')]({},_0x15c071,_0xd560b3[_0xd028('0x44')]);return db['VoiceChanSpy']['find'](_0x15c071)['then'](handleEntityNotFound(_0x519d79,null))['then'](respondWithResult(_0x519d79,null))[_0xd028('0x48')](handleError(_0x519d79,null));};exports[_0xd028('0x4d')]=function(_0x2ca45d,_0x3db4b8){return db[_0xd028('0x31')][_0xd028('0x4d')](_0x2ca45d[_0xd028('0x4e')],{})[_0xd028('0x28')](function(_0x1947ca){var _0x52489b=_0x2ca45d[_0xd028('0x4f')][_0xd028('0x2a')]({'plain':!![]});if(!_0x52489b)throw new Error(_0xd028('0x50'));if(_0x52489b[_0xd028('0x51')]===_0xd028('0x4f')){var _0x13b619=_0x1947ca['get']({'plain':!![]});var _0x59428e=_0xd028('0x2b');return db[_0xd028('0x52')]['find']({'where':{'name':_0x59428e,'userProfileId':_0x52489b[_0xd028('0x53')]},'raw':!![]})[_0xd028('0x28')](function(_0x3a70d9){if(_0x3a70d9&&_0x3a70d9[_0xd028('0x54')]===0x0){return db[_0xd028('0x2c')][_0xd028('0x4d')]({'name':_0x13b619[_0xd028('0x2f')],'resourceId':_0x13b619['id'],'type':_0x3a70d9[_0xd028('0x2f')],'sectionId':_0x3a70d9['id']},{})[_0xd028('0x28')](function(){return _0x1947ca;});}else{return _0x1947ca;}})['catch'](function(_0x56a07d){logger[_0xd028('0x2d')](_0xd028('0x55'),_0x56a07d);throw _0x56a07d;});}return _0x1947ca;})['then'](respondWithResult(_0x3db4b8,0xc9))['catch'](handleError(_0x3db4b8,null));};exports[_0xd028('0x27')]=function(_0x455826,_0x32dc1a){if(_0x455826['body']['id']){delete _0x455826[_0xd028('0x4e')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x455826['params']['id']}})[_0xd028('0x28')](handleEntityNotFound(_0x32dc1a,null))[_0xd028('0x28')](saveUpdates(_0x455826[_0xd028('0x4e')],null))[_0xd028('0x28')](respondWithResult(_0x32dc1a,null))[_0xd028('0x48')](handleError(_0x32dc1a,null));};exports[_0xd028('0x29')]=function(_0x3c35b9,_0x4b46cf){return db[_0xd028('0x31')][_0xd028('0x56')]({'where':{'id':_0x3c35b9[_0xd028('0x4a')]['id']}})[_0xd028('0x28')](handleEntityNotFound(_0x4b46cf,null))[_0xd028('0x28')](removeEntity(_0x4b46cf,null))[_0xd028('0x48')](handleError(_0x4b46cf,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index d52bfd3..8f2cef1 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 _0x5477=['Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','password','push','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','internal','concat','User','agent','then','exports','define','VoiceChanSpy','voice_chanspy','bulkCreate','catch','destroy','VoiceExtension','lodash','util','from-sip','format','%s%s','system','merge'];(function(_0x1f4c83,_0x2ab1dc){var _0xa8b4e7=function(_0x1150d5){while(--_0x1150d5){_0x1f4c83['push'](_0x1f4c83['shift']());}};_0xa8b4e7(++_0x2ab1dc);}(_0x5477,0x1a9));var _0x7547=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x5477[_0x4a7631];return _0x1a5a6f;};'use strict';var _=require(_0x7547('0x0'));var util=require(_0x7547('0x1'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x419cbd,_0x314fbe,_0x5335ff){var _0x34e191=0x1;var _0x22b436=[];var _0x2db489={'context':_0x314fbe['context']||_0x7547('0x2'),'exten':util[_0x7547('0x3')](_0x7547('0x4'),_0x419cbd['prefix'],_0x5335ff),'type':_0x7547('0x5'),'isApp':![],'ChanSpyId':_0x419cbd['id'],'UserId':_0x314fbe['id']};_0x22b436['push'](_[_0x7547('0x6')]({'app':_0x7547('0x7'),'appdata':util[_0x7547('0x3')](_0x7547('0x8'),_0x7547('0x9')),'priority':_0x34e191++},_0x2db489));if(_0x419cbd[_0x7547('0xa')]){_0x22b436['push'](_[_0x7547('0x6')]({'app':_0x7547('0xb'),'appdata':util[_0x7547('0x3')]('${UNIQUEID}.%s,a',_0x419cbd[_0x7547('0xc')]),'priority':_0x34e191++},_0x2db489));}if(_0x419cbd[_0x7547('0xd')]){_0x22b436['push'](_[_0x7547('0x6')]({'app':_0x7547('0xe'),'appdata':_0x419cbd[_0x7547('0xf')],'priority':_0x34e191++},_0x2db489));}_0x22b436[_0x7547('0x10')](_['merge']({'app':_0x7547('0x11'),'appdata':util['format'](_0x7547('0x12'),_0x314fbe[_0x7547('0x13')],_0x419cbd[_0x7547('0x14')]?_0x419cbd[_0x7547('0x14')]['join'](''):''),'priority':_0x34e191++},_0x2db489));if(_0x419cbd[_0x7547('0xa')]){_0x22b436['push'](_[_0x7547('0x6')]({'app':_0x7547('0x15'),'priority':_0x34e191++},_0x2db489));}return _0x22b436;};var getChanSpyApplications=function(_0x26f4fb,_0x228f40){var _0x327e24=[];for(var _0x488cb4=0x0,_0x1ffb8f=0x1;_0x488cb4<_0x228f40[_0x7547('0x16')];_0x488cb4++,_0x1ffb8f=0x1){_0x327e24=_0x327e24['concat'](getUserApplications(_0x26f4fb,_0x228f40[_0x488cb4],_0x228f40[_0x488cb4][_0x7547('0x17')]));if(_0x228f40[_0x488cb4][_0x7547('0x17')]!=_0x228f40[_0x488cb4][_0x7547('0x13')]){_0x327e24=_0x327e24[_0x7547('0x18')](getUserApplications(_0x26f4fb,_0x228f40[_0x488cb4],_0x228f40[_0x488cb4][_0x7547('0x13')]));}}return _0x327e24;};var getChanSpyPromise=function(_0x4d6b84,_0x3b44a5){return new BPromise(function(_0x15c9d6,_0x24eca5){return _0x4d6b84[_0x7547('0x19')]['findAll']({'attributes':['id',_0x7547('0x13'),_0x7547('0x17')],'where':{'role':_0x7547('0x1a'),'chanspy':!![]},'raw':!![]})[_0x7547('0x1b')](function(_0x409c51){if(_0x409c51){return _0x15c9d6(getChanSpyApplications(_0x3b44a5,_0x409c51));}return _0x15c9d6([]);})['catch'](function(_0x273f4a){_0x24eca5(_0x273f4a);});});};module[_0x7547('0x1c')]=function(_0x2fd78c,_0x32f7a5){var _0x3881da=_0x2fd78c['models'];return _0x2fd78c[_0x7547('0x1d')](_0x7547('0x1e'),attributes,{'tableName':_0x7547('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x49425b,_0x54c88e,_0x4ad4fe){return getChanSpyPromise(_0x3881da,_0x49425b)[_0x7547('0x1b')](function(_0x1971d2){if(_0x1971d2&&_0x1971d2[_0x7547('0x16')]){return _0x3881da['VoiceExtension'][_0x7547('0x20')](_0x1971d2);}})[_0x7547('0x1b')](function(){_0x4ad4fe();})[_0x7547('0x21')](function(_0x2cfac6){_0x4ad4fe(_0x2cfac6);});},'afterUpdate':function(_0x4d0d78,_0x1339cc,_0x4ad06e){return _0x3881da['VoiceExtension'][_0x7547('0x22')]({'where':{'ChanSpyId':_0x4d0d78['id']}})[_0x7547('0x1b')](function(){return getChanSpyPromise(_0x3881da,_0x4d0d78);})[_0x7547('0x1b')](function(_0x1ab25e){if(_0x1ab25e&&_0x1ab25e['length']){return _0x3881da[_0x7547('0x23')][_0x7547('0x20')](_0x1ab25e);}})[_0x7547('0x1b')](function(){_0x4ad06e();})[_0x7547('0x21')](function(_0x4bf176){_0x4ad06e(_0x4bf176);});},'afterDestroy':function(_0x1570ee,_0x15544b,_0x285e38){return _0x3881da[_0x7547('0x23')][_0x7547('0x22')]({'where':{'ChanSpyId':_0x1570ee['id']}})[_0x7547('0x1b')](function(){_0x285e38();})[_0x7547('0x21')](function(_0x242b70){_0x285e38(_0x242b70);});}}});}; \ No newline at end of file +var _0x6977=['push','Set','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','merge','Authenticate','password','ChanSpy','SIP/%s,%s','name','join','length','concat','internal','User','findAll','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','system'];(function(_0x42c1bb,_0x3f693d){var _0x34c989=function(_0xf1488){while(--_0xf1488){_0x42c1bb['push'](_0x42c1bb['shift']());}};_0x34c989(++_0x3f693d);}(_0x6977,0x1a4));var _0x7697=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6977[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7697('0x0'));var util=require(_0x7697('0x1'));var BPromise=require(_0x7697('0x2'));var attributes=require(_0x7697('0x3'));var getUserApplications=function(_0x312adc,_0x38d8a6,_0x1a0e84){var _0x5483cc=0x1;var _0x5a14f7=[];var _0x18448e={'context':_0x38d8a6[_0x7697('0x4')]||_0x7697('0x5'),'exten':util[_0x7697('0x6')](_0x7697('0x7'),_0x312adc['prefix'],_0x1a0e84),'type':_0x7697('0x8'),'isApp':![],'ChanSpyId':_0x312adc['id'],'UserId':_0x38d8a6['id']};_0x5a14f7[_0x7697('0x9')](_['merge']({'app':_0x7697('0xa'),'appdata':util[_0x7697('0x6')](_0x7697('0xb'),_0x7697('0xc')),'priority':_0x5483cc++},_0x18448e));if(_0x312adc['record']){_0x5a14f7[_0x7697('0x9')](_['merge']({'app':_0x7697('0xd'),'appdata':util[_0x7697('0x6')](_0x7697('0xe'),_0x312adc[_0x7697('0xf')]),'priority':_0x5483cc++},_0x18448e));}if(_0x312adc['auth']){_0x5a14f7[_0x7697('0x9')](_[_0x7697('0x10')]({'app':_0x7697('0x11'),'appdata':_0x312adc[_0x7697('0x12')],'priority':_0x5483cc++},_0x18448e));}_0x5a14f7['push'](_[_0x7697('0x10')]({'app':_0x7697('0x13'),'appdata':util[_0x7697('0x6')](_0x7697('0x14'),_0x38d8a6[_0x7697('0x15')],_0x312adc['options']?_0x312adc['options'][_0x7697('0x16')](''):''),'priority':_0x5483cc++},_0x18448e));if(_0x312adc['record']){_0x5a14f7[_0x7697('0x9')](_['merge']({'app':'StopMixMonitor','priority':_0x5483cc++},_0x18448e));}return _0x5a14f7;};var getChanSpyApplications=function(_0x4c4723,_0xe06adf){var _0x505f8e=[];for(var _0x69a0b=0x0,_0x208ee0=0x1;_0x69a0b<_0xe06adf[_0x7697('0x17')];_0x69a0b++,_0x208ee0=0x1){_0x505f8e=_0x505f8e[_0x7697('0x18')](getUserApplications(_0x4c4723,_0xe06adf[_0x69a0b],_0xe06adf[_0x69a0b][_0x7697('0x19')]));if(_0xe06adf[_0x69a0b][_0x7697('0x19')]!=_0xe06adf[_0x69a0b][_0x7697('0x15')]){_0x505f8e=_0x505f8e['concat'](getUserApplications(_0x4c4723,_0xe06adf[_0x69a0b],_0xe06adf[_0x69a0b]['name']));}}return _0x505f8e;};var getChanSpyPromise=function(_0x249b8e,_0x3e7bd9){return new BPromise(function(_0xe27f3e,_0x4bfc16){return _0x249b8e[_0x7697('0x1a')][_0x7697('0x1b')]({'attributes':['id',_0x7697('0x15'),_0x7697('0x19')],'where':{'role':_0x7697('0x1c'),'chanspy':!![]},'raw':!![]})[_0x7697('0x1d')](function(_0x3d0d98){if(_0x3d0d98){return _0xe27f3e(getChanSpyApplications(_0x3e7bd9,_0x3d0d98));}return _0xe27f3e([]);})['catch'](function(_0x5d8f43){_0x4bfc16(_0x5d8f43);});});};module[_0x7697('0x1e')]=function(_0x2eba7a,_0x232077){var _0xcc8728=_0x2eba7a[_0x7697('0x1f')];return _0x2eba7a[_0x7697('0x20')](_0x7697('0x21'),attributes,{'tableName':_0x7697('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x25c11e,_0x26ea10,_0x991f6f){return getChanSpyPromise(_0xcc8728,_0x25c11e)[_0x7697('0x1d')](function(_0x4176ae){if(_0x4176ae&&_0x4176ae[_0x7697('0x17')]){return _0xcc8728[_0x7697('0x23')][_0x7697('0x24')](_0x4176ae);}})['then'](function(){_0x991f6f();})[_0x7697('0x25')](function(_0x38cf4b){_0x991f6f(_0x38cf4b);});},'afterUpdate':function(_0x33af11,_0x4a3955,_0x639f0c){return _0xcc8728[_0x7697('0x23')][_0x7697('0x26')]({'where':{'ChanSpyId':_0x33af11['id']}})[_0x7697('0x1d')](function(){return getChanSpyPromise(_0xcc8728,_0x33af11);})[_0x7697('0x1d')](function(_0x432e8b){if(_0x432e8b&&_0x432e8b[_0x7697('0x17')]){return _0xcc8728[_0x7697('0x23')][_0x7697('0x24')](_0x432e8b);}})[_0x7697('0x1d')](function(){_0x639f0c();})[_0x7697('0x25')](function(_0x356212){_0x639f0c(_0x356212);});},'afterDestroy':function(_0x2abf6d,_0x4820ea,_0x35681f){return _0xcc8728[_0x7697('0x23')]['destroy']({'where':{'ChanSpyId':_0x2abf6d['id']}})[_0x7697('0x1d')](function(){_0x35681f();})['catch'](function(_0x3d948e){_0x35681f(_0x3d948e);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index e6341e5..57cde24 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 _0x750a=['error','code','VoiceChanSpy,\x20%s,\x20%s','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify'];(function(_0x1d82a8,_0x32a744){var _0x368fcc=function(_0x78bf67){while(--_0x78bf67){_0x1d82a8['push'](_0x1d82a8['shift']());}};_0x368fcc(++_0x32a744);}(_0x750a,0x140));var _0xa750=function(_0x5a18ed,_0x9936d2){_0x5a18ed=_0x5a18ed-0x0;var _0x12d357=_0x750a[_0x5a18ed];return _0x12d357;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});} \ No newline at end of file +var _0x6e6c=['randomstring','../../config/utils','rpc','jayson/promise','client','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird'];(function(_0x36d25e,_0x1a047d){var _0x4b95b8=function(_0x74da3){while(--_0x74da3){_0x36d25e['push'](_0x36d25e['shift']());}};_0x4b95b8(++_0x1a047d);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var moment=require('moment');var BPromise=require(_0xc6e6('0x2'));var rs=require(_0xc6e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc6e6('0x4'));var logger=require('../../config/logger')(_0xc6e6('0x5'));var config=require('../../config/environment');var jayson=require(_0xc6e6('0x6'));var client=jayson[_0xc6e6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301f55,_0x30a10b,_0x4da7bd){return new BPromise(function(_0x324706,_0x15d268){return client['request'](_0x301f55,_0x4da7bd)[_0xc6e6('0x8')](function(_0x481799){logger[_0xc6e6('0x9')](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));logger[_0xc6e6('0xc')](_0xc6e6('0xd'),_0x30a10b,_0xc6e6('0xb'),JSON[_0xc6e6('0xe')](_0x481799));if(_0x481799[_0xc6e6('0xf')]){if(_0x481799[_0xc6e6('0xf')]['code']===0x1f4){logger[_0xc6e6('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x15d268(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}logger['error'](_0xc6e6('0xa'),_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x324706(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}else{logger['info'](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));_0x324706(_0x481799['result'][_0xc6e6('0x10')]);}})[_0xc6e6('0x11')](function(_0xedf127){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x30a10b,_0xedf127);_0x15d268(_0xedf127);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 4974707..85b942a 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 _0x45e9=['express','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x294023,_0x162f34){var _0x42df52=function(_0x3de868){while(--_0x3de868){_0x294023['push'](_0x294023['shift']());}};_0x42df52(++_0x162f34);}(_0x45e9,0x1f0));var _0x945e=function(_0x290176,_0x3ba2da){_0x290176=_0x290176-0x0;var _0x32eb68=_0x45e9[_0x290176];return _0x32eb68;};'use strict';var multer=require(_0x945e('0x0'));var util=require(_0x945e('0x1'));var path=require(_0x945e('0x2'));var timeout=require(_0x945e('0x3'));var express=require(_0x945e('0x4'));var router=express['Router']();var fs_extra=require(_0x945e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x945e('0x6'));var config=require(_0x945e('0x7'));var controller=require(_0x945e('0x8'));router[_0x945e('0x9')]('/',auth[_0x945e('0xa')](),controller[_0x945e('0xb')]);router[_0x945e('0x9')](_0x945e('0xc'),auth[_0x945e('0xa')](),controller[_0x945e('0xd')]);router[_0x945e('0xe')]('/',auth[_0x945e('0xa')](),controller[_0x945e('0xf')]);router['put'](_0x945e('0xc'),auth['isAuthenticated'](),controller[_0x945e('0x10')]);router[_0x945e('0x11')](_0x945e('0xc'),auth[_0x945e('0xa')](),controller[_0x945e('0x12')]);module[_0x945e('0x13')]=router; \ No newline at end of file +var _0x1b3c=['post','put','update','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show'];(function(_0x17e8a2,_0x16e8e6){var _0xe752f9=function(_0x10b391){while(--_0x10b391){_0x17e8a2['push'](_0x17e8a2['shift']());}};_0xe752f9(++_0x16e8e6);}(_0x1b3c,0x1d5));var _0xc1b3=function(_0x24c46d,_0x52b2ac){_0x24c46d=_0x24c46d-0x0;var _0x127ad6=_0x1b3c[_0x24c46d];return _0x127ad6;};'use strict';var multer=require('multer');var util=require(_0xc1b3('0x0'));var path=require(_0xc1b3('0x1'));var timeout=require('connect-timeout');var express=require(_0xc1b3('0x2'));var router=express[_0xc1b3('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc1b3('0x4'));var config=require(_0xc1b3('0x5'));var controller=require('./voiceContext.controller');router[_0xc1b3('0x6')]('/',auth['isAuthenticated'](),controller[_0xc1b3('0x7')]);router[_0xc1b3('0x6')](_0xc1b3('0x8'),auth[_0xc1b3('0x9')](),controller[_0xc1b3('0xa')]);router[_0xc1b3('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc1b3('0xc')]('/:id',auth[_0xc1b3('0x9')](),controller[_0xc1b3('0xd')]);router['delete'](_0xc1b3('0x8'),auth[_0xc1b3('0x9')](),controller[_0xc1b3('0xe')]);module[_0xc1b3('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 f73b4a5..35c88f6 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 _0x2817=['STRING','sequelize'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x2817,0x183));var _0x7281=function(_0x19a412,_0x1864d2){_0x19a412=_0x19a412-0x0;var _0x4b79d1=_0x2817[_0x19a412];return _0x4b79d1;};'use strict';var Sequelize=require(_0x7281('0x0'));module['exports']={'name':{'type':Sequelize[_0x7281('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x7281('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x655d=['sequelize','STRING','name'];(function(_0x45239b,_0x2528f8){var _0x4f8190=function(_0x5a14d0){while(--_0x5a14d0){_0x45239b['push'](_0x45239b['shift']());}};_0x4f8190(++_0x2528f8);}(_0x655d,0x1d1));var _0xd655=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x655d[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xd655('0x0'));module['exports']={'name':{'type':Sequelize[_0xd655('0x1')],'unique':_0xd655('0x2')},'description':{'type':Sequelize[_0xd655('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 88a796d..78dbd67 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 _0x0bf9=['root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','render','params','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','name','send','index','VoiceContext','rawAttributes','type','key','model','map','query','intersection','fields','attributes','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','include','findAll','rows','show','keys','length','includeAll','find','create','body','readFileSync','join'];(function(_0xafde4a,_0x14e260){var _0x4199fb=function(_0xc5db4d){while(--_0xc5db4d){_0xafde4a['push'](_0xafde4a['shift']());}};_0x4199fb(++_0x14e260);}(_0x0bf9,0xe3));var _0x90bf=function(_0x7abf43,_0x2efe0c){_0x7abf43=_0x7abf43-0x0;var _0x365cb5=_0x0bf9[_0x7abf43];return _0x365cb5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x90bf('0x0'));var rp=require(_0x90bf('0x1'));var moment=require(_0x90bf('0x2'));var BPromise=require(_0x90bf('0x3'));var Mustache=require(_0x90bf('0x4'));var util=require(_0x90bf('0x5'));var path=require(_0x90bf('0x6'));var sox=require(_0x90bf('0x7'));var csv=require(_0x90bf('0x8'));var ejs=require(_0x90bf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x90bf('0xa'));var squel=require(_0x90bf('0xb'));var crypto=require(_0x90bf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x90bf('0xd'));var toCsv=require(_0x90bf('0x8'));var querystring=require(_0x90bf('0xe'));var Papa=require('papaparse');var Redis=require(_0x90bf('0xf'));var authService=require(_0x90bf('0x10'));var qs=require(_0x90bf('0x11'));var as=require(_0x90bf('0x12'));var hardwareService=require(_0x90bf('0x13'));var logger=require(_0x90bf('0x14'))(_0x90bf('0x15'));var utils=require(_0x90bf('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x90bf('0x17'));var db=require(_0x90bf('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x90bf('0x19')][_0x90bf('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x36ee85,_0x2c077d,_0x2004b0,_0x56c671){return new BPromise(function(_0x1fd823,_0x23d1c0){var _0x31d6c9=_0x56c671||client;return _0x31d6c9[_0x90bf('0x1b')](_0x36ee85,_0x2004b0)[_0x90bf('0x1c')](function(_0x4c1f0e){logger[_0x90bf('0x1d')](_0x90bf('0x1e'),_0x2c077d,_0x90bf('0x1f'));logger[_0x90bf('0x20')](_0x90bf('0x21'),_0x2c077d,_0x90bf('0x1f'),JSON[_0x90bf('0x22')](_0x4c1f0e));if(_0x4c1f0e[_0x90bf('0x23')]){if(_0x4c1f0e['error'][_0x90bf('0x24')]===0x1f4){logger[_0x90bf('0x23')](_0x90bf('0x1e'),_0x2c077d,_0x4c1f0e[_0x90bf('0x23')][_0x90bf('0x25')]);return _0x23d1c0(_0x4c1f0e[_0x90bf('0x23')]['message']);}logger[_0x90bf('0x23')](_0x90bf('0x1e'),_0x2c077d,_0x4c1f0e[_0x90bf('0x23')][_0x90bf('0x25')]);return _0x1fd823(_0x4c1f0e[_0x90bf('0x23')][_0x90bf('0x25')]);}else{logger[_0x90bf('0x1d')](_0x90bf('0x1e'),_0x2c077d,'request\x20sent');_0x1fd823(_0x4c1f0e[_0x90bf('0x26')][_0x90bf('0x25')]);}})[_0x90bf('0x27')](function(_0x28a02a){logger[_0x90bf('0x23')](_0x90bf('0x1e'),_0x2c077d,_0x28a02a);_0x23d1c0(_0x28a02a);});});}function respondWithStatusCode(_0x158d27,_0x5a4d2f){_0x5a4d2f=_0x5a4d2f||0xcc;return function(_0x52b51f){if(_0x52b51f){return _0x158d27[_0x90bf('0x28')](_0x5a4d2f);}return _0x158d27[_0x90bf('0x29')](_0x5a4d2f)[_0x90bf('0x2a')]();};}function respondWithResult(_0x58e40d,_0x22fe18){_0x22fe18=_0x22fe18||0xc8;return function(_0x477c77){if(_0x477c77){return _0x58e40d[_0x90bf('0x29')](_0x22fe18)[_0x90bf('0x2b')](_0x477c77);}};}function respondWithFilteredResult(_0x2f77ef,_0x4060c9){return function(_0x2aa241){if(_0x2aa241){var _0x580592=typeof _0x4060c9[_0x90bf('0x2c')]===_0x90bf('0x2d')&&typeof _0x4060c9[_0x90bf('0x2e')]===_0x90bf('0x2d');var _0x51b52b=_0x2aa241[_0x90bf('0x2f')];var _0x37fd8a=_0x580592?0x0:_0x4060c9[_0x90bf('0x2c')];var _0xce4e28=_0x580592?_0x2aa241[_0x90bf('0x2f')]:_0x4060c9['offset']+_0x4060c9[_0x90bf('0x2e')];var _0x10b1e3;if(_0xce4e28>=_0x51b52b){_0xce4e28=_0x51b52b;_0x10b1e3=0xc8;}else{_0x10b1e3=0xce;}_0x2f77ef[_0x90bf('0x29')](_0x10b1e3);return _0x2f77ef[_0x90bf('0x30')](_0x90bf('0x31'),_0x37fd8a+'-'+_0xce4e28+'/'+_0x51b52b)[_0x90bf('0x2b')](_0x2aa241);}return null;};}function patchUpdates(_0x196bd2){return function(_0x23517c){try{jsonpatch['apply'](_0x23517c,_0x196bd2,!![]);}catch(_0x5316d6){return BPromise[_0x90bf('0x32')](_0x5316d6);}return _0x23517c[_0x90bf('0x33')]();};}function saveUpdates(_0x3d39c8,_0x210b09){return function(_0x1b4748){if(_0x1b4748){return _0x1b4748[_0x90bf('0x34')](_0x3d39c8)[_0x90bf('0x1c')](function(_0xa72b7a){return _0xa72b7a;});}return null;};}function removeEntity(_0x490b58,_0x3ee594){return function(_0xc43c62){if(_0xc43c62){return _0xc43c62[_0x90bf('0x35')]()[_0x90bf('0x1c')](function(){var _0x441c86=_0xc43c62[_0x90bf('0x36')]({'plain':!![]});var _0x24b6da='Contexts';return db['UserProfileResource'][_0x90bf('0x35')]({'where':{'type':_0x24b6da,'resourceId':_0x441c86['id']}})[_0x90bf('0x1c')](function(){return _0xc43c62;});})[_0x90bf('0x1c')](function(){_0x490b58[_0x90bf('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53b089,_0x30b801){return function(_0x3cdf9d){if(!_0x3cdf9d){_0x53b089[_0x90bf('0x28')](0x194);}return _0x3cdf9d;};}function handleError(_0x3a3a5b,_0x2d513b){_0x2d513b=_0x2d513b||0x1f4;return function(_0x4c2358){logger[_0x90bf('0x23')](_0x4c2358['stack']);if(_0x4c2358[_0x90bf('0x37')]){delete _0x4c2358[_0x90bf('0x37')];}_0x3a3a5b[_0x90bf('0x29')](_0x2d513b)[_0x90bf('0x38')](_0x4c2358);};}exports[_0x90bf('0x39')]=function(_0x21e15f,_0x5d2a91){var _0xb1eeb9={},_0x2f678a={},_0x4c5899={'count':0x0,'rows':[]};var _0x50be25=_['map'](db[_0x90bf('0x3a')][_0x90bf('0x3b')],function(_0x15b14c){return{'name':_0x15b14c['fieldName'],'type':_0x15b14c[_0x90bf('0x3c')][_0x90bf('0x3d')]};});_0x2f678a[_0x90bf('0x3e')]=_[_0x90bf('0x3f')](_0x50be25,_0x90bf('0x37'));_0x2f678a[_0x90bf('0x40')]=_['keys'](_0x21e15f[_0x90bf('0x40')]);_0x2f678a['filters']=_[_0x90bf('0x41')](_0x2f678a[_0x90bf('0x3e')],_0x2f678a['query']);_0xb1eeb9['attributes']=_[_0x90bf('0x41')](_0x2f678a[_0x90bf('0x3e')],qs['fields'](_0x21e15f[_0x90bf('0x40')][_0x90bf('0x42')]));_0xb1eeb9[_0x90bf('0x43')]=_0xb1eeb9['attributes']['length']?_0xb1eeb9[_0x90bf('0x43')]:_0x2f678a['model'];if(!_0x21e15f[_0x90bf('0x40')][_0x90bf('0x44')]('nolimit')){_0xb1eeb9[_0x90bf('0x2e')]=qs[_0x90bf('0x2e')](_0x21e15f[_0x90bf('0x40')]['limit']);_0xb1eeb9[_0x90bf('0x2c')]=qs[_0x90bf('0x2c')](_0x21e15f[_0x90bf('0x40')][_0x90bf('0x2c')]);}_0xb1eeb9[_0x90bf('0x45')]=qs[_0x90bf('0x46')](_0x21e15f[_0x90bf('0x40')][_0x90bf('0x46')]);_0xb1eeb9['where']=qs[_0x90bf('0x47')](_[_0x90bf('0x48')](_0x21e15f[_0x90bf('0x40')],_0x2f678a[_0x90bf('0x47')]),_0x50be25);if(_0x21e15f['query']['filter']){_0xb1eeb9[_0x90bf('0x49')]=_[_0x90bf('0x4a')](_0xb1eeb9[_0x90bf('0x49')],{'$or':_[_0x90bf('0x3f')](_0x50be25,function(_0x39d34f){if(_0x39d34f[_0x90bf('0x3c')]!==_0x90bf('0x4b')){var _0x135016={};_0x135016[_0x39d34f['name']]={'$like':'%'+_0x21e15f[_0x90bf('0x40')]['filter']+'%'};return _0x135016;}})});}_0xb1eeb9=_['merge']({},_0xb1eeb9,_0x21e15f['options']);var _0x43d538={'where':_0xb1eeb9[_0x90bf('0x49')]};return db[_0x90bf('0x3a')][_0x90bf('0x2f')](_0x43d538)[_0x90bf('0x1c')](function(_0x2a50f2){_0x4c5899[_0x90bf('0x2f')]=_0x2a50f2;if(_0x21e15f['query']['includeAll']){_0xb1eeb9[_0x90bf('0x4c')]=[{'all':!![]}];}return db[_0x90bf('0x3a')][_0x90bf('0x4d')](_0xb1eeb9);})[_0x90bf('0x1c')](function(_0x4cc6d3){_0x4c5899[_0x90bf('0x4e')]=_0x4cc6d3;return _0x4c5899;})[_0x90bf('0x1c')](respondWithFilteredResult(_0x5d2a91,_0xb1eeb9))[_0x90bf('0x27')](handleError(_0x5d2a91,null));};exports[_0x90bf('0x4f')]=function(_0x453a07,_0x162ca0){var _0x35c43b={'raw':![],'where':{'id':_0x453a07['params']['id']}},_0x2536c2={};_0x2536c2['model']=_[_0x90bf('0x50')](db['VoiceContext'][_0x90bf('0x3b')]);_0x2536c2[_0x90bf('0x40')]=_[_0x90bf('0x50')](_0x453a07['query']);_0x2536c2['filters']=_[_0x90bf('0x41')](_0x2536c2[_0x90bf('0x3e')],_0x2536c2[_0x90bf('0x40')]);_0x35c43b['attributes']=_['intersection'](_0x2536c2['model'],qs[_0x90bf('0x42')](_0x453a07['query'][_0x90bf('0x42')]));_0x35c43b[_0x90bf('0x43')]=_0x35c43b['attributes'][_0x90bf('0x51')]?_0x35c43b['attributes']:_0x2536c2[_0x90bf('0x3e')];if(_0x453a07[_0x90bf('0x40')][_0x90bf('0x52')]){_0x35c43b[_0x90bf('0x4c')]=[{'all':!![]}];}_0x35c43b=_[_0x90bf('0x4a')]({},_0x35c43b,_0x453a07['options']);return db[_0x90bf('0x3a')][_0x90bf('0x53')](_0x35c43b)['then'](handleEntityNotFound(_0x162ca0,null))[_0x90bf('0x1c')](respondWithResult(_0x162ca0,null))[_0x90bf('0x27')](handleError(_0x162ca0,null));};exports[_0x90bf('0x54')]=function(_0x256475,_0x4107f6,_0x4367d1){var _0x388546;return db[_0x90bf('0x3a')][_0x90bf('0x54')](_0x256475[_0x90bf('0x55')],{'raw':!![]})[_0x90bf('0x1c')](function(_0x3e89ab){_0x388546=_0x3e89ab;return db['VoiceContext'][_0x90bf('0x4d')]({'raw':!![]});})[_0x90bf('0x1c')](function(_0x3309c5){var _0x4a205b=fs[_0x90bf('0x56')](path[_0x90bf('0x57')](config[_0x90bf('0x58')],_0x90bf('0x59')),_0x90bf('0x5a'));var _0x7b605d=ejs['render'](_0x4a205b,{'contexts':_0x3309c5||[]});fs[_0x90bf('0x5b')](_0x90bf('0x5c'),_0x7b605d);})['then'](function(){return respondWithRpcPromise(_0x90bf('0x5d'),_0x90bf('0x54'),{'module':_0x90bf('0x5e')});})[_0x90bf('0x1c')](function(){var _0x55d3a0=_0x256475[_0x90bf('0x5f')][_0x90bf('0x36')]({'plain':!![]});if(!_0x55d3a0)throw new Error(_0x90bf('0x60'));if(_0x55d3a0[_0x90bf('0x61')]===_0x90bf('0x5f')){var _0x55fd5d=_0x388546[_0x90bf('0x36')]({'plain':!![]});return db[_0x90bf('0x62')]['find']({'where':{'name':'Contexts','userProfileId':_0x55d3a0[_0x90bf('0x63')]},'raw':!![]})[_0x90bf('0x1c')](function(_0x3aa314){if(_0x3aa314&&_0x3aa314[_0x90bf('0x64')]===0x0){return db[_0x90bf('0x65')][_0x90bf('0x54')]({'name':_0x55fd5d['name'],'resourceId':_0x55fd5d['id'],'type':_0x3aa314[_0x90bf('0x37')],'sectionId':_0x3aa314['id']},{})[_0x90bf('0x1c')](function(){return _0x388546;});}else{return _0x388546;}})[_0x90bf('0x27')](function(_0x1707d1){logger[_0x90bf('0x23')](_0x90bf('0x66'),_0x1707d1);throw _0x1707d1;});}return _0x388546;})[_0x90bf('0x1c')](respondWithResult(_0x4107f6,0xc9))['catch'](handleError(_0x4107f6,null));};exports[_0x90bf('0x34')]=function(_0x81b4ab,_0x2f9329,_0x257c50){var _0x588a82;return db[_0x90bf('0x3a')]['find']({'where':{'id':_0x81b4ab['params']['id']}})['then'](handleEntityNotFound(_0x2f9329,null))[_0x90bf('0x1c')](saveUpdates(_0x81b4ab[_0x90bf('0x55')],null))[_0x90bf('0x1c')](function(_0x41815a){if(_0x41815a){_0x588a82=_0x41815a;return db[_0x90bf('0x3a')][_0x90bf('0x4d')]({'raw':!![]});}})[_0x90bf('0x1c')](function(_0x267b75){var _0x5c02f1=fs[_0x90bf('0x56')](path[_0x90bf('0x57')](config[_0x90bf('0x58')],_0x90bf('0x59')),_0x90bf('0x5a'));var _0x230a68=ejs[_0x90bf('0x67')](_0x5c02f1,{'contexts':_0x267b75||[]});fs[_0x90bf('0x5b')](_0x90bf('0x5c'),_0x230a68);})[_0x90bf('0x1c')](function(){return respondWithRpcPromise(_0x90bf('0x5d'),'update',{'module':'chan_sip.so'});})['then'](function(){return _0x588a82;})[_0x90bf('0x1c')](respondWithResult(_0x2f9329,null))['catch'](handleError(_0x2f9329,null));};exports['destroy']=function(_0x2fe228,_0x187d4b,_0x5ca4e4){var _0x3d66ab;return db[_0x90bf('0x3a')][_0x90bf('0x53')]({'where':{'id':_0x2fe228[_0x90bf('0x68')]['id']}})[_0x90bf('0x1c')](handleEntityNotFound(_0x187d4b,null))[_0x90bf('0x1c')](removeEntity(_0x187d4b,null))[_0x90bf('0x1c')](function(){return db[_0x90bf('0x3a')]['findAll']({'raw':!![]});})[_0x90bf('0x1c')](function(_0x48f7a3){var _0xb92580=fs[_0x90bf('0x56')](path[_0x90bf('0x57')](config[_0x90bf('0x58')],_0x90bf('0x59')),'utf8');var _0x31088c=ejs[_0x90bf('0x67')](_0xb92580,{'contexts':_0x48f7a3});fs[_0x90bf('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x31088c);return respondWithRpcPromise(_0x90bf('0x5d'),_0x90bf('0x35'),{'module':_0x90bf('0x5e')});})[_0x90bf('0x27')](handleError(_0x187d4b,null));}; \ No newline at end of file +var _0xb6cd=['stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','VoiceContext','findAll','catch','params','options','find','readFileSync','root','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','server/files/templates/context.ejs','render','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','Contexts','UserProfileResource'];(function(_0x4de703,_0x4525a3){var _0x3ca55a=function(_0x5b5b7a){while(--_0x5b5b7a){_0x4de703['push'](_0x4de703['shift']());}};_0x3ca55a(++_0x4525a3);}(_0xb6cd,0x1ca));var _0xdb6c=function(_0x1c415e,_0x56b220){_0x1c415e=_0x1c415e-0x0;var _0x5e60ad=_0xb6cd[_0x1c415e];return _0x5e60ad;};'use strict';var emlformat=require(_0xdb6c('0x0'));var rimraf=require(_0xdb6c('0x1'));var zipdir=require(_0xdb6c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb6c('0x3'));var moment=require(_0xdb6c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdb6c('0x5'));var util=require(_0xdb6c('0x6'));var path=require(_0xdb6c('0x7'));var sox=require(_0xdb6c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb6c('0x9'));var _=require(_0xdb6c('0xa'));var squel=require('squel');var crypto=require(_0xdb6c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdb6c('0xc'));var querystring=require(_0xdb6c('0xd'));var Papa=require(_0xdb6c('0xe'));var Redis=require(_0xdb6c('0xf'));var authService=require(_0xdb6c('0x10'));var qs=require(_0xdb6c('0x11'));var as=require(_0xdb6c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb6c('0x13'))(_0xdb6c('0x14'));var utils=require(_0xdb6c('0x15'));var config=require(_0xdb6c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb6c('0x17'))['db'];var jayson=require(_0xdb6c('0x18'));var client=jayson[_0xdb6c('0x19')][_0xdb6c('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x35e914,_0x4ebb77,_0x4cd64a,_0x1bdbd2){return new BPromise(function(_0xa0798c,_0x367847){var _0x466864=_0x1bdbd2||client;return _0x466864['request'](_0x35e914,_0x4cd64a)[_0xdb6c('0x1b')](function(_0x237f37){logger['info'](_0xdb6c('0x1c'),_0x4ebb77,_0xdb6c('0x1d'));logger['debug'](_0xdb6c('0x1e'),_0x4ebb77,'request\x20sent',JSON[_0xdb6c('0x1f')](_0x237f37));if(_0x237f37[_0xdb6c('0x20')]){if(_0x237f37[_0xdb6c('0x20')][_0xdb6c('0x21')]===0x1f4){logger[_0xdb6c('0x20')](_0xdb6c('0x1c'),_0x4ebb77,_0x237f37['error'][_0xdb6c('0x22')]);return _0x367847(_0x237f37[_0xdb6c('0x20')]['message']);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x4ebb77,_0x237f37[_0xdb6c('0x20')][_0xdb6c('0x22')]);return _0xa0798c(_0x237f37['error'][_0xdb6c('0x22')]);}else{logger[_0xdb6c('0x23')]('VoiceContext,\x20%s,\x20%s',_0x4ebb77,_0xdb6c('0x1d'));_0xa0798c(_0x237f37[_0xdb6c('0x24')][_0xdb6c('0x22')]);}})['catch'](function(_0x3c7ce7){logger[_0xdb6c('0x20')](_0xdb6c('0x1c'),_0x4ebb77,_0x3c7ce7);_0x367847(_0x3c7ce7);});});}function respondWithStatusCode(_0x5c5bd4,_0x19549a){_0x19549a=_0x19549a||0xcc;return function(_0x5e3905){if(_0x5e3905){return _0x5c5bd4[_0xdb6c('0x25')](_0x19549a);}return _0x5c5bd4[_0xdb6c('0x26')](_0x19549a)['end']();};}function respondWithResult(_0x57a770,_0xc43e9e){_0xc43e9e=_0xc43e9e||0xc8;return function(_0xd6c48a){if(_0xd6c48a){return _0x57a770['status'](_0xc43e9e)[_0xdb6c('0x27')](_0xd6c48a);}};}function respondWithFilteredResult(_0x1afe63,_0x4f0ec9){return function(_0x379d68){if(_0x379d68){var _0x18be2a=typeof _0x4f0ec9[_0xdb6c('0x28')]===_0xdb6c('0x29')&&typeof _0x4f0ec9[_0xdb6c('0x2a')]===_0xdb6c('0x29');var _0x5594d8=_0x379d68[_0xdb6c('0x2b')];var _0x5bcaf6=_0x18be2a?0x0:_0x4f0ec9[_0xdb6c('0x28')];var _0x1d9999=_0x18be2a?_0x379d68[_0xdb6c('0x2b')]:_0x4f0ec9[_0xdb6c('0x28')]+_0x4f0ec9[_0xdb6c('0x2a')];var _0x103c3c;if(_0x1d9999>=_0x5594d8){_0x1d9999=_0x5594d8;_0x103c3c=0xc8;}else{_0x103c3c=0xce;}_0x1afe63['status'](_0x103c3c);return _0x1afe63[_0xdb6c('0x2c')](_0xdb6c('0x2d'),_0x5bcaf6+'-'+_0x1d9999+'/'+_0x5594d8)[_0xdb6c('0x27')](_0x379d68);}return null;};}function patchUpdates(_0x439655){return function(_0x207e47){try{jsonpatch['apply'](_0x207e47,_0x439655,!![]);}catch(_0x4c1287){return BPromise[_0xdb6c('0x2e')](_0x4c1287);}return _0x207e47[_0xdb6c('0x2f')]();};}function saveUpdates(_0x3ba448,_0x3161b7){return function(_0x1e7fd7){if(_0x1e7fd7){return _0x1e7fd7[_0xdb6c('0x30')](_0x3ba448)[_0xdb6c('0x1b')](function(_0x2601d8){return _0x2601d8;});}return null;};}function removeEntity(_0x412444,_0x560256){return function(_0x311eab){if(_0x311eab){return _0x311eab[_0xdb6c('0x31')]()[_0xdb6c('0x1b')](function(){var _0x5cf186=_0x311eab['get']({'plain':!![]});var _0x394306=_0xdb6c('0x32');return db[_0xdb6c('0x33')][_0xdb6c('0x31')]({'where':{'type':_0x394306,'resourceId':_0x5cf186['id']}})[_0xdb6c('0x1b')](function(){return _0x311eab;});})[_0xdb6c('0x1b')](function(){_0x412444['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ec07b,_0x3b30b1){return function(_0x508dff){if(!_0x508dff){_0x4ec07b[_0xdb6c('0x25')](0x194);}return _0x508dff;};}function handleError(_0x47de12,_0x1f202f){_0x1f202f=_0x1f202f||0x1f4;return function(_0x2dc096){logger['error'](_0x2dc096[_0xdb6c('0x34')]);if(_0x2dc096[_0xdb6c('0x35')]){delete _0x2dc096[_0xdb6c('0x35')];}_0x47de12['status'](_0x1f202f)['send'](_0x2dc096);};}exports[_0xdb6c('0x36')]=function(_0x861eab,_0x2c5557){var _0x4d8bd2={},_0x30e788={},_0x481dff={'count':0x0,'rows':[]};var _0x11f2f5=_[_0xdb6c('0x37')](db['VoiceContext'][_0xdb6c('0x38')],function(_0x1e4df5){return{'name':_0x1e4df5[_0xdb6c('0x39')],'type':_0x1e4df5[_0xdb6c('0x3a')][_0xdb6c('0x3b')]};});_0x30e788[_0xdb6c('0x3c')]=_[_0xdb6c('0x37')](_0x11f2f5,_0xdb6c('0x35'));_0x30e788[_0xdb6c('0x3d')]=_[_0xdb6c('0x3e')](_0x861eab['query']);_0x30e788[_0xdb6c('0x3f')]=_[_0xdb6c('0x40')](_0x30e788['model'],_0x30e788['query']);_0x4d8bd2[_0xdb6c('0x41')]=_[_0xdb6c('0x40')](_0x30e788[_0xdb6c('0x3c')],qs[_0xdb6c('0x42')](_0x861eab[_0xdb6c('0x3d')][_0xdb6c('0x42')]));_0x4d8bd2[_0xdb6c('0x41')]=_0x4d8bd2[_0xdb6c('0x41')]['length']?_0x4d8bd2[_0xdb6c('0x41')]:_0x30e788[_0xdb6c('0x3c')];if(!_0x861eab['query'][_0xdb6c('0x43')](_0xdb6c('0x44'))){_0x4d8bd2['limit']=qs[_0xdb6c('0x2a')](_0x861eab[_0xdb6c('0x3d')]['limit']);_0x4d8bd2[_0xdb6c('0x28')]=qs[_0xdb6c('0x28')](_0x861eab[_0xdb6c('0x3d')][_0xdb6c('0x28')]);}_0x4d8bd2[_0xdb6c('0x45')]=qs[_0xdb6c('0x46')](_0x861eab['query'][_0xdb6c('0x46')]);_0x4d8bd2[_0xdb6c('0x47')]=qs[_0xdb6c('0x3f')](_[_0xdb6c('0x48')](_0x861eab[_0xdb6c('0x3d')],_0x30e788[_0xdb6c('0x3f')]),_0x11f2f5);if(_0x861eab['query'][_0xdb6c('0x49')]){_0x4d8bd2[_0xdb6c('0x47')]=_[_0xdb6c('0x4a')](_0x4d8bd2[_0xdb6c('0x47')],{'$or':_['map'](_0x11f2f5,function(_0x530edf){if(_0x530edf['type']!==_0xdb6c('0x4b')){var _0x1bd99e={};_0x1bd99e[_0x530edf[_0xdb6c('0x35')]]={'$like':'%'+_0x861eab['query'][_0xdb6c('0x49')]+'%'};return _0x1bd99e;}})});}_0x4d8bd2=_[_0xdb6c('0x4a')]({},_0x4d8bd2,_0x861eab['options']);var _0x7faca8={'where':_0x4d8bd2[_0xdb6c('0x47')]};return db['VoiceContext']['count'](_0x7faca8)[_0xdb6c('0x1b')](function(_0x9454ab){_0x481dff['count']=_0x9454ab;if(_0x861eab['query'][_0xdb6c('0x4c')]){_0x4d8bd2[_0xdb6c('0x4d')]=[{'all':!![]}];}return db[_0xdb6c('0x4e')][_0xdb6c('0x4f')](_0x4d8bd2);})['then'](function(_0x3df799){_0x481dff['rows']=_0x3df799;return _0x481dff;})[_0xdb6c('0x1b')](respondWithFilteredResult(_0x2c5557,_0x4d8bd2))[_0xdb6c('0x50')](handleError(_0x2c5557,null));};exports['show']=function(_0x5aef00,_0x23b4d4){var _0x1dda18={'raw':![],'where':{'id':_0x5aef00[_0xdb6c('0x51')]['id']}},_0x571755={};_0x571755[_0xdb6c('0x3c')]=_[_0xdb6c('0x3e')](db[_0xdb6c('0x4e')][_0xdb6c('0x38')]);_0x571755[_0xdb6c('0x3d')]=_['keys'](_0x5aef00[_0xdb6c('0x3d')]);_0x571755['filters']=_[_0xdb6c('0x40')](_0x571755['model'],_0x571755[_0xdb6c('0x3d')]);_0x1dda18[_0xdb6c('0x41')]=_[_0xdb6c('0x40')](_0x571755[_0xdb6c('0x3c')],qs['fields'](_0x5aef00[_0xdb6c('0x3d')][_0xdb6c('0x42')]));_0x1dda18['attributes']=_0x1dda18[_0xdb6c('0x41')]['length']?_0x1dda18[_0xdb6c('0x41')]:_0x571755[_0xdb6c('0x3c')];if(_0x5aef00[_0xdb6c('0x3d')][_0xdb6c('0x4c')]){_0x1dda18[_0xdb6c('0x4d')]=[{'all':!![]}];}_0x1dda18=_[_0xdb6c('0x4a')]({},_0x1dda18,_0x5aef00[_0xdb6c('0x52')]);return db[_0xdb6c('0x4e')][_0xdb6c('0x53')](_0x1dda18)[_0xdb6c('0x1b')](handleEntityNotFound(_0x23b4d4,null))[_0xdb6c('0x1b')](respondWithResult(_0x23b4d4,null))[_0xdb6c('0x50')](handleError(_0x23b4d4,null));};exports['create']=function(_0x22ea8b,_0x17c46d,_0x30093d){var _0x334e61;return db[_0xdb6c('0x4e')]['create'](_0x22ea8b['body'],{'raw':!![]})[_0xdb6c('0x1b')](function(_0x21297f){_0x334e61=_0x21297f;return db[_0xdb6c('0x4e')]['findAll']({'raw':!![]});})[_0xdb6c('0x1b')](function(_0x3885b5){var _0x27f715=fs[_0xdb6c('0x54')](path['join'](config[_0xdb6c('0x55')],'server/files/templates/context.ejs'),_0xdb6c('0x56'));var _0x5b18d5=ejs['render'](_0x27f715,{'contexts':_0x3885b5||[]});fs[_0xdb6c('0x57')](_0xdb6c('0x58'),_0x5b18d5);})[_0xdb6c('0x1b')](function(){return respondWithRpcPromise(_0xdb6c('0x59'),'create',{'module':'chan_sip.so'});})[_0xdb6c('0x1b')](function(){var _0x3fee23=_0x22ea8b[_0xdb6c('0x5a')][_0xdb6c('0x5b')]({'plain':!![]});if(!_0x3fee23)throw new Error(_0xdb6c('0x5c'));if(_0x3fee23[_0xdb6c('0x5d')]==='user'){var _0x382c59=_0x334e61['get']({'plain':!![]});return db[_0xdb6c('0x5e')]['find']({'where':{'name':_0xdb6c('0x32'),'userProfileId':_0x3fee23[_0xdb6c('0x5f')]},'raw':!![]})[_0xdb6c('0x1b')](function(_0x204d73){if(_0x204d73&&_0x204d73['autoAssociation']===0x0){return db[_0xdb6c('0x33')]['create']({'name':_0x382c59[_0xdb6c('0x35')],'resourceId':_0x382c59['id'],'type':_0x204d73[_0xdb6c('0x35')],'sectionId':_0x204d73['id']},{})['then'](function(){return _0x334e61;});}else{return _0x334e61;}})[_0xdb6c('0x50')](function(_0x1b25ab){logger[_0xdb6c('0x20')](_0xdb6c('0x60'),_0x1b25ab);throw _0x1b25ab;});}return _0x334e61;})['then'](respondWithResult(_0x17c46d,0xc9))[_0xdb6c('0x50')](handleError(_0x17c46d,null));};exports[_0xdb6c('0x30')]=function(_0x20b023,_0x4e08c9,_0x144bd9){var _0x75b696;return db[_0xdb6c('0x4e')]['find']({'where':{'id':_0x20b023[_0xdb6c('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e08c9,null))[_0xdb6c('0x1b')](saveUpdates(_0x20b023[_0xdb6c('0x61')],null))[_0xdb6c('0x1b')](function(_0x3bd73d){if(_0x3bd73d){_0x75b696=_0x3bd73d;return db[_0xdb6c('0x4e')][_0xdb6c('0x4f')]({'raw':!![]});}})[_0xdb6c('0x1b')](function(_0x1a0e27){var _0x27fce6=fs['readFileSync'](path[_0xdb6c('0x62')](config[_0xdb6c('0x55')],_0xdb6c('0x63')),'utf8');var _0x2b5b77=ejs[_0xdb6c('0x64')](_0x27fce6,{'contexts':_0x1a0e27||[]});fs[_0xdb6c('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2b5b77);})[_0xdb6c('0x1b')](function(){return respondWithRpcPromise(_0xdb6c('0x59'),'update',{'module':_0xdb6c('0x65')});})[_0xdb6c('0x1b')](function(){return _0x75b696;})[_0xdb6c('0x1b')](respondWithResult(_0x4e08c9,null))['catch'](handleError(_0x4e08c9,null));};exports[_0xdb6c('0x31')]=function(_0x1d0f3a,_0x517e09,_0x5ad6d4){var _0x362263;return db[_0xdb6c('0x4e')][_0xdb6c('0x53')]({'where':{'id':_0x1d0f3a['params']['id']}})[_0xdb6c('0x1b')](handleEntityNotFound(_0x517e09,null))['then'](removeEntity(_0x517e09,null))['then'](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0xdb6c('0x1b')](function(_0x2c18b7){var _0x2b9995=fs[_0xdb6c('0x54')](path['join'](config['root'],'server/files/templates/context.ejs'),_0xdb6c('0x56'));var _0x32b0cc=ejs['render'](_0x2b9995,{'contexts':_0x2c18b7});fs[_0xdb6c('0x57')](_0xdb6c('0x58'),_0x32b0cc);return respondWithRpcPromise('Reload','destroy',{'module':_0xdb6c('0x65')});})[_0xdb6c('0x50')](handleError(_0x517e09,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index facc919..51220e5 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 _0x564d=['define','VoiceContext','util','../../config/logger','moment','bluebird','path','../../config/environment','./voiceContext.attributes','exports'];(function(_0x559c7b,_0x4119cf){var _0x2c1677=function(_0x5c6d3d){while(--_0x5c6d3d){_0x559c7b['push'](_0x559c7b['shift']());}};_0x2c1677(++_0x4119cf);}(_0x564d,0x66));var _0xd564=function(_0x12e306,_0x2f0806){_0x12e306=_0x12e306-0x0;var _0x4c8b1e=_0x564d[_0x12e306];return _0x4c8b1e;};'use strict';var _=require('lodash');var util=require(_0xd564('0x0'));var logger=require(_0xd564('0x1'))('api');var moment=require(_0xd564('0x2'));var BPromise=require(_0xd564('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd564('0x4'));var rimraf=require('rimraf');var config=require(_0xd564('0x5'));var attributes=require(_0xd564('0x6'));module[_0xd564('0x7')]=function(_0x15592f,_0x460fb3){return _0x15592f[_0xd564('0x8')](_0xd564('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf2c=['moment','bluebird','path','../../config/environment','./voiceContext.attributes','VoiceContext','voice_contexts','lodash','util','../../config/logger'];(function(_0x1f6a94,_0x27fb6b){var _0x22344d=function(_0x327c22){while(--_0x327c22){_0x1f6a94['push'](_0x1f6a94['shift']());}};_0x22344d(++_0x27fb6b);}(_0xaf2c,0x165));var _0xcaf2=function(_0x57adf6,_0x12bbb0){_0x57adf6=_0x57adf6-0x0;var _0x563abd=_0xaf2c[_0x57adf6];return _0x563abd;};'use strict';var _=require(_0xcaf2('0x0'));var util=require(_0xcaf2('0x1'));var logger=require(_0xcaf2('0x2'))('api');var moment=require(_0xcaf2('0x3'));var BPromise=require(_0xcaf2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcaf2('0x5'));var rimraf=require('rimraf');var config=require(_0xcaf2('0x6'));var attributes=require(_0xcaf2('0x7'));module['exports']=function(_0xfa7305,_0xb52577){return _0xfa7305['define'](_0xcaf2('0x8'),attributes,{'tableName':_0xcaf2('0x9'),'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 34af640..8483c87 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 _0x7497=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceContext,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment','bluebird'];(function(_0x57c0d9,_0x348735){var _0x5bbde9=function(_0x153e7b){while(--_0x153e7b){_0x57c0d9['push'](_0x57c0d9['shift']());}};_0x5bbde9(++_0x348735);}(_0x7497,0x13c));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var moment=require(_0x7749('0x2'));var BPromise=require(_0x7749('0x3'));var rs=require(_0x7749('0x4'));var fs=require('fs');var Redis=require(_0x7749('0x5'));var db=require(_0x7749('0x6'))['db'];var utils=require(_0x7749('0x7'));var logger=require(_0x7749('0x8'))(_0x7749('0x9'));var config=require(_0x7749('0xa'));var jayson=require(_0x7749('0xb'));var client=jayson[_0x7749('0xc')][_0x7749('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xef965f,_0x5882e7,_0x544812){return new BPromise(function(_0x2a6ae8,_0x1bd19b){return client['request'](_0xef965f,_0x544812)['then'](function(_0x3e20c9){logger[_0x7749('0xe')](_0x7749('0xf'),_0x5882e7,_0x7749('0x10'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5882e7,_0x7749('0x10'),JSON['stringify'](_0x3e20c9));if(_0x3e20c9[_0x7749('0x11')]){if(_0x3e20c9['error']['code']===0x1f4){logger[_0x7749('0x11')](_0x7749('0xf'),_0x5882e7,_0x3e20c9[_0x7749('0x11')]['message']);return _0x1bd19b(_0x3e20c9['error'][_0x7749('0x12')]);}logger[_0x7749('0x11')](_0x7749('0xf'),_0x5882e7,_0x3e20c9[_0x7749('0x11')][_0x7749('0x12')]);return _0x2a6ae8(_0x3e20c9['error'][_0x7749('0x12')]);}else{logger[_0x7749('0xe')](_0x7749('0xf'),_0x5882e7,_0x7749('0x10'));_0x2a6ae8(_0x3e20c9['result'][_0x7749('0x12')]);}})[_0x7749('0x13')](function(_0x23da49){logger[_0x7749('0x11')]('VoiceContext,\x20%s,\x20%s',_0x5882e7,_0x23da49);_0x1bd19b(_0x23da49);});});} \ No newline at end of file +var _0x4d08=['http','request','then','request\x20sent','debug','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5f3e17,_0x12a4c1){var _0x3065bc=function(_0x397cb8){while(--_0x397cb8){_0x5f3e17['push'](_0x5f3e17['shift']());}};_0x3065bc(++_0x12a4c1);}(_0x4d08,0x1a5));var _0x84d0=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0x4d08[_0x71b765];return _0x34cb24;};'use strict';var _=require(_0x84d0('0x0'));var util=require('util');var moment=require(_0x84d0('0x1'));var BPromise=require(_0x84d0('0x2'));var rs=require(_0x84d0('0x3'));var fs=require('fs');var Redis=require(_0x84d0('0x4'));var db=require(_0x84d0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x84d0('0x6'))(_0x84d0('0x7'));var config=require(_0x84d0('0x8'));var jayson=require(_0x84d0('0x9'));var client=jayson[_0x84d0('0xa')][_0x84d0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a4698,_0x832446,_0x306e3b){return new BPromise(function(_0x3d8b60,_0x1b2ac0){return client[_0x84d0('0xc')](_0x2a4698,_0x306e3b)[_0x84d0('0xd')](function(_0x5b83fd){logger['info']('VoiceContext,\x20%s,\x20%s',_0x832446,_0x84d0('0xe'));logger[_0x84d0('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x832446,'request\x20sent',JSON[_0x84d0('0x10')](_0x5b83fd));if(_0x5b83fd[_0x84d0('0x11')]){if(_0x5b83fd[_0x84d0('0x11')][_0x84d0('0x12')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x832446,_0x5b83fd['error'][_0x84d0('0x13')]);return _0x1b2ac0(_0x5b83fd[_0x84d0('0x11')][_0x84d0('0x13')]);}logger[_0x84d0('0x11')](_0x84d0('0x14'),_0x832446,_0x5b83fd[_0x84d0('0x11')][_0x84d0('0x13')]);return _0x3d8b60(_0x5b83fd[_0x84d0('0x11')][_0x84d0('0x13')]);}else{logger[_0x84d0('0x15')]('VoiceContext,\x20%s,\x20%s',_0x832446,'request\x20sent');_0x3d8b60(_0x5b83fd[_0x84d0('0x16')][_0x84d0('0x13')]);}})[_0x84d0('0x17')](function(_0x4ff3bc){logger['error'](_0x84d0('0x14'),_0x832446,_0x4ff3bc);_0x1b2ac0(_0x4ff3bc);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 5207e72..3ad1379 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 _0xd899=['update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','describe','/:id','post','create','put'];(function(_0x54f01a,_0x12e01c){var _0x4787f1=function(_0x89ae1b){while(--_0x89ae1b){_0x54f01a['push'](_0x54f01a['shift']());}};_0x4787f1(++_0x12e01c);}(_0xd899,0x1b3));var _0x9d89=function(_0x2fedad,_0xb91393){_0x2fedad=_0x2fedad-0x0;var _0x2d9a06=_0xd899[_0x2fedad];return _0x2d9a06;};'use strict';var multer=require(_0x9d89('0x0'));var util=require(_0x9d89('0x1'));var path=require('path');var timeout=require(_0x9d89('0x2'));var express=require('express');var router=express[_0x9d89('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9d89('0x4'));var interaction=require(_0x9d89('0x5'));var config=require(_0x9d89('0x6'));var controller=require(_0x9d89('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9d89('0x8')]('/describe',auth[_0x9d89('0x9')](),controller[_0x9d89('0xa')]);router['get'](_0x9d89('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9d89('0xc')]('/',auth[_0x9d89('0x9')](),controller[_0x9d89('0xd')]);router[_0x9d89('0xe')](_0x9d89('0xb'),auth[_0x9d89('0x9')](),controller[_0x9d89('0xf')]);router[_0x9d89('0x10')](_0x9d89('0xb'),auth['isAuthenticated'](),controller[_0x9d89('0x11')]);module['exports']=router; \ No newline at end of file +var _0xad34=['isAuthenticated','index','describe','/:id','post','create','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0xc86baf,_0x2ffba2){var _0xab4b1f=function(_0x27404e){while(--_0x27404e){_0xc86baf['push'](_0xc86baf['shift']());}};_0xab4b1f(++_0x2ffba2);}(_0xad34,0x75));var _0x4ad3=function(_0x5ac3b8,_0x259304){_0x5ac3b8=_0x5ac3b8-0x0;var _0x2ea98e=_0xad34[_0x5ac3b8];return _0x2ea98e;};'use strict';var multer=require(_0x4ad3('0x0'));var util=require(_0x4ad3('0x1'));var path=require('path');var timeout=require(_0x4ad3('0x2'));var express=require(_0x4ad3('0x3'));var router=express[_0x4ad3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4ad3('0x5'));var interaction=require(_0x4ad3('0x6'));var config=require(_0x4ad3('0x7'));var controller=require('./voiceDialReport.controller');router[_0x4ad3('0x8')]('/',auth[_0x4ad3('0x9')](),controller[_0x4ad3('0xa')]);router[_0x4ad3('0x8')]('/describe',auth[_0x4ad3('0x9')](),controller[_0x4ad3('0xb')]);router[_0x4ad3('0x8')](_0x4ad3('0xc'),auth[_0x4ad3('0x9')](),controller['show']);router[_0x4ad3('0xd')]('/',auth['isAuthenticated'](),controller[_0x4ad3('0xe')]);router['put'](_0x4ad3('0xc'),auth[_0x4ad3('0x9')](),controller[_0x4ad3('0xf')]);router[_0x4ad3('0x10')](_0x4ad3('0xc'),auth[_0x4ad3('0x9')](),controller[_0x4ad3('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 11687f8..fd877d0 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 _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x58eae1,_0x8b501c){var _0x1722ae=function(_0x55f5cf){while(--_0x55f5cf){_0x58eae1['push'](_0x58eae1['shift']());}};_0x1722ae(++_0x8b501c);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x6f5a73,_0x2ec184){_0x6f5a73=_0x6f5a73-0x0;var _0x517173=_0x8d0e[_0x6f5a73];return _0x517173;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file +var _0x6aa7=['called,connect,complete','sequelize','STRING','INTEGER','DATE'];(function(_0x20d673,_0x31552f){var _0x288fc5=function(_0x5153b3){while(--_0x5153b3){_0x20d673['push'](_0x20d673['shift']());}};_0x288fc5(++_0x31552f);}(_0x6aa7,0x178));var _0x76aa=function(_0x2556a4,_0x1e8ad7){_0x2556a4=_0x2556a4-0x0;var _0x1869b2=_0x6aa7[_0x2556a4];return _0x1869b2;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x76aa('0x1')]},'channel':{'type':Sequelize[_0x76aa('0x1')]},'channelstate':{'type':Sequelize[_0x76aa('0x2')]},'channelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76aa('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x2')]},'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'linkedid':{'type':Sequelize[_0x76aa('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x76aa('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridnum':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'destlanguage':{'type':Sequelize[_0x76aa('0x1')]},'destaccountcode':{'type':Sequelize[_0x76aa('0x1')]},'destcontext':{'type':Sequelize[_0x76aa('0x1')]},'destexten':{'type':Sequelize[_0x76aa('0x1')]},'destpriority':{'type':Sequelize[_0x76aa('0x2')]},'destuniqueid':{'type':Sequelize[_0x76aa('0x1')]},'destlinkedid':{'type':Sequelize[_0x76aa('0x1')]},'dialstring':{'type':Sequelize[_0x76aa('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x76aa('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x76aa('0x3')]},'lastevent':{'type':Sequelize[_0x76aa('0x1')],'comment':_0x76aa('0x4')},'routeId':{'type':Sequelize[_0x76aa('0x2')]},'duration':{'type':Sequelize[_0x76aa('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'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 158de95..6cc0e46 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 _0x0195=['api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','count','offset','Content-Range','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x23833f,_0x46191f){var _0x231f17=function(_0x5df010){while(--_0x5df010){_0x23833f['push'](_0x23833f['shift']());}};_0x231f17(++_0x46191f);}(_0x0195,0xd4));var _0x5019=function(_0x2e761a,_0x5ca762){_0x2e761a=_0x2e761a-0x0;var _0x11bdc1=_0x0195[_0x2e761a];return _0x11bdc1;};'use strict';var emlformat=require(_0x5019('0x0'));var rimraf=require(_0x5019('0x1'));var zipdir=require(_0x5019('0x2'));var jsonpatch=require(_0x5019('0x3'));var rp=require(_0x5019('0x4'));var moment=require(_0x5019('0x5'));var BPromise=require(_0x5019('0x6'));var Mustache=require(_0x5019('0x7'));var util=require(_0x5019('0x8'));var path=require(_0x5019('0x9'));var sox=require(_0x5019('0xa'));var csv=require(_0x5019('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5019('0xc'));var _=require('lodash');var squel=require(_0x5019('0xd'));var crypto=require(_0x5019('0xe'));var jsforce=require(_0x5019('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5019('0x10'));var Papa=require(_0x5019('0x11'));var Redis=require(_0x5019('0x12'));var authService=require(_0x5019('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5019('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5019('0x15'))(_0x5019('0x16'));var utils=require(_0x5019('0x17'));var config=require(_0x5019('0x18'));var licenseUtil=require(_0x5019('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1037db,_0x68d7c8){_0x68d7c8=_0x68d7c8||0xcc;return function(_0x5c4ad8){if(_0x5c4ad8){return _0x1037db['sendStatus'](_0x68d7c8);}return _0x1037db[_0x5019('0x1a')](_0x68d7c8)['end']();};}function respondWithResult(_0x43776a,_0x17d57a){_0x17d57a=_0x17d57a||0xc8;return function(_0x1012e6){if(_0x1012e6){return _0x43776a[_0x5019('0x1a')](_0x17d57a)[_0x5019('0x1b')](_0x1012e6);}};}function respondWithFilteredResult(_0x571521,_0x5ed537){return function(_0x1407dd){if(_0x1407dd){var _0x2fe2f7=typeof _0x5ed537['offset']===_0x5019('0x1c')&&typeof _0x5ed537['limit']===_0x5019('0x1c');var _0x5058d7=_0x1407dd[_0x5019('0x1d')];var _0xcd5e20=_0x2fe2f7?0x0:_0x5ed537[_0x5019('0x1e')];var _0xbbe5d3=_0x2fe2f7?_0x1407dd[_0x5019('0x1d')]:_0x5ed537['offset']+_0x5ed537['limit'];var _0x1fc2e2;if(_0xbbe5d3>=_0x5058d7){_0xbbe5d3=_0x5058d7;_0x1fc2e2=0xc8;}else{_0x1fc2e2=0xce;}_0x571521[_0x5019('0x1a')](_0x1fc2e2);return _0x571521['set'](_0x5019('0x1f'),_0xcd5e20+'-'+_0xbbe5d3+'/'+_0x5058d7)['json'](_0x1407dd);}return null;};}function patchUpdates(_0x53008d){return function(_0x4039a9){try{jsonpatch['apply'](_0x4039a9,_0x53008d,!![]);}catch(_0x43114d){return BPromise[_0x5019('0x20')](_0x43114d);}return _0x4039a9[_0x5019('0x21')]();};}function saveUpdates(_0x1196d6,_0x45c39c){return function(_0x4cf4b1){if(_0x4cf4b1){return _0x4cf4b1[_0x5019('0x22')](_0x1196d6)['then'](function(_0x3a4833){return _0x3a4833;});}return null;};}function removeEntity(_0x33cf31,_0x51ca08){return function(_0x1821d0){if(_0x1821d0){return _0x1821d0[_0x5019('0x23')]()[_0x5019('0x24')](function(){_0x33cf31[_0x5019('0x1a')](0xcc)[_0x5019('0x25')]();});}};}function handleEntityNotFound(_0x2960b1,_0x935ccb){return function(_0x4a6d85){if(!_0x4a6d85){_0x2960b1[_0x5019('0x26')](0x194);}return _0x4a6d85;};}function handleError(_0x515ef7,_0x32a9ad){_0x32a9ad=_0x32a9ad||0x1f4;return function(_0x47fb15){logger[_0x5019('0x27')](_0x47fb15[_0x5019('0x28')]);if(_0x47fb15[_0x5019('0x29')]){delete _0x47fb15[_0x5019('0x29')];}_0x515ef7[_0x5019('0x1a')](_0x32a9ad)[_0x5019('0x2a')](_0x47fb15);};}exports[_0x5019('0x2b')]=function(_0x4d6f31,_0x2cc40a){var _0x3d7d6f={},_0x435a79={},_0x434276={'count':0x0,'rows':[]};var _0xcb6279=_[_0x5019('0x2c')](db[_0x5019('0x2d')][_0x5019('0x2e')],function(_0x1842ea){return{'name':_0x1842ea[_0x5019('0x2f')],'type':_0x1842ea[_0x5019('0x30')][_0x5019('0x31')]};});_0x435a79[_0x5019('0x32')]=_[_0x5019('0x2c')](_0xcb6279,_0x5019('0x29'));_0x435a79[_0x5019('0x33')]=_[_0x5019('0x34')](_0x4d6f31[_0x5019('0x33')]);_0x435a79[_0x5019('0x35')]=_['intersection'](_0x435a79[_0x5019('0x32')],_0x435a79['query']);_0x3d7d6f[_0x5019('0x36')]=_[_0x5019('0x37')](_0x435a79['model'],qs[_0x5019('0x38')](_0x4d6f31[_0x5019('0x33')][_0x5019('0x38')]));_0x3d7d6f[_0x5019('0x36')]=_0x3d7d6f['attributes'][_0x5019('0x39')]?_0x3d7d6f[_0x5019('0x36')]:_0x435a79['model'];if(!_0x4d6f31['query'][_0x5019('0x3a')](_0x5019('0x3b'))){_0x3d7d6f[_0x5019('0x3c')]=qs[_0x5019('0x3c')](_0x4d6f31[_0x5019('0x33')]['limit']);_0x3d7d6f[_0x5019('0x1e')]=qs[_0x5019('0x1e')](_0x4d6f31['query'][_0x5019('0x1e')]);}_0x3d7d6f[_0x5019('0x3d')]=qs[_0x5019('0x3e')](_0x4d6f31['query'][_0x5019('0x3e')]);_0x3d7d6f[_0x5019('0x3f')]=qs[_0x5019('0x35')](_[_0x5019('0x40')](_0x4d6f31[_0x5019('0x33')],_0x435a79[_0x5019('0x35')]),_0xcb6279);if(_0x4d6f31[_0x5019('0x33')]['filter']){_0x3d7d6f['where']=_[_0x5019('0x41')](_0x3d7d6f[_0x5019('0x3f')],{'$or':_['map'](_0xcb6279,function(_0x3de4be){if(_0x3de4be[_0x5019('0x30')]!=='VIRTUAL'){var _0x4781e1={};_0x4781e1[_0x3de4be[_0x5019('0x29')]]={'$like':'%'+_0x4d6f31[_0x5019('0x33')][_0x5019('0x42')]+'%'};return _0x4781e1;}})});}_0x3d7d6f=_[_0x5019('0x41')]({},_0x3d7d6f,_0x4d6f31[_0x5019('0x43')]);var _0x4abeca={'where':_0x3d7d6f['where']};return db[_0x5019('0x2d')]['count'](_0x4abeca)[_0x5019('0x24')](function(_0x14f534){_0x434276[_0x5019('0x1d')]=_0x14f534;if(_0x4d6f31[_0x5019('0x33')][_0x5019('0x44')]){_0x3d7d6f['include']=[{'all':!![]}];}return db[_0x5019('0x2d')][_0x5019('0x45')](_0x3d7d6f);})['then'](function(_0x42422e){_0x434276[_0x5019('0x46')]=_0x42422e;return _0x434276;})[_0x5019('0x24')](respondWithFilteredResult(_0x2cc40a,_0x3d7d6f))[_0x5019('0x47')](handleError(_0x2cc40a,null));};exports[_0x5019('0x48')]=function(_0xc82013,_0x44f732){var _0x584d81={'raw':!![],'where':{'id':_0xc82013['params']['id']}},_0x5307a7={};_0x5307a7[_0x5019('0x32')]=_[_0x5019('0x34')](db[_0x5019('0x2d')][_0x5019('0x2e')]);_0x5307a7[_0x5019('0x33')]=_['keys'](_0xc82013[_0x5019('0x33')]);_0x5307a7[_0x5019('0x35')]=_[_0x5019('0x37')](_0x5307a7['model'],_0x5307a7['query']);_0x584d81['attributes']=_[_0x5019('0x37')](_0x5307a7[_0x5019('0x32')],qs[_0x5019('0x38')](_0xc82013['query'][_0x5019('0x38')]));_0x584d81[_0x5019('0x36')]=_0x584d81[_0x5019('0x36')][_0x5019('0x39')]?_0x584d81['attributes']:_0x5307a7[_0x5019('0x32')];if(_0xc82013['query'][_0x5019('0x44')]){_0x584d81['include']=[{'all':!![]}];}_0x584d81=_[_0x5019('0x41')]({},_0x584d81,_0xc82013[_0x5019('0x43')]);return db['VoiceDialReport'][_0x5019('0x49')](_0x584d81)[_0x5019('0x24')](handleEntityNotFound(_0x44f732,null))[_0x5019('0x24')](respondWithResult(_0x44f732,null))['catch'](handleError(_0x44f732,null));};exports[_0x5019('0x4a')]=function(_0x326b94,_0x44ebc9){return db[_0x5019('0x2d')][_0x5019('0x4a')](_0x326b94['body'],{})[_0x5019('0x24')](respondWithResult(_0x44ebc9,0xc9))['catch'](handleError(_0x44ebc9,null));};exports[_0x5019('0x22')]=function(_0xed3eef,_0x55ff82){if(_0xed3eef['body']['id']){delete _0xed3eef[_0x5019('0x4b')]['id'];}return db[_0x5019('0x2d')][_0x5019('0x49')]({'where':{'id':_0xed3eef['params']['id']}})[_0x5019('0x24')](handleEntityNotFound(_0x55ff82,null))[_0x5019('0x24')](saveUpdates(_0xed3eef[_0x5019('0x4b')],null))[_0x5019('0x24')](respondWithResult(_0x55ff82,null))[_0x5019('0x47')](handleError(_0x55ff82,null));};exports['destroy']=function(_0x1504f6,_0x517097){return db['VoiceDialReport'][_0x5019('0x49')]({'where':{'id':_0x1504f6[_0x5019('0x4c')]['id']}})[_0x5019('0x24')](handleEntityNotFound(_0x517097,null))['then'](removeEntity(_0x517097,null))['catch'](handleError(_0x517097,null));};exports[_0x5019('0x4d')]=function(_0x3047b1,_0x365f04){return db[_0x5019('0x2d')][_0x5019('0x4d')]()[_0x5019('0x24')](respondWithResult(_0x365f04,null))[_0x5019('0x47')](handleError(_0x365f04,null));}; \ No newline at end of file +var _0x2cb2=['catch','show','params','include','options','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','end','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','VoiceDialReport','includeAll','findAll','rows'];(function(_0x25a9cb,_0x1fb3b3){var _0x2626cf=function(_0x20e9da){while(--_0x20e9da){_0x25a9cb['push'](_0x25a9cb['shift']());}};_0x2626cf(++_0x1fb3b3);}(_0x2cb2,0x9e));var _0x22cb=function(_0x44cb72,_0x5bbf15){_0x44cb72=_0x44cb72-0x0;var _0x71ae36=_0x2cb2[_0x44cb72];return _0x71ae36;};'use strict';var emlformat=require(_0x22cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x22cb('0x1'));var jsonpatch=require(_0x22cb('0x2'));var rp=require(_0x22cb('0x3'));var moment=require(_0x22cb('0x4'));var BPromise=require(_0x22cb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x22cb('0x6'));var ejs=require(_0x22cb('0x7'));var fs=require('fs');var fs_extra=require(_0x22cb('0x8'));var _=require(_0x22cb('0x9'));var squel=require(_0x22cb('0xa'));var crypto=require(_0x22cb('0xb'));var jsforce=require(_0x22cb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x22cb('0x6'));var querystring=require(_0x22cb('0xd'));var Papa=require(_0x22cb('0xe'));var Redis=require(_0x22cb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x22cb('0x10'));var as=require(_0x22cb('0x11'));var hardwareService=require(_0x22cb('0x12'));var logger=require('../../config/logger')(_0x22cb('0x13'));var utils=require(_0x22cb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x22cb('0x15'));var db=require(_0x22cb('0x16'))['db'];function respondWithStatusCode(_0xd15d3c,_0x585a6a){_0x585a6a=_0x585a6a||0xcc;return function(_0x24f699){if(_0x24f699){return _0xd15d3c[_0x22cb('0x17')](_0x585a6a);}return _0xd15d3c['status'](_0x585a6a)['end']();};}function respondWithResult(_0x588726,_0x8d4d01){_0x8d4d01=_0x8d4d01||0xc8;return function(_0x560ee6){if(_0x560ee6){return _0x588726[_0x22cb('0x18')](_0x8d4d01)['json'](_0x560ee6);}};}function respondWithFilteredResult(_0x4927cf,_0x40d717){return function(_0x5c493f){if(_0x5c493f){var _0xd52c5=typeof _0x40d717[_0x22cb('0x19')]===_0x22cb('0x1a')&&typeof _0x40d717[_0x22cb('0x1b')]===_0x22cb('0x1a');var _0x4b2b5e=_0x5c493f['count'];var _0x5e62d0=_0xd52c5?0x0:_0x40d717[_0x22cb('0x19')];var _0x44975e=_0xd52c5?_0x5c493f[_0x22cb('0x1c')]:_0x40d717['offset']+_0x40d717[_0x22cb('0x1b')];var _0x5437af;if(_0x44975e>=_0x4b2b5e){_0x44975e=_0x4b2b5e;_0x5437af=0xc8;}else{_0x5437af=0xce;}_0x4927cf[_0x22cb('0x18')](_0x5437af);return _0x4927cf[_0x22cb('0x1d')]('Content-Range',_0x5e62d0+'-'+_0x44975e+'/'+_0x4b2b5e)[_0x22cb('0x1e')](_0x5c493f);}return null;};}function patchUpdates(_0x560c20){return function(_0x143394){try{jsonpatch['apply'](_0x143394,_0x560c20,!![]);}catch(_0x3df794){return BPromise[_0x22cb('0x1f')](_0x3df794);}return _0x143394[_0x22cb('0x20')]();};}function saveUpdates(_0x2867be,_0x48f8ab){return function(_0x1cd2cc){if(_0x1cd2cc){return _0x1cd2cc[_0x22cb('0x21')](_0x2867be)[_0x22cb('0x22')](function(_0x23b3c4){return _0x23b3c4;});}return null;};}function removeEntity(_0x5e1792,_0x55ee24){return function(_0x4f68f3){if(_0x4f68f3){return _0x4f68f3['destroy']()['then'](function(){_0x5e1792[_0x22cb('0x18')](0xcc)[_0x22cb('0x23')]();});}};}function handleEntityNotFound(_0x1fbe03,_0x34f8dc){return function(_0x2bf99a){if(!_0x2bf99a){_0x1fbe03[_0x22cb('0x17')](0x194);}return _0x2bf99a;};}function handleError(_0x3516a6,_0x599b7d){_0x599b7d=_0x599b7d||0x1f4;return function(_0x4b04a7){logger['error'](_0x4b04a7[_0x22cb('0x24')]);if(_0x4b04a7[_0x22cb('0x25')]){delete _0x4b04a7[_0x22cb('0x25')];}_0x3516a6[_0x22cb('0x18')](_0x599b7d)['send'](_0x4b04a7);};}exports[_0x22cb('0x26')]=function(_0x574bcf,_0x293805){var _0x5a68de={},_0x514a5f={},_0x359757={'count':0x0,'rows':[]};var _0x15d47e=_[_0x22cb('0x27')](db['VoiceDialReport'][_0x22cb('0x28')],function(_0x57acb0){return{'name':_0x57acb0[_0x22cb('0x29')],'type':_0x57acb0[_0x22cb('0x2a')][_0x22cb('0x2b')]};});_0x514a5f[_0x22cb('0x2c')]=_[_0x22cb('0x27')](_0x15d47e,_0x22cb('0x25'));_0x514a5f[_0x22cb('0x2d')]=_[_0x22cb('0x2e')](_0x574bcf['query']);_0x514a5f[_0x22cb('0x2f')]=_[_0x22cb('0x30')](_0x514a5f['model'],_0x514a5f['query']);_0x5a68de[_0x22cb('0x31')]=_[_0x22cb('0x30')](_0x514a5f[_0x22cb('0x2c')],qs[_0x22cb('0x32')](_0x574bcf[_0x22cb('0x2d')][_0x22cb('0x32')]));_0x5a68de[_0x22cb('0x31')]=_0x5a68de[_0x22cb('0x31')][_0x22cb('0x33')]?_0x5a68de['attributes']:_0x514a5f[_0x22cb('0x2c')];if(!_0x574bcf[_0x22cb('0x2d')][_0x22cb('0x34')](_0x22cb('0x35'))){_0x5a68de['limit']=qs['limit'](_0x574bcf[_0x22cb('0x2d')]['limit']);_0x5a68de['offset']=qs[_0x22cb('0x19')](_0x574bcf[_0x22cb('0x2d')][_0x22cb('0x19')]);}_0x5a68de['order']=qs[_0x22cb('0x36')](_0x574bcf[_0x22cb('0x2d')][_0x22cb('0x36')]);_0x5a68de[_0x22cb('0x37')]=qs[_0x22cb('0x2f')](_[_0x22cb('0x38')](_0x574bcf[_0x22cb('0x2d')],_0x514a5f[_0x22cb('0x2f')]),_0x15d47e);if(_0x574bcf['query'][_0x22cb('0x39')]){_0x5a68de[_0x22cb('0x37')]=_[_0x22cb('0x3a')](_0x5a68de[_0x22cb('0x37')],{'$or':_[_0x22cb('0x27')](_0x15d47e,function(_0x182b96){if(_0x182b96[_0x22cb('0x2a')]!==_0x22cb('0x3b')){var _0x5b4e51={};_0x5b4e51[_0x182b96[_0x22cb('0x25')]]={'$like':'%'+_0x574bcf[_0x22cb('0x2d')][_0x22cb('0x39')]+'%'};return _0x5b4e51;}})});}_0x5a68de=_[_0x22cb('0x3a')]({},_0x5a68de,_0x574bcf['options']);var _0x5541d3={'where':_0x5a68de[_0x22cb('0x37')]};return db[_0x22cb('0x3c')]['count'](_0x5541d3)[_0x22cb('0x22')](function(_0x5a3190){_0x359757[_0x22cb('0x1c')]=_0x5a3190;if(_0x574bcf[_0x22cb('0x2d')][_0x22cb('0x3d')]){_0x5a68de['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0x22cb('0x3e')](_0x5a68de);})[_0x22cb('0x22')](function(_0x54b148){_0x359757[_0x22cb('0x3f')]=_0x54b148;return _0x359757;})[_0x22cb('0x22')](respondWithFilteredResult(_0x293805,_0x5a68de))[_0x22cb('0x40')](handleError(_0x293805,null));};exports[_0x22cb('0x41')]=function(_0x35eb74,_0x799197){var _0x1f76f6={'raw':!![],'where':{'id':_0x35eb74[_0x22cb('0x42')]['id']}},_0x42ece0={};_0x42ece0[_0x22cb('0x2c')]=_[_0x22cb('0x2e')](db[_0x22cb('0x3c')][_0x22cb('0x28')]);_0x42ece0['query']=_[_0x22cb('0x2e')](_0x35eb74[_0x22cb('0x2d')]);_0x42ece0['filters']=_[_0x22cb('0x30')](_0x42ece0[_0x22cb('0x2c')],_0x42ece0[_0x22cb('0x2d')]);_0x1f76f6['attributes']=_[_0x22cb('0x30')](_0x42ece0[_0x22cb('0x2c')],qs[_0x22cb('0x32')](_0x35eb74['query'][_0x22cb('0x32')]));_0x1f76f6[_0x22cb('0x31')]=_0x1f76f6[_0x22cb('0x31')]['length']?_0x1f76f6[_0x22cb('0x31')]:_0x42ece0[_0x22cb('0x2c')];if(_0x35eb74[_0x22cb('0x2d')][_0x22cb('0x3d')]){_0x1f76f6[_0x22cb('0x43')]=[{'all':!![]}];}_0x1f76f6=_[_0x22cb('0x3a')]({},_0x1f76f6,_0x35eb74[_0x22cb('0x44')]);return db[_0x22cb('0x3c')][_0x22cb('0x45')](_0x1f76f6)['then'](handleEntityNotFound(_0x799197,null))[_0x22cb('0x22')](respondWithResult(_0x799197,null))[_0x22cb('0x40')](handleError(_0x799197,null));};exports[_0x22cb('0x46')]=function(_0x450951,_0x271520){return db[_0x22cb('0x3c')][_0x22cb('0x46')](_0x450951['body'],{})[_0x22cb('0x22')](respondWithResult(_0x271520,0xc9))[_0x22cb('0x40')](handleError(_0x271520,null));};exports[_0x22cb('0x21')]=function(_0x1ce0d6,_0x49d37d){if(_0x1ce0d6['body']['id']){delete _0x1ce0d6['body']['id'];}return db[_0x22cb('0x3c')][_0x22cb('0x45')]({'where':{'id':_0x1ce0d6[_0x22cb('0x42')]['id']}})[_0x22cb('0x22')](handleEntityNotFound(_0x49d37d,null))[_0x22cb('0x22')](saveUpdates(_0x1ce0d6[_0x22cb('0x47')],null))[_0x22cb('0x22')](respondWithResult(_0x49d37d,null))['catch'](handleError(_0x49d37d,null));};exports[_0x22cb('0x48')]=function(_0x59428d,_0x38069c){return db[_0x22cb('0x3c')]['find']({'where':{'id':_0x59428d[_0x22cb('0x42')]['id']}})[_0x22cb('0x22')](handleEntityNotFound(_0x38069c,null))['then'](removeEntity(_0x38069c,null))['catch'](handleError(_0x38069c,null));};exports[_0x22cb('0x49')]=function(_0x13853e,_0x4cc1a2){return db['VoiceDialReport'][_0x22cb('0x49')]()[_0x22cb('0x22')](respondWithResult(_0x4cc1a2,null))[_0x22cb('0x40')](handleError(_0x4cc1a2,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 9a95afe..887a019 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 _0x5109=['report_dial','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport'];(function(_0x97abb1,_0x448866){var _0x375d57=function(_0x391f8f){while(--_0x391f8f){_0x97abb1['push'](_0x97abb1['shift']());}};_0x375d57(++_0x448866);}(_0x5109,0xb8));var _0x9510=function(_0x2892f8,_0x16077b){_0x2892f8=_0x2892f8-0x0;var _0x1a3fa9=_0x5109[_0x2892f8];return _0x1a3fa9;};'use strict';var _=require(_0x9510('0x0'));var util=require(_0x9510('0x1'));var logger=require(_0x9510('0x2'))(_0x9510('0x3'));var moment=require(_0x9510('0x4'));var BPromise=require('bluebird');var rp=require(_0x9510('0x5'));var fs=require('fs');var path=require(_0x9510('0x6'));var rimraf=require(_0x9510('0x7'));var config=require(_0x9510('0x8'));var attributes=require(_0x9510('0x9'));module[_0x9510('0xa')]=function(_0x240d1a,_0x156535){return _0x240d1a['define'](_0x9510('0xb'),attributes,{'tableName':_0x9510('0xc'),'paranoid':![],'indexes':[{'fields':[_0x9510('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ccb=['bluebird','request-promise','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','lodash','util','api','moment'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0x8ccb[_0x35fb56];return _0x2fd52c;};'use strict';var _=require(_0xb8cc('0x0'));var util=require(_0xb8cc('0x1'));var logger=require('../../config/logger')(_0xb8cc('0x2'));var moment=require(_0xb8cc('0x3'));var BPromise=require(_0xb8cc('0x4'));var rp=require(_0xb8cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb8cc('0x6'));var attributes=require(_0xb8cc('0x7'));module[_0xb8cc('0x8')]=function(_0x4b6b5f,_0x46ac6e){return _0x4b6b5f[_0xb8cc('0x9')](_0xb8cc('0xa'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xb8cc('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 680a34f..6472802 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 _0x35bf=['jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','VoiceDialReport','update','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x19ffee,_0x5abed3){var _0x424a76=function(_0x3b33f0){while(--_0x3b33f0){_0x19ffee['push'](_0x19ffee['shift']());}};_0x424a76(++_0x5abed3);}(_0x35bf,0xa2));var _0xf35b=function(_0x103c7c,_0x1b3d9c){_0x103c7c=_0x103c7c-0x0;var _0x2f343f=_0x35bf[_0x103c7c];return _0x2f343f;};'use strict';var _=require(_0xf35b('0x0'));var util=require(_0xf35b('0x1'));var moment=require(_0xf35b('0x2'));var BPromise=require(_0xf35b('0x3'));var rs=require(_0xf35b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf35b('0x5'))(_0xf35b('0x6'));var config=require(_0xf35b('0x7'));var jayson=require(_0xf35b('0x8'));var client=jayson[_0xf35b('0x9')][_0xf35b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f308f,_0x13c6cc,_0x29b48d){return new BPromise(function(_0x3c5c20,_0x365172){return client[_0xf35b('0xb')](_0x2f308f,_0x29b48d)[_0xf35b('0xc')](function(_0x5aa51c){logger[_0xf35b('0xd')](_0xf35b('0xe'),_0x13c6cc,_0xf35b('0xf'));logger['debug'](_0xf35b('0x10'),_0x13c6cc,_0xf35b('0xf'),JSON[_0xf35b('0x11')](_0x5aa51c));if(_0x5aa51c[_0xf35b('0x12')]){if(_0x5aa51c[_0xf35b('0x12')][_0xf35b('0x13')]===0x1f4){logger[_0xf35b('0x12')](_0xf35b('0xe'),_0x13c6cc,_0x5aa51c[_0xf35b('0x12')][_0xf35b('0x14')]);return _0x365172(_0x5aa51c[_0xf35b('0x12')][_0xf35b('0x14')]);}logger[_0xf35b('0x12')](_0xf35b('0xe'),_0x13c6cc,_0x5aa51c[_0xf35b('0x12')][_0xf35b('0x14')]);return _0x3c5c20(_0x5aa51c[_0xf35b('0x12')]['message']);}else{logger[_0xf35b('0xd')](_0xf35b('0xe'),_0x13c6cc,_0xf35b('0xf'));_0x3c5c20(_0x5aa51c[_0xf35b('0x15')][_0xf35b('0x14')]);}})[_0xf35b('0x16')](function(_0x2c4e1d){logger[_0xf35b('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x13c6cc,_0x2c4e1d);_0x365172(_0x2c4e1d);});});}exports[_0xf35b('0x17')]=function(_0x3f33a3){var _0x3d50c1=this;return new Promise(function(_0x2410dd,_0x32250f){return db['VoiceDialReport'][_0xf35b('0x18')](_0x3f33a3[_0xf35b('0x19')],{'raw':_0x3f33a3['options']?_0x3f33a3[_0xf35b('0x1a')][_0xf35b('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xa9e711){logger[_0xf35b('0xd')](_0xf35b('0x17'),_0x3f33a3);logger['debug'](_0xf35b('0x17'),_0x3f33a3,JSON[_0xf35b('0x11')](_0xa9e711));_0x2410dd(_0xa9e711);})[_0xf35b('0x16')](function(_0x26f6d9){logger['error'](_0xf35b('0x17'),_0x26f6d9[_0xf35b('0x14')],_0x3f33a3);_0x32250f(_0x3d50c1[_0xf35b('0x12')](0x1f4,_0x26f6d9['message']));});});};exports[_0xf35b('0x1c')]=function(_0x2617bb){var _0x4e3f0a=this;return new Promise(function(_0x4a3a82,_0x3c6155){return db[_0xf35b('0x1d')][_0xf35b('0x1e')](_0x2617bb[_0xf35b('0x19')],{'raw':_0x2617bb[_0xf35b('0x1a')]?_0x2617bb['options'][_0xf35b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2617bb[_0xf35b('0x1a')]?_0x2617bb['options']['where']||null:null,'attributes':_0x2617bb[_0xf35b('0x1a')]?_0x2617bb['options'][_0xf35b('0x1f')]||null:null,'limit':_0x2617bb[_0xf35b('0x1a')]?_0x2617bb[_0xf35b('0x1a')][_0xf35b('0x20')]||null:null})[_0xf35b('0xc')](function(_0x1f5cc4){logger[_0xf35b('0xd')](_0xf35b('0x1c'),_0x2617bb);logger[_0xf35b('0x21')](_0xf35b('0x1c'),_0x2617bb,JSON[_0xf35b('0x11')](_0x1f5cc4));_0x4a3a82(_0x1f5cc4);})[_0xf35b('0x16')](function(_0x2fb744){logger[_0xf35b('0x12')](_0xf35b('0x1c'),_0x2fb744['message'],_0x2617bb);_0x3c6155(_0x4e3f0a[_0xf35b('0x12')](0x1f4,_0x2fb744[_0xf35b('0x14')]));});});}; \ No newline at end of file +var _0xbaac=['create','body','options','raw','stringify','update','where','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateVoiceDialReport','VoiceDialReport'];(function(_0x32c9b9,_0x21a0cf){var _0x239eab=function(_0x25fceb){while(--_0x25fceb){_0x32c9b9['push'](_0x32c9b9['shift']());}};_0x239eab(++_0x21a0cf);}(_0xbaac,0x1ad));var _0xcbaa=function(_0x2fd820,_0x385841){_0x2fd820=_0x2fd820-0x0;var _0x15a8b5=_0xbaac[_0x2fd820];return _0x15a8b5;};'use strict';var _=require(_0xcbaa('0x0'));var util=require(_0xcbaa('0x1'));var moment=require(_0xcbaa('0x2'));var BPromise=require(_0xcbaa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbaa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcbaa('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xcbaa('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcbaa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xf0a638,_0x165f38,_0x567c2a){return new BPromise(function(_0x33f2c8,_0x45ecdb){return client[_0xcbaa('0x8')](_0xf0a638,_0x567c2a)[_0xcbaa('0x9')](function(_0x5379ef){logger[_0xcbaa('0xa')](_0xcbaa('0xb'),_0x165f38,'request\x20sent');logger[_0xcbaa('0xc')](_0xcbaa('0xd'),_0x165f38,_0xcbaa('0xe'),JSON['stringify'](_0x5379ef));if(_0x5379ef['error']){if(_0x5379ef[_0xcbaa('0xf')][_0xcbaa('0x10')]===0x1f4){logger[_0xcbaa('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x165f38,_0x5379ef[_0xcbaa('0xf')][_0xcbaa('0x11')]);return _0x45ecdb(_0x5379ef[_0xcbaa('0xf')][_0xcbaa('0x11')]);}logger['error'](_0xcbaa('0xb'),_0x165f38,_0x5379ef[_0xcbaa('0xf')]['message']);return _0x33f2c8(_0x5379ef['error'][_0xcbaa('0x11')]);}else{logger[_0xcbaa('0xa')](_0xcbaa('0xb'),_0x165f38,_0xcbaa('0xe'));_0x33f2c8(_0x5379ef['result'][_0xcbaa('0x11')]);}})[_0xcbaa('0x12')](function(_0x2986d9){logger[_0xcbaa('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x165f38,_0x2986d9);_0x45ecdb(_0x2986d9);});});}exports[_0xcbaa('0x13')]=function(_0x574041){var _0x305120=this;return new Promise(function(_0x154c19,_0x54b071){return db[_0xcbaa('0x14')][_0xcbaa('0x15')](_0x574041[_0xcbaa('0x16')],{'raw':_0x574041[_0xcbaa('0x17')]?_0x574041['options'][_0xcbaa('0x18')]===undefined?!![]:![]:!![]})[_0xcbaa('0x9')](function(_0x176eb9){logger[_0xcbaa('0xa')](_0xcbaa('0x13'),_0x574041);logger['debug'](_0xcbaa('0x13'),_0x574041,JSON[_0xcbaa('0x19')](_0x176eb9));_0x154c19(_0x176eb9);})['catch'](function(_0x2de942){logger['error'](_0xcbaa('0x13'),_0x2de942[_0xcbaa('0x11')],_0x574041);_0x54b071(_0x305120[_0xcbaa('0xf')](0x1f4,_0x2de942[_0xcbaa('0x11')]));});});};exports['UpdateVoiceDialReport']=function(_0x1d3b01){var _0x1c5a01=this;return new Promise(function(_0x40dabc,_0x127475){return db[_0xcbaa('0x14')][_0xcbaa('0x1a')](_0x1d3b01['body'],{'raw':_0x1d3b01[_0xcbaa('0x17')]?_0x1d3b01[_0xcbaa('0x17')][_0xcbaa('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d3b01[_0xcbaa('0x17')]?_0x1d3b01[_0xcbaa('0x17')][_0xcbaa('0x1b')]||null:null,'attributes':_0x1d3b01[_0xcbaa('0x17')]?_0x1d3b01['options']['attributes']||null:null,'limit':_0x1d3b01[_0xcbaa('0x17')]?_0x1d3b01[_0xcbaa('0x17')][_0xcbaa('0x1c')]||null:null})[_0xcbaa('0x9')](function(_0x239b34){logger[_0xcbaa('0xa')](_0xcbaa('0x1d'),_0x1d3b01);logger[_0xcbaa('0xc')](_0xcbaa('0x1d'),_0x1d3b01,JSON[_0xcbaa('0x19')](_0x239b34));_0x40dabc(_0x239b34);})[_0xcbaa('0x12')](function(_0x13a496){logger['error'](_0xcbaa('0x1d'),_0x13a496[_0xcbaa('0x11')],_0x1d3b01);_0x127475(_0x1c5a01[_0xcbaa('0xf')](0x1f4,_0x13a496[_0xcbaa('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 70ffcf4..bef6ae5 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 _0x4403=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','exports','multer','util'];(function(_0x2eaa66,_0x2062c0){var _0x3b1dd3=function(_0x2ef28a){while(--_0x2ef28a){_0x2eaa66['push'](_0x2eaa66['shift']());}};_0x3b1dd3(++_0x2062c0);}(_0x4403,0x96));var _0x3440=function(_0x590198,_0x50b486){_0x590198=_0x590198-0x0;var _0x537ded=_0x4403[_0x590198];return _0x537ded;};'use strict';var multer=require(_0x3440('0x0'));var util=require(_0x3440('0x1'));var path=require(_0x3440('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3440('0x3')]();var fs_extra=require(_0x3440('0x4'));var auth=require(_0x3440('0x5'));var interaction=require(_0x3440('0x6'));var config=require(_0x3440('0x7'));var controller=require(_0x3440('0x8'));router[_0x3440('0x9')]('/',auth[_0x3440('0xa')](),controller[_0x3440('0xb')]);router['get'](_0x3440('0xc'),auth['isAuthenticated'](),controller[_0x3440('0xd')]);router[_0x3440('0xe')]('/',auth['isAuthenticated'](),controller[_0x3440('0xf')]);router['post'](_0x3440('0x10'),auth[_0x3440('0xa')](),controller[_0x3440('0x11')]);router['put'](_0x3440('0xc'),auth[_0x3440('0xa')](),controller['update']);router['delete'](_0x3440('0xc'),auth[_0x3440('0xa')](),controller['destroy']);module[_0x3440('0x12')]=router; \ No newline at end of file +var _0xa76c=['index','/:id','show','create','post','/:id/applications','addApplications','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x38490b,_0x108ad7){var _0x197661=function(_0x70a164){while(--_0x70a164){_0x38490b['push'](_0x38490b['shift']());}};_0x197661(++_0x108ad7);}(_0xa76c,0x14b));var _0xca76=function(_0x606fe8,_0x10b084){_0x606fe8=_0x606fe8-0x0;var _0x28b517=_0xa76c[_0x606fe8];return _0x28b517;};'use strict';var multer=require(_0xca76('0x0'));var util=require(_0xca76('0x1'));var path=require('path');var timeout=require(_0xca76('0x2'));var express=require(_0xca76('0x3'));var router=express[_0xca76('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xca76('0x5'));var interaction=require(_0xca76('0x6'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0xca76('0x7')]('/',auth[_0xca76('0x8')](),controller[_0xca76('0x9')]);router[_0xca76('0x7')](_0xca76('0xa'),auth[_0xca76('0x8')](),controller[_0xca76('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xca76('0xc')]);router[_0xca76('0xd')](_0xca76('0xe'),auth[_0xca76('0x8')](),controller[_0xca76('0xf')]);router[_0xca76('0x10')](_0xca76('0xa'),auth[_0xca76('0x8')](),controller[_0xca76('0x11')]);router[_0xca76('0x12')](_0xca76('0xa'),auth['isAuthenticated'](),controller[_0xca76('0x13')]);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 fe220de..1abccb7 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 _0x30ed=['exten','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x30ed,0xa1));var _0xd30e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30ed[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xd30e('0x0')]={'context':{'type':Sequelize[_0xd30e('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd30e('0x1')],'allowNull':![],'unique':_0xd30e('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xd30e('0x2')},'tag':{'type':Sequelize[_0xd30e('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xd30e('0x1')],'allowNull':![],'defaultValue':_0xd30e('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xd30e('0x4')](_0xd30e('0x5'),_0xd30e('0x6'),_0xd30e('0x7'),_0xd30e('0x8'),'outbound-fax',_0xd30e('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xd30e('0x1')]},'interval':{'type':Sequelize[_0xd30e('0x1')],'allowNull':![],'defaultValue':_0xd30e('0xa')},'IntervalId':{'type':Sequelize[_0xd30e('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd30e('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xd30e('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xd30e('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd30e('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xd30e('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xd30e('0xe')],'get':function(_0x2d0cbf){return this['getDataValue'](_0xd30e('0xf'));}},'alias':{'type':Sequelize[_0xd30e('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x3cea=['BOOLEAN','INTEGER','wav','VIRTUAL','exten','sequelize','exports','compositeIndex','STRING','ENUM','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*'];(function(_0x5a7601,_0x2ca777){var _0x311673=function(_0xe280ec){while(--_0xe280ec){_0x5a7601['push'](_0x5a7601['shift']());}};_0x311673(++_0x2ca777);}(_0x3cea,0x1bf));var _0xa3ce=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3cea[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xa3ce('0x0'));module[_0xa3ce('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa3ce('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xa3ce('0x3')],'allowNull':![],'unique':_0xa3ce('0x2')},'priority':{'type':Sequelize[_0xa3ce('0x3')],'allowNull':![],'defaultValue':'1','unique':_0xa3ce('0x2')},'tag':{'type':Sequelize[_0xa3ce('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xa3ce('0x3')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xa3ce('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xa3ce('0x4')](_0xa3ce('0x5'),_0xa3ce('0x6'),_0xa3ce('0x7'),'inbound-fax',_0xa3ce('0x8'),_0xa3ce('0x9'),_0xa3ce('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xa3ce('0x3')]},'interval':{'type':Sequelize[_0xa3ce('0x3')],'allowNull':![],'defaultValue':_0xa3ce('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xa3ce('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xa3ce('0x3')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xa3ce('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xa3ce('0xd')]},'recordingFormat':{'type':Sequelize[_0xa3ce('0x3')],'defaultValue':_0xa3ce('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xa3ce('0xf')],'get':function(_0x3c116b){return this['getDataValue'](_0xa3ce('0x10'));}},'alias':{'type':Sequelize[_0xa3ce('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 3f26344..f83aa84 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 _0x3844=['rows','catch','show','params','rawAttributes','options','create','body','startsWith','exten','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','InboundRoutes','OutboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','addApplications','sequelize','transaction','Transaction','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','inbound','outbound','InternalRoutes','internal','map','value','includes','type','find','name','UserProfileResource','then','end','error','stack','send','index','VoiceExtension','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','findAll'];(function(_0x5db974,_0x45126b){var _0x32b019=function(_0x49ddd7){while(--_0x49ddd7){_0x5db974['push'](_0x5db974['shift']());}};_0x32b019(++_0x45126b);}(_0x3844,0x83));var _0x4384=function(_0x4e8c09,_0x38eae6){_0x4e8c09=_0x4e8c09-0x0;var _0x5aca42=_0x3844[_0x4e8c09];return _0x5aca42;};'use strict';var _=require(_0x4384('0x0'));var Redis=require('ioredis');var qs=require(_0x4384('0x1'));var logger=require(_0x4384('0x2'))('api');var config=require('../../config/environment');var db=require(_0x4384('0x3'))['db'];config[_0x4384('0x4')]=_[_0x4384('0x5')](config[_0x4384('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x4384('0x6'))(new Redis(config[_0x4384('0x4')]));require(_0x4384('0x7'))[_0x4384('0x8')](socket);function respondWithStatusCode(_0x3bf52e,_0x967cdf){_0x967cdf=_0x967cdf||0xcc;return function(_0x4dd03f){if(_0x4dd03f){return _0x3bf52e[_0x4384('0x9')](_0x967cdf);}return _0x3bf52e[_0x4384('0xa')](_0x967cdf)['end']();};}function respondWithResult(_0x4ebb0c,_0x502b16){_0x502b16=_0x502b16||0xc8;return function(_0x3369a6){if(_0x3369a6){return _0x4ebb0c['status'](_0x502b16)[_0x4384('0xb')](_0x3369a6);}};}function respondWithFilteredResult(_0xf3f1af,_0x82b305){return function(_0x21deaa){if(_0x21deaa){var _0xcfa3ee=typeof _0x82b305[_0x4384('0xc')]===_0x4384('0xd')&&typeof _0x82b305[_0x4384('0xe')]==='undefined';var _0x83181=_0x21deaa[_0x4384('0xf')];var _0x48f453=_0xcfa3ee?0x0:_0x82b305[_0x4384('0xc')];var _0x8aa6da=_0xcfa3ee?_0x21deaa[_0x4384('0xf')]:_0x82b305[_0x4384('0xc')]+_0x82b305[_0x4384('0xe')];var _0x44c091;if(_0x8aa6da>=_0x83181){_0x8aa6da=_0x83181;_0x44c091=0xc8;}else{_0x44c091=0xce;}_0xf3f1af[_0x4384('0xa')](_0x44c091);return _0xf3f1af[_0x4384('0x10')](_0x4384('0x11'),_0x48f453+'-'+_0x8aa6da+'/'+_0x83181)['json'](_0x21deaa);}return null;};}function removeEntity(_0x50279d){return function(_0x4785e5){if(_0x4785e5){return _0x4785e5[_0x4384('0x12')]()['then'](function(){var _0x2edf33=_0x4785e5['get']({'plain':!![]});var _0x454bab=[{'name':'InboundRoutes','value':_0x4384('0x13'),'ignore':![]},{'name':'OutboundRoutes','value':_0x4384('0x14'),'ignore':![]},{'name':_0x4384('0x15'),'value':_0x4384('0x16'),'ignore':![]}];var _0x372a50=_(_0x454bab)['filter']('ignore')[_0x4384('0x17')](_0x4384('0x18'))[_0x4384('0x18')]();if(_[_0x4384('0x19')](_0x372a50,_0x2edf33[_0x4384('0x1a')])){return;}var _0x4cc7cb=_[_0x4384('0x1b')](_0x454bab,[_0x4384('0x18'),_0x2edf33['type']])[_0x4384('0x1c')];return db[_0x4384('0x1d')][_0x4384('0x12')]({'where':{'type':_0x4cc7cb,'resourceId':_0x2edf33['id']}})[_0x4384('0x1e')](function(){return _0x4785e5;});})[_0x4384('0x1e')](function(){_0x50279d[_0x4384('0xa')](0xcc)[_0x4384('0x1f')]();});}};}function handleEntityNotFound(_0x22f750){return function(_0x4cfce9){if(!_0x4cfce9){_0x22f750[_0x4384('0x9')](0x194);}return _0x4cfce9;};}function handleError(_0x3ce101,_0x1fa40e){_0x1fa40e=_0x1fa40e||0x1f4;return function(_0x234824){logger[_0x4384('0x20')](_0x234824[_0x4384('0x21')]);if(_0x234824[_0x4384('0x1c')]){delete _0x234824[_0x4384('0x1c')];}_0x3ce101[_0x4384('0xa')](_0x1fa40e)[_0x4384('0x22')](_0x234824);};}exports[_0x4384('0x23')]=function(_0x2835b9,_0x3bd58b){var _0x4351fc={},_0x28f295={},_0x4c2eee={'count':0x0,'rows':[]};var _0x2ec64a=_[_0x4384('0x17')](db[_0x4384('0x24')]['rawAttributes'],function(_0x5614bc){return{'name':_0x5614bc[_0x4384('0x25')],'type':_0x5614bc['type'][_0x4384('0x26')]};});_0x28f295[_0x4384('0x27')]=_[_0x4384('0x17')](_0x2ec64a,_0x4384('0x1c'));_0x28f295['query']=_[_0x4384('0x28')](_0x2835b9[_0x4384('0x29')]);_0x28f295[_0x4384('0x2a')]=_[_0x4384('0x2b')](_0x28f295['model'],_0x28f295[_0x4384('0x29')]);_0x4351fc['attributes']=_[_0x4384('0x2b')](_0x28f295[_0x4384('0x27')],qs[_0x4384('0x2c')](_0x2835b9[_0x4384('0x29')]['fields']));_0x4351fc[_0x4384('0x2d')]=_0x4351fc['attributes'][_0x4384('0x2e')]?_0x4351fc[_0x4384('0x2d')]:_0x28f295['model'];if(!_0x2835b9[_0x4384('0x29')]['hasOwnProperty'](_0x4384('0x2f'))){_0x4351fc[_0x4384('0xe')]=qs[_0x4384('0xe')](_0x2835b9[_0x4384('0x29')]['limit']);_0x4351fc[_0x4384('0xc')]=qs[_0x4384('0xc')](_0x2835b9[_0x4384('0x29')][_0x4384('0xc')]);}_0x4351fc[_0x4384('0x30')]=qs[_0x4384('0x31')](_0x2835b9[_0x4384('0x29')][_0x4384('0x31')]);_0x4351fc[_0x4384('0x32')]=qs[_0x4384('0x2a')](_['pick'](_0x2835b9[_0x4384('0x29')],_0x28f295['filters']),_0x2ec64a);if(_0x2835b9['query'][_0x4384('0x33')]){_0x4351fc[_0x4384('0x32')]=_[_0x4384('0x34')](_0x4351fc[_0x4384('0x32')],{'$or':_['map'](_0x2ec64a,function(_0x2dd033){if(_0x2dd033[_0x4384('0x1a')]!==_0x4384('0x35')){var _0x4a32d0={};_0x4a32d0[_0x2dd033['name']]={'$like':'%'+_0x2835b9[_0x4384('0x29')][_0x4384('0x33')]+'%'};return _0x4a32d0;}})});}_0x4351fc=_['merge']({},_0x4351fc,_0x2835b9['options']);var _0x5b97b4={'where':_0x4351fc[_0x4384('0x32')]};return db[_0x4384('0x24')]['count'](_0x5b97b4)['then'](function(_0x2a8eba){_0x4c2eee['count']=_0x2a8eba;if(_0x2835b9[_0x4384('0x29')]['includeAll']){_0x4351fc['include']=[{'all':!![]}];}return db['VoiceExtension'][_0x4384('0x36')](_0x4351fc);})[_0x4384('0x1e')](function(_0x5a4659){_0x4c2eee[_0x4384('0x37')]=_0x5a4659;return _0x4c2eee;})[_0x4384('0x1e')](respondWithFilteredResult(_0x3bd58b,_0x4351fc))[_0x4384('0x38')](handleError(_0x3bd58b,null));};exports[_0x4384('0x39')]=function(_0x2a156e,_0x5d7df1){var _0x5c9bde={'raw':![],'where':{'id':_0x2a156e[_0x4384('0x3a')]['id']}},_0x3c04f8={};_0x3c04f8[_0x4384('0x27')]=_['keys'](db[_0x4384('0x24')][_0x4384('0x3b')]);_0x3c04f8[_0x4384('0x29')]=_[_0x4384('0x28')](_0x2a156e['query']);_0x3c04f8['filters']=_[_0x4384('0x2b')](_0x3c04f8[_0x4384('0x27')],_0x3c04f8[_0x4384('0x29')]);_0x5c9bde[_0x4384('0x2d')]=_[_0x4384('0x2b')](_0x3c04f8[_0x4384('0x27')],qs[_0x4384('0x2c')](_0x2a156e[_0x4384('0x29')][_0x4384('0x2c')]));_0x5c9bde[_0x4384('0x2d')]=_0x5c9bde[_0x4384('0x2d')][_0x4384('0x2e')]?_0x5c9bde['attributes']:_0x3c04f8[_0x4384('0x27')];if(_0x2a156e['query']['includeAll']){_0x5c9bde['include']=[{'all':!![]}];}_0x5c9bde=_[_0x4384('0x34')]({},_0x5c9bde,_0x2a156e[_0x4384('0x3c')]);return db[_0x4384('0x24')]['find'](_0x5c9bde)[_0x4384('0x1e')](handleEntityNotFound(_0x5d7df1,null))[_0x4384('0x1e')](respondWithResult(_0x5d7df1,null))['catch'](handleError(_0x5d7df1,null));};exports[_0x4384('0x12')]=function(_0x21be65,_0x4672f5){return db['VoiceExtension'][_0x4384('0x1b')]({'where':{'id':_0x21be65['params']['id']}})[_0x4384('0x1e')](handleEntityNotFound(_0x4672f5,null))[_0x4384('0x1e')](removeEntity(_0x4672f5,null))[_0x4384('0x38')](handleError(_0x4672f5,null));};exports[_0x4384('0x3d')]=function(_0x5b7a31,_0x159750){if(_0x5b7a31[_0x4384('0x3e')][_0x4384('0x1a')]===_0x4384('0x14')&&!_[_0x4384('0x3f')](_0x5b7a31[_0x4384('0x3e')][_0x4384('0x40')],'_')){_0x5b7a31[_0x4384('0x3e')][_0x4384('0x40')]='_'[_0x4384('0x41')](_0x5b7a31[_0x4384('0x3e')][_0x4384('0x40')]);}return db[_0x4384('0x24')][_0x4384('0x3d')](_0x5b7a31[_0x4384('0x3e')],{'raw':![]})['then'](function(_0x2eba53){var _0x509ac5=_0x5b7a31['user'][_0x4384('0x42')]({'plain':!![]});if(!_0x509ac5)throw new Error(_0x4384('0x43'));if(_0x509ac5[_0x4384('0x44')]===_0x4384('0x45')){var _0x28352a=_0x2eba53[_0x4384('0x42')]({'plain':!![]});var _0x5249c6=[{'name':_0x4384('0x46'),'value':_0x4384('0x13')},{'name':_0x4384('0x47'),'value':_0x4384('0x14')},{'name':_0x4384('0x15'),'value':_0x4384('0x16')}];var _0x4083c2=_['find'](_0x5249c6,[_0x4384('0x18'),_0x28352a['type']])[_0x4384('0x1c')];return db[_0x4384('0x48')][_0x4384('0x1b')]({'where':{'name':_0x4083c2,'userProfileId':_0x509ac5[_0x4384('0x49')]},'raw':!![]})[_0x4384('0x1e')](function(_0x39f750){if(_0x39f750&&_0x39f750[_0x4384('0x4a')]===0x0){return db['UserProfileResource'][_0x4384('0x3d')]({'name':_0x28352a[_0x4384('0x1c')],'resourceId':_0x28352a['id'],'type':_0x39f750['name'],'sectionId':_0x39f750['id']},{})[_0x4384('0x1e')](function(){return _0x2eba53;});}else{return _0x2eba53;}})[_0x4384('0x38')](function(_0x2c0e53){logger[_0x4384('0x20')](_0x4384('0x4b'),_0x2c0e53);throw _0x2c0e53;});}return _0x2eba53;})[_0x4384('0x1e')](respondWithResult(_0x159750,0xc9))[_0x4384('0x38')](handleError(_0x159750,null));};exports[_0x4384('0x4c')]=function(_0x487f87,_0x7b46ad){if(_0x487f87[_0x4384('0x3e')]['id']){delete _0x487f87[_0x4384('0x3e')]['id'];}return db['VoiceExtension'][_0x4384('0x1b')]({'where':{'id':_0x487f87['params']['id']}})['then'](handleEntityNotFound(_0x7b46ad,null))['then'](function(_0x514391){if(_0x514391){return db['VoiceExtension'][_0x4384('0x4c')](_[_0x4384('0x4d')](_0x487f87[_0x4384('0x3e')],['exten',_0x4384('0x4e'),_0x4384('0x4f'),_0x4384('0x50'),_0x4384('0x51'),'mandatoryDisposition','alias']),{'where':{'context':_0x514391['context'],'exten':_0x514391[_0x4384('0x40')]},'individualHooks':!![]})[_0x4384('0x1e')](function(_0x4a91f0){return _0x4a91f0;});}return null;})[_0x4384('0x1e')](respondWithStatusCode(_0x7b46ad,null))[_0x4384('0x38')](handleError(_0x7b46ad,null));};exports[_0x4384('0x52')]=function(_0x493aa4,_0x353205){var _0x1ed6c0=_0x493aa4['params']['id'];var _0x1f6c7a=_0x493aa4[_0x4384('0x3e')];var _0x5f42d4=0xc8;var _0x2fc282=null;return db[_0x4384('0x53')][_0x4384('0x54')]({'isolationLevel':db[_0x4384('0x53')][_0x4384('0x55')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x3832ba){return db[_0x4384('0x24')][_0x4384('0x56')]({'where':{'id':_0x1ed6c0},'transaction':_0x3832ba})[_0x4384('0x1e')](function(_0x34cced){if(_0x34cced){return db[_0x4384('0x24')]['destroy']({'where':{'VoiceExtensionId':_0x1ed6c0},'transaction':_0x3832ba})['then'](function(){var _0x446ba0=_['map'](_0x1f6c7a,function(_0x271685){_0x271685[_0x4384('0x57')]=_0x1ed6c0;_0x271685[_0x4384('0x58')]=!![];return _0x271685;});return _0x34cced['createRouting'](_0x446ba0);})[_0x4384('0x1e')](function(_0x49d5c9){return db[_0x4384('0x24')][_0x4384('0x59')](_0x49d5c9,{'transaction':_0x3832ba});});}else{_0x5f42d4=0x194;_0x2fc282=[];}});})[_0x4384('0x1e')](function(){if(_0x5f42d4!==0x194){return db[_0x4384('0x24')][_0x4384('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1ed6c0},'order':_0x4384('0x5b')})[_0x4384('0x1e')](function(_0x1aac24){_0x2fc282=_0x1aac24;});}})['catch'](function(_0x3141ad){_0x5f42d4=0x1f4;logger['error'](_0x3141ad['stack']);if(_0x3141ad[_0x4384('0x1c')]){delete _0x3141ad[_0x4384('0x1c')];}_0x2fc282=_0x3141ad;})[_0x4384('0x5c')](function(){if(_0x2fc282===null){_0x353205[_0x4384('0x9')](_0x5f42d4);}else{if(_0x5f42d4===0x1f4){_0x353205[_0x4384('0xa')](_0x5f42d4)['send'](_0x2fc282);}else{_0x353205[_0x4384('0xa')](_0x5f42d4)['json'](_0x2fc282);}}});}; \ No newline at end of file +var _0x25f8=['startsWith','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','params','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceExtension','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','filters','options','create','outbound'];(function(_0x3962d4,_0x34138d){var _0x4a164d=function(_0x1153aa){while(--_0x1153aa){_0x3962d4['push'](_0x3962d4['shift']());}};_0x4a164d(++_0x34138d);}(_0x25f8,0xe3));var _0x825f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x25f8[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x825f('0x0'));var Redis=require(_0x825f('0x1'));var qs=require(_0x825f('0x2'));var logger=require(_0x825f('0x3'))('api');var config=require(_0x825f('0x4'));var db=require('../../mysqldb')['db'];config[_0x825f('0x5')]=_[_0x825f('0x6')](config['redis'],{'host':_0x825f('0x7'),'port':0x18eb});var socket=require(_0x825f('0x8'))(new Redis(config['redis']));require(_0x825f('0x9'))['register'](socket);function respondWithStatusCode(_0x4ad4ef,_0x100c31){_0x100c31=_0x100c31||0xcc;return function(_0x16c02a){if(_0x16c02a){return _0x4ad4ef[_0x825f('0xa')](_0x100c31);}return _0x4ad4ef['status'](_0x100c31)[_0x825f('0xb')]();};}function respondWithResult(_0x53fdaa,_0x1ac2dc){_0x1ac2dc=_0x1ac2dc||0xc8;return function(_0x185e32){if(_0x185e32){return _0x53fdaa[_0x825f('0xc')](_0x1ac2dc)[_0x825f('0xd')](_0x185e32);}};}function respondWithFilteredResult(_0x3297f5,_0x120c04){return function(_0x4aed7a){if(_0x4aed7a){var _0x324851=typeof _0x120c04[_0x825f('0xe')]===_0x825f('0xf')&&typeof _0x120c04[_0x825f('0x10')]===_0x825f('0xf');var _0x611651=_0x4aed7a['count'];var _0x4f4ba8=_0x324851?0x0:_0x120c04['offset'];var _0x2dd57c=_0x324851?_0x4aed7a[_0x825f('0x11')]:_0x120c04['offset']+_0x120c04['limit'];var _0x2ccc52;if(_0x2dd57c>=_0x611651){_0x2dd57c=_0x611651;_0x2ccc52=0xc8;}else{_0x2ccc52=0xce;}_0x3297f5[_0x825f('0xc')](_0x2ccc52);return _0x3297f5[_0x825f('0x12')](_0x825f('0x13'),_0x4f4ba8+'-'+_0x2dd57c+'/'+_0x611651)[_0x825f('0xd')](_0x4aed7a);}return null;};}function removeEntity(_0x2bb1d5){return function(_0x46e9b7){if(_0x46e9b7){return _0x46e9b7[_0x825f('0x14')]()[_0x825f('0x15')](function(){var _0x5a847d=_0x46e9b7[_0x825f('0x16')]({'plain':!![]});var _0x176c19=[{'name':_0x825f('0x17'),'value':_0x825f('0x18'),'ignore':![]},{'name':_0x825f('0x19'),'value':'outbound','ignore':![]},{'name':_0x825f('0x1a'),'value':_0x825f('0x1b'),'ignore':![]}];var _0x2c8bd5=_(_0x176c19)[_0x825f('0x1c')](_0x825f('0x1d'))[_0x825f('0x1e')](_0x825f('0x1f'))[_0x825f('0x1f')]();if(_[_0x825f('0x20')](_0x2c8bd5,_0x5a847d[_0x825f('0x21')])){return;}var _0x23e988=_[_0x825f('0x22')](_0x176c19,[_0x825f('0x1f'),_0x5a847d[_0x825f('0x21')]])[_0x825f('0x23')];return db[_0x825f('0x24')]['destroy']({'where':{'type':_0x23e988,'resourceId':_0x5a847d['id']}})[_0x825f('0x15')](function(){return _0x46e9b7;});})[_0x825f('0x15')](function(){_0x2bb1d5[_0x825f('0xc')](0xcc)[_0x825f('0xb')]();});}};}function handleEntityNotFound(_0x3a6cd3){return function(_0x25373a){if(!_0x25373a){_0x3a6cd3[_0x825f('0xa')](0x194);}return _0x25373a;};}function handleError(_0x171ac1,_0x1b37d1){_0x1b37d1=_0x1b37d1||0x1f4;return function(_0x402024){logger[_0x825f('0x25')](_0x402024[_0x825f('0x26')]);if(_0x402024['name']){delete _0x402024[_0x825f('0x23')];}_0x171ac1[_0x825f('0xc')](_0x1b37d1)[_0x825f('0x27')](_0x402024);};}exports[_0x825f('0x28')]=function(_0x50c3b4,_0x303e66){var _0x3f56fd={},_0x74f98e={},_0x58272f={'count':0x0,'rows':[]};var _0x12b6a6=_[_0x825f('0x1e')](db[_0x825f('0x29')]['rawAttributes'],function(_0x159451){return{'name':_0x159451[_0x825f('0x2a')],'type':_0x159451[_0x825f('0x21')]['key']};});_0x74f98e[_0x825f('0x2b')]=_[_0x825f('0x1e')](_0x12b6a6,_0x825f('0x23'));_0x74f98e[_0x825f('0x2c')]=_[_0x825f('0x2d')](_0x50c3b4['query']);_0x74f98e['filters']=_[_0x825f('0x2e')](_0x74f98e[_0x825f('0x2b')],_0x74f98e['query']);_0x3f56fd[_0x825f('0x2f')]=_['intersection'](_0x74f98e[_0x825f('0x2b')],qs['fields'](_0x50c3b4[_0x825f('0x2c')][_0x825f('0x30')]));_0x3f56fd['attributes']=_0x3f56fd[_0x825f('0x2f')][_0x825f('0x31')]?_0x3f56fd[_0x825f('0x2f')]:_0x74f98e[_0x825f('0x2b')];if(!_0x50c3b4['query'][_0x825f('0x32')](_0x825f('0x33'))){_0x3f56fd[_0x825f('0x10')]=qs[_0x825f('0x10')](_0x50c3b4['query']['limit']);_0x3f56fd['offset']=qs['offset'](_0x50c3b4[_0x825f('0x2c')][_0x825f('0xe')]);}_0x3f56fd[_0x825f('0x34')]=qs[_0x825f('0x35')](_0x50c3b4[_0x825f('0x2c')]['sort']);_0x3f56fd[_0x825f('0x36')]=qs['filters'](_['pick'](_0x50c3b4[_0x825f('0x2c')],_0x74f98e['filters']),_0x12b6a6);if(_0x50c3b4[_0x825f('0x2c')][_0x825f('0x1c')]){_0x3f56fd['where']=_['merge'](_0x3f56fd['where'],{'$or':_[_0x825f('0x1e')](_0x12b6a6,function(_0x9f3a87){if(_0x9f3a87[_0x825f('0x21')]!==_0x825f('0x37')){var _0x535b52={};_0x535b52[_0x9f3a87['name']]={'$like':'%'+_0x50c3b4[_0x825f('0x2c')]['filter']+'%'};return _0x535b52;}})});}_0x3f56fd=_[_0x825f('0x38')]({},_0x3f56fd,_0x50c3b4['options']);var _0x1079bf={'where':_0x3f56fd[_0x825f('0x36')]};return db['VoiceExtension']['count'](_0x1079bf)[_0x825f('0x15')](function(_0x458ed9){_0x58272f[_0x825f('0x11')]=_0x458ed9;if(_0x50c3b4['query'][_0x825f('0x39')]){_0x3f56fd[_0x825f('0x3a')]=[{'all':!![]}];}return db[_0x825f('0x29')][_0x825f('0x3b')](_0x3f56fd);})[_0x825f('0x15')](function(_0x3d948b){_0x58272f[_0x825f('0x3c')]=_0x3d948b;return _0x58272f;})[_0x825f('0x15')](respondWithFilteredResult(_0x303e66,_0x3f56fd))[_0x825f('0x3d')](handleError(_0x303e66,null));};exports[_0x825f('0x3e')]=function(_0x24a933,_0x4eabcd){var _0x1ec181={'raw':![],'where':{'id':_0x24a933['params']['id']}},_0x5d1127={};_0x5d1127[_0x825f('0x2b')]=_[_0x825f('0x2d')](db[_0x825f('0x29')]['rawAttributes']);_0x5d1127[_0x825f('0x2c')]=_[_0x825f('0x2d')](_0x24a933[_0x825f('0x2c')]);_0x5d1127[_0x825f('0x3f')]=_[_0x825f('0x2e')](_0x5d1127[_0x825f('0x2b')],_0x5d1127[_0x825f('0x2c')]);_0x1ec181[_0x825f('0x2f')]=_[_0x825f('0x2e')](_0x5d1127[_0x825f('0x2b')],qs[_0x825f('0x30')](_0x24a933['query'][_0x825f('0x30')]));_0x1ec181[_0x825f('0x2f')]=_0x1ec181[_0x825f('0x2f')][_0x825f('0x31')]?_0x1ec181['attributes']:_0x5d1127[_0x825f('0x2b')];if(_0x24a933[_0x825f('0x2c')]['includeAll']){_0x1ec181[_0x825f('0x3a')]=[{'all':!![]}];}_0x1ec181=_[_0x825f('0x38')]({},_0x1ec181,_0x24a933[_0x825f('0x40')]);return db[_0x825f('0x29')]['find'](_0x1ec181)[_0x825f('0x15')](handleEntityNotFound(_0x4eabcd,null))[_0x825f('0x15')](respondWithResult(_0x4eabcd,null))[_0x825f('0x3d')](handleError(_0x4eabcd,null));};exports['destroy']=function(_0x5f0f4a,_0x215b98){return db[_0x825f('0x29')][_0x825f('0x22')]({'where':{'id':_0x5f0f4a['params']['id']}})['then'](handleEntityNotFound(_0x215b98,null))[_0x825f('0x15')](removeEntity(_0x215b98,null))[_0x825f('0x3d')](handleError(_0x215b98,null));};exports[_0x825f('0x41')]=function(_0x43c44a,_0x293219){if(_0x43c44a['body']['type']===_0x825f('0x42')&&!_[_0x825f('0x43')](_0x43c44a[_0x825f('0x44')][_0x825f('0x45')],'_')){_0x43c44a[_0x825f('0x44')][_0x825f('0x45')]='_'[_0x825f('0x46')](_0x43c44a[_0x825f('0x44')][_0x825f('0x45')]);}return db[_0x825f('0x29')][_0x825f('0x41')](_0x43c44a[_0x825f('0x44')],{'raw':![]})['then'](function(_0x19e4dc){var _0x5b6b32=_0x43c44a[_0x825f('0x47')][_0x825f('0x16')]({'plain':!![]});if(!_0x5b6b32)throw new Error(_0x825f('0x48'));if(_0x5b6b32['role']===_0x825f('0x47')){var _0x31004f=_0x19e4dc['get']({'plain':!![]});var _0x1d84a5=[{'name':_0x825f('0x17'),'value':_0x825f('0x18')},{'name':_0x825f('0x19'),'value':'outbound'},{'name':'InternalRoutes','value':_0x825f('0x1b')}];var _0x385592=_[_0x825f('0x22')](_0x1d84a5,[_0x825f('0x1f'),_0x31004f[_0x825f('0x21')]])[_0x825f('0x23')];return db[_0x825f('0x49')][_0x825f('0x22')]({'where':{'name':_0x385592,'userProfileId':_0x5b6b32[_0x825f('0x4a')]},'raw':!![]})[_0x825f('0x15')](function(_0x591a86){if(_0x591a86&&_0x591a86[_0x825f('0x4b')]===0x0){return db[_0x825f('0x24')][_0x825f('0x41')]({'name':_0x31004f['name'],'resourceId':_0x31004f['id'],'type':_0x591a86[_0x825f('0x23')],'sectionId':_0x591a86['id']},{})[_0x825f('0x15')](function(){return _0x19e4dc;});}else{return _0x19e4dc;}})[_0x825f('0x3d')](function(_0x1504c5){logger[_0x825f('0x25')](_0x825f('0x4c'),_0x1504c5);throw _0x1504c5;});}return _0x19e4dc;})[_0x825f('0x15')](respondWithResult(_0x293219,0xc9))[_0x825f('0x3d')](handleError(_0x293219,null));};exports[_0x825f('0x4d')]=function(_0x1f73b7,_0x3eca44){if(_0x1f73b7[_0x825f('0x44')]['id']){delete _0x1f73b7[_0x825f('0x44')]['id'];}return db[_0x825f('0x29')]['find']({'where':{'id':_0x1f73b7['params']['id']}})[_0x825f('0x15')](handleEntityNotFound(_0x3eca44,null))['then'](function(_0x118c96){if(_0x118c96){return db['VoiceExtension']['update'](_['pick'](_0x1f73b7['body'],['exten',_0x825f('0x4e'),_0x825f('0x4f'),_0x825f('0x50'),_0x825f('0x51'),_0x825f('0x52'),_0x825f('0x53')]),{'where':{'context':_0x118c96[_0x825f('0x4e')],'exten':_0x118c96[_0x825f('0x45')]},'individualHooks':!![]})[_0x825f('0x15')](function(_0x265825){return _0x265825;});}return null;})['then'](respondWithStatusCode(_0x3eca44,null))[_0x825f('0x3d')](handleError(_0x3eca44,null));};exports[_0x825f('0x54')]=function(_0x4b537c,_0x4fdc48){var _0xe4a83c=_0x4b537c[_0x825f('0x55')]['id'];var _0x1b8455=_0x4b537c[_0x825f('0x44')];var _0x54782a=0xc8;var _0x332d25=null;return db[_0x825f('0x56')][_0x825f('0x57')]({'isolationLevel':db['sequelize'][_0x825f('0x58')][_0x825f('0x59')][_0x825f('0x5a')]},function(_0x245166){return db[_0x825f('0x29')][_0x825f('0x5b')]({'where':{'id':_0xe4a83c},'transaction':_0x245166})[_0x825f('0x15')](function(_0x12d444){if(_0x12d444){return db[_0x825f('0x29')][_0x825f('0x14')]({'where':{'VoiceExtensionId':_0xe4a83c},'transaction':_0x245166})['then'](function(){var _0x4087fb=_[_0x825f('0x1e')](_0x1b8455,function(_0x13dd1b){_0x13dd1b['VoiceExtensionId']=_0xe4a83c;_0x13dd1b[_0x825f('0x5c')]=!![];return _0x13dd1b;});return _0x12d444[_0x825f('0x5d')](_0x4087fb);})[_0x825f('0x15')](function(_0x4d56c7){return db[_0x825f('0x29')][_0x825f('0x5e')](_0x4d56c7,{'transaction':_0x245166});});}else{_0x54782a=0x194;_0x332d25=[];}});})[_0x825f('0x15')](function(){if(_0x54782a!==0x194){return db[_0x825f('0x29')][_0x825f('0x5f')]({'where':{'isApp':!![],'VoiceExtensionId':_0xe4a83c},'order':_0x825f('0x60')})[_0x825f('0x15')](function(_0xe5eca2){_0x332d25=_0xe5eca2;});}})['catch'](function(_0x17e3e6){_0x54782a=0x1f4;logger[_0x825f('0x25')](_0x17e3e6[_0x825f('0x26')]);if(_0x17e3e6[_0x825f('0x23')]){delete _0x17e3e6[_0x825f('0x23')];}_0x332d25=_0x17e3e6;})[_0x825f('0x61')](function(){if(_0x332d25===null){_0x4fdc48['sendStatus'](_0x54782a);}else{if(_0x54782a===0x1f4){_0x4fdc48[_0x825f('0xc')](_0x54782a)[_0x825f('0x27')](_0x332d25);}else{_0x4fdc48[_0x825f('0xc')](_0x54782a)[_0x825f('0xd')](_0x332d25);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index ee14f69..b535917 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 _0xa029=['VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2e80d5,_0x16512c){var _0xf3e966=function(_0x381704){while(--_0x381704){_0x2e80d5['push'](_0x2e80d5['shift']());}};_0xf3e966(++_0x16512c);}(_0xa029,0x130));var _0x9a02=function(_0x303775,_0x51539c){_0x303775=_0x303775-0x0;var _0x1c8a3f=_0xa029[_0x303775];return _0x1c8a3f;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x9a02('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9a02('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9a02('0x2'),'afterDestroy':_0x9a02('0x3')};function emitEvent(_0x3d7a2f){return function(_0x3c7ceb,_0xd9709b,_0x49ef61){VoiceExtensionEvents['emit'](_0x3d7a2f+':'+_0x3c7ceb['id'],_0x3c7ceb);VoiceExtensionEvents[_0x9a02('0x4')](_0x3d7a2f,_0x3c7ceb);_0x49ef61(null);};}for(var e in events){if(events[_0x9a02('0x5')](e)){var event=events[e];VoiceExtension[_0x9a02('0x6')](e,emitEvent(event));}}module[_0x9a02('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0xb768=['emit','hasOwnProperty','VoiceExtension','setMaxListeners','save','update','remove'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xb768,0x1c2));var _0x8b76=function(_0x50752a,_0x16d9ae){_0x50752a=_0x50752a-0x0;var _0x5460aa=_0xb768[_0x50752a];return _0x5460aa;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x8b76('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8b76('0x1')](0x0);var events={'afterCreate':_0x8b76('0x2'),'afterUpdate':_0x8b76('0x3'),'afterDestroy':_0x8b76('0x4')};function emitEvent(_0x4ce971){return function(_0x13e763,_0x3c18b4,_0x452f10){VoiceExtensionEvents['emit'](_0x4ce971+':'+_0x13e763['id'],_0x13e763);VoiceExtensionEvents[_0x8b76('0x5')](_0x4ce971,_0x13e763);_0x452f10(null);};}for(var e in events){if(events[_0x8b76('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index fd55a80..b7ff07f 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 _0x25d5=['CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','join','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','*,*,*,*','intervals','map','hasOwnProperty','tag','toLowerCase','CDR(tag)=','callerID','Set(CALLERID(all)=','answer','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','concat','define','voice_extensions','get','then','Hangup','last','lodash','exports','models','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','):Goto('];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x25d5,0x91));var _0x525d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x525d('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x525d('0x1')]=function(_0x5d7994){var _0xa822eb=_0x5d7994[_0x525d('0x2')];function _0x315f4e(_0x586cbf){var _0x189c28=0x2;var _0x29e86f=[{'type':_0x586cbf[_0x525d('0x3')],'app':_0x525d('0x4'),'appdata':'CDR(type)='+_0x586cbf[_0x525d('0x3')],'context':_0x586cbf[_0x525d('0x5')],'exten':_0x586cbf[_0x525d('0x6')],'priority':_0x189c28++,'VoiceExtensionId':_0x586cbf['id']},{'type':_0x586cbf[_0x525d('0x3')],'app':_0x586cbf[_0x525d('0x7')]?_0x525d('0x4'):_0x525d('0x8'),'appdata':_0x586cbf[_0x525d('0x7')]?_0x525d('0x9')+_0x586cbf['alias']:_0x525d('0xa'),'context':_0x586cbf['context'],'exten':_0x586cbf[_0x525d('0x6')],'priority':_0x189c28++,'VoiceExtensionId':_0x586cbf['id']}];if(_0x586cbf['type']==='inbound'){_0x29e86f['push']({'type':_0x525d('0xb'),'app':_0x525d('0x4'),'appdata':'CDR(routeid)='+_0x586cbf['id'],'context':_0x586cbf[_0x525d('0x5')],'exten':_0x586cbf[_0x525d('0x6')],'priority':_0x189c28++,'VoiceExtensionId':_0x586cbf['id']});}_0x29e86f[_0x525d('0xc')]({'type':_0x586cbf['type'],'app':_0x525d('0x4'),'appdata':_0x525d('0xd'),'context':_0x586cbf[_0x525d('0x5')],'exten':_0x586cbf[_0x525d('0x6')],'priority':_0x189c28++,'VoiceExtensionId':_0x586cbf['id']},{'type':_0x586cbf['type'],'app':_0x525d('0x4'),'appdata':_0x525d('0xe'),'context':_0x586cbf[_0x525d('0x5')],'exten':_0x586cbf[_0x525d('0x6')],'priority':_0x189c28++,'VoiceExtensionId':_0x586cbf['id']},{'type':_0x586cbf[_0x525d('0x3')],'app':_0x525d('0x4'),'appdata':_0x525d('0xf'),'context':_0x586cbf[_0x525d('0x5')],'exten':_0x586cbf['exten'],'priority':_0x189c28++,'VoiceExtensionId':_0x586cbf['id']});return _0x29e86f;}function _0x51dfca(_0x38750c){var _0x389565=0x2;var _0x121eab=[{'type':_0x525d('0x10'),'app':_0x525d('0x4'),'appdata':_0x525d('0x11'),'context':_0x38750c['context'],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':_0x525d('0x10'),'app':_0x38750c[_0x525d('0x7')]?_0x525d('0x4'):_0x525d('0x8'),'appdata':_0x38750c[_0x525d('0x7')]?'CDR(routeAlias)='+_0x38750c[_0x525d('0x7')]:'No\x20alias\x20set','context':_0x38750c['context'],'exten':_0x38750c['exten'],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':_0x525d('0x10'),'app':'Set','appdata':_0x525d('0x12')+(_0x38750c[_0x525d('0x13')]?_0x525d('0x14')+_0x38750c[_0x525d('0x13')]+'}':_0x525d('0x15')),'context':_0x38750c['context'],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':'outbound','app':'Set','appdata':_0x525d('0x16')+_0x38750c['id'],'context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c['exten'],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':'outbound','app':_0x525d('0x17'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x389565+0x2)+_0x525d('0x18')+(_0x389565+0x1)+')','context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':_0x525d('0x10'),'app':_0x525d('0x4'),'appdata':_0x38750c[_0x525d('0x13')]?_0x525d('0x19')+_0x38750c['cutdigits']+'}':_0x525d('0x1a'),'context':_0x38750c['context'],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':_0x525d('0x10'),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c['exten'],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':_0x525d('0x10'),'app':_0x525d('0x4'),'appdata':_0x525d('0xe'),'context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c['exten'],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':'outbound','app':_0x525d('0x4'),'appdata':_0x525d('0xf'),'context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':_0x525d('0x10'),'app':_0x525d('0x4'),'appdata':_0x525d('0x1b')+_0x38750c['id'],'context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']}];if(_0x38750c['hasOwnProperty'](_0x525d('0x1c'))&&_0x38750c['recordingFormat']!==_0x525d('0x1d')){_0x121eab['push']({'type':_0x525d('0x10'),'app':'Set','appdata':_0x525d('0x1e'),'context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':'outbound','app':'Set','appdata':_0x525d('0x1f')+_0x38750c[_0x525d('0x1c')]||_0x525d('0x20'),'context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']});}return _0x121eab;}function _0x218b6a(_0x4d5050,_0x21afd1){var _0x27762f=[{'name':_0x525d('0x21'),'param':0x0},{'name':_0x525d('0x22'),'param':0x1},{'name':_0x525d('0x23'),'param':0x2},{'name':_0x525d('0x24'),'param':0x3}];var _0x1a2dd8={};var _0x2522ab=_0x21afd1[_0x525d('0x25')](',');var _0x252d46=[];for(var _0x58377f=0x0;_0x58377f<_0x27762f[_0x525d('0x26')];_0x58377f++){switch(_0x27762f[_0x58377f][_0x525d('0x27')]){case _0x525d('0x21'):_0x1a2dd8[_0x525d('0x21')]=_0x2522ab[_0x27762f[_0x58377f][_0x525d('0x28')]][_0x525d('0x25')]('/')[0x1];_0x1a2dd8[_0x525d('0x29')]=_0x2522ab[_0x27762f[_0x58377f]['param']][_0x525d('0x25')]('/')[0x2];_0x1a2dd8[_0x525d('0x2a')]=_0x1a2dd8[_0x525d('0x29')]?_0x1a2dd8[_0x525d('0x29')][_0x525d('0x25')]('$')[0x0]:undefined;_0x1a2dd8[_0x525d('0x29')]=_0x4d5050[_0x525d('0x13')]?(_0x1a2dd8[_0x525d('0x2a')]||'')+_0x525d('0x14')+_0x4d5050[_0x525d('0x13')]+'}':(_0x1a2dd8[_0x525d('0x2a')]||'')+'${EXTEN}';_0x252d46[_0x27762f[_0x58377f][_0x525d('0x28')]]=[_0x525d('0x2b'),_0x1a2dd8['trunk'],_0x1a2dd8[_0x525d('0x29')]][_0x525d('0x2c')]('/');break;case _0x525d('0x23'):_0x1a2dd8[_0x525d('0x23')]=_0x2522ab[_0x27762f[_0x58377f]['param']];if(_0x4d5050['recordingFormat']!==_0x525d('0x1d')){if(_0x1a2dd8[_0x525d('0x23')]['indexOf'](_0x525d('0x2d'))<0x0){_0x1a2dd8[_0x525d('0x23')]+=_0x525d('0x2d');}}else{_0x1a2dd8[_0x525d('0x23')]=_0x1a2dd8['options'][_0x525d('0x2e')](_0x525d('0x2d'),'');}_0x252d46[_0x27762f[_0x58377f][_0x525d('0x28')]]=_0x1a2dd8['options'];break;default:_0x252d46[_0x27762f[_0x58377f]['param']]=_0x2522ab[_0x27762f[_0x58377f]['param']];}}return _0x252d46['join'](',');}function _0x3c7a2d(_0x3e6091,_0x27def6,_0x2c9550){return new Promise(function(_0x13e6a7,_0x317b3b){var _0x5bc4e2=[];if(_[_0x525d('0x2f')](_0x27def6))return _0x13e6a7(_0x5bc4e2);_0xa822eb[_0x525d('0x30')][_0x525d('0x31')]({'attributes':['id',_0x525d('0x32'),_0x525d('0x33')],'raw':!![]})['then'](function(_0x15c0c1){for(var _0x5cd85f=0x0,_0x458c94=0x0;_0x5cd85f<_0x27def6[_0x525d('0x26')];_0x5cd85f++,_0x458c94=0x0){var _0x3cf843=_0x27def6[_0x5cd85f];var _0x4c975f=[];var _0x3a006e=[];delete _0x3cf843['id'];if(_0x3cf843['interval']!==_0x525d('0x34')){_0x3cf843['intervals']=[_0x3cf843[_0x525d('0x32')]];}else{_0x3cf843[_0x525d('0x35')]=_0x3cf843[_0x525d('0x33')]?_[_0x525d('0x36')](_['filter'](_0x15c0c1,{'IntervalId':_0x3cf843['IntervalId']}),'interval'):[];}_0x3cf843[_0x525d('0x5')]=_0x3e6091[_0x525d('0x5')];_0x3cf843[_0x525d('0x6')]=_0x3e6091[_0x525d('0x6')];if(_0x3cf843[_0x525d('0x3')])_0x3cf843[_0x525d('0x3')]=_0x3cf843[_0x525d('0x3')]['toLowerCase']();if(_0x3e6091['type']===_0x525d('0x10')){if(_0x3cf843[_0x525d('0x37')]('tag')&&_0x3cf843['tag']&&_0x3cf843[_0x525d('0x38')]!=='--'){_0x4c975f['push']({'type':_0x3cf843['type'][_0x525d('0x39')](),'app':_0x525d('0x4'),'appdata':_0x525d('0x3a')+_0x3cf843[_0x525d('0x38')],'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091[_0x525d('0x6')],'priority':_0x3cf843[_0x525d('0x35')][_0x525d('0x26')]+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});}_0x4c975f['push']({'type':_0x3cf843[_0x525d('0x3')][_0x525d('0x39')](),'app':_0x525d('0x17'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x3cf843[_0x525d('0x3b')]?_0x525d('0x3c')+_0x3cf843[_0x525d('0x3b')]+')':'NoOp(No\x20number\x20available)'),'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091['exten'],'priority':_0x3cf843[_0x525d('0x35')][_0x525d('0x26')]+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});}else{if(_0x3cf843[_0x525d('0x37')](_0x525d('0x3d'))){if(['queue',_0x525d('0x3e')][_0x525d('0x3f')](_0x3cf843[_0x525d('0x40')][_0x525d('0x39')]())&&_0x3cf843['appType']!==_0x525d('0x41')){if(_0x3cf843[_0x525d('0x3d')]){_0x4c975f[_0x525d('0xc')]({'type':_0x3cf843[_0x525d('0x3')][_0x525d('0x39')](),'app':_0x525d('0x17'),'appdata':_0x525d('0x42'),'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091['exten'],'priority':_0x3cf843[_0x525d('0x35')][_0x525d('0x26')]+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});_0x4c975f['push']({'type':_0x3cf843['type'][_0x525d('0x39')](),'app':'Set','appdata':_0x525d('0x43'),'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091[_0x525d('0x6')],'priority':_0x3cf843['intervals']['length']+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});}else{_0x4c975f[_0x525d('0xc')]({'type':_0x3cf843['type'][_0x525d('0x39')](),'app':_0x525d('0x17'),'appdata':_0x525d('0x44'),'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091[_0x525d('0x6')],'priority':_0x3cf843['intervals'][_0x525d('0x26')]+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});_0x4c975f[_0x525d('0xc')]({'type':_0x3cf843[_0x525d('0x3')][_0x525d('0x39')](),'app':'Set','appdata':_0x525d('0x45'),'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091[_0x525d('0x6')],'priority':_0x3cf843['intervals'][_0x525d('0x26')]+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});}}}}for(var _0x51ef08=0x0;_0x51ef08<_0x3cf843[_0x525d('0x35')][_0x525d('0x26')];_0x51ef08++){var _0x3dde2c=_0x2c9550+_0x3cf843[_0x525d('0x35')][_0x525d('0x26')];var _0x31b525=_0x51ef08===_0x3cf843[_0x525d('0x35')]['length']-0x1?_0x2c9550+_0x4c975f[_0x525d('0x26')]+_0x3a006e[_0x525d('0x26')]+0x2:_0x2c9550+_0x51ef08+0x1;_0x4c975f[_0x525d('0x46')](_0x51ef08,0x0,{'type':_0x3e6091['type'],'app':_0x525d('0x47'),'appdata':_0x3cf843[_0x525d('0x35')][_0x51ef08]+'?'+_0x3e6091[_0x525d('0x5')]+',${EXTEN},'+_0x3dde2c+':'+_0x3e6091['context']+_0x525d('0x48')+_0x31b525,'exten':_0x3e6091[_0x525d('0x6')],'context':_0x3e6091[_0x525d('0x5')],'priority':_0x2c9550+_0x51ef08,'VoiceExtensionId':_0x3e6091['id']});}if(_0x3cf843[_0x525d('0x49')]==='outboundDial'){_0x3cf843[_0x525d('0x4a')]=_0x218b6a(_0x3e6091,_0x3cf843['appdata']);}if(_0x3cf843[_0x525d('0x49')]===_0x525d('0x4b')){_0x4c975f['push']({'type':_0x3cf843[_0x525d('0x3')][_0x525d('0x39')](),'app':_0x525d('0x4'),'appdata':_0x525d('0x4c'),'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091[_0x525d('0x6')],'priority':_0x3cf843[_0x525d('0x35')][_0x525d('0x26')]+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});}_0x3cf843['priority']=_0x4c975f['length']?_['last'](_0x4c975f)[_0x525d('0x4d')]+0x1:_0x2c9550;_0x5bc4e2=_[_0x525d('0x4e')](_0x5bc4e2,_0x4c975f,[_0x3cf843],_0x3a006e);_0x2c9550=_['last'](_0x5bc4e2)[_0x525d('0x4d')]+0x1;}return _0x13e6a7(_0x5bc4e2);})['catch'](function(_0x98c1ef){_0x317b3b(_0x98c1ef);});});}return _0x5d7994[_0x525d('0x4f')]('VoiceExtension',attributes,{'tableName':_0x525d('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x387663){var _0x5a864f=this[_0x525d('0x51')]({'plain':!![]});var _0x492210=_0x5a864f[_0x525d('0x3')]===_0x525d('0x10')?_0x51dfca(_0x5a864f):_0x315f4e(_0x5a864f);return _0x3c7a2d(_0x5a864f,_0x387663,_['last'](_0x492210)[_0x525d('0x4d')]+0x1)[_0x525d('0x52')](function(_0xe75317){var _0x53295d=_['concat'](_0x492210,_0xe75317);_0x53295d[_0x525d('0xc')]({'type':_0x5a864f[_0x525d('0x3')],'app':_0x525d('0x53'),'exten':_0x5a864f[_0x525d('0x6')],'context':_0x5a864f[_0x525d('0x5')],'priority':_[_0x525d('0x54')](_0x53295d)[_0x525d('0x4d')]+0x1,'VoiceExtensionId':_0x5a864f['id']});return _0x53295d;});}}});}; \ No newline at end of file +var _0xc180=['$[${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=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','catch','define','VoiceExtension','voice_extensions','get','then','Hangup','lodash','./voiceExtension.attributes','exports','models','type','CDR(type)=','context','exten','alias','Set','NoOp','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','name','param','phone','prefix','${EXTEN}','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','IntervalId','length','*,*,*,*','intervals','map','filter','toLowerCase','CDR(tag)=','tag'];(function(_0x435a63,_0x2672e0){var _0x3f1b85=function(_0x500689){while(--_0x500689){_0x435a63['push'](_0x435a63['shift']());}};_0x3f1b85(++_0x2672e0);}(_0xc180,0x185));var _0x0c18=function(_0x22b643,_0x43ff1a){_0x22b643=_0x22b643-0x0;var _0x2d518a=_0xc180[_0x22b643];return _0x2d518a;};'use strict';var _=require(_0x0c18('0x0'));var attributes=require(_0x0c18('0x1'));module[_0x0c18('0x2')]=function(_0x5764a7){var _0x585e63=_0x5764a7[_0x0c18('0x3')];function _0x51de07(_0x4549a2){var _0x1428f2=0x2;var _0xca65b4=[{'type':_0x4549a2[_0x0c18('0x4')],'app':'Set','appdata':_0x0c18('0x5')+_0x4549a2[_0x0c18('0x4')],'context':_0x4549a2[_0x0c18('0x6')],'exten':_0x4549a2[_0x0c18('0x7')],'priority':_0x1428f2++,'VoiceExtensionId':_0x4549a2['id']},{'type':_0x4549a2[_0x0c18('0x4')],'app':_0x4549a2[_0x0c18('0x8')]?_0x0c18('0x9'):_0x0c18('0xa'),'appdata':_0x4549a2['alias']?'CDR(routeAlias)='+_0x4549a2[_0x0c18('0x8')]:_0x0c18('0xb'),'context':_0x4549a2[_0x0c18('0x6')],'exten':_0x4549a2['exten'],'priority':_0x1428f2++,'VoiceExtensionId':_0x4549a2['id']}];if(_0x4549a2[_0x0c18('0x4')]===_0x0c18('0xc')){_0xca65b4[_0x0c18('0xd')]({'type':_0x0c18('0xc'),'app':_0x0c18('0x9'),'appdata':_0x0c18('0xe')+_0x4549a2['id'],'context':_0x4549a2[_0x0c18('0x6')],'exten':_0x4549a2[_0x0c18('0x7')],'priority':_0x1428f2++,'VoiceExtensionId':_0x4549a2['id']});}_0xca65b4[_0x0c18('0xd')]({'type':_0x4549a2[_0x0c18('0x4')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4549a2[_0x0c18('0x6')],'exten':_0x4549a2[_0x0c18('0x7')],'priority':_0x1428f2++,'VoiceExtensionId':_0x4549a2['id']},{'type':_0x4549a2['type'],'app':'Set','appdata':_0x0c18('0xf'),'context':_0x4549a2[_0x0c18('0x6')],'exten':_0x4549a2[_0x0c18('0x7')],'priority':_0x1428f2++,'VoiceExtensionId':_0x4549a2['id']},{'type':_0x4549a2[_0x0c18('0x4')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x4549a2[_0x0c18('0x6')],'exten':_0x4549a2[_0x0c18('0x7')],'priority':_0x1428f2++,'VoiceExtensionId':_0x4549a2['id']});return _0xca65b4;}function _0xb983f6(_0x3aef94){var _0x4cab0e=0x2;var _0x1cfcea=[{'type':_0x0c18('0x10'),'app':_0x0c18('0x9'),'appdata':_0x0c18('0x11'),'context':_0x3aef94[_0x0c18('0x6')],'exten':_0x3aef94[_0x0c18('0x7')],'priority':_0x4cab0e++,'VoiceExtensionId':_0x3aef94['id']},{'type':'outbound','app':_0x3aef94[_0x0c18('0x8')]?_0x0c18('0x9'):'NoOp','appdata':_0x3aef94[_0x0c18('0x8')]?_0x0c18('0x12')+_0x3aef94[_0x0c18('0x8')]:'No\x20alias\x20set','context':_0x3aef94['context'],'exten':_0x3aef94['exten'],'priority':_0x4cab0e++,'VoiceExtensionId':_0x3aef94['id']},{'type':_0x0c18('0x10'),'app':_0x0c18('0x9'),'appdata':_0x0c18('0x13')+(_0x3aef94[_0x0c18('0x14')]?_0x0c18('0x15')+_0x3aef94[_0x0c18('0x14')]+'}':'${EXTEN}'),'context':_0x3aef94['context'],'exten':_0x3aef94[_0x0c18('0x7')],'priority':_0x4cab0e++,'VoiceExtensionId':_0x3aef94['id']},{'type':_0x0c18('0x10'),'app':'Set','appdata':'CDR(routeid)='+_0x3aef94['id'],'context':_0x3aef94['context'],'exten':_0x3aef94[_0x0c18('0x7')],'priority':_0x4cab0e++,'VoiceExtensionId':_0x3aef94['id']},{'type':_0x0c18('0x10'),'app':_0x0c18('0x16'),'appdata':_0x0c18('0x17')+(_0x4cab0e+0x2)+_0x0c18('0x18')+(_0x4cab0e+0x1)+')','context':_0x3aef94[_0x0c18('0x6')],'exten':_0x3aef94[_0x0c18('0x7')],'priority':_0x4cab0e++,'VoiceExtensionId':_0x3aef94['id']},{'type':'outbound','app':_0x0c18('0x9'),'appdata':_0x3aef94[_0x0c18('0x14')]?'CDR(prefix)=${EXTEN:0:'+_0x3aef94['cutdigits']+'}':_0x0c18('0x19'),'context':_0x3aef94[_0x0c18('0x6')],'exten':_0x3aef94[_0x0c18('0x7')],'priority':_0x4cab0e++,'VoiceExtensionId':_0x3aef94['id']},{'type':'outbound','app':_0x0c18('0x9'),'appdata':_0x0c18('0x1a'),'context':_0x3aef94[_0x0c18('0x6')],'exten':_0x3aef94[_0x0c18('0x7')],'priority':_0x4cab0e++,'VoiceExtensionId':_0x3aef94['id']},{'type':_0x0c18('0x10'),'app':_0x0c18('0x9'),'appdata':_0x0c18('0xf'),'context':_0x3aef94[_0x0c18('0x6')],'exten':_0x3aef94[_0x0c18('0x7')],'priority':_0x4cab0e++,'VoiceExtensionId':_0x3aef94['id']},{'type':_0x0c18('0x10'),'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x3aef94[_0x0c18('0x6')],'exten':_0x3aef94[_0x0c18('0x7')],'priority':_0x4cab0e++,'VoiceExtensionId':_0x3aef94['id']},{'type':_0x0c18('0x10'),'app':'Set','appdata':_0x0c18('0x1b')+_0x3aef94['id'],'context':_0x3aef94[_0x0c18('0x6')],'exten':_0x3aef94['exten'],'priority':_0x4cab0e++,'VoiceExtensionId':_0x3aef94['id']}];if(_0x3aef94[_0x0c18('0x1c')](_0x0c18('0x1d'))&&_0x3aef94[_0x0c18('0x1d')]!==_0x0c18('0x1e')){_0x1cfcea[_0x0c18('0xd')]({'type':_0x0c18('0x10'),'app':'Set','appdata':_0x0c18('0x1f'),'context':_0x3aef94[_0x0c18('0x6')],'exten':_0x3aef94[_0x0c18('0x7')],'priority':_0x4cab0e++,'VoiceExtensionId':_0x3aef94['id']},{'type':'outbound','app':'Set','appdata':_0x0c18('0x20')+_0x3aef94[_0x0c18('0x1d')]||_0x0c18('0x21'),'context':_0x3aef94[_0x0c18('0x6')],'exten':_0x3aef94[_0x0c18('0x7')],'priority':_0x4cab0e++,'VoiceExtensionId':_0x3aef94['id']});}return _0x1cfcea;}function _0x15d77c(_0x47b1fd,_0x393abc){var _0x22387c=[{'name':_0x0c18('0x22'),'param':0x0},{'name':_0x0c18('0x23'),'param':0x1},{'name':_0x0c18('0x24'),'param':0x2},{'name':_0x0c18('0x25'),'param':0x3}];var _0x13dbb6={};var _0x1638bd=_0x393abc[_0x0c18('0x26')](',');var _0x46daa4=[];for(var _0xd79c96=0x0;_0xd79c96<_0x22387c['length'];_0xd79c96++){switch(_0x22387c[_0xd79c96][_0x0c18('0x27')]){case _0x0c18('0x22'):_0x13dbb6['trunk']=_0x1638bd[_0x22387c[_0xd79c96][_0x0c18('0x28')]][_0x0c18('0x26')]('/')[0x1];_0x13dbb6[_0x0c18('0x29')]=_0x1638bd[_0x22387c[_0xd79c96]['param']][_0x0c18('0x26')]('/')[0x2];_0x13dbb6[_0x0c18('0x2a')]=_0x13dbb6[_0x0c18('0x29')]?_0x13dbb6[_0x0c18('0x29')][_0x0c18('0x26')]('$')[0x0]:undefined;_0x13dbb6[_0x0c18('0x29')]=_0x47b1fd[_0x0c18('0x14')]?(_0x13dbb6['prefix']||'')+_0x0c18('0x15')+_0x47b1fd[_0x0c18('0x14')]+'}':(_0x13dbb6[_0x0c18('0x2a')]||'')+_0x0c18('0x2b');_0x46daa4[_0x22387c[_0xd79c96][_0x0c18('0x28')]]=[_0x0c18('0x2c'),_0x13dbb6['trunk'],_0x13dbb6[_0x0c18('0x29')]][_0x0c18('0x2d')]('/');break;case'options':_0x13dbb6['options']=_0x1638bd[_0x22387c[_0xd79c96][_0x0c18('0x28')]];if(_0x47b1fd[_0x0c18('0x1d')]!==_0x0c18('0x1e')){if(_0x13dbb6['options'][_0x0c18('0x2e')](_0x0c18('0x2f'))<0x0){_0x13dbb6[_0x0c18('0x24')]+='U(xcally-mixmonitor-context)';}}else{_0x13dbb6['options']=_0x13dbb6[_0x0c18('0x24')][_0x0c18('0x30')](_0x0c18('0x2f'),'');}_0x46daa4[_0x22387c[_0xd79c96]['param']]=_0x13dbb6[_0x0c18('0x24')];break;default:_0x46daa4[_0x22387c[_0xd79c96][_0x0c18('0x28')]]=_0x1638bd[_0x22387c[_0xd79c96][_0x0c18('0x28')]];}}return _0x46daa4[_0x0c18('0x2d')](',');}function _0x570f63(_0x59f9ea,_0x40be9a,_0x3ce9c1){return new Promise(function(_0xe77e86,_0xd26d48){var _0x204d00=[];if(_[_0x0c18('0x31')](_0x40be9a))return _0xe77e86(_0x204d00);_0x585e63['Interval'][_0x0c18('0x32')]({'attributes':['id',_0x0c18('0x33'),_0x0c18('0x34')],'raw':!![]})['then'](function(_0x19bce5){for(var _0x55a55f=0x0,_0x531d17=0x0;_0x55a55f<_0x40be9a[_0x0c18('0x35')];_0x55a55f++,_0x531d17=0x0){var _0x36d01c=_0x40be9a[_0x55a55f];var _0x2ada67=[];var _0x491a23=[];delete _0x36d01c['id'];if(_0x36d01c[_0x0c18('0x33')]!==_0x0c18('0x36')){_0x36d01c[_0x0c18('0x37')]=[_0x36d01c[_0x0c18('0x33')]];}else{_0x36d01c['intervals']=_0x36d01c[_0x0c18('0x34')]?_[_0x0c18('0x38')](_[_0x0c18('0x39')](_0x19bce5,{'IntervalId':_0x36d01c[_0x0c18('0x34')]}),_0x0c18('0x33')):[];}_0x36d01c[_0x0c18('0x6')]=_0x59f9ea[_0x0c18('0x6')];_0x36d01c[_0x0c18('0x7')]=_0x59f9ea['exten'];if(_0x36d01c[_0x0c18('0x4')])_0x36d01c[_0x0c18('0x4')]=_0x36d01c['type'][_0x0c18('0x3a')]();if(_0x59f9ea[_0x0c18('0x4')]===_0x0c18('0x10')){if(_0x36d01c[_0x0c18('0x1c')]('tag')&&_0x36d01c['tag']&&_0x36d01c['tag']!=='--'){_0x2ada67[_0x0c18('0xd')]({'type':_0x36d01c[_0x0c18('0x4')][_0x0c18('0x3a')](),'app':_0x0c18('0x9'),'appdata':_0x0c18('0x3b')+_0x36d01c[_0x0c18('0x3c')],'context':_0x59f9ea[_0x0c18('0x6')],'exten':_0x59f9ea[_0x0c18('0x7')],'priority':_0x36d01c['intervals'][_0x0c18('0x35')]+_0x3ce9c1+_0x531d17++,'VoiceExtensionId':_0x59f9ea['id']});}_0x2ada67['push']({'type':_0x36d01c[_0x0c18('0x4')]['toLowerCase'](),'app':_0x0c18('0x16'),'appdata':_0x0c18('0x3d')+(_0x36d01c['callerID']?_0x0c18('0x3e')+_0x36d01c[_0x0c18('0x3f')]+')':_0x0c18('0x40')),'context':_0x59f9ea[_0x0c18('0x6')],'exten':_0x59f9ea['exten'],'priority':_0x36d01c[_0x0c18('0x37')]['length']+_0x3ce9c1+_0x531d17++,'VoiceExtensionId':_0x59f9ea['id']});}else{if(_0x36d01c[_0x0c18('0x1c')](_0x0c18('0x41'))){if([_0x0c18('0x42'),_0x0c18('0x43')][_0x0c18('0x44')](_0x36d01c[_0x0c18('0x45')]['toLowerCase']())&&_0x36d01c[_0x0c18('0x46')]!==_0x0c18('0x47')){if(_0x36d01c[_0x0c18('0x41')]){_0x2ada67[_0x0c18('0xd')]({'type':_0x36d01c[_0x0c18('0x4')]['toLowerCase'](),'app':_0x0c18('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x59f9ea[_0x0c18('0x6')],'exten':_0x59f9ea[_0x0c18('0x7')],'priority':_0x36d01c[_0x0c18('0x37')][_0x0c18('0x35')]+_0x3ce9c1+_0x531d17++,'VoiceExtensionId':_0x59f9ea['id']});_0x2ada67[_0x0c18('0xd')]({'type':_0x36d01c['type']['toLowerCase'](),'app':_0x0c18('0x9'),'appdata':_0x0c18('0x48'),'context':_0x59f9ea[_0x0c18('0x6')],'exten':_0x59f9ea[_0x0c18('0x7')],'priority':_0x36d01c[_0x0c18('0x37')]['length']+_0x3ce9c1+_0x531d17++,'VoiceExtensionId':_0x59f9ea['id']});}else{_0x2ada67[_0x0c18('0xd')]({'type':_0x36d01c['type'][_0x0c18('0x3a')](),'app':_0x0c18('0x16'),'appdata':_0x0c18('0x49'),'context':_0x59f9ea['context'],'exten':_0x59f9ea['exten'],'priority':_0x36d01c[_0x0c18('0x37')][_0x0c18('0x35')]+_0x3ce9c1+_0x531d17++,'VoiceExtensionId':_0x59f9ea['id']});_0x2ada67[_0x0c18('0xd')]({'type':_0x36d01c[_0x0c18('0x4')]['toLowerCase'](),'app':_0x0c18('0x9'),'appdata':_0x0c18('0x4a'),'context':_0x59f9ea[_0x0c18('0x6')],'exten':_0x59f9ea[_0x0c18('0x7')],'priority':_0x36d01c[_0x0c18('0x37')]['length']+_0x3ce9c1+_0x531d17++,'VoiceExtensionId':_0x59f9ea['id']});}}}}for(var _0x433a53=0x0;_0x433a53<_0x36d01c[_0x0c18('0x37')]['length'];_0x433a53++){var _0x3c712a=_0x3ce9c1+_0x36d01c[_0x0c18('0x37')]['length'];var _0x26f0fc=_0x433a53===_0x36d01c['intervals'][_0x0c18('0x35')]-0x1?_0x3ce9c1+_0x2ada67[_0x0c18('0x35')]+_0x491a23[_0x0c18('0x35')]+0x2:_0x3ce9c1+_0x433a53+0x1;_0x2ada67[_0x0c18('0x4b')](_0x433a53,0x0,{'type':_0x59f9ea[_0x0c18('0x4')],'app':_0x0c18('0x4c'),'appdata':_0x36d01c[_0x0c18('0x37')][_0x433a53]+'?'+_0x59f9ea['context']+_0x0c18('0x4d')+_0x3c712a+':'+_0x59f9ea[_0x0c18('0x6')]+_0x0c18('0x4d')+_0x26f0fc,'exten':_0x59f9ea[_0x0c18('0x7')],'context':_0x59f9ea['context'],'priority':_0x3ce9c1+_0x433a53,'VoiceExtensionId':_0x59f9ea['id']});}if(_0x36d01c['appType']==='outboundDial'){_0x36d01c['appdata']=_0x15d77c(_0x59f9ea,_0x36d01c[_0x0c18('0x4e')]);}if(_0x36d01c[_0x0c18('0x46')]===_0x0c18('0x4f')){_0x2ada67['push']({'type':_0x36d01c['type'][_0x0c18('0x3a')](),'app':_0x0c18('0x9'),'appdata':_0x0c18('0x50'),'context':_0x59f9ea[_0x0c18('0x6')],'exten':_0x59f9ea[_0x0c18('0x7')],'priority':_0x36d01c[_0x0c18('0x37')]['length']+_0x3ce9c1+_0x531d17++,'VoiceExtensionId':_0x59f9ea['id']});}_0x36d01c[_0x0c18('0x51')]=_0x2ada67[_0x0c18('0x35')]?_[_0x0c18('0x52')](_0x2ada67)[_0x0c18('0x51')]+0x1:_0x3ce9c1;_0x204d00=_['concat'](_0x204d00,_0x2ada67,[_0x36d01c],_0x491a23);_0x3ce9c1=_['last'](_0x204d00)[_0x0c18('0x51')]+0x1;}return _0xe77e86(_0x204d00);})[_0x0c18('0x53')](function(_0x45af5a){_0xd26d48(_0x45af5a);});});}return _0x5764a7[_0x0c18('0x54')](_0x0c18('0x55'),attributes,{'tableName':_0x0c18('0x56'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x292403){var _0x488d7f=this[_0x0c18('0x57')]({'plain':!![]});var _0x44f454=_0x488d7f[_0x0c18('0x4')]==='outbound'?_0xb983f6(_0x488d7f):_0x51de07(_0x488d7f);return _0x570f63(_0x488d7f,_0x292403,_[_0x0c18('0x52')](_0x44f454)['priority']+0x1)[_0x0c18('0x58')](function(_0x3037eb){var _0x51bf58=_['concat'](_0x44f454,_0x3037eb);_0x51bf58['push']({'type':_0x488d7f['type'],'app':_0x0c18('0x59'),'exten':_0x488d7f['exten'],'context':_0x488d7f[_0x0c18('0x6')],'priority':_[_0x0c18('0x52')](_0x51bf58)[_0x0c18('0x51')]+0x1,'VoiceExtensionId':_0x488d7f['id']});return _0x51bf58;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 52b200b..e619b2d 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 _0xae30=['localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','request\x20sent','result','catch','findAll','options','where','limit','include','map','model','attributes','GetVoiceExtension','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xae30,0x10a));var _0x0ae3=function(_0x151ecd,_0x18ecb1){_0x151ecd=_0x151ecd-0x0;var _0x4c2325=_0xae30[_0x151ecd];return _0x4c2325;};'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});config[_0x0ae3('0xc')]=_[_0x0ae3('0xd')](config[_0x0ae3('0xc')],{'host':_0x0ae3('0xe'),'port':0x18eb});var socket=require(_0x0ae3('0xf'))(new Redis(config[_0x0ae3('0xc')]));require(_0x0ae3('0x10'))[_0x0ae3('0x11')](socket);function respondWithRpcPromise(_0x49e0a5,_0x98ab46,_0xee8a4c){return new BPromise(function(_0x5b70dd,_0x4a012d){return client[_0x0ae3('0x12')](_0x49e0a5,_0xee8a4c)[_0x0ae3('0x13')](function(_0xeca9e6){logger[_0x0ae3('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x98ab46,'request\x20sent');logger[_0x0ae3('0x15')](_0x0ae3('0x16'),_0x98ab46,'request\x20sent',JSON['stringify'](_0xeca9e6));if(_0xeca9e6[_0x0ae3('0x17')]){if(_0xeca9e6['error'][_0x0ae3('0x18')]===0x1f4){logger[_0x0ae3('0x17')](_0x0ae3('0x19'),_0x98ab46,_0xeca9e6[_0x0ae3('0x17')][_0x0ae3('0x1a')]);return _0x4a012d(_0xeca9e6[_0x0ae3('0x17')][_0x0ae3('0x1a')]);}logger['error'](_0x0ae3('0x19'),_0x98ab46,_0xeca9e6['error'][_0x0ae3('0x1a')]);return _0x5b70dd(_0xeca9e6[_0x0ae3('0x17')][_0x0ae3('0x1a')]);}else{logger[_0x0ae3('0x14')](_0x0ae3('0x19'),_0x98ab46,_0x0ae3('0x1b'));_0x5b70dd(_0xeca9e6[_0x0ae3('0x1c')][_0x0ae3('0x1a')]);}})[_0x0ae3('0x1d')](function(_0x5f15eb){logger[_0x0ae3('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x98ab46,_0x5f15eb);_0x4a012d(_0x5f15eb);});});}exports['GetVoiceExtension']=function(_0x571135){var _0x4ac074=this;return new Promise(function(_0x54ff97,_0x4e8135){return db['VoiceExtension'][_0x0ae3('0x1e')]({'raw':_0x571135[_0x0ae3('0x1f')]?_0x571135[_0x0ae3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x571135[_0x0ae3('0x1f')]?_0x571135['options'][_0x0ae3('0x20')]||null:null,'attributes':_0x571135['options']?_0x571135['options']['attributes']||null:null,'limit':_0x571135[_0x0ae3('0x1f')]?_0x571135[_0x0ae3('0x1f')][_0x0ae3('0x21')]||null:null,'include':_0x571135['options']?_0x571135['options'][_0x0ae3('0x22')]?_[_0x0ae3('0x23')](_0x571135['options'][_0x0ae3('0x22')],function(_0x1613c3){return{'model':db[_0x1613c3[_0x0ae3('0x24')]],'as':_0x1613c3['as'],'attributes':_0x1613c3['attributes'],'include':_0x1613c3[_0x0ae3('0x22')]?_[_0x0ae3('0x23')](_0x1613c3[_0x0ae3('0x22')],function(_0x5303f6){return{'model':db[_0x5303f6[_0x0ae3('0x24')]],'as':_0x5303f6['as'],'attributes':_0x5303f6[_0x0ae3('0x25')],'include':_0x5303f6[_0x0ae3('0x22')]?_['map'](_0x5303f6[_0x0ae3('0x22')],function(_0x247623){return{'model':db[_0x247623[_0x0ae3('0x24')]],'as':_0x247623['as'],'attributes':_0x247623[_0x0ae3('0x25')]};}):[]};}):[]};}):[]:[]})[_0x0ae3('0x13')](function(_0x10a7bd){logger[_0x0ae3('0x14')](_0x0ae3('0x26'),_0x571135);logger[_0x0ae3('0x15')](_0x0ae3('0x26'),_0x571135,JSON[_0x0ae3('0x27')](_0x10a7bd));_0x54ff97(_0x10a7bd);})[_0x0ae3('0x1d')](function(_0x23f213){logger[_0x0ae3('0x17')](_0x0ae3('0x26'),_0x23f213['message'],_0x571135);_0x4e8135(_0x4ac074[_0x0ae3('0x17')](0x1f4,_0x23f213[_0x0ae3('0x1a')]));});});}; \ No newline at end of file +var _0x9f5a=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','lodash'];(function(_0x496615,_0x41a618){var _0x222aa2=function(_0x449c76){while(--_0x449c76){_0x496615['push'](_0x496615['shift']());}};_0x222aa2(++_0x41a618);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x481f64,_0x5b3f61){_0x481f64=_0x481f64-0x0;var _0x1e63b5=_0x9f5a[_0x481f64];return _0x1e63b5;};'use strict';var _=require(_0xa9f5('0x0'));var util=require(_0xa9f5('0x1'));var moment=require(_0xa9f5('0x2'));var BPromise=require(_0xa9f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9f5('0x4'));var db=require(_0xa9f5('0x5'))['db'];var utils=require(_0xa9f5('0x6'));var logger=require('../../config/logger')(_0xa9f5('0x7'));var config=require('../../config/environment');var jayson=require(_0xa9f5('0x8'));var client=jayson[_0xa9f5('0x9')]['http']({'port':0x232a});config[_0xa9f5('0xa')]=_[_0xa9f5('0xb')](config[_0xa9f5('0xa')],{'host':_0xa9f5('0xc'),'port':0x18eb});var socket=require(_0xa9f5('0xd'))(new Redis(config[_0xa9f5('0xa')]));require(_0xa9f5('0xe'))['register'](socket);function respondWithRpcPromise(_0x2e0ff8,_0x2ec4a7,_0x4bb362){return new BPromise(function(_0x194d0d,_0x1f6e40){return client['request'](_0x2e0ff8,_0x4bb362)['then'](function(_0x418ba3){logger[_0xa9f5('0xf')](_0xa9f5('0x10'),_0x2ec4a7,_0xa9f5('0x11'));logger['debug'](_0xa9f5('0x12'),_0x2ec4a7,_0xa9f5('0x11'),JSON[_0xa9f5('0x13')](_0x418ba3));if(_0x418ba3['error']){if(_0x418ba3[_0xa9f5('0x14')][_0xa9f5('0x15')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x2ec4a7,_0x418ba3['error'][_0xa9f5('0x16')]);return _0x1f6e40(_0x418ba3['error']['message']);}logger[_0xa9f5('0x14')](_0xa9f5('0x10'),_0x2ec4a7,_0x418ba3[_0xa9f5('0x14')][_0xa9f5('0x16')]);return _0x194d0d(_0x418ba3['error'][_0xa9f5('0x16')]);}else{logger[_0xa9f5('0xf')](_0xa9f5('0x10'),_0x2ec4a7,_0xa9f5('0x11'));_0x194d0d(_0x418ba3[_0xa9f5('0x17')][_0xa9f5('0x16')]);}})[_0xa9f5('0x18')](function(_0x430acb){logger[_0xa9f5('0x14')](_0xa9f5('0x10'),_0x2ec4a7,_0x430acb);_0x1f6e40(_0x430acb);});});}exports[_0xa9f5('0x19')]=function(_0x27a7b0){var _0x4e0c93=this;return new Promise(function(_0x2fb5a3,_0x131f21){return db[_0xa9f5('0x1a')][_0xa9f5('0x1b')]({'raw':_0x27a7b0[_0xa9f5('0x1c')]?_0x27a7b0[_0xa9f5('0x1c')][_0xa9f5('0x1d')]===undefined?!![]:![]:!![],'where':_0x27a7b0['options']?_0x27a7b0[_0xa9f5('0x1c')][_0xa9f5('0x1e')]||null:null,'attributes':_0x27a7b0[_0xa9f5('0x1c')]?_0x27a7b0[_0xa9f5('0x1c')][_0xa9f5('0x1f')]||null:null,'limit':_0x27a7b0[_0xa9f5('0x1c')]?_0x27a7b0[_0xa9f5('0x1c')][_0xa9f5('0x20')]||null:null,'include':_0x27a7b0['options']?_0x27a7b0[_0xa9f5('0x1c')][_0xa9f5('0x21')]?_[_0xa9f5('0x22')](_0x27a7b0[_0xa9f5('0x1c')][_0xa9f5('0x21')],function(_0x31b517){return{'model':db[_0x31b517['model']],'as':_0x31b517['as'],'attributes':_0x31b517[_0xa9f5('0x1f')],'include':_0x31b517['include']?_['map'](_0x31b517['include'],function(_0x3449b6){return{'model':db[_0x3449b6[_0xa9f5('0x23')]],'as':_0x3449b6['as'],'attributes':_0x3449b6[_0xa9f5('0x1f')],'include':_0x3449b6[_0xa9f5('0x21')]?_[_0xa9f5('0x22')](_0x3449b6[_0xa9f5('0x21')],function(_0x51741f){return{'model':db[_0x51741f[_0xa9f5('0x23')]],'as':_0x51741f['as'],'attributes':_0x51741f[_0xa9f5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa9f5('0x24')](function(_0x5faf64){logger[_0xa9f5('0xf')](_0xa9f5('0x19'),_0x27a7b0);logger[_0xa9f5('0x25')](_0xa9f5('0x19'),_0x27a7b0,JSON['stringify'](_0x5faf64));_0x2fb5a3(_0x5faf64);})['catch'](function(_0x4a4386){logger[_0xa9f5('0x14')](_0xa9f5('0x19'),_0x4a4386[_0xa9f5('0x16')],_0x27a7b0);_0x131f21(_0x4e0c93[_0xa9f5('0x14')](0x1f4,_0x4a4386[_0xa9f5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 1b581ce..cc46393 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 _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x3cf175,_0x39ab6f){var _0x52a067=function(_0x27a4ee){while(--_0x27a4ee){_0x3cf175['push'](_0x3cf175['shift']());}};_0x52a067(++_0x39ab6f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file +var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x5f317c,_0x29b8eb){var _0x5e5e9f=function(_0x284ac8){while(--_0x284ac8){_0x5f317c['push'](_0x5f317c['shift']());}};_0x5e5e9f(++_0x29b8eb);}(_0x326f,0xd1));var _0xf326=function(_0x4aa554,_0x3c4191){_0x4aa554=_0x4aa554-0x0;var _0x59f6ec=_0x326f[_0x4aa554];return _0x59f6ec;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 1be28fa..37faa99 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 _0x583c=['fs-extra','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','show','getMessages','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x1c101f,_0x52141d){var _0xe02ee4=function(_0x1d9034){while(--_0x1d9034){_0x1c101f['push'](_0x1c101f['shift']());}};_0xe02ee4(++_0x52141d);}(_0x583c,0x12b));var _0xc583=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x583c[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var path=require(_0xc583('0x2'));var timeout=require(_0xc583('0x3'));var express=require('express');var router=express[_0xc583('0x4')]();var fs_extra=require(_0xc583('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc583('0x6'));var controller=require(_0xc583('0x7'));router['get']('/',auth[_0xc583('0x8')](),controller[_0xc583('0x9')]);router[_0xc583('0xa')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0xc')]);router[_0xc583('0xa')]('/:id/messages',auth[_0xc583('0x8')](),controller[_0xc583('0xd')]);router[_0xc583('0xe')]('/',auth[_0xc583('0x8')](),controller[_0xc583('0xf')]);router['put'](_0xc583('0xb'),auth[_0xc583('0x8')](),controller['update']);router[_0xc583('0x10')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0x11')]);module[_0xc583('0x12')]=router; \ No newline at end of file +var _0xa456=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','post','create','put','delete','multer'];(function(_0x556bca,_0x573fb9){var _0x16c8fd=function(_0x469625){while(--_0x469625){_0x556bca['push'](_0x556bca['shift']());}};_0x16c8fd(++_0x573fb9);}(_0xa456,0x142));var _0x6a45=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xa456[_0x2112d4];return _0x434972;};'use strict';var multer=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var path=require(_0x6a45('0x2'));var timeout=require(_0x6a45('0x3'));var express=require('express');var router=express[_0x6a45('0x4')]();var fs_extra=require(_0x6a45('0x5'));var auth=require(_0x6a45('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6a45('0x7'));var controller=require(_0x6a45('0x8'));router[_0x6a45('0x9')]('/',auth[_0x6a45('0xa')](),controller['index']);router[_0x6a45('0x9')](_0x6a45('0xb'),auth[_0x6a45('0xa')](),controller[_0x6a45('0xc')]);router[_0x6a45('0x9')]('/:id/messages',auth[_0x6a45('0xa')](),controller['getMessages']);router[_0x6a45('0xd')]('/',auth[_0x6a45('0xa')](),controller[_0x6a45('0xe')]);router[_0x6a45('0xf')](_0x6a45('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6a45('0x10')](_0x6a45('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 62ff431..3defa0a 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 _0x4717=['TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)'];(function(_0x49da91,_0x423bda){var _0xd6a44e=function(_0x4d2020){while(--_0x4d2020){_0x49da91['push'](_0x49da91['shift']());}};_0xd6a44e(++_0x423bda);}(_0x4717,0x183));var _0x7471=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4717[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x7471('0x0'));module[_0x7471('0x1')]={'customer_id':{'type':Sequelize[_0x7471('0x2')]},'context':{'type':Sequelize[_0x7471('0x2')],'defaultValue':_0x7471('0x3'),'unique':_0x7471('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x7471('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x7471('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x1ddf5e){this[_0x7471('0x5')](_0x7471('0x6'),typeof _0x1ddf5e===_0x7471('0x7')&&_0x1ddf5e['trim']()?_0x1ddf5e[_0x7471('0x8')]():null);}},'pager':{'type':Sequelize[_0x7471('0x2')]},'tz':{'type':Sequelize[_0x7471('0x2')],'defaultValue':_0x7471('0x9')},'attach':{'type':Sequelize['ENUM'](_0x7471('0xa'),'no'),'defaultValue':_0x7471('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7471('0xb')](_0x7471('0xa'),'no'),'defaultValue':_0x7471('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x7471('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7471('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7471('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7471('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7471('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7471('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x7471('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7471('0xb')](_0x7471('0xa'),'no'),'defaultValue':_0x7471('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x7471('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7471('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7471('0xb')](_0x7471('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x7471('0xd')},'emailsubject':{'type':Sequelize[_0x7471('0x2')]},'emailbody':{'type':Sequelize[_0x7471('0x2')]},'maxsecs':{'type':Sequelize[_0x7471('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7471('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7471('0xf')],'get':function(){return this[_0x7471('0x10')](_0x7471('0x11'))+_0x7471('0x12')+this['getDataValue'](_0x7471('0x13'));}}}; \ No newline at end of file +var _0x7cd5=['mailbox','contest_mailbox','STRING','setDataValue','email','string','trim','central','yes','ENUM','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20'];(function(_0x2a4b0f,_0x3f45e0){var _0x2064ab=function(_0x567b8f){while(--_0x567b8f){_0x2a4b0f['push'](_0x2a4b0f['shift']());}};_0x2064ab(++_0x3f45e0);}(_0x7cd5,0x191));var _0x57cd=function(_0x1464af,_0x272ea9){_0x1464af=_0x1464af-0x0;var _0x49007e=_0x7cd5[_0x1464af];return _0x49007e;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0x57cd('0x0')},'mailbox':{'type':Sequelize[_0x57cd('0x1')],'defaultValue':'','allowNull':![],'unique':_0x57cd('0x0')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x57cd('0x1')],'validate':{'isEmail':!![]},'set':function(_0x24768f){this[_0x57cd('0x2')](_0x57cd('0x3'),typeof _0x24768f===_0x57cd('0x4')&&_0x24768f[_0x57cd('0x5')]()?_0x24768f[_0x57cd('0x5')]():null);}},'pager':{'type':Sequelize[_0x57cd('0x1')]},'tz':{'type':Sequelize[_0x57cd('0x1')],'defaultValue':_0x57cd('0x6')},'attach':{'type':Sequelize['ENUM'](_0x57cd('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x57cd('0x8')]('yes','no'),'defaultValue':_0x57cd('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x57cd('0x1')]},'callback':{'type':Sequelize[_0x57cd('0x1')]},'review':{'type':Sequelize[_0x57cd('0x8')](_0x57cd('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x57cd('0x8')](_0x57cd('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x57cd('0x8')](_0x57cd('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x57cd('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x57cd('0x8')](_0x57cd('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x57cd('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x57cd('0x8')](_0x57cd('0x7'),'no'),'defaultValue':_0x57cd('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x57cd('0x8')](_0x57cd('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x57cd('0x8')](_0x57cd('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x57cd('0x8')](_0x57cd('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x57cd('0x9')},'emailsubject':{'type':Sequelize[_0x57cd('0x1')]},'emailbody':{'type':Sequelize[_0x57cd('0x1')]},'maxsecs':{'type':Sequelize[_0x57cd('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x57cd('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x57cd('0xb')],'get':function(){return this[_0x57cd('0xc')](_0x57cd('0xd'))+_0x57cd('0xe')+this[_0x57cd('0xc')](_0x57cd('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 8ae2f6e..cd4badd 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 _0x7072=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','length','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','error','stack','name','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields'];(function(_0x3b5fb7,_0x3a7e43){var _0x4db635=function(_0x5c5a42){while(--_0x5c5a42){_0x3b5fb7['push'](_0x3b5fb7['shift']());}};_0x4db635(++_0x3a7e43);}(_0x7072,0x138));var _0x2707=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x7072[_0x1f36bb];return _0xaf97fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2707('0x0'));var zipdir=require(_0x2707('0x1'));var jsonpatch=require(_0x2707('0x2'));var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2707('0x5'));var path=require('path');var sox=require(_0x2707('0x6'));var csv=require(_0x2707('0x7'));var ejs=require(_0x2707('0x8'));var fs=require('fs');var fs_extra=require(_0x2707('0x9'));var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2707('0xf'));var authService=require(_0x2707('0x10'));var qs=require(_0x2707('0x11'));var as=require(_0x2707('0x12'));var hardwareService=require(_0x2707('0x13'));var logger=require(_0x2707('0x14'))(_0x2707('0x15'));var utils=require(_0x2707('0x16'));var config=require(_0x2707('0x17'));var licenseUtil=require(_0x2707('0x18'));var db=require(_0x2707('0x19'))['db'];function respondWithStatusCode(_0x32d4bd,_0x40d370){_0x40d370=_0x40d370||0xcc;return function(_0x5bf16e){if(_0x5bf16e){return _0x32d4bd[_0x2707('0x1a')](_0x40d370);}return _0x32d4bd['status'](_0x40d370)[_0x2707('0x1b')]();};}function respondWithResult(_0x307367,_0xfe975c){_0xfe975c=_0xfe975c||0xc8;return function(_0x3a67f2){if(_0x3a67f2){return _0x307367[_0x2707('0x1c')](_0xfe975c)['json'](_0x3a67f2);}};}function respondWithFilteredResult(_0x345774,_0x1a687a){return function(_0x2f6381){if(_0x2f6381){var _0x5d523f=typeof _0x1a687a[_0x2707('0x1d')]===_0x2707('0x1e')&&typeof _0x1a687a[_0x2707('0x1f')]===_0x2707('0x1e');var _0x7ed037=_0x2f6381[_0x2707('0x20')];var _0x4a8b7f=_0x5d523f?0x0:_0x1a687a[_0x2707('0x1d')];var _0x449a61=_0x5d523f?_0x2f6381[_0x2707('0x20')]:_0x1a687a['offset']+_0x1a687a['limit'];var _0x58a4ee;if(_0x449a61>=_0x7ed037){_0x449a61=_0x7ed037;_0x58a4ee=0xc8;}else{_0x58a4ee=0xce;}_0x345774[_0x2707('0x1c')](_0x58a4ee);return _0x345774[_0x2707('0x21')](_0x2707('0x22'),_0x4a8b7f+'-'+_0x449a61+'/'+_0x7ed037)[_0x2707('0x23')](_0x2f6381);}return null;};}function patchUpdates(_0x1a0e1a){return function(_0x3c2935){try{jsonpatch[_0x2707('0x24')](_0x3c2935,_0x1a0e1a,!![]);}catch(_0x65b6e5){return BPromise[_0x2707('0x25')](_0x65b6e5);}return _0x3c2935[_0x2707('0x26')]();};}function saveUpdates(_0x37c475,_0x119df4){return function(_0x454fde){if(_0x454fde){return _0x454fde[_0x2707('0x27')](_0x37c475)['then'](function(_0x1acf22){return _0x1acf22;});}return null;};}function removeEntity(_0x3b030a,_0x46259e){return function(_0x369e3a){if(_0x369e3a){return _0x369e3a[_0x2707('0x28')]()[_0x2707('0x29')](function(){var _0x4831ed=_0x369e3a[_0x2707('0x2a')]({'plain':!![]});var _0x3f6976=_0x2707('0x2b');return db[_0x2707('0x2c')][_0x2707('0x28')]({'where':{'type':_0x3f6976,'resourceId':_0x4831ed['id']}})['then'](function(){return _0x369e3a;});})[_0x2707('0x29')](function(){_0x3b030a['status'](0xcc)[_0x2707('0x1b')]();});}};}function handleEntityNotFound(_0x34dc4e,_0x2aa3fe){return function(_0x57da26){if(!_0x57da26){_0x34dc4e[_0x2707('0x1a')](0x194);}return _0x57da26;};}function handleError(_0x14daf8,_0x2c7047){_0x2c7047=_0x2c7047||0x1f4;return function(_0x529be8){logger[_0x2707('0x2d')](_0x529be8[_0x2707('0x2e')]);if(_0x529be8['name']){delete _0x529be8[_0x2707('0x2f')];}_0x14daf8['status'](_0x2c7047)['send'](_0x529be8);};}exports[_0x2707('0x30')]=function(_0x4e0c93,_0x2a0d24){var _0x3f153d={},_0x417a97={},_0x36b2e9={'count':0x0,'rows':[]};var _0x48832b=_[_0x2707('0x31')](db[_0x2707('0x32')][_0x2707('0x33')],function(_0x154799){return{'name':_0x154799[_0x2707('0x34')],'type':_0x154799[_0x2707('0x35')][_0x2707('0x36')]};});_0x417a97[_0x2707('0x37')]=_[_0x2707('0x31')](_0x48832b,'name');_0x417a97[_0x2707('0x38')]=_[_0x2707('0x39')](_0x4e0c93['query']);_0x417a97['filters']=_['intersection'](_0x417a97['model'],_0x417a97['query']);_0x3f153d[_0x2707('0x3a')]=_['intersection'](_0x417a97['model'],qs[_0x2707('0x3b')](_0x4e0c93[_0x2707('0x38')]['fields']));_0x3f153d[_0x2707('0x3a')]=_0x3f153d[_0x2707('0x3a')]['length']?_0x3f153d['attributes']:_0x417a97[_0x2707('0x37')];if(!_0x4e0c93[_0x2707('0x38')]['hasOwnProperty']('nolimit')){_0x3f153d[_0x2707('0x1f')]=qs[_0x2707('0x1f')](_0x4e0c93['query'][_0x2707('0x1f')]);_0x3f153d[_0x2707('0x1d')]=qs[_0x2707('0x1d')](_0x4e0c93[_0x2707('0x38')][_0x2707('0x1d')]);}_0x3f153d[_0x2707('0x3c')]=qs['sort'](_0x4e0c93[_0x2707('0x38')][_0x2707('0x3d')]);_0x3f153d[_0x2707('0x3e')]=qs[_0x2707('0x3f')](_[_0x2707('0x40')](_0x4e0c93[_0x2707('0x38')],_0x417a97[_0x2707('0x3f')]),_0x48832b);if(_0x4e0c93['query'][_0x2707('0x41')]){_0x3f153d[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x3f153d[_0x2707('0x3e')],{'$or':_[_0x2707('0x31')](_0x48832b,function(_0xc7119d){if(_0xc7119d[_0x2707('0x35')]!==_0x2707('0x43')){var _0x2f06f8={};_0x2f06f8[_0xc7119d[_0x2707('0x2f')]]={'$like':'%'+_0x4e0c93[_0x2707('0x38')][_0x2707('0x41')]+'%'};return _0x2f06f8;}})});}_0x3f153d=_[_0x2707('0x42')]({},_0x3f153d,_0x4e0c93[_0x2707('0x44')]);var _0x36c8ab={'where':_0x3f153d[_0x2707('0x3e')]};return db['VoiceMail'][_0x2707('0x20')](_0x36c8ab)[_0x2707('0x29')](function(_0x5053ba){_0x36b2e9[_0x2707('0x20')]=_0x5053ba;if(_0x4e0c93['query'][_0x2707('0x45')]){_0x3f153d[_0x2707('0x46')]=[{'all':!![]}];}return db[_0x2707('0x32')][_0x2707('0x47')](_0x3f153d);})[_0x2707('0x29')](function(_0xdeec24){_0x36b2e9[_0x2707('0x48')]=_0xdeec24;return _0x36b2e9;})['then'](respondWithFilteredResult(_0x2a0d24,_0x3f153d))[_0x2707('0x49')](handleError(_0x2a0d24,null));};exports[_0x2707('0x4a')]=function(_0x4c8dbf,_0x3d25ea){var _0x6defc2={'raw':!![],'where':{'id':_0x4c8dbf['params']['id']}},_0x3b38d7={};_0x3b38d7['model']=_[_0x2707('0x39')](db[_0x2707('0x32')]['rawAttributes']);_0x3b38d7[_0x2707('0x38')]=_['keys'](_0x4c8dbf[_0x2707('0x38')]);_0x3b38d7[_0x2707('0x3f')]=_[_0x2707('0x4b')](_0x3b38d7[_0x2707('0x37')],_0x3b38d7['query']);_0x6defc2[_0x2707('0x3a')]=_[_0x2707('0x4b')](_0x3b38d7[_0x2707('0x37')],qs[_0x2707('0x3b')](_0x4c8dbf[_0x2707('0x38')][_0x2707('0x3b')]));_0x6defc2[_0x2707('0x3a')]=_0x6defc2['attributes'][_0x2707('0x4c')]?_0x6defc2[_0x2707('0x3a')]:_0x3b38d7[_0x2707('0x37')];if(_0x4c8dbf[_0x2707('0x38')][_0x2707('0x45')]){_0x6defc2['include']=[{'all':!![]}];}_0x6defc2=_[_0x2707('0x42')]({},_0x6defc2,_0x4c8dbf['options']);return db[_0x2707('0x32')][_0x2707('0x4d')](_0x6defc2)['then'](handleEntityNotFound(_0x3d25ea,null))[_0x2707('0x29')](respondWithResult(_0x3d25ea,null))[_0x2707('0x49')](handleError(_0x3d25ea,null));};exports[_0x2707('0x4e')]=function(_0x4ae196,_0x1a8034){return db['VoiceMail'][_0x2707('0x4e')](_0x4ae196[_0x2707('0x4f')],{})['then'](function(_0x2b1746){var _0xffe740=_0x4ae196[_0x2707('0x50')]['get']({'plain':!![]});if(!_0xffe740)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xffe740[_0x2707('0x51')]===_0x2707('0x50')){var _0x292b44=_0x2b1746[_0x2707('0x2a')]({'plain':!![]});var _0x463bf='Voicemails';return db['UserProfileSection']['find']({'where':{'name':_0x463bf,'userProfileId':_0xffe740[_0x2707('0x52')]},'raw':!![]})[_0x2707('0x29')](function(_0x2e11fc){if(_0x2e11fc&&_0x2e11fc[_0x2707('0x53')]===0x0){return db[_0x2707('0x2c')]['create']({'name':_0x292b44[_0x2707('0x2f')],'resourceId':_0x292b44['id'],'type':_0x2e11fc[_0x2707('0x2f')],'sectionId':_0x2e11fc['id']},{})['then'](function(){return _0x2b1746;});}else{return _0x2b1746;}})['catch'](function(_0x3b41b2){logger[_0x2707('0x2d')](_0x2707('0x54'),_0x3b41b2);throw _0x3b41b2;});}return _0x2b1746;})['then'](respondWithResult(_0x1a8034,0xc9))[_0x2707('0x49')](handleError(_0x1a8034,null));};exports[_0x2707('0x27')]=function(_0x2a2a71,_0x29a453){if(_0x2a2a71['body']['id']){delete _0x2a2a71[_0x2707('0x4f')]['id'];}return db[_0x2707('0x32')][_0x2707('0x4d')]({'where':{'id':_0x2a2a71[_0x2707('0x55')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x29a453,null))[_0x2707('0x29')](saveUpdates(_0x2a2a71[_0x2707('0x4f')],null))[_0x2707('0x29')](respondWithResult(_0x29a453,null))[_0x2707('0x49')](handleError(_0x29a453,null));};exports[_0x2707('0x28')]=function(_0x4f2b54,_0x38acdd){return db['VoiceMail']['find']({'where':{'id':_0x4f2b54[_0x2707('0x55')]['id']}})['then'](handleEntityNotFound(_0x38acdd,null))['then'](removeEntity(_0x38acdd,null))[_0x2707('0x49')](handleError(_0x38acdd,null));};exports[_0x2707('0x56')]=function(_0x185bd3,_0x154e26,_0x3f82de){return db[_0x2707('0x32')][_0x2707('0x57')]({'where':{'id':_0x185bd3[_0x2707('0x55')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x154e26,null))[_0x2707('0x29')](function(_0x40c333){var _0x5852bd;var _0x4c4568={},_0x4a3a35={};_0x4a3a35[_0x2707('0x37')]=_[_0x2707('0x39')](db[_0x2707('0x58')]['rawAttributes']);_0x4a3a35['query']=_[_0x2707('0x39')](_0x185bd3[_0x2707('0x38')]);_0x4a3a35[_0x2707('0x3f')]=_[_0x2707('0x4b')](_0x4a3a35[_0x2707('0x37')],_0x4a3a35['query']);_0x4c4568['attributes']=_[_0x2707('0x4b')](_0x4a3a35[_0x2707('0x37')],qs[_0x2707('0x3b')](_0x185bd3[_0x2707('0x38')][_0x2707('0x3b')]));_0x4c4568[_0x2707('0x3a')]=_0x4c4568[_0x2707('0x3a')][_0x2707('0x4c')]?_0x4c4568[_0x2707('0x3a')]:_0x4a3a35['model'];if(!_0x185bd3[_0x2707('0x38')][_0x2707('0x59')](_0x2707('0x5a'))){_0x4c4568[_0x2707('0x1f')]=qs[_0x2707('0x1f')](_0x185bd3[_0x2707('0x38')]['limit']);_0x4c4568['offset']=qs[_0x2707('0x1d')](_0x185bd3[_0x2707('0x38')]['offset']);}_0x4c4568['order']=qs['sort'](_0x185bd3['query'][_0x2707('0x3d')]);_0x4c4568[_0x2707('0x3e')]=qs['filters'](_[_0x2707('0x40')](_0x185bd3[_0x2707('0x38')],_0x4a3a35[_0x2707('0x3f')]));if(_0x185bd3['query']['filter']){_0x4c4568[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x4c4568[_0x2707('0x3e')],{'$or':_[_0x2707('0x31')](_0x4c4568[_0x2707('0x3a')],function(_0xdb1de0){var _0x3973a0={};_0x3973a0[_0xdb1de0]={'$like':'%'+_0x185bd3['query'][_0x2707('0x41')]+'%'};return _0x3973a0;})});}_0x4c4568[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x4c4568[_0x2707('0x3e')],{'mailboxuser':_0x40c333[_0x2707('0x5b')]});_0x4c4568=_[_0x2707('0x42')]({},_0x4c4568,_0x185bd3['options']);return db[_0x2707('0x58')][_0x2707('0x5c')](_0x4c4568)[_0x2707('0x29')](respondWithFilteredResult(_0x154e26,_0x4c4568));})[_0x2707('0x49')](handleError(_0x154e26,null));}; \ No newline at end of file +var _0x7af2=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','getMessages','findOne','VoiceMailMessage','rawAttributes','mailbox','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','Content-Range','apply','reject','update','then','get','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create'];(function(_0x46f9e3,_0x1889fb){var _0x43d6ba=function(_0x4b281b){while(--_0x4b281b){_0x46f9e3['push'](_0x46f9e3['shift']());}};_0x43d6ba(++_0x1889fb);}(_0x7af2,0x119));var _0x27af=function(_0x4531b3,_0x13cae2){_0x4531b3=_0x4531b3-0x0;var _0x44d749=_0x7af2[_0x4531b3];return _0x44d749;};'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(){var _0x4b8fe6=_0x2e1bb0[_0x27af('0x24')]({'plain':!![]});var _0x4feaf1=_0x27af('0x25');return db[_0x27af('0x26')]['destroy']({'where':{'type':_0x4feaf1,'resourceId':_0x4b8fe6['id']}})[_0x27af('0x23')](function(){return _0x2e1bb0;});})[_0x27af('0x23')](function(){_0x43dd9e[_0x27af('0x18')](0xcc)[_0x27af('0x19')]();});}};}function handleEntityNotFound(_0x39b8ee,_0x3ca40e){return function(_0x775d4e){if(!_0x775d4e){_0x39b8ee['sendStatus'](0x194);}return _0x775d4e;};}function handleError(_0x14d5fc,_0x250d5b){_0x250d5b=_0x250d5b||0x1f4;return function(_0xadd38e){logger[_0x27af('0x27')](_0xadd38e[_0x27af('0x28')]);if(_0xadd38e[_0x27af('0x29')]){delete _0xadd38e[_0x27af('0x29')];}_0x14d5fc[_0x27af('0x18')](_0x250d5b)[_0x27af('0x2a')](_0xadd38e);};}exports[_0x27af('0x2b')]=function(_0x205e41,_0x4f4955){var _0x15e867={},_0x14b2e7={},_0x3800a1={'count':0x0,'rows':[]};var _0x575887=_[_0x27af('0x2c')](db[_0x27af('0x2d')]['rawAttributes'],function(_0x51bc97){return{'name':_0x51bc97[_0x27af('0x2e')],'type':_0x51bc97[_0x27af('0x2f')]['key']};});_0x14b2e7[_0x27af('0x30')]=_[_0x27af('0x2c')](_0x575887,_0x27af('0x29'));_0x14b2e7[_0x27af('0x31')]=_[_0x27af('0x32')](_0x205e41[_0x27af('0x31')]);_0x14b2e7[_0x27af('0x33')]=_[_0x27af('0x34')](_0x14b2e7[_0x27af('0x30')],_0x14b2e7[_0x27af('0x31')]);_0x15e867[_0x27af('0x35')]=_['intersection'](_0x14b2e7['model'],qs[_0x27af('0x36')](_0x205e41[_0x27af('0x31')]['fields']));_0x15e867[_0x27af('0x35')]=_0x15e867[_0x27af('0x35')]['length']?_0x15e867[_0x27af('0x35')]:_0x14b2e7[_0x27af('0x30')];if(!_0x205e41[_0x27af('0x31')][_0x27af('0x37')](_0x27af('0x38'))){_0x15e867['limit']=qs[_0x27af('0x1d')](_0x205e41[_0x27af('0x31')]['limit']);_0x15e867['offset']=qs[_0x27af('0x1b')](_0x205e41[_0x27af('0x31')][_0x27af('0x1b')]);}_0x15e867[_0x27af('0x39')]=qs[_0x27af('0x3a')](_0x205e41[_0x27af('0x31')]['sort']);_0x15e867[_0x27af('0x3b')]=qs['filters'](_[_0x27af('0x3c')](_0x205e41[_0x27af('0x31')],_0x14b2e7[_0x27af('0x33')]),_0x575887);if(_0x205e41[_0x27af('0x31')][_0x27af('0x3d')]){_0x15e867['where']=_[_0x27af('0x3e')](_0x15e867[_0x27af('0x3b')],{'$or':_[_0x27af('0x2c')](_0x575887,function(_0x3faebd){if(_0x3faebd[_0x27af('0x2f')]!==_0x27af('0x3f')){var _0x415d9f={};_0x415d9f[_0x3faebd[_0x27af('0x29')]]={'$like':'%'+_0x205e41[_0x27af('0x31')][_0x27af('0x3d')]+'%'};return _0x415d9f;}})});}_0x15e867=_[_0x27af('0x3e')]({},_0x15e867,_0x205e41[_0x27af('0x40')]);var _0x24ee9b={'where':_0x15e867[_0x27af('0x3b')]};return db['VoiceMail'][_0x27af('0x1e')](_0x24ee9b)[_0x27af('0x23')](function(_0x44534b){_0x3800a1[_0x27af('0x1e')]=_0x44534b;if(_0x205e41['query'][_0x27af('0x41')]){_0x15e867['include']=[{'all':!![]}];}return db['VoiceMail'][_0x27af('0x42')](_0x15e867);})[_0x27af('0x23')](function(_0x279f99){_0x3800a1[_0x27af('0x43')]=_0x279f99;return _0x3800a1;})[_0x27af('0x23')](respondWithFilteredResult(_0x4f4955,_0x15e867))[_0x27af('0x44')](handleError(_0x4f4955,null));};exports[_0x27af('0x45')]=function(_0x26eb28,_0x2269e8){var _0x100fcb={'raw':!![],'where':{'id':_0x26eb28[_0x27af('0x46')]['id']}},_0x1e3c35={};_0x1e3c35['model']=_[_0x27af('0x32')](db[_0x27af('0x2d')]['rawAttributes']);_0x1e3c35['query']=_[_0x27af('0x32')](_0x26eb28[_0x27af('0x31')]);_0x1e3c35[_0x27af('0x33')]=_[_0x27af('0x34')](_0x1e3c35[_0x27af('0x30')],_0x1e3c35['query']);_0x100fcb[_0x27af('0x35')]=_['intersection'](_0x1e3c35[_0x27af('0x30')],qs[_0x27af('0x36')](_0x26eb28[_0x27af('0x31')][_0x27af('0x36')]));_0x100fcb[_0x27af('0x35')]=_0x100fcb[_0x27af('0x35')][_0x27af('0x47')]?_0x100fcb['attributes']:_0x1e3c35['model'];if(_0x26eb28[_0x27af('0x31')]['includeAll']){_0x100fcb[_0x27af('0x48')]=[{'all':!![]}];}_0x100fcb=_[_0x27af('0x3e')]({},_0x100fcb,_0x26eb28[_0x27af('0x40')]);return db[_0x27af('0x2d')][_0x27af('0x49')](_0x100fcb)[_0x27af('0x23')](handleEntityNotFound(_0x2269e8,null))[_0x27af('0x23')](respondWithResult(_0x2269e8,null))['catch'](handleError(_0x2269e8,null));};exports[_0x27af('0x4a')]=function(_0xc7e2a8,_0x20e180){return db[_0x27af('0x2d')][_0x27af('0x4a')](_0xc7e2a8['body'],{})[_0x27af('0x23')](function(_0x25f960){var _0x28ba64=_0xc7e2a8['user']['get']({'plain':!![]});if(!_0x28ba64)throw new Error(_0x27af('0x4b'));if(_0x28ba64[_0x27af('0x4c')]===_0x27af('0x4d')){var _0x5be44f=_0x25f960['get']({'plain':!![]});var _0x2fad23='Voicemails';return db[_0x27af('0x4e')][_0x27af('0x49')]({'where':{'name':_0x2fad23,'userProfileId':_0x28ba64[_0x27af('0x4f')]},'raw':!![]})[_0x27af('0x23')](function(_0x38aa14){if(_0x38aa14&&_0x38aa14[_0x27af('0x50')]===0x0){return db[_0x27af('0x26')][_0x27af('0x4a')]({'name':_0x5be44f[_0x27af('0x29')],'resourceId':_0x5be44f['id'],'type':_0x38aa14[_0x27af('0x29')],'sectionId':_0x38aa14['id']},{})[_0x27af('0x23')](function(){return _0x25f960;});}else{return _0x25f960;}})['catch'](function(_0x76ed78){logger[_0x27af('0x27')](_0x27af('0x51'),_0x76ed78);throw _0x76ed78;});}return _0x25f960;})[_0x27af('0x23')](respondWithResult(_0x20e180,0xc9))[_0x27af('0x44')](handleError(_0x20e180,null));};exports[_0x27af('0x22')]=function(_0x20c155,_0x31eaa9){if(_0x20c155['body']['id']){delete _0x20c155[_0x27af('0x52')]['id'];}return db['VoiceMail'][_0x27af('0x49')]({'where':{'id':_0x20c155[_0x27af('0x46')]['id']}})[_0x27af('0x23')](handleEntityNotFound(_0x31eaa9,null))['then'](saveUpdates(_0x20c155[_0x27af('0x52')],null))['then'](respondWithResult(_0x31eaa9,null))[_0x27af('0x44')](handleError(_0x31eaa9,null));};exports[_0x27af('0x53')]=function(_0x4769ff,_0x5bf8b0){return db[_0x27af('0x2d')]['find']({'where':{'id':_0x4769ff[_0x27af('0x46')]['id']}})['then'](handleEntityNotFound(_0x5bf8b0,null))[_0x27af('0x23')](removeEntity(_0x5bf8b0,null))[_0x27af('0x44')](handleError(_0x5bf8b0,null));};exports[_0x27af('0x54')]=function(_0x571064,_0x4bc851,_0x5eab7d){return db[_0x27af('0x2d')][_0x27af('0x55')]({'where':{'id':_0x571064[_0x27af('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bc851,null))[_0x27af('0x23')](function(_0x306c56){var _0x6761d4;var _0x34c855={},_0x299f63={};_0x299f63[_0x27af('0x30')]=_['keys'](db[_0x27af('0x56')][_0x27af('0x57')]);_0x299f63[_0x27af('0x31')]=_[_0x27af('0x32')](_0x571064['query']);_0x299f63[_0x27af('0x33')]=_['intersection'](_0x299f63[_0x27af('0x30')],_0x299f63[_0x27af('0x31')]);_0x34c855['attributes']=_[_0x27af('0x34')](_0x299f63[_0x27af('0x30')],qs['fields'](_0x571064['query'][_0x27af('0x36')]));_0x34c855[_0x27af('0x35')]=_0x34c855[_0x27af('0x35')]['length']?_0x34c855[_0x27af('0x35')]:_0x299f63[_0x27af('0x30')];if(!_0x571064['query'][_0x27af('0x37')](_0x27af('0x38'))){_0x34c855['limit']=qs['limit'](_0x571064[_0x27af('0x31')][_0x27af('0x1d')]);_0x34c855['offset']=qs['offset'](_0x571064[_0x27af('0x31')][_0x27af('0x1b')]);}_0x34c855[_0x27af('0x39')]=qs[_0x27af('0x3a')](_0x571064[_0x27af('0x31')][_0x27af('0x3a')]);_0x34c855[_0x27af('0x3b')]=qs['filters'](_['pick'](_0x571064[_0x27af('0x31')],_0x299f63[_0x27af('0x33')]));if(_0x571064[_0x27af('0x31')][_0x27af('0x3d')]){_0x34c855[_0x27af('0x3b')]=_[_0x27af('0x3e')](_0x34c855[_0x27af('0x3b')],{'$or':_[_0x27af('0x2c')](_0x34c855[_0x27af('0x35')],function(_0x13c9ff){var _0x444f21={};_0x444f21[_0x13c9ff]={'$like':'%'+_0x571064[_0x27af('0x31')][_0x27af('0x3d')]+'%'};return _0x444f21;})});}_0x34c855[_0x27af('0x3b')]=_[_0x27af('0x3e')](_0x34c855[_0x27af('0x3b')],{'mailboxuser':_0x306c56[_0x27af('0x58')]});_0x34c855=_['merge']({},_0x34c855,_0x571064[_0x27af('0x40')]);return db[_0x27af('0x56')]['findAndCountAll'](_0x34c855)[_0x27af('0x23')](respondWithFilteredResult(_0x4bc851,_0x34c855));})[_0x27af('0x44')](handleError(_0x4bc851,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 3cd8fa2..895a88f 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 _0xf0d2=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash'];(function(_0x326dfd,_0x2e0ac3){var _0x4e06eb=function(_0x5a59f8){while(--_0x5a59f8){_0x326dfd['push'](_0x326dfd['shift']());}};_0x4e06eb(++_0x2e0ac3);}(_0xf0d2,0x8f));var _0x2f0d=function(_0x45e79b,_0x88488a){_0x45e79b=_0x45e79b-0x0;var _0x5635c6=_0xf0d2[_0x45e79b];return _0x5635c6;};'use strict';var _=require(_0x2f0d('0x0'));var util=require(_0x2f0d('0x1'));var logger=require(_0x2f0d('0x2'))(_0x2f0d('0x3'));var moment=require(_0x2f0d('0x4'));var BPromise=require('bluebird');var rp=require(_0x2f0d('0x5'));var fs=require('fs');var path=require(_0x2f0d('0x6'));var rimraf=require(_0x2f0d('0x7'));var config=require(_0x2f0d('0x8'));var attributes=require(_0x2f0d('0x9'));module[_0x2f0d('0xa')]=function(_0x35d534,_0x415ca2){return _0x35d534[_0x2f0d('0xb')](_0x2f0d('0xc'),attributes,{'tableName':_0x2f0d('0xd'),'paranoid':![],'indexes':[{'name':_0x2f0d('0xe'),'fields':['mailbox',_0x2f0d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x84f4=['rimraf','../../config/environment','define','VoiceMail','voice_voicemail','mailbox','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x462c42,_0x2bace1){var _0x12dd61=function(_0x558567){while(--_0x558567){_0x462c42['push'](_0x462c42['shift']());}};_0x12dd61(++_0x2bace1);}(_0x84f4,0x16e));var _0x484f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x84f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x484f('0x0'));var logger=require(_0x484f('0x1'))('api');var moment=require(_0x484f('0x2'));var BPromise=require(_0x484f('0x3'));var rp=require(_0x484f('0x4'));var fs=require('fs');var path=require(_0x484f('0x5'));var rimraf=require(_0x484f('0x6'));var config=require(_0x484f('0x7'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x528d90,_0x46d54f){return _0x528d90[_0x484f('0x8')](_0x484f('0x9'),attributes,{'tableName':_0x484f('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x484f('0xb'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 6330088..d41d5a8 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 _0xbde6=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x122b89,_0x2fca71){var _0x2069f9=function(_0x9b4ce3){while(--_0x9b4ce3){_0x122b89['push'](_0x122b89['shift']());}};_0x2069f9(++_0x2fca71);}(_0xbde6,0xca));var _0x6bde=function(_0x523977,_0x1e0fe5){_0x523977=_0x523977-0x0;var _0xd4b2c6=_0xbde6[_0x523977];return _0xd4b2c6;};'use strict';var _=require(_0x6bde('0x0'));var util=require(_0x6bde('0x1'));var moment=require(_0x6bde('0x2'));var BPromise=require('bluebird');var rs=require(_0x6bde('0x3'));var fs=require('fs');var Redis=require(_0x6bde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6bde('0x5'));var logger=require(_0x6bde('0x6'))(_0x6bde('0x7'));var config=require(_0x6bde('0x8'));var jayson=require(_0x6bde('0x9'));var client=jayson['client'][_0x6bde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d1492,_0x464605,_0x1a0f8d){return new BPromise(function(_0x25e2e3,_0x3aaf7a){return client[_0x6bde('0xb')](_0x1d1492,_0x1a0f8d)['then'](function(_0x309b36){logger[_0x6bde('0xc')](_0x6bde('0xd'),_0x464605,_0x6bde('0xe'));logger[_0x6bde('0xf')](_0x6bde('0x10'),_0x464605,_0x6bde('0xe'),JSON[_0x6bde('0x11')](_0x309b36));if(_0x309b36['error']){if(_0x309b36[_0x6bde('0x12')][_0x6bde('0x13')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x464605,_0x309b36[_0x6bde('0x12')][_0x6bde('0x14')]);return _0x3aaf7a(_0x309b36['error'][_0x6bde('0x14')]);}logger[_0x6bde('0x12')](_0x6bde('0xd'),_0x464605,_0x309b36[_0x6bde('0x12')][_0x6bde('0x14')]);return _0x25e2e3(_0x309b36[_0x6bde('0x12')][_0x6bde('0x14')]);}else{logger[_0x6bde('0xc')](_0x6bde('0xd'),_0x464605,_0x6bde('0xe'));_0x25e2e3(_0x309b36[_0x6bde('0x15')][_0x6bde('0x14')]);}})[_0x6bde('0x16')](function(_0x1b54e9){logger[_0x6bde('0x12')]('VoiceMail,\x20%s,\x20%s',_0x464605,_0x1b54e9);_0x3aaf7a(_0x1b54e9);});});} \ No newline at end of file +var _0x43b5=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3856e7,_0x2c34e4){var _0x379422=function(_0x21f114){while(--_0x21f114){_0x3856e7['push'](_0x3856e7['shift']());}};_0x379422(++_0x2c34e4);}(_0x43b5,0x131));var _0x543b=function(_0x3d5719,_0x2fea03){_0x3d5719=_0x3d5719-0x0;var _0x2c17da=_0x43b5[_0x3d5719];return _0x2c17da;};'use strict';var _=require(_0x543b('0x0'));var util=require(_0x543b('0x1'));var moment=require(_0x543b('0x2'));var BPromise=require(_0x543b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x543b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x543b('0x5'));var logger=require(_0x543b('0x6'))('rpc');var config=require(_0x543b('0x7'));var jayson=require(_0x543b('0x8'));var client=jayson[_0x543b('0x9')][_0x543b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x390a40,_0xa4d637,_0x5b56d8){return new BPromise(function(_0x238e60,_0x564edb){return client[_0x543b('0xb')](_0x390a40,_0x5b56d8)[_0x543b('0xc')](function(_0x2bc256){logger[_0x543b('0xd')](_0x543b('0xe'),_0xa4d637,_0x543b('0xf'));logger[_0x543b('0x10')](_0x543b('0x11'),_0xa4d637,_0x543b('0xf'),JSON[_0x543b('0x12')](_0x2bc256));if(_0x2bc256[_0x543b('0x13')]){if(_0x2bc256[_0x543b('0x13')][_0x543b('0x14')]===0x1f4){logger[_0x543b('0x13')]('VoiceMail,\x20%s,\x20%s',_0xa4d637,_0x2bc256['error'][_0x543b('0x15')]);return _0x564edb(_0x2bc256[_0x543b('0x13')][_0x543b('0x15')]);}logger[_0x543b('0x13')](_0x543b('0xe'),_0xa4d637,_0x2bc256['error'][_0x543b('0x15')]);return _0x238e60(_0x2bc256[_0x543b('0x13')][_0x543b('0x15')]);}else{logger['info'](_0x543b('0xe'),_0xa4d637,_0x543b('0xf'));_0x238e60(_0x2bc256[_0x543b('0x16')][_0x543b('0x15')]);}})['catch'](function(_0x3dfeef){logger['error'](_0x543b('0xe'),_0xa4d637,_0x3dfeef);_0x564edb(_0x3dfeef);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 22ca3f3..9d6908b 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 _0x4772=['get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4772,0x15c));var _0x2477=function(_0xf247e7,_0x1260cc){_0xf247e7=_0xf247e7-0x0;var _0x38517b=_0x4772[_0xf247e7];return _0x38517b;};'use strict';var multer=require(_0x2477('0x0'));var util=require(_0x2477('0x1'));var path=require('path');var timeout=require(_0x2477('0x2'));var express=require(_0x2477('0x3'));var router=express[_0x2477('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2477('0x5'));var interaction=require(_0x2477('0x6'));var config=require(_0x2477('0x7'));var controller=require(_0x2477('0x8'));router[_0x2477('0x9')]('/',auth[_0x2477('0xa')](),controller['index']);router['get'](_0x2477('0xb'),auth[_0x2477('0xa')](),controller[_0x2477('0xc')]);router['get'](_0x2477('0xd'),auth[_0x2477('0xa')](),controller[_0x2477('0xe')]);router[_0x2477('0xf')]('/',auth['isAuthenticated'](),controller[_0x2477('0x10')]);router[_0x2477('0x11')]('/:id',auth[_0x2477('0xa')](),controller[_0x2477('0x12')]);router[_0x2477('0x13')](_0x2477('0xb'),auth[_0x2477('0xa')](),controller[_0x2477('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd726=['./voiceMailMessage.controller','get','isAuthenticated','index','/:id/download','download','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','../../config/environment'];(function(_0x53474b,_0x4ad7aa){var _0x23534d=function(_0x5c3661){while(--_0x5c3661){_0x53474b['push'](_0x53474b['shift']());}};_0x23534d(++_0x4ad7aa);}(_0xd726,0x13d));var _0x6d72=function(_0x190af6,_0x492781){_0x190af6=_0x190af6-0x0;var _0x55a2cc=_0xd726[_0x190af6];return _0x55a2cc;};'use strict';var multer=require('multer');var util=require(_0x6d72('0x0'));var path=require(_0x6d72('0x1'));var timeout=require(_0x6d72('0x2'));var express=require(_0x6d72('0x3'));var router=express[_0x6d72('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6d72('0x5'));var controller=require(_0x6d72('0x6'));router[_0x6d72('0x7')]('/',auth[_0x6d72('0x8')](),controller[_0x6d72('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x6d72('0xa'),auth[_0x6d72('0x8')](),controller[_0x6d72('0xb')]);router[_0x6d72('0xc')]('/',auth[_0x6d72('0x8')](),controller[_0x6d72('0xd')]);router[_0x6d72('0xe')](_0x6d72('0xf'),auth[_0x6d72('0x8')](),controller[_0x6d72('0x10')]);router[_0x6d72('0x11')](_0x6d72('0xf'),auth['isAuthenticated'](),controller[_0x6d72('0x12')]);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 7c5cb9f..0cae6a4 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 _0x9052=['sequelize','exports','VIRTUAL','getDataValue','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x5048b1,_0x5cf2e6){var _0x1edd3c=function(_0x3dfd7c){while(--_0x3dfd7c){_0x5048b1['push'](_0x5048b1['shift']());}};_0x1edd3c(++_0x5cf2e6);}(_0x9052,0x17a));var _0x2905=function(_0x19f4bd,_0x5671fa){_0x19f4bd=_0x19f4bd-0x0;var _0x3e7744=_0x9052[_0x19f4bd];return _0x3e7744;};'use strict';var Sequelize=require(_0x2905('0x0'));module[_0x2905('0x1')]={'name':{'type':Sequelize[_0x2905('0x2')],'get':function(_0x3245f4){return this[_0x2905('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x2905('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'stamp':{'type':_0x2905('0x6'),'defaultValue':Sequelize[_0x2905('0x7')](_0x2905('0x8'))}}; \ No newline at end of file +var _0xab5c=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','literal'];(function(_0x47d79a,_0x2bc9ef){var _0x3c6e2f=function(_0x555554){while(--_0x555554){_0x47d79a['push'](_0x47d79a['shift']());}};_0x3c6e2f(++_0x2bc9ef);}(_0xab5c,0xfb));var _0xcab5=function(_0x158ab6,_0x3b4274){_0x158ab6=_0x158ab6-0x0;var _0x176a87=_0xab5c[_0x158ab6];return _0x176a87;};'use strict';var Sequelize=require(_0xcab5('0x0'));module[_0xcab5('0x1')]={'name':{'type':Sequelize[_0xcab5('0x2')],'get':function(_0x3dd02c){return this[_0xcab5('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xcab5('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xcab5('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xcab5('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xcab5('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xcab5('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xcab5('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xcab5('0x6')](_0xcab5('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0xcab5('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xcab5('0x8')](_0xcab5('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index a4ddd58..7740a31 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 _0xa258=['ValidationError','VoiceMailMessage\x20not\x20found','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','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','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','query','keys','attributes','intersection','fields','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','download','recording','Sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa258,0x146));var _0x8a25=function(_0xe8b463,_0x129158){_0xe8b463=_0xe8b463-0x0;var _0x24141b=_0xa258[_0xe8b463];return _0x24141b;};'use strict';var emlformat=require(_0x8a25('0x0'));var rimraf=require(_0x8a25('0x1'));var zipdir=require(_0x8a25('0x2'));var jsonpatch=require(_0x8a25('0x3'));var rp=require(_0x8a25('0x4'));var moment=require(_0x8a25('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8a25('0x6'));var util=require(_0x8a25('0x7'));var path=require('path');var sox=require(_0x8a25('0x8'));var csv=require('to-csv');var ejs=require(_0x8a25('0x9'));var fs=require('fs');var fs_extra=require(_0x8a25('0xa'));var _=require(_0x8a25('0xb'));var squel=require('squel');var crypto=require(_0x8a25('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8a25('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8a25('0xe'));var Redis=require('ioredis');var authService=require(_0x8a25('0xf'));var qs=require(_0x8a25('0x10'));var as=require(_0x8a25('0x11'));var hardwareService=require(_0x8a25('0x12'));var logger=require('../../config/logger')(_0x8a25('0x13'));var utils=require(_0x8a25('0x14'));var config=require(_0x8a25('0x15'));var licenseUtil=require(_0x8a25('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x499495,_0x74d796){_0x74d796=_0x74d796||0xcc;return function(_0x558ffa){if(_0x558ffa){return _0x499495[_0x8a25('0x17')](_0x74d796);}return _0x499495[_0x8a25('0x18')](_0x74d796)[_0x8a25('0x19')]();};}function respondWithResult(_0x561a3d,_0x11403f){_0x11403f=_0x11403f||0xc8;return function(_0xef5fd1){if(_0xef5fd1){return _0x561a3d[_0x8a25('0x18')](_0x11403f)[_0x8a25('0x1a')](_0xef5fd1);}};}function respondWithFilteredResult(_0x3d60b8,_0x48bf73){return function(_0x53c2dd){if(_0x53c2dd){var _0x353de7=typeof _0x48bf73['offset']==='undefined'&&typeof _0x48bf73[_0x8a25('0x1b')]==='undefined';var _0x3bc440=_0x53c2dd[_0x8a25('0x1c')];var _0x29e956=_0x353de7?0x0:_0x48bf73[_0x8a25('0x1d')];var _0x343bc4=_0x353de7?_0x53c2dd[_0x8a25('0x1c')]:_0x48bf73[_0x8a25('0x1d')]+_0x48bf73[_0x8a25('0x1b')];var _0x29db74;if(_0x343bc4>=_0x3bc440){_0x343bc4=_0x3bc440;_0x29db74=0xc8;}else{_0x29db74=0xce;}_0x3d60b8[_0x8a25('0x18')](_0x29db74);return _0x3d60b8[_0x8a25('0x1e')](_0x8a25('0x1f'),_0x29e956+'-'+_0x343bc4+'/'+_0x3bc440)[_0x8a25('0x1a')](_0x53c2dd);}return null;};}function patchUpdates(_0x21b992){return function(_0x3914c0){try{jsonpatch[_0x8a25('0x20')](_0x3914c0,_0x21b992,!![]);}catch(_0x2bdbad){return BPromise[_0x8a25('0x21')](_0x2bdbad);}return _0x3914c0['save']();};}function saveUpdates(_0x26f161,_0x492910){return function(_0x15857a){if(_0x15857a){return _0x15857a[_0x8a25('0x22')](_0x26f161)['then'](function(_0x3b1b45){return _0x3b1b45;});}return null;};}function removeEntity(_0x1ce857,_0x3dc48e){return function(_0x4cfaea){if(_0x4cfaea){return _0x4cfaea[_0x8a25('0x23')]()[_0x8a25('0x24')](function(){_0x1ce857[_0x8a25('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5efe23,_0x86e851){return function(_0xf6c985){if(!_0xf6c985){_0x5efe23[_0x8a25('0x17')](0x194);}return _0xf6c985;};}function handleError(_0xebf26,_0xb26098){_0xb26098=_0xb26098||0x1f4;return function(_0x226be2){logger[_0x8a25('0x25')](_0x226be2[_0x8a25('0x26')]);if(_0x226be2['name']){delete _0x226be2[_0x8a25('0x27')];}_0xebf26[_0x8a25('0x18')](_0xb26098)['send'](_0x226be2);};}exports['index']=function(_0x204ba5,_0x53b56a){var _0x4f4e23={},_0x38019e={},_0x2514e3={'count':0x0,'rows':[]};var _0x64876b=_[_0x8a25('0x28')](db[_0x8a25('0x29')][_0x8a25('0x2a')],function(_0x51b369){return{'name':_0x51b369[_0x8a25('0x2b')],'type':_0x51b369[_0x8a25('0x2c')]['key']};});_0x38019e[_0x8a25('0x2d')]=_[_0x8a25('0x2e')](_[_0x8a25('0x28')](_0x64876b,_0x8a25('0x27')),[_0x8a25('0x27')]);_0x38019e[_0x8a25('0x2f')]=_[_0x8a25('0x30')](_0x204ba5[_0x8a25('0x2f')]);_0x38019e['filters']=_['intersection'](_0x38019e['model'],_0x38019e['query']);_0x4f4e23[_0x8a25('0x31')]=_[_0x8a25('0x32')](_0x38019e[_0x8a25('0x2d')],qs[_0x8a25('0x33')](_0x204ba5[_0x8a25('0x2f')]['fields']));_0x4f4e23['attributes']=_0x4f4e23[_0x8a25('0x31')]['length']?_0x4f4e23[_0x8a25('0x31')]:_0x38019e[_0x8a25('0x2d')];if(!_0x204ba5[_0x8a25('0x2f')]['hasOwnProperty'](_0x8a25('0x34'))){_0x4f4e23[_0x8a25('0x1b')]=qs['limit'](_0x204ba5[_0x8a25('0x2f')][_0x8a25('0x1b')]);_0x4f4e23[_0x8a25('0x1d')]=qs[_0x8a25('0x1d')](_0x204ba5[_0x8a25('0x2f')][_0x8a25('0x1d')]);}_0x4f4e23['order']=qs['sort'](_0x204ba5['query'][_0x8a25('0x35')]);_0x4f4e23[_0x8a25('0x36')]=qs['filters'](_[_0x8a25('0x37')](_0x204ba5[_0x8a25('0x2f')],_0x38019e[_0x8a25('0x38')]),_0x64876b);if(_0x204ba5[_0x8a25('0x2f')][_0x8a25('0x39')]){_0x4f4e23['where']=_[_0x8a25('0x3a')](_0x4f4e23[_0x8a25('0x36')],{'$or':_[_0x8a25('0x28')](_0x64876b,function(_0x53f6d1){if(_0x53f6d1[_0x8a25('0x2c')]!==_0x8a25('0x3b')){var _0x5363bb={};_0x5363bb[_0x53f6d1[_0x8a25('0x27')]]={'$like':'%'+_0x204ba5[_0x8a25('0x2f')][_0x8a25('0x39')]+'%'};return _0x5363bb;}})});}_0x4f4e23=_['merge']({},_0x4f4e23,_0x204ba5[_0x8a25('0x3c')]);var _0x377873={'where':_0x4f4e23[_0x8a25('0x36')]};return db[_0x8a25('0x29')][_0x8a25('0x1c')](_0x377873)[_0x8a25('0x24')](function(_0x38b4fa){_0x2514e3['count']=_0x38b4fa;if(_0x204ba5[_0x8a25('0x2f')][_0x8a25('0x3d')]){_0x4f4e23[_0x8a25('0x3e')]=[{'all':!![]}];}return db[_0x8a25('0x29')][_0x8a25('0x3f')](_0x4f4e23);})[_0x8a25('0x24')](function(_0x1b21fa){_0x2514e3[_0x8a25('0x40')]=_0x1b21fa;return _0x2514e3;})[_0x8a25('0x24')](respondWithFilteredResult(_0x53b56a,_0x4f4e23))[_0x8a25('0x41')](handleError(_0x53b56a,null));};exports[_0x8a25('0x42')]=function(_0xe49f28,_0x594f0e){var _0x1017d1={'raw':!![],'where':{'id':_0xe49f28[_0x8a25('0x43')]['id']}},_0x50c7a4={};_0x50c7a4['model']=_['keys'](db[_0x8a25('0x29')][_0x8a25('0x2a')]);_0x50c7a4['query']=_[_0x8a25('0x30')](_0xe49f28[_0x8a25('0x2f')]);_0x50c7a4['filters']=_[_0x8a25('0x32')](_0x50c7a4['model'],_0x50c7a4[_0x8a25('0x2f')]);_0x1017d1[_0x8a25('0x31')]=_[_0x8a25('0x32')](_0x50c7a4[_0x8a25('0x2d')],qs[_0x8a25('0x33')](_0xe49f28[_0x8a25('0x2f')][_0x8a25('0x33')]));_0x1017d1[_0x8a25('0x31')]=_0x1017d1[_0x8a25('0x31')]['length']?_0x1017d1[_0x8a25('0x31')]:_0x50c7a4[_0x8a25('0x2d')];if(_0xe49f28['query']['includeAll']){_0x1017d1[_0x8a25('0x3e')]=[{'all':!![]}];}_0x1017d1=_[_0x8a25('0x3a')]({},_0x1017d1,_0xe49f28['options']);return db['VoiceMailMessage']['find'](_0x1017d1)[_0x8a25('0x24')](handleEntityNotFound(_0x594f0e,null))[_0x8a25('0x24')](respondWithResult(_0x594f0e,null))['catch'](handleError(_0x594f0e,null));};exports['create']=function(_0x25eb0a,_0x2fba66){return db[_0x8a25('0x29')][_0x8a25('0x44')](_0x25eb0a[_0x8a25('0x45')],{})[_0x8a25('0x24')](respondWithResult(_0x2fba66,0xc9))[_0x8a25('0x41')](handleError(_0x2fba66,null));};exports[_0x8a25('0x22')]=function(_0x702bba,_0x3b04c4){if(_0x702bba[_0x8a25('0x45')]['id']){delete _0x702bba[_0x8a25('0x45')]['id'];}return db['VoiceMailMessage'][_0x8a25('0x46')]({'where':{'id':_0x702bba['params']['id']}})[_0x8a25('0x24')](handleEntityNotFound(_0x3b04c4,null))[_0x8a25('0x24')](saveUpdates(_0x702bba[_0x8a25('0x45')],null))[_0x8a25('0x24')](respondWithResult(_0x3b04c4,null))['catch'](handleError(_0x3b04c4,null));};exports['destroy']=function(_0x4b63cc,_0x4fad62){return db[_0x8a25('0x29')][_0x8a25('0x46')]({'where':{'id':_0x4b63cc['params']['id']}})[_0x8a25('0x24')](handleEntityNotFound(_0x4fad62,null))[_0x8a25('0x24')](removeEntity(_0x4fad62,null))[_0x8a25('0x41')](handleError(_0x4fad62,null));};exports[_0x8a25('0x47')]=function(_0x9c8508,_0x4bc220,_0x14ea7a){return db[_0x8a25('0x29')][_0x8a25('0x46')]({'where':{'id':_0x9c8508[_0x8a25('0x43')]['id']},'attributes':['id',_0x8a25('0x48'),'msg_id']})[_0x8a25('0x24')](handleEntityNotFound(_0x4bc220,null))[_0x8a25('0x24')](function(_0x272339){if(_0x272339){if(!_0x272339['recording']){throw new db[(_0x8a25('0x49'))][(_0x8a25('0x4a'))](_0x8a25('0x4b'));}var _0x1ea8b3={'Content-Type':'audio/wav','Content-Disposition':_0x8a25('0x4c')};if(_0x272339[_0x8a25('0x4d')]){_0x1ea8b3[_0x8a25('0x4e')]=_0x8a25('0x4f')+_0x272339[_0x8a25('0x4d')]+'.wav\x22';}_0x4bc220[_0x8a25('0x1e')](_0x1ea8b3);return _0x4bc220['send'](new Buffer(_0x272339[_0x8a25('0x48')]));}})[_0x8a25('0x41')](handleError(_0x4bc220,null));}; \ No newline at end of file +var _0xdef6=['Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','end','name','send','map','VoiceMailMessage','rawAttributes','fieldName','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','merge','find','create','body','download','msg_id','recording'];(function(_0x323fca,_0x369c53){var _0x2f4122=function(_0x8d8818){while(--_0x8d8818){_0x323fca['push'](_0x323fca['shift']());}};_0x2f4122(++_0x369c53);}(_0xdef6,0xff));var _0x6def=function(_0x38cb58,_0x203de5){_0x38cb58=_0x38cb58-0x0;var _0x57fc2a=_0xdef6[_0x38cb58];return _0x57fc2a;};'use strict';var emlformat=require(_0x6def('0x0'));var rimraf=require(_0x6def('0x1'));var zipdir=require(_0x6def('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6def('0x3'));var BPromise=require(_0x6def('0x4'));var Mustache=require(_0x6def('0x5'));var util=require(_0x6def('0x6'));var path=require(_0x6def('0x7'));var sox=require(_0x6def('0x8'));var csv=require(_0x6def('0x9'));var ejs=require(_0x6def('0xa'));var fs=require('fs');var fs_extra=require(_0x6def('0xb'));var _=require(_0x6def('0xc'));var squel=require(_0x6def('0xd'));var crypto=require('crypto');var jsforce=require(_0x6def('0xe'));var deskjs=require(_0x6def('0xf'));var toCsv=require(_0x6def('0x9'));var querystring=require(_0x6def('0x10'));var Papa=require(_0x6def('0x11'));var Redis=require('ioredis');var authService=require(_0x6def('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6def('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6def('0x14'))(_0x6def('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6def('0x16'));var db=require(_0x6def('0x17'))['db'];function respondWithStatusCode(_0x4bab00,_0x179cc8){_0x179cc8=_0x179cc8||0xcc;return function(_0x8b4d59){if(_0x8b4d59){return _0x4bab00[_0x6def('0x18')](_0x179cc8);}return _0x4bab00[_0x6def('0x19')](_0x179cc8)['end']();};}function respondWithResult(_0x3fc003,_0x2b2ab3){_0x2b2ab3=_0x2b2ab3||0xc8;return function(_0x5c0343){if(_0x5c0343){return _0x3fc003[_0x6def('0x19')](_0x2b2ab3)[_0x6def('0x1a')](_0x5c0343);}};}function respondWithFilteredResult(_0x186b79,_0x166a72){return function(_0x37d1d6){if(_0x37d1d6){var _0x4d43d2=typeof _0x166a72['offset']===_0x6def('0x1b')&&typeof _0x166a72[_0x6def('0x1c')]===_0x6def('0x1b');var _0x4b6ea1=_0x37d1d6[_0x6def('0x1d')];var _0x233226=_0x4d43d2?0x0:_0x166a72[_0x6def('0x1e')];var _0x4a66a8=_0x4d43d2?_0x37d1d6['count']:_0x166a72[_0x6def('0x1e')]+_0x166a72['limit'];var _0x7ea258;if(_0x4a66a8>=_0x4b6ea1){_0x4a66a8=_0x4b6ea1;_0x7ea258=0xc8;}else{_0x7ea258=0xce;}_0x186b79[_0x6def('0x19')](_0x7ea258);return _0x186b79[_0x6def('0x1f')](_0x6def('0x20'),_0x233226+'-'+_0x4a66a8+'/'+_0x4b6ea1)[_0x6def('0x1a')](_0x37d1d6);}return null;};}function patchUpdates(_0x11f8e1){return function(_0x4de88e){try{jsonpatch['apply'](_0x4de88e,_0x11f8e1,!![]);}catch(_0x22a3c1){return BPromise[_0x6def('0x21')](_0x22a3c1);}return _0x4de88e[_0x6def('0x22')]();};}function saveUpdates(_0xbf3a0e,_0x24f0bf){return function(_0x10d1ee){if(_0x10d1ee){return _0x10d1ee[_0x6def('0x23')](_0xbf3a0e)[_0x6def('0x24')](function(_0x11f6ad){return _0x11f6ad;});}return null;};}function removeEntity(_0x8a259c,_0x497937){return function(_0x2cc107){if(_0x2cc107){return _0x2cc107['destroy']()[_0x6def('0x24')](function(){_0x8a259c['status'](0xcc)[_0x6def('0x25')]();});}};}function handleEntityNotFound(_0x687d06,_0x328393){return function(_0x2b015f){if(!_0x2b015f){_0x687d06[_0x6def('0x18')](0x194);}return _0x2b015f;};}function handleError(_0x204f14,_0x190d90){_0x190d90=_0x190d90||0x1f4;return function(_0x3e8e23){logger['error'](_0x3e8e23['stack']);if(_0x3e8e23[_0x6def('0x26')]){delete _0x3e8e23[_0x6def('0x26')];}_0x204f14[_0x6def('0x19')](_0x190d90)[_0x6def('0x27')](_0x3e8e23);};}exports['index']=function(_0x4b1a2e,_0x498d34){var _0x27c5e8={},_0x2b9dc7={},_0x40b068={'count':0x0,'rows':[]};var _0x57f08d=_[_0x6def('0x28')](db[_0x6def('0x29')][_0x6def('0x2a')],function(_0x34f18b){return{'name':_0x34f18b[_0x6def('0x2b')],'type':_0x34f18b['type'][_0x6def('0x2c')]};});_0x2b9dc7['model']=_[_0x6def('0x2d')](_[_0x6def('0x28')](_0x57f08d,_0x6def('0x26')),[_0x6def('0x26')]);_0x2b9dc7[_0x6def('0x2e')]=_[_0x6def('0x2f')](_0x4b1a2e[_0x6def('0x2e')]);_0x2b9dc7[_0x6def('0x30')]=_[_0x6def('0x31')](_0x2b9dc7[_0x6def('0x32')],_0x2b9dc7[_0x6def('0x2e')]);_0x27c5e8[_0x6def('0x33')]=_[_0x6def('0x31')](_0x2b9dc7[_0x6def('0x32')],qs[_0x6def('0x34')](_0x4b1a2e[_0x6def('0x2e')][_0x6def('0x34')]));_0x27c5e8['attributes']=_0x27c5e8['attributes'][_0x6def('0x35')]?_0x27c5e8[_0x6def('0x33')]:_0x2b9dc7['model'];if(!_0x4b1a2e['query'][_0x6def('0x36')](_0x6def('0x37'))){_0x27c5e8['limit']=qs['limit'](_0x4b1a2e['query'][_0x6def('0x1c')]);_0x27c5e8[_0x6def('0x1e')]=qs[_0x6def('0x1e')](_0x4b1a2e[_0x6def('0x2e')][_0x6def('0x1e')]);}_0x27c5e8[_0x6def('0x38')]=qs[_0x6def('0x39')](_0x4b1a2e[_0x6def('0x2e')][_0x6def('0x39')]);_0x27c5e8['where']=qs[_0x6def('0x30')](_[_0x6def('0x3a')](_0x4b1a2e['query'],_0x2b9dc7[_0x6def('0x30')]),_0x57f08d);if(_0x4b1a2e['query']['filter']){_0x27c5e8[_0x6def('0x3b')]=_['merge'](_0x27c5e8['where'],{'$or':_[_0x6def('0x28')](_0x57f08d,function(_0x70a763){if(_0x70a763[_0x6def('0x3c')]!==_0x6def('0x3d')){var _0x35f228={};_0x35f228[_0x70a763[_0x6def('0x26')]]={'$like':'%'+_0x4b1a2e[_0x6def('0x2e')][_0x6def('0x3e')]+'%'};return _0x35f228;}})});}_0x27c5e8=_['merge']({},_0x27c5e8,_0x4b1a2e[_0x6def('0x3f')]);var _0x14da6b={'where':_0x27c5e8['where']};return db[_0x6def('0x29')][_0x6def('0x1d')](_0x14da6b)['then'](function(_0x318625){_0x40b068[_0x6def('0x1d')]=_0x318625;if(_0x4b1a2e[_0x6def('0x2e')][_0x6def('0x40')]){_0x27c5e8['include']=[{'all':!![]}];}return db[_0x6def('0x29')][_0x6def('0x41')](_0x27c5e8);})['then'](function(_0x3a9354){_0x40b068['rows']=_0x3a9354;return _0x40b068;})[_0x6def('0x24')](respondWithFilteredResult(_0x498d34,_0x27c5e8))[_0x6def('0x42')](handleError(_0x498d34,null));};exports[_0x6def('0x43')]=function(_0x511a80,_0x2c4b71){var _0x1566dc={'raw':!![],'where':{'id':_0x511a80[_0x6def('0x44')]['id']}},_0x4c7c39={};_0x4c7c39['model']=_[_0x6def('0x2f')](db[_0x6def('0x29')]['rawAttributes']);_0x4c7c39[_0x6def('0x2e')]=_[_0x6def('0x2f')](_0x511a80['query']);_0x4c7c39[_0x6def('0x30')]=_[_0x6def('0x31')](_0x4c7c39[_0x6def('0x32')],_0x4c7c39[_0x6def('0x2e')]);_0x1566dc['attributes']=_['intersection'](_0x4c7c39[_0x6def('0x32')],qs[_0x6def('0x34')](_0x511a80[_0x6def('0x2e')][_0x6def('0x34')]));_0x1566dc[_0x6def('0x33')]=_0x1566dc[_0x6def('0x33')][_0x6def('0x35')]?_0x1566dc[_0x6def('0x33')]:_0x4c7c39[_0x6def('0x32')];if(_0x511a80[_0x6def('0x2e')][_0x6def('0x40')]){_0x1566dc[_0x6def('0x45')]=[{'all':!![]}];}_0x1566dc=_[_0x6def('0x46')]({},_0x1566dc,_0x511a80[_0x6def('0x3f')]);return db[_0x6def('0x29')][_0x6def('0x47')](_0x1566dc)[_0x6def('0x24')](handleEntityNotFound(_0x2c4b71,null))[_0x6def('0x24')](respondWithResult(_0x2c4b71,null))[_0x6def('0x42')](handleError(_0x2c4b71,null));};exports[_0x6def('0x48')]=function(_0x5b54c3,_0x5d7814){return db[_0x6def('0x29')]['create'](_0x5b54c3[_0x6def('0x49')],{})[_0x6def('0x24')](respondWithResult(_0x5d7814,0xc9))[_0x6def('0x42')](handleError(_0x5d7814,null));};exports[_0x6def('0x23')]=function(_0x3bfb17,_0x35b182){if(_0x3bfb17[_0x6def('0x49')]['id']){delete _0x3bfb17['body']['id'];}return db[_0x6def('0x29')]['find']({'where':{'id':_0x3bfb17[_0x6def('0x44')]['id']}})[_0x6def('0x24')](handleEntityNotFound(_0x35b182,null))[_0x6def('0x24')](saveUpdates(_0x3bfb17[_0x6def('0x49')],null))[_0x6def('0x24')](respondWithResult(_0x35b182,null))[_0x6def('0x42')](handleError(_0x35b182,null));};exports['destroy']=function(_0x54118e,_0xabfbca){return db[_0x6def('0x29')][_0x6def('0x47')]({'where':{'id':_0x54118e['params']['id']}})[_0x6def('0x24')](handleEntityNotFound(_0xabfbca,null))['then'](removeEntity(_0xabfbca,null))[_0x6def('0x42')](handleError(_0xabfbca,null));};exports[_0x6def('0x4a')]=function(_0x3c5416,_0x47e6fe,_0x2931ea){return db['VoiceMailMessage'][_0x6def('0x47')]({'where':{'id':_0x3c5416['params']['id']},'attributes':['id','recording',_0x6def('0x4b')]})[_0x6def('0x24')](handleEntityNotFound(_0x47e6fe,null))[_0x6def('0x24')](function(_0x3ce56c){if(_0x3ce56c){if(!_0x3ce56c[_0x6def('0x4c')]){throw new db[(_0x6def('0x4d'))][(_0x6def('0x4e'))](_0x6def('0x4f'));}var _0x1982cd={'Content-Type':_0x6def('0x50'),'Content-Disposition':'attachment'};if(_0x3ce56c[_0x6def('0x4b')]){_0x1982cd[_0x6def('0x51')]=_0x6def('0x52')+_0x3ce56c[_0x6def('0x4b')]+'.wav\x22';}_0x47e6fe[_0x6def('0x1f')](_0x1982cd);return _0x47e6fe[_0x6def('0x27')](new Buffer(_0x3ce56c[_0x6def('0x4c')]));}})[_0x6def('0x42')](handleError(_0x47e6fe,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 4dadda5..0db59c1 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 _0xa009=['exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes'];(function(_0x5a957c,_0x315720){var _0x3629b6=function(_0x4326b4){while(--_0x4326b4){_0x5a957c['push'](_0x5a957c['shift']());}};_0x3629b6(++_0x315720);}(_0xa009,0x1b5));var _0x9a00=function(_0x6b6b99,_0x254b9d){_0x6b6b99=_0x6b6b99-0x0;var _0x15fb7e=_0xa009[_0x6b6b99];return _0x15fb7e;};'use strict';var _=require(_0x9a00('0x0'));var util=require(_0x9a00('0x1'));var logger=require(_0x9a00('0x2'))(_0x9a00('0x3'));var moment=require(_0x9a00('0x4'));var BPromise=require(_0x9a00('0x5'));var rp=require(_0x9a00('0x6'));var fs=require('fs');var path=require(_0x9a00('0x7'));var rimraf=require(_0x9a00('0x8'));var config=require(_0x9a00('0x9'));var attributes=require(_0x9a00('0xa'));module[_0x9a00('0xb')]=function(_0x55d78b,_0x1025e5){return _0x55d78b[_0x9a00('0xc')](_0x9a00('0xd'),attributes,{'tableName':_0x9a00('0xe'),'paranoid':![],'indexes':[{'name':_0x9a00('0xf'),'fields':[_0x9a00('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1af7=['bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util','../../config/logger','api','moment'];(function(_0x1f8e7e,_0x29a171){var _0x1f4208=function(_0x2529c0){while(--_0x2529c0){_0x1f8e7e['push'](_0x1f8e7e['shift']());}};_0x1f4208(++_0x29a171);}(_0x1af7,0xb1));var _0x71af=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x1af7[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x71af('0x0'));var util=require(_0x71af('0x1'));var logger=require(_0x71af('0x2'))(_0x71af('0x3'));var moment=require(_0x71af('0x4'));var BPromise=require(_0x71af('0x5'));var rp=require(_0x71af('0x6'));var fs=require('fs');var path=require(_0x71af('0x7'));var rimraf=require(_0x71af('0x8'));var config=require('../../config/environment');var attributes=require(_0x71af('0x9'));module[_0x71af('0xa')]=function(_0x3c1faa,_0x2560e5){return _0x3c1faa[_0x71af('0xb')](_0x71af('0xc'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0x71af('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index c96b196..deb891b 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 _0x9207=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code','message','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x196dc5,_0x50be9d){var _0x56458e=function(_0x5bd98b){while(--_0x5bd98b){_0x196dc5['push'](_0x196dc5['shift']());}};_0x56458e(++_0x50be9d);}(_0x9207,0x1ba));var _0x7920=function(_0x562f67,_0x22b5d6){_0x562f67=_0x562f67-0x0;var _0x4ede70=_0x9207[_0x562f67];return _0x4ede70;};'use strict';var _=require('lodash');var util=require(_0x7920('0x0'));var moment=require(_0x7920('0x1'));var BPromise=require(_0x7920('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7920('0x3'));var db=require(_0x7920('0x4'))['db'];var utils=require(_0x7920('0x5'));var logger=require(_0x7920('0x6'))(_0x7920('0x7'));var config=require(_0x7920('0x8'));var jayson=require(_0x7920('0x9'));var client=jayson[_0x7920('0xa')][_0x7920('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2655f1,_0x614781,_0x9fc1a8){return new BPromise(function(_0x43248c,_0x415679){return client['request'](_0x2655f1,_0x9fc1a8)[_0x7920('0xc')](function(_0x5e0f45){logger[_0x7920('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x614781,_0x7920('0xe'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x614781,_0x7920('0xe'),JSON[_0x7920('0xf')](_0x5e0f45));if(_0x5e0f45[_0x7920('0x10')]){if(_0x5e0f45[_0x7920('0x10')][_0x7920('0x11')]===0x1f4){logger[_0x7920('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x614781,_0x5e0f45[_0x7920('0x10')]['message']);return _0x415679(_0x5e0f45[_0x7920('0x10')][_0x7920('0x12')]);}logger[_0x7920('0x10')](_0x7920('0x13'),_0x614781,_0x5e0f45[_0x7920('0x10')][_0x7920('0x12')]);return _0x43248c(_0x5e0f45[_0x7920('0x10')][_0x7920('0x12')]);}else{logger[_0x7920('0xd')](_0x7920('0x13'),_0x614781,_0x7920('0xe'));_0x43248c(_0x5e0f45['result'][_0x7920('0x12')]);}})[_0x7920('0x14')](function(_0x54361c){logger[_0x7920('0x10')](_0x7920('0x13'),_0x614781,_0x54361c);_0x415679(_0x54361c);});});} \ No newline at end of file +var _0xb7a7=['code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x327d26,_0x1e7b85){var _0x4fe5a5=function(_0x3efb82){while(--_0x3efb82){_0x327d26['push'](_0x327d26['shift']());}};_0x4fe5a5(++_0x1e7b85);}(_0xb7a7,0x190));var _0x7b7a=function(_0x3b30a4,_0x3bdde5){_0x3b30a4=_0x3b30a4-0x0;var _0x37c1d1=_0xb7a7[_0x3b30a4];return _0x37c1d1;};'use strict';var _=require(_0x7b7a('0x0'));var util=require('util');var moment=require(_0x7b7a('0x1'));var BPromise=require(_0x7b7a('0x2'));var rs=require(_0x7b7a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7a('0x5'))(_0x7b7a('0x6'));var config=require(_0x7b7a('0x7'));var jayson=require(_0x7b7a('0x8'));var client=jayson[_0x7b7a('0x9')][_0x7b7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f999c,_0x135b99,_0xe086db){return new BPromise(function(_0x2bd835,_0x42cb9c){return client[_0x7b7a('0xb')](_0x4f999c,_0xe086db)['then'](function(_0x426b17){logger[_0x7b7a('0xc')](_0x7b7a('0xd'),_0x135b99,_0x7b7a('0xe'));logger['debug'](_0x7b7a('0xf'),_0x135b99,_0x7b7a('0xe'),JSON[_0x7b7a('0x10')](_0x426b17));if(_0x426b17[_0x7b7a('0x11')]){if(_0x426b17[_0x7b7a('0x11')][_0x7b7a('0x12')]===0x1f4){logger[_0x7b7a('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x135b99,_0x426b17[_0x7b7a('0x11')][_0x7b7a('0x13')]);return _0x42cb9c(_0x426b17['error'][_0x7b7a('0x13')]);}logger[_0x7b7a('0x11')](_0x7b7a('0xd'),_0x135b99,_0x426b17[_0x7b7a('0x11')][_0x7b7a('0x13')]);return _0x2bd835(_0x426b17['error'][_0x7b7a('0x13')]);}else{logger[_0x7b7a('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x135b99,_0x7b7a('0xe'));_0x2bd835(_0x426b17[_0x7b7a('0x14')][_0x7b7a('0x13')]);}})[_0x7b7a('0x15')](function(_0xe410e1){logger[_0x7b7a('0x11')](_0x7b7a('0xd'),_0x135b99,_0xe410e1);_0x42cb9c(_0xe410e1);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 9f11503..9b10d6c 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 _0x90bc=['/:id','show','/:id/sounds','post','create','addSound','delete','destroy','/:id/sounds/:id2','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','isAuthenticated','get'];(function(_0x3cbf99,_0x9cb33a){var _0x5f1cba=function(_0x2bfa17){while(--_0x2bfa17){_0x3cbf99['push'](_0x3cbf99['shift']());}};_0x5f1cba(++_0x9cb33a);}(_0x90bc,0x82));var _0xc90b=function(_0x202c99,_0x121caf){_0x202c99=_0x202c99-0x0;var _0x256a0f=_0x90bc[_0x202c99];return _0x256a0f;};'use strict';var multer=require(_0xc90b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc90b('0x1'));var express=require(_0xc90b('0x2'));var router=express[_0xc90b('0x3')]();var fs_extra=require(_0xc90b('0x4'));var auth=require(_0xc90b('0x5'));var interaction=require(_0xc90b('0x6'));var config=require('../../config/environment');var controller=require(_0xc90b('0x7'));router['get']('/',auth[_0xc90b('0x8')](),controller['index']);router[_0xc90b('0x9')](_0xc90b('0xa'),auth[_0xc90b('0x8')](),controller[_0xc90b('0xb')]);router[_0xc90b('0x9')](_0xc90b('0xc'),auth[_0xc90b('0x8')](),controller['getSounds']);router[_0xc90b('0xd')]('/',auth[_0xc90b('0x8')](),controller[_0xc90b('0xe')]);router[_0xc90b('0xd')](_0xc90b('0xc'),auth[_0xc90b('0x8')](),controller[_0xc90b('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc90b('0x10')]('/:id',auth[_0xc90b('0x8')](),controller[_0xc90b('0x11')]);router[_0xc90b('0x10')](_0xc90b('0x12'),auth[_0xc90b('0x8')](),controller['removeSound']);module[_0xc90b('0x13')]=router; \ No newline at end of file +var _0x0e01=['../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','post','create','put','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e01,0x1c1));var _0x10e0=function(_0x1a18d6,_0x2785c2){_0x1a18d6=_0x1a18d6-0x0;var _0x2f165a=_0x0e01[_0x1a18d6];return _0x2f165a;};'use strict';var multer=require('multer');var util=require(_0x10e0('0x0'));var path=require(_0x10e0('0x1'));var timeout=require(_0x10e0('0x2'));var express=require(_0x10e0('0x3'));var router=express['Router']();var fs_extra=require(_0x10e0('0x4'));var auth=require(_0x10e0('0x5'));var interaction=require(_0x10e0('0x6'));var config=require(_0x10e0('0x7'));var controller=require(_0x10e0('0x8'));router[_0x10e0('0x9')]('/',auth[_0x10e0('0xa')](),controller[_0x10e0('0xb')]);router[_0x10e0('0x9')](_0x10e0('0xc'),auth[_0x10e0('0xa')](),controller[_0x10e0('0xd')]);router[_0x10e0('0x9')](_0x10e0('0xe'),auth[_0x10e0('0xa')](),controller['getSounds']);router[_0x10e0('0xf')]('/',auth[_0x10e0('0xa')](),controller[_0x10e0('0x10')]);router[_0x10e0('0xf')](_0x10e0('0xe'),auth[_0x10e0('0xa')](),controller['addSound']);router[_0x10e0('0x11')]('/:id',auth[_0x10e0('0xa')](),controller[_0x10e0('0x12')]);router['delete'](_0x10e0('0xc'),auth[_0x10e0('0xa')](),controller[_0x10e0('0x13')]);router[_0x10e0('0x14')](_0x10e0('0x15'),auth[_0x10e0('0xa')](),controller[_0x10e0('0x16')]);module[_0x10e0('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 18f98eb..e7ef5ca 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 _0xbe44=['ENUM','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING'];(function(_0xe284a6,_0x221d2b){var _0x8f96be=function(_0x3957f1){while(--_0x3957f1){_0xe284a6['push'](_0xe284a6['shift']());}};_0x8f96be(++_0x221d2b);}(_0xbe44,0xd0));var _0x4be4=function(_0x8720df,_0x3f41ea){_0x8720df=_0x8720df-0x0;var _0x44b435=_0xbe44[_0x8720df];return _0x44b435;};'use strict';var Sequelize=require(_0x4be4('0x0'));module['exports']={'name':{'type':Sequelize[_0x4be4('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x4be4('0x2')]('custom',_0x4be4('0x3'),_0x4be4('0x4'),_0x4be4('0x5'),'quietmp3',_0x4be4('0x6')),'allowNull':!![],'defaultValue':_0x4be4('0x3')},'directory':{'type':Sequelize[_0x4be4('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x4be4('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4be4('0x1')],'allowNull':!![],'defaultValue':_0x4be4('0x7')},'format':{'type':Sequelize[_0x4be4('0x1')],'allowNull':!![]},'stamp':{'type':_0x4be4('0x8')},'defaultEntry':{'type':Sequelize[_0x4be4('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa779=['quietmp3nb','quietmp3','mp3','files','alpha','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','mp3nb'];(function(_0x27f9be,_0x268da6){var _0x3783a6=function(_0x332e7c){while(--_0x332e7c){_0x27f9be['push'](_0x27f9be['shift']());}};_0x3783a6(++_0x268da6);}(_0xa779,0x117));var _0x9a77=function(_0x4e7ea1,_0x4189a9){_0x4e7ea1=_0x4e7ea1-0x0;var _0x48495b=_0xa779[_0x4e7ea1];return _0x48495b;};'use strict';var Sequelize=require(_0x9a77('0x0'));module[_0x9a77('0x1')]={'name':{'type':Sequelize[_0x9a77('0x2')],'allowNull':![],'unique':_0x9a77('0x3')},'mode':{'type':Sequelize[_0x9a77('0x4')](_0x9a77('0x5'),'files',_0x9a77('0x6'),_0x9a77('0x7'),_0x9a77('0x8'),_0x9a77('0x9')),'allowNull':!![],'defaultValue':_0x9a77('0xa')},'directory':{'type':Sequelize[_0x9a77('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x9a77('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x9a77('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x9a77('0x2')],'allowNull':!![],'defaultValue':_0x9a77('0xb')},'format':{'type':Sequelize[_0x9a77('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x9a77('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 3557707..66f6d94 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 _0xe90d=['sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','length','find','body','create','sequelize','files','directory','join','server/files/moh','mode','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','rmdirSync','ValidationError','message','addSound','Sound','save_name','createdAt','root','server/files/sounds/converted','%s.%s','basename','extname','converted_format','format','symlinkSync','Sequelize','removeSound','id2','findOne','unlinkSync','getSounds','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','VoiceMusicOnHold','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0xe86415,_0x4fe3ab){var _0x4dc900=function(_0xc4dd21){while(--_0xc4dd21){_0xe86415['push'](_0xe86415['shift']());}};_0x4dc900(++_0x4fe3ab);}(_0xe90d,0x123));var _0xde90=function(_0x1c80c,_0x20f7ce){_0x1c80c=_0x1c80c-0x0;var _0x347317=_0xe90d[_0x1c80c];return _0x347317;};'use strict';var emlformat=require(_0xde90('0x0'));var rimraf=require(_0xde90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde90('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xde90('0x3'));var Mustache=require(_0xde90('0x4'));var util=require(_0xde90('0x5'));var path=require(_0xde90('0x6'));var sox=require('sox');var csv=require(_0xde90('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde90('0x8'));var _=require(_0xde90('0x9'));var squel=require(_0xde90('0xa'));var crypto=require(_0xde90('0xb'));var jsforce=require(_0xde90('0xc'));var deskjs=require(_0xde90('0xd'));var toCsv=require(_0xde90('0x7'));var querystring=require('querystring');var Papa=require(_0xde90('0xe'));var Redis=require('ioredis');var authService=require(_0xde90('0xf'));var qs=require(_0xde90('0x10'));var as=require(_0xde90('0x11'));var hardwareService=require(_0xde90('0x12'));var logger=require(_0xde90('0x13'))(_0xde90('0x14'));var utils=require(_0xde90('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xde90('0x16'));var db=require(_0xde90('0x17'))['db'];function respondWithStatusCode(_0xc6fbaf,_0x8258dc){_0x8258dc=_0x8258dc||0xcc;return function(_0x63ed0e){if(_0x63ed0e){return _0xc6fbaf['sendStatus'](_0x8258dc);}return _0xc6fbaf[_0xde90('0x18')](_0x8258dc)[_0xde90('0x19')]();};}function respondWithResult(_0x317c18,_0x261853){_0x261853=_0x261853||0xc8;return function(_0x30220b){if(_0x30220b){return _0x317c18[_0xde90('0x18')](_0x261853)[_0xde90('0x1a')](_0x30220b);}};}function respondWithFilteredResult(_0x22633f,_0x27e426){return function(_0x547ef8){if(_0x547ef8){var _0x246383=typeof _0x27e426[_0xde90('0x1b')]===_0xde90('0x1c')&&typeof _0x27e426[_0xde90('0x1d')]==='undefined';var _0x893881=_0x547ef8[_0xde90('0x1e')];var _0x263899=_0x246383?0x0:_0x27e426[_0xde90('0x1b')];var _0x5b4865=_0x246383?_0x547ef8[_0xde90('0x1e')]:_0x27e426['offset']+_0x27e426[_0xde90('0x1d')];var _0x24817b;if(_0x5b4865>=_0x893881){_0x5b4865=_0x893881;_0x24817b=0xc8;}else{_0x24817b=0xce;}_0x22633f[_0xde90('0x18')](_0x24817b);return _0x22633f['set'](_0xde90('0x1f'),_0x263899+'-'+_0x5b4865+'/'+_0x893881)['json'](_0x547ef8);}return null;};}function patchUpdates(_0x250598){return function(_0x119545){try{jsonpatch[_0xde90('0x20')](_0x119545,_0x250598,!![]);}catch(_0x5317d6){return BPromise[_0xde90('0x21')](_0x5317d6);}return _0x119545[_0xde90('0x22')]();};}function saveUpdates(_0x1070bc,_0x523cba){return function(_0x375596){if(_0x375596){return _0x375596[_0xde90('0x23')](_0x1070bc)[_0xde90('0x24')](function(_0x3bc6c1){return _0x3bc6c1;});}return null;};}function removeEntity(_0x485759,_0x51f095){return function(_0x313eff){if(_0x313eff){return _0x313eff['destroy']()[_0xde90('0x24')](function(){var _0x18d10a=_0x313eff[_0xde90('0x25')]({'plain':!![]});var _0x29f064=_0xde90('0x26');return db[_0xde90('0x27')][_0xde90('0x28')]({'where':{'type':_0x29f064,'resourceId':_0x18d10a['id']}})[_0xde90('0x24')](function(){return _0x313eff;});})['then'](function(){_0x485759[_0xde90('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c0ff2,_0x210944){return function(_0x10f041){if(!_0x10f041){_0x2c0ff2[_0xde90('0x29')](0x194);}return _0x10f041;};}function handleError(_0xbf56c6,_0x55f859){_0x55f859=_0x55f859||0x1f4;return function(_0x2bb5c3){logger[_0xde90('0x2a')](_0x2bb5c3[_0xde90('0x2b')]);if(_0x2bb5c3[_0xde90('0x2c')]){delete _0x2bb5c3['name'];}_0xbf56c6[_0xde90('0x18')](_0x55f859)['send'](_0x2bb5c3);};}exports[_0xde90('0x2d')]=function(_0x5d812d,_0x5df18c){var _0x2c99a5={},_0x2301e7={},_0x3f0d84={'count':0x0,'rows':[]};var _0x360c89=_[_0xde90('0x2e')](db[_0xde90('0x2f')]['rawAttributes'],function(_0x48cb93){return{'name':_0x48cb93[_0xde90('0x30')],'type':_0x48cb93[_0xde90('0x31')][_0xde90('0x32')]};});_0x2301e7[_0xde90('0x33')]=_['map'](_0x360c89,_0xde90('0x2c'));_0x2301e7[_0xde90('0x34')]=_[_0xde90('0x35')](_0x5d812d['query']);_0x2301e7['filters']=_[_0xde90('0x36')](_0x2301e7['model'],_0x2301e7[_0xde90('0x34')]);_0x2c99a5[_0xde90('0x37')]=_[_0xde90('0x36')](_0x2301e7[_0xde90('0x33')],qs[_0xde90('0x38')](_0x5d812d['query']['fields']));_0x2c99a5['attributes']=_0x2c99a5[_0xde90('0x37')]['length']?_0x2c99a5[_0xde90('0x37')]:_0x2301e7['model'];if(!_0x5d812d['query'][_0xde90('0x39')](_0xde90('0x3a'))){_0x2c99a5['limit']=qs[_0xde90('0x1d')](_0x5d812d['query'][_0xde90('0x1d')]);_0x2c99a5[_0xde90('0x1b')]=qs[_0xde90('0x1b')](_0x5d812d[_0xde90('0x34')][_0xde90('0x1b')]);}_0x2c99a5[_0xde90('0x3b')]=qs['sort'](_0x5d812d[_0xde90('0x34')][_0xde90('0x3c')]);delete _0x5d812d['query'][_0xde90('0x3c')];_0x2c99a5['where']=qs['filters'](_[_0xde90('0x3d')](_0x5d812d[_0xde90('0x34')],_0x2301e7['filters']),_0x360c89);if(_0x5d812d['query'][_0xde90('0x3e')]){_0x2c99a5[_0xde90('0x3f')]=_[_0xde90('0x40')](_0x2c99a5['where'],{'$or':_[_0xde90('0x2e')](_0x360c89,function(_0x38b8ed){if(_0x38b8ed[_0xde90('0x31')]!=='VIRTUAL'){var _0x115f93={};_0x115f93[_0x38b8ed[_0xde90('0x2c')]]={'$like':'%'+_0x5d812d[_0xde90('0x34')][_0xde90('0x3e')]+'%'};return _0x115f93;}})});}_0x2c99a5=_[_0xde90('0x40')]({},_0x2c99a5,_0x5d812d[_0xde90('0x41')]);var _0xfc77c5={'where':_0x2c99a5[_0xde90('0x3f')]};return db['VoiceMusicOnHold'][_0xde90('0x1e')](_0xfc77c5)[_0xde90('0x24')](function(_0x14e99d){_0x3f0d84[_0xde90('0x1e')]=_0x14e99d;if(_0x5d812d['query'][_0xde90('0x42')]){_0x2c99a5[_0xde90('0x43')]=[{'all':!![]}];}return db[_0xde90('0x2f')][_0xde90('0x44')](_0x2c99a5);})[_0xde90('0x24')](function(_0x3eb0d5){_0x3f0d84[_0xde90('0x45')]=_0x3eb0d5;return _0x3f0d84;})[_0xde90('0x24')](respondWithFilteredResult(_0x5df18c,_0x2c99a5))[_0xde90('0x46')](handleError(_0x5df18c,null));};exports[_0xde90('0x47')]=function(_0x423932,_0x1018ad){var _0x117c5e={'raw':![],'where':{'id':_0x423932[_0xde90('0x48')]['id']}},_0x45789d={};_0x45789d[_0xde90('0x33')]=_[_0xde90('0x35')](db[_0xde90('0x2f')][_0xde90('0x49')]);_0x45789d[_0xde90('0x34')]=_[_0xde90('0x35')](_0x423932[_0xde90('0x34')]);_0x45789d[_0xde90('0x4a')]=_[_0xde90('0x36')](_0x45789d[_0xde90('0x33')],_0x45789d['query']);_0x117c5e[_0xde90('0x37')]=_['intersection'](_0x45789d[_0xde90('0x33')],qs[_0xde90('0x38')](_0x423932[_0xde90('0x34')][_0xde90('0x38')]));_0x117c5e[_0xde90('0x37')]=_0x117c5e[_0xde90('0x37')][_0xde90('0x4b')]?_0x117c5e[_0xde90('0x37')]:_0x45789d[_0xde90('0x33')];if(_0x423932[_0xde90('0x34')]['includeAll']){_0x117c5e[_0xde90('0x43')]=[{'all':!![]}];}_0x117c5e=_[_0xde90('0x40')]({},_0x117c5e,_0x423932[_0xde90('0x41')]);return db[_0xde90('0x2f')][_0xde90('0x4c')](_0x117c5e)[_0xde90('0x24')](handleEntityNotFound(_0x1018ad,null))[_0xde90('0x24')](respondWithResult(_0x1018ad,null))[_0xde90('0x46')](handleError(_0x1018ad,null));};exports[_0xde90('0x23')]=function(_0x4c6673,_0x35cdb8){if(_0x4c6673[_0xde90('0x4d')]['id']){delete _0x4c6673[_0xde90('0x4d')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x4c6673[_0xde90('0x48')]['id']}})[_0xde90('0x24')](handleEntityNotFound(_0x35cdb8,null))[_0xde90('0x24')](saveUpdates(_0x4c6673[_0xde90('0x4d')],null))['then'](respondWithResult(_0x35cdb8,null))[_0xde90('0x46')](handleError(_0x35cdb8,null));};exports[_0xde90('0x4e')]=function(_0x487236,_0x22308d,_0x1dcb1d){return db[_0xde90('0x4f')]['transaction'](function(_0xd84282){if(_0x487236[_0xde90('0x4d')]['mode']===_0xde90('0x50')){_0x487236['body'][_0xde90('0x51')]=path[_0xde90('0x52')](config['root'],_0xde90('0x53'),_0x487236[_0xde90('0x4d')][_0xde90('0x2c')]);}return db[_0xde90('0x2f')][_0xde90('0x4e')](_0x487236[_0xde90('0x4d')],{'transaction':_0xd84282})[_0xde90('0x24')](function(_0x27fe46){if(_0x487236[_0xde90('0x4d')][_0xde90('0x54')]===_0xde90('0x50')){fs[_0xde90('0x55')](_0x27fe46[_0xde90('0x51')],parseInt(_0xde90('0x56'),0x8));}var _0x3206dd=_0x487236['user'][_0xde90('0x25')]({'plain':!![]});if(!_0x3206dd)throw new Error(_0xde90('0x57'));if(_0x3206dd['role']===_0xde90('0x58')){var _0x2d48e1=_0x27fe46[_0xde90('0x25')]({'plain':!![]});return db[_0xde90('0x59')][_0xde90('0x4c')]({'where':{'name':_0xde90('0x26'),'userProfileId':_0x3206dd[_0xde90('0x5a')]},'raw':!![]})['then'](function(_0x1af60c){if(_0x1af60c&&_0x1af60c[_0xde90('0x5b')]===0x0){return db[_0xde90('0x27')][_0xde90('0x4e')]({'name':_0x2d48e1[_0xde90('0x2c')],'resourceId':_0x2d48e1['id'],'type':_0x1af60c[_0xde90('0x2c')],'sectionId':_0x1af60c['id']},{})[_0xde90('0x24')](function(){return _0x27fe46;});}else{return _0x27fe46;}})[_0xde90('0x46')](function(_0x20358c){logger['error'](_0xde90('0x5c'),_0x20358c);});}return _0x27fe46;});})[_0xde90('0x24')](respondWithResult(_0x22308d,0xc9))[_0xde90('0x46')](handleError(_0x22308d,null));};exports[_0xde90('0x28')]=function(_0x15f08b,_0x35dc97,_0x4bc371){var _0x1cc323;return db['VoiceMusicOnHold'][_0xde90('0x4c')]({'where':{'id':_0x15f08b[_0xde90('0x48')]['id']}})[_0xde90('0x24')](function(_0x59d858){if(_0x59d858){return db[_0xde90('0x4f')][_0xde90('0x5d')](function(_0x142a36){return _0x59d858['destroy']({'transaction':_0x142a36,'raw':!![]})['then'](function(_0x10fbc5){if(_0x10fbc5[_0xde90('0x51')]){fs[_0xde90('0x5e')](_0x10fbc5[_0xde90('0x51')])[_0xde90('0x5f')](function(_0x4f512b){fs['unlinkSync'](path['join'](_0x10fbc5[_0xde90('0x51')],_0x4f512b));});fs[_0xde90('0x60')](_0x10fbc5[_0xde90('0x51')]);}return _0x10fbc5;});})[_0xde90('0x46')](function(_0x76d5f7){throw new db['Sequelize'][(_0xde90('0x61'))](_0x76d5f7[_0xde90('0x62')]);});}})['then'](handleEntityNotFound(_0x35dc97,null))[_0xde90('0x24')](removeEntity(_0x35dc97,null))[_0xde90('0x46')](handleError(_0x35dc97,null));};exports[_0xde90('0x63')]=function(_0x3ec1a5,_0x181b45,_0x1f7c70){return db[_0xde90('0x4f')]['transaction'](function(_0x199242){var _0x1a4691;return db[_0xde90('0x2f')]['find']({'where':{'id':_0x3ec1a5['params']['id']}})[_0xde90('0x24')](function(_0x5a6128){if(_0x5a6128){_0x1a4691=_0x5a6128;return _0x5a6128['addSound'](_0x3ec1a5[_0xde90('0x4d')]['id'],{'transaction':_0x199242});}})['then'](function(_0x571b41){if(_0x571b41){return db[_0xde90('0x64')]['findOne']({'where':{'id':_0x3ec1a5[_0xde90('0x4d')]['id']},'attributes':['id',_0xde90('0x2c'),_0xde90('0x65'),'converted_format',_0xde90('0x66')],'raw':!![]});}})[_0xde90('0x24')](function(_0x444182){if(_0x444182){var _0xe5df77=path[_0xde90('0x52')](config[_0xde90('0x67')],_0xde90('0x68'),util['format'](_0xde90('0x69'),path[_0xde90('0x6a')](_0x444182[_0xde90('0x65')],path[_0xde90('0x6b')](_0x444182['save_name'])),_0x444182[_0xde90('0x6c')]));var _0x34e7f8=path[_0xde90('0x52')](config[_0xde90('0x67')],'server/files/moh',_0x1a4691[_0xde90('0x2c')],util[_0xde90('0x6d')](_0xde90('0x69'),_0x444182['name'],_0x444182['converted_format']));fs[_0xde90('0x6e')](_0xe5df77,_0x34e7f8);return _0x444182;}})[_0xde90('0x46')](function(_0x30453f){throw new db[(_0xde90('0x6f'))][(_0xde90('0x61'))](_0x30453f[_0xde90('0x62')]);});})['then'](handleEntityNotFound(_0x181b45,null))[_0xde90('0x24')](respondWithResult(_0x181b45,0xc9))[_0xde90('0x46')](handleError(_0x181b45,null));};exports[_0xde90('0x70')]=function(_0x429fde,_0x2e4cdf,_0x127ee0){return db[_0xde90('0x4f')][_0xde90('0x5d')](function(_0x973343){var _0x47b756;return db[_0xde90('0x2f')]['findOne']({'where':{'id':_0x429fde[_0xde90('0x48')]['id']}})[_0xde90('0x24')](handleEntityNotFound(_0x2e4cdf,null))['then'](function(_0x369488){if(_0x369488){_0x47b756=_0x369488;return _0x369488[_0xde90('0x70')](_0x429fde[_0xde90('0x48')][_0xde90('0x71')]);}})[_0xde90('0x24')](function(_0x56f1e0){if(_0x56f1e0){return db[_0xde90('0x64')][_0xde90('0x72')]({'where':{'id':_0x429fde[_0xde90('0x48')]['id2']},'attributes':['id',_0xde90('0x2c'),_0xde90('0x65'),_0xde90('0x6c'),_0xde90('0x66')],'raw':!![]});}})[_0xde90('0x24')](function(_0x194400){if(_0x194400){fs[_0xde90('0x73')](path[_0xde90('0x52')](_0x47b756[_0xde90('0x51')],util[_0xde90('0x6d')]('%s.%s',_0x194400['name'],_0x194400[_0xde90('0x6c')])));return _0x194400;}})[_0xde90('0x46')](function(_0x7d0d5c){throw new db[(_0xde90('0x6f'))][(_0xde90('0x61'))](_0x7d0d5c[_0xde90('0x62')]);});})[_0xde90('0x24')](handleEntityNotFound(_0x2e4cdf,null))[_0xde90('0x24')](respondWithStatusCode(_0x2e4cdf,0xcc))[_0xde90('0x46')](handleError(_0x2e4cdf,null));};exports[_0xde90('0x74')]=function(_0x20b774,_0x1f0c9c,_0xd19342){var _0x4579b7={};var _0x2dcaed={};var _0x245cda;var _0x28b395;return db[_0xde90('0x2f')]['findOne']({'where':{'id':_0x20b774[_0xde90('0x48')]['id']}})[_0xde90('0x24')](handleEntityNotFound(_0x1f0c9c,null))[_0xde90('0x24')](function(_0x128041){if(_0x128041){_0x245cda=_0x128041;_0x2dcaed[_0xde90('0x33')]=_[_0xde90('0x35')](db[_0xde90('0x64')][_0xde90('0x49')]);_0x2dcaed[_0xde90('0x34')]=_[_0xde90('0x35')](_0x20b774[_0xde90('0x34')]);_0x2dcaed['filters']=_[_0xde90('0x36')](_0x2dcaed[_0xde90('0x33')],_0x2dcaed[_0xde90('0x34')]);_0x4579b7['attributes']=_[_0xde90('0x36')](_0x2dcaed[_0xde90('0x33')],qs[_0xde90('0x38')](_0x20b774[_0xde90('0x34')][_0xde90('0x38')]));_0x4579b7[_0xde90('0x37')]=_0x4579b7['attributes']['length']?_0x4579b7['attributes']:_0x2dcaed['model'];_0x4579b7['order']=qs['sort'](_0x20b774[_0xde90('0x34')][_0xde90('0x3c')]);_0x4579b7[_0xde90('0x3f')]=qs['filters'](_[_0xde90('0x3d')](_0x20b774[_0xde90('0x34')],_0x2dcaed[_0xde90('0x4a')]));if(_0x20b774[_0xde90('0x34')][_0xde90('0x3e')]){_0x4579b7[_0xde90('0x3f')]=_[_0xde90('0x40')](_0x4579b7[_0xde90('0x3f')],{'$or':_['map'](_0x4579b7[_0xde90('0x37')],function(_0x2574e9){var _0x39f8bd={};_0x39f8bd[_0x2574e9]={'$like':'%'+_0x20b774[_0xde90('0x34')][_0xde90('0x3e')]+'%'};return _0x39f8bd;})});}_0x4579b7=_[_0xde90('0x40')]({},_0x4579b7,_0x20b774[_0xde90('0x41')]);return _0x245cda['getSounds'](_0x4579b7);}})[_0xde90('0x24')](function(_0x562848){if(_0x562848){_0x28b395=_0x562848['length'];if(!_0x20b774[_0xde90('0x34')]['hasOwnProperty']('nolimit')){_0x4579b7[_0xde90('0x1d')]=qs['limit'](_0x20b774['query'][_0xde90('0x1d')]);_0x4579b7['offset']=qs[_0xde90('0x1b')](_0x20b774[_0xde90('0x34')]['offset']);}return _0x245cda[_0xde90('0x74')](_0x4579b7);}})[_0xde90('0x24')](function(_0x5ee773){if(_0x5ee773){return _0x5ee773?{'count':_0x28b395,'rows':_0x5ee773}:null;}})[_0xde90('0x24')](respondWithResult(_0x1f0c9c,null))['catch'](handleError(_0x1f0c9c,null));}; \ No newline at end of file +var _0x3ea2=['VoiceMusicOnHold','rows','catch','show','params','body','create','sequelize','transaction','files','directory','join','root','server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','converted_format','createdAt','server/files/sounds/converted','format','basename','save_name','extname','%s.%s','symlinkSync','id2','pick','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','apply','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x58c2d6,_0x54cbe8){var _0x14d36c=function(_0x4ea2bc){while(--_0x4ea2bc){_0x58c2d6['push'](_0x58c2d6['shift']());}};_0x14d36c(++_0x54cbe8);}(_0x3ea2,0x106));var _0x23ea=function(_0x153e72,_0x1cde75){_0x153e72=_0x153e72-0x0;var _0x2d060f=_0x3ea2[_0x153e72];return _0x2d060f;};'use strict';var emlformat=require(_0x23ea('0x0'));var rimraf=require(_0x23ea('0x1'));var zipdir=require(_0x23ea('0x2'));var jsonpatch=require(_0x23ea('0x3'));var rp=require(_0x23ea('0x4'));var moment=require(_0x23ea('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x23ea('0x6'));var util=require(_0x23ea('0x7'));var path=require(_0x23ea('0x8'));var sox=require(_0x23ea('0x9'));var csv=require(_0x23ea('0xa'));var ejs=require(_0x23ea('0xb'));var fs=require('fs');var fs_extra=require(_0x23ea('0xc'));var _=require('lodash');var squel=require(_0x23ea('0xd'));var crypto=require(_0x23ea('0xe'));var jsforce=require(_0x23ea('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x23ea('0xa'));var querystring=require(_0x23ea('0x10'));var Papa=require('papaparse');var Redis=require(_0x23ea('0x11'));var authService=require(_0x23ea('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x23ea('0x13'));var hardwareService=require(_0x23ea('0x14'));var logger=require(_0x23ea('0x15'))(_0x23ea('0x16'));var utils=require('../../config/utils');var config=require(_0x23ea('0x17'));var licenseUtil=require(_0x23ea('0x18'));var db=require(_0x23ea('0x19'))['db'];function respondWithStatusCode(_0x209709,_0x3c176e){_0x3c176e=_0x3c176e||0xcc;return function(_0x143e30){if(_0x143e30){return _0x209709[_0x23ea('0x1a')](_0x3c176e);}return _0x209709['status'](_0x3c176e)[_0x23ea('0x1b')]();};}function respondWithResult(_0x302381,_0x7a2335){_0x7a2335=_0x7a2335||0xc8;return function(_0x201fe0){if(_0x201fe0){return _0x302381[_0x23ea('0x1c')](_0x7a2335)[_0x23ea('0x1d')](_0x201fe0);}};}function respondWithFilteredResult(_0x335eb3,_0x37d0f0){return function(_0x8545ec){if(_0x8545ec){var _0x23214e=typeof _0x37d0f0[_0x23ea('0x1e')]===_0x23ea('0x1f')&&typeof _0x37d0f0['limit']==='undefined';var _0x2cc6a1=_0x8545ec['count'];var _0x21d99c=_0x23214e?0x0:_0x37d0f0[_0x23ea('0x1e')];var _0x2f90de=_0x23214e?_0x8545ec[_0x23ea('0x20')]:_0x37d0f0[_0x23ea('0x1e')]+_0x37d0f0['limit'];var _0x2d0682;if(_0x2f90de>=_0x2cc6a1){_0x2f90de=_0x2cc6a1;_0x2d0682=0xc8;}else{_0x2d0682=0xce;}_0x335eb3[_0x23ea('0x1c')](_0x2d0682);return _0x335eb3['set']('Content-Range',_0x21d99c+'-'+_0x2f90de+'/'+_0x2cc6a1)[_0x23ea('0x1d')](_0x8545ec);}return null;};}function patchUpdates(_0x973dbf){return function(_0x3bc7c0){try{jsonpatch[_0x23ea('0x21')](_0x3bc7c0,_0x973dbf,!![]);}catch(_0x50359a){return BPromise[_0x23ea('0x22')](_0x50359a);}return _0x3bc7c0[_0x23ea('0x23')]();};}function saveUpdates(_0x504d9f,_0x46d2f7){return function(_0x31a765){if(_0x31a765){return _0x31a765[_0x23ea('0x24')](_0x504d9f)[_0x23ea('0x25')](function(_0x3b42e0){return _0x3b42e0;});}return null;};}function removeEntity(_0x599337,_0x20a508){return function(_0x57e7b2){if(_0x57e7b2){return _0x57e7b2[_0x23ea('0x26')]()['then'](function(){var _0x392bc8=_0x57e7b2['get']({'plain':!![]});var _0x3cc422=_0x23ea('0x27');return db[_0x23ea('0x28')][_0x23ea('0x26')]({'where':{'type':_0x3cc422,'resourceId':_0x392bc8['id']}})['then'](function(){return _0x57e7b2;});})['then'](function(){_0x599337['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x520b3c,_0x1a952a){return function(_0x19b601){if(!_0x19b601){_0x520b3c['sendStatus'](0x194);}return _0x19b601;};}function handleError(_0x562d22,_0x5dadb5){_0x5dadb5=_0x5dadb5||0x1f4;return function(_0x3d6916){logger[_0x23ea('0x29')](_0x3d6916[_0x23ea('0x2a')]);if(_0x3d6916['name']){delete _0x3d6916[_0x23ea('0x2b')];}_0x562d22[_0x23ea('0x1c')](_0x5dadb5)['send'](_0x3d6916);};}exports['index']=function(_0x1e2a96,_0x4adb16){var _0x1c09de={},_0x2aaaca={},_0x4ad0ab={'count':0x0,'rows':[]};var _0x359c28=_[_0x23ea('0x2c')](db['VoiceMusicOnHold'][_0x23ea('0x2d')],function(_0x366238){return{'name':_0x366238[_0x23ea('0x2e')],'type':_0x366238[_0x23ea('0x2f')][_0x23ea('0x30')]};});_0x2aaaca['model']=_[_0x23ea('0x2c')](_0x359c28,_0x23ea('0x2b'));_0x2aaaca[_0x23ea('0x31')]=_[_0x23ea('0x32')](_0x1e2a96['query']);_0x2aaaca[_0x23ea('0x33')]=_['intersection'](_0x2aaaca[_0x23ea('0x34')],_0x2aaaca['query']);_0x1c09de[_0x23ea('0x35')]=_[_0x23ea('0x36')](_0x2aaaca[_0x23ea('0x34')],qs['fields'](_0x1e2a96[_0x23ea('0x31')][_0x23ea('0x37')]));_0x1c09de[_0x23ea('0x35')]=_0x1c09de[_0x23ea('0x35')][_0x23ea('0x38')]?_0x1c09de['attributes']:_0x2aaaca['model'];if(!_0x1e2a96[_0x23ea('0x31')][_0x23ea('0x39')]('nolimit')){_0x1c09de[_0x23ea('0x3a')]=qs[_0x23ea('0x3a')](_0x1e2a96[_0x23ea('0x31')][_0x23ea('0x3a')]);_0x1c09de[_0x23ea('0x1e')]=qs[_0x23ea('0x1e')](_0x1e2a96[_0x23ea('0x31')][_0x23ea('0x1e')]);}_0x1c09de[_0x23ea('0x3b')]=qs[_0x23ea('0x3c')](_0x1e2a96[_0x23ea('0x31')][_0x23ea('0x3c')]);delete _0x1e2a96['query']['sort'];_0x1c09de[_0x23ea('0x3d')]=qs[_0x23ea('0x33')](_['pick'](_0x1e2a96[_0x23ea('0x31')],_0x2aaaca['filters']),_0x359c28);if(_0x1e2a96[_0x23ea('0x31')][_0x23ea('0x3e')]){_0x1c09de[_0x23ea('0x3d')]=_[_0x23ea('0x3f')](_0x1c09de['where'],{'$or':_[_0x23ea('0x2c')](_0x359c28,function(_0x6629bd){if(_0x6629bd[_0x23ea('0x2f')]!==_0x23ea('0x40')){var _0xfc14e3={};_0xfc14e3[_0x6629bd[_0x23ea('0x2b')]]={'$like':'%'+_0x1e2a96[_0x23ea('0x31')][_0x23ea('0x3e')]+'%'};return _0xfc14e3;}})});}_0x1c09de=_['merge']({},_0x1c09de,_0x1e2a96[_0x23ea('0x41')]);var _0x19b6f2={'where':_0x1c09de['where']};return db['VoiceMusicOnHold'][_0x23ea('0x20')](_0x19b6f2)[_0x23ea('0x25')](function(_0x4dd05f){_0x4ad0ab[_0x23ea('0x20')]=_0x4dd05f;if(_0x1e2a96[_0x23ea('0x31')][_0x23ea('0x42')]){_0x1c09de[_0x23ea('0x43')]=[{'all':!![]}];}return db[_0x23ea('0x44')]['findAll'](_0x1c09de);})[_0x23ea('0x25')](function(_0x25a142){_0x4ad0ab[_0x23ea('0x45')]=_0x25a142;return _0x4ad0ab;})['then'](respondWithFilteredResult(_0x4adb16,_0x1c09de))[_0x23ea('0x46')](handleError(_0x4adb16,null));};exports[_0x23ea('0x47')]=function(_0x1f838c,_0x5b75cb){var _0x57fb89={'raw':![],'where':{'id':_0x1f838c[_0x23ea('0x48')]['id']}},_0x2c1ded={};_0x2c1ded[_0x23ea('0x34')]=_['keys'](db[_0x23ea('0x44')][_0x23ea('0x2d')]);_0x2c1ded['query']=_[_0x23ea('0x32')](_0x1f838c['query']);_0x2c1ded[_0x23ea('0x33')]=_[_0x23ea('0x36')](_0x2c1ded[_0x23ea('0x34')],_0x2c1ded['query']);_0x57fb89[_0x23ea('0x35')]=_['intersection'](_0x2c1ded[_0x23ea('0x34')],qs[_0x23ea('0x37')](_0x1f838c[_0x23ea('0x31')]['fields']));_0x57fb89['attributes']=_0x57fb89['attributes']['length']?_0x57fb89['attributes']:_0x2c1ded['model'];if(_0x1f838c[_0x23ea('0x31')][_0x23ea('0x42')]){_0x57fb89[_0x23ea('0x43')]=[{'all':!![]}];}_0x57fb89=_[_0x23ea('0x3f')]({},_0x57fb89,_0x1f838c[_0x23ea('0x41')]);return db[_0x23ea('0x44')]['find'](_0x57fb89)[_0x23ea('0x25')](handleEntityNotFound(_0x5b75cb,null))['then'](respondWithResult(_0x5b75cb,null))[_0x23ea('0x46')](handleError(_0x5b75cb,null));};exports[_0x23ea('0x24')]=function(_0x4bba79,_0x22aa41){if(_0x4bba79[_0x23ea('0x49')]['id']){delete _0x4bba79[_0x23ea('0x49')]['id'];}return db[_0x23ea('0x44')]['find']({'where':{'id':_0x4bba79['params']['id']}})[_0x23ea('0x25')](handleEntityNotFound(_0x22aa41,null))[_0x23ea('0x25')](saveUpdates(_0x4bba79[_0x23ea('0x49')],null))['then'](respondWithResult(_0x22aa41,null))['catch'](handleError(_0x22aa41,null));};exports[_0x23ea('0x4a')]=function(_0x450bbf,_0xd0e051,_0x121d7d){return db[_0x23ea('0x4b')][_0x23ea('0x4c')](function(_0x88168d){if(_0x450bbf['body']['mode']===_0x23ea('0x4d')){_0x450bbf['body'][_0x23ea('0x4e')]=path[_0x23ea('0x4f')](config[_0x23ea('0x50')],_0x23ea('0x51'),_0x450bbf[_0x23ea('0x49')][_0x23ea('0x2b')]);}return db['VoiceMusicOnHold'][_0x23ea('0x4a')](_0x450bbf[_0x23ea('0x49')],{'transaction':_0x88168d})[_0x23ea('0x25')](function(_0xd0f81f){if(_0x450bbf[_0x23ea('0x49')]['mode']===_0x23ea('0x4d')){fs[_0x23ea('0x52')](_0xd0f81f[_0x23ea('0x4e')],parseInt('0777',0x8));}var _0x3829e4=_0x450bbf[_0x23ea('0x53')]['get']({'plain':!![]});if(!_0x3829e4)throw new Error(_0x23ea('0x54'));if(_0x3829e4[_0x23ea('0x55')]===_0x23ea('0x53')){var _0x446077=_0xd0f81f['get']({'plain':!![]});return db[_0x23ea('0x56')][_0x23ea('0x57')]({'where':{'name':_0x23ea('0x27'),'userProfileId':_0x3829e4[_0x23ea('0x58')]},'raw':!![]})['then'](function(_0x127986){if(_0x127986&&_0x127986[_0x23ea('0x59')]===0x0){return db[_0x23ea('0x28')][_0x23ea('0x4a')]({'name':_0x446077[_0x23ea('0x2b')],'resourceId':_0x446077['id'],'type':_0x127986[_0x23ea('0x2b')],'sectionId':_0x127986['id']},{})[_0x23ea('0x25')](function(){return _0xd0f81f;});}else{return _0xd0f81f;}})[_0x23ea('0x46')](function(_0x589079){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x589079);});}return _0xd0f81f;});})[_0x23ea('0x25')](respondWithResult(_0xd0e051,0xc9))[_0x23ea('0x46')](handleError(_0xd0e051,null));};exports[_0x23ea('0x26')]=function(_0x50840e,_0x3493c5,_0x4ade61){var _0x1918e5;return db[_0x23ea('0x44')][_0x23ea('0x57')]({'where':{'id':_0x50840e[_0x23ea('0x48')]['id']}})['then'](function(_0x105616){if(_0x105616){return db[_0x23ea('0x4b')][_0x23ea('0x4c')](function(_0x4d83d5){return _0x105616['destroy']({'transaction':_0x4d83d5,'raw':!![]})['then'](function(_0x826b77){if(_0x826b77[_0x23ea('0x4e')]){fs['readdirSync'](_0x826b77[_0x23ea('0x4e')])['forEach'](function(_0x4fed9a){fs[_0x23ea('0x5a')](path[_0x23ea('0x4f')](_0x826b77[_0x23ea('0x4e')],_0x4fed9a));});fs[_0x23ea('0x5b')](_0x826b77[_0x23ea('0x4e')]);}return _0x826b77;});})['catch'](function(_0x29b373){throw new db[(_0x23ea('0x5c'))][(_0x23ea('0x5d'))](_0x29b373[_0x23ea('0x5e')]);});}})[_0x23ea('0x25')](handleEntityNotFound(_0x3493c5,null))[_0x23ea('0x25')](removeEntity(_0x3493c5,null))[_0x23ea('0x46')](handleError(_0x3493c5,null));};exports['addSound']=function(_0x264251,_0x592dce,_0x216534){return db['sequelize'][_0x23ea('0x4c')](function(_0x35ba39){var _0x4da2a3;return db[_0x23ea('0x44')][_0x23ea('0x57')]({'where':{'id':_0x264251[_0x23ea('0x48')]['id']}})['then'](function(_0x501c45){if(_0x501c45){_0x4da2a3=_0x501c45;return _0x501c45[_0x23ea('0x5f')](_0x264251['body']['id'],{'transaction':_0x35ba39});}})[_0x23ea('0x25')](function(_0x502904){if(_0x502904){return db[_0x23ea('0x60')][_0x23ea('0x61')]({'where':{'id':_0x264251[_0x23ea('0x49')]['id']},'attributes':['id',_0x23ea('0x2b'),'save_name',_0x23ea('0x62'),_0x23ea('0x63')],'raw':!![]});}})[_0x23ea('0x25')](function(_0x50c203){if(_0x50c203){var _0x1f6b71=path[_0x23ea('0x4f')](config['root'],_0x23ea('0x64'),util[_0x23ea('0x65')]('%s.%s',path[_0x23ea('0x66')](_0x50c203[_0x23ea('0x67')],path[_0x23ea('0x68')](_0x50c203[_0x23ea('0x67')])),_0x50c203[_0x23ea('0x62')]));var _0x4b8eec=path[_0x23ea('0x4f')](config[_0x23ea('0x50')],_0x23ea('0x51'),_0x4da2a3[_0x23ea('0x2b')],util[_0x23ea('0x65')](_0x23ea('0x69'),_0x50c203[_0x23ea('0x2b')],_0x50c203[_0x23ea('0x62')]));fs[_0x23ea('0x6a')](_0x1f6b71,_0x4b8eec);return _0x50c203;}})[_0x23ea('0x46')](function(_0x5e8c63){throw new db[(_0x23ea('0x5c'))][(_0x23ea('0x5d'))](_0x5e8c63[_0x23ea('0x5e')]);});})[_0x23ea('0x25')](handleEntityNotFound(_0x592dce,null))[_0x23ea('0x25')](respondWithResult(_0x592dce,0xc9))[_0x23ea('0x46')](handleError(_0x592dce,null));};exports['removeSound']=function(_0x3dc1db,_0xd46060,_0x2f6092){return db[_0x23ea('0x4b')]['transaction'](function(_0xc00be8){var _0x47a5a7;return db[_0x23ea('0x44')][_0x23ea('0x61')]({'where':{'id':_0x3dc1db['params']['id']}})[_0x23ea('0x25')](handleEntityNotFound(_0xd46060,null))[_0x23ea('0x25')](function(_0x380e38){if(_0x380e38){_0x47a5a7=_0x380e38;return _0x380e38['removeSound'](_0x3dc1db[_0x23ea('0x48')][_0x23ea('0x6b')]);}})[_0x23ea('0x25')](function(_0x5b2284){if(_0x5b2284){return db[_0x23ea('0x60')][_0x23ea('0x61')]({'where':{'id':_0x3dc1db[_0x23ea('0x48')][_0x23ea('0x6b')]},'attributes':['id',_0x23ea('0x2b'),_0x23ea('0x67'),'converted_format',_0x23ea('0x63')],'raw':!![]});}})['then'](function(_0x873264){if(_0x873264){fs[_0x23ea('0x5a')](path['join'](_0x47a5a7[_0x23ea('0x4e')],util[_0x23ea('0x65')]('%s.%s',_0x873264['name'],_0x873264[_0x23ea('0x62')])));return _0x873264;}})[_0x23ea('0x46')](function(_0xe3f966){throw new db['Sequelize'][(_0x23ea('0x5d'))](_0xe3f966[_0x23ea('0x5e')]);});})['then'](handleEntityNotFound(_0xd46060,null))[_0x23ea('0x25')](respondWithStatusCode(_0xd46060,0xcc))[_0x23ea('0x46')](handleError(_0xd46060,null));};exports['getSounds']=function(_0x7fe12c,_0x244a32,_0xb498fa){var _0x32c837={};var _0x2b8ed5={};var _0xbeed58;var _0x1e6481;return db[_0x23ea('0x44')]['findOne']({'where':{'id':_0x7fe12c[_0x23ea('0x48')]['id']}})['then'](handleEntityNotFound(_0x244a32,null))['then'](function(_0x29e7c6){if(_0x29e7c6){_0xbeed58=_0x29e7c6;_0x2b8ed5[_0x23ea('0x34')]=_[_0x23ea('0x32')](db['Sound']['rawAttributes']);_0x2b8ed5[_0x23ea('0x31')]=_[_0x23ea('0x32')](_0x7fe12c['query']);_0x2b8ed5[_0x23ea('0x33')]=_[_0x23ea('0x36')](_0x2b8ed5[_0x23ea('0x34')],_0x2b8ed5[_0x23ea('0x31')]);_0x32c837[_0x23ea('0x35')]=_['intersection'](_0x2b8ed5[_0x23ea('0x34')],qs[_0x23ea('0x37')](_0x7fe12c[_0x23ea('0x31')][_0x23ea('0x37')]));_0x32c837[_0x23ea('0x35')]=_0x32c837[_0x23ea('0x35')][_0x23ea('0x38')]?_0x32c837[_0x23ea('0x35')]:_0x2b8ed5[_0x23ea('0x34')];_0x32c837[_0x23ea('0x3b')]=qs[_0x23ea('0x3c')](_0x7fe12c[_0x23ea('0x31')]['sort']);_0x32c837[_0x23ea('0x3d')]=qs['filters'](_[_0x23ea('0x6c')](_0x7fe12c[_0x23ea('0x31')],_0x2b8ed5[_0x23ea('0x33')]));if(_0x7fe12c[_0x23ea('0x31')][_0x23ea('0x3e')]){_0x32c837[_0x23ea('0x3d')]=_[_0x23ea('0x3f')](_0x32c837['where'],{'$or':_[_0x23ea('0x2c')](_0x32c837['attributes'],function(_0x16938f){var _0x418ed4={};_0x418ed4[_0x16938f]={'$like':'%'+_0x7fe12c[_0x23ea('0x31')][_0x23ea('0x3e')]+'%'};return _0x418ed4;})});}_0x32c837=_['merge']({},_0x32c837,_0x7fe12c[_0x23ea('0x41')]);return _0xbeed58['getSounds'](_0x32c837);}})[_0x23ea('0x25')](function(_0x252846){if(_0x252846){_0x1e6481=_0x252846[_0x23ea('0x38')];if(!_0x7fe12c['query'][_0x23ea('0x39')]('nolimit')){_0x32c837[_0x23ea('0x3a')]=qs[_0x23ea('0x3a')](_0x7fe12c[_0x23ea('0x31')][_0x23ea('0x3a')]);_0x32c837['offset']=qs[_0x23ea('0x1e')](_0x7fe12c['query'][_0x23ea('0x1e')]);}return _0xbeed58[_0x23ea('0x6d')](_0x32c837);}})[_0x23ea('0x25')](function(_0x432964){if(_0x432964){return _0x432964?{'count':_0x1e6481,'rows':_0x432964}:null;}})[_0x23ea('0x25')](respondWithResult(_0x244a32,null))[_0x23ea('0x46')](handleError(_0x244a32,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 7bc4402..dc416e8 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 _0x8aed=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger','api'];(function(_0x3f5963,_0x3739dd){var _0xcecb22=function(_0x3ee523){while(--_0x3ee523){_0x3f5963['push'](_0x3f5963['shift']());}};_0xcecb22(++_0x3739dd);}(_0x8aed,0x190));var _0xd8ae=function(_0x47eedb,_0x118339){_0x47eedb=_0x47eedb-0x0;var _0x1c07be=_0x8aed[_0x47eedb];return _0x1c07be;};'use strict';var _=require(_0xd8ae('0x0'));var util=require('util');var logger=require(_0xd8ae('0x1'))(_0xd8ae('0x2'));var moment=require(_0xd8ae('0x3'));var BPromise=require(_0xd8ae('0x4'));var rp=require(_0xd8ae('0x5'));var fs=require('fs');var path=require(_0xd8ae('0x6'));var rimraf=require(_0xd8ae('0x7'));var config=require(_0xd8ae('0x8'));var attributes=require(_0xd8ae('0x9'));module['exports']=function(_0x2b8021,_0x12364a){return _0x2b8021[_0xd8ae('0xa')](_0xd8ae('0xb'),attributes,{'tableName':_0xd8ae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0fa=['api','moment','bluebird','path','rimraf','./voiceMusicOnHold.attributes','define','voice_musiconhold','lodash'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc0fa,0x10d));var _0xac0f=function(_0x2df4d7,_0x57da82){_0x2df4d7=_0x2df4d7-0x0;var _0x40787a=_0xc0fa[_0x2df4d7];return _0x40787a;};'use strict';var _=require(_0xac0f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xac0f('0x1'));var moment=require(_0xac0f('0x2'));var BPromise=require(_0xac0f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac0f('0x4'));var rimraf=require(_0xac0f('0x5'));var config=require('../../config/environment');var attributes=require(_0xac0f('0x6'));module['exports']=function(_0x5908c6,_0x28051b){return _0x5908c6[_0xac0f('0x7')]('VoiceMusicOnHold',attributes,{'tableName':_0xac0f('0x8'),'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 3ec5d2b..92ce4a3 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 _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x589636,_0x6d87fd){var _0x57cfa0=function(_0x53d1ae){while(--_0x53d1ae){_0x589636['push'](_0x589636['shift']());}};_0x57cfa0(++_0x6d87fd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x299d3b,_0x5ead22){var _0x4198ab=function(_0x330b38){while(--_0x330b38){_0x299d3b['push'](_0x299d3b['shift']());}};_0x4198ab(++_0x5ead22);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index a674572..12ee06e 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 _0xbcc7=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','/:id/users','/:id/teams','getTeams','post','create','addAgents','addTeams','/:id','update','delete','destroy','removeAgents','multer','util','connect-timeout','fs-extra'];(function(_0x22d581,_0x331408){var _0x5ac3b4=function(_0x4b035a){while(--_0x4b035a){_0x22d581['push'](_0x22d581['shift']());}};_0x5ac3b4(++_0x331408);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x5ecdde,_0x55bf08){_0x5ecdde=_0x5ecdde-0x0;var _0x593585=_0xbcc7[_0x5ecdde];return _0x593585;};'use strict';var multer=require(_0x7bcc('0x0'));var util=require(_0x7bcc('0x1'));var path=require('path');var timeout=require(_0x7bcc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7bcc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7bcc('0x4'));var config=require(_0x7bcc('0x5'));var controller=require('./voicePrefix.controller');router[_0x7bcc('0x6')]('/',auth[_0x7bcc('0x7')](),controller[_0x7bcc('0x8')]);router[_0x7bcc('0x6')](_0x7bcc('0x9'),auth[_0x7bcc('0x7')](),controller['describe']);router[_0x7bcc('0x6')]('/:id',auth[_0x7bcc('0x7')](),controller[_0x7bcc('0xa')]);router['get'](_0x7bcc('0xb'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x7bcc('0xc'),auth[_0x7bcc('0x7')](),controller[_0x7bcc('0xd')]);router[_0x7bcc('0xe')]('/',auth[_0x7bcc('0x7')](),controller[_0x7bcc('0xf')]);router[_0x7bcc('0xe')]('/:id/users',auth[_0x7bcc('0x7')](),controller[_0x7bcc('0x10')]);router[_0x7bcc('0xe')](_0x7bcc('0xc'),auth[_0x7bcc('0x7')](),controller[_0x7bcc('0x11')]);router['put'](_0x7bcc('0x12'),auth[_0x7bcc('0x7')](),controller[_0x7bcc('0x13')]);router[_0x7bcc('0x14')](_0x7bcc('0x12'),auth[_0x7bcc('0x7')](),controller[_0x7bcc('0x15')]);router['delete'](_0x7bcc('0xb'),auth['isAuthenticated'](),controller[_0x7bcc('0x16')]);router[_0x7bcc('0x14')](_0x7bcc('0xc'),auth[_0x7bcc('0x7')](),controller['removeTeams']);module['exports']=router; \ No newline at end of file +var _0x32f6=['isAuthenticated','describe','/:id','show','getAgents','post','create','/:id/users','delete','destroy','removeAgents','/:id/teams','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe'];(function(_0x485116,_0x159f2e){var _0x37c963=function(_0x380b8f){while(--_0x380b8f){_0x485116['push'](_0x485116['shift']());}};_0x37c963(++_0x159f2e);}(_0x32f6,0xbd));var _0x632f=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x32f6[_0x119d5a];return _0x15bff4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x632f('0x0'));var timeout=require(_0x632f('0x1'));var express=require('express');var router=express[_0x632f('0x2')]();var fs_extra=require(_0x632f('0x3'));var auth=require(_0x632f('0x4'));var interaction=require(_0x632f('0x5'));var config=require(_0x632f('0x6'));var controller=require('./voicePrefix.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x632f('0x7')](_0x632f('0x8'),auth[_0x632f('0x9')](),controller[_0x632f('0xa')]);router[_0x632f('0x7')](_0x632f('0xb'),auth[_0x632f('0x9')](),controller[_0x632f('0xc')]);router[_0x632f('0x7')]('/:id/users',auth[_0x632f('0x9')](),controller[_0x632f('0xd')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x632f('0xe')]('/',auth['isAuthenticated'](),controller[_0x632f('0xf')]);router[_0x632f('0xe')](_0x632f('0x10'),auth['isAuthenticated'](),controller['addAgents']);router['post']('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router['put'](_0x632f('0xb'),auth[_0x632f('0x9')](),controller['update']);router[_0x632f('0x11')](_0x632f('0xb'),auth[_0x632f('0x9')](),controller[_0x632f('0x12')]);router['delete'](_0x632f('0x10'),auth[_0x632f('0x9')](),controller[_0x632f('0x13')]);router[_0x632f('0x11')](_0x632f('0x14'),auth[_0x632f('0x9')](),controller['removeTeams']);module[_0x632f('0x15')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 73794a2..b573c77 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 _0x7704=['VIRTUAL','system-','INTEGER','exports','STRING','name'];(function(_0xf6615a,_0x1d6e2c){var _0x362f2e=function(_0xbbe4f3){while(--_0xbbe4f3){_0xf6615a['push'](_0xf6615a['shift']());}};_0x362f2e(++_0x1d6e2c);}(_0x7704,0xe1));var _0x4770=function(_0x159b50,_0x4316ee){_0x159b50=_0x159b50-0x0;var _0x3ac3e7=_0x7704[_0x159b50];return _0x3ac3e7;};'use strict';var Sequelize=require('sequelize');module[_0x4770('0x0')]={'name':{'type':Sequelize[_0x4770('0x1')],'allowNull':![],'unique':_0x4770('0x2')},'prefix':{'type':Sequelize[_0x4770('0x3')],'get':function(_0x373341){return _0x4770('0x4')+this['getDataValue'](_0x4770('0x2'))+'-';}},'description':{'type':Sequelize[_0x4770('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x4770('0x5')]}}; \ No newline at end of file +var _0xf0f5=['system-','getDataValue','INTEGER','exports','STRING','name'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xf0f5,0x75));var _0x5f0f=function(_0x10de99,_0xdd42d){_0x10de99=_0x10de99-0x0;var _0x8550e5=_0xf0f5[_0x10de99];return _0x8550e5;};'use strict';var Sequelize=require('sequelize');module[_0x5f0f('0x0')]={'name':{'type':Sequelize[_0x5f0f('0x1')],'allowNull':![],'unique':_0x5f0f('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x4ae771){return _0x5f0f('0x3')+this[_0x5f0f('0x4')](_0x5f0f('0x2'))+'-';}},'description':{'type':Sequelize[_0x5f0f('0x1')]},'callerIdAll':{'type':Sequelize[_0x5f0f('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x5f0f('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index caaed30..ec3a449 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 _0xdd4f=['lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','send','map','VoicePrefix','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','describe','create','transaction','body','VoiceExtension','find','VoiceExtensionId','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','charAt','update','system-','sequelize','findById','addAgents','spread','ids','emit','userVoicePrefix:save','removeAgents','isArray','getAgents','findOne','rawAttributes','order','getTeams','Team','nolimit','findAll','User','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','removeTeams','userVoicePrefix:remove','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x12aeae,_0x9d7453){var _0x1867e0=function(_0x25dd27){while(--_0x25dd27){_0x12aeae['push'](_0x12aeae['shift']());}};_0x1867e0(++_0x9d7453);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x2b1b72,_0x3b6a38){_0x2b1b72=_0x2b1b72-0x0;var _0x352cb4=_0xdd4f[_0x2b1b72];return _0x352cb4;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var hardwareService=require(_0xfdd4('0x10'));var logger=require(_0xfdd4('0x11'))(_0xfdd4('0x12'));var utils=require(_0xfdd4('0x13'));var config=require(_0xfdd4('0x14'));var licenseUtil=require(_0xfdd4('0x15'));var db=require(_0xfdd4('0x16'))['db'];config[_0xfdd4('0x17')]=_[_0xfdd4('0x18')](config[_0xfdd4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xfdd4('0x19'))(new Redis(config[_0xfdd4('0x17')]));require(_0xfdd4('0x1a'))['register'](socket);function respondWithStatusCode(_0x1b7da1,_0x4aaeee){_0x4aaeee=_0x4aaeee||0xcc;return function(_0x467824){if(_0x467824){return _0x1b7da1[_0xfdd4('0x1b')](_0x4aaeee);}return _0x1b7da1[_0xfdd4('0x1c')](_0x4aaeee)[_0xfdd4('0x1d')]();};}function respondWithResult(_0x37b05f,_0x52cf2c){_0x52cf2c=_0x52cf2c||0xc8;return function(_0x47ed1d){if(_0x47ed1d){return _0x37b05f['status'](_0x52cf2c)[_0xfdd4('0x1e')](_0x47ed1d);}};}function respondWithFilteredResult(_0x216c7e,_0x2eb174){return function(_0x2ccc88){if(_0x2ccc88){var _0x32b5f7=typeof _0x2eb174[_0xfdd4('0x1f')]===_0xfdd4('0x20')&&typeof _0x2eb174[_0xfdd4('0x21')]===_0xfdd4('0x20');var _0x52ce34=_0x2ccc88[_0xfdd4('0x22')];var _0x3e8eac=_0x32b5f7?0x0:_0x2eb174[_0xfdd4('0x1f')];var _0x36e611=_0x32b5f7?_0x2ccc88[_0xfdd4('0x22')]:_0x2eb174[_0xfdd4('0x1f')]+_0x2eb174[_0xfdd4('0x21')];var _0x34dfa8;if(_0x36e611>=_0x52ce34){_0x36e611=_0x52ce34;_0x34dfa8=0xc8;}else{_0x34dfa8=0xce;}_0x216c7e['status'](_0x34dfa8);return _0x216c7e[_0xfdd4('0x23')](_0xfdd4('0x24'),_0x3e8eac+'-'+_0x36e611+'/'+_0x52ce34)[_0xfdd4('0x1e')](_0x2ccc88);}return null;};}function patchUpdates(_0x16e81b){return function(_0xb7856d){try{jsonpatch[_0xfdd4('0x25')](_0xb7856d,_0x16e81b,!![]);}catch(_0x451767){return BPromise[_0xfdd4('0x26')](_0x451767);}return _0xb7856d['save']();};}function saveUpdates(_0x1e14da,_0x1112e8){return function(_0x4397a3){if(_0x4397a3){return _0x4397a3['update'](_0x1e14da)[_0xfdd4('0x27')](function(_0x39b712){return _0x39b712;});}return null;};}function removeEntity(_0xf9c346,_0x2f8268){return function(_0x1ade42){if(_0x1ade42){return _0x1ade42['destroy']()[_0xfdd4('0x27')](function(){var _0x2c88ad=_0x1ade42[_0xfdd4('0x28')]({'plain':!![]});var _0x31e053=_0xfdd4('0x29');return db[_0xfdd4('0x2a')][_0xfdd4('0x2b')]({'where':{'type':_0x31e053,'resourceId':_0x2c88ad['id']}})[_0xfdd4('0x27')](function(){return _0x1ade42;});})['then'](function(){_0xf9c346[_0xfdd4('0x1c')](0xcc)[_0xfdd4('0x1d')]();});}};}function handleEntityNotFound(_0x385a68,_0xef012e){return function(_0x2207ae){if(!_0x2207ae){_0x385a68['sendStatus'](0x194);}return _0x2207ae;};}function handleError(_0xd127b1,_0x3372d2){_0x3372d2=_0x3372d2||0x1f4;return function(_0xbf38b4){logger[_0xfdd4('0x2c')](_0xbf38b4[_0xfdd4('0x2d')]);if(_0xbf38b4['name']){delete _0xbf38b4[_0xfdd4('0x2e')];}_0xd127b1[_0xfdd4('0x1c')](_0x3372d2)[_0xfdd4('0x2f')](_0xbf38b4);};}exports['index']=function(_0x3fd07a,_0x502776){var _0x2a65c8={},_0x2b22f9={},_0x4aa4f2={'count':0x0,'rows':[]};var _0x50b748=_[_0xfdd4('0x30')](db[_0xfdd4('0x31')]['rawAttributes'],function(_0x557d7b){return{'name':_0x557d7b[_0xfdd4('0x32')],'type':_0x557d7b[_0xfdd4('0x33')][_0xfdd4('0x34')]};});_0x2b22f9[_0xfdd4('0x35')]=_[_0xfdd4('0x30')](_0x50b748,_0xfdd4('0x2e'));_0x2b22f9[_0xfdd4('0x36')]=_[_0xfdd4('0x37')](_0x3fd07a[_0xfdd4('0x36')]);_0x2b22f9[_0xfdd4('0x38')]=_[_0xfdd4('0x39')](_0x2b22f9[_0xfdd4('0x35')],_0x2b22f9[_0xfdd4('0x36')]);_0x2a65c8[_0xfdd4('0x3a')]=_[_0xfdd4('0x39')](_0x2b22f9[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x2a65c8[_0xfdd4('0x3a')]=_0x2a65c8[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x2a65c8[_0xfdd4('0x3a')]:_0x2b22f9[_0xfdd4('0x35')];if(!_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3d')]('nolimit')){_0x2a65c8[_0xfdd4('0x21')]=qs[_0xfdd4('0x21')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x2a65c8[_0xfdd4('0x1f')]=qs[_0xfdd4('0x1f')](_0x3fd07a['query'][_0xfdd4('0x1f')]);}_0x2a65c8['order']=qs[_0xfdd4('0x3e')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3e')]);_0x2a65c8[_0xfdd4('0x3f')]=qs['filters'](_[_0xfdd4('0x40')](_0x3fd07a[_0xfdd4('0x36')],_0x2b22f9[_0xfdd4('0x38')]),_0x50b748);if(_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x41')]){_0x2a65c8[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x2a65c8[_0xfdd4('0x3f')],{'$or':_[_0xfdd4('0x30')](_0x50b748,function(_0x83673d){if(_0x83673d['type']!==_0xfdd4('0x43')){var _0x2196f={};_0x2196f[_0x83673d[_0xfdd4('0x2e')]]={'$like':'%'+_0x3fd07a[_0xfdd4('0x36')]['filter']+'%'};return _0x2196f;}})});}_0x2a65c8=_[_0xfdd4('0x42')]({},_0x2a65c8,_0x3fd07a[_0xfdd4('0x44')]);var _0x30524f={'where':_0x2a65c8[_0xfdd4('0x3f')]};return db[_0xfdd4('0x31')]['count'](_0x30524f)[_0xfdd4('0x27')](function(_0x23af2a){_0x4aa4f2[_0xfdd4('0x22')]=_0x23af2a;if(_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x45')]){_0x2a65c8[_0xfdd4('0x46')]=[{'all':!![]}];}return db[_0xfdd4('0x31')]['findAll'](_0x2a65c8);})[_0xfdd4('0x27')](function(_0x586713){_0x4aa4f2[_0xfdd4('0x47')]=_0x586713;return _0x4aa4f2;})[_0xfdd4('0x27')](respondWithFilteredResult(_0x502776,_0x2a65c8))[_0xfdd4('0x48')](handleError(_0x502776,null));};exports[_0xfdd4('0x49')]=function(_0x5367aa,_0x419578){var _0x11e90a={'raw':![],'where':{'id':_0x5367aa[_0xfdd4('0x4a')]['id']}},_0x4d1dfe={};_0x4d1dfe[_0xfdd4('0x35')]=_['keys'](db[_0xfdd4('0x31')]['rawAttributes']);_0x4d1dfe['query']=_['keys'](_0x5367aa[_0xfdd4('0x36')]);_0x4d1dfe[_0xfdd4('0x38')]=_[_0xfdd4('0x39')](_0x4d1dfe['model'],_0x4d1dfe[_0xfdd4('0x36')]);_0x11e90a[_0xfdd4('0x3a')]=_['intersection'](_0x4d1dfe[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x5367aa[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x11e90a[_0xfdd4('0x3a')]=_0x11e90a[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x11e90a[_0xfdd4('0x3a')]:_0x4d1dfe[_0xfdd4('0x35')];if(_0x5367aa[_0xfdd4('0x36')][_0xfdd4('0x45')]){_0x11e90a[_0xfdd4('0x46')]=[{'all':!![]}];}_0x11e90a=_[_0xfdd4('0x42')]({},_0x11e90a,_0x5367aa[_0xfdd4('0x44')]);return db['VoicePrefix']['find'](_0x11e90a)[_0xfdd4('0x27')](handleEntityNotFound(_0x419578,null))[_0xfdd4('0x27')](respondWithResult(_0x419578,null))[_0xfdd4('0x48')](handleError(_0x419578,null));};exports[_0xfdd4('0x2b')]=function(_0x507bf5,_0x3c6828){return db[_0xfdd4('0x31')]['find']({'where':{'id':_0x507bf5['params']['id']}})['then'](handleEntityNotFound(_0x3c6828,null))['then'](removeEntity(_0x3c6828,null))['catch'](handleError(_0x3c6828,null));};exports[_0xfdd4('0x4b')]=function(_0x88e9ef,_0x3a4202){return db[_0xfdd4('0x31')][_0xfdd4('0x4b')]()[_0xfdd4('0x27')](respondWithResult(_0x3a4202,null))['catch'](handleError(_0x3a4202,null));};exports[_0xfdd4('0x4c')]=function(_0x1f521a,_0x1dd417){var _0x2355b5;return db['sequelize'][_0xfdd4('0x4d')](function(_0x8aa0ea){return db['VoicePrefix'][_0xfdd4('0x4c')](_0x1f521a[_0xfdd4('0x4e')],{'transaction':_0x8aa0ea})['then'](function(_0x5467d1){_0x2355b5=_0x5467d1[_0xfdd4('0x28')]({'plain':!![]});return db[_0xfdd4('0x4f')][_0xfdd4('0x50')]({'where':{'id':_0x2355b5[_0xfdd4('0x51')]},'raw':!![]})[_0xfdd4('0x27')](function(_0x1b9979){return createVoicePrefixExtensions(_0x2355b5,_0x1b9979,_0x8aa0ea);});});})[_0xfdd4('0x27')](function(){var _0x3de4fd=_0x1f521a['user'][_0xfdd4('0x28')]({'plain':!![]});if(!_0x3de4fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3de4fd['role']===_0xfdd4('0x52')){var _0x1d9a8d=_0x2355b5;return db['UserProfileSection']['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x3de4fd[_0xfdd4('0x53')]},'raw':!![]})[_0xfdd4('0x27')](function(_0x4dc113){if(_0x4dc113&&_0x4dc113[_0xfdd4('0x54')]===0x0){return db[_0xfdd4('0x2a')][_0xfdd4('0x4c')]({'name':_0x1d9a8d[_0xfdd4('0x2e')],'resourceId':_0x1d9a8d['id'],'type':_0x4dc113[_0xfdd4('0x2e')],'sectionId':_0x4dc113['id']},{})['then'](function(){return _0x2355b5;});}else{return _0x2355b5;}})['catch'](function(_0x483942){logger['error'](_0xfdd4('0x55'),_0x483942);throw _0x483942;});}return _0x2355b5;})[_0xfdd4('0x27')](respondWithResult(_0x1dd417,null))['catch'](handleError(_0x1dd417,null));};function Extension(_0x1eee3d,_0x2abe50,_0x4d4304,_0x45dcc8){this[_0xfdd4('0x56')]='from-sip';this[_0xfdd4('0x57')]=_0x1eee3d;this[_0xfdd4('0x58')]=_0x4d4304;this[_0xfdd4('0x33')]='system';this[_0xfdd4('0x59')]=_0xfdd4('0x5a');this[_0xfdd4('0x5b')]=_0x2abe50;this[_0xfdd4('0x5c')]=_0x45dcc8;}function createVoicePrefixExtensions(_0x5c7be,_0x562417,_0x2cc3e2){return new BPromise(function(_0x2ee4b6,_0x3be4d5){var _0x202124=new Extension(formatPrefixName(_0x5c7be[_0xfdd4('0x5d')]),0x1,_0xfdd4('0x5e'),_0xfdd4('0x5f'));_0x202124[_0xfdd4('0x60')]=_0x5c7be['id'];return db[_0xfdd4('0x4f')]['create'](_0x202124,{'transaction':_0x2cc3e2})[_0xfdd4('0x27')](function(_0x2799b2){var _0x4483e1=_0x2799b2[_0xfdd4('0x28')]({'plain':!![]});var _0x3096fa=_['map'](addVoicePrefixExtensions(_0x5c7be,_0x562417),function(_0x46e7eb){_0x46e7eb[_0xfdd4('0x51')]=_0x4483e1['id'];_0x46e7eb[_0xfdd4('0x60')]=_0x5c7be['id'];return _0x46e7eb;});return db[_0xfdd4('0x4f')][_0xfdd4('0x61')](_0x3096fa,{'transaction':_0x2cc3e2})[_0xfdd4('0x27')](function(_0x180ad9){if(!_0x180ad9){return _0x3be4d5(_0xfdd4('0x62'));}else{return _0x2ee4b6(_0x180ad9);}})[_0xfdd4('0x48')](function(_0x2a0dd8){return _0x3be4d5(_0x2a0dd8);});});;});};function addVoicePrefixExtensions(_0x2fff30,_0x2792c4){var _0x1205b8=[];var _0x527068=formatPrefixName(_0x2fff30[_0xfdd4('0x5d')]);_0x1205b8['push'](new Extension(_0x527068,0x2,_0xfdd4('0x63'),_0xfdd4('0x64')+_0x2fff30[_0xfdd4('0x2e')]));if(_0x2fff30[_0xfdd4('0x65')]){_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x3,_0xfdd4('0x63'),_0xfdd4('0x67')+_0x2fff30[_0xfdd4('0x65')]));}else{_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x3,_0xfdd4('0x5e'),_0xfdd4('0x68')));}_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x4,'goto',_0x2792c4['context']+','+'${EXTEN:'+(0x8+_0x2fff30[_0xfdd4('0x2e')][_0xfdd4('0x3c')])+'}'+','+0x1));return _0x1205b8;}function formatPrefixName(_0x4bb18b){var _0x3a367c='_';for(var _0x3f027b=0x0;_0x3f027b<_0x4bb18b[_0xfdd4('0x3c')];_0x3f027b++){if(_0x4bb18b[_0xfdd4('0x69')](_0x3f027b)=='-'){_0x3a367c+=_0x4bb18b[_0xfdd4('0x69')](_0x3f027b);}else{_0x3a367c+='['+_0x4bb18b['charAt'](_0x3f027b)+']';}}_0x3a367c+='.';return _0x3a367c;}exports[_0xfdd4('0x6a')]=function(_0x297432,_0x3958cd,_0x523085){var _0x366f1c=_0x297432['body'];_0x366f1c[_0xfdd4('0x5d')]=_0xfdd4('0x6b')+_0x366f1c[_0xfdd4('0x2e')]+'-';return db[_0xfdd4('0x6c')]['transaction'](function(_0x2351b6){return db[_0xfdd4('0x31')]['update'](_0x366f1c,{'where':{'id':_0x366f1c['id']},'transaction':_0x2351b6})[_0xfdd4('0x27')](function(){return db[_0xfdd4('0x4f')][_0xfdd4('0x2b')]({'where':{'VoicePrefixId':_0x366f1c['id']},'transaction':_0x2351b6})['then'](function(){return db[_0xfdd4('0x4f')][_0xfdd4('0x50')]({'where':{'id':_0x366f1c[_0xfdd4('0x51')]},'raw':!![]})['then'](function(_0x3f4337){return createVoicePrefixExtensions(_0x366f1c,_0x3f4337,_0x2351b6);});});});})[_0xfdd4('0x27')](function(){return db[_0xfdd4('0x31')][_0xfdd4('0x6d')](_0x366f1c['id']);})[_0xfdd4('0x27')](respondWithResult(_0x3958cd,null))[_0xfdd4('0x48')](handleError(_0x3958cd,null));};exports[_0xfdd4('0x6e')]=function(_0x539d3b,_0x147d54,_0x36b615){return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x539d3b[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x147d54,null))[_0xfdd4('0x27')](function(_0x4987d6){if(_0x4987d6){return _0x4987d6['addAgents'](_0x539d3b[_0xfdd4('0x4e')]['ids'],_['omit'](_0x539d3b[_0xfdd4('0x4e')],['ids','id'])||{})[_0xfdd4('0x6f')](function(_0x51711a){for(var _0x4576ce=0x0;_0x4576ce<_0x539d3b[_0xfdd4('0x4e')][_0xfdd4('0x70')][_0xfdd4('0x3c')];_0x4576ce+=0x1){socket[_0xfdd4('0x71')](_0xfdd4('0x72'),{'UserId':Number(_0x539d3b[_0xfdd4('0x4e')]['ids'][_0x4576ce]),'VoicePrefixId':Number(_0x539d3b['params']['id'])});}return _0x51711a;});}})[_0xfdd4('0x27')](respondWithResult(_0x147d54,null))['catch'](handleError(_0x147d54,null));};exports[_0xfdd4('0x73')]=function(_0x1a82ee,_0x3b205f,_0x1d57f8){return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x1a82ee[_0xfdd4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b205f,null))['then'](function(_0x37a342){if(_0x37a342){return _0x37a342[_0xfdd4('0x73')](_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')])[_0xfdd4('0x27')](function(){if(_[_0xfdd4('0x74')](_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')])){for(var _0xf78c69=0x0;_0xf78c69<_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')][_0xfdd4('0x3c')];_0xf78c69+=0x1){socket[_0xfdd4('0x71')]('userVoicePrefix:remove',{'UserId':Number(_0x1a82ee['query'][_0xfdd4('0x70')][_0xf78c69]),'VoicePrefixId':Number(_0x1a82ee[_0xfdd4('0x4a')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')]),'VoicePrefixId':Number(_0x1a82ee['params']['id'])});}});}})[_0xfdd4('0x27')](respondWithStatusCode(_0x3b205f,null))[_0xfdd4('0x48')](handleError(_0x3b205f,null));};exports[_0xfdd4('0x75')]=function(_0x11db43,_0x5ec62b,_0x25c078){var _0x5d356c={};var _0x3924c7={};var _0x2f65d7;var _0x4783b9;return db[_0xfdd4('0x31')][_0xfdd4('0x76')]({'where':{'id':_0x11db43[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x5ec62b,null))[_0xfdd4('0x27')](function(_0x575bc2){if(_0x575bc2){_0x2f65d7=_0x575bc2;_0x3924c7['model']=_[_0xfdd4('0x37')](db['User'][_0xfdd4('0x77')]);_0x3924c7[_0xfdd4('0x36')]=_[_0xfdd4('0x37')](_0x11db43[_0xfdd4('0x36')]);_0x3924c7[_0xfdd4('0x38')]=_['intersection'](_0x3924c7['model'],_0x3924c7[_0xfdd4('0x36')]);_0x5d356c['attributes']=_[_0xfdd4('0x39')](_0x3924c7['model'],qs[_0xfdd4('0x3b')](_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x5d356c[_0xfdd4('0x3a')]=_0x5d356c[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x5d356c[_0xfdd4('0x3a')]:_0x3924c7[_0xfdd4('0x35')];_0x5d356c[_0xfdd4('0x78')]=qs[_0xfdd4('0x3e')](_0x11db43[_0xfdd4('0x36')]['sort']);_0x5d356c[_0xfdd4('0x3f')]=qs[_0xfdd4('0x38')](_[_0xfdd4('0x40')](_0x11db43[_0xfdd4('0x36')],_0x3924c7[_0xfdd4('0x38')]));if(_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x41')]){_0x5d356c[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x5d356c['where'],{'$or':_['map'](_0x5d356c[_0xfdd4('0x3a')],function(_0x244d6d){var _0x30bd32={};_0x30bd32[_0x244d6d]={'$like':'%'+_0x11db43['query'][_0xfdd4('0x41')]+'%'};return _0x30bd32;})});}_0x5d356c=_[_0xfdd4('0x42')]({},_0x5d356c,_0x11db43[_0xfdd4('0x44')]);return _0x2f65d7[_0xfdd4('0x75')](_0x5d356c);}})['then'](function(_0x5868e6){if(_0x5868e6){_0x4783b9=_0x5868e6[_0xfdd4('0x3c')];if(!_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x3d')]('nolimit')){_0x5d356c[_0xfdd4('0x21')]=qs[_0xfdd4('0x21')](_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x5d356c[_0xfdd4('0x1f')]=qs[_0xfdd4('0x1f')](_0x11db43['query']['offset']);}return _0x2f65d7[_0xfdd4('0x75')](_0x5d356c);}})[_0xfdd4('0x27')](function(_0x6a1410){if(_0x6a1410){return _0x6a1410?{'count':_0x4783b9,'rows':_0x6a1410}:null;}})[_0xfdd4('0x27')](respondWithResult(_0x5ec62b,null))[_0xfdd4('0x48')](handleError(_0x5ec62b,null));};exports[_0xfdd4('0x79')]=function(_0x46edc9,_0x2a4366,_0x5d1a3f){var _0x218d83={};var _0x547c4c={};var _0x464eb0;var _0x1871d6;return db['VoicePrefix'][_0xfdd4('0x76')]({'where':{'id':_0x46edc9[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x2a4366,null))[_0xfdd4('0x27')](function(_0x3cd7ae){if(_0x3cd7ae){_0x464eb0=_0x3cd7ae;_0x547c4c[_0xfdd4('0x35')]=_[_0xfdd4('0x37')](db[_0xfdd4('0x7a')][_0xfdd4('0x77')]);_0x547c4c['query']=_[_0xfdd4('0x37')](_0x46edc9['query']);_0x547c4c[_0xfdd4('0x38')]=_['intersection'](_0x547c4c['model'],_0x547c4c[_0xfdd4('0x36')]);_0x218d83[_0xfdd4('0x3a')]=_[_0xfdd4('0x39')](_0x547c4c[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x46edc9['query'][_0xfdd4('0x3b')]));_0x218d83[_0xfdd4('0x3a')]=_0x218d83[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x218d83[_0xfdd4('0x3a')]:_0x547c4c[_0xfdd4('0x35')];_0x218d83['order']=qs[_0xfdd4('0x3e')](_0x46edc9[_0xfdd4('0x36')]['sort']);_0x218d83['where']=qs[_0xfdd4('0x38')](_[_0xfdd4('0x40')](_0x46edc9[_0xfdd4('0x36')],_0x547c4c['filters']));if(_0x46edc9['query'][_0xfdd4('0x41')]){_0x218d83[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x218d83['where'],{'$or':_['map'](_0x218d83[_0xfdd4('0x3a')],function(_0xd6eb47){var _0x1927ed={};_0x1927ed[_0xd6eb47]={'$like':'%'+_0x46edc9['query'][_0xfdd4('0x41')]+'%'};return _0x1927ed;})});}_0x218d83=_['merge']({},_0x218d83,_0x46edc9[_0xfdd4('0x44')]);return _0x464eb0[_0xfdd4('0x79')](_0x218d83);}})[_0xfdd4('0x27')](function(_0x4e1dbc){if(_0x4e1dbc){_0x1871d6=_0x4e1dbc[_0xfdd4('0x3c')];if(!_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x3d')](_0xfdd4('0x7b'))){_0x218d83[_0xfdd4('0x21')]=qs['limit'](_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x218d83[_0xfdd4('0x1f')]=qs['offset'](_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x1f')]);}return _0x464eb0[_0xfdd4('0x79')](_0x218d83);}})[_0xfdd4('0x27')](function(_0x56e5d3){if(_0x56e5d3){return _0x56e5d3?{'count':_0x1871d6,'rows':_0x56e5d3}:null;}})[_0xfdd4('0x27')](respondWithResult(_0x2a4366,null))['catch'](handleError(_0x2a4366,null));};exports['addTeams']=function(_0x528004,_0x206a59,_0x545475){var _0x5e5362=_0x528004['body'][_0xfdd4('0x70')];var _0x728e25;return db[_0xfdd4('0x7a')][_0xfdd4('0x7c')]({'where':{'id':_0x5e5362},'attributes':['id'],'include':[{'model':db[_0xfdd4('0x7d')],'as':_0xfdd4('0x7e'),'attributes':['id',_0xfdd4('0x2e'),_0xfdd4('0x7f'),_0xfdd4('0x80'),_0xfdd4('0x81')],'raw':!![]}]})[_0xfdd4('0x27')](function(_0x2911ca){if(_0x2911ca){_0x728e25=_0x2911ca;var _0x31303f=_[_0xfdd4('0x82')](_0x2911ca,function(_0x46b927){var _0x450c67=_0x46b927[_0xfdd4('0x28')]({'plain':!![]});return _0x450c67[_0xfdd4('0x7e')];});return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x528004[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](function(_0x189baf){return db[_0xfdd4('0x6c')][_0xfdd4('0x4d')](function(_0x22f93b){return _0x189baf['addTeams'](_0x5e5362,{'transaction':_0x22f93b})[_0xfdd4('0x27')](function(){return BPromise[_0xfdd4('0x83')](_0x728e25,function(_0xaef5e2){return db[_0xfdd4('0x84')][_0xfdd4('0x85')]({'TeamId':_0xaef5e2['id'],'VoicePrefixId':_0x528004['params']['id']},{'transaction':_0x22f93b});});})[_0xfdd4('0x27')](function(){return BPromise[_0xfdd4('0x83')](_0x31303f,function(_0x19b679){return db[_0xfdd4('0x86')][_0xfdd4('0x87')]({'where':{'UserId':_0x19b679['id'],'VoicePrefixId':_0x528004[_0xfdd4('0x4a')]['id']},'transaction':_0x22f93b});});})['then'](function(){_0x31303f[_0xfdd4('0x88')](function(_0x1a9e62){socket[_0xfdd4('0x71')](_0xfdd4('0x72'),{'UserId':_0x1a9e62['id'],'VoicePrefixId':_0x189baf['id']});});});});});}})[_0xfdd4('0x27')](respondWithStatusCode(_0x206a59,null))[_0xfdd4('0x48')](handleError(_0x206a59,null));};exports['removeTeams']=function(_0x2a6a0d,_0x3d82d1,_0x17d272){return db['Team'][_0xfdd4('0x7c')]({'where':{'id':_0x2a6a0d[_0xfdd4('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfdd4('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xfdd4('0x27')](handleEntityNotFound(_0x3d82d1,null))[_0xfdd4('0x27')](function(_0xd07645){var _0x5a3249=_[_0xfdd4('0x30')](_0xd07645,'id');var _0x5b22b1=[];var _0xc9955e=[];var _0x42204a=squel[_0xfdd4('0x89')]();_0x42204a[_0xfdd4('0x8a')](_0xfdd4('0x8b'))[_0xfdd4('0x8c')](_0xfdd4('0x8d'),'tq')[_0xfdd4('0x8e')](_0xfdd4('0x8f'),'ut',_0xfdd4('0x90'))[_0xfdd4('0x3f')]('VoicePrefixId\x20=\x20?',_0x2a6a0d[_0xfdd4('0x4a')]['id']);for(var _0x42a3dc=0x0;_0x42a3dc<_0xd07645[_0xfdd4('0x3c')];_0x42a3dc+=0x1){let _0x26316c=_0xd07645[_0x42a3dc];for(var _0x1e7bbb=0x0;_0x1e7bbb<_0x26316c[_0xfdd4('0x7e')]['length'];_0x1e7bbb+=0x1){let _0xfd0c1=_0x26316c[_0xfdd4('0x7e')][_0x1e7bbb];var _0x2ae92=_0x42204a[_0xfdd4('0x91')]();_0x2ae92['where'](_0xfdd4('0x92'),_0xfd0c1['id']);_0xc9955e[_0xfdd4('0x66')](db['sequelize'][_0xfdd4('0x36')](_0x2ae92[_0xfdd4('0x93')](),{'type':db[_0xfdd4('0x6c')][_0xfdd4('0x94')][_0xfdd4('0x95')]})[_0xfdd4('0x27')](function(_0x191ab6){if(_0x191ab6[_0xfdd4('0x3c')]===0x1){return _0xfd0c1['id'];}else{var _0x1d460f=_[_0xfdd4('0x96')](_[_0xfdd4('0x30')](_0x191ab6,_0xfdd4('0x97')),function(_0x25c508){return _[_0xfdd4('0x98')](_0x5a3249,_0x25c508);});if(_0x1d460f){return _0xfd0c1['id'];}}}));}}return BPromise['all'](_0xc9955e)[_0xfdd4('0x27')](function(_0x349fc6){_0x5b22b1=_(_0x5b22b1)[_0xfdd4('0x99')](_0x349fc6)[_0xfdd4('0x9a')]()['value']();return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x2a6a0d['params']['id']}})[_0xfdd4('0x27')](function(_0x401681){return db[_0xfdd4('0x6c')][_0xfdd4('0x4d')](function(_0x5a7c85){return _0x401681[_0xfdd4('0x9b')](_0x2a6a0d['query'][_0xfdd4('0x70')],{'transaction':_0x5a7c85})[_0xfdd4('0x27')](function(){if(!_['isEmpty'](_0x5b22b1)){return _0x401681[_0xfdd4('0x73')](_0x5b22b1,{'transaction':_0x5a7c85});}})['then'](function(){_0x5b22b1['forEach'](function(_0x10a396){socket[_0xfdd4('0x71')](_0xfdd4('0x9c'),{'UserId':_0x10a396,'VoicePrefixId':_0x401681['id']});});});});});});})[_0xfdd4('0x27')](respondWithStatusCode(_0x3d82d1,null))['catch'](handleError(_0x3d82d1,null));}; \ No newline at end of file +var _0xe511=['bulkCreate','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','prefix','system-','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','Agents','online','voicePause','flatMap','addTeams','each','TeamVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','isEmpty','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','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','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','VoicePrefixes','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','key','query','intersection','attributes','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','include','findAll','rows','show','params','keys','fields','length','options','catch','destroy','describe','create','sequelize','transaction','body','VoiceExtension','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe511,0x16f));var _0x1e51=function(_0x4c8d7e,_0x481321){_0x4c8d7e=_0x4c8d7e-0x0;var _0xf5e4e8=_0xe511[_0x4c8d7e];return _0xf5e4e8;};'use strict';var emlformat=require(_0x1e51('0x0'));var rimraf=require(_0x1e51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e51('0x2'));var rp=require('request-promise');var moment=require(_0x1e51('0x3'));var BPromise=require(_0x1e51('0x4'));var Mustache=require('mustache');var util=require(_0x1e51('0x5'));var path=require(_0x1e51('0x6'));var sox=require(_0x1e51('0x7'));var csv=require(_0x1e51('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e51('0x9'));var _=require(_0x1e51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e51('0xb'));var deskjs=require(_0x1e51('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require(_0x1e51('0xf'));var qs=require(_0x1e51('0x10'));var as=require(_0x1e51('0x11'));var hardwareService=require(_0x1e51('0x12'));var logger=require('../../config/logger')(_0x1e51('0x13'));var utils=require(_0x1e51('0x14'));var config=require(_0x1e51('0x15'));var licenseUtil=require(_0x1e51('0x16'));var db=require(_0x1e51('0x17'))['db'];config[_0x1e51('0x18')]=_['defaults'](config[_0x1e51('0x18')],{'host':_0x1e51('0x19'),'port':0x18eb});var socket=require(_0x1e51('0x1a'))(new Redis(config[_0x1e51('0x18')]));require(_0x1e51('0x1b'))[_0x1e51('0x1c')](socket);function respondWithStatusCode(_0x441c70,_0x467e77){_0x467e77=_0x467e77||0xcc;return function(_0x1cc62a){if(_0x1cc62a){return _0x441c70[_0x1e51('0x1d')](_0x467e77);}return _0x441c70['status'](_0x467e77)[_0x1e51('0x1e')]();};}function respondWithResult(_0x24db4f,_0x4526b4){_0x4526b4=_0x4526b4||0xc8;return function(_0x5857e2){if(_0x5857e2){return _0x24db4f[_0x1e51('0x1f')](_0x4526b4)['json'](_0x5857e2);}};}function respondWithFilteredResult(_0x53d222,_0x1f6f4e){return function(_0x27dcad){if(_0x27dcad){var _0x40ae4c=typeof _0x1f6f4e[_0x1e51('0x20')]===_0x1e51('0x21')&&typeof _0x1f6f4e[_0x1e51('0x22')]==='undefined';var _0x39449b=_0x27dcad['count'];var _0xea581d=_0x40ae4c?0x0:_0x1f6f4e[_0x1e51('0x20')];var _0x309a87=_0x40ae4c?_0x27dcad[_0x1e51('0x23')]:_0x1f6f4e['offset']+_0x1f6f4e['limit'];var _0x4e6a49;if(_0x309a87>=_0x39449b){_0x309a87=_0x39449b;_0x4e6a49=0xc8;}else{_0x4e6a49=0xce;}_0x53d222['status'](_0x4e6a49);return _0x53d222[_0x1e51('0x24')]('Content-Range',_0xea581d+'-'+_0x309a87+'/'+_0x39449b)[_0x1e51('0x25')](_0x27dcad);}return null;};}function patchUpdates(_0x28aacb){return function(_0x415154){try{jsonpatch[_0x1e51('0x26')](_0x415154,_0x28aacb,!![]);}catch(_0x23c85a){return BPromise[_0x1e51('0x27')](_0x23c85a);}return _0x415154[_0x1e51('0x28')]();};}function saveUpdates(_0x461d3d,_0x4bcdd3){return function(_0x4d04c0){if(_0x4d04c0){return _0x4d04c0[_0x1e51('0x29')](_0x461d3d)[_0x1e51('0x2a')](function(_0x2e42b1){return _0x2e42b1;});}return null;};}function removeEntity(_0x1386db,_0x505d79){return function(_0x54d031){if(_0x54d031){return _0x54d031['destroy']()[_0x1e51('0x2a')](function(){var _0x2a1561=_0x54d031[_0x1e51('0x2b')]({'plain':!![]});var _0x5412bc=_0x1e51('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x5412bc,'resourceId':_0x2a1561['id']}})[_0x1e51('0x2a')](function(){return _0x54d031;});})['then'](function(){_0x1386db[_0x1e51('0x1f')](0xcc)[_0x1e51('0x1e')]();});}};}function handleEntityNotFound(_0x56722f,_0x3e6ef2){return function(_0x10ee23){if(!_0x10ee23){_0x56722f[_0x1e51('0x1d')](0x194);}return _0x10ee23;};}function handleError(_0x6862d1,_0x52538c){_0x52538c=_0x52538c||0x1f4;return function(_0x4cf046){logger['error'](_0x4cf046[_0x1e51('0x2d')]);if(_0x4cf046[_0x1e51('0x2e')]){delete _0x4cf046[_0x1e51('0x2e')];}_0x6862d1[_0x1e51('0x1f')](_0x52538c)[_0x1e51('0x2f')](_0x4cf046);};}exports[_0x1e51('0x30')]=function(_0x378206,_0x34701c){var _0x31b678={},_0x3167b6={},_0x27b550={'count':0x0,'rows':[]};var _0x54c84e=_[_0x1e51('0x31')](db[_0x1e51('0x32')][_0x1e51('0x33')],function(_0x12da89){return{'name':_0x12da89[_0x1e51('0x34')],'type':_0x12da89['type'][_0x1e51('0x35')]};});_0x3167b6['model']=_[_0x1e51('0x31')](_0x54c84e,_0x1e51('0x2e'));_0x3167b6[_0x1e51('0x36')]=_['keys'](_0x378206[_0x1e51('0x36')]);_0x3167b6['filters']=_[_0x1e51('0x37')](_0x3167b6['model'],_0x3167b6['query']);_0x31b678[_0x1e51('0x38')]=_[_0x1e51('0x37')](_0x3167b6[_0x1e51('0x39')],qs['fields'](_0x378206[_0x1e51('0x36')]['fields']));_0x31b678[_0x1e51('0x38')]=_0x31b678[_0x1e51('0x38')]['length']?_0x31b678[_0x1e51('0x38')]:_0x3167b6[_0x1e51('0x39')];if(!_0x378206[_0x1e51('0x36')][_0x1e51('0x3a')](_0x1e51('0x3b'))){_0x31b678[_0x1e51('0x22')]=qs['limit'](_0x378206['query'][_0x1e51('0x22')]);_0x31b678['offset']=qs[_0x1e51('0x20')](_0x378206[_0x1e51('0x36')][_0x1e51('0x20')]);}_0x31b678[_0x1e51('0x3c')]=qs[_0x1e51('0x3d')](_0x378206[_0x1e51('0x36')][_0x1e51('0x3d')]);_0x31b678[_0x1e51('0x3e')]=qs[_0x1e51('0x3f')](_[_0x1e51('0x40')](_0x378206[_0x1e51('0x36')],_0x3167b6['filters']),_0x54c84e);if(_0x378206[_0x1e51('0x36')]['filter']){_0x31b678[_0x1e51('0x3e')]=_[_0x1e51('0x41')](_0x31b678[_0x1e51('0x3e')],{'$or':_[_0x1e51('0x31')](_0x54c84e,function(_0x33e516){if(_0x33e516[_0x1e51('0x42')]!==_0x1e51('0x43')){var _0x27b3fd={};_0x27b3fd[_0x33e516[_0x1e51('0x2e')]]={'$like':'%'+_0x378206[_0x1e51('0x36')][_0x1e51('0x44')]+'%'};return _0x27b3fd;}})});}_0x31b678=_['merge']({},_0x31b678,_0x378206['options']);var _0x13da51={'where':_0x31b678[_0x1e51('0x3e')]};return db[_0x1e51('0x32')][_0x1e51('0x23')](_0x13da51)[_0x1e51('0x2a')](function(_0x1a9e0d){_0x27b550[_0x1e51('0x23')]=_0x1a9e0d;if(_0x378206[_0x1e51('0x36')]['includeAll']){_0x31b678[_0x1e51('0x45')]=[{'all':!![]}];}return db[_0x1e51('0x32')][_0x1e51('0x46')](_0x31b678);})[_0x1e51('0x2a')](function(_0xfd96a0){_0x27b550[_0x1e51('0x47')]=_0xfd96a0;return _0x27b550;})[_0x1e51('0x2a')](respondWithFilteredResult(_0x34701c,_0x31b678))['catch'](handleError(_0x34701c,null));};exports[_0x1e51('0x48')]=function(_0x232789,_0x51296e){var _0xfd6521={'raw':![],'where':{'id':_0x232789[_0x1e51('0x49')]['id']}},_0x38e4a7={};_0x38e4a7['model']=_[_0x1e51('0x4a')](db[_0x1e51('0x32')][_0x1e51('0x33')]);_0x38e4a7[_0x1e51('0x36')]=_[_0x1e51('0x4a')](_0x232789[_0x1e51('0x36')]);_0x38e4a7[_0x1e51('0x3f')]=_[_0x1e51('0x37')](_0x38e4a7[_0x1e51('0x39')],_0x38e4a7['query']);_0xfd6521[_0x1e51('0x38')]=_[_0x1e51('0x37')](_0x38e4a7['model'],qs[_0x1e51('0x4b')](_0x232789[_0x1e51('0x36')][_0x1e51('0x4b')]));_0xfd6521['attributes']=_0xfd6521[_0x1e51('0x38')][_0x1e51('0x4c')]?_0xfd6521[_0x1e51('0x38')]:_0x38e4a7['model'];if(_0x232789[_0x1e51('0x36')]['includeAll']){_0xfd6521['include']=[{'all':!![]}];}_0xfd6521=_['merge']({},_0xfd6521,_0x232789[_0x1e51('0x4d')]);return db[_0x1e51('0x32')]['find'](_0xfd6521)['then'](handleEntityNotFound(_0x51296e,null))[_0x1e51('0x2a')](respondWithResult(_0x51296e,null))[_0x1e51('0x4e')](handleError(_0x51296e,null));};exports[_0x1e51('0x4f')]=function(_0x233a5a,_0xf3377b){return db[_0x1e51('0x32')]['find']({'where':{'id':_0x233a5a[_0x1e51('0x49')]['id']}})['then'](handleEntityNotFound(_0xf3377b,null))[_0x1e51('0x2a')](removeEntity(_0xf3377b,null))[_0x1e51('0x4e')](handleError(_0xf3377b,null));};exports['describe']=function(_0x5ea040,_0x479fe6){return db[_0x1e51('0x32')][_0x1e51('0x50')]()[_0x1e51('0x2a')](respondWithResult(_0x479fe6,null))['catch'](handleError(_0x479fe6,null));};exports[_0x1e51('0x51')]=function(_0x1fe669,_0x4226da){var _0x2100d4;return db[_0x1e51('0x52')][_0x1e51('0x53')](function(_0x32fe1f){return db[_0x1e51('0x32')]['create'](_0x1fe669[_0x1e51('0x54')],{'transaction':_0x32fe1f})[_0x1e51('0x2a')](function(_0xeb77ad){_0x2100d4=_0xeb77ad[_0x1e51('0x2b')]({'plain':!![]});return db[_0x1e51('0x55')][_0x1e51('0x56')]({'where':{'id':_0x2100d4['VoiceExtensionId']},'raw':!![]})[_0x1e51('0x2a')](function(_0x4a2c1b){return createVoicePrefixExtensions(_0x2100d4,_0x4a2c1b,_0x32fe1f);});});})['then'](function(){var _0x4807b9=_0x1fe669[_0x1e51('0x57')][_0x1e51('0x2b')]({'plain':!![]});if(!_0x4807b9)throw new Error(_0x1e51('0x58'));if(_0x4807b9['role']===_0x1e51('0x57')){var _0x133576=_0x2100d4;return db[_0x1e51('0x59')]['find']({'where':{'name':_0x1e51('0x2c'),'userProfileId':_0x4807b9[_0x1e51('0x5a')]},'raw':!![]})[_0x1e51('0x2a')](function(_0x570193){if(_0x570193&&_0x570193[_0x1e51('0x5b')]===0x0){return db[_0x1e51('0x5c')][_0x1e51('0x51')]({'name':_0x133576[_0x1e51('0x2e')],'resourceId':_0x133576['id'],'type':_0x570193[_0x1e51('0x2e')],'sectionId':_0x570193['id']},{})[_0x1e51('0x2a')](function(){return _0x2100d4;});}else{return _0x2100d4;}})[_0x1e51('0x4e')](function(_0x607626){logger['error'](_0x1e51('0x5d'),_0x607626);throw _0x607626;});}return _0x2100d4;})[_0x1e51('0x2a')](respondWithResult(_0x4226da,null))['catch'](handleError(_0x4226da,null));};function Extension(_0x5a9d2a,_0x577b19,_0xa39f42,_0x686433){this[_0x1e51('0x5e')]=_0x1e51('0x5f');this[_0x1e51('0x60')]=_0x5a9d2a;this[_0x1e51('0x61')]=_0xa39f42;this[_0x1e51('0x42')]=_0x1e51('0x62');this[_0x1e51('0x63')]='Voice\x20Prefix\x20Extension';this['priority']=_0x577b19;this['appdata']=_0x686433;}function createVoicePrefixExtensions(_0x1d2daf,_0x4048a4,_0x50c202){return new BPromise(function(_0x4e1fa8,_0x1a7297){var _0x114657=new Extension(formatPrefixName(_0x1d2daf['prefix']),0x1,_0x1e51('0x64'),_0x1e51('0x65'));_0x114657[_0x1e51('0x66')]=_0x1d2daf['id'];return db[_0x1e51('0x55')][_0x1e51('0x51')](_0x114657,{'transaction':_0x50c202})[_0x1e51('0x2a')](function(_0x2199e5){var _0x31eae0=_0x2199e5[_0x1e51('0x2b')]({'plain':!![]});var _0x32863f=_['map'](addVoicePrefixExtensions(_0x1d2daf,_0x4048a4),function(_0x178baf){_0x178baf[_0x1e51('0x67')]=_0x31eae0['id'];_0x178baf[_0x1e51('0x66')]=_0x1d2daf['id'];return _0x178baf;});return db[_0x1e51('0x55')][_0x1e51('0x68')](_0x32863f,{'transaction':_0x50c202})[_0x1e51('0x2a')](function(_0x47cc50){if(!_0x47cc50){return _0x1a7297('Extensions\x20creation\x20failed');}else{return _0x4e1fa8(_0x47cc50);}})[_0x1e51('0x4e')](function(_0x1b0459){return _0x1a7297(_0x1b0459);});});;});};function addVoicePrefixExtensions(_0x19ec72,_0x13fb81){var _0x52a439=[];var _0x4bbe62=formatPrefixName(_0x19ec72['prefix']);_0x52a439[_0x1e51('0x69')](new Extension(_0x4bbe62,0x2,_0x1e51('0x6a'),_0x1e51('0x6b')+_0x19ec72[_0x1e51('0x2e')]));if(_0x19ec72[_0x1e51('0x6c')]){_0x52a439['push'](new Extension(_0x4bbe62,0x3,_0x1e51('0x6a'),_0x1e51('0x6d')+_0x19ec72[_0x1e51('0x6c')]));}else{_0x52a439['push'](new Extension(_0x4bbe62,0x3,_0x1e51('0x64'),_0x1e51('0x6e')));}_0x52a439[_0x1e51('0x69')](new Extension(_0x4bbe62,0x4,'goto',_0x13fb81[_0x1e51('0x5e')]+','+_0x1e51('0x6f')+(0x8+_0x19ec72['name']['length'])+'}'+','+0x1));return _0x52a439;}function formatPrefixName(_0x40d5e8){var _0x4d6d41='_';for(var _0x4464bf=0x0;_0x4464bf<_0x40d5e8['length'];_0x4464bf++){if(_0x40d5e8[_0x1e51('0x70')](_0x4464bf)=='-'){_0x4d6d41+=_0x40d5e8[_0x1e51('0x70')](_0x4464bf);}else{_0x4d6d41+='['+_0x40d5e8[_0x1e51('0x70')](_0x4464bf)+']';}}_0x4d6d41+='.';return _0x4d6d41;}exports[_0x1e51('0x29')]=function(_0x5142ed,_0x37f3e6,_0x4c9871){var _0x5eaa16=_0x5142ed[_0x1e51('0x54')];_0x5eaa16[_0x1e51('0x71')]=_0x1e51('0x72')+_0x5eaa16['name']+'-';return db[_0x1e51('0x52')][_0x1e51('0x53')](function(_0x15f15b){return db[_0x1e51('0x32')]['update'](_0x5eaa16,{'where':{'id':_0x5eaa16['id']},'transaction':_0x15f15b})[_0x1e51('0x2a')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x5eaa16['id']},'transaction':_0x15f15b})[_0x1e51('0x2a')](function(){return db['VoiceExtension'][_0x1e51('0x56')]({'where':{'id':_0x5eaa16['VoiceExtensionId']},'raw':!![]})[_0x1e51('0x2a')](function(_0x486508){return createVoicePrefixExtensions(_0x5eaa16,_0x486508,_0x15f15b);});});});})[_0x1e51('0x2a')](function(){return db[_0x1e51('0x32')]['findById'](_0x5eaa16['id']);})[_0x1e51('0x2a')](respondWithResult(_0x37f3e6,null))['catch'](handleError(_0x37f3e6,null));};exports[_0x1e51('0x73')]=function(_0x6dc707,_0x1d2753,_0x18ed16){return db[_0x1e51('0x32')][_0x1e51('0x56')]({'where':{'id':_0x6dc707['params']['id']}})[_0x1e51('0x2a')](handleEntityNotFound(_0x1d2753,null))['then'](function(_0x5556ad){if(_0x5556ad){return _0x5556ad[_0x1e51('0x73')](_0x6dc707[_0x1e51('0x54')][_0x1e51('0x74')],_[_0x1e51('0x75')](_0x6dc707[_0x1e51('0x54')],[_0x1e51('0x74'),'id'])||{})[_0x1e51('0x76')](function(_0x51ef46){for(var _0x39dc12=0x0;_0x39dc12<_0x6dc707[_0x1e51('0x54')][_0x1e51('0x74')]['length'];_0x39dc12+=0x1){socket['emit'](_0x1e51('0x77'),{'UserId':Number(_0x6dc707[_0x1e51('0x54')]['ids'][_0x39dc12]),'VoicePrefixId':Number(_0x6dc707[_0x1e51('0x49')]['id'])});}return _0x51ef46;});}})[_0x1e51('0x2a')](respondWithResult(_0x1d2753,null))['catch'](handleError(_0x1d2753,null));};exports['removeAgents']=function(_0xe96651,_0x49263c,_0x16793c){return db[_0x1e51('0x32')][_0x1e51('0x56')]({'where':{'id':_0xe96651[_0x1e51('0x49')]['id']}})[_0x1e51('0x2a')](handleEntityNotFound(_0x49263c,null))['then'](function(_0x4e3460){if(_0x4e3460){return _0x4e3460[_0x1e51('0x78')](_0xe96651[_0x1e51('0x36')]['ids'])[_0x1e51('0x2a')](function(){if(_[_0x1e51('0x79')](_0xe96651['query'][_0x1e51('0x74')])){for(var _0x57ab4a=0x0;_0x57ab4a<_0xe96651[_0x1e51('0x36')]['ids']['length'];_0x57ab4a+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0xe96651['query']['ids'][_0x57ab4a]),'VoicePrefixId':Number(_0xe96651[_0x1e51('0x49')]['id'])});}}else{socket['emit'](_0x1e51('0x7a'),{'UserId':Number(_0xe96651['query'][_0x1e51('0x74')]),'VoicePrefixId':Number(_0xe96651[_0x1e51('0x49')]['id'])});}});}})[_0x1e51('0x2a')](respondWithStatusCode(_0x49263c,null))['catch'](handleError(_0x49263c,null));};exports[_0x1e51('0x7b')]=function(_0x3ed4b1,_0x4a2b44,_0x2efc56){var _0x49517c={};var _0x101bb9={};var _0x5c4452;var _0x2b4b49;return db[_0x1e51('0x32')][_0x1e51('0x7c')]({'where':{'id':_0x3ed4b1[_0x1e51('0x49')]['id']}})[_0x1e51('0x2a')](handleEntityNotFound(_0x4a2b44,null))[_0x1e51('0x2a')](function(_0x50e359){if(_0x50e359){_0x5c4452=_0x50e359;_0x101bb9[_0x1e51('0x39')]=_['keys'](db[_0x1e51('0x7d')][_0x1e51('0x33')]);_0x101bb9[_0x1e51('0x36')]=_[_0x1e51('0x4a')](_0x3ed4b1['query']);_0x101bb9['filters']=_['intersection'](_0x101bb9[_0x1e51('0x39')],_0x101bb9[_0x1e51('0x36')]);_0x49517c[_0x1e51('0x38')]=_[_0x1e51('0x37')](_0x101bb9['model'],qs[_0x1e51('0x4b')](_0x3ed4b1['query'][_0x1e51('0x4b')]));_0x49517c['attributes']=_0x49517c['attributes'][_0x1e51('0x4c')]?_0x49517c[_0x1e51('0x38')]:_0x101bb9['model'];_0x49517c[_0x1e51('0x3c')]=qs['sort'](_0x3ed4b1[_0x1e51('0x36')]['sort']);_0x49517c[_0x1e51('0x3e')]=qs[_0x1e51('0x3f')](_['pick'](_0x3ed4b1[_0x1e51('0x36')],_0x101bb9['filters']));if(_0x3ed4b1[_0x1e51('0x36')][_0x1e51('0x44')]){_0x49517c[_0x1e51('0x3e')]=_[_0x1e51('0x41')](_0x49517c['where'],{'$or':_[_0x1e51('0x31')](_0x49517c[_0x1e51('0x38')],function(_0x4698b1){var _0x4ff0ff={};_0x4ff0ff[_0x4698b1]={'$like':'%'+_0x3ed4b1['query'][_0x1e51('0x44')]+'%'};return _0x4ff0ff;})});}_0x49517c=_[_0x1e51('0x41')]({},_0x49517c,_0x3ed4b1[_0x1e51('0x4d')]);return _0x5c4452['getAgents'](_0x49517c);}})['then'](function(_0x552f34){if(_0x552f34){_0x2b4b49=_0x552f34[_0x1e51('0x4c')];if(!_0x3ed4b1[_0x1e51('0x36')][_0x1e51('0x3a')]('nolimit')){_0x49517c[_0x1e51('0x22')]=qs[_0x1e51('0x22')](_0x3ed4b1['query'][_0x1e51('0x22')]);_0x49517c[_0x1e51('0x20')]=qs[_0x1e51('0x20')](_0x3ed4b1['query'][_0x1e51('0x20')]);}return _0x5c4452['getAgents'](_0x49517c);}})[_0x1e51('0x2a')](function(_0x2c84a3){if(_0x2c84a3){return _0x2c84a3?{'count':_0x2b4b49,'rows':_0x2c84a3}:null;}})[_0x1e51('0x2a')](respondWithResult(_0x4a2b44,null))[_0x1e51('0x4e')](handleError(_0x4a2b44,null));};exports[_0x1e51('0x7e')]=function(_0x37a7ef,_0x37f26c,_0xa3225a){var _0x10370b={};var _0x5a6e2f={};var _0x5394e1;var _0x4a5daa;return db[_0x1e51('0x32')]['findOne']({'where':{'id':_0x37a7ef[_0x1e51('0x49')]['id']}})[_0x1e51('0x2a')](handleEntityNotFound(_0x37f26c,null))[_0x1e51('0x2a')](function(_0x3a546f){if(_0x3a546f){_0x5394e1=_0x3a546f;_0x5a6e2f[_0x1e51('0x39')]=_[_0x1e51('0x4a')](db[_0x1e51('0x7f')][_0x1e51('0x33')]);_0x5a6e2f[_0x1e51('0x36')]=_['keys'](_0x37a7ef[_0x1e51('0x36')]);_0x5a6e2f[_0x1e51('0x3f')]=_[_0x1e51('0x37')](_0x5a6e2f['model'],_0x5a6e2f[_0x1e51('0x36')]);_0x10370b[_0x1e51('0x38')]=_[_0x1e51('0x37')](_0x5a6e2f['model'],qs[_0x1e51('0x4b')](_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x4b')]));_0x10370b[_0x1e51('0x38')]=_0x10370b[_0x1e51('0x38')]['length']?_0x10370b['attributes']:_0x5a6e2f[_0x1e51('0x39')];_0x10370b['order']=qs['sort'](_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x3d')]);_0x10370b[_0x1e51('0x3e')]=qs[_0x1e51('0x3f')](_[_0x1e51('0x40')](_0x37a7ef[_0x1e51('0x36')],_0x5a6e2f[_0x1e51('0x3f')]));if(_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x44')]){_0x10370b['where']=_[_0x1e51('0x41')](_0x10370b[_0x1e51('0x3e')],{'$or':_[_0x1e51('0x31')](_0x10370b['attributes'],function(_0x5e3a9a){var _0x121591={};_0x121591[_0x5e3a9a]={'$like':'%'+_0x37a7ef[_0x1e51('0x36')]['filter']+'%'};return _0x121591;})});}_0x10370b=_[_0x1e51('0x41')]({},_0x10370b,_0x37a7ef[_0x1e51('0x4d')]);return _0x5394e1['getTeams'](_0x10370b);}})[_0x1e51('0x2a')](function(_0x30f3f4){if(_0x30f3f4){_0x4a5daa=_0x30f3f4[_0x1e51('0x4c')];if(!_0x37a7ef['query'][_0x1e51('0x3a')](_0x1e51('0x3b'))){_0x10370b[_0x1e51('0x22')]=qs[_0x1e51('0x22')](_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x22')]);_0x10370b[_0x1e51('0x20')]=qs[_0x1e51('0x20')](_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x20')]);}return _0x5394e1['getTeams'](_0x10370b);}})['then'](function(_0x41147f){if(_0x41147f){return _0x41147f?{'count':_0x4a5daa,'rows':_0x41147f}:null;}})['then'](respondWithResult(_0x37f26c,null))['catch'](handleError(_0x37f26c,null));};exports['addTeams']=function(_0x251595,_0x53dbbb,_0x159c58){var _0x5494ac=_0x251595[_0x1e51('0x54')][_0x1e51('0x74')];var _0x4859cd;return db[_0x1e51('0x7f')]['findAll']({'where':{'id':_0x5494ac},'attributes':['id'],'include':[{'model':db[_0x1e51('0x7d')],'as':_0x1e51('0x80'),'attributes':['id','name',_0x1e51('0x81'),_0x1e51('0x82'),'interface'],'raw':!![]}]})['then'](function(_0x4e99dd){if(_0x4e99dd){_0x4859cd=_0x4e99dd;var _0x46bea7=_[_0x1e51('0x83')](_0x4e99dd,function(_0x3cc89b){var _0x543c71=_0x3cc89b['get']({'plain':!![]});return _0x543c71[_0x1e51('0x80')];});return db[_0x1e51('0x32')][_0x1e51('0x56')]({'where':{'id':_0x251595['params']['id']}})[_0x1e51('0x2a')](function(_0x20bcb6){return db[_0x1e51('0x52')][_0x1e51('0x53')](function(_0xb339a0){return _0x20bcb6[_0x1e51('0x84')](_0x5494ac,{'transaction':_0xb339a0})['then'](function(){return BPromise[_0x1e51('0x85')](_0x4859cd,function(_0x15ca94){return db[_0x1e51('0x86')]['upsert']({'TeamId':_0x15ca94['id'],'VoicePrefixId':_0x251595['params']['id']},{'transaction':_0xb339a0});});})[_0x1e51('0x2a')](function(){return BPromise['each'](_0x46bea7,function(_0x55c0e9){return db['UserVoicePrefix'][_0x1e51('0x87')]({'where':{'UserId':_0x55c0e9['id'],'VoicePrefixId':_0x251595[_0x1e51('0x49')]['id']},'transaction':_0xb339a0});});})[_0x1e51('0x2a')](function(){_0x46bea7[_0x1e51('0x88')](function(_0x4c5279){socket['emit']('userVoicePrefix:save',{'UserId':_0x4c5279['id'],'VoicePrefixId':_0x20bcb6['id']});});});});});}})[_0x1e51('0x2a')](respondWithStatusCode(_0x53dbbb,null))['catch'](handleError(_0x53dbbb,null));};exports[_0x1e51('0x89')]=function(_0x15ae93,_0x40146c,_0x419043){return db[_0x1e51('0x7f')][_0x1e51('0x46')]({'where':{'id':_0x15ae93[_0x1e51('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1e51('0x7d')],'as':_0x1e51('0x80'),'attributes':['id'],'raw':!![]}]})[_0x1e51('0x2a')](handleEntityNotFound(_0x40146c,null))[_0x1e51('0x2a')](function(_0x478a79){var _0xec29f4=_[_0x1e51('0x31')](_0x478a79,'id');var _0x57c3a2=[];var _0x2b12e9=[];var _0x2ab009=squel[_0x1e51('0x8a')]();_0x2ab009[_0x1e51('0x8b')](_0x1e51('0x8c'))[_0x1e51('0x8d')](_0x1e51('0x8e'),'tq')[_0x1e51('0x8f')](_0x1e51('0x90'),'ut',_0x1e51('0x91'))['where'](_0x1e51('0x92'),_0x15ae93[_0x1e51('0x49')]['id']);for(var _0x42f652=0x0;_0x42f652<_0x478a79[_0x1e51('0x4c')];_0x42f652+=0x1){let _0x131006=_0x478a79[_0x42f652];for(var _0xa5bef1=0x0;_0xa5bef1<_0x131006[_0x1e51('0x80')][_0x1e51('0x4c')];_0xa5bef1+=0x1){let _0x1e1c48=_0x131006[_0x1e51('0x80')][_0xa5bef1];var _0x12d430=_0x2ab009['clone']();_0x12d430[_0x1e51('0x3e')](_0x1e51('0x93'),_0x1e1c48['id']);_0x2b12e9['push'](db['sequelize'][_0x1e51('0x36')](_0x12d430[_0x1e51('0x94')](),{'type':db[_0x1e51('0x52')][_0x1e51('0x95')][_0x1e51('0x96')]})[_0x1e51('0x2a')](function(_0x51114b){if(_0x51114b['length']===0x1){return _0x1e1c48['id'];}else{var _0x290551=_[_0x1e51('0x97')](_['map'](_0x51114b,_0x1e51('0x98')),function(_0x4610e1){return _[_0x1e51('0x99')](_0xec29f4,_0x4610e1);});if(_0x290551){return _0x1e1c48['id'];}}}));}}return BPromise['all'](_0x2b12e9)[_0x1e51('0x2a')](function(_0x304999){_0x57c3a2=_(_0x57c3a2)[_0x1e51('0x9a')](_0x304999)['compact']()[_0x1e51('0x9b')]();return db[_0x1e51('0x32')][_0x1e51('0x56')]({'where':{'id':_0x15ae93[_0x1e51('0x49')]['id']}})['then'](function(_0x2773c3){return db[_0x1e51('0x52')]['transaction'](function(_0x237435){return _0x2773c3[_0x1e51('0x89')](_0x15ae93[_0x1e51('0x36')][_0x1e51('0x74')],{'transaction':_0x237435})['then'](function(){if(!_[_0x1e51('0x9c')](_0x57c3a2)){return _0x2773c3[_0x1e51('0x78')](_0x57c3a2,{'transaction':_0x237435});}})[_0x1e51('0x2a')](function(){_0x57c3a2[_0x1e51('0x88')](function(_0x43b66c){socket['emit'](_0x1e51('0x7a'),{'UserId':_0x43b66c,'VoicePrefixId':_0x2773c3['id']});});});});});});})[_0x1e51('0x2a')](respondWithStatusCode(_0x40146c,null))[_0x1e51('0x4e')](handleError(_0x40146c,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index b14bd9b..c9fe29c 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 _0xca34=['emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove'];(function(_0x3ddbc6,_0x137eac){var _0x478f4b=function(_0x46fa2e){while(--_0x46fa2e){_0x3ddbc6['push'](_0x3ddbc6['shift']());}};_0x478f4b(++_0x137eac);}(_0xca34,0x123));var _0x4ca3=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xca34[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x4ca3('0x0'));var VoicePrefix=require(_0x4ca3('0x1'))['db'][_0x4ca3('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4ca3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4ca3('0x4'),'afterDestroy':_0x4ca3('0x5')};function emitEvent(_0x40a52e){return function(_0x4d26f7,_0x30bae1,_0x1e306b){VoicePrefixEvents[_0x4ca3('0x6')](_0x40a52e+':'+_0x4d26f7['id'],_0x4d26f7);VoicePrefixEvents[_0x4ca3('0x6')](_0x40a52e,_0x4d26f7);_0x1e306b(null);};}for(var e in events){if(events[_0x4ca3('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x4ca3('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x9d9d=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix'];(function(_0x36eeff,_0x228d2f){var _0x4e1bc5=function(_0x4d8027){while(--_0x4d8027){_0x36eeff['push'](_0x36eeff['shift']());}};_0x4e1bc5(++_0x228d2f);}(_0x9d9d,0x1ab));var _0xd9d9=function(_0x22b23a,_0x236605){_0x22b23a=_0x22b23a-0x0;var _0x4a4a76=_0x9d9d[_0x22b23a];return _0x4a4a76;};'use strict';var EventEmitter=require(_0xd9d9('0x0'));var VoicePrefix=require(_0xd9d9('0x1'))['db'][_0xd9d9('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd9d9('0x3'),'afterUpdate':_0xd9d9('0x4'),'afterDestroy':_0xd9d9('0x5')};function emitEvent(_0x2d23da){return function(_0x422a1b,_0x325ad7,_0x291e7c){VoicePrefixEvents[_0xd9d9('0x6')](_0x2d23da+':'+_0x422a1b['id'],_0x422a1b);VoicePrefixEvents['emit'](_0x2d23da,_0x422a1b);_0x291e7c(null);};}for(var e in events){if(events[_0xd9d9('0x7')](e)){var event=events[e];VoicePrefix[_0xd9d9('0x8')](e,emitEvent(event));}}module[_0xd9d9('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 75d2ef0..534ff2c 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 _0x69d5=['path','rimraf','../../config/environment','exports','VoicePrefix','lodash','util','api','request-promise'];(function(_0x1fc170,_0x17a5a9){var _0x289550=function(_0x4eaa19){while(--_0x4eaa19){_0x1fc170['push'](_0x1fc170['shift']());}};_0x289550(++_0x17a5a9);}(_0x69d5,0x7a));var _0x569d=function(_0x597cee,_0x118341){_0x597cee=_0x597cee-0x0;var _0x4f47bb=_0x69d5[_0x597cee];return _0x4f47bb;};'use strict';var _=require(_0x569d('0x0'));var util=require(_0x569d('0x1'));var logger=require('../../config/logger')(_0x569d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x569d('0x3'));var fs=require('fs');var path=require(_0x569d('0x4'));var rimraf=require(_0x569d('0x5'));var config=require(_0x569d('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x569d('0x7')]=function(_0x3f492f,_0x197486){return _0x3f492f['define'](_0x569d('0x8'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa756=['define','util','api','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x2bbf4d,_0xe5c8bb){var _0x8dd663=function(_0x2809da){while(--_0x2809da){_0x2bbf4d['push'](_0x2bbf4d['shift']());}};_0x8dd663(++_0xe5c8bb);}(_0xa756,0x159));var _0x6a75=function(_0x3a678a,_0x61219){_0x3a678a=_0x3a678a-0x0;var _0x3141a6=_0xa756[_0x3a678a];return _0x3141a6;};'use strict';var _=require('lodash');var util=require(_0x6a75('0x0'));var logger=require('../../config/logger')(_0x6a75('0x1'));var moment=require('moment');var BPromise=require(_0x6a75('0x2'));var rp=require(_0x6a75('0x3'));var fs=require('fs');var path=require(_0x6a75('0x4'));var rimraf=require('rimraf');var config=require(_0x6a75('0x5'));var attributes=require('./voicePrefix.attributes');module[_0x6a75('0x6')]=function(_0x436acd,_0x5066b5){return _0x436acd[_0x6a75('0x7')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index ea60fcd..6d1c2ec 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 _0x082a=['message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x28c0cb,_0x4b54f3){var _0x9d54f7=function(_0x293e00){while(--_0x293e00){_0x28c0cb['push'](_0x28c0cb['shift']());}};_0x9d54f7(++_0x4b54f3);}(_0x082a,0x154));var _0xa082=function(_0x5351fb,_0x39aa75){_0x5351fb=_0x5351fb-0x0;var _0x1275f8=_0x082a[_0x5351fb];return _0x1275f8;};'use strict';var _=require('lodash');var util=require(_0xa082('0x0'));var moment=require(_0xa082('0x1'));var BPromise=require(_0xa082('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa082('0x3'));var db=require(_0xa082('0x4'))['db'];var utils=require(_0xa082('0x5'));var logger=require(_0xa082('0x6'))(_0xa082('0x7'));var config=require('../../config/environment');var jayson=require(_0xa082('0x8'));var client=jayson['client'][_0xa082('0x9')]({'port':0x232a});config[_0xa082('0xa')]=_['defaults'](config[_0xa082('0xa')],{'host':_0xa082('0xb'),'port':0x18eb});var socket=require(_0xa082('0xc'))(new Redis(config['redis']));require(_0xa082('0xd'))[_0xa082('0xe')](socket);function respondWithRpcPromise(_0xd359ef,_0x46b66d,_0x7c826c){return new BPromise(function(_0x494ef6,_0x1fcf69){return client[_0xa082('0xf')](_0xd359ef,_0x7c826c)[_0xa082('0x10')](function(_0x5798dc){logger['info'](_0xa082('0x11'),_0x46b66d,_0xa082('0x12'));logger[_0xa082('0x13')](_0xa082('0x14'),_0x46b66d,'request\x20sent',JSON[_0xa082('0x15')](_0x5798dc));if(_0x5798dc[_0xa082('0x16')]){if(_0x5798dc[_0xa082('0x16')][_0xa082('0x17')]===0x1f4){logger[_0xa082('0x16')](_0xa082('0x11'),_0x46b66d,_0x5798dc['error'][_0xa082('0x18')]);return _0x1fcf69(_0x5798dc[_0xa082('0x16')]['message']);}logger[_0xa082('0x16')](_0xa082('0x11'),_0x46b66d,_0x5798dc[_0xa082('0x16')][_0xa082('0x18')]);return _0x494ef6(_0x5798dc['error']['message']);}else{logger[_0xa082('0x19')](_0xa082('0x11'),_0x46b66d,'request\x20sent');_0x494ef6(_0x5798dc[_0xa082('0x1a')]['message']);}})[_0xa082('0x1b')](function(_0x284376){logger[_0xa082('0x16')](_0xa082('0x11'),_0x46b66d,_0x284376);_0x1fcf69(_0x284376);});});} \ No newline at end of file +var _0x6ca3=['result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1c7f48,_0x255687){var _0x274c31=function(_0x58e252){while(--_0x58e252){_0x1c7f48['push'](_0x1c7f48['shift']());}};_0x274c31(++_0x255687);}(_0x6ca3,0xba));var _0x36ca=function(_0x487cb0,_0x339d3e){_0x487cb0=_0x487cb0-0x0;var _0x5a8047=_0x6ca3[_0x487cb0];return _0x5a8047;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x36ca('0x0'));var BPromise=require(_0x36ca('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36ca('0x2'));var db=require(_0x36ca('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x36ca('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x36ca('0x5'));var client=jayson[_0x36ca('0x6')][_0x36ca('0x7')]({'port':0x232a});config[_0x36ca('0x8')]=_['defaults'](config['redis'],{'host':_0x36ca('0x9'),'port':0x18eb});var socket=require(_0x36ca('0xa'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x36ca('0xb')](socket);function respondWithRpcPromise(_0x164357,_0x2f5acf,_0x394c7b){return new BPromise(function(_0x5d42d8,_0x302c9a){return client['request'](_0x164357,_0x394c7b)[_0x36ca('0xc')](function(_0xbe5b53){logger[_0x36ca('0xd')](_0x36ca('0xe'),_0x2f5acf,_0x36ca('0xf'));logger['debug'](_0x36ca('0x10'),_0x2f5acf,_0x36ca('0xf'),JSON[_0x36ca('0x11')](_0xbe5b53));if(_0xbe5b53['error']){if(_0xbe5b53[_0x36ca('0x12')][_0x36ca('0x13')]===0x1f4){logger[_0x36ca('0x12')](_0x36ca('0xe'),_0x2f5acf,_0xbe5b53[_0x36ca('0x12')][_0x36ca('0x14')]);return _0x302c9a(_0xbe5b53[_0x36ca('0x12')][_0x36ca('0x14')]);}logger[_0x36ca('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x2f5acf,_0xbe5b53[_0x36ca('0x12')][_0x36ca('0x14')]);return _0x5d42d8(_0xbe5b53[_0x36ca('0x12')][_0x36ca('0x14')]);}else{logger[_0x36ca('0xd')]('VoicePrefix,\x20%s,\x20%s',_0x2f5acf,'request\x20sent');_0x5d42d8(_0xbe5b53[_0x36ca('0x15')][_0x36ca('0x14')]);}})[_0x36ca('0x16')](function(_0x369e12){logger[_0x36ca('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x2f5acf,_0x369e12);_0x302c9a(_0x369e12);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 379522f..8bf4803 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 _0x4ffe=['remove','removeListener','register','length','./voicePrefix.events','save'];(function(_0x2aaf86,_0x375b59){var _0x289a37=function(_0x2ccc0d){while(--_0x2ccc0d){_0x2aaf86['push'](_0x2aaf86['shift']());}};_0x289a37(++_0x375b59);}(_0x4ffe,0x172));var _0xe4ff=function(_0x2ddd52,_0x4e3b17){_0x2ddd52=_0x2ddd52-0x0;var _0x4bb4ec=_0x4ffe[_0x2ddd52];return _0x4bb4ec;};'use strict';var VoicePrefixEvents=require(_0xe4ff('0x0'));var events=[_0xe4ff('0x1'),_0xe4ff('0x2'),'update'];function createListener(_0x43b348,_0x13bb2f){return function(_0x1ede19){_0x13bb2f['emit'](_0x43b348,_0x1ede19);};}function removeListener(_0x45c5e9,_0x2621fc){return function(){VoicePrefixEvents[_0xe4ff('0x3')](_0x45c5e9,_0x2621fc);};}exports[_0xe4ff('0x4')]=function(_0x68c0c7){for(var _0x50250d=0x0,_0x5eed52=events[_0xe4ff('0x5')];_0x50250d<_0x5eed52;_0x50250d++){var _0x227be1=events[_0x50250d];var _0x2aa67c=createListener('voicePrefix:'+_0x227be1,_0x68c0c7);VoicePrefixEvents['on'](_0x227be1,_0x2aa67c);}}; \ No newline at end of file +var _0xefe3=['./voicePrefix.events','emit','register','length','voicePrefix:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xefe3,0xf5));var _0x3efe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xefe3[_0x122ef9];return _0x42fba0;};'use strict';var VoicePrefixEvents=require(_0x3efe('0x0'));var events=['save','remove','update'];function createListener(_0x336f0f,_0xcd5959){return function(_0x28c2d6){_0xcd5959[_0x3efe('0x1')](_0x336f0f,_0x28c2d6);};}function removeListener(_0x48d77b,_0x11125f){return function(){VoicePrefixEvents['removeListener'](_0x48d77b,_0x11125f);};}exports[_0x3efe('0x2')]=function(_0x4b5006){for(var _0x3a1c0a=0x0,_0x60487e=events[_0x3efe('0x3')];_0x3a1c0a<_0x60487e;_0x3a1c0a++){var _0x195d5d=events[_0x3a1c0a];var _0x30d2e8=createListener(_0x3efe('0x4')+_0x195d5d,_0x4b5006);VoicePrefixEvents['on'](_0x195d5d,_0x30d2e8);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 47cc249..3d266ab 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(_0x3517d9,_0x1e6703){var _0x29a2f4=function(_0x29efb9){while(--_0x29efb9){_0x3517d9['push'](_0x3517d9['shift']());}};_0x29a2f4(++_0x1e6703);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 _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(_0x2f9849,_0x209c0e){var _0x1aefac=function(_0x127084){while(--_0x127084){_0x2f9849['push'](_0x2f9849['shift']());}};_0x1aefac(++_0x209c0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 4c46b2b..2de41a5 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 _0x2c26=['type','dialMethod','outbound','preview','booked','roundrobin','INTEGER','yes','all','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','power','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2c26,0x131));var _0x62c2=function(_0x154ecd,_0x152847){_0x154ecd=_0x154ecd-0x0;var _0x3b2edf=_0x2c26[_0x154ecd];return _0x3b2edf;};'use strict';var Sequelize=require('sequelize');module[_0x62c2('0x0')]={'name':{'type':Sequelize[_0x62c2('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x62c2('0x3')},'musiconhold':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':_0x62c2('0x4')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x62c2('0x2')]('rr',_0x62c2('0x5'),_0x62c2('0x6'),_0x62c2('0x7'),_0x62c2('0x8'),_0x62c2('0x9'),'linear',_0x62c2('0xa'),_0x62c2('0xb')),'allowNull':![],'defaultValue':_0x62c2('0x5'),'set':function(_0x2a54fe){this[_0x62c2('0xc')](_0x62c2('0xd'),_0x2a54fe?_0x2a54fe:_0x62c2('0x9'));},'get':function(){var _0x410d7b=this[_0x62c2('0xe')](_0x62c2('0xf'));var _0x1a52a3=this['getDataValue'](_0x62c2('0x10'));var _0x1714c6=this[_0x62c2('0xe')](_0x62c2('0xd'));if(_0x410d7b===_0x62c2('0x11')){if(_0x1a52a3===_0x62c2('0x12')){return null;}if(_0x1a52a3===_0x62c2('0x13')&&![_0x62c2('0x9'),_0x62c2('0x14')]['includes'](_0x1714c6)){this[_0x62c2('0xc')](_0x62c2('0xd'),_0x62c2('0x9'));}}return _0x1714c6;}},'servicelevel':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x62c2('0x15')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x62c2('0x1')]},'weight':{'type':Sequelize[_0x62c2('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x62c2('0x16'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0x62c2('0x16'),'no',_0x62c2('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x62c2('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x62c2('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x62c2('0x2')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x62c2('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x62c2('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x62c2('0x2')]('yes','no'),'defaultValue':_0x62c2('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x62c2('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x62c2('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x62c2('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x62c2('0x1')]},'queue_youarenext':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x62c2('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x62c2('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x62c2('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x62c2('0x1')]},'periodic_announce':{'type':Sequelize[_0x62c2('0x18')],'set':function(_0x5e1374){this[_0x62c2('0xc')](_0x62c2('0x19'),_0x5e1374?_0x5e1374[_0x62c2('0x1a')](','):[]);},'get':function(){return this[_0x62c2('0xe')](_0x62c2('0x19'))?this[_0x62c2('0xe')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':_0x62c2('0x16'),'set':function(_0x509a45){this[_0x62c2('0xc')](_0x62c2('0x1b'),_0x509a45?_0x509a45[_0x62c2('0x1a')](','):undefined);},'get':function(){return this[_0x62c2('0xe')](_0x62c2('0x1b'))?this[_0x62c2('0xe')](_0x62c2('0x1b'))[_0x62c2('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':'no','set':function(_0x269baa){this[_0x62c2('0xc')](_0x62c2('0x1d'),_0x269baa?_0x269baa[_0x62c2('0x1a')](','):undefined);},'get':function(){return this[_0x62c2('0xe')](_0x62c2('0x1d'))?this['getDataValue'](_0x62c2('0x1d'))[_0x62c2('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x62c2('0x1')]},'description':{'type':Sequelize[_0x62c2('0x1')]},'acw':{'type':Sequelize[_0x62c2('0x1e')],'defaultValue':0x0,'set':function(_0x12ca7a){this[_0x62c2('0xc')](_0x62c2('0x1f'),_0x12ca7a);if(_0x12ca7a){if(this[_0x62c2('0xe')](_0x62c2('0x20'))<0x2){this[_0x62c2('0xc')](_0x62c2('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x12'),'progressive',_0x62c2('0x21'),_0x62c2('0x22'),'booked'),'defaultValue':_0x62c2('0x23'),'comment':_0x62c2('0x24')},'dialLimitChannel':{'type':Sequelize[_0x62c2('0x15')](0x4)[_0x62c2('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x62c2('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x62c2('0x26')},'dialPowerLevel':{'type':Sequelize[_0x62c2('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x62c2('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x62c2('0x2')]('agentBusyFactor',_0x62c2('0x29')),'defaultValue':_0x62c2('0x29'),'comment':_0x62c2('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x62c2('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x62c2('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x62c2('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x62c2('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':_0x62c2('0x2e'),'comment':_0x62c2('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x30')},'dialQueueProject':{'type':Sequelize[_0x62c2('0x1')],'comment':_0x62c2('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)[_0x62c2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x62c2('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x3,'comment':_0x62c2('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)[_0x62c2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x62c2('0x35')},'dialTimezone':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x62c2('0x36')},'dialPrefix':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x37'),_0x62c2('0x38'),_0x62c2('0x39')),'defaultValue':_0x62c2('0x37')},'dialAMDActive':{'type':Sequelize[_0x62c2('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x62c2('0x15')](0x9)[_0x62c2('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x62c2('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x62c2('0x15')](0x9)[_0x62c2('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x62c2('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x62c2('0x15')](0x9)[_0x62c2('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x62c2('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x62c2('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x62c2('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x62c2('0x15')](0x9)[_0x62c2('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x62c2('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x62c2('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x62c2('0x15')](0x9)[_0x62c2('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x62c2('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x62c2('0x15')](0x5)[_0x62c2('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x62c2('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x62c2('0x15')](0x9)[_0x62c2('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x62c2('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x62c2('0x15')](0x5)[_0x62c2('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x62c2('0x42')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x43'),_0x62c2('0x44')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x62c2('0x1')],'comment':_0x62c2('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x62c2('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x62c2('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x62c2('0x45')},'dialCutDigit':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x62c2('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x62c2('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)[_0x62c2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x62c2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)[_0x62c2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x62c2('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x62c2('0x15')],'allowNull':!![],'comment':_0x62c2('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x62c2('0x1e')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1bda1c){if(!_0x1bda1c)this['setDataValue'](_0x62c2('0x4e'),null);this['setDataValue'](_0x62c2('0x4f'),_0x1bda1c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x62c2('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x62c2('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x62c2('0x15')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x62c2('0x1e')],'defaultValue':![]}}; \ No newline at end of file +var _0xbeec=['never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','default','STRING','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','setDataValue','getDataValue','type','dialMethod','strategy','preview','booked','roundrobin','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','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)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xbeec,0x14c));var _0xcbee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbeec[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcbee('0x0'));module[_0xcbee('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcbee('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xcbee('0x3')](_0xcbee('0x4'),'outbound'),'allowNull':![],'defaultValue':_0xcbee('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xcbee('0x5')},'announce':{'type':Sequelize[_0xcbee('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0xcbee('0x3')]('rr',_0xcbee('0x7'),_0xcbee('0x8'),_0xcbee('0x9'),_0xcbee('0xa'),_0xcbee('0xb'),'linear',_0xcbee('0xc'),'rrordered'),'allowNull':![],'defaultValue':_0xcbee('0x7'),'set':function(_0x45618f){this[_0xcbee('0xd')]('strategy',_0x45618f?_0x45618f:_0xcbee('0xb'));},'get':function(){var _0x48da06=this[_0xcbee('0xe')](_0xcbee('0xf'));var _0x1e4817=this[_0xcbee('0xe')](_0xcbee('0x10'));var _0x2e4032=this[_0xcbee('0xe')](_0xcbee('0x11'));if(_0x48da06==='outbound'){if(_0x1e4817===_0xcbee('0x12')){return null;}if(_0x1e4817===_0xcbee('0x13')&&![_0xcbee('0xb'),_0xcbee('0x14')]['includes'](_0x2e4032)){this[_0xcbee('0xd')](_0xcbee('0x11'),_0xcbee('0xb'));}}return _0x2e4032;}},'servicelevel':{'type':Sequelize[_0xcbee('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xcbee('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xcbee('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xcbee('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xcbee('0x6')]},'weight':{'type':Sequelize[_0xcbee('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xcbee('0x3')](_0xcbee('0x16'),'no'),'defaultValue':_0xcbee('0x16')},'autopause':{'type':Sequelize[_0xcbee('0x3')](_0xcbee('0x16'),'no',_0xcbee('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xcbee('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xcbee('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xcbee('0x3')](_0xcbee('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xcbee('0x3')](_0xcbee('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xcbee('0x3')](_0xcbee('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xcbee('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xcbee('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xcbee('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xcbee('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xcbee('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xcbee('0x3')](_0xcbee('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xcbee('0x3')](_0xcbee('0x16'),'no'),'defaultValue':_0xcbee('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xcbee('0x16'),'no',_0xcbee('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xcbee('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xcbee('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xcbee('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xcbee('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xcbee('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xcbee('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xcbee('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xcbee('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xcbee('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xcbee('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xcbee('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xcbee('0x6')]},'queue_quantity1':{'type':Sequelize[_0xcbee('0x6')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xcbee('0x6')]},'queue_less_than':{'type':Sequelize[_0xcbee('0x6')]},'periodic_announce':{'type':Sequelize[_0xcbee('0x19')],'set':function(_0x3ed7d2){this[_0xcbee('0xd')](_0xcbee('0x1a'),_0x3ed7d2?_0x3ed7d2[_0xcbee('0x1b')](','):[]);},'get':function(){return this[_0xcbee('0xe')](_0xcbee('0x1a'))?this['getDataValue'](_0xcbee('0x1a'))[_0xcbee('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0xcbee('0x6')],'defaultValue':_0xcbee('0x16'),'set':function(_0x14fa7a){this[_0xcbee('0xd')]('joinempty',_0x14fa7a?_0x14fa7a[_0xcbee('0x1b')](','):undefined);},'get':function(){return this[_0xcbee('0xe')](_0xcbee('0x1d'))?this[_0xcbee('0xe')]('joinempty')[_0xcbee('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x4f2f5f){this[_0xcbee('0xd')](_0xcbee('0x1e'),_0x4f2f5f?_0x4f2f5f[_0xcbee('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0xcbee('0x1e'))?this[_0xcbee('0xe')](_0xcbee('0x1e'))[_0xcbee('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xcbee('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xcbee('0x3')](_0xcbee('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xcbee('0x6')]},'description':{'type':Sequelize[_0xcbee('0x6')]},'acw':{'type':Sequelize[_0xcbee('0x1f')],'defaultValue':0x0,'set':function(_0x35ddb3){this[_0xcbee('0xd')](_0xcbee('0x20'),_0x35ddb3);if(_0x35ddb3){if(this[_0xcbee('0xe')](_0xcbee('0x21'))<0x2){this[_0xcbee('0xd')](_0xcbee('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xcbee('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xcbee('0x1f')],'defaultValue':0x0,'comment':_0xcbee('0x22')},'dialMethod':{'type':Sequelize[_0xcbee('0x3')](_0xcbee('0x12'),_0xcbee('0x23'),_0xcbee('0x24'),'predictive',_0xcbee('0x13')),'defaultValue':'progressive','comment':_0xcbee('0x25')},'dialLimitChannel':{'type':Sequelize[_0xcbee('0x15')](0x4)[_0xcbee('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xcbee('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xcbee('0x27')},'dialPowerLevel':{'type':Sequelize[_0xcbee('0x28')](0x2)[_0xcbee('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xcbee('0x29')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xcbee('0x2a'),_0xcbee('0x2b')),'defaultValue':_0xcbee('0x2b'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xcbee('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xcbee('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0xcbee('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xcbee('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0xcbee('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcbee('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xcbee('0x6')],'defaultValue':_0xcbee('0x2f'),'comment':_0xcbee('0x30')},'dialQueueTimeout':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xcbee('0x6')],'comment':_0xcbee('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcbee('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xcbee('0x15')](0x5)[_0xcbee('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcbee('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcbee('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0xcbee('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcbee('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'defaultValue':0x3,'comment':_0xcbee('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xcbee('0x15')](0x5)[_0xcbee('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcbee('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xcbee('0x38')},'dialTimezone':{'type':Sequelize[_0xcbee('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xcbee('0x6')],'defaultValue':_0xcbee('0x39')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xcbee('0x3')]('always',_0xcbee('0x3a'),_0xcbee('0x3b')),'defaultValue':_0xcbee('0x3c')},'dialAMDActive':{'type':Sequelize[_0xcbee('0x1f')],'defaultValue':0x0,'comment':_0xcbee('0x3d')},'dialAMDInitialSilence':{'type':Sequelize[_0xcbee('0x15')](0x9)[_0xcbee('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xcbee('0x3e')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xcbee('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xcbee('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xcbee('0x15')](0x9)[_0xcbee('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcbee('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0xcbee('0x15')](0x9)[_0xcbee('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xcbee('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xcbee('0x15')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xcbee('0x15')](0x9)[_0xcbee('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xcbee('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xcbee('0x15')](0x5)[_0xcbee('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xcbee('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xcbee('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xcbee('0x15')](0x5)[_0xcbee('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xcbee('0x43')},'dialRecallInQueue':{'type':Sequelize[_0xcbee('0x1f')],'defaultValue':0x0,'comment':_0xcbee('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0xcbee('0x3')](_0xcbee('0x45'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xcbee('0x6')],'comment':_0xcbee('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xcbee('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xcbee('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcbee('0x46')},'dialCutDigit':{'type':Sequelize[_0xcbee('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcbee('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xcbee('0x15')](0x5)[_0xcbee('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcbee('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0xcbee('0x15')](0x5)[_0xcbee('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcbee('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcbee('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcbee('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xcbee('0x15')](0x5)[_0xcbee('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcbee('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0xcbee('0x15')](0x5)[_0xcbee('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xcbee('0x15')](0x5)[_0xcbee('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcbee('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xcbee('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x213c13){if(!_0x213c13)this[_0xcbee('0xd')]('mandatoryDispositionPauseId',null);this[_0xcbee('0xd')](_0xcbee('0x4d'),_0x213c13);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xcbee('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xcbee('0x15')](0x3)[_0xcbee('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xcbee('0x1f')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 6435dbc..2f76dda 100644 --- a/server/api/voiceQueue/voiceQueue.controller.js +++ b/server/api/voiceQueue/voiceQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','index','VoiceQueue','rawAttributes','fieldName','getOptions','where','include','rows','show','model','keys','query','attributes','intersection','fields','length','includeAll','merge','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','getHoppers','findOne','filters','nolimit','order','sort','pick','VoiceQueueId','filter','CmHopper','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','hasOwnProperty','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','forEach','penalty','Agents','sequelize','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','compact','isEmpty','removeAgents','addAgents','spread','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','toString','cm_contacts','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','select'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x6aa7,0x178));var _0x76aa=function(_0x55579c,_0x1bc809){_0x55579c=_0x55579c-0x0;var _0x3b421a=_0x6aa7[_0x55579c];return _0x3b421a;};'use strict';var moment=require(_0x76aa('0x0'));var BPromise=require('bluebird');var util=require(_0x76aa('0x1'));var _=require(_0x76aa('0x2'));var squel=require(_0x76aa('0x3'));var Redis=require(_0x76aa('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x76aa('0x5'))(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x76aa('0x8')](config['redis'],{'host':_0x76aa('0x9'),'port':0x18eb});var socket=require(_0x76aa('0xa'))(new Redis(config[_0x76aa('0xb')]));require('./voiceQueue.socket')[_0x76aa('0xc')](socket);function respondWithStatusCode(_0x266bd5,_0x3a3f36){_0x3a3f36=_0x3a3f36||0xcc;return function(_0x557d69){if(_0x557d69){return _0x266bd5[_0x76aa('0xd')](_0x3a3f36);}return _0x266bd5[_0x76aa('0xe')](_0x3a3f36)[_0x76aa('0xf')]();};}function respondWithResult(_0x16cb50,_0x37f1ab){_0x37f1ab=_0x37f1ab||0xc8;return function(_0x128435){if(_0x128435){return _0x16cb50[_0x76aa('0xe')](_0x37f1ab)[_0x76aa('0x10')](_0x128435);}};}function respondWithFilteredResult(_0xd6327,_0x17a417){return function(_0x5e5f47){if(_0x5e5f47){var _0x112c39=typeof _0x17a417['offset']===_0x76aa('0x11')&&typeof _0x17a417[_0x76aa('0x12')]===_0x76aa('0x11');var _0x8e44ed=_0x5e5f47[_0x76aa('0x13')];var _0x4e309f=_0x112c39?0x0:_0x17a417['offset'];var _0x2b3b4f=_0x112c39?_0x5e5f47['count']:_0x17a417[_0x76aa('0x14')]+_0x17a417[_0x76aa('0x12')];var _0x5cf594;if(_0x2b3b4f>=_0x8e44ed){_0x2b3b4f=_0x8e44ed;_0x5cf594=0xc8;}else{_0x5cf594=0xce;}_0xd6327[_0x76aa('0xe')](_0x5cf594);return _0xd6327['set'](_0x76aa('0x15'),_0x4e309f+'-'+_0x2b3b4f+'/'+_0x8e44ed)['json'](_0x5e5f47);}return null;};}function saveUpdates(_0x1515e9){return function(_0x413cf6){if(_0x413cf6){return _0x413cf6[_0x76aa('0x16')](_0x1515e9)[_0x76aa('0x17')](function(_0xa1bc7){return _0xa1bc7;});}return null;};}function removeEntity(_0x3ead3f){return function(_0x496902){if(_0x496902){return _0x496902['destroy']()[_0x76aa('0x17')](function(){var _0x454dd3=_0x496902[_0x76aa('0x18')]({'plain':!![]});var _0x15b931=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a'),'ignore':![]},{'name':_0x76aa('0x1b'),'value':_0x76aa('0x1c'),'ignore':![]}];var _0x385157=_(_0x15b931)['filter'](_0x76aa('0x1d'))[_0x76aa('0x1e')](_0x76aa('0x1f'))['value']();if(_[_0x76aa('0x20')](_0x385157,_0x454dd3[_0x76aa('0x21')])){return;}var _0x31252f=_[_0x76aa('0x22')](_0x15b931,[_0x76aa('0x1f'),_0x454dd3[_0x76aa('0x21')]])[_0x76aa('0x23')];return db[_0x76aa('0x24')][_0x76aa('0x25')]({'where':{'type':_0x31252f,'resourceId':_0x454dd3['id']}})[_0x76aa('0x17')](function(){return _0x496902;});})[_0x76aa('0x17')](function(){_0x3ead3f[_0x76aa('0xe')](0xcc)[_0x76aa('0xf')]();});}};}function handleEntityNotFound(_0x4ef9b0){return function(_0xb5e8a9){if(!_0xb5e8a9){_0x4ef9b0[_0x76aa('0xd')](0x194);}return _0xb5e8a9;};}function handleError(_0x25c614,_0x2e7ab4){_0x2e7ab4=_0x2e7ab4||0x1f4;return function(_0xa1e6){logger[_0x76aa('0x26')](_0xa1e6[_0x76aa('0x27')]);if(_0xa1e6[_0x76aa('0x23')]){delete _0xa1e6[_0x76aa('0x23')];}_0x25c614[_0x76aa('0xe')](_0x2e7ab4)['send'](_0xa1e6);};}exports[_0x76aa('0x28')]=function(_0x5a8030,_0x994550){var _0x365ff8={};var _0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=_[_0x76aa('0x1e')](db[_0x76aa('0x29')][_0x76aa('0x2a')],function(_0x3827ec){return{'name':_0x3827ec[_0x76aa('0x2b')],'type':_0x3827ec[_0x76aa('0x21')]['key']};});_0x365ff8=qs[_0x76aa('0x2c')](_0x1e90b9,_0x5a8030);var _0x5532c7={'where':_0x365ff8[_0x76aa('0x2d')]};return db[_0x76aa('0x29')][_0x76aa('0x13')](_0x5532c7)[_0x76aa('0x17')](function(_0x35a705){_0x2dec94['count']=_0x35a705;_0x365ff8[_0x76aa('0x2e')]=qs[_0x76aa('0x2e')](_0x5a8030['query']);return db[_0x76aa('0x29')]['findAll'](_0x365ff8);})[_0x76aa('0x17')](function(_0x4c90b6){_0x2dec94[_0x76aa('0x2f')]=_0x4c90b6;return _0x2dec94;})['then'](respondWithFilteredResult(_0x994550,_0x365ff8))['catch'](handleError(_0x994550,null));};exports[_0x76aa('0x30')]=function(_0x282c56,_0x198fcb){var _0x37dfab={'raw':![],'where':{'id':_0x282c56['params']['id']}},_0x595a0f={};_0x595a0f[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')][_0x76aa('0x2a')]);_0x595a0f[_0x76aa('0x33')]=_['keys'](_0x282c56[_0x76aa('0x33')]);_0x595a0f['filters']=_['intersection'](_0x595a0f[_0x76aa('0x31')],_0x595a0f[_0x76aa('0x33')]);_0x37dfab[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x595a0f['model'],qs[_0x76aa('0x36')](_0x282c56[_0x76aa('0x33')][_0x76aa('0x36')]));_0x37dfab['attributes']=_0x37dfab[_0x76aa('0x34')][_0x76aa('0x37')]?_0x37dfab[_0x76aa('0x34')]:_0x595a0f[_0x76aa('0x31')];if(_0x282c56[_0x76aa('0x33')][_0x76aa('0x38')]){_0x37dfab[_0x76aa('0x2e')]=[{'all':!![]}];}_0x37dfab=_[_0x76aa('0x39')]({},_0x37dfab,_0x282c56[_0x76aa('0x3a')]);return db['VoiceQueue'][_0x76aa('0x22')](_0x37dfab)[_0x76aa('0x17')](handleEntityNotFound(_0x198fcb,null))[_0x76aa('0x17')](respondWithResult(_0x198fcb,null))[_0x76aa('0x3b')](handleError(_0x198fcb,null));};exports[_0x76aa('0x3c')]=function(_0x2957aa,_0x572fdb){return db['VoiceQueue'][_0x76aa('0x3c')](_0x2957aa[_0x76aa('0x3d')],{})[_0x76aa('0x17')](function(_0x365612){var _0x50599f=_0x2957aa[_0x76aa('0x3e')][_0x76aa('0x18')]({'plain':!![]});if(!_0x50599f)throw new Error(_0x76aa('0x3f'));if(_0x50599f[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x4aa2f3=_0x365612[_0x76aa('0x18')]({'plain':!![]});var _0x556f59=[{'name':_0x76aa('0x19'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x144f0a=_['find'](_0x556f59,['value',_0x4aa2f3['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x144f0a,'userProfileId':_0x50599f[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0x47b0c8){if(_0x47b0c8&&_0x47b0c8[_0x76aa('0x43')]===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x4aa2f3[_0x76aa('0x23')],'resourceId':_0x4aa2f3['id'],'type':_0x47b0c8[_0x76aa('0x23')],'sectionId':_0x47b0c8['id']},{})['then'](function(){return _0x365612;});}else{return _0x365612;}})[_0x76aa('0x3b')](function(_0x1c62a9){logger['error'](_0x76aa('0x44'),_0x1c62a9);throw _0x1c62a9;});}return _0x365612;})['then'](respondWithResult(_0x572fdb,0xc9))[_0x76aa('0x3b')](handleError(_0x572fdb,null));};exports[_0x76aa('0x45')]=function(_0x31930b,_0x18fd3e){var _0x2d0bc4={'where':{'id':_0x31930b[_0x76aa('0x46')]['id']}},_0x3e0315={};_0x3e0315[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')]['rawAttributes']);_0x2d0bc4[_0x76aa('0x34')]=_['intersection'](_0x3e0315[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x31930b[_0x76aa('0x33')][_0x76aa('0x36')]));_0x2d0bc4['attributes']=_0x2d0bc4['attributes'][_0x76aa('0x37')]?_0x2d0bc4['attributes']:_0x3e0315[_0x76aa('0x31')];if(_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]){_0x2d0bc4[_0x76aa('0x2e')]=[{'all':!![]}];}_0x2d0bc4=_[_0x76aa('0x39')]({},_0x2d0bc4,_0x31930b[_0x76aa('0x3a')]);return db['VoiceQueue']['find'](_0x2d0bc4)[_0x76aa('0x17')](handleEntityNotFound(_0x18fd3e,null))[_0x76aa('0x17')](function(_0x1708d4){if(_0x1708d4){var _0x40e8ff=_0x1708d4[_0x76aa('0x18')]({'plain':!![]});_0x40e8ff=qs[_0x76aa('0x47')](_0x40e8ff,['id','createdAt',_0x76aa('0x48')]);_0x31930b[_0x76aa('0x3d')]=_[_0x76aa('0x47')](_0x31930b['body'],['id',_0x76aa('0x49'),'updatedAt']);return db[_0x76aa('0x29')]['create'](_[_0x76aa('0x39')](_0x40e8ff,_0x31930b[_0x76aa('0x3d')]),{'include':_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]?[{'all':!![]}]:undefined})[_0x76aa('0x17')](function(_0x316de3){var _0x953726=_0x31930b['user'][_0x76aa('0x18')]({'plain':!![]});if(!_0x953726)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x953726[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x288151=_0x316de3[_0x76aa('0x18')]({'plain':!![]});var _0x3fa7ec=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a')},{'name':'QueueCampaigns','value':_0x76aa('0x1c')}];var _0x281f73=_[_0x76aa('0x22')](_0x3fa7ec,[_0x76aa('0x1f'),_0x288151['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x281f73,'userProfileId':_0x953726[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0xf7732){if(_0xf7732&&_0xf7732['autoAssociation']===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x288151[_0x76aa('0x23')],'resourceId':_0x288151['id'],'type':_0xf7732[_0x76aa('0x23')],'sectionId':_0xf7732['id']},{})[_0x76aa('0x17')](function(){return _0x316de3;});}else{return _0x316de3;}})[_0x76aa('0x3b')](function(_0x37babe){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37babe);throw _0x37babe;});}return _0x316de3;});}})[_0x76aa('0x17')](respondWithResult(_0x18fd3e,0xc9))[_0x76aa('0x3b')](handleError(_0x18fd3e,null));};exports['update']=function(_0x3d7802,_0x1e6f3c){if(_0x3d7802['body']['id']){delete _0x3d7802[_0x76aa('0x3d')]['id'];}return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x3d7802[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1e6f3c,null))[_0x76aa('0x17')](saveUpdates(_0x3d7802[_0x76aa('0x3d')],null))[_0x76aa('0x17')](respondWithResult(_0x1e6f3c,null))[_0x76aa('0x3b')](handleError(_0x1e6f3c,null));};exports['destroy']=function(_0xd337f0,_0x49156c){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0xd337f0[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x49156c,null))[_0x76aa('0x17')](removeEntity(_0x49156c,null))[_0x76aa('0x3b')](handleError(_0x49156c,null));};exports[_0x76aa('0x4a')]=function(_0x431d1c,_0x2f1263){var _0x5eceba={'raw':![],'where':{}};var _0x267fcf={};var _0x3d4025={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x431d1c[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x2f1263,null))[_0x76aa('0x17')](function(_0x157540){if(_0x157540){_0x267fcf['model']=_[_0x76aa('0x32')](db['CmHopper'][_0x76aa('0x2a')]);_0x267fcf[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x431d1c[_0x76aa('0x33')]);_0x267fcf[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x267fcf[_0x76aa('0x31')],_0x267fcf['query']);_0x5eceba[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x267fcf['model'],qs['fields'](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x36')]));_0x5eceba['attributes']=_0x5eceba[_0x76aa('0x34')][_0x76aa('0x37')]?_0x5eceba[_0x76aa('0x34')]:_0x267fcf['model'];if(!_0x431d1c[_0x76aa('0x33')]['hasOwnProperty'](_0x76aa('0x4d'))){_0x5eceba[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x431d1c[_0x76aa('0x33')]['limit']);_0x5eceba['offset']=qs[_0x76aa('0x14')](_0x431d1c['query'][_0x76aa('0x14')]);}_0x5eceba[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x5eceba[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x431d1c[_0x76aa('0x33')],_0x267fcf['filters']));_0x5eceba[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x157540['id'];if(_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]){_0x5eceba['where']=_['merge'](_0x5eceba['where'],{'$or':_[_0x76aa('0x1e')](_0x5eceba['attributes'],function(_0xb61e5){var _0x256195={};_0x256195[_0xb61e5]={'$like':'%'+_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x256195;})});}_0x5eceba=_['merge']({},_0x5eceba,_0x431d1c[_0x76aa('0x3a')]);return db['CmHopper'][_0x76aa('0x13')]({'where':_0x5eceba[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x11d602){_0x3d4025[_0x76aa('0x13')]=_0x11d602;if(_0x431d1c['query'][_0x76aa('0x38')]){_0x5eceba[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x53')][_0x76aa('0x54')](_0x5eceba);})[_0x76aa('0x17')](function(_0x22432d){_0x3d4025[_0x76aa('0x2f')]=_0x22432d;return _0x3d4025;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x2f1263,_0x5eceba))['catch'](handleError(_0x2f1263,null));};exports[_0x76aa('0x55')]=function(_0x381f44,_0x48136a){var _0x3c1b98={'raw':!![],'where':{}};var _0x215463={};var _0x325487={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x381f44[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x48136a,null))['then'](function(_0xdb821b){if(_0xdb821b){_0x215463['model']=_['keys'](db[_0x76aa('0x56')][_0x76aa('0x2a')]);_0x215463['query']=_['keys'](_0x381f44[_0x76aa('0x33')]);_0x215463[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x215463['model'],_0x215463['query']);_0x3c1b98[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x215463[_0x76aa('0x31')],qs['fields'](_0x381f44[_0x76aa('0x33')]['fields']));_0x3c1b98[_0x76aa('0x34')]=_0x3c1b98[_0x76aa('0x34')][_0x76aa('0x37')]?_0x3c1b98[_0x76aa('0x34')]:_0x215463[_0x76aa('0x31')];if(!_0x381f44['query']['hasOwnProperty'](_0x76aa('0x4d'))){_0x3c1b98[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x381f44['query'][_0x76aa('0x12')]);_0x3c1b98[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x381f44[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x3c1b98['order']=qs[_0x76aa('0x4f')](_0x381f44['query'][_0x76aa('0x4f')]);_0x3c1b98[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x381f44[_0x76aa('0x33')],_0x215463[_0x76aa('0x4c')]));_0x3c1b98['where']['VoiceQueueId']=_0xdb821b['id'];if(_0x381f44['query']['filter']){_0x3c1b98['where']=_[_0x76aa('0x39')](_0x3c1b98[_0x76aa('0x2d')],{'$or':_['map'](_0x3c1b98['attributes'],function(_0x4f01e9){var _0x3a6326={};_0x3a6326[_0x4f01e9]={'$like':'%'+_0x381f44[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x3a6326;})});}_0x3c1b98=_['merge']({},_0x3c1b98,_0x381f44['options']);return db[_0x76aa('0x56')][_0x76aa('0x13')]({'where':_0x3c1b98[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x354c7b){_0x325487['count']=_0x354c7b;if(_0x381f44['query'][_0x76aa('0x38')]){_0x3c1b98['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3c1b98);})[_0x76aa('0x17')](function(_0xbb1ccd){_0x325487['rows']=_0xbb1ccd;return _0x325487;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x48136a,_0x3c1b98))[_0x76aa('0x3b')](handleError(_0x48136a,null));};exports['getHopperFinals']=function(_0x22063f,_0x24331a){var _0x11d91f={'raw':!![],'where':{}};var _0x258e5a={};var _0x1fa86b={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x22063f[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x24331a,null))['then'](function(_0x84bc91){if(_0x84bc91){_0x258e5a[_0x76aa('0x31')]=_['keys'](db[_0x76aa('0x57')][_0x76aa('0x2a')]);_0x258e5a[_0x76aa('0x33')]=_['keys'](_0x22063f[_0x76aa('0x33')]);_0x258e5a[_0x76aa('0x4c')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],_0x258e5a[_0x76aa('0x33')]);_0x11d91f[_0x76aa('0x34')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x22063f['query']['fields']));_0x11d91f['attributes']=_0x11d91f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x11d91f[_0x76aa('0x34')]:_0x258e5a[_0x76aa('0x31')];if(!_0x22063f['query']['hasOwnProperty']('nolimit')){_0x11d91f[_0x76aa('0x12')]=qs['limit'](_0x22063f[_0x76aa('0x33')][_0x76aa('0x12')]);_0x11d91f['offset']=qs[_0x76aa('0x14')](_0x22063f[_0x76aa('0x33')]['offset']);}_0x11d91f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x22063f[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x11d91f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x22063f[_0x76aa('0x33')],_0x258e5a['filters']));_0x11d91f['where']['VoiceQueueId']=_0x84bc91['id'];if(_0x22063f['query']['filter']){_0x11d91f[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x11d91f[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x11d91f['attributes'],function(_0x447103){var _0x2192ed={};_0x2192ed[_0x447103]={'$like':'%'+_0x22063f[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2192ed;})});}_0x11d91f=_[_0x76aa('0x39')]({},_0x11d91f,_0x22063f['options']);return db[_0x76aa('0x57')][_0x76aa('0x13')]({'where':_0x11d91f[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x13be70){_0x1fa86b[_0x76aa('0x13')]=_0x13be70;if(_0x22063f[_0x76aa('0x33')]['includeAll']){_0x11d91f[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x57')]['findAll'](_0x11d91f);})['then'](function(_0x216e87){_0x1fa86b[_0x76aa('0x2f')]=_0x216e87;return _0x1fa86b;});}})['then'](respondWithFilteredResult(_0x24331a,_0x11d91f))[_0x76aa('0x3b')](handleError(_0x24331a,null));};exports['getHopperBlacks']=function(_0x28ec11,_0x5cc005){var _0x28b439={'raw':!![],'where':{}};var _0x583924={};var _0x45227e={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x28ec11['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x5cc005,null))['then'](function(_0x1af32e){if(_0x1af32e){_0x583924[_0x76aa('0x31')]=_['keys'](db['CmHopperBlack'][_0x76aa('0x2a')]);_0x583924[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x28ec11[_0x76aa('0x33')]);_0x583924['filters']=_['intersection'](_0x583924[_0x76aa('0x31')],_0x583924['query']);_0x28b439[_0x76aa('0x34')]=_['intersection'](_0x583924[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x28ec11['query'][_0x76aa('0x36')]));_0x28b439['attributes']=_0x28b439['attributes'][_0x76aa('0x37')]?_0x28b439[_0x76aa('0x34')]:_0x583924['model'];if(!_0x28ec11[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x28b439['limit']=qs[_0x76aa('0x12')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x12')]);_0x28b439[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x28b439[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x28b439[_0x76aa('0x2d')]=qs['filters'](_[_0x76aa('0x50')](_0x28ec11[_0x76aa('0x33')],_0x583924['filters']));_0x28b439[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x1af32e['id'];if(_0x28ec11['query']['filter']){_0x28b439[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x28b439['where'],{'$or':_[_0x76aa('0x1e')](_0x28b439[_0x76aa('0x34')],function(_0x24af48){var _0x5010c8={};_0x5010c8[_0x24af48]={'$like':'%'+_0x28ec11[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x5010c8;})});}_0x28b439=_['merge']({},_0x28b439,_0x28ec11[_0x76aa('0x3a')]);return db[_0x76aa('0x59')][_0x76aa('0x13')]({'where':_0x28b439[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x42543c){_0x45227e['count']=_0x42543c;if(_0x28ec11[_0x76aa('0x33')]['includeAll']){_0x28b439[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x59')][_0x76aa('0x54')](_0x28b439);})['then'](function(_0x4c5f54){_0x45227e[_0x76aa('0x2f')]=_0x4c5f54;return _0x45227e;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x5cc005,_0x28b439))[_0x76aa('0x3b')](handleError(_0x5cc005,null));};exports[_0x76aa('0x5a')]=function(_0x1a81fd,_0x1eb8f2){var _0x4f7dd4={};var _0x5a4c03={};var _0x2565a2;var _0x109bd3;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x1a81fd['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1eb8f2,null))['then'](function(_0x54d530){if(_0x54d530){_0x2565a2=_0x54d530;_0x5a4c03[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x5b')]['rawAttributes']);_0x5a4c03[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x1a81fd[_0x76aa('0x33')]);_0x5a4c03[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],_0x5a4c03[_0x76aa('0x33')]);_0x4f7dd4['attributes']=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x36')]));_0x4f7dd4[_0x76aa('0x34')]=_0x4f7dd4['attributes'][_0x76aa('0x37')]?_0x4f7dd4[_0x76aa('0x34')]:_0x5a4c03[_0x76aa('0x31')];_0x4f7dd4[_0x76aa('0x4e')]=qs['sort'](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x4f7dd4[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x1a81fd['query'],_0x5a4c03[_0x76aa('0x4c')]));if(_0x1a81fd[_0x76aa('0x33')]['filter']){_0x4f7dd4['where']=_[_0x76aa('0x39')](_0x4f7dd4[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x4f7dd4[_0x76aa('0x34')],function(_0x46f098){var _0x293221={};_0x293221[_0x46f098]={'$like':'%'+_0x1a81fd['query'][_0x76aa('0x52')]+'%'};return _0x293221;})});}_0x4f7dd4=_[_0x76aa('0x39')]({},_0x4f7dd4,_0x1a81fd[_0x76aa('0x3a')]);return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x2e7bb7){if(_0x2e7bb7){_0x109bd3=_0x2e7bb7['length'];if(!_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x4f7dd4[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x1a81fd[_0x76aa('0x33')]['limit']);_0x4f7dd4[_0x76aa('0x14')]=qs['offset'](_0x1a81fd[_0x76aa('0x33')]['offset']);}return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x56d6af){if(_0x56d6af){return _0x56d6af?{'count':_0x109bd3,'rows':_0x56d6af}:null;}})[_0x76aa('0x17')](respondWithResult(_0x1eb8f2,null))[_0x76aa('0x3b')](handleError(_0x1eb8f2,null));};exports[_0x76aa('0x5c')]=function(_0x57636c,_0x3ae5e8){var _0x46c818=_0x57636c['body'][_0x76aa('0x5d')];var _0xfe926d=_[_0x76aa('0x1e')](_0x46c818,'id');return db[_0x76aa('0x5b')][_0x76aa('0x54')]({'where':{'id':_0xfe926d},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':'Agents','attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]}]})[_0x76aa('0x17')](function(_0x28e1a4){if(_0x28e1a4){var _0x8bb516=_[_0x76aa('0x62')](_0x28e1a4,function(_0xf9f670){var _0x1359f9=_0xf9f670[_0x76aa('0x18')]({'plain':!![]});_0x1359f9['Agents'][_0x76aa('0x63')](function(_0x58cd0c){_0x58cd0c[_0x76aa('0x64')]=_[_0x76aa('0x22')](_0x46c818,{'id':_0x1359f9['id']})[_0x76aa('0x64')];});return _0x1359f9[_0x76aa('0x65')];});return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x57636c['params']['id']}})[_0x76aa('0x17')](function(_0x53090c){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x2045a2){return _0x53090c['addTeams'](_0xfe926d,{'transaction':_0x2045a2})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_0x46c818,function(_0x228968){return db[_0x76aa('0x69')][_0x76aa('0x6a')]({'TeamId':_0x228968['id'],'VoiceQueueId':_0x57636c['params']['id'],'penalty':_0x228968[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})['then'](function(){return BPromise[_0x76aa('0x68')](_0x8bb516,function(_0x1bc764){return db['UserVoiceQueue'][_0x76aa('0x6b')]({'where':{'UserId':_0x1bc764['id'],'VoiceQueueId':_0x57636c[_0x76aa('0x46')]['id']},'defaults':{'penalty':_0x1bc764[_0x76aa('0x64')]},'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_[_0x76aa('0x52')](_0x8bb516,{'online':!![]}),function(_0x245af7){return db[_0x76aa('0x6c')]['upsert']({'membername':_0x245af7[_0x76aa('0x23')],'UserId':_0x245af7['id'],'queue_name':_0x53090c[_0x76aa('0x23')],'VoiceQueueId':_0x53090c['id'],'interface':_[_0x76aa('0x6d')](_0x245af7[_0x76aa('0x61')])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x245af7[_0x76aa('0x23')]):_0x245af7[_0x76aa('0x61')],'paused':_0x245af7['voicePause']||![],'penalty':_0x245af7[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){_0x8bb516[_0x76aa('0x63')](function(_0x54e450){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':_0x54e450['id'],'VoiceQueueId':_0x53090c['id']});});});});});}})[_0x76aa('0x17')](respondWithStatusCode(_0x3ae5e8,null))[_0x76aa('0x3b')](handleError(_0x3ae5e8,null));};exports[_0x76aa('0x72')]=function(_0x5db8d8,_0x21fd43){return db['Team'][_0x76aa('0x54')]({'where':{'id':_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')]},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':_0x76aa('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x21fd43,null))[_0x76aa('0x17')](function(_0x4920fa){var _0x577463=_[_0x76aa('0x1e')](_0x4920fa,'id');var _0x20ba92=[];var _0x533080=[];var _0x3cd088=squel['select']();_0x3cd088[_0x76aa('0x74')](_0x76aa('0x75'))[_0x76aa('0x76')](_0x76aa('0x77'),'tq')[_0x76aa('0x78')](_0x76aa('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x5db8d8[_0x76aa('0x46')]['id']);for(var _0x3ebe91=0x0;_0x3ebe91<_0x4920fa[_0x76aa('0x37')];_0x3ebe91+=0x1){let _0x14318c=_0x4920fa[_0x3ebe91];for(var _0xbfa5f8=0x0;_0xbfa5f8<_0x14318c[_0x76aa('0x65')][_0x76aa('0x37')];_0xbfa5f8+=0x1){let _0x46772f=_0x14318c[_0x76aa('0x65')][_0xbfa5f8];var _0x40df44=_0x3cd088[_0x76aa('0x45')]();_0x40df44[_0x76aa('0x2d')](_0x76aa('0x7b'),_0x46772f['id']);_0x533080[_0x76aa('0x7c')](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x40df44['toString'](),{'type':db[_0x76aa('0x66')]['QueryTypes'][_0x76aa('0x7d')]})[_0x76aa('0x17')](function(_0x4a093b){if(_0x4a093b[_0x76aa('0x37')]===0x1){return _0x46772f['id'];}else{var _0x5305f1=_[_0x76aa('0x7e')](_[_0x76aa('0x1e')](_0x4a093b,_0x76aa('0x7f')),function(_0x5ceae2){return _[_0x76aa('0x20')](_0x577463,_0x5ceae2);});if(_0x5305f1){return _0x46772f['id'];}}}));}}return BPromise['all'](_0x533080)['then'](function(_0x3c9841){_0x20ba92=_(_0x20ba92)['union'](_0x3c9841)[_0x76aa('0x80')]()['value']();return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5db8d8[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](function(_0x3f4ded){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x434634){return _0x3f4ded[_0x76aa('0x72')](_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')],{'transaction':_0x434634})[_0x76aa('0x17')](function(){if(!_[_0x76aa('0x81')](_0x20ba92)){return _0x3f4ded[_0x76aa('0x82')](_0x20ba92,{'transaction':_0x434634})[_0x76aa('0x17')](function(){return db['UserVoiceQueueRt'][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5db8d8[_0x76aa('0x46')]['id'],'UserId':_0x20ba92},'transaction':_0x434634});});}})[_0x76aa('0x17')](function(){_0x20ba92[_0x76aa('0x63')](function(_0x540bf3){socket[_0x76aa('0x70')]('userVoiceQueue:remove',{'UserId':_0x540bf3,'VoiceQueueId':_0x3f4ded['id']});});});});});});})[_0x76aa('0x17')](respondWithStatusCode(_0x21fd43,null))['catch'](handleError(_0x21fd43,null));};exports[_0x76aa('0x83')]=function(_0x5427f0,_0x3e9153){var _0x490090,_0x31b7a8;return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5427f0[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e9153,null))[_0x76aa('0x17')](function(_0x51feca){if(_0x51feca){_0x31b7a8=_0x51feca;return _0x51feca[_0x76aa('0x83')](_0x5427f0['body'][_0x76aa('0x73')],_['omit'](_0x5427f0['body'],[_0x76aa('0x73'),'id'])||{})[_0x76aa('0x84')](function(_0x38b6aa){for(var _0x395501=0x0;_0x395501<_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')][_0x76aa('0x37')];_0x395501+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':Number(_0x5427f0[_0x76aa('0x3d')]['ids'][_0x395501]),'VoiceQueueId':Number(_0x5427f0[_0x76aa('0x46')]['id'])});}return _0x38b6aa;});}})[_0x76aa('0x17')](function(_0x3d969f){_0x490090=_0x3d969f||[];if(_0x31b7a8){return db[_0x76aa('0x5e')][_0x76aa('0x54')]({'where':{'id':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')]},'attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]});}})[_0x76aa('0x17')](function(_0x3274a9){if(!_[_0x76aa('0x81')](_0x3274a9)){var _0x5c0268=[];for(var _0x5c5a6f=0x0;_0x5c5a6f<_0x3274a9[_0x76aa('0x37')];_0x5c5a6f++){if(_0x3274a9[_0x5c5a6f][_0x76aa('0x5f')]){_0x5c0268[_0x76aa('0x7c')](db['UserVoiceQueueRt']['upsert']({'membername':_0x3274a9[_0x5c5a6f][_0x76aa('0x23')],'UserId':_0x3274a9[_0x5c5a6f]['id'],'queue_name':_0x31b7a8[_0x76aa('0x23')],'VoiceQueueId':_0x31b7a8['id'],'interface':_[_0x76aa('0x6d')](_0x3274a9[_0x5c5a6f]['interface'])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x3274a9[_0x5c5a6f]['name']):_0x3274a9[_0x5c5a6f]['interface'],'paused':_0x3274a9[_0x5c5a6f]['voicePause']||![],'penalty':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x64')]||0x0}));}}return BPromise[_0x76aa('0x85')](_0x5c0268);}})['then'](function(){return _0x490090;})[_0x76aa('0x17')](respondWithResult(_0x3e9153,null))[_0x76aa('0x3b')](handleError(_0x3e9153,null));};exports['removeAgents']=function(_0x5433dc,_0x328d1a){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x5433dc['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x328d1a,null))[_0x76aa('0x17')](function(_0x546770){if(_0x546770){return _0x546770[_0x76aa('0x82')](_0x5433dc[_0x76aa('0x33')]['ids'])[_0x76aa('0x17')](function(){if(_[_0x76aa('0x86')](_0x5433dc['query'][_0x76aa('0x73')])){for(var _0x4df504=0x0;_0x4df504<_0x5433dc['query'][_0x76aa('0x73')][_0x76aa('0x37')];_0x4df504+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')][_0x76aa('0x73')][_0x4df504]),'VoiceQueueId':Number(_0x5433dc[_0x76aa('0x46')]['id'])});}}else{socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')]['ids']),'VoiceQueueId':Number(_0x5433dc['params']['id'])});}});}})[_0x76aa('0x17')](function(_0x2726da){return db[_0x76aa('0x6c')][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5433dc[_0x76aa('0x46')]['id'],'UserId':_0x5433dc[_0x76aa('0x33')]['ids']}})[_0x76aa('0x17')](function(){return _0x2726da;});})[_0x76aa('0x17')](respondWithStatusCode(_0x328d1a,null))[_0x76aa('0x3b')](handleError(_0x328d1a,null));};exports[_0x76aa('0x88')]=function(_0x38694d,_0xf0b932){var _0x1c8cf5={};var _0x5a8d0f={};var _0x5f513d;var _0x54e70c;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x38694d[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0xf0b932,null))[_0x76aa('0x17')](function(_0x4afe13){if(_0x4afe13){_0x5f513d=_0x4afe13;_0x5a8d0f['model']=_[_0x76aa('0x32')](db[_0x76aa('0x5e')][_0x76aa('0x2a')]);_0x5a8d0f[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x38694d['query']);_0x5a8d0f[_0x76aa('0x4c')]=_['intersection'](_0x5a8d0f[_0x76aa('0x31')],_0x5a8d0f['query']);_0x1c8cf5['attributes']=_[_0x76aa('0x35')](_0x5a8d0f['model'],qs[_0x76aa('0x36')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x36')]));_0x1c8cf5[_0x76aa('0x34')]=_0x1c8cf5[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1c8cf5[_0x76aa('0x34')]:_0x5a8d0f[_0x76aa('0x31')];_0x1c8cf5['order']=qs[_0x76aa('0x4f')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1c8cf5[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x38694d[_0x76aa('0x33')],_0x5a8d0f['filters']));if(_0x38694d[_0x76aa('0x33')]['filter']){_0x1c8cf5[_0x76aa('0x2d')]=_['merge'](_0x1c8cf5[_0x76aa('0x2d')],{'$or':_['map'](_0x1c8cf5[_0x76aa('0x34')],function(_0x8b2ee1){var _0x279be2={};_0x279be2[_0x8b2ee1]={'$like':'%'+_0x38694d['query']['filter']+'%'};return _0x279be2;})});}_0x1c8cf5=_[_0x76aa('0x39')]({},_0x1c8cf5,_0x38694d['options']);return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x1b99d8){if(_0x1b99d8){_0x54e70c=_0x1b99d8['length'];if(!_0x38694d['query']['hasOwnProperty']('nolimit')){_0x1c8cf5[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1c8cf5[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x2484fd){if(_0x2484fd){return _0x2484fd?{'count':_0x54e70c,'rows':_0x2484fd}:null;}})[_0x76aa('0x17')](respondWithResult(_0xf0b932,null))[_0x76aa('0x3b')](handleError(_0xf0b932,null));};exports['getMembers']=function(_0x2b12e9,_0x4e697b){var _0x1e902d={};var _0x3a7658={};var _0x1b1f85;var _0x3fb275;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x2b12e9[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x4e697b,null))[_0x76aa('0x17')](function(_0x1bdc5c){if(_0x1bdc5c){_0x1b1f85=_0x1bdc5c;_0x3a7658[_0x76aa('0x31')]=_['keys'](db['UserVoiceQueueRt'][_0x76aa('0x2a')]);_0x3a7658[_0x76aa('0x33')]=_['keys'](_0x2b12e9[_0x76aa('0x33')]);_0x3a7658[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x3a7658[_0x76aa('0x31')],_0x3a7658[_0x76aa('0x33')]);_0x1e902d[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x3a7658['model'],qs[_0x76aa('0x36')](_0x2b12e9[_0x76aa('0x33')]['fields']));_0x1e902d['attributes']=_0x1e902d[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1e902d[_0x76aa('0x34')]:_0x3a7658[_0x76aa('0x31')];_0x1e902d[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1e902d[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x2b12e9[_0x76aa('0x33')],_0x3a7658[_0x76aa('0x4c')]));if(_0x2b12e9['query']['filter']){_0x1e902d[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x1e902d[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x1e902d['attributes'],function(_0x5f3819){var _0x2a8410={};_0x2a8410[_0x5f3819]={'$like':'%'+_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2a8410;})});}_0x1e902d=_['merge']({},_0x1e902d,_0x2b12e9['options']);return _0x1b1f85['getMembers'](_0x1e902d);}})[_0x76aa('0x17')](function(_0x4df872){if(_0x4df872){_0x3fb275=_0x4df872[_0x76aa('0x37')];if(!_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x1e902d[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1e902d[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x1b1f85[_0x76aa('0x89')](_0x1e902d);}})[_0x76aa('0x17')](function(_0x3b1f33){return _0x3b1f33?{'count':_0x3fb275,'rows':_0x3b1f33}:null;})[_0x76aa('0x17')](respondWithResult(_0x4e697b,null))['catch'](handleError(_0x4e697b,null));};exports[_0x76aa('0x8a')]=function(_0x5e8cec,_0x1a37e9){var _0x58932f={};var _0x17bd1a={};var _0x5d7a2b;var _0x363c45;return db['VoiceQueue']['findOne']({'where':{'id':_0x5e8cec[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1a37e9,null))[_0x76aa('0x17')](function(_0x44668d){if(_0x44668d){_0x5d7a2b=_0x44668d;_0x17bd1a[_0x76aa('0x31')]=_[_0x76aa('0x32')](db['CmList'][_0x76aa('0x2a')]);_0x17bd1a[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x5e8cec[_0x76aa('0x33')]);_0x17bd1a['filters']=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],_0x17bd1a[_0x76aa('0x33')]);_0x58932f[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x36')]));_0x58932f[_0x76aa('0x34')]=_0x58932f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x58932f['attributes']:_0x17bd1a['model'];_0x58932f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x58932f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x5e8cec[_0x76aa('0x33')],_0x17bd1a[_0x76aa('0x4c')]));if(_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x52')]){_0x58932f['where']=_[_0x76aa('0x39')](_0x58932f['where'],{'$or':_[_0x76aa('0x1e')](_0x58932f[_0x76aa('0x34')],function(_0x278bac){var _0x14256c={};_0x14256c[_0x278bac]={'$like':'%'+_0x5e8cec[_0x76aa('0x33')]['filter']+'%'};return _0x14256c;})});}_0x58932f=_['merge']({},_0x58932f,_0x5e8cec[_0x76aa('0x3a')]);return _0x5d7a2b['getLists'](_0x58932f);}})[_0x76aa('0x17')](function(_0xb760ca){if(_0xb760ca){_0x363c45=_0xb760ca[_0x76aa('0x37')];if(!_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x58')]('nolimit')){_0x58932f['limit']=qs[_0x76aa('0x12')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x12')]);_0x58932f[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5d7a2b[_0x76aa('0x8a')](_0x58932f);}})[_0x76aa('0x17')](function(_0x33644d){if(_0x33644d){return _0x33644d?{'count':_0x363c45,'rows':_0x33644d}:null;}})['then'](respondWithResult(_0x1a37e9,null))[_0x76aa('0x3b')](handleError(_0x1a37e9,null));};exports[_0x76aa('0x8b')]=function(_0x4830ea,_0x20638f){var _0x2b2f27=moment()[_0x76aa('0x6e')](_0x76aa('0x8c'));var _0x1a5297,_0x487c28;return db[_0x76aa('0x29')]['find']({'where':{'id':_0x4830ea[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x20638f,null))[_0x76aa('0x17')](function(_0x2f2a27){if(_0x2f2a27){_0x487c28=_0x2f2a27;return _0x2f2a27['addLists'](_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x4830ea[_0x76aa('0x3d')],[_0x76aa('0x73'),'id'])||{});}return null;})[_0x76aa('0x84')](function(_0xca12fa){var _0xb0a4e1;_0x1a5297=_0xca12fa||[];var _0x1f7f1d=[];if(_0xca12fa){for(var _0x413528=0x0;_0x413528<_0xca12fa[_0x76aa('0x37')];_0x413528+=0x1){var _0x39de41=_0xca12fa[_0x413528][_0x76aa('0x18')]({'plain':!![]});_0x487c28[_0x76aa('0x8d')]=_0x4830ea['body']['dialCheckDuplicateType']?_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x8d')]:_0x487c28['dialCheckDuplicateType'];switch(_0x487c28[_0x76aa('0x8d')]){case'always':_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),'VoiceQueueId',_0x76aa('0x49'),_0x76aa('0x48')],squel['select']()['field'](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id','ContactId')[_0x76aa('0x74')](_0x39de41['CmListId'][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x76aa('0x74')](_0x76aa('0x98'))['from'](_0x76aa('0x99'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']()))['where'](_0x76aa('0x9a'),squel['select']()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')]('VoiceQueueId\x20=\x20?',_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')]())))[_0x76aa('0x96')]();break;case _0x76aa('0x9c'):_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')](['phone',_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))['field'](_0x39de41['CmListId']['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea['params']['id'][_0x76aa('0x96')](),'VoiceQueueId')['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0'))[_0x76aa('0x2d')](_0x76aa('0x9a'),squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']())))[_0x76aa('0x96')]();break;default:_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')]('cm_hopper')[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))['field']('id',_0x76aa('0x94'))['field'](_0x39de41[_0x76aa('0x9f')]['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id']['toString'](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')]('cm_contacts')['where'](_0x76aa('0xa1'))[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')](_0x76aa('0xa0')))[_0x76aa('0x96')]();}_0x1f7f1d['push'](db['sequelize'][_0x76aa('0x33')](_0xb0a4e1));}return BPromise[_0x76aa('0x85')](_0x1f7f1d);}})[_0x76aa('0x17')](function(){var _0xbb19e4=[];var _0x226b44=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xa2'))['fromQuery']([_0x76aa('0xa3'),_0x76aa('0x92'),_0x76aa('0xa4'),'createdAt',_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')]('h.id')['field'](_0x76aa('0xa5'))['field'](_0x76aa('0xa6'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')['from'](_0x76aa('0xa7'),'ci')[_0x76aa('0x78')](_0x76aa('0x90'),'h',_0x76aa('0xa8'))[_0x76aa('0x2d')](_0x76aa('0xa9'),_0x2b2f27)['where'](_0x76aa('0xaa'),_0x76aa('0xab')))[_0x76aa('0x96')]();_0xbb19e4['push'](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x226b44));return BPromise[_0x76aa('0x85')](_0xbb19e4);})['then'](function(){return _0x1a5297;})[_0x76aa('0x17')](respondWithResult(_0x20638f,null))['catch'](handleError(_0x20638f,null));};exports['removeLists']=function(_0xef9ea7,_0x45f21f){return db[_0x76aa('0x29')]['find']({'where':{'id':_0xef9ea7[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x45f21f,null))[_0x76aa('0x17')](function(_0x113e70){if(_0x113e70){return _0x113e70['removeLists'](_0xef9ea7[_0x76aa('0x33')]['ids']);}})['then'](function(_0x583d68){if(_0x583d68){return db[_0x76aa('0x53')]['destroy']({'where':{'ListId':_0xef9ea7[_0x76aa('0x33')]['ids'],'VoiceQueueId':_0xef9ea7['params']['id']}})[_0x76aa('0x17')](function(){return _0x583d68;});}})['then'](respondWithStatusCode(_0x45f21f,null))['catch'](handleError(_0x45f21f,null));};exports[_0x76aa('0xac')]=function(_0x3b7370,_0x1c3431){var _0x865a1b={};var _0x132d60={};var _0x1a3074;var _0x3184a2;return db['VoiceQueue']['findOne']({'where':{'id':_0x3b7370[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1c3431,null))[_0x76aa('0x17')](function(_0x274356){if(_0x274356){_0x1a3074=_0x274356;_0x132d60[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0xad')][_0x76aa('0x2a')]);_0x132d60[_0x76aa('0x33')]=_['keys'](_0x3b7370['query']);_0x132d60[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x132d60[_0x76aa('0x31')],_0x132d60[_0x76aa('0x33')]);_0x865a1b['attributes']=_['intersection'](_0x132d60[_0x76aa('0x31')],qs['fields'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x36')]));_0x865a1b['attributes']=_0x865a1b[_0x76aa('0x34')][_0x76aa('0x37')]?_0x865a1b[_0x76aa('0x34')]:_0x132d60[_0x76aa('0x31')];_0x865a1b[_0x76aa('0x4e')]=qs['sort'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x865a1b['where']=qs['filters'](_[_0x76aa('0x50')](_0x3b7370[_0x76aa('0x33')],_0x132d60[_0x76aa('0x4c')]));if(_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]){_0x865a1b[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x865a1b[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x865a1b[_0x76aa('0x34')],function(_0xbb0ea3){var _0x4978dd={};_0x4978dd[_0xbb0ea3]={'$like':'%'+_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x4978dd;})});}_0x865a1b=_[_0x76aa('0x39')]({},_0x865a1b,_0x3b7370[_0x76aa('0x3a')]);return _0x1a3074['getBlackLists'](_0x865a1b);}})['then'](function(_0x4ee1d3){if(_0x4ee1d3){_0x3184a2=_0x4ee1d3['length'];if(!_0x3b7370[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x865a1b[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x12')]);_0x865a1b['offset']=qs['offset'](_0x3b7370[_0x76aa('0x33')]['offset']);}return _0x1a3074[_0x76aa('0xac')](_0x865a1b);}})[_0x76aa('0x17')](function(_0x3bc149){if(_0x3bc149){return _0x3bc149?{'count':_0x3184a2,'rows':_0x3bc149}:null;}})['then'](respondWithResult(_0x1c3431,null))[_0x76aa('0x3b')](handleError(_0x1c3431,null));};exports[_0x76aa('0xae')]=function(_0x29e112,_0x3fd683){var _0x5c2c4d;return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x29e112[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fd683,null))[_0x76aa('0x17')](function(_0xcb041d){if(_0xcb041d){return _0xcb041d[_0x76aa('0xae')](_0x29e112[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x29e112[_0x76aa('0x3d')],['ids','id'])||{});}return null;})['spread'](function(_0x72b9a){var _0x29db0f;_0x5c2c4d=_0x72b9a||[];var _0x28a212=[];if(_0x72b9a){for(var _0x242cd6=0x0;_0x242cd6<_0x72b9a[_0x76aa('0x37')];_0x242cd6+=0x1){var _0xeb428a=_0x72b9a[_0x242cd6][_0x76aa('0x18')]({'plain':!![]});_0x29db0f=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xaf'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))[_0x76aa('0x74')](_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x29e112['params']['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')](_0x76aa('0xb0'),'createdAt')[_0x76aa('0x74')](_0x76aa('0xb0'),_0x76aa('0x48'))['from'](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0')))['toString']();_0x28a212[_0x76aa('0x7c')](db['sequelize'][_0x76aa('0x33')](_0x29db0f));}return BPromise['all'](_0x28a212);}})[_0x76aa('0x17')](function(){return _0x5c2c4d;})['then'](respondWithResult(_0x3fd683,null))[_0x76aa('0x3b')](handleError(_0x3fd683,null));};exports[_0x76aa('0xb1')]=function(_0x140ee1,_0x3d9e9e){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x140ee1['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x3d9e9e,null))[_0x76aa('0x17')](function(_0x139e67){if(_0x139e67){return _0x139e67[_0x76aa('0xb1')](_0x140ee1['query'][_0x76aa('0x73')]);}})[_0x76aa('0x17')](function(_0x506cad){if(_0x506cad){return db['CmHopperBlack'][_0x76aa('0x25')]({'where':{'ListId':_0x140ee1[_0x76aa('0x33')][_0x76aa('0x73')],'VoiceQueueId':_0x140ee1[_0x76aa('0x46')]['id']}})['then'](function(){return _0x506cad;});}})['then'](respondWithStatusCode(_0x3d9e9e,null))[_0x76aa('0x3b')](handleError(_0x3d9e9e,null));}; \ No newline at end of file +var _0x9957=['includes','find','type','name','UserProfileResource','destroy','stack','send','fieldName','key','getOptions','include','query','findAll','catch','show','params','model','rawAttributes','filters','attributes','intersection','fields','includeAll','merge','VoiceQueue','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','userProfileId','autoAssociation','error','clone','length','options','omit','updatedAt','user','role','outbound','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','keys','order','sort','where','pick','CmHopper','rows','getHopperHistories','CmHopperHistory','hasOwnProperty','VoiceQueueId','getHopperFinals','CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','Agents','voicePause','interface','penalty','transaction','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','forEach','emit','userVoiceQueue:save','ids','User','field','tq.TeamId','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','every','all','union','compact','removeTeams','isEmpty','userVoiceQueue:remove','addAgents','online','SIP/%s','removeAgents','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','createdAt','select','ContactId','CmListId','ListId','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','VoiceQueues','QueueCampaigns','filter','ignore','map','value'];(function(_0x3a85ab,_0x1f3525){var _0x32d91a=function(_0x216ab1){while(--_0x216ab1){_0x3a85ab['push'](_0x3a85ab['shift']());}};_0x32d91a(++_0x1f3525);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var moment=require(_0x7995('0x0'));var BPromise=require(_0x7995('0x1'));var util=require(_0x7995('0x2'));var _=require(_0x7995('0x3'));var squel=require('squel');var Redis=require(_0x7995('0x4'));var qs=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var config=require('../../config/environment');var db=require(_0x7995('0x8'))['db'];config[_0x7995('0x9')]=_[_0x7995('0xa')](config[_0x7995('0x9')],{'host':_0x7995('0xb'),'port':0x18eb});var socket=require(_0x7995('0xc'))(new Redis(config['redis']));require(_0x7995('0xd'))[_0x7995('0xe')](socket);function respondWithStatusCode(_0x4a64f7,_0xa2e5f0){_0xa2e5f0=_0xa2e5f0||0xcc;return function(_0x3116fb){if(_0x3116fb){return _0x4a64f7[_0x7995('0xf')](_0xa2e5f0);}return _0x4a64f7[_0x7995('0x10')](_0xa2e5f0)[_0x7995('0x11')]();};}function respondWithResult(_0x1e400a,_0x341672){_0x341672=_0x341672||0xc8;return function(_0x524f7b){if(_0x524f7b){return _0x1e400a[_0x7995('0x10')](_0x341672)[_0x7995('0x12')](_0x524f7b);}};}function respondWithFilteredResult(_0x581f22,_0xb0c872){return function(_0x2cb37a){if(_0x2cb37a){var _0x19a27e=typeof _0xb0c872[_0x7995('0x13')]===_0x7995('0x14')&&typeof _0xb0c872[_0x7995('0x15')]===_0x7995('0x14');var _0x4cc004=_0x2cb37a['count'];var _0x2b4e94=_0x19a27e?0x0:_0xb0c872[_0x7995('0x13')];var _0x24b5bb=_0x19a27e?_0x2cb37a[_0x7995('0x16')]:_0xb0c872[_0x7995('0x13')]+_0xb0c872[_0x7995('0x15')];var _0x2202ce;if(_0x24b5bb>=_0x4cc004){_0x24b5bb=_0x4cc004;_0x2202ce=0xc8;}else{_0x2202ce=0xce;}_0x581f22[_0x7995('0x10')](_0x2202ce);return _0x581f22['set'](_0x7995('0x17'),_0x2b4e94+'-'+_0x24b5bb+'/'+_0x4cc004)['json'](_0x2cb37a);}return null;};}function saveUpdates(_0x2f832e){return function(_0x37f297){if(_0x37f297){return _0x37f297[_0x7995('0x18')](_0x2f832e)[_0x7995('0x19')](function(_0x1e1415){return _0x1e1415;});}return null;};}function removeEntity(_0x37a7d4){return function(_0x4faa60){if(_0x4faa60){return _0x4faa60['destroy']()[_0x7995('0x19')](function(){var _0x5e6f90=_0x4faa60['get']({'plain':!![]});var _0x3ec178=[{'name':_0x7995('0x1a'),'value':'inbound','ignore':![]},{'name':_0x7995('0x1b'),'value':'outbound','ignore':![]}];var _0x4b1a8e=_(_0x3ec178)[_0x7995('0x1c')](_0x7995('0x1d'))[_0x7995('0x1e')](_0x7995('0x1f'))[_0x7995('0x1f')]();if(_[_0x7995('0x20')](_0x4b1a8e,_0x5e6f90['type'])){return;}var _0x32a09a=_[_0x7995('0x21')](_0x3ec178,[_0x7995('0x1f'),_0x5e6f90[_0x7995('0x22')]])[_0x7995('0x23')];return db[_0x7995('0x24')][_0x7995('0x25')]({'where':{'type':_0x32a09a,'resourceId':_0x5e6f90['id']}})[_0x7995('0x19')](function(){return _0x4faa60;});})['then'](function(){_0x37a7d4[_0x7995('0x10')](0xcc)[_0x7995('0x11')]();});}};}function handleEntityNotFound(_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x401dc3[_0x7995('0xf')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x26')]);if(_0x47625f[_0x7995('0x23')]){delete _0x47625f[_0x7995('0x23')];}_0x2a307e[_0x7995('0x10')](_0x56691a)[_0x7995('0x27')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={};var _0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['VoiceQueue']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x28')],'type':_0x3573be[_0x7995('0x22')][_0x7995('0x29')]};});_0x456a28=qs[_0x7995('0x2a')](_0x4253e5,_0x9b2a15);var _0x1ca460={'where':_0x456a28['where']};return db['VoiceQueue'][_0x7995('0x16')](_0x1ca460)['then'](function(_0x553671){_0x3250e0[_0x7995('0x16')]=_0x553671;_0x456a28[_0x7995('0x2b')]=qs[_0x7995('0x2b')](_0x9b2a15[_0x7995('0x2c')]);return db['VoiceQueue'][_0x7995('0x2d')](_0x456a28);})[_0x7995('0x19')](function(_0x5dd802){_0x3250e0['rows']=_0x5dd802;return _0x3250e0;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x2e')](handleError(_0x514445,null));};exports[_0x7995('0x2f')]=function(_0x4a176f,_0x3e7020){var _0x51b95d={'raw':![],'where':{'id':_0x4a176f[_0x7995('0x30')]['id']}},_0x37917b={};_0x37917b[_0x7995('0x31')]=_['keys'](db['VoiceQueue'][_0x7995('0x32')]);_0x37917b['query']=_['keys'](_0x4a176f[_0x7995('0x2c')]);_0x37917b[_0x7995('0x33')]=_['intersection'](_0x37917b[_0x7995('0x31')],_0x37917b[_0x7995('0x2c')]);_0x51b95d[_0x7995('0x34')]=_[_0x7995('0x35')](_0x37917b[_0x7995('0x31')],qs['fields'](_0x4a176f[_0x7995('0x2c')][_0x7995('0x36')]));_0x51b95d[_0x7995('0x34')]=_0x51b95d[_0x7995('0x34')]['length']?_0x51b95d[_0x7995('0x34')]:_0x37917b[_0x7995('0x31')];if(_0x4a176f[_0x7995('0x2c')][_0x7995('0x37')]){_0x51b95d[_0x7995('0x2b')]=[{'all':!![]}];}_0x51b95d=_[_0x7995('0x38')]({},_0x51b95d,_0x4a176f['options']);return db[_0x7995('0x39')][_0x7995('0x21')](_0x51b95d)[_0x7995('0x19')](handleEntityNotFound(_0x3e7020,null))[_0x7995('0x19')](respondWithResult(_0x3e7020,null))[_0x7995('0x2e')](handleError(_0x3e7020,null));};exports[_0x7995('0x3a')]=function(_0x14d638,_0x270c0e){return db[_0x7995('0x39')][_0x7995('0x3a')](_0x14d638[_0x7995('0x3b')],{})[_0x7995('0x19')](function(_0x7b4e67){var _0x53cda2=_0x14d638['user'][_0x7995('0x3c')]({'plain':!![]});if(!_0x53cda2)throw new Error(_0x7995('0x3d'));if(_0x53cda2['role']==='user'){var _0x3f8522=_0x7b4e67['get']({'plain':!![]});var _0x504a33=[{'name':_0x7995('0x1a'),'value':_0x7995('0x3e')},{'name':_0x7995('0x1b'),'value':'outbound'}];var _0x46ac4f=_['find'](_0x504a33,[_0x7995('0x1f'),_0x3f8522['type']])['name'];return db[_0x7995('0x3f')][_0x7995('0x21')]({'where':{'name':_0x46ac4f,'userProfileId':_0x53cda2[_0x7995('0x40')]},'raw':!![]})[_0x7995('0x19')](function(_0x599ecb){if(_0x599ecb&&_0x599ecb[_0x7995('0x41')]===0x0){return db[_0x7995('0x24')][_0x7995('0x3a')]({'name':_0x3f8522[_0x7995('0x23')],'resourceId':_0x3f8522['id'],'type':_0x599ecb['name'],'sectionId':_0x599ecb['id']},{})['then'](function(){return _0x7b4e67;});}else{return _0x7b4e67;}})[_0x7995('0x2e')](function(_0x55791b){logger[_0x7995('0x42')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55791b);throw _0x55791b;});}return _0x7b4e67;})[_0x7995('0x19')](respondWithResult(_0x270c0e,0xc9))['catch'](handleError(_0x270c0e,null));};exports[_0x7995('0x43')]=function(_0x1b0373,_0x4d9245){var _0x3e9e62={'where':{'id':_0x1b0373[_0x7995('0x30')]['id']}},_0x336ff2={};_0x336ff2[_0x7995('0x31')]=_['keys'](db[_0x7995('0x39')][_0x7995('0x32')]);_0x3e9e62[_0x7995('0x34')]=_['intersection'](_0x336ff2[_0x7995('0x31')],qs[_0x7995('0x36')](_0x1b0373[_0x7995('0x2c')][_0x7995('0x36')]));_0x3e9e62[_0x7995('0x34')]=_0x3e9e62['attributes'][_0x7995('0x44')]?_0x3e9e62[_0x7995('0x34')]:_0x336ff2['model'];if(_0x1b0373[_0x7995('0x2c')]['includeAll']){_0x3e9e62[_0x7995('0x2b')]=[{'all':!![]}];}_0x3e9e62=_[_0x7995('0x38')]({},_0x3e9e62,_0x1b0373[_0x7995('0x45')]);return db[_0x7995('0x39')][_0x7995('0x21')](_0x3e9e62)[_0x7995('0x19')](handleEntityNotFound(_0x4d9245,null))[_0x7995('0x19')](function(_0x4d46bc){if(_0x4d46bc){var _0x427dcf=_0x4d46bc[_0x7995('0x3c')]({'plain':!![]});_0x427dcf=qs[_0x7995('0x46')](_0x427dcf,['id','createdAt',_0x7995('0x47')]);_0x1b0373[_0x7995('0x3b')]=_[_0x7995('0x46')](_0x1b0373['body'],['id','createdAt','updatedAt']);return db[_0x7995('0x39')][_0x7995('0x3a')](_['merge'](_0x427dcf,_0x1b0373[_0x7995('0x3b')]),{'include':_0x1b0373[_0x7995('0x2c')][_0x7995('0x37')]?[{'all':!![]}]:undefined})[_0x7995('0x19')](function(_0xc04004){var _0x528c8e=_0x1b0373[_0x7995('0x48')]['get']({'plain':!![]});if(!_0x528c8e)throw new Error(_0x7995('0x3d'));if(_0x528c8e[_0x7995('0x49')]===_0x7995('0x48')){var _0x50c7b5=_0xc04004['get']({'plain':!![]});var _0x54e2b1=[{'name':'VoiceQueues','value':_0x7995('0x3e')},{'name':_0x7995('0x1b'),'value':_0x7995('0x4a')}];var _0x150261=_[_0x7995('0x21')](_0x54e2b1,[_0x7995('0x1f'),_0x50c7b5[_0x7995('0x22')]])[_0x7995('0x23')];return db[_0x7995('0x3f')][_0x7995('0x21')]({'where':{'name':_0x150261,'userProfileId':_0x528c8e[_0x7995('0x40')]},'raw':!![]})[_0x7995('0x19')](function(_0x3da72b){if(_0x3da72b&&_0x3da72b[_0x7995('0x41')]===0x0){return db[_0x7995('0x24')][_0x7995('0x3a')]({'name':_0x50c7b5[_0x7995('0x23')],'resourceId':_0x50c7b5['id'],'type':_0x3da72b[_0x7995('0x23')],'sectionId':_0x3da72b['id']},{})[_0x7995('0x19')](function(){return _0xc04004;});}else{return _0xc04004;}})['catch'](function(_0x56a374){logger[_0x7995('0x42')](_0x7995('0x4b'),_0x56a374);throw _0x56a374;});}return _0xc04004;});}})[_0x7995('0x19')](respondWithResult(_0x4d9245,0xc9))['catch'](handleError(_0x4d9245,null));};exports['update']=function(_0x402fa0,_0x197b52){if(_0x402fa0[_0x7995('0x3b')]['id']){delete _0x402fa0[_0x7995('0x3b')]['id'];}return db['VoiceQueue'][_0x7995('0x21')]({'where':{'id':_0x402fa0[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x197b52,null))[_0x7995('0x19')](saveUpdates(_0x402fa0['body'],null))['then'](respondWithResult(_0x197b52,null))[_0x7995('0x2e')](handleError(_0x197b52,null));};exports[_0x7995('0x25')]=function(_0x6c0221,_0x1d69ce){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x6c0221[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1d69ce,null))[_0x7995('0x19')](removeEntity(_0x1d69ce,null))['catch'](handleError(_0x1d69ce,null));};exports[_0x7995('0x4c')]=function(_0x3ec5a8,_0xdf9e38){var _0x1ecfdb={'raw':![],'where':{}};var _0x59c5aa={};var _0x51bf6a={'count':0x0,'rows':[]};return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x3ec5a8['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0xdf9e38,null))[_0x7995('0x19')](function(_0x2e3421){if(_0x2e3421){_0x59c5aa[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmHopper'][_0x7995('0x32')]);_0x59c5aa['query']=_[_0x7995('0x4e')](_0x3ec5a8[_0x7995('0x2c')]);_0x59c5aa[_0x7995('0x33')]=_[_0x7995('0x35')](_0x59c5aa[_0x7995('0x31')],_0x59c5aa[_0x7995('0x2c')]);_0x1ecfdb[_0x7995('0x34')]=_[_0x7995('0x35')](_0x59c5aa[_0x7995('0x31')],qs[_0x7995('0x36')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x36')]));_0x1ecfdb['attributes']=_0x1ecfdb[_0x7995('0x34')][_0x7995('0x44')]?_0x1ecfdb[_0x7995('0x34')]:_0x59c5aa[_0x7995('0x31')];if(!_0x3ec5a8[_0x7995('0x2c')]['hasOwnProperty']('nolimit')){_0x1ecfdb[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x15')]);_0x1ecfdb['offset']=qs[_0x7995('0x13')](_0x3ec5a8['query']['offset']);}_0x1ecfdb[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x50')]);_0x1ecfdb[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x3ec5a8[_0x7995('0x2c')],_0x59c5aa[_0x7995('0x33')]));_0x1ecfdb[_0x7995('0x51')]['VoiceQueueId']=_0x2e3421['id'];if(_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x1c')]){_0x1ecfdb[_0x7995('0x51')]=_['merge'](_0x1ecfdb[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x1ecfdb[_0x7995('0x34')],function(_0x3a7d9d){var _0x3b0d30={};_0x3b0d30[_0x3a7d9d]={'$like':'%'+_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x3b0d30;})});}_0x1ecfdb=_[_0x7995('0x38')]({},_0x1ecfdb,_0x3ec5a8[_0x7995('0x45')]);return db[_0x7995('0x53')][_0x7995('0x16')]({'where':_0x1ecfdb['where']})['then'](function(_0xd07c1c){_0x51bf6a[_0x7995('0x16')]=_0xd07c1c;if(_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x37')]){_0x1ecfdb['include']=[{'all':!![]}];}return db[_0x7995('0x53')][_0x7995('0x2d')](_0x1ecfdb);})['then'](function(_0x480fdb){_0x51bf6a[_0x7995('0x54')]=_0x480fdb;return _0x51bf6a;});}})[_0x7995('0x19')](respondWithFilteredResult(_0xdf9e38,_0x1ecfdb))['catch'](handleError(_0xdf9e38,null));};exports[_0x7995('0x55')]=function(_0x5b1cba,_0x3758f9){var _0xea9aba={'raw':!![],'where':{}};var _0x4ff9ff={};var _0x5d9d33={'count':0x0,'rows':[]};return db[_0x7995('0x39')]['findOne']({'where':{'id':_0x5b1cba[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x3758f9,null))[_0x7995('0x19')](function(_0x45bd8a){if(_0x45bd8a){_0x4ff9ff[_0x7995('0x31')]=_[_0x7995('0x4e')](db[_0x7995('0x56')][_0x7995('0x32')]);_0x4ff9ff[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x5b1cba[_0x7995('0x2c')]);_0x4ff9ff[_0x7995('0x33')]=_[_0x7995('0x35')](_0x4ff9ff[_0x7995('0x31')],_0x4ff9ff[_0x7995('0x2c')]);_0xea9aba[_0x7995('0x34')]=_[_0x7995('0x35')](_0x4ff9ff[_0x7995('0x31')],qs[_0x7995('0x36')](_0x5b1cba[_0x7995('0x2c')][_0x7995('0x36')]));_0xea9aba[_0x7995('0x34')]=_0xea9aba[_0x7995('0x34')][_0x7995('0x44')]?_0xea9aba[_0x7995('0x34')]:_0x4ff9ff[_0x7995('0x31')];if(!_0x5b1cba[_0x7995('0x2c')][_0x7995('0x57')]('nolimit')){_0xea9aba[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x5b1cba['query']['limit']);_0xea9aba[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x5b1cba[_0x7995('0x2c')][_0x7995('0x13')]);}_0xea9aba[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x5b1cba['query'][_0x7995('0x50')]);_0xea9aba[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x5b1cba[_0x7995('0x2c')],_0x4ff9ff[_0x7995('0x33')]));_0xea9aba[_0x7995('0x51')][_0x7995('0x58')]=_0x45bd8a['id'];if(_0x5b1cba['query'][_0x7995('0x1c')]){_0xea9aba[_0x7995('0x51')]=_['merge'](_0xea9aba['where'],{'$or':_[_0x7995('0x1e')](_0xea9aba[_0x7995('0x34')],function(_0x18e1a2){var _0x3db7a9={};_0x3db7a9[_0x18e1a2]={'$like':'%'+_0x5b1cba[_0x7995('0x2c')]['filter']+'%'};return _0x3db7a9;})});}_0xea9aba=_[_0x7995('0x38')]({},_0xea9aba,_0x5b1cba[_0x7995('0x45')]);return db['CmHopperHistory'][_0x7995('0x16')]({'where':_0xea9aba[_0x7995('0x51')]})['then'](function(_0x1535a3){_0x5d9d33['count']=_0x1535a3;if(_0x5b1cba[_0x7995('0x2c')][_0x7995('0x37')]){_0xea9aba[_0x7995('0x2b')]=[{'all':!![]}];}return db[_0x7995('0x56')][_0x7995('0x2d')](_0xea9aba);})['then'](function(_0x1f0506){_0x5d9d33[_0x7995('0x54')]=_0x1f0506;return _0x5d9d33;});}})[_0x7995('0x19')](respondWithFilteredResult(_0x3758f9,_0xea9aba))['catch'](handleError(_0x3758f9,null));};exports[_0x7995('0x59')]=function(_0x3f3434,_0x350ed3){var _0x308a26={'raw':!![],'where':{}};var _0x5d7018={};var _0x3356fd={'count':0x0,'rows':[]};return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x3f3434['params']['id']}})['then'](handleEntityNotFound(_0x350ed3,null))[_0x7995('0x19')](function(_0x333379){if(_0x333379){_0x5d7018['model']=_['keys'](db[_0x7995('0x5a')][_0x7995('0x32')]);_0x5d7018[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x3f3434[_0x7995('0x2c')]);_0x5d7018['filters']=_['intersection'](_0x5d7018[_0x7995('0x31')],_0x5d7018['query']);_0x308a26['attributes']=_[_0x7995('0x35')](_0x5d7018[_0x7995('0x31')],qs[_0x7995('0x36')](_0x3f3434['query'][_0x7995('0x36')]));_0x308a26[_0x7995('0x34')]=_0x308a26[_0x7995('0x34')][_0x7995('0x44')]?_0x308a26[_0x7995('0x34')]:_0x5d7018['model'];if(!_0x3f3434[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x308a26[_0x7995('0x15')]=qs['limit'](_0x3f3434[_0x7995('0x2c')][_0x7995('0x15')]);_0x308a26['offset']=qs[_0x7995('0x13')](_0x3f3434[_0x7995('0x2c')]['offset']);}_0x308a26[_0x7995('0x4f')]=qs['sort'](_0x3f3434[_0x7995('0x2c')]['sort']);_0x308a26[_0x7995('0x51')]=qs['filters'](_[_0x7995('0x52')](_0x3f3434[_0x7995('0x2c')],_0x5d7018['filters']));_0x308a26[_0x7995('0x51')]['VoiceQueueId']=_0x333379['id'];if(_0x3f3434['query'][_0x7995('0x1c')]){_0x308a26[_0x7995('0x51')]=_[_0x7995('0x38')](_0x308a26[_0x7995('0x51')],{'$or':_['map'](_0x308a26[_0x7995('0x34')],function(_0x35044a){var _0x4bd29f={};_0x4bd29f[_0x35044a]={'$like':'%'+_0x3f3434['query'][_0x7995('0x1c')]+'%'};return _0x4bd29f;})});}_0x308a26=_['merge']({},_0x308a26,_0x3f3434[_0x7995('0x45')]);return db[_0x7995('0x5a')][_0x7995('0x16')]({'where':_0x308a26['where']})['then'](function(_0x2b7852){_0x3356fd['count']=_0x2b7852;if(_0x3f3434[_0x7995('0x2c')][_0x7995('0x37')]){_0x308a26[_0x7995('0x2b')]=[{'all':!![]}];}return db[_0x7995('0x5a')]['findAll'](_0x308a26);})['then'](function(_0x50f880){_0x3356fd[_0x7995('0x54')]=_0x50f880;return _0x3356fd;});}})[_0x7995('0x19')](respondWithFilteredResult(_0x350ed3,_0x308a26))[_0x7995('0x2e')](handleError(_0x350ed3,null));};exports[_0x7995('0x5c')]=function(_0x265f07,_0x168e7f){var _0x59a793={'raw':!![],'where':{}};var _0x53cbec={};var _0x1a2902={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x265f07[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x168e7f,null))['then'](function(_0x35c3f3){if(_0x35c3f3){_0x53cbec[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmHopperBlack'][_0x7995('0x32')]);_0x53cbec[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x265f07[_0x7995('0x2c')]);_0x53cbec[_0x7995('0x33')]=_[_0x7995('0x35')](_0x53cbec[_0x7995('0x31')],_0x53cbec[_0x7995('0x2c')]);_0x59a793[_0x7995('0x34')]=_['intersection'](_0x53cbec[_0x7995('0x31')],qs[_0x7995('0x36')](_0x265f07[_0x7995('0x2c')][_0x7995('0x36')]));_0x59a793[_0x7995('0x34')]=_0x59a793['attributes'][_0x7995('0x44')]?_0x59a793[_0x7995('0x34')]:_0x53cbec[_0x7995('0x31')];if(!_0x265f07['query']['hasOwnProperty']('nolimit')){_0x59a793[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x265f07[_0x7995('0x2c')][_0x7995('0x15')]);_0x59a793[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x265f07['query'][_0x7995('0x13')]);}_0x59a793['order']=qs[_0x7995('0x50')](_0x265f07[_0x7995('0x2c')][_0x7995('0x50')]);_0x59a793[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x265f07[_0x7995('0x2c')],_0x53cbec[_0x7995('0x33')]));_0x59a793[_0x7995('0x51')][_0x7995('0x58')]=_0x35c3f3['id'];if(_0x265f07[_0x7995('0x2c')]['filter']){_0x59a793[_0x7995('0x51')]=_['merge'](_0x59a793[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x59a793['attributes'],function(_0x493e74){var _0x2a25eb={};_0x2a25eb[_0x493e74]={'$like':'%'+_0x265f07[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x2a25eb;})});}_0x59a793=_[_0x7995('0x38')]({},_0x59a793,_0x265f07[_0x7995('0x45')]);return db[_0x7995('0x5d')][_0x7995('0x16')]({'where':_0x59a793[_0x7995('0x51')]})[_0x7995('0x19')](function(_0x3c9b3c){_0x1a2902[_0x7995('0x16')]=_0x3c9b3c;if(_0x265f07[_0x7995('0x2c')]['includeAll']){_0x59a793['include']=[{'all':!![]}];}return db[_0x7995('0x5d')][_0x7995('0x2d')](_0x59a793);})[_0x7995('0x19')](function(_0x1531a9){_0x1a2902[_0x7995('0x54')]=_0x1531a9;return _0x1a2902;});}})['then'](respondWithFilteredResult(_0x168e7f,_0x59a793))[_0x7995('0x2e')](handleError(_0x168e7f,null));};exports[_0x7995('0x5e')]=function(_0x5ebf5e,_0x46fc1c){var _0x53d693={};var _0x37416c={};var _0x30cda5;var _0x234a40;return db['VoiceQueue'][_0x7995('0x4d')]({'where':{'id':_0x5ebf5e[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x46fc1c,null))[_0x7995('0x19')](function(_0x11f9fb){if(_0x11f9fb){_0x30cda5=_0x11f9fb;_0x37416c[_0x7995('0x31')]=_[_0x7995('0x4e')](db['Team']['rawAttributes']);_0x37416c['query']=_[_0x7995('0x4e')](_0x5ebf5e[_0x7995('0x2c')]);_0x37416c['filters']=_['intersection'](_0x37416c[_0x7995('0x31')],_0x37416c[_0x7995('0x2c')]);_0x53d693['attributes']=_['intersection'](_0x37416c['model'],qs['fields'](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x36')]));_0x53d693[_0x7995('0x34')]=_0x53d693[_0x7995('0x34')]['length']?_0x53d693[_0x7995('0x34')]:_0x37416c[_0x7995('0x31')];_0x53d693['order']=qs[_0x7995('0x50')](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x50')]);_0x53d693['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x5ebf5e['query'],_0x37416c[_0x7995('0x33')]));if(_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x1c')]){_0x53d693[_0x7995('0x51')]=_[_0x7995('0x38')](_0x53d693[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x53d693[_0x7995('0x34')],function(_0x4254de){var _0x278004={};_0x278004[_0x4254de]={'$like':'%'+_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x278004;})});}_0x53d693=_[_0x7995('0x38')]({},_0x53d693,_0x5ebf5e['options']);return _0x30cda5[_0x7995('0x5e')](_0x53d693);}})[_0x7995('0x19')](function(_0x3603e8){if(_0x3603e8){_0x234a40=_0x3603e8[_0x7995('0x44')];if(!_0x5ebf5e['query'][_0x7995('0x57')](_0x7995('0x5b'))){_0x53d693[_0x7995('0x15')]=qs['limit'](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x15')]);_0x53d693[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x30cda5[_0x7995('0x5e')](_0x53d693);}})['then'](function(_0x35dbd7){if(_0x35dbd7){return _0x35dbd7?{'count':_0x234a40,'rows':_0x35dbd7}:null;}})['then'](respondWithResult(_0x46fc1c,null))[_0x7995('0x2e')](handleError(_0x46fc1c,null));};exports[_0x7995('0x5f')]=function(_0x2190d1,_0x4cae1c){var _0xd012b9=_0x2190d1['body']['teams'];var _0x4ee5ee=_['map'](_0xd012b9,'id');return db[_0x7995('0x60')][_0x7995('0x2d')]({'where':{'id':_0x4ee5ee},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7995('0x61'),'attributes':['id',_0x7995('0x23'),'online',_0x7995('0x62'),_0x7995('0x63')],'raw':!![]}]})[_0x7995('0x19')](function(_0x45a479){if(_0x45a479){var _0x443863=_['flatMap'](_0x45a479,function(_0x38ea3e){var _0x1df81d=_0x38ea3e[_0x7995('0x3c')]({'plain':!![]});_0x1df81d[_0x7995('0x61')]['forEach'](function(_0x428d5a){_0x428d5a[_0x7995('0x64')]=_[_0x7995('0x21')](_0xd012b9,{'id':_0x1df81d['id']})[_0x7995('0x64')];});return _0x1df81d[_0x7995('0x61')];});return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x2190d1[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(_0x1fda95){return db['sequelize'][_0x7995('0x65')](function(_0x521712){return _0x1fda95[_0x7995('0x5f')](_0x4ee5ee,{'transaction':_0x521712})[_0x7995('0x19')](function(){return BPromise[_0x7995('0x66')](_0xd012b9,function(_0x50eb5e){return db['TeamVoiceQueue'][_0x7995('0x67')]({'TeamId':_0x50eb5e['id'],'VoiceQueueId':_0x2190d1[_0x7995('0x30')]['id'],'penalty':_0x50eb5e['penalty']},{'transaction':_0x521712});});})[_0x7995('0x19')](function(){return BPromise['each'](_0x443863,function(_0x43de18){return db[_0x7995('0x68')][_0x7995('0x69')]({'where':{'UserId':_0x43de18['id'],'VoiceQueueId':_0x2190d1[_0x7995('0x30')]['id']},'defaults':{'penalty':_0x43de18['penalty']},'transaction':_0x521712});});})['then'](function(){return BPromise[_0x7995('0x66')](_[_0x7995('0x1c')](_0x443863,{'online':!![]}),function(_0x365318){return db[_0x7995('0x6a')]['upsert']({'membername':_0x365318[_0x7995('0x23')],'UserId':_0x365318['id'],'queue_name':_0x1fda95[_0x7995('0x23')],'VoiceQueueId':_0x1fda95['id'],'interface':_[_0x7995('0x6b')](_0x365318[_0x7995('0x63')])?util[_0x7995('0x6c')]('SIP/%s',_0x365318['name']):_0x365318['interface'],'paused':_0x365318[_0x7995('0x62')]||![],'penalty':_0x365318[_0x7995('0x64')]},{'transaction':_0x521712});});})['then'](function(){_0x443863[_0x7995('0x6d')](function(_0x5635d6){socket[_0x7995('0x6e')](_0x7995('0x6f'),{'UserId':_0x5635d6['id'],'VoiceQueueId':_0x1fda95['id']});});});});});}})[_0x7995('0x19')](respondWithStatusCode(_0x4cae1c,null))[_0x7995('0x2e')](handleError(_0x4cae1c,null));};exports['removeTeams']=function(_0x3fbafb,_0x2caacd){return db[_0x7995('0x60')][_0x7995('0x2d')]({'where':{'id':_0x3fbafb[_0x7995('0x2c')][_0x7995('0x70')]},'attributes':['id'],'include':[{'model':db[_0x7995('0x71')],'as':_0x7995('0x61'),'attributes':['id'],'raw':!![]}]})[_0x7995('0x19')](handleEntityNotFound(_0x2caacd,null))[_0x7995('0x19')](function(_0x30893a){var _0x2b8d90=_[_0x7995('0x1e')](_0x30893a,'id');var _0x2122af=[];var _0x4ff0b6=[];var _0x764245=squel['select']();_0x764245[_0x7995('0x72')](_0x7995('0x73'))['from'](_0x7995('0x74'),'tq')['join'](_0x7995('0x75'),'ut',_0x7995('0x76'))['where']('VoiceQueueId\x20=\x20?',_0x3fbafb['params']['id']);for(var _0x8f5ecd=0x0;_0x8f5ecd<_0x30893a[_0x7995('0x44')];_0x8f5ecd+=0x1){let _0x139f76=_0x30893a[_0x8f5ecd];for(var _0x2b7bc2=0x0;_0x2b7bc2<_0x139f76['Agents'][_0x7995('0x44')];_0x2b7bc2+=0x1){let _0x2b2814=_0x139f76[_0x7995('0x61')][_0x2b7bc2];var _0x2de960=_0x764245[_0x7995('0x43')]();_0x2de960[_0x7995('0x51')](_0x7995('0x77'),_0x2b2814['id']);_0x4ff0b6[_0x7995('0x78')](db['sequelize'][_0x7995('0x2c')](_0x2de960[_0x7995('0x79')](),{'type':db[_0x7995('0x7a')][_0x7995('0x7b')]['SELECT']})[_0x7995('0x19')](function(_0x3a2958){if(_0x3a2958[_0x7995('0x44')]===0x1){return _0x2b2814['id'];}else{var _0x339e6b=_[_0x7995('0x7c')](_[_0x7995('0x1e')](_0x3a2958,'TeamId'),function(_0x1bc617){return _[_0x7995('0x20')](_0x2b8d90,_0x1bc617);});if(_0x339e6b){return _0x2b2814['id'];}}}));}}return BPromise[_0x7995('0x7d')](_0x4ff0b6)[_0x7995('0x19')](function(_0x3fcc49){_0x2122af=_(_0x2122af)[_0x7995('0x7e')](_0x3fcc49)[_0x7995('0x7f')]()[_0x7995('0x1f')]();return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3fbafb[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(_0x64a62d){return db[_0x7995('0x7a')][_0x7995('0x65')](function(_0x370984){return _0x64a62d[_0x7995('0x80')](_0x3fbafb[_0x7995('0x2c')][_0x7995('0x70')],{'transaction':_0x370984})[_0x7995('0x19')](function(){if(!_[_0x7995('0x81')](_0x2122af)){return _0x64a62d['removeAgents'](_0x2122af,{'transaction':_0x370984})['then'](function(){return db[_0x7995('0x6a')][_0x7995('0x25')]({'where':{'VoiceQueueId':_0x3fbafb['params']['id'],'UserId':_0x2122af},'transaction':_0x370984});});}})[_0x7995('0x19')](function(){_0x2122af['forEach'](function(_0x2ce103){socket['emit'](_0x7995('0x82'),{'UserId':_0x2ce103,'VoiceQueueId':_0x64a62d['id']});});});});});});})[_0x7995('0x19')](respondWithStatusCode(_0x2caacd,null))[_0x7995('0x2e')](handleError(_0x2caacd,null));};exports[_0x7995('0x83')]=function(_0x3aa676,_0x1df2a2){var _0xd82313,_0x1fa59d;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3aa676['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1df2a2,null))[_0x7995('0x19')](function(_0x1d0481){if(_0x1d0481){_0x1fa59d=_0x1d0481;return _0x1d0481[_0x7995('0x83')](_0x3aa676['body'][_0x7995('0x70')],_[_0x7995('0x46')](_0x3aa676[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{})['spread'](function(_0x32c550){for(var _0x37e647=0x0;_0x37e647<_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')][_0x7995('0x44')];_0x37e647+=0x1){socket[_0x7995('0x6e')](_0x7995('0x6f'),{'UserId':Number(_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')][_0x37e647]),'VoiceQueueId':Number(_0x3aa676['params']['id'])});}return _0x32c550;});}})[_0x7995('0x19')](function(_0x5f5496){_0xd82313=_0x5f5496||[];if(_0x1fa59d){return db[_0x7995('0x71')][_0x7995('0x2d')]({'where':{'id':_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')]},'attributes':['id','name',_0x7995('0x84'),_0x7995('0x62'),_0x7995('0x63')],'raw':!![]});}})[_0x7995('0x19')](function(_0x2c715){if(!_[_0x7995('0x81')](_0x2c715)){var _0x3661ab=[];for(var _0x408692=0x0;_0x408692<_0x2c715[_0x7995('0x44')];_0x408692++){if(_0x2c715[_0x408692][_0x7995('0x84')]){_0x3661ab[_0x7995('0x78')](db[_0x7995('0x6a')][_0x7995('0x67')]({'membername':_0x2c715[_0x408692][_0x7995('0x23')],'UserId':_0x2c715[_0x408692]['id'],'queue_name':_0x1fa59d['name'],'VoiceQueueId':_0x1fa59d['id'],'interface':_['isNil'](_0x2c715[_0x408692][_0x7995('0x63')])?util[_0x7995('0x6c')](_0x7995('0x85'),_0x2c715[_0x408692]['name']):_0x2c715[_0x408692][_0x7995('0x63')],'paused':_0x2c715[_0x408692][_0x7995('0x62')]||![],'penalty':_0x3aa676[_0x7995('0x3b')]['penalty']||0x0}));}}return BPromise[_0x7995('0x7d')](_0x3661ab);}})[_0x7995('0x19')](function(){return _0xd82313;})[_0x7995('0x19')](respondWithResult(_0x1df2a2,null))[_0x7995('0x2e')](handleError(_0x1df2a2,null));};exports[_0x7995('0x86')]=function(_0x3d42a3,_0x29fb77){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3d42a3[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x29fb77,null))['then'](function(_0x580571){if(_0x580571){return _0x580571[_0x7995('0x86')](_0x3d42a3['query'][_0x7995('0x70')])[_0x7995('0x19')](function(){if(_[_0x7995('0x87')](_0x3d42a3[_0x7995('0x2c')][_0x7995('0x70')])){for(var _0x4eebf4=0x0;_0x4eebf4<_0x3d42a3['query'][_0x7995('0x70')][_0x7995('0x44')];_0x4eebf4+=0x1){socket[_0x7995('0x6e')](_0x7995('0x82'),{'UserId':Number(_0x3d42a3[_0x7995('0x2c')][_0x7995('0x70')][_0x4eebf4]),'VoiceQueueId':Number(_0x3d42a3[_0x7995('0x30')]['id'])});}}else{socket[_0x7995('0x6e')](_0x7995('0x82'),{'UserId':Number(_0x3d42a3[_0x7995('0x2c')]['ids']),'VoiceQueueId':Number(_0x3d42a3[_0x7995('0x30')]['id'])});}});}})[_0x7995('0x19')](function(_0x38e67a){return db[_0x7995('0x6a')]['destroy']({'where':{'VoiceQueueId':_0x3d42a3['params']['id'],'UserId':_0x3d42a3['query']['ids']}})['then'](function(){return _0x38e67a;});})[_0x7995('0x19')](respondWithStatusCode(_0x29fb77,null))['catch'](handleError(_0x29fb77,null));};exports['getAgents']=function(_0x32f19d,_0x44dbb8){var _0x181ed6={};var _0x48b807={};var _0xba00af;var _0x4f008a;return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x32f19d[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x44dbb8,null))[_0x7995('0x19')](function(_0x14be06){if(_0x14be06){_0xba00af=_0x14be06;_0x48b807[_0x7995('0x31')]=_['keys'](db[_0x7995('0x71')][_0x7995('0x32')]);_0x48b807[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x32f19d[_0x7995('0x2c')]);_0x48b807['filters']=_[_0x7995('0x35')](_0x48b807[_0x7995('0x31')],_0x48b807[_0x7995('0x2c')]);_0x181ed6['attributes']=_[_0x7995('0x35')](_0x48b807[_0x7995('0x31')],qs[_0x7995('0x36')](_0x32f19d[_0x7995('0x2c')][_0x7995('0x36')]));_0x181ed6['attributes']=_0x181ed6[_0x7995('0x34')][_0x7995('0x44')]?_0x181ed6[_0x7995('0x34')]:_0x48b807[_0x7995('0x31')];_0x181ed6[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x32f19d[_0x7995('0x2c')]['sort']);_0x181ed6['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x32f19d['query'],_0x48b807['filters']));if(_0x32f19d[_0x7995('0x2c')][_0x7995('0x1c')]){_0x181ed6[_0x7995('0x51')]=_[_0x7995('0x38')](_0x181ed6[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x181ed6[_0x7995('0x34')],function(_0x4dca11){var _0xf90cd8={};_0xf90cd8[_0x4dca11]={'$like':'%'+_0x32f19d[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0xf90cd8;})});}_0x181ed6=_[_0x7995('0x38')]({},_0x181ed6,_0x32f19d[_0x7995('0x45')]);return _0xba00af[_0x7995('0x88')](_0x181ed6);}})['then'](function(_0x1d7c33){if(_0x1d7c33){_0x4f008a=_0x1d7c33[_0x7995('0x44')];if(!_0x32f19d[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x181ed6[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x32f19d['query'][_0x7995('0x15')]);_0x181ed6[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x32f19d[_0x7995('0x2c')]['offset']);}return _0xba00af[_0x7995('0x88')](_0x181ed6);}})['then'](function(_0x21ba9b){if(_0x21ba9b){return _0x21ba9b?{'count':_0x4f008a,'rows':_0x21ba9b}:null;}})[_0x7995('0x19')](respondWithResult(_0x44dbb8,null))['catch'](handleError(_0x44dbb8,null));};exports['getMembers']=function(_0x478c12,_0x3b22ec){var _0xf503d5={};var _0x7d2ccf={};var _0x18a3dc;var _0x503b32;return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x478c12[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x3b22ec,null))[_0x7995('0x19')](function(_0x1fa484){if(_0x1fa484){_0x18a3dc=_0x1fa484;_0x7d2ccf[_0x7995('0x31')]=_['keys'](db['UserVoiceQueueRt'][_0x7995('0x32')]);_0x7d2ccf['query']=_['keys'](_0x478c12[_0x7995('0x2c')]);_0x7d2ccf[_0x7995('0x33')]=_[_0x7995('0x35')](_0x7d2ccf[_0x7995('0x31')],_0x7d2ccf[_0x7995('0x2c')]);_0xf503d5[_0x7995('0x34')]=_[_0x7995('0x35')](_0x7d2ccf[_0x7995('0x31')],qs[_0x7995('0x36')](_0x478c12[_0x7995('0x2c')][_0x7995('0x36')]));_0xf503d5[_0x7995('0x34')]=_0xf503d5['attributes'][_0x7995('0x44')]?_0xf503d5[_0x7995('0x34')]:_0x7d2ccf[_0x7995('0x31')];_0xf503d5[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x478c12[_0x7995('0x2c')][_0x7995('0x50')]);_0xf503d5['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x478c12[_0x7995('0x2c')],_0x7d2ccf[_0x7995('0x33')]));if(_0x478c12[_0x7995('0x2c')]['filter']){_0xf503d5[_0x7995('0x51')]=_['merge'](_0xf503d5[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0xf503d5[_0x7995('0x34')],function(_0x5150aa){var _0x260e84={};_0x260e84[_0x5150aa]={'$like':'%'+_0x478c12[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x260e84;})});}_0xf503d5=_[_0x7995('0x38')]({},_0xf503d5,_0x478c12[_0x7995('0x45')]);return _0x18a3dc[_0x7995('0x89')](_0xf503d5);}})[_0x7995('0x19')](function(_0x4fb899){if(_0x4fb899){_0x503b32=_0x4fb899['length'];if(!_0x478c12[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0xf503d5[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x478c12[_0x7995('0x2c')]['limit']);_0xf503d5[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x478c12[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x18a3dc['getMembers'](_0xf503d5);}})['then'](function(_0x5b93e6){return _0x5b93e6?{'count':_0x503b32,'rows':_0x5b93e6}:null;})[_0x7995('0x19')](respondWithResult(_0x3b22ec,null))['catch'](handleError(_0x3b22ec,null));};exports[_0x7995('0x8a')]=function(_0x1b6411,_0x54e348){var _0x390bd3={};var _0x3f0a01={};var _0x45d8a2;var _0x26ab59;return db[_0x7995('0x39')]['findOne']({'where':{'id':_0x1b6411['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x54e348,null))[_0x7995('0x19')](function(_0x2cfa1d){if(_0x2cfa1d){_0x45d8a2=_0x2cfa1d;_0x3f0a01[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmList'][_0x7995('0x32')]);_0x3f0a01[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x1b6411[_0x7995('0x2c')]);_0x3f0a01[_0x7995('0x33')]=_['intersection'](_0x3f0a01['model'],_0x3f0a01['query']);_0x390bd3['attributes']=_[_0x7995('0x35')](_0x3f0a01[_0x7995('0x31')],qs['fields'](_0x1b6411[_0x7995('0x2c')][_0x7995('0x36')]));_0x390bd3['attributes']=_0x390bd3['attributes'][_0x7995('0x44')]?_0x390bd3[_0x7995('0x34')]:_0x3f0a01[_0x7995('0x31')];_0x390bd3[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x50')]);_0x390bd3['where']=qs['filters'](_[_0x7995('0x52')](_0x1b6411[_0x7995('0x2c')],_0x3f0a01[_0x7995('0x33')]));if(_0x1b6411['query'][_0x7995('0x1c')]){_0x390bd3[_0x7995('0x51')]=_[_0x7995('0x38')](_0x390bd3[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x390bd3[_0x7995('0x34')],function(_0x28ac7c){var _0x1b4cab={};_0x1b4cab[_0x28ac7c]={'$like':'%'+_0x1b6411[_0x7995('0x2c')]['filter']+'%'};return _0x1b4cab;})});}_0x390bd3=_['merge']({},_0x390bd3,_0x1b6411[_0x7995('0x45')]);return _0x45d8a2['getLists'](_0x390bd3);}})[_0x7995('0x19')](function(_0x5953d1){if(_0x5953d1){_0x26ab59=_0x5953d1[_0x7995('0x44')];if(!_0x1b6411[_0x7995('0x2c')][_0x7995('0x57')]('nolimit')){_0x390bd3['limit']=qs[_0x7995('0x15')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x15')]);_0x390bd3[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x45d8a2[_0x7995('0x8a')](_0x390bd3);}})[_0x7995('0x19')](function(_0x35403c){if(_0x35403c){return _0x35403c?{'count':_0x26ab59,'rows':_0x35403c}:null;}})[_0x7995('0x19')](respondWithResult(_0x54e348,null))['catch'](handleError(_0x54e348,null));};exports[_0x7995('0x8b')]=function(_0xe43c99,_0x1b7e44){var _0x442c6d=moment()[_0x7995('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3b5edf,_0x44068f;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0xe43c99[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1b7e44,null))[_0x7995('0x19')](function(_0x2b812f){if(_0x2b812f){_0x44068f=_0x2b812f;return _0x2b812f[_0x7995('0x8b')](_0xe43c99['body']['ids'],_[_0x7995('0x46')](_0xe43c99[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{});}return null;})[_0x7995('0x8c')](function(_0x17fd98){var _0x498d7c;_0x3b5edf=_0x17fd98||[];var _0x341024=[];if(_0x17fd98){for(var _0x2bcbc6=0x0;_0x2bcbc6<_0x17fd98[_0x7995('0x44')];_0x2bcbc6+=0x1){var _0x2dd6c7=_0x17fd98[_0x2bcbc6][_0x7995('0x3c')]({'plain':!![]});_0x44068f[_0x7995('0x8d')]=_0xe43c99[_0x7995('0x3b')][_0x7995('0x8d')]?_0xe43c99[_0x7995('0x3b')]['dialCheckDuplicateType']:_0x44068f['dialCheckDuplicateType'];switch(_0x44068f[_0x7995('0x8d')]){case _0x7995('0x8e'):_0x498d7c=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),_0x7995('0x94'),'ContactId','ListId',_0x7995('0x58'),_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()['field']('phone',_0x7995('0x93'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id',_0x7995('0x97'))[_0x7995('0x72')](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))[_0x7995('0x72')](_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')](),'VoiceQueueId')['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x95'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')]('cm_contacts')[_0x7995('0x51')]('deletedAt\x20IS\x20NULL')[_0x7995('0x51')](_0x7995('0x9b'),_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c'))['where'](_0x7995('0x9d'),squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x9e'))['from']('cm_hopper_final')[_0x7995('0x51')](_0x7995('0x9f'),_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]()))['where'](_0x7995('0x9d'),squel[_0x7995('0x96')]()[_0x7995('0x72')]('COALESCE(phone,\x27\x27)')[_0x7995('0x9a')](_0x7995('0x91'))[_0x7995('0x51')]('VoiceQueueId\x20=\x20?',_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]())))[_0x7995('0x79')]();break;case _0x7995('0xa0'):_0x498d7c=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),'scheduledAt',_0x7995('0x97'),_0x7995('0x99'),_0x7995('0x58'),_0x7995('0x95'),'updatedAt'],squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x93'),_0x7995('0x93'))['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id',_0x7995('0x97'))[_0x7995('0x72')](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))['field'](_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')](),_0x7995('0x58'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x95'))['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))['from'](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))['where']('ListId\x20=\x20?',_0x2dd6c7['CmListId'][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c'))[_0x7995('0x51')](_0x7995('0x9d'),squel[_0x7995('0x96')]()['field'](_0x7995('0xa3'))[_0x7995('0x9a')](_0x7995('0x91'))[_0x7995('0x51')]('VoiceQueueId\x20=\x20?',_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]())))['toString']();break;default:_0x498d7c=squel[_0x7995('0x8f')]()['into'](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),'scheduledAt','ContactId',_0x7995('0x99'),_0x7995('0x58'),_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x93'),_0x7995('0x93'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id','ContactId')['field'](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))[_0x7995('0x72')](_0xe43c99['params']['id']['toString'](),_0x7995('0x58'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27','createdAt')['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))['where'](_0x7995('0x9b'),_0x2dd6c7[_0x7995('0x98')]['toString']())[_0x7995('0x51')](_0x7995('0x9c')))[_0x7995('0x79')]();}_0x341024['push'](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x498d7c));}return BPromise[_0x7995('0x7d')](_0x341024);}})[_0x7995('0x19')](function(){var _0x113e03=[];var _0x5348b1=squel['insert']()[_0x7995('0x90')]('cm_hopper_additional_phones')[_0x7995('0x92')](['CmHopperId',_0x7995('0x93'),_0x7995('0xa4'),_0x7995('0x95'),'updatedAt'],squel['select']()['field'](_0x7995('0xa5'))[_0x7995('0x72')](_0x7995('0xa6'))['field'](_0x7995('0xa7'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27','createdAt')[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa8'),'ci')[_0x7995('0xa9')]('cm_hopper','h','h.ContactId=ci.CmContactId')[_0x7995('0x51')](_0x7995('0xaa'),_0x442c6d)[_0x7995('0x51')](_0x7995('0xab'),_0x7995('0xac')))[_0x7995('0x79')]();_0x113e03[_0x7995('0x78')](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x5348b1));return BPromise[_0x7995('0x7d')](_0x113e03);})['then'](function(){return _0x3b5edf;})[_0x7995('0x19')](respondWithResult(_0x1b7e44,null))[_0x7995('0x2e')](handleError(_0x1b7e44,null));};exports[_0x7995('0xad')]=function(_0xff759b,_0x39ee00){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0xff759b['params']['id']}})['then'](handleEntityNotFound(_0x39ee00,null))[_0x7995('0x19')](function(_0x2aec8d){if(_0x2aec8d){return _0x2aec8d[_0x7995('0xad')](_0xff759b[_0x7995('0x2c')]['ids']);}})['then'](function(_0x4b477a){if(_0x4b477a){return db[_0x7995('0x53')][_0x7995('0x25')]({'where':{'ListId':_0xff759b['query'][_0x7995('0x70')],'VoiceQueueId':_0xff759b[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(){return _0x4b477a;});}})[_0x7995('0x19')](respondWithStatusCode(_0x39ee00,null))[_0x7995('0x2e')](handleError(_0x39ee00,null));};exports[_0x7995('0xae')]=function(_0x35229d,_0x22d392){var _0x57438e={};var _0x463c25={};var _0x13d525;var _0x37b7e7;return db['VoiceQueue'][_0x7995('0x4d')]({'where':{'id':_0x35229d['params']['id']}})['then'](handleEntityNotFound(_0x22d392,null))['then'](function(_0x507bf3){if(_0x507bf3){_0x13d525=_0x507bf3;_0x463c25[_0x7995('0x31')]=_['keys'](db[_0x7995('0xaf')][_0x7995('0x32')]);_0x463c25['query']=_[_0x7995('0x4e')](_0x35229d[_0x7995('0x2c')]);_0x463c25[_0x7995('0x33')]=_[_0x7995('0x35')](_0x463c25['model'],_0x463c25[_0x7995('0x2c')]);_0x57438e['attributes']=_[_0x7995('0x35')](_0x463c25[_0x7995('0x31')],qs[_0x7995('0x36')](_0x35229d[_0x7995('0x2c')][_0x7995('0x36')]));_0x57438e[_0x7995('0x34')]=_0x57438e[_0x7995('0x34')][_0x7995('0x44')]?_0x57438e[_0x7995('0x34')]:_0x463c25[_0x7995('0x31')];_0x57438e['order']=qs[_0x7995('0x50')](_0x35229d[_0x7995('0x2c')]['sort']);_0x57438e[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x35229d[_0x7995('0x2c')],_0x463c25[_0x7995('0x33')]));if(_0x35229d[_0x7995('0x2c')]['filter']){_0x57438e[_0x7995('0x51')]=_['merge'](_0x57438e[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x57438e[_0x7995('0x34')],function(_0xb79b0b){var _0x259bf2={};_0x259bf2[_0xb79b0b]={'$like':'%'+_0x35229d[_0x7995('0x2c')]['filter']+'%'};return _0x259bf2;})});}_0x57438e=_[_0x7995('0x38')]({},_0x57438e,_0x35229d[_0x7995('0x45')]);return _0x13d525[_0x7995('0xae')](_0x57438e);}})['then'](function(_0x1176cd){if(_0x1176cd){_0x37b7e7=_0x1176cd[_0x7995('0x44')];if(!_0x35229d[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x57438e[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x35229d[_0x7995('0x2c')][_0x7995('0x15')]);_0x57438e[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x35229d['query'][_0x7995('0x13')]);}return _0x13d525[_0x7995('0xae')](_0x57438e);}})['then'](function(_0x3098ef){if(_0x3098ef){return _0x3098ef?{'count':_0x37b7e7,'rows':_0x3098ef}:null;}})[_0x7995('0x19')](respondWithResult(_0x22d392,null))[_0x7995('0x2e')](handleError(_0x22d392,null));};exports[_0x7995('0xb0')]=function(_0x258f87,_0x5a5cc4){var _0x37af6b;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x258f87[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x5a5cc4,null))[_0x7995('0x19')](function(_0x120bef){if(_0x120bef){return _0x120bef[_0x7995('0xb0')](_0x258f87[_0x7995('0x3b')][_0x7995('0x70')],_[_0x7995('0x46')](_0x258f87[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{});}return null;})['spread'](function(_0x247b71){var _0x1ecb6f;_0x37af6b=_0x247b71||[];var _0x225a37=[];if(_0x247b71){for(var _0x1a9f59=0x0;_0x1a9f59<_0x247b71['length'];_0x1a9f59+=0x1){var _0x92a561=_0x247b71[_0x1a9f59][_0x7995('0x3c')]({'plain':!![]});_0x1ecb6f=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0xb1'))[_0x7995('0x92')]([_0x7995('0x93'),'ContactId',_0x7995('0x99'),'VoiceQueueId',_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()['field']('phone',_0x7995('0x93'))[_0x7995('0x72')]('id',_0x7995('0x97'))['field'](_0x92a561[_0x7995('0x98')]['toString'](),_0x7995('0x99'))[_0x7995('0x72')](_0x258f87[_0x7995('0x30')]['id'][_0x7995('0x79')](),_0x7995('0x58'))[_0x7995('0x72')]('NOW()',_0x7995('0x95'))[_0x7995('0x72')]('NOW()',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))[_0x7995('0x51')](_0x7995('0x9b'),_0x92a561[_0x7995('0x98')][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c')))[_0x7995('0x79')]();_0x225a37[_0x7995('0x78')](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x1ecb6f));}return BPromise[_0x7995('0x7d')](_0x225a37);}})[_0x7995('0x19')](function(){return _0x37af6b;})['then'](respondWithResult(_0x5a5cc4,null))['catch'](handleError(_0x5a5cc4,null));};exports[_0x7995('0xb2')]=function(_0x2f3c17,_0x4fe5eb){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x2f3c17['params']['id']}})['then'](handleEntityNotFound(_0x4fe5eb,null))[_0x7995('0x19')](function(_0x31a3d6){if(_0x31a3d6){return _0x31a3d6[_0x7995('0xb2')](_0x2f3c17[_0x7995('0x2c')][_0x7995('0x70')]);}})[_0x7995('0x19')](function(_0x1b3920){if(_0x1b3920){return db[_0x7995('0x5d')][_0x7995('0x25')]({'where':{'ListId':_0x2f3c17[_0x7995('0x2c')]['ids'],'VoiceQueueId':_0x2f3c17[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(){return _0x1b3920;});}})[_0x7995('0x19')](respondWithStatusCode(_0x4fe5eb,null))[_0x7995('0x2e')](handleError(_0x4fe5eb,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 5609984..ddf4bd8 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 _0xf431=['hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','remove','emit'];(function(_0x1eb21a,_0x40a3a7){var _0x58f8f8=function(_0x3c0e9a){while(--_0x3c0e9a){_0x1eb21a['push'](_0x1eb21a['shift']());}};_0x58f8f8(++_0x40a3a7);}(_0xf431,0x1b2));var _0x1f43=function(_0x18e875,_0x54fff7){_0x18e875=_0x18e875-0x0;var _0x1643c6=_0xf431[_0x18e875];return _0x1643c6;};'use strict';var EventEmitter=require(_0x1f43('0x0'));var VoiceQueue=require(_0x1f43('0x1'))['db'][_0x1f43('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1f43('0x3')](0x0);var events={'afterCreate':_0x1f43('0x4'),'afterUpdate':'update','afterDestroy':_0x1f43('0x5')};function emitEvent(_0x84f11d){return function(_0x13ce10,_0x37ebb7,_0x376339){VoiceQueueEvents['emit'](_0x84f11d+':'+_0x13ce10['id'],_0x13ce10);VoiceQueueEvents[_0x1f43('0x6')](_0x84f11d,_0x13ce10);_0x376339(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x1f43('0x7')](e,emitEvent(event));}}module[_0x1f43('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xdf3b=['emit','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','remove'];(function(_0x341240,_0x52ac67){var _0x3ab00b=function(_0x49b3f4){while(--_0x49b3f4){_0x341240['push'](_0x341240['shift']());}};_0x3ab00b(++_0x52ac67);}(_0xdf3b,0x111));var _0xbdf3=function(_0x7dbd65,_0x18da49){_0x7dbd65=_0x7dbd65-0x0;var _0x33d551=_0xdf3b[_0x7dbd65];return _0x33d551;};'use strict';var EventEmitter=require(_0xbdf3('0x0'));var VoiceQueue=require(_0xbdf3('0x1'))['db'][_0xbdf3('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xbdf3('0x3')](0x0);var events={'afterCreate':_0xbdf3('0x4'),'afterUpdate':'update','afterDestroy':_0xbdf3('0x5')};function emitEvent(_0x4044cb){return function(_0x14df24,_0x2c878e,_0xae42fa){VoiceQueueEvents[_0xbdf3('0x6')](_0x4044cb+':'+_0x14df24['id'],_0x14df24);VoiceQueueEvents[_0xbdf3('0x6')](_0x4044cb,_0x14df24);_0xae42fa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xbdf3('0x7')](e,emitEvent(event));}}module[_0xbdf3('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 5f39e7b..2cc4f0e 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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x132844,_0x98bc49){var _0x13c26f=function(_0xf5c16f){while(--_0xf5c16f){_0x132844['push'](_0x132844['shift']());}};_0x13c26f(++_0x98bc49);}(_0x70e0,0x17b));var _0x070e=function(_0xfb36ba,_0x81ca8b){_0xfb36ba=_0xfb36ba-0x0;var _0x187737=_0x70e0[_0xfb36ba];return _0x187737;};'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 +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x24116b,_0x32d730){var _0x42accb=function(_0x27c425){while(--_0x27c425){_0x24116b['push'](_0x24116b['shift']());}};_0x42accb(++_0x32d730);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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':'voice_queues','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 71037b0..2ff08a7 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 _0xbe6a=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetVoiceQueue','findAll','options','raw','where','limit','include','attributes','map','model','VoiceQueue','find','ShowVoiceQueue'];(function(_0x52e06f,_0xef68a0){var _0x416550=function(_0x4f654c){while(--_0x4f654c){_0x52e06f['push'](_0x52e06f['shift']());}};_0x416550(++_0xef68a0);}(_0xbe6a,0x78));var _0xabe6=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0xbe6a[_0x20845e];return _0x28cf2b;};'use strict';var _=require('lodash');var util=require(_0xabe6('0x0'));var moment=require(_0xabe6('0x1'));var BPromise=require('bluebird');var rs=require(_0xabe6('0x2'));var fs=require('fs');var Redis=require(_0xabe6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xabe6('0x4'));var logger=require(_0xabe6('0x5'))(_0xabe6('0x6'));var config=require(_0xabe6('0x7'));var jayson=require(_0xabe6('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xabe6('0x9')]=_[_0xabe6('0xa')](config['redis'],{'host':_0xabe6('0xb'),'port':0x18eb});var socket=require(_0xabe6('0xc'))(new Redis(config[_0xabe6('0x9')]));require(_0xabe6('0xd'))[_0xabe6('0xe')](socket);function respondWithRpcPromise(_0x1b6bc5,_0xa6065c,_0x572ad2){return new BPromise(function(_0x16a9ff,_0x28eaed){return client[_0xabe6('0xf')](_0x1b6bc5,_0x572ad2)[_0xabe6('0x10')](function(_0x53224a){logger[_0xabe6('0x11')](_0xabe6('0x12'),_0xa6065c,'request\x20sent');logger[_0xabe6('0x13')](_0xabe6('0x14'),_0xa6065c,'request\x20sent',JSON[_0xabe6('0x15')](_0x53224a));if(_0x53224a['error']){if(_0x53224a['error']['code']===0x1f4){logger[_0xabe6('0x16')](_0xabe6('0x12'),_0xa6065c,_0x53224a['error']['message']);return _0x28eaed(_0x53224a['error'][_0xabe6('0x17')]);}logger[_0xabe6('0x16')]('VoiceQueue,\x20%s,\x20%s',_0xa6065c,_0x53224a[_0xabe6('0x16')][_0xabe6('0x17')]);return _0x16a9ff(_0x53224a[_0xabe6('0x16')][_0xabe6('0x17')]);}else{logger[_0xabe6('0x11')](_0xabe6('0x12'),_0xa6065c,_0xabe6('0x18'));_0x16a9ff(_0x53224a[_0xabe6('0x19')][_0xabe6('0x17')]);}})[_0xabe6('0x1a')](function(_0x5bb47c){logger[_0xabe6('0x16')]('VoiceQueue,\x20%s,\x20%s',_0xa6065c,_0x5bb47c);_0x28eaed(_0x5bb47c);});});}exports[_0xabe6('0x1b')]=function(_0x42f0b7){var _0x35e560=this;return new Promise(function(_0x92a95e,_0x3c61b2){return db['VoiceQueue'][_0xabe6('0x1c')]({'raw':_0x42f0b7['options']?_0x42f0b7[_0xabe6('0x1d')][_0xabe6('0x1e')]===undefined?!![]:![]:!![],'where':_0x42f0b7[_0xabe6('0x1d')]?_0x42f0b7[_0xabe6('0x1d')][_0xabe6('0x1f')]||null:null,'attributes':_0x42f0b7[_0xabe6('0x1d')]?_0x42f0b7[_0xabe6('0x1d')]['attributes']||null:null,'limit':_0x42f0b7[_0xabe6('0x1d')]?_0x42f0b7['options'][_0xabe6('0x20')]||null:null,'include':_0x42f0b7[_0xabe6('0x1d')]?_0x42f0b7[_0xabe6('0x1d')]['include']?_['map'](_0x42f0b7[_0xabe6('0x1d')][_0xabe6('0x21')],function(_0x38f901){return{'model':db[_0x38f901['model']],'as':_0x38f901['as'],'attributes':_0x38f901[_0xabe6('0x22')],'include':_0x38f901[_0xabe6('0x21')]?_[_0xabe6('0x23')](_0x38f901[_0xabe6('0x21')],function(_0x5b56ba){return{'model':db[_0x5b56ba[_0xabe6('0x24')]],'as':_0x5b56ba['as'],'attributes':_0x5b56ba['attributes'],'include':_0x5b56ba[_0xabe6('0x21')]?_['map'](_0x5b56ba['include'],function(_0x24f7d1){return{'model':db[_0x24f7d1[_0xabe6('0x24')]],'as':_0x24f7d1['as'],'attributes':_0x24f7d1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x727491){logger[_0xabe6('0x11')](_0xabe6('0x1b'),_0x42f0b7);logger[_0xabe6('0x13')](_0xabe6('0x1b'),_0x42f0b7,JSON[_0xabe6('0x15')](_0x727491));_0x92a95e(_0x727491);})[_0xabe6('0x1a')](function(_0x14ac0b){logger[_0xabe6('0x16')](_0xabe6('0x1b'),_0x14ac0b[_0xabe6('0x17')],_0x42f0b7);_0x3c61b2(_0x35e560[_0xabe6('0x16')](0x1f4,_0x14ac0b[_0xabe6('0x17')]));});});};exports['ShowVoiceQueue']=function(_0x923b7b){var _0x22e8e5=this;return new Promise(function(_0x1e0d81,_0xf4f283){return db[_0xabe6('0x25')][_0xabe6('0x26')]({'raw':_0x923b7b['options']?_0x923b7b[_0xabe6('0x1d')][_0xabe6('0x1e')]===undefined?!![]:![]:!![],'where':_0x923b7b[_0xabe6('0x1d')]?_0x923b7b['options'][_0xabe6('0x1f')]||null:null,'attributes':_0x923b7b[_0xabe6('0x1d')]?_0x923b7b['options'][_0xabe6('0x22')]||null:null,'include':_0x923b7b[_0xabe6('0x1d')]?_0x923b7b[_0xabe6('0x1d')][_0xabe6('0x21')]?_[_0xabe6('0x23')](_0x923b7b[_0xabe6('0x1d')]['include'],function(_0x6a49ee){return{'model':db[_0x6a49ee[_0xabe6('0x24')]],'as':_0x6a49ee['as'],'attributes':_0x6a49ee[_0xabe6('0x22')],'include':_0x6a49ee[_0xabe6('0x21')]?_[_0xabe6('0x23')](_0x6a49ee['include'],function(_0x39e20b){return{'model':db[_0x39e20b[_0xabe6('0x24')]],'as':_0x39e20b['as'],'attributes':_0x39e20b['attributes'],'include':_0x39e20b[_0xabe6('0x21')]?_[_0xabe6('0x23')](_0x39e20b[_0xabe6('0x21')],function(_0x591810){return{'model':db[_0x591810[_0xabe6('0x24')]],'as':_0x591810['as'],'attributes':_0x591810[_0xabe6('0x22')]};}):[]};}):[]};}):[]:[]})[_0xabe6('0x10')](function(_0x3b654b){logger['info'](_0xabe6('0x27'),_0x923b7b);logger['debug']('ShowVoiceQueue',_0x923b7b,JSON[_0xabe6('0x15')](_0x3b654b));_0x1e0d81(_0x3b654b);})[_0xabe6('0x1a')](function(_0x48a9ba){logger[_0xabe6('0x16')]('ShowVoiceQueue',_0x48a9ba[_0xabe6('0x17')],_0x923b7b);_0xf4f283(_0x22e8e5[_0xabe6('0x16')](0x1f4,_0x48a9ba['message']));});});}; \ No newline at end of file +var _0x13bd=['then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','include','model','map','debug','catch','ShowVoiceQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','defaults','redis','localhost','register','request'];(function(_0x573823,_0x1d27fc){var _0x2b60ad=function(_0x12a929){while(--_0x12a929){_0x573823['push'](_0x573823['shift']());}};_0x2b60ad(++_0x1d27fc);}(_0x13bd,0x12a));var _0xd13b=function(_0x23ec89,_0x11c956){_0x23ec89=_0x23ec89-0x0;var _0x51aea2=_0x13bd[_0x23ec89];return _0x51aea2;};'use strict';var _=require(_0xd13b('0x0'));var util=require('util');var moment=require(_0xd13b('0x1'));var BPromise=require(_0xd13b('0x2'));var rs=require(_0xd13b('0x3'));var fs=require('fs');var Redis=require(_0xd13b('0x4'));var db=require(_0xd13b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd13b('0x6'))(_0xd13b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd13b('0x8')]({'port':0x232a});config['redis']=_[_0xd13b('0x9')](config[_0xd13b('0xa')],{'host':_0xd13b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd13b('0xa')]));require('./voiceQueue.socket')[_0xd13b('0xc')](socket);function respondWithRpcPromise(_0x6f008f,_0x4202ae,_0x47d505){return new BPromise(function(_0x11a21e,_0xddb92d){return client[_0xd13b('0xd')](_0x6f008f,_0x47d505)[_0xd13b('0xe')](function(_0x4b6183){logger[_0xd13b('0xf')](_0xd13b('0x10'),_0x4202ae,_0xd13b('0x11'));logger['debug'](_0xd13b('0x12'),_0x4202ae,'request\x20sent',JSON[_0xd13b('0x13')](_0x4b6183));if(_0x4b6183[_0xd13b('0x14')]){if(_0x4b6183[_0xd13b('0x14')][_0xd13b('0x15')]===0x1f4){logger[_0xd13b('0x14')](_0xd13b('0x10'),_0x4202ae,_0x4b6183[_0xd13b('0x14')][_0xd13b('0x16')]);return _0xddb92d(_0x4b6183[_0xd13b('0x14')][_0xd13b('0x16')]);}logger['error'](_0xd13b('0x10'),_0x4202ae,_0x4b6183['error']['message']);return _0x11a21e(_0x4b6183[_0xd13b('0x14')]['message']);}else{logger[_0xd13b('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x4202ae,_0xd13b('0x11'));_0x11a21e(_0x4b6183[_0xd13b('0x17')]['message']);}})['catch'](function(_0x4dcbf6){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x4202ae,_0x4dcbf6);_0xddb92d(_0x4dcbf6);});});}exports[_0xd13b('0x18')]=function(_0x24b642){var _0x18d3c5=this;return new Promise(function(_0x3790e0,_0x42a368){return db[_0xd13b('0x19')][_0xd13b('0x1a')]({'raw':_0x24b642[_0xd13b('0x1b')]?_0x24b642[_0xd13b('0x1b')][_0xd13b('0x1c')]===undefined?!![]:![]:!![],'where':_0x24b642[_0xd13b('0x1b')]?_0x24b642[_0xd13b('0x1b')]['where']||null:null,'attributes':_0x24b642[_0xd13b('0x1b')]?_0x24b642[_0xd13b('0x1b')][_0xd13b('0x1d')]||null:null,'limit':_0x24b642['options']?_0x24b642[_0xd13b('0x1b')][_0xd13b('0x1e')]||null:null,'include':_0x24b642['options']?_0x24b642[_0xd13b('0x1b')]['include']?_['map'](_0x24b642['options']['include'],function(_0x35a9a4){return{'model':db[_0x35a9a4['model']],'as':_0x35a9a4['as'],'attributes':_0x35a9a4['attributes'],'include':_0x35a9a4['include']?_['map'](_0x35a9a4[_0xd13b('0x1f')],function(_0x1fdc7c){return{'model':db[_0x1fdc7c[_0xd13b('0x20')]],'as':_0x1fdc7c['as'],'attributes':_0x1fdc7c['attributes'],'include':_0x1fdc7c[_0xd13b('0x1f')]?_[_0xd13b('0x21')](_0x1fdc7c[_0xd13b('0x1f')],function(_0x36e2c2){return{'model':db[_0x36e2c2[_0xd13b('0x20')]],'as':_0x36e2c2['as'],'attributes':_0x36e2c2[_0xd13b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd13b('0xe')](function(_0x42a2e8){logger[_0xd13b('0xf')]('GetVoiceQueue',_0x24b642);logger[_0xd13b('0x22')](_0xd13b('0x18'),_0x24b642,JSON[_0xd13b('0x13')](_0x42a2e8));_0x3790e0(_0x42a2e8);})[_0xd13b('0x23')](function(_0x59621b){logger['error'](_0xd13b('0x18'),_0x59621b[_0xd13b('0x16')],_0x24b642);_0x42a368(_0x18d3c5['error'](0x1f4,_0x59621b[_0xd13b('0x16')]));});});};exports[_0xd13b('0x24')]=function(_0x3b2650){var _0x1cf586=this;return new Promise(function(_0x27637e,_0x346207){return db[_0xd13b('0x19')][_0xd13b('0x25')]({'raw':_0x3b2650['options']?_0x3b2650[_0xd13b('0x1b')][_0xd13b('0x1c')]===undefined?!![]:![]:!![],'where':_0x3b2650['options']?_0x3b2650['options'][_0xd13b('0x26')]||null:null,'attributes':_0x3b2650[_0xd13b('0x1b')]?_0x3b2650[_0xd13b('0x1b')]['attributes']||null:null,'include':_0x3b2650[_0xd13b('0x1b')]?_0x3b2650[_0xd13b('0x1b')][_0xd13b('0x1f')]?_[_0xd13b('0x21')](_0x3b2650[_0xd13b('0x1b')][_0xd13b('0x1f')],function(_0x454e69){return{'model':db[_0x454e69['model']],'as':_0x454e69['as'],'attributes':_0x454e69[_0xd13b('0x1d')],'include':_0x454e69['include']?_[_0xd13b('0x21')](_0x454e69[_0xd13b('0x1f')],function(_0x59bfb6){return{'model':db[_0x59bfb6[_0xd13b('0x20')]],'as':_0x59bfb6['as'],'attributes':_0x59bfb6[_0xd13b('0x1d')],'include':_0x59bfb6[_0xd13b('0x1f')]?_[_0xd13b('0x21')](_0x59bfb6[_0xd13b('0x1f')],function(_0x2b16ce){return{'model':db[_0x2b16ce[_0xd13b('0x20')]],'as':_0x2b16ce['as'],'attributes':_0x2b16ce[_0xd13b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd13b('0xe')](function(_0x5e1046){logger['info'](_0xd13b('0x24'),_0x3b2650);logger[_0xd13b('0x22')](_0xd13b('0x24'),_0x3b2650,JSON[_0xd13b('0x13')](_0x5e1046));_0x27637e(_0x5e1046);})['catch'](function(_0x1dac65){logger[_0xd13b('0x14')](_0xd13b('0x24'),_0x1dac65[_0xd13b('0x16')],_0x3b2650);_0x346207(_0x1cf586[_0xd13b('0x14')](0x1f4,_0x1dac65[_0xd13b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 6cd2976..bc1d8cb 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 _0x3a96=['remove','emit','removeListener','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x3e94f0,_0x382afe){var _0x5ddbb2=function(_0x45f8a4){while(--_0x45f8a4){_0x3e94f0['push'](_0x3e94f0['shift']());}};_0x5ddbb2(++_0x382afe);}(_0x3a96,0x8a));var _0x63a9=function(_0x360c42,_0x427772){_0x360c42=_0x360c42-0x0;var _0x23b630=_0x3a96[_0x360c42];return _0x23b630;};'use strict';var VoiceQueueEvents=require(_0x63a9('0x0'));var events=[_0x63a9('0x1'),_0x63a9('0x2'),'update'];function createListener(_0x137d16,_0x37eddf){return function(_0x37b8a9){_0x37eddf[_0x63a9('0x3')](_0x137d16,_0x37b8a9);};}function removeListener(_0x2390e4,_0x21f2c8){return function(){VoiceQueueEvents[_0x63a9('0x4')](_0x2390e4,_0x21f2c8);};}exports['register']=function(_0x11e857){for(var _0x463b95=0x0,_0x304419=events[_0x63a9('0x5')];_0x463b95<_0x304419;_0x463b95++){var _0x3e2cc3=events[_0x463b95];var _0x56b0ab=createListener(_0x63a9('0x6')+_0x3e2cc3,_0x11e857);VoiceQueueEvents['on'](_0x3e2cc3,_0x56b0ab);}}; \ No newline at end of file +var _0x83d8=['voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x5cf70e,_0x4bdeab){var _0x2359ab=function(_0x57cd68){while(--_0x57cd68){_0x5cf70e['push'](_0x5cf70e['shift']());}};_0x2359ab(++_0x4bdeab);}(_0x83d8,0xfd));var _0x883d=function(_0x602e31,_0x2c062a){_0x602e31=_0x602e31-0x0;var _0x3d265d=_0x83d8[_0x602e31];return _0x3d265d;};'use strict';var VoiceQueueEvents=require(_0x883d('0x0'));var events=[_0x883d('0x1'),_0x883d('0x2'),_0x883d('0x3')];function createListener(_0x56c0b7,_0xd18627){return function(_0x24a6a8){_0xd18627[_0x883d('0x4')](_0x56c0b7,_0x24a6a8);};}function removeListener(_0x44e51f,_0x289819){return function(){VoiceQueueEvents[_0x883d('0x5')](_0x44e51f,_0x289819);};}exports[_0x883d('0x6')]=function(_0x263e7b){for(var _0x5220da=0x0,_0xe751e0=events[_0x883d('0x7')];_0x5220da<_0xe751e0;_0x5220da++){var _0x2c2189=events[_0x5220da];var _0x25c138=createListener(_0x883d('0x8')+_0x2c2189,_0x263e7b);VoiceQueueEvents['on'](_0x2c2189,_0x25c138);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index c40a66b..7bb7b61 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 _0x3081=['/describe','describe','isAuthenticated','getVoiceQueuesReport','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','index','get'];(function(_0x4a6d29,_0x33bd68){var _0x168c5d=function(_0x31e923){while(--_0x31e923){_0x4a6d29['push'](_0x4a6d29['shift']());}};_0x168c5d(++_0x33bd68);}(_0x3081,0x131));var _0x1308=function(_0x36785f,_0x3e631d){_0x36785f=_0x36785f-0x0;var _0x226396=_0x3081[_0x36785f];return _0x226396;};'use strict';var multer=require(_0x1308('0x0'));var util=require(_0x1308('0x1'));var path=require(_0x1308('0x2'));var timeout=require('connect-timeout');var express=require(_0x1308('0x3'));var router=express[_0x1308('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1308('0x5'));var config=require(_0x1308('0x6'));var controller=require(_0x1308('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1308('0x8')]);router[_0x1308('0x9')](_0x1308('0xa'),auth['isAuthenticated'](),controller[_0x1308('0xb')]);router['get']('/index',auth[_0x1308('0xc')](),controller[_0x1308('0xd')]);router[_0x1308('0x9')](_0x1308('0xe'),auth[_0x1308('0xc')](),controller[_0x1308('0xf')]);router[_0x1308('0x10')]('/',auth[_0x1308('0xc')](),controller[_0x1308('0x11')]);router[_0x1308('0x12')](_0x1308('0xe'),auth[_0x1308('0xc')](),controller['update']);router['delete'](_0x1308('0xe'),auth[_0x1308('0xc')](),controller[_0x1308('0x13')]);module[_0x1308('0x14')]=router; \ No newline at end of file +var _0xeee9=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','update','exports','multer','util'];(function(_0x4cc8e7,_0x5c5f89){var _0x2bdb81=function(_0x1e8521){while(--_0x1e8521){_0x4cc8e7['push'](_0x4cc8e7['shift']());}};_0x2bdb81(++_0x5c5f89);}(_0xeee9,0x1d2));var _0x9eee=function(_0x55c5f0,_0x10e109){_0x55c5f0=_0x55c5f0-0x0;var _0x498e2a=_0xeee9[_0x55c5f0];return _0x498e2a;};'use strict';var multer=require(_0x9eee('0x0'));var util=require(_0x9eee('0x1'));var path=require(_0x9eee('0x2'));var timeout=require('connect-timeout');var express=require(_0x9eee('0x3'));var router=express[_0x9eee('0x4')]();var fs_extra=require(_0x9eee('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9eee('0x6'));var config=require(_0x9eee('0x7'));var controller=require(_0x9eee('0x8'));router[_0x9eee('0x9')]('/',auth[_0x9eee('0xa')](),controller['index']);router[_0x9eee('0x9')](_0x9eee('0xb'),auth[_0x9eee('0xa')](),controller[_0x9eee('0xc')]);router[_0x9eee('0x9')]('/index',auth[_0x9eee('0xa')](),controller['getVoiceQueuesReport']);router[_0x9eee('0x9')](_0x9eee('0xd'),auth[_0x9eee('0xa')](),controller['show']);router[_0x9eee('0xe')]('/',auth[_0x9eee('0xa')](),controller[_0x9eee('0xf')]);router['put'](_0x9eee('0xd'),auth[_0x9eee('0xa')](),controller[_0x9eee('0x10')]);router['delete'](_0x9eee('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x9eee('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 7f0dc58..c8552b3 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 _0xd20a=['queuecallerjoinAt','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','exports','STRING','DATE'];(function(_0xf7aa86,_0x171456){var _0x5eb1ed=function(_0x47175f){while(--_0x47175f){_0xf7aa86['push'](_0xf7aa86['shift']());}};_0x5eb1ed(++_0x171456);}(_0xd20a,0xe1));var _0xad20=function(_0x5304c5,_0x5787bb){_0x5304c5=_0x5304c5-0x0;var _0x3131fa=_0xd20a[_0x5304c5];return _0x3131fa;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xad20('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xad20('0x1')]},'calleridnum':{'type':Sequelize[_0xad20('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xad20('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0xad20('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0xad20('0x2')],'set':function(_0x36184e){var _0x1b1d8d=moment(_0x36184e);var _0x4fbf3d=moment(this['getDataValue'](_0xad20('0x3')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x20298a=_0x1b1d8d[_0xad20('0x4')](_0x4fbf3d,_0xad20('0x5'));this[_0xad20('0x6')](_0xad20('0x7'),_0x36184e);this[_0xad20('0x6')](_0xad20('0x8'),_0x20298a||null);}},'position':{'type':Sequelize[_0xad20('0x9')]},'count':{'type':Sequelize[_0xad20('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xad20('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xad20('0x2')]},'queuecallercomplete':{'type':Sequelize[_0xad20('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xad20('0x2')]},'queuecallerexit':{'type':Sequelize[_0xad20('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xad20('0x2')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xad20('0xb')},'originalposition':{'type':Sequelize[_0xad20('0x9')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xad20('0x1')]},'context':{'type':Sequelize[_0xad20('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xad20('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xad20('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xad20('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xad20('0x1')]},'transfer':{'type':Sequelize[_0xad20('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xad20('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xad20('0x1')]},'disposition':{'type':Sequelize[_0xad20('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xad20('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0xad20('0x9')],'defaultValue':0x0},'note':{'type':Sequelize[_0xad20('0x1')]}}; \ No newline at end of file +var _0xd7fb=['setDataValue','queuecallerleaveAt','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds'];(function(_0x37cbb8,_0x180ad2){var _0x50378f=function(_0x312285){while(--_0x312285){_0x37cbb8['push'](_0x37cbb8['shift']());}};_0x50378f(++_0x180ad2);}(_0xd7fb,0xc1));var _0xbd7f=function(_0x2d9989,_0x1211f5){_0x2d9989=_0x2d9989-0x0;var _0x3b18db=_0xd7fb[_0x2d9989];return _0x3b18db;};'use strict';var Sequelize=require(_0xbd7f('0x0'));var moment=require(_0xbd7f('0x1'));module[_0xbd7f('0x2')]={'type':{'type':Sequelize[_0xbd7f('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xbd7f('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xbd7f('0x4')],'set':function(_0x3c78d5){var _0x470371=moment(_0x3c78d5);var _0x33d04b=moment(this[_0xbd7f('0x5')](_0xbd7f('0x6')))[_0xbd7f('0x7')](_0xbd7f('0x8'));var _0x5b0eea=_0x470371[_0xbd7f('0x9')](_0x33d04b,_0xbd7f('0xa'));this[_0xbd7f('0xb')](_0xbd7f('0xc'),_0x3c78d5);this[_0xbd7f('0xb')]('holdtime',_0x5b0eea||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xbd7f('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xbd7f('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xbd7f('0x4')]},'queuecallerexit':{'type':Sequelize[_0xbd7f('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xbd7f('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xbd7f('0xe')},'originalposition':{'type':Sequelize[_0xbd7f('0xf')]},'channel':{'type':Sequelize[_0xbd7f('0x3')]},'connectedlinenum':{'type':Sequelize[_0xbd7f('0x3')]},'connectedlinename':{'type':Sequelize[_0xbd7f('0x3')]},'accountcode':{'type':Sequelize[_0xbd7f('0x3')]},'context':{'type':Sequelize[_0xbd7f('0x3')]},'exten':{'type':Sequelize[_0xbd7f('0x3')]},'priority':{'type':Sequelize[_0xbd7f('0x3')]},'holdtime':{'type':Sequelize[_0xbd7f('0xf')]},'mohtime':{'type':Sequelize[_0xbd7f('0xf')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xbd7f('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xbd7f('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xbd7f('0x3')],'comment':_0xbd7f('0x10')},'transferexten':{'type':Sequelize[_0xbd7f('0x3')]},'transferuniqueid':{'type':Sequelize[_0xbd7f('0x3')]},'disposition':{'type':Sequelize[_0xbd7f('0x3')]},'secondDisposition':{'type':Sequelize[_0xbd7f('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xbd7f('0xf')],'defaultValue':0x0},'note':{'type':Sequelize[_0xbd7f('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 3ac19aa..2577b42 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 _0x8191=['register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','sort','pick','findAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket'];(function(_0x24ed5b,_0x49db60){var _0x23479a=function(_0x1bddf3){while(--_0x1bddf3){_0x24ed5b['push'](_0x24ed5b['shift']());}};_0x23479a(++_0x49db60);}(_0x8191,0xe3));var _0x1819=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x8191[_0x5c2c7c];return _0xea7ffe;};'use strict';var emlformat=require(_0x1819('0x0'));var rimraf=require(_0x1819('0x1'));var zipdir=require(_0x1819('0x2'));var jsonpatch=require(_0x1819('0x3'));var rp=require('request-promise');var moment=require(_0x1819('0x4'));var BPromise=require(_0x1819('0x5'));var Mustache=require('mustache');var util=require(_0x1819('0x6'));var path=require(_0x1819('0x7'));var sox=require('sox');var csv=require(_0x1819('0x8'));var ejs=require(_0x1819('0x9'));var fs=require('fs');var fs_extra=require(_0x1819('0xa'));var _=require(_0x1819('0xb'));var squel=require(_0x1819('0xc'));var crypto=require('crypto');var jsforce=require(_0x1819('0xd'));var deskjs=require(_0x1819('0xe'));var toCsv=require(_0x1819('0x8'));var querystring=require(_0x1819('0xf'));var Papa=require(_0x1819('0x10'));var Redis=require('ioredis');var authService=require(_0x1819('0x11'));var qs=require(_0x1819('0x12'));var as=require(_0x1819('0x13'));var hardwareService=require(_0x1819('0x14'));var logger=require(_0x1819('0x15'))('api');var utils=require(_0x1819('0x16'));var config=require(_0x1819('0x17'));var licenseUtil=require(_0x1819('0x18'));var db=require(_0x1819('0x19'))['db'];config[_0x1819('0x1a')]=_[_0x1819('0x1b')](config['redis'],{'host':_0x1819('0x1c'),'port':0x18eb});var socket=require(_0x1819('0x1d'))(new Redis(config['redis']));require(_0x1819('0x1e'))[_0x1819('0x1f')](socket);function respondWithStatusCode(_0x44e186,_0x3972da){_0x3972da=_0x3972da||0xcc;return function(_0x5e396b){if(_0x5e396b){return _0x44e186[_0x1819('0x20')](_0x3972da);}return _0x44e186[_0x1819('0x21')](_0x3972da)[_0x1819('0x22')]();};}function respondWithResult(_0x59c689,_0x3b3b53){_0x3b3b53=_0x3b3b53||0xc8;return function(_0x5460ba){if(_0x5460ba){return _0x59c689[_0x1819('0x21')](_0x3b3b53)['json'](_0x5460ba);}};}function respondWithFilteredResult(_0x3874c2,_0x2f1dfc){return function(_0x19b99f){if(_0x19b99f){var _0x17e102=typeof _0x2f1dfc['offset']===_0x1819('0x23')&&typeof _0x2f1dfc[_0x1819('0x24')]===_0x1819('0x23');var _0x20a415=_0x19b99f[_0x1819('0x25')];var _0x4f1388=_0x17e102?0x0:_0x2f1dfc['offset'];var _0x3e2c57=_0x17e102?_0x19b99f[_0x1819('0x25')]:_0x2f1dfc[_0x1819('0x26')]+_0x2f1dfc[_0x1819('0x24')];var _0x5d80ab;if(_0x3e2c57>=_0x20a415){_0x3e2c57=_0x20a415;_0x5d80ab=0xc8;}else{_0x5d80ab=0xce;}_0x3874c2['status'](_0x5d80ab);return _0x3874c2[_0x1819('0x27')](_0x1819('0x28'),_0x4f1388+'-'+_0x3e2c57+'/'+_0x20a415)['json'](_0x19b99f);}return null;};}function patchUpdates(_0x52aea9){return function(_0x337449){try{jsonpatch['apply'](_0x337449,_0x52aea9,!![]);}catch(_0x369032){return BPromise[_0x1819('0x29')](_0x369032);}return _0x337449['save']();};}function saveUpdates(_0xbf4540,_0x13d08d){return function(_0x23c669){if(_0x23c669){return _0x23c669[_0x1819('0x2a')](_0xbf4540)[_0x1819('0x2b')](function(_0x579d8d){return _0x579d8d;});}return null;};}function removeEntity(_0x3fd256,_0x4e78ed){return function(_0x59e0d7){if(_0x59e0d7){return _0x59e0d7[_0x1819('0x2c')]()['then'](function(){_0x3fd256[_0x1819('0x21')](0xcc)[_0x1819('0x22')]();});}};}function handleEntityNotFound(_0x2ca200,_0x5b0b95){return function(_0x50dd71){if(!_0x50dd71){_0x2ca200[_0x1819('0x20')](0x194);}return _0x50dd71;};}function handleError(_0x3e0956,_0x4cf4da){_0x4cf4da=_0x4cf4da||0x1f4;return function(_0x4fd2cb){logger[_0x1819('0x2d')](_0x4fd2cb[_0x1819('0x2e')]);if(_0x4fd2cb[_0x1819('0x2f')]){delete _0x4fd2cb[_0x1819('0x2f')];}_0x3e0956[_0x1819('0x21')](_0x4cf4da)[_0x1819('0x30')](_0x4fd2cb);};}exports[_0x1819('0x31')]=function(_0x55c187,_0x619897){var _0x4fc900={},_0x2fe3ca={},_0x391255={'count':0x0,'rows':[]};var _0x3866c1=_[_0x1819('0x32')](db[_0x1819('0x33')]['rawAttributes'],function(_0x4fcd1b){return{'name':_0x4fcd1b[_0x1819('0x34')],'type':_0x4fcd1b['type'][_0x1819('0x35')]};});_0x2fe3ca[_0x1819('0x36')]=_[_0x1819('0x32')](_0x3866c1,_0x1819('0x2f'));_0x2fe3ca[_0x1819('0x37')]=_[_0x1819('0x38')](_0x55c187['query']);_0x2fe3ca[_0x1819('0x39')]=_[_0x1819('0x3a')](_0x2fe3ca[_0x1819('0x36')],_0x2fe3ca[_0x1819('0x37')]);_0x4fc900['attributes']=_[_0x1819('0x3a')](_0x2fe3ca[_0x1819('0x36')],qs[_0x1819('0x3b')](_0x55c187[_0x1819('0x37')]['fields']));_0x4fc900[_0x1819('0x3c')]=_0x4fc900[_0x1819('0x3c')][_0x1819('0x3d')]?_0x4fc900[_0x1819('0x3c')]:_0x2fe3ca[_0x1819('0x36')];if(!_0x55c187[_0x1819('0x37')][_0x1819('0x3e')](_0x1819('0x3f'))){_0x4fc900['limit']=qs[_0x1819('0x24')](_0x55c187['query'][_0x1819('0x24')]);_0x4fc900[_0x1819('0x26')]=qs[_0x1819('0x26')](_0x55c187['query'][_0x1819('0x26')]);}_0x4fc900[_0x1819('0x40')]=qs['sort'](_0x55c187[_0x1819('0x37')]['sort']);_0x4fc900[_0x1819('0x41')]=qs['filters'](_['pick'](_0x55c187[_0x1819('0x37')],_0x2fe3ca[_0x1819('0x39')]),_0x3866c1);if(_0x55c187[_0x1819('0x37')][_0x1819('0x42')]){_0x4fc900['where']=_[_0x1819('0x43')](_0x4fc900[_0x1819('0x41')],{'$or':_[_0x1819('0x32')](_0x3866c1,function(_0x2c6766){if(_0x2c6766[_0x1819('0x44')]!==_0x1819('0x45')){var _0x5e317a={};_0x5e317a[_0x2c6766[_0x1819('0x2f')]]={'$like':'%'+_0x55c187[_0x1819('0x37')]['filter']+'%'};return _0x5e317a;}})});}_0x4fc900=_['merge']({},_0x4fc900,_0x55c187[_0x1819('0x46')]);var _0x49e283={'where':_0x4fc900['where']};return db['VoiceQueueReport']['count'](_0x49e283)[_0x1819('0x2b')](function(_0x4ddcf1){_0x391255['count']=_0x4ddcf1;if(_0x55c187[_0x1819('0x37')][_0x1819('0x47')]){_0x4fc900[_0x1819('0x48')]=[{'all':!![]}];}return db[_0x1819('0x33')]['findAll'](_0x4fc900);})[_0x1819('0x2b')](function(_0x3f0134){_0x391255[_0x1819('0x49')]=_0x3f0134;return _0x391255;})[_0x1819('0x2b')](respondWithFilteredResult(_0x619897,_0x4fc900))[_0x1819('0x4a')](handleError(_0x619897,null));};exports[_0x1819('0x4b')]=function(_0x317778,_0xd1575f){var _0x5cb8e3={'raw':![],'where':{'id':_0x317778[_0x1819('0x4c')]['id']}},_0x384190={};_0x384190[_0x1819('0x36')]=_[_0x1819('0x38')](db[_0x1819('0x33')][_0x1819('0x4d')]);_0x384190['query']=_[_0x1819('0x38')](_0x317778[_0x1819('0x37')]);_0x384190['filters']=_[_0x1819('0x3a')](_0x384190[_0x1819('0x36')],_0x384190[_0x1819('0x37')]);_0x5cb8e3[_0x1819('0x3c')]=_[_0x1819('0x3a')](_0x384190[_0x1819('0x36')],qs['fields'](_0x317778[_0x1819('0x37')][_0x1819('0x3b')]));_0x5cb8e3[_0x1819('0x3c')]=_0x5cb8e3[_0x1819('0x3c')][_0x1819('0x3d')]?_0x5cb8e3[_0x1819('0x3c')]:_0x384190[_0x1819('0x36')];if(_0x317778[_0x1819('0x37')][_0x1819('0x47')]){_0x5cb8e3['include']=[{'all':!![]}];}_0x5cb8e3=_[_0x1819('0x43')]({},_0x5cb8e3,_0x317778['options']);return db['VoiceQueueReport'][_0x1819('0x4e')](_0x5cb8e3)[_0x1819('0x2b')](handleEntityNotFound(_0xd1575f,null))[_0x1819('0x2b')](respondWithResult(_0xd1575f,null))[_0x1819('0x4a')](handleError(_0xd1575f,null));};exports[_0x1819('0x4f')]=function(_0x350e34,_0x5e6b78){return db[_0x1819('0x33')]['create'](_0x350e34[_0x1819('0x50')],{})['then'](respondWithResult(_0x5e6b78,0xc9))[_0x1819('0x4a')](handleError(_0x5e6b78,null));};exports['update']=function(_0x4ce206,_0xdb56ab){if(_0x4ce206[_0x1819('0x50')]['id']){delete _0x4ce206['body']['id'];}return db[_0x1819('0x33')][_0x1819('0x4e')]({'where':{'id':_0x4ce206[_0x1819('0x4c')]['id']}})[_0x1819('0x2b')](handleEntityNotFound(_0xdb56ab,null))['then'](saveUpdates(_0x4ce206['body'],null))[_0x1819('0x2b')](respondWithResult(_0xdb56ab,null))[_0x1819('0x4a')](handleError(_0xdb56ab,null));};exports[_0x1819('0x2c')]=function(_0x4a205d,_0x5dc4df){return db[_0x1819('0x33')][_0x1819('0x4e')]({'where':{'id':_0x4a205d[_0x1819('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5dc4df,null))['then'](removeEntity(_0x5dc4df,null))[_0x1819('0x4a')](handleError(_0x5dc4df,null));};exports[_0x1819('0x51')]=function(_0x487133,_0x4865ff){return db['VoiceQueueReport']['describe']()[_0x1819('0x2b')](respondWithResult(_0x4865ff,null))[_0x1819('0x4a')](handleError(_0x4865ff,null));};exports['getVoiceQueuesReport']=function(_0x28f941,_0x106275){var _0x168a8a={},_0x4d6025={},_0x4ef6a9={'count':0x0,'rows':[]};_0x4d6025[_0x1819('0x36')]=_[_0x1819('0x38')](db[_0x1819('0x33')]['rawAttributes']);_0x4d6025[_0x1819('0x37')]=_[_0x1819('0x38')](_0x28f941['query']);_0x4d6025[_0x1819('0x39')]=_['intersection'](_0x4d6025['model'],_0x4d6025[_0x1819('0x37')]);_0x168a8a[_0x1819('0x3c')]=_[_0x1819('0x3a')](_0x4d6025[_0x1819('0x36')],qs[_0x1819('0x3b')](_0x28f941[_0x1819('0x37')][_0x1819('0x3b')]));_0x168a8a['attributes']=_0x168a8a[_0x1819('0x3c')][_0x1819('0x3d')]?_0x168a8a[_0x1819('0x3c')]:_0x4d6025['model'];if(!_0x28f941[_0x1819('0x37')][_0x1819('0x3e')](_0x1819('0x3f'))){_0x168a8a[_0x1819('0x24')]=qs[_0x1819('0x24')](_0x28f941[_0x1819('0x37')][_0x1819('0x24')]);_0x168a8a[_0x1819('0x26')]=qs[_0x1819('0x26')](_0x28f941['query'][_0x1819('0x26')]);}_0x168a8a[_0x1819('0x40')]=qs[_0x1819('0x52')](_0x28f941['query'][_0x1819('0x52')]);_0x168a8a[_0x1819('0x41')]=qs[_0x1819('0x39')](_[_0x1819('0x53')](_0x28f941[_0x1819('0x37')],_0x4d6025[_0x1819('0x39')]));if(_0x28f941[_0x1819('0x37')]['filter']){_0x168a8a[_0x1819('0x41')]=_[_0x1819('0x43')](_0x168a8a[_0x1819('0x41')],{'$or':_[_0x1819('0x32')](_0x168a8a[_0x1819('0x3c')],function(_0x149436){var _0x3c680d={};_0x3c680d[_0x149436]={'$like':'%'+_0x28f941[_0x1819('0x37')][_0x1819('0x42')]+'%'};return _0x3c680d;})});}_0x168a8a=_[_0x1819('0x43')]({},_0x168a8a,_0x28f941[_0x1819('0x46')]);var _0x1775eb={'where':_0x168a8a['where']};return db[_0x1819('0x33')]['count'](_0x1775eb)['then'](function(_0x452e6b){_0x4ef6a9['count']=_0x452e6b;if(_0x28f941[_0x1819('0x37')][_0x1819('0x47')]){_0x168a8a[_0x1819('0x48')]=[{'all':!![]}];}return db[_0x1819('0x33')][_0x1819('0x54')](_0x168a8a);})[_0x1819('0x2b')](function(_0xe1378c){_0x4ef6a9[_0x1819('0x49')]=_0xe1378c;return _0x4ef6a9;})[_0x1819('0x2b')](respondWithFilteredResult(_0x106275,_0x168a8a,_0x1819('0x55')))[_0x1819('0x4a')](handleError(_0x106275,null,_0x1819('0x55')));}; \ No newline at end of file +var _0xdf85=['fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','limit','undefined','count','offset','apply','save','update','destroy','error','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','then','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','getVoiceQueuesReport','nolimit','order','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x456066,_0x44930c){var _0x5a069a=function(_0x2ed314){while(--_0x2ed314){_0x456066['push'](_0x456066['shift']());}};_0x5a069a(++_0x44930c);}(_0xdf85,0xdb));var _0x5df8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdf85[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x5df8('0x0'));var rimraf=require(_0x5df8('0x1'));var zipdir=require(_0x5df8('0x2'));var jsonpatch=require(_0x5df8('0x3'));var rp=require(_0x5df8('0x4'));var moment=require(_0x5df8('0x5'));var BPromise=require(_0x5df8('0x6'));var Mustache=require(_0x5df8('0x7'));var util=require(_0x5df8('0x8'));var path=require('path');var sox=require(_0x5df8('0x9'));var csv=require(_0x5df8('0xa'));var ejs=require(_0x5df8('0xb'));var fs=require('fs');var fs_extra=require(_0x5df8('0xc'));var _=require('lodash');var squel=require(_0x5df8('0xd'));var crypto=require(_0x5df8('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5df8('0xf'));var Papa=require(_0x5df8('0x10'));var Redis=require('ioredis');var authService=require(_0x5df8('0x11'));var qs=require(_0x5df8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5df8('0x13'));var logger=require('../../config/logger')(_0x5df8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5df8('0x15'))['db'];config[_0x5df8('0x16')]=_[_0x5df8('0x17')](config[_0x5df8('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5df8('0x16')]));require('./voiceQueueReport.socket')[_0x5df8('0x18')](socket);function respondWithStatusCode(_0x1b3388,_0x5713a0){_0x5713a0=_0x5713a0||0xcc;return function(_0x440ce0){if(_0x440ce0){return _0x1b3388[_0x5df8('0x19')](_0x5713a0);}return _0x1b3388[_0x5df8('0x1a')](_0x5713a0)[_0x5df8('0x1b')]();};}function respondWithResult(_0x34d531,_0x1cf679){_0x1cf679=_0x1cf679||0xc8;return function(_0x40afa0){if(_0x40afa0){return _0x34d531[_0x5df8('0x1a')](_0x1cf679)[_0x5df8('0x1c')](_0x40afa0);}};}function respondWithFilteredResult(_0x248585,_0x2e041a){return function(_0x12f7e7){if(_0x12f7e7){var _0xd25c67=typeof _0x2e041a['offset']==='undefined'&&typeof _0x2e041a[_0x5df8('0x1d')]===_0x5df8('0x1e');var _0x4ea06f=_0x12f7e7[_0x5df8('0x1f')];var _0x3f2900=_0xd25c67?0x0:_0x2e041a[_0x5df8('0x20')];var _0x33b325=_0xd25c67?_0x12f7e7[_0x5df8('0x1f')]:_0x2e041a[_0x5df8('0x20')]+_0x2e041a['limit'];var _0x2311c9;if(_0x33b325>=_0x4ea06f){_0x33b325=_0x4ea06f;_0x2311c9=0xc8;}else{_0x2311c9=0xce;}_0x248585[_0x5df8('0x1a')](_0x2311c9);return _0x248585['set']('Content-Range',_0x3f2900+'-'+_0x33b325+'/'+_0x4ea06f)[_0x5df8('0x1c')](_0x12f7e7);}return null;};}function patchUpdates(_0x5df2f8){return function(_0x1ec85a){try{jsonpatch[_0x5df8('0x21')](_0x1ec85a,_0x5df2f8,!![]);}catch(_0x23cb75){return BPromise['reject'](_0x23cb75);}return _0x1ec85a[_0x5df8('0x22')]();};}function saveUpdates(_0x13903d,_0x30415a){return function(_0x378acd){if(_0x378acd){return _0x378acd[_0x5df8('0x23')](_0x13903d)['then'](function(_0x464b55){return _0x464b55;});}return null;};}function removeEntity(_0x34ee62,_0x3b352a){return function(_0x1a340c){if(_0x1a340c){return _0x1a340c[_0x5df8('0x24')]()['then'](function(){_0x34ee62['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56a38a,_0x30590a){return function(_0x3abd40){if(!_0x3abd40){_0x56a38a['sendStatus'](0x194);}return _0x3abd40;};}function handleError(_0x573035,_0x1abdb6){_0x1abdb6=_0x1abdb6||0x1f4;return function(_0x3f7648){logger[_0x5df8('0x25')](_0x3f7648[_0x5df8('0x26')]);if(_0x3f7648[_0x5df8('0x27')]){delete _0x3f7648[_0x5df8('0x27')];}_0x573035[_0x5df8('0x1a')](_0x1abdb6)[_0x5df8('0x28')](_0x3f7648);};}exports[_0x5df8('0x29')]=function(_0x45bb84,_0x5c9815){var _0x442a89={},_0x13b6b4={},_0x5971c3={'count':0x0,'rows':[]};var _0x18eecc=_['map'](db[_0x5df8('0x2a')][_0x5df8('0x2b')],function(_0x5a3cac){return{'name':_0x5a3cac[_0x5df8('0x2c')],'type':_0x5a3cac[_0x5df8('0x2d')]['key']};});_0x13b6b4[_0x5df8('0x2e')]=_[_0x5df8('0x2f')](_0x18eecc,_0x5df8('0x27'));_0x13b6b4[_0x5df8('0x30')]=_[_0x5df8('0x31')](_0x45bb84[_0x5df8('0x30')]);_0x13b6b4['filters']=_[_0x5df8('0x32')](_0x13b6b4[_0x5df8('0x2e')],_0x13b6b4['query']);_0x442a89[_0x5df8('0x33')]=_['intersection'](_0x13b6b4[_0x5df8('0x2e')],qs[_0x5df8('0x34')](_0x45bb84[_0x5df8('0x30')][_0x5df8('0x34')]));_0x442a89[_0x5df8('0x33')]=_0x442a89[_0x5df8('0x33')][_0x5df8('0x35')]?_0x442a89['attributes']:_0x13b6b4['model'];if(!_0x45bb84['query'][_0x5df8('0x36')]('nolimit')){_0x442a89[_0x5df8('0x1d')]=qs['limit'](_0x45bb84[_0x5df8('0x30')][_0x5df8('0x1d')]);_0x442a89['offset']=qs[_0x5df8('0x20')](_0x45bb84[_0x5df8('0x30')]['offset']);}_0x442a89['order']=qs[_0x5df8('0x37')](_0x45bb84[_0x5df8('0x30')][_0x5df8('0x37')]);_0x442a89[_0x5df8('0x38')]=qs['filters'](_['pick'](_0x45bb84[_0x5df8('0x30')],_0x13b6b4[_0x5df8('0x39')]),_0x18eecc);if(_0x45bb84['query'][_0x5df8('0x3a')]){_0x442a89['where']=_[_0x5df8('0x3b')](_0x442a89['where'],{'$or':_['map'](_0x18eecc,function(_0x379ba0){if(_0x379ba0[_0x5df8('0x2d')]!=='VIRTUAL'){var _0xb9e303={};_0xb9e303[_0x379ba0[_0x5df8('0x27')]]={'$like':'%'+_0x45bb84['query'][_0x5df8('0x3a')]+'%'};return _0xb9e303;}})});}_0x442a89=_['merge']({},_0x442a89,_0x45bb84['options']);var _0x17c6db={'where':_0x442a89[_0x5df8('0x38')]};return db[_0x5df8('0x2a')][_0x5df8('0x1f')](_0x17c6db)[_0x5df8('0x3c')](function(_0x366e18){_0x5971c3[_0x5df8('0x1f')]=_0x366e18;if(_0x45bb84['query']['includeAll']){_0x442a89[_0x5df8('0x3d')]=[{'all':!![]}];}return db[_0x5df8('0x2a')][_0x5df8('0x3e')](_0x442a89);})[_0x5df8('0x3c')](function(_0x16752f){_0x5971c3[_0x5df8('0x3f')]=_0x16752f;return _0x5971c3;})[_0x5df8('0x3c')](respondWithFilteredResult(_0x5c9815,_0x442a89))[_0x5df8('0x40')](handleError(_0x5c9815,null));};exports[_0x5df8('0x41')]=function(_0x202939,_0x4f32f5){var _0x1dfc80={'raw':![],'where':{'id':_0x202939[_0x5df8('0x42')]['id']}},_0x4f3d32={};_0x4f3d32[_0x5df8('0x2e')]=_[_0x5df8('0x31')](db[_0x5df8('0x2a')][_0x5df8('0x2b')]);_0x4f3d32[_0x5df8('0x30')]=_[_0x5df8('0x31')](_0x202939['query']);_0x4f3d32[_0x5df8('0x39')]=_[_0x5df8('0x32')](_0x4f3d32['model'],_0x4f3d32[_0x5df8('0x30')]);_0x1dfc80[_0x5df8('0x33')]=_['intersection'](_0x4f3d32['model'],qs[_0x5df8('0x34')](_0x202939[_0x5df8('0x30')][_0x5df8('0x34')]));_0x1dfc80['attributes']=_0x1dfc80[_0x5df8('0x33')][_0x5df8('0x35')]?_0x1dfc80[_0x5df8('0x33')]:_0x4f3d32[_0x5df8('0x2e')];if(_0x202939[_0x5df8('0x30')][_0x5df8('0x43')]){_0x1dfc80[_0x5df8('0x3d')]=[{'all':!![]}];}_0x1dfc80=_[_0x5df8('0x3b')]({},_0x1dfc80,_0x202939[_0x5df8('0x44')]);return db[_0x5df8('0x2a')][_0x5df8('0x45')](_0x1dfc80)['then'](handleEntityNotFound(_0x4f32f5,null))[_0x5df8('0x3c')](respondWithResult(_0x4f32f5,null))[_0x5df8('0x40')](handleError(_0x4f32f5,null));};exports[_0x5df8('0x46')]=function(_0x5d4b41,_0x221968){return db[_0x5df8('0x2a')]['create'](_0x5d4b41[_0x5df8('0x47')],{})[_0x5df8('0x3c')](respondWithResult(_0x221968,0xc9))[_0x5df8('0x40')](handleError(_0x221968,null));};exports[_0x5df8('0x23')]=function(_0x52aeed,_0x288c25){if(_0x52aeed[_0x5df8('0x47')]['id']){delete _0x52aeed[_0x5df8('0x47')]['id'];}return db['VoiceQueueReport'][_0x5df8('0x45')]({'where':{'id':_0x52aeed[_0x5df8('0x42')]['id']}})[_0x5df8('0x3c')](handleEntityNotFound(_0x288c25,null))[_0x5df8('0x3c')](saveUpdates(_0x52aeed[_0x5df8('0x47')],null))[_0x5df8('0x3c')](respondWithResult(_0x288c25,null))['catch'](handleError(_0x288c25,null));};exports[_0x5df8('0x24')]=function(_0x180781,_0x419236){return db[_0x5df8('0x2a')][_0x5df8('0x45')]({'where':{'id':_0x180781['params']['id']}})[_0x5df8('0x3c')](handleEntityNotFound(_0x419236,null))[_0x5df8('0x3c')](removeEntity(_0x419236,null))[_0x5df8('0x40')](handleError(_0x419236,null));};exports[_0x5df8('0x48')]=function(_0x1b5245,_0x1ce0c9){return db[_0x5df8('0x2a')][_0x5df8('0x48')]()['then'](respondWithResult(_0x1ce0c9,null))[_0x5df8('0x40')](handleError(_0x1ce0c9,null));};exports[_0x5df8('0x49')]=function(_0x104c6c,_0x10eb39){var _0x9365bf={},_0x6ce6bc={},_0x45c5cd={'count':0x0,'rows':[]};_0x6ce6bc['model']=_['keys'](db['VoiceQueueReport']['rawAttributes']);_0x6ce6bc[_0x5df8('0x30')]=_[_0x5df8('0x31')](_0x104c6c[_0x5df8('0x30')]);_0x6ce6bc['filters']=_['intersection'](_0x6ce6bc['model'],_0x6ce6bc['query']);_0x9365bf[_0x5df8('0x33')]=_[_0x5df8('0x32')](_0x6ce6bc[_0x5df8('0x2e')],qs[_0x5df8('0x34')](_0x104c6c[_0x5df8('0x30')][_0x5df8('0x34')]));_0x9365bf[_0x5df8('0x33')]=_0x9365bf['attributes'][_0x5df8('0x35')]?_0x9365bf[_0x5df8('0x33')]:_0x6ce6bc[_0x5df8('0x2e')];if(!_0x104c6c[_0x5df8('0x30')][_0x5df8('0x36')](_0x5df8('0x4a'))){_0x9365bf['limit']=qs[_0x5df8('0x1d')](_0x104c6c[_0x5df8('0x30')][_0x5df8('0x1d')]);_0x9365bf[_0x5df8('0x20')]=qs[_0x5df8('0x20')](_0x104c6c[_0x5df8('0x30')][_0x5df8('0x20')]);}_0x9365bf[_0x5df8('0x4b')]=qs[_0x5df8('0x37')](_0x104c6c['query'][_0x5df8('0x37')]);_0x9365bf[_0x5df8('0x38')]=qs[_0x5df8('0x39')](_[_0x5df8('0x4c')](_0x104c6c[_0x5df8('0x30')],_0x6ce6bc[_0x5df8('0x39')]));if(_0x104c6c[_0x5df8('0x30')]['filter']){_0x9365bf[_0x5df8('0x38')]=_[_0x5df8('0x3b')](_0x9365bf[_0x5df8('0x38')],{'$or':_[_0x5df8('0x2f')](_0x9365bf['attributes'],function(_0x4726fd){var _0xc1e9b4={};_0xc1e9b4[_0x4726fd]={'$like':'%'+_0x104c6c[_0x5df8('0x30')][_0x5df8('0x3a')]+'%'};return _0xc1e9b4;})});}_0x9365bf=_['merge']({},_0x9365bf,_0x104c6c[_0x5df8('0x44')]);var _0x2c9f16={'where':_0x9365bf['where']};return db[_0x5df8('0x2a')][_0x5df8('0x1f')](_0x2c9f16)['then'](function(_0x11d268){_0x45c5cd['count']=_0x11d268;if(_0x104c6c[_0x5df8('0x30')][_0x5df8('0x43')]){_0x9365bf[_0x5df8('0x3d')]=[{'all':!![]}];}return db[_0x5df8('0x2a')][_0x5df8('0x3e')](_0x9365bf);})['then'](function(_0x517901){_0x45c5cd['rows']=_0x517901;return _0x45c5cd;})[_0x5df8('0x3c')](respondWithFilteredResult(_0x10eb39,_0x9365bf,_0x5df8('0x49')))[_0x5df8('0x40')](handleError(_0x10eb39,null,_0x5df8('0x49')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 3f05a16..57d3edb 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 _0x4d92=['VoiceQueueReport','setMaxListeners','save','update','emit','exports','events','../../mysqldb'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x4d92,0x1ee));var _0x24d9=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x4d92[_0xc4001c];return _0x49f7bc;};'use strict';var EventEmitter=require(_0x24d9('0x0'));var VoiceQueueReport=require(_0x24d9('0x1'))['db'][_0x24d9('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x24d9('0x3')](0x0);var events={'afterCreate':_0x24d9('0x4'),'afterUpdate':_0x24d9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5b2066){return function(_0x1103f1,_0x2e8423,_0x1ae8dc){VoiceQueueReportEvents[_0x24d9('0x6')](_0x5b2066+':'+_0x1103f1['id'],_0x1103f1);VoiceQueueReportEvents['emit'](_0x5b2066,_0x1103f1);_0x1ae8dc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x24d9('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xcdd4=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update'];(function(_0xc0d9bc,_0x2bd6be){var _0x32ff73=function(_0x28c592){while(--_0x28c592){_0xc0d9bc['push'](_0xc0d9bc['shift']());}};_0x32ff73(++_0x2bd6be);}(_0xcdd4,0x12e));var _0x4cdd=function(_0x5899f6,_0x1cdb9a){_0x5899f6=_0x5899f6-0x0;var _0x2e19fd=_0xcdd4[_0x5899f6];return _0x2e19fd;};'use strict';var EventEmitter=require(_0x4cdd('0x0'));var VoiceQueueReport=require(_0x4cdd('0x1'))['db'][_0x4cdd('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x4cdd('0x3')](0x0);var events={'afterCreate':_0x4cdd('0x4'),'afterUpdate':_0x4cdd('0x5'),'afterDestroy':_0x4cdd('0x6')};function emitEvent(_0x24072a){return function(_0x2024ff,_0x357cca,_0x11cde9){VoiceQueueReportEvents[_0x4cdd('0x7')](_0x24072a+':'+_0x2024ff['id'],_0x2024ff);VoiceQueueReportEvents[_0x4cdd('0x7')](_0x24072a,_0x2024ff);_0x11cde9(null);};}for(var e in events){if(events[_0x4cdd('0x8')](e)){var event=events[e];VoiceQueueReport[_0x4cdd('0x9')](e,emitEvent(event));}}module[_0x4cdd('0xa')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 71706fe..df7115f 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 _0x1332=['rimraf','../../config/environment','exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_0x1332,0x157));var _0x2133=function(_0x89c2bd,_0x42013d){_0x89c2bd=_0x89c2bd-0x0;var _0x3a216f=_0x1332[_0x89c2bd];return _0x3a216f;};'use strict';var _=require(_0x2133('0x0'));var util=require(_0x2133('0x1'));var logger=require(_0x2133('0x2'))('api');var moment=require(_0x2133('0x3'));var BPromise=require(_0x2133('0x4'));var rp=require(_0x2133('0x5'));var fs=require('fs');var path=require(_0x2133('0x6'));var rimraf=require(_0x2133('0x7'));var config=require(_0x2133('0x8'));var attributes=require('./voiceQueueReport.attributes');module[_0x2133('0x9')]=function(_0xbb3f7,_0xb170a){return _0xbb3f7[_0x2133('0xa')](_0x2133('0xb'),attributes,{'tableName':_0x2133('0xc'),'paranoid':![],'indexes':[{'fields':[_0x2133('0xd')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8284=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','util'];(function(_0x1d36f3,_0x29547e){var _0x83aebc=function(_0x1a5d47){while(--_0x1a5d47){_0x1d36f3['push'](_0x1d36f3['shift']());}};_0x83aebc(++_0x29547e);}(_0x8284,0x76));var _0x4828=function(_0x23adab,_0x543e43){_0x23adab=_0x23adab-0x0;var _0x3e1c8b=_0x8284[_0x23adab];return _0x3e1c8b;};'use strict';var _=require(_0x4828('0x0'));var util=require(_0x4828('0x1'));var logger=require(_0x4828('0x2'))(_0x4828('0x3'));var moment=require(_0x4828('0x4'));var BPromise=require(_0x4828('0x5'));var rp=require(_0x4828('0x6'));var fs=require('fs');var path=require(_0x4828('0x7'));var rimraf=require('rimraf');var config=require(_0x4828('0x8'));var attributes=require(_0x4828('0x9'));module[_0x4828('0xa')]=function(_0x2316ab,_0x1a3811){return _0x2316ab[_0x4828('0xb')](_0x4828('0xc'),attributes,{'tableName':_0x4828('0xd'),'paranoid':![],'indexes':[{'fields':[_0x4828('0xe')]},{'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 2e09c03..3b025b8 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 _0xbecb=['GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','limit','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','VoiceQueueReport','findAll','options','raw','include','map','attributes','model'];(function(_0x427611,_0x180ae8){var _0x97539e=function(_0x564f09){while(--_0x564f09){_0x427611['push'](_0x427611['shift']());}};_0x97539e(++_0x180ae8);}(_0xbecb,0xb0));var _0xbbec=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xbecb[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require(_0xbbec('0x0'));var moment=require(_0xbbec('0x1'));var BPromise=require(_0xbbec('0x2'));var rs=require(_0xbbec('0x3'));var fs=require('fs');var Redis=require(_0xbbec('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbbec('0x5'))(_0xbbec('0x6'));var config=require('../../config/environment');var jayson=require(_0xbbec('0x7'));var client=jayson[_0xbbec('0x8')]['http']({'port':0x232a});config[_0xbbec('0x9')]=_[_0xbbec('0xa')](config[_0xbbec('0x9')],{'host':_0xbbec('0xb'),'port':0x18eb});var socket=require(_0xbbec('0xc'))(new Redis(config[_0xbbec('0x9')]));require('./voiceQueueReport.socket')[_0xbbec('0xd')](socket);function respondWithRpcPromise(_0x59b7e9,_0x1db36d,_0x4c0906){return new BPromise(function(_0x3ce4a1,_0x52392d){return client[_0xbbec('0xe')](_0x59b7e9,_0x4c0906)[_0xbbec('0xf')](function(_0x437040){logger[_0xbbec('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x1db36d,_0xbbec('0x11'));logger[_0xbbec('0x12')](_0xbbec('0x13'),_0x1db36d,_0xbbec('0x11'),JSON[_0xbbec('0x14')](_0x437040));if(_0x437040[_0xbbec('0x15')]){if(_0x437040['error'][_0xbbec('0x16')]===0x1f4){logger[_0xbbec('0x15')](_0xbbec('0x17'),_0x1db36d,_0x437040[_0xbbec('0x15')][_0xbbec('0x18')]);return _0x52392d(_0x437040['error'][_0xbbec('0x18')]);}logger[_0xbbec('0x15')](_0xbbec('0x17'),_0x1db36d,_0x437040[_0xbbec('0x15')][_0xbbec('0x18')]);return _0x3ce4a1(_0x437040[_0xbbec('0x15')][_0xbbec('0x18')]);}else{logger['info'](_0xbbec('0x17'),_0x1db36d,_0xbbec('0x11'));_0x3ce4a1(_0x437040[_0xbbec('0x19')]['message']);}})['catch'](function(_0x47a377){logger['error'](_0xbbec('0x17'),_0x1db36d,_0x47a377);_0x52392d(_0x47a377);});});}exports['GetVoiceQueueReport']=function(_0x4a26c8){var _0x53ecda=this;return new Promise(function(_0x1c669d,_0x4a9358){return db[_0xbbec('0x1a')][_0xbbec('0x1b')]({'raw':_0x4a26c8[_0xbbec('0x1c')]?_0x4a26c8[_0xbbec('0x1c')][_0xbbec('0x1d')]===undefined?!![]:![]:!![],'where':_0x4a26c8[_0xbbec('0x1c')]?_0x4a26c8[_0xbbec('0x1c')]['where']||null:null,'attributes':_0x4a26c8[_0xbbec('0x1c')]?_0x4a26c8[_0xbbec('0x1c')]['attributes']||null:null,'limit':_0x4a26c8[_0xbbec('0x1c')]?_0x4a26c8[_0xbbec('0x1c')]['limit']||null:null,'include':_0x4a26c8[_0xbbec('0x1c')]?_0x4a26c8[_0xbbec('0x1c')][_0xbbec('0x1e')]?_[_0xbbec('0x1f')](_0x4a26c8[_0xbbec('0x1c')][_0xbbec('0x1e')],function(_0x4a300a){return{'model':db[_0x4a300a['model']],'as':_0x4a300a['as'],'attributes':_0x4a300a[_0xbbec('0x20')],'include':_0x4a300a[_0xbbec('0x1e')]?_['map'](_0x4a300a['include'],function(_0x194a62){return{'model':db[_0x194a62['model']],'as':_0x194a62['as'],'attributes':_0x194a62[_0xbbec('0x20')],'include':_0x194a62['include']?_['map'](_0x194a62[_0xbbec('0x1e')],function(_0x6d9cc9){return{'model':db[_0x6d9cc9[_0xbbec('0x21')]],'as':_0x6d9cc9['as'],'attributes':_0x6d9cc9[_0xbbec('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x690e7f){logger[_0xbbec('0x10')](_0xbbec('0x22'),_0x4a26c8);logger[_0xbbec('0x12')]('GetVoiceQueueReport',_0x4a26c8,JSON[_0xbbec('0x14')](_0x690e7f));_0x1c669d(_0x690e7f);})[_0xbbec('0x23')](function(_0x318ac2){logger[_0xbbec('0x15')](_0xbbec('0x22'),_0x318ac2[_0xbbec('0x18')],_0x4a26c8);_0x4a9358(_0x53ecda['error'](0x1f4,_0x318ac2[_0xbbec('0x18')]));});});};exports[_0xbbec('0x24')]=function(_0x3a61d7){var _0x430422=this;return new Promise(function(_0x4ffa8f,_0x34c2ac){return db['VoiceQueueReport'][_0xbbec('0x25')](_0x3a61d7['body'],{'raw':_0x3a61d7['options']?_0x3a61d7['options'][_0xbbec('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x1274a4){logger[_0xbbec('0x10')](_0xbbec('0x24'),_0x3a61d7);logger[_0xbbec('0x12')](_0xbbec('0x24'),_0x3a61d7,JSON[_0xbbec('0x14')](_0x1274a4));_0x4ffa8f(_0x1274a4);})['catch'](function(_0xde80b0){logger['error'](_0xbbec('0x24'),_0xde80b0[_0xbbec('0x18')],_0x3a61d7);_0x34c2ac(_0x430422[_0xbbec('0x15')](0x1f4,_0xde80b0[_0xbbec('0x18')]));});});};exports[_0xbbec('0x26')]=function(_0x53a4f0){var _0x3ecda0=this;return new Promise(function(_0x55ed08,_0x185254){return db[_0xbbec('0x1a')][_0xbbec('0x27')](_0x53a4f0[_0xbbec('0x28')],{'raw':_0x53a4f0[_0xbbec('0x1c')]?_0x53a4f0['options'][_0xbbec('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53a4f0[_0xbbec('0x1c')]?_0x53a4f0[_0xbbec('0x1c')]['where']||null:null,'attributes':_0x53a4f0[_0xbbec('0x1c')]?_0x53a4f0[_0xbbec('0x1c')][_0xbbec('0x20')]||null:null,'limit':_0x53a4f0['options']?_0x53a4f0[_0xbbec('0x1c')][_0xbbec('0x29')]||null:null})[_0xbbec('0xf')](function(_0x7d45ef){logger[_0xbbec('0x10')](_0xbbec('0x26'),_0x53a4f0);logger[_0xbbec('0x12')](_0xbbec('0x26'),_0x53a4f0,JSON[_0xbbec('0x14')](_0x7d45ef));_0x55ed08(_0x7d45ef);})[_0xbbec('0x23')](function(_0x40cab0){logger[_0xbbec('0x15')](_0xbbec('0x26'),_0x40cab0[_0xbbec('0x18')],_0x53a4f0);_0x185254(_0x3ecda0[_0xbbec('0x15')](0x1f4,_0x40cab0['message']));});});}; \ No newline at end of file +var _0x0562=['attributes','map','include','model','GetVoiceQueueReport','CreateVoiceQueueReport','VoiceQueueReport','create','UpdateVoiceQueueReport','limit','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','findAll','options','raw','where'];(function(_0x27bc7a,_0xad4683){var _0xc90f74=function(_0x203bb2){while(--_0x203bb2){_0x27bc7a['push'](_0x27bc7a['shift']());}};_0xc90f74(++_0xad4683);}(_0x0562,0x16a));var _0x2056=function(_0x58122d,_0x3db6a0){_0x58122d=_0x58122d-0x0;var _0x2551ec=_0x0562[_0x58122d];return _0x2551ec;};'use strict';var _=require('lodash');var util=require(_0x2056('0x0'));var moment=require('moment');var BPromise=require(_0x2056('0x1'));var rs=require(_0x2056('0x2'));var fs=require('fs');var Redis=require(_0x2056('0x3'));var db=require(_0x2056('0x4'))['db'];var utils=require(_0x2056('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2056('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2056('0x7')][_0x2056('0x8')]({'port':0x232a});config[_0x2056('0x9')]=_[_0x2056('0xa')](config[_0x2056('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2056('0xb'))(new Redis(config['redis']));require(_0x2056('0xc'))[_0x2056('0xd')](socket);function respondWithRpcPromise(_0x13b853,_0x24a40d,_0x1aef24){return new BPromise(function(_0x3da2f6,_0x45068f){return client['request'](_0x13b853,_0x1aef24)['then'](function(_0x1ffc0b){logger['info'](_0x2056('0xe'),_0x24a40d,_0x2056('0xf'));logger[_0x2056('0x10')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x24a40d,_0x2056('0xf'),JSON[_0x2056('0x11')](_0x1ffc0b));if(_0x1ffc0b[_0x2056('0x12')]){if(_0x1ffc0b['error'][_0x2056('0x13')]===0x1f4){logger[_0x2056('0x12')](_0x2056('0xe'),_0x24a40d,_0x1ffc0b[_0x2056('0x12')][_0x2056('0x14')]);return _0x45068f(_0x1ffc0b['error']['message']);}logger[_0x2056('0x12')](_0x2056('0xe'),_0x24a40d,_0x1ffc0b['error']['message']);return _0x3da2f6(_0x1ffc0b['error'][_0x2056('0x14')]);}else{logger[_0x2056('0x15')](_0x2056('0xe'),_0x24a40d,_0x2056('0xf'));_0x3da2f6(_0x1ffc0b[_0x2056('0x16')][_0x2056('0x14')]);}})[_0x2056('0x17')](function(_0x51b930){logger[_0x2056('0x12')](_0x2056('0xe'),_0x24a40d,_0x51b930);_0x45068f(_0x51b930);});});}exports['GetVoiceQueueReport']=function(_0x217bd5){var _0x1202fa=this;return new Promise(function(_0x15d3db,_0x2dd832){return db['VoiceQueueReport'][_0x2056('0x18')]({'raw':_0x217bd5[_0x2056('0x19')]?_0x217bd5[_0x2056('0x19')][_0x2056('0x1a')]===undefined?!![]:![]:!![],'where':_0x217bd5['options']?_0x217bd5['options'][_0x2056('0x1b')]||null:null,'attributes':_0x217bd5[_0x2056('0x19')]?_0x217bd5[_0x2056('0x19')]['attributes']||null:null,'limit':_0x217bd5['options']?_0x217bd5['options']['limit']||null:null,'include':_0x217bd5[_0x2056('0x19')]?_0x217bd5[_0x2056('0x19')]['include']?_['map'](_0x217bd5[_0x2056('0x19')]['include'],function(_0xa8f397){return{'model':db[_0xa8f397['model']],'as':_0xa8f397['as'],'attributes':_0xa8f397[_0x2056('0x1c')],'include':_0xa8f397['include']?_[_0x2056('0x1d')](_0xa8f397[_0x2056('0x1e')],function(_0x183f32){return{'model':db[_0x183f32[_0x2056('0x1f')]],'as':_0x183f32['as'],'attributes':_0x183f32[_0x2056('0x1c')],'include':_0x183f32[_0x2056('0x1e')]?_[_0x2056('0x1d')](_0x183f32[_0x2056('0x1e')],function(_0x45813f){return{'model':db[_0x45813f[_0x2056('0x1f')]],'as':_0x45813f['as'],'attributes':_0x45813f[_0x2056('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e7c5c){logger['info'](_0x2056('0x20'),_0x217bd5);logger[_0x2056('0x10')](_0x2056('0x20'),_0x217bd5,JSON[_0x2056('0x11')](_0x1e7c5c));_0x15d3db(_0x1e7c5c);})['catch'](function(_0x3dacd9){logger[_0x2056('0x12')](_0x2056('0x20'),_0x3dacd9[_0x2056('0x14')],_0x217bd5);_0x2dd832(_0x1202fa[_0x2056('0x12')](0x1f4,_0x3dacd9[_0x2056('0x14')]));});});};exports[_0x2056('0x21')]=function(_0x4de19b){var _0x3c92a4=this;return new Promise(function(_0x5070c8,_0x4f4ec4){return db[_0x2056('0x22')][_0x2056('0x23')](_0x4de19b['body'],{'raw':_0x4de19b[_0x2056('0x19')]?_0x4de19b[_0x2056('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x233577){logger[_0x2056('0x15')]('CreateVoiceQueueReport',_0x4de19b);logger[_0x2056('0x10')](_0x2056('0x21'),_0x4de19b,JSON[_0x2056('0x11')](_0x233577));_0x5070c8(_0x233577);})[_0x2056('0x17')](function(_0xf21903){logger[_0x2056('0x12')](_0x2056('0x21'),_0xf21903[_0x2056('0x14')],_0x4de19b);_0x4f4ec4(_0x3c92a4[_0x2056('0x12')](0x1f4,_0xf21903[_0x2056('0x14')]));});});};exports[_0x2056('0x24')]=function(_0x201238){var _0x4c347f=this;return new Promise(function(_0xbf5789,_0x55e5d0){return db['VoiceQueueReport']['update'](_0x201238['body'],{'raw':_0x201238[_0x2056('0x19')]?_0x201238[_0x2056('0x19')][_0x2056('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x201238[_0x2056('0x19')]?_0x201238['options'][_0x2056('0x1b')]||null:null,'attributes':_0x201238['options']?_0x201238[_0x2056('0x19')][_0x2056('0x1c')]||null:null,'limit':_0x201238[_0x2056('0x19')]?_0x201238[_0x2056('0x19')][_0x2056('0x25')]||null:null})[_0x2056('0x26')](function(_0x3d4934){logger[_0x2056('0x15')](_0x2056('0x24'),_0x201238);logger[_0x2056('0x10')](_0x2056('0x24'),_0x201238,JSON[_0x2056('0x11')](_0x3d4934));_0xbf5789(_0x3d4934);})[_0x2056('0x17')](function(_0x263830){logger[_0x2056('0x12')](_0x2056('0x24'),_0x263830['message'],_0x201238);_0x55e5d0(_0x4c347f['error'](0x1f4,_0x263830[_0x2056('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 087b117..77bfccc 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 _0x6b1d=['length','save','update','emit','register'];(function(_0x30567e,_0xa860af){var _0x48161d=function(_0x1f61cd){while(--_0x1f61cd){_0x30567e['push'](_0x30567e['shift']());}};_0x48161d(++_0xa860af);}(_0x6b1d,0xc9));var _0xd6b1=function(_0x6c40ba,_0x5e39fa){_0x6c40ba=_0x6c40ba-0x0;var _0x7a54dd=_0x6b1d[_0x6c40ba];return _0x7a54dd;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xd6b1('0x0'),'remove',_0xd6b1('0x1')];function createListener(_0x15351b,_0x409fc9){return function(_0x372042){_0x409fc9[_0xd6b1('0x2')](_0x15351b,_0x372042);};}function removeListener(_0x5f3de9,_0x75f22b){return function(){VoiceQueueReportEvents['removeListener'](_0x5f3de9,_0x75f22b);};}exports[_0xd6b1('0x3')]=function(_0x37345b){for(var _0x106639=0x0,_0x29b0f7=events[_0xd6b1('0x4')];_0x106639<_0x29b0f7;_0x106639++){var _0x34bdd6=events[_0x106639];var _0x1adddd=createListener('voiceQueueReport:'+_0x34bdd6,_0x37345b);VoiceQueueReportEvents['on'](_0x34bdd6,_0x1adddd);}}; \ No newline at end of file +var _0x3e03=['emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x4b075e,_0x57874c){var _0x31385c=function(_0x3ab6ef){while(--_0x3ab6ef){_0x4b075e['push'](_0x4b075e['shift']());}};_0x31385c(++_0x57874c);}(_0x3e03,0xc2));var _0x33e0=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0x3e03[_0x381379];return _0x3e1063;};'use strict';var VoiceQueueReportEvents=require(_0x33e0('0x0'));var events=[_0x33e0('0x1'),'remove','update'];function createListener(_0x5a3614,_0x4837d6){return function(_0x5324e5){_0x4837d6[_0x33e0('0x2')](_0x5a3614,_0x5324e5);};}function removeListener(_0x5acfab,_0x221365){return function(){VoiceQueueReportEvents[_0x33e0('0x3')](_0x5acfab,_0x221365);};}exports[_0x33e0('0x4')]=function(_0x36609d){for(var _0x42a979=0x0,_0x558408=events[_0x33e0('0x5')];_0x42a979<_0x558408;_0x42a979++){var _0x577f2a=events[_0x42a979];var _0x2d0a79=createListener(_0x33e0('0x6')+_0x577f2a,_0x36609d);VoiceQueueReportEvents['on'](_0x577f2a,_0x2d0a79);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index c2324f0..9615d8a 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 _0x3b18=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','/:id'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x3b18,0x1d4));var _0x83b1=function(_0x3de5f0,_0x7a560b){_0x3de5f0=_0x3de5f0-0x0;var _0x31a522=_0x3b18[_0x3de5f0];return _0x31a522;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x83b1('0x0'));var express=require(_0x83b1('0x1'));var router=express[_0x83b1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x83b1('0x3'));var interaction=require(_0x83b1('0x4'));var config=require('../../config/environment');var controller=require(_0x83b1('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x83b1('0x6')](_0x83b1('0x7'),auth[_0x83b1('0x8')](),controller[_0x83b1('0x9')]);router[_0x83b1('0xa')]('/',auth[_0x83b1('0x8')](),controller[_0x83b1('0xb')]);router[_0x83b1('0xc')](_0x83b1('0x7'),auth[_0x83b1('0x8')](),controller[_0x83b1('0xd')]);router[_0x83b1('0xe')]('/:id',auth[_0x83b1('0x8')](),controller[_0x83b1('0xf')]);module[_0x83b1('0x10')]=router; \ No newline at end of file +var _0x5119=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','isAuthenticated','show','post','create','put','delete','/:id','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1b4783,_0x3697e7){var _0x30fc2c=function(_0x67eae7){while(--_0x67eae7){_0x1b4783['push'](_0x1b4783['shift']());}};_0x30fc2c(++_0x3697e7);}(_0x5119,0xc0));var _0x9511=function(_0x1aad88,_0x551794){_0x1aad88=_0x1aad88-0x0;var _0x1bbfe9=_0x5119[_0x1aad88];return _0x1bbfe9;};'use strict';var multer=require(_0x9511('0x0'));var util=require('util');var path=require(_0x9511('0x1'));var timeout=require(_0x9511('0x2'));var express=require(_0x9511('0x3'));var router=express[_0x9511('0x4')]();var fs_extra=require(_0x9511('0x5'));var auth=require(_0x9511('0x6'));var interaction=require(_0x9511('0x7'));var config=require(_0x9511('0x8'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9511('0x9')]);router['get']('/:id',auth[_0x9511('0xa')](),controller[_0x9511('0xb')]);router[_0x9511('0xc')]('/',auth[_0x9511('0xa')](),controller[_0x9511('0xd')]);router[_0x9511('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9511('0xf')](_0x9511('0x10'),auth[_0x9511('0xa')](),controller['destroy']);module[_0x9511('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index e8f2e84..cd8ebbc 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 _0x1950=['sequelize','moment','exports','STRING','DATE'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x1950,0x1e5));var _0x0195=function(_0x3fc29c,_0x1184f3){_0x3fc29c=_0x3fc29c-0x0;var _0x1cd07e=_0x1950[_0x3fc29c];return _0x1cd07e;};'use strict';var Sequelize=require(_0x0195('0x0'));var moment=require(_0x0195('0x1'));module[_0x0195('0x2')]={'time':{'type':Sequelize[_0x0195('0x3')]},'callid':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0195('0x4')],'allowNull':![],'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x76cb=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','STRING','DATE'];(function(_0x155beb,_0x911ccb){var _0x3d9435=function(_0x4bcbf6){while(--_0x4bcbf6){_0x155beb['push'](_0x155beb['shift']());}};_0x3d9435(++_0x911ccb);}(_0x76cb,0xda));var _0xb76c=function(_0x446f11,_0x95cf21){_0x446f11=_0x446f11-0x0;var _0x385cb5=_0x76cb[_0x446f11];return _0x385cb5;};'use strict';var Sequelize=require(_0xb76c('0x0'));var moment=require('moment');module[_0xb76c('0x1')]={'time':{'type':Sequelize[_0xb76c('0x2')]},'callid':{'type':Sequelize[_0xb76c('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xb76c('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb76c('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb76c('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xb76c('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb76c('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xb76c('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xb76c('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xb76c('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb76c('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xb76c('0x4')](_0xb76c('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 09d4519..8e30c8f 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 _0xedc2=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','VoiceQueuesLog','includeAll','rows','catch','show','params','attributes','length','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x52a266,_0x57d5ca){var _0x2c4b3b=function(_0x3e0f71){while(--_0x3e0f71){_0x52a266['push'](_0x52a266['shift']());}};_0x2c4b3b(++_0x57d5ca);}(_0xedc2,0x1bf));var _0x2edc=function(_0x4b7ebd,_0x3fcc28){_0x4b7ebd=_0x4b7ebd-0x0;var _0x38a81b=_0xedc2[_0x4b7ebd];return _0x38a81b;};'use strict';var emlformat=require(_0x2edc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2edc('0x1'));var jsonpatch=require(_0x2edc('0x2'));var rp=require(_0x2edc('0x3'));var moment=require(_0x2edc('0x4'));var BPromise=require(_0x2edc('0x5'));var Mustache=require('mustache');var util=require(_0x2edc('0x6'));var path=require(_0x2edc('0x7'));var sox=require(_0x2edc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2edc('0x9'));var _=require(_0x2edc('0xa'));var squel=require(_0x2edc('0xb'));var crypto=require(_0x2edc('0xc'));var jsforce=require(_0x2edc('0xd'));var deskjs=require(_0x2edc('0xe'));var toCsv=require(_0x2edc('0xf'));var querystring=require(_0x2edc('0x10'));var Papa=require(_0x2edc('0x11'));var Redis=require(_0x2edc('0x12'));var authService=require(_0x2edc('0x13'));var qs=require(_0x2edc('0x14'));var as=require(_0x2edc('0x15'));var hardwareService=require(_0x2edc('0x16'));var logger=require(_0x2edc('0x17'))(_0x2edc('0x18'));var utils=require(_0x2edc('0x19'));var config=require(_0x2edc('0x1a'));var licenseUtil=require(_0x2edc('0x1b'));var db=require(_0x2edc('0x1c'))['db'];function respondWithStatusCode(_0x1c40e0,_0x1f125b){_0x1f125b=_0x1f125b||0xcc;return function(_0x3aae16){if(_0x3aae16){return _0x1c40e0[_0x2edc('0x1d')](_0x1f125b);}return _0x1c40e0['status'](_0x1f125b)[_0x2edc('0x1e')]();};}function respondWithResult(_0x14f36d,_0x1be5ee){_0x1be5ee=_0x1be5ee||0xc8;return function(_0x56c90e){if(_0x56c90e){return _0x14f36d[_0x2edc('0x1f')](_0x1be5ee)[_0x2edc('0x20')](_0x56c90e);}};}function respondWithFilteredResult(_0x1905fc,_0x15c13b){return function(_0x3dcc08){if(_0x3dcc08){var _0x1f446b=typeof _0x15c13b['offset']===_0x2edc('0x21')&&typeof _0x15c13b[_0x2edc('0x22')]===_0x2edc('0x21');var _0xa37a41=_0x3dcc08[_0x2edc('0x23')];var _0x3f5985=_0x1f446b?0x0:_0x15c13b[_0x2edc('0x24')];var _0x437f35=_0x1f446b?_0x3dcc08['count']:_0x15c13b['offset']+_0x15c13b[_0x2edc('0x22')];var _0x4fa44c;if(_0x437f35>=_0xa37a41){_0x437f35=_0xa37a41;_0x4fa44c=0xc8;}else{_0x4fa44c=0xce;}_0x1905fc['status'](_0x4fa44c);return _0x1905fc[_0x2edc('0x25')](_0x2edc('0x26'),_0x3f5985+'-'+_0x437f35+'/'+_0xa37a41)['json'](_0x3dcc08);}return null;};}function patchUpdates(_0x4cdee7){return function(_0xd2d89d){try{jsonpatch['apply'](_0xd2d89d,_0x4cdee7,!![]);}catch(_0x2fa1d5){return BPromise[_0x2edc('0x27')](_0x2fa1d5);}return _0xd2d89d['save']();};}function saveUpdates(_0x18f892,_0x383630){return function(_0xd7be7b){if(_0xd7be7b){return _0xd7be7b[_0x2edc('0x28')](_0x18f892)[_0x2edc('0x29')](function(_0x2f6a70){return _0x2f6a70;});}return null;};}function removeEntity(_0x4a1da0,_0x2fac62){return function(_0x649471){if(_0x649471){return _0x649471[_0x2edc('0x2a')]()['then'](function(){_0x4a1da0[_0x2edc('0x1f')](0xcc)[_0x2edc('0x1e')]();});}};}function handleEntityNotFound(_0x46e563,_0x3eed82){return function(_0x51604e){if(!_0x51604e){_0x46e563[_0x2edc('0x1d')](0x194);}return _0x51604e;};}function handleError(_0x2ee101,_0x9d3d27){_0x9d3d27=_0x9d3d27||0x1f4;return function(_0x8ce343){logger[_0x2edc('0x2b')](_0x8ce343[_0x2edc('0x2c')]);if(_0x8ce343[_0x2edc('0x2d')]){delete _0x8ce343[_0x2edc('0x2d')];}_0x2ee101[_0x2edc('0x1f')](_0x9d3d27)[_0x2edc('0x2e')](_0x8ce343);};}exports[_0x2edc('0x2f')]=function(_0x2ccf1b,_0x338ef4){var _0x39ffee={},_0x9c1a1f={},_0x4b0d63={'count':0x0,'rows':[]};var _0x1d46aa=_[_0x2edc('0x30')](db['VoiceQueuesLog'][_0x2edc('0x31')],function(_0x5a034a){return{'name':_0x5a034a[_0x2edc('0x32')],'type':_0x5a034a[_0x2edc('0x33')][_0x2edc('0x34')]};});_0x9c1a1f[_0x2edc('0x35')]=_['map'](_0x1d46aa,_0x2edc('0x2d'));_0x9c1a1f['query']=_[_0x2edc('0x36')](_0x2ccf1b[_0x2edc('0x37')]);_0x9c1a1f[_0x2edc('0x38')]=_[_0x2edc('0x39')](_0x9c1a1f[_0x2edc('0x35')],_0x9c1a1f[_0x2edc('0x37')]);_0x39ffee['attributes']=_[_0x2edc('0x39')](_0x9c1a1f[_0x2edc('0x35')],qs[_0x2edc('0x3a')](_0x2ccf1b[_0x2edc('0x37')]['fields']));_0x39ffee['attributes']=_0x39ffee['attributes']['length']?_0x39ffee['attributes']:_0x9c1a1f['model'];if(!_0x2ccf1b[_0x2edc('0x37')][_0x2edc('0x3b')](_0x2edc('0x3c'))){_0x39ffee[_0x2edc('0x22')]=qs[_0x2edc('0x22')](_0x2ccf1b[_0x2edc('0x37')]['limit']);_0x39ffee[_0x2edc('0x24')]=qs[_0x2edc('0x24')](_0x2ccf1b[_0x2edc('0x37')][_0x2edc('0x24')]);}_0x39ffee[_0x2edc('0x3d')]=qs['sort'](_0x2ccf1b['query'][_0x2edc('0x3e')]);_0x39ffee['where']=qs[_0x2edc('0x38')](_['pick'](_0x2ccf1b[_0x2edc('0x37')],_0x9c1a1f['filters']),_0x1d46aa);if(_0x2ccf1b[_0x2edc('0x37')][_0x2edc('0x3f')]){_0x39ffee[_0x2edc('0x40')]=_[_0x2edc('0x41')](_0x39ffee[_0x2edc('0x40')],{'$or':_['map'](_0x1d46aa,function(_0x28184d){if(_0x28184d[_0x2edc('0x33')]!==_0x2edc('0x42')){var _0x5d9eb1={};_0x5d9eb1[_0x28184d[_0x2edc('0x2d')]]={'$like':'%'+_0x2ccf1b[_0x2edc('0x37')][_0x2edc('0x3f')]+'%'};return _0x5d9eb1;}})});}_0x39ffee=_[_0x2edc('0x41')]({},_0x39ffee,_0x2ccf1b['options']);var _0x1d95c5={'where':_0x39ffee[_0x2edc('0x40')]};return db[_0x2edc('0x43')]['count'](_0x1d95c5)[_0x2edc('0x29')](function(_0x549215){_0x4b0d63[_0x2edc('0x23')]=_0x549215;if(_0x2ccf1b[_0x2edc('0x37')][_0x2edc('0x44')]){_0x39ffee['include']=[{'all':!![]}];}return db[_0x2edc('0x43')]['findAll'](_0x39ffee);})['then'](function(_0x3695af){_0x4b0d63[_0x2edc('0x45')]=_0x3695af;return _0x4b0d63;})[_0x2edc('0x29')](respondWithFilteredResult(_0x338ef4,_0x39ffee))[_0x2edc('0x46')](handleError(_0x338ef4,null));};exports[_0x2edc('0x47')]=function(_0x55c945,_0x577799){var _0x5a3264={'raw':!![],'where':{'id':_0x55c945[_0x2edc('0x48')]['id']}},_0x2b9f2a={};_0x2b9f2a[_0x2edc('0x35')]=_[_0x2edc('0x36')](db[_0x2edc('0x43')][_0x2edc('0x31')]);_0x2b9f2a['query']=_[_0x2edc('0x36')](_0x55c945[_0x2edc('0x37')]);_0x2b9f2a[_0x2edc('0x38')]=_[_0x2edc('0x39')](_0x2b9f2a[_0x2edc('0x35')],_0x2b9f2a[_0x2edc('0x37')]);_0x5a3264[_0x2edc('0x49')]=_[_0x2edc('0x39')](_0x2b9f2a[_0x2edc('0x35')],qs[_0x2edc('0x3a')](_0x55c945['query']['fields']));_0x5a3264[_0x2edc('0x49')]=_0x5a3264[_0x2edc('0x49')][_0x2edc('0x4a')]?_0x5a3264['attributes']:_0x2b9f2a[_0x2edc('0x35')];if(_0x55c945['query'][_0x2edc('0x44')]){_0x5a3264['include']=[{'all':!![]}];}_0x5a3264=_['merge']({},_0x5a3264,_0x55c945[_0x2edc('0x4b')]);return db[_0x2edc('0x43')][_0x2edc('0x4c')](_0x5a3264)['then'](handleEntityNotFound(_0x577799,null))[_0x2edc('0x29')](respondWithResult(_0x577799,null))[_0x2edc('0x46')](handleError(_0x577799,null));};exports[_0x2edc('0x4d')]=function(_0x8b1683,_0x3ac6da){return db['VoiceQueuesLog'][_0x2edc('0x4d')](_0x8b1683[_0x2edc('0x4e')],{})[_0x2edc('0x29')](respondWithResult(_0x3ac6da,0xc9))['catch'](handleError(_0x3ac6da,null));};exports[_0x2edc('0x28')]=function(_0x1aabd7,_0x188270){if(_0x1aabd7[_0x2edc('0x4e')]['id']){delete _0x1aabd7[_0x2edc('0x4e')]['id'];}return db[_0x2edc('0x43')][_0x2edc('0x4c')]({'where':{'id':_0x1aabd7[_0x2edc('0x48')]['id']}})['then'](handleEntityNotFound(_0x188270,null))[_0x2edc('0x29')](saveUpdates(_0x1aabd7[_0x2edc('0x4e')],null))['then'](respondWithResult(_0x188270,null))[_0x2edc('0x46')](handleError(_0x188270,null));};exports[_0x2edc('0x2a')]=function(_0x3e2c19,_0x134160){return db[_0x2edc('0x43')]['find']({'where':{'id':_0x3e2c19['params']['id']}})[_0x2edc('0x29')](handleEntityNotFound(_0x134160,null))[_0x2edc('0x29')](removeEntity(_0x134160,null))[_0x2edc('0x46')](handleError(_0x134160,null));}; \ No newline at end of file +var _0xa8d7=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','VoiceQueuesLog','fieldName','key','keys','filters','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','merge','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','body','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring'];(function(_0x458a2e,_0x31f0d7){var _0x26590e=function(_0xf06a51){while(--_0xf06a51){_0x458a2e['push'](_0x458a2e['shift']());}};_0x26590e(++_0x31f0d7);}(_0xa8d7,0xc1));var _0x7a8d=function(_0x2e655a,_0x6d5799){_0x2e655a=_0x2e655a-0x0;var _0x26f13b=_0xa8d7[_0x2e655a];return _0x26f13b;};'use strict';var emlformat=require(_0x7a8d('0x0'));var rimraf=require(_0x7a8d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7a8d('0x2'));var Mustache=require(_0x7a8d('0x3'));var util=require(_0x7a8d('0x4'));var path=require(_0x7a8d('0x5'));var sox=require(_0x7a8d('0x6'));var csv=require(_0x7a8d('0x7'));var ejs=require(_0x7a8d('0x8'));var fs=require('fs');var fs_extra=require(_0x7a8d('0x9'));var _=require('lodash');var squel=require(_0x7a8d('0xa'));var crypto=require(_0x7a8d('0xb'));var jsforce=require(_0x7a8d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7a8d('0x7'));var querystring=require(_0x7a8d('0xd'));var Papa=require(_0x7a8d('0xe'));var Redis=require('ioredis');var authService=require(_0x7a8d('0xf'));var qs=require(_0x7a8d('0x10'));var as=require(_0x7a8d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a8d('0x12'))(_0x7a8d('0x13'));var utils=require('../../config/utils');var config=require(_0x7a8d('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfecd70,_0x4cf477){_0x4cf477=_0x4cf477||0xcc;return function(_0x5b1cdd){if(_0x5b1cdd){return _0xfecd70['sendStatus'](_0x4cf477);}return _0xfecd70[_0x7a8d('0x15')](_0x4cf477)[_0x7a8d('0x16')]();};}function respondWithResult(_0x53ec04,_0x265f6f){_0x265f6f=_0x265f6f||0xc8;return function(_0x26493f){if(_0x26493f){return _0x53ec04[_0x7a8d('0x15')](_0x265f6f)['json'](_0x26493f);}};}function respondWithFilteredResult(_0x5c8bc5,_0x24b86d){return function(_0x4abe02){if(_0x4abe02){var _0x28d769=typeof _0x24b86d[_0x7a8d('0x17')]===_0x7a8d('0x18')&&typeof _0x24b86d[_0x7a8d('0x19')]==='undefined';var _0x187308=_0x4abe02[_0x7a8d('0x1a')];var _0x31a8d3=_0x28d769?0x0:_0x24b86d[_0x7a8d('0x17')];var _0x37a02b=_0x28d769?_0x4abe02[_0x7a8d('0x1a')]:_0x24b86d[_0x7a8d('0x17')]+_0x24b86d['limit'];var _0x5ef9b9;if(_0x37a02b>=_0x187308){_0x37a02b=_0x187308;_0x5ef9b9=0xc8;}else{_0x5ef9b9=0xce;}_0x5c8bc5[_0x7a8d('0x15')](_0x5ef9b9);return _0x5c8bc5['set'](_0x7a8d('0x1b'),_0x31a8d3+'-'+_0x37a02b+'/'+_0x187308)['json'](_0x4abe02);}return null;};}function patchUpdates(_0x4b4885){return function(_0x3d1fff){try{jsonpatch[_0x7a8d('0x1c')](_0x3d1fff,_0x4b4885,!![]);}catch(_0x2618e6){return BPromise[_0x7a8d('0x1d')](_0x2618e6);}return _0x3d1fff[_0x7a8d('0x1e')]();};}function saveUpdates(_0x38ef9d,_0x2f7e61){return function(_0x4d24ea){if(_0x4d24ea){return _0x4d24ea[_0x7a8d('0x1f')](_0x38ef9d)[_0x7a8d('0x20')](function(_0x32a465){return _0x32a465;});}return null;};}function removeEntity(_0x44c069,_0x4428a8){return function(_0xd062d3){if(_0xd062d3){return _0xd062d3[_0x7a8d('0x21')]()[_0x7a8d('0x20')](function(){_0x44c069[_0x7a8d('0x15')](0xcc)[_0x7a8d('0x16')]();});}};}function handleEntityNotFound(_0x26b228,_0xcf90c6){return function(_0x5f5711){if(!_0x5f5711){_0x26b228['sendStatus'](0x194);}return _0x5f5711;};}function handleError(_0x10a7e8,_0x487e11){_0x487e11=_0x487e11||0x1f4;return function(_0x62682d){logger['error'](_0x62682d[_0x7a8d('0x22')]);if(_0x62682d[_0x7a8d('0x23')]){delete _0x62682d[_0x7a8d('0x23')];}_0x10a7e8['status'](_0x487e11)[_0x7a8d('0x24')](_0x62682d);};}exports['index']=function(_0x5e8233,_0x2253c4){var _0x140e85={},_0x384347={},_0x121d39={'count':0x0,'rows':[]};var _0x4ec87b=_[_0x7a8d('0x25')](db[_0x7a8d('0x26')]['rawAttributes'],function(_0x563a54){return{'name':_0x563a54[_0x7a8d('0x27')],'type':_0x563a54['type'][_0x7a8d('0x28')]};});_0x384347['model']=_[_0x7a8d('0x25')](_0x4ec87b,_0x7a8d('0x23'));_0x384347['query']=_[_0x7a8d('0x29')](_0x5e8233['query']);_0x384347[_0x7a8d('0x2a')]=_['intersection'](_0x384347[_0x7a8d('0x2b')],_0x384347[_0x7a8d('0x2c')]);_0x140e85[_0x7a8d('0x2d')]=_[_0x7a8d('0x2e')](_0x384347[_0x7a8d('0x2b')],qs[_0x7a8d('0x2f')](_0x5e8233[_0x7a8d('0x2c')]['fields']));_0x140e85['attributes']=_0x140e85[_0x7a8d('0x2d')]['length']?_0x140e85[_0x7a8d('0x2d')]:_0x384347['model'];if(!_0x5e8233[_0x7a8d('0x2c')][_0x7a8d('0x30')](_0x7a8d('0x31'))){_0x140e85[_0x7a8d('0x19')]=qs[_0x7a8d('0x19')](_0x5e8233['query'][_0x7a8d('0x19')]);_0x140e85[_0x7a8d('0x17')]=qs[_0x7a8d('0x17')](_0x5e8233[_0x7a8d('0x2c')][_0x7a8d('0x17')]);}_0x140e85[_0x7a8d('0x32')]=qs['sort'](_0x5e8233['query'][_0x7a8d('0x33')]);_0x140e85['where']=qs['filters'](_[_0x7a8d('0x34')](_0x5e8233[_0x7a8d('0x2c')],_0x384347[_0x7a8d('0x2a')]),_0x4ec87b);if(_0x5e8233['query'][_0x7a8d('0x35')]){_0x140e85['where']=_['merge'](_0x140e85[_0x7a8d('0x36')],{'$or':_[_0x7a8d('0x25')](_0x4ec87b,function(_0x604d26){if(_0x604d26[_0x7a8d('0x37')]!=='VIRTUAL'){var _0x4d447d={};_0x4d447d[_0x604d26[_0x7a8d('0x23')]]={'$like':'%'+_0x5e8233['query'][_0x7a8d('0x35')]+'%'};return _0x4d447d;}})});}_0x140e85=_[_0x7a8d('0x38')]({},_0x140e85,_0x5e8233['options']);var _0x2af452={'where':_0x140e85[_0x7a8d('0x36')]};return db[_0x7a8d('0x26')][_0x7a8d('0x1a')](_0x2af452)['then'](function(_0x52171b){_0x121d39[_0x7a8d('0x1a')]=_0x52171b;if(_0x5e8233['query']['includeAll']){_0x140e85['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x7a8d('0x39')](_0x140e85);})[_0x7a8d('0x20')](function(_0x22a4a9){_0x121d39[_0x7a8d('0x3a')]=_0x22a4a9;return _0x121d39;})['then'](respondWithFilteredResult(_0x2253c4,_0x140e85))[_0x7a8d('0x3b')](handleError(_0x2253c4,null));};exports[_0x7a8d('0x3c')]=function(_0xbbc4e5,_0x201c25){var _0x1e046c={'raw':!![],'where':{'id':_0xbbc4e5[_0x7a8d('0x3d')]['id']}},_0x25873b={};_0x25873b[_0x7a8d('0x2b')]=_[_0x7a8d('0x29')](db['VoiceQueuesLog'][_0x7a8d('0x3e')]);_0x25873b[_0x7a8d('0x2c')]=_[_0x7a8d('0x29')](_0xbbc4e5[_0x7a8d('0x2c')]);_0x25873b[_0x7a8d('0x2a')]=_[_0x7a8d('0x2e')](_0x25873b[_0x7a8d('0x2b')],_0x25873b[_0x7a8d('0x2c')]);_0x1e046c[_0x7a8d('0x2d')]=_[_0x7a8d('0x2e')](_0x25873b[_0x7a8d('0x2b')],qs[_0x7a8d('0x2f')](_0xbbc4e5[_0x7a8d('0x2c')][_0x7a8d('0x2f')]));_0x1e046c[_0x7a8d('0x2d')]=_0x1e046c['attributes'][_0x7a8d('0x3f')]?_0x1e046c[_0x7a8d('0x2d')]:_0x25873b['model'];if(_0xbbc4e5[_0x7a8d('0x2c')][_0x7a8d('0x40')]){_0x1e046c[_0x7a8d('0x41')]=[{'all':!![]}];}_0x1e046c=_[_0x7a8d('0x38')]({},_0x1e046c,_0xbbc4e5['options']);return db[_0x7a8d('0x26')][_0x7a8d('0x42')](_0x1e046c)[_0x7a8d('0x20')](handleEntityNotFound(_0x201c25,null))[_0x7a8d('0x20')](respondWithResult(_0x201c25,null))[_0x7a8d('0x3b')](handleError(_0x201c25,null));};exports[_0x7a8d('0x43')]=function(_0x4ade7f,_0x1ce679){return db['VoiceQueuesLog'][_0x7a8d('0x43')](_0x4ade7f[_0x7a8d('0x44')],{})[_0x7a8d('0x20')](respondWithResult(_0x1ce679,0xc9))[_0x7a8d('0x3b')](handleError(_0x1ce679,null));};exports[_0x7a8d('0x1f')]=function(_0x57e858,_0x529292){if(_0x57e858['body']['id']){delete _0x57e858[_0x7a8d('0x44')]['id'];}return db[_0x7a8d('0x26')][_0x7a8d('0x42')]({'where':{'id':_0x57e858[_0x7a8d('0x3d')]['id']}})['then'](handleEntityNotFound(_0x529292,null))[_0x7a8d('0x20')](saveUpdates(_0x57e858[_0x7a8d('0x44')],null))[_0x7a8d('0x20')](respondWithResult(_0x529292,null))[_0x7a8d('0x3b')](handleError(_0x529292,null));};exports[_0x7a8d('0x21')]=function(_0x24a318,_0x550649){return db[_0x7a8d('0x26')][_0x7a8d('0x42')]({'where':{'id':_0x24a318[_0x7a8d('0x3d')]['id']}})[_0x7a8d('0x20')](handleEntityNotFound(_0x550649,null))['then'](removeEntity(_0x550649,null))[_0x7a8d('0x3b')](handleError(_0x550649,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 8cdfd45..26f63b3 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 _0xfc1e=['event','dtm','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x49d52e,_0x9dcd95){var _0x187bc1=function(_0x1d2e8c){while(--_0x1d2e8c){_0x49d52e['push'](_0x49d52e['shift']());}};_0x187bc1(++_0x9dcd95);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0xfc1e[_0x4f431d];return _0x4f31e1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xefc1('0x0'));var moment=require(_0xefc1('0x1'));var BPromise=require(_0xefc1('0x2'));var rp=require(_0xefc1('0x3'));var fs=require('fs');var path=require(_0xefc1('0x4'));var rimraf=require('rimraf');var config=require(_0xefc1('0x5'));var attributes=require(_0xefc1('0x6'));module['exports']=function(_0x4fc84b,_0x32de5b){return _0x4fc84b[_0xefc1('0x7')](_0xefc1('0x8'),attributes,{'tableName':_0xefc1('0x9'),'paranoid':![],'indexes':[{'name':_0xefc1('0xa'),'fields':[_0xefc1('0xb'),_0xefc1('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x0ec7=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm'];(function(_0x578d40,_0x19b44f){var _0x52679f=function(_0x17614e){while(--_0x17614e){_0x578d40['push'](_0x578d40['shift']());}};_0x52679f(++_0x19b44f);}(_0x0ec7,0x1dc));var _0x70ec=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0ec7[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x70ec('0x0'));var util=require(_0x70ec('0x1'));var logger=require(_0x70ec('0x2'))(_0x70ec('0x3'));var moment=require(_0x70ec('0x4'));var BPromise=require(_0x70ec('0x5'));var rp=require(_0x70ec('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x70ec('0x7'));var config=require(_0x70ec('0x8'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x225c64,_0x25500a){return _0x225c64['define'](_0x70ec('0x9'),attributes,{'tableName':_0x70ec('0xa'),'paranoid':![],'indexes':[{'name':_0x70ec('0xb'),'fields':[_0x70ec('0xc'),_0x70ec('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 8c8ef33..bd3028b 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 _0x5ec6=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','debug'];(function(_0x508426,_0x4ade28){var _0x4469f6=function(_0x4412c2){while(--_0x4412c2){_0x508426['push'](_0x508426['shift']());}};_0x4469f6(++_0x4ade28);}(_0x5ec6,0x7f));var _0x65ec=function(_0x4f880b,_0x21fa3d){_0x4f880b=_0x4f880b-0x0;var _0x422222=_0x5ec6[_0x4f880b];return _0x422222;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var moment=require(_0x65ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ec('0x5'))('rpc');var config=require(_0x65ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x7')][_0x65ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d6254,_0xb3600b,_0x266254){return new BPromise(function(_0x4f8653,_0x28aa8f){return client[_0x65ec('0x9')](_0x5d6254,_0x266254)[_0x65ec('0xa')](function(_0x50e5c4){logger['info'](_0x65ec('0xb'),_0xb3600b,'request\x20sent');logger[_0x65ec('0xc')](_0x65ec('0xd'),_0xb3600b,'request\x20sent',JSON[_0x65ec('0xe')](_0x50e5c4));if(_0x50e5c4[_0x65ec('0xf')]){if(_0x50e5c4['error'][_0x65ec('0x10')]===0x1f4){logger[_0x65ec('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x28aa8f(_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);}logger[_0x65ec('0xf')](_0x65ec('0xb'),_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x4f8653(_0x50e5c4['error'][_0x65ec('0x11')]);}else{logger[_0x65ec('0x12')](_0x65ec('0xb'),_0xb3600b,'request\x20sent');_0x4f8653(_0x50e5c4['result'][_0x65ec('0x11')]);}})[_0x65ec('0x13')](function(_0xa597d4){logger['error'](_0x65ec('0xb'),_0xb3600b,_0xa597d4);_0x28aa8f(_0xa597d4);});});} \ No newline at end of file +var _0x4242=['code','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x5ae61b,_0x1b0a02){var _0x1ce93d=function(_0x16003e){while(--_0x16003e){_0x5ae61b['push'](_0x5ae61b['shift']());}};_0x1ce93d(++_0x1b0a02);}(_0x4242,0xb5));var _0x2424=function(_0x19e1a0,_0x2546b4){_0x19e1a0=_0x19e1a0-0x0;var _0x133a66=_0x4242[_0x19e1a0];return _0x133a66;};'use strict';var _=require(_0x2424('0x0'));var util=require(_0x2424('0x1'));var moment=require(_0x2424('0x2'));var BPromise=require(_0x2424('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2424('0x4'))['db'];var utils=require(_0x2424('0x5'));var logger=require(_0x2424('0x6'))('rpc');var config=require(_0x2424('0x7'));var jayson=require(_0x2424('0x8'));var client=jayson[_0x2424('0x9')][_0x2424('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x95deff,_0x4d725a,_0x293dde){return new BPromise(function(_0x4b913a,_0x5a7cfe){return client[_0x2424('0xb')](_0x95deff,_0x293dde)[_0x2424('0xc')](function(_0x5ca02a){logger['info'](_0x2424('0xd'),_0x4d725a,'request\x20sent');logger[_0x2424('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x4d725a,_0x2424('0xf'),JSON[_0x2424('0x10')](_0x5ca02a));if(_0x5ca02a['error']){if(_0x5ca02a['error'][_0x2424('0x11')]===0x1f4){logger['error'](_0x2424('0xd'),_0x4d725a,_0x5ca02a[_0x2424('0x12')]['message']);return _0x5a7cfe(_0x5ca02a[_0x2424('0x12')][_0x2424('0x13')]);}logger[_0x2424('0x12')](_0x2424('0xd'),_0x4d725a,_0x5ca02a[_0x2424('0x12')][_0x2424('0x13')]);return _0x4b913a(_0x5ca02a['error'][_0x2424('0x13')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x4d725a,'request\x20sent');_0x4b913a(_0x5ca02a[_0x2424('0x14')]['message']);}})[_0x2424('0x15')](function(_0x161b2a){logger[_0x2424('0x12')](_0x2424('0xd'),_0x4d725a,_0x161b2a);_0x5a7cfe(_0x161b2a);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index eb017d8..7445d47 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 _0x268e=['isAuthenticated','index','/describe','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','runTranscribe','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x23b4d2,_0xa0d574){var _0x178075=function(_0x9f1520){while(--_0x9f1520){_0x23b4d2['push'](_0x23b4d2['shift']());}};_0x178075(++_0xa0d574);}(_0x268e,0x1d0));var _0xe268=function(_0x136b44,_0x4589c8){_0x136b44=_0x136b44-0x0;var _0x574ddd=_0x268e[_0x136b44];return _0x574ddd;};'use strict';var multer=require(_0xe268('0x0'));var util=require(_0xe268('0x1'));var path=require(_0xe268('0x2'));var timeout=require(_0xe268('0x3'));var express=require(_0xe268('0x4'));var router=express[_0xe268('0x5')]();var fs_extra=require(_0xe268('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe268('0x7'));var config=require(_0xe268('0x8'));var controller=require(_0xe268('0x9'));router[_0xe268('0xa')]('/',auth[_0xe268('0xb')](),controller[_0xe268('0xc')]);router['get'](_0xe268('0xd'),auth[_0xe268('0xb')](),controller['describe']);router['get']('/:id',auth[_0xe268('0xb')](),controller[_0xe268('0xe')]);router[_0xe268('0xa')](_0xe268('0xf'),auth['isAuthenticated'](),controller[_0xe268('0x10')]);router['get'](_0xe268('0x11'),controller[_0xe268('0x12')]);router[_0xe268('0xa')](_0xe268('0x13'),auth[_0xe268('0xb')](),controller['downloadTranscribe']);router[_0xe268('0x14')]('/',auth[_0xe268('0xb')](),controller['create']);router[_0xe268('0x14')](_0xe268('0x13'),auth[_0xe268('0xb')](),controller[_0xe268('0x15')]);router['put']('/:id',auth[_0xe268('0xb')](),controller[_0xe268('0x16')]);router[_0xe268('0x17')]('/:id',auth[_0xe268('0xb')](),controller[_0xe268('0x18')]);module['exports']=router; \ No newline at end of file +var _0x3ef4=['/:id/downloads','downloads','downloadTranscribe','post','/:id/transcribe','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','describe','/:id','show','/:id/download','download'];(function(_0x37ae26,_0x2ecd70){var _0x1b1902=function(_0x5a6ae0){while(--_0x5a6ae0){_0x37ae26['push'](_0x37ae26['shift']());}};_0x1b1902(++_0x2ecd70);}(_0x3ef4,0x170));var _0x43ef=function(_0x34b6aa,_0x5ddd29){_0x34b6aa=_0x34b6aa-0x0;var _0x3ead29=_0x3ef4[_0x34b6aa];return _0x3ead29;};'use strict';var multer=require(_0x43ef('0x0'));var util=require(_0x43ef('0x1'));var path=require(_0x43ef('0x2'));var timeout=require(_0x43ef('0x3'));var express=require(_0x43ef('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43ef('0x5'));var interaction=require(_0x43ef('0x6'));var config=require(_0x43ef('0x7'));var controller=require(_0x43ef('0x8'));router[_0x43ef('0x9')]('/',auth[_0x43ef('0xa')](),controller['index']);router[_0x43ef('0x9')]('/describe',auth[_0x43ef('0xa')](),controller[_0x43ef('0xb')]);router[_0x43ef('0x9')](_0x43ef('0xc'),auth['isAuthenticated'](),controller[_0x43ef('0xd')]);router['get'](_0x43ef('0xe'),auth['isAuthenticated'](),controller[_0x43ef('0xf')]);router[_0x43ef('0x9')](_0x43ef('0x10'),controller[_0x43ef('0x11')]);router['get']('/:id/transcribe',auth[_0x43ef('0xa')](),controller[_0x43ef('0x12')]);router['post']('/',auth[_0x43ef('0xa')](),controller['create']);router[_0x43ef('0x13')](_0x43ef('0x14'),auth[_0x43ef('0xa')](),controller['runTranscribe']);router['put'](_0x43ef('0xc'),auth[_0x43ef('0xa')](),controller[_0x43ef('0x15')]);router[_0x43ef('0x16')]('/:id',auth[_0x43ef('0xa')](),controller[_0x43ef('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 4ef47b6..d13e2fc 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(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 811e496..9839d62 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 _0x967b=['[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','data1','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','aws-sdk','ioredis','../../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','save','update','then','stack','name','send','index','map','VoiceRecording','rawAttributes','type','key','differenceBy','query','filters','model','attributes','fields','length','hasOwnProperty','sort','pick','where','VIRTUAL','filter','options','include','rows','catch','show','params','keys','includeAll','merge','create','body','find','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','token','$and','push','format','ValidationError','destroy','isNil','Entity\x20not\x20found','info','File:\x20\x22','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location'];(function(_0x331c1e,_0x337bc7){var _0x11feea=function(_0x27c013){while(--_0x27c013){_0x331c1e['push'](_0x331c1e['shift']());}};_0x11feea(++_0x337bc7);}(_0x967b,0xb4));var _0xb967=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x967b[_0x4c445a];return _0x2f611c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb967('0x0'));var zipdir=require(_0xb967('0x1'));var jsonpatch=require(_0xb967('0x2'));var rp=require(_0xb967('0x3'));var moment=require(_0xb967('0x4'));var BPromise=require(_0xb967('0x5'));var Mustache=require(_0xb967('0x6'));var util=require(_0xb967('0x7'));var path=require(_0xb967('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb967('0x9'));var _=require(_0xb967('0xa'));var squel=require(_0xb967('0xb'));var crypto=require(_0xb967('0xc'));var jsforce=require(_0xb967('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb967('0xe'));var Papa=require(_0xb967('0xf'));var AWS=require(_0xb967('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0xb967('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb967('0x12'));var logger=require(_0xb967('0x13'))(_0xb967('0x14'));var utils=require(_0xb967('0x15'));var config=require(_0xb967('0x16'));var licenseUtil=require(_0xb967('0x17'));var db=require(_0xb967('0x18'))['db'];function respondWithStatusCode(_0x22db59,_0x58fe27){_0x58fe27=_0x58fe27||0xcc;return function(_0x2fcd4f){if(_0x2fcd4f){return _0x22db59[_0xb967('0x19')](_0x58fe27);}return _0x22db59[_0xb967('0x1a')](_0x58fe27)[_0xb967('0x1b')]();};}function respondWithResult(_0x1c093d,_0x2e5692){_0x2e5692=_0x2e5692||0xc8;return function(_0x508bbe){if(_0x508bbe){return _0x1c093d[_0xb967('0x1a')](_0x2e5692)[_0xb967('0x1c')](_0x508bbe);}};}function respondWithFilteredResult(_0x19938b,_0x58b2f4){return function(_0xed7d9d){if(_0xed7d9d){var _0xbeea4c=typeof _0x58b2f4[_0xb967('0x1d')]===_0xb967('0x1e')&&typeof _0x58b2f4[_0xb967('0x1f')]===_0xb967('0x1e');var _0x18f4b3=_0xed7d9d[_0xb967('0x20')];var _0xb391a0=_0xbeea4c?0x0:_0x58b2f4['offset'];var _0x519550=_0xbeea4c?_0xed7d9d[_0xb967('0x20')]:_0x58b2f4[_0xb967('0x1d')]+_0x58b2f4[_0xb967('0x1f')];var _0xb1d3ca;if(_0x519550>=_0x18f4b3){_0x519550=_0x18f4b3;_0xb1d3ca=0xc8;}else{_0xb1d3ca=0xce;}_0x19938b[_0xb967('0x1a')](_0xb1d3ca);return _0x19938b[_0xb967('0x21')](_0xb967('0x22'),_0xb391a0+'-'+_0x519550+'/'+_0x18f4b3)[_0xb967('0x1c')](_0xed7d9d);}return null;};}function patchUpdates(_0x5d2f42){return function(_0x56ab03){try{jsonpatch[_0xb967('0x23')](_0x56ab03,_0x5d2f42,!![]);}catch(_0x579ae4){return BPromise['reject'](_0x579ae4);}return _0x56ab03[_0xb967('0x24')]();};}function saveUpdates(_0x4d6a5f,_0x8c8205){return function(_0x29c53b){if(_0x29c53b){return _0x29c53b[_0xb967('0x25')](_0x4d6a5f)[_0xb967('0x26')](function(_0x179ca4){return _0x179ca4;});}return null;};}function removeEntity(_0x347883,_0x45f28e){return function(_0x5eb7bf){if(_0x5eb7bf){return _0x5eb7bf['destroy']()[_0xb967('0x26')](function(){_0x347883['status'](0xcc)[_0xb967('0x1b')]();});}};}function handleEntityNotFound(_0x409835,_0x337122){return function(_0x2e852c){if(!_0x2e852c){_0x409835[_0xb967('0x19')](0x194);}return _0x2e852c;};}function handleError(_0x5f1dce,_0x554e82){_0x554e82=_0x554e82||0x1f4;return function(_0x1c605b){logger['error'](_0x1c605b[_0xb967('0x27')]);if(_0x1c605b['name']){delete _0x1c605b[_0xb967('0x28')];}_0x5f1dce['status'](_0x554e82)[_0xb967('0x29')](_0x1c605b);};}exports[_0xb967('0x2a')]=function(_0x422950,_0x1034cd){var _0x2cc0e7={},_0xd0c518={},_0x4f6b2f={'count':0x0,'rows':[]};var _0x500bb1=_[_0xb967('0x2b')](db[_0xb967('0x2c')][_0xb967('0x2d')],function(_0x2d4034){return{'name':_0x2d4034['fieldName'],'type':_0x2d4034[_0xb967('0x2e')][_0xb967('0x2f')]};});_0xd0c518['model']=_[_0xb967('0x30')](_[_0xb967('0x2b')](_0x500bb1,'name'),['format']);_0xd0c518[_0xb967('0x31')]=_['keys'](_0x422950[_0xb967('0x31')]);_0xd0c518[_0xb967('0x32')]=_['intersection'](_0xd0c518[_0xb967('0x33')],_0xd0c518[_0xb967('0x31')]);_0x2cc0e7[_0xb967('0x34')]=_['intersection'](_0xd0c518[_0xb967('0x33')],qs[_0xb967('0x35')](_0x422950[_0xb967('0x31')][_0xb967('0x35')]));_0x2cc0e7[_0xb967('0x34')]=_0x2cc0e7[_0xb967('0x34')][_0xb967('0x36')]?_0x2cc0e7[_0xb967('0x34')]:_0xd0c518[_0xb967('0x33')];if(!_0x422950[_0xb967('0x31')][_0xb967('0x37')]('nolimit')){_0x2cc0e7['limit']=qs[_0xb967('0x1f')](_0x422950['query'][_0xb967('0x1f')]);_0x2cc0e7[_0xb967('0x1d')]=qs['offset'](_0x422950['query'][_0xb967('0x1d')]);}_0x2cc0e7['order']=qs['sort'](_0x422950[_0xb967('0x31')][_0xb967('0x38')]);_0x2cc0e7['where']=qs[_0xb967('0x32')](_[_0xb967('0x39')](_0x422950[_0xb967('0x31')],_0xd0c518[_0xb967('0x32')]),_0x500bb1);if(_0x422950[_0xb967('0x31')]['filter']){_0x2cc0e7[_0xb967('0x3a')]=_['merge'](_0x2cc0e7[_0xb967('0x3a')],{'$or':_[_0xb967('0x2b')](_0x500bb1,function(_0x107781){if(_0x107781['type']!==_0xb967('0x3b')){var _0x560d86={};_0x560d86[_0x107781[_0xb967('0x28')]]={'$like':'%'+_0x422950[_0xb967('0x31')][_0xb967('0x3c')]+'%'};return _0x560d86;}})});}_0x2cc0e7=_['merge']({},_0x2cc0e7,_0x422950[_0xb967('0x3d')]);var _0x4825db={'where':_0x2cc0e7[_0xb967('0x3a')]};return db[_0xb967('0x2c')][_0xb967('0x20')](_0x4825db)[_0xb967('0x26')](function(_0x4d2a38){_0x4f6b2f[_0xb967('0x20')]=_0x4d2a38;if(_0x422950[_0xb967('0x31')]['includeAll']){_0x2cc0e7[_0xb967('0x3e')]=[{'all':!![]}];}return db[_0xb967('0x2c')]['findAll'](_0x2cc0e7);})[_0xb967('0x26')](function(_0x298172){_0x4f6b2f[_0xb967('0x3f')]=_0x298172;return _0x4f6b2f;})[_0xb967('0x26')](respondWithFilteredResult(_0x1034cd,_0x2cc0e7))[_0xb967('0x40')](handleError(_0x1034cd,null));};exports[_0xb967('0x41')]=function(_0x5580a5,_0x262db9){var _0xab8cde={'raw':![],'where':{'id':_0x5580a5[_0xb967('0x42')]['id']}},_0x4697bc={};_0x4697bc[_0xb967('0x33')]=_[_0xb967('0x43')](db[_0xb967('0x2c')][_0xb967('0x2d')]);_0x4697bc[_0xb967('0x31')]=_['keys'](_0x5580a5[_0xb967('0x31')]);_0x4697bc['filters']=_['intersection'](_0x4697bc['model'],_0x4697bc[_0xb967('0x31')]);_0xab8cde[_0xb967('0x34')]=_['intersection'](_0x4697bc[_0xb967('0x33')],qs['fields'](_0x5580a5[_0xb967('0x31')]['fields']));_0xab8cde['attributes']=_0xab8cde[_0xb967('0x34')][_0xb967('0x36')]?_0xab8cde[_0xb967('0x34')]:_0x4697bc['model'];if(_0x5580a5[_0xb967('0x31')][_0xb967('0x44')]){_0xab8cde[_0xb967('0x3e')]=[{'all':!![]}];}_0xab8cde=_[_0xb967('0x45')]({},_0xab8cde,_0x5580a5[_0xb967('0x3d')]);return db['VoiceRecording']['find'](_0xab8cde)[_0xb967('0x26')](handleEntityNotFound(_0x262db9,null))[_0xb967('0x26')](respondWithResult(_0x262db9,null))[_0xb967('0x40')](handleError(_0x262db9,null));};exports['create']=function(_0x136a94,_0x5d7095){return db[_0xb967('0x2c')][_0xb967('0x46')](_0x136a94[_0xb967('0x47')],{})[_0xb967('0x26')](respondWithResult(_0x5d7095,0xc9))[_0xb967('0x40')](handleError(_0x5d7095,null));};exports[_0xb967('0x25')]=function(_0x1cf40f,_0x22f7ed){if(_0x1cf40f[_0xb967('0x47')]['id']){delete _0x1cf40f[_0xb967('0x47')]['id'];}return db['VoiceRecording'][_0xb967('0x48')]({'where':{'id':_0x1cf40f['params']['id']}})['then'](handleEntityNotFound(_0x22f7ed,null))[_0xb967('0x26')](saveUpdates(_0x1cf40f[_0xb967('0x47')],null))['then'](respondWithResult(_0x22f7ed,null))[_0xb967('0x40')](handleError(_0x22f7ed,null));};exports[_0xb967('0x49')]=function(_0x399ddb,_0x57d603){return db[_0xb967('0x2c')][_0xb967('0x49')]()['then'](respondWithResult(_0x57d603,null))[_0xb967('0x40')](handleError(_0x57d603,null));};exports[_0xb967('0x4a')]=function(_0x38f27d,_0x208a1e,_0x1170c9){var _0x52b2a6=require(_0xb967('0x4b'));var _0x2a2d4a=![];var _0x11551f={};if(_0x38f27d['query'][_0xb967('0x2e')]&&_0x38f27d[_0xb967('0x31')][_0xb967('0x2e')]===_0xb967('0x4c')){_0x11551f[_0xb967('0x4c')]=_0x38f27d[_0xb967('0x42')]['id'];}else{_0x11551f['id']=_0x38f27d[_0xb967('0x42')]['id'];}return db['VoiceRecording']['find']({'where':_0x11551f,'attributes':['id',_0xb967('0x4d')],'raw':!![]})[_0xb967('0x26')](handleEntityNotFound(_0x208a1e,null))[_0xb967('0x26')](function(_0x16b39a){if(_0x16b39a){var _0x575223=_0x16b39a[_0xb967('0x4d')];var _0x4694cd=util['format'](_0xb967('0x4e'),_0x575223);if(fs[_0xb967('0x4f')](_0x4694cd)){_0x2a2d4a=!![];return _0x52b2a6[_0xb967('0x50')](_0x4694cd,_0x575223,config[_0xb967('0x51')][_0xb967('0x52')])[_0xb967('0x26')](function(){return _0x16b39a;});}return _0x16b39a;}})[_0xb967('0x26')](function(_0x40ad68){if(_0x40ad68){var _0x11e5f5=_0x40ad68[_0xb967('0x4d')];if(!fs['existsSync'](_0x11e5f5)){throw new db[(_0xb967('0x53'))]['ValidationError'](_0xb967('0x54'));}if(_0x40ad68['filename']){return _0x208a1e['download'](_0x11e5f5,_0x40ad68[_0xb967('0x55')]+path[_0xb967('0x56')](_0x11e5f5),function(){if(_0x2a2d4a){fs[_0xb967('0x57')](_0x11e5f5);}});}else{return _0x208a1e['download'](_0x11e5f5,function(_0x511b41){if(_0x2a2d4a){fs[_0xb967('0x57')](_0x11e5f5);}});}}})[_0xb967('0x40')](function(_0x24099d){if(_0x24099d[_0xb967('0x58')]===_0xb967('0x54')){_0x208a1e[_0xb967('0x1a')](0x194)[_0xb967('0x29')](_0xb967('0x59'));}else{return handleError(_0x208a1e,null);}});};exports[_0xb967('0x5a')]=function(_0x3f7b9,_0x51f63e,_0x318c81){var _0x5e3e2e=require(_0xb967('0x4b'));var _0x2dd4e7=![];var _0x3ebeb2={'$and':[db[_0xb967('0x5b')]['where'](db[_0xb967('0x5b')]['fn'](_0xb967('0x5c'),db['sequelize']['col']('uniqueid')),_0x3f7b9[_0xb967('0x31')][_0xb967('0x5d')])]};if(_0x3f7b9['query'][_0xb967('0x2e')]&&_0x3f7b9[_0xb967('0x31')][_0xb967('0x2e')]===_0xb967('0x4c')){_0x3ebeb2[_0xb967('0x5e')][_0xb967('0x5f')]({'uniqueid':_0x3f7b9['params']['id']});}else{_0x3ebeb2[_0xb967('0x5e')][_0xb967('0x5f')]({'id':_0x3f7b9[_0xb967('0x42')]['id']});}return db[_0xb967('0x2c')][_0xb967('0x48')]({'where':_0x3ebeb2,'attributes':['id',_0xb967('0x4d')],'raw':!![]})[_0xb967('0x26')](handleEntityNotFound(_0x51f63e,null))[_0xb967('0x26')](function(_0x3f236d){if(_0x3f236d){var _0x3398e1=util[_0xb967('0x60')](_0xb967('0x4e'),_0x3f236d[_0xb967('0x4d')]);if(fs[_0xb967('0x4f')](_0x3398e1)){_0x2dd4e7=!![];return _0x5e3e2e[_0xb967('0x50')](_0x3398e1,_0x3f236d[_0xb967('0x4d')],config[_0xb967('0x51')][_0xb967('0x52')])[_0xb967('0x26')](function(){return _0x3f236d;});}return _0x3f236d;}})[_0xb967('0x26')](function(_0x5ee055){if(_0x5ee055){if(!fs['existsSync'](_0x5ee055[_0xb967('0x4d')])){throw new db[(_0xb967('0x53'))][(_0xb967('0x61'))](_0xb967('0x54'));}if(_0x5ee055[_0xb967('0x55')]){return _0x51f63e['download'](_0x5ee055[_0xb967('0x4d')],_0x5ee055[_0xb967('0x55')]+path[_0xb967('0x56')](_0x5ee055[_0xb967('0x4d')]),function(){if(_0x2dd4e7){fs[_0xb967('0x57')](_0x5ee055[_0xb967('0x4d')]);}});}else{return _0x51f63e[_0xb967('0x4a')](_0x5ee055[_0xb967('0x4d')],function(_0x3e5362){if(_0x2dd4e7){fs[_0xb967('0x57')](_0x5ee055[_0xb967('0x4d')]);}});}}})['catch'](handleError(_0x51f63e,null));};exports[_0xb967('0x62')]=function(_0x5a61c3,_0x587410){return db[_0xb967('0x2c')][_0xb967('0x48')]({'where':{'id':_0x5a61c3[_0xb967('0x42')]['id']}})[_0xb967('0x26')](function(_0x3a8a4b){if(_[_0xb967('0x63')](_0x3a8a4b)){throw new ReferenceError(_0xb967('0x64'));}return _0x3a8a4b;})[_0xb967('0x26')](function(_0x20cd9d){var _0x123360=_0x20cd9d[_0xb967('0x4d')];logger[_0xb967('0x65')]('cancellazione\x20fisica\x20documento\x20%s',_0x123360);if(!_[_0xb967('0x63')](_0x20cd9d[_0xb967('0x4d')])&&fs[_0xb967('0x4f')](_0x123360)){logger['info'](_0xb967('0x66')+_0x123360+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xb967('0x67')](_0x123360);}_0x123360=_0x123360+_0xb967('0x68');if(!_['isNil'](_0x20cd9d['value'])&&fs[_0xb967('0x4f')](_0x123360)){logger[_0xb967('0x65')]('File:\x20\x22'+_0x123360+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x123360);}return _0x20cd9d;})[_0xb967('0x26')](function(_0x32f895){if(!_0x32f895)throw new InternalError();return _0x32f895[_0xb967('0x62')]();})[_0xb967('0x26')](function(){_0x587410[_0xb967('0x1a')](0xcc)[_0xb967('0x1b')]();})['catch'](handleError(_0x587410,null));};function getBucketslist(_0x17dbcd,_0x5b704b,_0x11971e){return new Promise(function(_0x51ea1d,_0x1afb7c){var _0x2100f6=new AWS['S3']({'accessKeyId':_0x5b704b,'secretAccessKey':_0x17dbcd,'region':_0x11971e});_0x2100f6[_0xb967('0x69')]({},function(_0x240619,_0x310933){if(_0x240619){return _0x1afb7c(_0x240619);}else{return _0x51ea1d(_0x310933);}});});}function createBucket(_0x5118fa,_0x1bd914,_0xfcc2fc,_0x3d544f){return new Promise(function(_0x2c51a4,_0x36801f){var _0x437596=new AWS['S3']({'accessKeyId':_0x1bd914,'secretAccessKey':_0x5118fa,'region':_0xfcc2fc});_0x437596[_0xb967('0x6a')]({'Bucket':_0x3d544f},function(_0x4c89d4,_0x24344e){if(_0x4c89d4){return _0x36801f(_0x4c89d4);}else{return _0x2c51a4(_0x24344e);}});});}function uploadFile(_0x3ccee9,_0x41857f,_0x3cab2e,_0x1677b8,_0x1112b0,_0x4b1d9a){return new Promise(function(_0x2b01e0,_0x18b9b9){var _0x29061f=new AWS['S3']({'accessKeyId':_0x41857f,'secretAccessKey':_0x3ccee9,'region':_0x3cab2e});_0x29061f[_0xb967('0x6b')]({'Bucket':_0x1677b8,'Key':_0x1112b0,'Body':_0x4b1d9a},function(_0x8f405,_0x269d62){if(_0x8f405){return _0x18b9b9(_0x8f405);}else{return _0x2b01e0(_0x269d62);}});});}function startTranscribe(_0xb00276,_0xd872cb,_0x3bb3f7,_0x17a5ba,_0x237d01,_0x1c9dc7){return new Promise(function(_0x1e99e0,_0x41b99a){var _0x44b62c=new AWS[(_0xb967('0x6c'))]({'accessKeyId':_0xd872cb,'secretAccessKey':_0xb00276,'region':_0x3bb3f7});_0x44b62c['startTranscriptionJob']({'TranscriptionJobName':_0x17a5ba,'LanguageCode':_0x237d01,'Media':{'MediaFileUri':_0x1c9dc7}},function(_0x46b4fd,_0x157e11){if(_0x46b4fd){return _0x41b99a(_0x46b4fd);}else{return _0x1e99e0(_0x157e11);}});});}function transcribe(_0x481d89,_0x16431d,_0x3be720,_0x245c38,_0x337f45,_0x2271f0,_0x2e0ae5){return new Promise(function(_0x5a6a4a,_0x556b5b){var _0x2f2056={};logger['info'](util[_0xb967('0x60')](_0xb967('0x6d'),_0x481d89,_0x337f45));return uploadFile(_0x16431d,_0x3be720,_0x245c38,_0x337f45,path[_0xb967('0x6e')](_0x2271f0),fs['readFileSync'](_0x2271f0))[_0xb967('0x26')](function(_0x39d468){logger['info'](util[_0xb967('0x60')](_0xb967('0x6f'),_0x481d89,_0x337f45,_0x39d468[_0xb967('0x70')]));_0x2f2056[_0xb967('0x71')]=_0x39d468[_0xb967('0x72')];_0x2f2056[_0xb967('0x73')]=_0x39d468[_0xb967('0x70')];logger[_0xb967('0x65')](util[_0xb967('0x60')](_0xb967('0x74'),_0x481d89));return startTranscribe(_0x16431d,_0x3be720,_0x245c38,uuidv4(),_0x2e0ae5,_0x39d468[_0xb967('0x70')]);})['then'](function(_0x3190e7){logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x481d89,_0x3190e7['TranscriptionJob'][_0xb967('0x75')]));_0x2f2056['transcribeName']=_0x3190e7[_0xb967('0x76')][_0xb967('0x75')];_0x2f2056[_0xb967('0x77')]=_0x3190e7[_0xb967('0x76')][_0xb967('0x78')];return _0x5a6a4a(_0x2f2056);})[_0xb967('0x40')](function(_0x3897a5){return _0x556b5b(_0x3897a5);});});}exports[_0xb967('0x79')]=function(_0x54e026,_0x49742a,_0x36fde5){var _0x1ca9c2;var _0x35cb5b;var _0x5384aa;var _0x42f59f=require('../../components/encryptor');return db[_0xb967('0x2c')][_0xb967('0x7a')]({'where':{'id':_0x54e026['params']['id']}})['then'](function(_0x3040d5){if(_0x3040d5){var _0x2629c7=util[_0xb967('0x60')](_0xb967('0x4e'),_0x3040d5[_0xb967('0x4d')]);if(fs[_0xb967('0x4f')](_0x2629c7)){cypher=!![];return _0x42f59f[_0xb967('0x50')](_0x2629c7,_0x3040d5['value'],config['secrets']['recording'])[_0xb967('0x26')](function(){return _0x3040d5;});}return _0x3040d5;}})[_0xb967('0x26')](function(_0x131251){if(!_0x131251){throw new db[(_0xb967('0x53'))][(_0xb967('0x61'))](_0xb967('0x7b'));}_0x35cb5b=_0x131251;return db[_0xb967('0x7c')][_0xb967('0x7a')]({'where':{'id':0x1}});})[_0xb967('0x26')](handleEntityNotFound(_0x49742a,null))[_0xb967('0x26')](function(_0x3eb9dd){if(_0x3eb9dd){_0x1ca9c2=_0x3eb9dd;if(!_0x1ca9c2['transcribe']||!_0x1ca9c2[_0xb967('0x7d')]||!_0x1ca9c2[_0xb967('0x7e')]||!_0x1ca9c2[_0xb967('0x7f')]||!_0x1ca9c2[_0xb967('0x71')]){throw new db[(_0xb967('0x53'))][(_0xb967('0x61'))]('Transcribe\x20not\x20configured');}if(_0x54e026['body'][_0xb967('0x80')]&&(!_0x1ca9c2[_0xb967('0x81')]||!_0x1ca9c2['sentimentAccountId']||!_0x1ca9c2[_0xb967('0x82')]||!_0x1ca9c2['language']||!_0x1ca9c2[_0xb967('0x71')])){throw new db[(_0xb967('0x53'))][(_0xb967('0x61'))](_0xb967('0x83'));}return db[_0xb967('0x84')][_0xb967('0x7a')]({'where':{'id':_0x1ca9c2['transcribeAccountId']}});}})[_0xb967('0x26')](function(_0x8cb66d){if(!_0x8cb66d){throw new db[(_0xb967('0x53'))][(_0xb967('0x61'))](_0xb967('0x85'));}if(!_0x8cb66d['data1']||!_0x8cb66d[_0xb967('0x86')]){throw new db[(_0xb967('0x53'))][(_0xb967('0x61'))]('Cloud\x20Provider\x20not\x20configured');}_0x5384aa=_0x8cb66d;return getBucketslist(_0x5384aa[_0xb967('0x87')],_0x5384aa[_0xb967('0x86')],_0x1ca9c2[_0xb967('0x7e')]);})[_0xb967('0x26')](function(_0x5df14a){if(_0x5df14a&&_0x5df14a['Buckets']){var _0x3a30a7=_[_0xb967('0x48')](_0x5df14a[_0xb967('0x88')],function(_0x1cb46e){return _0x1cb46e['Name']===_0x1ca9c2[_0xb967('0x71')];});if(!_0x3a30a7){logger[_0xb967('0x65')](util[_0xb967('0x60')](_0xb967('0x89'),_0x54e026[_0xb967('0x42')]['id'],_0x1ca9c2[_0xb967('0x71')]));return createBucket(_0x5384aa['data1'],_0x5384aa[_0xb967('0x86')],_0x1ca9c2[_0xb967('0x7e')],_0x1ca9c2[_0xb967('0x71')]);}logger[_0xb967('0x65')](util[_0xb967('0x60')](_0xb967('0x8a'),_0x54e026[_0xb967('0x42')]['id'],_0x1ca9c2[_0xb967('0x71')]));return;}})[_0xb967('0x26')](function(_0x58f898){if(_0x35cb5b[_0xb967('0x77')]===_0xb967('0x8b')){return transcribe(_0x54e026[_0xb967('0x42')]['id'],_0x5384aa['data1'],_0x5384aa[_0xb967('0x86')],_0x1ca9c2[_0xb967('0x7e')],_0x1ca9c2['bucket'],_0x35cb5b[_0xb967('0x4d')],_0x1ca9c2['language']);}else{logger[_0xb967('0x65')](util[_0xb967('0x60')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x54e026[_0xb967('0x42')]['id']));return{'transcribeStatus':_0xb967('0x8c')};}})[_0xb967('0x26')](function(_0x3a780b){if(_0x3a780b){_0x3a780b[_0xb967('0x8d')]=_0x54e026[_0xb967('0x47')][_0xb967('0x80')];return _0x35cb5b['updateAttributes'](_0x3a780b);}})['then'](respondWithResult(_0x49742a,null))[_0xb967('0x40')](handleError(_0x49742a,null));};function writeFile(_0x292688,_0x28dc09){return new Promise(function(_0x65ec0c,_0x69827e){fs[_0xb967('0x8e')](_0x28dc09,_0x292688,function(_0x5b34b7,_0x40e249){if(_0x5b34b7){return _0x69827e(_0x5b34b7);}else{return _0x65ec0c(_0x40e249);}});});}exports[_0xb967('0x8f')]=function(_0x34af77,_0x524aaf,_0x3b0298){return db[_0xb967('0x2c')][_0xb967('0x7a')]({'where':{'id':_0x34af77[_0xb967('0x42')]['id']}})[_0xb967('0x26')](handleEntityNotFound(_0x524aaf))[_0xb967('0x26')](function(_0x513f87){if(_0x513f87&&_0x513f87[_0xb967('0x90')]){var _0xdee939=_0x513f87[_0xb967('0x90')];var _0xcf225e=config[_0xb967('0x91')]+_0xb967('0x92')+_0x513f87['id']+_0xb967('0x93');if(fs[_0xb967('0x4f')](_0xcf225e)){return _0xcf225e;}return writeFile(_0xdee939,_0xcf225e)[_0xb967('0x26')](function(){return _0xcf225e;});}else{throw new db['Sequelize'][(_0xb967('0x61'))]('Transcript\x20not\x20available');}})['then'](function(_0x2be47a){return _0x524aaf[_0xb967('0x4a')](_0x2be47a);})['catch'](handleError(_0x524aaf));}; \ No newline at end of file +var _0x2925=['includeAll','include','findAll','rows','catch','params','length','create','body','find','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','sequelize','MD5','token','$and','push','recording','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','bucket','Bucket','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','../../components/encryptor','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','update','destroy','then','end','stack','name','index','map','VoiceRecording','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x5eca9f,_0x1d15d3){var _0x53a05c=function(_0x10bacd){while(--_0x10bacd){_0x5eca9f['push'](_0x5eca9f['shift']());}};_0x53a05c(++_0x1d15d3);}(_0x2925,0x187));var _0x5292=function(_0x1b13fd,_0x5794d4){_0x1b13fd=_0x1b13fd-0x0;var _0x5de2cf=_0x2925[_0x1b13fd];return _0x5de2cf;};'use strict';var emlformat=require(_0x5292('0x0'));var rimraf=require(_0x5292('0x1'));var zipdir=require(_0x5292('0x2'));var jsonpatch=require(_0x5292('0x3'));var rp=require(_0x5292('0x4'));var moment=require(_0x5292('0x5'));var BPromise=require(_0x5292('0x6'));var Mustache=require('mustache');var util=require(_0x5292('0x7'));var path=require(_0x5292('0x8'));var sox=require(_0x5292('0x9'));var csv=require(_0x5292('0xa'));var ejs=require(_0x5292('0xb'));var fs=require('fs');var fs_extra=require(_0x5292('0xc'));var _=require(_0x5292('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5292('0xe'));var deskjs=require(_0x5292('0xf'));var toCsv=require(_0x5292('0xa'));var querystring=require(_0x5292('0x10'));var Papa=require(_0x5292('0x11'));var AWS=require(_0x5292('0x12'));var uuidv4=require(_0x5292('0x13'));var Redis=require(_0x5292('0x14'));var authService=require(_0x5292('0x15'));var qs=require(_0x5292('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5292('0x17'));var logger=require(_0x5292('0x18'))('api');var utils=require(_0x5292('0x19'));var config=require(_0x5292('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x5292('0x1b'))['db'];function respondWithStatusCode(_0x337fa1,_0x2de694){_0x2de694=_0x2de694||0xcc;return function(_0x2de894){if(_0x2de894){return _0x337fa1[_0x5292('0x1c')](_0x2de694);}return _0x337fa1['status'](_0x2de694)['end']();};}function respondWithResult(_0x3118a8,_0x2bec70){_0x2bec70=_0x2bec70||0xc8;return function(_0x343c9e){if(_0x343c9e){return _0x3118a8[_0x5292('0x1d')](_0x2bec70)[_0x5292('0x1e')](_0x343c9e);}};}function respondWithFilteredResult(_0x4d3434,_0xda5062){return function(_0x45cdf1){if(_0x45cdf1){var _0x22daa8=typeof _0xda5062[_0x5292('0x1f')]===_0x5292('0x20')&&typeof _0xda5062[_0x5292('0x21')]===_0x5292('0x20');var _0x579ae1=_0x45cdf1['count'];var _0x33386c=_0x22daa8?0x0:_0xda5062[_0x5292('0x1f')];var _0x55e72e=_0x22daa8?_0x45cdf1[_0x5292('0x22')]:_0xda5062[_0x5292('0x1f')]+_0xda5062[_0x5292('0x21')];var _0x463295;if(_0x55e72e>=_0x579ae1){_0x55e72e=_0x579ae1;_0x463295=0xc8;}else{_0x463295=0xce;}_0x4d3434[_0x5292('0x1d')](_0x463295);return _0x4d3434['set']('Content-Range',_0x33386c+'-'+_0x55e72e+'/'+_0x579ae1)[_0x5292('0x1e')](_0x45cdf1);}return null;};}function patchUpdates(_0x23f9e2){return function(_0x1560dc){try{jsonpatch['apply'](_0x1560dc,_0x23f9e2,!![]);}catch(_0x46262f){return BPromise[_0x5292('0x23')](_0x46262f);}return _0x1560dc['save']();};}function saveUpdates(_0xba0ca,_0xa8c182){return function(_0x32e73c){if(_0x32e73c){return _0x32e73c[_0x5292('0x24')](_0xba0ca)['then'](function(_0x20d658){return _0x20d658;});}return null;};}function removeEntity(_0x2be08c,_0x21b99e){return function(_0x2c0a85){if(_0x2c0a85){return _0x2c0a85[_0x5292('0x25')]()[_0x5292('0x26')](function(){_0x2be08c[_0x5292('0x1d')](0xcc)[_0x5292('0x27')]();});}};}function handleEntityNotFound(_0x580b57,_0x632cce){return function(_0x319e2c){if(!_0x319e2c){_0x580b57[_0x5292('0x1c')](0x194);}return _0x319e2c;};}function handleError(_0x2f6c3a,_0x44f0cb){_0x44f0cb=_0x44f0cb||0x1f4;return function(_0x38d8e6){logger['error'](_0x38d8e6[_0x5292('0x28')]);if(_0x38d8e6[_0x5292('0x29')]){delete _0x38d8e6[_0x5292('0x29')];}_0x2f6c3a[_0x5292('0x1d')](_0x44f0cb)['send'](_0x38d8e6);};}exports[_0x5292('0x2a')]=function(_0x466b3f,_0x3823d0){var _0x2c4bf2={},_0x68b9bb={},_0x3ba1ba={'count':0x0,'rows':[]};var _0x134e79=_[_0x5292('0x2b')](db[_0x5292('0x2c')][_0x5292('0x2d')],function(_0x11aebb){return{'name':_0x11aebb['fieldName'],'type':_0x11aebb[_0x5292('0x2e')][_0x5292('0x2f')]};});_0x68b9bb[_0x5292('0x30')]=_[_0x5292('0x31')](_[_0x5292('0x2b')](_0x134e79,_0x5292('0x29')),[_0x5292('0x32')]);_0x68b9bb[_0x5292('0x33')]=_[_0x5292('0x34')](_0x466b3f['query']);_0x68b9bb[_0x5292('0x35')]=_[_0x5292('0x36')](_0x68b9bb[_0x5292('0x30')],_0x68b9bb[_0x5292('0x33')]);_0x2c4bf2['attributes']=_[_0x5292('0x36')](_0x68b9bb[_0x5292('0x30')],qs['fields'](_0x466b3f[_0x5292('0x33')][_0x5292('0x37')]));_0x2c4bf2[_0x5292('0x38')]=_0x2c4bf2[_0x5292('0x38')]['length']?_0x2c4bf2['attributes']:_0x68b9bb[_0x5292('0x30')];if(!_0x466b3f[_0x5292('0x33')]['hasOwnProperty'](_0x5292('0x39'))){_0x2c4bf2[_0x5292('0x21')]=qs[_0x5292('0x21')](_0x466b3f['query']['limit']);_0x2c4bf2[_0x5292('0x1f')]=qs['offset'](_0x466b3f[_0x5292('0x33')][_0x5292('0x1f')]);}_0x2c4bf2[_0x5292('0x3a')]=qs[_0x5292('0x3b')](_0x466b3f[_0x5292('0x33')][_0x5292('0x3b')]);_0x2c4bf2[_0x5292('0x3c')]=qs['filters'](_[_0x5292('0x3d')](_0x466b3f[_0x5292('0x33')],_0x68b9bb[_0x5292('0x35')]),_0x134e79);if(_0x466b3f['query'][_0x5292('0x3e')]){_0x2c4bf2[_0x5292('0x3c')]=_[_0x5292('0x3f')](_0x2c4bf2[_0x5292('0x3c')],{'$or':_[_0x5292('0x2b')](_0x134e79,function(_0x4d70d0){if(_0x4d70d0[_0x5292('0x2e')]!==_0x5292('0x40')){var _0x1eca72={};_0x1eca72[_0x4d70d0[_0x5292('0x29')]]={'$like':'%'+_0x466b3f[_0x5292('0x33')][_0x5292('0x3e')]+'%'};return _0x1eca72;}})});}_0x2c4bf2=_[_0x5292('0x3f')]({},_0x2c4bf2,_0x466b3f['options']);var _0x19b94d={'where':_0x2c4bf2[_0x5292('0x3c')]};return db[_0x5292('0x2c')][_0x5292('0x22')](_0x19b94d)[_0x5292('0x26')](function(_0x5cc897){_0x3ba1ba[_0x5292('0x22')]=_0x5cc897;if(_0x466b3f['query'][_0x5292('0x41')]){_0x2c4bf2[_0x5292('0x42')]=[{'all':!![]}];}return db[_0x5292('0x2c')][_0x5292('0x43')](_0x2c4bf2);})[_0x5292('0x26')](function(_0x59b163){_0x3ba1ba[_0x5292('0x44')]=_0x59b163;return _0x3ba1ba;})[_0x5292('0x26')](respondWithFilteredResult(_0x3823d0,_0x2c4bf2))[_0x5292('0x45')](handleError(_0x3823d0,null));};exports['show']=function(_0x36ae57,_0x537773){var _0x140ce7={'raw':![],'where':{'id':_0x36ae57[_0x5292('0x46')]['id']}},_0x478e74={};_0x478e74[_0x5292('0x30')]=_[_0x5292('0x34')](db[_0x5292('0x2c')]['rawAttributes']);_0x478e74['query']=_['keys'](_0x36ae57[_0x5292('0x33')]);_0x478e74['filters']=_[_0x5292('0x36')](_0x478e74[_0x5292('0x30')],_0x478e74[_0x5292('0x33')]);_0x140ce7[_0x5292('0x38')]=_['intersection'](_0x478e74[_0x5292('0x30')],qs[_0x5292('0x37')](_0x36ae57['query']['fields']));_0x140ce7[_0x5292('0x38')]=_0x140ce7[_0x5292('0x38')][_0x5292('0x47')]?_0x140ce7[_0x5292('0x38')]:_0x478e74[_0x5292('0x30')];if(_0x36ae57['query']['includeAll']){_0x140ce7[_0x5292('0x42')]=[{'all':!![]}];}_0x140ce7=_[_0x5292('0x3f')]({},_0x140ce7,_0x36ae57['options']);return db['VoiceRecording']['find'](_0x140ce7)['then'](handleEntityNotFound(_0x537773,null))[_0x5292('0x26')](respondWithResult(_0x537773,null))[_0x5292('0x45')](handleError(_0x537773,null));};exports[_0x5292('0x48')]=function(_0x2d934c,_0x355744){return db[_0x5292('0x2c')]['create'](_0x2d934c[_0x5292('0x49')],{})[_0x5292('0x26')](respondWithResult(_0x355744,0xc9))[_0x5292('0x45')](handleError(_0x355744,null));};exports[_0x5292('0x24')]=function(_0x3cec10,_0x409034){if(_0x3cec10['body']['id']){delete _0x3cec10[_0x5292('0x49')]['id'];}return db[_0x5292('0x2c')][_0x5292('0x4a')]({'where':{'id':_0x3cec10[_0x5292('0x46')]['id']}})[_0x5292('0x26')](handleEntityNotFound(_0x409034,null))[_0x5292('0x26')](saveUpdates(_0x3cec10[_0x5292('0x49')],null))[_0x5292('0x26')](respondWithResult(_0x409034,null))[_0x5292('0x45')](handleError(_0x409034,null));};exports[_0x5292('0x4b')]=function(_0x162b65,_0x1ce21e){return db[_0x5292('0x2c')][_0x5292('0x4b')]()['then'](respondWithResult(_0x1ce21e,null))['catch'](handleError(_0x1ce21e,null));};exports[_0x5292('0x4c')]=function(_0x337919,_0x497ff8,_0x4a7808){var _0x4dfed8=require('../../components/encryptor');var _0x393112=![];var _0x39d1fb={};if(_0x337919[_0x5292('0x33')]['type']&&_0x337919[_0x5292('0x33')][_0x5292('0x2e')]===_0x5292('0x4d')){_0x39d1fb['uniqueid']=_0x337919[_0x5292('0x46')]['id'];}else{_0x39d1fb['id']=_0x337919[_0x5292('0x46')]['id'];}return db['VoiceRecording']['find']({'where':_0x39d1fb,'attributes':['id',_0x5292('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x497ff8,null))[_0x5292('0x26')](function(_0x1fceac){if(_0x1fceac){var _0x14df1b=_0x1fceac[_0x5292('0x4e')];var _0x55c881=util[_0x5292('0x32')](_0x5292('0x4f'),_0x14df1b);if(fs[_0x5292('0x50')](_0x55c881)){_0x393112=!![];return _0x4dfed8[_0x5292('0x51')](_0x55c881,_0x14df1b,config[_0x5292('0x52')]['recording'])[_0x5292('0x26')](function(){return _0x1fceac;});}return _0x1fceac;}})[_0x5292('0x26')](function(_0x1c693e){if(_0x1c693e){var _0xb0a593=_0x1c693e[_0x5292('0x4e')];if(!fs['existsSync'](_0xb0a593)){throw new db[(_0x5292('0x53'))][(_0x5292('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x1c693e[_0x5292('0x55')]){return _0x497ff8[_0x5292('0x4c')](_0xb0a593,_0x1c693e[_0x5292('0x55')]+path[_0x5292('0x56')](_0xb0a593),function(){if(_0x393112){fs[_0x5292('0x57')](_0xb0a593);}});}else{return _0x497ff8[_0x5292('0x4c')](_0xb0a593,function(_0x1dd419){if(_0x393112){fs['unlink'](_0xb0a593);}});}}})[_0x5292('0x45')](function(_0x1ff0c9){if(_0x1ff0c9[_0x5292('0x58')]===_0x5292('0x59')){_0x497ff8[_0x5292('0x1d')](0x194)['send']('Not\x20found');}else{return handleError(_0x497ff8,null);}});};exports['downloads']=function(_0x5a6408,_0xd9a8cb,_0xf42d8a){var _0x197a40=require('../../components/encryptor');var _0x2642b4=![];var _0xcdfde2={'$and':[db['sequelize']['where'](db[_0x5292('0x5a')]['fn'](_0x5292('0x5b'),db[_0x5292('0x5a')]['col'](_0x5292('0x4d'))),_0x5a6408['query'][_0x5292('0x5c')])]};if(_0x5a6408[_0x5292('0x33')]['type']&&_0x5a6408['query']['type']===_0x5292('0x4d')){_0xcdfde2[_0x5292('0x5d')][_0x5292('0x5e')]({'uniqueid':_0x5a6408['params']['id']});}else{_0xcdfde2['$and'][_0x5292('0x5e')]({'id':_0x5a6408[_0x5292('0x46')]['id']});}return db['VoiceRecording'][_0x5292('0x4a')]({'where':_0xcdfde2,'attributes':['id',_0x5292('0x4e')],'raw':!![]})[_0x5292('0x26')](handleEntityNotFound(_0xd9a8cb,null))[_0x5292('0x26')](function(_0x3bf218){if(_0x3bf218){var _0x265fe4=util[_0x5292('0x32')]('%s.cypher',_0x3bf218[_0x5292('0x4e')]);if(fs[_0x5292('0x50')](_0x265fe4)){_0x2642b4=!![];return _0x197a40[_0x5292('0x51')](_0x265fe4,_0x3bf218['value'],config['secrets'][_0x5292('0x5f')])[_0x5292('0x26')](function(){return _0x3bf218;});}return _0x3bf218;}})[_0x5292('0x26')](function(_0x440813){if(_0x440813){if(!fs['existsSync'](_0x440813[_0x5292('0x4e')])){throw new db[(_0x5292('0x53'))][(_0x5292('0x54'))](_0x5292('0x59'));}if(_0x440813[_0x5292('0x55')]){return _0xd9a8cb[_0x5292('0x4c')](_0x440813[_0x5292('0x4e')],_0x440813[_0x5292('0x55')]+path[_0x5292('0x56')](_0x440813[_0x5292('0x4e')]),function(){if(_0x2642b4){fs[_0x5292('0x57')](_0x440813[_0x5292('0x4e')]);}});}else{return _0xd9a8cb[_0x5292('0x4c')](_0x440813[_0x5292('0x4e')],function(_0x127092){if(_0x2642b4){fs[_0x5292('0x57')](_0x440813[_0x5292('0x4e')]);}});}}})[_0x5292('0x45')](handleError(_0xd9a8cb,null));};exports[_0x5292('0x25')]=function(_0x13cd74,_0x43a07c){return db[_0x5292('0x2c')][_0x5292('0x4a')]({'where':{'id':_0x13cd74['params']['id']}})[_0x5292('0x26')](function(_0x2c2cc4){if(_[_0x5292('0x60')](_0x2c2cc4)){throw new ReferenceError(_0x5292('0x61'));}return _0x2c2cc4;})[_0x5292('0x26')](function(_0x2c111c){var _0x5cac0c=_0x2c111c[_0x5292('0x4e')];logger['info'](_0x5292('0x62'),_0x5cac0c);if(!_['isNil'](_0x2c111c[_0x5292('0x4e')])&&fs[_0x5292('0x50')](_0x5cac0c)){logger[_0x5292('0x63')](_0x5292('0x64')+_0x5cac0c+_0x5292('0x65'));fs['unlinkSync'](_0x5cac0c);}_0x5cac0c=_0x5cac0c+_0x5292('0x66');if(!_['isNil'](_0x2c111c[_0x5292('0x4e')])&&fs[_0x5292('0x50')](_0x5cac0c)){logger[_0x5292('0x63')](_0x5292('0x64')+_0x5cac0c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x5cac0c);}return _0x2c111c;})['then'](function(_0x24b4f8){if(!_0x24b4f8)throw new InternalError();return _0x24b4f8[_0x5292('0x25')]();})[_0x5292('0x26')](function(){_0x43a07c[_0x5292('0x1d')](0xcc)[_0x5292('0x27')]();})[_0x5292('0x45')](handleError(_0x43a07c,null));};function getBucketslist(_0x24183a,_0x106f41,_0x4764f0){return new Promise(function(_0x16ef10,_0x4ded20){var _0x331720=new AWS['S3']({'accessKeyId':_0x106f41,'secretAccessKey':_0x24183a,'region':_0x4764f0});_0x331720[_0x5292('0x67')]({},function(_0x25a29d,_0x36dd62){if(_0x25a29d){return _0x4ded20(_0x25a29d);}else{return _0x16ef10(_0x36dd62);}});});}function createBucket(_0x52ba09,_0x51fc71,_0x311af6,_0x568fc1){return new Promise(function(_0x35f27d,_0x2d7afa){var _0x2c8051=new AWS['S3']({'accessKeyId':_0x51fc71,'secretAccessKey':_0x52ba09,'region':_0x311af6});_0x2c8051[_0x5292('0x68')]({'Bucket':_0x568fc1},function(_0x59a713,_0x4266bf){if(_0x59a713){return _0x2d7afa(_0x59a713);}else{return _0x35f27d(_0x4266bf);}});});}function uploadFile(_0x38afb5,_0x4279fe,_0x53f80d,_0x46e645,_0x13569a,_0xb99a0a){return new Promise(function(_0x32aabf,_0x508793){var _0x3a7d2b=new AWS['S3']({'accessKeyId':_0x4279fe,'secretAccessKey':_0x38afb5,'region':_0x53f80d});_0x3a7d2b[_0x5292('0x69')]({'Bucket':_0x46e645,'Key':_0x13569a,'Body':_0xb99a0a},function(_0x492066,_0x197102){if(_0x492066){return _0x508793(_0x492066);}else{return _0x32aabf(_0x197102);}});});}function startTranscribe(_0x421989,_0x4ef5b7,_0x230f23,_0x533e8c,_0x1a6135,_0x57d192){return new Promise(function(_0x5be44a,_0x273e9d){var _0x7bfd90=new AWS[(_0x5292('0x6a'))]({'accessKeyId':_0x4ef5b7,'secretAccessKey':_0x421989,'region':_0x230f23});_0x7bfd90[_0x5292('0x6b')]({'TranscriptionJobName':_0x533e8c,'LanguageCode':_0x1a6135,'Media':{'MediaFileUri':_0x57d192}},function(_0x51bdbe,_0x243e00){if(_0x51bdbe){return _0x273e9d(_0x51bdbe);}else{return _0x5be44a(_0x243e00);}});});}function transcribe(_0x40f22e,_0x33ae3d,_0x2b9bd2,_0xca1766,_0x57c42e,_0x1d4894,_0x3efb10){return new Promise(function(_0x4cf9bf,_0x189a5f){var _0x108891={};logger[_0x5292('0x63')](util[_0x5292('0x32')](_0x5292('0x6c'),_0x40f22e,_0x57c42e));return uploadFile(_0x33ae3d,_0x2b9bd2,_0xca1766,_0x57c42e,path[_0x5292('0x6d')](_0x1d4894),fs[_0x5292('0x6e')](_0x1d4894))[_0x5292('0x26')](function(_0x365ade){logger[_0x5292('0x63')](util[_0x5292('0x32')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x40f22e,_0x57c42e,_0x365ade['Location']));_0x108891[_0x5292('0x6f')]=_0x365ade[_0x5292('0x70')];_0x108891['location']=_0x365ade[_0x5292('0x71')];logger[_0x5292('0x63')](util['format'](_0x5292('0x72'),_0x40f22e));return startTranscribe(_0x33ae3d,_0x2b9bd2,_0xca1766,uuidv4(),_0x3efb10,_0x365ade[_0x5292('0x71')]);})[_0x5292('0x26')](function(_0x34bd3f){logger[_0x5292('0x63')](util['format'](_0x5292('0x73'),_0x40f22e,_0x34bd3f[_0x5292('0x74')][_0x5292('0x75')]));_0x108891[_0x5292('0x76')]=_0x34bd3f['TranscriptionJob']['TranscriptionJobName'];_0x108891[_0x5292('0x77')]=_0x34bd3f[_0x5292('0x74')][_0x5292('0x78')];return _0x4cf9bf(_0x108891);})[_0x5292('0x45')](function(_0x367542){return _0x189a5f(_0x367542);});});}exports[_0x5292('0x79')]=function(_0x264df0,_0x5f4964,_0x331d86){var _0x1b5bd4;var _0x46a247;var _0x395306;var _0x35233d=require(_0x5292('0x7a'));return db[_0x5292('0x2c')]['findOne']({'where':{'id':_0x264df0[_0x5292('0x46')]['id']}})[_0x5292('0x26')](function(_0x15fb07){if(_0x15fb07){var _0x1fc307=util[_0x5292('0x32')]('%s.cypher',_0x15fb07['value']);if(fs['existsSync'](_0x1fc307)){cypher=!![];return _0x35233d[_0x5292('0x51')](_0x1fc307,_0x15fb07[_0x5292('0x4e')],config['secrets'][_0x5292('0x5f')])[_0x5292('0x26')](function(){return _0x15fb07;});}return _0x15fb07;}})[_0x5292('0x26')](function(_0x549c73){if(!_0x549c73){throw new db[(_0x5292('0x53'))][(_0x5292('0x54'))](_0x5292('0x7b'));}_0x46a247=_0x549c73;return db[_0x5292('0x7c')][_0x5292('0x7d')]({'where':{'id':0x1}});})[_0x5292('0x26')](handleEntityNotFound(_0x5f4964,null))[_0x5292('0x26')](function(_0x5557b2){if(_0x5557b2){_0x1b5bd4=_0x5557b2;if(!_0x1b5bd4[_0x5292('0x7e')]||!_0x1b5bd4[_0x5292('0x7f')]||!_0x1b5bd4['transcribeRegion']||!_0x1b5bd4[_0x5292('0x80')]||!_0x1b5bd4[_0x5292('0x6f')]){throw new db[(_0x5292('0x53'))][(_0x5292('0x54'))](_0x5292('0x81'));}if(_0x264df0[_0x5292('0x49')][_0x5292('0x82')]&&(!_0x1b5bd4[_0x5292('0x83')]||!_0x1b5bd4[_0x5292('0x84')]||!_0x1b5bd4['sentimentRegion']||!_0x1b5bd4[_0x5292('0x80')]||!_0x1b5bd4[_0x5292('0x6f')])){throw new db[(_0x5292('0x53'))][(_0x5292('0x54'))](_0x5292('0x85'));}return db[_0x5292('0x86')][_0x5292('0x7d')]({'where':{'id':_0x1b5bd4[_0x5292('0x7f')]}});}})[_0x5292('0x26')](function(_0x2a8cef){if(!_0x2a8cef){throw new db[(_0x5292('0x53'))][(_0x5292('0x54'))](_0x5292('0x87'));}if(!_0x2a8cef['data1']||!_0x2a8cef[_0x5292('0x88')]){throw new db['Sequelize'][(_0x5292('0x54'))](_0x5292('0x89'));}_0x395306=_0x2a8cef;return getBucketslist(_0x395306[_0x5292('0x8a')],_0x395306[_0x5292('0x88')],_0x1b5bd4[_0x5292('0x8b')]);})['then'](function(_0x4b8e08){if(_0x4b8e08&&_0x4b8e08['Buckets']){var _0x219a62=_[_0x5292('0x4a')](_0x4b8e08[_0x5292('0x8c')],function(_0xf08c52){return _0xf08c52[_0x5292('0x8d')]===_0x1b5bd4['bucket'];});if(!_0x219a62){logger[_0x5292('0x63')](util[_0x5292('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x264df0[_0x5292('0x46')]['id'],_0x1b5bd4['bucket']));return createBucket(_0x395306[_0x5292('0x8a')],_0x395306[_0x5292('0x88')],_0x1b5bd4[_0x5292('0x8b')],_0x1b5bd4[_0x5292('0x6f')]);}logger[_0x5292('0x63')](util[_0x5292('0x32')](_0x5292('0x8e'),_0x264df0['params']['id'],_0x1b5bd4[_0x5292('0x6f')]));return;}})[_0x5292('0x26')](function(_0x12a0cf){if(_0x46a247[_0x5292('0x77')]===_0x5292('0x8f')){return transcribe(_0x264df0[_0x5292('0x46')]['id'],_0x395306[_0x5292('0x8a')],_0x395306[_0x5292('0x88')],_0x1b5bd4['transcribeRegion'],_0x1b5bd4[_0x5292('0x6f')],_0x46a247['value'],_0x1b5bd4[_0x5292('0x80')]);}else{logger[_0x5292('0x63')](util[_0x5292('0x32')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x264df0['params']['id']));return{'transcribeStatus':_0x5292('0x90')};}})['then'](function(_0x57f657){if(_0x57f657){_0x57f657[_0x5292('0x91')]=_0x264df0[_0x5292('0x49')][_0x5292('0x82')];return _0x46a247[_0x5292('0x92')](_0x57f657);}})[_0x5292('0x26')](respondWithResult(_0x5f4964,null))[_0x5292('0x45')](handleError(_0x5f4964,null));};function writeFile(_0x25def4,_0x518cca){return new Promise(function(_0x2d3461,_0x4420aa){fs[_0x5292('0x93')](_0x518cca,_0x25def4,function(_0x3bad04,_0x41afe5){if(_0x3bad04){return _0x4420aa(_0x3bad04);}else{return _0x2d3461(_0x41afe5);}});});}exports[_0x5292('0x94')]=function(_0x1ecc5f,_0xb6947e,_0x3421d5){return db[_0x5292('0x2c')][_0x5292('0x7d')]({'where':{'id':_0x1ecc5f['params']['id']}})[_0x5292('0x26')](handleEntityNotFound(_0xb6947e))[_0x5292('0x26')](function(_0x2725c9){if(_0x2725c9&&_0x2725c9[_0x5292('0x95')]){var _0x18dd18=_0x2725c9[_0x5292('0x95')];var _0x365907=config[_0x5292('0x96')]+'/server/files/transcribes/transcribe_'+_0x2725c9['id']+'.txt';if(fs['existsSync'](_0x365907)){return _0x365907;}return writeFile(_0x18dd18,_0x365907)[_0x5292('0x26')](function(){return _0x365907;});}else{throw new db[(_0x5292('0x53'))][(_0x5292('0x54'))](_0x5292('0x97'));}})[_0x5292('0x26')](function(_0x11340e){return _0xb6947e[_0x5292('0x4c')](_0x11340e);})[_0x5292('0x45')](handleError(_0xb6947e));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 19a8f94..e54f2a8 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 _0x8f37=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports'];(function(_0x1a08cf,_0x186382){var _0x4174b7=function(_0x263861){while(--_0x263861){_0x1a08cf['push'](_0x1a08cf['shift']());}};_0x4174b7(++_0x186382);}(_0x8f37,0x190));var _0x78f3=function(_0x1a452f,_0xb35879){_0x1a452f=_0x1a452f-0x0;var _0x4b2a52=_0x8f37[_0x1a452f];return _0x4b2a52;};'use strict';var attributes=require(_0x78f3('0x0'));module[_0x78f3('0x1')]=function(_0x351c4f,_0x5c221b){return _0x351c4f['define'](_0x78f3('0x2'),attributes,{'tableName':_0x78f3('0x3'),'paranoid':![],'indexes':[{'name':_0x78f3('0x4'),'fields':['uniqueid']},{'name':_0x78f3('0x5'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x59ce=['exports','define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0x41fc65,_0x426991){var _0x1db689=function(_0x4bb0b3){while(--_0x4bb0b3){_0x41fc65['push'](_0x41fc65['shift']());}};_0x1db689(++_0x426991);}(_0x59ce,0x92));var _0xe59c=function(_0x45e84f,_0x3ef066){_0x45e84f=_0x45e84f-0x0;var _0x54a084=_0x59ce[_0x45e84f];return _0x54a084;};'use strict';var attributes=require(_0xe59c('0x0'));module[_0xe59c('0x1')]=function(_0x1d28da,_0x4b05a0){return _0x1d28da[_0xe59c('0x2')](_0xe59c('0x3'),attributes,{'tableName':_0xe59c('0x4'),'paranoid':![],'indexes':[{'name':_0xe59c('0x5'),'fields':[_0xe59c('0x5')]},{'name':_0xe59c('0x6'),'fields':[_0xe59c('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 9c260c4..0019970 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 _0xfb11=['update','body','options','where','attributes','debug','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','recording','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateVoiceRecording','VoiceRecording'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xfb11[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var moment=require(_0x1fb1('0x1'));var BPromise=require(_0x1fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fb1('0x4'));var logger=require('../../config/logger')(_0x1fb1('0x5'));var config=require(_0x1fb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1fb1('0x7')][_0x1fb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c098d,_0x1859da,_0x2596c2){return new BPromise(function(_0x34e61a,_0x236b20){return client[_0x1fb1('0x9')](_0x4c098d,_0x2596c2)[_0x1fb1('0xa')](function(_0x438d15){logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,_0x1fb1('0xd'));logger['debug'](_0x1fb1('0xe'),_0x1859da,'request\x20sent',JSON[_0x1fb1('0xf')](_0x438d15));if(_0x438d15['error']){if(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x11')]===0x1f4){logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x236b20(_0x438d15['error'][_0x1fb1('0x12')]);}logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x34e61a(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);}else{logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,'request\x20sent');_0x34e61a(_0x438d15['result'][_0x1fb1('0x12')]);}})[_0x1fb1('0x13')](function(_0x3924ab){logger['error'](_0x1fb1('0xc'),_0x1859da,_0x3924ab);_0x236b20(_0x3924ab);});});}exports[_0x1fb1('0x14')]=function(_0x24d4df){var _0x34076b=this;return new Promise(function(_0x33c6b6,_0x27d71f){return db[_0x1fb1('0x15')][_0x1fb1('0x16')](_0x24d4df[_0x1fb1('0x17')],{'raw':_0x24d4df['options']?_0x24d4df[_0x1fb1('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24d4df['options']?_0x24d4df[_0x1fb1('0x18')][_0x1fb1('0x19')]||null:null,'attributes':_0x24d4df[_0x1fb1('0x18')]?_0x24d4df['options'][_0x1fb1('0x1a')]||null:null,'limit':_0x24d4df['options']?_0x24d4df['options']['limit']||null:null})[_0x1fb1('0xa')](function(_0x1f8e5a){logger[_0x1fb1('0xb')](_0x1fb1('0x14'),_0x24d4df);logger[_0x1fb1('0x1b')]('UpdateVoiceRecording',_0x24d4df,JSON[_0x1fb1('0xf')](_0x1f8e5a));_0x33c6b6(_0x1f8e5a);})[_0x1fb1('0x13')](function(_0x1dc03f){logger[_0x1fb1('0x10')](_0x1fb1('0x14'),_0x1dc03f[_0x1fb1('0x12')],_0x24d4df);_0x27d71f(_0x34076b[_0x1fb1('0x10')](0x1f4,_0x1dc03f[_0x1fb1('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x1b25b3){var _0x1aac7d=this;return new Promise(function(_0x46ff60,_0xc5188b){var _0x1898e7=require(_0x1fb1('0x1c'));var _0x1a74c4;return db[_0x1fb1('0x1d')][_0x1fb1('0x1e')]({'attributes':['id',_0x1fb1('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x1fb1('0xa')](function(_0x497017){_0x1a74c4=_0x497017;return db[_0x1fb1('0x15')][_0x1fb1('0x20')](_0x1b25b3[_0x1fb1('0x17')]);})['then'](function(_0x106134){if(_0x1a74c4[_0x1fb1('0x1f')]&&fs[_0x1fb1('0x21')](_0x106134[_0x1fb1('0x22')])){var _0x5402e9=util[_0x1fb1('0x23')](_0x1fb1('0x24'),_0x106134['value']);return _0x1898e7[_0x1fb1('0x25')](_0x106134['value'],_0x5402e9,config['secrets'][_0x1fb1('0x26')])[_0x1fb1('0xa')](function(){fs['unlink'](_0x106134[_0x1fb1('0x22')]);logger[_0x1fb1('0xb')](_0x1fb1('0x27'));return _0x106134;});}return _0x106134;})[_0x1fb1('0xa')](function(_0x32d797){logger['info'](_0x1fb1('0x28'),_0x1b25b3);logger[_0x1fb1('0x1b')](_0x1fb1('0x28'),_0x1b25b3,JSON[_0x1fb1('0xf')](_0x32d797));_0x46ff60(_0x32d797);})[_0x1fb1('0x13')](function(_0x307700){logger[_0x1fb1('0x10')](_0x1fb1('0x28'),_0x307700[_0x1fb1('0x12')],_0x1b25b3);_0xc5188b(_0x1aac7d['error'](0x1f4,_0x307700[_0x1fb1('0x12')]));});});}; \ No newline at end of file +var _0xef0f=['CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','body','value','%s.cypher','unlink','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','attributes'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xef0f,0x168));var _0xfef0=function(_0x37e383,_0x49f1bd){_0x37e383=_0x37e383-0x0;var _0x142d63=_0xef0f[_0x37e383];return _0x142d63;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('VoiceRecording,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});}exports[_0xfef0('0x18')]=function(_0x581459){var _0xd60678=this;return new Promise(function(_0x1642cd,_0x1577fa){return db[_0xfef0('0x19')][_0xfef0('0x1a')](_0x581459['body'],{'raw':_0x581459[_0xfef0('0x1b')]?_0x581459['options'][_0xfef0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x581459[_0xfef0('0x1b')]?_0x581459[_0xfef0('0x1b')]['where']||null:null,'attributes':_0x581459[_0xfef0('0x1b')]?_0x581459['options'][_0xfef0('0x1d')]||null:null,'limit':_0x581459[_0xfef0('0x1b')]?_0x581459['options']['limit']||null:null})['then'](function(_0x19fde8){logger['info'](_0xfef0('0x18'),_0x581459);logger[_0xfef0('0x10')](_0xfef0('0x18'),_0x581459,JSON[_0xfef0('0x12')](_0x19fde8));_0x1642cd(_0x19fde8);})[_0xfef0('0x17')](function(_0xd687ed){logger['error']('UpdateVoiceRecording',_0xd687ed[_0xfef0('0x15')],_0x581459);_0x1577fa(_0xd60678[_0xfef0('0x13')](0x1f4,_0xd687ed[_0xfef0('0x15')]));});});};exports[_0xfef0('0x1e')]=function(_0xab231c){var _0xf60f2=this;return new Promise(function(_0x5df04f,_0x168b98){var _0x391279=require('../../components/encryptor');var _0x1a6758;return db[_0xfef0('0x1f')][_0xfef0('0x20')]({'attributes':['id',_0xfef0('0x21')],'where':{'id':0x1},'raw':!![]})[_0xfef0('0xc')](function(_0x1ac4a3){_0x1a6758=_0x1ac4a3;return db[_0xfef0('0x19')][_0xfef0('0x22')](_0xab231c[_0xfef0('0x23')]);})[_0xfef0('0xc')](function(_0x3ee42f){if(_0x1a6758[_0xfef0('0x21')]&&fs['existsSync'](_0x3ee42f[_0xfef0('0x24')])){var _0x5806bd=util['format'](_0xfef0('0x25'),_0x3ee42f[_0xfef0('0x24')]);return _0x391279['encryptFile'](_0x3ee42f['value'],_0x5806bd,config['secrets']['recording'])['then'](function(){fs[_0xfef0('0x26')](_0x3ee42f[_0xfef0('0x24')]);logger[_0xfef0('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x3ee42f;});}return _0x3ee42f;})['then'](function(_0x50430e){logger[_0xfef0('0xd')]('CreateVoiceRecording',_0xab231c);logger[_0xfef0('0x10')](_0xfef0('0x1e'),_0xab231c,JSON[_0xfef0('0x12')](_0x50430e));_0x5df04f(_0x50430e);})['catch'](function(_0x3cad13){logger['error'](_0xfef0('0x1e'),_0x3cad13[_0xfef0('0x15')],_0xab231c);_0x168b98(_0xf60f2[_0xfef0('0x13')](0x1f4,_0x3cad13[_0xfef0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 21793ed..0790899 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 _0x8b38=['describe','/:id','show','post','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x48942f,_0x15d22d){var _0x59049f=function(_0x1e0eae){while(--_0x1e0eae){_0x48942f['push'](_0x48942f['shift']());}};_0x59049f(++_0x15d22d);}(_0x8b38,0x174));var _0x88b3=function(_0x48e921,_0x20cf98){_0x48e921=_0x48e921-0x0;var _0x4986fe=_0x8b38[_0x48e921];return _0x4986fe;};'use strict';var multer=require(_0x88b3('0x0'));var util=require(_0x88b3('0x1'));var path=require(_0x88b3('0x2'));var timeout=require(_0x88b3('0x3'));var express=require(_0x88b3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x88b3('0x5'));var interaction=require(_0x88b3('0x6'));var config=require('../../config/environment');var controller=require(_0x88b3('0x7'));router[_0x88b3('0x8')]('/',auth[_0x88b3('0x9')](),controller[_0x88b3('0xa')]);router[_0x88b3('0x8')](_0x88b3('0xb'),auth[_0x88b3('0x9')](),controller[_0x88b3('0xc')]);router[_0x88b3('0x8')](_0x88b3('0xd'),auth['isAuthenticated'](),controller[_0x88b3('0xe')]);router[_0x88b3('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x88b3('0x9')](),controller['update']);router['delete'](_0x88b3('0xd'),auth[_0x88b3('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb5d7=['./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2094e5,_0x236265){var _0x21af38=function(_0x5a3751){while(--_0x5a3751){_0x2094e5['push'](_0x2094e5['shift']());}};_0x21af38(++_0x236265);}(_0xb5d7,0xcb));var _0x7b5d=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb5d7[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7b5d('0x0'));var util=require(_0x7b5d('0x1'));var path=require('path');var timeout=require(_0x7b5d('0x2'));var express=require(_0x7b5d('0x3'));var router=express[_0x7b5d('0x4')]();var fs_extra=require(_0x7b5d('0x5'));var auth=require(_0x7b5d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7b5d('0x7'));router[_0x7b5d('0x8')]('/',auth[_0x7b5d('0x9')](),controller[_0x7b5d('0xa')]);router[_0x7b5d('0x8')](_0x7b5d('0xb'),auth[_0x7b5d('0x9')](),controller[_0x7b5d('0xc')]);router[_0x7b5d('0x8')](_0x7b5d('0xd'),auth['isAuthenticated'](),controller[_0x7b5d('0xe')]);router[_0x7b5d('0xf')]('/',auth[_0x7b5d('0x9')](),controller[_0x7b5d('0x10')]);router[_0x7b5d('0x11')](_0x7b5d('0xd'),auth[_0x7b5d('0x9')](),controller[_0x7b5d('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7b5d('0x13')]);module[_0x7b5d('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index f5265c6..aa7c475 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 _0x1024=['sequelize','moment','exports','ENUM','STRING','Yes'];(function(_0x55d9d9,_0x134208){var _0x1559da=function(_0x17ec52){while(--_0x17ec52){_0x55d9d9['push'](_0x55d9d9['shift']());}};_0x1559da(++_0x134208);}(_0x1024,0x1aa));var _0x4102=function(_0x426b11,_0xea4be1){_0x426b11=_0x426b11-0x0;var _0x438be2=_0x1024[_0x426b11];return _0x438be2;};'use strict';var Sequelize=require(_0x4102('0x0'));var moment=require(_0x4102('0x1'));module[_0x4102('0x2')]={'type':{'type':Sequelize[_0x4102('0x3')]('blind','attended')},'result':{'type':Sequelize[_0x4102('0x4')]},'transfererchannel':{'type':Sequelize[_0x4102('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x4102('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x4102('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x4102('0x4')]},'transfereechannel':{'type':Sequelize[_0x4102('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x4102('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x4102('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x4102('0x4')]},'transfereecontext':{'type':Sequelize[_0x4102('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x4102('0x4')]},'isexternal':{'type':Sequelize[_0x4102('0x3')](_0x4102('0x5'),'No')},'context':{'type':Sequelize[_0x4102('0x4')]},'extension':{'type':Sequelize[_0x4102('0x4')]}}; \ No newline at end of file +var _0xc6e6=['blind','attended','STRING','ENUM','sequelize','moment','exports'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0xc6e6,0x1a8));var _0x6c6e=function(_0x5c57a9,_0x236717){_0x5c57a9=_0x5c57a9-0x0;var _0x14d78e=_0xc6e6[_0x5c57a9];return _0x14d78e;};'use strict';var Sequelize=require(_0x6c6e('0x0'));var moment=require(_0x6c6e('0x1'));module[_0x6c6e('0x2')]={'type':{'type':Sequelize['ENUM'](_0x6c6e('0x3'),_0x6c6e('0x4'))},'result':{'type':Sequelize[_0x6c6e('0x5')]},'transfererchannel':{'type':Sequelize[_0x6c6e('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x6c6e('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x6c6e('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x6c6e('0x5')]},'transfererexten':{'type':Sequelize[_0x6c6e('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x6c6e('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x6c6e('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x6c6e('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x6c6e('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x6c6e('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x6c6e('0x6')]('Yes','No')},'context':{'type':Sequelize[_0x6c6e('0x5')]},'extension':{'type':Sequelize[_0x6c6e('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 3ef5ab9..dc6bec9 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 _0xae11=['findAll','catch','show','params','includeAll','find','create','body','describe','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','filters','pick','where','VIRTUAL','filter','merge','options','include'];(function(_0x414f67,_0x861aed){var _0x338537=function(_0x4696fd){while(--_0x4696fd){_0x414f67['push'](_0x414f67['shift']());}};_0x338537(++_0x861aed);}(_0xae11,0xde));var _0x1ae1=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xae11[_0x54d4fe];return _0x1ab5bb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1ae1('0x0'));var rp=require('request-promise');var moment=require(_0x1ae1('0x1'));var BPromise=require(_0x1ae1('0x2'));var Mustache=require(_0x1ae1('0x3'));var util=require('util');var path=require(_0x1ae1('0x4'));var sox=require(_0x1ae1('0x5'));var csv=require(_0x1ae1('0x6'));var ejs=require(_0x1ae1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1ae1('0x8'));var squel=require(_0x1ae1('0x9'));var crypto=require('crypto');var jsforce=require(_0x1ae1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1ae1('0x6'));var querystring=require(_0x1ae1('0xb'));var Papa=require(_0x1ae1('0xc'));var Redis=require(_0x1ae1('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1ae1('0xe'));var as=require(_0x1ae1('0xf'));var hardwareService=require(_0x1ae1('0x10'));var logger=require(_0x1ae1('0x11'))(_0x1ae1('0x12'));var utils=require(_0x1ae1('0x13'));var config=require(_0x1ae1('0x14'));var licenseUtil=require(_0x1ae1('0x15'));var db=require(_0x1ae1('0x16'))['db'];function respondWithStatusCode(_0x53049a,_0x12aa2d){_0x12aa2d=_0x12aa2d||0xcc;return function(_0x41de37){if(_0x41de37){return _0x53049a['sendStatus'](_0x12aa2d);}return _0x53049a[_0x1ae1('0x17')](_0x12aa2d)[_0x1ae1('0x18')]();};}function respondWithResult(_0x49ec0c,_0x53c5e7){_0x53c5e7=_0x53c5e7||0xc8;return function(_0x2b8feb){if(_0x2b8feb){return _0x49ec0c[_0x1ae1('0x17')](_0x53c5e7)[_0x1ae1('0x19')](_0x2b8feb);}};}function respondWithFilteredResult(_0x3c39af,_0x520db7){return function(_0x231358){if(_0x231358){var _0x54bb02=typeof _0x520db7[_0x1ae1('0x1a')]===_0x1ae1('0x1b')&&typeof _0x520db7[_0x1ae1('0x1c')]===_0x1ae1('0x1b');var _0x1d2216=_0x231358[_0x1ae1('0x1d')];var _0x3cf27d=_0x54bb02?0x0:_0x520db7[_0x1ae1('0x1a')];var _0x4335f0=_0x54bb02?_0x231358[_0x1ae1('0x1d')]:_0x520db7[_0x1ae1('0x1a')]+_0x520db7[_0x1ae1('0x1c')];var _0x208b33;if(_0x4335f0>=_0x1d2216){_0x4335f0=_0x1d2216;_0x208b33=0xc8;}else{_0x208b33=0xce;}_0x3c39af[_0x1ae1('0x17')](_0x208b33);return _0x3c39af[_0x1ae1('0x1e')](_0x1ae1('0x1f'),_0x3cf27d+'-'+_0x4335f0+'/'+_0x1d2216)['json'](_0x231358);}return null;};}function patchUpdates(_0x1a05b2){return function(_0x33dda9){try{jsonpatch[_0x1ae1('0x20')](_0x33dda9,_0x1a05b2,!![]);}catch(_0x14744e){return BPromise['reject'](_0x14744e);}return _0x33dda9[_0x1ae1('0x21')]();};}function saveUpdates(_0x45140e,_0x49b8cb){return function(_0x24c2b0){if(_0x24c2b0){return _0x24c2b0[_0x1ae1('0x22')](_0x45140e)[_0x1ae1('0x23')](function(_0x3cffa8){return _0x3cffa8;});}return null;};}function removeEntity(_0x703fb7,_0x651992){return function(_0x289786){if(_0x289786){return _0x289786[_0x1ae1('0x24')]()[_0x1ae1('0x23')](function(){_0x703fb7[_0x1ae1('0x17')](0xcc)[_0x1ae1('0x18')]();});}};}function handleEntityNotFound(_0x2daded,_0x3c0e12){return function(_0x140e34){if(!_0x140e34){_0x2daded[_0x1ae1('0x25')](0x194);}return _0x140e34;};}function handleError(_0x55136c,_0x583a0d){_0x583a0d=_0x583a0d||0x1f4;return function(_0x4fdf60){logger['error'](_0x4fdf60[_0x1ae1('0x26')]);if(_0x4fdf60['name']){delete _0x4fdf60['name'];}_0x55136c[_0x1ae1('0x17')](_0x583a0d)['send'](_0x4fdf60);};}exports[_0x1ae1('0x27')]=function(_0x4782c8,_0x3181ac){var _0x136a4a={},_0x329e43={},_0x5f14ec={'count':0x0,'rows':[]};var _0xbb7ef6=_[_0x1ae1('0x28')](db[_0x1ae1('0x29')][_0x1ae1('0x2a')],function(_0x32a207){return{'name':_0x32a207[_0x1ae1('0x2b')],'type':_0x32a207[_0x1ae1('0x2c')][_0x1ae1('0x2d')]};});_0x329e43[_0x1ae1('0x2e')]=_[_0x1ae1('0x28')](_0xbb7ef6,_0x1ae1('0x2f'));_0x329e43[_0x1ae1('0x30')]=_[_0x1ae1('0x31')](_0x4782c8[_0x1ae1('0x30')]);_0x329e43['filters']=_[_0x1ae1('0x32')](_0x329e43['model'],_0x329e43[_0x1ae1('0x30')]);_0x136a4a[_0x1ae1('0x33')]=_[_0x1ae1('0x32')](_0x329e43[_0x1ae1('0x2e')],qs[_0x1ae1('0x34')](_0x4782c8['query'][_0x1ae1('0x34')]));_0x136a4a['attributes']=_0x136a4a[_0x1ae1('0x33')][_0x1ae1('0x35')]?_0x136a4a[_0x1ae1('0x33')]:_0x329e43[_0x1ae1('0x2e')];if(!_0x4782c8['query']['hasOwnProperty']('nolimit')){_0x136a4a[_0x1ae1('0x1c')]=qs['limit'](_0x4782c8['query'][_0x1ae1('0x1c')]);_0x136a4a[_0x1ae1('0x1a')]=qs[_0x1ae1('0x1a')](_0x4782c8[_0x1ae1('0x30')]['offset']);}_0x136a4a['order']=qs['sort'](_0x4782c8[_0x1ae1('0x30')]['sort']);_0x136a4a['where']=qs[_0x1ae1('0x36')](_[_0x1ae1('0x37')](_0x4782c8[_0x1ae1('0x30')],_0x329e43[_0x1ae1('0x36')]),_0xbb7ef6);if(_0x4782c8[_0x1ae1('0x30')]['filter']){_0x136a4a[_0x1ae1('0x38')]=_['merge'](_0x136a4a[_0x1ae1('0x38')],{'$or':_['map'](_0xbb7ef6,function(_0x3a32c5){if(_0x3a32c5[_0x1ae1('0x2c')]!==_0x1ae1('0x39')){var _0x2a60d1={};_0x2a60d1[_0x3a32c5[_0x1ae1('0x2f')]]={'$like':'%'+_0x4782c8[_0x1ae1('0x30')][_0x1ae1('0x3a')]+'%'};return _0x2a60d1;}})});}_0x136a4a=_[_0x1ae1('0x3b')]({},_0x136a4a,_0x4782c8[_0x1ae1('0x3c')]);var _0x4ccd77={'where':_0x136a4a['where']};return db[_0x1ae1('0x29')][_0x1ae1('0x1d')](_0x4ccd77)['then'](function(_0xbff45a){_0x5f14ec[_0x1ae1('0x1d')]=_0xbff45a;if(_0x4782c8[_0x1ae1('0x30')]['includeAll']){_0x136a4a[_0x1ae1('0x3d')]=[{'all':!![]}];}return db[_0x1ae1('0x29')][_0x1ae1('0x3e')](_0x136a4a);})[_0x1ae1('0x23')](function(_0x2c2ee7){_0x5f14ec['rows']=_0x2c2ee7;return _0x5f14ec;})[_0x1ae1('0x23')](respondWithFilteredResult(_0x3181ac,_0x136a4a))[_0x1ae1('0x3f')](handleError(_0x3181ac,null));};exports[_0x1ae1('0x40')]=function(_0x3d8862,_0x462b36){var _0x376143={'raw':!![],'where':{'id':_0x3d8862[_0x1ae1('0x41')]['id']}},_0x1ab810={};_0x1ab810[_0x1ae1('0x2e')]=_[_0x1ae1('0x31')](db[_0x1ae1('0x29')]['rawAttributes']);_0x1ab810[_0x1ae1('0x30')]=_['keys'](_0x3d8862[_0x1ae1('0x30')]);_0x1ab810['filters']=_[_0x1ae1('0x32')](_0x1ab810['model'],_0x1ab810[_0x1ae1('0x30')]);_0x376143[_0x1ae1('0x33')]=_[_0x1ae1('0x32')](_0x1ab810[_0x1ae1('0x2e')],qs[_0x1ae1('0x34')](_0x3d8862[_0x1ae1('0x30')][_0x1ae1('0x34')]));_0x376143[_0x1ae1('0x33')]=_0x376143[_0x1ae1('0x33')][_0x1ae1('0x35')]?_0x376143[_0x1ae1('0x33')]:_0x1ab810[_0x1ae1('0x2e')];if(_0x3d8862[_0x1ae1('0x30')][_0x1ae1('0x42')]){_0x376143[_0x1ae1('0x3d')]=[{'all':!![]}];}_0x376143=_[_0x1ae1('0x3b')]({},_0x376143,_0x3d8862[_0x1ae1('0x3c')]);return db[_0x1ae1('0x29')][_0x1ae1('0x43')](_0x376143)[_0x1ae1('0x23')](handleEntityNotFound(_0x462b36,null))[_0x1ae1('0x23')](respondWithResult(_0x462b36,null))[_0x1ae1('0x3f')](handleError(_0x462b36,null));};exports['create']=function(_0x16a91e,_0xba5e26){return db[_0x1ae1('0x29')][_0x1ae1('0x44')](_0x16a91e[_0x1ae1('0x45')],{})[_0x1ae1('0x23')](respondWithResult(_0xba5e26,0xc9))[_0x1ae1('0x3f')](handleError(_0xba5e26,null));};exports[_0x1ae1('0x22')]=function(_0x1f4402,_0x5690a4){if(_0x1f4402['body']['id']){delete _0x1f4402[_0x1ae1('0x45')]['id'];}return db[_0x1ae1('0x29')][_0x1ae1('0x43')]({'where':{'id':_0x1f4402[_0x1ae1('0x41')]['id']}})[_0x1ae1('0x23')](handleEntityNotFound(_0x5690a4,null))['then'](saveUpdates(_0x1f4402[_0x1ae1('0x45')],null))[_0x1ae1('0x23')](respondWithResult(_0x5690a4,null))[_0x1ae1('0x3f')](handleError(_0x5690a4,null));};exports['destroy']=function(_0x511c32,_0x70c833){return db[_0x1ae1('0x29')]['find']({'where':{'id':_0x511c32['params']['id']}})[_0x1ae1('0x23')](handleEntityNotFound(_0x70c833,null))[_0x1ae1('0x23')](removeEntity(_0x70c833,null))['catch'](handleError(_0x70c833,null));};exports[_0x1ae1('0x46')]=function(_0x38e4e6,_0x408256){return db['VoiceTransferReport'][_0x1ae1('0x46')]()[_0x1ae1('0x23')](respondWithResult(_0x408256,null))['catch'](handleError(_0x408256,null));}; \ No newline at end of file +var _0xce16=['rows','catch','show','length','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x22f1a3,_0x335eec){var _0x45518b=function(_0x2c2866){while(--_0x2c2866){_0x22f1a3['push'](_0x22f1a3['shift']());}};_0x45518b(++_0x335eec);}(_0xce16,0x9e));var _0x6ce1=function(_0x473c57,_0x26c49d){_0x473c57=_0x473c57-0x0;var _0x3b989e=_0xce16[_0x473c57];return _0x3b989e;};'use strict';var emlformat=require(_0x6ce1('0x0'));var rimraf=require(_0x6ce1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ce1('0x2'));var rp=require(_0x6ce1('0x3'));var moment=require(_0x6ce1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6ce1('0x5'));var util=require('util');var path=require(_0x6ce1('0x6'));var sox=require('sox');var csv=require(_0x6ce1('0x7'));var ejs=require(_0x6ce1('0x8'));var fs=require('fs');var fs_extra=require(_0x6ce1('0x9'));var _=require(_0x6ce1('0xa'));var squel=require(_0x6ce1('0xb'));var crypto=require(_0x6ce1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6ce1('0xd'));var toCsv=require(_0x6ce1('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6ce1('0xe'));var authService=require(_0x6ce1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6ce1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ce1('0x11'))(_0x6ce1('0x12'));var utils=require(_0x6ce1('0x13'));var config=require(_0x6ce1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ce1('0x15'))['db'];function respondWithStatusCode(_0x3c4039,_0x4146fa){_0x4146fa=_0x4146fa||0xcc;return function(_0x49bdb8){if(_0x49bdb8){return _0x3c4039[_0x6ce1('0x16')](_0x4146fa);}return _0x3c4039[_0x6ce1('0x17')](_0x4146fa)[_0x6ce1('0x18')]();};}function respondWithResult(_0x5981ef,_0x2b3438){_0x2b3438=_0x2b3438||0xc8;return function(_0x19abb3){if(_0x19abb3){return _0x5981ef['status'](_0x2b3438)[_0x6ce1('0x19')](_0x19abb3);}};}function respondWithFilteredResult(_0x46e7a4,_0x175dd2){return function(_0x161c16){if(_0x161c16){var _0x53010e=typeof _0x175dd2[_0x6ce1('0x1a')]===_0x6ce1('0x1b')&&typeof _0x175dd2[_0x6ce1('0x1c')]===_0x6ce1('0x1b');var _0x364014=_0x161c16['count'];var _0x3308c2=_0x53010e?0x0:_0x175dd2[_0x6ce1('0x1a')];var _0x1e1f44=_0x53010e?_0x161c16[_0x6ce1('0x1d')]:_0x175dd2[_0x6ce1('0x1a')]+_0x175dd2['limit'];var _0x278171;if(_0x1e1f44>=_0x364014){_0x1e1f44=_0x364014;_0x278171=0xc8;}else{_0x278171=0xce;}_0x46e7a4[_0x6ce1('0x17')](_0x278171);return _0x46e7a4[_0x6ce1('0x1e')]('Content-Range',_0x3308c2+'-'+_0x1e1f44+'/'+_0x364014)[_0x6ce1('0x19')](_0x161c16);}return null;};}function patchUpdates(_0x1f2c38){return function(_0x525064){try{jsonpatch[_0x6ce1('0x1f')](_0x525064,_0x1f2c38,!![]);}catch(_0xab04af){return BPromise['reject'](_0xab04af);}return _0x525064[_0x6ce1('0x20')]();};}function saveUpdates(_0x54469c,_0x59c02f){return function(_0x3387c3){if(_0x3387c3){return _0x3387c3['update'](_0x54469c)[_0x6ce1('0x21')](function(_0x37711d){return _0x37711d;});}return null;};}function removeEntity(_0x57085f,_0x17cf4a){return function(_0x2a9172){if(_0x2a9172){return _0x2a9172[_0x6ce1('0x22')]()['then'](function(){_0x57085f[_0x6ce1('0x17')](0xcc)[_0x6ce1('0x18')]();});}};}function handleEntityNotFound(_0x1f5e63,_0x39e180){return function(_0x5d8c5a){if(!_0x5d8c5a){_0x1f5e63['sendStatus'](0x194);}return _0x5d8c5a;};}function handleError(_0x300d1c,_0x3e6d54){_0x3e6d54=_0x3e6d54||0x1f4;return function(_0x1c6418){logger[_0x6ce1('0x23')](_0x1c6418[_0x6ce1('0x24')]);if(_0x1c6418[_0x6ce1('0x25')]){delete _0x1c6418[_0x6ce1('0x25')];}_0x300d1c[_0x6ce1('0x17')](_0x3e6d54)[_0x6ce1('0x26')](_0x1c6418);};}exports[_0x6ce1('0x27')]=function(_0x58c7a1,_0x5c6cfa){var _0x20a57e={},_0x57c013={},_0x5c89d8={'count':0x0,'rows':[]};var _0x469e22=_[_0x6ce1('0x28')](db[_0x6ce1('0x29')][_0x6ce1('0x2a')],function(_0x4bfa44){return{'name':_0x4bfa44[_0x6ce1('0x2b')],'type':_0x4bfa44[_0x6ce1('0x2c')][_0x6ce1('0x2d')]};});_0x57c013[_0x6ce1('0x2e')]=_[_0x6ce1('0x28')](_0x469e22,'name');_0x57c013[_0x6ce1('0x2f')]=_[_0x6ce1('0x30')](_0x58c7a1['query']);_0x57c013[_0x6ce1('0x31')]=_[_0x6ce1('0x32')](_0x57c013[_0x6ce1('0x2e')],_0x57c013[_0x6ce1('0x2f')]);_0x20a57e[_0x6ce1('0x33')]=_[_0x6ce1('0x32')](_0x57c013[_0x6ce1('0x2e')],qs[_0x6ce1('0x34')](_0x58c7a1[_0x6ce1('0x2f')][_0x6ce1('0x34')]));_0x20a57e['attributes']=_0x20a57e['attributes']['length']?_0x20a57e[_0x6ce1('0x33')]:_0x57c013[_0x6ce1('0x2e')];if(!_0x58c7a1[_0x6ce1('0x2f')][_0x6ce1('0x35')]('nolimit')){_0x20a57e[_0x6ce1('0x1c')]=qs[_0x6ce1('0x1c')](_0x58c7a1['query'][_0x6ce1('0x1c')]);_0x20a57e[_0x6ce1('0x1a')]=qs[_0x6ce1('0x1a')](_0x58c7a1[_0x6ce1('0x2f')]['offset']);}_0x20a57e[_0x6ce1('0x36')]=qs[_0x6ce1('0x37')](_0x58c7a1['query'][_0x6ce1('0x37')]);_0x20a57e[_0x6ce1('0x38')]=qs[_0x6ce1('0x31')](_['pick'](_0x58c7a1[_0x6ce1('0x2f')],_0x57c013[_0x6ce1('0x31')]),_0x469e22);if(_0x58c7a1[_0x6ce1('0x2f')][_0x6ce1('0x39')]){_0x20a57e[_0x6ce1('0x38')]=_[_0x6ce1('0x3a')](_0x20a57e[_0x6ce1('0x38')],{'$or':_['map'](_0x469e22,function(_0x5a15d6){if(_0x5a15d6[_0x6ce1('0x2c')]!==_0x6ce1('0x3b')){var _0x3a6450={};_0x3a6450[_0x5a15d6[_0x6ce1('0x25')]]={'$like':'%'+_0x58c7a1[_0x6ce1('0x2f')][_0x6ce1('0x39')]+'%'};return _0x3a6450;}})});}_0x20a57e=_[_0x6ce1('0x3a')]({},_0x20a57e,_0x58c7a1[_0x6ce1('0x3c')]);var _0x3d6a77={'where':_0x20a57e['where']};return db['VoiceTransferReport']['count'](_0x3d6a77)[_0x6ce1('0x21')](function(_0x39accb){_0x5c89d8['count']=_0x39accb;if(_0x58c7a1['query'][_0x6ce1('0x3d')]){_0x20a57e[_0x6ce1('0x3e')]=[{'all':!![]}];}return db[_0x6ce1('0x29')][_0x6ce1('0x3f')](_0x20a57e);})[_0x6ce1('0x21')](function(_0x55d0d7){_0x5c89d8[_0x6ce1('0x40')]=_0x55d0d7;return _0x5c89d8;})[_0x6ce1('0x21')](respondWithFilteredResult(_0x5c6cfa,_0x20a57e))[_0x6ce1('0x41')](handleError(_0x5c6cfa,null));};exports[_0x6ce1('0x42')]=function(_0x279cbc,_0x1317e0){var _0x4b1531={'raw':!![],'where':{'id':_0x279cbc['params']['id']}},_0x2e1a12={};_0x2e1a12[_0x6ce1('0x2e')]=_[_0x6ce1('0x30')](db[_0x6ce1('0x29')][_0x6ce1('0x2a')]);_0x2e1a12['query']=_[_0x6ce1('0x30')](_0x279cbc[_0x6ce1('0x2f')]);_0x2e1a12[_0x6ce1('0x31')]=_['intersection'](_0x2e1a12[_0x6ce1('0x2e')],_0x2e1a12[_0x6ce1('0x2f')]);_0x4b1531[_0x6ce1('0x33')]=_['intersection'](_0x2e1a12[_0x6ce1('0x2e')],qs[_0x6ce1('0x34')](_0x279cbc[_0x6ce1('0x2f')][_0x6ce1('0x34')]));_0x4b1531['attributes']=_0x4b1531[_0x6ce1('0x33')][_0x6ce1('0x43')]?_0x4b1531['attributes']:_0x2e1a12[_0x6ce1('0x2e')];if(_0x279cbc[_0x6ce1('0x2f')][_0x6ce1('0x3d')]){_0x4b1531[_0x6ce1('0x3e')]=[{'all':!![]}];}_0x4b1531=_[_0x6ce1('0x3a')]({},_0x4b1531,_0x279cbc[_0x6ce1('0x3c')]);return db[_0x6ce1('0x29')][_0x6ce1('0x44')](_0x4b1531)[_0x6ce1('0x21')](handleEntityNotFound(_0x1317e0,null))[_0x6ce1('0x21')](respondWithResult(_0x1317e0,null))[_0x6ce1('0x41')](handleError(_0x1317e0,null));};exports[_0x6ce1('0x45')]=function(_0x4db349,_0xafbc04){return db[_0x6ce1('0x29')][_0x6ce1('0x45')](_0x4db349[_0x6ce1('0x46')],{})[_0x6ce1('0x21')](respondWithResult(_0xafbc04,0xc9))[_0x6ce1('0x41')](handleError(_0xafbc04,null));};exports[_0x6ce1('0x47')]=function(_0x4da607,_0x576c86){if(_0x4da607[_0x6ce1('0x46')]['id']){delete _0x4da607['body']['id'];}return db[_0x6ce1('0x29')]['find']({'where':{'id':_0x4da607['params']['id']}})[_0x6ce1('0x21')](handleEntityNotFound(_0x576c86,null))['then'](saveUpdates(_0x4da607[_0x6ce1('0x46')],null))[_0x6ce1('0x21')](respondWithResult(_0x576c86,null))['catch'](handleError(_0x576c86,null));};exports['destroy']=function(_0x125863,_0x2dc5c3){return db[_0x6ce1('0x29')][_0x6ce1('0x44')]({'where':{'id':_0x125863[_0x6ce1('0x48')]['id']}})['then'](handleEntityNotFound(_0x2dc5c3,null))[_0x6ce1('0x21')](removeEntity(_0x2dc5c3,null))[_0x6ce1('0x41')](handleError(_0x2dc5c3,null));};exports[_0x6ce1('0x49')]=function(_0x5c6da1,_0x32f435){return db[_0x6ce1('0x29')][_0x6ce1('0x49')]()[_0x6ce1('0x21')](respondWithResult(_0x32f435,null))[_0x6ce1('0x41')](handleError(_0x32f435,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index b9e16c2..d94735d 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 _0xae3f=['define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api','bluebird','request-promise','path','exports'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xae3f,0x1ed));var _0xfae3=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xae3f[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0xfae3('0x0'));var logger=require(_0xfae3('0x1'))(_0xfae3('0x2'));var moment=require('moment');var BPromise=require(_0xfae3('0x3'));var rp=require(_0xfae3('0x4'));var fs=require('fs');var path=require(_0xfae3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0xfae3('0x6')]=function(_0x3a4ada,_0x281248){return _0x3a4ada[_0xfae3('0x7')](_0xfae3('0x8'),attributes,{'tableName':_0xfae3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1c6=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_call_transfer','lodash','util'];(function(_0x112594,_0x4a99f1){var _0x5d89c8=function(_0x1ee87d){while(--_0x1ee87d){_0x112594['push'](_0x112594['shift']());}};_0x5d89c8(++_0x4a99f1);}(_0xf1c6,0x129));var _0x6f1c=function(_0x4ba50d,_0x1be43c){_0x4ba50d=_0x4ba50d-0x0;var _0x290aae=_0xf1c6[_0x4ba50d];return _0x290aae;};'use strict';var _=require(_0x6f1c('0x0'));var util=require(_0x6f1c('0x1'));var logger=require(_0x6f1c('0x2'))(_0x6f1c('0x3'));var moment=require(_0x6f1c('0x4'));var BPromise=require(_0x6f1c('0x5'));var rp=require(_0x6f1c('0x6'));var fs=require('fs');var path=require(_0x6f1c('0x7'));var rimraf=require(_0x6f1c('0x8'));var config=require(_0x6f1c('0x9'));var attributes=require('./voiceTransferReport.attributes');module[_0x6f1c('0xa')]=function(_0x45af04,_0x3e3b14){return _0x45af04[_0x6f1c('0xb')]('VoiceTransferReport',attributes,{'tableName':_0x6f1c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 7dc3aa7..d660025 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 _0xb780=['VoiceTransferReport,\x20%s,\x20%s','message','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','info','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x32e94b,_0x38c7a7){var _0x3b1567=function(_0x282670){while(--_0x282670){_0x32e94b['push'](_0x32e94b['shift']());}};_0x3b1567(++_0x38c7a7);}(_0xb780,0x1a8));var _0x0b78=function(_0x36107f,_0x354b5a){_0x36107f=_0x36107f-0x0;var _0x4a2900=_0xb780[_0x36107f];return _0x4a2900;};'use strict';var _=require(_0x0b78('0x0'));var util=require(_0x0b78('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b78('0x2'));var db=require(_0x0b78('0x3'))['db'];var utils=require(_0x0b78('0x4'));var logger=require(_0x0b78('0x5'))(_0x0b78('0x6'));var config=require(_0x0b78('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0b78('0x8')][_0x0b78('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x552bd0,_0x4ec611,_0x43eb93){return new BPromise(function(_0x18e6d7,_0x33fe3c){return client[_0x0b78('0xa')](_0x552bd0,_0x43eb93)[_0x0b78('0xb')](function(_0x5d7cc5){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x4ec611,'request\x20sent');logger[_0x0b78('0xc')](_0x0b78('0xd'),_0x4ec611,_0x0b78('0xe'),JSON[_0x0b78('0xf')](_0x5d7cc5));if(_0x5d7cc5[_0x0b78('0x10')]){if(_0x5d7cc5[_0x0b78('0x10')][_0x0b78('0x11')]===0x1f4){logger[_0x0b78('0x10')](_0x0b78('0x12'),_0x4ec611,_0x5d7cc5[_0x0b78('0x10')][_0x0b78('0x13')]);return _0x33fe3c(_0x5d7cc5[_0x0b78('0x10')][_0x0b78('0x13')]);}logger['error'](_0x0b78('0x12'),_0x4ec611,_0x5d7cc5['error']['message']);return _0x18e6d7(_0x5d7cc5['error'][_0x0b78('0x13')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x4ec611,_0x0b78('0xe'));_0x18e6d7(_0x5d7cc5['result'][_0x0b78('0x13')]);}})[_0x0b78('0x14')](function(_0x59c441){logger[_0x0b78('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x4ec611,_0x59c441);_0x33fe3c(_0x59c441);});});}exports[_0x0b78('0x15')]=function(_0x3e535a){var _0x1b998b=this;return new Promise(function(_0x175333,_0x1d44dc){return db[_0x0b78('0x16')]['create'](_0x3e535a[_0x0b78('0x17')],{'raw':_0x3e535a['options']?_0x3e535a[_0x0b78('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x0b78('0xb')](function(_0xab99e0){logger[_0x0b78('0x19')](_0x0b78('0x15'),_0x3e535a);logger[_0x0b78('0xc')]('CreateVoiceTransferReport',_0x3e535a,JSON['stringify'](_0xab99e0));_0x175333(_0xab99e0);})[_0x0b78('0x14')](function(_0x305863){logger['error']('CreateVoiceTransferReport',_0x305863[_0x0b78('0x13')],_0x3e535a);_0x1d44dc(_0x1b998b[_0x0b78('0x10')](0x1f4,_0x305863[_0x0b78('0x13')]));});});}; \ No newline at end of file +var _0x5e10=['../../config/environment','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','raw','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x310990,_0x245984){var _0x648534=function(_0xd320e5){while(--_0xd320e5){_0x310990['push'](_0x310990['shift']());}};_0x648534(++_0x245984);}(_0x5e10,0x1da));var _0x05e1=function(_0x491cbe,_0x45c8ba){_0x491cbe=_0x491cbe-0x0;var _0x59449d=_0x5e10[_0x491cbe];return _0x59449d;};'use strict';var _=require(_0x05e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x05e1('0x1'));var fs=require('fs');var Redis=require(_0x05e1('0x2'));var db=require(_0x05e1('0x3'))['db'];var utils=require(_0x05e1('0x4'));var logger=require('../../config/logger')(_0x05e1('0x5'));var config=require(_0x05e1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x05e1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd1537a,_0xb38ccb,_0x2105a9){return new BPromise(function(_0x323bea,_0x32dd13){return client[_0x05e1('0x8')](_0xd1537a,_0x2105a9)[_0x05e1('0x9')](function(_0x5c7efc){logger[_0x05e1('0xa')](_0x05e1('0xb'),_0xb38ccb,_0x05e1('0xc'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0xb38ccb,_0x05e1('0xc'),JSON[_0x05e1('0xd')](_0x5c7efc));if(_0x5c7efc['error']){if(_0x5c7efc[_0x05e1('0xe')]['code']===0x1f4){logger[_0x05e1('0xe')](_0x05e1('0xb'),_0xb38ccb,_0x5c7efc[_0x05e1('0xe')][_0x05e1('0xf')]);return _0x32dd13(_0x5c7efc[_0x05e1('0xe')]['message']);}logger[_0x05e1('0xe')](_0x05e1('0xb'),_0xb38ccb,_0x5c7efc[_0x05e1('0xe')][_0x05e1('0xf')]);return _0x323bea(_0x5c7efc[_0x05e1('0xe')][_0x05e1('0xf')]);}else{logger['info'](_0x05e1('0xb'),_0xb38ccb,'request\x20sent');_0x323bea(_0x5c7efc[_0x05e1('0x10')][_0x05e1('0xf')]);}})[_0x05e1('0x11')](function(_0x17a221){logger[_0x05e1('0xe')](_0x05e1('0xb'),_0xb38ccb,_0x17a221);_0x32dd13(_0x17a221);});});}exports[_0x05e1('0x12')]=function(_0x4d4928){var _0x4d2635=this;return new Promise(function(_0x50923d,_0x199078){return db[_0x05e1('0x13')][_0x05e1('0x14')](_0x4d4928[_0x05e1('0x15')],{'raw':_0x4d4928['options']?_0x4d4928['options'][_0x05e1('0x16')]===undefined?!![]:![]:!![]})[_0x05e1('0x9')](function(_0x18987f){logger[_0x05e1('0xa')](_0x05e1('0x12'),_0x4d4928);logger[_0x05e1('0x17')](_0x05e1('0x12'),_0x4d4928,JSON[_0x05e1('0xd')](_0x18987f));_0x50923d(_0x18987f);})[_0x05e1('0x11')](function(_0xde46b3){logger[_0x05e1('0xe')](_0x05e1('0x12'),_0xde46b3[_0x05e1('0xf')],_0x4d4928);_0x199078(_0x4d2635[_0x05e1('0xe')](0x1f4,_0xde46b3[_0x05e1('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index ee584c5..1200b7c 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 _0xb4e6=['unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/hold','hold','/unhold'];(function(_0x47d393,_0x4833d8){var _0x420486=function(_0x470d66){while(--_0x470d66){_0x47d393['push'](_0x47d393['shift']());}};_0x420486(++_0x4833d8);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x4d8a8f,_0x2afd4c){_0x4d8a8f=_0x4d8a8f-0x0;var _0xfc4adc=_0xb4e6[_0x4d8a8f];return _0xfc4adc;};'use strict';var express=require(_0x6b4e('0x0'));var router=express['Router']();var auth=require(_0x6b4e('0x1'));var controller=require(_0x6b4e('0x2'));router[_0x6b4e('0x3')](_0x6b4e('0x4'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0x7')]);router['post'](_0x6b4e('0x8'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['hangup']);router[_0x6b4e('0x3')]('/answer',auth['isAuthenticated'](),auth[_0x6b4e('0x6')](),controller['answer']);router['post'](_0x6b4e('0x9'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xa')]);router[_0x6b4e('0x3')](_0x6b4e('0xb'),auth[_0x6b4e('0x5')](),auth['isWebrtcLicence'](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0x3')]('/calls',auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xd')]);router[_0x6b4e('0x3')](_0x6b4e('0xe'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['transfer']);module[_0x6b4e('0xf')]=router; \ No newline at end of file +var _0x9c44=['/answer','answer','/hold','/unhold','unhold','/transfer','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup'];(function(_0x4314d7,_0x355218){var _0x5c599b=function(_0x556354){while(--_0x556354){_0x4314d7['push'](_0x4314d7['shift']());}};_0x5c599b(++_0x355218);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x49c4('0x0'));var controller=require(_0x49c4('0x1'));router[_0x49c4('0x2')](_0x49c4('0x3'),auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['originate']);router['post'](_0x49c4('0x6'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0x7')]);router[_0x49c4('0x2')](_0x49c4('0x8'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller[_0x49c4('0x9')]);router[_0x49c4('0x2')](_0x49c4('0xa'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0x49c4('0x2')](_0x49c4('0xb'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xc')]);router['post']('/calls',auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['calls']);router[_0x49c4('0x2')](_0x49c4('0xd'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 9cf59fd..c0d07f0 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 _0x87ae=['sessionId','length','sessionId\x20','\x20not\x20found!','body','json','userId','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','user:%s','webbar:hangup','hangup\x20executed!','answer\x20executed!','catch','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','all','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','../../mysqldb','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','localhost','validate','userId\x20is\x20required','string','number','transferNumber\x20is\x20required','info','stringify','handleError:','error','stack','name','send','status','NotFound','request','then','result','User','findOne','agent','filter','UserId'];(function(_0x35fd05,_0x1c8af7){var _0x103cf6=function(_0x364ae1){while(--_0x364ae1){_0x35fd05['push'](_0x35fd05['shift']());}};_0x103cf6(++_0x1c8af7);}(_0x87ae,0xf5));var _0xe87a=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0x87ae[_0xf48cce];return _0x2a5c38;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0xe87a('0x0'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0xe87a('0x1'));var jayson=require(_0xe87a('0x2'));var amiClient=jayson[_0xe87a('0x3')]['http']({'port':0x232a});var logger=require(_0xe87a('0x4'))(_0xe87a('0x5'));var Redis=require(_0xe87a('0x6'));config['redis']=_['defaults'](config[_0xe87a('0x7')],{'host':_0xe87a('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe87a('0x7')]));var Schema=require(_0xe87a('0x9'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe87a('0xa')]},'callNumber':{'type':_0xe87a('0xb'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xe87a('0xb')},'callbackUrl':{'type':_0xe87a('0xb')}});var hangupValidation=new Schema({'userId':{'type':_0xe87a('0xc'),'required':[!![],_0xe87a('0xa')]},'sessionId':{'type':_0xe87a('0xb'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe87a('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xe87a('0xc'),'required':[!![],_0xe87a('0xa')]},'sessionId':{'type':_0xe87a('0xb'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xe87a('0xb'),'required':[!![],_0xe87a('0xd')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe87a('0xa')]},'sessionId':{'type':_0xe87a('0xb'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe87a('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xe87a('0xc'),'required':[!![],_0xe87a('0xa')]}});function emit(_0xd2ca53,_0x175626,_0x4d66ce){logger[_0xe87a('0xe')](_0xd2ca53,_0x175626,JSON[_0xe87a('0xf')](_0x4d66ce));io['to'](_0xd2ca53)['emit'](_0x175626,_0x4d66ce);}function handleError(_0x5f31e3){return function(_0x4160e2){console['log'](_0xe87a('0x10'),_0x4160e2,_0x4160e2 instanceof RangeError);logger[_0xe87a('0x11')](_0x4160e2[_0xe87a('0x12')]);if(_0x4160e2 instanceof RangeError){if(_0x4160e2['name']){delete _0x4160e2[_0xe87a('0x13')];}_0x5f31e3['status'](0x194)[_0xe87a('0x14')](_0x4160e2);}else{if(_0x4160e2[_0xe87a('0x13')]){delete _0x4160e2[_0xe87a('0x13')];}_0x5f31e3[_0xe87a('0x15')](0x1f4)[_0xe87a('0x14')](_0x4160e2);}};}function checkError(){return function(_0x5be8f6){if(!_0x5be8f6){throw new RangeError(_0xe87a('0x16'));}return _0x5be8f6;};}function respondWithRpcPromise(_0x46e943,_0x5dd73f){return new BPromise(function(_0x59c17c,_0x42ba03){var _0x363c6a=amiClient;return _0x363c6a[_0xe87a('0x17')](_0x46e943,_0x5dd73f)[_0xe87a('0x18')](function(_0x15ced2){if(_0x15ced2[_0xe87a('0x11')]){if(_0x15ced2['error']['code']===0x1f4){return _0x42ba03(_0x15ced2['error']['message']);}return _0x59c17c(_0x15ced2[_0xe87a('0x11')]['message']);}else{_0x59c17c(_0x15ced2[_0xe87a('0x19')]);}})['catch'](function(_0x19f21e){_0x42ba03(_0x19f21e);});});}function getAgent(_0xfb831e){return db[_0xe87a('0x1a')][_0xe87a('0x1b')]({'where':{'id':_0xfb831e,'role':_0xe87a('0x1c')}})[_0xe87a('0x18')](checkError());}function getAgentCheckSession(_0x4fe080,_0x3fc24e){return new BPromise(function(_0x5b984f,_0x58f10a){var _0x39ec27=respondWithRpcPromise('VoiceChannels');var _0x537b52=getAgent(_0x4fe080);Promise['all']([_0x39ec27,_0x537b52])[_0xe87a('0x18')](function(_0x6feaf6){var _0x36d4cc=_0x6feaf6[0x0];var _0x4eae3f=_0x6feaf6[0x1];var _0x565d01=_[_0xe87a('0x1d')](_0x36d4cc['rows'],function(_0x4f61f7){return _0x4f61f7[_0xe87a('0x1e')]==_0x4eae3f['id']&&_0x4f61f7[_0xe87a('0x1f')]==_0x3fc24e;});if(_0x565d01[_0xe87a('0x20')]==0x1){_0x5b984f(_0x4eae3f);}else{_0x58f10a(new RangeError(_0xe87a('0x21')+_0x3fc24e+_0xe87a('0x22')));}});});}exports['originate']=function(_0x218510,_0x4b80df){logger[_0xe87a('0xe')]('originate\x20fired:',_0x218510[_0xe87a('0x23')]);var _0x238141=originateValidation[_0xe87a('0x9')](_0x218510[_0xe87a('0x23')]);if(_0x238141[_0xe87a('0x20')]>0x0){return _0x4b80df[_0xe87a('0x15')](0x190)[_0xe87a('0x24')](_0x238141);}var _0x19825f=_0x218510[_0xe87a('0x23')][_0xe87a('0x25')];var _0x4d4824=_0x218510['body']['callNumber'];var _0x2b07fe=_0x218510['body'][_0xe87a('0x26')];var _0x919558=_0x218510['body'][_0xe87a('0x27')];return getAgent(_0x19825f)['then'](function(_0x53a351){logger[_0xe87a('0xe')](_0xe87a('0x28'),_0x53a351[_0xe87a('0x13')]);emit(util[_0xe87a('0x29')]('user:%s',_0x53a351[_0xe87a('0x13')]),_0xe87a('0x2a'),{'callNumber':_0x4d4824,'callerId':_0x2b07fe,'callbackUrl':_0x919558});return _0x4b80df['status'](0xc8)[_0xe87a('0x24')]({'error':![],'message':_0xe87a('0x2b')});})['catch'](handleError(_0x4b80df));};exports[_0xe87a('0x2c')]=function(_0x211e37,_0x436eb0){logger[_0xe87a('0xe')](_0xe87a('0x2d'),_0x211e37['body']);var _0x27909a=hangupValidation['validate'](_0x211e37[_0xe87a('0x23')]);if(_0x27909a['length']>0x0){return _0x436eb0['status'](0x190)[_0xe87a('0x24')](_0x27909a);}var _0x31963a=_0x211e37[_0xe87a('0x23')][_0xe87a('0x25')];var _0x374153=_0x211e37[_0xe87a('0x23')][_0xe87a('0x1f')];return getAgent(_0x31963a)[_0xe87a('0x18')](function(_0xda1ce1){logger[_0xe87a('0xe')](_0xe87a('0x28'),_0xda1ce1[_0xe87a('0x13')]);emit(util[_0xe87a('0x29')](_0xe87a('0x2e'),_0xda1ce1['name']),_0xe87a('0x2f'),{'sessionId':_0x374153});return _0x436eb0[_0xe87a('0x15')](0xc8)[_0xe87a('0x24')]({'error':![],'message':_0xe87a('0x30')});})['catch'](handleError(_0x436eb0));};exports['answer']=function(_0x4f92e0,_0x196d1b){logger['info']('answer\x20fired:',_0x4f92e0[_0xe87a('0x23')]);var _0x5eb62e=answerValidation['validate'](_0x4f92e0[_0xe87a('0x23')]);if(_0x5eb62e[_0xe87a('0x20')]>0x0){return _0x196d1b['status'](0x190)[_0xe87a('0x24')](_0x5eb62e);}var _0x4e8f4c=_0x4f92e0['body']['userId'];var _0x3aba9c=_0x4f92e0[_0xe87a('0x23')]['sessionId'];return getAgent(_0x4e8f4c)[_0xe87a('0x18')](function(_0x4684d0){logger[_0xe87a('0xe')]('entityFound:',_0x4684d0['name']);emit(util['format']('user:%s',_0x4684d0[_0xe87a('0x13')]),'webbar:answer',{'sessionId':_0x3aba9c});return _0x196d1b[_0xe87a('0x15')](0xc8)[_0xe87a('0x24')]({'error':![],'message':_0xe87a('0x31')});})[_0xe87a('0x32')](handleError(_0x196d1b));};exports['hold']=function(_0x3920cf,_0x3e12b1){logger['info'](_0xe87a('0x33'),_0x3920cf[_0xe87a('0x23')]);var _0x40bf40=holdValidation[_0xe87a('0x9')](_0x3920cf[_0xe87a('0x23')]);if(_0x40bf40[_0xe87a('0x20')]>0x0){return _0x3e12b1[_0xe87a('0x15')](0x190)[_0xe87a('0x24')](_0x40bf40);}var _0x2aa508=_0x3920cf['body'][_0xe87a('0x25')];var _0x13a590=_0x3920cf[_0xe87a('0x23')][_0xe87a('0x1f')];return getAgent(_0x2aa508)['then'](function(_0x6ddec4){logger[_0xe87a('0xe')](_0xe87a('0x28'),_0x6ddec4[_0xe87a('0x13')]);emit(util[_0xe87a('0x29')](_0xe87a('0x2e'),_0x6ddec4[_0xe87a('0x13')]),_0xe87a('0x34'),{'sessionId':_0x13a590});return _0x3e12b1['status'](0xc8)[_0xe87a('0x24')]({'error':![],'message':_0xe87a('0x35')});})[_0xe87a('0x32')](handleError(_0x3e12b1));};exports['unhold']=function(_0x19d380,_0xc43c4a){logger[_0xe87a('0xe')](_0xe87a('0x36'),_0x19d380[_0xe87a('0x23')]);var _0x25418e=unholdValidation[_0xe87a('0x9')](_0x19d380[_0xe87a('0x23')]);if(_0x25418e[_0xe87a('0x20')]>0x0){return _0xc43c4a[_0xe87a('0x15')](0x190)[_0xe87a('0x24')](_0x25418e);}var _0x1f4272=_0x19d380['body'][_0xe87a('0x25')];var _0x9c063a=_0x19d380[_0xe87a('0x23')][_0xe87a('0x1f')];return getAgent(_0x1f4272)[_0xe87a('0x18')](function(_0x1f0d67){logger[_0xe87a('0xe')](_0xe87a('0x28'),_0x1f0d67[_0xe87a('0x13')]);emit(util['format']('user:%s',_0x1f0d67[_0xe87a('0x13')]),_0xe87a('0x37'),{'sessionId':_0x9c063a});return _0xc43c4a['status'](0xc8)[_0xe87a('0x24')]({'error':![],'message':_0xe87a('0x38')});})['catch'](handleError(_0xc43c4a));};exports[_0xe87a('0x39')]=function(_0x429955,_0x4d86f2){logger[_0xe87a('0xe')](_0xe87a('0x3a'),_0x4d86f2[_0xe87a('0x23')]);var _0xe84a3a=callsValidation['validate'](_0x429955['body']);if(_0xe84a3a[_0xe87a('0x20')]>0x0){return _0x4d86f2[_0xe87a('0x15')](0x190)['json'](_0xe84a3a);}var _0x2cc13d=_0x429955['body'][_0xe87a('0x25')];var _0x491199=respondWithRpcPromise(_0xe87a('0x3b'));var _0x5aec5e=getAgent(_0x2cc13d);return Promise[_0xe87a('0x3c')]([_0x491199,_0x5aec5e])['then'](function(_0x1d0f89){var _0x27910e=_0x1d0f89[0x0];var _0x45cb80=_0x1d0f89[0x1];var _0x1dc705=_[_0xe87a('0x1d')](_0x27910e[_0xe87a('0x3d')],function(_0x25c361){return _0x25c361[_0xe87a('0x1e')]==_0x45cb80['id'];});return _0x4d86f2[_0xe87a('0x15')](0xc8)[_0xe87a('0x24')]({'count':_0x1dc705[_0xe87a('0x20')],'rows':_0x1dc705});})['catch'](handleError(_0x4d86f2));};exports[_0xe87a('0x3e')]=function(_0xf14c4f,_0x2fdd5e){logger[_0xe87a('0xe')](_0xe87a('0x3f'),_0xf14c4f[_0xe87a('0x23')]);var _0x3efe6c=conferenceValidation[_0xe87a('0x9')](_0xf14c4f[_0xe87a('0x23')]);if(_0x3efe6c[_0xe87a('0x20')]>0x0){return _0x2fdd5e[_0xe87a('0x15')](0x190)[_0xe87a('0x24')](_0x3efe6c);}var _0x1c4f16=_0xf14c4f[_0xe87a('0x23')][_0xe87a('0x25')];return getAgent(_0x1c4f16)[_0xe87a('0x18')](function(_0x4d7f67){logger[_0xe87a('0xe')]('entityFound:',_0x4d7f67[_0xe87a('0x13')]);emit(util['format'](_0xe87a('0x2e'),_0x4d7f67['name']),_0xe87a('0x40'));return _0x2fdd5e[_0xe87a('0x15')](0xc8)[_0xe87a('0x24')]({'error':![],'message':_0xe87a('0x41')});})['catch'](handleError(_0x2fdd5e));};exports[_0xe87a('0x42')]=function(_0x18779,_0x30fb49){logger[_0xe87a('0xe')](_0xe87a('0x43'),_0x18779['body']);var _0x2dc0db=transferValidation[_0xe87a('0x9')](_0x18779[_0xe87a('0x23')]);if(_0x2dc0db[_0xe87a('0x20')]>0x0){return _0x30fb49[_0xe87a('0x15')](0x190)['json'](_0x2dc0db);}var _0x333ad9=_0x18779[_0xe87a('0x23')][_0xe87a('0x25')];var _0x1fe45e=_0x18779[_0xe87a('0x23')][_0xe87a('0x1f')];var _0x25bcd1=_0x18779[_0xe87a('0x23')]['transferNumber'];return getAgent(_0x333ad9)[_0xe87a('0x18')](function(_0x825cc7){logger['info'](_0xe87a('0x28'),_0x825cc7[_0xe87a('0x13')]);emit(util['format']('user:%s',_0x825cc7[_0xe87a('0x13')]),_0xe87a('0x44'),{'sessionId':_0x1fe45e,'transferNumber':_0x25bcd1});return _0x30fb49[_0xe87a('0x15')](0xc8)[_0xe87a('0x24')]({'error':![],'message':'transfer\x20executed!'});})[_0xe87a('0x32')](handleError(_0x30fb49));}; \ No newline at end of file +var _0x3a25=['originate','originate\x20fired:','body','userId','callNumber','callerId','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','json','format','webbar:hangup','catch','answer','answer\x20fired:','entityFound:','hold','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','log','handleError:','error','stack','status','send','name','request','then','code','message','result','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!'];(function(_0x4739f7,_0x5a2a53){var _0x25651a=function(_0x1df80e){while(--_0x1df80e){_0x4739f7['push'](_0x4739f7['shift']());}};_0x25651a(++_0x5a2a53);}(_0x3a25,0x15d));var _0x53a2=function(_0x7a6b39,_0x573ab6){_0x7a6b39=_0x7a6b39-0x0;var _0xb8033=_0x3a25[_0x7a6b39];return _0xb8033;};'use strict';var path=require(_0x53a2('0x0'));var fs=require('fs');var _=require(_0x53a2('0x1'));var db=require(_0x53a2('0x2'))['db'];var config=require(_0x53a2('0x3'));var util=require(_0x53a2('0x4'));var BPromise=require(_0x53a2('0x5'));var jayson=require(_0x53a2('0x6'));var amiClient=jayson[_0x53a2('0x7')][_0x53a2('0x8')]({'port':0x232a});var logger=require(_0x53a2('0x9'))(_0x53a2('0xa'));var Redis=require(_0x53a2('0xb'));config[_0x53a2('0xc')]=_[_0x53a2('0xd')](config[_0x53a2('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x53a2('0xe'))(new Redis(config['redis']));var Schema=require(_0x53a2('0xf'));var originateValidation=new Schema({'userId':{'type':_0x53a2('0x10'),'required':[!![],_0x53a2('0x11')]},'callNumber':{'type':_0x53a2('0x12'),'required':[!![],_0x53a2('0x13')]},'callerId':{'type':_0x53a2('0x12')},'callbackUrl':{'type':_0x53a2('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x53a2('0x10'),'required':[!![],_0x53a2('0x11')]},'sessionId':{'type':_0x53a2('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x53a2('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x53a2('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x53a2('0x12'),'required':[!![],_0x53a2('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0x53a2('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x53a2('0x11')]},'sessionId':{'type':_0x53a2('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x53a2('0x10'),'required':[!![],_0x53a2('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x53a2('0x11')]}});function emit(_0x3343d3,_0x4401b7,_0x42db86){logger[_0x53a2('0x15')](_0x3343d3,_0x4401b7,JSON['stringify'](_0x42db86));io['to'](_0x3343d3)['emit'](_0x4401b7,_0x42db86);}function handleError(_0xeff339){return function(_0x446b71){console[_0x53a2('0x16')](_0x53a2('0x17'),_0x446b71,_0x446b71 instanceof RangeError);logger[_0x53a2('0x18')](_0x446b71[_0x53a2('0x19')]);if(_0x446b71 instanceof RangeError){if(_0x446b71['name']){delete _0x446b71['name'];}_0xeff339[_0x53a2('0x1a')](0x194)[_0x53a2('0x1b')](_0x446b71);}else{if(_0x446b71['name']){delete _0x446b71[_0x53a2('0x1c')];}_0xeff339[_0x53a2('0x1a')](0x1f4)[_0x53a2('0x1b')](_0x446b71);}};}function checkError(){return function(_0x39e384){if(!_0x39e384){throw new RangeError('NotFound');}return _0x39e384;};}function respondWithRpcPromise(_0x32a804,_0x372f7e){return new BPromise(function(_0xd9693c,_0x2cda68){var _0x42df19=amiClient;return _0x42df19[_0x53a2('0x1d')](_0x32a804,_0x372f7e)[_0x53a2('0x1e')](function(_0x3a769d){if(_0x3a769d['error']){if(_0x3a769d['error'][_0x53a2('0x1f')]===0x1f4){return _0x2cda68(_0x3a769d[_0x53a2('0x18')][_0x53a2('0x20')]);}return _0xd9693c(_0x3a769d[_0x53a2('0x18')][_0x53a2('0x20')]);}else{_0xd9693c(_0x3a769d[_0x53a2('0x21')]);}})['catch'](function(_0x2dfa00){_0x2cda68(_0x2dfa00);});});}function getAgent(_0x5072b3){return db[_0x53a2('0x22')][_0x53a2('0x23')]({'where':{'id':_0x5072b3,'role':_0x53a2('0x24')}})[_0x53a2('0x1e')](checkError());}function getAgentCheckSession(_0x21325d,_0x41ae20){return new BPromise(function(_0x2f2062,_0x10e271){var _0x18d6df=respondWithRpcPromise(_0x53a2('0x25'));var _0x262eba=getAgent(_0x21325d);Promise[_0x53a2('0x26')]([_0x18d6df,_0x262eba])[_0x53a2('0x1e')](function(_0xf12019){var _0x437916=_0xf12019[0x0];var _0x5a84de=_0xf12019[0x1];var _0x14b24d=_[_0x53a2('0x27')](_0x437916[_0x53a2('0x28')],function(_0x23374b){return _0x23374b[_0x53a2('0x29')]==_0x5a84de['id']&&_0x23374b[_0x53a2('0x2a')]==_0x41ae20;});if(_0x14b24d[_0x53a2('0x2b')]==0x1){_0x2f2062(_0x5a84de);}else{_0x10e271(new RangeError(_0x53a2('0x2c')+_0x41ae20+_0x53a2('0x2d')));}});});}exports[_0x53a2('0x2e')]=function(_0x21d943,_0x4cb93b){logger[_0x53a2('0x15')](_0x53a2('0x2f'),_0x21d943[_0x53a2('0x30')]);var _0x1b16dc=originateValidation[_0x53a2('0xf')](_0x21d943[_0x53a2('0x30')]);if(_0x1b16dc[_0x53a2('0x2b')]>0x0){return _0x4cb93b[_0x53a2('0x1a')](0x190)['json'](_0x1b16dc);}var _0x5d32c4=_0x21d943[_0x53a2('0x30')][_0x53a2('0x31')];var _0x3c2d7e=_0x21d943['body'][_0x53a2('0x32')];var _0x283ba8=_0x21d943[_0x53a2('0x30')][_0x53a2('0x33')];var _0x218956=_0x21d943[_0x53a2('0x30')]['callbackUrl'];return getAgent(_0x5d32c4)[_0x53a2('0x1e')](function(_0x14f236){logger[_0x53a2('0x15')]('entityFound:',_0x14f236[_0x53a2('0x1c')]);emit(util['format'](_0x53a2('0x34'),_0x14f236[_0x53a2('0x1c')]),_0x53a2('0x35'),{'callNumber':_0x3c2d7e,'callerId':_0x283ba8,'callbackUrl':_0x218956});return _0x4cb93b['status'](0xc8)['json']({'error':![],'message':_0x53a2('0x36')});})['catch'](handleError(_0x4cb93b));};exports[_0x53a2('0x37')]=function(_0x397cfb,_0x18d5d6){logger[_0x53a2('0x15')](_0x53a2('0x38'),_0x397cfb[_0x53a2('0x30')]);var _0x4f7792=hangupValidation[_0x53a2('0xf')](_0x397cfb[_0x53a2('0x30')]);if(_0x4f7792['length']>0x0){return _0x18d5d6['status'](0x190)[_0x53a2('0x39')](_0x4f7792);}var _0x480f35=_0x397cfb[_0x53a2('0x30')][_0x53a2('0x31')];var _0x594961=_0x397cfb[_0x53a2('0x30')][_0x53a2('0x2a')];return getAgent(_0x480f35)[_0x53a2('0x1e')](function(_0x1aa50d){logger[_0x53a2('0x15')]('entityFound:',_0x1aa50d[_0x53a2('0x1c')]);emit(util[_0x53a2('0x3a')]('user:%s',_0x1aa50d[_0x53a2('0x1c')]),_0x53a2('0x3b'),{'sessionId':_0x594961});return _0x18d5d6['status'](0xc8)[_0x53a2('0x39')]({'error':![],'message':'hangup\x20executed!'});})[_0x53a2('0x3c')](handleError(_0x18d5d6));};exports[_0x53a2('0x3d')]=function(_0x41689b,_0x15b50b){logger[_0x53a2('0x15')](_0x53a2('0x3e'),_0x41689b['body']);var _0x71a339=answerValidation[_0x53a2('0xf')](_0x41689b[_0x53a2('0x30')]);if(_0x71a339[_0x53a2('0x2b')]>0x0){return _0x15b50b[_0x53a2('0x1a')](0x190)[_0x53a2('0x39')](_0x71a339);}var _0x3790c1=_0x41689b[_0x53a2('0x30')][_0x53a2('0x31')];var _0x1b5fbe=_0x41689b[_0x53a2('0x30')][_0x53a2('0x2a')];return getAgent(_0x3790c1)[_0x53a2('0x1e')](function(_0x1d1c82){logger[_0x53a2('0x15')](_0x53a2('0x3f'),_0x1d1c82['name']);emit(util[_0x53a2('0x3a')](_0x53a2('0x34'),_0x1d1c82['name']),'webbar:answer',{'sessionId':_0x1b5fbe});return _0x15b50b[_0x53a2('0x1a')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x53a2('0x3c')](handleError(_0x15b50b));};exports[_0x53a2('0x40')]=function(_0x37432a,_0x3001e2){logger['info']('hold\x20fired:',_0x37432a['body']);var _0x1984fe=holdValidation['validate'](_0x37432a['body']);if(_0x1984fe[_0x53a2('0x2b')]>0x0){return _0x3001e2[_0x53a2('0x1a')](0x190)[_0x53a2('0x39')](_0x1984fe);}var _0x32a6fd=_0x37432a[_0x53a2('0x30')]['userId'];var _0x26ad44=_0x37432a['body'][_0x53a2('0x2a')];return getAgent(_0x32a6fd)[_0x53a2('0x1e')](function(_0x5baa46){logger[_0x53a2('0x15')](_0x53a2('0x3f'),_0x5baa46[_0x53a2('0x1c')]);emit(util[_0x53a2('0x3a')](_0x53a2('0x34'),_0x5baa46[_0x53a2('0x1c')]),_0x53a2('0x41'),{'sessionId':_0x26ad44});return _0x3001e2['status'](0xc8)[_0x53a2('0x39')]({'error':![],'message':_0x53a2('0x42')});})[_0x53a2('0x3c')](handleError(_0x3001e2));};exports['unhold']=function(_0x36df41,_0x71dbbf){logger[_0x53a2('0x15')](_0x53a2('0x43'),_0x36df41[_0x53a2('0x30')]);var _0x567fce=unholdValidation['validate'](_0x36df41[_0x53a2('0x30')]);if(_0x567fce['length']>0x0){return _0x71dbbf[_0x53a2('0x1a')](0x190)[_0x53a2('0x39')](_0x567fce);}var _0x5314c3=_0x36df41['body'][_0x53a2('0x31')];var _0x382eba=_0x36df41[_0x53a2('0x30')]['sessionId'];return getAgent(_0x5314c3)['then'](function(_0x28cc39){logger[_0x53a2('0x15')](_0x53a2('0x3f'),_0x28cc39[_0x53a2('0x1c')]);emit(util[_0x53a2('0x3a')]('user:%s',_0x28cc39[_0x53a2('0x1c')]),_0x53a2('0x44'),{'sessionId':_0x382eba});return _0x71dbbf[_0x53a2('0x1a')](0xc8)[_0x53a2('0x39')]({'error':![],'message':_0x53a2('0x45')});})[_0x53a2('0x3c')](handleError(_0x71dbbf));};exports[_0x53a2('0x46')]=function(_0x52b7ac,_0x41f025){logger['info'](_0x53a2('0x47'),_0x41f025[_0x53a2('0x30')]);var _0x3b91eb=callsValidation[_0x53a2('0xf')](_0x52b7ac['body']);if(_0x3b91eb[_0x53a2('0x2b')]>0x0){return _0x41f025[_0x53a2('0x1a')](0x190)[_0x53a2('0x39')](_0x3b91eb);}var _0x2b6ab8=_0x52b7ac[_0x53a2('0x30')][_0x53a2('0x31')];var _0x53327b=respondWithRpcPromise(_0x53a2('0x25'));var _0x41a177=getAgent(_0x2b6ab8);return Promise[_0x53a2('0x26')]([_0x53327b,_0x41a177])[_0x53a2('0x1e')](function(_0x19518d){var _0x26c687=_0x19518d[0x0];var _0x22f40d=_0x19518d[0x1];var _0x50acc5=_[_0x53a2('0x27')](_0x26c687['rows'],function(_0x179812){return _0x179812[_0x53a2('0x29')]==_0x22f40d['id'];});return _0x41f025[_0x53a2('0x1a')](0xc8)['json']({'count':_0x50acc5[_0x53a2('0x2b')],'rows':_0x50acc5});})[_0x53a2('0x3c')](handleError(_0x41f025));};exports['conference']=function(_0x1be4ee,_0x4cb008){logger[_0x53a2('0x15')](_0x53a2('0x48'),_0x1be4ee[_0x53a2('0x30')]);var _0x2c1c94=conferenceValidation['validate'](_0x1be4ee[_0x53a2('0x30')]);if(_0x2c1c94[_0x53a2('0x2b')]>0x0){return _0x4cb008[_0x53a2('0x1a')](0x190)[_0x53a2('0x39')](_0x2c1c94);}var _0x3f0c29=_0x1be4ee[_0x53a2('0x30')][_0x53a2('0x31')];return getAgent(_0x3f0c29)[_0x53a2('0x1e')](function(_0x366fe4){logger[_0x53a2('0x15')]('entityFound:',_0x366fe4[_0x53a2('0x1c')]);emit(util['format']('user:%s',_0x366fe4[_0x53a2('0x1c')]),_0x53a2('0x49'));return _0x4cb008['status'](0xc8)['json']({'error':![],'message':_0x53a2('0x4a')});})[_0x53a2('0x3c')](handleError(_0x4cb008));};exports[_0x53a2('0x4b')]=function(_0x3e6374,_0x5b5309){logger[_0x53a2('0x15')]('transfer\x20fired:',_0x3e6374[_0x53a2('0x30')]);var _0x1dad4e=transferValidation[_0x53a2('0xf')](_0x3e6374['body']);if(_0x1dad4e[_0x53a2('0x2b')]>0x0){return _0x5b5309[_0x53a2('0x1a')](0x190)[_0x53a2('0x39')](_0x1dad4e);}var _0x1b186d=_0x3e6374[_0x53a2('0x30')][_0x53a2('0x31')];var _0x9405a2=_0x3e6374[_0x53a2('0x30')][_0x53a2('0x2a')];var _0x18b7c6=_0x3e6374[_0x53a2('0x30')][_0x53a2('0x4c')];return getAgent(_0x1b186d)[_0x53a2('0x1e')](function(_0x43f61a){logger[_0x53a2('0x15')](_0x53a2('0x3f'),_0x43f61a['name']);emit(util[_0x53a2('0x3a')]('user:%s',_0x43f61a[_0x53a2('0x1c')]),_0x53a2('0x4d'),{'sessionId':_0x9405a2,'transferNumber':_0x18b7c6});return _0x5b5309[_0x53a2('0x1a')](0xc8)[_0x53a2('0x39')]({'error':![],'message':_0x53a2('0x4e')});})[_0x53a2('0x3c')](handleError(_0x5b5309));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index e2ffcf2..2d68fda 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 _0x3330=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','/:id/canned_answers','/:id/users','post','create','addAnswer','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','put','update','/:id','removeDispositions','delete','removeAnswers','removeAgents','exports'];(function(_0x577384,_0x8a7d2d){var _0x45ed11=function(_0x33f006){while(--_0x33f006){_0x577384['push'](_0x577384['shift']());}};_0x45ed11(++_0x8a7d2d);}(_0x3330,0x132));var _0x0333=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x3330[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0333('0x0'));var util=require('util');var path=require(_0x0333('0x1'));var timeout=require('connect-timeout');var express=require(_0x0333('0x2'));var router=express[_0x0333('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0333('0x4'));var interaction=require(_0x0333('0x5'));var config=require(_0x0333('0x6'));var controller=require(_0x0333('0x7'));router[_0x0333('0x8')]('/',auth['isAuthenticated'](),controller[_0x0333('0x9')]);router[_0x0333('0x8')](_0x0333('0xa'),auth[_0x0333('0xb')](),controller[_0x0333('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0333('0xd')]);router[_0x0333('0x8')](_0x0333('0xe'),auth[_0x0333('0xb')](),controller['getDispositions']);router[_0x0333('0x8')](_0x0333('0xf'),auth[_0x0333('0xb')](),controller['getAnswers']);router[_0x0333('0x8')](_0x0333('0x10'),auth[_0x0333('0xb')](),controller['getAgents']);router[_0x0333('0x8')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x0333('0x11')]('/',auth[_0x0333('0xb')](),controller[_0x0333('0x12')]);router[_0x0333('0x11')](_0x0333('0xe'),auth[_0x0333('0xb')](),controller['addDisposition']);router['post'](_0x0333('0xf'),auth[_0x0333('0xb')](),controller[_0x0333('0x13')]);router[_0x0333('0x11')](_0x0333('0x10'),auth[_0x0333('0xb')](),controller[_0x0333('0x14')]);router[_0x0333('0x11')](_0x0333('0x15'),auth[_0x0333('0xb')](),controller[_0x0333('0x16')]);router['post'](_0x0333('0x17'),controller[_0x0333('0x18')]);router[_0x0333('0x11')](_0x0333('0x19'),auth[_0x0333('0xb')](),controller['send']);router[_0x0333('0x1a')]('/:id',auth[_0x0333('0xb')](),controller[_0x0333('0x1b')]);router['delete'](_0x0333('0x1c'),auth[_0x0333('0xb')](),controller['destroy']);router['delete'](_0x0333('0xe'),auth['isAuthenticated'](),controller[_0x0333('0x1d')]);router[_0x0333('0x1e')](_0x0333('0xf'),auth['isAuthenticated'](),controller[_0x0333('0x1f')]);router[_0x0333('0x1e')](_0x0333('0x10'),auth[_0x0333('0xb')](),controller[_0x0333('0x20')]);module[_0x0333('0x21')]=router; \ No newline at end of file +var _0x688d=['/describe','describe','show','/:id/dispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','addDisposition','addAnswer','addAgents','/:id/notify','notify','/:id/send','send','/:id','update','destroy','delete','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x688d,0x130));var _0xd688=function(_0x52f22f,_0x48d9e0){_0x52f22f=_0x52f22f-0x0;var _0x16dafc=_0x688d[_0x52f22f];return _0x16dafc;};'use strict';var multer=require(_0xd688('0x0'));var util=require('util');var path=require(_0xd688('0x1'));var timeout=require(_0xd688('0x2'));var express=require(_0xd688('0x3'));var router=express[_0xd688('0x4')]();var fs_extra=require(_0xd688('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd688('0x6'));var controller=require(_0xd688('0x7'));router[_0xd688('0x8')]('/',auth[_0xd688('0x9')](),controller[_0xd688('0xa')]);router[_0xd688('0x8')](_0xd688('0xb'),auth[_0xd688('0x9')](),controller[_0xd688('0xc')]);router[_0xd688('0x8')]('/:id',auth[_0xd688('0x9')](),controller[_0xd688('0xd')]);router[_0xd688('0x8')](_0xd688('0xe'),auth[_0xd688('0x9')](),controller['getDispositions']);router['get'](_0xd688('0xf'),auth[_0xd688('0x9')](),controller['getAnswers']);router[_0xd688('0x8')](_0xd688('0x10'),auth[_0xd688('0x9')](),controller[_0xd688('0x11')]);router['get'](_0xd688('0x12'),auth[_0xd688('0x9')](),controller[_0xd688('0x13')]);router[_0xd688('0x14')]('/',auth[_0xd688('0x9')](),controller['create']);router[_0xd688('0x14')](_0xd688('0xe'),auth[_0xd688('0x9')](),controller[_0xd688('0x15')]);router[_0xd688('0x14')]('/:id/canned_answers',auth[_0xd688('0x9')](),controller[_0xd688('0x16')]);router[_0xd688('0x14')]('/:id/users',auth[_0xd688('0x9')](),controller[_0xd688('0x17')]);router[_0xd688('0x14')]('/:id/applications',auth[_0xd688('0x9')](),controller['addApplications']);router[_0xd688('0x14')](_0xd688('0x18'),controller[_0xd688('0x19')]);router['post'](_0xd688('0x1a'),auth[_0xd688('0x9')](),controller[_0xd688('0x1b')]);router['put'](_0xd688('0x1c'),auth[_0xd688('0x9')](),controller[_0xd688('0x1d')]);router['delete'](_0xd688('0x1c'),auth['isAuthenticated'](),controller[_0xd688('0x1e')]);router[_0xd688('0x1f')](_0xd688('0xe'),auth[_0xd688('0x9')](),controller[_0xd688('0x20')]);router['delete'](_0xd688('0xf'),auth[_0xd688('0x9')](),controller['removeAnswers']);router[_0xd688('0x1f')](_0xd688('0x10'),auth[_0xd688('0x9')](),controller[_0xd688('0x21')]);module[_0xd688('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index d8509c6..a2635de 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 _0xc00e=['BOOLEAN','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xc00e,0x1e1));var _0xec00=function(_0x38400d,_0x1344d9){_0x38400d=_0x38400d-0x0;var _0x1422d6=_0xc00e[_0x38400d];return _0x1422d6;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xec00('0x0'));module[_0xec00('0x1')]={'name':{'type':Sequelize[_0xec00('0x2')],'unique':_0xec00('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xec00('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xec00('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xec00('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xec00('0x2')]},'type':{'type':Sequelize[_0xec00('0x4')](_0xec00('0x5'),_0xec00('0x6'))},'accountSid':{'type':Sequelize[_0xec00('0x2')]},'baseUrl':{'type':Sequelize[_0xec00('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xec00('0x7')],'defaultValue':function(){return _0xec00('0x8');}},'notificationSound':{'type':Sequelize[_0xec00('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xec00('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xec00('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xec00('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xec00('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xec00('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xec00('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xec00('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xec00('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1d30d0){if(!_0x1d30d0){this[_0xec00('0xb')](_0xec00('0xc'),null);}this['setDataValue'](_0xec00('0xd'),_0x1d30d0);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0ecc=['STRING','name','generate','ENUM','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'];(function(_0x56cc28,_0x4a921e){var _0x1f5798=function(_0x45f7a5){while(--_0x45f7a5){_0x56cc28['push'](_0x56cc28['shift']());}};_0x1f5798(++_0x4a921e);}(_0x0ecc,0x1bf));var _0xc0ec=function(_0x28a6bb,_0x5d6e70){_0x28a6bb=_0x28a6bb-0x0;var _0xaf7fce=_0x0ecc[_0x28a6bb];return _0xaf7fce;};'use strict';var Sequelize=require(_0xc0ec('0x0'));var rs=require(_0xc0ec('0x1'));module[_0xc0ec('0x2')]={'name':{'type':Sequelize[_0xc0ec('0x3')],'unique':_0xc0ec('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xc0ec('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xc0ec('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc0ec('0x6')]('twilio',_0xc0ec('0x7'))},'accountSid':{'type':Sequelize[_0xc0ec('0x3')]},'baseUrl':{'type':Sequelize[_0xc0ec('0x3')]},'authToken':{'type':Sequelize[_0xc0ec('0x3')]},'notificationTemplate':{'type':Sequelize[_0xc0ec('0x8')],'defaultValue':function(){return _0xc0ec('0x9');}},'notificationSound':{'type':Sequelize[_0xc0ec('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc0ec('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc0ec('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc0ec('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc0ec('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc0ec('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc0ec('0xb')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc0ec('0xa')],'defaultValue':![],'comment':_0xc0ec('0xc'),'set':function(_0x340b0b){if(!_0x340b0b){this[_0xc0ec('0xd')]('mandatoryDispositionPauseId',null);}this[_0xc0ec('0xd')](_0xc0ec('0xe'),_0x340b0b);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index c2c6775..e742c92 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 _0xf19d=['userWhatsappAccount:remove','getAgents','findOne','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','account','statuses','state','timestamp','message_id','orderBy','Applications','asc','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','From','whatsapp:','messageId','MessageSid','sinch','from','notifications','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','CmContact','Contacts','list','WhatsappInteraction','interaction','autoclose','applications','push','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','agent','queueId','WhatsappQueue','unshift','queue','waitForTheAssignedQueue','*,*,*,*','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','List','DESC','out','Messages','dataValues','eml-format','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','http','request','then','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','WhatsappAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','WhatsappAccount','includeAll','findAll','rows','show','rawAttributes','include','options','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','Disposition','getDispositions','WhatsappAccountId','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray'];(function(_0x21fc68,_0x459828){var _0x3561e1=function(_0x3dea77){while(--_0x3dea77){_0x21fc68['push'](_0x21fc68['shift']());}};_0x3561e1(++_0x459828);}(_0xf19d,0x110));var _0xdf19=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xf19d[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0xdf19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf19('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf19('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdf19('0x3'));var path=require(_0xdf19('0x4'));var sox=require(_0xdf19('0x5'));var csv=require(_0xdf19('0x6'));var ejs=require(_0xdf19('0x7'));var fs=require('fs');var fs_extra=require(_0xdf19('0x8'));var _=require(_0xdf19('0x9'));var squel=require(_0xdf19('0xa'));var crypto=require(_0xdf19('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdf19('0xc'));var toCsv=require(_0xdf19('0x6'));var querystring=require(_0xdf19('0xd'));var Papa=require(_0xdf19('0xe'));var Redis=require(_0xdf19('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdf19('0x10'));var as=require(_0xdf19('0x11'));var hardwareService=require(_0xdf19('0x12'));var logger=require(_0xdf19('0x13'))(_0xdf19('0x14'));var utils=require('../../config/utils');var config=require(_0xdf19('0x15'));var licenseUtil=require(_0xdf19('0x16'));var db=require('../../mysqldb')['db'];config[_0xdf19('0x17')]=_[_0xdf19('0x18')](config[_0xdf19('0x17')],{'host':_0xdf19('0x19'),'port':0x18eb});var socket=require(_0xdf19('0x1a'))(new Redis(config[_0xdf19('0x17')]));require(_0xdf19('0x1b'))['register'](socket);var jayson=require(_0xdf19('0x1c'));var client=jayson['client'][_0xdf19('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x150fcf,_0x121a9d,_0x3b7050,_0x260207){return new BPromise(function(_0x57e167,_0x5ecc3a){var _0x43c3c8=_0x260207||client;return _0x43c3c8[_0xdf19('0x1e')](_0x150fcf,_0x3b7050)[_0xdf19('0x1f')](function(_0x42da2b){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x121a9d,_0xdf19('0x20'));logger[_0xdf19('0x21')](_0xdf19('0x22'),_0x121a9d,_0xdf19('0x20'),JSON[_0xdf19('0x23')](_0x42da2b));if(_0x42da2b['error']){if(_0x42da2b['error'][_0xdf19('0x24')]===0x1f4){logger[_0xdf19('0x25')](_0xdf19('0x26'),_0x121a9d,_0x42da2b[_0xdf19('0x25')][_0xdf19('0x27')]);return _0x5ecc3a(_0x42da2b[_0xdf19('0x25')][_0xdf19('0x27')]);}logger['error'](_0xdf19('0x26'),_0x121a9d,_0x42da2b[_0xdf19('0x25')][_0xdf19('0x27')]);return _0x57e167(_0x42da2b['error'][_0xdf19('0x27')]);}else{logger[_0xdf19('0x28')](_0xdf19('0x26'),_0x121a9d,_0xdf19('0x20'));_0x57e167(_0x42da2b[_0xdf19('0x29')][_0xdf19('0x27')]);}})[_0xdf19('0x2a')](function(_0x39cdd6){logger[_0xdf19('0x25')](_0xdf19('0x26'),_0x121a9d,_0x39cdd6);_0x5ecc3a(_0x39cdd6);});});}function respondWithStatusCode(_0xe533a2,_0xccf53f){_0xccf53f=_0xccf53f||0xcc;return function(_0x4fbca3){if(_0x4fbca3){return _0xe533a2[_0xdf19('0x2b')](_0xccf53f);}return _0xe533a2[_0xdf19('0x2c')](_0xccf53f)[_0xdf19('0x2d')]();};}function respondWithResult(_0x1672d5,_0x2fdc0c){_0x2fdc0c=_0x2fdc0c||0xc8;return function(_0x1424f5){if(_0x1424f5){return _0x1672d5['status'](_0x2fdc0c)[_0xdf19('0x2e')](_0x1424f5);}};}function respondWithFilteredResult(_0x403227,_0x425140){return function(_0x2810de){if(_0x2810de){var _0xd2f46f=typeof _0x425140[_0xdf19('0x2f')]===_0xdf19('0x30')&&typeof _0x425140[_0xdf19('0x31')]==='undefined';var _0x3f1beb=_0x2810de[_0xdf19('0x32')];var _0x576152=_0xd2f46f?0x0:_0x425140[_0xdf19('0x2f')];var _0x317ecc=_0xd2f46f?_0x2810de[_0xdf19('0x32')]:_0x425140[_0xdf19('0x2f')]+_0x425140[_0xdf19('0x31')];var _0x1948da;if(_0x317ecc>=_0x3f1beb){_0x317ecc=_0x3f1beb;_0x1948da=0xc8;}else{_0x1948da=0xce;}_0x403227[_0xdf19('0x2c')](_0x1948da);return _0x403227[_0xdf19('0x33')](_0xdf19('0x34'),_0x576152+'-'+_0x317ecc+'/'+_0x3f1beb)[_0xdf19('0x2e')](_0x2810de);}return null;};}function patchUpdates(_0x324bc4){return function(_0x3d668f){try{jsonpatch['apply'](_0x3d668f,_0x324bc4,!![]);}catch(_0x1a431f){return BPromise[_0xdf19('0x35')](_0x1a431f);}return _0x3d668f['save']();};}function saveUpdates(_0x4879af,_0x301258){return function(_0x591ecf){if(_0x591ecf){return _0x591ecf[_0xdf19('0x36')](_0x4879af)[_0xdf19('0x1f')](function(_0x5f4761){return _0x5f4761;});}return null;};}function removeEntity(_0x4392fd,_0x43237f){return function(_0x208405){if(_0x208405){return _0x208405[_0xdf19('0x37')]()[_0xdf19('0x1f')](function(){var _0x2ad049=_0x208405[_0xdf19('0x38')]({'plain':!![]});var _0x4b68a1=_0xdf19('0x39');return db[_0xdf19('0x3a')]['destroy']({'where':{'type':_0x4b68a1,'resourceId':_0x2ad049['id']}})[_0xdf19('0x1f')](function(){return _0x208405;});})['then'](function(){_0x4392fd[_0xdf19('0x2c')](0xcc)[_0xdf19('0x2d')]();});}};}function handleEntityNotFound(_0x1ad4e5,_0x4a9ff8){return function(_0x573fb5){if(!_0x573fb5){_0x1ad4e5[_0xdf19('0x2b')](0x194);}return _0x573fb5;};}function handleError(_0x5ee8b4,_0x459e96){_0x459e96=_0x459e96||0x1f4;return function(_0x3bd37a){logger[_0xdf19('0x25')](_0x3bd37a['stack']);if(_0x3bd37a['name']){delete _0x3bd37a[_0xdf19('0x3b')];}_0x5ee8b4['status'](_0x459e96)[_0xdf19('0x3c')](_0x3bd37a);};}exports[_0xdf19('0x3d')]=function(_0x195e6e,_0x2c627e){var _0x9998cc={'include':[{'model':db[_0xdf19('0x3e')],'as':_0xdf19('0x3f')}]},_0x1ebd55={},_0xa74acd={'count':0x0,'rows':[]};var _0x36a22d=_[_0xdf19('0x40')](db['WhatsappAccount']['rawAttributes'],function(_0x9bd963){return{'name':_0x9bd963[_0xdf19('0x41')],'type':_0x9bd963[_0xdf19('0x42')]['key']};});_0x1ebd55[_0xdf19('0x43')]=_['map'](_0x36a22d,_0xdf19('0x3b'));_0x1ebd55[_0xdf19('0x44')]=_[_0xdf19('0x45')](_0x195e6e[_0xdf19('0x44')]);_0x1ebd55[_0xdf19('0x46')]=_[_0xdf19('0x47')](_0x1ebd55[_0xdf19('0x43')],_0x1ebd55['query']);_0x9998cc[_0xdf19('0x48')]=_[_0xdf19('0x47')](_0x1ebd55[_0xdf19('0x43')],qs['fields'](_0x195e6e[_0xdf19('0x44')][_0xdf19('0x49')]));_0x9998cc['attributes']=_0x9998cc['attributes'][_0xdf19('0x4a')]?_0x9998cc[_0xdf19('0x48')]:_0x1ebd55[_0xdf19('0x43')];if(!_0x195e6e[_0xdf19('0x44')][_0xdf19('0x4b')](_0xdf19('0x4c'))){_0x9998cc[_0xdf19('0x31')]=qs[_0xdf19('0x31')](_0x195e6e[_0xdf19('0x44')][_0xdf19('0x31')]);_0x9998cc['offset']=qs[_0xdf19('0x2f')](_0x195e6e[_0xdf19('0x44')][_0xdf19('0x2f')]);}_0x9998cc[_0xdf19('0x4d')]=qs[_0xdf19('0x4e')](_0x195e6e['query'][_0xdf19('0x4e')]);_0x9998cc[_0xdf19('0x4f')]=qs[_0xdf19('0x46')](_[_0xdf19('0x50')](_0x195e6e[_0xdf19('0x44')],_0x1ebd55['filters']),_0x36a22d);if(_0x195e6e[_0xdf19('0x44')][_0xdf19('0x51')]){_0x9998cc[_0xdf19('0x4f')]=_[_0xdf19('0x52')](_0x9998cc[_0xdf19('0x4f')],{'$or':_[_0xdf19('0x40')](_0x36a22d,function(_0x43a0a6){if(_0x43a0a6[_0xdf19('0x42')]!=='VIRTUAL'){var _0x3bdbfa={};_0x3bdbfa[_0x43a0a6['name']]={'$like':'%'+_0x195e6e['query'][_0xdf19('0x51')]+'%'};return _0x3bdbfa;}})});}_0x9998cc=_['merge']({},_0x9998cc,_0x195e6e['options']);var _0x5a183e={'where':_0x9998cc[_0xdf19('0x4f')]};return db[_0xdf19('0x53')]['count'](_0x5a183e)[_0xdf19('0x1f')](function(_0x2eb61a){_0xa74acd[_0xdf19('0x32')]=_0x2eb61a;if(_0x195e6e[_0xdf19('0x44')][_0xdf19('0x54')]){_0x9998cc['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0xdf19('0x55')](_0x9998cc);})['then'](function(_0x180247){_0xa74acd[_0xdf19('0x56')]=_0x180247;return _0xa74acd;})[_0xdf19('0x1f')](respondWithFilteredResult(_0x2c627e,_0x9998cc))[_0xdf19('0x2a')](handleError(_0x2c627e,null));};exports[_0xdf19('0x57')]=function(_0x4a5a45,_0x356048){var _0x1dc75a={'raw':![],'where':{'id':_0x4a5a45['params']['id']},'include':[{'model':db[_0xdf19('0x3e')],'as':_0xdf19('0x3f')}]},_0x3b4741={};_0x3b4741[_0xdf19('0x43')]=_[_0xdf19('0x45')](db[_0xdf19('0x53')][_0xdf19('0x58')]);_0x3b4741[_0xdf19('0x44')]=_[_0xdf19('0x45')](_0x4a5a45[_0xdf19('0x44')]);_0x3b4741[_0xdf19('0x46')]=_[_0xdf19('0x47')](_0x3b4741[_0xdf19('0x43')],_0x3b4741[_0xdf19('0x44')]);_0x1dc75a['attributes']=_[_0xdf19('0x47')](_0x3b4741[_0xdf19('0x43')],qs[_0xdf19('0x49')](_0x4a5a45[_0xdf19('0x44')]['fields']));_0x1dc75a['attributes']=_0x1dc75a[_0xdf19('0x48')]['length']?_0x1dc75a['attributes']:_0x3b4741[_0xdf19('0x43')];if(_0x4a5a45[_0xdf19('0x44')][_0xdf19('0x54')]){_0x1dc75a[_0xdf19('0x59')]=[{'all':!![]}];}_0x1dc75a=_[_0xdf19('0x52')]({},_0x1dc75a,_0x4a5a45[_0xdf19('0x5a')]);return db[_0xdf19('0x53')][_0xdf19('0x5b')](_0x1dc75a)[_0xdf19('0x1f')](handleEntityNotFound(_0x356048,null))[_0xdf19('0x1f')](respondWithResult(_0x356048,null))[_0xdf19('0x2a')](handleError(_0x356048,null));};exports[_0xdf19('0x5c')]=function(_0x39614d,_0x229685){return db[_0xdf19('0x53')][_0xdf19('0x5c')](_0x39614d['body'],{})[_0xdf19('0x1f')](function(_0x178ee3){var _0x56d58c=_0x39614d[_0xdf19('0x5d')][_0xdf19('0x38')]({'plain':!![]});if(!_0x56d58c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56d58c[_0xdf19('0x5e')]==='user'){var _0x3e71e6=_0x178ee3['get']({'plain':!![]});var _0x496d71='WhatsappAccounts';return db[_0xdf19('0x5f')]['find']({'where':{'name':_0x496d71,'userProfileId':_0x56d58c[_0xdf19('0x60')]},'raw':!![]})[_0xdf19('0x1f')](function(_0x69fb4){if(_0x69fb4&&_0x69fb4[_0xdf19('0x61')]===0x0){return db[_0xdf19('0x3a')][_0xdf19('0x5c')]({'name':_0x3e71e6['name'],'resourceId':_0x3e71e6['id'],'type':_0x69fb4[_0xdf19('0x3b')],'sectionId':_0x69fb4['id']},{})[_0xdf19('0x1f')](function(){return _0x178ee3;});}else{return _0x178ee3;}})[_0xdf19('0x2a')](function(_0x59200d){logger['error'](_0xdf19('0x62'),_0x59200d);throw _0x59200d;});}return _0x178ee3;})['then'](respondWithResult(_0x229685,0xc9))[_0xdf19('0x2a')](handleError(_0x229685,null));};exports['update']=function(_0x4db447,_0x81d924){if(_0x4db447[_0xdf19('0x63')]['id']){delete _0x4db447[_0xdf19('0x63')]['id'];}return db[_0xdf19('0x53')]['find']({'where':{'id':_0x4db447[_0xdf19('0x64')]['id']},'include':[{'model':db[_0xdf19('0x3e')],'as':'mandatoryDispositionPause'}]})[_0xdf19('0x1f')](handleEntityNotFound(_0x81d924,null))[_0xdf19('0x1f')](saveUpdates(_0x4db447[_0xdf19('0x63')],null))['then'](respondWithResult(_0x81d924,null))['catch'](handleError(_0x81d924,null));};exports[_0xdf19('0x37')]=function(_0x546066,_0x311f5d){return db[_0xdf19('0x53')]['find']({'where':{'id':_0x546066[_0xdf19('0x64')]['id']}})['then'](handleEntityNotFound(_0x311f5d,null))[_0xdf19('0x1f')](removeEntity(_0x311f5d,null))[_0xdf19('0x2a')](handleError(_0x311f5d,null));};exports[_0xdf19('0x65')]=function(_0x14c5ba,_0x1fae30){return db['WhatsappAccount'][_0xdf19('0x65')]()[_0xdf19('0x1f')](respondWithResult(_0x1fae30,null))[_0xdf19('0x2a')](handleError(_0x1fae30,null));};exports['addDisposition']=function(_0x3e9300,_0x228498,_0x53e9c7){if(_0x3e9300[_0xdf19('0x63')]['id']){delete _0x3e9300['body']['id'];}return db[_0xdf19('0x53')][_0xdf19('0x5b')]({'where':{'id':_0x3e9300['params']['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x228498,null))[_0xdf19('0x1f')](function(_0x5f4939){if(_0x5f4939){_0x3e9300['body']['WhatsappAccountId']=_0x5f4939['id'];return db[_0xdf19('0x66')][_0xdf19('0x5c')](_0x3e9300[_0xdf19('0x63')]);}})[_0xdf19('0x1f')](respondWithResult(_0x228498,null))[_0xdf19('0x2a')](handleError(_0x228498,null));};exports[_0xdf19('0x67')]=function(_0x4e1c8d,_0x538e17,_0x1b8010){var _0x2983a7={'raw':![],'where':{}};var _0x59a5c2={};var _0x4814de={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x4e1c8d[_0xdf19('0x64')]['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x538e17,null))[_0xdf19('0x1f')](function(_0x58ce12){if(_0x58ce12){_0x59a5c2[_0xdf19('0x43')]=_[_0xdf19('0x45')](db[_0xdf19('0x66')][_0xdf19('0x58')]);_0x59a5c2[_0xdf19('0x44')]=_[_0xdf19('0x45')](_0x4e1c8d[_0xdf19('0x44')]);_0x59a5c2[_0xdf19('0x46')]=_[_0xdf19('0x47')](_0x59a5c2[_0xdf19('0x43')],_0x59a5c2['query']);_0x2983a7['attributes']=_[_0xdf19('0x47')](_0x59a5c2['model'],qs[_0xdf19('0x49')](_0x4e1c8d['query'][_0xdf19('0x49')]));_0x2983a7['attributes']=_0x2983a7[_0xdf19('0x48')][_0xdf19('0x4a')]?_0x2983a7[_0xdf19('0x48')]:_0x59a5c2[_0xdf19('0x43')];if(!_0x4e1c8d[_0xdf19('0x44')][_0xdf19('0x4b')](_0xdf19('0x4c'))){_0x2983a7[_0xdf19('0x31')]=qs['limit'](_0x4e1c8d['query'][_0xdf19('0x31')]);_0x2983a7[_0xdf19('0x2f')]=qs[_0xdf19('0x2f')](_0x4e1c8d['query']['offset']);}_0x2983a7[_0xdf19('0x4d')]=qs[_0xdf19('0x4e')](_0x4e1c8d[_0xdf19('0x44')]['sort']);_0x2983a7[_0xdf19('0x4f')]=qs[_0xdf19('0x46')](_['pick'](_0x4e1c8d[_0xdf19('0x44')],_0x59a5c2[_0xdf19('0x46')]));_0x2983a7[_0xdf19('0x4f')][_0xdf19('0x68')]=_0x58ce12['id'];if(_0x4e1c8d[_0xdf19('0x44')][_0xdf19('0x51')]){_0x2983a7[_0xdf19('0x4f')]=_['merge'](_0x2983a7[_0xdf19('0x4f')],{'$or':_['map'](_0x2983a7[_0xdf19('0x48')],function(_0x14d6ad){var _0x5b0ea5={};_0x5b0ea5[_0x14d6ad]={'$like':'%'+_0x4e1c8d[_0xdf19('0x44')]['filter']+'%'};return _0x5b0ea5;})});}_0x2983a7=_['merge']({},_0x2983a7,_0x4e1c8d[_0xdf19('0x5a')]);return db[_0xdf19('0x66')][_0xdf19('0x32')]({'where':_0x2983a7[_0xdf19('0x4f')]})[_0xdf19('0x1f')](function(_0x3ae6b6){_0x4814de[_0xdf19('0x32')]=_0x3ae6b6;if(_0x4e1c8d[_0xdf19('0x44')][_0xdf19('0x54')]){_0x2983a7['include']=[{'all':!![]}];}return db[_0xdf19('0x66')][_0xdf19('0x55')](_0x2983a7);})[_0xdf19('0x1f')](function(_0x3414fe){_0x4814de['rows']=_0x3414fe;return _0x4814de;});}})[_0xdf19('0x1f')](respondWithFilteredResult(_0x538e17,_0x2983a7))['catch'](handleError(_0x538e17,null));};exports[_0xdf19('0x69')]=function(_0x4ec52f,_0x44c871,_0x1af150){return db[_0xdf19('0x53')][_0xdf19('0x5b')]({'where':{'id':_0x4ec52f['params']['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x44c871,null))[_0xdf19('0x1f')](function(_0x2b3a6b){if(_0x2b3a6b){return _0x2b3a6b[_0xdf19('0x69')](_0x4ec52f[_0xdf19('0x44')]['ids']);}})[_0xdf19('0x1f')](respondWithStatusCode(_0x44c871,null))[_0xdf19('0x2a')](handleError(_0x44c871,null));};exports[_0xdf19('0x6a')]=function(_0x45698a,_0x52b31f,_0xc4e56c){if(_0x45698a[_0xdf19('0x63')]['id']){delete _0x45698a[_0xdf19('0x63')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x45698a[_0xdf19('0x64')]['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x52b31f,null))[_0xdf19('0x1f')](function(_0x264df6){if(_0x264df6){_0x45698a[_0xdf19('0x63')][_0xdf19('0x68')]=_0x264df6['id'];return db[_0xdf19('0x6b')][_0xdf19('0x5c')](_0x45698a[_0xdf19('0x63')]);}})[_0xdf19('0x1f')](respondWithResult(_0x52b31f,null))[_0xdf19('0x2a')](handleError(_0x52b31f,null));};exports['getAnswers']=function(_0xa4f180,_0x410ea7,_0x5e152d){var _0x10c5a7={'raw':![],'where':{}};var _0x3cdbda={};var _0x3c1e2c={'count':0x0,'rows':[]};return db[_0xdf19('0x53')]['findOne']({'where':{'id':_0xa4f180[_0xdf19('0x64')]['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x410ea7,null))[_0xdf19('0x1f')](function(_0x1d177a){if(_0x1d177a){_0x3cdbda[_0xdf19('0x43')]=_[_0xdf19('0x45')](db['CannedAnswer'][_0xdf19('0x58')]);_0x3cdbda[_0xdf19('0x44')]=_[_0xdf19('0x45')](_0xa4f180[_0xdf19('0x44')]);_0x3cdbda[_0xdf19('0x46')]=_[_0xdf19('0x47')](_0x3cdbda[_0xdf19('0x43')],_0x3cdbda[_0xdf19('0x44')]);_0x10c5a7['attributes']=_['intersection'](_0x3cdbda['model'],qs[_0xdf19('0x49')](_0xa4f180[_0xdf19('0x44')][_0xdf19('0x49')]));_0x10c5a7[_0xdf19('0x48')]=_0x10c5a7[_0xdf19('0x48')]['length']?_0x10c5a7[_0xdf19('0x48')]:_0x3cdbda[_0xdf19('0x43')];if(!_0xa4f180[_0xdf19('0x44')][_0xdf19('0x4b')]('nolimit')){_0x10c5a7[_0xdf19('0x31')]=qs[_0xdf19('0x31')](_0xa4f180[_0xdf19('0x44')][_0xdf19('0x31')]);_0x10c5a7[_0xdf19('0x2f')]=qs[_0xdf19('0x2f')](_0xa4f180['query'][_0xdf19('0x2f')]);}_0x10c5a7['order']=qs[_0xdf19('0x4e')](_0xa4f180[_0xdf19('0x44')][_0xdf19('0x4e')]);_0x10c5a7[_0xdf19('0x4f')]=qs[_0xdf19('0x46')](_[_0xdf19('0x50')](_0xa4f180[_0xdf19('0x44')],_0x3cdbda[_0xdf19('0x46')]));_0x10c5a7[_0xdf19('0x4f')][_0xdf19('0x68')]=_0x1d177a['id'];if(_0xa4f180[_0xdf19('0x44')][_0xdf19('0x51')]){_0x10c5a7[_0xdf19('0x4f')]=_['merge'](_0x10c5a7[_0xdf19('0x4f')],{'$or':_['map'](_0x10c5a7[_0xdf19('0x48')],function(_0x2c8728){var _0x328e0a={};_0x328e0a[_0x2c8728]={'$like':'%'+_0xa4f180[_0xdf19('0x44')][_0xdf19('0x51')]+'%'};return _0x328e0a;})});}_0x10c5a7=_[_0xdf19('0x52')]({},_0x10c5a7,_0xa4f180[_0xdf19('0x5a')]);return db[_0xdf19('0x6b')]['count']({'where':_0x10c5a7[_0xdf19('0x4f')]})[_0xdf19('0x1f')](function(_0x4c8780){_0x3c1e2c[_0xdf19('0x32')]=_0x4c8780;if(_0xa4f180[_0xdf19('0x44')][_0xdf19('0x54')]){_0x10c5a7[_0xdf19('0x59')]=[{'all':!![]}];}return db[_0xdf19('0x6b')][_0xdf19('0x55')](_0x10c5a7);})[_0xdf19('0x1f')](function(_0x4fe10f){_0x3c1e2c[_0xdf19('0x56')]=_0x4fe10f;return _0x3c1e2c;});}})['then'](respondWithFilteredResult(_0x410ea7,_0x10c5a7))[_0xdf19('0x2a')](handleError(_0x410ea7,null));};exports[_0xdf19('0x6c')]=function(_0x476811,_0x53bbda,_0x3d02c6){return db[_0xdf19('0x53')][_0xdf19('0x5b')]({'where':{'id':_0x476811['params']['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x53bbda,null))[_0xdf19('0x1f')](function(_0x550b0d){if(_0x550b0d){return _0x550b0d[_0xdf19('0x6c')](_0x476811[_0xdf19('0x44')][_0xdf19('0x6d')]);}})[_0xdf19('0x1f')](respondWithStatusCode(_0x53bbda,null))['catch'](handleError(_0x53bbda,null));};exports['addAgents']=function(_0x37e46c,_0x4a88bc,_0x5e38a1){return db['WhatsappAccount'][_0xdf19('0x5b')]({'where':{'id':_0x37e46c['params']['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x4a88bc,null))[_0xdf19('0x1f')](function(_0x5c30bc){if(_0x5c30bc){return _0x5c30bc['addAgents'](_0x37e46c[_0xdf19('0x63')]['ids'],_[_0xdf19('0x6e')](_0x37e46c[_0xdf19('0x63')],['ids','id'])||{})[_0xdf19('0x6f')](function(_0x4c7176){for(var _0x1ba9c5=0x0;_0x1ba9c5<_0x37e46c[_0xdf19('0x63')]['ids'][_0xdf19('0x4a')];_0x1ba9c5+=0x1){socket[_0xdf19('0x70')](_0xdf19('0x71'),{'UserId':Number(_0x37e46c[_0xdf19('0x63')][_0xdf19('0x6d')][_0x1ba9c5]),'WhatsappAccountId':Number(_0x37e46c[_0xdf19('0x64')]['id'])});}return _0x4c7176;});}})[_0xdf19('0x1f')](respondWithResult(_0x4a88bc,null))[_0xdf19('0x2a')](handleError(_0x4a88bc,null));};exports[_0xdf19('0x72')]=function(_0x34f0f7,_0x1f6711,_0x11459e){return db[_0xdf19('0x53')][_0xdf19('0x5b')]({'where':{'id':_0x34f0f7[_0xdf19('0x64')]['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x1f6711,null))['then'](function(_0x48918b){if(_0x48918b){return _0x48918b[_0xdf19('0x72')](_0x34f0f7[_0xdf19('0x44')]['ids'])[_0xdf19('0x1f')](function(){if(_[_0xdf19('0x73')](_0x34f0f7[_0xdf19('0x44')][_0xdf19('0x6d')])){for(var _0x3b1c80=0x0;_0x3b1c80<_0x34f0f7[_0xdf19('0x44')][_0xdf19('0x6d')][_0xdf19('0x4a')];_0x3b1c80+=0x1){socket[_0xdf19('0x70')]('userWhatsappAccount:remove',{'UserId':Number(_0x34f0f7[_0xdf19('0x44')][_0xdf19('0x6d')][_0x3b1c80]),'WhatsappAccountId':Number(_0x34f0f7['params']['id'])});}}else{socket['emit'](_0xdf19('0x74'),{'UserId':Number(_0x34f0f7['query'][_0xdf19('0x6d')]),'WhatsappAccountId':Number(_0x34f0f7['params']['id'])});}});}})[_0xdf19('0x1f')](respondWithStatusCode(_0x1f6711,null))[_0xdf19('0x2a')](handleError(_0x1f6711,null));};exports[_0xdf19('0x75')]=function(_0x2af021,_0x5cf884,_0x26041a){var _0x534c8b={};var _0x32b4d0={};var _0x426ebd;var _0x528842;return db[_0xdf19('0x53')][_0xdf19('0x76')]({'where':{'id':_0x2af021['params']['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x5cf884,null))[_0xdf19('0x1f')](function(_0x3b1957){if(_0x3b1957){_0x426ebd=_0x3b1957;_0x32b4d0[_0xdf19('0x43')]=_[_0xdf19('0x45')](db[_0xdf19('0x77')][_0xdf19('0x58')]);_0x32b4d0[_0xdf19('0x44')]=_[_0xdf19('0x45')](_0x2af021['query']);_0x32b4d0['filters']=_[_0xdf19('0x47')](_0x32b4d0[_0xdf19('0x43')],_0x32b4d0[_0xdf19('0x44')]);_0x534c8b[_0xdf19('0x48')]=_['intersection'](_0x32b4d0[_0xdf19('0x43')],qs[_0xdf19('0x49')](_0x2af021[_0xdf19('0x44')][_0xdf19('0x49')]));_0x534c8b[_0xdf19('0x48')]=_0x534c8b[_0xdf19('0x48')][_0xdf19('0x4a')]?_0x534c8b[_0xdf19('0x48')]:_0x32b4d0[_0xdf19('0x43')];_0x534c8b['order']=qs['sort'](_0x2af021['query'][_0xdf19('0x4e')]);_0x534c8b[_0xdf19('0x4f')]=qs[_0xdf19('0x46')](_[_0xdf19('0x50')](_0x2af021[_0xdf19('0x44')],_0x32b4d0['filters']));if(_0x2af021['query'][_0xdf19('0x51')]){_0x534c8b[_0xdf19('0x4f')]=_['merge'](_0x534c8b[_0xdf19('0x4f')],{'$or':_[_0xdf19('0x40')](_0x534c8b[_0xdf19('0x48')],function(_0x5e967f){var _0x4657db={};_0x4657db[_0x5e967f]={'$like':'%'+_0x2af021[_0xdf19('0x44')][_0xdf19('0x51')]+'%'};return _0x4657db;})});}_0x534c8b=_[_0xdf19('0x52')]({},_0x534c8b,_0x2af021[_0xdf19('0x5a')]);return _0x426ebd['getAgents'](_0x534c8b);}})[_0xdf19('0x1f')](function(_0x5adc3e){if(_0x5adc3e){_0x528842=_0x5adc3e[_0xdf19('0x4a')];if(!_0x2af021[_0xdf19('0x44')]['hasOwnProperty'](_0xdf19('0x4c'))){_0x534c8b[_0xdf19('0x31')]=qs[_0xdf19('0x31')](_0x2af021[_0xdf19('0x44')][_0xdf19('0x31')]);_0x534c8b[_0xdf19('0x2f')]=qs[_0xdf19('0x2f')](_0x2af021['query'][_0xdf19('0x2f')]);}return _0x426ebd[_0xdf19('0x75')](_0x534c8b);}})[_0xdf19('0x1f')](function(_0x53b984){if(_0x53b984){return _0x53b984?{'count':_0x528842,'rows':_0x53b984}:null;}})[_0xdf19('0x1f')](respondWithResult(_0x5cf884,null))[_0xdf19('0x2a')](handleError(_0x5cf884,null));};exports[_0xdf19('0x78')]=function(_0x2bd4c9,_0x50e27e){var _0x7039c5=_0x2bd4c9[_0xdf19('0x64')]['id'];var _0x1b004c=_0x2bd4c9[_0xdf19('0x63')];var _0x3bf593=0xc8;var _0x4af1cc=null;return db[_0xdf19('0x79')][_0xdf19('0x7a')]({'isolationLevel':db[_0xdf19('0x79')][_0xdf19('0x7b')][_0xdf19('0x7c')][_0xdf19('0x7d')]},function(_0xfb4f35){return db[_0xdf19('0x53')][_0xdf19('0x76')]({'where':{'id':_0x7039c5},'transaction':_0xfb4f35})[_0xdf19('0x1f')](function(_0x3c625c){if(_0x3c625c){return db[_0xdf19('0x7e')]['destroy']({'where':{'WhatsappAccountId':_0x7039c5},'transaction':_0xfb4f35})[_0xdf19('0x1f')](function(){var _0x9785c=_['map'](_0x1b004c,function(_0x65b66d){_0x65b66d[_0xdf19('0x68')]=_0x7039c5;return _0x65b66d;});return db['WhatsappApplication'][_0xdf19('0x7f')](_0x9785c,{'transaction':_0xfb4f35});});}else{_0x3bf593=0x194;_0x4af1cc=[];}});})[_0xdf19('0x1f')](function(){if(_0x3bf593!==0x194){return db[_0xdf19('0x7e')][_0xdf19('0x80')]({'where':{'WhatsappAccountId':_0x7039c5},'order':_0xdf19('0x81')})[_0xdf19('0x1f')](function(_0x47b82b){_0x4af1cc=_0x47b82b;});}})['catch'](function(_0x38a7b8){_0x3bf593=0x1f4;logger[_0xdf19('0x25')](_0x38a7b8[_0xdf19('0x82')]);if(_0x38a7b8[_0xdf19('0x3b')]){delete _0x38a7b8[_0xdf19('0x3b')];}_0x4af1cc=_0x38a7b8;})[_0xdf19('0x83')](function(){if(_0x4af1cc===null){_0x50e27e['sendStatus'](_0x3bf593);}else{if(_0x3bf593===0x1f4){_0x50e27e[_0xdf19('0x2c')](_0x3bf593)[_0xdf19('0x3c')](_0x4af1cc);}else{_0x50e27e[_0xdf19('0x2c')](_0x3bf593)[_0xdf19('0x2e')](_0x4af1cc);}}});};exports[_0xdf19('0x84')]=function(_0x5dda72,_0x1fbc58,_0x1cff83){var _0x57f1d8={};var _0x23f9d2={};var _0x4c85f8;var _0x4dafaa;return db[_0xdf19('0x53')]['findOne']({'where':{'id':_0x5dda72[_0xdf19('0x64')]['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x1fbc58,null))[_0xdf19('0x1f')](function(_0x3fa959){if(_0x3fa959){_0x4c85f8=_0x3fa959;_0x23f9d2[_0xdf19('0x43')]=_[_0xdf19('0x45')](db[_0xdf19('0x7e')]['rawAttributes']);_0x23f9d2['query']=_[_0xdf19('0x45')](_0x5dda72[_0xdf19('0x44')]);_0x23f9d2[_0xdf19('0x46')]=_[_0xdf19('0x47')](_0x23f9d2[_0xdf19('0x43')],_0x23f9d2[_0xdf19('0x44')]);_0x57f1d8[_0xdf19('0x48')]=_[_0xdf19('0x47')](_0x23f9d2[_0xdf19('0x43')],qs[_0xdf19('0x49')](_0x5dda72['query']['fields']));_0x57f1d8['attributes']=_0x57f1d8[_0xdf19('0x48')][_0xdf19('0x4a')]?_0x57f1d8['attributes']:_0x23f9d2[_0xdf19('0x43')];_0x57f1d8['order']=qs[_0xdf19('0x4e')](_0x5dda72[_0xdf19('0x44')][_0xdf19('0x4e')]);_0x57f1d8[_0xdf19('0x4f')]=qs['filters'](_[_0xdf19('0x50')](_0x5dda72[_0xdf19('0x44')],_0x23f9d2[_0xdf19('0x46')]));if(_0x5dda72[_0xdf19('0x44')][_0xdf19('0x51')]){_0x57f1d8[_0xdf19('0x4f')]=_[_0xdf19('0x52')](_0x57f1d8[_0xdf19('0x4f')],{'$or':_['map'](_0x57f1d8[_0xdf19('0x48')],function(_0x5abcdf){var _0xd3fea5={};_0xd3fea5[_0x5abcdf]={'$like':'%'+_0x5dda72['query'][_0xdf19('0x51')]+'%'};return _0xd3fea5;})});}_0x57f1d8=_[_0xdf19('0x52')]({},_0x57f1d8,_0x5dda72[_0xdf19('0x5a')]);return _0x4c85f8[_0xdf19('0x84')](_0x57f1d8);}})[_0xdf19('0x1f')](function(_0x423099){if(_0x423099){_0x4dafaa=_0x423099[_0xdf19('0x4a')];if(!_0x5dda72['query'][_0xdf19('0x4b')](_0xdf19('0x4c'))){_0x57f1d8[_0xdf19('0x31')]=qs[_0xdf19('0x31')](_0x5dda72['query'][_0xdf19('0x31')]);_0x57f1d8[_0xdf19('0x2f')]=qs[_0xdf19('0x2f')](_0x5dda72['query'][_0xdf19('0x2f')]);}return _0x4c85f8[_0xdf19('0x84')](_0x57f1d8);}})['then'](function(_0x8861a3){if(_0x8861a3){return _0x8861a3?{'count':_0x4dafaa,'rows':_0x8861a3}:null;}})[_0xdf19('0x1f')](respondWithResult(_0x1fbc58,null))['catch'](handleError(_0x1fbc58,null));};exports['notify']=function(_0x2ff510,_0x23757a,_0x2d3ba1){var _0x3fddc7={'channel':'whatsapp'};var _0x522eb0=[];var _0x47262d=[];var _0x5013ee={};return db[_0xdf19('0x53')][_0xdf19('0x5b')]({'where':{'id':_0x2ff510[_0xdf19('0x64')]['id']},'include':[{'model':db[_0xdf19('0x7e')],'as':'Applications'}]})[_0xdf19('0x1f')](handleEntityNotFound(_0x23757a,null))[_0xdf19('0x1f')](function(_0xd6cf23){_0x3fddc7['account']=_0xd6cf23;if(_0x3fddc7['account']&&_0x3fddc7[_0xdf19('0x85')]['type']==='sinch'&&_0x2ff510['body'][_0xdf19('0x86')]){if(_0x2ff510['body'][_0xdf19('0x86')][_0xdf19('0x4a')]===0x0)return;if(_0x2ff510['body']['statuses'][0x0][_0xdf19('0x87')]!=='read')return;return db['WhatsappMessage'][_0xdf19('0x36')]({'read':!![],'readAt':_0x2ff510[_0xdf19('0x63')]['statuses'][0x0][_0xdf19('0x88')]},{'where':{'messageId':_0x2ff510[_0xdf19('0x63')][_0xdf19('0x86')][0x0][_0xdf19('0x89')]},'individualHooks':!![]})['then'](function(_0x484cf0){return _0x23757a[_0xdf19('0x2c')](0xc8)[_0xdf19('0x2e')](_0x484cf0);});}_0x3fddc7['applications']=_[_0xdf19('0x8a')](_0xd6cf23[_0xdf19('0x8b')],[_0xdf19('0x81')],[_0xdf19('0x8c')]);if(_0x3fddc7[_0xdf19('0x85')]['Applications']){delete _0x3fddc7[_0xdf19('0x85')][_0xdf19('0x8b')];}return db['CmContact']['describe']()[_0xdf19('0x1f')](function(_0x24cb67){if(!_0x24cb67){throw new db[(_0xdf19('0x8d'))][(_0xdf19('0x8e'))]('no\x20available\x20attributes');}_0x522eb0=_[_0xdf19('0x8f')](_[_0xdf19('0x45')](_0x24cb67),[_0xdf19('0x90'),_0xdf19('0x91')]);_0x47262d=_[_0xdf19('0x8f')](_['keys'](_0x24cb67),[_0xdf19('0x90'),_0xdf19('0x91'),_0xdf19('0x92'),_0xdf19('0x93')]);_0x3fddc7[_0xdf19('0x63')]={'mapKey':'mobile'};if(_0x3fddc7['account']&&_0x3fddc7['account'][_0xdf19('0x42')]==='twilio'){_0x3fddc7['body']['from']=_0x2ff510['body'][_0xdf19('0x94')]['replace'](_0xdf19('0x95'),'');_0x3fddc7['body']['body']=_0x2ff510[_0xdf19('0x63')]['Body'];_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x96')]=_0x2ff510[_0xdf19('0x63')][_0xdf19('0x97')];}if(_0x3fddc7['account']&&_0x3fddc7[_0xdf19('0x85')][_0xdf19('0x42')]===_0xdf19('0x98')){_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x99')]=_0x2ff510[_0xdf19('0x63')][_0xdf19('0x9a')][0x0][_0xdf19('0x99')];_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x63')]=_0x2ff510['body'][_0xdf19('0x9a')][0x0][_0xdf19('0x27')][_0xdf19('0x63')];_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x96')]=_0x2ff510[_0xdf19('0x63')][_0xdf19('0x9a')][0x0][_0xdf19('0x89')];}if(_0x3fddc7['body']['id']){delete _0x3fddc7['body']['id'];}if(_['isNil'](_0x3fddc7['body'][_0xdf19('0x99')])){throw new db[(_0xdf19('0x8d'))][(_0xdf19('0x8e'))](_0xdf19('0x9b'));}if(_[_0xdf19('0x9c')](_0x3fddc7['body']['body'])||_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x63')]===''){throw new db[(_0xdf19('0x8d'))][(_0xdf19('0x8e'))](_0xdf19('0x9d'));}if(_[_0xdf19('0x9c')](_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x9e')])){throw new db[(_0xdf19('0x8d'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x47262d);}if(!_[_0xdf19('0x9f')](_0x47262d,_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x9e')])){throw new db[(_0xdf19('0x8d'))][(_0xdf19('0x8e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x47262d);}_0x5013ee[_0x3fddc7['body'][_0xdf19('0x9e')]]=_0x3fddc7[_0xdf19('0x63')]['from'];return db[_0xdf19('0xa0')][_0xdf19('0x5b')]({'where':{'id':_0x3fddc7[_0xdf19('0x85')][_0xdf19('0x93')]},'include':[{'model':db[_0xdf19('0xa1')],'as':_0xdf19('0xa2'),'where':_0x5013ee,'limit':0x1,'order':[[_0xdf19('0x91'),'DESC']]}]});})[_0xdf19('0x1f')](handleEntityNotFound(_0x23757a,null))[_0xdf19('0x1f')](function(_0x9f27a1){if(_0x9f27a1){_0x3fddc7[_0xdf19('0xa3')]=_[_0xdf19('0x6e')](_0x9f27a1,[_0xdf19('0xa2')]);if(_0x9f27a1['Contacts'][_0xdf19('0x4a')]){return _0x9f27a1[_0xdf19('0xa2')][0x0];}var _0x57b921=_[_0xdf19('0x18')](_0x3fddc7[_0xdf19('0x63')],{'firstName':_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x99')],'ListId':_0x9f27a1['id']});_0x57b921[_0x3fddc7['body']['mapKey']]=_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x99')];return db['CmContact']['create'](_0x57b921,{'fields':_0x522eb0,'raw':!![]});}})[_0xdf19('0x1f')](handleEntityNotFound(_0x23757a,null))['then'](function(_0x5e21d7){if(_0x5e21d7){_0x3fddc7['contact']=_0x5e21d7;var _0x347ba3={'ContactId':_0x5e21d7['id'],'phone':_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x99')],'WhatsappAccountId':_0x2ff510['params']['id']};var _0x50c863={'ContactId':_0x5e21d7['id'],'WhatsappAccountId':_0x2ff510[_0xdf19('0x64')]['id'],'closed':![]};return db[_0xdf19('0xa4')][_0xdf19('0x5b')]({'where':_0x50c863})[_0xdf19('0x1f')](function(_0x96682a){if(_0x96682a){return[_0x96682a,![]];}return db[_0xdf19('0xa4')]['create'](_0x347ba3)[_0xdf19('0x1f')](function(_0x3ffad2){return[_0x3ffad2,!![]];});});}})['spread'](function(_0x25aa9f,_0x1c0fa1){_0x3fddc7[_0xdf19('0xa5')]=_0x25aa9f[_0xdf19('0x38')]({'plain':!![]});_0x3fddc7[_0xdf19('0xa5')]['created']=![];if(_0x1c0fa1){if(_0x3fddc7['account'][_0xdf19('0xa6')]){_0x3fddc7[_0xdf19('0xa7')][_0xdf19('0xa8')]({'id':0x0,'priority':_0x3fddc7[_0xdf19('0xa7')]['length']+0x1,'app':'close','appdata':_0xdf19('0xa9'),'interval':'*,*,*,*'});}_0x3fddc7[_0xdf19('0xa5')]['created']=!![];}return db[_0xdf19('0xaa')]['create']({'phone':_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x99')],'messageId':_0x3fddc7['body'][_0xdf19('0x96')],'body':_0x3fddc7[_0xdf19('0x63')]['body'],'WhatsappAccountId':_0x2ff510[_0xdf19('0x64')]['id'],'WhatsappInteractionId':_0x25aa9f['id'],'direction':'in','ContactId':_0x25aa9f[_0xdf19('0xab')],'AttachmentId':_0x3fddc7[_0xdf19('0x63')][_0xdf19('0xac')]});})[_0xdf19('0x1f')](function(_0x3ea6ed){_0x3fddc7[_0xdf19('0x27')]=_0x3ea6ed;if(!_0x3fddc7[_0xdf19('0xa5')][_0xdf19('0xad')])return;return db[_0xdf19('0x77')][_0xdf19('0x5b')]({'attributes':['id','name'],'where':{'id':_0x3fddc7[_0xdf19('0xa5')][_0xdf19('0xad')]}});})[_0xdf19('0x1f')](function(_0x211e1f){if(_0x211e1f){_0x3fddc7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xdf19('0xae'),'appdata':_0x211e1f[_0xdf19('0x3b')]+','+(_0x3fddc7[_0xdf19('0x85')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x3fddc7[_0xdf19('0xa5')][_0xdf19('0xaf')])return;return db[_0xdf19('0xb0')]['find']({'attributes':['id',_0xdf19('0x3b')],'where':{'id':_0x3fddc7[_0xdf19('0xa5')][_0xdf19('0xaf')]}});})[_0xdf19('0x1f')](function(_0x597415){if(_0x597415){_0x3fddc7['applications'][_0xdf19('0xb1')]({'id':0x0,'priority':0x1,'app':_0xdf19('0xb2'),'appdata':_0x597415[_0xdf19('0x3b')]+','+(_0x3fddc7[_0xdf19('0x85')][_0xdf19('0xb3')]||0x12c),'interval':_0xdf19('0xb4')});}return respondWithRpcPromise(_0xdf19('0xb5'),_0xdf19('0xb6'),_0x3fddc7);})[_0xdf19('0x1f')](function(_0x503188){if(_0x503188){var _0x4712c5=0xc8;var _0xadf206='receiveMessage';logger[_0xdf19('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xadf206,_0x4712c5,_0xdf19('0xb7'));logger['debug'](_0xdf19('0xb8'),_0xadf206,_0x4712c5,'entity\x20found',JSON['stringify'](_0x503188));if(_0x3fddc7[_0xdf19('0x85')]['type']===_0xdf19('0xb9')){return _0x23757a[_0xdf19('0x2c')](_0x4712c5)[_0xdf19('0x33')](_0xdf19('0xba'),_0xdf19('0xbb'))[_0xdf19('0x3c')](_0xdf19('0xbc'));}else{return _0x23757a[_0xdf19('0x2c')](_0x4712c5)['json'](_0x503188);}}});})[_0xdf19('0x2a')](handleError(_0x23757a,null));};exports[_0xdf19('0x3c')]=function(_0xb6799e,_0xd96729,_0x5322a0){var _0x279d3e,_0x1976b6,_0x111517;if(_['isNil'](_0xb6799e['body'][_0xdf19('0x63')])||_0xb6799e['body'][_0xdf19('0x63')]===''){throw new db['Sequelize'][(_0xdf19('0x8e'))](_0xdf19('0x9d'));}if(_[_0xdf19('0x9c')](_0xb6799e['body']['to'])){throw new db['Sequelize'][(_0xdf19('0x8e'))]('to\x20is\x20mandatory');}_0x279d3e=_0xb6799e['body']['to'];return db[_0xdf19('0x53')][_0xdf19('0x5b')]({'where':{'id':_0xb6799e[_0xdf19('0x64')]['id']},'include':[{'model':db[_0xdf19('0xa0')],'as':_0xdf19('0xbd'),'include':[{'model':db[_0xdf19('0xa1')],'as':'Contacts','where':{'mobile':_0x279d3e},'limit':0x1,'order':[[_0xdf19('0x91'),_0xdf19('0xbe')]]}]}]})[_0xdf19('0x1f')](handleEntityNotFound(_0xd96729,null))[_0xdf19('0x1f')](function(_0x207a0d){if(_0x207a0d&&_0x207a0d[_0xdf19('0xbd')]){_0x1976b6=_0x207a0d[_0xdf19('0x38')]({'plain':!![]});if(_0x1976b6['List']&&_0x1976b6[_0xdf19('0xbd')][_0xdf19('0xa2')][_0xdf19('0x4a')]){return _0x1976b6['List']['Contacts'][0x0];}return db['CmContact'][_0xdf19('0x5c')](_[_0xdf19('0x18')](_0xb6799e[_0xdf19('0x63')],{'firstName':_0x279d3e,'mobile':_0x279d3e,'phone':_0x279d3e,'ListId':_0x1976b6['ListId']}));}})['then'](handleEntityNotFound(_0xd96729,null))[_0xdf19('0x1f')](function(_0x212075){if(_0x212075){_0x111517=_0x212075;return db[_0xdf19('0xa4')][_0xdf19('0x5b')]({'where':{'ContactId':_0x111517['id'],'closed':![],'WhatsappAccountId':_0x1976b6['id']}})[_0xdf19('0x1f')](function(_0xf5d429){if(_0xf5d429){return[_0xf5d429,![]];}return db['WhatsappInteraction'][_0xdf19('0x5c')]({'UserId':_0xb6799e[_0xdf19('0x5d')]['id'],'ContactId':_0x111517['id'],'WhatsappAccountId':_0x1976b6['id'],'phone':_0x279d3e,'firstMsgDirection':_0xdf19('0xbf'),'Messages':[_['merge'](_0xb6799e[_0xdf19('0x63')],{'read':![],'body':_0xb6799e[_0xdf19('0x63')][_0xdf19('0x63')],'phone':_0x279d3e,'WhatsappAccountId':_0x1976b6['id'],'UserId':_0xb6799e[_0xdf19('0x5d')]['id'],'ContactId':_0x111517['id']})]},{'include':[{'model':db[_0xdf19('0xaa')],'as':_0xdf19('0xc0')}]})[_0xdf19('0x1f')](function(_0x3668f1){return[_0x3668f1,!![]];});});}})[_0xdf19('0x6f')](function(_0x2530e4,_0x33775c){if(_0x33775c){return _0x2530e4;}return db[_0xdf19('0xaa')][_0xdf19('0x5c')](_['merge'](_0xb6799e[_0xdf19('0x63')],{'read':![],'body':_0xb6799e[_0xdf19('0x63')][_0xdf19('0x63')],'phone':_0x279d3e,'WhatsappAccountId':_0x1976b6['id'],'WhatsappInteractionId':_0x2530e4['id'],'UserId':_0xb6799e['user']['id'],'ContactId':_0x111517['id']}))['then'](function(_0x5d4bdb){_0x2530e4[_0xdf19('0xc1')][_0xdf19('0xc0')]=[];_0x2530e4['dataValues']['Messages'][_0xdf19('0xa8')](_0x5d4bdb[_0xdf19('0xc1')]);return _0x2530e4;});})[_0xdf19('0x1f')](respondWithResult(_0xd96729,null))[_0xdf19('0x2a')](handleError(_0xd96729,null));}; \ No newline at end of file +var _0x4381=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','rawAttributes','sort','pick','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','message_id','applications','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','whatsapp:','Body','messageId','MessageSid','notifications','from','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','omit','Contacts','contact','interaction','created','autoclose','push','unmanaged','ContactId','UserId','User','agent','waitForTheAssignedAgent','queueId','unshift','waitForTheAssignedQueue','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','WhatsappInteraction','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','WhatsappAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','create'];(function(_0x4aba34,_0x31344d){var _0xfc4353=function(_0x223dc5){while(--_0x223dc5){_0x4aba34['push'](_0x4aba34['shift']());}};_0xfc4353(++_0x31344d);}(_0x4381,0x1f1));var _0x1438=function(_0x3fbfd8,_0x50fd0f){_0x3fbfd8=_0x3fbfd8-0x0;var _0x2fe839=_0x4381[_0x3fbfd8];return _0x2fe839;};'use strict';var emlformat=require(_0x1438('0x0'));var rimraf=require(_0x1438('0x1'));var zipdir=require(_0x1438('0x2'));var jsonpatch=require(_0x1438('0x3'));var rp=require(_0x1438('0x4'));var moment=require(_0x1438('0x5'));var BPromise=require(_0x1438('0x6'));var Mustache=require(_0x1438('0x7'));var util=require(_0x1438('0x8'));var path=require(_0x1438('0x9'));var sox=require('sox');var csv=require(_0x1438('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1438('0xb'));var _=require('lodash');var squel=require(_0x1438('0xc'));var crypto=require(_0x1438('0xd'));var jsforce=require(_0x1438('0xe'));var deskjs=require(_0x1438('0xf'));var toCsv=require(_0x1438('0xa'));var querystring=require(_0x1438('0x10'));var Papa=require(_0x1438('0x11'));var Redis=require(_0x1438('0x12'));var authService=require(_0x1438('0x13'));var qs=require(_0x1438('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1438('0x15'))(_0x1438('0x16'));var utils=require('../../config/utils');var config=require(_0x1438('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1438('0x18'))['db'];config[_0x1438('0x19')]=_[_0x1438('0x1a')](config[_0x1438('0x19')],{'host':_0x1438('0x1b'),'port':0x18eb});var socket=require(_0x1438('0x1c'))(new Redis(config[_0x1438('0x19')]));require(_0x1438('0x1d'))[_0x1438('0x1e')](socket);var jayson=require(_0x1438('0x1f'));var client=jayson[_0x1438('0x20')][_0x1438('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x36c0fd,_0x2d1b84,_0x20b8e6,_0x2eb2bb){return new BPromise(function(_0xaf4596,_0x296c21){var _0x35d055=_0x2eb2bb||client;return _0x35d055['request'](_0x36c0fd,_0x20b8e6)['then'](function(_0x5029c5){logger[_0x1438('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x2d1b84,'request\x20sent');logger[_0x1438('0x23')](_0x1438('0x24'),_0x2d1b84,_0x1438('0x25'),JSON[_0x1438('0x26')](_0x5029c5));if(_0x5029c5[_0x1438('0x27')]){if(_0x5029c5[_0x1438('0x27')][_0x1438('0x28')]===0x1f4){logger[_0x1438('0x27')](_0x1438('0x29'),_0x2d1b84,_0x5029c5['error'][_0x1438('0x2a')]);return _0x296c21(_0x5029c5[_0x1438('0x27')][_0x1438('0x2a')]);}logger[_0x1438('0x27')](_0x1438('0x29'),_0x2d1b84,_0x5029c5[_0x1438('0x27')][_0x1438('0x2a')]);return _0xaf4596(_0x5029c5[_0x1438('0x27')][_0x1438('0x2a')]);}else{logger[_0x1438('0x22')](_0x1438('0x29'),_0x2d1b84,_0x1438('0x25'));_0xaf4596(_0x5029c5[_0x1438('0x2b')][_0x1438('0x2a')]);}})[_0x1438('0x2c')](function(_0x49fab3){logger[_0x1438('0x27')](_0x1438('0x29'),_0x2d1b84,_0x49fab3);_0x296c21(_0x49fab3);});});}function respondWithStatusCode(_0x3e6280,_0x2c7099){_0x2c7099=_0x2c7099||0xcc;return function(_0x637417){if(_0x637417){return _0x3e6280[_0x1438('0x2d')](_0x2c7099);}return _0x3e6280['status'](_0x2c7099)['end']();};}function respondWithResult(_0x482f64,_0x51bec7){_0x51bec7=_0x51bec7||0xc8;return function(_0x20c2b2){if(_0x20c2b2){return _0x482f64[_0x1438('0x2e')](_0x51bec7)[_0x1438('0x2f')](_0x20c2b2);}};}function respondWithFilteredResult(_0x89d3b,_0x2ef5d1){return function(_0x4d18ed){if(_0x4d18ed){var _0x3768cf=typeof _0x2ef5d1[_0x1438('0x30')]==='undefined'&&typeof _0x2ef5d1[_0x1438('0x31')]===_0x1438('0x32');var _0x9131ee=_0x4d18ed[_0x1438('0x33')];var _0x46445b=_0x3768cf?0x0:_0x2ef5d1[_0x1438('0x30')];var _0x5b9c3f=_0x3768cf?_0x4d18ed[_0x1438('0x33')]:_0x2ef5d1[_0x1438('0x30')]+_0x2ef5d1[_0x1438('0x31')];var _0x462b22;if(_0x5b9c3f>=_0x9131ee){_0x5b9c3f=_0x9131ee;_0x462b22=0xc8;}else{_0x462b22=0xce;}_0x89d3b[_0x1438('0x2e')](_0x462b22);return _0x89d3b[_0x1438('0x34')](_0x1438('0x35'),_0x46445b+'-'+_0x5b9c3f+'/'+_0x9131ee)[_0x1438('0x2f')](_0x4d18ed);}return null;};}function patchUpdates(_0x1712a4){return function(_0x2992b8){try{jsonpatch[_0x1438('0x36')](_0x2992b8,_0x1712a4,!![]);}catch(_0x226874){return BPromise[_0x1438('0x37')](_0x226874);}return _0x2992b8['save']();};}function saveUpdates(_0x48c7b2,_0x1d7f98){return function(_0x332351){if(_0x332351){return _0x332351[_0x1438('0x38')](_0x48c7b2)[_0x1438('0x39')](function(_0x4139ad){return _0x4139ad;});}return null;};}function removeEntity(_0x1574f5,_0x1e6a9a){return function(_0x28685f){if(_0x28685f){return _0x28685f[_0x1438('0x3a')]()[_0x1438('0x39')](function(){var _0x11dc17=_0x28685f['get']({'plain':!![]});var _0x1c3c15=_0x1438('0x3b');return db[_0x1438('0x3c')][_0x1438('0x3a')]({'where':{'type':_0x1c3c15,'resourceId':_0x11dc17['id']}})[_0x1438('0x39')](function(){return _0x28685f;});})[_0x1438('0x39')](function(){_0x1574f5[_0x1438('0x2e')](0xcc)[_0x1438('0x3d')]();});}};}function handleEntityNotFound(_0x5a7a70,_0x23b6d7){return function(_0x21f7d9){if(!_0x21f7d9){_0x5a7a70['sendStatus'](0x194);}return _0x21f7d9;};}function handleError(_0x1993a7,_0x5b4ca3){_0x5b4ca3=_0x5b4ca3||0x1f4;return function(_0x27c764){logger[_0x1438('0x27')](_0x27c764[_0x1438('0x3e')]);if(_0x27c764[_0x1438('0x3f')]){delete _0x27c764['name'];}_0x1993a7[_0x1438('0x2e')](_0x5b4ca3)[_0x1438('0x40')](_0x27c764);};}exports[_0x1438('0x41')]=function(_0x38b36c,_0x32752c){var _0x132eac={'include':[{'model':db[_0x1438('0x42')],'as':_0x1438('0x43')}]},_0x5c8d8c={},_0x368e9f={'count':0x0,'rows':[]};var _0x68310a=_[_0x1438('0x44')](db[_0x1438('0x45')]['rawAttributes'],function(_0xf1803a){return{'name':_0xf1803a[_0x1438('0x46')],'type':_0xf1803a[_0x1438('0x47')][_0x1438('0x48')]};});_0x5c8d8c[_0x1438('0x49')]=_['map'](_0x68310a,_0x1438('0x3f'));_0x5c8d8c[_0x1438('0x4a')]=_[_0x1438('0x4b')](_0x38b36c[_0x1438('0x4a')]);_0x5c8d8c[_0x1438('0x4c')]=_[_0x1438('0x4d')](_0x5c8d8c['model'],_0x5c8d8c[_0x1438('0x4a')]);_0x132eac[_0x1438('0x4e')]=_[_0x1438('0x4d')](_0x5c8d8c[_0x1438('0x49')],qs[_0x1438('0x4f')](_0x38b36c[_0x1438('0x4a')][_0x1438('0x4f')]));_0x132eac['attributes']=_0x132eac[_0x1438('0x4e')]['length']?_0x132eac[_0x1438('0x4e')]:_0x5c8d8c['model'];if(!_0x38b36c['query'][_0x1438('0x50')](_0x1438('0x51'))){_0x132eac[_0x1438('0x31')]=qs[_0x1438('0x31')](_0x38b36c[_0x1438('0x4a')][_0x1438('0x31')]);_0x132eac[_0x1438('0x30')]=qs['offset'](_0x38b36c[_0x1438('0x4a')][_0x1438('0x30')]);}_0x132eac[_0x1438('0x52')]=qs['sort'](_0x38b36c[_0x1438('0x4a')]['sort']);_0x132eac['where']=qs[_0x1438('0x4c')](_['pick'](_0x38b36c[_0x1438('0x4a')],_0x5c8d8c[_0x1438('0x4c')]),_0x68310a);if(_0x38b36c[_0x1438('0x4a')][_0x1438('0x53')]){_0x132eac[_0x1438('0x54')]=_['merge'](_0x132eac['where'],{'$or':_[_0x1438('0x44')](_0x68310a,function(_0x5af64c){if(_0x5af64c[_0x1438('0x47')]!==_0x1438('0x55')){var _0x44c79d={};_0x44c79d[_0x5af64c[_0x1438('0x3f')]]={'$like':'%'+_0x38b36c['query'][_0x1438('0x53')]+'%'};return _0x44c79d;}})});}_0x132eac=_[_0x1438('0x56')]({},_0x132eac,_0x38b36c[_0x1438('0x57')]);var _0x5a8d45={'where':_0x132eac['where']};return db[_0x1438('0x45')][_0x1438('0x33')](_0x5a8d45)['then'](function(_0x4060b1){_0x368e9f[_0x1438('0x33')]=_0x4060b1;if(_0x38b36c['query'][_0x1438('0x58')]){_0x132eac[_0x1438('0x59')]=[{'all':!![]}];}return db[_0x1438('0x45')][_0x1438('0x5a')](_0x132eac);})[_0x1438('0x39')](function(_0x17058b){_0x368e9f[_0x1438('0x5b')]=_0x17058b;return _0x368e9f;})[_0x1438('0x39')](respondWithFilteredResult(_0x32752c,_0x132eac))[_0x1438('0x2c')](handleError(_0x32752c,null));};exports['show']=function(_0x1165ed,_0x484294){var _0xcce4ad={'raw':![],'where':{'id':_0x1165ed[_0x1438('0x5c')]['id']},'include':[{'model':db[_0x1438('0x42')],'as':_0x1438('0x43')}]},_0x4361d9={};_0x4361d9[_0x1438('0x49')]=_[_0x1438('0x4b')](db['WhatsappAccount']['rawAttributes']);_0x4361d9[_0x1438('0x4a')]=_[_0x1438('0x4b')](_0x1165ed[_0x1438('0x4a')]);_0x4361d9[_0x1438('0x4c')]=_[_0x1438('0x4d')](_0x4361d9[_0x1438('0x49')],_0x4361d9[_0x1438('0x4a')]);_0xcce4ad[_0x1438('0x4e')]=_[_0x1438('0x4d')](_0x4361d9[_0x1438('0x49')],qs[_0x1438('0x4f')](_0x1165ed[_0x1438('0x4a')][_0x1438('0x4f')]));_0xcce4ad[_0x1438('0x4e')]=_0xcce4ad[_0x1438('0x4e')][_0x1438('0x5d')]?_0xcce4ad[_0x1438('0x4e')]:_0x4361d9['model'];if(_0x1165ed[_0x1438('0x4a')][_0x1438('0x58')]){_0xcce4ad[_0x1438('0x59')]=[{'all':!![]}];}_0xcce4ad=_[_0x1438('0x56')]({},_0xcce4ad,_0x1165ed[_0x1438('0x57')]);return db[_0x1438('0x45')][_0x1438('0x5e')](_0xcce4ad)[_0x1438('0x39')](handleEntityNotFound(_0x484294,null))[_0x1438('0x39')](respondWithResult(_0x484294,null))['catch'](handleError(_0x484294,null));};exports['create']=function(_0xa1e004,_0x1a93d3){return db[_0x1438('0x45')]['create'](_0xa1e004[_0x1438('0x5f')],{})[_0x1438('0x39')](function(_0x37cc4a){var _0x2e90a4=_0xa1e004[_0x1438('0x60')]['get']({'plain':!![]});if(!_0x2e90a4)throw new Error(_0x1438('0x61'));if(_0x2e90a4[_0x1438('0x62')]===_0x1438('0x60')){var _0x4b7ac5=_0x37cc4a[_0x1438('0x63')]({'plain':!![]});var _0x2daa59=_0x1438('0x3b');return db['UserProfileSection'][_0x1438('0x5e')]({'where':{'name':_0x2daa59,'userProfileId':_0x2e90a4[_0x1438('0x64')]},'raw':!![]})[_0x1438('0x39')](function(_0x14b7b9){if(_0x14b7b9&&_0x14b7b9[_0x1438('0x65')]===0x0){return db[_0x1438('0x3c')][_0x1438('0x66')]({'name':_0x4b7ac5[_0x1438('0x3f')],'resourceId':_0x4b7ac5['id'],'type':_0x14b7b9[_0x1438('0x3f')],'sectionId':_0x14b7b9['id']},{})[_0x1438('0x39')](function(){return _0x37cc4a;});}else{return _0x37cc4a;}})['catch'](function(_0x13f700){logger['error'](_0x1438('0x67'),_0x13f700);throw _0x13f700;});}return _0x37cc4a;})[_0x1438('0x39')](respondWithResult(_0x1a93d3,0xc9))['catch'](handleError(_0x1a93d3,null));};exports[_0x1438('0x38')]=function(_0x1f054f,_0x293993){if(_0x1f054f['body']['id']){delete _0x1f054f[_0x1438('0x5f')]['id'];}return db[_0x1438('0x45')][_0x1438('0x5e')]({'where':{'id':_0x1f054f[_0x1438('0x5c')]['id']},'include':[{'model':db[_0x1438('0x42')],'as':_0x1438('0x43')}]})[_0x1438('0x39')](handleEntityNotFound(_0x293993,null))[_0x1438('0x39')](saveUpdates(_0x1f054f[_0x1438('0x5f')],null))['then'](respondWithResult(_0x293993,null))[_0x1438('0x2c')](handleError(_0x293993,null));};exports[_0x1438('0x3a')]=function(_0x109172,_0x2b8772){return db['WhatsappAccount'][_0x1438('0x5e')]({'where':{'id':_0x109172[_0x1438('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2b8772,null))[_0x1438('0x39')](removeEntity(_0x2b8772,null))['catch'](handleError(_0x2b8772,null));};exports['describe']=function(_0x2bbfac,_0x44a960){return db[_0x1438('0x45')][_0x1438('0x68')]()['then'](respondWithResult(_0x44a960,null))[_0x1438('0x2c')](handleError(_0x44a960,null));};exports[_0x1438('0x69')]=function(_0xe0ac2d,_0x1662bf,_0x48b967){if(_0xe0ac2d[_0x1438('0x5f')]['id']){delete _0xe0ac2d[_0x1438('0x5f')]['id'];}return db[_0x1438('0x45')][_0x1438('0x5e')]({'where':{'id':_0xe0ac2d[_0x1438('0x5c')]['id']}})[_0x1438('0x39')](handleEntityNotFound(_0x1662bf,null))[_0x1438('0x39')](function(_0x35e56d){if(_0x35e56d){_0xe0ac2d[_0x1438('0x5f')][_0x1438('0x6a')]=_0x35e56d['id'];return db[_0x1438('0x6b')]['create'](_0xe0ac2d[_0x1438('0x5f')]);}})[_0x1438('0x39')](respondWithResult(_0x1662bf,null))['catch'](handleError(_0x1662bf,null));};exports['getDispositions']=function(_0x317275,_0xf5afa3,_0x1b812f){var _0x43f1ef={'raw':![],'where':{}};var _0xd80b21={};var _0x3545bd={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x317275[_0x1438('0x5c')]['id']}})['then'](handleEntityNotFound(_0xf5afa3,null))[_0x1438('0x39')](function(_0x56e7b8){if(_0x56e7b8){_0xd80b21['model']=_[_0x1438('0x4b')](db[_0x1438('0x6b')][_0x1438('0x6c')]);_0xd80b21[_0x1438('0x4a')]=_['keys'](_0x317275[_0x1438('0x4a')]);_0xd80b21[_0x1438('0x4c')]=_[_0x1438('0x4d')](_0xd80b21[_0x1438('0x49')],_0xd80b21['query']);_0x43f1ef[_0x1438('0x4e')]=_[_0x1438('0x4d')](_0xd80b21[_0x1438('0x49')],qs[_0x1438('0x4f')](_0x317275[_0x1438('0x4a')][_0x1438('0x4f')]));_0x43f1ef['attributes']=_0x43f1ef[_0x1438('0x4e')][_0x1438('0x5d')]?_0x43f1ef[_0x1438('0x4e')]:_0xd80b21['model'];if(!_0x317275[_0x1438('0x4a')][_0x1438('0x50')](_0x1438('0x51'))){_0x43f1ef[_0x1438('0x31')]=qs[_0x1438('0x31')](_0x317275[_0x1438('0x4a')]['limit']);_0x43f1ef[_0x1438('0x30')]=qs['offset'](_0x317275['query'][_0x1438('0x30')]);}_0x43f1ef[_0x1438('0x52')]=qs[_0x1438('0x6d')](_0x317275[_0x1438('0x4a')]['sort']);_0x43f1ef[_0x1438('0x54')]=qs[_0x1438('0x4c')](_[_0x1438('0x6e')](_0x317275['query'],_0xd80b21[_0x1438('0x4c')]));_0x43f1ef[_0x1438('0x54')][_0x1438('0x6a')]=_0x56e7b8['id'];if(_0x317275[_0x1438('0x4a')][_0x1438('0x53')]){_0x43f1ef[_0x1438('0x54')]=_[_0x1438('0x56')](_0x43f1ef[_0x1438('0x54')],{'$or':_[_0x1438('0x44')](_0x43f1ef[_0x1438('0x4e')],function(_0x1f3ea3){var _0x2d4743={};_0x2d4743[_0x1f3ea3]={'$like':'%'+_0x317275['query'][_0x1438('0x53')]+'%'};return _0x2d4743;})});}_0x43f1ef=_[_0x1438('0x56')]({},_0x43f1ef,_0x317275['options']);return db[_0x1438('0x6b')][_0x1438('0x33')]({'where':_0x43f1ef[_0x1438('0x54')]})['then'](function(_0x2f8aa9){_0x3545bd[_0x1438('0x33')]=_0x2f8aa9;if(_0x317275[_0x1438('0x4a')]['includeAll']){_0x43f1ef[_0x1438('0x59')]=[{'all':!![]}];}return db[_0x1438('0x6b')][_0x1438('0x5a')](_0x43f1ef);})[_0x1438('0x39')](function(_0x23692d){_0x3545bd[_0x1438('0x5b')]=_0x23692d;return _0x3545bd;});}})[_0x1438('0x39')](respondWithFilteredResult(_0xf5afa3,_0x43f1ef))[_0x1438('0x2c')](handleError(_0xf5afa3,null));};exports['removeDispositions']=function(_0x26cd8a,_0x1e10ac,_0x5cd350){return db['WhatsappAccount'][_0x1438('0x5e')]({'where':{'id':_0x26cd8a[_0x1438('0x5c')]['id']}})[_0x1438('0x39')](handleEntityNotFound(_0x1e10ac,null))[_0x1438('0x39')](function(_0x2749e8){if(_0x2749e8){return _0x2749e8[_0x1438('0x6f')](_0x26cd8a['query'][_0x1438('0x70')]);}})[_0x1438('0x39')](respondWithStatusCode(_0x1e10ac,null))[_0x1438('0x2c')](handleError(_0x1e10ac,null));};exports[_0x1438('0x71')]=function(_0x14255c,_0x276e30,_0x435040){if(_0x14255c[_0x1438('0x5f')]['id']){delete _0x14255c[_0x1438('0x5f')]['id'];}return db[_0x1438('0x45')]['find']({'where':{'id':_0x14255c[_0x1438('0x5c')]['id']}})['then'](handleEntityNotFound(_0x276e30,null))['then'](function(_0x1c6711){if(_0x1c6711){_0x14255c['body']['WhatsappAccountId']=_0x1c6711['id'];return db[_0x1438('0x72')][_0x1438('0x66')](_0x14255c[_0x1438('0x5f')]);}})[_0x1438('0x39')](respondWithResult(_0x276e30,null))[_0x1438('0x2c')](handleError(_0x276e30,null));};exports['getAnswers']=function(_0x3b6159,_0x2fd66d,_0x474184){var _0x36d08a={'raw':![],'where':{}};var _0x8e7a2e={};var _0x3dcb8f={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x1438('0x73')]({'where':{'id':_0x3b6159[_0x1438('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2fd66d,null))['then'](function(_0x48f0f6){if(_0x48f0f6){_0x8e7a2e[_0x1438('0x49')]=_['keys'](db['CannedAnswer'][_0x1438('0x6c')]);_0x8e7a2e[_0x1438('0x4a')]=_[_0x1438('0x4b')](_0x3b6159['query']);_0x8e7a2e[_0x1438('0x4c')]=_[_0x1438('0x4d')](_0x8e7a2e[_0x1438('0x49')],_0x8e7a2e['query']);_0x36d08a[_0x1438('0x4e')]=_[_0x1438('0x4d')](_0x8e7a2e[_0x1438('0x49')],qs[_0x1438('0x4f')](_0x3b6159[_0x1438('0x4a')]['fields']));_0x36d08a[_0x1438('0x4e')]=_0x36d08a['attributes'][_0x1438('0x5d')]?_0x36d08a['attributes']:_0x8e7a2e[_0x1438('0x49')];if(!_0x3b6159[_0x1438('0x4a')][_0x1438('0x50')]('nolimit')){_0x36d08a[_0x1438('0x31')]=qs[_0x1438('0x31')](_0x3b6159[_0x1438('0x4a')][_0x1438('0x31')]);_0x36d08a[_0x1438('0x30')]=qs['offset'](_0x3b6159[_0x1438('0x4a')]['offset']);}_0x36d08a[_0x1438('0x52')]=qs[_0x1438('0x6d')](_0x3b6159[_0x1438('0x4a')][_0x1438('0x6d')]);_0x36d08a[_0x1438('0x54')]=qs[_0x1438('0x4c')](_['pick'](_0x3b6159[_0x1438('0x4a')],_0x8e7a2e['filters']));_0x36d08a['where'][_0x1438('0x6a')]=_0x48f0f6['id'];if(_0x3b6159[_0x1438('0x4a')][_0x1438('0x53')]){_0x36d08a[_0x1438('0x54')]=_[_0x1438('0x56')](_0x36d08a[_0x1438('0x54')],{'$or':_['map'](_0x36d08a[_0x1438('0x4e')],function(_0x2592e2){var _0x80071a={};_0x80071a[_0x2592e2]={'$like':'%'+_0x3b6159[_0x1438('0x4a')][_0x1438('0x53')]+'%'};return _0x80071a;})});}_0x36d08a=_[_0x1438('0x56')]({},_0x36d08a,_0x3b6159[_0x1438('0x57')]);return db['CannedAnswer']['count']({'where':_0x36d08a['where']})[_0x1438('0x39')](function(_0x34031c){_0x3dcb8f[_0x1438('0x33')]=_0x34031c;if(_0x3b6159[_0x1438('0x4a')][_0x1438('0x58')]){_0x36d08a['include']=[{'all':!![]}];}return db[_0x1438('0x72')][_0x1438('0x5a')](_0x36d08a);})[_0x1438('0x39')](function(_0x3f0c47){_0x3dcb8f['rows']=_0x3f0c47;return _0x3dcb8f;});}})[_0x1438('0x39')](respondWithFilteredResult(_0x2fd66d,_0x36d08a))[_0x1438('0x2c')](handleError(_0x2fd66d,null));};exports[_0x1438('0x74')]=function(_0x1d5b32,_0x1a054e,_0x31bbae){return db['WhatsappAccount']['find']({'where':{'id':_0x1d5b32['params']['id']}})[_0x1438('0x39')](handleEntityNotFound(_0x1a054e,null))[_0x1438('0x39')](function(_0xf9e319){if(_0xf9e319){return _0xf9e319[_0x1438('0x74')](_0x1d5b32[_0x1438('0x4a')][_0x1438('0x70')]);}})['then'](respondWithStatusCode(_0x1a054e,null))[_0x1438('0x2c')](handleError(_0x1a054e,null));};exports[_0x1438('0x75')]=function(_0x1e4527,_0x3a93d1,_0x35e275){return db[_0x1438('0x45')][_0x1438('0x5e')]({'where':{'id':_0x1e4527[_0x1438('0x5c')]['id']}})[_0x1438('0x39')](handleEntityNotFound(_0x3a93d1,null))['then'](function(_0x1465fd){if(_0x1465fd){return _0x1465fd[_0x1438('0x75')](_0x1e4527['body'][_0x1438('0x70')],_['omit'](_0x1e4527[_0x1438('0x5f')],[_0x1438('0x70'),'id'])||{})[_0x1438('0x76')](function(_0x11e1bb){for(var _0x5a95ca=0x0;_0x5a95ca<_0x1e4527['body'][_0x1438('0x70')]['length'];_0x5a95ca+=0x1){socket[_0x1438('0x77')](_0x1438('0x78'),{'UserId':Number(_0x1e4527['body'][_0x1438('0x70')][_0x5a95ca]),'WhatsappAccountId':Number(_0x1e4527[_0x1438('0x5c')]['id'])});}return _0x11e1bb;});}})[_0x1438('0x39')](respondWithResult(_0x3a93d1,null))[_0x1438('0x2c')](handleError(_0x3a93d1,null));};exports[_0x1438('0x79')]=function(_0x1515dc,_0x1865df,_0x54a27a){return db[_0x1438('0x45')]['find']({'where':{'id':_0x1515dc[_0x1438('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1865df,null))[_0x1438('0x39')](function(_0x1487f5){if(_0x1487f5){return _0x1487f5[_0x1438('0x79')](_0x1515dc[_0x1438('0x4a')][_0x1438('0x70')])[_0x1438('0x39')](function(){if(_['isArray'](_0x1515dc[_0x1438('0x4a')][_0x1438('0x70')])){for(var _0x30fd6e=0x0;_0x30fd6e<_0x1515dc[_0x1438('0x4a')][_0x1438('0x70')][_0x1438('0x5d')];_0x30fd6e+=0x1){socket[_0x1438('0x77')](_0x1438('0x7a'),{'UserId':Number(_0x1515dc['query'][_0x1438('0x70')][_0x30fd6e]),'WhatsappAccountId':Number(_0x1515dc[_0x1438('0x5c')]['id'])});}}else{socket[_0x1438('0x77')](_0x1438('0x7a'),{'UserId':Number(_0x1515dc[_0x1438('0x4a')]['ids']),'WhatsappAccountId':Number(_0x1515dc['params']['id'])});}});}})[_0x1438('0x39')](respondWithStatusCode(_0x1865df,null))[_0x1438('0x2c')](handleError(_0x1865df,null));};exports[_0x1438('0x7b')]=function(_0x3bc25f,_0x26755d,_0x44b2ac){var _0x5787c3={};var _0x925861={};var _0x362c95;var _0xd5f924;return db[_0x1438('0x45')][_0x1438('0x73')]({'where':{'id':_0x3bc25f[_0x1438('0x5c')]['id']}})[_0x1438('0x39')](handleEntityNotFound(_0x26755d,null))[_0x1438('0x39')](function(_0x3c6bbd){if(_0x3c6bbd){_0x362c95=_0x3c6bbd;_0x925861['model']=_[_0x1438('0x4b')](db['User'][_0x1438('0x6c')]);_0x925861['query']=_['keys'](_0x3bc25f[_0x1438('0x4a')]);_0x925861[_0x1438('0x4c')]=_[_0x1438('0x4d')](_0x925861[_0x1438('0x49')],_0x925861['query']);_0x5787c3[_0x1438('0x4e')]=_[_0x1438('0x4d')](_0x925861[_0x1438('0x49')],qs['fields'](_0x3bc25f[_0x1438('0x4a')][_0x1438('0x4f')]));_0x5787c3[_0x1438('0x4e')]=_0x5787c3[_0x1438('0x4e')][_0x1438('0x5d')]?_0x5787c3[_0x1438('0x4e')]:_0x925861[_0x1438('0x49')];_0x5787c3[_0x1438('0x52')]=qs[_0x1438('0x6d')](_0x3bc25f[_0x1438('0x4a')][_0x1438('0x6d')]);_0x5787c3[_0x1438('0x54')]=qs[_0x1438('0x4c')](_[_0x1438('0x6e')](_0x3bc25f['query'],_0x925861['filters']));if(_0x3bc25f[_0x1438('0x4a')][_0x1438('0x53')]){_0x5787c3[_0x1438('0x54')]=_[_0x1438('0x56')](_0x5787c3[_0x1438('0x54')],{'$or':_['map'](_0x5787c3[_0x1438('0x4e')],function(_0x575c01){var _0x5a27b6={};_0x5a27b6[_0x575c01]={'$like':'%'+_0x3bc25f[_0x1438('0x4a')]['filter']+'%'};return _0x5a27b6;})});}_0x5787c3=_[_0x1438('0x56')]({},_0x5787c3,_0x3bc25f[_0x1438('0x57')]);return _0x362c95['getAgents'](_0x5787c3);}})['then'](function(_0x718a8){if(_0x718a8){_0xd5f924=_0x718a8[_0x1438('0x5d')];if(!_0x3bc25f['query'][_0x1438('0x50')](_0x1438('0x51'))){_0x5787c3[_0x1438('0x31')]=qs['limit'](_0x3bc25f[_0x1438('0x4a')]['limit']);_0x5787c3[_0x1438('0x30')]=qs['offset'](_0x3bc25f[_0x1438('0x4a')][_0x1438('0x30')]);}return _0x362c95[_0x1438('0x7b')](_0x5787c3);}})['then'](function(_0x369299){if(_0x369299){return _0x369299?{'count':_0xd5f924,'rows':_0x369299}:null;}})[_0x1438('0x39')](respondWithResult(_0x26755d,null))[_0x1438('0x2c')](handleError(_0x26755d,null));};exports[_0x1438('0x7c')]=function(_0x40b2f9,_0x5d86ea){var _0x3c0198=_0x40b2f9['params']['id'];var _0x853c44=_0x40b2f9[_0x1438('0x5f')];var _0x3ff08c=0xc8;var _0x5e0081=null;return db[_0x1438('0x7d')][_0x1438('0x7e')]({'isolationLevel':db[_0x1438('0x7d')][_0x1438('0x7f')][_0x1438('0x80')]['READ_COMMITTED']},function(_0x1c9077){return db[_0x1438('0x45')]['findOne']({'where':{'id':_0x3c0198},'transaction':_0x1c9077})['then'](function(_0x1bc4ed){if(_0x1bc4ed){return db[_0x1438('0x81')][_0x1438('0x3a')]({'where':{'WhatsappAccountId':_0x3c0198},'transaction':_0x1c9077})[_0x1438('0x39')](function(){var _0x12b749=_[_0x1438('0x44')](_0x853c44,function(_0x3b5d0b){_0x3b5d0b[_0x1438('0x6a')]=_0x3c0198;return _0x3b5d0b;});return db[_0x1438('0x81')][_0x1438('0x82')](_0x12b749,{'transaction':_0x1c9077});});}else{_0x3ff08c=0x194;_0x5e0081=[];}});})[_0x1438('0x39')](function(){if(_0x3ff08c!==0x194){return db[_0x1438('0x81')][_0x1438('0x83')]({'where':{'WhatsappAccountId':_0x3c0198},'order':_0x1438('0x84')})['then'](function(_0x25833f){_0x5e0081=_0x25833f;});}})[_0x1438('0x2c')](function(_0x28f8e0){_0x3ff08c=0x1f4;logger[_0x1438('0x27')](_0x28f8e0[_0x1438('0x3e')]);if(_0x28f8e0['name']){delete _0x28f8e0[_0x1438('0x3f')];}_0x5e0081=_0x28f8e0;})['finally'](function(){if(_0x5e0081===null){_0x5d86ea['sendStatus'](_0x3ff08c);}else{if(_0x3ff08c===0x1f4){_0x5d86ea['status'](_0x3ff08c)['send'](_0x5e0081);}else{_0x5d86ea[_0x1438('0x2e')](_0x3ff08c)[_0x1438('0x2f')](_0x5e0081);}}});};exports[_0x1438('0x85')]=function(_0x480dcd,_0x512683,_0x3980c2){var _0x574d59={};var _0x9a883c={};var _0x102b8f;var _0x4feddd;return db['WhatsappAccount'][_0x1438('0x73')]({'where':{'id':_0x480dcd[_0x1438('0x5c')]['id']}})[_0x1438('0x39')](handleEntityNotFound(_0x512683,null))[_0x1438('0x39')](function(_0x525496){if(_0x525496){_0x102b8f=_0x525496;_0x9a883c['model']=_[_0x1438('0x4b')](db[_0x1438('0x81')]['rawAttributes']);_0x9a883c['query']=_[_0x1438('0x4b')](_0x480dcd['query']);_0x9a883c[_0x1438('0x4c')]=_['intersection'](_0x9a883c[_0x1438('0x49')],_0x9a883c[_0x1438('0x4a')]);_0x574d59[_0x1438('0x4e')]=_[_0x1438('0x4d')](_0x9a883c[_0x1438('0x49')],qs[_0x1438('0x4f')](_0x480dcd[_0x1438('0x4a')][_0x1438('0x4f')]));_0x574d59[_0x1438('0x4e')]=_0x574d59[_0x1438('0x4e')]['length']?_0x574d59[_0x1438('0x4e')]:_0x9a883c[_0x1438('0x49')];_0x574d59[_0x1438('0x52')]=qs[_0x1438('0x6d')](_0x480dcd[_0x1438('0x4a')][_0x1438('0x6d')]);_0x574d59[_0x1438('0x54')]=qs['filters'](_[_0x1438('0x6e')](_0x480dcd[_0x1438('0x4a')],_0x9a883c[_0x1438('0x4c')]));if(_0x480dcd[_0x1438('0x4a')][_0x1438('0x53')]){_0x574d59['where']=_[_0x1438('0x56')](_0x574d59[_0x1438('0x54')],{'$or':_[_0x1438('0x44')](_0x574d59[_0x1438('0x4e')],function(_0x1c3bf3){var _0x30ae25={};_0x30ae25[_0x1c3bf3]={'$like':'%'+_0x480dcd['query']['filter']+'%'};return _0x30ae25;})});}_0x574d59=_[_0x1438('0x56')]({},_0x574d59,_0x480dcd[_0x1438('0x57')]);return _0x102b8f['getApplications'](_0x574d59);}})['then'](function(_0x22206b){if(_0x22206b){_0x4feddd=_0x22206b[_0x1438('0x5d')];if(!_0x480dcd[_0x1438('0x4a')][_0x1438('0x50')](_0x1438('0x51'))){_0x574d59[_0x1438('0x31')]=qs[_0x1438('0x31')](_0x480dcd[_0x1438('0x4a')][_0x1438('0x31')]);_0x574d59['offset']=qs['offset'](_0x480dcd[_0x1438('0x4a')]['offset']);}return _0x102b8f['getApplications'](_0x574d59);}})[_0x1438('0x39')](function(_0x2dceb3){if(_0x2dceb3){return _0x2dceb3?{'count':_0x4feddd,'rows':_0x2dceb3}:null;}})[_0x1438('0x39')](respondWithResult(_0x512683,null))[_0x1438('0x2c')](handleError(_0x512683,null));};exports[_0x1438('0x86')]=function(_0x18e2df,_0x41a0cb,_0xf3a590){var _0x123307={'channel':_0x1438('0x87')};var _0x2ed661=[];var _0xfd9785=[];var _0x4af2cb={};return db[_0x1438('0x45')][_0x1438('0x5e')]({'where':{'id':_0x18e2df[_0x1438('0x5c')]['id']},'include':[{'model':db[_0x1438('0x81')],'as':_0x1438('0x88')}]})[_0x1438('0x39')](handleEntityNotFound(_0x41a0cb,null))[_0x1438('0x39')](function(_0x46a378){_0x123307['account']=_0x46a378;if(_0x123307[_0x1438('0x89')]&&_0x123307[_0x1438('0x89')][_0x1438('0x47')]===_0x1438('0x8a')&&_0x18e2df[_0x1438('0x5f')][_0x1438('0x8b')]){if(_0x18e2df[_0x1438('0x5f')]['statuses'][_0x1438('0x5d')]===0x0)return;if(_0x18e2df['body'][_0x1438('0x8b')][0x0][_0x1438('0x8c')]!==_0x1438('0x8d'))return;return db[_0x1438('0x8e')][_0x1438('0x38')]({'read':!![],'readAt':_0x18e2df['body'][_0x1438('0x8b')][0x0]['timestamp']},{'where':{'messageId':_0x18e2df[_0x1438('0x5f')]['statuses'][0x0][_0x1438('0x8f')]},'individualHooks':!![]})[_0x1438('0x39')](function(_0x587b6e){return _0x41a0cb['status'](0xc8)[_0x1438('0x2f')](_0x587b6e);});}_0x123307[_0x1438('0x90')]=_['orderBy'](_0x46a378[_0x1438('0x88')],['priority'],[_0x1438('0x91')]);if(_0x123307[_0x1438('0x89')]['Applications']){delete _0x123307[_0x1438('0x89')][_0x1438('0x88')];}return db[_0x1438('0x92')][_0x1438('0x68')]()[_0x1438('0x39')](function(_0x5261e5){if(!_0x5261e5){throw new db[(_0x1438('0x93'))][(_0x1438('0x94'))]('no\x20available\x20attributes');}_0x2ed661=_[_0x1438('0x95')](_[_0x1438('0x4b')](_0x5261e5),[_0x1438('0x96'),_0x1438('0x97')]);_0xfd9785=_[_0x1438('0x95')](_[_0x1438('0x4b')](_0x5261e5),[_0x1438('0x96'),_0x1438('0x97'),_0x1438('0x98'),_0x1438('0x99')]);_0x123307[_0x1438('0x5f')]={'mapKey':_0x1438('0x9a')};if(_0x123307[_0x1438('0x89')]&&_0x123307[_0x1438('0x89')][_0x1438('0x47')]===_0x1438('0x9b')){_0x123307[_0x1438('0x5f')]['from']=_0x18e2df['body'][_0x1438('0x9c')]['replace'](_0x1438('0x9d'),'');_0x123307[_0x1438('0x5f')][_0x1438('0x5f')]=_0x18e2df[_0x1438('0x5f')][_0x1438('0x9e')];_0x123307[_0x1438('0x5f')][_0x1438('0x9f')]=_0x18e2df[_0x1438('0x5f')][_0x1438('0xa0')];}if(_0x123307['account']&&_0x123307[_0x1438('0x89')][_0x1438('0x47')]===_0x1438('0x8a')){_0x123307[_0x1438('0x5f')]['from']=_0x18e2df[_0x1438('0x5f')][_0x1438('0xa1')][0x0][_0x1438('0xa2')];_0x123307['body'][_0x1438('0x5f')]=_0x18e2df[_0x1438('0x5f')]['notifications'][0x0]['message'][_0x1438('0x5f')];_0x123307['body']['messageId']=_0x18e2df[_0x1438('0x5f')]['notifications'][0x0][_0x1438('0x8f')];}if(_0x123307[_0x1438('0x5f')]['id']){delete _0x123307['body']['id'];}if(_[_0x1438('0xa3')](_0x123307[_0x1438('0x5f')][_0x1438('0xa2')])){throw new db[(_0x1438('0x93'))][(_0x1438('0x94'))](_0x1438('0xa4'));}if(_['isNil'](_0x123307['body'][_0x1438('0x5f')])||_0x123307[_0x1438('0x5f')][_0x1438('0x5f')]===''){throw new db[(_0x1438('0x93'))][(_0x1438('0x94'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1438('0xa3')](_0x123307['body'][_0x1438('0xa5')])){throw new db[(_0x1438('0x93'))][(_0x1438('0x94'))](_0x1438('0xa6')+_0xfd9785);}if(!_[_0x1438('0xa7')](_0xfd9785,_0x123307[_0x1438('0x5f')][_0x1438('0xa5')])){throw new db['Sequelize'][(_0x1438('0x94'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xfd9785);}_0x4af2cb[_0x123307[_0x1438('0x5f')][_0x1438('0xa5')]]=_0x123307[_0x1438('0x5f')]['from'];return db[_0x1438('0xa8')][_0x1438('0x5e')]({'where':{'id':_0x123307['account'][_0x1438('0x99')]},'include':[{'model':db[_0x1438('0x92')],'as':'Contacts','where':_0x4af2cb,'limit':0x1,'order':[[_0x1438('0x97'),_0x1438('0xa9')]]}]});})[_0x1438('0x39')](handleEntityNotFound(_0x41a0cb,null))[_0x1438('0x39')](function(_0x2bcf9b){if(_0x2bcf9b){_0x123307['list']=_[_0x1438('0xaa')](_0x2bcf9b,['Contacts']);if(_0x2bcf9b[_0x1438('0xab')][_0x1438('0x5d')]){return _0x2bcf9b[_0x1438('0xab')][0x0];}var _0x270fa0=_['defaults'](_0x123307[_0x1438('0x5f')],{'firstName':_0x123307[_0x1438('0x5f')]['from'],'ListId':_0x2bcf9b['id']});_0x270fa0[_0x123307[_0x1438('0x5f')][_0x1438('0xa5')]]=_0x123307[_0x1438('0x5f')][_0x1438('0xa2')];return db['CmContact'][_0x1438('0x66')](_0x270fa0,{'fields':_0x2ed661,'raw':!![]});}})['then'](handleEntityNotFound(_0x41a0cb,null))[_0x1438('0x39')](function(_0x5ca143){if(_0x5ca143){_0x123307[_0x1438('0xac')]=_0x5ca143;var _0x14dc72={'ContactId':_0x5ca143['id'],'phone':_0x123307[_0x1438('0x5f')][_0x1438('0xa2')],'WhatsappAccountId':_0x18e2df['params']['id']};var _0x2a241f={'ContactId':_0x5ca143['id'],'WhatsappAccountId':_0x18e2df[_0x1438('0x5c')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x2a241f})['then'](function(_0x56845c){if(_0x56845c){return[_0x56845c,![]];}return db['WhatsappInteraction'][_0x1438('0x66')](_0x14dc72)['then'](function(_0x4253f6){return[_0x4253f6,!![]];});});}})['spread'](function(_0x4e7090,_0x2fb06e){_0x123307[_0x1438('0xad')]=_0x4e7090['get']({'plain':!![]});_0x123307['interaction'][_0x1438('0xae')]=![];if(_0x2fb06e){if(_0x123307[_0x1438('0x89')][_0x1438('0xaf')]){_0x123307[_0x1438('0x90')][_0x1438('0xb0')]({'id':0x0,'priority':_0x123307[_0x1438('0x90')]['length']+0x1,'app':'close','appdata':_0x1438('0xb1'),'interval':'*,*,*,*'});}_0x123307[_0x1438('0xad')][_0x1438('0xae')]=!![];}return db[_0x1438('0x8e')]['create']({'phone':_0x123307[_0x1438('0x5f')][_0x1438('0xa2')],'messageId':_0x123307[_0x1438('0x5f')][_0x1438('0x9f')],'body':_0x123307[_0x1438('0x5f')][_0x1438('0x5f')],'WhatsappAccountId':_0x18e2df[_0x1438('0x5c')]['id'],'WhatsappInteractionId':_0x4e7090['id'],'direction':'in','ContactId':_0x4e7090[_0x1438('0xb2')],'AttachmentId':_0x123307['body']['AttachmentId']});})[_0x1438('0x39')](function(_0xc8bc63){_0x123307[_0x1438('0x2a')]=_0xc8bc63;if(!_0x123307[_0x1438('0xad')][_0x1438('0xb3')])return;return db[_0x1438('0xb4')]['find']({'attributes':['id','name'],'where':{'id':_0x123307['interaction']['UserId']}});})[_0x1438('0x39')](function(_0x450f71){if(_0x450f71){_0x123307[_0x1438('0x90')]['unshift']({'id':0x0,'priority':0x0,'app':_0x1438('0xb5'),'appdata':_0x450f71[_0x1438('0x3f')]+','+(_0x123307[_0x1438('0x89')][_0x1438('0xb6')]||0xa),'interval':'*,*,*,*'});}if(!_0x123307['interaction'][_0x1438('0xb7')])return;return db['WhatsappQueue'][_0x1438('0x5e')]({'attributes':['id',_0x1438('0x3f')],'where':{'id':_0x123307[_0x1438('0xad')]['queueId']}});})[_0x1438('0x39')](function(_0x1f938c){if(_0x1f938c){_0x123307[_0x1438('0x90')][_0x1438('0xb8')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1f938c[_0x1438('0x3f')]+','+(_0x123307[_0x1438('0x89')][_0x1438('0xb9')]||0x12c),'interval':_0x1438('0xba')});}return respondWithRpcPromise(_0x1438('0xbb'),_0x1438('0xbc'),_0x123307);})[_0x1438('0x39')](function(_0x15c836){if(_0x15c836){var _0x59ab47=0xc8;var _0x22d50c=_0x1438('0xbd');logger[_0x1438('0x22')](_0x1438('0x24'),_0x22d50c,_0x59ab47,_0x1438('0xbe'));logger[_0x1438('0x23')](_0x1438('0xbf'),_0x22d50c,_0x59ab47,_0x1438('0xbe'),JSON[_0x1438('0x26')](_0x15c836));if(_0x123307['account']['type']===_0x1438('0x9b')){return _0x41a0cb[_0x1438('0x2e')](_0x59ab47)[_0x1438('0x34')](_0x1438('0xc0'),'text/xml')[_0x1438('0x40')]('\x0a');}else{return _0x41a0cb[_0x1438('0x2e')](_0x59ab47)[_0x1438('0x2f')](_0x15c836);}}});})[_0x1438('0x2c')](handleError(_0x41a0cb,null));};exports[_0x1438('0x40')]=function(_0x330365,_0x41c090,_0x16ac01){var _0x5e0a0c,_0x390112,_0x307b85;if(_[_0x1438('0xa3')](_0x330365[_0x1438('0x5f')][_0x1438('0x5f')])||_0x330365[_0x1438('0x5f')]['body']===''){throw new db[(_0x1438('0x93'))][(_0x1438('0x94'))](_0x1438('0xc1'));}if(_[_0x1438('0xa3')](_0x330365[_0x1438('0x5f')]['to'])){throw new db[(_0x1438('0x93'))]['ValidationError'](_0x1438('0xc2'));}_0x5e0a0c=_0x330365[_0x1438('0x5f')]['to'];return db[_0x1438('0x45')]['find']({'where':{'id':_0x330365[_0x1438('0x5c')]['id']},'include':[{'model':db[_0x1438('0xa8')],'as':'List','include':[{'model':db[_0x1438('0x92')],'as':'Contacts','where':{'mobile':_0x5e0a0c},'limit':0x1,'order':[[_0x1438('0x97'),_0x1438('0xa9')]]}]}]})[_0x1438('0x39')](handleEntityNotFound(_0x41c090,null))['then'](function(_0x20c133){if(_0x20c133&&_0x20c133['List']){_0x390112=_0x20c133[_0x1438('0x63')]({'plain':!![]});if(_0x390112[_0x1438('0xc3')]&&_0x390112[_0x1438('0xc3')][_0x1438('0xab')][_0x1438('0x5d')]){return _0x390112['List']['Contacts'][0x0];}return db[_0x1438('0x92')]['create'](_['defaults'](_0x330365[_0x1438('0x5f')],{'firstName':_0x5e0a0c,'mobile':_0x5e0a0c,'phone':_0x5e0a0c,'ListId':_0x390112[_0x1438('0x99')]}));}})['then'](handleEntityNotFound(_0x41c090,null))['then'](function(_0x6924bd){if(_0x6924bd){_0x307b85=_0x6924bd;return db['WhatsappInteraction'][_0x1438('0x5e')]({'where':{'ContactId':_0x307b85['id'],'closed':![],'WhatsappAccountId':_0x390112['id']}})[_0x1438('0x39')](function(_0x323938){if(_0x323938){return[_0x323938,![]];}return db[_0x1438('0xc4')][_0x1438('0x66')]({'UserId':_0x330365[_0x1438('0x60')]['id'],'ContactId':_0x307b85['id'],'WhatsappAccountId':_0x390112['id'],'phone':_0x5e0a0c,'firstMsgDirection':_0x1438('0xc5'),'Messages':[_[_0x1438('0x56')](_0x330365[_0x1438('0x5f')],{'read':![],'body':_0x330365[_0x1438('0x5f')][_0x1438('0x5f')],'phone':_0x5e0a0c,'WhatsappAccountId':_0x390112['id'],'UserId':_0x330365[_0x1438('0x60')]['id'],'ContactId':_0x307b85['id']})]},{'include':[{'model':db[_0x1438('0x8e')],'as':_0x1438('0xc6')}]})['then'](function(_0x2e69bf){return[_0x2e69bf,!![]];});});}})['spread'](function(_0x5c5237,_0x54ee09){if(_0x54ee09){return _0x5c5237;}return db['WhatsappMessage']['create'](_[_0x1438('0x56')](_0x330365[_0x1438('0x5f')],{'read':![],'body':_0x330365[_0x1438('0x5f')][_0x1438('0x5f')],'phone':_0x5e0a0c,'WhatsappAccountId':_0x390112['id'],'WhatsappInteractionId':_0x5c5237['id'],'UserId':_0x330365[_0x1438('0x60')]['id'],'ContactId':_0x307b85['id']}))[_0x1438('0x39')](function(_0x524472){_0x5c5237[_0x1438('0xc7')][_0x1438('0xc6')]=[];_0x5c5237[_0x1438('0xc7')][_0x1438('0xc6')][_0x1438('0xb0')](_0x524472['dataValues']);return _0x5c5237;});})[_0x1438('0x39')](respondWithResult(_0x41c090,null))[_0x1438('0x2c')](handleError(_0x41c090,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 7842759..b0136e2 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 _0x9e94=['update','remove','emit','hasOwnProperty','events','WhatsappAccount','setMaxListeners'];(function(_0xccc579,_0x3def9a){var _0x33d5ae=function(_0x43bbd6){while(--_0x43bbd6){_0xccc579['push'](_0xccc579['shift']());}};_0x33d5ae(++_0x3def9a);}(_0x9e94,0x14d));var _0x49e9=function(_0x1d6d63,_0x4e4976){_0x1d6d63=_0x1d6d63-0x0;var _0x471552=_0x9e94[_0x1d6d63];return _0x471552;};'use strict';var EventEmitter=require(_0x49e9('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x49e9('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x49e9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x49e9('0x3'),'afterDestroy':_0x49e9('0x4')};function emitEvent(_0x2c9182){return function(_0x466276,_0x47a9d8,_0x3f08a1){WhatsappAccountEvents[_0x49e9('0x5')](_0x2c9182+':'+_0x466276['id'],_0x466276);WhatsappAccountEvents['emit'](_0x2c9182,_0x466276);_0x3f08a1(null);};}for(var e in events){if(events[_0x49e9('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x1469=['save','update','emit','hook','../../mysqldb','setMaxListeners'];(function(_0x1d2d76,_0x2fcdbb){var _0x9bb86=function(_0x3adf81){while(--_0x3adf81){_0x1d2d76['push'](_0x1d2d76['shift']());}};_0x9bb86(++_0x2fcdbb);}(_0x1469,0xe2));var _0x9146=function(_0x51b19b,_0x5015d2){_0x51b19b=_0x51b19b-0x0;var _0x1a3cd6=_0x1469[_0x51b19b];return _0x1a3cd6;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x9146('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9146('0x1')](0x0);var events={'afterCreate':_0x9146('0x2'),'afterUpdate':_0x9146('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3a1644){return function(_0x50a4d6,_0x350b87,_0x58a36f){WhatsappAccountEvents['emit'](_0x3a1644+':'+_0x50a4d6['id'],_0x50a4d6);WhatsappAccountEvents[_0x9146('0x4')](_0x3a1644,_0x50a4d6);_0x58a36f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x9146('0x5')](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 6062264..a329029 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 _0xe4ea=['../../config/environment','./whatsappAccount.attributes','define','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5630db,_0x176962){var _0x2c40a6=function(_0x3c6fe4){while(--_0x3c6fe4){_0x5630db['push'](_0x5630db['shift']());}};_0x2c40a6(++_0x176962);}(_0xe4ea,0x19c));var _0xae4e=function(_0x4694b3,_0x5c3bde){_0x4694b3=_0x4694b3-0x0;var _0x106f69=_0xe4ea[_0x4694b3];return _0x106f69;};'use strict';var _=require(_0xae4e('0x0'));var util=require(_0xae4e('0x1'));var logger=require(_0xae4e('0x2'))(_0xae4e('0x3'));var moment=require(_0xae4e('0x4'));var BPromise=require(_0xae4e('0x5'));var rp=require(_0xae4e('0x6'));var fs=require('fs');var path=require(_0xae4e('0x7'));var rimraf=require('rimraf');var config=require(_0xae4e('0x8'));var attributes=require(_0xae4e('0x9'));module['exports']=function(_0x52084a,_0x208ed9){return _0x52084a[_0xae4e('0xa')]('WhatsappAccount',attributes,{'tableName':_0xae4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x361a=['api','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','whatsapp_accounts','lodash','../../config/logger'];(function(_0x23c8f8,_0x155777){var _0x3a8c0f=function(_0x20c67d){while(--_0x20c67d){_0x23c8f8['push'](_0x23c8f8['shift']());}};_0x3a8c0f(++_0x155777);}(_0x361a,0x116));var _0xa361=function(_0xcb8fef,_0xe997f8){_0xcb8fef=_0xcb8fef-0x0;var _0x53ccae=_0x361a[_0xcb8fef];return _0x53ccae;};'use strict';var _=require(_0xa361('0x0'));var util=require('util');var logger=require(_0xa361('0x1'))(_0xa361('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa361('0x3'));var fs=require('fs');var path=require(_0xa361('0x4'));var rimraf=require(_0xa361('0x5'));var config=require(_0xa361('0x6'));var attributes=require(_0xa361('0x7'));module[_0xa361('0x8')]=function(_0x4b1b1c,_0x31885e){return _0x4b1b1c['define']('WhatsappAccount',attributes,{'tableName':_0xa361('0x9'),'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 aa61b3f..0e11c83 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 _0xacb5=['client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','map','model','attributes','include','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x45cbd6,_0x3548d9){var _0x186a7d=function(_0x1033b1){while(--_0x1033b1){_0x45cbd6['push'](_0x45cbd6['shift']());}};_0x186a7d(++_0x3548d9);}(_0xacb5,0xe0));var _0x5acb=function(_0x49282b,_0x4e2125){_0x49282b=_0x49282b-0x0;var _0xcb542e=_0xacb5[_0x49282b];return _0xcb542e;};'use strict';var _=require(_0x5acb('0x0'));var util=require('util');var moment=require(_0x5acb('0x1'));var BPromise=require(_0x5acb('0x2'));var rs=require(_0x5acb('0x3'));var fs=require('fs');var Redis=require(_0x5acb('0x4'));var db=require(_0x5acb('0x5'))['db'];var utils=require(_0x5acb('0x6'));var logger=require('../../config/logger')(_0x5acb('0x7'));var config=require(_0x5acb('0x8'));var jayson=require(_0x5acb('0x9'));var client=jayson[_0x5acb('0xa')][_0x5acb('0xb')]({'port':0x232a});config[_0x5acb('0xc')]=_['defaults'](config[_0x5acb('0xc')],{'host':_0x5acb('0xd'),'port':0x18eb});var socket=require(_0x5acb('0xe'))(new Redis(config['redis']));require(_0x5acb('0xf'))[_0x5acb('0x10')](socket);function respondWithRpcPromise(_0x42b294,_0x439e23,_0x2c582c){return new BPromise(function(_0x42dde6,_0x12780a){return client[_0x5acb('0x11')](_0x42b294,_0x2c582c)[_0x5acb('0x12')](function(_0x22059d){logger[_0x5acb('0x13')](_0x5acb('0x14'),_0x439e23,_0x5acb('0x15'));logger['debug'](_0x5acb('0x16'),_0x439e23,_0x5acb('0x15'),JSON[_0x5acb('0x17')](_0x22059d));if(_0x22059d[_0x5acb('0x18')]){if(_0x22059d[_0x5acb('0x18')][_0x5acb('0x19')]===0x1f4){logger[_0x5acb('0x18')](_0x5acb('0x14'),_0x439e23,_0x22059d[_0x5acb('0x18')][_0x5acb('0x1a')]);return _0x12780a(_0x22059d[_0x5acb('0x18')][_0x5acb('0x1a')]);}logger['error'](_0x5acb('0x14'),_0x439e23,_0x22059d['error'][_0x5acb('0x1a')]);return _0x42dde6(_0x22059d[_0x5acb('0x18')]['message']);}else{logger['info'](_0x5acb('0x14'),_0x439e23,_0x5acb('0x15'));_0x42dde6(_0x22059d['result'][_0x5acb('0x1a')]);}})[_0x5acb('0x1b')](function(_0x48c845){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x439e23,_0x48c845);_0x12780a(_0x48c845);});});}exports[_0x5acb('0x1c')]=function(_0x3d07b8){var _0x10edff=this;return new Promise(function(_0x399e20,_0x2fb334){return db[_0x5acb('0x1d')][_0x5acb('0x1e')]({'raw':_0x3d07b8['options']?_0x3d07b8[_0x5acb('0x1f')][_0x5acb('0x20')]===undefined?!![]:![]:!![],'where':_0x3d07b8[_0x5acb('0x1f')]?_0x3d07b8[_0x5acb('0x1f')][_0x5acb('0x21')]||null:null,'attributes':_0x3d07b8[_0x5acb('0x1f')]?_0x3d07b8[_0x5acb('0x1f')]['attributes']||null:null,'include':_0x3d07b8[_0x5acb('0x1f')]?_0x3d07b8[_0x5acb('0x1f')]['include']?_[_0x5acb('0x22')](_0x3d07b8[_0x5acb('0x1f')]['include'],function(_0x40978a){return{'model':db[_0x40978a[_0x5acb('0x23')]],'as':_0x40978a['as'],'attributes':_0x40978a[_0x5acb('0x24')],'include':_0x40978a[_0x5acb('0x25')]?_['map'](_0x40978a['include'],function(_0x23d11c){return{'model':db[_0x23d11c[_0x5acb('0x23')]],'as':_0x23d11c['as'],'attributes':_0x23d11c[_0x5acb('0x24')],'include':_0x23d11c['include']?_[_0x5acb('0x22')](_0x23d11c['include'],function(_0x3e48a0){return{'model':db[_0x3e48a0[_0x5acb('0x23')]],'as':_0x3e48a0['as'],'attributes':_0x3e48a0[_0x5acb('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5acb('0x12')](function(_0x12f63f){logger[_0x5acb('0x13')](_0x5acb('0x1c'),_0x3d07b8);logger[_0x5acb('0x26')]('ShowWhatsappAccount',_0x3d07b8,JSON['stringify'](_0x12f63f));_0x399e20(_0x12f63f);})[_0x5acb('0x1b')](function(_0x48608f){logger[_0x5acb('0x18')](_0x5acb('0x1c'),_0x48608f[_0x5acb('0x1a')],_0x3d07b8);_0x2fb334(_0x10edff[_0x5acb('0x18')](0x1f4,_0x48608f[_0x5acb('0x1a')]));});});}; \ No newline at end of file +var _0x3ecc=['find','options','raw','attributes','include','map','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','ShowWhatsappAccount'];(function(_0x53ddab,_0x4ada9d){var _0x5819ac=function(_0x4d5fc8){while(--_0x4d5fc8){_0x53ddab['push'](_0x53ddab['shift']());}};_0x5819ac(++_0x4ada9d);}(_0x3ecc,0x12f));var _0xc3ec=function(_0x1bd29e,_0x17f961){_0x1bd29e=_0x1bd29e-0x0;var _0x1e1a66=_0x3ecc[_0x1bd29e];return _0x1e1a66;};'use strict';var _=require('lodash');var util=require(_0xc3ec('0x0'));var moment=require(_0xc3ec('0x1'));var BPromise=require('bluebird');var rs=require(_0xc3ec('0x2'));var fs=require('fs');var Redis=require(_0xc3ec('0x3'));var db=require(_0xc3ec('0x4'))['db'];var utils=require(_0xc3ec('0x5'));var logger=require(_0xc3ec('0x6'))(_0xc3ec('0x7'));var config=require(_0xc3ec('0x8'));var jayson=require(_0xc3ec('0x9'));var client=jayson['client'][_0xc3ec('0xa')]({'port':0x232a});config[_0xc3ec('0xb')]=_[_0xc3ec('0xc')](config[_0xc3ec('0xb')],{'host':_0xc3ec('0xd'),'port':0x18eb});var socket=require(_0xc3ec('0xe'))(new Redis(config['redis']));require(_0xc3ec('0xf'))[_0xc3ec('0x10')](socket);function respondWithRpcPromise(_0x59d44a,_0x32a36a,_0x5209b1){return new BPromise(function(_0x55a144,_0x54f0a2){return client[_0xc3ec('0x11')](_0x59d44a,_0x5209b1)[_0xc3ec('0x12')](function(_0x38f434){logger[_0xc3ec('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x32a36a,_0xc3ec('0x14'));logger[_0xc3ec('0x15')](_0xc3ec('0x16'),_0x32a36a,'request\x20sent',JSON[_0xc3ec('0x17')](_0x38f434));if(_0x38f434['error']){if(_0x38f434[_0xc3ec('0x18')][_0xc3ec('0x19')]===0x1f4){logger[_0xc3ec('0x18')](_0xc3ec('0x1a'),_0x32a36a,_0x38f434[_0xc3ec('0x18')][_0xc3ec('0x1b')]);return _0x54f0a2(_0x38f434[_0xc3ec('0x18')][_0xc3ec('0x1b')]);}logger[_0xc3ec('0x18')](_0xc3ec('0x1a'),_0x32a36a,_0x38f434[_0xc3ec('0x18')][_0xc3ec('0x1b')]);return _0x55a144(_0x38f434[_0xc3ec('0x18')][_0xc3ec('0x1b')]);}else{logger[_0xc3ec('0x13')](_0xc3ec('0x1a'),_0x32a36a,'request\x20sent');_0x55a144(_0x38f434['result'][_0xc3ec('0x1b')]);}})[_0xc3ec('0x1c')](function(_0x20eefa){logger[_0xc3ec('0x18')](_0xc3ec('0x1a'),_0x32a36a,_0x20eefa);_0x54f0a2(_0x20eefa);});});}exports[_0xc3ec('0x1d')]=function(_0x152dc3){var _0x3907df=this;return new Promise(function(_0x5bb428,_0x4867b8){return db['WhatsappAccount'][_0xc3ec('0x1e')]({'raw':_0x152dc3['options']?_0x152dc3[_0xc3ec('0x1f')][_0xc3ec('0x20')]===undefined?!![]:![]:!![],'where':_0x152dc3[_0xc3ec('0x1f')]?_0x152dc3['options']['where']||null:null,'attributes':_0x152dc3[_0xc3ec('0x1f')]?_0x152dc3['options'][_0xc3ec('0x21')]||null:null,'include':_0x152dc3[_0xc3ec('0x1f')]?_0x152dc3[_0xc3ec('0x1f')][_0xc3ec('0x22')]?_[_0xc3ec('0x23')](_0x152dc3[_0xc3ec('0x1f')][_0xc3ec('0x22')],function(_0xc93a2b){return{'model':db[_0xc93a2b[_0xc3ec('0x24')]],'as':_0xc93a2b['as'],'attributes':_0xc93a2b[_0xc3ec('0x21')],'include':_0xc93a2b['include']?_[_0xc3ec('0x23')](_0xc93a2b[_0xc3ec('0x22')],function(_0x175851){return{'model':db[_0x175851['model']],'as':_0x175851['as'],'attributes':_0x175851['attributes'],'include':_0x175851['include']?_[_0xc3ec('0x23')](_0x175851[_0xc3ec('0x22')],function(_0x20e750){return{'model':db[_0x20e750[_0xc3ec('0x24')]],'as':_0x20e750['as'],'attributes':_0x20e750['attributes']};}):[]};}):[]};}):[]:[]})[_0xc3ec('0x12')](function(_0x44d2c9){logger[_0xc3ec('0x13')]('ShowWhatsappAccount',_0x152dc3);logger[_0xc3ec('0x15')](_0xc3ec('0x1d'),_0x152dc3,JSON['stringify'](_0x44d2c9));_0x5bb428(_0x44d2c9);})['catch'](function(_0x2e3370){logger[_0xc3ec('0x18')](_0xc3ec('0x1d'),_0x2e3370['message'],_0x152dc3);_0x4867b8(_0x3907df[_0xc3ec('0x18')](0x1f4,_0x2e3370[_0xc3ec('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 49ec411..dc5b7b8 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 _0x2320=['removeListener','whatsappAccount:','save','remove','update'];(function(_0x172206,_0x13a362){var _0x5738da=function(_0xa4e490){while(--_0xa4e490){_0x172206['push'](_0x172206['shift']());}};_0x5738da(++_0x13a362);}(_0x2320,0x101));var _0x0232=function(_0xdee5b3,_0x3e7500){_0xdee5b3=_0xdee5b3-0x0;var _0x30ed5f=_0x2320[_0xdee5b3];return _0x30ed5f;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x0232('0x0'),_0x0232('0x1'),_0x0232('0x2')];function createListener(_0xf120f0,_0x4db79c){return function(_0x51cda5){_0x4db79c['emit'](_0xf120f0,_0x51cda5);};}function removeListener(_0x144f36,_0x13bc50){return function(){WhatsappAccountEvents[_0x0232('0x3')](_0x144f36,_0x13bc50);};}exports['register']=function(_0x355936){for(var _0x136212=0x0,_0x5eb7f4=events['length'];_0x136212<_0x5eb7f4;_0x136212++){var _0x571d4f=events[_0x136212];var _0x48cc52=createListener(_0x0232('0x4')+_0x571d4f,_0x355936);WhatsappAccountEvents['on'](_0x571d4f,_0x48cc52);}}; \ No newline at end of file +var _0xd146=['save','remove','update','emit','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xd146,0x99));var _0x6d14=function(_0xe45c34,_0x45c8e1){_0xe45c34=_0xe45c34-0x0;var _0x432df2=_0xd146[_0xe45c34];return _0x432df2;};'use strict';var WhatsappAccountEvents=require(_0x6d14('0x0'));var events=[_0x6d14('0x1'),_0x6d14('0x2'),_0x6d14('0x3')];function createListener(_0xf22960,_0x16c580){return function(_0xc378fd){_0x16c580[_0x6d14('0x4')](_0xf22960,_0xc378fd);};}function removeListener(_0xbb8a97,_0x583908){return function(){WhatsappAccountEvents['removeListener'](_0xbb8a97,_0x583908);};}exports['register']=function(_0x4c3c50){for(var _0x2bb545=0x0,_0x3fa464=events[_0x6d14('0x5')];_0x2bb545<_0x3fa464;_0x2bb545++){var _0x55ba5d=events[_0x2bb545];var _0x3b4dfe=createListener(_0x6d14('0x6')+_0x55ba5d,_0x4c3c50);WhatsappAccountEvents['on'](_0x55ba5d,_0x3b4dfe);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 71e6f03..ec88fbd 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 _0xff3b=['index','/:id','show','post','create','put','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff3b,0x1c9));var _0xbff3=function(_0x592ecb,_0x4be9cc){_0x592ecb=_0x592ecb-0x0;var _0x35e231=_0xff3b[_0x592ecb];return _0x35e231;};'use strict';var multer=require(_0xbff3('0x0'));var util=require('util');var path=require(_0xbff3('0x1'));var timeout=require(_0xbff3('0x2'));var express=require(_0xbff3('0x3'));var router=express['Router']();var fs_extra=require(_0xbff3('0x4'));var auth=require(_0xbff3('0x5'));var interaction=require(_0xbff3('0x6'));var config=require(_0xbff3('0x7'));var controller=require(_0xbff3('0x8'));router[_0xbff3('0x9')]('/',auth[_0xbff3('0xa')](),controller[_0xbff3('0xb')]);router[_0xbff3('0x9')](_0xbff3('0xc'),auth[_0xbff3('0xa')](),controller[_0xbff3('0xd')]);router[_0xbff3('0xe')]('/',auth[_0xbff3('0xa')](),controller[_0xbff3('0xf')]);router[_0xbff3('0x10')]('/:id',auth[_0xbff3('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xbff3('0x11')]);module['exports']=router; \ No newline at end of file +var _0xbbf9=['update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','/:id','show','post','put'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0xbbf9,0x8b));var _0x9bbf=function(_0x42de15,_0x4eb272){_0x42de15=_0x42de15-0x0;var _0x46fca8=_0xbbf9[_0x42de15];return _0x46fca8;};'use strict';var multer=require('multer');var util=require(_0x9bbf('0x0'));var path=require(_0x9bbf('0x1'));var timeout=require(_0x9bbf('0x2'));var express=require(_0x9bbf('0x3'));var router=express[_0x9bbf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9bbf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9bbf('0x6'));var controller=require(_0x9bbf('0x7'));router['get']('/',auth[_0x9bbf('0x8')](),controller[_0x9bbf('0x9')]);router['get'](_0x9bbf('0xa'),auth['isAuthenticated'](),controller[_0x9bbf('0xb')]);router[_0x9bbf('0xc')]('/',auth[_0x9bbf('0x8')](),controller['create']);router[_0x9bbf('0xd')](_0x9bbf('0xa'),auth[_0x9bbf('0x8')](),controller[_0x9bbf('0xe')]);router[_0x9bbf('0xf')]('/:id',auth[_0x9bbf('0x8')](),controller[_0x9bbf('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 3658383..76b4685 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 _0x475c=['STRING','*,*,*,*','sequelize','INTEGER','noop'];(function(_0x33e5f5,_0x2b0ff4){var _0x42eba8=function(_0x4c5f49){while(--_0x4c5f49){_0x33e5f5['push'](_0x33e5f5['shift']());}};_0x42eba8(++_0x2b0ff4);}(_0x475c,0x93));var _0xc475=function(_0x59f88b,_0x466d0a){_0x59f88b=_0x59f88b-0x0;var _0x2d151c=_0x475c[_0x59f88b];return _0x2d151c;};'use strict';var Sequelize=require(_0xc475('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc475('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc475('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc475('0x3')]},'interval':{'type':Sequelize[_0xc475('0x3')],'defaultValue':_0xc475('0x4')}}; \ No newline at end of file +var _0xfdab=['sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xfdab,0x154));var _0xbfda=function(_0x8cdb08,_0x59062f){_0x8cdb08=_0x8cdb08-0x0;var _0xd348c3=_0xfdab[_0x8cdb08];return _0xd348c3;};'use strict';var Sequelize=require(_0xbfda('0x0'));module[_0xbfda('0x1')]={'priority':{'type':Sequelize[_0xbfda('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbfda('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbfda('0x4')]()},'description':{'type':Sequelize[_0xbfda('0x3')]},'interval':{'type':Sequelize[_0xbfda('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index b584220..1b27f82 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 _0x8b52=['../../config/license/util','sendStatus','end','status','offset','limit','count','Content-Range','json','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','WhatsappApplication','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xfe3bc5,_0x2c8bad){var _0x46686a=function(_0x36338f){while(--_0x36338f){_0xfe3bc5['push'](_0xfe3bc5['shift']());}};_0x46686a(++_0x2c8bad);}(_0x8b52,0x151));var _0x28b5=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x8b52[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0x28b5('0x0'));var rimraf=require(_0x28b5('0x1'));var zipdir=require(_0x28b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28b5('0x3'));var moment=require(_0x28b5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x28b5('0x5'));var util=require(_0x28b5('0x6'));var path=require(_0x28b5('0x7'));var sox=require(_0x28b5('0x8'));var csv=require(_0x28b5('0x9'));var ejs=require(_0x28b5('0xa'));var fs=require('fs');var fs_extra=require(_0x28b5('0xb'));var _=require(_0x28b5('0xc'));var squel=require(_0x28b5('0xd'));var crypto=require('crypto');var jsforce=require(_0x28b5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x28b5('0xf'));var Papa=require(_0x28b5('0x10'));var Redis=require('ioredis');var authService=require(_0x28b5('0x11'));var qs=require(_0x28b5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28b5('0x13'));var logger=require(_0x28b5('0x14'))(_0x28b5('0x15'));var utils=require(_0x28b5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x28b5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc18108,_0x3bd9f3){_0x3bd9f3=_0x3bd9f3||0xcc;return function(_0x5f41b6){if(_0x5f41b6){return _0xc18108[_0x28b5('0x18')](_0x3bd9f3);}return _0xc18108['status'](_0x3bd9f3)[_0x28b5('0x19')]();};}function respondWithResult(_0x4a684e,_0x58f350){_0x58f350=_0x58f350||0xc8;return function(_0xff943a){if(_0xff943a){return _0x4a684e[_0x28b5('0x1a')](_0x58f350)['json'](_0xff943a);}};}function respondWithFilteredResult(_0x2c17c7,_0x26213c){return function(_0x1e4a10){if(_0x1e4a10){var _0x16c115=typeof _0x26213c[_0x28b5('0x1b')]==='undefined'&&typeof _0x26213c[_0x28b5('0x1c')]==='undefined';var _0x7b6900=_0x1e4a10[_0x28b5('0x1d')];var _0xfea919=_0x16c115?0x0:_0x26213c[_0x28b5('0x1b')];var _0x540933=_0x16c115?_0x1e4a10[_0x28b5('0x1d')]:_0x26213c[_0x28b5('0x1b')]+_0x26213c[_0x28b5('0x1c')];var _0x534136;if(_0x540933>=_0x7b6900){_0x540933=_0x7b6900;_0x534136=0xc8;}else{_0x534136=0xce;}_0x2c17c7[_0x28b5('0x1a')](_0x534136);return _0x2c17c7['set'](_0x28b5('0x1e'),_0xfea919+'-'+_0x540933+'/'+_0x7b6900)[_0x28b5('0x1f')](_0x1e4a10);}return null;};}function patchUpdates(_0x2c4cae){return function(_0x386494){try{jsonpatch['apply'](_0x386494,_0x2c4cae,!![]);}catch(_0x3ebe9e){return BPromise[_0x28b5('0x20')](_0x3ebe9e);}return _0x386494[_0x28b5('0x21')]();};}function saveUpdates(_0x32c819,_0x5c453a){return function(_0x4a8893){if(_0x4a8893){return _0x4a8893['update'](_0x32c819)[_0x28b5('0x22')](function(_0x1bf044){return _0x1bf044;});}return null;};}function removeEntity(_0x395feb,_0x740562){return function(_0x8fa4b9){if(_0x8fa4b9){return _0x8fa4b9[_0x28b5('0x23')]()['then'](function(){_0x395feb['status'](0xcc)[_0x28b5('0x19')]();});}};}function handleEntityNotFound(_0x528993,_0x304f72){return function(_0x25fd54){if(!_0x25fd54){_0x528993[_0x28b5('0x18')](0x194);}return _0x25fd54;};}function handleError(_0x18176c,_0x127ab0){_0x127ab0=_0x127ab0||0x1f4;return function(_0x5ae41d){logger['error'](_0x5ae41d[_0x28b5('0x24')]);if(_0x5ae41d[_0x28b5('0x25')]){delete _0x5ae41d[_0x28b5('0x25')];}_0x18176c[_0x28b5('0x1a')](_0x127ab0)[_0x28b5('0x26')](_0x5ae41d);};}exports[_0x28b5('0x27')]=function(_0x2db6f1,_0x1bbe54){var _0x139524={},_0x2a182a={},_0x491b72={'count':0x0,'rows':[]};var _0x2b46f7=_[_0x28b5('0x28')](db['WhatsappApplication'][_0x28b5('0x29')],function(_0x330767){return{'name':_0x330767[_0x28b5('0x2a')],'type':_0x330767[_0x28b5('0x2b')][_0x28b5('0x2c')]};});_0x2a182a[_0x28b5('0x2d')]=_[_0x28b5('0x28')](_0x2b46f7,'name');_0x2a182a[_0x28b5('0x2e')]=_['keys'](_0x2db6f1[_0x28b5('0x2e')]);_0x2a182a[_0x28b5('0x2f')]=_[_0x28b5('0x30')](_0x2a182a[_0x28b5('0x2d')],_0x2a182a[_0x28b5('0x2e')]);_0x139524[_0x28b5('0x31')]=_[_0x28b5('0x30')](_0x2a182a[_0x28b5('0x2d')],qs[_0x28b5('0x32')](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x32')]));_0x139524[_0x28b5('0x31')]=_0x139524[_0x28b5('0x31')][_0x28b5('0x33')]?_0x139524[_0x28b5('0x31')]:_0x2a182a[_0x28b5('0x2d')];if(!_0x2db6f1['query'][_0x28b5('0x34')]('nolimit')){_0x139524[_0x28b5('0x1c')]=qs[_0x28b5('0x1c')](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x1c')]);_0x139524['offset']=qs[_0x28b5('0x1b')](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x1b')]);}_0x139524['order']=qs['sort'](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x35')]);_0x139524[_0x28b5('0x36')]=qs[_0x28b5('0x2f')](_['pick'](_0x2db6f1[_0x28b5('0x2e')],_0x2a182a[_0x28b5('0x2f')]),_0x2b46f7);if(_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x37')]){_0x139524[_0x28b5('0x36')]=_[_0x28b5('0x38')](_0x139524[_0x28b5('0x36')],{'$or':_[_0x28b5('0x28')](_0x2b46f7,function(_0x4cc88a){if(_0x4cc88a[_0x28b5('0x2b')]!==_0x28b5('0x39')){var _0x4d3d09={};_0x4d3d09[_0x4cc88a[_0x28b5('0x25')]]={'$like':'%'+_0x2db6f1['query'][_0x28b5('0x37')]+'%'};return _0x4d3d09;}})});}_0x139524=_[_0x28b5('0x38')]({},_0x139524,_0x2db6f1[_0x28b5('0x3a')]);var _0x5e1fb2={'where':_0x139524[_0x28b5('0x36')]};return db[_0x28b5('0x3b')][_0x28b5('0x1d')](_0x5e1fb2)[_0x28b5('0x22')](function(_0x31f620){_0x491b72[_0x28b5('0x1d')]=_0x31f620;if(_0x2db6f1['query'][_0x28b5('0x3c')]){_0x139524[_0x28b5('0x3d')]=[{'all':!![]}];}return db[_0x28b5('0x3b')][_0x28b5('0x3e')](_0x139524);})[_0x28b5('0x22')](function(_0x5c237f){_0x491b72[_0x28b5('0x3f')]=_0x5c237f;return _0x491b72;})[_0x28b5('0x22')](respondWithFilteredResult(_0x1bbe54,_0x139524))[_0x28b5('0x40')](handleError(_0x1bbe54,null));};exports[_0x28b5('0x41')]=function(_0x45bd3c,_0x4bd2e3){var _0x2ac508={'raw':!![],'where':{'id':_0x45bd3c[_0x28b5('0x42')]['id']}},_0x5bee77={};_0x5bee77[_0x28b5('0x2d')]=_[_0x28b5('0x43')](db[_0x28b5('0x3b')]['rawAttributes']);_0x5bee77['query']=_[_0x28b5('0x43')](_0x45bd3c[_0x28b5('0x2e')]);_0x5bee77[_0x28b5('0x2f')]=_[_0x28b5('0x30')](_0x5bee77[_0x28b5('0x2d')],_0x5bee77['query']);_0x2ac508[_0x28b5('0x31')]=_['intersection'](_0x5bee77[_0x28b5('0x2d')],qs[_0x28b5('0x32')](_0x45bd3c[_0x28b5('0x2e')][_0x28b5('0x32')]));_0x2ac508[_0x28b5('0x31')]=_0x2ac508[_0x28b5('0x31')][_0x28b5('0x33')]?_0x2ac508['attributes']:_0x5bee77[_0x28b5('0x2d')];if(_0x45bd3c[_0x28b5('0x2e')][_0x28b5('0x3c')]){_0x2ac508[_0x28b5('0x3d')]=[{'all':!![]}];}_0x2ac508=_[_0x28b5('0x38')]({},_0x2ac508,_0x45bd3c[_0x28b5('0x3a')]);return db[_0x28b5('0x3b')][_0x28b5('0x44')](_0x2ac508)[_0x28b5('0x22')](handleEntityNotFound(_0x4bd2e3,null))['then'](respondWithResult(_0x4bd2e3,null))[_0x28b5('0x40')](handleError(_0x4bd2e3,null));};exports[_0x28b5('0x45')]=function(_0xe46b0a,_0x141f9a){return db['WhatsappApplication'][_0x28b5('0x45')](_0xe46b0a[_0x28b5('0x46')],{})[_0x28b5('0x22')](respondWithResult(_0x141f9a,0xc9))[_0x28b5('0x40')](handleError(_0x141f9a,null));};exports[_0x28b5('0x47')]=function(_0xaf449d,_0x3d7fdd){if(_0xaf449d[_0x28b5('0x46')]['id']){delete _0xaf449d[_0x28b5('0x46')]['id'];}return db[_0x28b5('0x3b')][_0x28b5('0x44')]({'where':{'id':_0xaf449d[_0x28b5('0x42')]['id']}})[_0x28b5('0x22')](handleEntityNotFound(_0x3d7fdd,null))[_0x28b5('0x22')](saveUpdates(_0xaf449d['body'],null))['then'](respondWithResult(_0x3d7fdd,null))['catch'](handleError(_0x3d7fdd,null));};exports[_0x28b5('0x23')]=function(_0x97af32,_0x5aaef3){return db[_0x28b5('0x3b')][_0x28b5('0x44')]({'where':{'id':_0x97af32['params']['id']}})[_0x28b5('0x22')](handleEntityNotFound(_0x5aaef3,null))[_0x28b5('0x22')](removeEntity(_0x5aaef3,null))[_0x28b5('0x40')](handleError(_0x5aaef3,null));}; \ No newline at end of file +var _0xbc7a=['model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','sendStatus','stack','name','map','WhatsappApplication','rawAttributes','fieldName','type','key','query','keys'];(function(_0x58a474,_0x29e424){var _0x1d24f4=function(_0x231fc1){while(--_0x231fc1){_0x58a474['push'](_0x58a474['shift']());}};_0x1d24f4(++_0x29e424);}(_0xbc7a,0xa4));var _0xabc7=function(_0xb13f04,_0x53203e){_0xb13f04=_0xb13f04-0x0;var _0x25e517=_0xbc7a[_0xb13f04];return _0x25e517;};'use strict';var emlformat=require(_0xabc7('0x0'));var rimraf=require(_0xabc7('0x1'));var zipdir=require(_0xabc7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabc7('0x3'));var moment=require(_0xabc7('0x4'));var BPromise=require(_0xabc7('0x5'));var Mustache=require(_0xabc7('0x6'));var util=require(_0xabc7('0x7'));var path=require(_0xabc7('0x8'));var sox=require('sox');var csv=require(_0xabc7('0x9'));var ejs=require(_0xabc7('0xa'));var fs=require('fs');var fs_extra=require(_0xabc7('0xb'));var _=require(_0xabc7('0xc'));var squel=require(_0xabc7('0xd'));var crypto=require(_0xabc7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xabc7('0xf'));var toCsv=require('to-csv');var querystring=require(_0xabc7('0x10'));var Papa=require(_0xabc7('0x11'));var Redis=require(_0xabc7('0x12'));var authService=require(_0xabc7('0x13'));var qs=require(_0xabc7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xabc7('0x15'))('api');var utils=require(_0xabc7('0x16'));var config=require(_0xabc7('0x17'));var licenseUtil=require(_0xabc7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f1410,_0x4030f7){_0x4030f7=_0x4030f7||0xcc;return function(_0x58c9db){if(_0x58c9db){return _0x1f1410['sendStatus'](_0x4030f7);}return _0x1f1410[_0xabc7('0x19')](_0x4030f7)[_0xabc7('0x1a')]();};}function respondWithResult(_0x4db820,_0x218831){_0x218831=_0x218831||0xc8;return function(_0x4e1c98){if(_0x4e1c98){return _0x4db820[_0xabc7('0x19')](_0x218831)[_0xabc7('0x1b')](_0x4e1c98);}};}function respondWithFilteredResult(_0x3f3436,_0x2d4c5b){return function(_0x4b3575){if(_0x4b3575){var _0x50027a=typeof _0x2d4c5b[_0xabc7('0x1c')]===_0xabc7('0x1d')&&typeof _0x2d4c5b[_0xabc7('0x1e')]===_0xabc7('0x1d');var _0x5a184e=_0x4b3575['count'];var _0x4184e1=_0x50027a?0x0:_0x2d4c5b[_0xabc7('0x1c')];var _0x541a68=_0x50027a?_0x4b3575[_0xabc7('0x1f')]:_0x2d4c5b[_0xabc7('0x1c')]+_0x2d4c5b['limit'];var _0x273148;if(_0x541a68>=_0x5a184e){_0x541a68=_0x5a184e;_0x273148=0xc8;}else{_0x273148=0xce;}_0x3f3436[_0xabc7('0x19')](_0x273148);return _0x3f3436['set'](_0xabc7('0x20'),_0x4184e1+'-'+_0x541a68+'/'+_0x5a184e)['json'](_0x4b3575);}return null;};}function patchUpdates(_0x5905db){return function(_0x552ffa){try{jsonpatch[_0xabc7('0x21')](_0x552ffa,_0x5905db,!![]);}catch(_0x58ef0f){return BPromise[_0xabc7('0x22')](_0x58ef0f);}return _0x552ffa['save']();};}function saveUpdates(_0x4b13fa,_0x2862f9){return function(_0x20201c){if(_0x20201c){return _0x20201c[_0xabc7('0x23')](_0x4b13fa)['then'](function(_0x173881){return _0x173881;});}return null;};}function removeEntity(_0x390c50,_0x34dcc8){return function(_0x53d4fc){if(_0x53d4fc){return _0x53d4fc[_0xabc7('0x24')]()[_0xabc7('0x25')](function(){_0x390c50[_0xabc7('0x19')](0xcc)[_0xabc7('0x1a')]();});}};}function handleEntityNotFound(_0x924f1b,_0x52b87b){return function(_0x12ccd2){if(!_0x12ccd2){_0x924f1b[_0xabc7('0x26')](0x194);}return _0x12ccd2;};}function handleError(_0x10bb9e,_0x5b5a59){_0x5b5a59=_0x5b5a59||0x1f4;return function(_0xc42c6d){logger['error'](_0xc42c6d[_0xabc7('0x27')]);if(_0xc42c6d[_0xabc7('0x28')]){delete _0xc42c6d[_0xabc7('0x28')];}_0x10bb9e[_0xabc7('0x19')](_0x5b5a59)['send'](_0xc42c6d);};}exports['index']=function(_0x3b0bdc,_0x5dd2a3){var _0x5a4c1d={},_0x1fdbea={},_0x1df938={'count':0x0,'rows':[]};var _0x3cb4c9=_[_0xabc7('0x29')](db[_0xabc7('0x2a')][_0xabc7('0x2b')],function(_0x968c61){return{'name':_0x968c61[_0xabc7('0x2c')],'type':_0x968c61[_0xabc7('0x2d')][_0xabc7('0x2e')]};});_0x1fdbea['model']=_['map'](_0x3cb4c9,_0xabc7('0x28'));_0x1fdbea[_0xabc7('0x2f')]=_[_0xabc7('0x30')](_0x3b0bdc['query']);_0x1fdbea['filters']=_['intersection'](_0x1fdbea[_0xabc7('0x31')],_0x1fdbea[_0xabc7('0x2f')]);_0x5a4c1d[_0xabc7('0x32')]=_[_0xabc7('0x33')](_0x1fdbea[_0xabc7('0x31')],qs[_0xabc7('0x34')](_0x3b0bdc[_0xabc7('0x2f')][_0xabc7('0x34')]));_0x5a4c1d[_0xabc7('0x32')]=_0x5a4c1d[_0xabc7('0x32')][_0xabc7('0x35')]?_0x5a4c1d[_0xabc7('0x32')]:_0x1fdbea[_0xabc7('0x31')];if(!_0x3b0bdc[_0xabc7('0x2f')][_0xabc7('0x36')]('nolimit')){_0x5a4c1d[_0xabc7('0x1e')]=qs[_0xabc7('0x1e')](_0x3b0bdc[_0xabc7('0x2f')][_0xabc7('0x1e')]);_0x5a4c1d[_0xabc7('0x1c')]=qs[_0xabc7('0x1c')](_0x3b0bdc['query'][_0xabc7('0x1c')]);}_0x5a4c1d[_0xabc7('0x37')]=qs[_0xabc7('0x38')](_0x3b0bdc[_0xabc7('0x2f')][_0xabc7('0x38')]);_0x5a4c1d['where']=qs['filters'](_[_0xabc7('0x39')](_0x3b0bdc[_0xabc7('0x2f')],_0x1fdbea['filters']),_0x3cb4c9);if(_0x3b0bdc[_0xabc7('0x2f')][_0xabc7('0x3a')]){_0x5a4c1d[_0xabc7('0x3b')]=_[_0xabc7('0x3c')](_0x5a4c1d[_0xabc7('0x3b')],{'$or':_[_0xabc7('0x29')](_0x3cb4c9,function(_0x4dce4b){if(_0x4dce4b['type']!==_0xabc7('0x3d')){var _0x3110ab={};_0x3110ab[_0x4dce4b[_0xabc7('0x28')]]={'$like':'%'+_0x3b0bdc[_0xabc7('0x2f')][_0xabc7('0x3a')]+'%'};return _0x3110ab;}})});}_0x5a4c1d=_['merge']({},_0x5a4c1d,_0x3b0bdc[_0xabc7('0x3e')]);var _0x40a780={'where':_0x5a4c1d[_0xabc7('0x3b')]};return db[_0xabc7('0x2a')]['count'](_0x40a780)[_0xabc7('0x25')](function(_0x51c861){_0x1df938[_0xabc7('0x1f')]=_0x51c861;if(_0x3b0bdc[_0xabc7('0x2f')][_0xabc7('0x3f')]){_0x5a4c1d[_0xabc7('0x40')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x5a4c1d);})[_0xabc7('0x25')](function(_0x3444f3){_0x1df938['rows']=_0x3444f3;return _0x1df938;})[_0xabc7('0x25')](respondWithFilteredResult(_0x5dd2a3,_0x5a4c1d))[_0xabc7('0x41')](handleError(_0x5dd2a3,null));};exports[_0xabc7('0x42')]=function(_0x234ae8,_0x49abf1){var _0x5c21b1={'raw':!![],'where':{'id':_0x234ae8[_0xabc7('0x43')]['id']}},_0x1bec95={};_0x1bec95['model']=_[_0xabc7('0x30')](db[_0xabc7('0x2a')][_0xabc7('0x2b')]);_0x1bec95[_0xabc7('0x2f')]=_[_0xabc7('0x30')](_0x234ae8['query']);_0x1bec95['filters']=_[_0xabc7('0x33')](_0x1bec95[_0xabc7('0x31')],_0x1bec95['query']);_0x5c21b1[_0xabc7('0x32')]=_[_0xabc7('0x33')](_0x1bec95[_0xabc7('0x31')],qs[_0xabc7('0x34')](_0x234ae8['query']['fields']));_0x5c21b1[_0xabc7('0x32')]=_0x5c21b1[_0xabc7('0x32')][_0xabc7('0x35')]?_0x5c21b1['attributes']:_0x1bec95[_0xabc7('0x31')];if(_0x234ae8[_0xabc7('0x2f')][_0xabc7('0x3f')]){_0x5c21b1[_0xabc7('0x40')]=[{'all':!![]}];}_0x5c21b1=_['merge']({},_0x5c21b1,_0x234ae8[_0xabc7('0x3e')]);return db[_0xabc7('0x2a')][_0xabc7('0x44')](_0x5c21b1)[_0xabc7('0x25')](handleEntityNotFound(_0x49abf1,null))[_0xabc7('0x25')](respondWithResult(_0x49abf1,null))[_0xabc7('0x41')](handleError(_0x49abf1,null));};exports[_0xabc7('0x45')]=function(_0x24dacf,_0x3d835d){return db[_0xabc7('0x2a')][_0xabc7('0x45')](_0x24dacf[_0xabc7('0x46')],{})[_0xabc7('0x25')](respondWithResult(_0x3d835d,0xc9))['catch'](handleError(_0x3d835d,null));};exports[_0xabc7('0x23')]=function(_0x19b6ff,_0x109582){if(_0x19b6ff[_0xabc7('0x46')]['id']){delete _0x19b6ff[_0xabc7('0x46')]['id'];}return db[_0xabc7('0x2a')][_0xabc7('0x44')]({'where':{'id':_0x19b6ff['params']['id']}})[_0xabc7('0x25')](handleEntityNotFound(_0x109582,null))[_0xabc7('0x25')](saveUpdates(_0x19b6ff[_0xabc7('0x46')],null))[_0xabc7('0x25')](respondWithResult(_0x109582,null))[_0xabc7('0x41')](handleError(_0x109582,null));};exports[_0xabc7('0x24')]=function(_0x59dba6,_0x3e9665){return db[_0xabc7('0x2a')][_0xabc7('0x44')]({'where':{'id':_0x59dba6[_0xabc7('0x43')]['id']}})[_0xabc7('0x25')](handleEntityNotFound(_0x3e9665,null))[_0xabc7('0x25')](removeEntity(_0x3e9665,null))['catch'](handleError(_0x3e9665,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 45e6644..d6ba210 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 _0x1159=['define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes'];(function(_0x1d8432,_0x3776ea){var _0x5bde82=function(_0x1e5c67){while(--_0x1e5c67){_0x1d8432['push'](_0x1d8432['shift']());}};_0x5bde82(++_0x3776ea);}(_0x1159,0xf3));var _0x9115=function(_0x3df8df,_0x218f71){_0x3df8df=_0x3df8df-0x0;var _0x48578c=_0x1159[_0x3df8df];return _0x48578c;};'use strict';var _=require(_0x9115('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9115('0x1'));var moment=require(_0x9115('0x2'));var BPromise=require(_0x9115('0x3'));var rp=require(_0x9115('0x4'));var fs=require('fs');var path=require(_0x9115('0x5'));var rimraf=require(_0x9115('0x6'));var config=require(_0x9115('0x7'));var attributes=require(_0x9115('0x8'));module['exports']=function(_0x4a23ba,_0x3fd395){return _0x4a23ba[_0x9115('0x9')](_0x9115('0xa'),attributes,{'tableName':_0x9115('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9115('0xc'),'collate':_0x9115('0xd')});}; \ No newline at end of file +var _0xadb8=['path','rimraf','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise'];(function(_0x437b02,_0x34b630){var _0xf8c681=function(_0x28f83e){while(--_0x28f83e){_0x437b02['push'](_0x437b02['shift']());}};_0xf8c681(++_0x34b630);}(_0xadb8,0x1d0));var _0x8adb=function(_0x21b36c,_0x543483){_0x21b36c=_0x21b36c-0x0;var _0x236627=_0xadb8[_0x21b36c];return _0x236627;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8adb('0x0'))('api');var moment=require(_0x8adb('0x1'));var BPromise=require(_0x8adb('0x2'));var rp=require(_0x8adb('0x3'));var fs=require('fs');var path=require(_0x8adb('0x4'));var rimraf=require(_0x8adb('0x5'));var config=require(_0x8adb('0x6'));var attributes=require(_0x8adb('0x7'));module['exports']=function(_0x15bc63,_0x1a5f36){return _0x15bc63[_0x8adb('0x8')](_0x8adb('0x9'),attributes,{'tableName':_0x8adb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8adb('0xb'),'collate':_0x8adb('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index f8bc124..06b9272 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 _0x0a9a=['WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x1644f2,_0x2884e8){var _0x1fcb31=function(_0x41773c){while(--_0x41773c){_0x1644f2['push'](_0x1644f2['shift']());}};_0x1fcb31(++_0x2884e8);}(_0x0a9a,0x183));var _0xa0a9=function(_0x1ba18e,_0x335775){_0x1ba18e=_0x1ba18e-0x0;var _0xf31a91=_0x0a9a[_0x1ba18e];return _0xf31a91;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d689,_0x499a29,_0x2b2eb4){return new BPromise(function(_0x520f42,_0x10aa8a){return client[_0xa0a9('0xa')](_0x31d689,_0x2b2eb4)[_0xa0a9('0xb')](function(_0x2d6ac0){logger['info'](_0xa0a9('0xc'),_0x499a29,_0xa0a9('0xd'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x499a29,_0xa0a9('0xd'),JSON[_0xa0a9('0xe')](_0x2d6ac0));if(_0x2d6ac0['error']){if(_0x2d6ac0[_0xa0a9('0xf')]['code']===0x1f4){logger[_0xa0a9('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x10aa8a(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}logger[_0xa0a9('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x520f42(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}else{logger[_0xa0a9('0x11')](_0xa0a9('0xc'),_0x499a29,'request\x20sent');_0x520f42(_0x2d6ac0[_0xa0a9('0x12')]['message']);}})['catch'](function(_0x347092){logger[_0xa0a9('0xf')](_0xa0a9('0xc'),_0x499a29,_0x347092);_0x10aa8a(_0x347092);});});} \ No newline at end of file +var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x1b8d12,_0x18cde3){var _0x57c645=function(_0x464d38){while(--_0x464d38){_0x1b8d12['push'](_0x1b8d12['shift']());}};_0x57c645(++_0x18cde3);}(_0x55ca,0x126));var _0xa55c=function(_0x26a4ea,_0xa72fb8){_0x26a4ea=_0x26a4ea-0x0;var _0x1b669e=_0x55ca[_0x26a4ea];return _0x1b669e;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 7858551..0309d6d 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 _0x5d17=['whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','getMessages','download','post','create','addMessage','/:id/tags','whatsappinteraction:addtags','addTags','put','tracked'];(function(_0x4eb863,_0x4dfda9){var _0x456061=function(_0x41b406){while(--_0x41b406){_0x4eb863['push'](_0x4eb863['shift']());}};_0x456061(++_0x4dfda9);}(_0x5d17,0x114));var _0x75d1=function(_0x4d2993,_0x1c9473){_0x4d2993=_0x4d2993-0x0;var _0x427374=_0x5d17[_0x4d2993];return _0x427374;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var fs_extra=require(_0x75d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var controller=require(_0x75d1('0x7'));router[_0x75d1('0x8')]('/',auth['isAuthenticated'](),controller[_0x75d1('0x9')]);router[_0x75d1('0x8')](_0x75d1('0xa'),auth[_0x75d1('0xb')](),controller[_0x75d1('0xc')]);router[_0x75d1('0x8')](_0x75d1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x75d1('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x75d1('0xe')]);router[_0x75d1('0x8')]('/:id/download',auth[_0x75d1('0xb')](),controller[_0x75d1('0xf')]);router[_0x75d1('0x10')]('/',auth[_0x75d1('0xb')](),controller[_0x75d1('0x11')]);router[_0x75d1('0x10')]('/:id/messages',auth[_0x75d1('0xb')](),controller[_0x75d1('0x12')]);router[_0x75d1('0x10')](_0x75d1('0x13'),auth['isAuthenticated'](),interaction['tracked']('whatsapp',_0x75d1('0x14')),controller[_0x75d1('0x15')]);router[_0x75d1('0x16')]('/:id',auth[_0x75d1('0xb')](),interaction[_0x75d1('0x17')](_0x75d1('0x18'),_0x75d1('0x19')),controller[_0x75d1('0x1a')]);router[_0x75d1('0x1b')](_0x75d1('0xd'),auth[_0x75d1('0xb')](),interaction[_0x75d1('0x17')](_0x75d1('0x18'),_0x75d1('0x1c')),controller['destroy']);router['delete'](_0x75d1('0x13'),auth[_0x75d1('0xb')](),controller['removeTags']);module[_0x75d1('0x1d')]=router; \ No newline at end of file +var _0xba34=['removeTags','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','destroy','delete'];(function(_0x2af018,_0x5af3ca){var _0x1b6360=function(_0x346f7d){while(--_0x346f7d){_0x2af018['push'](_0x2af018['shift']());}};_0x1b6360(++_0x5af3ca);}(_0xba34,0x119));var _0x4ba3=function(_0x42053e,_0x545595){_0x42053e=_0x42053e-0x0;var _0xff8c3c=_0xba34[_0x42053e];return _0xff8c3c;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0x8')](_0x4ba3('0xe'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x8')]('/:id/download',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0x10')]);router['post']('/',auth[_0x4ba3('0x9')](),controller['create']);router[_0x4ba3('0x11')]('/:id/messages',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0x12')]);router[_0x4ba3('0x11')](_0x4ba3('0x13'),auth[_0x4ba3('0x9')](),interaction[_0x4ba3('0x14')](_0x4ba3('0x15'),_0x4ba3('0x16')),controller[_0x4ba3('0x17')]);router[_0x4ba3('0x18')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),interaction[_0x4ba3('0x14')](_0x4ba3('0x15'),_0x4ba3('0x19')),controller[_0x4ba3('0x1a')]);router['delete'](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),interaction[_0x4ba3('0x14')](_0x4ba3('0x15'),'whatsappinteraction:destroy'),controller[_0x4ba3('0x1b')]);router[_0x4ba3('0x1c')](_0x4ba3('0x13'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0x1d')]);module[_0x4ba3('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 2aa8943..b372d73 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 _0xd3c8=['out','INTEGER','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x9972af,_0x451342){var _0x5eed3c=function(_0x4b83b1){while(--_0x4b83b1){_0x9972af['push'](_0x9972af['shift']());}};_0x5eed3c(++_0x451342);}(_0xd3c8,0x161));var _0x8d3c=function(_0x246c8a,_0x436e0a){_0x246c8a=_0x246c8a-0x0;var _0xec552d=_0xd3c8[_0x246c8a];return _0xec552d;};'use strict';var Sequelize=require(_0x8d3c('0x0'));var moment=require(_0x8d3c('0x1'));module[_0x8d3c('0x2')]={'closed':{'type':Sequelize[_0x8d3c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8d3c('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8d3c('0x5')]},'thirdDisposition':{'type':Sequelize[_0x8d3c('0x5')]},'note':{'type':Sequelize[_0x8d3c('0x5')]},'phone':{'type':Sequelize[_0x8d3c('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x8d3c('0x6')]('in',_0x8d3c('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8d3c('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x8d3c('0x6')]('in',_0x8d3c('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8d3c('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x8d3c('0x8')]}}; \ No newline at end of file +var _0x49f8=['out','ENUM','INTEGER','sequelize','BOOLEAN','DATE','STRING'];(function(_0x3ababd,_0x58ab1c){var _0x461c5f=function(_0x510104){while(--_0x510104){_0x3ababd['push'](_0x3ababd['shift']());}};_0x461c5f(++_0x58ab1c);}(_0x49f8,0xff));var _0x849f=function(_0x1b338e,_0x25ac31){_0x1b338e=_0x1b338e-0x0;var _0x3ae2f4=_0x49f8[_0x1b338e];return _0x3ae2f4;};'use strict';var Sequelize=require(_0x849f('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x849f('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x849f('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x849f('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x849f('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x849f('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x849f('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x849f('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x849f('0x5')]('in',_0x849f('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x849f('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x849f('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 889f181..c36579b 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 _0x934b=['set','Content-Range','destroy','then','error','stack','name','send','index','type','key','getOptions','findAll','query','user','catch','show','model','WhatsappInteraction','rawAttributes','keys','filters','attributes','intersection','fields','length','include','merge','options','find','create','body','update','params','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','sort','where','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','read','WhatsappAccount','Account','get','mkdirSync','Owner','fullname','closed','closedAt','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','secret','value','renderFile','views','downloadInteraction.ejs','Whatsapp','createPdfFromHTML','log','err','rimraf','zip-dir','moment','bluebird','path','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','end','json','offset','undefined','limit','count'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x934b,0xe4));var _0xb934=function(_0x36f5cb,_0x2a720f){_0x36f5cb=_0x36f5cb-0x0;var _0x58d6ce=_0x934b[_0x36f5cb];return _0x58d6ce;};'use strict';var rimraf=require(_0xb934('0x0'));var zipdir=require(_0xb934('0x1'));var moment=require(_0xb934('0x2'));var BPromise=require(_0xb934('0x3'));var util=require('util');var path=require(_0xb934('0x4'));var ejs=require(_0xb934('0x5'));var fs=require('fs');var _=require(_0xb934('0x6'));var Redis=require(_0xb934('0x7'));var interaction=require(_0xb934('0x8'));var qs=require(_0xb934('0x9'));var pdf=require(_0xb934('0xa'));var logger=require(_0xb934('0xb'))('api');var config=require(_0xb934('0xc'));var db=require('../../mysqldb')['db'];config[_0xb934('0xd')]=_['defaults'](config[_0xb934('0xd')],{'host':_0xb934('0xe'),'port':0x18eb});var socket=require(_0xb934('0xf'))(new Redis(config[_0xb934('0xd')]));require(_0xb934('0x10'))[_0xb934('0x11')](socket);function respondWithStatusCode(_0x275c3f,_0x552155){_0x552155=_0x552155||0xcc;return function(_0x4ab59d){if(_0x4ab59d){return _0x275c3f[_0xb934('0x12')](_0x552155);}return _0x275c3f[_0xb934('0x13')](_0x552155)[_0xb934('0x14')]();};}function respondWithResult(_0x1c7234,_0x4b1bab){_0x4b1bab=_0x4b1bab||0xc8;return function(_0x431934){if(_0x431934){return _0x1c7234[_0xb934('0x13')](_0x4b1bab)[_0xb934('0x15')](_0x431934);}};}function respondWithFilteredResult(_0xd5fab4,_0x516d6a){return function(_0x3590d9){if(_0x3590d9){var _0x24ce2f=typeof _0x516d6a[_0xb934('0x16')]===_0xb934('0x17')&&typeof _0x516d6a[_0xb934('0x18')]===_0xb934('0x17');var _0x512642=_0x3590d9[_0xb934('0x19')];var _0x1ea202=_0x24ce2f?0x0:_0x516d6a[_0xb934('0x16')];var _0x15f749=_0x24ce2f?_0x3590d9[_0xb934('0x19')]:_0x516d6a[_0xb934('0x16')]+_0x516d6a[_0xb934('0x18')];var _0x122b4a;if(_0x15f749>=_0x512642){_0x15f749=_0x512642;_0x122b4a=0xc8;}else{_0x122b4a=0xce;}_0xd5fab4['status'](_0x122b4a);return _0xd5fab4[_0xb934('0x1a')](_0xb934('0x1b'),_0x1ea202+'-'+_0x15f749+'/'+_0x512642)[_0xb934('0x15')](_0x3590d9);}return null;};}function saveUpdates(_0x4d2de5){return function(_0x474d89){if(_0x474d89){return _0x474d89['update'](_0x4d2de5)['then'](function(_0xde2c30){return _0xde2c30;});}return null;};}function removeEntity(_0xf0c0d){return function(_0x2cfdc4){if(_0x2cfdc4){return _0x2cfdc4[_0xb934('0x1c')]()[_0xb934('0x1d')](function(){_0xf0c0d[_0xb934('0x13')](0xcc)[_0xb934('0x14')]();});}};}function handleEntityNotFound(_0x2db191){return function(_0x46ff39){if(!_0x46ff39){_0x2db191[_0xb934('0x12')](0x194);}return _0x46ff39;};}function handleError(_0x8b21f6,_0x269644){_0x269644=_0x269644||0x1f4;return function(_0x36416c){logger[_0xb934('0x1e')](_0x36416c[_0xb934('0x1f')]);if(_0x36416c[_0xb934('0x20')]){delete _0x36416c['name'];}_0x8b21f6[_0xb934('0x13')](_0x269644)[_0xb934('0x21')](_0x36416c);};}exports[_0xb934('0x22')]=function(_0x3a8ed3,_0x103329){var _0x1c8078={};var _0x4517e0=_['map'](db['WhatsappInteraction']['rawAttributes'],function(_0x214c23){return{'name':_0x214c23['fieldName'],'type':_0x214c23[_0xb934('0x23')][_0xb934('0x24')]};});_0x1c8078=qs[_0xb934('0x25')](_0x4517e0,_0x3a8ed3);return interaction[_0xb934('0x26')]('whatsapp',_0x3a8ed3[_0xb934('0x27')],_0x3a8ed3[_0xb934('0x28')],_0x1c8078,_0x4517e0)[_0xb934('0x1d')](respondWithFilteredResult(_0x103329,_0x1c8078))[_0xb934('0x29')](handleError(_0x103329,null));};exports[_0xb934('0x2a')]=function(_0xf30b02,_0x402e3f){var _0x50e0f5={'raw':![],'where':{'id':_0xf30b02['params']['id']}},_0x26c32b={};_0x26c32b[_0xb934('0x2b')]=_['keys'](db[_0xb934('0x2c')][_0xb934('0x2d')]);_0x26c32b['query']=_[_0xb934('0x2e')](_0xf30b02[_0xb934('0x27')]);_0x26c32b[_0xb934('0x2f')]=_['intersection'](_0x26c32b[_0xb934('0x2b')],_0x26c32b[_0xb934('0x27')]);_0x50e0f5[_0xb934('0x30')]=_[_0xb934('0x31')](_0x26c32b[_0xb934('0x2b')],qs[_0xb934('0x32')](_0xf30b02[_0xb934('0x27')][_0xb934('0x32')]));_0x50e0f5[_0xb934('0x30')]=_0x50e0f5[_0xb934('0x30')][_0xb934('0x33')]?_0x50e0f5[_0xb934('0x30')]:_0x26c32b[_0xb934('0x2b')];if(_0xf30b02[_0xb934('0x27')]['includeAll']){_0x50e0f5[_0xb934('0x34')]=[{'all':!![]}];}_0x50e0f5=_[_0xb934('0x35')]({},_0x50e0f5,_0xf30b02[_0xb934('0x36')]);return db['WhatsappInteraction'][_0xb934('0x37')](_0x50e0f5)[_0xb934('0x1d')](handleEntityNotFound(_0x402e3f,null))[_0xb934('0x1d')](respondWithResult(_0x402e3f,null))[_0xb934('0x29')](handleError(_0x402e3f,null));};exports[_0xb934('0x38')]=function(_0x26a08e,_0x43f6a5){return db[_0xb934('0x2c')]['create'](_0x26a08e[_0xb934('0x39')],{})[_0xb934('0x1d')](respondWithResult(_0x43f6a5,0xc9))[_0xb934('0x29')](handleError(_0x43f6a5,null));};exports[_0xb934('0x3a')]=function(_0x76fbf5,_0x1db6d2){if(_0x76fbf5[_0xb934('0x39')]['id']){delete _0x76fbf5['body']['id'];}return db[_0xb934('0x2c')]['find']({'where':{'id':_0x76fbf5[_0xb934('0x3b')]['id']}})[_0xb934('0x1d')](handleEntityNotFound(_0x1db6d2,null))[_0xb934('0x1d')](saveUpdates(_0x76fbf5[_0xb934('0x39')],null))[_0xb934('0x1d')](respondWithResult(_0x1db6d2,null))[_0xb934('0x29')](handleError(_0x1db6d2,null));};exports[_0xb934('0x1c')]=function(_0x41fb3e,_0x3203aa){return db[_0xb934('0x2c')]['find']({'where':{'id':_0x41fb3e[_0xb934('0x3b')]['id']}})[_0xb934('0x1d')](handleEntityNotFound(_0x3203aa,null))[_0xb934('0x1d')](removeEntity(_0x3203aa,null))[_0xb934('0x29')](handleError(_0x3203aa,null));};exports[_0xb934('0x3c')]=function(_0xcffc90,_0x2d3265){return db['WhatsappInteraction']['describe']()[_0xb934('0x1d')](respondWithResult(_0x2d3265,null))[_0xb934('0x29')](handleError(_0x2d3265,null));};exports[_0xb934('0x3d')]=function(_0x28b3af,_0x4f9054){return db[_0xb934('0x3e')]['find']({'where':{'id':_0x28b3af[_0xb934('0x3b')]['id']}})[_0xb934('0x1d')](handleEntityNotFound(_0x4f9054,null))[_0xb934('0x1d')](function(_0x2cb12d){if(_0x2cb12d){return _0x2cb12d['addMessage'](_0x28b3af[_0xb934('0x39')]['ids'],_[_0xb934('0x3f')](_0x28b3af[_0xb934('0x39')],[_0xb934('0x40'),'id'])||{});}})[_0xb934('0x1d')](respondWithResult(_0x4f9054,null))[_0xb934('0x29')](handleError(_0x4f9054,null));};exports[_0xb934('0x41')]=function(_0x567ed8,_0x4119a6){var _0xb65684={'raw':![],'where':{}};var _0x2d8070={};var _0x5f41ee={'count':0x0,'rows':[]};return db[_0xb934('0x2c')][_0xb934('0x42')]({'where':{'id':_0x567ed8[_0xb934('0x3b')]['id']}})[_0xb934('0x1d')](handleEntityNotFound(_0x4119a6,null))[_0xb934('0x1d')](function(_0x470a2e){if(_0x470a2e){_0x2d8070[_0xb934('0x2b')]=_[_0xb934('0x2e')](db[_0xb934('0x3e')]['rawAttributes']);_0x2d8070[_0xb934('0x27')]=_[_0xb934('0x2e')](_0x567ed8[_0xb934('0x27')]);_0x2d8070[_0xb934('0x2f')]=_[_0xb934('0x31')](_0x2d8070['model'],_0x2d8070[_0xb934('0x27')]);_0xb65684['attributes']=_[_0xb934('0x31')](_0x2d8070['model'],qs[_0xb934('0x32')](_0x567ed8['query']['fields']));_0xb65684[_0xb934('0x30')]=_0xb65684[_0xb934('0x30')][_0xb934('0x33')]?_0xb65684[_0xb934('0x30')]:_0x2d8070[_0xb934('0x2b')];if(!_0x567ed8[_0xb934('0x27')]['hasOwnProperty']('nolimit')){_0xb65684[_0xb934('0x18')]=qs[_0xb934('0x18')](_0x567ed8['query'][_0xb934('0x18')]);_0xb65684['offset']=qs[_0xb934('0x16')](_0x567ed8[_0xb934('0x27')]['offset']);}_0xb65684['order']=qs[_0xb934('0x43')](_0x567ed8[_0xb934('0x27')][_0xb934('0x43')]);_0xb65684[_0xb934('0x44')]=qs[_0xb934('0x2f')](_[_0xb934('0x45')](_0x567ed8[_0xb934('0x27')],_0x2d8070[_0xb934('0x2f')]));_0xb65684[_0xb934('0x44')]['WhatsappInteractionId']=_0x470a2e['id'];if(_0x567ed8[_0xb934('0x27')]['filter']){_0xb65684[_0xb934('0x44')]=_[_0xb934('0x35')](_0xb65684[_0xb934('0x44')],{'$or':_['map'](_0xb65684[_0xb934('0x30')],function(_0x48ae08){var _0xcfef17={};_0xcfef17[_0x48ae08]={'$like':'%'+_0x567ed8[_0xb934('0x27')]['filter']+'%'};return _0xcfef17;})});}if(_0x567ed8['query'][_0xb934('0x46')]){var _0x509247=_0x567ed8[_0xb934('0x27')][_0xb934('0x46')]['split'](',');var _0x5ae47c={};_0x5ae47c[_0x509247[0x0]]={'$gte':moment(_0x509247[0x1])[_0xb934('0x47')](_0xb934('0x48'))};_0xb65684[_0xb934('0x44')]=_[_0xb934('0x35')](_0xb65684[_0xb934('0x44')],_0x5ae47c);}_0xb65684=_[_0xb934('0x35')]({},_0xb65684,_0x567ed8['options']);return db['WhatsappMessage']['count']({'where':_0xb65684[_0xb934('0x44')]})[_0xb934('0x1d')](function(_0x18c4d0){_0x5f41ee['count']=_0x18c4d0;if(_0x567ed8[_0xb934('0x27')][_0xb934('0x49')]){_0xb65684[_0xb934('0x34')]=[{'all':!![]}];}return db[_0xb934('0x3e')][_0xb934('0x26')](_0xb65684);})[_0xb934('0x1d')](function(_0x2ccd57){_0x5f41ee[_0xb934('0x4a')]=_0x2ccd57;return _0x5f41ee;});}})['then'](respondWithFilteredResult(_0x4119a6,_0xb65684))['catch'](handleError(_0x4119a6,null));};exports[_0xb934('0x4b')]=function(_0x571297,_0x24f179){return db[_0xb934('0x2c')]['find']({'where':{'id':_0x571297[_0xb934('0x3b')]['id']}})[_0xb934('0x1d')](handleEntityNotFound(_0x24f179,null))[_0xb934('0x1d')](function(_0x55a508){if(_0x55a508){return _0x55a508[_0xb934('0x4c')](_0x571297['body'][_0xb934('0x40')],_[_0xb934('0x3f')](_0x571297[_0xb934('0x39')],[_0xb934('0x40'),'id'])||{})[_0xb934('0x4d')](function(){return db[_0xb934('0x4e')][_0xb934('0x26')]({'attributes':['id',_0xb934('0x20'),_0xb934('0x4f')],'where':{'id':_0x571297[_0xb934('0x39')][_0xb934('0x40')]}});})[_0xb934('0x1d')](function(_0x4976c2){socket[_0xb934('0x50')](_0xb934('0x51'),{'id':Number(_0x571297['params']['id']),'tags':_0x4976c2||[]});return{'id':Number(_0x571297[_0xb934('0x3b')]['id']),'tags':_0x4976c2||[]};});}})[_0xb934('0x1d')](respondWithResult(_0x24f179,null))[_0xb934('0x29')](handleError(_0x24f179,null));};exports['removeTags']=function(_0x9cee34,_0x2584fd){return db['WhatsappInteraction'][_0xb934('0x37')]({'where':{'id':_0x9cee34['params']['id']}})[_0xb934('0x1d')](handleEntityNotFound(_0x2584fd,null))[_0xb934('0x1d')](function(_0x170f87){if(_0x170f87){return _0x170f87[_0xb934('0x52')](_0x9cee34['query'][_0xb934('0x40')]);}})['then'](respondWithStatusCode(_0x2584fd,null))['catch'](handleError(_0x2584fd,null));};exports[_0xb934('0x53')]=function(_0x25064e,_0x1feef5){var _0x3ed5e2=moment()[_0xb934('0x54')]()[_0xb934('0x55')]();var _0x17a0ad=path[_0xb934('0x56')](config[_0xb934('0x57')],_0xb934('0x58'),_0xb934('0x59'),_0xb934('0x5a'));var _0x281a14=path['join'](config[_0xb934('0x57')],_0xb934('0x58'),_0xb934('0x59'),_0xb934('0x5b'));var _0xb0eb06=path[_0xb934('0x56')](_0x17a0ad,_0x3ed5e2);var _0x154c39=util[_0xb934('0x47')](_0xb934('0x5c'),_0x25064e[_0xb934('0x3b')]['id'],_0x3ed5e2);var _0x3c11fd=path['join'](_0x17a0ad,_0x154c39);var _0x2467bc=[];_0x2467bc[_0xb934('0x5d')]({'model':db[_0xb934('0x5e')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x2467bc[_0xb934('0x5d')]({'model':db['CmContact'],'as':_0xb934('0x5f'),'attributes':['id',_0xb934('0x60'),_0xb934('0x61')],'raw':!![]});if(_0x25064e[_0xb934('0x27')][_0xb934('0x5b')]){_0x2467bc[_0xb934('0x5d')]({'model':db[_0xb934('0x62')],'as':_0xb934('0x62'),'raw':!![]});}var _0x3efa21=[{'model':db['WhatsappMessage'],'as':_0xb934('0x63'),'attributes':['id',_0xb934('0x39'),_0xb934('0x64'),_0xb934('0x65'),'secret',_0xb934('0x66')],'include':_0x2467bc}];_0x3efa21[_0xb934('0x5d')]({'model':db[_0xb934('0x67')],'as':_0xb934('0x68'),'attributes':['id',_0xb934('0x20')]});_0x3efa21[_0xb934('0x5d')]({'model':db[_0xb934('0x5e')],'as':'Owner','attributes':['id','fullname']});return db[_0xb934('0x2c')][_0xb934('0x37')]({'where':{'id':_0x25064e[_0xb934('0x3b')]['id']},'include':_0x3efa21})['then'](handleEntityNotFound(_0x1feef5,null))[_0xb934('0x1d')](function(_0x346aeb){if(_0x346aeb){var _0x3c7eba=_0x346aeb[_0xb934('0x69')]({'plain':!![]});fs[_0xb934('0x6a')](_0xb0eb06);var _0x18ad00={'channel':'Whatsapp','account':_0x3c7eba[_0xb934('0x68')]['name'],'agent':_0x3c7eba[_0xb934('0x6b')]?_0x3c7eba['Owner'][_0xb934('0x6c')]:'N.A.','createdAt':moment(_0x3c7eba['createdAt'])[_0xb934('0x47')](_0xb934('0x48'))[_0xb934('0x55')](),'closedAt':_0x3c7eba[_0xb934('0x6d')]?moment(_0x3c7eba[_0xb934('0x6e')])[_0xb934('0x47')](_0xb934('0x48'))[_0xb934('0x55')]():'','disposition':_0x3c7eba['disposition'],'messages':_(_0x3c7eba[_0xb934('0x63')])['filter']({'secret':![]})['map'](function(_0x682c88){if(_0x682c88[_0xb934('0x62')]){var _0x2f99ce=path[_0xb934('0x56')](_0x281a14,_0x682c88[_0xb934('0x62')][_0xb934('0x6f')]);if(fs[_0xb934('0x70')](_0x2f99ce)){fs[_0xb934('0x71')](_0x2f99ce)[_0xb934('0x72')](fs[_0xb934('0x73')](path[_0xb934('0x56')](_0xb0eb06,_0x682c88[_0xb934('0x62')][_0xb934('0x6f')])));}}return{'date':moment(_0x682c88[_0xb934('0x64')])[_0xb934('0x47')](_0xb934('0x48'))['toString'](),'sender':_0x682c88[_0xb934('0x65')]===_0xb934('0x74')?_0x682c88['User']?_0x682c88[_0xb934('0x5e')][_0xb934('0x6c')]:_0xb934('0x75'):_0x682c88['Contact'][_0xb934('0x60')]+(_0x682c88['Contact']['lastName']?'\x20'+_0x682c88[_0xb934('0x5f')]['lastName']:''),'body':_0x682c88[_0xb934('0x62')]?_0x682c88[_0xb934('0x62')][_0xb934('0x6f')]:_0x682c88[_0xb934('0x39')],'direction':_0x682c88[_0xb934('0x65')]===_0xb934('0x74')?'A':'C','secret':_0x682c88[_0xb934('0x76')],'read':_0x682c88[_0xb934('0x66')],'attachment':_0x682c88[_0xb934('0x62')]};})[_0xb934('0x77')]()};return ejs[_0xb934('0x78')](path[_0xb934('0x56')](config[_0xb934('0x57')],_0xb934('0x58'),_0xb934('0x79'),_0xb934('0x7a')),{'interaction':_0x18ad00})[_0xb934('0x1d')](function(_0x251d4e){var _0x355610=path[_0xb934('0x56')](_0xb0eb06,'transcript-'+_0x3c7eba['id']+'-'+_0x3ed5e2+'.pdf');var _0x195fa5={'path':_0x355610,'channel':_0xb934('0x7b'),'interactionId':_0x3c7eba['id']};return pdf[_0xb934('0x7c')](_0x251d4e,_0x195fa5);})[_0xb934('0x1d')](function(){return new BPromise(function(_0x2a622d,_0x519545){zipdir(_0xb0eb06,{'saveTo':_0x3c11fd},function(_0x40cede,_0x622182){if(_0x40cede)return _0x519545(_0x40cede);return _0x2a622d(_0x622182);});})[_0xb934('0x1d')](function(){return new BPromise(function(_0x382072,_0x36b155){rimraf(_0xb0eb06,function(_0x50bb81){if(_0x50bb81)_0x36b155(_0x50bb81);return _0x382072();});});})[_0xb934('0x1d')](function(){return _0x1feef5[_0xb934('0x53')](_0x3c11fd,_0x154c39,function(_0x337fe4){if(_0x337fe4){console[_0xb934('0x7d')](_0xb934('0x7e'),_0x337fe4);}else{fs['unlinkSync'](_0x3c11fd);}});});});}else{return _0x1feef5[_0xb934('0x12')](0xc8);}})[_0xb934('0x29')](handleError(_0x1feef5,null));}; \ No newline at end of file +var _0xef75=['catch','describe','addMessage','WhatsappMessage','ids','findOne','length','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','merge','map','$gte','split','format','findAll','rows','spread','Tag','whatsappInteractionTags:save','removeTags','download','toString','root','server','files','tmp','join','push','User','fullname','CmContact','Contact','firstName','lastName','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','Messages','filter','Attachment','basename','existsSync','pipe','createWriteStream','out','System','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','bluebird','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','sendStatus','stack','name','send','index','type','key','getOptions','whatsapp','query','user','show','params','model','keys','WhatsappInteraction','rawAttributes','filters','attributes','intersection','fields','includeAll','options','find','create','body'];(function(_0x18235d,_0x378e2e){var _0xa3ea08=function(_0x29170c){while(--_0x29170c){_0x18235d['push'](_0x18235d['shift']());}};_0xa3ea08(++_0x378e2e);}(_0xef75,0x13e));var _0x5ef7=function(_0x5d6772,_0x42674a){_0x5d6772=_0x5d6772-0x0;var _0x495b87=_0xef75[_0x5d6772];return _0x495b87;};'use strict';var rimraf=require(_0x5ef7('0x0'));var zipdir=require(_0x5ef7('0x1'));var moment=require('moment');var BPromise=require(_0x5ef7('0x2'));var util=require('util');var path=require('path');var ejs=require(_0x5ef7('0x3'));var fs=require('fs');var _=require(_0x5ef7('0x4'));var Redis=require(_0x5ef7('0x5'));var interaction=require(_0x5ef7('0x6'));var qs=require(_0x5ef7('0x7'));var pdf=require(_0x5ef7('0x8'));var logger=require(_0x5ef7('0x9'))(_0x5ef7('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x5ef7('0xb')]=_[_0x5ef7('0xc')](config[_0x5ef7('0xb')],{'host':_0x5ef7('0xd'),'port':0x18eb});var socket=require(_0x5ef7('0xe'))(new Redis(config[_0x5ef7('0xb')]));require(_0x5ef7('0xf'))[_0x5ef7('0x10')](socket);function respondWithStatusCode(_0x3d5b2b,_0x4fae86){_0x4fae86=_0x4fae86||0xcc;return function(_0x4ff186){if(_0x4ff186){return _0x3d5b2b['sendStatus'](_0x4fae86);}return _0x3d5b2b[_0x5ef7('0x11')](_0x4fae86)[_0x5ef7('0x12')]();};}function respondWithResult(_0x21ed14,_0x33f100){_0x33f100=_0x33f100||0xc8;return function(_0x3e583a){if(_0x3e583a){return _0x21ed14[_0x5ef7('0x11')](_0x33f100)[_0x5ef7('0x13')](_0x3e583a);}};}function respondWithFilteredResult(_0x12e3cb,_0x3ac47f){return function(_0x254c45){if(_0x254c45){var _0x4ad4e2=typeof _0x3ac47f[_0x5ef7('0x14')]===_0x5ef7('0x15')&&typeof _0x3ac47f[_0x5ef7('0x16')]===_0x5ef7('0x15');var _0x377e1b=_0x254c45[_0x5ef7('0x17')];var _0x591bbf=_0x4ad4e2?0x0:_0x3ac47f[_0x5ef7('0x14')];var _0x21ee80=_0x4ad4e2?_0x254c45[_0x5ef7('0x17')]:_0x3ac47f['offset']+_0x3ac47f['limit'];var _0xf87929;if(_0x21ee80>=_0x377e1b){_0x21ee80=_0x377e1b;_0xf87929=0xc8;}else{_0xf87929=0xce;}_0x12e3cb[_0x5ef7('0x11')](_0xf87929);return _0x12e3cb['set'](_0x5ef7('0x18'),_0x591bbf+'-'+_0x21ee80+'/'+_0x377e1b)[_0x5ef7('0x13')](_0x254c45);}return null;};}function saveUpdates(_0x841e3a){return function(_0x2e2bdc){if(_0x2e2bdc){return _0x2e2bdc[_0x5ef7('0x19')](_0x841e3a)[_0x5ef7('0x1a')](function(_0x475771){return _0x475771;});}return null;};}function removeEntity(_0x2eeb82){return function(_0x2fad17){if(_0x2fad17){return _0x2fad17[_0x5ef7('0x1b')]()['then'](function(){_0x2eeb82[_0x5ef7('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4354e8){return function(_0xdc57e3){if(!_0xdc57e3){_0x4354e8[_0x5ef7('0x1c')](0x194);}return _0xdc57e3;};}function handleError(_0x2fa958,_0x34873f){_0x34873f=_0x34873f||0x1f4;return function(_0x1678c1){logger['error'](_0x1678c1[_0x5ef7('0x1d')]);if(_0x1678c1[_0x5ef7('0x1e')]){delete _0x1678c1[_0x5ef7('0x1e')];}_0x2fa958[_0x5ef7('0x11')](_0x34873f)[_0x5ef7('0x1f')](_0x1678c1);};}exports[_0x5ef7('0x20')]=function(_0x547023,_0x272b2c){var _0x5c7539={};var _0x308692=_['map'](db['WhatsappInteraction']['rawAttributes'],function(_0x186e0a){return{'name':_0x186e0a['fieldName'],'type':_0x186e0a[_0x5ef7('0x21')][_0x5ef7('0x22')]};});_0x5c7539=qs[_0x5ef7('0x23')](_0x308692,_0x547023);return interaction['findAll'](_0x5ef7('0x24'),_0x547023[_0x5ef7('0x25')],_0x547023[_0x5ef7('0x26')],_0x5c7539,_0x308692)['then'](respondWithFilteredResult(_0x272b2c,_0x5c7539))['catch'](handleError(_0x272b2c,null));};exports[_0x5ef7('0x27')]=function(_0x50cec8,_0xd90890){var _0x3482bf={'raw':![],'where':{'id':_0x50cec8[_0x5ef7('0x28')]['id']}},_0x1900a0={};_0x1900a0[_0x5ef7('0x29')]=_[_0x5ef7('0x2a')](db[_0x5ef7('0x2b')][_0x5ef7('0x2c')]);_0x1900a0[_0x5ef7('0x25')]=_[_0x5ef7('0x2a')](_0x50cec8[_0x5ef7('0x25')]);_0x1900a0[_0x5ef7('0x2d')]=_['intersection'](_0x1900a0[_0x5ef7('0x29')],_0x1900a0[_0x5ef7('0x25')]);_0x3482bf[_0x5ef7('0x2e')]=_[_0x5ef7('0x2f')](_0x1900a0[_0x5ef7('0x29')],qs[_0x5ef7('0x30')](_0x50cec8['query'][_0x5ef7('0x30')]));_0x3482bf['attributes']=_0x3482bf[_0x5ef7('0x2e')]['length']?_0x3482bf[_0x5ef7('0x2e')]:_0x1900a0[_0x5ef7('0x29')];if(_0x50cec8['query'][_0x5ef7('0x31')]){_0x3482bf['include']=[{'all':!![]}];}_0x3482bf=_['merge']({},_0x3482bf,_0x50cec8[_0x5ef7('0x32')]);return db[_0x5ef7('0x2b')][_0x5ef7('0x33')](_0x3482bf)[_0x5ef7('0x1a')](handleEntityNotFound(_0xd90890,null))[_0x5ef7('0x1a')](respondWithResult(_0xd90890,null))['catch'](handleError(_0xd90890,null));};exports['create']=function(_0x5edb10,_0x22da0d){return db['WhatsappInteraction'][_0x5ef7('0x34')](_0x5edb10[_0x5ef7('0x35')],{})[_0x5ef7('0x1a')](respondWithResult(_0x22da0d,0xc9))[_0x5ef7('0x36')](handleError(_0x22da0d,null));};exports['update']=function(_0x3b8aea,_0x1e0c54){if(_0x3b8aea[_0x5ef7('0x35')]['id']){delete _0x3b8aea['body']['id'];}return db[_0x5ef7('0x2b')]['find']({'where':{'id':_0x3b8aea[_0x5ef7('0x28')]['id']}})['then'](handleEntityNotFound(_0x1e0c54,null))[_0x5ef7('0x1a')](saveUpdates(_0x3b8aea['body'],null))[_0x5ef7('0x1a')](respondWithResult(_0x1e0c54,null))[_0x5ef7('0x36')](handleError(_0x1e0c54,null));};exports['destroy']=function(_0x248358,_0x543b85){return db[_0x5ef7('0x2b')]['find']({'where':{'id':_0x248358[_0x5ef7('0x28')]['id']}})[_0x5ef7('0x1a')](handleEntityNotFound(_0x543b85,null))[_0x5ef7('0x1a')](removeEntity(_0x543b85,null))[_0x5ef7('0x36')](handleError(_0x543b85,null));};exports['describe']=function(_0xd15fa9,_0x2e5660){return db[_0x5ef7('0x2b')][_0x5ef7('0x37')]()['then'](respondWithResult(_0x2e5660,null))[_0x5ef7('0x36')](handleError(_0x2e5660,null));};exports[_0x5ef7('0x38')]=function(_0x1237c4,_0x1d69f6){return db[_0x5ef7('0x39')][_0x5ef7('0x33')]({'where':{'id':_0x1237c4[_0x5ef7('0x28')]['id']}})['then'](handleEntityNotFound(_0x1d69f6,null))['then'](function(_0x307cd7){if(_0x307cd7){return _0x307cd7[_0x5ef7('0x38')](_0x1237c4['body'][_0x5ef7('0x3a')],_['omit'](_0x1237c4[_0x5ef7('0x35')],[_0x5ef7('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x1d69f6,null))[_0x5ef7('0x36')](handleError(_0x1d69f6,null));};exports['getMessages']=function(_0x558496,_0x5c84ad){var _0x1cc88b={'raw':![],'where':{}};var _0xa1f331={};var _0x3e2347={'count':0x0,'rows':[]};return db[_0x5ef7('0x2b')][_0x5ef7('0x3b')]({'where':{'id':_0x558496[_0x5ef7('0x28')]['id']}})[_0x5ef7('0x1a')](handleEntityNotFound(_0x5c84ad,null))[_0x5ef7('0x1a')](function(_0x4d7f4d){if(_0x4d7f4d){_0xa1f331[_0x5ef7('0x29')]=_['keys'](db['WhatsappMessage']['rawAttributes']);_0xa1f331[_0x5ef7('0x25')]=_[_0x5ef7('0x2a')](_0x558496['query']);_0xa1f331[_0x5ef7('0x2d')]=_[_0x5ef7('0x2f')](_0xa1f331[_0x5ef7('0x29')],_0xa1f331[_0x5ef7('0x25')]);_0x1cc88b[_0x5ef7('0x2e')]=_[_0x5ef7('0x2f')](_0xa1f331[_0x5ef7('0x29')],qs[_0x5ef7('0x30')](_0x558496[_0x5ef7('0x25')][_0x5ef7('0x30')]));_0x1cc88b[_0x5ef7('0x2e')]=_0x1cc88b[_0x5ef7('0x2e')][_0x5ef7('0x3c')]?_0x1cc88b[_0x5ef7('0x2e')]:_0xa1f331[_0x5ef7('0x29')];if(!_0x558496[_0x5ef7('0x25')][_0x5ef7('0x3d')](_0x5ef7('0x3e'))){_0x1cc88b['limit']=qs[_0x5ef7('0x16')](_0x558496['query'][_0x5ef7('0x16')]);_0x1cc88b[_0x5ef7('0x14')]=qs[_0x5ef7('0x14')](_0x558496[_0x5ef7('0x25')][_0x5ef7('0x14')]);}_0x1cc88b[_0x5ef7('0x3f')]=qs['sort'](_0x558496['query'][_0x5ef7('0x40')]);_0x1cc88b[_0x5ef7('0x41')]=qs[_0x5ef7('0x2d')](_[_0x5ef7('0x42')](_0x558496['query'],_0xa1f331['filters']));_0x1cc88b['where'][_0x5ef7('0x43')]=_0x4d7f4d['id'];if(_0x558496[_0x5ef7('0x25')]['filter']){_0x1cc88b[_0x5ef7('0x41')]=_[_0x5ef7('0x44')](_0x1cc88b['where'],{'$or':_[_0x5ef7('0x45')](_0x1cc88b[_0x5ef7('0x2e')],function(_0x5655a4){var _0x47a50f={};_0x47a50f[_0x5655a4]={'$like':'%'+_0x558496[_0x5ef7('0x25')]['filter']+'%'};return _0x47a50f;})});}if(_0x558496[_0x5ef7('0x25')][_0x5ef7('0x46')]){var _0x6e7ee2=_0x558496[_0x5ef7('0x25')][_0x5ef7('0x46')][_0x5ef7('0x47')](',');var _0x36d56a={};_0x36d56a[_0x6e7ee2[0x0]]={'$gte':moment(_0x6e7ee2[0x1])[_0x5ef7('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1cc88b[_0x5ef7('0x41')]=_[_0x5ef7('0x44')](_0x1cc88b['where'],_0x36d56a);}_0x1cc88b=_[_0x5ef7('0x44')]({},_0x1cc88b,_0x558496[_0x5ef7('0x32')]);return db[_0x5ef7('0x39')]['count']({'where':_0x1cc88b[_0x5ef7('0x41')]})[_0x5ef7('0x1a')](function(_0x1c0a7e){_0x3e2347[_0x5ef7('0x17')]=_0x1c0a7e;if(_0x558496[_0x5ef7('0x25')][_0x5ef7('0x31')]){_0x1cc88b['include']=[{'all':!![]}];}return db[_0x5ef7('0x39')][_0x5ef7('0x49')](_0x1cc88b);})[_0x5ef7('0x1a')](function(_0x16b89d){_0x3e2347[_0x5ef7('0x4a')]=_0x16b89d;return _0x3e2347;});}})['then'](respondWithFilteredResult(_0x5c84ad,_0x1cc88b))['catch'](handleError(_0x5c84ad,null));};exports['addTags']=function(_0x105f49,_0x3ac1d2){return db['WhatsappInteraction'][_0x5ef7('0x33')]({'where':{'id':_0x105f49[_0x5ef7('0x28')]['id']}})[_0x5ef7('0x1a')](handleEntityNotFound(_0x3ac1d2,null))[_0x5ef7('0x1a')](function(_0x14167a){if(_0x14167a){return _0x14167a['setTags'](_0x105f49['body']['ids'],_['omit'](_0x105f49[_0x5ef7('0x35')],[_0x5ef7('0x3a'),'id'])||{})[_0x5ef7('0x4b')](function(){return db[_0x5ef7('0x4c')][_0x5ef7('0x49')]({'attributes':['id','name','color'],'where':{'id':_0x105f49['body'][_0x5ef7('0x3a')]}});})['then'](function(_0x1a646e){socket['emit'](_0x5ef7('0x4d'),{'id':Number(_0x105f49[_0x5ef7('0x28')]['id']),'tags':_0x1a646e||[]});return{'id':Number(_0x105f49[_0x5ef7('0x28')]['id']),'tags':_0x1a646e||[]};});}})[_0x5ef7('0x1a')](respondWithResult(_0x3ac1d2,null))[_0x5ef7('0x36')](handleError(_0x3ac1d2,null));};exports[_0x5ef7('0x4e')]=function(_0x395893,_0x15dae4){return db[_0x5ef7('0x2b')][_0x5ef7('0x33')]({'where':{'id':_0x395893[_0x5ef7('0x28')]['id']}})[_0x5ef7('0x1a')](handleEntityNotFound(_0x15dae4,null))['then'](function(_0x447747){if(_0x447747){return _0x447747[_0x5ef7('0x4e')](_0x395893[_0x5ef7('0x25')][_0x5ef7('0x3a')]);}})[_0x5ef7('0x1a')](respondWithStatusCode(_0x15dae4,null))['catch'](handleError(_0x15dae4,null));};exports[_0x5ef7('0x4f')]=function(_0x1d7301,_0x515048){var _0x45b8d3=moment()['unix']()[_0x5ef7('0x50')]();var _0x2df73c=path['join'](config[_0x5ef7('0x51')],_0x5ef7('0x52'),_0x5ef7('0x53'),_0x5ef7('0x54'));var _0x112689=path[_0x5ef7('0x55')](config['root'],_0x5ef7('0x52'),_0x5ef7('0x53'),'attachments');var _0x57ccba=path[_0x5ef7('0x55')](_0x2df73c,_0x45b8d3);var _0x30cf1e=util[_0x5ef7('0x48')]('transcript-%d-%s.zip',_0x1d7301[_0x5ef7('0x28')]['id'],_0x45b8d3);var _0x2381ef=path['join'](_0x2df73c,_0x30cf1e);var _0x1a9fca=[];_0x1a9fca[_0x5ef7('0x56')]({'model':db[_0x5ef7('0x57')],'as':_0x5ef7('0x57'),'attributes':['id',_0x5ef7('0x58')],'raw':!![]});_0x1a9fca[_0x5ef7('0x56')]({'model':db[_0x5ef7('0x59')],'as':_0x5ef7('0x5a'),'attributes':['id',_0x5ef7('0x5b'),_0x5ef7('0x5c')],'raw':!![]});if(_0x1d7301[_0x5ef7('0x25')]['attachments']){_0x1a9fca[_0x5ef7('0x56')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0xe0eb88=[{'model':db[_0x5ef7('0x39')],'as':'Messages','attributes':['id',_0x5ef7('0x35'),_0x5ef7('0x5d'),_0x5ef7('0x5e'),_0x5ef7('0x5f'),_0x5ef7('0x60')],'include':_0x1a9fca}];_0xe0eb88[_0x5ef7('0x56')]({'model':db[_0x5ef7('0x61')],'as':_0x5ef7('0x62'),'attributes':['id','name']});_0xe0eb88['push']({'model':db['User'],'as':_0x5ef7('0x63'),'attributes':['id',_0x5ef7('0x58')]});return db[_0x5ef7('0x2b')]['find']({'where':{'id':_0x1d7301['params']['id']},'include':_0xe0eb88})['then'](handleEntityNotFound(_0x515048,null))[_0x5ef7('0x1a')](function(_0x41fe9c){if(_0x41fe9c){var _0x4e3a19=_0x41fe9c['get']({'plain':!![]});fs[_0x5ef7('0x64')](_0x57ccba);var _0x3b169e={'channel':_0x5ef7('0x65'),'account':_0x4e3a19[_0x5ef7('0x62')][_0x5ef7('0x1e')],'agent':_0x4e3a19['Owner']?_0x4e3a19[_0x5ef7('0x63')][_0x5ef7('0x58')]:_0x5ef7('0x66'),'createdAt':moment(_0x4e3a19[_0x5ef7('0x5d')])[_0x5ef7('0x48')](_0x5ef7('0x67'))[_0x5ef7('0x50')](),'closedAt':_0x4e3a19[_0x5ef7('0x68')]?moment(_0x4e3a19['closedAt'])[_0x5ef7('0x48')](_0x5ef7('0x67'))[_0x5ef7('0x50')]():'','disposition':_0x4e3a19[_0x5ef7('0x69')],'messages':_(_0x4e3a19[_0x5ef7('0x6a')])[_0x5ef7('0x6b')]({'secret':![]})[_0x5ef7('0x45')](function(_0x69d307){if(_0x69d307[_0x5ef7('0x6c')]){var _0x3ac1ec=path[_0x5ef7('0x55')](_0x112689,_0x69d307[_0x5ef7('0x6c')][_0x5ef7('0x6d')]);if(fs[_0x5ef7('0x6e')](_0x3ac1ec)){fs['createReadStream'](_0x3ac1ec)[_0x5ef7('0x6f')](fs[_0x5ef7('0x70')](path[_0x5ef7('0x55')](_0x57ccba,_0x69d307[_0x5ef7('0x6c')]['basename'])));}}return{'date':moment(_0x69d307[_0x5ef7('0x5d')])[_0x5ef7('0x48')](_0x5ef7('0x67'))[_0x5ef7('0x50')](),'sender':_0x69d307[_0x5ef7('0x5e')]===_0x5ef7('0x71')?_0x69d307[_0x5ef7('0x57')]?_0x69d307[_0x5ef7('0x57')][_0x5ef7('0x58')]:_0x5ef7('0x72'):_0x69d307['Contact']['firstName']+(_0x69d307[_0x5ef7('0x5a')][_0x5ef7('0x5c')]?'\x20'+_0x69d307[_0x5ef7('0x5a')][_0x5ef7('0x5c')]:''),'body':_0x69d307[_0x5ef7('0x6c')]?_0x69d307[_0x5ef7('0x6c')][_0x5ef7('0x6d')]:_0x69d307['body'],'direction':_0x69d307[_0x5ef7('0x5e')]===_0x5ef7('0x71')?'A':'C','secret':_0x69d307[_0x5ef7('0x5f')],'read':_0x69d307[_0x5ef7('0x60')],'attachment':_0x69d307[_0x5ef7('0x6c')]};})[_0x5ef7('0x73')]()};return ejs[_0x5ef7('0x74')](path[_0x5ef7('0x55')](config[_0x5ef7('0x51')],_0x5ef7('0x52'),_0x5ef7('0x75'),_0x5ef7('0x76')),{'interaction':_0x3b169e})['then'](function(_0x1a979d){var _0x56ff86=path['join'](_0x57ccba,'transcript-'+_0x4e3a19['id']+'-'+_0x45b8d3+_0x5ef7('0x77'));var _0x40d7b7={'path':_0x56ff86,'channel':'Whatsapp','interactionId':_0x4e3a19['id']};return pdf[_0x5ef7('0x78')](_0x1a979d,_0x40d7b7);})[_0x5ef7('0x1a')](function(){return new BPromise(function(_0x26e063,_0x4a06e4){zipdir(_0x57ccba,{'saveTo':_0x2381ef},function(_0x99d2ed,_0xa042b6){if(_0x99d2ed)return _0x4a06e4(_0x99d2ed);return _0x26e063(_0xa042b6);});})[_0x5ef7('0x1a')](function(){return new BPromise(function(_0xba5f65,_0x2bfb3d){rimraf(_0x57ccba,function(_0x41d301){if(_0x41d301)_0x2bfb3d(_0x41d301);return _0xba5f65();});});})[_0x5ef7('0x1a')](function(){return _0x515048['download'](_0x2381ef,_0x30cf1e,function(_0x2b2f72){if(_0x2b2f72){console[_0x5ef7('0x79')](_0x5ef7('0x7a'),_0x2b2f72);}else{fs[_0x5ef7('0x7b')](_0x2381ef);}});});});}else{return _0x515048['sendStatus'](0xc8);}})[_0x5ef7('0x36')](handleError(_0x515048,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index aff353e..b9b0f3e 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 _0x823c=['hook','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','getUsers','setDataValue','findAll','emit','catch','hasOwnProperty'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x823c,0x143));var _0xc823=function(_0x3d2405,_0x1e397f){_0x3d2405=_0x3d2405-0x0;var _0x5ddd8d=_0x823c[_0x3d2405];return _0x5ddd8d;};'use strict';var EventEmitter=require(_0xc823('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xc823('0x1')];var WhatsappMessage=require(_0xc823('0x2'))['db'][_0xc823('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xc823('0x4')](0x0);var events={'afterCreate':_0xc823('0x5'),'afterUpdate':_0xc823('0x6'),'afterDestroy':'remove'};function emitEvent(_0x3309cc){return function(_0x35dedf,_0x122228,_0x42e0c0){_0x35dedf[_0xc823('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xba407e){_0x35dedf[_0xc823('0x8')]('Users',_0xba407e['map'](function(_0x4478fc){return{'id':_0x4478fc['id']};}));return WhatsappMessage[_0xc823('0x9')]({'where':{'WhatsappInteractionId':_0x35dedf['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x43bbd8){_0x35dedf[_0xc823('0x8')]('unreadMessages',_0x43bbd8['length']);WhatsappInteractionEvents[_0xc823('0xa')](_0x3309cc+':'+_0x35dedf['id'],_0x35dedf);WhatsappInteractionEvents[_0xc823('0xa')](_0x3309cc,_0x35dedf);_0x42e0c0(null);})[_0xc823('0xb')](_0x42e0c0(null));};}for(var e in events){if(events[_0xc823('0xc')](e)){var event=events[e];WhatsappInteraction[_0xc823('0xd')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x80df=['length','emit','catch','hasOwnProperty','events','../../mysqldb','WhatsappInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x33b489,_0x1d8efb){var _0x179e16=function(_0xe1e7fa){while(--_0xe1e7fa){_0x33b489['push'](_0x33b489['shift']());}};_0x179e16(++_0x1d8efb);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xf80d('0x0'));var WhatsappInteraction=require(_0xf80d('0x1'))['db'][_0xf80d('0x2')];var WhatsappMessage=require(_0xf80d('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xf80d('0x3')](0x0);var events={'afterCreate':_0xf80d('0x4'),'afterUpdate':_0xf80d('0x5'),'afterDestroy':_0xf80d('0x6')};function emitEvent(_0x15d302){return function(_0xa6b1bb,_0x26fb05,_0xeffeb7){_0xa6b1bb[_0xf80d('0x7')]({'attributes':['id'],'raw':!![]})[_0xf80d('0x8')](function(_0x5068d4){_0xa6b1bb[_0xf80d('0x9')](_0xf80d('0xa'),_0x5068d4[_0xf80d('0xb')](function(_0x15fa69){return{'id':_0x15fa69['id']};}));return WhatsappMessage[_0xf80d('0xc')]({'where':{'WhatsappInteractionId':_0xa6b1bb['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf80d('0x8')](function(_0x41595f){_0xa6b1bb[_0xf80d('0x9')](_0xf80d('0xd'),_0x41595f[_0xf80d('0xe')]);WhatsappInteractionEvents[_0xf80d('0xf')](_0x15d302+':'+_0xa6b1bb['id'],_0xa6b1bb);WhatsappInteractionEvents[_0xf80d('0xf')](_0x15d302,_0xa6b1bb);_0xeffeb7(null);})[_0xf80d('0x10')](_0xeffeb7(null));};}for(var e in events){if(events[_0xf80d('0x11')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index d1059c1..7275212 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 _0xaa23=['./whatsappInteraction.attributes','exports','define','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0xaa23,0x158));var _0x3aa2=function(_0x2bc09e,_0x1ae747){_0x2bc09e=_0x2bc09e-0x0;var _0x3f7c75=_0xaa23[_0x2bc09e];return _0x3f7c75;};'use strict';var _=require(_0x3aa2('0x0'));var util=require(_0x3aa2('0x1'));var logger=require(_0x3aa2('0x2'))(_0x3aa2('0x3'));var moment=require(_0x3aa2('0x4'));var BPromise=require(_0x3aa2('0x5'));var rp=require(_0x3aa2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3aa2('0x7'));var config=require('../../config/environment');var attributes=require(_0x3aa2('0x8'));module[_0x3aa2('0x9')]=function(_0x349da4,_0x36e8e1){return _0x349da4[_0x3aa2('0xa')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd5053b,_0x3a09d3,_0x53934b){if(_0xd5053b[_0x3aa2('0xb')](_0x3aa2('0xc'))){_0xd5053b[_0x3aa2('0xd')]=moment()[_0x3aa2('0xe')](_0x3aa2('0xf'));}_0x53934b(null,_0xd5053b);}}});}; \ No newline at end of file +var _0x31b5=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','changed','closed','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2144f1,_0x2e9834){var _0x2dfd94=function(_0x2dac2a){while(--_0x2dac2a){_0x2144f1['push'](_0x2144f1['shift']());}};_0x2dfd94(++_0x2e9834);}(_0x31b5,0x159));var _0x531b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x31b5[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x531b('0x0'));var util=require(_0x531b('0x1'));var logger=require(_0x531b('0x2'))(_0x531b('0x3'));var moment=require(_0x531b('0x4'));var BPromise=require(_0x531b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x531b('0x6'));var rimraf=require(_0x531b('0x7'));var config=require(_0x531b('0x8'));var attributes=require(_0x531b('0x9'));module[_0x531b('0xa')]=function(_0x47aead,_0xc03408){return _0x47aead['define'](_0x531b('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c4230,_0x353a64,_0x470f37){if(_0x3c4230[_0x531b('0xc')](_0x531b('0xd'))){_0x3c4230['closedAt']=moment()['format'](_0x531b('0xe'));}_0x470f37(null,_0x3c4230);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 474b1de..96559ab 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 _0x0368=['catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x4c15ee,_0x7d6508){var _0x57327b=function(_0x5845a9){while(--_0x5845a9){_0x4c15ee['push'](_0x4c15ee['shift']());}};_0x57327b(++_0x7d6508);}(_0x0368,0xdc));var _0x8036=function(_0x56f935,_0xbb3e13){_0x56f935=_0x56f935-0x0;var _0x25ff2f=_0x0368[_0x56f935];return _0x25ff2f;};'use strict';var _=require(_0x8036('0x0'));var util=require(_0x8036('0x1'));var moment=require(_0x8036('0x2'));var BPromise=require(_0x8036('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8036('0x4'));var db=require(_0x8036('0x5'))['db'];var utils=require(_0x8036('0x6'));var logger=require(_0x8036('0x7'))(_0x8036('0x8'));var config=require(_0x8036('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8036('0xa')]({'port':0x232a});config[_0x8036('0xb')]=_[_0x8036('0xc')](config[_0x8036('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8036('0xd'))[_0x8036('0xe')](socket);function respondWithRpcPromise(_0x36bb94,_0xdd7ae5,_0x2015e1){return new BPromise(function(_0x122fad,_0x523635){return client[_0x8036('0xf')](_0x36bb94,_0x2015e1)[_0x8036('0x10')](function(_0x3052c2){logger[_0x8036('0x11')](_0x8036('0x12'),_0xdd7ae5,_0x8036('0x13'));logger[_0x8036('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0xdd7ae5,'request\x20sent',JSON[_0x8036('0x15')](_0x3052c2));if(_0x3052c2[_0x8036('0x16')]){if(_0x3052c2[_0x8036('0x16')][_0x8036('0x17')]===0x1f4){logger[_0x8036('0x16')](_0x8036('0x12'),_0xdd7ae5,_0x3052c2[_0x8036('0x16')][_0x8036('0x18')]);return _0x523635(_0x3052c2['error'][_0x8036('0x18')]);}logger['error'](_0x8036('0x12'),_0xdd7ae5,_0x3052c2[_0x8036('0x16')]['message']);return _0x122fad(_0x3052c2[_0x8036('0x16')][_0x8036('0x18')]);}else{logger[_0x8036('0x11')](_0x8036('0x12'),_0xdd7ae5,'request\x20sent');_0x122fad(_0x3052c2[_0x8036('0x19')]['message']);}})[_0x8036('0x1a')](function(_0x1332d3){logger[_0x8036('0x16')](_0x8036('0x12'),_0xdd7ae5,_0x1332d3);_0x523635(_0x1332d3);});});}exports[_0x8036('0x1b')]=function(_0x36d38b){var _0x5e982d=this;return new Promise(function(_0x281e18,_0x31e063){return db[_0x8036('0x1c')][_0x8036('0x1d')](_0x36d38b[_0x8036('0x1e')],{'raw':_0x36d38b[_0x8036('0x1f')]?_0x36d38b['options'][_0x8036('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36d38b['options']?_0x36d38b[_0x8036('0x1f')][_0x8036('0x21')]||null:null,'attributes':_0x36d38b[_0x8036('0x1f')]?_0x36d38b[_0x8036('0x1f')][_0x8036('0x22')]||null:null,'limit':_0x36d38b[_0x8036('0x1f')]?_0x36d38b[_0x8036('0x1f')][_0x8036('0x23')]||null:null})[_0x8036('0x10')](function(_0x40e5d9){logger['info']('UpdateWhatsappInteraction',_0x36d38b);logger[_0x8036('0x14')](_0x8036('0x1b'),_0x36d38b,JSON[_0x8036('0x15')](_0x40e5d9));_0x281e18(_0x40e5d9);})[_0x8036('0x1a')](function(_0x1c579e){logger[_0x8036('0x16')](_0x8036('0x1b'),_0x1c579e[_0x8036('0x18')],_0x36d38b);_0x31e063(_0x5e982d['error'](0x1f4,_0x1c579e[_0x8036('0x18')]));});});};exports[_0x8036('0x24')]=function(_0x5e3879){return new Promise(function(_0x54035d,_0x10bdb6){return db[_0x8036('0x1c')][_0x8036('0x25')]({'where':_0x5e3879[_0x8036('0x1f')]?_0x5e3879[_0x8036('0x1f')][_0x8036('0x21')]||null:null})[_0x8036('0x10')](function(_0xcf6e21){if(_0xcf6e21){return _0xcf6e21['addTags'](_0x5e3879[_0x8036('0x1e')]['ids'],_[_0x8036('0x26')](_0x5e3879['body'],['ids','id'])||{});}})[_0x8036('0x27')](function(_0x484b2c){logger['info'](_0x8036('0x28'),_0x5e3879);logger[_0x8036('0x14')](_0x8036('0x28'),_0x5e3879,JSON[_0x8036('0x15')](_0x484b2c));_0x54035d(_0x484b2c);})[_0x8036('0x1a')](function(_0x421720){logger[_0x8036('0x16')](_0x8036('0x28'),_0x421720['message'],_0x5e3879);_0x10bdb6(_this[_0x8036('0x16')](0x1f4,_0x421720[_0x8036('0x18')]));});});}; \ No newline at end of file +var _0x9d43=['options','raw','attributes','limit','WhatsappInteraction','find','body','ids','omit','spread','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','update'];(function(_0x1d7d6c,_0x1adcf5){var _0x14d772=function(_0xdd4d79){while(--_0xdd4d79){_0x1d7d6c['push'](_0x1d7d6c['shift']());}};_0x14d772(++_0x1adcf5);}(_0x9d43,0xcd));var _0x39d4=function(_0x2b2252,_0x5b3717){_0x2b2252=_0x2b2252-0x0;var _0x55a3a2=_0x9d43[_0x2b2252];return _0x55a3a2;};'use strict';var _=require(_0x39d4('0x0'));var util=require(_0x39d4('0x1'));var moment=require('moment');var BPromise=require(_0x39d4('0x2'));var rs=require(_0x39d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39d4('0x4'))['db'];var utils=require(_0x39d4('0x5'));var logger=require('../../config/logger')(_0x39d4('0x6'));var config=require('../../config/environment');var jayson=require(_0x39d4('0x7'));var client=jayson['client'][_0x39d4('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x39d4('0x9')],{'host':_0x39d4('0xa'),'port':0x18eb});var socket=require(_0x39d4('0xb'))(new Redis(config[_0x39d4('0x9')]));require(_0x39d4('0xc'))[_0x39d4('0xd')](socket);function respondWithRpcPromise(_0x3656bf,_0x348c1b,_0x4e30ed){return new BPromise(function(_0xa72e55,_0x4d8fca){return client[_0x39d4('0xe')](_0x3656bf,_0x4e30ed)[_0x39d4('0xf')](function(_0x2a973f){logger[_0x39d4('0x10')](_0x39d4('0x11'),_0x348c1b,_0x39d4('0x12'));logger[_0x39d4('0x13')](_0x39d4('0x14'),_0x348c1b,'request\x20sent',JSON[_0x39d4('0x15')](_0x2a973f));if(_0x2a973f[_0x39d4('0x16')]){if(_0x2a973f[_0x39d4('0x16')][_0x39d4('0x17')]===0x1f4){logger[_0x39d4('0x16')](_0x39d4('0x11'),_0x348c1b,_0x2a973f[_0x39d4('0x16')]['message']);return _0x4d8fca(_0x2a973f['error'][_0x39d4('0x18')]);}logger[_0x39d4('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x348c1b,_0x2a973f[_0x39d4('0x16')][_0x39d4('0x18')]);return _0xa72e55(_0x2a973f[_0x39d4('0x16')]['message']);}else{logger[_0x39d4('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x348c1b,_0x39d4('0x12'));_0xa72e55(_0x2a973f[_0x39d4('0x19')][_0x39d4('0x18')]);}})[_0x39d4('0x1a')](function(_0xc8af74){logger['error'](_0x39d4('0x11'),_0x348c1b,_0xc8af74);_0x4d8fca(_0xc8af74);});});}exports[_0x39d4('0x1b')]=function(_0x4a9f27){var _0x1d9194=this;return new Promise(function(_0x36e4e7,_0x39f661){return db['WhatsappInteraction'][_0x39d4('0x1c')](_0x4a9f27['body'],{'raw':_0x4a9f27[_0x39d4('0x1d')]?_0x4a9f27[_0x39d4('0x1d')][_0x39d4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a9f27[_0x39d4('0x1d')]?_0x4a9f27[_0x39d4('0x1d')]['where']||null:null,'attributes':_0x4a9f27[_0x39d4('0x1d')]?_0x4a9f27[_0x39d4('0x1d')][_0x39d4('0x1f')]||null:null,'limit':_0x4a9f27[_0x39d4('0x1d')]?_0x4a9f27[_0x39d4('0x1d')][_0x39d4('0x20')]||null:null})[_0x39d4('0xf')](function(_0x5dc6f7){logger['info']('UpdateWhatsappInteraction',_0x4a9f27);logger[_0x39d4('0x13')](_0x39d4('0x1b'),_0x4a9f27,JSON[_0x39d4('0x15')](_0x5dc6f7));_0x36e4e7(_0x5dc6f7);})[_0x39d4('0x1a')](function(_0x3e595c){logger['error'](_0x39d4('0x1b'),_0x3e595c['message'],_0x4a9f27);_0x39f661(_0x1d9194[_0x39d4('0x16')](0x1f4,_0x3e595c[_0x39d4('0x18')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x3945be){return new Promise(function(_0x1feacb,_0x158b67){return db[_0x39d4('0x21')][_0x39d4('0x22')]({'where':_0x3945be[_0x39d4('0x1d')]?_0x3945be[_0x39d4('0x1d')]['where']||null:null})['then'](function(_0x50c8a7){if(_0x50c8a7){return _0x50c8a7['addTags'](_0x3945be[_0x39d4('0x23')][_0x39d4('0x24')],_[_0x39d4('0x25')](_0x3945be[_0x39d4('0x23')],['ids','id'])||{});}})[_0x39d4('0x26')](function(_0x20ed47){logger[_0x39d4('0x10')]('AddTags',_0x3945be);logger[_0x39d4('0x13')]('AddTags',_0x3945be,JSON[_0x39d4('0x15')](_0x20ed47));_0x1feacb(_0x20ed47);})[_0x39d4('0x1a')](function(_0x128bb5){logger[_0x39d4('0x16')]('AddTags',_0x128bb5[_0x39d4('0x18')],_0x3945be);_0x158b67(_this[_0x39d4('0x16')](0x1f4,_0x128bb5[_0x39d4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 6b8f651..d89948b 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 _0x315d=['remove','removeListener','register','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x315d,0x13f));var _0xd315=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x315d[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappInteractionEvents=require(_0xd315('0x0'));var events=['save',_0xd315('0x1'),'update'];function createListener(_0x19e3fb,_0x41b033){return function(_0x18d144){_0x41b033['emit'](_0x19e3fb,_0x18d144);};}function removeListener(_0x5e6a1a,_0x1da5fd){return function(){WhatsappInteractionEvents[_0xd315('0x2')](_0x5e6a1a,_0x1da5fd);};}exports[_0xd315('0x3')]=function(_0x229c12){for(var _0x55a62=0x0,_0x389cb2=events['length'];_0x55a62<_0x389cb2;_0x55a62++){var _0xe86b73=events[_0x55a62];var _0x5054bc=createListener(_0xd315('0x4')+_0xe86b73,_0x229c12);WhatsappInteractionEvents['on'](_0xe86b73,_0x5054bc);}}; \ No newline at end of file +var _0x05c2=['./whatsappInteraction.events','save','emit','removeListener','register'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x05c2,0x1ae));var _0x205c=function(_0x288dcb,_0x5ae43a){_0x288dcb=_0x288dcb-0x0;var _0x1fa9cd=_0x05c2[_0x288dcb];return _0x1fa9cd;};'use strict';var WhatsappInteractionEvents=require(_0x205c('0x0'));var events=[_0x205c('0x1'),'remove','update'];function createListener(_0x19e15e,_0x3b9ed6){return function(_0x43578b){_0x3b9ed6[_0x205c('0x2')](_0x19e15e,_0x43578b);};}function removeListener(_0x4f1e37,_0x7eb231){return function(){WhatsappInteractionEvents[_0x205c('0x3')](_0x4f1e37,_0x7eb231);};}exports[_0x205c('0x4')]=function(_0x5ecb9c){for(var _0x61031b=0x0,_0x14abec=events['length'];_0x61031b<_0x14abec;_0x61031b++){var _0x2c09af=events[_0x61031b];var _0x25cc43=createListener('whatsappInteraction:'+_0x2c09af,_0x5ecb9c);WhatsappInteractionEvents['on'](_0x2c09af,_0x25cc43);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index a19d0f0..6662ad3 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 _0x68b8=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','describe','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','multer'];(function(_0x5d83f5,_0x11a1d5){var _0x3dc53d=function(_0x49369d){while(--_0x49369d){_0x5d83f5['push'](_0x5d83f5['shift']());}};_0x3dc53d(++_0x11a1d5);}(_0x68b8,0x1ca));var _0x868b=function(_0x580d0e,_0x1e5f43){_0x580d0e=_0x580d0e-0x0;var _0xb51111=_0x68b8[_0x580d0e];return _0xb51111;};'use strict';var multer=require(_0x868b('0x0'));var util=require(_0x868b('0x1'));var path=require('path');var timeout=require(_0x868b('0x2'));var express=require(_0x868b('0x3'));var router=express[_0x868b('0x4')]();var fs_extra=require(_0x868b('0x5'));var auth=require(_0x868b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x868b('0x7'));var controller=require(_0x868b('0x8'));router[_0x868b('0x9')]('/',auth[_0x868b('0xa')](),controller['index']);router[_0x868b('0x9')]('/describe',auth[_0x868b('0xa')](),controller[_0x868b('0xb')]);router[_0x868b('0x9')]('/:id',auth[_0x868b('0xa')](),controller[_0x868b('0xc')]);router[_0x868b('0xd')]('/',auth[_0x868b('0xa')](),interaction[_0x868b('0xe')](_0x868b('0xf'),_0x868b('0x10')),controller[_0x868b('0x11')]);router['post'](_0x868b('0x12'),controller[_0x868b('0x13')]);router[_0x868b('0x14')](_0x868b('0x15'),auth[_0x868b('0xa')](),controller[_0x868b('0x16')]);router['put'](_0x868b('0x17'),auth['isAuthenticated'](),controller[_0x868b('0x18')]);router[_0x868b('0x14')](_0x868b('0x19'),auth[_0x868b('0xa')](),controller[_0x868b('0x1a')]);router['delete'](_0x868b('0x15'),auth[_0x868b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb074=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','whatsappmessage:create','create','post','/:id/status','put','update','accept','/:id/reject','reject','delete'];(function(_0x3a07c1,_0x34d57f){var _0x2bbe15=function(_0x5a02fb){while(--_0x5a02fb){_0x3a07c1['push'](_0x3a07c1['shift']());}};_0x2bbe15(++_0x34d57f);}(_0xb074,0x1e8));var _0x4b07=function(_0x5e9d70,_0x37d7a1){_0x5e9d70=_0x5e9d70-0x0;var _0x415475=_0xb074[_0x5e9d70];return _0x415475;};'use strict';var multer=require(_0x4b07('0x0'));var util=require(_0x4b07('0x1'));var path=require('path');var timeout=require(_0x4b07('0x2'));var express=require('express');var router=express[_0x4b07('0x3')]();var fs_extra=require(_0x4b07('0x4'));var auth=require(_0x4b07('0x5'));var interaction=require(_0x4b07('0x6'));var config=require(_0x4b07('0x7'));var controller=require(_0x4b07('0x8'));router[_0x4b07('0x9')]('/',auth[_0x4b07('0xa')](),controller['index']);router['get'](_0x4b07('0xb'),auth[_0x4b07('0xa')](),controller[_0x4b07('0xc')]);router[_0x4b07('0x9')](_0x4b07('0xd'),auth[_0x4b07('0xa')](),controller[_0x4b07('0xe')]);router['post']('/',auth[_0x4b07('0xa')](),interaction['tracked']('whatsapp',_0x4b07('0xf')),controller[_0x4b07('0x10')]);router[_0x4b07('0x11')](_0x4b07('0x12'),controller['status']);router[_0x4b07('0x13')](_0x4b07('0xd'),auth[_0x4b07('0xa')](),controller[_0x4b07('0x14')]);router[_0x4b07('0x13')]('/:id/accept',auth[_0x4b07('0xa')](),controller[_0x4b07('0x15')]);router[_0x4b07('0x13')](_0x4b07('0x16'),auth['isAuthenticated'](),controller[_0x4b07('0x17')]);router[_0x4b07('0x18')](_0x4b07('0xd'),auth[_0x4b07('0xa')](),controller[_0x4b07('0x19')]);module[_0x4b07('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 5d25261..76432aa 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 _0xf87a=['medium','out','STRING','DATE','BOOLEAN','TEXT','sequelize','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xf87a,0xf6));var _0xaf87=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf87a[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xaf87('0x0'));module[_0xaf87('0x1')]={'body':{'type':Sequelize['TEXT'](_0xaf87('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xaf87('0x3')),'defaultValue':_0xaf87('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xaf87('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xaf87('0x5')]},'secret':{'type':Sequelize[_0xaf87('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xaf87('0x4')]},'providerResponse':{'type':Sequelize[_0xaf87('0x7')]}}; \ No newline at end of file +var _0xd1c3=['TEXT','BOOLEAN','ENUM','STRING','DATE','sequelize','exports'];(function(_0xd258c2,_0x2c2fa9){var _0x52fb59=function(_0x430f00){while(--_0x430f00){_0xd258c2['push'](_0xd258c2['shift']());}};_0x52fb59(++_0x2c2fa9);}(_0xd1c3,0x11d));var _0x3d1c=function(_0x4ff2a4,_0x250f2c){_0x4ff2a4=_0x4ff2a4-0x0;var _0x438811=_0xd1c3[_0x4ff2a4];return _0x438811;};'use strict';var Sequelize=require(_0x3d1c('0x0'));module[_0x3d1c('0x1')]={'body':{'type':Sequelize[_0x3d1c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3d1c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3d1c('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x3d1c('0x5')](0xbe)},'phone':{'type':Sequelize[_0x3d1c('0x5')]},'readAt':{'type':Sequelize[_0x3d1c('0x6')]},'secret':{'type':Sequelize[_0x3d1c('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3d1c('0x5')]},'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 474b5b4..b608380 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 _0x790f=['User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','WhatsappInteraction','RejectMessage','rejectMessage','format','EventManager','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','WhatsappMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','body','describe','whatsapp-interactions','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteractionId','isNil','interaction','get','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0x790f,0x1bf));var _0xf790=function(_0x48c615,_0x4cc757){_0x48c615=_0x48c615-0x0;var _0x3d9e22=_0x790f[_0x48c615];return _0x3d9e22;};'use strict';var emlformat=require(_0xf790('0x0'));var rimraf=require(_0xf790('0x1'));var zipdir=require(_0xf790('0x2'));var jsonpatch=require(_0xf790('0x3'));var rp=require(_0xf790('0x4'));var moment=require(_0xf790('0x5'));var BPromise=require(_0xf790('0x6'));var Mustache=require(_0xf790('0x7'));var util=require(_0xf790('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf790('0x9'));var ejs=require(_0xf790('0xa'));var fs=require('fs');var fs_extra=require(_0xf790('0xb'));var _=require(_0xf790('0xc'));var squel=require(_0xf790('0xd'));var crypto=require(_0xf790('0xe'));var jsforce=require(_0xf790('0xf'));var deskjs=require(_0xf790('0x10'));var toCsv=require(_0xf790('0x9'));var querystring=require(_0xf790('0x11'));var Papa=require(_0xf790('0x12'));var Redis=require(_0xf790('0x13'));var authService=require(_0xf790('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xf790('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf790('0x16'))(_0xf790('0x17'));var utils=require(_0xf790('0x18'));var config=require(_0xf790('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xf790('0x1a'))['db'];config[_0xf790('0x1b')]=_['defaults'](config[_0xf790('0x1b')],{'host':_0xf790('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf790('0x1b')]));require(_0xf790('0x1d'))[_0xf790('0x1e')](socket);var jayson=require(_0xf790('0x1f'));var client=jayson[_0xf790('0x20')]['http']({'port':0x232c});var client9002=jayson[_0xf790('0x20')][_0xf790('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x47ead1,_0x2a8719,_0x49ed6a,_0x247ef8){return new BPromise(function(_0x59b38a,_0x5d8686){var _0x3c4b14=_0x247ef8||client;return _0x3c4b14[_0xf790('0x22')](_0x47ead1,_0x49ed6a)[_0xf790('0x23')](function(_0x397994){logger[_0xf790('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x2a8719,_0xf790('0x25'));logger[_0xf790('0x26')](_0xf790('0x27'),_0x2a8719,_0xf790('0x25'),JSON[_0xf790('0x28')](_0x397994));if(_0x397994[_0xf790('0x29')]){if(_0x397994[_0xf790('0x29')][_0xf790('0x2a')]===0x1f4){logger['error'](_0xf790('0x2b'),_0x2a8719,_0x397994[_0xf790('0x29')][_0xf790('0x2c')]);return _0x5d8686(_0x397994[_0xf790('0x29')][_0xf790('0x2c')]);}logger['error'](_0xf790('0x2b'),_0x2a8719,_0x397994[_0xf790('0x29')]['message']);return _0x59b38a(_0x397994[_0xf790('0x29')][_0xf790('0x2c')]);}else{logger[_0xf790('0x24')](_0xf790('0x2b'),_0x2a8719,_0xf790('0x25'));_0x59b38a(_0x397994[_0xf790('0x2d')][_0xf790('0x2c')]);}})[_0xf790('0x2e')](function(_0x156c3b){logger['error'](_0xf790('0x2b'),_0x2a8719,_0x156c3b);_0x5d8686(_0x156c3b);});});}function respondWithStatusCode(_0x212298,_0x40edf2){_0x40edf2=_0x40edf2||0xcc;return function(_0x2a1983){if(_0x2a1983){return _0x212298[_0xf790('0x2f')](_0x40edf2);}return _0x212298[_0xf790('0x30')](_0x40edf2)['end']();};}function respondWithResult(_0x21d530,_0x35f2cb){_0x35f2cb=_0x35f2cb||0xc8;return function(_0x142f0c){if(_0x142f0c){return _0x21d530[_0xf790('0x30')](_0x35f2cb)[_0xf790('0x31')](_0x142f0c);}};}function respondWithFilteredResult(_0x3f825d,_0x5e989c){return function(_0x22b6f8){if(_0x22b6f8){var _0x1194c9=typeof _0x5e989c[_0xf790('0x32')]===_0xf790('0x33')&&typeof _0x5e989c['limit']===_0xf790('0x33');var _0x58ec32=_0x22b6f8['count'];var _0x46a914=_0x1194c9?0x0:_0x5e989c['offset'];var _0xcb1ff9=_0x1194c9?_0x22b6f8[_0xf790('0x34')]:_0x5e989c[_0xf790('0x32')]+_0x5e989c['limit'];var _0x55826b;if(_0xcb1ff9>=_0x58ec32){_0xcb1ff9=_0x58ec32;_0x55826b=0xc8;}else{_0x55826b=0xce;}_0x3f825d[_0xf790('0x30')](_0x55826b);return _0x3f825d['set'](_0xf790('0x35'),_0x46a914+'-'+_0xcb1ff9+'/'+_0x58ec32)[_0xf790('0x31')](_0x22b6f8);}return null;};}function patchUpdates(_0x24e1ad){return function(_0x53cd81){try{jsonpatch[_0xf790('0x36')](_0x53cd81,_0x24e1ad,!![]);}catch(_0x2aee3f){return BPromise[_0xf790('0x37')](_0x2aee3f);}return _0x53cd81[_0xf790('0x38')]();};}function saveUpdates(_0x64ce2c,_0x43f37c){return function(_0x3b3bee){if(_0x3b3bee){return _0x3b3bee[_0xf790('0x39')](_0x64ce2c)[_0xf790('0x23')](function(_0x1a9394){return _0x1a9394;});}return null;};}function removeEntity(_0x40074b,_0x3d4374){return function(_0x4d450c){if(_0x4d450c){return _0x4d450c[_0xf790('0x3a')]()['then'](function(){_0x40074b[_0xf790('0x30')](0xcc)[_0xf790('0x3b')]();});}};}function handleEntityNotFound(_0x1b74be,_0x5519ae){return function(_0x4e82a7){if(!_0x4e82a7){_0x1b74be[_0xf790('0x2f')](0x194);}return _0x4e82a7;};}function handleError(_0x3fe50c,_0x419e23){_0x419e23=_0x419e23||0x1f4;return function(_0x542cbc){logger[_0xf790('0x29')](_0x542cbc[_0xf790('0x3c')]);if(_0x542cbc[_0xf790('0x3d')]){delete _0x542cbc[_0xf790('0x3d')];}_0x3fe50c['status'](_0x419e23)[_0xf790('0x3e')](_0x542cbc);};}exports[_0xf790('0x3f')]=function(_0x14588e,_0x44cdf0){var _0x56e7d5={},_0x3e602d={},_0x50a1d1={'count':0x0,'rows':[]};var _0x193469=_[_0xf790('0x40')](db[_0xf790('0x41')]['rawAttributes'],function(_0x441369){return{'name':_0x441369[_0xf790('0x42')],'type':_0x441369[_0xf790('0x43')][_0xf790('0x44')]};});_0x3e602d[_0xf790('0x45')]=_[_0xf790('0x40')](_0x193469,_0xf790('0x3d'));_0x3e602d[_0xf790('0x46')]=_[_0xf790('0x47')](_0x14588e[_0xf790('0x46')]);_0x3e602d[_0xf790('0x48')]=_[_0xf790('0x49')](_0x3e602d['model'],_0x3e602d[_0xf790('0x46')]);_0x56e7d5[_0xf790('0x4a')]=_[_0xf790('0x49')](_0x3e602d[_0xf790('0x45')],qs['fields'](_0x14588e[_0xf790('0x46')][_0xf790('0x4b')]));_0x56e7d5[_0xf790('0x4a')]=_0x56e7d5[_0xf790('0x4a')][_0xf790('0x4c')]?_0x56e7d5['attributes']:_0x3e602d[_0xf790('0x45')];if(!_0x14588e[_0xf790('0x46')]['hasOwnProperty'](_0xf790('0x4d'))){_0x56e7d5[_0xf790('0x4e')]=qs['limit'](_0x14588e['query'][_0xf790('0x4e')]);_0x56e7d5[_0xf790('0x32')]=qs[_0xf790('0x32')](_0x14588e['query'][_0xf790('0x32')]);}_0x56e7d5[_0xf790('0x4f')]=qs['sort'](_0x14588e[_0xf790('0x46')][_0xf790('0x50')]);_0x56e7d5[_0xf790('0x51')]=qs[_0xf790('0x48')](_[_0xf790('0x52')](_0x14588e[_0xf790('0x46')],_0x3e602d[_0xf790('0x48')]),_0x193469);if(_0x14588e[_0xf790('0x46')][_0xf790('0x53')]){_0x56e7d5[_0xf790('0x51')]=_[_0xf790('0x54')](_0x56e7d5[_0xf790('0x51')],{'$or':_[_0xf790('0x40')](_0x193469,function(_0x11d341){if(_0x11d341[_0xf790('0x43')]!==_0xf790('0x55')){var _0x2618f4={};_0x2618f4[_0x11d341[_0xf790('0x3d')]]={'$like':'%'+_0x14588e['query'][_0xf790('0x53')]+'%'};return _0x2618f4;}})});}_0x56e7d5=_[_0xf790('0x54')]({},_0x56e7d5,_0x14588e['options']);var _0x569fde={'where':_0x56e7d5['where']};return db[_0xf790('0x41')][_0xf790('0x34')](_0x569fde)[_0xf790('0x23')](function(_0x38cdc2){_0x50a1d1[_0xf790('0x34')]=_0x38cdc2;if(_0x14588e[_0xf790('0x46')][_0xf790('0x56')]){_0x56e7d5[_0xf790('0x57')]=[{'all':!![]}];}return db[_0xf790('0x41')][_0xf790('0x58')](_0x56e7d5);})[_0xf790('0x23')](function(_0x2bb6a1){_0x50a1d1[_0xf790('0x59')]=_0x2bb6a1;return _0x50a1d1;})[_0xf790('0x23')](respondWithFilteredResult(_0x44cdf0,_0x56e7d5))['catch'](handleError(_0x44cdf0,null));};exports[_0xf790('0x5a')]=function(_0x13a1d4,_0x4ae3b2){var _0x54fa2b={'raw':!![],'where':{'id':_0x13a1d4[_0xf790('0x5b')]['id']}},_0x5823ae={};_0x5823ae[_0xf790('0x45')]=_['keys'](db[_0xf790('0x41')][_0xf790('0x5c')]);_0x5823ae[_0xf790('0x46')]=_[_0xf790('0x47')](_0x13a1d4[_0xf790('0x46')]);_0x5823ae[_0xf790('0x48')]=_[_0xf790('0x49')](_0x5823ae['model'],_0x5823ae['query']);_0x54fa2b[_0xf790('0x4a')]=_[_0xf790('0x49')](_0x5823ae['model'],qs[_0xf790('0x4b')](_0x13a1d4[_0xf790('0x46')][_0xf790('0x4b')]));_0x54fa2b[_0xf790('0x4a')]=_0x54fa2b[_0xf790('0x4a')][_0xf790('0x4c')]?_0x54fa2b[_0xf790('0x4a')]:_0x5823ae[_0xf790('0x45')];if(_0x13a1d4[_0xf790('0x46')][_0xf790('0x56')]){_0x54fa2b[_0xf790('0x57')]=[{'all':!![]}];}_0x54fa2b=_['merge']({},_0x54fa2b,_0x13a1d4[_0xf790('0x5d')]);return db[_0xf790('0x41')][_0xf790('0x5e')](_0x54fa2b)[_0xf790('0x23')](handleEntityNotFound(_0x4ae3b2,null))[_0xf790('0x23')](respondWithResult(_0x4ae3b2,null))[_0xf790('0x2e')](handleError(_0x4ae3b2,null));};exports['create']=function(_0x22b6b6,_0x282313){return db[_0xf790('0x41')][_0xf790('0x5f')](_0x22b6b6['body'],{})['then'](respondWithResult(_0x282313,0xc9))[_0xf790('0x2e')](handleError(_0x282313,null));};exports[_0xf790('0x39')]=function(_0x29c40c,_0x33cf1c){if(_0x29c40c[_0xf790('0x60')]['id']){delete _0x29c40c[_0xf790('0x60')]['id'];}return db[_0xf790('0x41')]['find']({'where':{'id':_0x29c40c[_0xf790('0x5b')]['id']}})[_0xf790('0x23')](handleEntityNotFound(_0x33cf1c,null))[_0xf790('0x23')](saveUpdates(_0x29c40c[_0xf790('0x60')],null))['then'](respondWithResult(_0x33cf1c,null))[_0xf790('0x2e')](handleError(_0x33cf1c,null));};exports[_0xf790('0x3a')]=function(_0xc07a26,_0x3ac93f){return db['WhatsappMessage']['find']({'where':{'id':_0xc07a26[_0xf790('0x5b')]['id']}})[_0xf790('0x23')](handleEntityNotFound(_0x3ac93f,null))[_0xf790('0x23')](removeEntity(_0x3ac93f,null))[_0xf790('0x2e')](handleError(_0x3ac93f,null));};exports[_0xf790('0x61')]=function(_0x375fd6,_0x10eb51){return db[_0xf790('0x41')][_0xf790('0x61')]()[_0xf790('0x23')](respondWithResult(_0x10eb51,null))[_0xf790('0x2e')](handleError(_0x10eb51,null));};var interaction_log=require(_0xf790('0x16'))(_0xf790('0x62'));exports['accept']=function(_0x5e1f9c,_0x24d0cc,_0x45c156){var _0x36b7b4={'agent':{},'channel':_0xf790('0x63')};if(_0x5e1f9c[_0xf790('0x60')]['id']){delete _0x5e1f9c[_0xf790('0x60')]['id'];}_0x5e1f9c['body']['read']=!![];_0x5e1f9c[_0xf790('0x60')][_0xf790('0x64')]=moment()['format'](_0xf790('0x65'));_0x5e1f9c['body'][_0xf790('0x66')]=_0x5e1f9c['body']['UserId']||_0x5e1f9c[_0xf790('0x67')]['id'];_0x36b7b4[_0xf790('0x68')]['id']=_0x5e1f9c[_0xf790('0x60')][_0xf790('0x66')];return db[_0xf790('0x41')][_0xf790('0x5e')]({'where':{'id':_0x5e1f9c[_0xf790('0x5b')]['id'],'UserId':null}})[_0xf790('0x23')](handleEntityNotFound(_0x24d0cc,null))[_0xf790('0x23')](saveUpdates(_0x5e1f9c[_0xf790('0x60')],null))[_0xf790('0x23')](function(_0xe3c26e){if(_0xe3c26e){_0x36b7b4[_0xf790('0x2c')]=_0xe3c26e['get']({'plain':!![]});return db['WhatsappInteraction'][_0xf790('0x5e')]({'where':{'id':_0xe3c26e[_0xf790('0x69')]}});}return null;})[_0xf790('0x23')](handleEntityNotFound(_0x24d0cc,null))[_0xf790('0x23')](function(_0x352388){if(_0x352388){return _0x352388['update']({'UserId':_0x5e1f9c[_0xf790('0x60')][_0xf790('0x66')],'read1stAt':_[_0xf790('0x6a')](_0x352388['read1stAt'])?moment()['format'](_0xf790('0x65')):undefined});}return null;})[_0xf790('0x23')](function(_0x3d3258){if(_0x3d3258){_0x36b7b4[_0xf790('0x6b')]=_0x3d3258[_0xf790('0x6c')]({'plain':!![]});interaction_log[_0xf790('0x24')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e1f9c[_0xf790('0x67')]['id'],_0x5e1f9c[_0xf790('0x67')]['name'],_0x5e1f9c[_0xf790('0x67')][_0xf790('0x6d')],_0x36b7b4[_0xf790('0x6b')]['id'],_0x5e1f9c[_0xf790('0x60')]?JSON[_0xf790('0x28')](_0x5e1f9c['body']):_0xf790('0x6e'));return respondWithRpcPromise('AcceptMessage',_0xf790('0x6f'),_0x36b7b4);}return null;})[_0xf790('0x23')](function(_0x1678aa){var _0x3f1bc7=_0xf790('0x70')+_0x1678aa[_0xf790('0x2c')][_0xf790('0x71')];return db['sequelize']['query'](_0x3f1bc7,{'type':db[_0xf790('0x72')]['QueryTypes'][_0xf790('0x73')],'raw':!![]})['then'](function(_0x1ed9b2){return _0x1ed9b2;});})[_0xf790('0x23')](function(_0x2d14f6){if(_0x2d14f6){_0x36b7b4[_0xf790('0x2c')][_0xf790('0x74')]=_0x2d14f6[0x0];if(!_0x5e1f9c['body'][_0xf790('0x66')])return;return db[_0xf790('0x75')][_0xf790('0x5e')]({'where':{'id':_0x5e1f9c['body'][_0xf790('0x66')],'role':_0xf790('0x68')},'attributes':['id',_0xf790('0x3d'),_0xf790('0x76'),'email',_0xf790('0x77')],'raw':!![]});}return null;})['then'](function(_0x114058){if(!_0x114058)return null;_0x36b7b4[_0xf790('0x2c')]['agent']=_0x114058;return _0x36b7b4;})[_0xf790('0x23')](function(_0x3aad50){if(_0x3aad50){if(_0x5e1f9c['body']['manual']){_0x36b7b4[_0xf790('0x2c')][_0xf790('0x78')]=util['format'](_0xf790('0x79'),_0x5e1f9c['user'][_0xf790('0x3d')]);_0x36b7b4[_0xf790('0x2c')]['channel']=_0x36b7b4[_0xf790('0x7a')];_0x36b7b4[_0xf790('0x2c')][_0xf790('0x7b')]=_0x36b7b4['channel'];_0x36b7b4[_0xf790('0x2c')][_0xf790('0x7c')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x36b7b4[_0xf790('0x2c')]},client9002)[_0xf790('0x23')](function(){return _0x36b7b4;});}return _0x36b7b4;}return null;})[_0xf790('0x23')](respondWithResult(_0x24d0cc,null))[_0xf790('0x2e')](handleError(_0x24d0cc,null));};var interaction_log=require(_0xf790('0x16'))(_0xf790('0x62'));exports[_0xf790('0x37')]=function(_0x2aad10,_0x2f6975,_0xfcf7ab){var _0x851daa={'agent':{},'channel':_0xf790('0x63')};if(_0x2aad10['body']['id']){delete _0x2aad10['body']['id'];}_0x2aad10['body'][_0xf790('0x66')]=_0x2aad10[_0xf790('0x60')]['UserId']||_0x2aad10[_0xf790('0x67')]['id'];_0x851daa[_0xf790('0x68')]['id']=_0x2aad10[_0xf790('0x60')]['UserId'];return db['WhatsappMessage'][_0xf790('0x5e')]({'where':{'id':_0x2aad10['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f6975,null))[_0xf790('0x23')](function(_0x59f7b5){if(_0x59f7b5){_0x851daa['message']=_0x59f7b5[_0xf790('0x6c')]({'plain':!![]});return db[_0xf790('0x7d')][_0xf790('0x5e')]({'where':{'id':_0x59f7b5['WhatsappInteractionId']}});}return null;})[_0xf790('0x23')](handleEntityNotFound(_0x2f6975,null))['then'](function(_0x21588b){if(_0x21588b){_0x851daa['interaction']=_0x21588b['get']({'plain':!![]});interaction_log[_0xf790('0x24')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2aad10['user']['id'],_0x2aad10[_0xf790('0x67')][_0xf790('0x3d')],_0x2aad10[_0xf790('0x67')][_0xf790('0x6d')],_0x851daa['interaction']['id'],_0x2aad10[_0xf790('0x60')]?JSON[_0xf790('0x28')](_0x2aad10[_0xf790('0x60')]):_0xf790('0x6e'));return respondWithRpcPromise(_0xf790('0x7e'),_0xf790('0x7f'),_0x851daa);}return null;})[_0xf790('0x23')](function(_0x3000b4){var _0x4118bf=_0xf790('0x70')+_0x3000b4[_0xf790('0x2c')][_0xf790('0x71')];return db['sequelize'][_0xf790('0x46')](_0x4118bf,{'type':db['Sequelize']['QueryTypes'][_0xf790('0x73')],'raw':!![]})[_0xf790('0x23')](function(_0x5071fe){return _0x5071fe;});})[_0xf790('0x23')](function(_0x2f2ef2){if(_0x2f2ef2){_0x851daa['message']['contact']=_0x2f2ef2[0x0];if(!_0x2aad10[_0xf790('0x60')][_0xf790('0x66')])return;return db['User']['find']({'where':{'id':_0x2aad10[_0xf790('0x60')][_0xf790('0x66')],'role':_0xf790('0x68')},'attributes':['id','name',_0xf790('0x76'),'email',_0xf790('0x77')],'raw':!![]});}return null;})[_0xf790('0x23')](function(_0x34d77a){if(!_0x34d77a)return null;_0x851daa[_0xf790('0x2c')][_0xf790('0x68')]=_0x34d77a;return _0x851daa;})[_0xf790('0x23')](function(_0xadff39){if(_0xadff39){_0xadff39[_0xf790('0x2c')][_0xf790('0x78')]=util[_0xf790('0x80')](_0xf790('0x79'),_0x2aad10[_0xf790('0x67')]['name']);_0xadff39[_0xf790('0x2c')][_0xf790('0x7a')]=_0x851daa[_0xf790('0x7a')];_0xadff39[_0xf790('0x2c')][_0xf790('0x7b')]=_0x851daa[_0xf790('0x7a')];_0xadff39['message']['event']=_0xf790('0x37');respondWithRpcPromise(_0xf790('0x81'),_0xf790('0x81'),{'event':_0xf790('0x82'),'message':_0xadff39[_0xf790('0x2c')]},client9002);return _0x851daa;}return null;})[_0xf790('0x23')](respondWithResult(_0x2f6975,null))[_0xf790('0x2e')](handleError(_0x2f6975,null));};exports[_0xf790('0x30')]=function(_0x12ca47,_0x1be934,_0x11c11e){if(_0x12ca47[_0xf790('0x60')]['id']){delete _0x12ca47['body']['id'];}var _0x5e06af;return db[_0xf790('0x41')][_0xf790('0x5e')]({'where':{'id':_0x12ca47[_0xf790('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1be934,null))[_0xf790('0x23')](function(_0x5dcdb9){if(_0x5dcdb9){_0x5e06af=_0x5dcdb9;return db[_0xf790('0x83')]['find']({'where':{'id':_0x5dcdb9[_0xf790('0x84')]}});}})[_0xf790('0x23')](handleEntityNotFound(_0x1be934,null))['then'](function(_0x253600){if(_0x253600){logger[_0xf790('0x26')](_0xf790('0x85'),'status',_0xf790('0x86'),_0x253600[_0xf790('0x43')],util[_0xf790('0x87')](_0x12ca47['body'],{'showHidden':![],'depth':null}));switch(_0x253600[_0xf790('0x43')]){case _0xf790('0x88'):if(_0x12ca47[_0xf790('0x60')][_0xf790('0x89')]&&_0x12ca47[_0xf790('0x60')][_0xf790('0x89')]===_0x5e06af['messageId']&&_0x12ca47['body']['MessageStatus']&&_0x12ca47[_0xf790('0x60')][_0xf790('0x8a')]===_0xf790('0x8b')){return _0x5e06af[_0xf790('0x39')]({'read':!![]});}else{logger['error'](_0xf790('0x8c'),'status',_0xf790('0x88'),util['inspect'](_0x12ca47[_0xf790('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x5e06af;}})[_0xf790('0x23')](respondWithResult(_0x1be934,null))[_0xf790('0x2e')](handleError(_0x1be934,null));}; \ No newline at end of file +var _0x534f=['QueryTypes','fullname','internal','rejectmessage','WhatsappAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','type','VIRTUAL','merge','options','WhatsappMessage','findAll','rows','show','params','length','includeAll','include','find','create','body','describe','whatsapp-interactions','accept','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','format','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','Sequelize'];(function(_0x1b6fa1,_0x439d73){var _0x13982d=function(_0x129fde){while(--_0x129fde){_0x1b6fa1['push'](_0x1b6fa1['shift']());}};_0x13982d(++_0x439d73);}(_0x534f,0x1b1));var _0xf534=function(_0xfc0e65,_0x4404de){_0xfc0e65=_0xfc0e65-0x0;var _0x464396=_0x534f[_0xfc0e65];return _0x464396;};'use strict';var emlformat=require(_0xf534('0x0'));var rimraf=require(_0xf534('0x1'));var zipdir=require(_0xf534('0x2'));var jsonpatch=require(_0xf534('0x3'));var rp=require('request-promise');var moment=require(_0xf534('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf534('0x5'));var util=require(_0xf534('0x6'));var path=require('path');var sox=require(_0xf534('0x7'));var csv=require(_0xf534('0x8'));var ejs=require(_0xf534('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf534('0xa'));var crypto=require(_0xf534('0xb'));var jsforce=require(_0xf534('0xc'));var deskjs=require(_0xf534('0xd'));var toCsv=require(_0xf534('0x8'));var querystring=require(_0xf534('0xe'));var Papa=require(_0xf534('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf534('0x10'));var as=require(_0xf534('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf534('0x12'))('api');var utils=require(_0xf534('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf534('0x14'));var db=require(_0xf534('0x15'))['db'];config[_0xf534('0x16')]=_[_0xf534('0x17')](config[_0xf534('0x16')],{'host':_0xf534('0x18'),'port':0x18eb});var socket=require(_0xf534('0x19'))(new Redis(config[_0xf534('0x16')]));require(_0xf534('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xf534('0x1b')]['http']({'port':0x232c});var client9002=jayson['client'][_0xf534('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x8cd0a0,_0x4b0f6d,_0x3501eb,_0x5298be){return new BPromise(function(_0x31e418,_0x32528a){var _0x1bb623=_0x5298be||client;return _0x1bb623[_0xf534('0x1d')](_0x8cd0a0,_0x3501eb)[_0xf534('0x1e')](function(_0xed9a45){logger[_0xf534('0x1f')](_0xf534('0x20'),_0x4b0f6d,_0xf534('0x21'));logger[_0xf534('0x22')](_0xf534('0x23'),_0x4b0f6d,_0xf534('0x21'),JSON[_0xf534('0x24')](_0xed9a45));if(_0xed9a45[_0xf534('0x25')]){if(_0xed9a45[_0xf534('0x25')][_0xf534('0x26')]===0x1f4){logger[_0xf534('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x4b0f6d,_0xed9a45['error'][_0xf534('0x27')]);return _0x32528a(_0xed9a45[_0xf534('0x25')]['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x4b0f6d,_0xed9a45[_0xf534('0x25')]['message']);return _0x31e418(_0xed9a45[_0xf534('0x25')][_0xf534('0x27')]);}else{logger[_0xf534('0x1f')](_0xf534('0x20'),_0x4b0f6d,_0xf534('0x21'));_0x31e418(_0xed9a45[_0xf534('0x28')][_0xf534('0x27')]);}})[_0xf534('0x29')](function(_0xbd376a){logger[_0xf534('0x25')](_0xf534('0x20'),_0x4b0f6d,_0xbd376a);_0x32528a(_0xbd376a);});});}function respondWithStatusCode(_0xa6524c,_0x13d179){_0x13d179=_0x13d179||0xcc;return function(_0xd78843){if(_0xd78843){return _0xa6524c['sendStatus'](_0x13d179);}return _0xa6524c[_0xf534('0x2a')](_0x13d179)[_0xf534('0x2b')]();};}function respondWithResult(_0x436f18,_0x1ec53a){_0x1ec53a=_0x1ec53a||0xc8;return function(_0x55da72){if(_0x55da72){return _0x436f18[_0xf534('0x2a')](_0x1ec53a)['json'](_0x55da72);}};}function respondWithFilteredResult(_0x1b311c,_0x47b2c2){return function(_0x1b66b0){if(_0x1b66b0){var _0x1320c4=typeof _0x47b2c2['offset']===_0xf534('0x2c')&&typeof _0x47b2c2[_0xf534('0x2d')]===_0xf534('0x2c');var _0x276729=_0x1b66b0[_0xf534('0x2e')];var _0x27bd2b=_0x1320c4?0x0:_0x47b2c2['offset'];var _0x32ea4a=_0x1320c4?_0x1b66b0[_0xf534('0x2e')]:_0x47b2c2['offset']+_0x47b2c2['limit'];var _0x1a4931;if(_0x32ea4a>=_0x276729){_0x32ea4a=_0x276729;_0x1a4931=0xc8;}else{_0x1a4931=0xce;}_0x1b311c[_0xf534('0x2a')](_0x1a4931);return _0x1b311c['set'](_0xf534('0x2f'),_0x27bd2b+'-'+_0x32ea4a+'/'+_0x276729)[_0xf534('0x30')](_0x1b66b0);}return null;};}function patchUpdates(_0x57b3b8){return function(_0x2cf65e){try{jsonpatch[_0xf534('0x31')](_0x2cf65e,_0x57b3b8,!![]);}catch(_0x5f2f6b){return BPromise[_0xf534('0x32')](_0x5f2f6b);}return _0x2cf65e[_0xf534('0x33')]();};}function saveUpdates(_0x303079,_0xba6d16){return function(_0x27e0fc){if(_0x27e0fc){return _0x27e0fc[_0xf534('0x34')](_0x303079)['then'](function(_0xe965c9){return _0xe965c9;});}return null;};}function removeEntity(_0x41308b,_0x4fd636){return function(_0x109cf3){if(_0x109cf3){return _0x109cf3[_0xf534('0x35')]()['then'](function(){_0x41308b[_0xf534('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x579ffb,_0x2e277d){return function(_0x319a0d){if(!_0x319a0d){_0x579ffb[_0xf534('0x36')](0x194);}return _0x319a0d;};}function handleError(_0x59776b,_0x1aca48){_0x1aca48=_0x1aca48||0x1f4;return function(_0x1e179e){logger['error'](_0x1e179e['stack']);if(_0x1e179e['name']){delete _0x1e179e[_0xf534('0x37')];}_0x59776b[_0xf534('0x2a')](_0x1aca48)[_0xf534('0x38')](_0x1e179e);};}exports[_0xf534('0x39')]=function(_0x55a5f4,_0x59b259){var _0x5a57e8={},_0x414385={},_0x38aed3={'count':0x0,'rows':[]};var _0x19a3e8=_[_0xf534('0x3a')](db['WhatsappMessage'][_0xf534('0x3b')],function(_0x349759){return{'name':_0x349759[_0xf534('0x3c')],'type':_0x349759['type']['key']};});_0x414385[_0xf534('0x3d')]=_['map'](_0x19a3e8,_0xf534('0x37'));_0x414385['query']=_[_0xf534('0x3e')](_0x55a5f4[_0xf534('0x3f')]);_0x414385[_0xf534('0x40')]=_[_0xf534('0x41')](_0x414385[_0xf534('0x3d')],_0x414385[_0xf534('0x3f')]);_0x5a57e8[_0xf534('0x42')]=_[_0xf534('0x41')](_0x414385[_0xf534('0x3d')],qs[_0xf534('0x43')](_0x55a5f4[_0xf534('0x3f')][_0xf534('0x43')]));_0x5a57e8[_0xf534('0x42')]=_0x5a57e8[_0xf534('0x42')]['length']?_0x5a57e8[_0xf534('0x42')]:_0x414385['model'];if(!_0x55a5f4[_0xf534('0x3f')][_0xf534('0x44')](_0xf534('0x45'))){_0x5a57e8[_0xf534('0x2d')]=qs[_0xf534('0x2d')](_0x55a5f4[_0xf534('0x3f')][_0xf534('0x2d')]);_0x5a57e8[_0xf534('0x46')]=qs[_0xf534('0x46')](_0x55a5f4[_0xf534('0x3f')][_0xf534('0x46')]);}_0x5a57e8[_0xf534('0x47')]=qs[_0xf534('0x48')](_0x55a5f4[_0xf534('0x3f')]['sort']);_0x5a57e8[_0xf534('0x49')]=qs['filters'](_[_0xf534('0x4a')](_0x55a5f4[_0xf534('0x3f')],_0x414385[_0xf534('0x40')]),_0x19a3e8);if(_0x55a5f4[_0xf534('0x3f')][_0xf534('0x4b')]){_0x5a57e8[_0xf534('0x49')]=_['merge'](_0x5a57e8['where'],{'$or':_[_0xf534('0x3a')](_0x19a3e8,function(_0x1ba227){if(_0x1ba227[_0xf534('0x4c')]!==_0xf534('0x4d')){var _0x5811e5={};_0x5811e5[_0x1ba227['name']]={'$like':'%'+_0x55a5f4[_0xf534('0x3f')][_0xf534('0x4b')]+'%'};return _0x5811e5;}})});}_0x5a57e8=_[_0xf534('0x4e')]({},_0x5a57e8,_0x55a5f4[_0xf534('0x4f')]);var _0x3b12b7={'where':_0x5a57e8[_0xf534('0x49')]};return db[_0xf534('0x50')][_0xf534('0x2e')](_0x3b12b7)[_0xf534('0x1e')](function(_0x412457){_0x38aed3['count']=_0x412457;if(_0x55a5f4[_0xf534('0x3f')]['includeAll']){_0x5a57e8['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xf534('0x51')](_0x5a57e8);})[_0xf534('0x1e')](function(_0x245a5c){_0x38aed3[_0xf534('0x52')]=_0x245a5c;return _0x38aed3;})[_0xf534('0x1e')](respondWithFilteredResult(_0x59b259,_0x5a57e8))['catch'](handleError(_0x59b259,null));};exports[_0xf534('0x53')]=function(_0x4f884b,_0x4047f8){var _0xa67fb7={'raw':!![],'where':{'id':_0x4f884b[_0xf534('0x54')]['id']}},_0x2ad9f8={};_0x2ad9f8[_0xf534('0x3d')]=_[_0xf534('0x3e')](db[_0xf534('0x50')][_0xf534('0x3b')]);_0x2ad9f8['query']=_[_0xf534('0x3e')](_0x4f884b[_0xf534('0x3f')]);_0x2ad9f8[_0xf534('0x40')]=_[_0xf534('0x41')](_0x2ad9f8[_0xf534('0x3d')],_0x2ad9f8[_0xf534('0x3f')]);_0xa67fb7[_0xf534('0x42')]=_[_0xf534('0x41')](_0x2ad9f8[_0xf534('0x3d')],qs[_0xf534('0x43')](_0x4f884b[_0xf534('0x3f')][_0xf534('0x43')]));_0xa67fb7['attributes']=_0xa67fb7[_0xf534('0x42')][_0xf534('0x55')]?_0xa67fb7['attributes']:_0x2ad9f8[_0xf534('0x3d')];if(_0x4f884b['query'][_0xf534('0x56')]){_0xa67fb7[_0xf534('0x57')]=[{'all':!![]}];}_0xa67fb7=_[_0xf534('0x4e')]({},_0xa67fb7,_0x4f884b[_0xf534('0x4f')]);return db[_0xf534('0x50')][_0xf534('0x58')](_0xa67fb7)['then'](handleEntityNotFound(_0x4047f8,null))['then'](respondWithResult(_0x4047f8,null))[_0xf534('0x29')](handleError(_0x4047f8,null));};exports[_0xf534('0x59')]=function(_0x2044c7,_0x22d649){return db[_0xf534('0x50')][_0xf534('0x59')](_0x2044c7[_0xf534('0x5a')],{})[_0xf534('0x1e')](respondWithResult(_0x22d649,0xc9))[_0xf534('0x29')](handleError(_0x22d649,null));};exports['update']=function(_0xb7fe10,_0x2163d7){if(_0xb7fe10[_0xf534('0x5a')]['id']){delete _0xb7fe10[_0xf534('0x5a')]['id'];}return db[_0xf534('0x50')][_0xf534('0x58')]({'where':{'id':_0xb7fe10[_0xf534('0x54')]['id']}})[_0xf534('0x1e')](handleEntityNotFound(_0x2163d7,null))[_0xf534('0x1e')](saveUpdates(_0xb7fe10['body'],null))[_0xf534('0x1e')](respondWithResult(_0x2163d7,null))[_0xf534('0x29')](handleError(_0x2163d7,null));};exports[_0xf534('0x35')]=function(_0x229b6a,_0x3b5c24){return db[_0xf534('0x50')][_0xf534('0x58')]({'where':{'id':_0x229b6a[_0xf534('0x54')]['id']}})[_0xf534('0x1e')](handleEntityNotFound(_0x3b5c24,null))[_0xf534('0x1e')](removeEntity(_0x3b5c24,null))['catch'](handleError(_0x3b5c24,null));};exports[_0xf534('0x5b')]=function(_0xa96b83,_0x5ab844){return db['WhatsappMessage'][_0xf534('0x5b')]()['then'](respondWithResult(_0x5ab844,null))[_0xf534('0x29')](handleError(_0x5ab844,null));};var interaction_log=require(_0xf534('0x12'))(_0xf534('0x5c'));exports[_0xf534('0x5d')]=function(_0xa3a839,_0x476ae7,_0x58b439){var _0x183734={'agent':{},'channel':_0xf534('0x5e')};if(_0xa3a839[_0xf534('0x5a')]['id']){delete _0xa3a839[_0xf534('0x5a')]['id'];}_0xa3a839[_0xf534('0x5a')]['read']=!![];_0xa3a839[_0xf534('0x5a')][_0xf534('0x5f')]=moment()['format'](_0xf534('0x60'));_0xa3a839[_0xf534('0x5a')][_0xf534('0x61')]=_0xa3a839[_0xf534('0x5a')][_0xf534('0x61')]||_0xa3a839[_0xf534('0x62')]['id'];_0x183734[_0xf534('0x63')]['id']=_0xa3a839['body']['UserId'];return db[_0xf534('0x50')][_0xf534('0x58')]({'where':{'id':_0xa3a839[_0xf534('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x476ae7,null))[_0xf534('0x1e')](saveUpdates(_0xa3a839['body'],null))[_0xf534('0x1e')](function(_0x4a6e19){if(_0x4a6e19){_0x183734['message']=_0x4a6e19['get']({'plain':!![]});return db[_0xf534('0x64')][_0xf534('0x58')]({'where':{'id':_0x4a6e19[_0xf534('0x65')]}});}return null;})[_0xf534('0x1e')](handleEntityNotFound(_0x476ae7,null))[_0xf534('0x1e')](function(_0xad09ff){if(_0xad09ff){return _0xad09ff[_0xf534('0x34')]({'UserId':_0xa3a839[_0xf534('0x5a')]['UserId'],'read1stAt':_['isNil'](_0xad09ff['read1stAt'])?moment()[_0xf534('0x66')](_0xf534('0x60')):undefined});}return null;})[_0xf534('0x1e')](function(_0x292f25){if(_0x292f25){_0x183734['interaction']=_0x292f25[_0xf534('0x67')]({'plain':!![]});interaction_log[_0xf534('0x1f')](_0xf534('0x68'),_0xa3a839[_0xf534('0x62')]['id'],_0xa3a839['user'][_0xf534('0x37')],_0xa3a839[_0xf534('0x62')][_0xf534('0x69')],_0x183734[_0xf534('0x6a')]['id'],_0xa3a839['body']?JSON[_0xf534('0x24')](_0xa3a839['body']):_0xf534('0x6b'));return respondWithRpcPromise(_0xf534('0x6c'),_0xf534('0x6d'),_0x183734);}return null;})[_0xf534('0x1e')](function(_0x34323d){var _0x2014d4=_0xf534('0x6e')+_0x34323d['message'][_0xf534('0x6f')];return db[_0xf534('0x70')][_0xf534('0x3f')](_0x2014d4,{'type':db['Sequelize']['QueryTypes'][_0xf534('0x71')],'raw':!![]})['then'](function(_0x32da27){return _0x32da27;});})[_0xf534('0x1e')](function(_0x1f26c0){if(_0x1f26c0){_0x183734[_0xf534('0x27')][_0xf534('0x72')]=_0x1f26c0[0x0];if(!_0xa3a839[_0xf534('0x5a')]['UserId'])return;return db[_0xf534('0x73')][_0xf534('0x58')]({'where':{'id':_0xa3a839[_0xf534('0x5a')][_0xf534('0x61')],'role':_0xf534('0x63')},'attributes':['id','name','fullname',_0xf534('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0xa2bfec){if(!_0xa2bfec)return null;_0x183734[_0xf534('0x27')][_0xf534('0x63')]=_0xa2bfec;return _0x183734;})[_0xf534('0x1e')](function(_0x1dec1e){if(_0x1dec1e){if(_0xa3a839[_0xf534('0x5a')][_0xf534('0x75')]){_0x183734[_0xf534('0x27')][_0xf534('0x76')]=util['format']('SIP/%s',_0xa3a839['user'][_0xf534('0x37')]);_0x183734[_0xf534('0x27')]['channel']=_0x183734[_0xf534('0x77')];_0x183734['message'][_0xf534('0x78')]=_0x183734[_0xf534('0x77')];_0x183734[_0xf534('0x27')][_0xf534('0x79')]=_0xf534('0x5d');return respondWithRpcPromise('EventManager',_0xf534('0x7a'),{'event':_0xf534('0x7b'),'message':_0x183734['message']},client9002)[_0xf534('0x1e')](function(){return _0x183734;});}return _0x183734;}return null;})[_0xf534('0x1e')](respondWithResult(_0x476ae7,null))[_0xf534('0x29')](handleError(_0x476ae7,null));};var interaction_log=require(_0xf534('0x12'))('whatsapp-interactions');exports['reject']=function(_0x16034c,_0x1e8410,_0x3dd28e){var _0x19942d={'agent':{},'channel':_0xf534('0x5e')};if(_0x16034c[_0xf534('0x5a')]['id']){delete _0x16034c[_0xf534('0x5a')]['id'];}_0x16034c['body'][_0xf534('0x61')]=_0x16034c['body'][_0xf534('0x61')]||_0x16034c['user']['id'];_0x19942d[_0xf534('0x63')]['id']=_0x16034c[_0xf534('0x5a')][_0xf534('0x61')];return db[_0xf534('0x50')][_0xf534('0x58')]({'where':{'id':_0x16034c[_0xf534('0x54')]['id'],'UserId':null}})[_0xf534('0x1e')](handleEntityNotFound(_0x1e8410,null))[_0xf534('0x1e')](function(_0x5a4bd9){if(_0x5a4bd9){_0x19942d[_0xf534('0x27')]=_0x5a4bd9[_0xf534('0x67')]({'plain':!![]});return db[_0xf534('0x64')][_0xf534('0x58')]({'where':{'id':_0x5a4bd9[_0xf534('0x65')]}});}return null;})[_0xf534('0x1e')](handleEntityNotFound(_0x1e8410,null))['then'](function(_0x3cf350){if(_0x3cf350){_0x19942d[_0xf534('0x6a')]=_0x3cf350['get']({'plain':!![]});interaction_log[_0xf534('0x1f')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x16034c[_0xf534('0x62')]['id'],_0x16034c[_0xf534('0x62')][_0xf534('0x37')],_0x16034c['user'][_0xf534('0x69')],_0x19942d[_0xf534('0x6a')]['id'],_0x16034c[_0xf534('0x5a')]?JSON[_0xf534('0x24')](_0x16034c[_0xf534('0x5a')]):'null');return respondWithRpcPromise(_0xf534('0x7c'),_0xf534('0x7d'),_0x19942d);}return null;})[_0xf534('0x1e')](function(_0x39d4e4){var _0x5f2e96=_0xf534('0x6e')+_0x39d4e4[_0xf534('0x27')]['ContactId'];return db[_0xf534('0x70')][_0xf534('0x3f')](_0x5f2e96,{'type':db[_0xf534('0x7e')][_0xf534('0x7f')]['SELECT'],'raw':!![]})['then'](function(_0x235a89){return _0x235a89;});})['then'](function(_0x1da66c){if(_0x1da66c){_0x19942d[_0xf534('0x27')][_0xf534('0x72')]=_0x1da66c[0x0];if(!_0x16034c[_0xf534('0x5a')][_0xf534('0x61')])return;return db[_0xf534('0x73')][_0xf534('0x58')]({'where':{'id':_0x16034c[_0xf534('0x5a')][_0xf534('0x61')],'role':'agent'},'attributes':['id',_0xf534('0x37'),_0xf534('0x80'),_0xf534('0x74'),_0xf534('0x81')],'raw':!![]});}return null;})[_0xf534('0x1e')](function(_0x564676){if(!_0x564676)return null;_0x19942d[_0xf534('0x27')]['agent']=_0x564676;return _0x19942d;})[_0xf534('0x1e')](function(_0x8a4b9c){if(_0x8a4b9c){_0x8a4b9c[_0xf534('0x27')][_0xf534('0x76')]=util[_0xf534('0x66')]('SIP/%s',_0x16034c[_0xf534('0x62')]['name']);_0x8a4b9c[_0xf534('0x27')]['channel']=_0x19942d['channel'];_0x8a4b9c[_0xf534('0x27')][_0xf534('0x78')]=_0x19942d[_0xf534('0x77')];_0x8a4b9c['message'][_0xf534('0x79')]=_0xf534('0x32');respondWithRpcPromise(_0xf534('0x7a'),_0xf534('0x7a'),{'event':_0xf534('0x82'),'message':_0x8a4b9c['message']},client9002);return _0x19942d;}return null;})[_0xf534('0x1e')](respondWithResult(_0x1e8410,null))['catch'](handleError(_0x1e8410,null));};exports[_0xf534('0x2a')]=function(_0x47ffbf,_0x5271b3,_0x192dca){if(_0x47ffbf[_0xf534('0x5a')]['id']){delete _0x47ffbf[_0xf534('0x5a')]['id'];}var _0xe4d904;return db[_0xf534('0x50')][_0xf534('0x58')]({'where':{'id':_0x47ffbf[_0xf534('0x54')]['id']}})[_0xf534('0x1e')](handleEntityNotFound(_0x5271b3,null))[_0xf534('0x1e')](function(_0x480842){if(_0x480842){_0xe4d904=_0x480842;return db['WhatsappAccount'][_0xf534('0x58')]({'where':{'id':_0x480842[_0xf534('0x83')]}});}})[_0xf534('0x1e')](handleEntityNotFound(_0x5271b3,null))['then'](function(_0x5d1a27){if(_0x5d1a27){logger[_0xf534('0x22')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xf534('0x2a'),_0xf534('0x84'),_0x5d1a27[_0xf534('0x4c')],util['inspect'](_0x47ffbf[_0xf534('0x5a')],{'showHidden':![],'depth':null}));switch(_0x5d1a27[_0xf534('0x4c')]){case _0xf534('0x85'):if(_0x47ffbf['body'][_0xf534('0x86')]&&_0x47ffbf[_0xf534('0x5a')][_0xf534('0x86')]===_0xe4d904[_0xf534('0x87')]&&_0x47ffbf['body']['MessageStatus']&&_0x47ffbf[_0xf534('0x5a')][_0xf534('0x88')]===_0xf534('0x89')){return _0xe4d904[_0xf534('0x34')]({'read':!![]});}else{logger[_0xf534('0x25')](_0xf534('0x8a'),_0xf534('0x2a'),_0xf534('0x85'),util[_0xf534('0x8b')](_0x47ffbf[_0xf534('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0xe4d904;}})[_0xf534('0x1e')](respondWithResult(_0x5271b3,null))[_0xf534('0x29')](handleError(_0x5271b3,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 8f89629..89133c6 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 _0x7894=['WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x7894,0x170));var _0x4789=function(_0x34e9ca,_0x3ebd44){_0x34e9ca=_0x34e9ca-0x0;var _0x1e0445=_0x7894[_0x34e9ca];return _0x1e0445;};'use strict';var EventEmitter=require(_0x4789('0x0'));var WhatsappMessage=require(_0x4789('0x1'))['db'][_0x4789('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4789('0x3')](0x0);var events={'afterCreate':_0x4789('0x4'),'afterUpdate':_0x4789('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd4bd76){return function(_0x2b2dd3,_0x4e2393,_0x3394f6){WhatsappMessageEvents[_0x4789('0x6')](_0xd4bd76+':'+_0x2b2dd3['id'],_0x2b2dd3);WhatsappMessageEvents[_0x4789('0x6')](_0xd4bd76,_0x2b2dd3);_0x3394f6(null);};}for(var e in events){if(events[_0x4789('0x7')](e)){var event=events[e];WhatsappMessage[_0x4789('0x8')](e,emitEvent(event));}}module[_0x4789('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x55f1=['remove','emit','hasOwnProperty','hook','exports','events','WhatsappMessage','setMaxListeners','save','update'];(function(_0x5cd099,_0x26589b){var _0x418b1d=function(_0x1aa2fe){while(--_0x1aa2fe){_0x5cd099['push'](_0x5cd099['shift']());}};_0x418b1d(++_0x26589b);}(_0x55f1,0x9b));var _0x155f=function(_0x24b2ff,_0xb20eda){_0x24b2ff=_0x24b2ff-0x0;var _0x2ed723=_0x55f1[_0x24b2ff];return _0x2ed723;};'use strict';var EventEmitter=require(_0x155f('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x155f('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x155f('0x2')](0x0);var events={'afterCreate':_0x155f('0x3'),'afterUpdate':_0x155f('0x4'),'afterDestroy':_0x155f('0x5')};function emitEvent(_0x13e2af){return function(_0x2089cc,_0x5c3d6c,_0x5cd807){WhatsappMessageEvents[_0x155f('0x6')](_0x13e2af+':'+_0x2089cc['id'],_0x2089cc);WhatsappMessageEvents['emit'](_0x13e2af,_0x2089cc);_0x5cd807(null);};}for(var e in events){if(events[_0x155f('0x7')](e)){var event=events[e];WhatsappMessage[_0x155f('0x8')](e,emitEvent(event));}}module[_0x155f('0x9')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 94e144c..0e8c683 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 _0x3228=['application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','/whatsapp/v1/','/messages/','text','POST','Bearer\x20'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x3228,0x181));var _0x8322=function(_0x1a5433,_0x4b01ff){_0x1a5433=_0x1a5433-0x0;var _0x4fec8c=_0x3228[_0x1a5433];return _0x4fec8c;};'use strict';var _=require(_0x8322('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8322('0x1'));var moment=require(_0x8322('0x2'));var BPromise=require(_0x8322('0x3'));var rp=require(_0x8322('0x4'));var fetch=require(_0x8322('0x5'));var fs=require('fs');var path=require(_0x8322('0x6'));var rimraf=require(_0x8322('0x7'));var config=require(_0x8322('0x8'));var attributes=require(_0x8322('0x9'));module['exports']=function(_0x2d3f72,_0x1d7870){return _0x2d3f72['define'](_0x8322('0xa'),attributes,{'tableName':_0x8322('0xb'),'paranoid':![],'indexes':[{'name':_0x8322('0xc'),'fields':[_0x8322('0xc')]},{'name':_0x8322('0xd'),'fields':[_0x8322('0xe')],'type':_0x8322('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x15c187,_0x35a94a,_0x2a3369){var _0xa58401=_0x2d3f72['models'];var _0x5a159f=_0x15c187[_0x8322('0x10')]({'plain':!![]});if(_0x5a159f[_0x8322('0x11')][_0x8322('0x12')]()==='in'||_0x5a159f[_0x8322('0x11')][_0x8322('0x12')]()===_0x8322('0x13')&&!_0x5a159f[_0x8322('0x14')]&&!_[_0x8322('0x15')](_0x5a159f[_0x8322('0x16')])){_0xa58401[_0x8322('0x17')][_0x8322('0x18')]({'where':{'id':_0x5a159f[_0x8322('0x19')]}})[_0x8322('0x1a')](function(_0x250164){if(_0x250164){_0x250164[_0x8322('0x1b')]({'lastMsgAt':_0x5a159f[_0x8322('0x1c')],'lastMsgDirection':_0x5a159f[_0x8322('0x11')][_0x8322('0x12')]()});}})[_0x8322('0x1d')](function(_0x54950c){console[_0x8322('0x1e')](_0x54950c);});}if(_0x5a159f['direction']===_0x8322('0x13')&&!_0x5a159f[_0x8322('0x14')]){var _0xebace9;_0xa58401[_0x8322('0x1f')][_0x8322('0x20')]({'where':{'id':_0x5a159f[_0x8322('0x21')]},'raw':!![]})[_0x8322('0x1a')](function(_0xab35b3){_0xebace9=_0xab35b3;if(_0xebace9&&_0xebace9['type']){switch(_0xebace9[_0x8322('0x22')]){case _0x8322('0x23'):var _0xc6020=require(_0x8322('0x23'));if(_0xebace9[_0x8322('0x24')]&&_0xebace9[_0x8322('0x25')]&&_0xebace9[_0x8322('0x26')]){var _0x4f5285=new _0xc6020(_0xebace9['accountSid'],_0xebace9['authToken']);_0x4f5285[_0x8322('0x27')][_0x8322('0x28')]({'body':_0x5a159f[_0x8322('0xe')],'to':_0x8322('0x29')+_0x5a159f[_0x8322('0x26')],'from':_0x8322('0x29')+_0xebace9[_0x8322('0x26')],'statusCallback':_0xebace9[_0x8322('0x2a')]+_0x8322('0x2b')+_0x5a159f['id']+_0x8322('0x2c')+_0xebace9[_0x8322('0x2d')]})[_0x8322('0x1a')](function(_0x3cbd64){if(_0x3cbd64[_0x8322('0x2e')]){return _0x15c187['update']({'messageId':_0x3cbd64[_0x8322('0x2e')]});}})[_0x8322('0x1d')](function(_0x1d6c94){logger[_0x8322('0x1e')](_0x8322('0x2f'),_0x8322('0x30'),_0x8322('0x23'),util[_0x8322('0x31')](_0x1d6c94,{'showHidden':![],'depth':null}));});}else{logger[_0x8322('0x1e')](_0x8322('0x2f'),_0x8322('0x30'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x8322('0x32'):var _0x4d3b67=_0xebace9[_0x8322('0x24')];var _0x516e85=_0xebace9[_0x8322('0x25')];var _0x2f8ded=_0xebace9['baseUrl']+_0x8322('0x33')+_0x4d3b67+_0x8322('0x34');var _0xe6d895={'to':[_0x5a159f[_0x8322('0x26')]],'message':{'type':_0x8322('0x35'),'text':_0x5a159f[_0x8322('0xe')]}};var _0xae1974={'method':_0x8322('0x36'),'uri':_0x2f8ded,'headers':{'Authorization':_0x8322('0x37')+_0x516e85,'Content-Type':_0x8322('0x38')},'body':_0xe6d895,'json':!![]};rp(_0xae1974)[_0x8322('0x1a')](function(_0x338359){if(_0x338359[_0x8322('0x39')][0x0][_0x8322('0x3a')]){return _0x15c187[_0x8322('0x1b')]({'messageId':_0x338359[_0x8322('0x39')][0x0]['message_id']});}})[_0x8322('0x1d')](function(_0x503faa){logger[_0x8322('0x3b')](_0x8322('0x3c'),_0x503faa);});break;}}})['finally'](function(){_0x2a3369();});}else{_0x2a3369();}}},'charset':_0x8322('0x3d'),'collate':_0x8322('0x3e')});}; \ No newline at end of file +var _0xfb49=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','node-fetch','path','rimraf','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','then','update','createdAt','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','sinch','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4'];(function(_0x564615,_0x51000c){var _0x3e5c3c=function(_0x35b777){while(--_0x35b777){_0x564615['push'](_0x564615['shift']());}};_0x3e5c3c(++_0x51000c);}(_0xfb49,0x1ac));var _0x9fb4=function(_0x4d2583,_0x52bd89){_0x4d2583=_0x4d2583-0x0;var _0x57fa3a=_0xfb49[_0x4d2583];return _0x57fa3a;};'use strict';var _=require(_0x9fb4('0x0'));var util=require(_0x9fb4('0x1'));var logger=require(_0x9fb4('0x2'))(_0x9fb4('0x3'));var moment=require('moment');var BPromise=require(_0x9fb4('0x4'));var rp=require(_0x9fb4('0x5'));var fetch=require(_0x9fb4('0x6'));var fs=require('fs');var path=require(_0x9fb4('0x7'));var rimraf=require(_0x9fb4('0x8'));var config=require('../../config/environment');var attributes=require(_0x9fb4('0x9'));module[_0x9fb4('0xa')]=function(_0xee211e,_0x51ab4e){return _0xee211e[_0x9fb4('0xb')]('WhatsappMessage',attributes,{'tableName':_0x9fb4('0xc'),'paranoid':![],'indexes':[{'name':_0x9fb4('0xd'),'fields':[_0x9fb4('0xd')]},{'name':_0x9fb4('0xe'),'fields':[_0x9fb4('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fd88a,_0x16cb55,_0x3f10e7){var _0x35c97a=_0xee211e[_0x9fb4('0x10')];var _0x4f6415=_0x1fd88a[_0x9fb4('0x11')]({'plain':!![]});if(_0x4f6415[_0x9fb4('0x12')][_0x9fb4('0x13')]()==='in'||_0x4f6415[_0x9fb4('0x12')]['toLowerCase']()===_0x9fb4('0x14')&&!_0x4f6415[_0x9fb4('0x15')]&&!_[_0x9fb4('0x16')](_0x4f6415[_0x9fb4('0x17')])){_0x35c97a[_0x9fb4('0x18')][_0x9fb4('0x19')]({'where':{'id':_0x4f6415['WhatsappInteractionId']}})[_0x9fb4('0x1a')](function(_0x194a91){if(_0x194a91){_0x194a91[_0x9fb4('0x1b')]({'lastMsgAt':_0x4f6415[_0x9fb4('0x1c')],'lastMsgDirection':_0x4f6415[_0x9fb4('0x12')][_0x9fb4('0x13')]()});}})['catch'](function(_0x15ec60){console['error'](_0x15ec60);});}if(_0x4f6415['direction']===_0x9fb4('0x14')&&!_0x4f6415[_0x9fb4('0x15')]){var _0x3b76b1;_0x35c97a['WhatsappAccount'][_0x9fb4('0x1d')]({'where':{'id':_0x4f6415[_0x9fb4('0x1e')]},'raw':!![]})[_0x9fb4('0x1a')](function(_0x60f378){_0x3b76b1=_0x60f378;if(_0x3b76b1&&_0x3b76b1['type']){switch(_0x3b76b1[_0x9fb4('0x1f')]){case _0x9fb4('0x20'):var _0x2b53b9=require(_0x9fb4('0x20'));if(_0x3b76b1[_0x9fb4('0x21')]&&_0x3b76b1[_0x9fb4('0x22')]&&_0x3b76b1[_0x9fb4('0x23')]){var _0x4c7270=new _0x2b53b9(_0x3b76b1[_0x9fb4('0x21')],_0x3b76b1[_0x9fb4('0x22')]);_0x4c7270[_0x9fb4('0x24')]['create']({'body':_0x4f6415[_0x9fb4('0xf')],'to':_0x9fb4('0x25')+_0x4f6415[_0x9fb4('0x23')],'from':_0x9fb4('0x25')+_0x3b76b1['phone'],'statusCallback':_0x3b76b1[_0x9fb4('0x26')]+_0x9fb4('0x27')+_0x4f6415['id']+_0x9fb4('0x28')+_0x3b76b1[_0x9fb4('0x29')]})[_0x9fb4('0x1a')](function(_0x49faed){if(_0x49faed[_0x9fb4('0x2a')]){return _0x1fd88a['update']({'messageId':_0x49faed['sid']});}})[_0x9fb4('0x2b')](function(_0x152a71){logger[_0x9fb4('0x2c')](_0x9fb4('0x2d'),'afterCreate',_0x9fb4('0x20'),util[_0x9fb4('0x2e')](_0x152a71,{'showHidden':![],'depth':null}));});}else{logger[_0x9fb4('0x2c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x9fb4('0x2f'),_0x9fb4('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x9fb4('0x30'):var _0x238645=_0x3b76b1['accountSid'];var _0x23cb05=_0x3b76b1[_0x9fb4('0x22')];var _0x1c5d7b=_0x3b76b1['baseUrl']+_0x9fb4('0x31')+_0x238645+_0x9fb4('0x32');var _0x5cad5e={'to':[_0x4f6415[_0x9fb4('0x23')]],'message':{'type':_0x9fb4('0x33'),'text':_0x4f6415[_0x9fb4('0xf')]}};var _0x9aed05={'method':_0x9fb4('0x34'),'uri':_0x1c5d7b,'headers':{'Authorization':_0x9fb4('0x35')+_0x23cb05,'Content-Type':_0x9fb4('0x36')},'body':_0x5cad5e,'json':!![]};rp(_0x9aed05)[_0x9fb4('0x1a')](function(_0x3d613e){if(_0x3d613e[_0x9fb4('0x37')][0x0]['message_id']){return _0x1fd88a[_0x9fb4('0x1b')]({'messageId':_0x3d613e['statuses'][0x0][_0x9fb4('0x38')]});}})[_0x9fb4('0x2b')](function(_0x24993c){logger[_0x9fb4('0x39')](_0x9fb4('0x3a'),_0x24993c);});break;}}})['finally'](function(){_0x3f10e7();});}else{_0x3f10e7();}}},'charset':_0x9fb4('0x3b'),'collate':_0x9fb4('0x3c')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 582c0c0..f6d8841 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 _0x9f09=['create','options','raw','CreateWhatsappMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','WhatsappMessage'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9f09,0x67));var _0x99f0=function(_0x36a6e6,_0x572048){_0x36a6e6=_0x36a6e6-0x0;var _0x4fd5f5=_0x9f09[_0x36a6e6];return _0x4fd5f5;};'use strict';var _=require(_0x99f0('0x0'));var util=require(_0x99f0('0x1'));var moment=require(_0x99f0('0x2'));var BPromise=require(_0x99f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99f0('0x4'));var db=require(_0x99f0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x99f0('0x6'));var jayson=require(_0x99f0('0x7'));var client=jayson[_0x99f0('0x8')][_0x99f0('0x9')]({'port':0x232a});config[_0x99f0('0xa')]=_[_0x99f0('0xb')](config[_0x99f0('0xa')],{'host':_0x99f0('0xc'),'port':0x18eb});var socket=require(_0x99f0('0xd'))(new Redis(config[_0x99f0('0xa')]));require(_0x99f0('0xe'))[_0x99f0('0xf')](socket);function respondWithRpcPromise(_0x275b13,_0x52ce5a,_0x1a000b){return new BPromise(function(_0x49725e,_0x20dd56){return client[_0x99f0('0x10')](_0x275b13,_0x1a000b)[_0x99f0('0x11')](function(_0x31e02b){logger[_0x99f0('0x12')](_0x99f0('0x13'),_0x52ce5a,'request\x20sent');logger[_0x99f0('0x14')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x52ce5a,_0x99f0('0x15'),JSON[_0x99f0('0x16')](_0x31e02b));if(_0x31e02b['error']){if(_0x31e02b['error'][_0x99f0('0x17')]===0x1f4){logger[_0x99f0('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x52ce5a,_0x31e02b[_0x99f0('0x18')][_0x99f0('0x19')]);return _0x20dd56(_0x31e02b[_0x99f0('0x18')]['message']);}logger[_0x99f0('0x18')](_0x99f0('0x13'),_0x52ce5a,_0x31e02b[_0x99f0('0x18')][_0x99f0('0x19')]);return _0x49725e(_0x31e02b[_0x99f0('0x18')]['message']);}else{logger[_0x99f0('0x12')](_0x99f0('0x13'),_0x52ce5a,_0x99f0('0x15'));_0x49725e(_0x31e02b[_0x99f0('0x1a')][_0x99f0('0x19')]);}})[_0x99f0('0x1b')](function(_0x37eb7d){logger[_0x99f0('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x52ce5a,_0x37eb7d);_0x20dd56(_0x37eb7d);});});}exports['CreateWhatsappMessage']=function(_0x24b4ca){var _0x53310c=this;return new Promise(function(_0x2742b3,_0x33c990){return db[_0x99f0('0x1c')][_0x99f0('0x1d')](_0x24b4ca['body'],{'raw':_0x24b4ca[_0x99f0('0x1e')]?_0x24b4ca[_0x99f0('0x1e')][_0x99f0('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0xf0ce4c){logger[_0x99f0('0x12')](_0x99f0('0x20'),_0x24b4ca);logger[_0x99f0('0x14')]('CreateWhatsappMessage',_0x24b4ca,JSON[_0x99f0('0x16')](_0xf0ce4c));_0x2742b3(_0xf0ce4c);})[_0x99f0('0x1b')](function(_0x4f15ca){logger[_0x99f0('0x18')](_0x99f0('0x20'),_0x4f15ca['message'],_0x24b4ca);_0x33c990(_0x53310c[_0x99f0('0x18')](0x1f4,_0x4f15ca[_0x99f0('0x19')]));});});}; \ No newline at end of file +var _0x07d2=['WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappMessage','body','options','raw','CreateWhatsappMessage','lodash','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x52b452,_0x222d50){var _0xcf628b=function(_0x255428){while(--_0x255428){_0x52b452['push'](_0x52b452['shift']());}};_0xcf628b(++_0x222d50);}(_0x07d2,0x12c));var _0x207d=function(_0x53ebe9,_0x4f2009){_0x53ebe9=_0x53ebe9-0x0;var _0x50a060=_0x07d2[_0x53ebe9];return _0x50a060;};'use strict';var _=require(_0x207d('0x0'));var util=require('util');var moment=require(_0x207d('0x1'));var BPromise=require(_0x207d('0x2'));var rs=require(_0x207d('0x3'));var fs=require('fs');var Redis=require(_0x207d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x207d('0x5'));var config=require('../../config/environment');var jayson=require(_0x207d('0x6'));var client=jayson[_0x207d('0x7')][_0x207d('0x8')]({'port':0x232a});config['redis']=_[_0x207d('0x9')](config[_0x207d('0xa')],{'host':_0x207d('0xb'),'port':0x18eb});var socket=require(_0x207d('0xc'))(new Redis(config[_0x207d('0xa')]));require(_0x207d('0xd'))[_0x207d('0xe')](socket);function respondWithRpcPromise(_0x474ed3,_0x2a5a67,_0x4dca47){return new BPromise(function(_0x10b5d5,_0x230947){return client['request'](_0x474ed3,_0x4dca47)[_0x207d('0xf')](function(_0x5b6f5b){logger[_0x207d('0x10')](_0x207d('0x11'),_0x2a5a67,_0x207d('0x12'));logger[_0x207d('0x13')](_0x207d('0x14'),_0x2a5a67,_0x207d('0x12'),JSON[_0x207d('0x15')](_0x5b6f5b));if(_0x5b6f5b[_0x207d('0x16')]){if(_0x5b6f5b[_0x207d('0x16')][_0x207d('0x17')]===0x1f4){logger['error'](_0x207d('0x11'),_0x2a5a67,_0x5b6f5b[_0x207d('0x16')][_0x207d('0x18')]);return _0x230947(_0x5b6f5b[_0x207d('0x16')][_0x207d('0x18')]);}logger['error'](_0x207d('0x11'),_0x2a5a67,_0x5b6f5b[_0x207d('0x16')][_0x207d('0x18')]);return _0x10b5d5(_0x5b6f5b[_0x207d('0x16')][_0x207d('0x18')]);}else{logger[_0x207d('0x10')](_0x207d('0x11'),_0x2a5a67,'request\x20sent');_0x10b5d5(_0x5b6f5b[_0x207d('0x19')][_0x207d('0x18')]);}})[_0x207d('0x1a')](function(_0x1265ac){logger[_0x207d('0x16')](_0x207d('0x11'),_0x2a5a67,_0x1265ac);_0x230947(_0x1265ac);});});}exports['CreateWhatsappMessage']=function(_0x30cabf){var _0x4dcf1c=this;return new Promise(function(_0x4b7943,_0x31ce0c){return db[_0x207d('0x1b')]['create'](_0x30cabf[_0x207d('0x1c')],{'raw':_0x30cabf['options']?_0x30cabf[_0x207d('0x1d')][_0x207d('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x132181){logger[_0x207d('0x10')](_0x207d('0x1f'),_0x30cabf);logger[_0x207d('0x13')](_0x207d('0x1f'),_0x30cabf,JSON[_0x207d('0x15')](_0x132181));_0x4b7943(_0x132181);})['catch'](function(_0x370012){logger[_0x207d('0x16')](_0x207d('0x1f'),_0x370012[_0x207d('0x18')],_0x30cabf);_0x31ce0c(_0x4dcf1c[_0x207d('0x16')](0x1f4,_0x370012[_0x207d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 8385d3e..b6448e9 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 _0x181d=['remove','update','emit','removeListener','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x181d,0x148));var _0xd181=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x181d[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappMessageEvents=require(_0xd181('0x0'));var events=['save',_0xd181('0x1'),_0xd181('0x2')];function createListener(_0x2fd164,_0x20ecbf){return function(_0x52df5f){_0x20ecbf[_0xd181('0x3')](_0x2fd164,_0x52df5f);};}function removeListener(_0x2d044f,_0x5024c9){return function(){WhatsappMessageEvents[_0xd181('0x4')](_0x2d044f,_0x5024c9);};}exports['register']=function(_0x4a67eb){for(var _0x4728c8=0x0,_0x1828d0=events[_0xd181('0x5')];_0x4728c8<_0x1828d0;_0x4728c8++){var _0x3aae27=events[_0x4728c8];var _0x5be048=createListener(_0xd181('0x6')+_0x3aae27,_0x4a67eb);WhatsappMessageEvents['on'](_0x3aae27,_0x5be048);}}; \ No newline at end of file +var _0x6c1f=['./whatsappMessage.events','save','remove','update','emit','removeListener','register','length','whatsappMessage:'];(function(_0x24fa37,_0x385211){var _0x559dd2=function(_0x10d7b9){while(--_0x10d7b9){_0x24fa37['push'](_0x24fa37['shift']());}};_0x559dd2(++_0x385211);}(_0x6c1f,0x1c2));var _0xf6c1=function(_0x5499d9,_0x1abd4f){_0x5499d9=_0x5499d9-0x0;var _0x52054c=_0x6c1f[_0x5499d9];return _0x52054c;};'use strict';var WhatsappMessageEvents=require(_0xf6c1('0x0'));var events=[_0xf6c1('0x1'),_0xf6c1('0x2'),_0xf6c1('0x3')];function createListener(_0x21d478,_0x23d17a){return function(_0x1cbfff){_0x23d17a[_0xf6c1('0x4')](_0x21d478,_0x1cbfff);};}function removeListener(_0x56bdb4,_0x2101d7){return function(){WhatsappMessageEvents[_0xf6c1('0x5')](_0x56bdb4,_0x2101d7);};}exports[_0xf6c1('0x6')]=function(_0xc371e4){for(var _0x4cef0f=0x0,_0x23ac9a=events[_0xf6c1('0x7')];_0x4cef0f<_0x23ac9a;_0x4cef0f++){var _0x49d594=events[_0x4cef0f];var _0x452a8a=createListener(_0xf6c1('0x8')+_0x49d594,_0xc371e4);WhatsappMessageEvents['on'](_0x49d594,_0x452a8a);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index bbf053e..c03547d 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 _0x07cb=['/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','delete','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x07cb,0x149));var _0xb07c=function(_0x330ff0,_0x146528){_0x330ff0=_0x330ff0-0x0;var _0x215472=_0x07cb[_0x330ff0];return _0x215472;};'use strict';var multer=require(_0xb07c('0x0'));var util=require(_0xb07c('0x1'));var path=require('path');var timeout=require(_0xb07c('0x2'));var express=require(_0xb07c('0x3'));var router=express[_0xb07c('0x4')]();var fs_extra=require(_0xb07c('0x5'));var auth=require(_0xb07c('0x6'));var interaction=require(_0xb07c('0x7'));var config=require(_0xb07c('0x8'));var controller=require(_0xb07c('0x9'));router[_0xb07c('0xa')]('/',auth['isAuthenticated'](),controller[_0xb07c('0xb')]);router['get'](_0xb07c('0xc'),auth[_0xb07c('0xd')](),controller[_0xb07c('0xe')]);router['get'](_0xb07c('0xf'),auth[_0xb07c('0xd')](),controller['show']);router[_0xb07c('0xa')](_0xb07c('0x10'),auth[_0xb07c('0xd')](),controller[_0xb07c('0x11')]);router[_0xb07c('0xa')](_0xb07c('0x12'),auth[_0xb07c('0xd')](),controller[_0xb07c('0x13')]);router['get']('/:id/users',auth[_0xb07c('0xd')](),controller[_0xb07c('0x14')]);router[_0xb07c('0x15')]('/',auth[_0xb07c('0xd')](),controller[_0xb07c('0x16')]);router['post'](_0xb07c('0x12'),auth['isAuthenticated'](),controller[_0xb07c('0x17')]);router[_0xb07c('0x15')](_0xb07c('0x18'),auth['isAuthenticated'](),controller[_0xb07c('0x19')]);router[_0xb07c('0x1a')](_0xb07c('0xf'),auth[_0xb07c('0xd')](),controller['update']);router[_0xb07c('0x1b')](_0xb07c('0xf'),auth[_0xb07c('0xd')](),controller[_0xb07c('0x1c')]);router[_0xb07c('0x1b')](_0xb07c('0x12'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xb07c('0x1b')](_0xb07c('0x18'),auth[_0xb07c('0xd')](),controller[_0xb07c('0x1d')]);module[_0xb07c('0x1e')]=router; \ No newline at end of file +var _0x5084=['/:id/users','getAgents','post','addAgents','put','update','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x3e37be,_0x3f80e5){var _0x20ff3d=function(_0xad385d){while(--_0xad385d){_0x3e37be['push'](_0x3e37be['shift']());}};_0x20ff3d(++_0x3f80e5);}(_0x5084,0x1ee));var _0x4508=function(_0x5b38d5,_0xcf0662){_0x5b38d5=_0x5b38d5-0x0;var _0x2600eb=_0x5084[_0x5b38d5];return _0x2600eb;};'use strict';var multer=require(_0x4508('0x0'));var util=require(_0x4508('0x1'));var path=require(_0x4508('0x2'));var timeout=require(_0x4508('0x3'));var express=require(_0x4508('0x4'));var router=express['Router']();var fs_extra=require(_0x4508('0x5'));var auth=require(_0x4508('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4508('0x7'));router[_0x4508('0x8')]('/',auth[_0x4508('0x9')](),controller[_0x4508('0xa')]);router[_0x4508('0x8')](_0x4508('0xb'),auth['isAuthenticated'](),controller[_0x4508('0xc')]);router[_0x4508('0x8')](_0x4508('0xd'),auth[_0x4508('0x9')](),controller[_0x4508('0xe')]);router[_0x4508('0x8')](_0x4508('0xf'),auth[_0x4508('0x9')](),controller[_0x4508('0x10')]);router['get'](_0x4508('0x11'),auth[_0x4508('0x9')](),controller[_0x4508('0x12')]);router[_0x4508('0x8')](_0x4508('0x13'),auth[_0x4508('0x9')](),controller[_0x4508('0x14')]);router[_0x4508('0x15')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x4508('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0x4508('0x15')](_0x4508('0x13'),auth[_0x4508('0x9')](),controller[_0x4508('0x16')]);router[_0x4508('0x17')](_0x4508('0xd'),auth[_0x4508('0x9')](),controller[_0x4508('0x18')]);router['delete'](_0x4508('0xd'),auth[_0x4508('0x9')](),controller['destroy']);router['delete'](_0x4508('0x11'),auth[_0x4508('0x9')](),controller['removeTeams']);router['delete'](_0x4508('0x13'),auth[_0x4508('0x9')](),controller[_0x4508('0x19')]);module[_0x4508('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index cf28154..f8b1441 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 _0x342b=['sequelize','STRING','name','INTEGER'];(function(_0x12a62c,_0xc9c41a){var _0x268a58=function(_0x100ca9){while(--_0x100ca9){_0x12a62c['push'](_0x12a62c['shift']());}};_0x268a58(++_0xc9c41a);}(_0x342b,0xbc));var _0xb342=function(_0x4bb413,_0x1adc8d){_0x4bb413=_0x4bb413-0x0;var _0x2528d3=_0x342b[_0x4bb413];return _0x2528d3;};'use strict';var Sequelize=require(_0xb342('0x0'));module['exports']={'name':{'type':Sequelize[_0xb342('0x1')],'unique':_0xb342('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb342('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall','roundrobin')},'description':{'type':Sequelize[_0xb342('0x1')]}}; \ No newline at end of file +var _0xf874=['ENUM','rrmemory','beepall','STRING','name','INTEGER'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xf874,0xed));var _0x4f87=function(_0x57c864,_0x1dd799){_0x57c864=_0x57c864-0x0;var _0xc67176=_0xf874[_0x57c864];return _0xc67176;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4f87('0x0')],'unique':_0x4f87('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4f87('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4f87('0x3')](_0x4f87('0x4'),_0x4f87('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x4f87('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index d6f12b5..d25c91c 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 _0xf1c9=['show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','describe','getMembers','findOne','hasOwnProperty','order','sort','WhatsappQueueId','filter','UserWhatsappQueue','findAll','findAndCountAll','UserId','agent','whatsappPause','updatedAt','format','SIP','createdAt','Team','pick','options','getTeams','nolimit','addTeams','User','Agents','online','voicePause','flatMap','sequelize','each','forEach','emit','removeTeams','ids','select','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','isArray','bluebird','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','get','WhatsappQueues','UserProfileResource','destroy','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','where','include','query','rows','catch'];(function(_0x3db453,_0x18a04f){var _0x25e68e=function(_0x559f48){while(--_0x559f48){_0x3db453['push'](_0x3db453['shift']());}};_0x25e68e(++_0x18a04f);}(_0xf1c9,0x1c9));var _0x9f1c=function(_0x44ec36,_0x296ad2){_0x44ec36=_0x44ec36-0x0;var _0x22976e=_0xf1c9[_0x44ec36];return _0x22976e;};'use strict';var BPromise=require(_0x9f1c('0x0'));var util=require(_0x9f1c('0x1'));var _=require(_0x9f1c('0x2'));var squel=require(_0x9f1c('0x3'));var Redis=require(_0x9f1c('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x9f1c('0x5'))(_0x9f1c('0x6'));var config=require(_0x9f1c('0x7'));var db=require(_0x9f1c('0x8'))['db'];config[_0x9f1c('0x9')]=_[_0x9f1c('0xa')](config[_0x9f1c('0x9')],{'host':_0x9f1c('0xb'),'port':0x18eb});var socket=require(_0x9f1c('0xc'))(new Redis(config[_0x9f1c('0x9')]));require(_0x9f1c('0xd'))[_0x9f1c('0xe')](socket);function respondWithStatusCode(_0x388848,_0x155a00){_0x155a00=_0x155a00||0xcc;return function(_0x3af1b1){if(_0x3af1b1){return _0x388848[_0x9f1c('0xf')](_0x155a00);}return _0x388848[_0x9f1c('0x10')](_0x155a00)[_0x9f1c('0x11')]();};}function respondWithResult(_0xf9dc3d,_0x4f24fc){_0x4f24fc=_0x4f24fc||0xc8;return function(_0x126a43){if(_0x126a43){return _0xf9dc3d[_0x9f1c('0x10')](_0x4f24fc)[_0x9f1c('0x12')](_0x126a43);}};}function respondWithFilteredResult(_0x2daf78,_0x2a9669){return function(_0x2a3ad0){if(_0x2a3ad0){var _0x5653a1=typeof _0x2a9669[_0x9f1c('0x13')]===_0x9f1c('0x14')&&typeof _0x2a9669['limit']===_0x9f1c('0x14');var _0x47aab9=_0x2a3ad0[_0x9f1c('0x15')];var _0x556662=_0x5653a1?0x0:_0x2a9669['offset'];var _0x17357b=_0x5653a1?_0x2a3ad0[_0x9f1c('0x15')]:_0x2a9669[_0x9f1c('0x13')]+_0x2a9669[_0x9f1c('0x16')];var _0x618160;if(_0x17357b>=_0x47aab9){_0x17357b=_0x47aab9;_0x618160=0xc8;}else{_0x618160=0xce;}_0x2daf78[_0x9f1c('0x10')](_0x618160);return _0x2daf78[_0x9f1c('0x17')](_0x9f1c('0x18'),_0x556662+'-'+_0x17357b+'/'+_0x47aab9)[_0x9f1c('0x12')](_0x2a3ad0);}return null;};}function saveUpdates(_0x24af19){return function(_0x4528a9){if(_0x4528a9){return _0x4528a9[_0x9f1c('0x19')](_0x24af19)[_0x9f1c('0x1a')](function(_0x383be8){return _0x383be8;});}return null;};}function removeEntity(_0x3dfc53){return function(_0x1f367c){if(_0x1f367c){return _0x1f367c['destroy']()[_0x9f1c('0x1a')](function(){var _0x695c7d=_0x1f367c[_0x9f1c('0x1b')]({'plain':!![]});var _0x2ce630=_0x9f1c('0x1c');return db[_0x9f1c('0x1d')][_0x9f1c('0x1e')]({'where':{'type':_0x2ce630,'resourceId':_0x695c7d['id']}})[_0x9f1c('0x1a')](function(){return _0x1f367c;});})[_0x9f1c('0x1a')](function(){_0x3dfc53[_0x9f1c('0x10')](0xcc)[_0x9f1c('0x11')]();});}};}function handleEntityNotFound(_0x26b871){return function(_0x74e786){if(!_0x74e786){_0x26b871[_0x9f1c('0xf')](0x194);}return _0x74e786;};}function handleError(_0x54bc51,_0x53ccf2){_0x53ccf2=_0x53ccf2||0x1f4;return function(_0x4d6759){logger[_0x9f1c('0x1f')](_0x4d6759[_0x9f1c('0x20')]);if(_0x4d6759[_0x9f1c('0x21')]){delete _0x4d6759[_0x9f1c('0x21')];}_0x54bc51[_0x9f1c('0x10')](_0x53ccf2)[_0x9f1c('0x22')](_0x4d6759);};}exports[_0x9f1c('0x23')]=function(_0x375b28,_0x46c3b2){var _0xa13bdf={};var _0xbc341b={'count':0x0,'rows':[]};var _0x49197d=_[_0x9f1c('0x24')](db[_0x9f1c('0x25')][_0x9f1c('0x26')],function(_0x3a4592){return{'name':_0x3a4592[_0x9f1c('0x27')],'type':_0x3a4592[_0x9f1c('0x28')][_0x9f1c('0x29')]};});_0xa13bdf=qs['getOptions'](_0x49197d,_0x375b28);var _0x358fe9={'where':_0xa13bdf[_0x9f1c('0x2a')]};return db['WhatsappQueue'][_0x9f1c('0x15')](_0x358fe9)[_0x9f1c('0x1a')](function(_0x2f96f5){_0xbc341b[_0x9f1c('0x15')]=_0x2f96f5;_0xa13bdf[_0x9f1c('0x2b')]=qs[_0x9f1c('0x2b')](_0x375b28[_0x9f1c('0x2c')]);return db['WhatsappQueue']['findAll'](_0xa13bdf);})[_0x9f1c('0x1a')](function(_0x194383){_0xbc341b[_0x9f1c('0x2d')]=_0x194383;return _0xbc341b;})[_0x9f1c('0x1a')](respondWithFilteredResult(_0x46c3b2,_0xa13bdf))[_0x9f1c('0x2e')](handleError(_0x46c3b2,null));};exports[_0x9f1c('0x2f')]=function(_0x51e47b,_0x299de0){var _0x525816={'raw':!![],'where':{'id':_0x51e47b[_0x9f1c('0x30')]['id']}},_0x4dec34={};_0x4dec34[_0x9f1c('0x31')]=_[_0x9f1c('0x32')](db['WhatsappQueue'][_0x9f1c('0x26')]);_0x4dec34[_0x9f1c('0x2c')]=_[_0x9f1c('0x32')](_0x51e47b[_0x9f1c('0x2c')]);_0x4dec34[_0x9f1c('0x33')]=_[_0x9f1c('0x34')](_0x4dec34[_0x9f1c('0x31')],_0x4dec34['query']);_0x525816[_0x9f1c('0x35')]=_['intersection'](_0x4dec34['model'],qs['fields'](_0x51e47b['query'][_0x9f1c('0x36')]));_0x525816['attributes']=_0x525816[_0x9f1c('0x35')][_0x9f1c('0x37')]?_0x525816['attributes']:_0x4dec34[_0x9f1c('0x31')];if(_0x51e47b['query'][_0x9f1c('0x38')]){_0x525816['include']=[{'all':!![]}];}_0x525816=_[_0x9f1c('0x39')]({},_0x525816,_0x51e47b['options']);return db[_0x9f1c('0x25')][_0x9f1c('0x3a')](_0x525816)[_0x9f1c('0x1a')](handleEntityNotFound(_0x299de0,null))[_0x9f1c('0x1a')](respondWithResult(_0x299de0,null))[_0x9f1c('0x2e')](handleError(_0x299de0,null));};exports['create']=function(_0x292dfb,_0xda3056){return db[_0x9f1c('0x25')][_0x9f1c('0x3b')](_0x292dfb[_0x9f1c('0x3c')],{})[_0x9f1c('0x1a')](function(_0x4fc81b){var _0x50ec1f=_0x292dfb[_0x9f1c('0x3d')]['get']({'plain':!![]});if(!_0x50ec1f)throw new Error(_0x9f1c('0x3e'));if(_0x50ec1f['role']===_0x9f1c('0x3d')){var _0x229eed=_0x4fc81b['get']({'plain':!![]});var _0x2b2a67=_0x9f1c('0x1c');return db[_0x9f1c('0x3f')][_0x9f1c('0x3a')]({'where':{'name':_0x2b2a67,'userProfileId':_0x50ec1f[_0x9f1c('0x40')]},'raw':!![]})[_0x9f1c('0x1a')](function(_0x181270){if(_0x181270&&_0x181270['autoAssociation']===0x0){return db['UserProfileResource'][_0x9f1c('0x3b')]({'name':_0x229eed[_0x9f1c('0x21')],'resourceId':_0x229eed['id'],'type':_0x181270[_0x9f1c('0x21')],'sectionId':_0x181270['id']},{})[_0x9f1c('0x1a')](function(){return _0x4fc81b;});}else{return _0x4fc81b;}})[_0x9f1c('0x2e')](function(_0x14b3be){logger[_0x9f1c('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14b3be);throw _0x14b3be;});}return _0x4fc81b;})[_0x9f1c('0x1a')](respondWithResult(_0xda3056,0xc9))['catch'](handleError(_0xda3056,null));};exports[_0x9f1c('0x19')]=function(_0x20636e,_0x4c6bf6){if(_0x20636e[_0x9f1c('0x3c')]['id']){delete _0x20636e['body']['id'];}return db[_0x9f1c('0x25')][_0x9f1c('0x3a')]({'where':{'id':_0x20636e['params']['id']}})['then'](handleEntityNotFound(_0x4c6bf6,null))['then'](saveUpdates(_0x20636e['body'],null))['then'](respondWithResult(_0x4c6bf6,null))[_0x9f1c('0x2e')](handleError(_0x4c6bf6,null));};exports['destroy']=function(_0x45260f,_0x590e0e){return db[_0x9f1c('0x25')][_0x9f1c('0x3a')]({'where':{'id':_0x45260f[_0x9f1c('0x30')]['id']}})['then'](handleEntityNotFound(_0x590e0e,null))[_0x9f1c('0x1a')](removeEntity(_0x590e0e,null))[_0x9f1c('0x2e')](handleError(_0x590e0e,null));};exports[_0x9f1c('0x41')]=function(_0x3c1b44,_0x2dafa4){return db['WhatsappQueue']['describe']()[_0x9f1c('0x1a')](respondWithResult(_0x2dafa4,null))[_0x9f1c('0x2e')](handleError(_0x2dafa4,null));};exports[_0x9f1c('0x42')]=function(_0x18bfde,_0x2354e2){var _0x473065={'raw':!![],'where':{}},_0x39b0aa={},_0x8ac4ae;return db['WhatsappQueue'][_0x9f1c('0x43')]({'where':{'id':_0x18bfde[_0x9f1c('0x30')]['id']}})[_0x9f1c('0x1a')](handleEntityNotFound(_0x2354e2,null))[_0x9f1c('0x1a')](function(_0x309bf9){if(_0x309bf9){_0x8ac4ae=_0x309bf9[_0x9f1c('0x1b')]({'plain':!![]});_0x39b0aa[_0x9f1c('0x31')]=_[_0x9f1c('0x32')](db['UserWhatsappQueue'][_0x9f1c('0x26')]);_0x39b0aa['query']=_['keys'](_0x18bfde[_0x9f1c('0x2c')]);_0x39b0aa[_0x9f1c('0x33')]=_[_0x9f1c('0x34')](_0x39b0aa[_0x9f1c('0x31')],_0x39b0aa[_0x9f1c('0x2c')]);_0x473065['attributes']=_['intersection'](_0x39b0aa[_0x9f1c('0x31')],qs['fields'](_0x18bfde['query'][_0x9f1c('0x36')]));_0x473065[_0x9f1c('0x35')]=_0x473065[_0x9f1c('0x35')][_0x9f1c('0x37')]?_0x473065[_0x9f1c('0x35')]:_0x39b0aa[_0x9f1c('0x31')];if(!_0x18bfde[_0x9f1c('0x2c')][_0x9f1c('0x44')]('nolimit')){_0x473065[_0x9f1c('0x16')]=qs[_0x9f1c('0x16')](_0x18bfde[_0x9f1c('0x2c')]['limit']);_0x473065[_0x9f1c('0x13')]=qs[_0x9f1c('0x13')](_0x18bfde[_0x9f1c('0x2c')][_0x9f1c('0x13')]);}_0x473065[_0x9f1c('0x45')]=qs['sort'](_0x18bfde[_0x9f1c('0x2c')][_0x9f1c('0x46')]);_0x473065[_0x9f1c('0x2a')]=qs['filters'](_['pick'](_0x18bfde[_0x9f1c('0x2c')],_0x39b0aa[_0x9f1c('0x33')]));_0x473065[_0x9f1c('0x2a')][_0x9f1c('0x47')]=_0x309bf9['id'];if(_0x18bfde[_0x9f1c('0x2c')]['filter']){_0x473065['where']=_[_0x9f1c('0x39')](_0x473065[_0x9f1c('0x2a')],{'$or':_[_0x9f1c('0x24')](_0x473065[_0x9f1c('0x35')],function(_0x175ec9){var _0xf9587={};_0xf9587[_0x175ec9]={'$like':'%'+_0x18bfde[_0x9f1c('0x2c')][_0x9f1c('0x48')]+'%'};return _0xf9587;})});}_0x473065=_['merge']({},_0x473065,_0x18bfde['options']);return db[_0x9f1c('0x49')][_0x9f1c('0x4a')](_0x473065);}})[_0x9f1c('0x1a')](function(_0x1d7e7e){if(_0x1d7e7e){return db['User'][_0x9f1c('0x4b')]({'where':{'id':_[_0x9f1c('0x24')](_0x1d7e7e,_0x9f1c('0x4c')),'role':_0x9f1c('0x4d')},'attributes':['id','name',_0x9f1c('0x4e'),_0x9f1c('0x4f'),'createdAt']});}})[_0x9f1c('0x1a')](function(_0x32dbc2){if(_0x32dbc2){return{'count':_0x32dbc2[_0x9f1c('0x15')],'rows':_[_0x9f1c('0x24')](_0x32dbc2[_0x9f1c('0x2d')],function(_0x3d82cf){return{'membername':_0x3d82cf[_0x9f1c('0x21')],'UserId':_0x3d82cf['id'],'queue_name':_0x8ac4ae[_0x9f1c('0x21')],'WhatsappQueueId':_0x8ac4ae['id'],'interface':util[_0x9f1c('0x50')]('%s/%s',_0x9f1c('0x51'),_0x3d82cf[_0x9f1c('0x21')]),'penalty':0x0,'paused':_0x3d82cf[_0x9f1c('0x4e')],'createdAt':_0x3d82cf[_0x9f1c('0x52')],'updatedAt':_0x3d82cf[_0x9f1c('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9f1c('0x1a')](respondWithFilteredResult(_0x2354e2,_0x473065))[_0x9f1c('0x2e')](handleError(_0x2354e2,null));};exports['getTeams']=function(_0x4eecca,_0x2a7ed5){var _0x51ba88={};var _0xb92ad4={};var _0x18b2f7;var _0x3d34d7;return db[_0x9f1c('0x25')][_0x9f1c('0x43')]({'where':{'id':_0x4eecca[_0x9f1c('0x30')]['id']}})[_0x9f1c('0x1a')](handleEntityNotFound(_0x2a7ed5,null))[_0x9f1c('0x1a')](function(_0x312615){if(_0x312615){_0x18b2f7=_0x312615;_0xb92ad4['model']=_['keys'](db[_0x9f1c('0x53')][_0x9f1c('0x26')]);_0xb92ad4['query']=_['keys'](_0x4eecca['query']);_0xb92ad4[_0x9f1c('0x33')]=_[_0x9f1c('0x34')](_0xb92ad4['model'],_0xb92ad4['query']);_0x51ba88[_0x9f1c('0x35')]=_[_0x9f1c('0x34')](_0xb92ad4['model'],qs['fields'](_0x4eecca[_0x9f1c('0x2c')][_0x9f1c('0x36')]));_0x51ba88['attributes']=_0x51ba88[_0x9f1c('0x35')][_0x9f1c('0x37')]?_0x51ba88[_0x9f1c('0x35')]:_0xb92ad4[_0x9f1c('0x31')];_0x51ba88[_0x9f1c('0x45')]=qs[_0x9f1c('0x46')](_0x4eecca['query'][_0x9f1c('0x46')]);_0x51ba88[_0x9f1c('0x2a')]=qs[_0x9f1c('0x33')](_[_0x9f1c('0x54')](_0x4eecca[_0x9f1c('0x2c')],_0xb92ad4['filters']));if(_0x4eecca[_0x9f1c('0x2c')][_0x9f1c('0x48')]){_0x51ba88[_0x9f1c('0x2a')]=_['merge'](_0x51ba88[_0x9f1c('0x2a')],{'$or':_[_0x9f1c('0x24')](_0x51ba88[_0x9f1c('0x35')],function(_0x25cdc0){var _0xeef153={};_0xeef153[_0x25cdc0]={'$like':'%'+_0x4eecca[_0x9f1c('0x2c')]['filter']+'%'};return _0xeef153;})});}_0x51ba88=_[_0x9f1c('0x39')]({},_0x51ba88,_0x4eecca[_0x9f1c('0x55')]);return _0x18b2f7[_0x9f1c('0x56')](_0x51ba88);}})[_0x9f1c('0x1a')](function(_0xe5b409){if(_0xe5b409){_0x3d34d7=_0xe5b409[_0x9f1c('0x37')];if(!_0x4eecca[_0x9f1c('0x2c')]['hasOwnProperty'](_0x9f1c('0x57'))){_0x51ba88[_0x9f1c('0x16')]=qs[_0x9f1c('0x16')](_0x4eecca[_0x9f1c('0x2c')][_0x9f1c('0x16')]);_0x51ba88[_0x9f1c('0x13')]=qs[_0x9f1c('0x13')](_0x4eecca['query'][_0x9f1c('0x13')]);}return _0x18b2f7[_0x9f1c('0x56')](_0x51ba88);}})[_0x9f1c('0x1a')](function(_0x4cb04a){if(_0x4cb04a){return _0x4cb04a?{'count':_0x3d34d7,'rows':_0x4cb04a}:null;}})['then'](respondWithResult(_0x2a7ed5,null))[_0x9f1c('0x2e')](handleError(_0x2a7ed5,null));};exports[_0x9f1c('0x58')]=function(_0x4f6fca,_0x35a0bd){var _0x3062d3=_0x4f6fca[_0x9f1c('0x3c')]['ids'];return db[_0x9f1c('0x53')]['findAll']({'where':{'id':_0x3062d3},'attributes':['id'],'include':[{'model':db[_0x9f1c('0x59')],'as':_0x9f1c('0x5a'),'attributes':['id',_0x9f1c('0x21'),_0x9f1c('0x5b'),_0x9f1c('0x5c'),'interface'],'raw':!![]}]})[_0x9f1c('0x1a')](function(_0x35a1f8){if(_0x35a1f8){var _0x4d2855=_[_0x9f1c('0x5d')](_0x35a1f8,function(_0xbf8e1a){var _0x28abf5=_0xbf8e1a[_0x9f1c('0x1b')]({'plain':!![]});return _0x28abf5[_0x9f1c('0x5a')];});return db[_0x9f1c('0x25')][_0x9f1c('0x3a')]({'where':{'id':_0x4f6fca[_0x9f1c('0x30')]['id']}})[_0x9f1c('0x1a')](function(_0x207692){return db[_0x9f1c('0x5e')]['transaction'](function(_0x3d3ac5){return _0x207692[_0x9f1c('0x58')](_0x3062d3,{'transaction':_0x3d3ac5})[_0x9f1c('0x1a')](function(){return BPromise[_0x9f1c('0x5f')](_0x4d2855,function(_0x44fcff){return db[_0x9f1c('0x49')]['findOrCreate']({'where':{'UserId':_0x44fcff['id'],'WhatsappQueueId':_0x4f6fca[_0x9f1c('0x30')]['id']},'transaction':_0x3d3ac5});});})[_0x9f1c('0x1a')](function(){_0x4d2855[_0x9f1c('0x60')](function(_0x59a6b8){socket[_0x9f1c('0x61')]('userWhatsappQueue:save',{'UserId':_0x59a6b8['id'],'WhatsappQueueId':_0x207692['id']});});});});});}})['then'](respondWithStatusCode(_0x35a0bd,null))['catch'](handleError(_0x35a0bd,null));};exports[_0x9f1c('0x62')]=function(_0x21885c,_0x3f75bd){return db['Team'][_0x9f1c('0x4a')]({'where':{'id':_0x21885c[_0x9f1c('0x2c')][_0x9f1c('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9f1c('0x1a')](handleEntityNotFound(_0x3f75bd,null))[_0x9f1c('0x1a')](function(_0x5a98e2){var _0x4185a4=_[_0x9f1c('0x24')](_0x5a98e2,'id');var _0x37be96=[];var _0x26e75f=[];var _0x99d8f2=squel[_0x9f1c('0x64')]();_0x99d8f2['field'](_0x9f1c('0x65'))[_0x9f1c('0x66')](_0x9f1c('0x67'),'tq')[_0x9f1c('0x68')]('user_has_teams','ut',_0x9f1c('0x69'))[_0x9f1c('0x2a')](_0x9f1c('0x6a'),_0x21885c[_0x9f1c('0x30')]['id']);for(var _0x1d7a1b=0x0;_0x1d7a1b<_0x5a98e2[_0x9f1c('0x37')];_0x1d7a1b+=0x1){let _0x2403c4=_0x5a98e2[_0x1d7a1b];for(var _0x443734=0x0;_0x443734<_0x2403c4['Agents'][_0x9f1c('0x37')];_0x443734+=0x1){let _0x517859=_0x2403c4['Agents'][_0x443734];var _0x3739db=_0x99d8f2['clone']();_0x3739db[_0x9f1c('0x2a')]('ut.UserId\x20=\x20?',_0x517859['id']);_0x26e75f['push'](db[_0x9f1c('0x5e')][_0x9f1c('0x2c')](_0x3739db[_0x9f1c('0x6b')](),{'type':db['sequelize'][_0x9f1c('0x6c')][_0x9f1c('0x6d')]})[_0x9f1c('0x1a')](function(_0x111107){if(_0x111107[_0x9f1c('0x37')]===0x1){return _0x517859['id'];}else{var _0x113cda=_[_0x9f1c('0x6e')](_['map'](_0x111107,_0x9f1c('0x6f')),function(_0x18dcac){return _[_0x9f1c('0x70')](_0x4185a4,_0x18dcac);});if(_0x113cda){return _0x517859['id'];}}}));}}return BPromise[_0x9f1c('0x71')](_0x26e75f)['then'](function(_0x374394){_0x37be96=_(_0x37be96)[_0x9f1c('0x72')](_0x374394)[_0x9f1c('0x73')]()[_0x9f1c('0x74')]();return db[_0x9f1c('0x25')][_0x9f1c('0x3a')]({'where':{'id':_0x21885c[_0x9f1c('0x30')]['id']}})[_0x9f1c('0x1a')](function(_0x5a9e53){return db[_0x9f1c('0x5e')][_0x9f1c('0x75')](function(_0x14ce39){return _0x5a9e53[_0x9f1c('0x62')](_0x21885c[_0x9f1c('0x2c')][_0x9f1c('0x63')],{'transaction':_0x14ce39})[_0x9f1c('0x1a')](function(){if(!_[_0x9f1c('0x76')](_0x37be96)){return _0x5a9e53[_0x9f1c('0x77')](_0x37be96,{'transaction':_0x14ce39});}})[_0x9f1c('0x1a')](function(){_0x37be96[_0x9f1c('0x60')](function(_0x3063d1){socket[_0x9f1c('0x61')](_0x9f1c('0x78'),{'UserId':_0x3063d1,'WhatsappQueueId':_0x5a9e53['id']});});});});});});})['then'](respondWithStatusCode(_0x3f75bd,null))[_0x9f1c('0x2e')](handleError(_0x3f75bd,null));};exports[_0x9f1c('0x79')]=function(_0x2d0ca7,_0x527211){return db[_0x9f1c('0x25')][_0x9f1c('0x3a')]({'where':{'id':_0x2d0ca7[_0x9f1c('0x30')]['id']}})['then'](handleEntityNotFound(_0x527211,null))[_0x9f1c('0x1a')](function(_0x52563c){if(_0x52563c){return _0x52563c[_0x9f1c('0x79')](_0x2d0ca7[_0x9f1c('0x3c')][_0x9f1c('0x63')],_[_0x9f1c('0x7a')](_0x2d0ca7['body'],[_0x9f1c('0x63'),'id'])||{})[_0x9f1c('0x7b')](function(_0x2e25da){for(var _0x22b6ad=0x0;_0x22b6ad<_0x2d0ca7[_0x9f1c('0x3c')][_0x9f1c('0x63')][_0x9f1c('0x37')];_0x22b6ad+=0x1){socket[_0x9f1c('0x61')](_0x9f1c('0x7c'),{'UserId':Number(_0x2d0ca7[_0x9f1c('0x3c')][_0x9f1c('0x63')][_0x22b6ad]),'WhatsappQueueId':Number(_0x2d0ca7[_0x9f1c('0x30')]['id'])});}return _0x2e25da;});}})[_0x9f1c('0x1a')](respondWithResult(_0x527211,null))[_0x9f1c('0x2e')](handleError(_0x527211,null));};exports[_0x9f1c('0x77')]=function(_0x15aa3b,_0x50a9a1){return db[_0x9f1c('0x25')][_0x9f1c('0x3a')]({'where':{'id':_0x15aa3b[_0x9f1c('0x30')]['id']}})[_0x9f1c('0x1a')](handleEntityNotFound(_0x50a9a1,null))[_0x9f1c('0x1a')](function(_0x1ce741){if(_0x1ce741){return _0x1ce741[_0x9f1c('0x77')](_0x15aa3b[_0x9f1c('0x2c')][_0x9f1c('0x63')])['then'](function(){if(_[_0x9f1c('0x7d')](_0x15aa3b['query']['ids'])){for(var _0x43f24a=0x0;_0x43f24a<_0x15aa3b[_0x9f1c('0x2c')]['ids'][_0x9f1c('0x37')];_0x43f24a+=0x1){socket[_0x9f1c('0x61')](_0x9f1c('0x78'),{'UserId':Number(_0x15aa3b['query']['ids'][_0x43f24a]),'WhatsappQueueId':Number(_0x15aa3b[_0x9f1c('0x30')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x15aa3b[_0x9f1c('0x2c')][_0x9f1c('0x63')]),'WhatsappQueueId':Number(_0x15aa3b[_0x9f1c('0x30')]['id'])});}});}})['then'](respondWithStatusCode(_0x50a9a1,null))[_0x9f1c('0x2e')](handleError(_0x50a9a1,null));};exports['getAgents']=function(_0x2d5d69,_0x1acffb){var _0x5d29dc={};var _0x57ea09={};var _0x12e0c6;var _0x206691;return db[_0x9f1c('0x25')][_0x9f1c('0x43')]({'where':{'id':_0x2d5d69[_0x9f1c('0x30')]['id']}})[_0x9f1c('0x1a')](handleEntityNotFound(_0x1acffb,null))[_0x9f1c('0x1a')](function(_0x45b694){if(_0x45b694){_0x12e0c6=_0x45b694;_0x57ea09[_0x9f1c('0x31')]=_[_0x9f1c('0x32')](db[_0x9f1c('0x59')][_0x9f1c('0x26')]);_0x57ea09[_0x9f1c('0x2c')]=_[_0x9f1c('0x32')](_0x2d5d69[_0x9f1c('0x2c')]);_0x57ea09[_0x9f1c('0x33')]=_[_0x9f1c('0x34')](_0x57ea09[_0x9f1c('0x31')],_0x57ea09[_0x9f1c('0x2c')]);_0x5d29dc[_0x9f1c('0x35')]=_[_0x9f1c('0x34')](_0x57ea09['model'],qs[_0x9f1c('0x36')](_0x2d5d69[_0x9f1c('0x2c')][_0x9f1c('0x36')]));_0x5d29dc[_0x9f1c('0x35')]=_0x5d29dc[_0x9f1c('0x35')][_0x9f1c('0x37')]?_0x5d29dc[_0x9f1c('0x35')]:_0x57ea09[_0x9f1c('0x31')];_0x5d29dc[_0x9f1c('0x45')]=qs['sort'](_0x2d5d69[_0x9f1c('0x2c')][_0x9f1c('0x46')]);_0x5d29dc['where']=qs['filters'](_['pick'](_0x2d5d69[_0x9f1c('0x2c')],_0x57ea09[_0x9f1c('0x33')]));if(_0x2d5d69[_0x9f1c('0x2c')]['filter']){_0x5d29dc[_0x9f1c('0x2a')]=_[_0x9f1c('0x39')](_0x5d29dc[_0x9f1c('0x2a')],{'$or':_[_0x9f1c('0x24')](_0x5d29dc['attributes'],function(_0x158b19){var _0x514d5e={};_0x514d5e[_0x158b19]={'$like':'%'+_0x2d5d69[_0x9f1c('0x2c')][_0x9f1c('0x48')]+'%'};return _0x514d5e;})});}_0x5d29dc=_['merge']({},_0x5d29dc,_0x2d5d69[_0x9f1c('0x55')]);return _0x12e0c6['getAgents'](_0x5d29dc);}})[_0x9f1c('0x1a')](function(_0x4ae993){if(_0x4ae993){_0x206691=_0x4ae993[_0x9f1c('0x37')];if(!_0x2d5d69[_0x9f1c('0x2c')]['hasOwnProperty'](_0x9f1c('0x57'))){_0x5d29dc[_0x9f1c('0x16')]=qs['limit'](_0x2d5d69[_0x9f1c('0x2c')]['limit']);_0x5d29dc['offset']=qs['offset'](_0x2d5d69['query'][_0x9f1c('0x13')]);}return _0x12e0c6['getAgents'](_0x5d29dc);}})[_0x9f1c('0x1a')](function(_0x5c08af){if(_0x5c08af){return _0x5c08af?{'count':_0x206691,'rows':_0x5c08af}:null;}})['then'](respondWithResult(_0x1acffb,null))['catch'](handleError(_0x1acffb,null));}; \ No newline at end of file +var _0x5d03=['addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','offset','limit','undefined','count','update','destroy','get','WhatsappQueues','UserProfileResource','then','error','stack','name','index','map','WhatsappQueue','fieldName','type','key','getOptions','include','findAll','rows','catch','params','model','rawAttributes','query','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','keys','hasOwnProperty','order','sort','where','filters','pick','WhatsappQueueId','filter','UserWhatsappQueue','User','findAndCountAll','agent','whatsappPause','format','%s/%s','SIP','updatedAt','Team','getTeams','nolimit','addTeams','ids','Agents','online','flatMap','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents'];(function(_0x3e5f05,_0x5663ff){var _0x4c5152=function(_0x98c461){while(--_0x98c461){_0x3e5f05['push'](_0x3e5f05['shift']());}};_0x4c5152(++_0x5663ff);}(_0x5d03,0x104));var _0x35d0=function(_0xe7babe,_0x3a6af0){_0xe7babe=_0xe7babe-0x0;var _0x5f23b7=_0x5d03[_0xe7babe];return _0x5f23b7;};'use strict';var BPromise=require(_0x35d0('0x0'));var util=require(_0x35d0('0x1'));var _=require(_0x35d0('0x2'));var squel=require(_0x35d0('0x3'));var Redis=require(_0x35d0('0x4'));var qs=require(_0x35d0('0x5'));var logger=require(_0x35d0('0x6'))(_0x35d0('0x7'));var config=require(_0x35d0('0x8'));var db=require(_0x35d0('0x9'))['db'];config[_0x35d0('0xa')]=_[_0x35d0('0xb')](config[_0x35d0('0xa')],{'host':_0x35d0('0xc'),'port':0x18eb});var socket=require(_0x35d0('0xd'))(new Redis(config['redis']));require(_0x35d0('0xe'))[_0x35d0('0xf')](socket);function respondWithStatusCode(_0x1f2118,_0x48d96d){_0x48d96d=_0x48d96d||0xcc;return function(_0x495440){if(_0x495440){return _0x1f2118[_0x35d0('0x10')](_0x48d96d);}return _0x1f2118[_0x35d0('0x11')](_0x48d96d)[_0x35d0('0x12')]();};}function respondWithResult(_0x500cd0,_0x5c7ea6){_0x5c7ea6=_0x5c7ea6||0xc8;return function(_0x1919af){if(_0x1919af){return _0x500cd0[_0x35d0('0x11')](_0x5c7ea6)['json'](_0x1919af);}};}function respondWithFilteredResult(_0x1f50e3,_0x3453ef){return function(_0x2ebdde){if(_0x2ebdde){var _0x150bbc=typeof _0x3453ef[_0x35d0('0x13')]==='undefined'&&typeof _0x3453ef[_0x35d0('0x14')]===_0x35d0('0x15');var _0x1df35a=_0x2ebdde[_0x35d0('0x16')];var _0x39aee9=_0x150bbc?0x0:_0x3453ef['offset'];var _0x42047a=_0x150bbc?_0x2ebdde[_0x35d0('0x16')]:_0x3453ef[_0x35d0('0x13')]+_0x3453ef['limit'];var _0x34c436;if(_0x42047a>=_0x1df35a){_0x42047a=_0x1df35a;_0x34c436=0xc8;}else{_0x34c436=0xce;}_0x1f50e3[_0x35d0('0x11')](_0x34c436);return _0x1f50e3['set']('Content-Range',_0x39aee9+'-'+_0x42047a+'/'+_0x1df35a)['json'](_0x2ebdde);}return null;};}function saveUpdates(_0x5cec0f){return function(_0x440097){if(_0x440097){return _0x440097[_0x35d0('0x17')](_0x5cec0f)['then'](function(_0x397cc2){return _0x397cc2;});}return null;};}function removeEntity(_0x5b3fc6){return function(_0x592ba1){if(_0x592ba1){return _0x592ba1[_0x35d0('0x18')]()['then'](function(){var _0x5462f9=_0x592ba1[_0x35d0('0x19')]({'plain':!![]});var _0x3c6686=_0x35d0('0x1a');return db[_0x35d0('0x1b')][_0x35d0('0x18')]({'where':{'type':_0x3c6686,'resourceId':_0x5462f9['id']}})['then'](function(){return _0x592ba1;});})[_0x35d0('0x1c')](function(){_0x5b3fc6[_0x35d0('0x11')](0xcc)[_0x35d0('0x12')]();});}};}function handleEntityNotFound(_0x4163b0){return function(_0x5cb7ce){if(!_0x5cb7ce){_0x4163b0[_0x35d0('0x10')](0x194);}return _0x5cb7ce;};}function handleError(_0x587c4f,_0xb8063d){_0xb8063d=_0xb8063d||0x1f4;return function(_0x2355af){logger[_0x35d0('0x1d')](_0x2355af[_0x35d0('0x1e')]);if(_0x2355af['name']){delete _0x2355af[_0x35d0('0x1f')];}_0x587c4f[_0x35d0('0x11')](_0xb8063d)['send'](_0x2355af);};}exports[_0x35d0('0x20')]=function(_0x5576ec,_0x20a364){var _0x3cf226={};var _0x22c11d={'count':0x0,'rows':[]};var _0xca60ad=_[_0x35d0('0x21')](db[_0x35d0('0x22')]['rawAttributes'],function(_0x33e4fb){return{'name':_0x33e4fb[_0x35d0('0x23')],'type':_0x33e4fb[_0x35d0('0x24')][_0x35d0('0x25')]};});_0x3cf226=qs[_0x35d0('0x26')](_0xca60ad,_0x5576ec);var _0x5da692={'where':_0x3cf226['where']};return db[_0x35d0('0x22')][_0x35d0('0x16')](_0x5da692)[_0x35d0('0x1c')](function(_0x2ae32f){_0x22c11d['count']=_0x2ae32f;_0x3cf226[_0x35d0('0x27')]=qs[_0x35d0('0x27')](_0x5576ec['query']);return db[_0x35d0('0x22')][_0x35d0('0x28')](_0x3cf226);})['then'](function(_0x52752d){_0x22c11d[_0x35d0('0x29')]=_0x52752d;return _0x22c11d;})[_0x35d0('0x1c')](respondWithFilteredResult(_0x20a364,_0x3cf226))[_0x35d0('0x2a')](handleError(_0x20a364,null));};exports['show']=function(_0x59702c,_0x469233){var _0x59bff2={'raw':!![],'where':{'id':_0x59702c[_0x35d0('0x2b')]['id']}},_0x4a81c8={};_0x4a81c8[_0x35d0('0x2c')]=_['keys'](db[_0x35d0('0x22')][_0x35d0('0x2d')]);_0x4a81c8[_0x35d0('0x2e')]=_['keys'](_0x59702c[_0x35d0('0x2e')]);_0x4a81c8['filters']=_[_0x35d0('0x2f')](_0x4a81c8['model'],_0x4a81c8[_0x35d0('0x2e')]);_0x59bff2['attributes']=_[_0x35d0('0x2f')](_0x4a81c8[_0x35d0('0x2c')],qs[_0x35d0('0x30')](_0x59702c[_0x35d0('0x2e')]['fields']));_0x59bff2[_0x35d0('0x31')]=_0x59bff2[_0x35d0('0x31')][_0x35d0('0x32')]?_0x59bff2[_0x35d0('0x31')]:_0x4a81c8[_0x35d0('0x2c')];if(_0x59702c[_0x35d0('0x2e')][_0x35d0('0x33')]){_0x59bff2[_0x35d0('0x27')]=[{'all':!![]}];}_0x59bff2=_[_0x35d0('0x34')]({},_0x59bff2,_0x59702c[_0x35d0('0x35')]);return db[_0x35d0('0x22')][_0x35d0('0x36')](_0x59bff2)[_0x35d0('0x1c')](handleEntityNotFound(_0x469233,null))['then'](respondWithResult(_0x469233,null))[_0x35d0('0x2a')](handleError(_0x469233,null));};exports[_0x35d0('0x37')]=function(_0xfc118e,_0x54cb64){return db[_0x35d0('0x22')][_0x35d0('0x37')](_0xfc118e[_0x35d0('0x38')],{})[_0x35d0('0x1c')](function(_0x309dc2){var _0x1e6e94=_0xfc118e['user'][_0x35d0('0x19')]({'plain':!![]});if(!_0x1e6e94)throw new Error(_0x35d0('0x39'));if(_0x1e6e94[_0x35d0('0x3a')]===_0x35d0('0x3b')){var _0xfc505e=_0x309dc2['get']({'plain':!![]});var _0x33851a=_0x35d0('0x1a');return db[_0x35d0('0x3c')][_0x35d0('0x36')]({'where':{'name':_0x33851a,'userProfileId':_0x1e6e94[_0x35d0('0x3d')]},'raw':!![]})['then'](function(_0xf40223){if(_0xf40223&&_0xf40223[_0x35d0('0x3e')]===0x0){return db[_0x35d0('0x1b')][_0x35d0('0x37')]({'name':_0xfc505e[_0x35d0('0x1f')],'resourceId':_0xfc505e['id'],'type':_0xf40223['name'],'sectionId':_0xf40223['id']},{})['then'](function(){return _0x309dc2;});}else{return _0x309dc2;}})[_0x35d0('0x2a')](function(_0x15e9ba){logger[_0x35d0('0x1d')](_0x35d0('0x3f'),_0x15e9ba);throw _0x15e9ba;});}return _0x309dc2;})['then'](respondWithResult(_0x54cb64,0xc9))[_0x35d0('0x2a')](handleError(_0x54cb64,null));};exports[_0x35d0('0x17')]=function(_0x16328f,_0x4751ff){if(_0x16328f[_0x35d0('0x38')]['id']){delete _0x16328f['body']['id'];}return db[_0x35d0('0x22')]['find']({'where':{'id':_0x16328f[_0x35d0('0x2b')]['id']}})[_0x35d0('0x1c')](handleEntityNotFound(_0x4751ff,null))['then'](saveUpdates(_0x16328f[_0x35d0('0x38')],null))[_0x35d0('0x1c')](respondWithResult(_0x4751ff,null))[_0x35d0('0x2a')](handleError(_0x4751ff,null));};exports[_0x35d0('0x18')]=function(_0x4e6a01,_0x51a7f1){return db[_0x35d0('0x22')][_0x35d0('0x36')]({'where':{'id':_0x4e6a01[_0x35d0('0x2b')]['id']}})[_0x35d0('0x1c')](handleEntityNotFound(_0x51a7f1,null))[_0x35d0('0x1c')](removeEntity(_0x51a7f1,null))[_0x35d0('0x2a')](handleError(_0x51a7f1,null));};exports[_0x35d0('0x40')]=function(_0x448445,_0x46369d){return db[_0x35d0('0x22')]['describe']()[_0x35d0('0x1c')](respondWithResult(_0x46369d,null))[_0x35d0('0x2a')](handleError(_0x46369d,null));};exports['getMembers']=function(_0x12a065,_0x3507ae){var _0x3cd912={'raw':!![],'where':{}},_0x5a5b04={},_0x34c524;return db[_0x35d0('0x22')][_0x35d0('0x41')]({'where':{'id':_0x12a065[_0x35d0('0x2b')]['id']}})[_0x35d0('0x1c')](handleEntityNotFound(_0x3507ae,null))[_0x35d0('0x1c')](function(_0x397178){if(_0x397178){_0x34c524=_0x397178[_0x35d0('0x19')]({'plain':!![]});_0x5a5b04[_0x35d0('0x2c')]=_['keys'](db['UserWhatsappQueue'][_0x35d0('0x2d')]);_0x5a5b04['query']=_[_0x35d0('0x42')](_0x12a065[_0x35d0('0x2e')]);_0x5a5b04['filters']=_[_0x35d0('0x2f')](_0x5a5b04[_0x35d0('0x2c')],_0x5a5b04[_0x35d0('0x2e')]);_0x3cd912[_0x35d0('0x31')]=_[_0x35d0('0x2f')](_0x5a5b04[_0x35d0('0x2c')],qs['fields'](_0x12a065['query'][_0x35d0('0x30')]));_0x3cd912[_0x35d0('0x31')]=_0x3cd912[_0x35d0('0x31')][_0x35d0('0x32')]?_0x3cd912[_0x35d0('0x31')]:_0x5a5b04[_0x35d0('0x2c')];if(!_0x12a065['query'][_0x35d0('0x43')]('nolimit')){_0x3cd912['limit']=qs[_0x35d0('0x14')](_0x12a065[_0x35d0('0x2e')][_0x35d0('0x14')]);_0x3cd912[_0x35d0('0x13')]=qs[_0x35d0('0x13')](_0x12a065['query']['offset']);}_0x3cd912[_0x35d0('0x44')]=qs[_0x35d0('0x45')](_0x12a065['query'][_0x35d0('0x45')]);_0x3cd912[_0x35d0('0x46')]=qs[_0x35d0('0x47')](_[_0x35d0('0x48')](_0x12a065[_0x35d0('0x2e')],_0x5a5b04[_0x35d0('0x47')]));_0x3cd912[_0x35d0('0x46')][_0x35d0('0x49')]=_0x397178['id'];if(_0x12a065[_0x35d0('0x2e')]['filter']){_0x3cd912[_0x35d0('0x46')]=_[_0x35d0('0x34')](_0x3cd912[_0x35d0('0x46')],{'$or':_[_0x35d0('0x21')](_0x3cd912[_0x35d0('0x31')],function(_0x38a837){var _0x5d5596={};_0x5d5596[_0x38a837]={'$like':'%'+_0x12a065[_0x35d0('0x2e')][_0x35d0('0x4a')]+'%'};return _0x5d5596;})});}_0x3cd912=_[_0x35d0('0x34')]({},_0x3cd912,_0x12a065['options']);return db[_0x35d0('0x4b')]['findAll'](_0x3cd912);}})[_0x35d0('0x1c')](function(_0x3608a3){if(_0x3608a3){return db[_0x35d0('0x4c')][_0x35d0('0x4d')]({'where':{'id':_[_0x35d0('0x21')](_0x3608a3,'UserId'),'role':_0x35d0('0x4e')},'attributes':['id',_0x35d0('0x1f'),_0x35d0('0x4f'),'updatedAt','createdAt']});}})[_0x35d0('0x1c')](function(_0xba07c8){if(_0xba07c8){return{'count':_0xba07c8['count'],'rows':_[_0x35d0('0x21')](_0xba07c8[_0x35d0('0x29')],function(_0x3f3e87){return{'membername':_0x3f3e87[_0x35d0('0x1f')],'UserId':_0x3f3e87['id'],'queue_name':_0x34c524[_0x35d0('0x1f')],'WhatsappQueueId':_0x34c524['id'],'interface':util[_0x35d0('0x50')](_0x35d0('0x51'),_0x35d0('0x52'),_0x3f3e87[_0x35d0('0x1f')]),'penalty':0x0,'paused':_0x3f3e87[_0x35d0('0x4f')],'createdAt':_0x3f3e87['createdAt'],'updatedAt':_0x3f3e87[_0x35d0('0x53')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x35d0('0x1c')](respondWithFilteredResult(_0x3507ae,_0x3cd912))['catch'](handleError(_0x3507ae,null));};exports['getTeams']=function(_0x4d62f9,_0x1f3483){var _0x408159={};var _0x4995c4={};var _0x325871;var _0x10886e;return db[_0x35d0('0x22')][_0x35d0('0x41')]({'where':{'id':_0x4d62f9['params']['id']}})['then'](handleEntityNotFound(_0x1f3483,null))['then'](function(_0x3ca7c){if(_0x3ca7c){_0x325871=_0x3ca7c;_0x4995c4[_0x35d0('0x2c')]=_[_0x35d0('0x42')](db[_0x35d0('0x54')][_0x35d0('0x2d')]);_0x4995c4[_0x35d0('0x2e')]=_[_0x35d0('0x42')](_0x4d62f9[_0x35d0('0x2e')]);_0x4995c4[_0x35d0('0x47')]=_[_0x35d0('0x2f')](_0x4995c4[_0x35d0('0x2c')],_0x4995c4[_0x35d0('0x2e')]);_0x408159['attributes']=_[_0x35d0('0x2f')](_0x4995c4[_0x35d0('0x2c')],qs[_0x35d0('0x30')](_0x4d62f9['query'][_0x35d0('0x30')]));_0x408159['attributes']=_0x408159['attributes'][_0x35d0('0x32')]?_0x408159['attributes']:_0x4995c4['model'];_0x408159[_0x35d0('0x44')]=qs['sort'](_0x4d62f9['query']['sort']);_0x408159[_0x35d0('0x46')]=qs[_0x35d0('0x47')](_[_0x35d0('0x48')](_0x4d62f9[_0x35d0('0x2e')],_0x4995c4[_0x35d0('0x47')]));if(_0x4d62f9[_0x35d0('0x2e')][_0x35d0('0x4a')]){_0x408159[_0x35d0('0x46')]=_['merge'](_0x408159[_0x35d0('0x46')],{'$or':_[_0x35d0('0x21')](_0x408159['attributes'],function(_0x2f2064){var _0x2a5e28={};_0x2a5e28[_0x2f2064]={'$like':'%'+_0x4d62f9[_0x35d0('0x2e')][_0x35d0('0x4a')]+'%'};return _0x2a5e28;})});}_0x408159=_[_0x35d0('0x34')]({},_0x408159,_0x4d62f9[_0x35d0('0x35')]);return _0x325871[_0x35d0('0x55')](_0x408159);}})[_0x35d0('0x1c')](function(_0x2f5c7b){if(_0x2f5c7b){_0x10886e=_0x2f5c7b[_0x35d0('0x32')];if(!_0x4d62f9[_0x35d0('0x2e')][_0x35d0('0x43')](_0x35d0('0x56'))){_0x408159[_0x35d0('0x14')]=qs[_0x35d0('0x14')](_0x4d62f9[_0x35d0('0x2e')]['limit']);_0x408159[_0x35d0('0x13')]=qs[_0x35d0('0x13')](_0x4d62f9[_0x35d0('0x2e')]['offset']);}return _0x325871[_0x35d0('0x55')](_0x408159);}})[_0x35d0('0x1c')](function(_0x13ed99){if(_0x13ed99){return _0x13ed99?{'count':_0x10886e,'rows':_0x13ed99}:null;}})[_0x35d0('0x1c')](respondWithResult(_0x1f3483,null))[_0x35d0('0x2a')](handleError(_0x1f3483,null));};exports[_0x35d0('0x57')]=function(_0x3c7669,_0xb0ec4a){var _0x11c1c0=_0x3c7669[_0x35d0('0x38')][_0x35d0('0x58')];return db[_0x35d0('0x54')][_0x35d0('0x28')]({'where':{'id':_0x11c1c0},'attributes':['id'],'include':[{'model':db['User'],'as':_0x35d0('0x59'),'attributes':['id',_0x35d0('0x1f'),_0x35d0('0x5a'),'voicePause','interface'],'raw':!![]}]})[_0x35d0('0x1c')](function(_0x7bafd0){if(_0x7bafd0){var _0x4273b0=_[_0x35d0('0x5b')](_0x7bafd0,function(_0x255f6b){var _0x46bb8d=_0x255f6b[_0x35d0('0x19')]({'plain':!![]});return _0x46bb8d[_0x35d0('0x59')];});return db[_0x35d0('0x22')]['find']({'where':{'id':_0x3c7669['params']['id']}})['then'](function(_0x2adfcf){return db['sequelize'][_0x35d0('0x5c')](function(_0x1740d0){return _0x2adfcf[_0x35d0('0x57')](_0x11c1c0,{'transaction':_0x1740d0})['then'](function(){return BPromise[_0x35d0('0x5d')](_0x4273b0,function(_0x1379ea){return db[_0x35d0('0x4b')][_0x35d0('0x5e')]({'where':{'UserId':_0x1379ea['id'],'WhatsappQueueId':_0x3c7669[_0x35d0('0x2b')]['id']},'transaction':_0x1740d0});});})[_0x35d0('0x1c')](function(){_0x4273b0[_0x35d0('0x5f')](function(_0x27533a){socket[_0x35d0('0x60')](_0x35d0('0x61'),{'UserId':_0x27533a['id'],'WhatsappQueueId':_0x2adfcf['id']});});});});});}})[_0x35d0('0x1c')](respondWithStatusCode(_0xb0ec4a,null))[_0x35d0('0x2a')](handleError(_0xb0ec4a,null));};exports[_0x35d0('0x62')]=function(_0x4a2925,_0x1b38de){return db['Team'][_0x35d0('0x28')]({'where':{'id':_0x4a2925['query'][_0x35d0('0x58')]},'attributes':['id'],'include':[{'model':db[_0x35d0('0x4c')],'as':_0x35d0('0x59'),'attributes':['id'],'raw':!![]}]})[_0x35d0('0x1c')](handleEntityNotFound(_0x1b38de,null))[_0x35d0('0x1c')](function(_0x3bdc46){var _0x334da9=_[_0x35d0('0x21')](_0x3bdc46,'id');var _0x194e9b=[];var _0x3cf11e=[];var _0x3833a2=squel[_0x35d0('0x63')]();_0x3833a2[_0x35d0('0x64')](_0x35d0('0x65'))[_0x35d0('0x66')]('team_has_whatsapp_queues','tq')['join'](_0x35d0('0x67'),'ut',_0x35d0('0x68'))[_0x35d0('0x46')](_0x35d0('0x69'),_0x4a2925['params']['id']);for(var _0x3a13e4=0x0;_0x3a13e4<_0x3bdc46[_0x35d0('0x32')];_0x3a13e4+=0x1){let _0xae13db=_0x3bdc46[_0x3a13e4];for(var _0x109d8b=0x0;_0x109d8b<_0xae13db[_0x35d0('0x59')][_0x35d0('0x32')];_0x109d8b+=0x1){let _0x34c1d2=_0xae13db[_0x35d0('0x59')][_0x109d8b];var _0x343bf3=_0x3833a2[_0x35d0('0x6a')]();_0x343bf3[_0x35d0('0x46')](_0x35d0('0x6b'),_0x34c1d2['id']);_0x3cf11e[_0x35d0('0x6c')](db[_0x35d0('0x6d')][_0x35d0('0x2e')](_0x343bf3['toString'](),{'type':db[_0x35d0('0x6d')][_0x35d0('0x6e')][_0x35d0('0x6f')]})['then'](function(_0x3f1d60){if(_0x3f1d60['length']===0x1){return _0x34c1d2['id'];}else{var _0x5ba464=_[_0x35d0('0x70')](_[_0x35d0('0x21')](_0x3f1d60,_0x35d0('0x71')),function(_0x2268c2){return _[_0x35d0('0x72')](_0x334da9,_0x2268c2);});if(_0x5ba464){return _0x34c1d2['id'];}}}));}}return BPromise[_0x35d0('0x73')](_0x3cf11e)['then'](function(_0x58c09c){_0x194e9b=_(_0x194e9b)[_0x35d0('0x74')](_0x58c09c)[_0x35d0('0x75')]()[_0x35d0('0x76')]();return db['WhatsappQueue']['find']({'where':{'id':_0x4a2925[_0x35d0('0x2b')]['id']}})[_0x35d0('0x1c')](function(_0x5b11b4){return db[_0x35d0('0x6d')]['transaction'](function(_0x4320ff){return _0x5b11b4[_0x35d0('0x62')](_0x4a2925[_0x35d0('0x2e')][_0x35d0('0x58')],{'transaction':_0x4320ff})[_0x35d0('0x1c')](function(){if(!_[_0x35d0('0x77')](_0x194e9b)){return _0x5b11b4[_0x35d0('0x78')](_0x194e9b,{'transaction':_0x4320ff});}})[_0x35d0('0x1c')](function(){_0x194e9b[_0x35d0('0x5f')](function(_0x446b22){socket[_0x35d0('0x60')]('userWhatsappQueue:remove',{'UserId':_0x446b22,'WhatsappQueueId':_0x5b11b4['id']});});});});});});})[_0x35d0('0x1c')](respondWithStatusCode(_0x1b38de,null))['catch'](handleError(_0x1b38de,null));};exports[_0x35d0('0x79')]=function(_0x2f9dec,_0x2ec0ab){return db[_0x35d0('0x22')][_0x35d0('0x36')]({'where':{'id':_0x2f9dec['params']['id']}})[_0x35d0('0x1c')](handleEntityNotFound(_0x2ec0ab,null))[_0x35d0('0x1c')](function(_0x4711bd){if(_0x4711bd){return _0x4711bd[_0x35d0('0x79')](_0x2f9dec['body']['ids'],_[_0x35d0('0x7a')](_0x2f9dec[_0x35d0('0x38')],['ids','id'])||{})[_0x35d0('0x7b')](function(_0x33dc8c){for(var _0x2f756d=0x0;_0x2f756d<_0x2f9dec[_0x35d0('0x38')][_0x35d0('0x58')][_0x35d0('0x32')];_0x2f756d+=0x1){socket[_0x35d0('0x60')](_0x35d0('0x61'),{'UserId':Number(_0x2f9dec['body'][_0x35d0('0x58')][_0x2f756d]),'WhatsappQueueId':Number(_0x2f9dec[_0x35d0('0x2b')]['id'])});}return _0x33dc8c;});}})[_0x35d0('0x1c')](respondWithResult(_0x2ec0ab,null))[_0x35d0('0x2a')](handleError(_0x2ec0ab,null));};exports['removeAgents']=function(_0x429ff2,_0x184dd3){return db[_0x35d0('0x22')][_0x35d0('0x36')]({'where':{'id':_0x429ff2['params']['id']}})[_0x35d0('0x1c')](handleEntityNotFound(_0x184dd3,null))['then'](function(_0x26eac2){if(_0x26eac2){return _0x26eac2['removeAgents'](_0x429ff2[_0x35d0('0x2e')]['ids'])[_0x35d0('0x1c')](function(){if(_[_0x35d0('0x7c')](_0x429ff2[_0x35d0('0x2e')][_0x35d0('0x58')])){for(var _0x48e839=0x0;_0x48e839<_0x429ff2[_0x35d0('0x2e')]['ids'][_0x35d0('0x32')];_0x48e839+=0x1){socket[_0x35d0('0x60')]('userWhatsappQueue:remove',{'UserId':Number(_0x429ff2['query'][_0x35d0('0x58')][_0x48e839]),'WhatsappQueueId':Number(_0x429ff2['params']['id'])});}}else{socket['emit'](_0x35d0('0x7d'),{'UserId':Number(_0x429ff2[_0x35d0('0x2e')][_0x35d0('0x58')]),'WhatsappQueueId':Number(_0x429ff2['params']['id'])});}});}})[_0x35d0('0x1c')](respondWithStatusCode(_0x184dd3,null))['catch'](handleError(_0x184dd3,null));};exports[_0x35d0('0x7e')]=function(_0x5c9415,_0x2fb4ae){var _0x45d795={};var _0x3d09c2={};var _0x30cfb8;var _0x43c1e9;return db[_0x35d0('0x22')][_0x35d0('0x41')]({'where':{'id':_0x5c9415['params']['id']}})['then'](handleEntityNotFound(_0x2fb4ae,null))[_0x35d0('0x1c')](function(_0x32c857){if(_0x32c857){_0x30cfb8=_0x32c857;_0x3d09c2['model']=_[_0x35d0('0x42')](db['User'][_0x35d0('0x2d')]);_0x3d09c2[_0x35d0('0x2e')]=_[_0x35d0('0x42')](_0x5c9415[_0x35d0('0x2e')]);_0x3d09c2[_0x35d0('0x47')]=_[_0x35d0('0x2f')](_0x3d09c2['model'],_0x3d09c2['query']);_0x45d795['attributes']=_[_0x35d0('0x2f')](_0x3d09c2[_0x35d0('0x2c')],qs[_0x35d0('0x30')](_0x5c9415[_0x35d0('0x2e')][_0x35d0('0x30')]));_0x45d795['attributes']=_0x45d795[_0x35d0('0x31')][_0x35d0('0x32')]?_0x45d795[_0x35d0('0x31')]:_0x3d09c2[_0x35d0('0x2c')];_0x45d795[_0x35d0('0x44')]=qs['sort'](_0x5c9415[_0x35d0('0x2e')][_0x35d0('0x45')]);_0x45d795[_0x35d0('0x46')]=qs[_0x35d0('0x47')](_['pick'](_0x5c9415[_0x35d0('0x2e')],_0x3d09c2[_0x35d0('0x47')]));if(_0x5c9415[_0x35d0('0x2e')][_0x35d0('0x4a')]){_0x45d795['where']=_[_0x35d0('0x34')](_0x45d795[_0x35d0('0x46')],{'$or':_[_0x35d0('0x21')](_0x45d795[_0x35d0('0x31')],function(_0x5b511e){var _0x20f7de={};_0x20f7de[_0x5b511e]={'$like':'%'+_0x5c9415[_0x35d0('0x2e')][_0x35d0('0x4a')]+'%'};return _0x20f7de;})});}_0x45d795=_[_0x35d0('0x34')]({},_0x45d795,_0x5c9415[_0x35d0('0x35')]);return _0x30cfb8['getAgents'](_0x45d795);}})[_0x35d0('0x1c')](function(_0x53b39e){if(_0x53b39e){_0x43c1e9=_0x53b39e[_0x35d0('0x32')];if(!_0x5c9415['query'][_0x35d0('0x43')](_0x35d0('0x56'))){_0x45d795['limit']=qs['limit'](_0x5c9415[_0x35d0('0x2e')][_0x35d0('0x14')]);_0x45d795['offset']=qs[_0x35d0('0x13')](_0x5c9415[_0x35d0('0x2e')][_0x35d0('0x13')]);}return _0x30cfb8[_0x35d0('0x7e')](_0x45d795);}})[_0x35d0('0x1c')](function(_0x41e861){if(_0x41e861){return _0x41e861?{'count':_0x43c1e9,'rows':_0x41e861}:null;}})[_0x35d0('0x1c')](respondWithResult(_0x2fb4ae,null))[_0x35d0('0x2a')](handleError(_0x2fb4ae,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index fb11b69..ecf754a 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 _0x497f=['events','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x497f,0xf3));var _0xf497=function(_0x456bd2,_0x156c79){_0x456bd2=_0x456bd2-0x0;var _0x2218c1=_0x497f[_0x456bd2];return _0x2218c1;};'use strict';var EventEmitter=require(_0xf497('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xf497('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf497('0x2')](0x0);var events={'afterCreate':_0xf497('0x3'),'afterUpdate':_0xf497('0x4'),'afterDestroy':_0xf497('0x5')};function emitEvent(_0x89a19d){return function(_0x431f34,_0x4400cb,_0x19576c){WhatsappQueueEvents[_0xf497('0x6')](_0x89a19d+':'+_0x431f34['id'],_0x431f34);WhatsappQueueEvents[_0xf497('0x6')](_0x89a19d,_0x431f34);_0x19576c(null);};}for(var e in events){if(events[_0xf497('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xf497('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x1e09=['emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','remove'];(function(_0xbfd2aa,_0x331747){var _0x8e52ce=function(_0x517036){while(--_0x517036){_0xbfd2aa['push'](_0xbfd2aa['shift']());}};_0x8e52ce(++_0x331747);}(_0x1e09,0xf6));var _0x91e0=function(_0x2b7d82,_0x4aeead){_0x2b7d82=_0x2b7d82-0x0;var _0x244dc6=_0x1e09[_0x2b7d82];return _0x244dc6;};'use strict';var EventEmitter=require(_0x91e0('0x0'));var WhatsappQueue=require(_0x91e0('0x1'))['db'][_0x91e0('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x91e0('0x3')](0x0);var events={'afterCreate':_0x91e0('0x4'),'afterUpdate':'update','afterDestroy':_0x91e0('0x5')};function emitEvent(_0x5635fc){return function(_0x47bd2d,_0x1993cb,_0x58277b){WhatsappQueueEvents[_0x91e0('0x6')](_0x5635fc+':'+_0x47bd2d['id'],_0x47bd2d);WhatsappQueueEvents[_0x91e0('0x6')](_0x5635fc,_0x47bd2d);_0x58277b(null);};}for(var e in events){if(events[_0x91e0('0x7')](e)){var event=events[e];WhatsappQueue[_0x91e0('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 5d29060..70c8d90 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 _0x3ac1=['path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x3ac1,0x1e7));var _0x13ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ac1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x13ac('0x0'));var logger=require(_0x13ac('0x1'))(_0x13ac('0x2'));var moment=require(_0x13ac('0x3'));var BPromise=require(_0x13ac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13ac('0x5'));var rimraf=require(_0x13ac('0x6'));var config=require(_0x13ac('0x7'));var attributes=require(_0x13ac('0x8'));module[_0x13ac('0x9')]=function(_0x509875,_0x3d1c05){return _0x509875['define'](_0x13ac('0xa'),attributes,{'tableName':_0x13ac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd576=['../../config/logger','bluebird','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','util'];(function(_0x1a04e8,_0x35ef29){var _0x5120bc=function(_0x11729b){while(--_0x11729b){_0x1a04e8['push'](_0x1a04e8['shift']());}};_0x5120bc(++_0x35ef29);}(_0xd576,0x116));var _0x6d57=function(_0x5eac0f,_0x370a5f){_0x5eac0f=_0x5eac0f-0x0;var _0x598afa=_0xd576[_0x5eac0f];return _0x598afa;};'use strict';var _=require('lodash');var util=require(_0x6d57('0x0'));var logger=require(_0x6d57('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6d57('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d57('0x3'));var config=require(_0x6d57('0x4'));var attributes=require(_0x6d57('0x5'));module[_0x6d57('0x6')]=function(_0x3baa60,_0x45a052){return _0x3baa60['define'](_0x6d57('0x7'),attributes,{'tableName':_0x6d57('0x8'),'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 b656638..f15e51e 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 _0x73bb=['options','where','attributes','limit','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','WhatsappQueue'];(function(_0x4f9178,_0x387005){var _0x59eeee=function(_0x3f4321){while(--_0x3f4321){_0x4f9178['push'](_0x4f9178['shift']());}};_0x59eeee(++_0x387005);}(_0x73bb,0xa6));var _0xb73b=function(_0x1dd82f,_0x52acb7){_0x1dd82f=_0x1dd82f-0x0;var _0x353ca4=_0x73bb[_0x1dd82f];return _0x353ca4;};'use strict';var _=require(_0xb73b('0x0'));var util=require(_0xb73b('0x1'));var moment=require(_0xb73b('0x2'));var BPromise=require(_0xb73b('0x3'));var rs=require(_0xb73b('0x4'));var fs=require('fs');var Redis=require(_0xb73b('0x5'));var db=require(_0xb73b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb73b('0x7'))(_0xb73b('0x8'));var config=require(_0xb73b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb73b('0xa')][_0xb73b('0xb')]({'port':0x232a});config[_0xb73b('0xc')]=_['defaults'](config[_0xb73b('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb73b('0xd'))[_0xb73b('0xe')](socket);function respondWithRpcPromise(_0x1370c6,_0x8af756,_0x440629){return new BPromise(function(_0x5a746a,_0xcedaa7){return client[_0xb73b('0xf')](_0x1370c6,_0x440629)[_0xb73b('0x10')](function(_0x435862){logger[_0xb73b('0x11')](_0xb73b('0x12'),_0x8af756,'request\x20sent');logger[_0xb73b('0x13')](_0xb73b('0x14'),_0x8af756,_0xb73b('0x15'),JSON[_0xb73b('0x16')](_0x435862));if(_0x435862[_0xb73b('0x17')]){if(_0x435862[_0xb73b('0x17')][_0xb73b('0x18')]===0x1f4){logger[_0xb73b('0x17')](_0xb73b('0x12'),_0x8af756,_0x435862[_0xb73b('0x17')][_0xb73b('0x19')]);return _0xcedaa7(_0x435862[_0xb73b('0x17')][_0xb73b('0x19')]);}logger[_0xb73b('0x17')](_0xb73b('0x12'),_0x8af756,_0x435862['error'][_0xb73b('0x19')]);return _0x5a746a(_0x435862[_0xb73b('0x17')][_0xb73b('0x19')]);}else{logger[_0xb73b('0x11')](_0xb73b('0x12'),_0x8af756,_0xb73b('0x15'));_0x5a746a(_0x435862[_0xb73b('0x1a')][_0xb73b('0x19')]);}})[_0xb73b('0x1b')](function(_0x256c15){logger[_0xb73b('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x8af756,_0x256c15);_0xcedaa7(_0x256c15);});});}exports['GetWhatsappQueue']=function(_0x30968e){var _0x256b35=this;return new Promise(function(_0x1774b3,_0x2b567b){return db[_0xb73b('0x1c')]['findAll']({'raw':_0x30968e['options']?_0x30968e[_0xb73b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x30968e['options']?_0x30968e['options'][_0xb73b('0x1e')]||null:null,'attributes':_0x30968e[_0xb73b('0x1d')]?_0x30968e[_0xb73b('0x1d')][_0xb73b('0x1f')]||null:null,'limit':_0x30968e[_0xb73b('0x1d')]?_0x30968e[_0xb73b('0x1d')][_0xb73b('0x20')]||null:null,'include':_0x30968e[_0xb73b('0x1d')]?_0x30968e[_0xb73b('0x1d')][_0xb73b('0x21')]?_[_0xb73b('0x22')](_0x30968e[_0xb73b('0x1d')][_0xb73b('0x21')],function(_0x3ea142){return{'model':db[_0x3ea142[_0xb73b('0x23')]],'as':_0x3ea142['as'],'attributes':_0x3ea142[_0xb73b('0x1f')],'include':_0x3ea142[_0xb73b('0x21')]?_[_0xb73b('0x22')](_0x3ea142[_0xb73b('0x21')],function(_0x244e45){return{'model':db[_0x244e45[_0xb73b('0x23')]],'as':_0x244e45['as'],'attributes':_0x244e45[_0xb73b('0x1f')],'include':_0x244e45[_0xb73b('0x21')]?_[_0xb73b('0x22')](_0x244e45[_0xb73b('0x21')],function(_0x124e68){return{'model':db[_0x124e68['model']],'as':_0x124e68['as'],'attributes':_0x124e68[_0xb73b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb73b('0x10')](function(_0xcdc14e){logger[_0xb73b('0x11')](_0xb73b('0x24'),_0x30968e);logger[_0xb73b('0x13')](_0xb73b('0x24'),_0x30968e,JSON[_0xb73b('0x16')](_0xcdc14e));_0x1774b3(_0xcdc14e);})[_0xb73b('0x1b')](function(_0x37daae){logger['error'](_0xb73b('0x24'),_0x37daae['message'],_0x30968e);_0x2b567b(_0x256b35[_0xb73b('0x17')](0x1f4,_0x37daae[_0xb73b('0x19')]));});});};exports[_0xb73b('0x25')]=function(_0x5bbfb9){var _0x745cb0=this;return new Promise(function(_0x210a65,_0x4e8fce){return db[_0xb73b('0x1c')][_0xb73b('0x26')]({'raw':_0x5bbfb9['options']?_0x5bbfb9[_0xb73b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5bbfb9[_0xb73b('0x1d')]?_0x5bbfb9[_0xb73b('0x1d')][_0xb73b('0x1e')]||null:null,'attributes':_0x5bbfb9[_0xb73b('0x1d')]?_0x5bbfb9[_0xb73b('0x1d')][_0xb73b('0x1f')]||null:null,'include':_0x5bbfb9[_0xb73b('0x1d')]?_0x5bbfb9['options'][_0xb73b('0x21')]?_['map'](_0x5bbfb9[_0xb73b('0x1d')][_0xb73b('0x21')],function(_0x45d6da){return{'model':db[_0x45d6da['model']],'as':_0x45d6da['as'],'attributes':_0x45d6da[_0xb73b('0x1f')],'include':_0x45d6da[_0xb73b('0x21')]?_['map'](_0x45d6da[_0xb73b('0x21')],function(_0x344094){return{'model':db[_0x344094[_0xb73b('0x23')]],'as':_0x344094['as'],'attributes':_0x344094[_0xb73b('0x1f')],'include':_0x344094[_0xb73b('0x21')]?_[_0xb73b('0x22')](_0x344094[_0xb73b('0x21')],function(_0x35bdb0){return{'model':db[_0x35bdb0[_0xb73b('0x23')]],'as':_0x35bdb0['as'],'attributes':_0x35bdb0[_0xb73b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24dd38){logger['info']('ShowWhatsappQueue',_0x5bbfb9);logger[_0xb73b('0x13')](_0xb73b('0x25'),_0x5bbfb9,JSON[_0xb73b('0x16')](_0x24dd38));_0x210a65(_0x24dd38);})[_0xb73b('0x1b')](function(_0x1d607a){logger[_0xb73b('0x17')](_0xb73b('0x25'),_0x1d607a[_0xb73b('0x19')],_0x5bbfb9);_0x4e8fce(_0x745cb0['error'](0x1f4,_0x1d607a[_0xb73b('0x19')]));});});}; \ No newline at end of file +var _0x9be9=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappQueue,\x20%s,\x20%s','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','include','model','map','ShowWhatsappQueue','find','where','lodash'];(function(_0x349b5c,_0x55e5fa){var _0x3efcac=function(_0x27832d){while(--_0x27832d){_0x349b5c['push'](_0x349b5c['shift']());}};_0x3efcac(++_0x55e5fa);}(_0x9be9,0x7a));var _0x99be=function(_0x407463,_0x3bc5cb){_0x407463=_0x407463-0x0;var _0x40921a=_0x9be9[_0x407463];return _0x40921a;};'use strict';var _=require(_0x99be('0x0'));var util=require(_0x99be('0x1'));var moment=require(_0x99be('0x2'));var BPromise=require(_0x99be('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99be('0x4'));var db=require(_0x99be('0x5'))['db'];var utils=require(_0x99be('0x6'));var logger=require(_0x99be('0x7'))(_0x99be('0x8'));var config=require(_0x99be('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x99be('0xa')]({'port':0x232a});config[_0x99be('0xb')]=_[_0x99be('0xc')](config[_0x99be('0xb')],{'host':_0x99be('0xd'),'port':0x18eb});var socket=require(_0x99be('0xe'))(new Redis(config[_0x99be('0xb')]));require(_0x99be('0xf'))[_0x99be('0x10')](socket);function respondWithRpcPromise(_0x491dcf,_0x9bf818,_0x24a613){return new BPromise(function(_0x5efd7d,_0x8451a9){return client[_0x99be('0x11')](_0x491dcf,_0x24a613)[_0x99be('0x12')](function(_0xc466f8){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x9bf818,_0x99be('0x13'));logger[_0x99be('0x14')](_0x99be('0x15'),_0x9bf818,_0x99be('0x13'),JSON[_0x99be('0x16')](_0xc466f8));if(_0xc466f8[_0x99be('0x17')]){if(_0xc466f8['error']['code']===0x1f4){logger[_0x99be('0x17')](_0x99be('0x18'),_0x9bf818,_0xc466f8['error'][_0x99be('0x19')]);return _0x8451a9(_0xc466f8[_0x99be('0x17')][_0x99be('0x19')]);}logger[_0x99be('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x9bf818,_0xc466f8['error'][_0x99be('0x19')]);return _0x5efd7d(_0xc466f8[_0x99be('0x17')]['message']);}else{logger[_0x99be('0x1a')](_0x99be('0x18'),_0x9bf818,'request\x20sent');_0x5efd7d(_0xc466f8[_0x99be('0x1b')][_0x99be('0x19')]);}})[_0x99be('0x1c')](function(_0x495250){logger[_0x99be('0x17')](_0x99be('0x18'),_0x9bf818,_0x495250);_0x8451a9(_0x495250);});});}exports[_0x99be('0x1d')]=function(_0x1de52a){var _0x219af9=this;return new Promise(function(_0x4ac0c7,_0x15ac05){return db[_0x99be('0x1e')][_0x99be('0x1f')]({'raw':_0x1de52a[_0x99be('0x20')]?_0x1de52a['options'][_0x99be('0x21')]===undefined?!![]:![]:!![],'where':_0x1de52a[_0x99be('0x20')]?_0x1de52a['options']['where']||null:null,'attributes':_0x1de52a[_0x99be('0x20')]?_0x1de52a['options'][_0x99be('0x22')]||null:null,'limit':_0x1de52a['options']?_0x1de52a['options']['limit']||null:null,'include':_0x1de52a[_0x99be('0x20')]?_0x1de52a[_0x99be('0x20')][_0x99be('0x23')]?_['map'](_0x1de52a['options']['include'],function(_0x50b0ee){return{'model':db[_0x50b0ee[_0x99be('0x24')]],'as':_0x50b0ee['as'],'attributes':_0x50b0ee['attributes'],'include':_0x50b0ee[_0x99be('0x23')]?_[_0x99be('0x25')](_0x50b0ee[_0x99be('0x23')],function(_0x3311e5){return{'model':db[_0x3311e5[_0x99be('0x24')]],'as':_0x3311e5['as'],'attributes':_0x3311e5['attributes'],'include':_0x3311e5[_0x99be('0x23')]?_['map'](_0x3311e5[_0x99be('0x23')],function(_0x1a7769){return{'model':db[_0x1a7769[_0x99be('0x24')]],'as':_0x1a7769['as'],'attributes':_0x1a7769[_0x99be('0x22')]};}):[]};}):[]};}):[]:[]})[_0x99be('0x12')](function(_0x1b264d){logger['info'](_0x99be('0x1d'),_0x1de52a);logger['debug'](_0x99be('0x1d'),_0x1de52a,JSON['stringify'](_0x1b264d));_0x4ac0c7(_0x1b264d);})[_0x99be('0x1c')](function(_0x47947e){logger[_0x99be('0x17')](_0x99be('0x1d'),_0x47947e[_0x99be('0x19')],_0x1de52a);_0x15ac05(_0x219af9[_0x99be('0x17')](0x1f4,_0x47947e[_0x99be('0x19')]));});});};exports[_0x99be('0x26')]=function(_0x107f55){var _0x227789=this;return new Promise(function(_0x264aff,_0xc36e0f){return db['WhatsappQueue'][_0x99be('0x27')]({'raw':_0x107f55[_0x99be('0x20')]?_0x107f55['options'][_0x99be('0x21')]===undefined?!![]:![]:!![],'where':_0x107f55[_0x99be('0x20')]?_0x107f55['options'][_0x99be('0x28')]||null:null,'attributes':_0x107f55[_0x99be('0x20')]?_0x107f55[_0x99be('0x20')][_0x99be('0x22')]||null:null,'include':_0x107f55[_0x99be('0x20')]?_0x107f55[_0x99be('0x20')][_0x99be('0x23')]?_[_0x99be('0x25')](_0x107f55[_0x99be('0x20')][_0x99be('0x23')],function(_0x759459){return{'model':db[_0x759459[_0x99be('0x24')]],'as':_0x759459['as'],'attributes':_0x759459[_0x99be('0x22')],'include':_0x759459['include']?_['map'](_0x759459[_0x99be('0x23')],function(_0x5913ad){return{'model':db[_0x5913ad[_0x99be('0x24')]],'as':_0x5913ad['as'],'attributes':_0x5913ad['attributes'],'include':_0x5913ad[_0x99be('0x23')]?_[_0x99be('0x25')](_0x5913ad[_0x99be('0x23')],function(_0x515965){return{'model':db[_0x515965['model']],'as':_0x515965['as'],'attributes':_0x515965[_0x99be('0x22')]};}):[]};}):[]};}):[]:[]})[_0x99be('0x12')](function(_0x39cd3f){logger['info'](_0x99be('0x26'),_0x107f55);logger['debug'](_0x99be('0x26'),_0x107f55,JSON[_0x99be('0x16')](_0x39cd3f));_0x264aff(_0x39cd3f);})['catch'](function(_0x5d7616){logger[_0x99be('0x17')](_0x99be('0x26'),_0x5d7616[_0x99be('0x19')],_0x107f55);_0xc36e0f(_0x227789[_0x99be('0x17')](0x1f4,_0x5d7616[_0x99be('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index a02ed74..b12b092 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 _0x0584=['removeListener','length','whatsappQueue:','./whatsappQueue.events','save','remove','emit'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0584,0xab));var _0x4058=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x0584[_0x484e36];return _0xafc85d;};'use strict';var WhatsappQueueEvents=require(_0x4058('0x0'));var events=[_0x4058('0x1'),_0x4058('0x2'),'update'];function createListener(_0x15e200,_0x4f940e){return function(_0xb62fac){_0x4f940e[_0x4058('0x3')](_0x15e200,_0xb62fac);};}function removeListener(_0x5aab88,_0x69c25c){return function(){WhatsappQueueEvents[_0x4058('0x4')](_0x5aab88,_0x69c25c);};}exports['register']=function(_0x26602c){for(var _0x753de6=0x0,_0x5d8dcf=events[_0x4058('0x5')];_0x753de6<_0x5d8dcf;_0x753de6++){var _0x2ef4bc=events[_0x753de6];var _0x581e91=createListener(_0x4058('0x6')+_0x2ef4bc,_0x26602c);WhatsappQueueEvents['on'](_0x2ef4bc,_0x581e91);}}; \ No newline at end of file +var _0x4a4e=['length','remove','update','emit','removeListener','register'];(function(_0x2916ee,_0x4c2238){var _0x5b7e8f=function(_0x1b316e){while(--_0x1b316e){_0x2916ee['push'](_0x2916ee['shift']());}};_0x5b7e8f(++_0x4c2238);}(_0x4a4e,0x7f));var _0xe4a4=function(_0x2fe689,_0x5794e5){_0x2fe689=_0x2fe689-0x0;var _0x35ea44=_0x4a4e[_0x2fe689];return _0x35ea44;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0xe4a4('0x0'),_0xe4a4('0x1')];function createListener(_0x590941,_0x28370f){return function(_0x2cda20){_0x28370f[_0xe4a4('0x2')](_0x590941,_0x2cda20);};}function removeListener(_0x1da13e,_0x173f98){return function(){WhatsappQueueEvents[_0xe4a4('0x3')](_0x1da13e,_0x173f98);};}exports[_0xe4a4('0x4')]=function(_0x21e92b){for(var _0x22213e=0x0,_0x5cec86=events[_0xe4a4('0x5')];_0x22213e<_0x5cec86;_0x22213e++){var _0x5e760a=events[_0x22213e];var _0x4797fa=createListener('whatsappQueue:'+_0x5e760a,_0x21e92b);WhatsappQueueEvents['on'](_0x5e760a,_0x4797fa);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 677a763..f8dd4e0 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 _0xb8cd=['post','create','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x1e5871,_0x2fb6b4){var _0xf51f32=function(_0x1719d3){while(--_0x1719d3){_0x1e5871['push'](_0x1e5871['shift']());}};_0xf51f32(++_0x2fb6b4);}(_0xb8cd,0x130));var _0xdb8c=function(_0x4d752d,_0x10f3fb){_0x4d752d=_0x4d752d-0x0;var _0x56773c=_0xb8cd[_0x4d752d];return _0x56773c;};'use strict';var multer=require(_0xdb8c('0x0'));var util=require(_0xdb8c('0x1'));var path=require('path');var timeout=require(_0xdb8c('0x2'));var express=require(_0xdb8c('0x3'));var router=express[_0xdb8c('0x4')]();var fs_extra=require(_0xdb8c('0x5'));var auth=require(_0xdb8c('0x6'));var interaction=require(_0xdb8c('0x7'));var config=require(_0xdb8c('0x8'));var controller=require(_0xdb8c('0x9'));router[_0xdb8c('0xa')]('/',auth[_0xdb8c('0xb')](),controller[_0xdb8c('0xc')]);router[_0xdb8c('0xa')](_0xdb8c('0xd'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xdb8c('0xe'),auth[_0xdb8c('0xb')](),controller[_0xdb8c('0xf')]);router[_0xdb8c('0x10')]('/',auth[_0xdb8c('0xb')](),controller[_0xdb8c('0x11')]);router['put']('/:id',auth[_0xdb8c('0xb')](),controller['update']);router[_0xdb8c('0x12')](_0xdb8c('0xe'),auth[_0xdb8c('0xb')](),controller[_0xdb8c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x66ef=['put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create'];(function(_0x458dd7,_0xe5602b){var _0x2a12f3=function(_0x547dee){while(--_0x547dee){_0x458dd7['push'](_0x458dd7['shift']());}};_0x2a12f3(++_0xe5602b);}(_0x66ef,0x145));var _0xf66e=function(_0x29735d,_0x5177f5){_0x29735d=_0x29735d-0x0;var _0x443b44=_0x66ef[_0x29735d];return _0x443b44;};'use strict';var multer=require(_0xf66e('0x0'));var util=require(_0xf66e('0x1'));var path=require(_0xf66e('0x2'));var timeout=require(_0xf66e('0x3'));var express=require(_0xf66e('0x4'));var router=express[_0xf66e('0x5')]();var fs_extra=require(_0xf66e('0x6'));var auth=require(_0xf66e('0x7'));var interaction=require(_0xf66e('0x8'));var config=require('../../config/environment');var controller=require(_0xf66e('0x9'));router[_0xf66e('0xa')]('/',auth[_0xf66e('0xb')](),controller['index']);router[_0xf66e('0xa')](_0xf66e('0xc'),auth[_0xf66e('0xb')](),controller[_0xf66e('0xd')]);router['get'](_0xf66e('0xe'),auth[_0xf66e('0xb')](),controller[_0xf66e('0xf')]);router['post']('/',auth[_0xf66e('0xb')](),controller[_0xf66e('0x10')]);router[_0xf66e('0x11')]('/:id',auth[_0xf66e('0xb')](),controller[_0xf66e('0x12')]);router['delete'](_0xf66e('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index d5fe4f4..c184df6 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(_0x46256e,_0x5a97e6){var _0x1bb72a=function(_0x4e5b9d){while(--_0x4e5b9d){_0x46256e['push'](_0x46256e['shift']());}};_0x1bb72a(++_0x5a97e6);}(_0x7a54,0x106));var _0x47a5=function(_0x2dc532,_0x722cd6){_0x2dc532=_0x2dc532-0x0;var _0x47cd0c=_0x7a54[_0x2dc532];return _0x47cd0c;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x2c27b0,_0x53a995){var _0x5b82bc=function(_0x26f719){while(--_0x26f719){_0x2c27b0['push'](_0x2c27b0['shift']());}};_0x5b82bc(++_0x53a995);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 4e683c1..a67a53c 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 _0x0713=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','params','keys','find','catch','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0xe4cec8,_0x38f597){var _0x5af255=function(_0x5cc6e1){while(--_0x5cc6e1){_0xe4cec8['push'](_0xe4cec8['shift']());}};_0x5af255(++_0x38f597);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={},_0x292205={},_0x254fc8={'count':0x0,'rows':[]};var _0x5aba96=_['map'](db[_0x3071('0x2d')][_0x3071('0x2e')],function(_0x6ddf96){return{'name':_0x6ddf96[_0x3071('0x2f')],'type':_0x6ddf96[_0x3071('0x30')][_0x3071('0x31')]};});_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x5aba96,'name');_0x292205['query']=_['keys'](_0x177b5f[_0x3071('0x34')]);_0x292205[_0x3071('0x35')]=_['intersection'](_0x292205[_0x3071('0x32')],_0x292205[_0x3071('0x34')]);_0x32f1b4[_0x3071('0x36')]=_[_0x3071('0x37')](_0x292205['model'],qs[_0x3071('0x38')](_0x177b5f[_0x3071('0x34')][_0x3071('0x38')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x39')]?_0x32f1b4[_0x3071('0x36')]:_0x292205[_0x3071('0x32')];if(!_0x177b5f['query'][_0x3071('0x3a')]('nolimit')){_0x32f1b4['limit']=qs[_0x3071('0x20')](_0x177b5f[_0x3071('0x34')]['limit']);_0x32f1b4[_0x3071('0x1e')]=qs[_0x3071('0x1e')](_0x177b5f[_0x3071('0x34')][_0x3071('0x1e')]);}_0x32f1b4[_0x3071('0x3b')]=qs[_0x3071('0x3c')](_0x177b5f['query'][_0x3071('0x3c')]);_0x32f1b4[_0x3071('0x3d')]=qs['filters'](_[_0x3071('0x3e')](_0x177b5f['query'],_0x292205[_0x3071('0x35')]),_0x5aba96);if(_0x177b5f[_0x3071('0x34')]['filter']){_0x32f1b4['where']=_[_0x3071('0x3f')](_0x32f1b4[_0x3071('0x3d')],{'$or':_[_0x3071('0x33')](_0x5aba96,function(_0x55afa6){if(_0x55afa6[_0x3071('0x30')]!=='VIRTUAL'){var _0x1ac90a={};_0x1ac90a[_0x55afa6['name']]={'$like':'%'+_0x177b5f[_0x3071('0x34')][_0x3071('0x40')]+'%'};return _0x1ac90a;}})});}_0x32f1b4=_[_0x3071('0x3f')]({},_0x32f1b4,_0x177b5f[_0x3071('0x41')]);var _0x30ab68={'where':_0x32f1b4['where']};return db['WhatsappQueueReport'][_0x3071('0x21')](_0x30ab68)[_0x3071('0x27')](function(_0x1455be){_0x254fc8[_0x3071('0x21')]=_0x1455be;if(_0x177b5f['query'][_0x3071('0x42')]){_0x32f1b4[_0x3071('0x43')]=[{'all':!![]}];}return db[_0x3071('0x2d')][_0x3071('0x44')](_0x32f1b4);})[_0x3071('0x27')](function(_0xb9a4b8){_0x254fc8['rows']=_0xb9a4b8;return _0x254fc8;})[_0x3071('0x27')](respondWithFilteredResult(_0x3921a1,_0x32f1b4))['catch'](handleError(_0x3921a1,null));};exports['show']=function(_0x4dc9d1,_0x47ceaf){var _0x2992e6={'raw':!![],'where':{'id':_0x4dc9d1[_0x3071('0x45')]['id']}},_0x1be8b6={};_0x1be8b6[_0x3071('0x32')]=_[_0x3071('0x46')](db[_0x3071('0x2d')][_0x3071('0x2e')]);_0x1be8b6[_0x3071('0x34')]=_['keys'](_0x4dc9d1[_0x3071('0x34')]);_0x1be8b6[_0x3071('0x35')]=_[_0x3071('0x37')](_0x1be8b6[_0x3071('0x32')],_0x1be8b6[_0x3071('0x34')]);_0x2992e6['attributes']=_['intersection'](_0x1be8b6[_0x3071('0x32')],qs[_0x3071('0x38')](_0x4dc9d1[_0x3071('0x34')][_0x3071('0x38')]));_0x2992e6[_0x3071('0x36')]=_0x2992e6['attributes'][_0x3071('0x39')]?_0x2992e6['attributes']:_0x1be8b6[_0x3071('0x32')];if(_0x4dc9d1['query']['includeAll']){_0x2992e6[_0x3071('0x43')]=[{'all':!![]}];}_0x2992e6=_['merge']({},_0x2992e6,_0x4dc9d1[_0x3071('0x41')]);return db['WhatsappQueueReport'][_0x3071('0x47')](_0x2992e6)[_0x3071('0x27')](handleEntityNotFound(_0x47ceaf,null))[_0x3071('0x27')](respondWithResult(_0x47ceaf,null))[_0x3071('0x48')](handleError(_0x47ceaf,null));};exports['create']=function(_0x2d70bf,_0x575c12){return db[_0x3071('0x2d')]['create'](_0x2d70bf[_0x3071('0x49')],{})[_0x3071('0x27')](respondWithResult(_0x575c12,0xc9))['catch'](handleError(_0x575c12,null));};exports[_0x3071('0x26')]=function(_0x117e73,_0x224a70){if(_0x117e73[_0x3071('0x49')]['id']){delete _0x117e73[_0x3071('0x49')]['id'];}return db[_0x3071('0x2d')][_0x3071('0x47')]({'where':{'id':_0x117e73['params']['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x224a70,null))[_0x3071('0x27')](saveUpdates(_0x117e73[_0x3071('0x49')],null))[_0x3071('0x27')](respondWithResult(_0x224a70,null))['catch'](handleError(_0x224a70,null));};exports[_0x3071('0x28')]=function(_0x2aea37,_0x1b832e){return db[_0x3071('0x2d')][_0x3071('0x47')]({'where':{'id':_0x2aea37[_0x3071('0x45')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x1b832e,null))[_0x3071('0x27')](removeEntity(_0x1b832e,null))[_0x3071('0x48')](handleError(_0x1b832e,null));};exports[_0x3071('0x4a')]=function(_0x4371e7,_0x111115){return db[_0x3071('0x2d')][_0x3071('0x4a')]()[_0x3071('0x27')](respondWithResult(_0x111115,null))[_0x3071('0x48')](handleError(_0x111115,null));}; \ No newline at end of file +var _0x5eb8=['rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','catch','show','params','keys','options','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','WhatsappQueueReport'];(function(_0x1081a3,_0x2ac784){var _0x5696a2=function(_0x23d2f6){while(--_0x23d2f6){_0x1081a3['push'](_0x1081a3['shift']());}};_0x5696a2(++_0x2ac784);}(_0x5eb8,0xb0));var _0x85eb=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0x5eb8[_0x258b93];return _0x35484b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];function respondWithStatusCode(_0x784583,_0x2f42ba){_0x2f42ba=_0x2f42ba||0xcc;return function(_0x259f72){if(_0x259f72){return _0x784583['sendStatus'](_0x2f42ba);}return _0x784583['status'](_0x2f42ba)[_0x85eb('0x19')]();};}function respondWithResult(_0x5c760a,_0x18ca53){_0x18ca53=_0x18ca53||0xc8;return function(_0x23a82a){if(_0x23a82a){return _0x5c760a[_0x85eb('0x1a')](_0x18ca53)[_0x85eb('0x1b')](_0x23a82a);}};}function respondWithFilteredResult(_0x183b0c,_0x49efdf){return function(_0x2e5c0a){if(_0x2e5c0a){var _0x59237b=typeof _0x49efdf[_0x85eb('0x1c')]===_0x85eb('0x1d')&&typeof _0x49efdf[_0x85eb('0x1e')]===_0x85eb('0x1d');var _0x5dbeda=_0x2e5c0a['count'];var _0x50d2a8=_0x59237b?0x0:_0x49efdf[_0x85eb('0x1c')];var _0x39ca96=_0x59237b?_0x2e5c0a[_0x85eb('0x1f')]:_0x49efdf[_0x85eb('0x1c')]+_0x49efdf[_0x85eb('0x1e')];var _0x34f875;if(_0x39ca96>=_0x5dbeda){_0x39ca96=_0x5dbeda;_0x34f875=0xc8;}else{_0x34f875=0xce;}_0x183b0c['status'](_0x34f875);return _0x183b0c[_0x85eb('0x20')](_0x85eb('0x21'),_0x50d2a8+'-'+_0x39ca96+'/'+_0x5dbeda)[_0x85eb('0x1b')](_0x2e5c0a);}return null;};}function patchUpdates(_0x4e8041){return function(_0x4b4b38){try{jsonpatch['apply'](_0x4b4b38,_0x4e8041,!![]);}catch(_0x55b9e4){return BPromise[_0x85eb('0x22')](_0x55b9e4);}return _0x4b4b38[_0x85eb('0x23')]();};}function saveUpdates(_0x329fc5,_0x255ca7){return function(_0x465c74){if(_0x465c74){return _0x465c74[_0x85eb('0x24')](_0x329fc5)['then'](function(_0x5491d5){return _0x5491d5;});}return null;};}function removeEntity(_0x5b48d9,_0x298e84){return function(_0x1426c8){if(_0x1426c8){return _0x1426c8[_0x85eb('0x25')]()[_0x85eb('0x26')](function(){_0x5b48d9[_0x85eb('0x1a')](0xcc)[_0x85eb('0x19')]();});}};}function handleEntityNotFound(_0x5dfc96,_0x39d3fe){return function(_0x3453cd){if(!_0x3453cd){_0x5dfc96[_0x85eb('0x27')](0x194);}return _0x3453cd;};}function handleError(_0x30e766,_0x3e2326){_0x3e2326=_0x3e2326||0x1f4;return function(_0x57a03c){logger[_0x85eb('0x28')](_0x57a03c[_0x85eb('0x29')]);if(_0x57a03c[_0x85eb('0x2a')]){delete _0x57a03c[_0x85eb('0x2a')];}_0x30e766[_0x85eb('0x1a')](_0x3e2326)[_0x85eb('0x2b')](_0x57a03c);};}exports['index']=function(_0x562792,_0x37515c){var _0x585f2a={},_0xa9b14f={},_0x5255eb={'count':0x0,'rows':[]};var _0x4229e9=_[_0x85eb('0x2c')](db[_0x85eb('0x2d')][_0x85eb('0x2e')],function(_0xa67e1c){return{'name':_0xa67e1c[_0x85eb('0x2f')],'type':_0xa67e1c[_0x85eb('0x30')]['key']};});_0xa9b14f[_0x85eb('0x31')]=_[_0x85eb('0x2c')](_0x4229e9,'name');_0xa9b14f[_0x85eb('0x32')]=_['keys'](_0x562792['query']);_0xa9b14f[_0x85eb('0x33')]=_[_0x85eb('0x34')](_0xa9b14f[_0x85eb('0x31')],_0xa9b14f[_0x85eb('0x32')]);_0x585f2a[_0x85eb('0x35')]=_[_0x85eb('0x34')](_0xa9b14f[_0x85eb('0x31')],qs[_0x85eb('0x36')](_0x562792[_0x85eb('0x32')][_0x85eb('0x36')]));_0x585f2a['attributes']=_0x585f2a[_0x85eb('0x35')][_0x85eb('0x37')]?_0x585f2a['attributes']:_0xa9b14f['model'];if(!_0x562792[_0x85eb('0x32')][_0x85eb('0x38')](_0x85eb('0x39'))){_0x585f2a[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x562792[_0x85eb('0x32')][_0x85eb('0x1e')]);_0x585f2a[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x562792[_0x85eb('0x32')][_0x85eb('0x1c')]);}_0x585f2a[_0x85eb('0x3a')]=qs[_0x85eb('0x3b')](_0x562792[_0x85eb('0x32')]['sort']);_0x585f2a[_0x85eb('0x3c')]=qs[_0x85eb('0x33')](_['pick'](_0x562792['query'],_0xa9b14f[_0x85eb('0x33')]),_0x4229e9);if(_0x562792[_0x85eb('0x32')]['filter']){_0x585f2a[_0x85eb('0x3c')]=_['merge'](_0x585f2a[_0x85eb('0x3c')],{'$or':_['map'](_0x4229e9,function(_0xaa27ca){if(_0xaa27ca['type']!==_0x85eb('0x3d')){var _0x5c618a={};_0x5c618a[_0xaa27ca[_0x85eb('0x2a')]]={'$like':'%'+_0x562792[_0x85eb('0x32')]['filter']+'%'};return _0x5c618a;}})});}_0x585f2a=_[_0x85eb('0x3e')]({},_0x585f2a,_0x562792['options']);var _0x2a6baa={'where':_0x585f2a[_0x85eb('0x3c')]};return db['WhatsappQueueReport'][_0x85eb('0x1f')](_0x2a6baa)['then'](function(_0x5495cf){_0x5255eb[_0x85eb('0x1f')]=_0x5495cf;if(_0x562792['query'][_0x85eb('0x3f')]){_0x585f2a[_0x85eb('0x40')]=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x585f2a);})[_0x85eb('0x26')](function(_0x422ec3){_0x5255eb['rows']=_0x422ec3;return _0x5255eb;})['then'](respondWithFilteredResult(_0x37515c,_0x585f2a))[_0x85eb('0x41')](handleError(_0x37515c,null));};exports[_0x85eb('0x42')]=function(_0x2211f9,_0x202681){var _0x3be961={'raw':!![],'where':{'id':_0x2211f9[_0x85eb('0x43')]['id']}},_0x5b7411={};_0x5b7411[_0x85eb('0x31')]=_[_0x85eb('0x44')](db[_0x85eb('0x2d')][_0x85eb('0x2e')]);_0x5b7411[_0x85eb('0x32')]=_[_0x85eb('0x44')](_0x2211f9[_0x85eb('0x32')]);_0x5b7411[_0x85eb('0x33')]=_['intersection'](_0x5b7411[_0x85eb('0x31')],_0x5b7411[_0x85eb('0x32')]);_0x3be961['attributes']=_[_0x85eb('0x34')](_0x5b7411[_0x85eb('0x31')],qs[_0x85eb('0x36')](_0x2211f9[_0x85eb('0x32')][_0x85eb('0x36')]));_0x3be961[_0x85eb('0x35')]=_0x3be961['attributes'][_0x85eb('0x37')]?_0x3be961[_0x85eb('0x35')]:_0x5b7411[_0x85eb('0x31')];if(_0x2211f9[_0x85eb('0x32')][_0x85eb('0x3f')]){_0x3be961[_0x85eb('0x40')]=[{'all':!![]}];}_0x3be961=_[_0x85eb('0x3e')]({},_0x3be961,_0x2211f9[_0x85eb('0x45')]);return db['WhatsappQueueReport'][_0x85eb('0x46')](_0x3be961)[_0x85eb('0x26')](handleEntityNotFound(_0x202681,null))[_0x85eb('0x26')](respondWithResult(_0x202681,null))[_0x85eb('0x41')](handleError(_0x202681,null));};exports[_0x85eb('0x47')]=function(_0x1a19c2,_0x3c387a){return db[_0x85eb('0x2d')][_0x85eb('0x47')](_0x1a19c2[_0x85eb('0x48')],{})[_0x85eb('0x26')](respondWithResult(_0x3c387a,0xc9))[_0x85eb('0x41')](handleError(_0x3c387a,null));};exports['update']=function(_0x11da79,_0x2c951b){if(_0x11da79[_0x85eb('0x48')]['id']){delete _0x11da79['body']['id'];}return db[_0x85eb('0x2d')][_0x85eb('0x46')]({'where':{'id':_0x11da79[_0x85eb('0x43')]['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x2c951b,null))[_0x85eb('0x26')](saveUpdates(_0x11da79['body'],null))[_0x85eb('0x26')](respondWithResult(_0x2c951b,null))[_0x85eb('0x41')](handleError(_0x2c951b,null));};exports[_0x85eb('0x25')]=function(_0x50e264,_0xc5cb43){return db[_0x85eb('0x2d')][_0x85eb('0x46')]({'where':{'id':_0x50e264['params']['id']}})['then'](handleEntityNotFound(_0xc5cb43,null))[_0x85eb('0x26')](removeEntity(_0xc5cb43,null))['catch'](handleError(_0xc5cb43,null));};exports['describe']=function(_0x3f0b0c,_0x593723){return db[_0x85eb('0x2d')][_0x85eb('0x49')]()['then'](respondWithResult(_0x593723,null))['catch'](handleError(_0x593723,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 5570b8d..a8aa1f1 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 _0xc02f=['util','../../config/logger','api','bluebird','request-promise','rimraf','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash'];(function(_0x3e2e2c,_0x36c7d5){var _0x75f42=function(_0x5a5380){while(--_0x5a5380){_0x3e2e2c['push'](_0x3e2e2c['shift']());}};_0x75f42(++_0x36c7d5);}(_0xc02f,0xa7));var _0xfc02=function(_0x4052c7,_0x30a10d){_0x4052c7=_0x4052c7-0x0;var _0x3134c7=_0xc02f[_0x4052c7];return _0x3134c7;};'use strict';var _=require(_0xfc02('0x0'));var util=require(_0xfc02('0x1'));var logger=require(_0xfc02('0x2'))(_0xfc02('0x3'));var moment=require('moment');var BPromise=require(_0xfc02('0x4'));var rp=require(_0xfc02('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc02('0x6'));var config=require('../../config/environment');var attributes=require(_0xfc02('0x7'));module[_0xfc02('0x8')]=function(_0xa2953f,_0xd9627b){return _0xa2953f['define'](_0xfc02('0x9'),attributes,{'tableName':_0xfc02('0xa'),'paranoid':![],'indexes':[{'name':_0xfc02('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f06=['request-promise','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','uniqueid','lodash','../../config/logger','moment','bluebird'];(function(_0x5a9524,_0x113509){var _0xe3170=function(_0x551c2d){while(--_0x551c2d){_0x5a9524['push'](_0x5a9524['shift']());}};_0xe3170(++_0x113509);}(_0x4f06,0x178));var _0x64f0=function(_0x38d398,_0x199bce){_0x38d398=_0x38d398-0x0;var _0x9d824f=_0x4f06[_0x38d398];return _0x9d824f;};'use strict';var _=require(_0x64f0('0x0'));var util=require('util');var logger=require(_0x64f0('0x1'))('api');var moment=require(_0x64f0('0x2'));var BPromise=require(_0x64f0('0x3'));var rp=require(_0x64f0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x64f0('0x5'));var attributes=require(_0x64f0('0x6'));module['exports']=function(_0x2201a8,_0x564d3d){return _0x2201a8[_0x64f0('0x7')](_0x64f0('0x8'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x64f0('0x9'),'fields':[_0x64f0('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 0c990c6..18b9714 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 _0xa9fc=['error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5c024f,_0x938921){var _0x4a44c7=function(_0x27ee42){while(--_0x27ee42){_0x5c024f['push'](_0x5c024f['shift']());}};_0x4a44c7(++_0x938921);}(_0xa9fc,0x9b));var _0xca9f=function(_0x4af01e,_0x543f5c){_0x4af01e=_0x4af01e-0x0;var _0x178c11=_0xa9fc[_0x4af01e];return _0x178c11;};'use strict';var _=require(_0xca9f('0x0'));var util=require(_0xca9f('0x1'));var moment=require(_0xca9f('0x2'));var BPromise=require('bluebird');var rs=require(_0xca9f('0x3'));var fs=require('fs');var Redis=require(_0xca9f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xca9f('0x5'));var logger=require(_0xca9f('0x6'))(_0xca9f('0x7'));var config=require(_0xca9f('0x8'));var jayson=require(_0xca9f('0x9'));var client=jayson[_0xca9f('0xa')][_0xca9f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdc21ab,_0x12764a,_0x1aa12c){return new BPromise(function(_0xb475ae,_0x14b88a){return client[_0xca9f('0xc')](_0xdc21ab,_0x1aa12c)[_0xca9f('0xd')](function(_0x4d688d){logger[_0xca9f('0xe')](_0xca9f('0xf'),_0x12764a,_0xca9f('0x10'));logger[_0xca9f('0x11')](_0xca9f('0x12'),_0x12764a,_0xca9f('0x10'),JSON[_0xca9f('0x13')](_0x4d688d));if(_0x4d688d[_0xca9f('0x14')]){if(_0x4d688d[_0xca9f('0x14')][_0xca9f('0x15')]===0x1f4){logger[_0xca9f('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0x12764a,_0x4d688d[_0xca9f('0x14')][_0xca9f('0x16')]);return _0x14b88a(_0x4d688d['error']['message']);}logger['error'](_0xca9f('0xf'),_0x12764a,_0x4d688d[_0xca9f('0x14')][_0xca9f('0x16')]);return _0xb475ae(_0x4d688d[_0xca9f('0x14')][_0xca9f('0x16')]);}else{logger['info'](_0xca9f('0xf'),_0x12764a,_0xca9f('0x10'));_0xb475ae(_0x4d688d[_0xca9f('0x17')][_0xca9f('0x16')]);}})[_0xca9f('0x18')](function(_0x4dde23){logger[_0xca9f('0x14')](_0xca9f('0xf'),_0x12764a,_0x4dde23);_0x14b88a(_0x4dde23);});});}exports[_0xca9f('0x19')]=function(_0x1eb78d){var _0x3ed1c8=this;return new Promise(function(_0x2bf587,_0x93d788){return db[_0xca9f('0x1a')][_0xca9f('0x1b')](_0x1eb78d[_0xca9f('0x1c')],{'raw':_0x1eb78d[_0xca9f('0x1d')]?_0x1eb78d[_0xca9f('0x1d')][_0xca9f('0x1e')]===undefined?!![]:![]:!![]})[_0xca9f('0xd')](function(_0x34f4cd){logger[_0xca9f('0xe')]('CreateWhatsappQueueReport',_0x1eb78d);logger['debug'](_0xca9f('0x19'),_0x1eb78d,JSON[_0xca9f('0x13')](_0x34f4cd));_0x2bf587(_0x34f4cd);})[_0xca9f('0x18')](function(_0xc1f108){logger[_0xca9f('0x14')](_0xca9f('0x19'),_0xc1f108[_0xca9f('0x16')],_0x1eb78d);_0x93d788(_0x3ed1c8[_0xca9f('0x14')](0x1f4,_0xc1f108[_0xca9f('0x16')]));});});};exports[_0xca9f('0x1f')]=function(_0x2c3a31){var _0xa4ad2e=this;return new Promise(function(_0xe11fe8,_0x632ce1){return db['WhatsappQueueReport']['update'](_0x2c3a31[_0xca9f('0x1c')],{'raw':_0x2c3a31[_0xca9f('0x1d')]?_0x2c3a31[_0xca9f('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c3a31[_0xca9f('0x1d')]?_0x2c3a31[_0xca9f('0x1d')][_0xca9f('0x20')]||null:null,'attributes':_0x2c3a31[_0xca9f('0x1d')]?_0x2c3a31['options'][_0xca9f('0x21')]||null:null,'limit':_0x2c3a31[_0xca9f('0x1d')]?_0x2c3a31[_0xca9f('0x1d')][_0xca9f('0x22')]||null:null})[_0xca9f('0xd')](function(_0x3d53e6){logger[_0xca9f('0xe')](_0xca9f('0x1f'),_0x2c3a31);logger[_0xca9f('0x11')]('UpdateWhatsappQueueReport',_0x2c3a31,JSON['stringify'](_0x3d53e6));_0xe11fe8(_0x3d53e6);})[_0xca9f('0x18')](function(_0x46dd07){logger[_0xca9f('0x14')](_0xca9f('0x1f'),_0x46dd07[_0xca9f('0x16')],_0x2c3a31);_0x632ce1(_0xa4ad2e[_0xca9f('0x14')](0x1f4,_0x46dd07[_0xca9f('0x16')]));});});}; \ No newline at end of file +var _0xc961=['request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','catch','UpdateWhatsappQueueReport','raw','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','http','then','info','WhatsappQueueReport,\x20%s,\x20%s'];(function(_0x3b7205,_0x4d6931){var _0x1fb858=function(_0x20db4c){while(--_0x20db4c){_0x3b7205['push'](_0x3b7205['shift']());}};_0x1fb858(++_0x4d6931);}(_0xc961,0x17a));var _0x1c96=function(_0x39f097,_0x17116b){_0x39f097=_0x39f097-0x0;var _0x544f6a=_0xc961[_0x39f097];return _0x544f6a;};'use strict';var _=require(_0x1c96('0x0'));var util=require(_0x1c96('0x1'));var moment=require(_0x1c96('0x2'));var BPromise=require(_0x1c96('0x3'));var rs=require(_0x1c96('0x4'));var fs=require('fs');var Redis=require(_0x1c96('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c96('0x6'));var config=require('../../config/environment');var jayson=require(_0x1c96('0x7'));var client=jayson['client'][_0x1c96('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d4b23,_0x1f09ff,_0x307846){return new BPromise(function(_0x2e4fa5,_0x473a4c){return client['request'](_0x2d4b23,_0x307846)[_0x1c96('0x9')](function(_0x362e46){logger[_0x1c96('0xa')](_0x1c96('0xb'),_0x1f09ff,_0x1c96('0xc'));logger[_0x1c96('0xd')](_0x1c96('0xe'),_0x1f09ff,_0x1c96('0xc'),JSON[_0x1c96('0xf')](_0x362e46));if(_0x362e46[_0x1c96('0x10')]){if(_0x362e46[_0x1c96('0x10')][_0x1c96('0x11')]===0x1f4){logger['error'](_0x1c96('0xb'),_0x1f09ff,_0x362e46[_0x1c96('0x10')]['message']);return _0x473a4c(_0x362e46[_0x1c96('0x10')][_0x1c96('0x12')]);}logger[_0x1c96('0x10')](_0x1c96('0xb'),_0x1f09ff,_0x362e46[_0x1c96('0x10')][_0x1c96('0x12')]);return _0x2e4fa5(_0x362e46[_0x1c96('0x10')][_0x1c96('0x12')]);}else{logger[_0x1c96('0xa')](_0x1c96('0xb'),_0x1f09ff,_0x1c96('0xc'));_0x2e4fa5(_0x362e46[_0x1c96('0x13')][_0x1c96('0x12')]);}})['catch'](function(_0x32596e){logger['error'](_0x1c96('0xb'),_0x1f09ff,_0x32596e);_0x473a4c(_0x32596e);});});}exports[_0x1c96('0x14')]=function(_0x595429){var _0x29dafb=this;return new Promise(function(_0x491875,_0x57efce){return db[_0x1c96('0x15')][_0x1c96('0x16')](_0x595429[_0x1c96('0x17')],{'raw':_0x595429['options']?_0x595429[_0x1c96('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x1c96('0x9')](function(_0x174ebf){logger['info'](_0x1c96('0x14'),_0x595429);logger['debug'](_0x1c96('0x14'),_0x595429,JSON[_0x1c96('0xf')](_0x174ebf));_0x491875(_0x174ebf);})[_0x1c96('0x19')](function(_0x3f4293){logger[_0x1c96('0x10')](_0x1c96('0x14'),_0x3f4293[_0x1c96('0x12')],_0x595429);_0x57efce(_0x29dafb[_0x1c96('0x10')](0x1f4,_0x3f4293[_0x1c96('0x12')]));});});};exports[_0x1c96('0x1a')]=function(_0x4d2c9c){var _0x24c60c=this;return new Promise(function(_0x18b849,_0x289ee5){return db['WhatsappQueueReport']['update'](_0x4d2c9c[_0x1c96('0x17')],{'raw':_0x4d2c9c[_0x1c96('0x18')]?_0x4d2c9c['options'][_0x1c96('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d2c9c[_0x1c96('0x18')]?_0x4d2c9c[_0x1c96('0x18')]['where']||null:null,'attributes':_0x4d2c9c['options']?_0x4d2c9c[_0x1c96('0x18')][_0x1c96('0x1c')]||null:null,'limit':_0x4d2c9c['options']?_0x4d2c9c[_0x1c96('0x18')][_0x1c96('0x1d')]||null:null})[_0x1c96('0x9')](function(_0x25db8a){logger['info']('UpdateWhatsappQueueReport',_0x4d2c9c);logger[_0x1c96('0xd')]('UpdateWhatsappQueueReport',_0x4d2c9c,JSON[_0x1c96('0xf')](_0x25db8a));_0x18b849(_0x25db8a);})['catch'](function(_0x5c7b1d){logger[_0x1c96('0x10')](_0x1c96('0x1a'),_0x5c7b1d[_0x1c96('0x12')],_0x4d2c9c);_0x289ee5(_0x24c60c[_0x1c96('0x10')](0x1f4,_0x5c7b1d[_0x1c96('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 46b79c2..00d6106 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 _0xdc02=['./whatsappTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','put','update','exports','util','path','Router','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdc02,0xce));var _0x2dc0=function(_0x459b3e,_0x5a0c7a){_0x459b3e=_0x459b3e-0x0;var _0xaf15e4=_0xdc02[_0x459b3e];return _0xaf15e4;};'use strict';var multer=require('multer');var util=require(_0x2dc0('0x0'));var path=require(_0x2dc0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2dc0('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2dc0('0x3'));var config=require('../../config/environment');var controller=require(_0x2dc0('0x4'));router['get']('/',auth[_0x2dc0('0x5')](),controller[_0x2dc0('0x6')]);router[_0x2dc0('0x7')](_0x2dc0('0x8'),auth[_0x2dc0('0x5')](),controller['describe']);router[_0x2dc0('0x7')](_0x2dc0('0x9'),auth[_0x2dc0('0x5')](),controller[_0x2dc0('0xa')]);router['post']('/',auth[_0x2dc0('0x5')](),controller['create']);router[_0x2dc0('0xb')](_0x2dc0('0x9'),auth[_0x2dc0('0x5')](),controller[_0x2dc0('0xc')]);router['delete']('/:id',auth[_0x2dc0('0x5')](),controller['destroy']);module[_0x2dc0('0xd')]=router; \ No newline at end of file +var _0x1612=['multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create','put','update','delete','destroy'];(function(_0x48744c,_0x2ca27b){var _0x3590ad=function(_0x2b08bb){while(--_0x2b08bb){_0x48744c['push'](_0x48744c['shift']());}};_0x3590ad(++_0x2ca27b);}(_0x1612,0x1a9));var _0x2161=function(_0x5b2d8f,_0x53f9d4){_0x5b2d8f=_0x5b2d8f-0x0;var _0x2f1fdf=_0x1612[_0x5b2d8f];return _0x2f1fdf;};'use strict';var multer=require(_0x2161('0x0'));var util=require(_0x2161('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2161('0x2'));var router=express['Router']();var fs_extra=require(_0x2161('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2161('0x4'));var config=require(_0x2161('0x5'));var controller=require(_0x2161('0x6'));router[_0x2161('0x7')]('/',auth[_0x2161('0x8')](),controller['index']);router[_0x2161('0x7')](_0x2161('0x9'),auth[_0x2161('0x8')](),controller['describe']);router[_0x2161('0x7')](_0x2161('0xa'),auth[_0x2161('0x8')](),controller['show']);router[_0x2161('0xb')]('/',auth[_0x2161('0x8')](),controller[_0x2161('0xc')]);router[_0x2161('0xd')](_0x2161('0xa'),auth['isAuthenticated'](),controller[_0x2161('0xe')]);router[_0x2161('0xf')](_0x2161('0xa'),auth['isAuthenticated'](),controller[_0x2161('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 023071e..ab08d5b 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 _0x99cd=['agent','queue','DATE','sequelize','STRING','ENUM','account'];(function(_0x31b813,_0x2f842d){var _0x2870fa=function(_0xc86546){while(--_0xc86546){_0x31b813['push'](_0x31b813['shift']());}};_0x2870fa(++_0x2f842d);}(_0x99cd,0x1df));var _0xd99c=function(_0x16d26c,_0xffdee0){_0x16d26c=_0x16d26c-0x0;var _0x1742a2=_0x99cd[_0x16d26c];return _0x1742a2;};'use strict';var Sequelize=require(_0xd99c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd99c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd99c('0x2')](_0xd99c('0x3'),_0xd99c('0x4'),_0xd99c('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd99c('0x6')]}}; \ No newline at end of file +var _0xb077=['queue','DATE','sequelize','ENUM','agent'];(function(_0x4fb14a,_0x46f1d9){var _0x237880=function(_0x12aac2){while(--_0x12aac2){_0x4fb14a['push'](_0x4fb14a['shift']());}};_0x237880(++_0x46f1d9);}(_0xb077,0x7a));var _0x7b07=function(_0x2a8ad2,_0x5cb52f){_0x2a8ad2=_0x2a8ad2-0x0;var _0x440301=_0xb077[_0x2a8ad2];return _0x440301;};'use strict';var Sequelize=require(_0x7b07('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7b07('0x1')]('account',_0x7b07('0x2'),_0x7b07('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7b07('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 74b506f..0bdf3c6 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 _0x52a7=['request-promise','moment','bluebird','mustache','util','sox','to-csv','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','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappTransferReport','includeAll','findAll','catch','show','params','find','create','body','destroy','zip-dir','fast-json-patch'];(function(_0xbc9261,_0x42ba9d){var _0x2c0487=function(_0x47e243){while(--_0x47e243){_0xbc9261['push'](_0xbc9261['shift']());}};_0x2c0487(++_0x42ba9d);}(_0x52a7,0x16b));var _0x752a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x52a7[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x752a('0x0'));var jsonpatch=require(_0x752a('0x1'));var rp=require(_0x752a('0x2'));var moment=require(_0x752a('0x3'));var BPromise=require(_0x752a('0x4'));var Mustache=require(_0x752a('0x5'));var util=require(_0x752a('0x6'));var path=require('path');var sox=require(_0x752a('0x7'));var csv=require(_0x752a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x752a('0x9'));var _=require('lodash');var squel=require(_0x752a('0xa'));var crypto=require(_0x752a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x752a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x752a('0xd'));var Papa=require(_0x752a('0xe'));var Redis=require(_0x752a('0xf'));var authService=require(_0x752a('0x10'));var qs=require(_0x752a('0x11'));var as=require(_0x752a('0x12'));var hardwareService=require(_0x752a('0x13'));var logger=require('../../config/logger')(_0x752a('0x14'));var utils=require(_0x752a('0x15'));var config=require(_0x752a('0x16'));var licenseUtil=require(_0x752a('0x17'));var db=require(_0x752a('0x18'))['db'];function respondWithStatusCode(_0x1fd312,_0x387cf4){_0x387cf4=_0x387cf4||0xcc;return function(_0x5bdad1){if(_0x5bdad1){return _0x1fd312[_0x752a('0x19')](_0x387cf4);}return _0x1fd312[_0x752a('0x1a')](_0x387cf4)['end']();};}function respondWithResult(_0x12aefd,_0x47d693){_0x47d693=_0x47d693||0xc8;return function(_0x9ea6e0){if(_0x9ea6e0){return _0x12aefd[_0x752a('0x1a')](_0x47d693)[_0x752a('0x1b')](_0x9ea6e0);}};}function respondWithFilteredResult(_0x1091e5,_0x2ad947){return function(_0x1d967a){if(_0x1d967a){var _0x4e2b56=typeof _0x2ad947[_0x752a('0x1c')]===_0x752a('0x1d')&&typeof _0x2ad947[_0x752a('0x1e')]===_0x752a('0x1d');var _0x52f175=_0x1d967a[_0x752a('0x1f')];var _0x4973ef=_0x4e2b56?0x0:_0x2ad947[_0x752a('0x1c')];var _0x3db53d=_0x4e2b56?_0x1d967a[_0x752a('0x1f')]:_0x2ad947[_0x752a('0x1c')]+_0x2ad947[_0x752a('0x1e')];var _0x5248c2;if(_0x3db53d>=_0x52f175){_0x3db53d=_0x52f175;_0x5248c2=0xc8;}else{_0x5248c2=0xce;}_0x1091e5[_0x752a('0x1a')](_0x5248c2);return _0x1091e5[_0x752a('0x20')](_0x752a('0x21'),_0x4973ef+'-'+_0x3db53d+'/'+_0x52f175)[_0x752a('0x1b')](_0x1d967a);}return null;};}function patchUpdates(_0x9056a5){return function(_0x4d276d){try{jsonpatch['apply'](_0x4d276d,_0x9056a5,!![]);}catch(_0x30cb6c){return BPromise[_0x752a('0x22')](_0x30cb6c);}return _0x4d276d[_0x752a('0x23')]();};}function saveUpdates(_0x24c10c,_0x58f48b){return function(_0xb71478){if(_0xb71478){return _0xb71478[_0x752a('0x24')](_0x24c10c)[_0x752a('0x25')](function(_0x2cf269){return _0x2cf269;});}return null;};}function removeEntity(_0x2f0d04,_0x54cdbf){return function(_0x3ba924){if(_0x3ba924){return _0x3ba924['destroy']()[_0x752a('0x25')](function(){_0x2f0d04[_0x752a('0x1a')](0xcc)[_0x752a('0x26')]();});}};}function handleEntityNotFound(_0x3ca500,_0xf1ff32){return function(_0x5b1f1a){if(!_0x5b1f1a){_0x3ca500['sendStatus'](0x194);}return _0x5b1f1a;};}function handleError(_0xd6ba41,_0x50fb40){_0x50fb40=_0x50fb40||0x1f4;return function(_0xf7e979){logger['error'](_0xf7e979[_0x752a('0x27')]);if(_0xf7e979[_0x752a('0x28')]){delete _0xf7e979[_0x752a('0x28')];}_0xd6ba41['status'](_0x50fb40)['send'](_0xf7e979);};}exports['index']=function(_0x455e3a,_0x38d78f){var _0x2f5059={},_0x4db606={},_0x520183={'count':0x0,'rows':[]};var _0x17495f=_[_0x752a('0x29')](db['WhatsappTransferReport'][_0x752a('0x2a')],function(_0x43c946){return{'name':_0x43c946[_0x752a('0x2b')],'type':_0x43c946[_0x752a('0x2c')]['key']};});_0x4db606[_0x752a('0x2d')]=_['map'](_0x17495f,_0x752a('0x28'));_0x4db606[_0x752a('0x2e')]=_[_0x752a('0x2f')](_0x455e3a[_0x752a('0x2e')]);_0x4db606[_0x752a('0x30')]=_[_0x752a('0x31')](_0x4db606[_0x752a('0x2d')],_0x4db606[_0x752a('0x2e')]);_0x2f5059['attributes']=_[_0x752a('0x31')](_0x4db606[_0x752a('0x2d')],qs[_0x752a('0x32')](_0x455e3a[_0x752a('0x2e')]['fields']));_0x2f5059['attributes']=_0x2f5059[_0x752a('0x33')][_0x752a('0x34')]?_0x2f5059[_0x752a('0x33')]:_0x4db606[_0x752a('0x2d')];if(!_0x455e3a['query'][_0x752a('0x35')](_0x752a('0x36'))){_0x2f5059[_0x752a('0x1e')]=qs[_0x752a('0x1e')](_0x455e3a['query'][_0x752a('0x1e')]);_0x2f5059[_0x752a('0x1c')]=qs[_0x752a('0x1c')](_0x455e3a[_0x752a('0x2e')][_0x752a('0x1c')]);}_0x2f5059[_0x752a('0x37')]=qs[_0x752a('0x38')](_0x455e3a[_0x752a('0x2e')][_0x752a('0x38')]);_0x2f5059['where']=qs[_0x752a('0x30')](_[_0x752a('0x39')](_0x455e3a[_0x752a('0x2e')],_0x4db606[_0x752a('0x30')]),_0x17495f);if(_0x455e3a['query'][_0x752a('0x3a')]){_0x2f5059[_0x752a('0x3b')]=_[_0x752a('0x3c')](_0x2f5059[_0x752a('0x3b')],{'$or':_['map'](_0x17495f,function(_0x4563be){if(_0x4563be['type']!==_0x752a('0x3d')){var _0x585bf3={};_0x585bf3[_0x4563be[_0x752a('0x28')]]={'$like':'%'+_0x455e3a[_0x752a('0x2e')]['filter']+'%'};return _0x585bf3;}})});}_0x2f5059=_['merge']({},_0x2f5059,_0x455e3a[_0x752a('0x3e')]);var _0x13a128={'where':_0x2f5059[_0x752a('0x3b')]};return db[_0x752a('0x3f')]['count'](_0x13a128)['then'](function(_0x25f24e){_0x520183['count']=_0x25f24e;if(_0x455e3a[_0x752a('0x2e')][_0x752a('0x40')]){_0x2f5059['include']=[{'all':!![]}];}return db[_0x752a('0x3f')][_0x752a('0x41')](_0x2f5059);})[_0x752a('0x25')](function(_0x2c8a36){_0x520183['rows']=_0x2c8a36;return _0x520183;})[_0x752a('0x25')](respondWithFilteredResult(_0x38d78f,_0x2f5059))[_0x752a('0x42')](handleError(_0x38d78f,null));};exports[_0x752a('0x43')]=function(_0x89fe1f,_0x3f44b6){var _0x45f4a8={'raw':!![],'where':{'id':_0x89fe1f[_0x752a('0x44')]['id']}},_0x4fc67f={};_0x4fc67f['model']=_[_0x752a('0x2f')](db[_0x752a('0x3f')][_0x752a('0x2a')]);_0x4fc67f[_0x752a('0x2e')]=_[_0x752a('0x2f')](_0x89fe1f[_0x752a('0x2e')]);_0x4fc67f[_0x752a('0x30')]=_[_0x752a('0x31')](_0x4fc67f[_0x752a('0x2d')],_0x4fc67f[_0x752a('0x2e')]);_0x45f4a8[_0x752a('0x33')]=_[_0x752a('0x31')](_0x4fc67f['model'],qs[_0x752a('0x32')](_0x89fe1f['query'][_0x752a('0x32')]));_0x45f4a8[_0x752a('0x33')]=_0x45f4a8[_0x752a('0x33')][_0x752a('0x34')]?_0x45f4a8[_0x752a('0x33')]:_0x4fc67f['model'];if(_0x89fe1f['query'][_0x752a('0x40')]){_0x45f4a8['include']=[{'all':!![]}];}_0x45f4a8=_[_0x752a('0x3c')]({},_0x45f4a8,_0x89fe1f['options']);return db[_0x752a('0x3f')][_0x752a('0x45')](_0x45f4a8)[_0x752a('0x25')](handleEntityNotFound(_0x3f44b6,null))['then'](respondWithResult(_0x3f44b6,null))[_0x752a('0x42')](handleError(_0x3f44b6,null));};exports['create']=function(_0x320ce8,_0x407214){return db['WhatsappTransferReport'][_0x752a('0x46')](_0x320ce8['body'],{})[_0x752a('0x25')](respondWithResult(_0x407214,0xc9))['catch'](handleError(_0x407214,null));};exports[_0x752a('0x24')]=function(_0x35be0c,_0x16b5ba){if(_0x35be0c[_0x752a('0x47')]['id']){delete _0x35be0c['body']['id'];}return db[_0x752a('0x3f')][_0x752a('0x45')]({'where':{'id':_0x35be0c[_0x752a('0x44')]['id']}})[_0x752a('0x25')](handleEntityNotFound(_0x16b5ba,null))[_0x752a('0x25')](saveUpdates(_0x35be0c[_0x752a('0x47')],null))['then'](respondWithResult(_0x16b5ba,null))[_0x752a('0x42')](handleError(_0x16b5ba,null));};exports[_0x752a('0x48')]=function(_0xc4413c,_0x53b2fe){return db['WhatsappTransferReport'][_0x752a('0x45')]({'where':{'id':_0xc4413c['params']['id']}})[_0x752a('0x25')](handleEntityNotFound(_0x53b2fe,null))[_0x752a('0x25')](removeEntity(_0x53b2fe,null))[_0x752a('0x42')](handleError(_0x53b2fe,null));};exports['describe']=function(_0x19a999,_0x57b656){return db['WhatsappTransferReport']['describe']()[_0x752a('0x25')](respondWithResult(_0x57b656,null))['catch'](handleError(_0x57b656,null));}; \ No newline at end of file +var _0x823a=['include','findAll','rows','catch','params','fields','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','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','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x1af858,_0x3ae4ee){var _0x57d7bf=function(_0xbc6463){while(--_0xbc6463){_0x1af858['push'](_0x1af858['shift']());}};_0x57d7bf(++_0x3ae4ee);}(_0x823a,0x14a));var _0xa823=function(_0x4471ff,_0x4bb7de){_0x4471ff=_0x4471ff-0x0;var _0xe723ca=_0x823a[_0x4471ff];return _0xe723ca;};'use strict';var emlformat=require(_0xa823('0x0'));var rimraf=require(_0xa823('0x1'));var zipdir=require(_0xa823('0x2'));var jsonpatch=require(_0xa823('0x3'));var rp=require(_0xa823('0x4'));var moment=require(_0xa823('0x5'));var BPromise=require(_0xa823('0x6'));var Mustache=require(_0xa823('0x7'));var util=require(_0xa823('0x8'));var path=require(_0xa823('0x9'));var sox=require(_0xa823('0xa'));var csv=require(_0xa823('0xb'));var ejs=require(_0xa823('0xc'));var fs=require('fs');var fs_extra=require(_0xa823('0xd'));var _=require(_0xa823('0xe'));var squel=require('squel');var crypto=require(_0xa823('0xf'));var jsforce=require(_0xa823('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa823('0xb'));var querystring=require(_0xa823('0x11'));var Papa=require('papaparse');var Redis=require(_0xa823('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa823('0x13'));var as=require(_0xa823('0x14'));var hardwareService=require(_0xa823('0x15'));var logger=require(_0xa823('0x16'))(_0xa823('0x17'));var utils=require(_0xa823('0x18'));var config=require(_0xa823('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa823('0x1a'))['db'];function respondWithStatusCode(_0x24de27,_0x1842cc){_0x1842cc=_0x1842cc||0xcc;return function(_0x415d01){if(_0x415d01){return _0x24de27['sendStatus'](_0x1842cc);}return _0x24de27[_0xa823('0x1b')](_0x1842cc)[_0xa823('0x1c')]();};}function respondWithResult(_0xe8a990,_0x30907c){_0x30907c=_0x30907c||0xc8;return function(_0x2e226a){if(_0x2e226a){return _0xe8a990[_0xa823('0x1b')](_0x30907c)[_0xa823('0x1d')](_0x2e226a);}};}function respondWithFilteredResult(_0x396f38,_0xdae13f){return function(_0x33d755){if(_0x33d755){var _0x4d52b8=typeof _0xdae13f[_0xa823('0x1e')]==='undefined'&&typeof _0xdae13f[_0xa823('0x1f')]===_0xa823('0x20');var _0x4fa255=_0x33d755[_0xa823('0x21')];var _0x2995a4=_0x4d52b8?0x0:_0xdae13f[_0xa823('0x1e')];var _0x41ce0d=_0x4d52b8?_0x33d755[_0xa823('0x21')]:_0xdae13f[_0xa823('0x1e')]+_0xdae13f[_0xa823('0x1f')];var _0x28ee04;if(_0x41ce0d>=_0x4fa255){_0x41ce0d=_0x4fa255;_0x28ee04=0xc8;}else{_0x28ee04=0xce;}_0x396f38['status'](_0x28ee04);return _0x396f38[_0xa823('0x22')](_0xa823('0x23'),_0x2995a4+'-'+_0x41ce0d+'/'+_0x4fa255)['json'](_0x33d755);}return null;};}function patchUpdates(_0x515bc1){return function(_0x395dd2){try{jsonpatch[_0xa823('0x24')](_0x395dd2,_0x515bc1,!![]);}catch(_0x32b639){return BPromise[_0xa823('0x25')](_0x32b639);}return _0x395dd2[_0xa823('0x26')]();};}function saveUpdates(_0x3fba02,_0x35caad){return function(_0x4f9409){if(_0x4f9409){return _0x4f9409[_0xa823('0x27')](_0x3fba02)[_0xa823('0x28')](function(_0x143855){return _0x143855;});}return null;};}function removeEntity(_0x3fad27,_0x1712ee){return function(_0x5b5c56){if(_0x5b5c56){return _0x5b5c56[_0xa823('0x29')]()[_0xa823('0x28')](function(){_0x3fad27[_0xa823('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35b787,_0x55ca98){return function(_0x4ea99a){if(!_0x4ea99a){_0x35b787[_0xa823('0x2a')](0x194);}return _0x4ea99a;};}function handleError(_0xf4e58d,_0x129221){_0x129221=_0x129221||0x1f4;return function(_0x1bde9a){logger[_0xa823('0x2b')](_0x1bde9a[_0xa823('0x2c')]);if(_0x1bde9a[_0xa823('0x2d')]){delete _0x1bde9a[_0xa823('0x2d')];}_0xf4e58d[_0xa823('0x1b')](_0x129221)[_0xa823('0x2e')](_0x1bde9a);};}exports[_0xa823('0x2f')]=function(_0x9f7d79,_0x96fa6f){var _0x5bfccc={},_0x3a22d6={},_0xca4c77={'count':0x0,'rows':[]};var _0x51170c=_[_0xa823('0x30')](db[_0xa823('0x31')][_0xa823('0x32')],function(_0x1567ed){return{'name':_0x1567ed['fieldName'],'type':_0x1567ed[_0xa823('0x33')][_0xa823('0x34')]};});_0x3a22d6['model']=_[_0xa823('0x30')](_0x51170c,_0xa823('0x2d'));_0x3a22d6[_0xa823('0x35')]=_[_0xa823('0x36')](_0x9f7d79[_0xa823('0x35')]);_0x3a22d6[_0xa823('0x37')]=_[_0xa823('0x38')](_0x3a22d6[_0xa823('0x39')],_0x3a22d6['query']);_0x5bfccc['attributes']=_['intersection'](_0x3a22d6[_0xa823('0x39')],qs['fields'](_0x9f7d79[_0xa823('0x35')]['fields']));_0x5bfccc[_0xa823('0x3a')]=_0x5bfccc[_0xa823('0x3a')][_0xa823('0x3b')]?_0x5bfccc[_0xa823('0x3a')]:_0x3a22d6[_0xa823('0x39')];if(!_0x9f7d79[_0xa823('0x35')][_0xa823('0x3c')](_0xa823('0x3d'))){_0x5bfccc[_0xa823('0x1f')]=qs[_0xa823('0x1f')](_0x9f7d79['query'][_0xa823('0x1f')]);_0x5bfccc[_0xa823('0x1e')]=qs[_0xa823('0x1e')](_0x9f7d79[_0xa823('0x35')]['offset']);}_0x5bfccc['order']=qs[_0xa823('0x3e')](_0x9f7d79[_0xa823('0x35')]['sort']);_0x5bfccc[_0xa823('0x3f')]=qs['filters'](_[_0xa823('0x40')](_0x9f7d79[_0xa823('0x35')],_0x3a22d6[_0xa823('0x37')]),_0x51170c);if(_0x9f7d79[_0xa823('0x35')][_0xa823('0x41')]){_0x5bfccc['where']=_[_0xa823('0x42')](_0x5bfccc[_0xa823('0x3f')],{'$or':_[_0xa823('0x30')](_0x51170c,function(_0x4bdb26){if(_0x4bdb26[_0xa823('0x33')]!==_0xa823('0x43')){var _0x5f0b0d={};_0x5f0b0d[_0x4bdb26[_0xa823('0x2d')]]={'$like':'%'+_0x9f7d79[_0xa823('0x35')]['filter']+'%'};return _0x5f0b0d;}})});}_0x5bfccc=_['merge']({},_0x5bfccc,_0x9f7d79[_0xa823('0x44')]);var _0x31b681={'where':_0x5bfccc['where']};return db[_0xa823('0x31')]['count'](_0x31b681)[_0xa823('0x28')](function(_0x542a16){_0xca4c77[_0xa823('0x21')]=_0x542a16;if(_0x9f7d79[_0xa823('0x35')][_0xa823('0x45')]){_0x5bfccc[_0xa823('0x46')]=[{'all':!![]}];}return db[_0xa823('0x31')][_0xa823('0x47')](_0x5bfccc);})[_0xa823('0x28')](function(_0x303da6){_0xca4c77[_0xa823('0x48')]=_0x303da6;return _0xca4c77;})[_0xa823('0x28')](respondWithFilteredResult(_0x96fa6f,_0x5bfccc))[_0xa823('0x49')](handleError(_0x96fa6f,null));};exports['show']=function(_0x73a99c,_0x4b657c){var _0x19638f={'raw':!![],'where':{'id':_0x73a99c[_0xa823('0x4a')]['id']}},_0x222c27={};_0x222c27[_0xa823('0x39')]=_[_0xa823('0x36')](db[_0xa823('0x31')][_0xa823('0x32')]);_0x222c27['query']=_[_0xa823('0x36')](_0x73a99c[_0xa823('0x35')]);_0x222c27['filters']=_[_0xa823('0x38')](_0x222c27[_0xa823('0x39')],_0x222c27['query']);_0x19638f[_0xa823('0x3a')]=_[_0xa823('0x38')](_0x222c27[_0xa823('0x39')],qs['fields'](_0x73a99c[_0xa823('0x35')][_0xa823('0x4b')]));_0x19638f[_0xa823('0x3a')]=_0x19638f['attributes'][_0xa823('0x3b')]?_0x19638f[_0xa823('0x3a')]:_0x222c27[_0xa823('0x39')];if(_0x73a99c[_0xa823('0x35')][_0xa823('0x45')]){_0x19638f[_0xa823('0x46')]=[{'all':!![]}];}_0x19638f=_[_0xa823('0x42')]({},_0x19638f,_0x73a99c[_0xa823('0x44')]);return db[_0xa823('0x31')][_0xa823('0x4c')](_0x19638f)[_0xa823('0x28')](handleEntityNotFound(_0x4b657c,null))[_0xa823('0x28')](respondWithResult(_0x4b657c,null))[_0xa823('0x49')](handleError(_0x4b657c,null));};exports['create']=function(_0x2a2a74,_0x944f01){return db[_0xa823('0x31')][_0xa823('0x4d')](_0x2a2a74[_0xa823('0x4e')],{})[_0xa823('0x28')](respondWithResult(_0x944f01,0xc9))['catch'](handleError(_0x944f01,null));};exports['update']=function(_0x23f1b8,_0x99e67){if(_0x23f1b8['body']['id']){delete _0x23f1b8[_0xa823('0x4e')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x23f1b8[_0xa823('0x4a')]['id']}})[_0xa823('0x28')](handleEntityNotFound(_0x99e67,null))[_0xa823('0x28')](saveUpdates(_0x23f1b8[_0xa823('0x4e')],null))[_0xa823('0x28')](respondWithResult(_0x99e67,null))['catch'](handleError(_0x99e67,null));};exports[_0xa823('0x29')]=function(_0x38cdc7,_0x39fdec){return db[_0xa823('0x31')][_0xa823('0x4c')]({'where':{'id':_0x38cdc7['params']['id']}})[_0xa823('0x28')](handleEntityNotFound(_0x39fdec,null))['then'](removeEntity(_0x39fdec,null))[_0xa823('0x49')](handleError(_0x39fdec,null));};exports['describe']=function(_0x3b08ed,_0x226cd9){return db[_0xa823('0x31')][_0xa823('0x4f')]()[_0xa823('0x28')](respondWithResult(_0x226cd9,null))['catch'](handleError(_0x226cd9,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 0369256..9eebdec 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 _0x7053=['exports','define','WhatsappTransferReport','uniqueid','util','moment','bluebird','request-promise','path','rimraf','./whatsappTransferReport.attributes'];(function(_0x532f19,_0x51cd09){var _0x4270e8=function(_0x1f0af8){while(--_0x1f0af8){_0x532f19['push'](_0x532f19['shift']());}};_0x4270e8(++_0x51cd09);}(_0x7053,0x1a6));var _0x3705=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x7053[_0x2405bc];return _0x5272d4;};'use strict';var _=require('lodash');var util=require(_0x3705('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3705('0x1'));var BPromise=require(_0x3705('0x2'));var rp=require(_0x3705('0x3'));var fs=require('fs');var path=require(_0x3705('0x4'));var rimraf=require(_0x3705('0x5'));var config=require('../../config/environment');var attributes=require(_0x3705('0x6'));module[_0x3705('0x7')]=function(_0x14c1d5,_0x413035){return _0x14c1d5[_0x3705('0x8')](_0x3705('0x9'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x3705('0xa'),'fields':[_0x3705('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c58=['api','bluebird','request-promise','path','rimraf','exports','WhatsappTransferReport','uniqueid','lodash','../../config/logger'];(function(_0x2cf329,_0x51119d){var _0x115faa=function(_0x44de4e){while(--_0x44de4e){_0x2cf329['push'](_0x2cf329['shift']());}};_0x115faa(++_0x51119d);}(_0x1c58,0x198));var _0x81c5=function(_0x135e8e,_0x308c00){_0x135e8e=_0x135e8e-0x0;var _0x4a805d=_0x1c58[_0x135e8e];return _0x4a805d;};'use strict';var _=require(_0x81c5('0x0'));var util=require('util');var logger=require(_0x81c5('0x1'))(_0x81c5('0x2'));var moment=require('moment');var BPromise=require(_0x81c5('0x3'));var rp=require(_0x81c5('0x4'));var fs=require('fs');var path=require(_0x81c5('0x5'));var rimraf=require(_0x81c5('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x81c5('0x7')]=function(_0x132c85,_0x43c0dd){return _0x132c85['define'](_0x81c5('0x8'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x81c5('0x9'),'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 e8f3370..d2a2b6e 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 _0x07e8=['jayson/promise','client','then','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x29cb61,_0x494484){var _0x21d3e0=function(_0x3e0ac4){while(--_0x3e0ac4){_0x29cb61['push'](_0x29cb61['shift']());}};_0x21d3e0(++_0x494484);}(_0x07e8,0xa0));var _0x807e=function(_0x57f59d,_0x493f90){_0x57f59d=_0x57f59d-0x0;var _0x11c40d=_0x07e8[_0x57f59d];return _0x11c40d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x807e('0x0'));var BPromise=require(_0x807e('0x1'));var rs=require(_0x807e('0x2'));var fs=require('fs');var Redis=require(_0x807e('0x3'));var db=require(_0x807e('0x4'))['db'];var utils=require(_0x807e('0x5'));var logger=require(_0x807e('0x6'))(_0x807e('0x7'));var config=require('../../config/environment');var jayson=require(_0x807e('0x8'));var client=jayson[_0x807e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d6e43,_0x4db50b,_0x45d205){return new BPromise(function(_0x5bba6f,_0x3769fc){return client['request'](_0x3d6e43,_0x45d205)[_0x807e('0xa')](function(_0x153b12){logger['info'](_0x807e('0xb'),_0x4db50b,'request\x20sent');logger[_0x807e('0xc')](_0x807e('0xd'),_0x4db50b,_0x807e('0xe'),JSON[_0x807e('0xf')](_0x153b12));if(_0x153b12[_0x807e('0x10')]){if(_0x153b12['error'][_0x807e('0x11')]===0x1f4){logger['error'](_0x807e('0xb'),_0x4db50b,_0x153b12['error'][_0x807e('0x12')]);return _0x3769fc(_0x153b12[_0x807e('0x10')][_0x807e('0x12')]);}logger[_0x807e('0x10')](_0x807e('0xb'),_0x4db50b,_0x153b12[_0x807e('0x10')][_0x807e('0x12')]);return _0x5bba6f(_0x153b12[_0x807e('0x10')][_0x807e('0x12')]);}else{logger[_0x807e('0x13')](_0x807e('0xb'),_0x4db50b,'request\x20sent');_0x5bba6f(_0x153b12['result']['message']);}})[_0x807e('0x14')](function(_0x14606a){logger[_0x807e('0x10')](_0x807e('0xb'),_0x4db50b,_0x14606a);_0x3769fc(_0x14606a);});});} \ No newline at end of file +var _0x4731=['../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x18e239,_0x209392){var _0x5a2d22=function(_0x58e8cf){while(--_0x58e8cf){_0x18e239['push'](_0x18e239['shift']());}};_0x5a2d22(++_0x209392);}(_0x4731,0x65));var _0x1473=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4731[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x1473('0x0'));var util=require(_0x1473('0x1'));var moment=require(_0x1473('0x2'));var BPromise=require(_0x1473('0x3'));var rs=require(_0x1473('0x4'));var fs=require('fs');var Redis=require(_0x1473('0x5'));var db=require(_0x1473('0x6'))['db'];var utils=require(_0x1473('0x7'));var logger=require(_0x1473('0x8'))('rpc');var config=require(_0x1473('0x9'));var jayson=require(_0x1473('0xa'));var client=jayson[_0x1473('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dd214,_0x403b41,_0x145094){return new BPromise(function(_0xc160df,_0x2d3969){return client[_0x1473('0xc')](_0x1dd214,_0x145094)['then'](function(_0x421959){logger[_0x1473('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x403b41,_0x1473('0xe'));logger[_0x1473('0xf')](_0x1473('0x10'),_0x403b41,'request\x20sent',JSON['stringify'](_0x421959));if(_0x421959[_0x1473('0x11')]){if(_0x421959[_0x1473('0x11')]['code']===0x1f4){logger['error'](_0x1473('0x12'),_0x403b41,_0x421959[_0x1473('0x11')][_0x1473('0x13')]);return _0x2d3969(_0x421959[_0x1473('0x11')][_0x1473('0x13')]);}logger['error'](_0x1473('0x12'),_0x403b41,_0x421959[_0x1473('0x11')][_0x1473('0x13')]);return _0xc160df(_0x421959[_0x1473('0x11')][_0x1473('0x13')]);}else{logger[_0x1473('0xd')](_0x1473('0x12'),_0x403b41,_0x1473('0xe'));_0xc160df(_0x421959[_0x1473('0x14')]['message']);}})[_0x1473('0x15')](function(_0xc5726e){logger[_0x1473('0x11')](_0x1473('0x12'),_0x403b41,_0xc5726e);_0x2d3969(_0xc5726e);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 2d1c53c..30465b6 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x102b=['\x20processes\x20failed\x20at\x20startup:\x20','map','Online\x20apps:','join','Offline\x20apps:','status','online','name','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','start','info','filter','exitCode','length'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x102b,0x1be));var _0xb102=function(_0xaf487e,_0x33f4bb){_0xaf487e=_0xaf487e-0x0;var _0x14a391=_0x102b[_0xaf487e];return _0x14a391;};'use strict';var _=require('lodash');var db=require(_0xb102('0x0'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xb102('0x1'));var rpc=require(_0xb102('0x2'));var config=require(_0xb102('0x3'));var logger=require(_0xb102('0x4'))(_0xb102('0x5'));var pm2=require(_0xb102('0x6'));var pm2Config=require(_0xb102('0x7'));var schedule=require(_0xb102('0x8'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xb102('0x9'));var transcribe=require(_0xb102('0xa'));var provider=require(_0xb102('0xb'));function main(){return db[_0xb102('0xc')][_0xb102('0xd')]()['then'](function(){if(config[_0xb102('0xe')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0xb102('0xf')]();})['then'](function(){return rpc['listen']();})[_0xb102('0x10')](function(_0x19f257){logger['info'](_0x19f257);return chat[_0xb102('0x11')]();})[_0xb102('0x10')](function(){return whatsapp[_0xb102('0x11')]();})[_0xb102('0x10')](function(){return schedule[_0xb102('0x11')]();})[_0xb102('0x10')](function(){return transcribe[_0xb102('0x11')]();})['then'](function(){return provider[_0xb102('0x11')]();})['then'](function(_0x2327ee){logger[_0xb102('0x12')](_0x2327ee);return pm2['start'](pm2Config);})[_0xb102('0x10')](function(_0x38db8c){var _0x5ab722=_0x38db8c[_0xb102('0x13')](function(_0x2925fb){return typeof _0x2925fb[_0xb102('0x14')]==='number'&&_0x2925fb['exitCode']>=0x0;});if(_0x5ab722['length']>0x0){throw new Error(_0x5ab722[_0xb102('0x15')]+_0xb102('0x16')+_[_0xb102('0x17')](_0x5ab722,function(_0xc80615){return'\x22'+_0xc80615['pm2_env']['name']+'\x22';}));}logger[_0xb102('0x12')](_0xb102('0x18'),_[_0xb102('0x17')](_[_0xb102('0x13')](_0x38db8c,{'status':'online'}),'name')[_0xb102('0x19')]());logger[_0xb102('0x12')](_0xb102('0x1a'),_[_0xb102('0x17')](_['filter'](_0x38db8c,function(_0xd2206b){return _0xd2206b[_0xb102('0x1b')]!==_0xb102('0x1c');}),_0xb102('0x1d'))['join']()||'None');console[_0xb102('0x1e')](_0xb102('0x1f'));})['catch'](function(_0x1752f1){console['log'](_0xb102('0x20'),_0x1752f1);logger[_0xb102('0x21')](_0xb102('0x22'),_0x1752f1);process[_0xb102('0x23')](0x1);});}main(); \ No newline at end of file +var _0x0309=['./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','seedDB','default','then','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/seedDB','./rpc'];(function(_0xf5177c,_0x2fe08c){var _0x1ccb6a=function(_0x1aa152){while(--_0x1aa152){_0xf5177c['push'](_0xf5177c['shift']());}};_0x1ccb6a(++_0x2fe08c);}(_0x0309,0x165));var _0x9030=function(_0x1cdaac,_0x4665aa){_0x1cdaac=_0x1cdaac-0x0;var _0x55b1ae=_0x0309[_0x1cdaac];return _0x55b1ae;};'use strict';var _=require(_0x9030('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x9030('0x1'));var checkLicense=require('./config/license');var rpc=require(_0x9030('0x2'));var config=require(_0x9030('0x3'));var logger=require(_0x9030('0x4'))(_0x9030('0x5'));var pm2=require(_0x9030('0x6'));var pm2Config=require(_0x9030('0x7'));var schedule=require(_0x9030('0x8'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x9030('0x9'));var provider=require(_0x9030('0xa'));function main(){return db['sequelize'][_0x9030('0xb')]()['then'](function(){if(config[_0x9030('0xc')]){return seedDb[_0x9030('0xd')]();}})[_0x9030('0xe')](function(){return checkLicense['default']();})[_0x9030('0xe')](function(){return rpc[_0x9030('0xf')]();})[_0x9030('0xe')](function(_0x53ef39){logger[_0x9030('0x10')](_0x53ef39);return chat[_0x9030('0x11')]();})[_0x9030('0xe')](function(){return whatsapp[_0x9030('0x11')]();})[_0x9030('0xe')](function(){return schedule[_0x9030('0x11')]();})[_0x9030('0xe')](function(){return transcribe['start']();})[_0x9030('0xe')](function(){return provider[_0x9030('0x11')]();})[_0x9030('0xe')](function(_0x45ec2a){logger['info'](_0x45ec2a);return pm2[_0x9030('0x11')](pm2Config);})[_0x9030('0xe')](function(_0x4a7465){var _0x41e659=_0x4a7465[_0x9030('0x12')](function(_0x1615ab){return typeof _0x1615ab[_0x9030('0x13')]===_0x9030('0x14')&&_0x1615ab[_0x9030('0x13')]>=0x0;});if(_0x41e659['length']>0x0){throw new Error(_0x41e659[_0x9030('0x15')]+_0x9030('0x16')+_[_0x9030('0x17')](_0x41e659,function(_0x37afac){return'\x22'+_0x37afac[_0x9030('0x18')][_0x9030('0x19')]+'\x22';}));}logger[_0x9030('0x10')](_0x9030('0x1a'),_[_0x9030('0x17')](_[_0x9030('0x12')](_0x4a7465,{'status':_0x9030('0x1b')}),_0x9030('0x19'))[_0x9030('0x1c')]());logger[_0x9030('0x10')](_0x9030('0x1d'),_[_0x9030('0x17')](_[_0x9030('0x12')](_0x4a7465,function(_0x4b0792){return _0x4b0792['status']!==_0x9030('0x1b');}),_0x9030('0x19'))['join']()||_0x9030('0x1e'));console[_0x9030('0x1f')](_0x9030('0x20'));})[_0x9030('0x21')](function(_0x4c52cb){console[_0x9030('0x1f')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x4c52cb);logger['error'](_0x9030('0x22'),_0x4c52cb);process[_0x9030('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index f93cea6..c423fba 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 _0xb03e=['disposition','then','status','json','unmanaged','Unmanaged.','headers','authorization','authenticate','pass','catch','startsWith','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','Setting','allowedLoginAttempts','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blockDuration','blockedAt','minutes','Invalid\x20API\x20access\x20key','User','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','apiKeyNonce','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','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','splice','encryptString','join','promisify','sign','secret','payload','options','randomBytes','floor','now','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','secrets','session','role','fullname','name','internal','userpic','permissions','md5secret','chatPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','use','user','findOne','params','closed'];(function(_0x3dbd93,_0x1ea5bb){var _0x28a67b=function(_0x3ba8a8){while(--_0x3ba8a8){_0x3dbd93['push'](_0x3dbd93['shift']());}};_0x28a67b(++_0x1ea5bb);}(_0xb03e,0x1eb));var _0xeb03=function(_0x361964,_0x18c5b1){_0x361964=_0x361964-0x0;var _0x329c5f=_0xb03e[_0x361964];return _0x329c5f;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xeb03('0x0'));var hardwareConf=require(_0xeb03('0x1'));var licenseUtil=require(_0xeb03('0x2'));var encryptor=require(_0xeb03('0x3'));var _=require(_0xeb03('0x4'));var jwt=require(_0xeb03('0x5'));var expressJwt=require(_0xeb03('0x6'));var compose=require(_0xeb03('0x7'));var basicAuth=require(_0xeb03('0x8'));var crypto=require(_0xeb03('0x9'));var BPromise=require(_0xeb03('0xa'));var util=require(_0xeb03('0xb'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xeb03('0xc')][_0xeb03('0xd')]});var userAttributes=['id',_0xeb03('0xe'),_0xeb03('0xf'),_0xeb03('0x10'),_0xeb03('0x11'),'email',_0xeb03('0x12'),_0xeb03('0x13'),_0xeb03('0x14'),'voicePause',_0xeb03('0x15'),'mailPause',_0xeb03('0x16'),_0xeb03('0x17'),_0xeb03('0x18'),_0xeb03('0x19'),_0xeb03('0x1a'),_0xeb03('0x1b'),_0xeb03('0x1c'),_0xeb03('0x1d'),_0xeb03('0x1e'),_0xeb03('0x1f'),_0xeb03('0x20'),_0xeb03('0x21'),'phoneBarAutoAnswerDelay',_0xeb03('0x22'),_0xeb03('0x23'),_0xeb03('0x24'),_0xeb03('0x25'),'phoneBarExpires',_0xeb03('0x26'),_0xeb03('0x27'),_0xeb03('0x28'),'hotdesk',_0xeb03('0x29'),_0xeb03('0x2a'),_0xeb03('0x2b'),_0xeb03('0x2c'),_0xeb03('0x2d'),_0xeb03('0x2e'),_0xeb03('0x2f'),_0xeb03('0x30'),_0xeb03('0x31'),_0xeb03('0x32'),_0xeb03('0x33'),_0xeb03('0x34'),_0xeb03('0x35'),_0xeb03('0x36'),'smsAutoanswer',_0xeb03('0x37'),_0xeb03('0x38'),_0xeb03('0x39'),_0xeb03('0x3a'),_0xeb03('0x3b'),_0xeb03('0x3c'),_0xeb03('0x3d'),_0xeb03('0x3e')];exports[_0xeb03('0x3f')]=function(){return this['isAuthenticated'](!![])[_0xeb03('0x40')](function(_0x1707ec,_0x11ea85,_0x300dc0){if(_0x1707ec[_0xeb03('0x41')]){_0x300dc0();}else{return db['ChatInteraction'][_0xeb03('0x42')]({'where':{'id':_0x1707ec[_0xeb03('0x43')]['id']},'attributes':['id',_0xeb03('0x44'),_0xeb03('0x45')],'raw':!![]})[_0xeb03('0x46')](function(_0x119697){if(_0x119697&&_0x119697[_0xeb03('0x44')]){return _0x11ea85[_0xeb03('0x47')](_0x119697[_0xeb03('0x45')]==='unmanaged'?0x195:0x193)[_0xeb03('0x48')]({'message':_0x119697[_0xeb03('0x45')]===_0xeb03('0x49')?_0xeb03('0x4a'):'Forbidden.'});}else{_0x300dc0();}})['catch'](function(_0x1064a5){_0x300dc0(_0x1064a5);});}});};exports['isAuthenticated']=function isAuthenticated(_0x31a622){return compose()[_0xeb03('0x40')](function(_0x160a37,_0x5db8bb,_0xd4c8ec){var _0x5de53a;if(_0x160a37['headers']['authorization']){if(_['startsWith'](_0x160a37[_0xeb03('0x4b')][_0xeb03('0x4c')],'Basic')){var _0x528479=basicAuth(_0x160a37);db['User']['find']({'where':{'name':_0x528479[_0xeb03('0x10')]}})[_0xeb03('0x46')](function(_0x32aff7){if(!_0x32aff7||!_0x32aff7[_0xeb03('0x4d')](_0x528479[_0xeb03('0x4e')])){return _0x5db8bb['status'](0x191)[_0xeb03('0x48')]({'message':'Wrong\x20credentials.'});}_0x160a37[_0xeb03('0x41')]={'id':_0x32aff7['id']};_0xd4c8ec();})[_0xeb03('0x4f')](function(_0x19ceae){_0xd4c8ec(_0x19ceae);});}else if(_[_0xeb03('0x50')](_0x160a37[_0xeb03('0x4b')][_0xeb03('0x4c')],_0xeb03('0x51'))){validateJwt(_0x160a37,_0x5db8bb,_0xd4c8ec);}else{if(_0x31a622){_0xd4c8ec();}else{return _0x5db8bb[_0xeb03('0x47')](0x193)['json']({'message':_0xeb03('0x52')});}}}else if(_0x160a37['query'][_0xeb03('0x53')]){try{var _0xe3c81a={'audience':hardwareConf[_0xeb03('0x54')](),'issuer':hardwareConf[_0xeb03('0x54')]()};verifyJwt(_0x160a37[_0xeb03('0x55')][_0xeb03('0x53')],_0xe3c81a)['then'](function(_0x155b53){return db['User']['find']({'where':{'id':_0x155b53['sub']}})[_0xeb03('0x46')](function(_0x452868){_0x5de53a=_0x452868;return db[_0xeb03('0x56')][_0xeb03('0x42')]({'where':{'id':0x1},'attributes':[_0xeb03('0x57'),'blockDuration'],'raw':!![]});})[_0xeb03('0x46')](function(_0x166562){if(!_0x5de53a||!_[_0xeb03('0x58')](_0x5de53a['apiKeyNonce'],_0x155b53['nonce'])){return _0x5db8bb[_0xeb03('0x47')](0x191)[_0xeb03('0x48')]({'message':_0xeb03('0x59')});}if(_0x5de53a['disabled']){return _0x5db8bb[_0xeb03('0x47')](0x191)[_0xeb03('0x48')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x5de53a['blocked']){if(_0x166562[_0xeb03('0x5a')]>0x0){if(moment(_0x5de53a[_0xeb03('0x5b')])['add'](_0x166562[_0xeb03('0x5a')],_0xeb03('0x5c'))>moment()){return _0x5db8bb[_0xeb03('0x47')](0x191)[_0xeb03('0x48')]({'message':_0xeb03('0x5d')});}}else{return _0x5db8bb[_0xeb03('0x47')](0x191)[_0xeb03('0x48')]({'message':_0xeb03('0x5d')});}}_0x160a37[_0xeb03('0x41')]={'id':_0x5de53a['id']};_0xd4c8ec();});})[_0xeb03('0x4f')](function(){return _0x5db8bb[_0xeb03('0x47')](0x191)[_0xeb03('0x48')]({'message':_0xeb03('0x5d')});});}catch(_0x33414d){_0xd4c8ec(_0x33414d);}}else if(_0x31a622){_0xd4c8ec();}else{return _0x5db8bb[_0xeb03('0x47')](0x193)[_0xeb03('0x48')]({'message':_0xeb03('0x52')});}})[_0xeb03('0x40')](function(_0x35e53d,_0x138d13,_0x43e530){if(_0x35e53d[_0xeb03('0x41')]){db[_0xeb03('0x5e')]['find']({'where':{'id':_0x35e53d['user']['id']},'attributes':userAttributes})[_0xeb03('0x46')](function(_0x2262b7){if(!_0x2262b7){return _0x138d13[_0xeb03('0x47')](0x194)[_0xeb03('0x48')]({'message':_0xeb03('0x5f')});}_0x35e53d[_0xeb03('0x41')]=_0x2262b7;_0x43e530();})[_0xeb03('0x4f')](function(_0xcd049b){_0x43e530(_0xcd049b);});}else if(_0x31a622){_0x43e530();}else{return _0x138d13['status'](0x194)[_0xeb03('0x48')]({'message':_0xeb03('0x60')});}});};exports[_0xeb03('0x61')]=function canUpdate(){return compose()[_0xeb03('0x40')](function(_0x528c0f,_0x57f59e,_0x4ef29c){return licenseUtil[_0xeb03('0x62')]()['then'](function(_0x5bcc30){if(_0x5bcc30['update']){_0x4ef29c();}else{return _0x57f59e[_0xeb03('0x47')](0x193)[_0xeb03('0x48')]({'message':_0xeb03('0x63')});}})[_0xeb03('0x4f')](function(_0xb321da){_0x4ef29c(_0xb321da);});});};exports[_0xeb03('0x64')]=function isWebrtcLicence(){return compose()['use'](function(_0x35279d,_0x4bf739,_0x5c4fac){return licenseUtil[_0xeb03('0x62')]()[_0xeb03('0x46')](function(_0x205fa3){if(_0x205fa3['webrtc']){_0x5c4fac();}else{return _0x4bf739[_0xeb03('0x47')](0x193)[_0xeb03('0x48')]({'message':_0xeb03('0x63')});}})[_0xeb03('0x4f')](function(_0x3c8293){_0x5c4fac(_0x3c8293);});});};exports['isMiddleware']=function(_0x21a121,_0x4dc1f6,_0x13c295){_0x21a121[_0xeb03('0x65')]=!![];return _0x13c295();};exports[_0xeb03('0x66')]=function signToken(_0xa90a33){return signJwt(_0xa90a33);};exports[_0xeb03('0x67')]=function(_0x46f4a7,_0x42e73f){if(!_0x46f4a7[_0xeb03('0x41')]){return _0x42e73f[_0xeb03('0x47')](0x194)[_0xeb03('0x48')]({'message':_0xeb03('0x68')});}var _0x10ef7d={'payload':{'id':_0x46f4a7[_0xeb03('0x41')]['id'],'role':_0x46f4a7[_0xeb03('0x41')][_0xeb03('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x10ef7d)[_0xeb03('0x46')](function(_0xf5c1ab){_0x42e73f[_0xeb03('0x69')](_0xeb03('0x6a'),_0xf5c1ab);_0x42e73f[_0xeb03('0x6b')](_0xeb03('0x6c'));})[_0xeb03('0x4f')](function(_0x1761ab){return _0x42e73f[_0xeb03('0x47')](0x1f4)['send'](_0x1761ab);});};exports[_0xeb03('0x6d')]=function(_0x17bf76){if(_[_0xeb03('0x6e')](_0x17bf76['apiKeyNonce'])||_[_0xeb03('0x6e')](_0x17bf76[_0xeb03('0x6f')])){return null;}else{return createJwt(_0x17bf76);}};exports[_0xeb03('0x70')]=function(_0xf7e2b){_0xf7e2b[_0xeb03('0x71')]=generateNonce();_0xf7e2b[_0xeb03('0x6f')]=generateIssuedAt();return createJwt(_0xf7e2b);};exports[_0xeb03('0x72')]=function(_0x36f18e,_0x1fe50a){var _0x3bd612=_0x36f18e[_0xeb03('0x55')][_0xeb03('0x53')];if(_0x3bd612){var _0xf9beaf={'nonce':_0x1fe50a[_0xeb03('0x71')],'iat':_0x1fe50a['apiKeyIat'],'audience':hardwareConf[_0xeb03('0x54')](),'issuer':hardwareConf[_0xeb03('0x54')]()};return verifyJwt(_0x3bd612,_0xf9beaf)[_0xeb03('0x46')](function(){return generateApiKey(_0x1fe50a);});}else{throw{'message':_0xeb03('0x73')};}};exports[_0xeb03('0x74')]=function(_0x39e2c7){var _0x4320f7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4320f7[_0xeb03('0x75')](_0x39e2c7))throw new db[(_0xeb03('0x76'))][(_0xeb03('0x77'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xeb03('0x78')]=function(_0x3a1cd2,_0x2bb0be,_0x62105a){var _0x58c096=encryptor[_0xeb03('0x79')](_0x2bb0be)[_0xeb03('0x7a')](',');for(var _0x2130c2=0x0;_0x2130c2<_0x62105a;_0x2130c2++){if(!_0x58c096[_0x2130c2])break;if(_0x3a1cd2[_0xeb03('0x7b')]()===_0x58c096[_0x2130c2][_0xeb03('0x7b')]()){var _0x4aa96e=util[_0xeb03('0x7c')](_0xeb03('0x7d'),_0x62105a);if(_0x62105a===0x1){_0x4aa96e=_0xeb03('0x7e');}throw new db['Sequelize'][(_0xeb03('0x77'))](_0x4aa96e);}}return;};exports[_0xeb03('0x7f')]=function(_0x4d9cfc,_0x1f6117){var _0x3102e3=_0x1f6117?encryptor[_0xeb03('0x79')](_0x1f6117)['split'](','):[];if(_0x3102e3[_0xeb03('0x80')]===0x5){_0x3102e3[_0xeb03('0x81')](-0x1,0x1);}_0x3102e3['unshift'](_0x4d9cfc);return encryptor[_0xeb03('0x82')](_0x3102e3[_0xeb03('0x83')](','));};function signJwt(_0x1972fb){var _0x3ac2de=BPromise[_0xeb03('0x84')](jwt[_0xeb03('0x85')],{'context':jwt});var _0x218ea5=_0x1972fb[_0xeb03('0x86')]||config['secrets'][_0xeb03('0xd')];return new BPromise(function(_0x50489b,_0xbcc043){_0x3ac2de(_0x1972fb[_0xeb03('0x87')],_0x218ea5,_0x1972fb[_0xeb03('0x88')])['then'](function(_0x1bd1b3){_0x50489b(_0x1bd1b3);})[_0xeb03('0x4f')](function(_0x14866f){_0xbcc043(_0x14866f);});});}function verifyJwt(_0x467a9d,_0x47c389,_0x3fe855){var _0x1cdf8e=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x583518=_0x3fe855||config[_0xeb03('0xc')][_0xeb03('0xd')];return new BPromise(function(_0x9148a6,_0x16ad3a){_0x1cdf8e(_0x467a9d,_0x583518,_0x47c389)[_0xeb03('0x46')](function(_0x461777){_0x9148a6(_0x461777);})[_0xeb03('0x4f')](function(_0x240178){_0x16ad3a(_0x240178);});});}function generateNonce(){return crypto[_0xeb03('0x89')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0xeb03('0x8a')](Date[_0xeb03('0x8b')]()/0x3e8)['toString']();}function createJwt(_0x1c9851){var _0x3e003d={'payload':{'iat':_0x1c9851[_0xeb03('0x6f')],'nonce':_0x1c9851[_0xeb03('0x71')]},'options':{'algorithm':'HS512','subject':_0x1c9851['id']['toString'](),'issuer':hardwareConf[_0xeb03('0x54')](),'audience':hardwareConf[_0xeb03('0x54')]()}};return signJwt(_0x3e003d)[_0xeb03('0x46')](function(_0x50c482){return{'iat':_0x1c9851[_0xeb03('0x6f')],'nonce':_0x1c9851[_0xeb03('0x71')],'token':_0x50c482};});} \ No newline at end of file +var _0x757a=['isAuthenticated','use','user','ChatInteraction','params','disposition','closed','status','unmanaged','json','Forbidden.','headers','startsWith','Basic','User','find','then','authenticate','pass','Wrong\x20credentials.','catch','authorization','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','format','ValidationError','updatePasswordsHistory','length','splice','unshift','promisify','sign','secret','session','payload','options','verify','randomBytes','hex','floor','toString','HS512','../../config/environment','../../config/license/hardware','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','role','fullname','name','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','crudPermissions','alias','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','privacyEnabled','settingsEnabled','wssPort','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswer','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized'];(function(_0x53b1f8,_0x303433){var _0x288960=function(_0x136a4c){while(--_0x136a4c){_0x53b1f8['push'](_0x53b1f8['shift']());}};_0x288960(++_0x303433);}(_0x757a,0xde));var _0xa757=function(_0x39aa2d,_0x364f79){_0x39aa2d=_0x39aa2d-0x0;var _0x3a0094=_0x757a[_0x39aa2d];return _0x3a0094;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xa757('0x0'));var hardwareConf=require(_0xa757('0x1'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require('lodash');var jwt=require(_0xa757('0x2'));var expressJwt=require(_0xa757('0x3'));var compose=require(_0xa757('0x4'));var basicAuth=require(_0xa757('0x5'));var crypto=require(_0xa757('0x6'));var BPromise=require(_0xa757('0x7'));var util=require('util');var moment=require(_0xa757('0x8'));var validateJwt=expressJwt({'secret':config[_0xa757('0x9')]['session']});var userAttributes=['id',_0xa757('0xa'),_0xa757('0xb'),_0xa757('0xc'),_0xa757('0xd'),_0xa757('0xe'),'userpic',_0xa757('0xf'),_0xa757('0x10'),_0xa757('0x11'),_0xa757('0x12'),_0xa757('0x13'),_0xa757('0x14'),_0xa757('0x15'),'openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt',_0xa757('0x16'),'allowmessenger','passwordResetAt',_0xa757('0x17'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay',_0xa757('0x18'),_0xa757('0x19'),_0xa757('0x1a'),_0xa757('0x1b'),_0xa757('0x1c'),_0xa757('0x1d'),_0xa757('0x1e'),_0xa757('0x1f'),_0xa757('0x20'),_0xa757('0x21'),'userProfileId',_0xa757('0x22'),_0xa757('0x23'),_0xa757('0x24'),'downloadVoiceRecordings','downloadOmnichannelInteractions',_0xa757('0x25'),_0xa757('0x26'),_0xa757('0x27'),_0xa757('0x28'),_0xa757('0x29'),_0xa757('0x2a'),'emailAutoanswerDelay',_0xa757('0x2b'),'smsAutoanswerDelay',_0xa757('0x2c'),_0xa757('0x2d'),_0xa757('0x2e'),_0xa757('0x2f'),'whatsappAutoanswer','whatsappAutoanswerDelay',_0xa757('0x30')];exports[_0xa757('0x31')]=function(){return this[_0xa757('0x32')](!![])[_0xa757('0x33')](function(_0x1d6e2,_0x40562f,_0x2ca10d){if(_0x1d6e2[_0xa757('0x34')]){_0x2ca10d();}else{return db[_0xa757('0x35')]['findOne']({'where':{'id':_0x1d6e2[_0xa757('0x36')]['id']},'attributes':['id','closed',_0xa757('0x37')],'raw':!![]})['then'](function(_0x40551d){if(_0x40551d&&_0x40551d[_0xa757('0x38')]){return _0x40562f[_0xa757('0x39')](_0x40551d['disposition']===_0xa757('0x3a')?0x195:0x193)[_0xa757('0x3b')]({'message':_0x40551d[_0xa757('0x37')]===_0xa757('0x3a')?'Unmanaged.':_0xa757('0x3c')});}else{_0x2ca10d();}})['catch'](function(_0x5a5664){_0x2ca10d(_0x5a5664);});}});};exports['isAuthenticated']=function isAuthenticated(_0x4f8de2){return compose()[_0xa757('0x33')](function(_0x596ae2,_0x2208f9,_0x3bc24c){var _0x55c5f8;if(_0x596ae2[_0xa757('0x3d')]['authorization']){if(_[_0xa757('0x3e')](_0x596ae2[_0xa757('0x3d')]['authorization'],_0xa757('0x3f'))){var _0x5ade7b=basicAuth(_0x596ae2);db[_0xa757('0x40')][_0xa757('0x41')]({'where':{'name':_0x5ade7b[_0xa757('0xc')]}})[_0xa757('0x42')](function(_0xcc87c0){if(!_0xcc87c0||!_0xcc87c0[_0xa757('0x43')](_0x5ade7b[_0xa757('0x44')])){return _0x2208f9[_0xa757('0x39')](0x191)[_0xa757('0x3b')]({'message':_0xa757('0x45')});}_0x596ae2[_0xa757('0x34')]={'id':_0xcc87c0['id']};_0x3bc24c();})[_0xa757('0x46')](function(_0x25dfbb){_0x3bc24c(_0x25dfbb);});}else if(_[_0xa757('0x3e')](_0x596ae2[_0xa757('0x3d')][_0xa757('0x47')],_0xa757('0x48'))){validateJwt(_0x596ae2,_0x2208f9,_0x3bc24c);}else{if(_0x4f8de2){_0x3bc24c();}else{return _0x2208f9[_0xa757('0x39')](0x193)[_0xa757('0x3b')]({'message':_0xa757('0x49')});}}}else if(_0x596ae2[_0xa757('0x4a')][_0xa757('0x4b')]){try{var _0x379de7={'audience':hardwareConf[_0xa757('0x4c')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x596ae2[_0xa757('0x4a')][_0xa757('0x4b')],_0x379de7)[_0xa757('0x42')](function(_0x1794a9){return db[_0xa757('0x40')]['find']({'where':{'id':_0x1794a9[_0xa757('0x4d')]}})[_0xa757('0x42')](function(_0x37b1a3){_0x55c5f8=_0x37b1a3;return db[_0xa757('0x4e')][_0xa757('0x4f')]({'where':{'id':0x1},'attributes':[_0xa757('0x50'),'blockDuration'],'raw':!![]});})[_0xa757('0x42')](function(_0x444639){if(!_0x55c5f8||!_[_0xa757('0x51')](_0x55c5f8[_0xa757('0x52')],_0x1794a9[_0xa757('0x53')])){return _0x2208f9[_0xa757('0x39')](0x191)[_0xa757('0x3b')]({'message':_0xa757('0x54')});}if(_0x55c5f8[_0xa757('0x55')]){return _0x2208f9['status'](0x191)[_0xa757('0x3b')]({'message':_0xa757('0x56')});}if(_0x55c5f8[_0xa757('0x57')]){if(_0x444639[_0xa757('0x58')]>0x0){if(moment(_0x55c5f8[_0xa757('0x59')])[_0xa757('0x5a')](_0x444639['blockDuration'],_0xa757('0x5b'))>moment()){return _0x2208f9[_0xa757('0x39')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x2208f9[_0xa757('0x39')](0x191)[_0xa757('0x3b')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x596ae2['user']={'id':_0x55c5f8['id']};_0x3bc24c();});})[_0xa757('0x46')](function(){return _0x2208f9[_0xa757('0x39')](0x191)[_0xa757('0x3b')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x830dc4){_0x3bc24c(_0x830dc4);}}else if(_0x4f8de2){_0x3bc24c();}else{return _0x2208f9[_0xa757('0x39')](0x193)[_0xa757('0x3b')]({'message':_0xa757('0x49')});}})[_0xa757('0x33')](function(_0x4c6639,_0x1f9af,_0x52c728){if(_0x4c6639['user']){db[_0xa757('0x40')][_0xa757('0x41')]({'where':{'id':_0x4c6639[_0xa757('0x34')]['id']},'attributes':userAttributes})[_0xa757('0x42')](function(_0x9a0934){if(!_0x9a0934){return _0x1f9af['status'](0x194)['json']({'message':_0xa757('0x5c')});}_0x4c6639[_0xa757('0x34')]=_0x9a0934;_0x52c728();})[_0xa757('0x46')](function(_0xe03a3c){_0x52c728(_0xe03a3c);});}else if(_0x4f8de2){_0x52c728();}else{return _0x1f9af[_0xa757('0x39')](0x194)[_0xa757('0x3b')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xa757('0x5d')]=function canUpdate(){return compose()[_0xa757('0x33')](function(_0x4d66d4,_0x40e291,_0x515123){return licenseUtil[_0xa757('0x5e')]()[_0xa757('0x42')](function(_0x4cf90f){if(_0x4cf90f[_0xa757('0x5f')]){_0x515123();}else{return _0x40e291[_0xa757('0x39')](0x193)['json']({'message':_0xa757('0x60')});}})[_0xa757('0x46')](function(_0x27ae35){_0x515123(_0x27ae35);});});};exports[_0xa757('0x61')]=function isWebrtcLicence(){return compose()['use'](function(_0x199dc9,_0x1be3bb,_0x450815){return licenseUtil[_0xa757('0x5e')]()['then'](function(_0xd4c1b){if(_0xd4c1b['webrtc']){_0x450815();}else{return _0x1be3bb['status'](0x193)[_0xa757('0x3b')]({'message':_0xa757('0x60')});}})[_0xa757('0x46')](function(_0x5e13cf){_0x450815(_0x5e13cf);});});};exports[_0xa757('0x62')]=function(_0x560c6c,_0x2ed63f,_0x151cc3){_0x560c6c[_0xa757('0x62')]=!![];return _0x151cc3();};exports[_0xa757('0x63')]=function signToken(_0x18b0ca){return signJwt(_0x18b0ca);};exports[_0xa757('0x64')]=function(_0x57bf73,_0x505cd){if(!_0x57bf73['user']){return _0x505cd[_0xa757('0x39')](0x194)[_0xa757('0x3b')]({'message':_0xa757('0x65')});}var _0x29434d={'payload':{'id':_0x57bf73[_0xa757('0x34')]['id'],'role':_0x57bf73[_0xa757('0x34')][_0xa757('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x29434d)[_0xa757('0x42')](function(_0x405397){_0x505cd[_0xa757('0x66')](_0xa757('0x67'),_0x405397);_0x505cd[_0xa757('0x68')](_0xa757('0x69'));})[_0xa757('0x46')](function(_0x388573){return _0x505cd[_0xa757('0x39')](0x1f4)['send'](_0x388573);});};exports[_0xa757('0x6a')]=function(_0x51157e){if(_[_0xa757('0x6b')](_0x51157e[_0xa757('0x52')])||_[_0xa757('0x6b')](_0x51157e[_0xa757('0x6c')])){return null;}else{return createJwt(_0x51157e);}};exports['generateApiKey']=function(_0x35cd81){_0x35cd81[_0xa757('0x52')]=generateNonce();_0x35cd81[_0xa757('0x6c')]=generateIssuedAt();return createJwt(_0x35cd81);};exports[_0xa757('0x6d')]=function(_0x595f16,_0x383674){var _0x2df5e1=_0x595f16[_0xa757('0x4a')][_0xa757('0x4b')];if(_0x2df5e1){var _0x33666d={'nonce':_0x383674[_0xa757('0x52')],'iat':_0x383674['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x2df5e1,_0x33666d)['then'](function(){return generateApiKey(_0x383674);});}else{throw{'message':_0xa757('0x6e')};}};exports[_0xa757('0x6f')]=function(_0x137477){var _0x32313b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x32313b[_0xa757('0x70')](_0x137477))throw new db[(_0xa757('0x71'))]['ValidationError'](_0xa757('0x72'));return;};exports[_0xa757('0x73')]=function(_0x34e03f,_0x29b2f5,_0x48b578){var _0x26c74e=encryptor[_0xa757('0x74')](_0x29b2f5)['split'](',');for(var _0x39699d=0x0;_0x39699d<_0x48b578;_0x39699d++){if(!_0x26c74e[_0x39699d])break;if(_0x34e03f['toLowerCase']()===_0x26c74e[_0x39699d][_0xa757('0x75')]()){var _0x5d375c=util[_0xa757('0x76')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x48b578);if(_0x48b578===0x1){_0x5d375c='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xa757('0x71'))][(_0xa757('0x77'))](_0x5d375c);}}return;};exports[_0xa757('0x78')]=function(_0x1b5db5,_0x14e226){var _0xc5ae37=_0x14e226?encryptor['decryptString'](_0x14e226)['split'](','):[];if(_0xc5ae37[_0xa757('0x79')]===0x5){_0xc5ae37[_0xa757('0x7a')](-0x1,0x1);}_0xc5ae37[_0xa757('0x7b')](_0x1b5db5);return encryptor['encryptString'](_0xc5ae37['join'](','));};function signJwt(_0x18dff7){var _0x31c4cd=BPromise[_0xa757('0x7c')](jwt[_0xa757('0x7d')],{'context':jwt});var _0x12b802=_0x18dff7[_0xa757('0x7e')]||config['secrets'][_0xa757('0x7f')];return new BPromise(function(_0x45f2a4,_0x415fe1){_0x31c4cd(_0x18dff7[_0xa757('0x80')],_0x12b802,_0x18dff7[_0xa757('0x81')])[_0xa757('0x42')](function(_0x213219){_0x45f2a4(_0x213219);})[_0xa757('0x46')](function(_0xb45477){_0x415fe1(_0xb45477);});});}function verifyJwt(_0x3b1bb8,_0x5d3219,_0x9e96e6){var _0x5c803a=BPromise['promisify'](jwt[_0xa757('0x82')],{'context':jwt});var _0x3da8c1=_0x9e96e6||config[_0xa757('0x9')][_0xa757('0x7f')];return new BPromise(function(_0x3c3ff1,_0x3672a7){_0x5c803a(_0x3b1bb8,_0x3da8c1,_0x5d3219)[_0xa757('0x42')](function(_0x32e0b9){_0x3c3ff1(_0x32e0b9);})[_0xa757('0x46')](function(_0x22a185){_0x3672a7(_0x22a185);});});}function generateNonce(){return crypto[_0xa757('0x83')](0x10)['toString'](_0xa757('0x84'));}function generateIssuedAt(){return Math[_0xa757('0x85')](Date['now']()/0x3e8)[_0xa757('0x86')]();}function createJwt(_0x409ee9){var _0x198a11={'payload':{'iat':_0x409ee9[_0xa757('0x6c')],'nonce':_0x409ee9[_0xa757('0x52')]},'options':{'algorithm':_0xa757('0x87'),'subject':_0x409ee9['id']['toString'](),'issuer':hardwareConf[_0xa757('0x4c')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x198a11)[_0xa757('0x42')](function(_0x3250d0){return{'iat':_0x409ee9[_0xa757('0x6c')],'nonce':_0x409ee9[_0xa757('0x52')],'token':_0x3250d0};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 5c37a3f..ad12b5c 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 _0xd478=['user','skip','tag','countFilteredContacts','count','User','buildContactsQuery','fields','getFilteredContacts','rows','describe','CmContact','cf_','map','CmCustomField','slice','all','length','type','catch','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseQueryParameters','where','default','filter','tags'];(function(_0x89bb8e,_0x2a429f){var _0x11df0d=function(_0x44dc52){while(--_0x44dc52){_0x89bb8e['push'](_0x89bb8e['shift']());}};_0x11df0d(++_0x2a429f);}(_0xd478,0x9c));var _0x8d47=function(_0x1eac9b,_0x24bf2f){_0x1eac9b=_0x1eac9b-0x0;var _0x33dfd6=_0xd478[_0x1eac9b];return _0x33dfd6;};'use strict';var _=require(_0x8d47('0x0'));var sqlUtils=require(_0x8d47('0x1'));var db=require(_0x8d47('0x2'))['db'];exports[_0x8d47('0x3')]=function(_0x414dde,_0x4f15ca,_0x2b7f87,_0xb41367){var _0x71ae3d={'count':0x0,'rows':[]};var _0x5cbb10=sqlUtils[_0x8d47('0x4')](_0x4f15ca,_0x414dde);if(_0x5cbb10){return Promise[_0x8d47('0x5')](_0x71ae3d);}var _0x3b37d4=sqlUtils[_0x8d47('0x6')]();var _0x511bae={};var _0x3cfe2f=![];var _0x5a6b3d=![];return Promise[_0x8d47('0x5')]()[_0x8d47('0x7')](function(){if(_0x414dde[_0x8d47('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x414dde[_0x8d47('0x8')],_0xb41367);}else{return sqlUtils[_0x8d47('0x9')](_0x414dde,_0xb41367);}})[_0x8d47('0x7')](function(_0x2db3a7){_0x3b37d4[_0x8d47('0xa')](_0x2db3a7[_0x8d47('0xb')]);_0x3b37d4[_0x8d47('0xa')](_0x2db3a7['fields']);_0x3b37d4[_0x8d47('0xa')](_0x2db3a7[_0x8d47('0xc')]);_0x3b37d4[_0x8d47('0xa')](_0x2db3a7['user']['clause']);_0x511bae=_0x2db3a7[_0x8d47('0xd')];_0x5a6b3d=_0x2db3a7[_0x8d47('0xe')][_0x8d47('0xf')];return sqlUtils['checkListsRestrictions'](_0x4f15ca,_0x414dde,_0x5a6b3d);})[_0x8d47('0x7')](function(_0x500975){_0x3b37d4['where'](_0x500975);var _0x901ea5=_0x414dde[_0x8d47('0x8')]?_0x511bae['ids']:_0x414dde[_0x8d47('0x10')];_0x3cfe2f=_0x901ea5?!![]:![];return sqlUtils[_0x8d47('0x11')](_0x3b37d4,_0x901ea5);})[_0x8d47('0x7')](function(_0x365fd9){_0x71ae3d[_0x8d47('0x12')]=_0x365fd9;if(_0x71ae3d[_0x8d47('0x12')]===0x0){return;}if(_0x414dde[_0x8d47('0x13')]){_0x5a6b3d=!![];}return sqlUtils[_0x8d47('0x14')](_0x3b37d4,_0x414dde[_0x8d47('0x15')],_0x2b7f87,_0x3cfe2f,_0x511bae['clause'],_0x5a6b3d);})[_0x8d47('0x7')](function(_0x5ab229){if(!_0x5ab229){return[];}return sqlUtils[_0x8d47('0x16')](_0x5ab229,_0x414dde,_0x2b7f87);})[_0x8d47('0x7')](function(_0x5cecfc){_0x71ae3d[_0x8d47('0x17')]=_0x5cecfc;return _0x71ae3d;})['catch'](function(_0x275922){throw _0x275922;});};exports[_0x8d47('0x18')]=function(){var _0x387eb4={};var _0x4eb74a=[];return db[_0x8d47('0x19')][_0x8d47('0x18')]()[_0x8d47('0x7')](function(_0x30f4ef){_0x387eb4=_0x30f4ef;var _0x58df71=Object['keys'](_0x387eb4)[_0x8d47('0xc')](function(_0x2b14f9){return _['startsWith'](_0x2b14f9,_0x8d47('0x1a'))?_0x2b14f9:undefined;});var _0x1e5907=_0x58df71[_0x8d47('0x1b')](function(_0x366c07){return db[_0x8d47('0x1c')]['findOne']({'where':{'id':_0x366c07[_0x8d47('0x1d')](0x3)},'raw':!![]});});return Promise[_0x8d47('0x1e')](_0x1e5907);})[_0x8d47('0x7')](function(_0x10554d){for(var _0x3ed8e9=0x0;_0x3ed8e9<_0x10554d[_0x8d47('0x1f')];_0x3ed8e9++){if(_0x10554d[_0x3ed8e9]){var _0x386220='cf_'+_0x10554d[_0x3ed8e9]['id'];_0x387eb4[_0x386220]['fieldType']=_0x10554d[_0x3ed8e9][_0x8d47('0x20')];}}_0x4eb74a=_[_0x8d47('0x1b')](Object['keys'](_0x387eb4),function(_0x295765){return{'name':_0x295765,'type':_0x387eb4[_0x295765][_0x8d47('0x20')]};});return _0x4eb74a;})[_0x8d47('0x21')](function(_0xa391e6){throw _0xa391e6;});}; \ No newline at end of file +var _0x939e=['parseQueryParameters','where','default','fields','user','skip','tag','countFilteredContacts','count','User','buildContactsQuery','clause','rows','catch','describe','CmContact','keys','filter','cf_','map','CmCustomField','all','length','type','lodash','../../mysqldb','findAll','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter'];(function(_0x19583e,_0x17ba74){var _0x496ebb=function(_0x3739d2){while(--_0x3739d2){_0x19583e['push'](_0x19583e['shift']());}};_0x496ebb(++_0x17ba74);}(_0x939e,0x158));var _0xe939=function(_0x4014e5,_0x125e6a){_0x4014e5=_0x4014e5-0x0;var _0x4ee8b7=_0x939e[_0x4014e5];return _0x4ee8b7;};'use strict';var _=require(_0xe939('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xe939('0x1'))['db'];exports[_0xe939('0x2')]=function(_0x519576,_0x1b79dc,_0xd1eaec,_0x37f990){var _0x309db0={'count':0x0,'rows':[]};var _0xcb9ccb=sqlUtils['skipContactsQuery'](_0x1b79dc,_0x519576);if(_0xcb9ccb){return Promise[_0xe939('0x3')](_0x309db0);}var _0x2a255a=sqlUtils[_0xe939('0x4')]();var _0x672164={};var _0x248d69=![];var _0x128abf=![];return Promise['resolve']()[_0xe939('0x5')](function(){if(_0x519576[_0xe939('0x6')]){return sqlUtils[_0xe939('0x7')](_0x519576[_0xe939('0x6')],_0x37f990);}else{return sqlUtils[_0xe939('0x8')](_0x519576,_0x37f990);}})[_0xe939('0x5')](function(_0x2dfa06){_0x2a255a[_0xe939('0x9')](_0x2dfa06[_0xe939('0xa')]);_0x2a255a[_0xe939('0x9')](_0x2dfa06[_0xe939('0xb')]);_0x2a255a['where'](_0x2dfa06['filter']);_0x2a255a['where'](_0x2dfa06[_0xe939('0xc')]['clause']);_0x672164=_0x2dfa06['tags'];_0x128abf=_0x2dfa06[_0xe939('0xc')][_0xe939('0xd')];return sqlUtils['checkListsRestrictions'](_0x1b79dc,_0x519576,_0x128abf);})[_0xe939('0x5')](function(_0x1d4ffa){_0x2a255a[_0xe939('0x9')](_0x1d4ffa);var _0x753ed6=_0x519576['search']?_0x672164['ids']:_0x519576[_0xe939('0xe')];_0x248d69=_0x753ed6?!![]:![];return sqlUtils[_0xe939('0xf')](_0x2a255a,_0x753ed6);})[_0xe939('0x5')](function(_0x55a6b8){_0x309db0[_0xe939('0x10')]=_0x55a6b8;if(_0x309db0[_0xe939('0x10')]===0x0){return;}if(_0x519576[_0xe939('0x11')]){_0x128abf=!![];}return sqlUtils[_0xe939('0x12')](_0x2a255a,_0x519576['fields'],_0xd1eaec,_0x248d69,_0x672164[_0xe939('0x13')],_0x128abf);})[_0xe939('0x5')](function(_0x27e5ea){if(!_0x27e5ea){return[];}return sqlUtils['getFilteredContacts'](_0x27e5ea,_0x519576,_0xd1eaec);})[_0xe939('0x5')](function(_0x537ca8){_0x309db0[_0xe939('0x14')]=_0x537ca8;return _0x309db0;})[_0xe939('0x15')](function(_0x4933e9){throw _0x4933e9;});};exports[_0xe939('0x16')]=function(){var _0x3f06ab={};var _0xbf6d30=[];return db[_0xe939('0x17')][_0xe939('0x16')]()[_0xe939('0x5')](function(_0xdc29c3){_0x3f06ab=_0xdc29c3;var _0x388aca=Object[_0xe939('0x18')](_0x3f06ab)[_0xe939('0x19')](function(_0x168310){return _['startsWith'](_0x168310,_0xe939('0x1a'))?_0x168310:undefined;});var _0x21b78f=_0x388aca[_0xe939('0x1b')](function(_0x209ca1){return db[_0xe939('0x1c')]['findOne']({'where':{'id':_0x209ca1['slice'](0x3)},'raw':!![]});});return Promise[_0xe939('0x1d')](_0x21b78f);})[_0xe939('0x5')](function(_0x5375b5){for(var _0x25a6dd=0x0;_0x25a6dd<_0x5375b5[_0xe939('0x1e')];_0x25a6dd++){if(_0x5375b5[_0x25a6dd]){var _0x4d6c97=_0xe939('0x1a')+_0x5375b5[_0x25a6dd]['id'];_0x3f06ab[_0x4d6c97]['fieldType']=_0x5375b5[_0x25a6dd][_0xe939('0x1f')];}}_0xbf6d30=_['map'](Object[_0xe939('0x18')](_0x3f06ab),function(_0x32b23f){return{'name':_0x32b23f,'type':_0x3f06ab[_0x32b23f][_0xe939('0x1f')]};});return _0xbf6d30;})[_0xe939('0x15')](function(_0xa3838c){throw _0xa3838c;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 44cd819..6d9ffa5 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 _0x4797=['SELECT','CmContact','query','toString','Tags','COUNT(*)','isEmpty','t.id\x20IN\x20?','QueryTypes','exports','lodash','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','autocomplete','true','select','from','cm_contacts','where','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20','.id','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','fax','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','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','sqlOperator','conditions','find','name','fieldType','datetime','castTo','DATE','buildExpression','type','default','text','value','start','Tag','split','clause','and','tags','user','uc.UserId\x20=\x20?','keys','map','some','compact','User','ListId','concat','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','fields','tag','filter','then','getLists','c.ListId\x20IN\x20?','c.id','limit','offset','group','subqry.id','having','order','subqry.','DESC','findAll','color','keyBy','Sequelize'];(function(_0x3731ce,_0x1c97c1){var _0x4b120c=function(_0x2c7df1){while(--_0x2c7df1){_0x3731ce['push'](_0x3731ce['shift']());}};_0x4b120c(++_0x1c97c1);}(_0x4797,0x157));var _0x7479=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4797[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7479('0x0'));var squel=require('squel');var as=require(_0x7479('0x1'));var qs=require(_0x7479('0x2'));var utils=require(_0x7479('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x23bd92,_0x131709){var _0x1cf9d0=![];if(_0x23bd92[_0x7479('0x4')]===_0x7479('0x5')&&!_0x131709[_0x7479('0x6')]&&!_0x131709['ListId']&&_0x131709[_0x7479('0x7')]!==_0x7479('0x8')){_0x1cf9d0=!![];}return _0x1cf9d0;}function getContactsSubquery(){return squel[_0x7479('0x9')]()[_0x7479('0xa')](_0x7479('0xb'),'c')[_0x7479('0xc')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x1dc29a,_0x5ab66e){var _0x646ee9=_0x5ab66e?'c':'subqry';_0x1dc29a[_0x7479('0xd')](_0x7479('0xe'),'uc','uc.CmContactId\x20=\x20'+_0x646ee9+'.id')[_0x7479('0xd')](_0x7479('0xf'),'ct',_0x7479('0x10')+_0x646ee9+_0x7479('0x11'))['left_join'](_0x7479('0x12'),'t',_0x7479('0x13'));return _0x1dc29a;}function addFieldsToQuery(_0x345565,_0x5e3c21,_0x5aefdb,_0x14afc3,_0xa8bbc7){var _0x2194cc=_0xa8bbc7?'c':_0x7479('0x14');if(!_0x5e3c21){_0x5e3c21=['id',_0x7479('0x15'),_0x7479('0x16'),_0x7479('0x17'),'mobile',_0x7479('0x18'),_0x7479('0x19'),'ListId',_0x7479('0x1a'),_0x7479('0x1b'),_0x7479('0x1c'),_0x7479('0x1d'),_0x7479('0x1e')];}else if(!_0x5e3c21[_0x7479('0x1f')]('id')){_0x5e3c21[_0x7479('0x20')]('id');}var _0x2b27d3=_0x5aefdb&&_0xa8bbc7||!_0x5aefdb&&!_0xa8bbc7;if(_0x14afc3){_0x2b27d3=_0x14afc3&&_0xa8bbc7||!_0x14afc3&&!_0xa8bbc7;}_0x5e3c21[_0x7479('0x21')](function(_0x50c4df){if(_0x50c4df===_0x7479('0x1e')){if(_0x2b27d3){_0x345565[_0x7479('0x22')](_0x7479('0x23'),_0x50c4df);}else if(_0x5aefdb||_0x14afc3){_0x345565[_0x7479('0x22')](_0x2194cc+'.'+_0x50c4df);}}else{_0x345565[_0x7479('0x22')](_0x2194cc+'.'+_0x50c4df);}});return _0x345565;}function getSqlClauses(){var _0xc1b5ac={'default':squel[_0x7479('0x24')](),'fields':squel[_0x7479('0x24')](),'filter':squel[_0x7479('0x24')](),'tags':{'clause':squel[_0x7479('0x24')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0xc1b5ac;}function parseTagParameter(_0x5d31a9){var _0x12ff5e=squel[_0x7479('0x24')]();if(_0x5d31a9){var _0x5b2fa2=utils[_0x7479('0x25')](_0x5d31a9);_0x5b2fa2[_0x7479('0x21')](function(_0x2d33d9){_0x12ff5e['or'](_0x7479('0x26'),'%,'+_0x2d33d9+',%');});}return _0x12ff5e;}function parseSearchFilter(_0x35d83e){var _0x540081=squel[_0x7479('0x24')]();if(_0x35d83e){var _0x450359=_0x35d83e[_0x7479('0x27')]('\x5c','\x5c\x5c')[_0x7479('0x27')](/'/g,'\x27\x27');if(_0x450359['split']('\x20')[_0x7479('0x28')]>0x1){_0x540081['or'](_0x7479('0x29'),qs[_0x7479('0x2a')](_0x450359,!![]),null);}else{if(qs[_0x7479('0x2b')](_0x450359)){_0x540081['or'](_0x7479('0x2c'),_0x450359+'%');_0x540081['or'](_0x7479('0x2d'),_0x450359+'%');_0x540081['or']('c.mobile\x20LIKE\x20?',_0x450359+'%');_0x540081['or'](_0x7479('0x2e'),_0x450359+'%');}else if(qs[_0x7479('0x2f')](_0x450359)){_0x540081['or']('c.email\x20LIKE\x20?',_0x450359+'%');}else{_0x540081['or'](_0x7479('0x30'),'%'+_0x450359+'%');_0x540081['or'](_0x7479('0x31'),'%'+_0x450359+'%');_0x540081['or'](_0x7479('0x32'),'%'+_0x450359+'%');}}}return _0x540081;}function parseAdvancedSearchFilter(_0x134f90,_0x247015){var _0xafe0f2=getSqlClauses();var _0x12c0de=as['parseSearch'](_0x134f90);var _0x5ccedc=_0x12c0de[_0x7479('0x33')];for(var _0x56a43f=0x0;_0x56a43f<_0x12c0de[_0x7479('0x34')][_0x7479('0x28')];_0x56a43f++){var _0x502589=_0x12c0de[_0x7479('0x34')][_0x56a43f];var _0x1c0723='c';var _0x42125e=_[_0x7479('0x35')](_0x247015,[_0x7479('0x36'),_0x502589[_0x7479('0x22')]]);if(_0x42125e){if(_0x502589['field']==='dateOfBirth'||_0x42125e[_0x7479('0x37')]===_0x7479('0x38')){_0x502589[_0x7479('0x39')]=_0x7479('0x3a');}var _0x19a9d3=as[_0x7479('0x3b')](_0x1c0723,_0x42125e[_0x7479('0x3c')],_0x502589);_0xafe0f2[_0x7479('0x3d')][_0x5ccedc](_0x19a9d3[_0x7479('0x3e')],_0x19a9d3[_0x7479('0x3f')][_0x7479('0x40')],_0x19a9d3[_0x7479('0x3f')]['end']);}else{if(_0x502589['field']===_0x7479('0x41')){var _0x34dcab=_0x502589['value'][_0x7479('0x42')](',')['map'](function(_0x7a2fa7){return Number(_0x7a2fa7);});var _0x3cb9dc=parseTagParameter(_0x34dcab);_0xafe0f2['tags'][_0x7479('0x43')][_0x7479('0x44')](_0x3cb9dc);_0xafe0f2[_0x7479('0x45')]['ids']=_0x34dcab;}else if(_0x502589[_0x7479('0x22')]==='User'){_0xafe0f2[_0x7479('0x46')][_0x7479('0x43')][_0x7479('0x44')](_0x7479('0x47'),_0x502589['value']);_0xafe0f2[_0x7479('0x46')]['skip']=!![];}}}return _0xafe0f2;}function parseModelFields(_0x531706,_0x2db0b4){var _0x399936=squel[_0x7479('0x24')]();var _0x559f07=_(_0x531706)[_0x7479('0x48')]()[_0x7479('0x49')](function(_0x5d076e){return _[_0x7479('0x4a')](_0x2db0b4,['name',_0x5d076e])?_0x5d076e:undefined;})[_0x7479('0x4b')]()[_0x7479('0x3f')]();if(_0x531706['Contact']){_0x559f07['push']('Contact');}if(_0x531706[_0x7479('0x4c')]){_0x559f07['push']('User');}if(_0x559f07[_0x7479('0x28')]>0x0){_0x559f07['forEach'](function(_0x2d06a4){if(_0x2d06a4===_0x7479('0x4d')){_0x399936['and']('c.ListId\x20IN\x20?',[][_0x7479('0x4e')](_0x531706[_0x2d06a4]));}else if(_0x2d06a4===_0x7479('0x4f')){var _0x3da812='%'+_0x531706[_0x2d06a4]+'%';_0x399936[_0x7479('0x44')](_0x7479('0x50'),_0x3da812);}else if(_0x2d06a4==='User'){_0x399936['and']('uc.UserId\x20=\x20?',_0x531706[_0x2d06a4]);}else{_0x399936[_0x7479('0x44')]('c.'+_0x2d06a4+'\x20=\x20?',_0x531706[_0x2d06a4]);}});}return _0x399936;}function parseQueryParameters(_0x43f99a,_0x27e81a){var _0x10f6bb=getSqlClauses();return Promise[_0x7479('0x51')]()['then'](function(){return parseModelFields(_0x43f99a,_0x27e81a);})['then'](function(_0x56b0c8){_0x10f6bb[_0x7479('0x52')][_0x7479('0x44')](_0x56b0c8);return parseTagParameter(_0x43f99a[_0x7479('0x53')]);})['then'](function(_0x1d02a1){_0x10f6bb[_0x7479('0x45')]['clause'][_0x7479('0x44')](_0x1d02a1);return parseSearchFilter(_0x43f99a[_0x7479('0x54')]);})[_0x7479('0x55')](function(_0x61afa3){_0x10f6bb['filter']=_0x61afa3;return _0x10f6bb;});}function checkListsRestrictions(_0x5acc3b,_0x4e5f7e,_0x61673a){var _0x406754=squel[_0x7479('0x24')]();return Promise[_0x7479('0x51')]()[_0x7479('0x55')](function(){if(_0x4e5f7e['search']&&_0x5acc3b[_0x7479('0x4')]==='agent'&&!_0x61673a){return _0x5acc3b[_0x7479('0x56')]({'attributes':['id'],'raw':!![]});}})[_0x7479('0x55')](function(_0x2121cf){if(_0x2121cf){if(_0x2121cf[_0x7479('0x28')]===0x0){_0x406754['and']('c.ListId\x20IS\x20NULL');}else{_0x406754[_0x7479('0x44')](_0x7479('0x57'),_[_0x7479('0x49')](_0x2121cf,'id'));}}})[_0x7479('0x55')](function(){return _0x406754;});}function buildContactsQuery(_0x1615bc,_0x52cd6,_0x54efa6,_0x1519ae,_0x5bd234,_0x10c13a){if(_0x52cd6){_0x52cd6=_0x54efa6['attributes'];}_0x1615bc=addFieldsToQuery(_0x1615bc,_0x52cd6,_0x1519ae,_0x10c13a,!![]);var _0x21e1c5=squel[_0x7479('0x9')]();_0x21e1c5=addFieldsToQuery(_0x21e1c5,_0x52cd6,_0x1519ae,_0x10c13a,![]);if(_0x1519ae||_0x10c13a){_0x1615bc=applyJoinClauses(_0x1615bc,!![]);_0x1615bc['group'](_0x7479('0x58'));if(_0x54efa6[_0x7479('0x59')]){_0x21e1c5[_0x7479('0x59')](_0x54efa6[_0x7479('0x59')]);}if(_0x54efa6['offset']){_0x21e1c5[_0x7479('0x5a')](_0x54efa6[_0x7479('0x5a')]);}}else{_0x21e1c5=applyJoinClauses(_0x21e1c5,![]);_0x21e1c5[_0x7479('0x5b')](_0x7479('0x5c'));if(_0x54efa6['limit']){_0x1615bc[_0x7479('0x59')](_0x54efa6['limit']);}if(_0x54efa6['offset']){_0x1615bc['offset'](_0x54efa6['offset']);}}_0x21e1c5[_0x7479('0x5d')](_0x5bd234);if(_0x54efa6[_0x7479('0x5e')]){_0x54efa6[_0x7479('0x5e')]['forEach'](function(_0x3ebfbc){_0x1615bc['order']('c.'+_0x3ebfbc[0x0],_0x3ebfbc[0x1]==='DESC'?![]:!![]);_0x21e1c5['order'](_0x7479('0x5f')+_0x3ebfbc[0x0],_0x3ebfbc[0x1]===_0x7479('0x60')?![]:!![]);});}_0x21e1c5[_0x7479('0xa')](_0x1615bc,'subqry');return _0x21e1c5;}function getFilteredContacts(_0x4f7c8f){var _0x26bdb5=[];return db[_0x7479('0x41')][_0x7479('0x61')]({'attributes':['id',_0x7479('0x36'),_0x7479('0x62')],'raw':!![]})[_0x7479('0x55')](function(_0x45bda6){_0x26bdb5=_[_0x7479('0x63')](_0x45bda6,'id');var _0x57ddad={'type':db[_0x7479('0x64')]['QueryTypes'][_0x7479('0x65')],'model':db[_0x7479('0x66')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x7479('0x67')](_0x4f7c8f[_0x7479('0x68')](),_0x57ddad);})['then'](function(_0x5a29dc){_0x5a29dc[_0x7479('0x21')](function(_0x19e71d){if(_0x19e71d[_0x7479('0x1e')]){_0x19e71d[_0x7479('0x69')]=[];_0x19e71d[_0x7479('0x1e')]['split'](',')['forEach'](function(_0x200b03){_0x19e71d['Tags'][_0x7479('0x20')](_0x26bdb5[_0x200b03]);});}delete _0x19e71d[_0x7479('0x1e')];});return _0x5a29dc;});}function countFilteredContacts(_0x1389a4,_0x2c3be2){var _0x50a632=_0x1389a4['clone']();_0x50a632[_0x7479('0x22')](_0x7479('0x6a'));_0x50a632=applyJoinClauses(_0x50a632,!![]);_0x1389a4[_0x7479('0x5b')](_0x7479('0x58'));var _0x56e5a1=utils[_0x7479('0x25')](_0x2c3be2);if(!_[_0x7479('0x6b')](_0x56e5a1)){_0x50a632[_0x7479('0xc')](_0x7479('0x6c'),_0x56e5a1);}var _0x318b37={'type':db['Sequelize'][_0x7479('0x6d')][_0x7479('0x65')],'raw':!![]};return db['sequelize'][_0x7479('0x67')](_0x50a632['toString'](),_0x318b37)[_0x7479('0x55')](function(_0x44533d){return _0x44533d[0x0][_0x7479('0x6a')];});}module[_0x7479('0x6e')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x3193=['dateOfBirth','castTo','DATE','type','default','text','value','start','end','map','tags','clause','and','ids','user','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','User','push','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','getLists','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','subqry','Tag','findAll','color','keyBy','Sequelize','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','QueryTypes','exports','lodash','squel','../parsers/advancedSearch','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','where','c.deletedAt\x20IS\x20NULL','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','left_join','t.id\x20=\x20ct.TagId','lastName','phone','mobile','fax','createdAt','deletedAt','TagIds','includes','forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name'];(function(_0x439ea2,_0x504140){var _0x103472=function(_0x1c6a10){while(--_0x1c6a10){_0x439ea2['push'](_0x439ea2['shift']());}};_0x103472(++_0x504140);}(_0x3193,0x115));var _0x3319=function(_0x458f80,_0x23459f){_0x458f80=_0x458f80-0x0;var _0x2586b9=_0x3193[_0x458f80];return _0x2586b9;};'use strict';var _=require(_0x3319('0x0'));var squel=require(_0x3319('0x1'));var as=require(_0x3319('0x2'));var qs=require('../parsers/qs');var utils=require('../interaction/utils');var db=require(_0x3319('0x3'))['db'];function skipContactsQuery(_0x41ffc8,_0x408d01){var _0x53a03c=![];if(_0x41ffc8[_0x3319('0x4')]===_0x3319('0x5')&&!_0x408d01[_0x3319('0x6')]&&!_0x408d01[_0x3319('0x7')]&&_0x408d01[_0x3319('0x8')]!==_0x3319('0x9')){_0x53a03c=!![];}return _0x53a03c;}function getContactsSubquery(){return squel['select']()[_0x3319('0xa')]('cm_contacts','c')[_0x3319('0xb')](_0x3319('0xc'));}function applyJoinClauses(_0x42782a,_0x38b02e){var _0x4b39b7=_0x38b02e?'c':'subqry';_0x42782a['left_join'](_0x3319('0xd'),'uc',_0x3319('0xe')+_0x4b39b7+_0x3319('0xf'))['left_join'](_0x3319('0x10'),'ct',_0x3319('0x11')+_0x4b39b7+'.id')[_0x3319('0x12')]('tools_tags','t',_0x3319('0x13'));return _0x42782a;}function addFieldsToQuery(_0x5bb693,_0x5784f4,_0x3a33c9,_0x421974,_0x23b754){var _0x4a39a3=_0x23b754?'c':'subqry';if(!_0x5784f4){_0x5784f4=['id','firstName',_0x3319('0x14'),_0x3319('0x15'),_0x3319('0x16'),_0x3319('0x17'),'email',_0x3319('0x7'),'CompanyId',_0x3319('0x18'),'updatedAt',_0x3319('0x19'),_0x3319('0x1a')];}else if(!_0x5784f4[_0x3319('0x1b')]('id')){_0x5784f4['push']('id');}var _0x11b92d=_0x3a33c9&&_0x23b754||!_0x3a33c9&&!_0x23b754;if(_0x421974){_0x11b92d=_0x421974&&_0x23b754||!_0x421974&&!_0x23b754;}_0x5784f4[_0x3319('0x1c')](function(_0x526c53){if(_0x526c53===_0x3319('0x1a')){if(_0x11b92d){_0x5bb693['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x526c53);}else if(_0x3a33c9||_0x421974){_0x5bb693['field'](_0x4a39a3+'.'+_0x526c53);}}else{_0x5bb693[_0x3319('0x1d')](_0x4a39a3+'.'+_0x526c53);}});return _0x5bb693;}function getSqlClauses(){var _0x19b0d6={'default':squel['expr'](),'fields':squel[_0x3319('0x1e')](),'filter':squel[_0x3319('0x1e')](),'tags':{'clause':squel[_0x3319('0x1e')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x19b0d6;}function parseTagParameter(_0xe1231b){var _0x4bce77=squel[_0x3319('0x1e')]();if(_0xe1231b){var _0x4e8bf3=utils[_0x3319('0x1f')](_0xe1231b);_0x4e8bf3[_0x3319('0x1c')](function(_0x419fc6){_0x4bce77['or'](_0x3319('0x20'),'%,'+_0x419fc6+',%');});}return _0x4bce77;}function parseSearchFilter(_0x6dec1c){var _0x4fad42=squel[_0x3319('0x1e')]();if(_0x6dec1c){var _0x404e95=_0x6dec1c[_0x3319('0x21')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x404e95[_0x3319('0x22')]('\x20')[_0x3319('0x23')]>0x1){_0x4fad42['or'](_0x3319('0x24'),qs[_0x3319('0x25')](_0x404e95,!![]),null);}else{if(qs[_0x3319('0x26')](_0x404e95)){_0x4fad42['or']('c.id\x20LIKE\x20?',_0x404e95+'%');_0x4fad42['or']('c.phone\x20LIKE\x20?',_0x404e95+'%');_0x4fad42['or'](_0x3319('0x27'),_0x404e95+'%');_0x4fad42['or'](_0x3319('0x28'),_0x404e95+'%');}else if(qs[_0x3319('0x29')](_0x404e95)){_0x4fad42['or'](_0x3319('0x2a'),_0x404e95+'%');}else{_0x4fad42['or'](_0x3319('0x2b'),'%'+_0x404e95+'%');_0x4fad42['or'](_0x3319('0x2c'),'%'+_0x404e95+'%');_0x4fad42['or'](_0x3319('0x2a'),'%'+_0x404e95+'%');}}}return _0x4fad42;}function parseAdvancedSearchFilter(_0x35c1fe,_0x1cdc6c){var _0x4c0851=getSqlClauses();var _0x37da92=as[_0x3319('0x2d')](_0x35c1fe);var _0x56f3b0=_0x37da92[_0x3319('0x2e')];for(var _0x55190d=0x0;_0x55190d<_0x37da92[_0x3319('0x2f')][_0x3319('0x23')];_0x55190d++){var _0x47664d=_0x37da92[_0x3319('0x2f')][_0x55190d];var _0x273d2c='c';var _0x6e38a4=_[_0x3319('0x30')](_0x1cdc6c,[_0x3319('0x31'),_0x47664d[_0x3319('0x1d')]]);if(_0x6e38a4){if(_0x47664d[_0x3319('0x1d')]===_0x3319('0x32')||_0x6e38a4['fieldType']==='datetime'){_0x47664d[_0x3319('0x33')]=_0x3319('0x34');}var _0x45f5e0=as['buildExpression'](_0x273d2c,_0x6e38a4[_0x3319('0x35')],_0x47664d);_0x4c0851[_0x3319('0x36')][_0x56f3b0](_0x45f5e0[_0x3319('0x37')],_0x45f5e0[_0x3319('0x38')][_0x3319('0x39')],_0x45f5e0[_0x3319('0x38')][_0x3319('0x3a')]);}else{if(_0x47664d[_0x3319('0x1d')]==='Tag'){var _0x2d78f8=_0x47664d[_0x3319('0x38')][_0x3319('0x22')](',')[_0x3319('0x3b')](function(_0x49a412){return Number(_0x49a412);});var _0x1c2f38=parseTagParameter(_0x2d78f8);_0x4c0851[_0x3319('0x3c')][_0x3319('0x3d')][_0x3319('0x3e')](_0x1c2f38);_0x4c0851[_0x3319('0x3c')][_0x3319('0x3f')]=_0x2d78f8;}else if(_0x47664d[_0x3319('0x1d')]==='User'){_0x4c0851[_0x3319('0x40')][_0x3319('0x3d')]['and'](_0x3319('0x41'),_0x47664d[_0x3319('0x38')]);_0x4c0851['user'][_0x3319('0x42')]=!![];}}}return _0x4c0851;}function parseModelFields(_0x4aa1c6,_0xef600c){var _0x3b8ef9=squel[_0x3319('0x1e')]();var _0x52eb97=_(_0x4aa1c6)[_0x3319('0x43')]()[_0x3319('0x3b')](function(_0x958418){return _[_0x3319('0x44')](_0xef600c,[_0x3319('0x31'),_0x958418])?_0x958418:undefined;})[_0x3319('0x45')]()[_0x3319('0x38')]();if(_0x4aa1c6[_0x3319('0x46')]){_0x52eb97['push'](_0x3319('0x46'));}if(_0x4aa1c6[_0x3319('0x47')]){_0x52eb97[_0x3319('0x48')](_0x3319('0x47'));}if(_0x52eb97[_0x3319('0x23')]>0x0){_0x52eb97[_0x3319('0x1c')](function(_0x466414){if(_0x466414===_0x3319('0x7')){_0x3b8ef9['and'](_0x3319('0x49'),[]['concat'](_0x4aa1c6[_0x466414]));}else if(_0x466414===_0x3319('0x46')){var _0x429b6f='%'+_0x4aa1c6[_0x466414]+'%';_0x3b8ef9[_0x3319('0x3e')](_0x3319('0x4a'),_0x429b6f);}else if(_0x466414===_0x3319('0x47')){_0x3b8ef9['and'](_0x3319('0x41'),_0x4aa1c6[_0x466414]);}else{_0x3b8ef9[_0x3319('0x3e')]('c.'+_0x466414+_0x3319('0x4b'),_0x4aa1c6[_0x466414]);}});}return _0x3b8ef9;}function parseQueryParameters(_0x38795d,_0x2e16d1){var _0x38afb7=getSqlClauses();return Promise[_0x3319('0x4c')]()[_0x3319('0x4d')](function(){return parseModelFields(_0x38795d,_0x2e16d1);})[_0x3319('0x4d')](function(_0x2de87e){_0x38afb7[_0x3319('0x4e')][_0x3319('0x3e')](_0x2de87e);return parseTagParameter(_0x38795d[_0x3319('0x4f')]);})['then'](function(_0x161b67){_0x38afb7[_0x3319('0x3c')][_0x3319('0x3d')]['and'](_0x161b67);return parseSearchFilter(_0x38795d['filter']);})['then'](function(_0x369a92){_0x38afb7[_0x3319('0x50')]=_0x369a92;return _0x38afb7;});}function checkListsRestrictions(_0x3cb9c2,_0x1949e6,_0x38ffdc){var _0xad60a4=squel[_0x3319('0x1e')]();return Promise[_0x3319('0x4c')]()[_0x3319('0x4d')](function(){if(_0x1949e6[_0x3319('0x6')]&&_0x3cb9c2[_0x3319('0x4')]==='agent'&&!_0x38ffdc){return _0x3cb9c2[_0x3319('0x51')]({'attributes':['id'],'raw':!![]});}})[_0x3319('0x4d')](function(_0x4b68d0){if(_0x4b68d0){if(_0x4b68d0['length']===0x0){_0xad60a4[_0x3319('0x3e')]('c.ListId\x20IS\x20NULL');}else{_0xad60a4[_0x3319('0x3e')](_0x3319('0x49'),_[_0x3319('0x3b')](_0x4b68d0,'id'));}}})[_0x3319('0x4d')](function(){return _0xad60a4;});}function buildContactsQuery(_0x32054c,_0x5c69f1,_0x3084ef,_0x194118,_0x3dfc3e,_0x46610c){if(_0x5c69f1){_0x5c69f1=_0x3084ef['attributes'];}_0x32054c=addFieldsToQuery(_0x32054c,_0x5c69f1,_0x194118,_0x46610c,!![]);var _0x170f64=squel['select']();_0x170f64=addFieldsToQuery(_0x170f64,_0x5c69f1,_0x194118,_0x46610c,![]);if(_0x194118||_0x46610c){_0x32054c=applyJoinClauses(_0x32054c,!![]);_0x32054c[_0x3319('0x52')](_0x3319('0x53'));if(_0x3084ef[_0x3319('0x54')]){_0x170f64[_0x3319('0x54')](_0x3084ef[_0x3319('0x54')]);}if(_0x3084ef[_0x3319('0x55')]){_0x170f64['offset'](_0x3084ef[_0x3319('0x55')]);}}else{_0x170f64=applyJoinClauses(_0x170f64,![]);_0x170f64['group'](_0x3319('0x56'));if(_0x3084ef['limit']){_0x32054c[_0x3319('0x54')](_0x3084ef[_0x3319('0x54')]);}if(_0x3084ef[_0x3319('0x55')]){_0x32054c[_0x3319('0x55')](_0x3084ef['offset']);}}_0x170f64[_0x3319('0x57')](_0x3dfc3e);if(_0x3084ef[_0x3319('0x58')]){_0x3084ef['order'][_0x3319('0x1c')](function(_0x4c628c){_0x32054c[_0x3319('0x58')]('c.'+_0x4c628c[0x0],_0x4c628c[0x1]===_0x3319('0x59')?![]:!![]);_0x170f64[_0x3319('0x58')](_0x3319('0x5a')+_0x4c628c[0x0],_0x4c628c[0x1]===_0x3319('0x59')?![]:!![]);});}_0x170f64['from'](_0x32054c,_0x3319('0x5b'));return _0x170f64;}function getFilteredContacts(_0x180af0){var _0x24e1a6=[];return db[_0x3319('0x5c')][_0x3319('0x5d')]({'attributes':['id',_0x3319('0x31'),_0x3319('0x5e')],'raw':!![]})[_0x3319('0x4d')](function(_0x4ff971){_0x24e1a6=_[_0x3319('0x5f')](_0x4ff971,'id');var _0x2947fb={'type':db[_0x3319('0x60')]['QueryTypes'][_0x3319('0x61')],'model':db[_0x3319('0x62')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x3319('0x63')][_0x3319('0x64')](_0x180af0[_0x3319('0x65')](),_0x2947fb);})['then'](function(_0x43356e){_0x43356e[_0x3319('0x1c')](function(_0x32fbed){if(_0x32fbed['TagIds']){_0x32fbed[_0x3319('0x66')]=[];_0x32fbed[_0x3319('0x1a')]['split'](',')[_0x3319('0x1c')](function(_0x239462){_0x32fbed[_0x3319('0x66')][_0x3319('0x48')](_0x24e1a6[_0x239462]);});}delete _0x32fbed['TagIds'];});return _0x43356e;});}function countFilteredContacts(_0x2abc68,_0x592d29){var _0x31f32a=_0x2abc68[_0x3319('0x67')]();_0x31f32a['field'](_0x3319('0x68'));_0x31f32a=applyJoinClauses(_0x31f32a,!![]);_0x2abc68[_0x3319('0x52')](_0x3319('0x53'));var _0x5a51b6=utils[_0x3319('0x1f')](_0x592d29);if(!_[_0x3319('0x69')](_0x5a51b6)){_0x31f32a['where'](_0x3319('0x6a'),_0x5a51b6);}var _0x2187f3={'type':db[_0x3319('0x60')][_0x3319('0x6b')]['SELECT'],'raw':!![]};return db['sequelize']['query'](_0x31f32a[_0x3319('0x65')](),_0x2187f3)[_0x3319('0x4d')](function(_0x573681){return _0x573681[0x0]['COUNT(*)'];});}module[_0x3319('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 11a16a5..3251fd9 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 _0x3a04=['data','update','write','end','final','binary','close','unlink','decryptFile','createWriteStream','createDecipher','encryptString','secret','base64','utf8','crypto','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','error','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3a04,0x1ef));var _0x43a0=function(_0x3245f7,_0x26bfad){_0x3245f7=_0x3245f7-0x0;var _0x472f77=_0x3a04[_0x3245f7];return _0x472f77;};'use strict';var crypto=require(_0x43a0('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x43a0('0x1'));var logger=require(_0x43a0('0x2'))(_0x43a0('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x43a0('0x4')],'algorithm':_0x43a0('0x5')};const fileOptions={'algorithm':_0x43a0('0x6')};if(config[_0x43a0('0x7')]&&config['encrypt'][_0x43a0('0x8')]){var isSupported=isAlgorithmSupported(config[_0x43a0('0x7')][_0x43a0('0x8')]);if(isSupported){fileOptions['algorithm']=config[_0x43a0('0x7')][_0x43a0('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x43a0('0x9')](config['encrypt']['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x4c8318){return AES_SUPPORTED_RX[_0x43a0('0xa')](_0x4c8318);}function getSupportedCiphers(){return crypto[_0x43a0('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x51d0f6){return getSupportedCiphers()[_0x43a0('0xc')](_0x51d0f6)>-0x1;}function combineOptions(_0x5a8cd1){var _0x331b18={};for(var _0x343423 in fileOptions){if(fileOptions[_0x43a0('0xd')](_0x343423)){_0x331b18[_0x343423]=fileOptions[_0x343423];}}if(_0x5a8cd1){for(var _0x6f976 in _0x5a8cd1){if(_0x5a8cd1[_0x43a0('0xd')](_0x6f976)){_0x331b18[_0x6f976]=_0x5a8cd1[_0x6f976];}}}return _0x331b18;}exports[_0x43a0('0xe')]=function(_0x36647e,_0x20641c,_0x561d2d,_0x587985){return new BPromise(function(_0x1efa7e,_0x3eb88e){_0x587985=combineOptions(_0x587985);var _0x5d9d99=new Buffer(_0x561d2d);var _0x18299d=fs[_0x43a0('0xf')](_0x36647e);var _0x1ab880=fs['createWriteStream'](_0x20641c);var _0x18019f=crypto[_0x43a0('0x10')](_0x587985[_0x43a0('0x8')],_0x5d9d99);_0x18299d['on'](_0x43a0('0x11'),function(_0x28cb54){var _0x15cc99=new Buffer(_0x18019f[_0x43a0('0x12')](_0x28cb54),'binary');_0x1ab880[_0x43a0('0x13')](_0x15cc99);});_0x18299d['on'](_0x43a0('0x14'),function(){try{var _0x25c3b8=new Buffer(_0x18019f[_0x43a0('0x15')](_0x43a0('0x16')),_0x43a0('0x16'));_0x1ab880['write'](_0x25c3b8);_0x1ab880[_0x43a0('0x14')]();_0x1ab880['on'](_0x43a0('0x17'),function(){return _0x1efa7e(_0x20641c);});}catch(_0x556cdd){fs[_0x43a0('0x18')](_0x20641c);return _0x3eb88e(_0x556cdd);}});});};exports[_0x43a0('0x19')]=function(_0x37fd53,_0x1418f5,_0xdd4ae8,_0x19c016){return new BPromise(function(_0x53717e,_0x2ca089){_0x19c016=combineOptions(_0x19c016);var _0x5e0b23=new Buffer(_0xdd4ae8);var _0x17b3f0=fs[_0x43a0('0xf')](_0x37fd53);var _0x44b6f0=fs[_0x43a0('0x1a')](_0x1418f5);var _0x4b88bf=crypto[_0x43a0('0x1b')](_0x19c016[_0x43a0('0x8')],_0x5e0b23);_0x17b3f0['on'](_0x43a0('0x11'),function(_0x473dd9){var _0x709801=new Buffer(_0x4b88bf['update'](_0x473dd9),_0x43a0('0x16'));_0x44b6f0[_0x43a0('0x13')](_0x709801);});_0x17b3f0['on'](_0x43a0('0x14'),function(){try{var _0x2c1f55=new Buffer(_0x4b88bf['final'](_0x43a0('0x16')),_0x43a0('0x16'));_0x44b6f0[_0x43a0('0x13')](_0x2c1f55);_0x44b6f0[_0x43a0('0x14')]();_0x44b6f0['on'](_0x43a0('0x17'),function(){return _0x53717e(_0x1418f5);});}catch(_0xd955f2){fs[_0x43a0('0x18')](_0x1418f5);return _0x2ca089(_0xd955f2);}});});};exports[_0x43a0('0x1c')]=function(_0x90abe9,_0xd83f54,_0x3db095){var _0x3297f1=_0x3db095||stringOptions['algorithm'];var _0x22f4da=_0xd83f54||stringOptions[_0x43a0('0x1d')];var _0x3443f4=crypto[_0x43a0('0x10')](_0x3297f1,_0x22f4da);var _0x8087f8=_0x3443f4[_0x43a0('0x12')](_0x90abe9,'utf8','base64');_0x8087f8+=_0x3443f4[_0x43a0('0x15')](_0x43a0('0x1e'));return _0x8087f8;};exports['decryptString']=function(_0x29f071,_0x43a023,_0x155411){var _0x371aff=_0x155411||stringOptions[_0x43a0('0x8')];var _0x4e71eb=_0x43a023||stringOptions[_0x43a0('0x1d')];var _0x44406f=crypto['createDecipher'](_0x371aff,_0x4e71eb);var _0xa08331=_0x44406f['update'](_0x29f071,'base64','utf8');_0xa08331+=_0x44406f[_0x43a0('0x15')](_0x43a0('0x1f'));return _0xa08331;}; \ No newline at end of file +var _0x5a28=['hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update','write','final','binary','end','close','unlink','decryptFile','createDecipher','utf8','base64','decryptString','secret','bluebird','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf'];(function(_0x530779,_0x210d44){var _0x389d82=function(_0x4d79e5){while(--_0x4d79e5){_0x530779['push'](_0x530779['shift']());}};_0x389d82(++_0x210d44);}(_0x5a28,0x132));var _0x85a2=function(_0x45cd35,_0x41147c){_0x45cd35=_0x45cd35-0x0;var _0x16db84=_0x5a28[_0x45cd35];return _0x16db84;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x85a2('0x0'));var _=require('lodash');var config=require(_0x85a2('0x1'));var logger=require(_0x85a2('0x2'))(_0x85a2('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x85a2('0x4')]['session'],'algorithm':_0x85a2('0x5')};const fileOptions={'algorithm':'aes192'};if(config[_0x85a2('0x6')]&&config[_0x85a2('0x6')][_0x85a2('0x7')]){var isSupported=isAlgorithmSupported(config[_0x85a2('0x6')][_0x85a2('0x7')]);if(isSupported){fileOptions['algorithm']=config[_0x85a2('0x6')][_0x85a2('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x85a2('0x8')](config['encrypt'][_0x85a2('0x7')],_0x85a2('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x18c627){return AES_SUPPORTED_RX[_0x85a2('0xa')](_0x18c627);}function getSupportedCiphers(){return crypto[_0x85a2('0xb')]()[_0x85a2('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x4265b5){return getSupportedCiphers()[_0x85a2('0xd')](_0x4265b5)>-0x1;}function combineOptions(_0x5b1424){var _0x1456f3={};for(var _0x1cd262 in fileOptions){if(fileOptions[_0x85a2('0xe')](_0x1cd262)){_0x1456f3[_0x1cd262]=fileOptions[_0x1cd262];}}if(_0x5b1424){for(var _0x76ba20 in _0x5b1424){if(_0x5b1424['hasOwnProperty'](_0x76ba20)){_0x1456f3[_0x76ba20]=_0x5b1424[_0x76ba20];}}}return _0x1456f3;}exports['encryptFile']=function(_0x5a4b9c,_0x2f003f,_0x2cf3e5,_0xb6d69e){return new BPromise(function(_0x236f86,_0x4f039b){_0xb6d69e=combineOptions(_0xb6d69e);var _0x33706e=new Buffer(_0x2cf3e5);var _0x5894e6=fs[_0x85a2('0xf')](_0x5a4b9c);var _0x382b40=fs[_0x85a2('0x10')](_0x2f003f);var _0x1fa3a1=crypto[_0x85a2('0x11')](_0xb6d69e[_0x85a2('0x7')],_0x33706e);_0x5894e6['on'](_0x85a2('0x12'),function(_0x4fa1f1){var _0x4392c4=new Buffer(_0x1fa3a1[_0x85a2('0x13')](_0x4fa1f1),'binary');_0x382b40[_0x85a2('0x14')](_0x4392c4);});_0x5894e6['on']('end',function(){try{var _0xdc1b08=new Buffer(_0x1fa3a1[_0x85a2('0x15')](_0x85a2('0x16')),_0x85a2('0x16'));_0x382b40[_0x85a2('0x14')](_0xdc1b08);_0x382b40[_0x85a2('0x17')]();_0x382b40['on'](_0x85a2('0x18'),function(){return _0x236f86(_0x2f003f);});}catch(_0x2b05ed){fs[_0x85a2('0x19')](_0x2f003f);return _0x4f039b(_0x2b05ed);}});});};exports[_0x85a2('0x1a')]=function(_0x5680e6,_0x47e254,_0x41aad3,_0xc131a9){return new BPromise(function(_0x5438d9,_0x2020fa){_0xc131a9=combineOptions(_0xc131a9);var _0x43e583=new Buffer(_0x41aad3);var _0x5c1788=fs[_0x85a2('0xf')](_0x5680e6);var _0x5337d8=fs['createWriteStream'](_0x47e254);var _0x4ddd23=crypto[_0x85a2('0x1b')](_0xc131a9[_0x85a2('0x7')],_0x43e583);_0x5c1788['on']('data',function(_0x56fa48){var _0x79c4bd=new Buffer(_0x4ddd23[_0x85a2('0x13')](_0x56fa48),_0x85a2('0x16'));_0x5337d8['write'](_0x79c4bd);});_0x5c1788['on']('end',function(){try{var _0x45ec1c=new Buffer(_0x4ddd23[_0x85a2('0x15')](_0x85a2('0x16')),_0x85a2('0x16'));_0x5337d8[_0x85a2('0x14')](_0x45ec1c);_0x5337d8['end']();_0x5337d8['on'](_0x85a2('0x18'),function(){return _0x5438d9(_0x47e254);});}catch(_0x35753d){fs[_0x85a2('0x19')](_0x47e254);return _0x2020fa(_0x35753d);}});});};exports['encryptString']=function(_0x47eb76,_0x1ca50e,_0x8b273b){var _0x662513=_0x8b273b||stringOptions[_0x85a2('0x7')];var _0xad07f=_0x1ca50e||stringOptions['secret'];var _0xd4b5a0=crypto[_0x85a2('0x11')](_0x662513,_0xad07f);var _0x143d87=_0xd4b5a0['update'](_0x47eb76,_0x85a2('0x1c'),_0x85a2('0x1d'));_0x143d87+=_0xd4b5a0['final'](_0x85a2('0x1d'));return _0x143d87;};exports[_0x85a2('0x1e')]=function(_0x381736,_0x500613,_0x5ebb30){var _0x563dc0=_0x5ebb30||stringOptions[_0x85a2('0x7')];var _0x113c84=_0x500613||stringOptions[_0x85a2('0x1f')];var _0x372606=crypto[_0x85a2('0x1b')](_0x563dc0,_0x113c84);var _0x357843=_0x372606['update'](_0x381736,'base64',_0x85a2('0x1c'));_0x357843+=_0x372606[_0x85a2('0x15')](_0x85a2('0x1c'));return _0x357843;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 4776fde..c67eb07 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 _0x08f8=['Setting','find','split','splitSizeCsv','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','Empty','length','range','num','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','join','each','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV'];(function(_0x43df64,_0x269872){var _0x2efeea=function(_0x1522b5){while(--_0x1522b5){_0x43df64['push'](_0x43df64['shift']());}};_0x2efeea(++_0x269872);}(_0x08f8,0x1a0));var _0x808f=function(_0x14be38,_0x3b44a8){_0x14be38=_0x14be38-0x0;var _0x2a5890=_0x08f8[_0x14be38];return _0x2a5890;};'use strict';var util=require(_0x808f('0x0'));var path=require(_0x808f('0x1'));var _=require(_0x808f('0x2'));var csv=require(_0x808f('0x3'));var fs=require('fs');var BPromise=require(_0x808f('0x4'));var zipdir=require(_0x808f('0x5'));var rimraf=require(_0x808f('0x6'));var db=require(_0x808f('0x7'))['db'];var dbH=require(_0x808f('0x7'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x808f('0x8')][0x2]);var QUERY=process[_0x808f('0x8')][0x3];var PATH=process[_0x808f('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xc0870d,_0x34e921){var _0x5ed9e2={'status':_0xc0870d};var _0x4a5884={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x34e921){_0x5ed9e2[_0x808f('0x9')]=_0x34e921;}return db[_0x808f('0xa')][_0x808f('0xb')](_0x5ed9e2,_0x4a5884);}function main(){var _0x6e688c=0x1388;var _0x59e0cd;logger[_0x808f('0xc')](util[_0x808f('0xd')](_0x808f('0xe'),EXTRACTED_REPORT_ID,_0x808f('0xf')));return db[_0x808f('0x10')][_0x808f('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x808f('0x12'),_0x808f('0x13')]})[_0x808f('0x14')](function(_0x388e40){if(_0x388e40){_0x59e0cd=_0x388e40;_0x6e688c=_0x59e0cd[_0x808f('0x13')]||0x1388;}})[_0x808f('0x14')](function(){return dbH['sequelize']['query'](util[_0x808f('0xd')](_0x808f('0x15'),QUERY),{'type':dbH[_0x808f('0x16')][_0x808f('0x17')][_0x808f('0x18')]});})[_0x808f('0x14')](function(_0x13653b){if(!_0x13653b[0x0]['num']){return analyticExtractedReport(_0x808f('0x19'));}var _0x17cdee=[];var _0x4737e5=0x0;if(_0x59e0cd[_0x808f('0x12')]){if(_0x13653b&&_0x13653b[_0x808f('0x1a')]){var _0x2dbcf6=_[_0x808f('0x1b')](_0x13653b[0x0][_0x808f('0x1c')]/_0x6e688c);var _0x4b04c7=Number['isInteger'](_0x13653b[0x0][_0x808f('0x1c')]/_0x6e688c)?_0x13653b[0x0][_0x808f('0x1c')]%_0x6e688c:0x0;_0x2dbcf6[_0x808f('0x1d')](function(_0x5d10fb){if(_0x5d10fb>0x0){_0x4737e5+=_0x6e688c;}_0x17cdee['push'](dbH[_0x808f('0x16')][_0x808f('0x1e')](util[_0x808f('0xd')](_0x808f('0x1f'),QUERY,_0x6e688c,_0x4737e5),{'type':dbH['sequelize'][_0x808f('0x17')][_0x808f('0x18')]}));});if(_0x4b04c7>0x0){_0x4737e5+=_0x6e688c;_0x17cdee[_0x808f('0x20')](dbH['sequelize'][_0x808f('0x1e')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4b04c7,_0x4737e5),{'type':dbH['sequelize'][_0x808f('0x17')]['SELECT']}));}}}else{_0x17cdee[_0x808f('0x20')](dbH[_0x808f('0x16')]['query'](QUERY,{'type':dbH[_0x808f('0x16')][_0x808f('0x17')][_0x808f('0x18')]}));}var _0x300a7b=path[_0x808f('0x21')](PATH);var _0x3e2e26=path[_0x808f('0x22')](PATH,_0x808f('0x23'));var _0x5ccd92=_0x59e0cd[_0x808f('0x12')]&&_0x17cdee[_0x808f('0x1a')]>0x1;var _0x2d3086=[];if(!fs['existsSync'](path[_0x808f('0x24')](_0x300a7b,_0x3e2e26))&&_0x5ccd92){fs['mkdirSync'](path[_0x808f('0x24')](_0x300a7b,_0x3e2e26));}return BPromise[_0x808f('0x25')](_0x17cdee,function(_0x129f84){_0x2d3086[_0x808f('0x20')](_0x129f84);})[_0x808f('0x14')](function(){for(var _0xea83fd=0x0;_0xea83fd<_0x2d3086[_0x808f('0x1a')];_0xea83fd+=0x1){var _0x271657;var _0x44150d=_0x2d3086[_0xea83fd];if(_0x5ccd92){_0x271657=path[_0x808f('0x24')](_0x300a7b,_0x3e2e26,util['format'](_0x808f('0x26'),_0x3e2e26,_0xea83fd,_0x808f('0x27')));}else{_0x271657=path[_0x808f('0x24')](_0x300a7b,util[_0x808f('0xd')]('%s.%s',_0x3e2e26,_0x808f('0x27')));}fs[_0x808f('0x28')](_0x271657,csv(_0x44150d));}})[_0x808f('0x14')](function(){if(_0x5ccd92){return new Promise(function(_0x13c00a){zipdir(path[_0x808f('0x24')](_0x300a7b,_0x3e2e26),{'saveTo':path[_0x808f('0x24')](_0x300a7b,util[_0x808f('0xd')](_0x808f('0x29'),_0x3e2e26,_0x808f('0x2a')))},function(_0x6a6098,_0x4a7ea2){rimraf(path[_0x808f('0x24')](_0x300a7b,_0x3e2e26),function(){});_0x13c00a(_0x808f('0x2b'));});});}})[_0x808f('0x14')](function(){logger['info'](util[_0x808f('0xd')](_0x808f('0x2c'),EXTRACTED_REPORT_ID,_0x808f('0xf')));return analyticExtractedReport(_0x808f('0x2d'),_0x5ccd92?util[_0x808f('0xd')]('%s.%s',_0x3e2e26,_0x5ccd92?_0x808f('0x2a'):_0x808f('0x27')):null);});})[_0x808f('0x2e')](function(_0x47b722){logger[_0x808f('0xc')](util[_0x808f('0xd')](_0x808f('0x2f'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x47b722,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x95b2=['finally','exit','util','path','lodash','to-csv','bluebird','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','length','join','mkdirSync','each','csv','%s.%s','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x95b2,0xe3));var _0x295b=function(_0x42e0ec,_0x47a580){_0x42e0ec=_0x42e0ec-0x0;var _0x42aa88=_0x95b2[_0x42e0ec];return _0x42aa88;};'use strict';var util=require(_0x295b('0x0'));var path=require(_0x295b('0x1'));var _=require(_0x295b('0x2'));var csv=require(_0x295b('0x3'));var fs=require('fs');var BPromise=require(_0x295b('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x295b('0x5'))(_0x295b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x295b('0x7')][0x2]);var QUERY=process[_0x295b('0x7')][0x3];var PATH=process[_0x295b('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5f3ccb,_0x195aee){var _0x56c309={'status':_0x5f3ccb};var _0x3b83c2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x195aee){_0x56c309[_0x295b('0x8')]=_0x195aee;}return db[_0x295b('0x9')][_0x295b('0xa')](_0x56c309,_0x3b83c2);}function main(){var _0x3fad27=0x1388;var _0x3d2865;logger[_0x295b('0xb')](util[_0x295b('0xc')](_0x295b('0xd'),EXTRACTED_REPORT_ID,_0x295b('0xe')));return db[_0x295b('0xf')][_0x295b('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x295b('0x11'),_0x295b('0x12')]})[_0x295b('0x13')](function(_0x4bc92c){if(_0x4bc92c){_0x3d2865=_0x4bc92c;_0x3fad27=_0x3d2865[_0x295b('0x12')]||0x1388;}})[_0x295b('0x13')](function(){return dbH[_0x295b('0x14')][_0x295b('0x15')](util[_0x295b('0xc')](_0x295b('0x16'),QUERY),{'type':dbH['sequelize'][_0x295b('0x17')][_0x295b('0x18')]});})['then'](function(_0x479140){if(!_0x479140[0x0][_0x295b('0x19')]){return analyticExtractedReport(_0x295b('0x1a'));}var _0xfca281=[];var _0x26f9f5=0x0;if(_0x3d2865['split']){if(_0x479140&&_0x479140['length']){var _0x91e01d=_[_0x295b('0x1b')](_0x479140[0x0][_0x295b('0x19')]/_0x3fad27);var _0x13f5bd=Number['isInteger'](_0x479140[0x0][_0x295b('0x19')]/_0x3fad27)?_0x479140[0x0][_0x295b('0x19')]%_0x3fad27:0x0;_0x91e01d[_0x295b('0x1c')](function(_0x2a80a1){if(_0x2a80a1>0x0){_0x26f9f5+=_0x3fad27;}_0xfca281['push'](dbH[_0x295b('0x14')][_0x295b('0x15')](util[_0x295b('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3fad27,_0x26f9f5),{'type':dbH[_0x295b('0x14')][_0x295b('0x17')][_0x295b('0x18')]}));});if(_0x13f5bd>0x0){_0x26f9f5+=_0x3fad27;_0xfca281[_0x295b('0x1d')](dbH[_0x295b('0x14')][_0x295b('0x15')](util['format'](_0x295b('0x1e'),QUERY,_0x13f5bd,_0x26f9f5),{'type':dbH[_0x295b('0x14')][_0x295b('0x17')][_0x295b('0x18')]}));}}}else{_0xfca281[_0x295b('0x1d')](dbH[_0x295b('0x14')][_0x295b('0x15')](QUERY,{'type':dbH[_0x295b('0x14')][_0x295b('0x17')][_0x295b('0x18')]}));}var _0x149a45=path['dirname'](PATH);var _0x4a8cc2=path[_0x295b('0x1f')](PATH,_0x295b('0x20'));var _0x352ecd=_0x3d2865[_0x295b('0x11')]&&_0xfca281[_0x295b('0x21')]>0x1;var _0x389fdf=[];if(!fs['existsSync'](path[_0x295b('0x22')](_0x149a45,_0x4a8cc2))&&_0x352ecd){fs[_0x295b('0x23')](path[_0x295b('0x22')](_0x149a45,_0x4a8cc2));}return BPromise[_0x295b('0x24')](_0xfca281,function(_0x76fdd9){_0x389fdf[_0x295b('0x1d')](_0x76fdd9);})[_0x295b('0x13')](function(){for(var _0x46b034=0x0;_0x46b034<_0x389fdf[_0x295b('0x21')];_0x46b034+=0x1){var _0x5294d5;var _0x278f0f=_0x389fdf[_0x46b034];if(_0x352ecd){_0x5294d5=path[_0x295b('0x22')](_0x149a45,_0x4a8cc2,util[_0x295b('0xc')]('%s%d.%s',_0x4a8cc2,_0x46b034,_0x295b('0x25')));}else{_0x5294d5=path[_0x295b('0x22')](_0x149a45,util[_0x295b('0xc')](_0x295b('0x26'),_0x4a8cc2,_0x295b('0x25')));}fs['writeFileSync'](_0x5294d5,csv(_0x278f0f));}})[_0x295b('0x13')](function(){if(_0x352ecd){return new Promise(function(_0x5ac140){zipdir(path[_0x295b('0x22')](_0x149a45,_0x4a8cc2),{'saveTo':path[_0x295b('0x22')](_0x149a45,util[_0x295b('0xc')]('%s.%s',_0x4a8cc2,'zip'))},function(_0x10ace2,_0x4855c8){rimraf(path[_0x295b('0x22')](_0x149a45,_0x4a8cc2),function(){});_0x5ac140(_0x295b('0x27'));});});}})[_0x295b('0x13')](function(){logger[_0x295b('0xb')](util[_0x295b('0xc')](_0x295b('0x28'),EXTRACTED_REPORT_ID,_0x295b('0xe')));return analyticExtractedReport('Completed',_0x352ecd?util[_0x295b('0xc')](_0x295b('0x26'),_0x4a8cc2,_0x352ecd?'zip':_0x295b('0x25')):null);});})[_0x295b('0x29')](function(_0x52b1ec){logger[_0x295b('0xb')](util[_0x295b('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x295b('0xe')),util[_0x295b('0x2a')](_0x52b1ec,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x295b('0x2b')](function(){process[_0x295b('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c3923d4..e9d6c9e 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 _0x64d6=['center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','createPdfFromHTML','util','path','moment','html-to-pdfmake','pdfmake/src/printer','jsdom','JSDOM','window','bluebird','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','length','body','chunk','keys','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','format','endDate','push','header','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','then','split','isInteger','forEach','sequelize','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','mkdirSync','each','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','PDF','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64d6,0x10a));var _0x664d=function(_0x34e85b,_0x4602a5){_0x34e85b=_0x34e85b-0x0;var _0x309665=_0x64d6[_0x34e85b];return _0x309665;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x664d('0x0'));var path=require(_0x664d('0x1'));var moment=require(_0x664d('0x2'));var htmlToPdfmake=require(_0x664d('0x3'));var PdfPrinter=require(_0x664d('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x664d('0x5'))[_0x664d('0x6')];var window=new JSDOM('')[_0x664d('0x7')];var BPromise=require(_0x664d('0x8'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x664d('0x9')];var logger=require(_0x664d('0xa'))(_0x664d('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x664d('0xc')][0x3];var PATH=process[_0x664d('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x664d('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x206e54,_0xd7ec79){var _0x5b2138={'status':_0x206e54};var _0x5b4ded={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xd7ec79){_0x5b2138[_0x664d('0xe')]=_0xd7ec79;}return db[_0x664d('0xf')]['update'](_0x5b2138,_0x5b4ded);}function getHeaders(_0x551401){return _[_0x664d('0x10')](_0x551401,function(_0x24895a){return{'text':_0x24895a,'style':_0x664d('0x11')};});}function getRows(_0x388158,_0x174c21){return _[_0x664d('0x10')](_0x174c21,function(_0x15cdc7){return _(_0x15cdc7)[_0x664d('0x12')](_0x388158)['map'](function(_0x287f2a){return _0x287f2a?_[_0x664d('0x13')](_0x287f2a):'';})['value']();});}function createTable(_0x33b6ee,_0x21a16b){var _0x2b4617={'widths':_['fill'](Array(_0x33b6ee[_0x664d('0x14')]),0x91),'heights':function(_0x3d2c10){return _0x3d2c10===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x31c290=getHeaders(_0x33b6ee);_0x2b4617[_0x664d('0x15')]['push'](_0x31c290);var _0x1bd214=getRows(_0x33b6ee,_0x21a16b);_0x2b4617[_0x664d('0x15')]=_0x2b4617[_0x664d('0x15')]['concat'](_0x1bd214);return _0x2b4617;}function createTables(_0x60c1c2){var _0x2758c2=[];var _0x277961=_[_0x664d('0x16')](Object[_0x664d('0x17')](_0x60c1c2[0x0]),0x5);_0x277961['forEach'](function(_0x6166ad){_0x2758c2['push'](createTable(_0x6166ad,_0x60c1c2));});return _0x2758c2;}function getPDFDocDefinition(_0x47d046){var _0x4eb38d=util['format'](_0x664d('0x18'),NAME,EXTRACTED_REPORT[_0x664d('0x19')],moment(EXTRACTED_REPORT['startDate'])[_0x664d('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x664d('0x1b')])[_0x664d('0x1a')](FORMAT));var _0xd403db=[];for(var _0x183aa1=0x0;_0x183aa1<_0x47d046[_0x664d('0x14')];_0x183aa1++){var _0x676306=[];if(_0x183aa1===0x0){_0x676306[_0x664d('0x1c')]({'text':_0x4eb38d,'style':_0x664d('0x1d')});}var _0xf53c87={'table':_0x47d046[_0x183aa1]};if(_0x183aa1>0x0){_0xf53c87['pageBreak']=_0x664d('0x1e');_0xf53c87[_0x664d('0x1f')]=[0x0,0x46,0x0,0x0];}_0x676306[_0x664d('0x1c')](_0xf53c87);_0xd403db[_0x664d('0x1c')](_0x676306);}return{'pageSize':'A4','pageOrientation':_0x664d('0x20'),'content':_0xd403db,'footer':function(_0x1257d9,_0x405c0f){return{'text':_0x1257d9[_0x664d('0x13')]()+_0x664d('0x21')+_0x405c0f,'style':_0x664d('0x22')};},'defaultStyle':{'font':_0x664d('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x664d('0x24')},'footer':{'alignment':_0x664d('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3d20d9){var _0x2fef9b=0x1388;var _0x527d4d;if(!_0x3d20d9[0x0][_0x664d('0x26')]){return analyticExtractedReport(_0x664d('0x27'));}return db[_0x664d('0x28')][_0x664d('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0x664d('0x2a')](function(_0x1be9df){if(_0x1be9df){_0x527d4d=_0x1be9df;_0x2fef9b=_0x527d4d['splitSizePdf']||0x3e8;}})[_0x664d('0x2a')](function(){var _0x5ebe79=[];var _0x14ea49=0x0;if(_0x527d4d[_0x664d('0x2b')]){if(_0x3d20d9&&_0x3d20d9[_0x664d('0x14')]){var _0x12da25=_['range'](_0x3d20d9[0x0]['num']/_0x2fef9b);var _0x23504a=Number[_0x664d('0x2c')](_0x3d20d9[0x0][_0x664d('0x26')]/_0x2fef9b)?_0x3d20d9[0x0]['num']%_0x2fef9b:0x0;_0x12da25[_0x664d('0x2d')](function(_0x2a6857){if(_0x2a6857>0x0){_0x14ea49+=_0x2fef9b;}_0x5ebe79[_0x664d('0x1c')](dbH[_0x664d('0x2e')]['query'](util[_0x664d('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2fef9b,_0x14ea49),{'type':dbH[_0x664d('0x2e')][_0x664d('0x2f')][_0x664d('0x30')]}));});if(_0x23504a>0x0){_0x14ea49+=_0x2fef9b;_0x5ebe79[_0x664d('0x1c')](dbH[_0x664d('0x2e')][_0x664d('0x31')](util[_0x664d('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x23504a,_0x14ea49),{'type':dbH['sequelize']['QueryTypes'][_0x664d('0x30')]}));}}}else{_0x5ebe79[_0x664d('0x1c')](dbH['sequelize'][_0x664d('0x31')](QUERY,{'type':dbH['sequelize'][_0x664d('0x2f')][_0x664d('0x30')]}));}var _0x57aedc=path[_0x664d('0x32')](PATH);var _0x41406d=path[_0x664d('0x33')](PATH,_0x664d('0x34'));var _0x32b3fa=_0x527d4d[_0x664d('0x2b')]&&_0x5ebe79['length']>0x1;var _0x4668cd=[];if(!fs[_0x664d('0x35')](path[_0x664d('0x36')](_0x57aedc,_0x41406d))&&_0x32b3fa){fs[_0x664d('0x37')](path[_0x664d('0x36')](_0x57aedc,_0x41406d));}return BPromise[_0x664d('0x38')](_0x5ebe79,function(_0x49d26b){_0x4668cd['push'](_0x49d26b);})[_0x664d('0x2a')](function(){var _0x32a7d8=[];for(var _0x3395a0=0x0;_0x3395a0<_0x4668cd['length'];_0x3395a0+=0x1){var _0x96c35a=_0x4668cd[_0x3395a0];var _0x599872=createTables(_['flatten'](_0x96c35a));var _0x47e151;var _0x3e8142=getPDFDocDefinition(_0x599872);var _0x2ddd81=getPDFPrinter();var _0x42b031=_0x2ddd81[_0x664d('0x39')](_0x3e8142);if(_0x32b3fa){_0x47e151=path['join'](_0x57aedc,_0x41406d,util['format'](_0x664d('0x3a'),_0x41406d,_0x3395a0,_0x664d('0x3b')));}else{_0x47e151=path['join'](_0x57aedc,util[_0x664d('0x1a')](_0x664d('0x3c'),_0x41406d,_0x664d('0x3b')));}_0x32a7d8['push'](writePDFDocument(_0x42b031,_0x47e151));}return Promise['all'](_0x32a7d8);})['then'](function(){if(_0x32b3fa){return new Promise(function(_0x446685){zipdir(path[_0x664d('0x36')](_0x57aedc,_0x41406d),{'saveTo':path[_0x664d('0x36')](_0x57aedc,util[_0x664d('0x1a')]('%s.%s',_0x41406d,'zip'))},function(){rimraf(path[_0x664d('0x36')](_0x57aedc,_0x41406d),function(){});_0x446685(_0x664d('0x3d'));});});}})[_0x664d('0x2a')](function(){if(!_0x32b3fa)return;rimraf(path['join'](_0x57aedc,_0x41406d),function(){});})['then'](function(){logger[_0x664d('0x3e')](util[_0x664d('0x1a')](_0x664d('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x664d('0x40'),_0x32b3fa?util['format']('%s.%s',_0x41406d,_0x32b3fa?'zip':_0x664d('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x664d('0x3e')](util[_0x664d('0x1a')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x664d('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x664d('0x2a')](function(_0x571aa6){EXTRACTED_REPORT=_0x571aa6;return dbH['sequelize']['query'](util[_0x664d('0x1a')](_0x664d('0x42'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x664d('0x30')]});})[_0x664d('0x2a')](extractReport)[_0x664d('0x43')](function(_0xe0ae8f){logger['info'](util[_0x664d('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x664d('0x44')),util[_0x664d('0x45')](_0xe0ae8f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x664d('0x46')](function(){process[_0x664d('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x578f9e=new PdfPrinter({'Arial':{'normal':__dirname+_0x664d('0x48'),'bold':__dirname+_0x664d('0x49'),'italics':__dirname+_0x664d('0x4a'),'bolditalics':__dirname+_0x664d('0x4b')}});return _0x578f9e;}function getPDFDocDefinitionFromHTML(_0x3aa6bb,_0x3aac3a){var _0x4c8526=util[_0x664d('0x1a')]('%s\x20#%d',_0x3aac3a[_0x664d('0x4c')],_0x3aac3a[_0x664d('0x4d')]);var _0x4c3f6c=moment()[_0x664d('0x1a')]('YYYY-MM-DD')[_0x664d('0x13')]();var _0x15fb64=htmlToPdfmake(_0x3aa6bb,{'window':window,'tableAutoSize':!![]});return{'content':[_0x15fb64],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x664d('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x664d('0x4f'),'style':_0x664d('0x1d')}];},'footer':function(_0x502371,_0x543ba0){return[{'text':util['format'](_0x664d('0x50'),_0x4c8526,_0x502371,_0x543ba0,_0x4c3f6c),'style':_0x664d('0x22')}];}};}function writePDFDocument(_0x5cbd58,_0x173a15){return new Promise(function(_0x2c38a2,_0x3095c4){var _0x2119fa=_0x5cbd58[_0x664d('0x51')](fs[_0x664d('0x52')](_0x173a15));_0x2119fa['on']('finish',function(){_0x2c38a2(_0x664d('0x53'));});_0x2119fa['on'](_0x664d('0x54'),function(_0x2d39b5){_0x3095c4(_0x2d39b5);});_0x5cbd58['end']();});}exports[_0x664d('0x55')]=function(_0x5bc528,_0x1d0736){var _0x593642=getPDFPrinter();var _0x3278b0=getPDFDocDefinitionFromHTML(_0x5bc528,_0x1d0736);var _0x3162de=_0x593642['createPdfKitDocument'](_0x3278b0);return writePDFDocument(_0x3162de,_0x1d0736[_0x664d('0x1')])[_0x664d('0x43')](function(_0x27901a){throw _0x27901a;});}; \ No newline at end of file +var _0x2976=['createPdfFromHTML','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','value','fill','length','auto','body','push','concat','chunk','keys','name','startDate','endDate','format','header','pageBreak','landscape','\x20/\x20','footer','right','num','Empty','Setting','find','split','splitSizePdf','range','isInteger','forEach','sequelize','QueryTypes','SELECT','query','dirname','basename','.pdf','join','mkdirSync','each','then','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end'];(function(_0x244ab0,_0x1cfe50){var _0x13dcf7=function(_0x1576ce){while(--_0x1576ce){_0x244ab0['push'](_0x244ab0['shift']());}};_0x13dcf7(++_0x1cfe50);}(_0x2976,0xbb));var _0x6297=function(_0x41a946,_0xd07acc){_0x41a946=_0x41a946-0x0;var _0x35e40a=_0x2976[_0x41a946];return _0x35e40a;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0x6297('0x0'));var moment=require(_0x6297('0x1'));var htmlToPdfmake=require(_0x6297('0x2'));var PdfPrinter=require(_0x6297('0x3'));var zipdir=require(_0x6297('0x4'));var rimraf=require(_0x6297('0x5'));var JSDOM=require(_0x6297('0x6'))[_0x6297('0x7')];var window=new JSDOM('')[_0x6297('0x8')];var BPromise=require(_0x6297('0x9'));var db=require(_0x6297('0xa'))['db'];var dbH=require(_0x6297('0xa'))[_0x6297('0xb')];var logger=require(_0x6297('0xc'))(_0x6297('0xd'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x6297('0xe')][0x4];var NAME=process[_0x6297('0xe')][0x5];var FORMAT=_0x6297('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xe285ee,_0x269126){var _0x12c58c={'status':_0xe285ee};var _0x2ebb4d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x269126){_0x12c58c[_0x6297('0x10')]=_0x269126;}return db[_0x6297('0x11')]['update'](_0x12c58c,_0x2ebb4d);}function getHeaders(_0x530bde){return _[_0x6297('0x12')](_0x530bde,function(_0x54778d){return{'text':_0x54778d,'style':_0x6297('0x13')};});}function getRows(_0x372088,_0x5742aa){return _[_0x6297('0x12')](_0x5742aa,function(_0xf9c984){return _(_0xf9c984)[_0x6297('0x14')](_0x372088)[_0x6297('0x12')](function(_0x530df7){return _0x530df7?_[_0x6297('0x15')](_0x530df7):'';})[_0x6297('0x16')]();});}function createTable(_0x30f981,_0x3ec133){var _0x2fb218={'widths':_[_0x6297('0x17')](Array(_0x30f981[_0x6297('0x18')]),0x91),'heights':function(_0x3f07d0){return _0x3f07d0===0x0?_0x6297('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x20658a=getHeaders(_0x30f981);_0x2fb218[_0x6297('0x1a')][_0x6297('0x1b')](_0x20658a);var _0x13fc89=getRows(_0x30f981,_0x3ec133);_0x2fb218[_0x6297('0x1a')]=_0x2fb218[_0x6297('0x1a')][_0x6297('0x1c')](_0x13fc89);return _0x2fb218;}function createTables(_0x1e89e2){var _0x3a3704=[];var _0x5a09ac=_[_0x6297('0x1d')](Object[_0x6297('0x1e')](_0x1e89e2[0x0]),0x5);_0x5a09ac['forEach'](function(_0x36e1c3){_0x3a3704[_0x6297('0x1b')](createTable(_0x36e1c3,_0x1e89e2));});return _0x3a3704;}function getPDFDocDefinition(_0x440764){var _0xc568e2=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x6297('0x1f')],moment(EXTRACTED_REPORT[_0x6297('0x20')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x6297('0x21')])[_0x6297('0x22')](FORMAT));var _0x4d9c17=[];for(var _0x4af79a=0x0;_0x4af79a<_0x440764[_0x6297('0x18')];_0x4af79a++){var _0x911fea=[];if(_0x4af79a===0x0){_0x911fea[_0x6297('0x1b')]({'text':_0xc568e2,'style':_0x6297('0x23')});}var _0x466742={'table':_0x440764[_0x4af79a]};if(_0x4af79a>0x0){_0x466742[_0x6297('0x24')]='before';_0x466742['margin']=[0x0,0x46,0x0,0x0];}_0x911fea[_0x6297('0x1b')](_0x466742);_0x4d9c17['push'](_0x911fea);}return{'pageSize':'A4','pageOrientation':_0x6297('0x25'),'content':_0x4d9c17,'footer':function(_0xc89ae0,_0x2e6213){return{'text':_0xc89ae0[_0x6297('0x15')]()+_0x6297('0x26')+_0x2e6213,'style':_0x6297('0x27')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x6297('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x26d5e4){var _0xb25597=0x1388;var _0x1fb3c6;if(!_0x26d5e4[0x0][_0x6297('0x29')]){return analyticExtractedReport(_0x6297('0x2a'));}return db[_0x6297('0x2b')][_0x6297('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6297('0x2d'),_0x6297('0x2e')]})['then'](function(_0x51f9a2){if(_0x51f9a2){_0x1fb3c6=_0x51f9a2;_0xb25597=_0x1fb3c6['splitSizePdf']||0x3e8;}})['then'](function(){var _0x476c95=[];var _0x21736e=0x0;if(_0x1fb3c6['split']){if(_0x26d5e4&&_0x26d5e4[_0x6297('0x18')]){var _0x4f53fa=_[_0x6297('0x2f')](_0x26d5e4[0x0][_0x6297('0x29')]/_0xb25597);var _0x313526=Number[_0x6297('0x30')](_0x26d5e4[0x0]['num']/_0xb25597)?_0x26d5e4[0x0][_0x6297('0x29')]%_0xb25597:0x0;_0x4f53fa[_0x6297('0x31')](function(_0x4dc7a6){if(_0x4dc7a6>0x0){_0x21736e+=_0xb25597;}_0x476c95[_0x6297('0x1b')](dbH[_0x6297('0x32')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xb25597,_0x21736e),{'type':dbH[_0x6297('0x32')][_0x6297('0x33')][_0x6297('0x34')]}));});if(_0x313526>0x0){_0x21736e+=_0xb25597;_0x476c95[_0x6297('0x1b')](dbH[_0x6297('0x32')][_0x6297('0x35')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x313526,_0x21736e),{'type':dbH[_0x6297('0x32')][_0x6297('0x33')][_0x6297('0x34')]}));}}}else{_0x476c95[_0x6297('0x1b')](dbH[_0x6297('0x32')][_0x6297('0x35')](QUERY,{'type':dbH['sequelize'][_0x6297('0x33')][_0x6297('0x34')]}));}var _0x50a02f=path[_0x6297('0x36')](PATH);var _0x5ed429=path[_0x6297('0x37')](PATH,_0x6297('0x38'));var _0x2b39bd=_0x1fb3c6[_0x6297('0x2d')]&&_0x476c95[_0x6297('0x18')]>0x1;var _0x591787=[];if(!fs['existsSync'](path[_0x6297('0x39')](_0x50a02f,_0x5ed429))&&_0x2b39bd){fs[_0x6297('0x3a')](path['join'](_0x50a02f,_0x5ed429));}return BPromise[_0x6297('0x3b')](_0x476c95,function(_0x40d7a6){_0x591787[_0x6297('0x1b')](_0x40d7a6);})[_0x6297('0x3c')](function(){var _0x15ddfe=[];for(var _0xbbea38=0x0;_0xbbea38<_0x591787['length'];_0xbbea38+=0x1){var _0x528d51=_0x591787[_0xbbea38];var _0x1d28ff=createTables(_[_0x6297('0x3d')](_0x528d51));var _0x2af95a;var _0x1a0e48=getPDFDocDefinition(_0x1d28ff);var _0x1bfc99=getPDFPrinter();var _0x550db7=_0x1bfc99[_0x6297('0x3e')](_0x1a0e48);if(_0x2b39bd){_0x2af95a=path[_0x6297('0x39')](_0x50a02f,_0x5ed429,util[_0x6297('0x22')](_0x6297('0x3f'),_0x5ed429,_0xbbea38,'pdf'));}else{_0x2af95a=path[_0x6297('0x39')](_0x50a02f,util['format']('%s.%s',_0x5ed429,_0x6297('0x40')));}_0x15ddfe[_0x6297('0x1b')](writePDFDocument(_0x550db7,_0x2af95a));}return Promise[_0x6297('0x41')](_0x15ddfe);})[_0x6297('0x3c')](function(){if(_0x2b39bd){return new Promise(function(_0xaa76e1){zipdir(path['join'](_0x50a02f,_0x5ed429),{'saveTo':path[_0x6297('0x39')](_0x50a02f,util[_0x6297('0x22')](_0x6297('0x42'),_0x5ed429,_0x6297('0x43')))},function(){rimraf(path['join'](_0x50a02f,_0x5ed429),function(){});_0xaa76e1(_0x6297('0x44'));});});}})[_0x6297('0x3c')](function(){if(!_0x2b39bd)return;rimraf(path[_0x6297('0x39')](_0x50a02f,_0x5ed429),function(){});})[_0x6297('0x3c')](function(){logger['info'](util[_0x6297('0x22')](_0x6297('0x45'),EXTRACTED_REPORT_ID,_0x6297('0x46')));return analyticExtractedReport(_0x6297('0x47'),_0x2b39bd?util[_0x6297('0x22')](_0x6297('0x42'),_0x5ed429,_0x2b39bd?_0x6297('0x43'):_0x6297('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6297('0x48')](util[_0x6297('0x22')](_0x6297('0x49'),EXTRACTED_REPORT_ID,_0x6297('0x46')));return db[_0x6297('0x11')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x6297('0x3c')](function(_0x219aa3){EXTRACTED_REPORT=_0x219aa3;return dbH[_0x6297('0x32')][_0x6297('0x35')](util['format'](_0x6297('0x4a'),QUERY),{'type':dbH[_0x6297('0x32')][_0x6297('0x33')][_0x6297('0x34')]});})[_0x6297('0x3c')](extractReport)[_0x6297('0x4b')](function(_0x3823f6){logger[_0x6297('0x48')](util[_0x6297('0x22')](_0x6297('0x4c'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x3823f6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x6297('0x4d')](function(){process[_0x6297('0x4e')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x561659=new PdfPrinter({'Arial':{'normal':__dirname+_0x6297('0x4f'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x6297('0x50'),'bolditalics':__dirname+_0x6297('0x51')}});return _0x561659;}function getPDFDocDefinitionFromHTML(_0x15c20b,_0x6806f0){var _0x3d2fd3=util[_0x6297('0x22')](_0x6297('0x52'),_0x6806f0[_0x6297('0x53')],_0x6806f0['interactionId']);var _0x45a7eb=moment()[_0x6297('0x22')]('YYYY-MM-DD')[_0x6297('0x15')]();var _0x3b4c25=htmlToPdfmake(_0x15c20b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3b4c25],'defaultStyle':{'font':_0x6297('0x54')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x6297('0x55'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x6297('0x55'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x6297('0x55')}},'header':function(){return[{'text':_0x6297('0x56'),'style':_0x6297('0x23')}];},'footer':function(_0xecb76,_0x43f630){return[{'text':util[_0x6297('0x22')](_0x6297('0x57'),_0x3d2fd3,_0xecb76,_0x43f630,_0x45a7eb),'style':'footer'}];}};}function writePDFDocument(_0x469640,_0x31c52c){return new Promise(function(_0x29fc85,_0x34181d){var _0x12d0b5=_0x469640[_0x6297('0x58')](fs[_0x6297('0x59')](_0x31c52c));_0x12d0b5['on'](_0x6297('0x5a'),function(){_0x29fc85(_0x6297('0x5a'));});_0x12d0b5['on']('error',function(_0x26ad6c){_0x34181d(_0x26ad6c);});_0x469640[_0x6297('0x5b')]();});}exports[_0x6297('0x5c')]=function(_0x19e88f,_0x86f43f){var _0x1b2168=getPDFPrinter();var _0x3bb909=getPDFDocDefinitionFromHTML(_0x19e88f,_0x86f43f);var _0xb0931f=_0x1b2168[_0x6297('0x3e')](_0x3bb909);return writePDFDocument(_0xb0931f,_0x86f43f[_0x6297('0x0')])[_0x6297('0x4b')](function(_0x5698e7){throw _0x5698e7;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 42b477f..6f1e560 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 _0x8d02=['analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','existsSync','mkdirSync','each','join','%s%d.%s','%s.%s','binary','zip','zip\x20finished','Completed','xlsx','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','inspect','Failed','exit','util','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8d02,0x134));var _0x28d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d02[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x28d0('0x0'));var path=require(_0x28d0('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x28d0('0x2'));var BPromise=require(_0x28d0('0x3'));var zipdir=require(_0x28d0('0x4'));var rimraf=require(_0x28d0('0x5'));var db=require(_0x28d0('0x6'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0x28d0('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x28d0('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4bc63e,_0x58f343){var _0x3ef5fb={'status':_0x4bc63e};var _0x58d8d2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x58f343){_0x3ef5fb['savename']=_0x58f343;}return db[_0x28d0('0x9')]['update'](_0x3ef5fb,_0x58d8d2);}function main(){var _0x57f8ac=0x1388;var _0xee9c43;logger[_0x28d0('0xa')](util[_0x28d0('0xb')](_0x28d0('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x28d0('0xd')][_0x28d0('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x28d0('0xf'),_0x28d0('0x10')]})['then'](function(_0x2aa7ac){if(_0x2aa7ac){_0xee9c43=_0x2aa7ac;_0x57f8ac=_0xee9c43[_0x28d0('0x10')]||0x1388;}})[_0x28d0('0x11')](function(){return dbH[_0x28d0('0x12')][_0x28d0('0x13')](util[_0x28d0('0xb')](_0x28d0('0x14'),QUERY),{'type':dbH['sequelize'][_0x28d0('0x15')][_0x28d0('0x16')]});})[_0x28d0('0x11')](function(_0x29532a){if(!_0x29532a[0x0]['num']){return analyticExtractedReport('Empty');}var _0x121527=[];var _0x37342d=0x0;if(_0xee9c43[_0x28d0('0xf')]){if(_0x29532a&&_0x29532a[_0x28d0('0x17')]){var _0x56fd84=_['range'](_0x29532a[0x0][_0x28d0('0x18')]/_0x57f8ac);var _0x3ac280=Number[_0x28d0('0x19')](_0x29532a[0x0][_0x28d0('0x18')]/_0x57f8ac)?_0x29532a[0x0][_0x28d0('0x18')]%_0x57f8ac:0x0;_0x56fd84[_0x28d0('0x1a')](function(_0x87b79f){if(_0x87b79f>0x0){_0x37342d+=_0x57f8ac;}_0x121527[_0x28d0('0x1b')](dbH[_0x28d0('0x12')][_0x28d0('0x13')](util[_0x28d0('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x57f8ac,_0x37342d),{'type':dbH[_0x28d0('0x12')][_0x28d0('0x15')][_0x28d0('0x16')]}));});if(_0x3ac280>0x0){_0x37342d+=_0x57f8ac;_0x121527[_0x28d0('0x1b')](dbH[_0x28d0('0x12')][_0x28d0('0x13')](util['format'](_0x28d0('0x1c'),QUERY,_0x3ac280,_0x37342d),{'type':dbH[_0x28d0('0x12')][_0x28d0('0x15')][_0x28d0('0x16')]}));}}}else{_0x121527[_0x28d0('0x1b')](dbH[_0x28d0('0x12')][_0x28d0('0x13')](QUERY,{'type':dbH[_0x28d0('0x12')]['QueryTypes'][_0x28d0('0x16')]}));}var _0x355bfd=path['dirname'](PATH);var _0x3e71d3=path['basename'](PATH,'.xlsx');var _0x857290=_0xee9c43[_0x28d0('0xf')]&&_0x121527[_0x28d0('0x17')]>0x1;var _0x431278=[];if(!fs[_0x28d0('0x1d')](path['join'](_0x355bfd,_0x3e71d3))&&_0x857290){fs[_0x28d0('0x1e')](path['join'](_0x355bfd,_0x3e71d3));}return BPromise[_0x28d0('0x1f')](_0x121527,function(_0x5e1801){_0x431278[_0x28d0('0x1b')](_0x5e1801);})[_0x28d0('0x11')](function(){for(var _0x48e4bc=0x0;_0x48e4bc<_0x431278[_0x28d0('0x17')];_0x48e4bc+=0x1){var _0x35a250;var _0x44f50b=_0x431278[_0x48e4bc];if(_0x857290){_0x35a250=path[_0x28d0('0x20')](_0x355bfd,_0x3e71d3,util[_0x28d0('0xb')](_0x28d0('0x21'),_0x3e71d3,_0x48e4bc,'xlsx'));}else{_0x35a250=path[_0x28d0('0x20')](_0x355bfd,util[_0x28d0('0xb')](_0x28d0('0x22'),_0x3e71d3,'xlsx'));}fs['writeFileSync'](_0x35a250,json2xls(_0x44f50b),_0x28d0('0x23'));}})['then'](function(){if(_0x857290){return new Promise(function(_0x1c948d){zipdir(path[_0x28d0('0x20')](_0x355bfd,_0x3e71d3),{'saveTo':path[_0x28d0('0x20')](_0x355bfd,util[_0x28d0('0xb')](_0x28d0('0x22'),_0x3e71d3,_0x28d0('0x24')))},function(_0x4e4557,_0x4157ef){rimraf(path['join'](_0x355bfd,_0x3e71d3),function(){});_0x1c948d(_0x28d0('0x25'));});});}})[_0x28d0('0x11')](function(){logger[_0x28d0('0xa')](util[_0x28d0('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x28d0('0x26'),_0x857290?util[_0x28d0('0xb')]('%s.%s',_0x3e71d3,_0x857290?_0x28d0('0x24'):_0x28d0('0x27')):null);});})['catch'](function(_0x5800b8){logger[_0x28d0('0xa')](util[_0x28d0('0xb')](_0x28d0('0x28'),EXTRACTED_REPORT_ID,_0x28d0('0x29')),util[_0x28d0('0x2a')](_0x5800b8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x28d0('0x2b'));})['finally'](function(){process[_0x28d0('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x1cf6=['%s.%s','writeFileSync','binary','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','xlsx','inspect','Failed','exit','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','XLSX','Setting','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','length','existsSync','join','each','%s%d.%s'];(function(_0xd98ca3,_0x38fbd9){var _0x35960d=function(_0x52e8ee){while(--_0x52e8ee){_0xd98ca3['push'](_0xd98ca3['shift']());}};_0x35960d(++_0x38fbd9);}(_0x1cf6,0x1a4));var _0x61cf=function(_0x751d0d,_0x3e714e){_0x751d0d=_0x751d0d-0x0;var _0xa06173=_0x1cf6[_0x751d0d];return _0xa06173;};'use strict';var util=require('util');var path=require(_0x61cf('0x0'));var _=require(_0x61cf('0x1'));var fs=require('fs');var json2xls=require(_0x61cf('0x2'));var BPromise=require(_0x61cf('0x3'));var zipdir=require(_0x61cf('0x4'));var rimraf=require(_0x61cf('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x61cf('0x6'))[_0x61cf('0x7')];var logger=require(_0x61cf('0x8'))(_0x61cf('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x61cf('0xa')][0x2]);var QUERY=process[_0x61cf('0xa')][0x3];var PATH=process[_0x61cf('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x412305,_0x437945){var _0x3c0798={'status':_0x412305};var _0x235576={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x437945){_0x3c0798[_0x61cf('0xb')]=_0x437945;}return db[_0x61cf('0xc')][_0x61cf('0xd')](_0x3c0798,_0x235576);}function main(){var _0x1aab6b=0x1388;var _0x43681d;logger['info'](util[_0x61cf('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x61cf('0xf')));return db[_0x61cf('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x61cf('0x11'),_0x61cf('0x12')]})[_0x61cf('0x13')](function(_0x18b674){if(_0x18b674){_0x43681d=_0x18b674;_0x1aab6b=_0x43681d[_0x61cf('0x12')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x61cf('0x14')](util[_0x61cf('0xe')](_0x61cf('0x15'),QUERY),{'type':dbH[_0x61cf('0x16')][_0x61cf('0x17')][_0x61cf('0x18')]});})[_0x61cf('0x13')](function(_0x4cc012){if(!_0x4cc012[0x0][_0x61cf('0x19')]){return analyticExtractedReport(_0x61cf('0x1a'));}var _0x41ad26=[];var _0xe6a050=0x0;if(_0x43681d[_0x61cf('0x11')]){if(_0x4cc012&&_0x4cc012['length']){var _0x1b9c24=_[_0x61cf('0x1b')](_0x4cc012[0x0][_0x61cf('0x19')]/_0x1aab6b);var _0x36f2d6=Number[_0x61cf('0x1c')](_0x4cc012[0x0][_0x61cf('0x19')]/_0x1aab6b)?_0x4cc012[0x0][_0x61cf('0x19')]%_0x1aab6b:0x0;_0x1b9c24['forEach'](function(_0x5bf713){if(_0x5bf713>0x0){_0xe6a050+=_0x1aab6b;}_0x41ad26[_0x61cf('0x1d')](dbH[_0x61cf('0x16')]['query'](util[_0x61cf('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1aab6b,_0xe6a050),{'type':dbH['sequelize'][_0x61cf('0x17')][_0x61cf('0x18')]}));});if(_0x36f2d6>0x0){_0xe6a050+=_0x1aab6b;_0x41ad26['push'](dbH['sequelize'][_0x61cf('0x14')](util['format'](_0x61cf('0x1e'),QUERY,_0x36f2d6,_0xe6a050),{'type':dbH['sequelize']['QueryTypes'][_0x61cf('0x18')]}));}}}else{_0x41ad26[_0x61cf('0x1d')](dbH[_0x61cf('0x16')][_0x61cf('0x14')](QUERY,{'type':dbH[_0x61cf('0x16')][_0x61cf('0x17')]['SELECT']}));}var _0x540c70=path[_0x61cf('0x1f')](PATH);var _0x3916e6=path[_0x61cf('0x20')](PATH,_0x61cf('0x21'));var _0x53f064=_0x43681d[_0x61cf('0x11')]&&_0x41ad26[_0x61cf('0x22')]>0x1;var _0x3730a1=[];if(!fs[_0x61cf('0x23')](path['join'](_0x540c70,_0x3916e6))&&_0x53f064){fs['mkdirSync'](path[_0x61cf('0x24')](_0x540c70,_0x3916e6));}return BPromise[_0x61cf('0x25')](_0x41ad26,function(_0x27a132){_0x3730a1[_0x61cf('0x1d')](_0x27a132);})['then'](function(){for(var _0x4b4d54=0x0;_0x4b4d54<_0x3730a1['length'];_0x4b4d54+=0x1){var _0x4966a8;var _0x3e3e3d=_0x3730a1[_0x4b4d54];if(_0x53f064){_0x4966a8=path[_0x61cf('0x24')](_0x540c70,_0x3916e6,util[_0x61cf('0xe')](_0x61cf('0x26'),_0x3916e6,_0x4b4d54,'xlsx'));}else{_0x4966a8=path[_0x61cf('0x24')](_0x540c70,util[_0x61cf('0xe')](_0x61cf('0x27'),_0x3916e6,'xlsx'));}fs[_0x61cf('0x28')](_0x4966a8,json2xls(_0x3e3e3d),_0x61cf('0x29'));}})[_0x61cf('0x13')](function(){if(_0x53f064){return new Promise(function(_0x4072ee){zipdir(path['join'](_0x540c70,_0x3916e6),{'saveTo':path[_0x61cf('0x24')](_0x540c70,util[_0x61cf('0xe')](_0x61cf('0x27'),_0x3916e6,_0x61cf('0x2a')))},function(_0x2072c6,_0x3749c4){rimraf(path[_0x61cf('0x24')](_0x540c70,_0x3916e6),function(){});_0x4072ee(_0x61cf('0x2b'));});});}})['then'](function(){logger[_0x61cf('0x2c')](util[_0x61cf('0xe')](_0x61cf('0x2d'),EXTRACTED_REPORT_ID,_0x61cf('0xf')));return analyticExtractedReport(_0x61cf('0x2e'),_0x53f064?util[_0x61cf('0xe')]('%s.%s',_0x3916e6,_0x53f064?_0x61cf('0x2a'):_0x61cf('0x2f')):null);});})['catch'](function(_0x6504d3){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x61cf('0xf')),util[_0x61cf('0x30')](_0x6504d3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x61cf('0x31'));})['finally'](function(){process[_0x61cf('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 87079df..73cc5ff 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 _0x556c=['XCALLY-MOTION-ANSWER=1','splice','GotoIfTime','last','concat','transaction','bulkCreate','catch','error','rewrite','models','Interval','findAll','intervals','IntervalId','VoiceExtension','uniq','map','then','filter','groupBy','exten','queue','playback','hasOwnProperty','extensions','extension','find','type','CDR(type)=%s','context','priority','VoiceExtensionId','push','Set','CDR(routeid)=','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer'];(function(_0x4f02e,_0x4ac328){var _0x5a09cd=function(_0x358155){while(--_0x358155){_0x4f02e['push'](_0x4f02e['shift']());}};_0x5a09cd(++_0x4ac328);}(_0x556c,0x1df));var _0xc556=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x556c[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x5aae13,_0x384f03){var _0x5addd6=this;return _0x5aae13[_0xc556('0x0')][_0xc556('0x1')][_0xc556('0x2')]({'raw':!![]})['then'](function(_0x1be160){_0x5addd6[_0xc556('0x3')]=_0x1be160;return _0x5aae13[_0xc556('0x0')]['VoiceExtension'][_0xc556('0x2')]({'where':{'IntervalId':_0x384f03[_0xc556('0x4')]},'raw':!![]});})['then'](function(_0x239dc8){return _0x5aae13[_0xc556('0x0')][_0xc556('0x5')]['findAll']({'where':{'exten':{'$in':_[_0xc556('0x6')](_[_0xc556('0x7')](_0x239dc8,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xc556('0x8')](function(_0x1d3b99){var _0x4dcaff=_[_0xc556('0x9')](_0x1d3b99,{'priority':'1'});var _0x390a46=_[_0xc556('0x9')](_0x1d3b99,{'isApp':0x1});var _0x34e24e=_[_0xc556('0xa')](_0x390a46,_0xc556('0xb'));var _0x2387e8=[_0xc556('0xc'),_0xc556('0xd')];var _0x38324f=[];var _0x3615d6=[];for(var _0x37655c in _0x34e24e){if(_0x34e24e[_0xc556('0xe')](_0x37655c)){_0x5addd6['priority']=0x2;_0x5addd6[_0xc556('0xf')]=[];_0x5addd6[_0xc556('0x10')]=_[_0xc556('0x11')](_0x4dcaff,{'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')]});_0x5addd6['extensions']['push']({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':'Set','appdata':util['format'](_0xc556('0x13'),_0x34e24e[_0x37655c][0x0]['type']),'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});if(_0x34e24e[_0x37655c][0x0][_0xc556('0x12')]==='inbound'){_0x5addd6['extensions'][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':_0xc556('0x19')+_0x34e24e[_0x37655c][0x0]['VoiceExtensionId'],'context':_0x34e24e[_0x37655c][0x0]['context'],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0]['VoiceExtensionId']});}else if(_0x34e24e[_0x37655c][0x0][_0xc556('0x12')]===_0xc556('0x1a')){if(_0x5addd6[_0xc556('0x10')]){_0x5addd6['extensions'][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':'CDR(destination)='+(_0x5addd6['extension'][_0xc556('0x1b')]?_0xc556('0x1c')+_0x5addd6[_0xc556('0x10')][_0xc556('0x1b')]+'}':_0xc556('0x1d')),'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0]['VoiceExtensionId']});}_0x5addd6[_0xc556('0xf')]['push']({'type':_0x34e24e[_0x37655c][0x0]['type'],'app':'Set','appdata':'CDR(routeid)='+_0x34e24e[_0x37655c][0x0][_0xc556('0x16')],'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0]['exten'],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});var _0xa0245d=_0x5addd6[_0xc556('0x15')]++;_0x5addd6[_0xc556('0xf')]['push']({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x1e'),'appdata':_0xc556('0x1f')+(_0xa0245d+0x2)+_0xc556('0x20')+(_0xa0245d+0x1)+')','context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0xa0245d,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});if(_0x5addd6['extension']){_0x5addd6[_0xc556('0xf')][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':_0x5addd6[_0xc556('0x10')][_0xc556('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x5addd6[_0xc556('0x10')][_0xc556('0x1b')]+'}':_0xc556('0x21'),'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6['priority']++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});}_0x5addd6[_0xc556('0xf')][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':_0xc556('0x22')+_0x34e24e[_0x37655c][0x0]['VoiceExtensionId'],'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0]['VoiceExtensionId']});if(_0x5addd6[_0xc556('0x10')]&&_0x5addd6[_0xc556('0x10')][_0xc556('0xe')](_0xc556('0x23'))&&_0x5addd6[_0xc556('0x10')][_0xc556('0x23')]!==_0xc556('0x24')){_0x5addd6['extensions'][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0]['exten'],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});_0x5addd6[_0xc556('0xf')][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':_0xc556('0x25')+_0x5addd6[_0xc556('0x10')][_0xc556('0x23')]||_0xc556('0x26'),'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0]['VoiceExtensionId']});}}_0x5addd6[_0xc556('0xf')][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':_0xc556('0x27'),'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});_0x5addd6[_0xc556('0xf')][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x34e24e[_0x37655c][0x0]['context'],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});_0x5addd6[_0xc556('0xf')]['push']({'type':_0x34e24e[_0x37655c][0x0]['type'],'app':_0xc556('0x18'),'appdata':_0xc556('0x28'),'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0]['VoiceExtensionId']});for(var _0x23aab4=0x0,_0x3d4050=0x0;_0x23aab4<_0x34e24e[_0x37655c][_0xc556('0x29')];_0x23aab4+=0x1,_0x3d4050=0x0){var _0x54c7a1=_0x34e24e[_0x37655c][_0x23aab4];if(_0x54c7a1[_0xc556('0x12')]){_0x54c7a1[_0xc556('0x12')]=_0x54c7a1[_0xc556('0x12')][_0xc556('0x2a')]();}var _0x19e6aa=[];var _0x1b32f4=[];delete _0x54c7a1['id'];delete _0x54c7a1[_0xc556('0x2b')];delete _0x54c7a1[_0xc556('0x2c')];var _0x5a86c0=_0x54c7a1[_0xc556('0x2d')]!==_0xc556('0x2e')?[_0x54c7a1[_0xc556('0x2d')]]:_0x54c7a1[_0xc556('0x4')]?_['map'](_[_0xc556('0x9')](_0x5addd6['intervals'],{'IntervalId':_0x54c7a1[_0xc556('0x4')]}),'interval'):[];if(_0x54c7a1['hasOwnProperty'](_0xc556('0x2f'))){if(_0x54c7a1[_0xc556('0x2f')]&&_0x54c7a1[_0xc556('0x2f')]!=='--'){_0x19e6aa[_0xc556('0x17')]({'type':_0x54c7a1['type'],'app':_0xc556('0x18'),'appdata':_0xc556('0x30')+_0x54c7a1['tag'],'context':_0x54c7a1[_0xc556('0x14')],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6[_0xc556('0x15')]+_0x3d4050++,'VoiceExtensionId':_0x54c7a1['VoiceExtensionId']});}}if(_0x54c7a1[_0xc556('0x12')]===_0xc556('0x1a')&&_0x54c7a1[_0xc556('0xe')](_0xc556('0x31'))){if(_0x54c7a1[_0xc556('0x31')]){_0x19e6aa['push']({'type':_0x54c7a1[_0xc556('0x12')],'app':_0xc556('0x1e'),'appdata':_0xc556('0x32')+_0x54c7a1[_0xc556('0x31')]+')','context':_0x54c7a1['context'],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6['priority']+_0x3d4050++,'VoiceExtensionId':_0x54c7a1[_0xc556('0x16')]});}else{_0x19e6aa[_0xc556('0x17')]({'type':_0x54c7a1[_0xc556('0x12')],'app':_0xc556('0x1e'),'appdata':_0xc556('0x33'),'context':_0x54c7a1[_0xc556('0x14')],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6[_0xc556('0x15')]+_0x3d4050++,'VoiceExtensionId':_0x54c7a1['VoiceExtensionId']});}}if(_0x54c7a1[_0xc556('0xe')](_0xc556('0x34'))){if(_0x2387e8[_0xc556('0x35')](_0x54c7a1['app'][_0xc556('0x2a')]())>=0x0&&_0x54c7a1[_0xc556('0x36')]!==_0xc556('0x37')){if(_0x54c7a1['answer']){_0x19e6aa['push']({'type':_0x54c7a1['type'],'app':_0xc556('0x1e'),'appdata':_0xc556('0x38'),'context':_0x54c7a1['context'],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6['priority']+_0x3d4050++,'VoiceExtensionId':_0x54c7a1[_0xc556('0x16')]});_0x19e6aa['push']({'type':_0x54c7a1[_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':_0xc556('0x39'),'context':_0x54c7a1[_0xc556('0x14')],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6[_0xc556('0x15')]+_0x3d4050++,'VoiceExtensionId':_0x54c7a1[_0xc556('0x16')]});}else{_0x19e6aa[_0xc556('0x17')]({'type':_0x54c7a1[_0xc556('0x12')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x54c7a1[_0xc556('0x14')],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6[_0xc556('0x15')]+_0x3d4050++,'VoiceExtensionId':_0x54c7a1[_0xc556('0x16')]});_0x19e6aa[_0xc556('0x17')]({'type':_0x54c7a1[_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x54c7a1[_0xc556('0x14')],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6[_0xc556('0x15')]+_0x3d4050++,'VoiceExtensionId':_0x54c7a1[_0xc556('0x16')]});}}}for(var _0x444e00=0x0;_0x444e00<_0x5a86c0[_0xc556('0x29')];_0x444e00+=0x1){var _0x1fbb36=_0x5addd6[_0xc556('0x15')]+_0x5a86c0[_0xc556('0x29')];var _0x1e0fe7=_0x444e00===_0x5a86c0[_0xc556('0x29')]-0x1?_0x5addd6[_0xc556('0x15')]+_0x19e6aa[_0xc556('0x29')]+_0x1b32f4[_0xc556('0x29')]+0x2:_0x5addd6[_0xc556('0x15')]+_0x444e00+0x1;_0x19e6aa[_0xc556('0x3a')](_0x444e00,0x0,{'type':_0x54c7a1['type'],'app':_0xc556('0x3b'),'appdata':_0x5a86c0[_0x444e00]+'?'+_0x54c7a1['context']+',${EXTEN},'+_0x1fbb36+':'+_0x54c7a1[_0xc556('0x14')]+',${EXTEN},'+_0x1e0fe7,'exten':_0x54c7a1['exten'],'context':_0x54c7a1[_0xc556('0x14')],'priority':_0x5addd6[_0xc556('0x15')]+_0x444e00,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});}_0x54c7a1[_0xc556('0x15')]=_0x19e6aa[_0xc556('0x29')]?_[_0xc556('0x3c')](_0x19e6aa)[_0xc556('0x15')]+0x1:_0x5addd6[_0xc556('0x15')];_0x5addd6[_0xc556('0x15')]=(_0x1b32f4[_0xc556('0x29')]?_['last'](_0x1b32f4)[_0xc556('0x15')]:_0x54c7a1[_0xc556('0x15')])+0x1;_0x5addd6[_0xc556('0xf')]=_[_0xc556('0x3d')](_0x5addd6['extensions'],_0x19e6aa,[_0x54c7a1],_0x1b32f4);}_0x5addd6[_0xc556('0xf')][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':'Hangup','exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'priority':_0x5addd6[_0xc556('0x15')],'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});_0x38324f[_0xc556('0x17')](_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]);_0x3615d6=_[_0xc556('0x3d')](_0x3615d6,_0x5addd6[_0xc556('0xf')]);}}return _0x5aae13[_0xc556('0x3e')](function(_0x34aa43){return _0x5aae13[_0xc556('0x0')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x38324f}},'transaction':_0x34aa43})[_0xc556('0x8')](function(_0x6772ab){return _0x5aae13[_0xc556('0x0')]['VoiceExtension'][_0xc556('0x3f')](_['sortBy'](_0x3615d6,_0xc556('0x15')),{'transaction':_0x34aa43});});});})[_0xc556('0x40')](function(_0x4c6fb5){console[_0xc556('0x41')](_0x4c6fb5);});}exports[_0xc556('0x42')]=rewrite; \ No newline at end of file +var _0xbb97=['tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','concat','Hangup','destroy','bulkCreate','sortBy','error','lodash','models','Interval','findAll','then','intervals','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','extension','find','type','format','context','inbound','push','Set','CDR(routeid)=','VoiceExtensionId','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','IntervalId'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbb97,0xf1));var _0x7bb9=function(_0x5c67af,_0x2a1e67){_0x5c67af=_0x5c67af-0x0;var _0x1314a1=_0xbb97[_0x5c67af];return _0x1314a1;};'use strict';var _=require(_0x7bb9('0x0'));var util=require('util');function rewrite(_0x2b6e45,_0x4f231b){var _0x128d3a=this;return _0x2b6e45[_0x7bb9('0x1')][_0x7bb9('0x2')][_0x7bb9('0x3')]({'raw':!![]})[_0x7bb9('0x4')](function(_0x2aa2ce){_0x128d3a[_0x7bb9('0x5')]=_0x2aa2ce;return _0x2b6e45[_0x7bb9('0x1')][_0x7bb9('0x6')][_0x7bb9('0x3')]({'where':{'IntervalId':_0x4f231b['IntervalId']},'raw':!![]});})['then'](function(_0x103477){return _0x2b6e45[_0x7bb9('0x1')][_0x7bb9('0x6')][_0x7bb9('0x3')]({'where':{'exten':{'$in':_[_0x7bb9('0x7')](_[_0x7bb9('0x8')](_0x103477,_0x7bb9('0x9')))}},'order':[{'raw':_0x7bb9('0xa')}],'raw':!![]});})['then'](function(_0x43aed1){var _0x5cf97a=_['filter'](_0x43aed1,{'priority':'1'});var _0x535672=_[_0x7bb9('0xb')](_0x43aed1,{'isApp':0x1});var _0x10bfef=_[_0x7bb9('0xc')](_0x535672,_0x7bb9('0x9'));var _0x4b4817=[_0x7bb9('0xd'),_0x7bb9('0xe')];var _0xd6d0e7=[];var _0x278577=[];for(var _0x3670c0 in _0x10bfef){if(_0x10bfef['hasOwnProperty'](_0x3670c0)){_0x128d3a[_0x7bb9('0xf')]=0x2;_0x128d3a[_0x7bb9('0x10')]=[];_0x128d3a[_0x7bb9('0x11')]=_[_0x7bb9('0x12')](_0x5cf97a,{'exten':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x9')]});_0x128d3a[_0x7bb9('0x10')]['push']({'type':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x13')],'app':'Set','appdata':util[_0x7bb9('0x14')]('CDR(type)=%s',_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x13')]),'context':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x15')],'exten':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x9')],'priority':_0x128d3a[_0x7bb9('0xf')]++,'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0]['VoiceExtensionId']});if(_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x13')]===_0x7bb9('0x16')){_0x128d3a[_0x7bb9('0x10')][_0x7bb9('0x17')]({'type':_0x10bfef[_0x3670c0][0x0]['type'],'app':_0x7bb9('0x18'),'appdata':_0x7bb9('0x19')+_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x1a')],'context':_0x10bfef[_0x3670c0][0x0]['context'],'exten':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x9')],'priority':_0x128d3a['priority']++,'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x1a')]});}else if(_0x10bfef[_0x3670c0][0x0]['type']==='outbound'){if(_0x128d3a[_0x7bb9('0x11')]){_0x128d3a[_0x7bb9('0x10')][_0x7bb9('0x17')]({'type':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x13')],'app':_0x7bb9('0x18'),'appdata':_0x7bb9('0x1b')+(_0x128d3a[_0x7bb9('0x11')][_0x7bb9('0x1c')]?_0x7bb9('0x1d')+_0x128d3a[_0x7bb9('0x11')]['cutdigits']+'}':_0x7bb9('0x1e')),'context':_0x10bfef[_0x3670c0][0x0]['context'],'exten':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x9')],'priority':_0x128d3a['priority']++,'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x1a')]});}_0x128d3a[_0x7bb9('0x10')][_0x7bb9('0x17')]({'type':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x13')],'app':_0x7bb9('0x18'),'appdata':_0x7bb9('0x19')+_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x1a')],'context':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x15')],'exten':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x9')],'priority':_0x128d3a[_0x7bb9('0xf')]++,'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0]['VoiceExtensionId']});var _0x2b847d=_0x128d3a[_0x7bb9('0xf')]++;_0x128d3a['extensions'][_0x7bb9('0x17')]({'type':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x13')],'app':_0x7bb9('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2b847d+0x2)+_0x7bb9('0x20')+(_0x2b847d+0x1)+')','context':_0x10bfef[_0x3670c0][0x0]['context'],'exten':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x9')],'priority':_0x2b847d,'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x1a')]});if(_0x128d3a['extension']){_0x128d3a[_0x7bb9('0x10')][_0x7bb9('0x17')]({'type':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x13')],'app':_0x7bb9('0x18'),'appdata':_0x128d3a[_0x7bb9('0x11')][_0x7bb9('0x1c')]?_0x7bb9('0x21')+_0x128d3a['extension']['cutdigits']+'}':_0x7bb9('0x22'),'context':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x15')],'exten':_0x10bfef[_0x3670c0][0x0]['exten'],'priority':_0x128d3a[_0x7bb9('0xf')]++,'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0]['VoiceExtensionId']});}_0x128d3a[_0x7bb9('0x10')][_0x7bb9('0x17')]({'type':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x13')],'app':'Set','appdata':_0x7bb9('0x23')+_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x1a')],'context':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x15')],'exten':_0x10bfef[_0x3670c0][0x0]['exten'],'priority':_0x128d3a['priority']++,'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x1a')]});if(_0x128d3a['extension']&&_0x128d3a[_0x7bb9('0x11')][_0x7bb9('0x24')](_0x7bb9('0x25'))&&_0x128d3a[_0x7bb9('0x11')]['recordingFormat']!==_0x7bb9('0x26')){_0x128d3a[_0x7bb9('0x10')][_0x7bb9('0x17')]({'type':_0x10bfef[_0x3670c0][0x0]['type'],'app':'Set','appdata':_0x7bb9('0x27'),'context':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x15')],'exten':_0x10bfef[_0x3670c0][0x0]['exten'],'priority':_0x128d3a['priority']++,'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x1a')]});_0x128d3a[_0x7bb9('0x10')][_0x7bb9('0x17')]({'type':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x13')],'app':_0x7bb9('0x18'),'appdata':_0x7bb9('0x28')+_0x128d3a[_0x7bb9('0x11')][_0x7bb9('0x25')]||_0x7bb9('0x29'),'context':_0x10bfef[_0x3670c0][0x0]['context'],'exten':_0x10bfef[_0x3670c0][0x0]['exten'],'priority':_0x128d3a[_0x7bb9('0xf')]++,'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x1a')]});}}_0x128d3a[_0x7bb9('0x10')][_0x7bb9('0x17')]({'type':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x13')],'app':'Set','appdata':_0x7bb9('0x2a'),'context':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x15')],'exten':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x9')],'priority':_0x128d3a[_0x7bb9('0xf')]++,'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0]['VoiceExtensionId']});_0x128d3a[_0x7bb9('0x10')]['push']({'type':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x13')],'app':_0x7bb9('0x18'),'appdata':_0x7bb9('0x2b'),'context':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x15')],'exten':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x9')],'priority':_0x128d3a[_0x7bb9('0xf')]++,'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x1a')]});_0x128d3a[_0x7bb9('0x10')][_0x7bb9('0x17')]({'type':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x13')],'app':_0x7bb9('0x18'),'appdata':_0x7bb9('0x2c'),'context':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x15')],'exten':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x9')],'priority':_0x128d3a['priority']++,'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x1a')]});for(var _0x5efd57=0x0,_0x1f7d52=0x0;_0x5efd57<_0x10bfef[_0x3670c0]['length'];_0x5efd57+=0x1,_0x1f7d52=0x0){var _0x917685=_0x10bfef[_0x3670c0][_0x5efd57];if(_0x917685[_0x7bb9('0x13')]){_0x917685[_0x7bb9('0x13')]=_0x917685[_0x7bb9('0x13')][_0x7bb9('0x2d')]();}var _0x275fdb=[];var _0x212ad1=[];delete _0x917685['id'];delete _0x917685[_0x7bb9('0x2e')];delete _0x917685[_0x7bb9('0x2f')];var _0x42de5f=_0x917685['interval']!==_0x7bb9('0x30')?[_0x917685[_0x7bb9('0x31')]]:_0x917685['IntervalId']?_[_0x7bb9('0x8')](_[_0x7bb9('0xb')](_0x128d3a[_0x7bb9('0x5')],{'IntervalId':_0x917685[_0x7bb9('0x32')]}),_0x7bb9('0x31')):[];if(_0x917685[_0x7bb9('0x24')](_0x7bb9('0x33'))){if(_0x917685['tag']&&_0x917685[_0x7bb9('0x33')]!=='--'){_0x275fdb[_0x7bb9('0x17')]({'type':_0x917685[_0x7bb9('0x13')],'app':_0x7bb9('0x18'),'appdata':_0x7bb9('0x34')+_0x917685[_0x7bb9('0x33')],'context':_0x917685[_0x7bb9('0x15')],'exten':_0x917685[_0x7bb9('0x9')],'priority':_0x42de5f['length']+_0x128d3a[_0x7bb9('0xf')]+_0x1f7d52++,'VoiceExtensionId':_0x917685[_0x7bb9('0x1a')]});}}if(_0x917685[_0x7bb9('0x13')]===_0x7bb9('0x35')&&_0x917685[_0x7bb9('0x24')]('callerID')){if(_0x917685[_0x7bb9('0x36')]){_0x275fdb[_0x7bb9('0x17')]({'type':_0x917685[_0x7bb9('0x13')],'app':_0x7bb9('0x1f'),'appdata':_0x7bb9('0x37')+_0x917685[_0x7bb9('0x36')]+')','context':_0x917685[_0x7bb9('0x15')],'exten':_0x917685[_0x7bb9('0x9')],'priority':_0x42de5f[_0x7bb9('0x38')]+_0x128d3a[_0x7bb9('0xf')]+_0x1f7d52++,'VoiceExtensionId':_0x917685[_0x7bb9('0x1a')]});}else{_0x275fdb[_0x7bb9('0x17')]({'type':_0x917685[_0x7bb9('0x13')],'app':_0x7bb9('0x1f'),'appdata':_0x7bb9('0x39'),'context':_0x917685[_0x7bb9('0x15')],'exten':_0x917685[_0x7bb9('0x9')],'priority':_0x42de5f[_0x7bb9('0x38')]+_0x128d3a[_0x7bb9('0xf')]+_0x1f7d52++,'VoiceExtensionId':_0x917685['VoiceExtensionId']});}}if(_0x917685[_0x7bb9('0x24')](_0x7bb9('0x3a'))){if(_0x4b4817[_0x7bb9('0x3b')](_0x917685['app']['toLowerCase']())>=0x0&&_0x917685[_0x7bb9('0x3c')]!=='custom'){if(_0x917685[_0x7bb9('0x3a')]){_0x275fdb['push']({'type':_0x917685['type'],'app':'ExecIf','appdata':_0x7bb9('0x3d'),'context':_0x917685[_0x7bb9('0x15')],'exten':_0x917685[_0x7bb9('0x9')],'priority':_0x42de5f[_0x7bb9('0x38')]+_0x128d3a[_0x7bb9('0xf')]+_0x1f7d52++,'VoiceExtensionId':_0x917685[_0x7bb9('0x1a')]});_0x275fdb['push']({'type':_0x917685[_0x7bb9('0x13')],'app':_0x7bb9('0x18'),'appdata':_0x7bb9('0x3e'),'context':_0x917685[_0x7bb9('0x15')],'exten':_0x917685['exten'],'priority':_0x42de5f[_0x7bb9('0x38')]+_0x128d3a[_0x7bb9('0xf')]+_0x1f7d52++,'VoiceExtensionId':_0x917685[_0x7bb9('0x1a')]});}else{_0x275fdb[_0x7bb9('0x17')]({'type':_0x917685[_0x7bb9('0x13')],'app':_0x7bb9('0x1f'),'appdata':_0x7bb9('0x3f'),'context':_0x917685[_0x7bb9('0x15')],'exten':_0x917685['exten'],'priority':_0x42de5f[_0x7bb9('0x38')]+_0x128d3a[_0x7bb9('0xf')]+_0x1f7d52++,'VoiceExtensionId':_0x917685[_0x7bb9('0x1a')]});_0x275fdb[_0x7bb9('0x17')]({'type':_0x917685[_0x7bb9('0x13')],'app':_0x7bb9('0x18'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x917685['context'],'exten':_0x917685['exten'],'priority':_0x42de5f[_0x7bb9('0x38')]+_0x128d3a[_0x7bb9('0xf')]+_0x1f7d52++,'VoiceExtensionId':_0x917685['VoiceExtensionId']});}}}for(var _0x5c9bc6=0x0;_0x5c9bc6<_0x42de5f[_0x7bb9('0x38')];_0x5c9bc6+=0x1){var _0x181767=_0x128d3a[_0x7bb9('0xf')]+_0x42de5f[_0x7bb9('0x38')];var _0x471cbf=_0x5c9bc6===_0x42de5f[_0x7bb9('0x38')]-0x1?_0x128d3a[_0x7bb9('0xf')]+_0x275fdb[_0x7bb9('0x38')]+_0x212ad1['length']+0x2:_0x128d3a[_0x7bb9('0xf')]+_0x5c9bc6+0x1;_0x275fdb[_0x7bb9('0x40')](_0x5c9bc6,0x0,{'type':_0x917685[_0x7bb9('0x13')],'app':_0x7bb9('0x41'),'appdata':_0x42de5f[_0x5c9bc6]+'?'+_0x917685[_0x7bb9('0x15')]+',${EXTEN},'+_0x181767+':'+_0x917685[_0x7bb9('0x15')]+_0x7bb9('0x42')+_0x471cbf,'exten':_0x917685['exten'],'context':_0x917685[_0x7bb9('0x15')],'priority':_0x128d3a['priority']+_0x5c9bc6,'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0]['VoiceExtensionId']});}_0x917685['priority']=_0x275fdb[_0x7bb9('0x38')]?_['last'](_0x275fdb)['priority']+0x1:_0x128d3a['priority'];_0x128d3a[_0x7bb9('0xf')]=(_0x212ad1[_0x7bb9('0x38')]?_['last'](_0x212ad1)[_0x7bb9('0xf')]:_0x917685[_0x7bb9('0xf')])+0x1;_0x128d3a[_0x7bb9('0x10')]=_[_0x7bb9('0x43')](_0x128d3a[_0x7bb9('0x10')],_0x275fdb,[_0x917685],_0x212ad1);}_0x128d3a[_0x7bb9('0x10')][_0x7bb9('0x17')]({'type':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x13')],'app':_0x7bb9('0x44'),'exten':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x9')],'context':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x15')],'priority':_0x128d3a[_0x7bb9('0xf')],'VoiceExtensionId':_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x1a')]});_0xd6d0e7[_0x7bb9('0x17')](_0x10bfef[_0x3670c0][0x0][_0x7bb9('0x1a')]);_0x278577=_['concat'](_0x278577,_0x128d3a['extensions']);}}return _0x2b6e45['transaction'](function(_0x191424){return _0x2b6e45['models'][_0x7bb9('0x6')][_0x7bb9('0x45')]({'where':{'VoiceExtensionId':{'$in':_0xd6d0e7}},'transaction':_0x191424})[_0x7bb9('0x4')](function(_0x10edcf){return _0x2b6e45['models']['VoiceExtension'][_0x7bb9('0x46')](_[_0x7bb9('0x47')](_0x278577,_0x7bb9('0xf')),{'transaction':_0x191424});});});})['catch'](function(_0x2f2ec5){console[_0x7bb9('0x48')](_0x2f2ec5);});}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 d6b2e29..0172ebc 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 _0x6ed3=['cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','outbound','CmList','Lists','get','dialCheckDuplicateType','always','push','sequelize','query','onlyIfOpen','VoiceQueueId','all','findAll','BlackLists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','resolve','createReadStream','parse','pause','info','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','ioredis','../../../config/environment','api','defaults','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','select','field','NOW()','ContactId','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','\x20=\x20?','str','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum'];(function(_0x5f2fc9,_0x3eff8f){var _0x1dd418=function(_0x5818f7){while(--_0x5818f7){_0x5f2fc9['push'](_0x5f2fc9['shift']());}};_0x1dd418(++_0x3eff8f);}(_0x6ed3,0x16c));var _0x36ed=function(_0x39bfb6,_0x4272c8){_0x39bfb6=_0x39bfb6-0x0;var _0x23fef9=_0x6ed3[_0x39bfb6];return _0x23fef9;};'use strict';var BPromise=require(_0x36ed('0x0'));var util=require(_0x36ed('0x1'));var _=require(_0x36ed('0x2'));var fs=require('fs');var squel=require(_0x36ed('0x3'));var Papa=require(_0x36ed('0x4'));var Redis=require(_0x36ed('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x36ed('0x6'));var logger=require('../../../config/logger')(_0x36ed('0x7'));config['redis']=_[_0x36ed('0x8')](config[_0x36ed('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x36ed('0xa'))(new Redis(config[_0x36ed('0x9')]));require(_0x36ed('0xb'))[_0x36ed('0xc')](socket);try{if(!process[_0x36ed('0xd')][0x2]||process[_0x36ed('0xd')][0x2]===_0x36ed('0xe')||process[_0x36ed('0xd')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x36ed('0xd')][0x2];if(!process[_0x36ed('0xd')][0x3]||process[_0x36ed('0xd')][0x3]===_0x36ed('0xe')||process[_0x36ed('0xd')][0x3]===_0x36ed('0xf')||!process['argv'][0x4]||process[_0x36ed('0xd')][0x4]===_0x36ed('0xe')||process[_0x36ed('0xd')][0x4]==='null'){throw new Error(_0x36ed('0x10'));}var FIELDS=_[_0x36ed('0x11')](process['argv'][0x3][_0x36ed('0x12')](','),process[_0x36ed('0xd')][0x4][_0x36ed('0x12')](','));if(!process[_0x36ed('0xd')][0x5]||process[_0x36ed('0xd')][0x5]===_0x36ed('0xe')||process[_0x36ed('0xd')][0x5]===_0x36ed('0xf')){throw new Error(_0x36ed('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x36ed('0xd')][0x6]&&process[_0x36ed('0xd')][0x6]!==_0x36ed('0xe')&&process['argv'][0x6]!==_0x36ed('0xf')?process[_0x36ed('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x36ed('0xd')][0x7]!==_0x36ed('0xe')&&process[_0x36ed('0xd')][0x7]!==_0x36ed('0xf')?process['argv'][0x7]:null;if(!process[_0x36ed('0xd')][0x8]||process[_0x36ed('0xd')][0x8]===_0x36ed('0xe')||process[_0x36ed('0xd')][0x8]===_0x36ed('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x30a01d){logger[_0x36ed('0x14')](_0x30a01d);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(_0x431bcc,_0x408016,_0x2f4c0d,_0xe88159){var _0x142e4c={'message':_0x408016};_0x142e4c[_0x431bcc]=!![];if(_0x2f4c0d){_0x142e4c['contact']=_0x2f4c0d;}if(_0xe88159){_0x142e4c[_0x36ed('0x15')]=_0xe88159;}return _0x142e4c;}function isEmail(_0x273bb2){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'](_0x273bb2);}function checkRow(_0x3708cb,_0x204cc4,_0x346837){return new BPromise(function(_0x2129a6,_0x19409a){if(_[_0x36ed('0x16')](_0x3708cb)){return _0x19409a(handleCheckRowError('error',_0x36ed('0x17'),null,_0x346837));}if(_0x3708cb['errors']&&_0x3708cb['errors'][_0x36ed('0x18')]){var _0x46659e=_[_0x36ed('0x19')](_0x3708cb['errors'],_0x36ed('0x1a'))[_0x36ed('0x1b')](';');return _0x19409a(handleCheckRowError(_0x36ed('0x14'),_0x46659e,null,_0x346837));}var _0x181b34={};for(var _0x308ce0 in FIELDS){if(FIELDS[_0x36ed('0x1c')](_0x308ce0)&&FIELDS[_0x308ce0]){_0x181b34[_0x308ce0]=_0x3708cb[_0x36ed('0x1d')][0x0][FIELDS[_0x308ce0]]||_0x3708cb['data'][0x0]['\ufeff'+FIELDS[_0x308ce0]];}}if(!_0x181b34[_0x36ed('0x1e')]){return _0x19409a(handleCheckRowError('error',_0x36ed('0x1f'),null,_0x346837));}if(!_0x181b34[_0x36ed('0x20')]){return _0x19409a(handleCheckRowError(_0x36ed('0x14'),'phone\x20not\x20specified!',null,_0x346837));}if(_0x181b34[_0x36ed('0x21')]){var _0x25cf83=moment(_0x181b34[_0x36ed('0x21')],_0x36ed('0x22'));if(!_0x25cf83['isValid']()){return _0x19409a(handleCheckRowError(_0x36ed('0x14'),_0x36ed('0x23'),null,_0x346837));}}if(_0x181b34[_0x36ed('0x24')]){if(!isEmail(_0x181b34[_0x36ed('0x24')])){return _0x19409a(handleCheckRowError(_0x36ed('0x14'),_0x36ed('0x25'),null,_0x346837));}}_0x181b34[_0x36ed('0x26')]=LISTID;_0x181b34[_0x36ed('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x204cc4){var _0x3fcc49={};for(var _0x5e5db5=0x0,_0x45d453=DUPLICATES[_0x36ed('0x18')];_0x5e5db5<_0x45d453;_0x5e5db5+=0x1){_0x3fcc49[DUPLICATES[_0x5e5db5]]=_0x181b34[DUPLICATES[_0x5e5db5]];}var _0xb20cbf=_[_0x36ed('0x28')](_0x204cc4,_0x3fcc49);if(_0xb20cbf){return _0x19409a(handleCheckRowError(_0x36ed('0x29'),_0x36ed('0x2a'),_0xb20cbf,_0x346837));}}return db[_0x36ed('0x2b')]['create'](_0x181b34,{'raw':!![],'hooks':![],'fields':_[_0x36ed('0x2c')](_0x181b34)})[_0x36ed('0x2d')](function(_0x5c769b){if(DUPLICATES&&DUPLICATES['length']&&_0x204cc4){_0x204cc4['push'](_['pick'](_0x181b34,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5c769b['id'];return _0x2129a6();})[_0x36ed('0x2e')](function(_0x552111){return _0x19409a(handleCheckRowError(_0x36ed('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x552111['message']||JSON[_0x36ed('0x2f')](_0x552111)),null,_0x346837));});});}function checkHopper(){function _0x4f4cb8(){return function(_0x137f17){logger[_0x36ed('0x14')](_0x36ed('0x30'),_0x36ed('0x31'),util[_0x36ed('0x32')](_0x137f17,{'showHidden':![],'depth':null}));};}var _0x430741=function(_0x3a3e31,_0x3f4339){var _0x145429=squel[_0x36ed('0x33')]()['into'](_0x36ed('0x34'))[_0x36ed('0x35')]([_0x36ed('0x20'),_0x36ed('0x36'),'ContactId','ListId',_0x3f4339,_0x36ed('0x37'),_0x36ed('0x38')],squel[_0x36ed('0x39')]()[_0x36ed('0x3a')](_0x36ed('0x20'),_0x36ed('0x20'))[_0x36ed('0x3a')](_0x36ed('0x3b'),'scheduledAt')[_0x36ed('0x3a')]('id',_0x36ed('0x3c'))[_0x36ed('0x3a')](LISTID[_0x36ed('0x3d')](),'ListId')[_0x36ed('0x3a')](_0x3a3e31['id'][_0x36ed('0x3d')](),_0x3f4339)['field'](_0x36ed('0x3b'),'createdAt')[_0x36ed('0x3a')](_0x36ed('0x3b'),_0x36ed('0x38'))[_0x36ed('0x3e')](_0x36ed('0x3f'))[_0x36ed('0x40')](_0x36ed('0x41'))[_0x36ed('0x40')](_0x36ed('0x42'),LISTID['toString']())[_0x36ed('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x36ed('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x36ed('0x39')]()[_0x36ed('0x3a')](_0x36ed('0x20'))[_0x36ed('0x3e')](_0x36ed('0x34'))[_0x36ed('0x40')](_0x3f4339+_0x36ed('0x43'),_0x3a3e31['id'][_0x36ed('0x3d')]())))['toString']();return _0x145429;};var _0x580e5c=function(_0x33a55b,_0x3c47a9){var _0x1506ac=squel[_0x36ed('0x33')]()['into']('cm_hopper')['fromQuery']([_0x36ed('0x20'),_0x36ed('0x36'),_0x36ed('0x3c'),_0x36ed('0x26'),_0x3c47a9,_0x36ed('0x37'),_0x36ed('0x38')],squel['select']()[_0x36ed('0x3a')](_0x36ed('0x20'),_0x36ed('0x20'))[_0x36ed('0x3a')](_0x36ed('0x3b'),_0x36ed('0x36'))[_0x36ed('0x3a')]('id',_0x36ed('0x3c'))[_0x36ed('0x3a')](LISTID[_0x36ed('0x3d')](),'ListId')[_0x36ed('0x3a')](_0x33a55b['id'][_0x36ed('0x3d')](),_0x3c47a9)['field'](_0x36ed('0x3b'),_0x36ed('0x37'))[_0x36ed('0x3a')](_0x36ed('0x3b'),_0x36ed('0x38'))['from'](_0x36ed('0x3f'))[_0x36ed('0x40')](_0x36ed('0x41'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0x36ed('0x40')]('id\x20IN\x20?',squel[_0x36ed('0x44')](hopperContacts))[_0x36ed('0x40')](_0x36ed('0x45'))[_0x36ed('0x40')](_0x36ed('0x46'),squel[_0x36ed('0x39')]()['field'](_0x36ed('0x47'))[_0x36ed('0x3e')](_0x36ed('0x48'))[_0x36ed('0x40')](_0x3c47a9+_0x36ed('0x43'),_0x33a55b['id'][_0x36ed('0x3d')]()))['where'](_0x36ed('0x46'),squel[_0x36ed('0x39')]()['field'](_0x36ed('0x20'))[_0x36ed('0x3e')](_0x36ed('0x34'))[_0x36ed('0x40')](_0x3c47a9+_0x36ed('0x43'),_0x33a55b['id'][_0x36ed('0x3d')]())))['toString']();return _0x1506ac;};function _0x2fdaf4(_0x13059c,_0x1ebd85){var _0x1f7fb1=squel[_0x36ed('0x33')]()['into'](_0x36ed('0x34'))[_0x36ed('0x35')]([_0x36ed('0x20'),_0x36ed('0x36'),_0x36ed('0x3c'),_0x36ed('0x26'),_0x1ebd85,_0x36ed('0x37'),_0x36ed('0x38')],squel[_0x36ed('0x39')]()[_0x36ed('0x3a')]('phone','phone')['field'](_0x36ed('0x3b'),_0x36ed('0x36'))[_0x36ed('0x3a')]('id',_0x36ed('0x3c'))[_0x36ed('0x3a')](LISTID['toString'](),_0x36ed('0x26'))[_0x36ed('0x3a')](_0x13059c['id'][_0x36ed('0x3d')](),_0x1ebd85)['field'](_0x36ed('0x3b'),_0x36ed('0x37'))[_0x36ed('0x3a')](_0x36ed('0x3b'),_0x36ed('0x38'))[_0x36ed('0x3e')]('cm_contacts')[_0x36ed('0x40')](_0x36ed('0x41'))[_0x36ed('0x40')](_0x36ed('0x42'),LISTID[_0x36ed('0x3d')]())[_0x36ed('0x40')](_0x36ed('0x49'),squel[_0x36ed('0x44')](hopperContacts))[_0x36ed('0x40')](_0x36ed('0x45')))[_0x36ed('0x3d')]();return _0x1f7fb1;}function _0x5bb765(_0x4932b7,_0x5c5eca){var _0x533ab5=squel[_0x36ed('0x33')]()['into'](_0x36ed('0x4a'))[_0x36ed('0x35')](['phone',_0x36ed('0x3c'),'ListId',_0x5c5eca,'createdAt',_0x36ed('0x38')],squel[_0x36ed('0x39')]()[_0x36ed('0x3a')]('phone',_0x36ed('0x20'))[_0x36ed('0x3a')]('id',_0x36ed('0x3c'))[_0x36ed('0x3a')](LISTID[_0x36ed('0x3d')](),_0x36ed('0x26'))[_0x36ed('0x3a')](_0x4932b7['id']['toString'](),_0x5c5eca)['field'](_0x36ed('0x3b'),'createdAt')[_0x36ed('0x3a')](_0x36ed('0x3b'),'updatedAt')[_0x36ed('0x3e')](_0x36ed('0x3f'))[_0x36ed('0x40')](_0x36ed('0x41'))[_0x36ed('0x40')](_0x36ed('0x42'),LISTID[_0x36ed('0x3d')]())[_0x36ed('0x40')](_0x36ed('0x49'),squel['str'](hopperContacts))[_0x36ed('0x40')](_0x36ed('0x45')))['toString']();return _0x533ab5;}return db[_0x36ed('0x4b')]['findAll']({'where':{'type':_0x36ed('0x4c')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x36ed('0x4d')],'as':_0x36ed('0x4e'),'where':{'id':LISTID}}]})[_0x36ed('0x2d')](function(_0x50c8e7){var _0x3ebee1=[];if(_0x50c8e7){var _0x548776;for(var _0xb0093e=0x0,_0x67ff1f;_0xb0093e<_0x50c8e7[_0x36ed('0x18')];_0xb0093e+=0x1){_0x67ff1f=_0x50c8e7[_0xb0093e][_0x36ed('0x4f')]({'plain':!![]});switch(_0x67ff1f[_0x36ed('0x50')]){case _0x36ed('0x51'):_0x3ebee1[_0x36ed('0x52')](db[_0x36ed('0x53')][_0x36ed('0x54')](_0x580e5c(_0x67ff1f,'VoiceQueueId'))[_0x36ed('0x2d')](function(){})[_0x36ed('0x2e')](_0x4f4cb8()));break;case _0x36ed('0x55'):_0x3ebee1[_0x36ed('0x52')](db['sequelize'][_0x36ed('0x54')](_0x430741(_0x67ff1f,_0x36ed('0x56')))[_0x36ed('0x2d')](function(){})['catch'](_0x4f4cb8()));break;default:_0x3ebee1['push'](db['sequelize'][_0x36ed('0x54')](_0x2fdaf4(_0x67ff1f,_0x36ed('0x56')))[_0x36ed('0x2d')](function(){})[_0x36ed('0x2e')](_0x4f4cb8()));}}}return _0x3ebee1;})[_0x36ed('0x57')]()[_0x36ed('0x2d')](function(){return db[_0x36ed('0x4b')][_0x36ed('0x58')]({'where':{'type':_0x36ed('0x4c')},'attributes':['id'],'include':[{'model':db[_0x36ed('0x4d')],'as':_0x36ed('0x59'),'where':{'id':LISTID}}]})[_0x36ed('0x2d')](function(_0x3892ad){var _0x325303=[];if(_0x3892ad){var _0x5b8fde;for(var _0x450e00=0x0,_0x4a7cde;_0x450e00<_0x3892ad[_0x36ed('0x18')];_0x450e00+=0x1){_0x4a7cde=_0x3892ad[_0x450e00][_0x36ed('0x4f')]({'plain':!![]});_0x325303[_0x36ed('0x52')](db[_0x36ed('0x53')]['query'](_0x5bb765(_0x4a7cde,_0x36ed('0x56')))[_0x36ed('0x2d')](function(){})[_0x36ed('0x2e')](_0x4f4cb8()));}}return _0x325303;})['all']();})[_0x36ed('0x2d')](function(){return db['Campaign']['findAll']({'attributes':['id',_0x36ed('0x50')],'include':[{'model':db[_0x36ed('0x4d')],'as':'Lists','where':{'id':LISTID}}]})[_0x36ed('0x2d')](function(_0x8ef8a8){var _0x2289a8=[];if(_0x8ef8a8){for(var _0x4d1019=0x0,_0x61d945;_0x4d1019<_0x8ef8a8[_0x36ed('0x18')];_0x4d1019+=0x1){_0x61d945=_0x8ef8a8[_0x4d1019]['get']({'plain':!![]});switch(_0x61d945['dialCheckDuplicateType']){case _0x36ed('0x51'):_0x2289a8[_0x36ed('0x52')](db[_0x36ed('0x53')][_0x36ed('0x54')](_0x580e5c(_0x61d945,_0x36ed('0x5a')))['then'](function(){})[_0x36ed('0x2e')](_0x4f4cb8()));break;case _0x36ed('0x55'):_0x2289a8[_0x36ed('0x52')](db[_0x36ed('0x53')][_0x36ed('0x54')](_0x430741(_0x61d945,_0x36ed('0x5a')))['then'](function(){})['catch'](_0x4f4cb8()));break;default:_0x2289a8[_0x36ed('0x52')](db[_0x36ed('0x53')][_0x36ed('0x54')](_0x2fdaf4(_0x61d945,_0x36ed('0x5a')))[_0x36ed('0x2d')](function(){})[_0x36ed('0x2e')](_0x4f4cb8()));}}}return _0x2289a8;})['all']();})['then'](function(){return db[_0x36ed('0x5b')][_0x36ed('0x58')]({'attributes':['id'],'include':[{'model':db[_0x36ed('0x4d')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x121983){var _0xc4708f=[];if(_0x121983){for(var _0x357459=0x0,_0x203668;_0x357459<_0x121983['length'];_0x357459+=0x1){_0x203668=_0x121983[_0x357459]['get']({'plain':!![]});_0xc4708f[_0x36ed('0x52')](db[_0x36ed('0x53')][_0x36ed('0x54')](_0x5bb765(_0x203668,_0x36ed('0x5a')))[_0x36ed('0x2d')](function(){})[_0x36ed('0x2e')](_0x4f4cb8()));}}return _0xc4708f;})[_0x36ed('0x57')]();})[_0x36ed('0x2e')](function(_0x58b811){logger[_0x36ed('0x14')](_0x36ed('0x5c'),_0x36ed('0x5d'),_0x58b811[_0x36ed('0x1a')]);});}var processPromises=function(_0x20e2c0){return BPromise['all'](promises)[_0x36ed('0x2d')](function(_0xa2584){})[_0x36ed('0x2e')](function(_0x8f4560){logger[_0x36ed('0x14')](_0x36ed('0x5e'),JSON[_0x36ed('0x2f')](_0x8f4560));})[_0x36ed('0x5f')](function(){socket[_0x36ed('0x60')](_0x36ed('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x20e2c0){return _0x20e2c0[_0x36ed('0x62')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x36ed('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x36ed('0x2d')](function(){socket['emit'](_0x36ed('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x36ed('0x63')](FILEPATH);}catch(_0x4c729c){logger[_0x36ed('0x14')](_0x36ed('0x64'),JSON[_0x36ed('0x2f')](_0x4c729c));}finally{process[_0x36ed('0x65')](0x0);}});};process['on'](_0x36ed('0x66'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x36ed('0x67')]()[_0x36ed('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x36ed('0x12')](',');return db[_0x36ed('0x2b')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x36ed('0x2d')](function(_0x432648){var _0x57c7a9=fs[_0x36ed('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x36ed('0x69')](_0x57c7a9,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c914b,_0x1d68f7){total+=0x1;var _0x31d2fb=total;promises[_0x36ed('0x52')](checkRow(_0x3c914b,_0x432648,_0x31d2fb)[_0x36ed('0x2d')](function(){success+=0x1;})['catch'](function(_0x4418e5){if(_0x4418e5['error']){errors+=0x1;delete _0x4418e5[_0x36ed('0x14')];}else if(_0x4418e5['duplicate']){duplicates+=0x1;delete _0x4418e5['duplicate'];}rows[_0x36ed('0x52')](_0x4418e5);}));if(total%0xc8===0x0){_0x1d68f7[_0x36ed('0x6a')]();return processPromises(_0x1d68f7);}},'complete':function(){return processPromises()['then'](function(){logger[_0x36ed('0x6b')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x319415,_0x6d2f2d){logger[_0x36ed('0x6b')](_0x36ed('0x6c'),JSON[_0x36ed('0x2f')](_0x319415));endCsv();}});})[_0x36ed('0x2e')](function(_0x8c221f){logger[_0x36ed('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x36ed('0x2f')](_0x8c221f));});}main(); \ No newline at end of file +var _0xe688=['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','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','into','createdAt','updatedAt','select','field','NOW()','scheduledAt','ContactId','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','fromQuery','id\x20IN\x20?','str','calleridnum','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','Lists','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','CmList','CampaignId','cmContact,\x20%s,\x20%s','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','undefined','argv','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','hasOwnProperty','firstName','phone','phone\x20not\x20specified!','birthDate'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe688,0xb5));var _0x8e68=function(_0x3961ee,_0x4f7e4f){_0x3961ee=_0x3961ee-0x0;var _0x22adcb=_0xe688[_0x3961ee];return _0x22adcb;};'use strict';var BPromise=require(_0x8e68('0x0'));var util=require(_0x8e68('0x1'));var _=require(_0x8e68('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x8e68('0x3'));var Redis=require(_0x8e68('0x4'));var db=require(_0x8e68('0x5'))['db'];var config=require(_0x8e68('0x6'));var logger=require(_0x8e68('0x7'))(_0x8e68('0x8'));config['redis']=_['defaults'](config[_0x8e68('0x9')],{'host':_0x8e68('0xa'),'port':0x18eb});var socket=require(_0x8e68('0xb'))(new Redis(config[_0x8e68('0x9')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x8e68('0xc')||process[_0x8e68('0xd')][0x2]===_0x8e68('0xe')){throw new Error(_0x8e68('0xf'));}var FILEPATH=process[_0x8e68('0xd')][0x2];if(!process['argv'][0x3]||process[_0x8e68('0xd')][0x3]==='undefined'||process[_0x8e68('0xd')][0x3]===_0x8e68('0xe')||!process[_0x8e68('0xd')][0x4]||process[_0x8e68('0xd')][0x4]===_0x8e68('0xc')||process[_0x8e68('0xd')][0x4]===_0x8e68('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x8e68('0x10')](process['argv'][0x3][_0x8e68('0x11')](','),process['argv'][0x4]['split'](','));if(!process[_0x8e68('0xd')][0x5]||process['argv'][0x5]===_0x8e68('0xc')||process[_0x8e68('0xd')][0x5]===_0x8e68('0xe')){throw new Error(_0x8e68('0x12'));}var LISTID=process[_0x8e68('0xd')][0x5];var COMPANYID=process[_0x8e68('0xd')][0x6]&&process[_0x8e68('0xd')][0x6]!==_0x8e68('0xc')&&process[_0x8e68('0xd')][0x6]!==_0x8e68('0xe')?process[_0x8e68('0xd')][0x6]:null;var DUPLICATES=process[_0x8e68('0xd')][0x7]&&process[_0x8e68('0xd')][0x7]!=='undefined'&&process[_0x8e68('0xd')][0x7]!==_0x8e68('0xe')?process[_0x8e68('0xd')][0x7]:null;if(!process[_0x8e68('0xd')][0x8]||process[_0x8e68('0xd')][0x8]===_0x8e68('0xc')||process[_0x8e68('0xd')][0x8]==='null'){throw new Error(_0x8e68('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4ebd6d){logger[_0x8e68('0x14')](_0x4ebd6d);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(_0x30e408,_0x457d69,_0x213501,_0x43214c){var _0x499f66={'message':_0x457d69};_0x499f66[_0x30e408]=!![];if(_0x213501){_0x499f66[_0x8e68('0x15')]=_0x213501;}if(_0x43214c){_0x499f66['index']=_0x43214c;}return _0x499f66;}function isEmail(_0x314578){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'](_0x314578);}function checkRow(_0x26a093,_0x33c6fe,_0x564700){return new BPromise(function(_0x3dfb00,_0x2c1c10){if(_['isNil'](_0x26a093)){return _0x2c1c10(handleCheckRowError(_0x8e68('0x14'),_0x8e68('0x16'),null,_0x564700));}if(_0x26a093[_0x8e68('0x17')]&&_0x26a093['errors'][_0x8e68('0x18')]){var _0xa98b5b=_['map'](_0x26a093[_0x8e68('0x17')],_0x8e68('0x19'))['join'](';');return _0x2c1c10(handleCheckRowError(_0x8e68('0x14'),_0xa98b5b,null,_0x564700));}var _0x421742={};for(var _0x3e51b5 in FIELDS){if(FIELDS[_0x8e68('0x1a')](_0x3e51b5)&&FIELDS[_0x3e51b5]){_0x421742[_0x3e51b5]=_0x26a093['data'][0x0][FIELDS[_0x3e51b5]]||_0x26a093['data'][0x0]['\ufeff'+FIELDS[_0x3e51b5]];}}if(!_0x421742[_0x8e68('0x1b')]){return _0x2c1c10(handleCheckRowError(_0x8e68('0x14'),'firstName\x20not\x20specified!',null,_0x564700));}if(!_0x421742[_0x8e68('0x1c')]){return _0x2c1c10(handleCheckRowError(_0x8e68('0x14'),_0x8e68('0x1d'),null,_0x564700));}if(_0x421742['birthDate']){var _0x23131a=moment(_0x421742[_0x8e68('0x1e')],_0x8e68('0x1f'));if(!_0x23131a[_0x8e68('0x20')]()){return _0x2c1c10(handleCheckRowError('error',_0x8e68('0x21'),null,_0x564700));}}if(_0x421742[_0x8e68('0x22')]){if(!isEmail(_0x421742['email'])){return _0x2c1c10(handleCheckRowError('error',_0x8e68('0x23'),null,_0x564700));}}_0x421742[_0x8e68('0x24')]=LISTID;_0x421742[_0x8e68('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x8e68('0x18')]&&_0x33c6fe){var _0x390f1f={};for(var _0x3097a8=0x0,_0x5d666b=DUPLICATES[_0x8e68('0x18')];_0x3097a8<_0x5d666b;_0x3097a8+=0x1){_0x390f1f[DUPLICATES[_0x3097a8]]=_0x421742[DUPLICATES[_0x3097a8]];}var _0x59e665=_[_0x8e68('0x26')](_0x33c6fe,_0x390f1f);if(_0x59e665){return _0x2c1c10(handleCheckRowError(_0x8e68('0x27'),_0x8e68('0x28'),_0x59e665,_0x564700));}}return db[_0x8e68('0x29')][_0x8e68('0x2a')](_0x421742,{'raw':!![],'hooks':![],'fields':_[_0x8e68('0x2b')](_0x421742)})[_0x8e68('0x2c')](function(_0x64c2f3){if(DUPLICATES&&DUPLICATES[_0x8e68('0x18')]&&_0x33c6fe){_0x33c6fe[_0x8e68('0x2d')](_[_0x8e68('0x2e')](_0x421742,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x64c2f3['id'];return _0x3dfb00();})[_0x8e68('0x2f')](function(_0x223b63){return _0x2c1c10(handleCheckRowError('error',_0x8e68('0x30')+(_0x223b63[_0x8e68('0x19')]||JSON[_0x8e68('0x31')](_0x223b63)),null,_0x564700));});});}function checkHopper(){function _0x41e53b(){return function(_0x4e6d73){logger[_0x8e68('0x14')]('cmContact',_0x8e68('0x32'),util[_0x8e68('0x33')](_0x4e6d73,{'showHidden':![],'depth':null}));};}var _0x4fd71f=function(_0xf8f1a4,_0x473e95){var _0x4f11e2=squel[_0x8e68('0x34')]()[_0x8e68('0x35')]('cm_hopper')['fromQuery']([_0x8e68('0x1c'),'scheduledAt','ContactId',_0x8e68('0x24'),_0x473e95,_0x8e68('0x36'),_0x8e68('0x37')],squel[_0x8e68('0x38')]()[_0x8e68('0x39')](_0x8e68('0x1c'),'phone')[_0x8e68('0x39')](_0x8e68('0x3a'),_0x8e68('0x3b'))[_0x8e68('0x39')]('id',_0x8e68('0x3c'))[_0x8e68('0x39')](LISTID['toString'](),'ListId')[_0x8e68('0x39')](_0xf8f1a4['id'][_0x8e68('0x3d')](),_0x473e95)[_0x8e68('0x39')]('NOW()',_0x8e68('0x36'))['field'](_0x8e68('0x3a'),_0x8e68('0x37'))[_0x8e68('0x3e')](_0x8e68('0x3f'))[_0x8e68('0x40')](_0x8e68('0x41'))[_0x8e68('0x40')](_0x8e68('0x42'),LISTID[_0x8e68('0x3d')]())[_0x8e68('0x40')](_0x8e68('0x43'))[_0x8e68('0x40')](_0x8e68('0x44'),squel[_0x8e68('0x38')]()['field']('phone')[_0x8e68('0x3e')]('cm_hopper')[_0x8e68('0x40')](_0x473e95+'\x20=\x20?',_0xf8f1a4['id'][_0x8e68('0x3d')]())))[_0x8e68('0x3d')]();return _0x4f11e2;};var _0x23587a=function(_0x4fbb70,_0x42a6c0){var _0x318157=squel[_0x8e68('0x34')]()[_0x8e68('0x35')](_0x8e68('0x45'))[_0x8e68('0x46')]([_0x8e68('0x1c'),_0x8e68('0x3b'),'ContactId',_0x8e68('0x24'),_0x42a6c0,_0x8e68('0x36'),_0x8e68('0x37')],squel[_0x8e68('0x38')]()['field'](_0x8e68('0x1c'),'phone')['field'](_0x8e68('0x3a'),_0x8e68('0x3b'))[_0x8e68('0x39')]('id',_0x8e68('0x3c'))[_0x8e68('0x39')](LISTID['toString'](),_0x8e68('0x24'))['field'](_0x4fbb70['id']['toString'](),_0x42a6c0)['field'](_0x8e68('0x3a'),_0x8e68('0x36'))[_0x8e68('0x39')](_0x8e68('0x3a'),_0x8e68('0x37'))[_0x8e68('0x3e')](_0x8e68('0x3f'))[_0x8e68('0x40')](_0x8e68('0x41'))[_0x8e68('0x40')](_0x8e68('0x42'),LISTID['toString']())[_0x8e68('0x40')](_0x8e68('0x47'),squel[_0x8e68('0x48')](hopperContacts))[_0x8e68('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x8e68('0x40')](_0x8e68('0x44'),squel['select']()['field'](_0x8e68('0x49'))[_0x8e68('0x3e')]('cm_hopper_final')[_0x8e68('0x40')](_0x42a6c0+_0x8e68('0x4a'),_0x4fbb70['id'][_0x8e68('0x3d')]()))['where'](_0x8e68('0x44'),squel[_0x8e68('0x38')]()['field']('phone')['from'](_0x8e68('0x45'))[_0x8e68('0x40')](_0x42a6c0+'\x20=\x20?',_0x4fbb70['id'][_0x8e68('0x3d')]())))[_0x8e68('0x3d')]();return _0x318157;};function _0x131194(_0x2f6010,_0x3b9a67){var _0x525441=squel[_0x8e68('0x34')]()[_0x8e68('0x35')](_0x8e68('0x45'))[_0x8e68('0x46')]([_0x8e68('0x1c'),_0x8e68('0x3b'),'ContactId',_0x8e68('0x24'),_0x3b9a67,_0x8e68('0x36'),_0x8e68('0x37')],squel[_0x8e68('0x38')]()[_0x8e68('0x39')](_0x8e68('0x1c'),'phone')[_0x8e68('0x39')]('NOW()',_0x8e68('0x3b'))['field']('id',_0x8e68('0x3c'))[_0x8e68('0x39')](LISTID[_0x8e68('0x3d')](),'ListId')[_0x8e68('0x39')](_0x2f6010['id'][_0x8e68('0x3d')](),_0x3b9a67)[_0x8e68('0x39')]('NOW()',_0x8e68('0x36'))['field'](_0x8e68('0x3a'),'updatedAt')['from'](_0x8e68('0x3f'))[_0x8e68('0x40')](_0x8e68('0x41'))[_0x8e68('0x40')](_0x8e68('0x42'),LISTID[_0x8e68('0x3d')]())['where']('id\x20IN\x20?',squel[_0x8e68('0x48')](hopperContacts))[_0x8e68('0x40')](_0x8e68('0x43')))[_0x8e68('0x3d')]();return _0x525441;}function _0x23c80f(_0x1adb5b,_0xe5b325){var _0x34d91f=squel['insert']()['into'](_0x8e68('0x4b'))[_0x8e68('0x46')]([_0x8e68('0x1c'),_0x8e68('0x3c'),_0x8e68('0x24'),_0xe5b325,_0x8e68('0x36'),'updatedAt'],squel[_0x8e68('0x38')]()['field'](_0x8e68('0x1c'),_0x8e68('0x1c'))[_0x8e68('0x39')]('id','ContactId')[_0x8e68('0x39')](LISTID[_0x8e68('0x3d')](),_0x8e68('0x24'))[_0x8e68('0x39')](_0x1adb5b['id']['toString'](),_0xe5b325)[_0x8e68('0x39')](_0x8e68('0x3a'),_0x8e68('0x36'))['field'](_0x8e68('0x3a'),_0x8e68('0x37'))[_0x8e68('0x3e')](_0x8e68('0x3f'))[_0x8e68('0x40')](_0x8e68('0x41'))[_0x8e68('0x40')](_0x8e68('0x42'),LISTID[_0x8e68('0x3d')]())[_0x8e68('0x40')](_0x8e68('0x47'),squel[_0x8e68('0x48')](hopperContacts))[_0x8e68('0x40')](_0x8e68('0x43')))[_0x8e68('0x3d')]();return _0x34d91f;}return db[_0x8e68('0x4c')][_0x8e68('0x4d')]({'where':{'type':_0x8e68('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x8e68('0x4f'),'where':{'id':LISTID}}]})[_0x8e68('0x2c')](function(_0xb5cafc){var _0x5aa6c2=[];if(_0xb5cafc){var _0x465c13;for(var _0x53c2c0=0x0,_0x1f7c32;_0x53c2c0<_0xb5cafc[_0x8e68('0x18')];_0x53c2c0+=0x1){_0x1f7c32=_0xb5cafc[_0x53c2c0][_0x8e68('0x50')]({'plain':!![]});switch(_0x1f7c32[_0x8e68('0x51')]){case _0x8e68('0x52'):_0x5aa6c2[_0x8e68('0x2d')](db[_0x8e68('0x53')][_0x8e68('0x54')](_0x23587a(_0x1f7c32,_0x8e68('0x55')))[_0x8e68('0x2c')](function(){})['catch'](_0x41e53b()));break;case _0x8e68('0x56'):_0x5aa6c2[_0x8e68('0x2d')](db[_0x8e68('0x53')]['query'](_0x4fd71f(_0x1f7c32,_0x8e68('0x55')))[_0x8e68('0x2c')](function(){})[_0x8e68('0x2f')](_0x41e53b()));break;default:_0x5aa6c2['push'](db[_0x8e68('0x53')]['query'](_0x131194(_0x1f7c32,_0x8e68('0x55')))[_0x8e68('0x2c')](function(){})[_0x8e68('0x2f')](_0x41e53b()));}}}return _0x5aa6c2;})[_0x8e68('0x57')]()[_0x8e68('0x2c')](function(){return db[_0x8e68('0x4c')]['findAll']({'where':{'type':_0x8e68('0x4e')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x8e68('0x58'),'where':{'id':LISTID}}]})[_0x8e68('0x2c')](function(_0x22e92e){var _0x447d19=[];if(_0x22e92e){var _0x46cabb;for(var _0x22781c=0x0,_0x3d2331;_0x22781c<_0x22e92e[_0x8e68('0x18')];_0x22781c+=0x1){_0x3d2331=_0x22e92e[_0x22781c][_0x8e68('0x50')]({'plain':!![]});_0x447d19[_0x8e68('0x2d')](db['sequelize'][_0x8e68('0x54')](_0x23c80f(_0x3d2331,_0x8e68('0x55')))['then'](function(){})[_0x8e68('0x2f')](_0x41e53b()));}}return _0x447d19;})[_0x8e68('0x57')]();})[_0x8e68('0x2c')](function(){return db['Campaign'][_0x8e68('0x4d')]({'attributes':['id',_0x8e68('0x51')],'include':[{'model':db[_0x8e68('0x59')],'as':_0x8e68('0x4f'),'where':{'id':LISTID}}]})[_0x8e68('0x2c')](function(_0x1a3399){var _0x52feb5=[];if(_0x1a3399){for(var _0x4fb0fb=0x0,_0x19caa3;_0x4fb0fb<_0x1a3399[_0x8e68('0x18')];_0x4fb0fb+=0x1){_0x19caa3=_0x1a3399[_0x4fb0fb][_0x8e68('0x50')]({'plain':!![]});switch(_0x19caa3[_0x8e68('0x51')]){case'always':_0x52feb5['push'](db[_0x8e68('0x53')][_0x8e68('0x54')](_0x23587a(_0x19caa3,'CampaignId'))[_0x8e68('0x2c')](function(){})[_0x8e68('0x2f')](_0x41e53b()));break;case'onlyIfOpen':_0x52feb5[_0x8e68('0x2d')](db['sequelize'][_0x8e68('0x54')](_0x4fd71f(_0x19caa3,_0x8e68('0x5a')))['then'](function(){})['catch'](_0x41e53b()));break;default:_0x52feb5['push'](db[_0x8e68('0x53')][_0x8e68('0x54')](_0x131194(_0x19caa3,'CampaignId'))['then'](function(){})[_0x8e68('0x2f')](_0x41e53b()));}}}return _0x52feb5;})[_0x8e68('0x57')]();})[_0x8e68('0x2c')](function(){return db['Campaign'][_0x8e68('0x4d')]({'attributes':['id'],'include':[{'model':db[_0x8e68('0x59')],'as':_0x8e68('0x58'),'where':{'id':LISTID}}]})[_0x8e68('0x2c')](function(_0x243514){var _0x585f7e=[];if(_0x243514){for(var _0x194685=0x0,_0x5a1d6d;_0x194685<_0x243514[_0x8e68('0x18')];_0x194685+=0x1){_0x5a1d6d=_0x243514[_0x194685][_0x8e68('0x50')]({'plain':!![]});_0x585f7e[_0x8e68('0x2d')](db[_0x8e68('0x53')]['query'](_0x23c80f(_0x5a1d6d,_0x8e68('0x5a')))['then'](function(){})[_0x8e68('0x2f')](_0x41e53b()));}}return _0x585f7e;})[_0x8e68('0x57')]();})[_0x8e68('0x2f')](function(_0x3e9be6){logger[_0x8e68('0x14')](_0x8e68('0x5b'),'generalCheckHopper',_0x3e9be6['message']);});}var processPromises=function(_0x3bc907){return BPromise[_0x8e68('0x57')](promises)[_0x8e68('0x2c')](function(_0xd50237){})[_0x8e68('0x2f')](function(_0x22efdf){logger[_0x8e68('0x14')]('Error\x20processing\x20rows\x20block:',JSON[_0x8e68('0x31')](_0x22efdf));})[_0x8e68('0x5c')](function(){socket[_0x8e68('0x5d')](_0x8e68('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3bc907){return _0x3bc907[_0x8e68('0x5f')]();}});};var endCsv=function(){return BPromise[_0x8e68('0x60')]()[_0x8e68('0x2c')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x8e68('0x5d')](_0x8e68('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x8e68('0x61')](FILEPATH);}catch(_0x10f1f9){logger[_0x8e68('0x14')](_0x8e68('0x62'),JSON[_0x8e68('0x31')](_0x10f1f9));}finally{process[_0x8e68('0x63')](0x0);}});};process['on'](_0x8e68('0x64'),function(){logger[_0x8e68('0x65')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x8e68('0x60')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x8e68('0x11')](',');return db[_0x8e68('0x29')][_0x8e68('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x299882){var _0x26c5d5=fs[_0x8e68('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x26c5d5,{'header':!![],'skipEmptyLines':!![],'step':function(_0x238cd8,_0x583095){total+=0x1;var _0x23dbab=total;promises[_0x8e68('0x2d')](checkRow(_0x238cd8,_0x299882,_0x23dbab)[_0x8e68('0x2c')](function(){success+=0x1;})['catch'](function(_0x5c7c8c){if(_0x5c7c8c[_0x8e68('0x14')]){errors+=0x1;delete _0x5c7c8c[_0x8e68('0x14')];}else if(_0x5c7c8c[_0x8e68('0x27')]){duplicates+=0x1;delete _0x5c7c8c[_0x8e68('0x27')];}rows[_0x8e68('0x2d')](_0x5c7c8c);}));if(total%0xc8===0x0){_0x583095[_0x8e68('0x67')]();return processPromises(_0x583095);}},'complete':function(){return processPromises()['then'](function(){logger[_0x8e68('0x65')](_0x8e68('0x68'));endCsv();});},'error':function(_0x4f29f0,_0x5d93c7){logger[_0x8e68('0x65')]('CSV\x20parse\x20error',JSON[_0x8e68('0x31')](_0x4f29f0));endCsv();}});})['catch'](function(_0x3bf217){logger[_0x8e68('0x14')](_0x8e68('0x69'),JSON['stringify'](_0x3bf217));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 8c2d169..7cf6c08 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 _0xd67c=['voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','query','dialTimezone','set','offset','main','stringify','start','clone','socket_timestamp','root','server/files/tmp','includes','header','ContactItemType','name','_description','writeFileSync','parse','createReadStream','data','find','hasOwnProperty','trim','isNaN','isNumber','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','utcOffset','firstName','itemTypeId','description','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','replace','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','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','CmContact','findAll','AdditionalPhones','then','length','all','split','push','isNil','filter','CmContactHasItem','update','updated','create','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.ListId','cm_hopper_black','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','cm_contacts.phone','cm_contacts.UserId','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','concat','keys','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','exit','errors','code','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','sequelize','voice_queues.id','voice_queues.dialTimezone'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd67c,0x103));var _0xcd67=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xd67c[_0x32f7d7];return _0x133d09;};'use strict';var fs=require('fs');var path=require(_0xcd67('0x0'));var _=require(_0xcd67('0x1'));var Papa=require(_0xcd67('0x2'));var util=require(_0xcd67('0x3'));var BPromise=require(_0xcd67('0x4'));var moment=require(_0xcd67('0x5'));var squel=require(_0xcd67('0x6'));var Redis=require(_0xcd67('0x7'));var db=require(_0xcd67('0x8'))['db'];var config=require('../../../config/environment');var shared=require(_0xcd67('0x9'));var logger=require('../../../config/logger')(_0xcd67('0xa'));config[_0xcd67('0xb')]=_[_0xcd67('0xc')](config[_0xcd67('0xb')],{'host':_0xcd67('0xd'),'port':0x18eb});var socket=require(_0xcd67('0xe'))(new Redis(config[_0xcd67('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xcd67('0xf')](_0xcd67('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xcd67('0xf')](_0xcd67('0x10'));function isEmail(_0x92bd22){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))*$/[_0xcd67('0x11')](_0x92bd22);}function selectNotIn(_0x56f084,_0x3d18cc,_0x2e689e,_0x1415fb,_0x491f7b){return squel['select']()[_0xcd67('0x12')](_0xcd67('0x13'))[_0xcd67('0x14')](_0x1415fb)['join'](_0x3d18cc,null,_0x3d18cc+_0xcd67('0x15')+_0x1415fb+'.'+_0x2e689e)['where'](_0x1415fb+'.'+_0x2e689e+_0xcd67('0x16')+_0x56f084+'.'+_0x2e689e)[_0xcd67('0x17')](_0x3d18cc+_0xcd67('0x18')+_0x491f7b[_0xcd67('0x19')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x38b7f3,_0x20dd5b){promisesAdditionalPhones=[];return db[_0xcd67('0x1a')][_0xcd67('0x1b')]({'raw':!![],'attributes':['id',_0xcd67('0x1c')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xcd67('0x1d')](function(_0x200ca6){if(_0x200ca6!==null){var _0x39d32d=[];for(var _0x15507f=0x0;_0x15507f<_0x200ca6[_0xcd67('0x1e')];_0x15507f++){var _0x234bf1=_0x200ca6[_0x15507f];_0x39d32d['push'](insertAdditionalPhones(_0x234bf1));}}Promise[_0xcd67('0x1f')](_0x39d32d)[_0xcd67('0x1d')](function(){_0x38b7f3({'val':0x1});});});});}function insertAdditionalPhones(_0x32cbb6){return new Promise(function(_0x219646,_0x56f03b){var _0x785644=_0x32cbb6['AdditionalPhones'];var _0x2e2ded=_0x785644[_0xcd67('0x20')](';');var _0x44a1f1=[];orderBy=0x0;for(var _0x47236a=0x0;_0x47236a<_0x2e2ded['length'];_0x47236a++){_0x44a1f1[_0xcd67('0x21')](splitAdditionalPhone(_0x32cbb6['id'],_0x2e2ded[_0x47236a]));}Promise[_0xcd67('0x1f')](_0x44a1f1)[_0xcd67('0x1d')](function(){_0x219646({'val':_0x2e2ded[_0xcd67('0x1e')]});});});}function splitAdditionalPhone(_0x48014d,_0x4c182f){return new Promise(function(_0xe97297,_0x50ea07){var _0x5f4876=_0x4c182f[_0xcd67('0x20')](':');var _0x39d981=_0x5f4876[0x0];var _0x225cbe=_0x5f4876[0x1];if(!_[_0xcd67('0x22')](_0x225cbe)){var _0xa18b49=_0x225cbe[_0xcd67('0x20')]('|');var _0x5a345c=[];for(var _0x17eba6=0x0;_0x17eba6<_0xa18b49['length'];_0x17eba6++){if(_0xa18b49[_0x17eba6]!==''){var _0x2d0046=_[_0xcd67('0x23')](promisesAdditionalPhones,{'contactId':_0x48014d,'phone':_0xa18b49[_0x17eba6]});if(_0x2d0046[_0xcd67('0x1e')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x48014d,'contactTypeId':_0x39d981,'phone':_0xa18b49[_0x17eba6],'orderBy':orderBy});}}}_0xe97297({'ok':0x1});}else _0xe97297({'res':0x0});});}function createAdditionalPhone(_0x40bb40,_0x31debe,_0x29e898,_0x5ad3cd){var _0x8c0376='';var _0xec9c0d='';var _0x538550=_0x29e898['split']('§');_0x8c0376=_0x538550[0x0];if(_0x538550['length']==0x2)_0xec9c0d=_0x538550[0x1];return new Promise(function(_0x433473,_0x26fd83){return db[_0xcd67('0x24')]['findOne']({'where':{'CmContactId':_0x40bb40,'item':_0x8c0376}})[_0xcd67('0x1d')](function(_0xe4d60){if(_0xe4d60){return db['CmContactHasItem'][_0xcd67('0x25')]({'ItemTypeId':_0x31debe,'description':_0xec9c0d,'OrderBy':_0x5ad3cd},{'where':{'CmContactId':_0x40bb40,'item':_0x8c0376}})['then'](function(_0x3755d2){_0x433473({'res':_0xcd67('0x26')});});}else{return db[_0xcd67('0x24')][_0xcd67('0x27')]({'CmContactId':_0x40bb40,'item':_0x8c0376,'description':_0xec9c0d,'ItemTypeId':_0x31debe,'OrderBy':_0x5ad3cd,'ItemClass':_0xcd67('0x28')})['then'](function(_0x39fd00){_0x433473({'res':_0xcd67('0x29')});});}});});}function insertCmHopper(_0x2a04dc,_0x3b86af,_0x110df8,_0x22c03e,_0x16df27){var _0xf3413e=['cm_contacts.phone',_0xcd67('0x2a'),_0xcd67('0x2b'),'cm_contacts.ListId',_0x3b86af+'.'+_0x22c03e,_0xcd67('0x2c'),_0xcd67('0x2d'),_0xcd67('0x2e'),'cm_contacts.UserId','\x22'+_0x16df27+'\x22'];return squel[_0xcd67('0x2f')]()[_0xcd67('0x30')](_0xcd67('0x31'))[_0xcd67('0x32')]([_0xcd67('0x13'),_0xcd67('0x33'),_0xcd67('0x34'),_0xcd67('0x35'),_0x22c03e,_0xcd67('0x36'),_0xcd67('0x37'),_0xcd67('0x38'),_0xcd67('0x39'),_0xcd67('0x3a')],squel[_0xcd67('0x3b')]()[_0xcd67('0x3c')](_0xf3413e)[_0xcd67('0x14')](_0x3b86af)[_0xcd67('0x19')](_0xcd67('0x3d'),null,'cm_contacts.ListId\x20=\x20'+_0x3b86af+_0xcd67('0x3e'))['join'](_0x110df8,null,_0x110df8+'.id\x20=\x20'+_0x3b86af+'.'+_0x22c03e)[_0xcd67('0x17')](_0x3b86af+_0xcd67('0x3f'),_0x2a04dc)[_0xcd67('0x17')](_0xcd67('0x40'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3b86af,_0x110df8,_0x22c03e,_0xcd67('0x31'),[_0xcd67('0x41'),_0xcd67('0x42')]))[_0xcd67('0x17')](_0xcd67('0x43'),selectNotIn(_0x3b86af,_0x110df8,_0x22c03e,_0xcd67('0x31'),[_0xcd67('0x41')])))[_0xcd67('0x44')]();}function insertCmHopperBlack(_0x9fefbd,_0x5b9bf3,_0x43996f,_0x3356b7){var _0x489d83=['cm_contacts.phone',_0xcd67('0x2b'),_0xcd67('0x45'),_0x5b9bf3+'.'+_0x3356b7,_0xcd67('0x2c'),_0xcd67('0x2d')];return squel[_0xcd67('0x2f')]()['into'](_0xcd67('0x46'))[_0xcd67('0x32')](['phone',_0xcd67('0x34'),_0xcd67('0x35'),_0x3356b7,_0xcd67('0x36'),_0xcd67('0x37')],squel[_0xcd67('0x3b')]()[_0xcd67('0x3c')](_0x489d83)[_0xcd67('0x14')](_0x5b9bf3)[_0xcd67('0x19')]('cm_contacts',null,_0xcd67('0x47')+_0x5b9bf3+'.CmListId')[_0xcd67('0x19')](_0x43996f,null,_0x43996f+_0xcd67('0x15')+_0x5b9bf3+'.'+_0x3356b7)[_0xcd67('0x17')](_0x5b9bf3+'.CmListId\x20=\x20?',_0x9fefbd)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xcd67('0x17')](_0xcd67('0x43'),squel['select']()[_0xcd67('0x12')](_0xcd67('0x13'))[_0xcd67('0x14')](_0xcd67('0x46'))[_0xcd67('0x17')](_0xcd67('0x48'),_0x9fefbd)[_0xcd67('0x17')](_0x3356b7+_0xcd67('0x16')+_0x5b9bf3+'.'+_0x3356b7)))[_0xcd67('0x44')]();}function insertTzCmHopper(_0x359cef,_0x4b89a2,_0x401849,_0x4f2485,_0x53ce85,_0x5832d6){var _0x4cde90=[_0xcd67('0x49'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x5832d6+'.offset-cm_contacts.utcOffset\x20minute)',_0xcd67('0x2b'),_0xcd67('0x45'),_0x4b89a2+'.'+_0x4f2485,_0xcd67('0x2c'),_0xcd67('0x2d'),_0xcd67('0x2e'),_0xcd67('0x4a'),'\x22'+_0x53ce85+'\x22'];var _0x59e6c0=squel[_0xcd67('0x2f')]()['into'](_0xcd67('0x31'))[_0xcd67('0x32')]([_0xcd67('0x13'),_0xcd67('0x33'),_0xcd67('0x34'),'ListId',_0x4f2485,_0xcd67('0x36'),_0xcd67('0x37'),_0xcd67('0x38'),_0xcd67('0x39'),_0xcd67('0x3a')],squel[_0xcd67('0x3b')]()[_0xcd67('0x3c')](_0x4cde90)[_0xcd67('0x14')](_0x4b89a2)['join'](_0xcd67('0x3d'),null,'cm_contacts.ListId\x20=\x20'+_0x4b89a2+'.CmListId')['join'](_0x401849,null,_0x401849+'.id\x20=\x20'+_0x4b89a2+'.'+_0x4f2485)[_0xcd67('0x19')](_0x5832d6,null,_0x5832d6+_0xcd67('0x15')+_0x4b89a2+'.'+_0x4f2485)['where'](_0x4b89a2+'.CmListId\x20=\x20?',_0x359cef)[_0xcd67('0x17')](_0xcd67('0x40'),NOW)[_0xcd67('0x17')](_0xcd67('0x43'),selectNotIn(_0x4b89a2,_0x401849,_0x4f2485,_0xcd67('0x31'),[_0xcd67('0x41'),_0xcd67('0x42')]))[_0xcd67('0x17')](_0xcd67('0x43'),selectNotIn(_0x4b89a2,_0x401849,_0x4f2485,_0xcd67('0x31'),['\x22always\x22'])))['toString']();return _0x59e6c0;}function insertTzCmHopperBlack(_0x15c656,_0x30bacf,_0x1926e0,_0x4818e2){var _0x1cff17=[_0xcd67('0x49'),_0xcd67('0x2b'),_0xcd67('0x45'),_0x30bacf+'.'+_0x4818e2,_0xcd67('0x2c'),'cm_contacts.updatedAt'];return squel[_0xcd67('0x2f')]()[_0xcd67('0x30')](_0xcd67('0x46'))['fromQuery']([_0xcd67('0x13'),'ContactId',_0xcd67('0x35'),_0x4818e2,'createdAt',_0xcd67('0x37')],squel['select']()[_0xcd67('0x3c')](_0x1cff17)['from'](_0x30bacf)[_0xcd67('0x19')](_0xcd67('0x3d'),null,_0xcd67('0x47')+_0x30bacf+_0xcd67('0x3e'))[_0xcd67('0x19')](_0x1926e0,null,_0x1926e0+'.id\x20=\x20'+_0x30bacf+'.'+_0x4818e2)[_0xcd67('0x17')](_0x30bacf+'.CmListId\x20=\x20?',_0x15c656)[_0xcd67('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xcd67('0x17')](_0xcd67('0x43'),squel[_0xcd67('0x3b')]()[_0xcd67('0x12')](_0xcd67('0x13'))['from']('cm_hopper_black')['where']('ListId\x20=\x20?',_0x15c656)['where'](_0x4818e2+_0xcd67('0x16')+_0x30bacf+'.'+_0x4818e2)))['toString']();}function insertCmHopperAdditionalPhones(_0x5174fb){var _0x308461=[_0xcd67('0x4b'),_0xcd67('0x4c'),_0xcd67('0x4d'),'cm_contact_has_items.createdAt',_0xcd67('0x4e')];return squel[_0xcd67('0x2f')]()[_0xcd67('0x30')](_0xcd67('0x4f'))[_0xcd67('0x32')]([_0xcd67('0x50'),_0xcd67('0x13'),_0xcd67('0x51'),_0xcd67('0x36'),_0xcd67('0x37')],squel[_0xcd67('0x3b')]()[_0xcd67('0x3c')](_0x308461)[_0xcd67('0x14')](_0xcd67('0x31'))[_0xcd67('0x19')](_0xcd67('0x3d'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join'](_0xcd67('0x52'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xcd67('0x17')]('cm_hopper.ListId\x20=\x20?',_0x5174fb)[_0xcd67('0x17')](_0xcd67('0x40'),NOW))[_0xcd67('0x44')]();}function insertCmContact(_0x310380,_0x58aadb,_0x2356a5,_0x117c2b){var _0x4e0365=_[_0xcd67('0x53')](_[_0xcd67('0x54')](_0x117c2b),[_0xcd67('0x35'),'CompanyId',_0xcd67('0x36'),_0xcd67('0x37'),'scheduledAt']);return squel[_0xcd67('0x2f')]()[_0xcd67('0x30')]('cm_contacts')['fromQuery'](_0x4e0365,squel[_0xcd67('0x3b')]()['fields'](_0x4e0365)[_0xcd67('0x14')](_0x58aadb)[_0xcd67('0x17')]('('+_0x2356a5[_0xcd67('0x19')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0xcd67('0x3c')](_0x2356a5)[_0xcd67('0x14')](_0xcd67('0x3d'))['where']('ListId\x20=\x20?',_0x310380)[_0xcd67('0x17')]('deletedAt\x20IS\x20NULL'))[_0xcd67('0x17')](_0xcd67('0x55'),squel[_0xcd67('0x3b')]()['field'](_0xcd67('0x56'),'min_id')['from'](_0x58aadb)[_0xcd67('0x57')](_0x2356a5[_0xcd67('0x19')](','))))[_0xcd67('0x44')]();}function handleStop(){logger[_0xcd67('0x58')](_0xcd67('0x59'));stopped=!![];}function handleUncaughtException(_0x31852f){logger[_0xcd67('0x5a')](_0x31852f[_0xcd67('0x5b')]);process[_0xcd67('0x5c')](0x1);}function handleError(_0x4b3cd2,_0x97365a){stats[_0xcd67('0x5d')][_0xcd67('0x21')]({'name':_0x97365a[_0xcd67('0x5e')],'message':_0x97365a[_0xcd67('0x5b')],'row':_0x4b3cd2});}function handleQuery(_0x388964){logger[_0xcd67('0x58')](_0x388964);return db['sequelize']['query'](_0x388964)[_0xcd67('0x5f')](function(_0x24b17d){results[_0xcd67('0x21')](_0x24b17d);})[_0xcd67('0x60')](function(_0x21cb11){logger[_0xcd67('0x5a')](_0x21cb11[_0xcd67('0x5b')]);});}function updateTzCampaigns(_0x1a1327){return new Promise(function(_0x4f654b,_0x15c41a){var _0x3e18fe=squel[_0xcd67('0x3b')]()['fields']([_0xcd67('0x61'),_0xcd67('0x62')])[_0xcd67('0x14')]('campaigns')[_0xcd67('0x19')]('campaigns_has_cm_lists',null,_0xcd67('0x63'))['where']('campaigns_has_cm_lists.CmListId='+_0x1a1327);db[_0xcd67('0x64')]['query'](_0x3e18fe[_0xcd67('0x44')]())['spread'](function(_0x40f836){var _0x15adf5=[];for(var _0x1540da=0x0;_0x1540da<_0x40f836['length'];_0x1540da++){_0x15adf5[_0xcd67('0x21')](getTimezoneData(_0x40f836[_0x1540da],tmp_campaigns));}BPromise[_0xcd67('0x1f')](_0x15adf5)[_0xcd67('0x1d')](function(){_0x4f654b({'val':0x1});});})[_0xcd67('0x60')](function(_0x910ffa){logger[_0xcd67('0x5a')](_0x910ffa[_0xcd67('0x5b')]);_0x4f654b({'val':0x0});});});}function updateTzVoiceQueues(_0x14b550){return new Promise(function(_0x418fc4,_0x594052){var _0x175329=squel[_0xcd67('0x3b')]()['fields']([_0xcd67('0x65'),_0xcd67('0x66')])[_0xcd67('0x14')](_0xcd67('0x67'))[_0xcd67('0x19')](_0xcd67('0x68'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xcd67('0x17')](_0xcd67('0x69')+_0x14b550);db[_0xcd67('0x64')][_0xcd67('0x6a')](_0x175329['toString']())[_0xcd67('0x5f')](function(_0x4b3477){var _0x4f21de=[];for(var _0x537d87=0x0;_0x537d87<_0x4b3477[_0xcd67('0x1e')];_0x537d87++){_0x4f21de[_0xcd67('0x21')](getTimezoneData(_0x4b3477[_0x537d87],tmp_voice_queues));}BPromise['all'](_0x4f21de)[_0xcd67('0x1d')](function(){_0x418fc4({'val':0x1});});})[_0xcd67('0x60')](function(_0x2afbed){logger['error'](_0x2afbed[_0xcd67('0x5b')]);_0x418fc4({'val':0x0});});});}function getTimezoneData(_0x150d85,_0x5b37e9){return new Promise(function(_0x21e5dc,_0x3f6a2f){var _0x1b458b=shared['timezones'];var _0x2410b3=_0x1b458b[_0x150d85[_0xcd67('0x6b')]];if(_[_0xcd67('0x22')](_0x2410b3)){_0x21e5dc({'ret':0x1});}else{var _0x2c17d1=_0x2410b3['utcOffset'];var _0x347f74=squel['insert']()['into'](_0x5b37e9)[_0xcd67('0x6c')]('id',_0x150d85['id'])[_0xcd67('0x6c')](_0xcd67('0x6d'),_0x2c17d1)[_0xcd67('0x6c')](_0xcd67('0x6b'),_0x150d85[_0xcd67('0x6b')])[_0xcd67('0x44')]();return db[_0xcd67('0x64')]['query'](_0x347f74)[_0xcd67('0x5f')](function(_0x58bc1a){_0x21e5dc({'ret':0x1});})['catch'](function(_0x3f8601){logger[_0xcd67('0x5a')](_0x3f8601['message']);_0x3f6a2f({'ret':0x1});});}});}function handleTZQuery(_0x15339f){logger[_0xcd67('0x58')](_0x15339f);return db[_0xcd67('0x64')][_0xcd67('0x6a')](_0x15339f)[_0xcd67('0x5f')](function(_0x4b9961){})[_0xcd67('0x60')](function(_0x485820){logger[_0xcd67('0x5a')](_0x485820[_0xcd67('0x5b')]);});}function main(_0x5d04ac,_0x50b454,_0x2b05e7,_0x4b5155){logger[_0xcd67('0x58')](_0xcd67('0x6e'),_0x5d04ac,JSON[_0xcd67('0x6f')](_0x50b454));process['send'](_0xcd67('0x70'));var _0x26015f=_0x50b454['binding'];var _0x473ba9=_[_0xcd67('0x71')](_0x26015f);var _0x21ecd6=_0x50b454[_0xcd67('0x72')];var _0x3c3080=path[_0xcd67('0x19')](config[_0xcd67('0x73')],_0xcd67('0x74'),_0x21ecd6+'.csv');hasTZ=_[_0xcd67('0x54')](_0x26015f)[_0xcd67('0x75')](_0xcd67('0x6b'));var _0x2b3596=_[_0xcd67('0x54')](_0x26015f)[_0xcd67('0x19')]();logger[_0xcd67('0x58')](_0xcd67('0x76'),_0x2b3596);db[_0xcd67('0x77')][_0xcd67('0x1b')]({'raw':!![],'attributes':['id',_0xcd67('0x78')]})[_0xcd67('0x1d')](function(_0x500041){for(var _0x305c3e=0x0;_0x305c3e<_0x500041[_0xcd67('0x1e')];_0x305c3e++){if(_0x500041[_0x305c3e][_0xcd67('0x78')]in _0x26015f){contactItemTypes[_0xcd67('0x21')](_0x500041[_0x305c3e]);delete _0x473ba9[_0x500041[_0x305c3e][_0xcd67('0x78')]];hasAdditionalPhones=!![];}for(var _0x96469f in _0x26015f){if(_0x500041[_0x305c3e][_0xcd67('0x78')]+_0xcd67('0x79')===_0x96469f){phoneDescriptions[_0xcd67('0x21')]({'itemTypeId':_0x500041[_0x305c3e]['id'],'description':_0x96469f});delete _0x473ba9[_0x96469f];}}}if(hasAdditionalPhones)_0x473ba9[_0xcd67('0x1c')]='';var _0x367978=_[_0xcd67('0x54')](_0x473ba9)['join']();logger['info'](_0xcd67('0x76'),_0x367978);fs[_0xcd67('0x7a')](_0x3c3080,_0x367978+'\x0a');Papa[_0xcd67('0x7b')](fs[_0xcd67('0x7c')](_0x5d04ac),{'header':!![],'skipEmptyLines':!![],'step':function(_0x9e0fb1,_0x452739){try{for(var _0x4b5a74=0x0,_0x3c864f=[];_0x4b5a74<_0x9e0fb1[_0xcd67('0x7d')][_0xcd67('0x1e')];_0x4b5a74++){stats['rows']+=0x1;if(_0x9e0fb1['errors'][_0x4b5a74]){handleError(_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74],_0x9e0fb1[_0xcd67('0x5d')][_0x4b5a74]);}else{var _0x3393f5=[];var _0x597e52=[];var _0x586a31={};for(var _0x2d0ead in _0x26015f){let _0x593d5c=contactItemTypes[_0xcd67('0x7e')](_0x21349f=>_0x21349f[_0xcd67('0x78')]===_0x2d0ead);let _0xe12422=contactItemTypes[_0xcd67('0x7e')](_0x4c8f7a=>_0x4c8f7a[_0xcd67('0x78')]+_0xcd67('0x79')===_0x2d0ead);if(_[_0xcd67('0x22')](_0x593d5c)&&_[_0xcd67('0x22')](_0xe12422)){if(_0x26015f[_0xcd67('0x7f')](_0x2d0ead)){if(_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74][_0x26015f[_0x2d0ead]]){var _0x179065=_[_0xcd67('0x80')](_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74][_0x26015f[_0x2d0ead]]['replace'](/"/g,'\x27'));switch(_0x2d0ead){case'scheduledat':var _0x4bb46d=moment(_0x179065,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4bb46d['isValid']()){_0x3c864f[_0xcd67('0x21')]('\x22'+_0x179065+'\x22');}else{_0x3393f5[_0xcd67('0x21')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xcd67('0x38'):var _0x253ba8=parseInt(_0x179065);_0x179065=_[_0xcd67('0x81')](_0x253ba8)||_0x253ba8<0x0||_0x253ba8>0x4?_0x4b5155?0x3:0x2:_0x253ba8;_0x3c864f[_0xcd67('0x21')]('\x22'+_0x179065+'\x22');break;case _0xcd67('0x39'):var _0x2e0afb=parseInt(_0x179065);if(_[_0xcd67('0x82')](_0x2e0afb)&&_[_0xcd67('0x75')](_0x2b05e7,_0x2e0afb)){_0x3c864f['push']('\x22'+_0x2e0afb+'\x22');}else{_0x3393f5[_0xcd67('0x21')]('agent\x20not\x20exists');}break;case _0xcd67('0x83'):if(isEmail(_0x179065)){_0x3c864f[_0xcd67('0x21')]('\x22'+_0x179065+'\x22');}else{_0x3393f5[_0xcd67('0x21')](_0xcd67('0x84'));}break;case _0xcd67('0x85'):var _0x3dc3dd=moment(_0x179065,_0xcd67('0x86'),!![]);if(_0x3dc3dd['isValid']()){_0x3c864f[_0xcd67('0x21')]('\x22'+_0x179065+'\x22');}else{_0x3393f5[_0xcd67('0x21')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xcd67('0x6b'):var _0x3d61ec=shared['timezones'];var _0x4a0dfe=_0x3d61ec[_0x179065];if(!_[_0xcd67('0x22')](_0x4a0dfe)){var _0x3aa603=_0x4a0dfe[_0xcd67('0x87')];_0x3c864f[_0xcd67('0x21')]('\x22'+_0x179065+'\x22');_0x3c864f[_0xcd67('0x21')]('\x22'+_0x3aa603+'\x22');}break;default:_0x3c864f[_0xcd67('0x21')]('\x22'+_0x179065+'\x22');}}else{switch(_0x2d0ead){case _0xcd67('0x88'):case'phone':_0x3393f5[_0xcd67('0x21')](_0x2d0ead+'\x20not\x20specified');break;default:_0x3c864f[_0xcd67('0x21')]('\x22\x22');}}}}else{var _0x1235c7='';if(!_[_0xcd67('0x22')](_0x593d5c)){if(!_0x586a31[_0xcd67('0x7f')](_0x593d5c['id'])){if(!_[_0xcd67('0x22')](_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74][_0x26015f[_0x2d0ead]])){var _0x179065=_[_0xcd67('0x80')](_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74][_0x26015f[_0x2d0ead]]['replace'](/"/g,'\x27'));var _0xd000fe=phoneDescriptions[_0xcd67('0x7e')](_0x31042e=>_0x31042e[_0xcd67('0x89')]===_0x593d5c['id']);if(!_['isNil'](_0xd000fe)){var _0x5edf3c=_['trim'](_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74][_0x26015f[_0xd000fe[_0xcd67('0x8a')]]]['replace'](/"/g,'\x27'));if(!_[_0xcd67('0x22')](_0x5edf3c))_0x179065=_0x179065+'§'+_0x5edf3c;}if(_0x1235c7=='')_0x1235c7=_0x179065;else _0x1235c7+='|'+_0x179065;}_0x597e52[_0xcd67('0x21')](_0x593d5c['id']+':'+_0x1235c7);_0x586a31[_0x593d5c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3c864f['push']('\x22'+_0x597e52['join'](';')+'\x22');}if(_0x3393f5[_0xcd67('0x1e')]){handleError(_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74],{'code':_0xcd67('0x8b'),'message':_0x3393f5[_0xcd67('0x19')]()});}else{fs[_0xcd67('0x8c')](_0x3c3080,_0x3c864f[_0xcd67('0x19')]()+'\x0a');}_0x3c864f=[];}if(!(stats[_0xcd67('0x8d')]%0xc8)){socket[_0xcd67('0x8e')](_0xcd67('0x8f')+_0x21ecd6,stats);stats[_0xcd67('0x5d')]=[];}}if(stopped){logger[_0xcd67('0x58')](_0xcd67('0x90'));_0x452739[_0xcd67('0x91')]();}}catch(_0x2bd0fe){handleError(_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74],{'code':'SystemError','message':_0x2bd0fe[_0xcd67('0x5b')]});logger[_0xcd67('0x5a')](_0xcd67('0x92'),_0x2bd0fe[_0xcd67('0x5b')]);}},'complete':function(){try{var _0x42ef63=[];var _0x3e35ab=[];var _0x4b9452=_0xcd67('0x3d');if(_0x50b454[_0xcd67('0x93')]&&_0x50b454[_0xcd67('0x93')][_0xcd67('0x1e')]){_0x4b9452=_0xcd67('0x94')+_0x21ecd6;_0x42ef63['push'](_0xcd67('0x95')+_0x4b9452+_0xcd67('0x96'));}tmp_campaigns='campaigns_'+_0x21ecd6;tmp_voice_queues=_0xcd67('0x97')+_0x21ecd6;_0x3e35ab[_0xcd67('0x21')](_0xcd67('0x95')+tmp_campaigns+_0xcd67('0x98'));_0x3e35ab[_0xcd67('0x21')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0xcd67('0x98'));BPromise[_0xcd67('0x99')](_0x3e35ab,handleTZQuery)['then'](function(_0x5deff3){updateTzCampaigns(_0x50b454['ListId'])[_0xcd67('0x1d')](function(_0x11ac12){updateTzVoiceQueues(_0x50b454[_0xcd67('0x35')])['then'](function(_0x554619){if(hasTZ)_0x367978=_0x367978[_0xcd67('0x9a')](_0xcd67('0x6b'),_0xcd67('0x9b'));var _0x4ad015=util['format'](_0xcd67('0x9c'),_0x3c3080,_0x4b9452,_0x367978,_0x50b454[_0xcd67('0x35')],_0x50b454[_0xcd67('0x9d')]||null,NOW,NOW);if(_[_0xcd67('0x22')](_0x26015f[_0xcd67('0x33')])){_0x4ad015+=_0xcd67('0x9e');}_0x42ef63[_0xcd67('0x21')](_0x4ad015);if(_0x50b454['duplicates']&&_0x50b454[_0xcd67('0x93')][_0xcd67('0x1e')]){_0x42ef63[_0xcd67('0x21')](insertCmContact(_0x50b454[_0xcd67('0x35')],_0x4b9452,_0x50b454['duplicates'],_0x26015f));_0x42ef63[_0xcd67('0x21')](_0xcd67('0x9f')+_0x4b9452+';');}BPromise[_0xcd67('0x99')](_0x42ef63,handleQuery)[_0xcd67('0x1d')](function(_0xefc358){BPromise[_0xcd67('0x1f')]([handleAdditionalPhones()])['then'](function(){_0x42ef63=[];for(var _0x3a7b82=0x0;_0x3a7b82\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','SIGINT','uncaughtException','path','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','test','select','from','join','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','then','length','push','all','AdditionalPhones','split','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.createdAt','cm_hopper_black','cm_contacts.ListId\x20=\x20','.id\x20=\x20','field','\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.priority','recallme','\x22onlyIfOpen\x22','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','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','scheduledAt','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','info','Received\x20SIGINT','error','message','exit','code','sequelize','spread','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','catch','timezones','utcOffset','set','offset','dialTimezone','query','main','stringify','send','start','binding','clone','socket_timestamp','root','.csv','includes','ContactItemType','findAll','name','_description','header'];(function(_0x10a688,_0x4ae439){var _0x3098e8=function(_0x305f9d){while(--_0x305f9d){_0x10a688['push'](_0x10a688['shift']());}};_0x3098e8(++_0x4ae439);}(_0xeb57,0x1ba));var _0x7eb5=function(_0x437ad4,_0x572b4e){_0x437ad4=_0x437ad4-0x0;var _0x274b8d=_0xeb57[_0x437ad4];return _0x274b8d;};'use strict';var fs=require('fs');var path=require(_0x7eb5('0x0'));var _=require('lodash');var Papa=require(_0x7eb5('0x1'));var util=require(_0x7eb5('0x2'));var BPromise=require(_0x7eb5('0x3'));var moment=require('moment');var squel=require(_0x7eb5('0x4'));var Redis=require(_0x7eb5('0x5'));var db=require(_0x7eb5('0x6'))['db'];var config=require(_0x7eb5('0x7'));var shared=require(_0x7eb5('0x8'));var logger=require(_0x7eb5('0x9'))(_0x7eb5('0xa'));config[_0x7eb5('0xb')]=_[_0x7eb5('0xc')](config[_0x7eb5('0xb')],{'host':_0x7eb5('0xd'),'port':0x18eb});var socket=require(_0x7eb5('0xe'))(new Redis(config[_0x7eb5('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x7eb5('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x7eb5('0x10')](_0x7eb5('0xf'));function isEmail(_0x1ea69a){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))*$/[_0x7eb5('0x11')](_0x1ea69a);}function selectNotIn(_0x3c948e,_0x52e2ad,_0x10ec5a,_0x399d0a,_0x3463f6){return squel[_0x7eb5('0x12')]()['field']('phone')[_0x7eb5('0x13')](_0x399d0a)[_0x7eb5('0x14')](_0x52e2ad,null,_0x52e2ad+'.id\x20=\x20'+_0x399d0a+'.'+_0x10ec5a)[_0x7eb5('0x15')](_0x399d0a+'.'+_0x10ec5a+'\x20=\x20'+_0x3c948e+'.'+_0x10ec5a)[_0x7eb5('0x15')](_0x52e2ad+_0x7eb5('0x16')+_0x3463f6[_0x7eb5('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xfaaa9f,_0x5062e0){promisesAdditionalPhones=[];return db[_0x7eb5('0x17')]['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x7eb5('0x18')](function(_0x5d3a7a){if(_0x5d3a7a!==null){var _0x59bdbf=[];for(var _0x44c3e1=0x0;_0x44c3e1<_0x5d3a7a[_0x7eb5('0x19')];_0x44c3e1++){var _0x2b1806=_0x5d3a7a[_0x44c3e1];_0x59bdbf[_0x7eb5('0x1a')](insertAdditionalPhones(_0x2b1806));}}Promise[_0x7eb5('0x1b')](_0x59bdbf)[_0x7eb5('0x18')](function(){_0xfaaa9f({'val':0x1});});});});}function insertAdditionalPhones(_0x43e3a6){return new Promise(function(_0x3e8462,_0x55f6a8){var _0xfc50d5=_0x43e3a6[_0x7eb5('0x1c')];var _0x33d2ce=_0xfc50d5[_0x7eb5('0x1d')](';');var _0x3a0e87=[];orderBy=0x0;for(var _0x15c6b6=0x0;_0x15c6b6<_0x33d2ce[_0x7eb5('0x19')];_0x15c6b6++){_0x3a0e87[_0x7eb5('0x1a')](splitAdditionalPhone(_0x43e3a6['id'],_0x33d2ce[_0x15c6b6]));}Promise['all'](_0x3a0e87)[_0x7eb5('0x18')](function(){_0x3e8462({'val':_0x33d2ce[_0x7eb5('0x19')]});});});}function splitAdditionalPhone(_0x10a65a,_0x29b44a){return new Promise(function(_0x5f4169,_0x4d05f2){var _0x5a3f2e=_0x29b44a[_0x7eb5('0x1d')](':');var _0x1b4b5b=_0x5a3f2e[0x0];var _0x1e4bc6=_0x5a3f2e[0x1];if(!_['isNil'](_0x1e4bc6)){var _0x2b52c4=_0x1e4bc6[_0x7eb5('0x1d')]('|');var _0x35c733=[];for(var _0x4c96a5=0x0;_0x4c96a5<_0x2b52c4[_0x7eb5('0x19')];_0x4c96a5++){if(_0x2b52c4[_0x4c96a5]!==''){var _0x1eed24=_[_0x7eb5('0x1e')](promisesAdditionalPhones,{'contactId':_0x10a65a,'phone':_0x2b52c4[_0x4c96a5]});if(_0x1eed24['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x10a65a,'contactTypeId':_0x1b4b5b,'phone':_0x2b52c4[_0x4c96a5],'orderBy':orderBy});}}}_0x5f4169({'ok':0x1});}else _0x5f4169({'res':0x0});});}function createAdditionalPhone(_0x1fd28f,_0xa364bc,_0x2adcba,_0x2d9578){var _0x15651e='';var _0x5361b8='';var _0x19968=_0x2adcba[_0x7eb5('0x1d')]('§');_0x15651e=_0x19968[0x0];if(_0x19968[_0x7eb5('0x19')]==0x2)_0x5361b8=_0x19968[0x1];return new Promise(function(_0x311544,_0xceaa90){return db[_0x7eb5('0x1f')][_0x7eb5('0x20')]({'where':{'CmContactId':_0x1fd28f,'item':_0x15651e}})[_0x7eb5('0x18')](function(_0x3cf1de){if(_0x3cf1de){return db[_0x7eb5('0x1f')][_0x7eb5('0x21')]({'ItemTypeId':_0xa364bc,'description':_0x5361b8,'OrderBy':_0x2d9578},{'where':{'CmContactId':_0x1fd28f,'item':_0x15651e}})['then'](function(_0x14ad04){_0x311544({'res':_0x7eb5('0x22')});});}else{return db[_0x7eb5('0x1f')][_0x7eb5('0x23')]({'CmContactId':_0x1fd28f,'item':_0x15651e,'description':_0x5361b8,'ItemTypeId':_0xa364bc,'OrderBy':_0x2d9578,'ItemClass':_0x7eb5('0x24')})[_0x7eb5('0x18')](function(_0x23fc79){_0x311544({'res':_0x7eb5('0x25')});});}});});}function insertCmHopper(_0x901abc,_0x3289ac,_0x34cd98,_0x12076f,_0x178d16){var _0x10c72a=[_0x7eb5('0x26'),_0x7eb5('0x27'),_0x7eb5('0x28'),_0x7eb5('0x29'),_0x3289ac+'.'+_0x12076f,'cm_contacts.createdAt',_0x7eb5('0x2a'),'cm_contacts.priority',_0x7eb5('0x2b'),'\x22'+_0x178d16+'\x22'];return squel[_0x7eb5('0x2c')]()[_0x7eb5('0x2d')]('cm_hopper')[_0x7eb5('0x2e')]([_0x7eb5('0x2f'),_0x7eb5('0x30'),_0x7eb5('0x31'),_0x7eb5('0x32'),_0x12076f,_0x7eb5('0x33'),_0x7eb5('0x34'),_0x7eb5('0x35'),_0x7eb5('0x36'),'recallme'],squel['select']()[_0x7eb5('0x37')](_0x10c72a)['from'](_0x3289ac)['join'](_0x7eb5('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0x3289ac+_0x7eb5('0x39'))[_0x7eb5('0x14')](_0x34cd98,null,_0x34cd98+'.id\x20=\x20'+_0x3289ac+'.'+_0x12076f)['where'](_0x3289ac+_0x7eb5('0x3a'),_0x901abc)['where'](_0x7eb5('0x3b'),NOW)[_0x7eb5('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3289ac,_0x34cd98,_0x12076f,_0x7eb5('0x3c'),[_0x7eb5('0x3d'),'\x22onlyIfOpen\x22']))[_0x7eb5('0x15')](_0x7eb5('0x3e'),selectNotIn(_0x3289ac,_0x34cd98,_0x12076f,_0x7eb5('0x3c'),[_0x7eb5('0x3d')])))[_0x7eb5('0x3f')]();}function insertCmHopperBlack(_0x5cc29d,_0x4173f2,_0x24ca75,_0x3d6cc9){var _0x4c9183=[_0x7eb5('0x26'),_0x7eb5('0x28'),_0x7eb5('0x29'),_0x4173f2+'.'+_0x3d6cc9,_0x7eb5('0x40'),_0x7eb5('0x2a')];return squel[_0x7eb5('0x2c')]()[_0x7eb5('0x2d')](_0x7eb5('0x41'))[_0x7eb5('0x2e')](['phone',_0x7eb5('0x31'),'ListId',_0x3d6cc9,'createdAt',_0x7eb5('0x34')],squel['select']()[_0x7eb5('0x37')](_0x4c9183)[_0x7eb5('0x13')](_0x4173f2)[_0x7eb5('0x14')](_0x7eb5('0x38'),null,_0x7eb5('0x42')+_0x4173f2+_0x7eb5('0x39'))[_0x7eb5('0x14')](_0x24ca75,null,_0x24ca75+_0x7eb5('0x43')+_0x4173f2+'.'+_0x3d6cc9)[_0x7eb5('0x15')](_0x4173f2+'.CmListId\x20=\x20?',_0x5cc29d)[_0x7eb5('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x7eb5('0x15')](_0x7eb5('0x3e'),squel[_0x7eb5('0x12')]()[_0x7eb5('0x44')](_0x7eb5('0x2f'))[_0x7eb5('0x13')](_0x7eb5('0x41'))['where']('ListId\x20=\x20?',_0x5cc29d)[_0x7eb5('0x15')](_0x3d6cc9+_0x7eb5('0x45')+_0x4173f2+'.'+_0x3d6cc9)))[_0x7eb5('0x3f')]();}function insertTzCmHopper(_0x46fa62,_0x5c9fb0,_0x1212fa,_0x44e6b1,_0x186e3b,_0x502ef2){var _0xeb8075=['cm_contacts.phone',_0x7eb5('0x46')+_0x502ef2+'.offset-cm_contacts.utcOffset\x20minute)',_0x7eb5('0x28'),_0x7eb5('0x29'),_0x5c9fb0+'.'+_0x44e6b1,_0x7eb5('0x40'),_0x7eb5('0x2a'),_0x7eb5('0x47'),'cm_contacts.UserId','\x22'+_0x186e3b+'\x22'];var _0x2068f1=squel[_0x7eb5('0x2c')]()[_0x7eb5('0x2d')](_0x7eb5('0x3c'))['fromQuery']([_0x7eb5('0x2f'),_0x7eb5('0x30'),_0x7eb5('0x31'),'ListId',_0x44e6b1,_0x7eb5('0x33'),'updatedAt',_0x7eb5('0x35'),_0x7eb5('0x36'),_0x7eb5('0x48')],squel['select']()[_0x7eb5('0x37')](_0xeb8075)['from'](_0x5c9fb0)[_0x7eb5('0x14')](_0x7eb5('0x38'),null,_0x7eb5('0x42')+_0x5c9fb0+_0x7eb5('0x39'))['join'](_0x1212fa,null,_0x1212fa+_0x7eb5('0x43')+_0x5c9fb0+'.'+_0x44e6b1)[_0x7eb5('0x14')](_0x502ef2,null,_0x502ef2+'.id\x20=\x20'+_0x5c9fb0+'.'+_0x44e6b1)['where'](_0x5c9fb0+_0x7eb5('0x3a'),_0x46fa62)[_0x7eb5('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5c9fb0,_0x1212fa,_0x44e6b1,_0x7eb5('0x3c'),[_0x7eb5('0x3d'),_0x7eb5('0x49')]))[_0x7eb5('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5c9fb0,_0x1212fa,_0x44e6b1,'cm_hopper',[_0x7eb5('0x3d')])))[_0x7eb5('0x3f')]();return _0x2068f1;}function insertTzCmHopperBlack(_0xd57c5f,_0x124c9f,_0xac188e,_0x53d407){var _0x5f527f=[_0x7eb5('0x26'),_0x7eb5('0x28'),'cm_contacts.ListId',_0x124c9f+'.'+_0x53d407,_0x7eb5('0x40'),_0x7eb5('0x2a')];return squel['insert']()[_0x7eb5('0x2d')](_0x7eb5('0x41'))[_0x7eb5('0x2e')]([_0x7eb5('0x2f'),_0x7eb5('0x31'),_0x7eb5('0x32'),_0x53d407,_0x7eb5('0x33'),_0x7eb5('0x34')],squel['select']()[_0x7eb5('0x37')](_0x5f527f)[_0x7eb5('0x13')](_0x124c9f)[_0x7eb5('0x14')](_0x7eb5('0x38'),null,_0x7eb5('0x42')+_0x124c9f+_0x7eb5('0x39'))[_0x7eb5('0x14')](_0xac188e,null,_0xac188e+_0x7eb5('0x43')+_0x124c9f+'.'+_0x53d407)[_0x7eb5('0x15')](_0x124c9f+'.CmListId\x20=\x20?',_0xd57c5f)[_0x7eb5('0x15')](_0x7eb5('0x3b'),NOW)['where'](_0x7eb5('0x3e'),squel[_0x7eb5('0x12')]()[_0x7eb5('0x44')]('phone')[_0x7eb5('0x13')](_0x7eb5('0x41'))[_0x7eb5('0x15')](_0x7eb5('0x4a'),_0xd57c5f)[_0x7eb5('0x15')](_0x53d407+_0x7eb5('0x45')+_0x124c9f+'.'+_0x53d407)))[_0x7eb5('0x3f')]();}function insertCmHopperAdditionalPhones(_0x315257){var _0x5202e4=[_0x7eb5('0x4b'),_0x7eb5('0x4c'),_0x7eb5('0x4d'),_0x7eb5('0x4e'),_0x7eb5('0x4f')];return squel[_0x7eb5('0x2c')]()[_0x7eb5('0x2d')](_0x7eb5('0x50'))[_0x7eb5('0x2e')]([_0x7eb5('0x51'),_0x7eb5('0x2f'),'OrderBy',_0x7eb5('0x33'),_0x7eb5('0x34')],squel[_0x7eb5('0x12')]()[_0x7eb5('0x37')](_0x5202e4)['from'](_0x7eb5('0x3c'))[_0x7eb5('0x14')](_0x7eb5('0x38'),null,_0x7eb5('0x52'))[_0x7eb5('0x14')](_0x7eb5('0x53'),null,_0x7eb5('0x54'))[_0x7eb5('0x15')](_0x7eb5('0x55'),_0x315257)[_0x7eb5('0x15')](_0x7eb5('0x3b'),NOW))[_0x7eb5('0x3f')]();}function insertCmContact(_0x10718f,_0x4df4e3,_0x4ecdc1,_0xe4367c){var _0x29bd30=_[_0x7eb5('0x56')](_[_0x7eb5('0x57')](_0xe4367c),[_0x7eb5('0x32'),_0x7eb5('0x58'),_0x7eb5('0x33'),_0x7eb5('0x34'),_0x7eb5('0x59')]);return squel[_0x7eb5('0x2c')]()[_0x7eb5('0x2d')](_0x7eb5('0x38'))[_0x7eb5('0x2e')](_0x29bd30,squel[_0x7eb5('0x12')]()[_0x7eb5('0x37')](_0x29bd30)[_0x7eb5('0x13')](_0x4df4e3)['where']('('+_0x4ecdc1[_0x7eb5('0x14')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x7eb5('0x37')](_0x4ecdc1)[_0x7eb5('0x13')](_0x7eb5('0x38'))['where']('ListId\x20=\x20?',_0x10718f)['where'](_0x7eb5('0x5a')))['where'](_0x7eb5('0x5b'),squel[_0x7eb5('0x12')]()[_0x7eb5('0x44')](_0x7eb5('0x5c'),'min_id')[_0x7eb5('0x13')](_0x4df4e3)['group'](_0x4ecdc1['join'](','))))[_0x7eb5('0x3f')]();}function handleStop(){logger[_0x7eb5('0x5d')](_0x7eb5('0x5e'));stopped=!![];}function handleUncaughtException(_0x417236){logger[_0x7eb5('0x5f')](_0x417236[_0x7eb5('0x60')]);process[_0x7eb5('0x61')](0x1);}function handleError(_0x5aa861,_0x447bdd){stats['errors'][_0x7eb5('0x1a')]({'name':_0x447bdd[_0x7eb5('0x62')],'message':_0x447bdd['message'],'row':_0x5aa861});}function handleQuery(_0x4d2bfd){logger['info'](_0x4d2bfd);return db[_0x7eb5('0x63')]['query'](_0x4d2bfd)[_0x7eb5('0x64')](function(_0x250ec8){results[_0x7eb5('0x1a')](_0x250ec8);})['catch'](function(_0x3cc9cb){logger[_0x7eb5('0x5f')](_0x3cc9cb['message']);});}function updateTzCampaigns(_0x4a9215){return new Promise(function(_0x4ff2e6,_0x52692b){var _0x220647=squel['select']()[_0x7eb5('0x37')]([_0x7eb5('0x65'),_0x7eb5('0x66')])['from'](_0x7eb5('0x67'))['join'](_0x7eb5('0x68'),null,_0x7eb5('0x69'))[_0x7eb5('0x15')](_0x7eb5('0x6a')+_0x4a9215);db['sequelize']['query'](_0x220647[_0x7eb5('0x3f')]())[_0x7eb5('0x64')](function(_0x15d744){var _0x1a34ae=[];for(var _0x5e7958=0x0;_0x5e7958<_0x15d744[_0x7eb5('0x19')];_0x5e7958++){_0x1a34ae[_0x7eb5('0x1a')](getTimezoneData(_0x15d744[_0x5e7958],tmp_campaigns));}BPromise[_0x7eb5('0x1b')](_0x1a34ae)['then'](function(){_0x4ff2e6({'val':0x1});});})['catch'](function(_0x1bf0b5){logger[_0x7eb5('0x5f')](_0x1bf0b5[_0x7eb5('0x60')]);_0x4ff2e6({'val':0x0});});});}function updateTzVoiceQueues(_0x53d0e0){return new Promise(function(_0x23bb1a,_0x24a097){var _0x4e13ec=squel[_0x7eb5('0x12')]()[_0x7eb5('0x37')]([_0x7eb5('0x6b'),_0x7eb5('0x6c')])['from'](_0x7eb5('0x6d'))['join'](_0x7eb5('0x6e'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x7eb5('0x15')](_0x7eb5('0x6f')+_0x53d0e0);db[_0x7eb5('0x63')]['query'](_0x4e13ec['toString']())[_0x7eb5('0x64')](function(_0x23e9c1){var _0x4be807=[];for(var _0x3359a0=0x0;_0x3359a0<_0x23e9c1[_0x7eb5('0x19')];_0x3359a0++){_0x4be807['push'](getTimezoneData(_0x23e9c1[_0x3359a0],tmp_voice_queues));}BPromise[_0x7eb5('0x1b')](_0x4be807)[_0x7eb5('0x18')](function(){_0x23bb1a({'val':0x1});});})[_0x7eb5('0x70')](function(_0x5674af){logger[_0x7eb5('0x5f')](_0x5674af[_0x7eb5('0x60')]);_0x23bb1a({'val':0x0});});});}function getTimezoneData(_0x5ec46e,_0x33827c){return new Promise(function(_0x2bc681,_0xfde646){var _0x450de3=shared[_0x7eb5('0x71')];var _0x1126f5=_0x450de3[_0x5ec46e['dialTimezone']];if(_['isNil'](_0x1126f5)){_0x2bc681({'ret':0x1});}else{var _0x1ed2ca=_0x1126f5[_0x7eb5('0x72')];var _0x301f19=squel[_0x7eb5('0x2c')]()[_0x7eb5('0x2d')](_0x33827c)[_0x7eb5('0x73')]('id',_0x5ec46e['id'])[_0x7eb5('0x73')](_0x7eb5('0x74'),_0x1ed2ca)[_0x7eb5('0x73')](_0x7eb5('0x75'),_0x5ec46e[_0x7eb5('0x75')])['toString']();return db[_0x7eb5('0x63')][_0x7eb5('0x76')](_0x301f19)['spread'](function(_0xa097c8){_0x2bc681({'ret':0x1});})[_0x7eb5('0x70')](function(_0x539717){logger['error'](_0x539717[_0x7eb5('0x60')]);_0xfde646({'ret':0x1});});}});}function handleTZQuery(_0x28b358){logger[_0x7eb5('0x5d')](_0x28b358);return db['sequelize']['query'](_0x28b358)[_0x7eb5('0x64')](function(_0x2fd2a0){})[_0x7eb5('0x70')](function(_0x37d78f){logger[_0x7eb5('0x5f')](_0x37d78f[_0x7eb5('0x60')]);});}function main(_0x304387,_0x3ff23c,_0x268832,_0x3d3c03){logger[_0x7eb5('0x5d')](_0x7eb5('0x77'),_0x304387,JSON[_0x7eb5('0x78')](_0x3ff23c));process[_0x7eb5('0x79')](_0x7eb5('0x7a'));var _0x200955=_0x3ff23c[_0x7eb5('0x7b')];var _0x261558=_[_0x7eb5('0x7c')](_0x200955);var _0x2674e8=_0x3ff23c[_0x7eb5('0x7d')];var _0x57ed0c=path[_0x7eb5('0x14')](config[_0x7eb5('0x7e')],'server/files/tmp',_0x2674e8+_0x7eb5('0x7f'));hasTZ=_['keys'](_0x200955)[_0x7eb5('0x80')]('dialTimezone');var _0x2aa85e=_[_0x7eb5('0x57')](_0x200955)[_0x7eb5('0x14')]();logger[_0x7eb5('0x5d')]('header',_0x2aa85e);db[_0x7eb5('0x81')][_0x7eb5('0x82')]({'raw':!![],'attributes':['id',_0x7eb5('0x83')]})[_0x7eb5('0x18')](function(_0x11c770){for(var _0x195f1e=0x0;_0x195f1e<_0x11c770[_0x7eb5('0x19')];_0x195f1e++){if(_0x11c770[_0x195f1e][_0x7eb5('0x83')]in _0x200955){contactItemTypes[_0x7eb5('0x1a')](_0x11c770[_0x195f1e]);delete _0x261558[_0x11c770[_0x195f1e]['name']];hasAdditionalPhones=!![];}for(var _0x12bb3a in _0x200955){if(_0x11c770[_0x195f1e]['name']+_0x7eb5('0x84')===_0x12bb3a){phoneDescriptions[_0x7eb5('0x1a')]({'itemTypeId':_0x11c770[_0x195f1e]['id'],'description':_0x12bb3a});delete _0x261558[_0x12bb3a];}}}if(hasAdditionalPhones)_0x261558['AdditionalPhones']='';var _0x57b4fc=_[_0x7eb5('0x57')](_0x261558)[_0x7eb5('0x14')]();logger[_0x7eb5('0x5d')](_0x7eb5('0x85'),_0x57b4fc);fs[_0x7eb5('0x86')](_0x57ed0c,_0x57b4fc+'\x0a');Papa[_0x7eb5('0x87')](fs[_0x7eb5('0x88')](_0x304387),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1e3d4f,_0x3ceeab){try{for(var _0x424a6b=0x0,_0x5bee56=[];_0x424a6b<_0x1e3d4f[_0x7eb5('0x89')][_0x7eb5('0x19')];_0x424a6b++){stats['rows']+=0x1;if(_0x1e3d4f[_0x7eb5('0x8a')][_0x424a6b]){handleError(_0x1e3d4f[_0x7eb5('0x89')][_0x424a6b],_0x1e3d4f['errors'][_0x424a6b]);}else{var _0x44657e=[];var _0xcc4c8f=[];var _0x1491e5={};for(var _0x4df4b6 in _0x200955){let _0x39b3f9=contactItemTypes[_0x7eb5('0x8b')](_0x2f5ace=>_0x2f5ace[_0x7eb5('0x83')]===_0x4df4b6);let _0x3f75e1=contactItemTypes[_0x7eb5('0x8b')](_0x4dc200=>_0x4dc200[_0x7eb5('0x83')]+_0x7eb5('0x84')===_0x4df4b6);if(_[_0x7eb5('0x8c')](_0x39b3f9)&&_[_0x7eb5('0x8c')](_0x3f75e1)){if(_0x200955[_0x7eb5('0x8d')](_0x4df4b6)){if(_0x1e3d4f[_0x7eb5('0x89')][_0x424a6b][_0x200955[_0x4df4b6]]){var _0x5a6753=_[_0x7eb5('0x8e')](_0x1e3d4f[_0x7eb5('0x89')][_0x424a6b][_0x200955[_0x4df4b6]]['replace'](/"/g,'\x27'));switch(_0x4df4b6){case'scheduledat':var _0x2e7b56=moment(_0x5a6753,_0x7eb5('0xf'),!![]);if(_0x2e7b56['isValid']()){_0x5bee56[_0x7eb5('0x1a')]('\x22'+_0x5a6753+'\x22');}else{_0x44657e[_0x7eb5('0x1a')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x7eb5('0x35'):var _0x24a29f=parseInt(_0x5a6753);_0x5a6753=_[_0x7eb5('0x8f')](_0x24a29f)||_0x24a29f<0x0||_0x24a29f>0x4?_0x3d3c03?0x3:0x2:_0x24a29f;_0x5bee56[_0x7eb5('0x1a')]('\x22'+_0x5a6753+'\x22');break;case'UserId':var _0xbe1dbf=parseInt(_0x5a6753);if(_[_0x7eb5('0x90')](_0xbe1dbf)&&_['includes'](_0x268832,_0xbe1dbf)){_0x5bee56['push']('\x22'+_0xbe1dbf+'\x22');}else{_0x44657e[_0x7eb5('0x1a')](_0x7eb5('0x91'));}break;case _0x7eb5('0x92'):if(isEmail(_0x5a6753)){_0x5bee56['push']('\x22'+_0x5a6753+'\x22');}else{_0x44657e['push']('email\x20wrong\x20format');}break;case _0x7eb5('0x93'):var _0x3b0880=moment(_0x5a6753,'YYYY-MM-DD',!![]);if(_0x3b0880['isValid']()){_0x5bee56[_0x7eb5('0x1a')]('\x22'+_0x5a6753+'\x22');}else{_0x44657e[_0x7eb5('0x1a')](_0x7eb5('0x94'));}break;case _0x7eb5('0x75'):var _0x5a3966=shared[_0x7eb5('0x71')];var _0x2e5a05=_0x5a3966[_0x5a6753];if(!_['isNil'](_0x2e5a05)){var _0x2ef576=_0x2e5a05[_0x7eb5('0x72')];_0x5bee56[_0x7eb5('0x1a')]('\x22'+_0x5a6753+'\x22');_0x5bee56[_0x7eb5('0x1a')]('\x22'+_0x2ef576+'\x22');}break;default:_0x5bee56[_0x7eb5('0x1a')]('\x22'+_0x5a6753+'\x22');}}else{switch(_0x4df4b6){case _0x7eb5('0x95'):case _0x7eb5('0x2f'):_0x44657e[_0x7eb5('0x1a')](_0x4df4b6+_0x7eb5('0x96'));break;default:_0x5bee56[_0x7eb5('0x1a')]('\x22\x22');}}}}else{var _0x25404b='';if(!_[_0x7eb5('0x8c')](_0x39b3f9)){if(!_0x1491e5['hasOwnProperty'](_0x39b3f9['id'])){if(!_[_0x7eb5('0x8c')](_0x1e3d4f[_0x7eb5('0x89')][_0x424a6b][_0x200955[_0x4df4b6]])){var _0x5a6753=_[_0x7eb5('0x8e')](_0x1e3d4f[_0x7eb5('0x89')][_0x424a6b][_0x200955[_0x4df4b6]][_0x7eb5('0x97')](/"/g,'\x27'));var _0x24f54f=phoneDescriptions[_0x7eb5('0x8b')](_0x509e7d=>_0x509e7d[_0x7eb5('0x98')]===_0x39b3f9['id']);if(!_[_0x7eb5('0x8c')](_0x24f54f)){var _0x55e691=_[_0x7eb5('0x8e')](_0x1e3d4f[_0x7eb5('0x89')][_0x424a6b][_0x200955[_0x24f54f[_0x7eb5('0x99')]]][_0x7eb5('0x97')](/"/g,'\x27'));if(!_[_0x7eb5('0x8c')](_0x55e691))_0x5a6753=_0x5a6753+'§'+_0x55e691;}if(_0x25404b=='')_0x25404b=_0x5a6753;else _0x25404b+='|'+_0x5a6753;}_0xcc4c8f[_0x7eb5('0x1a')](_0x39b3f9['id']+':'+_0x25404b);_0x1491e5[_0x39b3f9['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5bee56[_0x7eb5('0x1a')]('\x22'+_0xcc4c8f[_0x7eb5('0x14')](';')+'\x22');}if(_0x44657e[_0x7eb5('0x19')]){handleError(_0x1e3d4f['data'][_0x424a6b],{'code':_0x7eb5('0x9a'),'message':_0x44657e[_0x7eb5('0x14')]()});}else{fs['appendFileSync'](_0x57ed0c,_0x5bee56[_0x7eb5('0x14')]()+'\x0a');}_0x5bee56=[];}if(!(stats[_0x7eb5('0x9b')]%0xc8)){socket[_0x7eb5('0x9c')]('contact:import:'+_0x2674e8,stats);stats['errors']=[];}}if(stopped){logger[_0x7eb5('0x5d')](_0x7eb5('0x9d'));_0x3ceeab[_0x7eb5('0x9e')]();}}catch(_0x371750){handleError(_0x1e3d4f[_0x7eb5('0x89')][_0x424a6b],{'code':_0x7eb5('0x9f'),'message':_0x371750[_0x7eb5('0x60')]});logger[_0x7eb5('0x5f')]('step',_0x371750[_0x7eb5('0x60')]);}},'complete':function(){try{var _0x23e119=[];var _0x3e5b28=[];var _0x693fc2='cm_contacts';if(_0x3ff23c[_0x7eb5('0xa0')]&&_0x3ff23c[_0x7eb5('0xa0')][_0x7eb5('0x19')]){_0x693fc2=_0x7eb5('0xa1')+_0x2674e8;_0x23e119['push'](_0x7eb5('0xa2')+_0x693fc2+_0x7eb5('0xa3'));}tmp_campaigns='campaigns_'+_0x2674e8;tmp_voice_queues=_0x7eb5('0xa4')+_0x2674e8;_0x3e5b28[_0x7eb5('0x1a')](_0x7eb5('0xa2')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x3e5b28['push'](_0x7eb5('0xa2')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x7eb5('0xa5')](_0x3e5b28,handleTZQuery)[_0x7eb5('0x18')](function(_0x1b39d1){updateTzCampaigns(_0x3ff23c[_0x7eb5('0x32')])[_0x7eb5('0x18')](function(_0x22f338){updateTzVoiceQueues(_0x3ff23c['ListId'])[_0x7eb5('0x18')](function(_0x459452){if(hasTZ)_0x57b4fc=_0x57b4fc[_0x7eb5('0x97')](_0x7eb5('0x75'),_0x7eb5('0xa6'));var _0x3c5763=util[_0x7eb5('0x10')](_0x7eb5('0xa7'),_0x57ed0c,_0x693fc2,_0x57b4fc,_0x3ff23c['ListId'],_0x3ff23c['CompanyId']||null,NOW,NOW);if(_[_0x7eb5('0x8c')](_0x200955[_0x7eb5('0x30')])){_0x3c5763+=_0x7eb5('0xa8');}_0x23e119[_0x7eb5('0x1a')](_0x3c5763);if(_0x3ff23c[_0x7eb5('0xa0')]&&_0x3ff23c['duplicates'][_0x7eb5('0x19')]){_0x23e119[_0x7eb5('0x1a')](insertCmContact(_0x3ff23c[_0x7eb5('0x32')],_0x693fc2,_0x3ff23c[_0x7eb5('0xa0')],_0x200955));_0x23e119['push'](_0x7eb5('0xa9')+_0x693fc2+';');}BPromise[_0x7eb5('0xa5')](_0x23e119,handleQuery)[_0x7eb5('0x18')](function(_0x520537){BPromise[_0x7eb5('0x1b')]([handleAdditionalPhones()])['then'](function(){_0x23e119=[];for(var _0x3afe64=0x0;_0x3afe64\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','format','YYYYMMDDHHmmss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','length','isNil','phone','AdditionalPhones','push','all','then','catch','error','message','split','CmContactHasItem','update','updated','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.id','cm_hopper_black','createdAt'];(function(_0x685346,_0x3ef2e5){var _0x52e15b=function(_0x4435da){while(--_0x4435da){_0x685346['push'](_0x685346['shift']());}};_0x52e15b(++_0x3ef2e5);}(_0xa693,0xf1));var _0x3a69=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xa693[_0x43f881];return _0x365c14;};'use strict';var fs=require('fs');var path=require(_0x3a69('0x0'));var _=require(_0x3a69('0x1'));var Papa=require(_0x3a69('0x2'));var util=require(_0x3a69('0x3'));var BPromise=require(_0x3a69('0x4'));var moment=require(_0x3a69('0x5'));var squel=require('squel');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x3a69('0x6'));var logger=require(_0x3a69('0x7'))(_0x3a69('0x8'));config[_0x3a69('0x9')]=_[_0x3a69('0xa')](config[_0x3a69('0x9')],{'host':_0x3a69('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a69('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()[_0x3a69('0xc')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName='cm_contacts_temp_'+moment()['format'](_0x3a69('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4826b5){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))*$/[_0x3a69('0xe')](_0x4826b5);}function selectNotIn(_0x44b8b2,_0x21142a,_0x9934c2,_0x295bac,_0x59f5aa){return squel[_0x3a69('0xf')]()[_0x3a69('0x10')]('phone')[_0x3a69('0x11')](_0x295bac)[_0x3a69('0x12')](_0x21142a,null,_0x21142a+_0x3a69('0x13')+_0x295bac+'.'+_0x9934c2)[_0x3a69('0x14')](_0x295bac+'.'+_0x9934c2+_0x3a69('0x15')+_0x44b8b2+'.'+_0x9934c2)[_0x3a69('0x14')](_0x21142a+_0x3a69('0x16')+_0x59f5aa[_0x3a69('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xc26b8a,_0x1b88cc){promisesAdditionalPhones=[];promisesContact=[];return db[_0x3a69('0x17')][_0x3a69('0x18')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x3a1adf){if(_0x3a1adf!==null){var _0x3ffd02=[];for(var _0xc7fa7c=0x0;_0xc7fa7c<_0x3a1adf[_0x3a69('0x19')];_0xc7fa7c++){var _0x17b18a=_0x3a1adf[_0xc7fa7c];if(!_[_0x3a69('0x1a')](_0x17b18a[_0x3a69('0x1b')])){if(!_[_0x3a69('0x1a')](_0x17b18a[_0x3a69('0x1c')]))_0x3ffd02[_0x3a69('0x1d')](insertAdditionalPhones(_0x17b18a));promisesContact['push']({'contact':_0x17b18a});}}}Promise[_0x3a69('0x1e')](_0x3ffd02)[_0x3a69('0x1f')](function(){_0xc26b8a({'val':0x1});});})[_0x3a69('0x20')](function(_0x4f78b7){logger[_0x3a69('0x21')](_0x4f78b7[_0x3a69('0x22')]);});});}function insertAdditionalPhones(_0x5090a8){return new Promise(function(_0x59f565,_0x4c34d9){var _0x3d365=_0x5090a8[_0x3a69('0x1c')];if(_['isNil'](_0x3d365))_0x4c34d9({'val':0x0});else{var _0x20e973=_0x3d365['split'](';');var _0x41adfc=[];orderBy=0x0;for(var _0x591bcf=0x0;_0x591bcf<_0x20e973[_0x3a69('0x19')];_0x591bcf++){_0x41adfc[_0x3a69('0x1d')](splitAdditionalPhone(_0x5090a8['id'],_0x20e973[_0x591bcf]));}Promise[_0x3a69('0x1e')](_0x41adfc)['then'](function(){_0x59f565({'val':_0x20e973[_0x3a69('0x19')]});});}});}function splitAdditionalPhone(_0x2603db,_0x12d7d3){return new Promise(function(_0x5321b0,_0x502ee8){var _0x4af991=_0x12d7d3[_0x3a69('0x23')](':');var _0xe06144=_0x4af991[0x0];var _0x525019=_0x4af991[0x1];if(_0x525019!==''){var _0x28c160=_0x525019[_0x3a69('0x23')]('|');var _0x277b5d=[];for(var _0xfa5706=0x0;_0xfa5706<_0x28c160[_0x3a69('0x19')];_0xfa5706++){if(_0x28c160[_0xfa5706]!==''){var _0x207ae1=_['filter'](promisesAdditionalPhones,{'contactId':_0x2603db,'phone':_0x28c160[_0xfa5706]});if(_0x207ae1[_0x3a69('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0x3a69('0x1d')]({'contactId':_0x2603db,'contactTypeId':_0xe06144,'phone':_0x28c160[_0xfa5706],'orderBy':orderBy});}}}_0x5321b0({'ok':0x1});}else _0x5321b0({'res':0x0});});}function createAdditionalPhone(_0x191e5b,_0x3d1330,_0x2af120,_0x30a17c){var _0x439053='';var _0x4e679f='';var _0x586d3f=_0x2af120['split']('§');_0x439053=_0x586d3f[0x0];if(_0x586d3f[_0x3a69('0x19')]==0x2)_0x4e679f=_0x586d3f[0x1];return new Promise(function(_0xb3eda5,_0x44ee98){return db[_0x3a69('0x24')]['findOne']({'where':{'CmContactId':_0x191e5b,'item':_0x439053}})[_0x3a69('0x1f')](function(_0x37843b){if(_0x37843b){return db['CmContactHasItem'][_0x3a69('0x25')]({'ItemTypeId':_0x3d1330,'description':_0x4e679f,'OrderBy':_0x30a17c},{'where':{'CmContactId':_0x191e5b,'item':_0x439053}})[_0x3a69('0x1f')](function(_0xe137e6){_0xb3eda5({'res':_0x3a69('0x26')});});}else{return db[_0x3a69('0x24')][_0x3a69('0x27')]({'CmContactId':_0x191e5b,'item':_0x439053,'ItemTypeId':_0x3d1330,'description':_0x4e679f,'OrderBy':_0x30a17c,'ItemClass':_0x3a69('0x28')})[_0x3a69('0x1f')](function(_0x441a0b){_0xb3eda5({'res':_0x3a69('0x29')});});}});});}function updateContact(_0x13040c){return new Promise(function(_0x5b1594,_0x69e1c2){var _0x8ce623=_0x13040c['id'];delete _0x13040c['id'];return db[_0x3a69('0x2a')][_0x3a69('0x25')](_0x13040c,{'where':{'id':_0x8ce623}})[_0x3a69('0x1f')](function(_0x26ea78){updatedRows+=0x1;return db[_0x3a69('0x2b')][_0x3a69('0x25')]({'phone':_0x13040c[_0x3a69('0x1b')]},{'where':{'ContactId':_0x8ce623}})[_0x3a69('0x1f')](function(_0x5d0d30){_0x5b1594({'ret':'OK'});});});});}function insertCmHopper(_0x1fb38c,_0x3b7b43,_0x9552ae,_0x14f2c1,_0x245a6d){var _0x282e3f=[_0x3a69('0x2c'),'cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId',_0x3b7b43+'.'+_0x14f2c1,_0x3a69('0x2d'),_0x3a69('0x2e'),_0x3a69('0x2f'),_0x3a69('0x30'),'\x22'+_0x245a6d+'\x22'];return squel[_0x3a69('0x31')]()[_0x3a69('0x32')](_0x3a69('0x33'))[_0x3a69('0x34')]([_0x3a69('0x1b'),_0x3a69('0x35'),_0x3a69('0x36'),_0x3a69('0x37'),_0x14f2c1,'createdAt','updatedAt','priority',_0x3a69('0x38'),_0x3a69('0x39')],squel[_0x3a69('0xf')]()[_0x3a69('0x3a')](_0x282e3f)[_0x3a69('0x11')](_0x3b7b43)['join'](_0x3a69('0x3b'),null,_0x3a69('0x3c')+_0x3b7b43+_0x3a69('0x3d'))['join'](_0x9552ae,null,_0x9552ae+_0x3a69('0x13')+_0x3b7b43+'.'+_0x14f2c1)[_0x3a69('0x14')](_0x3b7b43+_0x3a69('0x3e'),_0x1fb38c)[_0x3a69('0x14')](_0x3a69('0x3f'),NOW)[_0x3a69('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3b7b43,_0x9552ae,_0x14f2c1,'cm_hopper',[_0x3a69('0x40'),'\x22onlyIfOpen\x22']))['where'](_0x3a69('0x41'),selectNotIn(_0x3b7b43,_0x9552ae,_0x14f2c1,_0x3a69('0x33'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x46f6dc,_0x2e2b7a,_0x231f43,_0x5a8e53){var _0x401317=['cm_contacts.phone',_0x3a69('0x42'),'cm_contacts.ListId',_0x2e2b7a+'.'+_0x5a8e53,_0x3a69('0x2d'),'cm_contacts.updatedAt'];return squel[_0x3a69('0x31')]()[_0x3a69('0x32')](_0x3a69('0x43'))[_0x3a69('0x34')]([_0x3a69('0x1b'),_0x3a69('0x36'),_0x3a69('0x37'),_0x5a8e53,_0x3a69('0x44'),_0x3a69('0x45')],squel[_0x3a69('0xf')]()[_0x3a69('0x3a')](_0x401317)[_0x3a69('0x11')](_0x2e2b7a)[_0x3a69('0x12')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x2e2b7a+'.CmListId')[_0x3a69('0x12')](_0x231f43,null,_0x231f43+_0x3a69('0x13')+_0x2e2b7a+'.'+_0x5a8e53)['where'](_0x2e2b7a+_0x3a69('0x3e'),_0x46f6dc)[_0x3a69('0x14')](_0x3a69('0x3f'),NOW)[_0x3a69('0x14')](_0x3a69('0x41'),squel[_0x3a69('0xf')]()[_0x3a69('0x10')]('phone')[_0x3a69('0x11')]('cm_hopper_black')[_0x3a69('0x14')](_0x3a69('0x46'),_0x46f6dc)['where'](_0x5a8e53+_0x3a69('0x47'),_0x2e2b7a+'.'+_0x5a8e53)))[_0x3a69('0x48')]();}function insertCmHopperAdditionalPhones(_0x5733b8){var _0x1af3ab=[_0x3a69('0x49'),_0x3a69('0x4a'),_0x3a69('0x4b'),_0x3a69('0x4c'),'cm_contact_has_items.updatedAt'];return squel[_0x3a69('0x31')]()[_0x3a69('0x32')](_0x3a69('0x4d'))['fromQuery'](['CmHopperId',_0x3a69('0x1b'),'OrderBy',_0x3a69('0x44'),'updatedAt'],squel[_0x3a69('0xf')]()[_0x3a69('0x3a')](_0x1af3ab)['from'](_0x3a69('0x33'))[_0x3a69('0x12')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x3a69('0x12')]('cm_contact_has_items',null,_0x3a69('0x4e'))['where']('cm_hopper.ListId\x20=\x20?',_0x5733b8)[_0x3a69('0x14')](_0x3a69('0x3f'),NOW))[_0x3a69('0x48')]();}function insertCmContact(_0x156bc5,_0x242ef1,_0x91dce2,_0xb4eb7c){var _0x473617=_['concat'](_[_0x3a69('0x4f')](_0xb4eb7c),[_0x3a69('0x37'),_0x3a69('0x50'),'createdAt',_0x3a69('0x45')]);return squel[_0x3a69('0x31')]()[_0x3a69('0x32')](_0x3a69('0x3b'))[_0x3a69('0x34')](_0x473617,squel[_0x3a69('0xf')]()[_0x3a69('0x3a')](_0x473617)[_0x3a69('0x11')](_0x242ef1)[_0x3a69('0x14')]('('+_0x91dce2['join'](',')+_0x3a69('0x51'),squel[_0x3a69('0xf')]()[_0x3a69('0x3a')](_0x91dce2)[_0x3a69('0x11')](_0x3a69('0x3b'))[_0x3a69('0x14')](_0x3a69('0x46'),_0x156bc5))[_0x3a69('0x14')]('id\x20IN\x20?',squel[_0x3a69('0xf')]()[_0x3a69('0x10')](_0x3a69('0x52'),_0x3a69('0x53'))[_0x3a69('0x11')](_0x242ef1)[_0x3a69('0x54')](_0x91dce2['join'](','))))[_0x3a69('0x48')]();}function handleStop(){logger[_0x3a69('0x55')](_0x3a69('0x56'));stopped=!![];}function handleUncaughtException(_0x4270f5){logger[_0x3a69('0x21')](_0x4270f5[_0x3a69('0x22')]);process[_0x3a69('0x57')](0x1);}function handleError(_0x9737d4,_0x9c5656){stats['errors']['push']({'name':_0x9c5656[_0x3a69('0x58')],'message':_0x9c5656[_0x3a69('0x22')],'row':_0x9737d4});}function handleQuery(_0xa7862d){logger[_0x3a69('0x55')](_0xa7862d);return db['sequelize'][_0x3a69('0x18')](_0xa7862d)[_0x3a69('0x59')](function(_0x3635f3){results[_0x3a69('0x1d')](_0x3635f3);})[_0x3a69('0x20')](function(_0x13a50a){logger[_0x3a69('0x21')](_0x13a50a['message']);});}function main(_0x54995d,_0x19c158,_0x36d29d,_0x593390){logger[_0x3a69('0x55')]('main',_0x54995d,JSON[_0x3a69('0x5a')](_0x19c158));process[_0x3a69('0x5b')](_0x3a69('0x5c'));var _0xa1699d=_0x19c158[_0x3a69('0x5d')];var _0x60714e=_[_0x3a69('0x5e')](_0xa1699d);var _0x4263ba=_0x19c158[_0x3a69('0x5f')];var _0xa12fc5=path[_0x3a69('0x12')](config[_0x3a69('0x60')],_0x3a69('0x61'),_0x4263ba+_0x3a69('0x62'));logger['info'](_0x3a69('0x63'),_0x19c158);db[_0x3a69('0x64')][_0x3a69('0x65')]({'raw':!![],'attributes':['id',_0x3a69('0x66')]})[_0x3a69('0x1f')](function(_0x25a4ec){for(var _0x337576=0x0;_0x337576<_0x25a4ec[_0x3a69('0x19')];_0x337576++){if(_0x25a4ec[_0x337576][_0x3a69('0x66')]in _0xa1699d){contactItemTypes[_0x3a69('0x1d')](_0x25a4ec[_0x337576]);delete _0x60714e[_0x25a4ec[_0x337576]['name']];hasAdditionalPhones=!![];}for(var _0x203616 in _0xa1699d){if(_0x25a4ec[_0x337576][_0x3a69('0x66')]+_0x3a69('0x67')===_0x203616){phoneDescriptions[_0x3a69('0x1d')]({'itemTypeId':_0x25a4ec[_0x337576]['id'],'description':_0x203616});delete _0x60714e[_0x203616];}}}if(hasAdditionalPhones)_0x60714e['AdditionalPhones']='';var _0x1ee3f9=_['keys'](_0x60714e)[_0x3a69('0x12')]();logger['info'](_0x3a69('0x68'),_0x1ee3f9);fs['writeFileSync'](_0xa12fc5,_0x1ee3f9+'\x0a');Papa[_0x3a69('0x69')](fs[_0x3a69('0x6a')](_0x54995d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2f5d9e,_0x392708){try{for(var _0xf7739b=0x0,_0x567856=[];_0xf7739b<_0x2f5d9e[_0x3a69('0x6b')]['length'];_0xf7739b++){stats[_0x3a69('0x6c')]+=0x1;if(_0x2f5d9e['errors'][_0xf7739b]){handleError(_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b],_0x2f5d9e[_0x3a69('0x6d')][_0xf7739b]);}else{var _0x4962a1=[];var _0x4a510b=[];var _0x84c89f={};for(var _0x157b6c in _0xa1699d){let _0x4272a8=contactItemTypes[_0x3a69('0x6e')](_0x487fd6=>_0x487fd6[_0x3a69('0x66')]===_0x157b6c);let _0x4973dd=contactItemTypes[_0x3a69('0x6e')](_0x5711e1=>_0x5711e1[_0x3a69('0x66')]+'_description'===_0x157b6c);if(_[_0x3a69('0x1a')](_0x4272a8)&&_[_0x3a69('0x1a')](_0x4973dd)){if(_0xa1699d[_0x3a69('0x6f')](_0x157b6c)){if(_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b][_0xa1699d[_0x157b6c]]){var _0x4ccc06=_['trim'](_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b][_0xa1699d[_0x157b6c]][_0x3a69('0x70')](/"/g,'\x27'));switch(_0x157b6c){case'scheduledat':var _0x6b4527=moment(_0x4ccc06,_0x3a69('0x71'),!![]);if(_0x6b4527[_0x3a69('0x72')]()){_0x567856[_0x3a69('0x1d')]('\x22'+_0x4ccc06+'\x22');}else{_0x4962a1[_0x3a69('0x1d')](_0x3a69('0x73'));}break;case'priority':var _0x1f4dd3=parseInt(_0x4ccc06);_0x4ccc06=_[_0x3a69('0x74')](_0x1f4dd3)||_0x1f4dd3<0x0||_0x1f4dd3>0x4?_0x593390?0x3:0x2:_0x1f4dd3;_0x567856[_0x3a69('0x1d')]('\x22'+_0x4ccc06+'\x22');break;case _0x3a69('0x38'):var _0x31d838=parseInt(_0x4ccc06);if(_[_0x3a69('0x75')](_0x31d838)&&_[_0x3a69('0x76')](_0x36d29d,_0x31d838)){_0x567856[_0x3a69('0x1d')]('\x22'+_0x31d838+'\x22');}else{_0x4962a1[_0x3a69('0x1d')](_0x3a69('0x77'));}break;case _0x3a69('0x78'):if(isEmail(_0x4ccc06)){_0x567856[_0x3a69('0x1d')]('\x22'+_0x4ccc06+'\x22');}else{_0x4962a1['push'](_0x3a69('0x79'));}break;case _0x3a69('0x7a'):var _0xd91f4a=moment(_0x4ccc06,'YYYY-MM-DD',!![]);if(_0xd91f4a[_0x3a69('0x72')]()){_0x567856[_0x3a69('0x1d')]('\x22'+_0x4ccc06+'\x22');}else{_0x4962a1['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x567856[_0x3a69('0x1d')]('\x22'+_0x4ccc06+'\x22');}}else{switch(_0x157b6c){case _0x3a69('0x7b'):case _0x3a69('0x1b'):_0x4962a1[_0x3a69('0x1d')](_0x157b6c+_0x3a69('0x7c'));break;default:_0x567856['push']('\x22\x22');}}}}else{var _0x3d5829='';if(!_[_0x3a69('0x1a')](_0x4272a8)){if(!_0x84c89f[_0x3a69('0x6f')](_0x4272a8['id'])){for(var _0x348024=0x0;_0x348024<_0xa1699d[_0x157b6c][_0x3a69('0x19')];_0x348024++){var _0x4ccc06=_['trim'](_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b][_0xa1699d[_0x157b6c][_0x348024]][_0x3a69('0x70')](/"/g,'\x27'));var _0x4027b0=phoneDescriptions[_0x3a69('0x6e')](_0x421724=>_0x421724[_0x3a69('0x7d')]===_0x4272a8['id']);if(!_[_0x3a69('0x1a')](_0x4027b0)){var _0x3a32a8=_[_0x3a69('0x7e')](_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b][_0xa1699d[_0x4027b0[_0x3a69('0x7f')]][0x0]][_0x3a69('0x70')](/"/g,'\x27'));if(!_[_0x3a69('0x1a')](_0x3a32a8))_0x4ccc06=_0x4ccc06+'§'+_0x3a32a8;}if(_0x3d5829=='')_0x3d5829=_0x4ccc06;else _0x3d5829+='|'+_0x4ccc06;}_0x4a510b[_0x3a69('0x1d')](_0x4272a8['id']+':'+_0x3d5829);_0x84c89f[_0x4272a8['id']]=0x1;}}}}if(hasAdditionalPhones){_0x567856[_0x3a69('0x1d')]('\x22'+_0x4a510b[_0x3a69('0x12')](';')+'\x22');}if(_0x4962a1[_0x3a69('0x19')]){handleError(_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b],{'code':'SystemRow','message':_0x4962a1['join']()});}else{fs['appendFileSync'](_0xa12fc5,_0x567856[_0x3a69('0x12')]()+'\x0a');}_0x567856=[];}if(!(stats[_0x3a69('0x6c')]%0xc8)){socket['emit'](_0x3a69('0x80')+_0x4263ba,stats);stats['errors']=[];}}if(stopped){logger[_0x3a69('0x55')](_0x3a69('0x81'));_0x392708[_0x3a69('0x82')]();}}catch(_0x558d90){handleError(_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b],{'code':_0x3a69('0x83'),'message':_0x558d90[_0x3a69('0x22')]});logger[_0x3a69('0x21')](_0x3a69('0x84'),_0x558d90[_0x3a69('0x22')]);}},'complete':function(){try{var _0x5bfde4=[];var _0x4984dd=tempTableName;_0x5bfde4[_0x3a69('0x1d')](_0x3a69('0x85')+_0x4984dd+_0x3a69('0x86'));logger['info'](_0x3a69('0x87'),contactItemTypes[_0x3a69('0x19')]);var _0x211881=util[_0x3a69('0xc')](_0x3a69('0x88'),_0xa12fc5,_0x4984dd,_0x1ee3f9,_0x19c158[_0x3a69('0x37')],_0x19c158[_0x3a69('0x50')]||null,NOW,NOW);if(_[_0x3a69('0x1a')](_0xa1699d[_0x3a69('0x35')])){_0x211881+=',\x20scheduledAt\x20=\x20NOW()';}_0x5bfde4[_0x3a69('0x1d')](_0x211881);BPromise['each'](_0x5bfde4,handleQuery)[_0x3a69('0x1f')](function(_0x389d14){BPromise[_0x3a69('0x1e')]([handleAdditionalPhones()])[_0x3a69('0x1f')](function(){_0x5bfde4=[];for(var _0x22542a=0x0;_0x22542a\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','UserId','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','defaults','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','test','select','phone','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20'];(function(_0x40971c,_0x45dff9){var _0x1a65f6=function(_0x3cdeab){while(--_0x3cdeab){_0x40971c['push'](_0x40971c['shift']());}};_0x1a65f6(++_0x45dff9);}(_0x16a2,0x1d0));var _0x216a=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0x16a2[_0x16eb11];return _0x3ae7ef;};'use strict';var fs=require('fs');var path=require(_0x216a('0x0'));var _=require(_0x216a('0x1'));var Papa=require(_0x216a('0x2'));var util=require(_0x216a('0x3'));var BPromise=require(_0x216a('0x4'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x216a('0x5'));var db=require(_0x216a('0x6'))['db'];var config=require(_0x216a('0x7'));var logger=require(_0x216a('0x8'))('import');config['redis']=_[_0x216a('0x9')](config[_0x216a('0xa')],{'host':_0x216a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x216a('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()[_0x216a('0xc')](_0x216a('0xd'));var tempTableName=_0x216a('0xe')+moment()['format']('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x425586){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))*$/[_0x216a('0xf')](_0x425586);}function selectNotIn(_0x5bd333,_0x1af4e7,_0x329d32,_0xf34cc6,_0x37a507){return squel[_0x216a('0x10')]()['field'](_0x216a('0x11'))[_0x216a('0x12')](_0xf34cc6)['join'](_0x1af4e7,null,_0x1af4e7+_0x216a('0x13')+_0xf34cc6+'.'+_0x329d32)[_0x216a('0x14')](_0xf34cc6+'.'+_0x329d32+'\x20=\x20'+_0x5bd333+'.'+_0x329d32)[_0x216a('0x14')](_0x1af4e7+_0x216a('0x15')+_0x37a507['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x117b1e,_0x5c41f2){promisesAdditionalPhones=[];promisesContact=[];return db[_0x216a('0x16')][_0x216a('0x17')](_0x216a('0x18')+tempTableName)[_0x216a('0x19')](function(_0x4dedd0){if(_0x4dedd0!==null){var _0x46f19d=[];for(var _0x263c8e=0x0;_0x263c8e<_0x4dedd0['length'];_0x263c8e++){var _0x167e71=_0x4dedd0[_0x263c8e];if(!_['isNil'](_0x167e71[_0x216a('0x11')])){if(!_['isNil'](_0x167e71[_0x216a('0x1a')]))_0x46f19d[_0x216a('0x1b')](insertAdditionalPhones(_0x167e71));promisesContact[_0x216a('0x1b')]({'contact':_0x167e71});}}}Promise[_0x216a('0x1c')](_0x46f19d)[_0x216a('0x1d')](function(){_0x117b1e({'val':0x1});});})['catch'](function(_0x1ca65f){logger[_0x216a('0x1e')](_0x1ca65f[_0x216a('0x1f')]);});});}function insertAdditionalPhones(_0x3bccf7){return new Promise(function(_0x4f0f4d,_0x23444a){var _0x3b3157=_0x3bccf7[_0x216a('0x1a')];if(_[_0x216a('0x20')](_0x3b3157))_0x23444a({'val':0x0});else{var _0xed04d4=_0x3b3157[_0x216a('0x21')](';');var _0x2db674=[];orderBy=0x0;for(var _0x12f60b=0x0;_0x12f60b<_0xed04d4[_0x216a('0x22')];_0x12f60b++){_0x2db674[_0x216a('0x1b')](splitAdditionalPhone(_0x3bccf7['id'],_0xed04d4[_0x12f60b]));}Promise[_0x216a('0x1c')](_0x2db674)['then'](function(){_0x4f0f4d({'val':_0xed04d4[_0x216a('0x22')]});});}});}function splitAdditionalPhone(_0x5cf17c,_0x3b0480){return new Promise(function(_0x3ebc8d,_0x28ec6d){var _0x4bec85=_0x3b0480[_0x216a('0x21')](':');var _0x55a0d6=_0x4bec85[0x0];var _0x36a07a=_0x4bec85[0x1];if(_0x36a07a!==''){var _0x495422=_0x36a07a[_0x216a('0x21')]('|');var _0x5f0257=[];for(var _0x1c3a56=0x0;_0x1c3a56<_0x495422[_0x216a('0x22')];_0x1c3a56++){if(_0x495422[_0x1c3a56]!==''){var _0x566950=_[_0x216a('0x23')](promisesAdditionalPhones,{'contactId':_0x5cf17c,'phone':_0x495422[_0x1c3a56]});if(_0x566950[_0x216a('0x22')]==0x0){orderBy++;promisesAdditionalPhones[_0x216a('0x1b')]({'contactId':_0x5cf17c,'contactTypeId':_0x55a0d6,'phone':_0x495422[_0x1c3a56],'orderBy':orderBy});}}}_0x3ebc8d({'ok':0x1});}else _0x3ebc8d({'res':0x0});});}function createAdditionalPhone(_0x26565c,_0xb02c4,_0x530c76,_0x4bde64){var _0x689e71='';var _0x56a81c='';var _0x32f3b1=_0x530c76['split']('§');_0x689e71=_0x32f3b1[0x0];if(_0x32f3b1[_0x216a('0x22')]==0x2)_0x56a81c=_0x32f3b1[0x1];return new Promise(function(_0x4588b8,_0x2879dc){return db[_0x216a('0x24')][_0x216a('0x25')]({'where':{'CmContactId':_0x26565c,'item':_0x689e71}})['then'](function(_0x2eaec2){if(_0x2eaec2){return db[_0x216a('0x24')][_0x216a('0x26')]({'ItemTypeId':_0xb02c4,'description':_0x56a81c,'OrderBy':_0x4bde64},{'where':{'CmContactId':_0x26565c,'item':_0x689e71}})['then'](function(_0x4f1776){_0x4588b8({'res':'updated'});});}else{return db[_0x216a('0x24')][_0x216a('0x27')]({'CmContactId':_0x26565c,'item':_0x689e71,'ItemTypeId':_0xb02c4,'description':_0x56a81c,'OrderBy':_0x4bde64,'ItemClass':_0x216a('0x28')})[_0x216a('0x1d')](function(_0x393568){_0x4588b8({'res':'inserted'});});}});});}function updateContact(_0x31bbe5){return new Promise(function(_0x17d847,_0x2ffddb){var _0x4d1ffc=_0x31bbe5['id'];delete _0x31bbe5['id'];return db[_0x216a('0x29')][_0x216a('0x26')](_0x31bbe5,{'where':{'id':_0x4d1ffc}})[_0x216a('0x1d')](function(_0x378c5d){updatedRows+=0x1;return db['CmHopper'][_0x216a('0x26')]({'phone':_0x31bbe5[_0x216a('0x11')]},{'where':{'ContactId':_0x4d1ffc}})[_0x216a('0x1d')](function(_0x376ac7){_0x17d847({'ret':'OK'});});});});}function insertCmHopper(_0x3f2214,_0x27b03b,_0x459891,_0x5b760c,_0x112526){var _0x3041b7=['cm_contacts.phone',_0x216a('0x2a'),_0x216a('0x2b'),'cm_contacts.ListId',_0x27b03b+'.'+_0x5b760c,_0x216a('0x2c'),_0x216a('0x2d'),_0x216a('0x2e'),_0x216a('0x2f'),'\x22'+_0x112526+'\x22'];return squel[_0x216a('0x30')]()['into']('cm_hopper')[_0x216a('0x31')]([_0x216a('0x11'),_0x216a('0x32'),_0x216a('0x33'),_0x216a('0x34'),_0x5b760c,_0x216a('0x35'),'updatedAt',_0x216a('0x36'),'UserId',_0x216a('0x37')],squel[_0x216a('0x10')]()['fields'](_0x3041b7)[_0x216a('0x12')](_0x27b03b)[_0x216a('0x38')](_0x216a('0x39'),null,_0x216a('0x3a')+_0x27b03b+_0x216a('0x3b'))['join'](_0x459891,null,_0x459891+_0x216a('0x13')+_0x27b03b+'.'+_0x5b760c)[_0x216a('0x14')](_0x27b03b+_0x216a('0x3c'),_0x3f2214)[_0x216a('0x14')](_0x216a('0x3d'),NOW)['where'](_0x216a('0x3e'),selectNotIn(_0x27b03b,_0x459891,_0x5b760c,_0x216a('0x3f'),['\x22always\x22',_0x216a('0x40')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x27b03b,_0x459891,_0x5b760c,_0x216a('0x3f'),[_0x216a('0x41')])))[_0x216a('0x42')]();}function insertCmHopperBlack(_0x517cae,_0x4fedf1,_0x285c59,_0x189d32){var _0x197c87=[_0x216a('0x43'),_0x216a('0x2b'),_0x216a('0x44'),_0x4fedf1+'.'+_0x189d32,_0x216a('0x2c'),_0x216a('0x2d')];return squel[_0x216a('0x30')]()[_0x216a('0x45')](_0x216a('0x46'))['fromQuery']([_0x216a('0x11'),_0x216a('0x33'),'ListId',_0x189d32,_0x216a('0x35'),_0x216a('0x47')],squel['select']()[_0x216a('0x48')](_0x197c87)[_0x216a('0x12')](_0x4fedf1)[_0x216a('0x38')](_0x216a('0x39'),null,_0x216a('0x3a')+_0x4fedf1+_0x216a('0x3b'))[_0x216a('0x38')](_0x285c59,null,_0x285c59+_0x216a('0x13')+_0x4fedf1+'.'+_0x189d32)[_0x216a('0x14')](_0x4fedf1+'.CmListId\x20=\x20?',_0x517cae)[_0x216a('0x14')](_0x216a('0x3d'),NOW)[_0x216a('0x14')](_0x216a('0x3e'),squel[_0x216a('0x10')]()[_0x216a('0x49')](_0x216a('0x11'))[_0x216a('0x12')]('cm_hopper_black')['where'](_0x216a('0x4a'),_0x517cae)[_0x216a('0x14')](_0x189d32+_0x216a('0x4b'),_0x4fedf1+'.'+_0x189d32)))['toString']();}function insertCmHopperAdditionalPhones(_0x5d447f){var _0x1663f8=[_0x216a('0x4c'),_0x216a('0x4d'),_0x216a('0x4e'),_0x216a('0x4f'),_0x216a('0x50')];return squel[_0x216a('0x30')]()[_0x216a('0x45')]('cm_hopper_additional_phones')['fromQuery']([_0x216a('0x51'),_0x216a('0x11'),'OrderBy',_0x216a('0x35'),_0x216a('0x47')],squel['select']()[_0x216a('0x48')](_0x1663f8)[_0x216a('0x12')]('cm_hopper')[_0x216a('0x38')](_0x216a('0x39'),null,_0x216a('0x52'))[_0x216a('0x38')](_0x216a('0x53'),null,_0x216a('0x54'))[_0x216a('0x14')](_0x216a('0x55'),_0x5d447f)[_0x216a('0x14')](_0x216a('0x3d'),NOW))[_0x216a('0x42')]();}function insertCmContact(_0x283c86,_0x4b80e9,_0x5bb73a,_0x2da4b2){var _0x3c484a=_[_0x216a('0x56')](_[_0x216a('0x57')](_0x2da4b2),['ListId',_0x216a('0x58'),'createdAt',_0x216a('0x47')]);return squel[_0x216a('0x30')]()['into'](_0x216a('0x39'))[_0x216a('0x31')](_0x3c484a,squel[_0x216a('0x10')]()[_0x216a('0x48')](_0x3c484a)[_0x216a('0x12')](_0x4b80e9)[_0x216a('0x14')]('('+_0x5bb73a[_0x216a('0x38')](',')+_0x216a('0x59'),squel[_0x216a('0x10')]()[_0x216a('0x48')](_0x5bb73a)[_0x216a('0x12')](_0x216a('0x39'))[_0x216a('0x14')]('ListId\x20=\x20?',_0x283c86))[_0x216a('0x14')](_0x216a('0x5a'),squel['select']()['field']('MIN(id)','min_id')[_0x216a('0x12')](_0x4b80e9)[_0x216a('0x5b')](_0x5bb73a[_0x216a('0x38')](','))))[_0x216a('0x42')]();}function handleStop(){logger['info'](_0x216a('0x5c'));stopped=!![];}function handleUncaughtException(_0xfc00e6){logger[_0x216a('0x1e')](_0xfc00e6['message']);process[_0x216a('0x5d')](0x1);}function handleError(_0x241c34,_0x13e392){stats[_0x216a('0x5e')][_0x216a('0x1b')]({'name':_0x13e392[_0x216a('0x5f')],'message':_0x13e392[_0x216a('0x1f')],'row':_0x241c34});}function handleQuery(_0x4e8c5f){logger['info'](_0x4e8c5f);return db[_0x216a('0x16')]['query'](_0x4e8c5f)['spread'](function(_0x3acf01){results[_0x216a('0x1b')](_0x3acf01);})[_0x216a('0x60')](function(_0x427bcd){logger['error'](_0x427bcd[_0x216a('0x1f')]);});}function main(_0x436c97,_0x2d54e8,_0x129716,_0x108c11){logger['info'](_0x216a('0x61'),_0x436c97,JSON[_0x216a('0x62')](_0x2d54e8));process[_0x216a('0x63')](_0x216a('0x64'));var _0x44b604=_0x2d54e8[_0x216a('0x65')];var _0x4b094f=_[_0x216a('0x66')](_0x44b604);var _0x5905ea=_0x2d54e8[_0x216a('0x67')];var _0x1c7e9b=path['join'](config[_0x216a('0x68')],'server/files/tmp',_0x5905ea+_0x216a('0x69'));logger[_0x216a('0x6a')](_0x216a('0x6b'),_0x2d54e8);db['ContactItemType'][_0x216a('0x6c')]({'raw':!![],'attributes':['id',_0x216a('0x6d')]})[_0x216a('0x1d')](function(_0x3082d6){for(var _0x55bf5e=0x0;_0x55bf5e<_0x3082d6['length'];_0x55bf5e++){if(_0x3082d6[_0x55bf5e][_0x216a('0x6d')]in _0x44b604){contactItemTypes['push'](_0x3082d6[_0x55bf5e]);delete _0x4b094f[_0x3082d6[_0x55bf5e][_0x216a('0x6d')]];hasAdditionalPhones=!![];}for(var _0x3d9265 in _0x44b604){if(_0x3082d6[_0x55bf5e][_0x216a('0x6d')]+'_description'===_0x3d9265){phoneDescriptions['push']({'itemTypeId':_0x3082d6[_0x55bf5e]['id'],'description':_0x3d9265});delete _0x4b094f[_0x3d9265];}}}if(hasAdditionalPhones)_0x4b094f['AdditionalPhones']='';var _0x5c109b=_[_0x216a('0x57')](_0x4b094f)[_0x216a('0x38')]();logger[_0x216a('0x6a')](_0x216a('0x6e'),_0x5c109b);fs[_0x216a('0x6f')](_0x1c7e9b,_0x5c109b+'\x0a');Papa[_0x216a('0x70')](fs[_0x216a('0x71')](_0x436c97),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3aa096,_0x5ec531){try{for(var _0x5cf8d7=0x0,_0x4edbae=[];_0x5cf8d7<_0x3aa096[_0x216a('0x72')][_0x216a('0x22')];_0x5cf8d7++){stats[_0x216a('0x73')]+=0x1;if(_0x3aa096[_0x216a('0x5e')][_0x5cf8d7]){handleError(_0x3aa096[_0x216a('0x72')][_0x5cf8d7],_0x3aa096[_0x216a('0x5e')][_0x5cf8d7]);}else{var _0x113e9b=[];var _0x56df56=[];var _0x2cfc2b={};for(var _0x44e68b in _0x44b604){let _0x1b31c1=contactItemTypes[_0x216a('0x74')](_0x3cbebd=>_0x3cbebd[_0x216a('0x6d')]===_0x44e68b);let _0x1baf86=contactItemTypes[_0x216a('0x74')](_0x426a89=>_0x426a89[_0x216a('0x6d')]+_0x216a('0x75')===_0x44e68b);if(_['isNil'](_0x1b31c1)&&_['isNil'](_0x1baf86)){if(_0x44b604[_0x216a('0x76')](_0x44e68b)){if(_0x3aa096['data'][_0x5cf8d7][_0x44b604[_0x44e68b]]){var _0x1983e5=_[_0x216a('0x77')](_0x3aa096[_0x216a('0x72')][_0x5cf8d7][_0x44b604[_0x44e68b]][_0x216a('0x78')](/"/g,'\x27'));switch(_0x44e68b){case _0x216a('0x32'):var _0x2718db=moment(_0x1983e5,_0x216a('0xd'),!![]);if(_0x2718db[_0x216a('0x79')]()){_0x4edbae[_0x216a('0x1b')]('\x22'+_0x1983e5+'\x22');}else{_0x113e9b['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x216a('0x36'):var _0x3d965d=parseInt(_0x1983e5);_0x1983e5=_[_0x216a('0x7a')](_0x3d965d)||_0x3d965d<0x0||_0x3d965d>0x4?_0x108c11?0x3:0x2:_0x3d965d;_0x4edbae[_0x216a('0x1b')]('\x22'+_0x1983e5+'\x22');break;case'UserId':var _0x114434=parseInt(_0x1983e5);if(_[_0x216a('0x7b')](_0x114434)&&_[_0x216a('0x7c')](_0x129716,_0x114434)){_0x4edbae[_0x216a('0x1b')]('\x22'+_0x114434+'\x22');}else{_0x113e9b[_0x216a('0x1b')](_0x216a('0x7d'));}break;case'email':if(isEmail(_0x1983e5)){_0x4edbae[_0x216a('0x1b')]('\x22'+_0x1983e5+'\x22');}else{_0x113e9b['push']('email\x20wrong\x20format');}break;case _0x216a('0x7e'):var _0x488f4f=moment(_0x1983e5,_0x216a('0x7f'),!![]);if(_0x488f4f[_0x216a('0x79')]()){_0x4edbae[_0x216a('0x1b')]('\x22'+_0x1983e5+'\x22');}else{_0x113e9b[_0x216a('0x1b')](_0x216a('0x80'));}break;default:_0x4edbae[_0x216a('0x1b')]('\x22'+_0x1983e5+'\x22');}}else{switch(_0x44e68b){case _0x216a('0x81'):case _0x216a('0x11'):_0x113e9b[_0x216a('0x1b')](_0x44e68b+'\x20not\x20specified');break;default:_0x4edbae[_0x216a('0x1b')]('\x22\x22');}}}}else{var _0x255283='';if(!_['isNil'](_0x1b31c1)){if(!_0x2cfc2b[_0x216a('0x76')](_0x1b31c1['id'])){for(var _0x918549=0x0;_0x918549<_0x44b604[_0x44e68b][_0x216a('0x22')];_0x918549++){var _0x1983e5=_[_0x216a('0x77')](_0x3aa096[_0x216a('0x72')][_0x5cf8d7][_0x44b604[_0x44e68b][_0x918549]][_0x216a('0x78')](/"/g,'\x27'));var _0x4e643e=phoneDescriptions[_0x216a('0x74')](_0x349145=>_0x349145['itemTypeId']===_0x1b31c1['id']);if(!_[_0x216a('0x20')](_0x4e643e)){var _0x20256e=_['trim'](_0x3aa096[_0x216a('0x72')][_0x5cf8d7][_0x44b604[_0x4e643e[_0x216a('0x82')]][0x0]][_0x216a('0x78')](/"/g,'\x27'));if(!_[_0x216a('0x20')](_0x20256e))_0x1983e5=_0x1983e5+'§'+_0x20256e;}if(_0x255283=='')_0x255283=_0x1983e5;else _0x255283+='|'+_0x1983e5;}_0x56df56[_0x216a('0x1b')](_0x1b31c1['id']+':'+_0x255283);_0x2cfc2b[_0x1b31c1['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4edbae[_0x216a('0x1b')]('\x22'+_0x56df56['join'](';')+'\x22');}if(_0x113e9b[_0x216a('0x22')]){handleError(_0x3aa096[_0x216a('0x72')][_0x5cf8d7],{'code':_0x216a('0x83'),'message':_0x113e9b[_0x216a('0x38')]()});}else{fs['appendFileSync'](_0x1c7e9b,_0x4edbae[_0x216a('0x38')]()+'\x0a');}_0x4edbae=[];}if(!(stats[_0x216a('0x73')]%0xc8)){socket[_0x216a('0x84')](_0x216a('0x85')+_0x5905ea,stats);stats[_0x216a('0x5e')]=[];}}if(stopped){logger[_0x216a('0x6a')](_0x216a('0x86'));_0x5ec531[_0x216a('0x87')]();}}catch(_0x336522){handleError(_0x3aa096[_0x216a('0x72')][_0x5cf8d7],{'code':_0x216a('0x88'),'message':_0x336522[_0x216a('0x1f')]});logger[_0x216a('0x1e')](_0x216a('0x89'),_0x336522['message']);}},'complete':function(){try{var _0x2433c6=[];var _0x237899=tempTableName;_0x2433c6[_0x216a('0x1b')](_0x216a('0x8a')+_0x237899+_0x216a('0x8b'));logger[_0x216a('0x6a')](_0x216a('0x8c'),contactItemTypes[_0x216a('0x22')]);var _0x219bfb=util[_0x216a('0xc')](_0x216a('0x8d'),_0x1c7e9b,_0x237899,_0x5c109b,_0x2d54e8['ListId'],_0x2d54e8[_0x216a('0x58')]||null,NOW,NOW);if(_[_0x216a('0x20')](_0x44b604[_0x216a('0x32')])){_0x219bfb+=_0x216a('0x8e');}_0x2433c6[_0x216a('0x1b')](_0x219bfb);BPromise['each'](_0x2433c6,handleQuery)['then'](function(_0x1d776f){BPromise[_0x216a('0x1c')]([handleAdditionalPhones()])[_0x216a('0x1d')](function(){_0x2433c6=[];for(var _0x5e5afb=0x0;_0x5e5afb\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax'];(function(_0x71cd05,_0x36ac11){var _0x59c9e7=function(_0x5472cd){while(--_0x5472cd){_0x71cd05['push'](_0x71cd05['shift']());}};_0x59c9e7(++_0x36ac11);}(_0x9b70,0xb6));var _0x09b7=function(_0xb67251,_0x1f6208){_0xb67251=_0xb67251-0x0;var _0x979d96=_0x9b70[_0xb67251];return _0x979d96;};'use strict';var _=require(_0x09b7('0x0'));var squel=require(_0x09b7('0x1'));var as=require(_0x09b7('0x2'));var qs=require('../parsers/qs');var updateInteraction=require(_0x09b7('0x3'))[_0x09b7('0x4')];var utils=require('./utils');var db=require(_0x09b7('0x5'))['db'];function skipInteractionsQuery(_0x45e6b6,_0x21205a,_0x2db329){var _0x45fc91=![];var _0xb8142=utils['getAccountFK'](_0x45e6b6);if(_0x21205a[_0x09b7('0x6')]==='agent'&&!_0x2db329[_0x09b7('0x7')]&&!_0x2db329[_0xb8142]){_0x45fc91=!![];}return _0x45fc91;}function getTagsQuery(){return squel[_0x09b7('0x8')]()[_0x09b7('0x9')]('id')[_0x09b7('0x9')](_0x09b7('0xa'))[_0x09b7('0x9')]('color')[_0x09b7('0xb')]('tools_tags');}function getUsersQuery(_0x3773c2,_0x460528){var _0x3da116=utils['getInteractionFK'](_0x3773c2);var _0x47ebe6=_0x09b7('0xc')+_0x3773c2+'_interactions';var _0x457b15=squel[_0x09b7('0x8')]()[_0x09b7('0x9')](_0x09b7('0xd'))[_0x09b7('0x9')](_0x09b7('0xe'))[_0x09b7('0x9')](_0x09b7('0xf')+_0x3da116)[_0x09b7('0xb')](_0x47ebe6,'ui')['left_join'](_0x09b7('0x10'),'u','u.id\x20=\x20ui.UserId');if(_0x460528['length']>0x0){_0x457b15[_0x09b7('0x11')]('ui.'+_0x3da116+_0x09b7('0x12'),_[_0x09b7('0x13')](_0x460528,'id'));}return _0x457b15;}function getInteractionsQuery(_0x20a0c7){var _0x353fcc=utils[_0x09b7('0x14')](_0x20a0c7);var _0x19f8f8=utils['getAccountFK'](_0x20a0c7);var _0x22ba8d=utils[_0x09b7('0x15')](_0x20a0c7);return squel[_0x09b7('0x8')]()[_0x09b7('0xb')](_0x353fcc[_0x09b7('0x16')],'i')[_0x09b7('0x17')](_0x09b7('0x18'),'c',_0x09b7('0x19'))[_0x09b7('0x17')](_0x09b7('0x10'),'o',_0x09b7('0x1a'))[_0x09b7('0x17')](_0x353fcc[_0x09b7('0x1b')],'a',_0x09b7('0x1c')+_0x19f8f8)[_0x09b7('0x17')](_0x353fcc[_0x09b7('0x1d')],'me',_0x09b7('0x1e')+_0x22ba8d+_0x09b7('0x1f'))[_0x09b7('0x17')](_0x353fcc[_0x09b7('0x20')],'it',_0x09b7('0x21')+_0x22ba8d+_0x09b7('0x1f'))[_0x09b7('0x17')](_0x09b7('0x22'),'t',_0x09b7('0x23'));}function getSqlClauses(){var _0x544d11={'body':squel['expr'](),'contact':squel[_0x09b7('0x24')](),'default':squel[_0x09b7('0x24')](),'fields':squel[_0x09b7('0x24')](),'filter':squel[_0x09b7('0x24')](),'read':squel[_0x09b7('0x24')](),'tags':{'clause':squel[_0x09b7('0x24')](),'ids':null},'user':squel[_0x09b7('0x24')]()};return _0x544d11;}function parseTagParameter(_0x15273d){var _0xad023d=squel['expr']();if(_0x15273d){var _0x4481d0=utils['getSelectedTags'](_0x15273d);_0x4481d0['forEach'](function(_0x3205b9){_0xad023d['or'](_0x09b7('0x25'),'%,'+_0x3205b9+',%');});}return _0xad023d;}function parseReadParameter(_0x9533d9){var _0x3fe9ba='';if(_0x9533d9){_0x3fe9ba=_0x09b7('0x26');if(_0x9533d9==='1'){_0x3fe9ba=_0x3fe9ba[_0x09b7('0x27')](_0x09b7('0x28'),'=');}else{_0x3fe9ba=_0x3fe9ba[_0x09b7('0x27')]('{OPERATOR}','>');}}return _0x3fe9ba;}function parseSearchFilter(_0x516ab3,_0x4c85e1){var _0x40b4c5=squel[_0x09b7('0x24')]();if(_0x4c85e1){var _0x4544a0=_0x4c85e1[_0x09b7('0x27')]('\x5c','\x5c\x5c')[_0x09b7('0x27')](/'/g,'\x27\x27');if(qs[_0x09b7('0x29')](_0x4544a0)){_0x40b4c5['or'](_0x09b7('0x2a'),_0x4544a0+'%');if(['sms','whatsapp'][_0x09b7('0x2b')](_0x516ab3)){_0x40b4c5['or']('i.phone\x20LIKE\x20?',_0x4544a0+'%');}else if(_0x516ab3===_0x09b7('0x2c')){_0x40b4c5['or']('i.fax\x20LIKE\x20?',_0x4544a0+'%');}else if(_0x516ab3===_0x09b7('0x2d')){_0x40b4c5['or'](_0x09b7('0x2e'),_0x4544a0+'%');}}else if(_0x516ab3===_0x09b7('0x2f')&&qs[_0x09b7('0x30')](_0x4544a0)){_0x40b4c5['or']('c.email\x20LIKE\x20?',_0x4544a0+'%');}else{if(_0x516ab3==='mail'){_0x40b4c5['or'](_0x09b7('0x31'),qs[_0x09b7('0x32')](_0x4544a0,!![]))['or'](_0x09b7('0x33'),qs[_0x09b7('0x32')](_0x4544a0));}else if(_0x516ab3!=='fax'){_0x40b4c5['or'](_0x09b7('0x34'),qs[_0x09b7('0x32')](_0x4544a0));}_0x40b4c5['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x09b7('0x32')](_0x4544a0,!![]),null);}}return _0x40b4c5;}function parseAdvancedSearchFilter(_0x52f920,_0x25287c){var _0x4cac2a=getSqlClauses();var _0x40de82=as[_0x09b7('0x35')](_0x52f920);var _0x8f18a1=_0x40de82[_0x09b7('0x36')];for(var _0x52ad3d=0x0;_0x52ad3d<_0x40de82[_0x09b7('0x37')][_0x09b7('0x38')];_0x52ad3d++){var _0x43e33d=_0x40de82['conditions'][_0x52ad3d];var _0x190db2='i';var _0x12d292=_[_0x09b7('0x39')](_0x25287c,['name',_0x43e33d['field']]);if(_0x12d292){var _0x44c628=as[_0x09b7('0x3a')](_0x190db2,_0x12d292[_0x09b7('0x3b')],_0x43e33d);_0x4cac2a['default'][_0x8f18a1](_0x44c628['text'],_0x44c628['value']['start'],_0x44c628[_0x09b7('0x3c')][_0x09b7('0x3d')]);}else{switch(_0x43e33d[_0x09b7('0x9')]){case _0x09b7('0x3e'):var _0x10b624=parseReadParameter(_0x43e33d[_0x09b7('0x3c')]);_0x4cac2a[_0x09b7('0x3f')]['and'](_0x10b624);break;case'Contact':if(_0x43e33d[_0x09b7('0x40')]===_0x09b7('0x41')){if(_0x43e33d['value'][_0x09b7('0x42')]('\x20')[_0x09b7('0x38')]>0x1){_0x4cac2a[_0x09b7('0x43')][_0x8f18a1](_0x09b7('0x44'),qs[_0x09b7('0x32')](_0x43e33d[_0x09b7('0x3c')],!![]),null);}else{var _0x32badb='%'+_0x43e33d[_0x09b7('0x3c')]+'%';_0x4cac2a[_0x09b7('0x43')][_0x8f18a1](_0x09b7('0x45'),_0x32badb,_0x32badb,_0x32badb);}}else{_0x12d292=_[_0x09b7('0x39')](_0x25287c,[_0x09b7('0xa'),_0x09b7('0x46')]);_0x43e33d[_0x09b7('0x9')]='ContactId';_0x44c628=as[_0x09b7('0x3a')](_0x190db2,_0x12d292[_0x09b7('0x3b')],_0x43e33d);_0x4cac2a[_0x09b7('0x43')][_0x8f18a1](_0x44c628[_0x09b7('0x47')],_0x44c628[_0x09b7('0x3c')][_0x09b7('0x48')],_0x44c628[_0x09b7('0x3c')][_0x09b7('0x3d')]);}break;case _0x09b7('0x49'):var _0x3c7d71=_0x43e33d[_0x09b7('0x3c')][_0x09b7('0x42')](',')[_0x09b7('0x13')](function(_0x57d367){return Number(_0x57d367);});var _0x334abb=parseTagParameter(_0x3c7d71);_0x4cac2a[_0x09b7('0x4a')][_0x09b7('0x4b')][_0x09b7('0x4c')](_0x334abb);_0x4cac2a[_0x09b7('0x4a')]['ids']=_0x3c7d71;break;case _0x09b7('0x4d'):if(_0x43e33d[_0x09b7('0x40')]==='$substring'){_0x4cac2a[_0x09b7('0x4e')][_0x8f18a1]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x43e33d[_0x09b7('0x3c')]+'%',null);}else{_0x12d292=_[_0x09b7('0x39')](_0x25287c,[_0x09b7('0xa'),_0x09b7('0x4f')]);_0x43e33d['field']=_0x09b7('0x4f');_0x44c628=as[_0x09b7('0x3a')](_0x190db2,_0x12d292[_0x09b7('0x3b')],_0x43e33d);_0x4cac2a[_0x09b7('0x4e')][_0x8f18a1](_0x44c628[_0x09b7('0x47')],_0x44c628['value']['start'],_0x44c628[_0x09b7('0x3c')][_0x09b7('0x3d')]);}break;case'body':case _0x09b7('0x50'):_0x44c628=as[_0x09b7('0x3a')]('me',null,_0x43e33d);_0x4cac2a[_0x09b7('0x51')][_0x8f18a1](_0x44c628['text'],_0x44c628[_0x09b7('0x3c')][_0x09b7('0x48')],_0x44c628[_0x09b7('0x3c')][_0x09b7('0x3d')]);break;}}}return _0x4cac2a;}function parseModelFields(_0x3200a9,_0x58c0c5,_0x2d71cc){var _0x25d7fe=utils['getAccountFK'](_0x3200a9);var _0x41ec76=squel['expr']();var _0xf108c0=_(_0x58c0c5)[_0x09b7('0x52')]()[_0x09b7('0x13')](function(_0x2024be){return _['some'](_0x2d71cc,[_0x09b7('0xa'),_0x2024be])?_0x2024be:undefined;})[_0x09b7('0x53')]()[_0x09b7('0x3c')]();if(_0xf108c0[_0x09b7('0x38')]>0x0){_0xf108c0['forEach'](function(_0x49089a){if(_0x49089a===_0x25d7fe){_0x41ec76[_0x09b7('0x4c')]('i.'+_0x25d7fe+_0x09b7('0x12'),[][_0x09b7('0x54')](_0x58c0c5[_0x49089a]));}else if(_0x49089a===_0x09b7('0x55')){var _0x4c2db4=JSON[_0x09b7('0x56')](_0x58c0c5[_0x49089a])['$gte'];var _0xe0012=JSON['parse'](_0x58c0c5[_0x49089a])[_0x09b7('0x57')];_0x41ec76[_0x09b7('0x4c')](_0x09b7('0x58'),_0x4c2db4,_0xe0012);}else{if(_0x58c0c5[_0x49089a]===_0x09b7('0x59')){_0x41ec76[_0x09b7('0x4c')]('i.'+_0x49089a+_0x09b7('0x5a'));}else{_0x41ec76[_0x09b7('0x4c')]('i.'+_0x49089a+_0x09b7('0x5b'),_0x58c0c5[_0x49089a]);}}});}return _0x41ec76;}function parseQueryParameters(_0x1beeb7,_0x4cf033,_0x20a096){var _0x1c6e3b=getSqlClauses();return Promise[_0x09b7('0x5c')]()[_0x09b7('0x5d')](function(){return parseModelFields(_0x1beeb7,_0x4cf033,_0x20a096);})['then'](function(_0x4d3c9c){_0x1c6e3b[_0x09b7('0x5e')][_0x09b7('0x4c')](_0x4d3c9c);return parseReadParameter(_0x4cf033[_0x09b7('0x3f')]);})[_0x09b7('0x5d')](function(_0x24b685){_0x1c6e3b[_0x09b7('0x3f')]['and'](_0x24b685);return parseTagParameter(_0x4cf033[_0x09b7('0x5f')]);})[_0x09b7('0x5d')](function(_0x3cd452){_0x1c6e3b[_0x09b7('0x4a')]['clause']['and'](_0x3cd452);return parseSearchFilter(_0x1beeb7,_0x4cf033['filter']);})['then'](function(_0x191365){_0x1c6e3b[_0x09b7('0x60')]=_0x191365;return _0x1c6e3b;});}function checkAccountsRestrictions(_0x301654,_0xffa14b,_0x41a4d0){var _0x5dd0da=utils[_0x09b7('0x61')](_0x301654);var _0xdff095=_0x09b7('0x62')+_['capitalize'](_0x301654)+(_0x301654===_0x09b7('0x63')?_0x09b7('0x64'):_0x09b7('0x65'));var _0x11daf9=squel[_0x09b7('0x24')]();return Promise[_0x09b7('0x5c')]()[_0x09b7('0x5d')](function(){if(_0x41a4d0['search']&&_0xffa14b['role']==='agent'){return _0xffa14b[_0xdff095]({'attributes':['id'],'raw':!![]});}})[_0x09b7('0x5d')](function(_0x4597c0){if(_0x4597c0){if(_0x4597c0[_0x09b7('0x38')]===0x0){_0x11daf9[_0x09b7('0x4c')]('i.'+_0x5dd0da+_0x09b7('0x5a'));}else{_0x11daf9['and']('i.'+_0x5dd0da+_0x09b7('0x12'),_[_0x09b7('0x13')](_0x4597c0,'id'));}}else if(!_0x41a4d0[_0x5dd0da]){_0x11daf9[_0x09b7('0x4c')]('i.'+_0x5dd0da+_0x09b7('0x66'));}})['then'](function(){return _0x11daf9;});}function getClosedOrderClause(_0x3f9aff,_0x41dff1){var _0x50e349='';var _0x1b34a9=[_0x09b7('0x67'),_0x09b7('0x68'),_0x09b7('0x69')];if(_0x3f9aff===_0x09b7('0x2f')){_0x1b34a9['unshift'](_0x09b7('0x6a'));}if(_0x41dff1[_0x09b7('0x6b')]==='0'&&_0x3f9aff==='mail'){_0x50e349=_0x09b7('0x6a');}else{if(_0x41dff1['closed']==='1'){_0x1b34a9['shift']();}_0x50e349='CONCAT_WS(\x27\x27,\x20'+_0x1b34a9['join'](',\x20')+')';}return _0x50e349;}function getFilteredInteractions(_0x57bd29,_0x17a8fa,_0x516500,_0x6ebc08){var _0x18808d=utils[_0x09b7('0x15')](_0x57bd29);var _0x2d26dd=_[_0x09b7('0x6c')](_0x57bd29)+'Interaction';var _0x279cd6=[];var _0x18f35b=getTagsQuery();var _0x1773a5={'type':db[_0x09b7('0x6d')]['QueryTypes']['SELECT'],'raw':!![]};var _0x38526c=[];var _0x1b1db5=[];return db[_0x09b7('0x6e')]['query'](_0x18f35b['toString'](),_0x1773a5)[_0x09b7('0x5d')](function(_0x2e45aa){_0x279cd6=_[_0x09b7('0x6f')](_0x2e45aa,'id');_0x1773a5=_[_0x09b7('0x70')](_0x1773a5,{'model':db[_0x2d26dd],'mapToModel':!![],'nest':!![]});if(_0x516500['fields']){_0x6ebc08['attributes'][_0x09b7('0x71')](function(_0x5b6e7c){_0x17a8fa['field']('i.'+_0x5b6e7c);});}else{_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x72'),_0x09b7('0x3e'));_0x17a8fa[_0x09b7('0x9')]('a.key',_0x09b7('0x73'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x74'),_0x09b7('0x75'));if(_0x57bd29===_0x09b7('0x2f')){_0x17a8fa['field'](_0x09b7('0x76'),'Account.email');_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x77'),'contactName');_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x78'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x79'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x7a'));_0x17a8fa['field'](_0x09b7('0x7b'));_0x17a8fa['field'](_0x09b7('0x7c'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x7d'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x7e'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x7f'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x80'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x69'));_0x17a8fa['field'](_0x09b7('0x68'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x67'));_0x17a8fa[_0x09b7('0x9')]('i.substatus');_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x81'));_0x17a8fa['field'](_0x09b7('0x82'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x83'));_0x17a8fa['field'](_0x09b7('0x84'));}else if(_0x57bd29==='openchannel'){_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x85'),_0x09b7('0x86'));}else{_0x17a8fa['field']('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',_0x09b7('0x86'));}if(_0x57bd29!==_0x09b7('0x2f')){_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x87'));}_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x88'),'Contact.firstName');_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x89'),_0x09b7('0x8a'));_0x17a8fa[_0x09b7('0x9')]('c.email',_0x09b7('0x8b'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x8c'),'Contact.phone');_0x17a8fa[_0x09b7('0x9')]('c.mobile',_0x09b7('0x8d'));_0x17a8fa['field'](_0x09b7('0x8e'),_0x09b7('0x8f'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x90'),_0x09b7('0x91'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x92'),_0x09b7('0x93'));_0x17a8fa[_0x09b7('0x9')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x09b7('0x94'));}if(_0x6ebc08['limit']){_0x17a8fa[_0x09b7('0x95')](_0x6ebc08['limit']);}if(_0x6ebc08[_0x09b7('0x96')]){_0x17a8fa[_0x09b7('0x96')](_0x6ebc08[_0x09b7('0x96')]);}return db['sequelize'][_0x09b7('0x97')](_0x17a8fa[_0x09b7('0x98')](),_0x1773a5);})[_0x09b7('0x5d')](function(_0x5ebb21){_0x38526c=_0x5ebb21;var _0x5705bc=getUsersQuery(_0x57bd29,_0x38526c);return db['sequelize'][_0x09b7('0x97')](_0x5705bc[_0x09b7('0x98')](),_0x1773a5);})[_0x09b7('0x5d')](function(_0x2e44df){_0x1b1db5=_[_0x09b7('0x99')](_0x2e44df,_0x18808d);if(_0x57bd29===_0x09b7('0x2f')){return db[_0x09b7('0x9a')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x09b7('0x5d')](function(_0x64a230){var _0x2da568=_0x64a230?_0x64a230[_0x09b7('0x9b')]:undefined;var _0x56d6c2=_0x38526c[_0x09b7('0x13')](function(_0x45ef57){return updateInteraction(_0x45ef57,_0x279cd6,_0x1b1db5,_0x2da568);});return Promise[_0x09b7('0x9c')](_0x56d6c2);});}function countFilteredInteractions(_0x58742a,_0x24b775){var _0x141396=_0x58742a[_0x09b7('0x9d')]();_0x141396[_0x09b7('0x9')](_0x09b7('0x9e'));_0x141396[_0x09b7('0x9')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x1b1f57=utils['getSelectedTags'](_0x24b775);if(!_['isEmpty'](_0x1b1f57)){_0x141396[_0x09b7('0x11')](_0x09b7('0x9f'),_0x1b1f57);}var _0x5a9095={'type':db[_0x09b7('0x6d')][_0x09b7('0xa0')][_0x09b7('0xa1')],'raw':!![]};return db[_0x09b7('0x6e')]['query'](_0x141396[_0x09b7('0x98')](),_0x5a9095);}module[_0x09b7('0xa2')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xdde2=['default','value','start','end','unreadMessages','Contact','operator','$substring','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','split','map','tags','clause','and','ids','UserId','type','user','body','plainBody','some','forEach','createdAt','parse','$gte','$lte','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','read','filter','get','capitalize','chat','Websites','Accounts','\x20IN\x20?','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','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','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','limit','offset','groupBy','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','lodash','squel','../parsers/qs','updateInteraction','../../mysqldb','getAccountFK','role','agent','search','field','name','from','tools_tags','getInteractionFK','user_has_','_interactions','select','u.id','ui.','users','u.id\x20=\x20ui.UserId','where','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','fax','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','length','find','buildExpression'];(function(_0x5742d7,_0x2cc1e0){var _0x3194ff=function(_0x2d2ef9){while(--_0x2d2ef9){_0x5742d7['push'](_0x5742d7['shift']());}};_0x3194ff(++_0x2cc1e0);}(_0xdde2,0x6b));var _0x2dde=function(_0x4f5a77,_0x483719){_0x4f5a77=_0x4f5a77-0x0;var _0x497a5a=_0xdde2[_0x4f5a77];return _0x497a5a;};'use strict';var _=require(_0x2dde('0x0'));var squel=require(_0x2dde('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x2dde('0x2'));var updateInteraction=require('./update-interaction')[_0x2dde('0x3')];var utils=require('./utils');var db=require(_0x2dde('0x4'))['db'];function skipInteractionsQuery(_0x53ac27,_0x1d91ff,_0x32c9c6){var _0x112981=![];var _0x422e7e=utils[_0x2dde('0x5')](_0x53ac27);if(_0x1d91ff[_0x2dde('0x6')]===_0x2dde('0x7')&&!_0x32c9c6[_0x2dde('0x8')]&&!_0x32c9c6[_0x422e7e]){_0x112981=!![];}return _0x112981;}function getTagsQuery(){return squel['select']()[_0x2dde('0x9')]('id')[_0x2dde('0x9')](_0x2dde('0xa'))[_0x2dde('0x9')]('color')[_0x2dde('0xb')](_0x2dde('0xc'));}function getUsersQuery(_0x4886cd,_0x3e3b3d){var _0x5c00b=utils[_0x2dde('0xd')](_0x4886cd);var _0x2cb90c=_0x2dde('0xe')+_0x4886cd+_0x2dde('0xf');var _0x264891=squel[_0x2dde('0x10')]()[_0x2dde('0x9')](_0x2dde('0x11'))[_0x2dde('0x9')]('u.fullname')[_0x2dde('0x9')](_0x2dde('0x12')+_0x5c00b)[_0x2dde('0xb')](_0x2cb90c,'ui')['left_join'](_0x2dde('0x13'),'u',_0x2dde('0x14'));if(_0x3e3b3d['length']>0x0){_0x264891[_0x2dde('0x15')](_0x2dde('0x12')+_0x5c00b+'\x20IN\x20?',_['map'](_0x3e3b3d,'id'));}return _0x264891;}function getInteractionsQuery(_0xd246fc){var _0x5e27bd=utils['getInteractionsTables'](_0xd246fc);var _0xdad984=utils['getAccountFK'](_0xd246fc);var _0x31f441=utils[_0x2dde('0xd')](_0xd246fc);return squel[_0x2dde('0x10')]()['from'](_0x5e27bd['interactions'],'i')[_0x2dde('0x16')](_0x2dde('0x17'),'c',_0x2dde('0x18'))[_0x2dde('0x16')](_0x2dde('0x13'),'o',_0x2dde('0x19'))[_0x2dde('0x16')](_0x5e27bd[_0x2dde('0x1a')],'a',_0x2dde('0x1b')+_0xdad984)[_0x2dde('0x16')](_0x5e27bd[_0x2dde('0x1c')],'me',_0x2dde('0x1d')+_0x31f441+_0x2dde('0x1e'))['left_join'](_0x5e27bd[_0x2dde('0x1f')],'it',_0x2dde('0x20')+_0x31f441+_0x2dde('0x1e'))['left_join'](_0x2dde('0xc'),'t',_0x2dde('0x21'));}function getSqlClauses(){var _0x4d8a67={'body':squel[_0x2dde('0x22')](),'contact':squel['expr'](),'default':squel[_0x2dde('0x22')](),'fields':squel[_0x2dde('0x22')](),'filter':squel[_0x2dde('0x22')](),'read':squel[_0x2dde('0x22')](),'tags':{'clause':squel[_0x2dde('0x22')](),'ids':null},'user':squel[_0x2dde('0x22')]()};return _0x4d8a67;}function parseTagParameter(_0x542132){var _0x1de478=squel[_0x2dde('0x22')]();if(_0x542132){var _0x4d7f0a=utils[_0x2dde('0x23')](_0x542132);_0x4d7f0a['forEach'](function(_0x4402bf){_0x1de478['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4402bf+',%');});}return _0x1de478;}function parseReadParameter(_0x7dfab9){var _0x3b9595='';if(_0x7dfab9){_0x3b9595='unreadMessages\x20{OPERATOR}\x200';if(_0x7dfab9==='1'){_0x3b9595=_0x3b9595['replace'](_0x2dde('0x24'),'=');}else{_0x3b9595=_0x3b9595[_0x2dde('0x25')]('{OPERATOR}','>');}}return _0x3b9595;}function parseSearchFilter(_0xe4a0e3,_0x39a199){var _0x5421c7=squel[_0x2dde('0x22')]();if(_0x39a199){var _0x2dedec=_0x39a199['replace']('\x5c','\x5c\x5c')[_0x2dde('0x25')](/'/g,'\x27\x27');if(qs[_0x2dde('0x26')](_0x2dedec)){_0x5421c7['or'](_0x2dde('0x27'),_0x2dedec+'%');if([_0x2dde('0x28'),_0x2dde('0x29')][_0x2dde('0x2a')](_0xe4a0e3)){_0x5421c7['or'](_0x2dde('0x2b'),_0x2dedec+'%');}else if(_0xe4a0e3==='fax'){_0x5421c7['or']('i.fax\x20LIKE\x20?',_0x2dedec+'%');}else if(_0xe4a0e3===_0x2dde('0x2c')){_0x5421c7['or'](_0x2dde('0x2d'),_0x2dedec+'%');}}else if(_0xe4a0e3===_0x2dde('0x2e')&&qs[_0x2dde('0x2f')](_0x2dedec)){_0x5421c7['or']('c.email\x20LIKE\x20?',_0x2dedec+'%');}else{if(_0xe4a0e3===_0x2dde('0x2e')){_0x5421c7['or'](_0x2dde('0x30'),qs[_0x2dde('0x31')](_0x2dedec,!![]))['or'](_0x2dde('0x32'),qs[_0x2dde('0x31')](_0x2dedec));}else if(_0xe4a0e3!==_0x2dde('0x33')){_0x5421c7['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2dde('0x31')](_0x2dedec));}_0x5421c7['or'](_0x2dde('0x34'),qs['getFullTextValue'](_0x2dedec,!![]),null);}}return _0x5421c7;}function parseAdvancedSearchFilter(_0x4903d6,_0x43a86b){var _0x1fca33=getSqlClauses();var _0x58ca22=as[_0x2dde('0x35')](_0x4903d6);var _0x216fdf=_0x58ca22[_0x2dde('0x36')];for(var _0xb9d72c=0x0;_0xb9d72c<_0x58ca22[_0x2dde('0x37')][_0x2dde('0x38')];_0xb9d72c++){var _0x1fb68c=_0x58ca22[_0x2dde('0x37')][_0xb9d72c];var _0x2010f8='i';var _0x57f4f4=_[_0x2dde('0x39')](_0x43a86b,['name',_0x1fb68c['field']]);if(_0x57f4f4){var _0x2ffd83=as[_0x2dde('0x3a')](_0x2010f8,_0x57f4f4['type'],_0x1fb68c);_0x1fca33[_0x2dde('0x3b')][_0x216fdf](_0x2ffd83['text'],_0x2ffd83[_0x2dde('0x3c')][_0x2dde('0x3d')],_0x2ffd83[_0x2dde('0x3c')][_0x2dde('0x3e')]);}else{switch(_0x1fb68c['field']){case _0x2dde('0x3f'):var _0x72b198=parseReadParameter(_0x1fb68c['value']);_0x1fca33['read']['and'](_0x72b198);break;case _0x2dde('0x40'):if(_0x1fb68c[_0x2dde('0x41')]===_0x2dde('0x42')){if(_0x1fb68c[_0x2dde('0x3c')]['split']('\x20')[_0x2dde('0x38')]>0x1){_0x1fca33[_0x2dde('0x43')][_0x216fdf]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2dde('0x31')](_0x1fb68c['value'],!![]),null);}else{var _0xe0ab33='%'+_0x1fb68c[_0x2dde('0x3c')]+'%';_0x1fca33[_0x2dde('0x43')][_0x216fdf](_0x2dde('0x44'),_0xe0ab33,_0xe0ab33,_0xe0ab33);}}else{_0x57f4f4=_[_0x2dde('0x39')](_0x43a86b,[_0x2dde('0xa'),'ContactId']);_0x1fb68c[_0x2dde('0x9')]=_0x2dde('0x45');_0x2ffd83=as['buildExpression'](_0x2010f8,_0x57f4f4['type'],_0x1fb68c);_0x1fca33[_0x2dde('0x43')][_0x216fdf](_0x2ffd83[_0x2dde('0x46')],_0x2ffd83['value'][_0x2dde('0x3d')],_0x2ffd83[_0x2dde('0x3c')]['end']);}break;case _0x2dde('0x47'):var _0x3f8c76=_0x1fb68c[_0x2dde('0x3c')][_0x2dde('0x48')](',')[_0x2dde('0x49')](function(_0x430667){return Number(_0x430667);});var _0x493d3c=parseTagParameter(_0x3f8c76);_0x1fca33[_0x2dde('0x4a')][_0x2dde('0x4b')][_0x2dde('0x4c')](_0x493d3c);_0x1fca33[_0x2dde('0x4a')][_0x2dde('0x4d')]=_0x3f8c76;break;case'User':if(_0x1fb68c[_0x2dde('0x41')]===_0x2dde('0x42')){_0x1fca33['user'][_0x216fdf]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1fb68c[_0x2dde('0x3c')]+'%',null);}else{_0x57f4f4=_[_0x2dde('0x39')](_0x43a86b,['name',_0x2dde('0x4e')]);_0x1fb68c[_0x2dde('0x9')]=_0x2dde('0x4e');_0x2ffd83=as['buildExpression'](_0x2010f8,_0x57f4f4[_0x2dde('0x4f')],_0x1fb68c);_0x1fca33[_0x2dde('0x50')][_0x216fdf](_0x2ffd83['text'],_0x2ffd83[_0x2dde('0x3c')][_0x2dde('0x3d')],_0x2ffd83[_0x2dde('0x3c')][_0x2dde('0x3e')]);}break;case _0x2dde('0x51'):case _0x2dde('0x52'):_0x2ffd83=as[_0x2dde('0x3a')]('me',null,_0x1fb68c);_0x1fca33[_0x2dde('0x51')][_0x216fdf](_0x2ffd83[_0x2dde('0x46')],_0x2ffd83[_0x2dde('0x3c')][_0x2dde('0x3d')],_0x2ffd83[_0x2dde('0x3c')][_0x2dde('0x3e')]);break;}}}return _0x1fca33;}function parseModelFields(_0xf7237e,_0x5b46c3,_0x2b0b26){var _0x3f5071=utils['getAccountFK'](_0xf7237e);var _0x12c832=squel[_0x2dde('0x22')]();var _0x30d806=_(_0x5b46c3)['keys']()[_0x2dde('0x49')](function(_0x262545){return _[_0x2dde('0x53')](_0x2b0b26,[_0x2dde('0xa'),_0x262545])?_0x262545:undefined;})['compact']()[_0x2dde('0x3c')]();if(_0x30d806['length']>0x0){_0x30d806[_0x2dde('0x54')](function(_0x1c62a3){if(_0x1c62a3===_0x3f5071){_0x12c832['and']('i.'+_0x3f5071+'\x20IN\x20?',[]['concat'](_0x5b46c3[_0x1c62a3]));}else if(_0x1c62a3===_0x2dde('0x55')){var _0x5ba878=JSON[_0x2dde('0x56')](_0x5b46c3[_0x1c62a3])[_0x2dde('0x57')];var _0x27ac5e=JSON[_0x2dde('0x56')](_0x5b46c3[_0x1c62a3])[_0x2dde('0x58')];_0x12c832[_0x2dde('0x4c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5ba878,_0x27ac5e);}else{if(_0x5b46c3[_0x1c62a3]==='null'){_0x12c832[_0x2dde('0x4c')]('i.'+_0x1c62a3+_0x2dde('0x59'));}else{_0x12c832[_0x2dde('0x4c')]('i.'+_0x1c62a3+_0x2dde('0x5a'),_0x5b46c3[_0x1c62a3]);}}});}return _0x12c832;}function parseQueryParameters(_0x473970,_0x249627,_0x66d5d0){var _0x245407=getSqlClauses();return Promise[_0x2dde('0x5b')]()[_0x2dde('0x5c')](function(){return parseModelFields(_0x473970,_0x249627,_0x66d5d0);})[_0x2dde('0x5c')](function(_0x216a16){_0x245407[_0x2dde('0x5d')][_0x2dde('0x4c')](_0x216a16);return parseReadParameter(_0x249627[_0x2dde('0x5e')]);})['then'](function(_0x1e231f){_0x245407[_0x2dde('0x5e')][_0x2dde('0x4c')](_0x1e231f);return parseTagParameter(_0x249627['tag']);})['then'](function(_0x5fc489){_0x245407['tags']['clause'][_0x2dde('0x4c')](_0x5fc489);return parseSearchFilter(_0x473970,_0x249627[_0x2dde('0x5f')]);})['then'](function(_0x592110){_0x245407[_0x2dde('0x5f')]=_0x592110;return _0x245407;});}function checkAccountsRestrictions(_0x103aa1,_0x180483,_0x2a8f4b){var _0x180b05=utils[_0x2dde('0x5')](_0x103aa1);var _0x1b2a6b=_0x2dde('0x60')+_[_0x2dde('0x61')](_0x103aa1)+(_0x103aa1===_0x2dde('0x62')?_0x2dde('0x63'):_0x2dde('0x64'));var _0xf23acd=squel['expr']();return Promise[_0x2dde('0x5b')]()[_0x2dde('0x5c')](function(){if(_0x2a8f4b[_0x2dde('0x8')]&&_0x180483[_0x2dde('0x6')]===_0x2dde('0x7')){return _0x180483[_0x1b2a6b]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x25096e){if(_0x25096e){if(_0x25096e['length']===0x0){_0xf23acd[_0x2dde('0x4c')]('i.'+_0x180b05+_0x2dde('0x59'));}else{_0xf23acd['and']('i.'+_0x180b05+_0x2dde('0x65'),_[_0x2dde('0x49')](_0x25096e,'id'));}}else if(!_0x2a8f4b[_0x180b05]){_0xf23acd['and']('i.'+_0x180b05+_0x2dde('0x66'));}})[_0x2dde('0x5c')](function(){return _0xf23acd;});}function getClosedOrderClause(_0x2c1353,_0x2293a7){var _0x26b2c6='';var _0x1f47dd=[_0x2dde('0x67'),'i.secondDisposition',_0x2dde('0x68')];if(_0x2c1353===_0x2dde('0x2e')){_0x1f47dd[_0x2dde('0x69')](_0x2dde('0x6a'));}if(_0x2293a7[_0x2dde('0x6b')]==='0'&&_0x2c1353===_0x2dde('0x2e')){_0x26b2c6=_0x2dde('0x6a');}else{if(_0x2293a7[_0x2dde('0x6b')]==='1'){_0x1f47dd[_0x2dde('0x6c')]();}_0x26b2c6=_0x2dde('0x6d')+_0x1f47dd['join'](',\x20')+')';}return _0x26b2c6;}function getFilteredInteractions(_0x51998b,_0x5a47e1,_0x3aeb0f,_0x20c566){var _0x35658c=utils[_0x2dde('0xd')](_0x51998b);var _0x1b830=_[_0x2dde('0x61')](_0x51998b)+_0x2dde('0x6e');var _0x5db088=[];var _0x115841=getTagsQuery();var _0xa74f85={'type':db[_0x2dde('0x6f')][_0x2dde('0x70')][_0x2dde('0x71')],'raw':!![]};var _0x30495a=[];var _0x4298d9=[];return db[_0x2dde('0x72')][_0x2dde('0x73')](_0x115841[_0x2dde('0x74')](),_0xa74f85)[_0x2dde('0x5c')](function(_0x235ad6){_0x5db088=_[_0x2dde('0x75')](_0x235ad6,'id');_0xa74f85=_[_0x2dde('0x76')](_0xa74f85,{'model':db[_0x1b830],'mapToModel':!![],'nest':!![]});if(_0x3aeb0f[_0x2dde('0x5d')]){_0x20c566['attributes'][_0x2dde('0x54')](function(_0x25614d){_0x5a47e1[_0x2dde('0x9')]('i.'+_0x25614d);});}else{_0x5a47e1['field'](_0x2dde('0x77'),_0x2dde('0x3f'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x78'),_0x2dde('0x79'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x7a'),_0x2dde('0x7b'));if(_0x51998b===_0x2dde('0x2e')){_0x5a47e1['field'](_0x2dde('0x7c'),_0x2dde('0x7d'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x7e'),_0x2dde('0x7f'));_0x5a47e1[_0x2dde('0x9')]('i.id');_0x5a47e1[_0x2dde('0x9')]('i.createdAt');_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x80'));_0x5a47e1[_0x2dde('0x9')]('i.closed');_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x81'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x82'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x83'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x84'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x85'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x68'));_0x5a47e1['field']('i.secondDisposition');_0x5a47e1['field']('i.thirdDisposition');_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x6a'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x86'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x87'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x88'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x89'));}else if(_0x51998b===_0x2dde('0x2c')){_0x5a47e1[_0x2dde('0x9')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}else{_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x8a'),_0x2dde('0x7f'));}if(_0x51998b!==_0x2dde('0x2e')){_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x8b'));}_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x8c'),_0x2dde('0x8d'));_0x5a47e1[_0x2dde('0x9')]('c.lastName',_0x2dde('0x8e'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x8f'),_0x2dde('0x90'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x91'),_0x2dde('0x92'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x93'),_0x2dde('0x94'));_0x5a47e1[_0x2dde('0x9')]('c.fax',_0x2dde('0x95'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x96'),_0x2dde('0x97'));_0x5a47e1[_0x2dde('0x9')](_0x2dde('0x98'),_0x2dde('0x99'));_0x5a47e1['field'](_0x2dde('0x9a'),'TagIds');}if(_0x20c566[_0x2dde('0x9b')]){_0x5a47e1[_0x2dde('0x9b')](_0x20c566[_0x2dde('0x9b')]);}if(_0x20c566[_0x2dde('0x9c')]){_0x5a47e1['offset'](_0x20c566[_0x2dde('0x9c')]);}return db['sequelize'][_0x2dde('0x73')](_0x5a47e1[_0x2dde('0x74')](),_0xa74f85);})['then'](function(_0x4a6ec1){_0x30495a=_0x4a6ec1;var _0x811bc2=getUsersQuery(_0x51998b,_0x30495a);return db['sequelize'][_0x2dde('0x73')](_0x811bc2[_0x2dde('0x74')](),_0xa74f85);})[_0x2dde('0x5c')](function(_0x3e5cfd){_0x4298d9=_[_0x2dde('0x9d')](_0x3e5cfd,_0x35658c);if(_0x51998b===_0x2dde('0x2e')){return db['Setting'][_0x2dde('0x9e')]({'attributes':[_0x2dde('0x9f')],'raw':!![]});}})['then'](function(_0xc1f0f0){var _0x275fdc=_0xc1f0f0?_0xc1f0f0[_0x2dde('0x9f')]:undefined;var _0x4f63c7=_0x30495a['map'](function(_0x54f959){return updateInteraction(_0x54f959,_0x5db088,_0x4298d9,_0x275fdc);});return Promise[_0x2dde('0xa0')](_0x4f63c7);});}function countFilteredInteractions(_0x66c5d3,_0x2c3cad){var _0x55de78=_0x66c5d3[_0x2dde('0xa1')]();_0x55de78['field'](_0x2dde('0xa2'));_0x55de78[_0x2dde('0x9')](_0x2dde('0x77'),'unreadMessages');var _0x6a97c=utils[_0x2dde('0x23')](_0x2c3cad);if(!_[_0x2dde('0xa3')](_0x6a97c)){_0x55de78[_0x2dde('0x15')](_0x2dde('0xa4'),_0x6a97c);}var _0x5de195={'type':db['Sequelize'][_0x2dde('0x70')][_0x2dde('0x71')],'raw':!![]};return db[_0x2dde('0x72')][_0x2dde('0x73')](_0x55de78[_0x2dde('0x74')](),_0x5de195);}module[_0x2dde('0xa5')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 44780e0..a7b1304 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 _0x817b=['MailMessage','findOne','out','plainBody','then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','Tags','../../mysqldb','map','fullname','forEach','waiting','talking','answered','unmanaged','closed','disposition','abandoned','UserId','total'];(function(_0x52961c,_0x1c7d2f){var _0x47176c=function(_0x40ca6b){while(--_0x40ca6b){_0x52961c['push'](_0x52961c['shift']());}};_0x47176c(++_0x1c7d2f);}(_0x817b,0x89));var _0xb817=function(_0x4ba730,_0x368687){_0x4ba730=_0x4ba730-0x0;var _0x49c90b=_0x817b[_0x4ba730];return _0x49c90b;};'use strict';var _=require('lodash');var db=require(_0xb817('0x0'))['db'];function getInteractionUsers(_0x40fd8a,_0x27c742){return new Promise(function(_0x58097a,_0x1a2cae){try{var _0x5900d2=[];if(_0x27c742[_0x40fd8a]){_0x5900d2=_0x27c742[_0x40fd8a][_0xb817('0x1')](function(_0x2d7185){return{'id':_0x2d7185['id'],'fullname':_0x2d7185[_0xb817('0x2')]};});}return _0x58097a(_0x5900d2);}catch(_0x557f9d){_0x1a2cae(_0x557f9d);}});}function getInteractionTags(_0x5565e2,_0x5b7dc0){var _0x2286f9=[];if(_0x5565e2){_0x5565e2['split'](',')[_0xb817('0x3')](function(_0x1a15e2){_0x2286f9['push'](_0x5b7dc0[_0x1a15e2]);});}return _0x2286f9;}function updateWaitingCounter(_0x4c8449){if(_0x4c8449[_0xb817('0x4')]){_0x4c8449[_0xb817('0x4')]-=0x1;}}function updateInteractionCounters(_0x204d67){_0x204d67[_0xb817('0x4')]=0x0;_0x204d67[_0xb817('0x5')]=0x0;_0x204d67[_0xb817('0x6')]=0x0;_0x204d67[_0xb817('0x7')]=0x0;_0x204d67['abandoned']=0x0;_0x204d67['total']=0x0;if(_0x204d67[_0xb817('0x8')]){if(_0x204d67[_0xb817('0x9')]===_0xb817('0xa')){_0x204d67[_0xb817('0xa')]+=0x1;updateWaitingCounter(_0x204d67);}if(_0x204d67[_0xb817('0xb')]){_0x204d67['answered']+=0x1;if(_0x204d67[_0xb817('0x5')]){_0x204d67[_0xb817('0x5')]-=0x1;}}else{if(_0x204d67[_0xb817('0x9')]){_0x204d67['unmanaged']+=0x1;updateWaitingCounter(_0x204d67);}}}else{if(!_0x204d67[_0xb817('0xb')]){_0x204d67[_0xb817('0x4')]+=0x1;}if(_0x204d67[_0xb817('0xb')]){_0x204d67[_0xb817('0x5')]+=0x1;updateWaitingCounter(_0x204d67);}}_0x204d67[_0xb817('0xc')]+=0x1;return _0x204d67;}function getLastMessageText(_0x20f332){return db[_0xb817('0xd')][_0xb817('0xe')]({'where':{'$and':[{'MailInteractionId':_0x20f332['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xb817('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xb817('0x10')],'order':'-id','raw':!![]})[_0xb817('0x11')](function(_0x5b795c){if(_0x5b795c&&_0x5b795c[_0xb817('0x10')]){_0x20f332[_0xb817('0x12')]=_[_0xb817('0x13')](_0x5b795c[_0xb817('0x10')]);}return _0x20f332;})[_0xb817('0x14')](function(_0x1c10da){throw _0x1c10da;});}exports[_0xb817('0x15')]=function(_0x509832,_0x471fc1,_0x1298f2,_0xf13cf2){return new Promise(function(_0xd38ff8,_0x5758d8){return getInteractionUsers(_0x509832['id'],_0x1298f2)[_0xb817('0x11')](function(_0x4eec17){_0x509832[_0xb817('0x16')]=_0x4eec17;return getInteractionTags(_0x509832[_0xb817('0x17')],_0x471fc1);})['then'](function(_0x49d12d){_0x509832[_0xb817('0x18')]=_0x49d12d;delete _0x509832['TagIds'];return updateInteractionCounters(_0x509832);})[_0xb817('0x11')](function(_0x3a8180){if(_0xf13cf2){return getLastMessageText(_0x3a8180);}else{return _0x3a8180;}})[_0xb817('0x11')](function(_0x524039){_0xd38ff8(_0x524039);})[_0xb817('0x14')](function(_0x383ad4){_0x5758d8(_0x383ad4);});});}; \ No newline at end of file +var _0x3922=['waiting','talking','answered','abandoned','total','closed','disposition','UserId','unmanaged','findOne','plainBody','-id','then','lastMsgText','trimStart','Tags','TagIds','lodash','../../mysqldb','map','split','forEach','push'];(function(_0x567bcb,_0x4978c1){var _0x4eebc2=function(_0x42a456){while(--_0x42a456){_0x567bcb['push'](_0x567bcb['shift']());}};_0x4eebc2(++_0x4978c1);}(_0x3922,0xe0));var _0x2392=function(_0x7275ac,_0x31c0b7){_0x7275ac=_0x7275ac-0x0;var _0x5974e1=_0x3922[_0x7275ac];return _0x5974e1;};'use strict';var _=require(_0x2392('0x0'));var db=require(_0x2392('0x1'))['db'];function getInteractionUsers(_0x3a709a,_0x985350){return new Promise(function(_0x24e0f8,_0x32b58d){try{var _0x3df3bf=[];if(_0x985350[_0x3a709a]){_0x3df3bf=_0x985350[_0x3a709a][_0x2392('0x2')](function(_0x8c9d7c){return{'id':_0x8c9d7c['id'],'fullname':_0x8c9d7c['fullname']};});}return _0x24e0f8(_0x3df3bf);}catch(_0x614aa2){_0x32b58d(_0x614aa2);}});}function getInteractionTags(_0x474cdd,_0x4a2394){var _0x4acf2a=[];if(_0x474cdd){_0x474cdd[_0x2392('0x3')](',')[_0x2392('0x4')](function(_0x2dea3f){_0x4acf2a[_0x2392('0x5')](_0x4a2394[_0x2dea3f]);});}return _0x4acf2a;}function updateWaitingCounter(_0x2dfe7d){if(_0x2dfe7d[_0x2392('0x6')]){_0x2dfe7d[_0x2392('0x6')]-=0x1;}}function updateInteractionCounters(_0x367c8d){_0x367c8d[_0x2392('0x6')]=0x0;_0x367c8d[_0x2392('0x7')]=0x0;_0x367c8d[_0x2392('0x8')]=0x0;_0x367c8d['unmanaged']=0x0;_0x367c8d[_0x2392('0x9')]=0x0;_0x367c8d[_0x2392('0xa')]=0x0;if(_0x367c8d[_0x2392('0xb')]){if(_0x367c8d[_0x2392('0xc')]===_0x2392('0x9')){_0x367c8d[_0x2392('0x9')]+=0x1;updateWaitingCounter(_0x367c8d);}if(_0x367c8d[_0x2392('0xd')]){_0x367c8d[_0x2392('0x8')]+=0x1;if(_0x367c8d[_0x2392('0x7')]){_0x367c8d[_0x2392('0x7')]-=0x1;}}else{if(_0x367c8d['disposition']){_0x367c8d[_0x2392('0xe')]+=0x1;updateWaitingCounter(_0x367c8d);}}}else{if(!_0x367c8d[_0x2392('0xd')]){_0x367c8d[_0x2392('0x6')]+=0x1;}if(_0x367c8d[_0x2392('0xd')]){_0x367c8d[_0x2392('0x7')]+=0x1;updateWaitingCounter(_0x367c8d);}}_0x367c8d[_0x2392('0xa')]+=0x1;return _0x367c8d;}function getLastMessageText(_0x925115){return db['MailMessage'][_0x2392('0xf')]({'where':{'$and':[{'MailInteractionId':_0x925115['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x2392('0x10')],'order':_0x2392('0x11'),'raw':!![]})[_0x2392('0x12')](function(_0x2c095d){if(_0x2c095d&&_0x2c095d[_0x2392('0x10')]){_0x925115[_0x2392('0x13')]=_[_0x2392('0x14')](_0x2c095d['plainBody']);}return _0x925115;})['catch'](function(_0x2b311c){throw _0x2b311c;});}exports['updateInteraction']=function(_0x501ba5,_0x349875,_0x2e86e9,_0x614c61){return new Promise(function(_0x409fb2,_0x251358){return getInteractionUsers(_0x501ba5['id'],_0x2e86e9)[_0x2392('0x12')](function(_0x51f908){_0x501ba5['Users']=_0x51f908;return getInteractionTags(_0x501ba5['TagIds'],_0x349875);})[_0x2392('0x12')](function(_0x83dcbe){_0x501ba5[_0x2392('0x15')]=_0x83dcbe;delete _0x501ba5[_0x2392('0x16')];return updateInteractionCounters(_0x501ba5);})['then'](function(_0x448a98){if(_0x614c61){return getLastMessageText(_0x448a98);}else{return _0x448a98;}})[_0x2392('0x12')](function(_0x4653cf){_0x409fb2(_0x4653cf);})['catch'](function(_0x1d0b94){_0x251358(_0x1d0b94);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 4ffb89a..f95515f 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 _0xe70b=['websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','error','lodash','../../mysqldb','openchannel-interactions','../../config/logger','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','Website','InteractionId','upperFirst','unknown'];(function(_0x4e6fb2,_0x3cf23e){var _0x2f1636=function(_0x53c7eb){while(--_0x53c7eb){_0x4e6fb2['push'](_0x4e6fb2['shift']());}};_0x2f1636(++_0x3cf23e);}(_0xe70b,0xb3));var _0xbe70=function(_0x1309e0,_0x1443b7){_0x1309e0=_0x1309e0-0x0;var _0x3e9feb=_0xe70b[_0x1309e0];return _0x3e9feb;};'use strict';var _=require(_0xbe70('0x0'));var db=require(_0xbe70('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xbe70('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0xbe70('0x3'))(_0xbe70('0x4')),'sms':require(_0xbe70('0x3'))(_0xbe70('0x5')),'chat':require(_0xbe70('0x3'))(_0xbe70('0x6')),'whatsapp':require(_0xbe70('0x3'))(_0xbe70('0x7'))};function getAccountFK(_0x277dc0){return _[_0xbe70('0x8')](_0x277dc0)+(_0x277dc0==='chat'?_0xbe70('0x9'):'Account')+'Id';}function getInteractionFK(_0x2488a2){return _[_0xbe70('0x8')](_0x2488a2)+_0xbe70('0xa');}function getInteractionId(_0xd2a118,_0x232aad,_0x4fb3ce){if(_0xd2a118&&_0xd2a118[_[_0xbe70('0xb')](_0x4fb3ce)+_0xbe70('0xa')]){return _0xd2a118[_['upperFirst'](_0x4fb3ce)+_0xbe70('0xa')];}else if(_0xd2a118&&_0xd2a118['id']){return _0xd2a118['id'];}else if(_0x232aad&&_0x232aad['id']){return _0x232aad['id'];}else{return _0xbe70('0xc');}}function getInteractionsTables(_0x5583ba){return{'accounts':_0x5583ba+'_'+(_0x5583ba==='chat'?_0xbe70('0xd'):_0xbe70('0xe')),'interactions':_0x5583ba+_0xbe70('0xf'),'interactionsTags':_0x5583ba+_0xbe70('0x10'),'messages':_0x5583ba+_0xbe70('0x11'),'userInteractions':_0xbe70('0x12')+_0x5583ba+_0xbe70('0xf')};}function getSelectedTags(_0x309327){var _0x499e4d=[];if(_0x309327){_0x499e4d=Array[_0xbe70('0x13')](_0x309327)?_0x309327:[_0x309327];}return _0x499e4d;}function log(_0xddbb5b,_0x55f034,_0xa15de4,_0x3f8a02,_0x4909ef,_0x13c963){loggers[_0x4909ef[_0xbe70('0x14')]()][_0xddbb5b]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x13c963[_0xbe70('0x15')](),_0x55f034?_0x55f034['id']:null,_0x55f034?_0x55f034[_0xbe70('0x16')]:null,_0x55f034?_0x55f034[_0xbe70('0x17')]:null,getInteractionId(_0xa15de4,_0x3f8a02,_0x4909ef),_0xa15de4?JSON[_0xbe70('0x18')](_0xa15de4):_0xbe70('0x19'));}function updateUser(_0x128436,_0x4d221d,_0x288ce2,_0xd444d0,_0x5b2490){db[_[_0xbe70('0xb')](_0xd444d0)+_0xbe70('0x1a')][_0xbe70('0x1b')]({'where':{'id':getInteractionId(_0x4d221d,_0x288ce2,_0xd444d0)}})[_0xbe70('0x1c')](function(_0x378920){if(_0x378920){return _0x378920[_0xbe70('0x1d')]({'UserId':_0x128436?_0x128436['id']:null});}})[_0xbe70('0x1c')](function(_0x33f1b4){if(_0x33f1b4){log(_0xbe70('0x1e'),_0x128436,_0x4d221d,_0x288ce2,_0xd444d0,_0x5b2490);}})['catch'](function(){log(_0xbe70('0x1f'),_0x128436,_0x4d221d,_0x288ce2,_0xd444d0,_0x5b2490);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xb0f7=['_messages','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','Interaction','findOne','then','update','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','capitalize','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags'];(function(_0x39a378,_0x24e80){var _0x578a3b=function(_0x8f8e2){while(--_0x8f8e2){_0x39a378['push'](_0x39a378['shift']());}};_0x578a3b(++_0x24e80);}(_0xb0f7,0x1df));var _0x7b0f=function(_0x35f1f0,_0x5a69a3){_0x35f1f0=_0x35f1f0-0x0;var _0x41cd13=_0xb0f7[_0x35f1f0];return _0x41cd13;};'use strict';var _=require(_0x7b0f('0x0'));var db=require(_0x7b0f('0x1'))['db'];var loggers={'openchannel':require(_0x7b0f('0x2'))(_0x7b0f('0x3')),'mail':require(_0x7b0f('0x2'))(_0x7b0f('0x4')),'fax':require(_0x7b0f('0x2'))(_0x7b0f('0x5')),'sms':require(_0x7b0f('0x2'))('sms-interactions'),'chat':require('../../config/logger')(_0x7b0f('0x6')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getAccountFK(_0x464ff2){return _[_0x7b0f('0x7')](_0x464ff2)+(_0x464ff2==='chat'?_0x7b0f('0x8'):_0x7b0f('0x9'))+'Id';}function getInteractionFK(_0x44286c){return _['capitalize'](_0x44286c)+_0x7b0f('0xa');}function getInteractionId(_0x2eb29e,_0x456c99,_0xe6c1c0){if(_0x2eb29e&&_0x2eb29e[_[_0x7b0f('0xb')](_0xe6c1c0)+_0x7b0f('0xa')]){return _0x2eb29e[_[_0x7b0f('0xb')](_0xe6c1c0)+_0x7b0f('0xa')];}else if(_0x2eb29e&&_0x2eb29e['id']){return _0x2eb29e['id'];}else if(_0x456c99&&_0x456c99['id']){return _0x456c99['id'];}else{return _0x7b0f('0xc');}}function getInteractionsTables(_0x5be9e3){return{'accounts':_0x5be9e3+'_'+(_0x5be9e3==='chat'?_0x7b0f('0xd'):_0x7b0f('0xe')),'interactions':_0x5be9e3+_0x7b0f('0xf'),'interactionsTags':_0x5be9e3+_0x7b0f('0x10'),'messages':_0x5be9e3+_0x7b0f('0x11'),'userInteractions':_0x7b0f('0x12')+_0x5be9e3+'_interactions'};}function getSelectedTags(_0x56db2d){var _0x1222d7=[];if(_0x56db2d){_0x1222d7=Array[_0x7b0f('0x13')](_0x56db2d)?_0x56db2d:[_0x56db2d];}return _0x1222d7;}function log(_0x5dcbb1,_0x21f4c4,_0x38def6,_0x12b99d,_0x303cbb,_0x2d8642){loggers[_0x303cbb['toLowerCase']()][_0x5dcbb1](_0x7b0f('0x14'),_0x2d8642[_0x7b0f('0x15')](),_0x21f4c4?_0x21f4c4['id']:null,_0x21f4c4?_0x21f4c4['name']:null,_0x21f4c4?_0x21f4c4[_0x7b0f('0x16')]:null,getInteractionId(_0x38def6,_0x12b99d,_0x303cbb),_0x38def6?JSON[_0x7b0f('0x17')](_0x38def6):'null');}function updateUser(_0x2c4209,_0xf26736,_0x305ab2,_0x58f5e1,_0x5df71e){db[_[_0x7b0f('0xb')](_0x58f5e1)+_0x7b0f('0x18')][_0x7b0f('0x19')]({'where':{'id':getInteractionId(_0xf26736,_0x305ab2,_0x58f5e1)}})[_0x7b0f('0x1a')](function(_0x3087f0){if(_0x3087f0){return _0x3087f0[_0x7b0f('0x1b')]({'UserId':_0x2c4209?_0x2c4209['id']:null});}})['then'](function(_0x475ad7){if(_0x475ad7){log('info',_0x2c4209,_0xf26736,_0x305ab2,_0x58f5e1,_0x5df71e);}})[_0x7b0f('0x1c')](function(){log(_0x7b0f('0x1d'),_0x2c4209,_0xf26736,_0x305ab2,_0x58f5e1,_0x5df71e);});}module[_0x7b0f('0x1e')]={'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 0ada25f..622cd8c 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 _0x5ca5=['util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','final','utf8','parse','hasOwnProperty','use','then','count','status','catch','User','admin','user','isUserLimit','crypto'];(function(_0x2267a2,_0x453e4b){var _0x1406a7=function(_0x5a0bb0){while(--_0x5a0bb0){_0x2267a2['push'](_0x2267a2['shift']());}};_0x1406a7(++_0x453e4b);}(_0x5ca5,0x1b9));var _0x55ca=function(_0x402511,_0x2f11ec){_0x402511=_0x402511-0x0;var _0x38e8ed=_0x5ca5[_0x402511];return _0x38e8ed;};'use strict';var crypto=require(_0x55ca('0x0'));var util=require(_0x55ca('0x1'));var compose=require(_0x55ca('0x2'));var db=require(_0x55ca('0x3'))['db'];var config=require(_0x55ca('0x4'));function getValueFromLicense(_0x4dfdd6,_0x5eb00e){if(_0x4dfdd6&&_0x5eb00e){if(_0x5eb00e[_0x55ca('0x5')]&&_0x5eb00e[_0x55ca('0x6')]){var _0x3da4dd=_0x5eb00e[_0x55ca('0x5')];var _0x19cff4=_0x5eb00e[_0x55ca('0x6')];var _0x2ef3f5=_0x3da4dd[_0x55ca('0x7')]('-')[0x4];var _0x332b21=_0x3da4dd['split']('-')[0x0];var _0x4b2c60=crypto['createDecipher'](_0x55ca('0x8'),util[_0x55ca('0x9')](_0x55ca('0xa'),_0x2ef3f5,_0x3da4dd,_0x332b21));var _0x536278=_0x4b2c60[_0x55ca('0xb')](_0x19cff4,_0x55ca('0xc'),'utf8');_0x536278+=_0x4b2c60[_0x55ca('0xd')](_0x55ca('0xe'));var _0xd0dcd2=JSON[_0x55ca('0xf')](_0x536278);return _0xd0dcd2[_0x55ca('0x10')](_0x4dfdd6)?_0xd0dcd2[_0x4dfdd6]:null;}}return null;}function isLimit(_0x5204aa,_0x2a7f1b,_0x1b3302,_0x3e7dba){var _0x14d7d8=_0x2a7f1b;return compose()[_0x55ca('0x11')](function(_0x59e0d9,_0xab115b,_0x57880f){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0x55ca('0x12')](function(_0x5d1712){var _0x509ff0=getValueFromLicense(_0x5204aa,_0x5d1712);return _0x509ff0?_0x509ff0:_0x14d7d8;})[_0x55ca('0x12')](function(_0x41713e){_0x14d7d8=_0x41713e;return _0x1b3302[_0x55ca('0x13')](_0x3e7dba);})[_0x55ca('0x12')](function(_0x2ad81d){if(_0x2ad81d>=_0x14d7d8){return _0xab115b[_0x55ca('0x14')](0x193)['json']({'message':util[_0x55ca('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x5204aa)});}_0x57880f();})[_0x55ca('0x15')](function(_0x2ab3b4){_0x57880f(_0x2ab3b4);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x55ca('0x16')],{'where':{'$or':[{'role':_0x55ca('0x17')},{'role':_0x55ca('0x18')}]}});}exports[_0x55ca('0x19')]=isUserLimit; \ No newline at end of file +var _0x148a=['%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','catch','users','admin','user','isUserLimit','crypto','../../config/environment','license','data1','split','createDecipher','format'];(function(_0x2fb866,_0x59bc0c){var _0x5d310f=function(_0x13bf75){while(--_0x13bf75){_0x2fb866['push'](_0x2fb866['shift']());}};_0x5d310f(++_0x59bc0c);}(_0x148a,0xda));var _0xa148=function(_0x21cc45,_0x22eff2){_0x21cc45=_0x21cc45-0x0;var _0x169c76=_0x148a[_0x21cc45];return _0x169c76;};'use strict';var crypto=require(_0xa148('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0xa148('0x1'));function getValueFromLicense(_0x506a2a,_0x20c30d){if(_0x506a2a&&_0x20c30d){if(_0x20c30d['data1']&&_0x20c30d[_0xa148('0x2')]){var _0x507ad8=_0x20c30d[_0xa148('0x3')];var _0x31b2d8=_0x20c30d['license'];var _0x3ae9de=_0x507ad8[_0xa148('0x4')]('-')[0x4];var _0x1f6872=_0x507ad8[_0xa148('0x4')]('-')[0x0];var _0x492a24=crypto[_0xa148('0x5')]('aes-256-ctr',util[_0xa148('0x6')](_0xa148('0x7'),_0x3ae9de,_0x507ad8,_0x1f6872));var _0x1481ba=_0x492a24[_0xa148('0x8')](_0x31b2d8,'base64',_0xa148('0x9'));_0x1481ba+=_0x492a24[_0xa148('0xa')]('utf8');var _0x2c0c17=JSON[_0xa148('0xb')](_0x1481ba);return _0x2c0c17[_0xa148('0xc')](_0x506a2a)?_0x2c0c17[_0x506a2a]:null;}}return null;}function isLimit(_0x4e7f33,_0x58e4f6,_0x21bd35,_0x273294){var _0x60f630=_0x58e4f6;return compose()[_0xa148('0xd')](function(_0x5742d5,_0xcdb1ca,_0x26cb6b){return db[_0xa148('0xe')][_0xa148('0xf')]({'where':{'id':0x1},'raw':!![]})[_0xa148('0x10')](function(_0x934b5a){var _0x388ed8=getValueFromLicense(_0x4e7f33,_0x934b5a);return _0x388ed8?_0x388ed8:_0x60f630;})['then'](function(_0x16872f){_0x60f630=_0x16872f;return _0x21bd35[_0xa148('0x11')](_0x273294);})[_0xa148('0x10')](function(_0x15c63f){if(_0x15c63f>=_0x60f630){return _0xcdb1ca[_0xa148('0x12')](0x193)[_0xa148('0x13')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4e7f33)});}_0x26cb6b();})[_0xa148('0x14')](function(_0x596b11){_0x26cb6b(_0x596b11);});});}function isUserLimit(){return isLimit(_0xa148('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0xa148('0x16')},{'role':_0xa148('0x17')}]}});}exports[_0xa148('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index d4e5338..b211301 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 _0x50c9=['NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','$gt','>\x20?','<=\x20?','>=\x20?','start','$endsWith','pop','hours','add','seconds','moment','parseSearch','and','replace','[$and]','[$or]','split','length','forEach','shift','indexOf','map','push','buildExpression','DATE','operator','$eq','$between','value','includes','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','$in','IN\x20?'];(function(_0x59e9ff,_0x5080c3){var _0xa71d5e=function(_0x7d1718){while(--_0x7d1718){_0x59e9ff['push'](_0x59e9ff['shift']());}};_0xa71d5e(++_0x5080c3);}(_0x50c9,0x1d2));var _0x950c=function(_0xaab643,_0x14df40){_0xaab643=_0xaab643-0x0;var _0x7bab9d=_0x50c9[_0xaab643];return _0x7bab9d;};'use strict';var _=require('lodash');var moment=require(_0x950c('0x0'));exports[_0x950c('0x1')]=function(_0x4b73db){var _0x497ba6={'conditions':[]};_0x497ba6['sqlOperator']=_['startsWith'](_0x4b73db,'[$or]')?'or':_0x950c('0x2');var _0x2ac528=_0x4b73db[_0x950c('0x3')](_0x950c('0x4'),'')['replace'](_0x950c('0x5'),'')[_0x950c('0x6')]('||');for(var _0x228dcf=0x0;_0x228dcf<_0x2ac528[_0x950c('0x7')];_0x228dcf++){var _0x14352f=_0x2ac528[_0x228dcf][_0x950c('0x6')](':=');var _0xe8b997=_0x14352f[0x0];var _0x11422e=_0x14352f['slice'](0x1);_0x11422e[_0x950c('0x8')](function(_0x4e38a1){var _0x5bfb7a=_0x4e38a1['split']('[')[_0x950c('0x9')]();var _0x3205da=_0x4e38a1['match'](/\[(.*?)\]/g);_0x3205da['forEach'](function(_0x58f793){var _0x21b46e=_0x58f793[_0x950c('0x6')]('[')['filter'](function(_0x349b82){return _0x349b82[_0x950c('0xa')](']')>-0x1;})[_0x950c('0xb')](function(_0x509475){return _0x509475[_0x950c('0x6')](']')[0x0];})[0x0];_0x497ba6['conditions'][_0x950c('0xc')]({'field':_0xe8b997,'operator':_0x5bfb7a,'value':_0x21b46e});});});}return _0x497ba6;};exports[_0x950c('0xd')]=function(_0x26a398,_0x153595,_0x3032ec){var _0xc61cce={};if(_0x153595===_0x950c('0xe')){if(_0x3032ec[_0x950c('0xf')]===_0x950c('0x10')){_0x3032ec['operator']=_0x950c('0x11');_0x3032ec[_0x950c('0x12')]+=','+_0x3032ec['value'];}else if(_[_0x950c('0x13')](['$gt',_0x950c('0x14')],_0x3032ec['operator'])){_0x3032ec[_0x950c('0x12')]=moment(_0x3032ec[_0x950c('0x12')])['add'](0x1,_0x950c('0x15'))[_0x950c('0x16')](_0x950c('0x17'));}}if(_0x3032ec[_0x950c('0x18')]){_0x153595=_0x3032ec[_0x950c('0x18')];_0xc61cce[_0x950c('0x19')]=_0x950c('0x1a')+_0x26a398+'.'+_0x3032ec[_0x950c('0x1b')]+_0x950c('0x1c')+_0x3032ec[_0x950c('0x18')]+')\x20'+parseOperator(_0x3032ec[_0x950c('0xf')]);}else{_0xc61cce[_0x950c('0x19')]=_0x26a398+'.'+_0x3032ec['field']+'\x20'+parseOperator(_0x3032ec[_0x950c('0xf')]);}if(_['includes']([_0x950c('0x1d'),_0x950c('0x1e')],_0x3032ec['operator']))_0xc61cce[_0x950c('0x19')]='('+_0xc61cce[_0x950c('0x19')]+_0x950c('0x1f')+_0x26a398+'.'+_0x3032ec[_0x950c('0x1b')]+'\x20IS\x20NULL)';_0xc61cce[_0x950c('0x12')]=parseValue(_0x153595,_0x3032ec['operator'],_0x3032ec[_0x950c('0x12')]);return _0xc61cce;};function parseOperator(_0x1bfc79){var _0x3cf29a;switch(_0x1bfc79){case _0x950c('0x20'):_0x3cf29a=_0x950c('0x21');break;case _0x950c('0x1e'):_0x3cf29a=_0x950c('0x22');break;case _0x950c('0x10'):_0x3cf29a='=\x20?';break;case _0x950c('0x1d'):_0x3cf29a=_0x950c('0x23');break;case _0x950c('0x24'):case _0x950c('0x25'):case'$endsWith':_0x3cf29a=_0x950c('0x26');break;case _0x950c('0x27'):_0x3cf29a='<\x20?';break;case _0x950c('0x28'):_0x3cf29a=_0x950c('0x29');break;case'$lte':_0x3cf29a=_0x950c('0x2a');break;case'$gte':_0x3cf29a=_0x950c('0x2b');break;case'$between':_0x3cf29a='BETWEEN\x20?\x20AND\x20?';break;}return _0x3cf29a;}function parseValue(_0x5262c7,_0x2ced36,_0x25cf61){var _0x363b5a={'start':undefined,'end':undefined};switch(_0x2ced36){case _0x950c('0x20'):case'$notIn':_0x363b5a[_0x950c('0x2c')]=_0x25cf61[_0x950c('0x6')](',');break;case _0x950c('0x24'):_0x363b5a[_0x950c('0x2c')]='%'+_0x25cf61+'%';break;case _0x950c('0x25'):_0x363b5a['start']=_0x25cf61+'%';break;case _0x950c('0x2d'):_0x363b5a[_0x950c('0x2c')]='%'+_0x25cf61;break;case _0x950c('0x11'):var _0x57a67b=_0x25cf61['split'](',');var _0x25cf61=_0x57a67b[_0x950c('0x9')]();var _0x3e0dfc=_0x57a67b[_0x950c('0x2e')]();if(_0x5262c7===_0x950c('0xe')){_0x25cf61=moment(_0x25cf61)['utcOffset'](0x0,!![])[_0x950c('0x16')]();_0x3e0dfc=moment(_0x3e0dfc)['utcOffset'](0x0,!![])['add'](0x17,_0x950c('0x2f'))[_0x950c('0x30')](0x3b,'minutes')[_0x950c('0x30')](0x3b,_0x950c('0x31'))[_0x950c('0x16')]();}_0x363b5a={'start':_0x25cf61,'end':_0x3e0dfc};break;default:_0x363b5a['start']=_0x25cf61;break;}return _0x363b5a;} \ No newline at end of file +var _0x1ddb=['value','includes','$gt','$lte','operator','days','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','$notIn','=\x20?','<>\x20?','$substring','LIKE\x20?','<\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','$startsWith','pop','utcOffset','format','hours','add','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','shift','match','filter','indexOf','map','conditions','push','DATE','$eq','$between'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x1ddb,0x1ba));var _0xb1dd=function(_0x1ed354,_0x4bb5be){_0x1ed354=_0x1ed354-0x0;var _0x532757=_0x1ddb[_0x1ed354];return _0x532757;};'use strict';var _=require(_0xb1dd('0x0'));var moment=require(_0xb1dd('0x1'));exports[_0xb1dd('0x2')]=function(_0x15fe20){var _0x390b03={'conditions':[]};_0x390b03[_0xb1dd('0x3')]=_[_0xb1dd('0x4')](_0x15fe20,_0xb1dd('0x5'))?'or':_0xb1dd('0x6');var _0x3f2bb8=_0x15fe20[_0xb1dd('0x7')](_0xb1dd('0x8'),'')[_0xb1dd('0x7')](_0xb1dd('0x5'),'')[_0xb1dd('0x9')]('||');for(var _0x2feaee=0x0;_0x2feaee<_0x3f2bb8['length'];_0x2feaee++){var _0x13084a=_0x3f2bb8[_0x2feaee][_0xb1dd('0x9')](':=');var _0xf7fefc=_0x13084a[0x0];var _0x681a7b=_0x13084a[_0xb1dd('0xa')](0x1);_0x681a7b[_0xb1dd('0xb')](function(_0x457e2d){var _0x27492f=_0x457e2d[_0xb1dd('0x9')]('[')[_0xb1dd('0xc')]();var _0x2438f3=_0x457e2d[_0xb1dd('0xd')](/\[(.*?)\]/g);_0x2438f3[_0xb1dd('0xb')](function(_0x3da7d9){var _0x3f5ab4=_0x3da7d9[_0xb1dd('0x9')]('[')[_0xb1dd('0xe')](function(_0x901550){return _0x901550[_0xb1dd('0xf')](']')>-0x1;})[_0xb1dd('0x10')](function(_0x108495){return _0x108495[_0xb1dd('0x9')](']')[0x0];})[0x0];_0x390b03[_0xb1dd('0x11')][_0xb1dd('0x12')]({'field':_0xf7fefc,'operator':_0x27492f,'value':_0x3f5ab4});});});}return _0x390b03;};exports['buildExpression']=function(_0x44d5be,_0x13d562,_0x33bde2){var _0x3d1b2f={};if(_0x13d562===_0xb1dd('0x13')){if(_0x33bde2['operator']===_0xb1dd('0x14')){_0x33bde2['operator']=_0xb1dd('0x15');_0x33bde2[_0xb1dd('0x16')]+=','+_0x33bde2['value'];}else if(_[_0xb1dd('0x17')]([_0xb1dd('0x18'),_0xb1dd('0x19')],_0x33bde2[_0xb1dd('0x1a')])){_0x33bde2[_0xb1dd('0x16')]=moment(_0x33bde2[_0xb1dd('0x16')])['add'](0x1,_0xb1dd('0x1b'))['format'](_0xb1dd('0x1c'));}}if(_0x33bde2[_0xb1dd('0x1d')]){_0x13d562=_0x33bde2[_0xb1dd('0x1d')];_0x3d1b2f[_0xb1dd('0x1e')]=_0xb1dd('0x1f')+_0x44d5be+'.'+_0x33bde2[_0xb1dd('0x20')]+_0xb1dd('0x21')+_0x33bde2[_0xb1dd('0x1d')]+')\x20'+parseOperator(_0x33bde2[_0xb1dd('0x1a')]);}else{_0x3d1b2f[_0xb1dd('0x1e')]=_0x44d5be+'.'+_0x33bde2['field']+'\x20'+parseOperator(_0x33bde2[_0xb1dd('0x1a')]);}if(_[_0xb1dd('0x17')]([_0xb1dd('0x22'),'$notIn'],_0x33bde2[_0xb1dd('0x1a')]))_0x3d1b2f['text']='('+_0x3d1b2f[_0xb1dd('0x1e')]+_0xb1dd('0x23')+_0x44d5be+'.'+_0x33bde2[_0xb1dd('0x20')]+_0xb1dd('0x24');_0x3d1b2f['value']=parseValue(_0x13d562,_0x33bde2[_0xb1dd('0x1a')],_0x33bde2[_0xb1dd('0x16')]);return _0x3d1b2f;};function parseOperator(_0x3107c4){var _0x3e2c04;switch(_0x3107c4){case'$in':_0x3e2c04=_0xb1dd('0x25');break;case _0xb1dd('0x26'):_0x3e2c04='NOT\x20IN\x20?';break;case'$eq':_0x3e2c04=_0xb1dd('0x27');break;case'$ne':_0x3e2c04=_0xb1dd('0x28');break;case _0xb1dd('0x29'):case'$startsWith':case'$endsWith':_0x3e2c04=_0xb1dd('0x2a');break;case'$lt':_0x3e2c04=_0xb1dd('0x2b');break;case'$gt':_0x3e2c04='>\x20?';break;case _0xb1dd('0x19'):_0x3e2c04=_0xb1dd('0x2c');break;case _0xb1dd('0x2d'):_0x3e2c04=_0xb1dd('0x2e');break;case'$between':_0x3e2c04=_0xb1dd('0x2f');break;}return _0x3e2c04;}function parseValue(_0x755b12,_0x514faa,_0x556e67){var _0x23060c={'start':undefined,'end':undefined};switch(_0x514faa){case _0xb1dd('0x30'):case'$notIn':_0x23060c[_0xb1dd('0x31')]=_0x556e67[_0xb1dd('0x9')](',');break;case'$substring':_0x23060c['start']='%'+_0x556e67+'%';break;case _0xb1dd('0x32'):_0x23060c[_0xb1dd('0x31')]=_0x556e67+'%';break;case'$endsWith':_0x23060c[_0xb1dd('0x31')]='%'+_0x556e67;break;case'$between':var _0xd6d8cc=_0x556e67[_0xb1dd('0x9')](',');var _0x556e67=_0xd6d8cc[_0xb1dd('0xc')]();var _0x7821e2=_0xd6d8cc[_0xb1dd('0x33')]();if(_0x755b12===_0xb1dd('0x13')){_0x556e67=moment(_0x556e67)[_0xb1dd('0x34')](0x0,!![])[_0xb1dd('0x35')]();_0x7821e2=moment(_0x7821e2)['utcOffset'](0x0,!![])['add'](0x17,_0xb1dd('0x36'))[_0xb1dd('0x37')](0x3b,_0xb1dd('0x38'))[_0xb1dd('0x37')](0x3b,_0xb1dd('0x39'))[_0xb1dd('0x35')]();}_0x23060c={'start':_0x556e67,'end':_0x7821e2};break;default:_0x23060c[_0xb1dd('0x31')]=_0x556e67;break;}return _0x23060c;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index eb9eaff..210f868 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 _0x34af=['intersection','attributes','nolimit','offset','where','pick','filter','object','includes','value','merge','VIRTUAL','lower','options','push','include','lodash','sequelize','moment','../../mysqldb','parse','keys','model','raw','fields','isEmpty','type','DATE','$gte','format','YYYY-MM-DD','utc','subtract','name','isArray','limit','sort','split','map','indexOf','priority','col','unsigned','substr','DESC','cast','ASC','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','replace','getOptions','query','$id','filters'];(function(_0x889daa,_0x22527c){var _0x267d0b=function(_0x33af1e){while(--_0x33af1e){_0x889daa['push'](_0x889daa['shift']());}};_0x267d0b(++_0x22527c);}(_0x34af,0x18a));var _0xf34a=function(_0x3268eb,_0x978d){_0x3268eb=_0x3268eb-0x0;var _0x5c8671=_0x34af[_0x3268eb];return _0x5c8671;};'use strict';var _=require(_0xf34a('0x0'));var sequelize=require(_0xf34a('0x1'));var moment=require(_0xf34a('0x2'));var db=require(_0xf34a('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x46faf4){var _0x2b9d0e=['ne'];try{var _0x13e438=JSON[_0xf34a('0x4')](_0x46faf4);var _0x2628dd=Object['keys'](_0x13e438)[0x0];return _0x2b9d0e['includes'](_0x2628dd);}catch(_0xe0e643){return![];}}function getOperatorValue(_0x509e73){var _0x3f72fd=JSON[_0xf34a('0x4')](_0x509e73);var _0x3431da=Object[_0xf34a('0x5')](_0x3f72fd)[0x0];var _0x29cbe8=_0x3f72fd[_0x3431da];return{['$'+_0x3431da]:_0x29cbe8};}function parseIncludeModel(_0x4d751c){var _0x1254ab=JSON[_0xf34a('0x4')](_0x4d751c);return{'model':db[_0x1254ab[_0xf34a('0x6')]],'as':_0x1254ab['alias'],'attributes':_0x1254ab['fields'],'raw':_0x1254ab[_0xf34a('0x7')]};}exports[_0xf34a('0x8')]=function(_0x20f48f){var _0x362d58=null;if(_0x20f48f){_0x362d58=_0x20f48f['split'](',');}return _0x362d58;};exports['filters']=function(_0x51d289,_0x59268e){var _0x4c3809={};if(!_[_0xf34a('0x9')](_0x51d289)){_['forOwn'](_0x51d289,function(_0x3f2bd6,_0x404eac){try{if(_0x59268e){var _0x4138a1=_['find'](_0x59268e,{'name':_0x404eac})||{};if(hasSequelizeOperator(_0x3f2bd6)){_0x4c3809[_0x404eac]=getOperatorValue(_0x3f2bd6);}else if(_0x4138a1[_0xf34a('0xa')]===_0xf34a('0xb')&&_['isPlainObject'](_0x3f2bd6)){var _0xd3c703=JSON[_0xf34a('0x4')](_0x3f2bd6);var _0xffa111={'$gte':moment(moment(_0xd3c703[_0xf34a('0xc')])[_0xf34a('0xd')](_0xf34a('0xe')))[_0xf34a('0xf')]()[_0xf34a('0xd')](),'$lte':moment(moment(_0xd3c703['$lte'])['format']('YYYY-MM-DD'))[_0xf34a('0xf')]()[_0xf34a('0x10')](0x1,'s')[_0xf34a('0xd')]()};_0x4c3809[_0x404eac]=_0xffa111;}else if(_0x4138a1[_0xf34a('0x11')]==='uniqueid'){_0x4c3809[_0x404eac]=_0x3f2bd6;}else{_0x4c3809[_0x404eac]=_[_0xf34a('0x12')](_0x3f2bd6)?_0x3f2bd6:JSON[_0xf34a('0x4')](_0x3f2bd6);}}else{_0x4c3809[_0x404eac]=_[_0xf34a('0x12')](_0x3f2bd6)?_0x3f2bd6:JSON[_0xf34a('0x4')](_0x3f2bd6);}}catch(_0x2ec3d0){_0x4c3809[_0x404eac]=_0x3f2bd6['split'](',');}});}return _0x4c3809;};exports[_0xf34a('0x13')]=function(_0x4dbbf9){_0x4dbbf9=parseInt(_0x4dbbf9,0xa);if(!_0x4dbbf9||_0x4dbbf9<0x0){_0x4dbbf9=LIMIT_VALUE;}return _0x4dbbf9;};exports['offset']=function(_0x4594d3){_0x4594d3=parseInt(_0x4594d3,0xa);if(!_0x4594d3||_0x4594d3<0x0){_0x4594d3=0x0;}return _0x4594d3;};exports[_0xf34a('0x14')]=function(_0x358edf){var _0x5ececc,_0x10e2ff=null;if(_0x358edf){_0x5ececc=_0x358edf[_0xf34a('0x15')](',');_0x10e2ff=_[_0xf34a('0x16')](_0x5ececc,function(_0xc8225a){if(_0xc8225a[_0xf34a('0x17')]('-')===0x0){return[_0xc8225a===_0xf34a('0x18')?sequelize['cast'](sequelize[_0xf34a('0x19')]('priority'),_0xf34a('0x1a')):_0xc8225a[_0xf34a('0x1b')](0x1),_0xf34a('0x1c')];}else{return[_0xc8225a===_0xf34a('0x18')?sequelize[_0xf34a('0x1d')](sequelize[_0xf34a('0x19')](_0xf34a('0x18')),'unsigned'):_0xc8225a,_0xf34a('0x1e')];}});}return _0x10e2ff;};exports['omit']=function(_0x18d936,_0xa6c0b2){if(_[_0xf34a('0x9')](_0x18d936)){return _0x18d936;}if(_[_0xf34a('0x12')](_0x18d936)){for(var _0x43ef3d=0x0;_0x43ef3d<_0x18d936[_0xf34a('0x1f')];_0x43ef3d+=0x1){_0x18d936[_0x43ef3d]=this['omit'](_0x18d936[_0x43ef3d],_0xa6c0b2);}return _0x18d936;}if(!_[_0xf34a('0x20')](_0x18d936)){return _0x18d936;}if(_[_0xf34a('0x21')](_0xa6c0b2)){_0xa6c0b2=[_0xa6c0b2];}if(!_[_0xf34a('0x12')](_0xa6c0b2)){return _0x18d936;}for(var _0x140d9a=0x0;_0x140d9a<_0xa6c0b2['length'];_0x140d9a+=0x1){_[_0xf34a('0x22')](_0x18d936,_0xa6c0b2[_0x140d9a]);}for(var _0x23465e in _0x18d936){if(_0x18d936[_0xf34a('0x23')](_0x23465e)){_0x18d936[_0x23465e]=this['omit'](_0x18d936[_0x23465e],_0xa6c0b2);}}return _0x18d936;};exports[_0xf34a('0x24')]=function(_0x5e3b35){return _0x5e3b35[_0xf34a('0x25')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xf34a('0x26')]=function(_0x1fa2a3){return _0x1fa2a3['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xf34a('0x27')]=function(_0x1c609e,_0x2b955c){var _0x4bdb13=[];var _0x24ae63=/[ `!@#$%^&*()_\-?~]/;var _0x4d056f=_0x2b955c?_0xf34a('0x28'):_0xf34a('0x29');_0x1c609e[_0xf34a('0x15')](/[ ,]+/)['forEach'](function(_0x39b377){_0x39b377=_0x39b377[_0xf34a('0x2a')](/([^:]")"+/g,'$1');_0x39b377='+'+_0x39b377+'*';var _0x3dc5ed=_0x39b377['match'](_0x24ae63);if(_0x3dc5ed){_0x39b377='\x22'+_0x39b377+'\x22';}_0x4bdb13['push'](_0x39b377);});_0x4d056f=_0x4d056f[_0xf34a('0x2a')]('{EXPR}',_0x4bdb13['join']('\x20'));return _0x4d056f;};exports[_0xf34a('0x2b')]=function(_0x821dd0,_0x1fc999,_0x1e3f44){var _0x903f64={},_0x1d20d7={};if(_0x1fc999[_0xf34a('0x2c')]['$id']){_0x1fc999[_0xf34a('0x2c')]['id']=_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x2d')];delete _0x1fc999[_0xf34a('0x2c')][_0xf34a('0x2d')];}_0x903f64[_0xf34a('0x6')]=_[_0xf34a('0x16')](_0x821dd0,_0xf34a('0x11'));_0x903f64[_0xf34a('0x2c')]=_[_0xf34a('0x5')](_0x1fc999[_0xf34a('0x2c')]);_0x903f64[_0xf34a('0x2e')]=_[_0xf34a('0x2f')](_0x903f64[_0xf34a('0x6')],_0x903f64['query']);_0x1d20d7[_0xf34a('0x30')]=_[_0xf34a('0x2f')](_0x903f64[_0xf34a('0x6')],this[_0xf34a('0x8')](_0x1fc999['query'][_0xf34a('0x8')]));_0x1d20d7[_0xf34a('0x30')]=_0x1d20d7['attributes'][_0xf34a('0x1f')]?_0x1d20d7[_0xf34a('0x30')]:_0x903f64[_0xf34a('0x6')];if(!_0x1fc999['query'][_0xf34a('0x23')](_0xf34a('0x31'))){_0x1d20d7[_0xf34a('0x13')]=this[_0xf34a('0x13')](_0x1fc999['query'][_0xf34a('0x13')]);_0x1d20d7['offset']=this['offset'](_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x32')]);}_0x1d20d7['order']=this[_0xf34a('0x14')](_0x1fc999[_0xf34a('0x2c')]['sort']);_0x1d20d7[_0xf34a('0x33')]=this[_0xf34a('0x2e')](_[_0xf34a('0x34')](_0x1fc999[_0xf34a('0x2c')],_0x903f64['filters']),_0x821dd0);if(_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x35')]){var _0x312cdd=_0x821dd0;var _0x28bbed=_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x35')];if(typeof _0x28bbed===_0xf34a('0x36')){_0x312cdd=_[_0xf34a('0x35')](_0x821dd0,function(_0x5b4010){return _[_0xf34a('0x37')](_0x28bbed['columns'],_0x5b4010[_0xf34a('0x11')]);});_0x28bbed=_0x28bbed[_0xf34a('0x38')];}_0x1d20d7[_0xf34a('0x33')]=_[_0xf34a('0x39')](_0x1d20d7[_0xf34a('0x33')],{'$or':_[_0xf34a('0x16')](_0x312cdd,function(_0x64d238){if(_0x64d238['type']!==_0xf34a('0x3a')){if(_0x1e3f44){return sequelize[_0xf34a('0x33')](sequelize['fn'](_0xf34a('0x3b'),sequelize[_0xf34a('0x19')](_0x64d238[_0xf34a('0x11')])),{'$like':sequelize['fn'](_0xf34a('0x3b'),'%'+_0x1fc999['query'][_0xf34a('0x35')]+'%')});}else{var _0x286fb7={};_0x286fb7[_0x64d238[_0xf34a('0x11')]]={'$like':'%'+_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x35')]+'%'};return _0x286fb7;}}})});}_0x1d20d7=_[_0xf34a('0x39')]({},_0x1d20d7,_0x1fc999[_0xf34a('0x3c')]);return _0x1d20d7;};exports['include']=function(_0xb9d50b){var _0x1437cf=[];if(_0xb9d50b['includeAll']){_0x1437cf[_0xf34a('0x3d')]({'all':!![]});}else if(_0xb9d50b[_0xf34a('0x3e')]){if(Array['isArray'](_0xb9d50b[_0xf34a('0x3e')])){_0x1437cf=Object['keys'](_0xb9d50b[_0xf34a('0x3e')])['map'](function(_0x5cf550){return parseIncludeModel(_0xb9d50b[_0xf34a('0x3e')][_0x5cf550]);});}else{var _0x342dc9=parseIncludeModel(_0xb9d50b[_0xf34a('0x3e')]);_0x1437cf[_0xf34a('0x3d')](_0x342dc9);}}return _0x1437cf;}; \ No newline at end of file +var _0x8fdd=['indexOf','priority','col','unsigned','substr','DESC','cast','length','isObject','unset','omit','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','push','replace','query','$id','intersection','attributes','nolimit','order','filter','object','columns','value','where','merge','lower','options','include','includeAll','sequelize','moment','keys','includes','parse','model','alias','fields','raw','split','filters','isEmpty','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','map'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8fdd,0x1ab));var _0xd8fd=function(_0xb83ec2,_0x18e73b){_0xb83ec2=_0xb83ec2-0x0;var _0x4d2fbf=_0x8fdd[_0xb83ec2];return _0x4d2fbf;};'use strict';var _=require('lodash');var sequelize=require(_0xd8fd('0x0'));var moment=require(_0xd8fd('0x1'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x233480){var _0x43d35e=['ne'];try{var _0x4cbc48=JSON['parse'](_0x233480);var _0x2e1524=Object[_0xd8fd('0x2')](_0x4cbc48)[0x0];return _0x43d35e[_0xd8fd('0x3')](_0x2e1524);}catch(_0x309ba2){return![];}}function getOperatorValue(_0x279470){var _0x2ff083=JSON[_0xd8fd('0x4')](_0x279470);var _0x4988e8=Object['keys'](_0x2ff083)[0x0];var _0x288c79=_0x2ff083[_0x4988e8];return{['$'+_0x4988e8]:_0x288c79};}function parseIncludeModel(_0x2d7e63){var _0x5d6f60=JSON['parse'](_0x2d7e63);return{'model':db[_0x5d6f60[_0xd8fd('0x5')]],'as':_0x5d6f60[_0xd8fd('0x6')],'attributes':_0x5d6f60[_0xd8fd('0x7')],'raw':_0x5d6f60[_0xd8fd('0x8')]};}exports[_0xd8fd('0x7')]=function(_0x197377){var _0x54f9e1=null;if(_0x197377){_0x54f9e1=_0x197377[_0xd8fd('0x9')](',');}return _0x54f9e1;};exports[_0xd8fd('0xa')]=function(_0xec6d37,_0x11eeb6){var _0x18386f={};if(!_[_0xd8fd('0xb')](_0xec6d37)){_[_0xd8fd('0xc')](_0xec6d37,function(_0x424e4e,_0x216ac9){try{if(_0x11eeb6){var _0x1339b1=_[_0xd8fd('0xd')](_0x11eeb6,{'name':_0x216ac9})||{};if(hasSequelizeOperator(_0x424e4e)){_0x18386f[_0x216ac9]=getOperatorValue(_0x424e4e);}else if(_0x1339b1[_0xd8fd('0xe')]===_0xd8fd('0xf')&&_['isPlainObject'](_0x424e4e)){var _0x53a041=JSON[_0xd8fd('0x4')](_0x424e4e);var _0x521c37={'$gte':moment(moment(_0x53a041[_0xd8fd('0x10')])[_0xd8fd('0x11')](_0xd8fd('0x12')))['utc']()[_0xd8fd('0x11')](),'$lte':moment(moment(_0x53a041[_0xd8fd('0x13')])[_0xd8fd('0x11')](_0xd8fd('0x12')))['utc']()[_0xd8fd('0x14')](0x1,'s')[_0xd8fd('0x11')]()};_0x18386f[_0x216ac9]=_0x521c37;}else if(_0x1339b1[_0xd8fd('0x15')]===_0xd8fd('0x16')){_0x18386f[_0x216ac9]=_0x424e4e;}else{_0x18386f[_0x216ac9]=_['isArray'](_0x424e4e)?_0x424e4e:JSON[_0xd8fd('0x4')](_0x424e4e);}}else{_0x18386f[_0x216ac9]=_[_0xd8fd('0x17')](_0x424e4e)?_0x424e4e:JSON['parse'](_0x424e4e);}}catch(_0x43e4c5){_0x18386f[_0x216ac9]=_0x424e4e[_0xd8fd('0x9')](',');}});}return _0x18386f;};exports[_0xd8fd('0x18')]=function(_0x23c6ed){_0x23c6ed=parseInt(_0x23c6ed,0xa);if(!_0x23c6ed||_0x23c6ed<0x0){_0x23c6ed=LIMIT_VALUE;}return _0x23c6ed;};exports[_0xd8fd('0x19')]=function(_0x5ce2b9){_0x5ce2b9=parseInt(_0x5ce2b9,0xa);if(!_0x5ce2b9||_0x5ce2b9<0x0){_0x5ce2b9=0x0;}return _0x5ce2b9;};exports[_0xd8fd('0x1a')]=function(_0x4a16e1){var _0x520281,_0x522b87=null;if(_0x4a16e1){_0x520281=_0x4a16e1['split'](',');_0x522b87=_[_0xd8fd('0x1b')](_0x520281,function(_0x3d5d5a){if(_0x3d5d5a[_0xd8fd('0x1c')]('-')===0x0){return[_0x3d5d5a===_0xd8fd('0x1d')?sequelize['cast'](sequelize[_0xd8fd('0x1e')](_0xd8fd('0x1d')),_0xd8fd('0x1f')):_0x3d5d5a[_0xd8fd('0x20')](0x1),_0xd8fd('0x21')];}else{return[_0x3d5d5a===_0xd8fd('0x1d')?sequelize[_0xd8fd('0x22')](sequelize['col'](_0xd8fd('0x1d')),'unsigned'):_0x3d5d5a,'ASC'];}});}return _0x522b87;};exports['omit']=function(_0xd77630,_0xf61c03){if(_['isEmpty'](_0xd77630)){return _0xd77630;}if(_['isArray'](_0xd77630)){for(var _0x22929d=0x0;_0x22929d<_0xd77630[_0xd8fd('0x23')];_0x22929d+=0x1){_0xd77630[_0x22929d]=this['omit'](_0xd77630[_0x22929d],_0xf61c03);}return _0xd77630;}if(!_[_0xd8fd('0x24')](_0xd77630)){return _0xd77630;}if(_['isString'](_0xf61c03)){_0xf61c03=[_0xf61c03];}if(!_[_0xd8fd('0x17')](_0xf61c03)){return _0xd77630;}for(var _0x13b0ac=0x0;_0x13b0ac<_0xf61c03[_0xd8fd('0x23')];_0x13b0ac+=0x1){_[_0xd8fd('0x25')](_0xd77630,_0xf61c03[_0x13b0ac]);}for(var _0x3cc1a0 in _0xd77630){if(_0xd77630['hasOwnProperty'](_0x3cc1a0)){_0xd77630[_0x3cc1a0]=this[_0xd8fd('0x26')](_0xd77630[_0x3cc1a0],_0xf61c03);}}return _0xd77630;};exports[_0xd8fd('0x27')]=function(_0x1d4372){return _0x1d4372['match'](RegExp(_0xd8fd('0x28')))?!![]:![];};exports[_0xd8fd('0x29')]=function(_0x59a1a4){return _0x59a1a4[_0xd8fd('0x2a')](/^\S+@\S+$/)?!![]:![];};exports[_0xd8fd('0x2b')]=function(_0x49c95b,_0x35c4f4){var _0x416ad0=[];var _0x2de22d=/[ `!@#$%^&*()_\-?~]/;var _0xba144=_0x35c4f4?_0xd8fd('0x2c'):_0xd8fd('0x2d');_0x49c95b[_0xd8fd('0x9')](/[ ,]+/)[_0xd8fd('0x2e')](function(_0xe54ba4){_0xe54ba4=_0xe54ba4['replace'](/([^:]")"+/g,'$1');_0xe54ba4='+'+_0xe54ba4+'*';var _0x23c329=_0xe54ba4[_0xd8fd('0x2a')](_0x2de22d);if(_0x23c329){_0xe54ba4='\x22'+_0xe54ba4+'\x22';}_0x416ad0[_0xd8fd('0x2f')](_0xe54ba4);});_0xba144=_0xba144[_0xd8fd('0x30')](_0xd8fd('0x2d'),_0x416ad0['join']('\x20'));return _0xba144;};exports['getOptions']=function(_0x352a57,_0x563645,_0x1d54d4){var _0x51d42c={},_0x5bf005={};if(_0x563645[_0xd8fd('0x31')]['$id']){_0x563645[_0xd8fd('0x31')]['id']=_0x563645[_0xd8fd('0x31')][_0xd8fd('0x32')];delete _0x563645[_0xd8fd('0x31')][_0xd8fd('0x32')];}_0x51d42c['model']=_['map'](_0x352a57,_0xd8fd('0x15'));_0x51d42c[_0xd8fd('0x31')]=_['keys'](_0x563645['query']);_0x51d42c['filters']=_[_0xd8fd('0x33')](_0x51d42c['model'],_0x51d42c[_0xd8fd('0x31')]);_0x5bf005[_0xd8fd('0x34')]=_['intersection'](_0x51d42c['model'],this[_0xd8fd('0x7')](_0x563645[_0xd8fd('0x31')][_0xd8fd('0x7')]));_0x5bf005['attributes']=_0x5bf005[_0xd8fd('0x34')]['length']?_0x5bf005[_0xd8fd('0x34')]:_0x51d42c[_0xd8fd('0x5')];if(!_0x563645[_0xd8fd('0x31')]['hasOwnProperty'](_0xd8fd('0x35'))){_0x5bf005['limit']=this[_0xd8fd('0x18')](_0x563645['query'][_0xd8fd('0x18')]);_0x5bf005['offset']=this[_0xd8fd('0x19')](_0x563645[_0xd8fd('0x31')][_0xd8fd('0x19')]);}_0x5bf005[_0xd8fd('0x36')]=this[_0xd8fd('0x1a')](_0x563645[_0xd8fd('0x31')][_0xd8fd('0x1a')]);_0x5bf005['where']=this['filters'](_['pick'](_0x563645[_0xd8fd('0x31')],_0x51d42c[_0xd8fd('0xa')]),_0x352a57);if(_0x563645[_0xd8fd('0x31')][_0xd8fd('0x37')]){var _0x162d9b=_0x352a57;var _0x50be4d=_0x563645[_0xd8fd('0x31')]['filter'];if(typeof _0x50be4d===_0xd8fd('0x38')){_0x162d9b=_[_0xd8fd('0x37')](_0x352a57,function(_0x286a93){return _[_0xd8fd('0x3')](_0x50be4d[_0xd8fd('0x39')],_0x286a93[_0xd8fd('0x15')]);});_0x50be4d=_0x50be4d[_0xd8fd('0x3a')];}_0x5bf005[_0xd8fd('0x3b')]=_[_0xd8fd('0x3c')](_0x5bf005[_0xd8fd('0x3b')],{'$or':_['map'](_0x162d9b,function(_0x5dbc42){if(_0x5dbc42['type']!=='VIRTUAL'){if(_0x1d54d4){return sequelize[_0xd8fd('0x3b')](sequelize['fn'](_0xd8fd('0x3d'),sequelize[_0xd8fd('0x1e')](_0x5dbc42[_0xd8fd('0x15')])),{'$like':sequelize['fn'](_0xd8fd('0x3d'),'%'+_0x563645[_0xd8fd('0x31')][_0xd8fd('0x37')]+'%')});}else{var _0x3dcc6f={};_0x3dcc6f[_0x5dbc42[_0xd8fd('0x15')]]={'$like':'%'+_0x563645['query'][_0xd8fd('0x37')]+'%'};return _0x3dcc6f;}}})});}_0x5bf005=_[_0xd8fd('0x3c')]({},_0x5bf005,_0x563645[_0xd8fd('0x3e')]);return _0x5bf005;};exports[_0xd8fd('0x3f')]=function(_0x1ae759){var _0x5e3c0c=[];if(_0x1ae759[_0xd8fd('0x40')]){_0x5e3c0c[_0xd8fd('0x2f')]({'all':!![]});}else if(_0x1ae759[_0xd8fd('0x3f')]){if(Array['isArray'](_0x1ae759[_0xd8fd('0x3f')])){_0x5e3c0c=Object[_0xd8fd('0x2')](_0x1ae759[_0xd8fd('0x3f')])[_0xd8fd('0x1b')](function(_0x582c22){return parseIncludeModel(_0x1ae759[_0xd8fd('0x3f')][_0x582c22]);});}else{var _0x5999ca=parseIncludeModel(_0x1ae759['include']);_0x5e3c0c[_0xd8fd('0x2f')](_0x5999ca);}}return _0x5e3c0c;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 228c762..91e53c7 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 _0x326f=['faxStatusTime','voiceStatusTime','queue','phoneBarEnableScreenRecordingByAgent','routealias','omit','pick','filterAgentAttributes','role','chatStatusTime','whatsappStatusTime','openchannelCurrentCapacity','phoneBarEnableAutomaticScreenRecording','destconnectedlinenum','onhold','screenrecording','getRealtimeAgentsQueryFields','lodash','client','http','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause','every','length','idle','unknown','ringing','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','fullname','openchannelPause','pauseType','find','merge','getSortedAgentsIdsByStatus','split','filter','globalStatus','startsWith','DESC','ASC','getUpdatedSortOptions','validateSortParameter','toLowerCase','userpic','lastLoginAt','lastPauseAt','internal','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','whatsappStatus','openchannelStatusTime','mailStatusTime','smsStatusTime'];(function(_0x56a245,_0x5e4680){var _0x405de0=function(_0x2fb47c){while(--_0x2fb47c){_0x56a245['push'](_0x56a245['shift']());}};_0x405de0(++_0x5e4680);}(_0x326f,0xd1));var _0xf326=function(_0x52ef59,_0x140a67){_0x52ef59=_0x52ef59-0x0;var _0x5015db=_0x326f[_0x52ef59];return _0x5015db;};'use strict';var _=require(_0xf326('0x0'));var jayson=require('jayson/promise');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xf326('0x1')][_0xf326('0x2')]({'port':0x232a});var routingClient=jayson[_0xf326('0x1')][_0xf326('0x2')]({'port':0x232c});function isAgentPaused(_0x27e8d7,_0x120a26){var _0x9445c6=[_0x27e8d7[_0xf326('0x3')],_0x27e8d7[_0xf326('0x4')],_0x27e8d7[_0xf326('0x5')],_0x27e8d7['openchannelPause'],_0x27e8d7[_0xf326('0x6')],_0x27e8d7[_0xf326('0x7')],_0x27e8d7[_0xf326('0x8')]];if(!_0x120a26)return _[_0xf326('0x9')](_0x9445c6);var _0x515bfa=_['filter'](_0x9445c6);return _0x515bfa['length']>0x0&&_0x515bfa[_0xf326('0xa')]<_0x9445c6[_0xf326('0xa')]?!![]:![];}function isIdle(_0x163416){return _0x163416===_0xf326('0xb')||_0x163416===_0xf326('0xc')||_0x163416==='unavailable'||_0x163416===_0xf326('0xd')||_['isNil'](_0x163416);}function isAgentIdle(_0x1cf441){if(_0x1cf441['voiceStatus']!==_0xf326('0xb')&&_0x1cf441['voicePause']){_0x1cf441[_0xf326('0xe')]=_0xf326('0xf');return![];}return _['every']([_0x1cf441[_0xf326('0x10')],_0x1cf441[_0xf326('0x11')],_0x1cf441[_0xf326('0x12')],_0x1cf441[_0xf326('0x13')],_0x1cf441['smsStatus'],_0x1cf441[_0xf326('0xe')],_0x1cf441['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xf326('0x14'),{})[_0xf326('0x15')](function(_0x1f2e5a){if(_0x1f2e5a[_0xf326('0x16')]){throw new Error(_0xf326('0x17'));}var _0x287a2a=_0x1f2e5a[_0xf326('0x18')];return routingClient[_0xf326('0x19')]('Agents',{})[_0xf326('0x15')](function(_0x453100){if(_0x453100[_0xf326('0x16')]){throw new Error(_0xf326('0x1a'));}var _0xcef2b5=_0x453100[_0xf326('0x18')];return _['merge']({},_0x287a2a,_0xcef2b5);});})['catch'](function(_0x56ad41){throw _0x56ad41;});}exports[_0xf326('0x1b')]=getRealtimeAgents;function getAgentStatus(_0x289f4b){var _0x484cbe='unknown';if(isAgentPaused(_0x289f4b))_0x484cbe=_0xf326('0xf');else if(isAgentPaused(_0x289f4b,!![]))_0x484cbe='*pause';else if(isAgentIdle(_0x289f4b))_0x484cbe='idle';else _0x484cbe=_0xf326('0x1c');return _0x484cbe;}exports[_0xf326('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x549b46,_0x5aa184){var _0x19b8ba=_[_0xf326('0x1e')](_0x549b46)?_0x549b46:[_0x549b46];var _0x5f21a2=_[_0xf326('0x1f')](_0x5aa184)+_0xf326('0x20');var _0x43c53e=_[_0xf326('0x21')](_0x19b8ba,function(_0x17c157){return db[_0x5f21a2][_0xf326('0x22')]({'where':{'id':_0x17c157}})['then'](function(_0x55b9f4){if(!_0x55b9f4)return[];return _0x55b9f4['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xf326('0x23')](_0x43c53e)[_0xf326('0x15')](function(_0x2cd45a){var _0x1ff2b5=_(_0x2cd45a)[_0xf326('0x24')]()[_0xf326('0x21')]('id')['uniq']()[_0xf326('0x25')]();return _0x1ff2b5;});}exports[_0xf326('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x212d5d,_0x581531,_0x1617d2){try{if(_0x581531['length']>0x0){_0x212d5d=_0x212d5d['filter'](function(_0x6a8e89){return _0x581531[_0xf326('0x27')](_0x6a8e89['id']);});}var _0x2fa28e=_0x212d5d['filter'](function(_0xc115d9){var _0x292500='busy';if(isAgentIdle(_0xc115d9)){_0x292500=_0xf326('0xb');}return _0x292500===_0x1617d2;});return _[_0xf326('0x21')](_0x2fa28e,'id');}catch(_0xd77aba){throw _0xd77aba;}}exports[_0xf326('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xa80156,_0x269be9,_0x161143){return Promise[_0xf326('0x29')]()[_0xf326('0x15')](function(){if(_0x269be9[_0xf326('0xa')]>0x0){_0xa80156=_0xa80156['filter'](function(_0x1035ed){return _0x269be9[_0xf326('0x27')](_0x1035ed['id']);});}return _0xa80156;})[_0xf326('0x15')](function(){return db['User'][_0xf326('0x2a')]({'attributes':['id',_0xf326('0x2b'),_0xf326('0x2c'),'chatPause','faxPause',_0xf326('0x5'),_0xf326('0x2d'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x2e')],'where':{'id':{'$in':_[_0xf326('0x21')](_0xa80156,'id')}},'raw':!![]});})[_0xf326('0x15')](function(_0x580374){return _0x580374[_0xf326('0x21')](function(_0x1981bc){var _0x51207a=_[_0xf326('0x2f')](_0xa80156,['id',_0x1981bc['id']]);var _0x4e5d7c=filterAgentAttributes(_0x51207a);_[_0xf326('0x30')](_0x1981bc,_0x4e5d7c);_0x1981bc['globalStatus']=getAgentStatus(_0x1981bc);return _0x1981bc;});})['then'](function(_0xadb020){var _0x4d8eac=sortAgentsByStatus(_0xadb020,_0x161143);return _[_0xf326('0x21')](_0x4d8eac,'id');})['catch'](function(_0x310dbb){throw _0x310dbb;});}exports[_0xf326('0x31')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2750ae){var _0x529cbb={'fields':[],'order':null};var _0x3dcc7e=_0x2750ae[_0xf326('0x32')](',');_0x529cbb['fields']=_[_0xf326('0x33')](_0x3dcc7e,function(_0xf64dd0){if(!_0xf64dd0[_0xf326('0x27')](_0xf326('0x34'))){return!![];}_0x529cbb['order']=_[_0xf326('0x35')](_0xf64dd0,'-')?_0xf326('0x36'):_0xf326('0x37');return![];});return _0x529cbb;}exports[_0xf326('0x38')]=getUpdatedSortOptions;function validateSortParameter(_0x1d88ed){if(!_0x1d88ed){_0x1d88ed='fullname,internal';}if(_0x1d88ed[_0xf326('0x27')](_0xf326('0x2c'))&&!_0x1d88ed['includes']('internal')){var _0x40564e=_0x1d88ed['substring'](0x0,_0x1d88ed['indexOf'](_0xf326('0x2c')));_0x1d88ed+=','+_0x40564e+'internal';}return _0x1d88ed;}exports[_0xf326('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x37a95b,_0x2c1e7f){var _0x39611e=_0x37a95b['sort'](function(_0x9dda89,_0x45d344){if(_0x9dda89[_0xf326('0x34')]===_0x45d344[_0xf326('0x34')]){if(_0x9dda89[_0xf326('0x34')]===_0xf326('0xf')){if(_0x2c1e7f===_0xf326('0x36')){return(_0x9dda89[_0xf326('0x2e')]||'')<(_0x45d344[_0xf326('0x2e')]||'')||_0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()>_0x45d344[_0xf326('0x2c')]['toLowerCase']()?0x1:-0x1;}else{return(_0x9dda89[_0xf326('0x2e')]||'')<(_0x45d344[_0xf326('0x2e')]||'')||_0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()>_0x45d344[_0xf326('0x2c')][_0xf326('0x3a')]()?-0x1:0x1;}}else{if(_0x2c1e7f==='DESC'){return _0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()<_0x45d344['fullname'][_0xf326('0x3a')]()?0x1:-0x1;}else{return _0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()<_0x45d344[_0xf326('0x2c')][_0xf326('0x3a')]()?-0x1:0x1;}}}else{if(_0x2c1e7f==='DESC'){return _0x9dda89['globalStatus']<_0x45d344[_0xf326('0x34')]?0x1:-0x1;}else{return _0x9dda89[_0xf326('0x34')]<_0x45d344['globalStatus']?-0x1:0x1;}}});return _0x39611e;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x8e318d){var _0x269e89=[_0xf326('0x3b'),'online',_0xf326('0x3c'),_0xf326('0x3d'),_0xf326('0x2e'),_0xf326('0x3d'),_0xf326('0x3e'),_0xf326('0x3f'),_0xf326('0x3'),_0xf326('0x2d'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x8'),_0xf326('0x4'),_0xf326('0x7'),_0xf326('0x40'),_0xf326('0x41'),'mailCapacity',_0xf326('0x42'),_0xf326('0x43'),_0xf326('0x44'),_0xf326('0x45'),'openchannelCurrentCapacity',_0xf326('0x46'),_0xf326('0x47'),_0xf326('0x48'),_0xf326('0x49'),'chatStatus',_0xf326('0x13'),_0xf326('0x12'),_0xf326('0x4a'),_0xf326('0x4b'),_0xf326('0x11'),'voiceStatus','chatStatusTime',_0xf326('0x4c'),_0xf326('0x4d'),_0xf326('0x4e'),'whatsappStatusTime',_0xf326('0x4f'),_0xf326('0x50'),_0xf326('0x51'),'destconnectedlinenum','screenrecording',_0xf326('0x52'),'phoneBarEnableAutomaticScreenRecording',_0xf326('0x53')];var _0x554277=[_0xf326('0x3'),_0xf326('0x2d'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x8'),_0xf326('0x4'),_0xf326('0x7'),'online'];var _0xcdaf3f=_(_0x8e318d)[_0xf326('0x54')](_0x554277)[_0xf326('0x55')](_0x269e89)['value']();return _0xcdaf3f;}exports[_0xf326('0x56')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xf326('0x2b'),_0xf326('0x2c'),_0xf326('0x57'),_0xf326('0x3e'),'online',_0xf326('0x34'),_0xf326('0x3b'),_0xf326('0x3c'),_0xf326('0x2e'),'lastPauseAt',_0xf326('0x4'),_0xf326('0x3'),_0xf326('0x5'),_0xf326('0x2d'),'smsPause','voicePause',_0xf326('0x8'),_0xf326('0x10'),'faxStatus',_0xf326('0x12'),_0xf326('0x13'),_0xf326('0x4a'),_0xf326('0xe'),'whatsappStatus',_0xf326('0x58'),'faxStatusTime','mailStatusTime',_0xf326('0x4c'),'smsStatusTime',_0xf326('0x50'),_0xf326('0x59'),_0xf326('0x40'),'faxCapacity','mailCapacity',_0xf326('0x41'),_0xf326('0x42'),_0xf326('0x43'),'chatCurrentCapacity',_0xf326('0x49'),'mailCurrentCapacity',_0xf326('0x5a'),_0xf326('0x47'),_0xf326('0x48'),_0xf326('0x52'),_0xf326('0x5b'),_0xf326('0x5c'),_0xf326('0x5d'),_0xf326('0x51'),_0xf326('0x53'),_0xf326('0x5e')];}exports[_0xf326('0x5f')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x3f8a=['includes','order','startsWith','DESC','getUpdatedSortOptions','substring','indexOf','internal','sort','globalStatus','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','role','openchannelStatusTime','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','merge','catch','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','map','findOne','getAgents','all','flatten','uniq','getAgentIdsByQueues','getAgentIdsByStatus','resolve','User','name','fullname','pauseType','find','getSortedAgentsIdsByStatus','split','fields'];(function(_0xbdbdf0,_0x16aec3){var _0x1097df=function(_0x4361bb){while(--_0x4361bb){_0xbdbdf0['push'](_0xbdbdf0['shift']());}};_0x1097df(++_0x16aec3);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x38a052,_0x33f0af){_0x38a052=_0x38a052-0x0;var _0x489892=_0x3f8a[_0x38a052];return _0x489892;};'use strict';var _=require(_0xa3f8('0x0'));var jayson=require(_0xa3f8('0x1'));var db=require(_0xa3f8('0x2'))['db'];var amiClient=jayson[_0xa3f8('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0xa3f8('0x3')][_0xa3f8('0x4')]({'port':0x232c});function isAgentPaused(_0x928738,_0x15b6aa){var _0x2553fd=[_0x928738[_0xa3f8('0x5')],_0x928738[_0xa3f8('0x6')],_0x928738[_0xa3f8('0x7')],_0x928738[_0xa3f8('0x8')],_0x928738[_0xa3f8('0x9')],_0x928738[_0xa3f8('0xa')],_0x928738[_0xa3f8('0xb')]];if(!_0x15b6aa)return _[_0xa3f8('0xc')](_0x2553fd);var _0x2448de=_[_0xa3f8('0xd')](_0x2553fd);return _0x2448de[_0xa3f8('0xe')]>0x0&&_0x2448de[_0xa3f8('0xe')]<_0x2553fd['length']?!![]:![];}function isIdle(_0x47496a){return _0x47496a===_0xa3f8('0xf')||_0x47496a===_0xa3f8('0x10')||_0x47496a===_0xa3f8('0x11')||_0x47496a==='ringing'||_[_0xa3f8('0x12')](_0x47496a);}function isAgentIdle(_0x26f0a0){if(_0x26f0a0[_0xa3f8('0x13')]!==_0xa3f8('0xf')&&_0x26f0a0[_0xa3f8('0xa')]){_0x26f0a0[_0xa3f8('0x13')]=_0xa3f8('0x14');return![];}return _[_0xa3f8('0xc')]([_0x26f0a0[_0xa3f8('0x15')],_0x26f0a0[_0xa3f8('0x16')],_0x26f0a0[_0xa3f8('0x17')],_0x26f0a0[_0xa3f8('0x18')],_0x26f0a0['smsStatus'],_0x26f0a0[_0xa3f8('0x13')],_0x26f0a0[_0xa3f8('0x19')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xa3f8('0x1a')](_0xa3f8('0x1b'),{})['then'](function(_0x39c450){if(_0x39c450[_0xa3f8('0x1c')]){throw new Error(_0xa3f8('0x1d'));}var _0x8cd130=_0x39c450[_0xa3f8('0x1e')];return routingClient[_0xa3f8('0x1a')](_0xa3f8('0x1b'),{})[_0xa3f8('0x1f')](function(_0x2cb49f){if(_0x2cb49f[_0xa3f8('0x1c')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x3ad8cd=_0x2cb49f['result'];return _[_0xa3f8('0x20')]({},_0x8cd130,_0x3ad8cd);});})[_0xa3f8('0x21')](function(_0x191f99){throw _0x191f99;});}exports[_0xa3f8('0x22')]=getRealtimeAgents;function getAgentStatus(_0x5c916e){var _0x1f0bb8='unknown';if(isAgentPaused(_0x5c916e))_0x1f0bb8=_0xa3f8('0x14');else if(isAgentPaused(_0x5c916e,!![]))_0x1f0bb8='*pause';else if(isAgentIdle(_0x5c916e))_0x1f0bb8=_0xa3f8('0xf');else _0x1f0bb8=_0xa3f8('0x23');return _0x1f0bb8;}exports[_0xa3f8('0x24')]=getAgentStatus;function getAgentIdsByQueues(_0x474893,_0x3a6a57){var _0x1e5f30=_[_0xa3f8('0x25')](_0x474893)?_0x474893:[_0x474893];var _0x490717=_[_0xa3f8('0x26')](_0x3a6a57)+'Queue';var _0x3ce57b=_[_0xa3f8('0x27')](_0x1e5f30,function(_0x24985a){return db[_0x490717][_0xa3f8('0x28')]({'where':{'id':_0x24985a}})[_0xa3f8('0x1f')](function(_0x2c5d10){if(!_0x2c5d10)return[];return _0x2c5d10[_0xa3f8('0x29')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xa3f8('0x2a')](_0x3ce57b)[_0xa3f8('0x1f')](function(_0x1eb2b9){var _0x545a28=_(_0x1eb2b9)[_0xa3f8('0x2b')]()[_0xa3f8('0x27')]('id')[_0xa3f8('0x2c')]()['value']();return _0x545a28;});}exports[_0xa3f8('0x2d')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x57f6be,_0xbad6a6,_0x3a3746){try{if(_0xbad6a6[_0xa3f8('0xe')]>0x0){_0x57f6be=_0x57f6be['filter'](function(_0x458824){return _0xbad6a6['includes'](_0x458824['id']);});}var _0x21c57e=_0x57f6be[_0xa3f8('0xd')](function(_0x226153){var _0x406140=_0xa3f8('0x23');if(isAgentIdle(_0x226153)){_0x406140=_0xa3f8('0xf');}return _0x406140===_0x3a3746;});return _[_0xa3f8('0x27')](_0x21c57e,'id');}catch(_0x424a3e){throw _0x424a3e;}}exports[_0xa3f8('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x290a4e,_0x6e83b0,_0x57c465){return Promise[_0xa3f8('0x2f')]()[_0xa3f8('0x1f')](function(){if(_0x6e83b0[_0xa3f8('0xe')]>0x0){_0x290a4e=_0x290a4e[_0xa3f8('0xd')](function(_0x3bb4b0){return _0x6e83b0['includes'](_0x3bb4b0['id']);});}return _0x290a4e;})[_0xa3f8('0x1f')](function(){return db[_0xa3f8('0x30')]['findAll']({'attributes':['id',_0xa3f8('0x31'),_0xa3f8('0x32'),'chatPause',_0xa3f8('0x6'),'mailPause','openchannelPause',_0xa3f8('0x9'),_0xa3f8('0xa'),'whatsappPause',_0xa3f8('0x33')],'where':{'id':{'$in':_['map'](_0x290a4e,'id')}},'raw':!![]});})[_0xa3f8('0x1f')](function(_0x30a972){return _0x30a972[_0xa3f8('0x27')](function(_0x22e8ea){var _0x52a80b=_[_0xa3f8('0x34')](_0x290a4e,['id',_0x22e8ea['id']]);var _0x53c7b2=filterAgentAttributes(_0x52a80b);_[_0xa3f8('0x20')](_0x22e8ea,_0x53c7b2);_0x22e8ea['globalStatus']=getAgentStatus(_0x22e8ea);return _0x22e8ea;});})[_0xa3f8('0x1f')](function(_0x5f459a){var _0x5eca3c=sortAgentsByStatus(_0x5f459a,_0x57c465);return _['map'](_0x5eca3c,'id');})[_0xa3f8('0x21')](function(_0x1674f1){throw _0x1674f1;});}exports[_0xa3f8('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2ffeb3){var _0x4b93ba={'fields':[],'order':null};var _0x447824=_0x2ffeb3[_0xa3f8('0x36')](',');_0x4b93ba[_0xa3f8('0x37')]=_[_0xa3f8('0xd')](_0x447824,function(_0x238da1){if(!_0x238da1[_0xa3f8('0x38')]('globalStatus')){return!![];}_0x4b93ba[_0xa3f8('0x39')]=_[_0xa3f8('0x3a')](_0x238da1,'-')?_0xa3f8('0x3b'):'ASC';return![];});return _0x4b93ba;}exports[_0xa3f8('0x3c')]=getUpdatedSortOptions;function validateSortParameter(_0x110b23){if(!_0x110b23){_0x110b23='fullname,internal';}if(_0x110b23[_0xa3f8('0x38')]('fullname')&&!_0x110b23[_0xa3f8('0x38')]('internal')){var _0x9ede8d=_0x110b23[_0xa3f8('0x3d')](0x0,_0x110b23[_0xa3f8('0x3e')](_0xa3f8('0x32')));_0x110b23+=','+_0x9ede8d+_0xa3f8('0x3f');}return _0x110b23;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0xa6f0a4,_0x88108){var _0x4db9c5=_0xa6f0a4[_0xa3f8('0x40')](function(_0x4e13f1,_0x6ff4d4){if(_0x4e13f1[_0xa3f8('0x41')]===_0x6ff4d4[_0xa3f8('0x41')]){if(_0x4e13f1[_0xa3f8('0x41')]===_0xa3f8('0x14')){if(_0x88108==='DESC'){return(_0x4e13f1[_0xa3f8('0x33')]||'')<(_0x6ff4d4[_0xa3f8('0x33')]||'')||_0x4e13f1[_0xa3f8('0x32')][_0xa3f8('0x42')]()>_0x6ff4d4[_0xa3f8('0x32')]['toLowerCase']()?0x1:-0x1;}else{return(_0x4e13f1[_0xa3f8('0x33')]||'')<(_0x6ff4d4[_0xa3f8('0x33')]||'')||_0x4e13f1[_0xa3f8('0x32')][_0xa3f8('0x42')]()>_0x6ff4d4[_0xa3f8('0x32')][_0xa3f8('0x42')]()?-0x1:0x1;}}else{if(_0x88108===_0xa3f8('0x3b')){return _0x4e13f1[_0xa3f8('0x32')][_0xa3f8('0x42')]()<_0x6ff4d4[_0xa3f8('0x32')][_0xa3f8('0x42')]()?0x1:-0x1;}else{return _0x4e13f1[_0xa3f8('0x32')][_0xa3f8('0x42')]()<_0x6ff4d4['fullname']['toLowerCase']()?-0x1:0x1;}}}else{if(_0x88108==='DESC'){return _0x4e13f1[_0xa3f8('0x41')]<_0x6ff4d4[_0xa3f8('0x41')]?0x1:-0x1;}else{return _0x4e13f1[_0xa3f8('0x41')]<_0x6ff4d4[_0xa3f8('0x41')]?-0x1:0x1;}}});return _0x4db9c5;}exports[_0xa3f8('0x43')]=sortAgentsByStatus;function filterAgentAttributes(_0x33a141){var _0x4a751f=[_0xa3f8('0x44'),_0xa3f8('0x45'),_0xa3f8('0x46'),_0xa3f8('0x47'),'pauseType',_0xa3f8('0x47'),_0xa3f8('0x3f'),_0xa3f8('0x48'),'chatPause','openchannelPause','mailPause',_0xa3f8('0x9'),_0xa3f8('0xb'),'faxPause',_0xa3f8('0xa'),_0xa3f8('0x49'),_0xa3f8('0x4a'),_0xa3f8('0x4b'),_0xa3f8('0x4c'),_0xa3f8('0x4d'),_0xa3f8('0x4e'),_0xa3f8('0x4f'),_0xa3f8('0x50'),_0xa3f8('0x51'),_0xa3f8('0x52'),_0xa3f8('0x53'),_0xa3f8('0x54'),_0xa3f8('0x15'),_0xa3f8('0x18'),_0xa3f8('0x17'),_0xa3f8('0x55'),'whatsappStatus','faxStatus',_0xa3f8('0x13'),_0xa3f8('0x56'),'openchannelStatusTime',_0xa3f8('0x57'),_0xa3f8('0x58'),_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),_0xa3f8('0x5c'),_0xa3f8('0x5d'),_0xa3f8('0x5e'),_0xa3f8('0x5f'),_0xa3f8('0x60'),_0xa3f8('0x61')];var _0x3752fa=[_0xa3f8('0x5'),_0xa3f8('0x8'),_0xa3f8('0x7'),_0xa3f8('0x9'),'whatsappPause','faxPause',_0xa3f8('0xa'),'online'];var _0x2410aa=_(_0x33a141)[_0xa3f8('0x62')](_0x3752fa)[_0xa3f8('0x63')](_0x4a751f)['value']();return _0x2410aa;}exports[_0xa3f8('0x64')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xa3f8('0x31'),_0xa3f8('0x32'),_0xa3f8('0x65'),'internal',_0xa3f8('0x45'),'globalStatus',_0xa3f8('0x44'),_0xa3f8('0x46'),_0xa3f8('0x33'),'lastPauseAt','faxPause',_0xa3f8('0x5'),_0xa3f8('0x7'),_0xa3f8('0x8'),_0xa3f8('0x9'),'voicePause',_0xa3f8('0xb'),_0xa3f8('0x15'),_0xa3f8('0x16'),_0xa3f8('0x17'),_0xa3f8('0x18'),'smsStatus','voiceStatus',_0xa3f8('0x19'),_0xa3f8('0x56'),_0xa3f8('0x5a'),_0xa3f8('0x57'),_0xa3f8('0x66'),_0xa3f8('0x58'),_0xa3f8('0x5b'),'whatsappStatusTime','chatCapacity','faxCapacity',_0xa3f8('0x4b'),_0xa3f8('0x4a'),_0xa3f8('0x4c'),_0xa3f8('0x4d'),_0xa3f8('0x4f'),_0xa3f8('0x54'),_0xa3f8('0x51'),_0xa3f8('0x50'),'smsCurrentCapacity',_0xa3f8('0x53'),_0xa3f8('0x5f'),_0xa3f8('0x60'),_0xa3f8('0x5d'),_0xa3f8('0x67'),_0xa3f8('0x5c'),_0xa3f8('0x61'),'screenrecording'];}exports[_0xa3f8('0x68')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 7134fa9..dfef9d0 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5766=['get','paused','waiting','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','busy','inUse','loggedInDb','notInUse','onHold','ringing','ringInUse','unavailable','unknown','pTalking','originated','message','statusMessage','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map'];(function(_0x5326fd,_0x2b3366){var _0x4a3b26=function(_0x263a30){while(--_0x263a30){_0x5326fd['push'](_0x5326fd['shift']());}};_0x4a3b26(++_0x2b3366);}(_0x5766,0x115));var _0x6576=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5766[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6576('0x0'));var jayson=require(_0x6576('0x1'));var util=require(_0x6576('0x2'));var amiClient=jayson[_0x6576('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0x6576('0x3')][_0x6576('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x6576('0x5'),_0x6576('0x6'),'paused','waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x6576('0x7'),_0x6576('0x8'),'invalid',_0x6576('0x9'),_0x6576('0xa'),_0x6576('0xb'),_0x6576('0xc'),_0x6576('0xd'),'talking',_0x6576('0xe'),_0x6576('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x6576('0x10'),_0x6576('0x11'),_0x6576('0x12'),_0x6576('0x13'),'dialActive','dialMethod',_0x6576('0x14'),_0x6576('0x15'),_0x6576('0x16'),_0x6576('0x17'),_0x6576('0x18'),'erlangAbandonmentRate',_0x6576('0x19'),'dialPredictiveInterval',_0x6576('0x1a'),_0x6576('0x1b'),_0x6576('0x1c'),'predictiveIntervalTotalCalls',_0x6576('0x1d'),'predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit',_0x6576('0x1e'),_0x6576('0x1f')];function getRealtimeQueues(_0x439f97,_0x3a0ffe){var _0x150bb7=_0x3a0ffe===_0x6576('0x20')?amiClient:routingClient;return _0x150bb7[_0x6576('0x21')](_[_0x6576('0x22')](_0x3a0ffe)+_0x6576('0x23'),_0x439f97)[_0x6576('0x24')](function(_0x3b6a45){if(_0x3b6a45[_0x6576('0x25')])throw new Error(util[_0x6576('0x26')](_0x6576('0x27'),_0x3a0ffe));return _0x3b6a45[_0x6576('0x28')];})[_0x6576('0x29')](function(_0x3a8b1e){throw _0x3a8b1e;});}exports[_0x6576('0x2a')]=getRealtimeQueues;function initializeQueues(_0x536dd0,_0x1ff11b,_0x197158,_0x5980a8){var _0x3dcf69=DEFAULT_QUEUE_ATTRIBUTES;if(_0x197158===_0x6576('0x20')){if(_0x5980a8===_0x6576('0x2b')){_0x3dcf69=_0x3dcf69[_0x6576('0x2c')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x5980a8===_0x6576('0x2d')){_0x3dcf69=_0x3dcf69[_0x6576('0x2c')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x536dd0[_0x6576('0x2e')](function(_0x42b65b){var _0x419155=_0x42b65b[_0x6576('0x2f')]({'plain':!![]});_0x419155[_0x6576('0x30')]=0x0;_0x419155['loggedInDb']=0x0;_0x419155[_0x6576('0x6')]=0x0;_0x419155['available']=0x0;_0x419155[_0x6576('0x31')]=0x0;if(_0x197158===_0x6576('0x20')){_0x419155['talking']=0x0;_0x419155[_0x6576('0x7')]=0x0;if(_0x5980a8===_0x6576('0x2d')){_0x419155['pTalking']=0x0;_0x419155[_0x6576('0x11')]=0x0;}}var _0xcde9b6=_[_0x6576('0x32')](_0x1ff11b,['id',_0x419155['id']]);if(_0xcde9b6){_[_0x6576('0x33')](_0x419155,_[_0x6576('0x34')](_0xcde9b6,_0x3dcf69));}return _0x419155;});}exports[_0x6576('0x35')]=initializeQueues; \ No newline at end of file +var _0x69d3=['invalid','notInUse','unavailable','unknown','pTalking','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues','inbound','concat','outbound','loggedInDb','loggedIn','talking','originated','find','merge','initializeQueues','lodash','jayson/promise','util','client','http','available','paused','waiting','busy'];(function(_0x343343,_0x46874d){var _0x25462d=function(_0x2f88a4){while(--_0x2f88a4){_0x343343['push'](_0x343343['shift']());}};_0x25462d(++_0x46874d);}(_0x69d3,0x93));var _0x369d=function(_0x50d8b0,_0xba165d){_0x50d8b0=_0x50d8b0-0x0;var _0x2d5045=_0x69d3[_0x50d8b0];return _0x2d5045;};'use strict';var _=require(_0x369d('0x0'));var jayson=require(_0x369d('0x1'));var util=require(_0x369d('0x2'));var amiClient=jayson[_0x369d('0x3')][_0x369d('0x4')]({'port':0x232a});var routingClient=jayson[_0x369d('0x3')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x369d('0x5'),'loggedIn',_0x369d('0x6'),_0x369d('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0x369d('0x8'),'inUse',_0x369d('0x9'),'loggedInDb',_0x369d('0xa'),'onHold','ringing','ringInUse','talking',_0x369d('0xb'),_0x369d('0xc')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x369d('0xd'),'originated',_0x369d('0xe'),'statusMessage',_0x369d('0xf'),_0x369d('0x10'),_0x369d('0x11'),'startPredictive',_0x369d('0x12'),_0x369d('0x13'),_0x369d('0x14'),_0x369d('0x15'),_0x369d('0x16'),_0x369d('0x17'),_0x369d('0x18'),_0x369d('0x19'),_0x369d('0x1a'),_0x369d('0x1b'),_0x369d('0x1c'),_0x369d('0x1d'),_0x369d('0x1e'),_0x369d('0x1f'),_0x369d('0x20')];function getRealtimeQueues(_0x25fc76,_0x2a0d4c){var _0x54e389=_0x2a0d4c===_0x369d('0x21')?amiClient:routingClient;return _0x54e389['request'](_[_0x369d('0x22')](_0x2a0d4c)+_0x369d('0x23'),_0x25fc76)[_0x369d('0x24')](function(_0x320fa7){if(_0x320fa7[_0x369d('0x25')])throw new Error(util[_0x369d('0x26')](_0x369d('0x27'),_0x2a0d4c));return _0x320fa7['result'];})[_0x369d('0x28')](function(_0x4e1494){throw _0x4e1494;});}exports[_0x369d('0x29')]=getRealtimeQueues;function initializeQueues(_0x42cb16,_0x2833dc,_0x402fd6,_0x55addd){var _0x18d5ef=DEFAULT_QUEUE_ATTRIBUTES;if(_0x402fd6===_0x369d('0x21')){if(_0x55addd===_0x369d('0x2a')){_0x18d5ef=_0x18d5ef[_0x369d('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x55addd===_0x369d('0x2c')){_0x18d5ef=_0x18d5ef[_0x369d('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x42cb16['map'](function(_0x53b25a){var _0x5686d9=_0x53b25a['get']({'plain':!![]});_0x5686d9['paused']=0x0;_0x5686d9[_0x369d('0x2d')]=0x0;_0x5686d9[_0x369d('0x2e')]=0x0;_0x5686d9[_0x369d('0x5')]=0x0;_0x5686d9['waiting']=0x0;if(_0x402fd6===_0x369d('0x21')){_0x5686d9[_0x369d('0x2f')]=0x0;_0x5686d9[_0x369d('0x8')]=0x0;if(_0x55addd===_0x369d('0x2c')){_0x5686d9[_0x369d('0xd')]=0x0;_0x5686d9[_0x369d('0x30')]=0x0;}}var _0x517791=_[_0x369d('0x31')](_0x2833dc,['id',_0x5686d9['id']]);if(_0x517791){_[_0x369d('0x32')](_0x5686d9,_['pick'](_0x517791,_0x18d5ef));}return _0x5686d9;});}exports[_0x369d('0x33')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 07b5a1f..cc90686 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x28f1de,_0x355054){var _0x5b5dad=function(_0x399b72){while(--_0x399b72){_0x28f1de['push'](_0x28f1de['shift']());}};_0x5b5dad(++_0x355054);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x68c4d9,_0x419b3c){var _0x62da93=function(_0x51ae9a){while(--_0x51ae9a){_0x68c4d9['push'](_0x68c4d9['shift']());}};_0x62da93(++_0x419b3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index b34f73f..61aa73f 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 _0x97cb=['digest','hex','platform','test','licenseToken','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','length','filter','IPv4','internal','concat','head','mac','address','getFirstInterface','cpus','map','model','join','createHash','md5'];(function(_0x51cc95,_0x11c31e){var _0x54fb8e=function(_0x50ea71){while(--_0x50ea71){_0x51cc95['push'](_0x51cc95['shift']());}};_0x54fb8e(++_0x11c31e);}(_0x97cb,0x11c));var _0xb97c=function(_0x11a3d9,_0x5db357){_0x11a3d9=_0x11a3d9-0x0;var _0x5c20e1=_0x97cb[_0x11a3d9];return _0x5c20e1;};'use strict';var _=require(_0xb97c('0x0'));var os=require('os');var crypto=require(_0xb97c('0x1'));var machine=require(_0xb97c('0x2'));var exec=require(_0xb97c('0x3'))[_0xb97c('0x4')];var config=require('../environment');function getInterfaces(){var _0x4e4431=[];var _0x8df631=os[_0xb97c('0x5')]();var _0x3913af=_[_0xb97c('0x6')](_['keys'](_0x8df631));for(var _0x446c2f=0x0;_0x446c2f<_0x3913af[_0xb97c('0x7')];_0x446c2f++){var _0x5945d5=_0x8df631[_0x3913af[_0x446c2f]][_0xb97c('0x8')](function(_0x1164fb){return _0x1164fb['family']===_0xb97c('0x9')&&_0x1164fb[_0xb97c('0xa')]===![];});_0x4e4431=_0x4e4431[_0xb97c('0xb')](_0x5945d5);}return _0x4e4431;}function getFirstInterface(){var _0x10e674=_[_0xb97c('0xc')](getInterfaces());return{'macAddress':_0x10e674&&_0x10e674[_0xb97c('0xd')]?_0x10e674[_0xb97c('0xd')]:'00:00:00:00:00:00','ipAddress':_0x10e674&&_0x10e674[_0xb97c('0xe')]?_0x10e674[_0xb97c('0xe')]:'127.0.0.1'};}exports[_0xb97c('0xf')]=getFirstInterface;function getCPUhash(){var _0x4af4a8=_['orderBy'](os[_0xb97c('0x10')]()[_0xb97c('0x11')](function(_0x36b785){return _0x36b785[_0xb97c('0x12')];}))[_0xb97c('0x13')](':');return crypto[_0xb97c('0x14')](_0xb97c('0x15'))['update'](_0x4af4a8)[_0xb97c('0x16')](_0xb97c('0x17'));}exports['getUuid']=function(){var _0x46ab5b=os[_0xb97c('0x18')]();var _0x4609bb=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x4609bb[_0xb97c('0x19')](config['licenseToken'])){return config[_0xb97c('0x1a')];}else if(_0x46ab5b==='win32'){return exec(_0xb97c('0x1b'),{'encoding':_0xb97c('0x1c')})[_0xb97c('0x1d')]('\x0d\x0a','');}else{var _0x587677=getFirstInterface();var _0x431a9e=getCPUhash();var _0x24d0ed=_0x431a9e+'|'+os[_0xb97c('0x1e')]()+'|'+_0x587677[_0xb97c('0x1f')]+'|'+_0x587677['ipAddress'];var _0x539876=crypto[_0xb97c('0x14')](_0xb97c('0x15'))[_0xb97c('0x20')](_0x24d0ed)[_0xb97c('0x16')](_0xb97c('0x17'));return _0x539876[_0xb97c('0x21')](0x0,0x8)+'-'+_0x539876['substring'](0x8,0xc)+'-'+_0x539876[_0xb97c('0x21')](0xc,0x10)+'-'+_0x539876['substring'](0x10,0x14)+'-'+_0x539876[_0xb97c('0x21')](0x14);}}; \ No newline at end of file +var _0x9b75=['keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','update','digest','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','hostname','macAddress','hex','substring','lodash','bimedia-machine-uuid','execSync','orderBy'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x9b75,0x15c));var _0x59b7=function(_0x440a3a,_0x31beee){_0x440a3a=_0x440a3a-0x0;var _0x497ee0=_0x9b75[_0x440a3a];return _0x497ee0;};'use strict';var _=require(_0x59b7('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x59b7('0x1'));var exec=require('child_process')[_0x59b7('0x2')];var config=require('../environment');function getInterfaces(){var _0x451e2a=[];var _0x5b9c08=os['networkInterfaces']();var _0x247f86=_[_0x59b7('0x3')](_[_0x59b7('0x4')](_0x5b9c08));for(var _0x314887=0x0;_0x314887<_0x247f86[_0x59b7('0x5')];_0x314887++){var _0x17890a=_0x5b9c08[_0x247f86[_0x314887]][_0x59b7('0x6')](function(_0x565172){return _0x565172['family']===_0x59b7('0x7')&&_0x565172[_0x59b7('0x8')]===![];});_0x451e2a=_0x451e2a[_0x59b7('0x9')](_0x17890a);}return _0x451e2a;}function getFirstInterface(){var _0x252b74=_[_0x59b7('0xa')](getInterfaces());return{'macAddress':_0x252b74&&_0x252b74[_0x59b7('0xb')]?_0x252b74[_0x59b7('0xb')]:_0x59b7('0xc'),'ipAddress':_0x252b74&&_0x252b74['address']?_0x252b74['address']:_0x59b7('0xd')};}exports[_0x59b7('0xe')]=getFirstInterface;function getCPUhash(){var _0x2a7165=_[_0x59b7('0x3')](os[_0x59b7('0xf')]()[_0x59b7('0x10')](function(_0x5c2657){return _0x5c2657['model'];}))[_0x59b7('0x11')](':');return crypto[_0x59b7('0x12')](_0x59b7('0x13'))[_0x59b7('0x14')](_0x2a7165)[_0x59b7('0x15')]('hex');}exports[_0x59b7('0x16')]=function(){var _0x12969d=os[_0x59b7('0x17')]();var _0x1d49cd=/[0-9a-f-]{36}/;if(config[_0x59b7('0x18')]&&_0x1d49cd[_0x59b7('0x19')](config[_0x59b7('0x18')])){return config[_0x59b7('0x18')];}else if(_0x12969d===_0x59b7('0x1a')){return exec(_0x59b7('0x1b'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x524e76=getFirstInterface();var _0xa8a94a=getCPUhash();var _0x2770cd=_0xa8a94a+'|'+os[_0x59b7('0x1c')]()+'|'+_0x524e76[_0x59b7('0x1d')]+'|'+_0x524e76['ipAddress'];var _0x354d22=crypto[_0x59b7('0x12')](_0x59b7('0x13'))[_0x59b7('0x14')](_0x2770cd)['digest'](_0x59b7('0x1e'));return _0x354d22['substring'](0x0,0x8)+'-'+_0x354d22['substring'](0x8,0xc)+'-'+_0x354d22['substring'](0xc,0x10)+'-'+_0x354d22[_0x59b7('0x1f')](0x10,0x14)+'-'+_0x354d22['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index c507df5..c99d0c9 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 _0x8723=['update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','pkginfo','version','../../mysqldb','./hardware','format','exports','GET','then','catch','get','data2','data1','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8723,0x1f4));var _0x3872=function(_0x1318cc,_0x4f5f65){_0x1318cc=_0x1318cc-0x0;var _0x1919d6=_0x8723[_0x1318cc];return _0x1919d6;};'use strict';var util=require(_0x3872('0x0'));var moment=require(_0x3872('0x1'));var rp=require(_0x3872('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x3872('0x3'))(module,_0x3872('0x4'));var db=require(_0x3872('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x3872('0x6'));var logger=require('../logger')('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4d4016){return new BPromise(function(_0x15031c,_0x39d2a8){var _0x2ba163=util[_0x3872('0x7')]('%s/api/servers/%s/check?version=%s',HOST,_0x4d4016,module[_0x3872('0x8')]['version']);if(oldToken){_0x2ba163=util[_0x3872('0x7')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x4d4016,module['exports']['version'],oldToken);}var _0x4286ef={'uri':_0x2ba163,'method':_0x3872('0x9'),'timeout':0xea60,'json':!![]};return rp(_0x4286ef)[_0x3872('0xa')](function(_0x3571e2){_0x15031c(_0x3571e2);})[_0x3872('0xb')](function(_0x3b3955){_0x39d2a8(_0x3b3955);});});}function manageLicense(_0x1c45e3,_0x388f0c){var _0x2846db=_0x388f0c[_0x3872('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x2846db['data1']!==_0x1c45e3&&!_0x2846db[_0x3872('0xd')]){oldToken=_0x2846db[_0x3872('0xe')];}httpRequest(_0x1c45e3)[_0x3872('0xa')](function(_0x563ea7){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x563ea7['active']){isOldTokenSent=![];if(!_0x2846db[_0x3872('0xf')]&&_0x2846db[_0x3872('0xf')]!=_0x563ea7['license']||_0x2846db[_0x3872('0xf')]&&_0x2846db[_0x3872('0xd')]){logger[_0x3872('0x10')](_0x3872('0x11'));}if(_0x2846db[_0x3872('0xf')]&&!_0x2846db[_0x3872('0xd')]&&_0x2846db[_0x3872('0xf')]!=_0x563ea7[_0x3872('0xf')]){logger[_0x3872('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x2846db[_0x3872('0xf')]&&!_0x2846db[_0x3872('0xd')]&&_0x2846db[_0x3872('0xf')]==_0x563ea7[_0x3872('0xf')]){return _0x388f0c;}return _0x388f0c[_0x3872('0x12')]({'data1':_0x1c45e3,'data2':null,'license':_0x563ea7[_0x3872('0xf')]});}else{if(_0x563ea7[_0x3872('0xf')]||_0x2846db[_0x3872('0xf')]){if(!_0x2846db['data2']){if(_0x2846db[_0x3872('0xe')]==_0x1c45e3){GRAY_PERIOD_REASON=_0x3872('0x13');logger[_0x3872('0x10')](_0x3872('0x14'));}else{GRAY_PERIOD_REASON=_0x3872('0x15');logger[_0x3872('0x10')](_0x3872('0x16'),_0x2846db[_0x3872('0xe')],_0x1c45e3);}logger[_0x3872('0x10')](_0x3872('0x17'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x3872('0x7')]('YYYY-MM-DD\x20HH:mm'));return _0x388f0c[_0x3872('0x12')]({'data2':encryptor[_0x3872('0x18')](moment()[_0x3872('0x7')](_0x3872('0x19')))});}else{if(moment()[_0x3872('0x1a')](encryptor[_0x3872('0x1b')](_0x2846db[_0x3872('0xd')]),'days')>DAYS){logger[_0x3872('0x10')]('DEMO\x20START\x20AT\x20%s',moment()[_0x3872('0x7')](_0x3872('0x19')));isOldTokenSent=![];return _0x388f0c['update']({'data1':_0x1c45e3,'data2':null,'license':null});}}}else{if(_0x2846db[_0x3872('0xe')]!=_0x1c45e3){logger[_0x3872('0x10')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2846db[_0x3872('0xe')],_0x1c45e3);return _0x388f0c['update']({'data1':_0x1c45e3,'data2':null,'license':null});}}}return _0x388f0c;})[_0x3872('0xa')](function(_0x179a35){_0x388f0c=_0x179a35;})[_0x3872('0xb')](function(_0x3e21d6){logger[_0x3872('0x1c')](_0x3e21d6[_0x3872('0x1d')]);})[_0x3872('0x1e')](function(){setTimeout(function(){manageLicense(hardware[_0x3872('0x1f')](),_0x388f0c);},TIME);});}function defaultLicense(){var _0x36a361=hardware[_0x3872('0x1f')]();if(_0x36a361){return db[_0x3872('0x20')][_0x3872('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x36a361}})[_0x3872('0x22')](function(_0x22e2bf,_0x4a15a6){logger[_0x3872('0x10')](_0x3872('0x23'),_0x36a361);manageLicense(_0x36a361,_0x22e2bf);})['catch'](function(_0x2b35aa){logger[_0x3872('0x1c')](_0x2b35aa[_0x3872('0x1d')]);});}}exports[_0x3872('0x24')]=defaultLicense; \ No newline at end of file +var _0xa69b=['data1','data2','then','license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','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','encryptString','days','DEMO\x20START\x20AT\x20%s','catch','message','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','request-promise','bluebird','pkginfo','../../mysqldb','./hardware','../logger','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s'];(function(_0x5a25f6,_0x3db5cb){var _0x5a524d=function(_0x11f0fd){while(--_0x11f0fd){_0x5a25f6['push'](_0x5a25f6['shift']());}};_0x5a524d(++_0x3db5cb);}(_0xa69b,0xb1));var _0xba69=function(_0x3f199b,_0x236a16){_0x3f199b=_0x3f199b-0x0;var _0x3c3f1b=_0xa69b[_0x3f199b];return _0x3c3f1b;};'use strict';var util=require(_0xba69('0x0'));var moment=require(_0xba69('0x1'));var rp=require(_0xba69('0x2'));var BPromise=require(_0xba69('0x3'));var pkginfo=require(_0xba69('0x4'))(module,'version');var db=require(_0xba69('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xba69('0x6'));var logger=require(_0xba69('0x7'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x105060){return new BPromise(function(_0x4cc5c8,_0x37708c){var _0x2552ea=util[_0xba69('0x8')](_0xba69('0x9'),HOST,_0x105060,module[_0xba69('0xa')][_0xba69('0xb')]);if(oldToken){_0x2552ea=util[_0xba69('0x8')](_0xba69('0xc'),HOST,_0x105060,module['exports'][_0xba69('0xb')],oldToken);}var _0xb62544={'uri':_0x2552ea,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0xb62544)['then'](function(_0x2d326e){_0x4cc5c8(_0x2d326e);})['catch'](function(_0x50225a){_0x37708c(_0x50225a);});});}function manageLicense(_0x2fc84f,_0x567ce4){var _0x3b8124=_0x567ce4['get']({'plain':!![]});if(!isOldTokenSent&&_0x3b8124[_0xba69('0xd')]!==_0x2fc84f&&!_0x3b8124[_0xba69('0xe')]){oldToken=_0x3b8124['data1'];}httpRequest(_0x2fc84f)[_0xba69('0xf')](function(_0x3c363f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3c363f['active']){isOldTokenSent=![];if(!_0x3b8124[_0xba69('0x10')]&&_0x3b8124['license']!=_0x3c363f['license']||_0x3b8124[_0xba69('0x10')]&&_0x3b8124[_0xba69('0xe')]){logger['info'](_0xba69('0x11'));}if(_0x3b8124[_0xba69('0x10')]&&!_0x3b8124['data2']&&_0x3b8124['license']!=_0x3c363f[_0xba69('0x10')]){logger[_0xba69('0x12')](_0xba69('0x13'));}if(_0x3b8124[_0xba69('0x10')]&&!_0x3b8124[_0xba69('0xe')]&&_0x3b8124[_0xba69('0x10')]==_0x3c363f[_0xba69('0x10')]){return _0x567ce4;}return _0x567ce4[_0xba69('0x14')]({'data1':_0x2fc84f,'data2':null,'license':_0x3c363f['license']});}else{if(_0x3c363f[_0xba69('0x10')]||_0x3b8124[_0xba69('0x10')]){if(!_0x3b8124[_0xba69('0xe')]){if(_0x3b8124[_0xba69('0xd')]==_0x2fc84f){GRAY_PERIOD_REASON=_0xba69('0x15');logger[_0xba69('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xba69('0x16');logger['info'](_0xba69('0x17'),_0x3b8124[_0xba69('0xd')],_0x2fc84f);}logger[_0xba69('0x12')](_0xba69('0x18'),GRAY_PERIOD_REASON[_0xba69('0x19')](),moment()[_0xba69('0x8')](_0xba69('0x1a')));return _0x567ce4[_0xba69('0x14')]({'data2':encryptor[_0xba69('0x1b')](moment()[_0xba69('0x8')](_0xba69('0x1a')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x3b8124[_0xba69('0xe')]),_0xba69('0x1c'))>DAYS){logger['info'](_0xba69('0x1d'),moment()[_0xba69('0x8')](_0xba69('0x1a')));isOldTokenSent=![];return _0x567ce4[_0xba69('0x14')]({'data1':_0x2fc84f,'data2':null,'license':null});}}}else{if(_0x3b8124[_0xba69('0xd')]!=_0x2fc84f){logger[_0xba69('0x12')](_0xba69('0x17'),_0x3b8124[_0xba69('0xd')],_0x2fc84f);return _0x567ce4[_0xba69('0x14')]({'data1':_0x2fc84f,'data2':null,'license':null});}}}return _0x567ce4;})[_0xba69('0xf')](function(_0x4f260a){_0x567ce4=_0x4f260a;})[_0xba69('0x1e')](function(_0x33d28f){logger['error'](_0x33d28f[_0xba69('0x1f')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xba69('0x20')](),_0x567ce4);},TIME);});}function defaultLicense(){var _0x2b0d07=hardware[_0xba69('0x20')]();if(_0x2b0d07){return db[_0xba69('0x21')][_0xba69('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x2b0d07}})['spread'](function(_0x178d85,_0x10a3cf){logger[_0xba69('0x12')](_0xba69('0x23'),_0x2b0d07);manageLicense(_0x2b0d07,_0x178d85);})[_0xba69('0x1e')](function(_0x488272){logger[_0xba69('0x24')](_0x488272[_0xba69('0x1f')]);});}}exports[_0xba69('0x25')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index e0552a5..c2acba2 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 _0xd2b3=['message','User','findAll','role','sequelize','COUNT','col','user','telephone','users','forEach','admin','count','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','uuid','changed','disabled'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xd2b3,0xa1));var _0x3d2b=function(_0x14e405,_0x387732){_0x14e405=_0x14e405-0x0;var _0x34822a=_0xd2b3[_0x14e405];return _0x34822a;};'use strict';var util=require(_0x3d2b('0x0'));var _=require(_0x3d2b('0x1'));var moment=require(_0x3d2b('0x2'));var BPromise=require('bluebird');var hardware=require(_0x3d2b('0x3'));var encryptor=require(_0x3d2b('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3d2b('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x3d2b('0x6'),'machineUuid':hardware[_0x3d2b('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3d2b('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x3d2b('0x8'),'machineUuid':hardware[_0x3d2b('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x214348){return new BPromise(function(_0x455be4,_0x5c0796){return db['License']['find'](_[_0x3d2b('0x9')](_0x214348,{'raw':!![],'where':{'id':0x1}}))[_0x3d2b('0xa')](function(_0x3b4e93){return checkLicense(_0x3b4e93,null);})[_0x3d2b('0xa')](function(_0x4b1d79){_0x455be4(_0x4b1d79);return;})[_0x3d2b('0xb')](function(_0x311be2){_0x5c0796(_0x311be2);});});}function checkLicense(_0x2e6fe0,_0x57864e){if(!_0x2e6fe0){demoLicense['uuid']=_0x2e6fe0[_0x3d2b('0xc')];return demoLicense;}try{var _0x4d4e8a=_0x57864e||_0x2e6fe0[_0x3d2b('0xd')];if(_[_0x3d2b('0xe')](_0x4d4e8a)){throw new Error(_0x3d2b('0xf'));}var _0x3ed2da=_0x2e6fe0[_0x3d2b('0xc')];var _0x2aae56=_0x2e6fe0[_0x3d2b('0x10')];var _0x23ad9c=_0x3ed2da[_0x3d2b('0x11')]('-')[0x4];var _0x361c23=_0x3ed2da['split']('-')[0x0];var _0x1145d7=encryptor[_0x3d2b('0x12')](_0x4d4e8a,util[_0x3d2b('0x13')](_0x3d2b('0x14'),_0x23ad9c,_0x3ed2da,_0x361c23));var _0x2f4e8f=JSON[_0x3d2b('0x15')](_0x1145d7);_0x2f4e8f[_0x3d2b('0x16')]=![];_0x2f4e8f['uuid']=_0x3ed2da;_0x2f4e8f[_0x3d2b('0x17')]=hardware[_0x3d2b('0x7')]();if(_0x2aae56){var _0x58c990=encryptor['decryptString'](_0x2aae56);_0x2f4e8f[_0x3d2b('0x18')]=_0x58c990;_0x2f4e8f[_0x3d2b('0x19')]=moment(_0x58c990)[_0x3d2b('0x1a')](0x7,_0x3d2b('0x1b'))[_0x3d2b('0x13')]();_0x2f4e8f['grayReason']=_0x2f4e8f[_0x3d2b('0x1c')]!=_0x2f4e8f[_0x3d2b('0x17')]?_0x3d2b('0x1d'):_0x3d2b('0x1e');}return _0x2f4e8f;}catch(_0x4e972d){breakingLicense[_0x3d2b('0x1c')]=_0x2e6fe0[_0x3d2b('0xc')];breakingLicense[_0x3d2b('0x1f')]=_0x4e972d[_0x3d2b('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x97bab0,_0xeb5b52){getLicense()[_0x3d2b('0xa')](function(_0x119ef4){return db[_0x3d2b('0x20')][_0x3d2b('0x21')]({'attributes':[_0x3d2b('0x22'),[db[_0x3d2b('0x23')]['fn'](_0x3d2b('0x24'),db[_0x3d2b('0x23')][_0x3d2b('0x25')](_0x3d2b('0x22'))),'count']],'group':_0x3d2b('0x22'),'where':{'role':{'$or':['admin',_0x3d2b('0x26'),_0x3d2b('0x27')]}},'raw':!![]})[_0x3d2b('0xa')](function(_0x298b56){var _0x14e630={'user':_0x119ef4[_0x3d2b('0x28')]||0x0,'telephone':_0x119ef4['telephones']||0x0};_0x298b56[_0x3d2b('0x29')](function(_0x51c79b){var _0x373306=_0x51c79b[_0x3d2b('0x22')]===_0x3d2b('0x2a')?'user':_0x51c79b[_0x3d2b('0x22')];_0x14e630[_0x373306]-=_0x51c79b[_0x3d2b('0x2b')];if(_0x14e630[_0x373306]<0x0)_0x14e630[_0x373306]=0x0;});_0x97bab0(_0x14e630);return;});})[_0x3d2b('0xb')](function(_0xd266c6){_0xeb5b52(_0xd266c6);});});}function checkUserLimits(_0xf10c1d){return new BPromise(function(_0x56efd6,_0x580b53){getLimits()[_0x3d2b('0xa')](function(_0x8ac636){var _0x3c622e=_[_0x3d2b('0x2c')](_['countBy'](_0xf10c1d,_0x3d2b('0x22')),[_0x3d2b('0x2a'),_0x3d2b('0x26'),_0x3d2b('0x27')]);var _0x1a0095=(_0x3c622e[_0x3d2b('0x2a')]||0x0)+(_0x3c622e[_0x3d2b('0x26')]||0x0);var _0x28a1d8=_0x3c622e[_0x3d2b('0x27')]||0x0;if(_0x1a0095>_0x8ac636[_0x3d2b('0x26')])return _0x580b53(_0x3d2b('0x2d'));if(_0x28a1d8>_0x8ac636[_0x3d2b('0x27')])return _0x580b53(_0x3d2b('0x2e'));return _0x56efd6();})[_0x3d2b('0xb')](function(_0x58692d){_0x580b53(_0x58692d);});});}module[_0x3d2b('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x3b21=['split','decryptString','format','%s:%s:%s','machineUuid','gray','deadline','add','grayReason','changed','disabled','User','findAll','role','sequelize','col','count','admin','telephone','users','telephones','forEach','user','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','find','defaults','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3b21,0x19e));var _0x13b2=function(_0x9001cb,_0x594354){_0x9001cb=_0x9001cb-0x0;var _0xa74d1b=_0x3b21[_0x9001cb];return _0xa74d1b;};'use strict';var util=require(_0x13b2('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0x13b2('0x1'));var hardware=require(_0x13b2('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0x13b2('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x13b2('0x4'),'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':_0x13b2('0x5'),'machineUuid':hardware[_0x13b2('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4deac6){return new BPromise(function(_0x49c236,_0x55a77c){return db['License'][_0x13b2('0x7')](_[_0x13b2('0x8')](_0x4deac6,{'raw':!![],'where':{'id':0x1}}))[_0x13b2('0x9')](function(_0x23cea7){return checkLicense(_0x23cea7,null);})['then'](function(_0x442010){_0x49c236(_0x442010);return;})[_0x13b2('0xa')](function(_0x10f552){_0x55a77c(_0x10f552);});});}function checkLicense(_0x33a98c,_0x5ac910){if(!_0x33a98c){demoLicense[_0x13b2('0xb')]=_0x33a98c[_0x13b2('0xc')];return demoLicense;}try{var _0x50922e=_0x5ac910||_0x33a98c['license'];if(_[_0x13b2('0xd')](_0x50922e)){throw new Error(_0x13b2('0xe'));}var _0x3e1a90=_0x33a98c[_0x13b2('0xc')];var _0x5cf32c=_0x33a98c[_0x13b2('0xf')];var _0x5cdba8=_0x3e1a90[_0x13b2('0x10')]('-')[0x4];var _0x57b851=_0x3e1a90[_0x13b2('0x10')]('-')[0x0];var _0x3a8b91=encryptor[_0x13b2('0x11')](_0x50922e,util[_0x13b2('0x12')](_0x13b2('0x13'),_0x5cdba8,_0x3e1a90,_0x57b851));var _0x4545d2=JSON['parse'](_0x3a8b91);_0x4545d2['demo']=![];_0x4545d2['uuid']=_0x3e1a90;_0x4545d2[_0x13b2('0x14')]=hardware['getUuid']();if(_0x5cf32c){var _0x3c875d=encryptor[_0x13b2('0x11')](_0x5cf32c);_0x4545d2[_0x13b2('0x15')]=_0x3c875d;_0x4545d2[_0x13b2('0x16')]=moment(_0x3c875d)[_0x13b2('0x17')](0x7,'days')[_0x13b2('0x12')]();_0x4545d2[_0x13b2('0x18')]=_0x4545d2[_0x13b2('0xb')]!=_0x4545d2[_0x13b2('0x14')]?_0x13b2('0x19'):_0x13b2('0x1a');}return _0x4545d2;}catch(_0x366883){breakingLicense['uuid']=_0x33a98c[_0x13b2('0xc')];breakingLicense['message']=_0x366883['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x36b532,_0x2d7b36){getLicense()[_0x13b2('0x9')](function(_0x496ac9){return db[_0x13b2('0x1b')][_0x13b2('0x1c')]({'attributes':[_0x13b2('0x1d'),[db[_0x13b2('0x1e')]['fn']('COUNT',db['sequelize'][_0x13b2('0x1f')](_0x13b2('0x1d'))),_0x13b2('0x20')]],'group':'role','where':{'role':{'$or':[_0x13b2('0x21'),'user',_0x13b2('0x22')]}},'raw':!![]})[_0x13b2('0x9')](function(_0x6aa399){var _0x4f5a75={'user':_0x496ac9[_0x13b2('0x23')]||0x0,'telephone':_0x496ac9[_0x13b2('0x24')]||0x0};_0x6aa399[_0x13b2('0x25')](function(_0x34d4c5){var _0x389124=_0x34d4c5['role']===_0x13b2('0x21')?_0x13b2('0x26'):_0x34d4c5[_0x13b2('0x1d')];_0x4f5a75[_0x389124]-=_0x34d4c5[_0x13b2('0x20')];if(_0x4f5a75[_0x389124]<0x0)_0x4f5a75[_0x389124]=0x0;});_0x36b532(_0x4f5a75);return;});})[_0x13b2('0xa')](function(_0x512878){_0x2d7b36(_0x512878);});});}function checkUserLimits(_0x3a0799){return new BPromise(function(_0x563703,_0xfb00c2){getLimits()[_0x13b2('0x9')](function(_0x458a86){var _0x1b0845=_[_0x13b2('0x27')](_[_0x13b2('0x28')](_0x3a0799,_0x13b2('0x1d')),[_0x13b2('0x21'),'user',_0x13b2('0x22')]);var _0x40ea3b=(_0x1b0845['admin']||0x0)+(_0x1b0845[_0x13b2('0x26')]||0x0);var _0x4c64e3=_0x1b0845[_0x13b2('0x22')]||0x0;if(_0x40ea3b>_0x458a86[_0x13b2('0x26')])return _0xfb00c2(_0x13b2('0x29'));if(_0x4c64e3>_0x458a86[_0x13b2('0x22')])return _0xfb00c2(_0x13b2('0x2a'));return _0x563703();})[_0x13b2('0xa')](function(_0x390e87){_0xfb00c2(_0x390e87);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 7932afb..f3310a8 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 _0x6a95=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0xa30df3,_0x54f0d3){var _0x3fbc93=function(_0x1f1faf){while(--_0x1f1faf){_0xa30df3['push'](_0xa30df3['shift']());}};_0x3fbc93(++_0x54f0d3);}(_0x6a95,0x1db));var _0x56a9=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x6a95[_0x139a3c];return _0x2b375b;};'use strict';module[_0x56a9('0x0')]={'DOMAIN':_0x56a9('0x1'),'SESSION_SECRET':_0x56a9('0x2'),'GOOGLE_ID':_0x56a9('0x3'),'GOOGLE_SECRET':_0x56a9('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x5f66=['app-id','secret','http://localhost:9000'];(function(_0x4d6ce,_0x595081){var _0x52f621=function(_0x5961c5){while(--_0x5961c5){_0x4d6ce['push'](_0x4d6ce['shift']());}};_0x52f621(++_0x595081);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'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 diff --git a/server/config/logger.js b/server/config/logger.js index 631b83d..477d917 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9a9=['../utils/loggers','fileLogger','exports'];(function(_0x2776ad,_0x5e26ed){var _0x378760=function(_0x10bb9f){while(--_0x10bb9f){_0x2776ad['push'](_0x2776ad['shift']());}};_0x378760(++_0x5e26ed);}(_0xd9a9,0x13b));var _0x9d9a=function(_0x4a6eda,_0x9d95f1){_0x4a6eda=_0x4a6eda-0x0;var _0x249c44=_0xd9a9[_0x4a6eda];return _0x249c44;};'use strict';var fileLogger=require(_0x9d9a('0x0'))[_0x9d9a('0x1')];module[_0x9d9a('0x2')]=fileLogger; \ No newline at end of file +var _0x182e=['../utils/loggers','fileLogger'];(function(_0x31678f,_0x4bd077){var _0x49d438=function(_0x5139d4){while(--_0x5139d4){_0x31678f['push'](_0x31678f['shift']());}};_0x49d438(++_0x4bd077);}(_0x182e,0xa8));var _0xe182=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x182e[_0xa2c0a3];return _0x52c618;};'use strict';var fileLogger=require(_0xe182('0x0'))[_0xe182('0x1')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index aa1ce0d..f06d337 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 _0x9165=['join','../../services/routing/index.js','../../services/xdr/index.js','exports','path','../../config/environment','resolve','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','email'];(function(_0x2ebfde,_0x598de1){var _0x244cbf=function(_0x5707c1){while(--_0x5707c1){_0x2ebfde['push'](_0x2ebfde['shift']());}};_0x244cbf(++_0x598de1);}(_0x9165,0x1d2));var _0x5916=function(_0x492dca,_0x557b3f){_0x492dca=_0x492dca-0x0;var _0x377752=_0x9165[_0x492dca];return _0x377752;};'use strict';var path=require(_0x5916('0x0'));var cfg=require(_0x5916('0x1'));var env={'NODE_PATH':path[_0x5916('0x2')](path['join'](cfg[_0x5916('0x3')],_0x5916('0x4')))};var pm2config={'apps':[{'name':_0x5916('0x5'),'script':path['join'](__dirname,_0x5916('0x6')),'env':env},{'name':_0x5916('0x7'),'script':path['join'](__dirname,_0x5916('0x8')),'env':env},{'name':'agi','script':path['join'](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x5916('0x9'),'script':path[_0x5916('0xa')](__dirname,'../../services/email/index.js'),'env':env},{'name':'routing','script':path[_0x5916('0xa')](__dirname,_0x5916('0xb')),'env':env},{'name':'xdr','script':path[_0x5916('0xa')](__dirname,_0x5916('0xc')),'env':env}]};module[_0x5916('0xd')]=pm2config; \ No newline at end of file +var _0x1768=['../../services/express/index.js','ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','path','../../config/environment','resolve','join','root','express'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x1768,0x18a));var _0x8176=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x1768[_0x1b6186];return _0x186121;};'use strict';var path=require(_0x8176('0x0'));var cfg=require(_0x8176('0x1'));var env={'NODE_PATH':path[_0x8176('0x2')](path[_0x8176('0x3')](cfg[_0x8176('0x4')],'legacy-libs'))};var pm2config={'apps':[{'name':_0x8176('0x5'),'script':path[_0x8176('0x3')](__dirname,_0x8176('0x6')),'env':env},{'name':_0x8176('0x7'),'script':path[_0x8176('0x3')](__dirname,_0x8176('0x8')),'env':env},{'name':_0x8176('0x9'),'script':path[_0x8176('0x3')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x8176('0xa'),'script':path[_0x8176('0x3')](__dirname,_0x8176('0xb')),'env':env},{'name':_0x8176('0xc'),'script':path['join'](__dirname,_0x8176('0xd')),'env':env},{'name':_0x8176('0xe'),'script':path['join'](__dirname,'../../services/xdr/index.js'),'env':env}]};module[_0x8176('0xf')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index ddee384..70df85f 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 _0x22dd=['then','stop','disconnect','restart','list','describe','delete','dump','pm2','bluebird','./config','start'];(function(_0x5d9e8d,_0x52050d){var _0x8ff2a0=function(_0x3bdae8){while(--_0x3bdae8){_0x5d9e8d['push'](_0x5d9e8d['shift']());}};_0x8ff2a0(++_0x52050d);}(_0x22dd,0x98));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var pm2=require(_0xd22d('0x0'));var BPromise=require(_0xd22d('0x1'));var config=require(_0xd22d('0x2'));function connect(){return new BPromise(function(_0x3d5f70,_0x371793){return pm2['connect'](function(_0x267384){if(_0x267384){return _0x371793(_0x267384);}return _0x3d5f70('connected');});});};exports[_0xd22d('0x3')]=function(_0x1b38af){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x4af281,_0x4c1721){return pm2['start'](_0x1b38af,function(_0x158b68,_0xdc40fb){if(_0x158b68){return _0x4c1721(_0x158b68);}pm2['disconnect']();return _0x4af281(_0xdc40fb);});});});};exports[_0xd22d('0x5')]=function(_0xc69fc2){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x1bcf34,_0x1b0226){return pm2['stop'](_0xc69fc2,function(_0x27e8ad,_0x58ccaf){if(_0x27e8ad){return _0x1b0226(_0x27e8ad);}pm2[_0xd22d('0x6')]();return _0x1bcf34(_0x58ccaf);});});});};exports[_0xd22d('0x7')]=function(_0x1d047d){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x181829,_0x2a4263){return pm2[_0xd22d('0x7')](_0x1d047d,function(_0xb9627e,_0x5cc7aa){if(_0xb9627e){return _0x2a4263(_0xb9627e);}pm2[_0xd22d('0x6')]();return _0x181829(_0x5cc7aa);});});});};exports[_0xd22d('0x8')]=function(){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x46b9a2,_0x236b94){return pm2['list'](function(_0x17034f,_0x1c35cc){if(_0x17034f){return _0x236b94(_0x17034f);}pm2[_0xd22d('0x6')]();return _0x46b9a2(_0x1c35cc);});});});};exports[_0xd22d('0x9')]=function(_0x944593){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x5cc450,_0x57ceaa){return pm2['describe'](_0x944593,function(_0x1f748e,_0xf409a2){if(_0x1f748e){return _0x57ceaa(_0x1f748e);}pm2[_0xd22d('0x6')]();return _0x5cc450(_0xf409a2);});});});};exports[_0xd22d('0xa')]=function(_0x9d5923){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x38af0f,_0xe81676){return pm2['delete'](_0x9d5923,function(_0xf03d6c,_0x32b1e8){if(_0xf03d6c){return _0xe81676(_0xf03d6c);}pm2[_0xd22d('0x6')]();return _0x38af0f(_0x32b1e8);});});});};exports[_0xd22d('0xb')]=function(){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x518243,_0x41c70e){return pm2[_0xd22d('0xb')](function(_0x231850){if(_0x231850){return _0x41c70e(_0x231850);}return _0x518243('saved');});});});}; \ No newline at end of file +var _0xde66=['restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connected','start','then','disconnect','stop'];(function(_0x4f4e10,_0x287d21){var _0x4085e2=function(_0x16cdb0){while(--_0x16cdb0){_0x4f4e10['push'](_0x4f4e10['shift']());}};_0x4085e2(++_0x287d21);}(_0xde66,0x1e2));var _0x6de6=function(_0x1551bc,_0x334b59){_0x1551bc=_0x1551bc-0x0;var _0x228deb=_0xde66[_0x1551bc];return _0x228deb;};'use strict';var pm2=require(_0x6de6('0x0'));var BPromise=require(_0x6de6('0x1'));var config=require(_0x6de6('0x2'));function connect(){return new BPromise(function(_0x5c4804,_0x566f53){return pm2['connect'](function(_0x5cb70e){if(_0x5cb70e){return _0x566f53(_0x5cb70e);}return _0x5c4804(_0x6de6('0x3'));});});};exports[_0x6de6('0x4')]=function(_0x34dcdc){return connect()[_0x6de6('0x5')](function(){return new BPromise(function(_0x56c57b,_0x2a4431){return pm2[_0x6de6('0x4')](_0x34dcdc,function(_0x20c7d5,_0x140f0e){if(_0x20c7d5){return _0x2a4431(_0x20c7d5);}pm2[_0x6de6('0x6')]();return _0x56c57b(_0x140f0e);});});});};exports[_0x6de6('0x7')]=function(_0x1e62f7){return connect()[_0x6de6('0x5')](function(){return new BPromise(function(_0x10e1ae,_0x3943a4){return pm2[_0x6de6('0x7')](_0x1e62f7,function(_0x5ded9d,_0x5b934d){if(_0x5ded9d){return _0x3943a4(_0x5ded9d);}pm2[_0x6de6('0x6')]();return _0x10e1ae(_0x5b934d);});});});};exports[_0x6de6('0x8')]=function(_0x21ae83){return connect()[_0x6de6('0x5')](function(){return new BPromise(function(_0x566e8e,_0x598da6){return pm2[_0x6de6('0x8')](_0x21ae83,function(_0x2b7527,_0x164d60){if(_0x2b7527){return _0x598da6(_0x2b7527);}pm2[_0x6de6('0x6')]();return _0x566e8e(_0x164d60);});});});};exports[_0x6de6('0x9')]=function(){return connect()[_0x6de6('0x5')](function(){return new BPromise(function(_0xc3dd67,_0xa26e24){return pm2[_0x6de6('0x9')](function(_0x299a8e,_0x27966c){if(_0x299a8e){return _0xa26e24(_0x299a8e);}pm2[_0x6de6('0x6')]();return _0xc3dd67(_0x27966c);});});});};exports['describe']=function(_0xb3b87b){return connect()['then'](function(){return new BPromise(function(_0x40742f,_0x59e129){return pm2[_0x6de6('0xa')](_0xb3b87b,function(_0x694b8c,_0xf77d04){if(_0x694b8c){return _0x59e129(_0x694b8c);}pm2[_0x6de6('0x6')]();return _0x40742f(_0xf77d04);});});});};exports[_0x6de6('0xb')]=function(_0x5134db){return connect()['then'](function(){return new BPromise(function(_0x3edda0,_0x304725){return pm2[_0x6de6('0xb')](_0x5134db,function(_0xd21ef5,_0x29419d){if(_0xd21ef5){return _0x304725(_0xd21ef5);}pm2['disconnect']();return _0x3edda0(_0x29419d);});});});};exports[_0x6de6('0xc')]=function(){return connect()[_0x6de6('0x5')](function(){return new BPromise(function(_0x28c055,_0x6ef7b7){return pm2[_0x6de6('0xc')](function(_0xdbfa41){if(_0xdbfa41){return _0x6ef7b7(_0xdbfa41);}return _0x28c055(_0x6de6('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 353e37a..8fbc715 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 _0xd803=['format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','inspect','start','lodash','moment','ioredis','../logger','schedule','redis','socket.io-emitter','find','chatTimeout','ChatInteraction','lastMsgAt','subtract','minutes','then','length','map','info','update','system'];(function(_0x1738b3,_0x4f4ec3){var _0x462fbc=function(_0x45bdf9){while(--_0x45bdf9){_0x1738b3['push'](_0x1738b3['shift']());}};_0x462fbc(++_0x4f4ec3);}(_0xd803,0xbd));var _0x3d80=function(_0x3b7c4d,_0x43c187){_0x3b7c4d=_0x3b7c4d-0x0;var _0x3995b2=_0xd803[_0x3b7c4d];return _0x3995b2;};'use strict';var _=require(_0x3d80('0x0'));var moment=require(_0x3d80('0x1'));var Redis=require(_0x3d80('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x3d80('0x3'))(_0x3d80('0x4'));config[_0x3d80('0x5')]=_['defaults'](config[_0x3d80('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x3d80('0x6'))(new Redis(config['redis']));function closeInteractions(){var _0x54c688=0x0;var _0x49ad46=[];return db['Setting'][_0x3d80('0x7')]({'raw':!![],'attributes':['id',_0x3d80('0x8')],'where':{'id':0x1}})['then'](function(_0x1e4458){_0x54c688=_0x1e4458[_0x3d80('0x8')];if(_0x54c688){return db[_0x3d80('0x9')]['findAll']({'raw':!![],'attributes':['id',_0x3d80('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3d80('0xb')](_0x1e4458[_0x3d80('0x8')],_0x3d80('0xc'))}}});}else{return[];}})[_0x3d80('0xd')](function(_0x5e6c36){if(_0x5e6c36&&_0x5e6c36[_0x3d80('0xe')]){_0x49ad46=_[_0x3d80('0xf')](_0x5e6c36||[],'id');logger[_0x3d80('0x10')]('[CHAT]\x20Interactions\x20to\x20close:',_0x49ad46['join']());return db[_0x3d80('0x9')][_0x3d80('0x11')]({'closeReason':_0x3d80('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x3d80('0x13')](_0x3d80('0x14'))},{'where':{'id':_0x49ad46}});}})['then'](function(){if(_0x49ad46&&_0x49ad46[_0x3d80('0xe')]){logger['info'](_0x3d80('0x15'),_0x49ad46[_0x3d80('0x16')]());for(var _0x3e19ee=0x0;_0x3e19ee<_0x49ad46[_0x3d80('0xe')];_0x3e19ee++){io[_0x3d80('0x17')]('chatInteraction:update',{'id':_0x49ad46[_0x3e19ee],'closed':!![]});}}})['catch'](function(_0xd70904){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0xd70904?util[_0x3d80('0x18')](_0xd70904,{'showHidden':![],'depth':null}):'');});}exports[_0x3d80('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x4082=['Setting','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','update','system','timeout','format','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','error','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost'];(function(_0x3187cd,_0x19f346){var _0x5c4002=function(_0x5befb9){while(--_0x5befb9){_0x3187cd['push'](_0x3187cd['shift']());}};_0x5c4002(++_0x19f346);}(_0x4082,0x140));var _0x2408=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x4082[_0x5c4f6b];return _0x104c4e;};'use strict';var _=require(_0x2408('0x0'));var moment=require('moment');var Redis=require(_0x2408('0x1'));var util=require(_0x2408('0x2'));var config=require(_0x2408('0x3'));var db=require(_0x2408('0x4'))['db'];var logger=require(_0x2408('0x5'))(_0x2408('0x6'));config[_0x2408('0x7')]=_[_0x2408('0x8')](config[_0x2408('0x7')],{'host':_0x2408('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x11659b=0x0;var _0x11e7cf=[];return db[_0x2408('0xa')][_0x2408('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x2408('0xc')](function(_0x3f9614){_0x11659b=_0x3f9614[_0x2408('0xd')];if(_0x11659b){return db[_0x2408('0xe')][_0x2408('0xf')]({'raw':!![],'attributes':['id',_0x2408('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x2408('0x11')](_0x3f9614[_0x2408('0xd')],_0x2408('0x12'))}}});}else{return[];}})[_0x2408('0xc')](function(_0x4b5164){if(_0x4b5164&&_0x4b5164[_0x2408('0x13')]){_0x11e7cf=_[_0x2408('0x14')](_0x4b5164||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x11e7cf['join']());return db[_0x2408('0xe')][_0x2408('0x15')]({'closeReason':_0x2408('0x16'),'disposition':_0x2408('0x17'),'closed':!![],'closedAt':moment()[_0x2408('0x18')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x11e7cf}});}})[_0x2408('0xc')](function(){if(_0x11e7cf&&_0x11e7cf[_0x2408('0x13')]){logger[_0x2408('0x19')](_0x2408('0x1a'),_0x11e7cf[_0x2408('0x1b')]());for(var _0x3c688c=0x0;_0x3c688c<_0x11e7cf[_0x2408('0x13')];_0x3c688c++){io[_0x2408('0x1c')](_0x2408('0x1d'),{'id':_0x11e7cf[_0x3c688c],'closed':!![]});}}})['catch'](function(_0x100dbc){logger[_0x2408('0x1e')]('[CHAT]\x20Error\x20closing\x20interactions',_0x100dbc?util[_0x2408('0x1f')](_0x100dbc,{'showHidden':![],'depth':null}):'');});}exports[_0x2408('0x20')]=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 a9a0c53..cedaf17 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 _0xcc12=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x2c3a47,_0x170687){var _0x1c04de=function(_0x367deb){while(--_0x367deb){_0x2c3a47['push'](_0x2c3a47['shift']());}};_0x1c04de(++_0x170687);}(_0xcc12,0x1d6));var _0x2cc1=function(_0x5d1e03,_0x409c65){_0x5d1e03=_0x5d1e03-0x0;var _0x375740=_0xcc12[_0x5d1e03];return _0x375740;};'use strict';function start(){var _0x2fa907=require(_0x2cc1('0x0'));return _0x2fa907[_0x2cc1('0x1')]();}module[_0x2cc1('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x2efc=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x2efc,0xda));var _0xc2ef=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x2efc[_0xbb14db];return _0x36bed7;};'use strict';function start(){var _0x436bc3=require(_0xc2ef('0x0'));return _0x436bc3['startAllRefreshIntervals']();}module[_0xc2ef('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 bf0209b..adbf5a1 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 _0x9a77=['then','error','catch','error\x20mail','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','add\x20cron','deleteJob','update','update\x20cron','stop\x20cron','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','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','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail'];(function(_0x30a629,_0xdd2c74){var _0x130d61=function(_0x578b1c){while(--_0x578b1c){_0x30a629['push'](_0x30a629['shift']());}};_0x130d61(++_0xdd2c74);}(_0x9a77,0x143));var _0x79a7=function(_0x5aa6ca,_0x4780cd){_0x5aa6ca=_0x5aa6ca-0x0;var _0x397e30=_0x9a77[_0x5aa6ca];return _0x397e30;};'use strict';var fs=require('fs');var util=require(_0x79a7('0x0'));var path=require(_0x79a7('0x1'));var _=require(_0x79a7('0x2'));var moment=require(_0x79a7('0x3'));var CronJobManager=require(_0x79a7('0x4'));var jayson=require(_0x79a7('0x5'));var BPromise=require('bluebird');var logger=require(_0x79a7('0x6'))('schedule');var db=require(_0x79a7('0x7'))['db'];var analyticCustomReportController=require(_0x79a7('0x8'));var analyticDefaultReportController=require(_0x79a7('0x9'));var client=jayson[_0x79a7('0xa')][_0x79a7('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x423d04,_0x254013){return function(){logger['info'](_0x79a7('0xc'),_0x423d04[_0x79a7('0xd')]);var _0x20ebed=!![];var _0x3cb234=_0x423d04['MailAccount'][_0x79a7('0xe')]();var _0x1e9ecb={'account':_0x3cb234,'message':{'from':util[_0x79a7('0xf')](_0x79a7('0x10'),_0x423d04[_0x79a7('0x11')][_0x79a7('0x12')],_0x423d04[_0x79a7('0x11')][_0x79a7('0xd')]||_0x423d04[_0x79a7('0x11')][_0x79a7('0x13')][_0x79a7('0x14')]),'to':_0x423d04['email'],'cc':_0x423d04['cc'],'bcc':_0x423d04[_0x79a7('0x15')],'subject':util[_0x79a7('0xf')](_0x79a7('0x16'),_0x254013[_0x79a7('0x12')],_0x423d04[_0x79a7('0x17')],_0x423d04[_0x79a7('0x18')])}};var _0x4fd487=path[_0x79a7('0x19')](__dirname,_0x79a7('0x1a'));var _0x16b83f=_0x254013[_0x79a7('0x1b')];var _0x59dc0f=util['format'](_0x79a7('0x1c'),path[_0x79a7('0x1d')](_0x254013[_0x79a7('0x1b')],path[_0x79a7('0x1e')](_0x254013[_0x79a7('0x1b')])),_0x79a7('0x1f'));var _0x55ea08=path[_0x79a7('0x19')](_0x4fd487,_0x16b83f);var _0x16a3a4=path[_0x79a7('0x19')](_0x4fd487,_0x59dc0f);if(fs[_0x79a7('0x20')](_0x55ea08)){_0x254013['status']='Sent';_0x1e9ecb[_0x79a7('0x21')][_0x79a7('0x22')]=[{'filename':_0x16b83f,'path':_0x55ea08}];_0x1e9ecb[_0x79a7('0x21')][_0x79a7('0x23')]=util['format'](_0x79a7('0x24'),JSON[_0x79a7('0x25')](_0x254013,null,0x2));}else if(fs['existsSync'](_0x16a3a4)){_0x254013['status']=_0x79a7('0x26');_0x1e9ecb[_0x79a7('0x21')][_0x79a7('0x22')]=[{'filename':_0x59dc0f,'path':_0x16a3a4}];}else{_0x1e9ecb[_0x79a7('0x21')][_0x79a7('0x23')]=_0x79a7('0x27');if(!_0x423d04[_0x79a7('0x28')]){_0x20ebed=![];logger[_0x79a7('0x29')](_0x79a7('0x2a'));}}if(_0x20ebed){return client[_0x79a7('0x2b')](_0x79a7('0x2c'),_0x1e9ecb)[_0x79a7('0x2d')](function(_0x258ae5){if(_0x258ae5[_0x79a7('0x2e')]){return logger[_0x79a7('0x2e')]('error\x20mail',JSON[_0x79a7('0x25')](_0x258ae5));}return logger[_0x79a7('0x29')]('email\x20sent');})[_0x79a7('0x2f')](function(_0x1fe395){return logger[_0x79a7('0x2e')](_0x79a7('0x30'),JSON[_0x79a7('0x25')](_0x1fe395));});}};}function handleError(){return function(_0x49ba41){return logger[_0x79a7('0x2e')](JSON[_0x79a7('0x25')](_0x49ba41));};}function handleResult(_0x14c7d7){return function(_0x343991){logger[_0x79a7('0x29')]('data',JSON[_0x79a7('0x25')](_0x343991));if(_0x14c7d7[_0x79a7('0x11')]&&_0x14c7d7['MailAccount'][_0x79a7('0x13')]&&!_[_0x79a7('0x31')](_0x14c7d7[_0x79a7('0xd')])){setTimeout(handleSendEmail(_0x14c7d7,_0x343991),0x3c*0x3e8);}};}function handleJob(_0x4baf6a){return function(){try{if(_[_0x79a7('0x31')](_0x4baf6a['subtractNumber'])){return logger[_0x79a7('0x29')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x79a7('0x31')](_0x4baf6a[_0x79a7('0x18')])){return logger['info'](_0x79a7('0x32'));}var _0x28b859={'startDate':moment()[_0x79a7('0x33')](_0x4baf6a[_0x79a7('0x17')],_0x4baf6a[_0x79a7('0x18')])['format'](_0x79a7('0x34')),'endDate':moment()[_0x79a7('0xf')](_0x79a7('0x34')),'type':'scheduled','output':_0x4baf6a[_0x79a7('0x35')],'name':_0x4baf6a[_0x79a7('0x12')]};if(!_[_0x79a7('0x31')](_0x4baf6a['DefaultReportId'])){logger[_0x79a7('0x29')](_0x79a7('0x36'),_0x4baf6a[_0x79a7('0x37')]);return analyticDefaultReportController[_0x79a7('0x38')]({'id':_0x4baf6a[_0x79a7('0x37')]},_0x28b859)['then'](handleResult(_0x4baf6a))[_0x79a7('0x2f')](handleError());}if(!_['isNil'](_0x4baf6a[_0x79a7('0x39')])){logger[_0x79a7('0x29')](_0x79a7('0x3a'),_0x4baf6a[_0x79a7('0x39')]);return analyticCustomReportController[_0x79a7('0x38')]({'id':_0x4baf6a[_0x79a7('0x39')]},_0x28b859)[_0x79a7('0x2d')](handleResult(_0x4baf6a))[_0x79a7('0x2f')](handleError());}}catch(_0x1b1a5f){logger[_0x79a7('0x2e')](JSON['stringify'](_0x1b1a5f));}return logger['info'](_0x79a7('0x3b'));};}function getJobs(_0x24690f){var _0x31c430={};if(_0x24690f){_0x31c430['id']=_0x24690f;}return db[_0x79a7('0x3c')][_0x79a7('0x3d')]({'where':_0x31c430,'include':[{'model':db['MailAccount'],'attributes':['id',_0x79a7('0x12'),_0x79a7('0xd')],'include':[{'model':db['MailServerOut'],'as':_0x79a7('0x13'),'include':[{'model':db[_0x79a7('0x3e')],'as':_0x79a7('0x3e')}]}]}]})[_0x79a7('0x2d')](function(_0xd712b7){var _0x56b55=_[_0x79a7('0x3f')](manager[_0x79a7('0x40')]);var _0x32f58c=_[_0x79a7('0x41')](_0xd712b7,function(_0x1af56c){return _0x1af56c['id'][_0x79a7('0x42')]();});var _0x14d5f1=_[_0x79a7('0x43')](_0xd712b7,function(_0x9f7bf3){return _0x9f7bf3['id']['toString']();});var _0x51f1d0=_0x24690f?_0x32f58c:_[_0x79a7('0x44')](_0x32f58c,_0x56b55);var _0x508cb2=_[_0x79a7('0x45')](_0x32f58c,_0x56b55);var _0x26a33b=_[_0x79a7('0x44')](_0x56b55,_0x32f58c);var _0x472efe;var _0x415c2a;for(_0x472efe=0x0;_0x472efe<_0x26a33b[_0x79a7('0x46')]&&!_0x24690f;_0x472efe+=0x1){_0x415c2a=_0x26a33b[_0x472efe][_0x79a7('0x42')]();if(manager[_0x79a7('0x47')](_0x415c2a)){manager[_0x79a7('0x48')](_0x415c2a);manager['deleteJob'](_0x415c2a);logger[_0x79a7('0x29')](_0x79a7('0x49'),_0x415c2a);}}logger['info'](_0x79a7('0x4a'),JSON[_0x79a7('0x25')](_0x51f1d0));for(_0x472efe=0x0;_0x472efe<_0x51f1d0[_0x79a7('0x46')];_0x472efe+=0x1){_0x415c2a=_0x51f1d0[_0x472efe][_0x79a7('0x42')]();logger['info'](_0x79a7('0x4b'),_0x415c2a);if(_0x24690f){logger[_0x79a7('0x29')](_0x79a7('0x4c'),_0x24690f);logger[_0x79a7('0x29')](JSON['stringify'](_0x14d5f1[_0x415c2a]));BPromise[_0x79a7('0x4d')]()['then'](handleJob(_0x14d5f1[_0x415c2a]));logger[_0x79a7('0x29')](_0x79a7('0x4e'),_0x14d5f1[_0x415c2a][_0x79a7('0x12')],_0x14d5f1[_0x415c2a][_0x79a7('0x4f')]);}else if(_0x14d5f1[_0x415c2a][_0x79a7('0x4f')]&&_0x14d5f1[_0x415c2a][_0x79a7('0x50')]&&moment()[_0x79a7('0x51')](_0x14d5f1[_0x415c2a][_0x79a7('0x52')],_0x14d5f1[_0x415c2a][_0x79a7('0x53')])){manager[_0x79a7('0x54')](_0x415c2a,_0x14d5f1[_0x415c2a][_0x79a7('0x4f')],handleJob(_0x14d5f1[_0x415c2a]));manager['start'](_0x415c2a);logger[_0x79a7('0x29')](_0x79a7('0x55'),_0x14d5f1[_0x415c2a][_0x79a7('0x12')],_0x14d5f1[_0x415c2a][_0x79a7('0x4f')]);}else if(manager[_0x79a7('0x47')](_0x415c2a)){manager[_0x79a7('0x48')](_0x415c2a);manager[_0x79a7('0x56')](_0x415c2a);logger['info']('stop\x20cron',_0x14d5f1[_0x415c2a][_0x79a7('0x12')],_0x14d5f1[_0x415c2a]['cron']);}}for(_0x472efe=0x0,_0x415c2a;_0x472efe<_0x508cb2['length']&&!_0x24690f;_0x472efe+=0x1){_0x415c2a=_0x508cb2[_0x472efe][_0x79a7('0x42')]();if(manager[_0x79a7('0x47')](_0x415c2a)){if(_0x14d5f1[_0x415c2a][_0x79a7('0x4f')]&&_0x14d5f1[_0x415c2a][_0x79a7('0x50')]&&moment()[_0x79a7('0x51')](_0x14d5f1[_0x415c2a][_0x79a7('0x52')],_0x14d5f1[_0x415c2a][_0x79a7('0x53')])){manager[_0x79a7('0x57')](_0x415c2a,_0x14d5f1[_0x415c2a][_0x79a7('0x4f')],handleJob(_0x14d5f1[_0x415c2a]));logger[_0x79a7('0x29')](_0x79a7('0x58'),_0x14d5f1[_0x415c2a]['name'],_0x14d5f1[_0x415c2a][_0x79a7('0x4f')]);}else{manager[_0x79a7('0x48')](_0x415c2a);manager['deleteJob'](_0x415c2a);logger[_0x79a7('0x29')](_0x79a7('0x59'),_0x14d5f1[_0x415c2a]['name'],_0x14d5f1[_0x415c2a][_0x79a7('0x4f')]);}}}})[_0x79a7('0x2f')](function(_0x3b9741){logger[_0x79a7('0x2e')](JSON[_0x79a7('0x25')](_0x3b9741));});}exports[_0x79a7('0x5a')]=function(_0x48584f){return getJobs(_0x48584f);};exports[_0x79a7('0x5b')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x9f47=['map','toString','difference','stop','delete\x20cron','index','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','exists','deleteJob','stop\x20cron','length','update','update\x20cron','start','lodash','moment','cron-job-manager','jayson/promise','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','email','MailAccount','getSmtpOptions','format','name','user','subtractNumber','subtractUnit','../../files/reports','basename','extname','savename','join','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','stringify','email\x20sent','data','Smtp','subtractNumber\x20null\x20or\x20undefined','isNil','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','then','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','catch','no\x20report\x20id','Schedule','findAll','MailServerOut'];(function(_0x1f09bb,_0x1dd71c){var _0x45d669=function(_0x2e34c3){while(--_0x2e34c3){_0x1f09bb['push'](_0x1f09bb['shift']());}};_0x45d669(++_0x1dd71c);}(_0x9f47,0x1e9));var _0x79f4=function(_0x18eeee,_0x34e6c2){_0x18eeee=_0x18eeee-0x0;var _0x509668=_0x9f47[_0x18eeee];return _0x509668;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0x79f4('0x0'));var moment=require(_0x79f4('0x1'));var CronJobManager=require(_0x79f4('0x2'));var jayson=require(_0x79f4('0x3'));var BPromise=require(_0x79f4('0x4'));var logger=require('../logger')('schedule');var db=require(_0x79f4('0x5'))['db'];var analyticCustomReportController=require(_0x79f4('0x6'));var analyticDefaultReportController=require(_0x79f4('0x7'));var client=jayson['client'][_0x79f4('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2f787f,_0x5db4c5){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x2f787f[_0x79f4('0x9')]);var _0x1cf7ee=!![];var _0xee1c7b=_0x2f787f[_0x79f4('0xa')][_0x79f4('0xb')]();var _0x364115={'account':_0xee1c7b,'message':{'from':util[_0x79f4('0xc')]('\x22%s\x22\x20<%s>',_0x2f787f['MailAccount'][_0x79f4('0xd')],_0x2f787f[_0x79f4('0xa')][_0x79f4('0x9')]||_0x2f787f[_0x79f4('0xa')]['Smtp'][_0x79f4('0xe')]),'to':_0x2f787f[_0x79f4('0x9')],'cc':_0x2f787f['cc'],'bcc':_0x2f787f['bcc'],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x5db4c5['name'],_0x2f787f[_0x79f4('0xf')],_0x2f787f[_0x79f4('0x10')])}};var _0x4836a1=path['join'](__dirname,_0x79f4('0x11'));var _0x140bf8=_0x5db4c5['savename'];var _0x39ad25=util[_0x79f4('0xc')]('%s.%s',path[_0x79f4('0x12')](_0x5db4c5['savename'],path[_0x79f4('0x13')](_0x5db4c5[_0x79f4('0x14')])),'zip');var _0x17cfcd=path['join'](_0x4836a1,_0x140bf8);var _0x387819=path[_0x79f4('0x15')](_0x4836a1,_0x39ad25);if(fs[_0x79f4('0x16')](_0x17cfcd)){_0x5db4c5[_0x79f4('0x17')]=_0x79f4('0x18');_0x364115[_0x79f4('0x19')][_0x79f4('0x1a')]=[{'filename':_0x140bf8,'path':_0x17cfcd}];_0x364115[_0x79f4('0x19')][_0x79f4('0x1b')]=util[_0x79f4('0xc')](_0x79f4('0x1c'),JSON['stringify'](_0x5db4c5,null,0x2));}else if(fs[_0x79f4('0x16')](_0x387819)){_0x5db4c5[_0x79f4('0x17')]=_0x79f4('0x18');_0x364115[_0x79f4('0x19')][_0x79f4('0x1a')]=[{'filename':_0x39ad25,'path':_0x387819}];}else{_0x364115[_0x79f4('0x19')][_0x79f4('0x1b')]=_0x79f4('0x1d');if(!_0x2f787f[_0x79f4('0x1e')]){_0x1cf7ee=![];logger[_0x79f4('0x1f')](_0x79f4('0x20'));}}if(_0x1cf7ee){return client[_0x79f4('0x21')](_0x79f4('0x22'),_0x364115)['then'](function(_0x1f3807){if(_0x1f3807[_0x79f4('0x23')]){return logger['error'](_0x79f4('0x24'),JSON[_0x79f4('0x25')](_0x1f3807));}return logger[_0x79f4('0x1f')](_0x79f4('0x26'));})['catch'](function(_0x41cb04){return logger[_0x79f4('0x23')](_0x79f4('0x24'),JSON['stringify'](_0x41cb04));});}};}function handleError(){return function(_0x3f8496){return logger['error'](JSON['stringify'](_0x3f8496));};}function handleResult(_0x3cdd92){return function(_0x292c6c){logger['info'](_0x79f4('0x27'),JSON[_0x79f4('0x25')](_0x292c6c));if(_0x3cdd92['MailAccount']&&_0x3cdd92[_0x79f4('0xa')][_0x79f4('0x28')]&&!_['isNil'](_0x3cdd92['email'])){setTimeout(handleSendEmail(_0x3cdd92,_0x292c6c),0x3c*0x3e8);}};}function handleJob(_0x276a2b){return function(){try{if(_['isNil'](_0x276a2b[_0x79f4('0xf')])){return logger['info'](_0x79f4('0x29'));}if(_[_0x79f4('0x2a')](_0x276a2b[_0x79f4('0x10')])){return logger[_0x79f4('0x1f')]('subtractUnit\x20null\x20or\x20undefined');}var _0x468df0={'startDate':moment()[_0x79f4('0x2b')](_0x276a2b[_0x79f4('0xf')],_0x276a2b[_0x79f4('0x10')])['format'](_0x79f4('0x2c')),'endDate':moment()[_0x79f4('0xc')](_0x79f4('0x2c')),'type':'scheduled','output':_0x276a2b[_0x79f4('0x2d')],'name':_0x276a2b['name']};if(!_[_0x79f4('0x2a')](_0x276a2b['DefaultReportId'])){logger[_0x79f4('0x1f')](_0x79f4('0x2e'),_0x276a2b['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x276a2b[_0x79f4('0x2f')]},_0x468df0)[_0x79f4('0x30')](handleResult(_0x276a2b))['catch'](handleError());}if(!_[_0x79f4('0x2a')](_0x276a2b[_0x79f4('0x31')])){logger[_0x79f4('0x1f')](_0x79f4('0x32'),_0x276a2b[_0x79f4('0x31')]);return analyticCustomReportController[_0x79f4('0x33')]({'id':_0x276a2b[_0x79f4('0x31')]},_0x468df0)[_0x79f4('0x30')](handleResult(_0x276a2b))[_0x79f4('0x34')](handleError());}}catch(_0x27c21e){logger[_0x79f4('0x23')](JSON[_0x79f4('0x25')](_0x27c21e));}return logger['info'](_0x79f4('0x35'));};}function getJobs(_0x1edf62){var _0x536d88={};if(_0x1edf62){_0x536d88['id']=_0x1edf62;}return db[_0x79f4('0x36')][_0x79f4('0x37')]({'where':_0x536d88,'include':[{'model':db[_0x79f4('0xa')],'attributes':['id',_0x79f4('0xd'),_0x79f4('0x9')],'include':[{'model':db[_0x79f4('0x38')],'as':_0x79f4('0x28'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]}]})[_0x79f4('0x30')](function(_0x3bd087){var _0xef3b71=_['keys'](manager['jobs']);var _0x13edca=_[_0x79f4('0x39')](_0x3bd087,function(_0x41db6a){return _0x41db6a['id'][_0x79f4('0x3a')]();});var _0xf22a1b=_['keyBy'](_0x3bd087,function(_0x6a7961){return _0x6a7961['id'][_0x79f4('0x3a')]();});var _0x99d35b=_0x1edf62?_0x13edca:_[_0x79f4('0x3b')](_0x13edca,_0xef3b71);var _0x6f9e22=_['intersection'](_0x13edca,_0xef3b71);var _0x3a5c47=_['difference'](_0xef3b71,_0x13edca);var _0x55a383;var _0x2b5061;for(_0x55a383=0x0;_0x55a383<_0x3a5c47['length']&&!_0x1edf62;_0x55a383+=0x1){_0x2b5061=_0x3a5c47[_0x55a383][_0x79f4('0x3a')]();if(manager['exists'](_0x2b5061)){manager[_0x79f4('0x3c')](_0x2b5061);manager['deleteJob'](_0x2b5061);logger['info'](_0x79f4('0x3d'),_0x2b5061);}}logger['info']('toRun',JSON[_0x79f4('0x25')](_0x99d35b));for(_0x55a383=0x0;_0x55a383<_0x99d35b['length'];_0x55a383+=0x1){_0x2b5061=_0x99d35b[_0x55a383][_0x79f4('0x3a')]();logger[_0x79f4('0x1f')](_0x79f4('0x3e'),_0x2b5061);if(_0x1edf62){logger[_0x79f4('0x1f')]('my\x20id',_0x1edf62);logger[_0x79f4('0x1f')](JSON[_0x79f4('0x25')](_0xf22a1b[_0x2b5061]));BPromise[_0x79f4('0x3f')]()[_0x79f4('0x30')](handleJob(_0xf22a1b[_0x2b5061]));logger[_0x79f4('0x1f')](_0x79f4('0x40'),_0xf22a1b[_0x2b5061][_0x79f4('0xd')],_0xf22a1b[_0x2b5061][_0x79f4('0x41')]);}else if(_0xf22a1b[_0x2b5061][_0x79f4('0x41')]&&_0xf22a1b[_0x2b5061][_0x79f4('0x42')]&&moment()[_0x79f4('0x43')](_0xf22a1b[_0x2b5061][_0x79f4('0x44')],_0xf22a1b[_0x2b5061][_0x79f4('0x45')])){manager[_0x79f4('0x46')](_0x2b5061,_0xf22a1b[_0x2b5061][_0x79f4('0x41')],handleJob(_0xf22a1b[_0x2b5061]));manager['start'](_0x2b5061);logger[_0x79f4('0x1f')]('add\x20cron',_0xf22a1b[_0x2b5061]['name'],_0xf22a1b[_0x2b5061][_0x79f4('0x41')]);}else if(manager[_0x79f4('0x47')](_0x2b5061)){manager[_0x79f4('0x3c')](_0x2b5061);manager[_0x79f4('0x48')](_0x2b5061);logger[_0x79f4('0x1f')](_0x79f4('0x49'),_0xf22a1b[_0x2b5061][_0x79f4('0xd')],_0xf22a1b[_0x2b5061][_0x79f4('0x41')]);}}for(_0x55a383=0x0,_0x2b5061;_0x55a383<_0x6f9e22[_0x79f4('0x4a')]&&!_0x1edf62;_0x55a383+=0x1){_0x2b5061=_0x6f9e22[_0x55a383][_0x79f4('0x3a')]();if(manager[_0x79f4('0x47')](_0x2b5061)){if(_0xf22a1b[_0x2b5061][_0x79f4('0x41')]&&_0xf22a1b[_0x2b5061]['active']&&moment()[_0x79f4('0x43')](_0xf22a1b[_0x2b5061][_0x79f4('0x44')],_0xf22a1b[_0x2b5061][_0x79f4('0x45')])){manager[_0x79f4('0x4b')](_0x2b5061,_0xf22a1b[_0x2b5061][_0x79f4('0x41')],handleJob(_0xf22a1b[_0x2b5061]));logger[_0x79f4('0x1f')](_0x79f4('0x4c'),_0xf22a1b[_0x2b5061]['name'],_0xf22a1b[_0x2b5061][_0x79f4('0x41')]);}else{manager['stop'](_0x2b5061);manager['deleteJob'](_0x2b5061);logger['info'](_0x79f4('0x49'),_0xf22a1b[_0x2b5061]['name'],_0xf22a1b[_0x2b5061][_0x79f4('0x41')]);}}}})[_0x79f4('0x34')](function(_0x394b70){logger[_0x79f4('0x23')](JSON[_0x79f4('0x25')](_0x394b70));});}exports['run']=function(_0x530054){return getJobs(_0x530054);};exports[_0x79f4('0x4d')]=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 efcae40..a68961b 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 _0xa958=['push','start','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','ValidationError','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','sentiment','Transcript\x20not\x20available','CloudProvider','findOne','Mixed','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa958,0x94));var _0x8a95=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xa958[_0x2dea24];return _0x309d58;};var _=require(_0x8a95('0x0'));var AWS=require('aws-sdk');var rp=require(_0x8a95('0x1'));var util=require(_0x8a95('0x2'));var BPromise=require(_0x8a95('0x3'));var db=require(_0x8a95('0x4'))['db'];var logger=require(_0x8a95('0x5'))(_0x8a95('0x6'));function getTranscriptionJob(_0x5f3024,_0x4db56d,_0x103d7a,_0xc65a39){return new Promise(function(_0x403364,_0x141f82){var _0x387db4=new AWS[(_0x8a95('0x7'))]({'accessKeyId':_0x4db56d,'secretAccessKey':_0x5f3024,'region':_0x103d7a});_0x387db4[_0x8a95('0x8')]({'TranscriptionJobName':_0xc65a39},function(_0x49287d,_0xe03b31){if(_0x49287d){return _0x141f82(_0x49287d);}else{return _0x403364(_0xe03b31);}});});}function sentiment(_0x1e5a06,_0x1f944c,_0x240b22,_0x16a20c,_0x20ad57){return new Promise(function(_0x1959de,_0x5c4947){var _0x27dfce=new AWS[(_0x8a95('0x9'))]({'accessKeyId':_0x1f944c,'secretAccessKey':_0x1e5a06,'region':_0x240b22});_0x27dfce['detectSentiment']({'Text':_0x16a20c,'LanguageCode':_0x20ad57[_0x8a95('0xa')](0x0,0x2)},function(_0x5bb2f2,_0x59b6d5){if(_0x5bb2f2){return _0x5c4947(_0x5bb2f2);}else{return _0x1959de(_0x59b6d5);}});});}function checkTranscribeJob(_0x108b6f,_0x4cb5a5,_0x2fdf66){var _0x1579cd;return new BPromise(function(_0x49439b,_0x3695a2){logger[_0x8a95('0xb')](util['format'](_0x8a95('0xc'),_0x108b6f['id'],_0x108b6f[_0x8a95('0xd')]));return getTranscriptionJob(_0x2fdf66[_0x8a95('0xe')],_0x2fdf66[_0x8a95('0xf')],_0x4cb5a5[_0x8a95('0x10')],_0x108b6f[_0x8a95('0xd')])[_0x8a95('0x11')](function(_0x52e3d9){logger[_0x8a95('0xb')](util['format'](_0x8a95('0x12'),_0x108b6f['id'],_0x108b6f['transcribeName'],_0x52e3d9[_0x8a95('0x13')][_0x8a95('0x14')]));if(!_0x108b6f[_0x8a95('0x15')]){switch(_0x52e3d9[_0x8a95('0x13')][_0x8a95('0x14')]){case _0x8a95('0x16'):var _0x3ce62a={'transcribeStatus':_0x52e3d9[_0x8a95('0x13')][_0x8a95('0x14')],'fileUri':_0x52e3d9[_0x8a95('0x13')][_0x8a95('0x17')][_0x8a95('0x18')]};logger[_0x8a95('0xb')](util[_0x8a95('0x19')](_0x8a95('0x1a'),_0x108b6f['id']));return rp({'uri':_0x52e3d9[_0x8a95('0x13')][_0x8a95('0x17')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x476c2c){logger[_0x8a95('0xb')](util[_0x8a95('0x19')](_0x8a95('0x1b'),_0x108b6f['id']));if(_0x476c2c&&_0x476c2c[_0x8a95('0x1c')]&&_0x476c2c[_0x8a95('0x1c')]['transcripts']&&_0x476c2c['results'][_0x8a95('0x1d')][_0x8a95('0x1e')]){_0x3ce62a[_0x8a95('0x15')]='';for(var _0x23130a=0x0;_0x23130a<_0x476c2c[_0x8a95('0x1c')][_0x8a95('0x1d')][_0x8a95('0x1e')];_0x23130a++){_0x3ce62a[_0x8a95('0x15')]+=_0x476c2c[_0x8a95('0x1c')][_0x8a95('0x1d')][_0x23130a]['transcript']+'';}}return _0x108b6f[_0x8a95('0x1f')](_0x3ce62a);})[_0x8a95('0x11')](function(){logger['info'](util[_0x8a95('0x19')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x108b6f['id']));if(!_0x108b6f['tempSentiment']){throw new db[(_0x8a95('0x20'))]['ValidationError'](_0x8a95('0x21'));}if(!_0x4cb5a5['sentiment']||!_0x4cb5a5[_0x8a95('0x22')]||!_0x4cb5a5[_0x8a95('0x23')]||!_0x4cb5a5[_0x8a95('0x24')]||!_0x4cb5a5[_0x8a95('0x25')]){throw new db[(_0x8a95('0x20'))]['ValidationError'](_0x8a95('0x26'));}if(!_0x3ce62a['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x4cb5a5[_0x8a95('0x22')]===_0x2fdf66['id']){return _0x2fdf66;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x8a95('0x22')]}});}})[_0x8a95('0x11')](function(_0x3fbad3){if(!_0x3fbad3){throw new db[(_0x8a95('0x20'))][(_0x8a95('0x27'))](_0x8a95('0x28'));}if(!_0x3fbad3[_0x8a95('0xe')]||!_0x3fbad3[_0x8a95('0xf')]){throw new db[(_0x8a95('0x20'))][(_0x8a95('0x27'))](_0x8a95('0x29'));}_0x1579cd=_0x3fbad3;logger[_0x8a95('0xb')](util[_0x8a95('0x19')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x108b6f['id']));return sentiment(_0x1579cd[_0x8a95('0xe')],_0x1579cd[_0x8a95('0xf')],_0x4cb5a5['sentimentRegion'],_0x3ce62a[_0x8a95('0x15')],_0x4cb5a5[_0x8a95('0x24')]);})[_0x8a95('0x11')](function(_0x5c8c85){logger[_0x8a95('0xb')](util[_0x8a95('0x19')](_0x8a95('0x2a'),_0x108b6f['id']));return _0x108b6f[_0x8a95('0x1f')]({'sentiment':_0x5c8c85[_0x8a95('0x2b')],'sPositive':_0x5c8c85[_0x8a95('0x2c')][_0x8a95('0x2d')],'sNegative':_0x5c8c85['SentimentScore'][_0x8a95('0x2e')],'sMixed':_0x5c8c85['SentimentScore']['Mixed'],'sNeutral':_0x5c8c85['SentimentScore']['Neutral']});})['then'](function(){logger['info'](util[_0x8a95('0x19')](_0x8a95('0x2f'),_0x108b6f['id']));_0x49439b();});case _0x8a95('0x30'):return _0x108b6f[_0x8a95('0x1f')]({'transcribeStatus':_0x8a95('0x30'),'failureReason':_0x52e3d9[_0x8a95('0x13')][_0x8a95('0x31')]})[_0x8a95('0x11')](function(){logger['info'](util[_0x8a95('0x19')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x108b6f['id']));_0x49439b();});default:logger[_0x8a95('0xb')](util[_0x8a95('0x19')](_0x8a95('0x32'),_0x108b6f['id']));break;}}else{return BPromise[_0x8a95('0x33')]()[_0x8a95('0x11')](function(){if(!_0x108b6f[_0x8a95('0x34')]){throw new db[(_0x8a95('0x20'))][(_0x8a95('0x27'))](_0x8a95('0x21'));}if(!_0x4cb5a5[_0x8a95('0x35')]||!_0x4cb5a5[_0x8a95('0x22')]||!_0x4cb5a5['sentimentRegion']||!_0x4cb5a5[_0x8a95('0x24')]||!_0x4cb5a5['bucket']){throw new db[(_0x8a95('0x20'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x108b6f[_0x8a95('0x15')]){throw new Error(_0x8a95('0x36'));}if(_0x4cb5a5[_0x8a95('0x22')]===_0x2fdf66['id']){return _0x2fdf66;}else{return db[_0x8a95('0x37')][_0x8a95('0x38')]({'where':{'id':_settings[_0x8a95('0x22')]}});}})['then'](function(_0xab4e60){if(!_0xab4e60){throw new db[(_0x8a95('0x20'))]['ValidationError'](_0x8a95('0x28'));}if(!_0xab4e60[_0x8a95('0xe')]||!_0xab4e60[_0x8a95('0xf')]){throw new db[(_0x8a95('0x20'))][(_0x8a95('0x27'))](_0x8a95('0x29'));}_0x1579cd=_0xab4e60;logger['info'](util[_0x8a95('0x19')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x108b6f['id']));return sentiment(_0x1579cd[_0x8a95('0xe')],_0x1579cd[_0x8a95('0xf')],_0x4cb5a5[_0x8a95('0x23')],_0x108b6f['fileText'],_0x4cb5a5[_0x8a95('0x24')]);})[_0x8a95('0x11')](function(_0x51d8f2){logger['info'](util[_0x8a95('0x19')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x108b6f['id']));return _0x108b6f[_0x8a95('0x1f')]({'sentiment':_0x51d8f2[_0x8a95('0x2b')],'sPositive':_0x51d8f2['SentimentScore'][_0x8a95('0x2d')],'sNegative':_0x51d8f2[_0x8a95('0x2c')][_0x8a95('0x2e')],'sMixed':_0x51d8f2[_0x8a95('0x2c')][_0x8a95('0x39')],'sNeutral':_0x51d8f2['SentimentScore']['Neutral'],'transcribeStatus':_0x8a95('0x16')});})['then'](function(){logger[_0x8a95('0xb')](util[_0x8a95('0x19')](_0x8a95('0x2f'),_0x108b6f['id']));_0x49439b();});}})[_0x8a95('0x3a')](function(_0x502294){if(_0x502294){if(!_0x502294[_0x8a95('0x3b')]||_0x502294[_0x8a95('0x3b')]!==_0x8a95('0x3c')){logger[_0x8a95('0x3d')](util[_0x8a95('0x19')](_0x8a95('0x3e'),_0x108b6f['id']),util[_0x8a95('0x3f')](_0x502294,{'showHidden':![],'depth':null}));}}_0x49439b();});});}function checkTranscribe(){var _0x7a794d;var _0x4dacc8;var _0x417212;return db['VoiceRecording'][_0x8a95('0x40')]({'where':{'transcribeStatus':_0x8a95('0x41')}})[_0x8a95('0x11')](function(_0x3b58a1){if(!_0x3b58a1||!_0x3b58a1['length']){throw new db['Sequelize'][(_0x8a95('0x27'))]('No\x20transcribe\x20job\x20to\x20check');}_0x7a794d=_0x3b58a1;return db[_0x8a95('0x42')][_0x8a95('0x38')]({'where':{'id':0x1}});})[_0x8a95('0x11')](function(_0x59470c){if(!_0x59470c){throw new db[(_0x8a95('0x20'))][(_0x8a95('0x27'))](_0x8a95('0x43'));}_0x4dacc8=_0x59470c;if(!_0x4dacc8[_0x8a95('0x6')]||!_0x4dacc8[_0x8a95('0x44')]||!_0x4dacc8[_0x8a95('0x10')]||!_0x4dacc8[_0x8a95('0x24')]||!_0x4dacc8[_0x8a95('0x25')]){throw new db[(_0x8a95('0x20'))]['ValidationError'](_0x8a95('0x45'));}return db[_0x8a95('0x37')][_0x8a95('0x38')]({'where':{'id':_0x4dacc8['transcribeAccountId']}});})[_0x8a95('0x11')](function(_0x3784c2){if(!_0x3784c2){throw new db[(_0x8a95('0x20'))]['ValidationError'](_0x8a95('0x28'));}if(!_0x3784c2[_0x8a95('0xe')]||!_0x3784c2[_0x8a95('0xf')]){throw new db['Sequelize'][(_0x8a95('0x27'))](_0x8a95('0x29'));}_0x417212=_0x3784c2;var _0x5307fb=[];_0x7a794d[_0x8a95('0x46')](function(_0x1e22e8){_0x5307fb[_0x8a95('0x47')](checkTranscribeJob(_0x1e22e8,_0x4dacc8,_0x417212));});return BPromise['all'](_0x5307fb);})[_0x8a95('0x3a')](function(_0x47bb7f){if(_0x47bb7f){if(!_0x47bb7f[_0x8a95('0x3b')]||_0x47bb7f[_0x8a95('0x3b')]!==_0x8a95('0x3c')){logger['error'](util[_0x8a95('0x3f')](_0x47bb7f,{'showHidden':![],'depth':null}));}}});}exports[_0x8a95('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xf2a6=['[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','results','transcripts','fileText','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','sentiment','sentimentAccountId','sentimentRegion','language','bucket','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','update','SentimentScore','Positive','Negative','Mixed','FAILED','FailureReason','resolve','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Neutral','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','start','lodash','bluebird','../../config/logger','transcribe','TranscribeService','detectSentiment','info','format'];(function(_0x2c24b8,_0x168e0b){var _0x563ed6=function(_0x7c1aa9){while(--_0x7c1aa9){_0x2c24b8['push'](_0x2c24b8['shift']());}};_0x563ed6(++_0x168e0b);}(_0xf2a6,0x13d));var _0x6f2a=function(_0x466b00,_0x378165){_0x466b00=_0x466b00-0x0;var _0x404427=_0xf2a6[_0x466b00];return _0x404427;};var _=require(_0x6f2a('0x0'));var AWS=require('aws-sdk');var rp=require('request-promise');var util=require('util');var BPromise=require(_0x6f2a('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x6f2a('0x2'))(_0x6f2a('0x3'));function getTranscriptionJob(_0x454ff7,_0x32ddb6,_0x1b4af5,_0x21a7db){return new Promise(function(_0x4684f4,_0x19ebe9){var _0x1efd8=new AWS[(_0x6f2a('0x4'))]({'accessKeyId':_0x32ddb6,'secretAccessKey':_0x454ff7,'region':_0x1b4af5});_0x1efd8['getTranscriptionJob']({'TranscriptionJobName':_0x21a7db},function(_0x379b80,_0xda4179){if(_0x379b80){return _0x19ebe9(_0x379b80);}else{return _0x4684f4(_0xda4179);}});});}function sentiment(_0x372663,_0x28ac69,_0x5b1229,_0x2fabc5,_0x5663e2){return new Promise(function(_0x310635,_0x601b21){var _0x396cb9=new AWS['Comprehend']({'accessKeyId':_0x28ac69,'secretAccessKey':_0x372663,'region':_0x5b1229});_0x396cb9[_0x6f2a('0x5')]({'Text':_0x2fabc5,'LanguageCode':_0x5663e2['substring'](0x0,0x2)},function(_0x231691,_0x398822){if(_0x231691){return _0x601b21(_0x231691);}else{return _0x310635(_0x398822);}});});}function checkTranscribeJob(_0x1c2665,_0x59df4e,_0x46a54f){var _0x4f1b32;return new BPromise(function(_0x1df919,_0x45eab9){logger[_0x6f2a('0x6')](util[_0x6f2a('0x7')](_0x6f2a('0x8'),_0x1c2665['id'],_0x1c2665['transcribeName']));return getTranscriptionJob(_0x46a54f[_0x6f2a('0x9')],_0x46a54f[_0x6f2a('0xa')],_0x59df4e[_0x6f2a('0xb')],_0x1c2665[_0x6f2a('0xc')])[_0x6f2a('0xd')](function(_0x3dfc44){logger[_0x6f2a('0x6')](util[_0x6f2a('0x7')](_0x6f2a('0xe'),_0x1c2665['id'],_0x1c2665[_0x6f2a('0xc')],_0x3dfc44[_0x6f2a('0xf')][_0x6f2a('0x10')]));if(!_0x1c2665['fileText']){switch(_0x3dfc44[_0x6f2a('0xf')][_0x6f2a('0x10')]){case _0x6f2a('0x11'):var _0x1ff155={'transcribeStatus':_0x3dfc44[_0x6f2a('0xf')][_0x6f2a('0x10')],'fileUri':_0x3dfc44[_0x6f2a('0xf')][_0x6f2a('0x12')][_0x6f2a('0x13')]};logger[_0x6f2a('0x6')](util[_0x6f2a('0x7')]('[RECORDING:%d]\x20Get\x20transcript',_0x1c2665['id']));return rp({'uri':_0x3dfc44[_0x6f2a('0xf')][_0x6f2a('0x12')][_0x6f2a('0x13')],'json':!![]})[_0x6f2a('0xd')](function(_0x1da29f){logger[_0x6f2a('0x6')](util[_0x6f2a('0x7')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x1c2665['id']));if(_0x1da29f&&_0x1da29f[_0x6f2a('0x14')]&&_0x1da29f['results'][_0x6f2a('0x15')]&&_0x1da29f[_0x6f2a('0x14')][_0x6f2a('0x15')]['length']){_0x1ff155[_0x6f2a('0x16')]='';for(var _0xb7cd00=0x0;_0xb7cd00<_0x1da29f['results']['transcripts'][_0x6f2a('0x17')];_0xb7cd00++){_0x1ff155[_0x6f2a('0x16')]+=_0x1da29f[_0x6f2a('0x14')][_0x6f2a('0x15')][_0xb7cd00][_0x6f2a('0x18')]+'';}}return _0x1c2665['update'](_0x1ff155);})[_0x6f2a('0xd')](function(){logger['info'](util[_0x6f2a('0x7')](_0x6f2a('0x19'),_0x1c2665['id']));if(!_0x1c2665['tempSentiment']){throw new db[(_0x6f2a('0x1a'))][(_0x6f2a('0x1b'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x59df4e[_0x6f2a('0x1c')]||!_0x59df4e[_0x6f2a('0x1d')]||!_0x59df4e[_0x6f2a('0x1e')]||!_0x59df4e[_0x6f2a('0x1f')]||!_0x59df4e[_0x6f2a('0x20')]){throw new db[(_0x6f2a('0x1a'))][(_0x6f2a('0x1b'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x1ff155[_0x6f2a('0x16')]){throw new Error('Transcript\x20not\x20available');}if(_0x59df4e[_0x6f2a('0x1d')]===_0x46a54f['id']){return _0x46a54f;}else{return db['CloudProvider'][_0x6f2a('0x21')]({'where':{'id':_settings[_0x6f2a('0x1d')]}});}})[_0x6f2a('0xd')](function(_0x53eb10){if(!_0x53eb10){throw new db[(_0x6f2a('0x1a'))]['ValidationError'](_0x6f2a('0x22'));}if(!_0x53eb10[_0x6f2a('0x9')]||!_0x53eb10['data2']){throw new db[(_0x6f2a('0x1a'))][(_0x6f2a('0x1b'))](_0x6f2a('0x23'));}_0x4f1b32=_0x53eb10;logger['info'](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1c2665['id']));return sentiment(_0x4f1b32[_0x6f2a('0x9')],_0x4f1b32['data2'],_0x59df4e[_0x6f2a('0x1e')],_0x1ff155[_0x6f2a('0x16')],_0x59df4e['language']);})[_0x6f2a('0xd')](function(_0x277e8f){logger[_0x6f2a('0x6')](util[_0x6f2a('0x7')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1c2665['id']));return _0x1c2665[_0x6f2a('0x24')]({'sentiment':_0x277e8f['Sentiment'],'sPositive':_0x277e8f[_0x6f2a('0x25')][_0x6f2a('0x26')],'sNegative':_0x277e8f[_0x6f2a('0x25')][_0x6f2a('0x27')],'sMixed':_0x277e8f[_0x6f2a('0x25')][_0x6f2a('0x28')],'sNeutral':_0x277e8f[_0x6f2a('0x25')]['Neutral']});})[_0x6f2a('0xd')](function(){logger[_0x6f2a('0x6')](util[_0x6f2a('0x7')](_0x6f2a('0x19'),_0x1c2665['id']));_0x1df919();});case _0x6f2a('0x29'):return _0x1c2665[_0x6f2a('0x24')]({'transcribeStatus':_0x6f2a('0x29'),'failureReason':_0x3dfc44[_0x6f2a('0xf')][_0x6f2a('0x2a')]})[_0x6f2a('0xd')](function(){logger[_0x6f2a('0x6')](util['format'](_0x6f2a('0x19'),_0x1c2665['id']));_0x1df919();});default:logger[_0x6f2a('0x6')](util[_0x6f2a('0x7')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1c2665['id']));break;}}else{return BPromise[_0x6f2a('0x2b')]()[_0x6f2a('0xd')](function(){if(!_0x1c2665[_0x6f2a('0x2c')]){throw new db[(_0x6f2a('0x1a'))][(_0x6f2a('0x1b'))](_0x6f2a('0x2d'));}if(!_0x59df4e[_0x6f2a('0x1c')]||!_0x59df4e[_0x6f2a('0x1d')]||!_0x59df4e[_0x6f2a('0x1e')]||!_0x59df4e[_0x6f2a('0x1f')]||!_0x59df4e[_0x6f2a('0x20')]){throw new db['Sequelize'][(_0x6f2a('0x1b'))](_0x6f2a('0x2e'));}if(!_0x1c2665[_0x6f2a('0x16')]){throw new Error('Transcript\x20not\x20available');}if(_0x59df4e[_0x6f2a('0x1d')]===_0x46a54f['id']){return _0x46a54f;}else{return db[_0x6f2a('0x2f')][_0x6f2a('0x21')]({'where':{'id':_settings[_0x6f2a('0x1d')]}});}})[_0x6f2a('0xd')](function(_0x2c5fbb){if(!_0x2c5fbb){throw new db[(_0x6f2a('0x1a'))][(_0x6f2a('0x1b'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2c5fbb[_0x6f2a('0x9')]||!_0x2c5fbb['data2']){throw new db['Sequelize'][(_0x6f2a('0x1b'))](_0x6f2a('0x23'));}_0x4f1b32=_0x2c5fbb;logger[_0x6f2a('0x6')](util[_0x6f2a('0x7')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1c2665['id']));return sentiment(_0x4f1b32[_0x6f2a('0x9')],_0x4f1b32[_0x6f2a('0xa')],_0x59df4e[_0x6f2a('0x1e')],_0x1c2665[_0x6f2a('0x16')],_0x59df4e[_0x6f2a('0x1f')]);})[_0x6f2a('0xd')](function(_0x47d221){logger[_0x6f2a('0x6')](util[_0x6f2a('0x7')](_0x6f2a('0x30'),_0x1c2665['id']));return _0x1c2665[_0x6f2a('0x24')]({'sentiment':_0x47d221[_0x6f2a('0x31')],'sPositive':_0x47d221[_0x6f2a('0x25')]['Positive'],'sNegative':_0x47d221['SentimentScore'][_0x6f2a('0x27')],'sMixed':_0x47d221['SentimentScore'][_0x6f2a('0x28')],'sNeutral':_0x47d221['SentimentScore'][_0x6f2a('0x32')],'transcribeStatus':_0x6f2a('0x11')});})['then'](function(){logger['info'](util['format'](_0x6f2a('0x19'),_0x1c2665['id']));_0x1df919();});}})['catch'](function(_0x4e726b){if(_0x4e726b){if(!_0x4e726b[_0x6f2a('0x33')]||_0x4e726b[_0x6f2a('0x33')]!==_0x6f2a('0x34')){logger[_0x6f2a('0x35')](util['format'](_0x6f2a('0x36'),_0x1c2665['id']),util[_0x6f2a('0x37')](_0x4e726b,{'showHidden':![],'depth':null}));}}_0x1df919();});});}function checkTranscribe(){var _0x254233;var _0x364573;var _0x3d8f60;return db[_0x6f2a('0x38')]['findAll']({'where':{'transcribeStatus':_0x6f2a('0x39')}})[_0x6f2a('0xd')](function(_0x2ae19b){if(!_0x2ae19b||!_0x2ae19b[_0x6f2a('0x17')]){throw new db[(_0x6f2a('0x1a'))][(_0x6f2a('0x1b'))]('No\x20transcribe\x20job\x20to\x20check');}_0x254233=_0x2ae19b;return db[_0x6f2a('0x3a')][_0x6f2a('0x21')]({'where':{'id':0x1}});})[_0x6f2a('0xd')](function(_0x5e72fe){if(!_0x5e72fe){throw new db['Sequelize'][(_0x6f2a('0x1b'))](_0x6f2a('0x3b'));}_0x364573=_0x5e72fe;if(!_0x364573[_0x6f2a('0x3')]||!_0x364573[_0x6f2a('0x3c')]||!_0x364573[_0x6f2a('0xb')]||!_0x364573[_0x6f2a('0x1f')]||!_0x364573[_0x6f2a('0x20')]){throw new db[(_0x6f2a('0x1a'))][(_0x6f2a('0x1b'))](_0x6f2a('0x3d'));}return db[_0x6f2a('0x2f')][_0x6f2a('0x21')]({'where':{'id':_0x364573[_0x6f2a('0x3c')]}});})['then'](function(_0x2c26fc){if(!_0x2c26fc){throw new db['Sequelize'][(_0x6f2a('0x1b'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2c26fc[_0x6f2a('0x9')]||!_0x2c26fc['data2']){throw new db[(_0x6f2a('0x1a'))][(_0x6f2a('0x1b'))](_0x6f2a('0x23'));}_0x3d8f60=_0x2c26fc;var _0x4a89a3=[];_0x254233[_0x6f2a('0x3e')](function(_0x5314a2){_0x4a89a3[_0x6f2a('0x3f')](checkTranscribeJob(_0x5314a2,_0x364573,_0x3d8f60));});return BPromise['all'](_0x4a89a3);})['catch'](function(_0x2e0078){if(_0x2e0078){if(!_0x2e0078[_0x6f2a('0x33')]||_0x2e0078[_0x6f2a('0x33')]!==_0x6f2a('0x34')){logger[_0x6f2a('0x35')](util[_0x6f2a('0x37')](_0x2e0078,{'showHidden':![],'depth':null}));}}});}exports[_0x6f2a('0x40')]=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 532d11b..2168952 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 _0xa269=['update','system','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','length','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','moment','util','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0xa5b7cf,_0x44b8cd){var _0x1d6587=function(_0x131f7f){while(--_0x131f7f){_0xa5b7cf['push'](_0xa5b7cf['shift']());}};_0x1d6587(++_0x44b8cd);}(_0xa269,0x14c));var _0x9a26=function(_0xf188a6,_0x5b1e21){_0xf188a6=_0xf188a6-0x0;var _0x505194=_0xa269[_0xf188a6];return _0x505194;};'use strict';var _=require('lodash');var moment=require(_0x9a26('0x0'));var Redis=require('ioredis');var util=require(_0x9a26('0x1'));var config=require(_0x9a26('0x2'));var db=require(_0x9a26('0x3'))['db'];var logger=require('../logger')('schedule');config[_0x9a26('0x4')]=_[_0x9a26('0x5')](config[_0x9a26('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9a26('0x6'))(new Redis(config[_0x9a26('0x4')]));function closeInteractions(){var _0x11d37b=[];return db[_0x9a26('0x7')][_0x9a26('0x8')]({'raw':!![],'attributes':['id',_0x9a26('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x9a26('0xa')](0x18,_0x9a26('0xb'))}}})[_0x9a26('0xc')](function(_0x4bed7b){if(_0x4bed7b&&_0x4bed7b['length']){_0x11d37b=_[_0x9a26('0xd')](_0x4bed7b||[],'id');logger[_0x9a26('0xe')](_0x9a26('0xf'),_0x11d37b['join']());return db['WhatsappInteraction'][_0x9a26('0x10')]({'closeReason':_0x9a26('0x11'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x9a26('0x12')](_0x9a26('0x13'))},{'where':{'id':_0x11d37b}});}})[_0x9a26('0xc')](function(){if(_0x11d37b&&_0x11d37b['length']){logger[_0x9a26('0xe')](_0x9a26('0x14'),_0x11d37b[_0x9a26('0x15')]());for(var _0x44be52=0x0;_0x44be52<_0x11d37b[_0x9a26('0x16')];_0x44be52++){io[_0x9a26('0x17')](_0x9a26('0x18'),{'id':_0x11d37b[_0x44be52],'closed':!![]});}}})[_0x9a26('0x19')](function(_0x4057bb){logger[_0x9a26('0x1a')](_0x9a26('0x1b'),_0x4057bb?util['inspect'](_0x4057bb,{'showHidden':![],'depth':null}):'');});}exports[_0x9a26('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x2fe5=['[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract','then','info','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','length','catch','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2fe5,0x1bd));var _0x52fe=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2fe5[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x52fe('0x0'));var moment=require(_0x52fe('0x1'));var Redis=require(_0x52fe('0x2'));var util=require(_0x52fe('0x3'));var config=require(_0x52fe('0x4'));var db=require(_0x52fe('0x5'))['db'];var logger=require(_0x52fe('0x6'))('schedule');config[_0x52fe('0x7')]=_['defaults'](config[_0x52fe('0x7')],{'host':_0x52fe('0x8'),'port':0x18eb});var io=require(_0x52fe('0x9'))(new Redis(config[_0x52fe('0x7')]));function closeInteractions(){var _0x2d10f5=[];return db[_0x52fe('0xa')][_0x52fe('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x52fe('0xc')](0x18,'hours')}}})[_0x52fe('0xd')](function(_0x1a0477){if(_0x1a0477&&_0x1a0477['length']){_0x2d10f5=_['map'](_0x1a0477||[],'id');logger[_0x52fe('0xe')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x2d10f5[_0x52fe('0xf')]());return db[_0x52fe('0xa')][_0x52fe('0x10')]({'closeReason':_0x52fe('0x11'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x52fe('0x12')](_0x52fe('0x13'))},{'where':{'id':_0x2d10f5}});}})[_0x52fe('0xd')](function(){if(_0x2d10f5&&_0x2d10f5[_0x52fe('0x14')]){logger[_0x52fe('0xe')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x2d10f5['join']());for(var _0x5d82f9=0x0;_0x5d82f9<_0x2d10f5['length'];_0x5d82f9++){io['emit']('whatsappInteraction:update',{'id':_0x2d10f5[_0x5d82f9],'closed':!![]});}}})[_0x52fe('0x15')](function(_0x419102){logger[_0x52fe('0x16')](_0x52fe('0x17'),_0x419102?util[_0x52fe('0x18')](_0x419102,{'showHidden':![],'depth':null}):'');});}exports[_0x52fe('0x19')]=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 e788255..acd5576 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcda=['destroy','then','bulkCreate','contacts1','CmHopper','finished\x20populating','hopper1','contacts2','hopper2','catch','log','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact'];(function(_0x558841,_0x3a2613){var _0x19ac6e=function(_0x383b57){while(--_0x383b57){_0x558841['push'](_0x558841['shift']());}};_0x19ac6e(++_0x3a2613);}(_0xbcda,0xe7));var _0xabcd=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xbcda[_0x3e112d];return _0x531c31;};'use strict';var util=require(_0xabcd('0x0'));var db=require(_0xabcd('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xabcd('0x2')]({'id':i,'firstName':_0xabcd('0x3')+i,'lastName':_0xabcd('0x4')+i,'phone':0xf879fb460+i,'email':_0xabcd('0x5')+i+_0xabcd('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xabcd('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xabcd('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xabcd('0x7')](),'updatedAt':Date[_0xabcd('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xabcd('0x3')+i,'lastName':_0xabcd('0x4')+i,'phone':0xf879fb460+i,'email':_0xabcd('0x5')+i+_0xabcd('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xabcd('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xabcd('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xabcd('0x7')](),'updatedAt':Date[_0xabcd('0x7')]()});}db[_0xabcd('0x8')][_0xabcd('0x9')]({'where':{}})[_0xabcd('0xa')](function(){return db['CmContact'][_0xabcd('0xb')](contacts);})[_0xabcd('0xa')](function(){console['log']('finished\x20populating',_0xabcd('0xc'));return db['CmHopper'][_0xabcd('0x9')]({'where':{}});})[_0xabcd('0xa')](function(){return db[_0xabcd('0xd')]['bulkCreate'](hopper);})['then'](function(){console['log'](_0xabcd('0xe'),_0xabcd('0xf'));return db['CmContact'][_0xabcd('0xb')](contacts2);})['then'](function(){console['log'](_0xabcd('0xe'),_0xabcd('0x10'));return db[_0xabcd('0xd')][_0xabcd('0xb')](hopper2);})[_0xabcd('0xa')](function(){console['log'](_0xabcd('0xe'),_0xabcd('0x11'));})[_0xabcd('0x12')](function(_0x33582f){console[_0xabcd('0x13')](_0x33582f);}); \ No newline at end of file +var _0x15a2=['destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','contacts2','hopper2','catch','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact'];(function(_0x26ce71,_0x18e803){var _0x20b38f=function(_0x40b5f4){while(--_0x40b5f4){_0x26ce71['push'](_0x26ce71['shift']());}};_0x20b38f(++_0x18e803);}(_0x15a2,0x102));var _0x215a=function(_0x32b8a9,_0x59d62b){_0x32b8a9=_0x32b8a9-0x0;var _0x40105c=_0x15a2[_0x32b8a9];return _0x40105c;};'use strict';var util=require('util');var db=require(_0x215a('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x215a('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x215a('0x2')+i,'phone':0xf879fb460+i,'email':_0x215a('0x3')+i+_0x215a('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x215a('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x215a('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x215a('0x6')+i,'lastName':_0x215a('0x2')+i,'phone':0xf879fb460+i,'email':_0x215a('0x3')+i+_0x215a('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x215a('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x215a('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x215a('0x5')](),'updatedAt':Date[_0x215a('0x5')]()});}db[_0x215a('0x7')][_0x215a('0x8')]({'where':{}})['then'](function(){return db[_0x215a('0x7')]['bulkCreate'](contacts);})[_0x215a('0x9')](function(){console[_0x215a('0xa')](_0x215a('0xb'),_0x215a('0xc'));return db[_0x215a('0xd')][_0x215a('0x8')]({'where':{}});})[_0x215a('0x9')](function(){return db['CmHopper'][_0x215a('0xe')](hopper);})[_0x215a('0x9')](function(){console['log'](_0x215a('0xb'),_0x215a('0xf'));return db['CmContact']['bulkCreate'](contacts2);})[_0x215a('0x9')](function(){console['log'](_0x215a('0xb'),_0x215a('0x10'));return db[_0x215a('0xd')][_0x215a('0xe')](hopper2);})[_0x215a('0x9')](function(){console[_0x215a('0xa')](_0x215a('0xb'),_0x215a('0x11'));})[_0x215a('0x12')](function(_0x9ac9d1){console[_0x215a('0xa')](_0x9ac9d1);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 01b8ea8..52ae040 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0aec=['format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0x0aec,0x184));var _0xc0ae=function(_0x479dd8,_0x4e3ab8){_0x479dd8=_0x479dd8-0x0;var _0x1f8d28=_0x0aec[_0x479dd8];return _0x1f8d28;};'use strict';var util=require(_0xc0ae('0x0'));var db=require(_0xc0ae('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc0ae('0x2')]({'name':util[_0xc0ae('0x3')](_0xc0ae('0x4'),_0xc0ae('0x5'),i),'fullname':util['format'](_0xc0ae('0x4'),_0xc0ae('0x5'),i),'email':util[_0xc0ae('0x3')](_0xc0ae('0x6'),_0xc0ae('0x5'),i),'role':'agent','password':_0xc0ae('0x7'),'internal':0xfa0+i,'type':_0xc0ae('0x8'),'transport':[_0xc0ae('0x9'),'ws',_0xc0ae('0xa')],'disallow':[_0xc0ae('0xb')],'allow':[_0xc0ae('0xc')],'defaultuser':util['format']('%s%s','agent',i),'encryption':_0xc0ae('0xd'),'avpf':_0xc0ae('0xd'),'force_avp':_0xc0ae('0xd'),'icesupport':_0xc0ae('0xd'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xc0ae('0xe'),'dtlsprivatekey':_0xc0ae('0xf'),'dtlssetup':'actpass','callerid':util[_0xc0ae('0x3')](_0xc0ae('0x10'),util[_0xc0ae('0x3')](_0xc0ae('0x4'),_0xc0ae('0x5'),i),0xfa0+i)});}db[_0xc0ae('0x11')][_0xc0ae('0x12')](users)[_0xc0ae('0x13')](function(){console[_0xc0ae('0x14')](_0xc0ae('0x15'));})[_0xc0ae('0x16')](function(_0x5da671){console['log'](_0x5da671);}); \ No newline at end of file +var _0xa968=['bulkCreate','then','log','catch','util','push','agent','%s%s','%s%s@xcally.com','password','format','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0xa968,0x147));var _0x8a96=function(_0x4612f3,_0x44006d){_0x4612f3=_0x4612f3-0x0;var _0x3999dd=_0xa968[_0x4612f3];return _0x3999dd;};'use strict';var util=require(_0x8a96('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x8a96('0x1')]({'name':util['format']('%s%s',_0x8a96('0x2'),i),'fullname':util['format'](_0x8a96('0x3'),'agent',i),'email':util['format'](_0x8a96('0x4'),_0x8a96('0x2'),i),'role':_0x8a96('0x2'),'password':_0x8a96('0x5'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws','wss'],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x8a96('0x6')](_0x8a96('0x3'),_0x8a96('0x2'),i),'encryption':_0x8a96('0x7'),'avpf':_0x8a96('0x7'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0x8a96('0x7'),'dtlsverify':'no','dtlscertfile':_0x8a96('0x8'),'dtlsprivatekey':_0x8a96('0x9'),'dtlssetup':_0x8a96('0xa'),'callerid':util[_0x8a96('0x6')](_0x8a96('0xb'),util[_0x8a96('0x6')](_0x8a96('0x3'),_0x8a96('0x2'),i),0xfa0+i)});}db[_0x8a96('0xc')][_0x8a96('0xd')](users)[_0x8a96('0xe')](function(){console[_0x8a96('0xf')]('add\x20user');})[_0x8a96('0x10')](function(_0xe7d53){console[_0x8a96('0xf')](_0xe7d53);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 24fd98b..f6f3185 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x151b=['hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','OpenchannelQueue','WhatsappQueue','user','voice:inbound','VoiceQueues','MailQueue','WhatsappQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','FaxInteractions','emit','removeSmsInteractions','user_has_sms_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','role','agent','type','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','map','resourceId','where','telephone','Campaign','format','%s:queue:%s','Agents','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteractions','admin','voice:outbound'];(function(_0x2a4a61,_0x3c3cae){var _0x308182=function(_0x5dd985){while(--_0x5dd985){_0x2a4a61['push'](_0x2a4a61['shift']());}};_0x308182(++_0x3c3cae);}(_0x151b,0x152));var _0xb151=function(_0x123b15,_0x503ac6){_0x123b15=_0x123b15-0x0;var _0x3724d3=_0x151b[_0x123b15];return _0x3724d3;};'use strict';var _=require(_0xb151('0x0'));var util=require(_0xb151('0x1'));var BPromise=require(_0xb151('0x2'));var db=require(_0xb151('0x3'))['db'];var config=require(_0xb151('0x4'));var queryQueues={'attributes':['id',_0xb151('0x5')],'include':[{'as':'Agents','model':db[_0xb151('0x6')],'attributes':['id','name',_0xb151('0x7')],'raw':!![],'where':{'role':_0xb151('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xb151('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xb151('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xb151('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xb151('0x5'),_0xb151('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x51e8fe,_0x2d38a3,_0x492e76){return db[_0xb151('0xa')][_0xb151('0xb')]({'where':{'name':_0x51e8fe,'userProfileId':_0x2d38a3},'raw':!![]})[_0xb151('0xc')](function(_0x2421a7){if(_0x2421a7){if(_0x2421a7[_0xb151('0xd')]){switch(_0x51e8fe){case'VoiceQueues':case _0xb151('0xe'):case _0xb151('0xf'):case _0xb151('0x10'):case _0xb151('0x11'):case _0xb151('0x12'):case'WhatsappQueues':return db[_0x492e76][_0xb151('0x13')](queryQueues);case _0xb151('0x14'):return db[_0x492e76]['findAll'](queryTelephones);case _0xb151('0x15'):return db[_0x492e76][_0xb151('0x13')](queryTrunks);case _0xb151('0x16'):return db[_0x492e76]['findAll'](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x2421a7['id']},'raw':!![]})[_0xb151('0xc')](function(_0x352834){if(_0x352834){var _0xe73c36={'where':{'id':_[_0xb151('0x17')](_0x352834,_0xb151('0x18'))},'raw':!![]};switch(_0x492e76){case'User':_0xe73c36[_0xb151('0x19')][_0xb151('0x7')]=_0xb151('0x1a');break;case _0xb151('0x1b'):_0xe73c36[_0xb151('0x19')][_0xb151('0x9')]='ivr';break;}return db[_0x492e76][_0xb151('0x13')](_0xe73c36);}else{return[];}});}}else{return[];}})[_0xb151('0xc')](function(_0x5aa911){return _0x5aa911;});}function joinOrLeaveQueues(_0x265b69,_0x2916a1,_0x49d160,_0x30beb4){_0x265b69[_0x2916a1](util[_0xb151('0x1c')](_0xb151('0x1d'),_0x49d160,_0x30beb4[_0xb151('0x5')]));if(_0x30beb4[_0xb151('0x1e')]){for(var _0x3392cb=0x0;_0x3392cb<_0x30beb4[_0xb151('0x1e')]['length'];_0x3392cb+=0x1){_0x265b69[_0x2916a1](util[_0xb151('0x1c')](_0xb151('0x1f'),_0x30beb4['Agents'][_0x3392cb]['name']));}}}function joinOrLeave(_0x1feb70,_0x2dee53,_0x47bac0){var _0x2ccf8a;if(_0x1feb70[_0xb151('0x20')][_0xb151('0x21')]['id']){db['User'][_0xb151('0x22')]({'attributes':['id',_0xb151('0x5'),_0xb151('0x7'),_0xb151('0x23')],'where':{'id':_0x1feb70[_0xb151('0x20')][_0xb151('0x21')]['id']},'include':[{'model':db[_0xb151('0x24')],'as':_0xb151('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xb151('0x26')],'as':_0xb151('0x27'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb151('0x28')],'as':_0xb151('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xb151('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xb151('0x2b'),'attributes':['id'],'raw':!![]}]})['then'](function(_0xa177ba){if(_0xa177ba){_0x2ccf8a=_0xa177ba;_0x1feb70[_0x2dee53](util[_0xb151('0x1c')]('user:%s',_0xa177ba[_0xb151('0x5')]));var _0x505f6a=[];switch(_0xa177ba[_0xb151('0x7')]){case _0xb151('0x2c'):_0x1feb70[_0x2dee53]('voice:inbound');_0x1feb70[_0x2dee53](_0xb151('0x2d'));if(queryQueues[_0xb151('0x2e')](_0xb151('0x2f'))){delete queryQueues[_0xb151('0x2f')];}_0x505f6a['push'](db[_0xb151('0x30')][_0xb151('0x13')](queryQueues));_0x505f6a[_0xb151('0x31')](db[_0xb151('0x32')][_0xb151('0x13')](queryQueues));_0x505f6a[_0xb151('0x31')](db[_0xb151('0x33')][_0xb151('0x13')](queryQueues));_0x505f6a[_0xb151('0x31')](db['SmsQueue'][_0xb151('0x13')](queryQueues));_0x505f6a[_0xb151('0x31')](db['MailQueue'][_0xb151('0x13')](queryQueues));_0x505f6a['push'](db[_0xb151('0x34')][_0xb151('0x13')](queryQueues));_0x505f6a[_0xb151('0x31')](db[_0xb151('0x35')]['findAll'](queryQueues));_0x505f6a[_0xb151('0x31')](db[_0xb151('0x6')]['findAll'](queryTelephones));_0x505f6a[_0xb151('0x31')](db['Trunk'][_0xb151('0x13')](queryTrunks));_0x505f6a['push'](db[_0xb151('0x1b')][_0xb151('0x13')](queryCampaigns));_0x505f6a[_0xb151('0x31')](db[_0xb151('0x6')][_0xb151('0x13')](queryAgents));break;case _0xb151('0x36'):_0x1feb70[_0x2dee53](_0xb151('0x37'));_0x1feb70[_0x2dee53]('voice:outbound');_0x505f6a[_0xb151('0x31')](getAssociatedResources(_0xb151('0x38'),_0xa177ba[_0xb151('0x23')],'VoiceQueue'));_0x505f6a[_0xb151('0x31')](getAssociatedResources('ChatQueues',_0xa177ba[_0xb151('0x23')],_0xb151('0x32')));_0x505f6a['push'](getAssociatedResources(_0xb151('0xf'),_0xa177ba[_0xb151('0x23')],_0xb151('0x33')));_0x505f6a[_0xb151('0x31')](getAssociatedResources('SmsQueues',_0xa177ba[_0xb151('0x23')],'SmsQueue'));_0x505f6a['push'](getAssociatedResources(_0xb151('0x11'),_0xa177ba[_0xb151('0x23')],_0xb151('0x39')));_0x505f6a[_0xb151('0x31')](getAssociatedResources('OpenchannelQueues',_0xa177ba[_0xb151('0x23')],_0xb151('0x34')));_0x505f6a[_0xb151('0x31')](getAssociatedResources(_0xb151('0x3a'),_0xa177ba[_0xb151('0x23')],_0xb151('0x35')));_0x505f6a[_0xb151('0x31')](getAssociatedResources(_0xb151('0x14'),_0xa177ba[_0xb151('0x23')],_0xb151('0x6')));_0x505f6a[_0xb151('0x31')](getAssociatedResources(_0xb151('0x15'),_0xa177ba['userProfileId'],'Trunk'));_0x505f6a['push'](getAssociatedResources(_0xb151('0x16'),_0xa177ba[_0xb151('0x23')],_0xb151('0x1b')));_0x505f6a[_0xb151('0x31')](db[_0xb151('0x6')][_0xb151('0x13')](queryAgents));break;case _0xb151('0x8'):_0x1feb70[_0x2dee53](_0xb151('0x37'));_0x1feb70[_0x2dee53](_0xb151('0x2d'));_0x505f6a[_0xb151('0x31')](_0xa177ba['getVoiceQueues']({'attributes':['id',_0xb151('0x5')]}));_0x505f6a[_0xb151('0x31')](_0xa177ba[_0xb151('0x3b')]({'attributes':['id',_0xb151('0x5')]}));_0x505f6a[_0xb151('0x31')](_0xa177ba[_0xb151('0x3c')]({'attributes':['id',_0xb151('0x5')]}));_0x505f6a[_0xb151('0x31')](_0xa177ba[_0xb151('0x3d')]({'attributes':['id',_0xb151('0x5')]}));_0x505f6a['push'](_0xa177ba[_0xb151('0x3e')]({'attributes':['id',_0xb151('0x5')]}));_0x505f6a[_0xb151('0x31')](_0xa177ba[_0xb151('0x3f')]({'attributes':['id',_0xb151('0x5')]}));_0x505f6a[_0xb151('0x31')](_0xa177ba['getWhatsappQueues']({'attributes':['id',_0xb151('0x5')]}));break;}return BPromise[_0xb151('0x40')](_0x505f6a);}})[_0xb151('0xc')](function(_0x218ecf){if(_0x218ecf&&_0x218ecf[_0xb151('0x41')]){for(var _0x4a74dd=0x0;_0x4a74dd<_0x218ecf[_0xb151('0x41')];_0x4a74dd+=0x1){for(var _0x1fef7a=0x0;_0x1fef7a<_0x218ecf[_0x4a74dd]['length'];_0x1fef7a+=0x1){switch(_0x4a74dd){case 0x0:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x42'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x1:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x43'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x2:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x44'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x3:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x45'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x4:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x46'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x5:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x47'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x6:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x48'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x7:if(_0x2ccf8a[_0xb151('0x7')]!==_0xb151('0x8'))_0x1feb70[_0x2dee53](util[_0xb151('0x1c')]('telephone:%s',_0x218ecf[_0x4a74dd][_0x1fef7a][_0xb151('0x5')]));break;case 0x8:if(_0x2ccf8a[_0xb151('0x7')]!==_0xb151('0x8'))_0x1feb70[_0x2dee53](util[_0xb151('0x1c')](_0xb151('0x49'),_0x218ecf[_0x4a74dd][_0x1fef7a][_0xb151('0x5')]));break;case 0x9:if(_0x2ccf8a[_0xb151('0x7')]!==_0xb151('0x8'))_0x1feb70[_0x2dee53](util[_0xb151('0x1c')](_0xb151('0x4a'),_0x218ecf[_0x4a74dd][_0x1fef7a][_0xb151('0x9')],_0x218ecf[_0x4a74dd][_0x1fef7a][_0xb151('0x5')]));break;case 0xa:_0x1feb70[_0x2dee53](util[_0xb151('0x1c')](_0xb151('0x1f'),_0x218ecf[_0x4a74dd][_0x1fef7a][_0xb151('0x5')]));break;}}}}})[_0xb151('0xc')](function(){if(_0x2dee53===_0xb151('0x4b')){var _0x3be19a=_[_0xb151('0x17')](_0x2ccf8a[_0xb151('0x25')],'id');return _0x2ccf8a[_0xb151('0x4c')](_0x3be19a)[_0xb151('0xc')](function(){for(var _0x27abb1=0x0;_0x27abb1<_0x3be19a['length'];_0x27abb1+=0x1){_0x47bac0['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x3be19a[_0x27abb1]),'UserId':Number(_0x2ccf8a['id'])});}});}})[_0xb151('0xc')](function(){if(_0x2dee53===_0xb151('0x4b')){var _0x28cd10=_[_0xb151('0x17')](_0x2ccf8a[_0xb151('0x27')],'id');return _0x2ccf8a['removeMailInteractions'](_0x28cd10)[_0xb151('0xc')](function(){for(var _0x5c4dd0=0x0;_0x5c4dd0<_0x28cd10[_0xb151('0x41')];_0x5c4dd0+=0x1){_0x47bac0['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x28cd10[_0x5c4dd0]),'UserId':Number(_0x2ccf8a['id'])});}});}})[_0xb151('0xc')](function(){if(_0x2dee53===_0xb151('0x4b')){var _0x4759bd=_[_0xb151('0x17')](_0x2ccf8a[_0xb151('0x4d')],'id');return _0x2ccf8a['removeFaxInteractions'](_0x4759bd)[_0xb151('0xc')](function(){for(var _0x28e1f=0x0;_0x28e1f<_0x4759bd[_0xb151('0x41')];_0x28e1f+=0x1){_0x47bac0[_0xb151('0x4e')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x4759bd[_0x28e1f]),'UserId':Number(_0x2ccf8a['id'])});}});}})[_0xb151('0xc')](function(){if(_0x2dee53===_0xb151('0x4b')){var _0xf8f0fe=_['map'](_0x2ccf8a[_0xb151('0x29')],'id');return _0x2ccf8a[_0xb151('0x4f')](_0xf8f0fe)[_0xb151('0xc')](function(){for(var _0x1dabd1=0x0;_0x1dabd1<_0xf8f0fe[_0xb151('0x41')];_0x1dabd1+=0x1){_0x47bac0[_0xb151('0x4e')](_0xb151('0x50'),{'SmsInteractionId':Number(_0xf8f0fe[_0x1dabd1]),'UserId':Number(_0x2ccf8a['id'])});}});}})[_0xb151('0xc')](function(){if(_0x2dee53==='leave'){var _0x363120=_['map'](_0x2ccf8a['OpenchannelInteractions'],'id');return _0x2ccf8a['removeOpenchannelInteractions'](_0x363120)[_0xb151('0xc')](function(){for(var _0x4f1cb5=0x0;_0x4f1cb5<_0x363120[_0xb151('0x41')];_0x4f1cb5+=0x1){_0x47bac0[_0xb151('0x4e')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x363120[_0x4f1cb5]),'UserId':Number(_0x2ccf8a['id'])});}});}})[_0xb151('0xc')](function(){if(_0x2dee53===_0xb151('0x4b')){var _0x2135bf=_[_0xb151('0x17')](_0x2ccf8a[_0xb151('0x2b')],'id');return _0x2ccf8a[_0xb151('0x51')](_0x2135bf)[_0xb151('0xc')](function(){for(var _0x5e2c08=0x0;_0x5e2c08<_0x2135bf[_0xb151('0x41')];_0x5e2c08+=0x1){_0x47bac0[_0xb151('0x4e')](_0xb151('0x52'),{'WhatsappInteractionId':Number(_0x2135bf[_0x5e2c08]),'UserId':Number(_0x2ccf8a['id'])});}});}})[_0xb151('0x53')](function(_0x43fe04){_0x1feb70[_0xb151('0x54')](_0x43fe04);});}}function onDisconnect(_0x5a3bd2,_0x44b6ee){joinOrLeave(_0x5a3bd2,_0xb151('0x4b'),_0x44b6ee);}function onConnect(_0x565841){joinOrLeave(_0x565841,_0xb151('0x55'));}exports[_0xb151('0x56')]=function(_0x2c552c){_0x2c552c['on']('connection',function(_0x483487){_0x483487[_0xb151('0x57')](0x0);_0x483487[_0xb151('0x58')]=_0x483487[_0xb151('0x59')][_0xb151('0x5a')][_0xb151('0x5b')]+':'+_0x483487['request'][_0xb151('0x5a')][_0xb151('0x5c')];_0x483487[_0xb151('0x5d')]=new Date();_0x483487[_0xb151('0x54')]=function(_0x58f0a7){console['log']('SocketIO\x20'+_0x483487['nsp'][_0xb151('0x5')]+'['+_0x483487['address']+']',_0x58f0a7);};_0x483487['on'](_0xb151('0x5e'),function(){onDisconnect(_0x483487,_0x2c552c);_0x483487['log']('DISCONNECTED');});onConnect(_0x483487);_0x483487[_0xb151('0x54')](_0xb151('0x5f'));});}; \ No newline at end of file +var _0x1d91=['getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','openchannel','telephone:%s','trunk:%s','map','ChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','address','request','connection','remoteAddress','remotePort','connectedAt','nsp','disconnect','lodash','util','bluebird','./environment','name','Agents','User','role','agent','type','ivr','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','resourceId','then','where','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','query','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteractions','voice:inbound','include','push','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','Campaign','user','ChatQueue','SmsQueues','OpenchannelQueues','OpenchannelQueue','Telephones','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x1d91,0x150));var _0x11d9=function(_0x2189fd,_0x55e28e){_0x2189fd=_0x2189fd-0x0;var _0xb78e30=_0x1d91[_0x2189fd];return _0xb78e30;};'use strict';var _=require(_0x11d9('0x0'));var util=require(_0x11d9('0x1'));var BPromise=require(_0x11d9('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x11d9('0x3'));var queryQueues={'attributes':['id',_0x11d9('0x4')],'include':[{'as':_0x11d9('0x5'),'model':db[_0x11d9('0x6')],'attributes':['id','name',_0x11d9('0x7')],'raw':!![],'where':{'role':_0x11d9('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x11d9('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x11d9('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x11d9('0x4'),_0x11d9('0x9')],'where':{'type':_0x11d9('0xa')}};function getAssociatedResources(_0x7a8c60,_0x5c6160,_0x311490){return db['UserProfileSection'][_0x11d9('0xb')]({'where':{'name':_0x7a8c60,'userProfileId':_0x5c6160},'raw':!![]})['then'](function(_0xd0ce63){if(_0xd0ce63){if(_0xd0ce63[_0x11d9('0xc')]){switch(_0x7a8c60){case _0x11d9('0xd'):case _0x11d9('0xe'):case _0x11d9('0xf'):case'SmsQueues':case _0x11d9('0x10'):case'OpenchannelQueues':case _0x11d9('0x11'):return db[_0x311490][_0x11d9('0x12')](queryQueues);case'Telephones':return db[_0x311490][_0x11d9('0x12')](queryTelephones);case _0x11d9('0x13'):return db[_0x311490][_0x11d9('0x12')](queryTrunks);case _0x11d9('0x14'):return db[_0x311490]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x11d9('0x12')]({'attributes':[_0x11d9('0x15')],'where':{'sectionId':_0xd0ce63['id']},'raw':!![]})[_0x11d9('0x16')](function(_0x1818e6){if(_0x1818e6){var _0x550459={'where':{'id':_['map'](_0x1818e6,'resourceId')},'raw':!![]};switch(_0x311490){case'User':_0x550459[_0x11d9('0x17')][_0x11d9('0x7')]='telephone';break;case'Campaign':_0x550459[_0x11d9('0x17')]['type']=_0x11d9('0xa');break;}return db[_0x311490]['findAll'](_0x550459);}else{return[];}});}}else{return[];}})['then'](function(_0x1a58e8){return _0x1a58e8;});}function joinOrLeaveQueues(_0x363fa6,_0xba808b,_0x42a637,_0x5371b6){_0x363fa6[_0xba808b](util[_0x11d9('0x18')](_0x11d9('0x19'),_0x42a637,_0x5371b6['name']));if(_0x5371b6['Agents']){for(var _0xf60d74=0x0;_0xf60d74<_0x5371b6[_0x11d9('0x5')][_0x11d9('0x1a')];_0xf60d74+=0x1){_0x363fa6[_0xba808b](util['format'](_0x11d9('0x1b'),_0x5371b6[_0x11d9('0x5')][_0xf60d74][_0x11d9('0x4')]));}}}function joinOrLeave(_0x35e7bf,_0x2d6956,_0x3ec49a){var _0x2b404a;if(_0x35e7bf[_0x11d9('0x1c')]['query']['id']){db[_0x11d9('0x6')][_0x11d9('0x1d')]({'attributes':['id','name',_0x11d9('0x7'),_0x11d9('0x1e')],'where':{'id':_0x35e7bf[_0x11d9('0x1c')][_0x11d9('0x1f')]['id']},'include':[{'model':db[_0x11d9('0x20')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x11d9('0x21')],'as':_0x11d9('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x11d9('0x23')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x11d9('0x24')],'as':_0x11d9('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x11d9('0x26')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x11d9('0x27'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x372ee4){if(_0x372ee4){_0x2b404a=_0x372ee4;_0x35e7bf[_0x2d6956](util[_0x11d9('0x18')]('user:%s',_0x372ee4[_0x11d9('0x4')]));var _0x44f163=[];switch(_0x372ee4[_0x11d9('0x7')]){case'admin':_0x35e7bf[_0x2d6956](_0x11d9('0x28'));_0x35e7bf[_0x2d6956]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x11d9('0x29'))){delete queryQueues['include'];}_0x44f163[_0x11d9('0x2a')](db['VoiceQueue'][_0x11d9('0x12')](queryQueues));_0x44f163[_0x11d9('0x2a')](db['ChatQueue'][_0x11d9('0x12')](queryQueues));_0x44f163['push'](db[_0x11d9('0x2b')]['findAll'](queryQueues));_0x44f163[_0x11d9('0x2a')](db[_0x11d9('0x2c')][_0x11d9('0x12')](queryQueues));_0x44f163[_0x11d9('0x2a')](db[_0x11d9('0x2d')][_0x11d9('0x12')](queryQueues));_0x44f163[_0x11d9('0x2a')](db['OpenchannelQueue']['findAll'](queryQueues));_0x44f163[_0x11d9('0x2a')](db[_0x11d9('0x2e')][_0x11d9('0x12')](queryQueues));_0x44f163[_0x11d9('0x2a')](db[_0x11d9('0x6')][_0x11d9('0x12')](queryTelephones));_0x44f163['push'](db[_0x11d9('0x2f')][_0x11d9('0x12')](queryTrunks));_0x44f163['push'](db[_0x11d9('0x30')][_0x11d9('0x12')](queryCampaigns));_0x44f163[_0x11d9('0x2a')](db[_0x11d9('0x6')]['findAll'](queryAgents));break;case _0x11d9('0x31'):_0x35e7bf[_0x2d6956]('voice:inbound');_0x35e7bf[_0x2d6956]('voice:outbound');_0x44f163[_0x11d9('0x2a')](getAssociatedResources(_0x11d9('0xd'),_0x372ee4[_0x11d9('0x1e')],'VoiceQueue'));_0x44f163['push'](getAssociatedResources(_0x11d9('0xe'),_0x372ee4[_0x11d9('0x1e')],_0x11d9('0x32')));_0x44f163['push'](getAssociatedResources(_0x11d9('0xf'),_0x372ee4[_0x11d9('0x1e')],_0x11d9('0x2b')));_0x44f163[_0x11d9('0x2a')](getAssociatedResources(_0x11d9('0x33'),_0x372ee4[_0x11d9('0x1e')],_0x11d9('0x2c')));_0x44f163[_0x11d9('0x2a')](getAssociatedResources('MailQueues',_0x372ee4['userProfileId'],_0x11d9('0x2d')));_0x44f163[_0x11d9('0x2a')](getAssociatedResources(_0x11d9('0x34'),_0x372ee4['userProfileId'],_0x11d9('0x35')));_0x44f163[_0x11d9('0x2a')](getAssociatedResources(_0x11d9('0x11'),_0x372ee4[_0x11d9('0x1e')],_0x11d9('0x2e')));_0x44f163['push'](getAssociatedResources(_0x11d9('0x36'),_0x372ee4['userProfileId'],_0x11d9('0x6')));_0x44f163[_0x11d9('0x2a')](getAssociatedResources('Trunks',_0x372ee4['userProfileId'],'Trunk'));_0x44f163[_0x11d9('0x2a')](getAssociatedResources(_0x11d9('0x14'),_0x372ee4[_0x11d9('0x1e')],_0x11d9('0x30')));_0x44f163['push'](db[_0x11d9('0x6')][_0x11d9('0x12')](queryAgents));break;case _0x11d9('0x8'):_0x35e7bf[_0x2d6956](_0x11d9('0x28'));_0x35e7bf[_0x2d6956]('voice:outbound');_0x44f163[_0x11d9('0x2a')](_0x372ee4[_0x11d9('0x37')]({'attributes':['id',_0x11d9('0x4')]}));_0x44f163['push'](_0x372ee4[_0x11d9('0x38')]({'attributes':['id',_0x11d9('0x4')]}));_0x44f163[_0x11d9('0x2a')](_0x372ee4[_0x11d9('0x39')]({'attributes':['id',_0x11d9('0x4')]}));_0x44f163[_0x11d9('0x2a')](_0x372ee4[_0x11d9('0x3a')]({'attributes':['id',_0x11d9('0x4')]}));_0x44f163[_0x11d9('0x2a')](_0x372ee4[_0x11d9('0x3b')]({'attributes':['id',_0x11d9('0x4')]}));_0x44f163['push'](_0x372ee4[_0x11d9('0x3c')]({'attributes':['id',_0x11d9('0x4')]}));_0x44f163[_0x11d9('0x2a')](_0x372ee4[_0x11d9('0x3d')]({'attributes':['id',_0x11d9('0x4')]}));break;}return BPromise[_0x11d9('0x3e')](_0x44f163);}})[_0x11d9('0x16')](function(_0x5e2bd5){if(_0x5e2bd5&&_0x5e2bd5[_0x11d9('0x1a')]){for(var _0x579026=0x0;_0x579026<_0x5e2bd5[_0x11d9('0x1a')];_0x579026+=0x1){for(var _0x3bacbe=0x0;_0x3bacbe<_0x5e2bd5[_0x579026][_0x11d9('0x1a')];_0x3bacbe+=0x1){switch(_0x579026){case 0x0:joinOrLeaveQueues(_0x35e7bf,_0x2d6956,_0x11d9('0x3f'),_0x5e2bd5[_0x579026][_0x3bacbe]);break;case 0x1:joinOrLeaveQueues(_0x35e7bf,_0x2d6956,_0x11d9('0x40'),_0x5e2bd5[_0x579026][_0x3bacbe]);break;case 0x2:joinOrLeaveQueues(_0x35e7bf,_0x2d6956,_0x11d9('0x41'),_0x5e2bd5[_0x579026][_0x3bacbe]);break;case 0x3:joinOrLeaveQueues(_0x35e7bf,_0x2d6956,_0x11d9('0x42'),_0x5e2bd5[_0x579026][_0x3bacbe]);break;case 0x4:joinOrLeaveQueues(_0x35e7bf,_0x2d6956,'mail',_0x5e2bd5[_0x579026][_0x3bacbe]);break;case 0x5:joinOrLeaveQueues(_0x35e7bf,_0x2d6956,_0x11d9('0x43'),_0x5e2bd5[_0x579026][_0x3bacbe]);break;case 0x6:joinOrLeaveQueues(_0x35e7bf,_0x2d6956,'whatsapp',_0x5e2bd5[_0x579026][_0x3bacbe]);break;case 0x7:if(_0x2b404a[_0x11d9('0x7')]!==_0x11d9('0x8'))_0x35e7bf[_0x2d6956](util[_0x11d9('0x18')](_0x11d9('0x44'),_0x5e2bd5[_0x579026][_0x3bacbe][_0x11d9('0x4')]));break;case 0x8:if(_0x2b404a[_0x11d9('0x7')]!==_0x11d9('0x8'))_0x35e7bf[_0x2d6956](util[_0x11d9('0x18')](_0x11d9('0x45'),_0x5e2bd5[_0x579026][_0x3bacbe]['name']));break;case 0x9:if(_0x2b404a[_0x11d9('0x7')]!=='agent')_0x35e7bf[_0x2d6956](util['format']('campaign:%s:%s',_0x5e2bd5[_0x579026][_0x3bacbe][_0x11d9('0x9')],_0x5e2bd5[_0x579026][_0x3bacbe][_0x11d9('0x4')]));break;case 0xa:_0x35e7bf[_0x2d6956](util[_0x11d9('0x18')]('user:%s',_0x5e2bd5[_0x579026][_0x3bacbe][_0x11d9('0x4')]));break;}}}}})[_0x11d9('0x16')](function(){if(_0x2d6956==='leave'){var _0xe4610=_[_0x11d9('0x46')](_0x2b404a[_0x11d9('0x47')],'id');return _0x2b404a['removeChatInteractions'](_0xe4610)[_0x11d9('0x16')](function(){for(var _0x240882=0x0;_0x240882<_0xe4610[_0x11d9('0x1a')];_0x240882+=0x1){_0x3ec49a[_0x11d9('0x48')](_0x11d9('0x49'),{'ChatInteractionId':Number(_0xe4610[_0x240882]),'UserId':Number(_0x2b404a['id'])});}});}})['then'](function(){if(_0x2d6956===_0x11d9('0x4a')){var _0x51da9f=_[_0x11d9('0x46')](_0x2b404a[_0x11d9('0x22')],'id');return _0x2b404a[_0x11d9('0x4b')](_0x51da9f)['then'](function(){for(var _0xd45b9=0x0;_0xd45b9<_0x51da9f[_0x11d9('0x1a')];_0xd45b9+=0x1){_0x3ec49a[_0x11d9('0x48')](_0x11d9('0x4c'),{'MailInteractionId':Number(_0x51da9f[_0xd45b9]),'UserId':Number(_0x2b404a['id'])});}});}})[_0x11d9('0x16')](function(){if(_0x2d6956==='leave'){var _0x1d0c70=_['map'](_0x2b404a[_0x11d9('0x4d')],'id');return _0x2b404a[_0x11d9('0x4e')](_0x1d0c70)[_0x11d9('0x16')](function(){for(var _0xb4eef2=0x0;_0xb4eef2<_0x1d0c70[_0x11d9('0x1a')];_0xb4eef2+=0x1){_0x3ec49a[_0x11d9('0x48')](_0x11d9('0x4f'),{'FaxInteractionId':Number(_0x1d0c70[_0xb4eef2]),'UserId':Number(_0x2b404a['id'])});}});}})[_0x11d9('0x16')](function(){if(_0x2d6956===_0x11d9('0x4a')){var _0x5ddf2e=_[_0x11d9('0x46')](_0x2b404a['SmsInteractions'],'id');return _0x2b404a[_0x11d9('0x50')](_0x5ddf2e)[_0x11d9('0x16')](function(){for(var _0x51845e=0x0;_0x51845e<_0x5ddf2e['length'];_0x51845e+=0x1){_0x3ec49a[_0x11d9('0x48')](_0x11d9('0x51'),{'SmsInteractionId':Number(_0x5ddf2e[_0x51845e]),'UserId':Number(_0x2b404a['id'])});}});}})[_0x11d9('0x16')](function(){if(_0x2d6956===_0x11d9('0x4a')){var _0x46e2a3=_[_0x11d9('0x46')](_0x2b404a[_0x11d9('0x52')],'id');return _0x2b404a[_0x11d9('0x53')](_0x46e2a3)[_0x11d9('0x16')](function(){for(var _0x1eab9a=0x0;_0x1eab9a<_0x46e2a3['length'];_0x1eab9a+=0x1){_0x3ec49a[_0x11d9('0x48')](_0x11d9('0x54'),{'OpenchannelInteractionId':Number(_0x46e2a3[_0x1eab9a]),'UserId':Number(_0x2b404a['id'])});}});}})[_0x11d9('0x16')](function(){if(_0x2d6956===_0x11d9('0x4a')){var _0x5e726=_[_0x11d9('0x46')](_0x2b404a[_0x11d9('0x27')],'id');return _0x2b404a[_0x11d9('0x55')](_0x5e726)[_0x11d9('0x16')](function(){for(var _0x3c1b64=0x0;_0x3c1b64<_0x5e726[_0x11d9('0x1a')];_0x3c1b64+=0x1){_0x3ec49a[_0x11d9('0x48')](_0x11d9('0x56'),{'WhatsappInteractionId':Number(_0x5e726[_0x3c1b64]),'UserId':Number(_0x2b404a['id'])});}});}})[_0x11d9('0x57')](function(_0x4d805f){_0x35e7bf[_0x11d9('0x58')](_0x4d805f);});}}function onDisconnect(_0x17d1f5,_0x4484fa){joinOrLeave(_0x17d1f5,_0x11d9('0x4a'),_0x4484fa);}function onConnect(_0x32699f){joinOrLeave(_0x32699f,_0x11d9('0x59'));}exports[_0x11d9('0x5a')]=function(_0x1c6f92){_0x1c6f92['on']('connection',function(_0x5e242e){_0x5e242e['setMaxListeners'](0x0);_0x5e242e[_0x11d9('0x5b')]=_0x5e242e[_0x11d9('0x5c')][_0x11d9('0x5d')][_0x11d9('0x5e')]+':'+_0x5e242e[_0x11d9('0x5c')][_0x11d9('0x5d')][_0x11d9('0x5f')];_0x5e242e[_0x11d9('0x60')]=new Date();_0x5e242e[_0x11d9('0x58')]=function(_0xbe9f2e){console[_0x11d9('0x58')]('SocketIO\x20'+_0x5e242e[_0x11d9('0x61')][_0x11d9('0x4')]+'['+_0x5e242e[_0x11d9('0x5b')]+']',_0xbe9f2e);};_0x5e242e['on'](_0x11d9('0x62'),function(){onDisconnect(_0x5e242e,_0x1c6f92);_0x5e242e[_0x11d9('0x58')]('DISCONNECTED');});onConnect(_0x5e242e);_0x5e242e['log']('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 7014eab..3cb1aa8 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 _0xbb6d=['request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','UserId','interface','SIP/%s','name','agent','incomingmessage','outgoingmessage','opened','query','Sequelize','SELECT','AfterCreate','changed','closed','substatus','format','AfterUpdate','User','find','fullname','email','internal','default','length','model','callback','condition','../../mysqldb','jayson/promise','../logger','client','Chat','ChatInteraction','afterCreate','newinteraction','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','afterUpdate','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage'];(function(_0xbc2cfa,_0x4adaa8){var _0x28244f=function(_0x592415){while(--_0x592415){_0xbc2cfa['push'](_0xbc2cfa['shift']());}};_0x28244f(++_0x4adaa8);}(_0xbb6d,0x107));var _0xdbb6=function(_0x365da3,_0x54ffd5){_0x365da3=_0x365da3-0x0;var _0x142b8c=_0xbb6d[_0x365da3];return _0x142b8c;};'use strict';var util=require('util');var db=require(_0xdbb6('0x0'))['db'];var jayson=require(_0xdbb6('0x1'));var logger=require(_0xdbb6('0x2'))('triggers');var client=jayson[_0xdbb6('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0xdbb6('0x4'),'model':_0xdbb6('0x5'),'event':_0xdbb6('0x6'),'condition':_0xdbb6('0x7'),'callback':afterCreate},{'channel':_0xdbb6('0x4'),'model':_0xdbb6('0x5'),'event':'afterUpdate','condition':_0xdbb6('0x8'),'callback':afterUpdate},{'channel':_0xdbb6('0x4'),'model':_0xdbb6('0x9'),'event':_0xdbb6('0x6'),'condition':_0xdbb6('0xa'),'callback':afterCreateMessage},{'channel':_0xdbb6('0x4'),'model':'ChatOfflineMessage','event':'afterCreate','condition':_0xdbb6('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0xdbb6('0xb'),'model':_0xdbb6('0xc'),'event':_0xdbb6('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xdbb6('0xb'),'model':_0xdbb6('0xc'),'event':_0xdbb6('0xd'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xdbb6('0xb'),'model':'SmsMessage','event':_0xdbb6('0x6'),'condition':_0xdbb6('0xa'),'callback':afterCreateMessage},{'channel':_0xdbb6('0xe'),'model':_0xdbb6('0xf'),'event':_0xdbb6('0x6'),'condition':_0xdbb6('0x7'),'callback':afterCreate},{'channel':_0xdbb6('0xe'),'model':_0xdbb6('0xf'),'event':_0xdbb6('0xd'),'condition':_0xdbb6('0x8'),'callback':afterUpdate},{'channel':_0xdbb6('0xe'),'model':'WhatsappMessage','event':_0xdbb6('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xdbb6('0x10'),'model':_0xdbb6('0x11'),'event':'afterCreate','condition':_0xdbb6('0x7'),'callback':afterCreate},{'channel':_0xdbb6('0x10'),'model':_0xdbb6('0x11'),'event':_0xdbb6('0xd'),'condition':_0xdbb6('0x8'),'callback':afterUpdate},{'channel':_0xdbb6('0x10'),'model':_0xdbb6('0x12'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xdbb6('0x13'),'model':_0xdbb6('0x14'),'event':_0xdbb6('0x6'),'condition':_0xdbb6('0x7'),'callback':afterCreate},{'channel':_0xdbb6('0x13'),'model':_0xdbb6('0x14'),'event':_0xdbb6('0xd'),'condition':_0xdbb6('0x8'),'callback':afterUpdate},{'channel':_0xdbb6('0x13'),'model':_0xdbb6('0x15'),'event':_0xdbb6('0x6'),'condition':_0xdbb6('0xa'),'callback':afterCreateMessage},{'channel':_0xdbb6('0x16'),'model':_0xdbb6('0x17'),'event':_0xdbb6('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':'Openchannel','model':_0xdbb6('0x17'),'event':'afterUpdate','condition':_0xdbb6('0x8'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xdbb6('0x18'),'event':_0xdbb6('0x6'),'condition':_0xdbb6('0xa'),'callback':afterCreateMessage}];function request(_0xc7e78e){return client[_0xdbb6('0x19')](_0xdbb6('0x1a'),_0xc7e78e)[_0xdbb6('0x1b')](function(_0x2991c0){logger[_0xdbb6('0x1c')](_0xdbb6('0x1d'),_0xdbb6('0x1a'),_0x2991c0);if(_0x2991c0[_0xdbb6('0x1e')]){if(_0x2991c0[_0xdbb6('0x1e')][_0xdbb6('0x1f')]===0x1f4){logger['error'](_0xdbb6('0x1d'),_0xdbb6('0x1a'),_0x2991c0['error']);}}})[_0xdbb6('0x20')](function(_0x2a76c1){logger['error'](_0xdbb6('0x1d'),_0xdbb6('0x1a'),_0x2a76c1);});}function afterCreateMessage(_0xbcbf7f){return function(_0x44b119){_0x44b119=_0x44b119[_0xdbb6('0x21')]({'plain':!![]});_0x44b119[_0xdbb6('0x22')]=_0xbcbf7f;_0x44b119[_0xdbb6('0x23')]=_0xbcbf7f;_0x44b119[_0xdbb6('0x24')]=_0x44b119[_0xdbb6('0x25')];Promise[_0xdbb6('0x26')]()['then'](function(){if(typeof _0x44b119[_0xdbb6('0x27')]===_0xdbb6('0x28'))return null;var _0x2f9a04=_0xdbb6('0x29')+_0x44b119[_0xdbb6('0x27')];return db[_0xdbb6('0x2a')]['query'](_0x2f9a04,{'type':db['Sequelize'][_0xdbb6('0x2b')]['SELECT'],'raw':!![]});})[_0xdbb6('0x1b')](function(_0x311f46){if(_0x311f46){_0x44b119[_0xdbb6('0x2c')]=_0x311f46[0x0];}if(typeof _0x44b119[_0xdbb6('0x2d')]==='undefined')return;return getAgent(_0x44b119['UserId']);})['then'](function(_0x46928a){if(_0x46928a){_0x44b119[_0xdbb6('0x2e')]=util['format'](_0xdbb6('0x2f'),_0x46928a[_0xdbb6('0x30')]);_0x44b119[_0xdbb6('0x31')]=_0x46928a;_0x44b119[_0xdbb6('0x22')]=_0xbcbf7f;return request({'event':_0xdbb6('0x32'),'message':_0x44b119});}else{return request({'event':_0xdbb6('0x33'),'message':_0x44b119});}})[_0xdbb6('0x20')](function(_0x3d761d){logger[_0xdbb6('0x1e')](_0xdbb6('0x1d'),'AfterCreateMessage',_0x3d761d);});};}function afterCreateOfflineMessage(_0x5f0361){return function(_0x5a3c05){_0x5a3c05=_0x5a3c05[_0xdbb6('0x21')]({'plain':!![]});_0x5a3c05[_0xdbb6('0x22')]=_0x5f0361;_0x5a3c05[_0xdbb6('0x23')]=_0x5f0361;_0x5a3c05['event']='offlineMessage';return request({'event':_0x5a3c05[_0xdbb6('0x24')],'message':_0x5a3c05});};}function afterCreate(_0x1e464c,_0x3a26f4){return function(_0x141380){_0x141380=_0x141380[_0xdbb6('0x21')]({'plain':!![]});_0x141380[_0xdbb6('0x22')]=_0x1e464c;_0x141380[_0xdbb6('0x23')]=_0x1e464c;_0x141380[_0xdbb6('0x24')]=_0xdbb6('0x34');Promise[_0xdbb6('0x26')]()[_0xdbb6('0x1b')](function(){var _0x80f66f=_0xdbb6('0x29')+_0x141380['ContactId'];return db[_0xdbb6('0x2a')][_0xdbb6('0x35')](_0x80f66f,{'type':db[_0xdbb6('0x36')]['QueryTypes'][_0xdbb6('0x37')],'raw':!![]});})['then'](function(_0x5c7b19){if(_0x5c7b19){_0x141380[_0xdbb6('0x2c')]=_0x5c7b19[0x0];}if(typeof _0x141380[_0xdbb6('0x2d')]===_0xdbb6('0x28'))return;return getAgent(_0x141380[_0xdbb6('0x2d')]);})['then'](function(_0x11d2d4){if(_0x11d2d4){_0x141380[_0xdbb6('0x2e')]=util['format'](_0xdbb6('0x2f'),_0x11d2d4[_0xdbb6('0x30')]);_0x141380[_0xdbb6('0x31')]=_0x11d2d4;}return request({'event':_0x3a26f4,'message':_0x141380});})['catch'](function(_0x249ee9){logger[_0xdbb6('0x1e')](_0xdbb6('0x1d'),_0xdbb6('0x38'),_0x249ee9);});};}function afterUpdate(_0x385fad){return function(_0x44fb8c){var _0x5b824d=_0x44fb8c[_0xdbb6('0x39')]('closed')&&_0x44fb8c[_0xdbb6('0x3a')];var _0x5293e8=_0x44fb8c['changed'](_0xdbb6('0x3b'));if(_0x5b824d||_0x5293e8){var _0x37cc8c=_0x5b824d?_0xdbb6('0x8'):_0xdbb6('0x3b');var _0x268efc=_0x44fb8c[_0xdbb6('0x21')]({'plain':!![]});_0x268efc[_0xdbb6('0x22')]=_0x385fad;_0x268efc[_0xdbb6('0x23')]=_0x385fad;_0x268efc[_0xdbb6('0x24')]=_0x5b824d?'closed':'substatus';var _0xc741c=_0xdbb6('0x29')+_0x268efc[_0xdbb6('0x27')];return db[_0xdbb6('0x2a')][_0xdbb6('0x35')](_0xc741c,{'type':db[_0xdbb6('0x36')][_0xdbb6('0x2b')][_0xdbb6('0x37')],'raw':!![]})[_0xdbb6('0x1b')](function(_0x2d95b0){if(_0x2d95b0){_0x268efc[_0xdbb6('0x2c')]=_0x2d95b0[0x0];}if(typeof _0x268efc[_0xdbb6('0x2d')]===_0xdbb6('0x28'))return;return getAgent(_0x268efc[_0xdbb6('0x2d')]);})[_0xdbb6('0x1b')](function(_0x150b0c){if(_0x150b0c){_0x268efc[_0xdbb6('0x2e')]=util[_0xdbb6('0x3c')](_0xdbb6('0x2f'),_0x150b0c[_0xdbb6('0x30')]);_0x268efc['agent']=_0x150b0c;}return request({'event':_0x37cc8c,'message':_0x268efc});})['catch'](function(_0x336c93){logger['error']('Trigger,\x20%s',_0xdbb6('0x3d'),_0x336c93);});}};}function getAgent(_0x44cb71){return db[_0xdbb6('0x3e')][_0xdbb6('0x3f')]({'where':{'id':_0x44cb71},'attributes':['id',_0xdbb6('0x30'),_0xdbb6('0x40'),_0xdbb6('0x41'),_0xdbb6('0x42')],'raw':!![]})[_0xdbb6('0x1b')](function(_0x5b9dcd){return _0x5b9dcd;});}exports[_0xdbb6('0x43')]=function(){for(var _0x512a5b=0x0;_0x512a5b=_0x111f50[_0x212e('0x14')]){throw Error(_0x212e('0x15'));}_0x2e614e(_0x1fb6f7);})[_0x212e('0x16')](function(_0x4392cb){_0x95fffc(_0x4392cb);});});}; \ No newline at end of file +var _0xa086=['Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents'];(function(_0x2d85a5,_0x26861c){var _0x27d75b=function(_0x46c938){while(--_0x46c938){_0x2d85a5['push'](_0x2d85a5['shift']());}};_0x27d75b(++_0x26861c);}(_0xa086,0xf5));var _0x6a08=function(_0x3a1dad,_0x2d3403){_0x3a1dad=_0x3a1dad-0x0;var _0xe3be62=_0xa086[_0x3a1dad];return _0xe3be62;};'use strict';var _=require(_0x6a08('0x0'));var BPromise=require(_0x6a08('0x1'));var db=require(_0x6a08('0x2'))['db'];var util=require(_0x6a08('0x3'));var channels=[_0x6a08('0x4'),_0x6a08('0x5'),_0x6a08('0x6'),_0x6a08('0x7'),_0x6a08('0x8'),'whatsapp',_0x6a08('0x9')];exports[_0x6a08('0xa')]=function(){return channels;};exports[_0x6a08('0xb')]=function(_0x24783a){_0x24783a=_0x24783a[_0x6a08('0xc')]();return _[_0x6a08('0xd')](channels,_0x24783a);};exports[_0x6a08('0xe')]=function(_0x6cf6f6,_0x183c96,_0x458aab,_0x2a4f4b){var _0x3f1f0c={'loginAttempts':_0x183c96,'blocked':_0x458aab};if(!_[_0x6a08('0xf')](_0x2a4f4b)){_0x3f1f0c[_0x6a08('0x10')]=_0x2a4f4b;}return _0x6cf6f6[_0x6a08('0x11')](_0x3f1f0c);};exports[_0x6a08('0x12')]=function(_0x245f1d){return new BPromise(function(_0x46e223,_0x2d2160){var _0x49f164=0x0;if(_0x245f1d[_0x6a08('0x13')]!==_0x6a08('0x14')){_0x46e223(_0x245f1d);}db[_0x6a08('0x15')][_0x6a08('0x16')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x245f1d['id']}}})[_0x6a08('0x17')](function(_0x15b911){_0x49f164=_0x15b911;return util[_0x6a08('0x12')]();})[_0x6a08('0x17')](function(_0x27f78b){if(_0x27f78b&&_0x27f78b[_0x6a08('0x18')]&&_0x49f164>=_0x27f78b['agents']){throw Error(_0x6a08('0x19'));}_0x46e223(_0x245f1d);})[_0x6a08('0x1a')](function(_0x91717){_0x2d2160(_0x91717);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index cde0ab5..ff039e7 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Bad\x20Request','Forbidden','Out\x20Of\x20Interval','Not\x20Found','error','stack','statusMessage','status','send','exports','util','../config/logger','api','message','name','Error','inherits','Entity\x20not\x20found'];(function(_0xa12bd7,_0x26b894){var _0x594416=function(_0x8f56c2){while(--_0x8f56c2){_0xa12bd7['push'](_0xa12bd7['shift']());}};_0x594416(++_0x26b894);}(_0x7a54,0x106));var _0x47a5=function(_0x447867,_0x529ad3){_0x447867=_0x447867-0x0;var _0x5858b6=_0x7a54[_0x447867];return _0x5858b6;};'use strict';var util=require(_0x47a5('0x0'));var logger=require(_0x47a5('0x1'))(_0x47a5('0x2'));var APIError=function(_0x58157c,_0x1d33e){this[_0x47a5('0x3')]=_0x58157c||'Internal\x20Server\x20Error';this[_0x47a5('0x4')]=_0x1d33e||_0x47a5('0x5');util[_0x47a5('0x6')](APIError,Error);};var APIBadRequestError=function(_0x3717e1){this[_0x47a5('0x3')]=_0x3717e1||'Bad\x20Request';this[_0x47a5('0x4')]='Bad\x20Request';util[_0x47a5('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x30e405){this['message']=_0x30e405||_0x47a5('0x7');this['name']='Not\x20Found';util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x2a0e98){this[_0x47a5('0x3')]=_0x2a0e98||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0x47a5('0x4')]='Out\x20Of\x20Interval';util['inherits'](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1f47f4){switch(_0x1f47f4){case _0x47a5('0x8'):return 0x190;case _0x47a5('0x9'),_0x47a5('0xa'):return 0x193;case _0x47a5('0xb'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0xd308b8){if(_0xd308b8===_0x47a5('0xa'))return _0xd308b8;return null;}function handleError(_0x5beb89){return function(_0x44bd3e){logger[_0x47a5('0xc')](_0x44bd3e[_0x47a5('0xd')]);var _0x711793=getStatusCode(_0x44bd3e[_0x47a5('0x4')]);var _0x620ee9=getCustomStatusMessage(_0x44bd3e[_0x47a5('0x4')]);if(_0x44bd3e[_0x47a5('0x4')])delete _0x44bd3e['name'];if(_0x620ee9)_0x5beb89[_0x47a5('0xe')]=_0x620ee9;return _0x5beb89[_0x47a5('0xf')](_0x711793)[_0x47a5('0x10')](_0x44bd3e);};}module[_0x47a5('0x11')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x7a54=['Bad\x20Request','Forbidden','Out\x20Of\x20Interval','Not\x20Found','error','stack','statusMessage','status','send','exports','util','../config/logger','api','message','name','Error','inherits','Entity\x20not\x20found'];(function(_0x372dad,_0x5cab1a){var _0x15a0e9=function(_0x508f34){while(--_0x508f34){_0x372dad['push'](_0x372dad['shift']());}};_0x15a0e9(++_0x5cab1a);}(_0x7a54,0x106));var _0x47a5=function(_0x3d61a8,_0x51f91f){_0x3d61a8=_0x3d61a8-0x0;var _0x2f01cc=_0x7a54[_0x3d61a8];return _0x2f01cc;};'use strict';var util=require(_0x47a5('0x0'));var logger=require(_0x47a5('0x1'))(_0x47a5('0x2'));var APIError=function(_0x58157c,_0x1d33e){this[_0x47a5('0x3')]=_0x58157c||'Internal\x20Server\x20Error';this[_0x47a5('0x4')]=_0x1d33e||_0x47a5('0x5');util[_0x47a5('0x6')](APIError,Error);};var APIBadRequestError=function(_0x3717e1){this[_0x47a5('0x3')]=_0x3717e1||'Bad\x20Request';this[_0x47a5('0x4')]='Bad\x20Request';util[_0x47a5('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x30e405){this['message']=_0x30e405||_0x47a5('0x7');this['name']='Not\x20Found';util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x2a0e98){this[_0x47a5('0x3')]=_0x2a0e98||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0x47a5('0x4')]='Out\x20Of\x20Interval';util['inherits'](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1f47f4){switch(_0x1f47f4){case _0x47a5('0x8'):return 0x190;case _0x47a5('0x9'),_0x47a5('0xa'):return 0x193;case _0x47a5('0xb'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0xd308b8){if(_0xd308b8===_0x47a5('0xa'))return _0xd308b8;return null;}function handleError(_0x5beb89){return function(_0x44bd3e){logger[_0x47a5('0xc')](_0x44bd3e[_0x47a5('0xd')]);var _0x711793=getStatusCode(_0x44bd3e[_0x47a5('0x4')]);var _0x620ee9=getCustomStatusMessage(_0x44bd3e[_0x47a5('0x4')]);if(_0x44bd3e[_0x47a5('0x4')])delete _0x44bd3e['name'];if(_0x620ee9)_0x5beb89[_0x47a5('0xe')]=_0x620ee9;return _0x5beb89[_0x47a5('0xf')](_0x711793)[_0x47a5('0x10')](_0x44bd3e);};}module[_0x47a5('0x11')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 9c558e2..aad7c18 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x799f=['render','json','send','status'];(function(_0x2edfad,_0x54b323){var _0x2499ff=function(_0x179a90){while(--_0x179a90){_0x2edfad['push'](_0x2edfad['shift']());}};_0x2499ff(++_0x54b323);}(_0x799f,0x1cf));var _0xf799=function(_0x38f4f6,_0x6726a0){_0x38f4f6=_0x38f4f6-0x0;var _0x56cc52=_0x799f[_0x38f4f6];return _0x56cc52;};'use strict';module['exports'][0x194]=function pageNotFound(_0x4b3960,_0x168ec1){var _0x315063='404';var _0x49f6ce=0x194;var _0x20f3f3={'status':_0x49f6ce};_0x168ec1[_0xf799('0x0')](_0x20f3f3[_0xf799('0x0')]);_0x168ec1[_0xf799('0x1')](_0x315063,{},function(_0x15052a,_0x314db3){if(_0x15052a){return _0x168ec1[_0xf799('0x0')](_0x20f3f3[_0xf799('0x0')])[_0xf799('0x2')](_0x20f3f3);}_0x168ec1[_0xf799('0x3')](_0x314db3);});}; \ No newline at end of file +var _0x91ff=['json','send','404','status','render'];(function(_0x34d275,_0x5d84ee){var _0x1379cc=function(_0x320fbe){while(--_0x320fbe){_0x34d275['push'](_0x34d275['shift']());}};_0x1379cc(++_0x5d84ee);}(_0x91ff,0x15b));var _0xf91f=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x91ff[_0x174ef5];return _0x1cc379;};'use strict';module['exports'][0x194]=function pageNotFound(_0x4f49ee,_0x2d4c89){var _0x4e5c14=_0xf91f('0x0');var _0x5ce09b=0x194;var _0x12e900={'status':_0x5ce09b};_0x2d4c89[_0xf91f('0x1')](_0x12e900[_0xf91f('0x1')]);_0x2d4c89[_0xf91f('0x2')](_0x4e5c14,{},function(_0x19d3cd,_0x35c817){if(_0x19d3cd){return _0x2d4c89[_0xf91f('0x1')](_0x12e900['status'])[_0xf91f('0x3')](_0x12e900);}_0x2d4c89[_0xf91f('0x4')](_0x35c817);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index c7d70e1..920ea5a 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index f0acb99..6fa4217 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a3d=['/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','./api/squareMessage','./api/team','/api/license','./api/license','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','static','join','root','/demo','snippet','3.5.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./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/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxInteraction','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount'];(function(_0x1cb552,_0x549cd9){var _0x3496d3=function(_0x330b47){while(--_0x330b47){_0x1cb552['push'](_0x1cb552['shift']());}};_0x3496d3(++_0x549cd9);}(_0x4a3d,0x79));var _0xd4a3=function(_0x23173e,_0x3968f6){_0x23173e=_0x23173e-0x0;var _0x128657=_0x4a3d[_0x23173e];return _0x128657;};'use strict';var path=require(_0xd4a3('0x0'));var express=require(_0xd4a3('0x1'));var errors=require(_0xd4a3('0x2'));var config=require(_0xd4a3('0x3'));var setupLoggers=require(_0xd4a3('0x4'))[_0xd4a3('0x5')];var clientSideLogs=require(_0xd4a3('0x6'));exports[_0xd4a3('0x7')]=function(_0xcae31b){return setupLoggers(_0xcae31b)[_0xd4a3('0x8')](function(){_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xa'),require('./api/user'));_0xcae31b['use'](_0xd4a3('0xb'),require(_0xd4a3('0xc')));_0xcae31b['use']('/api/voice/contexts',require(_0xd4a3('0xd')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xe'),require(_0xd4a3('0xf')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x10'),require(_0xd4a3('0x11')));_0xcae31b[_0xd4a3('0x9')]('/api/voice/queues',require(_0xd4a3('0x12')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x13'),require(_0xd4a3('0x14')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x15'),require(_0xd4a3('0x16')));_0xcae31b['use'](_0xd4a3('0x17'),require(_0xd4a3('0x18')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x19'),require(_0xd4a3('0x1a')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x1b'),require(_0xd4a3('0x1c')));_0xcae31b['use']('/api/voice/dials/reports',require(_0xd4a3('0x1d')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x1e'),require(_0xd4a3('0x1f')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x20'),require('./api/voiceQueueReport'));_0xcae31b[_0xd4a3('0x9')]('/api/members/reports',require(_0xd4a3('0x21')));_0xcae31b['use'](_0xd4a3('0x22'),require('./api/trunk'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x23'),require('./api/voiceTransferReport'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x24'),require(_0xd4a3('0x25')));_0xcae31b['use']('/api/mail/accounts',require(_0xd4a3('0x26')));_0xcae31b['use'](_0xd4a3('0x27'),require(_0xd4a3('0x28')));_0xcae31b['use']('/api/mail/substatuses',require('./api/mailSubstatus'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x29'),require(_0xd4a3('0x2a')));_0xcae31b['use'](_0xd4a3('0x2b'),require(_0xd4a3('0x2c')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x2d'),require(_0xd4a3('0x2e')));_0xcae31b[_0xd4a3('0x9')]('/api/mail/reports/queue',require(_0xd4a3('0x2f')));_0xcae31b[_0xd4a3('0x9')]('/api/dashboards',require(_0xd4a3('0x30')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x31'),require('./api/dashboardItem'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x32'),require(_0xd4a3('0x33')));_0xcae31b['use'](_0xd4a3('0x34'),require('./api/faxApplication'));_0xcae31b[_0xd4a3('0x9')]('/api/fax/interactions',require(_0xd4a3('0x35')));_0xcae31b['use'](_0xd4a3('0x36'),require('./api/faxMessage'));_0xcae31b[_0xd4a3('0x9')]('/api/fax/queues',require(_0xd4a3('0x37')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x38'),require(_0xd4a3('0x39')));_0xcae31b[_0xd4a3('0x9')]('/api/sms/accounts',require('./api/smsAccount'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x3a'),require(_0xd4a3('0x3b')));_0xcae31b[_0xd4a3('0x9')]('/api/sms/interactions',require(_0xd4a3('0x3c')));_0xcae31b[_0xd4a3('0x9')]('/api/sms/messages',require(_0xd4a3('0x3d')));_0xcae31b['use'](_0xd4a3('0x3e'),require(_0xd4a3('0x3f')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x40'),require(_0xd4a3('0x41')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x42'),require(_0xd4a3('0x43')));_0xcae31b[_0xd4a3('0x9')]('/api/openchannel/interactions',require(_0xd4a3('0x44')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x45'),require('./api/openchannelMessage'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x46'),require(_0xd4a3('0x47')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x48'),require(_0xd4a3('0x49')));_0xcae31b[_0xd4a3('0x9')]('/api/openchannel/reports/queue',require(_0xd4a3('0x4a')));_0xcae31b['use']('/api/chat/applications',require(_0xd4a3('0x4b')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x4c'),require(_0xd4a3('0x4d')));_0xcae31b['use'](_0xd4a3('0x4e'),require('./api/chatMessage'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x4f'),require(_0xd4a3('0x50')));_0xcae31b[_0xd4a3('0x9')]('/api/chat/queues',require(_0xd4a3('0x51')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x52'),require(_0xd4a3('0x53')));_0xcae31b['use']('/api/chat/proactive_actions',require(_0xd4a3('0x54')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x55'),require(_0xd4a3('0x56')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x57'),require(_0xd4a3('0x58')));_0xcae31b['use']('/api/cm/hopper',require(_0xd4a3('0x59')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x5a'),require(_0xd4a3('0x5b')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x5c'),require(_0xd4a3('0x5d')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x5e'),require(_0xd4a3('0x5f')));_0xcae31b['use'](_0xd4a3('0x60'),require(_0xd4a3('0x61')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x62'),require('./api/action'));_0xcae31b[_0xd4a3('0x9')]('/api/automations',require(_0xd4a3('0x63')));_0xcae31b['use'](_0xd4a3('0x64'),require(_0xd4a3('0x65')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x66'),require(_0xd4a3('0x67')));_0xcae31b['use'](_0xd4a3('0x68'),require(_0xd4a3('0x69')));_0xcae31b[_0xd4a3('0x9')]('/api/intervals',require(_0xd4a3('0x6a')));_0xcae31b[_0xd4a3('0x9')]('/api/pauses',require(_0xd4a3('0x6b')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x6c'),require(_0xd4a3('0x6d')));_0xcae31b[_0xd4a3('0x9')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x6e'),require(_0xd4a3('0x6f')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x70'),require(_0xd4a3('0x71')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x72'),require('./api/tag'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x73'),require('./api/contactItemType'));_0xcae31b['use'](_0xd4a3('0x74'),require('./api/cmContactHasItem'));_0xcae31b['use'](_0xd4a3('0x75'),require(_0xd4a3('0x76')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x77'),require(_0xd4a3('0x78')));_0xcae31b[_0xd4a3('0x9')]('/api/triggers',require('./api/trigger'));_0xcae31b['use'](_0xd4a3('0x79'),require('./api/variable'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x7a'),require(_0xd4a3('0x7b')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x7c'),require(_0xd4a3('0x7d')));_0xcae31b[_0xd4a3('0x9')]('/api/analytics/custom_reports',require(_0xd4a3('0x7e')));_0xcae31b['use'](_0xd4a3('0x7f'),require('./api/analyticDefaultReport'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x80'),require('./api/analyticExtractedReport'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x81'),require('./api/analyticMetric'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x82'),require(_0xd4a3('0x83')));_0xcae31b['use'](_0xd4a3('0x84'),require(_0xd4a3('0x85')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/salesforce/accounts',require(_0xd4a3('0x86')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/salesforce/configurations',require(_0xd4a3('0x87')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x88'),require(_0xd4a3('0x89')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x8a'),require('./api/intSugarcrmAccount'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x8b'),require(_0xd4a3('0x8c')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x8d'),require(_0xd4a3('0x8e')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x8f'),require(_0xd4a3('0x90')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x91'),require(_0xd4a3('0x92')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x93'),require(_0xd4a3('0x94')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x95'),require(_0xd4a3('0x96')));_0xcae31b['use'](_0xd4a3('0x97'),require(_0xd4a3('0x98')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x99'),require(_0xd4a3('0x9a')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x9b'),require('./api/intZendeskAccount'));_0xcae31b['use'](_0xd4a3('0x9c'),require('./api/intZendeskConfiguration'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x9d'),require(_0xd4a3('0x9e')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x9f'),require('./api/intFreshdeskAccount'));_0xcae31b['use'](_0xd4a3('0xa0'),require(_0xd4a3('0xa1')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xa2'),require('./api/intFreshdeskField'));_0xcae31b['use'](_0xd4a3('0xa3'),require(_0xd4a3('0xa4')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0xcae31b['use'](_0xd4a3('0xa5'),require('./api/intVtigerField'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xa6'),require(_0xd4a3('0xa7')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/servicenow/configurations',require(_0xd4a3('0xa8')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/servicenow/fields',require(_0xd4a3('0xa9')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0xcae31b['use'](_0xd4a3('0xaa'),require(_0xd4a3('0xab')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xac'),require(_0xd4a3('0xad')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/freshsales/accounts',require(_0xd4a3('0xae')));_0xcae31b['use']('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xaf'),require(_0xd4a3('0xb0')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xb1'),require(_0xd4a3('0xb2')));_0xcae31b[_0xd4a3('0x9')]('/api/chat/reports/queue',require(_0xd4a3('0xb3')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xb4'),require(_0xd4a3('0xb5')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xb6'),require(_0xd4a3('0xb7')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xb8'),require(_0xd4a3('0xb9')));_0xcae31b['use'](_0xd4a3('0xba'),require('./api/jscriptySessionReport'));_0xcae31b[_0xd4a3('0x9')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0xcae31b['use'](_0xd4a3('0xbb'),require(_0xd4a3('0xbc')));_0xcae31b[_0xd4a3('0x9')]('/api/square/details/reports',require(_0xd4a3('0xbd')));_0xcae31b['use'](_0xd4a3('0xbe'),require(_0xd4a3('0xbf')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xc0'),require('./api/setting'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xc1'),require(_0xd4a3('0xc2')));_0xcae31b[_0xd4a3('0x9')]('/api/square/projects',require('./api/squareProject'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xc3'),require(_0xd4a3('0xc4')));_0xcae31b[_0xd4a3('0x9')]('/api/square/messages',require(_0xd4a3('0xc5')));_0xcae31b['use']('/api/teams',require(_0xd4a3('0xc6')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xc7'),require(_0xd4a3('0xc8')));_0xcae31b[_0xd4a3('0x9')]('/api/campaigns',require('./api/campaign'));_0xcae31b['use'](_0xd4a3('0xc9'),require(_0xd4a3('0xca')));_0xcae31b['use'](_0xd4a3('0xcb'),require(_0xd4a3('0xcc')));_0xcae31b['use'](_0xd4a3('0xcd'),require(_0xd4a3('0xce')));_0xcae31b['use']('/api/mail/reports/transfer',require(_0xd4a3('0xcf')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd0'),require('./api/chatTransferReport'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd1'),require(_0xd4a3('0xd2')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd3'),require(_0xd4a3('0xd4')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd5'),require(_0xd4a3('0xd6')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd7'),require('./api/cmList'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd8'),require('./api/voicePrefix'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd9'),require('./api/userProfile'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xda'),require(_0xd4a3('0xdb')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xdc'),require('./api/userProfileResource'));_0xcae31b[_0xd4a3('0x9')]('/api/userNotifications',require('./api/userNotification'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xdd'),require(_0xd4a3('0xde')));_0xcae31b['use']('/api/whatsapp/applications',require(_0xd4a3('0xdf')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xe0'),require(_0xd4a3('0xe1')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xe2'),require(_0xd4a3('0xe3')));_0xcae31b['use'](_0xd4a3('0xe4'),require('./api/whatsappQueueReport'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xe5'),require(_0xd4a3('0xe6')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xe7'),require('./api/whatsappQueue'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xe8'),require(_0xd4a3('0xe9')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xea'),require(_0xd4a3('0xeb')));_0xcae31b[_0xd4a3('0x9')]('/api/user-settings',require('./api/user-setting'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xec'),require('./api/authLocal'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xed'),require(_0xd4a3('0xee')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xef'),require(_0xd4a3('0xf0')));_0xcae31b['use'](_0xd4a3('0xf1'),require(_0xd4a3('0xf2')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xf3'),require(_0xd4a3('0xf4')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xf5'),require('./api/version'));_0xcae31b['use']('/api/system',require(_0xd4a3('0xf6')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xf7'),require(_0xd4a3('0xf8')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xf9'),require('./api/webbar'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xfa'),clientSideLogs);_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xfb'),express[_0xd4a3('0xfc')](path[_0xd4a3('0xfd')](config[_0xd4a3('0xfe')],'/apidoc')));_0xcae31b[_0xd4a3('0x9')]('/www',express[_0xd4a3('0xfc')](path['join'](config['root'],'/www')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xff'),express[_0xd4a3('0xfc')](path[_0xd4a3('0xfd')](config[_0xd4a3('0xfe')],_0xd4a3('0xff'))));_0xcae31b[_0xd4a3('0x9')]('/snippet',express[_0xd4a3('0xfc')](path['join'](config[_0xd4a3('0xfe')],_0xd4a3('0x100'),_0xd4a3('0x101'))));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x102'),express[_0xd4a3('0xfc')](path[_0xd4a3('0xfd')](config['root'],_0xd4a3('0x103'))));_0xcae31b[_0xd4a3('0x104')](_0xd4a3('0x105'))[_0xd4a3('0x106')](errors[0x194]);_0xcae31b[_0xd4a3('0x104')]('/*')[_0xd4a3('0x106')](function(_0x588edd,_0x3ea280){_0x3ea280[_0xd4a3('0x107')](path[_0xd4a3('0x108')](_0xcae31b[_0xd4a3('0x106')]('appPath')+_0xd4a3('0x109')));});return _0xcae31b;});}; \ No newline at end of file +var _0x9234=['./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./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/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','./api/user-setting','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','join','root','/www','static','/demo','3.5.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','path','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions'];(function(_0x1b2d55,_0x1af6c2){var _0x397976=function(_0x5df497){while(--_0x5df497){_0x1b2d55['push'](_0x1b2d55['shift']());}};_0x397976(++_0x1af6c2);}(_0x9234,0x1bd));var _0x4923=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0x9234[_0x5c7e53];return _0x1c9af9;};'use strict';var path=require(_0x4923('0x0'));var express=require('express');var errors=require(_0x4923('0x1'));var config=require(_0x4923('0x2'));var setupLoggers=require(_0x4923('0x3'))[_0x4923('0x4')];var clientSideLogs=require('./api/client-side-logs');exports[_0x4923('0x5')]=function(_0x436ce1){return setupLoggers(_0x436ce1)['then'](function(){_0x436ce1[_0x4923('0x6')](_0x4923('0x7'),require(_0x4923('0x8')));_0x436ce1[_0x4923('0x6')](_0x4923('0x9'),require(_0x4923('0xa')));_0x436ce1[_0x4923('0x6')]('/api/voice/contexts',require(_0x4923('0xb')));_0x436ce1['use'](_0x4923('0xc'),require(_0x4923('0xd')));_0x436ce1[_0x4923('0x6')]('/api/voice/mohs',require(_0x4923('0xe')));_0x436ce1[_0x4923('0x6')](_0x4923('0xf'),require(_0x4923('0x10')));_0x436ce1[_0x4923('0x6')](_0x4923('0x11'),require(_0x4923('0x12')));_0x436ce1[_0x4923('0x6')](_0x4923('0x13'),require(_0x4923('0x14')));_0x436ce1['use']('/api/voice/mails',require(_0x4923('0x15')));_0x436ce1[_0x4923('0x6')](_0x4923('0x16'),require('./api/voiceMailMessage'));_0x436ce1[_0x4923('0x6')](_0x4923('0x17'),require(_0x4923('0x18')));_0x436ce1[_0x4923('0x6')](_0x4923('0x19'),require(_0x4923('0x1a')));_0x436ce1[_0x4923('0x6')](_0x4923('0x1b'),require(_0x4923('0x1c')));_0x436ce1[_0x4923('0x6')]('/api/voice/queues/reports',require(_0x4923('0x1d')));_0x436ce1[_0x4923('0x6')](_0x4923('0x1e'),require(_0x4923('0x1f')));_0x436ce1['use']('/api/trunks',require(_0x4923('0x20')));_0x436ce1['use'](_0x4923('0x21'),require(_0x4923('0x22')));_0x436ce1['use'](_0x4923('0x23'),require(_0x4923('0x24')));_0x436ce1[_0x4923('0x6')](_0x4923('0x25'),require('./api/mailAccount'));_0x436ce1[_0x4923('0x6')](_0x4923('0x26'),require('./api/mailQueue'));_0x436ce1[_0x4923('0x6')]('/api/mail/substatuses',require(_0x4923('0x27')));_0x436ce1[_0x4923('0x6')]('/api/mail/interactions',require(_0x4923('0x28')));_0x436ce1[_0x4923('0x6')](_0x4923('0x29'),require(_0x4923('0x2a')));_0x436ce1[_0x4923('0x6')](_0x4923('0x2b'),require(_0x4923('0x2c')));_0x436ce1['use']('/api/mail/reports/queue',require(_0x4923('0x2d')));_0x436ce1[_0x4923('0x6')](_0x4923('0x2e'),require(_0x4923('0x2f')));_0x436ce1[_0x4923('0x6')](_0x4923('0x30'),require(_0x4923('0x31')));_0x436ce1[_0x4923('0x6')](_0x4923('0x32'),require(_0x4923('0x33')));_0x436ce1[_0x4923('0x6')]('/api/fax/applications',require(_0x4923('0x34')));_0x436ce1[_0x4923('0x6')](_0x4923('0x35'),require(_0x4923('0x36')));_0x436ce1[_0x4923('0x6')](_0x4923('0x37'),require(_0x4923('0x38')));_0x436ce1[_0x4923('0x6')](_0x4923('0x39'),require(_0x4923('0x3a')));_0x436ce1[_0x4923('0x6')](_0x4923('0x3b'),require(_0x4923('0x3c')));_0x436ce1[_0x4923('0x6')]('/api/sms/accounts',require(_0x4923('0x3d')));_0x436ce1[_0x4923('0x6')](_0x4923('0x3e'),require(_0x4923('0x3f')));_0x436ce1[_0x4923('0x6')](_0x4923('0x40'),require(_0x4923('0x41')));_0x436ce1[_0x4923('0x6')]('/api/sms/messages',require('./api/smsMessage'));_0x436ce1[_0x4923('0x6')]('/api/sms/queues',require('./api/smsQueue'));_0x436ce1['use'](_0x4923('0x42'),require(_0x4923('0x43')));_0x436ce1[_0x4923('0x6')](_0x4923('0x44'),require('./api/openchannelApplication'));_0x436ce1[_0x4923('0x6')]('/api/openchannel/interactions',require(_0x4923('0x45')));_0x436ce1[_0x4923('0x6')](_0x4923('0x46'),require(_0x4923('0x47')));_0x436ce1[_0x4923('0x6')]('/api/openchannel/queues',require(_0x4923('0x48')));_0x436ce1['use']('/api/chat/websites',require(_0x4923('0x49')));_0x436ce1[_0x4923('0x6')](_0x4923('0x4a'),require(_0x4923('0x4b')));_0x436ce1[_0x4923('0x6')](_0x4923('0x4c'),require(_0x4923('0x4d')));_0x436ce1['use'](_0x4923('0x4e'),require('./api/chatInteraction'));_0x436ce1['use'](_0x4923('0x4f'),require(_0x4923('0x50')));_0x436ce1['use'](_0x4923('0x51'),require(_0x4923('0x52')));_0x436ce1['use']('/api/chat/queues',require(_0x4923('0x53')));_0x436ce1[_0x4923('0x6')]('/api/chat/groups',require('./api/chatGroup'));_0x436ce1[_0x4923('0x6')](_0x4923('0x54'),require(_0x4923('0x55')));_0x436ce1[_0x4923('0x6')](_0x4923('0x56'),require('./api/cmCompany'));_0x436ce1[_0x4923('0x6')](_0x4923('0x57'),require('./api/cmContact'));_0x436ce1[_0x4923('0x6')]('/api/cm/hopper',require(_0x4923('0x58')));_0x436ce1[_0x4923('0x6')]('/api/cm/hopper_black',require(_0x4923('0x59')));_0x436ce1[_0x4923('0x6')](_0x4923('0x5a'),require(_0x4923('0x5b')));_0x436ce1[_0x4923('0x6')](_0x4923('0x5c'),require('./api/cmHopperHistory'));_0x436ce1[_0x4923('0x6')](_0x4923('0x5d'),require('./api/cmCustomField'));_0x436ce1[_0x4923('0x6')]('/api/actions',require(_0x4923('0x5e')));_0x436ce1[_0x4923('0x6')](_0x4923('0x5f'),require(_0x4923('0x60')));_0x436ce1[_0x4923('0x6')](_0x4923('0x61'),require(_0x4923('0x62')));_0x436ce1[_0x4923('0x6')]('/api/dispositions',require(_0x4923('0x63')));_0x436ce1[_0x4923('0x6')](_0x4923('0x64'),require(_0x4923('0x65')));_0x436ce1[_0x4923('0x6')](_0x4923('0x66'),require(_0x4923('0x67')));_0x436ce1[_0x4923('0x6')](_0x4923('0x68'),require('./api/pause'));_0x436ce1[_0x4923('0x6')](_0x4923('0x69'),require('./api/cdr'));_0x436ce1[_0x4923('0x6')](_0x4923('0x6a'),require(_0x4923('0x6b')));_0x436ce1[_0x4923('0x6')](_0x4923('0x6c'),require(_0x4923('0x6d')));_0x436ce1[_0x4923('0x6')](_0x4923('0x6e'),require(_0x4923('0x6f')));_0x436ce1['use']('/api/tags',require('./api/tag'));_0x436ce1[_0x4923('0x6')]('/api/contact_item_types',require(_0x4923('0x70')));_0x436ce1['use'](_0x4923('0x71'),require(_0x4923('0x72')));_0x436ce1[_0x4923('0x6')](_0x4923('0x73'),require(_0x4923('0x74')));_0x436ce1[_0x4923('0x6')](_0x4923('0x75'),require(_0x4923('0x76')));_0x436ce1['use'](_0x4923('0x77'),require(_0x4923('0x78')));_0x436ce1[_0x4923('0x6')](_0x4923('0x79'),require(_0x4923('0x7a')));_0x436ce1[_0x4923('0x6')](_0x4923('0x7b'),require(_0x4923('0x7c')));_0x436ce1['use'](_0x4923('0x7d'),require(_0x4923('0x7e')));_0x436ce1[_0x4923('0x6')](_0x4923('0x7f'),require('./api/analyticCustomReport'));_0x436ce1[_0x4923('0x6')](_0x4923('0x80'),require(_0x4923('0x81')));_0x436ce1[_0x4923('0x6')](_0x4923('0x82'),require(_0x4923('0x83')));_0x436ce1[_0x4923('0x6')]('/api/analytics/metrics',require(_0x4923('0x84')));_0x436ce1['use']('/api/analytics/field_reports',require(_0x4923('0x85')));_0x436ce1[_0x4923('0x6')](_0x4923('0x86'),require('./api/analyticTreeReport'));_0x436ce1[_0x4923('0x6')]('/api/integrations/salesforce/accounts',require(_0x4923('0x87')));_0x436ce1['use'](_0x4923('0x88'),require(_0x4923('0x89')));_0x436ce1[_0x4923('0x6')](_0x4923('0x8a'),require(_0x4923('0x8b')));_0x436ce1['use'](_0x4923('0x8c'),require(_0x4923('0x8d')));_0x436ce1[_0x4923('0x6')](_0x4923('0x8e'),require(_0x4923('0x8f')));_0x436ce1[_0x4923('0x6')]('/api/integrations/sugarcrm/fields',require(_0x4923('0x90')));_0x436ce1[_0x4923('0x6')](_0x4923('0x91'),require(_0x4923('0x92')));_0x436ce1[_0x4923('0x6')](_0x4923('0x93'),require(_0x4923('0x94')));_0x436ce1['use'](_0x4923('0x95'),require(_0x4923('0x96')));_0x436ce1[_0x4923('0x6')](_0x4923('0x97'),require(_0x4923('0x98')));_0x436ce1[_0x4923('0x6')](_0x4923('0x99'),require('./api/intZohoConfiguration'));_0x436ce1[_0x4923('0x6')](_0x4923('0x9a'),require(_0x4923('0x9b')));_0x436ce1['use'](_0x4923('0x9c'),require(_0x4923('0x9d')));_0x436ce1['use']('/api/integrations/zendesk/configurations',require(_0x4923('0x9e')));_0x436ce1[_0x4923('0x6')](_0x4923('0x9f'),require(_0x4923('0xa0')));_0x436ce1[_0x4923('0x6')](_0x4923('0xa1'),require(_0x4923('0xa2')));_0x436ce1[_0x4923('0x6')]('/api/integrations/freshdesk/configurations',require(_0x4923('0xa3')));_0x436ce1[_0x4923('0x6')](_0x4923('0xa4'),require(_0x4923('0xa5')));_0x436ce1[_0x4923('0x6')]('/api/integrations/vtiger/accounts',require(_0x4923('0xa6')));_0x436ce1[_0x4923('0x6')](_0x4923('0xa7'),require('./api/intVtigerConfiguration'));_0x436ce1['use'](_0x4923('0xa8'),require(_0x4923('0xa9')));_0x436ce1['use']('/api/integrations/servicenow/accounts',require(_0x4923('0xaa')));_0x436ce1[_0x4923('0x6')](_0x4923('0xab'),require('./api/intServicenowConfiguration'));_0x436ce1[_0x4923('0x6')](_0x4923('0xac'),require('./api/intServicenowField'));_0x436ce1['use']('/api/integrations/dynamics365/accounts',require(_0x4923('0xad')));_0x436ce1['use'](_0x4923('0xae'),require(_0x4923('0xaf')));_0x436ce1[_0x4923('0x6')](_0x4923('0xb0'),require(_0x4923('0xb1')));_0x436ce1[_0x4923('0x6')](_0x4923('0xb2'),require('./api/intFreshsalesAccount'));_0x436ce1[_0x4923('0x6')](_0x4923('0xb3'),require(_0x4923('0xb4')));_0x436ce1['use'](_0x4923('0xb5'),require(_0x4923('0xb6')));_0x436ce1['use'](_0x4923('0xb7'),require(_0x4923('0xb8')));_0x436ce1[_0x4923('0x6')](_0x4923('0xb9'),require('./api/chatQueueReport'));_0x436ce1[_0x4923('0x6')]('/api/chat/internal/messages',require(_0x4923('0xba')));_0x436ce1[_0x4923('0x6')]('/api/jscripty/answers/reports',require(_0x4923('0xbb')));_0x436ce1['use'](_0x4923('0xbc'),require(_0x4923('0xbd')));_0x436ce1[_0x4923('0x6')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x436ce1[_0x4923('0x6')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x436ce1[_0x4923('0x6')](_0x4923('0xbe'),require(_0x4923('0xbf')));_0x436ce1[_0x4923('0x6')](_0x4923('0xc0'),require('./api/squareReportDetail'));_0x436ce1['use']('/api/jscripty/projects',require('./api/jscriptyProject'));_0x436ce1[_0x4923('0x6')]('/api/settings',require('./api/setting'));_0x436ce1[_0x4923('0x6')]('/api/square/odbc',require('./api/squareOdbc'));_0x436ce1[_0x4923('0x6')](_0x4923('0xc1'),require(_0x4923('0xc2')));_0x436ce1[_0x4923('0x6')](_0x4923('0xc3'),require(_0x4923('0xc4')));_0x436ce1[_0x4923('0x6')](_0x4923('0xc5'),require(_0x4923('0xc6')));_0x436ce1[_0x4923('0x6')](_0x4923('0xc7'),require(_0x4923('0xc8')));_0x436ce1[_0x4923('0x6')](_0x4923('0xc9'),require(_0x4923('0xca')));_0x436ce1[_0x4923('0x6')](_0x4923('0xcb'),require('./api/campaign'));_0x436ce1['use'](_0x4923('0xcc'),require(_0x4923('0xcd')));_0x436ce1[_0x4923('0x6')](_0x4923('0xce'),require(_0x4923('0xcf')));_0x436ce1[_0x4923('0x6')](_0x4923('0xd0'),require(_0x4923('0xd1')));_0x436ce1['use'](_0x4923('0xd2'),require(_0x4923('0xd3')));_0x436ce1[_0x4923('0x6')](_0x4923('0xd4'),require(_0x4923('0xd5')));_0x436ce1['use']('/api/fax/reports/transfer',require(_0x4923('0xd6')));_0x436ce1[_0x4923('0x6')](_0x4923('0xd7'),require(_0x4923('0xd8')));_0x436ce1[_0x4923('0x6')]('/api/sms/reports/transfer',require(_0x4923('0xd9')));_0x436ce1[_0x4923('0x6')](_0x4923('0xda'),require(_0x4923('0xdb')));_0x436ce1[_0x4923('0x6')](_0x4923('0xdc'),require(_0x4923('0xdd')));_0x436ce1[_0x4923('0x6')](_0x4923('0xde'),require(_0x4923('0xdf')));_0x436ce1[_0x4923('0x6')](_0x4923('0xe0'),require(_0x4923('0xe1')));_0x436ce1[_0x4923('0x6')](_0x4923('0xe2'),require(_0x4923('0xe3')));_0x436ce1[_0x4923('0x6')](_0x4923('0xe4'),require(_0x4923('0xe5')));_0x436ce1[_0x4923('0x6')](_0x4923('0xe6'),require('./api/whatsappAccount'));_0x436ce1[_0x4923('0x6')](_0x4923('0xe7'),require(_0x4923('0xe8')));_0x436ce1[_0x4923('0x6')](_0x4923('0xe9'),require(_0x4923('0xea')));_0x436ce1['use']('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x436ce1[_0x4923('0x6')](_0x4923('0xeb'),require(_0x4923('0xec')));_0x436ce1['use']('/api/whatsapp/reports/transfer',require(_0x4923('0xed')));_0x436ce1[_0x4923('0x6')](_0x4923('0xee'),require(_0x4923('0xef')));_0x436ce1[_0x4923('0x6')](_0x4923('0xf0'),require(_0x4923('0xf1')));_0x436ce1[_0x4923('0x6')]('/api/realtime',require(_0x4923('0xf2')));_0x436ce1[_0x4923('0x6')]('/api/user-settings',require(_0x4923('0xf3')));_0x436ce1['use']('/api/auth/local',require('./api/authLocal'));_0x436ce1[_0x4923('0x6')](_0x4923('0xf4'),require(_0x4923('0xf5')));_0x436ce1['use']('/api/auth/activedirectory',require(_0x4923('0xf6')));_0x436ce1['use'](_0x4923('0xf7'),require(_0x4923('0xf8')));_0x436ce1[_0x4923('0x6')](_0x4923('0xf9'),require(_0x4923('0xfa')));_0x436ce1[_0x4923('0x6')](_0x4923('0xfb'),require('./api/version'));_0x436ce1[_0x4923('0x6')](_0x4923('0xfc'),require(_0x4923('0xfd')));_0x436ce1['use']('/api/pm2',require(_0x4923('0xfe')));_0x436ce1['use'](_0x4923('0xff'),require(_0x4923('0x100')));_0x436ce1[_0x4923('0x6')](_0x4923('0x101'),clientSideLogs);_0x436ce1['use'](_0x4923('0x102'),express['static'](path[_0x4923('0x103')](config[_0x4923('0x104')],_0x4923('0x102'))));_0x436ce1[_0x4923('0x6')](_0x4923('0x105'),express[_0x4923('0x106')](path[_0x4923('0x103')](config['root'],_0x4923('0x105'))));_0x436ce1[_0x4923('0x6')]('/demo',express[_0x4923('0x106')](path[_0x4923('0x103')](config[_0x4923('0x104')],_0x4923('0x107'))));_0x436ce1['use']('/snippet',express[_0x4923('0x106')](path[_0x4923('0x103')](config['root'],'snippet',_0x4923('0x108'))));_0x436ce1[_0x4923('0x6')](_0x4923('0x109'),express['static'](path['join'](config['root'],_0x4923('0x10a'))));_0x436ce1[_0x4923('0x10b')](_0x4923('0x10c'))[_0x4923('0x10d')](errors[0x194]);_0x436ce1[_0x4923('0x10b')]('/*')[_0x4923('0x10d')](function(_0x3da999,_0x2a2dea){_0x2a2dea[_0x4923('0x10e')](path[_0x4923('0x10f')](_0x436ce1['get'](_0x4923('0x110'))+'/index.html'));});return _0x436ce1;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 12d4993..7cff4f7 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa00=['../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','http','port','rpc','localhost','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','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/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc'];(function(_0x3c3698,_0xa0bf08){var _0x4e6637=function(_0x1fc9a4){while(--_0x1fc9a4){_0x3c3698['push'](_0x3c3698['shift']());}};_0x4e6637(++_0xa0bf08);}(_0xfa00,0x129));var _0x0fa0=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xfa00[_0x4565bf];return _0x5610ba;};'use strict';var jayson=require(_0x0fa0('0x0'));var _=require(_0x0fa0('0x1'));var config=require(_0x0fa0('0x2'));exports['listen']=function(){return new Promise(function(_0x5246a8,_0x9db3b7){var _0x5124fe={};_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x4')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/voiceExtension/voiceExtension.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x5')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x6')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x7')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x8')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x9')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0xa')));_0x5124fe=_['merge'](_0x5124fe,require('../api/trunk/trunk.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0xb')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0xc')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/mailServerIn/mailServerIn.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0xd')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0xe')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0xf')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x10')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x11')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x12')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/faxAccount/faxAccount.rpc'));_0x5124fe=_['merge'](_0x5124fe,require('../api/faxApplication/faxApplication.rpc'));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x13')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x14')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x15')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x16')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x17')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x18')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x19')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x1a')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x1b')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x1c')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x1d')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x1e')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x1f')));_0x5124fe=_['merge'](_0x5124fe,require('../api/chatQueue/chatQueue.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/cmContact/cmContact.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x20')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x21')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x22')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x23')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x24')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/sound/sound.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x25')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x26')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/trigger/trigger.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x27')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x28')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x29')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x2a')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x2b')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x2c')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x2d')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x2e')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x2f')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x30')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x31')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x32')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x33')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x34')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x35')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x36')));_0x5124fe=_['merge'](_0x5124fe,require('../api/squareOdbc/squareOdbc.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x37')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x38')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x39')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x3a')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x3b')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x3c')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x3d')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x3e')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5124fe=_['merge'](_0x5124fe,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x427737=jayson['server'](_0x5124fe)[_0x0fa0('0x3f')]();var _0x32f7bb=config['rpc']['port']||config[_0x0fa0('0x40')]+0x1;var _0x52afaa=config[_0x0fa0('0x41')]['ip']||_0x0fa0('0x42');_0x427737['on']('error',function(_0x574e89){return _0x9db3b7(_0x574e89);});_0x427737['listen'](_0x32f7bb,_0x52afaa,function(){console['log'](_0x0fa0('0x43'),_0x52afaa,_0x32f7bb);require(_0x0fa0('0x44'))[_0x0fa0('0x45')]();return _0x5246a8(_0x0fa0('0x46')+_0x52afaa+':'+_0x32f7bb);});});}; \ No newline at end of file +var _0x6590=['../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','http','rpc','port','localhost','error','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.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/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.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/cmHopperBlack/cmHopperBlack.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc'];(function(_0x739d1,_0x183717){var _0x3b9070=function(_0x3f3116){while(--_0x3f3116){_0x739d1['push'](_0x739d1['shift']());}};_0x3b9070(++_0x183717);}(_0x6590,0xa5));var _0x0659=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x6590[_0x2642cb];return _0xe6e41;};'use strict';var jayson=require(_0x0659('0x0'));var _=require(_0x0659('0x1'));var config=require(_0x0659('0x2'));exports['listen']=function(){return new Promise(function(_0x1b3298,_0x4e59fa){var _0x33fb73={};_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x4')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x5')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x6')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x7')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x8')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x9')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0xa')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0xb')));_0x33fb73=_['merge'](_0x33fb73,require(_0x0659('0xc')));_0x33fb73=_['merge'](_0x33fb73,require('../api/trunk/trunk.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0xd')));_0x33fb73=_['merge'](_0x33fb73,require('../api/mailServerIn/mailServerIn.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0xe')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0xf')));_0x33fb73=_['merge'](_0x33fb73,require(_0x0659('0x10')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x11')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x12')));_0x33fb73=_['merge'](_0x33fb73,require(_0x0659('0x13')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/faxAccount/faxAccount.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x14')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x15')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x16')));_0x33fb73=_['merge'](_0x33fb73,require(_0x0659('0x17')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x18')));_0x33fb73=_['merge'](_0x33fb73,require(_0x0659('0x19')));_0x33fb73=_['merge'](_0x33fb73,require(_0x0659('0x1a')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x1b')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x1c')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x1d')));_0x33fb73=_['merge'](_0x33fb73,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x1e')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x1f')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x20')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x21')));_0x33fb73=_['merge'](_0x33fb73,require(_0x0659('0x22')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x23')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x24')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x25')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/interval/interval.rpc'));_0x33fb73=_['merge'](_0x33fb73,require(_0x0659('0x26')));_0x33fb73=_['merge'](_0x33fb73,require(_0x0659('0x27')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x28')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/trigger/trigger.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x29')));_0x33fb73=_['merge'](_0x33fb73,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x2a')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x2b')));_0x33fb73=_['merge'](_0x33fb73,require(_0x0659('0x2c')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x33fb73=_['merge'](_0x33fb73,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x2d')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x2e')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x2f')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x30')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x31')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x32')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x33')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x34')));_0x33fb73=_['merge'](_0x33fb73,require(_0x0659('0x35')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x36')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x37')));_0x33fb73=_['merge'](_0x33fb73,require(_0x0659('0x38')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/campaign/campaign.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x39')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x3a')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x3b')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require(_0x0659('0x3c')));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x33fb73=_[_0x0659('0x3')](_0x33fb73,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x4bfb2b=jayson['server'](_0x33fb73)[_0x0659('0x3d')]();var _0x3c1f80=config[_0x0659('0x3e')][_0x0659('0x3f')]||config['port']+0x1;var _0x2997af=config[_0x0659('0x3e')]['ip']||_0x0659('0x40');_0x4bfb2b['on'](_0x0659('0x41'),function(_0x5a970e){return _0x4e59fa(_0x5a970e);});_0x4bfb2b[_0x0659('0x42')](_0x3c1f80,_0x2997af,function(){console['log'](_0x0659('0x43'),_0x2997af,_0x3c1f80);require(_0x0659('0x44'))['default']();return _0x1b3298(_0x0659('0x45')+_0x2997af+':'+_0x3c1f80);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index f6e827b..21957d3 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 _0x0703=['sync','prototype','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setExtension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','no\x20code','replace','result=','substr','indexOf','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','function','write','destroy','inherits','sendRequest'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x0703,0xc0));var _0x3070=function(_0x128a79,_0x19f331){_0x128a79=_0x128a79-0x0;var _0x2ff426=_0x0703[_0x128a79];return _0x2ff426;};'use strict';var util=require(_0x3070('0x0'));var _=require(_0x3070('0x1'));var EventEmitter=require(_0x3070('0x2'))[_0x3070('0x3')];var AGIReply=require(_0x3070('0x4'));var AGIError=require(_0x3070('0x5'));function AGIChannel(_0x4ab1d4){var _0x579bb1=this,_0x1736e5=new AGIReply(),_0x5f4b06=![],_0x240844={};EventEmitter[_0x3070('0x6')](_0x579bb1);_0x4ab1d4[_0x3070('0x7')](_0x3070('0x8'));_0x4ab1d4[_0x3070('0x9')](0x8*0x3c*0x3c*0x3e8);_0x1736e5[_0x3070('0x7')]('utf8');_0x1736e5['on'](_0x3070('0xa'),function(_0xf3a45f){for(var _0x2fb8bf in _0xf3a45f){_0x579bb1[_0x2fb8bf]=_0xf3a45f[_0x2fb8bf];}_0x579bb1[_0x3070('0xb')](_0x3070('0xc'));});_0x1736e5['on'](_0x3070('0xd'),function(_0x3394b1){if(_0x3394b1[_0x3070('0xe')]()==_0x3070('0xf')){_0x579bb1[_0x3070('0xb')](_0x3070('0xf'));return;}if(_0x3394b1[_0x3070('0x10')](0x0,0xb)==_0x3070('0x11')){_0x5f4b06=!![];}if(_0x5f4b06){_0x240844['rx']+=_0x3394b1+'\x0a';if(_0x3394b1['search'](_0x3070('0x12'))!=-0x1){_0x5f4b06=![];}}else{_0x240844['rx']=_0x3394b1;}if(_0x5f4b06){return;}if(typeof _0x240844['cb']=='function'){var _0x49e797=_0x240844['rx'][_0x3070('0x10')](0x0,0x3),_0x22277c=null,_0x4a80ab=null;_0x49e797=parseInt(_0x49e797);if(isNaN(_0x49e797)){_0x240844['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x3070('0x13')});return;}if(_0x49e797!=0xc8){_0x240844['cb'](null,{'code':_0x49e797,'result':-0x1,'extra':'KO'});return;}_0x22277c=_0x240844['rx'][_0x3070('0x10')](0x4)[_0x3070('0x14')](_0x3070('0x15'),'');if(_0x22277c['indexOf']('\x20')!=-0x1){_0x22277c=_0x22277c[_0x3070('0x16')](0x0,_0x22277c[_0x3070('0x17')]('\x20'));}if(_['startsWith'](_0x22277c,'-1')){_0x22277c=parseInt(_0x22277c);}_0x4a80ab=_0x240844['rx']['split']('\x20');if(_0x4a80ab[_0x3070('0x18')]==0x3){_0x4a80ab=_0x4a80ab[0x2][_0x3070('0x10')](0x1,_0x4a80ab[0x2][_0x3070('0x18')]-0x1);}else if(_0x4a80ab[_0x3070('0x18')]>0x3){var _0x766377=/\((.+)\)/;var _0x3641ec=_0x240844['rx'][_0x3070('0x19')](_0x766377);if(_0x3641ec){_0x4a80ab=_0x3641ec[0x1];}else{_0x4a80ab=null;}}else{_0x4a80ab=null;}_0x240844['cb'](null,{'code':_0x49e797,'result':_0x22277c,'extra':_0x4a80ab});}});_0x4ab1d4['on'](_0x3070('0x1a'),function(_0x4564fc){_0x579bb1[_0x3070('0xb')](_0x3070('0x1a'),new AGIError('E_AGI_SOCKET_ERROR',_0x4564fc[_0x3070('0x1b')]));});_0x4ab1d4['on']('close',function(){_0x579bb1[_0x3070('0xb')](_0x3070('0x1c'),new AGIError(_0x3070('0x1d')));});_0x4ab1d4['on'](_0x3070('0x1e'),function(){_0x579bb1[_0x3070('0xb')](_0x3070('0x1e'),new AGIError(_0x3070('0x1f')));_0x4ab1d4['destroy']();});_0x4ab1d4[_0x3070('0x20')](_0x1736e5);this[_0x3070('0x21')]=function(_0x13452c,_0x39735d){var _0x13452c=_0x13452c||'',_0x39735d=typeof _0x39735d==_0x3070('0x22')?_0x39735d:new Function();_0x240844={'tx':_0x13452c,'rx':'','cb':_0x39735d};_0x4ab1d4[_0x3070('0x23')](_0x13452c+'\x0a');},this[_0x3070('0x1c')]=function(){_0x4ab1d4[_0x3070('0x24')]();};}util[_0x3070('0x25')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x3070('0x26')]=function(_0x530198){return this[_0x3070('0x21')][_0x3070('0x27')](this,_0x530198);};AGIChannel[_0x3070('0x28')]['answer']=function(){return this[_0x3070('0x26')](_0x3070('0x29'));};AGIChannel[_0x3070('0x28')][_0x3070('0x2a')]=function(_0x853abb,_0xe826d9,_0x2def9d){_0x853abb=_0x853abb===undefined?_0x3070('0x2b'):_0x853abb;_0xe826d9=_0xe826d9===undefined?'5':_0xe826d9;_0x2def9d=_0x2def9d===undefined?'1':_0x2def9d;return this[_0x3070('0x26')](util[_0x3070('0x2c')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x853abb,_0xe826d9*0x3e8,_0x2def9d));};AGIChannel[_0x3070('0x28')][_0x3070('0x2d')]=function(_0x1ffb6a){_0x1ffb6a=_0x1ffb6a||_0x3070('0x2e');return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x2f'),_0x1ffb6a));};AGIChannel[_0x3070('0x28')][_0x3070('0x30')]=function(_0x359ca2,_0x134709){if(_['isArray'](_0x134709)){return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x31'),_0x359ca2,_0x134709[_0x3070('0x32')](',')));}return this['sendRequest'](util[_0x3070('0x2c')]('EXEC\x20%s\x20%s',_0x359ca2,_0x134709));};AGIChannel[_0x3070('0x28')][_0x3070('0x33')]=function(_0x34d973){return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x34'),_0x34d973));};AGIChannel[_0x3070('0x28')]['setExtension']=function(_0xcdd8c8){return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x35'),_0xcdd8c8));};AGIChannel[_0x3070('0x28')][_0x3070('0x36')]=function(_0x23e7cc){return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x37'),_0x23e7cc));};AGIChannel[_0x3070('0x28')]['hangup']=function(){return this[_0x3070('0x26')]('HANGUP');};AGIChannel['prototype'][_0x3070('0x38')]=function(_0x222de6,_0x123ba6){var _0x19b4cf=_[_0x3070('0x39')](_0x123ba6)||_['isNumber'](_0x123ba6)?_0x123ba6[_0x3070('0x3a')]():_0x123ba6;return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x3b'),_0x222de6,_0x19b4cf?_0x19b4cf[_0x3070('0x3a')]()[_0x3070('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x3070('0x3c')]=function(_0x3cb314,_0x4ba627){return this[_0x3070('0x26')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x3cb314,_0x4ba627));};AGIChannel[_0x3070('0x28')]['sayDigits']=function(_0x1a31e3,_0x861e63){return this['sendRequest'](util[_0x3070('0x2c')](_0x3070('0x3d'),_0x1a31e3,_0x861e63));};AGIChannel[_0x3070('0x28')]['sayPhonetic']=function(_0x55f16c,_0x10ba8b){return this['sendRequest'](util[_0x3070('0x2c')](_0x3070('0x3e'),_0x55f16c,_0x10ba8b));};AGIChannel['prototype'][_0x3070('0x3f')]=function(_0xcf737f,_0x2944b1,_0x3155ee){_0x2944b1=_0x2944b1||this['extension'];_0x3155ee=_0x3155ee||0x1;this['setContext'](_0xcf737f);this[_0x3070('0x40')](_0x2944b1);this[_0x3070('0x36')](_0x3155ee);return this['noop'](util[_0x3070('0x2c')](_0x3070('0x41'),_0xcf737f,_0x2944b1,_0x3155ee));};AGIChannel['prototype']['getVariable']=function(_0xc49e8e){return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x42'),_0xc49e8e));};AGIChannel[_0x3070('0x28')]['recordFile']=function(_0x3034f1,_0x241f0a,_0x5a25d7,_0x365c4e,_0x7b99fe,_0x4c590c){_0x241f0a=_0x241f0a||_0x3070('0x43');_0x5a25d7=_0x5a25d7||'';_0x365c4e=_0x365c4e===undefined?-0x1:_0x365c4e==='-1'?-0x1:_0x365c4e*0x3e8;_0x7b99fe=_0x7b99fe===undefined?'':'s='+_0x7b99fe;_0x4c590c=_0x4c590c?_0x3070('0x44'):'';return this['sendRequest'](util[_0x3070('0x2c')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x3034f1,_0x241f0a,_0x5a25d7,_0x365c4e,_0x4c590c,_0x7b99fe));};AGIChannel[_0x3070('0x28')][_0x3070('0x45')]=function(_0x209ba2,_0xbf0d1e){_0xbf0d1e=_0xbf0d1e||'';return this['sendRequest'](util['format'](_0x3070('0x46'),_0x209ba2,_0xbf0d1e));};AGIChannel['prototype'][_0x3070('0x47')]=function(_0x3abee0){return this[_0x3070('0x30')](_0x3070('0x48'),_0x3abee0);};AGIChannel[_0x3070('0x28')][_0x3070('0x49')]=function(_0x3cd497){return this[_0x3070('0x30')]('WAIT',_0x3cd497);};AGIChannel['prototype'][_0x3070('0x1a')]=function(_0x1b5294,_0x28299a){this[_0x3070('0x2d')](util[_0x3070('0x2c')](_0x3070('0x4a'),_0x1b5294['id'],_0x1b5294[_0x3070('0x4b')],_0x28299a));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3070('0x4c')]=AGIChannel; \ No newline at end of file +var _0xaeba=['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','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','./error','setEncoding','utf8','setTimeout','emit','ready','line','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','startsWith','split','length','error','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','command','sync','sendRequest','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','format','join','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setPriority'];(function(_0x231058,_0x3a1958){var _0x1eb7d0=function(_0x4716aa){while(--_0x4716aa){_0x231058['push'](_0x231058['shift']());}};_0x1eb7d0(++_0x3a1958);}(_0xaeba,0x1cf));var _0xaaeb=function(_0x354cc7,_0x387dce){_0x354cc7=_0x354cc7-0x0;var _0x39f38b=_0xaeba[_0x354cc7];return _0x39f38b;};'use strict';var util=require(_0xaaeb('0x0'));var _=require(_0xaaeb('0x1'));var EventEmitter=require(_0xaaeb('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0xaaeb('0x3'));function AGIChannel(_0x3fa49d){var _0x398800=this,_0x491014=new AGIReply(),_0x3132df=![],_0x1f9314={};EventEmitter['call'](_0x398800);_0x3fa49d[_0xaaeb('0x4')](_0xaaeb('0x5'));_0x3fa49d[_0xaaeb('0x6')](0x8*0x3c*0x3c*0x3e8);_0x491014[_0xaaeb('0x4')]('utf8');_0x491014['on']('headers',function(_0x5c3021){for(var _0x13ae1b in _0x5c3021){_0x398800[_0x13ae1b]=_0x5c3021[_0x13ae1b];}_0x398800[_0xaaeb('0x7')](_0xaaeb('0x8'));});_0x491014['on'](_0xaaeb('0x9'),function(_0x3cb604){if(_0x3cb604['toLowerCase']()=='hangup'){_0x398800[_0xaaeb('0x7')](_0xaaeb('0xa'));return;}if(_0x3cb604['substring'](0x0,0xb)==_0xaaeb('0xb')){_0x3132df=!![];}if(_0x3132df){_0x1f9314['rx']+=_0x3cb604+'\x0a';if(_0x3cb604[_0xaaeb('0xc')](_0xaaeb('0xd'))!=-0x1){_0x3132df=![];}}else{_0x1f9314['rx']=_0x3cb604;}if(_0x3132df){return;}if(typeof _0x1f9314['cb']==_0xaaeb('0xe')){var _0x132881=_0x1f9314['rx'][_0xaaeb('0xf')](0x0,0x3),_0x4eab06=null,_0x2a4cda=null;_0x132881=parseInt(_0x132881);if(isNaN(_0x132881)){_0x1f9314['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xaaeb('0x10')});return;}if(_0x132881!=0xc8){_0x1f9314['cb'](null,{'code':_0x132881,'result':-0x1,'extra':'KO'});return;}_0x4eab06=_0x1f9314['rx'][_0xaaeb('0xf')](0x4)[_0xaaeb('0x11')](_0xaaeb('0x12'),'');if(_0x4eab06[_0xaaeb('0x13')]('\x20')!=-0x1){_0x4eab06=_0x4eab06['substr'](0x0,_0x4eab06[_0xaaeb('0x13')]('\x20'));}if(_[_0xaaeb('0x14')](_0x4eab06,'-1')){_0x4eab06=parseInt(_0x4eab06);}_0x2a4cda=_0x1f9314['rx'][_0xaaeb('0x15')]('\x20');if(_0x2a4cda[_0xaaeb('0x16')]==0x3){_0x2a4cda=_0x2a4cda[0x2][_0xaaeb('0xf')](0x1,_0x2a4cda[0x2]['length']-0x1);}else if(_0x2a4cda['length']>0x3){var _0x4add51=/\((.+)\)/;var _0x1bafab=_0x1f9314['rx']['match'](_0x4add51);if(_0x1bafab){_0x2a4cda=_0x1bafab[0x1];}else{_0x2a4cda=null;}}else{_0x2a4cda=null;}_0x1f9314['cb'](null,{'code':_0x132881,'result':_0x4eab06,'extra':_0x2a4cda});}});_0x3fa49d['on'](_0xaaeb('0x17'),function(_0x4707d1){_0x398800['emit'](_0xaaeb('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x4707d1[_0xaaeb('0x18')]));});_0x3fa49d['on'](_0xaaeb('0x19'),function(){_0x398800['emit'](_0xaaeb('0x19'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x3fa49d['on'](_0xaaeb('0x1a'),function(){_0x398800[_0xaaeb('0x7')]('timeout',new AGIError(_0xaaeb('0x1b')));_0x3fa49d[_0xaaeb('0x1c')]();});_0x3fa49d[_0xaaeb('0x1d')](_0x491014);this['command']=function(_0x4ff3c8,_0x248729){var _0x4ff3c8=_0x4ff3c8||'',_0x248729=typeof _0x248729=='function'?_0x248729:new Function();_0x1f9314={'tx':_0x4ff3c8,'rx':'','cb':_0x248729};_0x3fa49d[_0xaaeb('0x1e')](_0x4ff3c8+'\x0a');},this[_0xaaeb('0x19')]=function(){_0x3fa49d[_0xaaeb('0x1c')]();};}util[_0xaaeb('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0xaaeb('0x20')]['sendRequest']=function(_0xf18c5c){return this[_0xaaeb('0x21')][_0xaaeb('0x22')](this,_0xf18c5c);};AGIChannel[_0xaaeb('0x20')]['answer']=function(){return this[_0xaaeb('0x23')]('ANSWER');};AGIChannel[_0xaaeb('0x20')][_0xaaeb('0x24')]=function(_0x3edb8c,_0x59fb62,_0x1de1be){_0x3edb8c=_0x3edb8c===undefined?_0xaaeb('0x25'):_0x3edb8c;_0x59fb62=_0x59fb62===undefined?'5':_0x59fb62;_0x1de1be=_0x1de1be===undefined?'1':_0x1de1be;return this['sendRequest'](util['format'](_0xaaeb('0x26'),_0x3edb8c,_0x59fb62*0x3e8,_0x1de1be));};AGIChannel[_0xaaeb('0x20')][_0xaaeb('0x27')]=function(_0xbc2054){_0xbc2054=_0xbc2054||_0xaaeb('0x28');return this[_0xaaeb('0x23')](util['format'](_0xaaeb('0x29'),_0xbc2054));};AGIChannel[_0xaaeb('0x20')][_0xaaeb('0x2a')]=function(_0x3ca400,_0x167f31){if(_[_0xaaeb('0x2b')](_0x167f31)){return this[_0xaaeb('0x23')](util[_0xaaeb('0x2c')]('EXEC\x20%s\x20%s',_0x3ca400,_0x167f31[_0xaaeb('0x2d')](',')));}return this['sendRequest'](util[_0xaaeb('0x2c')](_0xaaeb('0x2e'),_0x3ca400,_0x167f31));};AGIChannel[_0xaaeb('0x20')][_0xaaeb('0x2f')]=function(_0x4b3fff){return this[_0xaaeb('0x23')](util['format']('SET\x20CONTEXT\x20%s',_0x4b3fff));};AGIChannel[_0xaaeb('0x20')][_0xaaeb('0x30')]=function(_0x5610b5){return this['sendRequest'](util[_0xaaeb('0x2c')](_0xaaeb('0x31'),_0x5610b5));};AGIChannel['prototype']['setPriority']=function(_0x754482){return this[_0xaaeb('0x23')](util[_0xaaeb('0x2c')]('SET\x20PRIORITY\x20%s',_0x754482));};AGIChannel['prototype']['hangup']=function(){return this[_0xaaeb('0x23')](_0xaaeb('0x32'));};AGIChannel['prototype'][_0xaaeb('0x33')]=function(_0x1ec563,_0x500819){var _0x3fe255=_[_0xaaeb('0x34')](_0x500819)||_[_0xaaeb('0x35')](_0x500819)?_0x500819['toString']():_0x500819;return this[_0xaaeb('0x23')](util[_0xaaeb('0x2c')](_0xaaeb('0x36'),_0x1ec563,_0x3fe255?_0x3fe255['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xaaeb('0x20')][_0xaaeb('0x37')]=function(_0x1faf49,_0x5041a4){return this[_0xaaeb('0x23')](util[_0xaaeb('0x2c')]('SAY\x20NUMBER\x20%s\x20%s',_0x1faf49,_0x5041a4));};AGIChannel[_0xaaeb('0x20')][_0xaaeb('0x38')]=function(_0x3288b7,_0x5e47a8){return this['sendRequest'](util[_0xaaeb('0x2c')](_0xaaeb('0x39'),_0x3288b7,_0x5e47a8));};AGIChannel[_0xaaeb('0x20')][_0xaaeb('0x3a')]=function(_0x5be89f,_0x5ee8b9){return this['sendRequest'](util[_0xaaeb('0x2c')](_0xaaeb('0x3b'),_0x5be89f,_0x5ee8b9));};AGIChannel['prototype']['continueAt']=function(_0x31e7ad,_0x5be881,_0x44db91){_0x5be881=_0x5be881||this[_0xaaeb('0x3c')];_0x44db91=_0x44db91||0x1;this[_0xaaeb('0x2f')](_0x31e7ad);this['setExtension'](_0x5be881);this[_0xaaeb('0x3d')](_0x44db91);return this[_0xaaeb('0x27')](util[_0xaaeb('0x2c')]('GOTO\x20%s\x20%s\x20%s',_0x31e7ad,_0x5be881,_0x44db91));};AGIChannel[_0xaaeb('0x20')][_0xaaeb('0x3e')]=function(_0x1dd3f7){return this[_0xaaeb('0x23')](util[_0xaaeb('0x2c')](_0xaaeb('0x3f'),_0x1dd3f7));};AGIChannel[_0xaaeb('0x20')][_0xaaeb('0x40')]=function(_0x586daf,_0x436829,_0x302fb5,_0x30de59,_0xc9e64c,_0x50fffb){_0x436829=_0x436829||_0xaaeb('0x41');_0x302fb5=_0x302fb5||'';_0x30de59=_0x30de59===undefined?-0x1:_0x30de59==='-1'?-0x1:_0x30de59*0x3e8;_0xc9e64c=_0xc9e64c===undefined?'':'s='+_0xc9e64c;_0x50fffb=_0x50fffb?_0xaaeb('0x42'):'';return this['sendRequest'](util[_0xaaeb('0x2c')](_0xaaeb('0x43'),_0x586daf,_0x436829,_0x302fb5,_0x30de59,_0x50fffb,_0xc9e64c));};AGIChannel[_0xaaeb('0x20')][_0xaaeb('0x44')]=function(_0x9153db,_0x22989f){_0x22989f=_0x22989f||'';return this[_0xaaeb('0x23')](util[_0xaaeb('0x2c')](_0xaaeb('0x45'),_0x9153db,_0x22989f));};AGIChannel[_0xaaeb('0x20')][_0xaaeb('0x46')]=function(_0x373d31){return this[_0xaaeb('0x2a')]('AGI',_0x373d31);};AGIChannel['prototype'][_0xaaeb('0x47')]=function(_0x3a48c6){return this['exec'](_0xaaeb('0x48'),_0x3a48c6);};AGIChannel[_0xaaeb('0x20')][_0xaaeb('0x17')]=function(_0x2ff428,_0x337374){this[_0xaaeb('0x27')](util[_0xaaeb('0x2c')](_0xaaeb('0x49'),_0x2ff428['id'],_0x2ff428[_0xaaeb('0x4a')],_0x337374));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 d43d7b5..4df979e 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 _0xf4d5=['message','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','E_AGI_UNDEFINED','push','format','apply'];(function(_0x2535df,_0x125763){var _0x5ef9e1=function(_0x31bad7){while(--_0x31bad7){_0x2535df['push'](_0x2535df['shift']());}};_0x5ef9e1(++_0x125763);}(_0xf4d5,0xd4));var _0x5f4d=function(_0x4db006,_0x3d27c1){_0x4db006=_0x4db006-0x0;var _0x493afc=_0xf4d5[_0x4db006];return _0x493afc;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x5f4d('0x0'),'E_AGI_ARGUMENT_PORT':_0x5f4d('0x1'),'E_AGI_SERVER_ERROR':_0x5f4d('0x2'),'E_AGI_SERVER_CLOSE':_0x5f4d('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x5f4d('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x5f4d('0x5'),'E_AGI_SOCKET_CLOSE':_0x5f4d('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x5f4d('0x7'),'E_AGI_COMMAND_EMPTY':_0x5f4d('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x3a22b4){var _0x3a22b4=_0x3a22b4||null,_0x157e05=_0x157e05||[],_0x531518=0x1,_0x5dbfb9='';if(!error[_0x3a22b4]){_0x3a22b4=_0x5f4d('0x9');}_0x157e05[_0x5f4d('0xa')](error[_0x3a22b4]);while(arguments[_0x531518]){_0x157e05[_0x5f4d('0xa')](arguments[_0x531518]);_0x531518++;}_0x5dbfb9=util[_0x5f4d('0xb')][_0x5f4d('0xc')](util,_0x157e05);this[_0x5f4d('0xd')]=_0x5dbfb9;this['name']=_0x3a22b4;}module[_0x5f4d('0xe')]=AGIError; \ No newline at end of file +var _0x5253=['exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','apply','name'];(function(_0x202c5b,_0x18cc8d){var _0x333417=function(_0x2d7a1a){while(--_0x2d7a1a){_0x202c5b['push'](_0x202c5b['shift']());}};_0x333417(++_0x18cc8d);}(_0x5253,0x1d5));var _0x3525=function(_0x3efef6,_0x300ade){_0x3efef6=_0x3efef6-0x0;var _0x30a662=_0x5253[_0x3efef6];return _0x30a662;};'use strict';var util=require(_0x3525('0x0'));var error={'E_AGI_UNDEFINED':_0x3525('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x3525('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x3525('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x3525('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x3525('0x5'),'E_AGI_COMMAND_EMPTY':_0x3525('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x3525('0x7'),'E_AGI_IVR_ENTRY':_0x3525('0x8')};function AGIError(_0x4a34e2){var _0x4a34e2=_0x4a34e2||null,_0x3a9e82=_0x3a9e82||[],_0x53f7d8=0x1,_0x790d99='';if(!error[_0x4a34e2]){_0x4a34e2='E_AGI_UNDEFINED';}_0x3a9e82[_0x3525('0x9')](error[_0x4a34e2]);while(arguments[_0x53f7d8]){_0x3a9e82[_0x3525('0x9')](arguments[_0x53f7d8]);_0x53f7d8++;}_0x790d99=util['format'][_0x3525('0xa')](util,_0x3a9e82);this['message']=_0x790d99;this[_0x3525('0xb')]=_0x4a34e2;}module[_0x3525('0xc')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 766a865..5cf6b48 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 _0x9675=['subscribe','emit','error','parse','E_AGI_SERVER_ERROR','exports','lodash','events','ioredis','../../config/environment','redis','localhost'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x9675,0x14a));var _0x5967=function(_0x53d138,_0x463ffe){_0x53d138=_0x53d138-0x0;var _0x1ef55f=_0x9675[_0x53d138];return _0x1ef55f;};'use strict';var _=require(_0x5967('0x0'));var EventEmitter=require(_0x5967('0x1'))['EventEmitter'];var Redis=require(_0x5967('0x2'));var AGIError=require('./error');var config=require(_0x5967('0x3'));config[_0x5967('0x4')]=_['defaults'](config[_0x5967('0x4')],{'host':_0x5967('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x5967('0x4')]);sub[_0x5967('0x6')]('agi',function(_0x15b550){if(_0x15b550)return eventEmitter[_0x5967('0x7')](_0x5967('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x15b550));});sub['on']('message',function(_0x333ddf,_0x3b4651){if(_0x333ddf!=='agi')return;try{var _0x31e5ca=JSON[_0x5967('0x9')](_0x3b4651);eventEmitter['emit']('projectUpdate',_0x31e5ca);}catch(_0x1d9975){eventEmitter[_0x5967('0x7')](_0x5967('0x8'),new AGIError(_0x5967('0xa'),_0x1d9975));}});module[_0x5967('0xb')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xac0c=['ioredis','./error','../../config/environment','redis','defaults','localhost','subscribe','agi','emit','message','parse','projectUpdate','error','E_AGI_SERVER_ERROR','exports','lodash','events','EventEmitter'];(function(_0xd5fd5c,_0x3e2a66){var _0x3b0663=function(_0x40643b){while(--_0x40643b){_0xd5fd5c['push'](_0xd5fd5c['shift']());}};_0x3b0663(++_0x3e2a66);}(_0xac0c,0x141));var _0xcac0=function(_0x5db657,_0x2f40b3){_0x5db657=_0x5db657-0x0;var _0x2d6e70=_0xac0c[_0x5db657];return _0x2d6e70;};'use strict';var _=require(_0xcac0('0x0'));var EventEmitter=require(_0xcac0('0x1'))[_0xcac0('0x2')];var Redis=require(_0xcac0('0x3'));var AGIError=require(_0xcac0('0x4'));var config=require(_0xcac0('0x5'));config[_0xcac0('0x6')]=_[_0xcac0('0x7')](config[_0xcac0('0x6')],{'host':_0xcac0('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xcac0('0x6')]);sub[_0xcac0('0x9')](_0xcac0('0xa'),function(_0x25e445){if(_0x25e445)return eventEmitter[_0xcac0('0xb')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x25e445));});sub['on'](_0xcac0('0xc'),function(_0xc21c7,_0x1eb6e9){if(_0xc21c7!=='agi')return;try{var _0x153da8=JSON[_0xcac0('0xd')](_0x1eb6e9);eventEmitter['emit'](_0xcac0('0xe'),_0x153da8);}catch(_0x4ccebb){eventEmitter[_0xcac0('0xb')](_0xcac0('0xf'),new AGIError(_0xcac0('0x10'),_0x4ccebb));}});module[_0xcac0('0x11')]={'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 d69071d..23ad60a 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 _0x6cdd=['traverseBFS','no\x20vertex\x20found','info','length','condition','agicommand','vswitch','default','target','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','getdigits','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','vertices','getVertex'];(function(_0x5094fe,_0xe45f2f){var _0x21a667=function(_0x5bb98b){while(--_0x5bb98b){_0x5094fe['push'](_0x5094fe['shift']());}};_0x21a667(++_0xe45f2f);}(_0x6cdd,0x137));var _0xd6cd=function(_0x5ab5a9,_0x17312a){_0x5ab5a9=_0x5ab5a9-0x0;var _0x37e495=_0x6cdd[_0x5ab5a9];return _0x37e495;};'use strict';var _=require(_0xd6cd('0x0'));var logger=require(_0xd6cd('0x1'))(_0xd6cd('0x2'));var verticesWithRetry=['menu',_0xd6cd('0x3'),'getsecretdigits'];var Graph=function(){this['vertices']={};this[_0xd6cd('0x4')]={};this[_0xd6cd('0x5')]=0x0;};Graph[_0xd6cd('0x6')][_0xd6cd('0x7')]=function(_0x490097){this['vertices'][_0x490097['id']]=_0x490097;this[_0xd6cd('0x4')][_0x490097['id']]=[];};Graph['prototype'][_0xd6cd('0x8')]=function(_0x1e833e,_0x5f07c6,_0x8eed2c){this[_0xd6cd('0x4')][_0x1e833e][_0xd6cd('0x9')]({'target':_0x5f07c6,'condition':_0x8eed2c});this[_0xd6cd('0x5')]+=0x1;};Graph[_0xd6cd('0x6')][_0xd6cd('0xa')]=function(){return _[_0xd6cd('0xa')](this[_0xd6cd('0xb')]);};Graph[_0xd6cd('0x6')]['relations']=function(){return this['numberOfEdges'];};Graph[_0xd6cd('0x6')][_0xd6cd('0xc')]=function(_0x505f16){return this[_0xd6cd('0xb')][_0x505f16];};Graph['prototype'][_0xd6cd('0xd')]=function(_0x284a2e,_0x55a4f0){if(!this[_0xd6cd('0xb')][_0x284a2e]){return logger['info'](_0xd6cd('0xe'));}var _0x1eed18=_0x55a4f0(this[_0xd6cd('0xb')][_0x284a2e]);if(!_0x1eed18){return logger[_0xd6cd('0xf')]('stop\x20traverse');}if(this[_0xd6cd('0x4')][_0x284a2e][_0xd6cd('0x10')]===0x0){return logger[_0xd6cd('0xf')]('no\x20edge/s\x20available');}for(var _0x53d69d=0x0,_0x44404a=[],_0x18eed4=![];_0x53d69d\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','indexOf','agi_','substring','debug','variables','stringify','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','catch','./server','listening'];(function(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0xfb5c,0x119));var _0xcfb5=function(_0x284506,_0x191316){_0x284506=_0x284506-0x0;var _0x1e9ee5=_0xfb5c[_0x284506];return _0x1e9ee5;};'use strict';var _=require('lodash');var syncho=require(_0xcfb5('0x0'));var util=require(_0xcfb5('0x1'));var config=require(_0xcfb5('0x2'));var logger=require(_0xcfb5('0x3'))(_0xcfb5('0x4'));var utilLicense=require(_0xcfb5('0x5'));var rpc=require(_0xcfb5('0x6'));var Project=require(_0xcfb5('0x7'));var AGIEmitter=require(_0xcfb5('0x8'))[_0xcfb5('0x9')];var projects=[];config[_0xcfb5('0x4')]=_[_0xcfb5('0xa')](config[_0xcfb5('0x4')],{'ip':_0xcfb5('0xb'),'port':0x11dd});AGIEmitter['on'](_0xcfb5('0xc'),projectUpdateHandler);function connectionHandler(_0x2d5803){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x2d5803);agiHandler(_0x2d5803);}catch(_0x26e7c3){logger['error'](_0x26e7c3[_0xcfb5('0xd')]);}});});}function projectUpdateHandler(_0x56ebcf){try{var _0x244d0c=_[_0xcfb5('0xe')](projects,['id',_0x56ebcf['id']]);if(_0x244d0c>-0x1){if(_0x56ebcf[_0xcfb5('0xf')]===!![]){projects['splice'](_0x244d0c,0x1);}else{projects[_0x244d0c]=_0x56ebcf;}}else{projects[_0xcfb5('0x10')](_0x56ebcf);}}catch(_0x2e03f8){logger[_0xcfb5('0x11')](_0x2e03f8['stack']);}}function listeningHandler(){console[_0xcfb5('0x12')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xcfb5('0x4')][_0xcfb5('0x13')]);logger[_0xcfb5('0x14')](util[_0xcfb5('0x15')](_0xcfb5('0x16'),config['agi']['ip'],config[_0xcfb5('0x4')][_0xcfb5('0x13')]));}function errorHandler(_0x54001d){if(_0x54001d&&_0x54001d[_0xcfb5('0x17')]&&_0x54001d[_0xcfb5('0x18')]){logger[_0xcfb5('0x11')](util['format'](_0xcfb5('0x19'),_0x54001d['name'],_0x54001d['message']));}else{logger['error'](util[_0xcfb5('0x15')](_0xcfb5('0x1a'),_0x54001d['stack']));}}function closeHandler(){logger['info'](util[_0xcfb5('0x15')](_0xcfb5('0x1b'),this[_0xcfb5('0x1c')],this[_0xcfb5('0x1d')],this[_0xcfb5('0x1e')],this['dnid'],this[_0xcfb5('0x1f')]));try{createSquareReport(this);}catch(_0x8bacdb){logger[_0xcfb5('0x11')](_0x8bacdb[_0xcfb5('0xd')]);}}function timeoutHandler(){logger[_0xcfb5('0x14')](util['format'](_0xcfb5('0x20'),this[_0xcfb5('0x1c')],this[_0xcfb5('0x1d')],this[_0xcfb5('0x1e')],this[_0xcfb5('0x21')],this[_0xcfb5('0x1f')]));}function hangupHandler(){logger[_0xcfb5('0x14')](util[_0xcfb5('0x15')](_0xcfb5('0x22'),this[_0xcfb5('0x1c')],this['calleridname'],this['callerid'],this[_0xcfb5('0x21')],this[_0xcfb5('0x1f')]));this[_0xcfb5('0x23')]=!![];}function createSquareReport(_0x3d40db,_0x2dc980){rpc[_0xcfb5('0x24')](_0x3d40db)[_0xcfb5('0x25')](function(_0x425565){if(_0x2dc980){_0x2dc980(null,_0x425565);}})['catch'](function(_0x11af44){if(_0x2dc980){_0x2dc980(null,_0x11af44);}});}function setChannelVariables(_0x42d926){for(var _0xb116bc in _0x42d926){if(_0x42d926['hasOwnProperty'](_0xb116bc)){if(_0xb116bc[_0xcfb5('0x26')](_0xcfb5('0x27'))===0x0){_0x42d926[_0xb116bc[_0xcfb5('0x28')](0x4)]=_0x42d926[_0xb116bc];delete _0x42d926[_0xb116bc];}}}}function agiHandler(_0x13bd2f){logger[_0xcfb5('0x29')](_0xcfb5('0x2a'),JSON[_0xcfb5('0x2b')](_0x13bd2f,null,0x2));logger[_0xcfb5('0x14')](util[_0xcfb5('0x15')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x13bd2f[_0xcfb5('0x1c')],_0x13bd2f['calleridname'],_0x13bd2f[_0xcfb5('0x1e')],_0x13bd2f[_0xcfb5('0x21')],_0x13bd2f[_0xcfb5('0x1f')]));_0x13bd2f['on'](_0xcfb5('0x11'),errorHandler);_0x13bd2f['on']('close',closeHandler);_0x13bd2f['on']('timeout',timeoutHandler);_0x13bd2f[_0xcfb5('0x23')]=![];_0x13bd2f['on']('hangup',hangupHandler);var _0x2b4607=_[_0xcfb5('0x2c')](projects,[_0xcfb5('0x17'),_0x13bd2f[_0xcfb5('0x1c')]]);if(!_0x2b4607)return Project[_0xcfb5('0x2d')](_0x13bd2f);if(!_0x2b4607[_0xcfb5('0x2e')])return Project[_0xcfb5('0x2f')](_0x13bd2f);return Project[_0xcfb5('0x30')](_0x2b4607,_0x13bd2f);}function main(){var _0x46f2e9;return utilLicense[_0xcfb5('0x31')]()['then'](function(_0x103692){if(!_0x103692)return;if(_0x103692[_0xcfb5('0x32')]){if(_0x103692['callysquare']&&_0x103692['callysquare']>0x0){logger[_0xcfb5('0x14')](util[_0xcfb5('0x15')]('[LICENSE]\x20CHANNELS:\x20%s',_0x103692[_0xcfb5('0x33')]));_0x46f2e9=_0x103692[_0xcfb5('0x33')];}else{logger[_0xcfb5('0x14')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xcfb5('0x14')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x46f2e9=-0x1;}})['then'](function(){return Project['getAll']();})[_0xcfb5('0x25')](function(_0x4bfeab){projects=_0x4bfeab;return;})[_0xcfb5('0x34')](function(_0x5b5f32){logger[_0xcfb5('0x11')]('[LICENSE]',_0x5b5f32[_0xcfb5('0xd')]);})['finally'](function(){var _0x589481=require(_0xcfb5('0x35'))(config[_0xcfb5('0x4')][_0xcfb5('0x13')],config[_0xcfb5('0x4')]['ip'],_0x46f2e9);_0x589481['on'](_0xcfb5('0x11'),errorHandler);_0x589481['on'](_0xcfb5('0x36'),listeningHandler);_0x589481['on'](_0xcfb5('0x37'),connectionHandler);_0x589481['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x2ee0=['[%s]\x20%s','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','uniqueid','info','callerid','dnid','evtHangup','createSquareReport','then','catch','hasOwnProperty','agi_','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','find','handleNotFound','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','./server','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./events','EventEmitter','defaults','nextTick','stack','findIndex','deleted','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x2ee0,0x13b));var _0x02ee=function(_0x558050,_0x174ec4){_0x558050=_0x558050-0x0;var _0x3ee149=_0x2ee0[_0x558050];return _0x3ee149;};'use strict';var _=require(_0x02ee('0x0'));var syncho=require(_0x02ee('0x1'));var util=require(_0x02ee('0x2'));var config=require(_0x02ee('0x3'));var logger=require(_0x02ee('0x4'))(_0x02ee('0x5'));var utilLicense=require(_0x02ee('0x6'));var rpc=require('./rpc');var Project=require('./project');var AGIEmitter=require(_0x02ee('0x7'))[_0x02ee('0x8')];var projects=[];config['agi']=_[_0x02ee('0x9')](config[_0x02ee('0x5')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x576c79){process[_0x02ee('0xa')](function(){syncho(function(){try{setChannelVariables(_0x576c79);agiHandler(_0x576c79);}catch(_0x4380ab){logger['error'](_0x4380ab[_0x02ee('0xb')]);}});});}function projectUpdateHandler(_0x232f1c){try{var _0x342d52=_[_0x02ee('0xc')](projects,['id',_0x232f1c['id']]);if(_0x342d52>-0x1){if(_0x232f1c[_0x02ee('0xd')]===!![]){projects['splice'](_0x342d52,0x1);}else{projects[_0x342d52]=_0x232f1c;}}else{projects[_0x02ee('0xe')](_0x232f1c);}}catch(_0x57532f){logger[_0x02ee('0xf')](_0x57532f[_0x02ee('0xb')]);}}function listeningHandler(){console[_0x02ee('0x10')](_0x02ee('0x11'),config[_0x02ee('0x5')][_0x02ee('0x12')]);logger['info'](util[_0x02ee('0x13')](_0x02ee('0x14'),config[_0x02ee('0x5')]['ip'],config['agi'][_0x02ee('0x12')]));}function errorHandler(_0x414548){if(_0x414548&&_0x414548['name']&&_0x414548['message']){logger[_0x02ee('0xf')](util[_0x02ee('0x13')](_0x02ee('0x15'),_0x414548[_0x02ee('0x16')],_0x414548[_0x02ee('0x17')]));}else{logger['error'](util[_0x02ee('0x13')](_0x02ee('0x18'),_0x414548[_0x02ee('0xb')]));}}function closeHandler(){logger['info'](util[_0x02ee('0x13')](_0x02ee('0x19'),this[_0x02ee('0x1a')],this[_0x02ee('0x1b')],this['callerid'],this['dnid'],this[_0x02ee('0x1c')]));try{createSquareReport(this);}catch(_0x5ca214){logger[_0x02ee('0xf')](_0x5ca214[_0x02ee('0xb')]);}}function timeoutHandler(){logger[_0x02ee('0x1d')](util[_0x02ee('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x02ee('0x1a')],this[_0x02ee('0x1b')],this[_0x02ee('0x1e')],this[_0x02ee('0x1f')],this[_0x02ee('0x1c')]));}function hangupHandler(){logger[_0x02ee('0x1d')](util[_0x02ee('0x13')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x02ee('0x1a')],this[_0x02ee('0x1b')],this[_0x02ee('0x1e')],this[_0x02ee('0x1f')],this['uniqueid']));this[_0x02ee('0x20')]=!![];}function createSquareReport(_0x29811a,_0x4a6caf){rpc[_0x02ee('0x21')](_0x29811a)[_0x02ee('0x22')](function(_0x150089){if(_0x4a6caf){_0x4a6caf(null,_0x150089);}})[_0x02ee('0x23')](function(_0x470251){if(_0x4a6caf){_0x4a6caf(null,_0x470251);}});}function setChannelVariables(_0x49eb55){for(var _0x56a942 in _0x49eb55){if(_0x49eb55[_0x02ee('0x24')](_0x56a942)){if(_0x56a942['indexOf'](_0x02ee('0x25'))===0x0){_0x49eb55[_0x56a942['substring'](0x4)]=_0x49eb55[_0x56a942];delete _0x49eb55[_0x56a942];}}}}function agiHandler(_0x3b020e){logger[_0x02ee('0x26')](_0x02ee('0x27'),JSON['stringify'](_0x3b020e,null,0x2));logger[_0x02ee('0x1d')](util[_0x02ee('0x13')](_0x02ee('0x28'),_0x3b020e[_0x02ee('0x1a')],_0x3b020e['calleridname'],_0x3b020e[_0x02ee('0x1e')],_0x3b020e[_0x02ee('0x1f')],_0x3b020e[_0x02ee('0x1c')]));_0x3b020e['on'](_0x02ee('0xf'),errorHandler);_0x3b020e['on'](_0x02ee('0x29'),closeHandler);_0x3b020e['on'](_0x02ee('0x2a'),timeoutHandler);_0x3b020e['evtHangup']=![];_0x3b020e['on'](_0x02ee('0x2b'),hangupHandler);var _0x5d6ec7=_[_0x02ee('0x2c')](projects,[_0x02ee('0x16'),_0x3b020e[_0x02ee('0x1a')]]);if(!_0x5d6ec7)return Project[_0x02ee('0x2d')](_0x3b020e);if(!_0x5d6ec7['production'])return Project[_0x02ee('0x2e')](_0x3b020e);return Project[_0x02ee('0x2f')](_0x5d6ec7,_0x3b020e);}function main(){var _0x23b2fa;return utilLicense[_0x02ee('0x30')]()[_0x02ee('0x22')](function(_0x52ccc8){if(!_0x52ccc8)return;if(_0x52ccc8['voice']){if(_0x52ccc8[_0x02ee('0x31')]&&_0x52ccc8[_0x02ee('0x31')]>0x0){logger[_0x02ee('0x1d')](util[_0x02ee('0x13')]('[LICENSE]\x20CHANNELS:\x20%s',_0x52ccc8[_0x02ee('0x31')]));_0x23b2fa=_0x52ccc8['callysquare'];}else{logger[_0x02ee('0x1d')](_0x02ee('0x32'));}}else{logger[_0x02ee('0x1d')](_0x02ee('0x33'));_0x23b2fa=-0x1;}})['then'](function(){return Project[_0x02ee('0x34')]();})[_0x02ee('0x22')](function(_0x4e67be){projects=_0x4e67be;return;})[_0x02ee('0x23')](function(_0x4811d2){logger['error']('[LICENSE]',_0x4811d2[_0x02ee('0xb')]);})['finally'](function(){var _0x1ebcfb=require(_0x02ee('0x35'))(config[_0x02ee('0x5')][_0x02ee('0x12')],config['agi']['ip'],_0x23b2fa);_0x1ebcfb['on'](_0x02ee('0xf'),errorHandler);_0x1ebcfb['on'](_0x02ee('0x36'),listeningHandler);_0x1ebcfb['on'](_0x02ee('0x37'),connectionHandler);_0x1ebcfb['on'](_0x02ee('0x29'),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 b733c22..94bd8e6 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 _0x3a9a=['result','catch','SendMail','bluebird','jayson/promise','client','request','then','error','message'];(function(_0x1ac4af,_0x456013){var _0x53ee46=function(_0x5c2298){while(--_0x5c2298){_0x1ac4af['push'](_0x1ac4af['shift']());}};_0x53ee46(++_0x456013);}(_0x3a9a,0x139));var _0xa3a9=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x3a9a[_0x215e65];return _0xa85842;};'use strict';var BPromise=require(_0xa3a9('0x0'));var jayson=require(_0xa3a9('0x1'));var client=jayson[_0xa3a9('0x2')]['http']({'port':0x232b});function request(_0x55d21a,_0x2b0a1b){return new BPromise(function(_0x125632,_0x1dedaf){return client[_0xa3a9('0x3')](_0x55d21a,_0x2b0a1b)[_0xa3a9('0x4')](function(_0x3a4d40){if(_0x3a4d40[_0xa3a9('0x5')]){return _0x1dedaf(_0x3a4d40['error'][_0xa3a9('0x6')]);}else{return _0x125632(_0x3a4d40[_0xa3a9('0x7')]);}})[_0xa3a9('0x8')](function(_0x3ebcad){return _0x1dedaf(_0x3ebcad);});});}exports['sendMailMessage']=function(_0x3a3dd5,_0x393ea2){return request(_0xa3a9('0x9'),{'account':_0x3a3dd5,'message':_0x393ea2});}; \ No newline at end of file +var _0xd2a3=['error','result','sendMailMessage','SendMail','bluebird','jayson/promise','request','then'];(function(_0x1444b3,_0x292fa5){var _0x253325=function(_0x39071d){while(--_0x39071d){_0x1444b3['push'](_0x1444b3['shift']());}};_0x253325(++_0x292fa5);}(_0xd2a3,0x94));var _0x3d2a=function(_0x28e7e7,_0x323032){_0x28e7e7=_0x28e7e7-0x0;var _0x18a3b8=_0xd2a3[_0x28e7e7];return _0x18a3b8;};'use strict';var BPromise=require(_0x3d2a('0x0'));var jayson=require(_0x3d2a('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x3cc99e,_0xcc1b95){return new BPromise(function(_0x503400,_0x4233b1){return client[_0x3d2a('0x2')](_0x3cc99e,_0xcc1b95)[_0x3d2a('0x3')](function(_0x49ac51){if(_0x49ac51[_0x3d2a('0x4')]){return _0x4233b1(_0x49ac51[_0x3d2a('0x4')]['message']);}else{return _0x503400(_0x49ac51[_0x3d2a('0x5')]);}})['catch'](function(_0xd110cd){return _0x4233b1(_0xd110cd);});});}exports[_0x3d2a('0x6')]=function(_0x2db3ee,_0x2160af){return request(_0x3d2a('0x7'),{'account':_0x2db3ee,'message':_0x2160af});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 81fc638..79258e9 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 _0xde11=['code','result','evtHangup','response','isUndefined','toString','agicommand\x20not\x20found','finally','callerid','dnid','traverseBFS','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','close','Project\x20%s\x20not\x20found','continueAt','exports','lodash','xml2json','util','../../config/logger','agi','./rpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','toJson','mxGraphModel','root','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','agicommand'];(function(_0xbdf6b4,_0x251d4e){var _0x1ba78d=function(_0x24e9f6){while(--_0x24e9f6){_0xbdf6b4['push'](_0xbdf6b4['shift']());}};_0x1ba78d(++_0x251d4e);}(_0xde11,0x1c3));var _0x1de1=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0xde11[_0x3b19ea];return _0x40ece9;};'use strict';var _=require(_0x1de1('0x0'));var moment=require('moment');var parser=require(_0x1de1('0x1'));var util=require(_0x1de1('0x2'));var logger=require(_0x1de1('0x3'))(_0x1de1('0x4'));var rpc=require(_0x1de1('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0x1de1('0x6'));var Vertices=require(_0x1de1('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x1de1('0x8')]()[_0x1de1('0x9')](function(_0x497a62){logger[_0x1de1('0xa')](_0x1de1('0xb'),_0x497a62[_0x1de1('0xc')]);return[];});}function addVertex(_0x48b4da,_0xc533de,_0x1a2caf){_0xc533de['agicommand']=_0x1a2caf;if(_0xc533de['hasOwnProperty'](_0x1de1('0xd'))){_0xc533de[_0x1de1('0xe')]=parseInt(_0xc533de['retry'],0xa);}_0x48b4da[_0x1de1('0xf')](_[_0x1de1('0x10')](_0xc533de,_0x1de1('0x11')));}function initGraph(_0x33629c,_0x484abf){var _0x202176=new Graph();for(var _0x3f723d in _0x33629c){if(_0x33629c[_0x1de1('0x12')](_0x3f723d)){if(_[_0x1de1('0x13')](_0x33629c[_0x3f723d])){for(var _0xd6f6cc=0x0;_0xd6f6cc<_0x33629c[_0x3f723d][_0x1de1('0x14')];_0xd6f6cc+=0x1){addVertex(_0x202176,_0x33629c[_0x3f723d][_0xd6f6cc],_0x3f723d);}}else{addVertex(_0x202176,_0x33629c[_0x3f723d],_0x3f723d);}}}for(var _0x185aed=0x0;_0x185aed<_0x484abf['length'];_0x185aed+=0x1){if(_0x484abf[_0x185aed][_0x1de1('0x15')]&&_0x484abf[_0x185aed][_0x1de1('0x16')]){_0x202176['addEdge'](_0x484abf[_0x185aed]['source'],_0x484abf[_0x185aed][_0x1de1('0x16')],_0x484abf[_0x185aed]['value']);}}return _0x202176;}function getRoot(_0x270e20){return parser[_0x1de1('0x17')](_0x270e20,{'object':!![]})[_0x1de1('0x18')][_0x1de1('0x19')];}function inspect(_0x70c1b){return util['inspect'](_0x70c1b,{'showHidden':![],'depth':null});}function initialize(_0x102761,_0x7bb4f3){var _0x919648=getRoot(_0x102761[_0x1de1('0x1a')]);if(!_0x919648||!_0x919648[_0x1de1('0x1b')])return;var _0x534ef4,_0xc184cf,_0x21e2f4;logger[_0x1de1('0x1c')]('root',JSON[_0x1de1('0x1d')](_0x919648,null,0x2));_0x7bb4f3[_0x1de1('0x1e')]=moment()[_0x1de1('0x1f')](_0x1de1('0x20'));_0x534ef4=initGraph(_[_0x1de1('0x10')](_0x919648,_0x1de1('0x11')),_0x919648[_0x1de1('0x11')]);_0xc184cf=new Vertices(_0x7bb4f3,rpc,mailRpc);logger[_0x1de1('0x21')](util['format'](_0x1de1('0x22'),_0x7bb4f3['arg_1'],_0x7bb4f3[_0x1de1('0x23')],_0x7bb4f3['callerid'],_0x7bb4f3['dnid'],_0x7bb4f3[_0x1de1('0x24')]));_0x534ef4['traverseBFS'](_0x919648[_0x1de1('0x1b')]['id'],function(_0x406451){try{_0x406451=_0xc184cf[_0x1de1('0x25')](_0x406451);logger[_0x1de1('0x1c')](_0x1de1('0x26'),JSON[_0x1de1('0x1d')](_0x406451,null,0x2));if(_0x406451['agicommand']===_0x1de1('0x27')){logger[_0x1de1('0x21')](_0x1de1('0x28'));_0x7bb4f3[_0x1de1('0x29')]=_0x406451[_0x1de1('0x29')]||_0x7bb4f3[_0x1de1('0x29')];_0x7bb4f3[_0x1de1('0x2a')]=_0x406451[_0x1de1('0x2a')];_0x7bb4f3[_0x1de1('0x2b')]=_0x406451['priority']?_0x406451[_0x1de1('0x2b')]-0x1:0x1;return null;}else if(_0x406451&&_0xc184cf[_0x406451[_0x1de1('0x2c')]]){_0x21e2f4=_0xc184cf[_0x406451[_0x1de1('0x2c')]](_0x406451);logger[_0x1de1('0x21')]('response',JSON[_0x1de1('0x1d')](_0x21e2f4,null,0x2));if(_0x21e2f4&&_0x21e2f4[_0x1de1('0x2d')]===AGI_CODE_SUCCESS&&_0x21e2f4[_0x1de1('0x2e')]!==AGI_RESULT_ERROR&&!_0x7bb4f3[_0x1de1('0x2f')]){logger['debug'](_0x1de1('0x30'),inspect(_0x21e2f4));return _[_0x1de1('0x31')](_0x21e2f4[_0x1de1('0x2e')])?null:_0x21e2f4['result'][_0x1de1('0x32')]();}else{logger[_0x1de1('0xa')](_0x1de1('0x30'),inspect(_0x21e2f4));return null;}}else{logger[_0x1de1('0xa')](_0x1de1('0x33'));return null;}}catch(_0x42d25f){logger[_0x1de1('0xa')](_0x42d25f[_0x1de1('0xc')]);return null;}});if(_0x919648[_0x1de1('0x34')]){logger[_0x1de1('0x21')](util[_0x1de1('0x1f')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x7bb4f3['arg_1'],_0x7bb4f3[_0x1de1('0x23')],_0x7bb4f3[_0x1de1('0x35')],_0x7bb4f3[_0x1de1('0x36')],_0x7bb4f3['uniqueid']));_0x534ef4[_0x1de1('0x37')](_0x919648[_0x1de1('0x34')]['id'],function(_0x46e4a5){try{_0x46e4a5=_0xc184cf[_0x1de1('0x25')](_0x46e4a5);logger[_0x1de1('0x1c')](_0x1de1('0x26'),JSON[_0x1de1('0x1d')](_0x46e4a5,null,0x2));if(_0x46e4a5&&_0xc184cf[_0x46e4a5[_0x1de1('0x2c')]]){_0x21e2f4=_0xc184cf[_0x46e4a5[_0x1de1('0x2c')]](_0x46e4a5);if(_0x21e2f4){logger[_0x1de1('0x1c')](_0x1de1('0x30'),inspect(_0x21e2f4));return _['isUndefined'](_0x21e2f4[_0x1de1('0x2e')])?null:_0x21e2f4['result']['toString']();}else{logger['error'](_0x1de1('0x30'),inspect(_0x21e2f4));return null;}}else{logger[_0x1de1('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x33142e){logger[_0x1de1('0xa')](_0x33142e[_0x1de1('0xc')]);return null;}});}logger['info'](util[_0x1de1('0x1f')](_0x1de1('0x38'),_0x7bb4f3[_0x1de1('0x39')],_0x7bb4f3[_0x1de1('0x23')],_0x7bb4f3['callerid'],_0x7bb4f3[_0x1de1('0x36')],_0x7bb4f3['uniqueid']));logger['info'](util[_0x1de1('0x1f')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x7bb4f3[_0x1de1('0x29')],_0x7bb4f3[_0x1de1('0x2a')],parseInt(_0x7bb4f3[_0x1de1('0x2b')],0xa)+0x1));_0x7bb4f3['continueAt'](_0x7bb4f3[_0x1de1('0x29')],_0x7bb4f3['extension'],parseInt(_0x7bb4f3[_0x1de1('0x2b')],0xa)+0x1);_0x7bb4f3[_0x1de1('0x3a')]();}function handleNotFound(_0x5d97d2){logger[_0x1de1('0xa')](util[_0x1de1('0x1f')](_0x1de1('0x3b'),_0x5d97d2['arg_1']));_0x5d97d2[_0x1de1('0x3c')](_0x5d97d2[_0x1de1('0x29')],_0x5d97d2[_0x1de1('0x2a')],parseInt(_0x5d97d2[_0x1de1('0x2b')],0xa)+0x1);_0x5d97d2[_0x1de1('0x3a')]();}function handleUnpublished(_0x22136e){logger[_0x1de1('0xa')](util[_0x1de1('0x1f')]('Project\x20%s\x20not\x20published',_0x22136e['arg_1']));_0x22136e[_0x1de1('0x3c')](_0x22136e[_0x1de1('0x29')],_0x22136e['extension'],parseInt(_0x22136e[_0x1de1('0x2b')],0xa)+0x1);_0x22136e[_0x1de1('0x3a')]();}module[_0x1de1('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x50a4=['dnid','continueAt','Project\x20%s\x20not\x20found','close','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger','agi','./mailRpc','./vertices','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','addVertex','omit','mxCell','source','target','addEdge','value','mxGraphModel','inspect','production','debug','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','start','clear','vertex','agicommand','gotoc','context','extension','priority','stringify','result','evtHangup','response','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','finally','isUndefined','agicommand\x20not\x20found'];(function(_0x2514e2,_0x7490ad){var _0x28b546=function(_0x250a47){while(--_0x250a47){_0x2514e2['push'](_0x2514e2['shift']());}};_0x28b546(++_0x7490ad);}(_0x50a4,0xb4));var _0x450a=function(_0x5e0406,_0x21dfea){_0x5e0406=_0x5e0406-0x0;var _0x81d10=_0x50a4[_0x5e0406];return _0x81d10;};'use strict';var _=require(_0x450a('0x0'));var moment=require(_0x450a('0x1'));var parser=require(_0x450a('0x2'));var util=require(_0x450a('0x3'));var logger=require(_0x450a('0x4'))(_0x450a('0x5'));var rpc=require('./rpc');var mailRpc=require(_0x450a('0x6'));var Graph=require('./graph');var Vertices=require(_0x450a('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x450a('0x8')]()['catch'](function(_0x396b75){logger[_0x450a('0x9')](_0x450a('0xa'),_0x396b75[_0x450a('0xb')]);return[];});}function addVertex(_0x30f5f2,_0x3e675b,_0x8d59ee){_0x3e675b['agicommand']=_0x8d59ee;if(_0x3e675b[_0x450a('0xc')](_0x450a('0xd'))){_0x3e675b['maxRetry']=parseInt(_0x3e675b[_0x450a('0xd')],0xa);}_0x30f5f2[_0x450a('0xe')](_[_0x450a('0xf')](_0x3e675b,_0x450a('0x10')));}function initGraph(_0x13253f,_0x5ed007){var _0x48e4be=new Graph();for(var _0x35d2f8 in _0x13253f){if(_0x13253f[_0x450a('0xc')](_0x35d2f8)){if(_['isArray'](_0x13253f[_0x35d2f8])){for(var _0x12a6b7=0x0;_0x12a6b7<_0x13253f[_0x35d2f8]['length'];_0x12a6b7+=0x1){addVertex(_0x48e4be,_0x13253f[_0x35d2f8][_0x12a6b7],_0x35d2f8);}}else{addVertex(_0x48e4be,_0x13253f[_0x35d2f8],_0x35d2f8);}}}for(var _0x215284=0x0;_0x215284<_0x5ed007['length'];_0x215284+=0x1){if(_0x5ed007[_0x215284][_0x450a('0x11')]&&_0x5ed007[_0x215284][_0x450a('0x12')]){_0x48e4be[_0x450a('0x13')](_0x5ed007[_0x215284][_0x450a('0x11')],_0x5ed007[_0x215284][_0x450a('0x12')],_0x5ed007[_0x215284][_0x450a('0x14')]);}}return _0x48e4be;}function getRoot(_0x1ed445){return parser['toJson'](_0x1ed445,{'object':!![]})[_0x450a('0x15')]['root'];}function inspect(_0x17a011){return util[_0x450a('0x16')](_0x17a011,{'showHidden':![],'depth':null});}function initialize(_0x51dac4,_0x451e22){var _0x60aead=getRoot(_0x51dac4[_0x450a('0x17')]);if(!_0x60aead||!_0x60aead['start'])return;var _0x209eb1,_0x2cb073,_0x2dc1ea;logger[_0x450a('0x18')](_0x450a('0x19'),JSON['stringify'](_0x60aead,null,0x2));_0x451e22[_0x450a('0x1a')]=moment()['format'](_0x450a('0x1b'));_0x209eb1=initGraph(_[_0x450a('0xf')](_0x60aead,_0x450a('0x10')),_0x60aead[_0x450a('0x10')]);_0x2cb073=new Vertices(_0x451e22,rpc,mailRpc);logger[_0x450a('0x1c')](util[_0x450a('0x1d')](_0x450a('0x1e'),_0x451e22[_0x450a('0x1f')],_0x451e22[_0x450a('0x20')],_0x451e22[_0x450a('0x21')],_0x451e22['dnid'],_0x451e22['uniqueid']));_0x209eb1['traverseBFS'](_0x60aead[_0x450a('0x22')]['id'],function(_0x1a0299){try{_0x1a0299=_0x2cb073[_0x450a('0x23')](_0x1a0299);logger[_0x450a('0x18')](_0x450a('0x24'),JSON['stringify'](_0x1a0299,null,0x2));if(_0x1a0299[_0x450a('0x25')]===_0x450a('0x26')){logger[_0x450a('0x1c')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x451e22['context']=_0x1a0299[_0x450a('0x27')]||_0x451e22['context'];_0x451e22[_0x450a('0x28')]=_0x1a0299[_0x450a('0x28')];_0x451e22['priority']=_0x1a0299['priority']?_0x1a0299[_0x450a('0x29')]-0x1:0x1;return null;}else if(_0x1a0299&&_0x2cb073[_0x1a0299[_0x450a('0x25')]]){_0x2dc1ea=_0x2cb073[_0x1a0299[_0x450a('0x25')]](_0x1a0299);logger[_0x450a('0x1c')]('response',JSON[_0x450a('0x2a')](_0x2dc1ea,null,0x2));if(_0x2dc1ea&&_0x2dc1ea['code']===AGI_CODE_SUCCESS&&_0x2dc1ea[_0x450a('0x2b')]!==AGI_RESULT_ERROR&&!_0x451e22[_0x450a('0x2c')]){logger[_0x450a('0x18')](_0x450a('0x2d'),inspect(_0x2dc1ea));return _['isUndefined'](_0x2dc1ea[_0x450a('0x2b')])?null:_0x2dc1ea[_0x450a('0x2b')][_0x450a('0x2e')]();}else{logger['error'](_0x450a('0x2d'),inspect(_0x2dc1ea));return null;}}else{logger[_0x450a('0x9')]('agicommand\x20not\x20found');return null;}}catch(_0x1d2a9a){logger['error'](_0x1d2a9a['stack']);return null;}});if(_0x60aead['finally']){logger['info'](util[_0x450a('0x1d')](_0x450a('0x2f'),_0x451e22[_0x450a('0x1f')],_0x451e22['calleridname'],_0x451e22[_0x450a('0x21')],_0x451e22['dnid'],_0x451e22[_0x450a('0x30')]));_0x209eb1['traverseBFS'](_0x60aead[_0x450a('0x31')]['id'],function(_0x305a84){try{_0x305a84=_0x2cb073[_0x450a('0x23')](_0x305a84);logger[_0x450a('0x18')](_0x450a('0x24'),JSON[_0x450a('0x2a')](_0x305a84,null,0x2));if(_0x305a84&&_0x2cb073[_0x305a84['agicommand']]){_0x2dc1ea=_0x2cb073[_0x305a84[_0x450a('0x25')]](_0x305a84);if(_0x2dc1ea){logger[_0x450a('0x18')](_0x450a('0x2d'),inspect(_0x2dc1ea));return _[_0x450a('0x32')](_0x2dc1ea[_0x450a('0x2b')])?null:_0x2dc1ea[_0x450a('0x2b')]['toString']();}else{logger[_0x450a('0x9')]('response',inspect(_0x2dc1ea));return null;}}else{logger['error'](_0x450a('0x33'));return null;}}catch(_0x2e9480){logger[_0x450a('0x9')](_0x2e9480[_0x450a('0xb')]);return null;}});}logger['info'](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x451e22[_0x450a('0x1f')],_0x451e22['calleridname'],_0x451e22['callerid'],_0x451e22[_0x450a('0x34')],_0x451e22[_0x450a('0x30')]));logger[_0x450a('0x1c')](util[_0x450a('0x1d')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x451e22[_0x450a('0x27')],_0x451e22['extension'],parseInt(_0x451e22[_0x450a('0x29')],0xa)+0x1));_0x451e22[_0x450a('0x35')](_0x451e22[_0x450a('0x27')],_0x451e22['extension'],parseInt(_0x451e22['priority'],0xa)+0x1);_0x451e22['close']();}function handleNotFound(_0x49ec66){logger[_0x450a('0x9')](util[_0x450a('0x1d')](_0x450a('0x36'),_0x49ec66['arg_1']));_0x49ec66[_0x450a('0x35')](_0x49ec66[_0x450a('0x27')],_0x49ec66['extension'],parseInt(_0x49ec66[_0x450a('0x29')],0xa)+0x1);_0x49ec66[_0x450a('0x37')]();}function handleUnpublished(_0x39d535){logger['error'](util[_0x450a('0x1d')](_0x450a('0x38'),_0x39d535['arg_1']));_0x39d535[_0x450a('0x35')](_0x39d535[_0x450a('0x27')],_0x39d535['extension'],parseInt(_0x39d535['priority'],0xa)+0x1);_0x39d535[_0x450a('0x37')]();}module[_0x450a('0x39')]={'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 3ad71b7..e67dc1f 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 _0xc859=['trim','emit','headers','line','exports','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice'];(function(_0x1a3452,_0x30067c){var _0x2e4de5=function(_0x44411e){while(--_0x44411e){_0x1a3452['push'](_0x1a3452['shift']());}};_0x2e4de5(++_0x30067c);}(_0xc859,0x17b));var _0x9c85=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xc859[_0x54d4a8];return _0x3b321b;};'use strict';var util=require('util');var Transform=require(_0x9c85('0x0'))[_0x9c85('0x1')];function AGIReply(_0x128e24){Transform[_0x9c85('0x2')](this,_0x128e24);this[_0x9c85('0x3')]='';this[_0x9c85('0x4')]=![];}util[_0x9c85('0x5')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1947eb,_0x290ab6,_0x355518){var _0x35c7af='\x0a',_0x1925a4=['\x0a\x0a',_0x9c85('0x6')],_0x93b04c=-0x1,_0x904224=-0x1,_0x2a7105='',_0x11112b=0x0,_0x5f06f1='',_0x25866='';this[_0x9c85('0x3')]+=_0x1947eb[_0x9c85('0x7')]();_0x5f06f1=this[_0x9c85('0x3')];if(!this[_0x9c85('0x4')]){_0x11112b=0x0;while(_0x1925a4[_0x11112b]){while((_0x904224=_0x5f06f1['indexOf'](_0x1925a4[_0x11112b]))!=-0x1){_0x2a7105=_0x1925a4[_0x11112b];_0x25866=_0x5f06f1[_0x9c85('0x8')](0x0,_0x904224);_0x5f06f1=_0x5f06f1[_0x9c85('0x8')](_0x904224+_0x2a7105[_0x9c85('0x9')]);var _0x5812c9=_0x25866[_0x9c85('0xa')](_0x35c7af),_0x2ee836=0x0,_0x24fc1d={},_0xd286a='',_0x5a566f='',_0x16ec01=-0x1;while(_0x5812c9[_0x2ee836]){_0x16ec01=_0x5812c9[_0x2ee836]['indexOf'](':');if(_0x16ec01!=-0x1){_0xd286a=_0x5812c9[_0x2ee836][_0x9c85('0xb')](0x0,_0x16ec01)[_0x9c85('0xc')]();_0x5a566f=_0x5812c9[_0x2ee836][_0x9c85('0xb')](_0x16ec01+0x1)[_0x9c85('0xc')]();if(_0xd286a['length']>0x0){_0x24fc1d[_0xd286a]=_0x5a566f;}}else{}_0x2ee836++;}this[_0x9c85('0xd')](_0x9c85('0xe'),_0x24fc1d);this[_0x9c85('0x4')]=!![];}_0x11112b++;}this[_0x9c85('0x3')]=_0x5f06f1;}else{while((_0x93b04c=_0x5f06f1['indexOf'](_0x35c7af))!=-0x1){_0x25866=_0x5f06f1['substring'](0x0,_0x93b04c);this[_0x9c85('0xd')](_0x9c85('0xf'),_0x25866);_0x5f06f1=_0x5f06f1['substring'](_0x93b04c+_0x35c7af[_0x9c85('0x9')]);}this[_0x9c85('0x3')]=_0x5f06f1;}_0x355518();};module[_0x9c85('0x10')]=AGIReply; \ No newline at end of file +var _0x7aad=['\x0d\x0a\x0d\x0a','toString','substring','length','indexOf','slice','trim','emit','exports','util','stream','Transform','_localBuffer','inherits','prototype'];(function(_0x5418ad,_0x40742f){var _0x2cae56=function(_0x36d317){while(--_0x36d317){_0x5418ad['push'](_0x5418ad['shift']());}};_0x2cae56(++_0x40742f);}(_0x7aad,0x180));var _0xd7aa=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x7aad[_0x139a3c];return _0x2b375b;};'use strict';var util=require(_0xd7aa('0x0'));var Transform=require(_0xd7aa('0x1'))[_0xd7aa('0x2')];function AGIReply(_0x1541cd){Transform['call'](this,_0x1541cd);this[_0xd7aa('0x3')]='';this['_inBody']=![];}util[_0xd7aa('0x4')](AGIReply,Transform);AGIReply[_0xd7aa('0x5')]['_transform']=function(_0x1459f9,_0x5b009f,_0x5860f7){var _0x174767='\x0a',_0x9cf409=['\x0a\x0a',_0xd7aa('0x6')],_0x475852=-0x1,_0x2c264b=-0x1,_0x3382f8='',_0x4f3cf9=0x0,_0x2d62f1='',_0x4a8c9a='';this[_0xd7aa('0x3')]+=_0x1459f9[_0xd7aa('0x7')]();_0x2d62f1=this['_localBuffer'];if(!this['_inBody']){_0x4f3cf9=0x0;while(_0x9cf409[_0x4f3cf9]){while((_0x2c264b=_0x2d62f1['indexOf'](_0x9cf409[_0x4f3cf9]))!=-0x1){_0x3382f8=_0x9cf409[_0x4f3cf9];_0x4a8c9a=_0x2d62f1['substring'](0x0,_0x2c264b);_0x2d62f1=_0x2d62f1[_0xd7aa('0x8')](_0x2c264b+_0x3382f8[_0xd7aa('0x9')]);var _0x2ff9ad=_0x4a8c9a['split'](_0x174767),_0x3d8301=0x0,_0x29b850={},_0x49c88c='',_0x4580b0='',_0x46af5b=-0x1;while(_0x2ff9ad[_0x3d8301]){_0x46af5b=_0x2ff9ad[_0x3d8301][_0xd7aa('0xa')](':');if(_0x46af5b!=-0x1){_0x49c88c=_0x2ff9ad[_0x3d8301][_0xd7aa('0xb')](0x0,_0x46af5b)['trim']();_0x4580b0=_0x2ff9ad[_0x3d8301][_0xd7aa('0xb')](_0x46af5b+0x1)[_0xd7aa('0xc')]();if(_0x49c88c[_0xd7aa('0x9')]>0x0){_0x29b850[_0x49c88c]=_0x4580b0;}}else{}_0x3d8301++;}this['emit']('headers',_0x29b850);this['_inBody']=!![];}_0x4f3cf9++;}this[_0xd7aa('0x3')]=_0x2d62f1;}else{while((_0x475852=_0x2d62f1[_0xd7aa('0xa')](_0x174767))!=-0x1){_0x4a8c9a=_0x2d62f1[_0xd7aa('0x8')](0x0,_0x475852);this[_0xd7aa('0xd')]('line',_0x4a8c9a);_0x2d62f1=_0x2d62f1['substring'](_0x475852+_0x174767[_0xd7aa('0x9')]);}this[_0xd7aa('0x3')]=_0x2d62f1;}_0x5860f7();};module[_0xd7aa('0xe')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index bd2b1fb..e7ad86d 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 _0x1f38=['createSquareReport','merge','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','save_name','getIntervalById','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f38,0xd7));var _0x81f3=function(_0x3bad26,_0x1cf013){_0x3bad26=_0x3bad26-0x0;var _0x42e1ff=_0x1f38[_0x3bad26];return _0x42e1ff;};'use strict';var _=require(_0x81f3('0x0'));var moment=require(_0x81f3('0x1'));var jayson=require(_0x81f3('0x2'));var client=jayson[_0x81f3('0x3')][_0x81f3('0x4')]({'port':0x2329});function request(_0x3ad066,_0x5100d4){return new Promise(function(_0x3f51d,_0x58b173){return client[_0x81f3('0x5')](_0x3ad066,_0x5100d4)[_0x81f3('0x6')](function(_0x413c49){if(_0x413c49['error']){return _0x58b173(_0x413c49[_0x81f3('0x7')][_0x81f3('0x8')]);}else{return _0x3f51d(_0x413c49[_0x81f3('0x9')]);}})[_0x81f3('0xa')](function(_0x343897){return _0x58b173(_0x343897);});});}exports[_0x81f3('0xb')]=function(){return request(_0x81f3('0xc'),{'options':{'raw':![],'attributes':['id',_0x81f3('0xd'),_0x81f3('0xe')]}});};exports[_0x81f3('0xf')]=function(_0x10b956){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x10b956},'attributes':[_0x81f3('0xe')]}});};exports[_0x81f3('0x10')]=function(_0x39948f){return request(_0x81f3('0x11'),{'options':{'raw':![],'where':{'id':_0x39948f},'include':[{'model':_0x81f3('0x12'),'as':'Smtp','include':[{'model':'CloudProvider','as':_0x81f3('0x13')}]}],'attributes':['id',_0x81f3('0xd'),_0x81f3('0x14')],'smtp':!![]}});};exports[_0x81f3('0x15')]=function(_0xf71e9a){return request(_0x81f3('0x16'),{'options':{'where':{'id':_0xf71e9a},'attributes':['name']}});};exports[_0x81f3('0x17')]=function(_0x79b7b){return request(_0x81f3('0x18'),{'options':{'where':{'id':_0x79b7b},'attributes':['name']}});};exports[_0x81f3('0x19')]=function(_0x44c4e9){return request(_0x81f3('0x1a'),{'options':{'where':{'id':_0x44c4e9},'attributes':[_0x81f3('0xd')]}});};exports[_0x81f3('0x1b')]=function(_0x2cd818){return request(_0x81f3('0x1c'),{'options':{'where':{'id':_0x2cd818},'attributes':[_0x81f3('0x1d')]}});};exports[_0x81f3('0x1e')]=function(_0x2fbf4e){return request(_0x81f3('0x1f'),{'options':{'where':{'id':_0x2fbf4e},'attributes':['name']}});};exports[_0x81f3('0x20')]=function(_0x336d5c){return request(_0x81f3('0x21'),{'options':{'where':{'phone':_0x336d5c[_0x81f3('0x22')]},'attributes':['id']}});};exports[_0x81f3('0x23')]=function(_0x49181a){return request(_0x81f3('0x24'),{'options':{'where':{'id':_0x49181a},'attributes':[_0x81f3('0xd')]}});};exports['getSoundById']=function(_0x2f6fd6){return request('ShowSound',{'options':{'where':{'id':_0x2f6fd6},'attributes':[_0x81f3('0x25')]}});};exports[_0x81f3('0x26')]=function(_0x473da7){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x473da7},'include':[{'model':'Interval','as':_0x81f3('0x27')}]}});};exports[_0x81f3('0x28')]=function(_0x4aaeff){return request(_0x81f3('0x29'),{'options':{'where':{'id':_0x4aaeff},'attributes':['id',_0x81f3('0xd')]}});};exports['createSmsMessage']=function(_0x3f22a4){return request(_0x81f3('0x2a'),{'body':_0x3f22a4});};exports[_0x81f3('0x2b')]=function(_0x315b63){return request(_0x81f3('0x2c'),{'body':_0x315b63});};exports[_0x81f3('0x2d')]=function(_0x13778a){return request('CreateSquareReport',{'body':_[_0x81f3('0x2e')](_0x13778a,{'project_name':_0x13778a['arg_1'],'prev_project_name':_0x13778a['arg_2']||'','is_subproject':_0x13778a[_0x81f3('0x2f')]?!![]:![],'leaveAt':moment()[_0x81f3('0x30')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x81f3('0x31')]=function(_0x5dfcd9){return request(_0x81f3('0x32'),{'body':_0x5dfcd9});};exports[_0x81f3('0x33')]=function(_0x5f1175){return request(_0x81f3('0x34'),{'body':_0x5f1175});};exports[_0x81f3('0x35')]=function(_0x46025a){return request(_0x81f3('0x36'),{'options':{'raw':![],'where':{'phone':_0x46025a[_0x81f3('0x22')],'ListId':_0x46025a[_0x81f3('0x37')]}}})[_0x81f3('0x6')](function(_0x560adf){if(_0x560adf){return _0x560adf;}return request(_0x81f3('0x38'),{'body':_0x46025a});});};exports[_0x81f3('0x39')]=function(_0x4134aa){return request(_0x81f3('0x3a'),{'options':{'where':{'id':_0x4134aa},'attributes':[_0x81f3('0xd')]}});};exports[_0x81f3('0x3b')]=function(_0x504e2b,_0x1f85ee){return request('LoginUser',{'body':{'interface':_0x1f85ee},'options':{'where':_0x504e2b}});};exports['agentPause']=function(_0x11e255,_0x490098,_0x3b88ec){return request(_0x81f3('0x3c'),{'body':{'type':_0x490098,'uniqueid':_0x3b88ec},'options':{'where':_0x11e255}});};exports[_0x81f3('0x3d')]=function(_0x680c3c){return request(_0x81f3('0x3e'),{'body':{},'options':{'where':_0x680c3c}});};exports[_0x81f3('0x3f')]=function(_0x356f38){return request(_0x81f3('0x40'),{'body':{},'options':{'where':_0x356f38}});}; \ No newline at end of file +var _0xb821=['catch','getSquareProjects','GetSquareProjects','name','production','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVariableById','ShowVariable','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','moment','jayson/promise','request','then','error','message','result'];(function(_0x2ffeca,_0x386aad){var _0xd046ed=function(_0xa2cf3f){while(--_0xa2cf3f){_0x2ffeca['push'](_0x2ffeca['shift']());}};_0xd046ed(++_0x386aad);}(_0xb821,0xa7));var _0x1b82=function(_0x4b7898,_0x2eae9a){_0x4b7898=_0x4b7898-0x0;var _0x38fc2e=_0xb821[_0x4b7898];return _0x38fc2e;};'use strict';var _=require('lodash');var moment=require(_0x1b82('0x0'));var jayson=require(_0x1b82('0x1'));var client=jayson['client']['http']({'port':0x2329});function request(_0xbab478,_0x578a10){return new Promise(function(_0x4b1809,_0x3b1d14){return client[_0x1b82('0x2')](_0xbab478,_0x578a10)[_0x1b82('0x3')](function(_0x26db32){if(_0x26db32['error']){return _0x3b1d14(_0x26db32[_0x1b82('0x4')][_0x1b82('0x5')]);}else{return _0x4b1809(_0x26db32[_0x1b82('0x6')]);}})[_0x1b82('0x7')](function(_0x18f45f){return _0x3b1d14(_0x18f45f);});});}exports[_0x1b82('0x8')]=function(){return request(_0x1b82('0x9'),{'options':{'raw':![],'attributes':['id',_0x1b82('0xa'),_0x1b82('0xb')]}});};exports['getSquareProject']=function(_0x4011f2){return request(_0x1b82('0xc'),{'options':{'raw':![],'where':{'name':_0x4011f2},'attributes':[_0x1b82('0xb')]}});};exports[_0x1b82('0xd')]=function(_0xcffb87){return request(_0x1b82('0xe'),{'options':{'raw':![],'where':{'id':_0xcffb87},'include':[{'model':_0x1b82('0xf'),'as':_0x1b82('0x10'),'include':[{'model':'CloudProvider','as':_0x1b82('0x11')}]}],'attributes':['id',_0x1b82('0xa'),_0x1b82('0x12')],'smtp':!![]}});};exports[_0x1b82('0x13')]=function(_0x50aed7){return request(_0x1b82('0xc'),{'options':{'where':{'id':_0x50aed7},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x1e553a){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x1e553a},'attributes':[_0x1b82('0xa')]}});};exports[_0x1b82('0x14')]=function(_0x5d4cf1){return request(_0x1b82('0x15'),{'options':{'where':{'id':_0x5d4cf1},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x1b115b){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x1b115b},'attributes':[_0x1b82('0x16')]}});};exports[_0x1b82('0x17')]=function(_0xf42818){return request('ShowUser',{'options':{'where':{'id':_0xf42818},'attributes':['name']}});};exports[_0x1b82('0x18')]=function(_0x5d66c3){return request(_0x1b82('0x19'),{'options':{'where':{'phone':_0x5d66c3[_0x1b82('0x1a')]},'attributes':['id']}});};exports[_0x1b82('0x1b')]=function(_0x594a63){return request(_0x1b82('0x1c'),{'options':{'where':{'id':_0x594a63},'attributes':[_0x1b82('0xa')]}});};exports[_0x1b82('0x1d')]=function(_0x46e5e2){return request(_0x1b82('0x1e'),{'options':{'where':{'id':_0x46e5e2},'attributes':['save_name']}});};exports[_0x1b82('0x1f')]=function(_0x1892b0){return request(_0x1b82('0x20'),{'options':{'raw':![],'where':{'id':_0x1892b0},'include':[{'model':_0x1b82('0x21'),'as':_0x1b82('0x22')}]}});};exports[_0x1b82('0x23')]=function(_0x2d07f4){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2d07f4},'attributes':['id',_0x1b82('0xa')]}});};exports[_0x1b82('0x24')]=function(_0x5b8d09){return request(_0x1b82('0x25'),{'body':_0x5b8d09});};exports[_0x1b82('0x26')]=function(_0x1ad9d6){return request('CreateSquareDetailsReport',{'body':_0x1ad9d6});};exports[_0x1b82('0x27')]=function(_0x4db690){return request('CreateSquareReport',{'body':_['merge'](_0x4db690,{'project_name':_0x4db690[_0x1b82('0x28')],'prev_project_name':_0x4db690[_0x1b82('0x29')]||'','is_subproject':_0x4db690[_0x1b82('0x29')]?!![]:![],'leaveAt':moment()[_0x1b82('0x2a')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x1b82('0x2b')]=function(_0x165b45){return request(_0x1b82('0x2c'),{'body':_0x165b45});};exports[_0x1b82('0x2d')]=function(_0x2d78b5){return request(_0x1b82('0x2e'),{'body':_0x2d78b5});};exports[_0x1b82('0x2f')]=function(_0x21ea34){return request(_0x1b82('0x30'),{'options':{'raw':![],'where':{'phone':_0x21ea34[_0x1b82('0x1a')],'ListId':_0x21ea34[_0x1b82('0x31')]}}})[_0x1b82('0x3')](function(_0x466441){if(_0x466441){return _0x466441;}return request('CreateCmContact',{'body':_0x21ea34});});};exports[_0x1b82('0x32')]=function(_0x2931d0){return request(_0x1b82('0x33'),{'options':{'where':{'id':_0x2931d0},'attributes':[_0x1b82('0xa')]}});};exports[_0x1b82('0x34')]=function(_0x115ce7,_0xd3c4a){return request(_0x1b82('0x35'),{'body':{'interface':_0xd3c4a},'options':{'where':_0x115ce7}});};exports[_0x1b82('0x36')]=function(_0x362657,_0x501ab0,_0x225c06){return request(_0x1b82('0x37'),{'body':{'type':_0x501ab0,'uniqueid':_0x225c06},'options':{'where':_0x362657}});};exports[_0x1b82('0x38')]=function(_0xc98ee2){return request('UnpauseUser',{'body':{},'options':{'where':_0xc98ee2}});};exports[_0x1b82('0x39')]=function(_0xbf65a){return request('LogoutUser',{'body':{},'options':{'where':_0xbf65a}});}; \ 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 10a2d17..50fab8f 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 _0xd47f=['exports','./polly'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0xd47f,0x1bd));var _0xfd47=function(_0x4d6d9a,_0xa022de){_0x4d6d9a=_0x4d6d9a-0x0;var _0x2029f8=_0xd47f[_0x4d6d9a];return _0x2029f8;};var polly=require(_0xfd47('0x0'));var lex=require('./lex');module[_0xfd47('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x0cfe=['./polly','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0cfe,0x9c));var _0xe0cf=function(_0x4cbafb,_0x23ac6d){_0x4cbafb=_0x4cbafb-0x0;var _0x3c59b2=_0x0cfe[_0x4cbafb];return _0x3c59b2;};var polly=require(_0xe0cf('0x0'));var lex=require('./lex');module[_0xe0cf('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index e93d0aa..41f6015 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 _0x3c81=['./lib/api','exports'];(function(_0x583988,_0x473518){var _0x435a3b=function(_0x44325e){while(--_0x44325e){_0x583988['push'](_0x583988['shift']());}};_0x435a3b(++_0x473518);}(_0x3c81,0x102));var _0x13c8=function(_0x2c0710,_0x3224fe){_0x2c0710=_0x2c0710-0x0;var _0x2bb4e8=_0x3c81[_0x2c0710];return _0x2bb4e8;};'use strict';var lex=require(_0x13c8('0x0'));module[_0x13c8('0x1')]=function(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4){return lex(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4);}; \ No newline at end of file +var _0x878f=['exports'];(function(_0x1f34c4,_0x434f00){var _0x438246=function(_0x4bfdc3){while(--_0x4bfdc3){_0x1f34c4['push'](_0x1f34c4['shift']());}};_0x438246(++_0x434f00);}(_0x878f,0x173));var _0xf878=function(_0x33702d,_0x34f130){_0x33702d=_0x33702d-0x0;var _0x1d3367=_0x878f[_0x33702d];return _0x1d3367;};'use strict';var lex=require('./lib/api');module[_0xf878('0x0')]=function(_0x658976,_0x2e1d23,_0x12df2b,_0x1b3d0b,_0x3d74cf,_0x9e6783){return lex(_0x658976,_0x2e1d23,_0x12df2b,_0x1b3d0b,_0x3d74cf,_0x9e6783);}; \ 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 0a88ecd..0b454bd 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(_0x7542b9,_0x2c4121){var _0x1e3a79=function(_0x18e7e2){while(--_0x18e7e2){_0x7542b9['push'](_0x7542b9['shift']());}};_0x1e3a79(++_0x2c4121);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x5f00c7,_0x14c139){var _0x326631=function(_0x47d388){while(--_0x47d388){_0x5f00c7['push'](_0x5f00c7['shift']());}};_0x326631(++_0x14c139);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 f085f64..a38abc2 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 _0xe6ca=['exports'];(function(_0x22faae,_0x52f4de){var _0x5df295=function(_0x43923a){while(--_0x43923a){_0x22faae['push'](_0x22faae['shift']());}};_0x5df295(++_0x52f4de);}(_0xe6ca,0x184));var _0xae6c=function(_0x317ca6,_0x1e7446){_0x317ca6=_0x317ca6-0x0;var _0x148262=_0xe6ca[_0x317ca6];return _0x148262;};'use strict';var polly=require('./lib/api');module[_0xae6c('0x0')]=function(_0x45c4df,_0x9508a4,_0x5aa6ae,_0x4a8964,_0x2189d2,_0x42cbdb,_0x14455c){return polly(_0x45c4df,_0x9508a4,_0x5aa6ae,_0x4a8964,_0x2189d2,_0x42cbdb,_0x14455c);}; \ No newline at end of file +var _0xe1f1=['./lib/api','exports'];(function(_0x4934e0,_0x381dea){var _0x2eee39=function(_0x4ed0ea){while(--_0x4ed0ea){_0x4934e0['push'](_0x4934e0['shift']());}};_0x2eee39(++_0x381dea);}(_0xe1f1,0xca));var _0x1e1f=function(_0x439ce0,_0x230c64){_0x439ce0=_0x439ce0-0x0;var _0x1424e0=_0xe1f1[_0x439ce0];return _0x1424e0;};'use strict';var polly=require(_0x1e1f('0x0'));module[_0x1e1f('0x1')]=function(_0x5cf640,_0x26b48f,_0x28f80a,_0x236321,_0x2bdac6,_0x57d100,_0x16364b){return polly(_0x5cf640,_0x26b48f,_0x28f80a,_0x236321,_0x2bdac6,_0x57d100,_0x16364b);}; \ 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 1c42c02..f22cdf4 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 _0x67a6=['bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x67a6,0x112));var _0x667a=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x67a6[_0x460150];return _0x340677;};'use strict';var fs=require('fs');var path=require(_0x667a('0x0'));var BPromise=require(_0x667a('0x1'));var rs=require(_0x667a('0x2'));var AWS=require(_0x667a('0x3'));function pollyResult(_0x3010fd,_0x461ae0,_0x58eab0){return new BPromise(function(_0xf4bf5e,_0x1708ae){_0x3010fd[_0x667a('0x4')](_0x461ae0,function(_0x4d664b,_0x252f0b){if(_0x4d664b){_0x1708ae(_0x4d664b);}else if(_0x252f0b){if(_0x252f0b['AudioStream']instanceof Buffer){fs[_0x667a('0x5')](_0x58eab0,_0x252f0b[_0x667a('0x6')],function(_0x55c87c){if(_0x55c87c){_0x1708ae(_0x55c87c);}else{_0xf4bf5e();}});}else{_0x1708ae(new Error(_0x667a('0x7')));}}else{_0x1708ae(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x5502f2,_0x176fbe,_0x2b20e4,_0x1e62d0,_0x3e54b7,_0x4ed9f5,_0x34a14b){var _0x3f6930=new AWS[(_0x667a('0x8'))]({'accessKeyId':_0x5502f2,'secretAccessKey':_0x176fbe,'region':_0x2b20e4});var _0x10aa79={'Text':_0x3e54b7,'TextType':_0x4ed9f5||_0x667a('0x9'),'OutputFormat':_0x667a('0xa'),'VoiceId':_0x1e62d0};return pollyResult(_0x3f6930,_0x10aa79,_0x34a14b);}; \ No newline at end of file +var _0x5d4d=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','aws-sdk','synthesizeSpeech','writeFile','AudioStream'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x5d4d,0x1bd));var _0xd5d4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d4d[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0xd5d4('0x0'));var BPromise=require(_0xd5d4('0x1'));var rs=require('randomstring');var AWS=require(_0xd5d4('0x2'));function pollyResult(_0x508b0a,_0x58a82a,_0x20dfa4){return new BPromise(function(_0x39d8f2,_0x1ff0d5){_0x508b0a[_0xd5d4('0x3')](_0x58a82a,function(_0x3ab35a,_0x592188){if(_0x3ab35a){_0x1ff0d5(_0x3ab35a);}else if(_0x592188){if(_0x592188['AudioStream']instanceof Buffer){fs[_0xd5d4('0x4')](_0x20dfa4,_0x592188[_0xd5d4('0x5')],function(_0x1a2fc7){if(_0x1a2fc7){_0x1ff0d5(_0x1a2fc7);}else{_0x39d8f2();}});}else{_0x1ff0d5(new Error(_0xd5d4('0x6')));}}else{_0x1ff0d5(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xd5d4('0x7')]=function(_0x346fbd,_0x19737c,_0x250874,_0x22da3d,_0xb207e3,_0x482677,_0x36ce42){var _0x30a180=new AWS[(_0xd5d4('0x8'))]({'accessKeyId':_0x346fbd,'secretAccessKey':_0x19737c,'region':_0x250874});var _0x232931={'Text':_0xb207e3,'TextType':_0x482677||_0xd5d4('0x9'),'OutputFormat':_0xd5d4('0xa'),'VoiceId':_0x22da3d};return pollyResult(_0x30a180,_0x232931,_0x36ce42);}; \ 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 ad67af0..913a60a 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 _0xe9a9=['exports','./lib/api'];(function(_0x43b5a7,_0xf5e3d6){var _0x5461fe=function(_0x5d9d5a){while(--_0x5d9d5a){_0x43b5a7['push'](_0x43b5a7['shift']());}};_0x5461fe(++_0xf5e3d6);}(_0xe9a9,0x193));var _0x9e9a=function(_0x50e1d4,_0x339fc8){_0x50e1d4=_0x50e1d4-0x0;var _0x3df41a=_0xe9a9[_0x50e1d4];return _0x3df41a;};'use strict';var asr=require(_0x9e9a('0x0'));module[_0x9e9a('0x1')]=function(_0x494a71,_0x1d434e,_0x254009,_0x2b274c){return asr(_0x494a71,_0x1d434e,_0x254009);}; \ No newline at end of file +var _0x1076=['exports','./lib/api'];(function(_0x5c48bd,_0x5d621e){var _0x44cdfa=function(_0x2224f6){while(--_0x2224f6){_0x5c48bd['push'](_0x5c48bd['shift']());}};_0x44cdfa(++_0x5d621e);}(_0x1076,0x18f));var _0x6107=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x1076[_0x28aea5];return _0x6a55f9;};'use strict';var asr=require(_0x6107('0x0'));module[_0x6107('0x1')]=function(_0x4a774f,_0x505d8b,_0x573875,_0x4b0b3a){return asr(_0x4a774f,_0x505d8b,_0x573875);}; \ 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 766e45b..47ed965 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 _0x5ff3=['filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','bluebird','exports','string','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2f16f5,_0x1f9a03){_0x2f16f5=_0x2f16f5-0x0;var _0x57ae15=_0x5ff3[_0x2f16f5];return _0x57ae15;};'use strict';var url=require('url');var BPromise=require(_0x35ff('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x35ff('0x1')]=function(_0x47c98d,_0x380f54,_0x1bb200){return new BPromise(function(_0x3bd66a,_0xd0846d){var _0x551514;if(typeof _0x47c98d!==_0x35ff('0x2')||_0x47c98d[_0x35ff('0x3')]===0x0){return _0xd0846d(_0x35ff('0x4'));}if(typeof _0x380f54!==_0x35ff('0x2')||_0x380f54[_0x35ff('0x3')]===0x0){return _0xd0846d('key\x20should\x20be\x20a\x20string');}if(typeof _0x1bb200!==_0x35ff('0x5')&&(typeof _0x1bb200!=='string'||_0x1bb200[_0x35ff('0x3')]===0x0)){return _0xd0846d(_0x35ff('0x6'));}try{_0x551514=fs[_0x35ff('0x7')](_0x47c98d)['toString'](_0x35ff('0x8'));}catch(_0x59ec4f){return _0xd0846d(_0x59ec4f);}return _0x3bd66a({'method':_0x35ff('0x9'),'uri':host+_0x35ff('0xa')+_0x380f54,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x1bb200},'audio':{'content':_0x551514}},'json':!![]});});}; \ No newline at end of file +var _0xb74d=['/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','readFileSync','base64'];(function(_0x110cb8,_0x55dc5c){var _0x401e8b=function(_0x2e5e9b){while(--_0x2e5e9b){_0x110cb8['push'](_0x110cb8['shift']());}};_0x401e8b(++_0x55dc5c);}(_0xb74d,0x16e));var _0xdb74=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0xb74d[_0x504df1];return _0x1063b5;};'use strict';var url=require(_0xdb74('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xdb74('0x1');module['exports']=function(_0x3f540e,_0x5700f0,_0x1ba155){return new BPromise(function(_0x30d1e5,_0x61bd15){var _0x4b3b06;if(typeof _0x3f540e!==_0xdb74('0x2')||_0x3f540e[_0xdb74('0x3')]===0x0){return _0x61bd15(_0xdb74('0x4'));}if(typeof _0x5700f0!=='string'||_0x5700f0['length']===0x0){return _0x61bd15(_0xdb74('0x5'));}if(typeof _0x1ba155!=='undefined'&&(typeof _0x1ba155!==_0xdb74('0x2')||_0x1ba155[_0xdb74('0x3')]===0x0)){return _0x61bd15('lang\x20should\x20be\x20a\x20string');}try{_0x4b3b06=fs[_0xdb74('0x6')](_0x3f540e)['toString'](_0xdb74('0x7'));}catch(_0x41780b){return _0x61bd15(_0x41780b);}return _0x30d1e5({'method':'POST','uri':host+_0xdb74('0x8')+_0x5700f0,'body':{'config':{'encoding':_0xdb74('0x9'),'sampleRateHertz':_0xdb74('0xa'),'languageCode':_0x1ba155},'audio':{'content':_0x4b3b06}},'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 c19fd84..c56d173 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 _0x63ee=['./asr','exports'];(function(_0x48e6c1,_0x2c5211){var _0x1521e2=function(_0x27e789){while(--_0x27e789){_0x48e6c1['push'](_0x48e6c1['shift']());}};_0x1521e2(++_0x2c5211);}(_0x63ee,0x152));var _0xe63e=function(_0x15676f,_0x13aebf){_0x15676f=_0x15676f-0x0;var _0x5db035=_0x63ee[_0x15676f];return _0x5db035;};var asr=require(_0xe63e('0x0'));module[_0xe63e('0x1')]={'asr':asr}; \ No newline at end of file +var _0xd07c=['./asr'];(function(_0x4004b1,_0x12e883){var _0x45ad29=function(_0x2585b1){while(--_0x2585b1){_0x4004b1['push'](_0x4004b1['shift']());}};_0x45ad29(++_0x12e883);}(_0xd07c,0x19a));var _0xcd07=function(_0xf7ef88,_0x161a98){_0xf7ef88=_0xf7ef88-0x0;var _0x1bab9b=_0xd07c[_0xf7ef88];return _0x1bab9b;};var asr=require(_0xcd07('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index c0c7fcd..66a2f5d 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 _0x5c5b=['.mp3','from','info','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','POST','application/x-www-form-urlencoded','stringify','generic','slice','length','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','googleASR','asr','results','map','alternatives','transcript','confidence','join','catch','[%s]\x20%s:%s','name','textRequest','result','source','resolvedQuery','action','actionIncomplete','score','status','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','protocol','https:','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','unlink','pipe','end','host','WHAT_EVER','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','.wav','writeFileSync','chmodSync','777','split','readFileSync','base64','googleCloudTTS','?key=','input','text:synthesize','then','tmp','generate'];(function(_0x2a2799,_0x5e25a8){var _0x17f761=function(_0x523b8a){while(--_0x523b8a){_0x2a2799['push'](_0x2a2799['shift']());}};_0x17f761(++_0x5e25a8);}(_0x5c5b,0xca));var _0xb5c5=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0x5c5b[_0x27bcf5];return _0x4ce4cf;};'use strict';var apiai=require(_0xb5c5('0x0'));var BPromise=require(_0xb5c5('0x1'));var dialogflow=require(_0xb5c5('0x2'));var fs=require('fs');var http=require(_0xb5c5('0x3'));var https=require(_0xb5c5('0x4'));var md5=require(_0xb5c5('0x5'));var path=require(_0xb5c5('0x6'));var querystring=require(_0xb5c5('0x7'));var rp=require(_0xb5c5('0x8'));var rs=require(_0xb5c5('0x9'));var sox=require(_0xb5c5('0xa'));var tts=require('google-tts-api');var urlParse=require(_0xb5c5('0xb'))[_0xb5c5('0xc')];var util=require(_0xb5c5('0xd'));var aws=require(_0xb5c5('0xe'));var google=require(_0xb5c5('0xf'));var sestek=require(_0xb5c5('0x10'));var tilde=require(_0xb5c5('0x11'));var logger=require(_0xb5c5('0x12'))(_0xb5c5('0x13'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x5af59c,_0x5f4fd1){return new BPromise(function(_0x1fe958,_0x579267){var _0x2482af=urlParse(_0x5af59c);var _0x5e9812=_0x2482af[_0xb5c5('0x14')]===_0xb5c5('0x15')?https:http;var _0x502841={'host':_0x2482af['host'],'path':_0x2482af[_0xb5c5('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x5e9812[_0xb5c5('0x16')](_0x502841,function(_0x1693ce){if(_0x1693ce[_0xb5c5('0x17')]!==0xc8){logger[_0xb5c5('0x18')](_0xb5c5('0x19')+_0x5af59c+_0xb5c5('0x1a')+_0x1693ce[_0xb5c5('0x17')]+'\x20('+_0x1693ce[_0xb5c5('0x1b')]+')');_0x579267(new Error(_0xb5c5('0x19')+_0x5af59c+_0xb5c5('0x1a')+_0x1693ce[_0xb5c5('0x17')]+'\x20('+_0x1693ce[_0xb5c5('0x1b')]+')'));return;}var _0x4fa062=fs[_0xb5c5('0x1c')](_0x5f4fd1);_0x4fa062['on'](_0xb5c5('0x1d'),function(){logger['info'](_0xb5c5('0x1e'));_0x4fa062[_0xb5c5('0x1f')](_0x1fe958);});_0x4fa062['on'](_0xb5c5('0x18'),function(_0x4cee9f){fs[_0xb5c5('0x20')](_0x5f4fd1);logger[_0xb5c5('0x18')]('download\x20error',_0x4cee9f);_0x579267(_0x4cee9f);});_0x1693ce[_0xb5c5('0x21')](_0x4fa062);})['on'](_0xb5c5('0x18'),function(_0x387ddc){logger[_0xb5c5('0x18')](_0x387ddc);_0x579267(_0x387ddc);})[_0xb5c5('0x22')]();});}function uploadFile(_0x28678b){return new BPromise(function(_0x840043,_0x1b9984){var _0x1609f2=urlParse(_0x28678b);var _0x97f4a6=_0x1609f2['protocol']==='https:'?https:http;var _0x1b9a4e={'host':_0x1609f2[_0xb5c5('0x23')],'path':_0x1609f2[_0xb5c5('0x6')],'headers':{'user-agent':_0xb5c5('0x24')}};_0x97f4a6['get'](_0x1b9a4e,function(_0x41cfd2){if(_0x41cfd2[_0xb5c5('0x17')]!==0xc8){_0x1b9984(new Error(_0xb5c5('0x19')+_0x28678b+_0xb5c5('0x1a')+_0x41cfd2[_0xb5c5('0x17')]+'\x20('+_0x41cfd2[_0xb5c5('0x1b')]+')'));return;}var _0x181b7d='';_0x41cfd2['on'](_0xb5c5('0x25'),function(_0xd2d2a){_0x181b7d+=_0xd2d2a;});_0x41cfd2['on'](_0xb5c5('0x22'),function(){_0x840043(_0x181b7d);});})['on'](_0xb5c5('0x18'),function(_0x3f09db){_0x1b9984(_0x3f09db);})[_0xb5c5('0x22')]();});}function convertFile(_0x7dda78,_0x50d596){return new BPromise(function(_0x5de121,_0x14ef88){var _0x50e8fe=sox[_0xb5c5('0x26')](_0x7dda78,_0x50d596,{'sampleRate':0x1f40,'format':_0xb5c5('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x50e8fe['on'](_0xb5c5('0x18'),function(_0x1ee5a5){logger[_0xb5c5('0x18')](_0xb5c5('0x28'),_0x1ee5a5);_0x14ef88(_0x1ee5a5);});_0x50e8fe['on']('end',function(){logger['info'](_0xb5c5('0x29'));_0x5de121();});_0x50e8fe[_0xb5c5('0x2a')]();});}function base64Decode(_0x3da9b4,_0x23ca4f){var _0x4e7f1d=path[_0xb5c5('0x2b')](__dirname,'tmp',rs['generate'](0x4)+_0xb5c5('0x2c'));fs[_0xb5c5('0x2d')](_0x4e7f1d,_0x3da9b4,'base64');return convertFile(_0x4e7f1d,_0x23ca4f)['then'](function(){try{fs['unlink'](_0x4e7f1d);fs[_0xb5c5('0x2e')](_0x23ca4f,_0xb5c5('0x2f'));}catch(_0x17a258){logger[_0xb5c5('0x18')](_0x17a258);}return _0x23ca4f[_0xb5c5('0x30')]('.')[0x0];});}function base64Encode(_0x46f35d){var _0x1cc93a=fs[_0xb5c5('0x31')](_0x46f35d);return new Buffer(_0x1cc93a)['toString'](_0xb5c5('0x32'));}exports[_0xb5c5('0x33')]=function(_0x569d26,_0x249975,_0xaa7134,_0x49a1b2,_0x23c47b,_0x88d298){var _0x50ceb7,_0x4b7ad0;var _0x39be13='https://texttospeech.googleapis.com/v1/';var _0x4119ad=_0xb5c5('0x34')+_0x569d26;var _0xb6df3a={};if(_0x249975==='ssml'){_0xb6df3a['input']={'ssml':_0xaa7134};}else{_0xb6df3a[_0xb5c5('0x35')]={'text':_0xaa7134};};_0xb6df3a['voice']={'languageCode':_0x49a1b2,'ssmlGender':_0x23c47b};_0xb6df3a['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x3e669e={'url':_0x39be13+_0xb5c5('0x36')+_0x4119ad,'method':'POST','json':!![],'body':_0xb6df3a};return rp(_0x3e669e)[_0xb5c5('0x37')](function(_0x12c2b0){return new BPromise(function(_0x567b97,_0x1e556e){_0x50ceb7=path['resolve'](__dirname,_0xb5c5('0x38'),rs[_0xb5c5('0x39')](0x4)+_0xb5c5('0x3a'));var _0x2db4ea=Buffer[_0xb5c5('0x3b')](_0x12c2b0['audioContent'],'base64');return fs['writeFile'](_0x50ceb7,_0x2db4ea,function(_0x896b62){_0x1e556e(_0x896b62);},function(_0x397dca){fs[_0xb5c5('0x2e')](_0x50ceb7,_0xb5c5('0x2f'));_0x567b97(_0x397dca);});});})['then'](function(_0x328df2){_0x4b7ad0=path['resolve'](__dirname,_0xb5c5('0x38'),rs[_0xb5c5('0x39')](0x4)+'.wav');return convertFile(_0x50ceb7,_0x4b7ad0);})[_0xb5c5('0x37')](function(){try{fs[_0xb5c5('0x20')](_0x50ceb7);fs[_0xb5c5('0x2e')](_0x4b7ad0,'777');}catch(_0x2f396e){logger['error'](_0x2f396e);}logger[_0xb5c5('0x3c')](_0xb5c5('0x3d'),_0x4b7ad0['split']('.')[0x0]);return _0x4b7ad0[_0xb5c5('0x30')]('.')[0x0];});};exports[_0xb5c5('0x3e')]=function(_0x5627e7,_0xe86ce6){var _0x514e67=_0xb5c5('0x3f');var _0x511073,_0x3d52ae;var _0xc10603;var _0x599e8a={'encoding':'utf8','method':_0xb5c5('0x40'),'timeout':0x2710,'url':_0x514e67,'headers':{'Content-Type':_0xb5c5('0x41')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0xb5c5('0x42')]([_0x5627e7,_0xe86ce6||'en',![],'null']),null,_0xb5c5('0x43')]]]))};return rp(_0x599e8a)[_0xb5c5('0x37')](function(_0x168aa8){try{_0xc10603=eval(_0x168aa8[_0xb5c5('0x44')](0x5))[0x0][0x2];}catch(_0xa7d8cf){throw new Error('parse\x20response\x20failed:\x0a'+_0x168aa8[_0xb5c5('0x25')]);}if(!_0xc10603){if(_0x5627e7[_0xb5c5('0x45')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0xe86ce6+_0xb5c5('0x46'));}}try{_0xc10603=eval(_0xc10603)[0x0];}catch(_0x318570){throw new Error(_0xb5c5('0x47')+res[_0xb5c5('0x25')]);}const _0x2db886=_0xc10603;_0x511073=path[_0xb5c5('0x2b')](__dirname,_0xb5c5('0x38'),rs[_0xb5c5('0x39')](0x4)+_0xb5c5('0x3a'));fs['writeFileSync'](_0x511073,_0xc10603,{'encoding':_0xb5c5('0x32')});_0x3d52ae=path[_0xb5c5('0x2b')](__dirname,_0xb5c5('0x38'),rs[_0xb5c5('0x39')](0x4)+_0xb5c5('0x2c'));return convertFile(_0x511073,_0x3d52ae);})[_0xb5c5('0x37')](function(){try{fs[_0xb5c5('0x20')](_0x511073);fs[_0xb5c5('0x2e')](_0x3d52ae,_0xb5c5('0x2f'));}catch(_0x3c8a94){logger[_0xb5c5('0x18')](_0x3c8a94);}logger['info']('goggleTTS\x20path',_0x3d52ae[_0xb5c5('0x30')]('.')[0x0]);return _0x3d52ae[_0xb5c5('0x30')]('.')[0x0];});};exports[_0xb5c5('0x48')]=function(_0x55d5bd,_0x4d4f5c,_0x4962e6){return google[_0xb5c5('0x49')](_0x55d5bd,_0x4d4f5c,_0x4962e6)[_0xb5c5('0x37')](function(_0x35b7e2){logger['info'](_0x35b7e2['uri']);return rp(_0x35b7e2);})['then'](function(_0x22894b){var _0x8a4d05='';var _0x1c767d=0x0;try{fs[_0xb5c5('0x20')](_0x55d5bd);}catch(_0x20ab4c){logger[_0xb5c5('0x18')](_0x20ab4c);}if(_0x22894b&&_0x22894b[_0xb5c5('0x4a')]){_0x8a4d05=_0x22894b[_0xb5c5('0x4a')][_0xb5c5('0x4b')](function(_0x257967){return _0x257967&&_0x257967['alternatives'][0x0]&&_0x257967[_0xb5c5('0x4c')][0x0]['transcript']?_0x257967[_0xb5c5('0x4c')][0x0][_0xb5c5('0x4d')]:'';})['join']('\x0a');_0x1c767d=_0x22894b['results'][_0xb5c5('0x4b')](function(_0x4df05a){return _0x4df05a&&_0x4df05a[_0xb5c5('0x4c')][0x0]&&_0x4df05a['alternatives'][0x0]['confidence']?_0x4df05a[_0xb5c5('0x4c')][0x0][_0xb5c5('0x4e')]:0x0;})[_0xb5c5('0x4f')]('\x0a');}logger[_0xb5c5('0x3c')]('googleASR\x20transcription',_0x8a4d05);logger[_0xb5c5('0x3c')]('googleASR\x20confidence',_0x1c767d);return{'transcript':_0x8a4d05,'confidence':_0x1c767d};})[_0xb5c5('0x50')](function(_0x5f1907){logger[_0xb5c5('0x18')](_0xb5c5('0x51'),_0x5f1907['statusCode'],_0x5f1907[_0xb5c5('0x52')],_0x5f1907['message']);});};exports['googleDialogflow']=function(_0x956e83,_0x58235e,_0x1f8eaa,_0x2f1280){var _0x5dd4d4=apiai(_0x58235e,{'language':_0x2f1280||'en'});return _0x5dd4d4[_0xb5c5('0x53')](_0x1f8eaa,{'sessionId':md5(_0x956e83)})[_0xb5c5('0x37')](function(_0x371de6){logger[_0xb5c5('0x3c')](JSON[_0xb5c5('0x42')](_0x371de6));return{'source':_0x371de6[_0xb5c5('0x54')][_0xb5c5('0x55')],'resolvedQuery':_0x371de6[_0xb5c5('0x54')][_0xb5c5('0x56')],'action':_0x371de6[_0xb5c5('0x54')][_0xb5c5('0x57')],'actionIncomplete':_0x371de6[_0xb5c5('0x54')][_0xb5c5('0x58')],'speech':_0x371de6[_0xb5c5('0x54')]['fulfillment']['speech'],'score':_0x371de6[_0xb5c5('0x54')][_0xb5c5('0x59')],'statusCode':_0x371de6[_0xb5c5('0x5a')][_0xb5c5('0x5b')],'endConversation':_0x371de6[_0xb5c5('0x54')]['metadata'][_0xb5c5('0x5c')]||![],'isFallbackIntent':_0x371de6[_0xb5c5('0x54')][_0xb5c5('0x5d')][_0xb5c5('0x5e')]};});};exports[_0xb5c5('0x5f')]=function(_0x3916c5,_0x1e6593,_0x473d5a,_0x2eb2d9,_0x3fbba9,_0x19b9ee){var _0x145b9e=_0x2eb2d9[_0xb5c5('0x60')](/\\n/g,'\x0a');var _0x536cc3={'credentials':{'private_key':_0x145b9e,'client_email':_0x473d5a}};var _0x61ef34=new dialogflow['SessionsClient'](_0x536cc3);var _0x10113f=_0x61ef34['sessionPath'](_0x1e6593,md5(_0x3916c5));var _0x3b5382={'session':_0x10113f,'queryInput':{'text':{'text':_0x3fbba9,'languageCode':_0x19b9ee}}};return _0x61ef34['detectIntent'](_0x3b5382)[_0xb5c5('0x37')](function(_0x26ed75){if(_0x26ed75&&_0x26ed75[_0xb5c5('0x45')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0xb5c5('0x42')](_0x26ed75));var _0x551584=_0x26ed75[0x0];if(_0x551584){var _0x3fce0c={'action':_0x551584['queryResult'][_0xb5c5('0x57')],'allRequiredParamsPresent':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x62')],'endConversation':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x63')]&&_0x551584[_0xb5c5('0x61')][_0xb5c5('0x63')]['fields']?_0x551584[_0xb5c5('0x61')][_0xb5c5('0x63')][_0xb5c5('0x64')][_0xb5c5('0x65')][_0xb5c5('0x66')]:![],'fulfillmentText':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x67')],'intentName':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x68')]['name'],'intentDisplayName':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x68')][_0xb5c5('0x69')],'isFallbackIntent':_0x551584['queryResult']['intent'][_0xb5c5('0x6a')],'languageCode':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x6b')],'queryText':_0x551584['queryResult'][_0xb5c5('0x6c')],'responseId':_0x551584[_0xb5c5('0x6d')],'score':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x6e')],'speech':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x67')],'providerResponse':JSON[_0xb5c5('0x42')](_0x26ed75)};return _0x3fce0c;}}});};exports['tildeASR']=function(_0x7d74c7,_0x9f8df6,_0x4bb458,_0x4b42bc){return tilde[_0xb5c5('0x49')](_0x7d74c7,_0x9f8df6,_0x4bb458,_0x4b42bc)['then'](function(_0x3130ca){try{fs[_0xb5c5('0x20')](_0x7d74c7);}catch(_0x400d46){logger[_0xb5c5('0x18')](_0x400d46);}logger[_0xb5c5('0x3c')](_0xb5c5('0x6f'),_0x3130ca[_0xb5c5('0x4d')]);logger[_0xb5c5('0x3c')](_0xb5c5('0x70'),_0x3130ca[_0xb5c5('0x4e')]);return _0x3130ca;});};exports['awsPolly']=function(_0x47be01,_0x5f1c36,_0x8f6bea,_0x5d8087,_0x5b5773,_0x13b2e8){var _0x5d2972=path[_0xb5c5('0x2b')](__dirname,_0xb5c5('0x38'),rs[_0xb5c5('0x39')](0x4)+_0xb5c5('0x3a'));var _0x114ca8;return aws[_0xb5c5('0x71')](_0x47be01,_0x5f1c36,_0x8f6bea,_0x5d8087,_0x5b5773,_0x13b2e8,_0x5d2972)[_0xb5c5('0x37')](function(){_0x114ca8=path[_0xb5c5('0x2b')](__dirname,_0xb5c5('0x38'),rs[_0xb5c5('0x39')](0x4)+_0xb5c5('0x2c'));return convertFile(_0x5d2972,_0x114ca8);})[_0xb5c5('0x37')](function(){try{fs[_0xb5c5('0x20')](_0x5d2972);fs[_0xb5c5('0x2e')](_0x114ca8,'777');}catch(_0x2d996e){logger[_0xb5c5('0x18')](_0x2d996e);}return _0x114ca8[_0xb5c5('0x30')]('.')[0x0];});};exports[_0xb5c5('0x72')]=function(_0x10a59d,_0x483ab5,_0x1b13e3,_0x56b431,_0x6ceca,_0x3ee0fb){return aws['lex'](_0x10a59d,_0x483ab5,_0x1b13e3,_0x56b431,_0x6ceca,_0x3ee0fb)[_0xb5c5('0x37')](function(_0x10baef){logger[_0xb5c5('0x3c')](JSON['stringify'](_0x10baef));return _0x10baef;});};exports[_0xb5c5('0x73')]=function(_0x4cae37,_0x38db21,_0x59fb09,_0x28f109){var _0x117675=util['format'](_0xb5c5('0x74'),ISPEECH_API,_0x4cae37,encodeURIComponent(_0x38db21),_0x59fb09,_0x28f109);var _0x395eac=path[_0xb5c5('0x2b')](__dirname,'tmp',rs['generate'](0x4)+_0xb5c5('0x3a'));var _0x1d0844;return downloadFile(_0x117675,_0x395eac)[_0xb5c5('0x37')](function(){_0x1d0844=path[_0xb5c5('0x2b')](__dirname,_0xb5c5('0x38'),rs['generate'](0x4)+'.wav');return convertFile(_0x395eac,_0x1d0844);})['then'](function(){try{fs[_0xb5c5('0x20')](_0x395eac);fs[_0xb5c5('0x2e')](_0x1d0844,_0xb5c5('0x2f'));}catch(_0x4cc1c4){logger['error'](_0x4cc1c4);}return _0x1d0844['split']('.')[0x0];});};exports['ispeechASR']=function(_0x51a96e,_0x10d231,_0x4cebf5,_0x18abef){var _0x2670c6=util[_0xb5c5('0x75')](_0xb5c5('0x76'),ISPEECH_API,_0x10d231,_0x4cebf5,base64Encode(_0x51a96e),_0x18abef?util[_0xb5c5('0x75')](_0xb5c5('0x77'),encodeURIComponent(_0x18abef)):_0xb5c5('0x78'));return uploadFile(_0x2670c6)['then'](function(_0x3d62f3){return querystring['parse'](_0x3d62f3);});};exports[_0xb5c5('0x79')]=function(_0x29edb1,_0x13af21){return sestek[_0xb5c5('0x7a')](_0x29edb1,_0x13af21)[_0xb5c5('0x37')](function(_0x4e841d){logger[_0xb5c5('0x3c')](JSON[_0xb5c5('0x42')](_0x4e841d));var _0x3d7ee7={'speech':_0x4e841d[_0xb5c5('0x7b')],'action':_0x4e841d[_0xb5c5('0x7c')]?_0x4e841d['channelData'][_0xb5c5('0x7d')]:undefined,'actiondata':_0x4e841d['channelData']?_0x4e841d[_0xb5c5('0x7c')][_0xb5c5('0x7e')]:undefined};if(_0x4e841d['channelData']&&_0x4e841d['channelData'][_0xb5c5('0x7f')]){return base64Decode(_0x4e841d[_0xb5c5('0x7c')][_0xb5c5('0x7f')]['Data'],path[_0xb5c5('0x2b')](__dirname,'tmp',rs[_0xb5c5('0x39')](0x4)+_0xb5c5('0x2c')))[_0xb5c5('0x37')](function(_0x1ebe00){_0x3d7ee7[_0xb5c5('0x80')]=_0x1ebe00;return _0x3d7ee7;});}return _0x3d7ee7;});};exports[_0xb5c5('0x81')]=function(){return __dirname;}; \ No newline at end of file +var _0x93e9=['intent','displayName','isFallback','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','model=%s','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','agi','https://api.ispeech.org/api/rest','protocol','https:','host','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','info','finish\x20download\x20file','unlink','download\x20error','end','WHAT_EVER','data','wav','error\x20convert','start','resolve','.wav','writeFileSync','base64','then','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','voice','audioConfig','MP3','text:synthesize','POST','generate','.mp3','from','audioContent','chmodSync','tmp','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','catch','name','message','googleDialogflow','textRequest','source','resolvedQuery','result','action','actionIncomplete','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','fields','diagnosticInfo','end_conversation','boolValue','fulfillmentText'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0x93e9,0x1a8));var _0x993e=function(_0x1ea855,_0x26f59f){_0x1ea855=_0x1ea855-0x0;var _0x4f1e6a=_0x93e9[_0x1ea855];return _0x4f1e6a;};'use strict';var apiai=require(_0x993e('0x0'));var BPromise=require(_0x993e('0x1'));var dialogflow=require(_0x993e('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x993e('0x3'));var path=require(_0x993e('0x4'));var querystring=require(_0x993e('0x5'));var rp=require(_0x993e('0x6'));var rs=require(_0x993e('0x7'));var sox=require(_0x993e('0x8'));var tts=require(_0x993e('0x9'));var urlParse=require(_0x993e('0xa'))[_0x993e('0xb')];var util=require(_0x993e('0xc'));var aws=require(_0x993e('0xd'));var google=require(_0x993e('0xe'));var sestek=require(_0x993e('0xf'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x993e('0x10'));var ISPEECH_API=_0x993e('0x11');function downloadFile(_0x2497f7,_0x4c808b){return new BPromise(function(_0x4bd4ef,_0x42546c){var _0xdbb49a=urlParse(_0x2497f7);var _0x3996dc=_0xdbb49a[_0x993e('0x12')]===_0x993e('0x13')?https:http;var _0x5b57b1={'host':_0xdbb49a[_0x993e('0x14')],'path':_0xdbb49a['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x3996dc['get'](_0x5b57b1,function(_0x52b72f){if(_0x52b72f[_0x993e('0x15')]!==0xc8){logger[_0x993e('0x16')](_0x993e('0x17')+_0x2497f7+_0x993e('0x18')+_0x52b72f[_0x993e('0x15')]+'\x20('+_0x52b72f[_0x993e('0x19')]+')');_0x42546c(new Error('request\x20to\x20'+_0x2497f7+_0x993e('0x18')+_0x52b72f[_0x993e('0x15')]+'\x20('+_0x52b72f[_0x993e('0x19')]+')'));return;}var _0x3e5235=fs['createWriteStream'](_0x4c808b);_0x3e5235['on']('finish',function(){logger[_0x993e('0x1a')](_0x993e('0x1b'));_0x3e5235['close'](_0x4bd4ef);});_0x3e5235['on'](_0x993e('0x16'),function(_0xcfc915){fs[_0x993e('0x1c')](_0x4c808b);logger[_0x993e('0x16')](_0x993e('0x1d'),_0xcfc915);_0x42546c(_0xcfc915);});_0x52b72f['pipe'](_0x3e5235);})['on'](_0x993e('0x16'),function(_0x1e6068){logger[_0x993e('0x16')](_0x1e6068);_0x42546c(_0x1e6068);})[_0x993e('0x1e')]();});}function uploadFile(_0x275a5d){return new BPromise(function(_0x4ed841,_0x110893){var _0x53b208=urlParse(_0x275a5d);var _0x56594e=_0x53b208[_0x993e('0x12')]==='https:'?https:http;var _0x2f58e0={'host':_0x53b208[_0x993e('0x14')],'path':_0x53b208[_0x993e('0x4')],'headers':{'user-agent':_0x993e('0x1f')}};_0x56594e['get'](_0x2f58e0,function(_0x3f4cc0){if(_0x3f4cc0[_0x993e('0x15')]!==0xc8){_0x110893(new Error(_0x993e('0x17')+_0x275a5d+_0x993e('0x18')+_0x3f4cc0[_0x993e('0x15')]+'\x20('+_0x3f4cc0[_0x993e('0x19')]+')'));return;}var _0x57df26='';_0x3f4cc0['on'](_0x993e('0x20'),function(_0x4eebb2){_0x57df26+=_0x4eebb2;});_0x3f4cc0['on'](_0x993e('0x1e'),function(){_0x4ed841(_0x57df26);});})['on'](_0x993e('0x16'),function(_0xec6e82){_0x110893(_0xec6e82);})[_0x993e('0x1e')]();});}function convertFile(_0x1707ab,_0x1f113d){return new BPromise(function(_0x2705c6,_0x4af800){var _0x1a02fe=sox['transcode'](_0x1707ab,_0x1f113d,{'sampleRate':0x1f40,'format':_0x993e('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1a02fe['on'](_0x993e('0x16'),function(_0x545bf9){logger[_0x993e('0x16')](_0x993e('0x22'),_0x545bf9);_0x4af800(_0x545bf9);});_0x1a02fe['on'](_0x993e('0x1e'),function(){logger['info']('finish\x20to\x20convert');_0x2705c6();});_0x1a02fe[_0x993e('0x23')]();});}function base64Decode(_0x16dcf1,_0x4573d3){var _0x9dccb7=path[_0x993e('0x24')](__dirname,'tmp',rs['generate'](0x4)+_0x993e('0x25'));fs[_0x993e('0x26')](_0x9dccb7,_0x16dcf1,_0x993e('0x27'));return convertFile(_0x9dccb7,_0x4573d3)[_0x993e('0x28')](function(){try{fs[_0x993e('0x1c')](_0x9dccb7);fs['chmodSync'](_0x4573d3,_0x993e('0x29'));}catch(_0x2cfeaf){logger['error'](_0x2cfeaf);}return _0x4573d3[_0x993e('0x2a')]('.')[0x0];});}function base64Encode(_0x209339){var _0x292919=fs[_0x993e('0x2b')](_0x209339);return new Buffer(_0x292919)[_0x993e('0x2c')](_0x993e('0x27'));}exports[_0x993e('0x2d')]=function(_0x5d0750,_0x33ed32,_0xbcd86f,_0xaed551,_0x134e5f,_0x38e35e){var _0x48a45c,_0x2bc4d2;var _0x33fcdc=_0x993e('0x2e');var _0xb3eb1=_0x993e('0x2f')+_0x5d0750;var _0x363e64={};if(_0x33ed32===_0x993e('0x30')){_0x363e64['input']={'ssml':_0xbcd86f};}else{_0x363e64['input']={'text':_0xbcd86f};};_0x363e64[_0x993e('0x31')]={'languageCode':_0xaed551,'ssmlGender':_0x134e5f};_0x363e64[_0x993e('0x32')]={'audioEncoding':_0x993e('0x33'),'sampleRateHertz':0x1f40};var _0x5bd77f={'url':_0x33fcdc+_0x993e('0x34')+_0xb3eb1,'method':_0x993e('0x35'),'json':!![],'body':_0x363e64};return rp(_0x5bd77f)[_0x993e('0x28')](function(_0x1dce2b){return new BPromise(function(_0xf672f,_0x3545a1){_0x48a45c=path['resolve'](__dirname,'tmp',rs[_0x993e('0x36')](0x4)+_0x993e('0x37'));var _0x56980f=Buffer[_0x993e('0x38')](_0x1dce2b[_0x993e('0x39')],'base64');return fs['writeFile'](_0x48a45c,_0x56980f,function(_0x5cdacb){_0x3545a1(_0x5cdacb);},function(_0x461e96){fs[_0x993e('0x3a')](_0x48a45c,_0x993e('0x29'));_0xf672f(_0x461e96);});});})[_0x993e('0x28')](function(_0x53a941){_0x2bc4d2=path[_0x993e('0x24')](__dirname,_0x993e('0x3b'),rs[_0x993e('0x36')](0x4)+_0x993e('0x25'));return convertFile(_0x48a45c,_0x2bc4d2);})[_0x993e('0x28')](function(){try{fs['unlink'](_0x48a45c);fs['chmodSync'](_0x2bc4d2,_0x993e('0x29'));}catch(_0x463f71){logger['error'](_0x463f71);}logger[_0x993e('0x1a')](_0x993e('0x3c'),_0x2bc4d2[_0x993e('0x2a')]('.')[0x0]);return _0x2bc4d2[_0x993e('0x2a')]('.')[0x0];});};exports[_0x993e('0x3d')]=function(_0x491dba,_0x205539){var _0x5c85e1=_0x993e('0x3e');var _0x48d74a,_0x344465;var _0x5e945c;var _0xaaa627={'encoding':'utf8','method':_0x993e('0x35'),'timeout':0x2710,'url':_0x5c85e1,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x993e('0x3f')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0x993e('0x40')]([_0x491dba,_0x205539||'en',![],_0x993e('0x41')]),null,_0x993e('0x42')]]]))};return rp(_0xaaa627)[_0x993e('0x28')](function(_0x2201a0){try{_0x5e945c=eval(_0x2201a0[_0x993e('0x43')](0x5))[0x0][0x2];}catch(_0x281348){throw new Error(_0x993e('0x44')+_0x2201a0[_0x993e('0x20')]);}if(!_0x5e945c){if(_0x491dba[_0x993e('0x45')]>0xc8){throw new Error(_0x993e('0x46'));}else{throw new Error(_0x993e('0x47')+_0x205539+_0x993e('0x48'));}}try{_0x5e945c=eval(_0x5e945c)[0x0];}catch(_0xf45817){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x26ce43=_0x5e945c;_0x48d74a=path['resolve'](__dirname,'tmp',rs[_0x993e('0x36')](0x4)+_0x993e('0x37'));fs[_0x993e('0x26')](_0x48d74a,_0x5e945c,{'encoding':_0x993e('0x27')});_0x344465=path[_0x993e('0x24')](__dirname,'tmp',rs[_0x993e('0x36')](0x4)+_0x993e('0x25'));return convertFile(_0x48d74a,_0x344465);})['then'](function(){try{fs[_0x993e('0x1c')](_0x48d74a);fs[_0x993e('0x3a')](_0x344465,_0x993e('0x29'));}catch(_0x290640){logger[_0x993e('0x16')](_0x290640);}logger['info'](_0x993e('0x49'),_0x344465[_0x993e('0x2a')]('.')[0x0]);return _0x344465[_0x993e('0x2a')]('.')[0x0];});};exports[_0x993e('0x4a')]=function(_0x12d005,_0x5a2319,_0x237c33){return google['asr'](_0x12d005,_0x5a2319,_0x237c33)[_0x993e('0x28')](function(_0x40eb7c){logger[_0x993e('0x1a')](_0x40eb7c[_0x993e('0x4b')]);return rp(_0x40eb7c);})[_0x993e('0x28')](function(_0x24c248){var _0x2feff8='';var _0x42adfc=0x0;try{fs[_0x993e('0x1c')](_0x12d005);}catch(_0xdc13d3){logger['error'](_0xdc13d3);}if(_0x24c248&&_0x24c248[_0x993e('0x4c')]){_0x2feff8=_0x24c248[_0x993e('0x4c')][_0x993e('0x4d')](function(_0x597b0e){return _0x597b0e&&_0x597b0e[_0x993e('0x4e')][0x0]&&_0x597b0e[_0x993e('0x4e')][0x0][_0x993e('0x4f')]?_0x597b0e[_0x993e('0x4e')][0x0][_0x993e('0x4f')]:'';})['join']('\x0a');_0x42adfc=_0x24c248['results']['map'](function(_0x25ca09){return _0x25ca09&&_0x25ca09[_0x993e('0x4e')][0x0]&&_0x25ca09[_0x993e('0x4e')][0x0][_0x993e('0x50')]?_0x25ca09[_0x993e('0x4e')][0x0][_0x993e('0x50')]:0x0;})[_0x993e('0x51')]('\x0a');}logger['info'](_0x993e('0x52'),_0x2feff8);logger['info']('googleASR\x20confidence',_0x42adfc);return{'transcript':_0x2feff8,'confidence':_0x42adfc};})[_0x993e('0x53')](function(_0x505ad7){logger[_0x993e('0x16')]('[%s]\x20%s:%s',_0x505ad7[_0x993e('0x15')],_0x505ad7[_0x993e('0x54')],_0x505ad7[_0x993e('0x55')]);});};exports[_0x993e('0x56')]=function(_0x49e0e1,_0x19ac07,_0x169e17,_0x2a4842){var _0x27c07f=apiai(_0x19ac07,{'language':_0x2a4842||'en'});return _0x27c07f[_0x993e('0x57')](_0x169e17,{'sessionId':md5(_0x49e0e1)})[_0x993e('0x28')](function(_0x422ccd){logger[_0x993e('0x1a')](JSON['stringify'](_0x422ccd));return{'source':_0x422ccd['result'][_0x993e('0x58')],'resolvedQuery':_0x422ccd['result'][_0x993e('0x59')],'action':_0x422ccd[_0x993e('0x5a')][_0x993e('0x5b')],'actionIncomplete':_0x422ccd['result'][_0x993e('0x5c')],'speech':_0x422ccd[_0x993e('0x5a')]['fulfillment'][_0x993e('0x5d')],'score':_0x422ccd[_0x993e('0x5a')][_0x993e('0x5e')],'statusCode':_0x422ccd[_0x993e('0x5f')][_0x993e('0x60')],'endConversation':_0x422ccd[_0x993e('0x5a')][_0x993e('0x61')]['endConversation']||![],'isFallbackIntent':_0x422ccd[_0x993e('0x5a')]['metadata'][_0x993e('0x62')]};});};exports[_0x993e('0x63')]=function(_0x15a1db,_0x295623,_0xf5e591,_0x1e2915,_0x157e1c,_0x28d162){var _0x2096ca=_0x1e2915[_0x993e('0x64')](/\\n/g,'\x0a');var _0xd134ad={'credentials':{'private_key':_0x2096ca,'client_email':_0xf5e591}};var _0x292056=new dialogflow[(_0x993e('0x65'))](_0xd134ad);var _0x524123=_0x292056[_0x993e('0x66')](_0x295623,md5(_0x15a1db));var _0x16ce9e={'session':_0x524123,'queryInput':{'text':{'text':_0x157e1c,'languageCode':_0x28d162}}};return _0x292056[_0x993e('0x67')](_0x16ce9e)[_0x993e('0x28')](function(_0x1ec0e5){if(_0x1ec0e5&&_0x1ec0e5['length']){logger[_0x993e('0x1a')](_0x993e('0x68'),JSON[_0x993e('0x40')](_0x1ec0e5));var _0x5b6568=_0x1ec0e5[0x0];if(_0x5b6568){var _0x49fc86={'action':_0x5b6568[_0x993e('0x69')][_0x993e('0x5b')],'allRequiredParamsPresent':_0x5b6568[_0x993e('0x69')][_0x993e('0x6a')],'endConversation':_0x5b6568[_0x993e('0x69')]['diagnosticInfo']&&_0x5b6568['queryResult']['diagnosticInfo'][_0x993e('0x6b')]?_0x5b6568[_0x993e('0x69')][_0x993e('0x6c')][_0x993e('0x6b')][_0x993e('0x6d')][_0x993e('0x6e')]:![],'fulfillmentText':_0x5b6568['queryResult'][_0x993e('0x6f')],'intentName':_0x5b6568[_0x993e('0x69')][_0x993e('0x70')]['name'],'intentDisplayName':_0x5b6568[_0x993e('0x69')][_0x993e('0x70')][_0x993e('0x71')],'isFallbackIntent':_0x5b6568[_0x993e('0x69')][_0x993e('0x70')][_0x993e('0x72')],'languageCode':_0x5b6568[_0x993e('0x69')]['languageCode'],'queryText':_0x5b6568['queryResult']['queryText'],'responseId':_0x5b6568['responseId'],'score':_0x5b6568[_0x993e('0x69')][_0x993e('0x73')],'speech':_0x5b6568['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x993e('0x40')](_0x1ec0e5)};return _0x49fc86;}}});};exports[_0x993e('0x74')]=function(_0x5aa092,_0x1a9a0f,_0xedda64,_0x497485){return tilde[_0x993e('0x75')](_0x5aa092,_0x1a9a0f,_0xedda64,_0x497485)['then'](function(_0x2bc56e){try{fs[_0x993e('0x1c')](_0x5aa092);}catch(_0x2be87b){logger['error'](_0x2be87b);}logger[_0x993e('0x1a')](_0x993e('0x76'),_0x2bc56e[_0x993e('0x4f')]);logger[_0x993e('0x1a')](_0x993e('0x77'),_0x2bc56e[_0x993e('0x50')]);return _0x2bc56e;});};exports[_0x993e('0x78')]=function(_0x462f6c,_0x2002d6,_0x356534,_0x5a7e53,_0x12a1fb,_0x312534){var _0x5b2ac6=path[_0x993e('0x24')](__dirname,_0x993e('0x3b'),rs[_0x993e('0x36')](0x4)+_0x993e('0x37'));var _0x3b1192;return aws[_0x993e('0x79')](_0x462f6c,_0x2002d6,_0x356534,_0x5a7e53,_0x12a1fb,_0x312534,_0x5b2ac6)[_0x993e('0x28')](function(){_0x3b1192=path[_0x993e('0x24')](__dirname,_0x993e('0x3b'),rs[_0x993e('0x36')](0x4)+_0x993e('0x25'));return convertFile(_0x5b2ac6,_0x3b1192);})['then'](function(){try{fs[_0x993e('0x1c')](_0x5b2ac6);fs[_0x993e('0x3a')](_0x3b1192,_0x993e('0x29'));}catch(_0x4e0632){logger[_0x993e('0x16')](_0x4e0632);}return _0x3b1192[_0x993e('0x2a')]('.')[0x0];});};exports[_0x993e('0x7a')]=function(_0x335aec,_0x158eba,_0xa83063,_0x5d55b2,_0x163d71,_0x1bae2e){return aws['lex'](_0x335aec,_0x158eba,_0xa83063,_0x5d55b2,_0x163d71,_0x1bae2e)[_0x993e('0x28')](function(_0x1b822b){logger[_0x993e('0x1a')](JSON[_0x993e('0x40')](_0x1b822b));return _0x1b822b;});};exports['ispeechTTS']=function(_0x527608,_0x493c73,_0x336eed,_0x49787d){var _0x525032=util[_0x993e('0x7b')](_0x993e('0x7c'),ISPEECH_API,_0x527608,encodeURIComponent(_0x493c73),_0x336eed,_0x49787d);var _0x1e27f6=path[_0x993e('0x24')](__dirname,'tmp',rs[_0x993e('0x36')](0x4)+'.mp3');var _0x43856f;return downloadFile(_0x525032,_0x1e27f6)[_0x993e('0x28')](function(){_0x43856f=path['resolve'](__dirname,_0x993e('0x3b'),rs[_0x993e('0x36')](0x4)+_0x993e('0x25'));return convertFile(_0x1e27f6,_0x43856f);})[_0x993e('0x28')](function(){try{fs['unlink'](_0x1e27f6);fs[_0x993e('0x3a')](_0x43856f,_0x993e('0x29'));}catch(_0x37a028){logger['error'](_0x37a028);}return _0x43856f[_0x993e('0x2a')]('.')[0x0];});};exports['ispeechASR']=function(_0x1644d1,_0x4d9f1c,_0x3977dc,_0x3d1b13){var _0x4aca6e=util[_0x993e('0x7b')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x4d9f1c,_0x3977dc,base64Encode(_0x1644d1),_0x3d1b13?util['format'](_0x993e('0x7d'),encodeURIComponent(_0x3d1b13)):'freeform=3');return uploadFile(_0x4aca6e)[_0x993e('0x28')](function(_0x462076){return querystring[_0x993e('0xb')](_0x462076);});};exports[_0x993e('0x7e')]=function(_0x51f09c,_0x4a05ba){return sestek[_0x993e('0x7f')](_0x51f09c,_0x4a05ba)['then'](function(_0x30fd9f){logger[_0x993e('0x1a')](JSON['stringify'](_0x30fd9f));var _0x6826c3={'speech':_0x30fd9f['text'],'action':_0x30fd9f[_0x993e('0x80')]?_0x30fd9f['channelData'][_0x993e('0x81')]:undefined,'actiondata':_0x30fd9f['channelData']?_0x30fd9f[_0x993e('0x80')][_0x993e('0x82')]:undefined};if(_0x30fd9f[_0x993e('0x80')]&&_0x30fd9f[_0x993e('0x80')][_0x993e('0x83')]){return base64Decode(_0x30fd9f[_0x993e('0x80')][_0x993e('0x83')][_0x993e('0x84')],path[_0x993e('0x24')](__dirname,_0x993e('0x3b'),rs['generate'](0x4)+_0x993e('0x25')))[_0x993e('0x28')](function(_0x247aaf){_0x6826c3['audiofile']=_0x247aaf;return _0x6826c3;});}return _0x6826c3;});};exports[_0x993e('0x85')]=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 cda46a3..e61d762 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 _0xe667=['exports'];(function(_0xc77311,_0x321f5d){var _0xf29cd9=function(_0x1ae712){while(--_0x1ae712){_0xc77311['push'](_0xc77311['shift']());}};_0xf29cd9(++_0x321f5d);}(_0xe667,0x18a));var _0x7e66=function(_0x5524a6,_0x8aaa35){_0x5524a6=_0x5524a6-0x0;var _0x51b2a6=_0xe667[_0x5524a6];return _0x51b2a6;};var nda=require('./nda');module[_0x7e66('0x0')]={'nda':nda}; \ No newline at end of file +var _0x8618=['./nda','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8618,0x19a));var _0x8861=function(_0x5260e6,_0xdf250f){_0x5260e6=_0x5260e6-0x0;var _0x32c1f6=_0x8618[_0x5260e6];return _0x32c1f6;};var nda=require(_0x8861('0x0'));module[_0x8861('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 2fdc5a9..db35652 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 _0x261b=['body','channelData','ProjectName','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise','url','POST','ndauth_url','password','username','then','resolve','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','Bearer\x20','access_token','project'];(function(_0x429ead,_0x4e0b10){var _0xed7d87=function(_0x59cccc){while(--_0x59cccc){_0x429ead['push'](_0x429ead['shift']());}};_0xed7d87(++_0x4e0b10);}(_0x261b,0x15a));var _0xb261=function(_0x3d10b5,_0x1a0488){_0x3d10b5=_0x3d10b5-0x0;var _0x5ca566=_0x261b[_0x3d10b5];return _0x5ca566;};'use strict';var rp=require(_0xb261('0x0'));var url=require(_0xb261('0x1'));var logger=require('../../../../../config/logger')('agi');module['exports']=function(_0x48c7f0,_0x392d5c){var _0x5a84d7={'method':_0xb261('0x2'),'uri':url['resolve'](_0x392d5c[_0xb261('0x3')],'/token'),'form':{'grant_type':_0xb261('0x4'),'username':_0x392d5c[_0xb261('0x5')],'password':_0x392d5c[_0xb261('0x4')]},'json':!![]};return rp(_0x5a84d7)[_0xb261('0x6')](function(_0x5740e1){var _0x756381={'method':_0xb261('0x2'),'uri':url[_0xb261('0x7')](_0x392d5c[_0xb261('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x392d5c[_0xb261('0x9')]||_0xb261('0xa'),'channelId':_0xb261('0xb'),'conversation':{'id':_0x48c7f0[_0xb261('0xc')]},'from':{'id':_0x48c7f0[_0xb261('0xd')],'name':_0x48c7f0[_0xb261('0xe')]},'recipient':{'id':_0x48c7f0['dnid'],'name':_0x48c7f0['extension']},'text':_0x392d5c['text'],'channelData':{}},'headers':{'Authorization':_0xb261('0xf')+_0x5740e1[_0xb261('0x10')]},'json':!![]};if(_0x392d5c[_0xb261('0x11')]){_0x756381[_0xb261('0x12')][_0xb261('0x13')][_0xb261('0x14')]=_0x392d5c['project'];}if(_0x392d5c['ndagenerate_audio']=='1'){_0x756381[_0xb261('0x12')][_0xb261('0x13')][_0xb261('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xb261('0x16')};}if(_0x392d5c[_0xb261('0x17')]){_0x756381[_0xb261('0x12')][_0xb261('0x13')][_0xb261('0x18')]=_0x392d5c[_0xb261('0x17')];if(_0x392d5c[_0xb261('0x19')]){_0x756381[_0xb261('0x12')][_0xb261('0x13')]['CustomActionData']=_0x392d5c[_0xb261('0x19')];}}logger[_0xb261('0x1a')](JSON[_0xb261('0x1b')](_0x756381));return rp(_0x756381);});}; \ No newline at end of file +var _0xb6b1=['calleridname','dnid','extension','text','access_token','project','body','ProjectName','channelData','AudioOutputSettings','audio/wav','custom_action','custom_action_data','info','stringify','request-promise','../../../../../config/logger','exports','resolve','ndauth_url','/token','password','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','callerid'];(function(_0x2c5775,_0x6d2968){var _0x4cd089=function(_0x4adf64){while(--_0x4adf64){_0x2c5775['push'](_0x2c5775['shift']());}};_0x4cd089(++_0x6d2968);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0xb6b1[_0x3ad7ad];return _0x225a60;};'use strict';var rp=require(_0x1b6b('0x0'));var url=require('url');var logger=require(_0x1b6b('0x1'))('agi');module[_0x1b6b('0x2')]=function(_0x29651a,_0x59b931){var _0x3f12e2={'method':'POST','uri':url[_0x1b6b('0x3')](_0x59b931[_0x1b6b('0x4')],_0x1b6b('0x5')),'form':{'grant_type':_0x1b6b('0x6'),'username':_0x59b931['username'],'password':_0x59b931[_0x1b6b('0x6')]},'json':!![]};return rp(_0x3f12e2)['then'](function(_0xae4115){var _0x5042f7={'method':_0x1b6b('0x7'),'uri':url[_0x1b6b('0x3')](_0x59b931[_0x1b6b('0x8')],_0x1b6b('0x9')),'body':{'type':_0x59b931['ndaactivity_type']||'message','channelId':_0x1b6b('0xa'),'conversation':{'id':_0x29651a[_0x1b6b('0xb')]},'from':{'id':_0x29651a[_0x1b6b('0xc')],'name':_0x29651a[_0x1b6b('0xd')]},'recipient':{'id':_0x29651a[_0x1b6b('0xe')],'name':_0x29651a[_0x1b6b('0xf')]},'text':_0x59b931[_0x1b6b('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0xae4115[_0x1b6b('0x11')]},'json':!![]};if(_0x59b931[_0x1b6b('0x12')]){_0x5042f7[_0x1b6b('0x13')]['channelData'][_0x1b6b('0x14')]=_0x59b931['project'];}if(_0x59b931['ndagenerate_audio']=='1'){_0x5042f7[_0x1b6b('0x13')][_0x1b6b('0x15')][_0x1b6b('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x1b6b('0x17')};}if(_0x59b931[_0x1b6b('0x18')]){_0x5042f7[_0x1b6b('0x13')][_0x1b6b('0x15')]['CustomAction']=_0x59b931[_0x1b6b('0x18')];if(_0x59b931[_0x1b6b('0x19')]){_0x5042f7[_0x1b6b('0x13')][_0x1b6b('0x15')]['CustomActionData']=_0x59b931[_0x1b6b('0x19')];}}logger[_0x1b6b('0x1a')](JSON[_0x1b6b('0x1b')](_0x5042f7));return rp(_0x5042f7);});}; \ 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 55963cf..5582f7d 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 _0xf19c=['exports','./lib/api'];(function(_0x315aca,_0x2d2896){var _0x4483b9=function(_0x6ead02){while(--_0x6ead02){_0x315aca['push'](_0x315aca['shift']());}};_0x4483b9(++_0x2d2896);}(_0xf19c,0x10b));var _0xcf19=function(_0x568e52,_0x1c1a97){_0x568e52=_0x568e52-0x0;var _0x4467da=_0xf19c[_0x568e52];return _0x4467da;};'use strict';var asr=require(_0xcf19('0x0'));module[_0xcf19('0x1')]=function(_0x42955a,_0x58b105,_0x34fc5c,_0x462df1){return asr(_0x42955a,_0x58b105,_0x34fc5c,_0x462df1);}; \ No newline at end of file +var _0x2f65=['exports','./lib/api'];(function(_0x15a522,_0x152d29){var _0x4cf789=function(_0x5bd37f){while(--_0x5bd37f){_0x15a522['push'](_0x15a522['shift']());}};_0x4cf789(++_0x152d29);}(_0x2f65,0xf1));var _0x52f6=function(_0x58eb37,_0x3ddabe){_0x58eb37=_0x58eb37-0x0;var _0x5ee8af=_0x2f65[_0x58eb37];return _0x5ee8af;};'use strict';var asr=require(_0x52f6('0x0'));module[_0x52f6('0x1')]=function(_0x1e3b42,_0x4ace19,_0x2e5b71,_0x43e7bd){return asr(_0x1e3b42,_0x4ace19,_0x2e5b71,_0x43e7bd);}; \ 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 4234915..d8ea6ce 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 _0x0292=['data','send','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','lodash','moment','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','info','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x0292,0xbc));var _0x2029=function(_0x8a7e38,_0x473a5d){_0x8a7e38=_0x8a7e38-0x0;var _0x228609=_0x0292[_0x8a7e38];return _0x228609;};'use strict';var BPromise=require(_0x2029('0x0'));var _=require(_0x2029('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2029('0x2'));var crypto=require('crypto');var logger=require(_0x2029('0x3'))(_0x2029('0x4'));module[_0x2029('0x5')]=function(_0x1b61a4,_0x1db0ac,_0x4dad74,_0x1a8359){return new BPromise(function(_0x3f74d3,_0x1aeb01){logger['info'](_0x2029('0x6'),_0x1a8359||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x62257d=new WebSocket(_0x1a8359||_0x2029('0x7'),{'perMessageDeflate':![]});var _0x843202='';var _0x11795e='0';var _0x29b260='1';var _0x2ac3ef=_0x2029('0x8');function _0x407693(_0x4c0da2){var _0x595e99=crypto[_0x2029('0x9')]('sha1');_0x595e99[_0x2029('0xa')](_0x4c0da2);return _0x595e99[_0x2029('0xb')]('hex');}function _0x599c8a(){try{logger[_0x2029('0xc')](_0x2029('0xd'));var _0x55359c=moment()[_0x2029('0xe')]();var _0x268ee0=_0x407693(_0x55359c+_0x1db0ac+_0x4dad74);_0x62257d['send'](JSON[_0x2029('0xf')]({'appID':_0x1db0ac,'timestamp':_0x55359c,'appKey':_0x268ee0}));var _0xb45278=fs[_0x2029('0x10')](_0x1b61a4);_0xb45278['on'](_0x2029('0x11'),function(_0x1a0a52){_0x62257d[_0x2029('0x12')](_0x1a0a52);});_0xb45278['on']('close',function(){_0x62257d[_0x2029('0x12')]('EOS');});}catch(_0x283efd){logger[_0x2029('0x13')](_0x2029('0x14'),JSON[_0x2029('0xf')](_0x283efd));_0x62257d['terminate']();}}function _0x4b85bc(_0xc69f5){try{if(_0xc69f5){var _0x4d8265=JSON[_0x2029('0x15')](_0xc69f5);switch(_0x4d8265[_0x2029('0x16')]){case 0x0:if(_0x4d8265[_0x2029('0x17')]){if(_0x4d8265[_0x2029('0x17')][_0x2029('0x18')]){logger[_0x2029('0xc')](_0x2029('0x19'),JSON[_0x2029('0xf')](_0x4d8265[_0x2029('0x17')][_0x2029('0x1a')]));_0x843202=_0x4d8265[_0x2029('0x17')]['hypotheses'][0x0][_0x2029('0x1b')];_0x11795e=_0x4d8265['result'][_0x2029('0x1a')][0x0]['likelihood'];_0x29b260='0';_0x2ac3ef='Success.';_0x62257d[_0x2029('0x1c')]();}}break;case 0x1:logger['info'](_0x2029('0x8'));_0x29b260='1';_0x2ac3ef='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info'](_0x2029('0x1d'));_0x29b260='2';_0x2ac3ef=_0x2029('0x1d');break;case 0x9:logger[_0x2029('0xc')](_0x2029('0x1e'));_0x29b260='9';_0x2ac3ef='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x2029('0xc')](_0x2029('0x1f'));_0x29b260='10';_0x2ac3ef='Authentication\x20failed.';break;case 0xb:logger[_0x2029('0xc')](_0x2029('0x20'));_0x29b260='11';_0x2ac3ef=_0x2029('0x20');}}}catch(_0x18bb42){logger['error'](_0x2029('0x21'),JSON['stringify'](_0x18bb42));_0x62257d['terminate']();}}function _0x1d6d15(){logger['info'](_0x2029('0x22'));_0x3f74d3({'transcript':_0x843202,'confidence':_0x11795e,'status':_0x29b260,'status_message':_0x2ac3ef});}function _0x3063f7(_0x51411f){logger['error'](_0x2029('0x23'));if(!_[_0x2029('0x24')](_0x51411f)){logger[_0x2029('0x13')](_[_0x2029('0x25')](_0x51411f)?JSON['stringify'](_0x51411f):_0x51411f);}}_0x62257d['on'](_0x2029('0x26'),_0x599c8a);_0x62257d['on'](_0x2029('0x27'),_0x4b85bc);_0x62257d['on'](_0x2029('0x28'),_0x1d6d15);_0x62257d['on'](_0x2029('0x13'),_0x3063f7);});}; \ No newline at end of file +var _0xe84d=['Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error'];(function(_0x7e0d9a,_0x4b1466){var _0x3eabf0=function(_0x3ae8f0){while(--_0x3ae8f0){_0x7e0d9a['push'](_0x7e0d9a['shift']());}};_0x3eabf0(++_0x4b1466);}(_0xe84d,0xd7));var _0xde84=function(_0x4c5911,_0x434a9b){_0x4c5911=_0x4c5911-0x0;var _0x22de3e=_0xe84d[_0x4c5911];return _0x22de3e;};'use strict';var BPromise=require(_0xde84('0x0'));var _=require(_0xde84('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xde84('0x2'));var crypto=require(_0xde84('0x3'));var logger=require(_0xde84('0x4'))(_0xde84('0x5'));module['exports']=function(_0x739adf,_0x4e40ff,_0x47338c,_0x589640){return new BPromise(function(_0x3d4207,_0x134b93){logger[_0xde84('0x6')](_0xde84('0x7'),_0x589640||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x135c81=new WebSocket(_0x589640||_0xde84('0x8'),{'perMessageDeflate':![]});var _0x424caa='';var _0x44b539='0';var _0x3940f3='1';var _0x4361dd=_0xde84('0x9');function _0x472f9f(_0xfeea53){var _0xf4924d=crypto['createHash'](_0xde84('0xa'));_0xf4924d['update'](_0xfeea53);return _0xf4924d[_0xde84('0xb')](_0xde84('0xc'));}function _0x57d617(){try{logger[_0xde84('0x6')](_0xde84('0xd'));var _0x444e0f=moment()[_0xde84('0xe')]();var _0x11963a=_0x472f9f(_0x444e0f+_0x4e40ff+_0x47338c);_0x135c81[_0xde84('0xf')](JSON[_0xde84('0x10')]({'appID':_0x4e40ff,'timestamp':_0x444e0f,'appKey':_0x11963a}));var _0x70f799=fs[_0xde84('0x11')](_0x739adf);_0x70f799['on'](_0xde84('0x12'),function(_0x5c94f7){_0x135c81[_0xde84('0xf')](_0x5c94f7);});_0x70f799['on'](_0xde84('0x13'),function(){_0x135c81[_0xde84('0xf')](_0xde84('0x14'));});}catch(_0x40a58d){logger[_0xde84('0x15')](_0xde84('0x16'),JSON[_0xde84('0x10')](_0x40a58d));_0x135c81[_0xde84('0x17')]();}}function _0x5df36b(_0x52ec25){try{if(_0x52ec25){var _0x1093d4=JSON[_0xde84('0x18')](_0x52ec25);switch(_0x1093d4[_0xde84('0x19')]){case 0x0:if(_0x1093d4[_0xde84('0x1a')]){if(_0x1093d4[_0xde84('0x1a')][_0xde84('0x1b')]){logger[_0xde84('0x6')](_0xde84('0x1c'),JSON[_0xde84('0x10')](_0x1093d4[_0xde84('0x1a')][_0xde84('0x1d')]));_0x424caa=_0x1093d4['result'][_0xde84('0x1d')][0x0]['transcript'];_0x44b539=_0x1093d4[_0xde84('0x1a')][_0xde84('0x1d')][0x0][_0xde84('0x1e')];_0x3940f3='0';_0x4361dd=_0xde84('0x1f');_0x135c81['terminate']();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x3940f3='1';_0x4361dd=_0xde84('0x9');break;case 0x2:logger['info'](_0xde84('0x20'));_0x3940f3='2';_0x4361dd='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xde84('0x6')](_0xde84('0x21'));_0x3940f3='9';_0x4361dd=_0xde84('0x21');break;case 0xa:logger[_0xde84('0x6')](_0xde84('0x22'));_0x3940f3='10';_0x4361dd=_0xde84('0x22');break;case 0xb:logger['info'](_0xde84('0x23'));_0x3940f3='11';_0x4361dd='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x1dbade){logger[_0xde84('0x15')](_0xde84('0x24'),JSON[_0xde84('0x10')](_0x1dbade));_0x135c81[_0xde84('0x17')]();}}function _0x3e640f(){logger['info'](_0xde84('0x25'));_0x3d4207({'transcript':_0x424caa,'confidence':_0x44b539,'status':_0x3940f3,'status_message':_0x4361dd});}function _0x513b84(_0x3252df){logger[_0xde84('0x15')](_0xde84('0x26'));if(!_['isNil'](_0x3252df)){logger[_0xde84('0x15')](_[_0xde84('0x27')](_0x3252df)?JSON[_0xde84('0x10')](_0x3252df):_0x3252df);}}_0x135c81['on'](_0xde84('0x28'),_0x57d617);_0x135c81['on'](_0xde84('0x29'),_0x5df36b);_0x135c81['on'](_0xde84('0x13'),_0x3e640f);_0x135c81['on'](_0xde84('0x15'),_0x513b84);});}; \ 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 207c8bb..b7bf1b8 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 _0xd204=['exports','./asr'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0xd204,0xe3));var _0x4d20=function(_0x3e635b,_0x2c02c6){_0x3e635b=_0x3e635b-0x0;var _0x3160eb=_0xd204[_0x3e635b];return _0x3160eb;};var asr=require(_0x4d20('0x0'));module[_0x4d20('0x1')]={'asr':asr}; \ No newline at end of file +var _0xe70d=['exports','./asr'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xe70d,0x14f));var _0xde70=function(_0x523642,_0x22ffbd){_0x523642=_0x523642-0x0;var _0x465b9c=_0xe70d[_0x523642];return _0x465b9c;};var asr=require(_0xde70('0x0'));module[_0xde70('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index c6eceaa..b0f60ad 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x5dbdfd,_0x1aef80){var _0x3db2e9=function(_0x344f0b){while(--_0x344f0b){_0x5dbdfd['push'](_0x5dbdfd['shift']());}};_0x3db2e9(++_0x1aef80);}(_0x34e8,0x12c));var _0x834e=function(_0x13162b,_0x12ecae){_0x13162b=_0x13162b-0x0;var _0x3ff54d=_0x34e8[_0x13162b];return _0x3ff54d;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file +var _0xd8b0=['getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','listen','listening','emit','connection'];(function(_0x4b0f59,_0x427904){var _0x4219c2=function(_0x3adf72){while(--_0x3adf72){_0x4b0f59['push'](_0x4b0f59['shift']());}};_0x4219c2(++_0x427904);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x0d8b('0x0'));var net=require(_0x0d8b('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0d8b('0x2'));var AGIServer=function(_0x5b9b89,_0x43bca1,_0x364286){var _0x8196ed=this;var _0x577834=null;var _0x5e15e6=0x0;if(!_0x5b9b89)_0x5b9b89=0x11dd;if(!_0x43bca1)_0x43bca1=_0x0d8b('0x3');EventEmitter[_0x0d8b('0x4')](_0x8196ed);function _0x39f43a(){if(!_0x5b9b89){_0x8196ed['emit'](_0x0d8b('0x5'),new AGIError(_0x0d8b('0x6')));return![];}_0x577834=net['createServer']();_0x577834[_0x0d8b('0x7')](_0x5b9b89,_0x43bca1);_0x577834['on'](_0x0d8b('0x8'),function(){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x8'));});_0x577834['on'](_0x0d8b('0xa'),function(_0x1cac62){_0x577834[_0x0d8b('0xb')](function(_0x28f87c,_0x48fa16){if(_0x28f87c){_0x8196ed[_0x0d8b('0x9')]('error',new AGIError(_0x0d8b('0xc'),_0x28f87c));}else if(_0x364286&&_0x364286<0x0){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xd')));_0x1cac62[_0x0d8b('0xe')]();}else if(_0x364286&&_0x364286>0x0&&_0x364286<_0x48fa16){_0x5e15e6+=0x1;_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xf'),_0x5e15e6));_0x1cac62[_0x0d8b('0xe')]();}else{var _0x2ce75e=new AGIChannel(_0x1cac62);_0x2ce75e['on'](_0x0d8b('0x10'),function(){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x2ce75e);});}});});_0x577834['on'](_0x0d8b('0x5'),function(_0x4f6f21){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xc'),_0x4f6f21[_0x0d8b('0x11')]));});_0x577834['on'](_0x0d8b('0x12'),function(){_0x8196ed['emit'](_0x0d8b('0x12'),new AGIError(_0x0d8b('0x13')));});}process[_0x0d8b('0x14')](function(){_0x39f43a();});};util[_0x0d8b('0x15')](AGIServer,EventEmitter);module[_0x0d8b('0x16')]=function(_0x18dd2d,_0x264b39,_0xa3612a){return new AGIServer(_0x18dd2d,_0x264b39,_0xa3612a);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 0e74825..486e582 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 _0xee24=['getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','getSoundPath','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','awsLex','aws_secret_access_key','aws_bot_name','googleASR','tildeASR','appid','appsecret','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','saveRestApiResult','%s.%s','setVariable','length','split','replaceAll','extra','getAndSetVariable','result','sync','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','no\x20grammar\x20configured','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','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_TRANSCRIPT','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','private_key','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','beep','tilde\x20%s\x20file\x20created','gotoc','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','streamFile','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','file_id','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','opts','indexOf','macro','gosub','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','XMCS-UNIQUEID','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','lodash','shelljs','randomstring','moment','mustache','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','prototype','getVariable','rpc','then','name','catch','getVoiceQueue','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSoundById','save_name'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xee24,0x1a6));var _0x4ee2=function(_0x5df9c5,_0x3b41d3){_0x5df9c5=_0x5df9c5-0x0;var _0x1a4029=_0xee24[_0x5df9c5];return _0x1a4029;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x4ee2('0x0'));var sh=require(_0x4ee2('0x1'));var odbc=require('odbc')();var rs=require(_0x4ee2('0x2'));var moment=require(_0x4ee2('0x3'));var Mustache=require(_0x4ee2('0x4'));var rp=require(_0x4ee2('0x5'));var logger=require('../../config/logger')(_0x4ee2('0x6'));var config=require(_0x4ee2('0x7'));var scripts=require(_0x4ee2('0x8'));var FILES_PATH=_0x4ee2('0x9');var recursiveMapAttributes=['rawHeaders',_0x4ee2('0xa')];var verticesWithRetry=[_0x4ee2('0xb'),_0x4ee2('0xc'),_0x4ee2('0xd')];var AGIVertices=function(_0x8d7266,_0x15f436,_0x32c572){this[_0x4ee2('0xe')]=_0x8d7266;this['rpc']=_0x15f436;this['mailRpc']=_0x32c572;};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x10')]=function(_0x36cf51,_0x2145d5){this[_0x4ee2('0x11')]['getVariableById'](_0x36cf51)[_0x4ee2('0x12')](function(_0x41bc11){_0x2145d5(null,_0x41bc11?_0x41bc11[_0x4ee2('0x13')]:![]);})[_0x4ee2('0x14')](function(_0x51f09d){_0x2145d5(_0x51f09d);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x15')]=function(_0x665d4d,_0x23c1c9){this['rpc']['getVoiceQueueById'](_0x665d4d)[_0x4ee2('0x12')](function(_0x2bf4c2){_0x23c1c9(null,_0x2bf4c2?_0x2bf4c2['name']:![]);})[_0x4ee2('0x14')](function(_0x231d5){_0x23c1c9(_0x231d5);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x16')]=function(_0x14bc72,_0x3b742c){this['rpc'][_0x4ee2('0x17')](_0x14bc72)[_0x4ee2('0x12')](function(_0x3d0308){_0x3b742c(null,_0x3d0308?_0x3d0308['name']:![]);})[_0x4ee2('0x14')](function(_0xb8e027){_0x3b742c(_0xb8e027);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x18')]=function(_0x92caf9,_0x341ca3){this[_0x4ee2('0x11')][_0x4ee2('0x19')](_0x92caf9)['then'](function(_0x4e82e3){_0x341ca3(null,_0x4e82e3?_0x4e82e3[_0x4ee2('0x1a')]:![]);})['catch'](function(_0x34c281){_0x341ca3(_0x34c281);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1b')]=function(_0x416a78,_0x4507d6){this['rpc'][_0x4ee2('0x1c')](_0x416a78)['then'](function(_0x1feac6){_0x4507d6(null,_0x1feac6?_0x1feac6[_0x4ee2('0x13')]:![]);})[_0x4ee2('0x14')](function(_0x1f4f90){_0x4507d6(_0x1f4f90);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1d')]=function(_0x381b3c,_0x581c75){this[_0x4ee2('0x11')]['getTrunkById'](_0x381b3c)['then'](function(_0xebd95f){_0x581c75(null,_0xebd95f?_0xebd95f[_0x4ee2('0x13')]:![]);})[_0x4ee2('0x14')](function(_0x1f79af){_0x581c75(_0x1f79af);});};AGIVertices[_0x4ee2('0xf')]['getSound']=function(_0x50005e,_0x404fba){var _0x2a078f=this;this['rpc'][_0x4ee2('0x1e')](_0x50005e)['then'](function(_0x49b1be){_0x404fba(null,_0x49b1be?_0x2a078f['getSoundPath'](_0x49b1be[_0x4ee2('0x1f')]):![]);})[_0x4ee2('0x14')](function(_0x50da2d){_0x404fba(_0x50da2d);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x20')]=function(_0x52db7b,_0xc7df80){this['rpc'][_0x4ee2('0x21')](_0x52db7b)[_0x4ee2('0x12')](function(_0x1fea65){_0xc7df80(null,_0x1fea65?_0x1fea65:![]);})['catch'](function(_0x4c1617){_0xc7df80(_0x4c1617);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x22')]=function(_0x3ab2a1,_0x502465,_0x1038e8){this[_0x4ee2('0x23')][_0x4ee2('0x22')](_0x3ab2a1,_0x502465)[_0x4ee2('0x12')](function(){_0x1038e8(null);})[_0x4ee2('0x14')](function(_0x2af2c0){_0x1038e8(_0x2af2c0);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x24')]=function(_0x256bea,_0x1231db){this[_0x4ee2('0x11')][_0x4ee2('0x25')](_0x256bea)['then'](function(_0x2f419b){if(_0x2f419b){if(_0x2f419b[_0x4ee2('0x26')]){_0x1231db(null,[_0x2f419b['interval']]);}else{_0x1231db(null,_[_0x4ee2('0x27')](_0x2f419b[_0x4ee2('0x28')],_0x4ee2('0x29')));}}else{_0x1231db(null,![]);}})[_0x4ee2('0x14')](function(_0x3f8416){_0x1231db(_0x3f8416);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x2a')]=function(_0x5b1c58){return util[_0x4ee2('0x2b')](_0x4ee2('0x2c'),FILES_PATH,_0x5b1c58);};AGIVertices[_0x4ee2('0xf')]['getQueryOdbc']=function(_0x208374,_0x5639c8,_0x1079b6){odbc[_0x4ee2('0x2d')](_0x208374,function(_0x40b6ba){if(_0x40b6ba){logger[_0x4ee2('0x2e')](_0x4ee2('0x2f'),_0x40b6ba);_0x1079b6(_0x40b6ba);}else{logger[_0x4ee2('0x30')]('ODBC\x20connection\x20successfully');odbc['query'](_0x5639c8,function(_0x3542a7,_0x3f2c6a){if(_0x3542a7){logger[_0x4ee2('0x30')](_0x4ee2('0x31'),_0x5639c8);_0x1079b6(_0x3542a7);}else{logger[_0x4ee2('0x30')](_0x4ee2('0x32'),_0x5639c8);odbc[_0x4ee2('0x33')](function(_0x29c4b3){if(_0x29c4b3){logger[_0x4ee2('0x2e')](_0x4ee2('0x34'),_0x29c4b3);}_0x1079b6(null,_0x3f2c6a);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x2e12f3,_0x2b54f1){this[_0x4ee2('0x11')]['getSmsAccountById'](_0x2e12f3)[_0x4ee2('0x12')](function(_0x2dee01){_0x2b54f1(null,_0x2dee01?_0x2dee01:![]);})[_0x4ee2('0x14')](function(_0x31d798){_0x2b54f1(_0x31d798);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x35')]=function(_0x6b643f,_0x766ea5){this[_0x4ee2('0x11')][_0x4ee2('0x35')](_0x6b643f)['then'](function(_0x5d4395){_0x766ea5(null,_0x5d4395);})[_0x4ee2('0x14')](function(_0xf327be){_0x766ea5(_0xf327be);});};AGIVertices[_0x4ee2('0xf')]['createSquareDetailsReport']=function(_0x1ef1d5,_0x56fd09,_0x34a074){this['rpc'][_0x4ee2('0x36')]({'uniqueid':this[_0x4ee2('0xe')][_0x4ee2('0x37')],'node':_0x1ef1d5['label'],'application':_0x1ef1d5[_0x4ee2('0x38')],'data':_0x56fd09||null,'project_name':this['channel'][_0x4ee2('0x39')],'callerid':this[_0x4ee2('0xe')][_0x4ee2('0x3a')]})[_0x4ee2('0x12')](function(_0x4f4687){if(_0x34a074){_0x34a074(null,_0x4f4687);}})[_0x4ee2('0x14')](function(_0x2ca3c1){if(_0x34a074){_0x34a074(_0x2ca3c1);}});};AGIVertices['prototype'][_0x4ee2('0x3b')]=function(_0x5dd440,_0x4b5061,_0x11cd7a,_0x54df9a){this[_0x4ee2('0x11')]['createSquareRecording']({'uniqueid':this[_0x4ee2('0xe')][_0x4ee2('0x37')],'callerid':this[_0x4ee2('0xe')]['callerid'],'calleridname':this[_0x4ee2('0xe')][_0x4ee2('0x3c')],'context':this[_0x4ee2('0xe')][_0x4ee2('0x3d')],'extension':this[_0x4ee2('0xe')]['extension'],'priority':this[_0x4ee2('0xe')][_0x4ee2('0x3e')],'accountcode':this['channel']['accountcode'],'dnid':this[_0x4ee2('0xe')]['dnid'],'projectName':this[_0x4ee2('0xe')][_0x4ee2('0x39')],'saveName':_0x4b5061,'filename':_0x5dd440['file']||_0x4b5061,'savePath':_0x11cd7a})[_0x4ee2('0x12')](function(_0x2bf21a){_0x54df9a(null,_0x2bf21a);})[_0x4ee2('0x14')](function(_0x4ae648){_0x54df9a(_0x4ae648);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x3f')]=function(_0x4f3fa6,_0x5204b0,_0x4c811a,_0x5ec387,_0x2b053a){this[_0x4ee2('0x11')]['createSquareMessage']({'uniqueid':this[_0x4ee2('0xe')][_0x4ee2('0x37')],'body':_0x4f3fa6,'direction':_0x5204b0,'providerName':_0x4c811a,'providerResponse':_0x5ec387})[_0x4ee2('0x12')](function(_0x1bd005){if(_0x2b053a){_0x2b053a(null,_0x1bd005);}})[_0x4ee2('0x14')](function(_0x152519){if(_0x2b053a){_0x2b053a(_0x152519);}});};AGIVertices[_0x4ee2('0xf')]['createCmContact']=function(_0x4498af,_0x517e9a){this[_0x4ee2('0x11')][_0x4ee2('0x40')]({'firstName':_[_0x4ee2('0x41')](_0x4498af['name'])||_[_0x4ee2('0x42')](_0x4498af[_0x4ee2('0x13')])?_0x4ee2('0x43')+Math['random']():_0x4498af['name'],'lastName':_[_0x4ee2('0x41')](_0x4498af[_0x4ee2('0x44')])||_[_0x4ee2('0x42')](_0x4498af[_0x4ee2('0x44')])?null:_0x4498af['lastName'],'phone':_0x4498af[_0x4ee2('0x45')],'ListId':_0x4498af[_0x4ee2('0x46')],'scheduledat':_0x4498af[_0x4ee2('0x47')],'callbackUniqueid':this[_0x4ee2('0xe')][_0x4ee2('0x37')],'tags':_0x4ee2('0x48'),'description':_0x4ee2('0x49')+_0x4498af[_0x4ee2('0x47')][_0x4ee2('0x4a')](),'priority':_0x4498af[_0x4ee2('0x4b')]})[_0x4ee2('0x12')](function(_0x1a1021){_0x517e9a(null,_0x1a1021);})['catch'](function(_0x59fb25){_0x517e9a(_0x59fb25);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x4c')]=function(_0x2b6465,_0x58c98d){this['rpc'][_0x4ee2('0x4d')](_0x2b6465)[_0x4ee2('0x12')](function(_0xf00660){_0x58c98d(null,_0xf00660?_0xf00660['name']:![]);})[_0x4ee2('0x14')](function(_0xc2d88f){_0x58c98d(_0xc2d88f);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x4e')]=function(_0x430dfc,_0x5a9dac,_0x55e0a4){var _0x2c7b92={'role':_0x4ee2('0x4f')};_0x2c7b92[_0x430dfc]=this['channel'][_0x4ee2('0x3a')];this[_0x4ee2('0x11')][_0x4ee2('0x4e')](_0x2c7b92,_0x5a9dac,this[_0x4ee2('0xe')][_0x4ee2('0x37')])['then'](function(_0x344e1c){_0x55e0a4(null,_['isNil'](_0x344e1c)?![]:!![]);})[_0x4ee2('0x14')](function(_0x450f98){logger['error'](_0x450f98);_0x55e0a4(null,![]);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x50')]=function(_0x3686e5,_0x1d6b21){var _0x592ce6={'role':_0x4ee2('0x4f')};_0x592ce6[_0x3686e5]=this[_0x4ee2('0xe')]['callerid'];this[_0x4ee2('0x11')][_0x4ee2('0x50')](_0x592ce6)[_0x4ee2('0x12')](function(_0x1f542a){_0x1d6b21(null,_['isNil'](_0x1f542a)?![]:!![]);})[_0x4ee2('0x14')](function(_0x3b3723){logger[_0x4ee2('0x2e')](_0x3b3723);_0x1d6b21(null,![]);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x51')]=function(_0x1b7bfc,_0x4c5988){var _0x211e6d={'role':_0x4ee2('0x4f')};_0x211e6d[_0x1b7bfc]=this[_0x4ee2('0xe')][_0x4ee2('0x3a')];this[_0x4ee2('0x11')][_0x4ee2('0x51')](_0x211e6d)[_0x4ee2('0x12')](function(_0x2136ad){_0x4c5988(null,_['isNil'](_0x2136ad)?![]:!![]);})['catch'](function(_0x5de0d2){logger[_0x4ee2('0x2e')](_0x5de0d2);_0x4c5988(null,![]);});};AGIVertices['prototype'][_0x4ee2('0x52')]=function(_0xcdf9c2,_0x355212){var _0x4c8d70={'role':'agent'};_0x4c8d70[_0xcdf9c2]=this[_0x4ee2('0xe')][_0x4ee2('0x3a')];var _0x4217f9=_0xcdf9c2!=_0x4ee2('0x53')?util[_0x4ee2('0x2b')](_0x4ee2('0x54'),'LOCAL',this[_0x4ee2('0xe')][_0x4ee2('0x3a')]):undefined;this[_0x4ee2('0x11')][_0x4ee2('0x52')](_0x4c8d70,_0x4217f9)[_0x4ee2('0x12')](function(_0x414e7d){_0x355212(null,_[_0x4ee2('0x42')](_0x414e7d)?![]:!![]);})[_0x4ee2('0x14')](function(_0x136ec5){logger['error'](_0x136ec5);_0x355212(null,![]);});};AGIVertices['prototype'][_0x4ee2('0x55')]=function(_0x4a3f7a,_0x46d1cb){sh['exec'](_['trim'](_0x4a3f7a),function(_0x342146,_0x3ef394){var _0x5671d5=_0x3ef394[_0x4ee2('0x56')](/(\r\n|\n|\r)/gm,'');_0x46d1cb(null,_0x5671d5);});};AGIVertices['prototype'][_0x4ee2('0x57')]=function(_0x3f23f1,_0x3aa69e){scripts['googleCloudTTS'](_0x3f23f1[_0x4ee2('0x58')],_0x3f23f1[_0x4ee2('0x59')]||'text',_0x3f23f1[_0x4ee2('0x5a')],_0x3f23f1[_0x4ee2('0x5b')]||_0x4ee2('0x5c'),_0x3f23f1[_0x4ee2('0x5d')]||_0x4ee2('0x5e'),_0x3f23f1[_0x4ee2('0x5f')]||_0x4ee2('0x60'))['then'](function(_0x48fbf7){_0x3aa69e(null,_0x48fbf7);})[_0x4ee2('0x14')](function(_0x15db25){_0x3aa69e(_0x15db25);});};AGIVertices[_0x4ee2('0xf')]['googleTTS']=function(_0x341b16,_0x41a850){scripts['googleTTS'](_0x341b16['text'],_0x341b16[_0x4ee2('0x61')]||'en',0x1)['then'](function(_0x23e898){_0x41a850(null,_0x23e898);})[_0x4ee2('0x14')](function(_0x479826){_0x41a850(_0x479826);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x62')]=function(_0x147353,_0x3428e0){var _0x2c3b73={'uri':_0x147353[_0x4ee2('0x63')],'method':_0x147353[_0x4ee2('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x147353[_0x4ee2('0x65')])===_0x4ee2('0x66')&&parseInt(_0x147353[_0x4ee2('0x65')])>=0x1?parseInt(_0x147353[_0x4ee2('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x4ee2('0x67')]([_0x4ee2('0x68'),_0x4ee2('0x69')],_0x2c3b73[_0x4ee2('0x64')][_0x4ee2('0x6a')]())){try{_0x2c3b73[_0x4ee2('0x6b')]=_0x147353[_0x4ee2('0xa')]?JSON[_0x4ee2('0x6c')](_0x147353[_0x4ee2('0xa')]):{};}catch(_0x3a4394){logger[_0x4ee2('0x2e')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3a4394);}}try{_0x2c3b73[_0x4ee2('0x6d')]=_0x147353[_0x4ee2('0x6e')]?JSON[_0x4ee2('0x6c')](_0x147353[_0x4ee2('0x6e')]):{};}catch(_0x2ec121){logger[_0x4ee2('0x2e')](_0x4ee2('0x6f'),_0x2ec121);}if(_0x147353[_0x4ee2('0x70')]){try{var _0x49e09e=require(_0x147353[_0x4ee2('0x70')])['sync'](this,_0x2c3b73);_0x2c3b73[_0x4ee2('0x71')]=Mustache[_0x4ee2('0x72')](_0x147353[_0x4ee2('0x63')],_0x49e09e,{},['$$','$$']);if(_0x2c3b73['headers']){_0x2c3b73[_0x4ee2('0x6d')]=JSON[_0x4ee2('0x6c')](Mustache[_0x4ee2('0x72')](JSON[_0x4ee2('0x73')](_0x2c3b73[_0x4ee2('0x6d')]),_0x49e09e,{},['$$','$$']));}if(_0x2c3b73[_0x4ee2('0x6b')]){_0x2c3b73[_0x4ee2('0x6b')]=JSON[_0x4ee2('0x6c')](Mustache[_0x4ee2('0x72')](JSON[_0x4ee2('0x73')](_0x2c3b73[_0x4ee2('0x6b')]),_0x49e09e,{},['$$','$$']));}}catch(_0x5e3e6d){logger[_0x4ee2('0x2e')](_0x4ee2('0x74'),_0x5e3e6d);}}rp(_0x2c3b73)['then'](function(_0x56c789){var _0x576440={'statusCode':_0x56c789[_0x4ee2('0x75')]||0xc8,'statusMessage':_0x56c789[_0x4ee2('0x76')]||'OK','headers':_0x56c789[_0x4ee2('0x6d')]||{},'body':_0x56c789[_0x4ee2('0x6b')]||{}};_0x3428e0(null,_0x576440);})[_0x4ee2('0x14')](function(_0x123b2f){var _0x2138c0={'statusCode':_0x123b2f[_0x4ee2('0x75')]||0x1f4,'statusMessage':_0x123b2f[_0x4ee2('0x77')]||_0x4ee2('0x78'),'headers':_0x123b2f[_0x4ee2('0x79')]['headers']||{},'body':_0x123b2f[_0x4ee2('0x79')]['body']||{}};_0x3428e0(null,_0x2138c0);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x7a')]=function(_0x6b233c,_0x2575a5){scripts[_0x4ee2('0x7a')](this[_0x4ee2('0xe')][_0x4ee2('0x37')],_0x6b233c[_0x4ee2('0x7b')],_0x6b233c[_0x4ee2('0x5a')],_0x6b233c[_0x4ee2('0x7c')]||'en')[_0x4ee2('0x12')](function(_0x1278ed){_0x2575a5(null,_0x1278ed);})[_0x4ee2('0x14')](function(_0x43d92b){_0x2575a5(_0x43d92b);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x7d')]=function(_0x43fa53,_0x5266f3){scripts[_0x4ee2('0x7d')](this[_0x4ee2('0xe')][_0x4ee2('0x37')],_0x43fa53[_0x4ee2('0x7e')],_0x43fa53[_0x4ee2('0x7f')],_0x43fa53['private_key'],_0x43fa53[_0x4ee2('0x5a')],_0x43fa53[_0x4ee2('0x80')]||'en')[_0x4ee2('0x12')](function(_0x2d91f4){_0x5266f3(null,_0x2d91f4);})['catch'](function(_0x35f757){_0x5266f3(_0x35f757);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x81')]=function(_0x4d041a,_0x26409a){scripts[_0x4ee2('0x81')](this[_0x4ee2('0xe')],_0x4d041a)[_0x4ee2('0x12')](function(_0x4b8a60){_0x26409a(null,_0x4b8a60);})[_0x4ee2('0x14')](function(_0x26632b){_0x26409a(_0x26632b);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x82')]=function(_0x242f3c,_0x1f6b62){scripts[_0x4ee2('0x82')](_0x242f3c['key'],_0x242f3c[_0x4ee2('0x5a')],_0x242f3c[_0x4ee2('0x83')]||_0x4ee2('0x5c'),_0x242f3c[_0x4ee2('0x84')])[_0x4ee2('0x12')](function(_0xa8d142){_0x1f6b62(null,_0xa8d142);})['catch'](function(_0x3769d1){_0x1f6b62(_0x3769d1);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x85')]=function(_0x36400e,_0x482e30,_0x26baa9){scripts['ispeechASR'](_0x482e30,_0x36400e['key'],_0x36400e[_0x4ee2('0x86')]||'en-US',this[_0x4ee2('0x87')](_0x36400e[_0x4ee2('0x88')])?_0x36400e['model']:undefined)[_0x4ee2('0x12')](function(_0x443c8a){_0x26baa9(null,_0x443c8a);})[_0x4ee2('0x14')](function(_0x5b8f7c){_0x26baa9(_0x5b8f7c);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x89')]=function(_0x16a3e8,_0x51ce91){scripts[_0x4ee2('0x89')](_0x16a3e8[_0x4ee2('0x8a')],_0x16a3e8['aws_secret_access_key'],_0x16a3e8[_0x4ee2('0x8b')],_0x16a3e8[_0x4ee2('0x8c')]||'Amy',_0x16a3e8[_0x4ee2('0x5a')],_0x16a3e8['aws_text_type']||_0x4ee2('0x5a'))[_0x4ee2('0x12')](function(_0x2563dc){_0x51ce91(null,_0x2563dc);})[_0x4ee2('0x14')](function(_0x3b8258){_0x51ce91(_0x3b8258);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x8d')]=function(_0x37a383,_0x51ee21){scripts[_0x4ee2('0x8d')](this[_0x4ee2('0xe')][_0x4ee2('0x37')],_0x37a383[_0x4ee2('0x8a')],_0x37a383[_0x4ee2('0x8e')],_0x37a383['aws_lex_region'],_0x37a383[_0x4ee2('0x5a')],_0x37a383[_0x4ee2('0x8f')])[_0x4ee2('0x12')](function(_0x56cecc){_0x51ee21(null,_0x56cecc);})[_0x4ee2('0x14')](function(_0x4dba92){_0x51ee21(_0x4dba92);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x90')]=function(_0x48f431,_0x13a431,_0x1cbe7f){scripts[_0x4ee2('0x90')](_0x13a431,_0x48f431[_0x4ee2('0x7b')],_0x48f431['google_asr_language']||_0x4ee2('0x5c'))['then'](function(_0x4561e4){_0x1cbe7f(null,_0x4561e4);})[_0x4ee2('0x14')](function(_0x404994){_0x1cbe7f(_0x404994);});};AGIVertices['prototype'][_0x4ee2('0x91')]=function(_0x522acb,_0x46f54d,_0x31e4c1){scripts[_0x4ee2('0x91')](_0x46f54d,_0x522acb[_0x4ee2('0x92')],_0x522acb[_0x4ee2('0x93')],_0x522acb[_0x4ee2('0x71')])[_0x4ee2('0x12')](function(_0x2931f0){_0x31e4c1(null,_0x2931f0);})[_0x4ee2('0x14')](function(_0x2863f5){_0x31e4c1(_0x2863f5);});};AGIVertices[_0x4ee2('0xf')]['clear']=function(_0x40facd){var _0x233bbb=_[_0x4ee2('0x67')](verticesWithRetry,_0x40facd[_0x4ee2('0x38')])?_0x40facd:_['clone'](_0x40facd);for(var _0x407229 in _0x233bbb){if(_0x233bbb[_0x4ee2('0x94')](_0x407229)){if(_0x233bbb[_0x407229]&&_[_0x4ee2('0x95')](_0x233bbb[_0x407229])){if(_[_0x4ee2('0x67')](recursiveMapAttributes,_0x407229)){_0x233bbb[_0x407229]=this[_0x4ee2('0x96')](_0x233bbb[_0x407229]);}else{_0x233bbb[_0x407229]=this[_0x4ee2('0x97')](_0x233bbb[_0x407229]);}}}}return _0x233bbb;};AGIVertices[_0x4ee2('0xf')]['recursiveNodeIndex']=function(_0x174742){for(var _0x47b089 in _0x174742){if(_0x174742[_0x4ee2('0x94')](_0x47b089)){if(_[_0x4ee2('0x98')](_0x174742[_0x47b089])){this[_0x4ee2('0x99')](_0x174742[_0x47b089]);}else if(_[_0x4ee2('0x9a')](_0x174742[_0x47b089])){for(var _0x2d4ac2=0x0;_0x2d4ac2<_0x174742[_0x47b089]['length'];_0x2d4ac2++){this[_0x4ee2('0x99')](_0x174742[_0x47b089][_0x2d4ac2]);}}else if(_[_0x4ee2('0x95')](_0x174742[_0x47b089])){_0x174742[_0x47b089]=this['replaceAllVariables'](_0x174742[_0x47b089]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x4f87ea,_0x5d25e6){for(var _0x40d990 in _0x4f87ea){if(_0x4f87ea[_0x4ee2('0x94')](_0x40d990)){if(_[_0x4ee2('0x98')](_0x4f87ea[_0x40d990])){if(!_[_0x4ee2('0x41')](_0x4f87ea[_0x40d990])){this[_0x4ee2('0x9b')](_0x4f87ea[_0x40d990],util[_0x4ee2('0x2b')](_0x4ee2('0x9c'),_0x5d25e6,_0x40d990));}}else if(_[_0x4ee2('0x9a')](_0x4f87ea[_0x40d990])){for(var _0x895e40=0x0;_0x895e40<_0x4f87ea[_0x40d990]['length'];_0x895e40++){this[_0x4ee2('0x9b')](_0x4f87ea[_0x40d990][_0x895e40],util[_0x4ee2('0x2b')]('%s.%s',_0x5d25e6,_0x40d990+'['+_0x895e40+']'));}}else{if(!_[_0x4ee2('0x42')](_0x4f87ea[_0x40d990])){this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')]('%s.%s',_0x5d25e6,_0x40d990),_0x4f87ea[_0x40d990]);}}}}};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x96')]=function(_0x43f703){try{var _0x7467dc=JSON['parse'](_0x43f703);this[_0x4ee2('0x99')](_0x7467dc);return JSON[_0x4ee2('0x73')](_0x7467dc);}catch(_0x4b1b33){return this[_0x4ee2('0x97')](_0x43f703);}};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x97')]=function(_0xe5eb1e){var _0x2b38ec=_0xe5eb1e['split']('{');for(var _0x13f585=0x1;_0x13f585<_0x2b38ec[_0x4ee2('0x9e')];_0x13f585+=0x1){var _0x16eecf=_0x2b38ec[_0x13f585][_0x4ee2('0x9f')]('}');if(_0x16eecf[_0x4ee2('0x9e')]>0x1){_0xe5eb1e=_0xe5eb1e[_0x4ee2('0xa0')]('{'+_0x16eecf[0x0]+'}',this[_0x4ee2('0xe')][_0x4ee2('0x10')](_0x16eecf[0x0])[_0x4ee2('0xa1')]||_0x16eecf[0x0]);}}if(_0x2b38ec[_0x4ee2('0x9e')]===0x1){return _0xe5eb1e[_0x4ee2('0x4a')]();}return this[_0x4ee2('0x97')](_0xe5eb1e);};AGIVertices['prototype'][_0x4ee2('0xa2')]=function(_0x3c7444,_0x4b6a7e){var _0x233cb1=this[_0x4ee2('0xe')][_0x4ee2('0x10')](_0x3c7444);if(_0x233cb1[_0x4ee2('0xa3')]===-0x1){return _0x233cb1;}logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x4b6a7e,_0x233cb1['extra']));return this[_0x4ee2('0xe')][_0x4ee2('0x9d')](_0x4b6a7e,_0x233cb1[_0x4ee2('0xa1')]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x87')]=function(_0x2110f4){return _0x2110f4&&_0x2110f4!=='0'&&_0x2110f4!=='-1'&&_0x2110f4!=='';};AGIVertices['prototype']['maxRetry']=function(_0x7f4a3d){this['createSquareDetailsReport'][_0x4ee2('0xa4')](this,_0x7f4a3d,'-');_0x7f4a3d[_0x4ee2('0xa5')]=_0x7f4a3d[_0x4ee2('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x4ee2('0xa7')]=function(_0x56229e){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xa8'),_0x56229e['label']));if(!this['isConfigured'](_0x56229e['text'])){return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}var _0x1c7f39='\x22'+_0x56229e['text']+'\x22';if(this[_0x4ee2('0x87')](_0x56229e['options'])){_0x1c7f39+=','+_0x56229e['options'];}var _0x158dcf=this[_0x4ee2('0xe')][_0x4ee2('0xab')]('MRCPSynth',_0x1c7f39);if(_0x158dcf['result']===-0x1){return _0x158dcf;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0xac'),_0x1c7f39));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xad')]=function(_0x4e8af6){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0xae'),_0x4e8af6[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x4e8af6[_0x4ee2('0xb0')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xb1'));}var _0x495526=_0x4e8af6[_0x4ee2('0xb0')];if(this[_0x4ee2('0x87')](_0x4e8af6[_0x4ee2('0x79')])){_0x495526+=','+_0x4e8af6[_0x4ee2('0x79')];}var _0x3b97d1=this['channel'][_0x4ee2('0xab')]('MRCPRecog',_0x495526);if(_0x3b97d1[_0x4ee2('0xa3')]===-0x1){return _0x3b97d1;}var _0x3c673e=this[_0x4ee2('0xa2')](_0x4ee2('0xb2'),_0x4ee2('0xb3'));if(_0x3c673e['result']===-0x1){return _0x3c673e;}var _0x53ac13=this[_0x4ee2('0xa2')](_0x4ee2('0xb4'),_0x4ee2('0xb5'));if(_0x53ac13[_0x4ee2('0xa3')]===-0x1){return _0x53ac13;}var _0x4fc99f=this[_0x4ee2('0xa2')](_0x4ee2('0xb6'),_0x4ee2('0xb7'));if(_0x4fc99f[_0x4ee2('0xa3')]===-0x1){return _0x4fc99f;}return this['channel'][_0x4ee2('0xa9')](util['format'](_0x4ee2('0xb8'),_0x495526));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x6')]=function(_0x205c95){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xb9'),_0x205c95['label']));return this[_0x4ee2('0xe')][_0x4ee2('0x6')]([_0x205c95[_0x4ee2('0xba')],_0x205c95[_0x4ee2('0xbb')]]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xbc')]=function(_0x9c83d8){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x9c83d8[_0x4ee2('0xaf')]));if(this[_0x4ee2('0x87')](_0x9c83d8[_0x4ee2('0x65')])){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xbd'),_0x9c83d8[_0x4ee2('0x65')]));var _0x5f4522=this['channel']['wait'](_0x9c83d8[_0x4ee2('0x65')]);if(_0x5f4522[_0x4ee2('0xa3')]===-0x1){return _0x5f4522;}}return this[_0x4ee2('0xe')][_0x4ee2('0xbc')]();};AGIVertices[_0x4ee2('0xf')]['callback']=function(_0x306f41){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xbe'),_0x306f41['label']));if(!this['isConfigured'](_0x306f41[_0x4ee2('0x46')])){return this['channel']['error'](_0x306f41,_0x4ee2('0xbf'));}_0x306f41[_0x4ee2('0x47')]=moment();if(this[_0x4ee2('0x87')](_0x306f41[_0x4ee2('0xc0')])){_0x306f41['scheduledAt']=moment()[_0x4ee2('0xc1')](_0x306f41[_0x4ee2('0xc0')],_0x4ee2('0xc2'));}if(!this[_0x4ee2('0x87')](_0x306f41[_0x4ee2('0x4b')])){_0x306f41['callback_priority']=0x2;}this['createCmContact']['sync'](this,_0x306f41);return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x306f41[_0x4ee2('0x45')],_0x306f41[_0x4ee2('0x46')],_0x306f41['scheduledAt']));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xc3')]=function(_0x3c032f){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xc4'),_0x3c032f['label']));var _0x304ea8=this[_0x4ee2('0xe')][_0x4ee2('0xab')](_0x3c032f[_0x4ee2('0xc5')],_0x3c032f['options']);if(_0x304ea8[_0x4ee2('0xa3')]===-0x1){return _0x304ea8;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format'](_0x4ee2('0xc6'),_0x3c032f['application'],_0x3c032f[_0x4ee2('0x79')]));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xc7')]=function(_0xf6c0d3){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xc8'),_0xf6c0d3[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0xf6c0d3[_0x4ee2('0x5a')])){return this['channel']['noop'](_0x4ee2('0xaa'));}var _0x77603f='\x22'+_0xf6c0d3['text']+'\x22';if(this['isConfigured'](_0xf6c0d3[_0x4ee2('0x79')])){_0x77603f+=','+_0xf6c0d3[_0x4ee2('0x79')];}var _0x3ab010=this[_0x4ee2('0xe')][_0x4ee2('0xab')]('MRCPSynth',_0x77603f);if(_0x3ab010[_0x4ee2('0xa3')]===-0x1){return _0x3ab010;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format'](_0x4ee2('0xac'),_0x77603f));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xc9')]=function(_0x34e9b4){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xca'),_0x34e9b4[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x34e9b4[_0x4ee2('0x5a')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}var _0x312c00='\x22'+_0x34e9b4[_0x4ee2('0x5a')]+'\x22';if(this['isConfigured'](_0x34e9b4['options'])){_0x312c00+=','+_0x34e9b4['options'];}var _0x25e928=this[_0x4ee2('0xe')][_0x4ee2('0xab')](_0x4ee2('0xcb'),_0x312c00);if(_0x25e928[_0x4ee2('0xa3')]===-0x1){return _0x25e928;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x312c00));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xcc')]=function(_0xc3e95d){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xcd'),_0xc3e95d[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0xc3e95d[_0x4ee2('0xb0')])){return this[_0x4ee2('0xe')]['noop']('no\x20grammar\x20configured');}var _0x4dab6d=_0xc3e95d[_0x4ee2('0xb0')];if(this[_0x4ee2('0x87')](_0xc3e95d[_0x4ee2('0x79')])){_0x4dab6d+=','+_0xc3e95d[_0x4ee2('0x79')];}var _0x1b1e00=this['channel'][_0x4ee2('0xab')](_0x4ee2('0xce'),_0x4dab6d);if(_0x1b1e00['result']===-0x1){return _0x1b1e00;}var _0x5735af=this[_0x4ee2('0xa2')](_0x4ee2('0xb2'),'LUMENVOX_ASR_CONFIDENCE');if(_0x5735af[_0x4ee2('0xa3')]===-0x1){return _0x5735af;}var _0x57b45b=this[_0x4ee2('0xa2')]('RECOG_INPUT()',_0x4ee2('0xcf'));if(_0x57b45b[_0x4ee2('0xa3')]===-0x1){return _0x57b45b;}var _0x47d86f=this[_0x4ee2('0xa2')](_0x4ee2('0xb6'),'LUMENVOX_ASR_INSTANCE');if(_0x47d86f[_0x4ee2('0xa3')]===-0x1){return _0x47d86f;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x4dab6d));};AGIVertices[_0x4ee2('0xf')]['sestekasr']=function(_0x4f2167){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xd0'),_0x4f2167[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x4f2167[_0x4ee2('0xb0')])){return this['channel'][_0x4ee2('0xa9')]('no\x20grammar\x20configured');}var _0x5bab10=_0x4f2167[_0x4ee2('0xb0')];if(this['isConfigured'](_0x4f2167[_0x4ee2('0x79')])){_0x5bab10+=','+_0x4f2167[_0x4ee2('0x79')];}var _0x4a9e90=this[_0x4ee2('0xe')][_0x4ee2('0xab')](_0x4ee2('0xce'),_0x5bab10);if(_0x4a9e90['result']===-0x1){return _0x4a9e90;}var _0xc4505c=this[_0x4ee2('0xa2')]('RECOG_CONFIDENCE()',_0x4ee2('0xd1'));if(_0xc4505c[_0x4ee2('0xa3')]===-0x1){return _0xc4505c;}var _0x2c206d=this['getAndSetVariable']('RECOG_INPUT()',_0x4ee2('0xd2'));if(_0x2c206d[_0x4ee2('0xa3')]===-0x1){return _0x2c206d;}var _0x16f54a=this[_0x4ee2('0xa2')](_0x4ee2('0xb6'),_0x4ee2('0xd3'));if(_0x16f54a[_0x4ee2('0xa3')]===-0x1){return _0x16f54a;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0xb8'),_0x5bab10));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xd4')]=function(_0x367d0b){logger['info'](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x367d0b[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x367d0b[_0x4ee2('0xd5')])){return this['channel'][_0x4ee2('0x2e')](_0x367d0b,_0x4ee2('0xd6'));}var _0x15e343=this['getSquareOdbc'][_0x4ee2('0xa4')](this,_0x367d0b[_0x4ee2('0xd5')]);if(!_0x15e343){return this[_0x4ee2('0xe')]['error'](_0x367d0b,'no\x20odbc\x20database\x20found');}if(!this[_0x4ee2('0x87')](_0x367d0b['query'])){return this['channel'][_0x4ee2('0x2e')](_0x367d0b,_0x4ee2('0xd7'));}var _0x343867=_0x367d0b[_0x4ee2('0xd8')][_0x4ee2('0x56')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x4ee2('0xa9')](util['format']('query:\x20%s',_0x343867));var _0x561f73=this[_0x4ee2('0xd9')]['sync'](this,_0x15e343,_0x343867);this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x367d0b,_0x343867);if(!this[_0x4ee2('0x87')](_0x367d0b[_0x4ee2('0xda')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xdb'));}var _0x2f1c00=this[_0x4ee2('0x10')][_0x4ee2('0xa4')](this,_0x367d0b[_0x4ee2('0xda')]);if(!_0x2f1c00){return this[_0x4ee2('0xe')]['error'](_0x367d0b,_0x4ee2('0xdc'));}var _0x169d4b=this;_0x561f73['forEach'](function(_0x3928a6,_0x47918d){Object[_0x4ee2('0xdd')](_0x3928a6)[_0x4ee2('0xde')](function(_0x1f885b){_0x169d4b[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')](_0x4ee2('0xdf'),_0x2f1c00,_0x47918d,_0x1f885b),_0x3928a6[_0x1f885b]);});});this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util['format'](_0x4ee2('0xe0'),_0x2f1c00),_0x561f73['length']);return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0xe1'),_0x2f1c00));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xe2')]=function(_0x17c91f){logger[_0x4ee2('0xe3')](util[_0x4ee2('0x2b')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x17c91f['label']));if(!this['isConfigured'](_0x17c91f[_0x4ee2('0xe4')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x17c91f,_0x4ee2('0xe5'));}var _0x25bfeb=this[_0x4ee2('0x1b')]['sync'](this,_0x17c91f['sip_id']);if(!_0x25bfeb){return this['channel'][_0x4ee2('0x2e')](_0x17c91f,_0x4ee2('0xe6'));}var _0x22338e=this[_0x4ee2('0xe')][_0x4ee2('0xab')](_0x4ee2('0xe7'),[util[_0x4ee2('0x2b')]('SIP/%s',_0x25bfeb),_0x17c91f[_0x4ee2('0x65')],_0x17c91f['opts'],_0x17c91f[_0x4ee2('0x63')]]);if(_0x22338e['result']===-0x1){return _0x22338e;}return this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xe8')]=function(_0xb51d01){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0xe9'),_0xb51d01[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0xb51d01[_0x4ee2('0x7b')])){return this[_0x4ee2('0xe')]['noop'](_0x4ee2('0xea'));}if(!this['isConfigured'](_0xb51d01[_0x4ee2('0x5a')])){return this[_0x4ee2('0xe')]['noop']('no\x20text\x20configured');}this[_0x4ee2('0xe')][_0x4ee2('0xeb')]=!![];this[_0x4ee2('0x36')](_0xb51d01);this[_0x4ee2('0x3f')](_0xb51d01[_0x4ee2('0x5a')],'in','','');this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0xec'),_0xb51d01['text']));var _0x3122d8=this[_0x4ee2('0x7a')]['sync'](this,_0xb51d01);if(_0x3122d8){for(var _0x226085 in _0x3122d8){if(_0x3122d8[_0x4ee2('0x94')](_0x226085)){this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')](_0x4ee2('0xed'),_0x226085['toUpperCase']()),_0x3122d8[_0x226085]);}}this[_0x4ee2('0x3f')](_0x3122d8['speech'],_0x4ee2('0xee'),'dialogflow','');return this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')]('Dialogflow\x20Result\x20%s',_0x3122d8[_0x4ee2('0xef')]));}return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0xb51d01,_0x4ee2('0xf0'));};AGIVertices[_0x4ee2('0xf')]['dialogflowV2']=function(_0x1b0ae6){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xf1'),_0x1b0ae6[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x1b0ae6[_0x4ee2('0x7e')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xf2'));}if(!this[_0x4ee2('0x87')](_0x1b0ae6['client_email'])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x1b0ae6[_0x4ee2('0xf3')])){return this['channel'][_0x4ee2('0xa9')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x1b0ae6[_0x4ee2('0x80')])){return this['channel'][_0x4ee2('0xa9')]('no\x20anguage\x20configured');}if(!this[_0x4ee2('0x87')](_0x1b0ae6[_0x4ee2('0x5a')])){return this[_0x4ee2('0xe')]['noop'](_0x4ee2('0xaa'));}this[_0x4ee2('0xe')][_0x4ee2('0xeb')]=!![];this[_0x4ee2('0x36')](_0x1b0ae6);this[_0x4ee2('0x3f')](_0x1b0ae6['text'],'in','','');this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0xf4'),_0x1b0ae6[_0x4ee2('0x5a')]));var _0x74282a=this[_0x4ee2('0x7d')]['sync'](this,_0x1b0ae6);if(_0x74282a){for(var _0x1563d0 in _0x74282a){if(_0x74282a[_0x4ee2('0x94')](_0x1563d0)){if(_0x1563d0!==_0x4ee2('0xf5')){this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util['format'](_0x4ee2('0xed'),_0x1563d0[_0x4ee2('0x6a')]()),_0x74282a[_0x1563d0]);}}}this[_0x4ee2('0x3f')](_0x74282a['speech'],_0x4ee2('0xee'),_0x4ee2('0xf6'),_0x74282a['providerResponse']);return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0xf7'),_0x74282a['speech']));}return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x1b0ae6,_0x4ee2('0xf8'));};AGIVertices['prototype'][_0x4ee2('0xf9')]=function(_0x356357){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x356357[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x356357[_0x4ee2('0xfa')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x4ee2('0x87')](_0x356357[_0x4ee2('0xfb')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xfc'));}if(!this[_0x4ee2('0x87')](_0x356357[_0x4ee2('0xfd')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('no\x20password\x20configured');}if(!this[_0x4ee2('0x87')](_0x356357[_0x4ee2('0xfe')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}this[_0x4ee2('0xe')][_0x4ee2('0xeb')]=!![];this[_0x4ee2('0x36')](_0x356357);this['createSquareMessage'](_0x356357['text'],'in','','');this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format'](_0x4ee2('0xff'),_0x356357[_0x4ee2('0x5a')]));var _0x2dc751=this[_0x4ee2('0x81')][_0x4ee2('0xa4')](this,_0x356357);if(_0x2dc751){for(var _0x529023 in _0x2dc751){if(_0x2dc751['hasOwnProperty'](_0x529023)){this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')](_0x4ee2('0x100'),_0x529023[_0x4ee2('0x6a')]()),_0x2dc751[_0x529023]);}}this[_0x4ee2('0x3f')](_0x2dc751[_0x4ee2('0xef')],_0x4ee2('0xee'),_0x4ee2('0xf9'),'');if(_0x2dc751[_0x4ee2('0x101')]){this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x102'),_0x2dc751['audiofile']));var _0x2538c6=this['channel']['streamFile'](_0x2dc751['audiofile']);try{fs[_0x4ee2('0x103')](_0x2dc751['audiofile']+_0x4ee2('0x104'));}catch(_0xb76eb){logger[_0x4ee2('0x2e')](_0xb76eb);}return _0x2538c6;}else{return this['channel'][_0x4ee2('0xa9')](util['format'](_0x4ee2('0x105'),_0x2dc751['speech']));}}return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x356357,_0x4ee2('0x106'));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x107')]=function(_0x5974f5){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Enter\x20in\x20END\x20(%s)\x20block',_0x5974f5[_0x4ee2('0xaf')]));return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('end');};AGIVertices[_0x4ee2('0xf')]['ext_dial']=function(_0x3204a0){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x3204a0['label']));var _0x1d8a78='';if(_0x3204a0[_0x4ee2('0x108')]){if(!this[_0x4ee2('0x87')](_0x3204a0[_0x4ee2('0x108')])){return this['channel'][_0x4ee2('0x2e')](_0x3204a0,_0x4ee2('0x109'));}else{var _0x150488=parseInt(_0x3204a0[_0x4ee2('0x108')],0xa);if(isNaN(_0x150488)){_0x1d8a78=_0x3204a0['trunk_id'];}else{_0x1d8a78=this[_0x4ee2('0x1d')][_0x4ee2('0xa4')](this,_0x3204a0[_0x4ee2('0x108')]);if(!_0x1d8a78){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x3204a0,_0x4ee2('0x10a'));}}}}else if(_0x3204a0[_0x4ee2('0x10b')]){_0x1d8a78=_0x3204a0['trunk_name'];}else{return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x3204a0,_0x4ee2('0x109'));}var _0x40d94a=this['channel'][_0x4ee2('0xab')](_0x4ee2('0xe7'),[util[_0x4ee2('0x2b')](_0x4ee2('0x10c'),_0x1d8a78,_0x3204a0[_0x4ee2('0x45')]),_0x3204a0[_0x4ee2('0x65')],_0x3204a0['opts'],_0x3204a0[_0x4ee2('0x63')]]);if(_0x40d94a['result']===-0x1){return _0x40d94a;}return this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')]('Executed\x20command\x20%s',_0x4ee2('0xe7')));};AGIVertices['prototype'][_0x4ee2('0x10d')]=function(_0x467813){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x467813[_0x4ee2('0xaf')]));return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0x10d'));};AGIVertices[_0x4ee2('0xf')]['getdigits']=function(_0x20e612){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x10e'),_0x20e612[_0x4ee2('0xaf')]));if(_0x20e612[_0x4ee2('0xa5')]===0x0){return this[_0x4ee2('0xa6')](_0x20e612);}_0x20e612[_0x4ee2('0xa5')]-=0x1;if(!this[_0x4ee2('0x87')](_0x20e612['file_id'])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x20e612,_0x4ee2('0x10f'));}var _0x462932=this['getSound']['sync'](this,_0x20e612['file_id']);if(!_0x462932){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x20e612,_0x4ee2('0x110'));}if(!this[_0x4ee2('0x87')](_0x20e612[_0x4ee2('0xda')])){return this[_0x4ee2('0xe')]['error'](_0x4ee2('0xdb'));}var _0x681f22=this[_0x4ee2('0xe')]['getData'](_0x462932,_0x20e612['response'],_0x20e612[_0x4ee2('0x111')]);var _0x20f931=_0x681f22[_0x4ee2('0xa3')]?_0x681f22['result'][_0x4ee2('0x4a')]():'';logger[_0x4ee2('0x30')](_0x4ee2('0x112'),JSON[_0x4ee2('0x73')](_0x681f22));if(_0x681f22[_0x4ee2('0xa3')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x20e612,_0x20f931);return _0x681f22;}else if(_0x681f22['extra']===_0x4ee2('0x65')){_0x681f22[_0x4ee2('0xa3')]=_0x20f931[_0x4ee2('0x9e')]>=parseInt(_0x20e612[_0x4ee2('0x113')])?'x':'i';}else{_0x681f22[_0x4ee2('0xa3')]=_0x20f931['length']>=parseInt(_0x20e612['mindigit'])&&_0x20f931[_0x4ee2('0x9e')]<=parseInt(_0x20e612['maxdigit'])?'x':'i';}var _0xbd4d2a=this[_0x4ee2('0x10')]['sync'](this,_0x20e612[_0x4ee2('0xda')]);if(!_0xbd4d2a){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x20e612,_0x4ee2('0xdc'));}this['channel'][_0x4ee2('0x9d')](_0xbd4d2a,_0x20f931);if(this[_0x4ee2('0x87')](_0x20e612[_0x4ee2('0x114')])){var _0x1c94fa=parseInt(_0x20e612[_0x4ee2('0x114')],0xa);var _0x24fb84=rs[_0x4ee2('0x115')]({'charset':'*','length':_0x1c94fa});var _0x5be0ea=_0x20f931['length'];if(_0x5be0ea>0x0){if(_0x5be0ea>_0x1c94fa){this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x20e612,_0x20e612[_0x4ee2('0x116')]===_0x4ee2('0x117')?_0x24fb84+_0x20f931[_0x4ee2('0x118')](_0x1c94fa):_0x20f931[_0x4ee2('0x118')](0x0,_0x5be0ea-_0x1c94fa)+_0x24fb84);}else{this['createSquareDetailsReport'][_0x4ee2('0xa4')](this,_0x20e612,rs[_0x4ee2('0x115')]({'charset':'*','length':_0x5be0ea}));}}else{this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x20e612,'');}}else{this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x20e612,_0x20f931);}return _0x681f22;};AGIVertices[_0x4ee2('0xf')]['getsecretdigits']=function(_0x25433c){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x119'),_0x25433c[_0x4ee2('0xaf')]));return this[_0x4ee2('0xc')](_0x25433c);};AGIVertices[_0x4ee2('0xf')]['goal']=function(_0x4f8d55){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x11a'),_0x4f8d55[_0x4ee2('0xaf')]));this['createSquareDetailsReport'][_0x4ee2('0xa4')](this,_0x4f8d55,_0x4f8d55[_0x4ee2('0x11b')]);return this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x11c'),_0x4f8d55[_0x4ee2('0x11b')]));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x11d')]=function(_0x42ebb7){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x11e'),_0x42ebb7[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x42ebb7[_0x4ee2('0x8a')])||!this[_0x4ee2('0x87')](_0x42ebb7[_0x4ee2('0x8e')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0x11f'));}if(!this['isConfigured'](_0x42ebb7[_0x4ee2('0x5a')])){return this['channel']['noop']('no\x20text\x20configured');}this['channel']['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x120'),_0x42ebb7[_0x4ee2('0x5a')]));var _0x33c1bf=this[_0x4ee2('0x89')][_0x4ee2('0xa4')](this,_0x42ebb7);if(_0x33c1bf){this[_0x4ee2('0xe')]['noop'](util['format'](_0x4ee2('0x121'),_0x33c1bf));var _0x2da13f=this[_0x4ee2('0xe')]['streamFile'](_0x33c1bf);try{fs[_0x4ee2('0x103')](_0x33c1bf+'.wav');}catch(_0x58ab30){logger[_0x4ee2('0x2e')](_0x58ab30);}return _0x2da13f;}return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x42ebb7,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x122')]=function(_0x5f18a0){logger[_0x4ee2('0x30')](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5f18a0[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x5f18a0[_0x4ee2('0x8a')])||!this[_0x4ee2('0x87')](_0x5f18a0[_0x4ee2('0x8e')])){return this[_0x4ee2('0xe')]['noop'](_0x4ee2('0x11f'));}if(!this[_0x4ee2('0x87')](_0x5f18a0['aws_bot_name'])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('no\x20bot\x20name\x20configured');}if(!this[_0x4ee2('0x87')](_0x5f18a0[_0x4ee2('0x5a')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}this[_0x4ee2('0xe')][_0x4ee2('0xeb')]=!![];this['createSquareDetailsReport'](_0x5f18a0);this[_0x4ee2('0x3f')](_0x5f18a0[_0x4ee2('0x5a')],'in','','');this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x123'),_0x5f18a0[_0x4ee2('0x5a')]));var _0x2750ab=this[_0x4ee2('0x8d')][_0x4ee2('0xa4')](this,_0x5f18a0);if(_0x2750ab){for(var _0x32c069 in _0x2750ab){if(_0x2750ab[_0x4ee2('0x94')](_0x32c069)&&_[_0x4ee2('0x95')](_0x2750ab[_0x32c069])){this[_0x4ee2('0xe')]['setVariable'](util[_0x4ee2('0x2b')](_0x4ee2('0x124'),_0x32c069[_0x4ee2('0x6a')]()),_0x2750ab[_0x32c069]);}}if(_[_0x4ee2('0x42')](_0x2750ab['message'])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x4ee2('0x3f')](_0x2750ab[_0x4ee2('0x77')],_0x4ee2('0xee'),_0x4ee2('0x125'),'');return this['channel']['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x126'),_0x2750ab[_0x4ee2('0x77')]));}}return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x5f18a0,_0x4ee2('0x127'));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x128')]=function(_0x335d17){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x129'),_0x335d17[_0x4ee2('0xaf')],_0x335d17[_0x4ee2('0x65')]));if(!this[_0x4ee2('0x87')](_0x335d17['key'])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xea'));}var _0xf5703a='wav';var _0x4c1bf1=util['format'](_0x4ee2('0x12a'),FILES_PATH,rs[_0x4ee2('0x115')](0x4));var _0x3524eb=util[_0x4ee2('0x2b')](_0x4ee2('0x9c'),_0x4c1bf1,_0xf5703a);var _0x4fa9fc=!![];if(_0x335d17['beep']===_0x4ee2('0x12b')){_0x4fa9fc=![];}var _0x42a88d=this[_0x4ee2('0xe')][_0x4ee2('0x12c')](_0x4c1bf1,_0xf5703a,_0x335d17[_0x4ee2('0x12d')],_0x335d17['timeout'],undefined,_0x4fa9fc);if(_0x42a88d[_0x4ee2('0xa3')]!==-0x1){this['channel'][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x12e'),_0x3524eb));var _0x17c32e=this[_0x4ee2('0x90')][_0x4ee2('0xa4')](this,_0x335d17,_0x3524eb);if(_0x17c32e){for(var _0x5dfc98 in _0x17c32e){if(_0x17c32e[_0x4ee2('0x94')](_0x5dfc98)){this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')](_0x4ee2('0x12f'),_0x5dfc98[_0x4ee2('0x6a')]()),_0x17c32e[_0x5dfc98]);}}return this[_0x4ee2('0xe')]['noop'](util['format'](_0x4ee2('0x130'),JSON['stringify'](_0x17c32e)));}}return _0x42a88d;};AGIVertices['prototype'][_0x4ee2('0x131')]=function(_0x313ada){logger[_0x4ee2('0x30')](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x313ada[_0x4ee2('0xaf')]));if(!this['isConfigured'](_0x313ada[_0x4ee2('0x92')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0x132'));}if(!this[_0x4ee2('0x87')](_0x313ada['appsecret'])){return this[_0x4ee2('0xe')]['noop'](_0x4ee2('0x133'));}var _0x445e82=_0x4ee2('0x134');var _0x492c20=util[_0x4ee2('0x2b')]('%s/recordings/%s',FILES_PATH,rs[_0x4ee2('0x115')](0x4));var _0x2f7e92=util[_0x4ee2('0x2b')](_0x4ee2('0x9c'),_0x492c20,_0x445e82);var _0x141327=!![];if(_0x313ada[_0x4ee2('0x135')]==='NOBEEP'){_0x141327=![];}var _0x1a4526=this['channel']['recordFile'](_0x492c20,_0x445e82,_0x313ada[_0x4ee2('0x12d')],_0x313ada['timeout'],undefined,_0x141327);if(_0x1a4526[_0x4ee2('0xa3')]!==-0x1){this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x136'),_0x2f7e92));var _0x31a064=this['tildeASR'][_0x4ee2('0xa4')](this,_0x313ada,_0x2f7e92);if(_0x31a064){for(var _0x101a9d in _0x31a064){if(_0x31a064[_0x4ee2('0x94')](_0x101a9d)){this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')]('TILDE_ASR_%s',_0x101a9d[_0x4ee2('0x6a')]()),_0x31a064[_0x101a9d]);}}return this['channel']['noop'](util['format']('TildeASR\x20Result\x20%s',JSON[_0x4ee2('0x73')](_0x31a064)));}}return _0x1a4526;};AGIVertices['prototype'][_0x4ee2('0x137')]=function(_0x38ef9e){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x38ef9e[_0x4ee2('0xaf')]));return this[_0x4ee2('0xe')][_0x4ee2('0x138')](_0x38ef9e[_0x4ee2('0x3d')],_0x38ef9e[_0x4ee2('0x139')],_0x38ef9e['priority']);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x13a')]=function(_0x56c86f){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x13b'),_0x56c86f[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x56c86f[_0x4ee2('0x13c')])){return this[_0x4ee2('0xe')]['error'](_0x56c86f,_0x4ee2('0x13d'));}try{var _0x20c34f=eval(_0x56c86f[_0x4ee2('0x13c')])?'true':_0x4ee2('0x13e');this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x13f'),_0x56c86f['condition'],_0x20c34f));return{'code':0xc8,'result':_0x20c34f};}catch(_0x42a05b){return{'code':0xc8,'result':_0x4ee2('0x13e')};}};AGIVertices[_0x4ee2('0xf')]['gotoiftime']=function(_0xadb353){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x140'),_0xadb353['label']));if(!this[_0x4ee2('0x87')](_0xadb353[_0x4ee2('0x141')])){return this[_0x4ee2('0xe')]['error'](_0xadb353,_0x4ee2('0x142'));}var _0x14bde4=this['getIntervals'][_0x4ee2('0xa4')](this,_0xadb353['interval_id']);if(!_0x14bde4){return this['channel'][_0x4ee2('0x2e')](_0xadb353,_0x4ee2('0x143'));}for(var _0x112be6=0x0;_0x112be6<_0x14bde4['length'];_0x112be6+=0x1){var _0x1cd850=this['channel'][_0x4ee2('0x10')](util[_0x4ee2('0x2b')](_0x4ee2('0x144'),_0x14bde4[_0x112be6]));if(_0x1cd850[_0x4ee2('0xa3')]===-0x1){return _0x1cd850;}logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x145'),_0x14bde4[_0x112be6],_0x1cd850['extra']));if(_0x1cd850[_0x4ee2('0xa1')]===_0x4ee2('0x146')){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x145'),_0x14bde4[_0x112be6],_0x4ee2('0x146')));this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x145'),_0x14bde4[_0x112be6],_0x4ee2('0x146')));return{'code':0xc8,'result':_0x4ee2('0x146')};}else{logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x145'),_0x14bde4[_0x112be6],_0x4ee2('0x13e')));this['channel'][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x145'),_0x14bde4[_0x112be6],_0x4ee2('0x13e')));}}return{'code':0xc8,'result':_0x4ee2('0x13e')};};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x147')]=function(_0x559f4d){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x148'),_0x559f4d[_0x4ee2('0xaf')]));return this[_0x4ee2('0xe')][_0x4ee2('0x147')]();};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x149')]=function(_0x1a2a1c){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x14a'),_0x1a2a1c[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x1a2a1c[_0x4ee2('0x7b')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('no\x20key\x20configured');}var _0x332569='wav';var _0x3754fd=util[_0x4ee2('0x2b')](_0x4ee2('0x12a'),FILES_PATH,rs[_0x4ee2('0x115')](0x4));var _0x4398ae=util[_0x4ee2('0x2b')](_0x4ee2('0x9c'),_0x3754fd,_0x332569);var _0x3590a3=!![];if(_0x1a2a1c[_0x4ee2('0x135')]===_0x4ee2('0x12b')){_0x3590a3=![];}var _0x46abc4=this[_0x4ee2('0xe')][_0x4ee2('0x12c')](_0x3754fd,_0x332569,_0x1a2a1c[_0x4ee2('0x12d')],_0x1a2a1c[_0x4ee2('0x65')],undefined,_0x3590a3);if(_0x46abc4[_0x4ee2('0xa3')]!==-0x1){this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('ispeech\x20%s\x20file\x20created',_0x4398ae));var _0x3c3919=this[_0x4ee2('0x85')]['sync'](this,_0x1a2a1c,_0x4398ae);if(_0x3c3919){for(var _0x20ca61 in _0x3c3919){if(_0x3c3919[_0x4ee2('0x94')](_0x20ca61)){this['channel']['setVariable'](util[_0x4ee2('0x2b')](_0x4ee2('0x14b'),_0x20ca61[_0x4ee2('0x6a')]()),_0x3c3919[_0x20ca61]);}}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x14c'),JSON['stringify'](_0x3c3919)));}}return _0x46abc4;};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x14d')]=function(_0x5160ac){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x14e'),_0x5160ac[_0x4ee2('0xaf')]));if(!this['isConfigured'](_0x5160ac['key'])){return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0xea'));}if(!this[_0x4ee2('0x87')](_0x5160ac[_0x4ee2('0x5a')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('Trying\x20ispeech\x20TTS\x20%s',_0x5160ac['text']));var _0x1efa58=this[_0x4ee2('0x82')][_0x4ee2('0xa4')](this,_0x5160ac);if(_0x1efa58){this[_0x4ee2('0xe')]['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x1efa58));var _0x20fc98=this['channel'][_0x4ee2('0x14f')](_0x1efa58,_0x5160ac['intKey']);try{fs[_0x4ee2('0x103')](_0x1efa58+_0x4ee2('0x104'));}catch(_0x51dafc){logger['error'](_0x51dafc);}return _0x20fc98;}return this['channel'][_0x4ee2('0x2e')](_0x5160ac,_0x4ee2('0x150'));};AGIVertices['prototype'][_0x4ee2('0x151')]=function(_0x3b2a37){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x152'),_0x3b2a37[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x3b2a37[_0x4ee2('0x153')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x3b2a37,_0x4ee2('0x154'));}logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x155'),this[_0x4ee2('0xe')]['callerid'],_0x3b2a37[_0x4ee2('0x153')]));var _0x28644d=this[_0x4ee2('0x52')][_0x4ee2('0xa4')](this,_0x3b2a37['findBy']);if(_0x28644d){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x156'),this['channel']['callerid'],_0x3b2a37[_0x4ee2('0x153')]));this['channel']['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x156'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3b2a37[_0x4ee2('0x153')]));return{'code':0xc8,'result':_0x4ee2('0x157')};}else{logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x158'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3b2a37[_0x4ee2('0x153')]));this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3b2a37[_0x4ee2('0x153')]));return{'code':0xc8,'result':_0x4ee2('0x159')};}};AGIVertices[_0x4ee2('0xf')]['logout']=function(_0x43752a){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x15a'),_0x43752a[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x43752a[_0x4ee2('0x153')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x43752a,_0x4ee2('0x154'));}logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x155'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x43752a['findBy']));var _0x10acd8=this[_0x4ee2('0x51')]['sync'](this,_0x43752a['findBy']);if(_0x10acd8){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x43752a[_0x4ee2('0x153')]));this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format'](_0x4ee2('0x156'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x43752a[_0x4ee2('0x153')]));return{'code':0xc8,'result':_0x4ee2('0x157')};}else{logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x158'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x43752a['findBy']));this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x158'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x43752a['findBy']));return{'code':0xc8,'result':_0x4ee2('0x159')};}};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x15b')]=function(_0x524842){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x15c'),_0x524842[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x524842[_0x4ee2('0x15d')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x524842,'no\x20operation\x20configured');}this['channel'][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x15e'),_0x524842['operation']));var _0x1c9f09=eval(_0x524842['operation']);if(!this[_0x4ee2('0x87')](_0x524842['variable_id'])){return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0xdb'));}var _0x319a61=this[_0x4ee2('0x10')][_0x4ee2('0xa4')](this,_0x524842['variable_id']);if(!_0x319a61){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x524842,_0x4ee2('0xdc'));}if(_['isArray'](_0x1c9f09)){var _0x109bf1=this;_0x1c9f09[_0x4ee2('0xde')](function(_0x23eaaf,_0x117d13){_0x109bf1['channel'][_0x4ee2('0x9d')](util['format']('%s[%s]',_0x319a61,_0x117d13),_0x23eaaf);});return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format']('variable\x20%s[key]\x20set',_0x319a61));}else{return this[_0x4ee2('0xe')]['setVariable'](_0x319a61,_0x1c9f09);}};AGIVertices['prototype'][_0x4ee2('0xb')]=function(_0x580f07){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x15f'),_0x580f07[_0x4ee2('0xaf')]));if(_0x580f07[_0x4ee2('0xa5')]===0x0){return this[_0x4ee2('0xa6')](_0x580f07);}_0x580f07[_0x4ee2('0xa5')]-=0x1;if(!this[_0x4ee2('0x87')](_0x580f07['file_id'])){return this[_0x4ee2('0xe')]['error'](_0x580f07,_0x4ee2('0x10f'));}var _0x1d49c0=this[_0x4ee2('0x160')][_0x4ee2('0xa4')](this,_0x580f07[_0x4ee2('0x161')]);if(!_0x1d49c0){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x580f07,_0x4ee2('0x110'));}var _0x3ed628=this[_0x4ee2('0xe')][_0x4ee2('0x162')](_0x1d49c0,_0x580f07['response'],_0x580f07[_0x4ee2('0x163')]);var _0x299950=_0x3ed628['result'];if(_0x3ed628[_0x4ee2('0xa3')]===-0x1){this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x580f07,'-1');return _0x3ed628;}else if(_0x3ed628['extra']===_0x4ee2('0x65')){_0x3ed628[_0x4ee2('0xa3')]=_0x3ed628[_0x4ee2('0xa3')][_0x4ee2('0x9e')]>0x0?_0x3ed628[_0x4ee2('0xa3')]:'t';}else if(_[_0x4ee2('0x41')](_0x3ed628['result'])){_0x3ed628[_0x4ee2('0xa3')]='#';_0x299950='#';}if(!this[_0x4ee2('0x87')](_0x580f07[_0x4ee2('0xda')])){this[_0x4ee2('0xe')]['noop'](_0x4ee2('0xdb'));}else{var _0x245262=this['getVariable']['sync'](this,_0x580f07[_0x4ee2('0xda')]);if(!_0x245262){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x580f07,'no\x20variable\x20found');}this[_0x4ee2('0xe')][_0x4ee2('0x9d')](_0x245262,_0x299950);}this[_0x4ee2('0x36')]['sync'](this,_0x580f07,_0x299950);return _0x3ed628;};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xa9')]=function(_0x581056){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x164'),_0x581056[_0x4ee2('0xaf')]));return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x581056['output']||_0x581056[_0x4ee2('0xaf')]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x165')]=function(_0x298aaa){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x166'),_0x298aaa['label']));if(!this[_0x4ee2('0x87')](_0x298aaa[_0x4ee2('0x153')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x298aaa,_0x4ee2('0x154'));}logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x155'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x298aaa[_0x4ee2('0x153')]));var _0x562e33=this['getPause'][_0x4ee2('0xa4')](this,_0x298aaa['pause_id']);var _0x138af2=this[_0x4ee2('0x4e')][_0x4ee2('0xa4')](this,_0x298aaa[_0x4ee2('0x153')],_0x562e33);if(_0x138af2){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x156'),this['channel'][_0x4ee2('0x3a')],_0x298aaa['findBy']));this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x156'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x298aaa['findBy']));return{'code':0xc8,'result':_0x4ee2('0x157')};}else{logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x158'),this['channel'][_0x4ee2('0x3a')],_0x298aaa[_0x4ee2('0x153')]));this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x298aaa[_0x4ee2('0x153')]));return{'code':0xc8,'result':_0x4ee2('0x159')};}};AGIVertices[_0x4ee2('0xf')]['playback']=function(_0x589456){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x589456['label']));if(!this[_0x4ee2('0x87')](_0x589456['file_id'])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x589456,_0x4ee2('0x10f'));}var _0x5c5bda=this[_0x4ee2('0x160')][_0x4ee2('0xa4')](this,_0x589456[_0x4ee2('0x161')]);if(!_0x5c5bda){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x589456,_0x4ee2('0x110'));}var _0x19c6ef=this[_0x4ee2('0xe')][_0x4ee2('0xab')](_0x4ee2('0x167'),[_0x5c5bda,_0x589456['opts']]);if(_0x19c6ef['result']===-0x1){return _0x19c6ef;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0xc6'),'PLAYBACK',_0x5c5bda));};AGIVertices[_0x4ee2('0xf')]['queue']=function(_0x198064){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x168'),_0x198064['label']));if(!this[_0x4ee2('0x87')](_0x198064[_0x4ee2('0x169')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x198064,_0x4ee2('0x16a'));}var _0x4da265='';var _0x24a1fe=parseInt(_0x198064[_0x4ee2('0x169')],0xa);if(isNaN(_0x24a1fe)){_0x4da265=_0x198064[_0x4ee2('0x169')];}else{_0x4da265=this[_0x4ee2('0x15')][_0x4ee2('0xa4')](this,_0x198064['queue_id']);if(!_0x4da265){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x198064,'no\x20queue\x20found');}}var _0x3e9b76='';if(this[_0x4ee2('0x87')](_0x198064[_0x4ee2('0x161')])){var _0x363607=this[_0x4ee2('0x160')][_0x4ee2('0xa4')](this,_0x198064[_0x4ee2('0x161')]);if(_0x363607){_0x3e9b76=_0x363607;}}this['createSquareDetailsReport'][_0x4ee2('0xa4')](this,_0x198064,_0x4da265);if(_0x198064[_0x4ee2('0x16b')]['indexOf']('x')<0x0){_0x198064[_0x4ee2('0x16b')]+='x';}if(_0x198064[_0x4ee2('0x16b')][_0x4ee2('0x16c')]('X')<0x0){_0x198064[_0x4ee2('0x16b')]+='X';}this[_0x4ee2('0xe')][_0x4ee2('0x9d')]('XMCS-QUEUE',_0x4da265?_0x4da265['toLowerCase']():'');var _0x184438=this[_0x4ee2('0xe')][_0x4ee2('0xab')]('QUEUE',[_0x4da265,_0x198064[_0x4ee2('0x16b')],_0x198064[_0x4ee2('0x63')],_0x3e9b76,_0x198064['timeout'],_0x198064[_0x4ee2('0x6')],_0x198064[_0x4ee2('0x16d')],_0x198064[_0x4ee2('0x16e')],'',_0x198064[_0x4ee2('0x16f')]]);if(_0x184438['result']===-0x1){return _0x184438;}return this[_0x4ee2('0xe')]['noop'](util['format'](_0x4ee2('0xc6'),_0x4ee2('0x170'),_0x4da265));};AGIVertices['prototype']['record']=function(_0x27eb42){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x171'),_0x27eb42[_0x4ee2('0xaf')]));var _0x4cf900=_0x27eb42[_0x4ee2('0x172')]||_0x4ee2('0x134');var _0x746a4a=util[_0x4ee2('0x2b')](_0x4ee2('0x173'),this[_0x4ee2('0xe')][_0x4ee2('0x37')],rs['generate'](0x5));var _0x31efde=util[_0x4ee2('0x2b')](_0x4ee2('0x174'),FILES_PATH,_0x746a4a,_0x4cf900);var _0xe725c6=util[_0x4ee2('0x2b')](_0x4ee2('0x12a'),FILES_PATH,_0x746a4a);this['createSquareRecording'][_0x4ee2('0xa4')](this,_0x27eb42,_0x746a4a,_0x31efde);this[_0x4ee2('0xe')]['setVariable']('RECORDING_SAVENAME',_0x746a4a);logger['info'](_0x4ee2('0x175'),_0xe725c6,_0x4cf900,_0x27eb42['escape_digits'],_0x27eb42[_0x4ee2('0x65')]);return this[_0x4ee2('0xe')][_0x4ee2('0x12c')](_0xe725c6,_0x4cf900,_0x27eb42['escape_digits'],_0x27eb42[_0x4ee2('0x65')],undefined,!![]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x176')]=function(_0x244905){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x177'),_0x244905[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x244905[_0x4ee2('0x63')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0x178'));}var _0x185842=this[_0x4ee2('0x62')][_0x4ee2('0xa4')](this,_0x244905);logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Response:',util[_0x4ee2('0x179')](_0x185842,{'showHidden':![],'depth':null})));if(!this[_0x4ee2('0x87')](_0x244905[_0x4ee2('0xda')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x42338b=this['getVariable'][_0x4ee2('0xa4')](this,_0x244905[_0x4ee2('0xda')]);if(!_0x42338b){return this[_0x4ee2('0xe')]['error'](_0x244905,_0x4ee2('0xdc'));}this[_0x4ee2('0xe')]['setVariable'](util[_0x4ee2('0x2b')](_0x4ee2('0x17a'),_0x42338b),_0x185842[_0x4ee2('0x75')]?_0x185842['statusCode']:_0x4ee2('0x17b'));this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')](_0x4ee2('0x17c'),_0x42338b),_0x185842[_0x4ee2('0x76')]?_0x185842[_0x4ee2('0x76')]:'OK');if(_0x185842[_0x4ee2('0x6b')]){try{this[_0x4ee2('0x9b')](_0x185842[_0x4ee2('0x6b')],_0x42338b);}catch(_0x5b2bfb){logger[_0x4ee2('0x2e')](util['format'](_0x4ee2('0x17d'),_0x42338b));}}return this['channel']['noop'](util['format'](_0x4ee2('0xe1'),_0x42338b));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x17e')]=function(_0x336ee4){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x17f'),_0x336ee4['label']));return this[_0x4ee2('0xe')][_0x4ee2('0x180')](_0x336ee4['digits'][_0x4ee2('0x56')](/\s+/g,''),_0x336ee4[_0x4ee2('0x181')]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x182')]=function(_0x228f9a){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x183'),_0x228f9a[_0x4ee2('0xaf')]));return this['channel'][_0x4ee2('0x184')](_0x228f9a['number'][_0x4ee2('0x56')](/\s+/g,''),_0x228f9a[_0x4ee2('0x181')]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x185')]=function(_0x5ece2c){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x186'),_0x5ece2c[_0x4ee2('0xaf')]));return this[_0x4ee2('0xe')][_0x4ee2('0x187')](_0x5ece2c['text'],_0x5ece2c[_0x4ee2('0x181')]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x188')]=function(_0x113a02){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x189'),_0x113a02['label']));if(!this[_0x4ee2('0x87')](_0x113a02[_0x4ee2('0x18a')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0x18b'));}var _0x35a380=this[_0x4ee2('0x20')]['sync'](this,_0x113a02[_0x4ee2('0x18a')]);if(!_0x35a380||!_0x35a380[_0x4ee2('0x18c')]){return this['channel'][_0x4ee2('0x2e')](_0x113a02,_0x4ee2('0x18d'));}var _0x438c53={'from':util[_0x4ee2('0x2b')](_0x4ee2('0x18e'),_0x35a380[_0x4ee2('0x13')],_0x35a380[_0x4ee2('0x18f')]||_0x35a380[_0x4ee2('0x18c')][_0x4ee2('0x190')]),'to':_0x113a02['to']||'','cc':_0x113a02['cc']||'','bcc':_0x113a02['bcc']||'','subject':_0x113a02[_0x4ee2('0x191')],'html':_0x113a02[_0x4ee2('0x5a')],'text':_0x113a02[_0x4ee2('0x5a')]};if(this['isConfigured'](_0x113a02[_0x4ee2('0x192')])){}logger[_0x4ee2('0xe3')](_0x4ee2('0x193'),JSON[_0x4ee2('0x73')](_0x438c53));this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x113a02,_0x113a02['account_id']);this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x194'),_0x35a380['name']));this[_0x4ee2('0x22')][_0x4ee2('0xa4')](this,_0x35a380[_0x4ee2('0x195')],_0x438c53);return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0x196'));};AGIVertices['prototype'][_0x4ee2('0x197')]=function(_0x371d56){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x198'),_0x371d56[_0x4ee2('0xaf')]));return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0x199'));};AGIVertices['prototype'][_0x4ee2('0x19a')]=function(_0x3029ea){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x19b'),_0x3029ea[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x3029ea['sms_account_id'])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0x19c'));}var _0x235095=this[_0x4ee2('0x19d')][_0x4ee2('0xa4')](this,_0x3029ea['sms_account_id']);if(!_0x235095){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x3029ea,_0x4ee2('0x19e'));}var _0x2fcaf2={'body':_0x3029ea[_0x4ee2('0x19f')],'phone':_0x3029ea['to']||'','SmsAccountId':_0x235095['id']};logger[_0x4ee2('0xe3')](_0x4ee2('0x1a0'),JSON[_0x4ee2('0x73')](_0x2fcaf2));this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x3029ea,_0x3029ea['sms_account_id']);this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x1a1'),_0x235095[_0x4ee2('0x13')]));this[_0x4ee2('0x35')][_0x4ee2('0xa4')](this,_0x2fcaf2);return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0x1a2'));};AGIVertices['prototype'][_0x4ee2('0x1a3')]=function(_0x27ecf2){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x1a4'),_0x27ecf2[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x27ecf2[_0x4ee2('0xda')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x27ecf2,_0x4ee2('0x1a5'));}var _0x26238e=this[_0x4ee2('0x10')][_0x4ee2('0xa4')](this,_0x27ecf2[_0x4ee2('0xda')]);if(!_0x26238e){return this['channel'][_0x4ee2('0x2e')](_0x27ecf2,_0x4ee2('0xdc'));}return this['channel'][_0x4ee2('0x9d')](_0x26238e,_0x27ecf2[_0x4ee2('0x1a6')]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1a7')]=function(_0x570c6e){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x1a8'),_0x570c6e[_0x4ee2('0xaf')]));this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('START\x20CALLY\x20SQUARE');var _0x14649=this[_0x4ee2('0xe')]['getVariable'](_0x4ee2('0x1a9'));if(!_[_0x4ee2('0x41')](_0x14649[_0x4ee2('0xa1')])){this[_0x4ee2('0xe')][_0x4ee2('0x37')]=_0x14649['extra'];}if(_0x570c6e[_0x4ee2('0xbc')]===_0x4ee2('0x1aa')){this['channel'][_0x4ee2('0xa9')](_0x4ee2('0x1ab'));return this[_0x4ee2('0xe')][_0x4ee2('0xbc')]();}return this['channel'][_0x4ee2('0xa9')]('Skipped\x20Answer');};AGIVertices['prototype'][_0x4ee2('0x1ac')]=function(_0x5b64f5){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x1ad'),_0x5b64f5[_0x4ee2('0xaf')]));if(!this['isConfigured'](_0x5b64f5[_0x4ee2('0x1ae')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x5b64f5,_0x4ee2('0x1af'));}var _0xd5e928=this['getSquareProject'][_0x4ee2('0xa4')](this,_0x5b64f5[_0x4ee2('0x1ae')]);if(!this['isConfigured'](_0xd5e928)){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x5b64f5,util[_0x4ee2('0x2b')](_0x4ee2('0x1b0'),_0x5b64f5['project_id']));}if(_0xd5e928===this[_0x4ee2('0xe')][_0x4ee2('0x39')]){return this['channel'][_0x4ee2('0x2e')](_0x5b64f5,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x5b64f5,_0xd5e928);var _0x5afcbf=this['channel'][_0x4ee2('0xab')](_0x4ee2('0x1b1'),util[_0x4ee2('0x2b')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x4ee2('0x1b2')]||_0x4ee2('0x1b3'),_0xd5e928,this['channel']['arg_1']));if(_0x5afcbf[_0x4ee2('0xa3')]===-0x1){return _0x5afcbf;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('Executed\x20command\x20%s\x20%s','AGI',_0xd5e928));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1b4')]=function(_0x1a087b){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x1b5'),_0x1a087b[_0x4ee2('0xaf')]));var _0x595ad=this['shellCommand'][_0x4ee2('0xa4')](this,_0x1a087b[_0x4ee2('0xba')]);this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x1a087b,_0x1a087b[_0x4ee2('0xba')]);if(this['isConfigured'](_0x1a087b['variable_id'])){var _0x30716d=this[_0x4ee2('0x10')][_0x4ee2('0xa4')](this,_0x1a087b[_0x4ee2('0xda')]);if(_0x30716d){this['channel']['setVariable'](_0x30716d,_0x595ad);return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x1b6'),_0x1a087b['command'],_0x30716d));}}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format'](_0x4ee2('0x1b7'),_0x1a087b[_0x4ee2('0xba')]));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1b8')]=function(_0x252ba9){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x1b9'),_0x252ba9[_0x4ee2('0xaf')]));_0x252ba9[_0x4ee2('0x5a')]=_0x252ba9[_0x4ee2('0x5a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x252ba9['apiKey'])){return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0x1ba'));}if(!this[_0x4ee2('0x87')](_0x252ba9[_0x4ee2('0x5a')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x252ba9['text']));var _0x48ad6e=this[_0x4ee2('0x57')][_0x4ee2('0xa4')](this,_0x252ba9);if(_0x48ad6e){this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x48ad6e));var _0x23968e=this[_0x4ee2('0xe')][_0x4ee2('0x14f')](_0x48ad6e);try{fs[_0x4ee2('0x103')](_0x48ad6e+_0x4ee2('0x104'));}catch(_0x9be314){logger[_0x4ee2('0x2e')](_0x9be314);}return _0x23968e;}return this['channel']['error'](_0x252ba9,_0x4ee2('0x1bb'));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1bc')]=function(_0x132681){logger['info'](util['format'](_0x4ee2('0x1bd'),_0x132681[_0x4ee2('0xaf')]));_0x132681['text']=_0x132681['text'][_0x4ee2('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x132681[_0x4ee2('0x5a')])){return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}this['channel'][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x1be'),_0x132681[_0x4ee2('0x5a')]));var _0x1c09da=this['googleTTS'][_0x4ee2('0xa4')](this,_0x132681);if(_0x1c09da){this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format'](_0x4ee2('0x1bf'),_0x1c09da));var _0x977acb=this[_0x4ee2('0xe')][_0x4ee2('0x14f')](_0x1c09da);try{fs[_0x4ee2('0x103')](_0x1c09da+'.wav');}catch(_0x5cf9e5){logger[_0x4ee2('0x2e')](_0x5cf9e5);}return _0x977acb;}return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x132681,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['unpause']=function(_0x3556a1){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x1c0'),_0x3556a1[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x3556a1[_0x4ee2('0x153')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x3556a1,_0x4ee2('0x154'));}logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x155'),this['channel']['callerid'],_0x3556a1[_0x4ee2('0x153')]));var _0x46c409=this[_0x4ee2('0x50')][_0x4ee2('0xa4')](this,_0x3556a1[_0x4ee2('0x153')]);if(_0x46c409){logger['info'](util[_0x4ee2('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3556a1[_0x4ee2('0x153')]));this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3556a1[_0x4ee2('0x153')]));return{'code':0xc8,'result':_0x4ee2('0x157')};}else{logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x158'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3556a1[_0x4ee2('0x153')]));this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x158'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3556a1[_0x4ee2('0x153')]));return{'code':0xc8,'result':_0x4ee2('0x159')};}};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1c1')]=function(_0x7910a8){logger[_0x4ee2('0x30')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x7910a8[_0x4ee2('0xaf')]));var _0x400f2b=this[_0x4ee2('0xe')]['exec']('VOICEMAIL',[_0x7910a8[_0x4ee2('0x1c2')],_0x7910a8[_0x4ee2('0x79')]]);if(_0x400f2b['result']===-0x1){return _0x400f2b;}return this['channel'][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x7910a8[_0x4ee2('0x1c2')]));};AGIVertices['prototype'][_0x4ee2('0x1c3')]=function(_0x12a744){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x1c4'),_0x12a744['label']));if(!this[_0x4ee2('0x87')](_0x12a744[_0x4ee2('0xda')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x12a744,_0x4ee2('0x1a5'));}var _0x53bd04=this[_0x4ee2('0x10')][_0x4ee2('0xa4')](this,_0x12a744[_0x4ee2('0xda')]);if(!_0x53bd04){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x12a744,_0x4ee2('0xdc'));}var _0x5117d6=this[_0x4ee2('0xe')][_0x4ee2('0x10')](_0x53bd04);return{'code':0xc8,'result':_0x5117d6[_0x4ee2('0xa1')]?_0x5117d6[_0x4ee2('0xa1')]:'-'};};String[_0x4ee2('0xf')]['replaceAll']=function(_0x38617d,_0x2f11ff){return this['split'](_0x38617d)[_0x4ee2('0x1c5')](_0x2f11ff);};module['exports']=AGIVertices; \ No newline at end of file +var _0x01fe=['Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','getSquareOdbc','odbc_id','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','dialogflow','bot','speech','out','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','toUpperCase','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','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','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','file_id','no\x20file\x20audio\x20selected','getSound','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','awsPolly','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','intKey','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','priority','gotoif','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','false','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','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','Enter\x20in\x20MATH\x20(%s)\x20block','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','recordingFormat','%s_%s','%s/recordings/%s.%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','sendMail\x20message','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','project_id','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','no\x20variable\x20selected','join','exports','util','shelljs','odbc','mustache','request-promise','../../config/logger','agi','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','label','agicommand','callerid','createSquareRecording','uniqueid','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','PUT','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','key','model','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','hasOwnProperty','%s.%s','saveRestApiResult','setVariable','replaceObjectAllVariables','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','isConfigured','maxRetry','retry','noop','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application'];(function(_0x136367,_0x22104c){var _0x475ecc=function(_0x55b370){while(--_0x55b370){_0x136367['push'](_0x136367['shift']());}};_0x475ecc(++_0x22104c);}(_0x01fe,0x102));var _0xe01f=function(_0x4ca55b,_0x2f937a){_0x4ca55b=_0x4ca55b-0x0;var _0x30c067=_0x01fe[_0x4ca55b];return _0x30c067;};'use strict';var fs=require('fs');var util=require(_0xe01f('0x0'));var _=require('lodash');var sh=require(_0xe01f('0x1'));var odbc=require(_0xe01f('0x2'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0xe01f('0x3'));var rp=require(_0xe01f('0x4'));var logger=require(_0xe01f('0x5'))(_0xe01f('0x6'));var config=require('../../config/environment');var scripts=require(_0xe01f('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xe01f('0x8'),_0xe01f('0x9')];var verticesWithRetry=[_0xe01f('0xa'),_0xe01f('0xb'),_0xe01f('0xc')];var AGIVertices=function(_0x4d1775,_0x3cccd7,_0x129e5a){this['channel']=_0x4d1775;this[_0xe01f('0xd')]=_0x3cccd7;this['mailRpc']=_0x129e5a;};AGIVertices[_0xe01f('0xe')][_0xe01f('0xf')]=function(_0x53577d,_0x2525ae){this['rpc'][_0xe01f('0x10')](_0x53577d)[_0xe01f('0x11')](function(_0x1b7292){_0x2525ae(null,_0x1b7292?_0x1b7292[_0xe01f('0x12')]:![]);})[_0xe01f('0x13')](function(_0x94e3d8){_0x2525ae(_0x94e3d8);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x14')]=function(_0x52c2f0,_0x313bb5){this[_0xe01f('0xd')][_0xe01f('0x15')](_0x52c2f0)[_0xe01f('0x11')](function(_0x4e98b9){_0x313bb5(null,_0x4e98b9?_0x4e98b9[_0xe01f('0x12')]:![]);})[_0xe01f('0x13')](function(_0x5e5e30){_0x313bb5(_0x5e5e30);});};AGIVertices['prototype']['getSquareProject']=function(_0x12540b,_0x14b05d){this[_0xe01f('0xd')][_0xe01f('0x16')](_0x12540b)[_0xe01f('0x11')](function(_0x3fad9a){_0x14b05d(null,_0x3fad9a?_0x3fad9a[_0xe01f('0x12')]:![]);})[_0xe01f('0x13')](function(_0x9ee4b5){_0x14b05d(_0x9ee4b5);});};AGIVertices[_0xe01f('0xe')]['getSquareOdbc']=function(_0x23e52a,_0x5ca305){this[_0xe01f('0xd')][_0xe01f('0x17')](_0x23e52a)[_0xe01f('0x11')](function(_0x3d5f9c){_0x5ca305(null,_0x3d5f9c?_0x3d5f9c['dsn']:![]);})[_0xe01f('0x13')](function(_0xb9343e){_0x5ca305(_0xb9343e);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x18')]=function(_0x369b7e,_0x3c34fa){this['rpc'][_0xe01f('0x19')](_0x369b7e)[_0xe01f('0x11')](function(_0x23df45){_0x3c34fa(null,_0x23df45?_0x23df45[_0xe01f('0x12')]:![]);})[_0xe01f('0x13')](function(_0x38efcc){_0x3c34fa(_0x38efcc);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x1a')]=function(_0x11708c,_0x4b44b6){this['rpc'][_0xe01f('0x1b')](_0x11708c)[_0xe01f('0x11')](function(_0x3f92ca){_0x4b44b6(null,_0x3f92ca?_0x3f92ca[_0xe01f('0x12')]:![]);})['catch'](function(_0x2be3d2){_0x4b44b6(_0x2be3d2);});};AGIVertices[_0xe01f('0xe')]['getSound']=function(_0x378c93,_0x5b9c5e){var _0x1b77c8=this;this[_0xe01f('0xd')][_0xe01f('0x1c')](_0x378c93)['then'](function(_0x940cb6){_0x5b9c5e(null,_0x940cb6?_0x1b77c8['getSoundPath'](_0x940cb6[_0xe01f('0x1d')]):![]);})[_0xe01f('0x13')](function(_0x2e4568){_0x5b9c5e(_0x2e4568);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x1e')]=function(_0x349348,_0x11386e){this[_0xe01f('0xd')][_0xe01f('0x1f')](_0x349348)['then'](function(_0x3f725a){_0x11386e(null,_0x3f725a?_0x3f725a:![]);})['catch'](function(_0x3736fd){_0x11386e(_0x3736fd);});};AGIVertices[_0xe01f('0xe')]['sendMailMessage']=function(_0x15f98f,_0x2aeb7e,_0x26cd7e){this['mailRpc'][_0xe01f('0x20')](_0x15f98f,_0x2aeb7e)[_0xe01f('0x11')](function(){_0x26cd7e(null);})[_0xe01f('0x13')](function(_0x1d034d){_0x26cd7e(_0x1d034d);});};AGIVertices[_0xe01f('0xe')]['getIntervals']=function(_0x57aed0,_0x5f19a6){this[_0xe01f('0xd')]['getIntervalById'](_0x57aed0)[_0xe01f('0x11')](function(_0x8af6fc){if(_0x8af6fc){if(_0x8af6fc[_0xe01f('0x21')]){_0x5f19a6(null,[_0x8af6fc[_0xe01f('0x22')]]);}else{_0x5f19a6(null,_[_0xe01f('0x23')](_0x8af6fc[_0xe01f('0x24')],_0xe01f('0x22')));}}else{_0x5f19a6(null,![]);}})[_0xe01f('0x13')](function(_0x5b7139){_0x5f19a6(_0x5b7139);});};AGIVertices['prototype'][_0xe01f('0x25')]=function(_0x25bea9){return util[_0xe01f('0x26')](_0xe01f('0x27'),FILES_PATH,_0x25bea9);};AGIVertices['prototype'][_0xe01f('0x28')]=function(_0x3530db,_0xf26288,_0x5179e4){odbc[_0xe01f('0x29')](_0x3530db,function(_0x3a48d2){if(_0x3a48d2){logger[_0xe01f('0x2a')](_0xe01f('0x2b'),_0x3a48d2);_0x5179e4(_0x3a48d2);}else{logger[_0xe01f('0x2c')](_0xe01f('0x2d'));odbc[_0xe01f('0x2e')](_0xf26288,function(_0x2b102c,_0x29c47f){if(_0x2b102c){logger[_0xe01f('0x2c')](_0xe01f('0x2f'),_0xf26288);_0x5179e4(_0x2b102c);}else{logger[_0xe01f('0x2c')](_0xe01f('0x30'),_0xf26288);odbc[_0xe01f('0x31')](function(_0x16ab3c){if(_0x16ab3c){logger['error'](_0xe01f('0x32'),_0x16ab3c);}_0x5179e4(null,_0x29c47f);});}});}});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x33')]=function(_0xbe9034,_0x495b74){this[_0xe01f('0xd')][_0xe01f('0x34')](_0xbe9034)[_0xe01f('0x11')](function(_0x1e3f02){_0x495b74(null,_0x1e3f02?_0x1e3f02:![]);})[_0xe01f('0x13')](function(_0x31dc11){_0x495b74(_0x31dc11);});};AGIVertices['prototype'][_0xe01f('0x35')]=function(_0x3f5a1e,_0x45be6c){this[_0xe01f('0xd')][_0xe01f('0x35')](_0x3f5a1e)[_0xe01f('0x11')](function(_0x861971){_0x45be6c(null,_0x861971);})[_0xe01f('0x13')](function(_0x15e82f){_0x45be6c(_0x15e82f);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x3dd453,_0x50b47,_0x5c8a92){this[_0xe01f('0xd')][_0xe01f('0x36')]({'uniqueid':this[_0xe01f('0x37')]['uniqueid'],'node':_0x3dd453[_0xe01f('0x38')],'application':_0x3dd453[_0xe01f('0x39')],'data':_0x50b47||null,'project_name':this['channel']['arg_1'],'callerid':this['channel'][_0xe01f('0x3a')]})['then'](function(_0x19d4ec){if(_0x5c8a92){_0x5c8a92(null,_0x19d4ec);}})['catch'](function(_0x196a1d){if(_0x5c8a92){_0x5c8a92(_0x196a1d);}});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x3b')]=function(_0x233d83,_0x310d75,_0x398573,_0x29954d){this[_0xe01f('0xd')][_0xe01f('0x3b')]({'uniqueid':this[_0xe01f('0x37')][_0xe01f('0x3c')],'callerid':this['channel'][_0xe01f('0x3a')],'calleridname':this[_0xe01f('0x37')][_0xe01f('0x3d')],'context':this[_0xe01f('0x37')][_0xe01f('0x3e')],'extension':this['channel'][_0xe01f('0x3f')],'priority':this['channel']['priority'],'accountcode':this[_0xe01f('0x37')][_0xe01f('0x40')],'dnid':this[_0xe01f('0x37')][_0xe01f('0x41')],'projectName':this[_0xe01f('0x37')]['arg_1'],'saveName':_0x310d75,'filename':_0x233d83[_0xe01f('0x42')]||_0x310d75,'savePath':_0x398573})[_0xe01f('0x11')](function(_0x3bb3b7){_0x29954d(null,_0x3bb3b7);})[_0xe01f('0x13')](function(_0xc5b0c4){_0x29954d(_0xc5b0c4);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x43')]=function(_0x5a511c,_0x3f4ae0,_0x51e5c6,_0x17580b,_0x204464){this['rpc'][_0xe01f('0x43')]({'uniqueid':this[_0xe01f('0x37')][_0xe01f('0x3c')],'body':_0x5a511c,'direction':_0x3f4ae0,'providerName':_0x51e5c6,'providerResponse':_0x17580b})[_0xe01f('0x11')](function(_0x2577cb){if(_0x204464){_0x204464(null,_0x2577cb);}})[_0xe01f('0x13')](function(_0x5b04b5){if(_0x204464){_0x204464(_0x5b04b5);}});};AGIVertices['prototype'][_0xe01f('0x44')]=function(_0x216f69,_0x516747){this[_0xe01f('0xd')][_0xe01f('0x44')]({'firstName':_[_0xe01f('0x45')](_0x216f69[_0xe01f('0x12')])||_[_0xe01f('0x46')](_0x216f69[_0xe01f('0x12')])?'callback_'+Math[_0xe01f('0x47')]():_0x216f69[_0xe01f('0x12')],'lastName':_['isEmpty'](_0x216f69[_0xe01f('0x48')])||_[_0xe01f('0x46')](_0x216f69[_0xe01f('0x48')])?null:_0x216f69[_0xe01f('0x48')],'phone':_0x216f69[_0xe01f('0x49')],'ListId':_0x216f69[_0xe01f('0x4a')],'scheduledat':_0x216f69['scheduledAt'],'callbackUniqueid':this[_0xe01f('0x37')]['uniqueid'],'tags':'callback','description':_0xe01f('0x4b')+_0x216f69[_0xe01f('0x4c')][_0xe01f('0x4d')](),'priority':_0x216f69[_0xe01f('0x4e')]})[_0xe01f('0x11')](function(_0x3b0ab1){_0x516747(null,_0x3b0ab1);})[_0xe01f('0x13')](function(_0x5b7672){_0x516747(_0x5b7672);});};AGIVertices['prototype']['getPause']=function(_0x24c60c,_0x54f01a){this[_0xe01f('0xd')][_0xe01f('0x4f')](_0x24c60c)[_0xe01f('0x11')](function(_0x33a11b){_0x54f01a(null,_0x33a11b?_0x33a11b[_0xe01f('0x12')]:![]);})['catch'](function(_0x2c0b36){_0x54f01a(_0x2c0b36);});};AGIVertices[_0xe01f('0xe')]['agentPause']=function(_0x3bda53,_0x4dd65c,_0xfb20c6){var _0x5d9683={'role':_0xe01f('0x50')};_0x5d9683[_0x3bda53]=this[_0xe01f('0x37')][_0xe01f('0x3a')];this[_0xe01f('0xd')][_0xe01f('0x51')](_0x5d9683,_0x4dd65c,this[_0xe01f('0x37')][_0xe01f('0x3c')])[_0xe01f('0x11')](function(_0x5d51e5){_0xfb20c6(null,_[_0xe01f('0x46')](_0x5d51e5)?![]:!![]);})[_0xe01f('0x13')](function(_0x4ca90a){logger[_0xe01f('0x2a')](_0x4ca90a);_0xfb20c6(null,![]);});};AGIVertices['prototype'][_0xe01f('0x52')]=function(_0x428b19,_0x517487){var _0x617624={'role':'agent'};_0x617624[_0x428b19]=this[_0xe01f('0x37')]['callerid'];this[_0xe01f('0xd')][_0xe01f('0x52')](_0x617624)[_0xe01f('0x11')](function(_0x316b2b){_0x517487(null,_[_0xe01f('0x46')](_0x316b2b)?![]:!![]);})[_0xe01f('0x13')](function(_0x4c79d6){logger['error'](_0x4c79d6);_0x517487(null,![]);});};AGIVertices[_0xe01f('0xe')]['agentLogout']=function(_0xa1471b,_0x4a4346){var _0x831296={'role':_0xe01f('0x50')};_0x831296[_0xa1471b]=this[_0xe01f('0x37')]['callerid'];this['rpc'][_0xe01f('0x53')](_0x831296)['then'](function(_0x493c13){_0x4a4346(null,_[_0xe01f('0x46')](_0x493c13)?![]:!![]);})[_0xe01f('0x13')](function(_0x45ecce){logger[_0xe01f('0x2a')](_0x45ecce);_0x4a4346(null,![]);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x54')]=function(_0x19b448,_0x13b790){var _0x3d03c9={'role':'agent'};_0x3d03c9[_0x19b448]=this['channel']['callerid'];var _0x47c632=_0x19b448!=_0xe01f('0x55')?util[_0xe01f('0x26')](_0xe01f('0x56'),_0xe01f('0x57'),this[_0xe01f('0x37')]['callerid']):undefined;this[_0xe01f('0xd')]['agentLogin'](_0x3d03c9,_0x47c632)[_0xe01f('0x11')](function(_0x3d7604){_0x13b790(null,_[_0xe01f('0x46')](_0x3d7604)?![]:!![]);})[_0xe01f('0x13')](function(_0x4973c8){logger['error'](_0x4973c8);_0x13b790(null,![]);});};AGIVertices[_0xe01f('0xe')]['shellCommand']=function(_0x3a5f45,_0x2a2580){sh['exec'](_[_0xe01f('0x58')](_0x3a5f45),function(_0x42d607,_0x41e175){var _0x1cd8ec=_0x41e175[_0xe01f('0x59')](/(\r\n|\n|\r)/gm,'');_0x2a2580(null,_0x1cd8ec);});};AGIVertices['prototype'][_0xe01f('0x5a')]=function(_0x1c9cbf,_0x5cd7bd){scripts[_0xe01f('0x5a')](_0x1c9cbf[_0xe01f('0x5b')],_0x1c9cbf[_0xe01f('0x5c')]||_0xe01f('0x5d'),_0x1c9cbf[_0xe01f('0x5d')],_0x1c9cbf[_0xe01f('0x5e')]||_0xe01f('0x5f'),_0x1c9cbf[_0xe01f('0x60')]||_0xe01f('0x61'),_0x1c9cbf[_0xe01f('0x62')]||_0xe01f('0x63'))[_0xe01f('0x11')](function(_0x5cfc2c){_0x5cd7bd(null,_0x5cfc2c);})[_0xe01f('0x13')](function(_0x185de4){_0x5cd7bd(_0x185de4);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x64')]=function(_0x1c4b5f,_0x495b3c){scripts[_0xe01f('0x64')](_0x1c4b5f['text'],_0x1c4b5f[_0xe01f('0x65')]||'en',0x1)[_0xe01f('0x11')](function(_0x35a7cb){_0x495b3c(null,_0x35a7cb);})['catch'](function(_0x41c0f){_0x495b3c(_0x41c0f);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x66')]=function(_0x468e7b,_0x5dfa19){var _0x42ff11={'uri':_0x468e7b[_0xe01f('0x67')],'method':_0x468e7b[_0xe01f('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x468e7b[_0xe01f('0x69')])===_0xe01f('0x6a')&&parseInt(_0x468e7b[_0xe01f('0x69')])>=0x1?parseInt(_0x468e7b['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0xe01f('0x6b'),_0xe01f('0x6c')],_0x42ff11[_0xe01f('0x68')]['toUpperCase']())){try{_0x42ff11['body']=_0x468e7b[_0xe01f('0x9')]?JSON[_0xe01f('0x6d')](_0x468e7b[_0xe01f('0x9')]):{};}catch(_0x27c50a){logger[_0xe01f('0x2a')](_0xe01f('0x6e'),_0x27c50a);}}try{_0x42ff11[_0xe01f('0x6f')]=_0x468e7b[_0xe01f('0x8')]?JSON[_0xe01f('0x6d')](_0x468e7b['rawHeaders']):{};}catch(_0x2f1975){logger[_0xe01f('0x2a')](_0xe01f('0x70'),_0x2f1975);}if(_0x468e7b[_0xe01f('0x71')]){try{var _0x1b89c3=require(_0x468e7b[_0xe01f('0x71')])[_0xe01f('0x72')](this,_0x42ff11);_0x42ff11[_0xe01f('0x73')]=Mustache[_0xe01f('0x74')](_0x468e7b[_0xe01f('0x67')],_0x1b89c3,{},['$$','$$']);if(_0x42ff11['headers']){_0x42ff11[_0xe01f('0x6f')]=JSON[_0xe01f('0x6d')](Mustache['render'](JSON[_0xe01f('0x75')](_0x42ff11[_0xe01f('0x6f')]),_0x1b89c3,{},['$$','$$']));}if(_0x42ff11['body']){_0x42ff11['body']=JSON['parse'](Mustache['render'](JSON[_0xe01f('0x75')](_0x42ff11[_0xe01f('0x76')]),_0x1b89c3,{},['$$','$$']));}}catch(_0x532171){logger[_0xe01f('0x2a')](_0xe01f('0x77'),_0x532171);}}rp(_0x42ff11)[_0xe01f('0x11')](function(_0x58ddd0){var _0x29869b={'statusCode':_0x58ddd0[_0xe01f('0x78')]||0xc8,'statusMessage':_0x58ddd0[_0xe01f('0x79')]||'OK','headers':_0x58ddd0[_0xe01f('0x6f')]||{},'body':_0x58ddd0[_0xe01f('0x76')]||{}};_0x5dfa19(null,_0x29869b);})['catch'](function(_0x256f4b){var _0x753543={'statusCode':_0x256f4b[_0xe01f('0x78')]||0x1f4,'statusMessage':_0x256f4b[_0xe01f('0x7a')]||_0xe01f('0x7b'),'headers':_0x256f4b['options'][_0xe01f('0x6f')]||{},'body':_0x256f4b[_0xe01f('0x7c')]['body']||{}};_0x5dfa19(null,_0x753543);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x7d')]=function(_0x474b52,_0xb8293e){scripts[_0xe01f('0x7d')](this[_0xe01f('0x37')][_0xe01f('0x3c')],_0x474b52['key'],_0x474b52[_0xe01f('0x5d')],_0x474b52[_0xe01f('0x7e')]||'en')[_0xe01f('0x11')](function(_0x1f07a){_0xb8293e(null,_0x1f07a);})[_0xe01f('0x13')](function(_0x408646){_0xb8293e(_0x408646);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x7f')]=function(_0x2bf66f,_0x31a040){scripts[_0xe01f('0x7f')](this[_0xe01f('0x37')][_0xe01f('0x3c')],_0x2bf66f['dialogflowV2_project_id'],_0x2bf66f['client_email'],_0x2bf66f[_0xe01f('0x80')],_0x2bf66f[_0xe01f('0x5d')],_0x2bf66f[_0xe01f('0x81')]||'en')[_0xe01f('0x11')](function(_0x119451){_0x31a040(null,_0x119451);})[_0xe01f('0x13')](function(_0x9a07c7){_0x31a040(_0x9a07c7);});};AGIVertices[_0xe01f('0xe')]['sestekNDA']=function(_0x3ae7d5,_0x52a060){scripts[_0xe01f('0x82')](this[_0xe01f('0x37')],_0x3ae7d5)[_0xe01f('0x11')](function(_0x59a2f7){_0x52a060(null,_0x59a2f7);})[_0xe01f('0x13')](function(_0x29972f){_0x52a060(_0x29972f);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x83')]=function(_0x418579,_0x4ce26b){scripts['ispeechTTS'](_0x418579['key'],_0x418579[_0xe01f('0x5d')],_0x418579[_0xe01f('0x84')]||_0xe01f('0x5f'),_0x418579['speed'])[_0xe01f('0x11')](function(_0x4840ad){_0x4ce26b(null,_0x4840ad);})['catch'](function(_0x313681){_0x4ce26b(_0x313681);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x85')]=function(_0x257171,_0x226875,_0x1dff55){scripts['ispeechASR'](_0x226875,_0x257171[_0xe01f('0x86')],_0x257171['ispeech_asr_language']||_0xe01f('0x5f'),this['isConfigured'](_0x257171[_0xe01f('0x87')])?_0x257171[_0xe01f('0x87')]:undefined)['then'](function(_0x2ac74d){_0x1dff55(null,_0x2ac74d);})[_0xe01f('0x13')](function(_0x4eec7d){_0x1dff55(_0x4eec7d);});};AGIVertices['prototype']['awsPolly']=function(_0x4f56e8,_0xb43191){scripts['awsPolly'](_0x4f56e8['aws_access_key_id'],_0x4f56e8['aws_secret_access_key'],_0x4f56e8['aws_polly_region'],_0x4f56e8[_0xe01f('0x88')]||_0xe01f('0x89'),_0x4f56e8[_0xe01f('0x5d')],_0x4f56e8[_0xe01f('0x8a')]||_0xe01f('0x5d'))[_0xe01f('0x11')](function(_0xb8a43d){_0xb43191(null,_0xb8a43d);})[_0xe01f('0x13')](function(_0x3380c6){_0xb43191(_0x3380c6);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x8b')]=function(_0x1dba36,_0x5a9d49){scripts[_0xe01f('0x8b')](this['channel'][_0xe01f('0x3c')],_0x1dba36[_0xe01f('0x8c')],_0x1dba36[_0xe01f('0x8d')],_0x1dba36[_0xe01f('0x8e')],_0x1dba36[_0xe01f('0x5d')],_0x1dba36[_0xe01f('0x8f')])[_0xe01f('0x11')](function(_0x7ef35e){_0x5a9d49(null,_0x7ef35e);})[_0xe01f('0x13')](function(_0x2648a4){_0x5a9d49(_0x2648a4);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x90')]=function(_0xa768b9,_0x33f718,_0x22c116){scripts['googleASR'](_0x33f718,_0xa768b9[_0xe01f('0x86')],_0xa768b9[_0xe01f('0x91')]||'en-US')[_0xe01f('0x11')](function(_0x9aa559){_0x22c116(null,_0x9aa559);})[_0xe01f('0x13')](function(_0x2560fc){_0x22c116(_0x2560fc);});};AGIVertices[_0xe01f('0xe')]['tildeASR']=function(_0x1aec49,_0x889e13,_0x18d5bf){scripts[_0xe01f('0x92')](_0x889e13,_0x1aec49[_0xe01f('0x93')],_0x1aec49[_0xe01f('0x94')],_0x1aec49[_0xe01f('0x73')])[_0xe01f('0x11')](function(_0x3e2416){_0x18d5bf(null,_0x3e2416);})[_0xe01f('0x13')](function(_0x4cbeef){_0x18d5bf(_0x4cbeef);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x95')]=function(_0x231aca){var _0x4fffb9=_[_0xe01f('0x96')](verticesWithRetry,_0x231aca['agicommand'])?_0x231aca:_['clone'](_0x231aca);for(var _0x39653c in _0x4fffb9){if(_0x4fffb9['hasOwnProperty'](_0x39653c)){if(_0x4fffb9[_0x39653c]&&_[_0xe01f('0x97')](_0x4fffb9[_0x39653c])){if(_['includes'](recursiveMapAttributes,_0x39653c)){_0x4fffb9[_0x39653c]=this['replaceObjectAllVariables'](_0x4fffb9[_0x39653c]);}else{_0x4fffb9[_0x39653c]=this[_0xe01f('0x98')](_0x4fffb9[_0x39653c]);}}}}return _0x4fffb9;};AGIVertices['prototype'][_0xe01f('0x99')]=function(_0x32dd90){for(var _0x435da5 in _0x32dd90){if(_0x32dd90['hasOwnProperty'](_0x435da5)){if(_[_0xe01f('0x9a')](_0x32dd90[_0x435da5])){this[_0xe01f('0x99')](_0x32dd90[_0x435da5]);}else if(_[_0xe01f('0x9b')](_0x32dd90[_0x435da5])){for(var _0x2d0bc5=0x0;_0x2d0bc5<_0x32dd90[_0x435da5][_0xe01f('0x9c')];_0x2d0bc5++){this[_0xe01f('0x99')](_0x32dd90[_0x435da5][_0x2d0bc5]);}}else if(_[_0xe01f('0x97')](_0x32dd90[_0x435da5])){_0x32dd90[_0x435da5]=this[_0xe01f('0x98')](_0x32dd90[_0x435da5]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x117e2f,_0x2c4d07){for(var _0x2289d0 in _0x117e2f){if(_0x117e2f[_0xe01f('0x9d')](_0x2289d0)){if(_[_0xe01f('0x9a')](_0x117e2f[_0x2289d0])){if(!_[_0xe01f('0x45')](_0x117e2f[_0x2289d0])){this['saveRestApiResult'](_0x117e2f[_0x2289d0],util['format'](_0xe01f('0x9e'),_0x2c4d07,_0x2289d0));}}else if(_[_0xe01f('0x9b')](_0x117e2f[_0x2289d0])){for(var _0x9033f8=0x0;_0x9033f8<_0x117e2f[_0x2289d0]['length'];_0x9033f8++){this[_0xe01f('0x9f')](_0x117e2f[_0x2289d0][_0x9033f8],util['format'](_0xe01f('0x9e'),_0x2c4d07,_0x2289d0+'['+_0x9033f8+']'));}}else{if(!_[_0xe01f('0x46')](_0x117e2f[_0x2289d0])){this['channel'][_0xe01f('0xa0')](util['format'](_0xe01f('0x9e'),_0x2c4d07,_0x2289d0),_0x117e2f[_0x2289d0]);}}}}};AGIVertices[_0xe01f('0xe')][_0xe01f('0xa1')]=function(_0x15078b){try{var _0x53c70e=JSON[_0xe01f('0x6d')](_0x15078b);this['recursiveNodeIndex'](_0x53c70e);return JSON[_0xe01f('0x75')](_0x53c70e);}catch(_0x26f8cb){return this[_0xe01f('0x98')](_0x15078b);}};AGIVertices['prototype'][_0xe01f('0x98')]=function(_0x27d255){var _0x3a8fd3=_0x27d255[_0xe01f('0xa2')]('{');for(var _0x1b362b=0x1;_0x1b362b<_0x3a8fd3[_0xe01f('0x9c')];_0x1b362b+=0x1){var _0x299389=_0x3a8fd3[_0x1b362b]['split']('}');if(_0x299389[_0xe01f('0x9c')]>0x1){_0x27d255=_0x27d255[_0xe01f('0xa3')]('{'+_0x299389[0x0]+'}',this[_0xe01f('0x37')][_0xe01f('0xf')](_0x299389[0x0])['extra']||_0x299389[0x0]);}}if(_0x3a8fd3[_0xe01f('0x9c')]===0x1){return _0x27d255[_0xe01f('0x4d')]();}return this['replaceAllVariables'](_0x27d255);};AGIVertices[_0xe01f('0xe')][_0xe01f('0xa4')]=function(_0xe78abc,_0x153905){var _0x593381=this['channel'][_0xe01f('0xf')](_0xe78abc);if(_0x593381[_0xe01f('0xa5')]===-0x1){return _0x593381;}logger['info'](util['format'](_0xe01f('0xa6'),_0x153905,_0x593381[_0xe01f('0xa7')]));return this[_0xe01f('0x37')][_0xe01f('0xa0')](_0x153905,_0x593381[_0xe01f('0xa7')]);};AGIVertices[_0xe01f('0xe')][_0xe01f('0xa8')]=function(_0x5be789){return _0x5be789&&_0x5be789!=='0'&&_0x5be789!=='-1'&&_0x5be789!=='';};AGIVertices[_0xe01f('0xe')][_0xe01f('0xa9')]=function(_0x22c702){this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x22c702,'-');_0x22c702[_0xe01f('0xaa')]=_0x22c702[_0xe01f('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xe01f('0xe')]['mrcpsynth']=function(_0x365642){logger[_0xe01f('0x2c')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x365642[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x365642[_0xe01f('0x5d')])){return this[_0xe01f('0x37')][_0xe01f('0xab')]('no\x20text\x20configured');}var _0x9d7bc1='\x22'+_0x365642[_0xe01f('0x5d')]+'\x22';if(this[_0xe01f('0xa8')](_0x365642[_0xe01f('0x7c')])){_0x9d7bc1+=','+_0x365642[_0xe01f('0x7c')];}var _0xbdcb11=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0xad'),_0x9d7bc1);if(_0xbdcb11[_0xe01f('0xa5')]===-0x1){return _0xbdcb11;}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xae'),_0x9d7bc1));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xaf')]=function(_0x468fbc){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x468fbc[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x468fbc[_0xe01f('0xb0')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xb1'));}var _0x73aedb=_0x468fbc[_0xe01f('0xb0')];if(this[_0xe01f('0xa8')](_0x468fbc[_0xe01f('0x7c')])){_0x73aedb+=','+_0x468fbc[_0xe01f('0x7c')];}var _0x542f31=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0xb2'),_0x73aedb);if(_0x542f31['result']===-0x1){return _0x542f31;}var _0x41ecc0=this[_0xe01f('0xa4')](_0xe01f('0xb3'),_0xe01f('0xb4'));if(_0x41ecc0[_0xe01f('0xa5')]===-0x1){return _0x41ecc0;}var _0x3959bb=this['getAndSetVariable']('RECOG_INPUT()',_0xe01f('0xb5'));if(_0x3959bb[_0xe01f('0xa5')]===-0x1){return _0x3959bb;}var _0x11b751=this[_0xe01f('0xa4')](_0xe01f('0xb6'),'MRCP_RECOG_INSTANCE');if(_0x11b751[_0xe01f('0xa5')]===-0x1){return _0x11b751;}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xb7'),_0x73aedb));};AGIVertices[_0xe01f('0xe')][_0xe01f('0x6')]=function(_0x4db14f){logger['info'](util['format'](_0xe01f('0xb8'),_0x4db14f[_0xe01f('0x38')]));return this['channel']['agi']([_0x4db14f['command'],_0x4db14f['args']]);};AGIVertices[_0xe01f('0xe')][_0xe01f('0xb9')]=function(_0xef549a){logger['info'](util[_0xe01f('0x26')](_0xe01f('0xba'),_0xef549a[_0xe01f('0x38')]));if(this[_0xe01f('0xa8')](_0xef549a[_0xe01f('0x69')])){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Wait\x20%s\x20seconds\x20before\x20answer',_0xef549a[_0xe01f('0x69')]));var _0x2a74b4=this['channel'][_0xe01f('0xbb')](_0xef549a['timeout']);if(_0x2a74b4[_0xe01f('0xa5')]===-0x1){return _0x2a74b4;}}return this[_0xe01f('0x37')]['answer']();};AGIVertices[_0xe01f('0xe')][_0xe01f('0xbc')]=function(_0x9a97f7){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0xbd'),_0x9a97f7[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x9a97f7[_0xe01f('0x4a')])){return this[_0xe01f('0x37')]['error'](_0x9a97f7,_0xe01f('0xbe'));}_0x9a97f7[_0xe01f('0x4c')]=moment();if(this[_0xe01f('0xa8')](_0x9a97f7[_0xe01f('0xbf')])){_0x9a97f7[_0xe01f('0x4c')]=moment()[_0xe01f('0xc0')](_0x9a97f7[_0xe01f('0xbf')],'minutes');}if(!this[_0xe01f('0xa8')](_0x9a97f7[_0xe01f('0x4e')])){_0x9a97f7[_0xe01f('0x4e')]=0x2;}this['createCmContact'][_0xe01f('0x72')](this,_0x9a97f7);return this[_0xe01f('0x37')]['noop'](util['format'](_0xe01f('0xc1'),_0x9a97f7[_0xe01f('0x49')],_0x9a97f7[_0xe01f('0x4a')],_0x9a97f7[_0xe01f('0x4c')]));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xc2')]=function(_0x4a6717){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0xc3'),_0x4a6717[_0xe01f('0x38')]));var _0x29e396=this['channel']['exec'](_0x4a6717[_0xe01f('0xc4')],_0x4a6717[_0xe01f('0x7c')]);if(_0x29e396['result']===-0x1){return _0x29e396;}return this[_0xe01f('0x37')][_0xe01f('0xab')](util['format'](_0xe01f('0xc5'),_0x4a6717[_0xe01f('0xc4')],_0x4a6717[_0xe01f('0x7c')]));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xc6')]=function(_0x51c7d1){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0xc7'),_0x51c7d1[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x51c7d1[_0xe01f('0x5d')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xc8'));}var _0x356e24='\x22'+_0x51c7d1[_0xe01f('0x5d')]+'\x22';if(this[_0xe01f('0xa8')](_0x51c7d1[_0xe01f('0x7c')])){_0x356e24+=','+_0x51c7d1[_0xe01f('0x7c')];}var _0x5c45c8=this[_0xe01f('0x37')]['exec']('MRCPSynth',_0x356e24);if(_0x5c45c8[_0xe01f('0xa5')]===-0x1){return _0x5c45c8;}return this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xae'),_0x356e24));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xc9')]=function(_0x2f3b29){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0xca'),_0x2f3b29['label']));if(!this['isConfigured'](_0x2f3b29[_0xe01f('0x5d')])){return this[_0xe01f('0x37')][_0xe01f('0xab')]('no\x20text\x20configured');}var _0xdc5f61='\x22'+_0x2f3b29[_0xe01f('0x5d')]+'\x22';if(this[_0xe01f('0xa8')](_0x2f3b29[_0xe01f('0x7c')])){_0xdc5f61+=','+_0x2f3b29[_0xe01f('0x7c')];}var _0x1eaab4=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0xad'),_0xdc5f61);if(_0x1eaab4[_0xe01f('0xa5')]===-0x1){return _0x1eaab4;}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xae'),_0xdc5f61));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xcb')]=function(_0x431b69){logger['info'](util[_0xe01f('0x26')](_0xe01f('0xcc'),_0x431b69['label']));if(!this[_0xe01f('0xa8')](_0x431b69[_0xe01f('0xb0')])){return this[_0xe01f('0x37')]['noop']('no\x20grammar\x20configured');}var _0x31cabb=_0x431b69[_0xe01f('0xb0')];if(this[_0xe01f('0xa8')](_0x431b69[_0xe01f('0x7c')])){_0x31cabb+=','+_0x431b69[_0xe01f('0x7c')];}var _0x45c6bd=this['channel']['exec']('MRCPRecog',_0x31cabb);if(_0x45c6bd['result']===-0x1){return _0x45c6bd;}var _0x15ac0b=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xe01f('0xcd'));if(_0x15ac0b[_0xe01f('0xa5')]===-0x1){return _0x15ac0b;}var _0x4cf4d8=this['getAndSetVariable']('RECOG_INPUT()',_0xe01f('0xce'));if(_0x4cf4d8[_0xe01f('0xa5')]===-0x1){return _0x4cf4d8;}var _0x53e68d=this['getAndSetVariable']('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x53e68d['result']===-0x1){return _0x53e68d;}return this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')]('Executed\x20command\x20MRCPRecog\x20%s',_0x31cabb));};AGIVertices[_0xe01f('0xe')]['sestekasr']=function(_0x54b1fd){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0xcf'),_0x54b1fd[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x54b1fd[_0xe01f('0xb0')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xb1'));}var _0x16cbcb=_0x54b1fd[_0xe01f('0xb0')];if(this['isConfigured'](_0x54b1fd[_0xe01f('0x7c')])){_0x16cbcb+=','+_0x54b1fd['options'];}var _0x432241=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0xb2'),_0x16cbcb);if(_0x432241[_0xe01f('0xa5')]===-0x1){return _0x432241;}var _0x171096=this['getAndSetVariable'](_0xe01f('0xb3'),_0xe01f('0xd0'));if(_0x171096[_0xe01f('0xa5')]===-0x1){return _0x171096;}var _0x78e052=this[_0xe01f('0xa4')](_0xe01f('0xd1'),_0xe01f('0xd2'));if(_0x78e052[_0xe01f('0xa5')]===-0x1){return _0x78e052;}var _0x225783=this[_0xe01f('0xa4')](_0xe01f('0xb6'),_0xe01f('0xd3'));if(_0x225783['result']===-0x1){return _0x225783;}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xb7'),_0x16cbcb));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xd4')]=function(_0x487545){logger[_0xe01f('0x2c')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x487545[_0xe01f('0x38')]));if(!this['isConfigured'](_0x487545['odbc_id'])){return this['channel']['error'](_0x487545,'no\x20database\x20selected');}var _0x5be520=this[_0xe01f('0xd5')][_0xe01f('0x72')](this,_0x487545[_0xe01f('0xd6')]);if(!_0x5be520){return this['channel'][_0xe01f('0x2a')](_0x487545,_0xe01f('0xd7'));}if(!this[_0xe01f('0xa8')](_0x487545[_0xe01f('0x2e')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x487545,'no\x20query\x20configured');}var _0x25c0f5=_0x487545[_0xe01f('0x2e')][_0xe01f('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0xe01f('0x37')]['noop'](util['format'](_0xe01f('0xd8'),_0x25c0f5));var _0xb562b1=this[_0xe01f('0x28')]['sync'](this,_0x5be520,_0x25c0f5);this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x487545,_0x25c0f5);if(!this[_0xe01f('0xa8')](_0x487545[_0xe01f('0xd9')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xda'));}var _0x1533c3=this['getVariable'][_0xe01f('0x72')](this,_0x487545[_0xe01f('0xd9')]);if(!_0x1533c3){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x487545,_0xe01f('0xdb'));}var _0x3aab57=this;_0xb562b1['forEach'](function(_0x476461,_0x2ad527){Object[_0xe01f('0xdc')](_0x476461)[_0xe01f('0xdd')](function(_0x35cc5a){_0x3aab57['channel'][_0xe01f('0xa0')](util[_0xe01f('0x26')](_0xe01f('0xde'),_0x1533c3,_0x2ad527,_0x35cc5a),_0x476461[_0x35cc5a]);});});this['channel']['setVariable'](util['format'](_0xe01f('0xdf'),_0x1533c3),_0xb562b1[_0xe01f('0x9c')]);return this[_0xe01f('0x37')]['noop'](util['format']('variable\x20%s\x20set',_0x1533c3));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xe0')]=function(_0x26c6ba){logger[_0xe01f('0xe1')](util['format'](_0xe01f('0xe2'),_0x26c6ba['label']));if(!this['isConfigured'](_0x26c6ba[_0xe01f('0xe3')])){return this['channel'][_0xe01f('0x2a')](_0x26c6ba,_0xe01f('0xe4'));}var _0x443879=this[_0xe01f('0x18')]['sync'](this,_0x26c6ba[_0xe01f('0xe3')]);if(!_0x443879){return this['channel'][_0xe01f('0x2a')](_0x26c6ba,'no\x20user\x20found');}var _0x56049d=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0xe5'),[util[_0xe01f('0x26')](_0xe01f('0xe6'),_0x443879),_0x26c6ba[_0xe01f('0x69')],_0x26c6ba['opts'],_0x26c6ba['url']]);if(_0x56049d[_0xe01f('0xa5')]===-0x1){return _0x56049d;}return this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')]('Executed\x20command\x20%s',_0xe01f('0xe5')));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xe7')]=function(_0x5bf5f3){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x5bf5f3[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x5bf5f3[_0xe01f('0x86')])){return this[_0xe01f('0x37')]['noop']('no\x20key\x20configured');}if(!this[_0xe01f('0xa8')](_0x5bf5f3[_0xe01f('0x5d')])){return this['channel'][_0xe01f('0xab')]('no\x20text\x20configured');}this[_0xe01f('0x37')][_0xe01f('0xe8')]=!![];this[_0xe01f('0x36')](_0x5bf5f3);this[_0xe01f('0x43')](_0x5bf5f3[_0xe01f('0x5d')],'in','','');this['channel']['noop'](util['format']('Trying\x20Dialogflow:\x20%s',_0x5bf5f3[_0xe01f('0x5d')]));var _0x3f7b1d=this[_0xe01f('0x7d')][_0xe01f('0x72')](this,_0x5bf5f3);if(_0x3f7b1d){for(var _0x289141 in _0x3f7b1d){if(_0x3f7b1d[_0xe01f('0x9d')](_0x289141)){this[_0xe01f('0x37')]['setVariable'](util[_0xe01f('0x26')]('DIALOGFLOW_%s',_0x289141['toUpperCase']()),_0x3f7b1d[_0x289141]);}}this[_0xe01f('0x43')](_0x3f7b1d[_0xe01f('0xe9')],_0xe01f('0xea'),'dialogflow','');return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xeb'),_0x3f7b1d[_0xe01f('0xe9')]));}return this['channel']['error'](_0x5bf5f3,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xe01f('0xe')][_0xe01f('0xec')]=function(_0x424585){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0xed'),_0x424585[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x424585[_0xe01f('0xee')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xef'));}if(!this[_0xe01f('0xa8')](_0x424585[_0xe01f('0xf0')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xf1'));}if(!this[_0xe01f('0xa8')](_0x424585[_0xe01f('0x80')])){return this[_0xe01f('0x37')]['noop']('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x424585[_0xe01f('0x81')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xf2'));}if(!this[_0xe01f('0xa8')](_0x424585[_0xe01f('0x5d')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xc8'));}this[_0xe01f('0x37')][_0xe01f('0xe8')]=!![];this['createSquareDetailsReport'](_0x424585);this[_0xe01f('0x43')](_0x424585['text'],'in','','');this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xf3'),_0x424585[_0xe01f('0x5d')]));var _0x42edb8=this[_0xe01f('0x7f')][_0xe01f('0x72')](this,_0x424585);if(_0x42edb8){for(var _0x89c561 in _0x42edb8){if(_0x42edb8[_0xe01f('0x9d')](_0x89c561)){if(_0x89c561!=='providerResponse'){this['channel'][_0xe01f('0xa0')](util[_0xe01f('0x26')](_0xe01f('0xf4'),_0x89c561[_0xe01f('0xf5')]()),_0x42edb8[_0x89c561]);}}}this[_0xe01f('0x43')](_0x42edb8['speech'],_0xe01f('0xea'),'dialogflowV2',_0x42edb8['providerResponse']);return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xf6'),_0x42edb8['speech']));}return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x424585,_0xe01f('0xf7'));};AGIVertices[_0xe01f('0xe')]['sesteknda']=function(_0x5719e8){logger['info'](util['format'](_0xe01f('0xf8'),_0x5719e8[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x5719e8[_0xe01f('0xf9')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xfa'));}if(!this['isConfigured'](_0x5719e8[_0xe01f('0xfb')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xfc'));}if(!this['isConfigured'](_0x5719e8[_0xe01f('0xfd')])){return this['channel'][_0xe01f('0xab')](_0xe01f('0xfe'));}if(!this[_0xe01f('0xa8')](_0x5719e8[_0xe01f('0xff')])){return this['channel'][_0xe01f('0xab')]('no\x20text\x20configured');}this[_0xe01f('0x37')][_0xe01f('0xe8')]=!![];this[_0xe01f('0x36')](_0x5719e8);this[_0xe01f('0x43')](_0x5719e8[_0xe01f('0x5d')],'in','','');this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')](_0xe01f('0x100'),_0x5719e8[_0xe01f('0x5d')]));var _0x9d1553=this['sestekNDA'][_0xe01f('0x72')](this,_0x5719e8);if(_0x9d1553){for(var _0x3d40ac in _0x9d1553){if(_0x9d1553[_0xe01f('0x9d')](_0x3d40ac)){this[_0xe01f('0x37')][_0xe01f('0xa0')](util[_0xe01f('0x26')](_0xe01f('0x101'),_0x3d40ac[_0xe01f('0xf5')]()),_0x9d1553[_0x3d40ac]);}}this[_0xe01f('0x43')](_0x9d1553[_0xe01f('0xe9')],_0xe01f('0xea'),_0xe01f('0x102'),'');if(_0x9d1553[_0xe01f('0x103')]){this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')](_0xe01f('0x104'),_0x9d1553['audiofile']));var _0x18b248=this[_0xe01f('0x37')][_0xe01f('0x105')](_0x9d1553[_0xe01f('0x103')]);try{fs[_0xe01f('0x106')](_0x9d1553['audiofile']+_0xe01f('0x107'));}catch(_0x31b7cd){logger[_0xe01f('0x2a')](_0x31b7cd);}return _0x18b248;}else{return this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')]('SestekNDA\x20Result\x20%s',_0x9d1553['speech']));}}return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5719e8,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xe01f('0xe')]['end']=function(_0xfe5baa){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x108'),_0xfe5baa[_0xe01f('0x38')]));return this[_0xe01f('0x37')]['noop'](_0xe01f('0x109'));};AGIVertices['prototype'][_0xe01f('0x10a')]=function(_0x5751a8){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x10b'),_0x5751a8[_0xe01f('0x38')]));var _0x568949='';if(_0x5751a8['trunk_id']){if(!this[_0xe01f('0xa8')](_0x5751a8[_0xe01f('0x10c')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5751a8,'no\x20trunk\x20selected');}else{var _0x2f7089=parseInt(_0x5751a8['trunk_id'],0xa);if(isNaN(_0x2f7089)){_0x568949=_0x5751a8[_0xe01f('0x10c')];}else{_0x568949=this['getTrunk'][_0xe01f('0x72')](this,_0x5751a8[_0xe01f('0x10c')]);if(!_0x568949){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5751a8,'no\x20trunk\x20found');}}}}else if(_0x5751a8[_0xe01f('0x10d')]){_0x568949=_0x5751a8[_0xe01f('0x10d')];}else{return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5751a8,_0xe01f('0x10e'));}var _0x4505b9=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0xe5'),[util['format'](_0xe01f('0x10f'),_0x568949,_0x5751a8[_0xe01f('0x49')]),_0x5751a8[_0xe01f('0x69')],_0x5751a8[_0xe01f('0x110')],_0x5751a8['url']]);if(_0x4505b9[_0xe01f('0xa5')]===-0x1){return _0x4505b9;}return this['channel']['noop'](util[_0xe01f('0x26')]('Executed\x20command\x20%s',_0xe01f('0xe5')));};AGIVertices[_0xe01f('0xe')]['finally']=function(_0x1ecc37){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x111'),_0x1ecc37['label']));return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x112'));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xb')]=function(_0x3564a8){logger['info'](util[_0xe01f('0x26')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3564a8['label']));if(_0x3564a8[_0xe01f('0xaa')]===0x0){return this[_0xe01f('0xa9')](_0x3564a8);}_0x3564a8[_0xe01f('0xaa')]-=0x1;if(!this[_0xe01f('0xa8')](_0x3564a8[_0xe01f('0x113')])){return this['channel'][_0xe01f('0x2a')](_0x3564a8,_0xe01f('0x114'));}var _0x224d80=this[_0xe01f('0x115')][_0xe01f('0x72')](this,_0x3564a8[_0xe01f('0x113')]);if(!_0x224d80){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x3564a8,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x3564a8['variable_id'])){return this['channel'][_0xe01f('0x2a')](_0xe01f('0xda'));}var _0x647e75=this['channel'][_0xe01f('0x116')](_0x224d80,_0x3564a8[_0xe01f('0x117')],_0x3564a8[_0xe01f('0x118')]);var _0x466833=_0x647e75['result']?_0x647e75[_0xe01f('0xa5')]['toString']():'';logger['info'](_0xe01f('0x119'),JSON['stringify'](_0x647e75));if(_0x647e75['result']===-0x1){this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x3564a8,_0x466833);return _0x647e75;}else if(_0x647e75[_0xe01f('0xa7')]===_0xe01f('0x69')){_0x647e75[_0xe01f('0xa5')]=_0x466833[_0xe01f('0x9c')]>=parseInt(_0x3564a8[_0xe01f('0x11a')])?'x':'i';}else{_0x647e75[_0xe01f('0xa5')]=_0x466833[_0xe01f('0x9c')]>=parseInt(_0x3564a8[_0xe01f('0x11a')])&&_0x466833[_0xe01f('0x9c')]<=parseInt(_0x3564a8[_0xe01f('0x118')])?'x':'i';}var _0xd2df4d=this[_0xe01f('0xf')]['sync'](this,_0x3564a8['variable_id']);if(!_0xd2df4d){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x3564a8,_0xe01f('0xdb'));}this[_0xe01f('0x37')][_0xe01f('0xa0')](_0xd2df4d,_0x466833);if(this[_0xe01f('0xa8')](_0x3564a8[_0xe01f('0x11b')])){var _0xdf6cd5=parseInt(_0x3564a8[_0xe01f('0x11b')],0xa);var _0x8533d4=rs[_0xe01f('0x11c')]({'charset':'*','length':_0xdf6cd5});var _0x44915a=_0x466833[_0xe01f('0x9c')];if(_0x44915a>0x0){if(_0x44915a>_0xdf6cd5){this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x3564a8,_0x3564a8[_0xe01f('0x11d')]===_0xe01f('0x11e')?_0x8533d4+_0x466833[_0xe01f('0x11f')](_0xdf6cd5):_0x466833['substr'](0x0,_0x44915a-_0xdf6cd5)+_0x8533d4);}else{this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x3564a8,rs[_0xe01f('0x11c')]({'charset':'*','length':_0x44915a}));}}else{this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x3564a8,'');}}else{this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x3564a8,_0x466833);}return _0x647e75;};AGIVertices[_0xe01f('0xe')]['getsecretdigits']=function(_0x372813){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x120'),_0x372813['label']));return this[_0xe01f('0xb')](_0x372813);};AGIVertices[_0xe01f('0xe')][_0xe01f('0x121')]=function(_0x1b409e){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x1b409e[_0xe01f('0x38')]));this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x1b409e,_0x1b409e[_0xe01f('0x122')]);return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x123'),_0x1b409e[_0xe01f('0x122')]));};AGIVertices[_0xe01f('0xe')][_0xe01f('0x124')]=function(_0x390de1){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x125'),_0x390de1['label']));if(!this[_0xe01f('0xa8')](_0x390de1['aws_access_key_id'])||!this[_0xe01f('0xa8')](_0x390de1['aws_secret_access_key'])){return this[_0xe01f('0x37')]['noop'](_0xe01f('0x126'));}if(!this[_0xe01f('0xa8')](_0x390de1['text'])){return this['channel'][_0xe01f('0xab')]('no\x20text\x20configured');}this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x127'),_0x390de1[_0xe01f('0x5d')]));var _0xf704a=this[_0xe01f('0x128')][_0xe01f('0x72')](this,_0x390de1);if(_0xf704a){this['channel'][_0xe01f('0xab')](util['format'](_0xe01f('0x129'),_0xf704a));var _0x31c499=this['channel'][_0xe01f('0x105')](_0xf704a);try{fs[_0xe01f('0x106')](_0xf704a+_0xe01f('0x107'));}catch(_0xf2be01){logger[_0xe01f('0x2a')](_0xf2be01);}return _0x31c499;}return this['channel']['error'](_0x390de1,_0xe01f('0x12a'));};AGIVertices[_0xe01f('0xe')][_0xe01f('0x12b')]=function(_0x530a05){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x12c'),_0x530a05[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x530a05['aws_access_key_id'])||!this[_0xe01f('0xa8')](_0x530a05[_0xe01f('0x8d')])){return this['channel']['noop'](_0xe01f('0x126'));}if(!this[_0xe01f('0xa8')](_0x530a05[_0xe01f('0x8f')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x12d'));}if(!this[_0xe01f('0xa8')](_0x530a05['text'])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xc8'));}this['channel'][_0xe01f('0xe8')]=!![];this[_0xe01f('0x36')](_0x530a05);this['createSquareMessage'](_0x530a05['text'],'in','','');this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x12e'),_0x530a05[_0xe01f('0x5d')]));var _0x36bd2a=this[_0xe01f('0x8b')]['sync'](this,_0x530a05);if(_0x36bd2a){for(var _0xe6c8f4 in _0x36bd2a){if(_0x36bd2a[_0xe01f('0x9d')](_0xe6c8f4)&&_[_0xe01f('0x97')](_0x36bd2a[_0xe6c8f4])){this[_0xe01f('0x37')][_0xe01f('0xa0')](util['format'](_0xe01f('0x12f'),_0xe6c8f4[_0xe01f('0xf5')]()),_0x36bd2a[_0xe6c8f4]);}}if(_['isNil'](_0x36bd2a[_0xe01f('0x7a')])){return this['channel'][_0xe01f('0xab')](_0xe01f('0x130'));}else{this[_0xe01f('0x43')](_0x36bd2a[_0xe01f('0x7a')],_0xe01f('0xea'),_0xe01f('0x131'),'');return this[_0xe01f('0x37')][_0xe01f('0xab')](util['format'](_0xe01f('0x132'),_0x36bd2a[_0xe01f('0x7a')]));}}return this['channel'][_0xe01f('0x2a')](_0x530a05,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xe01f('0xe')]['googleasr']=function(_0x265b06){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x133'),_0x265b06['label'],_0x265b06[_0xe01f('0x69')]));if(!this[_0xe01f('0xa8')](_0x265b06['key'])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x134'));}var _0x368a1e=_0xe01f('0x135');var _0x466fbd=util[_0xe01f('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0xe01f('0x11c')](0x4));var _0x59c632=util['format'](_0xe01f('0x9e'),_0x466fbd,_0x368a1e);var _0x3f5da1=!![];if(_0x265b06[_0xe01f('0x136')]===_0xe01f('0x137')){_0x3f5da1=![];}var _0x1fc959=this['channel'][_0xe01f('0x138')](_0x466fbd,_0x368a1e,_0x265b06['intKey'],_0x265b06[_0xe01f('0x69')],undefined,_0x3f5da1);if(_0x1fc959[_0xe01f('0xa5')]!==-0x1){this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x139'),_0x59c632));var _0x59fa10=this[_0xe01f('0x90')]['sync'](this,_0x265b06,_0x59c632);if(_0x59fa10){for(var _0x4e5e47 in _0x59fa10){if(_0x59fa10[_0xe01f('0x9d')](_0x4e5e47)){this['channel']['setVariable'](util['format'](_0xe01f('0x13a'),_0x4e5e47[_0xe01f('0xf5')]()),_0x59fa10[_0x4e5e47]);}}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x13b'),JSON['stringify'](_0x59fa10)));}}return _0x1fc959;};AGIVertices['prototype'][_0xe01f('0x13c')]=function(_0x273e4d){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x13d'),_0x273e4d[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x273e4d[_0xe01f('0x93')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x13e'));}if(!this[_0xe01f('0xa8')](_0x273e4d[_0xe01f('0x94')])){return this['channel']['noop']('no\x20appsecret\x20configured');}var _0x1b7e30=_0xe01f('0x135');var _0x327c0a=util[_0xe01f('0x26')](_0xe01f('0x13f'),FILES_PATH,rs[_0xe01f('0x11c')](0x4));var _0x284f96=util[_0xe01f('0x26')](_0xe01f('0x9e'),_0x327c0a,_0x1b7e30);var _0x1e8b1b=!![];if(_0x273e4d['beep']===_0xe01f('0x137')){_0x1e8b1b=![];}var _0x5b96b5=this[_0xe01f('0x37')][_0xe01f('0x138')](_0x327c0a,_0x1b7e30,_0x273e4d[_0xe01f('0x140')],_0x273e4d[_0xe01f('0x69')],undefined,_0x1e8b1b);if(_0x5b96b5[_0xe01f('0xa5')]!==-0x1){this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')]('tilde\x20%s\x20file\x20created',_0x284f96));var _0x5e01a7=this[_0xe01f('0x92')][_0xe01f('0x72')](this,_0x273e4d,_0x284f96);if(_0x5e01a7){for(var _0x2d789a in _0x5e01a7){if(_0x5e01a7['hasOwnProperty'](_0x2d789a)){this[_0xe01f('0x37')][_0xe01f('0xa0')](util['format'](_0xe01f('0x141'),_0x2d789a[_0xe01f('0xf5')]()),_0x5e01a7[_0x2d789a]);}}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')]('TildeASR\x20Result\x20%s',JSON[_0xe01f('0x75')](_0x5e01a7)));}}return _0x5b96b5;};AGIVertices[_0xe01f('0xe')][_0xe01f('0x142')]=function(_0x33d212){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x143'),_0x33d212[_0xe01f('0x38')]));return this[_0xe01f('0x37')]['continueAt'](_0x33d212[_0xe01f('0x3e')],_0x33d212[_0xe01f('0x3f')],_0x33d212[_0xe01f('0x144')]);};AGIVertices['prototype'][_0xe01f('0x145')]=function(_0x4a4e4d){logger['info'](util[_0xe01f('0x26')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x4a4e4d[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x4a4e4d[_0xe01f('0x146')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x4a4e4d,_0xe01f('0x147'));}try{var _0x141da6=eval(_0x4a4e4d[_0xe01f('0x146')])?_0xe01f('0x148'):'false';this['channel'][_0xe01f('0xab')](util['format'](_0xe01f('0x149'),_0x4a4e4d[_0xe01f('0x146')],_0x141da6));return{'code':0xc8,'result':_0x141da6};}catch(_0x390d60){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xe01f('0xe')][_0xe01f('0x14a')]=function(_0x2b283c){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x14b'),_0x2b283c['label']));if(!this['isConfigured'](_0x2b283c['interval_id'])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x2b283c,'no\x20interval\x20configured');}var _0x214f63=this['getIntervals'][_0xe01f('0x72')](this,_0x2b283c[_0xe01f('0x14c')]);if(!_0x214f63){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x2b283c,_0xe01f('0x14d'));}for(var _0x16811d=0x0;_0x16811d<_0x214f63['length'];_0x16811d+=0x1){var _0x2b3baf=this[_0xe01f('0x37')][_0xe01f('0xf')](util[_0xe01f('0x26')]('IFTIME(%s?true:false)',_0x214f63[_0x16811d]));if(_0x2b3baf['result']===-0x1){return _0x2b3baf;}logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x14e'),_0x214f63[_0x16811d],_0x2b3baf[_0xe01f('0xa7')]));if(_0x2b3baf[_0xe01f('0xa7')]==='true'){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x14e'),_0x214f63[_0x16811d],_0xe01f('0x148')));this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x14e'),_0x214f63[_0x16811d],_0xe01f('0x148')));return{'code':0xc8,'result':_0xe01f('0x148')};}else{logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x14e'),_0x214f63[_0x16811d],_0xe01f('0x14f')));this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x14e'),_0x214f63[_0x16811d],'false'));}}return{'code':0xc8,'result':_0xe01f('0x14f')};};AGIVertices['prototype'][_0xe01f('0x150')]=function(_0x3ef778){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x3ef778[_0xe01f('0x38')]));return this[_0xe01f('0x37')][_0xe01f('0x150')]();};AGIVertices[_0xe01f('0xe')][_0xe01f('0x151')]=function(_0x471228){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x152'),_0x471228[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x471228['key'])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x134'));}var _0x204565=_0xe01f('0x135');var _0x30f47a=util['format'](_0xe01f('0x13f'),FILES_PATH,rs[_0xe01f('0x11c')](0x4));var _0xf3486d=util[_0xe01f('0x26')](_0xe01f('0x9e'),_0x30f47a,_0x204565);var _0x5f4888=!![];if(_0x471228[_0xe01f('0x136')]==='NOBEEP'){_0x5f4888=![];}var _0x1a5adb=this[_0xe01f('0x37')][_0xe01f('0x138')](_0x30f47a,_0x204565,_0x471228['intKey'],_0x471228[_0xe01f('0x69')],undefined,_0x5f4888);if(_0x1a5adb[_0xe01f('0xa5')]!==-0x1){this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x153'),_0xf3486d));var _0x34d90e=this[_0xe01f('0x85')][_0xe01f('0x72')](this,_0x471228,_0xf3486d);if(_0x34d90e){for(var _0x179b6e in _0x34d90e){if(_0x34d90e['hasOwnProperty'](_0x179b6e)){this[_0xe01f('0x37')][_0xe01f('0xa0')](util[_0xe01f('0x26')]('ISPEECH_ASR_%s',_0x179b6e[_0xe01f('0xf5')]()),_0x34d90e[_0x179b6e]);}}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x154'),JSON[_0xe01f('0x75')](_0x34d90e)));}}return _0x1a5adb;};AGIVertices['prototype'][_0xe01f('0x155')]=function(_0x2f9966){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x156'),_0x2f9966[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x2f9966[_0xe01f('0x86')])){return this[_0xe01f('0x37')][_0xe01f('0xab')]('no\x20key\x20configured');}if(!this[_0xe01f('0xa8')](_0x2f9966[_0xe01f('0x5d')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xc8'));}this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x157'),_0x2f9966[_0xe01f('0x5d')]));var _0x5ce563=this['ispeechTTS'][_0xe01f('0x72')](this,_0x2f9966);if(_0x5ce563){this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x153'),_0x5ce563));var _0x38e4b4=this['channel'][_0xe01f('0x105')](_0x5ce563,_0x2f9966[_0xe01f('0x140')]);try{fs[_0xe01f('0x106')](_0x5ce563+_0xe01f('0x107'));}catch(_0x52f76b){logger[_0xe01f('0x2a')](_0x52f76b);}return _0x38e4b4;}return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x2f9966,_0xe01f('0x158'));};AGIVertices['prototype'][_0xe01f('0x159')]=function(_0x227a72){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x227a72[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x227a72[_0xe01f('0x15a')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x227a72,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0xe01f('0x15b'),this['channel'][_0xe01f('0x3a')],_0x227a72[_0xe01f('0x15a')]));var _0x1e4e83=this[_0xe01f('0x54')][_0xe01f('0x72')](this,_0x227a72[_0xe01f('0x15a')]);if(_0x1e4e83){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x227a72['findBy']));this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')](_0xe01f('0x15c'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x227a72[_0xe01f('0x15a')]));return{'code':0xc8,'result':_0xe01f('0x15d')};}else{logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15e'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x227a72[_0xe01f('0x15a')]));this[_0xe01f('0x37')][_0xe01f('0xab')](util['format'](_0xe01f('0x15e'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x227a72['findBy']));return{'code':0xc8,'result':_0xe01f('0x15f')};}};AGIVertices[_0xe01f('0xe')][_0xe01f('0x160')]=function(_0x5754d4){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x161'),_0x5754d4[_0xe01f('0x38')]));if(!this['isConfigured'](_0x5754d4[_0xe01f('0x15a')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5754d4,_0xe01f('0x162'));}logger['info'](util[_0xe01f('0x26')](_0xe01f('0x15b'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x5754d4[_0xe01f('0x15a')]));var _0x9a2870=this[_0xe01f('0x53')][_0xe01f('0x72')](this,_0x5754d4[_0xe01f('0x15a')]);if(_0x9a2870){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x5754d4[_0xe01f('0x15a')]));this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xe01f('0x3a')],_0x5754d4[_0xe01f('0x15a')]));return{'code':0xc8,'result':_0xe01f('0x15d')};}else{logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15e'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x5754d4[_0xe01f('0x15a')]));this[_0xe01f('0x37')][_0xe01f('0xab')](util['format'](_0xe01f('0x15e'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x5754d4[_0xe01f('0x15a')]));return{'code':0xc8,'result':_0xe01f('0x15f')};}};AGIVertices['prototype']['math']=function(_0x1d2586){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x163'),_0x1d2586[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x1d2586[_0xe01f('0x164')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x1d2586,'no\x20operation\x20configured');}this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')]('math\x20%s',_0x1d2586[_0xe01f('0x164')]));var _0xa45081=eval(_0x1d2586[_0xe01f('0x164')]);if(!this[_0xe01f('0xa8')](_0x1d2586[_0xe01f('0xd9')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xda'));}var _0x54f8a2=this[_0xe01f('0xf')]['sync'](this,_0x1d2586['variable_id']);if(!_0x54f8a2){return this[_0xe01f('0x37')]['error'](_0x1d2586,_0xe01f('0xdb'));}if(_[_0xe01f('0x9b')](_0xa45081)){var _0x29beb6=this;_0xa45081[_0xe01f('0xdd')](function(_0x458896,_0x11e363){_0x29beb6[_0xe01f('0x37')][_0xe01f('0xa0')](util[_0xe01f('0x26')](_0xe01f('0x165'),_0x54f8a2,_0x11e363),_0x458896);});return this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x166'),_0x54f8a2));}else{return this[_0xe01f('0x37')]['setVariable'](_0x54f8a2,_0xa45081);}};AGIVertices[_0xe01f('0xe')][_0xe01f('0xa')]=function(_0x45d84c){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x167'),_0x45d84c[_0xe01f('0x38')]));if(_0x45d84c[_0xe01f('0xaa')]===0x0){return this[_0xe01f('0xa9')](_0x45d84c);}_0x45d84c[_0xe01f('0xaa')]-=0x1;if(!this[_0xe01f('0xa8')](_0x45d84c[_0xe01f('0x113')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x45d84c,_0xe01f('0x114'));}var _0x4e2054=this[_0xe01f('0x115')][_0xe01f('0x72')](this,_0x45d84c[_0xe01f('0x113')]);if(!_0x4e2054){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x45d84c,'no\x20file\x20audio\x20found');}var _0x3f258a=this[_0xe01f('0x37')][_0xe01f('0x116')](_0x4e2054,_0x45d84c[_0xe01f('0x117')],_0x45d84c[_0xe01f('0x168')]);var _0x3651e4=_0x3f258a[_0xe01f('0xa5')];if(_0x3f258a[_0xe01f('0xa5')]===-0x1){this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x45d84c,'-1');return _0x3f258a;}else if(_0x3f258a[_0xe01f('0xa7')]===_0xe01f('0x69')){_0x3f258a[_0xe01f('0xa5')]=_0x3f258a[_0xe01f('0xa5')]['length']>0x0?_0x3f258a[_0xe01f('0xa5')]:'t';}else if(_['isEmpty'](_0x3f258a['result'])){_0x3f258a[_0xe01f('0xa5')]='#';_0x3651e4='#';}if(!this[_0xe01f('0xa8')](_0x45d84c['variable_id'])){this[_0xe01f('0x37')][_0xe01f('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x4e2c97=this['getVariable'][_0xe01f('0x72')](this,_0x45d84c[_0xe01f('0xd9')]);if(!_0x4e2c97){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x45d84c,'no\x20variable\x20found');}this[_0xe01f('0x37')][_0xe01f('0xa0')](_0x4e2c97,_0x3651e4);}this['createSquareDetailsReport'][_0xe01f('0x72')](this,_0x45d84c,_0x3651e4);return _0x3f258a;};AGIVertices[_0xe01f('0xe')][_0xe01f('0xab')]=function(_0x3ba4e7){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x169'),_0x3ba4e7['label']));return this[_0xe01f('0x37')][_0xe01f('0xab')](_0x3ba4e7[_0xe01f('0x16a')]||_0x3ba4e7[_0xe01f('0x38')]);};AGIVertices[_0xe01f('0xe')][_0xe01f('0x16b')]=function(_0x228eaa){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x16c'),_0x228eaa[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x228eaa[_0xe01f('0x15a')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x228eaa,_0xe01f('0x162'));}logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15b'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x228eaa[_0xe01f('0x15a')]));var _0x57fc60=this['getPause']['sync'](this,_0x228eaa[_0xe01f('0x16d')]);var _0x1bf178=this[_0xe01f('0x51')][_0xe01f('0x72')](this,_0x228eaa[_0xe01f('0x15a')],_0x57fc60);if(_0x1bf178){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x228eaa['findBy']));this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this[_0xe01f('0x37')]['callerid'],_0x228eaa['findBy']));return{'code':0xc8,'result':_0xe01f('0x15d')};}else{logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15e'),this['channel'][_0xe01f('0x3a')],_0x228eaa[_0xe01f('0x15a')]));this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this['channel']['callerid'],_0x228eaa[_0xe01f('0x15a')]));return{'code':0xc8,'result':_0xe01f('0x15f')};}};AGIVertices['prototype'][_0xe01f('0x16e')]=function(_0x5ed1ce){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x16f'),_0x5ed1ce[_0xe01f('0x38')]));if(!this['isConfigured'](_0x5ed1ce['file_id'])){return this[_0xe01f('0x37')]['error'](_0x5ed1ce,_0xe01f('0x114'));}var _0x12958d=this['getSound'][_0xe01f('0x72')](this,_0x5ed1ce[_0xe01f('0x113')]);if(!_0x12958d){return this['channel'][_0xe01f('0x2a')](_0x5ed1ce,_0xe01f('0x170'));}var _0x2ef073=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0x171'),[_0x12958d,_0x5ed1ce[_0xe01f('0x110')]]);if(_0x2ef073[_0xe01f('0xa5')]===-0x1){return _0x2ef073;}return this['channel']['noop'](util[_0xe01f('0x26')](_0xe01f('0xc5'),_0xe01f('0x171'),_0x12958d));};AGIVertices['prototype']['queue']=function(_0x370647){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x172'),_0x370647[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x370647[_0xe01f('0x173')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x370647,_0xe01f('0x174'));}var _0x34ea47='';var _0x164255=parseInt(_0x370647['queue_id'],0xa);if(isNaN(_0x164255)){_0x34ea47=_0x370647['queue_id'];}else{_0x34ea47=this[_0xe01f('0x14')][_0xe01f('0x72')](this,_0x370647[_0xe01f('0x173')]);if(!_0x34ea47){return this['channel'][_0xe01f('0x2a')](_0x370647,'no\x20queue\x20found');}}var _0x15058c='';if(this['isConfigured'](_0x370647['file_id'])){var _0x1de0fe=this['getSound'][_0xe01f('0x72')](this,_0x370647[_0xe01f('0x113')]);if(_0x1de0fe){_0x15058c=_0x1de0fe;}}this['createSquareDetailsReport'][_0xe01f('0x72')](this,_0x370647,_0x34ea47);if(_0x370647['opts'][_0xe01f('0x175')]('x')<0x0){_0x370647[_0xe01f('0x110')]+='x';}if(_0x370647['opts'][_0xe01f('0x175')]('X')<0x0){_0x370647[_0xe01f('0x110')]+='X';}this[_0xe01f('0x37')][_0xe01f('0xa0')](_0xe01f('0x176'),_0x34ea47?_0x34ea47[_0xe01f('0x177')]():'');var _0xa1ec2=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0x178'),[_0x34ea47,_0x370647[_0xe01f('0x110')],_0x370647[_0xe01f('0x67')],_0x15058c,_0x370647[_0xe01f('0x69')],_0x370647[_0xe01f('0x6')],_0x370647[_0xe01f('0x179')],_0x370647[_0xe01f('0x17a')],'',_0x370647[_0xe01f('0x17b')]]);if(_0xa1ec2[_0xe01f('0xa5')]===-0x1){return _0xa1ec2;}return this[_0xe01f('0x37')][_0xe01f('0xab')](util['format'](_0xe01f('0xc5'),_0xe01f('0x178'),_0x34ea47));};AGIVertices[_0xe01f('0xe')]['record']=function(_0x5963fe){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x5963fe[_0xe01f('0x38')]));var _0x23b29a=_0x5963fe[_0xe01f('0x17c')]||_0xe01f('0x135');var _0x4d8f0b=util[_0xe01f('0x26')](_0xe01f('0x17d'),this[_0xe01f('0x37')]['uniqueid'],rs['generate'](0x5));var _0x1aaeba=util[_0xe01f('0x26')](_0xe01f('0x17e'),FILES_PATH,_0x4d8f0b,_0x23b29a);var _0x608a3a=util[_0xe01f('0x26')](_0xe01f('0x13f'),FILES_PATH,_0x4d8f0b);this[_0xe01f('0x3b')]['sync'](this,_0x5963fe,_0x4d8f0b,_0x1aaeba);this['channel'][_0xe01f('0xa0')]('RECORDING_SAVENAME',_0x4d8f0b);logger[_0xe01f('0x2c')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x608a3a,_0x23b29a,_0x5963fe[_0xe01f('0x17f')],_0x5963fe[_0xe01f('0x69')]);return this[_0xe01f('0x37')][_0xe01f('0x138')](_0x608a3a,_0x23b29a,_0x5963fe[_0xe01f('0x17f')],_0x5963fe[_0xe01f('0x69')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x1a67ee){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x180'),_0x1a67ee[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x1a67ee[_0xe01f('0x67')])){return this[_0xe01f('0x37')][_0xe01f('0xab')]('no\x20url\x20configured');}var _0xbc15e8=this['restAPI'][_0xe01f('0x72')](this,_0x1a67ee);logger['info'](util[_0xe01f('0x26')]('Response:',util['inspect'](_0xbc15e8,{'showHidden':![],'depth':null})));if(!this[_0xe01f('0xa8')](_0x1a67ee['variable_id'])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x181'));}var _0x301854=this[_0xe01f('0xf')]['sync'](this,_0x1a67ee[_0xe01f('0xd9')]);if(!_0x301854){return this[_0xe01f('0x37')]['error'](_0x1a67ee,_0xe01f('0xdb'));}this[_0xe01f('0x37')][_0xe01f('0xa0')](util[_0xe01f('0x26')](_0xe01f('0x182'),_0x301854),_0xbc15e8[_0xe01f('0x78')]?_0xbc15e8['statusCode']:_0xe01f('0x183'));this[_0xe01f('0x37')][_0xe01f('0xa0')](util['format']('%s_STATUS_MESSAGE',_0x301854),_0xbc15e8['statusMessage']?_0xbc15e8[_0xe01f('0x79')]:'OK');if(_0xbc15e8[_0xe01f('0x76')]){try{this[_0xe01f('0x9f')](_0xbc15e8['body'],_0x301854);}catch(_0xfaf156){logger['error'](util[_0xe01f('0x26')](_0xe01f('0x184'),_0x301854));}}return this[_0xe01f('0x37')][_0xe01f('0xab')](util['format'](_0xe01f('0x185'),_0x301854));};AGIVertices[_0xe01f('0xe')]['saydigits']=function(_0x9783cc){logger['info'](util[_0xe01f('0x26')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x9783cc[_0xe01f('0x38')]));return this['channel'][_0xe01f('0x186')](_0x9783cc[_0xe01f('0x187')][_0xe01f('0x59')](/\s+/g,''),_0x9783cc[_0xe01f('0x17f')]);};AGIVertices['prototype'][_0xe01f('0x188')]=function(_0x4aea88){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x189'),_0x4aea88[_0xe01f('0x38')]));return this[_0xe01f('0x37')][_0xe01f('0x18a')](_0x4aea88[_0xe01f('0x6a')][_0xe01f('0x59')](/\s+/g,''),_0x4aea88[_0xe01f('0x17f')]);};AGIVertices[_0xe01f('0xe')][_0xe01f('0x18b')]=function(_0x3b8de5){logger['info'](util['format'](_0xe01f('0x18c'),_0x3b8de5['label']));return this[_0xe01f('0x37')][_0xe01f('0x18d')](_0x3b8de5['text'],_0x3b8de5[_0xe01f('0x17f')]);};AGIVertices[_0xe01f('0xe')][_0xe01f('0x18e')]=function(_0x358b92){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x358b92['label']));if(!this[_0xe01f('0xa8')](_0x358b92[_0xe01f('0x18f')])){return this[_0xe01f('0x37')][_0xe01f('0xab')]('no\x20mail\x20account\x20configured');}var _0x1ad58e=this['getMailAccount'][_0xe01f('0x72')](this,_0x358b92['account_id']);if(!_0x1ad58e||!_0x1ad58e[_0xe01f('0x190')]){return this[_0xe01f('0x37')]['error'](_0x358b92,_0xe01f('0x191'));}var _0x57b083={'from':util[_0xe01f('0x26')]('\x22%s\x22\x20<%s>',_0x1ad58e[_0xe01f('0x12')],_0x1ad58e[_0xe01f('0x192')]||_0x1ad58e[_0xe01f('0x190')][_0xe01f('0x193')]),'to':_0x358b92['to']||'','cc':_0x358b92['cc']||'','bcc':_0x358b92[_0xe01f('0x194')]||'','subject':_0x358b92[_0xe01f('0x195')],'html':_0x358b92[_0xe01f('0x5d')],'text':_0x358b92[_0xe01f('0x5d')]};if(this[_0xe01f('0xa8')](_0x358b92['template_id'])){}logger['debug'](_0xe01f('0x196'),JSON[_0xe01f('0x75')](_0x57b083));this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x358b92,_0x358b92[_0xe01f('0x18f')]);this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x1ad58e[_0xe01f('0x12')]));this[_0xe01f('0x20')][_0xe01f('0x72')](this,_0x1ad58e['smtpOptions'],_0x57b083);return this[_0xe01f('0x37')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xe01f('0xe')]['sendFax']=function(_0x1eabdb){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x197'),_0x1eabdb[_0xe01f('0x38')]));return this['channel'][_0xe01f('0xab')](_0xe01f('0x198'));};AGIVertices[_0xe01f('0xe')]['sendSMS']=function(_0x26f7cf){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x199'),_0x26f7cf[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x26f7cf[_0xe01f('0x19a')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x19b'));}var _0x24d812=this[_0xe01f('0x33')]['sync'](this,_0x26f7cf[_0xe01f('0x19a')]);if(!_0x24d812){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x26f7cf,_0xe01f('0x19c'));}var _0x4858f6={'body':_0x26f7cf[_0xe01f('0x19d')],'phone':_0x26f7cf['to']||'','SmsAccountId':_0x24d812['id']};logger[_0xe01f('0xe1')](_0xe01f('0x19e'),JSON['stringify'](_0x4858f6));this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x26f7cf,_0x26f7cf[_0xe01f('0x19a')]);this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x19f'),_0x24d812[_0xe01f('0x12')]));this['createSmsMessage']['sync'](this,_0x4858f6);return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x1a0'));};AGIVertices[_0xe01f('0xe')][_0xe01f('0x1a1')]=function(_0x5c0b1d){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x1a2'),_0x5c0b1d[_0xe01f('0x38')]));if(!this['isConfigured'](_0x5c0b1d[_0xe01f('0xd9')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5c0b1d,'no\x20variable\x20selected');}var _0x3b9657=this[_0xe01f('0xf')]['sync'](this,_0x5c0b1d['variable_id']);if(!_0x3b9657){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5c0b1d,'no\x20variable\x20found');}return this['channel'][_0xe01f('0xa0')](_0x3b9657,_0x5c0b1d[_0xe01f('0x1a3')]);};AGIVertices[_0xe01f('0xe')][_0xe01f('0x1a4')]=function(_0x5a29fe){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x1a5'),_0x5a29fe[_0xe01f('0x38')]));this['channel'][_0xe01f('0xab')](_0xe01f('0x1a6'));var _0x2533dd=this[_0xe01f('0x37')]['getVariable'](_0xe01f('0x1a7'));if(!_['isEmpty'](_0x2533dd[_0xe01f('0xa7')])){this[_0xe01f('0x37')]['uniqueid']=_0x2533dd[_0xe01f('0xa7')];}if(_0x5a29fe[_0xe01f('0xb9')]==='yes'){this['channel'][_0xe01f('0xab')](_0xe01f('0x1a8'));return this[_0xe01f('0x37')][_0xe01f('0xb9')]();}return this[_0xe01f('0x37')][_0xe01f('0xab')]('Skipped\x20Answer');};AGIVertices['prototype'][_0xe01f('0x1a9')]=function(_0x4da413){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x1aa'),_0x4da413[_0xe01f('0x38')]));if(!this['isConfigured'](_0x4da413['project_id'])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x4da413,_0xe01f('0x1ab'));}var _0x11c807=this[_0xe01f('0x1ac')][_0xe01f('0x72')](this,_0x4da413[_0xe01f('0x1ad')]);if(!this[_0xe01f('0xa8')](_0x11c807)){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x4da413,util[_0xe01f('0x26')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x4da413[_0xe01f('0x1ad')]));}if(_0x11c807===this[_0xe01f('0x37')][_0xe01f('0x1ae')]){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x4da413,_0xe01f('0x1af'));}this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x4da413,_0x11c807);var _0x3360e7=this['channel'][_0xe01f('0xac')]('AGI',util[_0xe01f('0x26')](_0xe01f('0x1b0'),config[_0xe01f('0x6')][_0xe01f('0x1b1')]||_0xe01f('0x1b2'),_0x11c807,this[_0xe01f('0x37')][_0xe01f('0x1ae')]));if(_0x3360e7[_0xe01f('0xa5')]===-0x1){return _0x3360e7;}return this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')](_0xe01f('0xc5'),_0xe01f('0x1b3'),_0x11c807));};AGIVertices['prototype'][_0xe01f('0x1b4')]=function(_0x284294){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x1b5'),_0x284294[_0xe01f('0x38')]));var _0x10e62a=this['shellCommand']['sync'](this,_0x284294['command']);this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x284294,_0x284294[_0xe01f('0x1b6')]);if(this['isConfigured'](_0x284294['variable_id'])){var _0x4f73d5=this['getVariable'][_0xe01f('0x72')](this,_0x284294[_0xe01f('0xd9')]);if(_0x4f73d5){this[_0xe01f('0x37')]['setVariable'](_0x4f73d5,_0x10e62a);return this[_0xe01f('0x37')][_0xe01f('0xab')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x284294[_0xe01f('0x1b6')],_0x4f73d5));}}return this['channel']['noop'](util['format'](_0xe01f('0x1b7'),_0x284294[_0xe01f('0x1b6')]));};AGIVertices[_0xe01f('0xe')][_0xe01f('0x1b8')]=function(_0x57e6b0){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x1b9'),_0x57e6b0[_0xe01f('0x38')]));_0x57e6b0['text']=_0x57e6b0['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xe01f('0xa8')](_0x57e6b0['apiKey'])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x1ba'));}if(!this[_0xe01f('0xa8')](_0x57e6b0[_0xe01f('0x5d')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xc8'));}this['channel']['noop'](util[_0xe01f('0x26')](_0xe01f('0x1bb'),_0x57e6b0['text']));var _0x2a7e94=this[_0xe01f('0x5a')][_0xe01f('0x72')](this,_0x57e6b0);if(_0x2a7e94){this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2a7e94));var _0x3908d0=this[_0xe01f('0x37')][_0xe01f('0x105')](_0x2a7e94);try{fs['unlink'](_0x2a7e94+'.wav');}catch(_0xf35d2c){logger['error'](_0xf35d2c);}return _0x3908d0;}return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x57e6b0,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['tts']=function(_0x576d78){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x1bc'),_0x576d78[_0xe01f('0x38')]));_0x576d78['text']=_0x576d78['text'][_0xe01f('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x576d78['text'])){return this['channel'][_0xe01f('0xab')](_0xe01f('0xc8'));}this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x1bd'),_0x576d78[_0xe01f('0x5d')]));var _0x255ec5=this[_0xe01f('0x64')][_0xe01f('0x72')](this,_0x576d78);if(_0x255ec5){this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')]('Google\x20TTS\x20%s\x20file\x20created',_0x255ec5));var _0x4b5da1=this['channel'][_0xe01f('0x105')](_0x255ec5);try{fs[_0xe01f('0x106')](_0x255ec5+'.wav');}catch(_0x87c80){logger[_0xe01f('0x2a')](_0x87c80);}return _0x4b5da1;}return this['channel'][_0xe01f('0x2a')](_0x576d78,_0xe01f('0x1be'));};AGIVertices[_0xe01f('0xe')][_0xe01f('0x1bf')]=function(_0x1fff23){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x1c0'),_0x1fff23['label']));if(!this[_0xe01f('0xa8')](_0x1fff23[_0xe01f('0x15a')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x1fff23,_0xe01f('0x162'));}logger['info'](util[_0xe01f('0x26')](_0xe01f('0x15b'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x1fff23[_0xe01f('0x15a')]));var _0x18a0b9=this[_0xe01f('0x52')][_0xe01f('0x72')](this,_0x1fff23['findBy']);if(_0x18a0b9){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x1fff23['findBy']));this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this['channel']['callerid'],_0x1fff23[_0xe01f('0x15a')]));return{'code':0xc8,'result':_0xe01f('0x15d')};}else{logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xe01f('0x3a')],_0x1fff23[_0xe01f('0x15a')]));this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x15e'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x1fff23['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe01f('0xe')]['voicemail']=function(_0x1ea260){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x1c1'),_0x1ea260[_0xe01f('0x38')]));var _0x4ee380=this['channel'][_0xe01f('0xac')](_0xe01f('0x1c2'),[_0x1ea260[_0xe01f('0x1c3')],_0x1ea260[_0xe01f('0x7c')]]);if(_0x4ee380[_0xe01f('0xa5')]===-0x1){return _0x4ee380;}return this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')](_0xe01f('0xc5'),_0xe01f('0x1c2'),_0x1ea260[_0xe01f('0x1c3')]));};AGIVertices[_0xe01f('0xe')]['vswitch']=function(_0x1b51d6){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x1b51d6[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x1b51d6[_0xe01f('0xd9')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x1b51d6,_0xe01f('0x1c4'));}var _0x20c87e=this[_0xe01f('0xf')][_0xe01f('0x72')](this,_0x1b51d6[_0xe01f('0xd9')]);if(!_0x20c87e){return this['channel'][_0xe01f('0x2a')](_0x1b51d6,_0xe01f('0xdb'));}var _0x2586ac=this[_0xe01f('0x37')]['getVariable'](_0x20c87e);return{'code':0xc8,'result':_0x2586ac[_0xe01f('0xa7')]?_0x2586ac[_0xe01f('0xa7')]:'-'};};String['prototype'][_0xe01f('0xa3')]=function(_0x2f3ba4,_0x222341){return this[_0xe01f('0xa2')](_0x2f3ba4)[_0xe01f('0x1c5')](_0x222341);};module[_0xe01f('0x1c6')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index c5d334d..dedb923 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 _0x24b1=['[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','timers','lastPauseAt','timer','update','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','resolve','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','uniqueid','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','pauseType','ACW','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','[%s][HANGUP:LINKEDID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]'];(function(_0x3c5bff,_0x3ba4d2){var _0x4789f3=function(_0x24745c){while(--_0x24745c){_0x3c5bff['push'](_0x3c5bff['shift']());}};_0x4789f3(++_0x3ba4d2);}(_0x24b1,0x11b));var _0x124b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x24b1[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var moment=require(_0x124b('0x0'));var ami=require('../ami');var logger=require(_0x124b('0x1'))(_0x124b('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x124b('0x3'));function Acw(_0x1d72c5){this[_0x124b('0x4')]=_0x1d72c5['voiceQueues'];this[_0x124b('0x5')]=_0x1d72c5['agents'];this['timers']=_0x1d72c5['timers'];this[_0x124b('0x6')]={};ami['on'](_0x124b('0x7'),this[_0x124b('0x8')][_0x124b('0x9')](this));ami['on'](_0x124b('0xa'),this[_0x124b('0xb')][_0x124b('0x9')](this));ami['on'](_0x124b('0xc'),this[_0x124b('0xd')][_0x124b('0x9')](this));ami['on'](_0x124b('0xe'),this[_0x124b('0xf')][_0x124b('0x9')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x124b('0x9')](this));ami['on'](_0x124b('0x10'),this['syncBlindTransfer'][_0x124b('0x9')](this));ami['on'](_0x124b('0x11'),this[_0x124b('0x12')][_0x124b('0x9')](this));}function getDiff(_0x49fde7){var _0x5d062a=moment()[_0x124b('0x13')](0x0);var _0x1a9273=moment(_0x49fde7)[_0x124b('0x13')](0x0);return _0x5d062a[_0x124b('0x14')](_0x1a9273,_0x124b('0x15'));}Acw[_0x124b('0x16')][_0x124b('0x17')]=function(_0x58dab8,_0x3d3e08){var _0x2dcafd=this;var _0x35f206=getDiff(_0x2dcafd[_0x124b('0x18')][_0x58dab8][_0x124b('0x19')]);clearTimeout(_0x2dcafd[_0x124b('0x18')][_0x58dab8]['timer']);_0x2dcafd[_0x124b('0x18')][_0x58dab8][_0x124b('0x1a')]=![];return RpcVoiceAgentReport[_0x124b('0x1b')]({'acwtime':_0x35f206},_0x2dcafd['timers'][_0x58dab8]['uniqueid'],_0x58dab8)[_0x124b('0x1c')](function(_0x108cd7){logger[_0x124b('0x1d')](_0x124b('0x1e'),_0x3d3e08,_0x35f206,_0x108cd7);})[_0x124b('0x1f')](function(_0x5eb047){logger[_0x124b('0x20')](_0x124b('0x21'),_0x3d3e08,_0x5eb047);})[_0x124b('0x22')](function(){delete _0x2dcafd['timers'][_0x58dab8];});};Acw[_0x124b('0x16')][_0x124b('0x23')]=function(_0x185fa2){try{var _0x4414de=this;var _0x4290f1=this['channels'][_0x185fa2][_0x124b('0x24')];var _0x1e3871=this[_0x124b('0x6')][_0x185fa2][_0x124b('0x25')];var _0x4d80a6=this[_0x124b('0x4')][_0x1e3871];var _0x3bff1d=![];var _0x15185a='ACW';if(_0x4d80a6[_0x124b('0x26')]&&_0x4d80a6[_0x124b('0x27')]['name']){_0x3bff1d=!![];_0x15185a=_0x4d80a6[_0x124b('0x27')]['name'];}if(!_0x4414de[_0x124b('0x5')][_0x4290f1]){return Promise[_0x124b('0x28')]();}return RpcUser[_0x124b('0x29')](_0x4414de[_0x124b('0x5')][_0x4290f1]['id'])[_0x124b('0x1c')](function(_0x14079b){if(!_0x14079b||_0x14079b[_0x124b('0x2a')]){logger[_0x124b('0x1d')](_0x124b('0x2b'),_0x185fa2,_0x4290f1,_0x1e3871);return;}logger[_0x124b('0x1d')](_0x124b('0x2c'),_0x185fa2,_0x4290f1,_0x1e3871);var _0x3029ac=_0x4414de['channels'][_0x185fa2][_0x124b('0x2d')]&&_0x4414de[_0x124b('0x6')][_0x185fa2]['destlinkedid']?_0x4414de[_0x124b('0x6')][_0x185fa2][_0x124b('0x2e')]:_0x185fa2;return RpcUser[_0x124b('0x2f')](_0x4414de[_0x124b('0x5')][_0x4290f1],_0x15185a,_0x3029ac)[_0x124b('0x1c')](function(_0x1bb898){_0x4414de['voiceQueues'][_0x1e3871][_0x124b('0x30')]-=0x1;_0x4414de[_0x124b('0x4')][_0x1e3871]['paused']+=0x1;return _0x1bb898;});})[_0x124b('0x1c')](function(_0x48581f){if(_0x3bff1d||!_0x48581f){return;}_0x4414de['timers'][_0x4290f1]={};logger[_0x124b('0x1d')](_0x124b('0x31'),_0x185fa2,_0x4414de[_0x124b('0x4')][_0x1e3871][_0x124b('0x32')],_0x4290f1,_0x1e3871);_0x4414de[_0x124b('0x18')][_0x4290f1][_0x124b('0x1a')]=setTimeout(_0x4414de[_0x124b('0x33')][_0x124b('0x9')](_0x4414de,_0x4290f1),_0x4414de[_0x124b('0x4')][_0x1e3871][_0x124b('0x32')]*0x3e8);_0x4414de[_0x124b('0x18')][_0x4290f1][_0x124b('0x19')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4414de['timers'][_0x4290f1][_0x124b('0x34')]=_0x185fa2;_0x4414de[_0x124b('0x18')][_0x4290f1][_0x124b('0x25')]=_0x1e3871;_0x4414de['timers'][_0x4290f1]['updateAcw']=_0x4414de[_0x124b('0x17')]['bind'](_0x4414de,_0x4290f1,_0x185fa2);})[_0x124b('0x1f')](function(){logger['error'](_0x124b('0x31'),_0x185fa2,_0x4414de[_0x124b('0x4')][_0x1e3871][_0x124b('0x32')],_0x4290f1,_0x1e3871);})[_0x124b('0x22')](function(){delete _0x4414de[_0x124b('0x6')][_0x185fa2];});}catch(_0x59e4c1){logger['error'](_0x124b('0x35'),_0x59e4c1['message']);}};Acw[_0x124b('0x16')][_0x124b('0x33')]=function(_0x3e44bb){try{var _0x5167f3=this;if(_0x5167f3[_0x124b('0x18')][_0x3e44bb]){_0x5167f3[_0x124b('0x18')][_0x3e44bb][_0x124b('0x1a')]=![];var _0x1522c5=_0x5167f3[_0x124b('0x18')][_0x3e44bb]['uniqueid'];var _0x182f04=_0x5167f3[_0x124b('0x18')][_0x3e44bb][_0x124b('0x25')];var _0xeb23e8=_0x5167f3[_0x124b('0x4')][_0x182f04]['acwTimeout'];logger[_0x124b('0x1d')](_0x124b('0x36'),_0x1522c5,_0x3e44bb);RpcUser[_0x124b('0x29')](this['agents'][_0x3e44bb]['id'])[_0x124b('0x1c')](function(_0x281fe0){if(_0x281fe0[_0x124b('0x37')]===_0x124b('0x38')){return RpcUser[_0x124b('0x39')](_0x5167f3[_0x124b('0x5')][_0x3e44bb]);}});RpcVoiceAgentReport[_0x124b('0x1b')]({'acwtime':_0xeb23e8,'agentacw':!![]},_0x1522c5,_0x3e44bb)[_0x124b('0x1c')](function(_0x30b82b){logger[_0x124b('0x1d')](_0x124b('0x1e'),_0x1522c5,_0xeb23e8,_0x30b82b);})['catch'](function(_0x47a16c){logger['error'](_0x124b('0x21'),_0x1522c5,_0x47a16c);});}else{logger['error'](_0x124b('0x3a'),_0x3e44bb);if(_0x5167f3[_0x124b('0x18')]){logger[_0x124b('0x1d')](_0x124b('0x3b'),JSON[_0x124b('0x3c')](_0x5167f3['timers']));}}}catch(_0x2e5562){logger[_0x124b('0x20')](_0x124b('0x3d'),_0x2e5562['message']);}};Acw[_0x124b('0x16')][_0x124b('0x8')]=function(_0x42b55b){try{if(this[_0x124b('0x4')][_0x42b55b[_0x124b('0x25')]]&&(this['voiceQueues'][_0x42b55b[_0x124b('0x25')]][_0x124b('0x2')]||this['voiceQueues'][_0x42b55b[_0x124b('0x25')]]['mandatoryDisposition'])){if(this[_0x124b('0x5')][_0x42b55b[_0x124b('0x24')]]){this[_0x124b('0x6')][_0x42b55b[_0x124b('0x34')]]={'queue':_0x42b55b['queue'],'interface':_0x42b55b[_0x124b('0x24')],'destlinkedid':_0x42b55b[_0x124b('0x2e')]};}}}catch(_0xf58b7a){logger[_0x124b('0x20')]('[ACW][syncAgentConnect]\x20%s',_0xf58b7a[_0x124b('0x3e')]);}};Acw[_0x124b('0x16')][_0x124b('0x12')]=function(_0x1bb9f0){try{if(this[_0x124b('0x4')][_0x1bb9f0['queue']]&&(this['voiceQueues'][_0x1bb9f0[_0x124b('0x25')]]['acw']||this[_0x124b('0x4')][_0x1bb9f0[_0x124b('0x25')]][_0x124b('0x26')])){if(this['agents'][_0x1bb9f0[_0x124b('0x24')]]){this[_0x124b('0x6')][_0x1bb9f0['uniqueid']]={'queue':_0x1bb9f0[_0x124b('0x25')],'interface':_0x1bb9f0[_0x124b('0x24')]};}}}catch(_0xef4c6e){logger[_0x124b('0x20')](_0x124b('0x3f'),_0xef4c6e[_0x124b('0x3e')]);}};Acw['prototype'][_0x124b('0xb')]=function(_0x211bf9){try{if(this['channels'][_0x211bf9[_0x124b('0x34')]]&&_['isUndefined'](this[_0x124b('0x6')][_0x211bf9['uniqueid']][_0x124b('0x2d')])){logger['info'](_0x124b('0x40'),_0x211bf9[_0x124b('0x34')]);this[_0x124b('0x23')](_0x211bf9[_0x124b('0x34')]);}else if(this[_0x124b('0x6')][_0x211bf9['linkedid']]&&_['isUndefined'](this[_0x124b('0x6')][_0x211bf9['linkedid']][_0x124b('0x2d')])){logger['info'](_0x124b('0x41'),_0x211bf9['linkedid']);this[_0x124b('0x23')](_0x211bf9[_0x124b('0x42')]);}}catch(_0x5cf5e2){logger['error'](_0x124b('0x43'),_0x5cf5e2[_0x124b('0x3e')]);}};Acw[_0x124b('0x16')][_0x124b('0xd')]=function(_0x163025){try{if(this[_0x124b('0x6')][_0x163025[_0x124b('0x34')]]&&this[_0x124b('0x6')][_0x163025[_0x124b('0x34')]][_0x124b('0x2d')]){logger[_0x124b('0x1d')](_0x124b('0x44'),_0x163025[_0x124b('0x34')]);this[_0x124b('0x23')](_0x163025[_0x124b('0x34')]);}else if(this[_0x124b('0x6')][_0x163025['linkedid']]&&this[_0x124b('0x6')][_0x163025[_0x124b('0x42')]][_0x124b('0x2d')]){logger[_0x124b('0x1d')](_0x124b('0x45'),_0x163025['linkedid']);this[_0x124b('0x23')](_0x163025[_0x124b('0x42')]);}}catch(_0x17000f){logger[_0x124b('0x20')](_0x124b('0x46'),_0x17000f[_0x124b('0x3e')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x42106e){try{if(!_[_0x124b('0x47')](this[_0x124b('0x6')][_0x42106e[_0x124b('0x48')]])){this[_0x124b('0x23')](_0x42106e[_0x124b('0x48')]);if(this[_0x124b('0x6')][_0x42106e[_0x124b('0x49')]]){this['channels'][_0x42106e[_0x124b('0x49')]][_0x124b('0x2d')]=!![];this[_0x124b('0x6')][_0x42106e[_0x124b('0x4a')]]=this[_0x124b('0x6')][_0x42106e[_0x124b('0x49')]];delete this[_0x124b('0x6')][_0x42106e[_0x124b('0x49')]];}}else if(!_[_0x124b('0x47')](this[_0x124b('0x6')][_0x42106e[_0x124b('0x4a')]])){this[_0x124b('0x23')](_0x42106e[_0x124b('0x4a')]);if(this['channels'][_0x42106e[_0x124b('0x4b')]]){this[_0x124b('0x6')][_0x42106e[_0x124b('0x4b')]][_0x124b('0x2d')]=!![];this[_0x124b('0x6')][_0x42106e[_0x124b('0x48')]]=this[_0x124b('0x6')][_0x42106e[_0x124b('0x4b')]];delete this[_0x124b('0x6')][_0x42106e[_0x124b('0x4b')]];}}}catch(_0x44d9ad){logger[_0x124b('0x20')](_0x124b('0x4c'),_0x44d9ad['message']);}};Acw['prototype'][_0x124b('0x4d')]=function(_0x3cae14){try{if(this[_0x124b('0x6')][_0x3cae14['transfereruniqueid']]){logger[_0x124b('0x1d')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x124b('0x3c')](_0x3cae14[_0x124b('0x4e')]));this[_0x124b('0x23')](_0x3cae14[_0x124b('0x4e')]);}else if(this[_0x124b('0x6')][_0x3cae14[_0x124b('0x4f')]]){logger[_0x124b('0x1d')](_0x124b('0x50'),JSON['stringify'](_0x3cae14[_0x124b('0x4f')]));this[_0x124b('0x23')](_0x3cae14[_0x124b('0x4f')]);}}catch(_0xc19d6a){logger[_0x124b('0x20')](_0x124b('0x51'),_0xc19d6a['message']);}};Acw[_0x124b('0x16')]['syncAgentRingNoAnswer']=function(_0x5c898f){try{if(this['voiceQueues'][_0x5c898f[_0x124b('0x25')]]&&this[_0x124b('0x4')][_0x5c898f[_0x124b('0x25')]][_0x124b('0x52')]===_0x124b('0x53')){if(this[_0x124b('0x5')][_0x5c898f[_0x124b('0x24')]]){logger[_0x124b('0x1d')](_0x124b('0x54'),_0x5c898f[_0x124b('0x34')],_0x5c898f[_0x124b('0x24')],_0x5c898f[_0x124b('0x25')]);return RpcUser['savePause'](this['agents'][_0x5c898f[_0x124b('0x24')]],_0x124b('0x55'),_0x5c898f[_0x124b('0x34')]);}}}catch(_0x23bc4b){logger['error'](_0x124b('0x56'),_0x23bc4b[_0x124b('0x3e')]);}};module[_0x124b('0x57')]=Acw; \ No newline at end of file +var _0xa617=['updateAcw','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','message','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','timers','timer','update','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','available','paused','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x9b78fa,_0x529770){var _0x2f9c14=function(_0x1bdff5){while(--_0x1bdff5){_0x9b78fa['push'](_0x9b78fa['shift']());}};_0x2f9c14(++_0x529770);}(_0xa617,0xd8));var _0x7a61=function(_0xe8f345,_0xb10506){_0xe8f345=_0xe8f345-0x0;var _0x12e8d6=_0xa617[_0xe8f345];return _0x12e8d6;};'use strict';var _=require('lodash');var moment=require(_0x7a61('0x0'));var ami=require(_0x7a61('0x1'));var logger=require(_0x7a61('0x2'))(_0x7a61('0x3'));var RpcUser=require(_0x7a61('0x4'));var RpcVoiceAgentReport=require(_0x7a61('0x5'));function Acw(_0x1e5394){this[_0x7a61('0x6')]=_0x1e5394[_0x7a61('0x6')];this[_0x7a61('0x7')]=_0x1e5394['agents'];this['timers']=_0x1e5394['timers'];this[_0x7a61('0x8')]={};ami['on'](_0x7a61('0x9'),this[_0x7a61('0xa')][_0x7a61('0xb')](this));ami['on'](_0x7a61('0xc'),this[_0x7a61('0xd')][_0x7a61('0xb')](this));ami['on'](_0x7a61('0xe'),this['syncHangup'][_0x7a61('0xb')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x7a61('0xb')](this));ami['on'](_0x7a61('0xf'),this[_0x7a61('0x10')][_0x7a61('0xb')](this));ami['on'](_0x7a61('0x11'),this[_0x7a61('0x12')][_0x7a61('0xb')](this));ami['on'](_0x7a61('0x13'),this[_0x7a61('0x14')][_0x7a61('0xb')](this));}function getDiff(_0x88c0da){var _0x35d8f2=moment()[_0x7a61('0x15')](0x0);var _0x3af077=moment(_0x88c0da)[_0x7a61('0x15')](0x0);return _0x35d8f2[_0x7a61('0x16')](_0x3af077,_0x7a61('0x17'));}Acw[_0x7a61('0x18')]['updateAcw']=function(_0x50c8b5,_0x1bd161){var _0x2e2961=this;var _0x4040ea=getDiff(_0x2e2961[_0x7a61('0x19')][_0x50c8b5]['lastPauseAt']);clearTimeout(_0x2e2961[_0x7a61('0x19')][_0x50c8b5][_0x7a61('0x1a')]);_0x2e2961[_0x7a61('0x19')][_0x50c8b5][_0x7a61('0x1a')]=![];return RpcVoiceAgentReport[_0x7a61('0x1b')]({'acwtime':_0x4040ea},_0x2e2961[_0x7a61('0x19')][_0x50c8b5][_0x7a61('0x1c')],_0x50c8b5)[_0x7a61('0x1d')](function(_0xa290c1){logger[_0x7a61('0x1e')](_0x7a61('0x1f'),_0x1bd161,_0x4040ea,_0xa290c1);})[_0x7a61('0x20')](function(_0x4855c3){logger[_0x7a61('0x21')](_0x7a61('0x22'),_0x1bd161,_0x4855c3);})[_0x7a61('0x23')](function(){delete _0x2e2961['timers'][_0x50c8b5];});};Acw[_0x7a61('0x18')][_0x7a61('0x24')]=function(_0x267985){try{var _0x4cb2c7=this;var _0xb837df=this[_0x7a61('0x8')][_0x267985][_0x7a61('0x25')];var _0x3cbfba=this[_0x7a61('0x8')][_0x267985][_0x7a61('0x26')];var _0x5defb4=this[_0x7a61('0x6')][_0x3cbfba];var _0x67cddd=![];var _0x27e22b=_0x7a61('0x27');if(_0x5defb4[_0x7a61('0x28')]&&_0x5defb4['mandatoryDispositionPause'][_0x7a61('0x29')]){_0x67cddd=!![];_0x27e22b=_0x5defb4[_0x7a61('0x2a')][_0x7a61('0x29')];}if(!_0x4cb2c7[_0x7a61('0x7')][_0xb837df]){return Promise['resolve']();}return RpcUser[_0x7a61('0x2b')](_0x4cb2c7['agents'][_0xb837df]['id'])[_0x7a61('0x1d')](function(_0x5235dd){if(!_0x5235dd||_0x5235dd[_0x7a61('0x2c')]){logger[_0x7a61('0x1e')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x267985,_0xb837df,_0x3cbfba);return;}logger[_0x7a61('0x1e')](_0x7a61('0x2d'),_0x267985,_0xb837df,_0x3cbfba);var _0x2ba477=_0x4cb2c7[_0x7a61('0x8')][_0x267985]['attended']&&_0x4cb2c7['channels'][_0x267985][_0x7a61('0x2e')]?_0x4cb2c7[_0x7a61('0x8')][_0x267985]['destlinkedid']:_0x267985;return RpcUser[_0x7a61('0x2f')](_0x4cb2c7[_0x7a61('0x7')][_0xb837df],_0x27e22b,_0x2ba477)[_0x7a61('0x1d')](function(_0x56345c){_0x4cb2c7[_0x7a61('0x6')][_0x3cbfba][_0x7a61('0x30')]-=0x1;_0x4cb2c7[_0x7a61('0x6')][_0x3cbfba][_0x7a61('0x31')]+=0x1;return _0x56345c;});})[_0x7a61('0x1d')](function(_0x31d884){if(_0x67cddd||!_0x31d884){return;}_0x4cb2c7['timers'][_0xb837df]={};logger[_0x7a61('0x1e')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x267985,_0x4cb2c7['voiceQueues'][_0x3cbfba][_0x7a61('0x32')],_0xb837df,_0x3cbfba);_0x4cb2c7['timers'][_0xb837df][_0x7a61('0x1a')]=setTimeout(_0x4cb2c7[_0x7a61('0x33')][_0x7a61('0xb')](_0x4cb2c7,_0xb837df),_0x4cb2c7['voiceQueues'][_0x3cbfba]['acwTimeout']*0x3e8);_0x4cb2c7['timers'][_0xb837df]['lastPauseAt']=moment()[_0x7a61('0x34')](_0x7a61('0x35'));_0x4cb2c7[_0x7a61('0x19')][_0xb837df][_0x7a61('0x1c')]=_0x267985;_0x4cb2c7[_0x7a61('0x19')][_0xb837df][_0x7a61('0x26')]=_0x3cbfba;_0x4cb2c7[_0x7a61('0x19')][_0xb837df][_0x7a61('0x36')]=_0x4cb2c7[_0x7a61('0x36')][_0x7a61('0xb')](_0x4cb2c7,_0xb837df,_0x267985);})['catch'](function(){logger['error'](_0x7a61('0x37'),_0x267985,_0x4cb2c7[_0x7a61('0x6')][_0x3cbfba][_0x7a61('0x32')],_0xb837df,_0x3cbfba);})[_0x7a61('0x23')](function(){delete _0x4cb2c7[_0x7a61('0x8')][_0x267985];});}catch(_0x95bfea){logger[_0x7a61('0x21')]('[ACW][START]\x20%s',_0x95bfea['message']);}};Acw['prototype']['stopAcw']=function(_0x356f4e){try{var _0x41997c=this;if(_0x41997c[_0x7a61('0x19')][_0x356f4e]){_0x41997c[_0x7a61('0x19')][_0x356f4e][_0x7a61('0x1a')]=![];var _0x113cc3=_0x41997c[_0x7a61('0x19')][_0x356f4e]['uniqueid'];var _0x389edf=_0x41997c[_0x7a61('0x19')][_0x356f4e]['queue'];var _0x712cbc=_0x41997c[_0x7a61('0x6')][_0x389edf][_0x7a61('0x32')];logger[_0x7a61('0x1e')](_0x7a61('0x38'),_0x113cc3,_0x356f4e);RpcUser['getAgent'](this[_0x7a61('0x7')][_0x356f4e]['id'])[_0x7a61('0x1d')](function(_0x3ba541){if(_0x3ba541[_0x7a61('0x39')]==='ACW'){return RpcUser[_0x7a61('0x3a')](_0x41997c[_0x7a61('0x7')][_0x356f4e]);}});RpcVoiceAgentReport['update']({'acwtime':_0x712cbc,'agentacw':!![]},_0x113cc3,_0x356f4e)['then'](function(_0x393661){logger[_0x7a61('0x1e')](_0x7a61('0x1f'),_0x113cc3,_0x712cbc,_0x393661);})['catch'](function(_0x1578cd){logger[_0x7a61('0x21')](_0x7a61('0x22'),_0x113cc3,_0x1578cd);});}else{logger['error'](_0x7a61('0x3b'),_0x356f4e);if(_0x41997c[_0x7a61('0x19')]){logger[_0x7a61('0x1e')](_0x7a61('0x3c'),JSON[_0x7a61('0x3d')](_0x41997c[_0x7a61('0x19')]));}}}catch(_0x15b079){logger[_0x7a61('0x21')](_0x7a61('0x3e'),_0x15b079['message']);}};Acw[_0x7a61('0x18')]['syncAgentConnect']=function(_0x30d0ab){try{if(this['voiceQueues'][_0x30d0ab[_0x7a61('0x26')]]&&(this['voiceQueues'][_0x30d0ab['queue']]['acw']||this[_0x7a61('0x6')][_0x30d0ab[_0x7a61('0x26')]]['mandatoryDisposition'])){if(this[_0x7a61('0x7')][_0x30d0ab[_0x7a61('0x25')]]){this[_0x7a61('0x8')][_0x30d0ab[_0x7a61('0x1c')]]={'queue':_0x30d0ab[_0x7a61('0x26')],'interface':_0x30d0ab[_0x7a61('0x25')],'destlinkedid':_0x30d0ab[_0x7a61('0x2e')]};}}}catch(_0x5e0d5f){logger[_0x7a61('0x21')](_0x7a61('0x3f'),_0x5e0d5f[_0x7a61('0x40')]);}};Acw['prototype'][_0x7a61('0x14')]=function(_0x42d680){try{if(this['voiceQueues'][_0x42d680[_0x7a61('0x26')]]&&(this[_0x7a61('0x6')][_0x42d680[_0x7a61('0x26')]][_0x7a61('0x3')]||this[_0x7a61('0x6')][_0x42d680[_0x7a61('0x26')]]['mandatoryDisposition'])){if(this['agents'][_0x42d680[_0x7a61('0x25')]]){this['channels'][_0x42d680['uniqueid']]={'queue':_0x42d680[_0x7a61('0x26')],'interface':_0x42d680[_0x7a61('0x25')]};}}}catch(_0x49ba8a){logger[_0x7a61('0x21')](_0x7a61('0x41'),_0x49ba8a[_0x7a61('0x40')]);}};Acw['prototype'][_0x7a61('0xd')]=function(_0x2c16c1){try{if(this['channels'][_0x2c16c1[_0x7a61('0x1c')]]&&_[_0x7a61('0x42')](this[_0x7a61('0x8')][_0x2c16c1['uniqueid']][_0x7a61('0x43')])){logger[_0x7a61('0x1e')]('[%s][HANGUP:UNIQUEID]',_0x2c16c1['uniqueid']);this['startAcw'](_0x2c16c1[_0x7a61('0x1c')]);}else if(this[_0x7a61('0x8')][_0x2c16c1[_0x7a61('0x44')]]&&_[_0x7a61('0x42')](this['channels'][_0x2c16c1[_0x7a61('0x44')]]['attended'])){logger['info'](_0x7a61('0x45'),_0x2c16c1[_0x7a61('0x44')]);this[_0x7a61('0x24')](_0x2c16c1['linkedid']);}}catch(_0x113e88){logger[_0x7a61('0x21')]('[ACW][syncHangupRequest]\x20%s',_0x113e88['message']);}};Acw[_0x7a61('0x18')]['syncHangup']=function(_0x3b3641){try{if(this[_0x7a61('0x8')][_0x3b3641[_0x7a61('0x1c')]]&&this['channels'][_0x3b3641[_0x7a61('0x1c')]]['attended']){logger['info'](_0x7a61('0x46'),_0x3b3641[_0x7a61('0x1c')]);this[_0x7a61('0x24')](_0x3b3641[_0x7a61('0x1c')]);}else if(this[_0x7a61('0x8')][_0x3b3641['linkedid']]&&this['channels'][_0x3b3641['linkedid']][_0x7a61('0x43')]){logger[_0x7a61('0x1e')](_0x7a61('0x47'),_0x3b3641['linkedid']);this[_0x7a61('0x24')](_0x3b3641[_0x7a61('0x44')]);}}catch(_0x20a661){logger['error'](_0x7a61('0x48'),_0x20a661['message']);}};Acw[_0x7a61('0x18')][_0x7a61('0x10')]=function(_0x41e7b2){try{if(!_[_0x7a61('0x49')](this[_0x7a61('0x8')][_0x41e7b2[_0x7a61('0x4a')]])){this[_0x7a61('0x24')](_0x41e7b2[_0x7a61('0x4a')]);if(this[_0x7a61('0x8')][_0x41e7b2[_0x7a61('0x4b')]]){this[_0x7a61('0x8')][_0x41e7b2[_0x7a61('0x4b')]][_0x7a61('0x43')]=!![];this[_0x7a61('0x8')][_0x41e7b2[_0x7a61('0x4c')]]=this['channels'][_0x41e7b2['secondtransfereruniqueid']];delete this['channels'][_0x41e7b2[_0x7a61('0x4b')]];}}else if(!_[_0x7a61('0x49')](this[_0x7a61('0x8')][_0x41e7b2[_0x7a61('0x4c')]])){this['startAcw'](_0x41e7b2[_0x7a61('0x4c')]);if(this['channels'][_0x41e7b2[_0x7a61('0x4d')]]){this['channels'][_0x41e7b2[_0x7a61('0x4d')]][_0x7a61('0x43')]=!![];this['channels'][_0x41e7b2[_0x7a61('0x4a')]]=this[_0x7a61('0x8')][_0x41e7b2[_0x7a61('0x4d')]];delete this[_0x7a61('0x8')][_0x41e7b2[_0x7a61('0x4d')]];}}}catch(_0x4d7abe){logger[_0x7a61('0x21')](_0x7a61('0x4e'),_0x4d7abe[_0x7a61('0x40')]);}};Acw[_0x7a61('0x18')]['syncBlindTransfer']=function(_0x1ed397){try{if(this[_0x7a61('0x8')][_0x1ed397[_0x7a61('0x4f')]]){logger[_0x7a61('0x1e')](_0x7a61('0x50'),JSON[_0x7a61('0x3d')](_0x1ed397[_0x7a61('0x4f')]));this['startAcw'](_0x1ed397['transfereruniqueid']);}else if(this[_0x7a61('0x8')][_0x1ed397[_0x7a61('0x51')]]){logger[_0x7a61('0x1e')](_0x7a61('0x52'),JSON[_0x7a61('0x3d')](_0x1ed397['transfererlinkedid']));this[_0x7a61('0x24')](_0x1ed397[_0x7a61('0x51')]);}}catch(_0x2c0885){logger[_0x7a61('0x21')](_0x7a61('0x53'),_0x2c0885['message']);}};Acw[_0x7a61('0x18')][_0x7a61('0x54')]=function(_0x5504c7){try{if(this[_0x7a61('0x6')][_0x5504c7[_0x7a61('0x26')]]&&this[_0x7a61('0x6')][_0x5504c7['queue']][_0x7a61('0x55')]==='all'){if(this[_0x7a61('0x7')][_0x5504c7['interface']]){logger[_0x7a61('0x1e')](_0x7a61('0x56'),_0x5504c7[_0x7a61('0x1c')],_0x5504c7[_0x7a61('0x25')],_0x5504c7[_0x7a61('0x26')]);return RpcUser['savePause'](this[_0x7a61('0x7')][_0x5504c7[_0x7a61('0x25')]],_0x7a61('0x57'),_0x5504c7[_0x7a61('0x1c')]);}}}catch(_0x35ab4f){logger[_0x7a61('0x21')](_0x7a61('0x58'),_0x35ab4f['message']);}};module[_0x7a61('0x59')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 59a3c72..59f5e91 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 _0x68e5=['../../config/logger','asterisk','port','username','password','keepConnected','Action','promisify','action','error','format','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','info','inspect','fullybooted','resolve','then','catch','[ami.js][fullybooted]','close','exports','asterisk-manager','util'];(function(_0x13ea6c,_0x5a8ae8){var _0x3c0b66=function(_0x22332d){while(--_0x22332d){_0x13ea6c['push'](_0x13ea6c['shift']());}};_0x3c0b66(++_0x5a8ae8);}(_0x68e5,0x86));var _0x568e=function(_0xa4e726,_0x415201){_0xa4e726=_0xa4e726-0x0;var _0x4cfe2f=_0x68e5[_0xa4e726];return _0x4cfe2f;};'use strict';var Manager=require(_0x568e('0x0'));var BPromise=require('bluebird');var util=require(_0x568e('0x1'));var logger=require(_0x568e('0x2'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x568e('0x3')][_0x568e('0x4')],config['asterisk']['ip'],config['asterisk'][_0x568e('0x5')],config[_0x568e('0x3')][_0x568e('0x6')],!![]);ami[_0x568e('0x7')]();ami[_0x568e('0x8')]=BPromise[_0x568e('0x9')](ami[_0x568e('0xa')]);function error(_0x4668ef){logger[_0x568e('0xb')](util[_0x568e('0xc')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x568e('0x5')],config[_0x568e('0x3')]['ip'],config[_0x568e('0x3')][_0x568e('0x4')],util['inspect'](_0x4668ef,![],null)));}function close(){logger[_0x568e('0xb')](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x568e('0x3')]['username'],config[_0x568e('0x3')]['ip'],config[_0x568e('0x3')][_0x568e('0x4')]));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0x568e('0xd')});};};ami[_0x568e('0xe')]=function(){return function(){return ami[_0x568e('0x8')]({'action':_0x568e('0xf')});};};ami[_0x568e('0x10')]=function(){return function(){return ami['Action']({'action':_0x568e('0x11')});};};ami[_0x568e('0x12')]=function(){return function(){return ami['Action']({'action':_0x568e('0x13')});};};ami[_0x568e('0x14')]=function(){return function(){return ami[_0x568e('0x8')]({'action':_0x568e('0x15')});};};function connect(){logger['info'](util[_0x568e('0xc')](_0x568e('0x16'),config['asterisk']['username'],config[_0x568e('0x3')]['ip'],config[_0x568e('0x3')][_0x568e('0x4')]));ami[_0x568e('0x17')]('error',error);ami[_0x568e('0x17')]('close',close);}ami['on'](_0x568e('0x18'),connect);ami['on']('shutdown',function(_0x175bbb){logger[_0x568e('0x19')](util[_0x568e('0xc')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x568e('0x3')][_0x568e('0x5')],config[_0x568e('0x3')]['ip'],config[_0x568e('0x3')][_0x568e('0x4')],util[_0x568e('0x1a')](_0x175bbb,![],null)));});ami['on'](_0x568e('0x1b'),function(){logger[_0x568e('0x19')](util[_0x568e('0xc')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x568e('0x3')][_0x568e('0x5')],config['asterisk']['ip'],config[_0x568e('0x3')]['port']));return Promise[_0x568e('0x1c')]()[_0x568e('0x1d')](ami['actionSipShowRegistry']())[_0x568e('0x1d')](ami[_0x568e('0xe')]())[_0x568e('0x1d')](ami['actionSipPeerStatus']())[_0x568e('0x1d')](ami[_0x568e('0x12')]())[_0x568e('0x1d')](ami[_0x568e('0x14')]())[_0x568e('0x1e')](function(_0x243c6f){logger['error'](_0x568e('0x1f'),util[_0x568e('0x1a')](_0x243c6f,{'showHidden':![],'depth':null}));});});ami[_0x568e('0x17')](_0x568e('0xb'),error);ami['once'](_0x568e('0x20'),close);module[_0x568e('0x21')]=ami; \ No newline at end of file +var _0x4e20=['util','ami','asterisk','username','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch','[ami.js][fullybooted]','asterisk-manager','bluebird'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4e20,0x142));var _0x04e2=function(_0x11deef,_0x34bbdb){_0x11deef=_0x11deef-0x0;var _0xe9ba85=_0x4e20[_0x11deef];return _0xe9ba85;};'use strict';var Manager=require(_0x04e2('0x0'));var BPromise=require(_0x04e2('0x1'));var util=require(_0x04e2('0x2'));var logger=require('../../config/logger')(_0x04e2('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x04e2('0x4')]['port'],config[_0x04e2('0x4')]['ip'],config[_0x04e2('0x4')][_0x04e2('0x5')],config[_0x04e2('0x4')][_0x04e2('0x6')],!![]);ami['keepConnected']();ami[_0x04e2('0x7')]=BPromise[_0x04e2('0x8')](ami[_0x04e2('0x9')]);function error(_0xf3fbd4){logger[_0x04e2('0xa')](util['format'](_0x04e2('0xb'),config[_0x04e2('0x4')][_0x04e2('0x5')],config[_0x04e2('0x4')]['ip'],config[_0x04e2('0x4')][_0x04e2('0xc')],util[_0x04e2('0xd')](_0xf3fbd4,![],null)));}function close(){logger[_0x04e2('0xa')](util[_0x04e2('0xe')](_0x04e2('0xf'),config['asterisk'][_0x04e2('0x5')],config[_0x04e2('0x4')]['ip'],config[_0x04e2('0x4')]['port']));}ami[_0x04e2('0x10')]=function(){return function(){return ami['Action']({'action':_0x04e2('0x11')});};};ami[_0x04e2('0x12')]=function(){return function(){return ami['Action']({'action':_0x04e2('0x13')});};};ami[_0x04e2('0x14')]=function(){return function(){return ami['Action']({'action':_0x04e2('0x15')});};};ami[_0x04e2('0x16')]=function(){return function(){return ami[_0x04e2('0x7')]({'action':_0x04e2('0x17')});};};ami[_0x04e2('0x18')]=function(){return function(){return ami[_0x04e2('0x7')]({'action':_0x04e2('0x19')});};};function connect(){logger[_0x04e2('0x1a')](util[_0x04e2('0xe')](_0x04e2('0x1b'),config[_0x04e2('0x4')][_0x04e2('0x5')],config[_0x04e2('0x4')]['ip'],config['asterisk'][_0x04e2('0xc')]));ami[_0x04e2('0x1c')](_0x04e2('0xa'),error);ami[_0x04e2('0x1c')](_0x04e2('0x1d'),close);}ami['on'](_0x04e2('0x1e'),connect);ami['on'](_0x04e2('0x1f'),function(_0x366214){logger[_0x04e2('0x1a')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x04e2('0x4')][_0x04e2('0x5')],config[_0x04e2('0x4')]['ip'],config[_0x04e2('0x4')]['port'],util['inspect'](_0x366214,![],null)));});ami['on']('fullybooted',function(){logger['info'](util[_0x04e2('0xe')](_0x04e2('0x20'),config[_0x04e2('0x4')]['username'],config[_0x04e2('0x4')]['ip'],config['asterisk'][_0x04e2('0xc')]));return Promise['resolve']()[_0x04e2('0x21')](ami[_0x04e2('0x10')]())['then'](ami[_0x04e2('0x12')]())['then'](ami[_0x04e2('0x14')]())[_0x04e2('0x21')](ami['actionQueueSummary']())[_0x04e2('0x21')](ami['actionCoreShowChannels']())[_0x04e2('0x22')](function(_0x398408){logger[_0x04e2('0xa')](_0x04e2('0x23'),util['inspect'](_0x398408,{'showHidden':![],'depth':null}));});});ami[_0x04e2('0x1c')](_0x04e2('0xa'),error);ami[_0x04e2('0x1c')]('close',close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index bc97266..7bbde4d 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(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xb7e7[_0x5d80de];return _0x1c7556;};'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 _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x50c2d6,_0x170dc0){var _0x21e17b=function(_0x3cabfa){while(--_0x3cabfa){_0x50c2d6['push'](_0x50c2d6['shift']());}};_0x21e17b(++_0x170dc0);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x10e870,_0x4c4324){_0x10e870=_0x10e870-0x0;var _0x29b93d=_0xbdb7[_0x10e870];return _0x29b93d;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 61b6044..f9c3712 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 _0xedc3=['SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','object','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','available','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','abandonmentRate','agentBusyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','loggedIn','busyFactor','startMethodPredictive','floor','erlangCallToSecond','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','[getContactCampaign2]','dialLimitQueue','getContactDialer','countReScheduled','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','not_inuse','[countReScheduled]\x20','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','CAMPAIGN_STATUS','\x20INTERVAL_IS_NULL','NULL_INTERVAL','Interval','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','stringify','isTrunkReachable','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','ifTime','Failure','\x20Timezone\x20unknow\x20','length','Action','iftime\x20%s,%s','content','indexOf','true','catch','push','command','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','campaigns','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','power','dialPowerLevel','handlePower','Queue','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','Global:\x20','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','syncAgentConnect','uniqueId','uniqueid','ivr','updateOriginated','queue','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','rescheduleContact','add','minutes','ContactId','ListId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','queueCallerAbandonCreateState','VoiceQueueId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','isNil','locked','stateinterface','roundrobin','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','paused','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','xcally-motion-dialer','dialAMDActive','HANGUP','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','outboundAnswerAgiCallsDay','countmachineretry','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','HangupInAMD','[syncHangupInAMDIvr][createHistory]','Machine','countagentrejectretry','stateGlobal','createStateFinal','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','moveContactManagedDialer','running','statusMessage','getQueueCampaignStatusMessage','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','undefined','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','user:%s','handleIvr','originate','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','assign','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','TrunkBackup','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables'];(function(_0x3cc73e,_0x169bcb){var _0x3a3cf1=function(_0x2e35fe){while(--_0x2e35fe){_0x3cc73e['push'](_0x3cc73e['shift']());}};_0x3a3cf1(++_0x169bcb);}(_0xedc3,0x99));var _0x3edc=function(_0x1d65b7,_0x4ae3e7){_0x1d65b7=_0x1d65b7-0x0;var _0x2c6afc=_0xedc3[_0x1d65b7];return _0x2c6afc;};'use strict';var util=require(_0x3edc('0x0'));var _=require(_0x3edc('0x1'));var uuid=require(_0x3edc('0x2'));var moment=require('moment');var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x3edc('0x3'));var hopperUtils=require(_0x3edc('0x4'));var ut=require(_0x3edc('0x5'));var config=require(_0x3edc('0x6'));var logger=require('../../../config/logger')(_0x3edc('0x7'));var loggerBooked=require(_0x3edc('0x8'))(_0x3edc('0x9'));var loggerPredictive=require('../../../config/logger')(_0x3edc('0xa'));var loggerPredictiveCalls=require(_0x3edc('0x8'))(_0x3edc('0xb'));var loggerSyncQueueSummary=require(_0x3edc('0x8'))(_0x3edc('0xc'));var ami=require('../ami');config['redis']=_[_0x3edc('0xd')](config[_0x3edc('0xe')],{'host':_0x3edc('0xf'),'port':0x18eb});var io=require(_0x3edc('0x10'))(new Redis(config[_0x3edc('0xe')]));var cmHopper=require(_0x3edc('0x11'));var voiceQueueRt=require(_0x3edc('0x12'));var RpcSetting=require('../rpc/setting');var Interval=require(_0x3edc('0x13'));var Action=require(_0x3edc('0x14'));var History=require(_0x3edc('0x15'));var Final=require(_0x3edc('0x16'));var AgentComplete=require(_0x3edc('0x17'));var QueueCallerAbandon=require(_0x3edc('0x18'));var Hangup=require(_0x3edc('0x19'));var ipAgi=process[_0x3edc('0x1a')][_0x3edc('0x1b')]||_0x3edc('0x1c');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x3edc('0x1d')][_0x3edc('0x1e')]=function(_0x3932b1){this[_0x3edc('0x1f')]=this[_0x3edc('0x1f')]?this[_0x3edc('0x1f')]['finally'](_0x3932b1):_0x3932b1();};function Dialer(_0xef0613,_0x483708){this[_0x3edc('0x20')]=new Sequence();this[_0x3edc('0x21')]=_0x483708;this[_0x3edc('0x22')]=_0xef0613[_0x3edc('0x22')];this['campaigns']=_0xef0613['campaigns'];this['agents']=_0xef0613[_0x3edc('0x23')];this[_0x3edc('0x24')]=_0xef0613[_0x3edc('0x24')];this[_0x3edc('0x25')]=config['maxNumberOriginate']||0x2;this[_0x3edc('0x26')]={};this[_0x3edc('0x27')]={};this['contactsId']={};this['uniqueId']={};this[_0x3edc('0x28')]={};this[_0x3edc('0x29')]={};this[_0x3edc('0x2a')]={};this[_0x3edc('0x2b')]={};this[_0x3edc('0x2c')]={};this[_0x3edc('0x2d')]={};this[_0x3edc('0x2e')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x30'),this[_0x3edc('0x31')][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x32'),this[_0x3edc('0x33')][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x34'),this[_0x3edc('0x35')][_0x3edc('0x2f')](this));ami['on']('custom:queuesummary',this[_0x3edc('0xc')][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x36'),this[_0x3edc('0x37')][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x38'),this[_0x3edc('0x39')][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x3a'),this[_0x3edc('0x3b')]['bind'](this));ami['on'](_0x3edc('0x3c'),this[_0x3edc('0x3d')]['bind'](this));ami['on'](_0x3edc('0x3e'),this['syncQueueMember'][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x3f'),this[_0x3edc('0x40')]['bind'](this));this[_0x3edc('0x41')]();this[_0x3edc('0x42')]();RpcSetting[_0x3edc('0x43')]()[_0x3edc('0x44')](function(_0x159525){previewRecallmeReminderInterval=_0x159525[_0x3edc('0x45')];});}function isNotNull(_0x1b9287){return _0x1b9287!==null&&!_[_0x3edc('0x46')](_0x1b9287);}function msgResponse(_0x1c9ef0,_0x2d7142,_0x307cf5){return{'action':_0x1c9ef0,'response':_0x2d7142,'message':_0x307cf5,'stack':_0x307cf5};}function emit(_0x5796e9,_0x1b1fb9,_0x1885b0){io['to'](_0x5796e9)[_0x3edc('0x47')](_0x1b1fb9,_0x1885b0);}function emitOutboundVoiceQueueSummary(_0xb10e84){if(_0xb10e84[_0x3edc('0x48')]===_0x3edc('0x49')){logger[_0x3edc('0x4a')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x3edc('0x4b')](_0xb10e84,{'showHidden':![],'depth':null}));emit(util[_0x3edc('0x4c')](_0x3edc('0x4d'),_0xb10e84[_0x3edc('0x4e')]),_0x3edc('0x4f'),_0xb10e84);}}function checkGetDataPredictive(_0xb8a49a){if(isNotNull(_0xb8a49a)&&!_[_0x3edc('0x50')](_0xb8a49a)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x3edc('0x51')](_0x3edc('0x52'),_0xb8a49a[_0x3edc('0x53')]);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x54'),_0xb8a49a['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x55'),_0xb8a49a[_0x3edc('0x56')]);loggerPredictive[_0x3edc('0x51')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xb8a49a[_0x3edc('0x57')]);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x58'),_0xb8a49a[_0x3edc('0x59')]);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5a'),_0xb8a49a[_0x3edc('0x5b')]);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5c'));if(_0xb8a49a[_0x3edc('0x53')]>0x0){if(!_[_0x3edc('0x46')](_0xb8a49a[_0x3edc('0x5b')])&&_0xb8a49a['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5d'));if(!_[_0x3edc('0x46')](_0xb8a49a['predictiveIntervalAvgHoldtime'])&&_0xb8a49a['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5e'));}else{loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5f'));}}else{loggerPredictive['info'](_0x3edc('0x60'));}return![];}function mergeDataErlangB(_0x5a4c0b){return function(_0x4ca0fa){loggerPredictive[_0x3edc('0x51')](_0x3edc('0x61'));loggerPredictive[_0x3edc('0x51')](_0x3edc('0x62'),_0x4ca0fa[_0x3edc('0x63')]);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x64'),_0x4ca0fa['erlangCallToSecond']);loggerPredictive[_0x3edc('0x51')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4ca0fa['erlangAbandonmentRate']);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x65'),_0x4ca0fa[_0x3edc('0x66')]);loggerPredictive['info'](_0x3edc('0x67'),_0x4ca0fa[_0x3edc('0x68')]);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5c'));_[_0x3edc('0x69')](_0x5a4c0b,_0x4ca0fa);};}function ifInterval(_0x2ceacd,_0x55ae0d){if(_[_0x3edc('0x46')](_0x55ae0d)){return![];}return utils[_0x3edc('0x6a')](undefined,_0x55ae0d)<_0x2ceacd*0x3c;}function clearPredictiveAttributes(_0x2ccfa9){if(_0x2ccfa9[_0x3edc('0x2a')]){_0x2ccfa9[_0x3edc('0x2a')]=undefined;loggerPredictive[_0x3edc('0x4a')](_0x2ccfa9['name'],_0x3edc('0x6b'));}if(_0x2ccfa9[_0x3edc('0x29')]){_0x2ccfa9[_0x3edc('0x29')]=undefined;loggerPredictive[_0x3edc('0x4a')](_0x2ccfa9[_0x3edc('0x4e')],_0x3edc('0x6c'));}if(_0x2ccfa9[_0x3edc('0x6d')]){clearInterval(_0x2ccfa9[_0x3edc('0x6d')]);_0x2ccfa9['handlePredictive']=undefined;loggerPredictive[_0x3edc('0x4a')](_0x2ccfa9[_0x3edc('0x4e')],_0x3edc('0x6e'));}}function loggerCatchPredictive(_0x5e24ae,_0x568331){return function(_0x4458df){loggerPredictive[_0x3edc('0x6f')](_0x568331[_0x3edc('0x4e')],_0x5e24ae);loggerPredictive[_0x3edc('0x6f')](_0x4458df[_0x3edc('0x70')]);clearPredictiveAttributes(_0x568331);};}function loggerCatch(_0x808278){return function(_0x284870){logger['error'](_0x808278,util[_0x3edc('0x4b')](_0x284870,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3211be,_0x5bb2d4,_0x5653d6){return function(_0xaefe66){utils[_0x3edc('0x71')](_0x5bb2d4,_0x5653d6,0x0);_0x5bb2d4[_0x3edc('0x72')]=0x0;logger[_0x3edc('0x6f')](_0x3211be,util['inspect'](_0xaefe66,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x11d404){return function(_0x565a71){if(isNotNull(_0x565a71)&&isNotNull(_0x565a71[0x0])){if(_0x565a71[0x0][_0x3edc('0x73')]>0x0){_0x11d404[_0x3edc('0x74')]=utils['CAMPAIGN_STATUS'][_0x3edc('0x75')];logger['info'](_0x3edc('0x76')+_0x11d404[_0x3edc('0x4e')],_0x565a71[0x0][_0x3edc('0x73')],_0x3edc('0x77'));}else{_0x11d404['message']=utils['CAMPAIGN_STATUS'][_0x3edc('0x78')];logger['info'](_0x3edc('0x79')+_0x11d404[_0x3edc('0x4e')]);}}};}function createObjHistory(_0x11544f,_0x39ee6b,_0xb5cc33,_0x22b2e6,_0x114c57){_0x11544f['message']=_0xb5cc33;var _0x4e3e78=new Action(_0x11544f,_0x39ee6b);var _0x5cc567=new History(_0x4e3e78);_0x5cc567[_0x3edc('0x7a')]=_0x22b2e6;_0x5cc567['statedesc']=_0x114c57;_0x5cc567[_0x3edc('0x7b')]=_0x4e3e78[_0x3edc('0x7c')];return _0x5cc567;}function unlockQueueStatus(_0x50a720,_0x5d0ac4){setTimeout(function(){if(_[_0x3edc('0x46')](_0x50a720[_0x3edc('0x7d')])){loggerBooked[_0x3edc('0x6f')](_0x3edc('0x7e'),_0x5d0ac4);}_0x50a720[_0x3edc('0x7d')]=!![];loggerBooked['info'](_0x3edc('0x7f'),_0x5d0ac4,JSON['stringify'](_[_0x3edc('0x80')](_0x50a720,[_0x3edc('0x4e'),_0x3edc('0x7d')])));},0x1f3);}function checkInterval(_0x446a42){return function(){if(!isNotNull(_0x446a42['Interval'])){_0x446a42[_0x3edc('0x74')]=utils[_0x3edc('0x81')]['NULL_INTERVAL'];throw _0x446a42[_0x3edc('0x4e')]+_0x3edc('0x82');}if(!isNotNull(_0x446a42['Interval']['Intervals'])){_0x446a42[_0x3edc('0x74')]=utils[_0x3edc('0x81')][_0x3edc('0x83')];throw _0x446a42[_0x3edc('0x4e')]+_0x3edc('0x82');}if(!isNotNull(_['isEmpty'](_0x446a42[_0x3edc('0x84')][_0x3edc('0x85')]))){_0x446a42[_0x3edc('0x74')]=utils[_0x3edc('0x81')][_0x3edc('0x83')];throw _0x446a42[_0x3edc('0x4e')]+_0x3edc('0x82');}};}function checkIsIVRCampaignActive(_0x47b040){return function(){if(!utils[_0x3edc('0x86')](_0x47b040)){_0x47b040[_0x3edc('0x74')]=utils['CAMPAIGN_STATUS'][_0x3edc('0x87')];throw _0x47b040[_0x3edc('0x4e')]+_0x3edc('0x88');}};}function emitCampaignSummary(_0xcaee53){if(utils[_0x3edc('0x89')](_0xcaee53)){emit(util[_0x3edc('0x4c')](_0x3edc('0x8a'),_0xcaee53[_0x3edc('0x4e')]),_0x3edc('0x8b'),_0xcaee53);}}function loggerCatchQueueSummary(_0x4cfcc2,_0x2ccbec){return function(_0x1cae11){clearPredictiveAttributes(_0x2ccbec);emitCampaignSummary(_0x2ccbec);loggerSyncQueueSummary[_0x3edc('0x4a')](_0x4cfcc2,util[_0x3edc('0x4b')](_0x1cae11,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x4fa647){if(_0x4fa647[_0x3edc('0x8c')]){if(_0x4fa647[_0x3edc('0x8d')]===0x0){_0x4fa647['sendMessageOneNotActive']=![];_0x4fa647['message']=utils[_0x3edc('0x81')]['INACTIVE'];loggerSyncQueueSummary[_0x3edc('0x4a')](_0x3edc('0x8e'),_0x4fa647['name'],'is\x20not\x20active');}else{_0x4fa647[_0x3edc('0x74')]=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4fa647[_0x3edc('0x4e')],_0x3edc('0x8f'));}emitCampaignSummary(_0x4fa647);}}function myreject(_0x4f065c){return function(_0x4d0de8){return _0x4f065c(msgResponse(_0x3edc('0x90'),'Error',JSON[_0x3edc('0x91')](_0x4d0de8)));};}Dialer['prototype'][_0x3edc('0x92')]=function(_0x190241){return!_['isUndefined'](_0x190241)&&_0x190241&&!_['isUndefined'](_0x190241[_0x3edc('0x4e')])&&!_[_0x3edc('0x46')](_0x190241['active'])&&_0x190241['active']&&(this[_0x3edc('0x24')][util['format'](_0x3edc('0x93'),_0x190241[_0x3edc('0x4e')])][_0x3edc('0x94')]===_0x3edc('0x95')||this['trunks'][util[_0x3edc('0x4c')](_0x3edc('0x93'),_0x190241[_0x3edc('0x4e')])][_0x3edc('0x94')]===_0x3edc('0x96'));};Dialer[_0x3edc('0x1d')][_0x3edc('0x97')]=function(_0x2f12a2){var _0x1d2641=this;return function(){if(!_0x1d2641[_0x3edc('0x92')](_0x2f12a2[_0x3edc('0x98')])){if(!_0x1d2641[_0x3edc('0x92')](_0x2f12a2['TrunkBackup'])){_0x2f12a2[_0x3edc('0x74')]=utils['CAMPAIGN_STATUS'][_0x3edc('0x99')];throw _0x2f12a2[_0x3edc('0x4e')]+_0x3edc('0x9a');}}};};Dialer[_0x3edc('0x1d')][_0x3edc('0x9b')]=function(_0x2e8cb3,_0x122867,_0xcebca,_0x307850){var _0x1c2b36=this;return function(){var _0x15eb55=!![];return _0x1c2b36[_0x3edc('0x9c')](_0x2e8cb3,_0x122867,_0xcebca,_0x307850,_0x15eb55);};};Dialer['prototype'][_0x3edc('0x9d')]=function(_0xdea0ce,_0x2c9788,_0xfe8768,_0x2cdf79){var _0xb81bec=this;return function(){var _0x3281dc=![];return _0xb81bec['ifTimeIvr'](_0xdea0ce[_0x3edc('0x85')],_0x2c9788,_0xfe8768,_0x2cdf79,_0x3281dc);};};Dialer[_0x3edc('0x1d')][_0x3edc('0x9c')]=function(_0xa4a11e,_0xe03ab,_0x1fb1f1,_0x25ffcf,_0x152557){var _0x29437c=[];return new Promise(function(_0xa4a63c,_0x2e5406){if(!isNotNull(_0xa4a11e)){_0x25ffcf['message']=utils[_0x3edc('0x81')][_0x3edc('0x83')];return _0x2e5406(msgResponse('ifTime','Failure',_0x1fb1f1+_0x3edc('0x9e')));}if(_[_0x3edc('0x50')](_0xa4a11e)){_0x25ffcf[_0x3edc('0x74')]=utils[_0x3edc('0x81')][_0x3edc('0x9f')];return _0x2e5406(msgResponse('ifTime','Failure',_0x1fb1f1+_0x3edc('0xa0')));}if(_0xe03ab&&_[_0x3edc('0x46')](config[_0x3edc('0xa1')][_0xe03ab])){_0x25ffcf[_0x3edc('0x74')]=utils[_0x3edc('0x81')][_0x3edc('0xa2')];return _0x2e5406(msgResponse(_0x3edc('0xa3'),_0x3edc('0xa4'),_0x1fb1f1+_0x3edc('0xa5')+_0xe03ab));}if(_['isArray'](_0xa4a11e)){for(var _0x30d4c9=0x0;_0x30d4c9<_0xa4a11e[_0x3edc('0xa6')];_0x30d4c9+=0x1){_0x29437c['push'](ami[_0x3edc('0xa7')]({'action':'command','command':util['format'](_0x3edc('0xa8'),_0xa4a11e[_0x30d4c9]['interval'],!_[_0x3edc('0x46')](config['timezones'][_0xe03ab])?_0xe03ab:'')})[_0x3edc('0x44')](function(_0x13ad3a){return _0x13ad3a[_0x3edc('0xa9')][_0x3edc('0xaa')](_0x3edc('0xab'))>=0x0;})[_0x3edc('0xac')](myreject(_0x2e5406)));}}else{_0x29437c[_0x3edc('0xad')](ami[_0x3edc('0xa7')]({'action':_0x3edc('0xae'),'command':util[_0x3edc('0x4c')](_0x3edc('0xa8'),_0xa4a11e,!_[_0x3edc('0x46')](config['timezones'][_0xe03ab])?_0xe03ab:'')})['then'](function(_0x265339){return _0x265339['content']['indexOf'](_0x3edc('0xab'))>=0x0;})[_0x3edc('0xac')](myreject(_0x2e5406)));}Promise['all'](_0x29437c)['then'](function(_0xf05b11){var _0x1c33a4=_['some'](_0xf05b11);if(_0x1c33a4){return _0xa4a63c(_0x1c33a4);}else{_0x25ffcf['message']=_0x152557?utils[_0x3edc('0x81')][_0x3edc('0xaf')]:utils[_0x3edc('0x81')][_0x3edc('0xb0')];return _0x2e5406(msgResponse(_0x3edc('0xb1'),_0x3edc('0xa4'),'Global:\x20'+_0x152557+'\x20'+_0x1fb1f1+_0x3edc('0xb2')+util[_0x3edc('0x4b')](_0xa4a11e,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0xe03ab));}})[_0x3edc('0xac')](function(_0x370228){return _0x2e5406(msgResponse('ifTime',_0x3edc('0xa4'),JSON[_0x3edc('0x91')](_0x370228)));});});};Dialer[_0x3edc('0x1d')][_0x3edc('0x41')]=function(){var _0x80366=this;return cmHopper[_0x3edc('0xb3')]({'active':![]},{'where':{'active':!![]}})[_0x3edc('0x44')](function(){setInterval(function(){_0x80366[_0x3edc('0xb4')]();},0x3e8);});};Dialer[_0x3edc('0x1d')][_0x3edc('0xb4')]=function(){var _0x4ff593=this;var _0x29810e;for(var _0x13566c in this[_0x3edc('0xb5')]){if(typeof this[_0x3edc('0xb5')][_0x13566c]!=='undefined'){_0x29810e=this[_0x3edc('0xb5')][_0x13566c];if(utils[_0x3edc('0x89')](_0x29810e)&&utils[_0x3edc('0x86')](_0x29810e)){_0x29810e[_0x3edc('0x8c')]=!![];Promise[_0x3edc('0xb6')]()[_0x3edc('0x44')](checkIsIVRCampaignActive(_0x29810e))[_0x3edc('0x44')](checkInterval(_0x29810e))[_0x3edc('0x44')](_0x4ff593[_0x3edc('0x97')](_0x29810e))[_0x3edc('0x44')](_0x4ff593['checkIfTime'](_0x29810e[_0x3edc('0xb7')],_0x29810e[_0x3edc('0xb8')],_0x29810e[_0x3edc('0x4e')],_0x29810e))['then'](_0x4ff593[_0x3edc('0x9d')](_0x29810e['Interval'],_0x29810e['dialTimezone'],_0x29810e[_0x3edc('0x4e')],_0x29810e))['then'](_0x4ff593[_0x3edc('0xb9')](_0x29810e))[_0x3edc('0xac')](loggerCatchQueueSummary(_0x3edc('0xba'),_0x29810e));}else{notSendMessagesCampaign(_0x29810e);}}}};Dialer[_0x3edc('0x1d')][_0x3edc('0xbb')]=function(_0x1bed57){if(_0x1bed57[_0x3edc('0xbc')]!==_0x3edc('0xa')){clearPredictiveAttributes(_0x1bed57);}switch(_0x1bed57[_0x3edc('0xbc')]){case'progressive':this['handlePower'](_0x1bed57,0x1);break;case _0x3edc('0xbd'):this['handlePower'](_0x1bed57,_0x1bed57[_0x3edc('0xbe')]);break;case _0x3edc('0xa'):this[_0x3edc('0xa')](_0x1bed57);break;case _0x3edc('0x9'):this[_0x3edc('0xbf')](_0x1bed57,0x1);break;default:logger[_0x3edc('0x6f')](_0x3edc('0xc0'),_0x1bed57['name'],'method\x20not\x20recognized');}};Dialer[_0x3edc('0x1d')][_0x3edc('0xa3')]=function(_0x5f26ac,_0x12f1b5){var _0x54f855=_0x5f26ac['dialTimezone'];var _0x1dcd52=_0x12f1b5?_0x5f26ac[_0x3edc('0xb7')]:_0x5f26ac[_0x3edc('0x84')][_0x3edc('0x85')];logger[_0x3edc('0xc1')](_0x3edc('0xc2'),_0x1dcd52,_0x54f855,_0x5f26ac[_0x3edc('0x4e')],util[_0x3edc('0x4c')](_0x3edc('0xc3'),_0x5f26ac[_0x3edc('0x4e')],_0x5f26ac['id']));var _0x461627=null;return Interval['intervalIftime'](_0x1dcd52,_0x54f855)[_0x3edc('0x44')](function(_0x5d191b){if(_0x5d191b===!![]){return _0x5d191b;}else{_0x5f26ac[_0x3edc('0x74')]=_0x12f1b5?utils[_0x3edc('0x81')][_0x3edc('0xaf')]:utils['CAMPAIGN_STATUS'][_0x3edc('0xb0')];_0x461627=msgResponse(_0x3edc('0xb1'),'Failure',_0x3edc('0xc4')+_0x12f1b5+'\x20'+_0x5f26ac['name']+_0x3edc('0xb2')+util[_0x3edc('0x4b')](_0x1dcd52,{'showHidden':![],'depth':null})+_0x3edc('0xc5')+_0x54f855);}if(_0x461627!==null){logger[_0x3edc('0xc1')](_0x3edc('0xc6'),_0x461627);_0x461627['isGlobal']=_0x12f1b5;throw _0x461627;}})[_0x3edc('0xac')](function(_0x3bdee2){logger[_0x3edc('0x6f')](_0x3edc('0xc7'),_0x3bdee2);throw msgResponse(_0x3edc('0x90'),'Error',util[_0x3edc('0x4b')](_0x3bdee2,{'showHidden':![],'depth':null}));});};Dialer[_0x3edc('0x1d')][_0x3edc('0xc8')]=function(_0x15e88a){if(this['voiceQueues'][_0x15e88a['queue']]){if(this[_0x3edc('0xc9')][_0x15e88a[_0x3edc('0xca')]]&&this[_0x3edc('0xc9')][_0x15e88a[_0x3edc('0xca')]][_0x3edc('0x48')]!==_0x3edc('0xcb')){this[_0x3edc('0xcc')](this[_0x3edc('0x22')][_0x15e88a[_0x3edc('0xcd')]]);this['uniqueId'][_0x15e88a['uniqueid']][_0x3edc('0xce')]=moment()[_0x3edc('0x4c')](_0x3edc('0xcf'));}}};Dialer[_0x3edc('0x1d')][_0x3edc('0x35')]=function(_0x3bfb91){var _0x122337=this[_0x3edc('0xc9')][_0x3bfb91[_0x3edc('0xca')]];if(this[_0x3edc('0x22')][_0x3bfb91[_0x3edc('0xcd')]]){if(_0x122337&&_0x122337[_0x3edc('0x48')]!==_0x3edc('0xcb')){delete this[_0x3edc('0xc9')][_0x3bfb91[_0x3edc('0xca')]];this[_0x3edc('0x22')][_0x3bfb91[_0x3edc('0xcd')]][_0x3edc('0xd0')]+=0x1;var _0x2b2178=new AgentComplete(_0x122337,_0x3bfb91);if(_0x3bfb91['reason']==='agent'){_0x2b2178[_0x3edc('0xd1')]=this[_0x3edc('0x22')][_0x3bfb91[_0x3edc('0xcd')]][_0x3edc('0xd2')]&&this[_0x3edc('0x22')][_0x3bfb91[_0x3edc('0xcd')]][_0x3edc('0xd3')]?moment()[_0x3edc('0x4c')](_0x3edc('0xcf')):undefined;}hopperUtils['createHistory'](_0x2b2178)[_0x3edc('0xac')](loggerCatch(_0x3edc('0xd4')));hopperUtils['moveContactManagedDialer'](_0x2b2178)[_0x3edc('0xac')](loggerCatch(_0x3edc('0xd5')));}}};Dialer[_0x3edc('0x1d')][_0x3edc('0x31')]=function(_0x42e7f5){var _0x5a276e=this[_0x3edc('0xc9')][_0x42e7f5[_0x3edc('0xca')]];var _0x26972e=this;var _0x33c703=![];var _0x2fd302;var _0x7e4202;if(this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]]){if(_0x5a276e&&_0x5a276e['type']!==_0x3edc('0xcb')){delete this[_0x3edc('0xc9')][_0x42e7f5[_0x3edc('0xca')]];this['updateOriginated'](this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]]);_0x5a276e[_0x3edc('0xd6')]=moment()[_0x3edc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x17215e=new QueueCallerAbandon(_0x5a276e,_0x42e7f5);if(utils[_0x3edc('0x6a')](_0x5a276e[_0x3edc('0xd6')],_0x5a276e['responsetime'])>=_0x5a276e[_0x3edc('0xd7')]){this['voiceQueues'][_0x42e7f5[_0x3edc('0xcd')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xd8')]+=0x1;this['voiceQueues'][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xd9')]+=0x1;_0x17215e['state']=0xa;_0x17215e[_0x3edc('0xda')]=_0x3edc('0xdb');_0x17215e[_0x3edc('0xdc')]='TIMEOUT';_0x17215e[_0x3edc('0xd1')]=this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]]['dialQueueProject2']?moment()[_0x3edc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x17215e[_0x3edc('0xdd')]+=0x1;_0x17215e[_0x3edc('0xde')]+=0x1;_0x2fd302=this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xdf')];_0x7e4202=this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xe0')];hopperUtils[_0x3edc('0xe1')](_0x17215e,_0x17215e[_0x3edc('0x7a')],_0x5a276e[_0x3edc('0xe2')])['then'](function(_0x55e91a){_0x33c703=_0x55e91a[_0x3edc('0xe3')]==0x1;if(_0x17215e['countdropretry']>=_0x26972e['voiceQueues'][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xe4')]){_0x26972e['queueCallerAbandonCreateState'](_0x17215e,_0x55e91a[_0x3edc('0xe3')]);}else{hopperUtils[_0x3edc('0xe5')]({'active':![],'countdropretry':_0x17215e[_0x3edc('0xdd')],'scheduledat':moment()[_0x3edc('0xe6')](_0x26972e[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xdf')],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x5a276e[_0x3edc('0xe8')],'ListId':_0x5a276e[_0x3edc('0xe9')],'VoiceQueueId':_0x5a276e['VoiceQueueId']||undefined,'CampaignId':_0x5a276e[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0xeb')));var _0x4af79c=new History(_0x17215e);_0x4af79c[_0x3edc('0x7a')]=0xa;_0x4af79c['statedesc']=_0x3edc('0xdb');_0x4af79c[_0x3edc('0x7c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4af79c['endtime']=_0x4af79c[_0x3edc('0x7c')];_0x4af79c[_0x3edc('0xec')]=_0x17215e['calleridname'];_0x4af79c[_0x3edc('0xed')]=_0x17215e['calleridnum'];hopperUtils[_0x3edc('0xee')](_0x4af79c)[_0x3edc('0xac')](loggerCatch(_0x3edc('0xef')));}})[_0x3edc('0x44')](function(){if(_0x33c703)hopperUtils[_0x3edc('0xf0')](_0x17215e,_0x2fd302,_0x7e4202)[_0x3edc('0x44')](function(){return 0x1;});});}else{this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0x57')]+=0x1;this['voiceQueues'][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xf1')]+=0x1;_0x17215e[_0x3edc('0x7a')]=0xb;_0x17215e[_0x3edc('0xda')]=_0x3edc('0xf2');_0x17215e[_0x3edc('0xdc')]='CALLEREXIT';_0x17215e[_0x3edc('0xf3')]+=0x1;_0x17215e[_0x3edc('0xde')]+=0x1;_0x2fd302=this['voiceQueues'][_0x42e7f5['queue']][_0x3edc('0xf4')];_0x7e4202=this['voiceQueues'][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xe0')];hopperUtils['verifyAdditionalPhones'](_0x17215e,_0x17215e[_0x3edc('0x7a')],_0x5a276e[_0x3edc('0xe2')])[_0x3edc('0x44')](function(_0x148366){if(_0x17215e['countabandonedretry']>=_0x26972e[_0x3edc('0x22')][_0x42e7f5['queue']][_0x3edc('0xf5')]){_0x26972e[_0x3edc('0xf6')](_0x17215e,_0x148366['additional']);}else{hopperUtils[_0x3edc('0xe5')]({'active':![],'countabandonedretry':_0x17215e[_0x3edc('0xf3')],'scheduledat':moment()[_0x3edc('0xe6')](_0x26972e['voiceQueues'][_0x42e7f5[_0x3edc('0xcd')]]['dialAbandonedRetryFrequency'],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x5a276e['ContactId'],'ListId':_0x5a276e['ListId'],'VoiceQueueId':_0x5a276e[_0x3edc('0xf7')]||undefined,'CampaignId':_0x5a276e['CampaignId']||undefined})['catch'](loggerCatch(_0x3edc('0xf8')));var _0x446381=new History(_0x17215e);_0x446381[_0x3edc('0x7a')]=0xb;_0x446381[_0x3edc('0xda')]=_0x3edc('0xf2');_0x446381[_0x3edc('0x7c')]=moment()[_0x3edc('0x4c')](_0x3edc('0xcf'));_0x446381[_0x3edc('0x7b')]=_0x446381['starttime'];_0x446381[_0x3edc('0xec')]=_0x17215e[_0x3edc('0xec')];_0x446381[_0x3edc('0xed')]=_0x17215e[_0x3edc('0xed')];hopperUtils[_0x3edc('0xee')](_0x446381)['catch'](loggerCatch(_0x3edc('0xf9')));}})[_0x3edc('0x44')](function(){if(_0x33c703)hopperUtils['swapAdditionalPhones'](_0x17215e,_0x2fd302,_0x7e4202)[_0x3edc('0x44')](function(){return 0x1;});});}}}};Dialer[_0x3edc('0x1d')][_0x3edc('0x3b')]=function(_0x3f3b32){if(this['actions'][_0x3f3b32[_0x3edc('0xca')]]){this['actions'][_0x3f3b32[_0x3edc('0xca')]][_0x3edc('0xfa')]=_0x3f3b32[_0x3edc('0xfa')];}if(this[_0x3edc('0xc9')][_0x3f3b32['uniqueid']]){this[_0x3edc('0xc9')][_0x3f3b32[_0x3edc('0xca')]][_0x3edc('0xfa')]=_0x3f3b32[_0x3edc('0xfa')];}};Dialer[_0x3edc('0x1d')]['syncQueueMember']=function(_0x4daa4e){if(!this[_0x3edc('0x27')][_0x4daa4e[_0x3edc('0xfb')]]){return;}var _0x2bdcd0=this[_0x3edc('0x22')][this['actions'][_0x4daa4e[_0x3edc('0xfb')]][_0x3edc('0xcd')]][_0x3edc('0xfc')]||_0x3edc('0xfd');if(_0x2bdcd0==='roundrobin'){if(this[_0x3edc('0x27')][_0x4daa4e[_0x3edc('0xfb')]]&&_[_0x3edc('0xfe')](this['actions'][_0x4daa4e[_0x3edc('0xfb')]][_0x3edc('0xff')])&&_0x4daa4e[_0x3edc('0x94')]==='1'&&_0x4daa4e['paused']==='0'){if(this[_0x3edc('0x23')][_0x4daa4e[_0x3edc('0x100')]]){if(!this['agents'][_0x4daa4e[_0x3edc('0x100')]][_0x3edc('0xff')]){this['agents'][_0x4daa4e[_0x3edc('0x100')]][_0x3edc('0xff')]=!![];this['actions'][_0x4daa4e[_0x3edc('0xfb')]][_0x3edc('0xff')]=!![];this[_0x3edc('0x27')][_0x4daa4e['actionid']][_0x3edc('0x100')]=_0x4daa4e[_0x3edc('0x100')];}}}}else if(_0x2bdcd0===_0x3edc('0xfd')){if(this[_0x3edc('0x27')][_0x4daa4e[_0x3edc('0xfb')]]){if(this[_0x3edc('0x23')][_0x4daa4e[_0x3edc('0x100')]]){this[_0x3edc('0x27')][_0x4daa4e[_0x3edc('0xfb')]]['stateinterface']=_0x4daa4e[_0x3edc('0x100')];if(_[_0x3edc('0xfe')](this[_0x3edc('0x2c')][this[_0x3edc('0x27')][_0x4daa4e['actionid']]['queue']])){this[_0x3edc('0x2c')][this[_0x3edc('0x27')][_0x4daa4e[_0x3edc('0xfb')]][_0x3edc('0xcd')]]=[];}this['queueBooked'][this['actions'][_0x4daa4e['actionid']]['queue']][_0x3edc('0xad')](_['merge'](_['pick'](this[_0x3edc('0x27')][_0x4daa4e[_0x3edc('0xfb')]],['idHopper',_0x3edc('0x100')]),{'status':_0x4daa4e[_0x3edc('0x94')],'paused':_0x4daa4e['paused']}));}}}};Dialer['prototype']['syncQueueStatusComplete']=function(_0x442532){if(!this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]]){return;}var _0x238419=this;var _0x329492=this[_0x3edc('0x22')][this['actions'][_0x442532[_0x3edc('0xfb')]][_0x3edc('0xcd')]];var _0xc92bee=_0x329492[_0x3edc('0xfc')]||_0x3edc('0xfd');if(_0xc92bee===_0x3edc('0x101')){if(this['actions'][_0x442532['actionid']]&&this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]][_0x3edc('0x100')]){this['preview'][_0x3edc('0x102')](this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]][_0x3edc('0x103')],this[_0x3edc('0x27')][_0x442532['actionid']][_0x3edc('0x100')])[_0x3edc('0xac')](function(_0xc4e3a6){logger[_0x3edc('0x6f')](_0x3edc('0x104'),util[_0x3edc('0x4b')](_0xc4e3a6,{'showHidden':![],'depth':null}));})[_0x3edc('0x105')](function(){_0x238419[_0x3edc('0xcc')](_0x238419['voiceQueues'][_0x238419[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]][_0x3edc('0xcd')]]);_0x238419[_0x3edc('0x23')][_0x238419[_0x3edc('0x27')][_0x442532['actionid']]['stateinterface']][_0x3edc('0xff')]=![];delete _0x238419['actions'][_0x442532['actionid']];unlockQueueStatus(_0x329492);});}else{this[_0x3edc('0xcc')](this['voiceQueues'][this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]][_0x3edc('0xcd')]]);hopperUtils[_0x3edc('0xe5')]({'active':![],'ContactId':this[_0x3edc('0x27')][_0x442532['actionid']][_0x3edc('0xe8')],'ListId':this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]]['ListId'],'VoiceQueueId':this[_0x3edc('0x27')][_0x442532['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]]['CampaignId']||undefined})[_0x3edc('0xac')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]];unlockQueueStatus(_0x329492);}}else if(_0xc92bee===_0x3edc('0xfd')){var _0x27604d;if(this[_0x3edc('0x27')][_0x442532['actionid']]&&!_[_0x3edc('0x50')](this[_0x3edc('0x2c')][this[_0x3edc('0x27')][_0x442532['actionid']]['queue']])){if(this[_0x3edc('0x2d')][_0x238419[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]][_0x3edc('0xcd')]]){this[_0x3edc('0x2d')][_0x238419[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]]['queue']]=this['queueBookedRR'][this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]]['queue']]?this[_0x3edc('0x2d')][this[_0x3edc('0x27')][_0x442532['actionid']][_0x3edc('0xcd')]]:this[_0x3edc('0x2c')][this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]]['queue']]?this[_0x3edc('0x2c')][this[_0x3edc('0x27')][_0x442532['actionid']]['queue']][_0x3edc('0x106')]||0x0:0x0;}this[_0x3edc('0x2c')][this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]][_0x3edc('0xcd')]][_0x3edc('0x106')]=this[_0x3edc('0x2d')][this['actions'][_0x442532[_0x3edc('0xfb')]][_0x3edc('0xcd')]];for(var _0x5c2ea3=0x0;_0x5c2ea3=_0x1f4076[_0x3edc('0x127')]){_0x34701a['stateGlobal'](_0x1ac457,_0x60d373,_0x3e87e7,_0x3edc('0x128'));}else{if(_0x1ac457['countmachineretry']>=_0x1f4076[_0x3edc('0x129')]){_0x34701a['createStateFinal'](_0x1ac457,_0x60d373,_0x3e87e7,_0x3edc('0x12a'));}else{hopperUtils[_0x3edc('0xe5')]({'active':![],'countmachineretry':_0x1ac457[_0x3edc('0x122')],'scheduledat':moment()[_0x3edc('0xe6')](_0x1f4076[_0x3edc('0x12b')],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x1ac457[_0x3edc('0xe8')],'ListId':_0x1ac457[_0x3edc('0xe9')],'VoiceQueueId':_0x1ac457[_0x3edc('0xf7')]||undefined,'CampaignId':_0x1ac457[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch('[rescheduleContact][Machine]'));_0x60d373({'reschedule':0x1});}}});}if(_0x507161[_0x3edc('0x48')]===_0x3edc('0xcb')&&this[_0x3edc('0xb5')][_0x507161['queue']][_0x3edc('0x115')]&&_0x2bdc24['value']===_0x3edc('0x116')){delete this[_0x3edc('0xc9')][_0x2bdc24[_0x3edc('0xca')]];this['updateOriginated'](this[_0x3edc('0xb5')][_0x507161[_0x3edc('0xcd')]]);_0x54fef4=new Hangup(_0x507161,_0x2bdc24);_0x54fef4['state']=0x12;_0x54fef4[_0x3edc('0xda')]=_0x3edc('0x12c');_0x54fef4['membername']='AMD';ami[_0x3edc('0x47')](_0x3edc('0x119'),ut[_0x3edc('0x11a')](_0x54fef4,_0x3edc('0x11b')));this[_0x3edc('0x11c')](_0x54fef4,_0x3edc('0x12d'),'[syncHangupInAMDIvr]');}if(_0x507161[_0x3edc('0x48')]==='ivr'&&this[_0x3edc('0xb5')][_0x507161[_0x3edc('0xcd')]]['dialAMDActive']&&_0x2bdc24[_0x3edc('0x11f')]===_0x3edc('0x120')){return new Promise(function(_0x3c62aa,_0x1d70d4){delete _0x34701a[_0x3edc('0xc9')][_0x2bdc24['uniqueid']];_0x34701a['updateOriginated'](_0x34701a[_0x3edc('0xb5')][_0x507161[_0x3edc('0xcd')]]);_0x34701a[_0x3edc('0xb5')][_0x507161['queue']][_0x3edc('0xd0')]+=0x1;_0x34701a[_0x3edc('0xb5')][_0x507161['queue']][_0x3edc('0x121')]+=0x1;var _0x575b49=_0x34701a[_0x3edc('0xb5')][_0x507161[_0x3edc('0xcd')]];var _0x458677=new Hangup(_0x507161,_0x2bdc24);_0x458677[_0x3edc('0x7a')]=0x13;_0x458677[_0x3edc('0xda')]=_0x3edc('0x12e');_0x458677[_0x3edc('0x117')]=_0x3edc('0x118');_0x458677[_0x3edc('0x122')]+=0x1;_0x458677['countglobal']+=0x1;_0x458677[_0x3edc('0x11b')]=!![];ami[_0x3edc('0x47')](_0x3edc('0x119'),ut[_0x3edc('0x11a')](_0x458677,_0x3edc('0x11b')));hopperUtils[_0x3edc('0xee')](_0x458677)[_0x3edc('0xac')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x458677['countbusyretry']+_0x458677[_0x3edc('0x124')]+_0x458677[_0x3edc('0x125')]+_0x458677[_0x3edc('0x126')]+_0x458677[_0x3edc('0xdd')]+_0x458677[_0x3edc('0xf3')]+_0x458677[_0x3edc('0x122')]+_0x458677[_0x3edc('0x12f')]>=_0x575b49[_0x3edc('0x127')]){_0x34701a[_0x3edc('0x130')](_0x458677,_0x3c62aa,_0x1d70d4,_0x3edc('0x128'));}else{if(_0x458677[_0x3edc('0x122')]>=_0x575b49[_0x3edc('0x129')]){_0x34701a[_0x3edc('0x131')](_0x458677,_0x3c62aa,_0x1d70d4,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x458677['countmachineretry'],'scheduledat':moment()[_0x3edc('0xe6')](_0x575b49[_0x3edc('0x12b')],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x458677[_0x3edc('0xe8')],'ListId':_0x458677[_0x3edc('0xe9')],'VoiceQueueId':_0x458677[_0x3edc('0xf7')]||undefined,'CampaignId':_0x458677[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x132')));_0x3c62aa({'reschedule':0x1});}}});}}};Dialer[_0x3edc('0x1d')][_0x3edc('0x39')]=function(_0x20ac0d){var _0x3ba6ea=this[_0x3edc('0xc9')][_0x20ac0d['uniqueid']];var _0x54e9b9;if(_0x3ba6ea&&_0x3ba6ea[_0x3edc('0x48')]===_0x3edc('0xcb')){delete this[_0x3edc('0xc9')][_0x20ac0d[_0x3edc('0xca')]];this[_0x3edc('0xcc')](this[_0x3edc('0xb5')][_0x3ba6ea[_0x3edc('0xcd')]]);this[_0x3edc('0xb5')][_0x3ba6ea['queue']][_0x3edc('0x133')]+=0x1;_0x54e9b9=new Hangup(_0x3ba6ea,_0x20ac0d);hopperUtils[_0x3edc('0xee')](_0x54e9b9)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x134')));hopperUtils['moveContactManagedDialer'](_0x54e9b9)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x135')));}if(_0x3ba6ea&&_0x3ba6ea[_0x3edc('0x48')]!==_0x3edc('0xcb')&&isNotNull(this[_0x3edc('0x22')][_0x3ba6ea['queue']][_0x3edc('0x136')])){delete this[_0x3edc('0xc9')][_0x20ac0d[_0x3edc('0xca')]];this[_0x3edc('0xcc')](this[_0x3edc('0x22')][_0x3ba6ea[_0x3edc('0xcd')]]);this[_0x3edc('0x22')][_0x3ba6ea[_0x3edc('0xcd')]][_0x3edc('0xd0')]+=0x1;this[_0x3edc('0x22')][_0x3ba6ea[_0x3edc('0xcd')]][_0x3edc('0x121')]+=0x1;_0x54e9b9=new Hangup(_0x3ba6ea,_0x20ac0d);_0x54e9b9[_0x3edc('0x7a')]=0x10;_0x54e9b9[_0x3edc('0xda')]=_0x3edc('0x137');_0x54e9b9[_0x3edc('0x117')]=_0x3edc('0x138');hopperUtils[_0x3edc('0xee')](_0x54e9b9)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x134')));hopperUtils['moveContactManagedDialer'](_0x54e9b9)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x135')));}if(_0x3ba6ea&&_0x3ba6ea[_0x3edc('0x48')]!==_0x3edc('0xcb')&&!isNotNull(this['voiceQueues'][_0x3ba6ea[_0x3edc('0xcd')]]['dialQueueProject'])){delete this[_0x3edc('0xc9')][_0x20ac0d[_0x3edc('0xca')]];this['updateOriginated'](this['voiceQueues'][_0x3ba6ea[_0x3edc('0xcd')]]);this[_0x3edc('0x22')][_0x3ba6ea[_0x3edc('0xcd')]][_0x3edc('0x139')]+=0x1;_0x54e9b9=new Hangup(_0x3ba6ea,_0x20ac0d);_0x54e9b9['state']=0xc;_0x54e9b9[_0x3edc('0xda')]=_0x20ac0d[_0x3edc('0x13a')];_0x54e9b9[_0x3edc('0x117')]=_0x3edc('0x13b');hopperUtils[_0x3edc('0xee')](_0x54e9b9)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x134')));hopperUtils[_0x3edc('0x13c')](_0x54e9b9)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x135')));}};Dialer[_0x3edc('0x1d')][_0x3edc('0xc')]=function(_0x5e0b20){var _0x43f5ba=this;if(!_0x43f5ba[_0x3edc('0x2e')][_0x5e0b20[_0x3edc('0x4e')]]){_0x43f5ba[_0x3edc('0x2e')][_0x5e0b20['name']]={'running':![]};}else if(_0x43f5ba[_0x3edc('0x2e')][_0x5e0b20[_0x3edc('0x4e')]][_0x3edc('0x13d')]===!![]){return;}else if(_0x43f5ba[_0x3edc('0x2e')][_0x5e0b20[_0x3edc('0x4e')]][_0x3edc('0x13d')]===![]){_0x43f5ba['queuesSummary'][_0x5e0b20[_0x3edc('0x4e')]][_0x3edc('0x13d')]=!![];}var _0x3964a0=_0x43f5ba['voiceQueues'][_0x5e0b20[_0x3edc('0x4e')]];var _0x359fa6=_0x3964a0[_0x3edc('0x74')]!==utils[_0x3edc('0x81')][_0x3edc('0x87')];var _0x2ba4d2=utils['isPreviewCampaign'](_0x3964a0);_0x3964a0[_0x3edc('0x13e')]=utils[_0x3edc('0x13f')](_0x3964a0,_0x43f5ba[_0x3edc('0x24')]);Promise['resolve']()[_0x3edc('0x44')](function(){if(_0x3964a0['statusMessage']===utils['CAMPAIGN_STATUS'][_0x3edc('0x87')]){if(_0x359fa6){clearPredictiveAttributes(_0x3964a0);_0x5e0b20[_0x3edc('0x29')]=undefined;_0x5e0b20[_0x3edc('0x2a')]=undefined;}if(_0x3964a0[_0x3edc('0x13e')]===utils[_0x3edc('0x81')][_0x3edc('0x87')]){_0x5e0b20['available']=0x0;_0x5e0b20[_0x3edc('0x107')]=0x0;_0x5e0b20[_0x3edc('0x140')]=0x0;_0x5e0b20[_0x3edc('0x141')]=0x0;_0x5e0b20[_0x3edc('0x142')]=0x0;}}else if(_0x3964a0[_0x3edc('0x13e')]===utils[_0x3edc('0x81')][_0x3edc('0x143')]&&!_0x2ba4d2){return _0x43f5ba[_0x3edc('0xa3')](_0x3964a0,!![])[_0x3edc('0x44')](function(){return _0x43f5ba[_0x3edc('0xa3')](_0x3964a0,![]);})['then'](function(){return _0x43f5ba['checkDialMethod'](_0x3964a0);})['catch'](function(_0x113656){loggerSyncQueueSummary[_0x3edc('0x4a')](_0x3edc('0x144'),util[_0x3edc('0x4b')](_0x113656,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3964a0);});}else{clearPredictiveAttributes(_0x3964a0);}})[_0x3edc('0x44')](function(){var _0x1df5ea=_0x5e0b20['compareToOutboundQueue'](_0x3964a0);if(_0x1df5ea||_0x3964a0[_0x3edc('0x145')]){_0x3964a0['queueSummaryCountersUpdated']=![];_0x5e0b20[_0x3edc('0x146')](_0x3964a0);Object['assign'](_0x3964a0,_0x5e0b20);emitOutboundVoiceQueueSummary(_0x5e0b20);}_0x43f5ba[_0x3edc('0x2e')][_0x3964a0[_0x3edc('0x4e')]]['running']=![];})[_0x3edc('0xac')](function(_0x27c0f7){logger[_0x3edc('0x6f')](_0x3edc('0x144'),util['inspect'](_0x27c0f7,{'showHidden':![],'depth':null}));_0x43f5ba['queuesSummary'][_0x3964a0[_0x3edc('0x4e')]][_0x3edc('0x13d')]=![];});};Dialer[_0x3edc('0x1d')]['syncQueueSummaryComplete']=_['throttle'](function(){var _0x5e3038=_[_0x3edc('0x147')](this[_0x3edc('0x22')],function(_0x434eb8){return _0x434eb8[_0x3edc('0x148')];});var _0x3a2ea9=_[_0x3edc('0x147')](this[_0x3edc('0x23')],function(_0x4f01df){return _0x4f01df['online']&&_0x4f01df[_0x3edc('0x94')]===_0x3edc('0x95');});if(_0x5e3038[_0x3edc('0xa6')]>0x0&&_0x3a2ea9[_0x3edc('0xa6')]>0x0){return Promise[_0x3edc('0xb6')]()[_0x3edc('0x44')](cmHopper[_0x3edc('0x149')](_[_0x3edc('0x14a')](_0x5e3038,'id'),previewRecallmeReminderInterval,_['map'](_0x3a2ea9,'id')))[_0x3edc('0x44')](function(_0x1218c0){for(var _0x3ef22e=0x0;_0x3ef22e<_0x1218c0[_0x3edc('0xa6')];_0x3ef22e++){var _0x4d3943=_0x1218c0[_0x3ef22e][_0x3edc('0x14b')][_0x3edc('0x4e')];if(_0x4d3943)io['to'](util[_0x3edc('0x4c')]('user:%s',_0x4d3943))['emit'](_0x3edc('0x14c'),{'hopper':_0x1218c0[_0x3ef22e]});}})[_0x3edc('0xac')](function(_0xeb37a3){logger['error'](_0x3edc('0x14d'),_0xeb37a3);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x3edc('0x42')]=function(){var _0x3b6fa2=this;setInterval(function(){_0x3b6fa2['clearZombieChannels'](_0x3b6fa2[_0x3edc('0xc9')],_0x3edc('0x14e'));_0x3b6fa2[_0x3edc('0x14f')](_0x3b6fa2[_0x3edc('0x27')],_0x3edc('0x150'));},0x32c8);};Dialer['prototype'][_0x3edc('0x14f')]=function(_0xa6da00,_0x4d4083){var _0x23ad8b=this;for(var _0x2bcf42 in _0xa6da00){if(typeof _0xa6da00[_0x2bcf42]!==_0x3edc('0x151')){this[_0x3edc('0x20')]['enqueue'](function(){if(!_['isNil'](_0xa6da00[_0x2bcf42])){return ami[_0x3edc('0xa7')]({'action':'status','channel':_0xa6da00[_0x2bcf42]['channel']})[_0x3edc('0xac')](function(_0x55ef2e){if(_0x55ef2e[_0x3edc('0x74')]===_0x3edc('0x152')){setTimeout(function(){if(_0xa6da00[_0x2bcf42]&&_0xa6da00[_0x2bcf42][_0x3edc('0x48')]!=='ivr'){_0x23ad8b['updateOriginated'](_0x23ad8b[_0x3edc('0x22')][_0xa6da00[_0x2bcf42][_0x3edc('0xcd')]]);logger[_0x3edc('0x6f')](_0x3edc('0x153'),_0x4d4083,_0x2bcf42,_0xa6da00[_0x2bcf42]['queue']);delete _0xa6da00[_0x2bcf42];}if(_0xa6da00[_0x2bcf42]&&_0xa6da00[_0x2bcf42][_0x3edc('0x48')]===_0x3edc('0xcb')){_0x23ad8b[_0x3edc('0xcc')](_0x23ad8b[_0x3edc('0xb5')][_0xa6da00[_0x2bcf42][_0x3edc('0xcd')]]);logger[_0x3edc('0x6f')](_0x3edc('0x154'),_0x4d4083,_0x2bcf42,_0xa6da00[_0x2bcf42]['queue']);delete _0xa6da00[_0x2bcf42];}},0x2328);}});}});}}};Dialer[_0x3edc('0x1d')][_0x3edc('0x155')]=function(_0x5b6261){return Promise[_0x3edc('0xb6')]()[_0x3edc('0x44')](voiceQueueRt[_0x3edc('0x155')](_0x5b6261))[_0x3edc('0xac')](loggerCatch(_0x3edc('0x156')));};Dialer[_0x3edc('0x1d')][_0x3edc('0xcc')]=function(_0x3cdadb){if(!_[_0x3edc('0x46')](_0x3cdadb)&&_0x3cdadb!==null){if(typeof _0x3cdadb[_0x3edc('0x8d')]!==_0x3edc('0x151')){if(_0x3cdadb[_0x3edc('0x8d')]>0x0){_0x3cdadb[_0x3edc('0x8d')]-=0x1;}else{logger['error'](_0x3edc('0x157'));}}}else{logger['error'](_0x3edc('0x158'));}};Dialer[_0x3edc('0x1d')][_0x3edc('0x159')]=function(_0x22c23e,_0x5a18c3){var _0x356fd2=this;return function(_0x90ea08){_0x356fd2[_0x3edc('0xcc')](_0x5a18c3);logger['error'](_0x22c23e,util[_0x3edc('0x4b')](_0x90ea08,{'showHidden':![],'depth':null}));};};Dialer[_0x3edc('0x1d')]['emptyContact']=function(_0x5b2eae,_0x40bf86,_0x465b61){var _0x3c4862={'state':0x19,'statedesc':_0x3edc('0x15a')};this[_0x3edc('0xcc')](_0x40bf86);this[_0x3edc('0x11c')](_['merge'](_0x3c4862,_[_0x3edc('0x80')](_0x465b61,[_0x3edc('0xe8'),'ListId',_0x3edc('0x15b'),_0x3edc('0xf7'),_0x3edc('0xea')])),'[emptyContact][createHistory]',_0x3edc('0x15c'));logger[_0x3edc('0x6f')](_0x5b2eae);};Dialer[_0x3edc('0x1d')]['saveInDb']=function(_0x5904e7,_0x489415,_0x455458){hopperUtils[_0x3edc('0xee')](_0x5904e7)[_0x3edc('0xac')](loggerCatch(_0x489415));hopperUtils[_0x3edc('0x13c')](_0x5904e7)[_0x3edc('0xac')](loggerCatch(_0x455458));};Dialer[_0x3edc('0x1d')]['queueCallerAbandonCreateState']=function(_0x1e3320,_0x17ee82){hopperUtils[_0x3edc('0xee')](_0x1e3320)[_0x3edc('0xac')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x17ee82==0x0){hopperUtils['moveContactManagedDialer'](_0x1e3320)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x15d')));}};Dialer[_0x3edc('0x1d')][_0x3edc('0x14d')]=function(_0x10255f){return Promise[_0x3edc('0xb6')]()['then'](cmHopper[_0x3edc('0x149')](_0x10255f['id'],previewRecallmeReminderInterval))[_0x3edc('0x44')](function(_0x572cfa){for(var _0x1e4736=0x0;_0x1e4736<_0x572cfa[_0x3edc('0xa6')];_0x1e4736++){var _0x3cb641=_0x572cfa[_0x1e4736][_0x3edc('0x14b')][_0x3edc('0x4e')];if(_0x3cb641)io['to'](util['format'](_0x3edc('0x15e'),_0x3cb641))[_0x3edc('0x47')](_0x3edc('0x14c'),{'hopper':_0x572cfa[_0x1e4736]});}})['catch'](function(){});};Dialer['prototype'][_0x3edc('0xb9')]=function(_0x52107a){var _0x1d63dd=this;return function(){_0x1d63dd[_0x3edc('0x15f')](_0x52107a);};};Dialer[_0x3edc('0x1d')]['actionOriginate']=function(_0x4a835e,_0x2f7b02){var _0x6a6f2f=this;var _0x930fd6=uuid['v4']();this[_0x3edc('0x27')][_0x930fd6]=new Action(_0x4a835e,_0x2f7b02,_0x930fd6);return new Promise(function(_0x132e6a,_0x36232f){if(_['isUndefined'](_0x4a835e)&&typeof _0x4a835e!=='object'){return _0x36232f(msgResponse(_0x3edc('0x160'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0x3edc('0x46')](_0x2f7b02[_0x3edc('0x161')])||_0x2f7b02[_0x3edc('0x161')]===null){return _0x36232f(msgResponse(_0x3edc('0x160'),_0x3edc('0xa4'),_0x3edc('0x162')));}var _0xc9cae5={'XMD-CALLERID':_0x6a6f2f[_0x3edc('0x27')][_0x930fd6]['getCaller'](),'XMD-AGI':_0x4a835e[_0x3edc('0x136')]?util[_0x3edc('0x4c')](_0x3edc('0x163'),ipAgi,_0x4a835e[_0x3edc('0x136')]):_0x3edc('0x164'),'XMD-AGIAFTER':_0x4a835e[_0x3edc('0xd2')]?util['format'](_0x3edc('0x163'),ipAgi,_0x4a835e[_0x3edc('0xd2')]):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x4a835e)?util['format'](_0x3edc('0x165'),_0x4a835e['name'],_0x4a835e[_0x3edc('0x166')]||'',_0x4a835e['dialAgiAfterHangupAgent']?'c':'',_0x4a835e[_0x3edc('0xd7')]||0x3):_0x3edc('0x164'),'XMD-CONTACTID':_0x2f7b02[_0x3edc('0xe8')],'XMD-CDRTYPE':_0x3edc('0x7'),'CALLERID(all)':_0x6a6f2f[_0x3edc('0x27')][_0x930fd6][_0x3edc('0x167')](),'XMD-AMD':_0x4a835e[_0x3edc('0x115')]?'ACTIVE':'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4a835e[_0x3edc('0x115')]){_0xc9cae5[_0x3edc('0x168')]=_0x4a835e[_0x3edc('0x169')]||0x9c4;_0xc9cae5[_0x3edc('0x16a')]=_0x4a835e[_0x3edc('0x16b')]||0x5dc;_0xc9cae5['XMD-AMDAFTERGREETINGSILENCE']=_0x4a835e[_0x3edc('0x16c')]||0x320;_0xc9cae5[_0x3edc('0x16d')]=_0x4a835e[_0x3edc('0x16e')]||0x1388;_0xc9cae5[_0x3edc('0x16f')]=_0x4a835e['dialAMDMinWordLength']||0x64;_0xc9cae5[_0x3edc('0x170')]=_0x4a835e[_0x3edc('0x171')]||0x32;_0xc9cae5[_0x3edc('0x172')]=_0x4a835e[_0x3edc('0x173')]||0x3;_0xc9cae5[_0x3edc('0x174')]=_0x4a835e[_0x3edc('0x175')]||0x100;_0xc9cae5[_0x3edc('0x176')]=_0x4a835e[_0x3edc('0x177')]||0x1388;}if(utils[_0x3edc('0x178')](_0x4a835e)){_0xc9cae5[_0x3edc('0x179')]=_0x2f7b02[_0x3edc('0xf7')];}else{_0xc9cae5[_0x3edc('0x17a')]=_0x2f7b02[_0x3edc('0xea')];}var _0x268196=utils[_0x3edc('0x17b')](_0x2f7b02[_0x3edc('0x17c')]);Object[_0x3edc('0x17d')](_0xc9cae5,_0x268196);var _0x3c4d45=_0x6a6f2f[_0x3edc('0x92')](_0x4a835e['Trunk'])?utils[_0x3edc('0x17e')](_0x4a835e['Trunk'][_0x3edc('0x17f')],_0x4a835e[_0x3edc('0x180')],_0x4a835e['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x3edc('0x181')](_0x4a835e[_0x3edc('0x182')],_0x4a835e['dialRandomLastDigitCallerIdNumber']):_0x4a835e[_0x3edc('0x182')]):utils[_0x3edc('0x17e')](_['isNil'](_0x4a835e[_0x3edc('0x183')])?_0x4a835e[_0x3edc('0x98')][_0x3edc('0x17f')]:_0x4a835e[_0x3edc('0x183')][_0x3edc('0x17f')],_0x4a835e[_0x3edc('0x180')],_0x4a835e[_0x3edc('0x184')]>0x0?utils['getCallerIdRandom'](_0x4a835e[_0x3edc('0x182')],_0x4a835e[_0x3edc('0x184')]):_0x4a835e[_0x3edc('0x182')]);if(_0x3c4d45){_0xc9cae5[_0x3edc('0x185')]=_0x6a6f2f[_0x3edc('0x27')][_0x930fd6]['originatecalleridname']=utils[_0x3edc('0x186')](_0x3c4d45);_0xc9cae5[_0x3edc('0x187')]=_0x2f7b02[_0x3edc('0x161')];}_0x4a835e[_0x3edc('0x188')]=_0xc9cae5;return ami[_0x3edc('0xa7')]({'actionid':_0x930fd6,'action':_0x3edc('0x160'),'channel':_0x6a6f2f[_0x3edc('0x92')](_0x4a835e['Trunk'])?util[_0x3edc('0x4c')](_0x3edc('0x189'),_0x4a835e[_0x3edc('0x98')][_0x3edc('0x4e')],isNotNull(_0x4a835e[_0x3edc('0x18a')])?_0x4a835e[_0x3edc('0x18a')]['trim']()||'':'',_0x4a835e[_0x3edc('0x18b')]>0x0?_0x2f7b02[_0x3edc('0x161')][_0x3edc('0x18c')](_0x4a835e[_0x3edc('0x18b')]):_0x2f7b02['phone']):util[_0x3edc('0x4c')](_0x3edc('0x189'),_[_0x3edc('0xfe')](_0x4a835e[_0x3edc('0x183')])?_0x4a835e[_0x3edc('0x98')]['name']:_0x4a835e['TrunkBackup'][_0x3edc('0x4e')],isNotNull(_0x4a835e[_0x3edc('0x18a')])?_0x4a835e['dialPrefix'][_0x3edc('0x18d')]()||'':'',_0x4a835e[_0x3edc('0x18b')]>0x0?_0x2f7b02[_0x3edc('0x161')][_0x3edc('0x18c')](_0x4a835e[_0x3edc('0x18b')]):_0x2f7b02[_0x3edc('0x161')]),'callerid':_0x3c4d45,'Exten':_0x3edc('0x114'),'Context':'from-sip','Priority':'1','variable':_0xc9cae5,'timeout':(_0x4a835e['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x930fd6})[_0x3edc('0x44')](function(_0x1ae3f5){return _0x132e6a(_0x1ae3f5);})[_0x3edc('0xac')](function(_0x329515){_0x4a835e['outboundOriginateFailureCallsDay']+=0x1;var _0x494996=new History(_0x6a6f2f[_0x3edc('0x27')][_0x930fd6]);logger[_0x3edc('0x6f')](util['format'](_0x3edc('0x18e'),JSON[_0x3edc('0x91')](_0x329515)));_0x494996[_0x3edc('0x7a')]=0xe;_0x494996[_0x3edc('0xda')]=_0x3edc('0x18f');_0x494996[_0x3edc('0x7c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x494996[_0x3edc('0x7b')]=_0x494996[_0x3edc('0x7c')];hopperUtils[_0x3edc('0xee')](_0x494996)['catch'](loggerCatch(_0x3edc('0x190')));_0x6a6f2f['moveContactManagedDialer'](_0x494996)[_0x3edc('0xac')](loggerCatch('[originate][error]'))[_0x3edc('0x105')](function(){delete _0x6a6f2f[_0x3edc('0x27')][_0x930fd6];return _0x36232f(msgResponse(_0x3edc('0x160'),_0x3edc('0x191'),_0x3edc('0x192')));});});});};Dialer[_0x3edc('0x1d')][_0x3edc('0x193')]=function(_0x360bed,_0x48d742,_0x4c826d){var _0x9ca4b4=new History(_0x48d742);if(_0x9ca4b4[_0x3edc('0x123')]+_0x9ca4b4[_0x3edc('0x124')]+_0x9ca4b4[_0x3edc('0x125')]+_0x9ca4b4[_0x3edc('0x126')]+_0x9ca4b4[_0x3edc('0xdd')]+_0x9ca4b4[_0x3edc('0xf3')]+_0x9ca4b4[_0x3edc('0x122')]+_0x9ca4b4[_0x3edc('0x12f')]>=_0x4c826d[_0x3edc('0x127')]-0x1){return!![];}switch(_0x360bed){case 0x3:if(_0x9ca4b4[_0x3edc('0x125')]>=_0x4c826d[_0x3edc('0x194')]-0x1){return!![];}hopperUtils[_0x3edc('0xe5')]({'active':![],'countnoanswerretry':_0x9ca4b4['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x3edc('0xe6')](_0x4c826d[_0x3edc('0x195')],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x9ca4b4[_0x3edc('0xe8')],'ListId':_0x9ca4b4[_0x3edc('0xe9')],'VoiceQueueId':_0x9ca4b4['VoiceQueueId']||undefined,'CampaignId':_0x9ca4b4['CampaignId']||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x196')));break;case 0x5:if(_0x9ca4b4[_0x3edc('0x123')]>=_0x4c826d[_0x3edc('0x197')]-0x1){return!![];}hopperUtils[_0x3edc('0xe5')]({'active':![],'countbusyretry':_0x9ca4b4[_0x3edc('0x123')]+=0x1,'scheduledat':moment()[_0x3edc('0xe6')](_0x4c826d['dialBusyRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x9ca4b4[_0x3edc('0xe8')],'ListId':_0x9ca4b4['ListId'],'VoiceQueueId':_0x9ca4b4[_0x3edc('0xf7')]||undefined,'CampaignId':_0x9ca4b4['CampaignId']||undefined})[_0x3edc('0xac')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x9ca4b4[_0x3edc('0x124')]>=_0x4c826d[_0x3edc('0x198')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x9ca4b4[_0x3edc('0x124')]+=0x1,'scheduledat':moment()['add'](_0x4c826d[_0x3edc('0x199')],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x9ca4b4['ContactId'],'ListId':_0x9ca4b4[_0x3edc('0xe9')],'VoiceQueueId':_0x9ca4b4[_0x3edc('0xf7')]||undefined,'CampaignId':_0x9ca4b4[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x19a')));break;case 0x0:if(_0x9ca4b4[_0x3edc('0x126')]>=_0x4c826d[_0x3edc('0x19b')]-0x1){return!![];}else{hopperUtils[_0x3edc('0xe5')]({'active':![],'countnosuchnumberretry':_0x9ca4b4['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x3edc('0xe6')](_0x4c826d[_0x3edc('0x19c')],_0x3edc('0xe7'))[_0x3edc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x9ca4b4['ContactId'],'ListId':_0x9ca4b4['ListId'],'VoiceQueueId':_0x9ca4b4[_0x3edc('0xf7')]||undefined,'CampaignId':_0x9ca4b4[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x19d')));}break;case 0xa:if(_0x9ca4b4[_0x3edc('0xdd')]>=_0x4c826d[_0x3edc('0xe4')]-0x1){return!![];}hopperUtils[_0x3edc('0xe5')]({'active':![],'countdropretry':_0x9ca4b4[_0x3edc('0xdd')]+=0x1,'scheduledat':moment()[_0x3edc('0xe6')](_0x4c826d[_0x3edc('0xdf')],_0x3edc('0xe7'))['format'](_0x3edc('0xcf')),'ContactId':_0x9ca4b4[_0x3edc('0xe8')],'ListId':_0x9ca4b4['ListId'],'VoiceQueueId':_0x9ca4b4['VoiceQueueId']||undefined,'CampaignId':_0x9ca4b4[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0xeb')));break;case 0xb:if(_0x9ca4b4['countabandonedretry']>=_0x4c826d[_0x3edc('0xf5')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x9ca4b4['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x4c826d[_0x3edc('0xf4')],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x9ca4b4[_0x3edc('0xe8')],'ListId':_0x9ca4b4[_0x3edc('0xe9')],'VoiceQueueId':_0x9ca4b4['VoiceQueueId']||undefined,'CampaignId':_0x9ca4b4[_0x3edc('0xea')]||undefined})['catch'](loggerCatch(_0x3edc('0xf8')));break;case 0x13:if(_0x9ca4b4[_0x3edc('0x122')]>=_0x4c826d['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x9ca4b4[_0x3edc('0x122')]+=0x1,'scheduledat':moment()[_0x3edc('0xe6')](_0x4c826d[_0x3edc('0x12b')],_0x3edc('0xe7'))['format'](_0x3edc('0xcf')),'ContactId':_0x9ca4b4[_0x3edc('0xe8')],'ListId':_0x9ca4b4[_0x3edc('0xe9')],'VoiceQueueId':_0x9ca4b4[_0x3edc('0xf7')]||undefined,'CampaignId':_0x9ca4b4[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x132')));break;case 0x14:if(_0x9ca4b4['countagentrejectretry']>=_0x4c826d[_0x3edc('0x19e')]-0x1){return!![];}hopperUtils[_0x3edc('0xe5')]({'active':![],'countagentrejectretry':_0x9ca4b4['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x3edc('0xe6')](_0x4c826d[_0x3edc('0x19f')],'minutes')[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x9ca4b4[_0x3edc('0xe8')],'ListId':_0x9ca4b4[_0x3edc('0xe9')],'VoiceQueueId':_0x9ca4b4[_0x3edc('0xf7')]||undefined,'CampaignId':_0x9ca4b4[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1a0')));break;default:return!![];}};Dialer[_0x3edc('0x1d')][_0x3edc('0x110')]=function(_0x26c6bb,_0x262b50,_0x21da66){var _0x3bef26=this;var _0x4a5bd6=new History(_0x26c6bb);var _0x535a20=![];var _0x59f7ba;var _0x51e5e1;return new Promise(function(_0x5f5950,_0x47d583){if(_[_0x3edc('0x46')](_0x262b50)&&typeof _0x262b50!=='object'){return _0x47d583(msgResponse(_0x3edc('0x1a1'),_0x3edc('0xa4'),_0x3edc('0x1a2')));}if(_[_0x3edc('0x46')](_0x21da66)&&typeof _0x21da66!==_0x3edc('0x1a3')){return _0x47d583(msgResponse(_0x3edc('0x1a1'),'Failure',_0x3edc('0x1a4')));}hopperUtils['verifyAdditionalPhones'](_0x4a5bd6,_0x21da66[_0x3edc('0x1a5')],_0x262b50)[_0x3edc('0x44')](function(_0x44a5ed){if(_0x44a5ed[_0x3edc('0xe3')]==0x1)_0x535a20=!![];switch(_0x21da66['reason']){case'0':_0x262b50[_0x3edc('0x1a6')]+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0x0;_0x4a5bd6[_0x3edc('0xda')]=_0x3edc('0x1a7');_0x4a5bd6[_0x3edc('0x126')]+=0x1;_0x4a5bd6[_0x3edc('0xde')]+=0x1;ami[_0x3edc('0x47')]('custom:agentnosuchnumber',ut[_0x3edc('0x11a')](_0x26c6bb,_0x3edc('0x1a8')));_0x59f7ba=_0x262b50[_0x3edc('0x19c')];_0x51e5e1=_0x262b50[_0x3edc('0xe0')];hopperUtils[_0x3edc('0xee')](_0x4a5bd6)['catch'](loggerCatch(_0x3edc('0x1a9')));if(_0x3bef26['checkRetriveMax'](0x0,_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0x126')]>=_0x262b50[_0x3edc('0x19b')]){_0x3bef26[_0x3edc('0x131')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1aa'));}else{_0x3bef26[_0x3edc('0x130')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1aa'));}}break;case'3':_0x262b50[_0x3edc('0x1ab')]+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0x3;_0x4a5bd6[_0x3edc('0xda')]=_0x3edc('0x1ac');_0x4a5bd6[_0x3edc('0x125')]+=0x1;_0x4a5bd6['countglobal']+=0x1;var _0x517590=ut[_0x3edc('0x1ad')](_0x26c6bb,_0x262b50);ami['emit'](_0x3edc('0x1ae'),_0x517590);_0x59f7ba=_0x262b50[_0x3edc('0x195')];_0x51e5e1=_0x262b50['callAdditionalPhoneAfterMin'];hopperUtils[_0x3edc('0xee')](_0x4a5bd6)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1af')));if(_0x3bef26[_0x3edc('0x193')](0x3,_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0x125')]>=_0x262b50['dialNoAnswerMaxRetry']){_0x3bef26['createStateFinal'](_0x4a5bd6,_0x5f5950,_0x47d583,'reason\x203\x20ringing\x20no\x20answer');}else{_0x3bef26[_0x3edc('0x130')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1b0'));}}break;case'5':_0x262b50['outboundBusyCallsDay']+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0x5;_0x4a5bd6[_0x3edc('0xda')]='Busy';_0x4a5bd6[_0x3edc('0x123')]+=0x1;_0x4a5bd6[_0x3edc('0xde')]+=0x1;ami[_0x3edc('0x47')]('custom:agentbusy',ut[_0x3edc('0x11a')](_0x26c6bb,'busy'));_0x59f7ba=_0x262b50[_0x3edc('0x1b1')];_0x51e5e1=_0x262b50[_0x3edc('0xe0')];hopperUtils[_0x3edc('0xee')](_0x4a5bd6)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1b2')));if(_0x3bef26[_0x3edc('0x193')](0x5,_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0x123')]>=_0x262b50[_0x3edc('0x197')]){_0x3bef26[_0x3edc('0x131')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1b3'));}else{_0x3bef26[_0x3edc('0x130')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1b3'));}}break;case'8':_0x262b50[_0x3edc('0x1b4')]+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0x8;_0x4a5bd6[_0x3edc('0xda')]=_0x3edc('0x1b5');_0x4a5bd6[_0x3edc('0x124')]+=0x1;_0x4a5bd6[_0x3edc('0xde')]+=0x1;_0x59f7ba=_0x262b50['dialCongestionRetryFrequency'];_0x51e5e1=_0x262b50[_0x3edc('0xe0')];ami['emit']('custom:agentcongestion',ut['buildObj'](_0x26c6bb,_0x3edc('0x1b6')));hopperUtils[_0x3edc('0xee')](_0x4a5bd6)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1b7')));if(_0x3bef26[_0x3edc('0x193')](0x8,_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0x124')]>=_0x262b50['dialCongestionMaxRetry']){_0x3bef26[_0x3edc('0x131')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1b8'));}else{_0x3bef26[_0x3edc('0x130')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1b8'));}}break;case'11':_0x262b50[_0x3edc('0x1b9')]+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0xb;_0x4a5bd6['statedesc']='Abandoned';_0x4a5bd6[_0x3edc('0xf3')]+=0x1;_0x4a5bd6['countglobal']+=0x1;_0x59f7ba=_0x262b50[_0x3edc('0xf4')];_0x51e5e1=_0x262b50[_0x3edc('0xe0')];hopperUtils[_0x3edc('0xee')](_0x4a5bd6)[_0x3edc('0xac')](loggerCatch(_0x3edc('0xf9')));if(_0x3bef26['checkRetriveMax'](0xb,_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0xf3')]>=_0x262b50[_0x3edc('0xf5')]){_0x3bef26[_0x3edc('0x131')](_0x4a5bd6,_0x5f5950,_0x47d583,'reason\x2011\x20abandoned');}else{_0x3bef26[_0x3edc('0x130')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1ba'));}}break;case'20':_0x262b50[_0x3edc('0x1bb')]+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0x14;_0x4a5bd6[_0x3edc('0xda')]=_0x3edc('0x1bc');_0x4a5bd6[_0x3edc('0x12f')]+=0x1;_0x4a5bd6[_0x3edc('0xde')]+=0x1;_0x59f7ba=_0x262b50[_0x3edc('0x19f')];_0x51e5e1=_0x262b50[_0x3edc('0xe0')];ami[_0x3edc('0x47')](_0x3edc('0x1bd'),ut['buildObj'](_0x26c6bb,_0x3edc('0x1be')));hopperUtils['createHistory'](_0x4a5bd6)['catch'](loggerCatch(_0x3edc('0x1bf')));if(_0x3bef26['checkRetriveMax'](0x14,_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0x12f')]>=_0x262b50[_0x3edc('0x19e')]){_0x3bef26[_0x3edc('0x131')](_0x4a5bd6,_0x5f5950,_0x47d583,'reason\x2020\x20agentreject');}else{_0x3bef26[_0x3edc('0x130')](_0x4a5bd6,_0x5f5950,_0x47d583,'reason\x2020\x20agentreject');}}break;default:_0x262b50[_0x3edc('0x139')]+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0xc;_0x4a5bd6[_0x3edc('0xda')]=_0x21da66[_0x3edc('0x1a5')];_0x59f7ba=_0x262b50[_0x3edc('0x19f')];_0x51e5e1=_0x262b50[_0x3edc('0xe0')];hopperUtils[_0x3edc('0xee')](_0x4a5bd6)[_0x3edc('0xac')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x3bef26[_0x3edc('0x193')](_0x21da66[_0x3edc('0x1a5')],_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0x123')]+_0x4a5bd6[_0x3edc('0x124')]+_0x4a5bd6[_0x3edc('0x125')]+_0x4a5bd6['countnosuchnumberretry']+_0x4a5bd6[_0x3edc('0xdd')]+_0x4a5bd6[_0x3edc('0xf3')]+_0x4a5bd6[_0x3edc('0x122')]+_0x4a5bd6[_0x3edc('0x12f')]>=_0x262b50['dialGlobalMaxRetry']){_0x3bef26['stateGlobal'](_0x4a5bd6,_0x5f5950,_0x47d583,_0x21da66['reason']);}else{_0x3bef26[_0x3edc('0x131')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x21da66[_0x3edc('0x1a5')]);}}}})[_0x3edc('0x44')](function(){if(_0x535a20){hopperUtils[_0x3edc('0xf0')](_0x4a5bd6,_0x59f7ba,_0x51e5e1)[_0x3edc('0x44')](function(){return _0x5f5950(0x1);});}});});};Dialer['prototype'][_0x3edc('0x130')]=function(_0x3a8ada,_0xb15477,_0x170cb9,_0x22158f){var _0x3678a6=new Final(_0x3a8ada);_0x3678a6[_0x3edc('0x7a')]=0xf;_0x3678a6[_0x3edc('0xda')]=_0x3edc('0x1c0');this[_0x3edc('0x131')](_0x3678a6,_0xb15477,_0x170cb9,_0x22158f);};Dialer[_0x3edc('0x1d')]['createStateFinal']=function(_0x1d8651,_0x57d01a,_0x2321ab,_0x487638){hopperUtils[_0x3edc('0x13c')](_0x1d8651)[_0x3edc('0x44')](function(){return _0x57d01a(msgResponse(_0x3edc('0x1a1'),_0x3edc('0x10f'),_0x487638));})['catch'](function(){return _0x2321ab(msgResponse(_0x3edc('0x1c1'),'Failure',_0x3edc('0x1c2')));});};Dialer['prototype']['predictive']=function(_0x24f406){var _0x4ff43f=_0x24f406[_0x3edc('0x1c3')]/0x64;var _0x46255f=_0x24f406['outboundDropCallsDayTimeout']/(_0x24f406[_0x3edc('0xd8')]+_0x24f406['outboundAnswerCallsDay']);var _0x53f86b=Math[_0x3edc('0x1c4')](_0x24f406[_0x3edc('0x1c5')]*(_0x24f406['predictiveIntervalMaxThreshold']/0x64));var _0xdcffa4=Math[_0x3edc('0x1c4')](_0x24f406[_0x3edc('0x1c5')]*(_0x24f406['predictiveIntervalMinThreshold']/0x64));var _0x57cc29=_0x24f406[_0x3edc('0x1c6')]+_0x24f406[_0x3edc('0x141')];var _0x52b98d=Math['floor'](_0x24f406[_0x3edc('0x63')]*_0x24f406[_0x3edc('0x68')]*_0x24f406[_0x3edc('0x1c7')]*_0x24f406[_0x3edc('0x1c8')]);if(_[_0x3edc('0x46')](_0x24f406[_0x3edc('0x2a')])){if(!_[_0x3edc('0x46')](_0x24f406[_0x3edc('0x29')])){_0x24f406[_0x3edc('0x29')]=undefined;loggerPredictive[_0x3edc('0x6f')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x3edc('0x46')](_0x24f406[_0x3edc('0x6d')])){loggerPredictive[_0x3edc('0x6f')](_0x3edc('0x1c9'),_0x3edc('0x1ca'));clearInterval(_0x24f406['handlePredictive']);_0x24f406['handlePredictive']=undefined;}_0x24f406[_0x3edc('0x2a')]=moment()[_0x3edc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x24f406[_0x3edc('0x4e')],_0x3edc('0x1cb'),_0x24f406[_0x3edc('0x2a')]);this[_0x3edc('0xbf')](_0x24f406,0x1);}else if(ifInterval(_0x24f406[_0x3edc('0x1cc')],_0x24f406[_0x3edc('0x2a')])){this[_0x3edc('0xbf')](_0x24f406,0x1);loggerPredictiveCalls[_0x3edc('0x51')](_0x3edc('0x1cd'),_0x24f406['startProgressive'],_0x24f406['name']);_0x24f406['erlangCalls']=0x0;_0x24f406[_0x3edc('0xd9')]=0x0;}else if(_0x4ff43f<_0x46255f&&_0x24f406[_0x3edc('0x1ce')]==='dropRate'){clearPredictiveAttributes(_0x24f406);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x1cf'),'Dropped\x20calls\x20day',_0x46255f,'startProgressive',_0x24f406[_0x3edc('0x4e')]);}else if(_0x52b98d<_0x24f406['predictiveIntervalErlangCallsDroppedCalls']&&_0x24f406[_0x3edc('0x1ce')]===_0x3edc('0x1d0')){clearPredictiveAttributes(_0x24f406);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x1d1'),_0x3edc('0x1d2'),_0x52b98d,'Drop\x20in\x20this\x20interval',_0x24f406[_0x3edc('0xd9')],_0x3edc('0x2a'),_0x24f406[_0x3edc('0x4e')]);}else if(!ifInterval(_0x24f406[_0x3edc('0x1cc')],_0x24f406['startProgressive'])&&_[_0x3edc('0x46')](_0x24f406[_0x3edc('0x29')])&&!_[_0x3edc('0x46')](_0x24f406[_0x3edc('0x2a')])){_0x24f406[_0x3edc('0x29')]=moment()[_0x3edc('0x4c')](_0x3edc('0xcf'));loggerPredictive[_0x3edc('0x51')](_0x24f406['name'],_0x3edc('0x1d3'),_0x24f406['startPredictive']);hopperUtils['avgHandleTime'](_0x24f406[_0x3edc('0x1cc')])[_0x3edc('0x44')](this[_0x3edc('0x1d4')](_0x24f406))[_0x3edc('0x44')](mergeDataErlangB(_0x24f406))[_0x3edc('0x44')](this['startMethodPredictive'](_0x24f406))[_0x3edc('0xac')](loggerCatchPredictive(_0x3edc('0x1d5'),_0x24f406));}else if(!ifInterval(_0x24f406[_0x3edc('0x1cc')],_0x24f406[_0x3edc('0x29')])){_0x24f406[_0x3edc('0xd9')]=0x0;_0x24f406[_0x3edc('0x29')]=moment()[_0x3edc('0x4c')](_0x3edc('0xcf'));loggerPredictive[_0x3edc('0x51')](_0x24f406['name'],_0x3edc('0x1d6'),_0x24f406['startPredictive']);clearInterval(_0x24f406['handlePredictive']);_0x24f406[_0x3edc('0x6d')]=undefined;hopperUtils['avgHandleTime'](_0x24f406[_0x3edc('0x1cc')])['then'](this[_0x3edc('0x1d4')](_0x24f406))['then'](mergeDataErlangB(_0x24f406))[_0x3edc('0x44')](this['startMethodPredictive'](_0x24f406))[_0x3edc('0xac')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x24f406));}else if(_0x24f406['predictiveIntervalAvailable']&&_0x57cc29<_0x24f406[_0x3edc('0x1c5')]-_0xdcffa4){clearPredictiveAttributes(_0x24f406);loggerPredictive[_0x3edc('0x51')](_0x24f406[_0x3edc('0x4e')],_0x3edc('0x1d7'),_0x57cc29,_0x3edc('0x1d8'),_0x24f406[_0x3edc('0x1c5')],'-',_0xdcffa4,'=',_0x24f406[_0x3edc('0x1c5')]-_0xdcffa4,')');}else if(_0x24f406['predictiveIntervalAvailable']&&_0x57cc29>_0x24f406[_0x3edc('0x1c5')]+_0x53f86b){clearPredictiveAttributes(_0x24f406);loggerPredictive[_0x3edc('0x51')](_0x24f406[_0x3edc('0x4e')],_0x3edc('0x1d7'),_0x57cc29,')\x20are\x20more\x20than\x20threshold\x20(',_0x24f406[_0x3edc('0x1c5')],'+',_0x53f86b,'=',_0x24f406[_0x3edc('0x1c5')]+_0x53f86b,')');}};Dialer[_0x3edc('0x1d')][_0x3edc('0x1d4')]=function(_0x42a0e4){var _0x4b3cc4=this;return function(_0x588ced){return new Promise(function(_0x5eaeb8,_0x594d60){_['merge'](_0x42a0e4,_0x588ced[0x0]);if(checkGetDataPredictive(_0x588ced[0x0])){var _0x1ccfa7=_0x42a0e4[_0x3edc('0x1c5')]=_0x42a0e4[_0x3edc('0x141')]+_0x42a0e4[_0x3edc('0x1c6')];var _0x1e2367=_0x42a0e4[_0x3edc('0x1cc')]*0x3c;var _0x3f0b33=_0x588ced[0x0][_0x3edc('0x5b')]+_0x588ced[0x0][_0x3edc('0x59')];var _0x4e26ea=(_0x588ced[0x0][_0x3edc('0x1d9')]+_0x588ced[0x0][_0x3edc('0x56')]+_0x588ced[0x0][_0x3edc('0x57')])/_0x588ced[0x0]['predictiveIntervalTotalCalls'];_0x42a0e4[_0x3edc('0x1c7')]=_0x4e26ea>0x0?_0x4e26ea:0x1;switch(_0x42a0e4[_0x3edc('0x1ce')]){case _0x3edc('0x1d0'):var _0x4b4880=_0x42a0e4[_0x3edc('0x1c3')]/0x64;return _0x4b3cc4[_0x3edc('0x1da')](_0x1ccfa7,_0x1e2367,_0x3f0b33,_0x4e26ea,_0x4b4880)[_0x3edc('0x44')](function(_0x438bf4){return _0x5eaeb8(_0x438bf4);});case _0x3edc('0x1db'):var _0x13d53c=_0x42a0e4[_0x3edc('0x1c3')]/0x64;return _0x4b3cc4['busyFactor'](_0x1ccfa7,_0x1e2367,_0x3f0b33,_0x4e26ea,_0x13d53c)[_0x3edc('0x44')](function(_0x35fdfa){return _0x5eaeb8(_0x35fdfa);});default:return _0x594d60(msgResponse('[getDataPredictive]',_0x3edc('0xa4'),_0x3edc('0x1dc')));}}else{return _0x594d60(msgResponse(_0x3edc('0x1dd'),_0x3edc('0xa4'),_0x3edc('0x1de')));}});};};Dialer[_0x3edc('0x1d')][_0x3edc('0x1df')]=function(_0x26d962){var _0x5739ae=this;return function(_0x37b351){return new Promise(function(_0x4dda4d,_0x470a60){_[_0x3edc('0x69')](_0x26d962,_0x37b351[0x0]);if(checkGetDataPredictive(_0x37b351[0x0])){loggerPredictive['info'](JSON[_0x3edc('0x91')](_0x37b351[0x0]));if(_0x26d962[_0x3edc('0x1ce')]===_0x3edc('0x1d0')){return _0x5739ae[_0x3edc('0x155')](_0x26d962['id'])[_0x3edc('0x44')](function(_0x28e218){var _0x1ab975=_0x26d962['loggedIn']-_0x28e218[0x0][_0x3edc('0x1e0')];var _0x46efcf=_0x26d962['dialPredictiveInterval']*0x3c;var _0x8b60a9=_0x37b351[0x0][_0x3edc('0x5b')]+_0x37b351[0x0][_0x3edc('0x59')];var _0x1f1391=(_0x37b351[0x0][_0x3edc('0x1d9')]+_0x37b351[0x0][_0x3edc('0x56')]+_0x37b351[0x0][_0x3edc('0x57')])/_0x37b351[0x0][_0x3edc('0x53')];var _0x4d804c=_0x26d962[_0x3edc('0x1c3')]/0x64;_0x26d962[_0x3edc('0x1e1')]=_0x28e218[0x0][_0x3edc('0x1e0')]||0x0;_0x26d962['predictiveIntervalHitRate']=_0x1f1391>0x0?_0x1f1391:0x1;return _0x5739ae['abandonmentRate'](_0x1ab975,_0x46efcf,_0x8b60a9,_0x1f1391,_0x4d804c);})[_0x3edc('0x44')](function(_0x30574e){return _0x4dda4d(_0x30574e);})['catch'](function(_0x2f3d8e){return _0x470a60(msgResponse(_0x3edc('0x1e2'),'Failure',JSON[_0x3edc('0x91')](_0x2f3d8e)));});}if(_0x26d962[_0x3edc('0x1ce')]===_0x3edc('0x1db')){return _0x5739ae[_0x3edc('0x155')](_0x26d962['id'])[_0x3edc('0x44')](function(_0x4d3965){var _0x433acc=_0x26d962[_0x3edc('0x1e3')]-_0x4d3965[0x0][_0x3edc('0x1e0')];var _0xf4b71a=_0x26d962['dialPredictiveInterval']*0x3c;var _0xd93e67=_0x37b351[0x0][_0x3edc('0x5b')]+_0x37b351[0x0]['predictiveIntervalAvgHoldtime'];var _0x5f44eb=(_0x37b351[0x0][_0x3edc('0x1d9')]+_0x37b351[0x0][_0x3edc('0x56')]+_0x37b351[0x0][_0x3edc('0x57')])/_0x37b351[0x0][_0x3edc('0x53')];var _0x5c1f91=_0x26d962[_0x3edc('0x1c3')]/0x64;_0x26d962[_0x3edc('0x1e1')]=_0x4d3965[0x0][_0x3edc('0x1e0')]||0x0;_0x26d962[_0x3edc('0x1c7')]=_0x5f44eb>0x0?_0x5f44eb:0x1;return _0x5739ae[_0x3edc('0x1e4')](_0x433acc,_0xf4b71a,_0xd93e67,_0x5f44eb,_0x5c1f91);})[_0x3edc('0x44')](function(_0x319773){return _0x4dda4d(_0x319773);})[_0x3edc('0xac')](function(_0x2f4747){return _0x470a60(msgResponse('[CatchErlangB]',_0x3edc('0xa4'),JSON[_0x3edc('0x91')](_0x2f4747)));});}}else{return _0x470a60(msgResponse('[getDataPredictive]',_0x3edc('0xa4'),_0x3edc('0x1de')));}});};};Dialer[_0x3edc('0x1d')][_0x3edc('0x1e5')]=function(_0x4ba3bb){var _0x24e336=this;return function(){var _0x15681d=0x0;var _0x89608=Math[_0x3edc('0x1e6')](_0x4ba3bb[_0x3edc('0x1e7')]*0x3e8);if(_0x89608>0x0){_0x89608=_0x89608<0x64?0x64:_0x89608;loggerPredictive[_0x3edc('0x51')](_0x4ba3bb[_0x3edc('0x4e')],_0x3edc('0x1e8'),_0x89608,_0x3edc('0x1e9'));_0x4ba3bb[_0x3edc('0x6d')]=setInterval(function(){_0x24e336[_0x3edc('0x6d')](_0x4ba3bb);loggerPredictiveCalls[_0x3edc('0x51')](_0x3edc('0x1ea'),_0x15681d+=0x1);},_0x89608);}else{loggerPredictive[_0x3edc('0x51')](_0x4ba3bb[_0x3edc('0x4e')],_0x3edc('0x1eb'));}};};Dialer[_0x3edc('0x1d')][_0x3edc('0x1ec')]=function(_0x55d13d,_0x134a46){var _0x337653=this;return function(_0x3f4970){if(_[_0x3edc('0x50')](_0x3f4970)){if(_[_0x3edc('0xfe')](_0x134a46[_0x3edc('0x15b')])||!_0x134a46[_0x3edc('0x1ed')]){if(_0x55d13d[_0x3edc('0xbc')]===_0x3edc('0x9')){_0x55d13d[_0x3edc('0x7d')]=_[_0x3edc('0x46')](_0x55d13d['queueStatusComplete'])?!![]:_0x55d13d['queueStatusComplete'];var _0x324a0e=uuid['v4']();_0x337653[_0x3edc('0x27')][_0x324a0e]=new Action(_0x55d13d,_0x134a46,_0x324a0e);loggerBooked[_0x3edc('0x51')](_0x3edc('0x1ee'),_0x324a0e,'queueStatusComplete:\x20',JSON[_0x3edc('0x91')](_0x55d13d[_0x3edc('0x7d')]),_0x3edc('0x1ef'),_0x55d13d[_0x3edc('0x4e')]);if(_0x55d13d[_0x3edc('0x7d')]){_0x55d13d[_0x3edc('0x7d')]=![];_0x337653[_0x3edc('0x2c')][_0x337653[_0x3edc('0x27')][_0x324a0e][_0x3edc('0xcd')]]=[];ami['Action']({'actionid':_0x324a0e,'action':'queuestatus','queue':_0x55d13d['name']})[_0x3edc('0xac')](function(){_0x337653[_0x3edc('0xcc')](_0x55d13d);hopperUtils[_0x3edc('0xe5')]({'active':![],'ContactId':_0x337653['actions'][_0x324a0e][_0x3edc('0xe8')],'ListId':_0x337653[_0x3edc('0x27')][_0x324a0e][_0x3edc('0xe9')],'VoiceQueueId':_0x337653['actions'][_0x324a0e][_0x3edc('0xf7')]||undefined,'CampaignId':_0x337653[_0x3edc('0x27')][_0x324a0e][_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1f0')));delete _0x337653[_0x3edc('0x27')][_0x324a0e];});}else{loggerBooked[_0x3edc('0x51')](_0x3edc('0x1f1'),JSON['stringify'](_0x55d13d[_0x3edc('0x7d')]),_0x3edc('0x1ef'),_0x55d13d[_0x3edc('0x4e')]);_0x337653[_0x3edc('0xcc')](_0x55d13d);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x337653['actions'][_0x324a0e]['ContactId'],'ListId':_0x337653[_0x3edc('0x27')][_0x324a0e]['ListId'],'VoiceQueueId':_0x337653[_0x3edc('0x27')][_0x324a0e][_0x3edc('0xf7')]||undefined,'CampaignId':_0x337653[_0x3edc('0x27')][_0x324a0e]['CampaignId']||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1f0')));delete _0x337653[_0x3edc('0x27')][_0x324a0e];}}else{return _0x337653[_0x3edc('0x1f2')](_0x55d13d,_0x134a46);}}else{if(utils[_0x3edc('0x6a')](undefined,_0x134a46[_0x3edc('0x1f3')])<_0x55d13d['dialRecallMeTimeout']*0x3c){if(_0x134a46[_0x3edc('0x14b')]&&!_0x134a46[_0x3edc('0x14b')][_0x3edc('0x1f4')]){_0x337653['preview']['run'](_0x134a46['id'])[_0x3edc('0x105')](function(){_0x337653[_0x3edc('0xcc')](_0x55d13d);});}else{hopperUtils[_0x3edc('0x1f5')]({'active':![]},_0x134a46['id'],0x1)[_0x3edc('0x105')](function(){_0x337653[_0x3edc('0xcc')](_0x55d13d);});}}else{_0x55d13d[_0x3edc('0x1f6')]+=0x1;_0x337653['updateOriginated'](_0x55d13d);if(_0x55d13d[_0x3edc('0x1f7')]){hopperUtils[_0x3edc('0xe5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x134a46[_0x3edc('0xe8')],'ListId':_0x134a46['ListId'],'VoiceQueueId':_0x134a46[_0x3edc('0xf7')]||undefined,'CampaignId':_0x134a46['CampaignId']||undefined})[_0x3edc('0xac')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x3edc('0xee')](createObjHistory(_0x55d13d,_0x134a46,utils[_0x3edc('0x81')]['QUEUE_RECALL'],0x17,_0x3edc('0x1f8')))[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1f9')));}else{_0x337653[_0x3edc('0x11c')](createObjHistory(_0x55d13d,_0x134a46,utils[_0x3edc('0x81')]['RECALL_TIMEOUT'],0x16,_0x3edc('0x1fa')),_0x3edc('0x1fb'),'[Originate][HistoryRecallClose]');}}}}else{_0x55d13d['outboundBlacklistCallsDay']+=0x1;_0x337653['saveInDb'](createObjHistory(_0x55d13d,_0x134a46,utils[_0x3edc('0x81')][_0x3edc('0x1fc')],0xd,_0x3edc('0x1fd')),_0x3edc('0x1fe'),'[Originate][MoveBlacklist]');throw _0x3edc('0x1ff');}};};Dialer['prototype']['handleIvr']=function(_0x25e671){var _0x44f5a9=this;var _0x592cfb=_0x25e671[_0x3edc('0x200')]-_0x25e671['originated'];emitCampaignSummary(_0x25e671);if(_0x592cfb>0x0&&_0x25e671[_0x3edc('0x72')]==0x0){if(_0x592cfb>this[_0x3edc('0x25')]){_0x592cfb=this[_0x3edc('0x25')];}_0x25e671[_0x3edc('0x72')]=0x1;hopperUtils[_0x3edc('0x201')](_0x25e671,_0x592cfb)[_0x3edc('0x44')](function(_0x303990){_0x25e671[_0x3edc('0x72')]=0x0;if(_0x303990){if(!utils[_0x3edc('0x202')](_0x303990)){_0x25e671['message']=utils[_0x3edc('0x81')][_0x3edc('0x78')];logger[_0x3edc('0x51')]('[getContactCampaign2][Empty]'+_0x25e671['name']);}else{_0x25e671[_0x3edc('0x8d')]+=_0x303990[_0x3edc('0xa6')];_0x25e671['message']=utils[_0x3edc('0x81')][_0x3edc('0x203')];for(var _0x167e78=0x0;_0x167e78<_0x303990['length'];_0x167e78+=0x1){_0x25e671[_0x3edc('0x204')]+=0x1;if(_[_0x3edc('0xfe')](_0x303990[_0x167e78])||_[_0x3edc('0xfe')](_0x303990[_0x167e78][_0x3edc('0x17c')])||_['isNil'](_0x303990[_0x167e78][_0x3edc('0x161')])){_0x44f5a9[_0x3edc('0x205')](_0x3edc('0x206'),_0x25e671,_0x303990[_0x167e78]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x3edc('0x80')](_0x303990[_0x167e78],[_0x3edc('0xea'),_0x3edc('0x161')]))['then'](_0x44f5a9[_0x3edc('0x1ec')](_0x25e671,_0x303990[_0x167e78]))[_0x3edc('0xac')](_0x44f5a9[_0x3edc('0x159')]('[actionOriginateIvr]\x20',_0x25e671));}}}}})[_0x3edc('0xac')](loggerGetContactDialer(_0x3edc('0x207'),_0x25e671,_0x592cfb));}};Dialer[_0x3edc('0x1d')][_0x3edc('0xbf')]=function(_0x3fc0ae,_0x5c0374){var _0x366599=this;var _0xeda835=[];if(_0x5c0374<0x1||_0x3fc0ae[_0x3edc('0xbc')]==='booked'){_0x5c0374=0x1;}var _0x25211d=Math[_0x3edc('0x1e6')](_0x3fc0ae[_0x3edc('0x1c6')]*_0x5c0374)-_0x3fc0ae[_0x3edc('0x8d')];if(_0x3fc0ae[_0x3edc('0x208')]>0x0){var _0x1f3a66=_0x3fc0ae['dialLimitQueue']-_0x3fc0ae[_0x3edc('0x8d')]-_0x3fc0ae[_0x3edc('0x141')]-_0x3fc0ae['pTalking'];if(_0x25211d>_0x1f3a66){_0x25211d=_0x1f3a66;}}if(_0x25211d>0x0&&_0x3fc0ae[_0x3edc('0x72')]==0x0){if(_0x3fc0ae[_0x3edc('0xbc')]===_0x3edc('0x9')){_0x25211d=0x1;}if(_0x25211d>this[_0x3edc('0x25')]){_0x25211d=this[_0x3edc('0x25')];}for(var _0x201b43 in this[_0x3edc('0x23')]){if(typeof this['agents'][_0x201b43]!==_0x3edc('0x151')){if(this[_0x3edc('0x23')][_0x201b43][_0x3edc('0x7a')]==='not_inuse'&&this[_0x3edc('0x23')][_0x201b43][_0x3edc('0x94')]===_0x3edc('0x95')){_0xeda835[_0x3edc('0xad')](this[_0x3edc('0x23')][_0x201b43]['id']);}}}_0x3fc0ae[_0x3edc('0x72')]=0x1;hopperUtils[_0x3edc('0x209')](_0x3fc0ae,_0xeda835,_0x25211d)['then'](function(_0x3c159b){_0x3fc0ae[_0x3edc('0x72')]=0x0;if(_0x3c159b){if(!utils[_0x3edc('0x202')](_0x3c159b)){hopperUtils[_0x3edc('0x20a')](_0x3fc0ae)['then'](sendMessageReschedule(_0x3fc0ae))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x3fc0ae[_0x3edc('0x8d')]+=_0x3c159b['length'];_0x3fc0ae[_0x3edc('0x74')]=_0x3fc0ae[_0x3edc('0xbc')]===_0x3edc('0x9')?utils[_0x3edc('0x81')][_0x3edc('0x143')]:utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x44e92f=0x0;_0x44e92f<_0x3c159b['length'];_0x44e92f+=0x1){if(_[_0x3edc('0xfe')](_0x3c159b[_0x44e92f])||_[_0x3edc('0xfe')](_0x3c159b[_0x44e92f][_0x3edc('0x17c')])||_[_0x3edc('0xfe')](_0x3c159b[_0x44e92f][_0x3edc('0x161')])){_0x366599['emptyContact'](_0x3edc('0x206'),_0x3fc0ae,_0x3c159b[_0x44e92f]);}else{hopperUtils[_0x3edc('0x20b')](_[_0x3edc('0x80')](_0x3c159b[_0x44e92f],[_0x3edc('0xf7'),_0x3edc('0x161')]))[_0x3edc('0x44')](_0x366599[_0x3edc('0x1ec')](_0x3fc0ae,_0x3c159b[_0x44e92f]))['catch'](_0x366599[_0x3edc('0x159')](_0x3edc('0x206'),_0x3fc0ae));}}}}})[_0x3edc('0xac')](loggerGetContactDialer(_0x3edc('0x20c'),_0x3fc0ae,_0x25211d));}};Dialer[_0x3edc('0x1d')][_0x3edc('0x6d')]=function(_0x18ce52){if(_0x18ce52[_0x3edc('0x208')]>0x0){var _0x146699=_0x18ce52[_0x3edc('0x208')]-_0x18ce52[_0x3edc('0x8d')]-_0x18ce52[_0x3edc('0x141')];if(_0x146699>0x0&&_0x18ce52[_0x3edc('0x72')]==0x0){this[_0x3edc('0x20d')](_0x18ce52);}else{loggerPredictiveCalls[_0x3edc('0x51')]('[handlePredictive][limitChannel]');}}else{this[_0x3edc('0x20d')](_0x18ce52);}};Dialer[_0x3edc('0x1d')][_0x3edc('0x20d')]=function(_0x3026a9){var _0x553a34=this;var _0x5d08d0=[];_0x3026a9[_0x3edc('0x8d')]+=0x1;for(var _0x4908e7 in this[_0x3edc('0x23')]){if(typeof this[_0x3edc('0x23')][_0x4908e7]!==_0x3edc('0x151')){if(this[_0x3edc('0x23')][_0x4908e7][_0x3edc('0x7a')]===_0x3edc('0x20e')&&this['agents'][_0x4908e7][_0x3edc('0x94')]===_0x3edc('0x95')){_0x5d08d0['push'](this[_0x3edc('0x23')][_0x4908e7]['id']);}}}_0x3026a9[_0x3edc('0x72')]=0x1;return this['getContactDialer'](_0x3026a9['id'],_0x5d08d0,0x1,_0x3026a9['dialOrderByScheduledAt'],_0x3026a9)[_0x3edc('0x44')](function(_0x58382e){_0x3026a9[_0x3edc('0x72')]=0x1;if(_0x58382e){if(!utils[_0x3edc('0x202')](_0x58382e)){utils[_0x3edc('0x71')](_0x3026a9,0x1,0x0);return hopperUtils['countReScheduled'](_0x3026a9)['then'](sendMessageReschedule(_0x3026a9))['catch'](loggerCatch(_0x3edc('0x20f')));}else{_0x3026a9[_0x3edc('0x74')]=utils['CAMPAIGN_STATUS'][_0x3edc('0x203')];if(_[_0x3edc('0xfe')](_0x58382e[0x0])||_[_0x3edc('0xfe')](_0x58382e[0x0][_0x3edc('0x17c')])||_['isNil'](_0x58382e[0x0][_0x3edc('0x161')])){_0x553a34[_0x3edc('0x205')](_0x3edc('0x206'),_0x3026a9,_0x58382e[0x0]);}else{return hopperUtils[_0x3edc('0x20b')](_[_0x3edc('0x80')](_0x58382e[0x0],[_0x3edc('0xf7'),_0x3edc('0x161')]))[_0x3edc('0x44')](_0x553a34[_0x3edc('0x1ec')](_0x3026a9,_0x58382e[0x0]))['catch'](_0x553a34[_0x3edc('0x159')](_0x3edc('0x210'),_0x3026a9));}}}})[_0x3edc('0xac')](loggerGetContactDialer('[getContactDialerPredictive]',_0x3026a9,0x1));};Dialer['prototype'][_0x3edc('0x1da')]=function(_0x4df70e,_0x2d8ac3,_0x355033,_0x65baf1,_0x1806ce,_0x3d6c4){loggerPredictive['info'](_0x3edc('0x211'));loggerPredictive['info'](_0x3edc('0x212'),_0x4df70e);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x213'),_0x2d8ac3);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x214'),_0x355033);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x215'),_0x65baf1);loggerPredictive['info'](_0x3edc('0x216'),_0x1806ce);loggerPredictive['info'](_0x3edc('0x5c'));return new Promise(function(_0x578b5e,_0x3ca631){if(_0x4df70e<=0x0||isNaN(_0x4df70e)){return _0x3ca631(msgResponse(_0x3edc('0x217'),'Error','m\x20=\x20'+_0x4df70e));}if(_0x355033<=0x0||isNaN(_0x355033)){return _0x3ca631(msgResponse('[abandonmentRate]',_0x3edc('0x191'),_0x3edc('0x218')+_0x355033));}if(_0x65baf1<=0x0||isNaN(_0x65baf1)){return _0x3ca631(msgResponse(_0x3edc('0x217'),_0x3edc('0x191'),_0x3edc('0x219')+_0x65baf1));}if(_0x2d8ac3<=0x0||isNaN(_0x2d8ac3)){return _0x3ca631(msgResponse(_0x3edc('0x217'),_0x3edc('0x191'),_0x3edc('0x21a')+_0x2d8ac3));}if(_0x1806ce<=0x0||isNaN(_0x1806ce)){return _0x3ca631(msgResponse('[abandonmentRate]','Error','Amax\x20=\x20'+_0x1806ce));}_0x3d6c4=_0x3d6c4||0x0;var _0x3080f5=0x1/_0x355033;var _0x334af2=0x0;var _0x3722ae=0x0;var _0x273856=0x0;var _0x4fdc3b=0x0;for(var _0x1429df=0x0;_0x273856<_0x1806ce;_0x1429df+=0x1){_0x3722ae=_0x1429df/_0x2d8ac3;_0x334af2=(_0x65baf1*_0x3722ae+_0x3d6c4)/_0x3080f5;_0x273856=utils['erlangb'](_0x334af2,_0x4df70e);_0x4fdc3b=_0x334af2/_0x4df70e*(0x1-utils[_0x3edc('0x21b')](_0x334af2,_0x4df70e));}return _0x578b5e({'erlangCalls':_0x1429df,'erlangCallToSecond':_0x2d8ac3/_0x1429df,'erlangAbandonmentRate':_0x273856,'erlangBusyFactor':_0x4fdc3b});});};Dialer['prototype'][_0x3edc('0x1e4')]=function(_0x3625e1,_0x50fadb,_0x17e306,_0x2e3944,_0x28156c,_0x4315ec){loggerPredictive[_0x3edc('0x51')](_0x3edc('0x21c'));loggerPredictive[_0x3edc('0x51')](_0x3edc('0x212'),_0x3625e1);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x213'),_0x50fadb);loggerPredictive[_0x3edc('0x51')]('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',_0x17e306);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x215'),_0x2e3944);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x21d'),_0x28156c);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5c'));return new Promise(function(_0x1f65a5,_0x40b05e){if(_0x3625e1<=0x0||isNaN(_0x3625e1)){return _0x40b05e(msgResponse(_0x3edc('0x21e'),_0x3edc('0x191'),_0x3edc('0x21f')+_0x3625e1));}if(_0x17e306<=0x0||isNaN(_0x17e306)){return _0x40b05e(msgResponse('[busyFactor]',_0x3edc('0x191'),'Ts\x20=\x20'+_0x17e306));}if(_0x2e3944<=0x0||isNaN(_0x2e3944)){return _0x40b05e(msgResponse(_0x3edc('0x21e'),_0x3edc('0x191'),_0x3edc('0x219')+_0x2e3944));}if(_0x50fadb<=0x0||isNaN(_0x50fadb)){return _0x40b05e(msgResponse(_0x3edc('0x21e'),_0x3edc('0x191'),_0x3edc('0x21a')+_0x50fadb));}if(_0x28156c<=0x0||isNaN(_0x28156c)){return _0x40b05e(msgResponse(_0x3edc('0x21e'),_0x3edc('0x191'),_0x3edc('0x220')+_0x28156c));}_0x4315ec=_0x4315ec||0x0;var _0x2ba2e6=0x1/_0x17e306;var _0x1d82b7=0x0;var _0x116025=0x0;var _0x4b61d2=0x0;var _0x24afc0=0x0;for(var _0x1729a5=0x0;_0x24afc0<_0x28156c;_0x1729a5+=0x1){_0x116025=_0x1729a5/_0x50fadb;_0x1d82b7=(_0x2e3944*_0x116025+_0x4315ec)/_0x2ba2e6;_0x4b61d2=utils[_0x3edc('0x21b')](_0x1d82b7,_0x3625e1);_0x24afc0=_0x1d82b7/_0x3625e1*(0x1-utils[_0x3edc('0x21b')](_0x1d82b7,_0x3625e1));}return _0x1f65a5({'erlangCalls':_0x1729a5,'erlangCallToSecond':_0x50fadb/_0x1729a5,'erlangAbandonmentRate':_0x4b61d2,'erlangBusyFactor':_0x24afc0});});};module[_0x3edc('0x221')]=Dialer; \ No newline at end of file +var _0x4a40=['TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','ifTime','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','iftime\x20%s,%s','interval','indexOf','true','catch','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','Queue','dialTimezone','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueid','updateOriginated','voiceQueues','YYYY-MM-DD\x20HH:mm:ss','ivr','outboundAnswerCallsDay','agent','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','moveContactManagedDialer','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','agiafterat','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','countabandonedretry','dialAbandonedRetryFrequency','voiceQueue','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','syncQueueStatusComplete','preview','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','ListId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','getQueue','response','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','MACHINE','Machine','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','createStateFinal','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','saveInDb','[syncHangupInAMDIvr][createHistory]','countnosuchnumberretry','stateGlobal','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','outboundUnknownCallsDay','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','talking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','updateReportFromOutboundQueue','assign','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','clearZombieChannels','[actions]','[Dialer][checkChannel][ivr]','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact]','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','handleIvr','actionOriginate','object','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','NONE','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','originate','dialPrefix','trim','dialCutDigit','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalTotalCalls','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getVoiceQueueRtPauses','loggedIn','predictiveIntervalPauses','outboundQueuePauses','busyFactor','erlangCallToSecond','milliseconds','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','Agent','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','inBlackList','checkContactEmpty','[getContactCampaign2][Empty]','ivrTotalCallsDays','checkIsBlackListIvr','[actionOriginateIvr]\x20','pTalking','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','[actionOriginate]\x20','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','RUNNING','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','uuid','moment','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','startProgressive','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','varset','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','---------------------------','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive','name','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','NULL_INTERVAL','Interval','Intervals','\x20INTERVAL_IS_NULL','isEmpty','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','Trunk'];(function(_0x318a7e,_0x182222){var _0x2172d0=function(_0xa6f13){while(--_0xa6f13){_0x318a7e['push'](_0x318a7e['shift']());}};_0x2172d0(++_0x182222);}(_0x4a40,0x184));var _0x04a4=function(_0x171028,_0x7ee648){_0x171028=_0x171028-0x0;var _0x5c4c7b=_0x4a40[_0x171028];return _0x5c4c7b;};'use strict';var util=require(_0x04a4('0x0'));var _=require(_0x04a4('0x1'));var uuid=require(_0x04a4('0x2'));var moment=require(_0x04a4('0x3'));var rr=require('rr');var Redis=require(_0x04a4('0x4'));var utils=require(_0x04a4('0x5'));var hopperUtils=require('./utils/hopper');var ut=require(_0x04a4('0x6'));var config=require(_0x04a4('0x7'));var logger=require(_0x04a4('0x8'))(_0x04a4('0x9'));var loggerBooked=require(_0x04a4('0x8'))(_0x04a4('0xa'));var loggerPredictive=require(_0x04a4('0x8'))(_0x04a4('0xb'));var loggerPredictiveCalls=require(_0x04a4('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x04a4('0x8'))(_0x04a4('0xc'));var ami=require(_0x04a4('0xd'));config[_0x04a4('0xe')]=_[_0x04a4('0xf')](config[_0x04a4('0xe')],{'host':_0x04a4('0x10'),'port':0x18eb});var io=require(_0x04a4('0x11'))(new Redis(config[_0x04a4('0xe')]));var cmHopper=require(_0x04a4('0x12'));var voiceQueueRt=require(_0x04a4('0x13'));var RpcSetting=require(_0x04a4('0x14'));var Interval=require('../rpc/interval');var Action=require(_0x04a4('0x15'));var History=require('./models/history');var Final=require(_0x04a4('0x16'));var AgentComplete=require(_0x04a4('0x17'));var QueueCallerAbandon=require(_0x04a4('0x18'));var Hangup=require(_0x04a4('0x19'));var ipAgi=process[_0x04a4('0x1a')][_0x04a4('0x1b')]||_0x04a4('0x1c');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x04a4('0x1d')][_0x04a4('0x1e')]=function(_0x195b29){this[_0x04a4('0x1f')]=this[_0x04a4('0x1f')]?this[_0x04a4('0x1f')][_0x04a4('0x20')](_0x195b29):_0x195b29();};function Dialer(_0x128939,_0x262495){this[_0x04a4('0x21')]=new Sequence();this['preview']=_0x262495;this['voiceQueues']=_0x128939['voiceQueues'];this[_0x04a4('0x22')]=_0x128939[_0x04a4('0x22')];this[_0x04a4('0x23')]=_0x128939[_0x04a4('0x23')];this[_0x04a4('0x24')]=_0x128939[_0x04a4('0x24')];this[_0x04a4('0x25')]=config[_0x04a4('0x25')]||0x2;this[_0x04a4('0x26')]={};this[_0x04a4('0x27')]={};this['contactsId']={};this[_0x04a4('0x28')]={};this['optionPredictive']={};this['startPredictive']={};this[_0x04a4('0x29')]={};this['ivrOriginated']={};this[_0x04a4('0x2a')]={};this[_0x04a4('0x2b')]={};this[_0x04a4('0x2c')]={};ami['on'](_0x04a4('0x2d'),this[_0x04a4('0x2e')][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x30'),this[_0x04a4('0x31')][_0x04a4('0x2f')](this));ami['on']('originateresponse',this[_0x04a4('0x32')][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x33'),this['syncAgentComplete']['bind'](this));ami['on'](_0x04a4('0x34'),this['syncQueueSummary'][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x35'),this[_0x04a4('0x36')][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x37'),this[_0x04a4('0x38')][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x39'),this['syncNewExten'][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x3a'),this['syncVarSet'][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x3b'),this[_0x04a4('0x3c')][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x3d'),this['syncQueueStatusComplete'][_0x04a4('0x2f')](this));this[_0x04a4('0x3e')]();this[_0x04a4('0x3f')]();RpcSetting[_0x04a4('0x40')]()[_0x04a4('0x41')](function(_0x1f626b){previewRecallmeReminderInterval=_0x1f626b[_0x04a4('0x42')];});}function isNotNull(_0x1bbb63){return _0x1bbb63!==null&&!_[_0x04a4('0x43')](_0x1bbb63);}function msgResponse(_0x2f381d,_0xa06a45,_0x56fed9){return{'action':_0x2f381d,'response':_0xa06a45,'message':_0x56fed9,'stack':_0x56fed9};}function emit(_0x239a05,_0x349f16,_0x4eb5d7){io['to'](_0x239a05)[_0x04a4('0x44')](_0x349f16,_0x4eb5d7);}function emitOutboundVoiceQueueSummary(_0x14a8cd){if(_0x14a8cd[_0x04a4('0x45')]===_0x04a4('0x46')){logger[_0x04a4('0x47')](_0x04a4('0x48'),util[_0x04a4('0x49')](_0x14a8cd,{'showHidden':![],'depth':null}));emit(util[_0x04a4('0x4a')]('voice:queue:%s',_0x14a8cd['name']),_0x04a4('0x4b'),_0x14a8cd);}}function checkGetDataPredictive(_0x58f16a){if(isNotNull(_0x58f16a)&&!_['isEmpty'](_0x58f16a)){loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x4d'));loggerPredictive['info'](_0x04a4('0x4e'),_0x58f16a['predictiveIntervalTotalCalls']);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x4f'),_0x58f16a[_0x04a4('0x50')]);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x51'),_0x58f16a['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x04a4('0x52'),_0x58f16a[_0x04a4('0x53')]);loggerPredictive[_0x04a4('0x4c')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58f16a['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x04a4('0x4c')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58f16a[_0x04a4('0x54')]);loggerPredictive[_0x04a4('0x4c')]('---------------------------');if(_0x58f16a['predictiveIntervalTotalCalls']>0x0){if(!_[_0x04a4('0x43')](_0x58f16a[_0x04a4('0x54')])&&_0x58f16a[_0x04a4('0x54')]>0x0){return!![];}loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x55'));if(!_[_0x04a4('0x43')](_0x58f16a[_0x04a4('0x56')])&&_0x58f16a['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x04a4('0x4c')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x57'));}}else{loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x58'));}return![];}function mergeDataErlangB(_0x13655b){return function(_0x2b7d47){loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x59'));loggerPredictive[_0x04a4('0x4c')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b7d47[_0x04a4('0x5a')]);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x5b'),_0x2b7d47['erlangCallToSecond']);loggerPredictive[_0x04a4('0x4c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b7d47['erlangAbandonmentRate']);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b7d47['erlangBusyFactor']);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x5c'),_0x2b7d47[_0x04a4('0x5d')]);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x5e'));_[_0x04a4('0x5f')](_0x13655b,_0x2b7d47);};}function ifInterval(_0x20af04,_0x251ef8){if(_['isUndefined'](_0x251ef8)){return![];}return utils[_0x04a4('0x60')](undefined,_0x251ef8)<_0x20af04*0x3c;}function clearPredictiveAttributes(_0x301a91){if(_0x301a91[_0x04a4('0x29')]){_0x301a91[_0x04a4('0x29')]=undefined;loggerPredictive[_0x04a4('0x47')](_0x301a91['name'],_0x04a4('0x61'));}if(_0x301a91[_0x04a4('0x62')]){_0x301a91[_0x04a4('0x62')]=undefined;loggerPredictive[_0x04a4('0x47')](_0x301a91[_0x04a4('0x63')],_0x04a4('0x64'));}if(_0x301a91[_0x04a4('0x65')]){clearInterval(_0x301a91['handlePredictive']);_0x301a91[_0x04a4('0x65')]=undefined;loggerPredictive[_0x04a4('0x47')](_0x301a91[_0x04a4('0x63')],_0x04a4('0x66'));}}function loggerCatchPredictive(_0x48984c,_0x53421a){return function(_0xf19e90){loggerPredictive[_0x04a4('0x67')](_0x53421a['name'],_0x48984c);loggerPredictive[_0x04a4('0x67')](_0xf19e90[_0x04a4('0x68')]);clearPredictiveAttributes(_0x53421a);};}function loggerCatch(_0x4eaf9f){return function(_0x53cd16){logger['error'](_0x4eaf9f,util['inspect'](_0x53cd16,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x52573c,_0x3fec35,_0xef1cdf){return function(_0xbe5c75){utils[_0x04a4('0x69')](_0x3fec35,_0xef1cdf,0x0);_0x3fec35[_0x04a4('0x6a')]=0x0;logger[_0x04a4('0x67')](_0x52573c,util[_0x04a4('0x49')](_0xbe5c75,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xa4a324){return function(_0x184387){if(isNotNull(_0x184387)&&isNotNull(_0x184387[0x0])){if(_0x184387[0x0][_0x04a4('0x6b')]>0x0){_0xa4a324['message']=utils[_0x04a4('0x6c')][_0x04a4('0x6d')];logger[_0x04a4('0x4c')](_0x04a4('0x6e')+_0xa4a324[_0x04a4('0x63')],_0x184387[0x0]['contactsRescheduled'],_0x04a4('0x6f'));}else{_0xa4a324[_0x04a4('0x70')]=utils[_0x04a4('0x6c')][_0x04a4('0x71')];logger[_0x04a4('0x4c')](_0x04a4('0x72')+_0xa4a324[_0x04a4('0x63')]);}}};}function createObjHistory(_0x23cf96,_0x28d0b4,_0x1d14a3,_0x48e1bb,_0x47e7bc){_0x23cf96['message']=_0x1d14a3;var _0x144f2c=new Action(_0x23cf96,_0x28d0b4);var _0x4616c1=new History(_0x144f2c);_0x4616c1[_0x04a4('0x73')]=_0x48e1bb;_0x4616c1[_0x04a4('0x74')]=_0x47e7bc;_0x4616c1[_0x04a4('0x75')]=_0x144f2c[_0x04a4('0x76')];return _0x4616c1;}function unlockQueueStatus(_0x4ffeb5,_0x383aa0){setTimeout(function(){if(_['isUndefined'](_0x4ffeb5[_0x04a4('0x77')])){loggerBooked['error'](_0x04a4('0x78'),_0x383aa0);}_0x4ffeb5[_0x04a4('0x77')]=!![];loggerBooked['info'](_0x04a4('0x79'),_0x383aa0,JSON[_0x04a4('0x7a')](_[_0x04a4('0x7b')](_0x4ffeb5,['name',_0x04a4('0x77')])));},0x1f3);}function checkInterval(_0x23b7b8){return function(){if(!isNotNull(_0x23b7b8['Interval'])){_0x23b7b8[_0x04a4('0x70')]=utils['CAMPAIGN_STATUS'][_0x04a4('0x7c')];throw _0x23b7b8[_0x04a4('0x63')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x23b7b8[_0x04a4('0x7d')][_0x04a4('0x7e')])){_0x23b7b8[_0x04a4('0x70')]=utils[_0x04a4('0x6c')]['NULL_INTERVAL'];throw _0x23b7b8['name']+_0x04a4('0x7f');}if(!isNotNull(_[_0x04a4('0x80')](_0x23b7b8[_0x04a4('0x7d')]['Intervals']))){_0x23b7b8[_0x04a4('0x70')]=utils['CAMPAIGN_STATUS'][_0x04a4('0x7c')];throw _0x23b7b8[_0x04a4('0x63')]+_0x04a4('0x7f');}};}function checkIsIVRCampaignActive(_0x354685){return function(){if(!utils[_0x04a4('0x81')](_0x354685)){_0x354685['message']=utils[_0x04a4('0x6c')][_0x04a4('0x82')];throw _0x354685['name']+_0x04a4('0x83');}};}function emitCampaignSummary(_0x54b569){if(utils[_0x04a4('0x84')](_0x54b569)){emit(util['format'](_0x04a4('0x85'),_0x54b569[_0x04a4('0x63')]),_0x04a4('0x86'),_0x54b569);}}function loggerCatchQueueSummary(_0x542714,_0x12b60e){return function(_0x5d5910){clearPredictiveAttributes(_0x12b60e);emitCampaignSummary(_0x12b60e);loggerSyncQueueSummary[_0x04a4('0x47')](_0x542714,util[_0x04a4('0x49')](_0x5d5910,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x7d8510){if(_0x7d8510[_0x04a4('0x87')]){if(_0x7d8510['originated']===0x0){_0x7d8510['sendMessageOneNotActive']=![];_0x7d8510[_0x04a4('0x70')]=utils[_0x04a4('0x6c')][_0x04a4('0x82')];loggerSyncQueueSummary['debug'](_0x04a4('0x88'),_0x7d8510[_0x04a4('0x63')],_0x04a4('0x89'));}else{_0x7d8510[_0x04a4('0x70')]=utils[_0x04a4('0x6c')][_0x04a4('0x8a')];loggerSyncQueueSummary['debug'](_0x04a4('0x88'),_0x7d8510['name'],_0x04a4('0x8b'));}emitCampaignSummary(_0x7d8510);}}function myreject(_0x18c9a7){return function(_0x562128){return _0x18c9a7(msgResponse(_0x04a4('0x8c'),_0x04a4('0x8d'),JSON['stringify'](_0x562128)));};}Dialer['prototype'][_0x04a4('0x8e')]=function(_0x3eb544){return!_[_0x04a4('0x43')](_0x3eb544)&&_0x3eb544&&!_['isUndefined'](_0x3eb544[_0x04a4('0x63')])&&!_['isUndefined'](_0x3eb544['active'])&&_0x3eb544[_0x04a4('0x8f')]&&(this[_0x04a4('0x24')][util[_0x04a4('0x4a')]('SIP/%s',_0x3eb544[_0x04a4('0x63')])][_0x04a4('0x90')]===_0x04a4('0x91')||this[_0x04a4('0x24')][util['format'](_0x04a4('0x92'),_0x3eb544[_0x04a4('0x63')])][_0x04a4('0x90')]===_0x04a4('0x93'));};Dialer[_0x04a4('0x1d')]['checkIsTrunkReachable']=function(_0x5004bc){var _0x131c51=this;return function(){if(!_0x131c51[_0x04a4('0x8e')](_0x5004bc[_0x04a4('0x94')])){if(!_0x131c51[_0x04a4('0x8e')](_0x5004bc[_0x04a4('0x95')])){_0x5004bc[_0x04a4('0x70')]=utils[_0x04a4('0x6c')][_0x04a4('0x96')];throw _0x5004bc[_0x04a4('0x63')]+_0x04a4('0x97');}}};};Dialer[_0x04a4('0x1d')]['checkIfTime']=function(_0x421f22,_0x14053c,_0x3691c7,_0x5aec99){var _0x1c1148=this;return function(){var _0x5a0861=!![];return _0x1c1148['ifTimeIvr'](_0x421f22,_0x14053c,_0x3691c7,_0x5aec99,_0x5a0861);};};Dialer['prototype'][_0x04a4('0x98')]=function(_0x6edeb6,_0x3471ce,_0x3f38a5,_0x39b451){var _0x330fd9=this;return function(){var _0x443507=![];return _0x330fd9['ifTimeIvr'](_0x6edeb6['Intervals'],_0x3471ce,_0x3f38a5,_0x39b451,_0x443507);};};Dialer[_0x04a4('0x1d')]['ifTimeIvr']=function(_0x232abc,_0x1f43cb,_0x172db8,_0x1c1542,_0x4df267){var _0x3257a9=[];return new Promise(function(_0x46e19c,_0x403e57){if(!isNotNull(_0x232abc)){_0x1c1542['message']=utils[_0x04a4('0x6c')]['NULL_INTERVAL'];return _0x403e57(msgResponse('ifTime',_0x04a4('0x99'),_0x172db8+_0x04a4('0x9a')));}if(_[_0x04a4('0x80')](_0x232abc)){_0x1c1542[_0x04a4('0x70')]=utils['CAMPAIGN_STATUS'][_0x04a4('0x9b')];return _0x403e57(msgResponse(_0x04a4('0x9c'),_0x04a4('0x99'),_0x172db8+_0x04a4('0x9d')));}if(_0x1f43cb&&_['isUndefined'](config[_0x04a4('0x9e')][_0x1f43cb])){_0x1c1542[_0x04a4('0x70')]=utils[_0x04a4('0x6c')]['UNKNOWN_TIMEZONE'];return _0x403e57(msgResponse(_0x04a4('0x9c'),_0x04a4('0x99'),_0x172db8+_0x04a4('0x9f')+_0x1f43cb));}if(_[_0x04a4('0xa0')](_0x232abc)){for(var _0x329434=0x0;_0x329434<_0x232abc[_0x04a4('0xa1')];_0x329434+=0x1){_0x3257a9[_0x04a4('0xa2')](ami[_0x04a4('0xa3')]({'action':_0x04a4('0xa4'),'command':util[_0x04a4('0x4a')](_0x04a4('0xa5'),_0x232abc[_0x329434][_0x04a4('0xa6')],!_[_0x04a4('0x43')](config[_0x04a4('0x9e')][_0x1f43cb])?_0x1f43cb:'')})[_0x04a4('0x41')](function(_0xb78364){return _0xb78364['content'][_0x04a4('0xa7')](_0x04a4('0xa8'))>=0x0;})[_0x04a4('0xa9')](myreject(_0x403e57)));}}else{_0x3257a9['push'](ami[_0x04a4('0xa3')]({'action':'command','command':util[_0x04a4('0x4a')](_0x04a4('0xa5'),_0x232abc,!_[_0x04a4('0x43')](config[_0x04a4('0x9e')][_0x1f43cb])?_0x1f43cb:'')})[_0x04a4('0x41')](function(_0x377b41){return _0x377b41['content'][_0x04a4('0xa7')](_0x04a4('0xa8'))>=0x0;})[_0x04a4('0xa9')](myreject(_0x403e57)));}Promise['all'](_0x3257a9)[_0x04a4('0x41')](function(_0x250a5a){var _0x52f702=_['some'](_0x250a5a);if(_0x52f702){return _0x46e19c(_0x52f702);}else{_0x1c1542[_0x04a4('0x70')]=_0x4df267?utils[_0x04a4('0x6c')][_0x04a4('0xaa')]:utils[_0x04a4('0x6c')][_0x04a4('0xab')];return _0x403e57(msgResponse('[ifTime][promiseAll]',_0x04a4('0x99'),_0x04a4('0xac')+_0x4df267+'\x20'+_0x172db8+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x232abc,{'showHidden':![],'depth':null})+_0x04a4('0xad')+_0x1f43cb));}})[_0x04a4('0xa9')](function(_0x453f8f){return _0x403e57(msgResponse(_0x04a4('0x9c'),_0x04a4('0x99'),JSON[_0x04a4('0x7a')](_0x453f8f)));});});};Dialer[_0x04a4('0x1d')][_0x04a4('0x3e')]=function(){var _0x5276e8=this;return cmHopper[_0x04a4('0xae')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x5276e8[_0x04a4('0xaf')]();},0x3e8);});};Dialer['prototype'][_0x04a4('0xaf')]=function(){var _0x500309=this;var _0x13eeac;for(var _0x110a98 in this[_0x04a4('0x22')]){if(typeof this[_0x04a4('0x22')][_0x110a98]!==_0x04a4('0xb0')){_0x13eeac=this[_0x04a4('0x22')][_0x110a98];if(utils[_0x04a4('0x84')](_0x13eeac)&&utils[_0x04a4('0x81')](_0x13eeac)){_0x13eeac[_0x04a4('0x87')]=!![];Promise[_0x04a4('0xb1')]()[_0x04a4('0x41')](checkIsIVRCampaignActive(_0x13eeac))[_0x04a4('0x41')](checkInterval(_0x13eeac))['then'](_0x500309[_0x04a4('0xb2')](_0x13eeac))[_0x04a4('0x41')](_0x500309[_0x04a4('0xb3')](_0x13eeac[_0x04a4('0xb4')],_0x13eeac['dialTimezone'],_0x13eeac[_0x04a4('0x63')],_0x13eeac))['then'](_0x500309['checkIfTimeIntervals'](_0x13eeac[_0x04a4('0x7d')],_0x13eeac['dialTimezone'],_0x13eeac[_0x04a4('0x63')],_0x13eeac))[_0x04a4('0x41')](_0x500309[_0x04a4('0xb5')](_0x13eeac))['catch'](loggerCatchQueueSummary(_0x04a4('0xb6'),_0x13eeac));}else{notSendMessagesCampaign(_0x13eeac);}}}};Dialer['prototype'][_0x04a4('0xb7')]=function(_0x29cb88){if(_0x29cb88[_0x04a4('0xb8')]!==_0x04a4('0xb')){clearPredictiveAttributes(_0x29cb88);}switch(_0x29cb88[_0x04a4('0xb8')]){case _0x04a4('0xb9'):this[_0x04a4('0xba')](_0x29cb88,0x1);break;case'power':this['handlePower'](_0x29cb88,_0x29cb88[_0x04a4('0xbb')]);break;case _0x04a4('0xb'):this[_0x04a4('0xb')](_0x29cb88);break;case'booked':this[_0x04a4('0xba')](_0x29cb88,0x1);break;default:logger['error'](_0x04a4('0xbc'),_0x29cb88['name'],'method\x20not\x20recognized');}};Dialer[_0x04a4('0x1d')][_0x04a4('0x9c')]=function(_0x4a0270,_0x230ed8){var _0x19339d=_0x4a0270[_0x04a4('0xbd')];var _0x20d95d=_0x230ed8?_0x4a0270[_0x04a4('0xb4')]:_0x4a0270[_0x04a4('0x7d')][_0x04a4('0x7e')];logger[_0x04a4('0xbe')](_0x04a4('0xbf'),_0x20d95d,_0x19339d,_0x4a0270[_0x04a4('0x63')],util[_0x04a4('0x4a')](_0x04a4('0xc0'),_0x4a0270[_0x04a4('0x63')],_0x4a0270['id']));var _0x351d90=null;return Interval[_0x04a4('0xc1')](_0x20d95d,_0x19339d)['then'](function(_0x4eb472){if(_0x4eb472===!![]){return _0x4eb472;}else{_0x4a0270[_0x04a4('0x70')]=_0x230ed8?utils['CAMPAIGN_STATUS'][_0x04a4('0xaa')]:utils[_0x04a4('0x6c')]['OVERTIME_INTERVAL'];_0x351d90=msgResponse(_0x04a4('0xc2'),_0x04a4('0x99'),'Global:\x20'+_0x230ed8+'\x20'+_0x4a0270[_0x04a4('0x63')]+_0x04a4('0xc3')+util[_0x04a4('0x49')](_0x20d95d,{'showHidden':![],'depth':null})+_0x04a4('0xad')+_0x19339d);}if(_0x351d90!==null){logger[_0x04a4('0xbe')](_0x04a4('0xc4'),_0x351d90);_0x351d90[_0x04a4('0xc5')]=_0x230ed8;throw _0x351d90;}})[_0x04a4('0xa9')](function(_0x4b9fdb){logger['error']('AMI\x20IfTime',_0x4b9fdb);throw msgResponse('[ifTime][Action]',_0x04a4('0x8d'),util[_0x04a4('0x49')](_0x4b9fdb,{'showHidden':![],'depth':null}));});};Dialer[_0x04a4('0x1d')][_0x04a4('0x2e')]=function(_0x2028b6){if(this['voiceQueues'][_0x2028b6[_0x04a4('0xc6')]]){if(this[_0x04a4('0x28')][_0x2028b6[_0x04a4('0xc7')]]&&this[_0x04a4('0x28')][_0x2028b6['uniqueid']][_0x04a4('0x45')]!=='ivr'){this[_0x04a4('0xc8')](this[_0x04a4('0xc9')][_0x2028b6[_0x04a4('0xc6')]]);this[_0x04a4('0x28')][_0x2028b6[_0x04a4('0xc7')]]['answertime']=moment()['format'](_0x04a4('0xca'));}}};Dialer[_0x04a4('0x1d')]['syncAgentComplete']=function(_0x501a5e){var _0x1dde7f=this[_0x04a4('0x28')][_0x501a5e[_0x04a4('0xc7')]];if(this[_0x04a4('0xc9')][_0x501a5e[_0x04a4('0xc6')]]){if(_0x1dde7f&&_0x1dde7f[_0x04a4('0x45')]!==_0x04a4('0xcb')){delete this['uniqueId'][_0x501a5e[_0x04a4('0xc7')]];this['voiceQueues'][_0x501a5e[_0x04a4('0xc6')]][_0x04a4('0xcc')]+=0x1;var _0x2ebfcd=new AgentComplete(_0x1dde7f,_0x501a5e);if(_0x501a5e['reason']===_0x04a4('0xcd')){_0x2ebfcd['agiafterat']=this['voiceQueues'][_0x501a5e[_0x04a4('0xc6')]][_0x04a4('0xce')]&&this['voiceQueues'][_0x501a5e[_0x04a4('0xc6')]][_0x04a4('0xcf')]?moment()[_0x04a4('0x4a')](_0x04a4('0xca')):undefined;}hopperUtils[_0x04a4('0xd0')](_0x2ebfcd)[_0x04a4('0xa9')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x04a4('0xd1')](_0x2ebfcd)[_0x04a4('0xa9')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x04a4('0x1d')]['syncQueueCallerAbandon']=function(_0x45a429){var _0x112aaf=this[_0x04a4('0x28')][_0x45a429[_0x04a4('0xc7')]];var _0x35218c=this;var _0x577140=![];var _0x2bb367;var _0xc313a;if(this[_0x04a4('0xc9')][_0x45a429['queue']]){if(_0x112aaf&&_0x112aaf[_0x04a4('0x45')]!==_0x04a4('0xcb')){delete this[_0x04a4('0x28')][_0x45a429['uniqueid']];this[_0x04a4('0xc8')](this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]]);_0x112aaf[_0x04a4('0xd2')]=moment()[_0x04a4('0x4a')](_0x04a4('0xca'));var _0x49f536=new QueueCallerAbandon(_0x112aaf,_0x45a429);if(utils[_0x04a4('0x60')](_0x112aaf[_0x04a4('0xd2')],_0x112aaf[_0x04a4('0xd3')])>=_0x112aaf[_0x04a4('0xd4')]){this['voiceQueues'][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xd5')]+=0x1;this[_0x04a4('0xc9')][_0x45a429['queue']][_0x04a4('0xd6')]+=0x1;this['voiceQueues'][_0x45a429['queue']][_0x04a4('0xd7')]+=0x1;_0x49f536['state']=0xa;_0x49f536[_0x04a4('0x74')]='Drop';_0x49f536[_0x04a4('0xd8')]=_0x04a4('0xd9');_0x49f536[_0x04a4('0xda')]=this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xce')]?moment()[_0x04a4('0x4a')](_0x04a4('0xca')):undefined;_0x49f536[_0x04a4('0xdb')]+=0x1;_0x49f536[_0x04a4('0xdc')]+=0x1;_0x2bb367=this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xdd')];_0xc313a=this[_0x04a4('0xc9')][_0x45a429['queue']][_0x04a4('0xde')];hopperUtils[_0x04a4('0xdf')](_0x49f536,_0x49f536[_0x04a4('0x73')],_0x112aaf['voiceQueue'])[_0x04a4('0x41')](function(_0x243c31){_0x577140=_0x243c31[_0x04a4('0xe0')]==0x1;if(_0x49f536[_0x04a4('0xdb')]>=_0x35218c[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xe1')]){_0x35218c[_0x04a4('0xe2')](_0x49f536,_0x243c31[_0x04a4('0xe0')]);}else{hopperUtils[_0x04a4('0xe3')]({'active':![],'countdropretry':_0x49f536[_0x04a4('0xdb')],'scheduledat':moment()[_0x04a4('0xe4')](_0x35218c[_0x04a4('0xc9')][_0x45a429['queue']][_0x04a4('0xdd')],_0x04a4('0xe5'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x112aaf[_0x04a4('0xe6')],'ListId':_0x112aaf['ListId'],'VoiceQueueId':_0x112aaf[_0x04a4('0xe7')]||undefined,'CampaignId':_0x112aaf[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch(_0x04a4('0xe9')));var _0x126ebc=new History(_0x49f536);_0x126ebc[_0x04a4('0x73')]=0xa;_0x126ebc['statedesc']=_0x04a4('0xea');_0x126ebc[_0x04a4('0x76')]=moment()[_0x04a4('0x4a')](_0x04a4('0xca'));_0x126ebc['endtime']=_0x126ebc['starttime'];_0x126ebc[_0x04a4('0xeb')]=_0x49f536['calleridname'];_0x126ebc[_0x04a4('0xec')]=_0x49f536['calleridnum'];hopperUtils[_0x04a4('0xd0')](_0x126ebc)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0xed')));}})['then'](function(){if(_0x577140)hopperUtils[_0x04a4('0xee')](_0x49f536,_0x2bb367,_0xc313a)[_0x04a4('0x41')](function(){return 0x1;});});}else{this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xef')]+=0x1;_0x49f536[_0x04a4('0x73')]=0xb;_0x49f536[_0x04a4('0x74')]=_0x04a4('0xf0');_0x49f536[_0x04a4('0xd8')]='CALLEREXIT';_0x49f536[_0x04a4('0xf1')]+=0x1;_0x49f536[_0x04a4('0xdc')]+=0x1;_0x2bb367=this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xf2')];_0xc313a=this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x04a4('0xdf')](_0x49f536,_0x49f536[_0x04a4('0x73')],_0x112aaf[_0x04a4('0xf3')])['then'](function(_0x3bdc94){if(_0x49f536['countabandonedretry']>=_0x35218c[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xf4')]){_0x35218c[_0x04a4('0xe2')](_0x49f536,_0x3bdc94[_0x04a4('0xe0')]);}else{hopperUtils[_0x04a4('0xe3')]({'active':![],'countabandonedretry':_0x49f536[_0x04a4('0xf1')],'scheduledat':moment()['add'](_0x35218c[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xf2')],_0x04a4('0xe5'))['format'](_0x04a4('0xca')),'ContactId':_0x112aaf[_0x04a4('0xe6')],'ListId':_0x112aaf['ListId'],'VoiceQueueId':_0x112aaf[_0x04a4('0xe7')]||undefined,'CampaignId':_0x112aaf[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch(_0x04a4('0xf5')));var _0x12889b=new History(_0x49f536);_0x12889b[_0x04a4('0x73')]=0xb;_0x12889b[_0x04a4('0x74')]=_0x04a4('0xf0');_0x12889b['starttime']=moment()['format'](_0x04a4('0xca'));_0x12889b['endtime']=_0x12889b['starttime'];_0x12889b[_0x04a4('0xeb')]=_0x49f536[_0x04a4('0xeb')];_0x12889b[_0x04a4('0xec')]=_0x49f536[_0x04a4('0xec')];hopperUtils[_0x04a4('0xd0')](_0x12889b)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0xf6')));}})[_0x04a4('0x41')](function(){if(_0x577140)hopperUtils[_0x04a4('0xee')](_0x49f536,_0x2bb367,_0xc313a)[_0x04a4('0x41')](function(){return 0x1;});});}}}};Dialer[_0x04a4('0x1d')][_0x04a4('0xf7')]=function(_0x37094a){if(this['actions'][_0x37094a[_0x04a4('0xc7')]]){this['actions'][_0x37094a[_0x04a4('0xc7')]]['channel']=_0x37094a[_0x04a4('0xf8')];}if(this['uniqueId'][_0x37094a[_0x04a4('0xc7')]]){this[_0x04a4('0x28')][_0x37094a[_0x04a4('0xc7')]][_0x04a4('0xf8')]=_0x37094a['channel'];}};Dialer[_0x04a4('0x1d')]['syncQueueMember']=function(_0x3e8e42){if(!this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]]){return;}var _0x10876f=this['voiceQueues'][this['actions'][_0x3e8e42[_0x04a4('0xf9')]][_0x04a4('0xc6')]][_0x04a4('0xfa')]||_0x04a4('0xfb');if(_0x10876f===_0x04a4('0xfc')){if(this['actions'][_0x3e8e42[_0x04a4('0xf9')]]&&_[_0x04a4('0xfd')](this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]][_0x04a4('0xfe')])&&_0x3e8e42[_0x04a4('0x90')]==='1'&&_0x3e8e42[_0x04a4('0xff')]==='0'){if(this[_0x04a4('0x23')][_0x3e8e42[_0x04a4('0x100')]]){if(!this['agents'][_0x3e8e42[_0x04a4('0x100')]]['locked']){this[_0x04a4('0x23')][_0x3e8e42['stateinterface']]['locked']=!![];this['actions'][_0x3e8e42['actionid']][_0x04a4('0xfe')]=!![];this[_0x04a4('0x27')][_0x3e8e42['actionid']][_0x04a4('0x100')]=_0x3e8e42['stateinterface'];}}}}else if(_0x10876f==='rrmemory'){if(this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]]){if(this[_0x04a4('0x23')][_0x3e8e42[_0x04a4('0x100')]]){this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]][_0x04a4('0x100')]=_0x3e8e42[_0x04a4('0x100')];if(_[_0x04a4('0xfd')](this['queueBooked'][this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]][_0x04a4('0xc6')]])){this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]][_0x04a4('0xc6')]]=[];}this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0x3e8e42['actionid']][_0x04a4('0xc6')]][_0x04a4('0xa2')](_['merge'](_[_0x04a4('0x7b')](this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]],['idHopper',_0x04a4('0x100')]),{'status':_0x3e8e42[_0x04a4('0x90')],'paused':_0x3e8e42[_0x04a4('0xff')]}));}}}};Dialer[_0x04a4('0x1d')][_0x04a4('0x101')]=function(_0xa50de1){if(!this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]]){return;}var _0x1a5051=this;var _0x5809eb=this[_0x04a4('0xc9')][this[_0x04a4('0x27')][_0xa50de1['actionid']][_0x04a4('0xc6')]];var _0x3ec3f6=_0x5809eb['strategy']||_0x04a4('0xfb');if(_0x3ec3f6==='roundrobin'){if(this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]]&&this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0x100')]){this[_0x04a4('0x102')][_0x04a4('0x103')](this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0x104')],this['actions'][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0x100')])[_0x04a4('0xa9')](function(_0x40d772){logger['error'](_0x04a4('0x105'),util[_0x04a4('0x49')](_0x40d772,{'showHidden':![],'depth':null}));})[_0x04a4('0x20')](function(){_0x1a5051[_0x04a4('0xc8')](_0x1a5051[_0x04a4('0xc9')][_0x1a5051['actions'][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]);_0x1a5051[_0x04a4('0x23')][_0x1a5051[_0x04a4('0x27')][_0xa50de1['actionid']][_0x04a4('0x100')]][_0x04a4('0xfe')]=![];delete _0x1a5051[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]];unlockQueueStatus(_0x5809eb);});}else{this[_0x04a4('0xc8')](this['voiceQueues'][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xe6')],'ListId':this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0x106')],'VoiceQueueId':this[_0x04a4('0x27')][_0xa50de1['actionid']]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xe8')]||undefined})['catch'](loggerCatch(_0x04a4('0x107')));delete this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]];unlockQueueStatus(_0x5809eb);}}else if(_0x3ec3f6==='rrmemory'){var _0x56ef00;if(this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]]&&!_[_0x04a4('0x80')](this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]])){if(this[_0x04a4('0x2b')][_0x1a5051[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]){this['queueBookedRR'][_0x1a5051[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]=this[_0x04a4('0x2b')][this[_0x04a4('0x27')][_0xa50de1['actionid']][_0x04a4('0xc6')]]?this[_0x04a4('0x2b')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]:this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]?this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]]['queue']][_0x04a4('0x108')]||0x0:0x0;}this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]['_rr']=this[_0x04a4('0x2b')][this['actions'][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]];for(var _0x21f3e7=0x0;_0x21f3e7=_0x43a1a2[_0x04a4('0x128')]){_0x48bf40['stateGlobal'](_0xae9315,_0x3445b4,_0x2c4651,_0x04a4('0x129'));}else{if(_0xae9315[_0x04a4('0x121')]>=_0x43a1a2['dialMachineMaxRetry']){_0x48bf40[_0x04a4('0x12a')](_0xae9315,_0x3445b4,_0x2c4651,'reason\x2019\x20machine....');}else{hopperUtils[_0x04a4('0xe3')]({'active':![],'countmachineretry':_0xae9315['countmachineretry'],'scheduledat':moment()['add'](_0x43a1a2[_0x04a4('0x12b')],_0x04a4('0xe5'))['format'](_0x04a4('0xca')),'ContactId':_0xae9315[_0x04a4('0xe6')],'ListId':_0xae9315[_0x04a4('0x106')],'VoiceQueueId':_0xae9315['VoiceQueueId']||undefined,'CampaignId':_0xae9315['CampaignId']||undefined})['catch'](loggerCatch(_0x04a4('0x12c')));_0x3445b4({'reschedule':0x1});}}});}if(_0x39d98d[_0x04a4('0x45')]==='ivr'&&this[_0x04a4('0x22')][_0x39d98d[_0x04a4('0xc6')]]['dialAMDActive']&&_0x9f7d01[_0x04a4('0x117')]==='HANGUP'){delete this[_0x04a4('0x28')][_0x9f7d01[_0x04a4('0xc7')]];this[_0x04a4('0xc8')](this[_0x04a4('0x22')][_0x39d98d[_0x04a4('0xc6')]]);_0x3e0af6=new Hangup(_0x39d98d,_0x9f7d01);_0x3e0af6[_0x04a4('0x73')]=0x12;_0x3e0af6[_0x04a4('0x74')]=_0x04a4('0x12d');_0x3e0af6[_0x04a4('0x11a')]=_0x04a4('0x11b');ami[_0x04a4('0x44')](_0x04a4('0x11c'),ut[_0x04a4('0x11d')](_0x3e0af6,_0x04a4('0x122')));this[_0x04a4('0x12e')](_0x3e0af6,_0x04a4('0x12f'),'[syncHangupInAMDIvr]');}if(_0x39d98d[_0x04a4('0x45')]==='ivr'&&this[_0x04a4('0x22')][_0x39d98d[_0x04a4('0xc6')]]['dialAMDActive']&&_0x9f7d01['value']===_0x04a4('0x11f')){return new Promise(function(_0x360f0c,_0x28ae92){delete _0x48bf40['uniqueId'][_0x9f7d01[_0x04a4('0xc7')]];_0x48bf40[_0x04a4('0xc8')](_0x48bf40[_0x04a4('0x22')][_0x39d98d[_0x04a4('0xc6')]]);_0x48bf40[_0x04a4('0x22')][_0x39d98d[_0x04a4('0xc6')]][_0x04a4('0xcc')]+=0x1;_0x48bf40['campaigns'][_0x39d98d[_0x04a4('0xc6')]][_0x04a4('0x119')]+=0x1;var _0x410335=_0x48bf40[_0x04a4('0x22')][_0x39d98d[_0x04a4('0xc6')]];var _0x208b79=new Hangup(_0x39d98d,_0x9f7d01);_0x208b79[_0x04a4('0x73')]=0x13;_0x208b79[_0x04a4('0x74')]=_0x04a4('0x120');_0x208b79[_0x04a4('0x11a')]=_0x04a4('0x11b');_0x208b79[_0x04a4('0x121')]+=0x1;_0x208b79[_0x04a4('0xdc')]+=0x1;_0x208b79[_0x04a4('0x122')]=!![];ami[_0x04a4('0x44')](_0x04a4('0x11c'),ut['buildObj'](_0x208b79,_0x04a4('0x122')));hopperUtils[_0x04a4('0xd0')](_0x208b79)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x123')));if(_0x208b79['countbusyretry']+_0x208b79[_0x04a4('0x125')]+_0x208b79[_0x04a4('0x126')]+_0x208b79[_0x04a4('0x130')]+_0x208b79[_0x04a4('0xdb')]+_0x208b79[_0x04a4('0xf1')]+_0x208b79[_0x04a4('0x121')]+_0x208b79['countagentrejectretry']>=_0x410335[_0x04a4('0x128')]){_0x48bf40[_0x04a4('0x131')](_0x208b79,_0x360f0c,_0x28ae92,'reason19\x20machine....');}else{if(_0x208b79[_0x04a4('0x121')]>=_0x410335[_0x04a4('0x132')]){_0x48bf40['createStateFinal'](_0x208b79,_0x360f0c,_0x28ae92,'reason\x2019\x20machine....');}else{hopperUtils[_0x04a4('0xe3')]({'active':![],'countmachineretry':_0x208b79[_0x04a4('0x121')],'scheduledat':moment()[_0x04a4('0xe4')](_0x410335[_0x04a4('0x12b')],_0x04a4('0xe5'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x208b79[_0x04a4('0xe6')],'ListId':_0x208b79[_0x04a4('0x106')],'VoiceQueueId':_0x208b79['VoiceQueueId']||undefined,'CampaignId':_0x208b79[_0x04a4('0xe8')]||undefined})['catch'](loggerCatch(_0x04a4('0x12c')));_0x360f0c({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x04a4('0x38')]=function(_0x2f5034){var _0x45eb61=this['uniqueId'][_0x2f5034[_0x04a4('0xc7')]];var _0x27fc47;if(_0x45eb61&&_0x45eb61[_0x04a4('0x45')]==='ivr'){delete this[_0x04a4('0x28')][_0x2f5034[_0x04a4('0xc7')]];this[_0x04a4('0xc8')](this['campaigns'][_0x45eb61[_0x04a4('0xc6')]]);this['campaigns'][_0x45eb61[_0x04a4('0xc6')]][_0x04a4('0x133')]+=0x1;_0x27fc47=new Hangup(_0x45eb61,_0x2f5034);hopperUtils[_0x04a4('0xd0')](_0x27fc47)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x134')));hopperUtils[_0x04a4('0xd1')](_0x27fc47)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x135')));}if(_0x45eb61&&_0x45eb61[_0x04a4('0x45')]!==_0x04a4('0xcb')&&isNotNull(this[_0x04a4('0xc9')][_0x45eb61[_0x04a4('0xc6')]][_0x04a4('0x136')])){delete this[_0x04a4('0x28')][_0x2f5034[_0x04a4('0xc7')]];this[_0x04a4('0xc8')](this['voiceQueues'][_0x45eb61[_0x04a4('0xc6')]]);this[_0x04a4('0xc9')][_0x45eb61[_0x04a4('0xc6')]]['outboundAnswerCallsDay']+=0x1;this[_0x04a4('0xc9')][_0x45eb61[_0x04a4('0xc6')]][_0x04a4('0x119')]+=0x1;_0x27fc47=new Hangup(_0x45eb61,_0x2f5034);_0x27fc47['state']=0x10;_0x27fc47[_0x04a4('0x74')]='AnswerAGI';_0x27fc47[_0x04a4('0x11a')]='AGI';hopperUtils[_0x04a4('0xd0')](_0x27fc47)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x134')));hopperUtils[_0x04a4('0xd1')](_0x27fc47)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x135')));}if(_0x45eb61&&_0x45eb61[_0x04a4('0x45')]!==_0x04a4('0xcb')&&!isNotNull(this[_0x04a4('0xc9')][_0x45eb61[_0x04a4('0xc6')]][_0x04a4('0x136')])){delete this[_0x04a4('0x28')][_0x2f5034[_0x04a4('0xc7')]];this[_0x04a4('0xc8')](this['voiceQueues'][_0x45eb61['queue']]);this[_0x04a4('0xc9')][_0x45eb61[_0x04a4('0xc6')]][_0x04a4('0x137')]+=0x1;_0x27fc47=new Hangup(_0x45eb61,_0x2f5034);_0x27fc47[_0x04a4('0x73')]=0xc;_0x27fc47['statedesc']=_0x2f5034['cause-txt'];_0x27fc47[_0x04a4('0x11a')]=_0x04a4('0x138');hopperUtils[_0x04a4('0xd0')](_0x27fc47)['catch'](loggerCatch(_0x04a4('0x134')));hopperUtils[_0x04a4('0xd1')](_0x27fc47)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x135')));}};Dialer[_0x04a4('0x1d')]['syncQueueSummary']=function(_0x195635){var _0x330bb3=this;if(!_0x330bb3[_0x04a4('0x2c')][_0x195635[_0x04a4('0x63')]]){_0x330bb3[_0x04a4('0x2c')][_0x195635[_0x04a4('0x63')]]={'running':![]};}else if(_0x330bb3[_0x04a4('0x2c')][_0x195635[_0x04a4('0x63')]][_0x04a4('0x139')]===!![]){return;}else if(_0x330bb3[_0x04a4('0x2c')][_0x195635[_0x04a4('0x63')]][_0x04a4('0x139')]===![]){_0x330bb3[_0x04a4('0x2c')][_0x195635['name']]['running']=!![];}var _0x445ae0=_0x330bb3['voiceQueues'][_0x195635[_0x04a4('0x63')]];var _0x23aec7=_0x445ae0[_0x04a4('0x70')]!==utils['CAMPAIGN_STATUS'][_0x04a4('0x82')];var _0x4d98c5=utils[_0x04a4('0x13a')](_0x445ae0);_0x445ae0[_0x04a4('0x13b')]=utils[_0x04a4('0x13c')](_0x445ae0,_0x330bb3[_0x04a4('0x24')]);Promise[_0x04a4('0xb1')]()[_0x04a4('0x41')](function(){if(_0x445ae0[_0x04a4('0x13b')]===utils[_0x04a4('0x6c')][_0x04a4('0x82')]){if(_0x23aec7){clearPredictiveAttributes(_0x445ae0);_0x195635['startPredictive']=undefined;_0x195635[_0x04a4('0x29')]=undefined;}if(_0x445ae0[_0x04a4('0x13b')]===utils['CAMPAIGN_STATUS'][_0x04a4('0x82')]){_0x195635['available']=0x0;_0x195635[_0x04a4('0xff')]=0x0;_0x195635['inUse']=0x0;_0x195635[_0x04a4('0x13d')]=0x0;_0x195635['pTalking']=0x0;}}else if(_0x445ae0[_0x04a4('0x13b')]===utils[_0x04a4('0x6c')][_0x04a4('0x13e')]&&!_0x4d98c5){return _0x330bb3['ifTime'](_0x445ae0,!![])['then'](function(){return _0x330bb3['ifTime'](_0x445ae0,![]);})['then'](function(){return _0x330bb3[_0x04a4('0xb7')](_0x445ae0);})['catch'](function(_0x28031e){loggerSyncQueueSummary[_0x04a4('0x47')](_0x04a4('0x13f'),util[_0x04a4('0x49')](_0x28031e,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x445ae0);});}else{clearPredictiveAttributes(_0x445ae0);}})[_0x04a4('0x41')](function(){var _0x24ccb1=_0x195635[_0x04a4('0x140')](_0x445ae0);if(_0x24ccb1||_0x445ae0['queueSummaryCountersUpdated']){_0x445ae0['queueSummaryCountersUpdated']=![];_0x195635[_0x04a4('0x141')](_0x445ae0);Object[_0x04a4('0x142')](_0x445ae0,_0x195635);emitOutboundVoiceQueueSummary(_0x195635);}_0x330bb3[_0x04a4('0x2c')][_0x445ae0['name']][_0x04a4('0x139')]=![];})['catch'](function(_0x3a976b){logger[_0x04a4('0x67')](_0x04a4('0x13f'),util['inspect'](_0x3a976b,{'showHidden':![],'depth':null}));_0x330bb3[_0x04a4('0x2c')][_0x445ae0[_0x04a4('0x63')]][_0x04a4('0x139')]=![];});};Dialer[_0x04a4('0x1d')]['syncQueueSummaryComplete']=_['throttle'](function(){var _0x23f080=_[_0x04a4('0x143')](this[_0x04a4('0xc9')],function(_0x3fa425){return _0x3fa425[_0x04a4('0x144')];});var _0x1c0e54=_[_0x04a4('0x143')](this[_0x04a4('0x23')],function(_0x10e1e1){return _0x10e1e1[_0x04a4('0x145')]&&_0x10e1e1[_0x04a4('0x90')]==='reachable';});if(_0x23f080[_0x04a4('0xa1')]>0x0&&_0x1c0e54[_0x04a4('0xa1')]>0x0){return Promise['resolve']()['then'](cmHopper[_0x04a4('0x146')](_['map'](_0x23f080,'id'),previewRecallmeReminderInterval,_[_0x04a4('0x147')](_0x1c0e54,'id')))[_0x04a4('0x41')](function(_0x26d558){for(var _0x5c8057=0x0;_0x5c8057<_0x26d558[_0x04a4('0xa1')];_0x5c8057++){var _0x4d9246=_0x26d558[_0x5c8057]['Agent'][_0x04a4('0x63')];if(_0x4d9246)io['to'](util[_0x04a4('0x4a')](_0x04a4('0x148'),_0x4d9246))[_0x04a4('0x44')](_0x04a4('0x149'),{'hopper':_0x26d558[_0x5c8057]});}})[_0x04a4('0xa9')](function(_0x1c2165){logger['error']('checkPreviewRecallReminder',_0x1c2165);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype']['loopClearZombieChannels']=function(){var _0x35fead=this;setInterval(function(){_0x35fead['clearZombieChannels'](_0x35fead[_0x04a4('0x28')],'[uniqueid]');_0x35fead[_0x04a4('0x14a')](_0x35fead[_0x04a4('0x27')],_0x04a4('0x14b'));},0x32c8);};Dialer[_0x04a4('0x1d')]['clearZombieChannels']=function(_0x1afc47,_0x588936){var _0x9110f2=this;for(var _0x22ccea in _0x1afc47){if(typeof _0x1afc47[_0x22ccea]!==_0x04a4('0xb0')){this[_0x04a4('0x21')]['enqueue'](function(){if(!_['isNil'](_0x1afc47[_0x22ccea])){return ami['Action']({'action':_0x04a4('0x90'),'channel':_0x1afc47[_0x22ccea][_0x04a4('0xf8')]})[_0x04a4('0xa9')](function(_0x514b8f){if(_0x514b8f[_0x04a4('0x70')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1afc47[_0x22ccea]&&_0x1afc47[_0x22ccea][_0x04a4('0x45')]!=='ivr'){_0x9110f2[_0x04a4('0xc8')](_0x9110f2['voiceQueues'][_0x1afc47[_0x22ccea][_0x04a4('0xc6')]]);logger[_0x04a4('0x67')]('[Dialer][checkChannel]',_0x588936,_0x22ccea,_0x1afc47[_0x22ccea][_0x04a4('0xc6')]);delete _0x1afc47[_0x22ccea];}if(_0x1afc47[_0x22ccea]&&_0x1afc47[_0x22ccea]['type']===_0x04a4('0xcb')){_0x9110f2[_0x04a4('0xc8')](_0x9110f2[_0x04a4('0x22')][_0x1afc47[_0x22ccea][_0x04a4('0xc6')]]);logger[_0x04a4('0x67')](_0x04a4('0x14c'),_0x588936,_0x22ccea,_0x1afc47[_0x22ccea][_0x04a4('0xc6')]);delete _0x1afc47[_0x22ccea];}},0x2328);}});}});}}};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x2839b3){return Promise[_0x04a4('0xb1')]()[_0x04a4('0x41')](voiceQueueRt['getVoiceQueueRtPauses'](_0x2839b3))[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x14d')));};Dialer['prototype'][_0x04a4('0xc8')]=function(_0x30fe4c){if(!_['isUndefined'](_0x30fe4c)&&_0x30fe4c!==null){if(typeof _0x30fe4c[_0x04a4('0x14e')]!==_0x04a4('0xb0')){if(_0x30fe4c[_0x04a4('0x14e')]>0x0){_0x30fe4c[_0x04a4('0x14e')]-=0x1;}else{logger['error'](_0x04a4('0x14f'));}}}else{logger[_0x04a4('0x67')](_0x04a4('0x150'));}};Dialer['prototype'][_0x04a4('0x151')]=function(_0x1a671a,_0x1bb315){var _0xacec49=this;return function(_0x656057){_0xacec49[_0x04a4('0xc8')](_0x1bb315);logger[_0x04a4('0x67')](_0x1a671a,util[_0x04a4('0x49')](_0x656057,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x04a4('0x152')]=function(_0x307790,_0x29dee3,_0x1a0643){var _0x4e1c57={'state':0x19,'statedesc':_0x04a4('0x153')};this[_0x04a4('0xc8')](_0x29dee3);this[_0x04a4('0x12e')](_[_0x04a4('0x5f')](_0x4e1c57,_[_0x04a4('0x7b')](_0x1a0643,[_0x04a4('0xe6'),'ListId',_0x04a4('0x154'),_0x04a4('0xe7'),_0x04a4('0xe8')])),'[emptyContact][createHistory]',_0x04a4('0x155'));logger[_0x04a4('0x67')](_0x307790);};Dialer['prototype']['saveInDb']=function(_0x17f1d6,_0x3ed28a,_0x4029da){hopperUtils[_0x04a4('0xd0')](_0x17f1d6)[_0x04a4('0xa9')](loggerCatch(_0x3ed28a));hopperUtils[_0x04a4('0xd1')](_0x17f1d6)[_0x04a4('0xa9')](loggerCatch(_0x4029da));};Dialer[_0x04a4('0x1d')][_0x04a4('0xe2')]=function(_0xfd21ff,_0x5a5a1f){hopperUtils[_0x04a4('0xd0')](_0xfd21ff)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x156')));if(_0x5a5a1f==0x0){hopperUtils[_0x04a4('0xd1')](_0xfd21ff)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x157')));}};Dialer[_0x04a4('0x1d')][_0x04a4('0x158')]=function(_0x7bf9e6){return Promise[_0x04a4('0xb1')]()[_0x04a4('0x41')](cmHopper[_0x04a4('0x146')](_0x7bf9e6['id'],previewRecallmeReminderInterval))[_0x04a4('0x41')](function(_0x40c4d4){for(var _0x5aa167=0x0;_0x5aa167<_0x40c4d4[_0x04a4('0xa1')];_0x5aa167++){var _0x119ae6=_0x40c4d4[_0x5aa167]['Agent'][_0x04a4('0x63')];if(_0x119ae6)io['to'](util[_0x04a4('0x4a')](_0x04a4('0x148'),_0x119ae6))[_0x04a4('0x44')]('user:dialPreviewRecallReminder',{'hopper':_0x40c4d4[_0x5aa167]});}})[_0x04a4('0xa9')](function(){});};Dialer[_0x04a4('0x1d')][_0x04a4('0xb5')]=function(_0x4ebb54){var _0x2eaf9f=this;return function(){_0x2eaf9f[_0x04a4('0x159')](_0x4ebb54);};};Dialer[_0x04a4('0x1d')][_0x04a4('0x15a')]=function(_0x13de28,_0x3da590){var _0x1add3a=this;var _0x42f4ab=uuid['v4']();this[_0x04a4('0x27')][_0x42f4ab]=new Action(_0x13de28,_0x3da590,_0x42f4ab);return new Promise(function(_0x1bdf62,_0x4b9c01){if(_[_0x04a4('0x43')](_0x13de28)&&typeof _0x13de28!==_0x04a4('0x15b')){return _0x4b9c01(msgResponse('originate','Failure','voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x3da590[_0x04a4('0x15c')])||_0x3da590[_0x04a4('0x15c')]===null){return _0x4b9c01(msgResponse('originate',_0x04a4('0x99'),_0x04a4('0x15d')));}var _0x3847a1={'XMD-CALLERID':_0x1add3a[_0x04a4('0x27')][_0x42f4ab]['getCaller'](),'XMD-AGI':_0x13de28[_0x04a4('0x136')]?util[_0x04a4('0x4a')](_0x04a4('0x15e'),ipAgi,_0x13de28[_0x04a4('0x136')]):'NONE','XMD-AGIAFTER':_0x13de28[_0x04a4('0xce')]?util[_0x04a4('0x4a')](_0x04a4('0x15e'),ipAgi,_0x13de28[_0x04a4('0xce')]):'NONE','XMD-QUEUE':utils[_0x04a4('0x15f')](_0x13de28)?util[_0x04a4('0x4a')](_0x04a4('0x160'),_0x13de28[_0x04a4('0x63')],_0x13de28['dialQueueOptions']||'',_0x13de28[_0x04a4('0xcf')]?'c':'',_0x13de28[_0x04a4('0xd4')]||0x3):_0x04a4('0x161'),'XMD-CONTACTID':_0x3da590[_0x04a4('0xe6')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1add3a[_0x04a4('0x27')][_0x42f4ab][_0x04a4('0x162')](),'XMD-AMD':_0x13de28[_0x04a4('0x116')]?_0x04a4('0x13e'):'NONE','XMD-DESTINATION':_0x04a4('0x115')};if(_0x13de28['dialAMDActive']){_0x3847a1[_0x04a4('0x163')]=_0x13de28[_0x04a4('0x164')]||0x9c4;_0x3847a1[_0x04a4('0x165')]=_0x13de28['dialAMDGreeting']||0x5dc;_0x3847a1[_0x04a4('0x166')]=_0x13de28[_0x04a4('0x167')]||0x320;_0x3847a1[_0x04a4('0x168')]=_0x13de28['dialAMDTotalAnalysisTime']||0x1388;_0x3847a1[_0x04a4('0x169')]=_0x13de28[_0x04a4('0x16a')]||0x64;_0x3847a1['XMD-AMDBETWEENWORDSSILENCE']=_0x13de28[_0x04a4('0x16b')]||0x32;_0x3847a1[_0x04a4('0x16c')]=_0x13de28['dialAMDMaximumNumberOfWords']||0x3;_0x3847a1[_0x04a4('0x16d')]=_0x13de28[_0x04a4('0x16e')]||0x100;_0x3847a1['XMD-AMDMAXIMUMWORDLENGTH']=_0x13de28[_0x04a4('0x16f')]||0x1388;}if(utils[_0x04a4('0x15f')](_0x13de28)){_0x3847a1[_0x04a4('0x170')]=_0x3da590['VoiceQueueId'];}else{_0x3847a1[_0x04a4('0x171')]=_0x3da590['CampaignId'];}var _0x315068=utils[_0x04a4('0x172')](_0x3da590[_0x04a4('0x173')]);Object[_0x04a4('0x142')](_0x3847a1,_0x315068);var _0x2e7c44=_0x1add3a['isTrunkReachable'](_0x13de28['Trunk'])?utils[_0x04a4('0x174')](_0x13de28[_0x04a4('0x94')]['callerid'],_0x13de28[_0x04a4('0x175')],_0x13de28[_0x04a4('0x176')]>0x0?utils[_0x04a4('0x177')](_0x13de28['dialOriginateCallerIdNumber'],_0x13de28[_0x04a4('0x176')]):_0x13de28[_0x04a4('0x178')]):utils[_0x04a4('0x174')](_[_0x04a4('0xfd')](_0x13de28['TrunkBackup'])?_0x13de28[_0x04a4('0x94')][_0x04a4('0x179')]:_0x13de28['TrunkBackup'][_0x04a4('0x179')],_0x13de28[_0x04a4('0x175')],_0x13de28[_0x04a4('0x176')]>0x0?utils[_0x04a4('0x177')](_0x13de28[_0x04a4('0x178')],_0x13de28[_0x04a4('0x176')]):_0x13de28['dialOriginateCallerIdNumber']);if(_0x2e7c44){_0x3847a1[_0x04a4('0x17a')]=_0x1add3a[_0x04a4('0x27')][_0x42f4ab][_0x04a4('0x17b')]=utils[_0x04a4('0x17c')](_0x2e7c44);_0x3847a1[_0x04a4('0x17d')]=_0x3da590['phone'];}_0x13de28[_0x04a4('0x17e')]=_0x3847a1;return ami['Action']({'actionid':_0x42f4ab,'action':_0x04a4('0x17f'),'channel':_0x1add3a[_0x04a4('0x8e')](_0x13de28[_0x04a4('0x94')])?util[_0x04a4('0x4a')]('SIP/%s/%s%s',_0x13de28['Trunk'][_0x04a4('0x63')],isNotNull(_0x13de28[_0x04a4('0x180')])?_0x13de28[_0x04a4('0x180')][_0x04a4('0x181')]()||'':'',_0x13de28[_0x04a4('0x182')]>0x0?_0x3da590[_0x04a4('0x15c')][_0x04a4('0x183')](_0x13de28[_0x04a4('0x182')]):_0x3da590[_0x04a4('0x15c')]):util[_0x04a4('0x4a')]('SIP/%s/%s%s',_[_0x04a4('0xfd')](_0x13de28[_0x04a4('0x95')])?_0x13de28['Trunk'][_0x04a4('0x63')]:_0x13de28[_0x04a4('0x95')][_0x04a4('0x63')],isNotNull(_0x13de28[_0x04a4('0x180')])?_0x13de28[_0x04a4('0x180')]['trim']()||'':'',_0x13de28[_0x04a4('0x182')]>0x0?_0x3da590[_0x04a4('0x15c')]['substring'](_0x13de28[_0x04a4('0x182')]):_0x3da590[_0x04a4('0x15c')]),'callerid':_0x2e7c44,'Exten':_0x04a4('0x115'),'Context':'from-sip','Priority':'1','variable':_0x3847a1,'timeout':(_0x13de28[_0x04a4('0x184')]||0x1e)*0x3e8,'async':!![],'channelid':_0x42f4ab})['then'](function(_0x3b7224){return _0x1bdf62(_0x3b7224);})[_0x04a4('0xa9')](function(_0x1d9b9a){_0x13de28[_0x04a4('0x185')]+=0x1;var _0xd19739=new History(_0x1add3a[_0x04a4('0x27')][_0x42f4ab]);logger[_0x04a4('0x67')](util[_0x04a4('0x4a')]('[originateError]:\x20%s',JSON[_0x04a4('0x7a')](_0x1d9b9a)));_0xd19739[_0x04a4('0x73')]=0xe;_0xd19739[_0x04a4('0x74')]='OriginateError';_0xd19739[_0x04a4('0x76')]=moment()[_0x04a4('0x4a')](_0x04a4('0xca'));_0xd19739[_0x04a4('0x75')]=_0xd19739['starttime'];hopperUtils[_0x04a4('0xd0')](_0xd19739)['catch'](loggerCatch(_0x04a4('0x186')));_0x1add3a[_0x04a4('0xd1')](_0xd19739)[_0x04a4('0xa9')](loggerCatch('[originate][error]'))[_0x04a4('0x20')](function(){delete _0x1add3a[_0x04a4('0x27')][_0x42f4ab];return _0x4b9c01(msgResponse(_0x04a4('0x17f'),_0x04a4('0x8d'),_0x04a4('0x187')));});});});};Dialer[_0x04a4('0x1d')][_0x04a4('0x188')]=function(_0x2cdd7a,_0x28ebca,_0x172a06){var _0x5dc186=new History(_0x28ebca);if(_0x5dc186[_0x04a4('0x124')]+_0x5dc186[_0x04a4('0x125')]+_0x5dc186[_0x04a4('0x126')]+_0x5dc186[_0x04a4('0x130')]+_0x5dc186[_0x04a4('0xdb')]+_0x5dc186['countabandonedretry']+_0x5dc186[_0x04a4('0x121')]+_0x5dc186[_0x04a4('0x127')]>=_0x172a06[_0x04a4('0x128')]-0x1){return!![];}switch(_0x2cdd7a){case 0x3:if(_0x5dc186[_0x04a4('0x126')]>=_0x172a06[_0x04a4('0x189')]-0x1){return!![];}hopperUtils[_0x04a4('0xe3')]({'active':![],'countnoanswerretry':_0x5dc186[_0x04a4('0x126')]+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06[_0x04a4('0x18a')],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186[_0x04a4('0xe6')],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186[_0x04a4('0xe7')]||undefined,'CampaignId':_0x5dc186[_0x04a4('0xe8')]||undefined})['catch'](loggerCatch(_0x04a4('0x18b')));break;case 0x5:if(_0x5dc186[_0x04a4('0x124')]>=_0x172a06[_0x04a4('0x18c')]-0x1){return!![];}hopperUtils[_0x04a4('0xe3')]({'active':![],'countbusyretry':_0x5dc186[_0x04a4('0x124')]+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06['dialBusyRetryFrequency'],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186[_0x04a4('0xe6')],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186[_0x04a4('0xe7')]||undefined,'CampaignId':_0x5dc186[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x18d')));break;case 0x8:if(_0x5dc186[_0x04a4('0x125')]>=_0x172a06[_0x04a4('0x18e')]-0x1){return!![];}hopperUtils[_0x04a4('0xe3')]({'active':![],'countcongestionretry':_0x5dc186[_0x04a4('0x125')]+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06[_0x04a4('0x18f')],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186['ContactId'],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186[_0x04a4('0xe7')]||undefined,'CampaignId':_0x5dc186[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x190')));break;case 0x0:if(_0x5dc186[_0x04a4('0x130')]>=_0x172a06['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x04a4('0xe3')]({'active':![],'countnosuchnumberretry':_0x5dc186[_0x04a4('0x130')]+=0x1,'scheduledat':moment()['add'](_0x172a06[_0x04a4('0x191')],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186['ContactId'],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186[_0x04a4('0xe7')]||undefined,'CampaignId':_0x5dc186['CampaignId']||undefined})[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x192')));}break;case 0xa:if(_0x5dc186['countdropretry']>=_0x172a06[_0x04a4('0xe1')]-0x1){return!![];}hopperUtils[_0x04a4('0xe3')]({'active':![],'countdropretry':_0x5dc186[_0x04a4('0xdb')]+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06[_0x04a4('0xdd')],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186[_0x04a4('0xe6')],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186[_0x04a4('0xe7')]||undefined,'CampaignId':_0x5dc186[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x5dc186[_0x04a4('0xf1')]>=_0x172a06[_0x04a4('0xf4')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x5dc186[_0x04a4('0xf1')]+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06[_0x04a4('0xf2')],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186[_0x04a4('0xe6')],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186['VoiceQueueId']||undefined,'CampaignId':_0x5dc186['CampaignId']||undefined})['catch'](loggerCatch(_0x04a4('0xf5')));break;case 0x13:if(_0x5dc186['countmachineretry']>=_0x172a06['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x5dc186['countmachineretry']+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06[_0x04a4('0x12b')],_0x04a4('0xe5'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5dc186[_0x04a4('0xe6')],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186['VoiceQueueId']||undefined,'CampaignId':_0x5dc186[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x5dc186[_0x04a4('0x127')]>=_0x172a06[_0x04a4('0x193')]-0x1){return!![];}hopperUtils[_0x04a4('0xe3')]({'active':![],'countagentrejectretry':_0x5dc186[_0x04a4('0x127')]+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06[_0x04a4('0x194')],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186['ContactId'],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186['VoiceQueueId']||undefined,'CampaignId':_0x5dc186[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x04a4('0x1d')][_0x04a4('0x195')]=function(_0x1ad5c8,_0x409605,_0x36991a){var _0x337b20=this;var _0x3e3a19=new History(_0x1ad5c8);var _0x2dd6a1=![];var _0x1eb85a;var _0x390ae8;return new Promise(function(_0x4d71d4,_0xe9c6c3){if(_[_0x04a4('0x43')](_0x409605)&&typeof _0x409605!==_0x04a4('0x15b')){return _0xe9c6c3(msgResponse(_0x04a4('0x196'),_0x04a4('0x99'),_0x04a4('0x197')));}if(_[_0x04a4('0x43')](_0x36991a)&&typeof _0x36991a!==_0x04a4('0x15b')){return _0xe9c6c3(msgResponse(_0x04a4('0x196'),_0x04a4('0x99'),_0x04a4('0x198')));}hopperUtils['verifyAdditionalPhones'](_0x3e3a19,_0x36991a['reason'],_0x409605)[_0x04a4('0x41')](function(_0x437b8e){if(_0x437b8e[_0x04a4('0xe0')]==0x1)_0x2dd6a1=!![];switch(_0x36991a[_0x04a4('0x199')]){case'0':_0x409605['outboundNoSuchCallsDay']+=0x1;_0x3e3a19[_0x04a4('0x73')]=0x0;_0x3e3a19['statedesc']=_0x04a4('0x19a');_0x3e3a19[_0x04a4('0x130')]+=0x1;_0x3e3a19[_0x04a4('0xdc')]+=0x1;ami[_0x04a4('0x44')](_0x04a4('0x19b'),ut[_0x04a4('0x11d')](_0x1ad5c8,_0x04a4('0x19c')));_0x1eb85a=_0x409605[_0x04a4('0x191')];_0x390ae8=_0x409605[_0x04a4('0xde')];hopperUtils['createHistory'](_0x3e3a19)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x123')));if(_0x337b20['checkRetriveMax'](0x0,_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19[_0x04a4('0x130')]>=_0x409605['dialNoSuchNumberMaxRetry']){_0x337b20[_0x04a4('0x12a')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,'reason\x200\x20no\x20such\x20number....');}else{_0x337b20[_0x04a4('0x131')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x19d'));}}break;case'3':_0x409605[_0x04a4('0x19e')]+=0x1;_0x3e3a19['state']=0x3;_0x3e3a19[_0x04a4('0x74')]='NoAnswer';_0x3e3a19[_0x04a4('0x126')]+=0x1;_0x3e3a19[_0x04a4('0xdc')]+=0x1;var _0x5ad30d=ut[_0x04a4('0x19f')](_0x1ad5c8,_0x409605);ami[_0x04a4('0x44')]('custom:agentnoanswer',_0x5ad30d);_0x1eb85a=_0x409605[_0x04a4('0x18a')];_0x390ae8=_0x409605['callAdditionalPhoneAfterMin'];hopperUtils[_0x04a4('0xd0')](_0x3e3a19)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x1a0')));if(_0x337b20[_0x04a4('0x188')](0x3,_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19[_0x04a4('0x126')]>=_0x409605[_0x04a4('0x189')]){_0x337b20['createStateFinal'](_0x3e3a19,_0x4d71d4,_0xe9c6c3,'reason\x203\x20ringing\x20no\x20answer');}else{_0x337b20['stateGlobal'](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x1a1'));}}break;case'5':_0x409605[_0x04a4('0x1a2')]+=0x1;_0x3e3a19[_0x04a4('0x73')]=0x5;_0x3e3a19['statedesc']='Busy';_0x3e3a19[_0x04a4('0x124')]+=0x1;_0x3e3a19[_0x04a4('0xdc')]+=0x1;ami[_0x04a4('0x44')]('custom:agentbusy',ut[_0x04a4('0x11d')](_0x1ad5c8,_0x04a4('0x1a3')));_0x1eb85a=_0x409605[_0x04a4('0x1a4')];_0x390ae8=_0x409605['callAdditionalPhoneAfterMin'];hopperUtils[_0x04a4('0xd0')](_0x3e3a19)['catch'](loggerCatch(_0x04a4('0x1a5')));if(_0x337b20[_0x04a4('0x188')](0x5,_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19[_0x04a4('0x124')]>=_0x409605[_0x04a4('0x18c')]){_0x337b20[_0x04a4('0x12a')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x1a6'));}else{_0x337b20['stateGlobal'](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x1a6'));}}break;case'8':_0x409605[_0x04a4('0x1a7')]+=0x1;_0x3e3a19[_0x04a4('0x73')]=0x8;_0x3e3a19['statedesc']=_0x04a4('0x1a8');_0x3e3a19[_0x04a4('0x125')]+=0x1;_0x3e3a19[_0x04a4('0xdc')]+=0x1;_0x1eb85a=_0x409605[_0x04a4('0x18f')];_0x390ae8=_0x409605[_0x04a4('0xde')];ami[_0x04a4('0x44')](_0x04a4('0x1a9'),ut[_0x04a4('0x11d')](_0x1ad5c8,_0x04a4('0x1aa')));hopperUtils[_0x04a4('0xd0')](_0x3e3a19)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x1ab')));if(_0x337b20[_0x04a4('0x188')](0x8,_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19[_0x04a4('0x125')]>=_0x409605[_0x04a4('0x18e')]){_0x337b20[_0x04a4('0x12a')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,'reason\x208\x20congestion');}else{_0x337b20[_0x04a4('0x131')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x1ac'));}}break;case'11':_0x409605[_0x04a4('0x1ad')]+=0x1;_0x3e3a19['state']=0xb;_0x3e3a19[_0x04a4('0x74')]='Abandoned';_0x3e3a19[_0x04a4('0xf1')]+=0x1;_0x3e3a19[_0x04a4('0xdc')]+=0x1;_0x1eb85a=_0x409605['dialAbandonedRetryFrequency'];_0x390ae8=_0x409605['callAdditionalPhoneAfterMin'];hopperUtils[_0x04a4('0xd0')](_0x3e3a19)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0xf6')));if(_0x337b20['checkRetriveMax'](0xb,_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19[_0x04a4('0xf1')]>=_0x409605[_0x04a4('0xf4')]){_0x337b20['createStateFinal'](_0x3e3a19,_0x4d71d4,_0xe9c6c3,'reason\x2011\x20abandoned');}else{_0x337b20[_0x04a4('0x131')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x1ae'));}}break;case'20':_0x409605[_0x04a4('0x1af')]+=0x1;_0x3e3a19[_0x04a4('0x73')]=0x14;_0x3e3a19[_0x04a4('0x74')]='AgentReject';_0x3e3a19[_0x04a4('0x127')]+=0x1;_0x3e3a19['countglobal']+=0x1;_0x1eb85a=_0x409605[_0x04a4('0x194')];_0x390ae8=_0x409605['callAdditionalPhoneAfterMin'];ami['emit'](_0x04a4('0x1b0'),ut[_0x04a4('0x11d')](_0x1ad5c8,'agentreject'));hopperUtils['createHistory'](_0x3e3a19)['catch'](loggerCatch(_0x04a4('0x1b1')));if(_0x337b20['checkRetriveMax'](0x14,_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19['countagentrejectretry']>=_0x409605[_0x04a4('0x193')]){_0x337b20[_0x04a4('0x12a')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,'reason\x2020\x20agentreject');}else{_0x337b20[_0x04a4('0x131')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x1b2'));}}break;default:_0x409605[_0x04a4('0x137')]+=0x1;_0x3e3a19['state']=0xc;_0x3e3a19[_0x04a4('0x74')]=_0x36991a[_0x04a4('0x199')];_0x1eb85a=_0x409605[_0x04a4('0x194')];_0x390ae8=_0x409605['callAdditionalPhoneAfterMin'];hopperUtils[_0x04a4('0xd0')](_0x3e3a19)['catch'](loggerCatch(_0x04a4('0x1b3')));if(_0x337b20[_0x04a4('0x188')](_0x36991a[_0x04a4('0x199')],_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19[_0x04a4('0x124')]+_0x3e3a19[_0x04a4('0x125')]+_0x3e3a19[_0x04a4('0x126')]+_0x3e3a19[_0x04a4('0x130')]+_0x3e3a19['countdropretry']+_0x3e3a19[_0x04a4('0xf1')]+_0x3e3a19[_0x04a4('0x121')]+_0x3e3a19[_0x04a4('0x127')]>=_0x409605[_0x04a4('0x128')]){_0x337b20[_0x04a4('0x131')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x36991a['reason']);}else{_0x337b20[_0x04a4('0x12a')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x36991a[_0x04a4('0x199')]);}}}})['then'](function(){if(_0x2dd6a1){hopperUtils['swapAdditionalPhones'](_0x3e3a19,_0x1eb85a,_0x390ae8)[_0x04a4('0x41')](function(){return _0x4d71d4(0x1);});}});});};Dialer[_0x04a4('0x1d')]['stateGlobal']=function(_0x458984,_0x521d84,_0x5b2439,_0xbdbc98){var _0x1da03a=new Final(_0x458984);_0x1da03a[_0x04a4('0x73')]=0xf;_0x1da03a[_0x04a4('0x74')]=_0x04a4('0x1b4');this['createStateFinal'](_0x1da03a,_0x521d84,_0x5b2439,_0xbdbc98);};Dialer['prototype'][_0x04a4('0x12a')]=function(_0x3b5f3c,_0x398a3a,_0xf34fa6,_0x2c5999){hopperUtils['moveContactManagedDialer'](_0x3b5f3c)[_0x04a4('0x41')](function(){return _0x398a3a(msgResponse(_0x04a4('0x196'),'Success',_0x2c5999));})['catch'](function(){return _0xf34fa6(msgResponse('[moveContactManagedDialer][0]',_0x04a4('0x99'),'contact\x20not\x20moved'));});};Dialer[_0x04a4('0x1d')]['predictive']=function(_0xdb1a4e){var _0x34a2a1=_0xdb1a4e['dialPredictiveOptimizationPercentage']/0x64;var _0x41f049=_0xdb1a4e[_0x04a4('0xd6')]/(_0xdb1a4e['outboundDropCallsDayTimeout']+_0xdb1a4e['outboundAnswerCallsDay']);var _0x520462=Math[_0x04a4('0x1b5')](_0xdb1a4e[_0x04a4('0x1b6')]*(_0xdb1a4e[_0x04a4('0x1b7')]/0x64));var _0xa32467=Math[_0x04a4('0x1b5')](_0xdb1a4e[_0x04a4('0x1b6')]*(_0xdb1a4e[_0x04a4('0x1b8')]/0x64));var _0x4f8a23=_0xdb1a4e[_0x04a4('0x1b9')]+_0xdb1a4e[_0x04a4('0x13d')];var _0x2bfe58=Math[_0x04a4('0x1ba')](_0xdb1a4e[_0x04a4('0x5a')]*_0xdb1a4e[_0x04a4('0x5d')]*_0xdb1a4e[_0x04a4('0x1bb')]*_0xdb1a4e[_0x04a4('0x1bc')]);if(_[_0x04a4('0x43')](_0xdb1a4e[_0x04a4('0x29')])){if(!_[_0x04a4('0x43')](_0xdb1a4e[_0x04a4('0x62')])){_0xdb1a4e[_0x04a4('0x62')]=undefined;loggerPredictive[_0x04a4('0x67')](_0x04a4('0x1bd'),_0x04a4('0x1be'));}if(!_[_0x04a4('0x43')](_0xdb1a4e[_0x04a4('0x65')])){loggerPredictive[_0x04a4('0x67')](_0x04a4('0x1bd'),_0x04a4('0x1bf'));clearInterval(_0xdb1a4e['handlePredictive']);_0xdb1a4e['handlePredictive']=undefined;}_0xdb1a4e[_0x04a4('0x29')]=moment()[_0x04a4('0x4a')](_0x04a4('0xca'));loggerPredictive[_0x04a4('0x4c')](_0xdb1a4e[_0x04a4('0x63')],_0x04a4('0x1c0'),_0xdb1a4e[_0x04a4('0x29')]);this[_0x04a4('0xba')](_0xdb1a4e,0x1);}else if(ifInterval(_0xdb1a4e[_0x04a4('0x1c1')],_0xdb1a4e[_0x04a4('0x29')])){this[_0x04a4('0xba')](_0xdb1a4e,0x1);loggerPredictiveCalls[_0x04a4('0x4c')](_0x04a4('0x1c2'),_0xdb1a4e[_0x04a4('0x29')],_0xdb1a4e[_0x04a4('0x63')]);_0xdb1a4e[_0x04a4('0x5a')]=0x0;_0xdb1a4e[_0x04a4('0xd7')]=0x0;}else if(_0x34a2a1<_0x41f049&&_0xdb1a4e[_0x04a4('0x1c3')]==='dropRate'){clearPredictiveAttributes(_0xdb1a4e);loggerPredictive[_0x04a4('0x4c')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x41f049,_0x04a4('0x29'),_0xdb1a4e[_0x04a4('0x63')]);}else if(_0x2bfe58<_0xdb1a4e['predictiveIntervalErlangCallsDroppedCalls']&&_0xdb1a4e[_0x04a4('0x1c3')]===_0x04a4('0x1c4')){clearPredictiveAttributes(_0xdb1a4e);loggerPredictive['info'](_0x04a4('0x1c5'),_0x04a4('0x1c6'),_0x2bfe58,_0x04a4('0x1c7'),_0xdb1a4e[_0x04a4('0xd7')],_0x04a4('0x29'),_0xdb1a4e[_0x04a4('0x63')]);}else if(!ifInterval(_0xdb1a4e[_0x04a4('0x1c1')],_0xdb1a4e['startProgressive'])&&_[_0x04a4('0x43')](_0xdb1a4e[_0x04a4('0x62')])&&!_[_0x04a4('0x43')](_0xdb1a4e[_0x04a4('0x29')])){_0xdb1a4e[_0x04a4('0x62')]=moment()[_0x04a4('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0xdb1a4e['name'],_0x04a4('0x1c8'),_0xdb1a4e['startPredictive']);hopperUtils[_0x04a4('0x1c9')](_0xdb1a4e[_0x04a4('0x1c1')])[_0x04a4('0x41')](this[_0x04a4('0x1ca')](_0xdb1a4e))[_0x04a4('0x41')](mergeDataErlangB(_0xdb1a4e))['then'](this[_0x04a4('0x1cb')](_0xdb1a4e))[_0x04a4('0xa9')](loggerCatchPredictive(_0x04a4('0x1cc'),_0xdb1a4e));}else if(!ifInterval(_0xdb1a4e[_0x04a4('0x1c1')],_0xdb1a4e[_0x04a4('0x62')])){_0xdb1a4e[_0x04a4('0xd7')]=0x0;_0xdb1a4e[_0x04a4('0x62')]=moment()['format'](_0x04a4('0xca'));loggerPredictive[_0x04a4('0x4c')](_0xdb1a4e['name'],_0x04a4('0x1cd'),_0xdb1a4e[_0x04a4('0x62')]);clearInterval(_0xdb1a4e[_0x04a4('0x65')]);_0xdb1a4e['handlePredictive']=undefined;hopperUtils[_0x04a4('0x1c9')](_0xdb1a4e[_0x04a4('0x1c1')])[_0x04a4('0x41')](this[_0x04a4('0x1ca')](_0xdb1a4e))[_0x04a4('0x41')](mergeDataErlangB(_0xdb1a4e))[_0x04a4('0x41')](this[_0x04a4('0x1cb')](_0xdb1a4e))[_0x04a4('0xa9')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0xdb1a4e));}else if(_0xdb1a4e[_0x04a4('0x1b6')]&&_0x4f8a23<_0xdb1a4e[_0x04a4('0x1b6')]-_0xa32467){clearPredictiveAttributes(_0xdb1a4e);loggerPredictive[_0x04a4('0x4c')](_0xdb1a4e[_0x04a4('0x63')],_0x04a4('0x1ce'),_0x4f8a23,_0x04a4('0x1cf'),_0xdb1a4e[_0x04a4('0x1b6')],'-',_0xa32467,'=',_0xdb1a4e[_0x04a4('0x1b6')]-_0xa32467,')');}else if(_0xdb1a4e[_0x04a4('0x1b6')]&&_0x4f8a23>_0xdb1a4e[_0x04a4('0x1b6')]+_0x520462){clearPredictiveAttributes(_0xdb1a4e);loggerPredictive['info'](_0xdb1a4e['name'],_0x04a4('0x1ce'),_0x4f8a23,_0x04a4('0x1d0'),_0xdb1a4e['predictiveIntervalAvailable'],'+',_0x520462,'=',_0xdb1a4e[_0x04a4('0x1b6')]+_0x520462,')');}};Dialer[_0x04a4('0x1d')][_0x04a4('0x1ca')]=function(_0x1c0a1c){var _0x349dc4=this;return function(_0x1859e8){return new Promise(function(_0x262287,_0x459e65){_[_0x04a4('0x5f')](_0x1c0a1c,_0x1859e8[0x0]);if(checkGetDataPredictive(_0x1859e8[0x0])){var _0x3ee93a=_0x1c0a1c['predictiveIntervalAvailable']=_0x1c0a1c[_0x04a4('0x13d')]+_0x1c0a1c['available'];var _0x4750f3=_0x1c0a1c[_0x04a4('0x1c1')]*0x3c;var _0x32efbb=_0x1859e8[0x0][_0x04a4('0x54')]+_0x1859e8[0x0][_0x04a4('0x56')];var _0x3cbb8a=(_0x1859e8[0x0]['predictiveIntervalAnsweredCalls']+_0x1859e8[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1859e8[0x0][_0x04a4('0x53')])/_0x1859e8[0x0][_0x04a4('0x1d1')];_0x1c0a1c[_0x04a4('0x1bb')]=_0x3cbb8a>0x0?_0x3cbb8a:0x1;switch(_0x1c0a1c[_0x04a4('0x1c3')]){case'dropRate':var _0x1792f7=_0x1c0a1c[_0x04a4('0x1d2')]/0x64;return _0x349dc4[_0x04a4('0x1d3')](_0x3ee93a,_0x4750f3,_0x32efbb,_0x3cbb8a,_0x1792f7)['then'](function(_0x3f34dc){return _0x262287(_0x3f34dc);});case _0x04a4('0x1d4'):var _0x2065aa=_0x1c0a1c[_0x04a4('0x1d2')]/0x64;return _0x349dc4['busyFactor'](_0x3ee93a,_0x4750f3,_0x32efbb,_0x3cbb8a,_0x2065aa)[_0x04a4('0x41')](function(_0x5def56){return _0x262287(_0x5def56);});default:return _0x459e65(msgResponse(_0x04a4('0x1d5'),_0x04a4('0x99'),_0x04a4('0x1d6')));}}else{return _0x459e65(msgResponse(_0x04a4('0x1d5'),_0x04a4('0x99'),_0x04a4('0x1d7')));}});};};Dialer[_0x04a4('0x1d')]['getDataPredictiveOld']=function(_0x2d88d4){var _0x4ef6e0=this;return function(_0x33a79d){return new Promise(function(_0x4fba4e,_0x14a26e){_[_0x04a4('0x5f')](_0x2d88d4,_0x33a79d[0x0]);if(checkGetDataPredictive(_0x33a79d[0x0])){loggerPredictive[_0x04a4('0x4c')](JSON['stringify'](_0x33a79d[0x0]));if(_0x2d88d4[_0x04a4('0x1c3')]===_0x04a4('0x1c4')){return _0x4ef6e0[_0x04a4('0x1d8')](_0x2d88d4['id'])[_0x04a4('0x41')](function(_0x3b5772){var _0x41c290=_0x2d88d4[_0x04a4('0x1d9')]-_0x3b5772[0x0]['outboundQueuePauses'];var _0xbe5c02=_0x2d88d4['dialPredictiveInterval']*0x3c;var _0x5b3562=_0x33a79d[0x0][_0x04a4('0x54')]+_0x33a79d[0x0][_0x04a4('0x56')];var _0x4ef4c8=(_0x33a79d[0x0]['predictiveIntervalAnsweredCalls']+_0x33a79d[0x0][_0x04a4('0xd5')]+_0x33a79d[0x0][_0x04a4('0x53')])/_0x33a79d[0x0]['predictiveIntervalTotalCalls'];var _0xe96796=_0x2d88d4[_0x04a4('0x1d2')]/0x64;_0x2d88d4[_0x04a4('0x1da')]=_0x3b5772[0x0]['outboundQueuePauses']||0x0;_0x2d88d4['predictiveIntervalHitRate']=_0x4ef4c8>0x0?_0x4ef4c8:0x1;return _0x4ef6e0['abandonmentRate'](_0x41c290,_0xbe5c02,_0x5b3562,_0x4ef4c8,_0xe96796);})[_0x04a4('0x41')](function(_0x25f964){return _0x4fba4e(_0x25f964);})[_0x04a4('0xa9')](function(_0x280df8){return _0x14a26e(msgResponse('[CatchErlangB]',_0x04a4('0x99'),JSON[_0x04a4('0x7a')](_0x280df8)));});}if(_0x2d88d4[_0x04a4('0x1c3')]===_0x04a4('0x1d4')){return _0x4ef6e0[_0x04a4('0x1d8')](_0x2d88d4['id'])['then'](function(_0xbc07fd){var _0x4f2bc1=_0x2d88d4[_0x04a4('0x1d9')]-_0xbc07fd[0x0]['outboundQueuePauses'];var _0x5d81c8=_0x2d88d4[_0x04a4('0x1c1')]*0x3c;var _0x179d8e=_0x33a79d[0x0][_0x04a4('0x54')]+_0x33a79d[0x0]['predictiveIntervalAvgHoldtime'];var _0x412abf=(_0x33a79d[0x0][_0x04a4('0x50')]+_0x33a79d[0x0][_0x04a4('0xd5')]+_0x33a79d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x33a79d[0x0]['predictiveIntervalTotalCalls'];var _0x1ab749=_0x2d88d4['dialPredictiveOptimizationPercentage']/0x64;_0x2d88d4[_0x04a4('0x1da')]=_0xbc07fd[0x0][_0x04a4('0x1db')]||0x0;_0x2d88d4[_0x04a4('0x1bb')]=_0x412abf>0x0?_0x412abf:0x1;return _0x4ef6e0[_0x04a4('0x1dc')](_0x4f2bc1,_0x5d81c8,_0x179d8e,_0x412abf,_0x1ab749);})[_0x04a4('0x41')](function(_0x1b1a97){return _0x4fba4e(_0x1b1a97);})[_0x04a4('0xa9')](function(_0x6faa27){return _0x14a26e(msgResponse('[CatchErlangB]',_0x04a4('0x99'),JSON['stringify'](_0x6faa27)));});}}else{return _0x14a26e(msgResponse(_0x04a4('0x1d5'),_0x04a4('0x99'),_0x04a4('0x1d7')));}});};};Dialer[_0x04a4('0x1d')][_0x04a4('0x1cb')]=function(_0x2d937d){var _0x4d9b39=this;return function(){var _0x3609e8=0x0;var _0x3b6e1c=Math['floor'](_0x2d937d[_0x04a4('0x1dd')]*0x3e8);if(_0x3b6e1c>0x0){_0x3b6e1c=_0x3b6e1c<0x64?0x64:_0x3b6e1c;loggerPredictive[_0x04a4('0x4c')](_0x2d937d['name'],'one\x20call\x20every:',_0x3b6e1c,_0x04a4('0x1de'));_0x2d937d[_0x04a4('0x65')]=setInterval(function(){_0x4d9b39[_0x04a4('0x65')](_0x2d937d);loggerPredictiveCalls[_0x04a4('0x4c')](_0x04a4('0x1df'),_0x3609e8+=0x1);},_0x3b6e1c);}else{loggerPredictive[_0x04a4('0x4c')](_0x2d937d[_0x04a4('0x63')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x04a4('0x1e0')]=function(_0x512c0a,_0xe096b1){var _0x2f361e=this;return function(_0x39fe5f){if(_[_0x04a4('0x80')](_0x39fe5f)){if(_['isNil'](_0xe096b1['UserId'])||!_0xe096b1[_0x04a4('0x1e1')]){if(_0x512c0a['dialMethod']===_0x04a4('0xa')){_0x512c0a[_0x04a4('0x77')]=_['isUndefined'](_0x512c0a[_0x04a4('0x77')])?!![]:_0x512c0a['queueStatusComplete'];var _0x2379c0=uuid['v4']();_0x2f361e[_0x04a4('0x27')][_0x2379c0]=new Action(_0x512c0a,_0xe096b1,_0x2379c0);loggerBooked['info'](_0x04a4('0x1e2'),_0x2379c0,_0x04a4('0x1e3'),JSON[_0x04a4('0x7a')](_0x512c0a[_0x04a4('0x77')]),_0x04a4('0x1e4'),_0x512c0a[_0x04a4('0x63')]);if(_0x512c0a[_0x04a4('0x77')]){_0x512c0a[_0x04a4('0x77')]=![];_0x2f361e[_0x04a4('0x2a')][_0x2f361e['actions'][_0x2379c0]['queue']]=[];ami[_0x04a4('0xa3')]({'actionid':_0x2379c0,'action':_0x04a4('0x1e5'),'queue':_0x512c0a[_0x04a4('0x63')]})[_0x04a4('0xa9')](function(){_0x2f361e[_0x04a4('0xc8')](_0x512c0a);hopperUtils[_0x04a4('0xe3')]({'active':![],'ContactId':_0x2f361e[_0x04a4('0x27')][_0x2379c0][_0x04a4('0xe6')],'ListId':_0x2f361e[_0x04a4('0x27')][_0x2379c0][_0x04a4('0x106')],'VoiceQueueId':_0x2f361e[_0x04a4('0x27')][_0x2379c0][_0x04a4('0xe7')]||undefined,'CampaignId':_0x2f361e[_0x04a4('0x27')][_0x2379c0][_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x1e6')));delete _0x2f361e[_0x04a4('0x27')][_0x2379c0];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON['stringify'](_0x512c0a[_0x04a4('0x77')]),'Queue:\x20',_0x512c0a[_0x04a4('0x63')]);_0x2f361e[_0x04a4('0xc8')](_0x512c0a);hopperUtils[_0x04a4('0xe3')]({'active':![],'ContactId':_0x2f361e[_0x04a4('0x27')][_0x2379c0][_0x04a4('0xe6')],'ListId':_0x2f361e[_0x04a4('0x27')][_0x2379c0]['ListId'],'VoiceQueueId':_0x2f361e[_0x04a4('0x27')][_0x2379c0]['VoiceQueueId']||undefined,'CampaignId':_0x2f361e['actions'][_0x2379c0][_0x04a4('0xe8')]||undefined})['catch'](loggerCatch(_0x04a4('0x1e6')));delete _0x2f361e['actions'][_0x2379c0];}}else{return _0x2f361e[_0x04a4('0x15a')](_0x512c0a,_0xe096b1);}}else{if(utils[_0x04a4('0x60')](undefined,_0xe096b1[_0x04a4('0x1e7')])<_0x512c0a['dialRecallMeTimeout']*0x3c){if(_0xe096b1[_0x04a4('0x1e8')]&&!_0xe096b1['Agent'][_0x04a4('0x1e9')]){_0x2f361e[_0x04a4('0x102')][_0x04a4('0x103')](_0xe096b1['id'])[_0x04a4('0x20')](function(){_0x2f361e['updateOriginated'](_0x512c0a);});}else{hopperUtils[_0x04a4('0x1ea')]({'active':![]},_0xe096b1['id'],0x1)[_0x04a4('0x20')](function(){_0x2f361e['updateOriginated'](_0x512c0a);});}}else{_0x512c0a[_0x04a4('0x1eb')]+=0x1;_0x2f361e[_0x04a4('0xc8')](_0x512c0a);if(_0x512c0a[_0x04a4('0x1ec')]){hopperUtils[_0x04a4('0xe3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xe096b1['ContactId'],'ListId':_0xe096b1[_0x04a4('0x106')],'VoiceQueueId':_0xe096b1[_0x04a4('0xe7')]||undefined,'CampaignId':_0xe096b1['CampaignId']||undefined})[_0x04a4('0xa9')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x04a4('0xd0')](createObjHistory(_0x512c0a,_0xe096b1,utils[_0x04a4('0x6c')][_0x04a4('0x1ed')],0x17,'RecallInQueue'))['catch'](loggerCatch(_0x04a4('0x1ee')));}else{_0x2f361e[_0x04a4('0x12e')](createObjHistory(_0x512c0a,_0xe096b1,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,_0x04a4('0x1ef')),'[Originate][HistoryRecallClose][historyCatch]',_0x04a4('0x1f0'));}}}}else{_0x512c0a[_0x04a4('0x1f1')]+=0x1;_0x2f361e['saveInDb'](createObjHistory(_0x512c0a,_0xe096b1,utils['CAMPAIGN_STATUS']['BLACKLIST'],0xd,_0x04a4('0x1f2')),_0x04a4('0x1f3'),'[Originate][MoveBlacklist]');throw _0x04a4('0x1f4');}};};Dialer[_0x04a4('0x1d')]['handleIvr']=function(_0x3d3b6a){var _0x5adacb=this;var _0x639b51=_0x3d3b6a['limitCalls']-_0x3d3b6a['originated'];emitCampaignSummary(_0x3d3b6a);if(_0x639b51>0x0&&_0x3d3b6a['temp']==0x0){if(_0x639b51>this[_0x04a4('0x25')]){_0x639b51=this[_0x04a4('0x25')];}_0x3d3b6a['temp']=0x1;hopperUtils['getContactDialerIvr'](_0x3d3b6a,_0x639b51)[_0x04a4('0x41')](function(_0x129a59){_0x3d3b6a[_0x04a4('0x6a')]=0x0;if(_0x129a59){if(!utils[_0x04a4('0x1f5')](_0x129a59)){_0x3d3b6a[_0x04a4('0x70')]=utils[_0x04a4('0x6c')][_0x04a4('0x71')];logger[_0x04a4('0x4c')](_0x04a4('0x1f6')+_0x3d3b6a[_0x04a4('0x63')]);}else{_0x3d3b6a['originated']+=_0x129a59['length'];_0x3d3b6a[_0x04a4('0x70')]=utils[_0x04a4('0x6c')]['RUNNING'];for(var _0x25d994=0x0;_0x25d994<_0x129a59[_0x04a4('0xa1')];_0x25d994+=0x1){_0x3d3b6a[_0x04a4('0x1f7')]+=0x1;if(_['isNil'](_0x129a59[_0x25d994])||_['isNil'](_0x129a59[_0x25d994][_0x04a4('0x173')])||_[_0x04a4('0xfd')](_0x129a59[_0x25d994][_0x04a4('0x15c')])){_0x5adacb[_0x04a4('0x152')]('[actionOriginate]\x20',_0x3d3b6a,_0x129a59[_0x25d994]);}else{hopperUtils[_0x04a4('0x1f8')](_[_0x04a4('0x7b')](_0x129a59[_0x25d994],[_0x04a4('0xe8'),_0x04a4('0x15c')]))[_0x04a4('0x41')](_0x5adacb[_0x04a4('0x1e0')](_0x3d3b6a,_0x129a59[_0x25d994]))[_0x04a4('0xa9')](_0x5adacb[_0x04a4('0x151')](_0x04a4('0x1f9'),_0x3d3b6a));}}}}})[_0x04a4('0xa9')](loggerGetContactDialer('[getContactCampaign2]',_0x3d3b6a,_0x639b51));}};Dialer[_0x04a4('0x1d')]['handlePower']=function(_0x16ed77,_0x2267f2){var _0x142456=this;var _0x461c18=[];if(_0x2267f2<0x1||_0x16ed77[_0x04a4('0xb8')]===_0x04a4('0xa')){_0x2267f2=0x1;}var _0x5afed9=Math[_0x04a4('0x1ba')](_0x16ed77[_0x04a4('0x1b9')]*_0x2267f2)-_0x16ed77[_0x04a4('0x14e')];if(_0x16ed77['dialLimitQueue']>0x0){var _0x2b0909=_0x16ed77['dialLimitQueue']-_0x16ed77[_0x04a4('0x14e')]-_0x16ed77[_0x04a4('0x13d')]-_0x16ed77[_0x04a4('0x1fa')];if(_0x5afed9>_0x2b0909){_0x5afed9=_0x2b0909;}}if(_0x5afed9>0x0&&_0x16ed77['temp']==0x0){if(_0x16ed77[_0x04a4('0xb8')]===_0x04a4('0xa')){_0x5afed9=0x1;}if(_0x5afed9>this[_0x04a4('0x25')]){_0x5afed9=this['maxNumberOriginate'];}for(var _0x555ad0 in this[_0x04a4('0x23')]){if(typeof this[_0x04a4('0x23')][_0x555ad0]!==_0x04a4('0xb0')){if(this[_0x04a4('0x23')][_0x555ad0]['state']===_0x04a4('0x1fb')&&this[_0x04a4('0x23')][_0x555ad0][_0x04a4('0x90')]==='reachable'){_0x461c18[_0x04a4('0xa2')](this[_0x04a4('0x23')][_0x555ad0]['id']);}}}_0x16ed77[_0x04a4('0x6a')]=0x1;hopperUtils[_0x04a4('0x1fc')](_0x16ed77,_0x461c18,_0x5afed9)['then'](function(_0x1487ff){_0x16ed77[_0x04a4('0x6a')]=0x0;if(_0x1487ff){if(!utils[_0x04a4('0x1f5')](_0x1487ff)){hopperUtils[_0x04a4('0x1fd')](_0x16ed77)['then'](sendMessageReschedule(_0x16ed77))[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x1fe')));}else{_0x16ed77['originated']+=_0x1487ff[_0x04a4('0xa1')];_0x16ed77['message']=_0x16ed77[_0x04a4('0xb8')]===_0x04a4('0xa')?utils['CAMPAIGN_STATUS'][_0x04a4('0x13e')]:utils[_0x04a4('0x6c')]['RUNNING'];for(var _0x156fa2=0x0;_0x156fa2<_0x1487ff[_0x04a4('0xa1')];_0x156fa2+=0x1){if(_['isNil'](_0x1487ff[_0x156fa2])||_[_0x04a4('0xfd')](_0x1487ff[_0x156fa2][_0x04a4('0x173')])||_[_0x04a4('0xfd')](_0x1487ff[_0x156fa2][_0x04a4('0x15c')])){_0x142456['emptyContact']('[actionOriginate]\x20',_0x16ed77,_0x1487ff[_0x156fa2]);}else{hopperUtils['checkIsBlackList'](_[_0x04a4('0x7b')](_0x1487ff[_0x156fa2],[_0x04a4('0xe7'),_0x04a4('0x15c')]))[_0x04a4('0x41')](_0x142456['checkContactBlack'](_0x16ed77,_0x1487ff[_0x156fa2]))[_0x04a4('0xa9')](_0x142456[_0x04a4('0x151')](_0x04a4('0x1ff'),_0x16ed77));}}}}})[_0x04a4('0xa9')](loggerGetContactDialer(_0x04a4('0x200'),_0x16ed77,_0x5afed9));}};Dialer[_0x04a4('0x1d')][_0x04a4('0x65')]=function(_0x491161){if(_0x491161[_0x04a4('0x201')]>0x0){var _0x2498c3=_0x491161[_0x04a4('0x201')]-_0x491161[_0x04a4('0x14e')]-_0x491161[_0x04a4('0x13d')];if(_0x2498c3>0x0&&_0x491161[_0x04a4('0x6a')]==0x0){this[_0x04a4('0x202')](_0x491161);}else{loggerPredictiveCalls[_0x04a4('0x4c')](_0x04a4('0x203'));}}else{this[_0x04a4('0x202')](_0x491161);}};Dialer[_0x04a4('0x1d')][_0x04a4('0x202')]=function(_0x475e58){var _0x57d5a4=this;var _0x1cd23a=[];_0x475e58['originated']+=0x1;for(var _0x4e8958 in this[_0x04a4('0x23')]){if(typeof this[_0x04a4('0x23')][_0x4e8958]!=='undefined'){if(this[_0x04a4('0x23')][_0x4e8958][_0x04a4('0x73')]===_0x04a4('0x1fb')&&this['agents'][_0x4e8958][_0x04a4('0x90')]==='reachable'){_0x1cd23a[_0x04a4('0xa2')](this['agents'][_0x4e8958]['id']);}}}_0x475e58[_0x04a4('0x6a')]=0x1;return this[_0x04a4('0x1fc')](_0x475e58['id'],_0x1cd23a,0x1,_0x475e58[_0x04a4('0x204')],_0x475e58)[_0x04a4('0x41')](function(_0x4c09fa){_0x475e58[_0x04a4('0x6a')]=0x1;if(_0x4c09fa){if(!utils[_0x04a4('0x1f5')](_0x4c09fa)){utils[_0x04a4('0x69')](_0x475e58,0x1,0x0);return hopperUtils[_0x04a4('0x1fd')](_0x475e58)[_0x04a4('0x41')](sendMessageReschedule(_0x475e58))[_0x04a4('0xa9')](loggerCatch('[countReScheduled]\x20'));}else{_0x475e58['message']=utils[_0x04a4('0x6c')][_0x04a4('0x205')];if(_['isNil'](_0x4c09fa[0x0])||_[_0x04a4('0xfd')](_0x4c09fa[0x0][_0x04a4('0x173')])||_['isNil'](_0x4c09fa[0x0][_0x04a4('0x15c')])){_0x57d5a4[_0x04a4('0x152')]('[actionOriginate]\x20',_0x475e58,_0x4c09fa[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x04a4('0x7b')](_0x4c09fa[0x0],[_0x04a4('0xe7'),_0x04a4('0x15c')]))['then'](_0x57d5a4[_0x04a4('0x1e0')](_0x475e58,_0x4c09fa[0x0]))[_0x04a4('0xa9')](_0x57d5a4[_0x04a4('0x151')](_0x04a4('0x206'),_0x475e58));}}}})['catch'](loggerGetContactDialer(_0x04a4('0x207'),_0x475e58,0x1));};Dialer[_0x04a4('0x1d')][_0x04a4('0x1d3')]=function(_0x7cf8,_0x203ec2,_0x5be7b6,_0x418ed4,_0x3593fd,_0x381d0b){loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x208'));loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x209'),_0x7cf8);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x20a'),_0x203ec2);loggerPredictive['info'](_0x04a4('0x20b'),_0x5be7b6);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',_0x418ed4);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x20c'),_0x3593fd);loggerPredictive['info'](_0x04a4('0x5e'));return new Promise(function(_0x4d1164,_0x307d81){if(_0x7cf8<=0x0||isNaN(_0x7cf8)){return _0x307d81(msgResponse('[abandonmentRate]','Error',_0x04a4('0x20d')+_0x7cf8));}if(_0x5be7b6<=0x0||isNaN(_0x5be7b6)){return _0x307d81(msgResponse(_0x04a4('0x20e'),_0x04a4('0x8d'),_0x04a4('0x20f')+_0x5be7b6));}if(_0x418ed4<=0x0||isNaN(_0x418ed4)){return _0x307d81(msgResponse(_0x04a4('0x20e'),_0x04a4('0x8d'),_0x04a4('0x210')+_0x418ed4));}if(_0x203ec2<=0x0||isNaN(_0x203ec2)){return _0x307d81(msgResponse(_0x04a4('0x20e'),_0x04a4('0x8d'),_0x04a4('0x211')+_0x203ec2));}if(_0x3593fd<=0x0||isNaN(_0x3593fd)){return _0x307d81(msgResponse(_0x04a4('0x20e'),_0x04a4('0x8d'),_0x04a4('0x212')+_0x3593fd));}_0x381d0b=_0x381d0b||0x0;var _0x1dcebf=0x1/_0x5be7b6;var _0x28476c=0x0;var _0x5d037a=0x0;var _0x31e00f=0x0;var _0x1fdba0=0x0;for(var _0xed208d=0x0;_0x31e00f<_0x3593fd;_0xed208d+=0x1){_0x5d037a=_0xed208d/_0x203ec2;_0x28476c=(_0x418ed4*_0x5d037a+_0x381d0b)/_0x1dcebf;_0x31e00f=utils[_0x04a4('0x213')](_0x28476c,_0x7cf8);_0x1fdba0=_0x28476c/_0x7cf8*(0x1-utils[_0x04a4('0x213')](_0x28476c,_0x7cf8));}return _0x4d1164({'erlangCalls':_0xed208d,'erlangCallToSecond':_0x203ec2/_0xed208d,'erlangAbandonmentRate':_0x31e00f,'erlangBusyFactor':_0x1fdba0});});};Dialer[_0x04a4('0x1d')][_0x04a4('0x1dc')]=function(_0x133190,_0x56ac79,_0x5c963c,_0x3f3b07,_0x9553dd,_0x38f552){loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x214'));loggerPredictive[_0x04a4('0x4c')]('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',_0x133190);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x20a'),_0x56ac79);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x20b'),_0x5c963c);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x215'),_0x3f3b07);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x216'),_0x9553dd);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x5e'));return new Promise(function(_0x5613d6,_0x35c695){if(_0x133190<=0x0||isNaN(_0x133190)){return _0x35c695(msgResponse(_0x04a4('0x217'),_0x04a4('0x8d'),_0x04a4('0x20d')+_0x133190));}if(_0x5c963c<=0x0||isNaN(_0x5c963c)){return _0x35c695(msgResponse(_0x04a4('0x217'),'Error',_0x04a4('0x20f')+_0x5c963c));}if(_0x3f3b07<=0x0||isNaN(_0x3f3b07)){return _0x35c695(msgResponse(_0x04a4('0x217'),'Error','p\x20=\x20'+_0x3f3b07));}if(_0x56ac79<=0x0||isNaN(_0x56ac79)){return _0x35c695(msgResponse('[busyFactor]','Error',_0x04a4('0x211')+_0x56ac79));}if(_0x9553dd<=0x0||isNaN(_0x9553dd)){return _0x35c695(msgResponse(_0x04a4('0x217'),_0x04a4('0x8d'),'Umin\x20=\x20'+_0x9553dd));}_0x38f552=_0x38f552||0x0;var _0x5c35c6=0x1/_0x5c963c;var _0x24a4aa=0x0;var _0x3436b1=0x0;var _0x5637ec=0x0;var _0x4633d6=0x0;for(var _0x3358f1=0x0;_0x4633d6<_0x9553dd;_0x3358f1+=0x1){_0x3436b1=_0x3358f1/_0x56ac79;_0x24a4aa=(_0x3f3b07*_0x3436b1+_0x38f552)/_0x5c35c6;_0x5637ec=utils[_0x04a4('0x213')](_0x24a4aa,_0x133190);_0x4633d6=_0x24a4aa/_0x133190*(0x1-utils[_0x04a4('0x213')](_0x24a4aa,_0x133190));}return _0x5613d6({'erlangCalls':_0x3358f1,'erlangCallToSecond':_0x56ac79/_0x3358f1,'erlangAbandonmentRate':_0x5637ec,'erlangBusyFactor':_0x4633d6});});};module[_0x04a4('0x218')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index bad8555..8a2099d 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8d7=['idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','lodash','isNil','string','voiceQueue','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x5d05c6,_0x482c6e){var _0x52403a=function(_0x256a97){while(--_0x256a97){_0x5d05c6['push'](_0x5d05c6['shift']());}};_0x52403a(++_0x482c6e);}(_0xe8d7,0x1dc));var _0x7e8d=function(_0x3bc4c9,_0x4d7cfe){_0x3bc4c9=_0x3bc4c9-0x0;var _0x29cdea=_0xe8d7[_0x3bc4c9];return _0x29cdea;};'use strict';var util=require(_0x7e8d('0x0'));var _=require(_0x7e8d('0x1'));var moment=require('moment');function checkNameSurname(_0x330879,_0xfce4d1,_0x53b955){var _0x3a316c='';if(!_[_0x7e8d('0x2')](_0xfce4d1)&&'string'===typeof _0xfce4d1){_0x3a316c+=_0xfce4d1;}if(!_[_0x7e8d('0x2')](_0x53b955)&&_0x7e8d('0x3')===typeof _0x53b955){_0x3a316c+='\x20'+_0x53b955;}if(_0x3a316c!==''){return _0x3a316c;}return _0x330879;}function Action(_0x475648,_0x11422e,_0x1efacf){this[_0x7e8d('0x4')]=_0x475648;this['uniqueid']=_0x1efacf||undefined;this[_0x7e8d('0x5')]=checkNameSurname(_0x11422e[_0x7e8d('0x6')][_0x7e8d('0x7')],_0x11422e[_0x7e8d('0x6')][_0x7e8d('0x8')],_0x11422e['Contact'][_0x7e8d('0x9')]);this[_0x7e8d('0xa')]=_0x11422e['phone'];this[_0x7e8d('0xb')]=_0x475648[_0x7e8d('0x5')];this[_0x7e8d('0xc')]=_0x11422e['active']||![];this['type']=_0x475648[_0x7e8d('0xd')];this['dialQueueTimeout']=_0x475648[_0x7e8d('0xe')]||0x3;this[_0x7e8d('0xf')]=_0x11422e[_0x7e8d('0xf')];this[_0x7e8d('0x10')]=_0x11422e[_0x7e8d('0x10')];this[_0x7e8d('0x11')]=_0x11422e[_0x7e8d('0x11')];this[_0x7e8d('0x12')]=_0x11422e[_0x7e8d('0x12')];this[_0x7e8d('0x13')]=_0x11422e[_0x7e8d('0x13')];this[_0x7e8d('0x14')]=_0x11422e[_0x7e8d('0x14')];this[_0x7e8d('0x15')]=_0x11422e[_0x7e8d('0x15')];this[_0x7e8d('0x16')]=_0x11422e[_0x7e8d('0x16')];this[_0x7e8d('0x17')]=_0x11422e[_0x7e8d('0x17')];this['ContactId']=_0x11422e['ContactId'];this[_0x7e8d('0x18')]=_0x11422e[_0x7e8d('0x18')];this['UserId']=_0x11422e[_0x7e8d('0x19')];this['VoiceQueueId']=_0x11422e[_0x7e8d('0x1a')];this[_0x7e8d('0x1b')]=_0x11422e[_0x7e8d('0x1b')];this[_0x7e8d('0x1c')]=_0x11422e['id'];this[_0x7e8d('0x1d')]=_0x11422e[_0x7e8d('0x6')]['firstName']||'';this[_0x7e8d('0x1e')]=moment()[_0x7e8d('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x11422e[_0x7e8d('0x20')];this[_0x7e8d('0x21')]=_0x11422e[_0x7e8d('0x21')];this[_0x7e8d('0x22')]=_0x11422e[_0x7e8d('0x22')];this['recallme']=_0x11422e['recallme'];this[_0x7e8d('0x23')]='';this[_0x7e8d('0x24')]='';}Action['prototype'][_0x7e8d('0x25')]=function(){return util['format'](_0x7e8d('0x26'),this['name'],this[_0x7e8d('0x4')][_0x7e8d('0x27')]>0x0?this['number']['substring'](this[_0x7e8d('0x4')]['dialCutDigit']):this[_0x7e8d('0xa')]);};Action['prototype'][_0x7e8d('0x28')]=function(){return this['queue'];};module[_0x7e8d('0x29')]=Action; \ No newline at end of file +var _0x1146=['isNil','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','format','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','exports','util','lodash','moment','string'];(function(_0x3c1cc0,_0x286ab8){var _0x136153=function(_0x3c5adb){while(--_0x3c5adb){_0x3c1cc0['push'](_0x3c1cc0['shift']());}};_0x136153(++_0x286ab8);}(_0x1146,0xb4));var _0x6114=function(_0xc47837,_0x4c8a63){_0xc47837=_0xc47837-0x0;var _0x376bb7=_0x1146[_0xc47837];return _0x376bb7;};'use strict';var util=require(_0x6114('0x0'));var _=require(_0x6114('0x1'));var moment=require(_0x6114('0x2'));function checkNameSurname(_0x20a0c1,_0x3ccb7e,_0x365518){var _0x4ddc4e='';if(!_['isNil'](_0x3ccb7e)&&_0x6114('0x3')===typeof _0x3ccb7e){_0x4ddc4e+=_0x3ccb7e;}if(!_[_0x6114('0x4')](_0x365518)&&_0x6114('0x3')===typeof _0x365518){_0x4ddc4e+='\x20'+_0x365518;}if(_0x4ddc4e!==''){return _0x4ddc4e;}return _0x20a0c1;}function Action(_0x57b843,_0x4b365b,_0x31fd32){this[_0x6114('0x5')]=_0x57b843;this[_0x6114('0x6')]=_0x31fd32||undefined;this[_0x6114('0x7')]=checkNameSurname(_0x4b365b['Contact'][_0x6114('0x8')],_0x4b365b[_0x6114('0x9')][_0x6114('0xa')],_0x4b365b[_0x6114('0x9')][_0x6114('0xb')]);this[_0x6114('0xc')]=_0x4b365b[_0x6114('0x8')];this[_0x6114('0xd')]=_0x57b843['name'];this[_0x6114('0xe')]=_0x4b365b[_0x6114('0xe')]||![];this[_0x6114('0xf')]=_0x57b843[_0x6114('0xf')];this[_0x6114('0x10')]=_0x57b843[_0x6114('0x10')]||0x3;this[_0x6114('0x11')]=_0x4b365b[_0x6114('0x11')];this[_0x6114('0x12')]=_0x4b365b[_0x6114('0x12')];this[_0x6114('0x13')]=_0x4b365b[_0x6114('0x13')];this[_0x6114('0x14')]=_0x4b365b[_0x6114('0x14')];this[_0x6114('0x15')]=_0x4b365b[_0x6114('0x15')];this['countdropretry']=_0x4b365b[_0x6114('0x16')];this[_0x6114('0x17')]=_0x4b365b[_0x6114('0x17')];this[_0x6114('0x18')]=_0x4b365b['countmachineretry'];this[_0x6114('0x19')]=_0x4b365b['countagentrejectretry'];this[_0x6114('0x1a')]=_0x4b365b[_0x6114('0x1a')];this[_0x6114('0x1b')]=_0x4b365b[_0x6114('0x1b')];this[_0x6114('0x1c')]=_0x4b365b[_0x6114('0x1c')];this['VoiceQueueId']=_0x4b365b[_0x6114('0x1d')];this[_0x6114('0x1e')]=_0x4b365b[_0x6114('0x1e')];this[_0x6114('0x1f')]=_0x4b365b['id'];this['ContactFirstName']=_0x4b365b[_0x6114('0x9')][_0x6114('0xa')]||'';this[_0x6114('0x20')]=moment()['format'](_0x6114('0x21'));this[_0x6114('0x22')]=_0x4b365b[_0x6114('0x22')];this[_0x6114('0x23')]=_0x4b365b['callbackuniqueid'];this[_0x6114('0x24')]=_0x4b365b[_0x6114('0x24')];this[_0x6114('0x25')]=_0x4b365b[_0x6114('0x25')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x6114('0x26')][_0x6114('0x27')]=function(){return util[_0x6114('0x28')](_0x6114('0x29'),this[_0x6114('0x7')],this[_0x6114('0x5')]['dialCutDigit']>0x0?this[_0x6114('0xc')][_0x6114('0x2a')](this['voiceQueue'][_0x6114('0x2b')]):this['number']);};Action[_0x6114('0x26')][_0x6114('0x2c')]=function(){return this[_0x6114('0xd')];};module[_0x6114('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index a988f87..244aea6 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabc7=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','getSeconds','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','state','Answer','scheduledat','type','campaigntype','outbound'];(function(_0x31f2a0,_0x43dc59){var _0x593ed1=function(_0x5d3147){while(--_0x5d3147){_0x31f2a0['push'](_0x31f2a0['shift']());}};_0x593ed1(++_0x43dc59);}(_0xabc7,0x80));var _0x7abc=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xabc7[_0xae7c2f];return _0x5d7001;};'use strict';var moment=require(_0x7abc('0x0'));var utils=require('../utils');function AgentComplete(_0x5bf476,_0x10b255){this[_0x7abc('0x1')]=0x4;this['statedesc']=_0x7abc('0x2');this[_0x7abc('0x3')]=_0x5bf476[_0x7abc('0x3')];this[_0x7abc('0x4')]=_0x5bf476['type'];this[_0x7abc('0x5')]=_0x5bf476['type']===_0x7abc('0x6')?_0x7abc('0x7'):_0x5bf476[_0x7abc('0x4')];this['countbusyretry']=_0x5bf476[_0x7abc('0x8')];this[_0x7abc('0x9')]=_0x5bf476[_0x7abc('0x9')];this[_0x7abc('0xa')]=_0x5bf476[_0x7abc('0xa')];this[_0x7abc('0xb')]=_0x5bf476['countbusyretry']+_0x5bf476[_0x7abc('0x9')]+_0x5bf476['countnoanswerretry']+_0x5bf476[_0x7abc('0xc')]+_0x5bf476['countdropretry']+_0x5bf476[_0x7abc('0xd')]+_0x5bf476['countmachineretry']+_0x5bf476['countagentrejectretry'];this['countnosuchnumberretry']=_0x5bf476['countnosuchnumberretry'];this[_0x7abc('0xe')]=_0x5bf476['countdropretry'];this[_0x7abc('0xd')]=_0x5bf476[_0x7abc('0xd')];this[_0x7abc('0xf')]=_0x5bf476[_0x7abc('0xf')];this[_0x7abc('0x10')]=_0x5bf476[_0x7abc('0x10')];this[_0x7abc('0x11')]=_0x10b255[_0x7abc('0x11')];this[_0x7abc('0x12')]=_0x5bf476[_0x7abc('0x13')];this['calleridnum']=_0x5bf476[_0x7abc('0x14')];this['starttime']=_0x5bf476[_0x7abc('0x15')];this[_0x7abc('0x16')]=_0x5bf476[_0x7abc('0x16')];this[_0x7abc('0x17')]=_0x5bf476[_0x7abc('0x17')];this[_0x7abc('0x18')]=moment()[_0x7abc('0x19')](_0x7abc('0x1a'));this[_0x7abc('0x1b')]=utils['getSeconds'](_0x5bf476[_0x7abc('0x16')],_0x5bf476[_0x7abc('0x15')]);this[_0x7abc('0x1c')]=utils['getSeconds'](_0x5bf476['answertime'],_0x5bf476[_0x7abc('0x16')]);this[_0x7abc('0x1d')]=utils[_0x7abc('0x1e')](this[_0x7abc('0x18')],_0x5bf476[_0x7abc('0x17')]);this[_0x7abc('0x7')]=_0x10b255[_0x7abc('0x7')];this[_0x7abc('0x1f')]=_0x10b255['membername'];this[_0x7abc('0x20')]=_0x10b255['reason'];this[_0x7abc('0x21')]=_0x5bf476[_0x7abc('0x21')];this[_0x7abc('0x22')]=_0x5bf476[_0x7abc('0x22')];this['callbackat']=_0x5bf476[_0x7abc('0x23')];this[_0x7abc('0x24')]=_0x5bf476[_0x7abc('0x24')];this[_0x7abc('0x25')]=_0x5bf476['ContactId'];this['ListId']=_0x5bf476[_0x7abc('0x26')];this[_0x7abc('0x27')]=_0x5bf476[_0x7abc('0x27')];this[_0x7abc('0x28')]=_0x5bf476['VoiceQueueId'];this['CampaignId']=_0x5bf476['CampaignId'];this['originatecalleridnum']=_0x5bf476[_0x7abc('0x29')]||'';this[_0x7abc('0x2a')]=_0x5bf476[_0x7abc('0x2a')]||'';this[_0x7abc('0x2b')]=_0x5bf476[_0x7abc('0x2b')];}module[_0x7abc('0x2c')]=AgentComplete; \ No newline at end of file +var _0x2f15=['name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','answertime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','uniqueid','calleridname'];(function(_0x203d64,_0x1ec79c){var _0x462ab3=function(_0x55ee6e){while(--_0x55ee6e){_0x203d64['push'](_0x203d64['shift']());}};_0x462ab3(++_0x1ec79c);}(_0x2f15,0x97));var _0x52f1=function(_0x29dedd,_0x3c7419){_0x29dedd=_0x29dedd-0x0;var _0x4e6d4f=_0x2f15[_0x29dedd];return _0x4e6d4f;};'use strict';var moment=require(_0x52f1('0x0'));var utils=require(_0x52f1('0x1'));function AgentComplete(_0x3a7268,_0x2aeba5){this[_0x52f1('0x2')]=0x4;this['statedesc']=_0x52f1('0x3');this[_0x52f1('0x4')]=_0x3a7268[_0x52f1('0x4')];this[_0x52f1('0x5')]=_0x3a7268[_0x52f1('0x5')];this['campaigntype']=_0x3a7268[_0x52f1('0x5')]===_0x52f1('0x6')?_0x52f1('0x7'):_0x3a7268['type'];this[_0x52f1('0x8')]=_0x3a7268[_0x52f1('0x8')];this[_0x52f1('0x9')]=_0x3a7268[_0x52f1('0x9')];this[_0x52f1('0xa')]=_0x3a7268[_0x52f1('0xa')];this['countglobal']=_0x3a7268[_0x52f1('0x8')]+_0x3a7268[_0x52f1('0x9')]+_0x3a7268[_0x52f1('0xa')]+_0x3a7268[_0x52f1('0xb')]+_0x3a7268[_0x52f1('0xc')]+_0x3a7268[_0x52f1('0xd')]+_0x3a7268['countmachineretry']+_0x3a7268['countagentrejectretry'];this[_0x52f1('0xb')]=_0x3a7268[_0x52f1('0xb')];this[_0x52f1('0xc')]=_0x3a7268[_0x52f1('0xc')];this[_0x52f1('0xd')]=_0x3a7268['countabandonedretry'];this[_0x52f1('0xe')]=_0x3a7268[_0x52f1('0xe')];this['countagentrejectretry']=_0x3a7268['countagentrejectretry'];this[_0x52f1('0xf')]=_0x2aeba5[_0x52f1('0xf')];this[_0x52f1('0x10')]=_0x3a7268[_0x52f1('0x11')];this[_0x52f1('0x12')]=_0x3a7268[_0x52f1('0x13')];this[_0x52f1('0x14')]=_0x3a7268['starttime'];this[_0x52f1('0x15')]=_0x3a7268[_0x52f1('0x15')];this['answertime']=_0x3a7268['answertime'];this[_0x52f1('0x16')]=moment()['format'](_0x52f1('0x17'));this['ringtime']=utils[_0x52f1('0x18')](_0x3a7268[_0x52f1('0x15')],_0x3a7268[_0x52f1('0x14')]);this[_0x52f1('0x19')]=utils[_0x52f1('0x18')](_0x3a7268[_0x52f1('0x1a')],_0x3a7268[_0x52f1('0x15')]);this[_0x52f1('0x1b')]=utils[_0x52f1('0x18')](this[_0x52f1('0x16')],_0x3a7268[_0x52f1('0x1a')]);this[_0x52f1('0x7')]=_0x2aeba5[_0x52f1('0x7')];this[_0x52f1('0x1c')]=_0x2aeba5['membername'];this['reason']=_0x2aeba5['reason'];this[_0x52f1('0x1d')]=_0x3a7268[_0x52f1('0x1d')];this[_0x52f1('0x1e')]=_0x3a7268[_0x52f1('0x1e')];this[_0x52f1('0x1f')]=_0x3a7268[_0x52f1('0x1f')];this[_0x52f1('0x20')]=_0x3a7268[_0x52f1('0x20')];this[_0x52f1('0x21')]=_0x3a7268[_0x52f1('0x21')];this['ListId']=_0x3a7268[_0x52f1('0x22')];this[_0x52f1('0x23')]=_0x3a7268[_0x52f1('0x23')];this['VoiceQueueId']=_0x3a7268[_0x52f1('0x24')];this[_0x52f1('0x25')]=_0x3a7268[_0x52f1('0x25')];this[_0x52f1('0x26')]=_0x3a7268[_0x52f1('0x26')]||'';this[_0x52f1('0x27')]=_0x3a7268[_0x52f1('0x27')]||'';this[_0x52f1('0x28')]=_0x3a7268[_0x52f1('0x28')];}module[_0x52f1('0x29')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index e5e8d58..e1b936a 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58ed=['countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','statedesc','exports','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x4b5667,_0x22f053){var _0xf737f5=function(_0x4fde0d){while(--_0x4fde0d){_0x4b5667['push'](_0x4b5667['shift']());}};_0xf737f5(++_0x22f053);}(_0x58ed,0x11c));var _0xd58e=function(_0xb5f367,_0x5bf716){_0xb5f367=_0xb5f367-0x0;var _0x8c031a=_0x58ed[_0xb5f367];return _0x8c031a;};'use strict';function Final(_0x3c6846){this[_0xd58e('0x0')]=_0x3c6846[_0xd58e('0x0')];this[_0xd58e('0x1')]=_0x3c6846[_0xd58e('0x1')];this[_0xd58e('0x2')]=_0x3c6846[_0xd58e('0x2')];this[_0xd58e('0x3')]=_0x3c6846[_0xd58e('0x2')]==='outbound'?_0xd58e('0x4'):_0x3c6846['type'];this['countbusyretry']=_0x3c6846[_0xd58e('0x5')];this[_0xd58e('0x6')]=_0x3c6846[_0xd58e('0x6')];this[_0xd58e('0x7')]=_0x3c6846[_0xd58e('0x7')];this[_0xd58e('0x8')]=_0x3c6846[_0xd58e('0x5')]+_0x3c6846[_0xd58e('0x6')]+_0x3c6846['countnoanswerretry']+_0x3c6846[_0xd58e('0x9')]+_0x3c6846[_0xd58e('0xa')]+_0x3c6846[_0xd58e('0xb')]+_0x3c6846[_0xd58e('0xc')]+_0x3c6846['countagentrejectretry'];this['countnosuchnumberretry']=_0x3c6846['countnosuchnumberretry'];this[_0xd58e('0xa')]=_0x3c6846[_0xd58e('0xa')];this[_0xd58e('0xb')]=_0x3c6846['countabandonedretry'];this[_0xd58e('0xc')]=_0x3c6846[_0xd58e('0xc')];this[_0xd58e('0xd')]=_0x3c6846['countagentrejectretry'];this[_0xd58e('0x4')]=_0x3c6846['queue'];this[_0xd58e('0xe')]=_0x3c6846['calleridname'];this[_0xd58e('0xf')]=_0x3c6846[_0xd58e('0xf')];this[_0xd58e('0x10')]=_0x3c6846[_0xd58e('0x10')];this[_0xd58e('0x11')]=_0x3c6846['responsetime'];this[_0xd58e('0x12')]=_0x3c6846[_0xd58e('0x11')];this[_0xd58e('0x13')]=_0x3c6846[_0xd58e('0x13')]||0x0;this[_0xd58e('0x14')]=_0x3c6846[_0xd58e('0x14')]||0x0;this[_0xd58e('0x15')]=_0x3c6846[_0xd58e('0x15')]||0x0;this[_0xd58e('0x16')]=_0x3c6846[_0xd58e('0x16')];this[_0xd58e('0x17')]=_0x3c6846[_0xd58e('0x17')];this[_0xd58e('0x18')]=_0x3c6846['callbackat'];this['recallme']=_0x3c6846['recallme'];this['ContactId']=_0x3c6846[_0xd58e('0x19')];this[_0xd58e('0x1a')]=_0x3c6846[_0xd58e('0x1a')];this['UserId']=_0x3c6846['UserId'];this[_0xd58e('0x1b')]=_0x3c6846[_0xd58e('0x1b')];this['CampaignId']=_0x3c6846[_0xd58e('0x1c')];this['originatecalleridnum']=_0x3c6846[_0xd58e('0x1d')]||'';this[_0xd58e('0x1e')]=_0x3c6846[_0xd58e('0x1e')]||'';this['state']=_0x3c6846['state'];this[_0xd58e('0x1f')]=_0x3c6846[_0xd58e('0x1f')];}module[_0xd58e('0x20')]=Final; \ No newline at end of file +var _0x3150=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime'];(function(_0x7b544a,_0x33c45a){var _0x33dcb4=function(_0x5ebc7f){while(--_0x5ebc7f){_0x7b544a['push'](_0x7b544a['shift']());}};_0x33dcb4(++_0x33c45a);}(_0x3150,0x75));var _0x0315=function(_0x43e11f,_0x196da0){_0x43e11f=_0x43e11f-0x0;var _0x3c9208=_0x3150[_0x43e11f];return _0x3c9208;};'use strict';function Final(_0x4a111e){this[_0x0315('0x0')]=_0x4a111e[_0x0315('0x0')];this[_0x0315('0x1')]=_0x4a111e[_0x0315('0x1')];this[_0x0315('0x2')]=_0x4a111e['type'];this[_0x0315('0x3')]=_0x4a111e[_0x0315('0x2')]==='outbound'?_0x0315('0x4'):_0x4a111e[_0x0315('0x2')];this['countbusyretry']=_0x4a111e['countbusyretry'];this['countcongestionretry']=_0x4a111e[_0x0315('0x5')];this['countnoanswerretry']=_0x4a111e[_0x0315('0x6')];this[_0x0315('0x7')]=_0x4a111e[_0x0315('0x8')]+_0x4a111e[_0x0315('0x5')]+_0x4a111e[_0x0315('0x6')]+_0x4a111e['countnosuchnumberretry']+_0x4a111e[_0x0315('0x9')]+_0x4a111e[_0x0315('0xa')]+_0x4a111e['countmachineretry']+_0x4a111e[_0x0315('0xb')];this['countnosuchnumberretry']=_0x4a111e['countnosuchnumberretry'];this['countdropretry']=_0x4a111e['countdropretry'];this[_0x0315('0xa')]=_0x4a111e[_0x0315('0xa')];this[_0x0315('0xc')]=_0x4a111e['countmachineretry'];this[_0x0315('0xb')]=_0x4a111e[_0x0315('0xb')];this['queue']=_0x4a111e['queue'];this['calleridname']=_0x4a111e[_0x0315('0xd')];this[_0x0315('0xe')]=_0x4a111e[_0x0315('0xe')];this['starttime']=_0x4a111e['starttime'];this[_0x0315('0xf')]=_0x4a111e[_0x0315('0xf')];this[_0x0315('0x10')]=_0x4a111e['responsetime'];this[_0x0315('0x11')]=_0x4a111e[_0x0315('0x11')]||0x0;this[_0x0315('0x12')]=_0x4a111e[_0x0315('0x12')]||0x0;this[_0x0315('0x13')]=_0x4a111e[_0x0315('0x13')]||0x0;this[_0x0315('0x14')]=_0x4a111e[_0x0315('0x14')];this[_0x0315('0x15')]=_0x4a111e[_0x0315('0x15')];this[_0x0315('0x16')]=_0x4a111e['callbackat'];this[_0x0315('0x17')]=_0x4a111e[_0x0315('0x17')];this[_0x0315('0x18')]=_0x4a111e[_0x0315('0x18')];this[_0x0315('0x19')]=_0x4a111e[_0x0315('0x19')];this[_0x0315('0x1a')]=_0x4a111e[_0x0315('0x1a')];this[_0x0315('0x1b')]=_0x4a111e[_0x0315('0x1b')];this[_0x0315('0x1c')]=_0x4a111e[_0x0315('0x1c')];this['originatecalleridnum']=_0x4a111e[_0x0315('0x1d')]||'';this[_0x0315('0x1e')]=_0x4a111e[_0x0315('0x1e')]||'';this[_0x0315('0x1f')]=_0x4a111e['state'];this[_0x0315('0x20')]=_0x4a111e[_0x0315('0x20')];}module[_0x0315('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 50c3e6a..ae945fa 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a13=['outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','talktime','endtime','queue','membername','IVR','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','exports','moment','../utils','state','Answer','scheduledat','type','campaigntype'];(function(_0x2dc39a,_0x4ed570){var _0x599bc1=function(_0x2bda94){while(--_0x2bda94){_0x2dc39a['push'](_0x2dc39a['shift']());}};_0x599bc1(++_0x4ed570);}(_0x0a13,0x161));var _0x30a1=function(_0x32e264,_0x41cee8){_0x32e264=_0x32e264-0x0;var _0x1d7175=_0x0a13[_0x32e264];return _0x1d7175;};'use strict';var moment=require(_0x30a1('0x0'));var utils=require(_0x30a1('0x1'));function Hangup(_0x20e9bf,_0x3fcfdf){this[_0x30a1('0x2')]=0x4;this['statedesc']=_0x30a1('0x3');this['scheduledat']=_0x20e9bf[_0x30a1('0x4')];this[_0x30a1('0x5')]=_0x20e9bf[_0x30a1('0x5')];this[_0x30a1('0x6')]=_0x20e9bf[_0x30a1('0x5')]===_0x30a1('0x7')?'queue':_0x20e9bf[_0x30a1('0x5')];this['amd']=_0x20e9bf[_0x30a1('0x8')]||![];this['countbusyretry']=_0x20e9bf[_0x30a1('0x9')];this[_0x30a1('0xa')]=_0x20e9bf[_0x30a1('0xa')];this['countnoanswerretry']=_0x20e9bf[_0x30a1('0xb')];this[_0x30a1('0xc')]=_0x20e9bf['countbusyretry']+_0x20e9bf[_0x30a1('0xa')]+_0x20e9bf[_0x30a1('0xb')]+_0x20e9bf[_0x30a1('0xd')]+_0x20e9bf['countdropretry']+_0x20e9bf[_0x30a1('0xe')]+_0x20e9bf['countmachineretry']+_0x20e9bf['countagentrejectretry'];this[_0x30a1('0xd')]=_0x20e9bf[_0x30a1('0xd')];this[_0x30a1('0xf')]=_0x20e9bf['countdropretry'];this['countabandonedretry']=_0x20e9bf[_0x30a1('0xe')];this[_0x30a1('0x10')]=_0x20e9bf[_0x30a1('0x10')];this[_0x30a1('0x11')]=_0x20e9bf['countagentrejectretry'];this[_0x30a1('0x12')]=_0x3fcfdf[_0x30a1('0x12')];this[_0x30a1('0x13')]=_0x20e9bf[_0x30a1('0x14')];this[_0x30a1('0x15')]=_0x20e9bf['number'];this['starttime']=_0x20e9bf[_0x30a1('0x16')];this['responsetime']=_0x20e9bf[_0x30a1('0x17')];this['endtime']=moment()[_0x30a1('0x18')](_0x30a1('0x19'));this['ringtime']=utils[_0x30a1('0x1a')](_0x20e9bf[_0x30a1('0x17')],_0x20e9bf[_0x30a1('0x16')]);this['holdtime']=0x0;this[_0x30a1('0x1b')]=utils[_0x30a1('0x1a')](this[_0x30a1('0x1c')],_0x20e9bf[_0x30a1('0x17')]);this[_0x30a1('0x1d')]=_0x20e9bf['queue'];this[_0x30a1('0x1e')]=_0x30a1('0x1f');this['reason']=_0x3fcfdf['cause-txt'];this[_0x30a1('0x20')]=_0x20e9bf[_0x30a1('0x20')];this['callbackuniqueid']=_0x20e9bf[_0x30a1('0x21')];this[_0x30a1('0x22')]=_0x20e9bf[_0x30a1('0x22')];this['recallme']=_0x20e9bf['recallme'];this[_0x30a1('0x23')]=_0x20e9bf[_0x30a1('0x23')];this[_0x30a1('0x24')]=_0x20e9bf[_0x30a1('0x24')];this[_0x30a1('0x25')]=_0x20e9bf[_0x30a1('0x25')];this[_0x30a1('0x26')]=_0x20e9bf[_0x30a1('0x26')];this['CampaignId']=_0x20e9bf['CampaignId'];}module[_0x30a1('0x27')]=Hangup; \ No newline at end of file +var _0x531f=['starttime','responsetime','endtime','format','ringtime','getSeconds','talktime','queue','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','../utils','state','type','campaigntype','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','number'];(function(_0xe7c4be,_0x124018){var _0x2ea623=function(_0x5977b2){while(--_0x5977b2){_0xe7c4be['push'](_0xe7c4be['shift']());}};_0x2ea623(++_0x124018);}(_0x531f,0xcd));var _0xf531=function(_0x372ee1,_0x45c637){_0x372ee1=_0x372ee1-0x0;var _0x31ea06=_0x531f[_0x372ee1];return _0x31ea06;};'use strict';var moment=require('moment');var utils=require(_0xf531('0x0'));function Hangup(_0x4f8352,_0x168712){this[_0xf531('0x1')]=0x4;this['statedesc']='Answer';this['scheduledat']=_0x4f8352['scheduledat'];this['type']=_0x4f8352[_0xf531('0x2')];this[_0xf531('0x3')]=_0x4f8352[_0xf531('0x2')]==='outbound'?'queue':_0x4f8352[_0xf531('0x2')];this[_0xf531('0x4')]=_0x4f8352['amd']||![];this[_0xf531('0x5')]=_0x4f8352[_0xf531('0x5')];this['countcongestionretry']=_0x4f8352[_0xf531('0x6')];this[_0xf531('0x7')]=_0x4f8352[_0xf531('0x7')];this[_0xf531('0x8')]=_0x4f8352['countbusyretry']+_0x4f8352[_0xf531('0x6')]+_0x4f8352[_0xf531('0x7')]+_0x4f8352[_0xf531('0x9')]+_0x4f8352[_0xf531('0xa')]+_0x4f8352[_0xf531('0xb')]+_0x4f8352['countmachineretry']+_0x4f8352[_0xf531('0xc')];this[_0xf531('0x9')]=_0x4f8352['countnosuchnumberretry'];this[_0xf531('0xa')]=_0x4f8352[_0xf531('0xa')];this[_0xf531('0xb')]=_0x4f8352[_0xf531('0xb')];this[_0xf531('0xd')]=_0x4f8352[_0xf531('0xd')];this[_0xf531('0xc')]=_0x4f8352[_0xf531('0xc')];this['uniqueid']=_0x168712[_0xf531('0xe')];this['calleridname']=_0x4f8352[_0xf531('0xf')];this['calleridnum']=_0x4f8352[_0xf531('0x10')];this[_0xf531('0x11')]=_0x4f8352[_0xf531('0x11')];this['responsetime']=_0x4f8352[_0xf531('0x12')];this[_0xf531('0x13')]=moment()[_0xf531('0x14')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf531('0x15')]=utils[_0xf531('0x16')](_0x4f8352[_0xf531('0x12')],_0x4f8352[_0xf531('0x11')]);this['holdtime']=0x0;this[_0xf531('0x17')]=utils[_0xf531('0x16')](this['endtime'],_0x4f8352[_0xf531('0x12')]);this[_0xf531('0x18')]=_0x4f8352['queue'];this[_0xf531('0x19')]=_0xf531('0x1a');this['reason']=_0x168712['cause-txt'];this[_0xf531('0x1b')]=_0x4f8352['callback'];this[_0xf531('0x1c')]=_0x4f8352[_0xf531('0x1c')];this[_0xf531('0x1d')]=_0x4f8352[_0xf531('0x1d')];this[_0xf531('0x1e')]=_0x4f8352['recallme'];this[_0xf531('0x1f')]=_0x4f8352[_0xf531('0x1f')];this[_0xf531('0x20')]=_0x4f8352['ListId'];this['UserId']=_0x4f8352[_0xf531('0x21')];this[_0xf531('0x22')]=_0x4f8352[_0xf531('0x22')];this[_0xf531('0x23')]=_0x4f8352[_0xf531('0x23')];}module[_0xf531('0x24')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index b02f795..ab77ed3 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4328=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','holdtime'];(function(_0x2ead7c,_0x19d844){var _0x3561a5=function(_0x2daff8){while(--_0x2daff8){_0x2ead7c['push'](_0x2ead7c['shift']());}};_0x3561a5(++_0x19d844);}(_0x4328,0x199));var _0x8432=function(_0x511efc,_0x46bfcb){_0x511efc=_0x511efc-0x0;var _0x4db0ce=_0x4328[_0x511efc];return _0x4db0ce;};'use strict';var utils=require(_0x8432('0x0'));function History(_0x5ec68f){this[_0x8432('0x1')]=_0x5ec68f[_0x8432('0x1')];this[_0x8432('0x2')]=_0x5ec68f[_0x8432('0x2')]||undefined;this[_0x8432('0x3')]=_0x5ec68f[_0x8432('0x3')];this[_0x8432('0x4')]=_0x5ec68f[_0x8432('0x3')]===_0x8432('0x5')?_0x8432('0x6'):_0x5ec68f[_0x8432('0x3')];this[_0x8432('0x7')]=_0x5ec68f[_0x8432('0x7')];this['countcongestionretry']=_0x5ec68f['countcongestionretry'];this['countnoanswerretry']=_0x5ec68f['countnoanswerretry'];this[_0x8432('0x8')]=_0x5ec68f[_0x8432('0x7')]+_0x5ec68f['countcongestionretry']+_0x5ec68f[_0x8432('0x9')]+_0x5ec68f[_0x8432('0xa')]+_0x5ec68f[_0x8432('0xb')]+_0x5ec68f[_0x8432('0xc')]+_0x5ec68f['countmachineretry']+_0x5ec68f[_0x8432('0xd')];this[_0x8432('0xa')]=_0x5ec68f[_0x8432('0xa')];this[_0x8432('0xb')]=_0x5ec68f[_0x8432('0xb')];this['countabandonedretry']=_0x5ec68f[_0x8432('0xc')];this[_0x8432('0xe')]=_0x5ec68f[_0x8432('0xe')];this['countagentrejectretry']=_0x5ec68f[_0x8432('0xd')];this[_0x8432('0x6')]=_0x5ec68f[_0x8432('0x6')];this[_0x8432('0xf')]=_0x5ec68f[_0x8432('0x10')];this[_0x8432('0x11')]=_0x5ec68f[_0x8432('0x12')];this[_0x8432('0x13')]=_0x5ec68f['starttime'];this['responsetime']=_0x5ec68f[_0x8432('0x14')];this[_0x8432('0x15')]=_0x5ec68f['responsetime'];this['ringtime']=utils['getSeconds'](_0x5ec68f[_0x8432('0x14')],_0x5ec68f[_0x8432('0x13')]);this[_0x8432('0x16')]=0x0;this[_0x8432('0x17')]=0x0;this[_0x8432('0x18')]=_0x5ec68f['callback'];this[_0x8432('0x19')]=_0x5ec68f[_0x8432('0x19')];this['callbackat']=_0x5ec68f[_0x8432('0x1a')];this[_0x8432('0x1b')]=_0x5ec68f[_0x8432('0x1b')];this[_0x8432('0x1c')]=_0x5ec68f[_0x8432('0x1c')];this['ListId']=_0x5ec68f['ListId'];this[_0x8432('0x1d')]=_0x5ec68f[_0x8432('0x1d')];this['VoiceQueueId']=_0x5ec68f[_0x8432('0x1e')];this[_0x8432('0x1f')]=_0x5ec68f[_0x8432('0x1f')];this['originatecalleridnum']=_0x5ec68f[_0x8432('0x20')]||'';this[_0x8432('0x21')]=_0x5ec68f[_0x8432('0x21')]||'';this[_0x8432('0x22')]=_0x5ec68f[_0x8432('0x22')];this[_0x8432('0x23')]=_0x5ec68f[_0x8432('0x23')];}module['exports']=History; \ No newline at end of file +var _0x32db=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','../utils','uniqueid','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','callback'];(function(_0x5ddf0d,_0x2a731e){var _0x18ae64=function(_0x1b2bd8){while(--_0x1b2bd8){_0x5ddf0d['push'](_0x5ddf0d['shift']());}};_0x18ae64(++_0x2a731e);}(_0x32db,0x12b));var _0xb32d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x32db[_0x14add3];return _0x4a174f;};'use strict';var utils=require(_0xb32d('0x0'));function History(_0x133ef0){this['uniqueid']=_0x133ef0[_0xb32d('0x1')];this['scheduledat']=_0x133ef0['scheduledat']||undefined;this['type']=_0x133ef0['type'];this[_0xb32d('0x2')]=_0x133ef0[_0xb32d('0x3')]===_0xb32d('0x4')?'queue':_0x133ef0[_0xb32d('0x3')];this[_0xb32d('0x5')]=_0x133ef0['countbusyretry'];this[_0xb32d('0x6')]=_0x133ef0['countcongestionretry'];this['countnoanswerretry']=_0x133ef0[_0xb32d('0x7')];this[_0xb32d('0x8')]=_0x133ef0['countbusyretry']+_0x133ef0[_0xb32d('0x6')]+_0x133ef0['countnoanswerretry']+_0x133ef0['countnosuchnumberretry']+_0x133ef0[_0xb32d('0x9')]+_0x133ef0[_0xb32d('0xa')]+_0x133ef0[_0xb32d('0xb')]+_0x133ef0[_0xb32d('0xc')];this[_0xb32d('0xd')]=_0x133ef0['countnosuchnumberretry'];this[_0xb32d('0x9')]=_0x133ef0[_0xb32d('0x9')];this[_0xb32d('0xa')]=_0x133ef0['countabandonedretry'];this[_0xb32d('0xb')]=_0x133ef0[_0xb32d('0xb')];this[_0xb32d('0xc')]=_0x133ef0[_0xb32d('0xc')];this[_0xb32d('0xe')]=_0x133ef0['queue'];this[_0xb32d('0xf')]=_0x133ef0[_0xb32d('0x10')];this[_0xb32d('0x11')]=_0x133ef0['number'];this[_0xb32d('0x12')]=_0x133ef0[_0xb32d('0x12')];this[_0xb32d('0x13')]=_0x133ef0['responsetime'];this[_0xb32d('0x14')]=_0x133ef0[_0xb32d('0x13')];this[_0xb32d('0x15')]=utils[_0xb32d('0x16')](_0x133ef0[_0xb32d('0x13')],_0x133ef0[_0xb32d('0x12')]);this[_0xb32d('0x17')]=0x0;this['talktime']=0x0;this['callback']=_0x133ef0[_0xb32d('0x18')];this['callbackuniqueid']=_0x133ef0['callbackuniqueid'];this[_0xb32d('0x19')]=_0x133ef0['callbackat'];this[_0xb32d('0x1a')]=_0x133ef0['recallme'];this[_0xb32d('0x1b')]=_0x133ef0['ContactId'];this[_0xb32d('0x1c')]=_0x133ef0[_0xb32d('0x1c')];this[_0xb32d('0x1d')]=_0x133ef0[_0xb32d('0x1d')];this[_0xb32d('0x1e')]=_0x133ef0['VoiceQueueId'];this['CampaignId']=_0x133ef0[_0xb32d('0x1f')];this['originatecalleridnum']=_0x133ef0[_0xb32d('0x20')]||'';this['originatecalleridname']=_0x133ef0[_0xb32d('0x21')]||'';this[_0xb32d('0x22')]=_0x133ef0[_0xb32d('0x22')];this['statedesc']=_0x133ef0[_0xb32d('0x23')];}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 6e2221b..3e8dbeb 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc869=['../utils','type','campaigntype','outbound','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','getSeconds','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','statedesc','exports'];(function(_0xa57b21,_0x417e10){var _0x424aaa=function(_0x2022ab){while(--_0x2022ab){_0xa57b21['push'](_0xa57b21['shift']());}};_0x424aaa(++_0x417e10);}(_0xc869,0x17a));var _0x9c86=function(_0x19ce05,_0x15cccb){_0x19ce05=_0x19ce05-0x0;var _0xfb5110=_0xc869[_0x19ce05];return _0xfb5110;};'use strict';var utils=require(_0x9c86('0x0'));function QueueCallerAbandon(_0x3794da,_0x4543cb){this['scheduledat']=_0x3794da['scheduledat'];this['type']=_0x3794da[_0x9c86('0x1')];this[_0x9c86('0x2')]=_0x3794da['type']===_0x9c86('0x3')?'queue':_0x3794da[_0x9c86('0x1')];this[_0x9c86('0x4')]=_0x3794da[_0x9c86('0x4')];this['countcongestionretry']=_0x3794da[_0x9c86('0x5')];this['countnoanswerretry']=_0x3794da['countnoanswerretry'];this[_0x9c86('0x6')]=_0x3794da[_0x9c86('0x4')]+_0x3794da[_0x9c86('0x5')]+_0x3794da[_0x9c86('0x7')]+_0x3794da[_0x9c86('0x8')]+_0x3794da[_0x9c86('0x9')]+_0x3794da['countabandonedretry']+_0x3794da[_0x9c86('0xa')]+_0x3794da[_0x9c86('0xb')];this[_0x9c86('0x8')]=_0x3794da[_0x9c86('0x8')];this[_0x9c86('0x9')]=_0x3794da[_0x9c86('0x9')];this['countabandonedretry']=_0x3794da[_0x9c86('0xc')];this[_0x9c86('0xa')]=_0x3794da[_0x9c86('0xa')];this[_0x9c86('0xb')]=_0x3794da[_0x9c86('0xb')];this['uniqueid']=_0x4543cb[_0x9c86('0xd')];this[_0x9c86('0xe')]=_0x3794da[_0x9c86('0xf')];this[_0x9c86('0x10')]=_0x3794da[_0x9c86('0x11')];this['starttime']=_0x3794da[_0x9c86('0x12')];this['responsetime']=_0x3794da[_0x9c86('0x13')];this[_0x9c86('0x14')]=_0x3794da[_0x9c86('0x14')];this['dropreason']=_0x3794da[_0x9c86('0x15')];this['endtime']=this[_0x9c86('0x14')];this['ringtime']=utils[_0x9c86('0x16')](_0x3794da[_0x9c86('0x13')],_0x3794da[_0x9c86('0x12')]);this[_0x9c86('0x17')]=utils['getSeconds'](this[_0x9c86('0x14')],_0x3794da[_0x9c86('0x13')]);this[_0x9c86('0x18')]=0x0;this[_0x9c86('0x19')]=_0x4543cb[_0x9c86('0x19')];this[_0x9c86('0x1a')]=_0x4543cb[_0x9c86('0x1b')];this[_0x9c86('0x1c')]=_0x4543cb[_0x9c86('0x1c')];this[_0x9c86('0x1d')]=_0x3794da[_0x9c86('0x1d')];this[_0x9c86('0x1e')]=_0x3794da[_0x9c86('0x1e')];this[_0x9c86('0x1f')]=_0x3794da['callbackat'];this[_0x9c86('0x20')]=_0x3794da[_0x9c86('0x20')];this[_0x9c86('0x21')]=_0x3794da[_0x9c86('0x21')];this['ListId']=_0x3794da['ListId'];this[_0x9c86('0x22')]=_0x3794da[_0x9c86('0x22')];this['VoiceQueueId']=_0x3794da[_0x9c86('0x23')];this['CampaignId']=_0x3794da[_0x9c86('0x24')];this[_0x9c86('0x25')]=_0x3794da[_0x9c86('0x25')]||'';this[_0x9c86('0x26')]=_0x3794da[_0x9c86('0x26')]||'';this[_0x9c86('0x27')]=_0x3794da[_0x9c86('0x27')];this['state']=_0x3794da['state'];this[_0x9c86('0x28')]=_0x3794da[_0x9c86('0x28')];}module[_0x9c86('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x445c=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','holdtime','getSeconds','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x533500,_0x590832){var _0x19c22b=function(_0xa28ca){while(--_0xa28ca){_0x533500['push'](_0x533500['shift']());}};_0x19c22b(++_0x590832);}(_0x445c,0x16b));var _0xc445=function(_0x111f06,_0x294533){_0x111f06=_0x111f06-0x0;var _0x1116a2=_0x445c[_0x111f06];return _0x1116a2;};'use strict';var utils=require(_0xc445('0x0'));function QueueCallerAbandon(_0x1f4888,_0x3bc1d9){this[_0xc445('0x1')]=_0x1f4888['scheduledat'];this[_0xc445('0x2')]=_0x1f4888['type'];this['campaigntype']=_0x1f4888[_0xc445('0x2')]===_0xc445('0x3')?'queue':_0x1f4888[_0xc445('0x2')];this[_0xc445('0x4')]=_0x1f4888[_0xc445('0x4')];this[_0xc445('0x5')]=_0x1f4888[_0xc445('0x5')];this[_0xc445('0x6')]=_0x1f4888[_0xc445('0x6')];this['countglobal']=_0x1f4888['countbusyretry']+_0x1f4888['countcongestionretry']+_0x1f4888[_0xc445('0x6')]+_0x1f4888[_0xc445('0x7')]+_0x1f4888[_0xc445('0x8')]+_0x1f4888['countabandonedretry']+_0x1f4888[_0xc445('0x9')]+_0x1f4888[_0xc445('0xa')];this[_0xc445('0x7')]=_0x1f4888[_0xc445('0x7')];this['countdropretry']=_0x1f4888[_0xc445('0x8')];this[_0xc445('0xb')]=_0x1f4888['countabandonedretry'];this['countmachineretry']=_0x1f4888[_0xc445('0x9')];this[_0xc445('0xa')]=_0x1f4888[_0xc445('0xa')];this['uniqueid']=_0x3bc1d9[_0xc445('0xc')];this[_0xc445('0xd')]=_0x1f4888[_0xc445('0xe')];this[_0xc445('0xf')]=_0x1f4888[_0xc445('0x10')];this[_0xc445('0x11')]=_0x1f4888['starttime'];this[_0xc445('0x12')]=_0x1f4888[_0xc445('0x12')];this[_0xc445('0x13')]=_0x1f4888[_0xc445('0x13')];this[_0xc445('0x14')]=_0x1f4888[_0xc445('0x14')];this[_0xc445('0x15')]=this[_0xc445('0x13')];this[_0xc445('0x16')]=utils['getSeconds'](_0x1f4888[_0xc445('0x12')],_0x1f4888[_0xc445('0x11')]);this[_0xc445('0x17')]=utils[_0xc445('0x18')](this[_0xc445('0x13')],_0x1f4888[_0xc445('0x12')]);this['talktime']=0x0;this[_0xc445('0x19')]=_0x3bc1d9[_0xc445('0x19')];this[_0xc445('0x1a')]=_0x3bc1d9[_0xc445('0x1b')];this['reason']=_0x3bc1d9[_0xc445('0x1c')];this[_0xc445('0x1d')]=_0x1f4888['callback'];this[_0xc445('0x1e')]=_0x1f4888[_0xc445('0x1e')];this[_0xc445('0x1f')]=_0x1f4888[_0xc445('0x1f')];this[_0xc445('0x20')]=_0x1f4888[_0xc445('0x20')];this[_0xc445('0x21')]=_0x1f4888[_0xc445('0x21')];this[_0xc445('0x22')]=_0x1f4888[_0xc445('0x22')];this[_0xc445('0x23')]=_0x1f4888['UserId'];this[_0xc445('0x24')]=_0x1f4888['VoiceQueueId'];this[_0xc445('0x25')]=_0x1f4888[_0xc445('0x25')];this['originatecalleridnum']=_0x1f4888[_0xc445('0x26')]||'';this[_0xc445('0x27')]=_0x1f4888[_0xc445('0x27')]||'';this[_0xc445('0x28')]=_0x1f4888[_0xc445('0x28')];this[_0xc445('0x29')]=_0x1f4888[_0xc445('0x29')];this[_0xc445('0x2a')]=_0x1f4888['statedesc'];}module[_0xc445('0x2b')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 2f8b1c2..25922fa 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x430c=['[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','util','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','dialOrderByScheduledAt','temp','error','[getContactDialer]','getContactDialer','getContactDialerIvr','[getContactDialerIvr]','catch','[countReScheduled]','countReScheduled','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x4ef478,_0xb7e570){var _0x5220d5=function(_0x52a7a7){while(--_0x52a7a7){_0x4ef478['push'](_0x4ef478['shift']());}};_0x5220d5(++_0xb7e570);}(_0x430c,0x1a1));var _0xc430=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x430c[_0x374ccf];return _0x443cde;};'use strict';var util=require(_0xc430('0x0'));var logger=require('../../../../config/logger')('dialer');var cmHopper=require(_0xc430('0x1'));var cmHopperAdditionalPhone=require(_0xc430('0x2'));var cmHopperBlack=require(_0xc430('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x4f0118){return util['inspect'](_0x4f0118,{'showHidden':![],'depth':null});}function getContactDialer(_0x47d8b9,_0x338a82,_0x2408f5){return cmHopper['getContactDialer'](_0x47d8b9['id'],_0x338a82,_0x2408f5,_0x47d8b9[_0xc430('0x4')])['catch'](function(_0x212354){_0x47d8b9[_0xc430('0x5')]=0x0;logger[_0xc430('0x6')](_0xc430('0x7'),inspectError(_0x212354));});}exports[_0xc430('0x8')]=getContactDialer;function getContactDialerIvr(_0x11f4b0,_0x861581){return cmHopper[_0xc430('0x9')](_0x11f4b0['id'],_0x861581,_0x11f4b0[_0xc430('0x4')])['catch'](function(_0x97fa5b){_0x11f4b0[_0xc430('0x5')]=0x0;logger['error'](_0xc430('0xa'),inspectError(_0x97fa5b));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x3b84bc){return cmHopper['countReScheduled'](_0x3b84bc)[_0xc430('0xb')](function(_0x8aa2e6){logger[_0xc430('0x6')](_0xc430('0xc'),inspectError(_0x8aa2e6));});}exports[_0xc430('0xd')]=countReScheduled;function rescheduleContact(_0x2777af){return cmHopper[_0xc430('0xe')](_0x2777af)['catch'](function(_0x4e9134){logger[_0xc430('0x6')](_0xc430('0xf'),inspectError(_0x4e9134));});}exports[_0xc430('0xe')]=rescheduleContact;function unlockContact(_0x2ef538,_0x31d3b7,_0x55cc6c){return cmHopper[_0xc430('0x10')](_0x2ef538,_0x31d3b7,_0x55cc6c)['catch'](function(_0x4bf91f){logger[_0xc430('0x6')](_0xc430('0x11'),inspectError(_0x4bf91f));});}exports[_0xc430('0x10')]=unlockContact;function moveContactManagedDialer(_0x5830b0){return cmHopper['moveContactManagedDialer'](_0x5830b0)[_0xc430('0xb')](function(_0x4c1937){logger[_0xc430('0x6')]('[moveContactManagedDialer]',inspectError(_0x4c1937));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x2f3203){return cmHopperBlack['checkIsBlackList'](_0x2f3203)[_0xc430('0xb')](function(_0x1eae3b){logger[_0xc430('0x6')](_0xc430('0x12'),inspectError(_0x1eae3b));});}exports[_0xc430('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5af282){return cmHopperBlack[_0xc430('0x14')](_0x5af282)['catch'](function(_0x4d2d43){logger[_0xc430('0x6')](_0xc430('0x15'),inspectError(_0x4d2d43));});}exports[_0xc430('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x56dd16,_0x3fd56b,_0x57d26e){return cmHopperAdditionalPhone[_0xc430('0x16')](_0x56dd16,_0x3fd56b,_0x57d26e)[_0xc430('0xb')](function(_0x4efecd){logger[_0xc430('0x6')](_0xc430('0x17'),inspectError(_0x4efecd));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x2f9af4,_0x59c498,_0x3aa85e){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x2f9af4,_0x59c498,_0x3aa85e)[_0xc430('0xb')](function(_0x21e28a){logger['error'](_0xc430('0x18'),inspectError(_0x21e28a));});}exports[_0xc430('0x19')]=swapAdditionalPhones;function avgHandleTime(_0x2c0422){return cmHopperHistory[_0xc430('0x1a')](_0x2c0422)[_0xc430('0xb')](function(_0x57cd72){logger[_0xc430('0x6')](_0xc430('0x1b'),inspectError(_0x57cd72));});}exports[_0xc430('0x1a')]=avgHandleTime;function createHistory(_0x1591e3){return cmHopperHistory['createHistory'](_0x1591e3)[_0xc430('0xb')](function(_0x4cf56c){logger[_0xc430('0x6')]('[createHistory]',inspectError(_0x4cf56c));});}exports[_0xc430('0x1c')]=createHistory; \ No newline at end of file +var _0xfdbd=['[createHistory]','createHistory','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','error','[getContactDialer]','getContactDialerIvr','catch','temp','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','[unlockContact]','[moveContactManagedDialer]','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime'];(function(_0x35c165,_0x1bb4d3){var _0x43e64b=function(_0x249cf7){while(--_0x249cf7){_0x35c165['push'](_0x35c165['shift']());}};_0x43e64b(++_0x1bb4d3);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0xfdbd[_0x3f3a47];return _0x57a682;};'use strict';var util=require(_0xdfdb('0x0'));var logger=require(_0xdfdb('0x1'))(_0xdfdb('0x2'));var cmHopper=require(_0xdfdb('0x3'));var cmHopperAdditionalPhone=require(_0xdfdb('0x4'));var cmHopperBlack=require(_0xdfdb('0x5'));var cmHopperHistory=require(_0xdfdb('0x6'));function inspectError(_0x66533b){return util[_0xdfdb('0x7')](_0x66533b,{'showHidden':![],'depth':null});}function getContactDialer(_0x5945e0,_0x3f5b2d,_0x4a4a3f){return cmHopper[_0xdfdb('0x8')](_0x5945e0['id'],_0x3f5b2d,_0x4a4a3f,_0x5945e0[_0xdfdb('0x9')])['catch'](function(_0x556dc0){_0x5945e0['temp']=0x0;logger[_0xdfdb('0xa')](_0xdfdb('0xb'),inspectError(_0x556dc0));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x11d845,_0x444c19){return cmHopper[_0xdfdb('0xc')](_0x11d845['id'],_0x444c19,_0x11d845[_0xdfdb('0x9')])[_0xdfdb('0xd')](function(_0x1ace28){_0x11d845[_0xdfdb('0xe')]=0x0;logger['error'](_0xdfdb('0xf'),inspectError(_0x1ace28));});}exports[_0xdfdb('0xc')]=getContactDialerIvr;function countReScheduled(_0x527c05){return cmHopper[_0xdfdb('0x10')](_0x527c05)[_0xdfdb('0xd')](function(_0x2bee3b){logger[_0xdfdb('0xa')](_0xdfdb('0x11'),inspectError(_0x2bee3b));});}exports[_0xdfdb('0x10')]=countReScheduled;function rescheduleContact(_0xf5d903){return cmHopper[_0xdfdb('0x12')](_0xf5d903)['catch'](function(_0x48a66a){logger[_0xdfdb('0xa')]('[rescheduleContact]',inspectError(_0x48a66a));});}exports[_0xdfdb('0x12')]=rescheduleContact;function unlockContact(_0x9f3039,_0x11a56a,_0x40bc8a){return cmHopper[_0xdfdb('0x13')](_0x9f3039,_0x11a56a,_0x40bc8a)[_0xdfdb('0xd')](function(_0x54ff23){logger['error'](_0xdfdb('0x14'),inspectError(_0x54ff23));});}exports[_0xdfdb('0x13')]=unlockContact;function moveContactManagedDialer(_0x2c1070){return cmHopper['moveContactManagedDialer'](_0x2c1070)[_0xdfdb('0xd')](function(_0xb677b1){logger[_0xdfdb('0xa')](_0xdfdb('0x15'),inspectError(_0xb677b1));});}exports[_0xdfdb('0x16')]=moveContactManagedDialer;function checkIsBlackList(_0x2294de){return cmHopperBlack[_0xdfdb('0x17')](_0x2294de)[_0xdfdb('0xd')](function(_0x5b8cb5){logger[_0xdfdb('0xa')](_0xdfdb('0x18'),inspectError(_0x5b8cb5));});}exports[_0xdfdb('0x17')]=checkIsBlackList;function checkIsBlackListIvr(_0x5cc70b){return cmHopperBlack[_0xdfdb('0x19')](_0x5cc70b)[_0xdfdb('0xd')](function(_0x2c7dd1){logger['error'](_0xdfdb('0x1a'),inspectError(_0x2c7dd1));});}exports[_0xdfdb('0x19')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x334cdd,_0x489fd4,_0x2a80c1){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x334cdd,_0x489fd4,_0x2a80c1)[_0xdfdb('0xd')](function(_0x145350){logger[_0xdfdb('0xa')](_0xdfdb('0x1b'),inspectError(_0x145350));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x4c253e,_0x4363d8,_0x956843){return cmHopperAdditionalPhone[_0xdfdb('0x1c')](_0x4c253e,_0x4363d8,_0x956843)[_0xdfdb('0xd')](function(_0x305954){logger['error'](_0xdfdb('0x1d'),inspectError(_0x305954));});}exports[_0xdfdb('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0xdf3a5c){return cmHopperHistory['avgHandleTime'](_0xdf3a5c)[_0xdfdb('0xd')](function(_0x5df454){logger[_0xdfdb('0xa')](_0xdfdb('0x1e'),inspectError(_0x5df454));});}exports[_0xdfdb('0x1f')]=avgHandleTime;function createHistory(_0x513fa0){return cmHopperHistory['createHistory'](_0x513fa0)[_0xdfdb('0xd')](function(_0xc56435){logger[_0xdfdb('0xa')](_0xdfdb('0x20'),inspectError(_0xc56435));});}exports[_0xdfdb('0x21')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index d663b58..8d0438d 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d24=['RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','isPreviewCampaign','ivr','isIVRCampaign','type','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','unmonitored','includes','TrunkBackup','status','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','replace','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','undefined','XMD-','toUpperCase','setXMDContactVariables','lodash','util','../../../../config/logger','timezones','BLACKLIST'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6d24,0x1a4));var _0x46d2=function(_0x515cff,_0x27d4a5){_0x515cff=_0x515cff-0x0;var _0x419c0e=_0x6d24[_0x515cff];return _0x419c0e;};'use strict';var _=require(_0x46d2('0x0'));var moment=require('moment');var util=require(_0x46d2('0x1'));var logger=require(_0x46d2('0x2'))('dialer');var timezones=require('../../../../config/environment/shared')[_0x46d2('0x3')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x46d2('0x4'),'CONTACTS_RESCHEDULED':_0x46d2('0x5'),'DEACTIVATED':_0x46d2('0x6'),'DISACTIVED':_0x46d2('0x7'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x46d2('0x8'),'NO_AVAILABLE_CONTACTS':_0x46d2('0x9'),'NULL_INTERVAL':_0x46d2('0xa'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x46d2('0xb'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x46d2('0xc'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x46d2('0xd'),'UNREACHABLE_TRUNK':_0x46d2('0xe')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x34e6d7){return _0x34e6d7[_0x46d2('0xf')]===_0x46d2('0x10');}exports[_0x46d2('0x11')]=isPreviewCampaign;function isIVRCampaign(_0x2bcc25){return _0x2bcc25['type']===_0x46d2('0x12');}exports[_0x46d2('0x13')]=isIVRCampaign;function isOutboundQueue(_0x47c7da){return _0x47c7da[_0x46d2('0x14')]==='outbound';}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x154fc6){return _0x154fc6[_0x46d2('0x15')];}exports[_0x46d2('0x16')]=isQueueCampaignActive;function isIVRCampaignActive(_0x1bb1b5){return _0x1bb1b5['active'];}exports[_0x46d2('0x17')]=isIVRCampaignActive;function getSeconds(_0x1c67a5,_0x169451){var _0x7cc1fd=moment(_0x1c67a5)[_0x46d2('0x18')](0x0);var _0x30bd14=moment(_0x169451)[_0x46d2('0x18')](0x0);return _0x7cc1fd[_0x46d2('0x19')](_0x30bd14,_0x46d2('0x1a'));}exports[_0x46d2('0x1b')]=getSeconds;function hasQueueCampaignDataChanged(_0x4a20d5,_0x38e2fe){var _0x475d5f=![];var _0xd72695=_0x4a20d5[_0x46d2('0xf')]!==_0x38e2fe[_0x46d2('0xf')]||_0x4a20d5[_0x46d2('0x15')]!==_0x38e2fe['dialActive']||_0x4a20d5[_0x46d2('0x1c')]!==_0x38e2fe[_0x46d2('0x1c')];var _0x12ab53=_0x4a20d5[_0x46d2('0x1d')]!==_0x38e2fe[_0x46d2('0x1d')]||_0x4a20d5[_0x46d2('0x1e')]!==_0x38e2fe[_0x46d2('0x1e')]||_0x4a20d5[_0x46d2('0x1f')]!==_0x38e2fe['loggedInDb']||_0x4a20d5[_0x46d2('0x20')]!==_0x38e2fe[_0x46d2('0x20')]||_0x4a20d5[_0x46d2('0x21')]!==_0x38e2fe[_0x46d2('0x21')]||_0x4a20d5[_0x46d2('0x22')]!==_0x38e2fe[_0x46d2('0x22')]||_0x4a20d5[_0x46d2('0x23')]!==_0x38e2fe[_0x46d2('0x23')]||_0x4a20d5['inUse']!==_0x38e2fe[_0x46d2('0x24')]||_0x4a20d5[_0x46d2('0x25')]!==_0x38e2fe[_0x46d2('0x25')];if(_0x4a20d5[_0x46d2('0x26')]&&_0x38e2fe[_0x46d2('0x26')]){_0x475d5f=_0x4a20d5[_0x46d2('0x26')][_0x46d2('0x27')]!==_0x38e2fe['Trunk'][_0x46d2('0x27')]||_0x4a20d5[_0x46d2('0x26')][_0x46d2('0x28')]!==_0x38e2fe[_0x46d2('0x26')]['active'];}return _0xd72695||_0x12ab53||_0x475d5f;}exports[_0x46d2('0x29')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x3e8bd0){var _0x214f9f=null;var _0x46f2d2=_0x3e8bd0['dialTimezone'];if(_[_0x46d2('0x2a')](_0x3e8bd0[_0x46d2('0x2b')])||_[_0x46d2('0x2a')](_0x3e8bd0['Interval'])||_[_0x46d2('0x2a')](_0x3e8bd0[_0x46d2('0x2c')][_0x46d2('0x2d')])){_0x214f9f=CAMPAIGN_STATUS[_0x46d2('0x2e')];}else if(_[_0x46d2('0x2f')](_0x3e8bd0['dialGlobalInterval'])||_[_0x46d2('0x2f')](_0x3e8bd0[_0x46d2('0x2c')][_0x46d2('0x2d')])){_0x214f9f=CAMPAIGN_STATUS[_0x46d2('0x30')];}else if(_0x46f2d2&&!timezones[_0x46f2d2]){_0x214f9f=CAMPAIGN_STATUS[_0x46d2('0x31')];}return _0x214f9f;}function checkAnyValidTrunk(_0x30bf33,_0x3ebc51){var _0x1cecb4=null;var _0x828f90='SIP/';var _0x475b4d=['reachable',_0x46d2('0x32')];var _0x5969ea=!![];if(_0x30bf33['Trunk']&&_0x30bf33['Trunk'][_0x46d2('0x28')]){_0x828f90+=_0x30bf33[_0x46d2('0x26')]['name'];_0x1cecb4=_0x3ebc51[_0x828f90];_0x5969ea=_0x475b4d[_0x46d2('0x33')](_0x1cecb4['status']);}else if(_0x30bf33[_0x46d2('0x34')]&&_0x30bf33[_0x46d2('0x34')][_0x46d2('0x28')]){_0x828f90+=_0x30bf33[_0x46d2('0x34')]['name'];_0x1cecb4=_0x3ebc51[_0x828f90];_0x5969ea=_0x475b4d['includes'](_0x1cecb4[_0x46d2('0x35')]);}return _0x5969ea;}function getQueueCampaignStatusMessage(_0x38efac,_0x4d271e){var _0x43f437=CAMPAIGN_STATUS[_0x46d2('0x36')];var _0x270333=isPreviewCampaign(_0x38efac);if(!isQueueCampaignActive(_0x38efac)){if(_0x270333){_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x37')];}else{if(_0x38efac['originated']===0x0&&_0x38efac[_0x46d2('0x21')]===0x0&&_0x38efac['waiting']===0x0&&(_0x38efac[_0x46d2('0x22')]||0x0)===0x0){_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x37')];}else{_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x38')];}}}else if(_0x38efac[_0x46d2('0x1e')]===0x0){_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x39')];}else if(!checkAnyValidTrunk(_0x38efac,_0x4d271e)){_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x3a')];}else if(!isPreviewCampaign(_0x38efac)){var _0x513cea=checkAnyValidQueueCampaignInterval(_0x38efac);if(_0x513cea){_0x43f437=_0x513cea;}}return _0x43f437;}exports[_0x46d2('0x3b')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3007c3){var _0x3767ed=CAMPAIGN_STATUS['DISACTIVED'];if(_0x3007c3[_0x46d2('0x25')]===0x0&&_0x3007c3[_0x46d2('0x21')]===0x0&&_0x3007c3[_0x46d2('0x23')]===0x0&&(_0x3007c3[_0x46d2('0x22')]||0x0)===0x0){_0x3767ed=CAMPAIGN_STATUS[_0x46d2('0x37')];}return _0x3767ed;}exports[_0x46d2('0x3c')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x5a248){var _0x15fa6f=_0x5a248[_0x46d2('0x3d')](/"(.*?)"/);return _0x15fa6f?_0x15fa6f[0x1]:_0x5a248;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x11d12b,_0x12b50c,_0x4e4c09){if(!_[_0x46d2('0x3e')](_0x4e4c09)&&typeof _0x4e4c09===_0x46d2('0x3f')&&!_[_0x46d2('0x2f')](_0x4e4c09)){if(!_[_0x46d2('0x3e')](_0x12b50c)&&typeof _0x12b50c===_0x46d2('0x3f')&&!_[_0x46d2('0x2f')](_0x12b50c)){return util[_0x46d2('0x40')](_0x46d2('0x41'),_0x12b50c,_0x4e4c09);}return util[_0x46d2('0x40')](_0x46d2('0x41'),_0x4e4c09,_0x4e4c09);}if(!_[_0x46d2('0x3e')](_0x11d12b)&&typeof _0x11d12b===_0x46d2('0x3f')&&!_[_0x46d2('0x2f')](_0x11d12b)){return _0x11d12b;}return _0x46d2('0x42');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x4c08c5,_0x3d0c62){var _0x2a64bb;var _0xa56709;var _0xdc70d0;if(_0x3d0c62<=0x0){_0x3d0c62=0x1;}_0x2a64bb=new RegExp(_0x46d2('0x43')+_0x3d0c62+'}$');_0xa56709=Math[_0x46d2('0x44')](0xa,_0x3d0c62-0x1);_0xdc70d0=Math['pow'](0xa,_0x3d0c62)-0x1;return util[_0x46d2('0x40')]('%s',_[_0x46d2('0x45')](_0x4c08c5,_0x2a64bb,_['random'](_0xa56709,_0xdc70d0)[_0x46d2('0x46')]()));}exports[_0x46d2('0x47')]=getCallerIdRandom;function decrementOriginate(_0x38a25a){if(_0x38a25a[_0x46d2('0x25')]&&_0x38a25a[_0x46d2('0x25')]>0x0){_0x38a25a[_0x46d2('0x25')]-=0x1;}else{logger[_0x46d2('0x48')](_0x46d2('0x49'));}}exports[_0x46d2('0x4a')]=decrementOriginate;function checkContactEmpty(_0x3f0fc3){return _0x3f0fc3&&_0x3f0fc3[_0x46d2('0x4b')]>0x0;}exports[_0x46d2('0x4c')]=checkContactEmpty;function erlangb(_0x5a0634,_0x4d6993){if(_0x4d6993===0x0){return 0x0;}var _0x3c3679=0x1;for(var _0x571a9b=0x1;_0x571a9b<=_0x4d6993;_0x571a9b+=0x1){_0x3c3679=0x1+_0x3c3679*_0x571a9b/_0x5a0634;}return 0x1/_0x3c3679;}exports[_0x46d2('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x5e1382,_0x367e37,_0x23f507){if(_0x367e37>_0x23f507){for(var _0x4b5ab0=0x0;_0x4b5ab0<_0x367e37-_0x23f507;_0x4b5ab0+=0x1){decrementOriginate(_0x5e1382);}}}exports[_0x46d2('0x4e')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0xa5b2c0){var _0x11949b={};var _0x40265d=['id',_0x46d2('0x4f'),_0x46d2('0x50'),'tags','updatedAt'];if(_0xa5b2c0){for(var _0x2ef6a9 in _0xa5b2c0){if(typeof _0xa5b2c0[_0x2ef6a9]!==_0x46d2('0x51')){if(!_['isNil'](_0xa5b2c0[_0x2ef6a9])&&!_0x40265d[_0x46d2('0x33')](_0x2ef6a9)){_0x11949b[util['format']('%s%s',_0x46d2('0x52'),_0x2ef6a9[_0x46d2('0x53')]())]=_0xa5b2c0[_0x2ef6a9];}}}}return _0x11949b;}exports[_0x46d2('0x54')]=setXMDContactVariables; \ No newline at end of file +var _0xa3fb=['isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','checkContactLowerLimitOriginate','createdAt','description','tags','updatedAt','undefined','%s%s','XMD-','toUpperCase','setXMDContactVariables','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','milliseconds','diff','seconds','message','available','loggedIn','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','TrunkBackup','status','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','extractCalleridName'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xa3fb,0x193));var _0xba3f=function(_0x4446cc,_0x135a4c){_0x4446cc=_0x4446cc-0x0;var _0x20eb69=_0xa3fb[_0x4446cc];return _0x20eb69;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xba3f('0x0'));var logger=require(_0xba3f('0x1'))(_0xba3f('0x2'));var timezones=require(_0xba3f('0x3'))[_0xba3f('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0xba3f('0x5'),'BLACKLIST':_0xba3f('0x6'),'CONTACTS_RESCHEDULED':_0xba3f('0x7'),'DEACTIVATED':_0xba3f('0x8'),'DISACTIVED':_0xba3f('0x9'),'EMPTY_INTERVAL':_0xba3f('0xa'),'INACTIVE':_0xba3f('0xb'),'NO_AGENTS_LOGGED':_0xba3f('0xc'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':_0xba3f('0xd'),'OVERTIME_INTERVAL':_0xba3f('0xe'),'OVERTIME_GLOBAL_INTERVAL':_0xba3f('0xf'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0xba3f('0x10'),'RUNNING':_0xba3f('0x11'),'UNKNOWN_TIMEZONE':_0xba3f('0x12'),'UNREACHABLE_TRUNK':_0xba3f('0x13')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2289ab){return _0x2289ab[_0xba3f('0x14')]===_0xba3f('0x15');}exports[_0xba3f('0x16')]=isPreviewCampaign;function isIVRCampaign(_0x3e1138){return _0x3e1138[_0xba3f('0x17')]===_0xba3f('0x18');}exports[_0xba3f('0x19')]=isIVRCampaign;function isOutboundQueue(_0x5ea041){return _0x5ea041[_0xba3f('0x17')]===_0xba3f('0x1a');}exports[_0xba3f('0x1b')]=isOutboundQueue;function isQueueCampaignActive(_0x414d3a){return _0x414d3a[_0xba3f('0x1c')];}exports[_0xba3f('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x3e04e3){return _0x3e04e3[_0xba3f('0x1e')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x1ce0af,_0x4ee00e){var _0x1efab7=moment(_0x1ce0af)[_0xba3f('0x1f')](0x0);var _0x598ca9=moment(_0x4ee00e)['milliseconds'](0x0);return _0x1efab7[_0xba3f('0x20')](_0x598ca9,_0xba3f('0x21'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x50ef10,_0x553f2f){var _0x102c78=![];var _0x12f931=_0x50ef10[_0xba3f('0x14')]!==_0x553f2f[_0xba3f('0x14')]||_0x50ef10[_0xba3f('0x1c')]!==_0x553f2f[_0xba3f('0x1c')]||_0x50ef10[_0xba3f('0x22')]!==_0x553f2f[_0xba3f('0x22')];var _0xf5f45e=_0x50ef10[_0xba3f('0x23')]!==_0x553f2f[_0xba3f('0x23')]||_0x50ef10['loggedIn']!==_0x553f2f[_0xba3f('0x24')]||_0x50ef10['loggedInDb']!==_0x553f2f['loggedInDb']||_0x50ef10[_0xba3f('0x25')]!==_0x553f2f[_0xba3f('0x25')]||_0x50ef10[_0xba3f('0x26')]!==_0x553f2f[_0xba3f('0x26')]||_0x50ef10[_0xba3f('0x27')]!==_0x553f2f[_0xba3f('0x27')]||_0x50ef10['waiting']!==_0x553f2f[_0xba3f('0x28')]||_0x50ef10[_0xba3f('0x29')]!==_0x553f2f[_0xba3f('0x29')]||_0x50ef10[_0xba3f('0x2a')]!==_0x553f2f[_0xba3f('0x2a')];if(_0x50ef10[_0xba3f('0x2b')]&&_0x553f2f[_0xba3f('0x2b')]){_0x102c78=_0x50ef10[_0xba3f('0x2b')][_0xba3f('0x2c')]!==_0x553f2f[_0xba3f('0x2b')]['name']||_0x50ef10[_0xba3f('0x2b')]['active']!==_0x553f2f[_0xba3f('0x2b')][_0xba3f('0x1e')];}return _0x12f931||_0xf5f45e||_0x102c78;}exports[_0xba3f('0x2d')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x4acc38){var _0x5198b8=null;var _0xe568ba=_0x4acc38[_0xba3f('0x2e')];if(_[_0xba3f('0x2f')](_0x4acc38[_0xba3f('0x30')])||_['isNil'](_0x4acc38[_0xba3f('0x31')])||_[_0xba3f('0x2f')](_0x4acc38[_0xba3f('0x31')][_0xba3f('0x32')])){_0x5198b8=CAMPAIGN_STATUS[_0xba3f('0x33')];}else if(_[_0xba3f('0x34')](_0x4acc38[_0xba3f('0x30')])||_['isEmpty'](_0x4acc38[_0xba3f('0x31')][_0xba3f('0x32')])){_0x5198b8=CAMPAIGN_STATUS[_0xba3f('0x35')];}else if(_0xe568ba&&!timezones[_0xe568ba]){_0x5198b8=CAMPAIGN_STATUS[_0xba3f('0x36')];}return _0x5198b8;}function checkAnyValidTrunk(_0x3699c6,_0x1753d8){var _0x9df835=null;var _0x1119c2=_0xba3f('0x37');var _0xa7b89d=[_0xba3f('0x38'),_0xba3f('0x39')];var _0x320948=!![];if(_0x3699c6['Trunk']&&_0x3699c6[_0xba3f('0x2b')][_0xba3f('0x1e')]){_0x1119c2+=_0x3699c6['Trunk'][_0xba3f('0x2c')];_0x9df835=_0x1753d8[_0x1119c2];_0x320948=_0xa7b89d['includes'](_0x9df835['status']);}else if(_0x3699c6[_0xba3f('0x3a')]&&_0x3699c6[_0xba3f('0x3a')][_0xba3f('0x1e')]){_0x1119c2+=_0x3699c6[_0xba3f('0x3a')]['name'];_0x9df835=_0x1753d8[_0x1119c2];_0x320948=_0xa7b89d['includes'](_0x9df835[_0xba3f('0x3b')]);}return _0x320948;}function getQueueCampaignStatusMessage(_0xa98105,_0x45630f){var _0x3f1be8=CAMPAIGN_STATUS[_0xba3f('0x5')];var _0x1081c4=isPreviewCampaign(_0xa98105);if(!isQueueCampaignActive(_0xa98105)){if(_0x1081c4){_0x3f1be8=CAMPAIGN_STATUS[_0xba3f('0x3c')];}else{if(_0xa98105['originated']===0x0&&_0xa98105[_0xba3f('0x26')]===0x0&&_0xa98105[_0xba3f('0x28')]===0x0&&(_0xa98105[_0xba3f('0x27')]||0x0)===0x0){_0x3f1be8=CAMPAIGN_STATUS[_0xba3f('0x3c')];}else{_0x3f1be8=CAMPAIGN_STATUS[_0xba3f('0x3d')];}}}else if(_0xa98105[_0xba3f('0x24')]===0x0){_0x3f1be8=CAMPAIGN_STATUS[_0xba3f('0x3e')];}else if(!checkAnyValidTrunk(_0xa98105,_0x45630f)){_0x3f1be8=CAMPAIGN_STATUS[_0xba3f('0x3f')];}else if(!isPreviewCampaign(_0xa98105)){var _0x1c18e1=checkAnyValidQueueCampaignInterval(_0xa98105);if(_0x1c18e1){_0x3f1be8=_0x1c18e1;}}return _0x3f1be8;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x51207b){var _0x5a230a=CAMPAIGN_STATUS['DISACTIVED'];if(_0x51207b[_0xba3f('0x2a')]===0x0&&_0x51207b[_0xba3f('0x26')]===0x0&&_0x51207b[_0xba3f('0x28')]===0x0&&(_0x51207b[_0xba3f('0x27')]||0x0)===0x0){_0x5a230a=CAMPAIGN_STATUS[_0xba3f('0x3c')];}return _0x5a230a;}exports[_0xba3f('0x40')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x5a58ea){var _0x5802cd=_0x5a58ea[_0xba3f('0x41')](/"(.*?)"/);return _0x5802cd?_0x5802cd[0x1]:_0x5a58ea;}exports[_0xba3f('0x42')]=extractCalleridName;function getCallerId(_0xa08541,_0x1bda95,_0x25813b){if(!_[_0xba3f('0x43')](_0x25813b)&&typeof _0x25813b==='string'&&!_[_0xba3f('0x34')](_0x25813b)){if(!_[_0xba3f('0x43')](_0x1bda95)&&typeof _0x1bda95===_0xba3f('0x44')&&!_['isEmpty'](_0x1bda95)){return util[_0xba3f('0x45')](_0xba3f('0x46'),_0x1bda95,_0x25813b);}return util[_0xba3f('0x45')]('\x22%s\x22\x20<%s>',_0x25813b,_0x25813b);}if(!_[_0xba3f('0x43')](_0xa08541)&&typeof _0xa08541===_0xba3f('0x44')&&!_[_0xba3f('0x34')](_0xa08541)){return _0xa08541;}return _0xba3f('0x47');}exports[_0xba3f('0x48')]=getCallerId;function getCallerIdRandom(_0x5c7f83,_0x2d4bec){var _0x2d6fd6;var _0x3e4254;var _0x6bff34;if(_0x2d4bec<=0x0){_0x2d4bec=0x1;}_0x2d6fd6=new RegExp(_0xba3f('0x49')+_0x2d4bec+'}$');_0x3e4254=Math[_0xba3f('0x4a')](0xa,_0x2d4bec-0x1);_0x6bff34=Math['pow'](0xa,_0x2d4bec)-0x1;return util[_0xba3f('0x45')]('%s',_[_0xba3f('0x4b')](_0x5c7f83,_0x2d6fd6,_[_0xba3f('0x4c')](_0x3e4254,_0x6bff34)[_0xba3f('0x4d')]()));}exports[_0xba3f('0x4e')]=getCallerIdRandom;function decrementOriginate(_0x57ebec){if(_0x57ebec['originated']&&_0x57ebec[_0xba3f('0x2a')]>0x0){_0x57ebec[_0xba3f('0x2a')]-=0x1;}else{logger[_0xba3f('0x4f')](_0xba3f('0x50'));}}exports[_0xba3f('0x51')]=decrementOriginate;function checkContactEmpty(_0x444e96){return _0x444e96&&_0x444e96[_0xba3f('0x52')]>0x0;}exports[_0xba3f('0x53')]=checkContactEmpty;function erlangb(_0x57c782,_0x5c5a1b){if(_0x5c5a1b===0x0){return 0x0;}var _0x5f1870=0x1;for(var _0xe80e55=0x1;_0xe80e55<=_0x5c5a1b;_0xe80e55+=0x1){_0x5f1870=0x1+_0x5f1870*_0xe80e55/_0x57c782;}return 0x1/_0x5f1870;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x408132,_0xe57207,_0x217b1f){if(_0xe57207>_0x217b1f){for(var _0x433fe5=0x0;_0x433fe5<_0xe57207-_0x217b1f;_0x433fe5+=0x1){decrementOriginate(_0x408132);}}}exports[_0xba3f('0x54')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x504ee2){var _0x5704cc={};var _0x3dfa92=['id',_0xba3f('0x55'),_0xba3f('0x56'),_0xba3f('0x57'),_0xba3f('0x58')];if(_0x504ee2){for(var _0x286640 in _0x504ee2){if(typeof _0x504ee2[_0x286640]!==_0xba3f('0x59')){if(!_[_0xba3f('0x2f')](_0x504ee2[_0x286640])&&!_0x3dfa92['includes'](_0x286640)){_0x5704cc[util[_0xba3f('0x45')](_0xba3f('0x5a'),_0xba3f('0x5b'),_0x286640[_0xba3f('0x5c')]())]=_0x504ee2[_0x286640];}}}}return _0x5704cc;}exports[_0xba3f('0x5d')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index b8f2b14..ac6222a 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(_0x4d0225,_0x140e85){var _0x432d38=function(_0x1a9374){while(--_0x1a9374){_0x4d0225['push'](_0x4d0225['shift']());}};_0x432d38(++_0x140e85);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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(_0x14bbf5,_0x331f7e){var _0xe2e90c=function(_0x49890f){while(--_0x49890f){_0x14bbf5['push'](_0x14bbf5['shift']());}};_0xe2e90c(++_0x331f7e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 2546602..c3b96cf 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 _0xf71c=['Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','context','from-voip-provider','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','prototype','operation','status','localstationid','filename','remotestationid','pagestransferred','resolution','calleridnum','\x20result\x20conversion\x20file\x20','message','create','application/pdf','then','notify','parse','.pdf','catch','error','\x20notify\x20','\x20receiveFax\x20','pick','response','reason','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]','\x20hangup\x20sendFile\x20','stringify','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','XMF-PATH'];(function(_0x29b85d,_0x472608){var _0x594a39=function(_0x483d65){while(--_0x483d65){_0x29b85d['push'](_0x29b85d['shift']());}};_0x594a39(++_0x472608);}(_0xf71c,0x17d));var _0xcf71=function(_0x2e6741,_0x49e427){_0x2e6741=_0x2e6741-0x0;var _0x5c3688=_0xf71c[_0x2e6741];return _0x5c3688;};'use strict';var util=require(_0xcf71('0x0'));var _=require(_0xcf71('0x1'));var BPromise=require(_0xcf71('0x2'));var uuid=require(_0xcf71('0x3'));var moment=require(_0xcf71('0x4'));var path=require('path');var tiff2pdf=require(_0xcf71('0x5'));var gs=require(_0xcf71('0x6'));var logger=require(_0xcf71('0x7'))(_0xcf71('0x8'));var ami=require(_0xcf71('0x9'));var rpcDb=require(_0xcf71('0xa'));var Channel=require(_0xcf71('0xb'));var ut=require(_0xcf71('0xc'));var Action=require(_0xcf71('0xd'));var faxAccount=require(_0xcf71('0xe'));var attachment=require(_0xcf71('0xf'));var faxMessage=require(_0xcf71('0x10'));function Fax(_0x1daad0){this['channels']={};this[_0xcf71('0x11')]=_0x1daad0[_0xcf71('0x11')];this[_0xcf71('0x12')]=_0x1daad0['trunks'];this[_0xcf71('0x13')]={};ami['on'](_0xcf71('0x14'),this[_0xcf71('0x15')][_0xcf71('0x16')](this));ami['on']('varset',this[_0xcf71('0x17')][_0xcf71('0x16')](this));ami['on']('newstate',this[_0xcf71('0x18')]['bind'](this));ami['on'](_0xcf71('0x19'),this[_0xcf71('0x1a')]['bind'](this));ami['on'](_0xcf71('0x1b'),this[_0xcf71('0x1c')]['bind'](this));ami['on'](_0xcf71('0x1d'),this[_0xcf71('0x1e')][_0xcf71('0x16')](this));ami['on'](_0xcf71('0x1f'),this[_0xcf71('0x20')][_0xcf71('0x16')](this));ami['on'](_0xcf71('0x21'),this['syncOriginateResponse']['bind'](this));}Fax['prototype'][_0xcf71('0x15')]=function(_0x4e83e3){if(_0x4e83e3[_0xcf71('0x22')]===_0xcf71('0x23')){for(var _0x85985f in this[_0xcf71('0x11')]){if(this[_0xcf71('0x11')][_0xcf71('0x24')](_0x85985f)){if(_0x4e83e3[_0xcf71('0x25')]===this[_0xcf71('0x11')][_0x85985f]['localstationid']){this[_0xcf71('0x26')][_0x4e83e3['uniqueid']]={};this['channels'][_0x4e83e3[_0xcf71('0x27')]]['channel']=_0x4e83e3[_0xcf71('0x28')];this[_0xcf71('0x26')][_0x4e83e3[_0xcf71('0x27')]]['id']=this[_0xcf71('0x11')][_0x85985f]['id'];this[_0xcf71('0x26')][_0x4e83e3['uniqueid']][_0xcf71('0x29')]=this[_0xcf71('0x11')][_0x85985f][_0xcf71('0x29')];logger[_0xcf71('0x2a')](_0x4e83e3[_0xcf71('0x27')],_0xcf71('0x2b'));}}}}if(this[_0xcf71('0x13')][_0x4e83e3[_0xcf71('0x27')]]){this['channels'][_0x4e83e3[_0xcf71('0x27')]]={};this[_0xcf71('0x26')][_0x4e83e3[_0xcf71('0x27')]][_0xcf71('0x28')]=_0x4e83e3['channel'];logger['info'](_0x4e83e3[_0xcf71('0x27')],_0xcf71('0x2b'));}};Fax['prototype']['syncVarSet']=function(_0x5e57a5){if(this['channels'][_0x5e57a5['uniqueid']]){for(var _0x21e4f9 in _0x5e57a5['variable']){if(_0x5e57a5[_0xcf71('0x2c')][_0xcf71('0x24')](_0x21e4f9)){this[_0xcf71('0x26')][_0x5e57a5['uniqueid']][_0x21e4f9]=_0x5e57a5[_0xcf71('0x2d')];}}}};Fax['prototype'][_0xcf71('0x18')]=function(_0x5602e5){if(this[_0xcf71('0x26')][_0x5602e5[_0xcf71('0x27')]]){this['channels'][_0x5602e5['uniqueid']][_0xcf71('0x2e')]=_0x5602e5['channelstate'];this['channels'][_0x5602e5[_0xcf71('0x27')]][_0xcf71('0x2f')]=_0x5602e5[_0xcf71('0x2f')];}};Fax[_0xcf71('0x30')]['syncNewExten']=function(_0x2b0b4a){if(this['channels'][_0x2b0b4a[_0xcf71('0x27')]]){for(var _0x17e643 in _0x2b0b4a[_0xcf71('0x2c')]){if(_0x2b0b4a['variable']['hasOwnProperty'](_0x17e643)){this['channels'][_0x2b0b4a[_0xcf71('0x27')]][_0x17e643]=_0x2b0b4a[_0xcf71('0x2d')];}}}};Fax['prototype'][_0xcf71('0x1c')]=function(_0x284588){if(this['channels'][_0x284588[_0xcf71('0x27')]]){this[_0xcf71('0x26')][_0x284588[_0xcf71('0x27')]][_0xcf71('0x31')]=_0x284588[_0xcf71('0x31')];this[_0xcf71('0x26')][_0x284588['uniqueid']][_0xcf71('0x32')]=_0x284588[_0xcf71('0x32')];this[_0xcf71('0x26')][_0x284588['uniqueid']][_0xcf71('0x33')]=_0x284588[_0xcf71('0x33')];this[_0xcf71('0x26')][_0x284588[_0xcf71('0x27')]][_0xcf71('0x34')]=_0x284588['filename'];logger[_0xcf71('0x2a')](_0x284588['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0xcf71('0x30')]['syncReceiveFax']=function(_0x285164){var _0x5154d3=this;if(this[_0xcf71('0x26')][_0x285164['uniqueid']]){var _0x58b501=this['channels'][_0x285164[_0xcf71('0x27')]]['id'];this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]][_0xcf71('0x35')]=_0x285164[_0xcf71('0x35')];this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]][_0xcf71('0x36')]=_0x285164[_0xcf71('0x36')];this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]]['localstationid']=_0x285164[_0xcf71('0x33')];this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]]['resolution']=_0x285164[_0xcf71('0x37')];this[_0xcf71('0x26')][_0x285164['uniqueid']]['transferrate']=_0x285164['transferrate'];this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]]['filename']=_0x285164[_0xcf71('0x34')];this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]][_0xcf71('0x38')]=_0x285164[_0xcf71('0x38')];if(this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]][_0xcf71('0x36')]>0x0){tiff2pdf(_0x285164['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x3eff47){logger[_0xcf71('0x2a')](_0x285164[_0xcf71('0x27')],_0xcf71('0x39'),_0x3eff47[_0xcf71('0x3a')]);attachment[_0xcf71('0x3b')]({'name':path['parse'](_0x285164['filename'])['name'],'basename':path['parse'](_0x285164[_0xcf71('0x34')])[_0xcf71('0x29')]+'.pdf','type':_0xcf71('0x3c')})[_0xcf71('0x3d')](function(_0x330e35){faxAccount[_0xcf71('0x3e')](_0x58b501,{'from':_0x285164[_0xcf71('0x38')],'mapKey':_0xcf71('0x8'),'body':path[_0xcf71('0x3f')](_0x285164[_0xcf71('0x34')])['name']+_0xcf71('0x40'),'AttachmentId':_0x330e35['id']})[_0xcf71('0x41')](function(_0x42d3c8){logger[_0xcf71('0x42')](_0x285164[_0xcf71('0x27')],_0xcf71('0x43'),JSON['stringify'](_0x42d3c8));});})[_0xcf71('0x41')](function(_0x19b169){logger['error'](_0x285164[_0xcf71('0x27')],'\x20receiveFax\x20',JSON['stringify'](_0x19b169));});});}logger[_0xcf71('0x2a')](_0x285164[_0xcf71('0x27')],_0xcf71('0x44'));}};Fax[_0xcf71('0x30')]['syncOriginateResponse']=function(_0x481624){if(this[_0xcf71('0x13')][_0x481624[_0xcf71('0x27')]]){_['merge'](this[_0xcf71('0x26')][_0x481624[_0xcf71('0x27')]],_[_0xcf71('0x45')](_0x481624,[_0xcf71('0x46'),_0xcf71('0x47')]));}};function updateStatus(_0x2cb26b){if(_0x2cb26b[_0xcf71('0x48')]){faxMessage[_0xcf71('0x49')](_0x2cb26b[_0xcf71('0x48')],{'failMessage':_0xcf71('0x4a')})['then'](function(_0x545c53){ut[_0xcf71('0x4b')](_0xcf71('0x4c'),_0x545c53);})[_0xcf71('0x41')](function(_0x1bcf83){ut[_0xcf71('0x4b')](_0xcf71('0x4d'),_0x1bcf83);});}else{ut[_0xcf71('0x4b')](_0xcf71('0x4e'));}}Fax[_0xcf71('0x30')][_0xcf71('0x4f')]=function(_0x569ad2,_0x467716,_0x21ee8d){var _0x213965=this;var _0x3d9358={};if(_0x467716){_0x3d9358={'read':_0x467716};}else{_0x3d9358={'failMessage':_0x21ee8d};}if(this['actions'][_0x569ad2][_0xcf71('0x48')]){faxMessage[_0xcf71('0x49')](this['actions'][_0x569ad2][_0xcf71('0x48')],_0x3d9358)['then'](function(_0x3013cb){ut[_0xcf71('0x4b')](_0xcf71('0x50'),_0x3013cb);})['catch'](function(_0x31850c){ut[_0xcf71('0x4b')](_0xcf71('0x51'),_0x31850c);})[_0xcf71('0x52')](function(){delete _0x213965[_0xcf71('0x26')][_0x569ad2];delete _0x213965[_0xcf71('0x13')][_0x569ad2];});}else{ut[_0xcf71('0x4b')](_0xcf71('0x53'));delete this[_0xcf71('0x26')][_0x569ad2];delete this[_0xcf71('0x13')][_0x569ad2];}};Fax[_0xcf71('0x30')][_0xcf71('0x20')]=function(_0x2c35d5){var _0x321857=this;if(this[_0xcf71('0x26')][_0x2c35d5[_0xcf71('0x27')]]){if(this[_0xcf71('0x13')][_0x2c35d5[_0xcf71('0x27')]]){this[_0xcf71('0x26')][_0x2c35d5['uniqueid']]['id']=this[_0xcf71('0x13')][_0x2c35d5[_0xcf71('0x27')]]['id'];this['channels'][_0x2c35d5[_0xcf71('0x27')]][_0xcf71('0x29')]=this[_0xcf71('0x13')][_0x2c35d5[_0xcf71('0x27')]]['name'];}logger[_0xcf71('0x2a')](_0x2c35d5[_0xcf71('0x27')],this[_0xcf71('0x13')][_0x2c35d5['uniqueid']]?_0xcf71('0x54'):'\x20hangup\x20faxRiceive\x20',JSON[_0xcf71('0x55')](this[_0xcf71('0x26')][_0x2c35d5['uniqueid']]));if(this[_0xcf71('0x13')][_0x2c35d5[_0xcf71('0x27')]]){if(this[_0xcf71('0x26')][_0x2c35d5[_0xcf71('0x27')]][_0xcf71('0x56')]>0x0&&this['channels'][_0x2c35d5[_0xcf71('0x27')]][_0xcf71('0x1b')]===_0xcf71('0x57')){this[_0xcf71('0x4f')](_0x2c35d5[_0xcf71('0x27')],!![]);}else{this[_0xcf71('0x4f')](_0x2c35d5['uniqueid'],![],this[_0xcf71('0x26')][_0x2c35d5[_0xcf71('0x27')]][_0xcf71('0x58')]?_0xcf71('0x59')+this[_0xcf71('0x26')][_0x2c35d5[_0xcf71('0x27')]][_0xcf71('0x58')]:_0xcf71('0x5a'));}}}};Fax[_0xcf71('0x30')]['send']=function(_0x1ff276){var _0xdd293c=this;return new BPromise(function(_0x3b1140,_0x55366c){_0xdd293c[_0xcf71('0x5b')](_0x1ff276,_0xdd293c[_0xcf71('0x11')][_0x1ff276[_0xcf71('0x5c')]])[_0xcf71('0x3d')](function(_0xedc0de){ut[_0xcf71('0x4b')](_0xcf71('0x5d'),_0xedc0de);_0x3b1140(ut[_0xcf71('0x3a')](_0xcf71('0x5e')));})[_0xcf71('0x41')](function(_0x269c4c){ut['logger']('[Fax][execOriginate][failure]',_0x269c4c);updateStatus(_0x1ff276);_0x55366c(ut[_0xcf71('0x3a')](_0xcf71('0x5f')));});});};Fax['prototype'][_0xcf71('0x60')]=function(_0x20f435){var _0x122143=this;return new BPromise(function(_0x19880a,_0x5be48e){var _0x4ac0f0=_0x122143[_0xcf71('0x61')](_0x122143[_0xcf71('0x11')][_0x20f435[_0xcf71('0x5c')]][_0xcf71('0x62')],_0x20f435);if(_0x4ac0f0[_0xcf71('0x63')]){_0x19880a(ut[_0xcf71('0x3a')]('Trunk\x20Reachable'));}else{_0x5be48e(ut[_0xcf71('0x3a')](_0x4ac0f0[_0xcf71('0x3a')]));}});};function originate(_0x1e4ad8,_0x24a477,_0x5464fd){return new BPromise(function(_0x16d6be,_0x566388){if(_0x5464fd){var _0xa0866c=util[_0xcf71('0x64')](_0xcf71('0x65'),path['parse'](_0x1e4ad8[_0xcf71('0x66')])[_0xcf71('0x29')],_0x1e4ad8[_0xcf71('0x66')]);gs[_0xcf71('0x67')](_0xa0866c)[_0xcf71('0x3d')](function(){_0x1e4ad8['path']=util[_0xcf71('0x64')](_0xcf71('0x68'),path[_0xcf71('0x3f')](_0x1e4ad8[_0xcf71('0x66')])[_0xcf71('0x69')],path['parse'](_0x1e4ad8['path'])[_0xcf71('0x29')]);_0x24a477[_0xcf71('0x6a')]=_0x1e4ad8[_0xcf71('0x66')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0xcf71('0x6b')](ut[_0xcf71('0x6c')](_0x1e4ad8,_0x24a477))[_0xcf71('0x3d')](function(_0x54d363){_0x16d6be(_0x54d363);})[_0xcf71('0x41')](function(_0x227925){_0x566388(_0x227925);});})[_0xcf71('0x41')](function(_0x47cb19){_0x566388(_0x47cb19);});}else{ami['Action'](ut['variablesAction'](_0x1e4ad8,_0x24a477))[_0xcf71('0x3d')](function(_0x3ab807){_0x16d6be(_0x3ab807);})[_0xcf71('0x41')](function(_0xaa839d){_0x566388(_0xaa839d);});}});}Fax[_0xcf71('0x30')][_0xcf71('0x5b')]=function(_0x1f77fc,_0x497bfe){var _0x53c9d1=this;return new BPromise(function(_0x18b20e,_0x4ab87d){var _0x35e0c9=uuid['v4']();var _0x459c5f=ut[_0xcf71('0x6d')](_0x1f77fc,_0x497bfe);_0x53c9d1[_0xcf71('0x13')][_0x35e0c9]=new Action(_0x35e0c9,_0x497bfe,_0x1f77fc);var _0x4b9a5d=_0x53c9d1[_0xcf71('0x13')][_0x35e0c9];if(path[_0xcf71('0x3f')](_0x1f77fc[_0xcf71('0x66')])[_0xcf71('0x6e')]===_0xcf71('0x40')){originate(_0x4b9a5d,_0x459c5f,!![])[_0xcf71('0x3d')](function(_0x565d3d){_0x18b20e(_0x565d3d);})['catch'](function(_0x3e72ff){_0x4ab87d(_0x3e72ff);});}else{originate(_0x4b9a5d,_0x459c5f,![])[_0xcf71('0x3d')](function(_0x5052d2){_0x18b20e(_0x5052d2);})[_0xcf71('0x41')](function(_0x19576e){_0x4ab87d(_0x19576e);});}});};Fax[_0xcf71('0x30')]['isTrunkReachable']=function(_0x30e744){return!_[_0xcf71('0x6f')](_0x30e744)&&!_[_0xcf71('0x6f')](_0x30e744[_0xcf71('0x29')])&&!_['isNil'](_0x30e744['active'])&&_0x30e744[_0xcf71('0x70')]&&!_[_0xcf71('0x6f')](this[_0xcf71('0x12')][util[_0xcf71('0x64')](_0xcf71('0x71'),_0x30e744['name'])])&&!_[_0xcf71('0x6f')](this[_0xcf71('0x12')][util[_0xcf71('0x64')](_0xcf71('0x71'),_0x30e744['name'])][_0xcf71('0x32')])&&(this[_0xcf71('0x12')][util[_0xcf71('0x64')](_0xcf71('0x71'),_0x30e744[_0xcf71('0x29')])][_0xcf71('0x32')]===_0xcf71('0x72')||this[_0xcf71('0x12')][util[_0xcf71('0x64')]('SIP/%s',_0x30e744[_0xcf71('0x29')])]['status']===_0xcf71('0x73'));};Fax[_0xcf71('0x30')][_0xcf71('0x61')]=function(_0xfcf18,_0x9ab7d9){if(!this[_0xcf71('0x74')](_0xfcf18)){ut[_0xcf71('0x4b')](_0xcf71('0x75'),_[_0xcf71('0x6f')](_0xfcf18)?'':_0xfcf18['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xcf71('0x6f')](_0x9ab7d9[_0xcf71('0x8')])){ut['logger'](_0xcf71('0x76'),JSON['stringify'](_0x9ab7d9));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x9ab7d9[_0xcf71('0x66')])){ut[_0xcf71('0x4b')](_0xcf71('0x77'),JSON[_0xcf71('0x55')](_0x9ab7d9));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xcf71('0x78')};};module[_0xcf71('0x79')]=Fax; \ No newline at end of file +var _0x6bf9=['isNil','active','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','util','lodash','bluebird','uuid','moment','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','bind','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','info','syncVarSet','variable','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','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','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','addVariables','ext','isTrunkReachable'];(function(_0x419bb9,_0x247ffa){var _0x594006=function(_0x795a74){while(--_0x795a74){_0x419bb9['push'](_0x419bb9['shift']());}};_0x594006(++_0x247ffa);}(_0x6bf9,0x1cd));var _0x96bf=function(_0xd4636c,_0x34dbf6){_0xd4636c=_0xd4636c-0x0;var _0x5ee17d=_0x6bf9[_0xd4636c];return _0x5ee17d;};'use strict';var util=require(_0x96bf('0x0'));var _=require(_0x96bf('0x1'));var BPromise=require(_0x96bf('0x2'));var uuid=require(_0x96bf('0x3'));var moment=require(_0x96bf('0x4'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x96bf('0x5'))(_0x96bf('0x6'));var ami=require(_0x96bf('0x7'));var rpcDb=require(_0x96bf('0x8'));var Channel=require(_0x96bf('0x9'));var ut=require(_0x96bf('0xa'));var Action=require('./action');var faxAccount=require(_0x96bf('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x96bf('0xc'));function Fax(_0x100fa4){this['channels']={};this[_0x96bf('0xd')]=_0x100fa4[_0x96bf('0xd')];this[_0x96bf('0xe')]=_0x100fa4['trunks'];this[_0x96bf('0xf')]={};ami['on'](_0x96bf('0x10'),this['syncNewchannel'][_0x96bf('0x11')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0x96bf('0x12'),this[_0x96bf('0x13')][_0x96bf('0x11')](this));ami['on']('newexten',this[_0x96bf('0x14')][_0x96bf('0x11')](this));ami['on'](_0x96bf('0x15'),this[_0x96bf('0x16')][_0x96bf('0x11')](this));ami['on']('receivefax',this[_0x96bf('0x17')][_0x96bf('0x11')](this));ami['on'](_0x96bf('0x18'),this[_0x96bf('0x19')][_0x96bf('0x11')](this));ami['on']('originateresponse',this[_0x96bf('0x1a')]['bind'](this));}Fax[_0x96bf('0x1b')][_0x96bf('0x1c')]=function(_0x2ca19e){if(_0x2ca19e[_0x96bf('0x1d')]===_0x96bf('0x1e')){for(var _0x37ec0d in this[_0x96bf('0xd')]){if(this[_0x96bf('0xd')][_0x96bf('0x1f')](_0x37ec0d)){if(_0x2ca19e['exten']===this['faxAccounts'][_0x37ec0d][_0x96bf('0x20')]){this[_0x96bf('0x21')][_0x2ca19e[_0x96bf('0x22')]]={};this['channels'][_0x2ca19e[_0x96bf('0x22')]][_0x96bf('0x23')]=_0x2ca19e[_0x96bf('0x23')];this[_0x96bf('0x21')][_0x2ca19e[_0x96bf('0x22')]]['id']=this[_0x96bf('0xd')][_0x37ec0d]['id'];this['channels'][_0x2ca19e['uniqueid']][_0x96bf('0x24')]=this[_0x96bf('0xd')][_0x37ec0d][_0x96bf('0x24')];logger['info'](_0x2ca19e[_0x96bf('0x22')],_0x96bf('0x25'));}}}}if(this[_0x96bf('0xf')][_0x2ca19e[_0x96bf('0x22')]]){this[_0x96bf('0x21')][_0x2ca19e[_0x96bf('0x22')]]={};this[_0x96bf('0x21')][_0x2ca19e['uniqueid']]['channel']=_0x2ca19e[_0x96bf('0x23')];logger[_0x96bf('0x26')](_0x2ca19e[_0x96bf('0x22')],_0x96bf('0x25'));}};Fax[_0x96bf('0x1b')][_0x96bf('0x27')]=function(_0x4152f6){if(this[_0x96bf('0x21')][_0x4152f6[_0x96bf('0x22')]]){for(var _0x3e6bfc in _0x4152f6[_0x96bf('0x28')]){if(_0x4152f6[_0x96bf('0x28')][_0x96bf('0x1f')](_0x3e6bfc)){this[_0x96bf('0x21')][_0x4152f6['uniqueid']][_0x3e6bfc]=_0x4152f6['value'];}}}};Fax['prototype'][_0x96bf('0x13')]=function(_0xe05730){if(this[_0x96bf('0x21')][_0xe05730['uniqueid']]){this[_0x96bf('0x21')][_0xe05730[_0x96bf('0x22')]]['channelstate']=_0xe05730['channelstate'];this[_0x96bf('0x21')][_0xe05730[_0x96bf('0x22')]][_0x96bf('0x29')]=_0xe05730[_0x96bf('0x29')];}};Fax[_0x96bf('0x1b')]['syncNewExten']=function(_0x20e7c4){if(this[_0x96bf('0x21')][_0x20e7c4['uniqueid']]){for(var _0x35b2f6 in _0x20e7c4['variable']){if(_0x20e7c4[_0x96bf('0x28')][_0x96bf('0x1f')](_0x35b2f6)){this[_0x96bf('0x21')][_0x20e7c4['uniqueid']][_0x35b2f6]=_0x20e7c4['value'];}}}};Fax['prototype'][_0x96bf('0x16')]=function(_0x126eeb){if(this[_0x96bf('0x21')][_0x126eeb[_0x96bf('0x22')]]){this[_0x96bf('0x21')][_0x126eeb[_0x96bf('0x22')]][_0x96bf('0x2a')]=_0x126eeb[_0x96bf('0x2a')];this[_0x96bf('0x21')][_0x126eeb[_0x96bf('0x22')]]['status']=_0x126eeb[_0x96bf('0x2b')];this[_0x96bf('0x21')][_0x126eeb[_0x96bf('0x22')]]['localstationid']=_0x126eeb[_0x96bf('0x20')];this[_0x96bf('0x21')][_0x126eeb[_0x96bf('0x22')]][_0x96bf('0x2c')]=_0x126eeb['filename'];logger[_0x96bf('0x26')](_0x126eeb['uniqueid'],_0x96bf('0x2d'));}};Fax['prototype'][_0x96bf('0x17')]=function(_0x4595d5){var _0x4646c7=this;if(this[_0x96bf('0x21')][_0x4595d5[_0x96bf('0x22')]]){var _0x1cbeec=this[_0x96bf('0x21')][_0x4595d5[_0x96bf('0x22')]]['id'];this[_0x96bf('0x21')][_0x4595d5['uniqueid']][_0x96bf('0x2e')]=_0x4595d5['remotestationid'];this[_0x96bf('0x21')][_0x4595d5['uniqueid']]['pagestransferred']=_0x4595d5[_0x96bf('0x2f')];this[_0x96bf('0x21')][_0x4595d5[_0x96bf('0x22')]][_0x96bf('0x20')]=_0x4595d5['localstationid'];this[_0x96bf('0x21')][_0x4595d5[_0x96bf('0x22')]]['resolution']=_0x4595d5[_0x96bf('0x30')];this['channels'][_0x4595d5[_0x96bf('0x22')]]['transferrate']=_0x4595d5[_0x96bf('0x31')];this[_0x96bf('0x21')][_0x4595d5[_0x96bf('0x22')]][_0x96bf('0x2c')]=_0x4595d5['filename'];this[_0x96bf('0x21')][_0x4595d5[_0x96bf('0x22')]][_0x96bf('0x32')]=_0x4595d5[_0x96bf('0x32')];if(this[_0x96bf('0x21')][_0x4595d5[_0x96bf('0x22')]]['pagestransferred']>0x0){tiff2pdf(_0x4595d5[_0x96bf('0x2c')],_0x96bf('0x33'),function(_0x888bb){logger[_0x96bf('0x26')](_0x4595d5[_0x96bf('0x22')],'\x20result\x20conversion\x20file\x20',_0x888bb['message']);attachment[_0x96bf('0x34')]({'name':path[_0x96bf('0x35')](_0x4595d5[_0x96bf('0x2c')])[_0x96bf('0x24')],'basename':path[_0x96bf('0x35')](_0x4595d5[_0x96bf('0x2c')])[_0x96bf('0x24')]+_0x96bf('0x36'),'type':_0x96bf('0x37')})[_0x96bf('0x38')](function(_0x54546b){faxAccount[_0x96bf('0x39')](_0x1cbeec,{'from':_0x4595d5[_0x96bf('0x32')],'mapKey':_0x96bf('0x6'),'body':path[_0x96bf('0x35')](_0x4595d5[_0x96bf('0x2c')])[_0x96bf('0x24')]+_0x96bf('0x36'),'AttachmentId':_0x54546b['id']})[_0x96bf('0x3a')](function(_0x4d11b7){logger[_0x96bf('0x3b')](_0x4595d5['uniqueid'],_0x96bf('0x3c'),JSON['stringify'](_0x4d11b7));});})[_0x96bf('0x3a')](function(_0x5286de){logger[_0x96bf('0x3b')](_0x4595d5[_0x96bf('0x22')],'\x20receiveFax\x20',JSON[_0x96bf('0x3d')](_0x5286de));});});}logger[_0x96bf('0x26')](_0x4595d5[_0x96bf('0x22')],_0x96bf('0x3e'));}};Fax[_0x96bf('0x1b')][_0x96bf('0x1a')]=function(_0x3149c3){if(this[_0x96bf('0xf')][_0x3149c3[_0x96bf('0x22')]]){_['merge'](this[_0x96bf('0x21')][_0x3149c3[_0x96bf('0x22')]],_[_0x96bf('0x3f')](_0x3149c3,[_0x96bf('0x40'),'reason']));}};function updateStatus(_0x3ae7c1){if(_0x3ae7c1[_0x96bf('0x41')]){faxMessage['update'](_0x3ae7c1[_0x96bf('0x41')],{'failMessage':_0x96bf('0x42')})[_0x96bf('0x38')](function(_0x54e2a6){ut[_0x96bf('0x43')]('[Fax][Message][Error][Updated]',_0x54e2a6);})[_0x96bf('0x3a')](function(_0x5c4391){ut['logger'](_0x96bf('0x44'),_0x5c4391);});}else{ut[_0x96bf('0x43')](_0x96bf('0x45'));}}Fax[_0x96bf('0x1b')][_0x96bf('0x46')]=function(_0x58a65d,_0x4b5297,_0x3afb30){var _0x1b44b8=this;var _0x315571={};if(_0x4b5297){_0x315571={'read':_0x4b5297};}else{_0x315571={'failMessage':_0x3afb30};}if(this[_0x96bf('0xf')][_0x58a65d][_0x96bf('0x41')]){faxMessage[_0x96bf('0x47')](this[_0x96bf('0xf')][_0x58a65d][_0x96bf('0x41')],_0x315571)['then'](function(_0x2d1c6a){ut[_0x96bf('0x43')](_0x96bf('0x48'),_0x2d1c6a);})[_0x96bf('0x3a')](function(_0x102f35){ut[_0x96bf('0x43')](_0x96bf('0x49'),_0x102f35);})[_0x96bf('0x4a')](function(){delete _0x1b44b8['channels'][_0x58a65d];delete _0x1b44b8[_0x96bf('0xf')][_0x58a65d];});}else{ut[_0x96bf('0x43')](_0x96bf('0x4b'));delete this[_0x96bf('0x21')][_0x58a65d];delete this['actions'][_0x58a65d];}};Fax[_0x96bf('0x1b')][_0x96bf('0x19')]=function(_0x27ccb6){var _0x1a05c1=this;if(this[_0x96bf('0x21')][_0x27ccb6[_0x96bf('0x22')]]){if(this[_0x96bf('0xf')][_0x27ccb6[_0x96bf('0x22')]]){this['channels'][_0x27ccb6[_0x96bf('0x22')]]['id']=this[_0x96bf('0xf')][_0x27ccb6[_0x96bf('0x22')]]['id'];this[_0x96bf('0x21')][_0x27ccb6[_0x96bf('0x22')]][_0x96bf('0x24')]=this[_0x96bf('0xf')][_0x27ccb6[_0x96bf('0x22')]][_0x96bf('0x24')];}logger[_0x96bf('0x26')](_0x27ccb6['uniqueid'],this[_0x96bf('0xf')][_0x27ccb6[_0x96bf('0x22')]]?_0x96bf('0x4c'):_0x96bf('0x4d'),JSON[_0x96bf('0x3d')](this[_0x96bf('0x21')][_0x27ccb6[_0x96bf('0x22')]]));if(this[_0x96bf('0xf')][_0x27ccb6[_0x96bf('0x22')]]){if(this[_0x96bf('0x21')][_0x27ccb6[_0x96bf('0x22')]][_0x96bf('0x4e')]>0x0&&this[_0x96bf('0x21')][_0x27ccb6[_0x96bf('0x22')]]['faxstatus']===_0x96bf('0x4f')){this[_0x96bf('0x46')](_0x27ccb6['uniqueid'],!![]);}else{this[_0x96bf('0x46')](_0x27ccb6['uniqueid'],![],this[_0x96bf('0x21')][_0x27ccb6[_0x96bf('0x22')]][_0x96bf('0x50')]?_0x96bf('0x51')+this['channels'][_0x27ccb6[_0x96bf('0x22')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x96bf('0x1b')]['send']=function(_0x312ccb){var _0x17a9a8=this;return new BPromise(function(_0x2050bd,_0x58fbfd){_0x17a9a8[_0x96bf('0x52')](_0x312ccb,_0x17a9a8[_0x96bf('0xd')][_0x312ccb[_0x96bf('0x53')]])['then'](function(_0xb2e120){ut[_0x96bf('0x43')](_0x96bf('0x54'),_0xb2e120);_0x2050bd(ut[_0x96bf('0x55')](_0x96bf('0x56')));})['catch'](function(_0x39367e){ut[_0x96bf('0x43')]('[Fax][execOriginate][failure]',_0x39367e);updateStatus(_0x312ccb);_0x58fbfd(ut[_0x96bf('0x55')](_0x96bf('0x57')));});});};Fax[_0x96bf('0x1b')][_0x96bf('0x58')]=function(_0x48be11){var _0x31b3d0=this;return new BPromise(function(_0x42b55a,_0x15340e){var _0x3a0b09=_0x31b3d0[_0x96bf('0x59')](_0x31b3d0[_0x96bf('0xd')][_0x48be11[_0x96bf('0x53')]][_0x96bf('0x5a')],_0x48be11);if(_0x3a0b09[_0x96bf('0x5b')]){_0x42b55a(ut['message'](_0x96bf('0x5c')));}else{_0x15340e(ut[_0x96bf('0x55')](_0x3a0b09[_0x96bf('0x55')]));}});};function originate(_0x5f240c,_0x34db8a,_0xa0076){return new BPromise(function(_0x15ce03,_0x2b326b){if(_0xa0076){var _0x585eb3=util[_0x96bf('0x5d')](_0x96bf('0x5e'),path['parse'](_0x5f240c['path'])[_0x96bf('0x24')],_0x5f240c[_0x96bf('0x5f')]);gs[_0x96bf('0x60')](_0x585eb3)[_0x96bf('0x38')](function(){_0x5f240c[_0x96bf('0x5f')]=util['format'](_0x96bf('0x61'),path[_0x96bf('0x35')](_0x5f240c[_0x96bf('0x5f')])['dir'],path['parse'](_0x5f240c['path'])['name']);_0x34db8a[_0x96bf('0x62')]=_0x5f240c[_0x96bf('0x5f')];ut[_0x96bf('0x43')](_0x96bf('0x63'),'');ami[_0x96bf('0x64')](ut['variablesAction'](_0x5f240c,_0x34db8a))[_0x96bf('0x38')](function(_0x146e10){_0x15ce03(_0x146e10);})[_0x96bf('0x3a')](function(_0x5cde67){_0x2b326b(_0x5cde67);});})[_0x96bf('0x3a')](function(_0x122c61){_0x2b326b(_0x122c61);});}else{ami[_0x96bf('0x64')](ut['variablesAction'](_0x5f240c,_0x34db8a))[_0x96bf('0x38')](function(_0xd20219){_0x15ce03(_0xd20219);})[_0x96bf('0x3a')](function(_0x325c73){_0x2b326b(_0x325c73);});}});}Fax[_0x96bf('0x1b')][_0x96bf('0x52')]=function(_0x5dca6f,_0x462e5d){var _0x2b3150=this;return new BPromise(function(_0x4dffea,_0xef1ab5){var _0x2740b2=uuid['v4']();var _0x7cec90=ut[_0x96bf('0x65')](_0x5dca6f,_0x462e5d);_0x2b3150[_0x96bf('0xf')][_0x2740b2]=new Action(_0x2740b2,_0x462e5d,_0x5dca6f);var _0x5b52f3=_0x2b3150[_0x96bf('0xf')][_0x2740b2];if(path[_0x96bf('0x35')](_0x5dca6f[_0x96bf('0x5f')])[_0x96bf('0x66')]==='.pdf'){originate(_0x5b52f3,_0x7cec90,!![])[_0x96bf('0x38')](function(_0xfd918c){_0x4dffea(_0xfd918c);})[_0x96bf('0x3a')](function(_0x29983a){_0xef1ab5(_0x29983a);});}else{originate(_0x5b52f3,_0x7cec90,![])[_0x96bf('0x38')](function(_0x2a786b){_0x4dffea(_0x2a786b);})[_0x96bf('0x3a')](function(_0x2ff4f5){_0xef1ab5(_0x2ff4f5);});}});};Fax[_0x96bf('0x1b')][_0x96bf('0x67')]=function(_0x2015c0){return!_[_0x96bf('0x68')](_0x2015c0)&&!_['isNil'](_0x2015c0[_0x96bf('0x24')])&&!_[_0x96bf('0x68')](_0x2015c0[_0x96bf('0x69')])&&_0x2015c0[_0x96bf('0x69')]&&!_[_0x96bf('0x68')](this[_0x96bf('0xe')][util[_0x96bf('0x5d')](_0x96bf('0x6a'),_0x2015c0[_0x96bf('0x24')])])&&!_[_0x96bf('0x68')](this[_0x96bf('0xe')][util[_0x96bf('0x5d')]('SIP/%s',_0x2015c0['name'])][_0x96bf('0x2b')])&&(this[_0x96bf('0xe')][util[_0x96bf('0x5d')]('SIP/%s',_0x2015c0['name'])][_0x96bf('0x2b')]==='reachable'||this['trunks'][util[_0x96bf('0x5d')](_0x96bf('0x6a'),_0x2015c0[_0x96bf('0x24')])][_0x96bf('0x2b')]==='unmonitored');};Fax[_0x96bf('0x1b')][_0x96bf('0x59')]=function(_0x377d0d,_0xcb8539){if(!this[_0x96bf('0x67')](_0x377d0d)){ut['logger'](_0x96bf('0x6b'),_[_0x96bf('0x68')](_0x377d0d)?'':_0x377d0d[_0x96bf('0x24')]+_0x96bf('0x6c'));return{'isValid':![],'message':_0x96bf('0x6d')};}if(_[_0x96bf('0x68')](_0xcb8539['fax'])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0xcb8539));return{'isValid':![],'message':_0x96bf('0x6e')};}if(_[_0x96bf('0x68')](_0xcb8539['path'])){ut[_0x96bf('0x43')](_0x96bf('0x6f'),JSON[_0x96bf('0x3d')](_0xcb8539));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x96bf('0x70')};};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 a811bd4..d8a1e94 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 _0xf209=['then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve'];(function(_0x214070,_0x38277e){var _0x358944=function(_0x582963){while(--_0x582963){_0x214070['push'](_0x214070['shift']());}};_0x358944(++_0x38277e);}(_0xf209,0xe0));var _0x9f20=function(_0x8854f2,_0x79542c){_0x8854f2=_0x8854f2-0x0;var _0x38505d=_0xf209[_0x8854f2];return _0x38505d;};'use strict';var util=require(_0x9f20('0x0'));var BPromise=require(_0x9f20('0x1'));var logger=require(_0x9f20('0x2'))(_0x9f20('0x3'));var _=require(_0x9f20('0x4'));var faxAccount=require(_0x9f20('0x5'));function loggerCatch(_0x570e75){return function(_0x58fe02){logger[_0x9f20('0x6')](_0x570e75,util[_0x9f20('0x7')](_0x58fe02,{'showHidden':![],'depth':null}));};}exports[_0x9f20('0x8')]=function(_0x46f87d,_0x4809ea){return BPromise[_0x9f20('0x9')]()[_0x9f20('0xa')](faxAccount[_0x9f20('0x8')](_0x46f87d,_0x4809ea))[_0x9f20('0xb')](loggerCatch(_0x9f20('0xc')));}; \ No newline at end of file +var _0x009d=['../rpc/faxAccount','error','inspect','notify','resolve','[Notify]\x20','util','preview'];(function(_0x3c4a7c,_0x2f4e3c){var _0xf13d1e=function(_0x24cb78){while(--_0x24cb78){_0x3c4a7c['push'](_0x3c4a7c['shift']());}};_0xf13d1e(++_0x2f4e3c);}(_0x009d,0x1ee));var _0xd009=function(_0x49e123,_0x547830){_0x49e123=_0x49e123-0x0;var _0x1528cf=_0x009d[_0x49e123];return _0x1528cf;};'use strict';var util=require(_0xd009('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xd009('0x1'));var _=require('lodash');var faxAccount=require(_0xd009('0x2'));function loggerCatch(_0xcfca0){return function(_0x3493e0){logger[_0xd009('0x3')](_0xcfca0,util[_0xd009('0x4')](_0x3493e0,{'showHidden':![],'depth':null}));};}exports[_0xd009('0x5')]=function(_0x106558,_0x52c1bf){return BPromise[_0xd009('0x6')]()['then'](faxAccount[_0xd009('0x5')](_0x106558,_0x52c1bf))['catch'](loggerCatch(_0xd009('0x7')));}; \ 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 7b5bcea..3f90e97 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 _0x7fae=['util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x5850ae,_0x15db0b){var _0x232a73=function(_0x57820c){while(--_0x57820c){_0x5850ae['push'](_0x5850ae['shift']());}};_0x232a73(++_0x15db0b);}(_0x7fae,0xd1));var _0xe7fa=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x7fae[_0xa148b7];return _0x51efd3;};'use strict';var util=require(_0xe7fa('0x0'));var logger=require(_0xe7fa('0x1'))(_0xe7fa('0x2'));var BPromise=require(_0xe7fa('0x3'));var exec=require(_0xe7fa('0x4'))[_0xe7fa('0x5')];exports[_0xe7fa('0x6')]=function(_0x35251e){return new BPromise(function(_0x527448,_0x25d45d){exec(_0x35251e,function(_0x5ac4ef,_0x346fed,_0x2efc06){logger[_0xe7fa('0x7')](_0xe7fa('0x8'),_0x346fed);if(_0x5ac4ef){logger[_0xe7fa('0x7')](_0xe7fa('0x8'),_0xe7fa('0x9'),util[_0xe7fa('0xa')](_0x5ac4ef,{'showHidden':![],'depth':null}),_0x346fed,_0x2efc06);_0x25d45d(_0x5ac4ef);}_0x527448(_0x346fed);});});}; \ No newline at end of file +var _0x37ca=['bluebird','execute','info','Exec\x20gs','inspect','util','../../../../config/logger','fax'];(function(_0x21bf68,_0x267674){var _0x5d6bb2=function(_0x2bed76){while(--_0x2bed76){_0x21bf68['push'](_0x21bf68['shift']());}};_0x5d6bb2(++_0x267674);}(_0x37ca,0x185));var _0xa37c=function(_0xeb2efc,_0x26190c){_0xeb2efc=_0xeb2efc-0x0;var _0x4eb76a=_0x37ca[_0xeb2efc];return _0x4eb76a;};'use strict';var util=require(_0xa37c('0x0'));var logger=require(_0xa37c('0x1'))(_0xa37c('0x2'));var BPromise=require(_0xa37c('0x3'));var exec=require('child_process')['exec'];exports[_0xa37c('0x4')]=function(_0x4c8bbd){return new BPromise(function(_0x314886,_0x36d4b4){exec(_0x4c8bbd,function(_0x28554e,_0x4e0313,_0x407b4c){logger[_0xa37c('0x5')](_0xa37c('0x6'),_0x4e0313);if(_0x28554e){logger[_0xa37c('0x5')](_0xa37c('0x6'),'\x20Error\x20:',util[_0xa37c('0x7')](_0x28554e,{'showHidden':![],'depth':null}),_0x4e0313,_0x407b4c);_0x36d4b4(_0x28554e);}_0x314886(_0x4e0313);});});}; \ 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 bc6e2f2..ec6febd 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 _0x4e48=['addVariables','ecm','headerinfo','minrate','format','modem','gateway','t38timeout','localstationid','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','message','logger','info','inspect'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x4e48,0x83));var _0x84e4=function(_0x41df5b,_0x2251e0){_0x41df5b=_0x41df5b-0x0;var _0x3b503c=_0x4e48[_0x41df5b];return _0x3b503c;};'use strict';var util=require(_0x84e4('0x0'));var _=require(_0x84e4('0x1'));var moment=require(_0x84e4('0x2'));var logger=require('../../../../config/logger')('fax');exports[_0x84e4('0x3')]=function(_0x20a8a8){return{'message':_0x20a8a8};};exports[_0x84e4('0x4')]=function(_0x4c428a,_0x3b305e){logger[_0x84e4('0x5')](_0x4c428a,util[_0x84e4('0x6')](_0x3b305e,{'showHidden':![],'depth':null}));};exports[_0x84e4('0x7')]=function(_0x26670c,_0x4e4ddc){var _0x405fa2={'XMF-ECM':_0x4e4ddc[_0x84e4('0x8')],'XMF-HEADERINFO':_0x4e4ddc[_0x84e4('0x9')],'XMF-MINRATE':_0x4e4ddc[_0x84e4('0xa')],'XMF-MAXRATE':_0x4e4ddc['maxrate'],'XMF-MODEM':util[_0x84e4('0xb')]('\x22%s\x22',_0x4e4ddc[_0x84e4('0xc')]),'XMF-GATEWAY':_0x4e4ddc[_0x84e4('0xd')],'XMF-FAXDETECT':_0x4e4ddc['faxdetect'],'XMF-T38TIMEOUT':_0x4e4ddc[_0x84e4('0xe')],'XMF-LOCALSTATIONID':_0x4e4ddc[_0x84e4('0xf')],'XMF-PATH':_0x26670c['path']};return _0x405fa2;};exports[_0x84e4('0x10')]=function(_0x201656,_0x1686f1){return{'actionid':_0x201656[_0x84e4('0x11')],'action':_0x84e4('0x12'),'channel':_0x201656[_0x84e4('0x13')],'Exten':_0x84e4('0x14'),'Context':_0x84e4('0x15'),'Priority':'1','callerid':util[_0x84e4('0xb')](_0x84e4('0x16'),_0x201656[_0x84e4('0x9')]?_0x201656[_0x84e4('0x9')]:'',_0x201656[_0x84e4('0xf')]),'variable':_0x1686f1,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x201656[_0x84e4('0x11')]};}; \ No newline at end of file +var _0xa57b=['channel','format','headerinfo','uniqueid','util','lodash','fax','message','logger','info','inspect','addVariables','ecm','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction'];(function(_0x156ef5,_0xfae29a){var _0x142df3=function(_0x57c13d){while(--_0x57c13d){_0x156ef5['push'](_0x156ef5['shift']());}};_0x142df3(++_0xfae29a);}(_0xa57b,0xe0));var _0xba57=function(_0x1e6e14,_0x50ad67){_0x1e6e14=_0x1e6e14-0x0;var _0x3b83cb=_0xa57b[_0x1e6e14];return _0x3b83cb;};'use strict';var util=require(_0xba57('0x0'));var _=require(_0xba57('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0xba57('0x2'));exports[_0xba57('0x3')]=function(_0x15353b){return{'message':_0x15353b};};exports[_0xba57('0x4')]=function(_0x4df30b,_0x200465){logger[_0xba57('0x5')](_0x4df30b,util[_0xba57('0x6')](_0x200465,{'showHidden':![],'depth':null}));};exports[_0xba57('0x7')]=function(_0x162d2c,_0x5658d2){var _0x3c67c0={'XMF-ECM':_0x5658d2[_0xba57('0x8')],'XMF-HEADERINFO':_0x5658d2['headerinfo'],'XMF-MINRATE':_0x5658d2['minrate'],'XMF-MAXRATE':_0x5658d2[_0xba57('0x9')],'XMF-MODEM':util['format'](_0xba57('0xa'),_0x5658d2[_0xba57('0xb')]),'XMF-GATEWAY':_0x5658d2[_0xba57('0xc')],'XMF-FAXDETECT':_0x5658d2[_0xba57('0xd')],'XMF-T38TIMEOUT':_0x5658d2[_0xba57('0xe')],'XMF-LOCALSTATIONID':_0x5658d2[_0xba57('0xf')],'XMF-PATH':_0x162d2c[_0xba57('0x10')]};return _0x3c67c0;};exports[_0xba57('0x11')]=function(_0x384504,_0x35303f){return{'actionid':_0x384504['uniqueid'],'action':'originate','channel':_0x384504[_0xba57('0x12')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0xba57('0x13')]('\x22%s\x22\x20<%s>',_0x384504[_0xba57('0x14')]?_0x384504['headerinfo']:'',_0x384504[_0xba57('0xf')]),'variable':_0x35303f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x384504[_0xba57('0x15')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index c5a8623..36554b5 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 _0x92a4=['./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','hour','get','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','sync','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92a4,0x71));var _0x492a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x92a4[_0x138adb];return _0x1b27f2;};'use strict';var util=require('util');var moment=require('moment');var server=require(_0x492a('0x0'));var Realtime=require(_0x492a('0x1'));var Report=require(_0x492a('0x2'));var Acw=require(_0x492a('0x3'));var Trigger=require('./trigger');var Dialer=require(_0x492a('0x4'));var Preview=require(_0x492a('0x5'));var Fax=require(_0x492a('0x6'));var user=require(_0x492a('0x7'));var voiceQueue=require(_0x492a('0x8'));var voiceQueueReport=require(_0x492a('0x9'));var voiceCallReport=require(_0x492a('0xa'));var trunk=require(_0x492a('0xb'));var trigger=require(_0x492a('0xc'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x492a('0xd'));var voiceExtension=require(_0x492a('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x492a('0xf'));var salesforce=require(_0x492a('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x492a('0x11'));var desk=require(_0x492a('0x12'));var zoho=require(_0x492a('0x13'));var vtiger=require(_0x492a('0x14'));var freshsales=require(_0x492a('0x15'));var servicenow=require(_0x492a('0x16'));var dynamics365=require(_0x492a('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x492a('0x18'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x492a('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x492a('0x1a')](_0x492a('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x492a('0x1b')]()['then'](user['getAgents']())[_0x492a('0x1c')](realtime[_0x492a('0x1d')]())[_0x492a('0x1c')](user[_0x492a('0x1e')]())[_0x492a('0x1c')](realtime[_0x492a('0x1f')]())[_0x492a('0x1c')](trunk[_0x492a('0x20')]())[_0x492a('0x1c')](realtime['initTrunks']())[_0x492a('0x1c')](voiceQueue['getVoiceQueues']())[_0x492a('0x1c')](realtime[_0x492a('0x21')]())[_0x492a('0x1c')](trigger['getTriggers']())[_0x492a('0x1c')](realtime[_0x492a('0x22')]())['then'](template['getTemplates']())[_0x492a('0x1c')](realtime[_0x492a('0x23')]())[_0x492a('0x1c')](zendesk[_0x492a('0x24')]())[_0x492a('0x1c')](realtime['initZendeskAccounts']())[_0x492a('0x1c')](salesforce[_0x492a('0x25')]())[_0x492a('0x1c')](realtime[_0x492a('0x26')]())['then'](sugarcrm[_0x492a('0x27')]())[_0x492a('0x1c')](realtime[_0x492a('0x28')]())['then'](freshdesk[_0x492a('0x29')]())[_0x492a('0x1c')](realtime['initFreshdeskAccounts']())[_0x492a('0x1c')](desk[_0x492a('0x2a')]())[_0x492a('0x1c')](realtime['initDeskAccounts']())[_0x492a('0x1c')](zoho[_0x492a('0x2b')]())[_0x492a('0x1c')](realtime[_0x492a('0x2c')]())['then'](vtiger[_0x492a('0x2d')]())[_0x492a('0x1c')](realtime['initVtigerAccounts']())[_0x492a('0x1c')](freshsales['getFreshsalesAccounts']())[_0x492a('0x1c')](realtime[_0x492a('0x2e')]())[_0x492a('0x1c')](servicenow[_0x492a('0x2f')]())[_0x492a('0x1c')](realtime[_0x492a('0x30')]())[_0x492a('0x1c')](dynamics365[_0x492a('0x31')]())[_0x492a('0x1c')](realtime[_0x492a('0x32')]())[_0x492a('0x1c')](campaign['getCampaigns']())['then'](realtime['initCampaigns']())[_0x492a('0x1c')](voiceExtension['getVoiceExtensions']())[_0x492a('0x1c')](realtime[_0x492a('0x33')]())[_0x492a('0x1c')](faxAccount[_0x492a('0x34')]())[_0x492a('0x1c')](realtime[_0x492a('0x35')]())[_0x492a('0x1c')](function(){return realtime;});}function initParams(){return Promise[_0x492a('0x1b')]()[_0x492a('0x1c')](voiceQueueReport[_0x492a('0x36')]())[_0x492a('0x1c')](realtime[_0x492a('0x37')]())['then'](cmHopperHistory[_0x492a('0x38')]())[_0x492a('0x1c')](realtime[_0x492a('0x39')]())['then'](cmHopperHistory[_0x492a('0x3a')]())[_0x492a('0x1c')](realtime['initCampaignHopperHistory']())[_0x492a('0x1c')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x492a('0x3b')]())[_0x492a('0x3c')](function(_0x27eb4b){logger[_0x492a('0x3d')](_0x492a('0x3e'),util[_0x492a('0x3f')](_0x27eb4b,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x492a('0x1c')](function(){return initRealtime();})[_0x492a('0x1c')](function(){return initParams();})[_0x492a('0x1c')](function(){report[_0x492a('0x40')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x5bb602){logger[_0x492a('0x3d')]('[index.js][main]',util[_0x492a('0x3f')](_0x5bb602,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xaaef=['./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','../../config/logger','ami','get','hour','resolve','then','getAgents','getTelephones','initTelephones','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','error','inspect','listen','sync','util','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaaef,0x1a8));var _0xfaae=function(_0x4f52f4,_0x3b312f){_0x4f52f4=_0x4f52f4-0x0;var _0x15b473=_0xaaef[_0x4f52f4];return _0x15b473;};'use strict';var util=require(_0xfaae('0x0'));var moment=require('moment');var server=require(_0xfaae('0x1'));var Realtime=require(_0xfaae('0x2'));var Report=require(_0xfaae('0x3'));var Acw=require(_0xfaae('0x4'));var Trigger=require(_0xfaae('0x5'));var Dialer=require(_0xfaae('0x6'));var Preview=require(_0xfaae('0x7'));var Fax=require('./fax');var user=require(_0xfaae('0x8'));var voiceQueue=require(_0xfaae('0x9'));var voiceQueueReport=require(_0xfaae('0xa'));var voiceCallReport=require(_0xfaae('0xb'));var trunk=require('./rpc/trunk');var trigger=require(_0xfaae('0xc'));var template=require(_0xfaae('0xd'));var cmHopperHistory=require(_0xfaae('0xe'));var campaign=require(_0xfaae('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xfaae('0x10'));var zendesk=require(_0xfaae('0x11'));var salesforce=require(_0xfaae('0x12'));var sugarcrm=require(_0xfaae('0x13'));var freshdesk=require(_0xfaae('0x14'));var desk=require(_0xfaae('0x15'));var zoho=require(_0xfaae('0x16'));var vtiger=require(_0xfaae('0x17'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xfaae('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xfaae('0x19'))(_0xfaae('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xfaae('0x1b')](_0xfaae('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xfaae('0x1b')](_0xfaae('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xfaae('0x1d')]()[_0xfaae('0x1e')](user[_0xfaae('0x1f')]())[_0xfaae('0x1e')](realtime['initAgents']())[_0xfaae('0x1e')](user[_0xfaae('0x20')]())[_0xfaae('0x1e')](realtime[_0xfaae('0x21')]())[_0xfaae('0x1e')](trunk['getTrunks']())[_0xfaae('0x1e')](realtime[_0xfaae('0x22')]())[_0xfaae('0x1e')](voiceQueue['getVoiceQueues']())[_0xfaae('0x1e')](realtime[_0xfaae('0x23')]())[_0xfaae('0x1e')](trigger[_0xfaae('0x24')]())[_0xfaae('0x1e')](realtime[_0xfaae('0x25')]())[_0xfaae('0x1e')](template[_0xfaae('0x26')]())[_0xfaae('0x1e')](realtime[_0xfaae('0x27')]())['then'](zendesk['getZendeskAccounts']())[_0xfaae('0x1e')](realtime[_0xfaae('0x28')]())[_0xfaae('0x1e')](salesforce[_0xfaae('0x29')]())['then'](realtime['initSalesforceAccounts']())[_0xfaae('0x1e')](sugarcrm[_0xfaae('0x2a')]())[_0xfaae('0x1e')](realtime[_0xfaae('0x2b')]())[_0xfaae('0x1e')](freshdesk[_0xfaae('0x2c')]())[_0xfaae('0x1e')](realtime[_0xfaae('0x2d')]())['then'](desk[_0xfaae('0x2e')]())[_0xfaae('0x1e')](realtime[_0xfaae('0x2f')]())[_0xfaae('0x1e')](zoho['getZohoAccounts']())[_0xfaae('0x1e')](realtime[_0xfaae('0x30')]())[_0xfaae('0x1e')](vtiger[_0xfaae('0x31')]())[_0xfaae('0x1e')](realtime[_0xfaae('0x32')]())[_0xfaae('0x1e')](freshsales[_0xfaae('0x33')]())[_0xfaae('0x1e')](realtime[_0xfaae('0x34')]())[_0xfaae('0x1e')](servicenow[_0xfaae('0x35')]())[_0xfaae('0x1e')](realtime[_0xfaae('0x36')]())[_0xfaae('0x1e')](dynamics365[_0xfaae('0x37')]())[_0xfaae('0x1e')](realtime[_0xfaae('0x38')]())[_0xfaae('0x1e')](campaign[_0xfaae('0x39')]())[_0xfaae('0x1e')](realtime[_0xfaae('0x3a')]())['then'](voiceExtension[_0xfaae('0x3b')]())['then'](realtime[_0xfaae('0x3c')]())['then'](faxAccount['getFaxAccounts']())[_0xfaae('0x1e')](realtime[_0xfaae('0x3d')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0xfaae('0x1d')]()[_0xfaae('0x1e')](voiceQueueReport[_0xfaae('0x3e')]())['then'](realtime[_0xfaae('0x3f')]())[_0xfaae('0x1e')](cmHopperHistory[_0xfaae('0x40')]())['then'](realtime[_0xfaae('0x41')]())[_0xfaae('0x1e')](cmHopperHistory[_0xfaae('0x42')]())[_0xfaae('0x1e')](realtime[_0xfaae('0x43')]())[_0xfaae('0x1e')](voiceCallReport[_0xfaae('0x44')]())['then'](realtime['initVoiceCallReports']())['catch'](function(_0x51e507){logger[_0xfaae('0x45')]('[index.js][initParams]',util[_0xfaae('0x46')](_0x51e507,{'showHidden':![],'depth':null}));});}function main(){return server[_0xfaae('0x47')](realtime,preview,fax)[_0xfaae('0x1e')](function(){return initRealtime();})[_0xfaae('0x1e')](function(){return initParams();})[_0xfaae('0x1e')](function(){report[_0xfaae('0x48')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x197281){logger[_0xfaae('0x45')]('[index.js][main]',util[_0xfaae('0x46')](_0x197281,{'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 32df9bb..120453c 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 _0x7397=['state','stateTime','status','address','phone','interface','online','voiceStatus','unknown','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','talking','statePause','toNumber','format','stringify','emit','user:ami:update','user:presence','exports','lodash','util','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname'];(function(_0x14a731,_0x38be9b){var _0x324e00=function(_0x334ab0){while(--_0x334ab0){_0x14a731['push'](_0x14a731['shift']());}};_0x324e00(++_0x38be9b);}(_0x7397,0xbc));var _0x7739=function(_0x3bb7d4,_0x1cc2a8){_0x3bb7d4=_0x3bb7d4-0x0;var _0x3293d4=_0x7397[_0x3bb7d4];return _0x3293d4;};'use strict';var _=require(_0x7739('0x0'));var util=require(_0x7739('0x1'));var moment=require('moment');var md5=require(_0x7739('0x2'));var Redis=require(_0x7739('0x3'));var config=require(_0x7739('0x4'));config[_0x7739('0x5')]=_[_0x7739('0x6')](config[_0x7739('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x7739('0x7'))(new Redis(config[_0x7739('0x5')]));function Agent(_0xaa8c05){this['id']=_0xaa8c05['id']||0x0;this[_0x7739('0x8')]=_0xaa8c05[_0x7739('0x8')]||'';this['email']=_0xaa8c05[_0x7739('0x9')]||'';this[_0x7739('0xa')]=_0xaa8c05[_0x7739('0xa')]||'';this[_0x7739('0xb')]=_0xaa8c05[_0x7739('0xb')]||'';this[_0x7739('0xc')]='unknown';this[_0x7739('0xd')]=0x0;this[_0x7739('0xe')]='unknown';this[_0x7739('0xf')]='';this[_0x7739('0x10')]='';this['mobile']='';this[_0x7739('0x11')]='';this[_0x7739('0x12')]=_0xaa8c05['online']||![];this[_0x7739('0x13')]=_0x7739('0x14');this[_0x7739('0x15')]=0x0;this[_0x7739('0x16')]='';this[_0x7739('0x17')]='';this[_0x7739('0x18')]=![];this[_0x7739('0x19')]=![];this[_0x7739('0x2')]='';}Agent[_0x7739('0x1a')][_0x7739('0x1b')]=function(_0x3fc748){var _0x2224b7;if(_0x3fc748&&_0x3fc748['state']){_0x2224b7=_0x3fc748[_0x7739('0xc')][_0x7739('0x1c')]();switch(_0x2224b7){case _0x7739('0x1d'):_0x2224b7=_0x7739('0x1e');break;case'inuse':_0x2224b7=_0x7739('0x1f');break;}}if(_0x2224b7&&this[_0x7739('0x13')]!==_0x2224b7||_0x3fc748[_0x7739('0x20')]){this[_0x7739('0x15')]=_[_0x7739('0x21')](moment()[_0x7739('0x22')]('x'));}if(_0x2224b7){this[_0x7739('0x13')]=_0x2224b7;}var _0x53b47e={'id':this['id'],'name':this[_0x7739('0x8')],'email':this[_0x7739('0x9')],'accountcode':this[_0x7739('0xa')],'fullname':this['fullname'],'state':this[_0x7739('0xc')],'stateTime':this['stateTime'],'status':this[_0x7739('0xe')],'address':this[_0x7739('0xf')],'online':this[_0x7739('0x12')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x7739('0x15')],'voiceStatusCallerIdNumber':this[_0x7739('0x16')],'voiceStatusQueue':this[_0x7739('0x17')],'interface':this['interface'],'onhold':this[_0x7739('0x18')]};var _0x2e9b2b=md5(JSON[_0x7739('0x23')](_0x53b47e));if(this[_0x7739('0x2')]!==_0x2e9b2b){this[_0x7739('0x2')]=_0x2e9b2b;io['to'](util['format']('user:%s',_0x53b47e[_0x7739('0x8')]))[_0x7739('0x24')](_0x7739('0x25'),_['omit'](_0x53b47e,[_0x7739('0x12')]));io[_0x7739('0x24')](_0x7739('0x26'),_0x53b47e);}};module[_0x7739('0x27')]=Agent; \ No newline at end of file +var _0x7354=['interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','format','status','stringify','user:ami:update','omit','emit','exports','util','moment','md5','../../../config/environment','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','address','phone','mobile'];(function(_0x20b966,_0x1cf3ad){var _0x14b006=function(_0x285af1){while(--_0x285af1){_0x20b966['push'](_0x20b966['shift']());}};_0x14b006(++_0x1cf3ad);}(_0x7354,0x150));var _0x4735=function(_0x7c13ed,_0x4d9dd5){_0x7c13ed=_0x7c13ed-0x0;var _0x4cad66=_0x7354[_0x7c13ed];return _0x4cad66;};'use strict';var _=require('lodash');var util=require(_0x4735('0x0'));var moment=require(_0x4735('0x1'));var md5=require(_0x4735('0x2'));var Redis=require('ioredis');var config=require(_0x4735('0x3'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x4735('0x4'))(new Redis(config['redis']));function Agent(_0x454fbd){this['id']=_0x454fbd['id']||0x0;this[_0x4735('0x5')]=_0x454fbd[_0x4735('0x5')]||'';this[_0x4735('0x6')]=_0x454fbd[_0x4735('0x6')]||'';this['accountcode']=_0x454fbd[_0x4735('0x7')]||'';this['fullname']=_0x454fbd[_0x4735('0x8')]||'';this[_0x4735('0x9')]=_0x4735('0xa');this[_0x4735('0xb')]=0x0;this['status']=_0x4735('0xa');this[_0x4735('0xc')]='';this[_0x4735('0xd')]='';this[_0x4735('0xe')]='';this[_0x4735('0xf')]='';this[_0x4735('0x10')]=_0x454fbd[_0x4735('0x10')]||![];this[_0x4735('0x11')]=_0x4735('0xa');this[_0x4735('0x12')]=0x0;this[_0x4735('0x13')]='';this[_0x4735('0x14')]='';this[_0x4735('0x15')]=![];this[_0x4735('0x16')]=![];this[_0x4735('0x2')]='';}Agent[_0x4735('0x17')][_0x4735('0x18')]=function(_0x4050b2){var _0x39bd1c;if(_0x4050b2&&_0x4050b2['state']){_0x39bd1c=_0x4050b2[_0x4735('0x9')][_0x4735('0x19')]();switch(_0x39bd1c){case _0x4735('0x1a'):_0x39bd1c=_0x4735('0x1b');break;case _0x4735('0x1c'):_0x39bd1c=_0x4735('0x1d');break;}}if(_0x39bd1c&&this['voiceStatus']!==_0x39bd1c||_0x4050b2[_0x4735('0x1e')]){this['voiceStatusTime']=_[_0x4735('0x1f')](moment()[_0x4735('0x20')]('x'));}if(_0x39bd1c){this[_0x4735('0x11')]=_0x39bd1c;}var _0x148a85={'id':this['id'],'name':this[_0x4735('0x5')],'email':this['email'],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x4735('0x9')],'stateTime':this[_0x4735('0xb')],'status':this[_0x4735('0x21')],'address':this[_0x4735('0xc')],'online':this[_0x4735('0x10')],'voiceStatus':this[_0x4735('0x11')],'voiceStatusTime':this[_0x4735('0x12')],'voiceStatusCallerIdNumber':this[_0x4735('0x13')],'voiceStatusQueue':this[_0x4735('0x14')],'interface':this[_0x4735('0xf')],'onhold':this['onhold']};var _0x276fb2=md5(JSON[_0x4735('0x22')](_0x148a85));if(this[_0x4735('0x2')]!==_0x276fb2){this[_0x4735('0x2')]=_0x276fb2;io['to'](util[_0x4735('0x20')]('user:%s',_0x148a85[_0x4735('0x5')]))['emit'](_0x4735('0x23'),_[_0x4735('0x24')](_0x148a85,['online']));io[_0x4735('0x25')]('user:presence',_0x148a85);}};module[_0x4735('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 71149f7..44f3578 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 _0x089e=['name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports'];(function(_0x319d24,_0x5a394a){var _0x303128=function(_0x797542){while(--_0x797542){_0x319d24['push'](_0x319d24['shift']());}};_0x303128(++_0x5a394a);}(_0x089e,0x96));var _0xe089=function(_0x5bb56e,_0xa87aec){_0x5bb56e=_0x5bb56e-0x0;var _0x13ab69=_0x089e[_0x5bb56e];return _0x13ab69;};'use strict';function Campaign(_0x5d437f){this['id']=_0x5d437f['id']||0x0;this['name']=_0x5d437f[_0xe089('0x0')]||'';this['type']=_0x5d437f[_0xe089('0x1')]||_0xe089('0x2');this[_0xe089('0x3')]=0x0;this[_0xe089('0x4')]=0x0;this[_0xe089('0x5')]=0x0;this[_0xe089('0x6')]=0x0;this[_0xe089('0x7')]='';this[_0xe089('0x8')]=!![];this[_0xe089('0x9')]=_0x5d437f['active'];this[_0xe089('0xa')]=_0x5d437f['limitCalls'];this[_0xe089('0xb')]=_0x5d437f[_0xe089('0xb')]||null;this[_0xe089('0xc')]=_0x5d437f['dialGlobalInterval']?_0x5d437f[_0xe089('0xc')]:null;this[_0xe089('0xd')]=_0x5d437f[_0xe089('0xd')];this['dialOriginateCallerIdNumber']=_0x5d437f[_0xe089('0xe')];this[_0xe089('0xf')]=_0x5d437f[_0xe089('0xf')]||0x1e;this['dialCongestionMaxRetry']=_0x5d437f[_0xe089('0x10')];this['dialCongestionRetryFrequency']=_0x5d437f['dialCongestionRetryFrequency'];this[_0xe089('0x11')]=_0x5d437f[_0xe089('0x11')];this[_0xe089('0x12')]=_0x5d437f[_0xe089('0x12')];this[_0xe089('0x13')]=_0x5d437f[_0xe089('0x13')];this[_0xe089('0x14')]=_0x5d437f['dialNoAnswerRetryFrequency'];this[_0xe089('0x15')]=_0x5d437f[_0xe089('0x15')];this['dialNoSuchNumberMaxRetry']=_0x5d437f['dialNoSuchNumberMaxRetry']||0x3;this[_0xe089('0x16')]=_0x5d437f[_0xe089('0x16')]||0x96;this[_0xe089('0x17')]=_0x5d437f[_0xe089('0x17')]||0x3;this[_0xe089('0x18')]=_0x5d437f['dialDropRetryFrequency']||0x96;this[_0xe089('0x19')]=_0x5d437f[_0xe089('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x5d437f[_0xe089('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x5d437f['dialMachineMaxRetry']||0x3;this[_0xe089('0x1b')]=_0x5d437f[_0xe089('0x1b')]||0x96;this[_0xe089('0x1c')]=_0x5d437f[_0xe089('0x1c')]||0x3;this[_0xe089('0x1d')]=_0x5d437f[_0xe089('0x1d')]||0x96;this[_0xe089('0x1e')]=_0x5d437f['dialOrderByScheduledAt']||_0xe089('0x1f');this[_0xe089('0x20')]=_0x5d437f['dialPrefix']||undefined;this[_0xe089('0x21')]=_0x5d437f[_0xe089('0x21')]||undefined;this[_0xe089('0x22')]=_0x5d437f[_0xe089('0x22')]||undefined;this[_0xe089('0x23')]=_0x5d437f[_0xe089('0x23')]?_0x5d437f['TrunkBackup']:undefined;this[_0xe089('0x24')]=_0x5d437f[_0xe089('0x24')]?_0x5d437f['Trunk']:undefined;this[_0xe089('0x25')]=_0x5d437f[_0xe089('0x25')]?_0x5d437f[_0xe089('0x25')]:undefined;this[_0xe089('0x26')]=_0x5d437f[_0xe089('0x26')]?_0x5d437f['SquareProject']:undefined;this[_0xe089('0x27')]=_0x5d437f[_0xe089('0x26')]?_0x5d437f[_0xe089('0x26')][_0xe089('0x0')]:undefined;this[_0xe089('0x28')]=_0x5d437f[_0xe089('0x28')]||![];this[_0xe089('0x29')]=_0x5d437f[_0xe089('0x29')];this[_0xe089('0x2a')]=_0x5d437f[_0xe089('0x2a')];this[_0xe089('0x2b')]=_0x5d437f[_0xe089('0x2b')];this['dialAMDTotalAnalysisTime']=_0x5d437f[_0xe089('0x2c')];this['dialAMDMinWordLength']=_0x5d437f['dialAMDMinWordLength'];this[_0xe089('0x2d')]=_0x5d437f[_0xe089('0x2d')];this[_0xe089('0x2e')]=_0x5d437f['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x5d437f[_0xe089('0x2f')];this[_0xe089('0x30')]=_0x5d437f[_0xe089('0x30')];}module[_0xe089('0x31')]=Campaign; \ No newline at end of file +var _0x5b47=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x120175,_0x252b75){var _0x4e5a97=function(_0x40dbbe){while(--_0x40dbbe){_0x120175['push'](_0x120175['shift']());}};_0x4e5a97(++_0x252b75);}(_0x5b47,0x11c));var _0x75b4=function(_0xe5d503,_0x8e592c){_0xe5d503=_0xe5d503-0x0;var _0x33c4ba=_0x5b47[_0xe5d503];return _0x33c4ba;};'use strict';function Campaign(_0x51c1a1){this['id']=_0x51c1a1['id']||0x0;this[_0x75b4('0x0')]=_0x51c1a1['name']||'';this['type']=_0x51c1a1[_0x75b4('0x1')]||_0x75b4('0x2');this[_0x75b4('0x3')]=0x0;this[_0x75b4('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x75b4('0x5')]=0x0;this[_0x75b4('0x6')]='';this[_0x75b4('0x7')]=!![];this[_0x75b4('0x8')]=_0x51c1a1[_0x75b4('0x8')];this['limitCalls']=_0x51c1a1['limitCalls'];this[_0x75b4('0x9')]=_0x51c1a1[_0x75b4('0x9')]||null;this[_0x75b4('0xa')]=_0x51c1a1['dialGlobalInterval']?_0x51c1a1[_0x75b4('0xa')]:null;this[_0x75b4('0xb')]=_0x51c1a1[_0x75b4('0xb')];this[_0x75b4('0xc')]=_0x51c1a1[_0x75b4('0xc')];this[_0x75b4('0xd')]=_0x51c1a1[_0x75b4('0xd')]||0x1e;this[_0x75b4('0xe')]=_0x51c1a1[_0x75b4('0xe')];this['dialCongestionRetryFrequency']=_0x51c1a1[_0x75b4('0xf')];this['dialBusyMaxRetry']=_0x51c1a1[_0x75b4('0x10')];this[_0x75b4('0x11')]=_0x51c1a1[_0x75b4('0x11')];this[_0x75b4('0x12')]=_0x51c1a1[_0x75b4('0x12')];this['dialNoAnswerRetryFrequency']=_0x51c1a1[_0x75b4('0x13')];this[_0x75b4('0x14')]=_0x51c1a1['dialGlobalMaxRetry'];this[_0x75b4('0x15')]=_0x51c1a1[_0x75b4('0x15')]||0x3;this[_0x75b4('0x16')]=_0x51c1a1[_0x75b4('0x16')]||0x96;this[_0x75b4('0x17')]=_0x51c1a1[_0x75b4('0x17')]||0x3;this['dialDropRetryFrequency']=_0x51c1a1[_0x75b4('0x18')]||0x96;this[_0x75b4('0x19')]=_0x51c1a1[_0x75b4('0x19')]||0x3;this[_0x75b4('0x1a')]=_0x51c1a1[_0x75b4('0x1a')]||0x96;this[_0x75b4('0x1b')]=_0x51c1a1[_0x75b4('0x1b')]||0x3;this[_0x75b4('0x1c')]=_0x51c1a1[_0x75b4('0x1c')]||0x96;this[_0x75b4('0x1d')]=_0x51c1a1['dialAgentRejectMaxRetry']||0x3;this[_0x75b4('0x1e')]=_0x51c1a1['dialAgentRejectRetryFrequency']||0x96;this[_0x75b4('0x1f')]=_0x51c1a1[_0x75b4('0x1f')]||_0x75b4('0x20');this[_0x75b4('0x21')]=_0x51c1a1[_0x75b4('0x21')]||undefined;this[_0x75b4('0x22')]=_0x51c1a1[_0x75b4('0x22')]||undefined;this[_0x75b4('0x23')]=_0x51c1a1['dialCutDigit']||undefined;this[_0x75b4('0x24')]=_0x51c1a1[_0x75b4('0x24')]?_0x51c1a1[_0x75b4('0x24')]:undefined;this[_0x75b4('0x25')]=_0x51c1a1[_0x75b4('0x25')]?_0x51c1a1[_0x75b4('0x25')]:undefined;this[_0x75b4('0x26')]=_0x51c1a1['Interval']?_0x51c1a1[_0x75b4('0x26')]:undefined;this[_0x75b4('0x27')]=_0x51c1a1[_0x75b4('0x27')]?_0x51c1a1[_0x75b4('0x27')]:undefined;this[_0x75b4('0x28')]=_0x51c1a1['SquareProject']?_0x51c1a1['SquareProject'][_0x75b4('0x0')]:undefined;this[_0x75b4('0x29')]=_0x51c1a1['dialAMDActive']||![];this[_0x75b4('0x2a')]=_0x51c1a1['dialAMDInitialSilence'];this[_0x75b4('0x2b')]=_0x51c1a1[_0x75b4('0x2b')];this[_0x75b4('0x2c')]=_0x51c1a1[_0x75b4('0x2c')];this[_0x75b4('0x2d')]=_0x51c1a1[_0x75b4('0x2d')];this[_0x75b4('0x2e')]=_0x51c1a1['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x51c1a1[_0x75b4('0x2f')];this['dialAMDMaximumNumberOfWords']=_0x51c1a1[_0x75b4('0x30')];this['dialAMDSilenceThreshold']=_0x51c1a1[_0x75b4('0x31')];this[_0x75b4('0x32')]=_0x51c1a1[_0x75b4('0x32')];}module[_0x75b4('0x33')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index d7a6720..e731020 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 _0x9d62=['connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname'];(function(_0x3517c9,_0x165394){var _0x15b3cf=function(_0x5472a0){while(--_0x5472a0){_0x3517c9['push'](_0x3517c9['shift']());}};_0x15b3cf(++_0x165394);}(_0x9d62,0xaf));var _0x29d6=function(_0xa5f4ee,_0x391ca0){_0xa5f4ee=_0xa5f4ee-0x0;var _0x36b64c=_0x9d62[_0xa5f4ee];return _0x36b64c;};'use strict';function Channel(){this[_0x29d6('0x0')]=null;this[_0x29d6('0x1')]='';this[_0x29d6('0x2')]='';this[_0x29d6('0x3')]=0x0;this[_0x29d6('0x4')]='';this['connectedlinenum']=undefined;this[_0x29d6('0x5')]=undefined;this[_0x29d6('0x6')]=0x0;this[_0x29d6('0x7')]='';this[_0x29d6('0x8')]=0x0;this[_0x29d6('0x9')]=0x0;this['exten']=0x0;this[_0x29d6('0xa')]=![];this[_0x29d6('0xb')]=null;this[_0x29d6('0xc')]=null;this[_0x29d6('0xd')]=![];this[_0x29d6('0xe')]=![];this[_0x29d6('0xf')]='';this['lastdata']='';this[_0x29d6('0x10')]=0x0;this[_0x29d6('0x11')]=0x0;this[_0x29d6('0x12')]=0x0;this[_0x29d6('0x13')]=null;this[_0x29d6('0x14')]=null;this[_0x29d6('0x15')]=null;this[_0x29d6('0x16')]=![];this[_0x29d6('0x17')]=null;this['queue']=null;this[_0x29d6('0x18')]=[];this[_0x29d6('0x19')]=undefined;this[_0x29d6('0x1a')]=undefined;this[_0x29d6('0x1b')]=undefined;this[_0x29d6('0x1c')]=0x0;}module[_0x29d6('0x1d')]=Channel; \ No newline at end of file +var _0xfb8a=['monitor','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','type','disposition'];(function(_0x88f4d9,_0x3185b6){var _0x5b5b3c=function(_0x34c91a){while(--_0x34c91a){_0x88f4d9['push'](_0x88f4d9['shift']());}};_0x5b5b3c(++_0x3185b6);}(_0xfb8a,0x109));var _0xafb8=function(_0x1297c7,_0x1ff2a5){_0x1297c7=_0x1297c7-0x0;var _0x5c1916=_0xfb8a[_0x1297c7];return _0x5c1916;};'use strict';function Channel(){this[_0xafb8('0x0')]=null;this[_0xafb8('0x1')]='';this[_0xafb8('0x2')]='';this[_0xafb8('0x3')]=0x0;this['calleridname']='';this[_0xafb8('0x4')]=undefined;this['connectedlinename']=undefined;this[_0xafb8('0x5')]=0x0;this[_0xafb8('0x6')]='';this[_0xafb8('0x7')]=0x0;this[_0xafb8('0x8')]=0x0;this[_0xafb8('0x9')]=0x0;this[_0xafb8('0xa')]=![];this[_0xafb8('0xb')]=null;this[_0xafb8('0xc')]=null;this[_0xafb8('0xd')]=![];this[_0xafb8('0xe')]=![];this[_0xafb8('0xf')]='';this[_0xafb8('0x10')]='';this[_0xafb8('0x11')]=0x0;this[_0xafb8('0x12')]=0x0;this['holdtime']=0x0;this[_0xafb8('0x13')]=null;this['tag']=null;this[_0xafb8('0x14')]=null;this[_0xafb8('0x15')]=![];this['monitorFilename']=null;this['queue']=null;this['monitors']=[];this[_0xafb8('0x16')]=undefined;this[_0xafb8('0x17')]=undefined;this[_0xafb8('0x18')]=undefined;this['mohtime']=0x0;}module[_0xafb8('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index d4daafa..01755c1 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 _0xc295=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x69fb6a,_0x46ec8d){var _0x2faee2=function(_0x56b079){while(--_0x56b079){_0x69fb6a['push'](_0x69fb6a['shift']());}};_0x2faee2(++_0x46ec8d);}(_0xc295,0x101));var _0x5c29=function(_0x5ec565,_0x266986){_0x5ec565=_0x5ec565-0x0;var _0x1667c3=_0xc295[_0x5ec565];return _0x1667c3;};'use strict';function DeskAccount(_0x45964e){this['id']=_0x45964e['id']||0x0;this['name']=_0x45964e[_0x5c29('0x0')]||'';this[_0x5c29('0x1')]=_0x45964e['username']||'';this[_0x5c29('0x2')]=_0x45964e[_0x5c29('0x2')]||'';this[_0x5c29('0x3')]=_0x45964e[_0x5c29('0x3')]||'';this[_0x5c29('0x4')]=_0x45964e['password']||'';this[_0x5c29('0x5')]=_0x45964e[_0x5c29('0x5')]||'';this[_0x5c29('0x6')]=_0x45964e[_0x5c29('0x6')]||'';this['token']=_0x45964e[_0x5c29('0x7')]||'';this[_0x5c29('0x8')]=_0x45964e['tokenSecret']||'';this['type']=_0x45964e[_0x5c29('0x9')]||'';this[_0x5c29('0xa')]=_0x45964e['serverUrl']||'';this['Configurations']=_0x45964e[_0x5c29('0xb')]||{};}module[_0x5c29('0xc')]=DeskAccount; \ No newline at end of file +var _0x21c4=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0x4f7bff,_0x2416cd){var _0x4bf992=function(_0x383a07){while(--_0x383a07){_0x4f7bff['push'](_0x4f7bff['shift']());}};_0x4bf992(++_0x2416cd);}(_0x21c4,0x18f));var _0x421c=function(_0xf56b46,_0x4e32e8){_0xf56b46=_0xf56b46-0x0;var _0x583cea=_0x21c4[_0xf56b46];return _0x583cea;};'use strict';function DeskAccount(_0x48fa20){this['id']=_0x48fa20['id']||0x0;this[_0x421c('0x0')]=_0x48fa20[_0x421c('0x0')]||'';this['username']=_0x48fa20[_0x421c('0x1')]||'';this[_0x421c('0x2')]=_0x48fa20[_0x421c('0x2')]||'';this[_0x421c('0x3')]=_0x48fa20[_0x421c('0x3')]||'';this[_0x421c('0x4')]=_0x48fa20[_0x421c('0x4')]||'';this[_0x421c('0x5')]=_0x48fa20['consumerKey']||'';this[_0x421c('0x6')]=_0x48fa20[_0x421c('0x6')]||'';this['token']=_0x48fa20[_0x421c('0x7')]||'';this[_0x421c('0x8')]=_0x48fa20[_0x421c('0x8')]||'';this['type']=_0x48fa20[_0x421c('0x9')]||'';this[_0x421c('0xa')]=_0x48fa20['serverUrl']||'';this[_0x421c('0xb')]=_0x48fa20[_0x421c('0xb')]||{};}module[_0x421c('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index f26c1b3..430cfed 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 _0xd12e=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','CloudProvider','exports'];(function(_0x5c3406,_0xca2423){var _0x5afe5b=function(_0x2e7048){while(--_0x2e7048){_0x5c3406['push'](_0x5c3406['shift']());}};_0x5afe5b(++_0xca2423);}(_0xd12e,0x14a));var _0xed12=function(_0x2aa6e6,_0x44abb0){_0x2aa6e6=_0x2aa6e6-0x0;var _0x2cb7f0=_0xd12e[_0x2aa6e6];return _0x2cb7f0;};'use strict';function Dynamics365Account(_0x45e280){this['id']=_0x45e280['id']||0x0;this[_0xed12('0x0')]=_0x45e280['name']||'';this[_0xed12('0x1')]=_0x45e280[_0xed12('0x1')]||'';this[_0xed12('0x2')]=_0x45e280[_0xed12('0x2')]||'';this[_0xed12('0x3')]=_0x45e280[_0xed12('0x3')]||'';this[_0xed12('0x4')]=_0x45e280[_0xed12('0x4')]||'';this[_0xed12('0x5')]=_0x45e280[_0xed12('0x5')]||'';this[_0xed12('0x6')]=_0x45e280['clientSecret']||{};this[_0xed12('0x7')]=_0x45e280[_0xed12('0x7')]||'';this['modernAuthentication']=_0x45e280['modernAuthentication']||![];this['Configurations']=_0x45e280['Configurations']||{};this[_0xed12('0x8')]=_0x45e280[_0xed12('0x8')]||{};}module[_0xed12('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x73b9=['exports','name','username','password','remoteUri','tenantId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x9edfd5,_0x286486){var _0x330738=function(_0x4aceb3){while(--_0x4aceb3){_0x9edfd5['push'](_0x9edfd5['shift']());}};_0x330738(++_0x286486);}(_0x73b9,0x1cf));var _0x973b=function(_0x3c8ed4,_0x39f8af){_0x3c8ed4=_0x3c8ed4-0x0;var _0x4b022a=_0x73b9[_0x3c8ed4];return _0x4b022a;};'use strict';function Dynamics365Account(_0xce193e){this['id']=_0xce193e['id']||0x0;this['name']=_0xce193e[_0x973b('0x0')]||'';this[_0x973b('0x1')]=_0xce193e[_0x973b('0x1')]||'';this['password']=_0xce193e[_0x973b('0x2')]||'';this[_0x973b('0x3')]=_0xce193e['remoteUri']||'';this[_0x973b('0x4')]=_0xce193e['tenantId']||'';this['clientId']=_0xce193e['clientId']||'';this[_0x973b('0x5')]=_0xce193e[_0x973b('0x5')]||{};this['serverUrl']=_0xce193e[_0x973b('0x6')]||'';this['modernAuthentication']=_0xce193e[_0x973b('0x7')]||![];this[_0x973b('0x8')]=_0xce193e[_0x973b('0x8')]||{};this[_0x973b('0x9')]=_0xce193e[_0x973b('0x9')]||{};}module[_0x973b('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 6420192..1ccae14 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 _0x9bb2=['Trunk','ListId','key','exports','name','description','ecm','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x9bb2,0xc4));var _0x29bb=function(_0x518526,_0x38d6ea){_0x518526=_0x518526-0x0;var _0x2034d9=_0x9bb2[_0x518526];return _0x2034d9;};'use strict';function FaxAccount(_0x4dc777){this['id']=_0x4dc777['id']||0x0;this['name']=_0x4dc777[_0x29bb('0x0')]||'';this[_0x29bb('0x1')]=_0x4dc777[_0x29bb('0x1')];this[_0x29bb('0x2')]=_0x4dc777[_0x29bb('0x2')];this['headerinfo']=_0x4dc777['headerinfo'];this[_0x29bb('0x3')]=_0x4dc777['localstationid'];this[_0x29bb('0x4')]=_0x4dc777[_0x29bb('0x4')]||0x960;this['maxrate']=_0x4dc777[_0x29bb('0x5')]||0x3840;this[_0x29bb('0x6')]=_0x4dc777['modem']||'v17,v27,v29';this[_0x29bb('0x7')]=_0x4dc777['gateway']||'no';this[_0x29bb('0x8')]=_0x4dc777[_0x29bb('0x8')]||'no';this[_0x29bb('0x9')]=_0x4dc777['t38timeout']||0x1388;this[_0x29bb('0xa')]=_0x4dc777[_0x29bb('0xa')]||_0x29bb('0xb');this[_0x29bb('0xc')]=_0x4dc777[_0x29bb('0xc')]?_0x4dc777[_0x29bb('0xc')]:undefined;this[_0x29bb('0xd')]=_0x4dc777[_0x29bb('0xd')];this[_0x29bb('0xe')]=_0x4dc777[_0x29bb('0xe')];}module[_0x29bb('0xf')]=FaxAccount; \ No newline at end of file +var _0xb635=['maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb635,0x11b));var _0x5b63=function(_0xa74d76,_0x2e748a){_0xa74d76=_0xa74d76-0x0;var _0x494e18=_0xb635[_0xa74d76];return _0x494e18;};'use strict';function FaxAccount(_0x1400fd){this['id']=_0x1400fd['id']||0x0;this[_0x5b63('0x0')]=_0x1400fd[_0x5b63('0x0')]||'';this[_0x5b63('0x1')]=_0x1400fd[_0x5b63('0x1')];this[_0x5b63('0x2')]=_0x1400fd[_0x5b63('0x2')];this[_0x5b63('0x3')]=_0x1400fd['headerinfo'];this[_0x5b63('0x4')]=_0x1400fd[_0x5b63('0x4')];this['minrate']=_0x1400fd[_0x5b63('0x5')]||0x960;this['maxrate']=_0x1400fd[_0x5b63('0x6')]||0x3840;this[_0x5b63('0x7')]=_0x1400fd[_0x5b63('0x7')]||'v17,v27,v29';this[_0x5b63('0x8')]=_0x1400fd[_0x5b63('0x8')]||'no';this['faxdetect']=_0x1400fd[_0x5b63('0x9')]||'no';this[_0x5b63('0xa')]=_0x1400fd['t38timeout']||0x1388;this['tech']=_0x1400fd[_0x5b63('0xb')]||_0x5b63('0xc');this[_0x5b63('0xd')]=_0x1400fd[_0x5b63('0xd')]?_0x1400fd[_0x5b63('0xd')]:undefined;this[_0x5b63('0xe')]=_0x1400fd[_0x5b63('0xe')];this[_0x5b63('0xf')]=_0x1400fd[_0x5b63('0xf')];}module[_0x5b63('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 741f32b..154fc38 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 _0xa460=['name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x57e1ac,_0x1e0b48){var _0x274975=function(_0x1f7f56){while(--_0x1f7f56){_0x57e1ac['push'](_0x57e1ac['shift']());}};_0x274975(++_0x1e0b48);}(_0xa460,0xd9));var _0x0a46=function(_0x2d51cc,_0x2ca3e2){_0x2d51cc=_0x2d51cc-0x0;var _0x3dc46b=_0xa460[_0x2d51cc];return _0x3dc46b;};'use strict';function FreshdeskAccount(_0x30c9a6){this['id']=_0x30c9a6['id']||0x0;this[_0x0a46('0x0')]=_0x30c9a6[_0x0a46('0x0')]||'';this['username']=_0x30c9a6[_0x0a46('0x1')]||'';this[_0x0a46('0x2')]=_0x30c9a6[_0x0a46('0x3')]||'';this[_0x0a46('0x4')]=_0x30c9a6[_0x0a46('0x4')]||'';this[_0x0a46('0x5')]=_0x30c9a6[_0x0a46('0x5')]||'';this[_0x0a46('0x6')]=_0x30c9a6[_0x0a46('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x07d5=['Configurations','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x3254c0,_0x57a5ae){var _0x380854=function(_0x4a54ef){while(--_0x4a54ef){_0x3254c0['push'](_0x3254c0['shift']());}};_0x380854(++_0x57a5ae);}(_0x07d5,0x143));var _0x507d=function(_0x49a137,_0x3941dc){_0x49a137=_0x49a137-0x0;var _0xaa58dd=_0x07d5[_0x49a137];return _0xaa58dd;};'use strict';function FreshdeskAccount(_0x51750e){this['id']=_0x51750e['id']||0x0;this['name']=_0x51750e[_0x507d('0x0')]||'';this[_0x507d('0x1')]=_0x51750e['username']||'';this[_0x507d('0x2')]=_0x51750e[_0x507d('0x3')]||'';this[_0x507d('0x4')]=_0x51750e[_0x507d('0x4')]||'';this[_0x507d('0x5')]=_0x51750e[_0x507d('0x5')]||'';this[_0x507d('0x6')]=_0x51750e[_0x507d('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 5e98927..dcbb271 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 _0x212b=['username','apiKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3b92d4,_0x92961e){var _0x2fb2c3=function(_0x5baa50){while(--_0x5baa50){_0x3b92d4['push'](_0x3b92d4['shift']());}};_0x2fb2c3(++_0x92961e);}(_0x212b,0x148));var _0xb212=function(_0x166978,_0x59f928){_0x166978=_0x166978-0x0;var _0x788da7=_0x212b[_0x166978];return _0x788da7;};'use strict';function FreshsalesAccount(_0x4fab1b){this['id']=_0x4fab1b['id']||0x0;this['name']=_0x4fab1b[_0xb212('0x0')]||'';this[_0xb212('0x1')]=_0x4fab1b[_0xb212('0x1')]||'';this[_0xb212('0x2')]=_0x4fab1b['token']||'';this[_0xb212('0x3')]=_0x4fab1b[_0xb212('0x3')]||'';this[_0xb212('0x4')]=_0x4fab1b['serverUrl']||'';this[_0xb212('0x5')]=_0x4fab1b[_0xb212('0x5')]||{};}module[_0xb212('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x1b65=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x49628e,_0x2d03da){var _0x4674e1=function(_0x474500){while(--_0x474500){_0x49628e['push'](_0x49628e['shift']());}};_0x4674e1(++_0x2d03da);}(_0x1b65,0x1b4));var _0x51b6=function(_0x28d396,_0x50bd20){_0x28d396=_0x28d396-0x0;var _0x3bdb1d=_0x1b65[_0x28d396];return _0x3bdb1d;};'use strict';function FreshsalesAccount(_0x8ff7db){this['id']=_0x8ff7db['id']||0x0;this[_0x51b6('0x0')]=_0x8ff7db[_0x51b6('0x0')]||'';this[_0x51b6('0x1')]=_0x8ff7db['username']||'';this[_0x51b6('0x2')]=_0x8ff7db[_0x51b6('0x3')]||'';this[_0x51b6('0x4')]=_0x8ff7db[_0x51b6('0x4')]||'';this[_0x51b6('0x5')]=_0x8ff7db[_0x51b6('0x5')]||'';this[_0x51b6('0x6')]=_0x8ff7db['Configurations']||{};}module[_0x51b6('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 6f986a9..7c686d5 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 _0x94e1=['connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','lastAssignedTo','motionChannel','voice','routealias','variables','type','inbound','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexitAt','channel'];(function(_0x1043b6,_0x356a58){var _0x3a9abe=function(_0x247057){while(--_0x247057){_0x1043b6['push'](_0x1043b6['shift']());}};_0x3a9abe(++_0x356a58);}(_0x94e1,0x106));var _0x194e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x94e1[_0x321bb2];return _0x9c12ed;};'use strict';function QueueReport(){this[_0x194e('0x0')]=_0x194e('0x1');this[_0x194e('0x2')]='';this[_0x194e('0x3')]='';this['calleridname']='';this['queue']='';this[_0x194e('0x4')]=null;this[_0x194e('0x5')]=null;this[_0x194e('0x6')]=0x1;this[_0x194e('0x7')]=0x1;this[_0x194e('0x8')]=![];this[_0x194e('0x9')]=null;this['queuecallercomplete']=![];this[_0x194e('0xa')]=null;this['queuecallerexit']=![];this[_0x194e('0xb')]=null;this['originalposition']=0x1;this[_0x194e('0xc')]='';this[_0x194e('0xd')]='';this[_0x194e('0xe')]='';this[_0x194e('0xf')]='';this[_0x194e('0x10')]='';this[_0x194e('0x11')]='';this[_0x194e('0x12')]='';this[_0x194e('0x13')]=0x0;this['assigned']=![];this[_0x194e('0x14')]='';this[_0x194e('0x15')]=_0x194e('0x16');this[_0x194e('0x17')]=null;this['mohtime']=0x0;this[_0x194e('0x18')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x5dd0=['type','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','position','count','queuecallercompleteAt','queuecallerexit','channel','connectedlinenum','connectedlinename','accountcode','context','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','exports'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x5dd0,0x1c2));var _0x05dd=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5dd0[_0x413feb];return _0x40ee88;};'use strict';function QueueReport(){this[_0x05dd('0x0')]=_0x05dd('0x1');this[_0x05dd('0x2')]='';this[_0x05dd('0x3')]='';this[_0x05dd('0x4')]='';this['queue']='';this[_0x05dd('0x5')]=null;this['queuecallerleaveAt']=null;this[_0x05dd('0x6')]=0x1;this[_0x05dd('0x7')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0x05dd('0x8')]=null;this[_0x05dd('0x9')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0x05dd('0xa')]='';this[_0x05dd('0xb')]='';this[_0x05dd('0xc')]='';this[_0x05dd('0xd')]='';this[_0x05dd('0xe')]='';this['exten']='';this[_0x05dd('0xf')]='';this[_0x05dd('0x10')]=0x0;this[_0x05dd('0x11')]=![];this[_0x05dd('0x12')]='';this[_0x05dd('0x13')]=_0x05dd('0x14');this[_0x05dd('0x15')]=null;this[_0x05dd('0x16')]=0x0;this[_0x05dd('0x17')]={};}module[_0x05dd('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 4505f9e..4c16e66 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 _0x71d5=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x71d5,0x109));var _0x571d=function(_0x2c6af3,_0x3ce442){_0x2c6af3=_0x2c6af3-0x0;var _0x4895bf=_0x71d5[_0x2c6af3];return _0x4895bf;};'use strict';function SalesforceAccount(_0x502cba){this['id']=_0x502cba['id']||0x0;this[_0x571d('0x0')]=_0x502cba['name']||'';this['username']=_0x502cba[_0x571d('0x1')]||'';this[_0x571d('0x2')]=_0x502cba[_0x571d('0x2')]||'';this[_0x571d('0x3')]=_0x502cba[_0x571d('0x3')]||'';this[_0x571d('0x4')]=_0x502cba[_0x571d('0x4')]||'';this[_0x571d('0x5')]=_0x502cba[_0x571d('0x5')]||'';this['securityToken']=_0x502cba[_0x571d('0x6')]||'';this[_0x571d('0x7')]=_0x502cba[_0x571d('0x7')]||_0x571d('0x8');this[_0x571d('0x9')]=_0x502cba[_0x571d('0x9')]||'';this[_0x571d('0xa')]=_0x502cba[_0x571d('0xa')]||{};}module[_0x571d('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xeefe=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x33ec38,_0xc6cd31){var _0x6fbfd=function(_0x597ac8){while(--_0x597ac8){_0x33ec38['push'](_0x33ec38['shift']());}};_0x6fbfd(++_0xc6cd31);}(_0xeefe,0xf2));var _0xeeef=function(_0x13dce8,_0x2ec192){_0x13dce8=_0x13dce8-0x0;var _0x5c039c=_0xeefe[_0x13dce8];return _0x5c039c;};'use strict';function SalesforceAccount(_0x189723){this['id']=_0x189723['id']||0x0;this['name']=_0x189723[_0xeeef('0x0')]||'';this['username']=_0x189723[_0xeeef('0x1')]||'';this[_0xeeef('0x2')]=_0x189723['remoteUri']||'';this[_0xeeef('0x3')]=_0x189723['password']||'';this[_0xeeef('0x4')]=_0x189723[_0xeeef('0x4')]||'';this[_0xeeef('0x5')]=_0x189723[_0xeeef('0x5')]||'';this['securityToken']=_0x189723[_0xeeef('0x6')]||'';this[_0xeeef('0x7')]=_0x189723[_0xeeef('0x7')]||_0xeeef('0x8');this[_0xeeef('0x9')]=_0x189723[_0xeeef('0x9')]||'';this[_0xeeef('0xa')]=_0x189723[_0xeeef('0xa')]||{};}module[_0xeeef('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 d0b7442..56a90ca 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 _0x50eb=['serverUrl','Configurations','exports','name','username','password'];(function(_0x208392,_0x4328ef){var _0x479ae3=function(_0x20331d){while(--_0x20331d){_0x208392['push'](_0x208392['shift']());}};_0x479ae3(++_0x4328ef);}(_0x50eb,0x1b9));var _0xb50e=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x50eb[_0x1f36bb];return _0xaf97fa;};'use strict';function ServicenowAccount(_0x55d1fc){this['id']=_0x55d1fc['id']||0x0;this[_0xb50e('0x0')]=_0x55d1fc[_0xb50e('0x0')]||'';this[_0xb50e('0x1')]=_0x55d1fc[_0xb50e('0x1')]||'';this[_0xb50e('0x2')]=_0x55d1fc['password']||'';this['remoteUri']=_0x55d1fc['remoteUri']||'';this[_0xb50e('0x3')]=_0x55d1fc[_0xb50e('0x3')]||'';this[_0xb50e('0x4')]=_0x55d1fc[_0xb50e('0x4')]||{};}module[_0xb50e('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x642f=['exports','name','username','remoteUri','serverUrl','Configurations'];(function(_0x2904a8,_0x73180){var _0x4aae50=function(_0x491df9){while(--_0x491df9){_0x2904a8['push'](_0x2904a8['shift']());}};_0x4aae50(++_0x73180);}(_0x642f,0x163));var _0xf642=function(_0x1b7f86,_0xc03da5){_0x1b7f86=_0x1b7f86-0x0;var _0x38877e=_0x642f[_0x1b7f86];return _0x38877e;};'use strict';function ServicenowAccount(_0x1a41bd){this['id']=_0x1a41bd['id']||0x0;this[_0xf642('0x0')]=_0x1a41bd[_0xf642('0x0')]||'';this[_0xf642('0x1')]=_0x1a41bd['username']||'';this['password']=_0x1a41bd['password']||'';this[_0xf642('0x2')]=_0x1a41bd[_0xf642('0x2')]||'';this[_0xf642('0x3')]=_0x1a41bd[_0xf642('0x3')]||'';this[_0xf642('0x4')]=_0x1a41bd[_0xf642('0x4')]||{};}module[_0xf642('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 4b767c8..5bfb78a 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 _0xee6f=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x2cb885,_0x588f87){var _0x3cbcc3=function(_0x375ae7){while(--_0x375ae7){_0x2cb885['push'](_0x2cb885['shift']());}};_0x3cbcc3(++_0x588f87);}(_0xee6f,0x137));var _0xfee6=function(_0x1cb783,_0x197145){_0x1cb783=_0x1cb783-0x0;var _0x4fae14=_0xee6f[_0x1cb783];return _0x4fae14;};'use strict';function SugarcrmAccount(_0x481587){this['id']=_0x481587['id']||0x0;this[_0xfee6('0x0')]=_0x481587[_0xfee6('0x0')]||'';this[_0xfee6('0x1')]=_0x481587[_0xfee6('0x1')]||'';this[_0xfee6('0x2')]=_0x481587['password']||'';this[_0xfee6('0x3')]=_0x481587[_0xfee6('0x3')]||'';this[_0xfee6('0x4')]=_0x481587[_0xfee6('0x4')]||'';this[_0xfee6('0x5')]=_0x481587[_0xfee6('0x5')]||{};}module[_0xfee6('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x184f=['exports','name','password','remoteUri','serverUrl','Configurations'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x184f,0x73));var _0xf184=function(_0x9b2bb0,_0x3965b1){_0x9b2bb0=_0x9b2bb0-0x0;var _0x2cdb3b=_0x184f[_0x9b2bb0];return _0x2cdb3b;};'use strict';function SugarcrmAccount(_0x96f18a){this['id']=_0x96f18a['id']||0x0;this['name']=_0x96f18a[_0xf184('0x0')]||'';this['username']=_0x96f18a['username']||'';this[_0xf184('0x1')]=_0x96f18a[_0xf184('0x1')]||'';this[_0xf184('0x2')]=_0x96f18a[_0xf184('0x2')]||'';this['serverUrl']=_0x96f18a[_0xf184('0x3')]||'';this[_0xf184('0x4')]=_0x96f18a[_0xf184('0x4')]||{};}module[_0xf184('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 568b3fc..a8d67d7 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 _0x65aa=['name','accountcode','state','unknown','status','address','exports'];(function(_0x50686c,_0x460e57){var _0x2b0c44=function(_0x33f7dd){while(--_0x33f7dd){_0x50686c['push'](_0x50686c['shift']());}};_0x2b0c44(++_0x460e57);}(_0x65aa,0x142));var _0xa65a=function(_0x96b4c9,_0x15f4da){_0x96b4c9=_0x96b4c9-0x0;var _0x5791df=_0x65aa[_0x96b4c9];return _0x5791df;};'use strict';function Telephone(_0x11d953){this['id']=_0x11d953['id']||0x0;this['name']=_0x11d953[_0xa65a('0x0')]||'';this['accountcode']=_0x11d953[_0xa65a('0x1')]||'';this[_0xa65a('0x2')]=_0xa65a('0x3');this['stateTime']=0x0;this[_0xa65a('0x4')]=_0xa65a('0x3');this[_0xa65a('0x5')]='';}module[_0xa65a('0x6')]=Telephone; \ No newline at end of file +var _0x5455=['status','address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x218c38,_0x32e3c8){var _0x4a7b38=function(_0xad72c0){while(--_0xad72c0){_0x218c38['push'](_0x218c38['shift']());}};_0x4a7b38(++_0x32e3c8);}(_0x5455,0x17b));var _0x5545=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5455[_0x3ab51d];return _0x29a04e;};'use strict';function Telephone(_0x14e755){this['id']=_0x14e755['id']||0x0;this[_0x5545('0x0')]=_0x14e755['name']||'';this[_0x5545('0x1')]=_0x14e755['accountcode']||'';this[_0x5545('0x2')]=_0x5545('0x3');this[_0x5545('0x4')]=0x0;this[_0x5545('0x5')]=_0x5545('0x3');this[_0x5545('0x6')]='';}module[_0x5545('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index dc0235d..142ba38 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 _0xa9e0=['exports','name'];(function(_0x3f42c8,_0x2d4fea){var _0x2f7e69=function(_0x165465){while(--_0x165465){_0x3f42c8['push'](_0x3f42c8['shift']());}};_0x2f7e69(++_0x2d4fea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 +var _0xb10b=['name','html'];(function(_0x15244b,_0x3bada9){var _0x55741f=function(_0x6bae1c){while(--_0x6bae1c){_0x15244b['push'](_0x15244b['shift']());}};_0x55741f(++_0x3bada9);}(_0xb10b,0x12a));var _0xbb10=function(_0x7880d2,_0x32e7d6){_0x7880d2=_0x7880d2-0x0;var _0x35ebbe=_0xb10b[_0x7880d2];return _0x35ebbe;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index d8dd7f9..0b0b0e5 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(_0x3de873,_0x174b5f){var _0x380b8c=function(_0x313dea){while(--_0x313dea){_0x3de873['push'](_0x3de873['shift']());}};_0x380b8c(++_0x174b5f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'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 _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x5d7201,_0x525632){var _0x10c571=function(_0x33a3c0){while(--_0x33a3c0){_0x5d7201['push'](_0x5d7201['shift']());}};_0x10c571(++_0x525632);}(_0x14a0,0x8e));var _0x014a=function(_0x3747c4,_0x367681){_0x3747c4=_0x3747c4-0x0;var _0xf8075b=_0x14a0[_0x3747c4];return _0xf8075b;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index dd01954..e693fa6 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 _0x14e3=['unknown','stateTime','status','registry','indexOf','split','domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','state'];(function(_0x574d5c,_0x50b123){var _0x1d919b=function(_0x311e20){while(--_0x311e20){_0x574d5c['push'](_0x574d5c['shift']());}};_0x1d919b(++_0x50b123);}(_0x14e3,0x15d));var _0x314e=function(_0x485859,_0x27221e){_0x485859=_0x485859-0x0;var _0x510bb8=_0x14e3[_0x485859];return _0x510bb8;};'use strict';function Trunk(_0x396210){this['id']=_0x396210['id']||0x0;this[_0x314e('0x0')]=_0x396210[_0x314e('0x0')]||![];this[_0x314e('0x1')]=_0x396210[_0x314e('0x1')]||'';this[_0x314e('0x2')]=_0x314e('0x3');this[_0x314e('0x4')]=0x0;this[_0x314e('0x5')]='unknown';this[_0x314e('0x6')]=_0x396210[_0x314e('0x6')]&&_0x396210['registry'][_0x314e('0x7')](':')?_0x396210[_0x314e('0x6')][_0x314e('0x8')](':')[0x0]:'';this['host']='';this['port']='';this[_0x314e('0x9')]='';this[_0x314e('0xa')]='';this[_0x314e('0xb')]='';this[_0x314e('0xc')]=_0x314e('0x3');this[_0x314e('0xd')]='';this['address']='';this['defaultuser']=_0x396210[_0x314e('0xe')]||'';}module[_0x314e('0xf')]=Trunk; \ No newline at end of file +var _0x827c=['domain','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state','unknown','stateTime','registry','indexOf','split','host','port'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x827c,0x1b0));var _0xc827=function(_0x350927,_0x4da4ee){_0x350927=_0x350927-0x0;var _0x25eace=_0x827c[_0x350927];return _0x25eace;};'use strict';function Trunk(_0x202faa){this['id']=_0x202faa['id']||0x0;this[_0xc827('0x0')]=_0x202faa['active']||![];this[_0xc827('0x1')]=_0x202faa[_0xc827('0x1')]||'';this[_0xc827('0x2')]=_0xc827('0x3');this[_0xc827('0x4')]=0x0;this['status']=_0xc827('0x3');this['registry']=_0x202faa['registry']&&_0x202faa[_0xc827('0x5')][_0xc827('0x6')](':')?_0x202faa[_0xc827('0x5')][_0xc827('0x7')](':')[0x0]:'';this[_0xc827('0x8')]='';this[_0xc827('0x9')]='';this[_0xc827('0xa')]='';this[_0xc827('0xb')]='';this[_0xc827('0xc')]='';this[_0xc827('0xd')]=_0xc827('0x3');this['registrationtime']='';this[_0xc827('0xe')]='';this[_0xc827('0xf')]=_0x202faa[_0xc827('0xf')]||'';}module[_0xc827('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 56da323..07cfb91 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 _0x0552=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x0552,0x1c2));var _0x2055=function(_0x2a86a5,_0x3f6481){_0x2a86a5=_0x2a86a5-0x0;var _0x5ede44=_0x0552[_0x2a86a5];return _0x5ede44;};'use strict';function voiceExtension(_0x2e4f85){this['id']=_0x2e4f85['id']||0x0;this[_0x2055('0x0')]=_0x2e4f85[_0x2055('0x0')]||'';this[_0x2055('0x1')]=_0x2e4f85[_0x2055('0x1')]||_0x2055('0x2');this[_0x2055('0x3')]=_0x2e4f85[_0x2055('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x030d=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x34ae0f,_0x5e491e){var _0x4d290c=function(_0x585c8d){while(--_0x585c8d){_0x34ae0f['push'](_0x34ae0f['shift']());}};_0x4d290c(++_0x5e491e);}(_0x030d,0x113));var _0xd030=function(_0x50e086,_0x18f9b9){_0x50e086=_0x50e086-0x0;var _0x4e9143=_0x030d[_0x50e086];return _0x4e9143;};'use strict';function voiceExtension(_0x1f5d70){this['id']=_0x1f5d70['id']||0x0;this[_0xd030('0x0')]=_0x1f5d70['exten']||'';this[_0xd030('0x1')]=_0x1f5d70['recordingFormat']||_0xd030('0x2');this['mandatoryDisposition']=_0x1f5d70[_0xd030('0x3')]||![];}module[_0xd030('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 8b1f13f..dd7a237 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 _0x4b57=['dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','linear','random','ringall','roundrobin','rrmemory','wrandom','monitor_format','type','inbound','waiting','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','loggedIn','notInUse','onHold','paused','ringing','ringInUse','unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x729293,_0x4887e7){var _0x1ff835=function(_0xa4b3e1){while(--_0xa4b3e1){_0x729293['push'](_0x729293['shift']());}};_0x1ff835(++_0x4887e7);}(_0x4b57,0xaa));var _0x74b5=function(_0xee5d2a,_0x534134){_0xee5d2a=_0xee5d2a-0x0;var _0x346948=_0x4b57[_0xee5d2a];return _0x346948;};'use strict';var monitorFormat={'wav':_0x74b5('0x0'),'wav49':_0x74b5('0x1'),'gsm':_0x74b5('0x2')};var strategy={'fewestcalls':_0x74b5('0x3'),'leastrecent':'leastrecent','linear':_0x74b5('0x4'),'random':_0x74b5('0x5'),'ringall':_0x74b5('0x6'),'rr':_0x74b5('0x7'),'rrmemory':_0x74b5('0x8'),'rrordered':'rrordered','wrandom':_0x74b5('0x9')};function VoiceQueue(_0xf94fa5){this['id']=_0xf94fa5['id']||0x0;this['name']=_0xf94fa5['name']||'';this[_0x74b5('0xa')]=_0xf94fa5['monitor_format']||'';this[_0x74b5('0xb')]=_0xf94fa5[_0x74b5('0xb')]||_0x74b5('0xc');this[_0x74b5('0xd')]=0x0;this['total']=0x0;this['answered']=0x0;this[_0x74b5('0xe')]=0x0;this[_0x74b5('0xf')]=0x0;this[_0x74b5('0x10')]=0x0;this[_0x74b5('0x11')]=0x0;this[_0x74b5('0x12')]=0x0;this[_0x74b5('0x13')]=0x0;this[_0x74b5('0x14')]=0x0;this['inUse']=0x0;this['invalid']=0x0;this[_0x74b5('0x15')]=0x0;this[_0x74b5('0x16')]=0x0;this[_0x74b5('0x17')]=0x0;this[_0x74b5('0x18')]=0x0;this[_0x74b5('0x19')]=0x0;this[_0x74b5('0x1a')]=0x0;this['talking']=0x0;this[_0x74b5('0x1b')]=0x0;this['unknown']=0x0;this['acw']=_0xf94fa5[_0x74b5('0x1c')]||![];this[_0x74b5('0x1d')]=_0xf94fa5['acwTimeout']||0xa;this['autopause']=_0xf94fa5[_0x74b5('0x1e')]||'no';this[_0x74b5('0x1f')]=!![];this[_0x74b5('0x20')]='';this[_0x74b5('0x21')]='';this[_0x74b5('0x22')]=0x0;this['temp']=0x0;this[_0x74b5('0x23')]=_0xf94fa5[_0x74b5('0x23')]||null;this[_0x74b5('0x24')]=_0xf94fa5[_0x74b5('0x24')]?_0xf94fa5[_0x74b5('0x24')]:null;this[_0x74b5('0x25')]=_0xf94fa5[_0x74b5('0x25')];this[_0x74b5('0x26')]=_0xf94fa5[_0x74b5('0x26')]||_0x74b5('0x27');this[_0x74b5('0x28')]=_0xf94fa5[_0x74b5('0x28')]||0x0;this[_0x74b5('0x29')]=_0xf94fa5[_0x74b5('0x29')]||0x0;this[_0x74b5('0x2a')]=_0xf94fa5[_0x74b5('0x2a')]||0x1;this['dialPredictiveOptimization']=_0xf94fa5[_0x74b5('0x2b')]||_0x74b5('0x2c');this['dialPredictiveOptimizationPercentage']=_0xf94fa5[_0x74b5('0x2d')]||0.03;this[_0x74b5('0x2e')]=_0xf94fa5['dialPredictiveInterval']||0x258;this[_0x74b5('0x2f')]=_0xf94fa5[_0x74b5('0x2f')]||_0x74b5('0x30');this[_0x74b5('0x31')]=_0xf94fa5[_0x74b5('0x31')]||_0x74b5('0x30');this['dialOriginateTimeout']=_0xf94fa5[_0x74b5('0x32')]||0x1e;this[_0x74b5('0x33')]=_0xf94fa5['dialQueueOptions']||_0x74b5('0x34');this[_0x74b5('0x35')]=_0xf94fa5['dialQueueTimeout']||0x3;this['dialQueueProject']=_0xf94fa5['dialQueueProject']||undefined;this[_0x74b5('0x36')]=_0xf94fa5[_0x74b5('0x36')]||0x3;this['dialCongestionRetryFrequency']=_0xf94fa5['dialCongestionRetryFrequency']||0x96;this[_0x74b5('0x37')]=_0xf94fa5['dialBusyMaxRetry']||0x3;this[_0x74b5('0x38')]=_0xf94fa5['dialBusyRetryFrequency']||0x96;this[_0x74b5('0x39')]=_0xf94fa5[_0x74b5('0x39')]||0x3;this['dialNoAnswerRetryFrequency']=_0xf94fa5[_0x74b5('0x3a')]||0x96;this[_0x74b5('0x3b')]=_0xf94fa5[_0x74b5('0x3b')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0xf94fa5[_0x74b5('0x3c')]||0x96;this[_0x74b5('0x3d')]=_0xf94fa5[_0x74b5('0x3d')]||0x3;this[_0x74b5('0x3e')]=_0xf94fa5['dialDropRetryFrequency']||0x96;this[_0x74b5('0x3f')]=_0xf94fa5[_0x74b5('0x3f')]||0x3;this[_0x74b5('0x40')]=_0xf94fa5[_0x74b5('0x40')]||0x96;this['dialMachineMaxRetry']=_0xf94fa5[_0x74b5('0x41')]||0x3;this[_0x74b5('0x42')]=_0xf94fa5[_0x74b5('0x42')]||0x96;this[_0x74b5('0x43')]=_0xf94fa5['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0xf94fa5[_0x74b5('0x44')]||0x96;this[_0x74b5('0x45')]=_0xf94fa5[_0x74b5('0x45')]||0x3;this[_0x74b5('0x46')]=_0xf94fa5[_0x74b5('0x46')]||0x4;this['Trunk']=_0xf94fa5[_0x74b5('0x47')]?_0xf94fa5[_0x74b5('0x47')]:undefined;this[_0x74b5('0x48')]=_0xf94fa5['TrunkBackup']?_0xf94fa5['TrunkBackup']:undefined;this[_0x74b5('0x49')]=_0xf94fa5[_0x74b5('0x49')]||undefined;this[_0x74b5('0x4a')]=_0xf94fa5[_0x74b5('0x4a')]?_0xf94fa5[_0x74b5('0x4a')]:undefined;this[_0x74b5('0x4b')]=_0xf94fa5['dialOrderByScheduledAt']||_0x74b5('0x4c');this['dialRandomLastDigitCallerIdNumber']=_0xf94fa5[_0x74b5('0x4d')]||undefined;this[_0x74b5('0x4e')]=_0xf94fa5[_0x74b5('0x4e')]||undefined;this[_0x74b5('0x4f')]=strategy[_0xf94fa5[_0x74b5('0x4f')]];this['queueStatusComplete']=!![];this['dialAMDActive']=_0xf94fa5[_0x74b5('0x50')]||![];this[_0x74b5('0x51')]=_0xf94fa5['dialAMDInitialSilence'];this[_0x74b5('0x52')]=_0xf94fa5[_0x74b5('0x52')];this[_0x74b5('0x53')]=_0xf94fa5[_0x74b5('0x53')];this[_0x74b5('0x54')]=_0xf94fa5[_0x74b5('0x54')];this[_0x74b5('0x55')]=_0xf94fa5[_0x74b5('0x55')];this[_0x74b5('0x56')]=_0xf94fa5['dialAMDBetweenWordsSilence'];this[_0x74b5('0x57')]=_0xf94fa5['dialAMDMaximumNumberOfWords'];this[_0x74b5('0x58')]=_0xf94fa5[_0x74b5('0x58')];this['dialAMDMaximumWordLength']=_0xf94fa5['dialAMDMaximumWordLength'];this[_0x74b5('0x59')]=0x0;this[_0x74b5('0x5a')]=0x0;this[_0x74b5('0x5b')]=_0xf94fa5[_0x74b5('0x5b')];this[_0x74b5('0x5c')]=0x0;this[_0x74b5('0x5d')]=0x0;this[_0x74b5('0x5e')]=0x0;this[_0x74b5('0x5f')]=0x0;this[_0x74b5('0x60')]=0x0;this[_0x74b5('0x61')]=0x0;this[_0x74b5('0x62')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x74b5('0x63')]=0x0;this[_0x74b5('0x64')]=0x0;this[_0x74b5('0x65')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0x74b5('0x66')]=undefined;this[_0x74b5('0x67')]=undefined;this['handlePredictive']=undefined;this[_0x74b5('0x68')]=1.05;this[_0x74b5('0x69')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x74b5('0x6a')]=0x0;this[_0x74b5('0x6b')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x74b5('0x6c')]=0x0;this[_0x74b5('0x6d')]=0x0;this[_0x74b5('0x6e')]=_0xf94fa5[_0x74b5('0x6f')]||0x14;this[_0x74b5('0x70')]=_0xf94fa5[_0x74b5('0x6f')]||0xa;this[_0x74b5('0x71')]=0x0;this[_0x74b5('0x72')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x74b5('0x73')]=0x0;this['erlangCallToSecond']=0x0;this[_0x74b5('0x74')]=0x0;this[_0x74b5('0x75')]=0x0;this['dialRecallMeTimeout']=_0xf94fa5[_0x74b5('0x76')]||0x1e;this[_0x74b5('0x77')]=_0xf94fa5['dialRecallInQueue']||![];this[_0x74b5('0x78')]=!!_0xf94fa5[_0x74b5('0x78')]||![];this['dialPreviewRecallmeReminder']=!!_0xf94fa5[_0x74b5('0x79')]||![];this[_0x74b5('0x7a')]=_0xf94fa5[_0x74b5('0x7a')]||undefined;this[_0x74b5('0x7b')]=_0xf94fa5[_0x74b5('0x7b')]||![];this[_0x74b5('0x7c')]=_0xf94fa5[_0x74b5('0x7c')]||![];this[_0x74b5('0xa')]=monitorFormat[_0xf94fa5['monitor_format']]?monitorFormat[_0xf94fa5[_0x74b5('0xa')]]:undefined;this[_0x74b5('0x7d')]=_0xf94fa5['mandatoryDisposition']||![];this[_0x74b5('0x7e')]=_0xf94fa5[_0x74b5('0x7e')]?_0xf94fa5[_0x74b5('0x7e')]:undefined;this[_0x74b5('0x7f')]=![];}module[_0x74b5('0x80')]=VoiceQueue; \ No newline at end of file +var _0x2af8=['unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','ringing','ringInUse','talking','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','gsm','fewestcalls','linear','random','roundrobin','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable'];(function(_0x31e740,_0x407113){var _0x1365a1=function(_0x484096){while(--_0x484096){_0x31e740['push'](_0x31e740['shift']());}};_0x1365a1(++_0x407113);}(_0x2af8,0xf6));var _0x82af=function(_0x2ae3ec,_0x2c2cae){_0x2ae3ec=_0x2ae3ec-0x0;var _0x467367=_0x2af8[_0x2ae3ec];return _0x467367;};'use strict';var monitorFormat={'wav':_0x82af('0x0'),'wav49':'wav49','gsm':_0x82af('0x1')};var strategy={'fewestcalls':_0x82af('0x2'),'leastrecent':'leastrecent','linear':_0x82af('0x3'),'random':_0x82af('0x4'),'ringall':'ringall','rr':_0x82af('0x5'),'rrmemory':'rrmemory','rrordered':_0x82af('0x6'),'wrandom':_0x82af('0x7')};function VoiceQueue(_0x4dd422){this['id']=_0x4dd422['id']||0x0;this[_0x82af('0x8')]=_0x4dd422[_0x82af('0x8')]||'';this['monitor_format']=_0x4dd422[_0x82af('0x9')]||'';this[_0x82af('0xa')]=_0x4dd422[_0x82af('0xa')]||_0x82af('0xb');this[_0x82af('0xc')]=0x0;this[_0x82af('0xd')]=0x0;this[_0x82af('0xe')]=0x0;this[_0x82af('0xf')]=0x0;this[_0x82af('0x10')]=0x0;this[_0x82af('0x11')]=0x0;this[_0x82af('0x12')]=0x0;this[_0x82af('0x13')]=0x0;this[_0x82af('0x14')]=0x0;this[_0x82af('0x15')]=0x0;this[_0x82af('0x16')]=0x0;this[_0x82af('0x17')]=0x0;this[_0x82af('0x18')]=0x0;this[_0x82af('0x19')]=0x0;this['onHold']=0x0;this['paused']=0x0;this[_0x82af('0x1a')]=0x0;this[_0x82af('0x1b')]=0x0;this[_0x82af('0x1c')]=0x0;this['unavailable']=0x0;this[_0x82af('0x1d')]=0x0;this[_0x82af('0x1e')]=_0x4dd422[_0x82af('0x1e')]||![];this[_0x82af('0x1f')]=_0x4dd422['acwTimeout']||0xa;this[_0x82af('0x20')]=_0x4dd422[_0x82af('0x20')]||'no';this[_0x82af('0x21')]=!![];this[_0x82af('0x22')]='';this[_0x82af('0x23')]='';this[_0x82af('0x24')]=0x0;this[_0x82af('0x25')]=0x0;this[_0x82af('0x26')]=_0x4dd422[_0x82af('0x26')]||null;this[_0x82af('0x27')]=_0x4dd422[_0x82af('0x27')]?_0x4dd422[_0x82af('0x27')]:null;this[_0x82af('0x28')]=_0x4dd422['dialActive'];this[_0x82af('0x29')]=_0x4dd422[_0x82af('0x29')]||_0x82af('0x2a');this[_0x82af('0x2b')]=_0x4dd422['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x4dd422[_0x82af('0x2c')]||0x0;this['dialPowerLevel']=_0x4dd422[_0x82af('0x2d')]||0x1;this[_0x82af('0x2e')]=_0x4dd422[_0x82af('0x2e')]||_0x82af('0x2f');this[_0x82af('0x30')]=_0x4dd422[_0x82af('0x30')]||0.03;this[_0x82af('0x31')]=_0x4dd422['dialPredictiveInterval']||0x258;this[_0x82af('0x32')]=_0x4dd422['dialOriginateCallerIdName']||_0x82af('0x33');this['dialOriginateCallerIdNumber']=_0x4dd422['dialOriginateCallerIdNumber']||_0x82af('0x33');this['dialOriginateTimeout']=_0x4dd422[_0x82af('0x34')]||0x1e;this[_0x82af('0x35')]=_0x4dd422[_0x82af('0x35')]||_0x82af('0x36');this[_0x82af('0x37')]=_0x4dd422[_0x82af('0x37')]||0x3;this[_0x82af('0x38')]=_0x4dd422[_0x82af('0x38')]||undefined;this['dialCongestionMaxRetry']=_0x4dd422['dialCongestionMaxRetry']||0x3;this[_0x82af('0x39')]=_0x4dd422[_0x82af('0x39')]||0x96;this['dialBusyMaxRetry']=_0x4dd422[_0x82af('0x3a')]||0x3;this[_0x82af('0x3b')]=_0x4dd422[_0x82af('0x3b')]||0x96;this[_0x82af('0x3c')]=_0x4dd422['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x4dd422[_0x82af('0x3d')]||0x96;this[_0x82af('0x3e')]=_0x4dd422[_0x82af('0x3e')]||0x3;this[_0x82af('0x3f')]=_0x4dd422[_0x82af('0x3f')]||0x96;this[_0x82af('0x40')]=_0x4dd422[_0x82af('0x40')]||0x3;this[_0x82af('0x41')]=_0x4dd422[_0x82af('0x41')]||0x96;this[_0x82af('0x42')]=_0x4dd422['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x4dd422[_0x82af('0x43')]||0x96;this['dialMachineMaxRetry']=_0x4dd422['dialMachineMaxRetry']||0x3;this[_0x82af('0x44')]=_0x4dd422[_0x82af('0x44')]||0x96;this['dialAgentRejectMaxRetry']=_0x4dd422['dialAgentRejectMaxRetry']||0x3;this[_0x82af('0x45')]=_0x4dd422[_0x82af('0x45')]||0x96;this[_0x82af('0x46')]=_0x4dd422[_0x82af('0x46')]||0x3;this['dialGlobalMaxRetry']=_0x4dd422[_0x82af('0x47')]||0x4;this[_0x82af('0x48')]=_0x4dd422[_0x82af('0x48')]?_0x4dd422[_0x82af('0x48')]:undefined;this[_0x82af('0x49')]=_0x4dd422['TrunkBackup']?_0x4dd422[_0x82af('0x49')]:undefined;this[_0x82af('0x4a')]=_0x4dd422[_0x82af('0x4a')]||undefined;this[_0x82af('0x4b')]=_0x4dd422[_0x82af('0x4b')]?_0x4dd422[_0x82af('0x4b')]:undefined;this['dialOrderByScheduledAt']=_0x4dd422[_0x82af('0x4c')]||_0x82af('0x4d');this[_0x82af('0x4e')]=_0x4dd422[_0x82af('0x4e')]||undefined;this[_0x82af('0x4f')]=_0x4dd422[_0x82af('0x4f')]||undefined;this['strategy']=strategy[_0x4dd422[_0x82af('0x50')]];this[_0x82af('0x51')]=!![];this[_0x82af('0x52')]=_0x4dd422[_0x82af('0x52')]||![];this[_0x82af('0x53')]=_0x4dd422[_0x82af('0x53')];this['dialAMDGreeting']=_0x4dd422[_0x82af('0x54')];this[_0x82af('0x55')]=_0x4dd422[_0x82af('0x55')];this[_0x82af('0x56')]=_0x4dd422['dialAMDTotalAnalysisTime'];this[_0x82af('0x57')]=_0x4dd422[_0x82af('0x57')];this['dialAMDBetweenWordsSilence']=_0x4dd422[_0x82af('0x58')];this[_0x82af('0x59')]=_0x4dd422[_0x82af('0x59')];this[_0x82af('0x5a')]=_0x4dd422[_0x82af('0x5a')];this[_0x82af('0x5b')]=_0x4dd422['dialAMDMaximumWordLength'];this[_0x82af('0x5c')]=0x0;this['pTalking']=0x0;this[_0x82af('0x5d')]=_0x4dd422[_0x82af('0x5d')];this[_0x82af('0x5e')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x82af('0x5f')]=0x0;this[_0x82af('0x60')]=0x0;this[_0x82af('0x61')]=0x0;this[_0x82af('0x62')]=0x0;this[_0x82af('0x63')]=0x0;this[_0x82af('0x64')]=0x0;this[_0x82af('0x65')]=0x0;this[_0x82af('0x66')]=0x0;this[_0x82af('0x67')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x82af('0x68')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x82af('0x69')]=undefined;this[_0x82af('0x6a')]=undefined;this[_0x82af('0x6b')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x82af('0x6c')]=0x0;this[_0x82af('0x6d')]=0x0;this[_0x82af('0x6e')]=0x0;this[_0x82af('0x6f')]=0x0;this[_0x82af('0x70')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x82af('0x71')]=0x0;this[_0x82af('0x72')]=0x0;this['predictiveIntervalMaxThreshold']=_0x4dd422['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x82af('0x73')]=_0x4dd422[_0x82af('0x74')]||0xa;this[_0x82af('0x75')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x82af('0x76')]=0x1;this[_0x82af('0x77')]=0x0;this[_0x82af('0x78')]=0x0;this[_0x82af('0x79')]=0x0;this['erlangBusyFactor']=0x0;this[_0x82af('0x7a')]=_0x4dd422[_0x82af('0x7a')]||0x1e;this[_0x82af('0x7b')]=_0x4dd422[_0x82af('0x7b')]||![];this[_0x82af('0x7c')]=!!_0x4dd422[_0x82af('0x7c')]||![];this['dialPreviewRecallmeReminder']=!!_0x4dd422['dialPreviewRecallmeReminder']||![];this[_0x82af('0x7d')]=_0x4dd422['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x4dd422[_0x82af('0x7e')]||![];this[_0x82af('0x7f')]=_0x4dd422[_0x82af('0x7f')]||![];this[_0x82af('0x9')]=monitorFormat[_0x4dd422[_0x82af('0x9')]]?monitorFormat[_0x4dd422['monitor_format']]:undefined;this[_0x82af('0x80')]=_0x4dd422[_0x82af('0x80')]||![];this['mandatoryDispositionPause']=_0x4dd422[_0x82af('0x81')]?_0x4dd422[_0x82af('0x81')]:undefined;this[_0x82af('0x82')]=![];}module[_0x82af('0x83')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index c881250..7ec875c 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc492=['dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','createReport','loggedin','status','booked','keys','length','queue','dialer','compareToInboundQueue','some','compareToOutboundQueue','active','updateReportFromOutboundQueue','available','loggedIn','loggedInDb','talking','answered','inUse','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','sumDuration','waiting','name','strategy','abandoned','busy','invalid','onHold','notInUse','paused','ringing','ringInUse','sumBillable','total','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName'];(function(_0x29563a,_0x393dd5){var _0x33e493=function(_0x13ed52){while(--_0x13ed52){_0x29563a['push'](_0x29563a['shift']());}};_0x33e493(++_0x393dd5);}(_0xc492,0xd7));var _0x2c49=function(_0x3d0d6f,_0x56b492){_0x3d0d6f=_0x3d0d6f-0x0;var _0x3bc103=_0xc492[_0x3d0d6f];return _0x3bc103;};'use strict';var INBOUND_COUNTERS=[_0x2c49('0x0'),_0x2c49('0x1'),_0x2c49('0x2'),'paused','ringing',_0x2c49('0x3'),'waiting'];var OUTBOUND_COUNTERS=['available',_0x2c49('0x4'),_0x2c49('0x5'),'loggedIn',_0x2c49('0x2'),'originated',_0x2c49('0x6'),_0x2c49('0x7'),'outboundBlacklistCallsDay',_0x2c49('0x8'),_0x2c49('0x9'),_0x2c49('0xa'),_0x2c49('0xb'),_0x2c49('0xc'),'outboundRejectCallsDay',_0x2c49('0xd'),'paused','pTalking','talking','sumBillable',_0x2c49('0xe'),'total',_0x2c49('0xf')];function VoiceQueueSummary(_0x2a998e){this['id']=_0x2a998e['id'];this['name']=_0x2a998e[_0x2c49('0x10')];this[_0x2c49('0x11')]=_0x2a998e[_0x2c49('0x11')];this[_0x2c49('0x12')]=_0x2a998e[_0x2c49('0x12')]||0x0;this[_0x2c49('0x4')]=_0x2a998e['answered']||0x0;this[_0x2c49('0x0')]=_0x2a998e[_0x2c49('0x0')]||0x0;this[_0x2c49('0x13')]=_0x2a998e[_0x2c49('0x13')]||0x0;this[_0x2c49('0x5')]=_0x2a998e['inUse']||0x0;this[_0x2c49('0x14')]=_0x2a998e[_0x2c49('0x14')]||0x0;this[_0x2c49('0x1')]=_0x2a998e[_0x2c49('0x1')]||0x0;this[_0x2c49('0x2')]=_0x2a998e[_0x2c49('0x2')]||0x0;this[_0x2c49('0x15')]=_0x2a998e[_0x2c49('0x15')]||0x0;this[_0x2c49('0x16')]=_0x2a998e[_0x2c49('0x16')]||0x0;this['paused']=_0x2a998e[_0x2c49('0x17')]||0x0;this[_0x2c49('0x18')]=_0x2a998e[_0x2c49('0x18')]||0x0;this[_0x2c49('0x19')]=_0x2a998e['ringInUse'];this[_0x2c49('0x1a')]=_0x2a998e['sumBillable'];this[_0x2c49('0xe')]=_0x2a998e[_0x2c49('0xe')];this['sumHoldTime']=_0x2a998e['sumHoldTime']||0x0;this[_0x2c49('0x3')]=_0x2a998e[_0x2c49('0x3')]||0x0;this[_0x2c49('0x1b')]=_0x2a998e[_0x2c49('0x1b')]||0x0;this[_0x2c49('0x1c')]=_0x2a998e[_0x2c49('0x1c')];this[_0x2c49('0x1d')]=_0x2a998e[_0x2c49('0x1d')]||0x0;this[_0x2c49('0x1e')]=_0x2a998e['unknown']||0x0;this[_0x2c49('0x1f')]=_0x2a998e[_0x2c49('0x1f')]||0x0;this[_0x2c49('0xf')]=_0x2a998e[_0x2c49('0xf')]||0x0;if(_0x2a998e['type']===_0x2c49('0x20')){this[_0x2c49('0x21')]=_0x2a998e[_0x2c49('0x21')]||0x0;this[_0x2c49('0x22')]=_0x2a998e['dialActive'];this[_0x2c49('0x23')]=_0x2a998e[_0x2c49('0x23')];this[_0x2c49('0x24')]=_0x2a998e['dialOriginateCallerIdName'];this[_0x2c49('0x25')]=_0x2a998e[_0x2c49('0x25')];this['dialOriginateTimeout']=_0x2a998e[_0x2c49('0x26')];this['dialPrefix']=_0x2a998e['dialPrefix'];this[_0x2c49('0x27')]=_0x2a998e['temp'];this[_0x2c49('0x28')]=_0x2a998e['outboundAnswerAgiCallsDay'];this[_0x2c49('0x7')]=_0x2a998e[_0x2c49('0x7')];this[_0x2c49('0x29')]=_0x2a998e[_0x2c49('0x29')];this[_0x2c49('0x8')]=_0x2a998e[_0x2c49('0x8')];this[_0x2c49('0x9')]=_0x2a998e[_0x2c49('0x9')];this[_0x2c49('0x2a')]=_0x2a998e[_0x2c49('0x2a')];this['outboundDropCallsDayCallersExit']=_0x2a998e[_0x2c49('0x2b')];this['outboundDropCallsDayTimeout']=_0x2a998e[_0x2c49('0x2c')];this[_0x2c49('0xa')]=_0x2a998e[_0x2c49('0xa')];this[_0x2c49('0xb')]=_0x2a998e[_0x2c49('0xb')];this[_0x2c49('0x2d')]=_0x2a998e[_0x2c49('0x2d')];this[_0x2c49('0xc')]=_0x2a998e[_0x2c49('0xc')];this[_0x2c49('0x2e')]=_0x2a998e[_0x2c49('0x2e')];this[_0x2c49('0xd')]=_0x2a998e[_0x2c49('0xd')];this[_0x2c49('0x2f')]=_0x2a998e['predictiveIntervalAnsweredCalls'];this['predictiveIntervalAvgHoldtime']=_0x2a998e[_0x2c49('0x30')];this[_0x2c49('0x31')]=_0x2a998e['predictiveIntervalAvgTalktime'];this[_0x2c49('0x32')]=_0x2a998e[_0x2c49('0x32')];this[_0x2c49('0x33')]=_0x2a998e[_0x2c49('0x33')];this[_0x2c49('0x34')]=_0x2a998e[_0x2c49('0x34')];this[_0x2c49('0x35')]=_0x2a998e[_0x2c49('0x35')];this['predictiveIntervalHitRate']=_0x2a998e[_0x2c49('0x36')];this[_0x2c49('0x37')]=_0x2a998e['predictiveIntervalMultiplicativeFactor'];this[_0x2c49('0x38')]=_0x2a998e[_0x2c49('0x38')];this[_0x2c49('0x39')]=_0x2a998e['predictiveIntervalAvailable'];this[_0x2c49('0x3a')]=_0x2a998e[_0x2c49('0x3a')];this[_0x2c49('0x3b')]=_0x2a998e[_0x2c49('0x3b')];this[_0x2c49('0x3c')]=_0x2a998e[_0x2c49('0x3c')];this['erlangCallToSecond']=_0x2a998e[_0x2c49('0x3d')];this[_0x2c49('0x3e')]=_0x2a998e['erlangAbandonmentRate'];this[_0x2c49('0x3f')]=_0x2a998e[_0x2c49('0x3f')];this['startPredictive']=_0x2a998e[_0x2c49('0x40')];this['startProgressive']=_0x2a998e[_0x2c49('0x41')];this[_0x2c49('0x42')]=_0x2a998e[_0x2c49('0x42')];this['statusMessage']=_0x2a998e[_0x2c49('0x43')];}if(_0x2a998e['Trunk']){this[_0x2c49('0x44')]={'id':_0x2a998e[_0x2c49('0x44')]['id'],'name':_0x2a998e[_0x2c49('0x44')][_0x2c49('0x10')],'active':_0x2a998e[_0x2c49('0x44')]['active'],'callerid':_0x2a998e[_0x2c49('0x44')][_0x2c49('0x45')]};}}VoiceQueueSummary[_0x2c49('0x46')][_0x2c49('0x47')]=function(_0x251c8d,_0x130410,_0x3c25b6,_0x40f640){this['loggedInDb']=0x0;this[_0x2c49('0x3')]=0x0;this[_0x2c49('0x17')]=0x0;this['unknown']=0x0;this[_0x2c49('0x16')]=0x0;this[_0x2c49('0x5')]=0x0;this['busy']=0x0;this[_0x2c49('0x14')]=0x0;this['unavailable']=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this['onHold']=0x0;if(_0x3c25b6){if(_0x3c25b6[_0x2c49('0x0')]){this[_0x2c49('0x0')]=Number(_0x3c25b6[_0x2c49('0x0')]);}if(_0x3c25b6[_0x2c49('0x48')]){this[_0x2c49('0x1')]=Number(_0x3c25b6['loggedin']);}if(_0x3c25b6['callers']){this['waiting']=Number(_0x3c25b6['callers']);}}for(var _0x43b5ca=0x0;_0x43b5ca<_0x251c8d['length'];_0x43b5ca++){var _0x341fd6=_0x130410['SIP/'+_0x251c8d[_0x43b5ca]['name']];if(_0x341fd6&&_0x341fd6['online']){this[_0x2c49('0x2')]+=0x1;}if(_0x251c8d[_0x43b5ca]['incall']==='1'){this[_0x2c49('0x3')]+=0x1;}if(_0x251c8d[_0x43b5ca][_0x2c49('0x17')]==='1'&&!['2','7','8']['includes'](_0x251c8d[_0x43b5ca]['status'])){this[_0x2c49('0x17')]+=0x1;}switch(_0x251c8d[_0x43b5ca][_0x2c49('0x49')]){case'0':this[_0x2c49('0x1e')]+=0x1;break;case'1':this[_0x2c49('0x16')]+=0x1;break;case'2':this[_0x2c49('0x5')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0x2c49('0x1d')]+=0x1;break;case'6':this[_0x2c49('0x18')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this['dialMethod']===_0x2c49('0x4a')){var _0x267a32=Object[_0x2c49('0x4b')](_0x40f640);for(var _0x55e4cd=0x0;_0x55e4cd<_0x267a32[_0x2c49('0x4c')];_0x55e4cd++){var _0xea11c4=_0x267a32[_0x55e4cd];var _0x43a7fd=_0x40f640[_0xea11c4];if(_0x43a7fd[_0x2c49('0x4d')]===this[_0x2c49('0x10')]&&_0x43a7fd[_0x2c49('0x1c')]===_0x2c49('0x4e')&&_0x43a7fd['exten']==='xcally-motion-preview'){this['talking']+=0x1;}}if(this[_0x2c49('0x3')]>this[_0x2c49('0x5')]){this['talking']=this[_0x2c49('0x5')];}this[_0x2c49('0x21')]=0x0;}return this;};VoiceQueueSummary[_0x2c49('0x46')][_0x2c49('0x4f')]=function(_0x199b26){var _0x38d901=![];if(_0x199b26){_0x38d901=INBOUND_COUNTERS[_0x2c49('0x50')](function(_0x11878d){return this[_0x11878d]!==_0x199b26[_0x11878d];},this);}return _0x38d901;};VoiceQueueSummary[_0x2c49('0x46')][_0x2c49('0x51')]=function(_0x56d647){var _0x46a0c6=![];var _0xe026bf=![];var _0xfcdbaf=![];if(_0x56d647){_0x46a0c6=this['dialMethod']!==_0x56d647[_0x2c49('0x23')]||this[_0x2c49('0x22')]!==_0x56d647['dialActive']||this[_0x2c49('0x42')]!==_0x56d647[_0x2c49('0x42')]||this[_0x2c49('0x43')]!==_0x56d647[_0x2c49('0x43')];_0xe026bf=OUTBOUND_COUNTERS['some'](function(_0x34e69e){return this[_0x34e69e]!==_0x56d647[_0x34e69e];},this);if(this[_0x2c49('0x44')]&&_0x56d647[_0x2c49('0x44')]){_0xfcdbaf=this[_0x2c49('0x44')]['name']!==_0x56d647[_0x2c49('0x44')][_0x2c49('0x10')]||this[_0x2c49('0x44')][_0x2c49('0x52')]!==_0x56d647[_0x2c49('0x44')][_0x2c49('0x52')];}}return _0x46a0c6||_0xe026bf||_0xfcdbaf;};VoiceQueueSummary[_0x2c49('0x46')][_0x2c49('0x53')]=function(_0x3b62ee){this['answered']=_0x3b62ee['answered'];this[_0x2c49('0x42')]=_0x3b62ee[_0x2c49('0x42')];this['statusMessage']=_0x3b62ee[_0x2c49('0x43')];this['originated']=_0x3b62ee[_0x2c49('0x3b')];this[_0x2c49('0x6')]=_0x3b62ee[_0x2c49('0x6')];this[_0x2c49('0x7')]=_0x3b62ee[_0x2c49('0x7')];this['outboundBlacklistCallsDay']=_0x3b62ee[_0x2c49('0x29')];this[_0x2c49('0x8')]=_0x3b62ee[_0x2c49('0x8')];this['outboundCongestionCallsDay']=_0x3b62ee[_0x2c49('0x9')];this[_0x2c49('0xa')]=_0x3b62ee['outboundNoAnswerCallsDay'];this[_0x2c49('0xb')]=_0x3b62ee[_0x2c49('0xb')];this['outboundReCallsDay']=_0x3b62ee[_0x2c49('0xc')];this['outboundRejectCallsDay']=_0x3b62ee[_0x2c49('0x2e')];this[_0x2c49('0xd')]=_0x3b62ee[_0x2c49('0xd')];this[_0x2c49('0x1a')]=_0x3b62ee[_0x2c49('0x1a')];this[_0x2c49('0xe')]=_0x3b62ee['sumDuration'];this[_0x2c49('0x1b')]=_0x3b62ee[_0x2c49('0x1b')];if(this[_0x2c49('0x23')]==='preview'){this[_0x2c49('0x21')]=_0x3b62ee['pTalking'];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0x2eb2=['dialPrefix','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','name','callerid','createReport','invalid','loggedin','callers','length','online','incall','includes','status','booked','keys','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','prototype','compareToOutboundQueue','active','updateReportFromOutboundQueue','total','preview','exports','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumDuration','strategy','abandoned','available','busy','inUse','onHold','notInUse','ringInUse','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0x2eb2,0x19f));var _0x22eb=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x2eb2[_0x4fc9e6];return _0x551d28;};'use strict';var INBOUND_COUNTERS=['available',_0x22eb('0x0'),_0x22eb('0x1'),_0x22eb('0x2'),_0x22eb('0x3'),_0x22eb('0x4'),_0x22eb('0x5')];var OUTBOUND_COUNTERS=['available',_0x22eb('0x6'),'inUse','loggedIn',_0x22eb('0x1'),_0x22eb('0x7'),_0x22eb('0x8'),_0x22eb('0x9'),_0x22eb('0xa'),_0x22eb('0xb'),_0x22eb('0xc'),_0x22eb('0xd'),_0x22eb('0xe'),_0x22eb('0xf'),_0x22eb('0x10'),_0x22eb('0x11'),'paused',_0x22eb('0x12'),'talking','sumBillable',_0x22eb('0x13'),'total',_0x22eb('0x5')];function VoiceQueueSummary(_0x28c587){this['id']=_0x28c587['id'];this['name']=_0x28c587['name'];this[_0x22eb('0x14')]=_0x28c587[_0x22eb('0x14')];this[_0x22eb('0x15')]=_0x28c587[_0x22eb('0x15')]||0x0;this[_0x22eb('0x6')]=_0x28c587['answered']||0x0;this[_0x22eb('0x16')]=_0x28c587['available']||0x0;this[_0x22eb('0x17')]=_0x28c587['busy']||0x0;this[_0x22eb('0x18')]=_0x28c587[_0x22eb('0x18')]||0x0;this['invalid']=_0x28c587['invalid']||0x0;this['loggedIn']=_0x28c587[_0x22eb('0x0')]||0x0;this['loggedInDb']=_0x28c587['loggedInDb']||0x0;this[_0x22eb('0x19')]=_0x28c587['onHold']||0x0;this['notInUse']=_0x28c587[_0x22eb('0x1a')]||0x0;this[_0x22eb('0x2')]=_0x28c587[_0x22eb('0x2')]||0x0;this[_0x22eb('0x3')]=_0x28c587[_0x22eb('0x3')]||0x0;this['ringInUse']=_0x28c587[_0x22eb('0x1b')];this[_0x22eb('0x1c')]=_0x28c587[_0x22eb('0x1c')];this[_0x22eb('0x13')]=_0x28c587[_0x22eb('0x13')];this['sumHoldTime']=_0x28c587[_0x22eb('0x1d')]||0x0;this[_0x22eb('0x4')]=_0x28c587[_0x22eb('0x4')]||0x0;this['total']=_0x28c587['total']||0x0;this[_0x22eb('0x1e')]=_0x28c587[_0x22eb('0x1e')];this[_0x22eb('0x1f')]=_0x28c587[_0x22eb('0x1f')]||0x0;this[_0x22eb('0x20')]=_0x28c587[_0x22eb('0x20')]||0x0;this[_0x22eb('0x21')]=_0x28c587['unmanaged']||0x0;this[_0x22eb('0x5')]=_0x28c587[_0x22eb('0x5')]||0x0;if(_0x28c587[_0x22eb('0x1e')]===_0x22eb('0x22')){this[_0x22eb('0x12')]=_0x28c587['pTalking']||0x0;this[_0x22eb('0x23')]=_0x28c587[_0x22eb('0x23')];this[_0x22eb('0x24')]=_0x28c587['dialMethod'];this[_0x22eb('0x25')]=_0x28c587[_0x22eb('0x25')];this['dialOriginateCallerIdNumber']=_0x28c587[_0x22eb('0x26')];this[_0x22eb('0x27')]=_0x28c587[_0x22eb('0x27')];this[_0x22eb('0x28')]=_0x28c587[_0x22eb('0x28')];this['temp']=_0x28c587['temp'];this[_0x22eb('0x29')]=_0x28c587[_0x22eb('0x29')];this[_0x22eb('0x9')]=_0x28c587[_0x22eb('0x9')];this[_0x22eb('0xa')]=_0x28c587[_0x22eb('0xa')];this[_0x22eb('0xb')]=_0x28c587[_0x22eb('0xb')];this[_0x22eb('0xc')]=_0x28c587[_0x22eb('0xc')];this[_0x22eb('0x2a')]=_0x28c587[_0x22eb('0x2a')];this['outboundDropCallsDayCallersExit']=_0x28c587[_0x22eb('0x2b')];this['outboundDropCallsDayTimeout']=_0x28c587[_0x22eb('0x2c')];this[_0x22eb('0xd')]=_0x28c587[_0x22eb('0xd')];this[_0x22eb('0xe')]=_0x28c587[_0x22eb('0xe')];this[_0x22eb('0x2d')]=_0x28c587[_0x22eb('0x2d')];this[_0x22eb('0xf')]=_0x28c587[_0x22eb('0xf')];this[_0x22eb('0x10')]=_0x28c587['outboundRejectCallsDay'];this['outboundUnknownCallsDay']=_0x28c587[_0x22eb('0x11')];this['predictiveIntervalAnsweredCalls']=_0x28c587['predictiveIntervalAnsweredCalls'];this[_0x22eb('0x2e')]=_0x28c587[_0x22eb('0x2e')];this[_0x22eb('0x2f')]=_0x28c587[_0x22eb('0x2f')];this[_0x22eb('0x30')]=_0x28c587[_0x22eb('0x30')];this[_0x22eb('0x31')]=_0x28c587[_0x22eb('0x31')];this[_0x22eb('0x32')]=_0x28c587[_0x22eb('0x32')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x28c587[_0x22eb('0x33')];this['predictiveIntervalHitRate']=_0x28c587['predictiveIntervalHitRate'];this[_0x22eb('0x34')]=_0x28c587[_0x22eb('0x34')];this['predictiveIntervalPauses']=_0x28c587[_0x22eb('0x35')];this[_0x22eb('0x36')]=_0x28c587[_0x22eb('0x36')];this[_0x22eb('0x37')]=_0x28c587[_0x22eb('0x37')];this['originated']=_0x28c587[_0x22eb('0x7')];this[_0x22eb('0x38')]=_0x28c587['erlangCalls'];this[_0x22eb('0x39')]=_0x28c587[_0x22eb('0x39')];this[_0x22eb('0x3a')]=_0x28c587[_0x22eb('0x3a')];this[_0x22eb('0x3b')]=_0x28c587['erlangBusyFactor'];this['startPredictive']=_0x28c587[_0x22eb('0x3c')];this[_0x22eb('0x3d')]=_0x28c587['startProgressive'];this[_0x22eb('0x3e')]=_0x28c587[_0x22eb('0x3e')];this[_0x22eb('0x3f')]=_0x28c587['statusMessage'];}if(_0x28c587[_0x22eb('0x40')]){this[_0x22eb('0x40')]={'id':_0x28c587[_0x22eb('0x40')]['id'],'name':_0x28c587[_0x22eb('0x40')][_0x22eb('0x41')],'active':_0x28c587[_0x22eb('0x40')]['active'],'callerid':_0x28c587[_0x22eb('0x40')][_0x22eb('0x42')]};}}VoiceQueueSummary['prototype'][_0x22eb('0x43')]=function(_0x44d39f,_0x204092,_0x30cb10,_0x18c6ed){this[_0x22eb('0x1')]=0x0;this[_0x22eb('0x4')]=0x0;this[_0x22eb('0x2')]=0x0;this[_0x22eb('0x20')]=0x0;this[_0x22eb('0x1a')]=0x0;this[_0x22eb('0x18')]=0x0;this[_0x22eb('0x17')]=0x0;this[_0x22eb('0x44')]=0x0;this[_0x22eb('0x1f')]=0x0;this[_0x22eb('0x3')]=0x0;this[_0x22eb('0x1b')]=0x0;this[_0x22eb('0x19')]=0x0;if(_0x30cb10){if(_0x30cb10[_0x22eb('0x16')]){this['available']=Number(_0x30cb10[_0x22eb('0x16')]);}if(_0x30cb10[_0x22eb('0x45')]){this['loggedIn']=Number(_0x30cb10[_0x22eb('0x45')]);}if(_0x30cb10[_0x22eb('0x46')]){this['waiting']=Number(_0x30cb10['callers']);}}for(var _0x5c18d1=0x0;_0x5c18d1<_0x44d39f[_0x22eb('0x47')];_0x5c18d1++){var _0x1efc65=_0x204092['SIP/'+_0x44d39f[_0x5c18d1]['name']];if(_0x1efc65&&_0x1efc65[_0x22eb('0x48')]){this[_0x22eb('0x1')]+=0x1;}if(_0x44d39f[_0x5c18d1][_0x22eb('0x49')]==='1'){this[_0x22eb('0x4')]+=0x1;}if(_0x44d39f[_0x5c18d1][_0x22eb('0x2')]==='1'&&!['2','7','8'][_0x22eb('0x4a')](_0x44d39f[_0x5c18d1][_0x22eb('0x4b')])){this[_0x22eb('0x2')]+=0x1;}switch(_0x44d39f[_0x5c18d1]['status']){case'0':this['unknown']+=0x1;break;case'1':this[_0x22eb('0x1a')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x22eb('0x17')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0x22eb('0x1f')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this['dialMethod']===_0x22eb('0x4c')){var _0x4b5c03=Object[_0x22eb('0x4d')](_0x18c6ed);for(var _0x3b35c6=0x0;_0x3b35c6<_0x4b5c03['length'];_0x3b35c6++){var _0x24e6ba=_0x4b5c03[_0x3b35c6];var _0x5df756=_0x18c6ed[_0x24e6ba];if(_0x5df756[_0x22eb('0x4e')]===this[_0x22eb('0x41')]&&_0x5df756[_0x22eb('0x1e')]===_0x22eb('0x4f')&&_0x5df756[_0x22eb('0x50')]===_0x22eb('0x51')){this[_0x22eb('0x4')]+=0x1;}}if(this[_0x22eb('0x4')]>this[_0x22eb('0x18')]){this['talking']=this[_0x22eb('0x18')];}this[_0x22eb('0x12')]=0x0;}return this;};VoiceQueueSummary['prototype'][_0x22eb('0x52')]=function(_0x2f0242){var _0x4da671=![];if(_0x2f0242){_0x4da671=INBOUND_COUNTERS[_0x22eb('0x53')](function(_0x4fee5c){return this[_0x4fee5c]!==_0x2f0242[_0x4fee5c];},this);}return _0x4da671;};VoiceQueueSummary[_0x22eb('0x54')][_0x22eb('0x55')]=function(_0x3b1cd2){var _0x3e3fae=![];var _0x447177=![];var _0x10393b=![];if(_0x3b1cd2){_0x3e3fae=this['dialMethod']!==_0x3b1cd2[_0x22eb('0x24')]||this['dialActive']!==_0x3b1cd2[_0x22eb('0x23')]||this['message']!==_0x3b1cd2[_0x22eb('0x3e')]||this[_0x22eb('0x3f')]!==_0x3b1cd2[_0x22eb('0x3f')];_0x447177=OUTBOUND_COUNTERS[_0x22eb('0x53')](function(_0x3f03df){return this[_0x3f03df]!==_0x3b1cd2[_0x3f03df];},this);if(this['Trunk']&&_0x3b1cd2['Trunk']){_0x10393b=this[_0x22eb('0x40')][_0x22eb('0x41')]!==_0x3b1cd2['Trunk'][_0x22eb('0x41')]||this[_0x22eb('0x40')][_0x22eb('0x56')]!==_0x3b1cd2[_0x22eb('0x40')][_0x22eb('0x56')];}}return _0x3e3fae||_0x447177||_0x10393b;};VoiceQueueSummary[_0x22eb('0x54')][_0x22eb('0x57')]=function(_0x35c997){this[_0x22eb('0x6')]=_0x35c997[_0x22eb('0x6')];this[_0x22eb('0x3e')]=_0x35c997['message'];this[_0x22eb('0x3f')]=_0x35c997[_0x22eb('0x3f')];this[_0x22eb('0x7')]=_0x35c997[_0x22eb('0x7')];this[_0x22eb('0x8')]=_0x35c997[_0x22eb('0x8')];this[_0x22eb('0x9')]=_0x35c997[_0x22eb('0x9')];this[_0x22eb('0xa')]=_0x35c997[_0x22eb('0xa')];this[_0x22eb('0xb')]=_0x35c997[_0x22eb('0xb')];this[_0x22eb('0xc')]=_0x35c997[_0x22eb('0xc')];this['outboundNoAnswerCallsDay']=_0x35c997['outboundNoAnswerCallsDay'];this[_0x22eb('0xe')]=_0x35c997[_0x22eb('0xe')];this[_0x22eb('0xf')]=_0x35c997[_0x22eb('0xf')];this[_0x22eb('0x10')]=_0x35c997['outboundRejectCallsDay'];this[_0x22eb('0x11')]=_0x35c997[_0x22eb('0x11')];this['sumBillable']=_0x35c997['sumBillable'];this[_0x22eb('0x13')]=_0x35c997[_0x22eb('0x13')];this[_0x22eb('0x58')]=_0x35c997[_0x22eb('0x58')];if(this[_0x22eb('0x24')]===_0x22eb('0x59')){this[_0x22eb('0x12')]=_0x35c997[_0x22eb('0x12')];}};module[_0x22eb('0x5a')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 83811a1..6f2f05b 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 _0x640e=['name','username','remoteUri','serverUrl','Configurations'];(function(_0x143f06,_0x8be769){var _0x3c33d9=function(_0x593197){while(--_0x593197){_0x143f06['push'](_0x143f06['shift']());}};_0x3c33d9(++_0x8be769);}(_0x640e,0xbe));var _0xe640=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0x640e[_0x1399d6];return _0x4a9db4;};'use strict';function VtigerAccount(_0x3f6100){this['id']=_0x3f6100['id']||0x0;this[_0xe640('0x0')]=_0x3f6100[_0xe640('0x0')]||'';this[_0xe640('0x1')]=_0x3f6100[_0xe640('0x1')]||'';this['accessKey']=_0x3f6100['accessKey']||'';this['remoteUri']=_0x3f6100[_0xe640('0x2')]||'';this[_0xe640('0x3')]=_0x3f6100[_0xe640('0x3')]||'';this[_0xe640('0x4')]=_0x3f6100[_0xe640('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x9336=['accessKey','remoteUri','serverUrl','exports','name','username'];(function(_0xe0ef19,_0x4fe598){var _0x191c71=function(_0x4c00b0){while(--_0x4c00b0){_0xe0ef19['push'](_0xe0ef19['shift']());}};_0x191c71(++_0x4fe598);}(_0x9336,0x112));var _0x6933=function(_0x17006d,_0x5ed717){_0x17006d=_0x17006d-0x0;var _0x219045=_0x9336[_0x17006d];return _0x219045;};'use strict';function VtigerAccount(_0x5917c8){this['id']=_0x5917c8['id']||0x0;this['name']=_0x5917c8[_0x6933('0x0')]||'';this[_0x6933('0x1')]=_0x5917c8[_0x6933('0x1')]||'';this[_0x6933('0x2')]=_0x5917c8[_0x6933('0x2')]||'';this[_0x6933('0x3')]=_0x5917c8[_0x6933('0x3')]||'';this['serverUrl']=_0x5917c8[_0x6933('0x4')]||'';this['Configurations']=_0x5917c8['Configurations']||{};}module[_0x6933('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 5212228..ebf2058 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 _0xe085=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x2c2a20,_0x605b06){var _0x30e247=function(_0x5922f0){while(--_0x5922f0){_0x2c2a20['push'](_0x2c2a20['shift']());}};_0x30e247(++_0x605b06);}(_0xe085,0x1ef));var _0x5e08=function(_0x106193,_0x3c27cf){_0x106193=_0x106193-0x0;var _0x49ac5b=_0xe085[_0x106193];return _0x49ac5b;};'use strict';function ZendeskAccount(_0x3cf0ad){this['id']=_0x3cf0ad['id']||0x0;this[_0x5e08('0x0')]=_0x3cf0ad[_0x5e08('0x0')]||'';this[_0x5e08('0x1')]=_0x3cf0ad[_0x5e08('0x1')]||'';this[_0x5e08('0x2')]=_0x3cf0ad[_0x5e08('0x2')]||'';this[_0x5e08('0x3')]=_0x3cf0ad['token']||'';this[_0x5e08('0x4')]=_0x3cf0ad['remoteUri']||'';this[_0x5e08('0x5')]=_0x3cf0ad[_0x5e08('0x5')]||'';this[_0x5e08('0x6')]=_0x3cf0ad['type']||_0x5e08('0x7');this['serverUrl']=_0x3cf0ad[_0x5e08('0x8')]||'';this[_0x5e08('0x9')]=_0x3cf0ad[_0x5e08('0x9')]||{};}module[_0x5e08('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x1915=['name','username','password','token','remoteUri','authType','type','serverUrl','Configurations','exports'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0x1915,0x1ae));var _0x5191=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1915[_0x19950b];return _0x3c6b41;};'use strict';function ZendeskAccount(_0x29941f){this['id']=_0x29941f['id']||0x0;this[_0x5191('0x0')]=_0x29941f['name']||'';this[_0x5191('0x1')]=_0x29941f[_0x5191('0x1')]||'';this[_0x5191('0x2')]=_0x29941f[_0x5191('0x2')]||'';this[_0x5191('0x3')]=_0x29941f[_0x5191('0x3')]||'';this[_0x5191('0x4')]=_0x29941f['remoteUri']||'';this[_0x5191('0x5')]=_0x29941f['authType']||'';this['type']=_0x29941f[_0x5191('0x6')]||'integrationTab';this[_0x5191('0x7')]=_0x29941f[_0x5191('0x7')]||'';this[_0x5191('0x8')]=_0x29941f[_0x5191('0x8')]||{};}module[_0x5191('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 87b1420..231c611 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 _0xf31a=['name','description','host','zone','clientId','clientSecret','code','refreshToken','Configurations'];(function(_0x2efe86,_0x4b6c3f){var _0x48e01c=function(_0x5b1412){while(--_0x5b1412){_0x2efe86['push'](_0x2efe86['shift']());}};_0x48e01c(++_0x4b6c3f);}(_0xf31a,0xfc));var _0xaf31=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xf31a[_0xf50820];return _0x2a9b10;};'use strict';function ZohoAccount(_0x5e07d6){this['id']=_0x5e07d6['id']||0x0;this['name']=_0x5e07d6[_0xaf31('0x0')]||'';this[_0xaf31('0x1')]=_0x5e07d6[_0xaf31('0x1')]||'';this[_0xaf31('0x2')]=_0x5e07d6['host']||'';this[_0xaf31('0x3')]=_0x5e07d6['zone']||'';this[_0xaf31('0x4')]=_0x5e07d6[_0xaf31('0x4')]||'';this[_0xaf31('0x5')]=_0x5e07d6[_0xaf31('0x5')]||'';this['serverUrl']=_0x5e07d6['serverUrl']||'';this[_0xaf31('0x6')]=_0x5e07d6[_0xaf31('0x6')]||'';this[_0xaf31('0x7')]=_0x5e07d6[_0xaf31('0x7')]||'';this['Configurations']=_0x5e07d6[_0xaf31('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x6192=['refreshToken','exports','name','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x2c512e,_0x568998){var _0xa697cc=function(_0x1d3159){while(--_0x1d3159){_0x2c512e['push'](_0x2c512e['shift']());}};_0xa697cc(++_0x568998);}(_0x6192,0xad));var _0x2619=function(_0x58b9b3,_0x55bef2){_0x58b9b3=_0x58b9b3-0x0;var _0xd8f8d0=_0x6192[_0x58b9b3];return _0xd8f8d0;};'use strict';function ZohoAccount(_0x55f82c){this['id']=_0x55f82c['id']||0x0;this['name']=_0x55f82c[_0x2619('0x0')]||'';this['description']=_0x55f82c['description']||'';this[_0x2619('0x1')]=_0x55f82c[_0x2619('0x1')]||'';this[_0x2619('0x2')]=_0x55f82c[_0x2619('0x2')]||'';this['clientId']=_0x55f82c[_0x2619('0x3')]||'';this[_0x2619('0x4')]=_0x55f82c[_0x2619('0x4')]||'';this[_0x2619('0x5')]=_0x55f82c[_0x2619('0x5')]||'';this[_0x2619('0x6')]=_0x55f82c[_0x2619('0x6')]||'';this['refreshToken']=_0x55f82c[_0x2619('0x7')]||'';this['Configurations']=_0x55f82c['Configurations']||{};}module[_0x2619('0x8')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 92d87df..d1405ba 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 _0x236c=['recallme','ContactId','ListId','UserId','originatecalleridnum','prototype','calleridname','number','util','moment','string','isNil','uniqueid','type','campaigntype','queue','dialAnswer','membername','Agent','name','format','phone','Contact','firstName','active','scheduledat','countbusyretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callback','callbackuniqueid','callbackat'];(function(_0x393712,_0x23fdf5){var _0x42e3c9=function(_0x39986b){while(--_0x39986b){_0x393712['push'](_0x393712['shift']());}};_0x42e3c9(++_0x23fdf5);}(_0x236c,0x155));var _0xc236=function(_0x24abb3,_0x5dfed2){_0x24abb3=_0x24abb3-0x0;var _0x336000=_0x236c[_0x24abb3];return _0x336000;};'use strict';var util=require(_0xc236('0x0'));var _=require('lodash');var moment=require(_0xc236('0x1'));function checkNameSurname(_0x404d50,_0x39c024,_0x8072){var _0x2bf2d3='';if(!_['isNil'](_0x39c024)&&_0xc236('0x2')===typeof _0x39c024){_0x2bf2d3+=_0x39c024;}if(!_[_0xc236('0x3')](_0x8072)&&_0xc236('0x2')===typeof _0x8072){_0x2bf2d3+='\x20'+_0x8072;}if(_0x2bf2d3!==''){return _0x2bf2d3;}return _0x404d50;}function Action(_0xd582f6,_0x23d3cc,_0x461c3a,_0x5abd65,_0xd612c6){this[_0xc236('0x4')]=_0x461c3a||undefined;this['idContact']=_0xd582f6['id'];this['queue']=_0x23d3cc['name'];this[_0xc236('0x5')]=_0x23d3cc['type'];this[_0xc236('0x6')]=_0xc236('0x7');this[_0xc236('0x8')]=![];this[_0xc236('0x9')]=_[_0xc236('0x3')](_0xd582f6['Agent'])?undefined:_0xd582f6[_0xc236('0xa')][_0xc236('0xb')];this['channelAgent']=this[_0xc236('0x9')]?util[_0xc236('0xc')]('SIP/%s',this[_0xc236('0x9')]):_0x5abd65||undefined;this['calleridname']=checkNameSurname(_0xd582f6['Contact'][_0xc236('0xd')],_0xd582f6[_0xc236('0xe')][_0xc236('0xf')],_0xd582f6[_0xc236('0xe')]['lastName']);this[_0xc236('0x10')]=_0xd582f6['active']||![];this['calleridnum']=_0xd582f6[_0xc236('0xd')];this[_0xc236('0x11')]=_0xd582f6[_0xc236('0x11')];this[_0xc236('0x12')]=_0xd582f6[_0xc236('0x12')]||0x0;this['countcongestionretry']=_0xd582f6['countcongestionretry']||0x0;this['countnoanswerretry']=_0xd582f6[_0xc236('0x13')]||0x0;this[_0xc236('0x14')]=(_0xd582f6[_0xc236('0x12')]||0x0)+(_0xd582f6['countcongestionretry']||0x0)+(_0xd582f6[_0xc236('0x13')]||0x0)+(_0xd582f6['countnosuchnumberretry']||0x0)+(_0xd582f6['countdropretry']||0x0)+(_0xd582f6[_0xc236('0x15')]||0x0)+(_0xd582f6[_0xc236('0x16')]||0x0)+(_0xd582f6[_0xc236('0x17')]||0x0);this[_0xc236('0x18')]=_0xd582f6[_0xc236('0x18')]||0x0;this[_0xc236('0x19')]=_0xd582f6[_0xc236('0x19')]||0x0;this[_0xc236('0x15')]=_0xd582f6[_0xc236('0x15')]||0x0;this[_0xc236('0x16')]=_0xd582f6[_0xc236('0x16')]||0x0;this['countagentrejectretry']=_0xd582f6[_0xc236('0x17')]||0x0;this[_0xc236('0x1a')]=_0xd582f6[_0xc236('0x1a')];this[_0xc236('0x1b')]=_0xd582f6[_0xc236('0x1b')];this[_0xc236('0x1c')]=_0xd582f6[_0xc236('0x1c')];this[_0xc236('0x1d')]=_0xd582f6[_0xc236('0x1d')];this[_0xc236('0x1e')]=_0xd582f6[_0xc236('0x1e')];this['ListId']=_0xd582f6[_0xc236('0x1f')];this[_0xc236('0x20')]=_[_0xc236('0x3')](_0xd582f6[_0xc236('0xa')])?_0xd582f6['UserId']:_0xd582f6[_0xc236('0xa')]['id'];this['VoiceQueueId']=_0xd582f6['VoiceQueueId'];this[_0xc236('0x21')]='';this['originatecalleridname']='';}Action[_0xc236('0x22')]['getCaller']=function(){return util[_0xc236('0xc')]('\x22%s\x22\x20<%s>',this[_0xc236('0x23')],this[_0xc236('0x24')]);};module['exports']=Action; \ No newline at end of file +var _0x5f2f=['phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','membername','Agent','format','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum'];(function(_0x433e98,_0x1450d0){var _0xc5c7cb=function(_0x57701c){while(--_0x57701c){_0x433e98['push'](_0x433e98['shift']());}};_0xc5c7cb(++_0x1450d0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x11eb9e,_0x29ac97){_0x11eb9e=_0x11eb9e-0x0;var _0x220d91=_0x5f2f[_0x11eb9e];return _0x220d91;};'use strict';var util=require(_0xf5f2('0x0'));var _=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));function checkNameSurname(_0x1a7be1,_0x1172dd,_0x174bc7){var _0x3c72ee='';if(!_[_0xf5f2('0x3')](_0x1172dd)&&'string'===typeof _0x1172dd){_0x3c72ee+=_0x1172dd;}if(!_['isNil'](_0x174bc7)&&_0xf5f2('0x4')===typeof _0x174bc7){_0x3c72ee+='\x20'+_0x174bc7;}if(_0x3c72ee!==''){return _0x3c72ee;}return _0x1a7be1;}function Action(_0x192215,_0xad7f65,_0x3eebf6,_0x3133bc,_0x473100){this['uniqueid']=_0x3eebf6||undefined;this[_0xf5f2('0x5')]=_0x192215['id'];this[_0xf5f2('0x6')]=_0xad7f65[_0xf5f2('0x7')];this['type']=_0xad7f65[_0xf5f2('0x8')];this[_0xf5f2('0x9')]=_0xf5f2('0x6');this['dialAnswer']=![];this[_0xf5f2('0xa')]=_['isNil'](_0x192215['Agent'])?undefined:_0x192215[_0xf5f2('0xb')][_0xf5f2('0x7')];this['channelAgent']=this[_0xf5f2('0xa')]?util[_0xf5f2('0xc')](_0xf5f2('0xd'),this[_0xf5f2('0xa')]):_0x3133bc||undefined;this[_0xf5f2('0xe')]=checkNameSurname(_0x192215[_0xf5f2('0xf')]['phone'],_0x192215[_0xf5f2('0xf')][_0xf5f2('0x10')],_0x192215[_0xf5f2('0xf')][_0xf5f2('0x11')]);this[_0xf5f2('0x12')]=_0x192215['active']||![];this[_0xf5f2('0x13')]=_0x192215[_0xf5f2('0x14')];this[_0xf5f2('0x15')]=_0x192215[_0xf5f2('0x15')];this[_0xf5f2('0x16')]=_0x192215[_0xf5f2('0x16')]||0x0;this[_0xf5f2('0x17')]=_0x192215[_0xf5f2('0x17')]||0x0;this[_0xf5f2('0x18')]=_0x192215[_0xf5f2('0x18')]||0x0;this[_0xf5f2('0x19')]=(_0x192215[_0xf5f2('0x16')]||0x0)+(_0x192215[_0xf5f2('0x17')]||0x0)+(_0x192215[_0xf5f2('0x18')]||0x0)+(_0x192215[_0xf5f2('0x1a')]||0x0)+(_0x192215[_0xf5f2('0x1b')]||0x0)+(_0x192215[_0xf5f2('0x1c')]||0x0)+(_0x192215['countmachineretry']||0x0)+(_0x192215[_0xf5f2('0x1d')]||0x0);this[_0xf5f2('0x1a')]=_0x192215['countnosuchnumberretry']||0x0;this['countdropretry']=_0x192215[_0xf5f2('0x1b')]||0x0;this[_0xf5f2('0x1c')]=_0x192215['countabandonedretry']||0x0;this[_0xf5f2('0x1e')]=_0x192215[_0xf5f2('0x1e')]||0x0;this[_0xf5f2('0x1d')]=_0x192215[_0xf5f2('0x1d')]||0x0;this[_0xf5f2('0x1f')]=_0x192215['callback'];this[_0xf5f2('0x20')]=_0x192215[_0xf5f2('0x20')];this[_0xf5f2('0x21')]=_0x192215[_0xf5f2('0x21')];this[_0xf5f2('0x22')]=_0x192215['recallme'];this['ContactId']=_0x192215[_0xf5f2('0x23')];this[_0xf5f2('0x24')]=_0x192215[_0xf5f2('0x24')];this[_0xf5f2('0x25')]=_[_0xf5f2('0x3')](_0x192215[_0xf5f2('0xb')])?_0x192215[_0xf5f2('0x25')]:_0x192215[_0xf5f2('0xb')]['id'];this[_0xf5f2('0x26')]=_0x192215['VoiceQueueId'];this[_0xf5f2('0x27')]='';this[_0xf5f2('0x28')]='';}Action[_0xf5f2('0x29')][_0xf5f2('0x2a')]=function(){return util[_0xf5f2('0xc')](_0xf5f2('0x2b'),this['calleridname'],this['number']);};module[_0xf5f2('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index ef4dc01..dd457ff 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x2c2add,_0x49691b){var _0x151afe=function(_0x52db30){while(--_0x52db30){_0x2c2add['push'](_0x2c2add['shift']());}};_0x151afe(++_0x49691b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x3bdc2a,_0x5c9a8c){var _0x959de1=function(_0x3e8da4){while(--_0x3e8da4){_0x3bdc2a['push'](_0x3bdc2a['shift']());}};_0x959de1(++_0x5c9a8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index c4106fd..4bfe83d 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 _0x0512=['createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','from-sip','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueReport','error','inspect','createHistory','catch','then','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','resolve','[getContactPreview]\x20'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x0512,0x1d8));var _0x2051=function(_0x559391,_0x4a2699){_0x559391=_0x559391-0x0;var _0x48cf02=_0x0512[_0x559391];return _0x48cf02;};'use strict';var util=require(_0x2051('0x0'));var BPromise=require(_0x2051('0x1'));var logger=require('../../../config/logger')(_0x2051('0x2'));var cmHopper=require(_0x2051('0x3'));var cmHopperHistory=require(_0x2051('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x2051('0x5'));function loggerCatch(_0x5b5610){return function(_0x21196d){logger[_0x2051('0x6')](_0x5b5610,util[_0x2051('0x7')](_0x21196d,{'showHidden':![],'depth':null}));};}function create(_0x4f8743){return cmHopperHistory[_0x2051('0x8')](_0x4f8743)[_0x2051('0x9')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x497da1){return BPromise['resolve']()[_0x2051('0xa')](agentReportPreview[_0x2051('0x8')](_0x497da1))[_0x2051('0x9')](loggerCatch(_0x2051('0xb')));}function moveContact(_0x50a6c3){return cmHopper['moveContactManagedDialer'](_0x50a6c3,!![])[_0x2051('0x9')](loggerCatch(_0x2051('0xc')));}exports[_0x2051('0xd')]=function(_0x36d88f){return cmHopperBlack[_0x2051('0xd')](_0x36d88f)['catch'](loggerCatch(_0x2051('0xe')));};exports[_0x2051('0xf')]=function(_0x249a7f){return BPromise[_0x2051('0x10')]()['then'](cmHopper[_0x2051('0xf')](_0x249a7f))['catch'](loggerCatch(_0x2051('0x11')));};exports[_0x2051('0x8')]=function(_0x3dd236,_0x276fcb){create(_0x3dd236)[_0x2051('0x9')](loggerCatch(_0x276fcb));moveContact(_0x3dd236)['catch'](loggerCatch(_0x276fcb));};exports[_0x2051('0x12')]=function(_0x4bba4c,_0x1272d7){createAgent(_0x4bba4c)[_0x2051('0x9')](loggerCatch(_0x1272d7));};exports['createCustomerHistory']=function(_0x467266,_0x16f8b6){create(_0x467266)[_0x2051('0x9')](loggerCatch(_0x16f8b6));};exports[_0x2051('0x13')]=function(_0x24dc12,_0x5059fd){moveContact(_0x24dc12)[_0x2051('0x9')](loggerCatch(_0x5059fd));};exports[_0x2051('0x14')]=function(_0x51d42d,_0x3b6ffc,_0x496c41){if(_0x3b6ffc){_0x51d42d[_0x2051('0x15')]=null;}if(_0x496c41){_0x51d42d[_0x2051('0x16')]=![];}return cmHopper[_0x2051('0x14')](_0x51d42d)[_0x2051('0x9')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x2051('0x17')]=function(_0x284bc7){return cmHopper['countReScheduled'](_0x284bc7)[_0x2051('0x9')](loggerCatch(_0x2051('0x18')));};exports[_0x2051('0x19')]=function(_0x5c33b6){return cmHopper[_0x2051('0x19')]({'UserId':null},_0x5c33b6,0x1)['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0x2051('0x1a')]=function(_0x1786b8){return cmHopper['unlockContact']({'active':![]},_0x1786b8,0x1)[_0x2051('0x9')](loggerCatch(_0x2051('0x1b')));};exports['crateCustomerReportQueue']=function(_0x2d1814){var _0x2069c8={};_0x2069c8['type']=_0x2d1814[_0x2051('0x1c')];_0x2069c8[_0x2051('0x1d')]=_0x2d1814[_0x2051('0x1d')];_0x2069c8[_0x2051('0x1e')]=_0x2d1814['calleridnum'];_0x2069c8['calleridname']=_0x2d1814[_0x2051('0x1f')];_0x2069c8['queue']=_0x2d1814[_0x2051('0x20')];_0x2069c8['queuecallerjoinAt']=_0x2d1814[_0x2051('0x21')];_0x2069c8[_0x2051('0x22')]=_0x2d1814[_0x2051('0x21')];_0x2069c8[_0x2051('0x23')]=0x1;_0x2069c8[_0x2051('0x24')]=_0x2d1814['endtime'];_0x2069c8[_0x2051('0x25')]=_0x2d1814[_0x2051('0x26')];_0x2069c8['context']=_0x2051('0x27');_0x2069c8['exten']=_0x2051('0x28');_0x2069c8[_0x2051('0x29')]=0x0;_0x2069c8['assigned']=0x1;_0x2069c8[_0x2051('0x2a')]=_0x2d1814[_0x2051('0x26')];_0x2069c8[_0x2051('0x2b')]=_0x2051('0x2c');return BPromise['resolve']()[_0x2051('0xa')](voiceQueueReport[_0x2051('0x2d')](_0x2069c8))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x2051('0x2e')]=function(_0x43bfac,_0x573e1b){return BPromise[_0x2051('0x10')]()[_0x2051('0xa')](cmHopper[_0x2051('0x2e')](_0x43bfac,_0x573e1b))[_0x2051('0x9')](loggerCatch(_0x2051('0x2f')));};exports[_0x2051('0x30')]=function(_0x5cafac){return cmHopper[_0x2051('0x14')](_0x5cafac,!![],!![])[_0x2051('0x9')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x47b0=['lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','xcally-motion-preview','assigned'];(function(_0x5527dd,_0x1ffd51){var _0x5b034a=function(_0x3d1fef){while(--_0x3d1fef){_0x5527dd['push'](_0x5527dd['shift']());}};_0x5b034a(++_0x1ffd51);}(_0x47b0,0x119));var _0x047b=function(_0x3ea8e1,_0x33ab0b){_0x3ea8e1=_0x3ea8e1-0x0;var _0x473e9f=_0x47b0[_0x3ea8e1];return _0x473e9f;};'use strict';var util=require('util');var BPromise=require(_0x047b('0x0'));var logger=require(_0x047b('0x1'))(_0x047b('0x2'));var cmHopper=require(_0x047b('0x3'));var cmHopperHistory=require(_0x047b('0x4'));var cmHopperBlack=require(_0x047b('0x5'));var agentReportPreview=require(_0x047b('0x6'));var voiceQueueReport=require(_0x047b('0x7'));function loggerCatch(_0x3c68c1){return function(_0xce70fc){logger['error'](_0x3c68c1,util[_0x047b('0x8')](_0xce70fc,{'showHidden':![],'depth':null}));};}function create(_0x5dcaa4){return cmHopperHistory[_0x047b('0x9')](_0x5dcaa4)[_0x047b('0xa')](loggerCatch(_0x047b('0xb')));}function createAgent(_0x53e71c){return BPromise[_0x047b('0xc')]()['then'](agentReportPreview['createHistory'](_0x53e71c))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x410027){return cmHopper[_0x047b('0xd')](_0x410027,!![])[_0x047b('0xa')](loggerCatch(_0x047b('0xe')));}exports[_0x047b('0xf')]=function(_0x56a344){return cmHopperBlack['checkIsBlackList'](_0x56a344)[_0x047b('0xa')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x047b('0x10')]=function(_0x4e9fe3){return BPromise['resolve']()[_0x047b('0x11')](cmHopper[_0x047b('0x10')](_0x4e9fe3))[_0x047b('0xa')](loggerCatch(_0x047b('0x12')));};exports['createHistory']=function(_0x3a2a29,_0x3db15c){create(_0x3a2a29)['catch'](loggerCatch(_0x3db15c));moveContact(_0x3a2a29)[_0x047b('0xa')](loggerCatch(_0x3db15c));};exports[_0x047b('0x13')]=function(_0x2e03fd,_0x1b3899){createAgent(_0x2e03fd)[_0x047b('0xa')](loggerCatch(_0x1b3899));};exports[_0x047b('0x14')]=function(_0x47a23e,_0x2f674f){create(_0x47a23e)[_0x047b('0xa')](loggerCatch(_0x2f674f));};exports[_0x047b('0x15')]=function(_0x4be100,_0x375091){moveContact(_0x4be100)['catch'](loggerCatch(_0x375091));};exports[_0x047b('0x16')]=function(_0x544910,_0x83256a,_0x4ad761){if(_0x83256a){_0x544910[_0x047b('0x17')]=null;}if(_0x4ad761){_0x544910[_0x047b('0x18')]=![];}return cmHopper[_0x047b('0x16')](_0x544910)[_0x047b('0xa')](loggerCatch(_0x047b('0x19')));};exports[_0x047b('0x1a')]=function(_0x19e1ec){return cmHopper[_0x047b('0x1a')](_0x19e1ec)['catch'](loggerCatch(_0x047b('0x1b')));};exports[_0x047b('0x1c')]=function(_0x4e4733){return cmHopper[_0x047b('0x1c')]({'UserId':null},_0x4e4733,0x1)[_0x047b('0xa')](loggerCatch(_0x047b('0x1d')));};exports[_0x047b('0x1e')]=function(_0x1c1a6e){return cmHopper['unlockContact']({'active':![]},_0x1c1a6e,0x1)[_0x047b('0xa')](loggerCatch(_0x047b('0x1f')));};exports[_0x047b('0x20')]=function(_0x51aaca){var _0x2c0cbe={};_0x2c0cbe[_0x047b('0x21')]=_0x51aaca['type'];_0x2c0cbe[_0x047b('0x22')]=_0x51aaca[_0x047b('0x22')];_0x2c0cbe[_0x047b('0x23')]=_0x51aaca[_0x047b('0x23')];_0x2c0cbe[_0x047b('0x24')]=_0x51aaca[_0x047b('0x24')];_0x2c0cbe[_0x047b('0x25')]=_0x51aaca[_0x047b('0x25')];_0x2c0cbe[_0x047b('0x26')]=_0x51aaca[_0x047b('0x27')];_0x2c0cbe['queuecallerleaveAt']=_0x51aaca['answertime'];_0x2c0cbe[_0x047b('0x28')]=0x1;_0x2c0cbe[_0x047b('0x29')]=_0x51aaca[_0x047b('0x2a')];_0x2c0cbe[_0x047b('0x2b')]=_0x51aaca[_0x047b('0x2c')];_0x2c0cbe['context']=_0x047b('0x2d');_0x2c0cbe[_0x047b('0x2e')]=_0x047b('0x2f');_0x2c0cbe['holdtime']=0x0;_0x2c0cbe[_0x047b('0x30')]=0x1;_0x2c0cbe[_0x047b('0x31')]=_0x51aaca[_0x047b('0x2c')];_0x2c0cbe['queuecallerexitreason']='COMPLETED';return BPromise['resolve']()['then'](voiceQueueReport[_0x047b('0x32')](_0x2c0cbe))[_0x047b('0xa')](loggerCatch(_0x047b('0x33')));};exports[_0x047b('0x34')]=function(_0x40754b,_0x17d73a){return BPromise[_0x047b('0xc')]()[_0x047b('0x11')](cmHopper[_0x047b('0x34')](_0x40754b,_0x17d73a))['catch'](loggerCatch(_0x047b('0x35')));};exports[_0x047b('0x36')]=function(_0x2e6973){return cmHopper['rescheduleContact'](_0x2e6973,!![],!![])['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 32ff84d..af02d89 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 _0xbcfe=['countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','channelAgent','motionChannel','mandatoryDisposition','buildObj','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','type','campaigntype','scheduledat','countglobal','callback','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','replace','random','extractCalleridName','match','extractCalleridNumber','variables','keys','forEach','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','logger','info','error','logger2','inspect','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','dialQueueProject2','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','toLowerVariables','hasOwnProperty','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','getSeconds','membername','UserId','logCustomer','ringtime','answertime','isFailure','uniqueid','timeout','totalGlobal','countbusyretry'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbcfe,0xc8));var _0xebcf=function(_0xc234bf,_0x10cc1c){_0xc234bf=_0xc234bf-0x0;var _0x2e79aa=_0xbcfe[_0xc234bf];return _0x2e79aa;};'use strict';var util=require('util');var _=require(_0xebcf('0x0'));var moment=require('moment');var logger=require(_0xebcf('0x1'))(_0xebcf('0x2'));var ipAgi=process[_0xebcf('0x3')][_0xebcf('0x4')]||_0xebcf('0x5');var utils=require(_0xebcf('0x6'));exports[_0xebcf('0x7')]=function(_0x2635d1){return function(_0x339d29){logger['error'](_0x2635d1,util['inspect'](_0x339d29,{'showHidden':![],'depth':null}));};};exports[_0xebcf('0x8')]=function(_0x404df8,_0x370251){logger[_0xebcf('0x9')](_0x404df8,util['inspect'](_0x370251,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3d01e1,_0xecf7dc){logger[_0xebcf('0xa')](_0x3d01e1,util['inspect'](_0xecf7dc,{'showHidden':![],'depth':null}));};exports[_0xebcf('0xb')]=function(_0x1cc67b){return function(_0x2812e0){logger[_0xebcf('0x9')](_0x1cc67b,util[_0xebcf('0xc')](_0x2812e0,{'showHidden':![],'depth':null}));};};exports['message']=function(_0xe43a90,_0x50a26a,_0x57da7d){return{'message':_0xe43a90,'unlock':_0x50a26a,'active':_0x57da7d};};exports[_0xebcf('0xd')]=function(_0x28b583,_0x2541bb,_0x1fa326){if(!_['isUndefined'](_0x1fa326)&&_0xebcf('0xe')===typeof _0x1fa326&&!_[_0xebcf('0xf')](_0x1fa326)){if(!_[_0xebcf('0x10')](_0x2541bb)&&_0xebcf('0xe')===typeof _0x2541bb&&!_[_0xebcf('0xf')](_0x2541bb)){return util[_0xebcf('0x11')](_0xebcf('0x12'),_0x2541bb,_0x1fa326);}return util[_0xebcf('0x11')](_0xebcf('0x12'),_0x1fa326,_0x1fa326);}if(!_[_0xebcf('0x10')](_0x28b583)&&'string'===typeof _0x28b583&&!_[_0xebcf('0xf')](_0x28b583)){return _0x28b583;}return _0xebcf('0x13');};exports['isActive']=function(_0x352ab7){if(_['isNil'](_0x352ab7)){return![];}return _0x352ab7;};exports[_0xebcf('0x14')]=function(_0x125663,_0x539a63,_0x407196,_0x11c32a,_0x5847cd,_0x5d93da){var _0x92c3ac={'XMD-QUEUE':_0x539a63['Queue']?_0x539a63[_0xebcf('0x15')][_0xebcf('0x16')]:'','XMD-CALLERID':_0x11c32a,'XMD-CALLERID-PREVIEW':_0x5d93da?util[_0xebcf('0x11')](_0xebcf('0x12'),_0x5d93da[_0xebcf('0x17')],_0x5d93da[_0xebcf('0x18')]):_0x11c32a,'XMD-DIALID':_0x5847cd,'XMD-CONTACTID':_0x539a63[_0xebcf('0x19')],'XMD-CDRTYPE':_0xebcf('0x1a'),'CALLERID(all)':_0x11c32a,'XMD-VOICEQUEUEID':_0x539a63[_0xebcf('0x1b')],'XMD-DIALCHANNEL':_0x407196,'XMD-DIALTIMEOUT':_0x125663[_0xebcf('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xebcf('0x11')](_0xebcf('0x1d'),_0x125663['dialQueueProject2']?'g':'',_[_0xebcf('0xf')](_0x125663[_0xebcf('0x1e')])?'':_0xebcf('0x1f')),'XMD-DIALURL':_0x125663[_0xebcf('0x20')]||'','XMD-AGI':_0x125663['dialQueueProject']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x125663[_0xebcf('0x21')]):_0xebcf('0x22'),'XMD-AGIAFTER':_0x125663[_0xebcf('0x23')]?util[_0xebcf('0x11')](_0xebcf('0x24'),ipAgi,_0x125663['dialQueueProject2']):_0xebcf('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x5d93da?_0x5d93da[_0xebcf('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x5d93da?_0x5d93da[_0xebcf('0x26')]:'','XMD-DESTINATION':_0xebcf('0x27'),'SIPADDHEADER':_0xebcf('0x28')};if(!_['isEmpty'](_0x125663['monitor_format'])){_0x92c3ac[util['format']('%s',_0xebcf('0x29'))]=_0x125663[_0xebcf('0x1e')];_0x92c3ac[util[_0xebcf('0x11')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x5847cd;}return _0x92c3ac;};exports[_0xebcf('0x2a')]=function(_0x5ee6e9){var _0x375945={};for(var _0xadb46e in _0x5ee6e9){if(_0x5ee6e9[_0xebcf('0x2b')](_0xadb46e)){_0x375945[util[_0xebcf('0x11')]('%s',_[_0xebcf('0x2c')](_0xadb46e))]=_0x5ee6e9[_0xadb46e];}}return{'variables':_0x375945};};exports[_0xebcf('0x2d')]=function(_0x49afad,_0x2bf46c){if(!_[_0xebcf('0x2e')](_0x49afad)){if(_0x49afad[_0xebcf('0x2b')](_0xebcf('0x2f'))){if(_0x49afad[_0xebcf('0x2f')]>0x0){_0x49afad['originated']-=0x1;}else{logger[_0xebcf('0xa')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x2bf46c);}}}else{logger[_0xebcf('0xa')](_0xebcf('0x30'),_0x2bf46c);}};exports['logBlacklist']=function(_0x5e8a9a){var _0x4afd4a=moment()[_0xebcf('0x11')](_0xebcf('0x31'));_0x5e8a9a[_0xebcf('0x32')]=0xd;_0x5e8a9a[_0xebcf('0x33')]=_0xebcf('0x34');_0x5e8a9a[_0xebcf('0x35')]=_0x4afd4a;_0x5e8a9a[_0xebcf('0x36')]=_0x4afd4a;_0x5e8a9a[_0xebcf('0x37')]=_0x4afd4a;};exports[_0xebcf('0x38')]=function(_0x591964,_0x3ebac5,_0x822935){var _0xca91fc=moment()[_0xebcf('0x11')](_0xebcf('0x31'));_0x591964['state']=_0x3ebac5;_0x591964[_0xebcf('0x33')]=_0x822935;_0x591964[_0xebcf('0x36')]=_0xca91fc;_0x591964['ringtime']=utils[_0xebcf('0x39')](_0x591964[_0xebcf('0x36')],_0x591964[_0xebcf('0x35')]);};exports['logLookAgent']=function(_0x3065be,_0x2dcea9,_0x459294){_0x3065be[_0xebcf('0x3a')]=_0x2dcea9;_0x3065be[_0xebcf('0x3b')]=_0x459294;};exports[_0xebcf('0x3c')]=function(_0x8538bb,_0x5cdc1f,_0x45fdff){var _0x22147a=moment()[_0xebcf('0x11')](_0xebcf('0x31'));_0x8538bb['state']=_0x5cdc1f;_0x8538bb[_0xebcf('0x33')]=_0x45fdff;_0x8538bb[_0xebcf('0x36')]=_0x8538bb[_0xebcf('0x36')]?_0x8538bb['responsetime']:_0x22147a;_0x8538bb[_0xebcf('0x37')]=_0x8538bb[_0xebcf('0x37')]?_0x8538bb[_0xebcf('0x37')]:_0x22147a;_0x8538bb[_0xebcf('0x3d')]=utils[_0xebcf('0x39')](_0x8538bb[_0xebcf('0x36')]||0x0,_0x8538bb['starttime']||0x0);_0x8538bb['talktime']=_0x8538bb[_0xebcf('0x3e')]?utils[_0xebcf('0x39')](_0x8538bb['endtime'],_0x8538bb[_0xebcf('0x3e')]):0x0;};exports[_0xebcf('0x3f')]=function(_0x4861eb){return _0x4861eb==='Failure';};exports['variablesAction']=function(_0x4f3046,_0x1abd8d,_0x1ca286,_0x1ae8d7,_0xebead6){var _0x4728a0=_0x1ae8d7?'RECALL':_0x4f3046[_0xebcf('0x17')];_0x4728a0=_0xebead6?'BOOKED':_0x4728a0;return{'actionid':_0x4f3046[_0xebcf('0x40')],'action':'originate','channel':_0x4f3046['channelAgent'],'callerid':util[_0xebcf('0x11')]('\x22%s\x22\x20<%s>',_0x4728a0,_0x4f3046[_0xebcf('0x18')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x1ca286,'timeout':(_0x1abd8d[_0xebcf('0x41')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4f3046[_0xebcf('0x40')]};};exports[_0xebcf('0x42')]=function(_0x59a58a){return _0x59a58a[_0xebcf('0x43')]+_0x59a58a[_0xebcf('0x44')]+_0x59a58a[_0xebcf('0x45')]+_0x59a58a[_0xebcf('0x46')]+_0x59a58a[_0xebcf('0x47')];};exports[_0xebcf('0x48')]=function(_0x37099b){var _0x4cba7c=_[_0xebcf('0x49')](_0x37099b);_0x4cba7c[_0xebcf('0x32')]=0xf;_0x4cba7c[_0xebcf('0x33')]=_0xebcf('0x4a');return _0x4cba7c;};exports[_0xebcf('0x4b')]=function(_0x113118,_0x43dc47,_0x137cb6){var _0x528056={};_0x528056[_0x43dc47]=_0x113118[_0x43dc47];_0x528056[_0xebcf('0x4c')]=![];_0x528056['scheduledat']=moment()['add'](_0x137cb6,_0xebcf('0x4d'))['format'](_0xebcf('0x31'));_0x528056['ContactId']=_0x113118[_0xebcf('0x19')];_0x528056[_0xebcf('0x4e')]=_0x113118[_0xebcf('0x4e')];_0x528056[_0xebcf('0x1b')]=_0x113118['VoiceQueueId']||undefined;return _0x528056;};exports[_0xebcf('0x4f')]=function(_0x107e6e,_0x1b894a){if(!_[_0xebcf('0x2e')](_0x107e6e)){if(_0x107e6e[_0xebcf('0x50')]>0x0){_0x107e6e[_0xebcf('0x50')]-=0x1;}else{logger[_0xebcf('0xa')](_0x1b894a,_0xebcf('0x51'));}}else{logger['error'](_0x1b894a,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xebcf('0x52')]=function(_0x50ba38){if(_0x50ba38<=0x0){return!![];}return![];};function buildObj(_0x24af38,_0x13513f,_0x91d6e2){_0x24af38[_0xebcf('0x53')]=_0x13513f;_0x24af38[_0xebcf('0x16')]=_0x24af38[_0xebcf('0x54')];_0x24af38[_0xebcf('0x55')]=_0x24af38[_0xebcf('0x56')];_0x24af38[_0xebcf('0x57')]='voice';if(_0x91d6e2){_0x24af38[_0xebcf('0x58')]=_0x91d6e2[_0xebcf('0x58')];}return _0x24af38;}exports[_0xebcf('0x59')]=buildObj;exports[_0xebcf('0x5a')]=function(_0x1a4cc1){var _0x3df8d4=[];for(var _0x225f55 in _0x1a4cc1){if(_0x1a4cc1[_0xebcf('0x2b')](_0x225f55)){if(!_[_0xebcf('0x2e')](_0x1a4cc1[_0x225f55])&&_0x1a4cc1[_0x225f55]['state']===_0xebcf('0x5b')&&_0x1a4cc1[_0x225f55]['status']===_0xebcf('0x5c')){_0x3df8d4[_0xebcf('0x5d')](_0x1a4cc1[_0x225f55]['id']);}}}return _0x3df8d4;};exports[_0xebcf('0x5e')]=function(_0x3e2ab5){var _0x2743f5=moment()[_0xebcf('0x5f')](0x0);var _0x5ccbac=moment(_0x3e2ab5)[_0xebcf('0x5f')](0x0);return _0x2743f5[_0xebcf('0x60')](_0x5ccbac,_0xebcf('0x61'));};exports[_0xebcf('0x62')]=function(_0x481970){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x481970[_0xebcf('0x19')],'ListId':_0x481970['ListId'],'VoiceQueueId':_0x481970['VoiceQueueId']||undefined,'CampaignId':_0x481970[_0xebcf('0x63')]||undefined};};exports[_0xebcf('0x64')]=function(_0x327142){if(_0x327142===_0xebcf('0x40')||_0x327142==='idContact'||_0x327142==='queue'||_0x327142===_0xebcf('0x65')||_0x327142===_0xebcf('0x66')||_0x327142==='dialAnswer'||_0x327142==='membername'||_0x327142===_0xebcf('0x56')||_0x327142===_0xebcf('0x17')||_0x327142==='active'||_0x327142==='calleridnum'||_0x327142===_0xebcf('0x67')||_0x327142==='countbusyretry'||_0x327142===_0xebcf('0x44')||_0x327142===_0xebcf('0x45')||_0x327142===_0xebcf('0x68')||_0x327142===_0xebcf('0x69')||_0x327142==='callbackuniqueid'||_0x327142==='callbackat'||_0x327142==='recallme'||_0x327142===_0xebcf('0x19')||_0x327142==='ListId'||_0x327142==='UserId'||_0x327142===_0xebcf('0x1b')||_0x327142==='sipcallid'||_0x327142===_0xebcf('0x6a')||_0x327142===_0xebcf('0x6b')||_0x327142==='xmd-phone'||_0x327142===_0xebcf('0x6c')||_0x327142==='xmd-dialurl'||_0x327142===_0xebcf('0x6d')||_0x327142==='xmd-dialoptions'||_0x327142===_0xebcf('0x6e')||_0x327142==='xmd-dialchannel'||_0x327142===_0xebcf('0x6f')||_0x327142===_0xebcf('0x70')||_0x327142===_0xebcf('0x71')||_0x327142==='xmd-agiafter'||_0x327142===_0xebcf('0x72')||_0x327142===_0xebcf('0x73')||_0x327142===_0xebcf('0x74')||_0x327142===_0xebcf('0x75')||_0x327142===_0xebcf('0x76')||_0x327142===_0xebcf('0x77')||_0x327142===_0xebcf('0x78')||_0x327142===_0xebcf('0x79')||_0x327142===_0xebcf('0x7a')||_0x327142==='rtpaudioqos'||_0x327142===_0xebcf('0x74')||_0x327142===_0xebcf('0x75')||_0x327142===_0xebcf('0x76')||_0x327142==='rtpaudioqosloss'||_0x327142===_0xebcf('0x78')||_0x327142===_0xebcf('0x79')||_0x327142===_0xebcf('0x7a')||_0x327142==='bridgepeer'||_0x327142===_0xebcf('0x7b')||_0x327142===_0xebcf('0x32')||_0x327142===_0xebcf('0x33')){return![];}return!![];};exports[_0xebcf('0x7c')]=function(_0x35b166,_0x15a307){var _0x322af3,_0x3772d7,_0x2ed8bd;if(_0x15a307<=0x0){_0x15a307=0x1;}_0x322af3=new RegExp(_0xebcf('0x7d')+_0x15a307+'}$');_0x3772d7=Math['pow'](0xa,_0x15a307-0x1);_0x2ed8bd=Math['pow'](0xa,_0x15a307)-0x1;return util[_0xebcf('0x11')]('%s',_[_0xebcf('0x7e')](_0x35b166,_0x322af3,_[_0xebcf('0x7f')](_0x3772d7,_0x2ed8bd)));};exports[_0xebcf('0x80')]=function(_0x2c77e3){var _0x4eb9a3=_0x2c77e3[_0xebcf('0x81')](/"(.*?)"/);return _0x4eb9a3?_0x4eb9a3[0x1]:_0x2c77e3;};exports[_0xebcf('0x82')]=function(_0x48a0df){var _0x33240b=_0x48a0df[_0xebcf('0x81')](/<(.*?)>/);return _0x33240b?_0x33240b[0x1]:_0x48a0df;};function buildNoAnswerEventPayload(_0x45a2e1,_0x21c54b){var _0x505555=buildObj(_0x45a2e1,'noanswer');if(!_['isEmpty'](_0x21c54b[_0xebcf('0x83')])){Object[_0xebcf('0x84')](_0x21c54b['variables'])[_0xebcf('0x85')](function(_0x36ec10){_0x505555[_0x36ec10['toLowerCase']()]=_0x21c54b[_0xebcf('0x83')][_0x36ec10];});}return _0x505555;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0xb93d=['Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','interface','channelAgent','motionChannel','buildObj','agentReadyId','status','push','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','type','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','toLowerCase','buildNoAnswerEventPayload','util','lodash','../../../../config/logger','XCALLY_IP_AGI','../../dialer/utils','error','inspect','logger','info','message','getCallerId','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','ContactId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','monitor_format','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','endtime','logAgent','ringtime','getSeconds','responsetime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','originate','calleridnum','xcally-motion-preview','from-sip','timeout','uniqueid','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone'];(function(_0x1a5f8f,_0xd5e605){var _0x3b6afa=function(_0x5b304d){while(--_0x5b304d){_0x1a5f8f['push'](_0x1a5f8f['shift']());}};_0x3b6afa(++_0xd5e605);}(_0xb93d,0x15b));var _0xdb93=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xb93d[_0x26f702];return _0x11417d;};'use strict';var util=require(_0xdb93('0x0'));var _=require(_0xdb93('0x1'));var moment=require('moment');var logger=require(_0xdb93('0x2'))('preview');var ipAgi=process['env'][_0xdb93('0x3')]||'127.0.0.1';var utils=require(_0xdb93('0x4'));exports['loggerCatch']=function(_0x207a1c){return function(_0x23bfff){logger[_0xdb93('0x5')](_0x207a1c,util[_0xdb93('0x6')](_0x23bfff,{'showHidden':![],'depth':null}));};};exports[_0xdb93('0x7')]=function(_0xc64d89,_0x1c1aac){logger[_0xdb93('0x8')](_0xc64d89,util[_0xdb93('0x6')](_0x1c1aac,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x2c648d,_0xb560fd){logger[_0xdb93('0x5')](_0x2c648d,util[_0xdb93('0x6')](_0xb560fd,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x1ad2a0){return function(_0xfa27dd){logger['info'](_0x1ad2a0,util[_0xdb93('0x6')](_0xfa27dd,{'showHidden':![],'depth':null}));};};exports[_0xdb93('0x9')]=function(_0x6ae6cc,_0x1a2e3e,_0x29d4e9){return{'message':_0x6ae6cc,'unlock':_0x1a2e3e,'active':_0x29d4e9};};exports[_0xdb93('0xa')]=function(_0x2a06ed,_0x64605,_0x22fbfb){if(!_[_0xdb93('0xb')](_0x22fbfb)&&'string'===typeof _0x22fbfb&&!_[_0xdb93('0xc')](_0x22fbfb)){if(!_['isUndefined'](_0x64605)&&'string'===typeof _0x64605&&!_[_0xdb93('0xc')](_0x64605)){return util[_0xdb93('0xd')](_0xdb93('0xe'),_0x64605,_0x22fbfb);}return util[_0xdb93('0xd')](_0xdb93('0xe'),_0x22fbfb,_0x22fbfb);}if(!_['isUndefined'](_0x2a06ed)&&_0xdb93('0xf')===typeof _0x2a06ed&&!_[_0xdb93('0xc')](_0x2a06ed)){return _0x2a06ed;}return _0xdb93('0x10');};exports[_0xdb93('0x11')]=function(_0x11a7a0){if(_[_0xdb93('0x12')](_0x11a7a0)){return![];}return _0x11a7a0;};exports['addVariables']=function(_0x52f7e7,_0x20b1a8,_0x19eeeb,_0x169577,_0x1dad29,_0xae9aab){var _0x1de7d5={'XMD-QUEUE':_0x20b1a8[_0xdb93('0x13')]?_0x20b1a8[_0xdb93('0x13')][_0xdb93('0x14')]:'','XMD-CALLERID':_0x169577,'XMD-CALLERID-PREVIEW':_0xae9aab?util['format'](_0xdb93('0xe'),_0xae9aab[_0xdb93('0x15')],_0xae9aab['calleridnum']):_0x169577,'XMD-DIALID':_0x1dad29,'XMD-CONTACTID':_0x20b1a8[_0xdb93('0x16')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x169577,'XMD-VOICEQUEUEID':_0x20b1a8['VoiceQueueId'],'XMD-DIALCHANNEL':_0x19eeeb,'XMD-DIALTIMEOUT':_0x52f7e7[_0xdb93('0x17')]||0x1e,'XMD-DIALOPTIONS':util[_0xdb93('0xd')](_0xdb93('0x18'),_0x52f7e7[_0xdb93('0x19')]?'g':'',_['isEmpty'](_0x52f7e7['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x52f7e7[_0xdb93('0x1a')]||'','XMD-AGI':_0x52f7e7['dialQueueProject']?util['format'](_0xdb93('0x1b'),ipAgi,_0x52f7e7['dialQueueProject']):_0xdb93('0x1c'),'XMD-AGIAFTER':_0x52f7e7[_0xdb93('0x19')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x52f7e7[_0xdb93('0x19')]):_0xdb93('0x1c'),'XMD-ORIGINATECALLERIDNUM':_0xae9aab?_0xae9aab[_0xdb93('0x1d')]:'','XMD-ORIGINATECALLERIDNAME':_0xae9aab?_0xae9aab[_0xdb93('0x1e')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0xdb93('0x1f')};if(!_[_0xdb93('0xc')](_0x52f7e7['monitor_format'])){_0x1de7d5[util[_0xdb93('0xd')]('%s',_0xdb93('0x20'))]=_0x52f7e7[_0xdb93('0x21')];_0x1de7d5[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1dad29;}return _0x1de7d5;};exports[_0xdb93('0x22')]=function(_0x2c877a){var _0x287d52={};for(var _0x5741d6 in _0x2c877a){if(_0x2c877a[_0xdb93('0x23')](_0x5741d6)){_0x287d52[util['format']('%s',_['toLower'](_0x5741d6))]=_0x2c877a[_0x5741d6];}}return{'variables':_0x287d52};};exports[_0xdb93('0x24')]=function(_0xb6afa8,_0x3b17f8){if(!_[_0xdb93('0x12')](_0xb6afa8)){if(_0xb6afa8[_0xdb93('0x23')](_0xdb93('0x25'))){if(_0xb6afa8[_0xdb93('0x25')]>0x0){_0xb6afa8[_0xdb93('0x25')]-=0x1;}else{logger[_0xdb93('0x5')](_0xdb93('0x26'),_0x3b17f8);}}}else{logger[_0xdb93('0x5')](_0xdb93('0x27'),_0x3b17f8);}};exports[_0xdb93('0x28')]=function(_0x5d2b45){var _0x5825db=moment()[_0xdb93('0xd')](_0xdb93('0x29'));_0x5d2b45[_0xdb93('0x2a')]=0xd;_0x5d2b45[_0xdb93('0x2b')]=_0xdb93('0x2c');_0x5d2b45[_0xdb93('0x2d')]=_0x5825db;_0x5d2b45['responsetime']=_0x5825db;_0x5d2b45[_0xdb93('0x2e')]=_0x5825db;};exports[_0xdb93('0x2f')]=function(_0x10deea,_0x1110c4,_0x22a0b1){var _0x234efe=moment()[_0xdb93('0xd')](_0xdb93('0x29'));_0x10deea[_0xdb93('0x2a')]=_0x1110c4;_0x10deea['statedesc']=_0x22a0b1;_0x10deea['responsetime']=_0x234efe;_0x10deea[_0xdb93('0x30')]=utils[_0xdb93('0x31')](_0x10deea[_0xdb93('0x32')],_0x10deea[_0xdb93('0x2d')]);};exports[_0xdb93('0x33')]=function(_0x35ff73,_0x42cc0a,_0x21f8e2){_0x35ff73[_0xdb93('0x34')]=_0x42cc0a;_0x35ff73[_0xdb93('0x35')]=_0x21f8e2;};exports[_0xdb93('0x36')]=function(_0x22a40d,_0x398104,_0x2a3ec4){var _0x146af2=moment()[_0xdb93('0xd')]('YYYY-MM-DD\x20HH:mm:ss');_0x22a40d[_0xdb93('0x2a')]=_0x398104;_0x22a40d[_0xdb93('0x2b')]=_0x2a3ec4;_0x22a40d[_0xdb93('0x32')]=_0x22a40d['responsetime']?_0x22a40d[_0xdb93('0x32')]:_0x146af2;_0x22a40d['endtime']=_0x22a40d[_0xdb93('0x2e')]?_0x22a40d[_0xdb93('0x2e')]:_0x146af2;_0x22a40d[_0xdb93('0x30')]=utils[_0xdb93('0x31')](_0x22a40d[_0xdb93('0x32')]||0x0,_0x22a40d['starttime']||0x0);_0x22a40d[_0xdb93('0x37')]=_0x22a40d[_0xdb93('0x38')]?utils[_0xdb93('0x31')](_0x22a40d['endtime'],_0x22a40d[_0xdb93('0x38')]):0x0;};exports[_0xdb93('0x39')]=function(_0x1e8947){return _0x1e8947===_0xdb93('0x3a');};exports[_0xdb93('0x3b')]=function(_0x5b6747,_0xdb8593,_0x3d6ede,_0x3c31e1,_0x2e87b1){var _0xe9ef03=_0x3c31e1?'RECALL':_0x5b6747[_0xdb93('0x15')];_0xe9ef03=_0x2e87b1?_0xdb93('0x3c'):_0xe9ef03;return{'actionid':_0x5b6747['uniqueid'],'action':_0xdb93('0x3d'),'channel':_0x5b6747['channelAgent'],'callerid':util[_0xdb93('0xd')]('\x22%s\x22\x20<%s>',_0xe9ef03,_0x5b6747[_0xdb93('0x3e')]),'Exten':_0xdb93('0x3f'),'Context':_0xdb93('0x40'),'Priority':'1','variable':_0x3d6ede,'timeout':(_0xdb8593[_0xdb93('0x41')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5b6747[_0xdb93('0x42')]};};exports[_0xdb93('0x43')]=function(_0x11c671){return _0x11c671['countbusyretry']+_0x11c671[_0xdb93('0x44')]+_0x11c671[_0xdb93('0x45')]+_0x11c671[_0xdb93('0x46')]+_0x11c671[_0xdb93('0x47')];};exports['cloneAction']=function(_0x29fd0a){var _0x17aaad=_[_0xdb93('0x48')](_0x29fd0a);_0x17aaad['state']=0xf;_0x17aaad['statedesc']=_0xdb93('0x49');return _0x17aaad;};exports[_0xdb93('0x4a')]=function(_0xbf55c6,_0x25180b,_0x9e70ac){var _0x939265={};_0x939265[_0x25180b]=_0xbf55c6[_0x25180b];_0x939265[_0xdb93('0x4b')]=![];_0x939265[_0xdb93('0x4c')]=moment()[_0xdb93('0x4d')](_0x9e70ac,_0xdb93('0x4e'))[_0xdb93('0xd')](_0xdb93('0x29'));_0x939265['ContactId']=_0xbf55c6[_0xdb93('0x16')];_0x939265[_0xdb93('0x4f')]=_0xbf55c6['ListId'];_0x939265[_0xdb93('0x50')]=_0xbf55c6['VoiceQueueId']||undefined;return _0x939265;};exports[_0xdb93('0x51')]=function(_0x5b46de,_0x43c795){if(!_[_0xdb93('0x12')](_0x5b46de)){if(_0x5b46de[_0xdb93('0x52')]>0x0){_0x5b46de[_0xdb93('0x52')]-=0x1;}else{logger[_0xdb93('0x5')](_0x43c795,_0xdb93('0x53'));}}else{logger['error'](_0x43c795,_0xdb93('0x54'));}};exports[_0xdb93('0x55')]=function(_0x291b64){if(_0x291b64<=0x0){return!![];}return![];};function buildObj(_0xeb233b,_0x1b997d,_0x5c371b){_0xeb233b['lastevent']=_0x1b997d;_0xeb233b[_0xdb93('0x14')]=_0xeb233b[_0xdb93('0x56')];_0xeb233b[_0xdb93('0x57')]=_0xeb233b[_0xdb93('0x58')];_0xeb233b[_0xdb93('0x59')]='voice';if(_0x5c371b){_0xeb233b['mandatoryDisposition']=_0x5c371b['mandatoryDisposition'];}return _0xeb233b;}exports[_0xdb93('0x5a')]=buildObj;exports[_0xdb93('0x5b')]=function(_0x1f0f07){var _0x1d4fc4=[];for(var _0x183773 in _0x1f0f07){if(_0x1f0f07[_0xdb93('0x23')](_0x183773)){if(!_[_0xdb93('0x12')](_0x1f0f07[_0x183773])&&_0x1f0f07[_0x183773][_0xdb93('0x2a')]==='not_inuse'&&_0x1f0f07[_0x183773][_0xdb93('0x5c')]==='reachable'){_0x1d4fc4[_0xdb93('0x5d')](_0x1f0f07[_0x183773]['id']);}}}return _0x1d4fc4;};exports['getDiff']=function(_0x55c6bb){var _0xc751d=moment()['milliseconds'](0x0);var _0xc25191=moment(_0x55c6bb)[_0xdb93('0x5e')](0x0);return _0xc751d[_0xdb93('0x5f')](_0xc25191,_0xdb93('0x60'));};exports[_0xdb93('0x61')]=function(_0x385031){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x385031[_0xdb93('0x16')],'ListId':_0x385031['ListId'],'VoiceQueueId':_0x385031[_0xdb93('0x50')]||undefined,'CampaignId':_0x385031[_0xdb93('0x62')]||undefined};};exports[_0xdb93('0x63')]=function(_0x159ef9){if(_0x159ef9==='uniqueid'||_0x159ef9===_0xdb93('0x64')||_0x159ef9===_0xdb93('0x56')||_0x159ef9===_0xdb93('0x65')||_0x159ef9==='campaigntype'||_0x159ef9===_0xdb93('0x66')||_0x159ef9==='membername'||_0x159ef9===_0xdb93('0x58')||_0x159ef9==='calleridname'||_0x159ef9==='active'||_0x159ef9===_0xdb93('0x3e')||_0x159ef9===_0xdb93('0x4c')||_0x159ef9==='countbusyretry'||_0x159ef9==='countcongestionretry'||_0x159ef9===_0xdb93('0x45')||_0x159ef9===_0xdb93('0x67')||_0x159ef9===_0xdb93('0x68')||_0x159ef9===_0xdb93('0x69')||_0x159ef9===_0xdb93('0x6a')||_0x159ef9===_0xdb93('0x6b')||_0x159ef9===_0xdb93('0x16')||_0x159ef9===_0xdb93('0x4f')||_0x159ef9===_0xdb93('0x35')||_0x159ef9===_0xdb93('0x50')||_0x159ef9===_0xdb93('0x6c')||_0x159ef9==='xmd-voicequeueid'||_0x159ef9==='xmd-queue'||_0x159ef9===_0xdb93('0x6d')||_0x159ef9==='xmd-listid'||_0x159ef9===_0xdb93('0x6e')||_0x159ef9===_0xdb93('0x6f')||_0x159ef9===_0xdb93('0x70')||_0x159ef9===_0xdb93('0x71')||_0x159ef9===_0xdb93('0x72')||_0x159ef9===_0xdb93('0x73')||_0x159ef9===_0xdb93('0x74')||_0x159ef9==='xmd-callerid'||_0x159ef9==='xmd-agiafter'||_0x159ef9===_0xdb93('0x75')||_0x159ef9===_0xdb93('0x76')||_0x159ef9===_0xdb93('0x77')||_0x159ef9==='rtpaudioqosjitter'||_0x159ef9===_0xdb93('0x78')||_0x159ef9===_0xdb93('0x79')||_0x159ef9===_0xdb93('0x7a')||_0x159ef9===_0xdb93('0x7b')||_0x159ef9==='rtpaudioqosrttbridged'||_0x159ef9==='rtpaudioqos'||_0x159ef9===_0xdb93('0x77')||_0x159ef9===_0xdb93('0x7c')||_0x159ef9===_0xdb93('0x78')||_0x159ef9==='rtpaudioqosloss'||_0x159ef9===_0xdb93('0x7a')||_0x159ef9===_0xdb93('0x7b')||_0x159ef9==='rtpaudioqosrttbridged'||_0x159ef9===_0xdb93('0x7d')||_0x159ef9===_0xdb93('0x7e')||_0x159ef9===_0xdb93('0x2a')||_0x159ef9===_0xdb93('0x2b')){return![];}return!![];};exports[_0xdb93('0x7f')]=function(_0x498271,_0x5533ed){var _0x3a08b2,_0x2b1f86,_0x38a336;if(_0x5533ed<=0x0){_0x5533ed=0x1;}_0x3a08b2=new RegExp(_0xdb93('0x80')+_0x5533ed+'}$');_0x2b1f86=Math[_0xdb93('0x81')](0xa,_0x5533ed-0x1);_0x38a336=Math['pow'](0xa,_0x5533ed)-0x1;return util[_0xdb93('0xd')]('%s',_[_0xdb93('0x82')](_0x498271,_0x3a08b2,_[_0xdb93('0x83')](_0x2b1f86,_0x38a336)));};exports[_0xdb93('0x84')]=function(_0xec1c2f){var _0x1e271e=_0xec1c2f[_0xdb93('0x85')](/"(.*?)"/);return _0x1e271e?_0x1e271e[0x1]:_0xec1c2f;};exports[_0xdb93('0x86')]=function(_0x1a8ba6){var _0x56449a=_0x1a8ba6[_0xdb93('0x85')](/<(.*?)>/);return _0x56449a?_0x56449a[0x1]:_0x1a8ba6;};function buildNoAnswerEventPayload(_0x250edf,_0x4e8be0){var _0x1ea250=buildObj(_0x250edf,_0xdb93('0x87'));if(!_[_0xdb93('0xc')](_0x4e8be0[_0xdb93('0x88')])){Object[_0xdb93('0x89')](_0x4e8be0[_0xdb93('0x88')])['forEach'](function(_0x4dfed7){_0x1ea250[_0x4dfed7[_0xdb93('0x8a')]()]=_0x4e8be0['variables'][_0x4dfed7];});}return _0x1ea250;}exports[_0xdb93('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 183ff45..66b57ce 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 _0x8552=['boolean','queuepause','reload','voicequeuechannel','voicequeuechannelredirect','queueadd','string','number'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x8552,0x65));var _0x2855=function(_0x4a8f5f,_0x7cd06b){_0x4a8f5f=_0x4a8f5f-0x0;var _0x103648=_0x8552[_0x4a8f5f];return _0x103648;};'use strict';exports[_0x2855('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x2855('0x1'),'required':!![]},'membername':{'type':_0x2855('0x1'),'required':!![]},'penalty':{'type':_0x2855('0x2'),'required':![]},'paused':{'type':_0x2855('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x2855('0x1'),'required':!![]},'interface':{'type':_0x2855('0x1'),'required':!![]}};exports[_0x2855('0x4')]={'interface':{'type':_0x2855('0x1'),'required':!![]},'paused':{'type':_0x2855('0x3')},'reason':{'type':_0x2855('0x1'),'required':![]}};exports[_0x2855('0x5')]={'module':{'type':_0x2855('0x1'),'required':![]}};exports[_0x2855('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x2855('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x2855('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x2855('0x1'),'required':!![]}};exports[_0x2855('0x7')]={'uniqueid':{'type':_0x2855('0x1'),'required':!![]},'exten':{'type':_0x2855('0x1'),'required':!![]},'context':{'type':_0x2855('0x1')}}; \ No newline at end of file +var _0x0305=['number','boolean','queuepause','voicechannel','queueadd','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0305,0x136));var _0x5030=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0x0305[_0x15d18f];return _0xd12bf7;};'use strict';exports[_0x5030('0x0')]={'queue':{'type':_0x5030('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x5030('0x1'),'required':!![]},'penalty':{'type':_0x5030('0x2'),'required':![]},'paused':{'type':_0x5030('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x5030('0x1'),'required':!![]}};exports[_0x5030('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x5030('0x3')},'reason':{'type':_0x5030('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x5030('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x5030('0x1'),'required':!![]}};exports[_0x5030('0x5')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x5030('0x1')},'format':{'type':_0x5030('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x5030('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x5030('0x1'),'required':!![]},'exten':{'type':_0x5030('0x1'),'required':!![]},'context':{'type':_0x5030('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 0c04110..672af7d 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x43f74e,_0x12fd7e){var _0x1e904e=function(_0x310861){while(--_0x310861){_0x43f74e['push'](_0x43f74e['shift']());}};_0x1e904e(++_0x12fd7e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x556481,_0x102733){_0x556481=_0x556481-0x0;var _0xc6403f=_0x5f2f[_0x556481];return _0xc6403f;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file +var _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2032,0xd9));var _0x2203=function(_0xadfd8e,_0x4074eb){_0xadfd8e=_0xadfd8e-0x0;var _0x545450=_0x2032[_0xadfd8e];return _0x545450;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index cec5b97..9319974 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21c0=['hasOwnProperty'];(function(_0x499e36,_0xc35951){var _0x95bf7b=function(_0x332fe1){while(--_0x332fe1){_0x499e36['push'](_0x499e36['shift']());}};_0x95bf7b(++_0xc35951);}(_0x21c0,0x109));var _0x021c=function(_0x12ae73,_0x49975f){_0x12ae73=_0x12ae73-0x0;var _0x5ea6ea=_0x21c0[_0x12ae73];return _0x5ea6ea;};'use strict';function mergeDBDataToRealtime(_0x33f41e,_0x9c446f){var _0x3cb026=Object['assign']({},_0x33f41e);for(var _0x68cb74 in _0x9c446f){if(_0x3cb026[_0x021c('0x0')](_0x68cb74)){_0x3cb026[_0x68cb74]=_0x9c446f[_0x68cb74];}}return _0x3cb026;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file +var _0x9b1d=['mergeDBDataToRealtime','hasOwnProperty'];(function(_0x247aaa,_0x498ad1){var _0x33215a=function(_0x341711){while(--_0x341711){_0x247aaa['push'](_0x247aaa['shift']());}};_0x33215a(++_0x498ad1);}(_0x9b1d,0xed));var _0xd9b1=function(_0x56dd9a,_0xdc0140){_0x56dd9a=_0x56dd9a-0x0;var _0x174350=_0x9b1d[_0x56dd9a];return _0x174350;};'use strict';function mergeDBDataToRealtime(_0x4d9580,_0x36c786){var _0x12b2c2=Object['assign']({},_0x4d9580);for(var _0x3e877a in _0x36c786){if(_0x12b2c2[_0xd9b1('0x0')](_0x3e877a)){_0x12b2c2[_0x3e877a]=_0x36c786[_0x3e877a];}}return _0x12b2c2;}exports[_0xd9b1('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 6e109a6..83f774a 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 _0xc550=['connectedlinenum','assigned','lastAssignedTo','format','SIP/%s','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','getAgentByInternal','keys','getCallType','split','calleridnum','outbound','internal','exten','type','dialer','lastapplication','queue','lastdata','context','destination','calleridpreview','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','callerid','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','UserId','membername','monitor','monitors','filename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','forEach','startsWith','substring','indexOf','mobile','phone','transfererlinkedid','attendedTransfer','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','findAgent','accountcode','name','isNil','find','agents','interface','length'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xc550,0x142));var _0x0c55=function(_0x1a8a79,_0x57182d){_0x1a8a79=_0x1a8a79-0x0;var _0x436f4c=_0xc550[_0x1a8a79];return _0x436f4c;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var config=require(_0x0c55('0x0'));var ami=require(_0x0c55('0x1'));var RpcVoiceAgentReport=require(_0x0c55('0x2'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x0c55('0x3'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x0c55('0x4'));var RpcVoiceRecording=require(_0x0c55('0x5'));var RpcVoiceTransferReport=require(_0x0c55('0x6'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x0c55('0x7'));var VoiceAgentReport=require(_0x0c55('0x8'));var VoiceDialReport=require(_0x0c55('0x9'));var UserReport=require(_0x0c55('0xa'));function Report(_0x44771e){this[_0x0c55('0xb')]=_0x44771e;this['agents']=_0x44771e['agents'];this[_0x0c55('0xc')]=_0x44771e[_0x0c55('0xc')];}Report[_0x0c55('0xd')][_0x0c55('0xe')]=function(_0x45dfe8){var _0x4f0f97=new VoiceQueueReport(this['realtime']);var _0x32893b=new VoiceAgentReport(this[_0x0c55('0xb')]);var _0x54577d=new VoiceDialReport(this['realtime']);var _0x3582b2=new VoiceCallReport(this[_0x0c55('0xb')]);var _0x16dba9=new UserReport(this['realtime']);if(config[_0x0c55('0xf')]&&config[_0x0c55('0xf')][_0x0c55('0x10')]){ami['on'](_0x0c55('0x11'),this[_0x0c55('0x12')][_0x0c55('0x13')](this));ami['on']('custom:voiceCallReport',this[_0x0c55('0x14')][_0x0c55('0x13')](this));ami['on'](_0x0c55('0x15'),this['voiceAgentReport'][_0x0c55('0x13')](this));ami['on'](_0x0c55('0x16'),this[_0x0c55('0x17')]['bind'](this));ami['on'](_0x0c55('0x18'),this['blindTransfer']['bind'](this));ami['on'](_0x0c55('0x19'),this['attendedTransfer'][_0x0c55('0x13')](this));}};Report[_0x0c55('0xd')][_0x0c55('0x1a')]=function(_0x5a5e6d){var _0x5a2791;_0x5a2791=_['find'](this['agents'],function(_0x3023e9){return _0x3023e9[_0x0c55('0x1b')]==_0x5a5e6d||_0x3023e9[_0x0c55('0x1c')]==_0x5a5e6d;});if(_[_0x0c55('0x1d')](_0x5a2791)){var _0x2c2d66=_[_0x0c55('0x1e')](this[_0x0c55('0xc')],function(_0x4c6aaa){return _0x4c6aaa[_0x0c55('0x1b')]==_0x5a5e6d||_0x4c6aaa[_0x0c55('0x1c')]==_0x5a5e6d;});if(_0x2c2d66){_0x5a2791=_[_0x0c55('0x1e')](this[_0x0c55('0x1f')],function(_0x20158d){return _0x20158d[_0x0c55('0x20')]==util['format']('SIP/%s',_0x2c2d66[_0x0c55('0x1c')]);});}}return _0x5a2791;};Report[_0x0c55('0xd')][_0x0c55('0x12')]=function(_0x425148){for(var _0x379328=0x0;_0x379328<_0x425148[_0x0c55('0x21')];_0x379328+=0x1){var _0x2685d0=this[_0x0c55('0x1a')](_0x425148[_0x379328][_0x0c55('0x22')]);if(_0x2685d0){_0x425148[_0x379328][_0x0c55('0x1b')]=_0x2685d0[_0x0c55('0x1b')];_0x425148[_0x379328][_0x0c55('0x23')]=!![];_0x425148[_0x379328][_0x0c55('0x24')]=_0x2685d0[_0x0c55('0x1c')];_0x425148[_0x379328][_0x0c55('0x20')]=_[_0x0c55('0x1d')](_0x2685d0[_0x0c55('0x20')])?util[_0x0c55('0x25')](_0x0c55('0x26'),_0x2685d0[_0x0c55('0x1c')]):_0x2685d0['interface'];if(_0x425148[_0x379328]['queuecallercomplete']){_0x425148[_0x379328][_0x0c55('0x27')]=moment()[_0x0c55('0x25')](_0x0c55('0x28'));}if(_0x425148[_0x379328][_0x0c55('0x29')]){_0x425148[_0x379328]['queuecallerexitAt']=moment()['format'](_0x0c55('0x28'));}RpcMemberReport['voiceQueueReport'](_0x425148[_0x379328]);}RpcVoiceQueueReport[_0x0c55('0x2a')](_0x425148[_0x379328]);}};function extractCalleridNumber(_0x3c7b74){var _0x7217f9=_0x3c7b74['match'](/<(.*?)>/);return _0x7217f9?_0x7217f9[0x1]:_0x3c7b74;}Report['prototype'][_0x0c55('0x2b')]=function(_0x14028e){for(var _0x42698c=0x0;_0x42698c','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','blindTransfer','getCallType','UserId','membername','monitor','monitorFilename','monitors','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','voiceAgentReport','isArray','startsWith','Local','indexOf','phone','substring','lastIndexOf','SIP/%s','transfererlinkedid','lodash','moment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind'];(function(_0x3fbeea,_0x59b594){var _0x479753=function(_0x2d874d){while(--_0x2d874d){_0x3fbeea['push'](_0x3fbeea['shift']());}};_0x479753(++_0x59b594);}(_0x3476,0x16d));var _0x6347=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x3476[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x6347('0x0'));var moment=require(_0x6347('0x1'));var util=require('util');var config=require('../../../config/environment');var ami=require(_0x6347('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x6347('0x3'));var RpcVoiceDialReport=require(_0x6347('0x4'));var RpcMemberReport=require(_0x6347('0x5'));var RpcVoiceQueueReport=require(_0x6347('0x6'));var RpcVoiceRecording=require(_0x6347('0x7'));var RpcVoiceTransferReport=require(_0x6347('0x8'));var VoiceQueueReport=require(_0x6347('0x9'));var VoiceCallReport=require(_0x6347('0xa'));var VoiceAgentReport=require(_0x6347('0xb'));var VoiceDialReport=require(_0x6347('0xc'));var UserReport=require(_0x6347('0xd'));function Report(_0x375bb6){this['realtime']=_0x375bb6;this[_0x6347('0xe')]=_0x375bb6[_0x6347('0xe')];this[_0x6347('0xf')]=_0x375bb6[_0x6347('0xf')];}Report['prototype'][_0x6347('0x10')]=function(_0x4b529e){var _0x1f9d67=new VoiceQueueReport(this[_0x6347('0x11')]);var _0xc269ae=new VoiceAgentReport(this[_0x6347('0x11')]);var _0x3f6b8d=new VoiceDialReport(this[_0x6347('0x11')]);var _0x1cabf8=new VoiceCallReport(this[_0x6347('0x11')]);var _0x453f86=new UserReport(this['realtime']);if(config[_0x6347('0x12')]&&config['xdr'][_0x6347('0x13')]){ami['on'](_0x6347('0x14'),this[_0x6347('0x15')][_0x6347('0x16')](this));ami['on']('custom:voiceCallReport',this[_0x6347('0x17')][_0x6347('0x16')](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport'][_0x6347('0x16')](this));ami['on'](_0x6347('0x18'),this[_0x6347('0x19')]['bind'](this));ami['on'](_0x6347('0x1a'),this['blindTransfer'][_0x6347('0x16')](this));ami['on'](_0x6347('0x1b'),this[_0x6347('0x1c')][_0x6347('0x16')](this));}};Report['prototype']['findAgent']=function(_0x2adc34){var _0x213215;_0x213215=_[_0x6347('0x1d')](this[_0x6347('0xe')],function(_0x442a05){return _0x442a05[_0x6347('0x1e')]==_0x2adc34||_0x442a05[_0x6347('0x1f')]==_0x2adc34;});if(_[_0x6347('0x20')](_0x213215)){var _0x135fda=_[_0x6347('0x1d')](this[_0x6347('0xf')],function(_0x27f1a3){return _0x27f1a3[_0x6347('0x1e')]==_0x2adc34||_0x27f1a3[_0x6347('0x1f')]==_0x2adc34;});if(_0x135fda){_0x213215=_['find'](this[_0x6347('0xe')],function(_0x5c76d9){return _0x5c76d9[_0x6347('0x21')]==util[_0x6347('0x22')]('SIP/%s',_0x135fda['name']);});}}return _0x213215;};Report[_0x6347('0x23')][_0x6347('0x15')]=function(_0x178b2e){for(var _0x2b7203=0x0;_0x2b7203<_0x178b2e[_0x6347('0x24')];_0x2b7203+=0x1){var _0x5b6a58=this[_0x6347('0x25')](_0x178b2e[_0x2b7203][_0x6347('0x26')]);if(_0x5b6a58){_0x178b2e[_0x2b7203]['accountcode']=_0x5b6a58[_0x6347('0x1e')];_0x178b2e[_0x2b7203][_0x6347('0x27')]=!![];_0x178b2e[_0x2b7203][_0x6347('0x28')]=_0x5b6a58[_0x6347('0x1f')];_0x178b2e[_0x2b7203]['interface']=_[_0x6347('0x20')](_0x5b6a58[_0x6347('0x21')])?util[_0x6347('0x22')]('SIP/%s',_0x5b6a58['name']):_0x5b6a58['interface'];if(_0x178b2e[_0x2b7203][_0x6347('0x29')]){_0x178b2e[_0x2b7203][_0x6347('0x2a')]=moment()[_0x6347('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x178b2e[_0x2b7203][_0x6347('0x2b')]){_0x178b2e[_0x2b7203][_0x6347('0x2c')]=moment()['format'](_0x6347('0x2d'));}RpcMemberReport[_0x6347('0x15')](_0x178b2e[_0x2b7203]);}RpcVoiceQueueReport[_0x6347('0x2e')](_0x178b2e[_0x2b7203]);}};function extractCalleridNumber(_0x52eee3){var _0x2cd0b9=_0x52eee3['match'](/<(.*?)>/);return _0x2cd0b9?_0x2cd0b9[0x1]:_0x52eee3;}Report['prototype'][_0x6347('0x2f')]=function(_0x16f07a){for(var _0x494098=0x0;_0x4940980x0?!![]:![];if(!_0x12b5cc){return this['syncQueueSummaryComplete'](this['summary']['completeEvent']);}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x16')]=function(_0x2f62a7){var _0x31529=this[_0xf6f7('0x5f')]['id'];if(this['summary'][_0xf6f7('0x63')][_0x31529]&&this['summary']['queuestatus'][_0x31529][_0x2f62a7[_0xf6f7('0x62')]]){this[_0xf6f7('0x5f')]['queuestatus'][_0x31529][_0x2f62a7['actionid']]['agents'][_0xf6f7('0x6e')](_0x2f62a7);}};VoiceQueueReport[_0xf6f7('0x38')]['syncQueueSummary']=function(_0x8727b7){var _0x11ab00=this;try{if(this[_0xf6f7('0x5a')](_0x8727b7)&&this['isNotNull'](_0x8727b7[_0xf6f7('0x4f')])){logger['debug'](_0xf6f7('0x6f'),util[_0xf6f7('0x40')](_0x8727b7,{'showHidden':![],'depth':null}));var _0x57a7ac=this['voiceQueues'][_0x8727b7[_0xf6f7('0x4f')]];if(_0x57a7ac){logger[_0xf6f7('0x49')](_0xf6f7('0x70'),_0x57a7ac['name']);this[_0xf6f7('0x5f')][_0xf6f7('0x5d')][_0x57a7ac[_0xf6f7('0x66')]]={'summaryEvent':_0x8727b7};this[_0xf6f7('0x5f')][_0xf6f7('0x6d')]+=0x1;return ami['Action']({'action':_0xf6f7('0x63'),'queue':_0x57a7ac[_0xf6f7('0x66')]})[_0xf6f7('0x61')](function(_0x3a0ae1){if(!_0x11ab00['summary']['queuestatus'][_0x8727b7[_0xf6f7('0x62')]]){_0x11ab00['summary'][_0xf6f7('0x63')][_0x8727b7[_0xf6f7('0x62')]]={};}_0x11ab00[_0xf6f7('0x5f')][_0xf6f7('0x63')][_0x8727b7[_0xf6f7('0x62')]][_0x3a0ae1[_0xf6f7('0x62')]]={'queue':_0x57a7ac[_0xf6f7('0x66')],'agents':[]};})['catch'](function(_0x530012){throw _0x530012;});}}}catch(_0x53e6a5){logger[_0xf6f7('0x3e')](_0xf6f7('0x64'),util[_0xf6f7('0x40')](_0x53e6a5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x14')]=function(_0x330358){if(this[_0xf6f7('0x5f')][_0xf6f7('0x6d')]>0x0){this[_0xf6f7('0x5f')][_0xf6f7('0x71')]=_0x330358;return;}logger[_0xf6f7('0x49')](_0xf6f7('0x72'),util['inspect'](_0x330358,{'showHidden':![],'depth':null}));this[_0xf6f7('0x5f')]=initializeSummary();ami[_0xf6f7('0x47')](_0xf6f7('0x73'),{});};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x425d20){try{if(this['isNotNull'](_0x425d20)){logger[_0xf6f7('0x49')]('[%s][voiceQueueReport][queuecallerjoin]',_0x425d20[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x425d20,{'showHidden':![],'depth':null}));if(_[_0xf6f7('0x5b')](this['queueReports'][_0x425d20[_0xf6f7('0x4c')]])){this[_0xf6f7('0xd')][_0x425d20[_0xf6f7('0x4c')]]=[];}if(_[_0xf6f7('0x5b')](this[_0xf6f7('0xf')][_0x425d20[_0xf6f7('0x4c')]])){this['channels'][_0x425d20[_0xf6f7('0x4c')]]={};}var _0x1f8c90=new QueueReport();_0x1f8c90[_0xf6f7('0x4f')]=_0x425d20[_0xf6f7('0x4f')];_0x1f8c90[_0xf6f7('0x56')]=this[_0xf6f7('0x10')][_0x1f8c90[_0xf6f7('0x4f')]]&&this['voiceQueues'][_0x1f8c90['queue']]['type']?this[_0xf6f7('0x10')][_0x1f8c90[_0xf6f7('0x4f')]][_0xf6f7('0x56')]||'inbound':_0xf6f7('0x57');_0x1f8c90['queuecallerjoinAt']=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));_0x1f8c90[_0xf6f7('0x75')]=_0x425d20[_0xf6f7('0x75')];_0x1f8c90[_0xf6f7('0x76')]=_0x425d20[_0xf6f7('0x76')];_0x1f8c90[_0xf6f7('0x4c')]=_0x425d20['uniqueid'];_0x1f8c90[_0xf6f7('0x77')]=this[_0xf6f7('0xf')][_0x425d20['uniqueid']][_0xf6f7('0x77')];logger[_0xf6f7('0x78')](_0xf6f7('0x79'),_0x1f8c90[_0xf6f7('0x4f')],_0x1f8c90[_0xf6f7('0x56')]);Object[_0xf6f7('0x7a')](_0x1f8c90,_[_0xf6f7('0x7b')](_0x425d20,_[_0xf6f7('0x7c')](_0x1f8c90)));this[_0xf6f7('0xd')][_0x425d20[_0xf6f7('0x4c')]][_0xf6f7('0x6e')](_0x1f8c90);this[_0xf6f7('0xf')][_0x425d20[_0xf6f7('0x4c')]]=_0x1f8c90;this['emitVoiceQueueChannelSave'](_0x1f8c90,_0xf6f7('0x1a'));}}catch(_0x57ea7f){logger[_0xf6f7('0x3e')](_0xf6f7('0x7d'),_0x425d20[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x57ea7f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x1c')]=function(_0x564c6a){try{if(this[_0xf6f7('0x5a')](_0x564c6a)){logger[_0xf6f7('0x49')](_0xf6f7('0x7e'),_0x564c6a[_0xf6f7('0x4c')],util['inspect'](_0x564c6a,{'showHidden':![],'depth':null}));if(this[_0xf6f7('0xd')][_0x564c6a[_0xf6f7('0x4c')]]){var _0x4de57e=_[_0xf6f7('0x7f')](this['queueReports'][_0x564c6a[_0xf6f7('0x4c')]]);_0x4de57e[_0xf6f7('0x37')]=![];_0x4de57e[_0xf6f7('0x80')]=null;_0x4de57e['holdtime']=_0x564c6a[_0xf6f7('0x81')];_0x4de57e[_0xf6f7('0x82')]=_0x564c6a['originalposition'];_0x4de57e[_0xf6f7('0x1b')]=!![];_0x4de57e[_0xf6f7('0x83')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4de57e['queuecallerexitreason']=_0xf6f7('0x84');_0x4de57e[_0xf6f7('0x85')]=null;logger[_0xf6f7('0x78')](_0xf6f7('0x86'),_0x4de57e[_0xf6f7('0x4f')],_0x4de57e['type']);this[_0xf6f7('0xf')][_0x564c6a[_0xf6f7('0x4c')]]=_0x4de57e;this[_0xf6f7('0x46')](_0x4de57e,'queuecallerabandon');}}}catch(_0x39205d){logger[_0xf6f7('0x3e')](_0xf6f7('0x7e'),_0x564c6a[_0xf6f7('0x4c')],util['inspect'](_0x39205d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x1e')]=function(_0x1be53d){try{if(this[_0xf6f7('0x5a')](_0x1be53d)){logger['debug'](_0xf6f7('0x87'),_0x1be53d[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x1be53d,{'showHidden':![],'depth':null}));if(this[_0xf6f7('0xd')][_0x1be53d['uniqueid']]){var _0xde7a6a=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x1be53d[_0xf6f7('0x4c')]]);_0xde7a6a[_0xf6f7('0x88')]=moment()['format'](_0xf6f7('0x74'));_0xde7a6a['connectedlinenum']=_0x1be53d['connectedlinenum'];_0xde7a6a['connectedlinename']=_0x1be53d[_0xf6f7('0x89')];logger[_0xf6f7('0x78')](_0xf6f7('0x8a'),_0xde7a6a[_0xf6f7('0x4f')],_0xde7a6a[_0xf6f7('0x56')],_0x1be53d[_0xf6f7('0x8b')],_0x1be53d[_0xf6f7('0x89')]);this[_0xf6f7('0xf')][_0x1be53d[_0xf6f7('0x4c')]]=_0xde7a6a;this[_0xf6f7('0x48')](_0xde7a6a,'queuecallerleave');}}}catch(_0x59e8a6){logger[_0xf6f7('0x3e')](_0xf6f7('0x87'),_0x1be53d[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x59e8a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf6f7('0x22')]=function(_0x2996ff){try{if(this[_0xf6f7('0x5a')](_0x2996ff)){logger[_0xf6f7('0x49')](_0xf6f7('0x8c'),_0x2996ff[_0xf6f7('0x4c')],util['inspect'](_0x2996ff,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2996ff['uniqueid']]){var _0x5bf8d5=_['last'](this[_0xf6f7('0xd')][_0x2996ff[_0xf6f7('0x4c')]]);_0x5bf8d5[_0xf6f7('0x37')]=!![];_0x5bf8d5[_0xf6f7('0x52')]=_0xf6f7('0x8d');logger[_0xf6f7('0x78')](_0xf6f7('0x8e'),_0x5bf8d5[_0xf6f7('0x4f')],_0x5bf8d5['type']);}}}catch(_0x273007){logger[_0xf6f7('0x3e')]('[%s][voiceQueueReport][agentconnect]',_0x2996ff[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x273007,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf6f7('0x20')]=function(_0x371565){try{if(this[_0xf6f7('0x5a')](_0x371565)){logger[_0xf6f7('0x49')]('[%s][voiceQueueReport][agentcomplete]',_0x371565[_0xf6f7('0x4c')],util['inspect'](_0x371565,{'showHidden':![],'depth':null}));if(this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x4c')]]){var _0x5af29b=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x4c')]]);_0x5af29b['queuecallerabandon']=![];_0x5af29b[_0xf6f7('0x83')]=null;_0x5af29b[_0xf6f7('0x8f')]=!![];_0x5af29b[_0xf6f7('0x85')]=_0x371565[_0xf6f7('0x90')];_0x5af29b[_0xf6f7('0x81')]=_0x371565[_0xf6f7('0x81')];_0x5af29b[_0xf6f7('0x37')]=!![];_0x5af29b[_0xf6f7('0x36')]=![];_0x5af29b[_0xf6f7('0x91')]=null;if(!_0x5af29b['transfer']){if(_0x371565['reason']==_0xf6f7('0x92')){_0x5af29b[_0xf6f7('0x52')]=_0xf6f7('0x93');logger[_0xf6f7('0x78')](_0xf6f7('0x94'),_0x5af29b[_0xf6f7('0x4f')],_0x5af29b[_0xf6f7('0x56')]);}else{if(_['startsWith'](_0x371565[_0xf6f7('0x3c')]['toLowerCase'](),_0xf6f7('0x95'))){if(this[_0xf6f7('0xd')][_0x371565['linkedid']]){var _0x25dfff=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x371565['linkedid']]);_0x25dfff[_0xf6f7('0x37')]=![];_0x25dfff['queuecallerexit']=!![];_0x25dfff[_0xf6f7('0x91')]=moment(_0x5af29b['queuecallerjoinAt'])['add'](_0x371565[_0xf6f7('0x81')],_0xf6f7('0x96'))[_0xf6f7('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x25dfff[_0xf6f7('0x52')]=_0xf6f7('0x97');_0x25dfff[_0xf6f7('0x92')]=!![];_0x25dfff[_0xf6f7('0x98')]=_0xf6f7('0x99');_0x25dfff['transferexten']=_0x371565[_0xf6f7('0x9a')];_0x25dfff[_0xf6f7('0x9b')]=_0x371565[_0xf6f7('0x4c')];logger[_0xf6f7('0x78')](_0xf6f7('0x9c'),_0x25dfff[_0xf6f7('0x4f')],_0x25dfff[_0xf6f7('0x56')]);var _0x1b2776=this[_0xf6f7('0xd')][_0x371565['linkedid']];this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x9d')]]=this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x4c')]];this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x4c')]]=_0x1b2776;}}else{_0x5af29b[_0xf6f7('0x52')]=_0xf6f7('0x9e')+_0x371565[_0xf6f7('0x9f')]['toUpperCase']();logger[_0xf6f7('0x78')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x5af29b[_0xf6f7('0x4f')],_0x5af29b[_0xf6f7('0x56')],_0x5af29b['queuecallerexitreason']);}}}this[_0xf6f7('0xf')][_0x371565['uniqueid']]=_0x5af29b;}}}catch(_0x8ed821){logger['error'](_0xf6f7('0xa0'),_0x371565[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x8ed821,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf6f7('0x23')]=function(_0x4aad8b){try{if(this[_0xf6f7('0x5a')](_0x4aad8b)){logger['debug'](_0xf6f7('0xa1'),_0x4aad8b[_0xf6f7('0x4c')],util['inspect'](_0x4aad8b,{'showHidden':![],'depth':null}));this[_0xf6f7('0xa2')](_0x4aad8b[_0xf6f7('0x4c')],_['keys'](_0x4aad8b[_0xf6f7('0xa3')])[0x0],_0x4aad8b[_0xf6f7('0xa4')]);if(this[_0xf6f7('0xd')][_0x4aad8b[_0xf6f7('0x4c')]]){var _0x13fd86=_['last'](this[_0xf6f7('0xd')][_0x4aad8b[_0xf6f7('0x4c')]]);if(_0x13fd86){if(this[_0xf6f7('0x5a')](_0x4aad8b[_0xf6f7('0xa3')])&&this[_0xf6f7('0x5a')](_0x4aad8b['variable'][_0xf6f7('0x63')])){switch(_0x4aad8b[_0xf6f7('0xa4')]){case'CONTINUE':_0x13fd86['queuecallerexit']=![];_0x13fd86[_0xf6f7('0x91')]=null;break;case _0xf6f7('0xa5'):_0x13fd86[_0xf6f7('0xa6')]=_0xf6f7('0xa7');_0x13fd86[_0xf6f7('0x36')]=!![];_0x13fd86[_0xf6f7('0x91')]=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));_0x13fd86['queuecallerleaveAt']=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));logger[_0xf6f7('0x49')](_0xf6f7('0xa8'),_0x4aad8b[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x13fd86,{'showHidden':![],'depth':null}));ami[_0xf6f7('0x47')](_0xf6f7('0xa9'),_0x13fd86);break;default:_0x13fd86[_0xf6f7('0x36')]=!![];_0x13fd86[_0xf6f7('0x91')]=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));_0x13fd86[_0xf6f7('0x88')]=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));}_0x13fd86['queuecallerabandon']=![];_0x13fd86['queuecallerabandonAt']=null;_0x13fd86['queuecallerexitreason']=_0x4aad8b[_0xf6f7('0xa4')];this[_0xf6f7('0xf')][_0x4aad8b[_0xf6f7('0x4c')]]=_0x13fd86;this[_0xf6f7('0x46')](_0x13fd86,_0xf6f7('0xaa'));}else if(this[_0xf6f7('0x5a')](_0x4aad8b[_0xf6f7('0xa3')])&&this['isNotNull'](_0x4aad8b[_0xf6f7('0xa3')][_0xf6f7('0xab')])){if(!_0x13fd86[_0xf6f7('0x1b')]){_0x13fd86[_0xf6f7('0x36')]=!![];_0x13fd86[_0xf6f7('0x91')]=moment()['format'](_0xf6f7('0x74'));_0x13fd86[_0xf6f7('0x52')]=_0xf6f7('0xac');_0x13fd86['queuecallerleaveAt']=moment()['format'](_0xf6f7('0x74'));this['channels'][_0x4aad8b[_0xf6f7('0x4c')]]=_0x13fd86;}}logger[_0xf6f7('0x78')](_0xf6f7('0xad'),_0x4aad8b[_0xf6f7('0x4c')],_0x13fd86[_0xf6f7('0x4f')],_0x13fd86[_0xf6f7('0x56')],_[_0xf6f7('0x7c')](_0x4aad8b['variable'])[0x0],_0x4aad8b['value']);_0x13fd86[_0xf6f7('0x42')]=this[_0xf6f7('0x42')][_0x4aad8b['uniqueid']];}}}}catch(_0x44ffef){logger[_0xf6f7('0x3e')](_0xf6f7('0xa1'),_0x4aad8b[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x44ffef,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')]['addVariable']=function(_0x3dbe71,_0x14463a,_0x1d4ddb){var _0x51072f=[_0xf6f7('0xae'),_0xf6f7('0xaf'),_0xf6f7('0xb0'),_0xf6f7('0xb1'),_0xf6f7('0xb2'),_0xf6f7('0xb3'),_0xf6f7('0xb4'),_0xf6f7('0xb5'),'sipcallid',_0xf6f7('0xb6'),'bridgepeer',_0xf6f7('0xb7'),_0xf6f7('0xb8'),_0xf6f7('0xb9'),_0xf6f7('0xba'),_0xf6f7('0xbb'),_0xf6f7('0x90'),_0xf6f7('0xbc'),_0xf6f7('0xbd')];if(!_[_0xf6f7('0xbe')](_0x14463a)&&!_[_0xf6f7('0xbf')](_0x51072f,_0x14463a)){if(_[_0xf6f7('0x5b')](this[_0xf6f7('0x42')][_0x3dbe71])){this[_0xf6f7('0x42')][_0x3dbe71]={};}this[_0xf6f7('0x42')][_0x3dbe71][_0x14463a]=_0x1d4ddb;}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0xc0')]=function(_0x1b0839,_0x2ec4df,_0x51001e){try{var _0x4b8fcd={};if(this['queueReports'][_0x1b0839]){for(var _0xb2616=0x0;_0xb26160x0?!![]:![];if(!_0x546bd0){return this['syncQueueSummaryComplete'](this[_0x7af8('0x13')]['completeEvent']);}};VoiceQueueReport[_0x7af8('0xa')]['syncQueueMember']=function(_0x21c3ca){var _0x2b9b13=this[_0x7af8('0x13')]['id'];if(this[_0x7af8('0x13')][_0x7af8('0x64')][_0x2b9b13]&&this[_0x7af8('0x13')][_0x7af8('0x64')][_0x2b9b13][_0x21c3ca[_0x7af8('0x63')]]){this[_0x7af8('0x13')][_0x7af8('0x64')][_0x2b9b13][_0x21c3ca[_0x7af8('0x63')]][_0x7af8('0xf')][_0x7af8('0x71')](_0x21c3ca);}};VoiceQueueReport['prototype'][_0x7af8('0x15')]=function(_0x298803){var _0x3c30ec=this;try{if(this['isNotNull'](_0x298803)&&this[_0x7af8('0x72')](_0x298803[_0x7af8('0x54')])){logger[_0x7af8('0x50')]('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x298803,{'showHidden':![],'depth':null}));var _0x428d6d=this[_0x7af8('0x11')][_0x298803[_0x7af8('0x54')]];if(_0x428d6d){logger['debug']('[voiceQueueReport][queuesummary]\x20name:%s',_0x428d6d['name']);this[_0x7af8('0x13')]['queues'][_0x428d6d[_0x7af8('0x66')]]={'summaryEvent':_0x298803};this['summary'][_0x7af8('0x70')]+=0x1;return ami['Action']({'action':_0x7af8('0x64'),'queue':_0x428d6d[_0x7af8('0x66')]})['then'](function(_0x122e67){if(!_0x3c30ec[_0x7af8('0x13')][_0x7af8('0x64')][_0x298803['actionid']]){_0x3c30ec['summary']['queuestatus'][_0x298803[_0x7af8('0x63')]]={};}_0x3c30ec[_0x7af8('0x13')]['queuestatus'][_0x298803[_0x7af8('0x63')]][_0x122e67['actionid']]={'queue':_0x428d6d[_0x7af8('0x66')],'agents':[]};})['catch'](function(_0x21f5d1){throw _0x21f5d1;});}}}catch(_0x31974b){logger[_0x7af8('0x45')](_0x7af8('0x65'),util[_0x7af8('0x46')](_0x31974b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x16')]=function(_0x1f186e){if(this[_0x7af8('0x13')][_0x7af8('0x70')]>0x0){this[_0x7af8('0x13')][_0x7af8('0x73')]=_0x1f186e;return;}logger[_0x7af8('0x50')](_0x7af8('0x74'),util[_0x7af8('0x46')](_0x1f186e,{'showHidden':![],'depth':null}));this[_0x7af8('0x13')]=initializeSummary();ami[_0x7af8('0x4e')](_0x7af8('0x75'),{});};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x1d')]=function(_0x103dcb){try{if(this[_0x7af8('0x72')](_0x103dcb)){logger[_0x7af8('0x50')](_0x7af8('0x76'),_0x103dcb[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x103dcb,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x7af8('0x47')][_0x103dcb['uniqueid']])){this[_0x7af8('0x47')][_0x103dcb[_0x7af8('0x52')]]=[];}if(_[_0x7af8('0x5e')](this[_0x7af8('0x3b')][_0x103dcb[_0x7af8('0x52')]])){this[_0x7af8('0x3b')][_0x103dcb[_0x7af8('0x52')]]={};}var _0x5842bd=new QueueReport();_0x5842bd[_0x7af8('0x54')]=_0x103dcb[_0x7af8('0x54')];_0x5842bd[_0x7af8('0x6c')]=this[_0x7af8('0x11')][_0x5842bd[_0x7af8('0x54')]]&&this[_0x7af8('0x11')][_0x5842bd[_0x7af8('0x54')]][_0x7af8('0x6c')]?this[_0x7af8('0x11')][_0x5842bd[_0x7af8('0x54')]][_0x7af8('0x6c')]||_0x7af8('0x5c'):_0x7af8('0x5c');_0x5842bd[_0x7af8('0x77')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0x5842bd[_0x7af8('0x79')]=_0x103dcb[_0x7af8('0x79')];_0x5842bd[_0x7af8('0x7a')]=_0x103dcb[_0x7af8('0x7a')];_0x5842bd[_0x7af8('0x52')]=_0x103dcb['uniqueid'];_0x5842bd[_0x7af8('0x7b')]=this[_0x7af8('0x3b')][_0x103dcb[_0x7af8('0x52')]]['routealias'];logger['info'](_0x7af8('0x7c'),_0x5842bd[_0x7af8('0x54')],_0x5842bd[_0x7af8('0x6c')]);Object[_0x7af8('0x6a')](_0x5842bd,_[_0x7af8('0x7d')](_0x103dcb,_['keys'](_0x5842bd)));this[_0x7af8('0x47')][_0x103dcb['uniqueid']][_0x7af8('0x71')](_0x5842bd);this[_0x7af8('0x3b')][_0x103dcb[_0x7af8('0x52')]]=_0x5842bd;this[_0x7af8('0x4f')](_0x5842bd,'queuecallerjoin');}}catch(_0x1191a3){logger['error'](_0x7af8('0x76'),_0x103dcb['uniqueid'],util[_0x7af8('0x46')](_0x1191a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7af8('0x7e')]=function(_0x29513e){try{if(this['isNotNull'](_0x29513e)){logger[_0x7af8('0x50')](_0x7af8('0x7f'),_0x29513e['uniqueid'],util[_0x7af8('0x46')](_0x29513e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x29513e[_0x7af8('0x52')]]){var _0xaeaaba=_['last'](this[_0x7af8('0x47')][_0x29513e['uniqueid']]);_0xaeaaba['queuecallercomplete']=![];_0xaeaaba['queuecallercompleteAt']=null;_0xaeaaba[_0x7af8('0x80')]=_0x29513e['holdtime'];_0xaeaaba['originalposition']=_0x29513e[_0x7af8('0x81')];_0xaeaaba['queuecallerabandon']=!![];_0xaeaaba[_0x7af8('0x82')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0xaeaaba[_0x7af8('0x58')]='ABANDONED';_0xaeaaba['lastAssignedTo']=null;logger['info'](_0x7af8('0x83'),_0xaeaaba['queue'],_0xaeaaba[_0x7af8('0x6c')]);this['channels'][_0x29513e[_0x7af8('0x52')]]=_0xaeaaba;this[_0x7af8('0x4c')](_0xaeaaba,_0x7af8('0x39'));}}}catch(_0xa22709){logger[_0x7af8('0x45')](_0x7af8('0x7f'),_0x29513e[_0x7af8('0x52')],util['inspect'](_0xa22709,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x1f')]=function(_0x1c768b){try{if(this[_0x7af8('0x72')](_0x1c768b)){logger[_0x7af8('0x50')](_0x7af8('0x84'),_0x1c768b[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x1c768b,{'showHidden':![],'depth':null}));if(this[_0x7af8('0x47')][_0x1c768b[_0x7af8('0x52')]]){var _0x3cb64a=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x1c768b[_0x7af8('0x52')]]);_0x3cb64a['queuecallerleaveAt']=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0x3cb64a[_0x7af8('0x86')]=_0x1c768b[_0x7af8('0x86')];_0x3cb64a[_0x7af8('0x87')]=_0x1c768b[_0x7af8('0x87')];logger[_0x7af8('0x88')](_0x7af8('0x89'),_0x3cb64a['queue'],_0x3cb64a[_0x7af8('0x6c')],_0x1c768b['connectedlinenum'],_0x1c768b['connectedlinename']);this[_0x7af8('0x3b')][_0x1c768b[_0x7af8('0x52')]]=_0x3cb64a;this[_0x7af8('0x4f')](_0x3cb64a,_0x7af8('0x1e'));}}}catch(_0x507215){logger[_0x7af8('0x45')]('[%s][voiceQueueReport][queuecallerleave]',_0x1c768b[_0x7af8('0x52')],util['inspect'](_0x507215,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7af8('0x23')]=function(_0x56d8e6){try{if(this[_0x7af8('0x72')](_0x56d8e6)){logger[_0x7af8('0x50')](_0x7af8('0x8a'),_0x56d8e6[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x56d8e6,{'showHidden':![],'depth':null}));if(this[_0x7af8('0x47')][_0x56d8e6['uniqueid']]){var _0x4f5c3c=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x56d8e6[_0x7af8('0x52')]]);_0x4f5c3c[_0x7af8('0x8b')]=!![];_0x4f5c3c[_0x7af8('0x58')]=_0x7af8('0x8c');logger[_0x7af8('0x88')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x4f5c3c[_0x7af8('0x54')],_0x4f5c3c[_0x7af8('0x6c')]);}}}catch(_0x328baf){logger[_0x7af8('0x45')](_0x7af8('0x8a'),_0x56d8e6[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x328baf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')]['syncAgentComplete']=function(_0x29b575){try{if(this['isNotNull'](_0x29b575)){logger[_0x7af8('0x50')](_0x7af8('0x8d'),_0x29b575[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x29b575,{'showHidden':![],'depth':null}));if(this[_0x7af8('0x47')][_0x29b575[_0x7af8('0x52')]]){var _0x5e959a=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x29b575[_0x7af8('0x52')]]);_0x5e959a[_0x7af8('0x39')]=![];_0x5e959a[_0x7af8('0x82')]=null;_0x5e959a[_0x7af8('0x8e')]=!![];_0x5e959a[_0x7af8('0x8f')]=_0x29b575[_0x7af8('0x90')];_0x5e959a['holdtime']=_0x29b575[_0x7af8('0x80')];_0x5e959a['queuecallercomplete']=!![];_0x5e959a[_0x7af8('0x91')]=![];_0x5e959a[_0x7af8('0x92')]=null;if(!_0x5e959a[_0x7af8('0x93')]){if(_0x29b575[_0x7af8('0x94')]==_0x7af8('0x93')){_0x5e959a[_0x7af8('0x58')]='COMPLETED';logger[_0x7af8('0x88')](_0x7af8('0x95'),_0x5e959a[_0x7af8('0x54')],_0x5e959a[_0x7af8('0x6c')]);}else{if(_[_0x7af8('0x96')](_0x29b575[_0x7af8('0x41')][_0x7af8('0x97')](),_0x7af8('0x98'))){if(this[_0x7af8('0x47')][_0x29b575[_0x7af8('0x99')]]){var _0x32cf54=_[_0x7af8('0x85')](this['queueReports'][_0x29b575[_0x7af8('0x99')]]);_0x32cf54[_0x7af8('0x8b')]=![];_0x32cf54[_0x7af8('0x91')]=!![];_0x32cf54['queuecallerexitAt']=moment(_0x5e959a[_0x7af8('0x77')])['add'](_0x29b575['holdtime'],_0x7af8('0x9a'))[_0x7af8('0x5a')](_0x7af8('0x78'));_0x32cf54[_0x7af8('0x58')]=_0x7af8('0x9b');_0x32cf54[_0x7af8('0x93')]=!![];_0x32cf54['transfertype']='FORWARD';_0x32cf54[_0x7af8('0x9c')]=_0x29b575[_0x7af8('0x9d')];_0x32cf54[_0x7af8('0x9e')]=_0x29b575[_0x7af8('0x52')];logger[_0x7af8('0x88')](_0x7af8('0x9f'),_0x32cf54[_0x7af8('0x54')],_0x32cf54[_0x7af8('0x6c')]);var _0x472974=this['queueReports'][_0x29b575[_0x7af8('0x99')]];this['queueReports'][_0x29b575[_0x7af8('0x99')]]=this[_0x7af8('0x47')][_0x29b575['uniqueid']];this[_0x7af8('0x47')][_0x29b575['uniqueid']]=_0x472974;}}else{_0x5e959a[_0x7af8('0x58')]='COMPLETEDBY'+_0x29b575['reason'][_0x7af8('0xa0')]();logger[_0x7af8('0x88')](_0x7af8('0xa1'),_0x5e959a[_0x7af8('0x54')],_0x5e959a['type'],_0x5e959a[_0x7af8('0x58')]);}}}this[_0x7af8('0x3b')][_0x29b575[_0x7af8('0x52')]]=_0x5e959a;}}}catch(_0x544488){logger[_0x7af8('0x45')](_0x7af8('0x8d'),_0x29b575[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x544488,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x25')]=function(_0x434e4f){try{if(this['isNotNull'](_0x434e4f)){logger['debug'](_0x7af8('0xa2'),_0x434e4f[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x434e4f,{'showHidden':![],'depth':null}));this[_0x7af8('0xa3')](_0x434e4f[_0x7af8('0x52')],_['keys'](_0x434e4f[_0x7af8('0xa4')])[0x0],_0x434e4f[_0x7af8('0xa5')]);if(this[_0x7af8('0x47')][_0x434e4f[_0x7af8('0x52')]]){var _0x5c857d=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x434e4f['uniqueid']]);if(_0x5c857d){if(this[_0x7af8('0x72')](_0x434e4f['variable'])&&this[_0x7af8('0x72')](_0x434e4f[_0x7af8('0xa4')][_0x7af8('0x64')])){switch(_0x434e4f[_0x7af8('0xa5')]){case _0x7af8('0xa6'):_0x5c857d['queuecallerexit']=![];_0x5c857d[_0x7af8('0x92')]=null;break;case _0x7af8('0xa7'):_0x5c857d[_0x7af8('0xa8')]=_0x7af8('0xa9');_0x5c857d[_0x7af8('0x91')]=!![];_0x5c857d[_0x7af8('0x92')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0x5c857d[_0x7af8('0xaa')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));logger['debug'](_0x7af8('0xab'),_0x434e4f[_0x7af8('0x52')],util['inspect'](_0x5c857d,{'showHidden':![],'depth':null}));ami[_0x7af8('0x4e')](_0x7af8('0xac'),_0x5c857d);break;default:_0x5c857d[_0x7af8('0x91')]=!![];_0x5c857d[_0x7af8('0x92')]=moment()['format'](_0x7af8('0x78'));_0x5c857d['queuecallerleaveAt']=moment()['format'](_0x7af8('0x78'));}_0x5c857d[_0x7af8('0x39')]=![];_0x5c857d[_0x7af8('0x82')]=null;_0x5c857d[_0x7af8('0x58')]=_0x434e4f['value'];this[_0x7af8('0x3b')][_0x434e4f[_0x7af8('0x52')]]=_0x5c857d;this['emitVoiceQueueChannelRemove'](_0x5c857d,'varset');}else if(this[_0x7af8('0x72')](_0x434e4f[_0x7af8('0xa4')])&&this['isNotNull'](_0x434e4f[_0x7af8('0xa4')]['queueposition'])){if(!_0x5c857d[_0x7af8('0x39')]){_0x5c857d['queuecallerexit']=!![];_0x5c857d[_0x7af8('0x92')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0x5c857d[_0x7af8('0x58')]=_0x7af8('0xad');_0x5c857d[_0x7af8('0xaa')]=moment()['format'](_0x7af8('0x78'));this['channels'][_0x434e4f['uniqueid']]=_0x5c857d;}}logger[_0x7af8('0x88')](_0x7af8('0xae'),_0x434e4f[_0x7af8('0x52')],_0x5c857d['queue'],_0x5c857d[_0x7af8('0x6c')],_['keys'](_0x434e4f[_0x7af8('0xa4')])[0x0],_0x434e4f['value']);_0x5c857d[_0x7af8('0x14')]=this[_0x7af8('0x14')][_0x434e4f[_0x7af8('0x52')]];}}}}catch(_0x4c1593){logger['error'](_0x7af8('0xa2'),_0x434e4f['uniqueid'],util[_0x7af8('0x46')](_0x4c1593,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0xa3')]=function(_0x4915f0,_0x31b419,_0x522fc7){var _0x400b42=[_0x7af8('0xaf'),_0x7af8('0xb0'),_0x7af8('0xb1'),_0x7af8('0xb2'),_0x7af8('0xb3'),_0x7af8('0xb4'),'rtpaudioqosrtt',_0x7af8('0xb5'),_0x7af8('0xb6'),_0x7af8('0xb7'),'bridgepeer',_0x7af8('0xb8'),_0x7af8('0xb9'),_0x7af8('0xba'),_0x7af8('0xbb'),'memberlastcall',_0x7af8('0x90'),_0x7af8('0xbc'),_0x7af8('0xbd')];if(!_[_0x7af8('0x3e')](_0x31b419)&&!_[_0x7af8('0xbe')](_0x400b42,_0x31b419)){if(_['isUndefined'](this[_0x7af8('0x14')][_0x4915f0])){this[_0x7af8('0x14')][_0x4915f0]={};}this['variables'][_0x4915f0][_0x31b419]=_0x522fc7;}};VoiceQueueReport['prototype'][_0x7af8('0xbf')]=function(_0x1fabfa,_0x47a85b,_0x326ff8){try{var _0x5debd7={};if(this[_0x7af8('0x47')][_0x1fabfa]){for(var _0x3d41e9=0x0;_0x3d41e9=0x0?moment(_0x39f54b['endtime'])[_0x8a93('0x19')](_0x39f54b[_0x8a93('0x17')],'seconds'):null,'data1':'outbound','data2':_0x39f54b[_0x8a93('0x11')],'data3':_0x39f54b[_0x8a93('0x1a')],'data4':_0x39f54b[_0x8a93('0x1b')]||null,'role':'agent','internal':_0x39f54b[_0x8a93('0x11')]?_[_0x8a93('0x12')](_0x39f54b[_0x8a93('0x11')]):undefined,'uniqueid':_0x39f54b['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xb642=['toNumber','uniqueid','voiceDialReport','membername','starttime','endtime','seconds','outbound','accountcode','exten','dialstring','moment','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','interface','SIP/%s','lastAssignedTo','TALKING','queuecallerleaveAt','diff','inbound','calleridnum','queue','agent'];(function(_0x57d556,_0x2dc7cd){var _0x39bf5c=function(_0x143082){while(--_0x143082){_0x57d556['push'](_0x57d556['shift']());}};_0x39bf5c(++_0x2dc7cd);}(_0xb642,0xa1));var _0x2b64=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xb642[_0x2bf141];return _0x48277b;};'use strict';var moment=require(_0x2b64('0x0'));var _=require('lodash');var util=require(_0x2b64('0x1'));var client=require(_0x2b64('0x2'));exports[_0x2b64('0x3')]=function(_0x38a0a6){var _0x593d85=_0x38a0a6[_0x2b64('0x4')]||_0x38a0a6[_0x2b64('0x5')];return client[_0x2b64('0x6')](_0x2b64('0x7'),{'body':{'channel':_0x2b64('0x8'),'membername':_0x38a0a6['lastAssignedTo'],'interface':_['isNil'](_0x38a0a6[_0x2b64('0x9')])?util['format'](_0x2b64('0xa'),_0x38a0a6[_0x2b64('0xb')]):_0x38a0a6[_0x2b64('0x9')],'type':_0x2b64('0xc'),'enterAt':_0x38a0a6[_0x2b64('0xd')],'exitAt':_0x593d85,'duration':moment(_0x593d85)[_0x2b64('0xe')](_0x38a0a6[_0x2b64('0xd')],'seconds'),'data1':_0x2b64('0xf'),'data2':_0x38a0a6[_0x2b64('0x10')],'data3':_0x38a0a6['exten'],'data4':null,'data5':_0x38a0a6[_0x2b64('0x11')],'role':_0x2b64('0x12'),'internal':_0x38a0a6['accountcode']?_[_0x2b64('0x13')](_0x38a0a6['accountcode']):undefined,'uniqueid':_0x38a0a6[_0x2b64('0x14')]},'log':_0x2b64('0x7')});};exports[_0x2b64('0x15')]=function(_0x22c80f){return client['Request'](_0x2b64('0x7'),{'body':{'channel':_0x2b64('0x8'),'membername':_0x22c80f[_0x2b64('0x16')],'interface':_0x22c80f[_0x2b64('0x9')],'type':_0x2b64('0xc'),'enterAt':_0x22c80f[_0x2b64('0x17')],'exitAt':_0x22c80f[_0x2b64('0x18')],'duration':moment(_0x22c80f[_0x2b64('0x18')])[_0x2b64('0xe')](_0x22c80f['starttime'],_0x2b64('0x19'))>=0x0?moment(_0x22c80f[_0x2b64('0x18')])['diff'](_0x22c80f['starttime'],'seconds'):null,'data1':_0x2b64('0x1a'),'data2':_0x22c80f[_0x2b64('0x1b')],'data3':_0x22c80f[_0x2b64('0x1c')],'data4':_0x22c80f[_0x2b64('0x1d')]||null,'role':_0x2b64('0x12'),'internal':_0x22c80f[_0x2b64('0x1b')]?_[_0x2b64('0x13')](_0x22c80f[_0x2b64('0x1b')]):undefined,'uniqueid':_0x22c80f['uniqueid']},'log':_0x2b64('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index e334629..1a1bb21 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 _0xe126=['GetSettings','../client','getSettings','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x2fc81f,_0x2d689d){var _0x29b312=function(_0x1a88f9){while(--_0x1a88f9){_0x2fc81f['push'](_0x2fc81f['shift']());}};_0x29b312(++_0x2d689d);}(_0xe126,0xeb));var _0x6e12=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xe126[_0x87b0ff];return _0x3bc0b2;};'use strict';var client=require(_0x6e12('0x0'));exports[_0x6e12('0x1')]=function(){return client['Request'](_0x6e12('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x6e12('0x3'),_0x6e12('0x4')]},'log':_0x6e12('0x5')});}; \ No newline at end of file +var _0xd945=['../client','getSettings','Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings'];(function(_0x5c8c7f,_0x3acfde){var _0x514e60=function(_0x1c7258){while(--_0x1c7258){_0x5c8c7f['push'](_0x5c8c7f['shift']());}};_0x514e60(++_0x3acfde);}(_0xd945,0x84));var _0x5d94=function(_0x5d3dff,_0x23389e){_0x5d3dff=_0x5d3dff-0x0;var _0x479375=_0xd945[_0x5d3dff];return _0x479375;};'use strict';var client=require(_0x5d94('0x0'));exports[_0x5d94('0x1')]=function(){return client[_0x5d94('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5d94('0x3'),_0x5d94('0x4')]},'log':_0x5d94('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index e691f63..c0dc344 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 _0x5a28=['getTemplates','Request','name','html','GetTemplate','../client'];(function(_0x3986fc,_0x41fd49){var _0x514bd1=function(_0x4f038f){while(--_0x4f038f){_0x3986fc['push'](_0x3986fc['shift']());}};_0x514bd1(++_0x41fd49);}(_0x5a28,0x1c7));var _0x85a2=function(_0x1f504c,_0x319b4f){_0x1f504c=_0x1f504c-0x0;var _0x50d2e6=_0x5a28[_0x1f504c];return _0x50d2e6;};'use strict';var client=require(_0x85a2('0x0'));exports[_0x85a2('0x1')]=function(_0x1d99cf){return function(_0x779af9){return client[_0x85a2('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x85a2('0x3'),_0x85a2('0x4')]},'log':_0x85a2('0x5')});};}; \ No newline at end of file +var _0x4dd9=['Request','html','GetTemplate','../client','getTemplates'];(function(_0x1b3224,_0x3351d9){var _0x5dae4f=function(_0x22894a){while(--_0x22894a){_0x1b3224['push'](_0x1b3224['shift']());}};_0x5dae4f(++_0x3351d9);}(_0x4dd9,0x1f2));var _0x94dd=function(_0x36db65,_0x2b4af1){_0x36db65=_0x36db65-0x0;var _0x5bea6a=_0x4dd9[_0x36db65];return _0x5bea6a;};'use strict';var client=require(_0x94dd('0x0'));exports[_0x94dd('0x1')]=function(_0x44d1dc){return function(_0x979dd6){return client[_0x94dd('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id','name',_0x94dd('0x3')]},'log':_0x94dd('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index c9eed71..643f0fe 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 _0xdc1b=['Condition','AllConditions','operator','value','AnyConditions','Action','Actions','action','data1','data2','data4','data5','data6','data7','../client','Request','GetTrigger','name','channel','status'];(function(_0x123935,_0x1670ba){var _0x1a8ebf=function(_0xa6933e){while(--_0xa6933e){_0x123935['push'](_0x123935['shift']());}};_0x1a8ebf(++_0x1670ba);}(_0xdc1b,0x9a));var _0xbdc1=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0xdc1b[_0x474d97];return _0x1edf25;};'use strict';var client=require(_0xbdc1('0x0'));exports['getTriggers']=function(_0x1709bf){return function(_0x55a4e9){return client[_0xbdc1('0x1')](_0xbdc1('0x2'),{'options':{'raw':![],'attributes':['id',_0xbdc1('0x3'),_0xbdc1('0x4'),_0xbdc1('0x5')],'include':[{'model':_0xbdc1('0x6'),'as':_0xbdc1('0x7'),'attributes':['id','field',_0xbdc1('0x8'),_0xbdc1('0x9')]},{'model':_0xbdc1('0x6'),'as':_0xbdc1('0xa'),'attributes':['id','field',_0xbdc1('0x8'),'value']},{'model':_0xbdc1('0xb'),'as':_0xbdc1('0xc'),'attributes':['id',_0xbdc1('0xd'),_0xbdc1('0xe'),_0xbdc1('0xf'),'data3',_0xbdc1('0x10'),_0xbdc1('0x11'),_0xbdc1('0x12'),_0xbdc1('0x13')]}]},'log':_0xbdc1('0x2')});};}; \ No newline at end of file +var _0x923b=['action','data2','data3','data4','data5','data6','../client','getTriggers','Request','name','Condition','field','operator','value','Actions'];(function(_0x29df42,_0x21af68){var _0x135819=function(_0x627c79){while(--_0x627c79){_0x29df42['push'](_0x29df42['shift']());}};_0x135819(++_0x21af68);}(_0x923b,0x150));var _0xb923=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0x923b[_0x301c34];return _0x1a8c5a;};'use strict';var client=require(_0xb923('0x0'));exports[_0xb923('0x1')]=function(_0x1b7361){return function(_0xbacbba){return client[_0xb923('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xb923('0x3'),'channel','status'],'include':[{'model':_0xb923('0x4'),'as':'AllConditions','attributes':['id',_0xb923('0x5'),_0xb923('0x6'),_0xb923('0x7')]},{'model':_0xb923('0x4'),'as':'AnyConditions','attributes':['id',_0xb923('0x5'),_0xb923('0x6'),'value']},{'model':'Action','as':_0xb923('0x8'),'attributes':['id',_0xb923('0x9'),'data1',_0xb923('0xa'),_0xb923('0xb'),_0xb923('0xc'),_0xb923('0xd'),_0xb923('0xe'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 7ebe2e7..e66a4e9 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 _0xdf67=['name','registry','defaultuser','../client','getTrunks','GetTrunk'];(function(_0x13e418,_0x167abb){var _0x1f31d8=function(_0x1b84e1){while(--_0x1b84e1){_0x13e418['push'](_0x13e418['shift']());}};_0x1f31d8(++_0x167abb);}(_0xdf67,0x117));var _0x7df6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf67[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7df6('0x0'));exports[_0x7df6('0x1')]=function(_0x815a7e){return function(_0x84acd7){return client['Request'](_0x7df6('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7df6('0x3'),_0x7df6('0x4'),_0x7df6('0x5')]},'log':_0x7df6('0x2')});};}; \ No newline at end of file +var _0x4ccb=['name','../client','getTrunks','GetTrunk'];(function(_0x421af5,_0x4d624e){var _0x2babdc=function(_0x2eb339){while(--_0x2eb339){_0x421af5['push'](_0x421af5['shift']());}};_0x2babdc(++_0x4d624e);}(_0x4ccb,0x1a5));var _0xb4cc=function(_0x81c564,_0x4e4e2e){_0x81c564=_0x81c564-0x0;var _0x3c8daf=_0x4ccb[_0x81c564];return _0x3c8daf;};'use strict';var client=require(_0xb4cc('0x0'));exports[_0xb4cc('0x1')]=function(_0x204822){return function(_0x2b92ea){return client['Request'](_0xb4cc('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xb4cc('0x3'),'registry','defaultuser']},'log':_0xb4cc('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 7d7fcbb..8766492 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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x83c1dc,_0x16b447){var _0x358ff0=function(_0x506373){while(--_0x506373){_0x83c1dc['push'](_0x83c1dc['shift']());}};_0x358ff0(++_0x16b447);}(_0xedd9,0xfc));var _0x9edd=function(_0x451429,_0x5540dc){_0x451429=_0x451429-0x0;var _0x688119=_0xedd9[_0x451429];return _0x688119;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index b6bd9f4..3728c86 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 _0xa3ac=['UpdateVoiceAgentReport','../client','create','Request'];(function(_0x7f5e4,_0x21af1b){var _0x5f1035=function(_0x325cad){while(--_0x325cad){_0x7f5e4['push'](_0x7f5e4['shift']());}};_0x5f1035(++_0x21af1b);}(_0xa3ac,0xd1));var _0xca3a=function(_0x2be7d0,_0x3ed00b){_0x2be7d0=_0x2be7d0-0x0;var _0x717c96=_0xa3ac[_0x2be7d0];return _0x717c96;};'use strict';var client=require(_0xca3a('0x0'));exports[_0xca3a('0x1')]=function(_0x30a447){return client['Request']('CreateVoiceAgentReport',{'body':_0x30a447,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x5326ce,_0xc993ff,_0x95c77){return client[_0xca3a('0x2')](_0xca3a('0x3'),{'body':_0x5326ce,'options':{'where':{'uniqueid':_0xc993ff,'interface':_0x95c77,'agentcomplete':!![]}},'log':_0xca3a('0x3')});}; \ No newline at end of file +var _0x3ac4=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client'];(function(_0x4672d3,_0x241d5b){var _0x263b93=function(_0x33b92f){while(--_0x33b92f){_0x4672d3['push'](_0x4672d3['shift']());}};_0x263b93(++_0x241d5b);}(_0x3ac4,0x125));var _0x43ac=function(_0x5326ea,_0xf4ebfb){_0x5326ea=_0x5326ea-0x0;var _0x4fbcde=_0x3ac4[_0x5326ea];return _0x4fbcde;};'use strict';var client=require(_0x43ac('0x0'));exports[_0x43ac('0x1')]=function(_0x57b171){return client['Request'](_0x43ac('0x2'),{'body':_0x57b171,'log':_0x43ac('0x2')});};exports[_0x43ac('0x3')]=function(_0x2524e6,_0x12481a,_0x315895){return client[_0x43ac('0x4')](_0x43ac('0x5'),{'body':_0x2524e6,'options':{'where':{'uniqueid':_0x12481a,'interface':_0x315895,'agentcomplete':!![]}},'log':_0x43ac('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 6885627..f699a71 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 _0x2ad2=['endOf','day','type','disposition','duration','billableseconds','moment','util','../client','create','Request','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x712d97,_0x53bb9b){var _0x2025e6=function(_0x2b45e3){while(--_0x2b45e3){_0x712d97['push'](_0x712d97['shift']());}};_0x2025e6(++_0x53bb9b);}(_0x2ad2,0x1bb));var _0x22ad=function(_0x45b100,_0x29a4b1){_0x45b100=_0x45b100-0x0;var _0x1b41f8=_0x2ad2[_0x45b100];return _0x1b41f8;};'use strict';var moment=require(_0x22ad('0x0'));var util=require(_0x22ad('0x1'));var _=require('lodash');var client=require(_0x22ad('0x2'));exports[_0x22ad('0x3')]=function(_0x5852aa){return client[_0x22ad('0x4')]('CreateVoiceCallReport',{'body':_['merge'](_0x5852aa,{'source':_0x5852aa['calleridnum'],'destinationcontext':_0x5852aa['context'],'callerid':_0x5852aa[_0x22ad('0x5')],'amaflags':_0x22ad('0x6')}),'log':_0x22ad('0x7')});};exports[_0x22ad('0x8')]=function(){return function(){return client['Request'](_0x22ad('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x22ad('0xa')]('day')[_0x22ad('0xb')](_0x22ad('0xc')),moment()[_0x22ad('0xd')](_0x22ad('0xe'))['format'](_0x22ad('0xc'))]}},'attributes':[_0x22ad('0xf'),_0x22ad('0x10'),_0x22ad('0x11'),_0x22ad('0x12')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x9ae1=['create','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','billableseconds','GetVoiceCallReports','moment','util','lodash'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x9ae1,0x18d));var _0x19ae=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9ae1[_0x279d37];return _0x530173;};'use strict';var moment=require(_0x19ae('0x0'));var util=require(_0x19ae('0x1'));var _=require(_0x19ae('0x2'));var client=require('../client');exports[_0x19ae('0x3')]=function(_0x4ae09d){return client[_0x19ae('0x4')](_0x19ae('0x5'),{'body':_['merge'](_0x4ae09d,{'source':_0x4ae09d[_0x19ae('0x6')],'destinationcontext':_0x4ae09d[_0x19ae('0x7')],'callerid':_0x4ae09d[_0x19ae('0x8')],'amaflags':_0x19ae('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x19ae('0xa')]=function(){return function(){return client[_0x19ae('0x4')](_0x19ae('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x19ae('0xc')]('day')[_0x19ae('0xd')](_0x19ae('0xe')),moment()[_0x19ae('0xf')](_0x19ae('0x10'))['format'](_0x19ae('0xe'))]}},'attributes':[_0x19ae('0x11'),'disposition','duration',_0x19ae('0x12')]},'log':_0x19ae('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index aaaef4c..8fc7d19 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 _0x148d=['create','Request','CreateVoiceDialReport'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x148d,0x1d4));var _0xd148=function(_0x153a0c,_0x1c7404){_0x153a0c=_0x153a0c-0x0;var _0x37cd06=_0x148d[_0x153a0c];return _0x37cd06;};'use strict';var client=require('../client');exports[_0xd148('0x0')]=function(_0xb8230){return client[_0xd148('0x1')](_0xd148('0x2'),{'body':_0xb8230,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0xe588=['../client','create','Request','CreateVoiceDialReport'];(function(_0x18c4c7,_0x2ba1e3){var _0x46e9ca=function(_0xb45415){while(--_0xb45415){_0x18c4c7['push'](_0x18c4c7['shift']());}};_0x46e9ca(++_0x2ba1e3);}(_0xe588,0x12c));var _0x8e58=function(_0x1ace59,_0x2a1ad1){_0x1ace59=_0x1ace59-0x0;var _0x195bc7=_0xe588[_0x1ace59];return _0x195bc7;};'use strict';var client=require(_0x8e58('0x0'));exports[_0x8e58('0x1')]=function(_0x53e7d1){return client[_0x8e58('0x2')]('CreateVoiceDialReport',{'body':_0x53e7d1,'log':_0x8e58('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 9e0f312..2ad8d08 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 _0x6075=['GetVoiceExtension','exten','../client','getVoiceExtensions'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x6075,0x142));var _0x5607=function(_0xb8aff7,_0x2dcc58){_0xb8aff7=_0xb8aff7-0x0;var _0x427f35=_0x6075[_0xb8aff7];return _0x427f35;};'use strict';var client=require(_0x5607('0x0'));exports[_0x5607('0x1')]=function(){return function(){return client['Request'](_0x5607('0x2'),{'options':{'raw':!![],'attributes':['id',_0x5607('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x5106=['exten','recordingFormat','../client','Request'];(function(_0x14f78b,_0x237fa9){var _0x48cd1c=function(_0x17cfe2){while(--_0x17cfe2){_0x14f78b['push'](_0x14f78b['shift']());}};_0x48cd1c(++_0x237fa9);}(_0x5106,0x116));var _0x6510=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5106[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0x6510('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x6510('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x6510('0x2'),_0x6510('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index a0865b2..bbfdac2 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 _0xe2ea=['dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','Pause','mandatoryDispositionPause','TrunkBackup','callerid','active','Interval','Intervals','interval','getVoiceQueues','GetVoiceQueue','acwTimeout','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient'];(function(_0xc4b350,_0x244825){var _0x2e91b6=function(_0x5f46a1){while(--_0x5f46a1){_0xc4b350['push'](_0xc4b350['shift']());}};_0x2e91b6(++_0x244825);}(_0xe2ea,0x101));var _0xae2e=function(_0x28cac0,_0x3cd28b){_0x28cac0=_0x28cac0-0x0;var _0x2badcd=_0xe2ea[_0x28cac0];return _0x2badcd;};'use strict';var client=require('../client');exports[_0xae2e('0x0')]=function(){return function(){return client['Request'](_0xae2e('0x1'),{'options':{'raw':![],'attributes':['id','name','acw',_0xae2e('0x2'),'autopause',_0xae2e('0x3'),_0xae2e('0x4'),_0xae2e('0x5'),'dialMethod',_0xae2e('0x6'),_0xae2e('0x7'),_0xae2e('0x8'),_0xae2e('0x9'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0xae2e('0xa'),'dialOriginateCallerIdNumber',_0xae2e('0xb'),_0xae2e('0xc'),_0xae2e('0xd'),'dialQueueProject','dialCongestionMaxRetry',_0xae2e('0xe'),_0xae2e('0xf'),_0xae2e('0x10'),_0xae2e('0x11'),_0xae2e('0x12'),'dialGlobalMaxRetry',_0xae2e('0x13'),_0xae2e('0x14'),_0xae2e('0x15'),_0xae2e('0x16'),'dialAMDActive',_0xae2e('0x17'),_0xae2e('0x18'),'dialAMDAfterGreetingSilence',_0xae2e('0x19'),'dialAMDMinWordLength',_0xae2e('0x1a'),_0xae2e('0x1b'),'dialAMDSilenceThreshold',_0xae2e('0x1c'),_0xae2e('0x1d'),_0xae2e('0x1e'),_0xae2e('0x1f'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0xae2e('0x20'),_0xae2e('0x21'),_0xae2e('0x3'),_0xae2e('0x22'),_0xae2e('0x23'),_0xae2e('0x24'),_0xae2e('0x25'),_0xae2e('0x26'),_0xae2e('0x27'),'dialDropRetryFrequency',_0xae2e('0x28'),_0xae2e('0x29'),_0xae2e('0x2a'),'dialMachineRetryFrequency',_0xae2e('0x2b'),'dialAgentRejectRetryFrequency',_0xae2e('0x2c'),'dialPredictiveIntervalMaxThreshold',_0xae2e('0x2d'),_0xae2e('0x2e'),_0xae2e('0x2f')],'include':[{'model':_0xae2e('0x30'),'as':_0xae2e('0x30'),'attributes':['id',_0xae2e('0x31'),'callerid','active']},{'model':_0xae2e('0x32'),'as':_0xae2e('0x33'),'attributes':['id',_0xae2e('0x31')]},{'model':'Trunk','as':_0xae2e('0x34'),'attributes':['id',_0xae2e('0x31'),_0xae2e('0x35'),_0xae2e('0x36')]},{'model':_0xae2e('0x37'),'as':_0xae2e('0x37'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xae2e('0x38'),'attributes':['id',_0xae2e('0x31'),_0xae2e('0x39')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0xe746=['dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','Pause','TrunkBackup','active','Interval','Intervals','interval','../client','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType'];(function(_0x5aa191,_0x472c2a){var _0xd5d35=function(_0x34b0b){while(--_0x34b0b){_0x5aa191['push'](_0x5aa191['shift']());}};_0xd5d35(++_0x472c2a);}(_0xe746,0xcc));var _0x6e74=function(_0x28e4b9,_0x59f343){_0x28e4b9=_0x28e4b9-0x0;var _0x413d46=_0xe746[_0x28e4b9];return _0x413d46;};'use strict';var client=require(_0x6e74('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x6e74('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x6e74('0x2'),_0x6e74('0x3'),_0x6e74('0x4'),_0x6e74('0x5'),_0x6e74('0x6'),'dialActive',_0x6e74('0x7'),_0x6e74('0x8'),_0x6e74('0x9'),_0x6e74('0xa'),'dialPredictiveOptimization',_0x6e74('0xb'),'dialPredictiveInterval','dialOriginateCallerIdName',_0x6e74('0xc'),_0x6e74('0xd'),_0x6e74('0xe'),'dialQueueTimeout','dialQueueProject',_0x6e74('0xf'),_0x6e74('0x10'),_0x6e74('0x11'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x6e74('0x12'),_0x6e74('0x13'),_0x6e74('0x14'),_0x6e74('0x15'),_0x6e74('0x16'),_0x6e74('0x17'),_0x6e74('0x18'),'dialAMDInitialSilence',_0x6e74('0x19'),_0x6e74('0x1a'),'dialAMDTotalAnalysisTime',_0x6e74('0x1b'),_0x6e74('0x1c'),_0x6e74('0x1d'),'dialAMDSilenceThreshold',_0x6e74('0x1e'),_0x6e74('0x1f'),_0x6e74('0x20'),'dialRecallInQueue',_0x6e74('0x21'),_0x6e74('0x22'),_0x6e74('0x23'),_0x6e74('0x24'),'monitor_format',_0x6e74('0x25'),'dialRandomLastDigitCallerIdNumber',_0x6e74('0x26'),_0x6e74('0x27'),_0x6e74('0x28'),_0x6e74('0x29'),'dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency',_0x6e74('0x2a'),_0x6e74('0x2b'),_0x6e74('0x2c'),_0x6e74('0x2d'),'dialPredictiveIntervalMinThreshold',_0x6e74('0x2e'),_0x6e74('0x2f')],'include':[{'model':_0x6e74('0x30'),'as':_0x6e74('0x30'),'attributes':['id',_0x6e74('0x31'),_0x6e74('0x32'),'active']},{'model':_0x6e74('0x33'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':'Trunk','as':_0x6e74('0x34'),'attributes':['id',_0x6e74('0x31'),'callerid',_0x6e74('0x35')]},{'model':_0x6e74('0x36'),'as':_0x6e74('0x36'),'attributes':['id',_0x6e74('0x31')],'include':[{'model':_0x6e74('0x36'),'as':_0x6e74('0x37'),'attributes':['id',_0x6e74('0x31'),_0x6e74('0x38')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 2a1a77f..96b4e4e 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(_0x212776,_0x38666e){var _0x46b217=function(_0x2f8365){while(--_0x2f8365){_0x212776['push'](_0x212776['shift']());}};_0x46b217(++_0x38666e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x58e872,_0x1d4fad){var _0xd1739e=function(_0x1b11c7){while(--_0x1b11c7){_0x58e872['push'](_0x58e872['shift']());}};_0xd1739e(++_0x1d4fad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 50479e6..11f460e 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 _0x7407=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x43ae14,_0xd2cce0){var _0x51ef24=function(_0x1112f2){while(--_0x1112f2){_0x43ae14['push'](_0x43ae14['shift']());}};_0x51ef24(++_0xd2cce0);}(_0x7407,0x81));var _0x7740=function(_0xe18a43,_0x4ccd77){_0xe18a43=_0xe18a43-0x0;var _0x31cca5=_0x7407[_0xe18a43];return _0x31cca5;};'use strict';var client=require(_0x7740('0x0'));exports[_0x7740('0x1')]=function(_0x2174b9){return function(){return client[_0x7740('0x2')](_0x7740('0x3'),{'options':{'where':{'VoiceQueueId':_0x2174b9,'paused':!![]},'raw':!![]},'log':_0x7740('0x1')});};}; \ No newline at end of file +var _0xa34b=['../client','getVoiceQueueRtPauses','Request'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0xa34b,0x177));var _0xba34=function(_0x1600da,_0x185a23){_0x1600da=_0x1600da-0x0;var _0x5ddc23=_0xa34b[_0x1600da];return _0x5ddc23;};'use strict';var client=require(_0xba34('0x0'));exports[_0xba34('0x1')]=function(_0x144a2b){return function(){return client[_0xba34('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x144a2b,'paused':!![]},'raw':!![]},'log':_0xba34('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 92362c6..ae42915 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(_0xcab034,_0x57b43b){var _0x4a8d4a=function(_0x58427c){while(--_0x58427c){_0xcab034['push'](_0xcab034['shift']());}};_0x4a8d4a(++_0x57b43b);}(_0x7a54,0x106));var _0x47a5=function(_0x1e1de6,_0x4f4cf9){_0x1e1de6=_0x1e1de6-0x0;var _0x2ff233=_0x7a54[_0x1e1de6];return _0x2ff233;};'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(_0x36fb73,_0x5e7cf7){var _0x15cc6c=function(_0x48d721){while(--_0x48d721){_0x36fb73['push'](_0x36fb73['shift']());}};_0x15cc6c(++_0x5e7cf7);}(_0x7a54,0x106));var _0x47a5=function(_0x2bc0c0,_0x52621c){_0x2bc0c0=_0x2bc0c0-0x0;var _0x5ecc0b=_0x7a54[_0x2bc0c0];return _0x5ecc0b;};'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 47d8236..6fe73cd 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 _0x2509=['transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereeexten','transfereelinkedid','extension','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename'];(function(_0x343090,_0x433a80){var _0x3ff3e8=function(_0x16c811){while(--_0x16c811){_0x343090['push'](_0x343090['shift']());}};_0x3ff3e8(++_0x433a80);}(_0x2509,0x1a7));var _0x9250=function(_0x3bb5b4,_0x128455){_0x3bb5b4=_0x3bb5b4-0x0;var _0x586c60=_0x2509[_0x3bb5b4];return _0x586c60;};'use strict';var client=require(_0x9250('0x0'));exports['transfers']={};exports[_0x9250('0x1')]=function(_0x3809d3){return client[_0x9250('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x3809d3[_0x9250('0x3')],'transfererchannel':_0x3809d3[_0x9250('0x4')],'transferercalleridnum':_0x3809d3[_0x9250('0x5')],'transferercalleridname':_0x3809d3[_0x9250('0x6')],'transfererconnectedlinenum':_0x3809d3[_0x9250('0x7')],'transfererconnectedlinename':_0x3809d3[_0x9250('0x8')],'transfereraccountcode':_0x3809d3['transfereraccountcode'],'transferercontext':_0x3809d3[_0x9250('0x9')],'transfererexten':_0x3809d3[_0x9250('0xa')],'transfererlinkedid':_0x3809d3[_0x9250('0xb')],'transfereechannel':_0x3809d3[_0x9250('0xc')],'transfereecalleridnum':_0x3809d3['transfereecalleridnum'],'transfereecalleridname':_0x3809d3[_0x9250('0xd')],'transfereeconnectedlinenum':_0x3809d3[_0x9250('0xe')],'transfereeconnectedlinename':_0x3809d3['transfereeconnectedlinename'],'transfereeaccountcode':_0x3809d3[_0x9250('0xf')],'transfereecontext':_0x3809d3['transfereecontext'],'transfereeexten':_0x3809d3[_0x9250('0x10')],'transfereelinkedid':_0x3809d3[_0x9250('0x11')],'isexternal':_0x3809d3['isexternal'],'context':_0x3809d3['context'],'extension':_0x3809d3[_0x9250('0x12')],'type':'blind'},'log':_0x9250('0x13')});};exports[_0x9250('0x14')]=function(_0x45cd4e){return client[_0x9250('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x45cd4e['result'],'transfererchannel':_0x45cd4e[_0x9250('0x15')],'transferercalleridnum':_0x45cd4e['origtransferercalleridnum'],'transferercalleridname':_0x45cd4e[_0x9250('0x16')],'transfererconnectedlinenum':_0x45cd4e[_0x9250('0x17')],'transfererconnectedlinename':_0x45cd4e['secondtransfererconnectedlinename'],'transfereraccountcode':_0x45cd4e['origtransfereraccountcode'],'transferercontext':_0x45cd4e[_0x9250('0x18')],'transfererexten':_0x45cd4e['secondtransfererexten'],'transfererlinkedid':_0x45cd4e[_0x9250('0x19')],'transfereechannel':_0x45cd4e[_0x9250('0x1a')],'transfereecalleridnum':_0x45cd4e[_0x9250('0x1b')],'transfereecalleridname':_0x45cd4e['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x45cd4e[_0x9250('0x1c')],'transfereeconnectedlinename':_0x45cd4e['transfertargetconnectedlinename'],'transfereeaccountcode':_0x45cd4e[_0x9250('0x1d')],'transfereecontext':_0x45cd4e['transfertargetcontext'],'transfereeexten':_0x45cd4e[_0x9250('0x1e')],'transfereelinkedid':_0x45cd4e[_0x9250('0x1f')],'isexternal':_0x45cd4e[_0x9250('0x20')],'context':_0x45cd4e[_0x9250('0x21')],'extension':_0x45cd4e[_0x9250('0x22')],'type':_0x9250('0x23')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x2840=['result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','isexternal','context','extension','blind','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0x2840,0x133));var _0x0284=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0x2840[_0x5f4cd7];return _0x47c93f;};'use strict';var client=require(_0x0284('0x0'));exports[_0x0284('0x1')]={};exports[_0x0284('0x2')]=function(_0x3d8dd4){return client[_0x0284('0x3')](_0x0284('0x4'),{'body':{'result':_0x3d8dd4[_0x0284('0x5')],'transfererchannel':_0x3d8dd4[_0x0284('0x6')],'transferercalleridnum':_0x3d8dd4[_0x0284('0x7')],'transferercalleridname':_0x3d8dd4[_0x0284('0x8')],'transfererconnectedlinenum':_0x3d8dd4[_0x0284('0x9')],'transfererconnectedlinename':_0x3d8dd4[_0x0284('0xa')],'transfereraccountcode':_0x3d8dd4[_0x0284('0xb')],'transferercontext':_0x3d8dd4[_0x0284('0xc')],'transfererexten':_0x3d8dd4[_0x0284('0xd')],'transfererlinkedid':_0x3d8dd4['transfererlinkedid'],'transfereechannel':_0x3d8dd4[_0x0284('0xe')],'transfereecalleridnum':_0x3d8dd4['transfereecalleridnum'],'transfereecalleridname':_0x3d8dd4['transfereecalleridname'],'transfereeconnectedlinenum':_0x3d8dd4[_0x0284('0xf')],'transfereeconnectedlinename':_0x3d8dd4[_0x0284('0x10')],'transfereeaccountcode':_0x3d8dd4[_0x0284('0x11')],'transfereecontext':_0x3d8dd4[_0x0284('0x12')],'transfereeexten':_0x3d8dd4['transfereeexten'],'transfereelinkedid':_0x3d8dd4['transfereelinkedid'],'isexternal':_0x3d8dd4[_0x0284('0x13')],'context':_0x3d8dd4[_0x0284('0x14')],'extension':_0x3d8dd4[_0x0284('0x15')],'type':_0x0284('0x16')},'log':'CreateVoiceTransferReport'});};exports[_0x0284('0x17')]=function(_0x5e7a97){return client[_0x0284('0x3')](_0x0284('0x4'),{'body':{'result':_0x5e7a97[_0x0284('0x5')],'transfererchannel':_0x5e7a97['origtransfererchannel'],'transferercalleridnum':_0x5e7a97[_0x0284('0x18')],'transferercalleridname':_0x5e7a97[_0x0284('0x19')],'transfererconnectedlinenum':_0x5e7a97[_0x0284('0x1a')],'transfererconnectedlinename':_0x5e7a97[_0x0284('0x1b')],'transfereraccountcode':_0x5e7a97[_0x0284('0x1c')],'transferercontext':_0x5e7a97[_0x0284('0x1d')],'transfererexten':_0x5e7a97['secondtransfererexten'],'transfererlinkedid':_0x5e7a97['origtransfererlinkedid'],'transfereechannel':_0x5e7a97[_0x0284('0x1e')],'transfereecalleridnum':_0x5e7a97['transfertargetcalleridnum'],'transfereecalleridname':_0x5e7a97['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x5e7a97[_0x0284('0x1f')],'transfereeconnectedlinename':_0x5e7a97[_0x0284('0x20')],'transfereeaccountcode':_0x5e7a97[_0x0284('0x21')],'transfereecontext':_0x5e7a97[_0x0284('0x22')],'transfereeexten':_0x5e7a97[_0x0284('0x23')],'transfereelinkedid':_0x5e7a97[_0x0284('0x24')],'isexternal':_0x5e7a97[_0x0284('0x13')],'context':_0x5e7a97[_0x0284('0x25')],'extension':_0x5e7a97['origtransfererexten'],'type':_0x0284('0x26')},'log':_0x0284('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 81387db..d77e048 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x10f9bb,_0xe5cb46){var _0xc88fc5=function(_0x332233){while(--_0x332233){_0x10f9bb['push'](_0x10f9bb['shift']());}};_0xc88fc5(++_0xe5cb46);}(_0xb10b,0x12a));var _0xbb10=function(_0x388550,_0x3fd74b){_0x388550=_0x388550-0x0;var _0x735860=_0xb10b[_0x388550];return _0x735860;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x46f860,_0x1ff6f9){var _0xf7f46e=function(_0x140325){while(--_0x140325){_0x46f860['push'](_0x46f860['shift']());}};_0xf7f46e(++_0x1ff6f9);}(_0xb10b,0x12a));var _0xbb10=function(_0x505088,_0x23a321){_0x505088=_0x505088-0x0;var _0x3eb2c9=_0xb10b[_0x505088];return _0x3eb2c9;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 2c28af3..1f52413 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 _0x2067=['calleridname','','destcalleridname','Unknown','resolve','[CM][%s][%s]\x20Contact\x20created:%s','push','format','trigger:%s','toLowerCase','lodash','ioredis','util','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','[CM][%s][%s]','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','updatedAt','union','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0x2067,0x161));var _0x7206=function(_0x21cecb,_0x2872d2){_0x21cecb=_0x21cecb-0x0;var _0x191984=_0x2067[_0x21cecb];return _0x191984;};'use strict';var _=require(_0x7206('0x0'));var BPromise=require('bluebird');var Redis=require(_0x7206('0x1'));var util=require(_0x7206('0x2'));var config=require('../../../../config/environment');var logger=require(_0x7206('0x3'))('trigger');var cmContactRpc=require(_0x7206('0x4'));config[_0x7206('0x5')]=_[_0x7206('0x6')](config[_0x7206('0x5')],{'host':_0x7206('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x15c0c5,_0x3685f9,_0x559939,_0x2cf8da,_0x1ef65c){logger['info'](_0x7206('0x8'),_0x15c0c5,_0x3685f9['id'],_0x559939,_0x2cf8da,JSON['stringify'](_0x1ef65c));io['to'](_0x559939)['emit'](_0x2cf8da,_0x1ef65c);}exports[_0x7206('0x9')]=function(_0x164c54,_0x15eab9,_0x1b6e1f,_0xbca8b7){var _0x5c4362,_0x2e4a27;var _0x16e931={};var _0x2cfd59;var _0x277593=Number(_0x1b6e1f[_0x7206('0xa')]);var _0x2afd1a=_0x1b6e1f[_0x7206('0xb')]?Boolean(Number(_0x1b6e1f[_0x7206('0xb')])):![];var _0x55279e;var _0x2baee1=![];if(!_[_0x7206('0xc')](_0x1b6e1f['data5'])){if(_0x1b6e1f[_0x7206('0xd')]=='1')_0x2baee1=!![];}if(!_0x2baee1){if(_0xbca8b7[_0x7206('0xe')]){_0x16e931['id']=_0xbca8b7[_0x7206('0xe')];}}if(!_0x16e931['id']){_0x16e931[_0x7206('0xf')]=_0x277593;_0x55279e=_0x1b6e1f[_0x7206('0x10')]&&_0x1b6e1f[_0x7206('0x10')]!=='0'?_0x1b6e1f[_0x7206('0x10')][_0x7206('0x11')](','):[_0x7206('0x12')];_0x16e931['$or']=_[_0x7206('0x13')](_0x55279e,function(_0x2f53ea){var _0x19c547={};_0x19c547[_0x2f53ea]=_0xbca8b7[_0x7206('0x14')]?_0xbca8b7[_0x7206('0x15')]:_0xbca8b7[_0x7206('0x16')];return _0x19c547;});_0x2cfd59=_0xbca8b7[_0x7206('0x14')]?_0xbca8b7[_0x7206('0x15')]:_0xbca8b7[_0x7206('0x16')];}var _0x15432b=['id',_0x7206('0x17'),_0x7206('0x18'),'phone',_0x7206('0x19'),'fax',_0x7206('0xf'),_0x7206('0x1a'),'scheduledAt',_0x7206('0x1b')];var _0x292d53=_[_0x7206('0x1c')](_0x15432b,_0x55279e);BPromise['resolve']()[_0x7206('0x1d')](cmContactRpc['getContacts']({'attributes':_0x292d53,'where':_0x16e931,'phone':_0x2cfd59}))[_0x7206('0x1d')](function(_0x581584){_0x2e4a27=_0x581584;if(!_[_0x7206('0x1e')](_0x2e4a27)){if(_0x2e4a27[_0x7206('0x1f')]===0x1){_0x5c4362=_0x2e4a27[0x0];logger[_0x7206('0x20')](_0x7206('0x21'),_0xbca8b7[_0x7206('0x22')],_0x15eab9['id'],_0x5c4362['id']);}else{logger[_0x7206('0x20')](_0x7206('0x23'),_0xbca8b7[_0x7206('0x22')],_0x15eab9['id'],_[_0x7206('0x13')](_0x2e4a27,'id')[_0x7206('0x24')](','));}return;}else{logger[_0x7206('0x20')](_0x7206('0x25'),_0xbca8b7[_0x7206('0x22')],_0x15eab9['id']);var _0x11fa9={'ListId':_0x277593};var _0x41d5ec=_0x1b6e1f[_0x7206('0x26')]&&_0x1b6e1f[_0x7206('0x26')]!=='0'?_0x1b6e1f[_0x7206('0x26')]:_0x7206('0x12');if(_0x2afd1a){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0xbca8b7['uniqueid'],_0x15eab9['id']);_0x11fa9[_0x41d5ec]=_[_0x7206('0xc')](_0xbca8b7[_0x7206('0x14')])?_0xbca8b7['calleridnum']:_0xbca8b7[_0x7206('0x15')];if(_[_0x7206('0xc')](_0xbca8b7['routeId'])){_0x11fa9[_0x7206('0x17')]=_0xbca8b7[_0x7206('0x27')]&&_0xbca8b7[_0x7206('0x27')]!==_0x7206('0x28')?_0xbca8b7[_0x7206('0x27')]:'Unknown';}else{_0x11fa9[_0x7206('0x17')]=_0xbca8b7[_0x7206('0x29')]&&_0xbca8b7[_0x7206('0x29')]!==_0x7206('0x28')?_0xbca8b7[_0x7206('0x29')]:_0x7206('0x2a');}return BPromise[_0x7206('0x2b')]()['then'](cmContactRpc['createContact'](_0x11fa9))[_0x7206('0x1d')](function(_0x487300){_0x5c4362=_0x487300;_0x2e4a27['push'](_0x487300);if(_0x5c4362){logger[_0x7206('0x20')](_0x7206('0x2c'),_0xbca8b7[_0x7206('0x22')],_0x15eab9['id'],_0x5c4362['id']);}return;});}else{logger[_0x7206('0x20')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0xbca8b7[_0x7206('0x22')],_0x15eab9['id']);_0x11fa9[_0x41d5ec]=_[_0x7206('0xc')](_0xbca8b7[_0x7206('0x14')])?_0xbca8b7[_0x7206('0x16')]:_0xbca8b7[_0x7206('0x15')];if(_['isNil'](_0xbca8b7[_0x7206('0x14')])){_0x11fa9['firstName']=_0xbca8b7[_0x7206('0x27')]&&_0xbca8b7[_0x7206('0x27')]!==_0x7206('0x28')?_0xbca8b7[_0x7206('0x27')]:'Unknown';}else{_0x11fa9[_0x7206('0x17')]=_0xbca8b7[_0x7206('0x29')]&&_0xbca8b7[_0x7206('0x29')]!==_0x7206('0x28')?_0xbca8b7['destcalleridname']:_0x7206('0x2a');}_0x5c4362=_0x11fa9;_0x2e4a27[_0x7206('0x2d')](_0x11fa9);return;}}})[_0x7206('0x1d')](function(){if(_0x164c54){emit(_0xbca8b7[_0x7206('0x22')],_0x15eab9,util[_0x7206('0x2e')]('user:%s',_0x164c54['name']),util['format'](_0x7206('0x2f'),_0x1b6e1f['action'][_0x7206('0x30')]()),{'evt':_['merge'](_0xbca8b7,{'autoCreate':_0x2afd1a}),'contact':_0x5c4362===undefined?{}:_0x5c4362,'contacts':_0x2e4a27[_0x7206('0x1f')]===0x0?undefined:_0x2e4a27});}});}; \ No newline at end of file +var _0x8f0a=['Unknown','destcalleridname','','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','trigger:%s','action','toLowerCase','merge','length','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','stringify','emit','exec','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','then','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f0a,0x157));var _0xa8f0=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0x8f0a[_0x474d97];return _0x1edf25;};'use strict';var _=require(_0xa8f0('0x0'));var BPromise=require(_0xa8f0('0x1'));var Redis=require(_0xa8f0('0x2'));var util=require('util');var config=require(_0xa8f0('0x3'));var logger=require(_0xa8f0('0x4'))(_0xa8f0('0x5'));var cmContactRpc=require(_0xa8f0('0x6'));config[_0xa8f0('0x7')]=_['defaults'](config[_0xa8f0('0x7')],{'host':_0xa8f0('0x8'),'port':0x18eb});var io=require(_0xa8f0('0x9'))(new Redis(config[_0xa8f0('0x7')]));function emit(_0x233f2e,_0x53a740,_0x2e5920,_0x79f240,_0x2db575){logger[_0xa8f0('0xa')]('[CM][%s][%s]',_0x233f2e,_0x53a740['id'],_0x2e5920,_0x79f240,JSON[_0xa8f0('0xb')](_0x2db575));io['to'](_0x2e5920)[_0xa8f0('0xc')](_0x79f240,_0x2db575);}exports[_0xa8f0('0xd')]=function(_0x117159,_0x496d31,_0x9e8582,_0x2d541d){var _0x21daef,_0xc55fde;var _0x13808e={};var _0x231d6c;var _0x37e3a9=Number(_0x9e8582['data1']);var _0xc06516=_0x9e8582['data2']?Boolean(Number(_0x9e8582[_0xa8f0('0xe')])):![];var _0x190e38;var _0x58b9f2=![];if(!_[_0xa8f0('0xf')](_0x9e8582[_0xa8f0('0x10')])){if(_0x9e8582['data5']=='1')_0x58b9f2=!![];}if(!_0x58b9f2){if(_0x2d541d[_0xa8f0('0x11')]){_0x13808e['id']=_0x2d541d[_0xa8f0('0x11')];}}if(!_0x13808e['id']){_0x13808e[_0xa8f0('0x12')]=_0x37e3a9;_0x190e38=_0x9e8582[_0xa8f0('0x13')]&&_0x9e8582[_0xa8f0('0x13')]!=='0'?_0x9e8582[_0xa8f0('0x13')]['split'](','):[_0xa8f0('0x14')];_0x13808e[_0xa8f0('0x15')]=_[_0xa8f0('0x16')](_0x190e38,function(_0x595b43){var _0x1644a0={};_0x1644a0[_0x595b43]=_0x2d541d[_0xa8f0('0x17')]?_0x2d541d[_0xa8f0('0x18')]:_0x2d541d[_0xa8f0('0x19')];return _0x1644a0;});_0x231d6c=_0x2d541d['routeId']?_0x2d541d[_0xa8f0('0x18')]:_0x2d541d['calleridnum'];}var _0x10e3ca=['id',_0xa8f0('0x1a'),'lastName','phone',_0xa8f0('0x1b'),_0xa8f0('0x1c'),_0xa8f0('0x12'),_0xa8f0('0x1d'),_0xa8f0('0x1e'),_0xa8f0('0x1f')];var _0xa9ee68=_['union'](_0x10e3ca,_0x190e38);BPromise[_0xa8f0('0x20')]()[_0xa8f0('0x21')](cmContactRpc['getContacts']({'attributes':_0xa9ee68,'where':_0x13808e,'phone':_0x231d6c}))[_0xa8f0('0x21')](function(_0x5b8e7e){_0xc55fde=_0x5b8e7e;if(!_[_0xa8f0('0x22')](_0xc55fde)){if(_0xc55fde['length']===0x1){_0x21daef=_0xc55fde[0x0];logger[_0xa8f0('0xa')](_0xa8f0('0x23'),_0x2d541d[_0xa8f0('0x24')],_0x496d31['id'],_0x21daef['id']);}else{logger['info'](_0xa8f0('0x25'),_0x2d541d[_0xa8f0('0x24')],_0x496d31['id'],_['map'](_0xc55fde,'id')[_0xa8f0('0x26')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x2d541d['uniqueid'],_0x496d31['id']);var _0x415e8a={'ListId':_0x37e3a9};var _0x104a99=_0x9e8582['data4']&&_0x9e8582[_0xa8f0('0x27')]!=='0'?_0x9e8582[_0xa8f0('0x27')]:_0xa8f0('0x14');if(_0xc06516){logger[_0xa8f0('0xa')](_0xa8f0('0x28'),_0x2d541d[_0xa8f0('0x24')],_0x496d31['id']);_0x415e8a[_0x104a99]=_[_0xa8f0('0xf')](_0x2d541d[_0xa8f0('0x17')])?_0x2d541d[_0xa8f0('0x19')]:_0x2d541d[_0xa8f0('0x18')];if(_[_0xa8f0('0xf')](_0x2d541d[_0xa8f0('0x17')])){_0x415e8a[_0xa8f0('0x1a')]=_0x2d541d['calleridname']&&_0x2d541d['calleridname']!==''?_0x2d541d[_0xa8f0('0x29')]:_0xa8f0('0x2a');}else{_0x415e8a[_0xa8f0('0x1a')]=_0x2d541d[_0xa8f0('0x2b')]&&_0x2d541d[_0xa8f0('0x2b')]!==_0xa8f0('0x2c')?_0x2d541d[_0xa8f0('0x2b')]:_0xa8f0('0x2a');}return BPromise[_0xa8f0('0x20')]()['then'](cmContactRpc[_0xa8f0('0x2d')](_0x415e8a))[_0xa8f0('0x21')](function(_0x5821d4){_0x21daef=_0x5821d4;_0xc55fde['push'](_0x5821d4);if(_0x21daef){logger['info'](_0xa8f0('0x2e'),_0x2d541d[_0xa8f0('0x24')],_0x496d31['id'],_0x21daef['id']);}return;});}else{logger[_0xa8f0('0xa')](_0xa8f0('0x2f'),_0x2d541d[_0xa8f0('0x24')],_0x496d31['id']);_0x415e8a[_0x104a99]=_[_0xa8f0('0xf')](_0x2d541d['routeId'])?_0x2d541d[_0xa8f0('0x19')]:_0x2d541d[_0xa8f0('0x18')];if(_[_0xa8f0('0xf')](_0x2d541d['routeId'])){_0x415e8a[_0xa8f0('0x1a')]=_0x2d541d[_0xa8f0('0x29')]&&_0x2d541d['calleridname']!==_0xa8f0('0x2c')?_0x2d541d[_0xa8f0('0x29')]:_0xa8f0('0x2a');}else{_0x415e8a[_0xa8f0('0x1a')]=_0x2d541d[_0xa8f0('0x2b')]&&_0x2d541d[_0xa8f0('0x2b')]!==_0xa8f0('0x2c')?_0x2d541d[_0xa8f0('0x2b')]:_0xa8f0('0x2a');}_0x21daef=_0x415e8a;_0xc55fde[_0xa8f0('0x30')](_0x415e8a);return;}}})[_0xa8f0('0x21')](function(){if(_0x117159){emit(_0x2d541d[_0xa8f0('0x24')],_0x496d31,util[_0xa8f0('0x31')]('user:%s',_0x117159['name']),util[_0xa8f0('0x31')](_0xa8f0('0x32'),_0x9e8582[_0xa8f0('0x33')][_0xa8f0('0x34')]()),{'evt':_[_0xa8f0('0x35')](_0x2d541d,{'autoCreate':_0xc06516}),'contact':_0x21daef===undefined?{}:_0x21daef,'contacts':_0xc55fde[_0xa8f0('0x36')]===0x0?undefined:_0xc55fde});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index c6759d2..705af53 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 _0xb04a=['debug','inspect','interface','status','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','data3','isNil','data4','location','uriLocation','windowWidth','data5','800','data6','600','winApplication','format','trigger:%s:%s','data1','jscripty','user:%s','name','trigger:%s','exec','integration','queue','urlforward','query','search','replace','checkTrigger','channel','AllConditions','checkConditions','AnyConditions','some','checkTrigger:\x20trigger','field','account','chat','ChatWebsiteId','operator','value','AccountId','interaction','event','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','exports','util','url','mustache','ioredis','./urlforward','./integration','../../../config/environment','../../../config/logger','trigger','redis','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentconnect','custom:agentnosuchnumber','custom:agentnoanswer','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:closedinteraction','custom:substatus','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','emit','stringify','prototype','motionChannel','undefined','voice'];(function(_0x20d08e,_0x4cc575){var _0x2cbd12=function(_0x3de355){while(--_0x3de355){_0x20d08e['push'](_0x20d08e['shift']());}};_0x2cbd12(++_0x4cc575);}(_0xb04a,0xbb));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xab04('0x0'));var _=require('lodash');var url=require(_0xab04('0x1'));var Mustache=require(_0xab04('0x2'));var Redis=require(_0xab04('0x3'));var urlforward=require(_0xab04('0x4'));var integration=require(_0xab04('0x5'));var cmContact=require('./cmContact');var script=require('./script');var config=require(_0xab04('0x6'));var logger=require(_0xab04('0x7'))(_0xab04('0x8'));var ami=require('../ami');config['redis']=_['defaults'](config[_0xab04('0x9')],{'host':_0xab04('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xab04('0x9')]));var operators={'equals':function(_0xc2ab48,_0x4ce7e7){return _0xc2ab48==_0x4ce7e7;},'not_equals':function(_0x113e70,_0x46267a){return _0x113e70!=_0x46267a;}};var barAndWebActions=[_0xab04('0xb'),_0xab04('0x1'),_0xab04('0xc')];function Trigger(_0xc8130e){this[_0xab04('0xd')]=_0xc8130e[_0xab04('0xd')];this[_0xab04('0xe')]=_0xc8130e[_0xab04('0xe')];this[_0xab04('0xf')]=_0xc8130e[_0xab04('0xf')];this['templates']=_0xc8130e[_0xab04('0x10')];this[_0xab04('0x11')]=_0xc8130e['voiceExtensions'];this[_0xab04('0x12')]=_0xc8130e[_0xab04('0x12')];this[_0xab04('0x13')]=_0xc8130e['freshdeskAccounts'];this[_0xab04('0x14')]=_0xc8130e[_0xab04('0x14')];this[_0xab04('0x15')]=_0xc8130e['sugarcrmAccounts'];this[_0xab04('0x16')]=_0xc8130e[_0xab04('0x16')];this['deskAccounts']=_0xc8130e[_0xab04('0x17')];this[_0xab04('0x18')]=_0xc8130e[_0xab04('0x18')];this[_0xab04('0x19')]=_0xc8130e[_0xab04('0x19')];this[_0xab04('0x1a')]=_0xc8130e[_0xab04('0x1a')];this[_0xab04('0x1b')]=_0xc8130e[_0xab04('0x1b')];this[_0xab04('0x1c')]={'zendesk':this[_0xab04('0x12')],'salesforce':this[_0xab04('0x14')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xab04('0x15')],'zoho':this[_0xab04('0x16')],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xab04('0x1a')],'freshsales':this[_0xab04('0x1b')],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0xab04('0x1d')][_0xab04('0x1e')](this));ami['on'](_0xab04('0x1f'),this[_0xab04('0x1d')]['bind'](this));ami['on']('custom:agentringnoanswer',this[_0xab04('0x1d')][_0xab04('0x1e')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0xab04('0x1e')](this));ami['on'](_0xab04('0x20'),this[_0xab04('0x1d')][_0xab04('0x1e')](this));ami['on'](_0xab04('0x21'),this[_0xab04('0x1d')][_0xab04('0x1e')](this));ami['on']('custom:agentbusy',this[_0xab04('0x1d')]['bind'](this));ami['on']('custom:agentcongestion',this[_0xab04('0x1d')][_0xab04('0x1e')](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0xab04('0x1e')](this));ami['on']('custom:amd',this[_0xab04('0x1d')][_0xab04('0x1e')](this));ami['on']('custom:queuecallerabandon',this[_0xab04('0x1d')][_0xab04('0x1e')](this));ami['on'](_0xab04('0x22'),this['syncCustomEvent'][_0xab04('0x1e')](this));ami['on'](_0xab04('0x23'),this[_0xab04('0x24')][_0xab04('0x1e')](this));ami['on']('custom:dialconnect',this[_0xab04('0x24')]['bind'](this));ami['on'](_0xab04('0x25'),this['syncAgentDial'][_0xab04('0x1e')](this));ami['on']('custom:newinteraction',this[_0xab04('0x1d')]['bind'](this));ami['on'](_0xab04('0x26'),this['syncCustomEvent']['bind'](this));ami['on'](_0xab04('0x27'),this['syncCustomEvent'][_0xab04('0x1e')](this));ami['on']('custom:incomingmessage',this[_0xab04('0x1d')][_0xab04('0x1e')](this));ami['on']('custom:outgoingmessage',this[_0xab04('0x1d')][_0xab04('0x1e')](this));ami['on'](_0xab04('0x28'),this[_0xab04('0x1d')]['bind'](this));ami['on'](_0xab04('0x29'),this[_0xab04('0x1d')][_0xab04('0x1e')](this));ami['on'](_0xab04('0x2a'),this[_0xab04('0x1d')][_0xab04('0x1e')](this));}Trigger['prototype'][_0xab04('0x2b')]=function(_0x144da2,_0x118ac7,_0x221928){logger['info'](_0x144da2,_0x118ac7,JSON[_0xab04('0x2c')](_0x221928));io['to'](_0x144da2)[_0xab04('0x2b')](_0x118ac7,_0x221928);};Trigger[_0xab04('0x2d')][_0xab04('0x1d')]=function(_0x5ab30a){var _0x11fad5=_['clone'](_0x5ab30a);if(typeof _0x11fad5[_0xab04('0x2e')]===_0xab04('0x2f')){_0x11fad5[_0xab04('0x2e')]=_0xab04('0x30');}logger[_0xab04('0x31')](_0xab04('0x1d'),util[_0xab04('0x32')](_0x11fad5,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x11fad5);};Trigger[_0xab04('0x2d')][_0xab04('0x24')]=function(_0x2e1fc2){if(this[_0xab04('0xe')][_0x2e1fc2[_0xab04('0x33')]]){this[_0xab04('0x1d')](_0x2e1fc2);}};Trigger[_0xab04('0x2d')]['checkTriggers']=function(_0x3f4a88){var _0x2da78;for(var _0x1b8bea in this[_0xab04('0xd')]){if(this['triggers']['hasOwnProperty'](_0x1b8bea)){if(this[_0xab04('0xd')][_0x1b8bea][_0xab04('0x34')]){_0x2da78=this['checkTrigger'](this['triggers'][_0x1b8bea],_0x3f4a88);if(_0x2da78){_[_0xab04('0x35')](_0x3f4a88,_0x3f4a88[_0xab04('0x36')]);for(var _0x390128=0x0,_0x36128d,_0xc8cac7,_0x37b7cb;_0x3901280x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe14b,0x93));var _0xbe14=function(_0x338291,_0x283970){_0x338291=_0x338291-0x0;var _0xb0cba7=_0xe14b[_0x338291];return _0xb0cba7;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index dd992ff..6f9e37c 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 _0x49cb=['systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','catch','calleridnum','telephone1','&$filter=','\x20eq\x20\x27','replace','%2b','Bearer\x20','enduserId','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','Fields','phonecall','callDirection','queue','/contacts(','phonecalls','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','format','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','ticketId','error','lodash','request-promise','util','./util','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','POST','clientId','username','password','access_token','message','then','GET'];(function(_0x251a41,_0x351dad){var _0x1c2d5c=function(_0x15984b){while(--_0x15984b){_0x251a41['push'](_0x251a41['shift']());}};_0x1c2d5c(++_0x351dad);}(_0x49cb,0xc9));var _0xb49c=function(_0x216e1e,_0x5587d0){_0x216e1e=_0x216e1e-0x0;var _0xc109a=_0x49cb[_0x216e1e];return _0xc109a;};'use strict';var _=require(_0xb49c('0x0'));var rp=require(_0xb49c('0x1'));var util=require(_0xb49c('0x2'));var intUtil=require(_0xb49c('0x3'));var md5=require('md5');var Redis=require('ioredis');var logger=require(_0xb49c('0x4'))('dynamics365');var config=require(_0xb49c('0x5'));config[_0xb49c('0x6')]=_[_0xb49c('0x7')](config['redis'],{'host':_0xb49c('0x8'),'port':0x18eb});var io=require(_0xb49c('0x9'))(new Redis(config[_0xb49c('0x6')]));function getAuthToken(_0x3203d2,_0x2a8aef,_0x4d2e6f){if(_0x3203d2[_0xb49c('0xa')]){_0x3203d2[_0xb49c('0xb')]=_0x3203d2[_0xb49c('0xc')][_0xb49c('0xd')];_0x3203d2[_0xb49c('0xe')]=_0x3203d2['CloudProvider']['data2'];return Promise['resolve'](_0x3203d2[_0xb49c('0xc')]['data5']);}var _0x2c8f7b={'method':_0xb49c('0xf'),'uri':_0x2a8aef,'form':{'client_id':_0x3203d2[_0xb49c('0x10')],'resource':_0x3203d2[_0xb49c('0xb')],'username':_0x3203d2[_0xb49c('0x11')],'password':_0x3203d2[_0xb49c('0x12')],'grant_type':_0xb49c('0x12'),'client_secret':_0x3203d2['clientSecret']},'json':!![]};return rp(_0x2c8f7b)['then'](function(_0x523937){return _0x523937[_0xb49c('0x13')];})['catch'](function(_0x1f782b){logger['error']('['+[_0x4d2e6f['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x1f782b[_0xb49c('0x14')];});}function getUser(_0x1a10cd,_0x1e227d,_0x5795c4,_0x2ff5ae,_0x5c8524,_0x21b990){return new Promise(function(_0x2b89e8,_0xf9e46a){return getAuthToken(_0x1e227d,_0x2ff5ae,_0x21b990)[_0xb49c('0x15')](function(_0x550bf8){var _0x35a694={'method':_0xb49c('0x16'),'uri':_0x5c8524+_0xb49c('0x17'),'headers':{'Authorization':'Bearer\x20'+_0x550bf8,'OData-Version':_0xb49c('0x18')},'json':!![]};return rp(_0x35a694);})[_0xb49c('0x15')](function(_0x1f8e5d){var _0x44ea68=_0x1f8e5d['value'];var _0x3dae51=![];var _0x1b069c=null;if(!_[_0xb49c('0x19')](_0x5795c4)){if(intUtil[_0xb49c('0x1a')](_0x5795c4[_0xb49c('0x1b')])){_0x1a10cd[_0xb49c('0x1c')]=_0x5795c4['email'];for(_0x1b069c=0x0;_0x1b069c<_0x44ea68[_0xb49c('0x1d')];_0x1b069c++){if(_0x44ea68[_0x1b069c][_0xb49c('0x1e')]===_0x5795c4[_0xb49c('0x1b')]&&!_0x44ea68[_0x1b069c][_0xb49c('0x1f')]){_0x3dae51=!![];logger[_0xb49c('0x20')]('['+[_0x21b990[_0xb49c('0x21')]()]+_0xb49c('0x22')+_0x44ea68[_0x1b069c][_0xb49c('0x23')]+'!');_0x1a10cd[_0xb49c('0x24')]=_0x44ea68[_0x1b069c]['systemuserid'];}}}}if(!_0x3dae51){logger[_0xb49c('0x20')]('['+[_0x21b990[_0xb49c('0x21')]()]+_0xb49c('0x25'));_0x1a10cd[_0xb49c('0x1c')]=_0x1e227d[_0xb49c('0x11')];for(_0x1b069c=0x0;_0x1b069c<_0x44ea68[_0xb49c('0x1d')];_0x1b069c++){if(_0x44ea68[_0x1b069c][_0xb49c('0x1e')]===_0x1e227d[_0xb49c('0x11')]){_0x1a10cd[_0xb49c('0x24')]=_0x44ea68[_0x1b069c][_0xb49c('0x23')];}}}_0x2b89e8(_0x1a10cd);})['catch'](function(_0x2de711){_0xf9e46a(_0x2de711['message']);});});}function createEndUser(_0xa9eabb,_0x43a446,_0xc76de5,_0x511d3f,_0x1b55b7,_0x586ffd,_0x2b0705){return new Promise(function(_0x222504,_0x10795a){return getAuthToken(_0x43a446,_0xc76de5,_0x586ffd)[_0xb49c('0x15')](function(_0x2911e6){var _0x313a6f=_0x586ffd[_0xb49c('0x26')]()===_0xb49c('0x27')?_0x1b55b7[_0xb49c('0x28')]:_0x1b55b7['calleridnum'];var _0x212a25={'method':_0xb49c('0xf'),'uri':_0x511d3f+_0xb49c('0x29'),'body':{'fullname':_0x313a6f,'firstname':_0x313a6f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xb49c('0x2a')+_0xa9eabb[_0xb49c('0x24')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x2911e6,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x212a25[_0xb49c('0x2b')][_0x2b0705]=_0x313a6f;return rp(_0x212a25);})[_0xb49c('0x15')](function(_0x5860bf){var _0x32afc1=_0x5860bf[_0xb49c('0x2c')][_0xb49c('0x2d')];var _0x14fe5c=_0x32afc1[_0xb49c('0x2e')](_0x32afc1[_0xb49c('0x2f')]('(')+0x1,_0x32afc1[_0xb49c('0x2f')](')'));_0xa9eabb['enduserId']=_0x14fe5c;_0x222504(_0xa9eabb);})[_0xb49c('0x30')](function(_0x580235){_0x10795a(_0x580235[_0xb49c('0x14')]);});});}function getEndUser(_0x50aec6,_0x5e81a3,_0x5052bb,_0x2929e5,_0x2c4769,_0x4de55,_0x297d58,_0x3e3b69){var _0x462256=_0x4de55[_0xb49c('0x26')]()===_0xb49c('0x27')?_0x2c4769['destcalleridnum']:_0x2c4769[_0xb49c('0x31')];return getAuthToken(_0x5e81a3,_0x5052bb,_0x4de55)[_0xb49c('0x15')](function(_0x51bcb5){_0x3e3b69=_0x3e3b69?_0x3e3b69:_0xb49c('0x32');var _0x2b0a03={'method':_0xb49c('0x16'),'uri':_0x2929e5+'contacts?$select='+_0x3e3b69+_0xb49c('0x33')+_0x3e3b69+_0xb49c('0x34')+_0x462256[_0xb49c('0x35')]('+',_0xb49c('0x36'))+'\x27','headers':{'Authorization':_0xb49c('0x37')+_0x51bcb5,'If-None-Match':null,'OData-Version':_0xb49c('0x18')},'json':!![]};return rp(_0x2b0a03);})[_0xb49c('0x15')](function(_0x36c8c7){var _0x1d0969=![];if(!_0x36c8c7)return _0x1d0969;var _0x3c52a8=_0x36c8c7['value'];for(var _0x2af077=0x0;_0x2af077<_0x3c52a8[_0xb49c('0x1d')];_0x2af077++){if(_0x3c52a8[_0x2af077][_0x3e3b69]===_0x462256){_0x1d0969=!![];_0x50aec6[_0xb49c('0x38')]=_0x3c52a8[_0x2af077][_0xb49c('0x39')];}}return _0x1d0969;})['then'](function(_0x2e5697){if(_0x2e5697)return _0x50aec6;if(_0x297d58==='nothing'){logger[_0xb49c('0x20')]('['+[_0x4de55[_0xb49c('0x21')]()]+_0xb49c('0x3a'));return _0x50aec6;}return createEndUser(_0x50aec6,_0x5e81a3,_0x5052bb,_0x2929e5,_0x2c4769,_0x4de55,_0x3e3b69)[_0xb49c('0x15')](function(_0x44979e){logger[_0xb49c('0x20')]('['+[_0x4de55['toUpperCase']()]+_0xb49c('0x3b'),_0x44979e[_0xb49c('0x38')]);return _0x44979e;});});}function getCustomFields(_0x3fc6ab,_0x41902a,_0x13c306){var _0x2f450b={};if(_0x3fc6ab[_0xb49c('0x1d')]>0x0){_[_0xb49c('0x3c')](_0x3fc6ab,function(_0x2d1d49){if(_[_0xb49c('0x3d')]([_0xb49c('0x3e'),'picklist'],_0x2d1d49[_0xb49c('0x3f')])&&_0x2d1d49[_0xb49c('0x40')]&&!_0x2d1d49[_0xb49c('0x41')]){var _0x59e127=_0x2d1d49[_0xb49c('0x42')][_0xb49c('0x26')]();var _0x3c6029=_0x59e127[_0xb49c('0x2e')](0x0,_0x59e127[_0xb49c('0x43')]('_'));var _0x4736fa=_0x59e127['substring'](_0x59e127[_0xb49c('0x43')]('_')+0x1);if(_0x3c6029===_0x13c306){_0x2f450b[_0x4736fa]=_0x2d1d49[_0xb49c('0x44')];}}});}return _0x2f450b;}function getTicket(_0x2a1bf9,_0x23291a,_0x334931,_0x1f40dc,_0x305deb,_0x75ec1f,_0x51cc64){return new Promise(function(_0x18c6f8,_0x3a5d01){var _0x2fd753;return getAuthToken(_0x23291a,_0x334931,_0x51cc64)[_0xb49c('0x15')](function(_0x5915ee){if(_0x75ec1f[_0xb49c('0x45')]===_0xb49c('0x46')){_0x2fd753={'method':'POST','uri':_0x1f40dc+_0xb49c('0x47'),'body':Object[_0xb49c('0x48')]({},{'title':intUtil[_0xb49c('0x49')](_0x75ec1f[_0xb49c('0x4a')],_0x305deb,'\x20'),'description':intUtil[_0xb49c('0x49')](_0x75ec1f[_0xb49c('0x4b')],_0x305deb,'\x0a'),'customerid_contact@odata.bind':_0x2a1bf9[_0xb49c('0x38')]?'/contacts('+_0x2a1bf9[_0xb49c('0x38')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2a1bf9['userId']+')','caseorigincode':'1'},getCustomFields(_0x75ec1f[_0xb49c('0x4c')],_0x305deb,_0x75ec1f[_0xb49c('0x45')])),'headers':{'Authorization':_0xb49c('0x37')+_0x5915ee,'OData-Version':_0xb49c('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x75ec1f[_0xb49c('0x45')]===_0xb49c('0x4d')){var _0x1afa31=_0x2a1bf9[_0xb49c('0x38')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2a1bf9[_0xb49c('0x24')]+')','participationtypemask':_0x2a1bf9[_0xb49c('0x4e')]===_0xb49c('0x4f')?0x2:0x1},{'partyid_contact@odata.bind':_0xb49c('0x50')+_0x2a1bf9[_0xb49c('0x38')]+')','participationtypemask':_0x2a1bf9['callDirection']===_0xb49c('0x4f')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xb49c('0x2a')+_0x2a1bf9[_0xb49c('0x24')]+')','participationtypemask':_0x2a1bf9[_0xb49c('0x4e')]===_0xb49c('0x4f')?0x2:0x1}];_0x2fd753={'method':_0xb49c('0xf'),'uri':_0x1f40dc+_0xb49c('0x51'),'body':Object[_0xb49c('0x48')]({},{'subject':intUtil['getString'](_0x75ec1f[_0xb49c('0x4a')],_0x305deb,'\x20'),'phonenumber':String(_0x305deb[_0xb49c('0x31')]),'description':intUtil['getString'](_0x75ec1f[_0xb49c('0x4b')],_0x305deb,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2a1bf9[_0xb49c('0x38')]?_0xb49c('0x50')+_0x2a1bf9[_0xb49c('0x38')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2a1bf9[_0xb49c('0x24')]+')','directioncode':_0x2a1bf9['callDirection']===_0xb49c('0x4f')?![]:!![],'phonecall_activity_parties':_0x1afa31},getCustomFields(_0x75ec1f[_0xb49c('0x4c')],_0x305deb,_0x75ec1f['ticketType'])),'headers':{'Authorization':_0xb49c('0x37')+_0x5915ee,'OData-Version':_0xb49c('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2fd753);})['then'](function(_0x3356fb){var _0x1a029d=_0x3356fb[_0xb49c('0x2c')][_0xb49c('0x2d')];var _0x3cd8f2=_0x1a029d[_0xb49c('0x2e')](_0x1a029d[_0xb49c('0x2f')]('(')+0x1,_0x1a029d[_0xb49c('0x2f')](')'));_0x2a1bf9['ticketId']=_0x3cd8f2;_0x18c6f8(_0x2a1bf9);})['catch'](function(_0x529b6d){_0x3a5d01(_0x529b6d[_0xb49c('0x14')]);});});}function emit(_0x5706ae,_0x142342,_0x1d85d9,_0x4547d3){var _0x1e5775={'uri':util['format'](_0xb49c('0x52'),_0x5706ae,_0x1d85d9,_0x4547d3)};io['to'](util['format'](_0xb49c('0x53'),_0x142342))[_0xb49c('0x54')](_0xb49c('0x55'),_0x1e5775);}exports['cs']=function(_0xc610b5,_0x44eb3f,_0x254c46,_0x2fc07d,_0x18da17,_0x151b9d,_0x416ec3,_0x551122){var _0x5cb7ab={};_0x151b9d[_0xb49c('0xb')]=_0x151b9d[_0xb49c('0xa')]?intUtil['stripTrailingSlash'](_0x151b9d[_0xb49c('0xc')][_0xb49c('0xd')]):intUtil[_0xb49c('0x56')](_0x151b9d[_0xb49c('0xb')]);_0x151b9d[_0xb49c('0x57')]=intUtil['stripTrailingSlash'](_0x151b9d['serverUrl']);_0x5cb7ab[_0xb49c('0x4e')]=_0x551122===_0xb49c('0x4f')||_0x551122===_0xb49c('0x58')?_0xb49c('0x4f'):'outbound';var _0x1df2ec=_0x151b9d[_0xb49c('0xa')]?util[_0xb49c('0x59')]('%s/api/data/v9.0/',_0x151b9d[_0xb49c('0xc')][_0xb49c('0xd')]):util['format'](_0xb49c('0x5a'),_0x151b9d[_0xb49c('0xb')]);var _0x55e058=util['format'](_0xb49c('0x5b'),_0x151b9d['tenantId']);var _0x32f00a=util[_0xb49c('0x59')](_0xb49c('0x5c'),_0x151b9d['serverUrl'],_0x44eb3f['uniqueid'],md5(_0x44eb3f['uniqueid']));if(_0x18da17&&_0x18da17[_0xb49c('0x5d')]){logger[_0xb49c('0x20')]('[QUEUE]','Recording\x20is\x20enabled!');_0x44eb3f['recordingURL']=_0x32f00a;}else if(_0x416ec3&&_0x416ec3[_0xb49c('0x5e')]&&_0x416ec3[_0xb49c('0x5e')]!==_0xb49c('0x5f')){logger['info'](_0xb49c('0x60'),_0xb49c('0x61'));_0x44eb3f[_0xb49c('0x62')]=_0x32f00a;}else{_0x44eb3f['recordingURL']='';}return getUser(_0x5cb7ab,_0x151b9d,_0x2fc07d,_0x55e058,_0x1df2ec,_0x551122)[_0xb49c('0x15')](function(_0x5a1cff){logger[_0xb49c('0x20')]('['+_0x551122[_0xb49c('0x21')]()+_0xb49c('0x63'),_0x5a1cff['userId']);logger[_0xb49c('0x20')]('['+_0x551122['toUpperCase']()+_0xb49c('0x64'),_0x5a1cff[_0xb49c('0x1c')]);return getEndUser(_0x5a1cff,_0x151b9d,_0x55e058,_0x1df2ec,_0x44eb3f,_0x551122,_0x254c46[_0xb49c('0x65')],_0x254c46[_0xb49c('0x66')]);})[_0xb49c('0x15')](function(_0x1b4e52){logger[_0xb49c('0x20')]('['+_0x551122[_0xb49c('0x21')]()+_0xb49c('0x67'),_0x1b4e52[_0xb49c('0x38')]);logger['info']('['+_0x551122[_0xb49c('0x21')]()+_0xb49c('0x68'),_0x44eb3f['calleridnum']);return getTicket(_0x1b4e52,_0x151b9d,_0x55e058,_0x1df2ec,_0x44eb3f,_0x254c46,_0x551122);})['then'](function(_0xae48bb){logger[_0xb49c('0x20')](util[_0xb49c('0x59')]('['+_0x551122[_0xb49c('0x21')]()+_0xb49c('0x69'),_0x254c46[_0xb49c('0x45')],_0xae48bb['ticketId']));logger['info'](util[_0xb49c('0x59')]('['+_0x551122[_0xb49c('0x21')]()+_0xb49c('0x6a'),_0x551122));if(_0x551122!==_0xb49c('0x58')&&_0x254c46[_0xb49c('0x6b')]){logger[_0xb49c('0x20')]('['+_0x551122[_0xb49c('0x21')]()+']',_0xb49c('0x6c'));emit(_0x151b9d[_0xb49c('0xb')],_0x2fc07d[_0xb49c('0x6d')],_0x254c46[_0xb49c('0x45')],_0xae48bb[_0xb49c('0x6e')]);}})[_0xb49c('0x30')](function(_0x2f8c34){logger[_0xb49c('0x6f')]('['+_0x551122[_0xb49c('0x21')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x2f8c34[_0xb49c('0x14')]);console[_0xb49c('0x6f')]('Error\x20running\x20Dynamics365\x20integration',_0x2f8c34);});}; \ No newline at end of file +var _0x8008=['recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','localhost','remoteUri','CloudProvider','tenantId','data2','data5','username','password','clientSecret','then','access_token','catch','error','toUpperCase','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info','toLowerCase','outbound','destcalleridnum','POST','contacts','/systemusers(','headers','odata-entityid','lastIndexOf','enduserId','calleridnum','telephone1','GET','contacts?$select=','\x20eq\x20\x27','replace','Bearer\x20','4.0','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string','customField','idField','substring','indexOf','ticketType','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingURL'];(function(_0x330fb3,_0x33d842){var _0xf97de4=function(_0x4214d6){while(--_0x4214d6){_0x330fb3['push'](_0x330fb3['shift']());}};_0xf97de4(++_0x33d842);}(_0x8008,0x145));var _0x8800=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8008[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8800('0x0'));var rp=require(_0x8800('0x1'));var util=require('util');var intUtil=require(_0x8800('0x2'));var md5=require(_0x8800('0x3'));var Redis=require(_0x8800('0x4'));var logger=require(_0x8800('0x5'))('dynamics365');var config=require(_0x8800('0x6'));config['redis']=_['defaults'](config[_0x8800('0x7')],{'host':_0x8800('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8800('0x7')]));function getAuthToken(_0x2be16a,_0x414930,_0x54619b){if(_0x2be16a['modernAuthentication']){_0x2be16a[_0x8800('0x9')]=_0x2be16a[_0x8800('0xa')]['data7'];_0x2be16a[_0x8800('0xb')]=_0x2be16a[_0x8800('0xa')][_0x8800('0xc')];return Promise['resolve'](_0x2be16a[_0x8800('0xa')][_0x8800('0xd')]);}var _0xd7a690={'method':'POST','uri':_0x414930,'form':{'client_id':_0x2be16a['clientId'],'resource':_0x2be16a['remoteUri'],'username':_0x2be16a[_0x8800('0xe')],'password':_0x2be16a[_0x8800('0xf')],'grant_type':_0x8800('0xf'),'client_secret':_0x2be16a[_0x8800('0x10')]},'json':!![]};return rp(_0xd7a690)[_0x8800('0x11')](function(_0x516c0c){return _0x516c0c[_0x8800('0x12')];})[_0x8800('0x13')](function(_0x1c9a6a){logger[_0x8800('0x14')]('['+[_0x54619b[_0x8800('0x15')]()]+']\x20Wrong\x20credentials!');return _0x1c9a6a[_0x8800('0x16')];});}function getUser(_0xb56fcf,_0x863631,_0x50cff4,_0x5a511a,_0x101d61,_0x532b17){return new Promise(function(_0x2ecba0,_0x167020){return getAuthToken(_0x863631,_0x5a511a,_0x532b17)[_0x8800('0x11')](function(_0x1ca58c){var _0x12bb41={'method':'GET','uri':_0x101d61+_0x8800('0x17'),'headers':{'Authorization':'Bearer\x20'+_0x1ca58c,'OData-Version':'4.0'},'json':!![]};return rp(_0x12bb41);})[_0x8800('0x11')](function(_0x3d5f39){var _0x4017a8=_0x3d5f39[_0x8800('0x18')];var _0x4f6bee=![];var _0x2a5ab0=null;if(!_[_0x8800('0x19')](_0x50cff4)){if(intUtil[_0x8800('0x1a')](_0x50cff4[_0x8800('0x1b')])){_0xb56fcf[_0x8800('0x1c')]=_0x50cff4[_0x8800('0x1b')];for(_0x2a5ab0=0x0;_0x2a5ab0<_0x4017a8[_0x8800('0x1d')];_0x2a5ab0++){if(_0x4017a8[_0x2a5ab0][_0x8800('0x1e')]===_0x50cff4['email']&&!_0x4017a8[_0x2a5ab0][_0x8800('0x1f')]){_0x4f6bee=!![];logger['info']('['+[_0x532b17[_0x8800('0x15')]()]+_0x8800('0x20')+_0x4017a8[_0x2a5ab0][_0x8800('0x21')]+'!');_0xb56fcf[_0x8800('0x22')]=_0x4017a8[_0x2a5ab0][_0x8800('0x21')];}}}}if(!_0x4f6bee){logger[_0x8800('0x23')]('['+[_0x532b17[_0x8800('0x15')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0xb56fcf['userEmail']=_0x863631['username'];for(_0x2a5ab0=0x0;_0x2a5ab0<_0x4017a8['length'];_0x2a5ab0++){if(_0x4017a8[_0x2a5ab0][_0x8800('0x1e')]===_0x863631['username']){_0xb56fcf[_0x8800('0x22')]=_0x4017a8[_0x2a5ab0][_0x8800('0x21')];}}}_0x2ecba0(_0xb56fcf);})['catch'](function(_0x9b9214){_0x167020(_0x9b9214['message']);});});}function createEndUser(_0x49f21d,_0x48e18a,_0x35098f,_0x2a1952,_0x15e115,_0x3c691e,_0x233f8f){return new Promise(function(_0x2175b1,_0x5be3ee){return getAuthToken(_0x48e18a,_0x35098f,_0x3c691e)[_0x8800('0x11')](function(_0x45d73e){var _0x1481b4=_0x3c691e[_0x8800('0x24')]()===_0x8800('0x25')?_0x15e115[_0x8800('0x26')]:_0x15e115['calleridnum'];var _0x5e490f={'method':_0x8800('0x27'),'uri':_0x2a1952+_0x8800('0x28'),'body':{'fullname':_0x1481b4,'firstname':_0x1481b4,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8800('0x29')+_0x49f21d[_0x8800('0x22')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x45d73e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x5e490f['body'][_0x233f8f]=_0x1481b4;return rp(_0x5e490f);})[_0x8800('0x11')](function(_0xda480a){var _0x50cd0a=_0xda480a[_0x8800('0x2a')][_0x8800('0x2b')];var _0x5711db=_0x50cd0a['substring'](_0x50cd0a[_0x8800('0x2c')]('(')+0x1,_0x50cd0a[_0x8800('0x2c')](')'));_0x49f21d[_0x8800('0x2d')]=_0x5711db;_0x2175b1(_0x49f21d);})[_0x8800('0x13')](function(_0x175698){_0x5be3ee(_0x175698[_0x8800('0x16')]);});});}function getEndUser(_0x2036dc,_0x22bfe9,_0x50260e,_0x2dba4a,_0x38b6a4,_0x388e35,_0x3ff220,_0x17e69){var _0x25261c=_0x388e35[_0x8800('0x24')]()===_0x8800('0x25')?_0x38b6a4[_0x8800('0x26')]:_0x38b6a4[_0x8800('0x2e')];return getAuthToken(_0x22bfe9,_0x50260e,_0x388e35)[_0x8800('0x11')](function(_0x33d311){_0x17e69=_0x17e69?_0x17e69:_0x8800('0x2f');var _0x2a898c={'method':_0x8800('0x30'),'uri':_0x2dba4a+_0x8800('0x31')+_0x17e69+'&$filter='+_0x17e69+_0x8800('0x32')+_0x25261c[_0x8800('0x33')]('+','%2b')+'\x27','headers':{'Authorization':_0x8800('0x34')+_0x33d311,'If-None-Match':null,'OData-Version':_0x8800('0x35')},'json':!![]};return rp(_0x2a898c);})[_0x8800('0x11')](function(_0xd04ed7){var _0x3dcc06=![];if(!_0xd04ed7)return _0x3dcc06;var _0x3cec04=_0xd04ed7[_0x8800('0x18')];for(var _0x46975c=0x0;_0x46975c<_0x3cec04[_0x8800('0x1d')];_0x46975c++){if(_0x3cec04[_0x46975c][_0x17e69]===_0x25261c){_0x3dcc06=!![];_0x2036dc[_0x8800('0x2d')]=_0x3cec04[_0x46975c][_0x8800('0x36')];}}return _0x3dcc06;})[_0x8800('0x11')](function(_0x5aa2f8){if(_0x5aa2f8)return _0x2036dc;if(_0x3ff220==='nothing'){logger[_0x8800('0x23')]('['+[_0x388e35[_0x8800('0x15')]()]+_0x8800('0x37'));return _0x2036dc;}return createEndUser(_0x2036dc,_0x22bfe9,_0x50260e,_0x2dba4a,_0x38b6a4,_0x388e35,_0x17e69)[_0x8800('0x11')](function(_0x35dd87){logger[_0x8800('0x23')]('['+[_0x388e35['toUpperCase']()]+_0x8800('0x38'),_0x35dd87[_0x8800('0x2d')]);return _0x35dd87;});});}function getCustomFields(_0x2e49e1,_0x3d5d43,_0x10f8d7){var _0x2605ed={};if(_0x2e49e1[_0x8800('0x1d')]>0x0){_['forEach'](_0x2e49e1,function(_0x69a7f8){if(_[_0x8800('0x39')]([_0x8800('0x3a'),'picklist'],_0x69a7f8['type'])&&_0x69a7f8['nameField']&&!_0x69a7f8[_0x8800('0x3b')]){var _0x39e3a5=_0x69a7f8[_0x8800('0x3c')]['toLowerCase']();var _0x430cc6=_0x39e3a5[_0x8800('0x3d')](0x0,_0x39e3a5['indexOf']('_'));var _0xae0dd1=_0x39e3a5[_0x8800('0x3d')](_0x39e3a5[_0x8800('0x3e')]('_')+0x1);if(_0x430cc6===_0x10f8d7){_0x2605ed[_0xae0dd1]=_0x69a7f8['content'];}}});}return _0x2605ed;}function getTicket(_0x5ddc04,_0x1653cf,_0x31515d,_0x47e177,_0x3b316b,_0x176e61,_0x4c7349){return new Promise(function(_0x508516,_0x8e84ce){var _0x9ee7bc;return getAuthToken(_0x1653cf,_0x31515d,_0x4c7349)[_0x8800('0x11')](function(_0x4625d1){if(_0x176e61[_0x8800('0x3f')]==='incident'){_0x9ee7bc={'method':'POST','uri':_0x47e177+_0x8800('0x40'),'body':Object[_0x8800('0x41')]({},{'title':intUtil[_0x8800('0x42')](_0x176e61[_0x8800('0x43')],_0x3b316b,'\x20'),'description':intUtil[_0x8800('0x42')](_0x176e61[_0x8800('0x44')],_0x3b316b,'\x0a'),'customerid_contact@odata.bind':_0x5ddc04['enduserId']?_0x8800('0x45')+_0x5ddc04['enduserId']+')':undefined,'ownerid@odata.bind':_0x8800('0x29')+_0x5ddc04['userId']+')','caseorigincode':'1'},getCustomFields(_0x176e61[_0x8800('0x46')],_0x3b316b,_0x176e61[_0x8800('0x3f')])),'headers':{'Authorization':_0x8800('0x34')+_0x4625d1,'OData-Version':_0x8800('0x35')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x176e61[_0x8800('0x3f')]===_0x8800('0x47')){var _0x4c3f7b=_0x5ddc04[_0x8800('0x2d')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x5ddc04['userId']+')','participationtypemask':_0x5ddc04[_0x8800('0x48')]===_0x8800('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x8800('0x45')+_0x5ddc04[_0x8800('0x2d')]+')','participationtypemask':_0x5ddc04[_0x8800('0x48')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x8800('0x29')+_0x5ddc04[_0x8800('0x22')]+')','participationtypemask':_0x5ddc04[_0x8800('0x48')]===_0x8800('0x49')?0x2:0x1}];_0x9ee7bc={'method':'POST','uri':_0x47e177+_0x8800('0x4a'),'body':Object['assign']({},{'subject':intUtil[_0x8800('0x42')](_0x176e61[_0x8800('0x43')],_0x3b316b,'\x20'),'phonenumber':String(_0x3b316b[_0x8800('0x2e')]),'description':intUtil[_0x8800('0x42')](_0x176e61[_0x8800('0x44')],_0x3b316b,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5ddc04[_0x8800('0x2d')]?'/contacts('+_0x5ddc04['enduserId']+')':undefined,'ownerid@odata.bind':_0x8800('0x29')+_0x5ddc04[_0x8800('0x22')]+')','directioncode':_0x5ddc04[_0x8800('0x48')]===_0x8800('0x49')?![]:!![],'phonecall_activity_parties':_0x4c3f7b},getCustomFields(_0x176e61[_0x8800('0x46')],_0x3b316b,_0x176e61[_0x8800('0x3f')])),'headers':{'Authorization':_0x8800('0x34')+_0x4625d1,'OData-Version':_0x8800('0x35')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x9ee7bc);})[_0x8800('0x11')](function(_0x18ac1d){var _0x32d025=_0x18ac1d[_0x8800('0x2a')][_0x8800('0x2b')];var _0x55ceec=_0x32d025['substring'](_0x32d025[_0x8800('0x2c')]('(')+0x1,_0x32d025[_0x8800('0x2c')](')'));_0x5ddc04[_0x8800('0x4b')]=_0x55ceec;_0x508516(_0x5ddc04);})[_0x8800('0x13')](function(_0x3a3340){_0x8e84ce(_0x3a3340['message']);});});}function emit(_0x23713b,_0x5922ae,_0x274d26,_0x5bba29){var _0x4d07f1={'uri':util[_0x8800('0x4c')](_0x8800('0x4d'),_0x23713b,_0x274d26,_0x5bba29)};io['to'](util[_0x8800('0x4c')](_0x8800('0x4e'),_0x5922ae))[_0x8800('0x4f')](_0x8800('0x50'),_0x4d07f1);}exports['cs']=function(_0x5ec677,_0x1c9933,_0x2f5324,_0x13e1fe,_0x1add26,_0x5afc64,_0x548dbe,_0x8a5d0){var _0x3f8b77={};_0x5afc64[_0x8800('0x9')]=_0x5afc64[_0x8800('0x51')]?intUtil[_0x8800('0x52')](_0x5afc64['CloudProvider'][_0x8800('0x53')]):intUtil[_0x8800('0x52')](_0x5afc64[_0x8800('0x9')]);_0x5afc64['serverUrl']=intUtil[_0x8800('0x52')](_0x5afc64[_0x8800('0x54')]);_0x3f8b77['callDirection']=_0x8a5d0==='queue'||_0x8a5d0===_0x8800('0x55')?_0x8800('0x49'):'outbound';var _0x4a1a4b=_0x5afc64[_0x8800('0x51')]?util['format'](_0x8800('0x56'),_0x5afc64[_0x8800('0xa')]['data7']):util[_0x8800('0x4c')]('%s/api/data/v9.0/',_0x5afc64[_0x8800('0x9')]);var _0x295970=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x5afc64[_0x8800('0xb')]);var _0x35ba3c=util[_0x8800('0x4c')](_0x8800('0x57'),_0x5afc64[_0x8800('0x54')],_0x1c9933[_0x8800('0x58')],md5(_0x1c9933['uniqueid']));if(_0x1add26&&_0x1add26['monitor_format']){logger['info'](_0x8800('0x59'),'Recording\x20is\x20enabled!');_0x1c9933[_0x8800('0x5a')]=_0x35ba3c;}else if(_0x548dbe&&_0x548dbe[_0x8800('0x5b')]&&_0x548dbe['recordingFormat']!==_0x8800('0x5c')){logger['info'](_0x8800('0x5d'),'Recording\x20is\x20enabled!');_0x1c9933['recordingURL']=_0x35ba3c;}else{_0x1c9933[_0x8800('0x5a')]='';}return getUser(_0x3f8b77,_0x5afc64,_0x13e1fe,_0x295970,_0x4a1a4b,_0x8a5d0)['then'](function(_0x120ba9){logger['info']('['+_0x8a5d0[_0x8800('0x15')]()+_0x8800('0x5e'),_0x120ba9[_0x8800('0x22')]);logger[_0x8800('0x23')]('['+_0x8a5d0[_0x8800('0x15')]()+_0x8800('0x5f'),_0x120ba9[_0x8800('0x1c')]);return getEndUser(_0x120ba9,_0x5afc64,_0x295970,_0x4a1a4b,_0x1c9933,_0x8a5d0,_0x2f5324[_0x8800('0x60')],_0x2f5324['additionalSearchContact']);})[_0x8800('0x11')](function(_0x46cbe5){logger[_0x8800('0x23')]('['+_0x8a5d0[_0x8800('0x15')]()+_0x8800('0x61'),_0x46cbe5[_0x8800('0x2d')]);logger['info']('['+_0x8a5d0['toUpperCase']()+_0x8800('0x62'),_0x1c9933[_0x8800('0x2e')]);return getTicket(_0x46cbe5,_0x5afc64,_0x295970,_0x4a1a4b,_0x1c9933,_0x2f5324,_0x8a5d0);})[_0x8800('0x11')](function(_0x4b05d8){logger[_0x8800('0x23')](util[_0x8800('0x4c')]('['+_0x8a5d0[_0x8800('0x15')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x2f5324[_0x8800('0x3f')],_0x4b05d8[_0x8800('0x4b')]));logger[_0x8800('0x23')](util[_0x8800('0x4c')]('['+_0x8a5d0[_0x8800('0x15')]()+_0x8800('0x63'),_0x8a5d0));if(_0x8a5d0!=='unmanaged'&&_0x2f5324[_0x8800('0x64')]){logger['info']('['+_0x8a5d0[_0x8800('0x15')]()+']',_0x8800('0x65'));emit(_0x5afc64[_0x8800('0x9')],_0x13e1fe['name'],_0x2f5324['ticketType'],_0x4b05d8[_0x8800('0x4b')]);}})[_0x8800('0x13')](function(_0x2aefa1){logger[_0x8800('0x14')]('['+_0x8a5d0[_0x8800('0x15')]()+_0x8800('0x66'),_0x2aefa1['message']);console['error'](_0x8800('0x67'),_0x2aefa1);});}; \ 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 592087e..cb7ad98 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 _0xcca5=['user:%s','%s/helpdesk/tickets/%d','catch','error','stringify','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','base64','[HTTP]','GET','map','forEach','includes','string','type','nameField','customField','toLowerCase','toString','idField','variable','variableName','push','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0xcca5,0x1e3));var _0x5cca=function(_0x20118a,_0x3dbdf3){_0x20118a=_0x20118a-0x0;var _0x538b5f=_0xcca5[_0x20118a];return _0x538b5f;};'use strict';var _=require(_0x5cca('0x0'));var rp=require('request-promise');var md5=require(_0x5cca('0x1'));var util=require('util');var Redis=require(_0x5cca('0x2'));var intUtil=require(_0x5cca('0x3'));var config=require(_0x5cca('0x4'));var logger=require(_0x5cca('0x5'))(_0x5cca('0x6'));config[_0x5cca('0x7')]=_[_0x5cca('0x8')](config[_0x5cca('0x7')],{'host':_0x5cca('0x9'),'port':0x18eb});var io=require(_0x5cca('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0x5cca('0xb'),'Accept':_0x5cca('0xb')};function emit(_0xae039b,_0x40824f,_0x30bde1){io['to'](_0xae039b)[_0x5cca('0xc')](_0x40824f,_0x30bde1);}function getTicket(_0x3e630d,_0x52e856,_0x41fbb2,_0x64a1da,_0x19a805){logger[_0x5cca('0xd')]('Creating\x20new\x20ticket...');var _0x521b7e=_['merge']({'responder_id':_0x52e856['id'],'requester_id':_0x41fbb2['id'],'name':util[_0x5cca('0xe')](_0x5cca('0xf'),_0x19a805[_0x5cca('0x10')]),'phone':_0x19a805[_0x5cca('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x5cca('0x12')](_0x64a1da[_0x5cca('0x13')],_0x19a805,'\x20'),'description':intUtil[_0x5cca('0x12')](_0x64a1da[_0x5cca('0x14')],_0x19a805,_0x5cca('0x15')),'tags':getTags(_0x64a1da[_0x5cca('0x16')],'name')},getCustomFields(_0x64a1da[_0x5cca('0x17')],_0x19a805));_0x521b7e[_0x5cca('0x18')]=_[_0x5cca('0x19')](_[_0x5cca('0x1a')](_0x521b7e[_0x5cca('0x18')],'id'),_0x5cca('0x1b'));return request({'uri':util['format'](_0x5cca('0x1c'),_0x3e630d[_0x5cca('0x1d')]),'method':_0x5cca('0x1e'),'body':_0x521b7e})[_0x5cca('0x1f')](function(_0x17abf3){logger[_0x5cca('0xd')](_0x5cca('0x20'));return _0x17abf3;});}function getUser(_0x5727e,_0x3bb500){if(intUtil['validateEmail'](_0x3bb500)){return request({'uri':util['format'](_0x5cca('0x21'),_0x5727e[_0x5cca('0x1d')]),'qs':{'email':_0x3bb500}})[_0x5cca('0x1f')](function(_0x41771f){if(_0x41771f[_0x5cca('0x22')]){logger[_0x5cca('0xd')](_0x5cca('0x23'));return _[_0x5cca('0x24')](_0x41771f,function(_0x4a56d4){return _0x4a56d4[_0x5cca('0x25')][_0x5cca('0x26')]===_0x3bb500;});}else{logger[_0x5cca('0xd')](_0x5cca('0x27'));return request({'uri':util[_0x5cca('0xe')](_0x5cca('0x28'),_0x5727e[_0x5cca('0x1d')])})[_0x5cca('0x1f')](function(_0x45e060){logger[_0x5cca('0xd')]('Admin\x20account\x20selected.');return _0x45e060;});}});}else{logger['info'](_0x5cca('0x29'));return request({'uri':util[_0x5cca('0xe')](_0x5cca('0x28'),_0x5727e[_0x5cca('0x1d')])})['then'](function(_0x255b0e){logger[_0x5cca('0xd')]('Admin\x20account\x20selected.');return _0x255b0e;});}}function getEndUser(_0x5d7823,_0x42cd09,_0x3de3b7){logger[_0x5cca('0xd')](_0x5cca('0x2a'),_0x3de3b7);return request({'uri':util[_0x5cca('0xe')](_0x5cca('0x2b'),_0x5d7823[_0x5cca('0x1d')]),'qs':{'phone':_0x3de3b7}})[_0x5cca('0x1f')](function(_0x31e2bd){if(_0x31e2bd[_0x5cca('0x22')]){logger[_0x5cca('0xd')](_0x5cca('0x2c'));return _[_0x5cca('0x24')](_0x31e2bd,{'phone':_0x3de3b7});}else{logger[_0x5cca('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x5cca('0x2b'),_0x5d7823[_0x5cca('0x1d')]),'method':_0x5cca('0x1e'),'body':{'name':_0x42cd09,'phone':_0x3de3b7}})[_0x5cca('0x1f')](function(_0x35a064){logger[_0x5cca('0xd')](_0x5cca('0x2d'));return _0x35a064;});}});}function getAuth(_0x45a5f2){return util[_0x5cca('0xe')](_0x5cca('0x2e'),new Buffer(_0x45a5f2[_0x5cca('0x2f')]+':X')['toString'](_0x5cca('0x30')));}function request(_0x2a5146){logger['debug'](_0x5cca('0x31'),JSON['stringify'](_0x2a5146));return rp(_['defaults'](_0x2a5146,{'method':_0x5cca('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x4cc9b7,_0x22ee5e){var _0xaa0118=[];if(_0x4cc9b7&&_0x4cc9b7['length']>0x0){_0xaa0118=_[_0x5cca('0x33')](_0x4cc9b7,_0x22ee5e);}return _0xaa0118;}function getCustomFields(_0x40413c,_0x57d129){var _0x22c181=[];var _0x54d8b0={'custom_fields':[]};if(_0x40413c['length']>0x0){_[_0x5cca('0x34')](_0x40413c,function(_0xd40bae){if(_[_0x5cca('0x35')]([_0x5cca('0x36'),'picklist'],_0xd40bae[_0x5cca('0x37')])&&_0xd40bae[_0x5cca('0x38')]&&!_0xd40bae[_0x5cca('0x39')]){_0x54d8b0[_0xd40bae[_0x5cca('0x38')][_0x5cca('0x3a')]()]=_0xd40bae['content'][_0x5cca('0x3b')]();}else if(_[_0x5cca('0x35')](['string','picklist'],_0xd40bae['type'])&&_0xd40bae[_0x5cca('0x3c')]&&_0xd40bae[_0x5cca('0x39')]){_0x54d8b0['custom_fields']['push']({'id':_0xd40bae[_0x5cca('0x3c')],'value':_0xd40bae['content'][_0x5cca('0x3b')]()});}else if(_0xd40bae[_0x5cca('0x37')]===_0x5cca('0x3d')&&_0xd40bae[_0x5cca('0x3e')]&&_0xd40bae['idField']&&_0xd40bae[_0x5cca('0x39')]){_0x57d129[_0xd40bae[_0x5cca('0x3e')]]&&_0x54d8b0[_0x5cca('0x18')][_0x5cca('0x3f')]({'id':_0xd40bae[_0x5cca('0x3c')],'value':_0x57d129[_0xd40bae[_0x5cca('0x3e')]][_0x5cca('0x3b')]()});}else if(_0xd40bae[_0x5cca('0x37')]===_0x5cca('0x40')&&_0xd40bae[_0x5cca('0x41')]&&_0xd40bae[_0x5cca('0x41')][_0x5cca('0x42')]&&_0xd40bae[_0x5cca('0x3c')]&&_0xd40bae[_0x5cca('0x39')]){_0x57d129[_0xd40bae['Variable'][_0x5cca('0x42')][_0x5cca('0x3a')]()]&&_0x54d8b0['custom_fields'][_0x5cca('0x3f')]({'id':_0xd40bae[_0x5cca('0x3c')],'value':_0x57d129[_0xd40bae[_0x5cca('0x41')]['name'][_0x5cca('0x3a')]()][_0x5cca('0x3b')]()});}});}return _0x54d8b0;}exports[_0x5cca('0x43')]=function(_0x54dbc3,_0x478d01,_0x291b48,_0x4b7ad4,_0x29e974,_0x39c951){var _0x459944,_0x4ef1aa;_0x39c951['remoteUri']=intUtil[_0x5cca('0x44')](_0x39c951[_0x5cca('0x1d')]);_0x39c951['serverUrl']=intUtil[_0x5cca('0x44')](_0x39c951[_0x5cca('0x45')]);if(_0x29e974&&_0x29e974[_0x5cca('0x46')]){logger[_0x5cca('0xd')](_0x5cca('0x47'),_0x5cca('0x48'));_0x478d01[_0x5cca('0x49')]=util[_0x5cca('0xe')](_0x5cca('0x4a'),_0x39c951['serverUrl'],_0x478d01['uniqueid'],md5(_0x478d01[_0x5cca('0x4b')]));}else{_0x478d01[_0x5cca('0x49')]='';}headers[_0x5cca('0x4c')]=getAuth(_0x39c951);return getUser(_0x39c951,_0x4b7ad4[_0x5cca('0x26')])[_0x5cca('0x1f')](function(_0x1856d4){_0x459944=_0x1856d4;logger[_0x5cca('0xd')](_0x5cca('0x4d'),_0x459944['id']);return getEndUser(_0x39c951,_0x478d01['calleridname'],_0x478d01[_0x5cca('0x11')]);})[_0x5cca('0x1f')](function(_0x3ff4dc){_0x4ef1aa=_0x3ff4dc;logger[_0x5cca('0xd')](_0x5cca('0x4e'),_0x4ef1aa['id']);return getTicket(_0x39c951,_0x459944,_0x4ef1aa,_0x291b48,_0x478d01);})[_0x5cca('0x1f')](function(_0x3debc4){if(_0x3debc4&&_0x3debc4['id']){logger[_0x5cca('0xd')](_0x5cca('0x20'));logger[_0x5cca('0xd')](_0x5cca('0x4f'),_0x3debc4['id']);logger[_0x5cca('0xd')](_0x5cca('0x47'),_0x5cca('0x50'));emit(util[_0x5cca('0xe')](_0x5cca('0x51'),_0x4b7ad4[_0x5cca('0x42')]),'trigger:browser:url',{'uri':util[_0x5cca('0xe')](_0x5cca('0x52'),_0x39c951[_0x5cca('0x1d')],_0x3debc4['id'])});}})[_0x5cca('0x53')](function(_0x1a8048){logger[_0x5cca('0x54')](_0x5cca('0x47'),JSON[_0x5cca('0x55')](_0x1a8048));});};exports['outbound']=function(_0xf5107c,_0x33082f,_0x330f61,_0x44d9ea,_0x429a6c,_0x1de4ef,_0x3e3738){var _0x316ce5,_0x5a6ebb;_0x1de4ef[_0x5cca('0x1d')]=intUtil['stripTrailingSlash'](_0x1de4ef[_0x5cca('0x1d')]);_0x1de4ef[_0x5cca('0x45')]=intUtil[_0x5cca('0x44')](_0x1de4ef[_0x5cca('0x45')]);if(_0x3e3738&&_0x3e3738['recordingFormat']&&_0x3e3738[_0x5cca('0x56')]!=='none'){logger[_0x5cca('0xd')](_0x5cca('0x57'),_0x5cca('0x48'));_0x33082f['recordingURL']=util[_0x5cca('0xe')](_0x5cca('0x4a'),_0x1de4ef[_0x5cca('0x45')],_0x33082f[_0x5cca('0x4b')],md5(_0x33082f[_0x5cca('0x4b')]));}headers[_0x5cca('0x4c')]=getAuth(_0x1de4ef);return getUser(_0x1de4ef,_0x44d9ea[_0x5cca('0x26')])['then'](function(_0x5d1f61){_0x316ce5=_0x5d1f61;logger[_0x5cca('0xd')](_0x5cca('0x4d'),_0x316ce5['id']);return getEndUser(_0x1de4ef,_0x33082f[_0x5cca('0x58')],_0x33082f[_0x5cca('0x59')]);})[_0x5cca('0x1f')](function(_0x472c28){_0x5a6ebb=_0x472c28;logger[_0x5cca('0xd')](_0x5cca('0x4e'),_0x5a6ebb['id']);return getTicket(_0x1de4ef,_0x316ce5,_0x5a6ebb,_0x330f61,_0x33082f);})[_0x5cca('0x1f')](function(_0x1ed0eb){if(_0x1ed0eb&&_0x1ed0eb['id']){logger[_0x5cca('0xd')](_0x5cca('0x20'));logger[_0x5cca('0xd')](_0x5cca('0x4f'),_0x1ed0eb['id']);logger['info'](_0x5cca('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5cca('0xe')](_0x5cca('0x51'),_0x44d9ea[_0x5cca('0x42')]),_0x5cca('0x5a'),{'uri':util[_0x5cca('0xe')](_0x5cca('0x52'),_0x1de4ef[_0x5cca('0x1d')],_0x1ed0eb['id'])});}})[_0x5cca('0x53')](function(_0x1e3104){logger['error']('[OUTBOUND]',JSON[_0x5cca('0x55')](_0x1e3104));});};exports[_0x5cca('0x5b')]=function(_0x15b7d8,_0xa7c6c0,_0x5ac7d7,_0x1e6cc4,_0xf54798,_0xadd8a3){var _0x2f924f,_0x174a0a;_0xadd8a3[_0x5cca('0x1d')]=intUtil[_0x5cca('0x44')](_0xadd8a3['remoteUri']);_0xadd8a3[_0x5cca('0x45')]=intUtil[_0x5cca('0x44')](_0xadd8a3[_0x5cca('0x45')]);if(_0xf54798&&_0xf54798[_0x5cca('0x46')]){logger[_0x5cca('0xd')]('['+_0xa7c6c0[_0x5cca('0x5c')][_0x5cca('0x5d')]()+']',_0x5cca('0x48'));_0xa7c6c0[_0x5cca('0x49')]=util['format'](_0x5cca('0x4a'),_0xadd8a3[_0x5cca('0x45')],_0xa7c6c0[_0x5cca('0x4b')],md5(_0xa7c6c0[_0x5cca('0x4b')]));}else{_0xa7c6c0[_0x5cca('0x49')]='';}headers[_0x5cca('0x4c')]=getAuth(_0xadd8a3);return getUser(_0xadd8a3,'')[_0x5cca('0x1f')](function(_0x36131e){_0x2f924f=_0x36131e;logger['info'](_0x5cca('0x4d'),_0x2f924f['id']);return getEndUser(_0xadd8a3,_0xa7c6c0[_0x5cca('0x10')],_0xa7c6c0[_0x5cca('0x11')]);})['then'](function(_0x2fe97c){_0x174a0a=_0x2fe97c;logger[_0x5cca('0xd')](_0x5cca('0x4e'),_0x174a0a['id']);return getTicket(_0xadd8a3,_0x2f924f,_0x174a0a,_0x5ac7d7,_0xa7c6c0);})[_0x5cca('0x1f')](function(_0x80d503){if(_0x80d503){logger[_0x5cca('0xd')](_0x5cca('0x20'));logger['info'](_0x5cca('0x4f'),_0x80d503['id']);}})[_0x5cca('0x53')](function(_0x15a480){logger[_0x5cca('0x54')]('['+_0xa7c6c0[_0x5cca('0x5c')][_0x5cca('0x5d')]()+']',JSON[_0x5cca('0x55')](_0x15a480));});}; \ No newline at end of file +var _0x3f98=['md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','name','Fields','mapValues','value','%s/api/v2/tickets','remoteUri','POST','then','info','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','[HTTP]','GET','map','includes','string','picklist','type','customField','toLowerCase','content','toString','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','stringify','unmanaged','lastevent','toUpperCase','lodash','request-promise'];(function(_0x5547c6,_0x5d611c){var _0x1f3fbc=function(_0x161797){while(--_0x161797){_0x5547c6['push'](_0x5547c6['shift']());}};_0x1f3fbc(++_0x5d611c);}(_0x3f98,0x172));var _0x83f9=function(_0x3a70d9,_0x310f4){_0x3a70d9=_0x3a70d9-0x0;var _0x3d0d0a=_0x3f98[_0x3a70d9];return _0x3d0d0a;};'use strict';var _=require(_0x83f9('0x0'));var rp=require(_0x83f9('0x1'));var md5=require(_0x83f9('0x2'));var util=require(_0x83f9('0x3'));var Redis=require('ioredis');var intUtil=require(_0x83f9('0x4'));var config=require(_0x83f9('0x5'));var logger=require(_0x83f9('0x6'))(_0x83f9('0x7'));config[_0x83f9('0x8')]=_[_0x83f9('0x9')](config[_0x83f9('0x8')],{'host':_0x83f9('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x83f9('0x8')]));var headers={'Content-Type':_0x83f9('0xb'),'Accept':_0x83f9('0xb')};function emit(_0x156dc4,_0x17b4c1,_0x38aa26){io['to'](_0x156dc4)[_0x83f9('0xc')](_0x17b4c1,_0x38aa26);}function getTicket(_0x543bf0,_0xe73f87,_0x386320,_0x23ce5b,_0xccfd7a){logger['info']('Creating\x20new\x20ticket...');var _0x1cdf2c=_[_0x83f9('0xd')]({'responder_id':_0xe73f87['id'],'requester_id':_0x386320['id'],'name':util[_0x83f9('0xe')]('Caller\x20-\x20%s',_0xccfd7a[_0x83f9('0xf')]),'phone':_0xccfd7a[_0x83f9('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x83f9('0x11')](_0x23ce5b[_0x83f9('0x12')],_0xccfd7a,'\x20'),'description':intUtil[_0x83f9('0x11')](_0x23ce5b[_0x83f9('0x13')],_0xccfd7a,'
'),'tags':getTags(_0x23ce5b[_0x83f9('0x14')],_0x83f9('0x15'))},getCustomFields(_0x23ce5b[_0x83f9('0x16')],_0xccfd7a));_0x1cdf2c['custom_fields']=_[_0x83f9('0x17')](_['keyBy'](_0x1cdf2c['custom_fields'],'id'),_0x83f9('0x18'));return request({'uri':util['format'](_0x83f9('0x19'),_0x543bf0[_0x83f9('0x1a')]),'method':_0x83f9('0x1b'),'body':_0x1cdf2c})[_0x83f9('0x1c')](function(_0x5f3003){logger[_0x83f9('0x1d')]('Ticket\x20created!');return _0x5f3003;});}function getUser(_0x4bf6f7,_0x313333){if(intUtil[_0x83f9('0x1e')](_0x313333)){return request({'uri':util[_0x83f9('0xe')](_0x83f9('0x1f'),_0x4bf6f7[_0x83f9('0x1a')]),'qs':{'email':_0x313333}})['then'](function(_0x1d8824){if(_0x1d8824[_0x83f9('0x20')]){logger['info'](_0x83f9('0x21'));return _[_0x83f9('0x22')](_0x1d8824,function(_0xa31d45){return _0xa31d45[_0x83f9('0x23')][_0x83f9('0x24')]===_0x313333;});}else{logger[_0x83f9('0x1d')](_0x83f9('0x25'));return request({'uri':util['format'](_0x83f9('0x26'),_0x4bf6f7[_0x83f9('0x1a')])})[_0x83f9('0x1c')](function(_0x5821bd){logger[_0x83f9('0x1d')](_0x83f9('0x27'));return _0x5821bd;});}});}else{logger['info'](_0x83f9('0x28'));return request({'uri':util[_0x83f9('0xe')](_0x83f9('0x26'),_0x4bf6f7['remoteUri'])})[_0x83f9('0x1c')](function(_0x6f9ab5){logger[_0x83f9('0x1d')](_0x83f9('0x27'));return _0x6f9ab5;});}}function getEndUser(_0x2b1269,_0x2d9f59,_0x371ed8){logger[_0x83f9('0x1d')](_0x83f9('0x29'),_0x371ed8);return request({'uri':util[_0x83f9('0xe')]('%s/api/v2/contacts',_0x2b1269[_0x83f9('0x1a')]),'qs':{'phone':_0x371ed8}})['then'](function(_0x259d70){if(_0x259d70[_0x83f9('0x20')]){logger[_0x83f9('0x1d')](_0x83f9('0x2a'));return _[_0x83f9('0x22')](_0x259d70,{'phone':_0x371ed8});}else{logger[_0x83f9('0x1d')](_0x83f9('0x2b'));return request({'uri':util[_0x83f9('0xe')](_0x83f9('0x2c'),_0x2b1269[_0x83f9('0x1a')]),'method':'POST','body':{'name':_0x2d9f59,'phone':_0x371ed8}})['then'](function(_0x14bde5){logger[_0x83f9('0x1d')](_0x83f9('0x2d'));return _0x14bde5;});}});}function getAuth(_0x58f477){return util[_0x83f9('0xe')]('Basic\x20%s',new Buffer(_0x58f477['apiKey']+':X')['toString']('base64'));}function request(_0x34144d){logger['debug'](_0x83f9('0x2e'),JSON['stringify'](_0x34144d));return rp(_['defaults'](_0x34144d,{'method':_0x83f9('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x1c8f62,_0x1dd35c){var _0x357923=[];if(_0x1c8f62&&_0x1c8f62[_0x83f9('0x20')]>0x0){_0x357923=_[_0x83f9('0x30')](_0x1c8f62,_0x1dd35c);}return _0x357923;}function getCustomFields(_0x289e89,_0x4cdd32){var _0x594e93=[];var _0x260951={'custom_fields':[]};if(_0x289e89[_0x83f9('0x20')]>0x0){_['forEach'](_0x289e89,function(_0x56b6d6){if(_[_0x83f9('0x31')]([_0x83f9('0x32'),_0x83f9('0x33')],_0x56b6d6[_0x83f9('0x34')])&&_0x56b6d6['nameField']&&!_0x56b6d6[_0x83f9('0x35')]){_0x260951[_0x56b6d6['nameField'][_0x83f9('0x36')]()]=_0x56b6d6[_0x83f9('0x37')][_0x83f9('0x38')]();}else if(_[_0x83f9('0x31')]([_0x83f9('0x32'),_0x83f9('0x33')],_0x56b6d6[_0x83f9('0x34')])&&_0x56b6d6[_0x83f9('0x39')]&&_0x56b6d6[_0x83f9('0x35')]){_0x260951[_0x83f9('0x3a')][_0x83f9('0x3b')]({'id':_0x56b6d6[_0x83f9('0x39')],'value':_0x56b6d6[_0x83f9('0x37')][_0x83f9('0x38')]()});}else if(_0x56b6d6['type']===_0x83f9('0x3c')&&_0x56b6d6[_0x83f9('0x3d')]&&_0x56b6d6[_0x83f9('0x39')]&&_0x56b6d6['customField']){_0x4cdd32[_0x56b6d6[_0x83f9('0x3d')]]&&_0x260951['custom_fields'][_0x83f9('0x3b')]({'id':_0x56b6d6[_0x83f9('0x39')],'value':_0x4cdd32[_0x56b6d6['variableName']]['toString']()});}else if(_0x56b6d6[_0x83f9('0x34')]===_0x83f9('0x3e')&&_0x56b6d6[_0x83f9('0x3f')]&&_0x56b6d6[_0x83f9('0x3f')]['name']&&_0x56b6d6[_0x83f9('0x39')]&&_0x56b6d6[_0x83f9('0x35')]){_0x4cdd32[_0x56b6d6['Variable'][_0x83f9('0x15')][_0x83f9('0x36')]()]&&_0x260951[_0x83f9('0x3a')][_0x83f9('0x3b')]({'id':_0x56b6d6[_0x83f9('0x39')],'value':_0x4cdd32[_0x56b6d6['Variable'][_0x83f9('0x15')][_0x83f9('0x36')]()][_0x83f9('0x38')]()});}});}return _0x260951;}exports[_0x83f9('0x40')]=function(_0x5def6f,_0x1ef1c3,_0x3b559d,_0x31a4f9,_0x28364d,_0x4f7fa5){var _0x11023d,_0x31ad0e;_0x4f7fa5[_0x83f9('0x1a')]=intUtil['stripTrailingSlash'](_0x4f7fa5[_0x83f9('0x1a')]);_0x4f7fa5[_0x83f9('0x41')]=intUtil[_0x83f9('0x42')](_0x4f7fa5['serverUrl']);if(_0x28364d&&_0x28364d[_0x83f9('0x43')]){logger['info'](_0x83f9('0x44'),'Recording\x20is\x20enabled!');_0x1ef1c3[_0x83f9('0x45')]=util[_0x83f9('0xe')](_0x83f9('0x46'),_0x4f7fa5[_0x83f9('0x41')],_0x1ef1c3[_0x83f9('0x47')],md5(_0x1ef1c3['uniqueid']));}else{_0x1ef1c3['recordingURL']='';}headers[_0x83f9('0x48')]=getAuth(_0x4f7fa5);return getUser(_0x4f7fa5,_0x31a4f9[_0x83f9('0x24')])[_0x83f9('0x1c')](function(_0xc9eb6a){_0x11023d=_0xc9eb6a;logger[_0x83f9('0x1d')](_0x83f9('0x49'),_0x11023d['id']);return getEndUser(_0x4f7fa5,_0x1ef1c3[_0x83f9('0xf')],_0x1ef1c3['calleridnum']);})['then'](function(_0x17bf63){_0x31ad0e=_0x17bf63;logger[_0x83f9('0x1d')]('The\x20Enduser\x20ID\x20is:',_0x31ad0e['id']);return getTicket(_0x4f7fa5,_0x11023d,_0x31ad0e,_0x3b559d,_0x1ef1c3);})[_0x83f9('0x1c')](function(_0x2a789c){if(_0x2a789c&&_0x2a789c['id']){logger[_0x83f9('0x1d')]('Ticket\x20created!');logger[_0x83f9('0x1d')](_0x83f9('0x4a'),_0x2a789c['id']);logger[_0x83f9('0x1d')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x83f9('0xe')](_0x83f9('0x4b'),_0x31a4f9[_0x83f9('0x15')]),'trigger:browser:url',{'uri':util[_0x83f9('0xe')](_0x83f9('0x4c'),_0x4f7fa5[_0x83f9('0x1a')],_0x2a789c['id'])});}})[_0x83f9('0x4d')](function(_0x4682f8){logger[_0x83f9('0x4e')](_0x83f9('0x44'),JSON['stringify'](_0x4682f8));});};exports[_0x83f9('0x4f')]=function(_0x4d44fb,_0x536336,_0x2d04a7,_0x707653,_0x223c81,_0x2bf068,_0x280973){var _0x4e36c0,_0x482cfa;_0x2bf068[_0x83f9('0x1a')]=intUtil[_0x83f9('0x42')](_0x2bf068[_0x83f9('0x1a')]);_0x2bf068[_0x83f9('0x41')]=intUtil[_0x83f9('0x42')](_0x2bf068[_0x83f9('0x41')]);if(_0x280973&&_0x280973[_0x83f9('0x50')]&&_0x280973[_0x83f9('0x50')]!==_0x83f9('0x51')){logger['info'](_0x83f9('0x52'),_0x83f9('0x53'));_0x536336[_0x83f9('0x45')]=util[_0x83f9('0xe')](_0x83f9('0x46'),_0x2bf068['serverUrl'],_0x536336[_0x83f9('0x47')],md5(_0x536336[_0x83f9('0x47')]));}headers[_0x83f9('0x48')]=getAuth(_0x2bf068);return getUser(_0x2bf068,_0x707653[_0x83f9('0x24')])[_0x83f9('0x1c')](function(_0x3c4647){_0x4e36c0=_0x3c4647;logger[_0x83f9('0x1d')](_0x83f9('0x49'),_0x4e36c0['id']);return getEndUser(_0x2bf068,_0x536336[_0x83f9('0x54')],_0x536336[_0x83f9('0x55')]);})['then'](function(_0x4e633c){_0x482cfa=_0x4e633c;logger[_0x83f9('0x1d')](_0x83f9('0x56'),_0x482cfa['id']);return getTicket(_0x2bf068,_0x4e36c0,_0x482cfa,_0x2d04a7,_0x536336);})[_0x83f9('0x1c')](function(_0x1e34a1){if(_0x1e34a1&&_0x1e34a1['id']){logger['info'](_0x83f9('0x57'));logger[_0x83f9('0x1d')](_0x83f9('0x4a'),_0x1e34a1['id']);logger[_0x83f9('0x1d')](_0x83f9('0x52'),_0x83f9('0x58'));emit(util[_0x83f9('0xe')]('user:%s',_0x707653[_0x83f9('0x15')]),'trigger:browser:url',{'uri':util[_0x83f9('0xe')]('%s/helpdesk/tickets/%d',_0x2bf068[_0x83f9('0x1a')],_0x1e34a1['id'])});}})['catch'](function(_0x27f28b){logger[_0x83f9('0x4e')](_0x83f9('0x52'),JSON[_0x83f9('0x59')](_0x27f28b));});};exports[_0x83f9('0x5a')]=function(_0x40cc7e,_0x5107db,_0x33ff9d,_0x12e14d,_0x2e3090,_0x58fc8d){var _0x1ae68a,_0x9a7cdb;_0x58fc8d['remoteUri']=intUtil[_0x83f9('0x42')](_0x58fc8d[_0x83f9('0x1a')]);_0x58fc8d['serverUrl']=intUtil[_0x83f9('0x42')](_0x58fc8d[_0x83f9('0x41')]);if(_0x2e3090&&_0x2e3090['monitor_format']){logger[_0x83f9('0x1d')]('['+_0x5107db[_0x83f9('0x5b')][_0x83f9('0x5c')]()+']',_0x83f9('0x53'));_0x5107db[_0x83f9('0x45')]=util[_0x83f9('0xe')](_0x83f9('0x46'),_0x58fc8d['serverUrl'],_0x5107db[_0x83f9('0x47')],md5(_0x5107db[_0x83f9('0x47')]));}else{_0x5107db[_0x83f9('0x45')]='';}headers[_0x83f9('0x48')]=getAuth(_0x58fc8d);return getUser(_0x58fc8d,'')[_0x83f9('0x1c')](function(_0x25feec){_0x1ae68a=_0x25feec;logger[_0x83f9('0x1d')](_0x83f9('0x49'),_0x1ae68a['id']);return getEndUser(_0x58fc8d,_0x5107db[_0x83f9('0xf')],_0x5107db[_0x83f9('0x10')]);})[_0x83f9('0x1c')](function(_0x44bd0d){_0x9a7cdb=_0x44bd0d;logger['info']('The\x20Enduser\x20ID\x20is:',_0x9a7cdb['id']);return getTicket(_0x58fc8d,_0x1ae68a,_0x9a7cdb,_0x33ff9d,_0x5107db);})[_0x83f9('0x1c')](function(_0x5f3c87){if(_0x5f3c87){logger[_0x83f9('0x1d')](_0x83f9('0x57'));logger[_0x83f9('0x1d')](_0x83f9('0x4a'),_0x5f3c87['id']);}})['catch'](function(_0x136d38){logger[_0x83f9('0x4e')]('['+_0x5107db[_0x83f9('0x5b')][_0x83f9('0x5c')]()+']',JSON[_0x83f9('0x59')](_0x136d38));});}; \ 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 a2795da..59759cb 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 _0x01a5=['moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','GET','Getting\x20user\x20list','agentEmail','userEmail','userId','User\x20found:','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','getString','Subjects','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','unmanaged',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util'];(function(_0x5a54a9,_0x4f08b4){var _0x3c7f83=function(_0x2c312d){while(--_0x2c312d){_0x5a54a9['push'](_0x5a54a9['shift']());}};_0x3c7f83(++_0x4f08b4);}(_0x01a5,0x148));var _0x501a=function(_0x210661,_0x2f2a83){_0x210661=_0x210661-0x0;var _0x23ece6=_0x01a5[_0x210661];return _0x23ece6;};'use strict';var _=require(_0x501a('0x0'));var rp=require(_0x501a('0x1'));var md5=require(_0x501a('0x2'));var util=require(_0x501a('0x3'));var moment=require(_0x501a('0x4'));var Promise=require(_0x501a('0x5'));var Redis=require(_0x501a('0x6'));var intUtil=require(_0x501a('0x7'));var config=require(_0x501a('0x8'));var logger=require('../../../../config/logger')(_0x501a('0x9'));config[_0x501a('0xa')]=_[_0x501a('0xb')](config[_0x501a('0xa')],{'host':_0x501a('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x501a('0xa')]));function getAdminId(_0x5d8308,_0x17c090,_0x37bf43,_0x20c7ee){return new Promise(function(_0x25d7e2,_0x44054e){var _0x2cd6f5=![];var _0x30940e={'method':'GET','uri':_0x20c7ee+_0x501a('0xd'),'json':!![]};_0x30940e[_0x501a('0xe')]=_0x37bf43;logger[_0x501a('0xf')](_0x501a('0x10'));return rp(_0x30940e)[_0x501a('0x11')](function(_0x192001){if(_0x192001){var _0x35ad09=_0x192001[_0x501a('0x12')];var _0x8f63f4=null;for(_0x8f63f4=0x0;_0x8f63f4<_0x35ad09[_0x501a('0x13')];_0x8f63f4++){if(_0x35ad09[_0x8f63f4][_0x501a('0x14')]===_0x5d8308[_0x501a('0x15')]){_0x5d8308[_0x501a('0x16')]=_0x35ad09[_0x8f63f4]['id'];_0x2cd6f5=!![];}}if(_0x2cd6f5){logger[_0x501a('0xf')](_0x501a('0x17'),_0x5d8308['adminId']);_0x25d7e2(_0x5d8308);}else{_0x44054e({'statusCode':0x194,'message':_0x501a('0x18')});}}else{_0x44054e({'statusCode':0x194,'message':_0x501a('0x18')});}})[_0x501a('0x19')](function(_0x167aa4){logger[_0x501a('0x1a')]('['+[_0x17c090[_0x501a('0x1b')]()]+']',_0x167aa4['message']);_0x44054e(_0x167aa4);});});}function getUser(_0x5c82ba,_0x21accf,_0x31d8f2){return function(_0x300315){return new Promise(function(_0x5d3799,_0x1567df){var _0x8ac009={'method':_0x501a('0x1c'),'uri':_0x31d8f2+_0x501a('0xd'),'json':!![]};_0x8ac009[_0x501a('0xe')]=_0x21accf;logger[_0x501a('0xf')](_0x501a('0x1d'));return rp(_0x8ac009)[_0x501a('0x11')](function(_0x1b3688){if(_0x1b3688){var _0x50416e=_0x1b3688[_0x501a('0x12')];var _0x32bde2=![];var _0x163d67=null;if(_0x300315[_0x501a('0x1e')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x300315[_0x501a('0x1e')]);_0x300315[_0x501a('0x1f')]=_0x300315[_0x501a('0x1e')];for(_0x163d67=0x0;_0x163d67<_0x50416e['length'];_0x163d67++){if(_0x50416e[_0x163d67]['email']===_0x300315[_0x501a('0x1e')]){_0x32bde2=!![];_0x300315[_0x501a('0x20')]=_0x50416e[_0x163d67]['id'];logger['info'](_0x501a('0x21'),_0x300315[_0x501a('0x20')]);}}}if(!_0x32bde2){logger[_0x501a('0xf')]('Admin\x20selected');_0x300315['userEmail']=_0x300315[_0x501a('0x15')];_0x300315[_0x501a('0x20')]=_0x300315[_0x501a('0x16')];_0x32bde2=!![];}if(_0x32bde2){_0x5d3799(_0x300315);}else{_0x1567df({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1567df({'statusCode':0x194,'message':_0x501a('0x18')});}})[_0x501a('0x19')](function(_0x892dfa){logger['error']('['+[_0x5c82ba[_0x501a('0x1b')]()]+']',_0x892dfa[_0x501a('0x22')]);_0x1567df(_0x892dfa);});});};}function searchContact(_0x783556,_0x802dd0,_0x16b3a8,_0x32e864){return new Promise(function(_0x2c3a81,_0x812db){var _0x36ebaf={'method':'GET','headers':_0x802dd0,'uri':_0x783556+_0x501a('0x23')+_0x32e864+_0x501a('0x24')+_0x16b3a8+_0x501a('0x25'),'json':!![]};rp(_0x36ebaf)[_0x501a('0x11')](function(_0x233387){var _0x49c2b7=_[_0x501a('0x26')](_0x233387[_0x501a('0x27')][_0x501a('0x27')],[_0x16b3a8,_0x32e864]);_0x2c3a81(_0x49c2b7);})[_0x501a('0x19')](function(_0x366c2f){_0x812db(_0x366c2f);});});}function getEndUser(_0x54d698,_0x45b410,_0x19dff6){return function(_0x1cc16e){return new Promise(function(_0x5de7a5,_0x2ae229){logger['info'](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x1cc16e[_0x501a('0x28')]));searchContact(_0x19dff6,_0x45b410,_0x501a('0x29'),_0x1cc16e[_0x501a('0x28')])[_0x501a('0x11')](function(_0x2fb3d8){if(_0x2fb3d8){_0x1cc16e[_0x501a('0x2a')]=_0x2fb3d8['id'];logger['info']('Contact\x20found\x20mobile_number:',_0x1cc16e['endUserId']);return _0x5de7a5(_0x1cc16e);}searchContact(_0x19dff6,_0x45b410,_0x501a('0x2b'),_0x1cc16e[_0x501a('0x28')])[_0x501a('0x11')](function(_0x12a8d4){if(_0x12a8d4){_0x1cc16e[_0x501a('0x2a')]=_0x12a8d4['id'];logger['info'](_0x501a('0x2c'),_0x1cc16e['endUserId']);return _0x5de7a5(_0x1cc16e);}createEndUser(_0x1cc16e,_0x54d698,_0x45b410,_0x19dff6)[_0x501a('0x11')](function(_0x4e39b4){logger[_0x501a('0xf')](_0x501a('0x2d'),_0x4e39b4[_0x501a('0x2a')]);return _0x5de7a5(_0x4e39b4);});});})[_0x501a('0x19')](function(_0x28f6c0){_0x2ae229(_0x28f6c0);});});};}function createEndUser(_0x38850b,_0x486904,_0x45ad4c,_0x7a8287){return new Promise(function(_0x11c192,_0x28972e){var _0x299dea=moment();var _0x585f22={'method':_0x501a('0x2e'),'uri':_0x7a8287+_0x501a('0x2f'),'body':{'contact':{'last_name':_0x38850b['contactNumber'],'work_number':_0x38850b[_0x501a('0x28')],'mobile_number':_0x38850b[_0x501a('0x28')],'owner_id':_0x38850b['userId'],'created_at':_0x299dea[_0x501a('0x30')](_0x501a('0x31'))}},'json':!![]};_0x585f22['headers']=_0x45ad4c;logger[_0x501a('0xf')](_0x501a('0x32'));return rp(_0x585f22)[_0x501a('0x11')](function(_0x3a2c79){_0x38850b['endUserId']=_0x3a2c79['contact']['id'];_0x11c192(_0x38850b);})['catch'](function(_0x2c74b9){logger[_0x501a('0x1a')]('['+[_0x486904[_0x501a('0x1b')]()]+']',_0x2c74b9[_0x501a('0x22')]);_0x28972e(_0x2c74b9[_0x501a('0x22')]);});});}function getTicket(_0x530b4c,_0x5868c9,_0x251949,_0x23ad88,_0x43c4c5){return function(_0x2429ff){logger[_0x501a('0xf')](_0x501a('0x33'));return new Promise(function(_0x545445,_0x339566){var _0x2af5ed=moment();var _0x41fa12={'method':_0x501a('0x2e'),'uri':_0x251949+'/api/tasks','body':{'title':intUtil[_0x501a('0x34')](_0x23ad88[_0x501a('0x35')],_0x43c4c5,'\x20'),'description':intUtil[_0x501a('0x34')](_0x23ad88['Descriptions'],_0x43c4c5,'\x0a'),'owner_id':_0x2429ff[_0x501a('0x20')],'creater_id':_0x2429ff[_0x501a('0x16')],'targetable_id':_0x2429ff[_0x501a('0x2a')],'targetable_type':_0x501a('0x36'),'created_at':_0x2af5ed['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x2af5ed[_0x501a('0x37')](0x1e,'m')[_0x501a('0x30')](_0x501a('0x31'))},'json':!![]};_0x41fa12[_0x501a('0xe')]=_0x5868c9;return rp(_0x41fa12)[_0x501a('0x11')](function(_0x49f675){_0x2429ff[_0x501a('0x38')]=_0x49f675['task']['id'];logger[_0x501a('0xf')](_0x501a('0x39'),_0x2429ff[_0x501a('0x38')]);_0x545445(_0x2429ff);})['catch'](function(_0x2f9621){logger[_0x501a('0x1a')]('['+[_0x530b4c['toUpperCase']()]+']',_0x2f9621['message']);_0x339566(_0x2f9621[_0x501a('0x22')]);});});};}function emit(_0x3c3d7e,_0x31778f,_0x27a28b){var _0x22c031={'uri':_0x3c3d7e+_0x501a('0x3a')+_0x27a28b};io['to'](util[_0x501a('0x30')](_0x501a('0x3b'),_0x31778f))['emit'](_0x501a('0x3c'),_0x22c031);}exports['cs']=function(_0x472600,_0x232539,_0x56a881,_0x567661,_0x5d09f9,_0x4a07db,_0x2ac45f,_0x204ce1){var _0x32de6c={};var _0x32404d={'Authorization':_0x501a('0x3d')+_0x4a07db['apiKey']};_0x4a07db[_0x501a('0x3e')]=intUtil[_0x501a('0x3f')](_0x4a07db[_0x501a('0x3e')]);_0x4a07db[_0x501a('0x40')]=intUtil[_0x501a('0x3f')](_0x4a07db[_0x501a('0x40')]);var _0x114df5=_0x4a07db['remoteUri'];_0x32de6c[_0x501a('0x15')]=_0x4a07db[_0x501a('0x41')];_0x32de6c['contactNumber']=_0x204ce1['toLowerCase']()===_0x501a('0x42')?_0x232539[_0x501a('0x43')]:_0x232539[_0x501a('0x44')];_0x32de6c['callDirection']=_0x204ce1===_0x501a('0x45')||_0x204ce1==='unmanaged'?_0x501a('0x45'):_0x501a('0x42');if(_0x567661){_0x32de6c[_0x501a('0x1e')]=_0x567661['email'];}var _0x43fc74=util[_0x501a('0x30')](_0x501a('0x46'),_0x4a07db['serverUrl'],_0x232539[_0x501a('0x47')],md5(_0x232539['uniqueid']));if(_0x5d09f9&&_0x5d09f9[_0x501a('0x48')]){logger[_0x501a('0xf')](_0x501a('0x49'),_0x501a('0x4a'));_0x232539['recordingURL']=_0x43fc74;}else if(_0x2ac45f&&_0x2ac45f[_0x501a('0x4b')]&&_0x2ac45f[_0x501a('0x4b')]!==_0x501a('0x4c')){logger[_0x501a('0xf')](_0x501a('0x4d'),_0x501a('0x4a'));_0x232539['recordingURL']=_0x43fc74;}else{_0x232539[_0x501a('0x4e')]='';}return getAdminId(_0x32de6c,_0x204ce1,_0x32404d,_0x114df5)[_0x501a('0x11')](getUser(_0x204ce1,_0x32404d,_0x114df5))[_0x501a('0x11')](getEndUser(_0x204ce1,_0x32404d,_0x114df5))[_0x501a('0x11')](getTicket(_0x204ce1,_0x32404d,_0x114df5,_0x56a881,_0x232539))['then'](function(_0x3287d1){logger[_0x501a('0xf')](util[_0x501a('0x30')](_0x501a('0x4f'),_0x3287d1[_0x501a('0x38')]));if(_0x204ce1!==_0x501a('0x50')){logger['info']('['+[_0x204ce1[_0x501a('0x1b')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x114df5,_0x567661['name'],_0x3287d1['endUserId']);}})[_0x501a('0x19')](function(_0x1e9e36){logger[_0x501a('0x1a')]('['+[_0x204ce1[_0x501a('0x1b')]()]+_0x501a('0x51'),util[_0x501a('0x52')](_0x1e9e36,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8c51=['Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','/contacts/','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','callDirection','unmanaged','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','/api/selector/owners','info','Getting\x20admin\x20information','users','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','headers','Getting\x20user\x20list','then','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x8c51,0x166));var _0x18c5=function(_0x2953ae,_0x2b4fe2){_0x2953ae=_0x2953ae-0x0;var _0x21bf44=_0x8c51[_0x2953ae];return _0x21bf44;};'use strict';var _=require(_0x18c5('0x0'));var rp=require(_0x18c5('0x1'));var md5=require(_0x18c5('0x2'));var util=require('util');var moment=require(_0x18c5('0x3'));var Promise=require(_0x18c5('0x4'));var Redis=require(_0x18c5('0x5'));var intUtil=require(_0x18c5('0x6'));var config=require('../../../../config/environment');var logger=require(_0x18c5('0x7'))(_0x18c5('0x8'));config[_0x18c5('0x9')]=_[_0x18c5('0xa')](config[_0x18c5('0x9')],{'host':_0x18c5('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0xf7ad5d,_0x2cf106,_0x1c7f9e,_0x214fde){return new Promise(function(_0x3c2112,_0x3ece2a){var _0x16c026=![];var _0x48c69c={'method':'GET','uri':_0x214fde+_0x18c5('0xc'),'json':!![]};_0x48c69c['headers']=_0x1c7f9e;logger[_0x18c5('0xd')](_0x18c5('0xe'));return rp(_0x48c69c)['then'](function(_0xe5e131){if(_0xe5e131){var _0x3ad622=_0xe5e131[_0x18c5('0xf')];var _0x5e4865=null;for(_0x5e4865=0x0;_0x5e4865<_0x3ad622['length'];_0x5e4865++){if(_0x3ad622[_0x5e4865][_0x18c5('0x10')]===_0xf7ad5d['adminEmail']){_0xf7ad5d[_0x18c5('0x11')]=_0x3ad622[_0x5e4865]['id'];_0x16c026=!![];}}if(_0x16c026){logger['info'](_0x18c5('0x12'),_0xf7ad5d[_0x18c5('0x11')]);_0x3c2112(_0xf7ad5d);}else{_0x3ece2a({'statusCode':0x194,'message':_0x18c5('0x13')});}}else{_0x3ece2a({'statusCode':0x194,'message':_0x18c5('0x13')});}})[_0x18c5('0x14')](function(_0x593b44){logger[_0x18c5('0x15')]('['+[_0x2cf106[_0x18c5('0x16')]()]+']',_0x593b44[_0x18c5('0x17')]);_0x3ece2a(_0x593b44);});});}function getUser(_0x2dbdd3,_0x4a171f,_0x48bf65){return function(_0x2830aa){return new Promise(function(_0x49a8b2,_0x164fcc){var _0x5485fd={'method':'GET','uri':_0x48bf65+'/api/selector/owners','json':!![]};_0x5485fd[_0x18c5('0x18')]=_0x4a171f;logger[_0x18c5('0xd')](_0x18c5('0x19'));return rp(_0x5485fd)[_0x18c5('0x1a')](function(_0xd78cdd){if(_0xd78cdd){var _0x4ddc36=_0xd78cdd[_0x18c5('0xf')];var _0x4ef0b1=![];var _0x50e04e=null;if(_0x2830aa[_0x18c5('0x1b')]!==null){logger[_0x18c5('0xd')]('Getting\x20user\x20with\x20email',_0x2830aa[_0x18c5('0x1b')]);_0x2830aa[_0x18c5('0x1c')]=_0x2830aa[_0x18c5('0x1b')];for(_0x50e04e=0x0;_0x50e04e<_0x4ddc36['length'];_0x50e04e++){if(_0x4ddc36[_0x50e04e][_0x18c5('0x10')]===_0x2830aa[_0x18c5('0x1b')]){_0x4ef0b1=!![];_0x2830aa[_0x18c5('0x1d')]=_0x4ddc36[_0x50e04e]['id'];logger[_0x18c5('0xd')](_0x18c5('0x1e'),_0x2830aa[_0x18c5('0x1d')]);}}}if(!_0x4ef0b1){logger[_0x18c5('0xd')](_0x18c5('0x1f'));_0x2830aa[_0x18c5('0x1c')]=_0x2830aa[_0x18c5('0x20')];_0x2830aa[_0x18c5('0x1d')]=_0x2830aa[_0x18c5('0x11')];_0x4ef0b1=!![];}if(_0x4ef0b1){_0x49a8b2(_0x2830aa);}else{_0x164fcc({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x164fcc({'statusCode':0x194,'message':_0x18c5('0x13')});}})[_0x18c5('0x14')](function(_0x2ab225){logger[_0x18c5('0x15')]('['+[_0x2dbdd3[_0x18c5('0x16')]()]+']',_0x2ab225[_0x18c5('0x17')]);_0x164fcc(_0x2ab225);});});};}function searchContact(_0x33f82b,_0x27bcf5,_0x512a82,_0x1ed0aa){return new Promise(function(_0x204837,_0x125638){var _0x4ae193={'method':'GET','headers':_0x27bcf5,'uri':_0x33f82b+'/api/lookup?q='+_0x1ed0aa+_0x18c5('0x21')+_0x512a82+_0x18c5('0x22'),'json':!![]};rp(_0x4ae193)[_0x18c5('0x1a')](function(_0x5d2d56){var _0x43f084=_[_0x18c5('0x23')](_0x5d2d56[_0x18c5('0x24')][_0x18c5('0x24')],[_0x512a82,_0x1ed0aa]);_0x204837(_0x43f084);})[_0x18c5('0x14')](function(_0x310f35){_0x125638(_0x310f35);});});}function getEndUser(_0x125c66,_0x5f7561,_0x18190c){return function(_0x3ed3fe){return new Promise(function(_0x3c89ab,_0x4994ea){logger[_0x18c5('0xd')](util[_0x18c5('0x25')](_0x18c5('0x26'),_0x3ed3fe[_0x18c5('0x27')]));searchContact(_0x18190c,_0x5f7561,_0x18c5('0x28'),_0x3ed3fe[_0x18c5('0x27')])[_0x18c5('0x1a')](function(_0xe84e56){if(_0xe84e56){_0x3ed3fe[_0x18c5('0x29')]=_0xe84e56['id'];logger[_0x18c5('0xd')](_0x18c5('0x2a'),_0x3ed3fe['endUserId']);return _0x3c89ab(_0x3ed3fe);}searchContact(_0x18190c,_0x5f7561,_0x18c5('0x2b'),_0x3ed3fe[_0x18c5('0x27')])['then'](function(_0x3bd93e){if(_0x3bd93e){_0x3ed3fe[_0x18c5('0x29')]=_0x3bd93e['id'];logger['info'](_0x18c5('0x2c'),_0x3ed3fe['endUserId']);return _0x3c89ab(_0x3ed3fe);}createEndUser(_0x3ed3fe,_0x125c66,_0x5f7561,_0x18190c)[_0x18c5('0x1a')](function(_0x492e7f){logger[_0x18c5('0xd')](_0x18c5('0x2d'),_0x492e7f['endUserId']);return _0x3c89ab(_0x492e7f);});});})['catch'](function(_0x5e142e){_0x4994ea(_0x5e142e);});});};}function createEndUser(_0x4b7abd,_0x2a3cf6,_0x3bb68d,_0x220c3e){return new Promise(function(_0x14d3ff,_0x8d3220){var _0x2e34a7=moment();var _0x284c82={'method':_0x18c5('0x2e'),'uri':_0x220c3e+_0x18c5('0x2f'),'body':{'contact':{'last_name':_0x4b7abd[_0x18c5('0x27')],'work_number':_0x4b7abd['contactNumber'],'mobile_number':_0x4b7abd[_0x18c5('0x27')],'owner_id':_0x4b7abd['userId'],'created_at':_0x2e34a7[_0x18c5('0x25')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x284c82[_0x18c5('0x18')]=_0x3bb68d;logger[_0x18c5('0xd')](_0x18c5('0x30'));return rp(_0x284c82)[_0x18c5('0x1a')](function(_0x1998f0){_0x4b7abd[_0x18c5('0x29')]=_0x1998f0['contact']['id'];_0x14d3ff(_0x4b7abd);})[_0x18c5('0x14')](function(_0x2f338b){logger['error']('['+[_0x2a3cf6['toUpperCase']()]+']',_0x2f338b['message']);_0x8d3220(_0x2f338b[_0x18c5('0x17')]);});});}function getTicket(_0x3dae88,_0x4eba0a,_0x7f071e,_0x26f780,_0xd2c708){return function(_0x2bbc56){logger[_0x18c5('0xd')](_0x18c5('0x31'));return new Promise(function(_0x138736,_0x1d66f6){var _0x183165=moment();var _0x578d66={'method':_0x18c5('0x2e'),'uri':_0x7f071e+_0x18c5('0x32'),'body':{'title':intUtil[_0x18c5('0x33')](_0x26f780[_0x18c5('0x34')],_0xd2c708,'\x20'),'description':intUtil[_0x18c5('0x33')](_0x26f780[_0x18c5('0x35')],_0xd2c708,'\x0a'),'owner_id':_0x2bbc56['userId'],'creater_id':_0x2bbc56[_0x18c5('0x11')],'targetable_id':_0x2bbc56[_0x18c5('0x29')],'targetable_type':_0x18c5('0x36'),'created_at':_0x183165[_0x18c5('0x25')](_0x18c5('0x37')),'due_date':_0x183165[_0x18c5('0x38')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x578d66[_0x18c5('0x18')]=_0x4eba0a;return rp(_0x578d66)[_0x18c5('0x1a')](function(_0x501cbb){_0x2bbc56[_0x18c5('0x39')]=_0x501cbb['task']['id'];logger[_0x18c5('0xd')]('Task\x20created:',_0x2bbc56[_0x18c5('0x39')]);_0x138736(_0x2bbc56);})[_0x18c5('0x14')](function(_0x1fc711){logger['error']('['+[_0x3dae88[_0x18c5('0x16')]()]+']',_0x1fc711[_0x18c5('0x17')]);_0x1d66f6(_0x1fc711[_0x18c5('0x17')]);});});};}function emit(_0x151990,_0x2126ce,_0x4b41ad){var _0x6daec3={'uri':_0x151990+_0x18c5('0x3a')+_0x4b41ad};io['to'](util[_0x18c5('0x25')]('user:%s',_0x2126ce))[_0x18c5('0x3b')](_0x18c5('0x3c'),_0x6daec3);}exports['cs']=function(_0x5ddfd5,_0x239491,_0x37bbb8,_0x15c3b1,_0x31e66f,_0x5886d9,_0x5ce54a,_0x28c5dd){var _0x5bec09={};var _0x2dbf95={'Authorization':'Token\x20token='+_0x5886d9[_0x18c5('0x3d')]};_0x5886d9[_0x18c5('0x3e')]=intUtil[_0x18c5('0x3f')](_0x5886d9[_0x18c5('0x3e')]);_0x5886d9[_0x18c5('0x40')]=intUtil['stripTrailingSlash'](_0x5886d9[_0x18c5('0x40')]);var _0x39637d=_0x5886d9[_0x18c5('0x3e')];_0x5bec09[_0x18c5('0x20')]=_0x5886d9['username'];_0x5bec09[_0x18c5('0x27')]=_0x28c5dd[_0x18c5('0x41')]()===_0x18c5('0x42')?_0x239491['destcalleridnum']:_0x239491['calleridnum'];_0x5bec09[_0x18c5('0x43')]=_0x28c5dd==='queue'||_0x28c5dd===_0x18c5('0x44')?_0x18c5('0x45'):'outbound';if(_0x15c3b1){_0x5bec09['agentEmail']=_0x15c3b1[_0x18c5('0x10')];}var _0x5f4b92=util[_0x18c5('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5886d9[_0x18c5('0x40')],_0x239491[_0x18c5('0x46')],md5(_0x239491[_0x18c5('0x46')]));if(_0x31e66f&&_0x31e66f[_0x18c5('0x47')]){logger[_0x18c5('0xd')](_0x18c5('0x48'),_0x18c5('0x49'));_0x239491[_0x18c5('0x4a')]=_0x5f4b92;}else if(_0x5ce54a&&_0x5ce54a[_0x18c5('0x4b')]&&_0x5ce54a[_0x18c5('0x4b')]!==_0x18c5('0x4c')){logger[_0x18c5('0xd')](_0x18c5('0x4d'),_0x18c5('0x49'));_0x239491[_0x18c5('0x4a')]=_0x5f4b92;}else{_0x239491[_0x18c5('0x4a')]='';}return getAdminId(_0x5bec09,_0x28c5dd,_0x2dbf95,_0x39637d)[_0x18c5('0x1a')](getUser(_0x28c5dd,_0x2dbf95,_0x39637d))[_0x18c5('0x1a')](getEndUser(_0x28c5dd,_0x2dbf95,_0x39637d))['then'](getTicket(_0x28c5dd,_0x2dbf95,_0x39637d,_0x37bbb8,_0x239491))[_0x18c5('0x1a')](function(_0x355ee6){logger[_0x18c5('0xd')](util[_0x18c5('0x25')](_0x18c5('0x4e'),_0x355ee6[_0x18c5('0x39')]));if(_0x28c5dd!==_0x18c5('0x44')){logger[_0x18c5('0xd')]('['+[_0x28c5dd[_0x18c5('0x16')]()]+']',_0x18c5('0x4f'));emit(_0x39637d,_0x15c3b1[_0x18c5('0x50')],_0x355ee6[_0x18c5('0x29')]);}})['catch'](function(_0x4bbafc){logger[_0x18c5('0x15')]('['+[_0x28c5dd[_0x18c5('0x16')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x18c5('0x51')](_0x4bbafc,{'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 20a8ab2..b0b4779 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 _0xccd1=['toLowerCase','data2','find','queue','routeId','log','EVENT\x20UNKNOWN','freshsales','servicenow','unknown\x20integration','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./freshdesk','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','exec','includes','data1'];(function(_0x21a1a6,_0x1474bf){var _0x5cec0e=function(_0x13abb9){while(--_0x13abb9){_0x21a1a6['push'](_0x21a1a6['shift']());}};_0x5cec0e(++_0x1474bf);}(_0xccd1,0x1bc));var _0x1ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1ccd('0x0'));var util=require('util');var zendesk=require(_0x1ccd('0x1'));var salesforce=require(_0x1ccd('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x1ccd('0x3'));var zoho=require('./zoho');var desk=require(_0x1ccd('0x4'));var vtiger=require(_0x1ccd('0x5'));var servicenow=require(_0x1ccd('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0x1ccd('0x7'));var integrations=[_0x1ccd('0x8'),_0x1ccd('0x9'),'sugarcrm',_0x1ccd('0xa'),_0x1ccd('0xb'),_0x1ccd('0xc'),_0x1ccd('0xd'),_0x1ccd('0xe'),'freshsales','servicenow'];exports[_0x1ccd('0xf')]=function(_0x7793f4,_0x59953a,_0x4127d5,_0x162477,_0x31e9e4,_0x5c5851){if(_0x4127d5){if(_[_0x1ccd('0x10')](integrations,_0x7793f4[_0x1ccd('0x11')]['toLowerCase']())){try{var _0x29b416=null;var _0x4bbd8c='';var _0x591ac2=_0x4127d5[_0x7793f4[_0x1ccd('0x11')][_0x1ccd('0x12')]()];if(_0x591ac2){var _0x2f6f4e=_0x591ac2[_0x7793f4[_0x1ccd('0x13')]];if(_0x2f6f4e){var _0x15443d=_[_0x1ccd('0x14')](_0x2f6f4e['Configurations'],{'id':parseInt(_0x7793f4['data3'],0xa)});if(_0x15443d){if(_0x162477){if(_0x31e9e4&&_0x59953a[_0x1ccd('0x15')]){_0x4bbd8c=_0x1ccd('0x15');}else if(_0x59953a[_0x1ccd('0x16')]){_0x4bbd8c='outbound';}else{console[_0x1ccd('0x17')](_0x1ccd('0x18'),_0x59953a);}}else{_0x4bbd8c='unmanaged';}switch(_0x7793f4[_0x1ccd('0x11')]['toLowerCase']()){case _0x1ccd('0x8'):zendesk[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case _0x1ccd('0x9'):salesforce[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case'sugarcrm':sugarcrm[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case _0x1ccd('0xa'):freshdesk[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case'zoho':zoho[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case _0x1ccd('0xc'):desk[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case _0x1ccd('0xd'):vtiger[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case _0x1ccd('0x19'):freshsales['cs'](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851,_0x4bbd8c);break;case _0x1ccd('0x1a'):servicenow['cs'](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851,_0x4bbd8c);break;case _0x1ccd('0xe'):dynamics365['cs'](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851,_0x4bbd8c);break;default:console[_0x1ccd('0x17')](_0x1ccd('0x1b'));}}else{_0x29b416=require('../../../../config/logger')(_0x7793f4[_0x1ccd('0x11')][_0x1ccd('0x12')]());_0x29b416['error'](_0x1ccd('0x1c'),util[_0x1ccd('0x1d')](_0x1ccd('0x1e'),_0x7793f4['data1']['toLowerCase'](),_0x7793f4[_0x1ccd('0x1f')]));}}else{_0x29b416=require('../../../../config/logger')(_0x7793f4[_0x1ccd('0x11')][_0x1ccd('0x12')]());_0x29b416['error'](_0x1ccd('0x1c'),util[_0x1ccd('0x1d')](_0x1ccd('0x20'),_0x7793f4[_0x1ccd('0x11')][_0x1ccd('0x12')](),_0x7793f4[_0x1ccd('0x13')]));}}else{}}catch(_0x2ec58d){console['error'](_0x2ec58d);}}}}; \ No newline at end of file +var _0xce22=['queue','routeId','outbound','log','freshdesk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','vtiger','dynamics365','freshsales','servicenow','includes','data1','toLowerCase','data2','Configurations','data3'];(function(_0x252249,_0x51b202){var _0x1c1548=function(_0x33685d){while(--_0x33685d){_0x252249['push'](_0x252249['shift']());}};_0x1c1548(++_0x51b202);}(_0xce22,0xea));var _0x2ce2=function(_0x1507b0,_0x444936){_0x1507b0=_0x1507b0-0x0;var _0x39e688=_0xce22[_0x1507b0];return _0x39e688;};'use strict';var _=require(_0x2ce2('0x0'));var util=require(_0x2ce2('0x1'));var zendesk=require(_0x2ce2('0x2'));var salesforce=require(_0x2ce2('0x3'));var sugarcrm=require(_0x2ce2('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x2ce2('0x5'));var desk=require('./desk');var vtiger=require(_0x2ce2('0x6'));var servicenow=require(_0x2ce2('0x7'));var dynamics365=require(_0x2ce2('0x8'));var freshsales=require(_0x2ce2('0x9'));var integrations=[_0x2ce2('0xa'),_0x2ce2('0xb'),_0x2ce2('0xc'),'freshdesk',_0x2ce2('0xd'),_0x2ce2('0xe'),_0x2ce2('0xf'),_0x2ce2('0x10'),_0x2ce2('0x11'),_0x2ce2('0x12')];exports['exec']=function(_0x25d27e,_0x3c2e05,_0x561dae,_0x26218a,_0x3c9b36,_0x524303){if(_0x561dae){if(_[_0x2ce2('0x13')](integrations,_0x25d27e[_0x2ce2('0x14')][_0x2ce2('0x15')]())){try{var _0x3dbbbe=null;var _0x4b2407='';var _0x1b4a4f=_0x561dae[_0x25d27e[_0x2ce2('0x14')][_0x2ce2('0x15')]()];if(_0x1b4a4f){var _0x5efaa1=_0x1b4a4f[_0x25d27e[_0x2ce2('0x16')]];if(_0x5efaa1){var _0x4d3490=_['find'](_0x5efaa1[_0x2ce2('0x17')],{'id':parseInt(_0x25d27e[_0x2ce2('0x18')],0xa)});if(_0x4d3490){if(_0x26218a){if(_0x3c9b36&&_0x3c2e05[_0x2ce2('0x19')]){_0x4b2407=_0x2ce2('0x19');}else if(_0x3c2e05[_0x2ce2('0x1a')]){_0x4b2407=_0x2ce2('0x1b');}else{console[_0x2ce2('0x1c')]('EVENT\x20UNKNOWN',_0x3c2e05);}}else{_0x4b2407='unmanaged';}switch(_0x25d27e['data1'][_0x2ce2('0x15')]()){case _0x2ce2('0xa'):zendesk[_0x4b2407](_0x25d27e,_0x3c2e05,_0x4d3490,_0x26218a,_0x3c9b36,_0x5efaa1,_0x524303);break;case _0x2ce2('0xb'):salesforce[_0x4b2407](_0x25d27e,_0x3c2e05,_0x4d3490,_0x26218a,_0x3c9b36,_0x5efaa1,_0x524303);break;case _0x2ce2('0xc'):sugarcrm[_0x4b2407](_0x25d27e,_0x3c2e05,_0x4d3490,_0x26218a,_0x3c9b36,_0x5efaa1,_0x524303);break;case _0x2ce2('0x1d'):freshdesk[_0x4b2407](_0x25d27e,_0x3c2e05,_0x4d3490,_0x26218a,_0x3c9b36,_0x5efaa1,_0x524303);break;case'zoho':zoho[_0x4b2407](_0x25d27e,_0x3c2e05,_0x4d3490,_0x26218a,_0x3c9b36,_0x5efaa1,_0x524303);break;case _0x2ce2('0xe'):desk[_0x4b2407](_0x25d27e,_0x3c2e05,_0x4d3490,_0x26218a,_0x3c9b36,_0x5efaa1,_0x524303);break;case'vtiger':vtiger[_0x4b2407](_0x25d27e,_0x3c2e05,_0x4d3490,_0x26218a,_0x3c9b36,_0x5efaa1,_0x524303);break;case _0x2ce2('0x11'):freshsales['cs'](_0x25d27e,_0x3c2e05,_0x4d3490,_0x26218a,_0x3c9b36,_0x5efaa1,_0x524303,_0x4b2407);break;case _0x2ce2('0x12'):servicenow['cs'](_0x25d27e,_0x3c2e05,_0x4d3490,_0x26218a,_0x3c9b36,_0x5efaa1,_0x524303,_0x4b2407);break;case _0x2ce2('0x10'):dynamics365['cs'](_0x25d27e,_0x3c2e05,_0x4d3490,_0x26218a,_0x3c9b36,_0x5efaa1,_0x524303,_0x4b2407);break;default:console[_0x2ce2('0x1c')](_0x2ce2('0x1e'));}}else{_0x3dbbbe=require(_0x2ce2('0x1f'))(_0x25d27e['data1']['toLowerCase']());_0x3dbbbe[_0x2ce2('0x20')](_0x2ce2('0x21'),util[_0x2ce2('0x22')](_0x2ce2('0x23'),_0x25d27e['data1']['toLowerCase'](),_0x25d27e['data3']));}}else{_0x3dbbbe=require(_0x2ce2('0x1f'))(_0x25d27e[_0x2ce2('0x14')]['toLowerCase']());_0x3dbbbe[_0x2ce2('0x20')](_0x2ce2('0x21'),util[_0x2ce2('0x22')](_0x2ce2('0x24'),_0x25d27e[_0x2ce2('0x14')][_0x2ce2('0x15')](),_0x25d27e[_0x2ce2('0x16')]));}}else{}}catch(_0x5c748f){console['error'](_0x5c748f);}}}}; \ 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 f1f8ea1..b2dbf2b 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 _0x43a8=['variable','variableName','Variable','name','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','email','calleridname','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','salesforce','redis','defaults','localhost','emit','assign','Subjects','getString','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','Case','ContactId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','then','length','Email','Agent\x20%s\x20found.','resolve','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','execute','additionalSearchLead','merge','account_contact_lead','additionalSearchAccount','Contact','Lead','first','Name','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','Caller\x20-\x20%s','','format','Company','upperFirst','forEach','includes','picklist','type','idField','toString'];(function(_0x5302fb,_0x1a2db3){var _0x43e6a4=function(_0x324ae6){while(--_0x324ae6){_0x5302fb['push'](_0x5302fb['shift']());}};_0x43e6a4(++_0x1a2db3);}(_0x43a8,0x1bc));var _0x843a=function(_0x2f2614,_0x2a0172){_0x2f2614=_0x2f2614-0x0;var _0x29cbe5=_0x43a8[_0x2f2614];return _0x29cbe5;};'use strict';var _=require(_0x843a('0x0'));var rp=require(_0x843a('0x1'));var moment=require(_0x843a('0x2'));var BPromise=require(_0x843a('0x3'));var md5=require(_0x843a('0x4'));var jsforce=require(_0x843a('0x5'));var util=require('util');var Redis=require(_0x843a('0x6'));var intUtil=require(_0x843a('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x843a('0x8'));config[_0x843a('0x9')]=_[_0x843a('0xa')](config[_0x843a('0x9')],{'host':_0x843a('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x37054a,_0x5edd0d,_0x3725e){io['to'](_0x37054a)[_0x843a('0xc')](_0x5edd0d,_0x3725e);}function getTicket(_0x502370,_0x48bf09,_0x1d8511,_0x4f3082,_0x38115e,_0x5bdf17,_0x18a350,_0x49fe51){var _0xf318fe=Object[_0x843a('0xd')]({},{'OwnerId':_0x48bf09['id'],'Subject':intUtil['getString'](_0x4f3082[_0x843a('0xe')],_0x38115e,'\x20'),'Description':intUtil[_0x843a('0xf')](_0x4f3082['Descriptions'],_0x38115e,'\x0a')},getCustomFields(_0x5bdf17,_0x38115e));if(_0x1d8511){if(_0x4f3082[_0x843a('0x10')]===_0x843a('0x11')){_0xf318fe[_0x843a('0x12')]=moment[_0x843a('0x13')]();_0xf318fe[_0x843a('0x14')]=![];_0xf318fe[_0x843a('0x15')]=![];if(_0x1d8511[_0x843a('0x16')]===_0x843a('0x17')||_0x1d8511[_0x843a('0x16')]===_0x843a('0x18')){_0xf318fe['WhoId']=_0x1d8511['id'];}else if(_0x1d8511[_0x843a('0x16')]==='account'){_0xf318fe['WhatId']=_0x1d8511['id'];}}else if(_0x4f3082[_0x843a('0x10')]===_0x843a('0x19')){if(_0x1d8511[_0x843a('0x16')]==='contact'){_0xf318fe[_0x843a('0x1a')]=_0x1d8511['id'];}else if(_0x1d8511[_0x843a('0x16')]===_0x843a('0x1b')){_0xf318fe[_0x843a('0x1c')]=_0x1d8511['id'];}else if(_0x1d8511[_0x843a('0x16')]===_0x843a('0x18')&&_0x4f3082[_0x843a('0x1d')]){_0xf318fe[_0x4f3082[_0x843a('0x1d')]]=_0x1d8511['id'];}else{logger[_0x843a('0x1e')](_0x843a('0x1f'));}}}return _0x18a350[_0x843a('0x20')](_0x4f3082[_0x843a('0x10')])[_0x843a('0x21')](_0xf318fe);}function getUser(_0x793d54,_0x264fa9,_0x1c280d){if(!_[_0x843a('0x22')](_0x264fa9)&&intUtil[_0x843a('0x23')](_0x264fa9)){var _0xf4e9de={'Email':_0x264fa9};var _0x47dde6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1c280d[_0x843a('0x20')](_0x843a('0x24'))[_0x843a('0x25')](_0xf4e9de,_0x47dde6)['execute']()[_0x843a('0x26')](function(_0x36a0e7){if(_0x36a0e7[_0x843a('0x27')]){var _0x2d88e0=_[_0x843a('0x25')](_0x36a0e7,function(_0x4d52a9){return _0x4d52a9[_0x843a('0x28')]===_0x264fa9;});if(_0x2d88e0){logger[_0x843a('0x1e')](_0x843a('0x29'),_0x264fa9);return BPromise[_0x843a('0x2a')]({'id':_0x2d88e0['Id'],'name':_0x2d88e0['Name']});}}else{logger[_0x843a('0x1e')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x264fa9);return _0x1c280d[_0x843a('0x2b')]()[_0x843a('0x26')](function(_0x448d3d){return BPromise[_0x843a('0x2a')]({'id':_0x448d3d[_0x843a('0x2c')],'name':_0x448d3d[_0x843a('0x2d')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x264fa9);return _0x1c280d[_0x843a('0x2b')]()[_0x843a('0x26')](function(_0x3bfb14){return BPromise['resolve']({'id':_0x3bfb14[_0x843a('0x2c')],'name':_0x3bfb14[_0x843a('0x2d')]});});}}function getEndUser(_0x398ccc,_0x55c74d,_0x31aa3d,_0x4ee0f7,_0x2d790b){var _0x16620d={'$or':{'Phone':_0x4ee0f7}};var _0x126218={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x843a('0x2a')]()[_0x843a('0x26')](function(){logger[_0x843a('0x1e')](_0x843a('0x2e'),_0x4ee0f7,_0x55c74d['moduleSearch']);switch(_0x55c74d[_0x843a('0x2f')]){case _0x843a('0x30'):var _0x31f42c=_[_0x843a('0x31')](_0x16620d);if(_0x55c74d['additionalSearchContact']){var _0x29ae0a={};_0x29ae0a[_0x55c74d[_0x843a('0x32')]]=_0x4ee0f7;_['merge'](_0x31f42c[_0x843a('0x33')],_0x29ae0a);}return _0x2d790b[_0x843a('0x20')]('Contact')[_0x843a('0x25')](_0x31f42c,_0x126218)[_0x843a('0x34')]()['then'](function(_0x4de7fb){if(_0x4de7fb&&_0x4de7fb[_0x843a('0x27')]){return _0x4de7fb;}else{var _0x12d3fa=_[_0x843a('0x31')](_0x16620d);if(_0x55c74d[_0x843a('0x35')]){var _0x14bdfc={};_0x14bdfc[_0x55c74d[_0x843a('0x35')]]=_0x4ee0f7;_[_0x843a('0x36')](_0x12d3fa['$or'],_0x14bdfc);}return _0x2d790b[_0x843a('0x20')]('Lead')[_0x843a('0x25')](_0x12d3fa,_0x126218);}});case _0x843a('0x37'):var _0x57b6ba=_[_0x843a('0x31')](_0x16620d);if(_0x55c74d[_0x843a('0x38')]){var _0x29ae0a={};_0x29ae0a[_0x55c74d[_0x843a('0x38')]]=_0x4ee0f7;_['merge'](_0x57b6ba[_0x843a('0x33')],_0x29ae0a);}return _0x2d790b['sobject']('Account')['find'](_0x57b6ba,_0x126218)[_0x843a('0x34')]()[_0x843a('0x26')](function(_0x54e38b){if(_0x54e38b&&_0x54e38b[_0x843a('0x27')]){return _0x54e38b;}else{var _0x2ac2f2=_['cloneDeep'](_0x16620d);if(_0x55c74d[_0x843a('0x32')]){var _0x3cec88={};_0x3cec88[_0x55c74d[_0x843a('0x32')]]=_0x4ee0f7;_[_0x843a('0x36')](_0x2ac2f2[_0x843a('0x33')],_0x3cec88);}return _0x2d790b[_0x843a('0x20')](_0x843a('0x39'))[_0x843a('0x25')](_0x2ac2f2,_0x126218)[_0x843a('0x26')](function(_0x6251a){if(_0x6251a&&_0x6251a[_0x843a('0x27')]){return _0x6251a;}else{var _0x12e4e7=_[_0x843a('0x31')](_0x16620d);if(_0x55c74d[_0x843a('0x35')]){var _0x5485c8={};_0x5485c8[_0x55c74d[_0x843a('0x35')]]=_0x4ee0f7;_[_0x843a('0x36')](_0x12e4e7[_0x843a('0x33')],_0x5485c8);}return _0x2d790b[_0x843a('0x20')]('Lead')[_0x843a('0x25')](_0x12e4e7,_0x126218);}});}});case _0x843a('0x17'):var _0x31f42c=_[_0x843a('0x31')](_0x16620d);if(_0x55c74d[_0x843a('0x32')]){var _0x29ae0a={};_0x29ae0a[_0x55c74d[_0x843a('0x32')]]=_0x4ee0f7;_[_0x843a('0x36')](_0x31f42c[_0x843a('0x33')],_0x29ae0a);}return _0x2d790b[_0x843a('0x20')](_0x843a('0x39'))[_0x843a('0x25')](_0x31f42c,_0x126218)[_0x843a('0x34')]();case _0x843a('0x18'):var _0x1eb74f=_['cloneDeep'](_0x16620d);if(_0x55c74d[_0x843a('0x35')]){var _0x29ae0a={};_0x29ae0a[_0x55c74d[_0x843a('0x35')]]=_0x4ee0f7;_[_0x843a('0x36')](_0x1eb74f['$or'],_0x29ae0a);}return _0x2d790b['sobject'](_0x843a('0x3a'))[_0x843a('0x25')](_0x1eb74f,_0x126218);case _0x843a('0x1b'):var _0x57b6ba=_[_0x843a('0x31')](_0x16620d);if(_0x55c74d[_0x843a('0x38')]){var _0x29ae0a={};_0x29ae0a[_0x55c74d[_0x843a('0x38')]]=_0x4ee0f7;_[_0x843a('0x36')](_0x57b6ba[_0x843a('0x33')],_0x29ae0a);}return _0x2d790b[_0x843a('0x20')]('Account')['find'](_0x57b6ba,_0x126218);default:return null;}})[_0x843a('0x26')](function(_0x3c4680){if(_0x3c4680&&_0x3c4680[_0x843a('0x27')]){var _0x269243=_[_0x843a('0x3b')](_0x3c4680);if(_0x269243){return BPromise[_0x843a('0x2a')]({'id':_0x269243['Id'],'name':_0x269243[_0x843a('0x3c')],'phone':_0x269243[_0x843a('0x3d')],'endUserType':_0x269243[_0x843a('0x3e')]['type'][_0x843a('0x3f')]()});}}})['then'](function(_0x4928d2){if(_0x4928d2){logger[_0x843a('0x1e')](_0x843a('0x40'),_0x4928d2['endUserType'],_0x4ee0f7);return BPromise['resolve'](_0x4928d2);}else{logger[_0x843a('0x1e')](_0x843a('0x41'),_0x4ee0f7);var _0x3e0702={'Phone':_0x4ee0f7};if(_0x55c74d[_0x843a('0x42')]){if(_0x55c74d['moduleCreate']==='contact'){logger[_0x843a('0x1e')](_0x843a('0x43'),_0x4ee0f7,_0x55c74d['moduleCreate']);_0x3e0702[_0x843a('0x44')]=_0x31aa3d!==''?_0x31aa3d:util['format'](_0x843a('0x45'),_0x4ee0f7);}else if(_0x55c74d[_0x843a('0x42')]===_0x843a('0x18')){logger['info'](_0x843a('0x43'),_0x4ee0f7,_0x55c74d[_0x843a('0x42')]);_0x3e0702['LastName']=_0x31aa3d!==_0x843a('0x46')?_0x31aa3d:util[_0x843a('0x47')](_0x843a('0x45'),_0x4ee0f7);_0x3e0702[_0x843a('0x48')]='No\x20Company';}else if(_0x55c74d[_0x843a('0x42')]===_0x843a('0x1b')){logger[_0x843a('0x1e')](_0x843a('0x43'),_0x4ee0f7,_0x55c74d['moduleCreate']);_0x3e0702[_0x843a('0x3c')]=_0x31aa3d!==_0x843a('0x46')?_0x31aa3d:util['format'](_0x843a('0x45'),_0x4ee0f7);}else{return null;}}return _0x2d790b[_0x843a('0x20')](_[_0x843a('0x49')](_0x55c74d['moduleCreate']))['create'](_0x3e0702)[_0x843a('0x26')](function(_0x547b5e){return BPromise[_0x843a('0x2a')]({'id':_0x547b5e['id'],'endUserType':_0x55c74d[_0x843a('0x42')]});});}});}function getCustomFields(_0x30b2b9,_0x179f76){var _0x2d25f6={};if(_0x30b2b9[_0x843a('0x27')]>0x0){_[_0x843a('0x4a')](_0x30b2b9,function(_0x69abf9){if(_[_0x843a('0x4b')](['string',_0x843a('0x4c')],_0x69abf9[_0x843a('0x4d')])&&_0x69abf9[_0x843a('0x4e')]){_0x2d25f6[_0x69abf9[_0x843a('0x4e')]]=_0x69abf9['content'][_0x843a('0x4f')]();}else if(_0x69abf9[_0x843a('0x4d')]===_0x843a('0x50')&&_0x69abf9[_0x843a('0x51')]&&_0x69abf9[_0x843a('0x4e')]){_0x179f76[_0x69abf9[_0x843a('0x51')]]&&(_0x2d25f6[_0x69abf9[_0x843a('0x4e')]]=_0x179f76[_0x69abf9[_0x843a('0x51')]][_0x843a('0x4f')]());}else if(_0x69abf9[_0x843a('0x4d')]==='customVariable'&&_0x69abf9['Variable']&&_0x69abf9[_0x843a('0x52')][_0x843a('0x53')]&&_0x69abf9[_0x843a('0x4e')]){_0x179f76[_0x69abf9['Variable'][_0x843a('0x53')][_0x843a('0x3f')]()]&&(_0x2d25f6[_0x69abf9[_0x843a('0x4e')]]=_0x179f76[_0x69abf9[_0x843a('0x52')][_0x843a('0x53')]['toLowerCase']()]['toString']());}});}return _0x2d25f6;}function getConnection(_0x80ce6a){var _0x5b372e=_0x80ce6a[_0x843a('0x54')]['concat'](_0x80ce6a[_0x843a('0x55')]);var _0x18cb26=new jsforce[(_0x843a('0x56'))]({'oauth2':{'loginUrl':_0x80ce6a[_0x843a('0x57')]||_0x843a('0x58'),'clientId':_0x80ce6a[_0x843a('0x59')],'clientSecret':_0x80ce6a[_0x843a('0x5a')]}});return _0x18cb26[_0x843a('0x5b')](_0x80ce6a[_0x843a('0x5c')],_0x5b372e)[_0x843a('0x26')](function(){logger[_0x843a('0x1e')](_0x843a('0x5d'));return _0x18cb26;});}exports['queue']=function(_0xf476c6,_0x51e775,_0x2516fe,_0x5c926f,_0x336e87,_0x1343d0){var _0x566d0a,_0x751e6e,_0x37d06d,_0x5bfaa7;_0x1343d0[_0x843a('0x5e')]=intUtil[_0x843a('0x5f')](_0x1343d0[_0x843a('0x5e')]);_0x1343d0[_0x843a('0x57')]=intUtil[_0x843a('0x5f')](_0x1343d0['remoteUri']);if(_0x336e87&&_0x336e87[_0x843a('0x60')]){logger[_0x843a('0x1e')]('[QUEUE]',_0x843a('0x61'));_0x51e775['recordingURL']=util[_0x843a('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1343d0[_0x843a('0x5e')],_0x51e775['uniqueid'],md5(_0x51e775['uniqueid']));}else{_0x51e775[_0x843a('0x62')]='';}return getConnection(_0x1343d0)['then'](function(_0x3dae73){_0x5bfaa7=_0x3dae73;return getUser(_0x1343d0,_0x5c926f[_0x843a('0x63')],_0x5bfaa7);})[_0x843a('0x26')](function(_0x5e1602){_0x566d0a=_0x5e1602;return getEndUser(_0x1343d0,_0x2516fe,_0x51e775[_0x843a('0x64')],_0x51e775[_0x843a('0x65')],_0x5bfaa7);})['then'](function(_0x216636){_0x751e6e=_0x216636;return getTicket(_0x1343d0,_0x566d0a,_0x751e6e,_0x2516fe,_0x51e775,_0x2516fe['Fields'],_0x5bfaa7,_0x843a('0x66'));})['then'](function(_0x354a6e){_0x37d06d=_0x354a6e;logger[_0x843a('0x1e')](_0x843a('0x67'),_0x37d06d['id']);logger[_0x843a('0x1e')](_0x843a('0x68'),_0x37d06d['id'],_0x5c926f[_0x843a('0x53')],_0x1343d0[_0x843a('0x4d')]);switch(_0x1343d0['type']){case _0x843a('0x69'):emit(util['format'](_0x843a('0x6a'),_0x5c926f[_0x843a('0x53')]),_0x843a('0x6b'),{'recordId':_0x37d06d['id']});break;case'newTab':emit(util[_0x843a('0x47')](_0x843a('0x6a'),_0x5c926f[_0x843a('0x53')]),_0x843a('0x6c'),{'uri':util[_0x843a('0x47')](_0x843a('0x6d'),_0x5bfaa7[_0x843a('0x6e')],_0x37d06d['id'])});break;default:logger[_0x843a('0x6f')](_0x843a('0x70'));}})[_0x843a('0x71')](function(_0x23b466){logger['error'](_0x843a('0x72'),_0x23b466);});};exports[_0x843a('0x73')]=function(_0x566356,_0x122213,_0x2aba87,_0x2a06d5,_0x1e01b3,_0xeece42,_0xcc6206){var _0x3679e3,_0xf38888,_0x2c3dba,_0x4f8043;_0xeece42[_0x843a('0x5e')]=intUtil[_0x843a('0x5f')](_0xeece42[_0x843a('0x5e')]);_0xeece42[_0x843a('0x57')]=intUtil[_0x843a('0x5f')](_0xeece42['remoteUri']);if(_0xcc6206&&_0xcc6206[_0x843a('0x74')]&&_0xcc6206[_0x843a('0x74')]!==_0x843a('0x75')){logger[_0x843a('0x1e')](_0x843a('0x76'),_0x843a('0x61'));_0x122213[_0x843a('0x62')]=util[_0x843a('0x47')](_0x843a('0x77'),_0xeece42[_0x843a('0x5e')],_0x122213[_0x843a('0x78')],md5(_0x122213[_0x843a('0x78')]));}return getConnection(_0xeece42)[_0x843a('0x26')](function(_0x2ae80d){_0x4f8043=_0x2ae80d;return getUser(_0xeece42,_0x2a06d5[_0x843a('0x63')],_0x4f8043);})['then'](function(_0x8ef146){_0x3679e3=_0x8ef146;return getEndUser(_0xeece42,_0x2aba87,_0x122213['destcalleridname'],_0x122213[_0x843a('0x79')],_0x4f8043);})['then'](function(_0x49b8a9){_0xf38888=_0x49b8a9;return getTicket(_0xeece42,_0x3679e3,_0xf38888,_0x2aba87,_0x122213,_0x2aba87[_0x843a('0x7a')],_0x4f8043,_0x843a('0x73'));})['then'](function(_0x546119){_0x2c3dba=_0x546119;logger[_0x843a('0x1e')](_0x843a('0x7b'),_0x2c3dba['id']);logger[_0x843a('0x1e')](_0x843a('0x7c'),_0x2c3dba['id'],_0x2a06d5['name'],_0xeece42['type']);switch(_0xeece42[_0x843a('0x4d')]){case _0x843a('0x69'):emit(util[_0x843a('0x47')](_0x843a('0x6a'),_0x2a06d5[_0x843a('0x53')]),_0x843a('0x6b'),{'recordId':_0x2c3dba['id']});break;case'newTab':emit(util['format']('user:%s',_0x2a06d5[_0x843a('0x53')]),'trigger:browser:url',{'uri':util['format'](_0x843a('0x6d'),_0x4f8043[_0x843a('0x6e')],_0x2c3dba['id'])});break;default:logger[_0x843a('0x6f')]('[OUTBOUND]',_0x843a('0x7d'));}})['catch'](function(_0x4948fb){logger['error'](_0x843a('0x76'),_0x4948fb);});};exports[_0x843a('0x7e')]=function(_0x44f342,_0x331745,_0x114403,_0x33fa83,_0x552b19,_0x252ef5){var _0x44cf35,_0x2814c3,_0x1394cb,_0x490a49;_0x252ef5[_0x843a('0x5e')]=intUtil[_0x843a('0x5f')](_0x252ef5['serverUrl']);_0x252ef5[_0x843a('0x57')]=intUtil['stripTrailingSlash'](_0x252ef5[_0x843a('0x57')]);if(_0x552b19&&_0x552b19[_0x843a('0x60')]){logger[_0x843a('0x1e')]('['+_0x331745[_0x843a('0x7f')][_0x843a('0x80')]()+']',_0x843a('0x61'));_0x331745[_0x843a('0x62')]=util[_0x843a('0x47')](_0x843a('0x77'),_0x252ef5['serverUrl'],_0x331745[_0x843a('0x78')],md5(_0x331745['uniqueid']));}else{_0x331745[_0x843a('0x62')]='';}return getConnection(_0x252ef5)[_0x843a('0x26')](function(_0x280036){_0x490a49=_0x280036;if(!_[_0x843a('0x22')](_0x33fa83)){return getUser(_0x252ef5,_0x33fa83[_0x843a('0x53')],_0x490a49);}else{return getUser(_0x252ef5,null,_0x490a49);}})[_0x843a('0x26')](function(_0x446517){_0x44cf35=_0x446517;return getEndUser(_0x252ef5,_0x114403,_0x331745[_0x843a('0x64')],_0x331745[_0x843a('0x65')],_0x490a49);})['then'](function(_0x41295a){_0x2814c3=_0x41295a;return getTicket(_0x252ef5,_0x44cf35,_0x2814c3,_0x114403,_0x331745,_0x114403[_0x843a('0x7a')],_0x490a49);})[_0x843a('0x26')](function(_0x5d5db4){_0x1394cb=_0x5d5db4;logger[_0x843a('0x1e')]('['+_0x331745[_0x843a('0x7f')][_0x843a('0x80')]()+_0x843a('0x81'),_0x1394cb['id']);logger[_0x843a('0x1e')]('['+_0x331745[_0x843a('0x7f')][_0x843a('0x80')]()+_0x843a('0x82'),_0x252ef5['type']);})[_0x843a('0x71')](function(_0x17e0b1){logger[_0x843a('0x6f')]('['+_0x331745[_0x843a('0x7f')][_0x843a('0x80')]()+']',_0x17e0b1);});}; \ No newline at end of file +var _0x60e6=['[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','lead','account','WhatId','Case','ContactId','leadId','info','sobject','isNil','validateEmail','User','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Phone','attributes','type','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','includes','string','picklist','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','password','securityToken','Connection','remoteUri','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error'];(function(_0x5f1fc5,_0x1fc97a){var _0x52efb3=function(_0x374388){while(--_0x374388){_0x5f1fc5['push'](_0x5f1fc5['shift']());}};_0x52efb3(++_0x1fc97a);}(_0x60e6,0x104));var _0x660e=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x60e6[_0xfa634c];return _0x73e478;};'use strict';var _=require(_0x660e('0x0'));var rp=require(_0x660e('0x1'));var moment=require(_0x660e('0x2'));var BPromise=require(_0x660e('0x3'));var md5=require('md5');var jsforce=require(_0x660e('0x4'));var util=require(_0x660e('0x5'));var Redis=require(_0x660e('0x6'));var intUtil=require(_0x660e('0x7'));var config=require(_0x660e('0x8'));var logger=require(_0x660e('0x9'))('salesforce');config[_0x660e('0xa')]=_['defaults'](config[_0x660e('0xa')],{'host':_0x660e('0xb'),'port':0x18eb});var io=require(_0x660e('0xc'))(new Redis(config['redis']));function emit(_0x2927ab,_0x4b022f,_0x4b9430){io['to'](_0x2927ab)[_0x660e('0xd')](_0x4b022f,_0x4b9430);}function getTicket(_0x3dcc9e,_0x13ab96,_0x33dff2,_0x30638f,_0x1e51d1,_0x488a1c,_0x3929ee,_0x4713bc){var _0x25358e=Object['assign']({},{'OwnerId':_0x13ab96['id'],'Subject':intUtil[_0x660e('0xe')](_0x30638f['Subjects'],_0x1e51d1,'\x20'),'Description':intUtil[_0x660e('0xe')](_0x30638f[_0x660e('0xf')],_0x1e51d1,'\x0a')},getCustomFields(_0x488a1c,_0x1e51d1));if(_0x33dff2){if(_0x30638f[_0x660e('0x10')]===_0x660e('0x11')){_0x25358e[_0x660e('0x12')]=moment[_0x660e('0x13')]();_0x25358e['IsReminderSet']=![];_0x25358e[_0x660e('0x14')]=![];if(_0x33dff2[_0x660e('0x15')]===_0x660e('0x16')||_0x33dff2[_0x660e('0x15')]===_0x660e('0x17')){_0x25358e['WhoId']=_0x33dff2['id'];}else if(_0x33dff2[_0x660e('0x15')]===_0x660e('0x18')){_0x25358e[_0x660e('0x19')]=_0x33dff2['id'];}}else if(_0x30638f[_0x660e('0x10')]===_0x660e('0x1a')){if(_0x33dff2['endUserType']===_0x660e('0x16')){_0x25358e[_0x660e('0x1b')]=_0x33dff2['id'];}else if(_0x33dff2['endUserType']===_0x660e('0x18')){_0x25358e['AccountId']=_0x33dff2['id'];}else if(_0x33dff2[_0x660e('0x15')]==='lead'&&_0x30638f[_0x660e('0x1c')]){_0x25358e[_0x30638f[_0x660e('0x1c')]]=_0x33dff2['id'];}else{logger[_0x660e('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x3929ee[_0x660e('0x1e')](_0x30638f[_0x660e('0x10')])['create'](_0x25358e);}function getUser(_0x249bb5,_0x5c4dc1,_0x532806){if(!_[_0x660e('0x1f')](_0x5c4dc1)&&intUtil[_0x660e('0x20')](_0x5c4dc1)){var _0xd2a2a4={'Email':_0x5c4dc1};var _0xe822e9={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x532806[_0x660e('0x1e')](_0x660e('0x21'))[_0x660e('0x22')](_0xd2a2a4,_0xe822e9)[_0x660e('0x23')]()[_0x660e('0x24')](function(_0x1fd6d3){if(_0x1fd6d3[_0x660e('0x25')]){var _0x461fc4=_[_0x660e('0x22')](_0x1fd6d3,function(_0x5231e7){return _0x5231e7['Email']===_0x5c4dc1;});if(_0x461fc4){logger[_0x660e('0x1d')](_0x660e('0x26'),_0x5c4dc1);return BPromise[_0x660e('0x27')]({'id':_0x461fc4['Id'],'name':_0x461fc4[_0x660e('0x28')]});}}else{logger['info'](_0x660e('0x29'),_0x5c4dc1);return _0x532806['identity']()[_0x660e('0x24')](function(_0xd6522e){return BPromise[_0x660e('0x27')]({'id':_0xd6522e[_0x660e('0x2a')],'name':_0xd6522e['display_name']});});}});}else{logger[_0x660e('0x1d')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5c4dc1);return _0x532806[_0x660e('0x2b')]()['then'](function(_0x2fa0e4){return BPromise[_0x660e('0x27')]({'id':_0x2fa0e4[_0x660e('0x2a')],'name':_0x2fa0e4[_0x660e('0x2c')]});});}}function getEndUser(_0x2ec6cf,_0x38f9a3,_0x1a55ed,_0x506374,_0x4dac09){var _0xf53fc2={'$or':{'Phone':_0x506374}};var _0x28d324={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x660e('0x27')]()[_0x660e('0x24')](function(){logger[_0x660e('0x1d')](_0x660e('0x2d'),_0x506374,_0x38f9a3['moduleSearch']);switch(_0x38f9a3['moduleSearch']){case'contact_lead':var _0x196281=_[_0x660e('0x2e')](_0xf53fc2);if(_0x38f9a3[_0x660e('0x2f')]){var _0x289c90={};_0x289c90[_0x38f9a3[_0x660e('0x2f')]]=_0x506374;_[_0x660e('0x30')](_0x196281[_0x660e('0x31')],_0x289c90);}return _0x4dac09[_0x660e('0x1e')](_0x660e('0x32'))[_0x660e('0x22')](_0x196281,_0x28d324)['execute']()[_0x660e('0x24')](function(_0x4c8f9a){if(_0x4c8f9a&&_0x4c8f9a['length']){return _0x4c8f9a;}else{var _0x26181c=_[_0x660e('0x2e')](_0xf53fc2);if(_0x38f9a3['additionalSearchLead']){var _0x4abcf1={};_0x4abcf1[_0x38f9a3[_0x660e('0x33')]]=_0x506374;_[_0x660e('0x30')](_0x26181c[_0x660e('0x31')],_0x4abcf1);}return _0x4dac09[_0x660e('0x1e')](_0x660e('0x34'))[_0x660e('0x22')](_0x26181c,_0x28d324);}});case _0x660e('0x35'):var _0x528be7=_[_0x660e('0x2e')](_0xf53fc2);if(_0x38f9a3[_0x660e('0x36')]){var _0x289c90={};_0x289c90[_0x38f9a3[_0x660e('0x36')]]=_0x506374;_[_0x660e('0x30')](_0x528be7[_0x660e('0x31')],_0x289c90);}return _0x4dac09[_0x660e('0x1e')](_0x660e('0x37'))[_0x660e('0x22')](_0x528be7,_0x28d324)[_0x660e('0x23')]()[_0x660e('0x24')](function(_0x42d8da){if(_0x42d8da&&_0x42d8da['length']){return _0x42d8da;}else{var _0x2e077f=_[_0x660e('0x2e')](_0xf53fc2);if(_0x38f9a3[_0x660e('0x2f')]){var _0x388bb5={};_0x388bb5[_0x38f9a3[_0x660e('0x2f')]]=_0x506374;_[_0x660e('0x30')](_0x2e077f[_0x660e('0x31')],_0x388bb5);}return _0x4dac09[_0x660e('0x1e')](_0x660e('0x32'))[_0x660e('0x22')](_0x2e077f,_0x28d324)[_0x660e('0x24')](function(_0x3f7daa){if(_0x3f7daa&&_0x3f7daa['length']){return _0x3f7daa;}else{var _0xcbd9bd=_['cloneDeep'](_0xf53fc2);if(_0x38f9a3[_0x660e('0x33')]){var _0x3f3dda={};_0x3f3dda[_0x38f9a3[_0x660e('0x33')]]=_0x506374;_[_0x660e('0x30')](_0xcbd9bd[_0x660e('0x31')],_0x3f3dda);}return _0x4dac09[_0x660e('0x1e')](_0x660e('0x34'))[_0x660e('0x22')](_0xcbd9bd,_0x28d324);}});}});case _0x660e('0x16'):var _0x196281=_['cloneDeep'](_0xf53fc2);if(_0x38f9a3[_0x660e('0x2f')]){var _0x289c90={};_0x289c90[_0x38f9a3[_0x660e('0x2f')]]=_0x506374;_[_0x660e('0x30')](_0x196281[_0x660e('0x31')],_0x289c90);}return _0x4dac09[_0x660e('0x1e')](_0x660e('0x32'))['find'](_0x196281,_0x28d324)['execute']();case _0x660e('0x17'):var _0x595a0=_[_0x660e('0x2e')](_0xf53fc2);if(_0x38f9a3[_0x660e('0x33')]){var _0x289c90={};_0x289c90[_0x38f9a3[_0x660e('0x33')]]=_0x506374;_[_0x660e('0x30')](_0x595a0['$or'],_0x289c90);}return _0x4dac09['sobject'](_0x660e('0x34'))[_0x660e('0x22')](_0x595a0,_0x28d324);case'account':var _0x528be7=_[_0x660e('0x2e')](_0xf53fc2);if(_0x38f9a3[_0x660e('0x36')]){var _0x289c90={};_0x289c90[_0x38f9a3['additionalSearchAccount']]=_0x506374;_[_0x660e('0x30')](_0x528be7['$or'],_0x289c90);}return _0x4dac09[_0x660e('0x1e')](_0x660e('0x37'))['find'](_0x528be7,_0x28d324);default:return null;}})[_0x660e('0x24')](function(_0x2d343b){if(_0x2d343b&&_0x2d343b[_0x660e('0x25')]){var _0x9aa3c1=_['first'](_0x2d343b);if(_0x9aa3c1){return BPromise[_0x660e('0x27')]({'id':_0x9aa3c1['Id'],'name':_0x9aa3c1[_0x660e('0x28')],'phone':_0x9aa3c1[_0x660e('0x38')],'endUserType':_0x9aa3c1[_0x660e('0x39')][_0x660e('0x3a')]['toLowerCase']()});}}})[_0x660e('0x24')](function(_0x4d185c){if(_0x4d185c){logger[_0x660e('0x1d')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x4d185c[_0x660e('0x15')],_0x506374);return BPromise[_0x660e('0x27')](_0x4d185c);}else{logger['info'](_0x660e('0x3b'),_0x506374);var _0x46c993={'Phone':_0x506374};if(_0x38f9a3[_0x660e('0x3c')]){if(_0x38f9a3[_0x660e('0x3c')]===_0x660e('0x16')){logger[_0x660e('0x1d')](_0x660e('0x3d'),_0x506374,_0x38f9a3[_0x660e('0x3c')]);_0x46c993[_0x660e('0x3e')]=_0x1a55ed!==_0x660e('0x3f')?_0x1a55ed:util[_0x660e('0x40')](_0x660e('0x41'),_0x506374);}else if(_0x38f9a3['moduleCreate']===_0x660e('0x17')){logger[_0x660e('0x1d')](_0x660e('0x3d'),_0x506374,_0x38f9a3[_0x660e('0x3c')]);_0x46c993[_0x660e('0x3e')]=_0x1a55ed!==_0x660e('0x3f')?_0x1a55ed:util['format'](_0x660e('0x41'),_0x506374);_0x46c993[_0x660e('0x42')]=_0x660e('0x43');}else if(_0x38f9a3[_0x660e('0x3c')]===_0x660e('0x18')){logger[_0x660e('0x1d')](_0x660e('0x3d'),_0x506374,_0x38f9a3[_0x660e('0x3c')]);_0x46c993[_0x660e('0x28')]=_0x1a55ed!==''?_0x1a55ed:util[_0x660e('0x40')](_0x660e('0x41'),_0x506374);}else{return null;}}return _0x4dac09['sobject'](_['upperFirst'](_0x38f9a3[_0x660e('0x3c')]))['create'](_0x46c993)[_0x660e('0x24')](function(_0x523ce9){return BPromise[_0x660e('0x27')]({'id':_0x523ce9['id'],'endUserType':_0x38f9a3['moduleCreate']});});}});}function getCustomFields(_0x2e2942,_0x4b164f){var _0x2acd1b={};if(_0x2e2942[_0x660e('0x25')]>0x0){_['forEach'](_0x2e2942,function(_0x170e32){if(_[_0x660e('0x44')]([_0x660e('0x45'),_0x660e('0x46')],_0x170e32['type'])&&_0x170e32[_0x660e('0x47')]){_0x2acd1b[_0x170e32['idField']]=_0x170e32[_0x660e('0x48')]['toString']();}else if(_0x170e32[_0x660e('0x3a')]===_0x660e('0x49')&&_0x170e32[_0x660e('0x4a')]&&_0x170e32[_0x660e('0x47')]){_0x4b164f[_0x170e32[_0x660e('0x4a')]]&&(_0x2acd1b[_0x170e32[_0x660e('0x47')]]=_0x4b164f[_0x170e32[_0x660e('0x4a')]][_0x660e('0x4b')]());}else if(_0x170e32[_0x660e('0x3a')]===_0x660e('0x4c')&&_0x170e32[_0x660e('0x4d')]&&_0x170e32['Variable']['name']&&_0x170e32[_0x660e('0x47')]){_0x4b164f[_0x170e32[_0x660e('0x4d')][_0x660e('0x4e')][_0x660e('0x4f')]()]&&(_0x2acd1b[_0x170e32[_0x660e('0x47')]]=_0x4b164f[_0x170e32['Variable'][_0x660e('0x4e')][_0x660e('0x4f')]()][_0x660e('0x4b')]());}});}return _0x2acd1b;}function getConnection(_0x2ce5e3){var _0x437ad6=_0x2ce5e3[_0x660e('0x50')]['concat'](_0x2ce5e3[_0x660e('0x51')]);var _0x182c4e=new jsforce[(_0x660e('0x52'))]({'oauth2':{'loginUrl':_0x2ce5e3[_0x660e('0x53')]||'https://login.salesforce.com','clientId':_0x2ce5e3[_0x660e('0x54')],'clientSecret':_0x2ce5e3[_0x660e('0x55')]}});return _0x182c4e[_0x660e('0x56')](_0x2ce5e3[_0x660e('0x57')],_0x437ad6)[_0x660e('0x24')](function(){logger[_0x660e('0x1d')]('Connection\x20established.');return _0x182c4e;});}exports[_0x660e('0x58')]=function(_0x1c247d,_0x3b2d8b,_0xcf08c,_0x4389fd,_0x54ac06,_0x1842dd){var _0x2253ba,_0x5390e1,_0x5ecf1e,_0xfb96ca;_0x1842dd[_0x660e('0x59')]=intUtil[_0x660e('0x5a')](_0x1842dd[_0x660e('0x59')]);_0x1842dd['remoteUri']=intUtil[_0x660e('0x5a')](_0x1842dd[_0x660e('0x53')]);if(_0x54ac06&&_0x54ac06[_0x660e('0x5b')]){logger[_0x660e('0x1d')](_0x660e('0x5c'),_0x660e('0x5d'));_0x3b2d8b[_0x660e('0x5e')]=util[_0x660e('0x40')](_0x660e('0x5f'),_0x1842dd['serverUrl'],_0x3b2d8b[_0x660e('0x60')],md5(_0x3b2d8b[_0x660e('0x60')]));}else{_0x3b2d8b[_0x660e('0x5e')]='';}return getConnection(_0x1842dd)[_0x660e('0x24')](function(_0x3e2f21){_0xfb96ca=_0x3e2f21;return getUser(_0x1842dd,_0x4389fd[_0x660e('0x61')],_0xfb96ca);})['then'](function(_0x42e6f8){_0x2253ba=_0x42e6f8;return getEndUser(_0x1842dd,_0xcf08c,_0x3b2d8b[_0x660e('0x62')],_0x3b2d8b[_0x660e('0x63')],_0xfb96ca);})[_0x660e('0x24')](function(_0x42166){_0x5390e1=_0x42166;return getTicket(_0x1842dd,_0x2253ba,_0x5390e1,_0xcf08c,_0x3b2d8b,_0xcf08c[_0x660e('0x64')],_0xfb96ca,_0x660e('0x58'));})['then'](function(_0x6eb936){_0x5ecf1e=_0x6eb936;logger[_0x660e('0x1d')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x5ecf1e['id']);logger[_0x660e('0x1d')](_0x660e('0x65'),_0x5ecf1e['id'],_0x4389fd[_0x660e('0x4e')],_0x1842dd['type']);switch(_0x1842dd[_0x660e('0x3a')]){case _0x660e('0x66'):emit(util[_0x660e('0x40')](_0x660e('0x67'),_0x4389fd[_0x660e('0x4e')]),_0x660e('0x68'),{'recordId':_0x5ecf1e['id']});break;case _0x660e('0x69'):emit(util[_0x660e('0x40')](_0x660e('0x67'),_0x4389fd[_0x660e('0x4e')]),_0x660e('0x6a'),{'uri':util[_0x660e('0x40')](_0x660e('0x6b'),_0xfb96ca['instanceUrl'],_0x5ecf1e['id'])});break;default:logger[_0x660e('0x6c')](_0x660e('0x6d'));}})[_0x660e('0x6e')](function(_0x2dde87){logger[_0x660e('0x6c')](_0x660e('0x5c'),_0x2dde87);});};exports[_0x660e('0x6f')]=function(_0x1458cf,_0x145939,_0x2ad9fc,_0x27bd72,_0x18c6e5,_0x250931,_0x517058){var _0x30d4e5,_0x13c0cf,_0x37aaff,_0x293729;_0x250931[_0x660e('0x59')]=intUtil[_0x660e('0x5a')](_0x250931[_0x660e('0x59')]);_0x250931['remoteUri']=intUtil[_0x660e('0x5a')](_0x250931[_0x660e('0x53')]);if(_0x517058&&_0x517058[_0x660e('0x70')]&&_0x517058[_0x660e('0x70')]!=='none'){logger[_0x660e('0x1d')](_0x660e('0x71'),'Recording\x20is\x20enabled!');_0x145939[_0x660e('0x5e')]=util[_0x660e('0x40')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x250931[_0x660e('0x59')],_0x145939[_0x660e('0x60')],md5(_0x145939['uniqueid']));}return getConnection(_0x250931)['then'](function(_0x122c98){_0x293729=_0x122c98;return getUser(_0x250931,_0x27bd72[_0x660e('0x61')],_0x293729);})[_0x660e('0x24')](function(_0x3c7ab3){_0x30d4e5=_0x3c7ab3;return getEndUser(_0x250931,_0x2ad9fc,_0x145939[_0x660e('0x72')],_0x145939[_0x660e('0x73')],_0x293729);})['then'](function(_0x9adf29){_0x13c0cf=_0x9adf29;return getTicket(_0x250931,_0x30d4e5,_0x13c0cf,_0x2ad9fc,_0x145939,_0x2ad9fc[_0x660e('0x64')],_0x293729,_0x660e('0x6f'));})[_0x660e('0x24')](function(_0x324176){_0x37aaff=_0x324176;logger[_0x660e('0x1d')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x37aaff['id']);logger[_0x660e('0x1d')](_0x660e('0x74'),_0x37aaff['id'],_0x27bd72[_0x660e('0x4e')],_0x250931[_0x660e('0x3a')]);switch(_0x250931[_0x660e('0x3a')]){case'integrationTab':emit(util[_0x660e('0x40')]('user:%s',_0x27bd72[_0x660e('0x4e')]),_0x660e('0x68'),{'recordId':_0x37aaff['id']});break;case _0x660e('0x69'):emit(util[_0x660e('0x40')](_0x660e('0x67'),_0x27bd72[_0x660e('0x4e')]),_0x660e('0x6a'),{'uri':util['format'](_0x660e('0x6b'),_0x293729[_0x660e('0x75')],_0x37aaff['id'])});break;default:logger[_0x660e('0x6c')](_0x660e('0x71'),_0x660e('0x76'));}})[_0x660e('0x6e')](function(_0x4bd480){logger['error'](_0x660e('0x71'),_0x4bd480);});};exports[_0x660e('0x77')]=function(_0xf71abb,_0x169a11,_0x2f4e97,_0x561915,_0x1510ca,_0xd3ef13){var _0x2d1209,_0x4ee565,_0x412064,_0xc596db;_0xd3ef13[_0x660e('0x59')]=intUtil[_0x660e('0x5a')](_0xd3ef13[_0x660e('0x59')]);_0xd3ef13[_0x660e('0x53')]=intUtil[_0x660e('0x5a')](_0xd3ef13[_0x660e('0x53')]);if(_0x1510ca&&_0x1510ca[_0x660e('0x5b')]){logger[_0x660e('0x1d')]('['+_0x169a11[_0x660e('0x78')][_0x660e('0x79')]()+']','Recording\x20is\x20enabled!');_0x169a11[_0x660e('0x5e')]=util[_0x660e('0x40')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd3ef13[_0x660e('0x59')],_0x169a11[_0x660e('0x60')],md5(_0x169a11[_0x660e('0x60')]));}else{_0x169a11[_0x660e('0x5e')]='';}return getConnection(_0xd3ef13)[_0x660e('0x24')](function(_0x1d8b2f){_0xc596db=_0x1d8b2f;if(!_['isNil'](_0x561915)){return getUser(_0xd3ef13,_0x561915[_0x660e('0x4e')],_0xc596db);}else{return getUser(_0xd3ef13,null,_0xc596db);}})[_0x660e('0x24')](function(_0xd07612){_0x2d1209=_0xd07612;return getEndUser(_0xd3ef13,_0x2f4e97,_0x169a11[_0x660e('0x62')],_0x169a11[_0x660e('0x63')],_0xc596db);})['then'](function(_0x2c7b24){_0x4ee565=_0x2c7b24;return getTicket(_0xd3ef13,_0x2d1209,_0x4ee565,_0x2f4e97,_0x169a11,_0x2f4e97[_0x660e('0x64')],_0xc596db);})[_0x660e('0x24')](function(_0x4ba033){_0x412064=_0x4ba033;logger['info']('['+_0x169a11['lastevent']['toUpperCase']()+_0x660e('0x7a'),_0x412064['id']);logger[_0x660e('0x1d')]('['+_0x169a11[_0x660e('0x78')][_0x660e('0x79')]()+']\x20Integration\x20account\x20type\x20%s.',_0xd3ef13[_0x660e('0x3a')]);})[_0x660e('0x6e')](function(_0x303196){logger['error']('['+_0x169a11[_0x660e('0x78')][_0x660e('0x79')]()+']',_0x303196);});}; \ 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 3911c33..e0a5095 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 _0xcc0f=['variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','ticketNumber','push','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','outbound','destcalleridnum','queue','unmanaged','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','util','md5','ioredis','./util','servicenow','defaults','redis','localhost','socket.io-emitter','GET','then','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','message','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','customField','toString','includes','idField','toLowerCase','content','variable'];(function(_0x5c76be,_0x463757){var _0x2c0e72=function(_0x1ec5e1){while(--_0x1ec5e1){_0x5c76be['push'](_0x5c76be['shift']());}};_0x2c0e72(++_0x463757);}(_0xcc0f,0x1e4));var _0xfcc0=function(_0x58d533,_0x2bcda3){_0x58d533=_0x58d533-0x0;var _0xfb8f79=_0xcc0f[_0x58d533];return _0xfb8f79;};'use strict';var _=require('lodash');var Promise=require(_0xfcc0('0x0'));var rp=require('request-promise');var util=require(_0xfcc0('0x1'));var md5=require(_0xfcc0('0x2'));var Redis=require(_0xfcc0('0x3'));var intUtil=require(_0xfcc0('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xfcc0('0x5'));config['redis']=_[_0xfcc0('0x6')](config[_0xfcc0('0x7')],{'host':_0xfcc0('0x8'),'port':0x18eb});var io=require(_0xfcc0('0x9'))(new Redis(config[_0xfcc0('0x7')]));function getAdminUser(_0x59fdce,_0x313d13,_0x333b47,_0x4fbeb6,_0x48ff54,_0x485d92){return new Promise(function(_0x360a90,_0x4e3af4){var _0x1c9fdd={'method':_0xfcc0('0xa'),'uri':_0x4fbeb6+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x48ff54+'&'+_0x485d92,'auth':_0x313d13,'json':!![]};return rp(_0x1c9fdd)[_0xfcc0('0xb')](function(_0x48936f){if(_0x48936f[_0xfcc0('0xc')][_0xfcc0('0xd')]>0x0){_0x333b47[_0xfcc0('0xe')]=_0x48936f['result'][0x0][_0xfcc0('0xf')];}logger['info']('['+[_0x59fdce[_0xfcc0('0x10')]()]+_0xfcc0('0x11'),_0x333b47);_0x360a90(_0x333b47);})[_0xfcc0('0x12')](function(_0x18d830){logger[_0xfcc0('0x13')]('['+[_0x59fdce[_0xfcc0('0x10')]()]+']',_0x18d830['message']);_0x4e3af4(_0x18d830['message']);});});}function getUser(_0x527888,_0x2ff972,_0x6da411,_0x406172,_0x4bff8f){return function(_0x5280b5){logger[_0xfcc0('0x14')]('['+[_0x527888[_0xfcc0('0x10')]()]+_0xfcc0('0x15'),_0x5280b5);return new Promise(function(_0xcec249,_0xc7c5e){if(intUtil[_0xfcc0('0x16')](_0x5280b5[_0xfcc0('0x17')])){var _0x278810={'method':_0xfcc0('0xa'),'uri':_0x6da411+_0xfcc0('0x18')+_0x5280b5[_0xfcc0('0x17')]+'&'+_0x406172+'&'+_0x4bff8f,'auth':_0x2ff972,'json':!![]};logger[_0xfcc0('0x14')]('['+[_0x527888[_0xfcc0('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x278810);return rp(_0x278810)['then'](function(_0x25f897){logger[_0xfcc0('0x14')]('['+[_0x527888[_0xfcc0('0x10')]()]+_0xfcc0('0x19'),_0x25f897);if(_0x25f897[_0xfcc0('0xc')]['length']>0x0&&String(_0x25f897[_0xfcc0('0xc')][0x0][_0xfcc0('0x1a')])===_0xfcc0('0x1b')){_0x5280b5['userId']=_0x25f897['result'][0x0][_0xfcc0('0xf')];}else{_0x5280b5[_0xfcc0('0x1c')]=_0x5280b5['adminId'];_0x5280b5[_0xfcc0('0x17')]=_0x5280b5[_0xfcc0('0x1d')];}logger[_0xfcc0('0x14')]('['+[_0x527888[_0xfcc0('0x10')]()]+_0xfcc0('0x1e'),_0x5280b5);_0xcec249(_0x5280b5);})[_0xfcc0('0x12')](function(_0x156efe){logger['error']('['+[_0x527888['toUpperCase']()]+']',_0x156efe['message']);_0xc7c5e(_0x156efe[_0xfcc0('0x1f')]);});}else{logger[_0xfcc0('0x14')]('['+[_0x527888[_0xfcc0('0x10')]()]+']\x20using\x20admin\x20profile');_0x5280b5[_0xfcc0('0x1c')]=_0x5280b5[_0xfcc0('0xe')];_0x5280b5[_0xfcc0('0x17')]=_0x5280b5[_0xfcc0('0x1d')];_0xcec249(_0x5280b5);}});};}function createEndUser(_0x2aa45e,_0x1a20bf,_0x13f3d2,_0x192e46,_0x34d5ce){logger[_0xfcc0('0x14')]('['+[_0x2aa45e[_0xfcc0('0x10')]()]+_0xfcc0('0x20'),_0x13f3d2);return new Promise(function(_0x5beb3b,_0x3bafd5){var _0x5c44e2={'method':_0xfcc0('0x21'),'uri':_0x192e46+_0xfcc0('0x22')+_0x34d5ce,'body':{'user_name':_0x13f3d2[_0xfcc0('0x23')],'roles':_0xfcc0('0x24'),'first_name':_0x13f3d2['endUserNumber'],'active':'true','date_format':_0xfcc0('0x25'),'phone':_0x13f3d2['endUserNumber']},'auth':_0x1a20bf,'json':!![]};return rp(_0x5c44e2)[_0xfcc0('0xb')](function(_0x2fc7ff){logger[_0xfcc0('0x14')]('['+[_0x2aa45e['toUpperCase']()]+_0xfcc0('0x26'),_0x2fc7ff['result']);_0x13f3d2[_0xfcc0('0x27')]=_0x2fc7ff['result']['sys_id'];_0x5beb3b(_0x13f3d2);})[_0xfcc0('0x12')](function(_0x283aad){logger[_0xfcc0('0x13')]('['+[_0x2aa45e[_0xfcc0('0x10')]()]+']',_0x283aad['message']);_0x3bafd5(_0x283aad[_0xfcc0('0x1f')]);});});}function getEndUser(_0x1710f3,_0x1a6563,_0x3230ba,_0x4ae67b,_0x25fbae){return function(_0x160a28){logger[_0xfcc0('0x14')]('['+[_0x1710f3[_0xfcc0('0x10')]()]+_0xfcc0('0x28'),_0x160a28);return new Promise(function(_0xd0384e,_0x30f240){var _0x4baece={'method':_0xfcc0('0xa'),'uri':_0x3230ba+_0xfcc0('0x29')+_0x160a28[_0xfcc0('0x23')]+'&'+_0x4ae67b+'&'+_0x25fbae,'auth':_0x1a6563,'json':!![]};return rp(_0x4baece)[_0xfcc0('0xb')](function(_0x145e89){if(_0x145e89[_0xfcc0('0xc')][_0xfcc0('0xd')]>0x0){_0x160a28[_0xfcc0('0x27')]=_0x145e89[_0xfcc0('0xc')][0x0][_0xfcc0('0xf')];logger[_0xfcc0('0x14')]('['+[_0x1710f3['toUpperCase']()]+_0xfcc0('0x2a'),_0x160a28);_0xd0384e(_0x160a28);}else{return createEndUser(_0x1710f3,_0x1a6563,_0x160a28,_0x3230ba,_0x4ae67b)[_0xfcc0('0xb')](function(_0x46337c){logger[_0xfcc0('0x14')]('['+[_0x1710f3['toUpperCase']()]+_0xfcc0('0x2b'),_0x46337c);_0xd0384e(_0x46337c);});}})[_0xfcc0('0x12')](function(_0x53213a){logger[_0xfcc0('0x13')]('['+[_0x1710f3['toUpperCase']()]+']',_0x53213a[_0xfcc0('0x1f')]);_0x30f240(_0x53213a[_0xfcc0('0x1f')]);});});};}function getCustomFields(_0x561e22,_0x261c13){var _0x33fdfb={};if(_0x561e22[_0xfcc0('0xd')]>0x0){_[_0xfcc0('0x2c')](_0x561e22,function(_0xff544a){if(_['includes']([_0xfcc0('0x2d'),_0xfcc0('0x2e')],_0xff544a[_0xfcc0('0x2f')])&&_0xff544a[_0xfcc0('0x30')]&&!_0xff544a[_0xfcc0('0x31')]){_0x33fdfb[_0xff544a['nameField']['toLowerCase']()]=_0xff544a['content'][_0xfcc0('0x32')]();}else if(_[_0xfcc0('0x33')](['string',_0xfcc0('0x2e')],_0xff544a[_0xfcc0('0x2f')])&&_0xff544a[_0xfcc0('0x34')]&&_0xff544a[_0xfcc0('0x31')]){_0x33fdfb[_0xff544a[_0xfcc0('0x34')][_0xfcc0('0x35')]()]=_0xff544a[_0xfcc0('0x36')][_0xfcc0('0x32')]();}else if(_0xff544a[_0xfcc0('0x2f')]===_0xfcc0('0x37')&&_0xff544a[_0xfcc0('0x38')]&&_0xff544a[_0xfcc0('0x34')]&&_0xff544a[_0xfcc0('0x31')]){_0x33fdfb[_0xff544a[_0xfcc0('0x34')][_0xfcc0('0x35')]()]=_0x261c13[_0xff544a['variableName']]['toString']();}else if(_0xff544a['type']===_0xfcc0('0x39')&&_0xff544a['Variable']&&_0xff544a[_0xfcc0('0x3a')]['name']&&_0xff544a[_0xfcc0('0x34')]&&_0xff544a[_0xfcc0('0x31')]){_0x33fdfb[_0xff544a[_0xfcc0('0x34')][_0xfcc0('0x35')]()]=_0x261c13[_0xff544a[_0xfcc0('0x3a')][_0xfcc0('0x3b')][_0xfcc0('0x35')]()][_0xfcc0('0x32')]();}});}return _0x33fdfb;}function getTicket(_0x2d3f9c,_0x14e8b1,_0x38d1fb,_0x2ca08d,_0x3e76c3,_0x144ded){return function(_0x2d6fc6){logger[_0xfcc0('0x14')]('['+[_0x2d3f9c['toUpperCase']()]+_0xfcc0('0x3c'),_0x2d6fc6);return new Promise(function(_0x27034f,_0x1c84ca){var _0x3a9a4b=_0x2d3f9c[_0xfcc0('0x35')]()==='outbound'?_0x2d6fc6[_0xfcc0('0x1c')]:_0x2d6fc6[_0xfcc0('0x27')];var _0x17f75e={'method':_0xfcc0('0x21'),'uri':_0x38d1fb+_0xfcc0('0x3d')+'?'+_0x144ded,'body':Object[_0xfcc0('0x3e')]({},{'active':_0xfcc0('0x1b'),'caller_id':_0x3a9a4b,'assigned_to':_0x2d6fc6['userId'],'short_description':intUtil[_0xfcc0('0x3f')](_0x2ca08d['Subjects'],_0x3e76c3,'\x20'),'description':intUtil['getString'](_0x2ca08d[_0xfcc0('0x40')],_0x3e76c3,'\x0a')},getCustomFields(_0x2ca08d[_0xfcc0('0x41')],_0x3e76c3)),'auth':_0x14e8b1,'json':!![]};return rp(_0x17f75e)[_0xfcc0('0xb')](function(_0x2c5e8b){logger[_0xfcc0('0x14')]('['+[_0x2d3f9c[_0xfcc0('0x10')]()]+_0xfcc0('0x42'),_0x2c5e8b['result']);_0x2d6fc6[_0xfcc0('0x43')]=_0x2c5e8b[_0xfcc0('0xc')][_0xfcc0('0xf')];_0x2d6fc6['ticketNumber']=_0x2c5e8b[_0xfcc0('0xc')][_0xfcc0('0x44')];logger['info']('['+[_0x2d3f9c[_0xfcc0('0x10')]()]+']\x20getTicket\x20crm',_0x2d6fc6);_0x27034f(_0x2d6fc6);})[_0xfcc0('0x12')](function(_0x1a6310){logger['error']('['+[_0x2d3f9c[_0xfcc0('0x10')]()]+']',_0x1a6310['message']);_0x1c84ca(_0x1a6310[_0xfcc0('0x1f')]);});});};}function createRemoteTag(_0x3d6d1f,_0x39eda4,_0x160bab,_0x1e4592){return new Promise(function(_0xb0c5ac,_0x4de4a6){var _0x32d6f0={'method':_0xfcc0('0x21'),'uri':_0x160bab+_0xfcc0('0x45')+'?'+_0x1e4592,'body':{'short_description':_0x3d6d1f,'global':!![],'active':!![],'name':_0x3d6d1f},'auth':_0x39eda4,'json':!![]};return rp(_0x32d6f0)[_0xfcc0('0xb')](function(_0xbda5a2){var _0xf7f4ae=_0xbda5a2[_0xfcc0('0xc')]['sys_id'];_0xb0c5ac(_0xf7f4ae);});});}function getRemoteTag(_0x5a5482,_0x25d0a4,_0x25062d,_0x58d5a4,_0x2e97da){return new Promise(function(_0x131f36,_0x4ad2d0){var _0x2a2b0b={'method':_0xfcc0('0xa'),'uri':_0x25062d+'label'+_0xfcc0('0x46')+_0x5a5482+'&'+_0x58d5a4,'auth':_0x25d0a4,'json':!![]};return rp(_0x2a2b0b)[_0xfcc0('0xb')](function(_0x299b0b){if(_0x299b0b[_0xfcc0('0xc')][_0xfcc0('0xd')]>0x0){var _0x3f3f94=_0x299b0b[_0xfcc0('0xc')][0x0][_0xfcc0('0xf')];_0x131f36(_0x3f3f94);}else{return createRemoteTag(_0x5a5482,_0x25d0a4,_0x25062d,_0x58d5a4)[_0xfcc0('0xb')](function(_0x1e8db6){_0x131f36(_0x1e8db6);});}});});}function assignTagToIncident(_0x3f98dc,_0x30cb6f,_0x1e6a49,_0x59d919,_0x550165){return new Promise(function(_0x3f32fd,_0x1b3765){var _0x2bca63={'method':_0xfcc0('0x21'),'uri':_0x1e6a49+'label_entry'+'?'+_0x550165,'body':{'label':_0x3f98dc,'table':_0xfcc0('0x3d'),'id_type':_0xfcc0('0x47'),'table_key':_0x59d919[_0xfcc0('0x43')],'title':_0xfcc0('0x48')+_0x59d919[_0xfcc0('0x49')],'id_display':_0x59d919['ticketNumber']},'auth':_0x30cb6f,'json':!![]};return rp(_0x2bca63)['then'](function(_0x376690){_0x3f32fd();})[_0xfcc0('0x12')](function(){_0x3f32fd();});});}function manageTags(_0x40fc01,_0x3aa83c,_0x375c63,_0x550e06,_0x413540,_0x4eedaf,_0x40dd60){return new Promise(function(_0x5b5fe5,_0x375a19){var _0x3acf6c=[];_0x3aa83c[_0xfcc0('0x2c')](function(_0x4bb319){_0x3acf6c['push'](getRemoteTag(_0x4bb319,_0x375c63,_0x550e06,_0x4eedaf,_0x40dd60));});return Promise['all'](_0x3acf6c)[_0xfcc0('0xb')](function(_0x2bd51b){if(_0x2bd51b[_0xfcc0('0xd')]){logger[_0xfcc0('0x14')]('['+[_0x40fc01[_0xfcc0('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x2bd51b);var _0x2a0366=[];_0x2bd51b[_0xfcc0('0x2c')](function(_0x23e199){_0x2a0366[_0xfcc0('0x4a')](assignTagToIncident(_0x23e199,_0x375c63,_0x550e06,_0x413540,_0x4eedaf));});return Promise['all'](_0x2a0366)[_0xfcc0('0xb')](function(){_0x5b5fe5();})[_0xfcc0('0x12')](function(){_0x5b5fe5();});}else{_0x5b5fe5();}});});}function getTags(_0x1eabdb,_0x4f3850,_0x170030,_0x2d87be,_0x5390f1,_0x52f0ac){return function(_0x399800){return new Promise(function(_0xd94c9d,_0x4bdcc4){var _0x4b04e5=[];var _0x66e5c=_0x2d87be[_0xfcc0('0x4b')];if(_0x66e5c&&_0x66e5c[_0xfcc0('0xd')]>0x0){_0x4b04e5=_['map'](_0x66e5c,_0xfcc0('0x3b'));}if(_0x4b04e5[_0xfcc0('0xd')]>0x0){return manageTags(_0x1eabdb,_0x4b04e5,_0x4f3850,_0x170030,_0x399800,_0x5390f1,_0x52f0ac)[_0xfcc0('0xb')](function(){_0xd94c9d(_0x399800);});}else{_0xd94c9d(_0x399800);}});};}function emit(_0xb66351,_0x3f8849,_0x44cb7d){var _0x4a4094=_0xfcc0('0x4c')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xfcc0('0x4d')+_0xfcc0('0x4e');var _0x91b88d={'uri':_0xb66351+_0xfcc0('0x4f')+_0x44cb7d+_0x4a4094};io['to'](util[_0xfcc0('0x50')](_0xfcc0('0x51'),_0x3f8849))[_0xfcc0('0x52')](_0xfcc0('0x53'),_0x91b88d);}exports['cs']=function(_0x30ac58,_0x40f4c8,_0x49fffa,_0x1e9bf8,_0x35c017,_0x29d599,_0x5d7da4,_0x33d186){var _0x1dcd70={};var _0x21dcb8={'user':_0x29d599[_0xfcc0('0x54')],'pass':_0x29d599[_0xfcc0('0x55')]};var _0x46883c=_0xfcc0('0x56');var _0x4a8148='sysparm_display_value=true';_0x29d599[_0xfcc0('0x57')]=intUtil[_0xfcc0('0x58')](_0x29d599[_0xfcc0('0x57')]);_0x29d599['serverUrl']=intUtil[_0xfcc0('0x58')](_0x29d599[_0xfcc0('0x59')]);var _0x547c91=util[_0xfcc0('0x50')](_0xfcc0('0x5a'),_0x29d599[_0xfcc0('0x57')]);_0x1dcd70[_0xfcc0('0x17')]=!_[_0xfcc0('0x5b')](_0x1e9bf8)?_0x1e9bf8['email']:null;_0x1dcd70[_0xfcc0('0x1d')]=_0x29d599['email'];_0x1dcd70['endUserNumber']=_0x33d186[_0xfcc0('0x35')]()===_0xfcc0('0x5c')?_0x40f4c8[_0xfcc0('0x5d')]:_0x40f4c8['calleridnum'];_0x1dcd70['callDirection']=_0x33d186===_0xfcc0('0x5e')||_0x33d186===_0xfcc0('0x5f')?_0xfcc0('0x5e'):_0xfcc0('0x5c');var _0x52a859=util[_0xfcc0('0x50')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x29d599[_0xfcc0('0x59')],_0x40f4c8[_0xfcc0('0x60')],md5(_0x40f4c8[_0xfcc0('0x60')]));if(_0x35c017&&_0x35c017[_0xfcc0('0x61')]){logger[_0xfcc0('0x14')]('[QUEUE]','Recording\x20is\x20enabled!');_0x40f4c8[_0xfcc0('0x62')]=_0x52a859;}else if(_0x5d7da4&&_0x5d7da4[_0xfcc0('0x63')]&&_0x5d7da4[_0xfcc0('0x63')]!==_0xfcc0('0x64')){logger[_0xfcc0('0x14')](_0xfcc0('0x65'),_0xfcc0('0x66'));_0x40f4c8['recordingURL']=_0x52a859;}else{_0x40f4c8[_0xfcc0('0x62')]='';}return getAdminUser(_0x33d186,_0x21dcb8,_0x1dcd70,_0x547c91,_0x4a8148,_0x46883c)[_0xfcc0('0xb')](getUser(_0x33d186,_0x21dcb8,_0x547c91,_0x4a8148,_0x46883c))['then'](getEndUser(_0x33d186,_0x21dcb8,_0x547c91,_0x4a8148,_0x46883c))[_0xfcc0('0xb')](getTicket(_0x33d186,_0x21dcb8,_0x547c91,_0x49fffa,_0x40f4c8,_0x4a8148))['then'](function(_0x2fbf03){logger[_0xfcc0('0x14')](util[_0xfcc0('0x50')](_0xfcc0('0x67'),_0x2fbf03[_0xfcc0('0x43')]));logger[_0xfcc0('0x14')](util[_0xfcc0('0x50')](_0xfcc0('0x68'),_0x33d186));if(_0x33d186!==_0xfcc0('0x5f')){logger['info']('['+[_0x33d186[_0xfcc0('0x10')]()]+']',_0xfcc0('0x69'));emit(_0x29d599[_0xfcc0('0x57')],_0x1e9bf8[_0xfcc0('0x3b')],_0x2fbf03[_0xfcc0('0x43')]);}})[_0xfcc0('0x12')](function(_0x586dcc){logger[_0xfcc0('0x13')]('['+[_0x33d186[_0xfcc0('0x10')]()]+_0xfcc0('0x6a'),util[_0xfcc0('0x6b')](_0x586dcc,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x779c=['adminEmail','],\x20getUser\x20crm','message',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','System','endUserNumber','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','length','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','nameField','toLowerCase','toString','type','idField','customField','content','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','getString','Subjects','Descriptions','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','incident','Incident','Incident\x20-\x20','push','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','util','md5','./util','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId'];(function(_0x48369e,_0x2c23a5){var _0x39eb0c=function(_0xe3f99a){while(--_0xe3f99a){_0x48369e['push'](_0x48369e['shift']());}};_0x39eb0c(++_0x2c23a5);}(_0x779c,0x18f));var _0xc779=function(_0x22fc85,_0x2d521a){_0x22fc85=_0x22fc85-0x0;var _0x424cb0=_0x779c[_0x22fc85];return _0x424cb0;};'use strict';var _=require('lodash');var Promise=require(_0xc779('0x0'));var rp=require('request-promise');var util=require(_0xc779('0x1'));var md5=require(_0xc779('0x2'));var Redis=require('ioredis');var intUtil=require(_0xc779('0x3'));var config=require('../../../../config/environment');var logger=require(_0xc779('0x4'))(_0xc779('0x5'));config['redis']=_[_0xc779('0x6')](config[_0xc779('0x7')],{'host':_0xc779('0x8'),'port':0x18eb});var io=require(_0xc779('0x9'))(new Redis(config[_0xc779('0x7')]));function getAdminUser(_0x3a7b33,_0x5080c2,_0x12d272,_0x5a08f7,_0xff284b,_0x14aaf8){return new Promise(function(_0x3e7bae,_0x390eef){var _0x74229b={'method':_0xc779('0xa'),'uri':_0x5a08f7+_0xc779('0xb')+'&'+_0xff284b+'&'+_0x14aaf8,'auth':_0x5080c2,'json':!![]};return rp(_0x74229b)[_0xc779('0xc')](function(_0x26784c){if(_0x26784c[_0xc779('0xd')]['length']>0x0){_0x12d272[_0xc779('0xe')]=_0x26784c[_0xc779('0xd')][0x0][_0xc779('0xf')];}logger['info']('['+[_0x3a7b33[_0xc779('0x10')]()]+_0xc779('0x11'),_0x12d272);_0x3e7bae(_0x12d272);})[_0xc779('0x12')](function(_0x56584c){logger[_0xc779('0x13')]('['+[_0x3a7b33['toUpperCase']()]+']',_0x56584c['message']);_0x390eef(_0x56584c['message']);});});}function getUser(_0x17bfea,_0x2a7a98,_0x16ab1f,_0x3d340f,_0x110a26){return function(_0x55d781){logger[_0xc779('0x14')]('['+[_0x17bfea[_0xc779('0x10')]()]+_0xc779('0x15'),_0x55d781);return new Promise(function(_0x4fe4c1,_0x3cc6f8){if(intUtil[_0xc779('0x16')](_0x55d781[_0xc779('0x17')])){var _0x270fa2={'method':'GET','uri':_0x16ab1f+'sys_user?sysparm_query=email%3D'+_0x55d781['userEmail']+'&'+_0x3d340f+'&'+_0x110a26,'auth':_0x2a7a98,'json':!![]};logger[_0xc779('0x14')]('['+[_0x17bfea['toUpperCase']()]+_0xc779('0x18'),_0x270fa2);return rp(_0x270fa2)[_0xc779('0xc')](function(_0x131d3b){logger[_0xc779('0x14')]('['+[_0x17bfea['toUpperCase']()]+_0xc779('0x19'),_0x131d3b);if(_0x131d3b[_0xc779('0xd')]['length']>0x0&&String(_0x131d3b['result'][0x0][_0xc779('0x1a')])===_0xc779('0x1b')){_0x55d781[_0xc779('0x1c')]=_0x131d3b['result'][0x0][_0xc779('0xf')];}else{_0x55d781[_0xc779('0x1c')]=_0x55d781['adminId'];_0x55d781[_0xc779('0x17')]=_0x55d781[_0xc779('0x1d')];}logger[_0xc779('0x14')]('['+[_0x17bfea[_0xc779('0x10')]()]+_0xc779('0x1e'),_0x55d781);_0x4fe4c1(_0x55d781);})[_0xc779('0x12')](function(_0x2501e0){logger[_0xc779('0x13')]('['+[_0x17bfea['toUpperCase']()]+']',_0x2501e0[_0xc779('0x1f')]);_0x3cc6f8(_0x2501e0['message']);});}else{logger[_0xc779('0x14')]('['+[_0x17bfea[_0xc779('0x10')]()]+_0xc779('0x20'));_0x55d781['userId']=_0x55d781[_0xc779('0xe')];_0x55d781[_0xc779('0x17')]=_0x55d781[_0xc779('0x1d')];_0x4fe4c1(_0x55d781);}});};}function createEndUser(_0x575f13,_0x1c36da,_0x27cfc6,_0x26c6a1,_0x22482e){logger[_0xc779('0x14')]('['+[_0x575f13[_0xc779('0x10')]()]+_0xc779('0x21'),_0x27cfc6);return new Promise(function(_0x2defbe,_0x535ba7){var _0x656a3a={'method':_0xc779('0x22'),'uri':_0x26c6a1+'sys_user?'+_0x22482e,'body':{'user_name':_0x27cfc6['endUserNumber'],'roles':'user','first_name':_0x27cfc6['endUserNumber'],'active':_0xc779('0x1b'),'date_format':_0xc779('0x23'),'phone':_0x27cfc6[_0xc779('0x24')]},'auth':_0x1c36da,'json':!![]};return rp(_0x656a3a)['then'](function(_0x2b5118){logger[_0xc779('0x14')]('['+[_0x575f13[_0xc779('0x10')]()]+_0xc779('0x25'),_0x2b5118[_0xc779('0xd')]);_0x27cfc6[_0xc779('0x26')]=_0x2b5118[_0xc779('0xd')]['sys_id'];_0x2defbe(_0x27cfc6);})[_0xc779('0x12')](function(_0x453c41){logger[_0xc779('0x13')]('['+[_0x575f13['toUpperCase']()]+']',_0x453c41[_0xc779('0x1f')]);_0x535ba7(_0x453c41[_0xc779('0x1f')]);});});}function getEndUser(_0x34bcd5,_0x43cd9f,_0x26fbb4,_0x21dfda,_0x2f0e0c){return function(_0x1dd712){logger[_0xc779('0x14')]('['+[_0x34bcd5[_0xc779('0x10')]()]+_0xc779('0x27'),_0x1dd712);return new Promise(function(_0x2a56e5,_0x56e7d2){var _0x1f1075={'method':_0xc779('0xa'),'uri':_0x26fbb4+_0xc779('0x28')+_0x1dd712[_0xc779('0x24')]+'&'+_0x21dfda+'&'+_0x2f0e0c,'auth':_0x43cd9f,'json':!![]};return rp(_0x1f1075)[_0xc779('0xc')](function(_0x5dc0b9){if(_0x5dc0b9[_0xc779('0xd')][_0xc779('0x29')]>0x0){_0x1dd712[_0xc779('0x26')]=_0x5dc0b9['result'][0x0][_0xc779('0xf')];logger[_0xc779('0x14')]('['+[_0x34bcd5[_0xc779('0x10')]()]+_0xc779('0x2a'),_0x1dd712);_0x2a56e5(_0x1dd712);}else{return createEndUser(_0x34bcd5,_0x43cd9f,_0x1dd712,_0x26fbb4,_0x21dfda)[_0xc779('0xc')](function(_0x75289a){logger[_0xc779('0x14')]('['+[_0x34bcd5[_0xc779('0x10')]()]+_0xc779('0x2b'),_0x75289a);_0x2a56e5(_0x75289a);});}})[_0xc779('0x12')](function(_0x251315){logger[_0xc779('0x13')]('['+[_0x34bcd5[_0xc779('0x10')]()]+']',_0x251315[_0xc779('0x1f')]);_0x56e7d2(_0x251315['message']);});});};}function getCustomFields(_0x46a52a,_0x5c6ad1){var _0x4e815f={};if(_0x46a52a[_0xc779('0x29')]>0x0){_[_0xc779('0x2c')](_0x46a52a,function(_0x5c2f02){if(_[_0xc779('0x2d')]([_0xc779('0x2e'),'picklist'],_0x5c2f02['type'])&&_0x5c2f02['nameField']&&!_0x5c2f02['customField']){_0x4e815f[_0x5c2f02[_0xc779('0x2f')][_0xc779('0x30')]()]=_0x5c2f02['content'][_0xc779('0x31')]();}else if(_[_0xc779('0x2d')]([_0xc779('0x2e'),'picklist'],_0x5c2f02[_0xc779('0x32')])&&_0x5c2f02[_0xc779('0x33')]&&_0x5c2f02[_0xc779('0x34')]){_0x4e815f[_0x5c2f02['idField'][_0xc779('0x30')]()]=_0x5c2f02[_0xc779('0x35')][_0xc779('0x31')]();}else if(_0x5c2f02[_0xc779('0x32')]===_0xc779('0x36')&&_0x5c2f02['variableName']&&_0x5c2f02[_0xc779('0x33')]&&_0x5c2f02[_0xc779('0x34')]){_0x4e815f[_0x5c2f02[_0xc779('0x33')][_0xc779('0x30')]()]=_0x5c6ad1[_0x5c2f02[_0xc779('0x37')]][_0xc779('0x31')]();}else if(_0x5c2f02['type']===_0xc779('0x38')&&_0x5c2f02[_0xc779('0x39')]&&_0x5c2f02['Variable'][_0xc779('0x3a')]&&_0x5c2f02[_0xc779('0x33')]&&_0x5c2f02[_0xc779('0x34')]){_0x4e815f[_0x5c2f02[_0xc779('0x33')]['toLowerCase']()]=_0x5c6ad1[_0x5c2f02['Variable'][_0xc779('0x3a')][_0xc779('0x30')]()]['toString']();}});}return _0x4e815f;}function getTicket(_0xbe4589,_0xbbc7ea,_0x5df2ed,_0x7e4a69,_0x387cd7,_0x291e9e){return function(_0x2f7a94){logger[_0xc779('0x14')]('['+[_0xbe4589[_0xc779('0x10')]()]+_0xc779('0x3b'),_0x2f7a94);return new Promise(function(_0x2e6374,_0x2789e4){var _0x3ca6b7=_0xbe4589[_0xc779('0x30')]()==='outbound'?_0x2f7a94[_0xc779('0x1c')]:_0x2f7a94['endUserId'];var _0x56f7d5={'method':'POST','uri':_0x5df2ed+'incident'+'?'+_0x291e9e,'body':Object['assign']({},{'active':_0xc779('0x1b'),'caller_id':_0x3ca6b7,'assigned_to':_0x2f7a94[_0xc779('0x1c')],'short_description':intUtil[_0xc779('0x3c')](_0x7e4a69[_0xc779('0x3d')],_0x387cd7,'\x20'),'description':intUtil[_0xc779('0x3c')](_0x7e4a69[_0xc779('0x3e')],_0x387cd7,'\x0a')},getCustomFields(_0x7e4a69['Fields'],_0x387cd7)),'auth':_0xbbc7ea,'json':!![]};return rp(_0x56f7d5)[_0xc779('0xc')](function(_0x4625f2){logger['info']('['+[_0xbe4589['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x4625f2[_0xc779('0xd')]);_0x2f7a94[_0xc779('0x3f')]=_0x4625f2[_0xc779('0xd')][_0xc779('0xf')];_0x2f7a94[_0xc779('0x40')]=_0x4625f2[_0xc779('0xd')][_0xc779('0x41')];logger[_0xc779('0x14')]('['+[_0xbe4589[_0xc779('0x10')]()]+_0xc779('0x42'),_0x2f7a94);_0x2e6374(_0x2f7a94);})[_0xc779('0x12')](function(_0x3f1e43){logger[_0xc779('0x13')]('['+[_0xbe4589[_0xc779('0x10')]()]+']',_0x3f1e43[_0xc779('0x1f')]);_0x2789e4(_0x3f1e43[_0xc779('0x1f')]);});});};}function createRemoteTag(_0x85aa33,_0x5b33c7,_0x365f91,_0x45ec71){return new Promise(function(_0x1c6800,_0x37f881){var _0x51ca03={'method':'POST','uri':_0x365f91+_0xc779('0x43')+'?'+_0x45ec71,'body':{'short_description':_0x85aa33,'global':!![],'active':!![],'name':_0x85aa33},'auth':_0x5b33c7,'json':!![]};return rp(_0x51ca03)[_0xc779('0xc')](function(_0x2e7599){var _0x3dbedb=_0x2e7599[_0xc779('0xd')][_0xc779('0xf')];_0x1c6800(_0x3dbedb);});});}function getRemoteTag(_0x5d135d,_0xa6f775,_0xa964c7,_0x42ae2d,_0x426a17){return new Promise(function(_0x2f23a0,_0x33da11){var _0xe2e679={'method':_0xc779('0xa'),'uri':_0xa964c7+_0xc779('0x43')+'?sysparm_query=name%3D'+_0x5d135d+'&'+_0x42ae2d,'auth':_0xa6f775,'json':!![]};return rp(_0xe2e679)[_0xc779('0xc')](function(_0x4ce54f){if(_0x4ce54f['result']['length']>0x0){var _0x38d9d5=_0x4ce54f['result'][0x0]['sys_id'];_0x2f23a0(_0x38d9d5);}else{return createRemoteTag(_0x5d135d,_0xa6f775,_0xa964c7,_0x42ae2d)['then'](function(_0x83bc4d){_0x2f23a0(_0x83bc4d);});}});});}function assignTagToIncident(_0x3da44f,_0x374459,_0x400f24,_0x3b62f2,_0xaec737){return new Promise(function(_0x14c3d9,_0x516711){var _0xf01bff={'method':_0xc779('0x22'),'uri':_0x400f24+_0xc779('0x44')+'?'+_0xaec737,'body':{'label':_0x3da44f,'table':_0xc779('0x45'),'id_type':_0xc779('0x46'),'table_key':_0x3b62f2['ticketId'],'title':_0xc779('0x47')+_0x3b62f2[_0xc779('0x40')],'id_display':_0x3b62f2[_0xc779('0x40')]},'auth':_0x374459,'json':!![]};return rp(_0xf01bff)['then'](function(_0x50c8c3){_0x14c3d9();})[_0xc779('0x12')](function(){_0x14c3d9();});});}function manageTags(_0x5534c7,_0x3b8134,_0x5b7009,_0x6fbe25,_0x34eb4a,_0x44ddcd,_0x3f6f6e){return new Promise(function(_0x29c77b,_0x5a8b69){var _0x2b6667=[];_0x3b8134[_0xc779('0x2c')](function(_0xf4d1d4){_0x2b6667[_0xc779('0x48')](getRemoteTag(_0xf4d1d4,_0x5b7009,_0x6fbe25,_0x44ddcd,_0x3f6f6e));});return Promise[_0xc779('0x49')](_0x2b6667)['then'](function(_0x4ed8b1){if(_0x4ed8b1['length']){logger[_0xc779('0x14')]('['+[_0x5534c7['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x4ed8b1);var _0x3dcd77=[];_0x4ed8b1[_0xc779('0x2c')](function(_0x192a27){_0x3dcd77[_0xc779('0x48')](assignTagToIncident(_0x192a27,_0x5b7009,_0x6fbe25,_0x34eb4a,_0x44ddcd));});return Promise[_0xc779('0x49')](_0x3dcd77)[_0xc779('0xc')](function(){_0x29c77b();})[_0xc779('0x12')](function(){_0x29c77b();});}else{_0x29c77b();}});});}function getTags(_0x556ac5,_0x6c7040,_0x289c6e,_0x16e372,_0x188d81,_0x4c4ec9){return function(_0x26f13f){return new Promise(function(_0x4fd75b,_0x3da387){var _0x2340d6=[];var _0x53029d=_0x16e372['Tags'];if(_0x53029d&&_0x53029d[_0xc779('0x29')]>0x0){_0x2340d6=_[_0xc779('0x4a')](_0x53029d,_0xc779('0x3a'));}if(_0x2340d6[_0xc779('0x29')]>0x0){return manageTags(_0x556ac5,_0x2340d6,_0x6c7040,_0x289c6e,_0x26f13f,_0x188d81,_0x4c4ec9)[_0xc779('0xc')](function(){_0x4fd75b(_0x26f13f);});}else{_0x4fd75b(_0x26f13f);}});};}function emit(_0x12b855,_0x1f54b5,_0x5b6814){var _0x580acc=_0xc779('0x4b')+_0xc779('0x4c')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xc779('0x4d');var _0x277197={'uri':_0x12b855+_0xc779('0x4e')+_0x5b6814+_0x580acc};io['to'](util[_0xc779('0x4f')](_0xc779('0x50'),_0x1f54b5))['emit'](_0xc779('0x51'),_0x277197);}exports['cs']=function(_0x944184,_0x217034,_0x5d0023,_0x6334c3,_0x5b66d0,_0x2d8230,_0x4749ae,_0x21b68a){var _0x26fff9={};var _0x3a7984={'user':_0x2d8230['username'],'pass':_0x2d8230[_0xc779('0x52')]};var _0x241cbd=_0xc779('0x53');var _0x184095='sysparm_display_value=true';_0x2d8230[_0xc779('0x54')]=intUtil[_0xc779('0x55')](_0x2d8230[_0xc779('0x54')]);_0x2d8230[_0xc779('0x56')]=intUtil['stripTrailingSlash'](_0x2d8230[_0xc779('0x56')]);var _0x43eafa=util[_0xc779('0x4f')]('%s/api/now/table/',_0x2d8230['remoteUri']);_0x26fff9[_0xc779('0x17')]=!_[_0xc779('0x57')](_0x6334c3)?_0x6334c3['email']:null;_0x26fff9['adminEmail']=_0x2d8230[_0xc779('0x58')];_0x26fff9[_0xc779('0x24')]=_0x21b68a[_0xc779('0x30')]()===_0xc779('0x59')?_0x217034[_0xc779('0x5a')]:_0x217034[_0xc779('0x5b')];_0x26fff9[_0xc779('0x5c')]=_0x21b68a===_0xc779('0x5d')||_0x21b68a===_0xc779('0x5e')?_0xc779('0x5d'):_0xc779('0x59');var _0x15e628=util[_0xc779('0x4f')](_0xc779('0x5f'),_0x2d8230[_0xc779('0x56')],_0x217034[_0xc779('0x60')],md5(_0x217034[_0xc779('0x60')]));if(_0x5b66d0&&_0x5b66d0[_0xc779('0x61')]){logger[_0xc779('0x14')](_0xc779('0x62'),'Recording\x20is\x20enabled!');_0x217034[_0xc779('0x63')]=_0x15e628;}else if(_0x4749ae&&_0x4749ae[_0xc779('0x64')]&&_0x4749ae[_0xc779('0x64')]!=='none'){logger[_0xc779('0x14')](_0xc779('0x65'),_0xc779('0x66'));_0x217034[_0xc779('0x63')]=_0x15e628;}else{_0x217034['recordingURL']='';}return getAdminUser(_0x21b68a,_0x3a7984,_0x26fff9,_0x43eafa,_0x184095,_0x241cbd)['then'](getUser(_0x21b68a,_0x3a7984,_0x43eafa,_0x184095,_0x241cbd))[_0xc779('0xc')](getEndUser(_0x21b68a,_0x3a7984,_0x43eafa,_0x184095,_0x241cbd))[_0xc779('0xc')](getTicket(_0x21b68a,_0x3a7984,_0x43eafa,_0x5d0023,_0x217034,_0x184095))['then'](function(_0x3837ed){logger[_0xc779('0x14')](util[_0xc779('0x4f')](_0xc779('0x67'),_0x3837ed[_0xc779('0x3f')]));logger[_0xc779('0x14')](util['format']('call\x20direction:\x20%s',_0x21b68a));if(_0x21b68a!==_0xc779('0x5e')){logger[_0xc779('0x14')]('['+[_0x21b68a[_0xc779('0x10')]()]+']',_0xc779('0x68'));emit(_0x2d8230['remoteUri'],_0x6334c3['name'],_0x3837ed[_0xc779('0x3f')]);}})['catch'](function(_0x1bec20){logger['error']('['+[_0x21b68a[_0xc779('0x10')]()]+_0xc779('0x69'),util[_0xc779('0x6a')](_0x1bec20,{'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 35dbc20..e899f5a 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 _0x134e=['none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','users','contacts','[OUTBOUND]','trigger:browser:url','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','description','Descriptions','date_start','replace','duration_hours','parent_id','Contacts','parent_name','direction','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','entry_list','length','find','user_name','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','type','string','nameField','toLowerCase','content','idField','customField','custom_fields','variable','customVariable','Variable','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','then','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','recordingFormat'];(function(_0x54d36b,_0xddacb2){var _0x3e8888=function(_0x3ed64a){while(--_0x3ed64a){_0x54d36b['push'](_0x54d36b['shift']());}};_0x3e8888(++_0xddacb2);}(_0x134e,0xee));var _0xe134=function(_0x5b5883,_0x4e0955){_0x5b5883=_0x5b5883-0x0;var _0xd87444=_0x134e[_0x5b5883];return _0xd87444;};'use strict';var _=require(_0xe134('0x0'));var rp=require(_0xe134('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0xe134('0x2'));var Redis=require(_0xe134('0x3'));var intUtil=require(_0xe134('0x4'));var config=require(_0xe134('0x5'));var logger=require(_0xe134('0x6'))('sugarcrm');config['redis']=_[_0xe134('0x7')](config[_0xe134('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x59ced1,_0x4941d0,_0x3dad6c){io['to'](_0x59ced1)[_0xe134('0x9')](_0x4941d0,_0x3dad6c);}function getTicket(_0xb7c282,_0xc38c7c,_0x3db1b8,_0x5ecdd4,_0x2748f9,_0x239e1b,_0x1b57fc,_0x119670){logger[_0xe134('0xa')](_0xe134('0xb'));var _0x9bf196=new Date();var _0x11ef49=[{'name':'name','value':intUtil[_0xe134('0xc')](_0x5ecdd4[_0xe134('0xd')],_0x2748f9,'\x20')},{'name':_0xe134('0xe'),'value':_0xc38c7c['id']},{'name':'created_by','value':_0xc38c7c['id']},{'name':_0xe134('0xf'),'value':intUtil[_0xe134('0xc')](_0x5ecdd4[_0xe134('0x10')],_0x2748f9,'\x0a')},{'name':_0xe134('0x11'),'value':_0x9bf196['toISOString']()['slice'](0x0,0x13)[_0xe134('0x12')]('T','\x20')},{'name':_0xe134('0x13'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xe134('0x14'),'value':_0x3db1b8['id']},{'name':'parent_type','value':_0xe134('0x15')},{'name':_0xe134('0x16'),'value':_0x3db1b8['name']},{'name':_0xe134('0x17'),'value':_0x119670}];if(_0x239e1b['length']){_[_0xe134('0x18')](_0x239e1b,function(_0x13f343){if(_0x2748f9[_0x13f343[_0xe134('0x19')]]){_0x11ef49[_0xe134('0x1a')]({'name':_0x13f343['idField'],'value':_0x2748f9[_0x13f343[_0xe134('0x19')]]});}});}return request({'form':{'method':_0xe134('0x1b'),'input_type':_0xe134('0x1c'),'response_type':_0xe134('0x1c'),'rest_data':JSON[_0xe134('0x1d')]({'session':_0x1b57fc['id'],'module_name':_0xe134('0x1e'),'name_value_list':_0x11ef49})}});}function getAuth(_0x2176d4){return util[_0xe134('0x1f')](_0xe134('0x20'),new Buffer(_0x2176d4['apiKey']+':X')[_0xe134('0x21')]('base64'));}function getServerInfo(_0x1478c4){return request({'form':{'method':_0xe134('0x22'),'input_type':_0xe134('0x1c'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x1478c4['id']})}});}function getUser(_0x28f16c,_0x54c684,_0x53eddd){if(!_[_0xe134('0x23')](_0x54c684)){logger[_0xe134('0xa')](_0xe134('0x24'),_0x54c684);return request({'form':{'method':_0xe134('0x25'),'input_type':_0xe134('0x1c'),'response_type':_0xe134('0x1c'),'rest_data':JSON[_0xe134('0x1d')]({'session':_0x53eddd['id'],'module_name':'Employees','query':util[_0xe134('0x1f')](_0xe134('0x26'),_0x54c684),'order_by':'','offset':'0','select_fields':['id',_0xe134('0x27'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x44aad4){if(_0x44aad4[_0xe134('0x28')][_0xe134('0x29')]){var _0x197120=_[_0xe134('0x2a')](_0x44aad4[_0xe134('0x28')],function(_0x59a87f){return _0x59a87f['name_value_list'][_0xe134('0x2b')][_0xe134('0x2c')]===_0x54c684;});if(_0x197120){logger[_0xe134('0xa')](_0xe134('0x2d'));return BPromise[_0xe134('0x2e')]({'id':_0x197120['name_value_list']['id']['value'],'name':_0x197120['name_value_list'][_0xe134('0x27')][_0xe134('0x2c')]});}}logger[_0xe134('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x53eddd[_0xe134('0x2f')]['user_id'][_0xe134('0x2c')],'name':_0x53eddd['name_value_list'][_0xe134('0x2b')][_0xe134('0x2c')]});});}else{logger[_0xe134('0xa')](_0xe134('0x30'));return BPromise[_0xe134('0x2e')]({'id':_0x53eddd[_0xe134('0x2f')]['user_id'][_0xe134('0x2c')],'name':_0x53eddd[_0xe134('0x2f')][_0xe134('0x2b')][_0xe134('0x2c')]});}}function getEndUser(_0x51bc86,_0x45559e,_0x267c39,_0x42df69){logger['info']('Searching\x20enduser\x20with\x20phone',_0x267c39);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xe134('0x1c'),'rest_data':JSON[_0xe134('0x1d')]({'session':_0x42df69['id'],'module_name':_0xe134('0x15'),'query':util[_0xe134('0x1f')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x267c39),'order_by':'','offset':'0','select_fields':['id',_0xe134('0x27'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4cf240){if(_0x4cf240[_0xe134('0x28')][_0xe134('0x29')]){var _0x351489=_['find'](_0x4cf240['entry_list'],function(_0x1ac243){return _0x1ac243[_0xe134('0x2f')][_0xe134('0x31')][_0xe134('0x2c')]===_0x267c39;});if(_0x351489){logger['info'](_0xe134('0x32'));return BPromise[_0xe134('0x2e')]({'id':_0x351489[_0xe134('0x2f')]['id']['value'],'name':_0x351489['name_value_list']['name'][_0xe134('0x2c')],'phone':_0x351489[_0xe134('0x2f')][_0xe134('0x31')][_0xe134('0x2c')]});}}else{logger[_0xe134('0xa')](_0xe134('0x33'));return request({'form':{'method':_0xe134('0x1b'),'input_type':'JSON','response_type':_0xe134('0x1c'),'rest_data':JSON[_0xe134('0x1d')]({'session':_0x42df69['id'],'module_name':_0xe134('0x15'),'name_value_list':[{'name':_0xe134('0x34'),'value':_0x45559e!==_0xe134('0x35')?_0x45559e:util[_0xe134('0x1f')](_0xe134('0x36'),_0x267c39)},{'name':_0xe134('0x31'),'value':_0x267c39}]})}})['then'](function(_0x1577e6){logger['info'](_0xe134('0x37'));return BPromise[_0xe134('0x2e')]({'id':_0x1577e6['id'],'name':_0x1577e6[_0xe134('0x28')][_0xe134('0x34')][_0xe134('0x2c')],'phone':_0x1577e6[_0xe134('0x28')][_0xe134('0x31')][_0xe134('0x2c')]});});}});}function request(_0x13472f){logger[_0xe134('0x38')]('[HTTP]',JSON[_0xe134('0x1d')](_0x13472f));return rp(_[_0xe134('0x39')](def,_0x13472f));}function getTags(_0xd1ec5a,_0x5adabc){var _0x1c0811=[];if(_0xd1ec5a&&_0xd1ec5a[_0xe134('0x29')]>0x0){_0x1c0811=_['map'](_0xd1ec5a,_0x5adabc);}return _0x1c0811;}function getCustomFields(_0x1b13ee,_0x391b00){var _0x26b1ca=[];var _0x55e887={'custom_fields':[]};if(_0x1b13ee[_0xe134('0x29')]>0x0){_['forEach'](_0x1b13ee,function(_0x582c37){if(_0x582c37[_0xe134('0x3a')]===_0xe134('0x3b')&&_0x582c37[_0xe134('0x3c')]&&!_0x582c37['customField']){_0x55e887[_0x582c37[_0xe134('0x3c')][_0xe134('0x3d')]()]=_0x582c37[_0xe134('0x3e')][_0xe134('0x21')]();}else if(_0x582c37['type']===_0xe134('0x3b')&&_0x582c37[_0xe134('0x3f')]&&_0x582c37[_0xe134('0x40')]){_0x55e887[_0xe134('0x41')][_0xe134('0x1a')]({'id':_0x582c37[_0xe134('0x3f')],'value':_0x582c37[_0xe134('0x3e')][_0xe134('0x21')]()});}else if(_0x582c37[_0xe134('0x3a')]===_0xe134('0x42')&&_0x582c37[_0xe134('0x19')]&&_0x582c37['idField']&&_0x582c37[_0xe134('0x40')]){_0x391b00[_0x582c37['variableName']]&&_0x55e887[_0xe134('0x41')][_0xe134('0x1a')]({'id':_0x582c37['idField'],'value':_0x391b00[_0x582c37[_0xe134('0x19')]][_0xe134('0x21')]()});}else if(_0x582c37[_0xe134('0x3a')]===_0xe134('0x43')&&_0x582c37[_0xe134('0x44')]&&_0x582c37['Variable']['name']&&_0x582c37['idField']&&_0x582c37['customField']){_0x391b00[_0x582c37[_0xe134('0x44')]['name'][_0xe134('0x3d')]()]&&_0x55e887[_0xe134('0x41')]['push']({'id':_0x582c37[_0xe134('0x3f')],'value':_0x391b00[_0x582c37[_0xe134('0x44')]['name'][_0xe134('0x3d')]()]['toString']()});}});}return _0x55e887;}function getConnection(_0x2828a2){return request({'method':_0xe134('0x45'),'form':{'method':_0xe134('0x46'),'input_type':_0xe134('0x1c'),'response_type':_0xe134('0x1c'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2828a2[_0xe134('0x47')],'password':_0x2828a2[_0xe134('0x48')],'encryption':_0xe134('0x49')},'application':_0xe134('0x4a')})}})[_0xe134('0x4b')](function(_0x3c9c61){var _0x569737=_0x3c9c61;if(_0x569737['id']){def['sessionID']=_0x569737['id'];return BPromise[_0xe134('0x2e')](_0x569737);}else{throw new Error(util[_0xe134('0x1f')](_0xe134('0x4c'),_0x2828a2['id']));}});}function setRelationship(_0x4af06c,_0x31a46c,_0x6f3401,_0x533b5e){return request({'form':{'method':_0xe134('0x4d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xe134('0x1d')]({'session':_0x4af06c['id'],'module_name':_0xe134('0x1e'),'module_id':_0x6f3401['id'],'link_field_name':_0x533b5e,'related_ids':[_0x31a46c['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xe134('0x4e')]=function(_0x4a66e6,_0x6db8df,_0x222ed8,_0x7f7afa,_0x4f3878,_0x5cbc84){var _0x33596f,_0x254ff0,_0x388616,_0x58c386;_0x5cbc84[_0xe134('0x4f')]=intUtil[_0xe134('0x50')](_0x5cbc84['remoteUri']);_0x5cbc84['serverUrl']=intUtil[_0xe134('0x50')](_0x5cbc84[_0xe134('0x51')]);def[_0xe134('0x52')]=util[_0xe134('0x1f')](_0xe134('0x53'),_0x5cbc84['remoteUri']);if(_0x4f3878&&_0x4f3878[_0xe134('0x54')]){logger[_0xe134('0xa')](_0xe134('0x55'),_0xe134('0x56'));_0x6db8df[_0xe134('0x57')]=util[_0xe134('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5cbc84[_0xe134('0x51')],_0x6db8df[_0xe134('0x58')],md5(_0x6db8df[_0xe134('0x58')]));}else{_0x6db8df[_0xe134('0x57')]='';}return getConnection(_0x5cbc84)['then'](function(_0x4f61ea){_0x58c386=_0x4f61ea;return getUser(_0x5cbc84,_0x7f7afa['name'],_0x58c386);})[_0xe134('0x4b')](function(_0x974d7){_0x33596f=_0x974d7;logger[_0xe134('0xa')]('The\x20User\x20ID\x20is:',_0x33596f['id']);return getEndUser(_0x5cbc84,_0x6db8df[_0xe134('0x59')],_0x6db8df[_0xe134('0x5a')],_0x58c386);})[_0xe134('0x4b')](function(_0x9aac14){_0x254ff0=_0x9aac14;logger['info'](_0xe134('0x5b'),_0x254ff0['id']);return getTicket(_0x5cbc84,_0x33596f,_0x254ff0,_0x222ed8,_0x6db8df,_0x222ed8[_0xe134('0x5c')],_0x58c386,_0xe134('0x5d'));})['then'](function(_0x24f83d){_0x388616=_0x24f83d;logger[_0xe134('0xa')](_0xe134('0x5e'));logger[_0xe134('0xa')]('The\x20Ticket\x20ID\x20is:',_0x388616['id']);return setRelationship(_0x58c386,_0x33596f,_0x388616,'users');})[_0xe134('0x4b')](function(){return setRelationship(_0x58c386,_0x254ff0,_0x388616,'contacts');})[_0xe134('0x4b')](function(){return getServerInfo(_0x58c386);})[_0xe134('0x4b')](function(_0x2e8308){var _0x36da44=parseInt(_0x2e8308[_0xe134('0x5f')][_0xe134('0x60')](0x0));var _0x283964=util[_0xe134('0x1f')](_0xe134('0x61'),_0x5cbc84[_0xe134('0x4f')],_0x388616['id']);if(_0x36da44>0x6){_0x283964=util[_0xe134('0x1f')](_0xe134('0x62'),_0x5cbc84[_0xe134('0x4f')],_0x388616['id']);}logger[_0xe134('0xa')](_0xe134('0x55'),_0xe134('0x63'));emit(util[_0xe134('0x1f')](_0xe134('0x64'),_0x7f7afa[_0xe134('0x27')]),'trigger:browser:url',{'uri':_0x283964});})[_0xe134('0x65')](function(_0x2d1bdd){logger[_0xe134('0x66')]('[QUEUE]',JSON[_0xe134('0x1d')](_0x2d1bdd));});};exports['outbound']=function(_0x45120a,_0x1c9264,_0x373cd8,_0x47e3e0,_0x287bd9,_0x46348a,_0x126ec4){var _0x489ad4,_0x774dae,_0x46a4b4,_0x242434;_0x46348a['remoteUri']=intUtil['stripTrailingSlash'](_0x46348a[_0xe134('0x4f')]);_0x46348a[_0xe134('0x51')]=intUtil[_0xe134('0x50')](_0x46348a['serverUrl']);def[_0xe134('0x52')]=util[_0xe134('0x1f')](_0xe134('0x53'),_0x46348a[_0xe134('0x4f')]);if(_0x126ec4&&_0x126ec4[_0xe134('0x67')]&&_0x126ec4[_0xe134('0x67')]!==_0xe134('0x68')){logger[_0xe134('0xa')]('[OUTBOUND]',_0xe134('0x56'));_0x1c9264[_0xe134('0x57')]=util[_0xe134('0x1f')](_0xe134('0x69'),_0x46348a[_0xe134('0x51')],_0x1c9264[_0xe134('0x58')],md5(_0x1c9264[_0xe134('0x58')]));}return getConnection(_0x46348a)[_0xe134('0x4b')](function(_0x2b70c3){_0x242434=_0x2b70c3;return getUser(_0x46348a,_0x47e3e0[_0xe134('0x27')],_0x242434);})[_0xe134('0x4b')](function(_0x55dd56){_0x489ad4=_0x55dd56;logger['info'](_0xe134('0x6a'),_0x489ad4['id']);return getEndUser(_0x46348a,_0x1c9264['destcalleridname'],_0x1c9264['destcalleridnum'],_0x242434);})[_0xe134('0x4b')](function(_0x4125d4){_0x774dae=_0x4125d4;logger[_0xe134('0xa')]('The\x20Enduser\x20ID\x20is:',_0x774dae['id']);return getTicket(_0x46348a,_0x489ad4,_0x774dae,_0x373cd8,_0x1c9264,_0x373cd8[_0xe134('0x5c')],_0x242434,'Outbound');})[_0xe134('0x4b')](function(_0xc15da9){_0x46a4b4=_0xc15da9;logger[_0xe134('0xa')]('Ticket\x20created!');logger[_0xe134('0xa')]('The\x20Ticket\x20ID\x20is:',_0x46a4b4['id']);return setRelationship(_0x242434,_0x489ad4,_0x46a4b4,_0xe134('0x6b'));})[_0xe134('0x4b')](function(){return setRelationship(_0x242434,_0x774dae,_0x46a4b4,_0xe134('0x6c'));})['then'](function(){return getServerInfo(_0x242434);})[_0xe134('0x4b')](function(_0x4f300d){var _0xffda72=parseInt(_0x4f300d[_0xe134('0x5f')][_0xe134('0x60')](0x0));var _0x12ea78=util['format'](_0xe134('0x61'),_0x46348a['remoteUri'],_0x46a4b4['id']);if(_0xffda72>0x6){_0x12ea78=util[_0xe134('0x1f')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x46348a['remoteUri'],_0x46a4b4['id']);}logger[_0xe134('0xa')](_0xe134('0x6d'),_0xe134('0x63'));emit(util[_0xe134('0x1f')](_0xe134('0x64'),_0x47e3e0[_0xe134('0x27')]),_0xe134('0x6e'),{'uri':_0x12ea78});})['catch'](function(_0x484690){logger[_0xe134('0x66')](_0xe134('0x6d'),JSON['stringify'](_0x484690));});};exports['unmanaged']=function(_0x3966f0,_0x240e1b,_0x1914c0,_0x104a15,_0x308d32,_0x3b3d93){var _0x29ba9d,_0x15ccbf,_0x313c1d,_0x2067cf;_0x3b3d93[_0xe134('0x4f')]=intUtil[_0xe134('0x50')](_0x3b3d93[_0xe134('0x4f')]);_0x3b3d93['serverUrl']=intUtil[_0xe134('0x50')](_0x3b3d93[_0xe134('0x51')]);def[_0xe134('0x52')]=util[_0xe134('0x1f')](_0xe134('0x53'),_0x3b3d93[_0xe134('0x4f')]);if(_0x308d32&&_0x308d32[_0xe134('0x54')]){logger[_0xe134('0xa')]('['+_0x240e1b[_0xe134('0x6f')][_0xe134('0x70')]()+']',_0xe134('0x56'));_0x240e1b[_0xe134('0x57')]=util[_0xe134('0x1f')](_0xe134('0x69'),_0x3b3d93['serverUrl'],_0x240e1b[_0xe134('0x58')],md5(_0x240e1b['uniqueid']));}else{_0x240e1b[_0xe134('0x57')]='';}return getConnection(_0x3b3d93)[_0xe134('0x4b')](function(_0x188ae1){_0x2067cf=_0x188ae1;if(!_['isNil'](_0x104a15)){return getUser(_0x3b3d93,_0x104a15[_0xe134('0x27')],_0x2067cf);}else{return getUser(_0x3b3d93,null,_0x2067cf);}})[_0xe134('0x4b')](function(_0x4ba69a){_0x29ba9d=_0x4ba69a;logger[_0xe134('0xa')](_0xe134('0x6a'),_0x29ba9d['id']);return getEndUser(_0x3b3d93,_0x240e1b[_0xe134('0x59')],_0x240e1b[_0xe134('0x5a')],_0x2067cf);})['then'](function(_0x5cecf6){_0x15ccbf=_0x5cecf6;logger['info'](_0xe134('0x5b'),_0x15ccbf['id']);return getTicket(_0x3b3d93,_0x29ba9d,_0x15ccbf,_0x1914c0,_0x240e1b,_0x1914c0['Fields'],_0x2067cf,_0xe134('0x5d'));})[_0xe134('0x4b')](function(_0x2f55cb){_0x313c1d=_0x2f55cb;logger[_0xe134('0xa')](_0xe134('0x5e'));logger['info'](_0xe134('0x71'),_0x313c1d['id']);return setRelationship(_0x2067cf,_0x29ba9d,_0x313c1d,_0xe134('0x6b'));})[_0xe134('0x4b')](function(){return setRelationship(_0x2067cf,_0x15ccbf,_0x313c1d,_0xe134('0x6c'));})[_0xe134('0x4b')](function(){return getServerInfo(_0x2067cf);})[_0xe134('0x65')](function(_0x185bb2){logger[_0xe134('0x66')]('['+_0x240e1b[_0xe134('0x6f')][_0xe134('0x70')]()+']',JSON['stringify'](_0x185bb2));});}; \ No newline at end of file +var _0x35a0=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Ticket\x20created!','user:%s','error','unmanaged','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','push','variable','idField','custom_fields','Variable','login','password','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]'];(function(_0x367526,_0x8276a7){var _0x41047c=function(_0x32011a){while(--_0x32011a){_0x367526['push'](_0x367526['shift']());}};_0x41047c(++_0x8276a7);}(_0x35a0,0x10b));var _0x035a=function(_0x3745bc,_0x3935d8){_0x3745bc=_0x3745bc-0x0;var _0x2fad35=_0x35a0[_0x3745bc];return _0x2fad35;};'use strict';var _=require(_0x035a('0x0'));var rp=require(_0x035a('0x1'));var BPromise=require(_0x035a('0x2'));var md5=require(_0x035a('0x3'));var util=require(_0x035a('0x4'));var Redis=require(_0x035a('0x5'));var intUtil=require(_0x035a('0x6'));var config=require(_0x035a('0x7'));var logger=require('../../../../config/logger')(_0x035a('0x8'));config['redis']=_[_0x035a('0x9')](config[_0x035a('0xa')],{'host':_0x035a('0xb'),'port':0x18eb});var io=require(_0x035a('0xc'))(new Redis(config[_0x035a('0xa')]));var def={'method':_0x035a('0xd'),'json':!![]};function emit(_0x32ecbc,_0x2287bf,_0x3a81a1){io['to'](_0x32ecbc)['emit'](_0x2287bf,_0x3a81a1);}function getTicket(_0x342f97,_0x52222b,_0x2e2928,_0x47c355,_0x451805,_0xdd7d1,_0x5f447c,_0x4b285e){logger[_0x035a('0xe')](_0x035a('0xf'));var _0x44a069=new Date();var _0x56ed5a=[{'name':_0x035a('0x10'),'value':intUtil[_0x035a('0x11')](_0x47c355['Subjects'],_0x451805,'\x20')},{'name':_0x035a('0x12'),'value':_0x52222b['id']},{'name':_0x035a('0x13'),'value':_0x52222b['id']},{'name':_0x035a('0x14'),'value':intUtil['getString'](_0x47c355[_0x035a('0x15')],_0x451805,'\x0a')},{'name':_0x035a('0x16'),'value':_0x44a069[_0x035a('0x17')]()[_0x035a('0x18')](0x0,0x13)[_0x035a('0x19')]('T','\x20')},{'name':_0x035a('0x1a'),'value':'0'},{'name':_0x035a('0x1b'),'value':'15'},{'name':_0x035a('0x1c'),'value':_0x2e2928['id']},{'name':_0x035a('0x1d'),'value':_0x035a('0x1e')},{'name':_0x035a('0x1f'),'value':_0x2e2928[_0x035a('0x10')]},{'name':_0x035a('0x20'),'value':_0x4b285e}];if(_0xdd7d1[_0x035a('0x21')]){_[_0x035a('0x22')](_0xdd7d1,function(_0x4650a7){if(_0x451805[_0x4650a7['variableName']]){_0x56ed5a['push']({'name':_0x4650a7['idField'],'value':_0x451805[_0x4650a7[_0x035a('0x23')]]});}});}return request({'form':{'method':_0x035a('0x24'),'input_type':'JSON','response_type':_0x035a('0x25'),'rest_data':JSON[_0x035a('0x26')]({'session':_0x5f447c['id'],'module_name':_0x035a('0x27'),'name_value_list':_0x56ed5a})}});}function getAuth(_0x2f4cdc){return util[_0x035a('0x28')](_0x035a('0x29'),new Buffer(_0x2f4cdc[_0x035a('0x2a')]+':X')[_0x035a('0x2b')](_0x035a('0x2c')));}function getServerInfo(_0x82eb57){return request({'form':{'method':_0x035a('0x2d'),'input_type':_0x035a('0x25'),'response_type':_0x035a('0x25'),'rest_data':JSON['stringify']({'session':_0x82eb57['id']})}});}function getUser(_0x398fe6,_0x3fc516,_0x11668c){if(!_[_0x035a('0x2e')](_0x3fc516)){logger[_0x035a('0xe')](_0x035a('0x2f'),_0x3fc516);return request({'form':{'method':_0x035a('0x30'),'input_type':_0x035a('0x25'),'response_type':_0x035a('0x25'),'rest_data':JSON[_0x035a('0x26')]({'session':_0x11668c['id'],'module_name':'Employees','query':util['format'](_0x035a('0x31'),_0x3fc516),'order_by':'','offset':'0','select_fields':['id',_0x035a('0x10'),_0x035a('0x32')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x035a('0x33')](function(_0x5ebf06){if(_0x5ebf06['entry_list'][_0x035a('0x21')]){var _0x23483c=_[_0x035a('0x34')](_0x5ebf06[_0x035a('0x35')],function(_0x14c704){return _0x14c704[_0x035a('0x36')][_0x035a('0x32')][_0x035a('0x37')]===_0x3fc516;});if(_0x23483c){logger[_0x035a('0xe')](_0x035a('0x38'));return BPromise['resolve']({'id':_0x23483c[_0x035a('0x36')]['id'][_0x035a('0x37')],'name':_0x23483c['name_value_list'][_0x035a('0x10')][_0x035a('0x37')]});}}logger[_0x035a('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x035a('0x39')]({'id':_0x11668c[_0x035a('0x36')]['user_id']['value'],'name':_0x11668c[_0x035a('0x36')]['user_name'][_0x035a('0x37')]});});}else{logger[_0x035a('0xe')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x035a('0x39')]({'id':_0x11668c[_0x035a('0x36')][_0x035a('0x3a')]['value'],'name':_0x11668c[_0x035a('0x36')]['user_name'][_0x035a('0x37')]});}}function getEndUser(_0x38f4a2,_0x38237e,_0x2f8f28,_0x30b4b0){logger[_0x035a('0xe')]('Searching\x20enduser\x20with\x20phone',_0x2f8f28);return request({'form':{'method':_0x035a('0x30'),'input_type':'JSON','response_type':_0x035a('0x25'),'rest_data':JSON[_0x035a('0x26')]({'session':_0x30b4b0['id'],'module_name':'Contacts','query':util[_0x035a('0x28')](_0x035a('0x3b'),_0x2f8f28),'order_by':'','offset':'0','select_fields':['id','name',_0x035a('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x035a('0x33')](function(_0x1e9d98){if(_0x1e9d98[_0x035a('0x35')][_0x035a('0x21')]){var _0x534a73=_[_0x035a('0x34')](_0x1e9d98[_0x035a('0x35')],function(_0x1aa46c){return _0x1aa46c[_0x035a('0x36')][_0x035a('0x3c')][_0x035a('0x37')]===_0x2f8f28;});if(_0x534a73){logger['info']('Enduser\x20found!');return BPromise[_0x035a('0x39')]({'id':_0x534a73[_0x035a('0x36')]['id']['value'],'name':_0x534a73[_0x035a('0x36')][_0x035a('0x10')]['value'],'phone':_0x534a73[_0x035a('0x36')][_0x035a('0x3c')][_0x035a('0x37')]});}}else{logger[_0x035a('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x035a('0x24'),'input_type':_0x035a('0x25'),'response_type':_0x035a('0x25'),'rest_data':JSON[_0x035a('0x26')]({'session':_0x30b4b0['id'],'module_name':_0x035a('0x1e'),'name_value_list':[{'name':'first_name','value':_0x38237e!==_0x035a('0x3d')?_0x38237e:util['format'](_0x035a('0x3e'),_0x2f8f28)},{'name':'phone_home','value':_0x2f8f28}]})}})[_0x035a('0x33')](function(_0x590976){logger['info'](_0x035a('0x3f'));return BPromise[_0x035a('0x39')]({'id':_0x590976['id'],'name':_0x590976[_0x035a('0x35')][_0x035a('0x40')][_0x035a('0x37')],'phone':_0x590976[_0x035a('0x35')][_0x035a('0x3c')][_0x035a('0x37')]});});}});}function request(_0x7131c0){logger[_0x035a('0x41')](_0x035a('0x42'),JSON['stringify'](_0x7131c0));return rp(_[_0x035a('0x43')](def,_0x7131c0));}function getTags(_0x1dfdfa,_0x191ef0){var _0x3d1423=[];if(_0x1dfdfa&&_0x1dfdfa[_0x035a('0x21')]>0x0){_0x3d1423=_[_0x035a('0x44')](_0x1dfdfa,_0x191ef0);}return _0x3d1423;}function getCustomFields(_0x30f5df,_0x404cb4){var _0x6a86db=[];var _0x11d494={'custom_fields':[]};if(_0x30f5df[_0x035a('0x21')]>0x0){_['forEach'](_0x30f5df,function(_0x16e3fa){if(_0x16e3fa[_0x035a('0x45')]===_0x035a('0x46')&&_0x16e3fa[_0x035a('0x47')]&&!_0x16e3fa[_0x035a('0x48')]){_0x11d494[_0x16e3fa[_0x035a('0x47')][_0x035a('0x49')]()]=_0x16e3fa[_0x035a('0x4a')][_0x035a('0x2b')]();}else if(_0x16e3fa['type']===_0x035a('0x46')&&_0x16e3fa['idField']&&_0x16e3fa[_0x035a('0x48')]){_0x11d494['custom_fields'][_0x035a('0x4b')]({'id':_0x16e3fa['idField'],'value':_0x16e3fa[_0x035a('0x4a')][_0x035a('0x2b')]()});}else if(_0x16e3fa[_0x035a('0x45')]===_0x035a('0x4c')&&_0x16e3fa['variableName']&&_0x16e3fa[_0x035a('0x4d')]&&_0x16e3fa[_0x035a('0x48')]){_0x404cb4[_0x16e3fa[_0x035a('0x23')]]&&_0x11d494[_0x035a('0x4e')][_0x035a('0x4b')]({'id':_0x16e3fa[_0x035a('0x4d')],'value':_0x404cb4[_0x16e3fa[_0x035a('0x23')]][_0x035a('0x2b')]()});}else if(_0x16e3fa[_0x035a('0x45')]==='customVariable'&&_0x16e3fa['Variable']&&_0x16e3fa[_0x035a('0x4f')]['name']&&_0x16e3fa[_0x035a('0x4d')]&&_0x16e3fa['customField']){_0x404cb4[_0x16e3fa[_0x035a('0x4f')][_0x035a('0x10')]['toLowerCase']()]&&_0x11d494[_0x035a('0x4e')]['push']({'id':_0x16e3fa[_0x035a('0x4d')],'value':_0x404cb4[_0x16e3fa[_0x035a('0x4f')][_0x035a('0x10')][_0x035a('0x49')]()][_0x035a('0x2b')]()});}});}return _0x11d494;}function getConnection(_0x2006d8){return request({'method':'POST','form':{'method':_0x035a('0x50'),'input_type':'JSON','response_type':_0x035a('0x25'),'rest_data':JSON[_0x035a('0x26')]({'user_auth':{'user_name':_0x2006d8['username'],'password':_0x2006d8[_0x035a('0x51')],'encryption':'PLAIN'},'application':_0x035a('0x52')})}})[_0x035a('0x33')](function(_0x50b780){var _0x5579bd=_0x50b780;if(_0x5579bd['id']){def['sessionID']=_0x5579bd['id'];return BPromise[_0x035a('0x39')](_0x5579bd);}else{throw new Error(util[_0x035a('0x28')](_0x035a('0x53'),_0x2006d8['id']));}});}function setRelationship(_0x401063,_0x45696d,_0x207321,_0x209e6){return request({'form':{'method':_0x035a('0x54'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x401063['id'],'module_name':_0x035a('0x27'),'module_id':_0x207321['id'],'link_field_name':_0x209e6,'related_ids':[_0x45696d['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x035a('0x55')]=function(_0x597ae7,_0x1b3705,_0x162319,_0xc34562,_0x24eff8,_0x4390b0){var _0x1383e8,_0x2cafca,_0x372c3a,_0x117b67;_0x4390b0['remoteUri']=intUtil[_0x035a('0x56')](_0x4390b0[_0x035a('0x57')]);_0x4390b0[_0x035a('0x58')]=intUtil['stripTrailingSlash'](_0x4390b0[_0x035a('0x58')]);def[_0x035a('0x59')]=util['format'](_0x035a('0x5a'),_0x4390b0[_0x035a('0x57')]);if(_0x24eff8&&_0x24eff8[_0x035a('0x5b')]){logger['info']('[QUEUE]',_0x035a('0x5c'));_0x1b3705[_0x035a('0x5d')]=util[_0x035a('0x28')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4390b0['serverUrl'],_0x1b3705[_0x035a('0x5e')],md5(_0x1b3705[_0x035a('0x5e')]));}else{_0x1b3705[_0x035a('0x5d')]='';}return getConnection(_0x4390b0)[_0x035a('0x33')](function(_0x116484){_0x117b67=_0x116484;return getUser(_0x4390b0,_0xc34562[_0x035a('0x10')],_0x117b67);})[_0x035a('0x33')](function(_0x5aaea5){_0x1383e8=_0x5aaea5;logger[_0x035a('0xe')](_0x035a('0x5f'),_0x1383e8['id']);return getEndUser(_0x4390b0,_0x1b3705[_0x035a('0x60')],_0x1b3705[_0x035a('0x61')],_0x117b67);})['then'](function(_0xd09ae8){_0x2cafca=_0xd09ae8;logger[_0x035a('0xe')](_0x035a('0x62'),_0x2cafca['id']);return getTicket(_0x4390b0,_0x1383e8,_0x2cafca,_0x162319,_0x1b3705,_0x162319[_0x035a('0x63')],_0x117b67,_0x035a('0x64'));})[_0x035a('0x33')](function(_0x3a8089){_0x372c3a=_0x3a8089;logger[_0x035a('0xe')]('Ticket\x20created!');logger[_0x035a('0xe')]('The\x20Ticket\x20ID\x20is:',_0x372c3a['id']);return setRelationship(_0x117b67,_0x1383e8,_0x372c3a,_0x035a('0x65'));})[_0x035a('0x33')](function(){return setRelationship(_0x117b67,_0x2cafca,_0x372c3a,_0x035a('0x66'));})[_0x035a('0x33')](function(){return getServerInfo(_0x117b67);})[_0x035a('0x33')](function(_0x27d0b0){var _0x5d245f=parseInt(_0x27d0b0[_0x035a('0x67')][_0x035a('0x68')](0x0));var _0x2ebd6e=util[_0x035a('0x28')](_0x035a('0x69'),_0x4390b0[_0x035a('0x57')],_0x372c3a['id']);if(_0x5d245f>0x6){_0x2ebd6e=util['format'](_0x035a('0x6a'),_0x4390b0[_0x035a('0x57')],_0x372c3a['id']);}logger[_0x035a('0xe')](_0x035a('0x6b'),_0x035a('0x6c'));emit(util['format']('user:%s',_0xc34562[_0x035a('0x10')]),_0x035a('0x6d'),{'uri':_0x2ebd6e});})[_0x035a('0x6e')](function(_0x229f68){logger['error'](_0x035a('0x6b'),JSON[_0x035a('0x26')](_0x229f68));});};exports[_0x035a('0x6f')]=function(_0x598f65,_0x1143e2,_0x227b0f,_0xeabc7f,_0x570c63,_0x2e5a63,_0x3e5ecf){var _0x1c40cd,_0x4f6442,_0x40ce6c,_0x43e5d3;_0x2e5a63[_0x035a('0x57')]=intUtil['stripTrailingSlash'](_0x2e5a63[_0x035a('0x57')]);_0x2e5a63['serverUrl']=intUtil[_0x035a('0x56')](_0x2e5a63[_0x035a('0x58')]);def['uri']=util[_0x035a('0x28')]('%s/service/v4_1/rest.php',_0x2e5a63[_0x035a('0x57')]);if(_0x3e5ecf&&_0x3e5ecf['recordingFormat']&&_0x3e5ecf[_0x035a('0x70')]!==_0x035a('0x71')){logger[_0x035a('0xe')](_0x035a('0x72'),_0x035a('0x5c'));_0x1143e2[_0x035a('0x5d')]=util[_0x035a('0x28')](_0x035a('0x73'),_0x2e5a63['serverUrl'],_0x1143e2[_0x035a('0x5e')],md5(_0x1143e2[_0x035a('0x5e')]));}return getConnection(_0x2e5a63)['then'](function(_0x45477b){_0x43e5d3=_0x45477b;return getUser(_0x2e5a63,_0xeabc7f[_0x035a('0x10')],_0x43e5d3);})[_0x035a('0x33')](function(_0x3e9612){_0x1c40cd=_0x3e9612;logger[_0x035a('0xe')]('The\x20User\x20ID\x20is:',_0x1c40cd['id']);return getEndUser(_0x2e5a63,_0x1143e2[_0x035a('0x74')],_0x1143e2[_0x035a('0x75')],_0x43e5d3);})['then'](function(_0x18f429){_0x4f6442=_0x18f429;logger['info'](_0x035a('0x62'),_0x4f6442['id']);return getTicket(_0x2e5a63,_0x1c40cd,_0x4f6442,_0x227b0f,_0x1143e2,_0x227b0f[_0x035a('0x63')],_0x43e5d3,'Outbound');})[_0x035a('0x33')](function(_0x327eaf){_0x40ce6c=_0x327eaf;logger['info'](_0x035a('0x76'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x40ce6c['id']);return setRelationship(_0x43e5d3,_0x1c40cd,_0x40ce6c,_0x035a('0x65'));})['then'](function(){return setRelationship(_0x43e5d3,_0x4f6442,_0x40ce6c,'contacts');})[_0x035a('0x33')](function(){return getServerInfo(_0x43e5d3);})[_0x035a('0x33')](function(_0x3f03e9){var _0x27e50d=parseInt(_0x3f03e9[_0x035a('0x67')]['charAt'](0x0));var _0x160a85=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2e5a63['remoteUri'],_0x40ce6c['id']);if(_0x27e50d>0x6){_0x160a85=util[_0x035a('0x28')](_0x035a('0x6a'),_0x2e5a63[_0x035a('0x57')],_0x40ce6c['id']);}logger[_0x035a('0xe')](_0x035a('0x72'),_0x035a('0x6c'));emit(util[_0x035a('0x28')](_0x035a('0x77'),_0xeabc7f[_0x035a('0x10')]),'trigger:browser:url',{'uri':_0x160a85});})['catch'](function(_0x1dce00){logger[_0x035a('0x78')](_0x035a('0x72'),JSON[_0x035a('0x26')](_0x1dce00));});};exports[_0x035a('0x79')]=function(_0x422d42,_0x1aa636,_0x1416e0,_0x4da2b4,_0x453b83,_0x2aaa65){var _0x7ffc5f,_0x38dba9,_0x1a07f3,_0x4e49d7;_0x2aaa65[_0x035a('0x57')]=intUtil[_0x035a('0x56')](_0x2aaa65[_0x035a('0x57')]);_0x2aaa65[_0x035a('0x58')]=intUtil[_0x035a('0x56')](_0x2aaa65['serverUrl']);def[_0x035a('0x59')]=util[_0x035a('0x28')](_0x035a('0x5a'),_0x2aaa65[_0x035a('0x57')]);if(_0x453b83&&_0x453b83['monitor_format']){logger['info']('['+_0x1aa636[_0x035a('0x7a')]['toUpperCase']()+']',_0x035a('0x5c'));_0x1aa636[_0x035a('0x5d')]=util[_0x035a('0x28')](_0x035a('0x73'),_0x2aaa65[_0x035a('0x58')],_0x1aa636[_0x035a('0x5e')],md5(_0x1aa636[_0x035a('0x5e')]));}else{_0x1aa636['recordingURL']='';}return getConnection(_0x2aaa65)[_0x035a('0x33')](function(_0x14ae03){_0x4e49d7=_0x14ae03;if(!_[_0x035a('0x2e')](_0x4da2b4)){return getUser(_0x2aaa65,_0x4da2b4[_0x035a('0x10')],_0x4e49d7);}else{return getUser(_0x2aaa65,null,_0x4e49d7);}})[_0x035a('0x33')](function(_0x52cbae){_0x7ffc5f=_0x52cbae;logger[_0x035a('0xe')](_0x035a('0x5f'),_0x7ffc5f['id']);return getEndUser(_0x2aaa65,_0x1aa636[_0x035a('0x60')],_0x1aa636[_0x035a('0x61')],_0x4e49d7);})['then'](function(_0x7f7752){_0x38dba9=_0x7f7752;logger[_0x035a('0xe')](_0x035a('0x62'),_0x38dba9['id']);return getTicket(_0x2aaa65,_0x7ffc5f,_0x38dba9,_0x1416e0,_0x1aa636,_0x1416e0[_0x035a('0x63')],_0x4e49d7,_0x035a('0x64'));})['then'](function(_0x120c9a){_0x1a07f3=_0x120c9a;logger['info']('Ticket\x20created!');logger[_0x035a('0xe')](_0x035a('0x7b'),_0x1a07f3['id']);return setRelationship(_0x4e49d7,_0x7ffc5f,_0x1a07f3,_0x035a('0x65'));})['then'](function(){return setRelationship(_0x4e49d7,_0x38dba9,_0x1a07f3,_0x035a('0x66'));})[_0x035a('0x33')](function(){return getServerInfo(_0x4e49d7);})[_0x035a('0x6e')](function(_0x119f5c){logger['error']('['+_0x1aa636[_0x035a('0x7a')][_0x035a('0x7c')]()+']',JSON[_0x035a('0x26')](_0x119f5c));});}; \ 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 da63d9c..152c33b 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 _0xadbe=['isNil','test','lodash','util','getString','length','type','content','variable','variableName','customVariable','Variable','name','toLowerCase','push','toString','keyValue','string','key','format','%s:\x20%s','keyContent','keyType','slice','lastIndexOf','validateEmail'];(function(_0xfba8b6,_0x154c72){var _0x386330=function(_0x2eb89c){while(--_0x2eb89c){_0xfba8b6['push'](_0xfba8b6['shift']());}};_0x386330(++_0x154c72);}(_0xadbe,0x13a));var _0xeadb=function(_0x59d438,_0x49e538){_0x59d438=_0x59d438-0x0;var _0x4cde6b=_0xadbe[_0x59d438];return _0x4cde6b;};'use strict';var _=require(_0xeadb('0x0'));var util=require(_0xeadb('0x1'));exports[_0xeadb('0x2')]=function(_0x52ff23,_0x303c28,_0x1249fc){var _0x38f129=[];if(_0x52ff23[_0xeadb('0x3')]>0x0){var _0x1109d0=_['sortBy'](_0x52ff23,['id']);for(var _0x5af1ac=0x0;_0x5af1ac<_0x1109d0[_0xeadb('0x3')];_0x5af1ac++){var _0x1bd77a=_0x1109d0[_0x5af1ac];if(_0x1bd77a[_0xeadb('0x4')]==='string'){_0x38f129['push'](_0x1bd77a[_0xeadb('0x5')]);}else if(_0x1bd77a[_0xeadb('0x4')]===_0xeadb('0x6')&&_0x1bd77a[_0xeadb('0x7')]){_0x303c28[_0x1bd77a['variableName']]&&_0x38f129['push'](_0x303c28[_0x1bd77a[_0xeadb('0x7')]]['toString']());}else if(_0x1bd77a['type']===_0xeadb('0x8')&&_0x1bd77a[_0xeadb('0x9')]&&_0x1bd77a[_0xeadb('0x9')][_0xeadb('0xa')]){_0x303c28[_0x1bd77a[_0xeadb('0x9')][_0xeadb('0xa')][_0xeadb('0xb')]()]&&_0x38f129[_0xeadb('0xc')](_0x303c28[_0x1bd77a['Variable']['name'][_0xeadb('0xb')]()][_0xeadb('0xd')]());}else if(_0x1bd77a[_0xeadb('0x4')]===_0xeadb('0xe')){if(_0x1bd77a['keyType']===_0xeadb('0xf')&&_0x1bd77a[_0xeadb('0x10')]){_0x38f129['push'](util[_0xeadb('0x11')](_0xeadb('0x12'),_0x1bd77a[_0xeadb('0x10')],_0x1bd77a[_0xeadb('0x13')]));}else if(_0x1bd77a[_0xeadb('0x14')]===_0xeadb('0x6')&&_0x1bd77a[_0xeadb('0x7')]&&_0x1bd77a[_0xeadb('0x10')]){_0x303c28[_0x1bd77a[_0xeadb('0x7')]]&&_0x38f129[_0xeadb('0xc')](util[_0xeadb('0x11')](_0xeadb('0x12'),_0x1bd77a[_0xeadb('0x10')],_0x303c28[_0x1bd77a['variableName']]));}else if(_0x1bd77a[_0xeadb('0x14')]===_0xeadb('0x8')&&_0x1bd77a[_0xeadb('0x9')]&&_0x1bd77a[_0xeadb('0x9')][_0xeadb('0xa')]&&_0x1bd77a[_0xeadb('0x10')]){_0x303c28[_0x1bd77a[_0xeadb('0x9')][_0xeadb('0xa')][_0xeadb('0xb')]()]&&_0x38f129[_0xeadb('0xc')](util[_0xeadb('0x11')](_0xeadb('0x12'),_0x1bd77a['key'],_0x303c28[_0x1bd77a[_0xeadb('0x9')][_0xeadb('0xa')]['toLowerCase']()]));}}}}return _0x38f129['join'](_0x1249fc);};exports['stripTrailingSlash']=function(_0xe1ff6c){var _0x3f28b3=_0xe1ff6c[_0xeadb('0x15')](-0x1);if(_0x3f28b3==='/'){_0xe1ff6c=_0xe1ff6c['substring'](0x0,_0xe1ff6c[_0xeadb('0x16')](_0x3f28b3));}return _0xe1ff6c;};exports[_0xeadb('0x17')]=function(_0x3ef33e){if(!_[_0xeadb('0x18')](_0x3ef33e)&&_0x3ef33e!==''){var _0x3b99da=/^(([^<>()\[\]\\.,;:\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 _0x3b99da[_0xeadb('0x19')](String(_0x3ef33e)[_0xeadb('0xb')]());}else{return![];}}; \ No newline at end of file +var _0xdd21=['length','type','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','key','%s:\x20%s','keyContent','format','join','stripTrailingSlash','lastIndexOf','test','lodash','util','getString','sortBy'];(function(_0x3897db,_0x397ce3){var _0x1c7411=function(_0x418df5){while(--_0x418df5){_0x3897db['push'](_0x3897db['shift']());}};_0x1c7411(++_0x397ce3);}(_0xdd21,0x128));var _0x1dd2=function(_0x48aba0,_0x42eda9){_0x48aba0=_0x48aba0-0x0;var _0x25546a=_0xdd21[_0x48aba0];return _0x25546a;};'use strict';var _=require(_0x1dd2('0x0'));var util=require(_0x1dd2('0x1'));exports[_0x1dd2('0x2')]=function(_0x56ed73,_0x1a583b,_0x19665d){var _0x4e6fac=[];if(_0x56ed73['length']>0x0){var _0x56992e=_[_0x1dd2('0x3')](_0x56ed73,['id']);for(var _0xa6a769=0x0;_0xa6a769<_0x56992e[_0x1dd2('0x4')];_0xa6a769++){var _0x3ae1c7=_0x56992e[_0xa6a769];if(_0x3ae1c7[_0x1dd2('0x5')]==='string'){_0x4e6fac[_0x1dd2('0x6')](_0x3ae1c7[_0x1dd2('0x7')]);}else if(_0x3ae1c7[_0x1dd2('0x5')]===_0x1dd2('0x8')&&_0x3ae1c7['variableName']){_0x1a583b[_0x3ae1c7[_0x1dd2('0x9')]]&&_0x4e6fac['push'](_0x1a583b[_0x3ae1c7[_0x1dd2('0x9')]]['toString']());}else if(_0x3ae1c7[_0x1dd2('0x5')]===_0x1dd2('0xa')&&_0x3ae1c7[_0x1dd2('0xb')]&&_0x3ae1c7[_0x1dd2('0xb')]['name']){_0x1a583b[_0x3ae1c7['Variable'][_0x1dd2('0xc')][_0x1dd2('0xd')]()]&&_0x4e6fac[_0x1dd2('0x6')](_0x1a583b[_0x3ae1c7[_0x1dd2('0xb')][_0x1dd2('0xc')][_0x1dd2('0xd')]()]['toString']());}else if(_0x3ae1c7[_0x1dd2('0x5')]===_0x1dd2('0xe')){if(_0x3ae1c7[_0x1dd2('0xf')]===_0x1dd2('0x10')&&_0x3ae1c7[_0x1dd2('0x11')]){_0x4e6fac[_0x1dd2('0x6')](util['format'](_0x1dd2('0x12'),_0x3ae1c7['key'],_0x3ae1c7[_0x1dd2('0x13')]));}else if(_0x3ae1c7[_0x1dd2('0xf')]==='variable'&&_0x3ae1c7['variableName']&&_0x3ae1c7[_0x1dd2('0x11')]){_0x1a583b[_0x3ae1c7[_0x1dd2('0x9')]]&&_0x4e6fac[_0x1dd2('0x6')](util['format'](_0x1dd2('0x12'),_0x3ae1c7['key'],_0x1a583b[_0x3ae1c7['variableName']]));}else if(_0x3ae1c7['keyType']===_0x1dd2('0xa')&&_0x3ae1c7[_0x1dd2('0xb')]&&_0x3ae1c7[_0x1dd2('0xb')][_0x1dd2('0xc')]&&_0x3ae1c7['key']){_0x1a583b[_0x3ae1c7[_0x1dd2('0xb')][_0x1dd2('0xc')][_0x1dd2('0xd')]()]&&_0x4e6fac['push'](util[_0x1dd2('0x14')](_0x1dd2('0x12'),_0x3ae1c7['key'],_0x1a583b[_0x3ae1c7[_0x1dd2('0xb')]['name'][_0x1dd2('0xd')]()]));}}}}return _0x4e6fac[_0x1dd2('0x15')](_0x19665d);};exports[_0x1dd2('0x16')]=function(_0x1e312c){var _0x43e894=_0x1e312c['slice'](-0x1);if(_0x43e894==='/'){_0x1e312c=_0x1e312c['substring'](0x0,_0x1e312c[_0x1dd2('0x17')](_0x43e894));}return _0x1e312c;};exports['validateEmail']=function(_0x1baef6){if(!_['isNil'](_0x1baef6)&&_0x1baef6!==''){var _0x170264=/^(([^<>()\[\]\\.,;:\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 _0x170264[_0x1dd2('0x18')](String(_0x1baef6)[_0x1dd2('0xd')]());}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 983813f..5174805 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x12ba0c,_0x15d6e9){var _0x402cbe=function(_0x235661){while(--_0x235661){_0x12ba0c['push'](_0x12ba0c['shift']());}};_0x402cbe(++_0x15d6e9);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x5d001c,_0x165b27){var _0x118c4b=function(_0x3996d7){while(--_0x3996d7){_0x5d001c['push'](_0x5d001c['shift']());}};_0x118c4b(++_0x165b27);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index e3e4a8f..a2de761 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 _0x80cc=['uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','[OUTBOUND]','recordingURL','The\x20Enduser\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','trigger:browser:url','error','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','catch','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','info','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','results','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','authType','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','base64','GET','map','forEach','includes','string','type','nameField','customField','toLowerCase','content','picklist','idField','variableName','custom_fields','push','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x548f2f,_0x43cc68){var _0x497c2b=function(_0x2fda8b){while(--_0x2fda8b){_0x548f2f['push'](_0x548f2f['shift']());}};_0x497c2b(++_0x43cc68);}(_0x80cc,0x15a));var _0xc80c=function(_0x4d750e,_0x35fb00){_0x4d750e=_0x4d750e-0x0;var _0x1a1e3f=_0x80cc[_0x4d750e];return _0x1a1e3f;};'use strict';var _=require(_0xc80c('0x0'));var rp=require(_0xc80c('0x1'));var md5=require(_0xc80c('0x2'));var util=require(_0xc80c('0x3'));var Redis=require(_0xc80c('0x4'));var intUtil=require(_0xc80c('0x5'));var config=require(_0xc80c('0x6'));var logger=require(_0xc80c('0x7'))(_0xc80c('0x8'));config[_0xc80c('0x9')]=_[_0xc80c('0xa')](config['redis'],{'host':_0xc80c('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc80c('0x9')]));function emit(_0xf4fdda,_0x543110,_0x5b6e66){io['to'](_0xf4fdda)[_0xc80c('0xc')](_0x543110,_0x5b6e66);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x2bad82,_0x5ef639,_0x2b9d73,_0x5bdfa6,_0x2447bd){logger[_0xc80c('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xc80c('0xe')](_0xc80c('0xf'),_0x2bad82[_0xc80c('0x10')]),'method':_0xc80c('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x2b9d73['id'],'submitter_id':_0x5ef639?_0x5ef639['id']:undefined,'assignee_id':_0x5ef639?_0x5ef639['id']:undefined,'tags':getTags(_0x5bdfa6[_0xc80c('0x12')],_0xc80c('0x13')),'subject':intUtil[_0xc80c('0x14')](_0x5bdfa6[_0xc80c('0x15')],_0x2447bd,'\x20'),'description':intUtil[_0xc80c('0x14')](_0x5bdfa6[_0xc80c('0x16')],_0x2447bd,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc80c('0x14')](_0x5bdfa6['Descriptions'],_0x2447bd,'\x0a')}},getCustomFields(_0x5bdfa6[_0xc80c('0x17')],_0x2447bd))}})[_0xc80c('0x18')](function(_0x73e79b){logger[_0xc80c('0xd')](_0xc80c('0x19'));return _0x73e79b[_0xc80c('0x1a')];});}function getUser(_0x2cfd7e,_0x5bb1f8){if(intUtil['validateEmail'](_0x5bb1f8)){logger[_0xc80c('0xd')]('Getting\x20agent\x20with\x20email',_0x5bb1f8);return request({'uri':util[_0xc80c('0xe')](_0xc80c('0x1b'),_0x2cfd7e[_0xc80c('0x10')]),'qs':{'query':util[_0xc80c('0xe')](_0xc80c('0x1c'),_0x5bb1f8)}})[_0xc80c('0x18')](function(_0x3b5e0a){if(_0x3b5e0a[_0xc80c('0x1d')]){logger[_0xc80c('0xd')](_0xc80c('0x1e'));return _[_0xc80c('0x1f')](_0x3b5e0a['results'],{'email':_0x5bb1f8,'role':_0xc80c('0x20')});}else{logger[_0xc80c('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xc80c('0x21'),_0x2cfd7e['remoteUri'])})[_0xc80c('0x18')](function(_0x31da01){logger['info'](_0xc80c('0x22'));return _0x31da01[_0xc80c('0x23')];});}});}else{logger[_0xc80c('0xd')](_0xc80c('0x24'));return request({'uri':util['format'](_0xc80c('0x21'),_0x2cfd7e[_0xc80c('0x10')])})['then'](function(_0xd365fd){logger[_0xc80c('0xd')](_0xc80c('0x22'));return _0xd365fd['user'];});}}function getEndUser(_0x4b756f,_0x3db798,_0x31f4e6){logger['info']('Searching\x20enduser\x20with\x20phone',_0x31f4e6);return request({'uri':util[_0xc80c('0xe')](_0xc80c('0x1b'),_0x4b756f['remoteUri']),'qs':{'query':util[_0xc80c('0xe')]('type:user\x20role:end-user\x20phone:%s',_0x31f4e6)}})[_0xc80c('0x18')](function(_0x911c94){var _0xdbe585;if(_0x911c94[_0xc80c('0x25')][_0xc80c('0x26')]){_0x911c94[_0xc80c('0x25')]=_[_0xc80c('0x27')](_0x911c94[_0xc80c('0x25')],{'suspended':![],'role':'end-user'});if(_0x911c94[_0xc80c('0x25')][_0xc80c('0x26')]){_0xdbe585=_[_0xc80c('0x28')](_0x911c94[_0xc80c('0x25')]);}}if(_0xdbe585){logger[_0xc80c('0xd')](_0xc80c('0x29'));return _0xdbe585;}else{logger[_0xc80c('0xd')](_0xc80c('0x2a'));return request({'uri':util[_0xc80c('0xe')](_0xc80c('0x2b'),_0x4b756f[_0xc80c('0x10')]),'method':_0xc80c('0x11'),'body':{'user':{'role':_0xc80c('0x2c'),'name':util[_0xc80c('0xe')]('Caller\x20-\x20%s',_0x3db798||_0x31f4e6),'phone':_0x31f4e6}}})['then'](function(_0x4eb5d){logger[_0xc80c('0xd')]('Enduser\x20created.');return _0x4eb5d[_0xc80c('0x23')];});}});}function getAuth(_0xd67a35){var _0x5b641e;if(_0xd67a35[_0xc80c('0x2d')]==='password'){_0x5b641e=util[_0xc80c('0xe')](_0xc80c('0x2e'),_0xd67a35['username'],_0xd67a35['password']);}else if(_0xd67a35[_0xc80c('0x2d')]===_0xc80c('0x2f')){_0x5b641e=util[_0xc80c('0xe')](_0xc80c('0x30'),_0xd67a35[_0xc80c('0x31')],_0xd67a35['token']);}return util[_0xc80c('0xe')](_0xc80c('0x32'),new Buffer(_0x5b641e)[_0xc80c('0x33')](_0xc80c('0x34')));}function request(_0x55bb5e){logger['debug']('[HTTP]',JSON['stringify'](_0x55bb5e));return rp(_[_0xc80c('0xa')](_0x55bb5e,{'method':_0xc80c('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x1822fc,_0xc1e9b7){var _0x2b5591=[];if(_0x1822fc&&_0x1822fc[_0xc80c('0x26')]>0x0){_0x2b5591=_[_0xc80c('0x36')](_0x1822fc,_0xc1e9b7);}return _0x2b5591;}function getCustomFields(_0x274b60,_0x5442e7){var _0x9f80a5=[];var _0x2a0e8b={'custom_fields':[]};if(_0x274b60[_0xc80c('0x26')]>0x0){_[_0xc80c('0x37')](_0x274b60,function(_0x1b0101){if(_[_0xc80c('0x38')]([_0xc80c('0x39'),'picklist'],_0x1b0101[_0xc80c('0x3a')])&&_0x1b0101[_0xc80c('0x3b')]&&!_0x1b0101[_0xc80c('0x3c')]){_0x2a0e8b[_0x1b0101[_0xc80c('0x3b')][_0xc80c('0x3d')]()]=_0x1b0101[_0xc80c('0x3e')][_0xc80c('0x33')]();}else if(_['includes']([_0xc80c('0x39'),_0xc80c('0x3f')],_0x1b0101[_0xc80c('0x3a')])&&_0x1b0101[_0xc80c('0x40')]&&_0x1b0101[_0xc80c('0x3c')]){_0x2a0e8b['custom_fields']['push']({'id':_0x1b0101['idField'],'value':_0x1b0101['content']['toString']()});}else if(_0x1b0101['type']==='variable'&&_0x1b0101[_0xc80c('0x41')]&&_0x1b0101['idField']&&_0x1b0101[_0xc80c('0x3c')]){_0x5442e7[_0x1b0101[_0xc80c('0x41')]]&&_0x2a0e8b[_0xc80c('0x42')][_0xc80c('0x43')]({'id':_0x1b0101['idField'],'value':_0x5442e7[_0x1b0101[_0xc80c('0x41')]][_0xc80c('0x33')]()});}else if(_0x1b0101[_0xc80c('0x3a')]===_0xc80c('0x44')&&_0x1b0101[_0xc80c('0x45')]&&_0x1b0101['Variable'][_0xc80c('0x13')]&&_0x1b0101[_0xc80c('0x40')]&&_0x1b0101[_0xc80c('0x3c')]){_0x5442e7[_0x1b0101[_0xc80c('0x45')]['name'][_0xc80c('0x3d')]()]&&_0x2a0e8b[_0xc80c('0x42')][_0xc80c('0x43')]({'id':_0x1b0101[_0xc80c('0x40')],'value':_0x5442e7[_0x1b0101[_0xc80c('0x45')][_0xc80c('0x13')]['toLowerCase']()][_0xc80c('0x33')]()});}});}return _0x2a0e8b;}exports['queue']=function(_0x562b41,_0x276e68,_0x15d395,_0x204a32,_0x51f484,_0x243fe9){var _0x5e30ab,_0x1706a1;_0x243fe9[_0xc80c('0x10')]=intUtil[_0xc80c('0x46')](_0x243fe9[_0xc80c('0x10')]);_0x243fe9[_0xc80c('0x47')]=intUtil[_0xc80c('0x46')](_0x243fe9[_0xc80c('0x47')]);if(_0x51f484&&_0x51f484['monitor_format']){logger[_0xc80c('0xd')](_0xc80c('0x48'),_0xc80c('0x49'));_0x276e68['recordingURL']=util[_0xc80c('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x243fe9[_0xc80c('0x47')],_0x276e68[_0xc80c('0x4a')],md5(_0x276e68['uniqueid']));}else{_0x276e68['recordingURL']='';}headers[_0xc80c('0x4b')]=getAuth(_0x243fe9);return getUser(_0x243fe9,_0x204a32[_0xc80c('0x4c')])[_0xc80c('0x18')](function(_0x18b445){_0x5e30ab=_0x18b445;logger[_0xc80c('0xd')](_0xc80c('0x4d'),_0x5e30ab['id']);return getEndUser(_0x243fe9,_0x276e68[_0xc80c('0x4e')],_0x276e68[_0xc80c('0x4f')]);})['then'](function(_0x2cadc0){_0x1706a1=_0x2cadc0;logger[_0xc80c('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1706a1['id']);return getTicket(_0x243fe9,_0x5e30ab,_0x1706a1,_0x15d395,_0x276e68);})['then'](function(_0x30f0b7){if(_0x30f0b7){logger[_0xc80c('0xd')](_0xc80c('0x50'),_0x30f0b7['id']);switch(_0x243fe9[_0xc80c('0x3a')]){case _0xc80c('0x51'):logger[_0xc80c('0xd')](_0xc80c('0x48'),_0xc80c('0x52'));return request({'uri':util[_0xc80c('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x243fe9[_0xc80c('0x10')],_0x5e30ab['id'],_0x30f0b7['id']),'method':_0xc80c('0x11')});case _0xc80c('0x53'):logger[_0xc80c('0xd')]('[QUEUE]',_0xc80c('0x54'));emit(util[_0xc80c('0xe')](_0xc80c('0x55'),_0x204a32[_0xc80c('0x13')]),'trigger:browser:url',{'uri':util['format'](_0xc80c('0x56'),_0x243fe9['remoteUri'][_0xc80c('0x57')](_0xc80c('0x58'),''),_0x30f0b7['id'])});break;default:logger['error'](_0xc80c('0x48'),_0xc80c('0x59'));}}})['catch'](function(_0x162dbc){logger['error'](_0xc80c('0x5a'),util['inspect'](_0x162dbc,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x4ec8a9,_0x2c77fb,_0x3e2f66,_0x5e5367,_0x27b8d4,_0x1c545b,_0xd99678){var _0xac8bb3,_0x3bc2a2;_0x1c545b['remoteUri']=intUtil['stripTrailingSlash'](_0x1c545b[_0xc80c('0x10')]);_0x1c545b[_0xc80c('0x47')]=intUtil[_0xc80c('0x46')](_0x1c545b[_0xc80c('0x47')]);if(_0xd99678&&_0xd99678[_0xc80c('0x5b')]&&_0xd99678[_0xc80c('0x5b')]!=='none'){logger[_0xc80c('0xd')](_0xc80c('0x5c'),'Recording\x20is\x20enabled!');_0x2c77fb[_0xc80c('0x5d')]=util[_0xc80c('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c545b[_0xc80c('0x47')],_0x2c77fb[_0xc80c('0x4a')],md5(_0x2c77fb[_0xc80c('0x4a')]));}headers['Authorization']=getAuth(_0x1c545b);return getUser(_0x1c545b,_0x5e5367[_0xc80c('0x4c')])['then'](function(_0x2d15c4){_0xac8bb3=_0x2d15c4;logger[_0xc80c('0xd')](_0xc80c('0x4d'),_0xac8bb3['id']);return getEndUser(_0x1c545b,_0x2c77fb['destcalleridname'],_0x2c77fb['destcalleridnum']);})[_0xc80c('0x18')](function(_0x296fef){_0x3bc2a2=_0x296fef;logger[_0xc80c('0xd')](_0xc80c('0x5e'),_0x3bc2a2['id']);return getTicket(_0x1c545b,_0xac8bb3,_0x3bc2a2,_0x3e2f66,_0x2c77fb);})[_0xc80c('0x18')](function(_0xf1654){if(_0xf1654){logger[_0xc80c('0xd')](_0xc80c('0x50'),_0xf1654['id']);switch(_0x1c545b[_0xc80c('0x3a')]){case _0xc80c('0x51'):logger[_0xc80c('0xd')](_0xc80c('0x5c'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc80c('0xe')](_0xc80c('0x5f'),_0x1c545b[_0xc80c('0x10')],_0xac8bb3['id'],_0xf1654['id']),'method':_0xc80c('0x11')});case _0xc80c('0x53'):logger[_0xc80c('0xd')](_0xc80c('0x5c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc80c('0xe')](_0xc80c('0x55'),_0x5e5367[_0xc80c('0x13')]),_0xc80c('0x60'),{'uri':util['format'](_0xc80c('0x56'),_0x1c545b['remoteUri']['replace'](_0xc80c('0x58'),''),_0xf1654['id'])});break;default:logger[_0xc80c('0x61')]('[OUTBOUND]',_0xc80c('0x59'));}}})['catch'](function(_0x485ea6){logger[_0xc80c('0x61')](_0xc80c('0x62'),util[_0xc80c('0x63')](_0x485ea6,{'showHidden':!![],'depth':null}));});};exports[_0xc80c('0x64')]=function(_0x47e04a,_0x2d17b1,_0x1bc557,_0x3e38bb,_0x5b906b,_0x2b7b46){var _0x747dd9,_0x533c61;_0x2b7b46[_0xc80c('0x10')]=intUtil['stripTrailingSlash'](_0x2b7b46[_0xc80c('0x10')]);_0x2b7b46[_0xc80c('0x47')]=intUtil['stripTrailingSlash'](_0x2b7b46['serverUrl']);if(_0x5b906b&&_0x5b906b['monitor_format']){logger['info']('['+_0x2d17b1['lastevent']['toUpperCase']()+']',_0xc80c('0x49'));_0x2d17b1[_0xc80c('0x5d')]=util[_0xc80c('0xe')](_0xc80c('0x65'),_0x2b7b46[_0xc80c('0x47')],_0x2d17b1[_0xc80c('0x4a')],md5(_0x2d17b1[_0xc80c('0x4a')]));}else{_0x2d17b1[_0xc80c('0x5d')]='';}headers[_0xc80c('0x4b')]=getAuth(_0x2b7b46);return getUser(_0x2b7b46)['then'](function(_0x3ecbc8){_0x747dd9=_0x3ecbc8;logger[_0xc80c('0xd')]('The\x20User\x20ID\x20is:',_0x747dd9['id']);return getEndUser(_0x2b7b46,_0x2d17b1[_0xc80c('0x4e')],_0x2d17b1[_0xc80c('0x4f')]);})[_0xc80c('0x18')](function(_0x3ceda0){_0x533c61=_0x3ceda0;logger['info'](_0xc80c('0x5e'),_0x533c61['id']);return getTicket(_0x2b7b46,_0x747dd9,_0x533c61,_0x1bc557,_0x2d17b1);})['then'](function(_0x7a9c61){if(_0x7a9c61){logger['info']('The\x20Ticket\x20ID\x20is:',_0x7a9c61['id']);}})[_0xc80c('0x66')](function(_0x364846){logger[_0xc80c('0x61')]('['+_0x2d17b1[_0xc80c('0x67')][_0xc80c('0x68')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x364846,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0ca6=['The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','replace','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','/api/v2','unmanaged','lastevent','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','format','POST','name','getString','Subjects','Descriptions','Fields','then','info','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','forEach','includes','string','type','customField','nameField','picklist','custom_fields','idField','variable','variableName','push','customVariable','Variable','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email'];(function(_0x54f5d8,_0x1a03c7){var _0x1e96a5=function(_0x913b1d){while(--_0x913b1d){_0x54f5d8['push'](_0x54f5d8['shift']());}};_0x1e96a5(++_0x1a03c7);}(_0x0ca6,0x100));var _0x60ca=function(_0x130ceb,_0x587407){_0x130ceb=_0x130ceb-0x0;var _0x6fee25=_0x0ca6[_0x130ceb];return _0x6fee25;};'use strict';var _=require(_0x60ca('0x0'));var rp=require(_0x60ca('0x1'));var md5=require(_0x60ca('0x2'));var util=require(_0x60ca('0x3'));var Redis=require(_0x60ca('0x4'));var intUtil=require(_0x60ca('0x5'));var config=require(_0x60ca('0x6'));var logger=require(_0x60ca('0x7'))(_0x60ca('0x8'));config[_0x60ca('0x9')]=_[_0x60ca('0xa')](config[_0x60ca('0x9')],{'host':_0x60ca('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x60ca('0x9')]));function emit(_0x5812ce,_0x48f8d6,_0x351198){io['to'](_0x5812ce)[_0x60ca('0xc')](_0x48f8d6,_0x351198);}var headers={'Content-Type':_0x60ca('0xd'),'Accept':_0x60ca('0xd')};function getTicket(_0x41ad4f,_0x1d925a,_0xa9c69c,_0x3011b0,_0x26e156){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0x60ca('0xe')]('%s/tickets.json',_0x41ad4f['remoteUri']),'method':_0x60ca('0xf'),'body':{'ticket':_['merge']({'requester_id':_0xa9c69c['id'],'submitter_id':_0x1d925a?_0x1d925a['id']:undefined,'assignee_id':_0x1d925a?_0x1d925a['id']:undefined,'tags':getTags(_0x3011b0['Tags'],_0x60ca('0x10')),'subject':intUtil[_0x60ca('0x11')](_0x3011b0[_0x60ca('0x12')],_0x26e156,'\x20'),'description':intUtil['getString'](_0x3011b0[_0x60ca('0x13')],_0x26e156,'\x0a'),'comment':{'public':![],'body':intUtil[_0x60ca('0x11')](_0x3011b0[_0x60ca('0x13')],_0x26e156,'\x0a')}},getCustomFields(_0x3011b0[_0x60ca('0x14')],_0x26e156))}})[_0x60ca('0x15')](function(_0x3723c0){logger[_0x60ca('0x16')]('Ticket\x20created!');return _0x3723c0[_0x60ca('0x17')];});}function getUser(_0x1dea8c,_0x49a062){if(intUtil[_0x60ca('0x18')](_0x49a062)){logger[_0x60ca('0x16')](_0x60ca('0x19'),_0x49a062);return request({'uri':util['format'](_0x60ca('0x1a'),_0x1dea8c[_0x60ca('0x1b')]),'qs':{'query':util[_0x60ca('0xe')](_0x60ca('0x1c'),_0x49a062)}})[_0x60ca('0x15')](function(_0x993da2){if(_0x993da2['count']){logger['info'](_0x60ca('0x1d'));return _[_0x60ca('0x1e')](_0x993da2[_0x60ca('0x1f')],{'email':_0x49a062,'role':'agent'});}else{logger['info'](_0x60ca('0x20'));return request({'uri':util[_0x60ca('0xe')](_0x60ca('0x21'),_0x1dea8c['remoteUri'])})[_0x60ca('0x15')](function(_0x210467){logger[_0x60ca('0x16')](_0x60ca('0x22'));return _0x210467['user'];});}});}else{logger[_0x60ca('0x16')](_0x60ca('0x20'));return request({'uri':util[_0x60ca('0xe')](_0x60ca('0x21'),_0x1dea8c[_0x60ca('0x1b')])})[_0x60ca('0x15')](function(_0x3f4a66){logger[_0x60ca('0x16')](_0x60ca('0x22'));return _0x3f4a66[_0x60ca('0x23')];});}}function getEndUser(_0x366b42,_0x45cf9,_0xc735f2){logger[_0x60ca('0x16')](_0x60ca('0x24'),_0xc735f2);return request({'uri':util[_0x60ca('0xe')]('%s/search.json',_0x366b42[_0x60ca('0x1b')]),'qs':{'query':util[_0x60ca('0xe')](_0x60ca('0x25'),_0xc735f2)}})[_0x60ca('0x15')](function(_0x54bb85){var _0x5c6526;if(_0x54bb85['results'][_0x60ca('0x26')]){_0x54bb85[_0x60ca('0x1f')]=_[_0x60ca('0x27')](_0x54bb85[_0x60ca('0x1f')],{'suspended':![],'role':_0x60ca('0x28')});if(_0x54bb85[_0x60ca('0x1f')][_0x60ca('0x26')]){_0x5c6526=_[_0x60ca('0x29')](_0x54bb85[_0x60ca('0x1f')]);}}if(_0x5c6526){logger[_0x60ca('0x16')](_0x60ca('0x2a'));return _0x5c6526;}else{logger[_0x60ca('0x16')](_0x60ca('0x2b'));return request({'uri':util[_0x60ca('0xe')]('%s/users.json',_0x366b42[_0x60ca('0x1b')]),'method':_0x60ca('0xf'),'body':{'user':{'role':_0x60ca('0x28'),'name':util['format'](_0x60ca('0x2c'),_0x45cf9||_0xc735f2),'phone':_0xc735f2}}})[_0x60ca('0x15')](function(_0x59e4ff){logger['info'](_0x60ca('0x2d'));return _0x59e4ff[_0x60ca('0x23')];});}});}function getAuth(_0x1ba2f7){var _0x127fb0;if(_0x1ba2f7['authType']===_0x60ca('0x2e')){_0x127fb0=util[_0x60ca('0xe')](_0x60ca('0x2f'),_0x1ba2f7[_0x60ca('0x30')],_0x1ba2f7[_0x60ca('0x2e')]);}else if(_0x1ba2f7[_0x60ca('0x31')]===_0x60ca('0x32')){_0x127fb0=util['format'](_0x60ca('0x33'),_0x1ba2f7['username'],_0x1ba2f7['token']);}return util['format'](_0x60ca('0x34'),new Buffer(_0x127fb0)[_0x60ca('0x35')](_0x60ca('0x36')));}function request(_0x2a0460){logger[_0x60ca('0x37')]('[HTTP]',JSON[_0x60ca('0x38')](_0x2a0460));return rp(_[_0x60ca('0xa')](_0x2a0460,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x14d6c3,_0x1849a1){var _0x1410e7=[];if(_0x14d6c3&&_0x14d6c3[_0x60ca('0x26')]>0x0){_0x1410e7=_['map'](_0x14d6c3,_0x1849a1);}return _0x1410e7;}function getCustomFields(_0xc4f351,_0x2d832d){var _0x4e7ba0=[];var _0x1a53e9={'custom_fields':[]};if(_0xc4f351[_0x60ca('0x26')]>0x0){_[_0x60ca('0x39')](_0xc4f351,function(_0x57ecde){if(_[_0x60ca('0x3a')]([_0x60ca('0x3b'),'picklist'],_0x57ecde[_0x60ca('0x3c')])&&_0x57ecde['nameField']&&!_0x57ecde[_0x60ca('0x3d')]){_0x1a53e9[_0x57ecde[_0x60ca('0x3e')]['toLowerCase']()]=_0x57ecde['content'][_0x60ca('0x35')]();}else if(_[_0x60ca('0x3a')](['string',_0x60ca('0x3f')],_0x57ecde[_0x60ca('0x3c')])&&_0x57ecde['idField']&&_0x57ecde[_0x60ca('0x3d')]){_0x1a53e9[_0x60ca('0x40')]['push']({'id':_0x57ecde[_0x60ca('0x41')],'value':_0x57ecde['content'][_0x60ca('0x35')]()});}else if(_0x57ecde[_0x60ca('0x3c')]===_0x60ca('0x42')&&_0x57ecde[_0x60ca('0x43')]&&_0x57ecde[_0x60ca('0x41')]&&_0x57ecde[_0x60ca('0x3d')]){_0x2d832d[_0x57ecde['variableName']]&&_0x1a53e9[_0x60ca('0x40')][_0x60ca('0x44')]({'id':_0x57ecde['idField'],'value':_0x2d832d[_0x57ecde[_0x60ca('0x43')]]['toString']()});}else if(_0x57ecde[_0x60ca('0x3c')]===_0x60ca('0x45')&&_0x57ecde['Variable']&&_0x57ecde[_0x60ca('0x46')][_0x60ca('0x10')]&&_0x57ecde[_0x60ca('0x41')]&&_0x57ecde['customField']){_0x2d832d[_0x57ecde[_0x60ca('0x46')][_0x60ca('0x10')]['toLowerCase']()]&&_0x1a53e9['custom_fields'][_0x60ca('0x44')]({'id':_0x57ecde['idField'],'value':_0x2d832d[_0x57ecde['Variable'][_0x60ca('0x10')][_0x60ca('0x47')]()][_0x60ca('0x35')]()});}});}return _0x1a53e9;}exports['queue']=function(_0x5e03db,_0x3343a5,_0x35a0dc,_0x1b6440,_0x8333d,_0x35b5ca){var _0x29f737,_0x3da1c8;_0x35b5ca[_0x60ca('0x1b')]=intUtil[_0x60ca('0x48')](_0x35b5ca[_0x60ca('0x1b')]);_0x35b5ca[_0x60ca('0x49')]=intUtil['stripTrailingSlash'](_0x35b5ca[_0x60ca('0x49')]);if(_0x8333d&&_0x8333d[_0x60ca('0x4a')]){logger[_0x60ca('0x16')]('[QUEUE]',_0x60ca('0x4b'));_0x3343a5[_0x60ca('0x4c')]=util[_0x60ca('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35b5ca[_0x60ca('0x49')],_0x3343a5['uniqueid'],md5(_0x3343a5[_0x60ca('0x4d')]));}else{_0x3343a5['recordingURL']='';}headers[_0x60ca('0x4e')]=getAuth(_0x35b5ca);return getUser(_0x35b5ca,_0x1b6440[_0x60ca('0x4f')])[_0x60ca('0x15')](function(_0x38af57){_0x29f737=_0x38af57;logger[_0x60ca('0x16')](_0x60ca('0x50'),_0x29f737['id']);return getEndUser(_0x35b5ca,_0x3343a5['calleridname'],_0x3343a5[_0x60ca('0x51')]);})[_0x60ca('0x15')](function(_0x251b5a){_0x3da1c8=_0x251b5a;logger[_0x60ca('0x16')](_0x60ca('0x52'),_0x3da1c8['id']);return getTicket(_0x35b5ca,_0x29f737,_0x3da1c8,_0x35a0dc,_0x3343a5);})[_0x60ca('0x15')](function(_0x2d701d){if(_0x2d701d){logger[_0x60ca('0x16')](_0x60ca('0x53'),_0x2d701d['id']);switch(_0x35b5ca[_0x60ca('0x3c')]){case'integrationTab':logger[_0x60ca('0x16')](_0x60ca('0x54'),_0x60ca('0x55'));return request({'uri':util[_0x60ca('0xe')](_0x60ca('0x56'),_0x35b5ca[_0x60ca('0x1b')],_0x29f737['id'],_0x2d701d['id']),'method':_0x60ca('0xf')});case _0x60ca('0x57'):logger['info'](_0x60ca('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x60ca('0x58'),_0x1b6440[_0x60ca('0x10')]),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x35b5ca[_0x60ca('0x1b')][_0x60ca('0x59')]('/api/v2',''),_0x2d701d['id'])});break;default:logger['error'](_0x60ca('0x54'),_0x60ca('0x5a'));}}})[_0x60ca('0x5b')](function(_0x28e251){logger[_0x60ca('0x5c')](_0x60ca('0x5d'),util[_0x60ca('0x5e')](_0x28e251,{'showHidden':!![],'depth':null}));});};exports[_0x60ca('0x5f')]=function(_0x4c525c,_0x114c62,_0x1d3da8,_0x156626,_0xddd422,_0x165965,_0x652b95){var _0x91ddd6,_0x44e150;_0x165965[_0x60ca('0x1b')]=intUtil[_0x60ca('0x48')](_0x165965['remoteUri']);_0x165965[_0x60ca('0x49')]=intUtil[_0x60ca('0x48')](_0x165965[_0x60ca('0x49')]);if(_0x652b95&&_0x652b95[_0x60ca('0x60')]&&_0x652b95[_0x60ca('0x60')]!==_0x60ca('0x61')){logger[_0x60ca('0x16')](_0x60ca('0x62'),_0x60ca('0x4b'));_0x114c62[_0x60ca('0x4c')]=util[_0x60ca('0xe')](_0x60ca('0x63'),_0x165965[_0x60ca('0x49')],_0x114c62[_0x60ca('0x4d')],md5(_0x114c62[_0x60ca('0x4d')]));}headers[_0x60ca('0x4e')]=getAuth(_0x165965);return getUser(_0x165965,_0x156626[_0x60ca('0x4f')])[_0x60ca('0x15')](function(_0x134c40){_0x91ddd6=_0x134c40;logger[_0x60ca('0x16')](_0x60ca('0x50'),_0x91ddd6['id']);return getEndUser(_0x165965,_0x114c62[_0x60ca('0x64')],_0x114c62[_0x60ca('0x65')]);})[_0x60ca('0x15')](function(_0xb98abe){_0x44e150=_0xb98abe;logger[_0x60ca('0x16')](_0x60ca('0x52'),_0x44e150['id']);return getTicket(_0x165965,_0x91ddd6,_0x44e150,_0x1d3da8,_0x114c62);})[_0x60ca('0x15')](function(_0x56c04c){if(_0x56c04c){logger[_0x60ca('0x16')](_0x60ca('0x53'),_0x56c04c['id']);switch(_0x165965['type']){case _0x60ca('0x66'):logger[_0x60ca('0x16')]('[OUTBOUND]',_0x60ca('0x55'));return request({'uri':util[_0x60ca('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x165965[_0x60ca('0x1b')],_0x91ddd6['id'],_0x56c04c['id']),'method':_0x60ca('0xf')});case _0x60ca('0x57'):logger[_0x60ca('0x16')](_0x60ca('0x62'),_0x60ca('0x67'));emit(util[_0x60ca('0xe')](_0x60ca('0x58'),_0x156626[_0x60ca('0x10')]),_0x60ca('0x68'),{'uri':util[_0x60ca('0xe')](_0x60ca('0x69'),_0x165965[_0x60ca('0x1b')][_0x60ca('0x59')](_0x60ca('0x6a'),''),_0x56c04c['id'])});break;default:logger[_0x60ca('0x5c')]('[OUTBOUND]',_0x60ca('0x5a'));}}})[_0x60ca('0x5b')](function(_0x546c60){logger[_0x60ca('0x5c')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x60ca('0x5e')](_0x546c60,{'showHidden':!![],'depth':null}));});};exports[_0x60ca('0x6b')]=function(_0x501936,_0x4fd103,_0x5e4947,_0x5e7006,_0x2181f7,_0x83172c){var _0xe4b780,_0x114b26;_0x83172c[_0x60ca('0x1b')]=intUtil[_0x60ca('0x48')](_0x83172c['remoteUri']);_0x83172c[_0x60ca('0x49')]=intUtil['stripTrailingSlash'](_0x83172c[_0x60ca('0x49')]);if(_0x2181f7&&_0x2181f7['monitor_format']){logger['info']('['+_0x4fd103[_0x60ca('0x6c')][_0x60ca('0x6d')]()+']',_0x60ca('0x4b'));_0x4fd103[_0x60ca('0x4c')]=util[_0x60ca('0xe')](_0x60ca('0x63'),_0x83172c[_0x60ca('0x49')],_0x4fd103[_0x60ca('0x4d')],md5(_0x4fd103[_0x60ca('0x4d')]));}else{_0x4fd103[_0x60ca('0x4c')]='';}headers['Authorization']=getAuth(_0x83172c);return getUser(_0x83172c)[_0x60ca('0x15')](function(_0x1da358){_0xe4b780=_0x1da358;logger[_0x60ca('0x16')]('The\x20User\x20ID\x20is:',_0xe4b780['id']);return getEndUser(_0x83172c,_0x4fd103[_0x60ca('0x6e')],_0x4fd103[_0x60ca('0x51')]);})[_0x60ca('0x15')](function(_0x4f3a5d){_0x114b26=_0x4f3a5d;logger[_0x60ca('0x16')](_0x60ca('0x52'),_0x114b26['id']);return getTicket(_0x83172c,_0xe4b780,_0x114b26,_0x5e4947,_0x4fd103);})[_0x60ca('0x15')](function(_0x3541ad){if(_0x3541ad){logger['info'](_0x60ca('0x53'),_0x3541ad['id']);}})[_0x60ca('0x5b')](function(_0x259059){logger[_0x60ca('0x5c')]('['+_0x4fd103['lastevent'][_0x60ca('0x6d')]()+']'+_0x60ca('0x6f'),util[_0x60ca('0x5e')](_0x259059,{'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 7cfe98e..1061405 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 _0xcc2e=['Creating\x20new\x20call...','Owner','administrator','first_name','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','mm:ss','lastevent','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','/crm/v2/Calls','code','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','The\x20User\x20ID\x20is:','calleridnum','Inbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','com','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','user:%s','unmanaged','toUpperCase','/downloads?type=uniqueid&token=','calleridname','lodash','request-promise','util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','stringify','length','forEach','includes','string','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','refresh_token','add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','findIndex','email','Using\x20the\x20admin\x20account!','profile','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','startCase','moduleCreate','role','last_name','data','details','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','lead','Leads'];(function(_0x950140,_0x2e4d36){var _0x2acd98=function(_0x3a1903){while(--_0x3a1903){_0x950140['push'](_0x950140['shift']());}};_0x2acd98(++_0x2e4d36);}(_0xcc2e,0xdd));var _0xecc2=function(_0x6395f8,_0x539b75){_0x6395f8=_0x6395f8-0x0;var _0x3d28fb=_0xcc2e[_0x6395f8];return _0x3d28fb;};'use strict';var _=require(_0xecc2('0x0'));var rp=require(_0xecc2('0x1'));var md5=require('md5');var util=require(_0xecc2('0x2'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0xecc2('0x3'));var BPromise=require(_0xecc2('0x4'));var config=require(_0xecc2('0x5'));var logger=require(_0xecc2('0x6'))(_0xecc2('0x7'));config[_0xecc2('0x8')]=_['defaults'](config['redis'],{'host':_0xecc2('0x9'),'port':0x18eb});var io=require(_0xecc2('0xa'))(new Redis(config[_0xecc2('0x8')]));function emit(_0x2f1764,_0x2d66a1,_0x545668){io['to'](_0x2f1764)[_0xecc2('0xb')](_0x2d66a1,_0x545668);}function request(_0x533643){logger['debug']('[HTTP]',JSON[_0xecc2('0xc')](_0x533643));return rp(_0x533643);}function getCustomFields(_0x4635cd,_0x31788b){var _0x1121a4={};if(_0x4635cd[_0xecc2('0xd')]>0x0){_[_0xecc2('0xe')](_0x4635cd,function(_0x48b5d8){if(_[_0xecc2('0xf')]([_0xecc2('0x10'),'picklist'],_0x48b5d8[_0xecc2('0x11')])&&_0x48b5d8[_0xecc2('0x12')]){_0x1121a4[_0x48b5d8[_0xecc2('0x12')]]=_0x48b5d8['content'][_0xecc2('0x13')]();}else if(_0x48b5d8[_0xecc2('0x11')]===_0xecc2('0x14')&&_0x48b5d8[_0xecc2('0x15')]&&_0x48b5d8[_0xecc2('0x12')]&&_0x31788b[_0x48b5d8['variableName']]){_0x1121a4[_0x48b5d8[_0xecc2('0x12')]]=_0x31788b[_0x48b5d8[_0xecc2('0x15')]][_0xecc2('0x13')]();}else if(_0x48b5d8[_0xecc2('0x11')]===_0xecc2('0x16')&&_0x48b5d8[_0xecc2('0x17')]&&_0x48b5d8['Variable'][_0xecc2('0x18')]&&_0x48b5d8[_0xecc2('0x12')]&&_0x31788b[_0x48b5d8['Variable']['name']['toLowerCase']()]){_0x1121a4[_0x48b5d8[_0xecc2('0x12')]]=_0x31788b[_0x48b5d8[_0xecc2('0x17')][_0xecc2('0x18')][_0xecc2('0x19')]()][_0xecc2('0x13')]();}});}return _0x1121a4;}function getName(_0x2a569c){if(_0x2a569c['indexOf']('\x20')>0x0){var _0x40c50c=_0x2a569c[_0xecc2('0x1a')](/ (.+)/);if(_0x40c50c[0x1]){return _0x40c50c;}}return[_0x2a569c,_0x2a569c];}var accountsTokens={};function getAccessToken(_0x38c6e4){return new Promise(function(_0x9d0068,_0xc61661){if(!_[_0xecc2('0x1b')](accountsTokens[_0x38c6e4['id']])&&!_['isNil'](accountsTokens[_0x38c6e4['id']][_0xecc2('0x1c')])){if(moment()[_0xecc2('0x1d')](accountsTokens[_0x38c6e4['id']]['expires_in'])){_0x9d0068(accountsTokens[_0x38c6e4['id']]['access_token']);}}var _0x333a60;switch(_0x38c6e4[_0xecc2('0x1e')]){case'US':_0x333a60=_0xecc2('0x1f');break;case'AU':_0x333a60=_0xecc2('0x20');break;case'EU':_0x333a60=_0xecc2('0x21');break;case'IN':_0x333a60=_0xecc2('0x22');break;case'CN':_0x333a60=_0xecc2('0x23');break;default:_0x333a60=_0xecc2('0x21');break;}var _0x3e0aa3={'method':_0xecc2('0x24'),'uri':_0x333a60+_0xecc2('0x25'),'qs':{'refresh_token':_0x38c6e4['refreshToken'],'client_id':_0x38c6e4[_0xecc2('0x26')],'client_secret':_0x38c6e4['clientSecret'],'grant_type':_0xecc2('0x27')},'json':!![]};return rp(_0x3e0aa3)['then'](function(_0x33eb11){accountsTokens[_0x38c6e4['id']]={'access_token':_0x33eb11[_0xecc2('0x1c')],'expires_in':moment()[_0xecc2('0x28')](_0x33eb11[_0xecc2('0x29')],_0xecc2('0x2a'))};_0x9d0068(_0x33eb11['access_token']);})[_0xecc2('0x2b')](function(_0x11df78){logger[_0xecc2('0x2c')](_0xecc2('0x2d'),_0x11df78[_0xecc2('0x2e')]);_0xc61661(_0x11df78);});});}function getUser(_0x2b8d71,_0x2a9b46,_0xa831da,_0x5ba4ee){logger[_0xecc2('0x2f')](_0xecc2('0x30'));return request({'method':_0xecc2('0x31'),'uri':util[_0xecc2('0x32')](_0xecc2('0x33'),_0x2a9b46),'qs':{'type':_0xecc2('0x34')},'headers':{'Authorization':_0xecc2('0x35')+_0x2b8d71},'json':!![]})[_0xecc2('0x36')](function(_0x5b831c){if(_0x5b831c['users']){var _0xae01b7=-0x1;if(_['isArrayLikeObject'](_0x5b831c[_0xecc2('0x37')])){if(!_['isNil'](_0x5ba4ee)){_0xae01b7=_[_0xecc2('0x38')](_0x5b831c[_0xecc2('0x37')],function(_0x509802){return _0x509802[_0xecc2('0x39')]===_0x5ba4ee;});}if(_0xae01b7>=0x0){logger['info']('Agent\x20found!');}else{logger[_0xecc2('0x2f')](_0xecc2('0x3a'));_0xae01b7=_[_0xecc2('0x38')](_0x5b831c['users'],function(_0x3cd4d9){return _0x3cd4d9[_0xecc2('0x3b')]['name']==='Administrator';});}return _0x5b831c['users'][_0xae01b7];}else{if(_0x5b831c[_0xecc2('0x3c')][_0xecc2('0x3b')][_0xecc2('0x18')]===_0xecc2('0x3d')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x5b831c['user'];return user;}else{logger[_0xecc2('0x2c')](_0xecc2('0x3e'),JSON['stringify'](_0x5b831c));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x5b831c));}}}else{logger[_0xecc2('0x2c')](_0xecc2('0x3e'),JSON[_0xecc2('0xc')](_0x5b831c));throw new Error(_0xecc2('0x3f')+JSON[_0xecc2('0xc')](_0x5b831c));}})['catch'](function(_0x418539){console[_0xecc2('0x2c')](_0x418539);});}function getZohoUser(_0x4ccef4,_0x392b32){return new BPromise(function(_0x354b13,_0x4c33f9){request(_0x4ccef4)[_0xecc2('0x36')](function(_0x408569){var _0x5238e8=null;if(_0x408569){_0x5238e8=_0x408569['data'][0x0];_0x5238e8[_0xecc2('0x40')]=_0x392b32;}_0x354b13(_0x5238e8);})[_0xecc2('0x2b')](function(_0x1a7e4e){_0x4c33f9(_0x1a7e4e);});});}function createEndUser(_0x6bbb,_0x5458c4,_0x4fd137,_0x87f1dd,_0x56839a,_0xf0bae){var _0x4fd137=getName(_0x4fd137);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x5458c4+'/crm/v2/'+_[_0xecc2('0x41')](_0xf0bae[_0xecc2('0x42')])+'s','body':{'data':[{'Last_Name':_0x4fd137[0x1],'First_Name':_0x4fd137[0x0],'Phone':_0x87f1dd,'Owner':{'name':!_[_0xecc2('0x1b')](_0x56839a[_0xecc2('0x43')][_0xecc2('0x18')])?_0x56839a[_0xecc2('0x43')][_0xecc2('0x18')]:!_[_0xecc2('0x1b')](_0x56839a['first_name'])?_0x56839a['first_name']+'\x20'+_0x56839a[_0xecc2('0x44')]:_0x56839a['last_name'],'id':_0x56839a['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x6bbb},'json':!![]})['then'](function(_0x37c704){if(_0x37c704&&_0x37c704[_0xecc2('0x45')][0x0]['code']==='SUCCESS'){var _0x11710a=_0x37c704[_0xecc2('0x45')][0x0][_0xecc2('0x46')];_0x11710a[_0xecc2('0x40')]=_[_0xecc2('0x41')](_0xf0bae[_0xecc2('0x42')])+'s';return _0x11710a;}logger['error'](_0xecc2('0x3e'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0xecc2('0x2b')](function(_0x4877ab){console[_0xecc2('0x47')]('CREATE\x20ERROR',_0x4877ab);});}function getEndUser(_0x8fbbe2,_0x2199b2,_0x2aa60d,_0x513d25,_0x724ad7,_0x1b6e0c,_0x229532){var _0x5f598c={'method':_0xecc2('0x31'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x8fbbe2},'json':!![]};switch(_0x229532[_0xecc2('0x48')]){case _0xecc2('0x49'):_0x5f598c[_0xecc2('0x4a')]='https://www.zohoapis.'+_0x2199b2+_0xecc2('0x4b')+_0x724ad7+'))';return getZohoUser(_0x5f598c,_0xecc2('0x4c'))[_0xecc2('0x36')](function(_0x173f2a){if(_0x173f2a)return _0x173f2a;_0x5f598c[_0xecc2('0x4a')]=_0xecc2('0x4d')+_0x2199b2+_0xecc2('0x4e')+_0x724ad7+'))';return getZohoUser(_0x5f598c,'Leads')[_0xecc2('0x36')](function(_0x4f4a47){if(_0x4f4a47)return _0x4f4a47;if(_0x229532[_0xecc2('0x42')]!=_0xecc2('0x4f')){return createEndUser(_0x8fbbe2,_0x2199b2,_0x513d25,_0x724ad7,_0x1b6e0c,_0x229532);}else{return{};}});});break;case _0xecc2('0x50'):_0x5f598c[_0xecc2('0x4a')]=_0xecc2('0x4d')+_0x2199b2+_0xecc2('0x4b')+_0x724ad7+'))';return getZohoUser(_0x5f598c,_0xecc2('0x4c'))['then'](function(_0x3bb5c8){if(_0x3bb5c8)return _0x3bb5c8;if(_0x229532[_0xecc2('0x42')]!='nothing'){return createEndUser(_0x8fbbe2,_0x2199b2,_0x513d25,_0x724ad7,_0x1b6e0c,_0x229532);}else{return{};}});break;case _0xecc2('0x51'):_0x5f598c[_0xecc2('0x4a')]=_0xecc2('0x4d')+_0x2199b2+_0xecc2('0x4e')+_0x724ad7+'))';return getZohoUser(_0x5f598c,_0xecc2('0x52'))['then'](function(_0x16aa08){if(_0x16aa08)return _0x16aa08;if(_0x229532[_0xecc2('0x42')]!=_0xecc2('0x4f')){return createEndUser(_0x8fbbe2,_0x2199b2,_0x513d25,_0x724ad7,_0x1b6e0c,_0x229532);}else{return{};}});break;}}function getCall(_0x25d1d2,_0xfb65f6,_0x53d709,_0x2052ab,_0x55711f,_0xead6e3,_0x42a1c4,_0x2bf746){logger['info'](_0xecc2('0x53'));var _0xd14ef3={};_0xd14ef3[_0xecc2('0x54')]={'name':!_[_0xecc2('0x1b')](_0x2052ab[_0xecc2('0x43')][_0xecc2('0x18')])&&!_[_0xecc2('0x1b')](_0x2052ab[_0xecc2('0x3b')][_0xecc2('0x18')])&&_0x2052ab[_0xecc2('0x3b')]['name']===_0xecc2('0x55')?_0x2052ab[_0xecc2('0x43')][_0xecc2('0x18')]:!_[_0xecc2('0x1b')](_0x2052ab[_0xecc2('0x56')])?_0x2052ab[_0xecc2('0x56')]+'\x20'+_0x2052ab[_0xecc2('0x44')]:_0x2052ab['last_name'],'id':_0x2052ab['id']};_0xd14ef3['Subject']=intUtil[_0xecc2('0x57')](_0xead6e3[_0xecc2('0x58')],_0x42a1c4,'\x20');_0xd14ef3[_0xecc2('0x59')]=intUtil[_0xecc2('0x57')](_0xead6e3[_0xecc2('0x5a')],_0x42a1c4,'\x0a');if(_0x55711f[_0xecc2('0x40')]==='Contacts'){_0xd14ef3[_0xecc2('0x5b')]={'name':!_[_0xecc2('0x1b')](_0x55711f['Full_Name'])?_0x55711f[_0xecc2('0x5c')]:!_[_0xecc2('0x1b')](_0x55711f['First_Name'])?_0x55711f[_0xecc2('0x5d')]+'\x20'+_0x55711f['Last_Name']:_0x55711f[_0xecc2('0x5e')],'id':_0x55711f['id']};}if(_0x55711f[_0xecc2('0x40')]===_0xecc2('0x52')){_0xd14ef3['What_Id']={'name':!_[_0xecc2('0x1b')](_0x55711f[_0xecc2('0x5c')])?_0x55711f[_0xecc2('0x5c')]:!_[_0xecc2('0x1b')](_0x55711f[_0xecc2('0x5d')])?_0x55711f['First_Name']+'\x20'+_0x55711f['Last_Name']:_0x55711f[_0xecc2('0x5e')],'id':_0x55711f['id']};_0xd14ef3[_0xecc2('0x5f')]=_[_0xecc2('0x41')](_0x55711f[_0xecc2('0x40')]);}if(_0x42a1c4[_0xecc2('0x60')]){_0xd14ef3[_0xecc2('0x61')]=moment[_0xecc2('0x62')](parseInt(_0x42a1c4[_0xecc2('0x60')])*0x3e8)[_0xecc2('0x32')]('mm:ss');}else if(_0x42a1c4[_0xecc2('0x63')]&&_0x42a1c4[_0xecc2('0x64')]){_0xd14ef3['Call_Duration']=moment[_0xecc2('0x62')](moment(_0x42a1c4[_0xecc2('0x64')],_0xecc2('0x65'))['diff'](moment(_0x42a1c4[_0xecc2('0x66')],_0xecc2('0x65'))))[_0xecc2('0x32')](_0xecc2('0x67'));}switch(_0x42a1c4[_0xecc2('0x68')]){case'called':_0xd14ef3[_0xecc2('0x69')]=_0xecc2('0x6a');break;case _0xecc2('0x6b'):case'connect':_0xd14ef3[_0xecc2('0x69')]=_0xecc2('0x6c');break;case _0xecc2('0x6d'):_0xd14ef3[_0xecc2('0x69')]=_0xecc2('0x6e');break;case _0xecc2('0x6f'):_0xd14ef3['Call_Result']='Abandoned';break;case _0xecc2('0x70'):_0xd14ef3['Call_Result']=_0xecc2('0x71');default:}_0xd14ef3[_0xecc2('0x72')]=(_0x2bf746==='outbound'?moment(_0x42a1c4[_0xecc2('0x66')])[_0xecc2('0x32')](_0xecc2('0x65')):moment(_0x42a1c4[_0xecc2('0x73')])[_0xecc2('0x32')](_0xecc2('0x65')))||moment()[_0xecc2('0x32')](_0xecc2('0x65'));_0xd14ef3['Call_Type']=_0x2bf746||'Inbound';_0xd14ef3=_['merge'](_0xd14ef3,getCustomFields(_0xead6e3['Fields'],_0x42a1c4));return request({'method':_0xecc2('0x24'),'uri':_0xecc2('0x4d')+_0xfb65f6+_0xecc2('0x74'),'headers':{'Authorization':_0xecc2('0x35')+_0x25d1d2},'body':{'data':[_0xd14ef3]},'json':!![]})['then'](function(_0x7d6bcc){if(_0x7d6bcc&&_0x7d6bcc[_0xecc2('0x45')][0x0][_0xecc2('0x75')]===_0xecc2('0x76')){logger[_0xecc2('0x2f')](_0xecc2('0x77'));return{'id':_0x7d6bcc['data'][0x0]['details']['id']};}})['catch'](function(_0x297124){logger[_0xecc2('0x2f')](_0xecc2('0x78'),_0x297124[_0xecc2('0x2e')]);console[_0xecc2('0x47')](_0xecc2('0x78'),_0x297124);});}exports[_0xecc2('0x79')]=function(_0x2ba6e9,_0x528577,_0x4a7355,_0x1cd7cc,_0x48df28,_0x568b82){var _0x5228ca,_0x2e4309,_0x156f59;_0x568b82[_0xecc2('0x7a')]=intUtil[_0xecc2('0x7b')](_0x568b82[_0xecc2('0x7a')]);_0x568b82['serverUrl']=intUtil[_0xecc2('0x7b')](_0x568b82[_0xecc2('0x7c')]);if(_0x48df28&&_0x48df28['monitor_format']){logger[_0xecc2('0x2f')]('[QUEUE]',_0xecc2('0x7d'));_0x528577[_0xecc2('0x7e')]=_0x568b82['serverUrl']+_0xecc2('0x7f')+_0x528577[_0xecc2('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x528577['uniqueid']);}else{_0x528577[_0xecc2('0x7e')]='';}var _0x248ca0=_0x568b82[_0xecc2('0x7a')]===_0xecc2('0x81')?'eu':'com';return getAccessToken(_0x568b82)[_0xecc2('0x36')](function(_0x290862){_0x156f59=_0x290862;return getUser(_0x156f59,_0x248ca0,_0x568b82,_0x1cd7cc[_0xecc2('0x39')]);})[_0xecc2('0x36')](function(_0x10070f){_0x5228ca=_0x10070f;logger[_0xecc2('0x2f')](_0xecc2('0x82'),_0x5228ca['id']);return getEndUser(_0x156f59,_0x248ca0,_0x568b82,_0x528577['calleridname'],_0x528577[_0xecc2('0x83')],_0x5228ca,_0x4a7355);})[_0xecc2('0x36')](function(_0x216487){_0x2e4309=_0x216487;return getCall(_0x156f59,_0x248ca0,_0x568b82,_0x5228ca,_0x2e4309,_0x4a7355,_0x528577,_0xecc2('0x84'));})[_0xecc2('0x36')](function(_0x329feb){if(_0x329feb){logger[_0xecc2('0x2f')]('The\x20Call\x20ID\x20is:',_0x329feb['id']);logger['info']('[QUEUE]',_0xecc2('0x85'));emit(util[_0xecc2('0x32')]('user:%s',_0x1cd7cc['name']),_0xecc2('0x86'),{'uri':_0xecc2('0x87')+_0x568b82[_0xecc2('0x7a')]+_0xecc2('0x88')+_0x329feb['id']});}})[_0xecc2('0x2b')](function(_0x2f3ef5){logger[_0xecc2('0x2c')](_0xecc2('0x89'),JSON[_0xecc2('0xc')](_0x2f3ef5));});};exports[_0xecc2('0x8a')]=function(_0x4675b9,_0x110e5f,_0x292f0f,_0xf15fec,_0xdaf00c,_0x36e7cc,_0x4b38b5){var _0x5a38fa,_0x365b0d,_0x45ae36;_0x36e7cc['host']=intUtil['stripTrailingSlash'](_0x36e7cc[_0xecc2('0x7a')]);_0x36e7cc[_0xecc2('0x7c')]=intUtil[_0xecc2('0x7b')](_0x36e7cc[_0xecc2('0x7c')]);if(_0x4b38b5&&_0x4b38b5[_0xecc2('0x8b')]&&_0x4b38b5[_0xecc2('0x8b')]!==_0xecc2('0x8c')){logger[_0xecc2('0x2f')](_0xecc2('0x8d'),_0xecc2('0x7d'));_0x110e5f['recordingURL']=_0x36e7cc[_0xecc2('0x7c')]+'/api/voice/recordings/'+_0x110e5f[_0xecc2('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x110e5f[_0xecc2('0x80')]);}var _0x26be28=_0x36e7cc['host']===_0xecc2('0x81')?'eu':_0xecc2('0x8e');return getAccessToken(_0x36e7cc)[_0xecc2('0x36')](function(_0x4a79b1){_0x45ae36=_0x4a79b1;return getUser(_0x45ae36,_0x26be28,_0x36e7cc,_0xf15fec[_0xecc2('0x39')]);})[_0xecc2('0x36')](function(_0x15d3cc){_0x5a38fa=_0x15d3cc;logger[_0xecc2('0x2f')](_0xecc2('0x82'),_0x5a38fa['id']);return getEndUser(_0x45ae36,_0x26be28,_0x36e7cc,_0x110e5f[_0xecc2('0x8f')],_0x110e5f[_0xecc2('0x90')],_0x5a38fa,_0x292f0f);})[_0xecc2('0x36')](function(_0x4f7759){_0x365b0d=_0x4f7759;return getCall(_0x45ae36,_0x26be28,_0x36e7cc,_0x5a38fa,_0x365b0d,_0x292f0f,_0x110e5f,_0xecc2('0x91'));})[_0xecc2('0x36')](function(_0x40e148){if(_0x40e148){logger[_0xecc2('0x2f')](_0xecc2('0x92'),_0x40e148['id']);logger[_0xecc2('0x2f')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xecc2('0x32')](_0xecc2('0x93'),_0xf15fec[_0xecc2('0x18')]),_0xecc2('0x86'),{'uri':_0xecc2('0x87')+_0x36e7cc[_0xecc2('0x7a')]+_0xecc2('0x88')+_0x40e148['id']});}})[_0xecc2('0x2b')](function(_0x80e836){logger[_0xecc2('0x2c')]('[OUTBOUND]',JSON[_0xecc2('0xc')](_0x80e836));});};exports[_0xecc2('0x94')]=function(_0x3d4859,_0x50fff8,_0xd76047,_0x144202,_0x2a225e,_0x593f43){var _0x3676d1,_0x333ed7,_0x6f55ed;_0x593f43[_0xecc2('0x7a')]=intUtil[_0xecc2('0x7b')](_0x593f43['host']);_0x593f43[_0xecc2('0x7c')]=intUtil[_0xecc2('0x7b')](_0x593f43['serverUrl']);if(_0x2a225e&&_0x2a225e['monitor_format']){logger[_0xecc2('0x2f')]('['+_0x50fff8[_0xecc2('0x68')][_0xecc2('0x95')]()+']',_0xecc2('0x7d'));_0x50fff8['recordingURL']=_0x593f43[_0xecc2('0x7c')]+'/api/voice/recordings/'+_0x50fff8[_0xecc2('0x80')]+_0xecc2('0x96')+md5(_0x50fff8[_0xecc2('0x80')]);}else{_0x50fff8[_0xecc2('0x7e')]='';}var _0x7651d1=_0x593f43['host']==='zoho.eu'?'eu':_0xecc2('0x8e');return getAccessToken(_0x593f43)['then'](function(_0x4aa515){_0x6f55ed=_0x4aa515;return getUser(_0x6f55ed,_0x7651d1,_0x593f43);})[_0xecc2('0x36')](function(_0x20beae){_0x3676d1=_0x20beae;logger[_0xecc2('0x2f')](_0xecc2('0x82'),_0x3676d1['id']);return getEndUser(_0x6f55ed,_0x7651d1,_0x593f43,_0x50fff8[_0xecc2('0x97')],_0x50fff8[_0xecc2('0x83')],_0x3676d1,_0xd76047);})['then'](function(_0x2d2d36){_0x333ed7=_0x2d2d36;return getCall(_0x6f55ed,_0x7651d1,_0x593f43,_0x3676d1,_0x333ed7,_0xd76047,_0x50fff8,'Inbound');})[_0xecc2('0x36')](function(_0x104d63){if(_0x104d63){logger[_0xecc2('0x2f')](_0xecc2('0x92'),_0x104d63['id']);}})[_0xecc2('0x2b')](function(_0x1afdba){logger[_0xecc2('0x2c')]('['+_0x50fff8['lastevent'][_0xecc2('0x95')]()+']',JSON[_0xecc2('0xc')](_0x1afdba));});}; \ No newline at end of file +var _0x7c35=['../../../../config/logger','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','forEach','includes','string','type','idField','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','SUCCESS','details','Error:\x20','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','nothing','lead','Leads','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','YYYY-MM-DDTHH:mm:ss','diff','mm:ss','lastevent','called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','code','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','toUpperCase','The\x20Call\x20ID\x20is:','request-promise','md5','util','./util','moment','ioredis','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c35,0x135));var _0x57c3=function(_0xdb784,_0x23ec05){_0xdb784=_0xdb784-0x0;var _0x2d7ef6=_0x7c35[_0xdb784];return _0x2d7ef6;};'use strict';var _=require('lodash');var rp=require(_0x57c3('0x0'));var md5=require(_0x57c3('0x1'));var util=require(_0x57c3('0x2'));var intUtil=require(_0x57c3('0x3'));var moment=require(_0x57c3('0x4'));var Redis=require(_0x57c3('0x5'));var BPromise=require(_0x57c3('0x6'));var config=require('../../../../config/environment');var logger=require(_0x57c3('0x7'))('zoho');config[_0x57c3('0x8')]=_['defaults'](config['redis'],{'host':_0x57c3('0x9'),'port':0x18eb});var io=require(_0x57c3('0xa'))(new Redis(config[_0x57c3('0x8')]));function emit(_0x13cf86,_0x524901,_0x3b36e1){io['to'](_0x13cf86)[_0x57c3('0xb')](_0x524901,_0x3b36e1);}function request(_0xe3e78c){logger[_0x57c3('0xc')](_0x57c3('0xd'),JSON[_0x57c3('0xe')](_0xe3e78c));return rp(_0xe3e78c);}function getCustomFields(_0x52a522,_0x5d6026){var _0x10f933={};if(_0x52a522['length']>0x0){_[_0x57c3('0xf')](_0x52a522,function(_0x38a230){if(_[_0x57c3('0x10')]([_0x57c3('0x11'),'picklist'],_0x38a230[_0x57c3('0x12')])&&_0x38a230[_0x57c3('0x13')]){_0x10f933[_0x38a230[_0x57c3('0x13')]]=_0x38a230['content'][_0x57c3('0x14')]();}else if(_0x38a230[_0x57c3('0x12')]===_0x57c3('0x15')&&_0x38a230[_0x57c3('0x16')]&&_0x38a230[_0x57c3('0x13')]&&_0x5d6026[_0x38a230[_0x57c3('0x16')]]){_0x10f933[_0x38a230[_0x57c3('0x13')]]=_0x5d6026[_0x38a230[_0x57c3('0x16')]][_0x57c3('0x14')]();}else if(_0x38a230['type']==='customVariable'&&_0x38a230[_0x57c3('0x17')]&&_0x38a230[_0x57c3('0x17')][_0x57c3('0x18')]&&_0x38a230['idField']&&_0x5d6026[_0x38a230['Variable'][_0x57c3('0x18')][_0x57c3('0x19')]()]){_0x10f933[_0x38a230[_0x57c3('0x13')]]=_0x5d6026[_0x38a230['Variable'][_0x57c3('0x18')][_0x57c3('0x19')]()]['toString']();}});}return _0x10f933;}function getName(_0x3f0bb4){if(_0x3f0bb4[_0x57c3('0x1a')]('\x20')>0x0){var _0x4ffecf=_0x3f0bb4[_0x57c3('0x1b')](/ (.+)/);if(_0x4ffecf[0x1]){return _0x4ffecf;}}return[_0x3f0bb4,_0x3f0bb4];}var accountsTokens={};function getAccessToken(_0x5840f8){return new Promise(function(_0x371637,_0x25c877){if(!_['isNil'](accountsTokens[_0x5840f8['id']])&&!_[_0x57c3('0x1c')](accountsTokens[_0x5840f8['id']][_0x57c3('0x1d')])){if(moment()[_0x57c3('0x1e')](accountsTokens[_0x5840f8['id']]['expires_in'])){_0x371637(accountsTokens[_0x5840f8['id']][_0x57c3('0x1d')]);}}var _0x2609c7;switch(_0x5840f8[_0x57c3('0x1f')]){case'US':_0x2609c7='https://accounts.zoho.com';break;case'AU':_0x2609c7='https://accounts.zoho.com.au';break;case'EU':_0x2609c7=_0x57c3('0x20');break;case'IN':_0x2609c7=_0x57c3('0x21');break;case'CN':_0x2609c7=_0x57c3('0x22');break;default:_0x2609c7=_0x57c3('0x20');break;}var _0x2f88ee={'method':_0x57c3('0x23'),'uri':_0x2609c7+_0x57c3('0x24'),'qs':{'refresh_token':_0x5840f8[_0x57c3('0x25')],'client_id':_0x5840f8[_0x57c3('0x26')],'client_secret':_0x5840f8[_0x57c3('0x27')],'grant_type':_0x57c3('0x28')},'json':!![]};return rp(_0x2f88ee)[_0x57c3('0x29')](function(_0x22ac54){accountsTokens[_0x5840f8['id']]={'access_token':_0x22ac54[_0x57c3('0x1d')],'expires_in':moment()[_0x57c3('0x2a')](_0x22ac54[_0x57c3('0x2b')],_0x57c3('0x2c'))};_0x371637(_0x22ac54[_0x57c3('0x1d')]);})[_0x57c3('0x2d')](function(_0x511e56){logger[_0x57c3('0x2e')](_0x57c3('0x2f'),_0x511e56[_0x57c3('0x30')]);_0x25c877(_0x511e56);});});}function getUser(_0x52710f,_0x5df784,_0xf2c5e0,_0x1b9b4c){logger[_0x57c3('0x31')](_0x57c3('0x32'));return request({'method':_0x57c3('0x33'),'uri':util[_0x57c3('0x34')](_0x57c3('0x35'),_0x5df784),'qs':{'type':_0x57c3('0x36')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x52710f},'json':!![]})[_0x57c3('0x29')](function(_0x374612){if(_0x374612[_0x57c3('0x37')]){var _0x32124d=-0x1;if(_[_0x57c3('0x38')](_0x374612[_0x57c3('0x37')])){if(!_[_0x57c3('0x1c')](_0x1b9b4c)){_0x32124d=_[_0x57c3('0x39')](_0x374612[_0x57c3('0x37')],function(_0x1b359b){return _0x1b359b['email']===_0x1b9b4c;});}if(_0x32124d>=0x0){logger[_0x57c3('0x31')](_0x57c3('0x3a'));}else{logger[_0x57c3('0x31')](_0x57c3('0x3b'));_0x32124d=_[_0x57c3('0x39')](_0x374612[_0x57c3('0x37')],function(_0x412027){return _0x412027[_0x57c3('0x3c')][_0x57c3('0x18')]===_0x57c3('0x3d');});}return _0x374612[_0x57c3('0x37')][_0x32124d];}else{if(_0x374612[_0x57c3('0x3e')]['profile']['name']===_0x57c3('0x3d')){logger['info'](_0x57c3('0x3b'));user=_0x374612[_0x57c3('0x3e')];return user;}else{logger[_0x57c3('0x2e')](_0x57c3('0x3f'),JSON['stringify'](_0x374612));throw new Error(_0x57c3('0x40')+JSON[_0x57c3('0xe')](_0x374612));}}}else{logger[_0x57c3('0x2e')](_0x57c3('0x3f'),JSON[_0x57c3('0xe')](_0x374612));throw new Error(_0x57c3('0x40')+JSON[_0x57c3('0xe')](_0x374612));}})[_0x57c3('0x2d')](function(_0x5ab370){console[_0x57c3('0x2e')](_0x5ab370);});}function getZohoUser(_0x8dc1fc,_0xecd567){return new BPromise(function(_0x50d544,_0x5bb9de){request(_0x8dc1fc)['then'](function(_0x108143){var _0x426184=null;if(_0x108143){_0x426184=_0x108143[_0x57c3('0x41')][0x0];_0x426184[_0x57c3('0x42')]=_0xecd567;}_0x50d544(_0x426184);})[_0x57c3('0x2d')](function(_0x588e0c){_0x5bb9de(_0x588e0c);});});}function createEndUser(_0x4c58c8,_0x5c88f7,_0x12d1f5,_0x278445,_0x57e11b,_0x395bf1){var _0x12d1f5=getName(_0x12d1f5);return request({'method':_0x57c3('0x23'),'uri':_0x57c3('0x43')+_0x5c88f7+_0x57c3('0x44')+_[_0x57c3('0x45')](_0x395bf1[_0x57c3('0x46')])+'s','body':{'data':[{'Last_Name':_0x12d1f5[0x1],'First_Name':_0x12d1f5[0x0],'Phone':_0x278445,'Owner':{'name':!_['isNil'](_0x57e11b[_0x57c3('0x47')][_0x57c3('0x18')])?_0x57e11b[_0x57c3('0x47')][_0x57c3('0x18')]:!_[_0x57c3('0x1c')](_0x57e11b[_0x57c3('0x48')])?_0x57e11b['first_name']+'\x20'+_0x57e11b['last_name']:_0x57e11b[_0x57c3('0x49')],'id':_0x57e11b['id']}}]},'headers':{'Authorization':_0x57c3('0x4a')+_0x4c58c8},'json':!![]})[_0x57c3('0x29')](function(_0x4195a7){if(_0x4195a7&&_0x4195a7[_0x57c3('0x41')][0x0]['code']===_0x57c3('0x4b')){var _0x4cedc0=_0x4195a7['data'][0x0][_0x57c3('0x4c')];_0x4cedc0[_0x57c3('0x42')]=_['startCase'](_0x395bf1[_0x57c3('0x46')])+'s';return _0x4cedc0;}logger[_0x57c3('0x2e')](_0x57c3('0x3f'),JSON[_0x57c3('0xe')](data));throw new Error(_0x57c3('0x4d')+JSON[_0x57c3('0xe')](data));})[_0x57c3('0x2d')](function(_0x1bc04c){console[_0x57c3('0x4e')]('CREATE\x20ERROR',_0x1bc04c);});}function getEndUser(_0x22e368,_0x47cb4a,_0x31c950,_0x1c4e96,_0x1a60f9,_0x1a715d,_0x259d68){var _0x3951ad={'method':_0x57c3('0x33'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x22e368},'json':!![]};switch(_0x259d68[_0x57c3('0x4f')]){case _0x57c3('0x50'):_0x3951ad[_0x57c3('0x51')]=_0x57c3('0x43')+_0x47cb4a+_0x57c3('0x52')+_0x1a60f9+'))';return getZohoUser(_0x3951ad,_0x57c3('0x53'))[_0x57c3('0x29')](function(_0x9310d2){if(_0x9310d2)return _0x9310d2;_0x3951ad[_0x57c3('0x51')]='https://www.zohoapis.'+_0x47cb4a+_0x57c3('0x54')+_0x1a60f9+'))';return getZohoUser(_0x3951ad,'Leads')['then'](function(_0x452ab1){if(_0x452ab1)return _0x452ab1;if(_0x259d68[_0x57c3('0x46')]!='nothing'){return createEndUser(_0x22e368,_0x47cb4a,_0x1c4e96,_0x1a60f9,_0x1a715d,_0x259d68);}else{return{};}});});break;case _0x57c3('0x55'):_0x3951ad['uri']=_0x57c3('0x43')+_0x47cb4a+_0x57c3('0x52')+_0x1a60f9+'))';return getZohoUser(_0x3951ad,_0x57c3('0x53'))[_0x57c3('0x29')](function(_0xd3294b){if(_0xd3294b)return _0xd3294b;if(_0x259d68['moduleCreate']!=_0x57c3('0x56')){return createEndUser(_0x22e368,_0x47cb4a,_0x1c4e96,_0x1a60f9,_0x1a715d,_0x259d68);}else{return{};}});break;case _0x57c3('0x57'):_0x3951ad[_0x57c3('0x51')]='https://www.zohoapis.'+_0x47cb4a+_0x57c3('0x54')+_0x1a60f9+'))';return getZohoUser(_0x3951ad,_0x57c3('0x58'))['then'](function(_0x5128fd){if(_0x5128fd)return _0x5128fd;if(_0x259d68[_0x57c3('0x46')]!=_0x57c3('0x56')){return createEndUser(_0x22e368,_0x47cb4a,_0x1c4e96,_0x1a60f9,_0x1a715d,_0x259d68);}else{return{};}});break;}}function getCall(_0x57fc8,_0x11a610,_0x4c0a63,_0x18db72,_0x4d3a54,_0x269e52,_0x2e2c7f,_0x1381c8){logger['info'](_0x57c3('0x59'));var _0x342de8={};_0x342de8[_0x57c3('0x5a')]={'name':!_[_0x57c3('0x1c')](_0x18db72[_0x57c3('0x47')][_0x57c3('0x18')])&&!_['isNil'](_0x18db72[_0x57c3('0x3c')]['name'])&&_0x18db72[_0x57c3('0x3c')][_0x57c3('0x18')]==='administrator'?_0x18db72[_0x57c3('0x47')][_0x57c3('0x18')]:!_[_0x57c3('0x1c')](_0x18db72['first_name'])?_0x18db72['first_name']+'\x20'+_0x18db72[_0x57c3('0x49')]:_0x18db72[_0x57c3('0x49')],'id':_0x18db72['id']};_0x342de8[_0x57c3('0x5b')]=intUtil[_0x57c3('0x5c')](_0x269e52[_0x57c3('0x5d')],_0x2e2c7f,'\x20');_0x342de8[_0x57c3('0x5e')]=intUtil[_0x57c3('0x5c')](_0x269e52[_0x57c3('0x5f')],_0x2e2c7f,'\x0a');if(_0x4d3a54[_0x57c3('0x42')]==='Contacts'){_0x342de8[_0x57c3('0x60')]={'name':!_[_0x57c3('0x1c')](_0x4d3a54['Full_Name'])?_0x4d3a54[_0x57c3('0x61')]:!_[_0x57c3('0x1c')](_0x4d3a54['First_Name'])?_0x4d3a54[_0x57c3('0x62')]+'\x20'+_0x4d3a54[_0x57c3('0x63')]:_0x4d3a54[_0x57c3('0x63')],'id':_0x4d3a54['id']};}if(_0x4d3a54[_0x57c3('0x42')]===_0x57c3('0x58')){_0x342de8[_0x57c3('0x64')]={'name':!_[_0x57c3('0x1c')](_0x4d3a54[_0x57c3('0x61')])?_0x4d3a54[_0x57c3('0x61')]:!_[_0x57c3('0x1c')](_0x4d3a54['First_Name'])?_0x4d3a54[_0x57c3('0x62')]+'\x20'+_0x4d3a54[_0x57c3('0x63')]:_0x4d3a54['Last_Name'],'id':_0x4d3a54['id']};_0x342de8[_0x57c3('0x65')]=_[_0x57c3('0x45')](_0x4d3a54['enduserType']);}if(_0x2e2c7f[_0x57c3('0x66')]){_0x342de8[_0x57c3('0x67')]=moment[_0x57c3('0x68')](parseInt(_0x2e2c7f[_0x57c3('0x66')])*0x3e8)[_0x57c3('0x34')]('mm:ss');}else if(_0x2e2c7f['answertime']&&_0x2e2c7f['endtime']){_0x342de8[_0x57c3('0x67')]=moment[_0x57c3('0x68')](moment(_0x2e2c7f['endtime'],_0x57c3('0x69'))[_0x57c3('0x6a')](moment(_0x2e2c7f['starttime'],_0x57c3('0x69'))))[_0x57c3('0x34')](_0x57c3('0x6b'));}switch(_0x2e2c7f[_0x57c3('0x6c')]){case _0x57c3('0x6d'):_0x342de8['Call_Result']='Called';break;case _0x57c3('0x6e'):case _0x57c3('0x6f'):_0x342de8[_0x57c3('0x70')]=_0x57c3('0x71');break;case _0x57c3('0x72'):_0x342de8[_0x57c3('0x70')]=_0x57c3('0x73');break;case _0x57c3('0x74'):_0x342de8['Call_Result']='Abandoned';break;case'timeout':_0x342de8[_0x57c3('0x70')]=_0x57c3('0x75');default:}_0x342de8[_0x57c3('0x76')]=(_0x1381c8===_0x57c3('0x77')?moment(_0x2e2c7f[_0x57c3('0x78')])[_0x57c3('0x34')](_0x57c3('0x69')):moment(_0x2e2c7f[_0x57c3('0x79')])[_0x57c3('0x34')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x57c3('0x34')]('YYYY-MM-DDTHH:mm:ss');_0x342de8[_0x57c3('0x7a')]=_0x1381c8||_0x57c3('0x7b');_0x342de8=_['merge'](_0x342de8,getCustomFields(_0x269e52[_0x57c3('0x7c')],_0x2e2c7f));return request({'method':_0x57c3('0x23'),'uri':_0x57c3('0x43')+_0x11a610+_0x57c3('0x7d'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x57fc8},'body':{'data':[_0x342de8]},'json':!![]})[_0x57c3('0x29')](function(_0x24f04e){if(_0x24f04e&&_0x24f04e[_0x57c3('0x41')][0x0][_0x57c3('0x7e')]===_0x57c3('0x4b')){logger[_0x57c3('0x31')](_0x57c3('0x7f'));return{'id':_0x24f04e['data'][0x0][_0x57c3('0x4c')]['id']};}})[_0x57c3('0x2d')](function(_0x1759e4){logger[_0x57c3('0x31')](_0x57c3('0x80'),_0x1759e4[_0x57c3('0x30')]);console[_0x57c3('0x4e')](_0x57c3('0x80'),_0x1759e4);});}exports[_0x57c3('0x81')]=function(_0x62e176,_0x342661,_0x1b24a2,_0x451731,_0x1abda1,_0x132fb8){var _0x2d78a3,_0x5c8fd0,_0xb31af2;_0x132fb8[_0x57c3('0x82')]=intUtil[_0x57c3('0x83')](_0x132fb8[_0x57c3('0x82')]);_0x132fb8[_0x57c3('0x84')]=intUtil['stripTrailingSlash'](_0x132fb8['serverUrl']);if(_0x1abda1&&_0x1abda1[_0x57c3('0x85')]){logger[_0x57c3('0x31')](_0x57c3('0x86'),_0x57c3('0x87'));_0x342661[_0x57c3('0x88')]=_0x132fb8[_0x57c3('0x84')]+_0x57c3('0x89')+_0x342661[_0x57c3('0x8a')]+_0x57c3('0x8b')+md5(_0x342661['uniqueid']);}else{_0x342661[_0x57c3('0x88')]='';}var _0x7cbe47=_0x132fb8[_0x57c3('0x82')]===_0x57c3('0x8c')?'eu':_0x57c3('0x8d');return getAccessToken(_0x132fb8)[_0x57c3('0x29')](function(_0x28df7b){_0xb31af2=_0x28df7b;return getUser(_0xb31af2,_0x7cbe47,_0x132fb8,_0x451731['email']);})[_0x57c3('0x29')](function(_0x18114c){_0x2d78a3=_0x18114c;logger[_0x57c3('0x31')]('The\x20User\x20ID\x20is:',_0x2d78a3['id']);return getEndUser(_0xb31af2,_0x7cbe47,_0x132fb8,_0x342661[_0x57c3('0x8e')],_0x342661[_0x57c3('0x8f')],_0x2d78a3,_0x1b24a2);})['then'](function(_0x33d8c2){_0x5c8fd0=_0x33d8c2;return getCall(_0xb31af2,_0x7cbe47,_0x132fb8,_0x2d78a3,_0x5c8fd0,_0x1b24a2,_0x342661,_0x57c3('0x7b'));})['then'](function(_0x3d957d){if(_0x3d957d){logger[_0x57c3('0x31')]('The\x20Call\x20ID\x20is:',_0x3d957d['id']);logger[_0x57c3('0x31')](_0x57c3('0x86'),_0x57c3('0x90'));emit(util['format'](_0x57c3('0x91'),_0x451731[_0x57c3('0x18')]),'trigger:browser:url',{'uri':_0x57c3('0x92')+_0x132fb8[_0x57c3('0x82')]+'/crm/EntityInfo.do?module=Calls&id='+_0x3d957d['id']});}})[_0x57c3('0x2d')](function(_0x3bc3b9){logger[_0x57c3('0x2e')]('[QUEUE]',JSON[_0x57c3('0xe')](_0x3bc3b9));});};exports[_0x57c3('0x77')]=function(_0x531607,_0x53c5c8,_0x11faf2,_0x16c562,_0x129390,_0x564c83,_0x3f85e7){var _0x5c721e,_0x10f92a,_0x57f131;_0x564c83[_0x57c3('0x82')]=intUtil[_0x57c3('0x83')](_0x564c83[_0x57c3('0x82')]);_0x564c83[_0x57c3('0x84')]=intUtil[_0x57c3('0x83')](_0x564c83['serverUrl']);if(_0x3f85e7&&_0x3f85e7[_0x57c3('0x93')]&&_0x3f85e7['recordingFormat']!==_0x57c3('0x94')){logger[_0x57c3('0x31')](_0x57c3('0x95'),_0x57c3('0x87'));_0x53c5c8[_0x57c3('0x88')]=_0x564c83['serverUrl']+_0x57c3('0x89')+_0x53c5c8['uniqueid']+_0x57c3('0x8b')+md5(_0x53c5c8[_0x57c3('0x8a')]);}var _0x1343b4=_0x564c83[_0x57c3('0x82')]==='zoho.eu'?'eu':_0x57c3('0x8d');return getAccessToken(_0x564c83)[_0x57c3('0x29')](function(_0x39bc1b){_0x57f131=_0x39bc1b;return getUser(_0x57f131,_0x1343b4,_0x564c83,_0x16c562[_0x57c3('0x96')]);})[_0x57c3('0x29')](function(_0x4c1777){_0x5c721e=_0x4c1777;logger[_0x57c3('0x31')]('The\x20User\x20ID\x20is:',_0x5c721e['id']);return getEndUser(_0x57f131,_0x1343b4,_0x564c83,_0x53c5c8[_0x57c3('0x97')],_0x53c5c8[_0x57c3('0x98')],_0x5c721e,_0x11faf2);})[_0x57c3('0x29')](function(_0x55ab39){_0x10f92a=_0x55ab39;return getCall(_0x57f131,_0x1343b4,_0x564c83,_0x5c721e,_0x10f92a,_0x11faf2,_0x53c5c8,_0x57c3('0x99'));})[_0x57c3('0x29')](function(_0xe03b47){if(_0xe03b47){logger[_0x57c3('0x31')]('The\x20Call\x20ID\x20is:',_0xe03b47['id']);logger[_0x57c3('0x31')](_0x57c3('0x95'),_0x57c3('0x90'));emit(util[_0x57c3('0x34')](_0x57c3('0x91'),_0x16c562[_0x57c3('0x18')]),_0x57c3('0x9a'),{'uri':'https://crm.'+_0x564c83[_0x57c3('0x82')]+_0x57c3('0x9b')+_0xe03b47['id']});}})[_0x57c3('0x2d')](function(_0x4315f5){logger[_0x57c3('0x2e')](_0x57c3('0x95'),JSON[_0x57c3('0xe')](_0x4315f5));});};exports['unmanaged']=function(_0x141b9d,_0x1ef9d8,_0x175910,_0xd26161,_0x41bb7a,_0x3a416e){var _0x18997c,_0x46c022,_0x3a6fcb;_0x3a416e['host']=intUtil['stripTrailingSlash'](_0x3a416e[_0x57c3('0x82')]);_0x3a416e[_0x57c3('0x84')]=intUtil['stripTrailingSlash'](_0x3a416e[_0x57c3('0x84')]);if(_0x41bb7a&&_0x41bb7a['monitor_format']){logger['info']('['+_0x1ef9d8[_0x57c3('0x6c')][_0x57c3('0x9c')]()+']',_0x57c3('0x87'));_0x1ef9d8[_0x57c3('0x88')]=_0x3a416e[_0x57c3('0x84')]+_0x57c3('0x89')+_0x1ef9d8[_0x57c3('0x8a')]+_0x57c3('0x8b')+md5(_0x1ef9d8[_0x57c3('0x8a')]);}else{_0x1ef9d8[_0x57c3('0x88')]='';}var _0x1a2149=_0x3a416e[_0x57c3('0x82')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x3a416e)[_0x57c3('0x29')](function(_0x42520c){_0x3a6fcb=_0x42520c;return getUser(_0x3a6fcb,_0x1a2149,_0x3a416e);})[_0x57c3('0x29')](function(_0x527643){_0x18997c=_0x527643;logger[_0x57c3('0x31')]('The\x20User\x20ID\x20is:',_0x18997c['id']);return getEndUser(_0x3a6fcb,_0x1a2149,_0x3a416e,_0x1ef9d8[_0x57c3('0x8e')],_0x1ef9d8[_0x57c3('0x8f')],_0x18997c,_0x175910);})[_0x57c3('0x29')](function(_0x39dbc4){_0x46c022=_0x39dbc4;return getCall(_0x3a6fcb,_0x1a2149,_0x3a416e,_0x18997c,_0x46c022,_0x175910,_0x1ef9d8,'Inbound');})['then'](function(_0x15053e){if(_0x15053e){logger[_0x57c3('0x31')](_0x57c3('0x9d'),_0x15053e['id']);}})[_0x57c3('0x2d')](function(_0xdf7fea){logger[_0x57c3('0x2e')]('['+_0x1ef9d8[_0x57c3('0x6c')][_0x57c3('0x9c')]()+']',JSON['stringify'](_0xdf7fea));});}; \ 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 cef7e33..506495d 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 _0x6bd0=['error','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','mustache','trigger','exec','data2','Script','render','data3'];(function(_0x153da6,_0xc9bfde){var _0xf01a0d=function(_0x409ed5){while(--_0x409ed5){_0x153da6['push'](_0x153da6['shift']());}};_0xf01a0d(++_0xc9bfde);}(_0x6bd0,0x161));var _0x06bd=function(_0x548924,_0x18acc1){_0x548924=_0x548924-0x0;var _0x36bbdc=_0x6bd0[_0x548924];return _0x36bbdc;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require(_0x06bd('0x0'));var logger=require('../../../../config/logger')(_0x06bd('0x1'));exports[_0x06bd('0x2')]=function(_0x25d35b,_0x121763){var _0x47a4d5=_0x25d35b[_0x06bd('0x3')]?_0x25d35b['data2']:_0x06bd('0x4');var _0x367489=_0x25d35b['data3']?Mustache[_0x06bd('0x5')](_0x25d35b[_0x06bd('0x6')],_0x121763):_0x121763;sh['exec'](_0x367489,function(_0x1cfbd2,_0x4c5cc0,_0x678e85){if(_0x1cfbd2!==0x0){logger[_0x06bd('0x7')](util[_0x06bd('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x47a4d5,_0x367489,_0x1cfbd2,_0x678e85));}else{logger['info'](util[_0x06bd('0x8')](_0x06bd('0x9'),_0x47a4d5,_0x367489,_0x4c5cc0));}});}; \ No newline at end of file +var _0x48ea=['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','shelljs','../../../../config/logger','trigger','data2','data3','render'];(function(_0x554e8f,_0x1c5790){var _0x5589e1=function(_0x484c4b){while(--_0x484c4b){_0x554e8f['push'](_0x554e8f['shift']());}};_0x5589e1(++_0x1c5790);}(_0x48ea,0x18c));var _0xa48e=function(_0x295d37,_0x3792c2){_0x295d37=_0x295d37-0x0;var _0x488c5b=_0x48ea[_0x295d37];return _0x488c5b;};'use strict';var util=require(_0xa48e('0x0'));var sh=require(_0xa48e('0x1'));var Mustache=require('mustache');var logger=require(_0xa48e('0x2'))(_0xa48e('0x3'));exports['exec']=function(_0x42887e,_0x5b9361){var _0x1a73c5=_0x42887e[_0xa48e('0x4')]?_0x42887e[_0xa48e('0x4')]:'Script';var _0x4d0915=_0x42887e[_0xa48e('0x5')]?Mustache[_0xa48e('0x6')](_0x42887e[_0xa48e('0x5')],_0x5b9361):_0x5b9361;sh[_0xa48e('0x7')](_0x4d0915,function(_0x3c4138,_0x4deaff,_0x459ac6){if(_0x3c4138!==0x0){logger[_0xa48e('0x8')](util[_0xa48e('0x9')](_0xa48e('0xa'),_0x1a73c5,_0x4d0915,_0x3c4138,_0x459ac6));}else{logger[_0xa48e('0xb')](util[_0xa48e('0x9')](_0xa48e('0xc'),_0x1a73c5,_0x4d0915,_0x4deaff));}});}; \ 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 46c96c6..b70535c 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 _0x2dd9=['stack','data1','GET','DELETE','POST','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','body','object','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache','../../../../config/logger','exec','toUpperCase','render','data2','data5','number','headers','data6','parse','error'];(function(_0x14bb52,_0x5040a6){var _0x1a62e8=function(_0x5e41ef){while(--_0x5e41ef){_0x14bb52['push'](_0x14bb52['shift']());}};_0x1a62e8(++_0x5040a6);}(_0x2dd9,0x168));var _0x92dd=function(_0x22b022,_0x4af786){_0x22b022=_0x22b022-0x0;var _0x3d29b8=_0x2dd9[_0x22b022];return _0x3d29b8;};'use strict';var rp=require(_0x92dd('0x0'));var util=require(_0x92dd('0x1'));var _=require('lodash');var Mustache=require(_0x92dd('0x2'));var logger=require(_0x92dd('0x3'))('trigger');exports[_0x92dd('0x4')]=function(_0x5e9be8,_0x85e6ed){var _0x2e01bf,_0x3f11e7;var _0x341a48={'method':_0x5e9be8['data1'][_0x92dd('0x5')](),'uri':Mustache[_0x92dd('0x6')](_0x5e9be8[_0x92dd('0x7')],_0x85e6ed),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5e9be8[_0x92dd('0x8')])===_0x92dd('0x9')&&parseInt(_0x5e9be8[_0x92dd('0x8')])>=0x1&&parseInt(_0x5e9be8[_0x92dd('0x8')])<=0xa?parseInt(_0x5e9be8[_0x92dd('0x8')])*0x3e8:0x5*0x3e8};try{_0x341a48[_0x92dd('0xa')]=_0x5e9be8[_0x92dd('0xb')]?JSON[_0x92dd('0xc')](Mustache[_0x92dd('0x6')](_0x5e9be8[_0x92dd('0xb')],_0x85e6ed)):{};}catch(_0x314ea5){logger[_0x92dd('0xd')](_0x314ea5[_0x92dd('0xe')]);}switch(_0x5e9be8[_0x92dd('0xf')]['toUpperCase']()){case _0x92dd('0x10'):case _0x92dd('0x11'):_0x2e01bf=null;_0x341a48['qs']=_0x85e6ed;break;case _0x92dd('0x12'):case'PUT':if(_0x5e9be8['data7']){try{_0x2e01bf=JSON[_0x92dd('0xc')](Mustache[_0x92dd('0x6')](_0x5e9be8['data7'],_0x85e6ed));_0x341a48['body']=_0x2e01bf;}catch(_0x4ca055){logger['error'](_0x4ca055[_0x92dd('0xe')]);logger[_0x92dd('0xd')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2e01bf=_0x85e6ed;_0x341a48['body']=_0x2e01bf;}break;}logger['info'](util['format'](_0x92dd('0x13'),_0x5e9be8[_0x92dd('0xf')],_0x5e9be8[_0x92dd('0x7')],JSON[_0x92dd('0x14')](_0x341a48)));rp(_0x341a48)[_0x92dd('0x15')](function(_0x42c7c1){_0x2e01bf=!_[_0x92dd('0x16')](_0x2e01bf)?_0x92dd('0x17')+_0x2e01bf:'';_0x3f11e7=typeof _0x42c7c1[_0x92dd('0x18')]===_0x92dd('0x19')?JSON[_0x92dd('0x14')](_0x42c7c1['body']):_0x42c7c1[_0x92dd('0x18')];logger[_0x92dd('0x1a')](util[_0x92dd('0x1b')](_0x92dd('0x1c'),_0x5e9be8[_0x92dd('0xf')],_0x5e9be8['data2'],_0x42c7c1[_0x92dd('0x1d')],_0x3f11e7));})[_0x92dd('0x1e')](function(_0x506582){logger['error'](util['format'](_0x92dd('0x1f'),_0x5e9be8[_0x92dd('0xf')],_0x5e9be8['data2'],_0x506582[_0x92dd('0x1d')],_0x506582[_0x92dd('0x20')],_0x506582[_0x92dd('0x21')]));});}; \ No newline at end of file +var _0x7f2c=['PUT','data7','body','format','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','exec','data1','data2','data5','number','headers','data6','parse','render','stack','GET','DELETE','POST'];(function(_0x2219d5,_0x465b6b){var _0x376266=function(_0x43b2e7){while(--_0x43b2e7){_0x2219d5['push'](_0x2219d5['shift']());}};_0x376266(++_0x465b6b);}(_0x7f2c,0x10f));var _0xc7f2=function(_0x3349fe,_0x111770){_0x3349fe=_0x3349fe-0x0;var _0x3f8bc5=_0x7f2c[_0x3349fe];return _0x3f8bc5;};'use strict';var rp=require(_0xc7f2('0x0'));var util=require(_0xc7f2('0x1'));var _=require(_0xc7f2('0x2'));var Mustache=require(_0xc7f2('0x3'));var logger=require('../../../../config/logger')('trigger');exports[_0xc7f2('0x4')]=function(_0x4d7d12,_0x176959){var _0x103266,_0x3e7720;var _0x58e354={'method':_0x4d7d12[_0xc7f2('0x5')]['toUpperCase'](),'uri':Mustache['render'](_0x4d7d12[_0xc7f2('0x6')],_0x176959),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4d7d12[_0xc7f2('0x7')])===_0xc7f2('0x8')&&parseInt(_0x4d7d12['data5'])>=0x1&&parseInt(_0x4d7d12[_0xc7f2('0x7')])<=0xa?parseInt(_0x4d7d12[_0xc7f2('0x7')])*0x3e8:0x5*0x3e8};try{_0x58e354[_0xc7f2('0x9')]=_0x4d7d12[_0xc7f2('0xa')]?JSON[_0xc7f2('0xb')](Mustache[_0xc7f2('0xc')](_0x4d7d12['data6'],_0x176959)):{};}catch(_0x385e8d){logger['error'](_0x385e8d[_0xc7f2('0xd')]);}switch(_0x4d7d12[_0xc7f2('0x5')]['toUpperCase']()){case _0xc7f2('0xe'):case _0xc7f2('0xf'):_0x103266=null;_0x58e354['qs']=_0x176959;break;case _0xc7f2('0x10'):case _0xc7f2('0x11'):if(_0x4d7d12[_0xc7f2('0x12')]){try{_0x103266=JSON['parse'](Mustache[_0xc7f2('0xc')](_0x4d7d12['data7'],_0x176959));_0x58e354[_0xc7f2('0x13')]=_0x103266;}catch(_0x360803){logger['error'](_0x360803[_0xc7f2('0xd')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x103266=_0x176959;_0x58e354[_0xc7f2('0x13')]=_0x103266;}break;}logger['info'](util[_0xc7f2('0x14')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x4d7d12['data1'],_0x4d7d12[_0xc7f2('0x6')],JSON[_0xc7f2('0x15')](_0x58e354)));rp(_0x58e354)[_0xc7f2('0x16')](function(_0x3f91ae){_0x103266=!_[_0xc7f2('0x17')](_0x103266)?_0xc7f2('0x18')+_0x103266:'';_0x3e7720=typeof _0x3f91ae[_0xc7f2('0x13')]===_0xc7f2('0x19')?JSON[_0xc7f2('0x15')](_0x3f91ae[_0xc7f2('0x13')]):_0x3f91ae['body'];logger['info'](util[_0xc7f2('0x14')](_0xc7f2('0x1a'),_0x4d7d12[_0xc7f2('0x5')],_0x4d7d12[_0xc7f2('0x6')],_0x3f91ae[_0xc7f2('0x1b')],_0x3e7720));})[_0xc7f2('0x1c')](function(_0x331ee3){logger['error'](util[_0xc7f2('0x14')](_0xc7f2('0x1d'),_0x4d7d12[_0xc7f2('0x5')],_0x4d7d12[_0xc7f2('0x6')],_0x331ee3[_0xc7f2('0x1b')],_0x331ee3[_0xc7f2('0x1e')],_0x331ee3[_0xc7f2('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index cd2efa9..92a9f7c 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 _0xf40c=['then','rpc','error','message','result','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf40c,0x18c));var _0xcf40=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xf40c[_0x2a6809];return _0x11c371;};'use strict';var jayson=require(_0xcf40('0x0'));var BPromise=require(_0xcf40('0x1'));var logger=require(_0xcf40('0x2'))(_0xcf40('0x3'));var client=jayson[_0xcf40('0x4')][_0xcf40('0x5')]({'port':0x2329});client['Request']=function(_0x1bbdee,_0x480ff5){return new BPromise(function(_0x22cc9e,_0x33eb14){return client[_0xcf40('0x6')](_0x1bbdee,_0x480ff5)[_0xcf40('0x7')](function(_0x5a5d1a){logger['debug'](_0xcf40('0x8'),_0xcf40('0x3'),_0x1bbdee,_0x480ff5,_0x5a5d1a);if(_0x5a5d1a[_0xcf40('0x9')]){logger[_0xcf40('0x9')](_0xcf40('0x8'),'routing',_0x1bbdee,_0x5a5d1a[_0xcf40('0x9')]['message'],_0x480ff5);return _0x33eb14(_0x5a5d1a[_0xcf40('0x9')][_0xcf40('0xa')]);}else{return _0x22cc9e(_0x5a5d1a[_0xcf40('0xb')]);}})['catch'](function(_0x3d687e){logger['error']('rpc',_0xcf40('0x3'),_0x1bbdee,_0x3d687e,_0x480ff5);return _0x33eb14(_0x3d687e);});});};module[_0xcf40('0xc')]=client; \ No newline at end of file +var _0x6dfb=['../../config/logger','routing','client','http','Request','request','debug','rpc','error','message','result','catch','jayson/promise','bluebird'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x6dfb,0xde));var _0xb6df=function(_0x398bcf,_0x3da484){_0x398bcf=_0x398bcf-0x0;var _0xbf80dc=_0x6dfb[_0x398bcf];return _0xbf80dc;};'use strict';var jayson=require(_0xb6df('0x0'));var BPromise=require(_0xb6df('0x1'));var logger=require(_0xb6df('0x2'))(_0xb6df('0x3'));var client=jayson[_0xb6df('0x4')][_0xb6df('0x5')]({'port':0x2329});client[_0xb6df('0x6')]=function(_0x3d047f,_0x220674){return new BPromise(function(_0x4c1ce8,_0x1333cf){return client[_0xb6df('0x7')](_0x3d047f,_0x220674)['then'](function(_0x314f3e){logger[_0xb6df('0x8')](_0xb6df('0x9'),_0xb6df('0x3'),_0x3d047f,_0x220674,_0x314f3e);if(_0x314f3e[_0xb6df('0xa')]){logger['error'](_0xb6df('0x9'),_0xb6df('0x3'),_0x3d047f,_0x314f3e[_0xb6df('0xa')][_0xb6df('0xb')],_0x220674);return _0x1333cf(_0x314f3e[_0xb6df('0xa')][_0xb6df('0xb')]);}else{return _0x4c1ce8(_0x314f3e[_0xb6df('0xc')]);}})[_0xb6df('0xd')](function(_0x3eb855){logger[_0xb6df('0xa')]('rpc',_0xb6df('0x3'),_0x3d047f,_0x3eb855,_0x220674);return _0x1333cf(_0x3eb855);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 15bd4b2..103a892 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 _0x1980=['loginMailFrequency','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','resolve','getMailAccounts','then','refresh','mailAccounts','getSettings'];(function(_0x5220f6,_0xab25f){var _0x32c0e0=function(_0x4ad714){while(--_0x4ad714){_0x5220f6['push'](_0x5220f6['shift']());}};_0x32c0e0(++_0xab25f);}(_0x1980,0x6f));var _0x0198=function(_0x370bc1,_0x123c05){_0x370bc1=_0x370bc1-0x0;var _0x10a973=_0x1980[_0x370bc1];return _0x10a973;};'use strict';var server=require(_0x0198('0x0'));var Realtime=require(_0x0198('0x1'));var EmailChannel=require(_0x0198('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x0198('0x3')]()['then'](mailAccount[_0x0198('0x4')]())[_0x0198('0x5')](realtime['initMailAccounts']())[_0x0198('0x5')](function(){email[_0x0198('0x6')](realtime[_0x0198('0x7')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x0198('0x5')](function(){return initRealtime();})[_0x0198('0x5')](function(){return setting[_0x0198('0x8')]();})[_0x0198('0x5')](function(_0x50e037){return setInterval(initRealtime,_0x50e037[_0x0198('0x9')]*0x3e8);})['catch'](function(_0x4122ae){logger[_0x0198('0xa')](_0x0198('0xb'),_0x4122ae);});}main(); \ No newline at end of file +var _0x7758=['mailAccounts','listen','getSettings','error','./realtime','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts'];(function(_0x5f3fd3,_0x45a0fc){var _0x27a5a5=function(_0x4eb3e6){while(--_0x4eb3e6){_0x5f3fd3['push'](_0x5f3fd3['shift']());}};_0x27a5a5(++_0x45a0fc);}(_0x7758,0x122));var _0x8775=function(_0x111f24,_0x4d309d){_0x111f24=_0x111f24-0x0;var _0x28f7f3=_0x7758[_0x111f24];return _0x28f7f3;};'use strict';var server=require('./server');var Realtime=require(_0x8775('0x0'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x8775('0x1'));var setting=require(_0x8775('0x2'));var logger=require(_0x8775('0x3'))(_0x8775('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x8775('0x5')]()[_0x8775('0x6')](mailAccount[_0x8775('0x7')]())[_0x8775('0x6')](realtime[_0x8775('0x8')]())[_0x8775('0x6')](function(){email['refresh'](realtime[_0x8775('0x9')]);return realtime;});}function main(){return server[_0x8775('0xa')](realtime,email)[_0x8775('0x6')](function(){return initRealtime();})[_0x8775('0x6')](function(){return setting[_0x8775('0xb')]();})['then'](function(_0x478a0c){return setInterval(initRealtime,_0x478a0c['loginMailFrequency']*0x3e8);})['catch'](function(_0x2e08ce){logger[_0x8775('0xc')]('Email\x20service\x20initialization',_0x2e08ce);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 4146821..7b61e23 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 _0x62e0=['moment','bluebird','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./smtp','info','mailAccounts','imapAccounts','prototype','name','key','active','Imap','status','isNil','md5','mailAccount:update','refresh','service','provider','box','bind','handleImapEmail','handleImapEnd','handleImapError','disabled','handleImapBox','connected','messageStatus','messages','total','emit','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','smtp','send','Smtp','lastSync','verify','verified','exports','lodash'];(function(_0x9346c4,_0x36ac86){var _0x2922d4=function(_0x3659ca){while(--_0x3659ca){_0x9346c4['push'](_0x9346c4['shift']());}};_0x2922d4(++_0x36ac86);}(_0x62e0,0x6b));var _0x062e=function(_0x1e3ea1,_0x2a0e3a){_0x1e3ea1=_0x1e3ea1-0x0;var _0x51583a=_0x62e0[_0x1e3ea1];return _0x51583a;};'use strict';var _=require(_0x062e('0x0'));var moment=require(_0x062e('0x1'));var BPromise=require(_0x062e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x062e('0x3'));var logger=require(_0x062e('0x4'))(_0x062e('0x5'));config[_0x062e('0x6')]=_[_0x062e('0x7')](config[_0x062e('0x6')],{'host':_0x062e('0x8'),'port':0x18eb});var io=require(_0x062e('0x9'))(new Redis(config[_0x062e('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x062e('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x7be79e){logger[_0x062e('0xb')]('start\x20email\x20channel');this[_0x062e('0xc')]=_0x7be79e[_0x062e('0xc')];this[_0x062e('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x062e('0xe')]['emit']=function(_0xe01400){var _0x1e24d7=this['mailAccounts'][_0xe01400];var _0x46b141={'id':_0x1e24d7['id'],'name':_0x1e24d7[_0x062e('0xf')],'key':_0x1e24d7[_0x062e('0x10')],'active':_0x1e24d7[_0x062e('0x11')],'Imap':{'status':_0x1e24d7[_0x062e('0x12')][_0x062e('0x13')],'messageStatus':_0x1e24d7[_0x062e('0x12')]['messageStatus'],'total':_0x1e24d7['Imap']['total']}};if(_[_0x062e('0x14')](md5Accounts[_0xe01400])){md5Accounts[_0xe01400]={};}var _0x4af2d6=md5(JSON['stringify'](_0x46b141));if(md5Accounts[_0xe01400]['md5']!==_0x4af2d6){md5Accounts[_0xe01400][_0x062e('0x15')]=_0x4af2d6;io['emit'](_0x062e('0x16'),_0x46b141);}};EmailChannel[_0x062e('0xe')][_0x062e('0x17')]=function(_0x6cbb29){for(var _0x54f00c in _0x6cbb29){if(_0x6cbb29['hasOwnProperty'](_0x54f00c)){if(_0x6cbb29[_0x54f00c]['Imap']&&_0x6cbb29[_0x54f00c]['active']){var _0x5f1c61=_0x6cbb29[_0x54f00c]['Imap'];if(!_0x5f1c61[_0x062e('0x18')]&&_0x6cbb29[_0x54f00c][_0x062e('0x19')]!=='custom')_0x5f1c61['service']=_0x6cbb29[_0x54f00c][_0x062e('0x19')];if(!this[_0x062e('0xd')]['hasOwnProperty'](_0x5f1c61['id'])){this[_0x062e('0xd')][_0x5f1c61['id']]=new EmailImap(_0x5f1c61,_0x6cbb29[_0x54f00c][_0x062e('0x5')]);this[_0x062e('0xd')][_0x5f1c61['id']]['on'](_0x062e('0x1a'),this['handleImapBox'][_0x062e('0x1b')](this,_0x54f00c));this['imapAccounts'][_0x5f1c61['id']]['on'](_0x062e('0x5'),this[_0x062e('0x1c')][_0x062e('0x1b')](this,_0x54f00c));this[_0x062e('0xd')][_0x5f1c61['id']]['on']('end',this[_0x062e('0x1d')][_0x062e('0x1b')](this,_0x54f00c));this[_0x062e('0xd')][_0x5f1c61['id']]['on']('error',this[_0x062e('0x1e')][_0x062e('0x1b')](this,_0x54f00c));}}else{if(_['isNil'](this['mailAccounts'][_0x54f00c]['Imap'])){this[_0x062e('0xc')][_0x54f00c][_0x062e('0x12')]={};}this[_0x062e('0xc')][_0x54f00c][_0x062e('0x12')]['status']=_0x062e('0x1f');this['mailAccounts'][_0x54f00c][_0x062e('0x12')]['messageStatus']='';this['emit'](_0x54f00c);}}}};EmailChannel[_0x062e('0xe')][_0x062e('0x20')]=function(_0x107562,_0x52e131){if(this[_0x062e('0xc')][_0x107562]){this[_0x062e('0xc')][_0x107562][_0x062e('0x12')][_0x062e('0x13')]=_0x062e('0x21');this['mailAccounts'][_0x107562][_0x062e('0x12')][_0x062e('0x22')]=_0x52e131[_0x062e('0xf')];if(_0x52e131[_0x062e('0x23')]){this['mailAccounts'][_0x107562][_0x062e('0x12')][_0x062e('0x24')]=_0x52e131[_0x062e('0x23')]['total'];}return this[_0x062e('0x25')](_0x107562);}};EmailChannel[_0x062e('0xe')][_0x062e('0x1c')]=function(_0x2734d7,_0x11c4bc){logger[_0x062e('0xb')](_0x062e('0x26'),_0x11c4bc['firstName'],_0x11c4bc[_0x062e('0x27')],_0x11c4bc[_0x062e('0x28')],_0x2734d7);if(this[_0x062e('0xc')][_0x2734d7]){return mailAccount[_0x062e('0x29')](_0x2734d7,_0x11c4bc)[_0x062e('0x2a')](function(_0x15bc08){if(_0x15bc08){logger[_0x062e('0xb')](_0x062e('0x2b'));}})[_0x062e('0x2c')](function(_0x2d9b2a){logger[_0x062e('0x2d')](_0x062e('0x2e'),JSON['stringify'](_0x2d9b2a));});}};EmailChannel[_0x062e('0xe')]['handleImapEnd']=function(_0x46b9bb){if(this[_0x062e('0xc')][_0x46b9bb]&&this['mailAccounts'][_0x46b9bb][_0x062e('0x12')]){if(this['imapAccounts'][this[_0x062e('0xc')][_0x46b9bb][_0x062e('0x12')]['id']]){delete this[_0x062e('0xd')][this[_0x062e('0xc')][_0x46b9bb]['Imap']['id']];}this[_0x062e('0xc')][_0x46b9bb]['Imap']['lastSync']=moment();this[_0x062e('0x25')](_0x46b9bb);}};EmailChannel['prototype']['handleImapError']=function(_0x292796,_0x28b336){if(this[_0x062e('0xc')][_0x292796]){this[_0x062e('0xc')][_0x292796][_0x062e('0x12')]['status']=_0x062e('0x2d');this['mailAccounts'][_0x292796]['Imap']['messageStatus']=_0x28b336;return this[_0x062e('0x25')](_0x292796);}};EmailChannel['prototype']['sendMail']=function(_0xe59fd8,_0x2a8d9b){return this[_0x062e('0x2f')][_0x062e('0x30')](_0xe59fd8,_0x2a8d9b);};EmailChannel[_0x062e('0xe')]['verifySmtp']=function(_0x4ad769){var _0x467470=this;if(this[_0x062e('0xc')][_0x4ad769['id']]){if(_[_0x062e('0x14')](this[_0x062e('0xc')][_0x4ad769['id']][_0x062e('0x31')])){this[_0x062e('0xc')][_0x4ad769['id']]['Smtp']={};}this[_0x062e('0xc')][_0x4ad769['id']][_0x062e('0x31')][_0x062e('0x32')]=moment();return new BPromise(function(_0x20b402,_0x308023){return _0x467470[_0x062e('0x2f')][_0x062e('0x33')](_0x4ad769)[_0x062e('0x2a')](function(_0x3381cd){_0x467470[_0x062e('0xc')][_0x4ad769['id']]['Smtp'][_0x062e('0x13')]=_0x062e('0x34');_0x467470['mailAccounts'][_0x4ad769['id']]['Smtp'][_0x062e('0x22')]='';_0x467470[_0x062e('0x25')](_0x4ad769['id']);_0x20b402(_0x3381cd);})[_0x062e('0x2c')](function(_0x7f443a){_0x467470['mailAccounts'][_0x4ad769['id']][_0x062e('0x31')][_0x062e('0x13')]=_0x062e('0x2d');_0x467470[_0x062e('0xc')][_0x4ad769['id']][_0x062e('0x31')][_0x062e('0x22')]=_0x7f443a;_0x467470['emit'](_0x4ad769['id']);_0x308023(_0x7f443a);});});}return this[_0x062e('0x2f')][_0x062e('0x33')](_0x4ad769);};module[_0x062e('0x35')]=EmailChannel; \ No newline at end of file +var _0xb61f=['connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','info','catch','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','localhost','socket.io-emitter','redis','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','imapAccounts','smtp','emit','mailAccounts','name','key','Imap','status','messageStatus','total','isNil','stringify','prototype','hasOwnProperty','active','service','provider','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','handleImapBox'];(function(_0x119b3e,_0x588d50){var _0x1169ae=function(_0x377422){while(--_0x377422){_0x119b3e['push'](_0x119b3e['shift']());}};_0x1169ae(++_0x588d50);}(_0xb61f,0x81));var _0xfb61=function(_0xda7ffb,_0x4a673f){_0xda7ffb=_0xda7ffb-0x0;var _0x28b42a=_0xb61f[_0xda7ffb];return _0x28b42a;};'use strict';var _=require(_0xfb61('0x0'));var moment=require(_0xfb61('0x1'));var BPromise=require('bluebird');var md5=require(_0xfb61('0x2'));var Redis=require(_0xfb61('0x3'));var config=require(_0xfb61('0x4'));var logger=require(_0xfb61('0x5'))(_0xfb61('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0xfb61('0x7'),'port':0x18eb});var io=require(_0xfb61('0x8'))(new Redis(config[_0xfb61('0x9')]));var EmailImap=require(_0xfb61('0xa'));var EmailSmtp=require(_0xfb61('0xb'));var mailAccount=require(_0xfb61('0xc'));var md5Accounts={};function EmailChannel(_0x1cfdf0){logger['info'](_0xfb61('0xd'));this['mailAccounts']=_0x1cfdf0['mailAccounts'];this[_0xfb61('0xe')]={};this[_0xfb61('0xf')]=new EmailSmtp();}EmailChannel['prototype'][_0xfb61('0x10')]=function(_0x5ca987){var _0x477460=this[_0xfb61('0x11')][_0x5ca987];var _0xa7a916={'id':_0x477460['id'],'name':_0x477460[_0xfb61('0x12')],'key':_0x477460[_0xfb61('0x13')],'active':_0x477460['active'],'Imap':{'status':_0x477460[_0xfb61('0x14')][_0xfb61('0x15')],'messageStatus':_0x477460[_0xfb61('0x14')][_0xfb61('0x16')],'total':_0x477460[_0xfb61('0x14')][_0xfb61('0x17')]}};if(_[_0xfb61('0x18')](md5Accounts[_0x5ca987])){md5Accounts[_0x5ca987]={};}var _0x576e41=md5(JSON[_0xfb61('0x19')](_0xa7a916));if(md5Accounts[_0x5ca987][_0xfb61('0x2')]!==_0x576e41){md5Accounts[_0x5ca987]['md5']=_0x576e41;io[_0xfb61('0x10')]('mailAccount:update',_0xa7a916);}};EmailChannel[_0xfb61('0x1a')]['refresh']=function(_0x2cd9c0){for(var _0x593493 in _0x2cd9c0){if(_0x2cd9c0[_0xfb61('0x1b')](_0x593493)){if(_0x2cd9c0[_0x593493][_0xfb61('0x14')]&&_0x2cd9c0[_0x593493][_0xfb61('0x1c')]){var _0x11c3fe=_0x2cd9c0[_0x593493][_0xfb61('0x14')];if(!_0x11c3fe[_0xfb61('0x1d')]&&_0x2cd9c0[_0x593493][_0xfb61('0x1e')]!=='custom')_0x11c3fe[_0xfb61('0x1d')]=_0x2cd9c0[_0x593493][_0xfb61('0x1e')];if(!this['imapAccounts'][_0xfb61('0x1b')](_0x11c3fe['id'])){this[_0xfb61('0xe')][_0x11c3fe['id']]=new EmailImap(_0x11c3fe,_0x2cd9c0[_0x593493][_0xfb61('0x6')]);this['imapAccounts'][_0x11c3fe['id']]['on']('box',this['handleImapBox'][_0xfb61('0x1f')](this,_0x593493));this[_0xfb61('0xe')][_0x11c3fe['id']]['on'](_0xfb61('0x6'),this[_0xfb61('0x20')]['bind'](this,_0x593493));this[_0xfb61('0xe')][_0x11c3fe['id']]['on'](_0xfb61('0x21'),this[_0xfb61('0x22')][_0xfb61('0x1f')](this,_0x593493));this[_0xfb61('0xe')][_0x11c3fe['id']]['on'](_0xfb61('0x23'),this[_0xfb61('0x24')]['bind'](this,_0x593493));}}else{if(_[_0xfb61('0x18')](this[_0xfb61('0x11')][_0x593493][_0xfb61('0x14')])){this[_0xfb61('0x11')][_0x593493][_0xfb61('0x14')]={};}this[_0xfb61('0x11')][_0x593493][_0xfb61('0x14')][_0xfb61('0x15')]=_0xfb61('0x25');this[_0xfb61('0x11')][_0x593493]['Imap']['messageStatus']='';this[_0xfb61('0x10')](_0x593493);}}}};EmailChannel['prototype'][_0xfb61('0x26')]=function(_0x1206a2,_0x12d54b){if(this[_0xfb61('0x11')][_0x1206a2]){this['mailAccounts'][_0x1206a2][_0xfb61('0x14')]['status']=_0xfb61('0x27');this[_0xfb61('0x11')][_0x1206a2][_0xfb61('0x14')][_0xfb61('0x16')]=_0x12d54b[_0xfb61('0x12')];if(_0x12d54b[_0xfb61('0x28')]){this[_0xfb61('0x11')][_0x1206a2][_0xfb61('0x14')][_0xfb61('0x17')]=_0x12d54b[_0xfb61('0x28')]['total'];}return this['emit'](_0x1206a2);}};EmailChannel[_0xfb61('0x1a')][_0xfb61('0x20')]=function(_0x449367,_0x5064b0){logger['info'](_0xfb61('0x29'),_0x5064b0[_0xfb61('0x2a')],_0x5064b0[_0xfb61('0x2b')],_0x5064b0[_0xfb61('0x2c')],_0x449367);if(this[_0xfb61('0x11')][_0x449367]){return mailAccount[_0xfb61('0x2d')](_0x449367,_0x5064b0)[_0xfb61('0x2e')](function(_0x12a436){if(_0x12a436){logger[_0xfb61('0x2f')]('Mail\x20accepted\x20from\x20routing');}})[_0xfb61('0x30')](function(_0x35f162){logger[_0xfb61('0x23')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xfb61('0x19')](_0x35f162));});}};EmailChannel[_0xfb61('0x1a')][_0xfb61('0x22')]=function(_0x5c2729){if(this[_0xfb61('0x11')][_0x5c2729]&&this[_0xfb61('0x11')][_0x5c2729]['Imap']){if(this['imapAccounts'][this[_0xfb61('0x11')][_0x5c2729][_0xfb61('0x14')]['id']]){delete this[_0xfb61('0xe')][this['mailAccounts'][_0x5c2729][_0xfb61('0x14')]['id']];}this[_0xfb61('0x11')][_0x5c2729][_0xfb61('0x14')][_0xfb61('0x31')]=moment();this[_0xfb61('0x10')](_0x5c2729);}};EmailChannel[_0xfb61('0x1a')]['handleImapError']=function(_0x4cd68d,_0x81f23b){if(this[_0xfb61('0x11')][_0x4cd68d]){this[_0xfb61('0x11')][_0x4cd68d][_0xfb61('0x14')][_0xfb61('0x15')]=_0xfb61('0x23');this[_0xfb61('0x11')][_0x4cd68d]['Imap'][_0xfb61('0x16')]=_0x81f23b;return this[_0xfb61('0x10')](_0x4cd68d);}};EmailChannel['prototype'][_0xfb61('0x32')]=function(_0x14fb73,_0x480327){return this[_0xfb61('0xf')][_0xfb61('0x33')](_0x14fb73,_0x480327);};EmailChannel[_0xfb61('0x1a')][_0xfb61('0x34')]=function(_0x9ffa3d){var _0x28c553=this;if(this[_0xfb61('0x11')][_0x9ffa3d['id']]){if(_[_0xfb61('0x18')](this['mailAccounts'][_0x9ffa3d['id']]['Smtp'])){this[_0xfb61('0x11')][_0x9ffa3d['id']][_0xfb61('0x35')]={};}this[_0xfb61('0x11')][_0x9ffa3d['id']][_0xfb61('0x35')][_0xfb61('0x31')]=moment();return new BPromise(function(_0x45635c,_0x49e4f1){return _0x28c553['smtp'][_0xfb61('0x36')](_0x9ffa3d)[_0xfb61('0x2e')](function(_0x39a51d){_0x28c553[_0xfb61('0x11')][_0x9ffa3d['id']]['Smtp'][_0xfb61('0x15')]=_0xfb61('0x37');_0x28c553['mailAccounts'][_0x9ffa3d['id']]['Smtp'][_0xfb61('0x16')]='';_0x28c553[_0xfb61('0x10')](_0x9ffa3d['id']);_0x45635c(_0x39a51d);})[_0xfb61('0x30')](function(_0x371b7c){_0x28c553[_0xfb61('0x11')][_0x9ffa3d['id']]['Smtp'][_0xfb61('0x15')]=_0xfb61('0x23');_0x28c553[_0xfb61('0x11')][_0x9ffa3d['id']]['Smtp'][_0xfb61('0x16')]=_0x371b7c;_0x28c553[_0xfb61('0x10')](_0x9ffa3d['id']);_0x49e4f1(_0x371b7c);});});}return this[_0xfb61('0xf')][_0xfb61('0x36')](_0x9ffa3d);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index f9903ef..d9161f3 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 _0x5d15=['hasOwnProperty','upperFirst','exports','lodash','util','mailparser','iconv','events','./utils','../../../config/logger','email','mailbox','account','getAccount','imap','once','ready','handleReady','bind','end','error','inherits','prototype','connTimeout','authTimeout','user','modernAuthentication','generateXOAuth2Token','CloudProvider','password','authentication','anonymous@xcally.com','host','port','tls','autotls','openBox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','handleEnd','stringify','textCode'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x5d15,0x7b));var _0x55d1=function(_0x22bee0,_0x412ecb){_0x22bee0=_0x22bee0-0x0;var _0x2d295b=_0x5d15[_0x22bee0];return _0x2d295b;};'use strict';var _=require(_0x55d1('0x0'));var util=require(_0x55d1('0x1'));var Imap=require('imap');var simpleParser=require(_0x55d1('0x2'))['simpleParser'];var Iconv=require(_0x55d1('0x3'))['Iconv'];var EventEmitter=require(_0x55d1('0x4'))['EventEmitter'];var utils=require(_0x55d1('0x5'));var logger=require(_0x55d1('0x6'))(_0x55d1('0x7'));function EmailImap(_0x167cd9,_0x471c00){this[_0x55d1('0x8')]=_0x167cd9['mailbox'];this[_0x55d1('0x9')]=this[_0x55d1('0xa')](_0x167cd9,_0x471c00);this[_0x55d1('0xb')]=new Imap(this[_0x55d1('0x9')]);this[_0x55d1('0xb')][_0x55d1('0xc')](_0x55d1('0xd'),this[_0x55d1('0xe')][_0x55d1('0xf')](this));this['imap'][_0x55d1('0xc')](_0x55d1('0x10'),this['handleEnd']['bind'](this));this[_0x55d1('0xb')]['on'](_0x55d1('0x11'),this['handleError'][_0x55d1('0xf')](this));this[_0x55d1('0xb')]['connect']();}util[_0x55d1('0x12')](EmailImap,EventEmitter);EmailImap[_0x55d1('0x13')][_0x55d1('0xa')]=function(_0x470ed4,_0x121018){var _0xf31cfb={'connTimeout':_0x470ed4[_0x55d1('0x14')]?_0x470ed4[_0x55d1('0x14')]*0x3e8:0x2710,'authTimeout':_0x470ed4[_0x55d1('0x15')]?_0x470ed4[_0x55d1('0x15')]*0x3e8:0x1388};if(_0x470ed4['service']){_0xf31cfb[_0x55d1('0x16')]=_0x470ed4['user'];if(_0x470ed4[_0x55d1('0x17')]){_0xf31cfb['xoauth2']=utils[_0x55d1('0x18')](_0x470ed4[_0x55d1('0x19')]['data5'],_0x470ed4[_0x55d1('0x16')]);}else{_0xf31cfb[_0x55d1('0x1a')]=_0x470ed4[_0x55d1('0x1a')];}}else{if(_0x470ed4[_0x55d1('0x1b')]){_0xf31cfb[_0x55d1('0x16')]=_0x470ed4[_0x55d1('0x16')];_0xf31cfb[_0x55d1('0x1a')]=_0x470ed4['password'];}}_0xf31cfb['email']=_0x121018||_0x470ed4['user']||_0x55d1('0x1c');_0xf31cfb[_0x55d1('0x1d')]=_0x470ed4['host'];_0xf31cfb[_0x55d1('0x1e')]=_0x470ed4['port']||0x3e1;if(_0x470ed4[_0x55d1('0x1f')]){_0xf31cfb['tls']=!![];}else{_0xf31cfb[_0x55d1('0x1f')]=![];_0xf31cfb[_0x55d1('0x20')]='required';}return _0xf31cfb;};EmailImap[_0x55d1('0x13')][_0x55d1('0xe')]=function(){this[_0x55d1('0xb')][_0x55d1('0x21')](this[_0x55d1('0x8')],![],this[_0x55d1('0x22')][_0x55d1('0xf')](this));};EmailImap[_0x55d1('0x13')][_0x55d1('0x22')]=function(_0x4f24b1,_0x35d268){if(_0x4f24b1){this[_0x55d1('0x23')](_0x4f24b1,!![]);}else{this[_0x55d1('0x24')](_0x55d1('0x25'),_0x35d268);this[_0x55d1('0x26')]();}};EmailImap[_0x55d1('0x13')][_0x55d1('0x27')]=function(_0x772f32){if(_0x772f32){this[_0x55d1('0x23')](_0x772f32,!![]);}else{this[_0x55d1('0xb')][_0x55d1('0x10')]();}};EmailImap[_0x55d1('0x13')][_0x55d1('0x26')]=function(){this[_0x55d1('0xb')][_0x55d1('0x28')]([_0x55d1('0x29')],this['handleReadUnseen'][_0x55d1('0xf')](this));};EmailImap[_0x55d1('0x13')][_0x55d1('0x2a')]=function(_0x224961,_0x2c0e52){if(_0x224961){this[_0x55d1('0x23')](_0x224961,!![]);}else{if(_0x2c0e52['length']){try{var _0x118029=this[_0x55d1('0xb')][_0x55d1('0x2b')](_0x2c0e52,{'bodies':'','markSeen':!![]});_0x118029['on'](_0x55d1('0x2c'),this[_0x55d1('0x2d')][_0x55d1('0xf')](this));_0x118029[_0x55d1('0xc')](_0x55d1('0x11'),this[_0x55d1('0x2e')][_0x55d1('0xf')](this));_0x118029[_0x55d1('0xc')](_0x55d1('0x10'),this[_0x55d1('0x2f')][_0x55d1('0xf')](this));}catch(_0x30de78){logger[_0x55d1('0x11')](_0x30de78);}}else{this[_0x55d1('0xb')][_0x55d1('0x30')](!![],this[_0x55d1('0x27')][_0x55d1('0xf')](this));}}};EmailImap[_0x55d1('0x13')][_0x55d1('0x2d')]=function(_0x4a1ecf){_0x4a1ecf['on'](_0x55d1('0x31'),this[_0x55d1('0x32')][_0x55d1('0xf')](this));_0x4a1ecf[_0x55d1('0xc')]('attributes',this[_0x55d1('0x33')]['bind'](this));_0x4a1ecf[_0x55d1('0xc')](_0x55d1('0x10'),this[_0x55d1('0x34')][_0x55d1('0xf')](this));};EmailImap[_0x55d1('0x13')][_0x55d1('0x32')]=function(_0x59813f){simpleParser(_0x59813f,{'Iconv':Iconv},this['handleSimpleParser'][_0x55d1('0xf')](this));};EmailImap[_0x55d1('0x13')][_0x55d1('0x33')]=function(){};EmailImap['prototype'][_0x55d1('0x34')]=function(){};EmailImap[_0x55d1('0x13')][_0x55d1('0x35')]=function(_0x349501,_0x2b5990){if(_0x349501){logger[_0x55d1('0x11')](_0x349501);}else{var _0x418c2e=this;utils['parser'](this['account'],_0x2b5990,function(_0x1321f1){_0x418c2e[_0x55d1('0x24')](_0x55d1('0x7'),_0x1321f1);});}};EmailImap['prototype'][_0x55d1('0x2f')]=function(){this[_0x55d1('0xb')][_0x55d1('0x30')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x55d1('0x13')][_0x55d1('0x2e')]=function(_0x4394af){this['handleError'](_0x4394af);this[_0x55d1('0xb')]['closeBox'](!![],this[_0x55d1('0x27')][_0x55d1('0xf')](this));};EmailImap[_0x55d1('0x13')][_0x55d1('0x36')]=function(){this[_0x55d1('0x24')](_0x55d1('0x10'));};EmailImap[_0x55d1('0x13')][_0x55d1('0x23')]=function(_0x2f7b46,_0x127916){logger[_0x55d1('0x11')]('handleError',this['account'][_0x55d1('0x7')],JSON[_0x55d1('0x37')](_0x2f7b46));var _0x3ace0a='';if(_0x2f7b46){if(_0x2f7b46[_0x55d1('0x38')]){_0x3ace0a=_0x2f7b46[_0x55d1('0x38')];}else{for(var _0x43dda0 in _0x2f7b46){if(_0x2f7b46[_0x55d1('0x39')](_0x43dda0)){_0x3ace0a+=_[_0x55d1('0x3a')](_0x43dda0)+':\x20'+_0x2f7b46[_0x43dda0]+'\x0a';}}}}if(_0x127916){this[_0x55d1('0xb')][_0x55d1('0x10')]();}else{this[_0x55d1('0x24')](_0x55d1('0x11'),_0x3ace0a);this[_0x55d1('0x24')](_0x55d1('0x10'));}};module[_0x55d1('0x3b')]=EmailImap; \ No newline at end of file +var _0x3363=['handleFetchError','body','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','closeBox','textCode','hasOwnProperty','upperFirst','exports','lodash','util','simpleParser','iconv','events','EventEmitter','./utils','email','mailbox','account','imap','bind','once','handleEnd','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','handleReady','openBox','handleOpenBox','emit','box','handleCloseBox','end','readUnseen','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage'];(function(_0x316904,_0x1e8b77){var _0xfa9a21=function(_0x2b75ae){while(--_0x2b75ae){_0x316904['push'](_0x316904['shift']());}};_0xfa9a21(++_0x1e8b77);}(_0x3363,0x8a));var _0x3336=function(_0x538cbd,_0x48d4ef){_0x538cbd=_0x538cbd-0x0;var _0x676281=_0x3363[_0x538cbd];return _0x676281;};'use strict';var _=require(_0x3336('0x0'));var util=require(_0x3336('0x1'));var Imap=require('imap');var simpleParser=require('mailparser')[_0x3336('0x2')];var Iconv=require(_0x3336('0x3'))['Iconv'];var EventEmitter=require(_0x3336('0x4'))[_0x3336('0x5')];var utils=require(_0x3336('0x6'));var logger=require('../../../config/logger')(_0x3336('0x7'));function EmailImap(_0x134f3c,_0x57db5b){this[_0x3336('0x8')]=_0x134f3c['mailbox'];this[_0x3336('0x9')]=this['getAccount'](_0x134f3c,_0x57db5b);this[_0x3336('0xa')]=new Imap(this[_0x3336('0x9')]);this[_0x3336('0xa')]['once']('ready',this['handleReady'][_0x3336('0xb')](this));this['imap'][_0x3336('0xc')]('end',this[_0x3336('0xd')]['bind'](this));this['imap']['on'](_0x3336('0xe'),this[_0x3336('0xf')][_0x3336('0xb')](this));this['imap'][_0x3336('0x10')]();}util[_0x3336('0x11')](EmailImap,EventEmitter);EmailImap[_0x3336('0x12')][_0x3336('0x13')]=function(_0x2bd9e4,_0x576cf9){var _0x10fbeb={'connTimeout':_0x2bd9e4[_0x3336('0x14')]?_0x2bd9e4['connTimeout']*0x3e8:0x2710,'authTimeout':_0x2bd9e4[_0x3336('0x15')]?_0x2bd9e4[_0x3336('0x15')]*0x3e8:0x1388};if(_0x2bd9e4[_0x3336('0x16')]){_0x10fbeb[_0x3336('0x17')]=_0x2bd9e4[_0x3336('0x17')];if(_0x2bd9e4[_0x3336('0x18')]){_0x10fbeb[_0x3336('0x19')]=utils[_0x3336('0x1a')](_0x2bd9e4[_0x3336('0x1b')][_0x3336('0x1c')],_0x2bd9e4[_0x3336('0x17')]);}else{_0x10fbeb['password']=_0x2bd9e4[_0x3336('0x1d')];}}else{if(_0x2bd9e4[_0x3336('0x1e')]){_0x10fbeb['user']=_0x2bd9e4['user'];_0x10fbeb[_0x3336('0x1d')]=_0x2bd9e4[_0x3336('0x1d')];}}_0x10fbeb[_0x3336('0x7')]=_0x576cf9||_0x2bd9e4[_0x3336('0x17')]||_0x3336('0x1f');_0x10fbeb['host']=_0x2bd9e4[_0x3336('0x20')];_0x10fbeb['port']=_0x2bd9e4[_0x3336('0x21')]||0x3e1;if(_0x2bd9e4[_0x3336('0x22')]){_0x10fbeb[_0x3336('0x22')]=!![];}else{_0x10fbeb[_0x3336('0x22')]=![];_0x10fbeb[_0x3336('0x23')]=_0x3336('0x24');}return _0x10fbeb;};EmailImap['prototype'][_0x3336('0x25')]=function(){this[_0x3336('0xa')][_0x3336('0x26')](this[_0x3336('0x8')],![],this['handleOpenBox'][_0x3336('0xb')](this));};EmailImap['prototype'][_0x3336('0x27')]=function(_0x5b2e45,_0x8dacd6){if(_0x5b2e45){this['handleError'](_0x5b2e45,!![]);}else{this[_0x3336('0x28')](_0x3336('0x29'),_0x8dacd6);this['readUnseen']();}};EmailImap[_0x3336('0x12')][_0x3336('0x2a')]=function(_0x1ec82a){if(_0x1ec82a){this[_0x3336('0xf')](_0x1ec82a,!![]);}else{this['imap'][_0x3336('0x2b')]();}};EmailImap[_0x3336('0x12')][_0x3336('0x2c')]=function(){this[_0x3336('0xa')][_0x3336('0x2d')]([_0x3336('0x2e')],this['handleReadUnseen'][_0x3336('0xb')](this));};EmailImap['prototype'][_0x3336('0x2f')]=function(_0xf4103d,_0x27c970){if(_0xf4103d){this[_0x3336('0xf')](_0xf4103d,!![]);}else{if(_0x27c970['length']){try{var _0x2b8428=this[_0x3336('0xa')][_0x3336('0x30')](_0x27c970,{'bodies':'','markSeen':!![]});_0x2b8428['on'](_0x3336('0x31'),this[_0x3336('0x32')][_0x3336('0xb')](this));_0x2b8428['once']('error',this[_0x3336('0x33')][_0x3336('0xb')](this));_0x2b8428[_0x3336('0xc')](_0x3336('0x2b'),this['handleFetchEnd']['bind'](this));}catch(_0xe8048e){logger[_0x3336('0xe')](_0xe8048e);}}else{this[_0x3336('0xa')]['closeBox'](!![],this[_0x3336('0x2a')][_0x3336('0xb')](this));}}};EmailImap[_0x3336('0x12')]['handleFetchMessage']=function(_0x13c488){_0x13c488['on'](_0x3336('0x34'),this['handleMessageBody'][_0x3336('0xb')](this));_0x13c488[_0x3336('0xc')]('attributes',this[_0x3336('0x35')][_0x3336('0xb')](this));_0x13c488['once']('end',this[_0x3336('0x36')]['bind'](this));};EmailImap[_0x3336('0x12')]['handleMessageBody']=function(_0x42e687){simpleParser(_0x42e687,{'Iconv':Iconv},this[_0x3336('0x37')][_0x3336('0xb')](this));};EmailImap[_0x3336('0x12')][_0x3336('0x35')]=function(){};EmailImap['prototype'][_0x3336('0x36')]=function(){};EmailImap[_0x3336('0x12')][_0x3336('0x37')]=function(_0x7b948f,_0x3ba821){if(_0x7b948f){logger[_0x3336('0xe')](_0x7b948f);}else{var _0x25169b=this;utils[_0x3336('0x38')](this['account'],_0x3ba821,function(_0x20eae9){_0x25169b[_0x3336('0x28')]('email',_0x20eae9);});}};EmailImap[_0x3336('0x12')][_0x3336('0x39')]=function(){this[_0x3336('0xa')][_0x3336('0x3a')](!![],this['handleCloseBox'][_0x3336('0xb')](this));};EmailImap[_0x3336('0x12')][_0x3336('0x33')]=function(_0xd1920){this[_0x3336('0xf')](_0xd1920);this['imap'][_0x3336('0x3a')](!![],this[_0x3336('0x2a')][_0x3336('0xb')](this));};EmailImap[_0x3336('0x12')][_0x3336('0xd')]=function(){this['emit']('end');};EmailImap['prototype'][_0x3336('0xf')]=function(_0x35a415,_0x10e606){logger[_0x3336('0xe')](_0x3336('0xf'),this[_0x3336('0x9')][_0x3336('0x7')],JSON['stringify'](_0x35a415));var _0x440637='';if(_0x35a415){if(_0x35a415[_0x3336('0x3b')]){_0x440637=_0x35a415[_0x3336('0x3b')];}else{for(var _0x15bce8 in _0x35a415){if(_0x35a415[_0x3336('0x3c')](_0x15bce8)){_0x440637+=_[_0x3336('0x3d')](_0x15bce8)+':\x20'+_0x35a415[_0x15bce8]+'\x0a';}}}}if(_0x10e606){this['imap'][_0x3336('0x2b')]();}else{this[_0x3336('0x28')]('error',_0x440637);this[_0x3336('0x28')](_0x3336('0x2b'));}};module[_0x3336('0x3e')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 20d0db1..bd6023b 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 _0xf05e=['sendMail','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xf05e,0x1bd));var _0xef05=function(_0x63904a,_0x273d0b){_0x63904a=_0x63904a-0x0;var _0x2e8639=_0xf05e[_0x63904a];return _0x2e8639;};'use strict';var nodemailer=require(_0xef05('0x0'));var inlineBase64=require(_0xef05('0x1'));function EmailSmtp(){}EmailSmtp[_0xef05('0x2')][_0xef05('0x3')]=function(_0x2b877d,_0x52658d){return new Promise(function(_0x3cea8a,_0x2e299c){var _0x23079e=nodemailer[_0xef05('0x4')](_0x2b877d);_0x23079e['use'](_0xef05('0x5'),inlineBase64());_0x23079e[_0xef05('0x6')](_0x52658d,function(_0x28e0a2,_0x32c301){if(_0x28e0a2){_0x2e299c(_0x28e0a2[_0xef05('0x7')]());}else{_0x3cea8a(_0x32c301);}});});};EmailSmtp['prototype'][_0xef05('0x8')]=function(_0x3ce9af){return new Promise(function(_0xac011a,_0x401394){var _0x2eb3dc=nodemailer[_0xef05('0x4')](_0x3ce9af);_0x2eb3dc['verify'](function(_0x40a21c,_0x3eba1c){if(_0x40a21c){_0x401394(_0x40a21c['toString']());}else{if(_0x3eba1c){_0xac011a(_0x3eba1c);}else{_0x401394(_0xef05('0x9'));}}});});};module[_0xef05('0xa')]=EmailSmtp; \ No newline at end of file +var _0xebfc=['verify','createTransport','toString','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','use','compile'];(function(_0x452713,_0x3a7125){var _0x56f004=function(_0x285ac5){while(--_0x285ac5){_0x452713['push'](_0x452713['shift']());}};_0x56f004(++_0x3a7125);}(_0xebfc,0x9b));var _0xcebf=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xebfc[_0x58e469];return _0x4c01c5;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xcebf('0x0'));function EmailSmtp(){}EmailSmtp[_0xcebf('0x1')][_0xcebf('0x2')]=function(_0x4cd3a9,_0x1ed4ec){return new Promise(function(_0x58f1bb,_0x17f9a9){var _0x278efa=nodemailer['createTransport'](_0x4cd3a9);_0x278efa[_0xcebf('0x3')](_0xcebf('0x4'),inlineBase64());_0x278efa['sendMail'](_0x1ed4ec,function(_0x56c620,_0x31064b){if(_0x56c620){_0x17f9a9(_0x56c620['toString']());}else{_0x58f1bb(_0x31064b);}});});};EmailSmtp[_0xcebf('0x1')][_0xcebf('0x5')]=function(_0x355e7c){return new Promise(function(_0x4458e6,_0x61bc2e){var _0x55ff7c=nodemailer[_0xcebf('0x6')](_0x355e7c);_0x55ff7c['verify'](function(_0x1eafc8,_0x11870a){if(_0x1eafc8){_0x61bc2e(_0x1eafc8[_0xcebf('0x7')]());}else{if(_0x11870a){_0x4458e6(_0x11870a);}else{_0x61bc2e(_0xcebf('0x8'));}}});});};module[_0xcebf('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 745de4a..1b98354 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 _0xfd6f=['%s-%s','now','root','server/files/attachments/','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','line','isAutoreply','parser','from','messageId','inReplyTo','filter','application/ms-tnef','info','parseBuffer','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','util','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','pop','html','test','replace','includes','forEach','push','_SRC','_IMG','\x20]','body','message','originTo','originCc','isEmpty','bcc','attachments','attach','type','attachment','filename','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd6f,0x133));var _0xffd6=function(_0xfde6df,_0x3b3105){_0xfde6df=_0xfde6df-0x0;var _0x225bb2=_0xfd6f[_0xfde6df];return _0x225bb2;};'use strict';var _=require(_0xffd6('0x0'));var moment=require(_0xffd6('0x1'));var random=require(_0xffd6('0x2'));var fs=require('fs');var path=require(_0xffd6('0x3'));var util=require(_0xffd6('0x4'));var tnef=require('node-tnef');var logger=require(_0xffd6('0x5'))(_0xffd6('0x6'));var config=require(_0xffd6('0x7'));function getAddress(_0x4d9706){var _0x4abbbd=_[_0xffd6('0x8')](_0x4d9706[_0xffd6('0x9')]);return _0x4abbbd&&_0x4abbbd[_0xffd6('0xa')]?_0x4abbbd['address']:_0xffd6('0xb')+random[_0xffd6('0xc')](0x6)+_0xffd6('0xd');}function getFirstName(_0x5b5c56){var _0x10819f=_[_0xffd6('0x8')](_0x5b5c56[_0xffd6('0x9')]);if(_0x10819f&&_0x10819f[_0xffd6('0xe')]){if(_0x10819f[_0xffd6('0xe')]==_0x10819f[_0xffd6('0xa')]){return _0x10819f[_0xffd6('0xe')][_0xffd6('0xf')](0x0,_0x10819f[_0xffd6('0xe')][_0xffd6('0x10')]('@'));}var _0x20dc05=_0x10819f['name'][_0xffd6('0x11')](/\s+/);return _0x20dc05[_0xffd6('0x12')]>0x1?_0x20dc05[_0xffd6('0x13')](0x0,-0x1)[_0xffd6('0x14')]('\x20'):_0x10819f[_0xffd6('0xe')];}return'Anonymous';}function getLastName(_0x4a6bf5){var _0xc257ca=_[_0xffd6('0x8')](_0x4a6bf5[_0xffd6('0x9')]);if(_0xc257ca&&_0xc257ca[_0xffd6('0xe')]){var _0x42bd83=_0xc257ca[_0xffd6('0xe')][_0xffd6('0x11')](/\s+/);return _0x42bd83[_0xffd6('0x12')]>0x1?_0x42bd83[_0xffd6('0x15')]():'';}return'';}function getMails(_0x39d3f6,_0x10345a){var _0x4c9bf3='';for(var _0x125d71=0x0;_0x125d71<_0x10345a['value'][_0xffd6('0x12')];_0x125d71+=0x1){if(_0x10345a[_0xffd6('0x9')][_0x125d71][_0xffd6('0xa')]!==_0x39d3f6){if(!_['isEmpty'](_0x4c9bf3)){_0x4c9bf3+=',';}_0x4c9bf3+=_0x10345a[_0xffd6('0x9')][_0x125d71][_0xffd6('0xe')]||_0x10345a['value'][_0x125d71][_0xffd6('0xa')]||'';_0x4c9bf3+='\x20<';_0x4c9bf3+=_0x10345a[_0xffd6('0x9')][_0x125d71][_0xffd6('0xa')]?_0x10345a[_0xffd6('0x9')][_0x125d71][_0xffd6('0xa')]:_0xffd6('0xb')+random['generate'](0x6)+_0xffd6('0xd');_0x4c9bf3+='>';}}return _0x4c9bf3;}function parseEmail(_0x321697,_0x2e1fb7,_0x503a65){if(_0x2e1fb7[_0xffd6('0x16')]){var _0x1139c0=/)<[^<]*)*<\/script>/gi;while(_0x1139c0[_0xffd6('0x17')](_0x2e1fb7[_0xffd6('0x16')])){_0x2e1fb7[_0xffd6('0x16')]=_0x2e1fb7[_0xffd6('0x16')][_0xffd6('0x18')](_0x1139c0,'');}if(_0x2e1fb7[_0xffd6('0x16')][_0xffd6('0x19')]('{_0x549503[_0xffd6('0x1b')](_0x58f49c['filename']);});var _0x9c8f35=/]+>/g;var _0x42751d=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x17360b=_0x2e1fb7[_0xffd6('0x16')]['replace'](_0x42751d,_0xffd6('0x1c'));var _0x3da0e5=_0x17360b['replace'](_0x9c8f35,_0xffd6('0x1d'));for(let _0x3da8d4=0x0;_0x3da8d4<_0x549503[_0xffd6('0x12')];_0x3da8d4++){var _0x69e60b=_0x3da0e5[_0xffd6('0x18')](_0xffd6('0x1d'),'\x20[Attachment:\x20'+_0x549503[_0x3da8d4]+_0xffd6('0x1e'));_0x3da0e5=_0x69e60b;}_0x2e1fb7['html']=_0x3da0e5;}_0x503a65[_0xffd6('0x1f')]=_0x2e1fb7[_0xffd6('0x16')];}else{_0x503a65[_0xffd6('0x1f')]=_0x2e1fb7['textAsHtml'];}if(_0x503a65[_0xffd6('0x1f')]){_0x503a65['body']=_0x503a65[_0xffd6('0x1f')]['replace'](/0x0){var _0xa63ee0=[_0xffd6('0x32'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x112a04=0x0;_0x112a04<_0x2e1fb7['headerLines']['length'];_0x112a04++){var _0x306a99=_[_0xffd6('0x10')](_0xa63ee0,_0x2e1fb7[_0xffd6('0x31')][_0x112a04][_0xffd6('0x33')]);if(_0x306a99>=0x0){_0x503a65[_0xffd6('0x34')]=!![];}}}return _0x503a65;}exports[_0xffd6('0x35')]=function(_0x342342,_0x2631c4,_0x1a5f55){var _0xf3098f={'from':getAddress(_0x2631c4['from']),'firstName':getFirstName(_0x2631c4[_0xffd6('0x36')]),'lastName':getLastName(_0x2631c4[_0xffd6('0x36')]),'mapKey':_0xffd6('0x6'),'message':{'from':getMails(_0x342342[_0xffd6('0x6')],_0x2631c4[_0xffd6('0x36')]),'to':_0x342342[_0xffd6('0x6')],'cc':'','subject':_0x2631c4['subject']||'','messageId':_0x2631c4[_0xffd6('0x37')],'inReplyTo':_0x2631c4[_0xffd6('0x38')],'sentAt':moment(_0x2631c4['date'])[_0xffd6('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x2631c4[_0xffd6('0x16')]&&!_0x2631c4['textAsHtml']){var _0x405355=_[_0xffd6('0x39')](_0x2631c4[_0xffd6('0x25')],{'contentType':_0xffd6('0x3a')});if(_0x405355[_0xffd6('0x12')]){logger[_0xffd6('0x3b')](util[_0xffd6('0x2a')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x2631c4['messageId']));tnef[_0xffd6('0x3c')](_['first'](_0x405355)[_0xffd6('0x2f')],function(_0x35de79,_0x41224d){if(_0x41224d){_0x2631c4[_0xffd6('0x16')]=_0x41224d['BodyHTML']||_0xffd6('0x3d');if(_0x41224d[_0xffd6('0x3e')]){for(var _0x383eb0=0x0;_0x383eb0<_0x41224d[_0xffd6('0x3e')][_0xffd6('0x12')];_0x383eb0++){var _0x49e9c4=_0x41224d[_0xffd6('0x3e')][_0x383eb0];_0xf3098f['message'][_0xffd6('0x25')][_0xffd6('0x1b')]({'filename':_0x49e9c4[_0xffd6('0x3f')],'content':Buffer[_0xffd6('0x36')](_0x49e9c4[_0xffd6('0x40')])});}}}_0x1a5f55(parseEmail(_0x342342,_0x2631c4,_0xf3098f));});}else{_0x2631c4[_0xffd6('0x16')]=_0xffd6('0x3d');_0x1a5f55(parseEmail(_0x342342,_0x2631c4,_0xf3098f));}}else{_0x1a5f55(parseEmail(_0x342342,_0x2631c4,_0xf3098f));}};exports[_0xffd6('0x41')]=function(_0x4f33b1,_0x578cf9){var _0x3d3d5a=[_0xffd6('0x42')+(_0x578cf9||''),_0xffd6('0x43')+_0x4f33b1,'',''];return Buffer[_0xffd6('0x36')](_0x3d3d5a[_0xffd6('0x14')](''),_0xffd6('0x44'))['toString'](_0xffd6('0x45'));}; \ No newline at end of file +var _0x3c54=['value','address','@xcally.com','name','indexOf','split','length','slice','Anonymous','pop','isEmpty','anonymous','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','generateXOAuth2Token','user=','auth=Bearer\x20','base64','lodash','randomstring','path','util','node-tnef','email','../../../config/environment','head'];(function(_0x37cde1,_0x250d40){var _0x797e60=function(_0x4f5687){while(--_0x4f5687){_0x37cde1['push'](_0x37cde1['shift']());}};_0x797e60(++_0x250d40);}(_0x3c54,0x82));var _0x43c5=function(_0x2127d1,_0x206e47){_0x2127d1=_0x2127d1-0x0;var _0x55df06=_0x3c54[_0x2127d1];return _0x55df06;};'use strict';var _=require(_0x43c5('0x0'));var moment=require('moment');var random=require(_0x43c5('0x1'));var fs=require('fs');var path=require(_0x43c5('0x2'));var util=require(_0x43c5('0x3'));var tnef=require(_0x43c5('0x4'));var logger=require('../../../config/logger')(_0x43c5('0x5'));var config=require(_0x43c5('0x6'));function getAddress(_0x20b08a){var _0x1778c4=_[_0x43c5('0x7')](_0x20b08a[_0x43c5('0x8')]);return _0x1778c4&&_0x1778c4[_0x43c5('0x9')]?_0x1778c4[_0x43c5('0x9')]:'anonymous'+random['generate'](0x6)+_0x43c5('0xa');}function getFirstName(_0x147f8b){var _0x1017a5=_[_0x43c5('0x7')](_0x147f8b[_0x43c5('0x8')]);if(_0x1017a5&&_0x1017a5[_0x43c5('0xb')]){if(_0x1017a5[_0x43c5('0xb')]==_0x1017a5['address']){return _0x1017a5[_0x43c5('0xb')]['substring'](0x0,_0x1017a5['name'][_0x43c5('0xc')]('@'));}var _0x1a63e0=_0x1017a5['name'][_0x43c5('0xd')](/\s+/);return _0x1a63e0[_0x43c5('0xe')]>0x1?_0x1a63e0[_0x43c5('0xf')](0x0,-0x1)['join']('\x20'):_0x1017a5[_0x43c5('0xb')];}return _0x43c5('0x10');}function getLastName(_0x5ce154){var _0x215513=_[_0x43c5('0x7')](_0x5ce154['value']);if(_0x215513&&_0x215513[_0x43c5('0xb')]){var _0x4edf33=_0x215513[_0x43c5('0xb')][_0x43c5('0xd')](/\s+/);return _0x4edf33[_0x43c5('0xe')]>0x1?_0x4edf33[_0x43c5('0x11')]():'';}return'';}function getMails(_0x1c26b7,_0x579bf7){var _0x89761c='';for(var _0x5ad2ba=0x0;_0x5ad2ba<_0x579bf7[_0x43c5('0x8')][_0x43c5('0xe')];_0x5ad2ba+=0x1){if(_0x579bf7[_0x43c5('0x8')][_0x5ad2ba][_0x43c5('0x9')]!==_0x1c26b7){if(!_[_0x43c5('0x12')](_0x89761c)){_0x89761c+=',';}_0x89761c+=_0x579bf7[_0x43c5('0x8')][_0x5ad2ba][_0x43c5('0xb')]||_0x579bf7[_0x43c5('0x8')][_0x5ad2ba]['address']||'';_0x89761c+='\x20<';_0x89761c+=_0x579bf7[_0x43c5('0x8')][_0x5ad2ba][_0x43c5('0x9')]?_0x579bf7['value'][_0x5ad2ba][_0x43c5('0x9')]:_0x43c5('0x13')+random['generate'](0x6)+'@xcally.com';_0x89761c+='>';}}return _0x89761c;}function parseEmail(_0x1df698,_0x32c5b6,_0x3db6ba){if(_0x32c5b6[_0x43c5('0x14')]){var _0x474a47=/)<[^<]*)*<\/script>/gi;while(_0x474a47[_0x43c5('0x15')](_0x32c5b6[_0x43c5('0x14')])){_0x32c5b6[_0x43c5('0x14')]=_0x32c5b6[_0x43c5('0x14')][_0x43c5('0x16')](_0x474a47,'');}if(_0x32c5b6[_0x43c5('0x14')][_0x43c5('0x17')](_0x43c5('0x18'))){var _0x3f4f2d=[];_0x32c5b6[_0x43c5('0x19')]['forEach'](_0x5b3cd2=>{_0x3f4f2d[_0x43c5('0x1a')](_0x5b3cd2[_0x43c5('0x1b')]);});var _0x52920=/]+>/g;var _0x269ae8=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3384c6=_0x32c5b6[_0x43c5('0x14')][_0x43c5('0x16')](_0x269ae8,_0x43c5('0x1c'));var _0x31a638=_0x3384c6['replace'](_0x52920,_0x43c5('0x1d'));for(let _0x3949ed=0x0;_0x3949ed<_0x3f4f2d[_0x43c5('0xe')];_0x3949ed++){var _0x2dc780=_0x31a638['replace'](_0x43c5('0x1d'),_0x43c5('0x1e')+_0x3f4f2d[_0x3949ed]+_0x43c5('0x1f'));_0x31a638=_0x2dc780;}_0x32c5b6['html']=_0x31a638;}_0x3db6ba[_0x43c5('0x20')]=_0x32c5b6[_0x43c5('0x14')];}else{_0x3db6ba['body']=_0x32c5b6[_0x43c5('0x21')];}if(_0x3db6ba[_0x43c5('0x20')]){_0x3db6ba['body']=_0x3db6ba['body']['replace'](/0x0){var _0x2d98ff=[_0x43c5('0x30'),_0x43c5('0x31'),_0x43c5('0x32')];for(var _0xe5f598=0x0;_0xe5f598<_0x32c5b6['headerLines']['length'];_0xe5f598++){var _0xdc3d7a=_[_0x43c5('0xc')](_0x2d98ff,_0x32c5b6['headerLines'][_0xe5f598]['line']);if(_0xdc3d7a>=0x0){_0x3db6ba['isAutoreply']=!![];}}}return _0x3db6ba;}exports[_0x43c5('0x33')]=function(_0x1ca0b8,_0x530c2d,_0x1a564d){var _0x5005bf={'from':getAddress(_0x530c2d[_0x43c5('0x34')]),'firstName':getFirstName(_0x530c2d['from']),'lastName':getLastName(_0x530c2d[_0x43c5('0x34')]),'mapKey':_0x43c5('0x5'),'message':{'from':getMails(_0x1ca0b8['email'],_0x530c2d[_0x43c5('0x34')]),'to':_0x1ca0b8[_0x43c5('0x5')],'cc':'','subject':_0x530c2d[_0x43c5('0x35')]||'','messageId':_0x530c2d[_0x43c5('0x36')],'inReplyTo':_0x530c2d[_0x43c5('0x37')],'sentAt':moment(_0x530c2d[_0x43c5('0x38')])[_0x43c5('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x530c2d[_0x43c5('0x14')]&&!_0x530c2d[_0x43c5('0x21')]){var _0x12d901=_[_0x43c5('0x39')](_0x530c2d['attachments'],{'contentType':_0x43c5('0x3a')});if(_0x12d901[_0x43c5('0xe')]){logger['info'](util[_0x43c5('0x2a')](_0x43c5('0x3b'),_0x530c2d[_0x43c5('0x36')]));tnef['parseBuffer'](_[_0x43c5('0x3c')](_0x12d901)[_0x43c5('0x2e')],function(_0x3c43b7,_0x1f1d13){if(_0x1f1d13){_0x530c2d[_0x43c5('0x14')]=_0x1f1d13[_0x43c5('0x3d')]||_0x43c5('0x3e');if(_0x1f1d13[_0x43c5('0x3f')]){for(var _0xec4d4=0x0;_0xec4d4<_0x1f1d13['Attachments']['length'];_0xec4d4++){var _0x4be29f=_0x1f1d13[_0x43c5('0x3f')][_0xec4d4];_0x5005bf[_0x43c5('0x24')][_0x43c5('0x19')][_0x43c5('0x1a')]({'filename':_0x4be29f[_0x43c5('0x40')],'content':Buffer['from'](_0x4be29f['Data'])});}}}_0x1a564d(parseEmail(_0x1ca0b8,_0x530c2d,_0x5005bf));});}else{_0x530c2d[_0x43c5('0x14')]=_0x43c5('0x3e');_0x1a564d(parseEmail(_0x1ca0b8,_0x530c2d,_0x5005bf));}}else{_0x1a564d(parseEmail(_0x1ca0b8,_0x530c2d,_0x5005bf));}};exports[_0x43c5('0x41')]=function(_0x5bd194,_0x498bb9){var _0x339d55=[_0x43c5('0x42')+(_0x498bb9||''),_0x43c5('0x43')+_0x5bd194,'',''];return Buffer[_0x43c5('0x34')](_0x339d55['join'](''),'utf-8')['toString'](_0x43c5('0x44'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 633dc5d..9822d1f 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 _0xf6c0=['name','Service','key','active','Imap','Smtp','exports','lodash'];(function(_0x311f44,_0x1d7f5b){var _0x46f1e6=function(_0x27342a){while(--_0x27342a){_0x311f44['push'](_0x311f44['shift']());}};_0x46f1e6(++_0x1d7f5b);}(_0xf6c0,0x1bf));var _0x0f6c=function(_0xfa260b,_0xd2d0d){_0xfa260b=_0xfa260b-0x0;var _0x48fb84=_0xf6c0[_0xfa260b];return _0x48fb84;};'use strict';var _=require(_0x0f6c('0x0'));function MailAccount(_0x46881e){this['id']=_0x46881e['id']||0x0;this[_0x0f6c('0x1')]=_0x46881e['name']||_0x0f6c('0x2');this[_0x0f6c('0x3')]=_0x46881e[_0x0f6c('0x3')]||'SERV';this['active']=_0x46881e[_0x0f6c('0x4')]||![];this['Imap']=_0x46881e[_0x0f6c('0x5')]||[];this[_0x0f6c('0x6')]=_0x46881e['Smtp']||[];}module[_0x0f6c('0x7')]=MailAccount; \ No newline at end of file +var _0x0550=['Imap','Smtp','name','Service','key','SERV','active'];(function(_0x4ee837,_0x4a454d){var _0xae1883=function(_0x57da8a){while(--_0x57da8a){_0x4ee837['push'](_0x4ee837['shift']());}};_0xae1883(++_0x4a454d);}(_0x0550,0x14b));var _0x0055=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0x0550[_0x3522c8];return _0x22f498;};'use strict';var _=require('lodash');function MailAccount(_0x1ba454){this['id']=_0x1ba454['id']||0x0;this['name']=_0x1ba454[_0x0055('0x0')]||_0x0055('0x1');this[_0x0055('0x2')]=_0x1ba454[_0x0055('0x2')]||_0x0055('0x3');this['active']=_0x1ba454[_0x0055('0x4')]||![];this[_0x0055('0x5')]=_0x1ba454['Imap']||[];this['Smtp']=_0x1ba454[_0x0055('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 1648111..3ede7d9 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 _0x82d5=['lodash','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports'];(function(_0x5bae77,_0x4f5e97){var _0x53d8af=function(_0x9db181){while(--_0x9db181){_0x5bae77['push'](_0x5bae77['shift']());}};_0x53d8af(++_0x4f5e97);}(_0x82d5,0x6e));var _0x582d=function(_0x5dc9ec,_0x407af4){_0x5dc9ec=_0x5dc9ec-0x0;var _0x5b4cdb=_0x82d5[_0x5dc9ec];return _0x5b4cdb;};'use strict';var _=require(_0x582d('0x0'));var MailAccount=require(_0x582d('0x1'));var Realtime=function(){this[_0x582d('0x2')]={};};function freeIsNotKey(_0x17a815,_0x4e8b7b,_0x1ece37){var _0x38f790=_[_0x582d('0x3')](_0x17a815,function(_0x289d91,_0x4dd139){return _0x289d91[_0x1ece37];});for(var _0x2fa1a2 in _0x4e8b7b){if(_0x4e8b7b['hasOwnProperty'](_0x2fa1a2)){if(!_0x38f790[_0x2fa1a2]){delete _0x4e8b7b[_0x2fa1a2];}}}}Realtime[_0x582d('0x4')][_0x582d('0x5')]=function(_0x586d3e,_0x198d73){for(var _0x2149a7 in _0x198d73){if(_0x586d3e['hasOwnProperty'](_0x2149a7)){_0x586d3e[_0x2149a7]=_0x198d73[_0x2149a7];}}};Realtime[_0x582d('0x4')][_0x582d('0x6')]=function(){var _0x1692ce=this;return function(_0x317c1b){if(_0x317c1b){freeIsNotKey(_0x317c1b,_0x1692ce[_0x582d('0x2')],'id');for(var _0x28664b=0x0,_0x34b804={},_0x1bfe13={};_0x28664b<_0x317c1b[_0x582d('0x7')];_0x28664b+=0x1){_0x34b804=_0x317c1b[_0x28664b];if(_[_0x582d('0x8')](_0x1692ce['mailAccounts'][_0x34b804['id']])){_0x1692ce[_0x582d('0x2')][_0x34b804['id']]=new MailAccount(_0x34b804);}else{_[_0x582d('0x9')](_0x1692ce[_0x582d('0x2')][_0x34b804['id']],_0x34b804);}}}return _0x1692ce[_0x582d('0x2')];};};module[_0x582d('0xa')]=Realtime; \ No newline at end of file +var _0x591f=['isUndefined','merge','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length'];(function(_0x1fc80b,_0x98bfe9){var _0x28da77=function(_0x226f1e){while(--_0x226f1e){_0x1fc80b['push'](_0x1fc80b['shift']());}};_0x28da77(++_0x98bfe9);}(_0x591f,0x17e));var _0xf591=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0x591f[_0x5d8631];return _0x34c15e;};'use strict';var _=require(_0xf591('0x0'));var MailAccount=require(_0xf591('0x1'));var Realtime=function(){this[_0xf591('0x2')]={};};function freeIsNotKey(_0x5ecd78,_0x4372d1,_0x1e0607){var _0x39be56=_[_0xf591('0x3')](_0x5ecd78,function(_0xe84ec3,_0x1eab52){return _0xe84ec3[_0x1e0607];});for(var _0x35475b in _0x4372d1){if(_0x4372d1[_0xf591('0x4')](_0x35475b)){if(!_0x39be56[_0x35475b]){delete _0x4372d1[_0x35475b];}}}}Realtime[_0xf591('0x5')]['mergeFromDatabase']=function(_0x5abce2,_0x714793){for(var _0x271604 in _0x714793){if(_0x5abce2[_0xf591('0x4')](_0x271604)){_0x5abce2[_0x271604]=_0x714793[_0x271604];}}};Realtime['prototype'][_0xf591('0x6')]=function(){var _0x3ac8ee=this;return function(_0x19d425){if(_0x19d425){freeIsNotKey(_0x19d425,_0x3ac8ee['mailAccounts'],'id');for(var _0x459622=0x0,_0x44541a={},_0x4f4d1e={};_0x459622<_0x19d425[_0xf591('0x7')];_0x459622+=0x1){_0x44541a=_0x19d425[_0x459622];if(_[_0xf591('0x8')](_0x3ac8ee[_0xf591('0x2')][_0x44541a['id']])){_0x3ac8ee[_0xf591('0x2')][_0x44541a['id']]=new MailAccount(_0x44541a);}else{_[_0xf591('0x9')](_0x3ac8ee['mailAccounts'][_0x44541a['id']],_0x44541a);}}}return _0x3ac8ee[_0xf591('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index a057291..2008f8f 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 _0x6df0=['key','ListId','TemplateId','CloudProvider','service','type','data5','MailServerOut','Smtp','../client','getMailAccounts','Request','GetMailAccount','name','provider','email','active'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6df0,0x15d));var _0x06df=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x6df0[_0x50007c];return _0x5c1ec7;};'use strict';var client=require(_0x06df('0x0'));exports[_0x06df('0x1')]=function(){return function(){return client[_0x06df('0x2')](_0x06df('0x3'),{'options':{'attributes':['id',_0x06df('0x4'),_0x06df('0x5'),'service',_0x06df('0x6'),_0x06df('0x7'),_0x06df('0x8'),_0x06df('0x9'),_0x06df('0xa')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0x06df('0xb'),'attributes':['id',_0x06df('0x4'),_0x06df('0xc'),_0x06df('0xd'),_0x06df('0xe')],'as':_0x06df('0xb')}]},{'model':_0x06df('0xf'),'as':_0x06df('0x10'),'include':[{'model':_0x06df('0xb'),'attributes':['id','name',_0x06df('0xc'),'type',_0x06df('0xe')],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports['notify']=function(_0x1f7afa,_0x1b722d){return client['Request']('NotifyMailAccount',{'account':{'id':_0x1f7afa},'body':_0x1b722d,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x67d5=['key','ListId','TemplateId','MailServerIn','CloudProvider','type','data5','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','name','service','email','active'];(function(_0x570ebc,_0x454b4a){var _0x5ccce4=function(_0x15d687){while(--_0x15d687){_0x570ebc['push'](_0x570ebc['shift']());}};_0x5ccce4(++_0x454b4a);}(_0x67d5,0x18a));var _0x567d=function(_0xeaaa86,_0x47aa05){_0xeaaa86=_0xeaaa86-0x0;var _0xd2bd82=_0x67d5[_0xeaaa86];return _0xd2bd82;};'use strict';var client=require('../client');exports[_0x567d('0x0')]=function(){return function(){return client[_0x567d('0x1')]('GetMailAccount',{'options':{'attributes':['id',_0x567d('0x2'),'provider',_0x567d('0x3'),_0x567d('0x4'),_0x567d('0x5'),_0x567d('0x6'),_0x567d('0x7'),_0x567d('0x8')],'raw':![],'include':[{'model':_0x567d('0x9'),'as':'Imap','include':[{'model':_0x567d('0xa'),'attributes':['id',_0x567d('0x2'),_0x567d('0x3'),_0x567d('0xb'),_0x567d('0xc')],'as':_0x567d('0xa')}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x567d('0xa'),'attributes':['id',_0x567d('0x2'),_0x567d('0x3'),_0x567d('0xb'),_0x567d('0xc')],'as':_0x567d('0xa')}]}]},'log':_0x567d('0xd')});};};exports[_0x567d('0xe')]=function(_0x51d021,_0xd02cdc){return client[_0x567d('0x1')](_0x567d('0xf'),{'account':{'id':_0x51d021},'body':_0xd02cdc,'log':_0x567d('0xf')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index d937c6e..8f9411e 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 _0xdd4e=['getSettings','Request','ShowSetting','loginMailFrequency','../client'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xdd4e,0xae));var _0xedd4=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0xdd4e[_0xbc4659];return _0x5831f9;};'use strict';var client=require(_0xedd4('0x0'));exports[_0xedd4('0x1')]=function(){return client[_0xedd4('0x2')](_0xedd4('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xedd4('0x4')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x7ff5=['GetSettings','ShowSetting','loginMailFrequency'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x7ff5,0xeb));var _0x57ff=function(_0x22a24b,_0x33ebca){_0x22a24b=_0x22a24b-0x0;var _0x2309c4=_0x7ff5[_0x22a24b];return _0x2309c4;};'use strict';var client=require('../client');exports['getSettings']=function(){return client['Request'](_0x57ff('0x0'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x57ff('0x1')]},'log':_0x57ff('0x2')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 56c216e..9405ea6 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 8b4a02f..87cec15 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 _0xbeff=['polling','redis','defaults','localhost','adapter','../../config/triggers','default','../../config/socketio','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','../../config/environment','createServer','timeout','listen','port','socket.io','websocket'];(function(_0x4bb2ef,_0x138615){var _0x468378=function(_0x126632){while(--_0x126632){_0x4bb2ef['push'](_0x4bb2ef['shift']());}};_0x468378(++_0x138615);}(_0xbeff,0xca));var _0xfbef=function(_0xaca81c,_0x2df861){_0xaca81c=_0xaca81c-0x0;var _0x3b0001=_0xbeff[_0xaca81c];return _0x3b0001;};'use strict';var _=require('lodash');var http=require('http');var express=require('express');var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0xfbef('0x0'));var app=express();var server=http[_0xfbef('0x1')](app);server[_0xfbef('0x2')]=0xdbba0;if(sticky[_0xfbef('0x3')](server,config[_0xfbef('0x4')])){var socketio=require(_0xfbef('0x5'))(server,{'transports':[_0xfbef('0x6'),_0xfbef('0x7')]});config[_0xfbef('0x8')]=_[_0xfbef('0x9')](config[_0xfbef('0x8')],{'host':_0xfbef('0xa'),'port':0x18eb});socketio[_0xfbef('0xb')](require('socket.io-redis')({'pubClient':new Redis(config[_0xfbef('0x8')]),'subClient':new Redis(config[_0xfbef('0x8')])}));require(_0xfbef('0xc'))[_0xfbef('0xd')]();require(_0xfbef('0xe'))[_0xfbef('0xd')](socketio);require('../../config/express')[_0xfbef('0xd')](app);require('../../routes')[_0xfbef('0xd')](app);}else{server[_0xfbef('0xf')]('listening',function(){console[_0xfbef('0x10')](_0xfbef('0x11'),config['port']);});}exports=module[_0xfbef('0x12')]=app; \ No newline at end of file +var _0xab8d=['default','../../config/socketio','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers'];(function(_0x3fa3c3,_0x330f47){var _0x2524dd=function(_0x3c2f76){while(--_0x3c2f76){_0x3fa3c3['push'](_0x3fa3c3['shift']());}};_0x2524dd(++_0x330f47);}(_0xab8d,0x14d));var _0xdab8=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xab8d[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require('lodash');var http=require(_0xdab8('0x0'));var express=require(_0xdab8('0x1'));var sticky=require(_0xdab8('0x2'));var Redis=require(_0xdab8('0x3'));var config=require(_0xdab8('0x4'));var app=express();var server=http[_0xdab8('0x5')](app);server[_0xdab8('0x6')]=0xdbba0;if(sticky[_0xdab8('0x7')](server,config[_0xdab8('0x8')])){var socketio=require(_0xdab8('0x9'))(server,{'transports':[_0xdab8('0xa'),_0xdab8('0xb')]});config[_0xdab8('0xc')]=_[_0xdab8('0xd')](config[_0xdab8('0xc')],{'host':_0xdab8('0xe'),'port':0x18eb});socketio['adapter'](require(_0xdab8('0xf'))({'pubClient':new Redis(config[_0xdab8('0xc')]),'subClient':new Redis(config[_0xdab8('0xc')])}));require(_0xdab8('0x10'))[_0xdab8('0x11')]();require(_0xdab8('0x12'))[_0xdab8('0x11')](socketio);require('../../config/express')[_0xdab8('0x11')](app);require(_0xdab8('0x13'))[_0xdab8('0x11')](app);}else{server[_0xdab8('0x14')](_0xdab8('0x15'),function(){console[_0xdab8('0x16')](_0xdab8('0x17'),config[_0xdab8('0x8')]);});}exports=module[_0xdab8('0x18')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 594a7a3..169b41b 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 _0x7be1=['then','debug','rpc','error','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request'];(function(_0x2fad8a,_0x26de69){var _0x494d7d=function(_0x52fe59){while(--_0x52fe59){_0x2fad8a['push'](_0x2fad8a['shift']());}};_0x494d7d(++_0x26de69);}(_0x7be1,0x9d));var _0x17be=function(_0x4251a4,_0x17292f){_0x4251a4=_0x4251a4-0x0;var _0x27d2f1=_0x7be1[_0x4251a4];return _0x27d2f1;};'use strict';var jayson=require(_0x17be('0x0'));var BPromise=require(_0x17be('0x1'));var logger=require(_0x17be('0x2'))(_0x17be('0x3'));var client=jayson[_0x17be('0x4')][_0x17be('0x5')]({'port':0x2329});client[_0x17be('0x6')]=function(_0x1ee3fe,_0x4012f0){return new BPromise(function(_0x4a666d,_0x28544c){return client[_0x17be('0x7')](_0x1ee3fe,_0x4012f0)[_0x17be('0x8')](function(_0x33f3a6){logger[_0x17be('0x9')](_0x17be('0xa'),'routing',_0x1ee3fe,_0x4012f0,_0x33f3a6);if(_0x33f3a6[_0x17be('0xb')]){logger[_0x17be('0xb')]('rpc',_0x17be('0x3'),_0x1ee3fe,_0x33f3a6[_0x17be('0xb')]['message'],_0x4012f0);return _0x28544c(_0x33f3a6[_0x17be('0xb')]['message']);}else{return _0x4a666d(_0x33f3a6[_0x17be('0xc')]);}})[_0x17be('0xd')](function(_0x37fa0b){logger[_0x17be('0xb')](_0x17be('0xa'),'routing',_0x1ee3fe,_0x37fa0b,_0x4012f0);return _0x28544c(_0x37fa0b);});});};module[_0x17be('0xe')]=client; \ No newline at end of file +var _0x0073=['catch','exports','bluebird','../../config/logger','routing','Request','request','then','rpc','error','message'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0x0073,0xf4));var _0x3007=function(_0x2408ce,_0x27120b){_0x2408ce=_0x2408ce-0x0;var _0x49cc21=_0x0073[_0x2408ce];return _0x49cc21;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x3007('0x0'));var logger=require(_0x3007('0x1'))(_0x3007('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x3007('0x3')]=function(_0x15ce0a,_0x42126e){return new BPromise(function(_0xcfdbbd,_0x2c5985){return client[_0x3007('0x4')](_0x15ce0a,_0x42126e)[_0x3007('0x5')](function(_0x4ec78a){logger['debug'](_0x3007('0x6'),'routing',_0x15ce0a,_0x42126e,_0x4ec78a);if(_0x4ec78a[_0x3007('0x7')]){logger[_0x3007('0x7')](_0x3007('0x6'),_0x3007('0x2'),_0x15ce0a,_0x4ec78a['error'][_0x3007('0x8')],_0x42126e);return _0x2c5985(_0x4ec78a['error'][_0x3007('0x8')]);}else{return _0xcfdbbd(_0x4ec78a['result']);}})[_0x3007('0x9')](function(_0x1273d2){logger['error'](_0x3007('0x6'),_0x3007('0x2'),_0x15ce0a,_0x1273d2,_0x42126e);return _0x2c5985(_0x1273d2);});});};module[_0x3007('0xa')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 8e7e3ff..56b656d 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 _0x732f=['./rpc/user','./rpc/chatQueue','./rpc/smsQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime'];(function(_0x55aa06,_0x2e288f){var _0x267d72=function(_0x1a58f0){while(--_0x1a58f0){_0x55aa06['push'](_0x55aa06['shift']());}};_0x267d72(++_0x2e288f);}(_0x732f,0xce));var _0xf732=function(_0x155bd1,_0x1fce0d){_0x155bd1=_0x155bd1-0x0;var _0x932f67=_0x732f[_0x155bd1];return _0x932f67;};'use strict';var BPromise=require('bluebird');var server=require(_0xf732('0x0'));var Realtime=require(_0xf732('0x1'));var user=require(_0xf732('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xf732('0x3'));var smsQueue=require(_0xf732('0x4'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xf732('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xf732('0x6')]()[_0xf732('0x7')](user[_0xf732('0x8')]())[_0xf732('0x7')](realtime[_0xf732('0x9')]())[_0xf732('0x7')](interval[_0xf732('0xa')]())[_0xf732('0x7')](realtime[_0xf732('0xb')]())[_0xf732('0x7')](openchannelQueue['getOpenchannelQueues']())[_0xf732('0x7')](realtime[_0xf732('0xc')]())[_0xf732('0x7')](chatQueue[_0xf732('0xd')]())[_0xf732('0x7')](realtime[_0xf732('0xe')]())[_0xf732('0x7')](smsQueue[_0xf732('0xf')]())[_0xf732('0x7')](realtime[_0xf732('0x10')]())[_0xf732('0x7')](mailQueue[_0xf732('0x11')]())['then'](realtime[_0xf732('0x12')]())[_0xf732('0x7')](faxQueue[_0xf732('0x13')]())['then'](realtime[_0xf732('0x14')]())['then'](whatsappQueue[_0xf732('0x15')]())['then'](realtime[_0xf732('0x16')]())[_0xf732('0x7')](function(){return realtime;});}function main(){return server[_0xf732('0x17')](realtime)[_0xf732('0x7')](function(_0x4094a4){return initRealtime();})[_0xf732('0x7')](function(_0xa7b1d5){return setInterval(initRealtime,0x1388);})[_0xf732('0x18')](function(_0x27a722){console[_0xf732('0x19')](_0x27a722);});}main(); \ No newline at end of file +var _0x5cbe=['resolve','then','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue'];(function(_0x349eec,_0x4ec724){var _0x396cc1=function(_0x589f3b){while(--_0x589f3b){_0x349eec['push'](_0x349eec['shift']());}};_0x396cc1(++_0x4ec724);}(_0x5cbe,0x74));var _0xe5cb=function(_0x2c45b1,_0x43364c){_0x2c45b1=_0x2c45b1-0x0;var _0x5b0f1d=_0x5cbe[_0x2c45b1];return _0x5b0f1d;};'use strict';var BPromise=require(_0xe5cb('0x0'));var server=require(_0xe5cb('0x1'));var Realtime=require(_0xe5cb('0x2'));var user=require(_0xe5cb('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xe5cb('0x4'));var chatQueue=require(_0xe5cb('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xe5cb('0x6'));var faxQueue=require(_0xe5cb('0x7'));var whatsappQueue=require(_0xe5cb('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xe5cb('0x9')]()[_0xe5cb('0xa')](user['getAgents']())[_0xe5cb('0xa')](realtime[_0xe5cb('0xb')]())[_0xe5cb('0xa')](interval[_0xe5cb('0xc')]())[_0xe5cb('0xa')](realtime['initIntervals']())[_0xe5cb('0xa')](openchannelQueue[_0xe5cb('0xd')]())[_0xe5cb('0xa')](realtime[_0xe5cb('0xe')]())[_0xe5cb('0xa')](chatQueue[_0xe5cb('0xf')]())[_0xe5cb('0xa')](realtime['initChatQueues']())['then'](smsQueue['getSmsQueues']())[_0xe5cb('0xa')](realtime['initSmsQueues']())[_0xe5cb('0xa')](mailQueue[_0xe5cb('0x10')]())[_0xe5cb('0xa')](realtime[_0xe5cb('0x11')]())[_0xe5cb('0xa')](faxQueue[_0xe5cb('0x12')]())['then'](realtime[_0xe5cb('0x13')]())['then'](whatsappQueue[_0xe5cb('0x14')]())[_0xe5cb('0xa')](realtime[_0xe5cb('0x15')]())[_0xe5cb('0xa')](function(){return realtime;});}function main(){return server[_0xe5cb('0x16')](realtime)[_0xe5cb('0xa')](function(_0x30df4d){return initRealtime();})['then'](function(_0x1b8a58){return setInterval(initRealtime,0x1388);})[_0xe5cb('0x17')](function(_0x1980e1){console[_0xe5cb('0x18')](_0x1980e1);});}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 f46f945..78cdc24 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(_0x189106,_0x4e40fe){var _0x14cc2a=function(_0x2c1022){while(--_0x2c1022){_0x189106['push'](_0x189106['shift']());}};_0x14cc2a(++_0x4e40fe);}(_0xe14b,0x93));var _0xbe14=function(_0x456956,_0x7343d3){_0x456956=_0x456956-0x0;var _0xa25d0e=_0xe14b[_0x456956];return _0xa25d0e;};'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 _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x56d3cf,_0x20787b){var _0x5881e6=function(_0x2bd2cc){while(--_0x2bd2cc){_0x56d3cf['push'](_0x56d3cf['shift']());}};_0x5881e6(++_0x20787b);}(_0x326f,0xd1));var _0xf326=function(_0x303b04,_0x5d6822){_0x303b04=_0x303b04-0x0;var _0x4ac39e=_0x326f[_0x303b04];return _0x4ac39e;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 4b0d3c3..67c3a84 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 _0x237c=['http','request','then','error','sendMailMessage','SendMail','jayson/promise','client'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x237c,0xbe));var _0xc237=function(_0x446a13,_0x223117){_0x446a13=_0x446a13-0x0;var _0x28b7c8=_0x237c[_0x446a13];return _0x28b7c8;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xc237('0x0'));var client=jayson[_0xc237('0x1')][_0xc237('0x2')]({'port':0x232b});function request(_0x1edb6c,_0x2a834f){return new BPromise(function(_0x37cb92,_0x1daebb){return client[_0xc237('0x3')](_0x1edb6c,_0x2a834f)[_0xc237('0x4')](function(_0x2c016c){if(_0x2c016c[_0xc237('0x5')]){return _0x1daebb(_0x2c016c[_0xc237('0x5')]['message']);}else{return _0x37cb92(_0x2c016c['result']);}})['catch'](function(_0xbb8132){return _0x1daebb(_0xbb8132);});});}exports[_0xc237('0x6')]=function(_0x45c3c2,_0x56dc74){return request(_0xc237('0x7'),{'account':_0x45c3c2,'message':_0x56dc74});}; \ No newline at end of file +var _0x5fef=['sendMailMessage','SendMail','bluebird','client','http','request','then','error','message','catch'];(function(_0x574903,_0x4351af){var _0x5909bf=function(_0x1b4ef5){while(--_0x1b4ef5){_0x574903['push'](_0x574903['shift']());}};_0x5909bf(++_0x4351af);}(_0x5fef,0x1e2));var _0xf5fe=function(_0xe5e0e9,_0x16e8ce){_0xe5e0e9=_0xe5e0e9-0x0;var _0x3a2dbf=_0x5fef[_0xe5e0e9];return _0x3a2dbf;};'use strict';var BPromise=require(_0xf5fe('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xf5fe('0x1')][_0xf5fe('0x2')]({'port':0x232b});function request(_0x371631,_0x219c21){return new BPromise(function(_0x46b6e1,_0x46e9b9){return client[_0xf5fe('0x3')](_0x371631,_0x219c21)[_0xf5fe('0x4')](function(_0x1fa6e3){if(_0x1fa6e3[_0xf5fe('0x5')]){return _0x46e9b9(_0x1fa6e3['error'][_0xf5fe('0x6')]);}else{return _0x46b6e1(_0x1fa6e3['result']);}})[_0xf5fe('0x7')](function(_0x19ecb0){return _0x46e9b9(_0x19ecb0);});});}exports[_0xf5fe('0x8')]=function(_0x1f53d4,_0x52c767){return request(_0xf5fe('0x9'),{'account':_0x1f53d4,'message':_0x52c767});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 10e3c45..cde13b0 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 _0xbbbc=['chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','sms','length','Status','StatusTime','toNumber','format','chatStatus','chatCurrentCapacity','mailCurrentCapacity','faxCurrentCapacity','whatsappStatus','whatsappCurrentCapacity','openchannelStatus','mailWaitingInteractions','stringify','emit','lodash','md5','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown'];(function(_0x3f8fa5,_0xa2656){var _0x42542e=function(_0x5dc8ad){while(--_0x5dc8ad){_0x3f8fa5['push'](_0x3f8fa5['shift']());}};_0x42542e(++_0xa2656);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x487f47,_0x32b30b){_0x487f47=_0x487f47-0x0;var _0x35988b=_0xbbbc[_0x487f47];return _0x35988b;};'use strict';var _=require(_0xcbbb('0x0'));var md5=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var Redis=require(_0xcbbb('0x3'));var config=require(_0xcbbb('0x4'));config[_0xcbbb('0x5')]=_[_0xcbbb('0x6')](config['redis'],{'host':_0xcbbb('0x7'),'port':0x18eb});var io=require(_0xcbbb('0x8'))(new Redis(config[_0xcbbb('0x5')]));function Agent(_0x3ccbf6){this['id']=_0x3ccbf6['id']||0x0;this[_0xcbbb('0x9')]=_0x3ccbf6['name']||'';this[_0xcbbb('0xa')]=_0x3ccbf6[_0xcbbb('0xa')]||!![];this[_0xcbbb('0xb')]=_0x3ccbf6[_0xcbbb('0xb')]||![];this[_0xcbbb('0xc')]=_0x3ccbf6[_0xcbbb('0xc')]||![];this[_0xcbbb('0xd')]=_0x3ccbf6['mailPause']||![];this[_0xcbbb('0xe')]=_0x3ccbf6['faxPause']||![];this['smsPause']=_0x3ccbf6[_0xcbbb('0xf')]||![];this['openchannelPause']=_0x3ccbf6[_0xcbbb('0x10')]||![];this['chatStatus']=_0xcbbb('0x11');this[_0xcbbb('0x12')]=0x0;this['chatCapacity']=_0x3ccbf6[_0xcbbb('0x13')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xcbbb('0x14')]='unknown';this[_0xcbbb('0x15')]=0x0;this[_0xcbbb('0x16')]=_0x3ccbf6[_0xcbbb('0x16')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xcbbb('0x17')]=_0xcbbb('0x11');this[_0xcbbb('0x18')]=0x0;this[_0xcbbb('0x19')]=_0x3ccbf6['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0xcbbb('0x1a')]=_0xcbbb('0x11');this[_0xcbbb('0x1b')]=0x0;this[_0xcbbb('0x1c')]=_0x3ccbf6['smsCapacity']||0x0;this[_0xcbbb('0x1d')]=0x0;this['whatsappStatus']=_0xcbbb('0x11');this[_0xcbbb('0x1e')]=0x0;this[_0xcbbb('0x1f')]=_0x3ccbf6['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0xcbbb('0x11');this[_0xcbbb('0x20')]=0x0;this[_0xcbbb('0x21')]=_0x3ccbf6[_0xcbbb('0x21')]||0x0;this[_0xcbbb('0x22')]=0x0;this[_0xcbbb('0x23')]=![];this[_0xcbbb('0x24')]=undefined;this[_0xcbbb('0x1')]='';this[_0xcbbb('0x25')]={};this[_0xcbbb('0x26')]={};this['mailWaitingInteractions']={};this[_0xcbbb('0x27')]={};this[_0xcbbb('0x28')]={};this[_0xcbbb('0x29')]={};this[_0xcbbb('0x2a')]();}Agent[_0xcbbb('0x2b')][_0xcbbb('0x2c')]=function(_0x297eae){if(this[_0x297eae+_0xcbbb('0x2d')]>0x0){if(this[_0x297eae+_0xcbbb('0x2e')]>0x0&&this[_0x297eae+'CurrentCapacity']>=this[_0x297eae+_0xcbbb('0x2e')]){return _0xcbbb('0x2f');}else{return'working';}}else{return _0xcbbb('0x30');}};Agent['prototype']['updateRealtime']=function(){var _0x575d56=[_0xcbbb('0x31'),'chat','openchannel','fax',_0xcbbb('0x32'),'whatsapp'];for(var _0x4da775=0x0;_0x4da775<_0x575d56[_0xcbbb('0x33')];_0x4da775+=0x1){var _0x2902c6=this[_0xcbbb('0x2c')](_0x575d56[_0x4da775]);if(this[_0x575d56[_0x4da775]+_0xcbbb('0x34')]!==_0x2902c6){this[_0x575d56[_0x4da775]+_0xcbbb('0x35')]=_[_0xcbbb('0x36')](moment()[_0xcbbb('0x37')]('x'));}this[_0x575d56[_0x4da775]+_0xcbbb('0x34')]=_0x2902c6;}var _0x2a023f={'id':this['id'],'name':this[_0xcbbb('0x9')],'online':this[_0xcbbb('0xa')],'voicePause':this[_0xcbbb('0xb')],'chatPause':this[_0xcbbb('0xc')],'mailPause':this[_0xcbbb('0xd')],'smsPause':this[_0xcbbb('0xf')],'faxPause':this[_0xcbbb('0xe')],'openchannelPause':this[_0xcbbb('0x10')],'chatStatus':this[_0xcbbb('0x38')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xcbbb('0x13')],'chatCurrentCapacity':this[_0xcbbb('0x39')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xcbbb('0x15')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xcbbb('0x3a')],'faxStatus':this[_0xcbbb('0x17')],'faxStatusTime':this[_0xcbbb('0x18')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xcbbb('0x3b')],'smsStatus':this[_0xcbbb('0x1a')],'smsStatusTime':this[_0xcbbb('0x1b')],'smsCapacity':this[_0xcbbb('0x1c')],'smsCurrentCapacity':this[_0xcbbb('0x1d')],'whatsappStatus':this[_0xcbbb('0x3c')],'whatsappStatusTime':this[_0xcbbb('0x1e')],'whatsappCapacity':this[_0xcbbb('0x1f')],'whatsappCurrentCapacity':this[_0xcbbb('0x3d')],'openchannelStatus':this[_0xcbbb('0x3e')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0xcbbb('0x24')],'chatWaitingInteractions':this[_0xcbbb('0x25')],'faxWaitingInteractions':this[_0xcbbb('0x26')],'mailWaitingInteractions':this[_0xcbbb('0x3f')],'openchannelWaitingInteractions':this[_0xcbbb('0x27')],'smsWaitingInteractions':this[_0xcbbb('0x28')],'whatsappWaitingInteractions':this[_0xcbbb('0x29')]};var _0x39a417=md5(JSON[_0xcbbb('0x40')](_0x2a023f));if(this[_0xcbbb('0x1')]!==_0x39a417){this[_0xcbbb('0x1')]=_0x39a417;io[_0xcbbb('0x41')]('user:routing:update',_['omit'](_0x2a023f,[_0xcbbb('0xa')]));}};module['exports']=Agent; \ No newline at end of file +var _0x77d4=['toNumber','chatPause','chatStatusTime','chatCurrentCapacity','mailStatus','faxStatus','whatsappStatusTime','openchannelCurrentCapacity','stringify','user:routing:update','omit','exports','md5','ioredis','redis','defaults','socket.io-emitter','name','online','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','maxcapacity','working','idle','mail','chat','sms','whatsapp','Status','StatusTime'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x77d4,0x108));var _0x477d=function(_0x75e2c9,_0x50b412){_0x75e2c9=_0x75e2c9-0x0;var _0x388ddb=_0x77d4[_0x75e2c9];return _0x388ddb;};'use strict';var _=require('lodash');var md5=require(_0x477d('0x0'));var moment=require('moment');var Redis=require(_0x477d('0x1'));var config=require('../../../config/environment');config[_0x477d('0x2')]=_[_0x477d('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x477d('0x4'))(new Redis(config[_0x477d('0x2')]));function Agent(_0x3d2f8d){this['id']=_0x3d2f8d['id']||0x0;this[_0x477d('0x5')]=_0x3d2f8d[_0x477d('0x5')]||'';this[_0x477d('0x6')]=_0x3d2f8d['online']||!![];this['voicePause']=_0x3d2f8d[_0x477d('0x7')]||![];this['chatPause']=_0x3d2f8d['chatPause']||![];this[_0x477d('0x8')]=_0x3d2f8d[_0x477d('0x8')]||![];this[_0x477d('0x9')]=_0x3d2f8d[_0x477d('0x9')]||![];this[_0x477d('0xa')]=_0x3d2f8d['smsPause']||![];this[_0x477d('0xb')]=_0x3d2f8d['openchannelPause']||![];this[_0x477d('0xc')]=_0x477d('0xd');this['chatStatusTime']=0x0;this[_0x477d('0xe')]=_0x3d2f8d[_0x477d('0xe')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x477d('0xd');this[_0x477d('0xf')]=0x0;this['mailCapacity']=_0x3d2f8d[_0x477d('0x10')]||0x0;this[_0x477d('0x11')]=0x0;this['faxStatus']='unknown';this[_0x477d('0x12')]=0x0;this['faxCapacity']=_0x3d2f8d[_0x477d('0x13')]||0x0;this[_0x477d('0x14')]=0x0;this[_0x477d('0x15')]='unknown';this[_0x477d('0x16')]=0x0;this[_0x477d('0x17')]=_0x3d2f8d[_0x477d('0x17')]||0x0;this[_0x477d('0x18')]=0x0;this['whatsappStatus']=_0x477d('0xd');this['whatsappStatusTime']=0x0;this[_0x477d('0x19')]=_0x3d2f8d[_0x477d('0x19')]||0x0;this[_0x477d('0x1a')]=0x0;this[_0x477d('0x1b')]=_0x477d('0xd');this[_0x477d('0x1c')]=0x0;this['openchannelCapacity']=_0x3d2f8d[_0x477d('0x1d')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x477d('0x1e')]=![];this[_0x477d('0x1f')]=undefined;this[_0x477d('0x0')]='';this[_0x477d('0x20')]={};this[_0x477d('0x21')]={};this[_0x477d('0x22')]={};this[_0x477d('0x23')]={};this[_0x477d('0x24')]={};this[_0x477d('0x25')]={};this[_0x477d('0x26')]();}Agent[_0x477d('0x27')][_0x477d('0x28')]=function(_0x43c845){if(this[_0x43c845+_0x477d('0x29')]>0x0){if(this[_0x43c845+'Capacity']>0x0&&this[_0x43c845+_0x477d('0x29')]>=this[_0x43c845+'Capacity']){return _0x477d('0x2a');}else{return _0x477d('0x2b');}}else{return _0x477d('0x2c');}};Agent[_0x477d('0x27')]['updateRealtime']=function(){var _0xd6dca5=[_0x477d('0x2d'),_0x477d('0x2e'),'openchannel','fax',_0x477d('0x2f'),_0x477d('0x30')];for(var _0x386df5=0x0;_0x386df5<_0xd6dca5['length'];_0x386df5+=0x1){var _0x254141=this[_0x477d('0x28')](_0xd6dca5[_0x386df5]);if(this[_0xd6dca5[_0x386df5]+_0x477d('0x31')]!==_0x254141){this[_0xd6dca5[_0x386df5]+_0x477d('0x32')]=_[_0x477d('0x33')](moment()['format']('x'));}this[_0xd6dca5[_0x386df5]+_0x477d('0x31')]=_0x254141;}var _0xeb02f5={'id':this['id'],'name':this[_0x477d('0x5')],'online':this[_0x477d('0x6')],'voicePause':this[_0x477d('0x7')],'chatPause':this[_0x477d('0x34')],'mailPause':this[_0x477d('0x8')],'smsPause':this[_0x477d('0xa')],'faxPause':this[_0x477d('0x9')],'openchannelPause':this[_0x477d('0xb')],'chatStatus':this[_0x477d('0xc')],'chatStatusTime':this[_0x477d('0x35')],'chatCapacity':this[_0x477d('0xe')],'chatCurrentCapacity':this[_0x477d('0x36')],'mailStatus':this[_0x477d('0x37')],'mailStatusTime':this[_0x477d('0xf')],'mailCapacity':this[_0x477d('0x10')],'mailCurrentCapacity':this[_0x477d('0x11')],'faxStatus':this[_0x477d('0x38')],'faxStatusTime':this[_0x477d('0x12')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x477d('0x14')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x477d('0x16')],'smsCapacity':this[_0x477d('0x17')],'smsCurrentCapacity':this[_0x477d('0x18')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x477d('0x39')],'whatsappCapacity':this[_0x477d('0x19')],'whatsappCurrentCapacity':this[_0x477d('0x1a')],'openchannelStatus':this[_0x477d('0x1b')],'openchannelStatusTime':this[_0x477d('0x1c')],'openchannelCapacity':this[_0x477d('0x1d')],'openchannelCurrentCapacity':this[_0x477d('0x3a')],'busy':this[_0x477d('0x1e')],'busyQueue':this[_0x477d('0x1f')],'chatWaitingInteractions':this[_0x477d('0x20')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x477d('0x22')],'openchannelWaitingInteractions':this[_0x477d('0x23')],'smsWaitingInteractions':this[_0x477d('0x24')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x50b3f7=md5(JSON[_0x477d('0x3b')](_0xeb02f5));if(this[_0x477d('0x0')]!==_0x50b3f7){this['md5']=_0x50b3f7;io['emit'](_0x477d('0x3c'),_[_0x477d('0x3d')](_0xeb02f5,[_0x477d('0x6')]));}};module[_0x477d('0x3e')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 1f7e42d..d47665a 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 _0xe68c=['timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','online','chatPause','available','stringify','format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name'];(function(_0x14079c,_0x5337b4){var _0xcd69c1=function(_0x4fe8c7){while(--_0x4fe8c7){_0x14079c['push'](_0x14079c['shift']());}};_0xcd69c1(++_0x5337b4);}(_0xe68c,0x123));var _0xce68=function(_0x403f5f,_0x283f67){_0x403f5f=_0x403f5f-0x0;var _0x15b1cd=_0xe68c[_0x403f5f];return _0x15b1cd;};'use strict';var _=require(_0xce68('0x0'));var md5=require(_0xce68('0x1'));var util=require(_0xce68('0x2'));var Redis=require(_0xce68('0x3'));var config=require(_0xce68('0x4'));config['redis']=_[_0xce68('0x5')](config['redis'],{'host':_0xce68('0x6'),'port':0x18eb});var io=require(_0xce68('0x7'))(new Redis(config['redis']));function ChatQueue(_0x54badc){this['id']=_0x54badc['id']||0x0;this['name']=_0x54badc[_0xce68('0x8')]||'';this[_0xce68('0x9')]=_0x54badc['timeout']||0xa;this[_0xce68('0xa')]=_0x54badc[_0xce68('0xa')]||_0xce68('0xb');this['Agents']=_0x54badc[_0xce68('0xc')];this['mapAgentsId']={};this[_0xce68('0xd')]=0x0;this[_0xce68('0x1')]='';this[_0xce68('0xe')]();this[_0xce68('0xf')]();}ChatQueue[_0xce68('0x10')][_0xce68('0xe')]=function(){var _0x28f0ae=this[_0xce68('0x11')][_0xce68('0x12')];this['mapAgentsId']=_[_0xce68('0x13')](this[_0xce68('0xc')],'id');this['mapAgentsId'][_0xce68('0x12')]=_0x28f0ae;};ChatQueue[_0xce68('0x10')]['updateRealtime']=function(){this[_0xce68('0x14')]=0x0;this[_0xce68('0x15')]=0x0;for(var _0x1ff6ed=0x0;_0x1ff6ed=0x0?this[_0xce68('0x18')]:0x0;var _0x11397f={'id':this['id'],'available':this[_0xce68('0x18')],'loggedIn':this[_0xce68('0x14')],'name':this[_0xce68('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x2d15d4=md5(JSON[_0xce68('0x19')](_0x11397f));if(this[_0xce68('0x1')]!==_0x2d15d4){this[_0xce68('0x1')]=_0x2d15d4;io['to'](util[_0xce68('0x1a')](_0xce68('0x1b'),_0x11397f['name']))[_0xce68('0x1c')]('chat_queue:save',_0x11397f);}};module[_0xce68('0x1d')]=ChatQueue; \ No newline at end of file +var _0xbb55=['loggedIn','paused','online','chatPause','available','stringify','md5','format','chat:queue:%s','chat_queue:save','exports','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x5d24da,_0x150462){var _0x19782d=function(_0x15cc0f){while(--_0x15cc0f){_0x5d24da['push'](_0x5d24da['shift']());}};_0x19782d(++_0x150462);}(_0xbb55,0xb9));var _0x5bb5=function(_0x96f4ca,_0xdbc7cc){_0x96f4ca=_0x96f4ca-0x0;var _0x3c94f9=_0xbb55[_0x96f4ca];return _0x3c94f9;};'use strict';var _=require(_0x5bb5('0x0'));var md5=require('md5');var util=require(_0x5bb5('0x1'));var Redis=require(_0x5bb5('0x2'));var config=require(_0x5bb5('0x3'));config['redis']=_[_0x5bb5('0x4')](config[_0x5bb5('0x5')],{'host':_0x5bb5('0x6'),'port':0x18eb});var io=require(_0x5bb5('0x7'))(new Redis(config['redis']));function ChatQueue(_0x4af11d){this['id']=_0x4af11d['id']||0x0;this[_0x5bb5('0x8')]=_0x4af11d[_0x5bb5('0x8')]||'';this[_0x5bb5('0x9')]=_0x4af11d[_0x5bb5('0x9')]||0xa;this['strategy']=_0x4af11d['strategy']||'beepall';this[_0x5bb5('0xa')]=_0x4af11d['Agents'];this[_0x5bb5('0xb')]={};this[_0x5bb5('0xc')]=0x0;this['md5']='';this[_0x5bb5('0xd')]();this[_0x5bb5('0xe')]();}ChatQueue[_0x5bb5('0xf')][_0x5bb5('0xd')]=function(){var _0x9faa3b=this[_0x5bb5('0xb')][_0x5bb5('0x10')];this[_0x5bb5('0xb')]=_[_0x5bb5('0x11')](this[_0x5bb5('0xa')],'id');this['mapAgentsId'][_0x5bb5('0x10')]=_0x9faa3b;};ChatQueue[_0x5bb5('0xf')]['updateRealtime']=function(){this[_0x5bb5('0x12')]=0x0;this[_0x5bb5('0x13')]=0x0;for(var _0x1cb399=0x0;_0x1cb399=0x0?this[_0x5bb5('0x16')]:0x0;var _0x372b5e={'id':this['id'],'available':this[_0x5bb5('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x5bb5('0x8')],'paused':this[_0x5bb5('0x13')],'waiting':this[_0x5bb5('0xc')]};var _0x374ed8=md5(JSON[_0x5bb5('0x17')](_0x372b5e));if(this[_0x5bb5('0x18')]!==_0x374ed8){this['md5']=_0x374ed8;io['to'](util[_0x5bb5('0x19')](_0x5bb5('0x1a'),_0x372b5e[_0x5bb5('0x8')]))['emit'](_0x5bb5('0x1b'),_0x372b5e);}};module[_0x5bb5('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 ec19378..b608c53 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 _0x090a=['map','prototype','loggedIn','paused','length','online','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr'];(function(_0x427572,_0x1d89f2){var _0x585590=function(_0x1699da){while(--_0x1699da){_0x427572['push'](_0x427572['shift']());}};_0x585590(++_0x1d89f2);}(_0x090a,0x98));var _0xa090=function(_0x15bbf1,_0x40ef96){_0x15bbf1=_0x15bbf1-0x0;var _0x5c4b47=_0x090a[_0x15bbf1];return _0x5c4b47;};'use strict';var _=require(_0xa090('0x0'));var md5=require(_0xa090('0x1'));var util=require(_0xa090('0x2'));var Redis=require(_0xa090('0x3'));var config=require(_0xa090('0x4'));config[_0xa090('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa090('0x5')]));function FaxQueue(_0x37628f){this['id']=_0x37628f['id']||0x0;this['name']=_0x37628f[_0xa090('0x6')]||'';this['timeout']=_0x37628f[_0xa090('0x7')]||0xa;this[_0xa090('0x8')]=_0x37628f[_0xa090('0x8')]||_0xa090('0x9');this[_0xa090('0xa')]=_0x37628f[_0xa090('0xa')];this[_0xa090('0xb')]={};this[_0xa090('0xc')]=0x0;this[_0xa090('0x1')]='';this[_0xa090('0xd')]();this[_0xa090('0xe')]();}FaxQueue['prototype']['updateRouting']=function(){var _0x5cb919=this[_0xa090('0xb')][_0xa090('0xf')];this[_0xa090('0xb')]=_[_0xa090('0x10')](this['Agents'],'id');this[_0xa090('0xb')][_0xa090('0xf')]=_0x5cb919;};FaxQueue[_0xa090('0x11')][_0xa090('0xe')]=function(){this[_0xa090('0x12')]=0x0;this[_0xa090('0x13')]=0x0;for(var _0x54d2c8=0x0;_0x54d2c8=0x0?this[_0xa090('0x17')]:0x0;var _0x5ada06={'id':this['id'],'available':this[_0xa090('0x17')],'loggedIn':this[_0xa090('0x12')],'name':this['name'],'paused':this[_0xa090('0x13')],'waiting':this[_0xa090('0xc')]};var _0x457d9b=md5(JSON[_0xa090('0x18')](_0x5ada06));if(this[_0xa090('0x1')]!==_0x457d9b){this[_0xa090('0x1')]=_0x457d9b;io['to'](util['format'](_0xa090('0x19'),_0x5ada06['name']))[_0xa090('0x1a')](_0xa090('0x1b'),_0x5ada06);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x4f74=['beepall','waiting','updateRealtime','updateRouting','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','online','faxPause','available','format','fax_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4f74,0x9d));var _0x44f7=function(_0x390a19,_0x5dd137){_0x390a19=_0x390a19-0x0;var _0x5d8230=_0x4f74[_0x390a19];return _0x5d8230;};'use strict';var _=require(_0x44f7('0x0'));var md5=require(_0x44f7('0x1'));var util=require('util');var Redis=require(_0x44f7('0x2'));var config=require(_0x44f7('0x3'));config[_0x44f7('0x4')]=_[_0x44f7('0x5')](config[_0x44f7('0x4')],{'host':_0x44f7('0x6'),'port':0x18eb});var io=require(_0x44f7('0x7'))(new Redis(config[_0x44f7('0x4')]));function FaxQueue(_0x423aba){this['id']=_0x423aba['id']||0x0;this['name']=_0x423aba[_0x44f7('0x8')]||'';this['timeout']=_0x423aba[_0x44f7('0x9')]||0xa;this[_0x44f7('0xa')]=_0x423aba['strategy']||_0x44f7('0xb');this['Agents']=_0x423aba['Agents'];this['mapAgentsId']={};this[_0x44f7('0xc')]=0x0;this[_0x44f7('0x1')]='';this['updateRouting']();this[_0x44f7('0xd')]();}FaxQueue['prototype'][_0x44f7('0xe')]=function(){var _0x5569dc=this[_0x44f7('0xf')][_0x44f7('0x10')];this[_0x44f7('0xf')]=_[_0x44f7('0x11')](this[_0x44f7('0x12')],'id');this[_0x44f7('0xf')][_0x44f7('0x10')]=_0x5569dc;};FaxQueue[_0x44f7('0x13')][_0x44f7('0xd')]=function(){this[_0x44f7('0x14')]=0x0;this[_0x44f7('0x15')]=0x0;for(var _0x4f289e=0x0;_0x4f289e=0x0?this[_0x44f7('0x19')]:0x0;var _0xce2430={'id':this['id'],'available':this['available'],'loggedIn':this[_0x44f7('0x14')],'name':this[_0x44f7('0x8')],'paused':this[_0x44f7('0x15')],'waiting':this['waiting']};var _0x4ea19f=md5(JSON['stringify'](_0xce2430));if(this['md5']!==_0x4ea19f){this['md5']=_0x4ea19f;io['to'](util[_0x44f7('0x1a')]('fax:queue:%s',_0xce2430[_0x44f7('0x8')]))['emit'](_0x44f7('0x1b'),_0xce2430);}};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 98c66a1..e8986f2 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 _0xff95=['name','Intervals'];(function(_0x1cdf54,_0x50de61){var _0x3cfbc9=function(_0xcfbe2a){while(--_0xcfbe2a){_0x1cdf54['push'](_0x1cdf54['shift']());}};_0x3cfbc9(++_0x50de61);}(_0xff95,0x192));var _0x5ff9=function(_0x1024f5,_0x38928d){_0x1024f5=_0x1024f5-0x0;var _0x52a242=_0xff95[_0x1024f5];return _0x52a242;};'use strict';function Interval(_0x282f8c){this['id']=_0x282f8c['id']||0x0;this[_0x5ff9('0x0')]=_0x282f8c[_0x5ff9('0x0')]||'';this[_0x5ff9('0x1')]=_0x282f8c['Intervals']||{};}module['exports']=Interval; \ No newline at end of file +var _0x1727=['name','Intervals','exports'];(function(_0x301ca6,_0x70db90){var _0xee668b=function(_0x5ee475){while(--_0x5ee475){_0x301ca6['push'](_0x301ca6['shift']());}};_0xee668b(++_0x70db90);}(_0x1727,0x1ec));var _0x7172=function(_0x23cd05,_0x125cce){_0x23cd05=_0x23cd05-0x0;var _0x3fc54b=_0x1727[_0x23cd05];return _0x3fc54b;};'use strict';function Interval(_0x4758ae){this['id']=_0x4758ae['id']||0x0;this[_0x7172('0x0')]=_0x4758ae[_0x7172('0x0')]||'';this[_0x7172('0x1')]=_0x4758ae[_0x7172('0x1')]||{};}module[_0x7172('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 5cd1974..d6763fb 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 _0xd27a=['../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','prototype','_rr','mapAgentsId','map','updateRealtime','loggedIn','paused','length','online','available','stringify','format','mail:queue:%s','exports','lodash','util'];(function(_0x22bbf5,_0xd5ba18){var _0x2c0323=function(_0xafeab4){while(--_0xafeab4){_0x22bbf5['push'](_0x22bbf5['shift']());}};_0x2c0323(++_0xd5ba18);}(_0xd27a,0x186));var _0xad27=function(_0x229c5f,_0x28e427){_0x229c5f=_0x229c5f-0x0;var _0x32b7d6=_0xd27a[_0x229c5f];return _0x32b7d6;};'use strict';var _=require(_0xad27('0x0'));var md5=require('md5');var util=require(_0xad27('0x1'));var Redis=require('ioredis');var config=require(_0xad27('0x2'));config[_0xad27('0x3')]=_[_0xad27('0x4')](config['redis'],{'host':_0xad27('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xad27('0x3')]));function MailQueue(_0x468657){this['id']=_0x468657['id']||0x0;this[_0xad27('0x6')]=_0x468657['name']||'';this[_0xad27('0x7')]=_0x468657[_0xad27('0x7')]||0xa;this[_0xad27('0x8')]=_0x468657[_0xad27('0x8')]||_0xad27('0x9');this[_0xad27('0xa')]=_0x468657['Agents'];this['mapAgentsId']={};this[_0xad27('0xb')]=0x0;this[_0xad27('0xc')]='';this[_0xad27('0xd')]();this['updateRealtime']();}MailQueue[_0xad27('0xe')][_0xad27('0xd')]=function(){var _0x1cae72=this['mapAgentsId'][_0xad27('0xf')];this[_0xad27('0x10')]=_[_0xad27('0x11')](this[_0xad27('0xa')],'id');this[_0xad27('0x10')][_0xad27('0xf')]=_0x1cae72;};MailQueue[_0xad27('0xe')][_0xad27('0x12')]=function(){this[_0xad27('0x13')]=0x0;this[_0xad27('0x14')]=0x0;for(var _0x3a4a8b=0x0;_0x3a4a8b=0x0?this['available']:0x0;var _0xbe48a7={'id':this['id'],'available':this[_0xad27('0x17')],'loggedIn':this[_0xad27('0x13')],'name':this['name'],'paused':this[_0xad27('0x14')],'waiting':this['waiting']};var _0x6daeb0=md5(JSON[_0xad27('0x18')](_0xbe48a7));if(this[_0xad27('0xc')]!==_0x6daeb0){this['md5']=_0x6daeb0;io['to'](util[_0xad27('0x19')](_0xad27('0x1a'),_0xbe48a7[_0xad27('0x6')]))['emit']('mail_queue:save',_0xbe48a7);}};module[_0xad27('0x1b')]=MailQueue; \ No newline at end of file +var _0xaba5=['lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','paused','length','online','loggedIn','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save'];(function(_0x5590c5,_0x1a8e1e){var _0x3519d1=function(_0x8524d2){while(--_0x8524d2){_0x5590c5['push'](_0x5590c5['shift']());}};_0x3519d1(++_0x1a8e1e);}(_0xaba5,0x105));var _0x5aba=function(_0x1b8ecd,_0x38a0ff){_0x1b8ecd=_0x1b8ecd-0x0;var _0x343c02=_0xaba5[_0x1b8ecd];return _0x343c02;};'use strict';var _=require(_0x5aba('0x0'));var md5=require(_0x5aba('0x1'));var util=require(_0x5aba('0x2'));var Redis=require(_0x5aba('0x3'));var config=require(_0x5aba('0x4'));config[_0x5aba('0x5')]=_['defaults'](config[_0x5aba('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x5aba('0x6'))(new Redis(config[_0x5aba('0x5')]));function MailQueue(_0x198dfa){this['id']=_0x198dfa['id']||0x0;this[_0x5aba('0x7')]=_0x198dfa[_0x5aba('0x7')]||'';this[_0x5aba('0x8')]=_0x198dfa[_0x5aba('0x8')]||0xa;this[_0x5aba('0x9')]=_0x198dfa[_0x5aba('0x9')]||_0x5aba('0xa');this[_0x5aba('0xb')]=_0x198dfa['Agents'];this[_0x5aba('0xc')]={};this[_0x5aba('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0x5aba('0xe')]();}MailQueue[_0x5aba('0xf')][_0x5aba('0x10')]=function(){var _0x280733=this['mapAgentsId'][_0x5aba('0x11')];this['mapAgentsId']=_[_0x5aba('0x12')](this[_0x5aba('0xb')],'id');this[_0x5aba('0xc')][_0x5aba('0x11')]=_0x280733;};MailQueue[_0x5aba('0xf')][_0x5aba('0xe')]=function(){this['loggedIn']=0x0;this[_0x5aba('0x13')]=0x0;for(var _0x52b7ca=0x0;_0x52b7ca=0x0?this[_0x5aba('0x18')]:0x0;var _0x31a150={'id':this['id'],'available':this[_0x5aba('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x5aba('0x7')],'paused':this['paused'],'waiting':this[_0x5aba('0xd')]};var _0x189be8=md5(JSON[_0x5aba('0x19')](_0x31a150));if(this[_0x5aba('0x1')]!==_0x189be8){this[_0x5aba('0x1')]=_0x189be8;io['to'](util['format'](_0x5aba('0x1a'),_0x31a150[_0x5aba('0x7')]))[_0x5aba('0x1b')](_0x5aba('0x1c'),_0x31a150);}};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 87110bf..36c3baa 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x326f,0xd1));var _0xf326=function(_0x1f1f1f,_0x1302dc){_0x1f1f1f=_0x1f1f1f-0x0;var _0x285267=_0x326f[_0x1f1f1f];return _0x285267;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _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(_0x15f031,_0x58331b){var _0x1c4885=function(_0x26aa80){while(--_0x26aa80){_0x15f031['push'](_0x15f031['shift']());}};_0x1c4885(++_0x58331b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x519c88,_0xb84103){_0x519c88=_0x519c88-0x0;var _0x4668d7=_0x5fc3[_0x519c88];return _0x4668d7;};'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 e13bbba..6916d97 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 _0xb2b3=['waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x49c351,_0x104b09){var _0x1fb07c=function(_0x3eca6a){while(--_0x3eca6a){_0x49c351['push'](_0x49c351['shift']());}};_0x1fb07c(++_0x104b09);}(_0xb2b3,0x71));var _0x3b2b=function(_0x30b29c,_0x10f252){_0x30b29c=_0x30b29c-0x0;var _0x1e05f7=_0xb2b3[_0x30b29c];return _0x1e05f7;};'use strict';var _=require(_0x3b2b('0x0'));var md5=require(_0x3b2b('0x1'));var util=require(_0x3b2b('0x2'));var Redis=require(_0x3b2b('0x3'));var config=require(_0x3b2b('0x4'));config[_0x3b2b('0x5')]=_[_0x3b2b('0x6')](config['redis'],{'host':_0x3b2b('0x7'),'port':0x18eb});var io=require(_0x3b2b('0x8'))(new Redis(config[_0x3b2b('0x5')]));function SmsQueue(_0x45e179){this['id']=_0x45e179['id']||0x0;this[_0x3b2b('0x9')]=_0x45e179[_0x3b2b('0x9')]||'';this[_0x3b2b('0xa')]=_0x45e179[_0x3b2b('0xa')]||0xa;this[_0x3b2b('0xb')]=_0x45e179[_0x3b2b('0xb')]||_0x3b2b('0xc');this[_0x3b2b('0xd')]=_0x45e179['Agents'];this[_0x3b2b('0xe')]={};this[_0x3b2b('0xf')]=0x0;this[_0x3b2b('0x1')]='';this[_0x3b2b('0x10')]();this[_0x3b2b('0x11')]();}SmsQueue[_0x3b2b('0x12')]['updateRouting']=function(){var _0x492f5f=this[_0x3b2b('0xe')][_0x3b2b('0x13')];this[_0x3b2b('0xe')]=_[_0x3b2b('0x14')](this['Agents'],'id');this[_0x3b2b('0xe')][_0x3b2b('0x13')]=_0x492f5f;};SmsQueue[_0x3b2b('0x12')][_0x3b2b('0x11')]=function(){this[_0x3b2b('0x15')]=0x0;this[_0x3b2b('0x16')]=0x0;for(var _0x52b63f=0x0;_0x52b63f=0x0?this[_0x3b2b('0x19')]:0x0;var _0x52bba5={'id':this['id'],'available':this[_0x3b2b('0x19')],'loggedIn':this[_0x3b2b('0x15')],'name':this['name'],'paused':this[_0x3b2b('0x16')],'waiting':this['waiting']};var _0x26f83=md5(JSON[_0x3b2b('0x1a')](_0x52bba5));if(this['md5']!==_0x26f83){this['md5']=_0x26f83;io['to'](util[_0x3b2b('0x1b')](_0x3b2b('0x1c'),_0x52bba5[_0x3b2b('0x9')]))[_0x3b2b('0x1d')](_0x3b2b('0x1e'),_0x52bba5);}};module[_0x3b2b('0x1f')]=SmsQueue; \ No newline at end of file +var _0xf403=['sms:queue:%s','emit','sms_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','loggedIn','length','online','smsPause','paused','available','md5','format'];(function(_0x5b5eef,_0x3303f9){var _0xa0e915=function(_0x2fba87){while(--_0x2fba87){_0x5b5eef['push'](_0x5b5eef['shift']());}};_0xa0e915(++_0x3303f9);}(_0xf403,0x1d3));var _0x3f40=function(_0x1b173a,_0x1aeeba){_0x1b173a=_0x1b173a-0x0;var _0x3757f5=_0xf403[_0x1b173a];return _0x3757f5;};'use strict';var _=require(_0x3f40('0x0'));var md5=require('md5');var util=require(_0x3f40('0x1'));var Redis=require(_0x3f40('0x2'));var config=require(_0x3f40('0x3'));config[_0x3f40('0x4')]=_[_0x3f40('0x5')](config[_0x3f40('0x4')],{'host':_0x3f40('0x6'),'port':0x18eb});var io=require(_0x3f40('0x7'))(new Redis(config['redis']));function SmsQueue(_0x4e91bb){this['id']=_0x4e91bb['id']||0x0;this[_0x3f40('0x8')]=_0x4e91bb[_0x3f40('0x8')]||'';this[_0x3f40('0x9')]=_0x4e91bb[_0x3f40('0x9')]||0xa;this['strategy']=_0x4e91bb[_0x3f40('0xa')]||'beepall';this['Agents']=_0x4e91bb[_0x3f40('0xb')];this[_0x3f40('0xc')]={};this[_0x3f40('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0x3f40('0xe')]();}SmsQueue[_0x3f40('0xf')][_0x3f40('0x10')]=function(){var _0x4e30e2=this[_0x3f40('0xc')][_0x3f40('0x11')];this[_0x3f40('0xc')]=_['map'](this[_0x3f40('0xb')],'id');this['mapAgentsId'][_0x3f40('0x11')]=_0x4e30e2;};SmsQueue[_0x3f40('0xf')][_0x3f40('0xe')]=function(){this[_0x3f40('0x12')]=0x0;this['paused']=0x0;for(var _0x2b2bfe=0x0;_0x2b2bfe=0x0?this[_0x3f40('0x17')]:0x0;var _0x374644={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3f40('0x12')],'name':this[_0x3f40('0x8')],'paused':this[_0x3f40('0x16')],'waiting':this[_0x3f40('0xd')]};var _0x3129e2=md5(JSON['stringify'](_0x374644));if(this[_0x3f40('0x18')]!==_0x3129e2){this['md5']=_0x3129e2;io['to'](util[_0x3f40('0x19')](_0x3f40('0x1a'),_0x374644[_0x3f40('0x8')]))[_0x3f40('0x1b')](_0x3f40('0x1c'),_0x374644);}};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 7cabb6e..3e28a96 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 _0x09c7=['localhost','socket.io-emitter','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','length','loggedIn','paused','available','name','stringify','emit','whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09c7,0xd2));var _0x709c=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x09c7[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x709c('0x0'));var md5=require(_0x709c('0x1'));var util=require(_0x709c('0x2'));var Redis=require('ioredis');var config=require(_0x709c('0x3'));config[_0x709c('0x4')]=_[_0x709c('0x5')](config[_0x709c('0x4')],{'host':_0x709c('0x6'),'port':0x18eb});var io=require(_0x709c('0x7'))(new Redis(config[_0x709c('0x4')]));function WhatsappQueue(_0x4dc74d){this['id']=_0x4dc74d['id']||0x0;this['name']=_0x4dc74d['name']||'';this['timeout']=_0x4dc74d['timeout']||0xa;this[_0x709c('0x8')]=_0x4dc74d[_0x709c('0x8')]||_0x709c('0x9');this[_0x709c('0xa')]=_0x4dc74d['Agents'];this[_0x709c('0xb')]={};this[_0x709c('0xc')]=0x0;this[_0x709c('0x1')]='';this[_0x709c('0xd')]();this[_0x709c('0xe')]();}WhatsappQueue['prototype'][_0x709c('0xd')]=function(){var _0x38ad79=this['mapAgentsId'][_0x709c('0xf')];this[_0x709c('0xb')]=_[_0x709c('0x10')](this['Agents'],'id');this[_0x709c('0xb')]['_rr']=_0x38ad79;};WhatsappQueue[_0x709c('0x11')][_0x709c('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x59a0f4=0x0;_0x59a0f4=0x0?this[_0x709c('0x15')]:0x0;var _0x35175f={'id':this['id'],'available':this[_0x709c('0x15')],'loggedIn':this[_0x709c('0x13')],'name':this[_0x709c('0x16')],'paused':this[_0x709c('0x14')],'waiting':this['waiting']};var _0x349ee3=md5(JSON[_0x709c('0x17')](_0x35175f));if(this[_0x709c('0x1')]!==_0x349ee3){this[_0x709c('0x1')]=_0x349ee3;io['to'](util['format']('whatsapp:queue:%s',_0x35175f['name']))[_0x709c('0x18')](_0x709c('0x19'),_0x35175f);}};module[_0x709c('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0xbe48=['md5','ioredis','../../../config/environment','redis','defaults','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','paused','length','online','loggedIn','available','name','stringify','format','whatsapp:queue:%s','emit','exports'];(function(_0x5ea51f,_0x1e3a5b){var _0x28f6ab=function(_0x3bb09f){while(--_0x3bb09f){_0x5ea51f['push'](_0x5ea51f['shift']());}};_0x28f6ab(++_0x1e3a5b);}(_0xbe48,0x1cb));var _0x8be4=function(_0x3014e6,_0x4c010f){_0x3014e6=_0x3014e6-0x0;var _0x208f8a=_0xbe48[_0x3014e6];return _0x208f8a;};'use strict';var _=require('lodash');var md5=require(_0x8be4('0x0'));var util=require('util');var Redis=require(_0x8be4('0x1'));var config=require(_0x8be4('0x2'));config[_0x8be4('0x3')]=_[_0x8be4('0x4')](config[_0x8be4('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x5e982b){this['id']=_0x5e982b['id']||0x0;this['name']=_0x5e982b['name']||'';this[_0x8be4('0x5')]=_0x5e982b[_0x8be4('0x5')]||0xa;this[_0x8be4('0x6')]=_0x5e982b[_0x8be4('0x6')]||_0x8be4('0x7');this[_0x8be4('0x8')]=_0x5e982b[_0x8be4('0x8')];this['mapAgentsId']={};this[_0x8be4('0x9')]=0x0;this[_0x8be4('0x0')]='';this[_0x8be4('0xa')]();this[_0x8be4('0xb')]();}WhatsappQueue[_0x8be4('0xc')][_0x8be4('0xa')]=function(){var _0x29c3b5=this[_0x8be4('0xd')]['_rr'];this[_0x8be4('0xd')]=_[_0x8be4('0xe')](this[_0x8be4('0x8')],'id');this[_0x8be4('0xd')][_0x8be4('0xf')]=_0x29c3b5;};WhatsappQueue[_0x8be4('0xc')][_0x8be4('0xb')]=function(){this['loggedIn']=0x0;this[_0x8be4('0x10')]=0x0;for(var _0x4d840d=0x0;_0x4d840d=0x0?this[_0x8be4('0x14')]:0x0;var _0x52d1b5={'id':this['id'],'available':this[_0x8be4('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x8be4('0x15')],'paused':this[_0x8be4('0x10')],'waiting':this[_0x8be4('0x9')]};var _0x4851f4=md5(JSON[_0x8be4('0x16')](_0x52d1b5));if(this['md5']!==_0x4851f4){this[_0x8be4('0x0')]=_0x4851f4;io['to'](util[_0x8be4('0x17')](_0x8be4('0x18'),_0x52d1b5['name']))[_0x8be4('0x19')]('whatsapp_queue:save',_0x52d1b5);}};module[_0x8be4('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 10d27fe..b978420 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x9613c6,_0x53b76c){var _0x130cca=function(_0x40bbdb){while(--_0x40bbdb){_0x9613c6['push'](_0x9613c6['shift']());}};_0x130cca(++_0x53b76c);}(_0xb10b,0x12a));var _0xbb10=function(_0xce4604,_0x5e98ad){_0xce4604=_0xce4604-0x0;var _0x474352=_0xb10b[_0xce4604];return _0x474352;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index c7a888e..87b161b 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 _0x6ff3=['addTagsToChatInteraction','../client','Request','UpdateChatInteraction','AddTagsToChatInteraction'];(function(_0x5ddbc6,_0x49b8f4){var _0x5ca38f=function(_0x48f4be){while(--_0x48f4be){_0x5ddbc6['push'](_0x5ddbc6['shift']());}};_0x5ca38f(++_0x49b8f4);}(_0x6ff3,0x1b4));var _0x36ff=function(_0x1ca00f,_0x5ee88b){_0x1ca00f=_0x1ca00f-0x0;var _0x1d336c=_0x6ff3[_0x1ca00f];return _0x1d336c;};'use strict';var client=require(_0x36ff('0x0'));exports['update']=function(_0x47a28f,_0x312106){return client[_0x36ff('0x1')](_0x36ff('0x2'),{'body':_0x312106,'options':{'where':{'id':_0x47a28f}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x453af1,_0x5b6573){return client[_0x36ff('0x1')](_0x36ff('0x3'),{'body':_0x5b6573,'options':{'where':{'id':_0x453af1}},'log':_0x36ff('0x4')});}; \ No newline at end of file +var _0x584e=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x171ca6,_0x2f8f9d){var _0x244768=function(_0x25390c){while(--_0x25390c){_0x171ca6['push'](_0x171ca6['shift']());}};_0x244768(++_0x2f8f9d);}(_0x584e,0x81));var _0xe584=function(_0x2bbc07,_0x1e2168){_0x2bbc07=_0x2bbc07-0x0;var _0x6879e4=_0x584e[_0x2bbc07];return _0x6879e4;};'use strict';var client=require(_0xe584('0x0'));exports['update']=function(_0x50f4f1,_0x5670d5){return client['Request']('UpdateChatInteraction',{'body':_0x5670d5,'options':{'where':{'id':_0x50f4f1}},'log':_0xe584('0x1')});};exports[_0xe584('0x2')]=function(_0x4aefe6,_0x1c842e){return client['Request'](_0xe584('0x3'),{'body':_0x1c842e,'options':{'where':{'id':_0x4aefe6}},'log':_0xe584('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index e64cf15..c5320a8 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 _0x8b61=['Request','CreateChatMessage','createChatMessage','../client'];(function(_0x38b396,_0x5353aa){var _0x5daa5f=function(_0x2f4fd3){while(--_0x2f4fd3){_0x38b396['push'](_0x38b396['shift']());}};_0x5daa5f(++_0x5353aa);}(_0x8b61,0x1cb));var _0x18b6=function(_0x287519,_0x19a781){_0x287519=_0x287519-0x0;var _0x3d7c20=_0x8b61[_0x287519];return _0x3d7c20;};'use strict';var client=require(_0x18b6('0x0'));exports['create']=function(_0x3d6d34){return client[_0x18b6('0x1')](_0x18b6('0x2'),{'body':_0x3d6d34,'log':_0x18b6('0x3')});}; \ No newline at end of file +var _0xe422=['create','createChatMessage'];(function(_0xfe7644,_0x2f083e){var _0x2a3f13=function(_0x8f3c94){while(--_0x8f3c94){_0xfe7644['push'](_0xfe7644['shift']());}};_0x2a3f13(++_0x2f083e);}(_0xe422,0xf4));var _0x2e42=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe422[_0x4a9fb1];return _0x348672;};'use strict';var client=require('../client');exports[_0x2e42('0x0')]=function(_0x5b96a8){return client['Request']('CreateChatMessage',{'body':_0x5b96a8,'log':_0x2e42('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index aac62f7..aa9f4b6 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 _0xc818=['getChatQueues','Request','GetChatQueue','timeout','strategy','User','Agents','name','online','chatPause','../client'];(function(_0x1ff001,_0x2286c9){var _0x312a70=function(_0x1b498b){while(--_0x1b498b){_0x1ff001['push'](_0x1ff001['shift']());}};_0x312a70(++_0x2286c9);}(_0xc818,0x1e3));var _0x8c81=function(_0x489b3c,_0x5a2f09){_0x489b3c=_0x489b3c-0x0;var _0x9366f5=_0xc818[_0x489b3c];return _0x9366f5;};'use strict';var client=require(_0x8c81('0x0'));exports[_0x8c81('0x1')]=function(){return function(){return client[_0x8c81('0x2')](_0x8c81('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8c81('0x4'),_0x8c81('0x5')],'include':[{'model':_0x8c81('0x6'),'as':_0x8c81('0x7'),'attributes':['id',_0x8c81('0x8'),_0x8c81('0x9'),_0x8c81('0xa')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xa1aa=['chatPause','Request','GetChatQueue','name','timeout','strategy','User','Agents','online'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xa1aa,0x88));var _0xaa1a=function(_0x3d27df,_0x157763){_0x3d27df=_0x3d27df-0x0;var _0x5cc78c=_0xa1aa[_0x3d27df];return _0x5cc78c;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0xaa1a('0x0')](_0xaa1a('0x1'),{'options':{'raw':![],'attributes':['id',_0xaa1a('0x2'),_0xaa1a('0x3'),_0xaa1a('0x4')],'include':[{'model':_0xaa1a('0x5'),'as':_0xaa1a('0x6'),'attributes':['id','name',_0xaa1a('0x7'),_0xaa1a('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index aaea002..3c1cc67 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 _0x81d5=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0xd63e3a,_0x1bd6eb){var _0x19c178=function(_0x56be0d){while(--_0x56be0d){_0xd63e3a['push'](_0xd63e3a['shift']());}};_0x19c178(++_0x1bd6eb);}(_0x81d5,0x1ab));var _0x581d=function(_0x2aca1e,_0x32799c){_0x2aca1e=_0x2aca1e-0x0;var _0x6c6c79=_0x81d5[_0x2aca1e];return _0x6c6c79;};'use strict';var client=require(_0x581d('0x0'));exports[_0x581d('0x1')]=function(_0x55fd33){return client[_0x581d('0x2')](_0x581d('0x3'),{'body':_0x55fd33,'log':_0x581d('0x3')});};exports[_0x581d('0x4')]=function(_0x477e28,_0x553617){return client['Request'](_0x581d('0x5'),{'body':_0x553617,'options':{'where':{'uniqueid':_0x477e28},'order':[['id',_0x581d('0x6')]],'limit':0x1},'log':_0x581d('0x5')});}; \ No newline at end of file +var _0x0207=['CreateChatQueueReport','update','Request','UpdateChatQueueReport','create'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0x0207,0x162));var _0x7020=function(_0x4eab4d,_0x1fbd49){_0x4eab4d=_0x4eab4d-0x0;var _0x3bffce=_0x0207[_0x4eab4d];return _0x3bffce;};'use strict';var client=require('../client');exports[_0x7020('0x0')]=function(_0x4a5f80){return client['Request'](_0x7020('0x1'),{'body':_0x4a5f80,'log':_0x7020('0x1')});};exports[_0x7020('0x2')]=function(_0x15db09,_0x2e62fd){return client[_0x7020('0x3')](_0x7020('0x4'),{'body':_0x2e62fd,'options':{'where':{'uniqueid':_0x15db09},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index e80233e..507d1af 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x788de2,_0x5da66a){var _0x5bba81=function(_0x156f75){while(--_0x156f75){_0x788de2['push'](_0x788de2['shift']());}};_0x5bba81(++_0x5da66a);}(_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 +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x514989,_0x2437bb){var _0x132218=function(_0x2c93c2){while(--_0x2c93c2){_0x514989['push'](_0x514989['shift']());}};_0x132218(++_0x2437bb);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index e1c6e6c..c145da6 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 _0x8d9d=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x35d4d4,_0x4fa97d){var _0x145f3b=function(_0x2eeca3){while(--_0x2eeca3){_0x35d4d4['push'](_0x35d4d4['shift']());}};_0x145f3b(++_0x4fa97d);}(_0x8d9d,0x1e6));var _0xd8d9=function(_0x260f7b,_0x55199e){_0x260f7b=_0x260f7b-0x0;var _0x555862=_0x8d9d[_0x260f7b];return _0x555862;};'use strict';var client=require(_0xd8d9('0x0'));exports[_0xd8d9('0x1')]=function(_0x22208c){return client[_0xd8d9('0x2')](_0xd8d9('0x3'),{'body':_0x22208c,'log':_0xd8d9('0x4')});}; \ No newline at end of file +var _0x24be=['create','Request','createFaxMessage'];(function(_0x158a01,_0x50bcb8){var _0x94b215=function(_0x295679){while(--_0x295679){_0x158a01['push'](_0x158a01['shift']());}};_0x94b215(++_0x50bcb8);}(_0x24be,0x174));var _0xe24b=function(_0x10bc8f,_0x1b6a01){_0x10bc8f=_0x10bc8f-0x0;var _0x53e7f2=_0x24be[_0x10bc8f];return _0x53e7f2;};'use strict';var client=require('../client');exports[_0xe24b('0x0')]=function(_0x47ce7b){return client[_0xe24b('0x1')]('CreateFaxMessage',{'body':_0x47ce7b,'log':_0xe24b('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index d2e4516..bd57661 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 _0x3e4a=['faxPause','../client','getFaxQueues','Request','GetFaxQueue','User','Agents','name'];(function(_0x440c9d,_0x4ea95b){var _0x4a6c8a=function(_0x169b61){while(--_0x169b61){_0x440c9d['push'](_0x440c9d['shift']());}};_0x4a6c8a(++_0x4ea95b);}(_0x3e4a,0x91));var _0xa3e4=function(_0x34242a,_0x4e8623){_0x34242a=_0x34242a-0x0;var _0x1d4330=_0x3e4a[_0x34242a];return _0x1d4330;};'use strict';var client=require(_0xa3e4('0x0'));exports[_0xa3e4('0x1')]=function(){return function(){return client[_0xa3e4('0x2')](_0xa3e4('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xa3e4('0x4'),'as':_0xa3e4('0x5'),'attributes':['id',_0xa3e4('0x6'),'online',_0xa3e4('0x7')]}]},'log':_0xa3e4('0x1')});};}; \ No newline at end of file +var _0xdfcb=['faxPause','../client','getFaxQueues','Request','name','timeout','Agents','online'];(function(_0x5db7fe,_0x1bcf6a){var _0x4b724a=function(_0x206a9f){while(--_0x206a9f){_0x5db7fe['push'](_0x5db7fe['shift']());}};_0x4b724a(++_0x1bcf6a);}(_0xdfcb,0x171));var _0xbdfc=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0xdfcb[_0x22e47a];return _0x15a12a;};'use strict';var client=require(_0xbdfc('0x0'));exports[_0xbdfc('0x1')]=function(){return function(){return client[_0xbdfc('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xbdfc('0x3'),_0xbdfc('0x4'),'strategy'],'include':[{'model':'User','as':_0xbdfc('0x5'),'attributes':['id',_0xbdfc('0x3'),_0xbdfc('0x6'),_0xbdfc('0x7')]}]},'log':_0xbdfc('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 8118a2b..3ddb649 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 _0x9636=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9636,0x17a));var _0x6963=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9636[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x6963('0x0'));exports[_0x6963('0x1')]=function(_0x4b622a){return client[_0x6963('0x2')](_0x6963('0x3'),{'body':_0x4b622a,'log':_0x6963('0x3')});};exports[_0x6963('0x4')]=function(_0x2929d4,_0x3c976e){return client[_0x6963('0x2')]('UpdateFaxQueueReport',{'body':_0x3c976e,'options':{'where':{'uniqueid':_0x2929d4},'order':[['id','DESC']],'limit':0x1},'log':_0x6963('0x5')});}; \ No newline at end of file +var _0xd47c=['CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','../client','create'];(function(_0x59c206,_0x469c55){var _0x4c8b7e=function(_0x4ebc73){while(--_0x4ebc73){_0x59c206['push'](_0x59c206['shift']());}};_0x4c8b7e(++_0x469c55);}(_0xd47c,0x178));var _0xcd47=function(_0x54e2e1,_0x29c745){_0x54e2e1=_0x54e2e1-0x0;var _0x526017=_0xd47c[_0x54e2e1];return _0x526017;};'use strict';var client=require(_0xcd47('0x0'));exports[_0xcd47('0x1')]=function(_0x3e2231){return client['Request'](_0xcd47('0x2'),{'body':_0x3e2231,'log':'CreateFaxQueueReport'});};exports[_0xcd47('0x3')]=function(_0x5c6b61,_0xc890c0){return client[_0xcd47('0x4')](_0xcd47('0x5'),{'body':_0xc890c0,'options':{'where':{'uniqueid':_0x5c6b61},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 2d5f053..f381597 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 _0xae71=['name','Interval','Intervals','interval','../client','getIntervals','Request','GetInterval'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xae71,0x164));var _0x1ae7=function(_0x29f834,_0x3f4057){_0x29f834=_0x29f834-0x0;var _0x54e72d=_0xae71[_0x29f834];return _0x54e72d;};'use strict';var client=require(_0x1ae7('0x0'));exports[_0x1ae7('0x1')]=function(){return function(){return client[_0x1ae7('0x2')](_0x1ae7('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x1ae7('0x4')],'include':[{'model':_0x1ae7('0x5'),'as':_0x1ae7('0x6'),'attributes':['id','name',_0x1ae7('0x7')]}]},'log':_0x1ae7('0x1')});};}; \ No newline at end of file +var _0xe0a4=['name','Interval','Intervals','interval','getIntervals','Request','GetInterval'];(function(_0x32e57a,_0x3d5c3d){var _0x493891=function(_0x502743){while(--_0x502743){_0x32e57a['push'](_0x32e57a['shift']());}};_0x493891(++_0x3d5c3d);}(_0xe0a4,0xcf));var _0x4e0a=function(_0x2ff497,_0x2c0151){_0x2ff497=_0x2ff497-0x0;var _0x355215=_0xe0a4[_0x2ff497];return _0x355215;};'use strict';var client=require('../client');exports[_0x4e0a('0x0')]=function(){return function(){return client[_0x4e0a('0x1')](_0x4e0a('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x4e0a('0x3')],'include':[{'model':_0x4e0a('0x4'),'as':_0x4e0a('0x5'),'attributes':['id','name',_0x4e0a('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index d84a7f2..64df21a 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 _0x5f66=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x20bd63,_0x4e0a76){var _0x5ad21c=function(_0xd2e465){while(--_0xd2e465){_0x20bd63['push'](_0x20bd63['shift']());}};_0x5ad21c(++_0x4e0a76);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var client=require('../client');exports[_0x65f6('0x0')]=function(_0x4a3887,_0x2d5fd9){return client[_0x65f6('0x1')](_0x65f6('0x2'),{'body':_0x2d5fd9,'options':{'where':{'id':_0x4a3887}},'log':_0x65f6('0x3')});};exports[_0x65f6('0x4')]=function(_0x5eb9ad,_0x3c5029){return client['Request'](_0x65f6('0x5'),{'body':_0x3c5029,'options':{'where':{'id':_0x5eb9ad}},'log':_0x65f6('0x6')});}; \ No newline at end of file +var _0x6343=['AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x4be1ba,_0x123919){var _0x373268=function(_0x5b0629){while(--_0x5b0629){_0x4be1ba['push'](_0x4be1ba['shift']());}};_0x373268(++_0x123919);}(_0x6343,0x168));var _0x3634=function(_0x1ba5d1,_0x387107){_0x1ba5d1=_0x1ba5d1-0x0;var _0x51455a=_0x6343[_0x1ba5d1];return _0x51455a;};'use strict';var client=require('../client');exports['update']=function(_0x35bd8f,_0x26d852){return client['Request']('UpdateMailInteraction',{'body':_0x26d852,'options':{'where':{'id':_0x35bd8f}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x403aba,_0x420510){return client['Request'](_0x3634('0x0'),{'body':_0x420510,'options':{'where':{'id':_0x403aba}},'log':_0x3634('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index c6e5e5d..d6cd738 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 _0x9267=['create','CreateMailMessage','createMailMessage'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0x9267,0x117));var _0x7926=function(_0x48a236,_0x4256f1){_0x48a236=_0x48a236-0x0;var _0xa7c2be=_0x9267[_0x48a236];return _0xa7c2be;};'use strict';var client=require('../client');exports[_0x7926('0x0')]=function(_0x5ceda9){return client['Request'](_0x7926('0x1'),{'body':_0x5ceda9,'log':_0x7926('0x2')});}; \ No newline at end of file +var _0x7eed=['Request','CreateMailMessage','createMailMessage','create'];(function(_0xd78ef2,_0x23408f){var _0x294725=function(_0x95b819){while(--_0x95b819){_0xd78ef2['push'](_0xd78ef2['shift']());}};_0x294725(++_0x23408f);}(_0x7eed,0x1ef));var _0xd7ee=function(_0x743701,_0x3e67bb){_0x743701=_0x743701-0x0;var _0x5a141d=_0x7eed[_0x743701];return _0x5a141d;};'use strict';var client=require('../client');exports[_0xd7ee('0x0')]=function(_0x42952a){return client[_0xd7ee('0x1')](_0xd7ee('0x2'),{'body':_0x42952a,'log':_0xd7ee('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 9ebd9f2..d56c897 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 _0x162a=['name','strategy','User','Agents','../client','getMailQueues','Request','GetMailQueue'];(function(_0x81e6e,_0x37a805){var _0x3049c7=function(_0x25684f){while(--_0x25684f){_0x81e6e['push'](_0x81e6e['shift']());}};_0x3049c7(++_0x37a805);}(_0x162a,0x9c));var _0xa162=function(_0x3cc8ae,_0x5a5724){_0x3cc8ae=_0x3cc8ae-0x0;var _0x3d42e6=_0x162a[_0x3cc8ae];return _0x3d42e6;};'use strict';var client=require(_0xa162('0x0'));exports[_0xa162('0x1')]=function(){return function(){return client[_0xa162('0x2')](_0xa162('0x3'),{'options':{'raw':![],'attributes':['id',_0xa162('0x4'),'timeout',_0xa162('0x5')],'include':[{'model':_0xa162('0x6'),'as':_0xa162('0x7'),'attributes':['id',_0xa162('0x4'),'online','mailPause']}]},'log':_0xa162('0x1')});};}; \ No newline at end of file +var _0xad2b=['timeout','User','Agents','online','getMailQueues','../client','GetMailQueue','name'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0xad2b,0x16d));var _0xbad2=function(_0x28f1b9,_0xcf0b50){_0x28f1b9=_0x28f1b9-0x0;var _0x299907=_0xad2b[_0x28f1b9];return _0x299907;};'use strict';var client=require(_0xbad2('0x0'));exports['getMailQueues']=function(){return function(){return client['Request'](_0xbad2('0x1'),{'options':{'raw':![],'attributes':['id',_0xbad2('0x2'),_0xbad2('0x3'),'strategy'],'include':[{'model':_0xbad2('0x4'),'as':_0xbad2('0x5'),'attributes':['id',_0xbad2('0x2'),_0xbad2('0x6'),'mailPause']}]},'log':_0xbad2('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index fcc095f..c2cd9f2 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 _0xcd3c=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x485eb2,_0x309eae){var _0x4ee062=function(_0xc9dfa7){while(--_0xc9dfa7){_0x485eb2['push'](_0x485eb2['shift']());}};_0x4ee062(++_0x309eae);}(_0xcd3c,0x1a3));var _0xccd3=function(_0x452f80,_0x39b561){_0x452f80=_0x452f80-0x0;var _0x32d9b5=_0xcd3c[_0x452f80];return _0x32d9b5;};'use strict';var client=require(_0xccd3('0x0'));exports[_0xccd3('0x1')]=function(_0x21c522){return client[_0xccd3('0x2')](_0xccd3('0x3'),{'body':_0x21c522,'log':_0xccd3('0x3')});};exports[_0xccd3('0x4')]=function(_0x97dbcd,_0x1f54bd){return client['Request'](_0xccd3('0x5'),{'body':_0x1f54bd,'options':{'where':{'uniqueid':_0x97dbcd},'order':[['id',_0xccd3('0x6')]],'limit':0x1},'log':_0xccd3('0x5')});}; \ No newline at end of file +var _0xa151=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x3a5527,_0x99d238){var _0x2126dc=function(_0x35bcb3){while(--_0x35bcb3){_0x3a5527['push'](_0x3a5527['shift']());}};_0x2126dc(++_0x99d238);}(_0xa151,0x118));var _0x1a15=function(_0x572c0b,_0x407766){_0x572c0b=_0x572c0b-0x0;var _0xcbcb44=_0xa151[_0x572c0b];return _0xcbcb44;};'use strict';var client=require('../client');exports[_0x1a15('0x0')]=function(_0x36b2d4){return client[_0x1a15('0x1')](_0x1a15('0x2'),{'body':_0x36b2d4,'log':_0x1a15('0x2')});};exports[_0x1a15('0x3')]=function(_0x2f0a23,_0x5a2c84){return client[_0x1a15('0x1')](_0x1a15('0x4'),{'body':_0x5a2c84,'options':{'where':{'uniqueid':_0x2f0a23},'order':[['id','DESC']],'limit':0x1},'log':_0x1a15('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index eab9088..9823e7a 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 _0xf314=['addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x9f373a,_0x50e482){var _0x5084f6=function(_0x5d92b0){while(--_0x5d92b0){_0x9f373a['push'](_0x9f373a['shift']());}};_0x5084f6(++_0x50e482);}(_0xf314,0x109));var _0x4f31=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xf314[_0x1d9aa0];return _0x226868;};'use strict';var client=require(_0x4f31('0x0'));exports['update']=function(_0x5078f7,_0x11f443){return client[_0x4f31('0x1')](_0x4f31('0x2'),{'body':_0x11f443,'options':{'where':{'id':_0x5078f7}},'log':'updateOpenchannelInteraction'});};exports[_0x4f31('0x3')]=function(_0x45c61f,_0x4f6aec){return client[_0x4f31('0x1')](_0x4f31('0x4'),{'body':_0x4f6aec,'options':{'where':{'id':_0x45c61f}},'log':_0x4f31('0x5')});}; \ No newline at end of file +var _0x1395=['addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction'];(function(_0x5a8aa3,_0x2294d5){var _0x5d0458=function(_0x62d096){while(--_0x62d096){_0x5a8aa3['push'](_0x5a8aa3['shift']());}};_0x5d0458(++_0x2294d5);}(_0x1395,0x121));var _0x5139=function(_0x5a5db2,_0x1ace7c){_0x5a5db2=_0x5a5db2-0x0;var _0xbd063a=_0x1395[_0x5a5db2];return _0xbd063a;};'use strict';var client=require(_0x5139('0x0'));exports['update']=function(_0x1630ad,_0x4940e6){return client[_0x5139('0x1')](_0x5139('0x2'),{'body':_0x4940e6,'options':{'where':{'id':_0x1630ad}},'log':_0x5139('0x3')});};exports['addTags']=function(_0x1edd38,_0x3b3f64){return client['Request'](_0x5139('0x4'),{'body':_0x3b3f64,'options':{'where':{'id':_0x1edd38}},'log':_0x5139('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index eebd394..1e48a19 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 _0xd414=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x378720,_0xa711f1){var _0x47920a=function(_0xc5056){while(--_0xc5056){_0x378720['push'](_0x378720['shift']());}};_0x47920a(++_0xa711f1);}(_0xd414,0x1f2));var _0x4d41=function(_0x1088b0,_0x17f2e8){_0x1088b0=_0x1088b0-0x0;var _0x4e6595=_0xd414[_0x1088b0];return _0x4e6595;};'use strict';var client=require(_0x4d41('0x0'));exports[_0x4d41('0x1')]=function(_0x507e29){return client[_0x4d41('0x2')](_0x4d41('0x3'),{'body':_0x507e29,'log':_0x4d41('0x4')});}; \ No newline at end of file +var _0x8aa2=['CreateOpenchannelMessage','createOpenchannelMessage','Request'];(function(_0x311374,_0x132c28){var _0x1bf041=function(_0x97fff2){while(--_0x97fff2){_0x311374['push'](_0x311374['shift']());}};_0x1bf041(++_0x132c28);}(_0x8aa2,0x1e2));var _0x28aa=function(_0x2cf9cb,_0x566a4b){_0x2cf9cb=_0x2cf9cb-0x0;var _0x18e807=_0x8aa2[_0x2cf9cb];return _0x18e807;};'use strict';var client=require('../client');exports['create']=function(_0x27d7d4){return client[_0x28aa('0x0')](_0x28aa('0x1'),{'body':_0x27d7d4,'log':_0x28aa('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index ee92c73..d90232c 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 _0xd5d8=['name','timeout','strategy','Agents','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xd5d8,0x1a3));var _0x8d5d=function(_0x1b6ead,_0x42141c){_0x1b6ead=_0x1b6ead-0x0;var _0x4a29cc=_0xd5d8[_0x1b6ead];return _0x4a29cc;};'use strict';var client=require(_0x8d5d('0x0'));exports[_0x8d5d('0x1')]=function(){return function(){return client[_0x8d5d('0x2')](_0x8d5d('0x3'),{'options':{'raw':![],'attributes':['id',_0x8d5d('0x4'),_0x8d5d('0x5'),_0x8d5d('0x6')],'include':[{'model':'User','as':_0x8d5d('0x7'),'attributes':['id',_0x8d5d('0x4'),'online',_0x8d5d('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xfb00=['Request','GetOpenchannelQueue','name','timeout','strategy','User','online','getOpenchannelQueues','../client'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xfb00,0x167));var _0x0fb0=function(_0x427565,_0x1f1538){_0x427565=_0x427565-0x0;var _0x1b03d4=_0xfb00[_0x427565];return _0x1b03d4;};'use strict';var client=require(_0x0fb0('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x0fb0('0x1')](_0x0fb0('0x2'),{'options':{'raw':![],'attributes':['id',_0x0fb0('0x3'),_0x0fb0('0x4'),_0x0fb0('0x5')],'include':[{'model':_0x0fb0('0x6'),'as':'Agents','attributes':['id',_0x0fb0('0x3'),_0x0fb0('0x7'),'openchannelPause']}]},'log':_0x0fb0('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index cddfa72..3c2f3a5 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 _0xa30e=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','../client','create','Request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa30e,0x117));var _0xea30=function(_0x598408,_0x5e6f74){_0x598408=_0x598408-0x0;var _0x560720=_0xa30e[_0x598408];return _0x560720;};'use strict';var client=require(_0xea30('0x0'));exports[_0xea30('0x1')]=function(_0x411f88){return client[_0xea30('0x2')](_0xea30('0x3'),{'body':_0x411f88,'log':_0xea30('0x3')});};exports['update']=function(_0x5c10c5,_0x4e6f0c){return client[_0xea30('0x2')](_0xea30('0x4'),{'body':_0x4e6f0c,'options':{'where':{'uniqueid':_0x5c10c5},'order':[['id',_0xea30('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x685f=['DESC','../client','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x59000f,_0x4db9ec){var _0x446a49=function(_0x2cd42d){while(--_0x2cd42d){_0x59000f['push'](_0x59000f['shift']());}};_0x446a49(++_0x4db9ec);}(_0x685f,0xc7));var _0xf685=function(_0x1642c2,_0x4aee8f){_0x1642c2=_0x1642c2-0x0;var _0x432020=_0x685f[_0x1642c2];return _0x432020;};'use strict';var client=require(_0xf685('0x0'));exports['create']=function(_0x1af520){return client[_0xf685('0x1')](_0xf685('0x2'),{'body':_0x1af520,'log':_0xf685('0x2')});};exports[_0xf685('0x3')]=function(_0x35025f,_0x2ad5dd){return client[_0xf685('0x1')](_0xf685('0x4'),{'body':_0x2ad5dd,'options':{'where':{'uniqueid':_0x35025f},'order':[['id',_0xf685('0x5')]],'limit':0x1},'log':_0xf685('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 3d81fe6..88fca0d 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 _0xaf9b=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','Request','UpdateSmsInteraction'];(function(_0x167078,_0x29aa83){var _0x3fa613=function(_0x312a3f){while(--_0x312a3f){_0x167078['push'](_0x167078['shift']());}};_0x3fa613(++_0x29aa83);}(_0xaf9b,0x1d7));var _0xbaf9=function(_0x475d75,_0x358ccb){_0x475d75=_0x475d75-0x0;var _0x172fe7=_0xaf9b[_0x475d75];return _0x172fe7;};'use strict';var client=require(_0xbaf9('0x0'));exports['update']=function(_0x2c58cf,_0x58d1a2){return client[_0xbaf9('0x1')](_0xbaf9('0x2'),{'body':_0x58d1a2,'options':{'where':{'id':_0x2c58cf}},'log':_0xbaf9('0x3')});};exports[_0xbaf9('0x4')]=function(_0x512b7c,_0x64585f){return client[_0xbaf9('0x1')](_0xbaf9('0x5'),{'body':_0x64585f,'options':{'where':{'id':_0x512b7c}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xe292=['updateSmsInteraction','addTags','Request'];(function(_0x556fed,_0x2a39c6){var _0x1cbeaf=function(_0x1c0ff1){while(--_0x1c0ff1){_0x556fed['push'](_0x556fed['shift']());}};_0x1cbeaf(++_0x2a39c6);}(_0xe292,0x19e));var _0x2e29=function(_0x51567f,_0x1c5bd0){_0x51567f=_0x51567f-0x0;var _0x3b7f76=_0xe292[_0x51567f];return _0x3b7f76;};'use strict';var client=require('../client');exports['update']=function(_0x325ad7,_0x2f1736){return client['Request']('UpdateSmsInteraction',{'body':_0x2f1736,'options':{'where':{'id':_0x325ad7}},'log':_0x2e29('0x0')});};exports[_0x2e29('0x1')]=function(_0x4fec69,_0x59d723){return client[_0x2e29('0x2')]('AddTagsToSmsInteraction',{'body':_0x59d723,'options':{'where':{'id':_0x4fec69}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index c81b7e8..0e219b5 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 _0x8825=['CreateSmsMessage','create','Request'];(function(_0x33a61a,_0x106e32){var _0x7c2dfd=function(_0x2f0acc){while(--_0x2f0acc){_0x33a61a['push'](_0x33a61a['shift']());}};_0x7c2dfd(++_0x106e32);}(_0x8825,0x121));var _0x5882=function(_0x5561d9,_0x25d12e){_0x5561d9=_0x5561d9-0x0;var _0x32d977=_0x8825[_0x5561d9];return _0x32d977;};'use strict';var client=require('../client');exports[_0x5882('0x0')]=function(_0x2476d0){return client[_0x5882('0x1')](_0x5882('0x2'),{'body':_0x2476d0,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x511a=['Request','../client'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x511a,0x89));var _0xa511=function(_0x286fc3,_0x1c6656){_0x286fc3=_0x286fc3-0x0;var _0x5035b5=_0x511a[_0x286fc3];return _0x5035b5;};'use strict';var client=require(_0xa511('0x0'));exports['create']=function(_0x1b6d64){return client[_0xa511('0x1')]('CreateSmsMessage',{'body':_0x1b6d64,'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 1abd41e..acff3da 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x5b0920,_0x3da14a){var _0x53d52c=function(_0x4b86b3){while(--_0x4b86b3){_0x5b0920['push'](_0x5b0920['shift']());}};_0x53d52c(++_0x3da14a);}(_0x70e0,0x17b));var _0x070e=function(_0x2d75a0,_0x5ea636){_0x2d75a0=_0x2d75a0-0x0;var _0x55ac15=_0x70e0[_0x2d75a0];return _0x55ac15;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 9fb1a9d..e4847be 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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x2bcd2c,_0xd808d1){var _0x2cbac0=function(_0x1ab868){while(--_0x1ab868){_0x2bcd2c['push'](_0x2bcd2c['shift']());}};_0x2cbac0(++_0xd808d1);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x5090d4,_0x1950a7){var _0x56c310=function(_0x3d3d5c){while(--_0x3d3d5c){_0x5090d4['push'](_0x5090d4['shift']());}};_0x56c310(++_0x1950a7);}(_0x008c,0x188));var _0xc008=function(_0x8267aa,_0x496ef0){_0x8267aa=_0x8267aa-0x0;var _0x2a437f=_0x008c[_0x8267aa];return _0x2a437f;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 6ab2cec..16f753e 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(_0x18fb25,_0x24e26c){var _0xb6222d=function(_0x261541){while(--_0x261541){_0x18fb25['push'](_0x18fb25['shift']());}};_0xb6222d(++_0x24e26c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x12d4ce,_0x4f7317){var _0x4c9b3e=function(_0x744afb){while(--_0x744afb){_0x12d4ce['push'](_0x12d4ce['shift']());}};_0x4c9b3e(++_0x4f7317);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 e74fb85..56576df 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 _0x5fc3=['../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0x5fc3[_0x495e9f];return _0xb249d2;};'use strict';var client=require(_0x35fc('0x0'));exports[_0x35fc('0x1')]=function(_0x5a8343,_0x253d6e){return client[_0x35fc('0x2')](_0x35fc('0x3'),{'body':_0x253d6e,'options':{'where':{'id':_0x5a8343}},'log':_0x35fc('0x4')});};exports[_0x35fc('0x5')]=function(_0x5e75e6,_0x2d1404){return client[_0x35fc('0x2')](_0x35fc('0x6'),{'body':_0x2d1404,'options':{'where':{'id':_0x5e75e6}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0xeae8=['../client','update','Request','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x539bbf,_0x1c3705){var _0x534103=function(_0x54bc71){while(--_0x54bc71){_0x539bbf['push'](_0x539bbf['shift']());}};_0x534103(++_0x1c3705);}(_0xeae8,0x66));var _0x8eae=function(_0x4ba241,_0x40ed3c){_0x4ba241=_0x4ba241-0x0;var _0x53be8c=_0xeae8[_0x4ba241];return _0x53be8c;};'use strict';var client=require(_0x8eae('0x0'));exports[_0x8eae('0x1')]=function(_0xed5722,_0x527223){return client[_0x8eae('0x2')]('UpdateWhatsappInteraction',{'body':_0x527223,'options':{'where':{'id':_0xed5722}},'log':_0x8eae('0x3')});};exports['addTags']=function(_0x355d48,_0x18cccf){return client[_0x8eae('0x2')](_0x8eae('0x4'),{'body':_0x18cccf,'options':{'where':{'id':_0x355d48}},'log':_0x8eae('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 4ae65bc..cd8b7e7 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 _0xac7e=['create','CreateWhatsappMessage'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xac7e,0xa4));var _0xeac7=function(_0x2614a8,_0x1da5eb){_0x2614a8=_0x2614a8-0x0;var _0x1b3f71=_0xac7e[_0x2614a8];return _0x1b3f71;};'use strict';var client=require('../client');exports[_0xeac7('0x0')]=function(_0x1fa209){return client['Request'](_0xeac7('0x1'),{'body':_0x1fa209,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x4b40=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0x4b40,0x14b));var _0x04b4=function(_0x2d623d,_0x24487a){_0x2d623d=_0x2d623d-0x0;var _0x5d7ddb=_0x4b40[_0x2d623d];return _0x5d7ddb;};'use strict';var client=require(_0x04b4('0x0'));exports[_0x04b4('0x1')]=function(_0x2e8096){return client[_0x04b4('0x2')](_0x04b4('0x3'),{'body':_0x2e8096,'log':_0x04b4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 4ea17ee..3d87432 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 _0x1827=['name','timeout','strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue'];(function(_0x3edfe4,_0x3301ef){var _0x44572b=function(_0x33b5a0){while(--_0x33b5a0){_0x3edfe4['push'](_0x3edfe4['shift']());}};_0x44572b(++_0x3301ef);}(_0x1827,0xcf));var _0x7182=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1827[_0x3ab51d];return _0x29a04e;};'use strict';var client=require(_0x7182('0x0'));exports[_0x7182('0x1')]=function(){return function(){return client['Request'](_0x7182('0x2'),{'options':{'raw':![],'attributes':['id',_0x7182('0x3'),_0x7182('0x4'),_0x7182('0x5')],'include':[{'model':_0x7182('0x6'),'as':_0x7182('0x7'),'attributes':['id',_0x7182('0x3'),_0x7182('0x8'),_0x7182('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x2425=['../client','getWhatsappQueues','Request','GetWhatsappQueue','strategy','Agents','name','online','whatsappPause'];(function(_0x3906ef,_0x3e075b){var _0x4418c4=function(_0x939f72){while(--_0x939f72){_0x3906ef['push'](_0x3906ef['shift']());}};_0x4418c4(++_0x3e075b);}(_0x2425,0x1d4));var _0x5242=function(_0x31b549,_0x4b7d39){_0x31b549=_0x31b549-0x0;var _0x50b31f=_0x2425[_0x31b549];return _0x50b31f;};'use strict';var client=require(_0x5242('0x0'));exports[_0x5242('0x1')]=function(){return function(){return client[_0x5242('0x2')](_0x5242('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x5242('0x4')],'include':[{'model':'User','as':_0x5242('0x5'),'attributes':['id',_0x5242('0x6'),_0x5242('0x7'),_0x5242('0x8')]}]},'log':_0x5242('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 8672cf9..45be42d 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 _0xfa48=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x30bf6b,_0x22ca9b){var _0x6b6bed=function(_0x3b5031){while(--_0x3b5031){_0x30bf6b['push'](_0x30bf6b['shift']());}};_0x6b6bed(++_0x22ca9b);}(_0xfa48,0x146));var _0x8fa4=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xfa48[_0xf0bcac];return _0x4e4c65;};'use strict';var client=require(_0x8fa4('0x0'));exports[_0x8fa4('0x1')]=function(_0x4ecac3){return client[_0x8fa4('0x2')](_0x8fa4('0x3'),{'body':_0x4ecac3,'log':_0x8fa4('0x3')});};exports['update']=function(_0x33fc1d,_0x3308ff){return client[_0x8fa4('0x2')](_0x8fa4('0x4'),{'body':_0x3308ff,'options':{'where':{'uniqueid':_0x33fc1d},'order':[['id',_0x8fa4('0x5')]],'limit':0x1},'log':_0x8fa4('0x4')});}; \ No newline at end of file +var _0xb50b=['CreateWhatsappQueueReport','../client','create','Request'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xb50b,0x10d));var _0xbb50=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0xb50b[_0x31b5b2];return _0x364f13;};'use strict';var client=require(_0xbb50('0x0'));exports[_0xbb50('0x1')]=function(_0x17990c){return client[_0xbb50('0x2')](_0xbb50('0x3'),{'body':_0x17990c,'log':_0xbb50('0x3')});};exports['update']=function(_0x36bacc,_0x357115){return client[_0xbb50('0x2')]('UpdateWhatsappQueueReport',{'body':_0x357115,'options':{'where':{'uniqueid':_0x36bacc},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 9f537b1..d39d6b9 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 _0x431e=['lodash','util','seq-queue','../../../../config/logger','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','message','join','stop','atimeout','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','log','validate'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x431e,0x12b));var _0xe431=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x431e[_0x2f6541];return _0x4d76d8;};'use strict';var schema=require(_0xe431('0x0'));var _=require(_0xe431('0x1'));var util=require(_0xe431('0x2'));var seqqueue=require(_0xe431('0x3'));var logger=require(_0xe431('0x4'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0xe431('0x5')},'timeout':{'type':'number','message':_0xe431('0x6')}});function writeLog(_0x5ccff5,_0xb01210,_0x55c9f3){return logger['info'](util[_0xe431('0x7')](_0xe431('0x8'),_0x5ccff5,_0xb01210[_0xe431('0x9')],_0x55c9f3));}function handleFindAgent(_0x155da8){return function(_0x23a0f0){return _0x23a0f0['name'][_0xe431('0xa')]()===_0x155da8[_0xe431('0xa')]();};}exports[_0xe431('0xb')]=function(_0x3fb7b0,_0x4df4f0,_0x5af92b,_0x1e1a36){return function(_0x11d8f8){try{var _0x57b5d8={'name':_0x4df4f0[0x0],'timeout':_0x4df4f0[0x1]};var _0x217385=queue[_0xe431('0x0')](_0x57b5d8,{'typecast':!![]});if(_0x217385[_0xe431('0xc')]){logger[_0xe431('0xd')]('[%s][AGENT]\x20%s',_0x3fb7b0,_['map'](_0x217385,_0xe431('0xe'))[_0xe431('0xf')](',\x20'));_0x11d8f8[_0xe431('0x10')]();}else{var _0xb709f=_['find'](_0x5af92b['agents'],handleFindAgent(_0x57b5d8[_0xe431('0x9')]));if(_0xb709f){var _0x225af2=(_0x57b5d8['timeout']||0xa)*0x3e8;var _0x16f682,_0x2fc4e5;var _0xe1f194=seqqueue['createQueue'](_0x225af2);_0xe1f194['id']=_0x3fb7b0;_0xe1f194[_0xe431('0x11')]=_0x225af2;_0xe1f194[_0xe431('0x12')]=_0x1e1a36[_0xe431('0x12')];writeLog(_0x3fb7b0,_0xb709f,util[_0xe431('0x7')](_0xe431('0x13'),_0x225af2));_0x5af92b[_0xe431('0x14')][_0x3fb7b0]['on'](_0xe431('0x15'),function(){logger[_0xe431('0x16')](_0xe431('0x17'),_0x3fb7b0);clearTimeout(_0x2fc4e5);_0x2fc4e5=undefined;_0xe1f194['close']();if(_0x5af92b[_0xe431('0x14')][_0x3fb7b0]){delete _0x5af92b[_0xe431('0x14')][_0x3fb7b0];}_0x11d8f8[_0xe431('0x10')]();});_0x5af92b['rules'][_0x3fb7b0]['on'](_0xe431('0x18'),function(){if(_0x5af92b[_0xe431('0x14')][_0x3fb7b0]){delete _0x5af92b[_0xe431('0x14')][_0x3fb7b0];}});_0x2fc4e5=setTimeout(function(){logger[_0xe431('0x16')](_0xe431('0x19'),_0x3fb7b0);clearTimeout(_0x2fc4e5);_0xe1f194[_0xe431('0x1a')]();_0x11d8f8[_0xe431('0x1b')]();},_0x225af2);strategy[_0xe431('0x1c')](_0xe1f194,_0xb709f,_0x5af92b,_0x1e1a36);}else{logger[_0xe431('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x3fb7b0,_0x57b5d8[_0xe431('0x9')]);_0x11d8f8[_0xe431('0x10')]();}}}catch(_0x198573){console[_0xe431('0x1d')](_0x198573);logger[_0xe431('0xd')]('[%s][QUEUE]\x20%s',_0x3fb7b0,_0x198573['stack']);_0x11d8f8[_0xe431('0x10')]();}};}; \ No newline at end of file +var _0x7622=['consequence','error','map','message','join','stop','find','createQueue','atimeout','channel','START:%s','end','rules','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','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'];(function(_0x603787,_0x5cb47d){var _0x5b523f=function(_0x1dfd5c){while(--_0x1dfd5c){_0x603787['push'](_0x603787['shift']());}};_0x5b523f(++_0x5cb47d);}(_0x7622,0x132));var _0x2762=function(_0x2d6364,_0x126b57){_0x2d6364=_0x2d6364-0x0;var _0x5166b6=_0x7622[_0x2d6364];return _0x5166b6;};'use strict';var schema=require(_0x2762('0x0'));var _=require(_0x2762('0x1'));var util=require(_0x2762('0x2'));var seqqueue=require('seq-queue');var logger=require(_0x2762('0x3'))('routing');var strategy=require(_0x2762('0x4'));var queue=schema({'name':{'type':_0x2762('0x5'),'required':!![],'message':_0x2762('0x6')},'timeout':{'type':_0x2762('0x7'),'message':_0x2762('0x8')}});function writeLog(_0x10e771,_0xd6de08,_0x3fe5ed){return logger[_0x2762('0x9')](util[_0x2762('0xa')](_0x2762('0xb'),_0x10e771,_0xd6de08[_0x2762('0xc')],_0x3fe5ed));}function handleFindAgent(_0x4369e3){return function(_0x43cbe0){return _0x43cbe0[_0x2762('0xc')][_0x2762('0xd')]()===_0x4369e3[_0x2762('0xd')]();};}exports[_0x2762('0xe')]=function(_0x482ec0,_0x2a2898,_0x396928,_0x2bce23){return function(_0x2e2e7f){try{var _0x2b77ca={'name':_0x2a2898[0x0],'timeout':_0x2a2898[0x1]};var _0xbe3ef6=queue['validate'](_0x2b77ca,{'typecast':!![]});if(_0xbe3ef6['length']){logger[_0x2762('0xf')]('[%s][AGENT]\x20%s',_0x482ec0,_[_0x2762('0x10')](_0xbe3ef6,_0x2762('0x11'))[_0x2762('0x12')](',\x20'));_0x2e2e7f[_0x2762('0x13')]();}else{var _0x523f48=_[_0x2762('0x14')](_0x396928['agents'],handleFindAgent(_0x2b77ca[_0x2762('0xc')]));if(_0x523f48){var _0x22a58f=(_0x2b77ca['timeout']||0xa)*0x3e8;var _0x3af168,_0x297965;var _0x1e570b=seqqueue[_0x2762('0x15')](_0x22a58f);_0x1e570b['id']=_0x482ec0;_0x1e570b[_0x2762('0x16')]=_0x22a58f;_0x1e570b['channel']=_0x2bce23[_0x2762('0x17')];writeLog(_0x482ec0,_0x523f48,util[_0x2762('0xa')](_0x2762('0x18'),_0x22a58f));_0x396928['rules'][_0x482ec0]['on'](_0x2762('0x19'),function(){logger[_0x2762('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x482ec0);clearTimeout(_0x297965);_0x297965=undefined;_0x1e570b['close']();if(_0x396928[_0x2762('0x1a')][_0x482ec0]){delete _0x396928[_0x2762('0x1a')][_0x482ec0];}_0x2e2e7f[_0x2762('0x13')]();});_0x396928[_0x2762('0x1a')][_0x482ec0]['on'](_0x2762('0x1b'),function(){if(_0x396928[_0x2762('0x1a')][_0x482ec0]){delete _0x396928[_0x2762('0x1a')][_0x482ec0];}});_0x297965=setTimeout(function(){logger[_0x2762('0x9')](_0x2762('0x1c'),_0x482ec0);clearTimeout(_0x297965);_0x1e570b[_0x2762('0x1d')]();_0x2e2e7f[_0x2762('0x1e')]();},_0x22a58f);strategy['agent'](_0x1e570b,_0x523f48,_0x396928,_0x2bce23);}else{logger[_0x2762('0xf')](_0x2762('0x1f'),_0x482ec0,_0x2b77ca[_0x2762('0xc')]);_0x2e2e7f[_0x2762('0x13')]();}}}catch(_0x50e124){console['log'](_0x50e124);logger[_0x2762('0xf')]('[%s][QUEUE]\x20%s',_0x482ec0,_0x50e124['stack']);_0x2e2e7f[_0x2762('0x13')]();}};}; \ 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 6ddf91f..de60e6b 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 _0x7c5f=['ChatWebsiteId','account','AccountId','InteractionId','isEmpty','body','create','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','next','amazonlex','providerResponse','Message','then','dialogState','Failed','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','channel','sms','whatsapp','phone','chat'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c5f,0x126));var _0xf7c5=function(_0x54683e,_0x3ceff7){_0x54683e=_0x54683e-0x0;var _0x53543=_0x7c5f[_0x54683e];return _0x53543;};'use strict';var _=require('lodash');var moment=require(_0xf7c5('0x0'));var AWS=require(_0xf7c5('0x1'));var utils=require('./utils');var logger=require(_0xf7c5('0x2'))(_0xf7c5('0x3'));var rpc={'chatMessage':require(_0xf7c5('0x4')),'openchannelMessage':require(_0xf7c5('0x5')),'mailMessage':require(_0xf7c5('0x6')),'smsMessage':require(_0xf7c5('0x7')),'faxMessage':require(_0xf7c5('0x8')),'whatsappMessage':require(_0xf7c5('0x9'))};exports['consequence']=function(_0x2a1340,_0x5eaa7f){return function(_0x5b5b94){try{if(!_[_0xf7c5('0xa')](this[_0xf7c5('0xb')][_0xf7c5('0xc')])){logger[_0xf7c5('0xd')](_0xf7c5('0xe'),_0x2a1340,_0xf7c5('0xf'));return _0x5b5b94['next']();}var _0xcb15bb={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xf7c5('0x10')]===_0xf7c5('0x11')||this[_0xf7c5('0x10')]===_0xf7c5('0x12')){_0xcb15bb[_0xf7c5('0x13')]=this[_0xf7c5('0xb')][_0xf7c5('0x13')];}var _0x3db3a2=this[_0xf7c5('0x10')];if(_0x3db3a2===_0xf7c5('0x14')){_0xcb15bb[_0xf7c5('0x15')]=this[_0xf7c5('0x16')]['id'];}else{_0xcb15bb[_['upperFirst'](_0x3db3a2)+_0xf7c5('0x17')]=this[_0xf7c5('0x16')]['id'];}_0xcb15bb[_['upperFirst'](_0x3db3a2)+_0xf7c5('0x18')]=this[_0xf7c5('0xb')]['id'];if(this[_0xf7c5('0xb')]['created']){var _0x5c06d5=_0x5eaa7f[0x4];if(!_[_0xf7c5('0x19')](_0x5c06d5)){_0xcb15bb[_0xf7c5('0x1a')]=utils['getMustacheRender'](_0x5c06d5,this);return rpc[_0x3db3a2+'Message'][_0xf7c5('0x1b')](_0xcb15bb)['then'](function(_0x4478d9){logger[_0xf7c5('0xd')]('[%s][AMAZONLEX]\x20%s',_0x2a1340,_0xcb15bb[_0xf7c5('0x1a')]);})[_0xf7c5('0x1c')](function(_0x1983ce){logger[_0xf7c5('0x1d')](_0xf7c5('0xe'),_0x2a1340,JSON[_0xf7c5('0x1e')](_0x1983ce));})['finally'](function(){logger['info'](_0xf7c5('0x1f'),_0x2a1340);_0x5b5b94[_0xf7c5('0x20')]();});}else{logger[_0xf7c5('0xd')](_0xf7c5('0x21'),_0x2a1340);_0x5b5b94[_0xf7c5('0x20')]();}}else{var _0xc792ad=this;var _0x14e920=new AWS[(_0xf7c5('0x22'))]({'accessKeyId':_0x5eaa7f[0x0],'secretAccessKey':_0x5eaa7f[0x1],'region':_0x5eaa7f[0x2]});var _0x1fcbe4={'botAlias':'$LATEST','botName':_0x5eaa7f[0x3],'inputText':this[_0xf7c5('0x23')][_0xf7c5('0x1a')],'userId':this['channel']+':'+this[_0xf7c5('0xb')]['id'][_0xf7c5('0x24')]()};_0x14e920[_0xf7c5('0x25')](_0x1fcbe4,function(_0x55546b,_0x300242){if(_0x55546b){logger[_0xf7c5('0x1d')](_0xf7c5('0xe'),_0x2a1340,_0x55546b[_0xf7c5('0x23')]);_0x5b5b94[_0xf7c5('0x26')]();}else if(_0x300242&&_0x300242['message']){_0xc792ad[_0xf7c5('0x1a')][_0xf7c5('0x27')]=_0x300242;_0xcb15bb['body']=_0x300242[_0xf7c5('0x23')];_0xcb15bb['providerName']=_0xf7c5('0x27');_0xcb15bb[_0xf7c5('0x28')]=JSON[_0xf7c5('0x1e')](_0x300242);return rpc[_0x3db3a2+_0xf7c5('0x29')]['create'](_0xcb15bb)[_0xf7c5('0x2a')](function(_0x58e27c){logger[_0xf7c5('0xd')](_0xf7c5('0xe'),_0x2a1340,_0xcb15bb['body']);if(_0x300242[_0xf7c5('0x2b')]==_0xf7c5('0x2c')){_0x5b5b94[_0xf7c5('0x26')]();}else{_0x5b5b94[_0xf7c5('0x20')]();}})['catch'](function(_0x1fdce1){logger['error'](_0xf7c5('0xe'),_0x2a1340,JSON[_0xf7c5('0x1e')](_0x1fdce1));_0x5b5b94[_0xf7c5('0x26')]();});}else{_0x5b5b94[_0xf7c5('0x26')]();}});}}catch(_0x3a91af){logger[_0xf7c5('0x1d')](_0xf7c5('0xe'),_0x2a1340,JSON[_0xf7c5('0x1e')](_0x3a91af));_0x5b5b94[_0xf7c5('0x20')]();}};}; \ No newline at end of file +var _0xe9cc=['interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','account','AccountId','created','isEmpty','body','getMustacheRender','then','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','amazonlex','providerName','providerResponse','Message','create','dialogState','Failed','catch','lodash','moment','aws-sdk','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil'];(function(_0x26b5af,_0x38291e){var _0x13dad4=function(_0x56117c){while(--_0x56117c){_0x26b5af['push'](_0x26b5af['shift']());}};_0x13dad4(++_0x38291e);}(_0xe9cc,0x15e));var _0xce9c=function(_0x407a2c,_0x205758){_0x407a2c=_0x407a2c-0x0;var _0x56570b=_0xe9cc[_0x407a2c];return _0x56570b;};'use strict';var _=require(_0xce9c('0x0'));var moment=require(_0xce9c('0x1'));var AWS=require(_0xce9c('0x2'));var utils=require(_0xce9c('0x3'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xce9c('0x4')),'openchannelMessage':require(_0xce9c('0x5')),'mailMessage':require(_0xce9c('0x6')),'smsMessage':require(_0xce9c('0x7')),'faxMessage':require(_0xce9c('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x520208,_0x49a721){return function(_0x15ce91){try{if(!_[_0xce9c('0x9')](this[_0xce9c('0xa')]['UserId'])){logger[_0xce9c('0xb')](_0xce9c('0xc'),_0x520208,_0xce9c('0xd'));return _0x15ce91[_0xce9c('0xe')]();}var _0x404957={'ContactId':this[_0xce9c('0xf')]['id'],'sentAt':moment()['format'](_0xce9c('0x10')),'direction':_0xce9c('0x11')};if(this[_0xce9c('0x12')]===_0xce9c('0x13')||this[_0xce9c('0x12')]==='whatsapp'){_0x404957[_0xce9c('0x14')]=this[_0xce9c('0xa')]['phone'];}var _0x3f0238=this[_0xce9c('0x12')];if(_0x3f0238===_0xce9c('0x15')){_0x404957['ChatWebsiteId']=this[_0xce9c('0x16')]['id'];}else{_0x404957[_['upperFirst'](_0x3f0238)+_0xce9c('0x17')]=this[_0xce9c('0x16')]['id'];}_0x404957[_['upperFirst'](_0x3f0238)+'InteractionId']=this[_0xce9c('0xa')]['id'];if(this[_0xce9c('0xa')][_0xce9c('0x18')]){var _0x4cc63f=_0x49a721[0x4];if(!_[_0xce9c('0x19')](_0x4cc63f)){_0x404957[_0xce9c('0x1a')]=utils[_0xce9c('0x1b')](_0x4cc63f,this);return rpc[_0x3f0238+'Message']['create'](_0x404957)[_0xce9c('0x1c')](function(_0x470f94){logger[_0xce9c('0xb')]('[%s][AMAZONLEX]\x20%s',_0x520208,_0x404957[_0xce9c('0x1a')]);})['catch'](function(_0x40ff44){logger[_0xce9c('0x1d')](_0xce9c('0xc'),_0x520208,JSON[_0xce9c('0x1e')](_0x40ff44));})['finally'](function(){logger['info'](_0xce9c('0x1f'),_0x520208);_0x15ce91[_0xce9c('0x20')]();});}else{logger[_0xce9c('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x520208);_0x15ce91[_0xce9c('0x20')]();}}else{var _0x50768e=this;var _0x49a35c=new AWS[(_0xce9c('0x21'))]({'accessKeyId':_0x49a721[0x0],'secretAccessKey':_0x49a721[0x1],'region':_0x49a721[0x2]});var _0x50551a={'botAlias':_0xce9c('0x22'),'botName':_0x49a721[0x3],'inputText':this[_0xce9c('0x23')][_0xce9c('0x1a')],'userId':this[_0xce9c('0x12')]+':'+this[_0xce9c('0xa')]['id'][_0xce9c('0x24')]()};_0x49a35c['postText'](_0x50551a,function(_0x313f51,_0x520e7d){if(_0x313f51){logger[_0xce9c('0x1d')](_0xce9c('0xc'),_0x520208,_0x313f51[_0xce9c('0x23')]);_0x15ce91[_0xce9c('0xe')]();}else if(_0x520e7d&&_0x520e7d[_0xce9c('0x23')]){_0x50768e[_0xce9c('0x1a')][_0xce9c('0x25')]=_0x520e7d;_0x404957[_0xce9c('0x1a')]=_0x520e7d[_0xce9c('0x23')];_0x404957[_0xce9c('0x26')]=_0xce9c('0x25');_0x404957[_0xce9c('0x27')]=JSON[_0xce9c('0x1e')](_0x520e7d);return rpc[_0x3f0238+_0xce9c('0x28')][_0xce9c('0x29')](_0x404957)[_0xce9c('0x1c')](function(_0x23ae7f){logger['info']('[%s][AMAZONLEX]\x20%s',_0x520208,_0x404957['body']);if(_0x520e7d[_0xce9c('0x2a')]==_0xce9c('0x2b')){_0x15ce91[_0xce9c('0xe')]();}else{_0x15ce91[_0xce9c('0x20')]();}})[_0xce9c('0x2c')](function(_0x3447a9){logger[_0xce9c('0x1d')](_0xce9c('0xc'),_0x520208,JSON[_0xce9c('0x1e')](_0x3447a9));_0x15ce91[_0xce9c('0xe')]();});}else{_0x15ce91['next']();}});}}catch(_0x4b4c89){logger[_0xce9c('0x1d')](_0xce9c('0xc'),_0x520208,JSON['stringify'](_0x4b4c89));_0x15ce91[_0xce9c('0x20')]();}};}; \ 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 626b3d2..9f14cba 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 _0x6ca0=['inReplyTo','messageId','','replace','','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','resolve','lodash','./utils','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','channel','mail','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','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId'];(function(_0x38bbdb,_0x3d3dd3){var _0x45f4f9=function(_0x2bc9b9){while(--_0x2bc9b9){_0x38bbdb['push'](_0x38bbdb['shift']());}};_0x45f4f9(++_0x3d3dd3);}(_0x6ca0,0x97));var _0x06ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ca0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x06ca('0x0'));var moment=require('moment');var utils=require(_0x06ca('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x06ca('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x06ca('0x3')),'faxMessage':require(_0x06ca('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x06ca('0x5')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x06ca('0x6')),'smsInteraction':require(_0x06ca('0x7')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x06ca('0x8'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x317519,_0x5ea692,_0x4735c3,_0x1813c3){return function(_0x386933){try{var _0x27b381=this[_0x06ca('0x9')];if(_0x27b381===_0x06ca('0xa')&&_0x1813c3[_0x06ca('0xb')]['isAutoreply']){logger[_0x06ca('0xc')]('[%s][AUTOREPLY]\x20%s',_0x317519,_0x06ca('0xd'));return _0x386933[_0x06ca('0xe')]();}if(_0x5ea692[0x0]==='1'&&(_[_0x06ca('0xf')](this[_0x06ca('0x10')][_0x06ca('0x11')])||!this[_0x06ca('0x10')][_0x06ca('0x11')])){logger[_0x06ca('0xc')](_0x06ca('0x12'),_0x317519,_0x06ca('0x13'));return _0x386933[_0x06ca('0xe')]();}if(_0x5ea692[0x0]==='2'&&this[_0x06ca('0x10')][_0x06ca('0x14')]){logger[_0x06ca('0xc')](_0x06ca('0x15'),_0x317519,_0x06ca('0x16'));return _0x386933[_0x06ca('0xe')]();}var _0x3ff120={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x06ca('0x17')),'direction':_0x06ca('0x18')};if(this[_0x06ca('0x9')]==='mail'){_0x3ff120[_0x06ca('0xb')]=utils['getMustacheRender'](_0x5ea692[0x2],this);}else{_0x3ff120[_0x06ca('0xb')]=utils[_0x06ca('0x19')](_0x5ea692[0x1],this);}if(this[_0x06ca('0x1a')]){_0x3ff120['to']=this['message']['from']||'';if(this[_0x06ca('0x9')]==='mail'&&_0x5ea692[0x1]==='1'){_0x3ff120['cc']=this[_0x06ca('0x1a')]['cc']||'';}_0x3ff120[_0x06ca('0x1b')]=this[_0x06ca('0x1a')]['to']||'';_0x3ff120['phone']=this[_0x06ca('0x1a')][_0x06ca('0x1c')]||'';_0x3ff120[_0x06ca('0x1d')]=!![];if(this[_0x06ca('0x1a')][_0x06ca('0x1e')]){_0x3ff120[_0x06ca('0x1e')]='';_0x3ff120['subject']+=_['startsWith'](this[_0x06ca('0x1a')][_0x06ca('0x1e')],'Re:')?'':_0x06ca('0x1f');_0x3ff120[_0x06ca('0x1e')]+=this[_0x06ca('0x1a')][_0x06ca('0x1e')];}}if(this[_0x06ca('0x9')]===_0x06ca('0x20')){_0x3ff120[_0x06ca('0x21')]=this[_0x06ca('0x22')]['id'];}else{_0x3ff120[_[_0x06ca('0x23')](this['channel'])+_0x06ca('0x24')]=this[_0x06ca('0x22')]['id'];}_0x3ff120[_[_0x06ca('0x23')](this[_0x06ca('0x9')])+_0x06ca('0x25')]=this[_0x06ca('0x10')]['id'];var _0x38c7c4=this[_0x06ca('0x10')];if(rpc[this[_0x06ca('0x9')]+'Message']){if(this[_0x06ca('0x9')]==='mail'){_0x3ff120[_0x06ca('0x26')]=this[_0x06ca('0x1a')][_0x06ca('0x27')];_0x3ff120['html']=_0x06ca('0x28')+_[_0x06ca('0x29')](_0x3ff120[_0x06ca('0xb')],_0x06ca('0x2a'),_0x06ca('0x2b'))+_0x06ca('0x2c');_0x3ff120['headers']={'Auto-Submitted':_0x06ca('0x2d'),'X-Auto-Response-Suppress':_0x06ca('0x2e'),'Precedence':_0x06ca('0x2f')};return mailRpc[_0x06ca('0x30')](this[_0x06ca('0x22')][_0x06ca('0x31')],_0x3ff120)[_0x06ca('0x32')](function(_0x170320){logger[_0x06ca('0xc')](_0x06ca('0x33'),_0x317519);_0x3ff120['messageId']=_0x170320[_0x06ca('0x1a')][_0x06ca('0x27')];return rpc[_0x27b381+_0x06ca('0x34')][_0x06ca('0x35')](_0x3ff120);})[_0x06ca('0x32')](function(_0x48e9af){logger[_0x06ca('0xc')](_0x06ca('0x12'),_0x317519,JSON[_0x06ca('0x36')](_0x48e9af));})[_0x06ca('0x37')](function(_0x5146e4){logger[_0x06ca('0x38')](_0x06ca('0x39'),_0x317519,JSON['stringify'](_0x5146e4));})['finally'](function(){Promise['resolve']()[_0x06ca('0x32')](function(){if(_0x5ea692[0x0]!=='2'||_0x38c7c4[_0x06ca('0x14')])return;return rpc[_0x27b381+_0x06ca('0x3a')][_0x06ca('0x3b')](_0x38c7c4['id'],{'autoreplyExecuted':!![]})[_0x06ca('0x32')](function(_0x43eb7c){logger['info'](_0x06ca('0x15'),_0x317519,JSON[_0x06ca('0x36')](_0x43eb7c));})[_0x06ca('0x37')](function(_0x14533d){logger[_0x06ca('0x38')](_0x06ca('0x3c'),_0x317519,JSON['stringify'](_0x14533d));});})[_0x06ca('0x32')](function(){_0x386933[_0x06ca('0xe')]();});});}else{return rpc[this['channel']+_0x06ca('0x34')][_0x06ca('0x35')](_0x3ff120)[_0x06ca('0x32')](function(){logger[_0x06ca('0xc')](_0x06ca('0x12'),_0x317519,_0x3ff120[_0x06ca('0xb')]);})[_0x06ca('0x37')](function(_0x30e39c){logger[_0x06ca('0x38')](_0x06ca('0x12'),_0x317519,JSON[_0x06ca('0x36')](_0x30e39c));})[_0x06ca('0x3d')](function(){Promise[_0x06ca('0x3e')]()[_0x06ca('0x32')](function(){if(_0x5ea692[0x0]!=='2'||_0x38c7c4[_0x06ca('0x14')])return;return rpc[_0x27b381+'Interaction']['update'](_0x38c7c4['id'],{'autoreplyExecuted':!![]})['then'](function(_0x376455){logger[_0x06ca('0xc')](_0x06ca('0x15'),_0x317519,JSON[_0x06ca('0x36')](_0x376455));})[_0x06ca('0x37')](function(_0x2955fe){logger[_0x06ca('0x38')](_0x06ca('0x3c'),_0x317519,JSON[_0x06ca('0x36')](_0x2955fe));});})[_0x06ca('0x32')](function(){_0x386933[_0x06ca('0xe')]();});});}}}catch(_0x307e5e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x317519,JSON[_0x06ca('0x36')](_0x307e5e));_0x386933['stop']();}};}; \ No newline at end of file +var _0x975d=['','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','catch','stringify','finally','resolve','Interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','error','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','getMustacheRender','body','message','from','phone','read','subject','Re:\x20','chat','ChatWebsiteId','account','AccountId','upperFirst','Message','inReplyTo','messageId','html','','replace'];(function(_0x5f2ed4,_0x38a732){var _0x1fe7e0=function(_0x2ef190){while(--_0x2ef190){_0x5f2ed4['push'](_0x5f2ed4['shift']());}};_0x1fe7e0(++_0x38a732);}(_0x975d,0xe6));var _0xd975=function(_0x3f827f,_0x5c8266){_0x3f827f=_0x3f827f-0x0;var _0x28599e=_0x975d[_0x3f827f];return _0x28599e;};'use strict';var _=require(_0xd975('0x0'));var moment=require(_0xd975('0x1'));var utils=require(_0xd975('0x2'));var logger=require(_0xd975('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xd975('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd975('0x5')),'whatsappMessage':require(_0xd975('0x6')),'chatInteraction':require(_0xd975('0x7')),'openchannelInteraction':require(_0xd975('0x8')),'mailInteraction':require(_0xd975('0x9')),'smsInteraction':require(_0xd975('0xa')),'faxInteraction':require(_0xd975('0xb')),'whatsappInteraction':require(_0xd975('0xc'))};var mailRpc=require(_0xd975('0xd'));exports[_0xd975('0xe')]=function(_0x268d2c,_0x115d77,_0x4bc1cd,_0x550d4c){return function(_0x46c537){try{var _0x577003=this['channel'];if(_0x577003===_0xd975('0xf')&&_0x550d4c['body'][_0xd975('0x10')]){logger['info'](_0xd975('0x11'),_0x268d2c,_0xd975('0x12'));return _0x46c537[_0xd975('0x13')]();}if(_0x115d77[0x0]==='1'&&(_[_0xd975('0x14')](this[_0xd975('0x15')][_0xd975('0x16')])||!this[_0xd975('0x15')][_0xd975('0x16')])){logger[_0xd975('0x17')](_0xd975('0x11'),_0x268d2c,_0xd975('0x18'));return _0x46c537[_0xd975('0x13')]();}if(_0x115d77[0x0]==='2'&&this[_0xd975('0x15')][_0xd975('0x19')]){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x268d2c,_0xd975('0x1a'));return _0x46c537['next']();}var _0xba614a={'ContactId':this[_0xd975('0x1b')]['id'],'sentAt':moment()[_0xd975('0x1c')](_0xd975('0x1d')),'direction':'out'};if(this[_0xd975('0x1e')]===_0xd975('0xf')){_0xba614a['body']=utils[_0xd975('0x1f')](_0x115d77[0x2],this);}else{_0xba614a[_0xd975('0x20')]=utils[_0xd975('0x1f')](_0x115d77[0x1],this);}if(this[_0xd975('0x21')]){_0xba614a['to']=this['message'][_0xd975('0x22')]||'';if(this[_0xd975('0x1e')]==='mail'&&_0x115d77[0x1]==='1'){_0xba614a['cc']=this[_0xd975('0x21')]['cc']||'';}_0xba614a['from']=this['message']['to']||'';_0xba614a[_0xd975('0x23')]=this[_0xd975('0x21')][_0xd975('0x23')]||'';_0xba614a[_0xd975('0x24')]=!![];if(this['message'][_0xd975('0x25')]){_0xba614a[_0xd975('0x25')]='';_0xba614a[_0xd975('0x25')]+=_['startsWith'](this[_0xd975('0x21')]['subject'],'Re:')?'':_0xd975('0x26');_0xba614a[_0xd975('0x25')]+=this[_0xd975('0x21')][_0xd975('0x25')];}}if(this[_0xd975('0x1e')]===_0xd975('0x27')){_0xba614a[_0xd975('0x28')]=this[_0xd975('0x29')]['id'];}else{_0xba614a[_['upperFirst'](this[_0xd975('0x1e')])+_0xd975('0x2a')]=this[_0xd975('0x29')]['id'];}_0xba614a[_[_0xd975('0x2b')](this[_0xd975('0x1e')])+'InteractionId']=this[_0xd975('0x15')]['id'];var _0x4e667d=this[_0xd975('0x15')];if(rpc[this['channel']+_0xd975('0x2c')]){if(this[_0xd975('0x1e')]===_0xd975('0xf')){_0xba614a[_0xd975('0x2d')]=this[_0xd975('0x21')][_0xd975('0x2e')];_0xba614a[_0xd975('0x2f')]=_0xd975('0x30')+_[_0xd975('0x31')](_0xba614a[_0xd975('0x20')],']+(>|$)/g,''),'priorityTrue':_0x3dee30[0x1],'priorityFalse':_0x3dee30[0x2]};var _0x1b3f23=gotoif[_0xd9b5('0x0')](_0x11e21e,{'typecast':!![]});if(_0x1b3f23['length']){logger[_0xd9b5('0x8')](_0xd9b5('0x9'),_0x3f4cf5,_[_0xd9b5('0xa')](_0x1b3f23,_0xd9b5('0xb'))[_0xd9b5('0xc')](',\x20'));_0x11a029[_0xd9b5('0xd')]();}else{try{var _0x1c35cf=eval('('+_0x11e21e['condition']+')');var _0x1f879d=_0x1c35cf?_0x11e21e[_0xd9b5('0xe')]:_0x11e21e[_0xd9b5('0xf')];logger['info'](_0xd9b5('0x10'),_0x3f4cf5,_0x11e21e['condition'],_0x1c35cf,_0x1f879d||_0xd9b5('0x11'));if(_0x1f879d){var _0x4b3389=_[_0xd9b5('0x12')](_0x11a029[_0xd9b5('0x13')](),{'p':_0x1f879d});if(_0x4b3389>=0x0){logger[_0xd9b5('0x14')](_0xd9b5('0x15'),_0x3f4cf5,_0x1f879d||_0xd9b5('0x11'),_0x4b3389);_0x11a029[_0xd9b5('0x11')](_0x4b3389);}else{logger[_0xd9b5('0x14')](_0xd9b5('0x16'),_0x3f4cf5,_0x1f879d||_0xd9b5('0x11'));_0x11a029[_0xd9b5('0xd')]();}}else{_0x11a029['next']();}}catch(_0x2b8be4){logger[_0xd9b5('0x8')](_0xd9b5('0x17'),_0x3f4cf5,_0x2b8be4[_0xd9b5('0xb')]);_0x11a029[_0xd9b5('0xd')]();}}}catch(_0x225461){logger[_0xd9b5('0x8')](_0xd9b5('0x9'),_0x3f4cf5,JSON[_0xd9b5('0x18')](_0x225461));_0x11a029[_0xd9b5('0xd')]();}};}; \ No newline at end of file +var _0x0a0b=['info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','validate','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','consequence','fromString','getMustacheRender','length','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x0a0b,0x199));var _0xb0a0=function(_0x165da1,_0x594868){_0x165da1=_0x165da1-0x0;var _0x322208=_0x0a0b[_0x165da1];return _0x322208;};'use strict';var schema=require(_0xb0a0('0x0'));var _=require(_0xb0a0('0x1'));var htmlToText=require(_0xb0a0('0x2'));var utils=require('./utils');var logger=require(_0xb0a0('0x3'))(_0xb0a0('0x4'));var gotoif=schema({'condition':{'type':_0xb0a0('0x5'),'required':!![],'message':_0xb0a0('0x6')},'priorityTrue':{'type':'number','message':_0xb0a0('0x7')},'priorityFalse':{'type':_0xb0a0('0x8'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xb0a0('0x9')]=function(_0x3a3086,_0x37ebaf){return function(_0x374535){try{var _0x33aa41={'condition':htmlToText[_0xb0a0('0xa')](utils[_0xb0a0('0xb')](_0x37ebaf[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x37ebaf[0x1],'priorityFalse':_0x37ebaf[0x2]};var _0x16e2bd=gotoif['validate'](_0x33aa41,{'typecast':!![]});if(_0x16e2bd[_0xb0a0('0xc')]){logger['error'](_0xb0a0('0xd'),_0x3a3086,_[_0xb0a0('0xe')](_0x16e2bd,_0xb0a0('0xf'))['join'](',\x20'));_0x374535[_0xb0a0('0x10')]();}else{try{var _0x5c95cf=eval('('+_0x33aa41[_0xb0a0('0x11')]+')');var _0x5c8869=_0x5c95cf?_0x33aa41[_0xb0a0('0x12')]:_0x33aa41['priorityFalse'];logger['info'](_0xb0a0('0x13'),_0x3a3086,_0x33aa41[_0xb0a0('0x11')],_0x5c95cf,_0x5c8869||_0xb0a0('0x14'));if(_0x5c8869){var _0x336269=_[_0xb0a0('0x15')](_0x374535[_0xb0a0('0x16')](),{'p':_0x5c8869});if(_0x336269>=0x0){logger[_0xb0a0('0x17')](_0xb0a0('0x18'),_0x3a3086,_0x5c8869||_0xb0a0('0x14'),_0x336269);_0x374535[_0xb0a0('0x14')](_0x336269);}else{logger[_0xb0a0('0x17')](_0xb0a0('0x19'),_0x3a3086,_0x5c8869||'next');_0x374535[_0xb0a0('0x10')]();}}else{_0x374535[_0xb0a0('0x14')]();}}catch(_0x4d03cf){logger[_0xb0a0('0x1a')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3a3086,_0x4d03cf['message']);_0x374535[_0xb0a0('0x10')]();}}}catch(_0x54e688){logger[_0xb0a0('0x1a')](_0xb0a0('0xd'),_0x3a3086,JSON['stringify'](_0x54e688));_0x374535[_0xb0a0('0x10')]();}};}; \ 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 2400274..9631bf9 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 _0xc451=['stringify','lodash','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','error','map','message','join','stop','info','[%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','[%s][GOTOP]\x20%s'];(function(_0x5ebc9a,_0x405dcd){var _0x20d5ae=function(_0x43c067){while(--_0x43c067){_0x5ebc9a['push'](_0x5ebc9a['shift']());}};_0x20d5ae(++_0x405dcd);}(_0xc451,0x8d));var _0x1c45=function(_0x28da7d,_0x360718){_0x28da7d=_0x28da7d-0x0;var _0x53a718=_0xc451[_0x28da7d];return _0x53a718;};'use strict';var schema=require('validate');var _=require(_0x1c45('0x0'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x1c45('0x1'),'required':!![],'message':_0x1c45('0x2')}});exports[_0x1c45('0x3')]=function(_0x4f6eb2,_0x32b676){return function(_0x8e6904){try{var _0x1a068c={'priority':_0x32b676[0x0]};var _0x4dbc78=gotop[_0x1c45('0x4')](_0x1a068c,{'typecast':!![]});if(_0x4dbc78['length']){logger[_0x1c45('0x5')]('[%s][GOTOP]\x20%s',_0x4f6eb2,_[_0x1c45('0x6')](_0x4dbc78,_0x1c45('0x7'))[_0x1c45('0x8')](',\x20'));_0x8e6904[_0x1c45('0x9')]();}else{logger[_0x1c45('0xa')](_0x1c45('0xb'),_0x4f6eb2,_0x1a068c[_0x1c45('0xc')]);if(_0x1a068c[_0x1c45('0xc')]){var _0x5acf3e=_[_0x1c45('0xd')](_0x8e6904[_0x1c45('0xe')](),{'p':_0x1a068c[_0x1c45('0xc')]});if(_0x5acf3e>=0x0){logger[_0x1c45('0xa')](_0x1c45('0xf'),_0x4f6eb2,_0x1a068c[_0x1c45('0xc')]||_0x1c45('0x10'),_0x5acf3e);_0x8e6904[_0x1c45('0x10')](_0x5acf3e);}else{logger[_0x1c45('0xa')](_0x1c45('0x11'),_0x4f6eb2,_0x1a068c[_0x1c45('0xc')]||_0x1c45('0x10'));_0x8e6904[_0x1c45('0x9')]();}}else{_0x8e6904[_0x1c45('0x10')]();}}}catch(_0x183ffb){logger[_0x1c45('0x5')](_0x1c45('0x12'),_0x4f6eb2,JSON[_0x1c45('0x13')](_0x183ffb));_0x8e6904[_0x1c45('0x9')]();}};}; \ No newline at end of file +var _0xd11c=['../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','[%s][GOTOP]\x20%s','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','next','error','stringify','lodash'];(function(_0x4cae4e,_0x286828){var _0x1052f4=function(_0x5bf422){while(--_0x5bf422){_0x4cae4e['push'](_0x4cae4e['shift']());}};_0x1052f4(++_0x286828);}(_0xd11c,0x13f));var _0xcd11=function(_0x53ce77,_0x485779){_0x53ce77=_0x53ce77-0x0;var _0x2a373f=_0xd11c[_0x53ce77];return _0x2a373f;};'use strict';var schema=require('validate');var _=require(_0xcd11('0x0'));var logger=require(_0xcd11('0x1'))(_0xcd11('0x2'));var gotop=schema({'priority':{'type':_0xcd11('0x3'),'required':!![],'message':_0xcd11('0x4')}});exports[_0xcd11('0x5')]=function(_0x46beda,_0x2e0fb2){return function(_0x124116){try{var _0x3c9ff9={'priority':_0x2e0fb2[0x0]};var _0x1c3dec=gotop[_0xcd11('0x6')](_0x3c9ff9,{'typecast':!![]});if(_0x1c3dec['length']){logger['error'](_0xcd11('0x7'),_0x46beda,_[_0xcd11('0x8')](_0x1c3dec,_0xcd11('0x9'))[_0xcd11('0xa')](',\x20'));_0x124116[_0xcd11('0xb')]();}else{logger['info'](_0xcd11('0xc'),_0x46beda,_0x3c9ff9[_0xcd11('0xd')]);if(_0x3c9ff9[_0xcd11('0xd')]){var _0x5ba2a2=_[_0xcd11('0xe')](_0x124116[_0xcd11('0xf')](),{'p':_0x3c9ff9['priority']});if(_0x5ba2a2>=0x0){logger[_0xcd11('0x10')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x46beda,_0x3c9ff9[_0xcd11('0xd')]||'next',_0x5ba2a2);_0x124116[_0xcd11('0x11')](_0x5ba2a2);}else{logger[_0xcd11('0x10')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x46beda,_0x3c9ff9['priority']||_0xcd11('0x11'));_0x124116['stop']();}}else{_0x124116[_0xcd11('0x11')]();}}}catch(_0x309ba6){logger[_0xcd11('0x12')]('[%s][GOTOP]\x20%s',_0x46beda,JSON[_0xcd11('0x13')](_0x309ba6));_0x124116['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 e8ea90e..72b0acf 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 _0xfbe2=['Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','interaction'];(function(_0x18fc56,_0x4e0fc1){var _0x58302a=function(_0x40447f){while(--_0x40447f){_0x18fc56['push'](_0x18fc56['shift']());}};_0x58302a(++_0x4e0fc1);}(_0xfbe2,0x1da));var _0x2fbe=function(_0x6a7409,_0x3b25b0){_0x6a7409=_0x6a7409-0x0;var _0x1bed59=_0xfbe2[_0x6a7409];return _0x1bed59;};'use strict';var _=require(_0x2fbe('0x0'));var utils=require(_0x2fbe('0x1'));var logger=require(_0x2fbe('0x2'))(_0x2fbe('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2fbe('0x4')),'mailMessage':require(_0x2fbe('0x5')),'smsMessage':require(_0x2fbe('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x2fbe('0x7'))};exports[_0x2fbe('0x8')]=function(_0x85a5c8,_0x399ea8){return function(_0x402817){try{var _0x221c08={'body':utils[_0x2fbe('0x9')](_0x399ea8[0x0],this),'ContactId':this[_0x2fbe('0xa')]['id']};if(this[_0x2fbe('0xb')]===_0x2fbe('0xc')){_0x221c08[_0x2fbe('0xd')]=this['account']['id'];}else{_0x221c08[_['upperFirst'](this[_0x2fbe('0xb')])+_0x2fbe('0xe')]=this[_0x2fbe('0xf')]['id'];}_0x221c08[_[_0x2fbe('0x10')](this[_0x2fbe('0xb')])+_0x2fbe('0x11')]=this[_0x2fbe('0x12')]['id'];if(rpc[this[_0x2fbe('0xb')]+_0x2fbe('0x13')]){return rpc[this[_0x2fbe('0xb')]+_0x2fbe('0x13')][_0x2fbe('0x14')](_0x221c08)[_0x2fbe('0x15')](function(_0x12be84){logger['info'](_0x2fbe('0x16'),_0x85a5c8,_0x221c08[_0x2fbe('0x17')]);_0x402817[_0x2fbe('0x18')]();})[_0x2fbe('0x19')](function(_0x19777a){logger[_0x2fbe('0x1a')]('[%s][MESSAGE]\x20%s',_0x85a5c8,JSON[_0x2fbe('0x1b')](_0x19777a));_0x402817[_0x2fbe('0x1c')]();});}}catch(_0x556a98){logger[_0x2fbe('0x1a')]('[%s][MESSAGE]\x20%s',_0x85a5c8,JSON['stringify'](_0x556a98));_0x402817[_0x2fbe('0x1c')]();}};}; \ No newline at end of file +var _0xab7f=['catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','next'];(function(_0x469c33,_0x19afd3){var _0x27cc13=function(_0xc873ae){while(--_0xc873ae){_0x469c33['push'](_0x469c33['shift']());}};_0x27cc13(++_0x19afd3);}(_0xab7f,0xa6));var _0xfab7=function(_0x20f751,_0x3e58b5){_0x20f751=_0x20f751-0x0;var _0x5e694c=_0xab7f[_0x20f751];return _0x5e694c;};'use strict';var _=require(_0xfab7('0x0'));var utils=require(_0xfab7('0x1'));var logger=require(_0xfab7('0x2'))(_0xfab7('0x3'));var rpc={'chatMessage':require(_0xfab7('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xfab7('0x5')),'smsMessage':require(_0xfab7('0x6')),'faxMessage':require(_0xfab7('0x7')),'whatsappMessage':require(_0xfab7('0x8'))};exports['consequence']=function(_0x206d70,_0x1213a8){return function(_0x5cde2d){try{var _0x704224={'body':utils[_0xfab7('0x9')](_0x1213a8[0x0],this),'ContactId':this[_0xfab7('0xa')]['id']};if(this[_0xfab7('0xb')]===_0xfab7('0xc')){_0x704224[_0xfab7('0xd')]=this[_0xfab7('0xe')]['id'];}else{_0x704224[_[_0xfab7('0xf')](this[_0xfab7('0xb')])+'AccountId']=this[_0xfab7('0xe')]['id'];}_0x704224[_[_0xfab7('0xf')](this[_0xfab7('0xb')])+'InteractionId']=this[_0xfab7('0x10')]['id'];if(rpc[this[_0xfab7('0xb')]+_0xfab7('0x11')]){return rpc[this['channel']+_0xfab7('0x11')][_0xfab7('0x12')](_0x704224)['then'](function(_0x220d14){logger[_0xfab7('0x13')](_0xfab7('0x14'),_0x206d70,_0x704224[_0xfab7('0x15')]);_0x5cde2d[_0xfab7('0x16')]();})[_0xfab7('0x17')](function(_0xc1785a){logger[_0xfab7('0x18')]('[%s][MESSAGE]\x20%s',_0x206d70,JSON[_0xfab7('0x19')](_0xc1785a));_0x5cde2d[_0xfab7('0x1a')]();});}}catch(_0x3a30e8){logger[_0xfab7('0x18')](_0xfab7('0x14'),_0x206d70,JSON[_0xfab7('0x19')](_0x3a30e8));_0x5cde2d[_0xfab7('0x1a')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 688dddf..d6909dd 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 _0x683c=['next','error','[%s][NOOP]\x20%s','stringify','routing','consequence','info','getMustacheRender'];(function(_0x3db7f0,_0x20d9da){var _0x31c3f9=function(_0xa29ac4){while(--_0xa29ac4){_0x3db7f0['push'](_0x3db7f0['shift']());}};_0x31c3f9(++_0x20d9da);}(_0x683c,0xac));var _0xc683=function(_0x46da1d,_0xb61e2e){_0x46da1d=_0x46da1d-0x0;var _0x152206=_0x683c[_0x46da1d];return _0x152206;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0xc683('0x0'));exports[_0xc683('0x1')]=function(_0x64ef5c,_0x257c1c){return function(_0x3cc7d8){try{logger[_0xc683('0x2')]('[%s][NOOP]\x20%s',_0x64ef5c,utils[_0xc683('0x3')](_0x257c1c[0x0],this));_0x3cc7d8[_0xc683('0x4')]();}catch(_0x35da3b){logger[_0xc683('0x5')](_0xc683('0x6'),_0x64ef5c,JSON[_0xc683('0x7')](_0x35da3b));_0x3cc7d8['stop']();}};}; \ No newline at end of file +var _0x5c57=['stringify','./utils','routing','info','getMustacheRender','next','error','[%s][NOOP]\x20%s'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x5c57,0xc1));var _0x75c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c57[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0x75c5('0x0'));var logger=require('../../../../config/logger')(_0x75c5('0x1'));exports['consequence']=function(_0x28107d,_0x1a75e1){return function(_0x132f9f){try{logger[_0x75c5('0x2')]('[%s][NOOP]\x20%s',_0x28107d,utils[_0x75c5('0x3')](_0x1a75e1[0x0],this));_0x132f9f[_0x75c5('0x4')]();}catch(_0x703811){logger[_0x75c5('0x5')](_0x75c5('0x6'),_0x28107d,JSON[_0x75c5('0x7')](_0x703811));_0x132f9f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 1421ed7..98dd8ab 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 _0x0e1f=['create','catch','error','create\x20queue\x20report','accepted','info','Interaction','update','then','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','stop','find','Queues','createQueue','atimeout','qtimeout','rules','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','validate','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','account','queue','from','joinAt','clone','queue_id','push','InteractionId','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','[%s][START:QUEUE][NAME:%s]','name','QueueReport'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x0e1f,0x1bc));var _0xf0e1=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0e1f[_0x3947c9];return _0x2e7871;};'use strict';var schema=require(_0xf0e1('0x0'));var _=require('lodash');var util=require(_0xf0e1('0x1'));var seqqueue=require('seq-queue');var moment=require(_0xf0e1('0x2'));var Redis=require(_0xf0e1('0x3'));var config=require(_0xf0e1('0x4'));var logger=require(_0xf0e1('0x5'))(_0xf0e1('0x6'));var strategy=require(_0xf0e1('0x7'));config[_0xf0e1('0x8')]=_[_0xf0e1('0x9')](config[_0xf0e1('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xf0e1('0xa'))(new Redis(config['redis']));var attributes=['id','queue_id',_0xf0e1('0xb'),_0xf0e1('0xc'),_0xf0e1('0xd'),_0xf0e1('0xe')];function emit(_0x21fccb,_0x51e601,_0x4b2c05){io['to'](_0x21fccb)['emit'](_0x51e601,_0x4b2c05);}function emitChannelQueueInteraction(_0x229da5,_0x369b93,_0x39d739,_0x3112b1,_0x531b3c,_0x4d296d,_0x3ffe35,_0x1c8a3f){var _0x399fba=_[_0xf0e1('0xf')](_0x39d739);_0x399fba[_0xf0e1('0x10')]=_0x1c8a3f;_0x399fba[_0xf0e1('0xc')]=_0x369b93;_0x399fba[_0xf0e1('0xb')]=_0x3112b1;_0x399fba['id']=_0x531b3c;if(_0x4d296d){attributes[_0xf0e1('0x11')](_['capitalize'](_0x229da5)+_0xf0e1('0x12'));_0x3ffe35[util[_0xf0e1('0x13')]('%sQueuesWaitingInteractions',_0x229da5)][_0x531b3c]=_[_0xf0e1('0x14')](_0x399fba,attributes);}else{delete _0x3ffe35[util[_0xf0e1('0x13')](_0xf0e1('0x15'),_0x229da5)][_0x531b3c];}emit(util[_0xf0e1('0x13')](_0xf0e1('0x16'),_0x229da5,_0x369b93),util[_0xf0e1('0x13')](_0xf0e1('0x17'),_0x229da5,_0x4d296d?_0xf0e1('0x18'):_0xf0e1('0x19')),_['pick'](_0x399fba,attributes));}var rpc={'openchannelQueueReport':require(_0xf0e1('0x1a')),'mailQueueReport':require(_0xf0e1('0x1b')),'chatQueueReport':require(_0xf0e1('0x1c')),'smsQueueReport':require(_0xf0e1('0x1d')),'faxQueueReport':require(_0xf0e1('0x1e')),'whatsappQueueReport':require(_0xf0e1('0x1f')),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require(_0xf0e1('0x20')),'mailInteraction':require(_0xf0e1('0x21')),'openchannelInteraction':require(_0xf0e1('0x22')),'smsInteraction':require(_0xf0e1('0x23')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':_0xf0e1('0x24'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xf0e1('0x25'),'message':_0xf0e1('0x26')}});function startRouting(_0x57a4b1,_0x1edddd,_0x25ee7b,_0x18890e){if(_0x57a4b1&&_0x1edddd&&_0x25ee7b){_0x1edddd[_0xf0e1('0x27')]+=0x1;var _0x3a1d59={'uniqueid':_0x57a4b1,'from':_0x25ee7b[_0xf0e1('0x28')]?_0x25ee7b[_0xf0e1('0x28')]['from']:'','joinAt':moment()[_0xf0e1('0x13')](_0xf0e1('0x29')),'ContactId':_0x25ee7b[_0xf0e1('0x2a')]?_0x25ee7b[_0xf0e1('0x2a')]['id']:null,'ListId':_0x25ee7b['list']?_0x25ee7b['list']['id']:null};_0x3a1d59[_[_0xf0e1('0x2b')](_0x25ee7b[_0xf0e1('0x2c')])+_0xf0e1('0x2d')]=_0x1edddd['id']||null;_0x3a1d59[_['upperFirst'](_0x25ee7b[_0xf0e1('0x2c')])+_0xf0e1('0x12')]=_0x25ee7b[_0xf0e1('0x2e')]?_0x25ee7b[_0xf0e1('0x2e')]['id']:null;_0x3a1d59[_[_0xf0e1('0x2b')](_0x25ee7b[_0xf0e1('0x2c')])+_0xf0e1('0x2f')]=_0x25ee7b[_0xf0e1('0x30')]?_0x25ee7b['message']['id']:null;_0x3a1d59[_[_0xf0e1('0x2b')](_0x25ee7b['channel'])+(_0x25ee7b['channel']!==_0xf0e1('0x31')?_0xf0e1('0x32'):'WebsiteId')]=_0x25ee7b[_0xf0e1('0xb')]?_0x25ee7b['account']['id']:null;logger['info'](util[_0xf0e1('0x13')](_0xf0e1('0x33'),_0x57a4b1,_0x1edddd[_0xf0e1('0x34')]));emitChannelQueueInteraction(_0x25ee7b['channel'],_0x1edddd[_0xf0e1('0x34')],_0x3a1d59,_0x25ee7b[_0xf0e1('0xb')]['name'],_0x25ee7b['message']['id'],!![],_0x18890e,_0x1edddd['id']);if(rpc[_0x25ee7b[_0xf0e1('0x2c')]+_0xf0e1('0x35')]){return rpc[_0x25ee7b[_0xf0e1('0x2c')]+'QueueReport'][_0xf0e1('0x36')](_0x3a1d59)[_0xf0e1('0x37')](function(_0x2585ef){logger[_0xf0e1('0x38')](_0xf0e1('0x39'),_0x2585ef);});}}}function stopRouting(_0x24c4f9,_0x67cea7,_0x2c11db,_0x26e43c){if(_0x24c4f9&&_0x67cea7){_0x67cea7[_0xf0e1('0x27')]-=0x1;var _0x2c2e42={'leaveAt':moment()[_0xf0e1('0x13')](_0xf0e1('0x29')),'acceptAt':moment()['format'](_0xf0e1('0x29')),'reason':_0xf0e1('0x3a')};logger[_0xf0e1('0x3b')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x24c4f9,_0x67cea7[_0xf0e1('0x34')]));emitChannelQueueInteraction(_0x2c11db[_0xf0e1('0x2c')],_0x67cea7[_0xf0e1('0x34')],_0x2c11db[_0xf0e1('0x28')],_0x2c11db[_0xf0e1('0xb')][_0xf0e1('0x34')],_0x2c11db[_0xf0e1('0x30')]['id'],![],_0x26e43c,_0x67cea7['id']);return rpc[_0x2c11db['channel']+_0xf0e1('0x3c')][_0xf0e1('0x3d')](_0x2c11db['interaction']['id'],{'queueId':_0x67cea7['id']})[_0xf0e1('0x3e')](function(){if(rpc[_0x2c11db['channel']+_0xf0e1('0x35')]){return rpc[_0x2c11db[_0xf0e1('0x2c')]+_0xf0e1('0x35')][_0xf0e1('0x3d')](_0x24c4f9,_0x2c2e42)['catch'](function(_0x1a2f57){logger[_0xf0e1('0x38')](_0xf0e1('0x3f'),_0x1a2f57);});}});}}function endRouting(_0x5c1815,_0x350a8c,_0x276c7d,_0x3c88e6){if(_0x5c1815&&_0x350a8c){_0x350a8c[_0xf0e1('0x27')]-=0x1;var _0x55a680={'leaveAt':moment()[_0xf0e1('0x13')](_0xf0e1('0x29')),'exitAt':moment()[_0xf0e1('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xf0e1('0x40')};logger[_0xf0e1('0x3b')](util['format'](_0xf0e1('0x41'),_0x5c1815,_0x350a8c[_0xf0e1('0x34')]));emitChannelQueueInteraction(_0x276c7d[_0xf0e1('0x2c')],_0x350a8c[_0xf0e1('0x34')],_0x276c7d['body'],_0x276c7d[_0xf0e1('0xb')][_0xf0e1('0x34')],_0x276c7d[_0xf0e1('0x30')]['id'],![],_0x3c88e6);if(rpc[_0x276c7d['channel']+_0xf0e1('0x35')]){return rpc[_0x276c7d[_0xf0e1('0x2c')]+_0xf0e1('0x35')]['update'](_0x5c1815,_0x55a680)[_0xf0e1('0x37')](function(_0x8b7c10){logger['error']('update\x20queue\x20report',_0x8b7c10);});}}}function handleFindQueue(_0x104539){return function(_0x1020a5){return _0x1020a5[_0xf0e1('0x34')][_0xf0e1('0x42')]()===_0x104539[_0xf0e1('0x42')]();};}exports[_0xf0e1('0x43')]=function(_0x564819,_0x261948,_0x104a80,_0x4ce78e){return function(_0x3ebb69){try{var _0x58425e={'name':_0x261948[0x0],'timeout':_0x261948[0x1]};var _0xde0717=queue[_0xf0e1('0x0')](_0x58425e,{'typecast':!![]});if(_0xde0717[_0xf0e1('0x44')]){logger[_0xf0e1('0x38')](_0xf0e1('0x45'),_0x564819,_['map'](_0xde0717,'message')['join'](',\x20'));_0x3ebb69[_0xf0e1('0x46')]();}else{var _0x2a7766=_[_0xf0e1('0x47')](_0x104a80[_0x4ce78e[_0xf0e1('0x2c')]+_0xf0e1('0x48')],handleFindQueue(_0x58425e[_0xf0e1('0x34')]));if(_0x2a7766){startRouting(_0x564819,_0x2a7766,_0x4ce78e,_0x104a80);var _0x30475c=(_0x2a7766['timeout']||0xa)*0x3e8;var _0x14a1ec=(_0x58425e[_0xf0e1('0x40')]||0x14)*0x3e8;var _0x27df23;if(_0x30475c>_0x14a1ec){_0x14a1ec=_0x30475c;}var _0x5c9a34=seqqueue[_0xf0e1('0x49')](_0x30475c);_0x5c9a34['id']=_0x564819;_0x5c9a34[_0xf0e1('0x4a')]=_0x30475c;_0x5c9a34[_0xf0e1('0x4b')]=_0x14a1ec;_0x5c9a34[_0xf0e1('0x2c')]=_0x4ce78e[_0xf0e1('0x2c')];_0x104a80[_0xf0e1('0x4c')][_0x564819]['on']('end',function(){logger[_0xf0e1('0x3b')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x564819);stopRouting(_0x564819,_0x2a7766,_0x4ce78e,_0x104a80);clearTimeout(_0x27df23);_0x27df23=undefined;_0x5c9a34[_0xf0e1('0x4d')](!![]);if(_0x104a80[_0xf0e1('0x4c')][_0x564819]){delete _0x104a80[_0xf0e1('0x4c')][_0x564819];}_0x3ebb69[_0xf0e1('0x46')]();});_0x104a80[_0xf0e1('0x4c')][_0x564819]['on'](_0xf0e1('0x4e'),function(){if(_0x104a80[_0xf0e1('0x4c')][_0x564819]){delete _0x104a80[_0xf0e1('0x4c')][_0x564819];}});_0x27df23=setTimeout(function(){logger[_0xf0e1('0x3b')](_0xf0e1('0x4f'),_0x564819);endRouting(_0x564819,_0x2a7766,_0x4ce78e,_0x104a80);clearTimeout(_0x27df23);_0x5c9a34['close'](!![]);_0x3ebb69['next']();},_0x14a1ec);switch(_0x2a7766['strategy']){case _0xf0e1('0x50'):strategy[_0xf0e1('0x50')](_0x5c9a34,_0x2a7766,_0x104a80,_0x4ce78e);break;default:strategy[_0xf0e1('0x51')](_0x5c9a34,_0x2a7766,_0x104a80,_0x4ce78e);}}else{logger[_0xf0e1('0x38')](_0xf0e1('0x52'),_0x564819,_0x58425e[_0xf0e1('0x34')]);_0x3ebb69[_0xf0e1('0x46')]();}}}catch(_0x419acf){logger[_0xf0e1('0x38')](_0xf0e1('0x45'),_0x564819,_0x419acf['stack']);_0x3ebb69[_0xf0e1('0x46')]();}};}; \ No newline at end of file +var _0xbb6b=['format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','string','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','list','channel','QueueId','upperFirst','interaction','MessageId','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','then','update\x20queue\x20report','toLowerCase','consequence','validate','[%s][QUEUE]\x20%s','map','find','Queues','timeout','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stop','stack','lodash','ioredis','../../../../config/environment','routing','defaults','redis','localhost','socket.io-emitter','queue_id','queue','from','joinAt','emit','clone','account','push','capitalize','InteractionId'];(function(_0x212741,_0x3ea0f0){var _0x25ff42=function(_0x42d40c){while(--_0x42d40c){_0x212741['push'](_0x212741['shift']());}};_0x25ff42(++_0x3ea0f0);}(_0xbb6b,0x17e));var _0xbbb6=function(_0x1bfce8,_0x2abf68){_0x1bfce8=_0x1bfce8-0x0;var _0x1f6574=_0xbb6b[_0x1bfce8];return _0x1f6574;};'use strict';var schema=require('validate');var _=require(_0xbbb6('0x0'));var util=require('util');var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0xbbb6('0x1'));var config=require(_0xbbb6('0x2'));var logger=require('../../../../config/logger')(_0xbbb6('0x3'));var strategy=require('./strategy');config['redis']=_[_0xbbb6('0x4')](config[_0xbbb6('0x5')],{'host':_0xbbb6('0x6'),'port':0x18eb});var io=require(_0xbbb6('0x7'))(new Redis(config['redis']));var attributes=['id',_0xbbb6('0x8'),'account',_0xbbb6('0x9'),_0xbbb6('0xa'),_0xbbb6('0xb')];function emit(_0x3db836,_0x1ac2a1,_0x3e5339){io['to'](_0x3db836)[_0xbbb6('0xc')](_0x1ac2a1,_0x3e5339);}function emitChannelQueueInteraction(_0x274c7f,_0x4705cb,_0x31ec7e,_0x366d1e,_0x45d868,_0x2fc7a4,_0x30d0af,_0x3e4bf4){var _0x31c47b=_[_0xbbb6('0xd')](_0x31ec7e);_0x31c47b['queue_id']=_0x3e4bf4;_0x31c47b[_0xbbb6('0x9')]=_0x4705cb;_0x31c47b[_0xbbb6('0xe')]=_0x366d1e;_0x31c47b['id']=_0x45d868;if(_0x2fc7a4){attributes[_0xbbb6('0xf')](_[_0xbbb6('0x10')](_0x274c7f)+_0xbbb6('0x11'));_0x30d0af[util[_0xbbb6('0x12')](_0xbbb6('0x13'),_0x274c7f)][_0x45d868]=_[_0xbbb6('0x14')](_0x31c47b,attributes);}else{delete _0x30d0af[util[_0xbbb6('0x12')](_0xbbb6('0x13'),_0x274c7f)][_0x45d868];}emit(util['format'](_0xbbb6('0x15'),_0x274c7f,_0x4705cb),util[_0xbbb6('0x12')](_0xbbb6('0x16'),_0x274c7f,_0x2fc7a4?'save':_0xbbb6('0x17')),_['pick'](_0x31c47b,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xbbb6('0x18')),'chatQueueReport':require(_0xbbb6('0x19')),'smsQueueReport':require(_0xbbb6('0x1a')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xbbb6('0x1b')),'chatInteraction':require(_0xbbb6('0x1c')),'faxInteraction':require(_0xbbb6('0x1d')),'mailInteraction':require(_0xbbb6('0x1e')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0xbbb6('0x1f'))};var queue=schema({'name':{'type':_0xbbb6('0x20'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xbbb6('0x21')}});function startRouting(_0xa9aac8,_0x110471,_0x49c79a,_0xfee67){if(_0xa9aac8&&_0x110471&&_0x49c79a){_0x110471[_0xbbb6('0x22')]+=0x1;var _0x5b05da={'uniqueid':_0xa9aac8,'from':_0x49c79a[_0xbbb6('0x23')]?_0x49c79a[_0xbbb6('0x23')][_0xbbb6('0xa')]:'','joinAt':moment()['format'](_0xbbb6('0x24')),'ContactId':_0x49c79a['contact']?_0x49c79a['contact']['id']:null,'ListId':_0x49c79a['list']?_0x49c79a[_0xbbb6('0x25')]['id']:null};_0x5b05da[_['upperFirst'](_0x49c79a[_0xbbb6('0x26')])+_0xbbb6('0x27')]=_0x110471['id']||null;_0x5b05da[_[_0xbbb6('0x28')](_0x49c79a[_0xbbb6('0x26')])+_0xbbb6('0x11')]=_0x49c79a[_0xbbb6('0x29')]?_0x49c79a['interaction']['id']:null;_0x5b05da[_[_0xbbb6('0x28')](_0x49c79a['channel'])+_0xbbb6('0x2a')]=_0x49c79a[_0xbbb6('0x2b')]?_0x49c79a[_0xbbb6('0x2b')]['id']:null;_0x5b05da[_[_0xbbb6('0x28')](_0x49c79a[_0xbbb6('0x26')])+(_0x49c79a[_0xbbb6('0x26')]!=='chat'?_0xbbb6('0x2c'):_0xbbb6('0x2d'))]=_0x49c79a[_0xbbb6('0xe')]?_0x49c79a[_0xbbb6('0xe')]['id']:null;logger[_0xbbb6('0x2e')](util['format'](_0xbbb6('0x2f'),_0xa9aac8,_0x110471[_0xbbb6('0x30')]));emitChannelQueueInteraction(_0x49c79a[_0xbbb6('0x26')],_0x110471[_0xbbb6('0x30')],_0x5b05da,_0x49c79a[_0xbbb6('0xe')][_0xbbb6('0x30')],_0x49c79a[_0xbbb6('0x2b')]['id'],!![],_0xfee67,_0x110471['id']);if(rpc[_0x49c79a[_0xbbb6('0x26')]+_0xbbb6('0x31')]){return rpc[_0x49c79a[_0xbbb6('0x26')]+'QueueReport'][_0xbbb6('0x32')](_0x5b05da)[_0xbbb6('0x33')](function(_0x108bcb){logger[_0xbbb6('0x34')](_0xbbb6('0x35'),_0x108bcb);});}}}function stopRouting(_0x4c92cb,_0x32f3fb,_0x2e6489,_0x4bbe05){if(_0x4c92cb&&_0x32f3fb){_0x32f3fb[_0xbbb6('0x22')]-=0x1;var _0x3d0c33={'leaveAt':moment()[_0xbbb6('0x12')](_0xbbb6('0x24')),'acceptAt':moment()['format'](_0xbbb6('0x24')),'reason':'accepted'};logger['info'](util['format'](_0xbbb6('0x36'),_0x4c92cb,_0x32f3fb[_0xbbb6('0x30')]));emitChannelQueueInteraction(_0x2e6489[_0xbbb6('0x26')],_0x32f3fb[_0xbbb6('0x30')],_0x2e6489[_0xbbb6('0x23')],_0x2e6489['account'][_0xbbb6('0x30')],_0x2e6489[_0xbbb6('0x2b')]['id'],![],_0x4bbe05,_0x32f3fb['id']);return rpc[_0x2e6489[_0xbbb6('0x26')]+'Interaction'][_0xbbb6('0x37')](_0x2e6489[_0xbbb6('0x29')]['id'],{'queueId':_0x32f3fb['id']})[_0xbbb6('0x38')](function(){if(rpc[_0x2e6489['channel']+_0xbbb6('0x31')]){return rpc[_0x2e6489[_0xbbb6('0x26')]+_0xbbb6('0x31')][_0xbbb6('0x37')](_0x4c92cb,_0x3d0c33)[_0xbbb6('0x33')](function(_0x24208e){logger[_0xbbb6('0x34')](_0xbbb6('0x39'),_0x24208e);});}});}}function endRouting(_0x307d4f,_0x33ab8a,_0x4dcc8d,_0x53eea5){if(_0x307d4f&&_0x33ab8a){_0x33ab8a[_0xbbb6('0x22')]-=0x1;var _0x5c6bf1={'leaveAt':moment()[_0xbbb6('0x12')](_0xbbb6('0x24')),'exitAt':moment()[_0xbbb6('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger['info'](util['format']('[%s][END:QUEUE][NAME:%s]',_0x307d4f,_0x33ab8a[_0xbbb6('0x30')]));emitChannelQueueInteraction(_0x4dcc8d['channel'],_0x33ab8a['name'],_0x4dcc8d[_0xbbb6('0x23')],_0x4dcc8d[_0xbbb6('0xe')][_0xbbb6('0x30')],_0x4dcc8d['message']['id'],![],_0x53eea5);if(rpc[_0x4dcc8d[_0xbbb6('0x26')]+'QueueReport']){return rpc[_0x4dcc8d['channel']+_0xbbb6('0x31')]['update'](_0x307d4f,_0x5c6bf1)['catch'](function(_0x386b4f){logger['error'](_0xbbb6('0x39'),_0x386b4f);});}}}function handleFindQueue(_0x39c779){return function(_0x186bbc){return _0x186bbc[_0xbbb6('0x30')][_0xbbb6('0x3a')]()===_0x39c779[_0xbbb6('0x3a')]();};}exports[_0xbbb6('0x3b')]=function(_0xf19853,_0x489a7f,_0x450b64,_0x5e4628){return function(_0x18c949){try{var _0x43edcc={'name':_0x489a7f[0x0],'timeout':_0x489a7f[0x1]};var _0x35bb66=queue[_0xbbb6('0x3c')](_0x43edcc,{'typecast':!![]});if(_0x35bb66['length']){logger[_0xbbb6('0x34')](_0xbbb6('0x3d'),_0xf19853,_[_0xbbb6('0x3e')](_0x35bb66,_0xbbb6('0x2b'))['join'](',\x20'));_0x18c949['stop']();}else{var _0x1cd3a1=_[_0xbbb6('0x3f')](_0x450b64[_0x5e4628[_0xbbb6('0x26')]+_0xbbb6('0x40')],handleFindQueue(_0x43edcc[_0xbbb6('0x30')]));if(_0x1cd3a1){startRouting(_0xf19853,_0x1cd3a1,_0x5e4628,_0x450b64);var _0x3e7c9c=(_0x1cd3a1['timeout']||0xa)*0x3e8;var _0x72c78=(_0x43edcc[_0xbbb6('0x41')]||0x14)*0x3e8;var _0x5c34f8;if(_0x3e7c9c>_0x72c78){_0x72c78=_0x3e7c9c;}var _0x50a6c9=seqqueue['createQueue'](_0x3e7c9c);_0x50a6c9['id']=_0xf19853;_0x50a6c9[_0xbbb6('0x42')]=_0x3e7c9c;_0x50a6c9[_0xbbb6('0x43')]=_0x72c78;_0x50a6c9[_0xbbb6('0x26')]=_0x5e4628[_0xbbb6('0x26')];_0x450b64['rules'][_0xf19853]['on'](_0xbbb6('0x44'),function(){logger['info'](_0xbbb6('0x45'),_0xf19853);stopRouting(_0xf19853,_0x1cd3a1,_0x5e4628,_0x450b64);clearTimeout(_0x5c34f8);_0x5c34f8=undefined;_0x50a6c9[_0xbbb6('0x46')](!![]);if(_0x450b64[_0xbbb6('0x47')][_0xf19853]){delete _0x450b64[_0xbbb6('0x47')][_0xf19853];}_0x18c949['stop']();});_0x450b64[_0xbbb6('0x47')][_0xf19853]['on'](_0xbbb6('0x48'),function(){if(_0x450b64[_0xbbb6('0x47')][_0xf19853]){delete _0x450b64[_0xbbb6('0x47')][_0xf19853];}});_0x5c34f8=setTimeout(function(){logger[_0xbbb6('0x2e')](_0xbbb6('0x49'),_0xf19853);endRouting(_0xf19853,_0x1cd3a1,_0x5e4628,_0x450b64);clearTimeout(_0x5c34f8);_0x50a6c9[_0xbbb6('0x46')](!![]);_0x18c949['next']();},_0x72c78);switch(_0x1cd3a1[_0xbbb6('0x4a')]){case'rrmemory':strategy[_0xbbb6('0x4b')](_0x50a6c9,_0x1cd3a1,_0x450b64,_0x5e4628);break;default:strategy[_0xbbb6('0x4c')](_0x50a6c9,_0x1cd3a1,_0x450b64,_0x5e4628);}}else{logger[_0xbbb6('0x34')](_0xbbb6('0x4d'),_0xf19853,_0x43edcc['name']);_0x18c949[_0xbbb6('0x4e')]();}}}catch(_0x42677f){logger[_0xbbb6('0x34')](_0xbbb6('0x3d'),_0xf19853,_0x42677f[_0xbbb6('0x4f')]);_0x18c949['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 a656e6d..dec682a 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 _0x0e85=['lodash','uuid','../../../../../config/logger','routing','squeue','agent','realtime','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','busyQueue','channel','writeLog',':FORCED','isNil','hideNotification','notificationId','removeWaitingNotification','STOP','TIMEOUT'];(function(_0x245d3a,_0x35a304){var _0x2072f1=function(_0x281bd0){while(--_0x281bd0){_0x245d3a['push'](_0x245d3a['shift']());}};_0x2072f1(++_0x35a304);}(_0x0e85,0x7c));var _0x50e8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0e85[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x50e8('0x0'));var uuid=require(_0x50e8('0x1'));var util=require('./util');var logger=require(_0x50e8('0x2'))(_0x50e8('0x3'));var Agent=function(_0x55e515,_0x55cba3,_0x4ce6cd,_0x236cf3){this['notificationId']=uuid['v4']();this[_0x50e8('0x4')]=_0x55e515;this[_0x50e8('0x5')]=_0x55cba3;this[_0x50e8('0x6')]=_0x4ce6cd;this[_0x50e8('0x3')]=_0x236cf3;this['squeue'][_0x50e8('0x7')](this[_0x50e8('0x8')][_0x50e8('0x9')](this),this[_0x50e8('0xa')][_0x50e8('0x9')](this));this[_0x50e8('0x4')]['on']('timeout',this[_0x50e8('0xa')][_0x50e8('0x9')](this));this[_0x50e8('0x4')]['on'](_0x50e8('0xb'),this[_0x50e8('0xc')][_0x50e8('0x9')](this));};Agent[_0x50e8('0xd')][_0x50e8('0x7')]=function(){this['squeue']['push'](this[_0x50e8('0x8')][_0x50e8('0x9')](this),this['handleTimeout']['bind'](this));};Agent[_0x50e8('0xd')][_0x50e8('0xc')]=function(){this[_0x50e8('0xa')](!![]);};Agent[_0x50e8('0xd')]['handleRun']=function(){logger[_0x50e8('0xe')](_0x50e8('0xf'),this[_0x50e8('0x4')]['id'],this['agent']['id']);if(_['isNil'](this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']])){logger[_0x50e8('0xe')](_0x50e8('0x11'),this[_0x50e8('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0x50e8('0x9')](this),0x3e8);}else{if(this[_0x50e8('0x3')][_0x50e8('0x12')]||util[_0x50e8('0x13')](this[_0x50e8('0x4')]['id'],this[_0x50e8('0x6')][_0x50e8('0x10')][this['agent']['id']],this[_0x50e8('0x4')]['channel'],![])){this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']][_0x50e8('0x14')]=!![];this[_0x50e8('0x6')]['agents'][this[_0x50e8('0x5')]['id']][_0x50e8('0x15')]=undefined;util['saveWaitingNotification'](this[_0x50e8('0x6')],this[_0x50e8('0x3')],this['agent'],this[_0x50e8('0x4')][_0x50e8('0x16')]);util['showNotification'](this['notificationId'],this['squeue']['id'],this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']],null,this[_0x50e8('0x3')]);util[_0x50e8('0x17')](this[_0x50e8('0x4')]['id'],this['realtime'][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']],'RINGING'+(this[_0x50e8('0x3')][_0x50e8('0x12')]?_0x50e8('0x18'):''));}else{logger[_0x50e8('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x50e8('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x50e8('0x7')][_0x50e8('0x9')](this),0x3e8);}}};Agent[_0x50e8('0xd')]['handleTimeout']=function(_0x1041b9){if(_[_0x50e8('0x19')](this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']])){return logger[_0x50e8('0xe')](_0x50e8('0x11'),this['squeue']['id'],this[_0x50e8('0x5')]['id']);}else{logger[_0x50e8('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x50e8('0x5')]['id']);util[_0x50e8('0x1a')](this[_0x50e8('0x1b')],this['squeue']['id'],this['realtime'][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']],null,this['routing']);this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']][_0x50e8('0x14')]=![];this['realtime'][_0x50e8('0x10')][this['agent']['id']][_0x50e8('0x15')]=undefined;util[_0x50e8('0x1c')](this[_0x50e8('0x6')],this['routing'],this[_0x50e8('0x5')],this[_0x50e8('0x4')]['channel']);util[_0x50e8('0x17')](this[_0x50e8('0x4')]['id'],this[_0x50e8('0x6')][_0x50e8('0x10')][this['agent']['id']],_0x1041b9?_0x50e8('0x1d'):_0x50e8('0x1e'));}if(!_0x1041b9){setTimeout(this[_0x50e8('0x7')][_0x50e8('0x9')](this),0x3e8);}};function agent(_0x5e556c,_0x3c7778,_0x2d0ccf,_0x3f01ee){return new Agent(_0x5e556c,_0x3c7778,_0x2d0ccf,_0x3f01ee);}module['exports']=agent; \ No newline at end of file +var _0xf3cd=['notificationId','agent','realtime','squeue','push','handleRun','handleTimeout','timeout','drained','handleDrained','bind','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busyQueue','saveWaitingNotification','showNotification','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0xf3cd[_0x2d344f];return _0x2e796b;};'use strict';var _=require(_0xdf3c('0x0'));var uuid=require(_0xdf3c('0x1'));var util=require(_0xdf3c('0x2'));var logger=require(_0xdf3c('0x3'))(_0xdf3c('0x4'));var Agent=function(_0x433a7f,_0x54db05,_0x401518,_0x71b446){this[_0xdf3c('0x5')]=uuid['v4']();this['squeue']=_0x433a7f;this[_0xdf3c('0x6')]=_0x54db05;this[_0xdf3c('0x7')]=_0x401518;this[_0xdf3c('0x4')]=_0x71b446;this[_0xdf3c('0x8')][_0xdf3c('0x9')](this[_0xdf3c('0xa')]['bind'](this),this[_0xdf3c('0xb')]['bind'](this));this['squeue']['on'](_0xdf3c('0xc'),this[_0xdf3c('0xb')]['bind'](this));this[_0xdf3c('0x8')]['on'](_0xdf3c('0xd'),this[_0xdf3c('0xe')][_0xdf3c('0xf')](this));};Agent[_0xdf3c('0x10')][_0xdf3c('0x9')]=function(){this[_0xdf3c('0x8')][_0xdf3c('0x9')](this['handleRun'][_0xdf3c('0xf')](this),this[_0xdf3c('0xb')][_0xdf3c('0xf')](this));};Agent[_0xdf3c('0x10')]['handleDrained']=function(){this[_0xdf3c('0xb')](!![]);};Agent[_0xdf3c('0x10')][_0xdf3c('0xa')]=function(){logger['debug'](_0xdf3c('0x11'),this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x6')]['id']);if(_[_0xdf3c('0x12')](this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']])){logger[_0xdf3c('0x14')](_0xdf3c('0x15'),this[_0xdf3c('0x8')]['id'],this['agent']['id']);setTimeout(this[_0xdf3c('0x9')][_0xdf3c('0xf')](this),0x3e8);}else{if(this[_0xdf3c('0x4')][_0xdf3c('0x16')]||util[_0xdf3c('0x17')](this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']],this[_0xdf3c('0x8')][_0xdf3c('0x18')],![])){this[_0xdf3c('0x7')][_0xdf3c('0x13')][this['agent']['id']]['busy']=!![];this[_0xdf3c('0x7')]['agents'][this[_0xdf3c('0x6')]['id']][_0xdf3c('0x19')]=undefined;util[_0xdf3c('0x1a')](this[_0xdf3c('0x7')],this[_0xdf3c('0x4')],this[_0xdf3c('0x6')],this['squeue'][_0xdf3c('0x18')]);util[_0xdf3c('0x1b')](this[_0xdf3c('0x5')],this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']],null,this[_0xdf3c('0x4')]);util[_0xdf3c('0x1c')](this[_0xdf3c('0x8')]['id'],this['realtime'][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']],'RINGING'+(this[_0xdf3c('0x4')]['forcedOwnership']?':FORCED':''));}else{logger['debug'](_0xdf3c('0x1d'),this[_0xdf3c('0x8')]['id'],this['agent']['id']);setTimeout(this['push'][_0xdf3c('0xf')](this),0x3e8);}}};Agent[_0xdf3c('0x10')][_0xdf3c('0xb')]=function(_0x1ccdd4){if(_['isNil'](this[_0xdf3c('0x7')][_0xdf3c('0x13')][this['agent']['id']])){return logger['debug'](_0xdf3c('0x15'),this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x6')]['id']);}else{logger['debug'](_0xdf3c('0x1e'),this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x6')]['id']);util[_0xdf3c('0x1f')](this['notificationId'],this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x7')]['agents'][this[_0xdf3c('0x6')]['id']],null,this[_0xdf3c('0x4')]);this[_0xdf3c('0x7')][_0xdf3c('0x13')][this['agent']['id']][_0xdf3c('0x20')]=![];this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']]['busyQueue']=undefined;util[_0xdf3c('0x21')](this[_0xdf3c('0x7')],this['routing'],this['agent'],this[_0xdf3c('0x8')]['channel']);util[_0xdf3c('0x1c')](this['squeue']['id'],this['realtime']['agents'][this[_0xdf3c('0x6')]['id']],_0x1ccdd4?_0xdf3c('0x22'):_0xdf3c('0x23'));}if(!_0x1ccdd4){setTimeout(this[_0xdf3c('0x9')]['bind'](this),0x3e8);}};function agent(_0x49f147,_0x3d8557,_0x49d0f0,_0x46e40f){return new Agent(_0x49f147,_0x3d8557,_0x49d0f0,_0x46e40f);}module[_0xdf3c('0x24')]=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 eaeb9fc..8f42b6d 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 _0xde03=['timeout','handleTimeout','drained','handleDrained','prototype','push','isNil','Agents','length','agents','isAgentAvailable','channel','writeLog','RINGING','busyQueue','name','saveWaitingNotification','showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','TIMEOUT','busy','removeWaitingNotification','lodash','uuid','routing','notificationId','squeue','queue','realtime','handleRun','bind'];(function(_0x457bd6,_0x3123bc){var _0x14d533=function(_0x558bbd){while(--_0x558bbd){_0x457bd6['push'](_0x457bd6['shift']());}};_0x14d533(++_0x3123bc);}(_0xde03,0x132));var _0x3de0=function(_0x4c433b,_0x15005a){_0x4c433b=_0x4c433b-0x0;var _0x475ebf=_0xde03[_0x4c433b];return _0x475ebf;};'use strict';var _=require(_0x3de0('0x0'));var uuid=require(_0x3de0('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')(_0x3de0('0x2'));var Beepall=function(_0xb1288d,_0x330955,_0xd78762,_0x320231){this[_0x3de0('0x3')]=uuid['v4']();this[_0x3de0('0x4')]=_0xb1288d;this[_0x3de0('0x5')]=_0x330955;this[_0x3de0('0x6')]=_0xd78762;this[_0x3de0('0x2')]=_0x320231;this[_0x3de0('0x4')]['push'](this[_0x3de0('0x7')]['bind'](this),this['handleTimeout'][_0x3de0('0x8')](this));this[_0x3de0('0x4')]['on'](_0x3de0('0x9'),this[_0x3de0('0xa')][_0x3de0('0x8')](this));this['squeue']['on'](_0x3de0('0xb'),this[_0x3de0('0xc')][_0x3de0('0x8')](this));};Beepall[_0x3de0('0xd')][_0x3de0('0xe')]=function(){this['squeue'][_0x3de0('0xe')](this[_0x3de0('0x7')][_0x3de0('0x8')](this),this[_0x3de0('0xa')]['bind'](this));};Beepall[_0x3de0('0xd')][_0x3de0('0xc')]=function(){this['handleTimeout'](!![]);};Beepall[_0x3de0('0xd')]['handleRun']=function(){var _0x439d1a=!![];if(!_[_0x3de0('0xf')](this[_0x3de0('0x5')])&&!_[_0x3de0('0xf')](this[_0x3de0('0x5')][_0x3de0('0x10')])&&this[_0x3de0('0x5')][_0x3de0('0x10')][_0x3de0('0x11')]>0x0){for(var _0x207c9c=0x0,_0x4c5821;_0x207c9c0x0){for(var _0x1f56ac=0x0,_0x4733f4;_0x1f56ac0x0&&_0x135ca1[_0x10e245+_0x4a1b('0x28')]>=_0x135ca1[_0x10e245+_0x4a1b('0x27')]){writeLog(_0x47551e,_0x135ca1,_0x10e245[_0x4a1b('0x29')]()+_0x4a1b('0x2a'));return![];}}return!![];};exports[_0x4a1b('0x2b')]=function(_0x2ec4e5,_0x169525,_0x3336a8,_0x19eb98,_0x59bc18){return sendNotification(!![],_0x2ec4e5,_0x169525,_0x3336a8,_0x19eb98,_0x59bc18);};exports[_0x4a1b('0x2c')]=function(_0x2ab164,_0x1d1860,_0x260395,_0x4e1ebd,_0x3f5701){return sendNotification(![],_0x2ab164,_0x1d1860,_0x260395,_0x4e1ebd,_0x3f5701);};exports['checkWaitingNotifications']=function(_0x3d9b31,_0x259163,_0x219bef){var _0x68a8fc=_0x259163[_0x4a1b('0x2d')][_0x4a1b('0x2e')];if(!_0x68a8fc&&_0x219bef){_0x68a8fc=_0x219bef['id'];}var _0x26d080=_[_0x4a1b('0x2f')](_0x3d9b31[_0x259163[_0x4a1b('0x30')]+_0x4a1b('0x31')],function(_0x5f0f1b){var _0x1515f2=_['capitalize'](_0x259163[_0x4a1b('0x30')])+_0x4a1b('0x32');return _0x5f0f1b[_0x1515f2]===_0x259163[_0x4a1b('0x2d')]['id'];});if(!_0x26d080&&_0x68a8fc&&_0x3d9b31[_0x4a1b('0x33')][_0x68a8fc]){_0x26d080=_['some'](_0x3d9b31['agents'][_0x68a8fc][_0x259163[_0x4a1b('0x30')]+_0x4a1b('0x34')],function(_0x28ed41){return _0x28ed41['id']===_0x259163['interaction']['id'];});}return _0x26d080;};exports['saveWaitingNotification']=function(_0x31f4fd,_0x210476,_0x1464d7,_0x16c3bf){if(_0x1464d7&&_0x1464d7['id']&&_0x31f4fd[_0x4a1b('0x33')]&&_0x31f4fd['agents'][_0x1464d7['id']]){_0x31f4fd['agents'][_0x1464d7['id']][_0x16c3bf+'WaitingInteractions'][_0x210476[_0x4a1b('0x18')]['id']]={'id':_0x210476['interaction']['id']};}};exports[_0x4a1b('0x35')]=function(_0x420690,_0x2b4a21,_0x29f027,_0x21f0bb){if(_0x29f027&&_0x29f027['id']&&_0x420690['agents']&&_0x420690[_0x4a1b('0x33')][_0x29f027['id']]){delete _0x420690[_0x4a1b('0x33')][_0x29f027['id']][_0x21f0bb+'WaitingInteractions'][_0x2b4a21['message']['id']];}};exports[_0x4a1b('0x36')]=writeLog; \ No newline at end of file +var _0x71d5=['WaitingInteractions','saveWaitingNotification','agents','removeWaitingNotification','writeLog','lodash','util','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','split','\x20interaction','account','notificationSound','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','user:%s','emit','notification:%s','save','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','name','isAgentAvailable','busy','Pause','PAUSE','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x71d5,0x109));var _0x571d=function(_0x435e0b,_0x4b794d){_0x435e0b=_0x435e0b-0x0;var _0xfb1f0b=_0x71d5[_0x435e0b];return _0xfb1f0b;};'use strict';var _=require(_0x571d('0x0'));var util=require(_0x571d('0x1'));var utils=require('../utils');var Redis=require('ioredis');var config=require(_0x571d('0x2'));var logger=require(_0x571d('0x3'))(_0x571d('0x4'));config[_0x571d('0x5')]=_[_0x571d('0x6')](config[_0x571d('0x5')],{'host':_0x571d('0x7'),'port':0x18eb});var io=require(_0x571d('0x8'))(new Redis(config[_0x571d('0x5')]));function sendNotification(_0x562de5,_0xdf7813,_0x12e5ba,_0x35ca3c,_0x141a0b,_0x18506e){var _0x2e8c89=_0x18506e||{};var _0x44861f=_0x12e5ba[_0x571d('0x9')]('.');var _0x148f1f={'uniqueid':_0xdf7813,'channel':_0x44861f[0x0],'id':_0x44861f[0x1],'title':_0x44861f[0x0]+_0x571d('0xa'),'interactionId':_0x44861f[0x2],'queue':_0x141a0b?_0x141a0b['name']:null,'sound':_0x2e8c89[_0x571d('0xb')][_0x571d('0xc')],'shake':_0x2e8c89[_0x571d('0xb')]['notificationShake']};try{if(!_0x2e8c89[_0x571d('0xd')]){_0x2e8c89['body']={};}if(_0x141a0b){_0x2e8c89[_0x571d('0xd')][_0x571d('0xe')]=_0x141a0b;}else if(_0x2e8c89[_0x571d('0xd')][_0x571d('0xe')]){delete _0x2e8c89[_0x571d('0xd')][_0x571d('0xe')];}_0x148f1f[_0x571d('0xf')]=utils[_0x571d('0x10')](_0x2e8c89[_0x571d('0xb')][_0x571d('0x11')],_0x2e8c89);}catch(_0x2f85d7){_0x148f1f['msg']=_0x571d('0x12');logger[_0x571d('0x13')](util[_0x571d('0x14')](_0x571d('0x15'),_0xdf7813,_0x2f85d7[_0x571d('0x16')]));}io['to'](util[_0x571d('0x14')](_0x571d('0x17'),_0x35ca3c['name']))[_0x571d('0x18')](util[_0x571d('0x14')](_0x571d('0x19'),_0x562de5?_0x571d('0x1a'):'remove'),_0x148f1f);}function writeLog(_0x21b69d,_0x413674,_0x5433ff){return logger[_0x571d('0x1b')](util[_0x571d('0x14')](_0x571d('0x1c'),_0x21b69d,_0x413674[_0x571d('0x1d')],_0x5433ff));}exports[_0x571d('0x1e')]=function(_0x291074,_0x316677,_0x45b979,_0x3e6403){if(_0x316677[_0x571d('0x1f')]){writeLog(_0x291074,_0x316677,'BUSY');return![];}if(!_0x316677['online']){writeLog(_0x291074,_0x316677,'OFFLINE');return![];}if(_0x316677[_0x45b979+_0x571d('0x20')]){writeLog(_0x291074,_0x316677,_0x571d('0x21'));return![];}if(_0x3e6403&&_0x316677['hasOwnProperty'](_0x45b979+_0x571d('0x22'))&&_0x316677['hasOwnProperty'](_0x45b979+_0x571d('0x23'))){if(_0x316677[_0x45b979+_0x571d('0x22')]>0x0&&_0x316677[_0x45b979+'CurrentCapacity']>=_0x316677[_0x45b979+_0x571d('0x22')]){writeLog(_0x291074,_0x316677,_0x45b979[_0x571d('0x24')]()+_0x571d('0x25'));return![];}}return!![];};exports['showNotification']=function(_0x15a73a,_0x251718,_0x2cde3a,_0x4e089e,_0x54a9d9){return sendNotification(!![],_0x15a73a,_0x251718,_0x2cde3a,_0x4e089e,_0x54a9d9);};exports[_0x571d('0x26')]=function(_0x53e5d1,_0x573b5e,_0x5cfdf6,_0x3ca32f,_0x361bd6){return sendNotification(![],_0x53e5d1,_0x573b5e,_0x5cfdf6,_0x3ca32f,_0x361bd6);};exports[_0x571d('0x27')]=function(_0x119211,_0x59749a,_0x395d7b){var _0x2a6764=_0x59749a[_0x571d('0x28')][_0x571d('0x29')];if(!_0x2a6764&&_0x395d7b){_0x2a6764=_0x395d7b['id'];}var _0x567742=_[_0x571d('0x2a')](_0x119211[_0x59749a[_0x571d('0x2b')]+_0x571d('0x2c')],function(_0x20dfdd){var _0x529cb5=_[_0x571d('0x2d')](_0x59749a[_0x571d('0x2b')])+_0x571d('0x2e');return _0x20dfdd[_0x529cb5]===_0x59749a[_0x571d('0x28')]['id'];});if(!_0x567742&&_0x2a6764&&_0x119211['agents'][_0x2a6764]){_0x567742=_[_0x571d('0x2a')](_0x119211['agents'][_0x2a6764][_0x59749a[_0x571d('0x2b')]+_0x571d('0x2f')],function(_0x1c5188){return _0x1c5188['id']===_0x59749a[_0x571d('0x28')]['id'];});}return _0x567742;};exports[_0x571d('0x30')]=function(_0x3135ae,_0x5e6faa,_0x98fb44,_0xe7a8f1){if(_0x98fb44&&_0x98fb44['id']&&_0x3135ae[_0x571d('0x31')]&&_0x3135ae[_0x571d('0x31')][_0x98fb44['id']]){_0x3135ae[_0x571d('0x31')][_0x98fb44['id']][_0xe7a8f1+'WaitingInteractions'][_0x5e6faa[_0x571d('0x16')]['id']]={'id':_0x5e6faa[_0x571d('0x28')]['id']};}};exports[_0x571d('0x32')]=function(_0x120b19,_0x1b123c,_0xccda23,_0x580b27){if(_0xccda23&&_0xccda23['id']&&_0x120b19[_0x571d('0x31')]&&_0x120b19['agents'][_0xccda23['id']]){delete _0x120b19[_0x571d('0x31')][_0xccda23['id']][_0x580b27+_0x571d('0x2f')][_0x1b123c[_0x571d('0x16')]['id']];}};exports[_0x571d('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 fb17e98..72e290e 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 _0xf4dd=['[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','consequence','error','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty'];(function(_0x384ac7,_0x4d867c){var _0x27b135=function(_0x17e3b1){while(--_0x17e3b1){_0x384ac7['push'](_0x384ac7['shift']());}};_0x27b135(++_0x4d867c);}(_0xf4dd,0xb4));var _0xdf4d=function(_0x5380f2,_0x4782dd){_0x5380f2=_0x5380f2-0x0;var _0x5e3665=_0xf4dd[_0x5380f2];return _0x5e3665;};'use strict';var schema=require(_0xdf4d('0x0'));var sh=require(_0xdf4d('0x1'));var _=require(_0xdf4d('0x2'));var utils=require(_0xdf4d('0x3'));var logger=require(_0xdf4d('0x4'))(_0xdf4d('0x5'));var system=schema({'command':{'type':_0xdf4d('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xdf4d('0x7')]=function(_0x539191,_0x434c2a){return function(_0x58fc81){try{var _0x41d806={'command':_0x434c2a[0x0]};var _0x50ebf6=system[_0xdf4d('0x0')](_0x41d806,{'typecast':!![]});if(_0x50ebf6['length']){logger[_0xdf4d('0x8')]('[%s][SYSTEM]\x20%s',_0x539191,_[_0xdf4d('0x9')](_0x50ebf6,_0xdf4d('0xa'))[_0xdf4d('0xb')](',\x20'));logger['info'](_0xdf4d('0xc'),_0x539191);_0x58fc81[_0xdf4d('0xd')]();}else{var _0x1d9192=this;var _0x2eb239=utils[_0xdf4d('0xe')](_0x434c2a[0x0],this);logger[_0xdf4d('0xf')](_0xdf4d('0x10'),_0x539191,_0x2eb239);sh[_0xdf4d('0x11')](_[_0xdf4d('0x12')](_0x2eb239),function(_0x4c1b27,_0x6afaef){logger[_0xdf4d('0xf')](_0xdf4d('0x13'),_0x539191,_0x4c1b27);if(_0x4c1b27==0x0){var _0x2d03ad=_0x6afaef[_0xdf4d('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0xdf4d('0x15')](_0x434c2a[0x1])||_[_0xdf4d('0x16')](_0x434c2a[0x1])){logger[_0xdf4d('0xf')](_0xdf4d('0x17'),_0x539191);_0x1d9192[_0xdf4d('0x18')][_0x434c2a[0x1]]=_0x2d03ad;}else{logger[_0xdf4d('0xf')](_0xdf4d('0x19'),_0x539191,_0x434c2a[0x1],_0x2d03ad);_0x1d9192[_0xdf4d('0x18')][_0x434c2a[0x1]]=_0x2d03ad;}}_0x58fc81[_0xdf4d('0xd')]();});}}catch(_0x2ec82d){logger[_0xdf4d('0x8')](_0xdf4d('0x1a'),_0x539191,_[_0xdf4d('0x1b')](_0x2ec82d)?JSON[_0xdf4d('0x1c')](_0x2ec82d):_0x2ec82d);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x539191);_0x58fc81[_0xdf4d('0xd')]();}};}; \ No newline at end of file +var _0xa243=['../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','map','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','[%s][SYSTEM]\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','./utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa243,0x19d));var _0x3a24=function(_0x5b43ea,_0x5afa05){_0x5b43ea=_0x5b43ea-0x0;var _0x504339=_0xa243[_0x5b43ea];return _0x504339;};'use strict';var schema=require(_0x3a24('0x0'));var sh=require(_0x3a24('0x1'));var _=require('lodash');var utils=require(_0x3a24('0x2'));var logger=require(_0x3a24('0x3'))('routing');var system=schema({'command':{'type':_0x3a24('0x4'),'required':!![],'message':_0x3a24('0x5')}});exports['consequence']=function(_0x40cd57,_0x5edcdf){return function(_0x41a232){try{var _0x3d8646={'command':_0x5edcdf[0x0]};var _0x384882=system['validate'](_0x3d8646,{'typecast':!![]});if(_0x384882[_0x3a24('0x6')]){logger['error']('[%s][SYSTEM]\x20%s',_0x40cd57,_[_0x3a24('0x7')](_0x384882,'message')[_0x3a24('0x8')](',\x20'));logger[_0x3a24('0x9')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x40cd57);_0x41a232[_0x3a24('0xa')]();}else{var _0x431d3c=this;var _0x82b1c9=utils[_0x3a24('0xb')](_0x5edcdf[0x0],this);logger[_0x3a24('0x9')](_0x3a24('0xc'),_0x40cd57,_0x82b1c9);sh[_0x3a24('0xd')](_['trim'](_0x82b1c9),function(_0x4e12f1,_0x3683f6){logger[_0x3a24('0x9')](_0x3a24('0xe'),_0x40cd57,_0x4e12f1);if(_0x4e12f1==0x0){var _0x2964d7=_0x3683f6[_0x3a24('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0x3a24('0x10')](_0x5edcdf[0x1])||_[_0x3a24('0x11')](_0x5edcdf[0x1])){logger['info'](_0x3a24('0x12'),_0x40cd57);_0x431d3c[_0x3a24('0x13')][_0x5edcdf[0x1]]=_0x2964d7;}else{logger[_0x3a24('0x9')](_0x3a24('0x14'),_0x40cd57,_0x5edcdf[0x1],_0x2964d7);_0x431d3c[_0x3a24('0x13')][_0x5edcdf[0x1]]=_0x2964d7;}}_0x41a232['next']();});}}catch(_0x190dbd){logger[_0x3a24('0x15')](_0x3a24('0x16'),_0x40cd57,_[_0x3a24('0x17')](_0x190dbd)?JSON[_0x3a24('0x18')](_0x190dbd):_0x190dbd);logger[_0x3a24('0x9')](_0x3a24('0x19'),_0x40cd57);_0x41a232[_0x3a24('0xa')]();}};}; \ 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 c81c3e6..85f7d53 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 _0x6cf3=['length','error','[%s][TAG]\x20%s','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','catch','stringify','finally','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x30f457,_0x582ea5){var _0x1a8943=function(_0x4b242a){while(--_0x4b242a){_0x30f457['push'](_0x30f457['shift']());}};_0x1a8943(++_0x582ea5);}(_0x6cf3,0x6b));var _0x36cf=function(_0x438fda,_0x229abf){_0x438fda=_0x438fda-0x0;var _0x445087=_0x6cf3[_0x438fda];return _0x445087;};'use strict';var schema=require(_0x36cf('0x0'));var _=require(_0x36cf('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x36cf('0x2')),'smsInteraction':require(_0x36cf('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x36cf('0x4'))};var logger=require('../../../../config/logger')(_0x36cf('0x5'));var tag=schema({'tag':{'type':_0x36cf('0x6'),'required':!![],'message':_0x36cf('0x7')}});exports['consequence']=function(_0x3310cf,_0x3c947e,_0x4d4fb6,_0xd816e6){return function(_0x486266){try{var _0x2a927a={'tag':_0x3c947e[0x0]};var _0xb4866b=tag[_0x36cf('0x0')](_0x2a927a,{'typecast':!![]});if(_0xb4866b[_0x36cf('0x8')]){logger[_0x36cf('0x9')](_0x36cf('0xa'),_0x3310cf,_['map'](_0xb4866b,'message')[_0x36cf('0xb')](',\x20'));logger[_0x36cf('0xc')](_0x36cf('0xd'),_0x3310cf);_0x486266[_0x36cf('0xe')]();}else{var _0x550034={'ids':[_0x3c947e[0x0]]};if(rpc[_0xd816e6[_0x36cf('0xf')]+_0x36cf('0x10')]){rpc[_0xd816e6[_0x36cf('0xf')]+_0x36cf('0x10')][_0x36cf('0x11')](_0xd816e6[_0x36cf('0x12')]['id'],_0x550034)[_0x36cf('0x13')](function(_0x57c7d6){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x3310cf,_0x3c947e[0x1],_0xd816e6[_0x36cf('0xf')],_0xd816e6['interaction']['id']);})[_0x36cf('0x14')](function(_0x324665){logger[_0x36cf('0x9')](_0x36cf('0xa'),_0x3310cf,JSON[_0x36cf('0x15')](_0x324665));logger[_0x36cf('0xc')](_0x36cf('0xd'),_0x3310cf);})[_0x36cf('0x16')](function(){_0x486266[_0x36cf('0xe')]();});}}}catch(_0x3e53ee){logger[_0x36cf('0x9')](_0x36cf('0xa'),_0x3310cf,_['isObject'](_0x3e53ee)?JSON[_0x36cf('0x15')](_0x3e53ee):_0x3e53ee);logger['info'](_0x36cf('0xd'),_0x3310cf);_0x486266[_0x36cf('0xe')]();}};}; \ No newline at end of file +var _0x6d3f=['validate','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','isObject','stringify','lodash','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence'];(function(_0x4d16b6,_0x5c83d9){var _0x3d85cf=function(_0x12b4c5){while(--_0x12b4c5){_0x4d16b6['push'](_0x4d16b6['shift']());}};_0x3d85cf(++_0x5c83d9);}(_0x6d3f,0x1a2));var _0xf6d3=function(_0x14de58,_0x5f06f3){_0x14de58=_0x14de58-0x0;var _0xb78582=_0x6d3f[_0x14de58];return _0xb78582;};'use strict';var schema=require('validate');var _=require(_0xf6d3('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xf6d3('0x1')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xf6d3('0x2'))};var logger=require(_0xf6d3('0x3'))(_0xf6d3('0x4'));var tag=schema({'tag':{'type':_0xf6d3('0x5'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xf6d3('0x6')]=function(_0x1f33fc,_0x206009,_0x5b6f66,_0x4c830f){return function(_0x115fd0){try{var _0x124686={'tag':_0x206009[0x0]};var _0x316a60=tag[_0xf6d3('0x7')](_0x124686,{'typecast':!![]});if(_0x316a60[_0xf6d3('0x8')]){logger[_0xf6d3('0x9')](_0xf6d3('0xa'),_0x1f33fc,_[_0xf6d3('0xb')](_0x316a60,_0xf6d3('0xc'))[_0xf6d3('0xd')](',\x20'));logger[_0xf6d3('0xe')](_0xf6d3('0xf'),_0x1f33fc);_0x115fd0[_0xf6d3('0x10')]();}else{var _0x440a6f={'ids':[_0x206009[0x0]]};if(rpc[_0x4c830f[_0xf6d3('0x11')]+'Interaction']){rpc[_0x4c830f[_0xf6d3('0x11')]+_0xf6d3('0x12')]['addTags'](_0x4c830f[_0xf6d3('0x13')]['id'],_0x440a6f)[_0xf6d3('0x14')](function(_0x28c162){logger[_0xf6d3('0xe')](_0xf6d3('0x15'),_0x1f33fc,_0x206009[0x1],_0x4c830f['channel'],_0x4c830f[_0xf6d3('0x13')]['id']);})[_0xf6d3('0x16')](function(_0x109a70){logger[_0xf6d3('0x9')](_0xf6d3('0xa'),_0x1f33fc,JSON['stringify'](_0x109a70));logger[_0xf6d3('0xe')](_0xf6d3('0xf'),_0x1f33fc);})['finally'](function(){_0x115fd0['next']();});}}}catch(_0x4aa70a){logger[_0xf6d3('0x9')](_0xf6d3('0xa'),_0x1f33fc,_[_0xf6d3('0x17')](_0x4aa70a)?JSON[_0xf6d3('0x18')](_0x4aa70a):_0x4aa70a);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1f33fc);_0x115fd0[_0xf6d3('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index bd31efc..2f95624 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 _0xa892=['2.0','method','login','params','stringify','utf8','POST','application/json-rpc','parse','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title'];(function(_0x13847a,_0x35023f){var _0x3856d4=function(_0x578ebc){while(--_0x578ebc){_0x13847a['push'](_0x13847a['shift']());}};_0x3856d4(++_0x35023f);}(_0xa892,0x1e3));var _0x2a89=function(_0x212912,_0x33b682){_0x212912=_0x212912-0x0;var _0x56369c=_0xa892[_0x212912];return _0x56369c;};'use strict';var rp=require(_0x2a89('0x0'));var logger=require(_0x2a89('0x1'))(_0x2a89('0x2'));var _=require('lodash');var arr=[];exports[_0x2a89('0x3')]=function(_0x4b9273,_0x1b2ed1){return function(_0x33ce4a){var _0x473e55=_0x1b2ed1[0xa];var _0x144810=_0x1b2ed1[0xb];var _0x25c13f=_0x1b2ed1[0xc];var _0x37a462=_0x1b2ed1[0xd];var _0x2dd369=_0x1b2ed1[0xe];var _0x4e84ae=_0x1b2ed1[0xf][_0x2a89('0x4')](/\n/g,_0x2a89('0x5'));var _0x4c0d6c=_0x1b2ed1[0x10][_0x2a89('0x4')](/\n/g,'\x20');if(!arr[_0x2a89('0x6')](_0x144810)){arr[_0x2a89('0x7')](_0x144810);var _0x1ccb9d=_0x1b2ed1[0x3];var _0x121a3f=_0x1b2ed1[0x4];var _0x3abf41=_0x1b2ed1[0x1];var _0x54e90a=_0x1b2ed1[0x0];var _0x471bdb={};_0x471bdb[_0x2a89('0x8')]=_0x1b2ed1[0x8]+_0x2a89('0x9')+_0x25c13f+'|'+_0x473e55+'|'+_0x37a462+'|'+_0x144810+'|'+_0x2dd369;_0x471bdb[_0x2a89('0xa')]=_0x1b2ed1[0x7]+_0x2a89('0x9')+_0x25c13f+'|'+_0x473e55+'|'+_0x37a462+'|'+_0x144810+'|'+_0x2dd369+'|'+_0x4e84ae+'|'+_0x4c0d6c;_0x471bdb[_0x2a89('0xb')]=_0x1b2ed1[0x9];var _0x556bb1={};_0x556bb1['jsonrpc']=_0x2a89('0xc');_0x556bb1[_0x2a89('0xd')]=_0x2a89('0xe');var _0x22b59f=[];_0x22b59f[_0x2a89('0x7')](_0x1b2ed1[0x2]);_0x22b59f[_0x2a89('0x7')](_0x1b2ed1[0x5]);_0x22b59f['push'](_0x1b2ed1[0x6]);_0x556bb1[_0x2a89('0xf')]=_0x22b59f;_0x556bb1['id']=0x1;var _0x39b8d8=JSON[_0x2a89('0x10')](_0x556bb1);var _0x313851={'encoding':_0x2a89('0x11'),'method':_0x2a89('0x12'),'timeout':0x2710,'url':_0x1ccb9d,'headers':{'Content-Type':_0x2a89('0x13')},'body':_0x39b8d8};return rp(_0x313851)['then'](function(_0x1ccff3){const _0x8e426=JSON[_0x2a89('0x14')](_0x1ccff3);if(!_0x8e426['result']['logged']){throw new Error(_0x2a89('0x15'));}var _0x5ad5e1=_0x144810;var _0x56dd91=_0x2a89('0x16')+_0x3abf41+_0x2a89('0x17')+_0x54e90a+_0x2a89('0x18')+_0x5ad5e1+_0x2a89('0x19')+JSON[_0x2a89('0x10')](_0x471bdb);var _0x10c9e1=_0x121a3f+'?'+_0x56dd91;return rp(_0x10c9e1);})[_0x2a89('0x1a')](function(_0x23136f){logger[_0x2a89('0x1b')](_0x2a89('0x1c'),_0x4b9273,_0x23136f);_0x33ce4a[_0x2a89('0x1d')]();})['catch'](function(_0x576592){logger[_0x2a89('0x1e')]('[%s][TVOX]\x20%s',_0x4b9273,_[_0x2a89('0x1f')](_0x576592)?JSON['stringify'](_0x576592):_0x576592);_0x33ce4a[_0x2a89('0x1d')]();});}else{logger[_0x2a89('0x1b')](_0x2a89('0x20'),_0x4b9273);_0x33ce4a['next']();}};}; \ No newline at end of file +var _0x4588=['stop','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','stringify','utf8','POST','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error'];(function(_0x225074,_0x1abb16){var _0x3fb50c=function(_0xf22c61){while(--_0xf22c61){_0x225074['push'](_0x225074['shift']());}};_0x3fb50c(++_0x1abb16);}(_0x4588,0x1de));var _0x8458=function(_0x26e727,_0x3e65be){_0x26e727=_0x26e727-0x0;var _0x563800=_0x4588[_0x26e727];return _0x563800;};'use strict';var rp=require(_0x8458('0x0'));var logger=require(_0x8458('0x1'))(_0x8458('0x2'));var _=require(_0x8458('0x3'));var arr=[];exports[_0x8458('0x4')]=function(_0x2f191b,_0x285f7c){return function(_0x543da2){var _0x25cfe2=_0x285f7c[0xa];var _0x2a6ec0=_0x285f7c[0xb];var _0x40c275=_0x285f7c[0xc];var _0xdf5ebf=_0x285f7c[0xd];var _0x15a6b2=_0x285f7c[0xe];var _0x394061=_0x285f7c[0xf][_0x8458('0x5')](/\n/g,_0x8458('0x6'));var _0x572901=_0x285f7c[0x10][_0x8458('0x5')](/\n/g,'\x20');if(!arr[_0x8458('0x7')](_0x2a6ec0)){arr[_0x8458('0x8')](_0x2a6ec0);var _0x58d71f=_0x285f7c[0x3];var _0x4a0a53=_0x285f7c[0x4];var _0x4a7de9=_0x285f7c[0x1];var _0x260dcd=_0x285f7c[0x0];var _0x22692a={};_0x22692a[_0x8458('0x9')]=_0x285f7c[0x8]+_0x8458('0xa')+_0x40c275+'|'+_0x25cfe2+'|'+_0xdf5ebf+'|'+_0x2a6ec0+'|'+_0x15a6b2;_0x22692a[_0x8458('0xb')]=_0x285f7c[0x7]+_0x8458('0xa')+_0x40c275+'|'+_0x25cfe2+'|'+_0xdf5ebf+'|'+_0x2a6ec0+'|'+_0x15a6b2+'|'+_0x394061+'|'+_0x572901;_0x22692a[_0x8458('0xc')]=_0x285f7c[0x9];var _0x3abeca={};_0x3abeca[_0x8458('0xd')]=_0x8458('0xe');_0x3abeca[_0x8458('0xf')]=_0x8458('0x10');var _0x118364=[];_0x118364[_0x8458('0x8')](_0x285f7c[0x2]);_0x118364[_0x8458('0x8')](_0x285f7c[0x5]);_0x118364['push'](_0x285f7c[0x6]);_0x3abeca['params']=_0x118364;_0x3abeca['id']=0x1;var _0x4623c1=JSON[_0x8458('0x11')](_0x3abeca);var _0x5ca85d={'encoding':_0x8458('0x12'),'method':_0x8458('0x13'),'timeout':0x2710,'url':_0x58d71f,'headers':{'Content-Type':_0x8458('0x14')},'body':_0x4623c1};return rp(_0x5ca85d)[_0x8458('0x15')](function(_0xe2c7ac){const _0x18bb85=JSON[_0x8458('0x16')](_0xe2c7ac);if(!_0x18bb85[_0x8458('0x17')]['logged']){throw new Error(_0x8458('0x18'));}var _0x16bfe9=_0x2a6ec0;var _0x26900a=_0x8458('0x19')+_0x4a7de9+'&serviceId='+_0x260dcd+_0x8458('0x1a')+_0x16bfe9+_0x8458('0x1b')+JSON[_0x8458('0x11')](_0x22692a);var _0x29eeaa=_0x4a0a53+'?'+_0x26900a;return rp(_0x29eeaa);})['then'](function(_0x5c33e1){logger[_0x8458('0x1c')](_0x8458('0x1d'),_0x2f191b,_0x5c33e1);_0x543da2['stop']();})[_0x8458('0x1e')](function(_0x12d999){logger[_0x8458('0x1f')]('[%s][TVOX]\x20%s',_0x2f191b,_['isObject'](_0x12d999)?JSON[_0x8458('0x11')](_0x12d999):_0x12d999);_0x543da2[_0x8458('0x20')]();});}else{logger[_0x8458('0x1c')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x2f191b);_0x543da2[_0x8458('0x21')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index bf89718..aca8447 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x4f3e01,_0x4cc22c){var _0x5c9d17=function(_0x55a65f){while(--_0x55a65f){_0x4f3e01['push'](_0x4f3e01['shift']());}};_0x5c9d17(++_0x4cc22c);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x187f67,_0x381737){var _0x2d64b2=function(_0x41523b){while(--_0x41523b){_0x187f67['push'](_0x187f67['shift']());}};_0x2d64b2(++_0x381737);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 7fe9910..68a04c4 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 _0xfb0b=['intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','./applications/utils','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','map','Intervals','interval','listen','channel','message','checkWaitingNotifications','applications','isArray','length','existsSync','.js','app','autoreply','appdata','split','mail','push','slice','join','dialogflow','amazonlex','tvox','getMustacheRender','interaction','ContactId','body','%s:%s:%s','./interval','condition'];(function(_0x4186d6,_0x4f4129){var _0x154591=function(_0x2f5f3a){while(--_0x2f5f3a){_0x4186d6['push'](_0x4186d6['shift']());}};_0x154591(++_0x4f4129);}(_0xfb0b,0x94));var _0xbfb0=function(_0x4ee892,_0x29fcd9){_0x4ee892=_0x4ee892-0x0;var _0xcc472f=_0xfb0b[_0x4ee892];return _0xcc472f;};'use strict';var _=require(_0xbfb0('0x0'));var util=require(_0xbfb0('0x1'));var path=require(_0xbfb0('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xbfb0('0x3'));var utils=require(_0xbfb0('0x4'));var sUtils=require('./applications/strategy/util');var logger=require('../../../config/logger')(_0xbfb0('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xbfb0('0x6')),'chatQueueReport':require(_0xbfb0('0x7')),'smsQueueReport':require(_0xbfb0('0x8')),'faxQueueReport':require(_0xbfb0('0x9')),'whatsappQueueReport':require(_0xbfb0('0xa'))};var RuleEngine=require(_0xbfb0('0xb'));function getId(_0x52eba3,_0x3491c7,_0x1afe32){return util[_0xbfb0('0xc')](_0xbfb0('0xd'),_0x52eba3,_0x3491c7||0x0,_0x1afe32||0x0);}function getIntervals(_0x4c2cee,_0x50bb81){var _0x4cec81=[];if(!_['isNil'](_0x50bb81[_0xbfb0('0xe')])&&!_[_0xbfb0('0xf')](_0x4c2cee[_0x50bb81[_0xbfb0('0xe')]])&&!_['isNil'](_0x4c2cee[_0x50bb81[_0xbfb0('0xe')]]['Intervals'])){_0x4cec81=_[_0xbfb0('0x10')](_0x4c2cee[_0x50bb81[_0xbfb0('0xe')]][_0xbfb0('0x11')],_0xbfb0('0x12'));}else if(!_[_0xbfb0('0xf')](_0x50bb81[_0xbfb0('0x12')])){_0x4cec81=[_0x50bb81['interval']];}return _0x4cec81;}exports[_0xbfb0('0x13')]=function(_0x567237){_0x567237['rules']={};return new BPromise(function(_0x47e716,_0x141e62){var _0x2c9768={'Start':function(_0x198001){var _0x3617f3=this;return new Promise(function(_0x27f7a1,_0x213994){if(_0x198001){try{var _0x2470cf=[];var _0x2d8773=getId(_0x198001[_0xbfb0('0x14')],_0x198001[_0xbfb0('0x15')]?_0x198001[_0xbfb0('0x15')]['id']:0x0,_0x198001['interaction']?_0x198001['interaction']['id']:0x0);var _0x3319a1=sUtils[_0xbfb0('0x16')](_0x567237,_0x198001);if(_0x198001['transfer']||!_0x3319a1&&_0x198001[_0xbfb0('0x17')]&&_[_0xbfb0('0x18')](_0x198001['applications'])&&_0x198001[_0xbfb0('0x17')]['length']){for(var _0x5172c5=0x0;_0x5172c5<_0x198001[_0xbfb0('0x17')][_0xbfb0('0x19')];_0x5172c5+=0x1){var _0x14eae9=_0x198001['applications'][_0x5172c5];if(fs[_0xbfb0('0x1a')](path['join'](__dirname,_0xbfb0('0x17'),_0x14eae9['app']+_0xbfb0('0x1b')))){var _0x4cae5a=[];switch(_0x14eae9[_0xbfb0('0x1c')]['toLowerCase']()){case _0xbfb0('0x1d'):var _0x19e16d=_0x14eae9[_0xbfb0('0x1e')][_0xbfb0('0x1f')](',');if(_0x198001['channel']===_0xbfb0('0x20')){_0x4cae5a[_0xbfb0('0x21')](_0x19e16d[0x0]);_0x4cae5a['push'](_0x19e16d[0x1]);_0x4cae5a['push'](_0x19e16d[_0xbfb0('0x22')](0x2,_0x19e16d[_0xbfb0('0x19')])[_0xbfb0('0x23')](','));}else{_0x4cae5a['push'](_0x19e16d[0x0]);_0x4cae5a[_0xbfb0('0x21')](_0x19e16d['slice'](0x1,_0x19e16d[_0xbfb0('0x19')])[_0xbfb0('0x23')](','));}break;case _0xbfb0('0x24'):var _0x402db3=_0x14eae9[_0xbfb0('0x1e')][_0xbfb0('0x1f')](',');_0x4cae5a[_0xbfb0('0x21')](_0x402db3[0x0]);_0x4cae5a['push'](_0x402db3[0x1]);_0x4cae5a[_0xbfb0('0x21')](_0x402db3[_0xbfb0('0x22')](0x2,_0x402db3[_0xbfb0('0x19')])[_0xbfb0('0x23')](','));break;case'dialogflowv2':var _0x16d460=_0x14eae9[_0xbfb0('0x1e')]['split'](',');_0x4cae5a[_0xbfb0('0x21')](_0x16d460[0x0]);_0x4cae5a[_0xbfb0('0x21')](_0x16d460[0x1]);_0x4cae5a[_0xbfb0('0x21')](_0x16d460[0x2]);_0x4cae5a[_0xbfb0('0x21')](_0x16d460[0x3]);_0x4cae5a[_0xbfb0('0x21')](_0x16d460[_0xbfb0('0x22')](0x4,_0x16d460[_0xbfb0('0x19')])[_0xbfb0('0x23')](','));break;case _0xbfb0('0x25'):var _0x21fd7f=_0x14eae9[_0xbfb0('0x1e')][_0xbfb0('0x1f')](',');_0x4cae5a['push'](_0x21fd7f[0x0]);_0x4cae5a['push'](_0x21fd7f[0x1]);_0x4cae5a['push'](_0x21fd7f[0x2]);_0x4cae5a[_0xbfb0('0x21')](_0x21fd7f[0x3]);_0x4cae5a[_0xbfb0('0x21')](_0x21fd7f[_0xbfb0('0x22')](0x4,_0x21fd7f[_0xbfb0('0x19')])[_0xbfb0('0x23')](','));break;case _0xbfb0('0x15'):_0x4cae5a[_0xbfb0('0x21')](_0x14eae9[_0xbfb0('0x1e')]);break;case'tag':_0x4cae5a['push'](_0x14eae9['TagId']);_0x4cae5a[_0xbfb0('0x21')](_0x14eae9[_0xbfb0('0x1e')]);break;case _0xbfb0('0x26'):var _0x43122e=utils[_0xbfb0('0x27')](_0x198001['account']['notificationTemplate'],_0x198001);var _0x3f1814=_0x14eae9[_0xbfb0('0x1e')][_0xbfb0('0x1f')](',');_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x0]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x1]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x2]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x3]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x4]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x5]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x6]);_0x4cae5a['push'](_0x3f1814[0x7]);_0x4cae5a['push'](_0x3f1814[0x8]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x9]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0xa]);_0x4cae5a['push'](_0x198001[_0xbfb0('0x28')]['id']);_0x4cae5a['push'](_0x198001[_0xbfb0('0x15')]['id']);_0x4cae5a[_0xbfb0('0x21')](_0x14eae9['ChatWebsiteId']);_0x4cae5a['push'](_0x198001[_0xbfb0('0x28')][_0xbfb0('0x29')]);_0x4cae5a['push'](_0x198001[_0xbfb0('0x2a')]['body']);_0x4cae5a[_0xbfb0('0x21')](_0x43122e);break;default:_0x4cae5a=_['isNil'](_0x14eae9['appdata'])?[]:_0x14eae9[_0xbfb0('0x1e')][_0xbfb0('0x1f')](',');}var _0xca5b07={'id':util[_0xbfb0('0xc')](_0xbfb0('0x2b'),_0x2d8773,_0x14eae9['id'],_0x14eae9['app']),'condition':require(_0xbfb0('0x2c'))[_0xbfb0('0x2d')](_0x2d8773,getIntervals(_0x567237[_0xbfb0('0x2e')],_0x14eae9),_0x567237),'consequence':require(_0xbfb0('0x2f')+_0x14eae9[_0xbfb0('0x1c')])[_0xbfb0('0x30')](_0x2d8773,_0x4cae5a,_0x567237,_0x198001),'p':_0x14eae9[_0xbfb0('0x31')]||0x0};logger[_0xbfb0('0x32')](_0xbfb0('0x33'),_0xca5b07['id'],_0xbfb0('0x34'),getIntervals(_0x567237[_0xbfb0('0x2e')],_0x14eae9)[_0xbfb0('0x23')](_0xbfb0('0x35')));_0x2470cf[_0xbfb0('0x21')](_0xca5b07);}else{logger[_0xbfb0('0x36')](_0xbfb0('0x37'),path[_0xbfb0('0x23')](__dirname,_0xbfb0('0x17'),_0x14eae9['app']+_0xbfb0('0x1b')));}}_0x567237[_0xbfb0('0x38')][_0x2d8773]=new RuleEngine(_0x2470cf);_0x567237[_0xbfb0('0x38')][_0x2d8773][_0xbfb0('0x39')](_0x198001,function(_0x164141){logger[_0xbfb0('0x32')](_0xbfb0('0x3a'),JSON[_0xbfb0('0x3b')](_0x164141[_0xbfb0('0x3c')]));if(_0x567237[_0xbfb0('0x38')][_0x2d8773]){_0x567237['rules'][_0x2d8773]['emit'](_0xbfb0('0x3d'));}});return _0x27f7a1({'code':0xc8,'message':_0x198001});}else{if(_0x3319a1){logger[_0xbfb0('0x32')](util['format']('Skipped\x20routing\x20for\x20%s',_0x2d8773));}else{logger[_0xbfb0('0x32')](_0xbfb0('0x3e'));}return _0x27f7a1({'code':0xc8,'message':_0x198001});}}catch(_0x218cf8){logger[_0xbfb0('0x36')](_0x218cf8[_0xbfb0('0x3f')]);return _0x213994(_0x3617f3[_0xbfb0('0x36')](0x1f4,_0x218cf8));}}return _0x213994('routing\x20is\x20empty');});},'AcceptMessage':function(_0x519965){var _0x373e03=this;return new Promise(function(_0x13d881,_0x30aa57){if(_0x519965[_0xbfb0('0x40')]&&_0x519965[_0xbfb0('0x40')]['id']){if(_0x567237[_0xbfb0('0x41')][_0x519965[_0xbfb0('0x40')]['id']]){_0x567237[_0xbfb0('0x41')][_0x519965[_0xbfb0('0x40')]['id']][_0xbfb0('0x42')]=![];_0x567237[_0xbfb0('0x41')][_0x519965[_0xbfb0('0x40')]['id']][_0xbfb0('0x43')]=undefined;}}if(_0x519965[_0xbfb0('0x15')]&&_0x519965[_0xbfb0('0x15')]['id']){try{var _0x1b2c03=getId(_0x519965[_0xbfb0('0x14')],_0x519965[_0xbfb0('0x15')]?_0x519965[_0xbfb0('0x15')]['id']:0x0,_0x519965[_0xbfb0('0x28')]?_0x519965[_0xbfb0('0x28')]['id']:0x0);if(_0x567237[_0xbfb0('0x38')][_0x1b2c03]){_0x567237[_0xbfb0('0x38')][_0x1b2c03]['emit'](_0xbfb0('0x44'));if(rpc[_0x519965[_0xbfb0('0x14')]+_0xbfb0('0x45')]){rpc[_0x519965[_0xbfb0('0x14')]+_0xbfb0('0x45')][_0xbfb0('0x46')](_0x1b2c03,{'UserId':_0x519965[_0xbfb0('0x15')]['UserId']})[_0xbfb0('0x47')](function(){logger[_0xbfb0('0x36')](_0xbfb0('0x48'));});}}return _0x13d881({'code':0xc8,'message':_0x519965});}catch(_0x47de5e){logger[_0xbfb0('0x36')](_0x47de5e['stack']);return _0x30aa57(_0x373e03[_0xbfb0('0x36')](0x1f4,_0x47de5e));}}logger[_0xbfb0('0x36')](_0xbfb0('0x49'));return _0x30aa57(_0x373e03[_0xbfb0('0x36')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x2539e9){var _0x455a5f=this;return new Promise(function(_0x4871a4,_0x18174b){if(_0x2539e9[_0xbfb0('0x40')]&&_0x2539e9['agent']['id']){try{if(_0x567237['agents'][_0x2539e9['agent']['id']]){_0x567237[_0xbfb0('0x41')][_0x2539e9[_0xbfb0('0x40')]['id']]['busy']=![];_0x567237[_0xbfb0('0x41')][_0x2539e9[_0xbfb0('0x40')]['id']][_0xbfb0('0x43')]=undefined;}return _0x4871a4({'code':0xc8,'message':_0x2539e9});}catch(_0x3a79bb){logger['error'](_0x3a79bb[_0xbfb0('0x3f')]);return _0x18174b(_0x455a5f[_0xbfb0('0x36')](0x1f4,_0x3a79bb));}}logger[_0xbfb0('0x36')]('message\x20is\x20empty');return _0x18174b(_0x455a5f['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x49c7d5){var _0xd0a7aa=this;return new Promise(function(_0x465925,_0x1dbe39){if(_0x49c7d5[_0xbfb0('0x14')]&&_0x49c7d5[_0xbfb0('0x28')]&&_0x49c7d5[_0xbfb0('0x28')]['id']){try{var _0x228e38=getId(_0x49c7d5['channel'],_0x49c7d5[_0xbfb0('0x15')]?_0x49c7d5[_0xbfb0('0x15')]['id']:0x0,_0x49c7d5[_0xbfb0('0x28')]?_0x49c7d5[_0xbfb0('0x28')]['id']:0x0);if(_0x567237[_0xbfb0('0x38')][_0x228e38]){_0x567237[_0xbfb0('0x38')][_0x228e38]['emit'](_0xbfb0('0x44'));}return _0x465925({'code':0xc8,'message':_0x49c7d5});}catch(_0x459f45){logger['error'](_0x459f45[_0xbfb0('0x3f')]);return _0x1dbe39(_0xd0a7aa[_0xbfb0('0x36')](0x1f4,_0x459f45));}}logger[_0xbfb0('0x36')](_0xbfb0('0x49'));return _0x1dbe39(_0xd0a7aa['error'](0x1f4,_0xbfb0('0x49')));});},'AgentCapacity':function(_0x1dda6d){var _0xd10ab9=this;return new Promise(function(_0x16c8aa,_0x41f701){if(_0x567237[_0xbfb0('0x41')]['hasOwnProperty'](_0x1dda6d['id'])){for(var _0xb146d in _0x1dda6d[_0xbfb0('0x4a')]){if(_0x1dda6d[_0xbfb0('0x4a')][_0xbfb0('0x4b')](_0xb146d)){if(_0x567237[_0xbfb0('0x41')][_0x1dda6d['id']]['hasOwnProperty'](_0xb146d+_0xbfb0('0x4c'))){_0x567237[_0xbfb0('0x41')][_0x1dda6d['id']][_0xb146d+_0xbfb0('0x4c')]=parseInt(_0x1dda6d['capacity'][_0xb146d],0xa);}}}_0x567237[_0xbfb0('0x41')][_0x1dda6d['id']]['updateRealtime']();return _0x16c8aa({'code':0xc8,'message':_0x567237[_0xbfb0('0x41')][_0x1dda6d['id']]});}else{return _0x41f701(_0xd10ab9[_0xbfb0('0x36')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x22a70f){return new Promise(function(_0x2ef113){var _0x497e59=_['values'](_0x567237[_0xbfb0('0x41')]);if(_0x22a70f&&_0x22a70f['id']){var _0x5f1f72=_['find'](_0x497e59,function(_0x21ebc0){return _0x21ebc0['id']===_0x22a70f['id'];});_0x2ef113(_0x5f1f72);}else{_0x2ef113({'count':_0x497e59[_0xbfb0('0x19')],'rows':_0x497e59});}});},'ChatQueues':function(){return new Promise(function(_0x30d6a4){var _0x200981=[];for(var _0x50123a in _0x567237['chatQueues']){if(_0x567237[_0xbfb0('0x4d')]['hasOwnProperty'](_0x50123a)){var _0x51a383=_0x567237[_0xbfb0('0x4d')][_0x50123a];var _0x3dd8ec={'id':_0x51a383['id'],'available':_0x51a383[_0xbfb0('0x4e')],'loggedIn':_0x51a383[_0xbfb0('0x4f')],'name':_0x51a383[_0xbfb0('0x50')],'paused':_0x51a383[_0xbfb0('0x51')],'waiting':_0x51a383['waiting']};_0x200981[_0xbfb0('0x21')](_0x3dd8ec);}}_0x30d6a4({'count':_0x200981[_0xbfb0('0x19')],'rows':_0x200981});});},'MailQueues':function(){return new Promise(function(_0x15c180){var _0x14645=[];for(var _0x3061fb in _0x567237[_0xbfb0('0x52')]){if(_0x567237[_0xbfb0('0x52')]['hasOwnProperty'](_0x3061fb)){var _0x11b9b9=_0x567237[_0xbfb0('0x52')][_0x3061fb];var _0xa02372={'id':_0x11b9b9['id'],'available':_0x11b9b9['available'],'loggedIn':_0x11b9b9[_0xbfb0('0x4f')],'name':_0x11b9b9[_0xbfb0('0x50')],'paused':_0x11b9b9[_0xbfb0('0x51')],'waiting':_0x11b9b9[_0xbfb0('0x53')]};_0x14645[_0xbfb0('0x21')](_0xa02372);}}_0x15c180({'count':_0x14645['length'],'rows':_0x14645});});},'OpenchannelQueues':function(){return new Promise(function(_0xa3db83){var _0x32e1c6=[];for(var _0x4e58dc in _0x567237['openchannelQueues']){if(_0x567237['openchannelQueues'][_0xbfb0('0x4b')](_0x4e58dc)){var _0x196d99=_0x567237[_0xbfb0('0x54')][_0x4e58dc];var _0x3a694c={'id':_0x196d99['id'],'available':_0x196d99['available'],'loggedIn':_0x196d99[_0xbfb0('0x4f')],'name':_0x196d99[_0xbfb0('0x50')],'paused':_0x196d99[_0xbfb0('0x51')],'waiting':_0x196d99[_0xbfb0('0x53')]};_0x32e1c6[_0xbfb0('0x21')](_0x3a694c);}}_0xa3db83({'count':_0x32e1c6[_0xbfb0('0x19')],'rows':_0x32e1c6});});},'SmsQueues':function(){return new Promise(function(_0x398e76){var _0x38dc74=[];for(var _0x342f24 in _0x567237[_0xbfb0('0x55')]){if(_0x567237[_0xbfb0('0x55')][_0xbfb0('0x4b')](_0x342f24)){var _0x151509=_0x567237['smsQueues'][_0x342f24];var _0x25528e={'id':_0x151509['id'],'available':_0x151509[_0xbfb0('0x4e')],'loggedIn':_0x151509[_0xbfb0('0x4f')],'name':_0x151509[_0xbfb0('0x50')],'paused':_0x151509['paused'],'waiting':_0x151509[_0xbfb0('0x53')]};_0x38dc74['push'](_0x25528e);}}_0x398e76({'count':_0x38dc74[_0xbfb0('0x19')],'rows':_0x38dc74});});},'FaxQueues':function(){return new Promise(function(_0x281b9a){var _0x1c05e7=[];for(var _0x5a05ae in _0x567237[_0xbfb0('0x56')]){if(_0x567237[_0xbfb0('0x56')][_0xbfb0('0x4b')](_0x5a05ae)){var _0x1e21ce=_0x567237['faxQueues'][_0x5a05ae];var _0x1fda13={'id':_0x1e21ce['id'],'available':_0x1e21ce[_0xbfb0('0x4e')],'loggedIn':_0x1e21ce['loggedIn'],'name':_0x1e21ce[_0xbfb0('0x50')],'paused':_0x1e21ce[_0xbfb0('0x51')],'waiting':_0x1e21ce[_0xbfb0('0x53')]};_0x1c05e7[_0xbfb0('0x21')](_0x1fda13);}}_0x281b9a({'count':_0x1c05e7['length'],'rows':_0x1c05e7});});},'WhatsappQueues':function(){return new Promise(function(_0x57452a){var _0x373ecc=[];for(var _0x3d0f43 in _0x567237[_0xbfb0('0x57')]){if(_0x567237['whatsappQueues'][_0xbfb0('0x4b')](_0x3d0f43)){var _0x1173b7=_0x567237['whatsappQueues'][_0x3d0f43];var _0x349ec0={'id':_0x1173b7['id'],'available':_0x1173b7[_0xbfb0('0x4e')],'loggedIn':_0x1173b7[_0xbfb0('0x4f')],'name':_0x1173b7[_0xbfb0('0x50')],'paused':_0x1173b7[_0xbfb0('0x51')],'waiting':_0x1173b7[_0xbfb0('0x53')]};_0x373ecc[_0xbfb0('0x21')](_0x349ec0);}}_0x57452a({'count':_0x373ecc[_0xbfb0('0x19')],'rows':_0x373ecc});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x5ca437){var _0x3ad529=_[_0xbfb0('0x58')](_0x567237[_0xbfb0('0x59')]);_0x5ca437({'count':_0x3ad529[_0xbfb0('0x19')],'rows':_0x3ad529});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1e8862){var _0x57f6b2=_[_0xbfb0('0x58')](_0x567237[_0xbfb0('0x5a')]);_0x1e8862({'count':_0x57f6b2[_0xbfb0('0x19')],'rows':_0x57f6b2});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1124ce){var _0x8660f3=_[_0xbfb0('0x58')](_0x567237[_0xbfb0('0x5b')]);_0x1124ce({'count':_0x8660f3['length'],'rows':_0x8660f3});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x8db0a8){var _0xfcc297=_[_0xbfb0('0x58')](_0x567237[_0xbfb0('0x5c')]);_0x8db0a8({'count':_0xfcc297['length'],'rows':_0xfcc297});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x211ae2){var _0x7ca2e6=_['values'](_0x567237['faxQueuesWaitingInteractions']);_0x211ae2({'count':_0x7ca2e6['length'],'rows':_0x7ca2e6});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x49b184){var _0x1e2e67=_['values'](_0x567237['whatsappQueuesWaitingInteractions']);_0x49b184({'count':_0x1e2e67[_0xbfb0('0x19')],'rows':_0x1e2e67});});}};var _0x5a4a4a=jayson['server'](_0x2c9768)[_0xbfb0('0x5d')]();_0x5a4a4a['on'](_0xbfb0('0x36'),function(_0x5eeeb3){logger[_0xbfb0('0x36')](JSON[_0xbfb0('0x3b')](_0x5eeeb3));return _0x141e62(_0x5eeeb3);});_0x5a4a4a['listen'](0x232c,_0xbfb0('0x5e'),function(){console[_0xbfb0('0x5f')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x47e716(_0xbfb0('0x60')+0x232c);});});}; \ No newline at end of file +var _0x4d1b=['TagId','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','app','./interval','condition','intervals','./applications/','priority','info','on\x20interval','\x20|\x20','Applications\x20executed','stringify','emit','complete','format','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','openchannelQueues','name','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','./applications/utils','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','length','existsSync','toLowerCase','appdata','split','mail','push','slice','join','dialogflow','dialogflowv2','amazonlex','tag'];(function(_0x15166d,_0x3f5651){var _0x26c65d=function(_0x3f3963){while(--_0x3f3963){_0x15166d['push'](_0x15166d['shift']());}};_0x26c65d(++_0x3f5651);}(_0x4d1b,0x102));var _0xb4d1=function(_0x32a884,_0x183853){_0x32a884=_0x32a884-0x0;var _0x242f9b=_0x4d1b[_0x32a884];return _0x242f9b;};'use strict';var _=require(_0xb4d1('0x0'));var util=require('util');var path=require(_0xb4d1('0x1'));var fs=require('fs');var jayson=require(_0xb4d1('0x2'));var BPromise=require(_0xb4d1('0x3'));var utils=require(_0xb4d1('0x4'));var sUtils=require('./applications/strategy/util');var logger=require(_0xb4d1('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0xb4d1('0x6')),'mailQueueReport':require(_0xb4d1('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xb4d1('0x8')),'faxQueueReport':require(_0xb4d1('0x9')),'whatsappQueueReport':require(_0xb4d1('0xa'))};var RuleEngine=require(_0xb4d1('0xb'));function getId(_0x49437b,_0x1e09fb,_0x205fe1){return util['format'](_0xb4d1('0xc'),_0x49437b,_0x1e09fb||0x0,_0x205fe1||0x0);}function getIntervals(_0x23c12e,_0xf3010d){var _0xfc12a6=[];if(!_[_0xb4d1('0xd')](_0xf3010d[_0xb4d1('0xe')])&&!_['isNil'](_0x23c12e[_0xf3010d[_0xb4d1('0xe')]])&&!_[_0xb4d1('0xd')](_0x23c12e[_0xf3010d[_0xb4d1('0xe')]][_0xb4d1('0xf')])){_0xfc12a6=_[_0xb4d1('0x10')](_0x23c12e[_0xf3010d[_0xb4d1('0xe')]][_0xb4d1('0xf')],_0xb4d1('0x11'));}else if(!_[_0xb4d1('0xd')](_0xf3010d[_0xb4d1('0x11')])){_0xfc12a6=[_0xf3010d[_0xb4d1('0x11')]];}return _0xfc12a6;}exports[_0xb4d1('0x12')]=function(_0x3baccd){_0x3baccd[_0xb4d1('0x13')]={};return new BPromise(function(_0x37cb4c,_0x295264){var _0x3ba994={'Start':function(_0x36c711){var _0x2599fd=this;return new Promise(function(_0x433e6d,_0x4987d1){if(_0x36c711){try{var _0x513886=[];var _0x785af3=getId(_0x36c711[_0xb4d1('0x14')],_0x36c711['message']?_0x36c711[_0xb4d1('0x15')]['id']:0x0,_0x36c711[_0xb4d1('0x16')]?_0x36c711['interaction']['id']:0x0);var _0x388798=sUtils[_0xb4d1('0x17')](_0x3baccd,_0x36c711);if(_0x36c711[_0xb4d1('0x18')]||!_0x388798&&_0x36c711['applications']&&_['isArray'](_0x36c711[_0xb4d1('0x19')])&&_0x36c711['applications']['length']){for(var _0x459615=0x0;_0x459615<_0x36c711[_0xb4d1('0x19')][_0xb4d1('0x1a')];_0x459615+=0x1){var _0x136d10=_0x36c711['applications'][_0x459615];if(fs[_0xb4d1('0x1b')](path['join'](__dirname,'applications',_0x136d10['app']+'.js'))){var _0x41fa10=[];switch(_0x136d10['app'][_0xb4d1('0x1c')]()){case'autoreply':var _0x3fe374=_0x136d10[_0xb4d1('0x1d')][_0xb4d1('0x1e')](',');if(_0x36c711[_0xb4d1('0x14')]===_0xb4d1('0x1f')){_0x41fa10['push'](_0x3fe374[0x0]);_0x41fa10[_0xb4d1('0x20')](_0x3fe374[0x1]);_0x41fa10[_0xb4d1('0x20')](_0x3fe374[_0xb4d1('0x21')](0x2,_0x3fe374[_0xb4d1('0x1a')])[_0xb4d1('0x22')](','));}else{_0x41fa10['push'](_0x3fe374[0x0]);_0x41fa10[_0xb4d1('0x20')](_0x3fe374[_0xb4d1('0x21')](0x1,_0x3fe374[_0xb4d1('0x1a')])[_0xb4d1('0x22')](','));}break;case _0xb4d1('0x23'):var _0x3721fb=_0x136d10['appdata']['split'](',');_0x41fa10[_0xb4d1('0x20')](_0x3721fb[0x0]);_0x41fa10[_0xb4d1('0x20')](_0x3721fb[0x1]);_0x41fa10[_0xb4d1('0x20')](_0x3721fb[_0xb4d1('0x21')](0x2,_0x3721fb['length'])[_0xb4d1('0x22')](','));break;case _0xb4d1('0x24'):var _0x307abe=_0x136d10[_0xb4d1('0x1d')][_0xb4d1('0x1e')](',');_0x41fa10[_0xb4d1('0x20')](_0x307abe[0x0]);_0x41fa10[_0xb4d1('0x20')](_0x307abe[0x1]);_0x41fa10[_0xb4d1('0x20')](_0x307abe[0x2]);_0x41fa10['push'](_0x307abe[0x3]);_0x41fa10[_0xb4d1('0x20')](_0x307abe[_0xb4d1('0x21')](0x4,_0x307abe[_0xb4d1('0x1a')])['join'](','));break;case _0xb4d1('0x25'):var _0x516dd7=_0x136d10[_0xb4d1('0x1d')][_0xb4d1('0x1e')](',');_0x41fa10[_0xb4d1('0x20')](_0x516dd7[0x0]);_0x41fa10[_0xb4d1('0x20')](_0x516dd7[0x1]);_0x41fa10[_0xb4d1('0x20')](_0x516dd7[0x2]);_0x41fa10[_0xb4d1('0x20')](_0x516dd7[0x3]);_0x41fa10[_0xb4d1('0x20')](_0x516dd7[_0xb4d1('0x21')](0x4,_0x516dd7[_0xb4d1('0x1a')])[_0xb4d1('0x22')](','));break;case _0xb4d1('0x15'):_0x41fa10[_0xb4d1('0x20')](_0x136d10['appdata']);break;case _0xb4d1('0x26'):_0x41fa10[_0xb4d1('0x20')](_0x136d10[_0xb4d1('0x27')]);_0x41fa10[_0xb4d1('0x20')](_0x136d10[_0xb4d1('0x1d')]);break;case'tvox':var _0x2d90d3=utils[_0xb4d1('0x28')](_0x36c711['account'][_0xb4d1('0x29')],_0x36c711);var _0x32f321=_0x136d10[_0xb4d1('0x1d')]['split'](',');_0x41fa10['push'](_0x32f321[0x0]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x1]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x2]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x3]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x4]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x5]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x6]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x7]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x8]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0x9]);_0x41fa10[_0xb4d1('0x20')](_0x32f321[0xa]);_0x41fa10[_0xb4d1('0x20')](_0x36c711[_0xb4d1('0x16')]['id']);_0x41fa10[_0xb4d1('0x20')](_0x36c711[_0xb4d1('0x15')]['id']);_0x41fa10['push'](_0x136d10[_0xb4d1('0x2a')]);_0x41fa10[_0xb4d1('0x20')](_0x36c711[_0xb4d1('0x16')][_0xb4d1('0x2b')]);_0x41fa10[_0xb4d1('0x20')](_0x36c711[_0xb4d1('0x2c')][_0xb4d1('0x2c')]);_0x41fa10[_0xb4d1('0x20')](_0x2d90d3);break;default:_0x41fa10=_[_0xb4d1('0xd')](_0x136d10[_0xb4d1('0x1d')])?[]:_0x136d10[_0xb4d1('0x1d')][_0xb4d1('0x1e')](',');}var _0x2fbaf1={'id':util['format']('%s:%s:%s',_0x785af3,_0x136d10['id'],_0x136d10[_0xb4d1('0x2d')]),'condition':require(_0xb4d1('0x2e'))[_0xb4d1('0x2f')](_0x785af3,getIntervals(_0x3baccd[_0xb4d1('0x30')],_0x136d10),_0x3baccd),'consequence':require(_0xb4d1('0x31')+_0x136d10['app'])['consequence'](_0x785af3,_0x41fa10,_0x3baccd,_0x36c711),'p':_0x136d10[_0xb4d1('0x32')]||0x0};logger[_0xb4d1('0x33')]('Push\x20new\x20rule',_0x2fbaf1['id'],_0xb4d1('0x34'),getIntervals(_0x3baccd[_0xb4d1('0x30')],_0x136d10)['join'](_0xb4d1('0x35')));_0x513886[_0xb4d1('0x20')](_0x2fbaf1);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0xb4d1('0x19'),_0x136d10[_0xb4d1('0x2d')]+'.js'));}}_0x3baccd[_0xb4d1('0x13')][_0x785af3]=new RuleEngine(_0x513886);_0x3baccd[_0xb4d1('0x13')][_0x785af3]['execute'](_0x36c711,function(_0x576f0a){logger[_0xb4d1('0x33')](_0xb4d1('0x36'),JSON[_0xb4d1('0x37')](_0x576f0a['matchPath']));if(_0x3baccd[_0xb4d1('0x13')][_0x785af3]){_0x3baccd[_0xb4d1('0x13')][_0x785af3][_0xb4d1('0x38')](_0xb4d1('0x39'));}});return _0x433e6d({'code':0xc8,'message':_0x36c711});}else{if(_0x388798){logger['info'](util[_0xb4d1('0x3a')](_0xb4d1('0x3b'),_0x785af3));}else{logger[_0xb4d1('0x33')](_0xb4d1('0x3c'));}return _0x433e6d({'code':0xc8,'message':_0x36c711});}}catch(_0x362b77){logger[_0xb4d1('0x3d')](_0x362b77[_0xb4d1('0x3e')]);return _0x4987d1(_0x2599fd[_0xb4d1('0x3d')](0x1f4,_0x362b77));}}return _0x4987d1(_0xb4d1('0x3f'));});},'AcceptMessage':function(_0x19e006){var _0x3f0dcf=this;return new Promise(function(_0x576902,_0x3eeea7){if(_0x19e006[_0xb4d1('0x40')]&&_0x19e006[_0xb4d1('0x40')]['id']){if(_0x3baccd[_0xb4d1('0x41')][_0x19e006[_0xb4d1('0x40')]['id']]){_0x3baccd['agents'][_0x19e006[_0xb4d1('0x40')]['id']][_0xb4d1('0x42')]=![];_0x3baccd[_0xb4d1('0x41')][_0x19e006[_0xb4d1('0x40')]['id']][_0xb4d1('0x43')]=undefined;}}if(_0x19e006[_0xb4d1('0x15')]&&_0x19e006[_0xb4d1('0x15')]['id']){try{var _0x57e935=getId(_0x19e006[_0xb4d1('0x14')],_0x19e006[_0xb4d1('0x15')]?_0x19e006[_0xb4d1('0x15')]['id']:0x0,_0x19e006['interaction']?_0x19e006[_0xb4d1('0x16')]['id']:0x0);if(_0x3baccd[_0xb4d1('0x13')][_0x57e935]){_0x3baccd[_0xb4d1('0x13')][_0x57e935][_0xb4d1('0x38')](_0xb4d1('0x44'));if(rpc[_0x19e006['channel']+_0xb4d1('0x45')]){rpc[_0x19e006[_0xb4d1('0x14')]+_0xb4d1('0x45')][_0xb4d1('0x46')](_0x57e935,{'UserId':_0x19e006[_0xb4d1('0x15')][_0xb4d1('0x47')]})[_0xb4d1('0x48')](function(){logger['error']('error\x20update\x20queue\x20report');});}}return _0x576902({'code':0xc8,'message':_0x19e006});}catch(_0x5e529a){logger[_0xb4d1('0x3d')](_0x5e529a[_0xb4d1('0x3e')]);return _0x3eeea7(_0x3f0dcf['error'](0x1f4,_0x5e529a));}}logger[_0xb4d1('0x3d')]('message\x20is\x20empty');return _0x3eeea7(_0x3f0dcf[_0xb4d1('0x3d')](0x1f4,_0xb4d1('0x49')));});},'RejectMessage':function(_0xcf7067){var _0x4254cc=this;return new Promise(function(_0x21ef5b,_0xa733df){if(_0xcf7067[_0xb4d1('0x40')]&&_0xcf7067['agent']['id']){try{if(_0x3baccd[_0xb4d1('0x41')][_0xcf7067[_0xb4d1('0x40')]['id']]){_0x3baccd[_0xb4d1('0x41')][_0xcf7067[_0xb4d1('0x40')]['id']]['busy']=![];_0x3baccd[_0xb4d1('0x41')][_0xcf7067[_0xb4d1('0x40')]['id']][_0xb4d1('0x43')]=undefined;}return _0x21ef5b({'code':0xc8,'message':_0xcf7067});}catch(_0x1a9b79){logger[_0xb4d1('0x3d')](_0x1a9b79['stack']);return _0xa733df(_0x4254cc[_0xb4d1('0x3d')](0x1f4,_0x1a9b79));}}logger[_0xb4d1('0x3d')](_0xb4d1('0x49'));return _0xa733df(_0x4254cc[_0xb4d1('0x3d')](0x1f4,_0xb4d1('0x49')));});},'AbandonInteraction':function(_0x446498){var _0x51fff9=this;return new Promise(function(_0x259667,_0xe788d8){if(_0x446498['channel']&&_0x446498[_0xb4d1('0x16')]&&_0x446498[_0xb4d1('0x16')]['id']){try{var _0x1898e9=getId(_0x446498[_0xb4d1('0x14')],_0x446498[_0xb4d1('0x15')]?_0x446498[_0xb4d1('0x15')]['id']:0x0,_0x446498[_0xb4d1('0x16')]?_0x446498[_0xb4d1('0x16')]['id']:0x0);if(_0x3baccd[_0xb4d1('0x13')][_0x1898e9]){_0x3baccd[_0xb4d1('0x13')][_0x1898e9][_0xb4d1('0x38')](_0xb4d1('0x44'));}return _0x259667({'code':0xc8,'message':_0x446498});}catch(_0x1e4f6e){logger[_0xb4d1('0x3d')](_0x1e4f6e[_0xb4d1('0x3e')]);return _0xe788d8(_0x51fff9[_0xb4d1('0x3d')](0x1f4,_0x1e4f6e));}}logger['error'](_0xb4d1('0x49'));return _0xe788d8(_0x51fff9[_0xb4d1('0x3d')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x46e9e1){var _0x34cfff=this;return new Promise(function(_0x18b9ab,_0x4ec3d6){if(_0x3baccd[_0xb4d1('0x41')]['hasOwnProperty'](_0x46e9e1['id'])){for(var _0x2c1166 in _0x46e9e1[_0xb4d1('0x4a')]){if(_0x46e9e1[_0xb4d1('0x4a')][_0xb4d1('0x4b')](_0x2c1166)){if(_0x3baccd[_0xb4d1('0x41')][_0x46e9e1['id']][_0xb4d1('0x4b')](_0x2c1166+_0xb4d1('0x4c'))){_0x3baccd[_0xb4d1('0x41')][_0x46e9e1['id']][_0x2c1166+_0xb4d1('0x4c')]=parseInt(_0x46e9e1[_0xb4d1('0x4a')][_0x2c1166],0xa);}}}_0x3baccd[_0xb4d1('0x41')][_0x46e9e1['id']]['updateRealtime']();return _0x18b9ab({'code':0xc8,'message':_0x3baccd['agents'][_0x46e9e1['id']]});}else{return _0x4ec3d6(_0x34cfff[_0xb4d1('0x3d')](0x1f4,_0xb4d1('0x4d')));}});},'Agents':function(_0x1da2cb){return new Promise(function(_0x465623){var _0x16fc0e=_[_0xb4d1('0x4e')](_0x3baccd[_0xb4d1('0x41')]);if(_0x1da2cb&&_0x1da2cb['id']){var _0x5733ca=_['find'](_0x16fc0e,function(_0x3211c6){return _0x3211c6['id']===_0x1da2cb['id'];});_0x465623(_0x5733ca);}else{_0x465623({'count':_0x16fc0e[_0xb4d1('0x1a')],'rows':_0x16fc0e});}});},'ChatQueues':function(){return new Promise(function(_0x2cd71c){var _0x11bea3=[];for(var _0x17d1fa in _0x3baccd[_0xb4d1('0x4f')]){if(_0x3baccd[_0xb4d1('0x4f')][_0xb4d1('0x4b')](_0x17d1fa)){var _0x4ce9d4=_0x3baccd[_0xb4d1('0x4f')][_0x17d1fa];var _0x54204={'id':_0x4ce9d4['id'],'available':_0x4ce9d4[_0xb4d1('0x50')],'loggedIn':_0x4ce9d4[_0xb4d1('0x51')],'name':_0x4ce9d4['name'],'paused':_0x4ce9d4[_0xb4d1('0x52')],'waiting':_0x4ce9d4[_0xb4d1('0x53')]};_0x11bea3[_0xb4d1('0x20')](_0x54204);}}_0x2cd71c({'count':_0x11bea3[_0xb4d1('0x1a')],'rows':_0x11bea3});});},'MailQueues':function(){return new Promise(function(_0x37244b){var _0x1db58c=[];for(var _0x25495e in _0x3baccd[_0xb4d1('0x54')]){if(_0x3baccd[_0xb4d1('0x54')][_0xb4d1('0x4b')](_0x25495e)){var _0x1303f5=_0x3baccd[_0xb4d1('0x54')][_0x25495e];var _0x38e0ee={'id':_0x1303f5['id'],'available':_0x1303f5[_0xb4d1('0x50')],'loggedIn':_0x1303f5[_0xb4d1('0x51')],'name':_0x1303f5['name'],'paused':_0x1303f5[_0xb4d1('0x52')],'waiting':_0x1303f5[_0xb4d1('0x53')]};_0x1db58c['push'](_0x38e0ee);}}_0x37244b({'count':_0x1db58c['length'],'rows':_0x1db58c});});},'OpenchannelQueues':function(){return new Promise(function(_0x5f4c77){var _0x74487e=[];for(var _0x2eccff in _0x3baccd[_0xb4d1('0x55')]){if(_0x3baccd[_0xb4d1('0x55')][_0xb4d1('0x4b')](_0x2eccff)){var _0x871af3=_0x3baccd['openchannelQueues'][_0x2eccff];var _0x3305a0={'id':_0x871af3['id'],'available':_0x871af3['available'],'loggedIn':_0x871af3[_0xb4d1('0x51')],'name':_0x871af3['name'],'paused':_0x871af3[_0xb4d1('0x52')],'waiting':_0x871af3[_0xb4d1('0x53')]};_0x74487e[_0xb4d1('0x20')](_0x3305a0);}}_0x5f4c77({'count':_0x74487e[_0xb4d1('0x1a')],'rows':_0x74487e});});},'SmsQueues':function(){return new Promise(function(_0x316d2f){var _0x5d9074=[];for(var _0x202fab in _0x3baccd['smsQueues']){if(_0x3baccd['smsQueues'][_0xb4d1('0x4b')](_0x202fab)){var _0x14bfbe=_0x3baccd['smsQueues'][_0x202fab];var _0x5bf701={'id':_0x14bfbe['id'],'available':_0x14bfbe['available'],'loggedIn':_0x14bfbe[_0xb4d1('0x51')],'name':_0x14bfbe[_0xb4d1('0x56')],'paused':_0x14bfbe['paused'],'waiting':_0x14bfbe[_0xb4d1('0x53')]};_0x5d9074['push'](_0x5bf701);}}_0x316d2f({'count':_0x5d9074[_0xb4d1('0x1a')],'rows':_0x5d9074});});},'FaxQueues':function(){return new Promise(function(_0x2031d2){var _0x1cd16b=[];for(var _0x31bee3 in _0x3baccd['faxQueues']){if(_0x3baccd[_0xb4d1('0x57')][_0xb4d1('0x4b')](_0x31bee3)){var _0x3900f8=_0x3baccd[_0xb4d1('0x57')][_0x31bee3];var _0x15871c={'id':_0x3900f8['id'],'available':_0x3900f8[_0xb4d1('0x50')],'loggedIn':_0x3900f8['loggedIn'],'name':_0x3900f8['name'],'paused':_0x3900f8['paused'],'waiting':_0x3900f8[_0xb4d1('0x53')]};_0x1cd16b[_0xb4d1('0x20')](_0x15871c);}}_0x2031d2({'count':_0x1cd16b[_0xb4d1('0x1a')],'rows':_0x1cd16b});});},'WhatsappQueues':function(){return new Promise(function(_0x398f6f){var _0x10078e=[];for(var _0x5edbf2 in _0x3baccd[_0xb4d1('0x58')]){if(_0x3baccd[_0xb4d1('0x58')][_0xb4d1('0x4b')](_0x5edbf2)){var _0x58c4aa=_0x3baccd[_0xb4d1('0x58')][_0x5edbf2];var _0xe45d7f={'id':_0x58c4aa['id'],'available':_0x58c4aa['available'],'loggedIn':_0x58c4aa[_0xb4d1('0x51')],'name':_0x58c4aa[_0xb4d1('0x56')],'paused':_0x58c4aa[_0xb4d1('0x52')],'waiting':_0x58c4aa[_0xb4d1('0x53')]};_0x10078e[_0xb4d1('0x20')](_0xe45d7f);}}_0x398f6f({'count':_0x10078e['length'],'rows':_0x10078e});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x15285a){var _0xa35671=_[_0xb4d1('0x4e')](_0x3baccd[_0xb4d1('0x59')]);_0x15285a({'count':_0xa35671['length'],'rows':_0xa35671});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1db69a){var _0x2b41d9=_[_0xb4d1('0x4e')](_0x3baccd[_0xb4d1('0x5a')]);_0x1db69a({'count':_0x2b41d9[_0xb4d1('0x1a')],'rows':_0x2b41d9});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x4fc3db){var _0x263e22=_[_0xb4d1('0x4e')](_0x3baccd[_0xb4d1('0x5b')]);_0x4fc3db({'count':_0x263e22['length'],'rows':_0x263e22});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2cd804){var _0x358dae=_['values'](_0x3baccd[_0xb4d1('0x5c')]);_0x2cd804({'count':_0x358dae[_0xb4d1('0x1a')],'rows':_0x358dae});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4adc46){var _0x567962=_['values'](_0x3baccd[_0xb4d1('0x5d')]);_0x4adc46({'count':_0x567962['length'],'rows':_0x567962});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1d3435){var _0x29d8dc=_[_0xb4d1('0x4e')](_0x3baccd[_0xb4d1('0x5e')]);_0x1d3435({'count':_0x29d8dc[_0xb4d1('0x1a')],'rows':_0x29d8dc});});}};var _0x5569e7=jayson['server'](_0x3ba994)[_0xb4d1('0x5f')]();_0x5569e7['on'](_0xb4d1('0x3d'),function(_0x355509){logger[_0xb4d1('0x3d')](JSON[_0xb4d1('0x37')](_0x355509));return _0x295264(_0x355509);});_0x5569e7['listen'](0x232c,_0xb4d1('0x60'),function(){console['log'](_0xb4d1('0x61'),0x232c);return _0x37cb4c(_0xb4d1('0x62')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 8b42726..659a763 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 _0x98bc=['routing','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map','join','\x20|\x20','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','iftime','../../../config/logger'];(function(_0x29f33e,_0x4c1d2a){var _0x4fcc7e=function(_0x1b76ae){while(--_0x1b76ae){_0x29f33e['push'](_0x29f33e['shift']());}};_0x4fcc7e(++_0x4c1d2a);}(_0x98bc,0x142));var _0xc98b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x98bc[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xc98b('0x0'));var iftime=require('../../../utils/iftime')[_0xc98b('0x1')];var logger=require(_0xc98b('0x2'))(_0xc98b('0x3'));exports[_0xc98b('0x4')]=function(_0x34291f,_0x3d7b2b,_0x88a2ed){return function(_0x22d54e){if(_0x88a2ed[_0xc98b('0x5')]&&!_0x88a2ed[_0xc98b('0x5')][_0x34291f]){logger[_0xc98b('0x6')](_0xc98b('0x7'),_0x34291f);return _0x22d54e[_0xc98b('0x8')]();}var _0x2548ae=_0x3d7b2b[_0xc98b('0x9')](function(_0x21a493){return iftime(_0x21a493);});var _0x51480d=_['some'](_0x2548ae);if(_0x51480d){logger[_0xc98b('0x6')]('[%s][INTERVAL\x20VALID]\x20%s\x20%s',_0x34291f,_0x3d7b2b[_0xc98b('0xa')](_0xc98b('0xb')),_0x51480d);_0x22d54e['when'](_0x51480d);}else{logger['info'](_0xc98b('0xc'),_0x34291f,_0x3d7b2b[_0xc98b('0xa')](_0xc98b('0xb')));_0x22d54e[_0xc98b('0x8')]();}};}; \ No newline at end of file +var _0x2e53=['../../../utils/iftime','iftime','../../../config/logger','routing','rules','info','stop','join','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','\x20|\x20','lodash'];(function(_0x36df03,_0xdb48d6){var _0x55ef09=function(_0x51e028){while(--_0x51e028){_0x36df03['push'](_0x36df03['shift']());}};_0x55ef09(++_0xdb48d6);}(_0x2e53,0x11d));var _0x32e5=function(_0x374dd6,_0xadc0eb){_0x374dd6=_0x374dd6-0x0;var _0x1aadd0=_0x2e53[_0x374dd6];return _0x1aadd0;};'use strict';var _=require(_0x32e5('0x0'));var iftime=require(_0x32e5('0x1'))[_0x32e5('0x2')];var logger=require(_0x32e5('0x3'))(_0x32e5('0x4'));exports['condition']=function(_0x4102ec,_0xa499b7,_0x331453){return function(_0x5267e1){if(_0x331453[_0x32e5('0x5')]&&!_0x331453[_0x32e5('0x5')][_0x4102ec]){logger[_0x32e5('0x6')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x4102ec);return _0x5267e1[_0x32e5('0x7')]();}var _0x4e4f56=_0xa499b7['map'](function(_0x41c8a9){return iftime(_0x41c8a9);});var _0x364f2e=_['some'](_0x4e4f56);if(_0x364f2e){logger[_0x32e5('0x6')]('[%s][INTERVAL\x20VALID]\x20%s\x20%s',_0x4102ec,_0xa499b7[_0x32e5('0x8')]('\x20|\x20'),_0x364f2e);_0x5267e1['when'](_0x364f2e);}else{logger[_0x32e5('0x6')](_0x32e5('0x9'),_0x4102ec,_0xa499b7[_0x32e5('0x8')](_0x32e5('0xa')));_0x5267e1[_0x32e5('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 304912c..ce5131b 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 _0xb9a7=['connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','transfereeuniqueid','calleridname','agententerreason','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','agentcompleteAt','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','agentacw','agentcomplete','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','format','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','ringtime','talktime','queuecallerabandon','forIn','includes','agentringnoanswerAt','abandoned','holdtime','[%s][agents][queuecallerabandon]','agentconnect','agentconnectAt','connectedlinename'];(function(_0x16d545,_0x52816d){var _0x78c374=function(_0x5845b7){while(--_0x5845b7){_0x16d545['push'](_0x16d545['shift']());}};_0x78c374(++_0x52816d);}(_0xb9a7,0x112));var _0x7b9a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xb9a7[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x563857,_0x5f1a52){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x2'),_0x563857[_0x7b9a('0x3')],_0x563857[_0x7b9a('0x4')],_0x563857[_0x7b9a('0x5')],_0x563857[_0x7b9a('0x6')],_0x563857[_0x7b9a('0x7')],_0x563857[_0x7b9a('0x8')],_0x563857[_0x7b9a('0x9')],_0x563857[_0x7b9a('0xa')]));if(_0x563857[_0x7b9a('0x5')]){utils['getVoiceQueueByName'](_0x563857[_0x7b9a('0x5')])[_0x7b9a('0xb')](function(_0x56a199){if(_0x56a199){_0x563857['type']=_0x56a199['type'];_0x563857[_0x7b9a('0xc')]=_0x563857[_0x7b9a('0xd')]?_0x56a199['acw']:![];_0x563857[_0x7b9a('0xe')]=_0x563857['agentacw']?_0x56a199[_0x7b9a('0xf')]:0x0;}utils['request'](_0x7b9a('0x10'),_0x563857);});}else{utils[_0x7b9a('0x11')](_0x7b9a('0x10'),_0x563857);}if(_0x5f1a52){delete transfers[_0x563857['uniqueid']];}else{delete agents[_0x563857[_0x7b9a('0x12')]];}}exports[_0x7b9a('0x13')]=function(_0x5e3875){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentcalled]',_0x5e3875[_0x7b9a('0x3')]),_0x5e3875);agents[_0x5e3875[_0x7b9a('0x12')]]=_0x5e3875;agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x18');agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinenum']=null;agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinename']=null;utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x19'),_0x5e3875[_0x7b9a('0x3')],agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x6')],_0x5e3875[_0x7b9a('0x12')]));}catch(_0x283cc3){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x1b'),_0x5e3875[_0x7b9a('0x3')]),_0x283cc3);}};exports[_0x7b9a('0x1c')]=function(_0x58aed7){try{if(!_[_0x7b9a('0x1d')](agents[_0x58aed7['destuniqueid']])){utils[_0x7b9a('0x14')](util['format'](_0x7b9a('0x1e'),_0x58aed7[_0x7b9a('0x3')]),_0x58aed7);utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x1f'),_0x58aed7[_0x7b9a('0x3')],agents[_0x58aed7['destuniqueid']][_0x7b9a('0x6')],_0x58aed7[_0x7b9a('0x12')]));agents[_0x58aed7[_0x7b9a('0x12')]][_0x7b9a('0x1c')]=!![];agents[_0x58aed7[_0x7b9a('0x12')]]['agentringnoanswerAt']=utils[_0x7b9a('0x17')]();agents[_0x58aed7[_0x7b9a('0x12')]]['lastevent']=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']][_0x7b9a('0x21')]=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']]['holdtime']=_0x58aed7[_0x7b9a('0x22')]?parseInt(_0x58aed7['ringtime'])/0x3e8:0x0;agents[_0x58aed7['destuniqueid']][_0x7b9a('0x23')]=0x0;unanswered['push'](_0x58aed7['destuniqueid']);}}catch(_0x3847b4){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x1e'),_0x58aed7['uniqueid']),_0x3847b4);}};exports[_0x7b9a('0x24')]=function(_0x2e6144){try{_[_0x7b9a('0x25')](agents,function(_0x5b64d7,_0x45ccf5){if(_0x5b64d7[_0x7b9a('0x3')]==_0x2e6144[_0x7b9a('0x3')]&&!_[_0x7b9a('0x26')](unanswered,_0x5b64d7[_0x7b9a('0x12')])){utils[_0x7b9a('0x14')](util['format']('[%s][agents][queuecallerabandon]',_0x2e6144[_0x7b9a('0x3')]),_0x2e6144);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2e6144[_0x7b9a('0x3')],_0x5b64d7[_0x7b9a('0x6')],_0x5b64d7['destuniqueid']));_0x5b64d7['agentringnoanswer']=!![];_0x5b64d7[_0x7b9a('0x27')]=utils[_0x7b9a('0x17')]();_0x5b64d7['lastevent']=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x21')]=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x29')]=_0x2e6144[_0x7b9a('0x29')];_0x5b64d7['talktime']=0x0;writeDB(_0x5b64d7);}});}catch(_0x46bcd0){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x2a'),_0x2e6144[_0x7b9a('0x3')]),_0x46bcd0);}};exports[_0x7b9a('0x2b')]=function(_0x5f1da4){try{if(agents[_0x5f1da4['destuniqueid']]){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]',_0x5f1da4[_0x7b9a('0x3')]),_0x5f1da4);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x5f1da4[_0x7b9a('0x3')],agents[_0x5f1da4[_0x7b9a('0x12')]]['membername'],_0x5f1da4['destuniqueid']));agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2c')]=utils[_0x7b9a('0x17')]();agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x9')]=_0x5f1da4[_0x7b9a('0x9')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2d')]=_0x5f1da4['connectedlinename'];agents[_0x5f1da4[_0x7b9a('0x12')]]['holdtime']=_0x5f1da4[_0x7b9a('0x22')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x2e');_[_0x7b9a('0x25')](agents,function(_0x89951b,_0x5e504f){if(_0x89951b[_0x7b9a('0x12')]!=_0x5f1da4[_0x7b9a('0x12')]&&_0x89951b[_0x7b9a('0x3')]==_0x5f1da4[_0x7b9a('0x3')]){_0x89951b['talktime']=0x0;_0x89951b[_0x7b9a('0x29')]=_0x5f1da4[_0x7b9a('0x22')];_0x89951b[_0x7b9a('0x1c')]=!![];_0x89951b[_0x7b9a('0x27')]=utils['now']();_0x89951b[_0x7b9a('0xa')]='answered_elsewhere';_0x89951b[_0x7b9a('0x21')]=_0x7b9a('0x2f');_0x89951b[_0x7b9a('0x30')]=_0x5f1da4[_0x7b9a('0x12')];_0x89951b[_0x7b9a('0x31')]=_0x5f1da4[_0x7b9a('0x6')];writeDB(_0x89951b);}});}}catch(_0x56e274){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x32'),_0x5f1da4['uniqueid']),_0x56e274);}};exports['agentcomplete']=function(_0x3724fe){try{if(!_[_0x7b9a('0x1d')](agents[_0x3724fe[_0x7b9a('0x12')]])){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe['uniqueid']),_0x3724fe);utils['info'](util['format'](_0x7b9a('0x34'),_0x3724fe[_0x7b9a('0x3')],agents[_0x3724fe['destuniqueid']][_0x7b9a('0x6')],_0x3724fe[_0x7b9a('0x12')]));agents[_0x3724fe[_0x7b9a('0x12')]]['agentcomplete']=!![];agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt']=utils[_0x7b9a('0x17')]();agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt'],agents[_0x3724fe[_0x7b9a('0x12')]]['agentconnectAt']);agents[_0x3724fe[_0x7b9a('0x12')]]['reason']=_0x3724fe['reason'];agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x36');writeDB(agents[_0x3724fe[_0x7b9a('0x12')]]);}}catch(_0x1cbd5a){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe[_0x7b9a('0x3')]),_0x1cbd5a);}};exports['blindtransfer']=function(_0x1d7957){try{if(!_[_0x7b9a('0x1d')](agents[_0x1d7957['transfereruniqueid']])){utils['debug'](util['format'](_0x7b9a('0x37'),_0x1d7957[_0x7b9a('0x3')]),_0x1d7957);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1d7957[_0x7b9a('0x3')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x6')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')]));agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x39')]=!![];agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x3b');agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3c')]=_0x1d7957['extension'];agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3d')]=agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')];}}catch(_0x2b0db5){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]',_0x1d7957['uniqueid']),_0x2b0db5);}};exports['attendedtransfer']=function(_0x12c5bf){try{utils[_0x7b9a('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf['origtransfereruniqueid']),_0x12c5bf);if(_0x12c5bf['origtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x3e')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf[_0x7b9a('0x3f')]])){utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x40'),_0x12c5bf[_0x7b9a('0x41')],agents[_0x12c5bf[_0x7b9a('0x3f')]]['membername']));agents[_0x12c5bf[_0x7b9a('0x3f')]]['transfer']=!![];agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3c')]=_0x12c5bf['origtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x3f')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x41')];}if(_0x12c5bf[_0x7b9a('0x43')]&&agents[_0x12c5bf[_0x7b9a('0x43')]]){agents[_0x12c5bf['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfereeuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x43')]]);transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x8')]=agents[_0x12c5bf['secondtransfereruniqueid']][_0x7b9a('0x8')];transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x44')]=agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x44')];transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x45')]=0x2;}}else if(_0x12c5bf['secondtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x46')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf['origtransfereruniqueid']])){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x40'),_0x12c5bf['origtransfereruniqueid'],agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x6')]));agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x39')]=!![];agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x3c')]=_0x12c5bf['secondtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x41')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x3f')];}if(_0x12c5bf['transfertargetuniqueid']&&agents[_0x12c5bf[_0x7b9a('0x47')]]){agents[_0x12c5bf['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfertargetuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x47')]]);transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x8')]=agents[_0x12c5bf[_0x7b9a('0x41')]]['calleridnum'];transfers[_0x12c5bf[_0x7b9a('0x47')]]['calleridname']=agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x44')];transfers[_0x12c5bf['transfertargetuniqueid']]['agentcalledAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x47')]]['agentconnectAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf['transfertargetuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x45')]=0x2;}}}catch(_0x5118b3){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf[_0x7b9a('0x41')]),_0x5118b3);}};exports[_0x7b9a('0x48')]=function(_0x3fd697){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3fd697);if(agents[_0x3fd697['uniqueid']]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]==='timeout'){if(_0x3fd697[_0x7b9a('0x4a')]==='21'){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='rejected';agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x4b');}utils['info'](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x21')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);var _0x2090ef=unanswered['indexOf'](_0x3fd697['uniqueid']);if(_0x2090ef>-0x1){unanswered[_0x7b9a('0x4c')](_0x2090ef,0x1);}}if(transfers[_0x3fd697[_0x7b9a('0x3')]]){transfers[_0x3fd697['uniqueid']][_0x7b9a('0xd')]=!![];transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')]=utils['now']();transfers[_0x3fd697['uniqueid']][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],transfers[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='agent';transfers[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x36');utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],transfers[_0x3fd697[_0x7b9a('0x3')]]['membername'],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(transfers[_0x3fd697[_0x7b9a('0x3')]],!![]);}if(agents[_0x3fd697[_0x7b9a('0x3')]]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x2c')]){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xd')]=!![];agents[_0x3fd697[_0x7b9a('0x3')]]['agentcompleteAt']=utils['now']();agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x23')]=utils['diffTime'](agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]=agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x39')]?_0x7b9a('0x39'):_0x7b9a('0x4e');agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]='complete';utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x4f'),_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);}}catch(_0x3022e0){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3022e0);}}; \ No newline at end of file +var _0x0713=['cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','./utils','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','destuniqueid','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','forIn','includes','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','[%s][agents][agentcomplete]','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]'];(function(_0x47b19f,_0x77c99f){var _0x1fd067=function(_0x2b7688){while(--_0x2b7688){_0x47b19f['push'](_0x47b19f['shift']());}};_0x1fd067(++_0x77c99f);}(_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 utils=require(_0x3071('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2afa91,_0x27405a){utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2afa91[_0x3071('0x3')],_0x2afa91[_0x3071('0x4')],_0x2afa91[_0x3071('0x5')],_0x2afa91[_0x3071('0x6')],_0x2afa91[_0x3071('0x7')],_0x2afa91[_0x3071('0x8')],_0x2afa91[_0x3071('0x9')],_0x2afa91[_0x3071('0xa')]));if(_0x2afa91[_0x3071('0x5')]){utils[_0x3071('0xb')](_0x2afa91[_0x3071('0x5')])[_0x3071('0xc')](function(_0x1a868e){if(_0x1a868e){_0x2afa91['type']=_0x1a868e[_0x3071('0xd')];_0x2afa91[_0x3071('0xe')]=_0x2afa91[_0x3071('0xf')]?_0x1a868e[_0x3071('0x10')]:![];_0x2afa91[_0x3071('0x11')]=_0x2afa91['agentacw']?_0x1a868e[_0x3071('0x12')]:0x0;}utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);});}else{utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);}if(_0x27405a){delete transfers[_0x2afa91['uniqueid']];}else{delete agents[_0x2afa91['destuniqueid']];}}exports[_0x3071('0x15')]=function(_0x5dc13b){try{utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][agentcalled]',_0x5dc13b[_0x3071('0x3')]),_0x5dc13b);agents[_0x5dc13b['destuniqueid']]=_0x5dc13b;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x18')]=utils[_0x3071('0x19')]();agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x1a');agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x9')]=null;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x1b')]=null;utils['info'](util[_0x3071('0x2')](_0x3071('0x1c'),_0x5dc13b[_0x3071('0x3')],agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x6')],_0x5dc13b[_0x3071('0x17')]));}catch(_0x105bbb){utils[_0x3071('0x1d')](util['format'](_0x3071('0x1e'),_0x5dc13b[_0x3071('0x3')]),_0x105bbb);}};exports[_0x3071('0x1f')]=function(_0x56c267){try{if(!_[_0x3071('0x20')](agents[_0x56c267['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x56c267);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x22'),_0x56c267[_0x3071('0x3')],agents[_0x56c267['destuniqueid']]['membername'],_0x56c267[_0x3071('0x17')]));agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x1f')]=!![];agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x23')]=utils[_0x3071('0x19')]();agents[_0x56c267[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x24');agents[_0x56c267['destuniqueid']][_0x3071('0x25')]=_0x3071('0x24');agents[_0x56c267[_0x3071('0x17')]]['holdtime']=_0x56c267[_0x3071('0x26')]?parseInt(_0x56c267[_0x3071('0x26')])/0x3e8:0x0;agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x27')]=0x0;unanswered[_0x3071('0x28')](_0x56c267[_0x3071('0x17')]);}}catch(_0x177b5f){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x177b5f);}};exports['queuecallerabandon']=function(_0x4f1484){try{_[_0x3071('0x29')](agents,function(_0x149e0d,_0x6ddf96){if(_0x149e0d[_0x3071('0x3')]==_0x4f1484[_0x3071('0x3')]&&!_[_0x3071('0x2a')](unanswered,_0x149e0d[_0x3071('0x17')])){utils[_0x3071('0x16')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484['uniqueid']),_0x4f1484);utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x4f1484[_0x3071('0x3')],_0x149e0d[_0x3071('0x6')],_0x149e0d[_0x3071('0x17')]));_0x149e0d[_0x3071('0x1f')]=!![];_0x149e0d['agentringnoanswerAt']=utils[_0x3071('0x19')]();_0x149e0d[_0x3071('0xa')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x25')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x2c')]=_0x4f1484[_0x3071('0x2c')];_0x149e0d[_0x3071('0x27')]=0x0;writeDB(_0x149e0d);}});}catch(_0x596cc3){utils[_0x3071('0x1d')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484[_0x3071('0x3')]),_0x596cc3);}};exports[_0x3071('0x2d')]=function(_0x54d9c3){try{if(agents[_0x54d9c3[_0x3071('0x17')]]){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x54d9c3);utils[_0x3071('0x1')](util['format'](_0x3071('0x2f'),_0x54d9c3[_0x3071('0x3')],agents[_0x54d9c3['destuniqueid']][_0x3071('0x6')],_0x54d9c3['destuniqueid']));agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0x30')]=utils['now']();agents[_0x54d9c3['destuniqueid']][_0x3071('0x9')]=_0x54d9c3[_0x3071('0x9')];agents[_0x54d9c3[_0x3071('0x17')]]['connectedlinename']=_0x54d9c3[_0x3071('0x1b')];agents[_0x54d9c3['destuniqueid']][_0x3071('0x2c')]=_0x54d9c3['ringtime'];agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x31');_[_0x3071('0x29')](agents,function(_0x30ab68,_0x593c9c){if(_0x30ab68['destuniqueid']!=_0x54d9c3[_0x3071('0x17')]&&_0x30ab68[_0x3071('0x3')]==_0x54d9c3[_0x3071('0x3')]){_0x30ab68[_0x3071('0x27')]=0x0;_0x30ab68['holdtime']=_0x54d9c3[_0x3071('0x26')];_0x30ab68[_0x3071('0x1f')]=!![];_0x30ab68[_0x3071('0x23')]=utils[_0x3071('0x19')]();_0x30ab68[_0x3071('0xa')]=_0x3071('0x32');_0x30ab68['reason']=_0x3071('0x32');_0x30ab68['answeredelsewheredestinationuniqueid']=_0x54d9c3['destuniqueid'];_0x30ab68['answeredelsewheremembername']=_0x54d9c3['membername'];writeDB(_0x30ab68);}});}}catch(_0x2992e6){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x2992e6);}};exports[_0x3071('0xf')]=function(_0xa711b5){try{if(!_[_0x3071('0x20')](agents[_0xa711b5['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x33'),_0xa711b5[_0x3071('0x3')]),_0xa711b5);utils[_0x3071('0x1')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xa711b5[_0x3071('0x3')],agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x6')],_0xa711b5[_0x3071('0x17')]));agents[_0xa711b5[_0x3071('0x17')]]['agentcomplete']=!![];agents[_0xa711b5[_0x3071('0x17')]]['agentcompleteAt']=utils[_0x3071('0x19')]();agents[_0xa711b5['destuniqueid']]['talktime']=utils[_0x3071('0x34')](agents[_0xa711b5['destuniqueid']][_0x3071('0x35')],agents[_0xa711b5['destuniqueid']][_0x3071('0x30')]);agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x25')]=_0xa711b5[_0x3071('0x25')];agents[_0xa711b5['destuniqueid']][_0x3071('0xa')]='complete';writeDB(agents[_0xa711b5[_0x3071('0x17')]]);}}catch(_0x4b6bbb){utils[_0x3071('0x1d')](util[_0x3071('0x2')]('[%s][agents][agentcomplete]',_0xa711b5[_0x3071('0x3')]),_0x4b6bbb);}};exports[_0x3071('0x36')]=function(_0x224a70){try{if(!_[_0x3071('0x20')](agents[_0x224a70[_0x3071('0x37')]])){utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x224a70);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x38'),_0x224a70['uniqueid'],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x6')],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')]));agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x39')]=!![];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3a')]=_0x3071('0x3b');agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3c')]=_0x224a70[_0x3071('0x3d')];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3e')]=agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')];}}catch(_0x596cdd){utils['error'](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x596cdd);}};exports[_0x3071('0x3f')]=function(_0x15c6f8){try{utils['debug'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x15c6f8);if(_0x15c6f8['origtransfereruniqueid']==_0x15c6f8[_0x3071('0x41')]){if(!_[_0x3071('0x20')](agents[_0x15c6f8[_0x3071('0x42')]])){utils[_0x3071('0x1')](util['format'](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x42')]]['transfer']=!![];agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3a')]=_0x3071('0x45');agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x46')];agents[_0x15c6f8[_0x3071('0x42')]]['transferuniqueid']=_0x15c6f8['origtransfereruniqueid'];}if(_0x15c6f8[_0x3071('0x47')]&&agents[_0x15c6f8['transfereeuniqueid']]){agents[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x1;transfers[_0x15c6f8['transfereeuniqueid']]=_[_0x3071('0x49')](agents[_0x15c6f8[_0x3071('0x47')]]);transfers[_0x15c6f8['transfereeuniqueid']][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x8')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x4a')]=agents[_0x15c6f8['secondtransfereruniqueid']][_0x3071('0x4a')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x18')]=utils['now']();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x2;}}else if(_0x15c6f8[_0x3071('0x42')]==_0x15c6f8[_0x3071('0x4b')]){if(!_['isNil'](agents[_0x15c6f8[_0x3071('0x44')]])){utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x39')]=!![];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3a')]='ATTENDED';agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x4c')];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3e')]=_0x15c6f8[_0x3071('0x42')];}if(_0x15c6f8[_0x3071('0x4d')]&&agents[_0x15c6f8[_0x3071('0x4d')]]){agents[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x48')]=0x1;transfers[_0x15c6f8[_0x3071('0x4d')]]=_['clone'](agents[_0x15c6f8['transfertargetuniqueid']]);transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x8')];transfers[_0x15c6f8['transfertargetuniqueid']]['calleridname']=agents[_0x15c6f8[_0x3071('0x44')]]['calleridname'];transfers[_0x15c6f8['transfertargetuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x48')]=0x2;}}}catch(_0x19a03d){utils['error'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x19a03d);}};exports[_0x3071('0x4e')]=function(_0x29ee70){try{utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70[_0x3071('0x3')]),_0x29ee70);if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']]['reason']===_0x3071('0x24')){if(_0x29ee70[_0x3071('0x50')]==='21'){agents[_0x29ee70[_0x3071('0x3')]]['reason']='rejected';agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x51');}utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]]['membername'],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);var _0x2fbac7=unanswered[_0x3071('0x53')](_0x29ee70[_0x3071('0x3')]);if(_0x2fbac7>-0x1){unanswered[_0x3071('0x54')](_0x2fbac7,0x1);}}if(transfers[_0x29ee70[_0x3071('0x3')]]){transfers[_0x29ee70['uniqueid']][_0x3071('0xf')]=!![];transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils['now']();transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](transfers[_0x29ee70['uniqueid']]['agentcompleteAt'],transfers[_0x29ee70[_0x3071('0x3')]]['agentconnectAt']);transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')]=_0x3071('0x55');transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x56');utils[_0x3071('0x1')](util['format'](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(transfers[_0x29ee70['uniqueid']],!![]);}if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']][_0x3071('0x30')]){agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xf')]=!![];agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils[_0x3071('0x19')]();agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](agents[_0x29ee70[_0x3071('0x3')]]['agentcompleteAt'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x30')]);agents[_0x29ee70['uniqueid']][_0x3071('0x25')]=agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x39')]?_0x3071('0x39'):_0x3071('0x55');agents[_0x29ee70['uniqueid']]['lastevent']=_0x3071('0x56');utils['info'](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);}}catch(_0x291bb9){utils['error'](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70['uniqueid']),_0x291bb9);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 265e23f..3b07a24 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 _0xb92f=['value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','startsWith','cdr','split','lastIndexOf','includes','set','lastdata','./utils','NO\x20ANSWER','FAILED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','newchannel','linkedid','channel','context','exten','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','ANSWERED','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','now','duration','diffTime','starttime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfereruniqueid','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s'];(function(_0x885111,_0x1efb97){var _0x54b76b=function(_0xf27e26){while(--_0xf27e26){_0x885111['push'](_0x885111['shift']());}};_0x54b76b(++_0x1efb97);}(_0xb92f,0xf6));var _0xfb92=function(_0x280e65,_0xc6f90a){_0x280e65=_0x280e65-0x0;var _0x2c24e2=_0xb92f[_0x280e65];return _0x2c24e2;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xfb92('0x0'));var dispositions=[_0xfb92('0x1'),_0xfb92('0x2'),_0xfb92('0x2'),_0xfb92('0x1'),'NO\x20ANSWER',_0xfb92('0x1'),'ANSWERED',_0xfb92('0x3'),_0xfb92('0x2'),_0xfb92('0x2'),'FAILED'];var channels={};function writeDB(_0x31efa1){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x6'),_0x31efa1[_0xfb92('0x7')],_0x31efa1['channel'],_0x31efa1[_0xfb92('0x8')],_0x31efa1[_0xfb92('0x9')],_0x31efa1[_0xfb92('0xa')],_0x31efa1[_0xfb92('0xb')],_0x31efa1['connectedlinenum'],_0x31efa1[_0xfb92('0xc')]));if(_0x31efa1[_0xfb92('0xd')]){utils[_0xfb92('0xe')](_0x31efa1[_0xfb92('0xd')])[_0xfb92('0xf')](function(_0x3ce563){if(_0x3ce563){_0x31efa1[_0xfb92('0x10')]=_0x3ce563['id'];}utils['request'](_0xfb92('0x11'),_0x31efa1);});}else{utils[_0xfb92('0x12')]('CreateVoiceCallReport',_0x31efa1);}if(channels[_0x31efa1[_0xfb92('0x7')]]){delete channels[_0x31efa1['uniqueid']];}}exports[_0xfb92('0x13')]=function(_0x3c5a91){try{utils['debug'](util['format']('[%s][calls][newchannel]',_0x3c5a91[_0xfb92('0x7')]),_0x3c5a91);if(_0x3c5a91['uniqueid']==_0x3c5a91[_0xfb92('0x14')]&&_0x3c5a91[_0xfb92('0x15')]!='OutgoingSpoolFailed'){utils[_0xfb92('0x4')](util[_0xfb92('0x5')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x3c5a91['uniqueid'],_0x3c5a91[_0xfb92('0x16')],_0x3c5a91[_0xfb92('0x17')]));channels[_0x3c5a91['uniqueid']]={'uniqueid':_0x3c5a91[_0xfb92('0x7')],'accountcode':_0x3c5a91[_0xfb92('0xd')],'source':_0x3c5a91['calleridnum'],'destination':_0x3c5a91[_0xfb92('0x17')],'destinationcontext':_0x3c5a91[_0xfb92('0x16')],'channel':_0x3c5a91[_0xfb92('0x15')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xfb92('0x1'),'amaflags':_0xfb92('0x18')};}}catch(_0x1f959a){utils[_0xfb92('0x19')](util['format'](_0xfb92('0x1a'),_0x3c5a91[_0xfb92('0x7')]),_0x1f959a);}};exports[_0xfb92('0x1b')]=function(_0x488fc6){try{utils[_0xfb92('0x1c')](util['format'](_0xfb92('0x1d'),_0x488fc6[_0xfb92('0x7')]),_0x488fc6);if(!_[_0xfb92('0x1e')](channels[_0x488fc6[_0xfb92('0x7')]])&&_0x488fc6[_0xfb92('0x1f')]==0x6){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x20'),_0x488fc6[_0xfb92('0x7')],_0x488fc6[_0xfb92('0x16')],_0x488fc6[_0xfb92('0x15')]));if(_[_0xfb92('0x1e')](channels[_0x488fc6[_0xfb92('0x7')]][_0xfb92('0x21')])){channels[_0x488fc6[_0xfb92('0x7')]]['systemanswertime']=utils['now']();}}else if(!_['isNil'](channels[_0x488fc6[_0xfb92('0x14')]])&&_0x488fc6[_0xfb92('0x1f')]==0x6&&_0x488fc6[_0xfb92('0x16')]!=_0xfb92('0x22')){utils['info'](util[_0xfb92('0x5')](_0xfb92('0x23'),_0x488fc6[_0xfb92('0x7')],_0x488fc6[_0xfb92('0x14')],_0x488fc6[_0xfb92('0x16')],_0x488fc6[_0xfb92('0x15')]));channels[_0x488fc6['linkedid']][_0xfb92('0xd')]=_0x488fc6[_0xfb92('0xd')];channels[_0x488fc6[_0xfb92('0x14')]][_0xfb92('0x24')]=_0x488fc6[_0xfb92('0x15')];if(_[_0xfb92('0x1e')](channels[_0x488fc6[_0xfb92('0x14')]][_0xfb92('0x25')])){channels[_0x488fc6['linkedid']][_0xfb92('0x25')]=utils['now']();}channels[_0x488fc6[_0xfb92('0x14')]][_0xfb92('0x26')]=dispositions[_['toNumber'](_0x488fc6[_0xfb92('0x1f')])]||_0xfb92('0x27');}}catch(_0x566efe){utils[_0xfb92('0x19')](util[_0xfb92('0x5')](_0xfb92('0x1d'),_0x488fc6[_0xfb92('0x7')]),_0x566efe);}};exports[_0xfb92('0x28')]=function(_0x4c8d60){try{if(!_[_0xfb92('0x1e')](channels[_0x4c8d60['uniqueid']])){utils[_0xfb92('0x1c')](util['format'](_0xfb92('0x29'),_0x4c8d60[_0xfb92('0x7')]),_0x4c8d60);if(_[_0xfb92('0x1e')](channels[_0x4c8d60['uniqueid']][_0xfb92('0x2a')])){channels[_0x4c8d60[_0xfb92('0x7')]]['callerid']=_0x4c8d60[_0xfb92('0x2b')]+'\x20<'+_0x4c8d60[_0xfb92('0xb')]+'>';}utils['info'](util[_0xfb92('0x5')](_0xfb92('0x2c'),_0x4c8d60[_0xfb92('0x7')],channels[_0x4c8d60[_0xfb92('0x7')]][_0xfb92('0x2a')],_0x4c8d60[_0xfb92('0x2d')]));channels[_0x4c8d60['uniqueid']][_0xfb92('0x2e')]=utils[_0xfb92('0x2f')]();channels[_0x4c8d60[_0xfb92('0x7')]][_0xfb92('0x30')]=utils[_0xfb92('0x31')](channels[_0x4c8d60['uniqueid']][_0xfb92('0x2e')],channels[_0x4c8d60[_0xfb92('0x7')]][_0xfb92('0x32')]);channels[_0x4c8d60['uniqueid']][_0xfb92('0x33')]=channels[_0x4c8d60[_0xfb92('0x7')]][_0xfb92('0x25')]?utils[_0xfb92('0x31')](channels[_0x4c8d60[_0xfb92('0x7')]][_0xfb92('0x2e')],channels[_0x4c8d60['uniqueid']][_0xfb92('0x25')]):0x0;writeDB(channels[_0x4c8d60['uniqueid']]);}}catch(_0x391865){utils[_0xfb92('0x19')](util['format'](_0xfb92('0x29'),_0x4c8d60[_0xfb92('0x7')]),_0x391865);}};exports[_0xfb92('0x34')]=function(_0x1e2a89){try{if(!_[_0xfb92('0x1e')](channels[_0x1e2a89['localtwolinkedid']])){utils[_0xfb92('0x1c')](util[_0xfb92('0x5')](_0xfb92('0x35'),_0x1e2a89['origtransfereruniqueid']),_0x1e2a89);if(channels[_0x1e2a89[_0xfb92('0x36')]][_0xfb92('0x15')]==_0x1e2a89[_0xfb92('0x37')]){utils[_0xfb92('0x4')](util['format'](_0xfb92('0x38'),_0x1e2a89['origtransfereruniqueid'],_0x1e2a89[_0xfb92('0x36')],_0x1e2a89[_0xfb92('0x39')]));channels[_0x1e2a89[_0xfb92('0x36')]][_0xfb92('0x24')]=_0x1e2a89['secondtransfererchannel'];channels[_0x1e2a89[_0xfb92('0x36')]][_0xfb92('0x3a')]=_0xfb92('0x3b');}else if(channels[_0x1e2a89[_0xfb92('0x36')]][_0xfb92('0x15')]=_0x1e2a89[_0xfb92('0x3c')]){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x38'),_0x1e2a89[_0xfb92('0x3d')],_0x1e2a89[_0xfb92('0x36')],_0x1e2a89[_0xfb92('0x3e')]));channels[_0x1e2a89[_0xfb92('0x36')]]['destinationchannel']=_0x1e2a89[_0xfb92('0x3e')];channels[_0x1e2a89['localtwolinkedid']][_0xfb92('0x3a')]=_0xfb92('0x3b');}}}catch(_0x9c0bce){utils[_0xfb92('0x19')](util[_0xfb92('0x5')](_0xfb92('0x35'),_0x1e2a89['origtransfereruniqueid']),_0x9c0bce);}};exports[_0xfb92('0x3f')]=function(_0x45c8cd){try{if(!_['isNil'](channels[_0x45c8cd['uniqueid']])){utils[_0xfb92('0x1c')](util[_0xfb92('0x5')](_0xfb92('0x40'),_0x45c8cd['uniqueid']),_0x45c8cd);channels[_0x45c8cd[_0xfb92('0x7')]]['musiconholdstartAt']=utils[_0xfb92('0x2f')]();utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x41'),_0x45c8cd['uniqueid'],channels[_0x45c8cd[_0xfb92('0x7')]][_0xfb92('0x42')]));}}catch(_0x485e2c){utils[_0xfb92('0x19')](util[_0xfb92('0x5')](_0xfb92('0x40'),_0x45c8cd[_0xfb92('0x7')]),_0x485e2c);}};exports['musiconholdstop']=function(_0x73c946){try{if(!_[_0xfb92('0x1e')](channels[_0x73c946[_0xfb92('0x7')]])){utils[_0xfb92('0x1c')](util[_0xfb92('0x5')](_0xfb92('0x43'),_0x73c946[_0xfb92('0x7')]),_0x73c946);if(!_[_0xfb92('0x1e')](channels[_0x73c946[_0xfb92('0x7')]][_0xfb92('0x42')])){channels[_0x73c946[_0xfb92('0x7')]][_0xfb92('0x44')]+=utils['diffTime'](utils[_0xfb92('0x2f')](),channels[_0x73c946['uniqueid']]['musiconholdstartAt']);utils[_0xfb92('0x4')](util['format'](_0xfb92('0x45'),_0x73c946[_0xfb92('0x7')],channels[_0x73c946[_0xfb92('0x7')]][_0xfb92('0x44')]));delete channels[_0x73c946['uniqueid']][_0xfb92('0x42')];}}}catch(_0xc89728){utils[_0xfb92('0x19')](util[_0xfb92('0x5')](_0xfb92('0x43'),_0x73c946['uniqueid']),_0xc89728);}};exports[_0xfb92('0x46')]=function(_0x5e313d){try{if(!_[_0xfb92('0x1e')](channels[_0x5e313d[_0xfb92('0x7')]])){utils[_0xfb92('0x1c')](util[_0xfb92('0x5')](_0xfb92('0x47'),_0x5e313d[_0xfb92('0x7')]),_0x5e313d);if(!_[_0xfb92('0x1e')](_0x5e313d[_0xfb92('0x48')][_0xfb92('0x49')])){utils['info'](util[_0xfb92('0x5')](_0xfb92('0x4a'),_0x5e313d[_0xfb92('0x7')],_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d['uniqueid']][_0xfb92('0x4c')]=_0x5e313d[_0xfb92('0x4b')];}if(!_['isNil'](_0x5e313d[_0xfb92('0x48')][_0xfb92('0x4d')])){utils['info'](util[_0xfb92('0x5')](_0xfb92('0x4e'),_0x5e313d[_0xfb92('0x7')],_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d[_0xfb92('0x7')]]['destination']=_0x5e313d[_0xfb92('0x4b')];channels[_0x5e313d[_0xfb92('0x7')]][_0xfb92('0x2a')]='\x22'+_0x5e313d['value']+'\x22\x20<'+_0x5e313d[_0xfb92('0x4b')]+'>';}if(!_['isNil'](_0x5e313d[_0xfb92('0x48')]['xmd-callerid-preview'])||!_[_0xfb92('0x1e')](_0x5e313d[_0xfb92('0x48')][_0xfb92('0x4f')])){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x50'),_0x5e313d[_0xfb92('0x7')],!_[_0xfb92('0x1e')](_0x5e313d[_0xfb92('0x48')][_0xfb92('0x51')])?'xmd-callerid-preview':'xmd-callerid',_0x5e313d['value']));channels[_0x5e313d[_0xfb92('0x7')]][_0xfb92('0x2a')]=_0x5e313d[_0xfb92('0x4b')];}if(!_[_0xfb92('0x1e')](_0x5e313d['variable'][_0xfb92('0x52')])||!_['isNil'](_0x5e313d[_0xfb92('0x48')][_0xfb92('0x53')])){utils['info'](util[_0xfb92('0x5')](_0xfb92('0x50'),_0x5e313d[_0xfb92('0x7')],!_[_0xfb92('0x1e')](_0x5e313d[_0xfb92('0x48')]['xmd-queue'])?_0xfb92('0x52'):_0xfb92('0x53'),_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d[_0xfb92('0x7')]][_0xfb92('0x54')]='Queue';channels[_0x5e313d[_0xfb92('0x7')]]['lastdata']=_0x5e313d[_0xfb92('0x4b')];channels[_0x5e313d[_0xfb92('0x7')]][_0xfb92('0x8')]=!![];}if(!_['isNil'](_0x5e313d[_0xfb92('0x48')][_0xfb92('0x55')])){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x56'),_0x5e313d[_0xfb92('0x7')],_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d['uniqueid']][_0xfb92('0x57')]=_0x5e313d[_0xfb92('0x4b')];}if(!_[_0xfb92('0x1e')](_0x5e313d['variable'][_0xfb92('0x58')])){utils['info'](util['format'](_0xfb92('0x59'),_0x5e313d[_0xfb92('0x7')],_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d['uniqueid']][_0xfb92('0x5a')]=_0x5e313d['value'];}if(!_[_0xfb92('0x1e')](_0x5e313d[_0xfb92('0x48')]['outboundrouteid'])){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x5b'),_0x5e313d[_0xfb92('0x7')],_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d['uniqueid']][_0xfb92('0x5c')]=_0x5e313d[_0xfb92('0x4b')];}if(!_[_0xfb92('0x1e')](_0x5e313d[_0xfb92('0x48')]['sipcallid'])){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x5d'),_0x5e313d[_0xfb92('0x7')],_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d[_0xfb92('0x7')]][_0xfb92('0x5e')]=_0x5e313d[_0xfb92('0x4b')];}}}catch(_0x2d9661){utils[_0xfb92('0x19')](util['format'](_0xfb92('0x47'),_0x5e313d[_0xfb92('0x7')]),_0x2d9661);}};exports['newexten']=function(_0x1f15fa){try{if(!_[_0xfb92('0x1e')](channels[_0x1f15fa[_0xfb92('0x7')]])){utils[_0xfb92('0x1c')](util[_0xfb92('0x5')](_0xfb92('0x5f'),_0x1f15fa[_0xfb92('0x7')]),_0x1f15fa);utils['info'](util[_0xfb92('0x5')](_0xfb92('0x60'),_0x1f15fa['uniqueid'],_0x1f15fa['application'],_0x1f15fa[_0xfb92('0x61')]));if(_0x1f15fa[_0xfb92('0x62')][_0xfb92('0x63')]()=='set'&&_[_0xfb92('0x64')](_0x1f15fa[_0xfb92('0x61')][_0xfb92('0x63')](),_0xfb92('0x65'))){var _0x2b4824=_0x1f15fa['appdata'][_0xfb92('0x66')]('=');var _0x3e2fc9=_0x2b4824[0x0]['substring'](_0x2b4824[0x0][_0xfb92('0x67')]('(')+0x1,_0x2b4824[0x0]['lastIndexOf'](')'));var _0x6746a=_0x2b4824[0x1];channels[_0x1f15fa[_0xfb92('0x7')]][_0x3e2fc9]=_0x6746a;}if(!_[_0xfb92('0x68')]([_0xfb92('0x28'),'noop','execif',_0xfb92('0x69'),'gotoif'],_0x1f15fa[_0xfb92('0x62')]['toLowerCase']())){channels[_0x1f15fa['uniqueid']]['lastapplication']=_0x1f15fa[_0xfb92('0x62')];channels[_0x1f15fa[_0xfb92('0x7')]][_0xfb92('0x6a')]=_0x1f15fa[_0xfb92('0x61')];}}}catch(_0xacf1d5){utils[_0xfb92('0x19')](util['format'](_0xfb92('0x5f'),_0x1f15fa[_0xfb92('0x7')]),_0xacf1d5);}}; \ No newline at end of file +var _0x0757=['getUserByInternal','then','UserId','CreateVoiceCallReport','request','newchannel','debug','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','[%s][calls][newchannel]','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','linkedid','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','accountcode','destinationchannel','answertime','disposition','error','hangup','callerid','calleridname','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','interface','lastevent'];(function(_0x5347b7,_0x4a502a){var _0x1fab3a=function(_0x4816d5){while(--_0x4816d5){_0x5347b7['push'](_0x5347b7['shift']());}};_0x1fab3a(++_0x4a502a);}(_0x0757,0x139));var _0x7075=function(_0x5d9d90,_0x375d3c){_0x5d9d90=_0x5d9d90-0x0;var _0x5aee0c=_0x0757[_0x5d9d90];return _0x5aee0c;};'use strict';var _=require(_0x7075('0x0'));var util=require(_0x7075('0x1'));var utils=require(_0x7075('0x2'));var dispositions=[_0x7075('0x3'),_0x7075('0x4'),_0x7075('0x4'),'NO\x20ANSWER',_0x7075('0x3'),_0x7075('0x3'),_0x7075('0x5'),'BUSY',_0x7075('0x4'),'FAILED',_0x7075('0x4')];var channels={};function writeDB(_0xd090ba){utils[_0x7075('0x6')](util[_0x7075('0x7')](_0x7075('0x8'),_0xd090ba[_0x7075('0x9')],_0xd090ba[_0x7075('0xa')],_0xd090ba[_0x7075('0xb')],_0xd090ba['membername'],_0xd090ba[_0x7075('0xc')],_0xd090ba['calleridnum'],_0xd090ba['connectedlinenum'],_0xd090ba[_0x7075('0xd')]));if(_0xd090ba['accountcode']){utils[_0x7075('0xe')](_0xd090ba['accountcode'])[_0x7075('0xf')](function(_0x5bbc84){if(_0x5bbc84){_0xd090ba[_0x7075('0x10')]=_0x5bbc84['id'];}utils['request'](_0x7075('0x11'),_0xd090ba);});}else{utils[_0x7075('0x12')]('CreateVoiceCallReport',_0xd090ba);}if(channels[_0xd090ba[_0x7075('0x9')]]){delete channels[_0xd090ba[_0x7075('0x9')]];}}exports[_0x7075('0x13')]=function(_0x53250c){try{utils[_0x7075('0x14')](util[_0x7075('0x7')]('[%s][calls][newchannel]',_0x53250c[_0x7075('0x9')]),_0x53250c);if(_0x53250c[_0x7075('0x9')]==_0x53250c['linkedid']&&_0x53250c[_0x7075('0xa')]!=_0x7075('0x15')){utils[_0x7075('0x6')](util['format'](_0x7075('0x16'),_0x53250c[_0x7075('0x9')],_0x53250c[_0x7075('0x17')],_0x53250c[_0x7075('0x18')]));channels[_0x53250c[_0x7075('0x9')]]={'uniqueid':_0x53250c[_0x7075('0x9')],'accountcode':_0x53250c['accountcode'],'source':_0x53250c['calleridnum'],'destination':_0x53250c[_0x7075('0x18')],'destinationcontext':_0x53250c[_0x7075('0x17')],'channel':_0x53250c['channel'],'starttime':utils[_0x7075('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x7075('0x3'),'amaflags':_0x7075('0x1a')};}}catch(_0x1a0f0c){utils['error'](util['format'](_0x7075('0x1b'),_0x53250c[_0x7075('0x9')]),_0x1a0f0c);}};exports['newstate']=function(_0x463632){try{utils[_0x7075('0x14')](util['format'](_0x7075('0x1c'),_0x463632[_0x7075('0x9')]),_0x463632);if(!_['isNil'](channels[_0x463632[_0x7075('0x9')]])&&_0x463632[_0x7075('0x1d')]==0x6){utils[_0x7075('0x6')](util['format'](_0x7075('0x1e'),_0x463632['uniqueid'],_0x463632['context'],_0x463632[_0x7075('0xa')]));if(_[_0x7075('0x1f')](channels[_0x463632[_0x7075('0x9')]][_0x7075('0x20')])){channels[_0x463632[_0x7075('0x9')]][_0x7075('0x20')]=utils[_0x7075('0x19')]();}}else if(!_[_0x7075('0x1f')](channels[_0x463632[_0x7075('0x21')]])&&_0x463632[_0x7075('0x1d')]==0x6&&_0x463632[_0x7075('0x17')]!='transfer'){utils['info'](util[_0x7075('0x7')](_0x7075('0x22'),_0x463632[_0x7075('0x9')],_0x463632[_0x7075('0x21')],_0x463632[_0x7075('0x17')],_0x463632['channel']));channels[_0x463632[_0x7075('0x21')]][_0x7075('0x23')]=_0x463632['accountcode'];channels[_0x463632[_0x7075('0x21')]][_0x7075('0x24')]=_0x463632[_0x7075('0xa')];if(_['isNil'](channels[_0x463632[_0x7075('0x21')]][_0x7075('0x25')])){channels[_0x463632[_0x7075('0x21')]][_0x7075('0x25')]=utils[_0x7075('0x19')]();}channels[_0x463632['linkedid']][_0x7075('0x26')]=dispositions[_['toNumber'](_0x463632[_0x7075('0x1d')])]||_0x7075('0x5');}}catch(_0x2eb6c1){utils[_0x7075('0x27')](util[_0x7075('0x7')]('[%s][calls][newstate]',_0x463632['uniqueid']),_0x2eb6c1);}};exports[_0x7075('0x28')]=function(_0xd7f97a){try{if(!_['isNil'](channels[_0xd7f97a[_0x7075('0x9')]])){utils[_0x7075('0x14')](util[_0x7075('0x7')]('[%s][calls][hangup]',_0xd7f97a[_0x7075('0x9')]),_0xd7f97a);if(_[_0x7075('0x1f')](channels[_0xd7f97a[_0x7075('0x9')]]['callerid'])){channels[_0xd7f97a[_0x7075('0x9')]][_0x7075('0x29')]=_0xd7f97a[_0x7075('0x2a')]+'\x20<'+_0xd7f97a[_0x7075('0x2b')]+'>';}utils[_0x7075('0x6')](util[_0x7075('0x7')](_0x7075('0x2c'),_0xd7f97a[_0x7075('0x9')],channels[_0xd7f97a[_0x7075('0x9')]]['callerid'],_0xd7f97a[_0x7075('0x2d')]));channels[_0xd7f97a[_0x7075('0x9')]][_0x7075('0x2e')]=utils[_0x7075('0x19')]();channels[_0xd7f97a[_0x7075('0x9')]][_0x7075('0x2f')]=utils[_0x7075('0x30')](channels[_0xd7f97a['uniqueid']][_0x7075('0x2e')],channels[_0xd7f97a[_0x7075('0x9')]][_0x7075('0x31')]);channels[_0xd7f97a[_0x7075('0x9')]]['billableseconds']=channels[_0xd7f97a[_0x7075('0x9')]][_0x7075('0x25')]?utils['diffTime'](channels[_0xd7f97a[_0x7075('0x9')]][_0x7075('0x2e')],channels[_0xd7f97a[_0x7075('0x9')]][_0x7075('0x25')]):0x0;writeDB(channels[_0xd7f97a['uniqueid']]);}}catch(_0x434ceb){utils[_0x7075('0x27')](util[_0x7075('0x7')]('[%s][calls][hangup]',_0xd7f97a[_0x7075('0x9')]),_0x434ceb);}};exports[_0x7075('0x32')]=function(_0x4b32a6){try{if(!_[_0x7075('0x1f')](channels[_0x4b32a6[_0x7075('0x33')]])){utils[_0x7075('0x14')](util[_0x7075('0x7')](_0x7075('0x34'),_0x4b32a6[_0x7075('0x35')]),_0x4b32a6);if(channels[_0x4b32a6[_0x7075('0x33')]][_0x7075('0xa')]==_0x4b32a6[_0x7075('0x36')]){utils['info'](util[_0x7075('0x7')](_0x7075('0x37'),_0x4b32a6['origtransfereruniqueid'],_0x4b32a6['localtwolinkedid'],_0x4b32a6['secondtransfererchannel']));channels[_0x4b32a6[_0x7075('0x33')]][_0x7075('0x24')]=_0x4b32a6[_0x7075('0x38')];channels[_0x4b32a6['localtwolinkedid']][_0x7075('0x39')]='_attended';}else if(channels[_0x4b32a6[_0x7075('0x33')]]['channel']=_0x4b32a6[_0x7075('0x3a')]){utils[_0x7075('0x6')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x4b32a6[_0x7075('0x35')],_0x4b32a6[_0x7075('0x33')],_0x4b32a6['origtransfererchannel']));channels[_0x4b32a6[_0x7075('0x33')]][_0x7075('0x24')]=_0x4b32a6[_0x7075('0x3b')];channels[_0x4b32a6[_0x7075('0x33')]][_0x7075('0x39')]=_0x7075('0x3c');}}}catch(_0x1e8ffa){utils[_0x7075('0x27')](util[_0x7075('0x7')]('[%s][calls][attendedtransfer]',_0x4b32a6[_0x7075('0x35')]),_0x1e8ffa);}};exports[_0x7075('0x3d')]=function(_0xc6ea46){try{if(!_['isNil'](channels[_0xc6ea46[_0x7075('0x9')]])){utils[_0x7075('0x14')](util[_0x7075('0x7')](_0x7075('0x3e'),_0xc6ea46['uniqueid']),_0xc6ea46);channels[_0xc6ea46[_0x7075('0x9')]]['musiconholdstartAt']=utils['now']();utils[_0x7075('0x6')](util['format'](_0x7075('0x3f'),_0xc6ea46[_0x7075('0x9')],channels[_0xc6ea46[_0x7075('0x9')]]['musiconholdstartAt']));}}catch(_0x43aa72){utils[_0x7075('0x27')](util[_0x7075('0x7')]('[%s][calls][musiconholdstart]',_0xc6ea46[_0x7075('0x9')]),_0x43aa72);}};exports['musiconholdstop']=function(_0x11b7c7){try{if(!_[_0x7075('0x1f')](channels[_0x11b7c7[_0x7075('0x9')]])){utils[_0x7075('0x14')](util[_0x7075('0x7')]('[%s][calls][musiconholdstop]',_0x11b7c7['uniqueid']),_0x11b7c7);if(!_[_0x7075('0x1f')](channels[_0x11b7c7[_0x7075('0x9')]]['musiconholdstartAt'])){channels[_0x11b7c7[_0x7075('0x9')]]['mohtime']+=utils[_0x7075('0x30')](utils[_0x7075('0x19')](),channels[_0x11b7c7[_0x7075('0x9')]][_0x7075('0x40')]);utils['info'](util[_0x7075('0x7')](_0x7075('0x41'),_0x11b7c7['uniqueid'],channels[_0x11b7c7['uniqueid']][_0x7075('0x42')]));delete channels[_0x11b7c7['uniqueid']][_0x7075('0x40')];}}}catch(_0xa638ae){utils[_0x7075('0x27')](util['format'](_0x7075('0x43'),_0x11b7c7[_0x7075('0x9')]),_0xa638ae);}};exports[_0x7075('0x44')]=function(_0x52e6c6){try{if(!_['isNil'](channels[_0x52e6c6[_0x7075('0x9')]])){utils[_0x7075('0x14')](util['format'](_0x7075('0x45'),_0x52e6c6[_0x7075('0x9')]),_0x52e6c6);if(!_['isNil'](_0x52e6c6[_0x7075('0x46')][_0x7075('0x47')])){utils[_0x7075('0x6')](util[_0x7075('0x7')](_0x7075('0x48'),_0x52e6c6[_0x7075('0x9')],_0x52e6c6[_0x7075('0x49')]));channels[_0x52e6c6[_0x7075('0x9')]][_0x7075('0x4a')]=_0x52e6c6['value'];}if(!_[_0x7075('0x1f')](_0x52e6c6[_0x7075('0x46')][_0x7075('0x4b')])){utils[_0x7075('0x6')](util[_0x7075('0x7')](_0x7075('0x4c'),_0x52e6c6[_0x7075('0x9')],_0x52e6c6[_0x7075('0x49')]));channels[_0x52e6c6[_0x7075('0x9')]]['destination']=_0x52e6c6[_0x7075('0x49')];channels[_0x52e6c6[_0x7075('0x9')]]['callerid']='\x22'+_0x52e6c6[_0x7075('0x49')]+_0x7075('0x4d')+_0x52e6c6[_0x7075('0x49')]+'>';}if(!_[_0x7075('0x1f')](_0x52e6c6[_0x7075('0x46')][_0x7075('0x4e')])||!_['isNil'](_0x52e6c6[_0x7075('0x46')][_0x7075('0x4f')])){utils[_0x7075('0x6')](util[_0x7075('0x7')](_0x7075('0x50'),_0x52e6c6[_0x7075('0x9')],!_['isNil'](_0x52e6c6[_0x7075('0x46')][_0x7075('0x4e')])?_0x7075('0x4e'):_0x7075('0x4f'),_0x52e6c6[_0x7075('0x49')]));channels[_0x52e6c6[_0x7075('0x9')]][_0x7075('0x29')]=_0x52e6c6['value'];}if(!_['isNil'](_0x52e6c6[_0x7075('0x46')][_0x7075('0x51')])||!_[_0x7075('0x1f')](_0x52e6c6[_0x7075('0x46')]['xmcs-queue'])){utils[_0x7075('0x6')](util[_0x7075('0x7')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x52e6c6['uniqueid'],!_['isNil'](_0x52e6c6['variable'][_0x7075('0x51')])?'xmd-queue':_0x7075('0x52'),_0x52e6c6[_0x7075('0x49')]));channels[_0x52e6c6[_0x7075('0x9')]][_0x7075('0x53')]='Queue';channels[_0x52e6c6[_0x7075('0x9')]][_0x7075('0x54')]=_0x52e6c6['value'];channels[_0x52e6c6[_0x7075('0x9')]][_0x7075('0xb')]=!![];}if(!_[_0x7075('0x1f')](_0x52e6c6[_0x7075('0x46')][_0x7075('0x55')])){utils[_0x7075('0x6')](util['format'](_0x7075('0x56'),_0x52e6c6[_0x7075('0x9')],_0x52e6c6[_0x7075('0x49')]));channels[_0x52e6c6[_0x7075('0x9')]][_0x7075('0x57')]=_0x52e6c6[_0x7075('0x49')];}if(!_['isNil'](_0x52e6c6[_0x7075('0x46')][_0x7075('0x58')])){utils[_0x7075('0x6')](util[_0x7075('0x7')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x52e6c6[_0x7075('0x9')],_0x52e6c6[_0x7075('0x49')]));channels[_0x52e6c6[_0x7075('0x9')]][_0x7075('0x59')]=_0x52e6c6[_0x7075('0x49')];}if(!_[_0x7075('0x1f')](_0x52e6c6[_0x7075('0x46')]['outboundrouteid'])){utils[_0x7075('0x6')](util[_0x7075('0x7')](_0x7075('0x5a'),_0x52e6c6[_0x7075('0x9')],_0x52e6c6[_0x7075('0x49')]));channels[_0x52e6c6['uniqueid']][_0x7075('0x5b')]=_0x52e6c6[_0x7075('0x49')];}if(!_['isNil'](_0x52e6c6[_0x7075('0x46')][_0x7075('0x5c')])){utils[_0x7075('0x6')](util[_0x7075('0x7')](_0x7075('0x5d'),_0x52e6c6[_0x7075('0x9')],_0x52e6c6[_0x7075('0x49')]));channels[_0x52e6c6[_0x7075('0x9')]][_0x7075('0x5c')]=_0x52e6c6[_0x7075('0x49')];}}}catch(_0x4e7e80){utils[_0x7075('0x27')](util[_0x7075('0x7')]('[%s][calls][varset]',_0x52e6c6[_0x7075('0x9')]),_0x4e7e80);}};exports[_0x7075('0x5e')]=function(_0x20c3ac){try{if(!_[_0x7075('0x1f')](channels[_0x20c3ac[_0x7075('0x9')]])){utils[_0x7075('0x14')](util[_0x7075('0x7')](_0x7075('0x5f'),_0x20c3ac[_0x7075('0x9')]),_0x20c3ac);utils[_0x7075('0x6')](util[_0x7075('0x7')](_0x7075('0x60'),_0x20c3ac[_0x7075('0x9')],_0x20c3ac[_0x7075('0x61')],_0x20c3ac[_0x7075('0x62')]));if(_0x20c3ac[_0x7075('0x61')][_0x7075('0x63')]()==_0x7075('0x64')&&_[_0x7075('0x65')](_0x20c3ac[_0x7075('0x62')][_0x7075('0x63')](),_0x7075('0x66'))){var _0x4f1490=_0x20c3ac[_0x7075('0x62')]['split']('=');var _0x3d902c=_0x4f1490[0x0][_0x7075('0x67')](_0x4f1490[0x0][_0x7075('0x68')]('(')+0x1,_0x4f1490[0x0][_0x7075('0x68')](')'));var _0x484793=_0x4f1490[0x1];channels[_0x20c3ac['uniqueid']][_0x3d902c]=_0x484793;}if(!_[_0x7075('0x69')](['hangup',_0x7075('0x6a'),_0x7075('0x6b'),_0x7075('0x64'),_0x7075('0x6c')],_0x20c3ac[_0x7075('0x61')]['toLowerCase']())){channels[_0x20c3ac[_0x7075('0x9')]][_0x7075('0x53')]=_0x20c3ac[_0x7075('0x61')];channels[_0x20c3ac[_0x7075('0x9')]][_0x7075('0x54')]=_0x20c3ac[_0x7075('0x62')];}}}catch(_0x56c37c){utils[_0x7075('0x27')](util['format'](_0x7075('0x5f'),_0x20c3ac['uniqueid']),_0x56c37c);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 2de8df4..81f448a 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 _0x1fb5=['[core]\x20error','close','[core]\x20close','managerevent','connect','info','shutdown','[core]\x20shutdown','fullybooted','error'];(function(_0x245cc0,_0x31b013){var _0x58ce2a=function(_0x4004f6){while(--_0x4004f6){_0x245cc0['push'](_0x245cc0['shift']());}};_0x58ce2a(++_0x31b013);}(_0x1fb5,0xae));var _0x51fb=function(_0x3cc8a9,_0x962eb6){_0x3cc8a9=_0x3cc8a9-0x0;var _0x5b667a=_0x1fb5[_0x3cc8a9];return _0x5b667a;};'use strict';var utils=require('./utils');exports[_0x51fb('0x0')]=function(){utils[_0x51fb('0x1')]('[core]\x20connected');};exports[_0x51fb('0x2')]=function(){utils[_0x51fb('0x1')](_0x51fb('0x3'));};exports[_0x51fb('0x4')]=function(){utils['info']('[core]\x20fullybooted');};exports['error']=function(_0x3492b2){utils[_0x51fb('0x5')](_0x51fb('0x6'),_0x3492b2);};exports[_0x51fb('0x7')]=function(){utils[_0x51fb('0x1')](_0x51fb('0x8'));};exports[_0x51fb('0x9')]=function(_0x1242dd){}; \ No newline at end of file +var _0x7b73=['error','[core]\x20error','close','[core]\x20close','./utils','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted'];(function(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0x7b73,0x1e8));var _0x37b7=function(_0x549490,_0xea5dd0){_0x549490=_0x549490-0x0;var _0x3a8791=_0x7b73[_0x549490];return _0x3a8791;};'use strict';var utils=require(_0x37b7('0x0'));exports['connect']=function(){utils[_0x37b7('0x1')](_0x37b7('0x2'));};exports[_0x37b7('0x3')]=function(){utils[_0x37b7('0x1')](_0x37b7('0x4'));};exports[_0x37b7('0x5')]=function(){utils['info'](_0x37b7('0x6'));};exports[_0x37b7('0x7')]=function(_0x2bd4fd){utils[_0x37b7('0x7')](_0x37b7('0x8'),_0x2bd4fd);};exports[_0x37b7('0x9')]=function(){utils[_0x37b7('0x1')](_0x37b7('0xa'));};exports['managerevent']=function(_0x32763d){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 98f7995..b75fa2a 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 _0xd0e9=['[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','endtime','holdtime','billableseconds','[%s][dials][hangup]','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','varset','debug','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','assign','starttime','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','answertime','now','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup'];(function(_0x11db7a,_0x26e377){var _0x309eb7=function(_0x56e342){while(--_0x56e342){_0x11db7a['push'](_0x11db7a['shift']());}};_0x309eb7(++_0x26e377);}(_0xd0e9,0x153));var _0x9d0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0e9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9d0e('0x0'));var utils=require(_0x9d0e('0x1'));var dials={};function writeDB(_0x9e5cfa){utils[_0x9d0e('0x2')](util[_0x9d0e('0x3')](_0x9d0e('0x4'),_0x9e5cfa[_0x9d0e('0x5')],_0x9e5cfa[_0x9d0e('0x6')],_0x9e5cfa[_0x9d0e('0x7')],_0x9e5cfa[_0x9d0e('0x8')],_0x9e5cfa[_0x9d0e('0x9')],_0x9e5cfa[_0x9d0e('0xa')]));utils[_0x9d0e('0xb')](_0x9d0e('0xc'),_0x9e5cfa);delete dials[_0x9e5cfa[_0x9d0e('0x5')]];}exports[_0x9d0e('0xd')]=function(_0x4d73e5){try{utils['debug'](util[_0x9d0e('0x3')](_0x9d0e('0xe'),_0x4d73e5[_0x9d0e('0x5')]),_0x4d73e5);utils['info'](util[_0x9d0e('0x3')](_0x9d0e('0xf'),_0x4d73e5[_0x9d0e('0x5')],_0x4d73e5[_0x9d0e('0x10')],_0x4d73e5[_0x9d0e('0x11')]));if(_0x4d73e5[_0x9d0e('0x10')][_0x9d0e('0x12')]()==_0x9d0e('0x13')&&_[_0x9d0e('0x14')](_0x4d73e5['appdata'][_0x9d0e('0x12')](),_0x9d0e('0x15'))){var _0x50dfbc=_0x4d73e5[_0x9d0e('0x11')]['split']('=');dials[_0x4d73e5['uniqueid']]={'routeId':_0x50dfbc[0x1]};}}catch(_0x2db554){utils[_0x9d0e('0x16')](util[_0x9d0e('0x3')](_0x9d0e('0xe'),_0x4d73e5[_0x9d0e('0x5')]),_0x2db554);}};exports[_0x9d0e('0x17')]=function(_0x3fee6a){try{utils[_0x9d0e('0x18')](util[_0x9d0e('0x3')](_0x9d0e('0x19'),_0x3fee6a[_0x9d0e('0x5')]),_0x3fee6a);if(!_['isNil'](_0x3fee6a[_0x9d0e('0x1a')][_0x9d0e('0x1b')])){utils[_0x9d0e('0x2')](util[_0x9d0e('0x3')](_0x9d0e('0x1c'),_0x3fee6a['uniqueid'],_0x3fee6a[_0x9d0e('0x1d')]));dials[_0x3fee6a['uniqueid']]={'routeId':_0x3fee6a[_0x9d0e('0x1d')]};}}catch(_0x2e3f69){utils[_0x9d0e('0x16')](util['format'](_0x9d0e('0x19'),_0x3fee6a['uniqueid']),_0x2e3f69);}};exports[_0x9d0e('0x1e')]=function(_0x171dcc){try{if(!_[_0x9d0e('0x1f')](dials[_0x171dcc[_0x9d0e('0x5')]])){utils['debug'](util['format']('[%s][dials][dialbegin]',_0x171dcc[_0x9d0e('0x5')]),_0x171dcc);dials[_0x171dcc[_0x9d0e('0x5')]]=_[_0x9d0e('0x20')](dials[_0x171dcc[_0x9d0e('0x5')]],_0x171dcc);dials[_0x171dcc[_0x9d0e('0x5')]][_0x9d0e('0x21')]=utils['now']();dials[_0x171dcc[_0x9d0e('0x5')]]['lastevent']=_0x9d0e('0x22');utils[_0x9d0e('0x2')](util[_0x9d0e('0x3')](_0x9d0e('0x23'),_0x171dcc['uniqueid'],dials[_0x171dcc[_0x9d0e('0x5')]][_0x9d0e('0x21')]));}}catch(_0x520011){utils[_0x9d0e('0x16')](util[_0x9d0e('0x3')](_0x9d0e('0x24'),_0x171dcc[_0x9d0e('0x5')]),_0x520011);}};exports[_0x9d0e('0x25')]=function(_0x2c769d){try{if(!_[_0x9d0e('0x1f')](dials[_0x2c769d[_0x9d0e('0x5')]])){utils[_0x9d0e('0x18')](util['format'](_0x9d0e('0x26'),_0x2c769d['uniqueid']),_0x2c769d);dials[_0x2c769d[_0x9d0e('0x5')]][_0x9d0e('0xa')]=_0x2c769d[_0x9d0e('0xa')];if(_0x2c769d[_0x9d0e('0xa')]=='ANSWER'){dials[_0x2c769d[_0x9d0e('0x5')]]=_[_0x9d0e('0x20')](dials[_0x2c769d[_0x9d0e('0x5')]],_0x2c769d);dials[_0x2c769d[_0x9d0e('0x5')]][_0x9d0e('0x27')]=utils[_0x9d0e('0x28')]();dials[_0x2c769d[_0x9d0e('0x5')]][_0x9d0e('0x29')]=_0x9d0e('0x2a');utils['info'](util[_0x9d0e('0x3')](_0x9d0e('0x2b'),_0x2c769d[_0x9d0e('0x5')],_0x2c769d['dialstatus'],dials[_0x2c769d[_0x9d0e('0x5')]][_0x9d0e('0x27')]));}else{utils[_0x9d0e('0x2')](util['format'](_0x9d0e('0x2c'),_0x2c769d[_0x9d0e('0x5')],_0x2c769d['dialstatus']));}}}catch(_0x5b256c){utils['error'](util['format'](_0x9d0e('0x26'),_0x2c769d[_0x9d0e('0x5')]),_0x5b256c);}};exports[_0x9d0e('0x2d')]=function(_0x4cc8f1){try{if(!_['isNil'](dials[_0x4cc8f1[_0x9d0e('0x5')]])){utils[_0x9d0e('0x18')](util[_0x9d0e('0x3')]('[%s][dials][hangup]',_0x4cc8f1[_0x9d0e('0x5')]),_0x4cc8f1);utils[_0x9d0e('0x2')](util[_0x9d0e('0x3')](_0x9d0e('0x2e'),_0x4cc8f1[_0x9d0e('0x5')],_0x4cc8f1['calleridnum'],_0x4cc8f1[_0x9d0e('0x2f')],_0x4cc8f1[_0x9d0e('0x30')]));dials[_0x4cc8f1[_0x9d0e('0x5')]]=_['assign'](dials[_0x4cc8f1[_0x9d0e('0x5')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x31')]=utils[_0x9d0e('0x32')](dials[_0x4cc8f1['uniqueid']][_0x9d0e('0x33')],dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x21')]);dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x34')]=utils['diffTime'](dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x27')]||dials[_0x4cc8f1[_0x9d0e('0x5')]]['endtime'],dials[_0x4cc8f1[_0x9d0e('0x5')]]['starttime']);dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x35')]=dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x27')]?utils[_0x9d0e('0x32')](dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x33')],dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x27')]):0x0;writeDB(dials[_0x4cc8f1[_0x9d0e('0x5')]]);}}catch(_0x1f2a8e){utils[_0x9d0e('0x16')](util[_0x9d0e('0x3')](_0x9d0e('0x36'),_0x4cc8f1['uniqueid']),_0x1f2a8e);}}; \ No newline at end of file +var _0x8f08=['called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','answertime','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','lodash','util','./utils','channel','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','format','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','isNil','[%s][dials][dialbegin]','assign','starttime','now'];(function(_0x1a4f8a,_0x3abeac){var _0x16dcf3=function(_0x5cdc73){while(--_0x5cdc73){_0x1a4f8a['push'](_0x1a4f8a['shift']());}};_0x16dcf3(++_0x3abeac);}(_0x8f08,0x1d2));var _0x88f0=function(_0x13992d,_0x3029ea){_0x13992d=_0x13992d-0x0;var _0x3d15bf=_0x8f08[_0x13992d];return _0x3d15bf;};'use strict';var _=require(_0x88f0('0x0'));var util=require(_0x88f0('0x1'));var utils=require(_0x88f0('0x2'));var dials={};function writeDB(_0x423f5b){utils['info'](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x423f5b['uniqueid'],_0x423f5b[_0x88f0('0x3')],_0x423f5b['dialstring'],_0x423f5b[_0x88f0('0x4')],_0x423f5b[_0x88f0('0x5')],_0x423f5b[_0x88f0('0x6')]));utils[_0x88f0('0x7')](_0x88f0('0x8'),_0x423f5b);delete dials[_0x423f5b[_0x88f0('0x9')]];}exports[_0x88f0('0xa')]=function(_0x5cdf04){try{utils[_0x88f0('0xb')](util[_0x88f0('0xc')]('[%s][dials][newexten]',_0x5cdf04[_0x88f0('0x9')]),_0x5cdf04);utils[_0x88f0('0xd')](util[_0x88f0('0xc')](_0x88f0('0xe'),_0x5cdf04[_0x88f0('0x9')],_0x5cdf04[_0x88f0('0xf')],_0x5cdf04[_0x88f0('0x10')]));if(_0x5cdf04['application'][_0x88f0('0x11')]()==_0x88f0('0x12')&&_[_0x88f0('0x13')](_0x5cdf04[_0x88f0('0x10')][_0x88f0('0x11')](),_0x88f0('0x14'))){var _0x124bc9=_0x5cdf04[_0x88f0('0x10')][_0x88f0('0x15')]('=');dials[_0x5cdf04[_0x88f0('0x9')]]={'routeId':_0x124bc9[0x1]};}}catch(_0x530a60){utils[_0x88f0('0x16')](util[_0x88f0('0xc')](_0x88f0('0x17'),_0x5cdf04[_0x88f0('0x9')]),_0x530a60);}};exports[_0x88f0('0x18')]=function(_0x2deda5){try{utils['debug'](util[_0x88f0('0xc')](_0x88f0('0x19'),_0x2deda5[_0x88f0('0x9')]),_0x2deda5);if(!_['isNil'](_0x2deda5[_0x88f0('0x1a')]['outboundrouteid'])){utils['info'](util[_0x88f0('0xc')](_0x88f0('0x1b'),_0x2deda5[_0x88f0('0x9')],_0x2deda5[_0x88f0('0x1c')]));dials[_0x2deda5['uniqueid']]={'routeId':_0x2deda5['value']};}}catch(_0x154856){utils['error'](util['format'](_0x88f0('0x19'),_0x2deda5[_0x88f0('0x9')]),_0x154856);}};exports['dialbegin']=function(_0x48bf7d){try{if(!_[_0x88f0('0x1d')](dials[_0x48bf7d[_0x88f0('0x9')]])){utils[_0x88f0('0xb')](util[_0x88f0('0xc')](_0x88f0('0x1e'),_0x48bf7d[_0x88f0('0x9')]),_0x48bf7d);dials[_0x48bf7d[_0x88f0('0x9')]]=_[_0x88f0('0x1f')](dials[_0x48bf7d[_0x88f0('0x9')]],_0x48bf7d);dials[_0x48bf7d[_0x88f0('0x9')]][_0x88f0('0x20')]=utils[_0x88f0('0x21')]();dials[_0x48bf7d['uniqueid']]['lastevent']=_0x88f0('0x22');utils[_0x88f0('0xd')](util[_0x88f0('0xc')](_0x88f0('0x23'),_0x48bf7d[_0x88f0('0x9')],dials[_0x48bf7d[_0x88f0('0x9')]][_0x88f0('0x20')]));}}catch(_0x4fe041){utils[_0x88f0('0x16')](util[_0x88f0('0xc')](_0x88f0('0x1e'),_0x48bf7d[_0x88f0('0x9')]),_0x4fe041);}};exports['dialend']=function(_0x3715cb){try{if(!_[_0x88f0('0x1d')](dials[_0x3715cb[_0x88f0('0x9')]])){utils[_0x88f0('0xb')](util[_0x88f0('0xc')](_0x88f0('0x24'),_0x3715cb['uniqueid']),_0x3715cb);dials[_0x3715cb['uniqueid']]['dialstatus']=_0x3715cb['dialstatus'];if(_0x3715cb[_0x88f0('0x6')]==_0x88f0('0x25')){dials[_0x3715cb[_0x88f0('0x9')]]=_['assign'](dials[_0x3715cb[_0x88f0('0x9')]],_0x3715cb);dials[_0x3715cb[_0x88f0('0x9')]][_0x88f0('0x26')]=utils[_0x88f0('0x21')]();dials[_0x3715cb[_0x88f0('0x9')]][_0x88f0('0x27')]=_0x88f0('0x28');utils[_0x88f0('0xd')](util['format'](_0x88f0('0x29'),_0x3715cb['uniqueid'],_0x3715cb['dialstatus'],dials[_0x3715cb[_0x88f0('0x9')]][_0x88f0('0x26')]));}else{utils['info'](util[_0x88f0('0xc')](_0x88f0('0x2a'),_0x3715cb[_0x88f0('0x9')],_0x3715cb[_0x88f0('0x6')]));}}}catch(_0x381179){utils['error'](util[_0x88f0('0xc')](_0x88f0('0x24'),_0x3715cb[_0x88f0('0x9')]),_0x381179);}};exports['hangup']=function(_0x145751){try{if(!_[_0x88f0('0x1d')](dials[_0x145751[_0x88f0('0x9')]])){utils[_0x88f0('0xb')](util['format'](_0x88f0('0x2b'),_0x145751[_0x88f0('0x9')]),_0x145751);utils[_0x88f0('0xd')](util[_0x88f0('0xc')](_0x88f0('0x2c'),_0x145751['uniqueid'],_0x145751[_0x88f0('0x4')],_0x145751['calleridname'],_0x145751[_0x88f0('0x2d')]));dials[_0x145751[_0x88f0('0x9')]]=_[_0x88f0('0x1f')](dials[_0x145751[_0x88f0('0x9')]],{'endtime':utils[_0x88f0('0x21')](),'lastevent':_0x88f0('0x2e')});dials[_0x145751[_0x88f0('0x9')]][_0x88f0('0x2f')]=utils['diffTime'](dials[_0x145751[_0x88f0('0x9')]]['endtime'],dials[_0x145751[_0x88f0('0x9')]]['starttime']);dials[_0x145751[_0x88f0('0x9')]]['holdtime']=utils[_0x88f0('0x30')](dials[_0x145751['uniqueid']][_0x88f0('0x26')]||dials[_0x145751[_0x88f0('0x9')]][_0x88f0('0x31')],dials[_0x145751['uniqueid']][_0x88f0('0x20')]);dials[_0x145751[_0x88f0('0x9')]]['billableseconds']=dials[_0x145751[_0x88f0('0x9')]]['answertime']?utils[_0x88f0('0x30')](dials[_0x145751[_0x88f0('0x9')]][_0x88f0('0x31')],dials[_0x145751['uniqueid']]['answertime']):0x0;writeDB(dials[_0x145751[_0x88f0('0x9')]]);}}catch(_0x37c4ff){utils[_0x88f0('0x16')](util['format'](_0x88f0('0x2b'),_0x145751['uniqueid']),_0x37c4ff);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 3efaa9f..0160b7e 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 _0x3034=['attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialend','[%s][index][dialend]','../../config/environment','./utils','util','xdr','disabled','asterisk','username','keepConnected','XDR\x20DISABLED','info','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','[%s][index][musiconholdstop]','newstate','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','[%s][index][blindtransfer]','blindtransfer','[%s][index][attendedtransfer]'];(function(_0x111032,_0x3a75d6){var _0x1a0a9b=function(_0x33c71f){while(--_0x33c71f){_0x111032['push'](_0x111032['shift']());}};_0x1a0a9b(++_0x3a75d6);}(_0x3034,0x107));var _0x4303=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3034[_0x2641f9];return _0x585741;};var AsteriskManager=require('asterisk-manager');var config=require(_0x4303('0x0'));var utils=require(_0x4303('0x1'));var util=require(_0x4303('0x2'));var isXDREnabled=config['xdr']&&config[_0x4303('0x3')][_0x4303('0x4')]?!config['xdr'][_0x4303('0x4')]:!![];var isProduction=config['env']==='production'||![];var isLocalAsterisk=config[_0x4303('0x3')]&&config[_0x4303('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x4303('0x5')]['port'],config[_0x4303('0x5')]['ip'],config[_0x4303('0x5')][_0x4303('0x6')],config[_0x4303('0x5')]['password'],!![]);ami[_0x4303('0x7')]();if(!isXDREnabled){utils['info'](_0x4303('0x8'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x4303('0x9')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0x4303('0xa'));var recordings=require(_0x4303('0xb'));var members=require(_0x4303('0xc'));var dials=require(_0x4303('0xd'));var transfers=require(_0x4303('0xe'));var core=require('./core.controller');ami['on'](_0x4303('0xf'),core[_0x4303('0xf')]);ami['on'](_0x4303('0x10'),core[_0x4303('0x10')]);ami['on'](_0x4303('0x11'),core[_0x4303('0x11')]);ami['on'](_0x4303('0x12'),core[_0x4303('0x12')]);ami['on'](_0x4303('0x13'),core[_0x4303('0x13')]);ami['on'](_0x4303('0x14'),core[_0x4303('0x14')]);ami['on'](_0x4303('0x15'),function(_0x2df8bc){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x18'),_0x2df8bc[_0x4303('0x19')]),_0x2df8bc);members[_0x4303('0x15')](_0x2df8bc);}catch(_0x29fa7c){utils[_0x4303('0x12')](util[_0x4303('0x17')]('[%s][index][devicestatechange]',_0x2df8bc[_0x4303('0x19')]),_0x29fa7c);}});ami['on']('agentcalled',function(_0x1ba007){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x1a'),_0x1ba007[_0x4303('0x1b')]),_0x1ba007);agents[_0x4303('0x1c')](_0x1ba007);}catch(_0x528c65){utils['error'](util['format']('[%s][index][agentcalled]',_0x1ba007[_0x4303('0x1b')]),_0x528c65);}});ami['on']('agentringnoanswer',function(_0x2487d3){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x1d'),_0x2487d3['uniqueid']),_0x2487d3);agents[_0x4303('0x1e')](_0x2487d3);}catch(_0x495957){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x1d'),_0x2487d3['uniqueid']),_0x495957);}});ami['on'](_0x4303('0x1f'),function(_0x13d515){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x20'),_0x13d515['uniqueid']),_0x13d515);agents[_0x4303('0x1f')](_0x13d515);queues[_0x4303('0x1f')](_0x13d515);}catch(_0x204711){utils[_0x4303('0x12')](util[_0x4303('0x17')]('[%s][index][agentconnect]',_0x13d515[_0x4303('0x1b')]),_0x204711);}});ami['on'](_0x4303('0x21'),function(_0x110052){try{utils[_0x4303('0x16')](util['format'](_0x4303('0x22'),_0x110052[_0x4303('0x1b')]),_0x110052);agents[_0x4303('0x21')](_0x110052);queues[_0x4303('0x21')](_0x110052);members[_0x4303('0x21')](_0x110052);}catch(_0x50db98){utils['error'](util[_0x4303('0x17')](_0x4303('0x22'),_0x110052[_0x4303('0x1b')]),_0x50db98);}});ami['on'](_0x4303('0x23'),function(_0x650c7b){try{utils['debug'](util['format'](_0x4303('0x24'),_0x650c7b[_0x4303('0x1b')]),_0x650c7b);agents[_0x4303('0x23')](_0x650c7b);queues[_0x4303('0x23')](_0x650c7b);}catch(_0x30bb83){utils[_0x4303('0x12')](util[_0x4303('0x17')]('[%s][index][queuecallerabandon]',_0x650c7b[_0x4303('0x1b')]),_0x30bb83);}});ami['on'](_0x4303('0x25'),function(_0x80c27c){try{utils[_0x4303('0x16')](util['format'](_0x4303('0x26'),_0x80c27c['uniqueid']),_0x80c27c);queues['queuecallerjoin'](_0x80c27c);recordings['queuecallerjoin'](_0x80c27c);}catch(_0x85810){utils[_0x4303('0x12')](util[_0x4303('0x17')]('[%s][index][queuecallerjoin]',_0x80c27c[_0x4303('0x1b')]),_0x85810);}});ami['on'](_0x4303('0x27'),function(_0x3800b7){try{utils['debug'](util[_0x4303('0x17')](_0x4303('0x28'),_0x3800b7[_0x4303('0x1b')]),_0x3800b7);queues[_0x4303('0x27')](_0x3800b7);}catch(_0x33e92c){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x28'),_0x3800b7[_0x4303('0x1b')]),_0x33e92c);}});ami['on']('musiconholdstart',function(_0xe784ce){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x29'),_0xe784ce['uniqueid']),_0xe784ce);queues[_0x4303('0x2a')](_0xe784ce);calls[_0x4303('0x2a')](_0xe784ce);}catch(_0x349601){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x29'),_0xe784ce[_0x4303('0x1b')]),_0x349601);}});ami['on']('musiconholdstop',function(_0x1e7153){try{utils[_0x4303('0x16')](util['format'](_0x4303('0x2b'),_0x1e7153[_0x4303('0x1b')]),_0x1e7153);queues['musiconholdstop'](_0x1e7153);calls['musiconholdstop'](_0x1e7153);}catch(_0x1dadc8){utils['error'](util[_0x4303('0x17')](_0x4303('0x2b'),_0x1e7153['uniqueid']),_0x1dadc8);}});ami['on']('newstate',function(_0x995c87){try{utils[_0x4303('0x16')](util[_0x4303('0x17')]('[%s][index][newstate]',_0x995c87[_0x4303('0x1b')]),_0x995c87);calls[_0x4303('0x2c')](_0x995c87);recordings[_0x4303('0x2c')](_0x995c87);}catch(_0x485fb9){utils['error'](util[_0x4303('0x17')]('[%s][index][newstate]',_0x995c87['uniqueid']),_0x485fb9);}});ami['on'](_0x4303('0x2d'),function(_0xd702de){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x2e'),_0xd702de[_0x4303('0x1b')]),_0xd702de);calls[_0x4303('0x2d')](_0xd702de);recordings[_0x4303('0x2d')](_0xd702de);dials[_0x4303('0x2d')](_0xd702de);agents[_0x4303('0x2d')](_0xd702de);queues[_0x4303('0x2d')](_0xd702de);}catch(_0x1af65e){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x2e'),_0xd702de[_0x4303('0x1b')]),_0x1af65e);}});ami['on']('cdr',function(_0x34abc1){try{utils[_0x4303('0x16')](util['format'](_0x4303('0x2f'),_0x34abc1[_0x4303('0x1b')]),_0x34abc1);members[_0x4303('0x30')](_0x34abc1);}catch(_0x340820){utils[_0x4303('0x12')](util[_0x4303('0x17')]('[%s][index][cdr]',_0x34abc1[_0x4303('0x1b')]),_0x340820);}});ami['on']('blindtransfer',function(_0x1266c5){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x31'),_0x1266c5[_0x4303('0x1b')]),_0x1266c5);queues[_0x4303('0x32')](_0x1266c5);agents[_0x4303('0x32')](_0x1266c5);transfers['blindtransfer'](_0x1266c5);}catch(_0x426480){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x31'),_0x1266c5[_0x4303('0x1b')]),_0x426480);}});ami['on']('attendedtransfer',function(_0x151a2c){try{utils[_0x4303('0x16')](util['format'](_0x4303('0x33'),_0x151a2c['origtransfereruniqueid']),_0x151a2c);queues[_0x4303('0x34')](_0x151a2c);transfers[_0x4303('0x34')](_0x151a2c);agents['attendedtransfer'](_0x151a2c);calls['attendedtransfer'](_0x151a2c);}catch(_0x52799e){utils['error'](util[_0x4303('0x17')](_0x4303('0x33'),_0x151a2c[_0x4303('0x35')]),_0x52799e);}});ami['on'](_0x4303('0x36'),function(_0x51a451){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x37'),_0x51a451[_0x4303('0x1b')]),_0x51a451);queues[_0x4303('0x36')](_0x51a451);recordings[_0x4303('0x36')](_0x51a451);calls[_0x4303('0x36')](_0x51a451);dials[_0x4303('0x36')](_0x51a451);}catch(_0x1496c9){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x37'),_0x51a451[_0x4303('0x1b')]),_0x1496c9);}});ami['on'](_0x4303('0x38'),function(_0x22db57){try{utils[_0x4303('0x16')](util['format'](_0x4303('0x39'),_0x22db57[_0x4303('0x1b')]),_0x22db57);calls[_0x4303('0x38')](_0x22db57);recordings[_0x4303('0x38')](_0x22db57);dials['newexten'](_0x22db57);}catch(_0x45d942){utils['error'](util[_0x4303('0x17')](_0x4303('0x39'),_0x22db57[_0x4303('0x1b')]),_0x45d942);}});ami['on'](_0x4303('0x3a'),function(_0x2242a2){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x3b'),_0x2242a2[_0x4303('0x1b')]),_0x2242a2);calls[_0x4303('0x3a')](_0x2242a2);recordings[_0x4303('0x3a')](_0x2242a2);}catch(_0x16ae20){utils['error'](util[_0x4303('0x17')](_0x4303('0x3b'),_0x2242a2[_0x4303('0x1b')]),_0x16ae20);}});ami['on']('dialbegin',function(_0x4d3b6a){try{utils['debug'](util[_0x4303('0x17')](_0x4303('0x3c'),_0x4d3b6a[_0x4303('0x1b')]),_0x4d3b6a);dials['dialbegin'](_0x4d3b6a);}catch(_0x20de3a){utils[_0x4303('0x12')](util[_0x4303('0x17')]('[%s]dialbegin',_0x4d3b6a[_0x4303('0x1b')]),_0x20de3a);}});ami['on'](_0x4303('0x3d'),function(_0x4e7039){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x3e'),_0x4e7039[_0x4303('0x1b')]),_0x4e7039);dials[_0x4303('0x3d')](_0x4e7039);}catch(_0x31c705){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x3e'),_0x4e7039[_0x4303('0x1b')]),_0x31c705);}});} \ No newline at end of file +var _0x50c7=['./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','fullybooted','error','close','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][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','[%s][index][dialend]','../../config/environment','./utils','xdr','disabled','env','production','local','asterisk','port','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller'];(function(_0x1cd75d,_0x391ee0){var _0x3d7cfd=function(_0x4471e1){while(--_0x4471e1){_0x1cd75d['push'](_0x1cd75d['shift']());}};_0x3d7cfd(++_0x391ee0);}(_0x50c7,0x7a));var _0x750c=function(_0x56f9b5,_0x34ef88){_0x56f9b5=_0x56f9b5-0x0;var _0x47afe4=_0x50c7[_0x56f9b5];return _0x47afe4;};var AsteriskManager=require('asterisk-manager');var config=require(_0x750c('0x0'));var utils=require(_0x750c('0x1'));var util=require('util');var isXDREnabled=config[_0x750c('0x2')]&&config[_0x750c('0x2')][_0x750c('0x3')]?!config[_0x750c('0x2')][_0x750c('0x3')]:!![];var isProduction=config[_0x750c('0x4')]===_0x750c('0x5')||![];var isLocalAsterisk=config[_0x750c('0x2')]&&config['xdr'][_0x750c('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x750c('0x7')][_0x750c('0x8')],config[_0x750c('0x7')]['ip'],config[_0x750c('0x7')]['username'],config['asterisk']['password'],!![]);ami[_0x750c('0x9')]();if(!isXDREnabled){utils[_0x750c('0xa')](_0x750c('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x750c('0xc'));}else{var agents=require(_0x750c('0xd'));var calls=require('./calls.controller');var queues=require(_0x750c('0xe'));var recordings=require(_0x750c('0xf'));var members=require(_0x750c('0x10'));var dials=require('./dials.controller');var transfers=require(_0x750c('0x11'));var core=require(_0x750c('0x12'));ami['on'](_0x750c('0x13'),core['connect']);ami['on']('shutdown',core['shutdown']);ami['on'](_0x750c('0x14'),core[_0x750c('0x14')]);ami['on'](_0x750c('0x15'),core[_0x750c('0x15')]);ami['on'](_0x750c('0x16'),core['close']);ami['on']('managerevent',core['managerevent']);ami['on'](_0x750c('0x17'),function(_0x2fa245){try{utils[_0x750c('0x18')](util[_0x750c('0x19')](_0x750c('0x1a'),_0x2fa245[_0x750c('0x1b')]),_0x2fa245);members[_0x750c('0x17')](_0x2fa245);}catch(_0x20d49e){utils[_0x750c('0x15')](util['format'](_0x750c('0x1a'),_0x2fa245[_0x750c('0x1b')]),_0x20d49e);}});ami['on']('agentcalled',function(_0x135d84){try{utils[_0x750c('0x18')](util[_0x750c('0x19')](_0x750c('0x1c'),_0x135d84['uniqueid']),_0x135d84);agents[_0x750c('0x1d')](_0x135d84);}catch(_0x292da5){utils[_0x750c('0x15')](util['format'](_0x750c('0x1c'),_0x135d84[_0x750c('0x1e')]),_0x292da5);}});ami['on'](_0x750c('0x1f'),function(_0x58ad1e){try{utils['debug'](util['format']('[%s][index][agentringnoanswer]',_0x58ad1e[_0x750c('0x1e')]),_0x58ad1e);agents[_0x750c('0x1f')](_0x58ad1e);}catch(_0x4979eb){utils['error'](util['format'](_0x750c('0x20'),_0x58ad1e[_0x750c('0x1e')]),_0x4979eb);}});ami['on'](_0x750c('0x21'),function(_0x487cf0){try{utils['debug'](util[_0x750c('0x19')](_0x750c('0x22'),_0x487cf0['uniqueid']),_0x487cf0);agents[_0x750c('0x21')](_0x487cf0);queues[_0x750c('0x21')](_0x487cf0);}catch(_0xd78347){utils[_0x750c('0x15')](util[_0x750c('0x19')](_0x750c('0x22'),_0x487cf0[_0x750c('0x1e')]),_0xd78347);}});ami['on'](_0x750c('0x23'),function(_0x29f27c){try{utils[_0x750c('0x18')](util[_0x750c('0x19')]('[%s][index][agentcomplete]',_0x29f27c[_0x750c('0x1e')]),_0x29f27c);agents['agentcomplete'](_0x29f27c);queues['agentcomplete'](_0x29f27c);members['agentcomplete'](_0x29f27c);}catch(_0x32bc3d){utils[_0x750c('0x15')](util[_0x750c('0x19')](_0x750c('0x24'),_0x29f27c['uniqueid']),_0x32bc3d);}});ami['on'](_0x750c('0x25'),function(_0x450f8b){try{utils[_0x750c('0x18')](util['format'](_0x750c('0x26'),_0x450f8b[_0x750c('0x1e')]),_0x450f8b);agents[_0x750c('0x25')](_0x450f8b);queues['queuecallerabandon'](_0x450f8b);}catch(_0x3054e0){utils[_0x750c('0x15')](util['format'](_0x750c('0x26'),_0x450f8b['uniqueid']),_0x3054e0);}});ami['on'](_0x750c('0x27'),function(_0x5231a4){try{utils[_0x750c('0x18')](util['format'](_0x750c('0x28'),_0x5231a4[_0x750c('0x1e')]),_0x5231a4);queues[_0x750c('0x27')](_0x5231a4);recordings[_0x750c('0x27')](_0x5231a4);}catch(_0x429cbb){utils[_0x750c('0x15')](util[_0x750c('0x19')](_0x750c('0x28'),_0x5231a4['uniqueid']),_0x429cbb);}});ami['on']('queuecallerleave',function(_0x4ce559){try{utils[_0x750c('0x18')](util['format'](_0x750c('0x29'),_0x4ce559['uniqueid']),_0x4ce559);queues[_0x750c('0x2a')](_0x4ce559);}catch(_0x28e4c8){utils['error'](util[_0x750c('0x19')](_0x750c('0x29'),_0x4ce559['uniqueid']),_0x28e4c8);}});ami['on']('musiconholdstart',function(_0x5c68f1){try{utils[_0x750c('0x18')](util[_0x750c('0x19')]('[%s][index][musiconholdstart]',_0x5c68f1[_0x750c('0x1e')]),_0x5c68f1);queues[_0x750c('0x2b')](_0x5c68f1);calls[_0x750c('0x2b')](_0x5c68f1);}catch(_0x494b7c){utils[_0x750c('0x15')](util[_0x750c('0x19')](_0x750c('0x2c'),_0x5c68f1['uniqueid']),_0x494b7c);}});ami['on'](_0x750c('0x2d'),function(_0xbee42a){try{utils[_0x750c('0x18')](util[_0x750c('0x19')](_0x750c('0x2e'),_0xbee42a[_0x750c('0x1e')]),_0xbee42a);queues[_0x750c('0x2d')](_0xbee42a);calls['musiconholdstop'](_0xbee42a);}catch(_0x13d86f){utils['error'](util['format'](_0x750c('0x2e'),_0xbee42a[_0x750c('0x1e')]),_0x13d86f);}});ami['on'](_0x750c('0x2f'),function(_0x3db720){try{utils[_0x750c('0x18')](util[_0x750c('0x19')]('[%s][index][newstate]',_0x3db720[_0x750c('0x1e')]),_0x3db720);calls[_0x750c('0x2f')](_0x3db720);recordings[_0x750c('0x2f')](_0x3db720);}catch(_0x88bfa0){utils[_0x750c('0x15')](util[_0x750c('0x19')](_0x750c('0x30'),_0x3db720['uniqueid']),_0x88bfa0);}});ami['on'](_0x750c('0x31'),function(_0x23f700){try{utils[_0x750c('0x18')](util[_0x750c('0x19')](_0x750c('0x32'),_0x23f700[_0x750c('0x1e')]),_0x23f700);calls['hangup'](_0x23f700);recordings[_0x750c('0x31')](_0x23f700);dials['hangup'](_0x23f700);agents[_0x750c('0x31')](_0x23f700);queues[_0x750c('0x31')](_0x23f700);}catch(_0x3177d3){utils[_0x750c('0x15')](util[_0x750c('0x19')](_0x750c('0x32'),_0x23f700[_0x750c('0x1e')]),_0x3177d3);}});ami['on'](_0x750c('0x33'),function(_0x8e14f0){try{utils[_0x750c('0x18')](util[_0x750c('0x19')](_0x750c('0x34'),_0x8e14f0[_0x750c('0x1e')]),_0x8e14f0);members['cdr'](_0x8e14f0);}catch(_0x5420de){utils[_0x750c('0x15')](util[_0x750c('0x19')](_0x750c('0x34'),_0x8e14f0[_0x750c('0x1e')]),_0x5420de);}});ami['on'](_0x750c('0x35'),function(_0x3c7d85){try{utils[_0x750c('0x18')](util[_0x750c('0x19')](_0x750c('0x36'),_0x3c7d85['uniqueid']),_0x3c7d85);queues[_0x750c('0x35')](_0x3c7d85);agents['blindtransfer'](_0x3c7d85);transfers[_0x750c('0x35')](_0x3c7d85);}catch(_0x47bc42){utils[_0x750c('0x15')](util[_0x750c('0x19')](_0x750c('0x36'),_0x3c7d85[_0x750c('0x1e')]),_0x47bc42);}});ami['on'](_0x750c('0x37'),function(_0x165333){try{utils[_0x750c('0x18')](util[_0x750c('0x19')](_0x750c('0x38'),_0x165333['origtransfereruniqueid']),_0x165333);queues['attendedtransfer'](_0x165333);transfers[_0x750c('0x37')](_0x165333);agents[_0x750c('0x37')](_0x165333);calls[_0x750c('0x37')](_0x165333);}catch(_0x42a4dd){utils[_0x750c('0x15')](util['format'](_0x750c('0x38'),_0x165333[_0x750c('0x39')]),_0x42a4dd);}});ami['on'](_0x750c('0x3a'),function(_0x5291cd){try{utils['debug'](util[_0x750c('0x19')](_0x750c('0x3b'),_0x5291cd['uniqueid']),_0x5291cd);queues[_0x750c('0x3a')](_0x5291cd);recordings[_0x750c('0x3a')](_0x5291cd);calls['varset'](_0x5291cd);dials[_0x750c('0x3a')](_0x5291cd);}catch(_0x455873){utils[_0x750c('0x15')](util[_0x750c('0x19')](_0x750c('0x3b'),_0x5291cd[_0x750c('0x1e')]),_0x455873);}});ami['on'](_0x750c('0x3c'),function(_0x23cea0){try{utils[_0x750c('0x18')](util[_0x750c('0x19')](_0x750c('0x3d'),_0x23cea0[_0x750c('0x1e')]),_0x23cea0);calls['newexten'](_0x23cea0);recordings['newexten'](_0x23cea0);dials[_0x750c('0x3c')](_0x23cea0);}catch(_0x35a886){utils[_0x750c('0x15')](util[_0x750c('0x19')](_0x750c('0x3d'),_0x23cea0[_0x750c('0x1e')]),_0x35a886);}});ami['on'](_0x750c('0x3e'),function(_0x2c24aa){try{utils[_0x750c('0x18')](util[_0x750c('0x19')](_0x750c('0x3f'),_0x2c24aa[_0x750c('0x1e')]),_0x2c24aa);calls[_0x750c('0x3e')](_0x2c24aa);recordings[_0x750c('0x3e')](_0x2c24aa);}catch(_0x1eb7f7){utils['error'](util[_0x750c('0x19')](_0x750c('0x3f'),_0x2c24aa[_0x750c('0x1e')]),_0x1eb7f7);}});ami['on'](_0x750c('0x40'),function(_0xd3d44b){try{utils[_0x750c('0x18')](util[_0x750c('0x19')](_0x750c('0x41'),_0xd3d44b['uniqueid']),_0xd3d44b);dials[_0x750c('0x40')](_0xd3d44b);}catch(_0x5bae80){utils[_0x750c('0x15')](util['format'](_0x750c('0x42'),_0xd3d44b[_0x750c('0x1e')]),_0x5bae80);}});ami['on']('dialend',function(_0x22400a){try{utils[_0x750c('0x18')](util[_0x750c('0x19')](_0x750c('0x43'),_0x22400a[_0x750c('0x1e')]),_0x22400a);dials['dialend'](_0x22400a);}catch(_0x4664c6){utils[_0x750c('0x15')](util['format'](_0x750c('0x43'),_0x22400a['uniqueid']),_0x4664c6);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index b92fcb9..ad41a32 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 _0x38c3=['exitAt','duration','diffTime','agentcomplete','debug','[%s][members][agentcomplete]','queue','assign','[%s][members][cdr]','channel','data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','data2','membername','getUserByInterface','name','internal','request','CreateMemberReport','split','catch','error','[%s][members][writeDB]','uniqueid','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','isNil'];(function(_0x308374,_0x550e85){var _0x1f71e0=function(_0x18377d){while(--_0x18377d){_0x308374['push'](_0x308374['shift']());}};_0x1f71e0(++_0x550e85);}(_0x38c3,0x13d));var _0x338c=function(_0x188905,_0x398fac){_0x188905=_0x188905-0x0;var _0x2bf735=_0x38c3[_0x188905];return _0x2bf735;};'use strict';var _=require(_0x338c('0x0'));var util=require(_0x338c('0x1'));var utils=require('./utils');var members={};var exclude=[_0x338c('0x2'),_0x338c('0x3')];function writeDB(_0x36a187){utils[_0x338c('0x4')](util[_0x338c('0x5')](_0x338c('0x6'),_0x36a187['uniqueid'],_0x36a187[_0x338c('0x7')],_0x36a187['channel'],_0x36a187[_0x338c('0x8')],_0x36a187[_0x338c('0x9')],_0x36a187['type']));if(_0x36a187[_0x338c('0x7')]){utils[_0x338c('0xa')](_0x36a187[_0x338c('0x7')])['then'](function(_0x2f3652){if(_0x2f3652){_0x36a187[_0x338c('0x9')]=_0x2f3652[_0x338c('0xb')];_0x36a187[_0x338c('0xc')]=_0x2f3652[_0x338c('0xc')];utils[_0x338c('0xd')](_0x338c('0xe'),_0x36a187);}else{utils['getUserByName'](_0x36a187[_0x338c('0x7')][_0x338c('0xf')]('/')[0x1])['then'](function(_0x2e17b8){if(_0x2e17b8){_0x36a187['membername']=_0x2e17b8[_0x338c('0xb')];_0x36a187[_0x338c('0xc')]=_0x2e17b8['internal'];utils[_0x338c('0xd')](_0x338c('0xe'),_0x36a187);}});}})[_0x338c('0x10')](function(_0x3f3c08){utils[_0x338c('0x11')](util[_0x338c('0x5')](_0x338c('0x12'),_0x36a187[_0x338c('0x13')]),_0x3f3c08);});}delete members[_0x36a187[_0x338c('0x7')]];}function startsWith(_0x127cd1,_0x512b38){return _['some'](_0x127cd1,function(_0x26a6dd){return _[_0x338c('0x14')](_0x512b38,_0x26a6dd);});}exports[_0x338c('0x15')]=function(_0x21cbd4){try{utils['debug'](util[_0x338c('0x5')](_0x338c('0x16'),members[_0x21cbd4[_0x338c('0x17')]]?members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x13')]:_0x21cbd4[_0x338c('0x17')]),_0x21cbd4);utils[_0x338c('0x4')](util[_0x338c('0x5')](_0x338c('0x18'),members[_0x21cbd4[_0x338c('0x17')]]?members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x13')]:_0x21cbd4[_0x338c('0x17')],_0x21cbd4['state'],_0x21cbd4['device']));switch(_0x21cbd4[_0x338c('0x19')]){case _0x338c('0x1a'):case _0x338c('0x1b'):if(!startsWith(exclude,_0x21cbd4[_0x338c('0x17')])){members[_0x21cbd4['device']]={'channel':_0x338c('0x1c'),'interface':_0x21cbd4['device'],'type':_0x338c('0x1d'),'enterAt':utils[_0x338c('0x1e')](),'role':'agent'};}break;case _0x338c('0x1f'):if(!_[_0x338c('0x20')](members[_0x21cbd4['device']])){members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x21')]=utils[_0x338c('0x1e')]();members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x22')]=utils[_0x338c('0x23')](members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x21')],members[_0x21cbd4[_0x338c('0x17')]]['enterAt']);if(members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x13')]){writeDB(members[_0x21cbd4[_0x338c('0x17')]]);}}break;default:break;}}catch(_0x4d78a5){utils[_0x338c('0x11')](util[_0x338c('0x5')]('[%s][members][devicestatechange]',members[_0x21cbd4[_0x338c('0x17')]]?members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x13')]:_0x21cbd4[_0x338c('0x17')]),_0x4d78a5);}};exports[_0x338c('0x24')]=function(_0x2ae332){try{if(!_['isNil'](members[_0x2ae332['interface']])){utils[_0x338c('0x25')](util[_0x338c('0x5')](_0x338c('0x26'),_0x2ae332[_0x338c('0x13')]),_0x2ae332);utils[_0x338c('0x4')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x2ae332[_0x338c('0x13')],_0x2ae332['interface'],_0x2ae332[_0x338c('0x27')]));members[_0x2ae332[_0x338c('0x7')]]=_[_0x338c('0x28')](members[_0x2ae332[_0x338c('0x7')]],{'data4':_0x2ae332[_0x338c('0x27')],'uniqueid':_0x2ae332[_0x338c('0x13')]});}}catch(_0x4a148e){utils['error'](util['format'](_0x338c('0x26'),_0x2ae332[_0x338c('0x13')]),_0x4a148e);}};exports['cdr']=function(_0x1656c6){try{utils[_0x338c('0x25')](util[_0x338c('0x5')](_0x338c('0x29'),_0x1656c6[_0x338c('0x13')]),_0x1656c6);if(_0x1656c6[_0x338c('0x2a')]){var _0x579073=_0x1656c6[_0x338c('0x2a')][_0x338c('0xf')]('-')[0x0];if(!_[_0x338c('0x20')](members[_0x579073])){members[_0x579073]=_['assign'](members[_0x579073],{'data1':members[_0x579073][_0x338c('0x2b')]||_0x1656c6[_0x338c('0x2c')],'data2':members[_0x579073][_0x338c('0x8')]||_0x1656c6[_0x338c('0x2d')],'data3':members[_0x579073][_0x338c('0x2e')]||_0x1656c6[_0x338c('0x2f')],'uniqueid':members[_0x579073][_0x338c('0x13')]||_0x1656c6[_0x338c('0x13')]});utils['info'](util[_0x338c('0x5')](_0x338c('0x30'),_0x1656c6[_0x338c('0x13')],members[_0x579073][_0x338c('0x2b')],members[_0x579073]['data2'],members[_0x579073][_0x338c('0x2e')]));if(members[_0x579073][_0x338c('0x21')]){writeDB(members[_0x579073]);}}}if(_0x1656c6[_0x338c('0x31')]){var _0x314015=_0x1656c6['destinationchannel'][_0x338c('0xf')]('-')[0x0];if(!_[_0x338c('0x20')](members[_0x314015])){members[_0x314015]=_[_0x338c('0x28')](members[_0x314015],{'data1':members[_0x314015][_0x338c('0x2b')]||_0x1656c6[_0x338c('0x2c')],'data2':members[_0x314015][_0x338c('0x8')]||_0x1656c6[_0x338c('0x2d')],'data3':members[_0x314015][_0x338c('0x2e')]||_0x1656c6[_0x338c('0x2f')],'uniqueid':members[_0x314015][_0x338c('0x13')]||_0x1656c6[_0x338c('0x13')]});utils[_0x338c('0x4')](util[_0x338c('0x5')](_0x338c('0x30'),_0x1656c6[_0x338c('0x13')],members[_0x314015][_0x338c('0x2b')],members[_0x314015][_0x338c('0x8')],members[_0x314015][_0x338c('0x2e')]));if(members[_0x314015][_0x338c('0x21')]){writeDB(members[_0x314015]);}}}}catch(_0x17f520){utils[_0x338c('0x11')](util[_0x338c('0x5')](_0x338c('0x29'),_0x1656c6[_0x338c('0x13')]),_0x17f520);}}; \ No newline at end of file +var _0x8ec7=['isNil','exitAt','duration','diffTime','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','type','source','[%s][members][cdr]','lodash','util','Local/_attended@transfer','info','format','uniqueid','interface','channel','data2','membername','then','name','internal','request','CreateMemberReport','split','catch','error','[%s][members][writeDB]','some','startsWith','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','now','agent','NOT_INUSE'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x8ec7,0x1f1));var _0x78ec=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0x8ec7[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0x78ec('0x0'));var util=require(_0x78ec('0x1'));var utils=require('./utils');var members={};var exclude=[_0x78ec('0x2'),'Queue:'];function writeDB(_0x47d4c9){utils[_0x78ec('0x3')](util[_0x78ec('0x4')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x47d4c9[_0x78ec('0x5')],_0x47d4c9[_0x78ec('0x6')],_0x47d4c9[_0x78ec('0x7')],_0x47d4c9[_0x78ec('0x8')],_0x47d4c9[_0x78ec('0x9')],_0x47d4c9['type']));if(_0x47d4c9[_0x78ec('0x6')]){utils['getUserByInterface'](_0x47d4c9[_0x78ec('0x6')])[_0x78ec('0xa')](function(_0x264abb){if(_0x264abb){_0x47d4c9['membername']=_0x264abb[_0x78ec('0xb')];_0x47d4c9[_0x78ec('0xc')]=_0x264abb[_0x78ec('0xc')];utils[_0x78ec('0xd')](_0x78ec('0xe'),_0x47d4c9);}else{utils['getUserByName'](_0x47d4c9['interface'][_0x78ec('0xf')]('/')[0x1])[_0x78ec('0xa')](function(_0x1a9060){if(_0x1a9060){_0x47d4c9['membername']=_0x1a9060[_0x78ec('0xb')];_0x47d4c9[_0x78ec('0xc')]=_0x1a9060[_0x78ec('0xc')];utils[_0x78ec('0xd')](_0x78ec('0xe'),_0x47d4c9);}});}})[_0x78ec('0x10')](function(_0x7f90e1){utils[_0x78ec('0x11')](util[_0x78ec('0x4')](_0x78ec('0x12'),_0x47d4c9[_0x78ec('0x5')]),_0x7f90e1);});}delete members[_0x47d4c9['interface']];}function startsWith(_0x1997ca,_0x275f7e){return _[_0x78ec('0x13')](_0x1997ca,function(_0x3855a4){return _[_0x78ec('0x14')](_0x275f7e,_0x3855a4);});}exports['devicestatechange']=function(_0x4f9ffd){try{utils['debug'](util['format'](_0x78ec('0x15'),members[_0x4f9ffd[_0x78ec('0x16')]]?members[_0x4f9ffd[_0x78ec('0x16')]][_0x78ec('0x5')]:_0x4f9ffd[_0x78ec('0x16')]),_0x4f9ffd);utils[_0x78ec('0x3')](util[_0x78ec('0x4')](_0x78ec('0x17'),members[_0x4f9ffd[_0x78ec('0x16')]]?members[_0x4f9ffd['device']][_0x78ec('0x5')]:_0x4f9ffd[_0x78ec('0x16')],_0x4f9ffd[_0x78ec('0x18')],_0x4f9ffd['device']));switch(_0x4f9ffd[_0x78ec('0x18')]){case'INUSE':case _0x78ec('0x19'):if(!startsWith(exclude,_0x4f9ffd[_0x78ec('0x16')])){members[_0x4f9ffd['device']]={'channel':_0x78ec('0x1a'),'interface':_0x4f9ffd['device'],'type':_0x78ec('0x1b'),'enterAt':utils[_0x78ec('0x1c')](),'role':_0x78ec('0x1d')};}break;case _0x78ec('0x1e'):if(!_[_0x78ec('0x1f')](members[_0x4f9ffd['device']])){members[_0x4f9ffd[_0x78ec('0x16')]][_0x78ec('0x20')]=utils[_0x78ec('0x1c')]();members[_0x4f9ffd[_0x78ec('0x16')]][_0x78ec('0x21')]=utils[_0x78ec('0x22')](members[_0x4f9ffd[_0x78ec('0x16')]][_0x78ec('0x20')],members[_0x4f9ffd['device']]['enterAt']);if(members[_0x4f9ffd[_0x78ec('0x16')]]['uniqueid']){writeDB(members[_0x4f9ffd[_0x78ec('0x16')]]);}}break;default:break;}}catch(_0x1f30c2){utils[_0x78ec('0x11')](util[_0x78ec('0x4')](_0x78ec('0x15'),members[_0x4f9ffd[_0x78ec('0x16')]]?members[_0x4f9ffd['device']]['uniqueid']:_0x4f9ffd[_0x78ec('0x16')]),_0x1f30c2);}};exports['agentcomplete']=function(_0x3a6c39){try{if(!_[_0x78ec('0x1f')](members[_0x3a6c39[_0x78ec('0x6')]])){utils[_0x78ec('0x23')](util[_0x78ec('0x4')](_0x78ec('0x24'),_0x3a6c39[_0x78ec('0x5')]),_0x3a6c39);utils[_0x78ec('0x3')](util[_0x78ec('0x4')](_0x78ec('0x25'),_0x3a6c39['uniqueid'],_0x3a6c39[_0x78ec('0x6')],_0x3a6c39[_0x78ec('0x26')]));members[_0x3a6c39[_0x78ec('0x6')]]=_[_0x78ec('0x27')](members[_0x3a6c39[_0x78ec('0x6')]],{'data4':_0x3a6c39[_0x78ec('0x26')],'uniqueid':_0x3a6c39[_0x78ec('0x5')]});}}catch(_0x4903a8){utils[_0x78ec('0x11')](util['format'](_0x78ec('0x24'),_0x3a6c39[_0x78ec('0x5')]),_0x4903a8);}};exports['cdr']=function(_0x219d4c){try{utils[_0x78ec('0x23')](util[_0x78ec('0x4')]('[%s][members][cdr]',_0x219d4c[_0x78ec('0x5')]),_0x219d4c);if(_0x219d4c[_0x78ec('0x7')]){var _0x295dd4=_0x219d4c[_0x78ec('0x7')][_0x78ec('0xf')]('-')[0x0];if(!_[_0x78ec('0x1f')](members[_0x295dd4])){members[_0x295dd4]=_[_0x78ec('0x27')](members[_0x295dd4],{'data1':members[_0x295dd4]['data1']||_0x219d4c['type'],'data2':members[_0x295dd4][_0x78ec('0x8')]||_0x219d4c['source'],'data3':members[_0x295dd4][_0x78ec('0x28')]||_0x219d4c[_0x78ec('0x29')],'uniqueid':members[_0x295dd4]['uniqueid']||_0x219d4c[_0x78ec('0x5')]});utils['info'](util['format'](_0x78ec('0x2a'),_0x219d4c[_0x78ec('0x5')],members[_0x295dd4][_0x78ec('0x2b')],members[_0x295dd4]['data2'],members[_0x295dd4][_0x78ec('0x28')]));if(members[_0x295dd4]['exitAt']){writeDB(members[_0x295dd4]);}}}if(_0x219d4c['destinationchannel']){var _0x443a7a=_0x219d4c[_0x78ec('0x2c')][_0x78ec('0xf')]('-')[0x0];if(!_[_0x78ec('0x1f')](members[_0x443a7a])){members[_0x443a7a]=_[_0x78ec('0x27')](members[_0x443a7a],{'data1':members[_0x443a7a][_0x78ec('0x2b')]||_0x219d4c[_0x78ec('0x2d')],'data2':members[_0x443a7a][_0x78ec('0x8')]||_0x219d4c[_0x78ec('0x2e')],'data3':members[_0x443a7a][_0x78ec('0x28')]||_0x219d4c[_0x78ec('0x29')],'uniqueid':members[_0x443a7a][_0x78ec('0x5')]||_0x219d4c[_0x78ec('0x5')]});utils['info'](util[_0x78ec('0x4')](_0x78ec('0x2a'),_0x219d4c[_0x78ec('0x5')],members[_0x443a7a][_0x78ec('0x2b')],members[_0x443a7a][_0x78ec('0x8')],members[_0x443a7a][_0x78ec('0x28')]));if(members[_0x443a7a]['exitAt']){writeDB(members[_0x443a7a]);}}}}catch(_0x2c8794){utils[_0x78ec('0x11')](util[_0x78ec('0x4')](_0x78ec('0x2f'),_0x219d4c[_0x78ec('0x5')]),_0x2c8794);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 2491187..7ef032f 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 _0x30fa=['connectedlinename','queuecallerleave','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','reason','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','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]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerabandon','queuecallerexitAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum'];(function(_0x3c3c49,_0x48b860){var _0x4d13e0=function(_0xeeda09){while(--_0xeeda09){_0x3c3c49['push'](_0x3c3c49['shift']());}};_0x4d13e0(++_0x48b860);}(_0x30fa,0x1d9));var _0xa30f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x30fa[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0xa30f('0x0'));var utils=require(_0xa30f('0x1'));var queues={};function writeDB(_0x4423e7){utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x4'),_0x4423e7[_0xa30f('0x5')],_0x4423e7[_0xa30f('0x6')],_0x4423e7[_0xa30f('0x7')],_0x4423e7[_0xa30f('0x8')],_0x4423e7[_0xa30f('0x9')],_0x4423e7[_0xa30f('0xa')],_0x4423e7[_0xa30f('0xb')]));if(_0x4423e7[_0xa30f('0x7')]){utils[_0xa30f('0xc')](_0x4423e7[_0xa30f('0x7')])[_0xa30f('0xd')](function(_0x22aef3){if(_0x22aef3){_0x4423e7['type']=_0x22aef3[_0xa30f('0xe')];}utils[_0xa30f('0xf')]('CreateVoiceQueueReport',_0x4423e7);});}else{utils['request'](_0xa30f('0x10'),_0x4423e7);}if(_0x4423e7[_0xa30f('0x11')]){delete queues[_0x4423e7[_0xa30f('0x11')]];}else{delete queues[_0x4423e7[_0xa30f('0x5')]];}}exports[_0xa30f('0x12')]=function(_0xa8756b){try{utils[_0xa30f('0x13')](util['format']('[%s][queues][queuecallerjoin]',_0xa8756b[_0xa30f('0x5')]),_0xa8756b);utils[_0xa30f('0x2')](util['format'](_0xa30f('0x14'),_0xa8756b['uniqueid'],_0xa8756b['queue'],_0xa8756b[_0xa30f('0x15')]));queues[_0xa8756b[_0xa30f('0x5')]]=_['assign'](_0xa8756b,{'originalposition':_0xa8756b[_0xa30f('0x15')],'queuecallerjoinAt':utils[_0xa30f('0x16')](),'mohtime':0x0});}catch(_0x226be7){utils[_0xa30f('0x17')](util['format'](_0xa30f('0x18'),_0xa8756b[_0xa30f('0x5')]),_0x226be7);}};exports[_0xa30f('0x19')]=function(_0x3413fe){try{if(!_[_0xa30f('0x1a')](queues[_0x3413fe['uniqueid']])){utils[_0xa30f('0x13')](util[_0xa30f('0x3')](_0xa30f('0x1b'),_0x3413fe['uniqueid']),_0x3413fe);if(queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x1c')]){if(!queues[_0x3413fe[_0xa30f('0x5')]]['queuecallerabandon']&&!queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x1d')]){queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x1e')]=!![];queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x1f')]=utils[_0xa30f('0x16')]();queues[_0x3413fe['uniqueid']][_0xa30f('0xb')]=_0xa30f('0x20');}utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x21'),_0x3413fe[_0xa30f('0x5')],queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x22')],queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0xb')]));writeDB(queues[_0x3413fe[_0xa30f('0x5')]]);}else if(queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x11')]){utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x23'),_0x3413fe[_0xa30f('0x5')],queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x22')],queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x11')]));queues[queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x11')]]=queues[_0x3413fe[_0xa30f('0x5')]];queues[queues[_0x3413fe['uniqueid']][_0xa30f('0x11')]][_0xa30f('0x24')]=0x2;delete queues[_0x3413fe[_0xa30f('0x5')]];}}}catch(_0x3b6f10){utils[_0xa30f('0x17')](util[_0xa30f('0x3')]('[%s][queues][hangup]',_0x3413fe[_0xa30f('0x5')]),_0x3b6f10);}};exports[_0xa30f('0x25')]=function(_0xf96522){try{utils[_0xa30f('0x13')](util['format'](_0xa30f('0x26'),_0xf96522[_0xa30f('0x5')]),_0xf96522);if(!_['isNil'](_0xf96522[_0xa30f('0x27')][_0xa30f('0x28')])&&_0xf96522[_0xa30f('0x29')][_0xa30f('0x2a')]()!==_0xa30f('0x2b')){if(!_[_0xa30f('0x1a')](queues[_0xf96522['uniqueid']])){queues[_0xf96522[_0xa30f('0x5')]]['queuecallerabandon']=![];queues[_0xf96522['uniqueid']][_0xa30f('0x2c')]=null;queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0x1d')]=!![];queues[_0xf96522[_0xa30f('0x5')]]['queuecallerexitAt']=utils[_0xa30f('0x16')]();queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0xb')]=_0xf96522[_0xa30f('0x29')]['toUpperCase']();utils['info'](util[_0xa30f('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0xf96522[_0xa30f('0x5')],queues[_0xf96522['uniqueid']]['name'],_0xf96522[_0xa30f('0x29')],queues[_0xf96522[_0xa30f('0x5')]]['queuecallerexitreason']));writeDB(queues[_0xf96522['uniqueid']]);}}else if(!_[_0xa30f('0x1a')](_0xf96522['variable']['queueposition'])){if(!_[_0xa30f('0x1a')](queues[_0xf96522['uniqueid']])&&!queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0x2d')]){queues[_0xf96522['uniqueid']][_0xa30f('0x2d')]=![];queues[_0xf96522[_0xa30f('0x5')]]['queuecallerabandonAt']=null;queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0x1d')]=!![];queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0x2e')]=utils[_0xa30f('0x16')]();queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0xb')]='EXITWITHKEY';utils[_0xa30f('0x2')](util[_0xa30f('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0xf96522['uniqueid'],queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0x22')],_0xf96522[_0xa30f('0x29')],queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0xb')]));}}}catch(_0x1b6498){utils[_0xa30f('0x17')](util['format'](_0xa30f('0x26'),_0xf96522[_0xa30f('0x5')]),_0x1b6498);}};exports['queuecallerabandon']=function(_0x44adf2){try{if(!_['isNil'](queues[_0x44adf2[_0xa30f('0x5')]])){utils[_0xa30f('0x13')](util['format']('[%s][queues][queuecallerabandon]',_0x44adf2[_0xa30f('0x5')]),_0x44adf2);queues[_0x44adf2[_0xa30f('0x5')]][_0xa30f('0x1d')]=![];queues[_0x44adf2[_0xa30f('0x5')]][_0xa30f('0x2e')]=null;queues[_0x44adf2[_0xa30f('0x5')]][_0xa30f('0x2d')]=!![];queues[_0x44adf2[_0xa30f('0x5')]][_0xa30f('0x2c')]=utils['now']();queues[_0x44adf2['uniqueid']]['queuecallerexitreason']=_0xa30f('0x2f');utils['info'](util['format'](_0xa30f('0x30'),_0x44adf2[_0xa30f('0x5')],queues[_0x44adf2[_0xa30f('0x5')]][_0xa30f('0x22')],queues[_0x44adf2[_0xa30f('0x5')]]['queuecallerexitreason']));}}catch(_0x505e1d){utils[_0xa30f('0x17')](util['format']('[%s][queues][queuecallerabandon]',_0x44adf2[_0xa30f('0x5')]),_0x505e1d);}};exports['queuecallerleave']=function(_0x3177cb){try{if(!_[_0xa30f('0x1a')](queues[_0x3177cb[_0xa30f('0x5')]])){utils[_0xa30f('0x13')](util[_0xa30f('0x3')](_0xa30f('0x31'),_0x3177cb[_0xa30f('0x5')]),_0x3177cb);utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x32'),_0x3177cb[_0xa30f('0x5')],queues[_0x3177cb[_0xa30f('0x5')]][_0xa30f('0x22')],_0x3177cb[_0xa30f('0x33')],_0x3177cb[_0xa30f('0x34')]));queues[_0x3177cb['uniqueid']][_0xa30f('0x35')]=!![];queues[_0x3177cb[_0xa30f('0x5')]]['queuecallerleaveAt']=utils[_0xa30f('0x16')]();queues[_0x3177cb['uniqueid']]['holdtime']=utils[_0xa30f('0x36')](queues[_0x3177cb[_0xa30f('0x5')]][_0xa30f('0x1c')],queues[_0x3177cb[_0xa30f('0x5')]][_0xa30f('0x37')]);queues[_0x3177cb[_0xa30f('0x5')]][_0xa30f('0x15')]=_0x3177cb[_0xa30f('0x15')];queues[_0x3177cb[_0xa30f('0x5')]][_0xa30f('0x38')]=_0x3177cb[_0xa30f('0x38')];queues[_0x3177cb['uniqueid']]['connectedlinenum']=_0x3177cb['connectedlinenum'];queues[_0x3177cb[_0xa30f('0x5')]][_0xa30f('0x34')]=_0x3177cb['connectedlinename'];}}catch(_0x29e48b){utils[_0xa30f('0x17')](util[_0xa30f('0x3')](_0xa30f('0x31'),_0x3177cb[_0xa30f('0x5')]),_0x29e48b);}};exports[_0xa30f('0x39')]=function(_0x8b86d1){try{if(!_[_0xa30f('0x1a')](queues[_0x8b86d1[_0xa30f('0x5')]])){utils['debug'](util[_0xa30f('0x3')]('[%s][queues][agentconnect]',_0x8b86d1[_0xa30f('0x5')]),_0x8b86d1);utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x3a'),_0x8b86d1[_0xa30f('0x5')],queues[_0x8b86d1['uniqueid']][_0xa30f('0x22')],_0x8b86d1[_0xa30f('0x3b')],_0x8b86d1[_0xa30f('0x3c')]));queues[_0x8b86d1[_0xa30f('0x5')]]['queuecallerabandon']=![];queues[_0x8b86d1[_0xa30f('0x5')]]['queuecallerabandon']=![];queues[_0x8b86d1[_0xa30f('0x5')]]['queuecallerabandonAt']=null;queues[_0x8b86d1[_0xa30f('0x5')]]['queuecallerexit']=![];queues[_0x8b86d1['uniqueid']][_0xa30f('0xb')]=null;queues[_0x8b86d1[_0xa30f('0x5')]][_0xa30f('0x2e')]=null;queues[_0x8b86d1['uniqueid']][_0xa30f('0x3d')]=!![];queues[_0x8b86d1['uniqueid']][_0xa30f('0xa')]=_0x8b86d1[_0xa30f('0x3c')];queues[_0x8b86d1[_0xa30f('0x5')]][_0xa30f('0x8')]=_0x8b86d1[_0xa30f('0x3b')];}}catch(_0x499041){utils[_0xa30f('0x17')](util[_0xa30f('0x3')](_0xa30f('0x3e'),_0x8b86d1[_0xa30f('0x5')]),_0x499041);}};exports[_0xa30f('0x3f')]=function(_0x1a3417){try{if(!_[_0xa30f('0x1a')](queues[_0x1a3417[_0xa30f('0x5')]])){if(queues[_0x1a3417[_0xa30f('0x5')]][_0xa30f('0x1c')]){utils[_0xa30f('0x13')](util[_0xa30f('0x3')](_0xa30f('0x40'),_0x1a3417[_0xa30f('0x5')]),_0x1a3417);queues[_0x1a3417['uniqueid']][_0xa30f('0x2d')]=![];queues[_0x1a3417[_0xa30f('0x5')]]['queuecallerabandon']=![];queues[_0x1a3417[_0xa30f('0x5')]][_0xa30f('0x2c')]=null;queues[_0x1a3417[_0xa30f('0x5')]]['queuecallerexit']=![];queues[_0x1a3417[_0xa30f('0x5')]][_0xa30f('0x2e')]=null;queues[_0x1a3417['uniqueid']][_0xa30f('0x3d')]=!![];queues[_0x1a3417['uniqueid']][_0xa30f('0x8')]=_0x1a3417[_0xa30f('0x3b')];queues[_0x1a3417[_0xa30f('0x5')]]['queuecallercomplete']=!![];queues[_0x1a3417['uniqueid']]['queuecallercompleteAt']=utils['now']();if(_0x1a3417['reason']==_0xa30f('0x41')){if(!queues[_0x1a3417[_0xa30f('0x5')]][_0xa30f('0x41')]){queues[_0x1a3417[_0xa30f('0x5')]]['queuecallerexitreason']=_0xa30f('0x42');}}else{queues[_0x1a3417['uniqueid']][_0xa30f('0xb')]=_0xa30f('0x43')+_0x1a3417[_0xa30f('0x44')][_0xa30f('0x2a')]();}utils[_0xa30f('0x2')](util[_0xa30f('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x1a3417[_0xa30f('0x5')],queues[_0x1a3417[_0xa30f('0x5')]][_0xa30f('0x22')],_0x1a3417[_0xa30f('0x3b')],queues[_0x1a3417[_0xa30f('0x5')]][_0xa30f('0xb')]));writeDB(queues[_0x1a3417[_0xa30f('0x5')]]);}}}catch(_0x1ce5d6){utils[_0xa30f('0x17')](util[_0xa30f('0x3')](_0xa30f('0x40'),_0x1a3417[_0xa30f('0x5')]),_0x1ce5d6);}};exports[_0xa30f('0x45')]=function(_0x2577c8){try{if(!_['isNil'](queues[_0x2577c8[_0xa30f('0x46')]])){utils[_0xa30f('0x13')](util['format']('[%s][queues][blindtransfer]',_0x2577c8[_0xa30f('0x5')]),_0x2577c8);queues[_0x2577c8[_0xa30f('0x46')]]['transfer']=!![];queues[_0x2577c8[_0xa30f('0x46')]][_0xa30f('0x47')]=_0xa30f('0x48');queues[_0x2577c8[_0xa30f('0x46')]][_0xa30f('0x49')]=_0x2577c8[_0xa30f('0x4a')];queues[_0x2577c8[_0xa30f('0x46')]][_0xa30f('0x4b')]=_0x2577c8[_0xa30f('0x46')];queues[_0x2577c8[_0xa30f('0x46')]][_0xa30f('0xb')]=_0xa30f('0x4c');utils[_0xa30f('0x2')](util['format'](_0xa30f('0x4d'),_0x2577c8[_0xa30f('0x5')],queues[_0x2577c8['transfereeuniqueid']][_0xa30f('0x22')],_0x2577c8['transfereeuniqueid'],_0x2577c8[_0xa30f('0x4a')]));}}catch(_0x1f611f){utils[_0xa30f('0x17')](util[_0xa30f('0x3')](_0xa30f('0x4e'),_0x2577c8['uniqueid']),_0x1f611f);}};exports[_0xa30f('0x4f')]=function(_0x53b382){try{utils[_0xa30f('0x13')](util['format'](_0xa30f('0x50'),_0x53b382['origtransfereruniqueid']),_0x53b382);if(_0x53b382[_0xa30f('0x51')]==_0x53b382[_0xa30f('0x52')]){if(!_[_0xa30f('0x1a')](queues[_0x53b382[_0xa30f('0x53')]])){utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x54'),_0x53b382[_0xa30f('0x51')],queues[_0x53b382[_0xa30f('0x53')]][_0xa30f('0x22')],_0x53b382['origtransfererexten']));queues[_0x53b382['secondtransfererlinkedid']]['transfer']=!![];queues[_0x53b382['secondtransfererlinkedid']][_0xa30f('0x47')]=_0xa30f('0x55');queues[_0x53b382[_0xa30f('0x53')]][_0xa30f('0x49')]=_0x53b382[_0xa30f('0x56')];queues[_0x53b382[_0xa30f('0x53')]][_0xa30f('0x4b')]=_0x53b382[_0xa30f('0x51')];queues[_0x53b382[_0xa30f('0x53')]][_0xa30f('0xb')]=_0xa30f('0x57');}if(!_[_0xa30f('0x1a')](queues[_0x53b382[_0xa30f('0x52')]])){if(_0x53b382[_0xa30f('0x58')]&&queues[_0x53b382[_0xa30f('0x58')]]){queues[_0x53b382['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x53b382[_0xa30f('0x46')]]=_[_0xa30f('0x59')](queues[_0x53b382[_0xa30f('0x58')]]);queues[_0x53b382[_0xa30f('0x46')]]['transfereduniqueid']=_0x53b382[_0xa30f('0x5a')];queues[_0x53b382[_0xa30f('0x46')]]['queuecallerenterreason']=0x2;queues[_0x53b382[_0xa30f('0x46')]]['calleridnum']=queues[_0x53b382[_0xa30f('0x53')]]['calleridnum'];queues[_0x53b382[_0xa30f('0x46')]]['calleridname']=queues[_0x53b382['secondtransfererlinkedid']][_0xa30f('0x5b')];queues[_0x53b382['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0xa30f('0x16')]();queues[_0x53b382[_0xa30f('0x46')]][_0xa30f('0x1c')]=utils[_0xa30f('0x16')]();queues[_0x53b382[_0xa30f('0x46')]][_0xa30f('0x5c')]=0x0;queues[_0x53b382[_0xa30f('0x46')]][_0xa30f('0x5d')]=0x0;utils['info'](util[_0xa30f('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x53b382[_0xa30f('0x51')],queues[_0x53b382[_0xa30f('0x46')]][_0xa30f('0x22')],queues[_0x53b382[_0xa30f('0x46')]][_0xa30f('0x9')],queues[_0x53b382[_0xa30f('0x46')]][_0xa30f('0x5b')]));}else{utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x5e'),_0x53b382[_0xa30f('0x51')],queues[_0x53b382[_0xa30f('0x52')]][_0xa30f('0x22')],_0x53b382['secondtransfererlinkedid']));queues[_0x53b382[_0xa30f('0x52')]][_0xa30f('0x11')]=_0x53b382[_0xa30f('0x53')];}}}else if(_0x53b382[_0xa30f('0x5f')]==_0x53b382[_0xa30f('0x53')]){if(!_[_0xa30f('0x1a')](queues[_0x53b382['origtransfererlinkedid']])){utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x60'),_0x53b382[_0xa30f('0x51')],queues[_0x53b382[_0xa30f('0x52')]][_0xa30f('0x22')],_0x53b382[_0xa30f('0x5f')],_0x53b382[_0xa30f('0x61')]));queues[_0x53b382[_0xa30f('0x52')]][_0xa30f('0x41')]=!![];queues[_0x53b382[_0xa30f('0x52')]][_0xa30f('0x47')]=_0xa30f('0x55');queues[_0x53b382[_0xa30f('0x52')]]['transferexten']=_0x53b382[_0xa30f('0x61')];queues[_0x53b382['origtransfererlinkedid']][_0xa30f('0x4b')]=_0x53b382['secondtransfereruniqueid'];queues[_0x53b382[_0xa30f('0x52')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x53b382[_0xa30f('0x53')]])){if(_0x53b382['transfertargetlinkedid']&&queues[_0x53b382['transfertargetlinkedid']]){queues[_0x53b382[_0xa30f('0x62')]][_0xa30f('0x24')]=0x1;queues[_0x53b382['transfertargetuniqueid']]=_[_0xa30f('0x59')](queues[_0x53b382['transfertargetlinkedid']]);queues[_0x53b382[_0xa30f('0x5a')]]['transfereduniqueid']=_0x53b382['transfertargetuniqueid'];queues[_0x53b382[_0xa30f('0x5a')]][_0xa30f('0x24')]=0x2;queues[_0x53b382[_0xa30f('0x5a')]][_0xa30f('0x9')]=queues[_0x53b382['origtransfererlinkedid']][_0xa30f('0x9')];queues[_0x53b382[_0xa30f('0x5a')]][_0xa30f('0x5b')]=queues[_0x53b382[_0xa30f('0x52')]]['calleridname'];queues[_0x53b382[_0xa30f('0x5a')]][_0xa30f('0x37')]=utils[_0xa30f('0x16')]();queues[_0x53b382['transfertargetuniqueid']][_0xa30f('0x1c')]=utils[_0xa30f('0x16')]();queues[_0x53b382[_0xa30f('0x5a')]]['holdtime']=0x0;queues[_0x53b382['transfertargetuniqueid']][_0xa30f('0x5d')]=0x0;utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x63'),_0x53b382[_0xa30f('0x51')],queues[_0x53b382['transfertargetuniqueid']][_0xa30f('0x22')],queues[_0x53b382[_0xa30f('0x5a')]][_0xa30f('0x11')],queues[_0x53b382[_0xa30f('0x5a')]]['calleridnum'],queues[_0x53b382[_0xa30f('0x5a')]]['calleridname']));}else{utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x5e'),_0x53b382[_0xa30f('0x51')],queues[_0x53b382[_0xa30f('0x53')]][_0xa30f('0x22')],_0x53b382[_0xa30f('0x52')]));queues[_0x53b382[_0xa30f('0x53')]][_0xa30f('0x11')]=_0x53b382[_0xa30f('0x52')];}}}}catch(_0x23908a){utils['error'](util[_0xa30f('0x3')](_0xa30f('0x50'),_0x53b382[_0xa30f('0x51')]),_0x23908a);}};exports[_0xa30f('0x64')]=function(_0x3fbff4){try{if(!_[_0xa30f('0x1a')](queues[_0x3fbff4[_0xa30f('0x5')]])){utils['debug'](util[_0xa30f('0x3')](_0xa30f('0x65'),_0x3fbff4[_0xa30f('0x5')]),_0x3fbff4);queues[_0x3fbff4[_0xa30f('0x5')]][_0xa30f('0x66')]=utils[_0xa30f('0x16')]();utils[_0xa30f('0x2')](util[_0xa30f('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x3fbff4['uniqueid'],queues[_0x3fbff4[_0xa30f('0x5')]][_0xa30f('0x22')],queues[_0x3fbff4[_0xa30f('0x5')]][_0xa30f('0x66')]));}}catch(_0x3e6723){utils[_0xa30f('0x17')](util[_0xa30f('0x3')]('[%s][queues][musiconholdstart]',_0x3fbff4[_0xa30f('0x5')]),_0x3e6723);}};exports['musiconholdstop']=function(_0x4d2181){try{if(!_['isNil'](queues[_0x4d2181['uniqueid']])){if(!_['isNil'](queues[_0x4d2181[_0xa30f('0x5')]][_0xa30f('0x66')])){utils['debug'](util[_0xa30f('0x3')](_0xa30f('0x67'),_0x4d2181[_0xa30f('0x5')]),_0x4d2181);queues[_0x4d2181[_0xa30f('0x5')]][_0xa30f('0x5d')]+=utils[_0xa30f('0x36')](utils[_0xa30f('0x16')](),queues[_0x4d2181[_0xa30f('0x5')]][_0xa30f('0x66')]);utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x68'),_0x4d2181[_0xa30f('0x5')],queues[_0x4d2181['uniqueid']][_0xa30f('0x22')],queues[_0x4d2181[_0xa30f('0x5')]][_0xa30f('0x5d')]));delete queues[_0x4d2181[_0xa30f('0x5')]]['musiconholdstartAt'];}}}catch(_0x5e0f8a){utils[_0xa30f('0x17')](util[_0xa30f('0x3')](_0xa30f('0x67'),_0x4d2181['uniqueid']),_0x5e0f8a);}}; \ No newline at end of file +var _0xedc1=['error','format','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][hangup]','[%s][queues][varset]','variable','queuestatus','queuecallerabandonAt','value','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexit','queuecallerexitAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','agentconnect','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','debug','[%s][queues][queuecallerjoin]','position','now'];(function(_0x4f0ac2,_0x116f52){var _0xbc786=function(_0x1fc99d){while(--_0x1fc99d){_0x4f0ac2['push'](_0x4f0ac2['shift']());}};_0xbc786(++_0x116f52);}(_0xedc1,0x18c));var _0x1edc=function(_0x56d20e,_0x217c31){_0x56d20e=_0x56d20e-0x0;var _0x18b27a=_0xedc1[_0x56d20e];return _0x18b27a;};'use strict';var _=require(_0x1edc('0x0'));var util=require(_0x1edc('0x1'));var utils=require(_0x1edc('0x2'));var queues={};function writeDB(_0x56d56c){utils[_0x1edc('0x3')](util['format'](_0x1edc('0x4'),_0x56d56c['uniqueid'],_0x56d56c[_0x1edc('0x5')],_0x56d56c[_0x1edc('0x6')],_0x56d56c[_0x1edc('0x7')],_0x56d56c['calleridnum'],_0x56d56c[_0x1edc('0x8')],_0x56d56c[_0x1edc('0x9')]));if(_0x56d56c[_0x1edc('0x6')]){utils['getVoiceQueueByName'](_0x56d56c[_0x1edc('0x6')])[_0x1edc('0xa')](function(_0x25f554){if(_0x25f554){_0x56d56c[_0x1edc('0xb')]=_0x25f554['type'];}utils[_0x1edc('0xc')]('CreateVoiceQueueReport',_0x56d56c);});}else{utils[_0x1edc('0xc')](_0x1edc('0xd'),_0x56d56c);}if(_0x56d56c[_0x1edc('0xe')]){delete queues[_0x56d56c['transfereduniqueid']];}else{delete queues[_0x56d56c[_0x1edc('0xf')]];}}exports['queuecallerjoin']=function(_0x4d3f28){try{utils[_0x1edc('0x10')](util['format'](_0x1edc('0x11'),_0x4d3f28[_0x1edc('0xf')]),_0x4d3f28);utils[_0x1edc('0x3')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x4d3f28[_0x1edc('0xf')],_0x4d3f28['queue'],_0x4d3f28[_0x1edc('0x12')]));queues[_0x4d3f28[_0x1edc('0xf')]]=_['assign'](_0x4d3f28,{'originalposition':_0x4d3f28[_0x1edc('0x12')],'queuecallerjoinAt':utils[_0x1edc('0x13')](),'mohtime':0x0});}catch(_0x300389){utils[_0x1edc('0x14')](util[_0x1edc('0x15')](_0x1edc('0x11'),_0x4d3f28['uniqueid']),_0x300389);}};exports[_0x1edc('0x16')]=function(_0x4d897c){try{if(!_[_0x1edc('0x17')](queues[_0x4d897c[_0x1edc('0xf')]])){utils[_0x1edc('0x10')](util[_0x1edc('0x15')]('[%s][queues][hangup]',_0x4d897c[_0x1edc('0xf')]),_0x4d897c);if(queues[_0x4d897c[_0x1edc('0xf')]][_0x1edc('0x18')]){if(!queues[_0x4d897c[_0x1edc('0xf')]][_0x1edc('0x19')]&&!queues[_0x4d897c[_0x1edc('0xf')]]['queuecallerexit']){queues[_0x4d897c['uniqueid']][_0x1edc('0x1a')]=!![];queues[_0x4d897c[_0x1edc('0xf')]][_0x1edc('0x1b')]=utils[_0x1edc('0x13')]();queues[_0x4d897c[_0x1edc('0xf')]][_0x1edc('0x9')]=_0x1edc('0x1c');}utils[_0x1edc('0x3')](util[_0x1edc('0x15')](_0x1edc('0x1d'),_0x4d897c[_0x1edc('0xf')],queues[_0x4d897c['uniqueid']][_0x1edc('0x1e')],queues[_0x4d897c[_0x1edc('0xf')]]['queuecallerexitreason']));writeDB(queues[_0x4d897c['uniqueid']]);}else if(queues[_0x4d897c[_0x1edc('0xf')]][_0x1edc('0xe')]){utils[_0x1edc('0x3')](util[_0x1edc('0x15')](_0x1edc('0x1f'),_0x4d897c['uniqueid'],queues[_0x4d897c[_0x1edc('0xf')]][_0x1edc('0x1e')],queues[_0x4d897c[_0x1edc('0xf')]][_0x1edc('0xe')]));queues[queues[_0x4d897c[_0x1edc('0xf')]][_0x1edc('0xe')]]=queues[_0x4d897c[_0x1edc('0xf')]];queues[queues[_0x4d897c[_0x1edc('0xf')]][_0x1edc('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x4d897c[_0x1edc('0xf')]];}}}catch(_0x2200e2){utils['error'](util[_0x1edc('0x15')](_0x1edc('0x20'),_0x4d897c[_0x1edc('0xf')]),_0x2200e2);}};exports['varset']=function(_0x26881f){try{utils[_0x1edc('0x10')](util['format'](_0x1edc('0x21'),_0x26881f[_0x1edc('0xf')]),_0x26881f);if(!_[_0x1edc('0x17')](_0x26881f[_0x1edc('0x22')][_0x1edc('0x23')])&&_0x26881f['value']['toUpperCase']()!=='CONTINUE'){if(!_['isNil'](queues[_0x26881f[_0x1edc('0xf')]])){queues[_0x26881f['uniqueid']]['queuecallerabandon']=![];queues[_0x26881f[_0x1edc('0xf')]][_0x1edc('0x24')]=null;queues[_0x26881f[_0x1edc('0xf')]]['queuecallerexit']=!![];queues[_0x26881f[_0x1edc('0xf')]]['queuecallerexitAt']=utils[_0x1edc('0x13')]();queues[_0x26881f[_0x1edc('0xf')]][_0x1edc('0x9')]=_0x26881f[_0x1edc('0x25')][_0x1edc('0x26')]();utils[_0x1edc('0x3')](util['format'](_0x1edc('0x27'),_0x26881f[_0x1edc('0xf')],queues[_0x26881f[_0x1edc('0xf')]]['name'],_0x26881f[_0x1edc('0x25')],queues[_0x26881f[_0x1edc('0xf')]][_0x1edc('0x9')]));writeDB(queues[_0x26881f[_0x1edc('0xf')]]);}}else if(!_['isNil'](_0x26881f[_0x1edc('0x22')][_0x1edc('0x28')])){if(!_[_0x1edc('0x17')](queues[_0x26881f[_0x1edc('0xf')]])&&!queues[_0x26881f['uniqueid']][_0x1edc('0x19')]){queues[_0x26881f[_0x1edc('0xf')]][_0x1edc('0x19')]=![];queues[_0x26881f['uniqueid']][_0x1edc('0x24')]=null;queues[_0x26881f['uniqueid']][_0x1edc('0x29')]=!![];queues[_0x26881f['uniqueid']][_0x1edc('0x2a')]=utils['now']();queues[_0x26881f[_0x1edc('0xf')]][_0x1edc('0x9')]=_0x1edc('0x2b');utils[_0x1edc('0x3')](util[_0x1edc('0x15')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x26881f[_0x1edc('0xf')],queues[_0x26881f[_0x1edc('0xf')]]['name'],_0x26881f[_0x1edc('0x25')],queues[_0x26881f[_0x1edc('0xf')]][_0x1edc('0x9')]));}}}catch(_0x16b1ea){utils[_0x1edc('0x14')](util[_0x1edc('0x15')]('[%s][queues][varset]',_0x26881f[_0x1edc('0xf')]),_0x16b1ea);}};exports[_0x1edc('0x19')]=function(_0x5c781e){try{if(!_[_0x1edc('0x17')](queues[_0x5c781e['uniqueid']])){utils[_0x1edc('0x10')](util[_0x1edc('0x15')](_0x1edc('0x2c'),_0x5c781e[_0x1edc('0xf')]),_0x5c781e);queues[_0x5c781e['uniqueid']][_0x1edc('0x29')]=![];queues[_0x5c781e[_0x1edc('0xf')]][_0x1edc('0x2a')]=null;queues[_0x5c781e[_0x1edc('0xf')]]['queuecallerabandon']=!![];queues[_0x5c781e[_0x1edc('0xf')]][_0x1edc('0x24')]=utils['now']();queues[_0x5c781e[_0x1edc('0xf')]][_0x1edc('0x9')]='ABANDONED';utils['info'](util[_0x1edc('0x15')](_0x1edc('0x2d'),_0x5c781e[_0x1edc('0xf')],queues[_0x5c781e[_0x1edc('0xf')]][_0x1edc('0x1e')],queues[_0x5c781e[_0x1edc('0xf')]]['queuecallerexitreason']));}}catch(_0x2a3956){utils[_0x1edc('0x14')](util[_0x1edc('0x15')](_0x1edc('0x2c'),_0x5c781e[_0x1edc('0xf')]),_0x2a3956);}};exports[_0x1edc('0x2e')]=function(_0x22300c){try{if(!_['isNil'](queues[_0x22300c[_0x1edc('0xf')]])){utils[_0x1edc('0x10')](util[_0x1edc('0x15')](_0x1edc('0x2f'),_0x22300c[_0x1edc('0xf')]),_0x22300c);utils[_0x1edc('0x3')](util[_0x1edc('0x15')](_0x1edc('0x30'),_0x22300c[_0x1edc('0xf')],queues[_0x22300c[_0x1edc('0xf')]][_0x1edc('0x1e')],_0x22300c['connectedlinenum'],_0x22300c[_0x1edc('0x31')]));queues[_0x22300c[_0x1edc('0xf')]]['queuecallerleave']=!![];queues[_0x22300c['uniqueid']][_0x1edc('0x18')]=utils[_0x1edc('0x13')]();queues[_0x22300c[_0x1edc('0xf')]][_0x1edc('0x32')]=utils[_0x1edc('0x33')](queues[_0x22300c['uniqueid']]['queuecallerleaveAt'],queues[_0x22300c[_0x1edc('0xf')]][_0x1edc('0x34')]);queues[_0x22300c[_0x1edc('0xf')]][_0x1edc('0x12')]=_0x22300c[_0x1edc('0x12')];queues[_0x22300c[_0x1edc('0xf')]][_0x1edc('0x35')]=_0x22300c[_0x1edc('0x35')];queues[_0x22300c[_0x1edc('0xf')]][_0x1edc('0x36')]=_0x22300c[_0x1edc('0x36')];queues[_0x22300c[_0x1edc('0xf')]][_0x1edc('0x31')]=_0x22300c[_0x1edc('0x31')];}}catch(_0x19be73){utils[_0x1edc('0x14')](util[_0x1edc('0x15')]('[%s][queues][queuecallerleave]',_0x22300c['uniqueid']),_0x19be73);}};exports[_0x1edc('0x37')]=function(_0x3e33a9){try{if(!_[_0x1edc('0x17')](queues[_0x3e33a9[_0x1edc('0xf')]])){utils['debug'](util[_0x1edc('0x15')]('[%s][queues][agentconnect]',_0x3e33a9['uniqueid']),_0x3e33a9);utils[_0x1edc('0x3')](util[_0x1edc('0x15')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x3e33a9[_0x1edc('0xf')],queues[_0x3e33a9[_0x1edc('0xf')]][_0x1edc('0x1e')],_0x3e33a9[_0x1edc('0x38')],_0x3e33a9[_0x1edc('0x39')]));queues[_0x3e33a9[_0x1edc('0xf')]][_0x1edc('0x19')]=![];queues[_0x3e33a9[_0x1edc('0xf')]][_0x1edc('0x19')]=![];queues[_0x3e33a9[_0x1edc('0xf')]]['queuecallerabandonAt']=null;queues[_0x3e33a9[_0x1edc('0xf')]][_0x1edc('0x29')]=![];queues[_0x3e33a9[_0x1edc('0xf')]]['queuecallerexitreason']=null;queues[_0x3e33a9[_0x1edc('0xf')]][_0x1edc('0x2a')]=null;queues[_0x3e33a9['uniqueid']][_0x1edc('0x3a')]=!![];queues[_0x3e33a9[_0x1edc('0xf')]][_0x1edc('0x8')]=_0x3e33a9['destaccountcode'];queues[_0x3e33a9[_0x1edc('0xf')]][_0x1edc('0x7')]=_0x3e33a9[_0x1edc('0x38')];}}catch(_0x4ab85f){utils[_0x1edc('0x14')](util['format'](_0x1edc('0x3b'),_0x3e33a9[_0x1edc('0xf')]),_0x4ab85f);}};exports[_0x1edc('0x3c')]=function(_0x17062c){try{if(!_[_0x1edc('0x17')](queues[_0x17062c[_0x1edc('0xf')]])){if(queues[_0x17062c[_0x1edc('0xf')]][_0x1edc('0x18')]){utils[_0x1edc('0x10')](util[_0x1edc('0x15')]('[%s][queues][agentcomplete]',_0x17062c['uniqueid']),_0x17062c);queues[_0x17062c[_0x1edc('0xf')]][_0x1edc('0x19')]=![];queues[_0x17062c['uniqueid']][_0x1edc('0x19')]=![];queues[_0x17062c[_0x1edc('0xf')]][_0x1edc('0x24')]=null;queues[_0x17062c[_0x1edc('0xf')]][_0x1edc('0x29')]=![];queues[_0x17062c['uniqueid']][_0x1edc('0x2a')]=null;queues[_0x17062c[_0x1edc('0xf')]][_0x1edc('0x3a')]=!![];queues[_0x17062c[_0x1edc('0xf')]]['lastAssignedTo']=_0x17062c[_0x1edc('0x38')];queues[_0x17062c[_0x1edc('0xf')]][_0x1edc('0x1a')]=!![];queues[_0x17062c[_0x1edc('0xf')]]['queuecallercompleteAt']=utils['now']();if(_0x17062c[_0x1edc('0x3d')]==_0x1edc('0x3e')){if(!queues[_0x17062c[_0x1edc('0xf')]][_0x1edc('0x3e')]){queues[_0x17062c['uniqueid']]['queuecallerexitreason']=_0x1edc('0x3f');}}else{queues[_0x17062c[_0x1edc('0xf')]][_0x1edc('0x9')]=_0x1edc('0x40')+_0x17062c['reason'][_0x1edc('0x26')]();}utils[_0x1edc('0x3')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x17062c[_0x1edc('0xf')],queues[_0x17062c[_0x1edc('0xf')]][_0x1edc('0x1e')],_0x17062c[_0x1edc('0x38')],queues[_0x17062c[_0x1edc('0xf')]][_0x1edc('0x9')]));writeDB(queues[_0x17062c[_0x1edc('0xf')]]);}}}catch(_0x498e30){utils[_0x1edc('0x14')](util['format'](_0x1edc('0x41'),_0x17062c[_0x1edc('0xf')]),_0x498e30);}};exports[_0x1edc('0x42')]=function(_0x19ae27){try{if(!_[_0x1edc('0x17')](queues[_0x19ae27[_0x1edc('0x43')]])){utils[_0x1edc('0x10')](util[_0x1edc('0x15')](_0x1edc('0x44'),_0x19ae27['uniqueid']),_0x19ae27);queues[_0x19ae27['transfereeuniqueid']][_0x1edc('0x3e')]=!![];queues[_0x19ae27[_0x1edc('0x43')]]['transfertype']=_0x1edc('0x45');queues[_0x19ae27[_0x1edc('0x43')]][_0x1edc('0x46')]=_0x19ae27[_0x1edc('0x47')];queues[_0x19ae27[_0x1edc('0x43')]][_0x1edc('0x48')]=_0x19ae27[_0x1edc('0x43')];queues[_0x19ae27[_0x1edc('0x43')]][_0x1edc('0x9')]=_0x1edc('0x49');utils[_0x1edc('0x3')](util[_0x1edc('0x15')](_0x1edc('0x4a'),_0x19ae27['uniqueid'],queues[_0x19ae27['transfereeuniqueid']][_0x1edc('0x1e')],_0x19ae27[_0x1edc('0x43')],_0x19ae27[_0x1edc('0x47')]));}}catch(_0x594967){utils[_0x1edc('0x14')](util[_0x1edc('0x15')](_0x1edc('0x44'),_0x19ae27['uniqueid']),_0x594967);}};exports[_0x1edc('0x4b')]=function(_0x2915ff){try{utils[_0x1edc('0x10')](util['format'](_0x1edc('0x4c'),_0x2915ff['origtransfereruniqueid']),_0x2915ff);if(_0x2915ff[_0x1edc('0x4d')]==_0x2915ff['origtransfererlinkedid']){if(!_[_0x1edc('0x17')](queues[_0x2915ff[_0x1edc('0x4e')]])){utils[_0x1edc('0x3')](util['format'](_0x1edc('0x4f'),_0x2915ff['origtransfereruniqueid'],queues[_0x2915ff[_0x1edc('0x4e')]]['name'],_0x2915ff[_0x1edc('0x50')]));queues[_0x2915ff[_0x1edc('0x4e')]][_0x1edc('0x3e')]=!![];queues[_0x2915ff[_0x1edc('0x4e')]]['transfertype']=_0x1edc('0x51');queues[_0x2915ff['secondtransfererlinkedid']][_0x1edc('0x46')]=_0x2915ff[_0x1edc('0x50')];queues[_0x2915ff['secondtransfererlinkedid']][_0x1edc('0x48')]=_0x2915ff['origtransfereruniqueid'];queues[_0x2915ff['secondtransfererlinkedid']][_0x1edc('0x9')]=_0x1edc('0x52');}if(!_[_0x1edc('0x17')](queues[_0x2915ff[_0x1edc('0x53')]])){if(_0x2915ff[_0x1edc('0x54')]&&queues[_0x2915ff[_0x1edc('0x54')]]){queues[_0x2915ff['transfereelinkedid']][_0x1edc('0x55')]=0x1;queues[_0x2915ff[_0x1edc('0x43')]]=_[_0x1edc('0x56')](queues[_0x2915ff[_0x1edc('0x54')]]);queues[_0x2915ff[_0x1edc('0x43')]][_0x1edc('0xe')]=_0x2915ff[_0x1edc('0x57')];queues[_0x2915ff[_0x1edc('0x43')]][_0x1edc('0x55')]=0x2;queues[_0x2915ff[_0x1edc('0x43')]][_0x1edc('0x58')]=queues[_0x2915ff['secondtransfererlinkedid']]['calleridnum'];queues[_0x2915ff['transfereeuniqueid']][_0x1edc('0x59')]=queues[_0x2915ff[_0x1edc('0x4e')]][_0x1edc('0x59')];queues[_0x2915ff['transfereeuniqueid']][_0x1edc('0x34')]=utils['now']();queues[_0x2915ff[_0x1edc('0x43')]][_0x1edc('0x18')]=utils[_0x1edc('0x13')]();queues[_0x2915ff['transfereeuniqueid']][_0x1edc('0x32')]=0x0;queues[_0x2915ff[_0x1edc('0x43')]][_0x1edc('0x5a')]=0x0;utils[_0x1edc('0x3')](util[_0x1edc('0x15')](_0x1edc('0x5b'),_0x2915ff[_0x1edc('0x4d')],queues[_0x2915ff[_0x1edc('0x43')]][_0x1edc('0x1e')],queues[_0x2915ff[_0x1edc('0x43')]][_0x1edc('0x58')],queues[_0x2915ff[_0x1edc('0x43')]][_0x1edc('0x59')]));}else{utils[_0x1edc('0x3')](util[_0x1edc('0x15')](_0x1edc('0x5c'),_0x2915ff[_0x1edc('0x4d')],queues[_0x2915ff[_0x1edc('0x53')]][_0x1edc('0x1e')],_0x2915ff['secondtransfererlinkedid']));queues[_0x2915ff[_0x1edc('0x53')]][_0x1edc('0xe')]=_0x2915ff['secondtransfererlinkedid'];}}}else if(_0x2915ff[_0x1edc('0x5d')]==_0x2915ff['secondtransfererlinkedid']){if(!_[_0x1edc('0x17')](queues[_0x2915ff[_0x1edc('0x53')]])){utils[_0x1edc('0x3')](util[_0x1edc('0x15')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x2915ff[_0x1edc('0x4d')],queues[_0x2915ff[_0x1edc('0x53')]][_0x1edc('0x1e')],_0x2915ff[_0x1edc('0x5d')],_0x2915ff[_0x1edc('0x5e')]));queues[_0x2915ff[_0x1edc('0x53')]][_0x1edc('0x3e')]=!![];queues[_0x2915ff['origtransfererlinkedid']]['transfertype']=_0x1edc('0x51');queues[_0x2915ff['origtransfererlinkedid']][_0x1edc('0x46')]=_0x2915ff[_0x1edc('0x5e')];queues[_0x2915ff[_0x1edc('0x53')]]['transferuniqueid']=_0x2915ff[_0x1edc('0x5d')];queues[_0x2915ff[_0x1edc('0x53')]][_0x1edc('0x9')]=_0x1edc('0x52');}if(!_[_0x1edc('0x17')](queues[_0x2915ff[_0x1edc('0x4e')]])){if(_0x2915ff['transfertargetlinkedid']&&queues[_0x2915ff['transfertargetlinkedid']]){queues[_0x2915ff[_0x1edc('0x5f')]]['queuecallerenterreason']=0x1;queues[_0x2915ff[_0x1edc('0x57')]]=_[_0x1edc('0x56')](queues[_0x2915ff[_0x1edc('0x5f')]]);queues[_0x2915ff[_0x1edc('0x57')]]['transfereduniqueid']=_0x2915ff['transfertargetuniqueid'];queues[_0x2915ff[_0x1edc('0x57')]][_0x1edc('0x55')]=0x2;queues[_0x2915ff[_0x1edc('0x57')]][_0x1edc('0x58')]=queues[_0x2915ff[_0x1edc('0x53')]][_0x1edc('0x58')];queues[_0x2915ff[_0x1edc('0x57')]][_0x1edc('0x59')]=queues[_0x2915ff['origtransfererlinkedid']][_0x1edc('0x59')];queues[_0x2915ff[_0x1edc('0x57')]][_0x1edc('0x34')]=utils['now']();queues[_0x2915ff[_0x1edc('0x57')]]['queuecallerleaveAt']=utils[_0x1edc('0x13')]();queues[_0x2915ff[_0x1edc('0x57')]][_0x1edc('0x32')]=0x0;queues[_0x2915ff['transfertargetuniqueid']][_0x1edc('0x5a')]=0x0;utils[_0x1edc('0x3')](util[_0x1edc('0x15')](_0x1edc('0x60'),_0x2915ff[_0x1edc('0x4d')],queues[_0x2915ff[_0x1edc('0x57')]][_0x1edc('0x1e')],queues[_0x2915ff[_0x1edc('0x57')]][_0x1edc('0xe')],queues[_0x2915ff[_0x1edc('0x57')]][_0x1edc('0x58')],queues[_0x2915ff[_0x1edc('0x57')]][_0x1edc('0x59')]));}else{utils['info'](util[_0x1edc('0x15')](_0x1edc('0x5c'),_0x2915ff['origtransfereruniqueid'],queues[_0x2915ff[_0x1edc('0x4e')]][_0x1edc('0x1e')],_0x2915ff[_0x1edc('0x53')]));queues[_0x2915ff[_0x1edc('0x4e')]][_0x1edc('0xe')]=_0x2915ff['origtransfererlinkedid'];}}}}catch(_0x479dc8){utils['error'](util['format'](_0x1edc('0x4c'),_0x2915ff[_0x1edc('0x4d')]),_0x479dc8);}};exports[_0x1edc('0x61')]=function(_0x593e20){try{if(!_[_0x1edc('0x17')](queues[_0x593e20[_0x1edc('0xf')]])){utils['debug'](util[_0x1edc('0x15')](_0x1edc('0x62'),_0x593e20[_0x1edc('0xf')]),_0x593e20);queues[_0x593e20['uniqueid']]['musiconholdstartAt']=utils[_0x1edc('0x13')]();utils['info'](util[_0x1edc('0x15')](_0x1edc('0x63'),_0x593e20[_0x1edc('0xf')],queues[_0x593e20[_0x1edc('0xf')]][_0x1edc('0x1e')],queues[_0x593e20[_0x1edc('0xf')]][_0x1edc('0x64')]));}}catch(_0xa37f0){utils[_0x1edc('0x14')](util['format'](_0x1edc('0x62'),_0x593e20[_0x1edc('0xf')]),_0xa37f0);}};exports[_0x1edc('0x65')]=function(_0x573091){try{if(!_[_0x1edc('0x17')](queues[_0x573091['uniqueid']])){if(!_[_0x1edc('0x17')](queues[_0x573091[_0x1edc('0xf')]][_0x1edc('0x64')])){utils[_0x1edc('0x10')](util[_0x1edc('0x15')](_0x1edc('0x66'),_0x573091[_0x1edc('0xf')]),_0x573091);queues[_0x573091['uniqueid']][_0x1edc('0x5a')]+=utils[_0x1edc('0x33')](utils[_0x1edc('0x13')](),queues[_0x573091['uniqueid']][_0x1edc('0x64')]);utils[_0x1edc('0x3')](util['format'](_0x1edc('0x67'),_0x573091[_0x1edc('0xf')],queues[_0x573091[_0x1edc('0xf')]][_0x1edc('0x1e')],queues[_0x573091[_0x1edc('0xf')]][_0x1edc('0x5a')]));delete queues[_0x573091[_0x1edc('0xf')]][_0x1edc('0x64')];}}}catch(_0x3d94ed){utils[_0x1edc('0x14')](util[_0x1edc('0x15')](_0x1edc('0x66'),_0x573091[_0x1edc('0xf')]),_0x3d94ed);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 7a6c4af..5a78b4b 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 _0x3797=['transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','replace','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr','split','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','accountcode','then','name','UserId','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate'];(function(_0x6f45dc,_0x379e7e){var _0x6d01d7=function(_0x59597a){while(--_0x59597a){_0x6f45dc['push'](_0x6f45dc['shift']());}};_0x6d01d7(++_0x379e7e);}(_0x3797,0x1df));var _0x7379=function(_0x485584,_0x588a02){_0x485584=_0x485584-0x0;var _0x20c9f5=_0x3797[_0x485584];return _0x20c9f5;};'use strict';var _=require(_0x7379('0x0'));var util=require(_0x7379('0x1'));var utils=require(_0x7379('0x2'));var recordings={};function writeDB(_0x2995ea){utils[_0x7379('0x3')](util[_0x7379('0x4')](_0x7379('0x5'),_0x2995ea['uniqueid']));if(_0x2995ea[_0x7379('0x6')]){utils['getUserByInternal'](_0x2995ea[_0x7379('0x6')])[_0x7379('0x7')](function(_0x3f602f){if(_0x3f602f){_0x2995ea['membername']=_0x3f602f[_0x7379('0x8')];_0x2995ea[_0x7379('0x9')]=_0x3f602f['id'];}utils['request'](_0x7379('0xa'),_0x2995ea);});}else{utils['request']('CreateVoiceRecording',_0x2995ea);}}exports[_0x7379('0xb')]=function(_0x325e43){try{utils[_0x7379('0xc')](util[_0x7379('0x4')](_0x7379('0xd'),_0x325e43[_0x7379('0xe')]),_0x325e43);if(_0x325e43[_0x7379('0xe')]==_0x325e43[_0x7379('0xf')]){utils[_0x7379('0x3')](util[_0x7379('0x4')](_0x7379('0x10'),_0x325e43[_0x7379('0xe')],_0x325e43[_0x7379('0x11')],_0x325e43[_0x7379('0x12')]));recordings[_0x325e43['uniqueid']]={'uniqueid':_0x325e43[_0x7379('0xe')],'accountcode':_0x325e43[_0x7379('0x6')],'exten':_0x325e43[_0x7379('0x12')],'context':_0x325e43['context'],'channel':_0x325e43[_0x7379('0x13')],'monitors':[]};}}catch(_0x39493e){utils[_0x7379('0x14')](util[_0x7379('0x4')](_0x7379('0xd'),_0x325e43['uniqueid']),_0x39493e);}};exports['newstate']=function(_0x364dd8){try{utils[_0x7379('0xc')](util['format'](_0x7379('0x15'),_0x364dd8[_0x7379('0xe')]),_0x364dd8);if(!_[_0x7379('0x16')](recordings[_0x364dd8['uniqueid']])&&_0x364dd8['channelstate']==0x6){utils[_0x7379('0x3')](util['format'](_0x7379('0x17'),_0x364dd8['uniqueid'],_0x364dd8[_0x7379('0x11')],_0x364dd8[_0x7379('0x13')]));}else if(!_[_0x7379('0x16')](recordings[_0x364dd8[_0x7379('0xf')]])&&_0x364dd8[_0x7379('0x18')]==0x6&&_0x364dd8['context']!=_0x7379('0x19')){utils[_0x7379('0x3')](util[_0x7379('0x4')](_0x7379('0x1a'),_0x364dd8[_0x7379('0xe')],_0x364dd8[_0x7379('0xf')],_0x364dd8[_0x7379('0x11')],_0x364dd8[_0x7379('0x13')]));recordings[_0x364dd8[_0x7379('0xf')]][_0x7379('0x6')]=_0x364dd8['accountcode'];}}catch(_0x5b828a){utils[_0x7379('0x14')](util[_0x7379('0x4')](_0x7379('0x15'),_0x364dd8[_0x7379('0xe')]),_0x5b828a);}};exports[_0x7379('0x1b')]=function(_0x23866c){try{if(!_[_0x7379('0x16')](_0x23866c[_0x7379('0x1c')])&&!_['isNil'](_0x23866c[_0x7379('0x1c')][_0x7379('0x1d')])){utils[_0x7379('0xc')](util[_0x7379('0x4')](_0x7379('0x1e'),_0x23866c[_0x7379('0xe')]),_0x23866c);utils[_0x7379('0x3')](util[_0x7379('0x4')](_0x7379('0x1f'),_0x23866c['uniqueid'],_0x23866c[_0x7379('0x1c')],_0x23866c['value']));if(_[_0x7379('0x20')](_0x23866c[_0x7379('0x21')],'.wav49')){_0x23866c[_0x7379('0x21')]=_0x23866c[_0x7379('0x21')][_0x7379('0x22')](_0x7379('0x23'),_0x7379('0x24'));}if(recordings[_0x23866c[_0x7379('0xf')]]){var _0x53c0e6=_[_0x7379('0x25')](recordings[_0x23866c[_0x7379('0xf')]][_0x7379('0x26')],{'value':_0x23866c[_0x7379('0x21')]});if(_[_0x7379('0x16')](_0x53c0e6)){recordings[_0x23866c['linkedid']][_0x7379('0x26')][_0x7379('0x27')]({'value':_0x23866c[_0x7379('0x21')]});}}}}catch(_0x5bb45a){utils[_0x7379('0x14')](util['format'](_0x7379('0x1e'),_0x23866c['uniqueid']),_0x5bb45a);}};exports[_0x7379('0x28')]=function(_0x5085be){try{if(!_[_0x7379('0x16')](recordings[_0x5085be[_0x7379('0xe')]])){utils[_0x7379('0xc')](util[_0x7379('0x4')](_0x7379('0x29'),_0x5085be[_0x7379('0xe')]),_0x5085be);utils[_0x7379('0x3')](util[_0x7379('0x4')](_0x7379('0x2a'),_0x5085be[_0x7379('0xe')],_0x5085be[_0x7379('0x2b')],_0x5085be[_0x7379('0x2c')],_0x5085be['cause-txt']));recordings[_0x5085be[_0x7379('0xe')]][_0x7379('0x2b')]=_0x5085be[_0x7379('0x2b')];recordings[_0x5085be[_0x7379('0xe')]][_0x7379('0x2c')]=_0x5085be['calleridname'];recordings[_0x5085be[_0x7379('0xe')]][_0x7379('0x2d')]=_0x5085be[_0x7379('0x2d')];recordings[_0x5085be[_0x7379('0xe')]][_0x7379('0x2e')]=_0x5085be[_0x7379('0x2e')];if(recordings[_0x5085be[_0x7379('0xe')]][_0x7379('0x2f')]=='outbound'&&recordings[_0x5085be[_0x7379('0xe')]]['accountcode']){recordings[_0x5085be['uniqueid']]['connectedlinenum']=recordings[_0x5085be[_0x7379('0xe')]]['accountcode'];recordings[_0x5085be[_0x7379('0xe')]][_0x7379('0x2e')]='';}recordings[_0x5085be['uniqueid']][_0x7379('0x26')][_0x7379('0x30')](function(_0x4ac468){var _0x25a83d=_[_0x7379('0x31')](recordings[_0x5085be[_0x7379('0xe')]]);_0x25a83d['value']=_0x4ac468[_0x7379('0x21')];writeDB(_0x25a83d);});delete recordings[_0x5085be['uniqueid']];}}catch(_0x555120){utils[_0x7379('0x14')](util[_0x7379('0x4')]('[%s][recordings][hangup]',_0x5085be[_0x7379('0xe')]),_0x555120);}};exports[_0x7379('0x32')]=function(_0x269544){try{if(!_[_0x7379('0x16')](recordings[_0x269544[_0x7379('0xe')]])){utils[_0x7379('0xc')](util[_0x7379('0x4')](_0x7379('0x33'),_0x269544[_0x7379('0xe')]),_0x269544);utils['info'](util[_0x7379('0x4')](_0x7379('0x34'),_0x269544[_0x7379('0xe')],_0x269544['application'],_0x269544['appdata']));if(_0x269544[_0x7379('0x35')][_0x7379('0x36')]()=='set'&&_[_0x7379('0x37')](_0x269544[_0x7379('0x38')][_0x7379('0x36')](),_0x7379('0x39'))){var _0x40f4bc=_0x269544['appdata'][_0x7379('0x3a')]('=');var _0x455eb9=_0x40f4bc[0x0]['substring'](_0x40f4bc[0x0][_0x7379('0x3b')]('(')+0x1,_0x40f4bc[0x0]['lastIndexOf'](')'));var _0x4f1eaf=_0x40f4bc[0x1];recordings[_0x269544['uniqueid']][_0x455eb9]=_0x4f1eaf;}}}catch(_0x405036){utils[_0x7379('0x14')](util['format'](_0x7379('0x33'),_0x269544[_0x7379('0xe')]),_0x405036);}};exports['queuecallerjoin']=function(_0x49058a){try{if(!_[_0x7379('0x16')](recordings[_0x49058a[_0x7379('0xe')]])){utils['debug'](util['format'](_0x7379('0x3c'),_0x49058a['uniqueid']),_0x49058a);utils[_0x7379('0x3')](util['format'](_0x7379('0x3d'),_0x49058a[_0x7379('0xe')],_0x49058a['queue']));recordings[_0x49058a['uniqueid']]['queue']=_0x49058a[_0x7379('0x3e')];}}catch(_0x360fb4){utils['error'](util[_0x7379('0x4')](_0x7379('0x3c'),_0x49058a['uniqueid']),_0x360fb4);}}; \ No newline at end of file +var _0xe1fe=['debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','info','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','then','membername','name','request','CreateVoiceRecording'];(function(_0x3ae2e9,_0x1ebae3){var _0xce4e82=function(_0x1b0815){while(--_0x1b0815){_0x3ae2e9['push'](_0x3ae2e9['shift']());}};_0xce4e82(++_0x1ebae3);}(_0xe1fe,0x6e));var _0xee1f=function(_0x2cc3e3,_0x91560d){_0x2cc3e3=_0x2cc3e3-0x0;var _0x7f8bc9=_0xe1fe[_0x2cc3e3];return _0x7f8bc9;};'use strict';var _=require(_0xee1f('0x0'));var util=require(_0xee1f('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x7c6c41){utils[_0xee1f('0x2')](util['format'](_0xee1f('0x3'),_0x7c6c41[_0xee1f('0x4')]));if(_0x7c6c41['accountcode']){utils[_0xee1f('0x5')](_0x7c6c41[_0xee1f('0x6')])[_0xee1f('0x7')](function(_0x2bb40b){if(_0x2bb40b){_0x7c6c41[_0xee1f('0x8')]=_0x2bb40b[_0xee1f('0x9')];_0x7c6c41['UserId']=_0x2bb40b['id'];}utils[_0xee1f('0xa')](_0xee1f('0xb'),_0x7c6c41);});}else{utils[_0xee1f('0xa')](_0xee1f('0xb'),_0x7c6c41);}}exports['newchannel']=function(_0x52e44e){try{utils[_0xee1f('0xc')](util[_0xee1f('0xd')](_0xee1f('0xe'),_0x52e44e[_0xee1f('0x4')]),_0x52e44e);if(_0x52e44e[_0xee1f('0x4')]==_0x52e44e[_0xee1f('0xf')]){utils['info'](util[_0xee1f('0xd')](_0xee1f('0x10'),_0x52e44e[_0xee1f('0x4')],_0x52e44e[_0xee1f('0x11')],_0x52e44e[_0xee1f('0x12')]));recordings[_0x52e44e[_0xee1f('0x4')]]={'uniqueid':_0x52e44e[_0xee1f('0x4')],'accountcode':_0x52e44e[_0xee1f('0x6')],'exten':_0x52e44e[_0xee1f('0x12')],'context':_0x52e44e[_0xee1f('0x11')],'channel':_0x52e44e[_0xee1f('0x13')],'monitors':[]};}}catch(_0x3d5539){utils[_0xee1f('0x14')](util['format'](_0xee1f('0xe'),_0x52e44e[_0xee1f('0x4')]),_0x3d5539);}};exports[_0xee1f('0x15')]=function(_0x25c5c0){try{utils['debug'](util[_0xee1f('0xd')]('[%s][recordings][newstate]',_0x25c5c0[_0xee1f('0x4')]),_0x25c5c0);if(!_[_0xee1f('0x16')](recordings[_0x25c5c0['uniqueid']])&&_0x25c5c0['channelstate']==0x6){utils[_0xee1f('0x2')](util[_0xee1f('0xd')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x25c5c0[_0xee1f('0x4')],_0x25c5c0[_0xee1f('0x11')],_0x25c5c0['channel']));}else if(!_[_0xee1f('0x16')](recordings[_0x25c5c0[_0xee1f('0xf')]])&&_0x25c5c0['channelstate']==0x6&&_0x25c5c0[_0xee1f('0x11')]!=_0xee1f('0x17')){utils[_0xee1f('0x2')](util[_0xee1f('0xd')](_0xee1f('0x18'),_0x25c5c0['uniqueid'],_0x25c5c0[_0xee1f('0xf')],_0x25c5c0[_0xee1f('0x11')],_0x25c5c0['channel']));recordings[_0x25c5c0['linkedid']]['accountcode']=_0x25c5c0['accountcode'];}}catch(_0x1e6cc1){utils[_0xee1f('0x14')](util[_0xee1f('0xd')](_0xee1f('0x19'),_0x25c5c0[_0xee1f('0x4')]),_0x1e6cc1);}};exports['varset']=function(_0x21942e){try{if(!_[_0xee1f('0x16')](_0x21942e[_0xee1f('0x1a')])&&!_[_0xee1f('0x16')](_0x21942e[_0xee1f('0x1a')][_0xee1f('0x1b')])){utils[_0xee1f('0xc')](util[_0xee1f('0xd')](_0xee1f('0x1c'),_0x21942e[_0xee1f('0x4')]),_0x21942e);utils[_0xee1f('0x2')](util['format'](_0xee1f('0x1d'),_0x21942e[_0xee1f('0x4')],_0x21942e['variable'],_0x21942e[_0xee1f('0x1e')]));if(_['endsWith'](_0x21942e['value'],_0xee1f('0x1f'))){_0x21942e[_0xee1f('0x1e')]=_0x21942e[_0xee1f('0x1e')][_0xee1f('0x20')](_0xee1f('0x1f'),_0xee1f('0x21'));}if(recordings[_0x21942e['linkedid']]){var _0x3ec20e=_[_0xee1f('0x22')](recordings[_0x21942e[_0xee1f('0xf')]][_0xee1f('0x23')],{'value':_0x21942e[_0xee1f('0x1e')]});if(_['isNil'](_0x3ec20e)){recordings[_0x21942e[_0xee1f('0xf')]][_0xee1f('0x23')][_0xee1f('0x24')]({'value':_0x21942e[_0xee1f('0x1e')]});}}}}catch(_0x5140df){utils[_0xee1f('0x14')](util[_0xee1f('0xd')](_0xee1f('0x1c'),_0x21942e['uniqueid']),_0x5140df);}};exports['hangup']=function(_0x49ede8){try{if(!_[_0xee1f('0x16')](recordings[_0x49ede8[_0xee1f('0x4')]])){utils[_0xee1f('0xc')](util[_0xee1f('0xd')](_0xee1f('0x25'),_0x49ede8[_0xee1f('0x4')]),_0x49ede8);utils[_0xee1f('0x2')](util[_0xee1f('0xd')](_0xee1f('0x26'),_0x49ede8[_0xee1f('0x4')],_0x49ede8[_0xee1f('0x27')],_0x49ede8[_0xee1f('0x28')],_0x49ede8[_0xee1f('0x29')]));recordings[_0x49ede8[_0xee1f('0x4')]][_0xee1f('0x27')]=_0x49ede8[_0xee1f('0x27')];recordings[_0x49ede8[_0xee1f('0x4')]]['calleridname']=_0x49ede8[_0xee1f('0x28')];recordings[_0x49ede8[_0xee1f('0x4')]][_0xee1f('0x2a')]=_0x49ede8[_0xee1f('0x2a')];recordings[_0x49ede8['uniqueid']][_0xee1f('0x2b')]=_0x49ede8['connectedlinename'];if(recordings[_0x49ede8[_0xee1f('0x4')]]['type']==_0xee1f('0x2c')&&recordings[_0x49ede8['uniqueid']][_0xee1f('0x6')]){recordings[_0x49ede8[_0xee1f('0x4')]][_0xee1f('0x2a')]=recordings[_0x49ede8[_0xee1f('0x4')]]['accountcode'];recordings[_0x49ede8[_0xee1f('0x4')]][_0xee1f('0x2b')]='';}recordings[_0x49ede8[_0xee1f('0x4')]][_0xee1f('0x23')][_0xee1f('0x2d')](function(_0xe9ea15){var _0xa906c5=_[_0xee1f('0x2e')](recordings[_0x49ede8[_0xee1f('0x4')]]);_0xa906c5[_0xee1f('0x1e')]=_0xe9ea15[_0xee1f('0x1e')];writeDB(_0xa906c5);});delete recordings[_0x49ede8['uniqueid']];}}catch(_0x22a92c){utils[_0xee1f('0x14')](util['format'](_0xee1f('0x25'),_0x49ede8[_0xee1f('0x4')]),_0x22a92c);}};exports[_0xee1f('0x2f')]=function(_0x1e998c){try{if(!_[_0xee1f('0x16')](recordings[_0x1e998c['uniqueid']])){utils['debug'](util['format']('[%s][recordings][newexten]',_0x1e998c[_0xee1f('0x4')]),_0x1e998c);utils[_0xee1f('0x2')](util['format'](_0xee1f('0x30'),_0x1e998c['uniqueid'],_0x1e998c[_0xee1f('0x31')],_0x1e998c[_0xee1f('0x32')]));if(_0x1e998c[_0xee1f('0x31')][_0xee1f('0x33')]()==_0xee1f('0x34')&&_['startsWith'](_0x1e998c[_0xee1f('0x32')]['toLowerCase'](),_0xee1f('0x35'))){var _0x5c689a=_0x1e998c[_0xee1f('0x32')][_0xee1f('0x36')]('=');var _0x48a890=_0x5c689a[0x0][_0xee1f('0x37')](_0x5c689a[0x0][_0xee1f('0x38')]('(')+0x1,_0x5c689a[0x0]['lastIndexOf'](')'));var _0x3071b4=_0x5c689a[0x1];recordings[_0x1e998c[_0xee1f('0x4')]][_0x48a890]=_0x3071b4;}}}catch(_0x1859f4){utils['error'](util[_0xee1f('0xd')](_0xee1f('0x39'),_0x1e998c[_0xee1f('0x4')]),_0x1859f4);}};exports['queuecallerjoin']=function(_0x4f781b){try{if(!_[_0xee1f('0x16')](recordings[_0x4f781b[_0xee1f('0x4')]])){utils[_0xee1f('0xc')](util[_0xee1f('0xd')](_0xee1f('0x3a'),_0x4f781b[_0xee1f('0x4')]),_0x4f781b);utils[_0xee1f('0x2')](util[_0xee1f('0xd')](_0xee1f('0x3b'),_0x4f781b[_0xee1f('0x4')],_0x4f781b[_0xee1f('0x3c')]));recordings[_0x4f781b[_0xee1f('0x4')]][_0xee1f('0x3c')]=_0x4f781b[_0xee1f('0x3c')];}}catch(_0x4d31e1){utils[_0xee1f('0x14')](util['format'](_0xee1f('0x3a'),_0x4f781b[_0xee1f('0x4')]),_0x4d31e1);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a63b369..1a00659 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 _0x8be4=['transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','lodash','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','type','request','CreateVoiceTransferReport','blindtransfer','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8be4,0xc2));var _0x48be=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0x8be4[_0x55ff79];return _0x579067;};'use strict';var _=require(_0x48be('0x0'));var util=require(_0x48be('0x1'));var utils=require(_0x48be('0x2'));function writeDB(_0x382410){utils[_0x48be('0x3')](util['format'](_0x48be('0x4'),_0x382410['type']===_0x48be('0x5')?_0x382410[_0x48be('0x6')]:_0x382410[_0x48be('0x7')],_0x382410[_0x48be('0x8')]));utils[_0x48be('0x9')](_0x48be('0xa'),_0x382410);}exports[_0x48be('0xb')]=function(_0x478943){try{utils[_0x48be('0xc')](util[_0x48be('0xd')](_0x48be('0xe'),_0x478943[_0x48be('0x7')]),_0x478943);utils[_0x48be('0x3')](util['format'](_0x48be('0xf'),_0x478943[_0x48be('0x7')],_0x478943['transferercalleridnum'],_0x478943[_0x48be('0x10')],_0x478943[_0x48be('0x11')],_0x478943[_0x48be('0x12')]));_0x478943[_0x48be('0x8')]=_0x48be('0x13');writeDB(_0x478943);}catch(_0x4406d7){utils[_0x48be('0x14')](util[_0x48be('0xd')](_0x48be('0xe'),_0x478943[_0x48be('0x7')]),_0x4406d7);}};exports[_0x48be('0x15')]=function(_0x451a05){try{utils['debug'](util[_0x48be('0xd')](_0x48be('0x16'),_0x451a05['origtransfereruniqueid']),_0x451a05);utils[_0x48be('0x3')](util[_0x48be('0xd')](_0x48be('0x17'),_0x451a05[_0x48be('0x6')],_0x451a05[_0x48be('0x18')],_0x451a05[_0x48be('0x19')],_0x451a05[_0x48be('0x1a')],_0x451a05[_0x48be('0x1b')]));_0x451a05=_[_0x48be('0x1c')](_0x451a05,{'transfererchannel':_0x451a05[_0x48be('0x1d')],'transferercalleridnum':_0x451a05[_0x48be('0x18')],'transferercalleridname':_0x451a05['origtransferercalleridname'],'transfererconnectedlinenum':_0x451a05[_0x48be('0x1e')],'transfererconnectedlinename':_0x451a05[_0x48be('0x1f')],'transfereraccountcode':_0x451a05[_0x48be('0x20')],'transferercontext':_0x451a05[_0x48be('0x21')],'transfererexten':_0x451a05[_0x48be('0x22')],'transfererlinkedid':_0x451a05['origtransfererlinkedid'],'context':_0x451a05[_0x48be('0x23')],'extension':_0x451a05[_0x48be('0x24')],'type':_0x48be('0x5')});if(_[_0x48be('0x25')](_0x451a05[_0x48be('0x26')])){_0x451a05=_['assign'](_0x451a05,{'transfereechannel':_0x451a05[_0x48be('0x27')],'transfereecalleridnum':_0x451a05[_0x48be('0x1a')],'transfereecalleridname':_0x451a05['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x451a05[_0x48be('0x28')],'transfereeconnectedlinename':_0x451a05[_0x48be('0x29')],'transfereeaccountcode':_0x451a05[_0x48be('0x2a')],'transfereecontext':_0x451a05['transfertargetcontext'],'transfereeexten':_0x451a05[_0x48be('0x2b')],'transfereelinkedid':_0x451a05['transfertargetlinkedid']});}writeDB(_0x451a05);}catch(_0x323e05){utils['error'](util['format'](_0x48be('0x16'),_0x451a05[_0x48be('0x6')]),_0x323e05);}}; \ No newline at end of file +var _0xe13a=['lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','assign','origtransfererchannel','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]'];(function(_0x5ed54b,_0x3a2827){var _0x4b58c7=function(_0x19d3b6){while(--_0x19d3b6){_0x5ed54b['push'](_0x5ed54b['shift']());}};_0x4b58c7(++_0x3a2827);}(_0xe13a,0x15f));var _0xae13=function(_0x37383b,_0x2c9043){_0x37383b=_0x37383b-0x0;var _0xcd7b8d=_0xe13a[_0x37383b];return _0xcd7b8d;};'use strict';var _=require(_0xae13('0x0'));var util=require('util');var utils=require(_0xae13('0x1'));function writeDB(_0x15a04a){utils[_0xae13('0x2')](util[_0xae13('0x3')](_0xae13('0x4'),_0x15a04a[_0xae13('0x5')]==='attended'?_0x15a04a[_0xae13('0x6')]:_0x15a04a[_0xae13('0x7')],_0x15a04a[_0xae13('0x5')]));utils['request']('CreateVoiceTransferReport',_0x15a04a);}exports[_0xae13('0x8')]=function(_0xb95b82){try{utils[_0xae13('0x9')](util['format'](_0xae13('0xa'),_0xb95b82['uniqueid']),_0xb95b82);utils[_0xae13('0x2')](util[_0xae13('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xb95b82[_0xae13('0x7')],_0xb95b82[_0xae13('0xb')],_0xb95b82['transferercalleridname'],_0xb95b82[_0xae13('0xc')],_0xb95b82[_0xae13('0xd')]));_0xb95b82[_0xae13('0x5')]=_0xae13('0xe');writeDB(_0xb95b82);}catch(_0x8ee546){utils['error'](util[_0xae13('0x3')](_0xae13('0xa'),_0xb95b82[_0xae13('0x7')]),_0x8ee546);}};exports[_0xae13('0xf')]=function(_0x641521){try{utils[_0xae13('0x9')](util[_0xae13('0x3')]('[%s][transfers][attendedtransfer]',_0x641521[_0xae13('0x6')]),_0x641521);utils[_0xae13('0x2')](util['format'](_0xae13('0x10'),_0x641521[_0xae13('0x6')],_0x641521[_0xae13('0x11')],_0x641521[_0xae13('0x12')],_0x641521['transfertargetcalleridnum'],_0x641521['transfertargetcalleridname']));_0x641521=_[_0xae13('0x13')](_0x641521,{'transfererchannel':_0x641521[_0xae13('0x14')],'transferercalleridnum':_0x641521['origtransferercalleridnum'],'transferercalleridname':_0x641521[_0xae13('0x12')],'transfererconnectedlinenum':_0x641521['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x641521['secondtransfererconnectedlinename'],'transfereraccountcode':_0x641521[_0xae13('0x15')],'transferercontext':_0x641521[_0xae13('0x16')],'transfererexten':_0x641521[_0xae13('0x17')],'transfererlinkedid':_0x641521['origtransfererlinkedid'],'context':_0x641521['origtransferercontext'],'extension':_0x641521[_0xae13('0x18')],'type':_0xae13('0x19')});if(_[_0xae13('0x1a')](_0x641521[_0xae13('0x1b')])){_0x641521=_['assign'](_0x641521,{'transfereechannel':_0x641521[_0xae13('0x1c')],'transfereecalleridnum':_0x641521[_0xae13('0x1d')],'transfereecalleridname':_0x641521[_0xae13('0x1e')],'transfereeconnectedlinenum':_0x641521[_0xae13('0x1f')],'transfereeconnectedlinename':_0x641521[_0xae13('0x20')],'transfereeaccountcode':_0x641521[_0xae13('0x21')],'transfereecontext':_0x641521[_0xae13('0x22')],'transfereeexten':_0x641521[_0xae13('0x23')],'transfereelinkedid':_0x641521[_0xae13('0x24')]});}writeDB(_0x641521);}catch(_0xbef90b){utils[_0xae13('0x25')](util[_0xae13('0x3')](_0xae13('0x26'),_0x641521[_0xae13('0x6')]),_0xbef90b);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index f270734..8c81cf7 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 _0x015e=['error','request','then','[utils][request]\x20name:%s','catch','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','xdr','info','debug','inspect'];(function(_0x414579,_0x23a19c){var _0x18653d=function(_0xe08c48){while(--_0xe08c48){_0x414579['push'](_0x414579['shift']());}};_0x18653d(++_0x23a19c);}(_0x015e,0x138));var _0xe015=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x015e[_0x8c43de];return _0xa6591b;};'use strict';var BPromise=require(_0xe015('0x0'));var jayson=require(_0xe015('0x1'));var moment=require(_0xe015('0x2'));var util=require(_0xe015('0x3'));var client=jayson['client'][_0xe015('0x4')]({'port':0x2329});var logger=require(_0xe015('0x5'))(_0xe015('0x6'));exports[_0xe015('0x7')]=function(_0x37b0b2,_0x299420){logger['info'](_0x37b0b2,_0x299420?util['inspect'](_0x299420,{'showHidden':![],'depth':null}):'');};exports[_0xe015('0x8')]=function(_0x78558e,_0x1f4006){logger[_0xe015('0x8')](_0x78558e,_0x1f4006?util[_0xe015('0x9')](_0x1f4006,{'showHidden':![],'depth':null}):'');};exports[_0xe015('0xa')]=function(_0x308041,_0x4e202e){logger[_0xe015('0xa')](_0x308041,_0x4e202e?util[_0xe015('0x9')](_0x4e202e,{'showHidden':![],'depth':null}):'');};exports[_0xe015('0xb')]=function(_0x1f7dbb,_0x3fd412){return client['request'](_0x1f7dbb,{'body':_0x3fd412})[_0xe015('0xc')](function(_0x23f861){logger[_0xe015('0x8')](_0xe015('0xd'),_0x1f7dbb,_0x23f861?util[_0xe015('0x9')](_0x23f861,{'showHidden':![],'depth':null}):'');})[_0xe015('0xe')](function(_0x24df8e){logger[_0xe015('0xa')](_0xe015('0xd'),_0x1f7dbb,_0x24df8e?util[_0xe015('0x9')](_0x24df8e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x52cddf){return client[_0xe015('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xe015('0xf'),_0xe015('0x10'),_0xe015('0x11')],'where':_0x52cddf,'limit':0x1}})[_0xe015('0xc')](function(_0x496fbe){logger[_0xe015('0x8')](_0xe015('0x12'),JSON[_0xe015('0x13')](_0x52cddf),_0x496fbe?util[_0xe015('0x9')](_0x496fbe,{'showHidden':![],'depth':null}):'');return _0x496fbe[_0xe015('0x14')][_0xe015('0x15')]?_0x496fbe[_0xe015('0x14')][0x0]:null;});}exports[_0xe015('0x16')]=function(_0x3c3d25){return new BPromise(function(_0x1f2ab8,_0x2ad4b8){if(_0x3c3d25){return getUser({'internal':_0x3c3d25})[_0xe015('0xc')](function(_0x25676f){logger[_0xe015('0x7')](_0xe015('0x17'),_0x3c3d25,_0x25676f?_0xe015('0x18'):_0xe015('0x19'));return _0x1f2ab8(_0x25676f);})[_0xe015('0xe')](function(_0x59e675){logger['error']('[utils][getUserByInternal]',_0x59e675?util[_0xe015('0x9')](_0x59e675,{'showHidden':![],'depth':null}):'');return _0x1f2ab8(null);});}return _0x1f2ab8(null);});};exports[_0xe015('0x1a')]=function(_0x4c8350){return new BPromise(function(_0x475700,_0x344b48){if(_0x4c8350){return getUser({'interface':_0x4c8350})['then'](function(_0xb8b644){logger[_0xe015('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x4c8350,_0xb8b644?'found':_0xe015('0x19'));return _0x475700(_0xb8b644);})[_0xe015('0xe')](function(_0x265867){logger['error'](_0xe015('0x1b'),_0x265867?util[_0xe015('0x9')](_0x265867,{'showHidden':![],'depth':null}):'');return _0x475700(null);});}return _0x475700(null);});};exports[_0xe015('0x1c')]=function(_0x37a9b6){return new BPromise(function(_0x3344ba,_0x1d8562){if(_0x37a9b6){return getUser({'name':_0x37a9b6})[_0xe015('0xc')](function(_0x1ef4d2){logger[_0xe015('0x7')](_0xe015('0x1d'),_0x37a9b6,_0x1ef4d2?_0xe015('0x18'):_0xe015('0x19'));return _0x3344ba(_0x1ef4d2);})[_0xe015('0xe')](function(_0x36178d){logger[_0xe015('0xa')]('[utils][getUserByName]',_0x36178d?util['inspect'](_0x36178d,{'showHidden':![],'depth':null}):'');return _0x3344ba(null);});}return _0x3344ba(null);});};exports[_0xe015('0x1e')]=function(_0x5d10df){return new BPromise(function(_0x739050,_0x2446d9){if(_0x5d10df){return client[_0xe015('0xb')](_0xe015('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xe015('0x10'),_0xe015('0x20'),'acw',_0xe015('0x21')],'where':{'name':_0x5d10df},'limit':0x1}})[_0xe015('0xc')](function(_0x452926){logger[_0xe015('0x8')](_0xe015('0x22'),_0x5d10df,_0x452926?util[_0xe015('0x9')](_0x452926,{'showHidden':![],'depth':null}):'');logger[_0xe015('0x7')](_0xe015('0x23'),_0x5d10df,_0x452926?_0xe015('0x18'):_0xe015('0x19'));return _0x739050(_0x452926[_0xe015('0x14')][_0xe015('0x15')]?_0x452926[_0xe015('0x14')][0x0]:null);})[_0xe015('0xe')](function(_0x4cf903){logger[_0xe015('0xa')]('[utils][getVoiceQueueByName]',_0x4cf903?util['inspect'](_0x4cf903,{'showHidden':![],'depth':null}):'');return _0x739050(null);});}return _0x739050(null);});};exports[_0xe015('0x24')]=function(_0x54e424,_0x3cffd8){return moment(_0x54e424)[_0xe015('0x25')](_0x3cffd8,_0xe015('0x26'))[_0xe015('0x27')](_0xe015('0x28'));};exports[_0xe015('0x29')]=function(_0xc304db,_0x15f433){return moment(_0xc304db)[_0xe015('0x2a')](_0x15f433,'seconds')[_0xe015('0x27')](_0xe015('0x28'));};exports['diffTime']=function(_0x1c25ba,_0x33f38f){return moment(_0x1c25ba)[_0xe015('0x2b')](moment(_0x33f38f),'seconds');};exports['sumTime']=function(_0x4a4166,_0x3c232b){return parseInt(_0x4a4166,0xa)+parseInt(_0x3c232b,0xa);};exports['now']=function(){return moment()['format'](_0xe015('0x28'));};exports[_0xe015('0x2c')]=function(_0xca7b1a,_0x35e27f){if(_0x35e27f){return moment(_0xca7b1a)['isAfter'](_0x35e27f);}return!![];};exports[_0xe015('0x2d')]=function(_0x4380d5,_0x505931){if(_0x505931){return moment(_0x4380d5)[_0xe015('0x2d')](_0x505931);}else if(_0x4380d5){return!![];}return![];}; \ No newline at end of file +var _0x2292=['[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','xdr','info','inspect','error','request','then','debug','catch','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2292,0xa1));var _0x2229=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x2292[_0x18ab2a];return _0x16dcee;};'use strict';var BPromise=require(_0x2229('0x0'));var jayson=require(_0x2229('0x1'));var moment=require(_0x2229('0x2'));var util=require('util');var client=jayson[_0x2229('0x3')][_0x2229('0x4')]({'port':0x2329});var logger=require(_0x2229('0x5'))(_0x2229('0x6'));exports['info']=function(_0x7ac718,_0x10eff5){logger[_0x2229('0x7')](_0x7ac718,_0x10eff5?util[_0x2229('0x8')](_0x10eff5,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x42a124,_0x1d7369){logger['debug'](_0x42a124,_0x1d7369?util[_0x2229('0x8')](_0x1d7369,{'showHidden':![],'depth':null}):'');};exports[_0x2229('0x9')]=function(_0xe7f1e5,_0x526f09){logger[_0x2229('0x9')](_0xe7f1e5,_0x526f09?util[_0x2229('0x8')](_0x526f09,{'showHidden':![],'depth':null}):'');};exports[_0x2229('0xa')]=function(_0x272fee,_0x44074e){return client[_0x2229('0xa')](_0x272fee,{'body':_0x44074e})[_0x2229('0xb')](function(_0x4a3bf5){logger[_0x2229('0xc')]('[utils][request]\x20name:%s',_0x272fee,_0x4a3bf5?util[_0x2229('0x8')](_0x4a3bf5,{'showHidden':![],'depth':null}):'');})[_0x2229('0xd')](function(_0x408182){logger[_0x2229('0x9')](_0x2229('0xe'),_0x272fee,_0x408182?util[_0x2229('0x8')](_0x408182,{'showHidden':![],'depth':null}):'');});};function getUser(_0x246cc1){return client[_0x2229('0xa')](_0x2229('0xf'),{'options':{'raw':!![],'attributes':['id',_0x2229('0x10'),_0x2229('0x11'),'interface'],'where':_0x246cc1,'limit':0x1}})['then'](function(_0x3856ae){logger[_0x2229('0xc')](_0x2229('0x12'),JSON[_0x2229('0x13')](_0x246cc1),_0x3856ae?util[_0x2229('0x8')](_0x3856ae,{'showHidden':![],'depth':null}):'');return _0x3856ae[_0x2229('0x14')][_0x2229('0x15')]?_0x3856ae['result'][0x0]:null;});}exports[_0x2229('0x16')]=function(_0xde09c9){return new BPromise(function(_0x3c2718,_0x50d33b){if(_0xde09c9){return getUser({'internal':_0xde09c9})['then'](function(_0x2312f7){logger[_0x2229('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0xde09c9,_0x2312f7?_0x2229('0x17'):_0x2229('0x18'));return _0x3c2718(_0x2312f7);})[_0x2229('0xd')](function(_0x719091){logger[_0x2229('0x9')](_0x2229('0x19'),_0x719091?util[_0x2229('0x8')](_0x719091,{'showHidden':![],'depth':null}):'');return _0x3c2718(null);});}return _0x3c2718(null);});};exports[_0x2229('0x1a')]=function(_0x337e8d){return new BPromise(function(_0x4f951e,_0x16bba3){if(_0x337e8d){return getUser({'interface':_0x337e8d})['then'](function(_0x8c7c50){logger[_0x2229('0x7')](_0x2229('0x1b'),_0x337e8d,_0x8c7c50?'found':_0x2229('0x18'));return _0x4f951e(_0x8c7c50);})[_0x2229('0xd')](function(_0x3d67d2){logger[_0x2229('0x9')](_0x2229('0x1c'),_0x3d67d2?util[_0x2229('0x8')](_0x3d67d2,{'showHidden':![],'depth':null}):'');return _0x4f951e(null);});}return _0x4f951e(null);});};exports['getUserByName']=function(_0x4aa1ab){return new BPromise(function(_0x2fbdb9,_0x1e049e){if(_0x4aa1ab){return getUser({'name':_0x4aa1ab})[_0x2229('0xb')](function(_0x3f077c){logger['info'](_0x2229('0x1d'),_0x4aa1ab,_0x3f077c?_0x2229('0x17'):'notfound');return _0x2fbdb9(_0x3f077c);})[_0x2229('0xd')](function(_0x4dbcf0){logger[_0x2229('0x9')]('[utils][getUserByName]',_0x4dbcf0?util[_0x2229('0x8')](_0x4dbcf0,{'showHidden':![],'depth':null}):'');return _0x2fbdb9(null);});}return _0x2fbdb9(null);});};exports[_0x2229('0x1e')]=function(_0x3323c3){return new BPromise(function(_0x1d3d51,_0xb86403){if(_0x3323c3){return client[_0x2229('0xa')](_0x2229('0x1f'),{'options':{'raw':!![],'attributes':['id','name',_0x2229('0x20'),_0x2229('0x21'),_0x2229('0x22')],'where':{'name':_0x3323c3},'limit':0x1}})[_0x2229('0xb')](function(_0x472ec2){logger[_0x2229('0xc')]('[utils][getVoiceQueueByName]\x20name:%s',_0x3323c3,_0x472ec2?util[_0x2229('0x8')](_0x472ec2,{'showHidden':![],'depth':null}):'');logger[_0x2229('0x7')](_0x2229('0x23'),_0x3323c3,_0x472ec2?_0x2229('0x17'):'notfound');return _0x1d3d51(_0x472ec2[_0x2229('0x14')][_0x2229('0x15')]?_0x472ec2[_0x2229('0x14')][0x0]:null);})['catch'](function(_0x38a254){logger[_0x2229('0x9')](_0x2229('0x24'),_0x38a254?util[_0x2229('0x8')](_0x38a254,{'showHidden':![],'depth':null}):'');return _0x1d3d51(null);});}return _0x1d3d51(null);});};exports[_0x2229('0x25')]=function(_0x296ef3,_0x587f1d){return moment(_0x296ef3)[_0x2229('0x26')](_0x587f1d,_0x2229('0x27'))[_0x2229('0x28')](_0x2229('0x29'));};exports['subtractTime']=function(_0x291d86,_0x5504f5){return moment(_0x291d86)[_0x2229('0x2a')](_0x5504f5,_0x2229('0x27'))[_0x2229('0x28')](_0x2229('0x29'));};exports[_0x2229('0x2b')]=function(_0xdd5477,_0x5bd40c){return moment(_0xdd5477)[_0x2229('0x2c')](moment(_0x5bd40c),_0x2229('0x27'));};exports[_0x2229('0x2d')]=function(_0x52ac59,_0x18811b){return parseInt(_0x52ac59,0xa)+parseInt(_0x18811b,0xa);};exports[_0x2229('0x2e')]=function(){return moment()['format'](_0x2229('0x29'));};exports[_0x2229('0x2f')]=function(_0x2810a8,_0x146be6){if(_0x146be6){return moment(_0x2810a8)['isAfter'](_0x146be6);}return!![];};exports[_0x2229('0x30')]=function(_0x5510bf,_0x327fb6){if(_0x327fb6){return moment(_0x5510bf)[_0x2229('0x30')](_0x327fb6);}else if(_0x5510bf){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 b0a5689..b0719d7 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 _0x37a6=['remoteAddress','url','statusCode','responseTime','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','client','role','name','ensureDir','user','no-user','data','timestamp','catch','error','api','auth','set','client-side-logger','body','\x20body=%s','format','headers','x-forwarded-for','connection'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0x37a6,0xfa));var _0x637a=function(_0x4b3637,_0x3657ea){_0x4b3637=_0x4b3637-0x0;var _0x2fcb89=_0x37a6[_0x4b3637];return _0x2fcb89;};var fs=require(_0x637a('0x0'));var _=require(_0x637a('0x1'));var ewinston=require(_0x637a('0x2'));var path=require('path');var util=require(_0x637a('0x3'));var fileLogger=require(_0x637a('0x4'))['fileLogger'];var safeTemplate=require(_0x637a('0x5'))[_0x637a('0x6')];var maskSensitiveData=require(_0x637a('0x7'))[_0x637a('0x8')];function ClientSideLogger(){function _0x470508(_0x4ee53c){var _0x47d4aa=path[_0x637a('0x9')](_0x637a('0xa'),_0x637a('0xb'),'xcally');var _0x2ec776=path[_0x637a('0x9')](_0x637a('0xc'),_0x4ee53c[_0x637a('0xd')]+'-'+_0x4ee53c[_0x637a('0xe')]);return fs[_0x637a('0xf')](path[_0x637a('0x9')](_0x47d4aa,_0x2ec776))['then'](function(){var _0x5d5f23=fileLogger(_0x637a('0xc'),path[_0x637a('0x9')](_0x47d4aa,_0x2ec776));return _0x5d5f23;})['catch'](function(_0x2c1622){throw _0x2c1622;});}this[_0x637a('0xb')]=function(_0x4bb919,_0x4ecffc,_0x5bf12e,_0x5e1430){return _0x470508(_0x4bb919[_0x637a('0x10')])['then'](function(_0x81c71d){var _0x1b1211=_0x81c71d[_0x4ecffc];return _0x1b1211;})['then'](function(_0x373ce0){var _0x42fa9a=_0x4bb919[_0x637a('0x10')]?_0x4bb919[_0x637a('0x10')]['id']:_0x637a('0x11');var _0x2ca626=_0x5e1430[_0x637a('0x12')];var _0x46ac18=_0x5e1430[_0x637a('0x13')];var _0x5cfcb4=new Date(Number(_0x46ac18));return _0x373ce0(_0x42fa9a,_0x5cfcb4,_0x5bf12e,_0x2ca626);})[_0x637a('0x14')](function(_0x3ac7af){fileLogger(_0x637a('0xc'))[_0x637a('0x15')](_0x3ac7af);});};}function setupLoggers(_0x3fb7b2){return new Promise(function(_0x2c2e3c){var _0x309b0a=new ClientSideLogger();var _0x3ed6a7=fileLogger(_0x637a('0x16'));var _0x5d81f=fileLogger(_0x637a('0x17'));_0x3fb7b2[_0x637a('0x18')](_0x637a('0x19'),_0x309b0a);_0x3fb7b2['use'](ewinston['logger']({'winstonInstance':_0x3ed6a7,'meta':![],'statusLevels':!![],'msg':function(_0xc55cc2,_0x2e927d){var _0x22efec='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0xc55cc2[_0x637a('0x1a')])){_0x22efec+=_0x637a('0x1b');var _0x3cacef=_0xc55cc2[_0x637a('0x1a')];maskSensitiveData(_0x3cacef);}return safeTemplate(util[_0x637a('0x1c')](_0x22efec,_0xc55cc2['method'],_0xc55cc2[_0x637a('0x1d')]['x-forwarded-for']?_0xc55cc2[_0x637a('0x1d')][_0x637a('0x1e')]:_0xc55cc2[_0x637a('0x1f')][_0x637a('0x20')]||_0xc55cc2['ip'],_0xc55cc2[_0x637a('0x21')],_0x2e927d[_0x637a('0x22')],_0x2e927d[_0x637a('0x23')],_0xc55cc2[_0x637a('0x10')]?_0xc55cc2[_0x637a('0x10')]['id']:null,_0xc55cc2[_0x637a('0x10')]?_0xc55cc2['user'][_0x637a('0xe')]:null,_0xc55cc2['user']?_0xc55cc2[_0x637a('0x10')][_0x637a('0xd')]:null,_0x3cacef?util['inspect'](_0x3cacef,![],null):''));}}));_0x3fb7b2[_0x637a('0x24')](ewinston[_0x637a('0x25')]({'winstonInstance':_0x5d81f,'meta':![],'statusLevels':!![],'msg':function(_0x3e147f,_0x5ca078){var _0x322970=_0x637a('0x26');if(_0x3e147f[_0x637a('0x1a')]&&_0x3e147f[_0x637a('0x1a')][_0x637a('0x27')]&&_0x3e147f[_0x637a('0x1a')][_0x637a('0x28')]){_0x322970=_0x637a('0x29');}return util[_0x637a('0x1c')](_0x322970,_0x3e147f[_0x637a('0x2a')],_0x3e147f['headers']['x-forwarded-for']?_0x3e147f['headers'][_0x637a('0x1e')]:_0x3e147f[_0x637a('0x1f')][_0x637a('0x20')]||_0x3e147f['ip'],_0x3e147f[_0x637a('0x21')],_0x5ca078[_0x637a('0x22')],_0x5ca078[_0x637a('0x23')],_0x3e147f['user']?_0x3e147f[_0x637a('0x10')]['id']:null,_0x3e147f['user']?_0x3e147f[_0x637a('0x10')][_0x637a('0xe')]:null,_0x3e147f[_0x637a('0x10')]?_0x3e147f[_0x637a('0x10')]['role']:null,_0x3e147f['body']&&_0x3e147f[_0x637a('0x1a')][_0x637a('0x27')]?_0x3e147f[_0x637a('0x1a')]['device']:_0x637a('0x2b'),_0x3e147f['body']&&_0x3e147f['body'][_0x637a('0x28')]?_0x3e147f['body'][_0x637a('0x28')]:'',_0x3e147f[_0x637a('0x1a')]&&_0x3e147f[_0x637a('0x1a')][_0x637a('0x2c')]?_0x3e147f['body'][_0x637a('0x2c')]:'');},'ignoreRoute':function(_0xabde1){var _0xca5f37=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xca5f37[_0x637a('0x2d')](_0xabde1['url']);}}));return _0x2c2e3c();});}exports[_0x637a('0x2e')]=setupLoggers; \ No newline at end of file +var _0x8aaf=['catch','log','then','user','no-user','data','timestamp','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_name','fs-extra','lodash','express-winston','path','util','./loggers','./safe-template','./mask-sensitive-data','join','/var','xcally','client','role','name','ensureDir'];(function(_0x44e5fe,_0xd4a750){var _0x43466f=function(_0x2aaf3d){while(--_0x2aaf3d){_0x44e5fe['push'](_0x44e5fe['shift']());}};_0x43466f(++_0xd4a750);}(_0x8aaf,0x1bd));var _0xf8aa=function(_0x6ab5b0,_0x471b81){_0x6ab5b0=_0x6ab5b0-0x0;var _0x4bcaef=_0x8aaf[_0x6ab5b0];return _0x4bcaef;};var fs=require(_0xf8aa('0x0'));var _=require(_0xf8aa('0x1'));var ewinston=require(_0xf8aa('0x2'));var path=require(_0xf8aa('0x3'));var util=require(_0xf8aa('0x4'));var fileLogger=require(_0xf8aa('0x5'))['fileLogger'];var safeTemplate=require(_0xf8aa('0x6'))['safeTemplate'];var maskSensitiveData=require(_0xf8aa('0x7'))['maskSensitiveData'];function ClientSideLogger(){function _0x3b9542(_0x46d366){var _0x4c0ec0=path[_0xf8aa('0x8')](_0xf8aa('0x9'),'log',_0xf8aa('0xa'));var _0x53fa98=path['join'](_0xf8aa('0xb'),_0x46d366[_0xf8aa('0xc')]+'-'+_0x46d366[_0xf8aa('0xd')]);return fs[_0xf8aa('0xe')](path['join'](_0x4c0ec0,_0x53fa98))['then'](function(){var _0x352919=fileLogger(_0xf8aa('0xb'),path['join'](_0x4c0ec0,_0x53fa98));return _0x352919;})[_0xf8aa('0xf')](function(_0xece9c6){throw _0xece9c6;});}this[_0xf8aa('0x10')]=function(_0x3a6e73,_0x29ae44,_0x16a2f0,_0x45f159){return _0x3b9542(_0x3a6e73['user'])[_0xf8aa('0x11')](function(_0x4a6764){var _0x423ca6=_0x4a6764[_0x29ae44];return _0x423ca6;})[_0xf8aa('0x11')](function(_0x1f042a){var _0x2c693e=_0x3a6e73[_0xf8aa('0x12')]?_0x3a6e73[_0xf8aa('0x12')]['id']:_0xf8aa('0x13');var _0x153ca3=_0x45f159[_0xf8aa('0x14')];var _0x518523=_0x45f159[_0xf8aa('0x15')];var _0x46e008=new Date(Number(_0x518523));return _0x1f042a(_0x2c693e,_0x46e008,_0x16a2f0,_0x153ca3);})[_0xf8aa('0xf')](function(_0x56c131){fileLogger(_0xf8aa('0xb'))['error'](_0x56c131);});};}function setupLoggers(_0x1b6e61){return new Promise(function(_0x4450f2){var _0x4435fb=new ClientSideLogger();var _0x45690f=fileLogger(_0xf8aa('0x16'));var _0xd9dd96=fileLogger(_0xf8aa('0x17'));_0x1b6e61[_0xf8aa('0x18')](_0xf8aa('0x19'),_0x4435fb);_0x1b6e61[_0xf8aa('0x1a')](ewinston[_0xf8aa('0x1b')]({'winstonInstance':_0x45690f,'meta':![],'statusLevels':!![],'msg':function(_0x943d19,_0x38fda4){var _0x1d8043=_0xf8aa('0x1c');if(!_['isEmpty'](_0x943d19[_0xf8aa('0x1d')])){_0x1d8043+='\x20body=%s';var _0x497cd4=_0x943d19[_0xf8aa('0x1d')];maskSensitiveData(_0x497cd4);}return safeTemplate(util[_0xf8aa('0x1e')](_0x1d8043,_0x943d19[_0xf8aa('0x1f')],_0x943d19[_0xf8aa('0x20')][_0xf8aa('0x21')]?_0x943d19[_0xf8aa('0x20')]['x-forwarded-for']:_0x943d19[_0xf8aa('0x22')][_0xf8aa('0x23')]||_0x943d19['ip'],_0x943d19[_0xf8aa('0x24')],_0x38fda4[_0xf8aa('0x25')],_0x38fda4[_0xf8aa('0x26')],_0x943d19['user']?_0x943d19['user']['id']:null,_0x943d19[_0xf8aa('0x12')]?_0x943d19[_0xf8aa('0x12')][_0xf8aa('0xd')]:null,_0x943d19[_0xf8aa('0x12')]?_0x943d19[_0xf8aa('0x12')]['role']:null,_0x497cd4?util[_0xf8aa('0x27')](_0x497cd4,![],null):''));}}));_0x1b6e61['use'](ewinston[_0xf8aa('0x1b')]({'winstonInstance':_0xd9dd96,'meta':![],'statusLevels':!![],'msg':function(_0x4a836c,_0x425a86){var _0x57d666=_0xf8aa('0x28');if(_0x4a836c['body']&&_0x4a836c[_0xf8aa('0x1d')][_0xf8aa('0x29')]&&_0x4a836c[_0xf8aa('0x1d')][_0xf8aa('0x2a')]){_0x57d666=_0xf8aa('0x2b');}return util[_0xf8aa('0x1e')](_0x57d666,_0x4a836c['method'],_0x4a836c[_0xf8aa('0x20')]['x-forwarded-for']?_0x4a836c['headers'][_0xf8aa('0x21')]:_0x4a836c[_0xf8aa('0x22')][_0xf8aa('0x23')]||_0x4a836c['ip'],_0x4a836c['url'],_0x425a86[_0xf8aa('0x25')],_0x425a86[_0xf8aa('0x26')],_0x4a836c[_0xf8aa('0x12')]?_0x4a836c[_0xf8aa('0x12')]['id']:null,_0x4a836c[_0xf8aa('0x12')]?_0x4a836c[_0xf8aa('0x12')]['name']:null,_0x4a836c[_0xf8aa('0x12')]?_0x4a836c[_0xf8aa('0x12')]['role']:null,_0x4a836c[_0xf8aa('0x1d')]&&_0x4a836c[_0xf8aa('0x1d')]['device']?_0x4a836c['body'][_0xf8aa('0x29')]:_0xf8aa('0x2c'),_0x4a836c[_0xf8aa('0x1d')]&&_0x4a836c[_0xf8aa('0x1d')][_0xf8aa('0x2a')]?_0x4a836c[_0xf8aa('0x1d')][_0xf8aa('0x2a')]:'',_0x4a836c[_0xf8aa('0x1d')]&&_0x4a836c['body'][_0xf8aa('0x2d')]?_0x4a836c['body'][_0xf8aa('0x2d')]:'');},'ignoreRoute':function(_0x47752c){var _0x32d5e2=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x32d5e2['test'](_0x47752c[_0xf8aa('0x24')]);}}));return _0x4450f2();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 1513b16..ec32a90 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bad=['circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','max','min','MMM','monthCompare','test','isMoment','split','length','padStart','iftime','lodash','map','source','join','Date\x20not\x20valid','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval'];(function(_0x5c92c7,_0x2bae59){var _0x1f64c0=function(_0x5c783d){while(--_0x5c783d){_0x5c92c7['push'](_0x5c92c7['shift']());}};_0x1f64c0(++_0x2bae59);}(_0x9bad,0x179));var _0xd9ba=function(_0x27341a,_0x218385){_0x27341a=_0x27341a-0x0;var _0x1a4bc1=_0x9bad[_0x27341a];return _0x1a4bc1;};var _=require(_0xd9ba('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xd9ba('0x1')](function(_0x3d2f00){return _0x3d2f00[_0xd9ba('0x2')];})[_0xd9ba('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0xd9ba('0x4');function throwIfDateNotValid(_0x439beb){if(!_0x439beb['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x2ea3d2){var _0x262ecb=_0x2ea3d2['split'](':')[_0xd9ba('0x1')](function(_0xb00b04){return parseInt(_0xb00b04,0xa);});var _0x573429=_0x262ecb[0x0];var _0x29d7a6=_0x262ecb[0x1];if(_0x573429<0x0||_0x573429>0x17||_0x29d7a6<0x0||_0x29d7a6>0x3b){throw new Error(EINVALID_DATE);}return[_0x573429,_0x29d7a6];}function circularDoWInterval(_0x5d9464,_0x4d49a8){if(_0x5d9464===_0x4d49a8){return[_0x5d9464];}else{var _0x5301cb=moment[_0xd9ba('0x5')]();moment['locale']('en');var _0x29fc2e=moment[_0xd9ba('0x6')]()[_0xd9ba('0x1')](function(_0x1cd4f3){return _0x1cd4f3[_0xd9ba('0x7')]();});moment['locale'](_0x5301cb);var _0x4e5ac7=_0x29fc2e[_0xd9ba('0x8')](_0x5d9464);var _0x230922=_0x29fc2e[_0xd9ba('0x8')](_0x4d49a8);if(_0x230922>_0x4e5ac7){return _0x29fc2e[_0xd9ba('0x9')](_0x4e5ac7,_0x230922+0x1);}else{var _0xf41652=_0x29fc2e[_0xd9ba('0x9')](0x0,_0x230922+0x1);var _0x508fc9=_0x29fc2e[_0xd9ba('0x9')](_0x4e5ac7);return _0x508fc9[_0xd9ba('0xa')](_0xf41652);}}}module[_0xd9ba('0xb')][_0xd9ba('0xc')]=circularDoWInterval;function circularMonthInterval(_0x5b0ce1,_0x5187be){if(_0x5b0ce1===_0x5187be){return[_0x5b0ce1];}else{var _0x56c5f8=moment[_0xd9ba('0x5')]();moment[_0xd9ba('0x5')]('en');var _0x4fd43a=moment['monthsShort']()['map'](function(_0x7f645c){return _0x7f645c[_0xd9ba('0x7')]();});moment[_0xd9ba('0x5')](_0x56c5f8);var _0x39c47e=_0x4fd43a['indexOf'](_0x5b0ce1);var _0x4d9c00=_0x4fd43a[_0xd9ba('0x8')](_0x5187be);if(_0x4d9c00>_0x39c47e){return _0x4fd43a[_0xd9ba('0x9')](_0x39c47e,_0x4d9c00+0x1);}else{var _0x17fa17=_0x4fd43a[_0xd9ba('0x9')](0x0,_0x4d9c00+0x1);var _0x26e15d=_0x4fd43a[_0xd9ba('0x9')](_0x39c47e);return _0x26e15d[_0xd9ba('0xa')](_0x17fa17);}}}module[_0xd9ba('0xb')][_0xd9ba('0xd')]=circularMonthInterval;function parseDom(_0x1d0974){var _0x36285e=parseInt(_0x1d0974,0xa);if(_0x36285e<0x1||_0x36285e>0x1f){throw new Error(EINVALID_DATE);}return _0x36285e;}function timeCompare(_0x2ec068,_0x437f9d,_0x3035fc){var _0x2bc74d=_0x2ec068[_0xd9ba('0xe')]();var _0x29361e=extractTime(_0x437f9d);var _0x36fc32=_0x29361e[0x0];var _0x52506f=_0x29361e[0x1];var _0xdb35c7=_0x2ec068['clone']()[_0xd9ba('0xf')](_0x36fc32)['minutes'](_0x52506f);throwIfDateNotValid(_0xdb35c7);var _0x531d9c=extractTime(_0x3035fc);var _0x5dad79=_0x531d9c[0x0];var _0x481ec1=_0x531d9c[0x1];var _0x596f63=_0x2ec068[_0xd9ba('0xe')]()[_0xd9ba('0xf')](_0x5dad79)[_0xd9ba('0x10')](_0x481ec1);throwIfDateNotValid(_0x596f63);if(_0x596f63[_0xd9ba('0x11')](_0xdb35c7)){var _0x239f50=_0x2bc74d[_0xd9ba('0xe')]()[_0xd9ba('0x12')](_0xd9ba('0x13'));var _0x9b1624=_0x2bc74d[_0xd9ba('0xe')]()[_0xd9ba('0x14')]('day');return _0x2bc74d[_0xd9ba('0x15')](_0xdb35c7,_0x9b1624,undefined,'[]')||_0x2bc74d[_0xd9ba('0x15')](_0x239f50,_0x596f63,undefined,'[]');}else{return _0x2bc74d[_0xd9ba('0x15')](_0xdb35c7,_0x596f63,undefined,'[]');}}module['exports'][_0xd9ba('0x16')]=timeCompare;function dowCompare(_0x268872,_0x196738,_0x38d45d){var _0x313dc2=_0x268872[_0xd9ba('0x5')]('en')[_0xd9ba('0x17')](_0xd9ba('0x18'))['toLowerCase']();return circularDoWInterval(_0x196738,_0x38d45d)[_0xd9ba('0x19')](_0x313dc2);}module[_0xd9ba('0xb')][_0xd9ba('0x1a')]=dowCompare;function domCompare(_0x1d01af,_0x46a48e,_0x3c80d6){var _0x5661ab=_0x1d01af[_0xd9ba('0x1b')]();if(_0x46a48e===_0x3c80d6){return _0x5661ab===_0x46a48e;}else{var _0x1c97de=_0x1d01af[_0xd9ba('0x1c')]();var _0x2bafe8=_0x46a48e<_0x3c80d6;let _0x1e8884=![];var _0x2ee410=0x0;var _0x3ff1e9=0x0;if(_0x2bafe8){_0x2ee410=Math[_0xd9ba('0x1d')](0x1,_0x46a48e);_0x3ff1e9=Math[_0xd9ba('0x1e')](_0x3c80d6,_0x1c97de);_0x1e8884=_0x5661ab>=_0x2ee410&&_0x5661ab<=_0x3ff1e9;}else{_0x2ee410=Math[_0xd9ba('0x1e')](_0x46a48e,_0x1c97de);_0x3ff1e9=Math['max'](0x1,_0x3c80d6);_0x1e8884=_0x5661ab>=_0x2ee410||_0x5661ab<=_0x3ff1e9;}return _0x1e8884;}}module[_0xd9ba('0xb')]['domCompare']=domCompare;function monthCompare(_0x1b7caa,_0x2a1dfd,_0x1f039c){var _0x5f456f=_0x1b7caa['locale']('en')['format'](_0xd9ba('0x1f'))[_0xd9ba('0x7')]();return circularMonthInterval(_0x2a1dfd,_0x1f039c)['includes'](_0x5f456f);}module[_0xd9ba('0xb')][_0xd9ba('0x20')]=monthCompare;function iftime(_0x144948,_0x88edcf=moment['tz']['guess'](),_0x35089c=moment()){if(!validateRx[_0xd9ba('0x21')](_0x144948)){throw new Error(EINVALID_STRING);}else{var _0x4ea1ed=(moment[_0xd9ba('0x22')](_0x35089c)?_0x35089c['clone']():moment(_0x35089c))['tz'](_0x88edcf)[_0xd9ba('0x5')]('en');throwIfDateNotValid(_0x4ea1ed);var _0x247798=_0x144948[_0xd9ba('0x23')](',');var _0x396d42=_0x247798[0x0];var _0x2c887c=_0x247798[0x1];var _0x29c2ac=_0x247798[0x2];var _0x509356=_0x247798[0x3];let _0x234d15=!![];if(_0x396d42!=='*'){var _0x159f2a=_0x396d42[_0xd9ba('0x23')]('-');var _0x347a7a=_['padStart'](_0x159f2a[0x0],0x5,'0');var _0x5af719=_0x159f2a[_0xd9ba('0x24')]===0x2?_[_0xd9ba('0x25')](_0x159f2a[0x1],0x5,'0'):_0x347a7a;_0x234d15=timeCompare(_0x4ea1ed,_0x347a7a,_0x5af719);}let _0x4eeda3=!![];if(_0x2c887c!=='*'){var _0x1ce23d=_0x2c887c['split']('-');var _0x396c86=_0x1ce23d[0x0];var _0xa11384=_0x1ce23d[_0xd9ba('0x24')]===0x2?_0x1ce23d[0x1]:_0x396c86;_0x4eeda3=dowCompare(_0x4ea1ed,_0x396c86,_0xa11384);}let _0x517ad5=!![];if(_0x29c2ac!=='*'){var _0x37968c=_0x29c2ac[_0xd9ba('0x23')]('-');var _0x5775bf=parseDom(_0x37968c[0x0]);var _0x4d9f56=_0x37968c['length']===0x2?parseDom(_0x37968c[0x1]):_0x5775bf;_0x517ad5=domCompare(_0x4ea1ed,_0x5775bf,_0x4d9f56);}let _0x3b8e83=!![];if(_0x509356!=='*'){var _0x7dfa3=_0x509356['split']('-');var _0x17ba75=_0x7dfa3[0x0];var _0x1713ba=_0x7dfa3[_0xd9ba('0x24')]===0x2?_0x7dfa3[0x1]:_0x7dfa3[0x0];_0x3b8e83=monthCompare(_0x4ea1ed,_0x17ba75,_0x1713ba);}return _0x234d15&&_0x4eeda3&&_0x517ad5&&_0x3b8e83;}}module[_0xd9ba('0xb')][_0xd9ba('0x26')]=iftime; \ No newline at end of file +var _0xab1c=['toLowerCase','indexOf','slice','concat','exports','monthsShort','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','dowCompare','daysInMonth','max','min','domCompare','format','MMM','monthCompare','guess','test','isMoment','padStart','length','iftime','moment-timezone','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort'];(function(_0xdde2e6,_0x561587){var _0x3eb5b1=function(_0x397bd6){while(--_0x397bd6){_0xdde2e6['push'](_0xdde2e6['shift']());}};_0x3eb5b1(++_0x561587);}(_0xab1c,0x69));var _0xcab1=function(_0x407af9,_0x10e6dc){_0x407af9=_0x407af9-0x0;var _0x295a07=_0xab1c[_0x407af9];return _0x295a07;};var _=require('lodash');var moment=require(_0xcab1('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xcab1('0x1')](function(_0x5c8fa8){return _0x5c8fa8['source'];})[_0xcab1('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xcab1('0x3');var EINVALID_DATE=_0xcab1('0x4');function throwIfDateNotValid(_0x35af7b){if(!_0x35af7b[_0xcab1('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x414ba6){var _0x4f08e1=_0x414ba6[_0xcab1('0x6')](':')['map'](function(_0x40fc41){return parseInt(_0x40fc41,0xa);});var _0x11e684=_0x4f08e1[0x0];var _0x201dc0=_0x4f08e1[0x1];if(_0x11e684<0x0||_0x11e684>0x17||_0x201dc0<0x0||_0x201dc0>0x3b){throw new Error(EINVALID_DATE);}return[_0x11e684,_0x201dc0];}function circularDoWInterval(_0x50f54b,_0xfa39a1){if(_0x50f54b===_0xfa39a1){return[_0x50f54b];}else{var _0xda9deb=moment[_0xcab1('0x7')]();moment['locale']('en');var _0x23b8e7=moment[_0xcab1('0x8')]()[_0xcab1('0x1')](function(_0x3425e7){return _0x3425e7[_0xcab1('0x9')]();});moment['locale'](_0xda9deb);var _0x37fee0=_0x23b8e7[_0xcab1('0xa')](_0x50f54b);var _0x33a6c2=_0x23b8e7[_0xcab1('0xa')](_0xfa39a1);if(_0x33a6c2>_0x37fee0){return _0x23b8e7['slice'](_0x37fee0,_0x33a6c2+0x1);}else{var _0xbbe0c8=_0x23b8e7['slice'](0x0,_0x33a6c2+0x1);var _0x28e63f=_0x23b8e7[_0xcab1('0xb')](_0x37fee0);return _0x28e63f[_0xcab1('0xc')](_0xbbe0c8);}}}module[_0xcab1('0xd')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0xc946f7,_0x3fb057){if(_0xc946f7===_0x3fb057){return[_0xc946f7];}else{var _0x20a030=moment[_0xcab1('0x7')]();moment[_0xcab1('0x7')]('en');var _0x3c0039=moment[_0xcab1('0xe')]()['map'](function(_0xec6a1f){return _0xec6a1f['toLowerCase']();});moment[_0xcab1('0x7')](_0x20a030);var _0x548418=_0x3c0039[_0xcab1('0xa')](_0xc946f7);var _0x533d4c=_0x3c0039['indexOf'](_0x3fb057);if(_0x533d4c>_0x548418){return _0x3c0039[_0xcab1('0xb')](_0x548418,_0x533d4c+0x1);}else{var _0x5ca163=_0x3c0039[_0xcab1('0xb')](0x0,_0x533d4c+0x1);var _0x37e9e1=_0x3c0039['slice'](_0x548418);return _0x37e9e1[_0xcab1('0xc')](_0x5ca163);}}}module['exports']['circularMonthInterval']=circularMonthInterval;function parseDom(_0xf3b8ca){var _0x45dedb=parseInt(_0xf3b8ca,0xa);if(_0x45dedb<0x1||_0x45dedb>0x1f){throw new Error(EINVALID_DATE);}return _0x45dedb;}function timeCompare(_0x57debe,_0xdcb6ec,_0x5a9043){var _0x42544a=_0x57debe[_0xcab1('0xf')]();var _0x233b63=extractTime(_0xdcb6ec);var _0x10b495=_0x233b63[0x0];var _0x13a243=_0x233b63[0x1];var _0x269698=_0x57debe[_0xcab1('0xf')]()[_0xcab1('0x10')](_0x10b495)['minutes'](_0x13a243);throwIfDateNotValid(_0x269698);var _0x4e0d6c=extractTime(_0x5a9043);var _0x225895=_0x4e0d6c[0x0];var _0x4f4dfc=_0x4e0d6c[0x1];var _0x4eabff=_0x57debe[_0xcab1('0xf')]()[_0xcab1('0x10')](_0x225895)[_0xcab1('0x11')](_0x4f4dfc);throwIfDateNotValid(_0x4eabff);if(_0x4eabff[_0xcab1('0x12')](_0x269698)){var _0x373cef=_0x42544a[_0xcab1('0xf')]()[_0xcab1('0x13')](_0xcab1('0x14'));var _0x1c1081=_0x42544a[_0xcab1('0xf')]()[_0xcab1('0x15')](_0xcab1('0x14'));return _0x42544a[_0xcab1('0x16')](_0x269698,_0x1c1081,undefined,'[]')||_0x42544a['isBetween'](_0x373cef,_0x4eabff,undefined,'[]');}else{return _0x42544a[_0xcab1('0x16')](_0x269698,_0x4eabff,undefined,'[]');}}module[_0xcab1('0xd')][_0xcab1('0x17')]=timeCompare;function dowCompare(_0x3a9273,_0x42f391,_0x267348){var _0x2d08dd=_0x3a9273['locale']('en')['format']('ddd')[_0xcab1('0x9')]();return circularDoWInterval(_0x42f391,_0x267348)['includes'](_0x2d08dd);}module[_0xcab1('0xd')][_0xcab1('0x18')]=dowCompare;function domCompare(_0x495921,_0x2aece3,_0x405e6d){var _0x4c30eb=_0x495921['date']();if(_0x2aece3===_0x405e6d){return _0x4c30eb===_0x2aece3;}else{var _0x1d75ed=_0x495921[_0xcab1('0x19')]();var _0x5141e9=_0x2aece3<_0x405e6d;let _0x8e8ee2=![];var _0x13a390=0x0;var _0x134207=0x0;if(_0x5141e9){_0x13a390=Math[_0xcab1('0x1a')](0x1,_0x2aece3);_0x134207=Math[_0xcab1('0x1b')](_0x405e6d,_0x1d75ed);_0x8e8ee2=_0x4c30eb>=_0x13a390&&_0x4c30eb<=_0x134207;}else{_0x13a390=Math['min'](_0x2aece3,_0x1d75ed);_0x134207=Math[_0xcab1('0x1a')](0x1,_0x405e6d);_0x8e8ee2=_0x4c30eb>=_0x13a390||_0x4c30eb<=_0x134207;}return _0x8e8ee2;}}module['exports'][_0xcab1('0x1c')]=domCompare;function monthCompare(_0x5bebf8,_0x13e7c9,_0x3caf11){var _0x1b74f5=_0x5bebf8[_0xcab1('0x7')]('en')[_0xcab1('0x1d')](_0xcab1('0x1e'))['toLowerCase']();return circularMonthInterval(_0x13e7c9,_0x3caf11)['includes'](_0x1b74f5);}module[_0xcab1('0xd')][_0xcab1('0x1f')]=monthCompare;function iftime(_0x16906a,_0x677615=moment['tz'][_0xcab1('0x20')](),_0x240721=moment()){if(!validateRx[_0xcab1('0x21')](_0x16906a)){throw new Error(EINVALID_STRING);}else{var _0x4387fa=(moment[_0xcab1('0x22')](_0x240721)?_0x240721[_0xcab1('0xf')]():moment(_0x240721))['tz'](_0x677615)['locale']('en');throwIfDateNotValid(_0x4387fa);var _0x31cd1f=_0x16906a[_0xcab1('0x6')](',');var _0x39025f=_0x31cd1f[0x0];var _0x3a0104=_0x31cd1f[0x1];var _0x3887a3=_0x31cd1f[0x2];var _0xe45bda=_0x31cd1f[0x3];let _0x3aa407=!![];if(_0x39025f!=='*'){var _0x156415=_0x39025f[_0xcab1('0x6')]('-');var _0x5a98b2=_[_0xcab1('0x23')](_0x156415[0x0],0x5,'0');var _0x12fc3d=_0x156415[_0xcab1('0x24')]===0x2?_[_0xcab1('0x23')](_0x156415[0x1],0x5,'0'):_0x5a98b2;_0x3aa407=timeCompare(_0x4387fa,_0x5a98b2,_0x12fc3d);}let _0x507e66=!![];if(_0x3a0104!=='*'){var _0x24b620=_0x3a0104[_0xcab1('0x6')]('-');var _0x406de4=_0x24b620[0x0];var _0x29fd0f=_0x24b620[_0xcab1('0x24')]===0x2?_0x24b620[0x1]:_0x406de4;_0x507e66=dowCompare(_0x4387fa,_0x406de4,_0x29fd0f);}let _0x555c13=!![];if(_0x3887a3!=='*'){var _0x36e69d=_0x3887a3['split']('-');var _0xb70b5e=parseDom(_0x36e69d[0x0]);var _0x3edfea=_0x36e69d[_0xcab1('0x24')]===0x2?parseDom(_0x36e69d[0x1]):_0xb70b5e;_0x555c13=domCompare(_0x4387fa,_0xb70b5e,_0x3edfea);}let _0x1444e2=!![];if(_0xe45bda!=='*'){var _0x162e34=_0xe45bda['split']('-');var _0xde879=_0x162e34[0x0];var _0x13663d=_0x162e34[_0xcab1('0x24')]===0x2?_0x162e34[0x1]:_0x162e34[0x0];_0x1444e2=monthCompare(_0x4387fa,_0xde879,_0x13663d);}return _0x3aa407&&_0x507e66&&_0x555c13&&_0x1444e2;}}module[_0xcab1('0xd')][_0xcab1('0x25')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index c5a4032..bf0c862 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b7d=['redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','addColors','/var/log/xcally','format','%s-%s.log','message','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','level','{{{','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','transports','Console','warn','error','File','%s-%s','fileLogger','moment','winston','../config/environment','debugLevel','toLowerCase','info'];(function(_0x371f8d,_0x2d7355){var _0x3ed5fc=function(_0x1809ae){while(--_0x1809ae){_0x371f8d['push'](_0x371f8d['shift']());}};_0x3ed5fc(++_0x2d7355);}(_0x5b7d,0x8a));var _0xd5b7=function(_0x42f226,_0x54d9a4){_0x42f226=_0x42f226-0x0;var _0x385118=_0x5b7d[_0x42f226];return _0x385118;};'use strict';var path=require('path');var util=require('util');var moment=require(_0xd5b7('0x0'));var winston=require(_0xd5b7('0x1'));var config=require(_0xd5b7('0x2'));var debugLevel=config[_0xd5b7('0x3')]?config[_0xd5b7('0x3')][_0xd5b7('0x4')]():_0xd5b7('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':_0xd5b7('0x6'),'error':_0xd5b7('0x7'),'warn':_0xd5b7('0x8'),'info':_0xd5b7('0x9'),'print':_0xd5b7('0xa'),'success':_0xd5b7('0xb'),'http':'gray','verbose':'bold\x20magenta','debug':'bold\x20blue','silly':'bold\x20cyan'};winston[_0xd5b7('0xc')](XC_LOG_COLORS);function getLogFileName(_0x443cde,_0x3f1e0b,_0x4cbfce){var _0x326ef9=_0x443cde||_0xd5b7('0xd');return path['join'](_0x326ef9,util[_0xd5b7('0xe')](_0xd5b7('0xf'),_0x3f1e0b,_0x4cbfce));}function formatter(_0xe20b48,_0x3469aa){_0x3469aa[_0xd5b7('0x10')]=_0x3469aa[_0xd5b7('0x10')]['replace'](/@@{/g,'{{{')[_0xd5b7('0x11')](/}@@/g,_0xd5b7('0x12'))[_0xd5b7('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xd5b7('0xe')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xd5b7('0xe')](_0xd5b7('0x13')),_0x3469aa[_0xd5b7('0x14')]['toUpperCase'](),_0xe20b48,_0x3469aa[_0xd5b7('0x10')]);}function fileFormat(_0x3862a2,_0x159b97){_0x159b97[_0xd5b7('0x10')]=_0x159b97['message'][_0xd5b7('0x11')](/@@{/g,_0xd5b7('0x15'))['replace'](/}@@/g,_0xd5b7('0x12'))['replace'](/@{/g,'{{')[_0xd5b7('0x11')](/}@/g,'}}');var _0x593208=_0x159b97[_0xd5b7('0x16')]&&Object[_0xd5b7('0x17')](_0x159b97[_0xd5b7('0x16')])[_0xd5b7('0x18')]?'\x0a\x09'+JSON[_0xd5b7('0x19')](_0x159b97[_0xd5b7('0x16')]):'';return util[_0xd5b7('0xe')](_0xd5b7('0x1a'),moment()[_0xd5b7('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),_0x159b97[_0xd5b7('0x14')][_0xd5b7('0x1b')](),_0x3862a2,_0x159b97[_0xd5b7('0x10')],_0x593208);}function consoleLogger(){var _0xbf6b62=new winston[(_0xd5b7('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xd5b7('0x1d'))][(_0xd5b7('0x1e'))]({'level':_0xd5b7('0x1f'),'json':![],'formatter':function(_0x473157){return formatter('',_0x473157);}})]});return _0xbf6b62;}function fileLogger(_0x6cf844,_0x3fe743){var _0x10c1b8=new winston[(_0xd5b7('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xd5b7('0x1d'))]['File']({'name':util['format']('%s-%s',_0x6cf844,_0xd5b7('0x20')),'filename':getLogFileName(_0x3fe743,_0x6cf844,_0xd5b7('0x20')),'level':_0xd5b7('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2e7536){return fileFormat(_0x6cf844,_0x2e7536);}}),new winston[(_0xd5b7('0x1d'))][(_0xd5b7('0x21'))]({'name':util['format'](_0xd5b7('0x22'),_0x6cf844,debugLevel),'filename':getLogFileName(_0x3fe743,_0x6cf844,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x317583){return fileFormat(_0x6cf844,_0x317583);}}),new winston[(_0xd5b7('0x1d'))][(_0xd5b7('0x1e'))]({'level':_0xd5b7('0x1f'),'json':![],'formatter':function(_0x4961a7){return fileFormat(_0x6cf844,_0x4961a7);}})]});return _0x10c1b8;}exports['consoleLogger']=consoleLogger;exports[_0xd5b7('0x23')]=fileLogger; \ No newline at end of file +var _0x15c6=['stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','warn','transports','File','error','%s-%s','Console','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','format','%s-%s.log','message','{{{','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','meta','keys'];(function(_0x5888d0,_0x2074ce){var _0x478a16=function(_0x110ca8){while(--_0x110ca8){_0x5888d0['push'](_0x5888d0['shift']());}};_0x478a16(++_0x2074ce);}(_0x15c6,0xea));var _0x615c=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x15c6[_0x4e7d25];return _0x526fe6;};'use strict';var path=require(_0x615c('0x0'));var util=require(_0x615c('0x1'));var moment=require(_0x615c('0x2'));var winston=require(_0x615c('0x3'));var config=require(_0x615c('0x4'));var debugLevel=config['debugLevel']?config['debugLevel'][_0x615c('0x5')]():_0x615c('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x615c('0x7'),'error':_0x615c('0x8'),'warn':_0x615c('0x9'),'info':_0x615c('0xa'),'print':'bold\x20white','success':_0x615c('0xb'),'http':_0x615c('0xc'),'verbose':_0x615c('0xd'),'debug':_0x615c('0xe'),'silly':_0x615c('0xf')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x45ff22,_0x3130cb,_0x52e002){var _0x4c91fd=_0x45ff22||'/var/log/xcally';return path['join'](_0x4c91fd,util[_0x615c('0x10')](_0x615c('0x11'),_0x3130cb,_0x52e002));}function formatter(_0x1f819b,_0x486f0b){_0x486f0b[_0x615c('0x12')]=_0x486f0b[_0x615c('0x12')]['replace'](/@@{/g,_0x615c('0x13'))[_0x615c('0x14')](/}@@/g,_0x615c('0x15'))[_0x615c('0x14')](/@{/g,'{{')[_0x615c('0x14')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x615c('0x10')](_0x615c('0x16')),_0x486f0b['level']['toUpperCase'](),_0x1f819b,_0x486f0b[_0x615c('0x12')]);}function fileFormat(_0x2bc867,_0x16b86c){_0x16b86c[_0x615c('0x12')]=_0x16b86c['message'][_0x615c('0x14')](/@@{/g,_0x615c('0x13'))[_0x615c('0x14')](/}@@/g,_0x615c('0x15'))[_0x615c('0x14')](/@{/g,'{{')[_0x615c('0x14')](/}@/g,'}}');var _0x56cabc=_0x16b86c[_0x615c('0x17')]&&Object[_0x615c('0x18')](_0x16b86c['meta'])['length']?'\x0a\x09'+JSON[_0x615c('0x19')](_0x16b86c[_0x615c('0x17')]):'';return util['format'](_0x615c('0x1a'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x16b86c['level'][_0x615c('0x1b')](),_0x2bc867,_0x16b86c[_0x615c('0x12')],_0x56cabc);}function consoleLogger(){var _0x533412=new winston[(_0x615c('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':_0x615c('0x1d'),'json':![],'formatter':function(_0x37e638){return formatter('',_0x37e638);}})]});return _0x533412;}function fileLogger(_0x4830fe,_0x316555){var _0x3fc7ff=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x615c('0x1e'))][(_0x615c('0x1f'))]({'name':util[_0x615c('0x10')]('%s-%s',_0x4830fe,_0x615c('0x20')),'filename':getLogFileName(_0x316555,_0x4830fe,_0x615c('0x20')),'level':_0x615c('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x455d29){return fileFormat(_0x4830fe,_0x455d29);}}),new winston[(_0x615c('0x1e'))][(_0x615c('0x1f'))]({'name':util['format'](_0x615c('0x21'),_0x4830fe,debugLevel),'filename':getLogFileName(_0x316555,_0x4830fe,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x281f40){return fileFormat(_0x4830fe,_0x281f40);}}),new winston[(_0x615c('0x1e'))][(_0x615c('0x22'))]({'level':'warn','json':![],'formatter':function(_0x35f638){return fileFormat(_0x4830fe,_0x35f638);}})]});return _0x3fc7ff;}exports[_0x615c('0x23')]=consoleLogger;exports[_0x615c('0x24')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 305a6d8..8acd4ba 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','exports','maskSensitiveData','lodash','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdb28,0x106));var _0x8db2=function(_0x3060c2,_0x1e0763){_0x3060c2=_0x3060c2-0x0;var _0x54c601=_0xdb28[_0x3060c2];return _0x54c601;};var _=require(_0x8db2('0x0'));var sensitiveFields=[_0x8db2('0x1'),_0x8db2('0x2'),_0x8db2('0x3'),'apiKey',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'fax',_0x8db2('0x9'),_0x8db2('0xa'),'clientSecret','securityToken',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'authToken',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'calleridname',_0x8db2('0x15'),_0x8db2('0x16'),'vidaooApiKey',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'user','pass',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21')];function maskSensitiveData(_0x2f177a){const _0x3c96a7=/(?!^)[\s\S](?!$)/g;if(_[_0x8db2('0x22')](_0x2f177a)){for(const _0x16c8c2 in _0x2f177a){if(_['isArray'](_0x2f177a[_0x16c8c2])){for(let _0x13b0f5=0x0;_0x13b0f5<_0x2f177a[_0x16c8c2][_0x8db2('0x23')];_0x13b0f5++){maskSensitiveData(_0x2f177a[_0x16c8c2][_0x13b0f5]);}}else if(_['isPlainObject'](_0x2f177a[_0x16c8c2])){maskSensitiveData(_0x2f177a[_0x16c8c2]);}else if(_[_0x8db2('0x24')](_0x2f177a[_0x16c8c2])){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](/{{{/g,_0x8db2('0x26'))[_0x8db2('0x25')](/}}}/g,_0x8db2('0x27'))[_0x8db2('0x25')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x16c8c2)){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](_0x3c96a7,'*');}}}}}module[_0x8db2('0x28')][_0x8db2('0x29')]=maskSensitiveData; \ No newline at end of file +var _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x57e7c4,_0x22a6f5){_0x57e7c4=_0x57e7c4-0x0;var _0x27b8cb=_0x7a54[_0x57e7c4];return _0x27b8cb;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 3397d50..fae88bb 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 _0x8e3f=['reduce','exports','safeTemplate','lodash','{\x20{\x20','string','isArray','map','isPlainObject','keys'];(function(_0xcbbd0e,_0x2ce77d){var _0x75e716=function(_0x477525){while(--_0x477525){_0xcbbd0e['push'](_0xcbbd0e['shift']());}};_0x75e716(++_0x2ce77d);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};var _=require(_0xf8e3('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x42db69){return _0x42db69==='{{'?_0xf8e3('0x1'):'\x20}\x20}';}function safeTemplate(_0x3f3440){var _0x292de5=_0x3f3440;if(typeof _0x3f3440===_0xf8e3('0x2')){_0x292de5=_0x3f3440['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xf8e3('0x3')](_0x3f3440)){_0x292de5=_0x3f3440[_0xf8e3('0x4')](function(_0x4dab56){return safeTemplate(_0x4dab56);});}else if(_[_0xf8e3('0x5')](_0x3f3440)){_0x292de5=Object[_0xf8e3('0x6')](_0x3f3440)[_0xf8e3('0x7')](function(_0x1ee9f3,_0x4e9e57){_0x1ee9f3[_0x4e9e57]=safeTemplate(_0x3f3440[_0x4e9e57]);return _0x1ee9f3;},{});}return _0x292de5;}module[_0xf8e3('0x8')][_0xf8e3('0x9')]=safeTemplate; \ No newline at end of file +var _0x80ed=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string'];(function(_0x2cbec0,_0x262fef){var _0x3d4101=function(_0x549a36){while(--_0x549a36){_0x2cbec0['push'](_0x2cbec0['shift']());}};_0x3d4101(++_0x262fef);}(_0x80ed,0x11c));var _0xd80e=function(_0x24c573,_0xbdf9c5){_0x24c573=_0x24c573-0x0;var _0x598860=_0x80ed[_0x24c573];return _0x598860;};var _=require(_0xd80e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5a14b2){return _0x5a14b2==='{{'?_0xd80e('0x1'):_0xd80e('0x2');}function safeTemplate(_0x4329e5){var _0x5052d7=_0x4329e5;if(typeof _0x4329e5===_0xd80e('0x3')){_0x5052d7=_0x4329e5[_0xd80e('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xd80e('0x5')](_0x4329e5)){_0x5052d7=_0x4329e5[_0xd80e('0x6')](function(_0x5ae6c6){return safeTemplate(_0x5ae6c6);});}else if(_[_0xd80e('0x7')](_0x4329e5)){_0x5052d7=Object[_0xd80e('0x8')](_0x4329e5)[_0xd80e('0x9')](function(_0x51c361,_0x411b3a){_0x51c361[_0x411b3a]=safeTemplate(_0x4329e5[_0x411b3a]);return _0x51c361;},{});}return _0x5052d7;}module[_0xd80e('0xa')][_0xd80e('0xb')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index aae7ef4..fe2e380 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ebb=['string','pathExists','then','readJSON','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','root','resolve','legacy-libs','isArray','apps','findIndex','name','motion2','env','NODE_PATH'];(function(_0xf8ca1a,_0xcd834a){var _0x5ac343=function(_0x2d15e6){while(--_0x2d15e6){_0xf8ca1a['push'](_0xf8ca1a['shift']());}};_0x5ac343(++_0xcd834a);}(_0x3ebb,0x86));var _0xb3eb=function(_0x372c49,_0x878312){_0x372c49=_0x372c49-0x0;var _0x5c6161=_0x3ebb[_0x372c49];return _0x5c6161;};var fs=require(_0xb3eb('0x0'));var path=require(_0xb3eb('0x1'));var config=require(_0xb3eb('0x2'));var root=config[_0xb3eb('0x3')];var APP_JSON_PATH=path[_0xb3eb('0x4')](root,'server/app.json');var NODEPATH=path[_0xb3eb('0x4')](root,_0xb3eb('0x5'));function setLegacyLibsNodeEnvPath(_0x44decb){let _0x20f313=![];if(Array[_0xb3eb('0x6')](_0x44decb['apps'])){var _0x4a4bfa=_0x44decb[_0xb3eb('0x7')][_0xb3eb('0x8')](function(_0x1639a3){return _0x1639a3[_0xb3eb('0x9')]===_0xb3eb('0xa');});if(_0x4a4bfa>-0x1){var _0x110e10=_0x44decb[_0xb3eb('0x7')][_0x4a4bfa];if(typeof _0x110e10[_0xb3eb('0xb')][_0xb3eb('0xc')]!==_0xb3eb('0xd')){_0x110e10['env'][_0xb3eb('0xc')]=NODEPATH;_0x20f313=!![];}}return{'appConfig':_0x44decb,'updated':_0x20f313};}}function updateAppConfig(_0x4a1639){return fs[_0xb3eb('0xe')](APP_JSON_PATH)[_0xb3eb('0xf')](function(_0x52d00a){if(_0x52d00a){return fs[_0xb3eb('0x10')](APP_JSON_PATH)['then'](function(_0x25a682){var _0x545bc3=setLegacyLibsNodeEnvPath(_0x25a682);if(_0x545bc3['updated']){_0x4a1639[_0xb3eb('0x11')](_0xb3eb('0x12'));return fs[_0xb3eb('0x13')](APP_JSON_PATH,_0x25a682,{'spaces':0x2});}else{return Promise[_0xb3eb('0x4')]();}});}else{return Promise[_0xb3eb('0x4')]();}});}module[_0xb3eb('0x14')]=updateAppConfig; \ No newline at end of file +var _0x4b30=['env','NODE_PATH','string','then','readJSON','info','Updating\x20app.json','exports','fs-extra','root','resolve','server/app.json','legacy-libs','apps','findIndex','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4b30,0x188));var _0x04b3=function(_0x119172,_0x3e83f2){_0x119172=_0x119172-0x0;var _0x1498a8=_0x4b30[_0x119172];return _0x1498a8;};var fs=require(_0x04b3('0x0'));var path=require('path');var config=require('../config/environment');var root=config[_0x04b3('0x1')];var APP_JSON_PATH=path[_0x04b3('0x2')](root,_0x04b3('0x3'));var NODEPATH=path[_0x04b3('0x2')](root,_0x04b3('0x4'));function setLegacyLibsNodeEnvPath(_0x2cbde6){let _0x389690=![];if(Array['isArray'](_0x2cbde6[_0x04b3('0x5')])){var _0x47101a=_0x2cbde6['apps'][_0x04b3('0x6')](function(_0x15c72c){return _0x15c72c[_0x04b3('0x7')]==='motion2';});if(_0x47101a>-0x1){var _0x24ef05=_0x2cbde6[_0x04b3('0x5')][_0x47101a];if(typeof _0x24ef05[_0x04b3('0x8')][_0x04b3('0x9')]!==_0x04b3('0xa')){_0x24ef05[_0x04b3('0x8')][_0x04b3('0x9')]=NODEPATH;_0x389690=!![];}}return{'appConfig':_0x2cbde6,'updated':_0x389690};}}function updateAppConfig(_0x5e27d5){return fs['pathExists'](APP_JSON_PATH)[_0x04b3('0xb')](function(_0x3a7aa2){if(_0x3a7aa2){return fs[_0x04b3('0xc')](APP_JSON_PATH)[_0x04b3('0xb')](function(_0x54240b){var _0x3e82a9=setLegacyLibsNodeEnvPath(_0x54240b);if(_0x3e82a9['updated']){_0x5e27d5[_0x04b3('0xd')](_0x04b3('0xe'));return fs['writeJSON'](APP_JSON_PATH,_0x54240b,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise['resolve']();}});}module[_0x04b3('0xf')]=updateAppConfig; \ No newline at end of file -- 1.7.1